Repository: containers/skopeo Branch: main Commit: 529952e1a1a2 Files: 3210 Total size: 37.2 MB Directory structure: gitextract_nfgi394f/ ├── .cirrus.yml ├── .fmf/ │ └── version ├── .github/ │ ├── renovate.json5 │ └── workflows/ │ ├── check_cirrus_cron.yml │ ├── issue_pr_lock.yml │ └── stale.yml ├── .gitignore ├── .golangci.yml ├── .packit.yaml ├── CODE-OF-CONDUCT.md ├── CONTRIBUTING.md ├── GOVERNANCE.md ├── LICENSE ├── MAINTAINERS.md ├── Makefile ├── OWNERS ├── README.md ├── ROADMAP.md ├── SECURITY.md ├── cmd/ │ └── skopeo/ │ ├── completions.go │ ├── copy.go │ ├── copy_test.go │ ├── delete.go │ ├── fixtures/ │ │ ├── .gitignore │ │ ├── corrupt.signature │ │ ├── empty.passphrase │ │ ├── image.manifest.json │ │ ├── image.signature │ │ ├── pubring.gpg │ │ ├── secring.gpg │ │ ├── trustdb.gpg │ │ └── v2s1-invalid-signatures.manifest.json │ ├── generate_sigstore_key.go │ ├── generate_sigstore_key_test.go │ ├── inspect/ │ │ └── output.go │ ├── inspect.go │ ├── layers.go │ ├── list_tags.go │ ├── list_tags_test.go │ ├── login.go │ ├── login_test.go │ ├── logout.go │ ├── logout_test.go │ ├── main.go │ ├── main_test.go │ ├── manifest.go │ ├── manifest_test.go │ ├── proxy.go │ ├── proxy_windows.go │ ├── signing.go │ ├── signing_test.go │ ├── sync.go │ ├── sync_test.go │ ├── unshare.go │ ├── unshare_linux.go │ ├── utils.go │ ├── utils_nosequoia_test.go │ ├── utils_sequoia_test.go │ └── utils_test.go ├── contrib/ │ ├── cirrus/ │ │ ├── mac_cleanup.sh │ │ ├── ostree_ext.dockerfile │ │ └── runner.sh │ └── skopeoimage/ │ └── README.md ├── default-policy.json ├── default.yaml ├── docs/ │ ├── skopeo-copy.1.md │ ├── skopeo-delete.1.md │ ├── skopeo-generate-sigstore-key.1.md │ ├── skopeo-inspect.1.md │ ├── skopeo-list-tags.1.md │ ├── skopeo-login.1.md │ ├── skopeo-logout.1.md │ ├── skopeo-manifest-digest.1.md │ ├── skopeo-standalone-sign.1.md │ ├── skopeo-standalone-verify.1.md │ ├── skopeo-sync.1.md │ └── skopeo.1.md ├── docs-experimental/ │ └── skopeo-experimental-image-proxy.1.md ├── go.mod ├── go.sum ├── hack/ │ ├── btrfs_installed_tag.sh │ ├── get_ci_vm.sh │ ├── get_fqin.sh │ ├── libsubid_tag.sh │ ├── man-page-checker │ ├── sqlite_tag.sh │ ├── test-system.sh │ ├── tree_status.sh │ ├── validate-git-marks.sh │ ├── validate-vet.sh │ ├── warn-destructive-tests.sh │ └── xref-helpmsgs-manpages ├── install.md ├── integration/ │ ├── blocked_test.go │ ├── check_test.go │ ├── copy_test.go │ ├── fixtures/ │ │ ├── .gitignore │ │ ├── blocked-registries.conf │ │ ├── data/ │ │ │ ├── keystore/ │ │ │ │ ├── keystore.cookie │ │ │ │ └── softkeys/ │ │ │ │ ├── 1F5825285B785E1DB13BF36D2D11A19ABA41C6AE.pgp │ │ │ │ └── 50DDE898DF4E48755C8C2B7AF6F908B6FA48A229.pgp │ │ │ └── pgp.cert.d/ │ │ │ ├── 1f/ │ │ │ │ └── 5825285b785e1db13bf36d2d11a19aba41c6ae │ │ │ ├── 4d/ │ │ │ │ └── 8bcd544b7573eefaad18c278473e5f255d10b8 │ │ │ ├── 50/ │ │ │ │ └── dde898df4e48755c8c2b7af6f908b6fa48a229 │ │ │ ├── 68/ │ │ │ │ └── de230c4a009f5ee5fbb27984642d0130b86046 │ │ │ ├── trust-root │ │ │ └── writelock │ │ ├── image.manifest.json │ │ ├── no-passphrase.pub │ │ ├── policy.json │ │ ├── registries.conf │ │ ├── registries.yaml │ │ ├── tls-details-1.3.yaml │ │ ├── tls-details-anything.yaml │ │ ├── tls-details-pqc-only.yaml │ │ ├── uncompressed-image-s1/ │ │ │ ├── 160d823fdc48e62f97ba62df31e55424f8f5eb6b679c865eec6e59adfe304710 │ │ │ └── manifest.json │ │ ├── uncompressed-image-s2/ │ │ │ ├── 160d823fdc48e62f97ba62df31e55424f8f5eb6b679c865eec6e59adfe304710 │ │ │ ├── 86ce150e65c72b30f885c261449d18b7c6832596916e7f654e08377b5a67b4ff │ │ │ └── manifest.json │ │ ├── with-passphrase.passphrase │ │ └── with-passphrase.pub │ ├── fixtures_info_test.go │ ├── openshift_shell_test.go │ ├── openshift_test.go │ ├── procutils_linux_test.go │ ├── procutils_test.go │ ├── proxy_test.go │ ├── registry_test.go │ ├── signing_test.go │ ├── sync_test.go │ ├── tls_test.go │ ├── user_agent_test.go │ └── utils_test.go ├── plans/ │ └── main.fmf ├── rpm/ │ └── skopeo.spec ├── systemtest/ │ ├── 001-basic.bats │ ├── 010-inspect.bats │ ├── 020-copy.bats │ ├── 030-local-registry-tls.bats │ ├── 040-local-registry-auth.bats │ ├── 050-signing.bats │ ├── 060-delete.bats │ ├── 070-list-tags.bats │ ├── 080-sync.bats │ ├── helpers.bash │ ├── make-noarch-manifest │ ├── run-tests │ ├── testdata/ │ │ ├── busybox_latest.sif │ │ └── docker-two-images.tar.xz │ └── tmt/ │ └── main.fmf ├── vendor/ │ ├── cyphar.com/ │ │ └── go-pathrs/ │ │ ├── .golangci.yml │ │ ├── COPYING │ │ ├── doc.go │ │ ├── handle_linux.go │ │ ├── internal/ │ │ │ ├── fdutils/ │ │ │ │ └── fd_linux.go │ │ │ └── libpathrs/ │ │ │ ├── error_unix.go │ │ │ └── libpathrs_linux.go │ │ ├── procfs/ │ │ │ └── procfs_linux.go │ │ ├── root_linux.go │ │ └── utils_linux.go │ ├── dario.cat/ │ │ └── mergo/ │ │ ├── .deepsource.toml │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── CODE_OF_CONDUCT.md │ │ ├── CONTRIBUTING.md │ │ ├── FUNDING.json │ │ ├── LICENSE │ │ ├── README.md │ │ ├── SECURITY.md │ │ ├── doc.go │ │ ├── map.go │ │ ├── merge.go │ │ └── mergo.go │ ├── github.com/ │ │ ├── BurntSushi/ │ │ │ └── toml/ │ │ │ ├── .gitignore │ │ │ ├── COPYING │ │ │ ├── README.md │ │ │ ├── decode.go │ │ │ ├── deprecated.go │ │ │ ├── doc.go │ │ │ ├── encode.go │ │ │ ├── error.go │ │ │ ├── internal/ │ │ │ │ └── tz.go │ │ │ ├── lex.go │ │ │ ├── meta.go │ │ │ ├── parse.go │ │ │ ├── type_fields.go │ │ │ └── type_toml.go │ │ ├── Masterminds/ │ │ │ └── semver/ │ │ │ └── v3/ │ │ │ ├── .gitignore │ │ │ ├── .golangci.yml │ │ │ ├── CHANGELOG.md │ │ │ ├── LICENSE.txt │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── SECURITY.md │ │ │ ├── collection.go │ │ │ ├── constraints.go │ │ │ ├── doc.go │ │ │ └── version.go │ │ ├── Microsoft/ │ │ │ └── go-winio/ │ │ │ ├── .gitattributes │ │ │ ├── .gitignore │ │ │ ├── .golangci.yml │ │ │ ├── CODEOWNERS │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── SECURITY.md │ │ │ ├── backup.go │ │ │ ├── doc.go │ │ │ ├── ea.go │ │ │ ├── file.go │ │ │ ├── fileinfo.go │ │ │ ├── hvsock.go │ │ │ ├── internal/ │ │ │ │ ├── fs/ │ │ │ │ │ ├── doc.go │ │ │ │ │ ├── fs.go │ │ │ │ │ ├── security.go │ │ │ │ │ └── zsyscall_windows.go │ │ │ │ ├── socket/ │ │ │ │ │ ├── rawaddr.go │ │ │ │ │ ├── socket.go │ │ │ │ │ └── zsyscall_windows.go │ │ │ │ └── stringbuffer/ │ │ │ │ └── wstring.go │ │ │ ├── pipe.go │ │ │ ├── pkg/ │ │ │ │ └── guid/ │ │ │ │ ├── guid.go │ │ │ │ ├── guid_nonwindows.go │ │ │ │ ├── guid_windows.go │ │ │ │ └── variant_string.go │ │ │ ├── privilege.go │ │ │ ├── reparse.go │ │ │ ├── sd.go │ │ │ ├── syscall.go │ │ │ └── zsyscall_windows.go │ │ ├── VividCortex/ │ │ │ └── ewma/ │ │ │ ├── .gitignore │ │ │ ├── .whitesource │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── codecov.yml │ │ │ └── ewma.go │ │ ├── acarl005/ │ │ │ └── stripansi/ │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ └── stripansi.go │ │ ├── cespare/ │ │ │ └── xxhash/ │ │ │ └── v2/ │ │ │ ├── LICENSE.txt │ │ │ ├── README.md │ │ │ ├── testall.sh │ │ │ ├── xxhash.go │ │ │ ├── xxhash_amd64.s │ │ │ ├── xxhash_arm64.s │ │ │ ├── xxhash_asm.go │ │ │ ├── xxhash_other.go │ │ │ ├── xxhash_safe.go │ │ │ └── xxhash_unsafe.go │ │ ├── clipperhouse/ │ │ │ └── uax29/ │ │ │ └── v2/ │ │ │ ├── LICENSE │ │ │ └── graphemes/ │ │ │ ├── README.md │ │ │ ├── ansi.go │ │ │ ├── ansi8.go │ │ │ ├── iterator.go │ │ │ ├── reader.go │ │ │ ├── splitfunc.go │ │ │ └── trie.go │ │ ├── containerd/ │ │ │ ├── errdefs/ │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── errors.go │ │ │ │ ├── pkg/ │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── errhttp/ │ │ │ │ │ │ └── http.go │ │ │ │ │ └── internal/ │ │ │ │ │ └── cause/ │ │ │ │ │ └── cause.go │ │ │ │ └── resolve.go │ │ │ └── stargz-snapshotter/ │ │ │ └── estargz/ │ │ │ ├── LICENSE │ │ │ ├── build.go │ │ │ ├── errorutil/ │ │ │ │ └── errors.go │ │ │ ├── estargz.go │ │ │ ├── gzip.go │ │ │ ├── testutil.go │ │ │ └── types.go │ │ ├── containers/ │ │ │ ├── libtrust/ │ │ │ │ ├── CODE-OF-CONDUCT.md │ │ │ │ ├── CONTRIBUTING.md │ │ │ │ ├── LICENSE │ │ │ │ ├── MAINTAINERS │ │ │ │ ├── README.md │ │ │ │ ├── SECURITY.md │ │ │ │ ├── certificates.go │ │ │ │ ├── doc.go │ │ │ │ ├── ec_key.go │ │ │ │ ├── ec_key_no_openssl.go │ │ │ │ ├── ec_key_openssl.go │ │ │ │ ├── filter.go │ │ │ │ ├── hash.go │ │ │ │ ├── jsonsign.go │ │ │ │ ├── key.go │ │ │ │ ├── key_files.go │ │ │ │ ├── key_manager.go │ │ │ │ ├── rsa_key.go │ │ │ │ └── util.go │ │ │ └── ocicrypt/ │ │ │ ├── .gitignore │ │ │ ├── .golangci.yml │ │ │ ├── ADOPTERS.md │ │ │ ├── CODE-OF-CONDUCT.md │ │ │ ├── LICENSE │ │ │ ├── MAINTAINERS │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── SECURITY.md │ │ │ ├── blockcipher/ │ │ │ │ ├── blockcipher.go │ │ │ │ └── blockcipher_aes_ctr.go │ │ │ ├── config/ │ │ │ │ ├── config.go │ │ │ │ ├── constructors.go │ │ │ │ ├── keyprovider-config/ │ │ │ │ │ └── config.go │ │ │ │ └── pkcs11config/ │ │ │ │ └── config.go │ │ │ ├── crypto/ │ │ │ │ └── pkcs11/ │ │ │ │ ├── common.go │ │ │ │ ├── pkcs11helpers.go │ │ │ │ ├── pkcs11helpers_nocgo.go │ │ │ │ └── utils.go │ │ │ ├── encryption.go │ │ │ ├── gpg.go │ │ │ ├── gpgvault.go │ │ │ ├── helpers/ │ │ │ │ └── parse_helpers.go │ │ │ ├── keywrap/ │ │ │ │ ├── jwe/ │ │ │ │ │ └── keywrapper_jwe.go │ │ │ │ ├── keyprovider/ │ │ │ │ │ └── keyprovider.go │ │ │ │ ├── keywrap.go │ │ │ │ ├── pgp/ │ │ │ │ │ └── keywrapper_gpg.go │ │ │ │ ├── pkcs11/ │ │ │ │ │ └── keywrapper_pkcs11.go │ │ │ │ └── pkcs7/ │ │ │ │ └── keywrapper_pkcs7.go │ │ │ ├── reader.go │ │ │ ├── spec/ │ │ │ │ └── spec.go │ │ │ └── utils/ │ │ │ ├── delayedreader.go │ │ │ ├── ioutils.go │ │ │ ├── keyprovider/ │ │ │ │ ├── keyprovider.pb.go │ │ │ │ └── keyprovider.proto │ │ │ ├── testing.go │ │ │ └── utils.go │ │ ├── coreos/ │ │ │ └── go-oidc/ │ │ │ └── v3/ │ │ │ ├── LICENSE │ │ │ ├── NOTICE │ │ │ └── oidc/ │ │ │ ├── jose.go │ │ │ ├── jwks.go │ │ │ ├── oidc.go │ │ │ └── verify.go │ │ ├── cyberphone/ │ │ │ └── json-canonicalization/ │ │ │ ├── LICENSE │ │ │ └── go/ │ │ │ └── src/ │ │ │ └── webpki.org/ │ │ │ └── jsoncanonicalizer/ │ │ │ ├── es6numfmt.go │ │ │ └── jsoncanonicalizer.go │ │ ├── cyphar/ │ │ │ └── filepath-securejoin/ │ │ │ ├── .golangci.yml │ │ │ ├── CHANGELOG.md │ │ │ ├── COPYING.md │ │ │ ├── LICENSE.BSD │ │ │ ├── LICENSE.MPL-2.0 │ │ │ ├── README.md │ │ │ ├── VERSION │ │ │ ├── codecov.yml │ │ │ ├── doc.go │ │ │ ├── internal/ │ │ │ │ └── consts/ │ │ │ │ └── consts.go │ │ │ ├── join.go │ │ │ ├── pathrs-lite/ │ │ │ │ ├── README.md │ │ │ │ ├── doc.go │ │ │ │ ├── internal/ │ │ │ │ │ ├── assert/ │ │ │ │ │ │ └── assert.go │ │ │ │ │ ├── errors_linux.go │ │ │ │ │ ├── fd/ │ │ │ │ │ │ ├── at_linux.go │ │ │ │ │ │ ├── fd.go │ │ │ │ │ │ ├── fd_linux.go │ │ │ │ │ │ ├── mount_linux.go │ │ │ │ │ │ └── openat2_linux.go │ │ │ │ │ ├── gocompat/ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── doc.go │ │ │ │ │ │ ├── gocompat_atomic_go119.go │ │ │ │ │ │ ├── gocompat_atomic_unsupported.go │ │ │ │ │ │ ├── gocompat_errors_go120.go │ │ │ │ │ │ ├── gocompat_errors_unsupported.go │ │ │ │ │ │ ├── gocompat_generics_go121.go │ │ │ │ │ │ └── gocompat_generics_unsupported.go │ │ │ │ │ ├── gopathrs/ │ │ │ │ │ │ ├── doc.go │ │ │ │ │ │ ├── lookup_linux.go │ │ │ │ │ │ ├── mkdir_linux.go │ │ │ │ │ │ ├── open_linux.go │ │ │ │ │ │ └── openat2_linux.go │ │ │ │ │ ├── kernelversion/ │ │ │ │ │ │ └── kernel_linux.go │ │ │ │ │ ├── linux/ │ │ │ │ │ │ ├── doc.go │ │ │ │ │ │ ├── mount_linux.go │ │ │ │ │ │ └── openat2_linux.go │ │ │ │ │ └── procfs/ │ │ │ │ │ ├── procfs_linux.go │ │ │ │ │ └── procfs_lookup_linux.go │ │ │ │ ├── mkdir.go │ │ │ │ ├── mkdir_libpathrs.go │ │ │ │ ├── mkdir_purego.go │ │ │ │ ├── open.go │ │ │ │ ├── open_libpathrs.go │ │ │ │ ├── open_purego.go │ │ │ │ └── procfs/ │ │ │ │ ├── procfs_libpathrs.go │ │ │ │ └── procfs_purego.go │ │ │ └── vfs.go │ │ ├── davecgh/ │ │ │ └── go-spew/ │ │ │ ├── LICENSE │ │ │ └── spew/ │ │ │ ├── bypass.go │ │ │ ├── bypasssafe.go │ │ │ ├── common.go │ │ │ ├── config.go │ │ │ ├── doc.go │ │ │ ├── dump.go │ │ │ ├── format.go │ │ │ └── spew.go │ │ ├── distribution/ │ │ │ └── reference/ │ │ │ ├── .gitattributes │ │ │ ├── .gitignore │ │ │ ├── .golangci.yml │ │ │ ├── CODE-OF-CONDUCT.md │ │ │ ├── CONTRIBUTING.md │ │ │ ├── GOVERNANCE.md │ │ │ ├── LICENSE │ │ │ ├── MAINTAINERS │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── SECURITY.md │ │ │ ├── helpers.go │ │ │ ├── normalize.go │ │ │ ├── reference.go │ │ │ ├── regexp.go │ │ │ └── sort.go │ │ ├── docker/ │ │ │ ├── distribution/ │ │ │ │ ├── LICENSE │ │ │ │ └── registry/ │ │ │ │ └── api/ │ │ │ │ ├── errcode/ │ │ │ │ │ ├── errors.go │ │ │ │ │ ├── handler.go │ │ │ │ │ └── register.go │ │ │ │ └── v2/ │ │ │ │ ├── descriptors.go │ │ │ │ ├── doc.go │ │ │ │ ├── errors.go │ │ │ │ ├── headerparser.go │ │ │ │ ├── routes.go │ │ │ │ └── urls.go │ │ │ ├── docker-credential-helpers/ │ │ │ │ ├── LICENSE │ │ │ │ ├── client/ │ │ │ │ │ ├── client.go │ │ │ │ │ └── command.go │ │ │ │ └── credentials/ │ │ │ │ ├── credentials.go │ │ │ │ ├── error.go │ │ │ │ ├── helper.go │ │ │ │ └── version.go │ │ │ ├── go-connections/ │ │ │ │ ├── LICENSE │ │ │ │ ├── sockets/ │ │ │ │ │ ├── inmem_socket.go │ │ │ │ │ ├── proxy.go │ │ │ │ │ ├── sockets.go │ │ │ │ │ ├── sockets_unix.go │ │ │ │ │ ├── sockets_windows.go │ │ │ │ │ ├── tcp_socket.go │ │ │ │ │ ├── unix_socket.go │ │ │ │ │ ├── unix_socket_unix.go │ │ │ │ │ └── unix_socket_windows.go │ │ │ │ └── tlsconfig/ │ │ │ │ ├── certpool.go │ │ │ │ └── config.go │ │ │ └── go-units/ │ │ │ ├── CONTRIBUTING.md │ │ │ ├── LICENSE │ │ │ ├── MAINTAINERS │ │ │ ├── README.md │ │ │ ├── circle.yml │ │ │ ├── duration.go │ │ │ ├── size.go │ │ │ └── ulimit.go │ │ ├── felixge/ │ │ │ └── httpsnoop/ │ │ │ ├── .gitignore │ │ │ ├── LICENSE.txt │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── capture_metrics.go │ │ │ ├── docs.go │ │ │ ├── wrap_generated_gteq_1.8.go │ │ │ └── wrap_generated_lt_1.8.go │ │ ├── go-jose/ │ │ │ └── go-jose/ │ │ │ └── v4/ │ │ │ ├── .gitignore │ │ │ ├── .golangci.yml │ │ │ ├── .travis.yml │ │ │ ├── CONTRIBUTING.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── SECURITY.md │ │ │ ├── asymmetric.go │ │ │ ├── cipher/ │ │ │ │ ├── cbc_hmac.go │ │ │ │ ├── concat_kdf.go │ │ │ │ ├── ecdh_es.go │ │ │ │ └── key_wrap.go │ │ │ ├── crypter.go │ │ │ ├── doc.go │ │ │ ├── encoding.go │ │ │ ├── json/ │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── decode.go │ │ │ │ ├── encode.go │ │ │ │ ├── indent.go │ │ │ │ ├── scanner.go │ │ │ │ ├── stream.go │ │ │ │ └── tags.go │ │ │ ├── jwe.go │ │ │ ├── jwk.go │ │ │ ├── jws.go │ │ │ ├── opaque.go │ │ │ ├── shared.go │ │ │ ├── signing.go │ │ │ └── symmetric.go │ │ ├── go-logr/ │ │ │ ├── logr/ │ │ │ │ ├── .golangci.yaml │ │ │ │ ├── CHANGELOG.md │ │ │ │ ├── CONTRIBUTING.md │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── SECURITY.md │ │ │ │ ├── context.go │ │ │ │ ├── context_noslog.go │ │ │ │ ├── context_slog.go │ │ │ │ ├── discard.go │ │ │ │ ├── funcr/ │ │ │ │ │ ├── funcr.go │ │ │ │ │ └── slogsink.go │ │ │ │ ├── logr.go │ │ │ │ ├── sloghandler.go │ │ │ │ ├── slogr.go │ │ │ │ └── slogsink.go │ │ │ └── stdr/ │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ └── stdr.go │ │ ├── golang/ │ │ │ └── protobuf/ │ │ │ ├── AUTHORS │ │ │ ├── CONTRIBUTORS │ │ │ ├── LICENSE │ │ │ └── proto/ │ │ │ ├── buffer.go │ │ │ ├── defaults.go │ │ │ ├── deprecated.go │ │ │ ├── discard.go │ │ │ ├── extensions.go │ │ │ ├── properties.go │ │ │ ├── proto.go │ │ │ ├── registry.go │ │ │ ├── text_decode.go │ │ │ ├── text_encode.go │ │ │ ├── wire.go │ │ │ └── wrappers.go │ │ ├── google/ │ │ │ ├── go-containerregistry/ │ │ │ │ ├── LICENSE │ │ │ │ └── pkg/ │ │ │ │ ├── name/ │ │ │ │ │ ├── README.md │ │ │ │ │ ├── check.go │ │ │ │ │ ├── digest.go │ │ │ │ │ ├── doc.go │ │ │ │ │ ├── errors.go │ │ │ │ │ ├── options.go │ │ │ │ │ ├── ref.go │ │ │ │ │ ├── registry.go │ │ │ │ │ ├── repository.go │ │ │ │ │ └── tag.go │ │ │ │ └── v1/ │ │ │ │ ├── config.go │ │ │ │ ├── doc.go │ │ │ │ ├── hash.go │ │ │ │ ├── image.go │ │ │ │ ├── index.go │ │ │ │ ├── layer.go │ │ │ │ ├── manifest.go │ │ │ │ ├── platform.go │ │ │ │ ├── progress.go │ │ │ │ ├── types/ │ │ │ │ │ └── types.go │ │ │ │ └── zz_deepcopy_generated.go │ │ │ ├── go-intervals/ │ │ │ │ ├── LICENSE │ │ │ │ └── intervalset/ │ │ │ │ ├── intervalset.go │ │ │ │ └── intervalset_immutable.go │ │ │ └── uuid/ │ │ │ ├── CHANGELOG.md │ │ │ ├── CONTRIBUTING.md │ │ │ ├── CONTRIBUTORS │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── dce.go │ │ │ ├── doc.go │ │ │ ├── hash.go │ │ │ ├── marshal.go │ │ │ ├── node.go │ │ │ ├── node_js.go │ │ │ ├── node_net.go │ │ │ ├── null.go │ │ │ ├── sql.go │ │ │ ├── time.go │ │ │ ├── util.go │ │ │ ├── uuid.go │ │ │ ├── version1.go │ │ │ ├── version4.go │ │ │ ├── version6.go │ │ │ └── version7.go │ │ ├── gorilla/ │ │ │ └── mux/ │ │ │ ├── .editorconfig │ │ │ ├── .gitignore │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── doc.go │ │ │ ├── middleware.go │ │ │ ├── mux.go │ │ │ ├── regexp.go │ │ │ ├── route.go │ │ │ └── test_helpers.go │ │ ├── hashicorp/ │ │ │ ├── go-cleanhttp/ │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── cleanhttp.go │ │ │ │ ├── doc.go │ │ │ │ └── handlers.go │ │ │ ├── go-multierror/ │ │ │ │ ├── .go-version │ │ │ │ ├── CODEOWNERS │ │ │ │ ├── LICENSE │ │ │ │ ├── Makefile │ │ │ │ ├── README.md │ │ │ │ ├── append.go │ │ │ │ ├── flatten.go │ │ │ │ ├── format.go │ │ │ │ ├── group.go │ │ │ │ ├── multierror.go │ │ │ │ ├── prefix.go │ │ │ │ └── sort.go │ │ │ └── go-retryablehttp/ │ │ │ ├── .gitignore │ │ │ ├── .go-version │ │ │ ├── .golangci.yml │ │ │ ├── CHANGELOG.md │ │ │ ├── CODEOWNERS │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── cert_error_go119.go │ │ │ ├── cert_error_go120.go │ │ │ ├── client.go │ │ │ └── roundtripper.go │ │ ├── inconshreveable/ │ │ │ └── mousetrap/ │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── trap_others.go │ │ │ └── trap_windows.go │ │ ├── klauspost/ │ │ │ ├── compress/ │ │ │ │ ├── .gitattributes │ │ │ │ ├── .gitignore │ │ │ │ ├── .goreleaser.yml │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── SECURITY.md │ │ │ │ ├── compressible.go │ │ │ │ ├── flate/ │ │ │ │ │ ├── deflate.go │ │ │ │ │ ├── dict_decoder.go │ │ │ │ │ ├── fast_encoder.go │ │ │ │ │ ├── huffman_bit_writer.go │ │ │ │ │ ├── huffman_code.go │ │ │ │ │ ├── huffman_sortByFreq.go │ │ │ │ │ ├── huffman_sortByLiteral.go │ │ │ │ │ ├── inflate.go │ │ │ │ │ ├── inflate_gen.go │ │ │ │ │ ├── level1.go │ │ │ │ │ ├── level2.go │ │ │ │ │ ├── level3.go │ │ │ │ │ ├── level4.go │ │ │ │ │ ├── level5.go │ │ │ │ │ ├── level6.go │ │ │ │ │ ├── matchlen_generic.go │ │ │ │ │ ├── regmask_amd64.go │ │ │ │ │ ├── regmask_other.go │ │ │ │ │ ├── stateless.go │ │ │ │ │ └── token.go │ │ │ │ ├── fse/ │ │ │ │ │ ├── README.md │ │ │ │ │ ├── bitreader.go │ │ │ │ │ ├── bitwriter.go │ │ │ │ │ ├── bytereader.go │ │ │ │ │ ├── compress.go │ │ │ │ │ ├── decompress.go │ │ │ │ │ └── fse.go │ │ │ │ ├── gen.sh │ │ │ │ ├── huff0/ │ │ │ │ │ ├── .gitignore │ │ │ │ │ ├── README.md │ │ │ │ │ ├── bitreader.go │ │ │ │ │ ├── bitwriter.go │ │ │ │ │ ├── compress.go │ │ │ │ │ ├── decompress.go │ │ │ │ │ ├── decompress_amd64.go │ │ │ │ │ ├── decompress_amd64.s │ │ │ │ │ ├── decompress_generic.go │ │ │ │ │ └── huff0.go │ │ │ │ ├── internal/ │ │ │ │ │ ├── cpuinfo/ │ │ │ │ │ │ ├── cpuinfo.go │ │ │ │ │ │ ├── cpuinfo_amd64.go │ │ │ │ │ │ └── cpuinfo_amd64.s │ │ │ │ │ ├── le/ │ │ │ │ │ │ ├── le.go │ │ │ │ │ │ ├── unsafe_disabled.go │ │ │ │ │ │ └── unsafe_enabled.go │ │ │ │ │ └── snapref/ │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── decode.go │ │ │ │ │ ├── decode_other.go │ │ │ │ │ ├── encode.go │ │ │ │ │ ├── encode_other.go │ │ │ │ │ └── snappy.go │ │ │ │ ├── s2sx.mod │ │ │ │ ├── s2sx.sum │ │ │ │ └── zstd/ │ │ │ │ ├── README.md │ │ │ │ ├── bitreader.go │ │ │ │ ├── bitwriter.go │ │ │ │ ├── blockdec.go │ │ │ │ ├── blockenc.go │ │ │ │ ├── blocktype_string.go │ │ │ │ ├── bytebuf.go │ │ │ │ ├── bytereader.go │ │ │ │ ├── decodeheader.go │ │ │ │ ├── decoder.go │ │ │ │ ├── decoder_options.go │ │ │ │ ├── dict.go │ │ │ │ ├── enc_base.go │ │ │ │ ├── enc_best.go │ │ │ │ ├── enc_better.go │ │ │ │ ├── enc_dfast.go │ │ │ │ ├── enc_fast.go │ │ │ │ ├── encoder.go │ │ │ │ ├── encoder_options.go │ │ │ │ ├── framedec.go │ │ │ │ ├── frameenc.go │ │ │ │ ├── fse_decoder.go │ │ │ │ ├── fse_decoder_amd64.go │ │ │ │ ├── fse_decoder_amd64.s │ │ │ │ ├── fse_decoder_generic.go │ │ │ │ ├── fse_encoder.go │ │ │ │ ├── fse_predefined.go │ │ │ │ ├── hash.go │ │ │ │ ├── history.go │ │ │ │ ├── internal/ │ │ │ │ │ └── xxhash/ │ │ │ │ │ ├── LICENSE.txt │ │ │ │ │ ├── README.md │ │ │ │ │ ├── xxhash.go │ │ │ │ │ ├── xxhash_amd64.s │ │ │ │ │ ├── xxhash_arm64.s │ │ │ │ │ ├── xxhash_asm.go │ │ │ │ │ ├── xxhash_other.go │ │ │ │ │ └── xxhash_safe.go │ │ │ │ ├── matchlen_amd64.go │ │ │ │ ├── matchlen_amd64.s │ │ │ │ ├── matchlen_generic.go │ │ │ │ ├── seqdec.go │ │ │ │ ├── seqdec_amd64.go │ │ │ │ ├── seqdec_amd64.s │ │ │ │ ├── seqdec_generic.go │ │ │ │ ├── seqenc.go │ │ │ │ ├── simple_go124.go │ │ │ │ ├── snappy.go │ │ │ │ ├── zip.go │ │ │ │ └── zstd.go │ │ │ └── pgzip/ │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ ├── GO_LICENSE │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── gunzip.go │ │ │ └── gzip.go │ │ ├── mattn/ │ │ │ ├── go-runewidth/ │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── benchstat.txt │ │ │ │ ├── new.txt │ │ │ │ ├── old.txt │ │ │ │ ├── runewidth.go │ │ │ │ ├── runewidth_appengine.go │ │ │ │ ├── runewidth_js.go │ │ │ │ ├── runewidth_posix.go │ │ │ │ ├── runewidth_table.go │ │ │ │ └── runewidth_windows.go │ │ │ └── go-sqlite3/ │ │ │ ├── .codecov.yml │ │ │ ├── .gitignore │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── backup.go │ │ │ ├── callback.go │ │ │ ├── convert.go │ │ │ ├── doc.go │ │ │ ├── error.go │ │ │ ├── sqlite3-binding.c │ │ │ ├── sqlite3-binding.h │ │ │ ├── sqlite3.go │ │ │ ├── sqlite3_context.go │ │ │ ├── sqlite3_func_crypt.go │ │ │ ├── sqlite3_go18.go │ │ │ ├── sqlite3_libsqlite3.go │ │ │ ├── sqlite3_load_extension.go │ │ │ ├── sqlite3_load_extension_omit.go │ │ │ ├── sqlite3_opt_allow_uri_authority.go │ │ │ ├── sqlite3_opt_app_armor.go │ │ │ ├── sqlite3_opt_column_metadata.go │ │ │ ├── sqlite3_opt_foreign_keys.go │ │ │ ├── sqlite3_opt_fts5.go │ │ │ ├── sqlite3_opt_icu.go │ │ │ ├── sqlite3_opt_introspect.go │ │ │ ├── sqlite3_opt_math_functions.go │ │ │ ├── sqlite3_opt_os_trace.go │ │ │ ├── sqlite3_opt_percentile.go │ │ │ ├── sqlite3_opt_preupdate.go │ │ │ ├── sqlite3_opt_preupdate_hook.go │ │ │ ├── sqlite3_opt_preupdate_omit.go │ │ │ ├── sqlite3_opt_secure_delete.go │ │ │ ├── sqlite3_opt_secure_delete_fast.go │ │ │ ├── sqlite3_opt_serialize.go │ │ │ ├── sqlite3_opt_serialize_omit.go │ │ │ ├── sqlite3_opt_stat4.go │ │ │ ├── sqlite3_opt_unlock_notify.c │ │ │ ├── sqlite3_opt_unlock_notify.go │ │ │ ├── sqlite3_opt_userauth.go │ │ │ ├── sqlite3_opt_userauth_omit.go │ │ │ ├── sqlite3_opt_vacuum_full.go │ │ │ ├── sqlite3_opt_vacuum_incr.go │ │ │ ├── sqlite3_opt_vtable.go │ │ │ ├── sqlite3_other.go │ │ │ ├── sqlite3_solaris.go │ │ │ ├── sqlite3_trace.go │ │ │ ├── sqlite3_type.go │ │ │ ├── sqlite3_usleep_windows.go │ │ │ ├── sqlite3_windows.go │ │ │ ├── sqlite3ext.h │ │ │ └── static_mock.go │ │ ├── miekg/ │ │ │ └── pkcs11/ │ │ │ ├── .gitignore │ │ │ ├── LICENSE │ │ │ ├── Makefile.release │ │ │ ├── README.md │ │ │ ├── error.go │ │ │ ├── params.go │ │ │ ├── pkcs11.go │ │ │ ├── pkcs11.h │ │ │ ├── pkcs11f.h │ │ │ ├── pkcs11go.h │ │ │ ├── pkcs11t.h │ │ │ ├── release.go │ │ │ ├── softhsm.conf │ │ │ ├── softhsm2.conf │ │ │ ├── types.go │ │ │ ├── vendor.go │ │ │ └── zconst.go │ │ ├── mistifyio/ │ │ │ └── go-zfs/ │ │ │ └── v4/ │ │ │ ├── .envrc │ │ │ ├── .gitignore │ │ │ ├── .golangci.yml │ │ │ ├── .yamllint │ │ │ ├── CHANGELOG.md │ │ │ ├── CONTRIBUTING.md │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── Vagrantfile │ │ │ ├── error.go │ │ │ ├── lint.mk │ │ │ ├── rules.mk │ │ │ ├── shell.nix │ │ │ ├── utils.go │ │ │ ├── utils_notsolaris.go │ │ │ ├── utils_solaris.go │ │ │ ├── zfs.go │ │ │ └── zpool.go │ │ ├── moby/ │ │ │ ├── docker-image-spec/ │ │ │ │ ├── LICENSE │ │ │ │ └── specs-go/ │ │ │ │ └── v1/ │ │ │ │ └── image.go │ │ │ ├── moby/ │ │ │ │ ├── api/ │ │ │ │ │ ├── LICENSE │ │ │ │ │ └── types/ │ │ │ │ │ ├── blkiodev/ │ │ │ │ │ │ └── blkio.go │ │ │ │ │ ├── build/ │ │ │ │ │ │ ├── build.go │ │ │ │ │ │ ├── cache.go │ │ │ │ │ │ └── disk_usage.go │ │ │ │ │ ├── checkpoint/ │ │ │ │ │ │ ├── create_request.go │ │ │ │ │ │ └── list.go │ │ │ │ │ ├── common/ │ │ │ │ │ │ ├── error_response.go │ │ │ │ │ │ ├── error_response_ext.go │ │ │ │ │ │ └── id_response.go │ │ │ │ │ ├── container/ │ │ │ │ │ │ ├── change_type.go │ │ │ │ │ │ ├── change_types.go │ │ │ │ │ │ ├── commit.go │ │ │ │ │ │ ├── config.go │ │ │ │ │ │ ├── container.go │ │ │ │ │ │ ├── create_request.go │ │ │ │ │ │ ├── create_response.go │ │ │ │ │ │ ├── disk_usage.go │ │ │ │ │ │ ├── errors.go │ │ │ │ │ │ ├── exec.go │ │ │ │ │ │ ├── exec_create_request.go │ │ │ │ │ │ ├── exec_start_request.go │ │ │ │ │ │ ├── filesystem_change.go │ │ │ │ │ │ ├── health.go │ │ │ │ │ │ ├── hostconfig.go │ │ │ │ │ │ ├── hostconfig_unix.go │ │ │ │ │ │ ├── hostconfig_windows.go │ │ │ │ │ │ ├── network_settings.go │ │ │ │ │ │ ├── port_summary.go │ │ │ │ │ │ ├── state.go │ │ │ │ │ │ ├── stats.go │ │ │ │ │ │ ├── top_response.go │ │ │ │ │ │ ├── update_response.go │ │ │ │ │ │ ├── wait_exit_error.go │ │ │ │ │ │ ├── wait_response.go │ │ │ │ │ │ └── waitcondition.go │ │ │ │ │ ├── events/ │ │ │ │ │ │ └── events.go │ │ │ │ │ ├── image/ │ │ │ │ │ │ ├── build_identity.go │ │ │ │ │ │ ├── delete_response.go │ │ │ │ │ │ ├── disk_usage.go │ │ │ │ │ │ ├── history_response_item.go │ │ │ │ │ │ ├── identity.go │ │ │ │ │ │ ├── image.go │ │ │ │ │ │ ├── image_inspect.go │ │ │ │ │ │ ├── manifest.go │ │ │ │ │ │ ├── pull_identity.go │ │ │ │ │ │ ├── signature_identity.go │ │ │ │ │ │ ├── signature_timestamp.go │ │ │ │ │ │ ├── signer_identity.go │ │ │ │ │ │ └── summary.go │ │ │ │ │ ├── jsonstream/ │ │ │ │ │ │ ├── json_error.go │ │ │ │ │ │ ├── message.go │ │ │ │ │ │ └── progress.go │ │ │ │ │ ├── mount/ │ │ │ │ │ │ └── mount.go │ │ │ │ │ ├── network/ │ │ │ │ │ │ ├── config_reference.go │ │ │ │ │ │ ├── connect_request.go │ │ │ │ │ │ ├── create_response.go │ │ │ │ │ │ ├── disconnect_request.go │ │ │ │ │ │ ├── endpoint.go │ │ │ │ │ │ ├── endpoint_resource.go │ │ │ │ │ │ ├── hwaddr.go │ │ │ │ │ │ ├── inspect.go │ │ │ │ │ │ ├── ipam.go │ │ │ │ │ │ ├── ipam_status.go │ │ │ │ │ │ ├── network.go │ │ │ │ │ │ ├── network_types.go │ │ │ │ │ │ ├── peer_info.go │ │ │ │ │ │ ├── port.go │ │ │ │ │ │ ├── service_info.go │ │ │ │ │ │ ├── status.go │ │ │ │ │ │ ├── subnet_status.go │ │ │ │ │ │ ├── summary.go │ │ │ │ │ │ └── task.go │ │ │ │ │ ├── plugin/ │ │ │ │ │ │ ├── .gitignore │ │ │ │ │ │ ├── capability.go │ │ │ │ │ │ ├── device.go │ │ │ │ │ │ ├── env.go │ │ │ │ │ │ ├── mount.go │ │ │ │ │ │ ├── plugin.go │ │ │ │ │ │ └── plugin_responses.go │ │ │ │ │ ├── registry/ │ │ │ │ │ │ ├── auth_response.go │ │ │ │ │ │ ├── authconfig.go │ │ │ │ │ │ ├── registry.go │ │ │ │ │ │ └── search.go │ │ │ │ │ ├── storage/ │ │ │ │ │ │ ├── driver_data.go │ │ │ │ │ │ ├── root_f_s_storage.go │ │ │ │ │ │ ├── root_f_s_storage_snapshot.go │ │ │ │ │ │ └── storage.go │ │ │ │ │ ├── swarm/ │ │ │ │ │ │ ├── common.go │ │ │ │ │ │ ├── config.go │ │ │ │ │ │ ├── container.go │ │ │ │ │ │ ├── network.go │ │ │ │ │ │ ├── node.go │ │ │ │ │ │ ├── runtime.go │ │ │ │ │ │ ├── secret.go │ │ │ │ │ │ ├── service.go │ │ │ │ │ │ ├── service_create_response.go │ │ │ │ │ │ ├── service_update_response.go │ │ │ │ │ │ ├── swarm.go │ │ │ │ │ │ └── task.go │ │ │ │ │ ├── system/ │ │ │ │ │ │ ├── disk_usage.go │ │ │ │ │ │ ├── info.go │ │ │ │ │ │ ├── runtime.go │ │ │ │ │ │ └── version_response.go │ │ │ │ │ ├── types.go │ │ │ │ │ └── volume/ │ │ │ │ │ ├── cluster_volume.go │ │ │ │ │ ├── create_request.go │ │ │ │ │ ├── disk_usage.go │ │ │ │ │ ├── list_response.go │ │ │ │ │ ├── prune_report.go │ │ │ │ │ └── volume.go │ │ │ │ └── client/ │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── auth.go │ │ │ │ ├── build_cancel.go │ │ │ │ ├── build_prune.go │ │ │ │ ├── checkpoint_create.go │ │ │ │ ├── checkpoint_list.go │ │ │ │ ├── checkpoint_remove.go │ │ │ │ ├── client.go │ │ │ │ ├── client_interfaces.go │ │ │ │ ├── client_options.go │ │ │ │ ├── client_responsehook.go │ │ │ │ ├── client_unix.go │ │ │ │ ├── client_windows.go │ │ │ │ ├── config_create.go │ │ │ │ ├── config_inspect.go │ │ │ │ ├── config_list.go │ │ │ │ ├── config_remove.go │ │ │ │ ├── config_update.go │ │ │ │ ├── container_attach.go │ │ │ │ ├── container_commit.go │ │ │ │ ├── container_copy.go │ │ │ │ ├── container_create.go │ │ │ │ ├── container_create_opts.go │ │ │ │ ├── container_diff.go │ │ │ │ ├── container_diff_opts.go │ │ │ │ ├── container_exec.go │ │ │ │ ├── container_export.go │ │ │ │ ├── container_inspect.go │ │ │ │ ├── container_kill.go │ │ │ │ ├── container_list.go │ │ │ │ ├── container_logs.go │ │ │ │ ├── container_pause.go │ │ │ │ ├── container_prune.go │ │ │ │ ├── container_remove.go │ │ │ │ ├── container_rename.go │ │ │ │ ├── container_resize.go │ │ │ │ ├── container_restart.go │ │ │ │ ├── container_start.go │ │ │ │ ├── container_stats.go │ │ │ │ ├── container_stop.go │ │ │ │ ├── container_top.go │ │ │ │ ├── container_unpause.go │ │ │ │ ├── container_update.go │ │ │ │ ├── container_wait.go │ │ │ │ ├── distribution_inspect.go │ │ │ │ ├── envvars.go │ │ │ │ ├── errors.go │ │ │ │ ├── filters.go │ │ │ │ ├── hijack.go │ │ │ │ ├── image_build.go │ │ │ │ ├── image_build_opts.go │ │ │ │ ├── image_history.go │ │ │ │ ├── image_history_opts.go │ │ │ │ ├── image_import.go │ │ │ │ ├── image_import_opts.go │ │ │ │ ├── image_inspect.go │ │ │ │ ├── image_inspect_opts.go │ │ │ │ ├── image_list.go │ │ │ │ ├── image_list_opts.go │ │ │ │ ├── image_load.go │ │ │ │ ├── image_load_opts.go │ │ │ │ ├── image_prune.go │ │ │ │ ├── image_pull.go │ │ │ │ ├── image_pull_opts.go │ │ │ │ ├── image_push.go │ │ │ │ ├── image_push_opts.go │ │ │ │ ├── image_remove.go │ │ │ │ ├── image_remove_opts.go │ │ │ │ ├── image_save.go │ │ │ │ ├── image_save_opts.go │ │ │ │ ├── image_search.go │ │ │ │ ├── image_search_opts.go │ │ │ │ ├── image_tag.go │ │ │ │ ├── internal/ │ │ │ │ │ ├── json-stream.go │ │ │ │ │ ├── jsonmessages.go │ │ │ │ │ └── timestamp/ │ │ │ │ │ └── timestamp.go │ │ │ │ ├── login.go │ │ │ │ ├── network_connect.go │ │ │ │ ├── network_create.go │ │ │ │ ├── network_disconnect.go │ │ │ │ ├── network_inspect.go │ │ │ │ ├── network_inspect_opts.go │ │ │ │ ├── network_list.go │ │ │ │ ├── network_list_opts.go │ │ │ │ ├── network_prune.go │ │ │ │ ├── network_remove.go │ │ │ │ ├── node_inspect.go │ │ │ │ ├── node_list.go │ │ │ │ ├── node_remove.go │ │ │ │ ├── node_update.go │ │ │ │ ├── ping.go │ │ │ │ ├── pkg/ │ │ │ │ │ └── versions/ │ │ │ │ │ └── compare.go │ │ │ │ ├── plugin_create.go │ │ │ │ ├── plugin_disable.go │ │ │ │ ├── plugin_enable.go │ │ │ │ ├── plugin_inspect.go │ │ │ │ ├── plugin_install.go │ │ │ │ ├── plugin_list.go │ │ │ │ ├── plugin_push.go │ │ │ │ ├── plugin_remove.go │ │ │ │ ├── plugin_set.go │ │ │ │ ├── plugin_upgrade.go │ │ │ │ ├── request.go │ │ │ │ ├── secret_create.go │ │ │ │ ├── secret_inspect.go │ │ │ │ ├── secret_list.go │ │ │ │ ├── secret_remove.go │ │ │ │ ├── secret_update.go │ │ │ │ ├── service_create.go │ │ │ │ ├── service_inspect.go │ │ │ │ ├── service_list.go │ │ │ │ ├── service_logs.go │ │ │ │ ├── service_remove.go │ │ │ │ ├── service_update.go │ │ │ │ ├── swarm_get_unlock_key.go │ │ │ │ ├── swarm_init.go │ │ │ │ ├── swarm_inspect.go │ │ │ │ ├── swarm_join.go │ │ │ │ ├── swarm_leave.go │ │ │ │ ├── swarm_unlock.go │ │ │ │ ├── swarm_update.go │ │ │ │ ├── system_disk_usage.go │ │ │ │ ├── system_events.go │ │ │ │ ├── system_info.go │ │ │ │ ├── task_inspect.go │ │ │ │ ├── task_list.go │ │ │ │ ├── task_logs.go │ │ │ │ ├── utils.go │ │ │ │ ├── version.go │ │ │ │ ├── volume_create.go │ │ │ │ ├── volume_inspect.go │ │ │ │ ├── volume_list.go │ │ │ │ ├── volume_prune.go │ │ │ │ ├── volume_remove.go │ │ │ │ └── volume_update.go │ │ │ └── sys/ │ │ │ ├── capability/ │ │ │ │ ├── CHANGELOG.md │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── capability.go │ │ │ │ ├── capability_linux.go │ │ │ │ ├── capability_noop.go │ │ │ │ ├── enum.go │ │ │ │ ├── enum_gen.go │ │ │ │ └── syscall_linux.go │ │ │ ├── mountinfo/ │ │ │ │ ├── LICENSE │ │ │ │ ├── doc.go │ │ │ │ ├── mounted_linux.go │ │ │ │ ├── mounted_unix.go │ │ │ │ ├── mountinfo.go │ │ │ │ ├── mountinfo_bsd.go │ │ │ │ ├── mountinfo_filters.go │ │ │ │ ├── mountinfo_freebsdlike.go │ │ │ │ ├── mountinfo_linux.go │ │ │ │ ├── mountinfo_openbsd.go │ │ │ │ ├── mountinfo_unsupported.go │ │ │ │ └── mountinfo_windows.go │ │ │ └── user/ │ │ │ ├── LICENSE │ │ │ ├── idtools.go │ │ │ ├── idtools_unix.go │ │ │ ├── idtools_windows.go │ │ │ ├── lookup_unix.go │ │ │ ├── user.go │ │ │ └── user_fuzzer.go │ │ ├── modern-go/ │ │ │ └── concurrent/ │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── executor.go │ │ │ ├── go_above_19.go │ │ │ ├── go_below_19.go │ │ │ ├── log.go │ │ │ ├── test.sh │ │ │ └── unbounded_executor.go │ │ ├── opencontainers/ │ │ │ ├── go-digest/ │ │ │ │ ├── .mailmap │ │ │ │ ├── .pullapprove.yml │ │ │ │ ├── .travis.yml │ │ │ │ ├── CONTRIBUTING.md │ │ │ │ ├── LICENSE │ │ │ │ ├── LICENSE.docs │ │ │ │ ├── MAINTAINERS │ │ │ │ ├── README.md │ │ │ │ ├── algorithm.go │ │ │ │ ├── digest.go │ │ │ │ ├── digester.go │ │ │ │ ├── doc.go │ │ │ │ └── verifiers.go │ │ │ ├── image-spec/ │ │ │ │ ├── LICENSE │ │ │ │ ├── schema/ │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── config-schema.json │ │ │ │ │ ├── content-descriptor.json │ │ │ │ │ ├── defs-descriptor.json │ │ │ │ │ ├── defs.json │ │ │ │ │ ├── doc.go │ │ │ │ │ ├── error.go │ │ │ │ │ ├── image-index-schema.json │ │ │ │ │ ├── image-layout-schema.json │ │ │ │ │ ├── image-manifest-schema.json │ │ │ │ │ ├── schema.go │ │ │ │ │ └── validator.go │ │ │ │ └── specs-go/ │ │ │ │ ├── v1/ │ │ │ │ │ ├── annotations.go │ │ │ │ │ ├── config.go │ │ │ │ │ ├── descriptor.go │ │ │ │ │ ├── index.go │ │ │ │ │ ├── layout.go │ │ │ │ │ ├── manifest.go │ │ │ │ │ └── mediatype.go │ │ │ │ ├── version.go │ │ │ │ └── versioned.go │ │ │ ├── image-tools/ │ │ │ │ ├── LICENSE │ │ │ │ └── image/ │ │ │ │ ├── autodetect.go │ │ │ │ ├── config.go │ │ │ │ ├── descriptor.go │ │ │ │ ├── doc.go │ │ │ │ ├── image.go │ │ │ │ ├── index.go │ │ │ │ ├── layout.go │ │ │ │ ├── manifest.go │ │ │ │ ├── project.go │ │ │ │ └── walker.go │ │ │ ├── runtime-spec/ │ │ │ │ ├── LICENSE │ │ │ │ └── specs-go/ │ │ │ │ ├── config.go │ │ │ │ ├── state.go │ │ │ │ └── version.go │ │ │ └── selinux/ │ │ │ ├── LICENSE │ │ │ ├── go-selinux/ │ │ │ │ ├── doc.go │ │ │ │ ├── label/ │ │ │ │ │ ├── label.go │ │ │ │ │ ├── label_linux.go │ │ │ │ │ └── label_stub.go │ │ │ │ ├── selinux.go │ │ │ │ ├── selinux_linux.go │ │ │ │ ├── selinux_stub.go │ │ │ │ └── xattrs_linux.go │ │ │ └── pkg/ │ │ │ └── pwalkdir/ │ │ │ ├── README.md │ │ │ └── pwalkdir.go │ │ ├── pkg/ │ │ │ ├── browser/ │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── browser.go │ │ │ │ ├── browser_darwin.go │ │ │ │ ├── browser_freebsd.go │ │ │ │ ├── browser_linux.go │ │ │ │ ├── browser_netbsd.go │ │ │ │ ├── browser_openbsd.go │ │ │ │ ├── browser_unsupported.go │ │ │ │ └── browser_windows.go │ │ │ └── errors/ │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── appveyor.yml │ │ │ ├── errors.go │ │ │ ├── go113.go │ │ │ └── stack.go │ │ ├── pmezard/ │ │ │ └── go-difflib/ │ │ │ ├── LICENSE │ │ │ └── difflib/ │ │ │ └── difflib.go │ │ ├── proglottis/ │ │ │ └── gpgme/ │ │ │ ├── .gitignore │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── data.go │ │ │ ├── go_gpgme.c │ │ │ ├── go_gpgme.h │ │ │ ├── gpgme.go │ │ │ ├── unset_agent_info.go │ │ │ └── unset_agent_info_windows.go │ │ ├── santhosh-tekuri/ │ │ │ └── jsonschema/ │ │ │ └── v6/ │ │ │ ├── .gitmodules │ │ │ ├── .golangci.yml │ │ │ ├── .pre-commit-hooks.yaml │ │ │ ├── .swp │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── compiler.go │ │ │ ├── content.go │ │ │ ├── draft.go │ │ │ ├── format.go │ │ │ ├── go.work │ │ │ ├── go.work.sum │ │ │ ├── kind/ │ │ │ │ └── kind.go │ │ │ ├── loader.go │ │ │ ├── metaschemas/ │ │ │ │ ├── draft/ │ │ │ │ │ ├── 2019-09/ │ │ │ │ │ │ ├── meta/ │ │ │ │ │ │ │ ├── applicator │ │ │ │ │ │ │ ├── content │ │ │ │ │ │ │ ├── core │ │ │ │ │ │ │ ├── format │ │ │ │ │ │ │ ├── meta-data │ │ │ │ │ │ │ └── validation │ │ │ │ │ │ └── schema │ │ │ │ │ └── 2020-12/ │ │ │ │ │ ├── meta/ │ │ │ │ │ │ ├── applicator │ │ │ │ │ │ ├── content │ │ │ │ │ │ ├── core │ │ │ │ │ │ ├── format-annotation │ │ │ │ │ │ ├── format-assertion │ │ │ │ │ │ ├── meta-data │ │ │ │ │ │ ├── unevaluated │ │ │ │ │ │ └── validation │ │ │ │ │ └── schema │ │ │ │ ├── draft-04/ │ │ │ │ │ └── schema │ │ │ │ ├── draft-06/ │ │ │ │ │ └── schema │ │ │ │ └── draft-07/ │ │ │ │ └── schema │ │ │ ├── objcompiler.go │ │ │ ├── output.go │ │ │ ├── position.go │ │ │ ├── root.go │ │ │ ├── roots.go │ │ │ ├── schema.go │ │ │ ├── util.go │ │ │ ├── validator.go │ │ │ └── vocab.go │ │ ├── secure-systems-lab/ │ │ │ └── go-securesystemslib/ │ │ │ ├── LICENSE │ │ │ └── encrypted/ │ │ │ └── encrypted.go │ │ ├── sigstore/ │ │ │ ├── fulcio/ │ │ │ │ ├── COPYRIGHT.txt │ │ │ │ ├── LICENSE │ │ │ │ └── pkg/ │ │ │ │ ├── api/ │ │ │ │ │ └── client.go │ │ │ │ └── certificate/ │ │ │ │ ├── doc.go │ │ │ │ └── extensions.go │ │ │ ├── protobuf-specs/ │ │ │ │ ├── COPYRIGHT.txt │ │ │ │ ├── LICENSE │ │ │ │ └── gen/ │ │ │ │ └── pb-go/ │ │ │ │ └── common/ │ │ │ │ └── v1/ │ │ │ │ └── sigstore_common.pb.go │ │ │ └── sigstore/ │ │ │ ├── COPYRIGHT.txt │ │ │ ├── LICENSE │ │ │ └── pkg/ │ │ │ ├── cryptoutils/ │ │ │ │ ├── certificate.go │ │ │ │ ├── doc.go │ │ │ │ ├── generic.go │ │ │ │ ├── password.go │ │ │ │ ├── privatekey.go │ │ │ │ ├── publickey.go │ │ │ │ ├── safestring.go │ │ │ │ └── sans.go │ │ │ ├── oauth/ │ │ │ │ ├── doc.go │ │ │ │ └── interactive.go │ │ │ ├── oauthflow/ │ │ │ │ ├── client_credentials.go │ │ │ │ ├── device.go │ │ │ │ ├── doc.go │ │ │ │ ├── flow.go │ │ │ │ ├── interactive.go │ │ │ │ └── pkce.go │ │ │ └── signature/ │ │ │ ├── algorithm_registry.go │ │ │ ├── doc.go │ │ │ ├── ecdsa.go │ │ │ ├── ed25519.go │ │ │ ├── ed25519ph.go │ │ │ ├── message.go │ │ │ ├── options/ │ │ │ │ ├── context.go │ │ │ │ ├── digest.go │ │ │ │ ├── doc.go │ │ │ │ ├── keyversion.go │ │ │ │ ├── loadoptions.go │ │ │ │ ├── noop.go │ │ │ │ ├── rand.go │ │ │ │ ├── remoteverification.go │ │ │ │ ├── rpcauth.go │ │ │ │ └── signeropts.go │ │ │ ├── options.go │ │ │ ├── payload/ │ │ │ │ ├── doc.go │ │ │ │ └── payload.go │ │ │ ├── publickey.go │ │ │ ├── rsapkcs1v15.go │ │ │ ├── rsapss.go │ │ │ ├── signer.go │ │ │ ├── signerverifier.go │ │ │ ├── util.go │ │ │ └── verifier.go │ │ ├── smallstep/ │ │ │ └── pkcs7/ │ │ │ ├── .gitignore │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── ber.go │ │ │ ├── decrypt.go │ │ │ ├── encrypt.go │ │ │ ├── internal/ │ │ │ │ └── legacy/ │ │ │ │ └── x509/ │ │ │ │ ├── debug.go │ │ │ │ ├── doc.go │ │ │ │ ├── oid.go │ │ │ │ ├── parser.go │ │ │ │ ├── pkcs1.go │ │ │ │ ├── verify.go │ │ │ │ └── x509.go │ │ │ ├── pkcs7.go │ │ │ ├── sign.go │ │ │ └── verify.go │ │ ├── spf13/ │ │ │ ├── cobra/ │ │ │ │ ├── .gitignore │ │ │ │ ├── .golangci.yml │ │ │ │ ├── .mailmap │ │ │ │ ├── CONDUCT.md │ │ │ │ ├── CONTRIBUTING.md │ │ │ │ ├── LICENSE.txt │ │ │ │ ├── MAINTAINERS │ │ │ │ ├── Makefile │ │ │ │ ├── README.md │ │ │ │ ├── SECURITY.md │ │ │ │ ├── active_help.go │ │ │ │ ├── args.go │ │ │ │ ├── bash_completions.go │ │ │ │ ├── bash_completionsV2.go │ │ │ │ ├── cobra.go │ │ │ │ ├── command.go │ │ │ │ ├── command_notwin.go │ │ │ │ ├── command_win.go │ │ │ │ ├── completions.go │ │ │ │ ├── fish_completions.go │ │ │ │ ├── flag_groups.go │ │ │ │ ├── powershell_completions.go │ │ │ │ ├── shell_completions.go │ │ │ │ └── zsh_completions.go │ │ │ └── pflag/ │ │ │ ├── .editorconfig │ │ │ ├── .gitignore │ │ │ ├── .golangci.yaml │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── bool.go │ │ │ ├── bool_func.go │ │ │ ├── bool_slice.go │ │ │ ├── bytes.go │ │ │ ├── count.go │ │ │ ├── duration.go │ │ │ ├── duration_slice.go │ │ │ ├── errors.go │ │ │ ├── flag.go │ │ │ ├── float32.go │ │ │ ├── float32_slice.go │ │ │ ├── float64.go │ │ │ ├── float64_slice.go │ │ │ ├── func.go │ │ │ ├── golangflag.go │ │ │ ├── int.go │ │ │ ├── int16.go │ │ │ ├── int32.go │ │ │ ├── int32_slice.go │ │ │ ├── int64.go │ │ │ ├── int64_slice.go │ │ │ ├── int8.go │ │ │ ├── int_slice.go │ │ │ ├── ip.go │ │ │ ├── ip_slice.go │ │ │ ├── ipmask.go │ │ │ ├── ipnet.go │ │ │ ├── ipnet_slice.go │ │ │ ├── string.go │ │ │ ├── string_array.go │ │ │ ├── string_slice.go │ │ │ ├── string_to_int.go │ │ │ ├── string_to_int64.go │ │ │ ├── string_to_string.go │ │ │ ├── text.go │ │ │ ├── time.go │ │ │ ├── uint.go │ │ │ ├── uint16.go │ │ │ ├── uint32.go │ │ │ ├── uint64.go │ │ │ ├── uint8.go │ │ │ └── uint_slice.go │ │ ├── stefanberger/ │ │ │ └── go-pkcs11uri/ │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ └── pkcs11uri.go │ │ ├── stretchr/ │ │ │ └── testify/ │ │ │ ├── LICENSE │ │ │ ├── assert/ │ │ │ │ ├── assertion_compare.go │ │ │ │ ├── assertion_format.go │ │ │ │ ├── assertion_format.go.tmpl │ │ │ │ ├── assertion_forward.go │ │ │ │ ├── assertion_forward.go.tmpl │ │ │ │ ├── assertion_order.go │ │ │ │ ├── assertions.go │ │ │ │ ├── doc.go │ │ │ │ ├── errors.go │ │ │ │ ├── forward_assertions.go │ │ │ │ ├── http_assertions.go │ │ │ │ └── yaml/ │ │ │ │ ├── yaml_custom.go │ │ │ │ ├── yaml_default.go │ │ │ │ └── yaml_fail.go │ │ │ ├── require/ │ │ │ │ ├── doc.go │ │ │ │ ├── forward_requirements.go │ │ │ │ ├── require.go │ │ │ │ ├── require.go.tmpl │ │ │ │ ├── require_forward.go │ │ │ │ ├── require_forward.go.tmpl │ │ │ │ └── requirements.go │ │ │ └── suite/ │ │ │ ├── doc.go │ │ │ ├── interfaces.go │ │ │ ├── stats.go │ │ │ └── suite.go │ │ ├── sylabs/ │ │ │ └── sif/ │ │ │ └── v2/ │ │ │ ├── LICENSE.md │ │ │ └── pkg/ │ │ │ └── sif/ │ │ │ ├── add.go │ │ │ ├── arch.go │ │ │ ├── buffer.go │ │ │ ├── create.go │ │ │ ├── delete.go │ │ │ ├── descriptor.go │ │ │ ├── descriptor_input.go │ │ │ ├── load.go │ │ │ ├── select.go │ │ │ ├── set.go │ │ │ └── sif.go │ │ ├── tchap/ │ │ │ └── go-patricia/ │ │ │ └── v2/ │ │ │ ├── AUTHORS │ │ │ ├── LICENSE │ │ │ └── patricia/ │ │ │ ├── children.go │ │ │ └── patricia.go │ │ ├── ulikunitz/ │ │ │ └── xz/ │ │ │ ├── .gitignore │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── SECURITY.md │ │ │ ├── TODO.md │ │ │ ├── bits.go │ │ │ ├── crc.go │ │ │ ├── format.go │ │ │ ├── fox-check-none.xz │ │ │ ├── fox.xz │ │ │ ├── internal/ │ │ │ │ ├── hash/ │ │ │ │ │ ├── cyclic_poly.go │ │ │ │ │ ├── doc.go │ │ │ │ │ ├── rabin_karp.go │ │ │ │ │ └── roller.go │ │ │ │ └── xlog/ │ │ │ │ └── xlog.go │ │ │ ├── lzma/ │ │ │ │ ├── bintree.go │ │ │ │ ├── bitops.go │ │ │ │ ├── breader.go │ │ │ │ ├── buffer.go │ │ │ │ ├── bytewriter.go │ │ │ │ ├── decoder.go │ │ │ │ ├── decoderdict.go │ │ │ │ ├── directcodec.go │ │ │ │ ├── distcodec.go │ │ │ │ ├── encoder.go │ │ │ │ ├── encoderdict.go │ │ │ │ ├── fox.lzma │ │ │ │ ├── hashtable.go │ │ │ │ ├── header.go │ │ │ │ ├── header2.go │ │ │ │ ├── lengthcodec.go │ │ │ │ ├── literalcodec.go │ │ │ │ ├── matchalgorithm.go │ │ │ │ ├── operation.go │ │ │ │ ├── prob.go │ │ │ │ ├── properties.go │ │ │ │ ├── rangecodec.go │ │ │ │ ├── reader.go │ │ │ │ ├── reader2.go │ │ │ │ ├── state.go │ │ │ │ ├── treecodecs.go │ │ │ │ ├── writer.go │ │ │ │ └── writer2.go │ │ │ ├── lzmafilter.go │ │ │ ├── make-docs │ │ │ ├── none-check.go │ │ │ ├── reader.go │ │ │ └── writer.go │ │ ├── vbatts/ │ │ │ └── tar-split/ │ │ │ ├── LICENSE │ │ │ ├── archive/ │ │ │ │ └── tar/ │ │ │ │ ├── common.go │ │ │ │ ├── format.go │ │ │ │ ├── reader.go │ │ │ │ ├── stat_actime1.go │ │ │ │ ├── stat_actime2.go │ │ │ │ ├── stat_unix.go │ │ │ │ ├── strconv.go │ │ │ │ └── writer.go │ │ │ └── tar/ │ │ │ ├── asm/ │ │ │ │ ├── README.md │ │ │ │ ├── assemble.go │ │ │ │ ├── disassemble.go │ │ │ │ ├── doc.go │ │ │ │ └── iterate.go │ │ │ └── storage/ │ │ │ ├── doc.go │ │ │ ├── entry.go │ │ │ ├── getter.go │ │ │ └── packer.go │ │ └── vbauerster/ │ │ └── mpb/ │ │ └── v8/ │ │ ├── .gitignore │ │ ├── CONTRIBUTING │ │ ├── README.md │ │ ├── UNLICENSE │ │ ├── bar.go │ │ ├── bar_filler.go │ │ ├── bar_filler_bar.go │ │ ├── bar_filler_nop.go │ │ ├── bar_filler_spinner.go │ │ ├── bar_heap.go │ │ ├── bar_option.go │ │ ├── container_option.go │ │ ├── cwriter/ │ │ │ ├── doc.go │ │ │ ├── util_bsd.go │ │ │ ├── util_linux.go │ │ │ ├── util_solaris.go │ │ │ ├── util_zos.go │ │ │ ├── writer.go │ │ │ ├── writer_posix.go │ │ │ └── writer_windows.go │ │ ├── decor/ │ │ │ ├── any.go │ │ │ ├── counters.go │ │ │ ├── decorator.go │ │ │ ├── doc.go │ │ │ ├── elapsed.go │ │ │ ├── eta.go │ │ │ ├── meta.go │ │ │ ├── moving_average.go │ │ │ ├── name.go │ │ │ ├── on_abort.go │ │ │ ├── on_abort_or_on_complete.go │ │ │ ├── on_complete.go │ │ │ ├── on_complete_or_on_abort.go │ │ │ ├── on_condition.go │ │ │ ├── percentage.go │ │ │ ├── size_type.go │ │ │ ├── sizeb1000_string.go │ │ │ ├── sizeb1024_string.go │ │ │ ├── speed.go │ │ │ └── spinner.go │ │ ├── doc.go │ │ ├── heap_manager.go │ │ ├── internal/ │ │ │ ├── percentage.go │ │ │ └── width.go │ │ ├── progress.go │ │ ├── proxyreader.go │ │ └── proxywriter.go │ ├── go.opentelemetry.io/ │ │ ├── auto/ │ │ │ └── sdk/ │ │ │ ├── CONTRIBUTING.md │ │ │ ├── LICENSE │ │ │ ├── VERSIONING.md │ │ │ ├── doc.go │ │ │ ├── internal/ │ │ │ │ └── telemetry/ │ │ │ │ ├── attr.go │ │ │ │ ├── doc.go │ │ │ │ ├── id.go │ │ │ │ ├── number.go │ │ │ │ ├── resource.go │ │ │ │ ├── scope.go │ │ │ │ ├── span.go │ │ │ │ ├── status.go │ │ │ │ ├── traces.go │ │ │ │ └── value.go │ │ │ ├── limit.go │ │ │ ├── span.go │ │ │ ├── tracer.go │ │ │ └── tracer_provider.go │ │ ├── contrib/ │ │ │ └── instrumentation/ │ │ │ └── net/ │ │ │ └── http/ │ │ │ └── otelhttp/ │ │ │ ├── LICENSE │ │ │ ├── common.go │ │ │ ├── config.go │ │ │ ├── doc.go │ │ │ ├── handler.go │ │ │ ├── internal/ │ │ │ │ ├── request/ │ │ │ │ │ ├── body_wrapper.go │ │ │ │ │ ├── gen.go │ │ │ │ │ └── resp_writer_wrapper.go │ │ │ │ └── semconv/ │ │ │ │ ├── client.go │ │ │ │ ├── gen.go │ │ │ │ ├── server.go │ │ │ │ └── util.go │ │ │ ├── labeler.go │ │ │ ├── start_time_context.go │ │ │ ├── transport.go │ │ │ └── version.go │ │ └── otel/ │ │ ├── .clomonitor.yml │ │ ├── .codespellignore │ │ ├── .codespellrc │ │ ├── .gitattributes │ │ ├── .gitignore │ │ ├── .golangci.yml │ │ ├── .lycheeignore │ │ ├── .markdownlint.yaml │ │ ├── CHANGELOG.md │ │ ├── CODEOWNERS │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── README.md │ │ ├── RELEASING.md │ │ ├── SECURITY-INSIGHTS.yml │ │ ├── VERSIONING.md │ │ ├── attribute/ │ │ │ ├── README.md │ │ │ ├── doc.go │ │ │ ├── encoder.go │ │ │ ├── filter.go │ │ │ ├── hash.go │ │ │ ├── internal/ │ │ │ │ ├── attribute.go │ │ │ │ └── xxhash/ │ │ │ │ └── xxhash.go │ │ │ ├── iterator.go │ │ │ ├── key.go │ │ │ ├── kv.go │ │ │ ├── rawhelpers.go │ │ │ ├── set.go │ │ │ ├── type_string.go │ │ │ └── value.go │ │ ├── baggage/ │ │ │ ├── README.md │ │ │ ├── baggage.go │ │ │ ├── context.go │ │ │ └── doc.go │ │ ├── codes/ │ │ │ ├── README.md │ │ │ ├── codes.go │ │ │ └── doc.go │ │ ├── dependencies.Dockerfile │ │ ├── doc.go │ │ ├── error_handler.go │ │ ├── handler.go │ │ ├── internal/ │ │ │ ├── baggage/ │ │ │ │ ├── baggage.go │ │ │ │ └── context.go │ │ │ └── global/ │ │ │ ├── handler.go │ │ │ ├── instruments.go │ │ │ ├── internal_logging.go │ │ │ ├── meter.go │ │ │ ├── propagator.go │ │ │ ├── state.go │ │ │ └── trace.go │ │ ├── internal_logging.go │ │ ├── metric/ │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── asyncfloat64.go │ │ │ ├── asyncint64.go │ │ │ ├── config.go │ │ │ ├── doc.go │ │ │ ├── embedded/ │ │ │ │ ├── README.md │ │ │ │ └── embedded.go │ │ │ ├── instrument.go │ │ │ ├── meter.go │ │ │ ├── noop/ │ │ │ │ ├── README.md │ │ │ │ └── noop.go │ │ │ ├── syncfloat64.go │ │ │ └── syncint64.go │ │ ├── metric.go │ │ ├── propagation/ │ │ │ ├── README.md │ │ │ ├── baggage.go │ │ │ ├── doc.go │ │ │ ├── propagation.go │ │ │ └── trace_context.go │ │ ├── propagation.go │ │ ├── renovate.json │ │ ├── requirements.txt │ │ ├── semconv/ │ │ │ ├── v1.37.0/ │ │ │ │ ├── MIGRATION.md │ │ │ │ ├── README.md │ │ │ │ ├── attribute_group.go │ │ │ │ ├── doc.go │ │ │ │ ├── error_type.go │ │ │ │ ├── exception.go │ │ │ │ └── schema.go │ │ │ └── v1.39.0/ │ │ │ ├── MIGRATION.md │ │ │ ├── README.md │ │ │ ├── attribute_group.go │ │ │ ├── doc.go │ │ │ ├── error_type.go │ │ │ ├── exception.go │ │ │ ├── httpconv/ │ │ │ │ └── metric.go │ │ │ └── schema.go │ │ ├── trace/ │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── auto.go │ │ │ ├── config.go │ │ │ ├── context.go │ │ │ ├── doc.go │ │ │ ├── embedded/ │ │ │ │ ├── README.md │ │ │ │ └── embedded.go │ │ │ ├── hex.go │ │ │ ├── internal/ │ │ │ │ └── telemetry/ │ │ │ │ ├── attr.go │ │ │ │ ├── doc.go │ │ │ │ ├── id.go │ │ │ │ ├── number.go │ │ │ │ ├── resource.go │ │ │ │ ├── scope.go │ │ │ │ ├── span.go │ │ │ │ ├── status.go │ │ │ │ ├── traces.go │ │ │ │ └── value.go │ │ │ ├── nonrecording.go │ │ │ ├── noop/ │ │ │ │ ├── README.md │ │ │ │ └── noop.go │ │ │ ├── noop.go │ │ │ ├── provider.go │ │ │ ├── span.go │ │ │ ├── trace.go │ │ │ ├── tracer.go │ │ │ └── tracestate.go │ │ ├── trace.go │ │ ├── verify_released_changelog.sh │ │ ├── version.go │ │ └── versions.yaml │ ├── go.podman.io/ │ │ ├── common/ │ │ │ ├── LICENSE │ │ │ └── pkg/ │ │ │ ├── auth/ │ │ │ │ ├── auth.go │ │ │ │ └── cli.go │ │ │ ├── capabilities/ │ │ │ │ └── capabilities.go │ │ │ ├── completion/ │ │ │ │ └── completion.go │ │ │ ├── flag/ │ │ │ │ └── flag.go │ │ │ ├── json-proxy/ │ │ │ │ ├── handler.go │ │ │ │ ├── proxy.go │ │ │ │ ├── proxy_unix.go │ │ │ │ ├── types.go │ │ │ │ ├── types_unix.go │ │ │ │ └── utils.go │ │ │ ├── password/ │ │ │ │ ├── password_supported.go │ │ │ │ └── password_windows.go │ │ │ ├── report/ │ │ │ │ ├── camelcase/ │ │ │ │ │ ├── LICENSE.md │ │ │ │ │ ├── README.md │ │ │ │ │ └── camelcase.go │ │ │ │ ├── doc.go │ │ │ │ ├── formatter.go │ │ │ │ ├── template.go │ │ │ │ ├── validate.go │ │ │ │ └── writer.go │ │ │ └── retry/ │ │ │ ├── retry.go │ │ │ ├── retry_linux.go │ │ │ └── retry_unsupported.go │ │ ├── image/ │ │ │ └── v5/ │ │ │ ├── LICENSE │ │ │ ├── copy/ │ │ │ │ ├── blob.go │ │ │ │ ├── compression.go │ │ │ │ ├── copy.go │ │ │ │ ├── digesting_reader.go │ │ │ │ ├── encryption.go │ │ │ │ ├── manifest.go │ │ │ │ ├── multiple.go │ │ │ │ ├── progress_bars.go │ │ │ │ ├── progress_channel.go │ │ │ │ ├── sign.go │ │ │ │ └── single.go │ │ │ ├── directory/ │ │ │ │ ├── directory_dest.go │ │ │ │ ├── directory_src.go │ │ │ │ ├── directory_transport.go │ │ │ │ ├── explicitfilepath/ │ │ │ │ │ └── path.go │ │ │ │ └── version.go │ │ │ ├── docker/ │ │ │ │ ├── archive/ │ │ │ │ │ ├── dest.go │ │ │ │ │ ├── reader.go │ │ │ │ │ ├── src.go │ │ │ │ │ ├── transport.go │ │ │ │ │ └── writer.go │ │ │ │ ├── body_reader.go │ │ │ │ ├── cache.go │ │ │ │ ├── daemon/ │ │ │ │ │ ├── client.go │ │ │ │ │ ├── daemon_dest.go │ │ │ │ │ ├── daemon_src.go │ │ │ │ │ └── daemon_transport.go │ │ │ │ ├── distribution_error.go │ │ │ │ ├── docker_client.go │ │ │ │ ├── docker_image.go │ │ │ │ ├── docker_image_dest.go │ │ │ │ ├── docker_image_src.go │ │ │ │ ├── docker_transport.go │ │ │ │ ├── errors.go │ │ │ │ ├── internal/ │ │ │ │ │ └── tarfile/ │ │ │ │ │ ├── dest.go │ │ │ │ │ ├── reader.go │ │ │ │ │ ├── src.go │ │ │ │ │ ├── types.go │ │ │ │ │ └── writer.go │ │ │ │ ├── paths_common.go │ │ │ │ ├── paths_freebsd.go │ │ │ │ ├── policyconfiguration/ │ │ │ │ │ └── naming.go │ │ │ │ ├── reference/ │ │ │ │ │ ├── README.md │ │ │ │ │ ├── helpers.go │ │ │ │ │ ├── normalize.go │ │ │ │ │ ├── reference.go │ │ │ │ │ ├── regexp-additions.go │ │ │ │ │ └── regexp.go │ │ │ │ ├── registries_d.go │ │ │ │ └── wwwauthenticate.go │ │ │ ├── image/ │ │ │ │ ├── docker_schema2.go │ │ │ │ ├── sourced.go │ │ │ │ └── unparsed.go │ │ │ ├── internal/ │ │ │ │ ├── blobinfocache/ │ │ │ │ │ ├── blobinfocache.go │ │ │ │ │ └── types.go │ │ │ │ ├── digests/ │ │ │ │ │ └── digests.go │ │ │ │ ├── image/ │ │ │ │ │ ├── digest_validation.go │ │ │ │ │ ├── docker_list.go │ │ │ │ │ ├── docker_schema1.go │ │ │ │ │ ├── docker_schema2.go │ │ │ │ │ ├── manifest.go │ │ │ │ │ ├── memory.go │ │ │ │ │ ├── oci.go │ │ │ │ │ ├── oci_index.go │ │ │ │ │ ├── sourced.go │ │ │ │ │ └── unparsed.go │ │ │ │ ├── imagedestination/ │ │ │ │ │ ├── impl/ │ │ │ │ │ │ ├── compat.go │ │ │ │ │ │ ├── helpers.go │ │ │ │ │ │ └── properties.go │ │ │ │ │ ├── stubs/ │ │ │ │ │ │ ├── original_oci_config.go │ │ │ │ │ │ ├── put_blob_partial.go │ │ │ │ │ │ ├── signatures.go │ │ │ │ │ │ └── stubs.go │ │ │ │ │ └── wrapper.go │ │ │ │ ├── imagesource/ │ │ │ │ │ ├── impl/ │ │ │ │ │ │ ├── compat.go │ │ │ │ │ │ ├── layer_infos.go │ │ │ │ │ │ ├── properties.go │ │ │ │ │ │ └── signatures.go │ │ │ │ │ ├── stubs/ │ │ │ │ │ │ ├── get_blob_at.go │ │ │ │ │ │ └── stubs.go │ │ │ │ │ └── wrapper.go │ │ │ │ ├── iolimits/ │ │ │ │ │ └── iolimits.go │ │ │ │ ├── manifest/ │ │ │ │ │ ├── common.go │ │ │ │ │ ├── docker_schema2.go │ │ │ │ │ ├── docker_schema2_list.go │ │ │ │ │ ├── errors.go │ │ │ │ │ ├── list.go │ │ │ │ │ ├── manifest.go │ │ │ │ │ └── oci_index.go │ │ │ │ ├── multierr/ │ │ │ │ │ └── multierr.go │ │ │ │ ├── pkg/ │ │ │ │ │ └── platform/ │ │ │ │ │ └── platform_matcher.go │ │ │ │ ├── private/ │ │ │ │ │ └── private.go │ │ │ │ ├── putblobdigest/ │ │ │ │ │ └── put_blob_digest.go │ │ │ │ ├── rootless/ │ │ │ │ │ └── rootless.go │ │ │ │ ├── set/ │ │ │ │ │ └── set.go │ │ │ │ ├── signature/ │ │ │ │ │ ├── signature.go │ │ │ │ │ ├── sigstore.go │ │ │ │ │ └── simple.go │ │ │ │ ├── signer/ │ │ │ │ │ └── signer.go │ │ │ │ ├── streamdigest/ │ │ │ │ │ └── stream_digest.go │ │ │ │ ├── tmpdir/ │ │ │ │ │ └── tmpdir.go │ │ │ │ ├── unparsedimage/ │ │ │ │ │ └── wrapper.go │ │ │ │ ├── uploadreader/ │ │ │ │ │ └── upload_reader.go │ │ │ │ └── useragent/ │ │ │ │ └── useragent.go │ │ │ ├── manifest/ │ │ │ │ ├── common.go │ │ │ │ ├── docker_schema1.go │ │ │ │ ├── docker_schema2.go │ │ │ │ ├── docker_schema2_list.go │ │ │ │ ├── list.go │ │ │ │ ├── manifest.go │ │ │ │ ├── oci.go │ │ │ │ └── oci_index.go │ │ │ ├── oci/ │ │ │ │ ├── archive/ │ │ │ │ │ ├── oci_dest.go │ │ │ │ │ ├── oci_src.go │ │ │ │ │ └── oci_transport.go │ │ │ │ ├── internal/ │ │ │ │ │ └── oci_util.go │ │ │ │ └── layout/ │ │ │ │ ├── oci_delete.go │ │ │ │ ├── oci_dest.go │ │ │ │ ├── oci_src.go │ │ │ │ ├── oci_transport.go │ │ │ │ └── reader.go │ │ │ ├── openshift/ │ │ │ │ ├── openshift-copies.go │ │ │ │ ├── openshift.go │ │ │ │ ├── openshift_dest.go │ │ │ │ ├── openshift_src.go │ │ │ │ └── openshift_transport.go │ │ │ ├── pkg/ │ │ │ │ ├── blobinfocache/ │ │ │ │ │ ├── default.go │ │ │ │ │ ├── internal/ │ │ │ │ │ │ └── prioritize/ │ │ │ │ │ │ └── prioritize.go │ │ │ │ │ ├── memory/ │ │ │ │ │ │ └── memory.go │ │ │ │ │ ├── none/ │ │ │ │ │ │ └── none.go │ │ │ │ │ └── sqlite/ │ │ │ │ │ └── sqlite.go │ │ │ │ ├── cli/ │ │ │ │ │ ├── basetls/ │ │ │ │ │ │ ├── basetls.go │ │ │ │ │ │ └── tlsdetails/ │ │ │ │ │ │ └── tlsdetails.go │ │ │ │ │ ├── passphrase.go │ │ │ │ │ └── sigstore/ │ │ │ │ │ ├── params/ │ │ │ │ │ │ └── sigstore.go │ │ │ │ │ └── sigstore.go │ │ │ │ ├── compression/ │ │ │ │ │ ├── compression.go │ │ │ │ │ ├── internal/ │ │ │ │ │ │ └── types.go │ │ │ │ │ ├── types/ │ │ │ │ │ │ └── types.go │ │ │ │ │ └── zstd.go │ │ │ │ ├── docker/ │ │ │ │ │ └── config/ │ │ │ │ │ └── config.go │ │ │ │ ├── strslice/ │ │ │ │ │ ├── README.md │ │ │ │ │ └── strslice.go │ │ │ │ ├── sysregistriesv2/ │ │ │ │ │ ├── paths_common.go │ │ │ │ │ ├── paths_freebsd.go │ │ │ │ │ ├── shortnames.go │ │ │ │ │ └── system_registries_v2.go │ │ │ │ └── tlsclientconfig/ │ │ │ │ └── tlsclientconfig.go │ │ │ ├── sif/ │ │ │ │ ├── load.go │ │ │ │ ├── src.go │ │ │ │ └── transport.go │ │ │ ├── signature/ │ │ │ │ ├── docker.go │ │ │ │ ├── fulcio_cert.go │ │ │ │ ├── internal/ │ │ │ │ │ ├── errors.go │ │ │ │ │ ├── json.go │ │ │ │ │ ├── rekor_api_types.go │ │ │ │ │ ├── rekor_set.go │ │ │ │ │ ├── sequoia/ │ │ │ │ │ │ ├── gosequoia.c │ │ │ │ │ │ ├── gosequoia.h │ │ │ │ │ │ ├── gosequoiafuncs.h │ │ │ │ │ │ ├── sequoia.go │ │ │ │ │ │ └── sequoia.h │ │ │ │ │ └── sigstore_payload.go │ │ │ │ ├── mechanism.go │ │ │ │ ├── mechanism_gpgme.go │ │ │ │ ├── mechanism_gpgme_only.go │ │ │ │ ├── mechanism_openpgp.go │ │ │ │ ├── mechanism_sequoia.go │ │ │ │ ├── pki_cert.go │ │ │ │ ├── policy_config.go │ │ │ │ ├── policy_config_sigstore.go │ │ │ │ ├── policy_eval.go │ │ │ │ ├── policy_eval_baselayer.go │ │ │ │ ├── policy_eval_signedby.go │ │ │ │ ├── policy_eval_sigstore.go │ │ │ │ ├── policy_eval_simple.go │ │ │ │ ├── policy_paths_common.go │ │ │ │ ├── policy_paths_freebsd.go │ │ │ │ ├── policy_reference_match.go │ │ │ │ ├── policy_types.go │ │ │ │ ├── signer/ │ │ │ │ │ └── signer.go │ │ │ │ ├── sigstore/ │ │ │ │ │ ├── copied.go │ │ │ │ │ ├── fulcio/ │ │ │ │ │ │ └── fulcio.go │ │ │ │ │ ├── generate.go │ │ │ │ │ ├── internal/ │ │ │ │ │ │ └── signer.go │ │ │ │ │ ├── rekor/ │ │ │ │ │ │ ├── leveled_logger.go │ │ │ │ │ │ ├── openapi_infra.go │ │ │ │ │ │ ├── rekor.go │ │ │ │ │ │ ├── rekor_api.go │ │ │ │ │ │ └── rekor_api_types.go │ │ │ │ │ └── signer.go │ │ │ │ ├── simple.go │ │ │ │ ├── simplesequoia/ │ │ │ │ │ ├── mechanism.go │ │ │ │ │ ├── options.go │ │ │ │ │ ├── signer.go │ │ │ │ │ └── signer_stub.go │ │ │ │ └── simplesigning/ │ │ │ │ └── signer.go │ │ │ ├── storage/ │ │ │ │ ├── storage_dest.go │ │ │ │ ├── storage_image.go │ │ │ │ ├── storage_reference.go │ │ │ │ ├── storage_src.go │ │ │ │ └── storage_transport.go │ │ │ ├── tarball/ │ │ │ │ ├── doc.go │ │ │ │ ├── tarball_reference.go │ │ │ │ ├── tarball_src.go │ │ │ │ └── tarball_transport.go │ │ │ ├── transports/ │ │ │ │ ├── alltransports/ │ │ │ │ │ ├── alltransports.go │ │ │ │ │ ├── docker_daemon.go │ │ │ │ │ ├── docker_daemon_stub.go │ │ │ │ │ ├── storage.go │ │ │ │ │ └── storage_stub.go │ │ │ │ ├── stub.go │ │ │ │ └── transports.go │ │ │ ├── types/ │ │ │ │ └── types.go │ │ │ └── version/ │ │ │ └── version.go │ │ └── storage/ │ │ ├── .dockerignore │ │ ├── .gitignore │ │ ├── .golangci.yml │ │ ├── .mailmap │ │ ├── AUTHORS │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── NOTICE │ │ ├── OWNERS │ │ ├── README.md │ │ ├── VERSION │ │ ├── check.go │ │ ├── containers.go │ │ ├── deprecated.go │ │ ├── drivers/ │ │ │ ├── btrfs/ │ │ │ │ ├── btrfs.go │ │ │ │ ├── dummy_unsupported.go │ │ │ │ └── version.go │ │ │ ├── chown.go │ │ │ ├── chown_darwin.go │ │ │ ├── chown_unix.go │ │ │ ├── chown_windows.go │ │ │ ├── chroot_unix.go │ │ │ ├── chroot_windows.go │ │ │ ├── copy/ │ │ │ │ ├── copy_linux.go │ │ │ │ └── copy_unsupported.go │ │ │ ├── counter.go │ │ │ ├── driver.go │ │ │ ├── driver_darwin.go │ │ │ ├── driver_freebsd.go │ │ │ ├── driver_linux.go │ │ │ ├── driver_solaris.go │ │ │ ├── driver_unsupported.go │ │ │ ├── fsdiff.go │ │ │ ├── jsoniter.go │ │ │ ├── overlay/ │ │ │ │ ├── check.go │ │ │ │ ├── check_116.go │ │ │ │ ├── composefs.go │ │ │ │ ├── jsoniter.go │ │ │ │ ├── mount.go │ │ │ │ ├── overlay.go │ │ │ │ ├── overlay_disk_quota.go │ │ │ │ ├── overlay_disk_quota_unsupported.go │ │ │ │ ├── overlay_unsupported.go │ │ │ │ └── randomid.go │ │ │ ├── overlayutils/ │ │ │ │ └── overlayutils.go │ │ │ ├── quota/ │ │ │ │ ├── projectquota.go │ │ │ │ ├── projectquota_supported.go │ │ │ │ └── projectquota_unsupported.go │ │ │ ├── register/ │ │ │ │ ├── register_btrfs.go │ │ │ │ ├── register_overlay.go │ │ │ │ ├── register_vfs.go │ │ │ │ └── register_zfs.go │ │ │ ├── vfs/ │ │ │ │ ├── copy_linux.go │ │ │ │ ├── copy_unsupported.go │ │ │ │ └── driver.go │ │ │ └── zfs/ │ │ │ ├── MAINTAINERS │ │ │ ├── zfs.go │ │ │ ├── zfs_freebsd.go │ │ │ ├── zfs_linux.go │ │ │ └── zfs_unsupported.go │ │ ├── errors.go │ │ ├── idset.go │ │ ├── images.go │ │ ├── internal/ │ │ │ ├── dedup/ │ │ │ │ ├── dedup.go │ │ │ │ ├── dedup_linux.go │ │ │ │ └── dedup_unsupported.go │ │ │ ├── rawfilelock/ │ │ │ │ ├── rawfilelock.go │ │ │ │ ├── rawfilelock_unix.go │ │ │ │ └── rawfilelock_windows.go │ │ │ ├── staging_lockfile/ │ │ │ │ └── staging_lockfile.go │ │ │ └── tempdir/ │ │ │ └── tempdir.go │ │ ├── jsoniter.go │ │ ├── layers.go │ │ ├── lockfile_compat.go │ │ ├── pkg/ │ │ │ ├── archive/ │ │ │ │ ├── README.md │ │ │ │ ├── archive.go │ │ │ │ ├── archive_110.go │ │ │ │ ├── archive_19.go │ │ │ │ ├── archive_bsd.go │ │ │ │ ├── archive_linux.go │ │ │ │ ├── archive_other.go │ │ │ │ ├── archive_unix.go │ │ │ │ ├── archive_windows.go │ │ │ │ ├── archive_zstd.go │ │ │ │ ├── changes.go │ │ │ │ ├── changes_linux.go │ │ │ │ ├── changes_other.go │ │ │ │ ├── changes_unix.go │ │ │ │ ├── changes_windows.go │ │ │ │ ├── copy.go │ │ │ │ ├── copy_unix.go │ │ │ │ ├── copy_windows.go │ │ │ │ ├── diff.go │ │ │ │ ├── fflags_bsd.go │ │ │ │ ├── fflags_unsupported.go │ │ │ │ ├── filter.go │ │ │ │ ├── time_linux.go │ │ │ │ ├── time_unsupported.go │ │ │ │ ├── whiteouts.go │ │ │ │ └── wrap.go │ │ │ ├── chrootarchive/ │ │ │ │ ├── archive.go │ │ │ │ ├── archive_darwin.go │ │ │ │ ├── archive_unix.go │ │ │ │ ├── archive_windows.go │ │ │ │ ├── chroot_linux.go │ │ │ │ ├── chroot_unix.go │ │ │ │ ├── diff.go │ │ │ │ ├── diff_darwin.go │ │ │ │ ├── diff_unix.go │ │ │ │ ├── diff_windows.go │ │ │ │ ├── init_unix.go │ │ │ │ └── jsoniter.go │ │ │ ├── chunked/ │ │ │ │ ├── bloom_filter_linux.go │ │ │ │ ├── cache_linux.go │ │ │ │ ├── compression.go │ │ │ │ ├── compression_linux.go │ │ │ │ ├── compressor/ │ │ │ │ │ ├── compressor.go │ │ │ │ │ └── rollsum.go │ │ │ │ ├── dump/ │ │ │ │ │ └── dump.go │ │ │ │ ├── filesystem_linux.go │ │ │ │ ├── internal/ │ │ │ │ │ ├── minimal/ │ │ │ │ │ │ └── compression.go │ │ │ │ │ └── path/ │ │ │ │ │ └── path.go │ │ │ │ ├── storage.go │ │ │ │ ├── storage_linux.go │ │ │ │ ├── storage_unsupported.go │ │ │ │ └── toc/ │ │ │ │ └── toc.go │ │ │ ├── config/ │ │ │ │ └── config.go │ │ │ ├── directory/ │ │ │ │ ├── directory.go │ │ │ │ ├── directory_unix.go │ │ │ │ └── directory_windows.go │ │ │ ├── fileutils/ │ │ │ │ ├── exists_freebsd.go │ │ │ │ ├── exists_unix.go │ │ │ │ ├── exists_windows.go │ │ │ │ ├── fileutils.go │ │ │ │ ├── fileutils_darwin.go │ │ │ │ ├── fileutils_solaris.go │ │ │ │ ├── fileutils_unix.go │ │ │ │ ├── fileutils_windows.go │ │ │ │ ├── reflink_linux.go │ │ │ │ └── reflink_unsupported.go │ │ │ ├── fsutils/ │ │ │ │ └── fsutils_linux.go │ │ │ ├── fsverity/ │ │ │ │ ├── fsverity_linux.go │ │ │ │ └── fsverity_unsupported.go │ │ │ ├── homedir/ │ │ │ │ ├── homedir.go │ │ │ │ ├── homedir_unix.go │ │ │ │ └── homedir_windows.go │ │ │ ├── idmap/ │ │ │ │ ├── idmapped_utils.go │ │ │ │ └── idmapped_utils_unsupported.go │ │ │ ├── idtools/ │ │ │ │ ├── idtools.go │ │ │ │ ├── idtools_supported.go │ │ │ │ ├── idtools_unix.go │ │ │ │ ├── idtools_unsupported.go │ │ │ │ ├── idtools_windows.go │ │ │ │ ├── parser.go │ │ │ │ ├── usergroupadd_linux.go │ │ │ │ ├── usergroupadd_unsupported.go │ │ │ │ └── utils_unix.go │ │ │ ├── ioutils/ │ │ │ │ ├── buffer.go │ │ │ │ ├── bytespipe.go │ │ │ │ ├── fswriters.go │ │ │ │ ├── fswriters_linux.go │ │ │ │ ├── fswriters_other.go │ │ │ │ ├── readers.go │ │ │ │ ├── temp_unix.go │ │ │ │ ├── temp_windows.go │ │ │ │ ├── writeflusher.go │ │ │ │ └── writers.go │ │ │ ├── lockfile/ │ │ │ │ ├── lastwrite.go │ │ │ │ ├── lockfile.go │ │ │ │ ├── lockfile_unix.go │ │ │ │ └── lockfile_windows.go │ │ │ ├── longpath/ │ │ │ │ └── longpath.go │ │ │ ├── loopback/ │ │ │ │ ├── attach_loopback.go │ │ │ │ ├── ioctl.go │ │ │ │ ├── loop_wrapper.go │ │ │ │ ├── loopback.go │ │ │ │ └── loopback_unsupported.go │ │ │ ├── mount/ │ │ │ │ ├── flags.go │ │ │ │ ├── flags_freebsd.go │ │ │ │ ├── flags_linux.go │ │ │ │ ├── flags_unsupported.go │ │ │ │ ├── mount.go │ │ │ │ ├── mounter_freebsd.go │ │ │ │ ├── mounter_linux.go │ │ │ │ ├── mounter_unsupported.go │ │ │ │ ├── mountinfo.go │ │ │ │ ├── mountinfo_linux.go │ │ │ │ ├── sharedsubtree_linux.go │ │ │ │ ├── unmount_unix.go │ │ │ │ └── unmount_unsupported.go │ │ │ ├── parsers/ │ │ │ │ └── parsers.go │ │ │ ├── pools/ │ │ │ │ └── pools.go │ │ │ ├── promise/ │ │ │ │ └── promise.go │ │ │ ├── reexec/ │ │ │ │ ├── README.md │ │ │ │ ├── command_freebsd.go │ │ │ │ ├── command_linux.go │ │ │ │ ├── command_unix.go │ │ │ │ ├── command_unsupported.go │ │ │ │ ├── command_windows.go │ │ │ │ └── reexec.go │ │ │ ├── regexp/ │ │ │ │ ├── regexp.go │ │ │ │ ├── regexp_dontprecompile.go │ │ │ │ └── regexp_precompile.go │ │ │ ├── stringid/ │ │ │ │ ├── README.md │ │ │ │ └── stringid.go │ │ │ ├── stringutils/ │ │ │ │ ├── README.md │ │ │ │ └── stringutils.go │ │ │ ├── system/ │ │ │ │ ├── chmod.go │ │ │ │ ├── chtimes.go │ │ │ │ ├── chtimes_unix.go │ │ │ │ ├── chtimes_windows.go │ │ │ │ ├── errors.go │ │ │ │ ├── exitcode.go │ │ │ │ ├── extattr_freebsd.go │ │ │ │ ├── extattr_unsupported.go │ │ │ │ ├── init.go │ │ │ │ ├── init_windows.go │ │ │ │ ├── lchflags_bsd.go │ │ │ │ ├── lchown.go │ │ │ │ ├── lcow_unix.go │ │ │ │ ├── lcow_windows.go │ │ │ │ ├── lstat_unix.go │ │ │ │ ├── lstat_windows.go │ │ │ │ ├── meminfo.go │ │ │ │ ├── meminfo_freebsd.go │ │ │ │ ├── meminfo_linux.go │ │ │ │ ├── meminfo_solaris.go │ │ │ │ ├── meminfo_unsupported.go │ │ │ │ ├── meminfo_windows.go │ │ │ │ ├── mknod.go │ │ │ │ ├── mknod_freebsd.go │ │ │ │ ├── mknod_windows.go │ │ │ │ ├── path.go │ │ │ │ ├── path_unix.go │ │ │ │ ├── path_windows.go │ │ │ │ ├── process_unix.go │ │ │ │ ├── rm.go │ │ │ │ ├── rm_common.go │ │ │ │ ├── rm_freebsd.go │ │ │ │ ├── stat_common.go │ │ │ │ ├── stat_darwin.go │ │ │ │ ├── stat_freebsd.go │ │ │ │ ├── stat_linux.go │ │ │ │ ├── stat_netbsd.go │ │ │ │ ├── stat_openbsd.go │ │ │ │ ├── stat_solaris.go │ │ │ │ ├── stat_unix.go │ │ │ │ ├── stat_windows.go │ │ │ │ ├── syscall_unix.go │ │ │ │ ├── syscall_windows.go │ │ │ │ ├── umask.go │ │ │ │ ├── umask_windows.go │ │ │ │ ├── utimes_freebsd.go │ │ │ │ ├── utimes_linux.go │ │ │ │ ├── utimes_unsupported.go │ │ │ │ ├── xattrs_darwin.go │ │ │ │ ├── xattrs_freebsd.go │ │ │ │ ├── xattrs_linux.go │ │ │ │ └── xattrs_unsupported.go │ │ │ ├── tarlog/ │ │ │ │ └── tarlogger.go │ │ │ ├── truncindex/ │ │ │ │ └── truncindex.go │ │ │ └── unshare/ │ │ │ ├── getenv_linux_cgo.go │ │ │ ├── getenv_linux_nocgo.go │ │ │ ├── unshare.c │ │ │ ├── unshare.go │ │ │ ├── unshare_cgo.go │ │ │ ├── unshare_darwin.go │ │ │ ├── unshare_freebsd.c │ │ │ ├── unshare_freebsd.go │ │ │ ├── unshare_gccgo.go │ │ │ ├── unshare_linux.go │ │ │ ├── unshare_unsupported.go │ │ │ └── unshare_unsupported_cgo.go │ │ ├── storage.conf │ │ ├── storage.conf-freebsd │ │ ├── store.go │ │ ├── types/ │ │ │ ├── default_override_test.conf │ │ │ ├── errors.go │ │ │ ├── idmappings.go │ │ │ ├── options.go │ │ │ ├── options_bsd.go │ │ │ ├── options_darwin.go │ │ │ ├── options_linux.go │ │ │ ├── options_windows.go │ │ │ ├── storage_broken.conf │ │ │ ├── storage_test.conf │ │ │ └── utils.go │ │ ├── userns.go │ │ ├── userns_unsupported.go │ │ └── utils.go │ ├── golang.org/ │ │ └── x/ │ │ ├── crypto/ │ │ │ ├── LICENSE │ │ │ ├── PATENTS │ │ │ ├── cast5/ │ │ │ │ └── cast5.go │ │ │ ├── cryptobyte/ │ │ │ │ ├── asn1/ │ │ │ │ │ └── asn1.go │ │ │ │ ├── asn1.go │ │ │ │ ├── builder.go │ │ │ │ └── string.go │ │ │ ├── internal/ │ │ │ │ ├── alias/ │ │ │ │ │ ├── alias.go │ │ │ │ │ └── alias_purego.go │ │ │ │ └── poly1305/ │ │ │ │ ├── mac_noasm.go │ │ │ │ ├── poly1305.go │ │ │ │ ├── sum_amd64.s │ │ │ │ ├── sum_asm.go │ │ │ │ ├── sum_generic.go │ │ │ │ ├── sum_loong64.s │ │ │ │ ├── sum_ppc64x.s │ │ │ │ ├── sum_s390x.go │ │ │ │ └── sum_s390x.s │ │ │ ├── nacl/ │ │ │ │ └── secretbox/ │ │ │ │ └── secretbox.go │ │ │ ├── openpgp/ │ │ │ │ ├── armor/ │ │ │ │ │ ├── armor.go │ │ │ │ │ └── encode.go │ │ │ │ ├── canonical_text.go │ │ │ │ ├── elgamal/ │ │ │ │ │ └── elgamal.go │ │ │ │ ├── errors/ │ │ │ │ │ └── errors.go │ │ │ │ ├── keys.go │ │ │ │ ├── packet/ │ │ │ │ │ ├── compressed.go │ │ │ │ │ ├── config.go │ │ │ │ │ ├── encrypted_key.go │ │ │ │ │ ├── literal.go │ │ │ │ │ ├── ocfb.go │ │ │ │ │ ├── one_pass_signature.go │ │ │ │ │ ├── opaque.go │ │ │ │ │ ├── packet.go │ │ │ │ │ ├── private_key.go │ │ │ │ │ ├── public_key.go │ │ │ │ │ ├── public_key_v3.go │ │ │ │ │ ├── reader.go │ │ │ │ │ ├── signature.go │ │ │ │ │ ├── signature_v3.go │ │ │ │ │ ├── symmetric_key_encrypted.go │ │ │ │ │ ├── symmetrically_encrypted.go │ │ │ │ │ ├── userattribute.go │ │ │ │ │ └── userid.go │ │ │ │ ├── read.go │ │ │ │ ├── s2k/ │ │ │ │ │ └── s2k.go │ │ │ │ └── write.go │ │ │ ├── pbkdf2/ │ │ │ │ └── pbkdf2.go │ │ │ ├── salsa20/ │ │ │ │ └── salsa/ │ │ │ │ ├── hsalsa20.go │ │ │ │ ├── salsa208.go │ │ │ │ ├── salsa20_amd64.go │ │ │ │ ├── salsa20_amd64.s │ │ │ │ ├── salsa20_noasm.go │ │ │ │ └── salsa20_ref.go │ │ │ └── scrypt/ │ │ │ └── scrypt.go │ │ ├── net/ │ │ │ ├── LICENSE │ │ │ ├── PATENTS │ │ │ ├── http/ │ │ │ │ └── httpguts/ │ │ │ │ ├── guts.go │ │ │ │ └── httplex.go │ │ │ ├── http2/ │ │ │ │ ├── .gitignore │ │ │ │ ├── ascii.go │ │ │ │ ├── ciphers.go │ │ │ │ ├── client_conn_pool.go │ │ │ │ ├── client_priority_go126.go │ │ │ │ ├── client_priority_go127.go │ │ │ │ ├── config.go │ │ │ │ ├── config_go125.go │ │ │ │ ├── config_go126.go │ │ │ │ ├── databuffer.go │ │ │ │ ├── errors.go │ │ │ │ ├── flow.go │ │ │ │ ├── frame.go │ │ │ │ ├── gotrack.go │ │ │ │ ├── hpack/ │ │ │ │ │ ├── encode.go │ │ │ │ │ ├── hpack.go │ │ │ │ │ ├── huffman.go │ │ │ │ │ ├── static_table.go │ │ │ │ │ └── tables.go │ │ │ │ ├── http2.go │ │ │ │ ├── pipe.go │ │ │ │ ├── server.go │ │ │ │ ├── transport.go │ │ │ │ ├── unencrypted.go │ │ │ │ ├── write.go │ │ │ │ ├── writesched.go │ │ │ │ ├── writesched_priority_rfc7540.go │ │ │ │ ├── writesched_priority_rfc9218.go │ │ │ │ ├── writesched_random.go │ │ │ │ └── writesched_roundrobin.go │ │ │ ├── idna/ │ │ │ │ ├── go118.go │ │ │ │ ├── idna10.0.0.go │ │ │ │ ├── idna9.0.0.go │ │ │ │ ├── pre_go118.go │ │ │ │ ├── punycode.go │ │ │ │ ├── tables10.0.0.go │ │ │ │ ├── tables11.0.0.go │ │ │ │ ├── tables12.0.0.go │ │ │ │ ├── tables13.0.0.go │ │ │ │ ├── tables15.0.0.go │ │ │ │ ├── tables9.0.0.go │ │ │ │ ├── trie.go │ │ │ │ ├── trie12.0.0.go │ │ │ │ ├── trie13.0.0.go │ │ │ │ └── trieval.go │ │ │ ├── internal/ │ │ │ │ ├── httpcommon/ │ │ │ │ │ ├── ascii.go │ │ │ │ │ ├── headermap.go │ │ │ │ │ └── request.go │ │ │ │ ├── httpsfv/ │ │ │ │ │ └── httpsfv.go │ │ │ │ └── timeseries/ │ │ │ │ └── timeseries.go │ │ │ └── trace/ │ │ │ ├── events.go │ │ │ ├── histogram.go │ │ │ └── trace.go │ │ ├── oauth2/ │ │ │ ├── .travis.yml │ │ │ ├── CONTRIBUTING.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── deviceauth.go │ │ │ ├── internal/ │ │ │ │ ├── doc.go │ │ │ │ ├── oauth2.go │ │ │ │ ├── token.go │ │ │ │ └── transport.go │ │ │ ├── oauth2.go │ │ │ ├── pkce.go │ │ │ ├── token.go │ │ │ └── transport.go │ │ ├── sync/ │ │ │ ├── LICENSE │ │ │ ├── PATENTS │ │ │ ├── errgroup/ │ │ │ │ └── errgroup.go │ │ │ └── semaphore/ │ │ │ └── semaphore.go │ │ ├── sys/ │ │ │ ├── LICENSE │ │ │ ├── PATENTS │ │ │ ├── cpu/ │ │ │ │ ├── asm_aix_ppc64.s │ │ │ │ ├── asm_darwin_arm64_gc.s │ │ │ │ ├── asm_darwin_x86_gc.s │ │ │ │ ├── byteorder.go │ │ │ │ ├── cpu.go │ │ │ │ ├── cpu_aix.go │ │ │ │ ├── cpu_arm.go │ │ │ │ ├── cpu_arm64.go │ │ │ │ ├── cpu_arm64.s │ │ │ │ ├── cpu_darwin_arm64.go │ │ │ │ ├── cpu_darwin_arm64_other.go │ │ │ │ ├── cpu_darwin_x86.go │ │ │ │ ├── cpu_gc_arm64.go │ │ │ │ ├── cpu_gc_s390x.go │ │ │ │ ├── cpu_gc_x86.go │ │ │ │ ├── cpu_gc_x86.s │ │ │ │ ├── cpu_gccgo_arm64.go │ │ │ │ ├── cpu_gccgo_s390x.go │ │ │ │ ├── cpu_gccgo_x86.c │ │ │ │ ├── cpu_gccgo_x86.go │ │ │ │ ├── cpu_linux.go │ │ │ │ ├── cpu_linux_arm.go │ │ │ │ ├── cpu_linux_arm64.go │ │ │ │ ├── cpu_linux_loong64.go │ │ │ │ ├── cpu_linux_mips64x.go │ │ │ │ ├── cpu_linux_noinit.go │ │ │ │ ├── cpu_linux_ppc64x.go │ │ │ │ ├── cpu_linux_riscv64.go │ │ │ │ ├── cpu_linux_s390x.go │ │ │ │ ├── cpu_loong64.go │ │ │ │ ├── cpu_loong64.s │ │ │ │ ├── cpu_mips64x.go │ │ │ │ ├── cpu_mipsx.go │ │ │ │ ├── cpu_netbsd_arm64.go │ │ │ │ ├── cpu_openbsd_arm64.go │ │ │ │ ├── cpu_openbsd_arm64.s │ │ │ │ ├── cpu_other_arm.go │ │ │ │ ├── cpu_other_arm64.go │ │ │ │ ├── cpu_other_mips64x.go │ │ │ │ ├── cpu_other_ppc64x.go │ │ │ │ ├── cpu_other_riscv64.go │ │ │ │ ├── cpu_other_x86.go │ │ │ │ ├── cpu_ppc64x.go │ │ │ │ ├── cpu_riscv64.go │ │ │ │ ├── cpu_s390x.go │ │ │ │ ├── cpu_s390x.s │ │ │ │ ├── cpu_wasm.go │ │ │ │ ├── cpu_windows_arm64.go │ │ │ │ ├── cpu_x86.go │ │ │ │ ├── cpu_zos.go │ │ │ │ ├── cpu_zos_s390x.go │ │ │ │ ├── endian_big.go │ │ │ │ ├── endian_little.go │ │ │ │ ├── hwcap_linux.go │ │ │ │ ├── parse.go │ │ │ │ ├── proc_cpuinfo_linux.go │ │ │ │ ├── runtime_auxv.go │ │ │ │ ├── runtime_auxv_go121.go │ │ │ │ ├── syscall_aix_gccgo.go │ │ │ │ ├── syscall_aix_ppc64_gc.go │ │ │ │ ├── syscall_darwin_arm64_gc.go │ │ │ │ └── syscall_darwin_x86_gc.go │ │ │ ├── plan9/ │ │ │ │ ├── asm.s │ │ │ │ ├── asm_plan9_386.s │ │ │ │ ├── asm_plan9_amd64.s │ │ │ │ ├── asm_plan9_arm.s │ │ │ │ ├── const_plan9.go │ │ │ │ ├── dir_plan9.go │ │ │ │ ├── env_plan9.go │ │ │ │ ├── errors_plan9.go │ │ │ │ ├── mkall.sh │ │ │ │ ├── mkerrors.sh │ │ │ │ ├── mksysnum_plan9.sh │ │ │ │ ├── pwd_plan9.go │ │ │ │ ├── race.go │ │ │ │ ├── race0.go │ │ │ │ ├── str.go │ │ │ │ ├── syscall.go │ │ │ │ ├── syscall_plan9.go │ │ │ │ ├── zsyscall_plan9_386.go │ │ │ │ ├── zsyscall_plan9_amd64.go │ │ │ │ ├── zsyscall_plan9_arm.go │ │ │ │ └── zsysnum_plan9.go │ │ │ ├── unix/ │ │ │ │ ├── .gitignore │ │ │ │ ├── README.md │ │ │ │ ├── affinity_linux.go │ │ │ │ ├── aliases.go │ │ │ │ ├── asm_aix_ppc64.s │ │ │ │ ├── asm_bsd_386.s │ │ │ │ ├── asm_bsd_amd64.s │ │ │ │ ├── asm_bsd_arm.s │ │ │ │ ├── asm_bsd_arm64.s │ │ │ │ ├── asm_bsd_ppc64.s │ │ │ │ ├── asm_bsd_riscv64.s │ │ │ │ ├── asm_linux_386.s │ │ │ │ ├── asm_linux_amd64.s │ │ │ │ ├── asm_linux_arm.s │ │ │ │ ├── asm_linux_arm64.s │ │ │ │ ├── asm_linux_loong64.s │ │ │ │ ├── asm_linux_mips64x.s │ │ │ │ ├── asm_linux_mipsx.s │ │ │ │ ├── asm_linux_ppc64x.s │ │ │ │ ├── asm_linux_riscv64.s │ │ │ │ ├── asm_linux_s390x.s │ │ │ │ ├── asm_openbsd_mips64.s │ │ │ │ ├── asm_solaris_amd64.s │ │ │ │ ├── asm_zos_s390x.s │ │ │ │ ├── auxv.go │ │ │ │ ├── auxv_unsupported.go │ │ │ │ ├── bluetooth_linux.go │ │ │ │ ├── bpxsvc_zos.go │ │ │ │ ├── bpxsvc_zos.s │ │ │ │ ├── cap_freebsd.go │ │ │ │ ├── constants.go │ │ │ │ ├── dev_aix_ppc.go │ │ │ │ ├── dev_aix_ppc64.go │ │ │ │ ├── dev_darwin.go │ │ │ │ ├── dev_dragonfly.go │ │ │ │ ├── dev_freebsd.go │ │ │ │ ├── dev_linux.go │ │ │ │ ├── dev_netbsd.go │ │ │ │ ├── dev_openbsd.go │ │ │ │ ├── dev_zos.go │ │ │ │ ├── dirent.go │ │ │ │ ├── endian_big.go │ │ │ │ ├── endian_little.go │ │ │ │ ├── env_unix.go │ │ │ │ ├── fcntl.go │ │ │ │ ├── fcntl_darwin.go │ │ │ │ ├── fcntl_linux_32bit.go │ │ │ │ ├── fdset.go │ │ │ │ ├── gccgo.go │ │ │ │ ├── gccgo_c.c │ │ │ │ ├── gccgo_linux_amd64.go │ │ │ │ ├── ifreq_linux.go │ │ │ │ ├── ioctl_linux.go │ │ │ │ ├── ioctl_signed.go │ │ │ │ ├── ioctl_unsigned.go │ │ │ │ ├── ioctl_zos.go │ │ │ │ ├── mkall.sh │ │ │ │ ├── mkerrors.sh │ │ │ │ ├── mmap_nomremap.go │ │ │ │ ├── mremap.go │ │ │ │ ├── pagesize_unix.go │ │ │ │ ├── pledge_openbsd.go │ │ │ │ ├── ptrace_darwin.go │ │ │ │ ├── ptrace_ios.go │ │ │ │ ├── race.go │ │ │ │ ├── race0.go │ │ │ │ ├── readdirent_getdents.go │ │ │ │ ├── readdirent_getdirentries.go │ │ │ │ ├── sockcmsg_dragonfly.go │ │ │ │ ├── sockcmsg_linux.go │ │ │ │ ├── sockcmsg_unix.go │ │ │ │ ├── sockcmsg_unix_other.go │ │ │ │ ├── sockcmsg_zos.go │ │ │ │ ├── symaddr_zos_s390x.s │ │ │ │ ├── syscall.go │ │ │ │ ├── syscall_aix.go │ │ │ │ ├── syscall_aix_ppc.go │ │ │ │ ├── syscall_aix_ppc64.go │ │ │ │ ├── syscall_bsd.go │ │ │ │ ├── syscall_darwin.go │ │ │ │ ├── syscall_darwin_amd64.go │ │ │ │ ├── syscall_darwin_arm64.go │ │ │ │ ├── syscall_darwin_libSystem.go │ │ │ │ ├── syscall_dragonfly.go │ │ │ │ ├── syscall_dragonfly_amd64.go │ │ │ │ ├── syscall_freebsd.go │ │ │ │ ├── syscall_freebsd_386.go │ │ │ │ ├── syscall_freebsd_amd64.go │ │ │ │ ├── syscall_freebsd_arm.go │ │ │ │ ├── syscall_freebsd_arm64.go │ │ │ │ ├── syscall_freebsd_riscv64.go │ │ │ │ ├── syscall_hurd.go │ │ │ │ ├── syscall_hurd_386.go │ │ │ │ ├── syscall_illumos.go │ │ │ │ ├── syscall_linux.go │ │ │ │ ├── syscall_linux_386.go │ │ │ │ ├── syscall_linux_alarm.go │ │ │ │ ├── syscall_linux_amd64.go │ │ │ │ ├── syscall_linux_amd64_gc.go │ │ │ │ ├── syscall_linux_arm.go │ │ │ │ ├── syscall_linux_arm64.go │ │ │ │ ├── syscall_linux_gc.go │ │ │ │ ├── syscall_linux_gc_386.go │ │ │ │ ├── syscall_linux_gc_arm.go │ │ │ │ ├── syscall_linux_gccgo_386.go │ │ │ │ ├── syscall_linux_gccgo_arm.go │ │ │ │ ├── syscall_linux_loong64.go │ │ │ │ ├── syscall_linux_mips64x.go │ │ │ │ ├── syscall_linux_mipsx.go │ │ │ │ ├── syscall_linux_ppc.go │ │ │ │ ├── syscall_linux_ppc64x.go │ │ │ │ ├── syscall_linux_riscv64.go │ │ │ │ ├── syscall_linux_s390x.go │ │ │ │ ├── syscall_linux_sparc64.go │ │ │ │ ├── syscall_netbsd.go │ │ │ │ ├── syscall_netbsd_386.go │ │ │ │ ├── syscall_netbsd_amd64.go │ │ │ │ ├── syscall_netbsd_arm.go │ │ │ │ ├── syscall_netbsd_arm64.go │ │ │ │ ├── syscall_openbsd.go │ │ │ │ ├── syscall_openbsd_386.go │ │ │ │ ├── syscall_openbsd_amd64.go │ │ │ │ ├── syscall_openbsd_arm.go │ │ │ │ ├── syscall_openbsd_arm64.go │ │ │ │ ├── syscall_openbsd_libc.go │ │ │ │ ├── syscall_openbsd_mips64.go │ │ │ │ ├── syscall_openbsd_ppc64.go │ │ │ │ ├── syscall_openbsd_riscv64.go │ │ │ │ ├── syscall_solaris.go │ │ │ │ ├── syscall_solaris_amd64.go │ │ │ │ ├── syscall_unix.go │ │ │ │ ├── syscall_unix_gc.go │ │ │ │ ├── syscall_unix_gc_ppc64x.go │ │ │ │ ├── syscall_zos_s390x.go │ │ │ │ ├── sysvshm_linux.go │ │ │ │ ├── sysvshm_unix.go │ │ │ │ ├── sysvshm_unix_other.go │ │ │ │ ├── timestruct.go │ │ │ │ ├── unveil_openbsd.go │ │ │ │ ├── vgetrandom_linux.go │ │ │ │ ├── vgetrandom_unsupported.go │ │ │ │ ├── xattr_bsd.go │ │ │ │ ├── zerrors_aix_ppc.go │ │ │ │ ├── zerrors_aix_ppc64.go │ │ │ │ ├── zerrors_darwin_amd64.go │ │ │ │ ├── zerrors_darwin_arm64.go │ │ │ │ ├── zerrors_dragonfly_amd64.go │ │ │ │ ├── zerrors_freebsd_386.go │ │ │ │ ├── zerrors_freebsd_amd64.go │ │ │ │ ├── zerrors_freebsd_arm.go │ │ │ │ ├── zerrors_freebsd_arm64.go │ │ │ │ ├── zerrors_freebsd_riscv64.go │ │ │ │ ├── zerrors_linux.go │ │ │ │ ├── zerrors_linux_386.go │ │ │ │ ├── zerrors_linux_amd64.go │ │ │ │ ├── zerrors_linux_arm.go │ │ │ │ ├── zerrors_linux_arm64.go │ │ │ │ ├── zerrors_linux_loong64.go │ │ │ │ ├── zerrors_linux_mips.go │ │ │ │ ├── zerrors_linux_mips64.go │ │ │ │ ├── zerrors_linux_mips64le.go │ │ │ │ ├── zerrors_linux_mipsle.go │ │ │ │ ├── zerrors_linux_ppc.go │ │ │ │ ├── zerrors_linux_ppc64.go │ │ │ │ ├── zerrors_linux_ppc64le.go │ │ │ │ ├── zerrors_linux_riscv64.go │ │ │ │ ├── zerrors_linux_s390x.go │ │ │ │ ├── zerrors_linux_sparc64.go │ │ │ │ ├── zerrors_netbsd_386.go │ │ │ │ ├── zerrors_netbsd_amd64.go │ │ │ │ ├── zerrors_netbsd_arm.go │ │ │ │ ├── zerrors_netbsd_arm64.go │ │ │ │ ├── zerrors_openbsd_386.go │ │ │ │ ├── zerrors_openbsd_amd64.go │ │ │ │ ├── zerrors_openbsd_arm.go │ │ │ │ ├── zerrors_openbsd_arm64.go │ │ │ │ ├── zerrors_openbsd_mips64.go │ │ │ │ ├── zerrors_openbsd_ppc64.go │ │ │ │ ├── zerrors_openbsd_riscv64.go │ │ │ │ ├── zerrors_solaris_amd64.go │ │ │ │ ├── zerrors_zos_s390x.go │ │ │ │ ├── zptrace_armnn_linux.go │ │ │ │ ├── zptrace_linux_arm64.go │ │ │ │ ├── zptrace_mipsnn_linux.go │ │ │ │ ├── zptrace_mipsnnle_linux.go │ │ │ │ ├── zptrace_x86_linux.go │ │ │ │ ├── zsymaddr_zos_s390x.s │ │ │ │ ├── zsyscall_aix_ppc.go │ │ │ │ ├── zsyscall_aix_ppc64.go │ │ │ │ ├── zsyscall_aix_ppc64_gc.go │ │ │ │ ├── zsyscall_aix_ppc64_gccgo.go │ │ │ │ ├── zsyscall_darwin_amd64.go │ │ │ │ ├── zsyscall_darwin_amd64.s │ │ │ │ ├── zsyscall_darwin_arm64.go │ │ │ │ ├── zsyscall_darwin_arm64.s │ │ │ │ ├── zsyscall_dragonfly_amd64.go │ │ │ │ ├── zsyscall_freebsd_386.go │ │ │ │ ├── zsyscall_freebsd_amd64.go │ │ │ │ ├── zsyscall_freebsd_arm.go │ │ │ │ ├── zsyscall_freebsd_arm64.go │ │ │ │ ├── zsyscall_freebsd_riscv64.go │ │ │ │ ├── zsyscall_illumos_amd64.go │ │ │ │ ├── zsyscall_linux.go │ │ │ │ ├── zsyscall_linux_386.go │ │ │ │ ├── zsyscall_linux_amd64.go │ │ │ │ ├── zsyscall_linux_arm.go │ │ │ │ ├── zsyscall_linux_arm64.go │ │ │ │ ├── zsyscall_linux_loong64.go │ │ │ │ ├── zsyscall_linux_mips.go │ │ │ │ ├── zsyscall_linux_mips64.go │ │ │ │ ├── zsyscall_linux_mips64le.go │ │ │ │ ├── zsyscall_linux_mipsle.go │ │ │ │ ├── zsyscall_linux_ppc.go │ │ │ │ ├── zsyscall_linux_ppc64.go │ │ │ │ ├── zsyscall_linux_ppc64le.go │ │ │ │ ├── zsyscall_linux_riscv64.go │ │ │ │ ├── zsyscall_linux_s390x.go │ │ │ │ ├── zsyscall_linux_sparc64.go │ │ │ │ ├── zsyscall_netbsd_386.go │ │ │ │ ├── zsyscall_netbsd_amd64.go │ │ │ │ ├── zsyscall_netbsd_arm.go │ │ │ │ ├── zsyscall_netbsd_arm64.go │ │ │ │ ├── zsyscall_openbsd_386.go │ │ │ │ ├── zsyscall_openbsd_386.s │ │ │ │ ├── zsyscall_openbsd_amd64.go │ │ │ │ ├── zsyscall_openbsd_amd64.s │ │ │ │ ├── zsyscall_openbsd_arm.go │ │ │ │ ├── zsyscall_openbsd_arm.s │ │ │ │ ├── zsyscall_openbsd_arm64.go │ │ │ │ ├── zsyscall_openbsd_arm64.s │ │ │ │ ├── zsyscall_openbsd_mips64.go │ │ │ │ ├── zsyscall_openbsd_mips64.s │ │ │ │ ├── zsyscall_openbsd_ppc64.go │ │ │ │ ├── zsyscall_openbsd_ppc64.s │ │ │ │ ├── zsyscall_openbsd_riscv64.go │ │ │ │ ├── zsyscall_openbsd_riscv64.s │ │ │ │ ├── zsyscall_solaris_amd64.go │ │ │ │ ├── zsyscall_zos_s390x.go │ │ │ │ ├── zsysctl_openbsd_386.go │ │ │ │ ├── zsysctl_openbsd_amd64.go │ │ │ │ ├── zsysctl_openbsd_arm.go │ │ │ │ ├── zsysctl_openbsd_arm64.go │ │ │ │ ├── zsysctl_openbsd_mips64.go │ │ │ │ ├── zsysctl_openbsd_ppc64.go │ │ │ │ ├── zsysctl_openbsd_riscv64.go │ │ │ │ ├── zsysnum_darwin_amd64.go │ │ │ │ ├── zsysnum_darwin_arm64.go │ │ │ │ ├── zsysnum_dragonfly_amd64.go │ │ │ │ ├── zsysnum_freebsd_386.go │ │ │ │ ├── zsysnum_freebsd_amd64.go │ │ │ │ ├── zsysnum_freebsd_arm.go │ │ │ │ ├── zsysnum_freebsd_arm64.go │ │ │ │ ├── zsysnum_freebsd_riscv64.go │ │ │ │ ├── zsysnum_linux_386.go │ │ │ │ ├── zsysnum_linux_amd64.go │ │ │ │ ├── zsysnum_linux_arm.go │ │ │ │ ├── zsysnum_linux_arm64.go │ │ │ │ ├── zsysnum_linux_loong64.go │ │ │ │ ├── zsysnum_linux_mips.go │ │ │ │ ├── zsysnum_linux_mips64.go │ │ │ │ ├── zsysnum_linux_mips64le.go │ │ │ │ ├── zsysnum_linux_mipsle.go │ │ │ │ ├── zsysnum_linux_ppc.go │ │ │ │ ├── zsysnum_linux_ppc64.go │ │ │ │ ├── zsysnum_linux_ppc64le.go │ │ │ │ ├── zsysnum_linux_riscv64.go │ │ │ │ ├── zsysnum_linux_s390x.go │ │ │ │ ├── zsysnum_linux_sparc64.go │ │ │ │ ├── zsysnum_netbsd_386.go │ │ │ │ ├── zsysnum_netbsd_amd64.go │ │ │ │ ├── zsysnum_netbsd_arm.go │ │ │ │ ├── zsysnum_netbsd_arm64.go │ │ │ │ ├── zsysnum_openbsd_386.go │ │ │ │ ├── zsysnum_openbsd_amd64.go │ │ │ │ ├── zsysnum_openbsd_arm.go │ │ │ │ ├── zsysnum_openbsd_arm64.go │ │ │ │ ├── zsysnum_openbsd_mips64.go │ │ │ │ ├── zsysnum_openbsd_ppc64.go │ │ │ │ ├── zsysnum_openbsd_riscv64.go │ │ │ │ ├── zsysnum_zos_s390x.go │ │ │ │ ├── ztypes_aix_ppc.go │ │ │ │ ├── ztypes_aix_ppc64.go │ │ │ │ ├── ztypes_darwin_amd64.go │ │ │ │ ├── ztypes_darwin_arm64.go │ │ │ │ ├── ztypes_dragonfly_amd64.go │ │ │ │ ├── ztypes_freebsd_386.go │ │ │ │ ├── ztypes_freebsd_amd64.go │ │ │ │ ├── ztypes_freebsd_arm.go │ │ │ │ ├── ztypes_freebsd_arm64.go │ │ │ │ ├── ztypes_freebsd_riscv64.go │ │ │ │ ├── ztypes_linux.go │ │ │ │ ├── ztypes_linux_386.go │ │ │ │ ├── ztypes_linux_amd64.go │ │ │ │ ├── ztypes_linux_arm.go │ │ │ │ ├── ztypes_linux_arm64.go │ │ │ │ ├── ztypes_linux_loong64.go │ │ │ │ ├── ztypes_linux_mips.go │ │ │ │ ├── ztypes_linux_mips64.go │ │ │ │ ├── ztypes_linux_mips64le.go │ │ │ │ ├── ztypes_linux_mipsle.go │ │ │ │ ├── ztypes_linux_ppc.go │ │ │ │ ├── ztypes_linux_ppc64.go │ │ │ │ ├── ztypes_linux_ppc64le.go │ │ │ │ ├── ztypes_linux_riscv64.go │ │ │ │ ├── ztypes_linux_s390x.go │ │ │ │ ├── ztypes_linux_sparc64.go │ │ │ │ ├── ztypes_netbsd_386.go │ │ │ │ ├── ztypes_netbsd_amd64.go │ │ │ │ ├── ztypes_netbsd_arm.go │ │ │ │ ├── ztypes_netbsd_arm64.go │ │ │ │ ├── ztypes_openbsd_386.go │ │ │ │ ├── ztypes_openbsd_amd64.go │ │ │ │ ├── ztypes_openbsd_arm.go │ │ │ │ ├── ztypes_openbsd_arm64.go │ │ │ │ ├── ztypes_openbsd_mips64.go │ │ │ │ ├── ztypes_openbsd_ppc64.go │ │ │ │ ├── ztypes_openbsd_riscv64.go │ │ │ │ ├── ztypes_solaris_amd64.go │ │ │ │ └── ztypes_zos_s390x.go │ │ │ └── windows/ │ │ │ ├── aliases.go │ │ │ ├── dll_windows.go │ │ │ ├── env_windows.go │ │ │ ├── eventlog.go │ │ │ ├── exec_windows.go │ │ │ ├── memory_windows.go │ │ │ ├── mkerrors.bash │ │ │ ├── mkknownfolderids.bash │ │ │ ├── mksyscall.go │ │ │ ├── race.go │ │ │ ├── race0.go │ │ │ ├── security_windows.go │ │ │ ├── service.go │ │ │ ├── setupapi_windows.go │ │ │ ├── str.go │ │ │ ├── syscall.go │ │ │ ├── syscall_windows.go │ │ │ ├── types_windows.go │ │ │ ├── types_windows_386.go │ │ │ ├── types_windows_amd64.go │ │ │ ├── types_windows_arm.go │ │ │ ├── types_windows_arm64.go │ │ │ ├── zerrors_windows.go │ │ │ ├── zknownfolderids_windows.go │ │ │ └── zsyscall_windows.go │ │ ├── term/ │ │ │ ├── CONTRIBUTING.md │ │ │ ├── LICENSE │ │ │ ├── PATENTS │ │ │ ├── README.md │ │ │ ├── codereview.cfg │ │ │ ├── term.go │ │ │ ├── term_plan9.go │ │ │ ├── term_unix.go │ │ │ ├── term_unix_bsd.go │ │ │ ├── term_unix_other.go │ │ │ ├── term_unsupported.go │ │ │ ├── term_windows.go │ │ │ └── terminal.go │ │ └── text/ │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── feature/ │ │ │ └── plural/ │ │ │ ├── common.go │ │ │ ├── message.go │ │ │ ├── plural.go │ │ │ └── tables.go │ │ ├── internal/ │ │ │ ├── catmsg/ │ │ │ │ ├── catmsg.go │ │ │ │ ├── codec.go │ │ │ │ └── varint.go │ │ │ ├── format/ │ │ │ │ ├── format.go │ │ │ │ └── parser.go │ │ │ ├── internal.go │ │ │ ├── language/ │ │ │ │ ├── common.go │ │ │ │ ├── compact/ │ │ │ │ │ ├── compact.go │ │ │ │ │ ├── language.go │ │ │ │ │ ├── parents.go │ │ │ │ │ ├── tables.go │ │ │ │ │ └── tags.go │ │ │ │ ├── compact.go │ │ │ │ ├── compose.go │ │ │ │ ├── coverage.go │ │ │ │ ├── language.go │ │ │ │ ├── lookup.go │ │ │ │ ├── match.go │ │ │ │ ├── parse.go │ │ │ │ ├── tables.go │ │ │ │ └── tags.go │ │ │ ├── match.go │ │ │ ├── number/ │ │ │ │ ├── common.go │ │ │ │ ├── decimal.go │ │ │ │ ├── format.go │ │ │ │ ├── number.go │ │ │ │ ├── pattern.go │ │ │ │ ├── roundingmode_string.go │ │ │ │ └── tables.go │ │ │ ├── stringset/ │ │ │ │ └── set.go │ │ │ └── tag/ │ │ │ └── tag.go │ │ ├── language/ │ │ │ ├── coverage.go │ │ │ ├── doc.go │ │ │ ├── language.go │ │ │ ├── match.go │ │ │ ├── parse.go │ │ │ ├── tables.go │ │ │ └── tags.go │ │ ├── message/ │ │ │ ├── catalog/ │ │ │ │ ├── catalog.go │ │ │ │ └── dict.go │ │ │ ├── catalog.go │ │ │ ├── doc.go │ │ │ ├── format.go │ │ │ ├── message.go │ │ │ └── print.go │ │ ├── secure/ │ │ │ └── bidirule/ │ │ │ └── bidirule.go │ │ ├── transform/ │ │ │ └── transform.go │ │ └── unicode/ │ │ ├── bidi/ │ │ │ ├── bidi.go │ │ │ ├── bracket.go │ │ │ ├── core.go │ │ │ ├── prop.go │ │ │ ├── tables15.0.0.go │ │ │ ├── tables17.0.0.go │ │ │ └── trieval.go │ │ └── norm/ │ │ ├── composition.go │ │ ├── forminfo.go │ │ ├── input.go │ │ ├── iter.go │ │ ├── normalize.go │ │ ├── readwriter.go │ │ ├── tables15.0.0.go │ │ ├── tables17.0.0.go │ │ ├── transform.go │ │ └── trie.go │ ├── google.golang.org/ │ │ ├── genproto/ │ │ │ └── googleapis/ │ │ │ ├── api/ │ │ │ │ ├── LICENSE │ │ │ │ ├── annotations/ │ │ │ │ │ ├── annotations.pb.go │ │ │ │ │ ├── client.pb.go │ │ │ │ │ ├── field_behavior.pb.go │ │ │ │ │ ├── field_info.pb.go │ │ │ │ │ ├── http.pb.go │ │ │ │ │ ├── resource.pb.go │ │ │ │ │ └── routing.pb.go │ │ │ │ └── launch_stage.pb.go │ │ │ └── rpc/ │ │ │ ├── LICENSE │ │ │ └── status/ │ │ │ └── status.pb.go │ │ ├── grpc/ │ │ │ ├── AUTHORS │ │ │ ├── CODE-OF-CONDUCT.md │ │ │ ├── CONTRIBUTING.md │ │ │ ├── GOVERNANCE.md │ │ │ ├── LICENSE │ │ │ ├── MAINTAINERS.md │ │ │ ├── Makefile │ │ │ ├── NOTICE.txt │ │ │ ├── README.md │ │ │ ├── SECURITY.md │ │ │ ├── attributes/ │ │ │ │ └── attributes.go │ │ │ ├── backoff/ │ │ │ │ └── backoff.go │ │ │ ├── backoff.go │ │ │ ├── balancer/ │ │ │ │ ├── balancer.go │ │ │ │ ├── base/ │ │ │ │ │ ├── balancer.go │ │ │ │ │ └── base.go │ │ │ │ ├── conn_state_evaluator.go │ │ │ │ ├── endpointsharding/ │ │ │ │ │ └── endpointsharding.go │ │ │ │ ├── grpclb/ │ │ │ │ │ └── state/ │ │ │ │ │ └── state.go │ │ │ │ ├── pickfirst/ │ │ │ │ │ ├── internal/ │ │ │ │ │ │ └── internal.go │ │ │ │ │ └── pickfirst.go │ │ │ │ ├── roundrobin/ │ │ │ │ │ └── roundrobin.go │ │ │ │ └── subconn.go │ │ │ ├── balancer_wrapper.go │ │ │ ├── binarylog/ │ │ │ │ └── grpc_binarylog_v1/ │ │ │ │ └── binarylog.pb.go │ │ │ ├── call.go │ │ │ ├── channelz/ │ │ │ │ └── channelz.go │ │ │ ├── clientconn.go │ │ │ ├── codec.go │ │ │ ├── codes/ │ │ │ │ ├── code_string.go │ │ │ │ └── codes.go │ │ │ ├── connectivity/ │ │ │ │ └── connectivity.go │ │ │ ├── credentials/ │ │ │ │ ├── credentials.go │ │ │ │ ├── insecure/ │ │ │ │ │ └── insecure.go │ │ │ │ └── tls.go │ │ │ ├── dialoptions.go │ │ │ ├── doc.go │ │ │ ├── encoding/ │ │ │ │ ├── encoding.go │ │ │ │ ├── encoding_v2.go │ │ │ │ ├── internal/ │ │ │ │ │ └── internal.go │ │ │ │ └── proto/ │ │ │ │ └── proto.go │ │ │ ├── experimental/ │ │ │ │ └── stats/ │ │ │ │ ├── metricregistry.go │ │ │ │ └── metrics.go │ │ │ ├── grpclog/ │ │ │ │ ├── component.go │ │ │ │ ├── grpclog.go │ │ │ │ ├── internal/ │ │ │ │ │ ├── grpclog.go │ │ │ │ │ ├── logger.go │ │ │ │ │ └── loggerv2.go │ │ │ │ ├── logger.go │ │ │ │ └── loggerv2.go │ │ │ ├── interceptor.go │ │ │ ├── internal/ │ │ │ │ ├── backoff/ │ │ │ │ │ └── backoff.go │ │ │ │ ├── balancer/ │ │ │ │ │ └── gracefulswitch/ │ │ │ │ │ ├── config.go │ │ │ │ │ └── gracefulswitch.go │ │ │ │ ├── balancerload/ │ │ │ │ │ └── load.go │ │ │ │ ├── binarylog/ │ │ │ │ │ ├── binarylog.go │ │ │ │ │ ├── binarylog_testutil.go │ │ │ │ │ ├── env_config.go │ │ │ │ │ ├── method_logger.go │ │ │ │ │ └── sink.go │ │ │ │ ├── buffer/ │ │ │ │ │ └── unbounded.go │ │ │ │ ├── channelz/ │ │ │ │ │ ├── channel.go │ │ │ │ │ ├── channelmap.go │ │ │ │ │ ├── funcs.go │ │ │ │ │ ├── logging.go │ │ │ │ │ ├── server.go │ │ │ │ │ ├── socket.go │ │ │ │ │ ├── subchannel.go │ │ │ │ │ ├── syscall_linux.go │ │ │ │ │ ├── syscall_nonlinux.go │ │ │ │ │ └── trace.go │ │ │ │ ├── credentials/ │ │ │ │ │ ├── credentials.go │ │ │ │ │ ├── spiffe.go │ │ │ │ │ ├── syscallconn.go │ │ │ │ │ └── util.go │ │ │ │ ├── envconfig/ │ │ │ │ │ ├── envconfig.go │ │ │ │ │ ├── observability.go │ │ │ │ │ └── xds.go │ │ │ │ ├── experimental.go │ │ │ │ ├── grpclog/ │ │ │ │ │ └── prefix_logger.go │ │ │ │ ├── grpcsync/ │ │ │ │ │ ├── callback_serializer.go │ │ │ │ │ ├── event.go │ │ │ │ │ └── pubsub.go │ │ │ │ ├── grpcutil/ │ │ │ │ │ ├── compressor.go │ │ │ │ │ ├── encode_duration.go │ │ │ │ │ ├── grpcutil.go │ │ │ │ │ ├── metadata.go │ │ │ │ │ ├── method.go │ │ │ │ │ └── regex.go │ │ │ │ ├── idle/ │ │ │ │ │ └── idle.go │ │ │ │ ├── internal.go │ │ │ │ ├── metadata/ │ │ │ │ │ └── metadata.go │ │ │ │ ├── pretty/ │ │ │ │ │ └── pretty.go │ │ │ │ ├── proxyattributes/ │ │ │ │ │ └── proxyattributes.go │ │ │ │ ├── resolver/ │ │ │ │ │ ├── config_selector.go │ │ │ │ │ ├── delegatingresolver/ │ │ │ │ │ │ └── delegatingresolver.go │ │ │ │ │ ├── dns/ │ │ │ │ │ │ ├── dns_resolver.go │ │ │ │ │ │ └── internal/ │ │ │ │ │ │ └── internal.go │ │ │ │ │ ├── passthrough/ │ │ │ │ │ │ └── passthrough.go │ │ │ │ │ └── unix/ │ │ │ │ │ └── unix.go │ │ │ │ ├── serviceconfig/ │ │ │ │ │ ├── duration.go │ │ │ │ │ └── serviceconfig.go │ │ │ │ ├── stats/ │ │ │ │ │ ├── labels.go │ │ │ │ │ ├── metrics_recorder_list.go │ │ │ │ │ └── stats.go │ │ │ │ ├── status/ │ │ │ │ │ └── status.go │ │ │ │ ├── syscall/ │ │ │ │ │ ├── syscall_linux.go │ │ │ │ │ └── syscall_nonlinux.go │ │ │ │ ├── tcp_keepalive_others.go │ │ │ │ ├── tcp_keepalive_unix.go │ │ │ │ ├── tcp_keepalive_windows.go │ │ │ │ └── transport/ │ │ │ │ ├── bdp_estimator.go │ │ │ │ ├── client_stream.go │ │ │ │ ├── controlbuf.go │ │ │ │ ├── defaults.go │ │ │ │ ├── flowcontrol.go │ │ │ │ ├── handler_server.go │ │ │ │ ├── http2_client.go │ │ │ │ ├── http2_server.go │ │ │ │ ├── http_util.go │ │ │ │ ├── logging.go │ │ │ │ ├── networktype/ │ │ │ │ │ └── networktype.go │ │ │ │ ├── proxy.go │ │ │ │ ├── server_stream.go │ │ │ │ └── transport.go │ │ │ ├── keepalive/ │ │ │ │ └── keepalive.go │ │ │ ├── mem/ │ │ │ │ ├── buffer_pool.go │ │ │ │ ├── buffer_slice.go │ │ │ │ └── buffers.go │ │ │ ├── metadata/ │ │ │ │ └── metadata.go │ │ │ ├── peer/ │ │ │ │ └── peer.go │ │ │ ├── picker_wrapper.go │ │ │ ├── preloader.go │ │ │ ├── resolver/ │ │ │ │ ├── dns/ │ │ │ │ │ └── dns_resolver.go │ │ │ │ ├── map.go │ │ │ │ └── resolver.go │ │ │ ├── resolver_wrapper.go │ │ │ ├── rpc_util.go │ │ │ ├── server.go │ │ │ ├── service_config.go │ │ │ ├── serviceconfig/ │ │ │ │ └── serviceconfig.go │ │ │ ├── stats/ │ │ │ │ ├── handlers.go │ │ │ │ ├── metrics.go │ │ │ │ └── stats.go │ │ │ ├── status/ │ │ │ │ └── status.go │ │ │ ├── stream.go │ │ │ ├── stream_interfaces.go │ │ │ ├── tap/ │ │ │ │ └── tap.go │ │ │ ├── trace.go │ │ │ ├── trace_notrace.go │ │ │ ├── trace_withtrace.go │ │ │ └── version.go │ │ └── protobuf/ │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── encoding/ │ │ │ ├── protojson/ │ │ │ │ ├── decode.go │ │ │ │ ├── doc.go │ │ │ │ ├── encode.go │ │ │ │ └── well_known_types.go │ │ │ ├── prototext/ │ │ │ │ ├── decode.go │ │ │ │ ├── doc.go │ │ │ │ └── encode.go │ │ │ └── protowire/ │ │ │ └── wire.go │ │ ├── internal/ │ │ │ ├── descfmt/ │ │ │ │ └── stringer.go │ │ │ ├── descopts/ │ │ │ │ └── options.go │ │ │ ├── detrand/ │ │ │ │ └── rand.go │ │ │ ├── editiondefaults/ │ │ │ │ ├── defaults.go │ │ │ │ └── editions_defaults.binpb │ │ │ ├── editionssupport/ │ │ │ │ └── editions.go │ │ │ ├── encoding/ │ │ │ │ ├── defval/ │ │ │ │ │ └── default.go │ │ │ │ ├── json/ │ │ │ │ │ ├── decode.go │ │ │ │ │ ├── decode_number.go │ │ │ │ │ ├── decode_string.go │ │ │ │ │ ├── decode_token.go │ │ │ │ │ └── encode.go │ │ │ │ ├── messageset/ │ │ │ │ │ └── messageset.go │ │ │ │ ├── tag/ │ │ │ │ │ └── tag.go │ │ │ │ └── text/ │ │ │ │ ├── decode.go │ │ │ │ ├── decode_number.go │ │ │ │ ├── decode_string.go │ │ │ │ ├── decode_token.go │ │ │ │ ├── doc.go │ │ │ │ └── encode.go │ │ │ ├── errors/ │ │ │ │ └── errors.go │ │ │ ├── filedesc/ │ │ │ │ ├── build.go │ │ │ │ ├── desc.go │ │ │ │ ├── desc_init.go │ │ │ │ ├── desc_lazy.go │ │ │ │ ├── desc_list.go │ │ │ │ ├── desc_list_gen.go │ │ │ │ ├── editions.go │ │ │ │ ├── placeholder.go │ │ │ │ └── presence.go │ │ │ ├── filetype/ │ │ │ │ └── build.go │ │ │ ├── flags/ │ │ │ │ ├── flags.go │ │ │ │ ├── proto_legacy_disable.go │ │ │ │ └── proto_legacy_enable.go │ │ │ ├── genid/ │ │ │ │ ├── any_gen.go │ │ │ │ ├── api_gen.go │ │ │ │ ├── descriptor_gen.go │ │ │ │ ├── doc.go │ │ │ │ ├── duration_gen.go │ │ │ │ ├── empty_gen.go │ │ │ │ ├── field_mask_gen.go │ │ │ │ ├── go_features_gen.go │ │ │ │ ├── goname.go │ │ │ │ ├── map_entry.go │ │ │ │ ├── name.go │ │ │ │ ├── source_context_gen.go │ │ │ │ ├── struct_gen.go │ │ │ │ ├── timestamp_gen.go │ │ │ │ ├── type_gen.go │ │ │ │ ├── wrappers.go │ │ │ │ └── wrappers_gen.go │ │ │ ├── impl/ │ │ │ │ ├── api_export.go │ │ │ │ ├── api_export_opaque.go │ │ │ │ ├── bitmap.go │ │ │ │ ├── bitmap_race.go │ │ │ │ ├── checkinit.go │ │ │ │ ├── codec_extension.go │ │ │ │ ├── codec_field.go │ │ │ │ ├── codec_field_opaque.go │ │ │ │ ├── codec_gen.go │ │ │ │ ├── codec_map.go │ │ │ │ ├── codec_message.go │ │ │ │ ├── codec_message_opaque.go │ │ │ │ ├── codec_messageset.go │ │ │ │ ├── codec_tables.go │ │ │ │ ├── codec_unsafe.go │ │ │ │ ├── convert.go │ │ │ │ ├── convert_list.go │ │ │ │ ├── convert_map.go │ │ │ │ ├── decode.go │ │ │ │ ├── encode.go │ │ │ │ ├── enum.go │ │ │ │ ├── equal.go │ │ │ │ ├── extension.go │ │ │ │ ├── lazy.go │ │ │ │ ├── legacy_enum.go │ │ │ │ ├── legacy_export.go │ │ │ │ ├── legacy_extension.go │ │ │ │ ├── legacy_file.go │ │ │ │ ├── legacy_message.go │ │ │ │ ├── merge.go │ │ │ │ ├── merge_gen.go │ │ │ │ ├── message.go │ │ │ │ ├── message_opaque.go │ │ │ │ ├── message_opaque_gen.go │ │ │ │ ├── message_reflect.go │ │ │ │ ├── message_reflect_field.go │ │ │ │ ├── message_reflect_field_gen.go │ │ │ │ ├── message_reflect_gen.go │ │ │ │ ├── pointer_unsafe.go │ │ │ │ ├── pointer_unsafe_opaque.go │ │ │ │ ├── presence.go │ │ │ │ └── validate.go │ │ │ ├── order/ │ │ │ │ ├── order.go │ │ │ │ └── range.go │ │ │ ├── pragma/ │ │ │ │ └── pragma.go │ │ │ ├── protolazy/ │ │ │ │ ├── bufferreader.go │ │ │ │ ├── lazy.go │ │ │ │ └── pointer_unsafe.go │ │ │ ├── set/ │ │ │ │ └── ints.go │ │ │ ├── strs/ │ │ │ │ ├── strings.go │ │ │ │ └── strings_unsafe.go │ │ │ └── version/ │ │ │ └── version.go │ │ ├── proto/ │ │ │ ├── checkinit.go │ │ │ ├── decode.go │ │ │ ├── decode_gen.go │ │ │ ├── doc.go │ │ │ ├── encode.go │ │ │ ├── encode_gen.go │ │ │ ├── equal.go │ │ │ ├── extension.go │ │ │ ├── merge.go │ │ │ ├── messageset.go │ │ │ ├── proto.go │ │ │ ├── proto_methods.go │ │ │ ├── proto_reflect.go │ │ │ ├── reset.go │ │ │ ├── size.go │ │ │ ├── size_gen.go │ │ │ ├── wrapperopaque.go │ │ │ └── wrappers.go │ │ ├── protoadapt/ │ │ │ └── convert.go │ │ ├── reflect/ │ │ │ ├── protodesc/ │ │ │ │ ├── desc.go │ │ │ │ ├── desc_init.go │ │ │ │ ├── desc_resolve.go │ │ │ │ ├── desc_validate.go │ │ │ │ ├── editions.go │ │ │ │ └── proto.go │ │ │ ├── protoreflect/ │ │ │ │ ├── methods.go │ │ │ │ ├── proto.go │ │ │ │ ├── source.go │ │ │ │ ├── source_gen.go │ │ │ │ ├── type.go │ │ │ │ ├── value.go │ │ │ │ ├── value_equal.go │ │ │ │ ├── value_union.go │ │ │ │ └── value_unsafe.go │ │ │ └── protoregistry/ │ │ │ └── registry.go │ │ ├── runtime/ │ │ │ ├── protoiface/ │ │ │ │ ├── legacy.go │ │ │ │ └── methods.go │ │ │ └── protoimpl/ │ │ │ ├── impl.go │ │ │ └── version.go │ │ └── types/ │ │ ├── descriptorpb/ │ │ │ └── descriptor.pb.go │ │ ├── gofeaturespb/ │ │ │ └── go_features.pb.go │ │ └── known/ │ │ ├── anypb/ │ │ │ └── any.pb.go │ │ ├── durationpb/ │ │ │ └── duration.pb.go │ │ └── timestamppb/ │ │ └── timestamp.pb.go │ ├── gopkg.in/ │ │ └── yaml.v3/ │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── README.md │ │ ├── apic.go │ │ ├── decode.go │ │ ├── emitterc.go │ │ ├── encode.go │ │ ├── parserc.go │ │ ├── readerc.go │ │ ├── resolve.go │ │ ├── scannerc.go │ │ ├── sorter.go │ │ ├── writerc.go │ │ ├── yaml.go │ │ ├── yamlh.go │ │ └── yamlprivateh.go │ └── modules.txt └── version/ └── version.go ================================================ FILE CONTENTS ================================================ ================================================ FILE: .cirrus.yml ================================================ --- # Main collection of env. vars to set for all tasks and scripts. env: #### #### Global variables used for all tasks #### # Name of the ultimate destination branch for this CI run, PR or post-merge. DEST_BRANCH: "main" # Overrides default location (/tmp/cirrus) for repo clone GOPATH: &gopath "/var/tmp/go" GOBIN: "${GOPATH}/bin" GOCACHE: "${GOPATH}/cache" GOSRC: &gosrc "/var/tmp/go/src/github.com/containers/skopeo" # Required for consistency with containers/image CI SKOPEO_PATH: *gosrc CIRRUS_WORKING_DIR: *gosrc # The default is 'sh' if unspecified CIRRUS_SHELL: "/bin/bash" # Save a little typing (path relative to $CIRRUS_WORKING_DIR) SCRIPT_BASE: "./contrib/cirrus" # Google-cloud VM Images # If you are updating IMAGE_SUFFIX: We are currently using rawhide for # the containers_image_sequoia tests because the rust-podman-sequoia # package is not available in earlier releases; once we update to a future # Fedora release (or if the package is backported), switch back from Rawhide # to the latest Fedora release. IMAGE_SUFFIX: "c20260310t170224z-f43f42d14" FEDORA_CACHE_IMAGE_NAME: "fedora-${IMAGE_SUFFIX}" RAWHIDE_CACHE_IMAGE_NAME: "rawhide-${IMAGE_SUFFIX}" # Container FQIN's FEDORA_CONTAINER_FQIN: "quay.io/libpod/fedora_podman:${IMAGE_SUFFIX}" # Built along with the standard PR-based workflow in c/automation_images SKOPEO_CIDEV_CONTAINER_FQIN: "quay.io/libpod/skopeo_cidev:${IMAGE_SUFFIX}" # Default timeout for each task timeout_in: 45m gcp_credentials: ENCRYPTED[52d9e807b531b37ab14e958cb5a72499460663f04c8d73e22ad608c027a31118420f1c80f0be0882fbdf96f49d8f9ac0] validate_task: # The git-validation tool doesn't work well on branch or tag push, # under Cirrus-CI, due to challenges obtaining the starting commit ID. # Only do validation for PRs. only_if: &is_pr $CIRRUS_PR != '' container: image: '${SKOPEO_CIDEV_CONTAINER_FQIN}' cpu: 4 memory: 8 setup_script: | make tools test_script: | make validate-local make vendor && hack/tree_status.sh doccheck_task: only_if: *is_pr depends_on: - validate container: image: "${FEDORA_CONTAINER_FQIN}" cpu: 4 memory: 8 env: BUILDTAGS: &withopengpg 'containers_image_openpgp' script: | # TODO: Can't use 'runner.sh setup' inside container. However, # removing the pre-installed package is the only necessary step # at the time of this comment. dnf remove -y skopeo # Guarantee non-interference "${SKOPEO_PATH}/${SCRIPT_BASE}/runner.sh" build "${SKOPEO_PATH}/${SCRIPT_BASE}/runner.sh" doccheck osx_task: # Don't run for docs-only builds. # Also don't run on release-branches or their PRs, # since base container-image is not version-constrained. only_if: ¬_docs_or_release_branch >- ($CIRRUS_BASE_BRANCH == $CIRRUS_DEFAULT_BRANCH || $CIRRUS_BRANCH == $CIRRUS_DEFAULT_BRANCH ) && $CIRRUS_CHANGE_TITLE !=~ '.*CI:DOCS.*' depends_on: - validate persistent_worker: &mac_pw labels: os: darwin arch: arm64 purpose: prod env: CIRRUS_WORKING_DIR: "$HOME/ci/task-${CIRRUS_TASK_ID}" # Prevent cache-pollution fron one task to the next. GOPATH: "$CIRRUS_WORKING_DIR/.go" GOCACHE: "$CIRRUS_WORKING_DIR/.go/cache" GOENV: "$CIRRUS_WORKING_DIR/.go/support" GOSRC: "$HOME/ci/task-${CIRRUS_TASK_ID}" TMPDIR: "/private/tmp/ci" # This host is/was shared with potentially many other CI tasks. # The previous task may have been canceled or aborted. prep_script: &mac_cleanup "contrib/cirrus/mac_cleanup.sh" test_script: - export PATH=$GOPATH/bin:$PATH - go version - go env - make tools - make validate-local test-unit-local bin/skopeo - bin/skopeo -v # This host is/was shared with potentially many other CI tasks. # Ensure nothing is left running while waiting for the next task. always: task_cleanup_script: *mac_cleanup cross_task: alias: cross only_if: >- $CIRRUS_CHANGE_TITLE !=~ '.*CI:DOCS.*' depends_on: - validate gce_instance: &standardvm image_project: libpod-218412 zone: "us-central1-f" cpu: 2 memory: "4Gb" # Required to be 200gig, do not modify - has i/o performance impact # according to gcloud CLI tool warning messages. disk: 200 image_name: ${FEDORA_CACHE_IMAGE_NAME} env: BUILDTAGS: *withopengpg setup_script: >- "${GOSRC}/${SCRIPT_BASE}/runner.sh" setup cross_script: >- "${GOSRC}/${SCRIPT_BASE}/runner.sh" cross ostree-rs-ext_task: alias: proxy_ostree_ext only_if: *not_docs_or_release_branch # WARNING: This task potentially performs a container image # build (on change) with runtime package installs. Therefore, # its behavior can be unpredictable and potentially flake-prone. # In case of emergency, uncomment the next statement to bypass. # # skip: $CI == "true" # depends_on: - validate # Ref: https://cirrus-ci.org/guide/docker-builder-vm/#dockerfile-as-a-ci-environment container: # The runtime image will be rebuilt on change dockerfile: contrib/cirrus/ostree_ext.dockerfile docker_arguments: # required build-args BASE_FQIN: quay.io/coreos-assembler/fcos-buildroot:testing-devel CIRRUS_IMAGE_VERSION: 4 env: EXT_REPO_NAME: ostree-rs-ext EXT_REPO_HOME: $CIRRUS_WORKING_DIR/../$EXT_REPO_NAME EXT_REPO: https://github.com/ostreedev/${EXT_REPO_NAME}.git skopeo_build_script: - dnf builddep -y skopeo - make - make install proxy_ostree_ext_build_script: - git clone --depth 1 $EXT_REPO $EXT_REPO_HOME - cd $EXT_REPO_HOME - cargo test --no-run proxy_ostree_ext_test_script: - cd $EXT_REPO_HOME - cargo test -- --nocapture --quiet ##### ##### NOTE: This task is subtantially duplicated in the containers/image ##### repository's `.cirrus.yml`. Changes made here should be fully merged ##### prior to being manually duplicated and maintained in containers/image. ##### test_skopeo_task: alias: test_skopeo # Don't test for [CI:DOCS], [CI:BUILD]. only_if: >- $CIRRUS_CHANGE_TITLE !=~ '.*CI:BUILD.*' && $CIRRUS_CHANGE_TITLE !=~ '.*CI:DOCS.*' depends_on: - validate gce_instance: image_project: libpod-218412 zone: "us-central1-f" cpu: 2 memory: "4Gb" # Required to be 200gig, do not modify - has i/o performance impact # according to gcloud CLI tool warning messages. disk: 200 image_name: ${VM_IMAGE_NAME} matrix: - name: "Skopeo Test" # N/B: Name ref. by hack/get_fqin.sh env: BUILDTAGS: '' VM_IMAGE_NAME: ${FEDORA_CACHE_IMAGE_NAME} - name: "Skopeo Test w/ opengpg" env: BUILDTAGS: *withopengpg VM_IMAGE_NAME: ${FEDORA_CACHE_IMAGE_NAME} - name: "Skopeo test w/ Sequoia (currently Rawhide)" env: BUILDTAGS: 'containers_image_sequoia' # If you are removing the use of rawhide, also remove the VM_IMAGE_NAME condition from runner.sh . VM_IMAGE_NAME: ${RAWHIDE_CACHE_IMAGE_NAME} setup_script: >- "${GOSRC}/${SCRIPT_BASE}/runner.sh" setup vendor_script: >- "${SKOPEO_PATH}/${SCRIPT_BASE}/runner.sh" vendor build_script: >- "${SKOPEO_PATH}/${SCRIPT_BASE}/runner.sh" build unit_script: >- "${SKOPEO_PATH}/${SCRIPT_BASE}/runner.sh" unit integration_script: >- "${SKOPEO_PATH}/${SCRIPT_BASE}/runner.sh" integration system_script: > "${SKOPEO_PATH}/${SCRIPT_BASE}/runner.sh" system # This task is critical. It updates the "last-used by" timestamp stored # in metadata for all VM images. This mechanism functions in tandem with # an out-of-band pruning operation to remove disused VM images. meta_task: name: "VM img. keepalive" alias: meta container: &smallcontainer cpu: 2 memory: 2 image: quay.io/libpod/imgts:latest env: # Space-separated list of images used by this repository state IMGNAMES: | ${FEDORA_CACHE_IMAGE_NAME} ${RAWHIDE_CACHE_IMAGE_NAME} build-push-${IMAGE_SUFFIX} BUILDID: "${CIRRUS_BUILD_ID}" REPOREF: "${CIRRUS_REPO_NAME}" GCPJSON: ENCRYPTED[6867b5a83e960e7c159a98fe6c8360064567a071c6f4b5e7d532283ecd870aa65c94ccd74bdaa9bf7aadac9d42e20a67] GCPNAME: ENCRYPTED[1cf558ae125e3c39ec401e443ad76452b25d790c45eb73d77c83eb059a0f7fd5085ef7e2f7e410b04ea6e83b0aab2eb1] GCPPROJECT: libpod-218412 clone_script: &noop mkdir -p "$CIRRUS_WORKING_DIR" script: /usr/local/bin/entrypoint.sh # Status aggregator for all tests. This task simply ensures a defined # set of tasks all passed, and allows confirming that based on the status # of this task. success_task: name: "Total Success" alias: success # N/B: ALL tasks must be listed here, minus their '_task' suffix. depends_on: - validate - doccheck - osx - cross - proxy_ostree_ext - test_skopeo - meta container: *smallcontainer env: CTR_FQIN: ${FEDORA_CONTAINER_FQIN} TEST_ENVIRON: container clone_script: *noop script: /bin/true ================================================ FILE: .fmf/version ================================================ 1 ================================================ FILE: .github/renovate.json5 ================================================ /* Renovate is a service similar to GitHub Dependabot, but with (fantastically) more configuration options. So many options in fact, if you're new I recommend glossing over this cheat-sheet prior to the official documentation: https://www.augmentedmind.de/2021/07/25/renovate-bot-cheat-sheet Configuration Update/Change Procedure: 1. Make changes 2. Manually validate changes (from repo-root): podman run -it \ -v ./.github/renovate.json5:/usr/src/app/renovate.json5:z \ docker.io/renovate/renovate:latest \ renovate-config-validator 3. Commit. Configuration Reference: https://docs.renovatebot.com/configuration-options/ Monitoring Dashboard: https://app.renovatebot.com/dashboard#github/containers Note: The Renovate bot will create/manage it's business on branches named 'renovate/*'. Otherwise, and by default, the only the copy of this file that matters is the one on the `main` branch. No other branches will be monitored or touched in any way. */ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", /************************************************* ****** Global/general configuration options ***** *************************************************/ // Re-use predefined sets of configuration options to DRY "extends": [ // https://github.com/containers/automation/blob/main/renovate/defaults.json5 "github>containers/automation//renovate/defaults.json5" ], // Permit automatic rebasing when base-branch changes by more than // one commit. "rebaseWhen": "behind-base-branch", /************************************************* *** Repository-specific configuration options *** *************************************************/ } ================================================ FILE: .github/workflows/check_cirrus_cron.yml ================================================ --- # See also: # https://github.com/containers/podman/blob/main/.github/workflows/check_cirrus_cron.yml on: # Note: This only applies to the default branch. schedule: # N/B: This should correspond to a period slightly after # the last job finishes running. See job defs. at: # https://cirrus-ci.com/settings/repository/6706677464432640 - cron: '03 03 * * 1-5' # Debug: Allow triggering job manually in github-actions WebUI workflow_dispatch: {} jobs: # Ref: https://docs.github.com/en/actions/using-workflows/reusing-workflows call_cron_failures: uses: containers/podman/.github/workflows/check_cirrus_cron.yml@main secrets: SECRET_CIRRUS_API_KEY: ${{secrets.SECRET_CIRRUS_API_KEY}} ACTION_MAIL_SERVER: ${{secrets.ACTION_MAIL_SERVER}} ACTION_MAIL_USERNAME: ${{secrets.ACTION_MAIL_USERNAME}} ACTION_MAIL_PASSWORD: ${{secrets.ACTION_MAIL_PASSWORD}} ACTION_MAIL_SENDER: ${{secrets.ACTION_MAIL_SENDER}} ================================================ FILE: .github/workflows/issue_pr_lock.yml ================================================ --- # See also: # https://github.com/containers/podman/blob/main/.github/workflows/issue_pr_lock.yml on: schedule: - cron: '0 0 * * *' # Debug: Allow triggering job manually in github-actions WebUI workflow_dispatch: {} jobs: # Ref: https://docs.github.com/en/actions/using-workflows/reusing-workflows closed_issue_discussion_lock: uses: containers/podman/.github/workflows/issue_pr_lock.yml@main secrets: inherit permissions: contents: read issues: write pull-requests: write ================================================ FILE: .github/workflows/stale.yml ================================================ name: Mark stale issues and pull requests # Please refer to https://github.com/actions/stale/blob/master/action.yml # to see all config knobs of the stale action. on: schedule: - cron: "0 0 * * *" permissions: contents: read jobs: stale: permissions: issues: write # for actions/stale to close stale issues pull-requests: write # for actions/stale to close stale PRs runs-on: ubuntu-latest steps: - uses: actions/stale@v10 with: repo-token: ${{ secrets.GITHUB_TOKEN }} stale-issue-message: 'A friendly reminder that this issue had no activity for 30 days.' stale-pr-message: 'A friendly reminder that this PR had no activity for 30 days.' stale-issue-label: 'stale-issue' stale-pr-label: 'stale-pr' days-before-stale: 30 days-before-close: 365 remove-stale-when-updated: true ================================================ FILE: .gitignore ================================================ *.1 /layers-* /skopeo result /completions/ # ignore JetBrains IDEs (GoLand) config folder .idea # Ignore the bin directory bin ================================================ FILE: .golangci.yml ================================================ version: "2" formatters: enable: - gofumpt linters: settings: staticcheck: checks: # Compared to golangci-lint v2.0.2 defaults, we don’t exclude # ST1003, ST1016, ST1020, ST1021, ST1022 as we don't hit those. - all - -ST1000 # Incorrect or missing package comment. - -ST1005 # Incorrectly formatted error string. exclusions: presets: - std-error-handling ================================================ FILE: .packit.yaml ================================================ --- # See the documentation for more information: # https://packit.dev/docs/configuration/ # NOTE: The Packit copr_build tasks help to check if every commit builds on # supported Fedora and CentOS Stream arches. # They do not block the current Cirrus-based workflow. downstream_package_name: skopeo upstream_tag_template: v{version} packages: skopeo-fedora: pkg_tool: fedpkg specfile_path: rpm/skopeo.spec skopeo-centos: pkg_tool: centpkg specfile_path: rpm/skopeo.spec skopeo-eln: specfile_path: rpm/skopeo.spec # https://packit.dev/docs/configuration/actions actions: get-current-version: bash -c 'grep "^const Version" version/version.go | cut -f2 -d\" | tr \- \~' srpm_build_deps: - make jobs: - job: copr_build trigger: pull_request packages: [skopeo-fedora] notifications: &copr_build_failure_notification failure_comment: message: "Ephemeral COPR build failed. @containers/packit-build please check." targets: &fedora_copr_targets - fedora-all-x86_64 - fedora-all-aarch64 enable_net: true # Re-enable these scans if OpenScanHub starts scanning go packages # https://packit.dev/posts/openscanhub-prototype osh_diff_scan_after_copr_build: false - job: copr_build trigger: pull_request packages: [skopeo-eln] notifications: *copr_build_failure_notification targets: &eln_copr_targets fedora-eln-x86_64: additional_repos: - "https://kojipkgs.fedoraproject.org/repos/eln-build/latest/x86_64/" fedora-eln-aarch64: additional_repos: - "https://kojipkgs.fedoraproject.org/repos/eln-build/latest/aarch64/" enable_net: true - job: copr_build trigger: pull_request packages: [skopeo-centos] notifications: *copr_build_failure_notification targets: ¢os_copr_targets - centos-stream-9-x86_64 - centos-stream-9-aarch64 - centos-stream-10-x86_64 - centos-stream-10-aarch64 enable_net: true # Run on commit to main branch - job: copr_build trigger: commit packages: [skopeo-fedora] branch: main owner: rhcontainerbot project: podman-next enable_net: true # Tests on Fedora for main branch - job: tests trigger: pull_request packages: [skopeo-fedora] notifications: &test_failure_notification failure_comment: message: "Tests failed. @containers/packit-build please check." targets: *fedora_copr_targets tf_extra_params: environments: - artifacts: - type: repository-file id: https://copr.fedorainfracloud.org/coprs/rhcontainerbot/podman-next/repo/fedora-$releasever/rhcontainerbot-podman-next-fedora-$releasever.repo # Tests on ELN for main branch - job: tests trigger: pull_request packages: [skopeo-eln] notifications: *test_failure_notification targets: *eln_copr_targets tf_extra_params: environments: - artifacts: - type: repository-file id: https://copr.fedorainfracloud.org/coprs/rhcontainerbot/podman-next/repo/fedora-eln/rhcontainerbot-podman-next-fedora-eln.repo # Tests on CentOS Stream for main branch - job: tests trigger: pull_request packages: [skopeo-centos] notifications: *test_failure_notification targets: *centos_copr_targets tf_extra_params: environments: - artifacts: - type: repository-file id: https://copr.fedorainfracloud.org/coprs/rhcontainerbot/podman-next/repo/centos-stream-$releasever/rhcontainerbot-podman-next-centos-stream-$releasever.repo # Sync to Fedora - job: propose_downstream trigger: release packages: [skopeo-fedora] update_release: false dist_git_branches: &fedora_targets - fedora-all actions: post-modifications: >- bash -c 'sed -i "s/^\(\s*\)ref: .*/\1ref: v${PACKIT_PROJECT_VERSION}/" ${PACKIT_DOWNSTREAM_REPO}/plans/main.fmf' # Sync to CentOS Stream # FIXME: Switch trigger whenever we're ready to update CentOS Stream via # Packit - job: propose_downstream trigger: ignore packages: [skopeo-centos] update_release: false dist_git_branches: - c10s # Fedora Koji build - job: koji_build trigger: commit packages: [skopeo-fedora] sidetag_group: podman-releases # Dependents are not rpm dependencies, but the package whose bodhi update # should include this package. # Ref: https://packit.dev/docs/fedora-releases-guide/releasing-multiple-packages dependents: - podman dist_git_branches: *fedora_targets ================================================ FILE: CODE-OF-CONDUCT.md ================================================ ## The skopeo Project Community Code of Conduct The skopeo project, as part of Podman Container Tools, follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/main/code-of-conduct.md). ================================================ FILE: CONTRIBUTING.md ================================================ # Contributing to Skopeo We'd love to have you join the community! Below summarizes the processes that we follow. ## Topics * [LLM ("AI") Policy](#llm-ai-policy) * [Reporting Issues](#reporting-issues) * [Submitting Pull Requests](#submitting-pull-requests) * [Communications](#communications) ## LLM ("AI") Policy If your contribution is aided by LLMs or other AI tools, please read the [LLM Policy in the Podman project](https://github.com/containers/podman/blob/main/LLM_POLICY.md). This project also follows this LLM policy, which includes comments, issues, PRs, and any other interactions with the team. ## Reporting Issues Before reporting an issue, check our backlog of [open issues](https://github.com/containers/skopeo/issues) to see if someone else has already reported it. If so, feel free to add your scenario, or additional information, to the discussion. Or simply "subscribe" to it to be notified when it is updated. If you find a new issue with the project we'd love to hear about it! The most important aspect of a bug report is that it includes enough information for us to reproduce it. So, please include as much detail as possible and try to remove the extra stuff that doesn't really relate to the issue itself. The easier it is for us to reproduce it, the faster it'll be fixed! Please don't include any private/sensitive information in your issue! ## Submitting Pull Requests No Pull Request (PR) is too small! Typos, additional comments in the code, new testcases, bug fixes, new features, more documentation, ... it's all welcome! While bug fixes can first be identified via an "issue", that is not required. It's ok to just open up a PR with the fix, but make sure you include the same information you would have included in an issue - like how to reproduce it. PRs for new features should include some background on what use cases the new code is trying to address. When possible and when it makes sense, try to break-up larger PRs into smaller ones - it's easier to review smaller code changes. But only if those smaller ones make sense as stand-alone PRs. Regardless of the type of PR, all PRs should include: * well documented code changes * additional testcases. Ideally, they should fail w/o your code change applied * documentation changes Squash your commits into logical pieces of work that might want to be reviewed separate from the rest of the PRs. Ideally, each commit should implement a single idea, and the PR branch should pass the tests at every commit. GitHub makes it easy to review the cumulative effect of many commits; so, when in doubt, use smaller commits. PRs that fix issues should include a reference like `Closes #XXXX` in the commit message so that github will automatically close the referenced issue when the PR is merged. ### Sign your PRs The sign-off is a line at the end of the explanation for the patch. Your signature certifies that you wrote the patch or otherwise have the right to pass it on as an open-source patch. The rules are simple: if you can certify the below (from [developercertificate.org](http://developercertificate.org/)): ``` Developer Certificate of Origin Version 1.1 Copyright (C) 2004, 2006 The Linux Foundation and its contributors. 660 York Street, Suite 102, San Francisco, CA 94110 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Developer's Certificate of Origin 1.1 By making a contribution to this project, I certify that: (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. ``` Then you just add a line to every git commit message: Signed-off-by: Joe Smith Use your real name (sorry, no pseudonyms or anonymous contributions.) If you set your `user.name` and `user.email` git configs, you can sign your commit automatically with `git commit -s`. ### Dependencies management Dependencies are managed via [standard go modules](https://golang.org/ref/mod). In order to add a new dependency to this project: - use `go get -d path/to/dep@version` to add a new line to `go.mod` - run `make vendor` In order to update an existing dependency: - use `go get -d -u path/to/dep@version` to update the relevant dependency line in `go.mod` - run `make vendor` When new PRs for [containers/container-libs](https://github.com/containers/container-libs) break `skopeo` (i.e. `containers/container-libs` tests fail in `make test-skopeo`): - create out a new branch in your `skopeo` checkout and switch to it - find out the version of `containers/container-libs` you want to use and note its commit ID. You might also want to use a fork of `containers/container-libs`, in that case note its repo - use `go get -d github.com/$REPO/container-libs/image/v5@$COMMIT_ID` to download the right version. The command will fetch the dependency and then fail because of a conflict in `go.mod`, this is expected. Note the pseudo-version (eg. `v5.13.1-0.20210707123201-50afbf0a326`) - use `go mod edit -replace=go.podman.io/image/v5=github.com/$REPO/container-libs/image/v5@$PSEUDO_VERSION` to add a replacement line to `go.mod` (e.g. `replace go.podman.io/image/v5 => github.com/moio/container-libs/image/v5 v5.13.1-0.20210707123201-50afbf0a3262`) - run `make vendor` - make any other necessary changes in the skopeo repo (e.g. add other dependencies now required by `containers/container-libs`, or update skopeo for changed `containers/container-libs` API) - optionally add new integration tests to the skopeo repo - submit the resulting branch as a skopeo PR, marked “DO NOT MERGE” - iterate until tests pass and the PR is reviewed - then the original `containers/container-libs` PR can be merged, disregarding its `make test-skopeo` failure - as soon as possible after that, in the skopeo PR, use `go mod edit -dropreplace=go.podman.io/image/v5` to remove the `replace` line in `go.mod` - run `make vendor` - update the skopeo PR with the result, drop the “DO NOT MERGE” marking - after tests complete successfully again, merge the skopeo PR ## Communications For general questions, or discussions, please use the [#podman](https://app.slack.com/client/T08PSQ7BQ/C08MXJLCFCN) channel on the [CNCF Slack](https://cloud-native.slack.com). For development related discussions, please use the [#podman-dev](https://app.slack.com/client/T08PSQ7BQ/C08NTKCDC1W) channel on the CNCF Slack. For discussions around issues/bugs and features, you can use the github [issues](https://github.com/containers/skopeo/issues) and [PRs](https://github.com/containers/skopeo/pulls) tracking system. ================================================ FILE: GOVERNANCE.md ================================================ ## The Skopeo Project Community Governance The Skopeo project, as part of Podman Container Tools, follows the [Podman Project Governance](https://github.com/containers/podman/blob/main/GOVERNANCE.md) except sections found in this document, which override those found in Podman's Governance. --- # Maintainers File The definitive source of truth for maintainers of this repository is the local [MAINTAINERS.md](./MAINTAINERS.md) file. The [MAINTAINERS.md](https://github.com/containers/podman/blob/main/MAINTAINERS.md) file in the main Podman repository is used for project-spanning roles, including Core Maintainer and Community Manager. Some repositories in the project will also have a local [OWNERS](./OWNERS) file, which the CI system uses to map users to roles. Any changes to the [OWNERS](./OWNERS) file must make a corresponding change to the [MAINTAINERS.md](./MAINTAINERS.md) file to ensure that the file remains up to date. Most changes to [MAINTAINERS.md](./MAINTAINERS.md) will require a change to the repository’s [OWNERS](.OWNERS) file (e.g., adding a Reviewer), but some will not (e.g., promoting a Maintainer to a Core Maintainer, which comes with no additional CI-related privileges). Any Core Maintainers listed in Podman’s [MAINTAINERS.md](https://github.com/containers/podman/blob/main/MAINTAINERS.md) file should also be added to the list of “approvers” in the local [OWNERS](./OWNERS) file and as a Core Maintainer in the list of “Maintainers” in the local [MAINTAINERS.md](./MAINTAINERS.md) file. ================================================ FILE: LICENSE ================================================ Apache License Version 2.0, January 2004 https://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: MAINTAINERS.md ================================================ # Skopeo Maintainers [GOVERNANCE.md](https://github.com/containers/podman/blob/main/GOVERNANCE.md) describes the project's governance and the Project Roles used below. ## Maintainers | Maintainer | GitHub ID | Project Roles | Affiliation | |-------------------|----------------------------------------------------------|----------------------------------|----------------------------------------------| | Brent Baude | [baude](https://github.com/baude) | Core Maintainer | [Red Hat](https://github.com/RedHatOfficial) | | Nalin Dahyabhai | [nalind](https://github.com/nalind) | Core Maintainer | [Red Hat](https://github.com/RedHatOfficial) | | Matthew Heon | [mheon](https://github.com/mheon) | Core Maintainer | [Red Hat](https://github.com/RedHatOfficial) | | Paul Holzinger | [Luap99](https://github.com/Luap99) | Core Maintainer | [Red Hat](https://github.com/RedHatOfficial) | | Giuseppe Scrivano | [giuseppe](https://github.com/giuseppe) | Core Maintainer | [Red Hat](https://github.com/RedHatOfficial) | | Miloslav Trmač | [mtrmac](https://github.com/mtrmac) | Core Maintainer | [Red Hat](https://github.com/RedHatOfficial) | | Mohan Boddu | [mohanboddu](https://github.com/mohanboddu) | Community Manager | [Red Hat](https://github.com/RedHatOfficial) | | Neil Smith | [actionmancan](https://github.com/actionmancan) | Community Manager | [Red Hat](https://github.com/RedHatOfficial) | | Tom Sweeney | [TomSweeneyRedHat](https://github.com/TomSweeneyRedHat/) | Maintainer and Community Manager | [Red Hat](https://github.com/RedHatOfficial) | | Lokesh Mandvekar | [lsm5](https://github.com/lsm5) | Maintainer | [Red Hat](https://github.com/RedHatOfficial) | | Dan Walsh | [rhatdan](https://github.com/rhatdan) | Maintainer | [Red Hat](https://github.com/RedHatOfficial) | | Ashley Cui | [ashley-cui](https://github.com/ashley-cui) | Reviewer | [Red Hat](https://github.com/RedHatOfficial) | | Valentin Rothberg | [vrothberg](https://github.com/vrothberg) | Reviewer | [Red Hat](https://github.com/RedHatOfficial) | | Colin Walters | [cgwalters](https://github.com/cgwalters) | Reviewer | [Red Hat](https://github.com/RedHatOfficial) | ## Alumni None at present ## Credits The structure of this document was based off of the equivalent one in the [CRI-O Project](https://github.com/cri-o/cri-o/blob/main/MAINTAINERS.md). ## Note If there is a discrepancy between the [MAINTAINERS.md](https://github.com/containers/podman/blob/main/MAINTAINERS.md) file in the main Podman repository and this file regarding Core Maintainers or Community Managers, the file in the Podman Repository is considered the source of truth. ================================================ FILE: Makefile ================================================ .PHONY: all binary docs docs-in-container build-local clean install install-binary install-completions shell test-integration .install.vndr vendor vendor-in-container export GOPROXY=https://proxy.golang.org # The following variables very roughly follow https://www.gnu.org/prep/standards/standards.html#Makefile-Conventions . DESTDIR ?= PREFIX ?= /usr/local ifeq ($(shell uname -s),FreeBSD) CONTAINERSCONFDIR ?= /usr/local/etc/containers else CONTAINERSCONFDIR ?= /etc/containers endif REGISTRIESDDIR ?= ${CONTAINERSCONFDIR}/registries.d LOOKASIDEDIR ?= /var/lib/containers/sigstore BINDIR ?= ${PREFIX}/bin MANDIR ?= ${PREFIX}/share/man BASHINSTALLDIR=${PREFIX}/share/bash-completion/completions ZSHINSTALLDIR=${PREFIX}/share/zsh/site-functions FISHINSTALLDIR=${PREFIX}/share/fish/vendor_completions.d GO ?= go GOBIN := $(shell $(GO) env GOBIN) GOOS ?= $(shell go env GOOS) GOARCH ?= $(shell go env GOARCH) SEQUOIA_SONAME_DIR = # N/B: This value is managed by Renovate, manual changes are # possible, as long as they don't disturb the formatting # (i.e. DO NOT ADD A 'v' prefix!) GOLANGCI_LINT_VERSION := 2.11.3 ifeq ($(GOBIN),) GOBIN := $(GOPATH)/bin endif # Scripts may also use CONTAINER_RUNTIME, so we need to export it. # Note possibly non-obvious aspects of this: # - We need to use 'command -v' here, not 'which', for compatibility with MacOS. # - GNU Make 4.2.1 (included in Ubuntu 20.04) incorrectly tries to avoid invoking # a shell, and fails because there is no /usr/bin/command. The trailing ';' in # $(shell … ;) defeats that heuristic (recommended in # https://savannah.gnu.org/bugs/index.php?57625 ). export CONTAINER_RUNTIME ?= $(if $(shell command -v podman ;),podman,docker) GOMD2MAN ?= $(if $(shell command -v go-md2man ;),go-md2man,$(GOBIN)/go-md2man) ifeq ($(DEBUG), 1) override GOGCFLAGS += -N -l endif ifeq ($(GOOS), linux) ifneq ($(GOARCH),$(filter $(GOARCH),mips mipsle mips64 mips64le ppc64 riscv64)) GO_DYN_FLAGS="-buildmode=pie" endif endif # If $TESTFLAGS is set, it is passed as extra arguments to 'go test' on integration tests. # You can select certain tests to run, with `-run ` for example: # # make test-integration TESTFLAGS='-run copySuite.TestCopy.*' export TESTFLAGS ?= -timeout=15m # This is assumed to be set non-empty when operating inside a CI/automation environment CI ?= # This env. var. is interpreted by some tests as a permission to # modify local configuration files and services. export SKOPEO_CONTAINER_TESTS ?= $(if $(CI),1,0) # This is a compromise, we either use a container for this or require # the local user to have a compatible python3 development environment. # Define it as a "resolve on use" variable to avoid calling out when possible SKOPEO_CIDEV_CONTAINER_FQIN ?= $(shell hack/get_fqin.sh) CONTAINER_CMD ?= ${CONTAINER_RUNTIME} run --rm -i -e TESTFLAGS="$(TESTFLAGS)" -e CI=$(CI) -e SKOPEO_CONTAINER_TESTS=1 # if this session isn't interactive, then we don't want to allocate a # TTY, which would fail, but if it is interactive, we do want to attach # so that the user can send e.g. ^C through. INTERACTIVE := $(shell [ -t 0 ] && echo 1 || echo 0) ifeq ($(INTERACTIVE), 1) CONTAINER_CMD += -t endif CONTAINER_GOSRC = /src/github.com/containers/skopeo CONTAINER_RUN ?= $(CONTAINER_CMD) --security-opt label=disable -v $(CURDIR):$(CONTAINER_GOSRC) -w $(CONTAINER_GOSRC) $(SKOPEO_CIDEV_CONTAINER_FQIN) EXTRA_LDFLAGS ?= SKOPEO_LDFLAGS := -ldflags '-X go.podman.io/image/v5/signature/internal/sequoia.sequoiaLibraryDir=$(SEQUOIA_SONAME_DIR) $(EXTRA_LDFLAGS)' MANPAGES_MD = $(wildcard docs/*.md) MANPAGES ?= $(MANPAGES_MD:%.md=%) BTRFS_BUILD_TAG = $(shell hack/btrfs_installed_tag.sh) LIBSUBID_BUILD_TAG = $(shell hack/libsubid_tag.sh) SQLITE_BUILD_TAG = $(shell hack/sqlite_tag.sh) LOCAL_BUILD_TAGS = $(BTRFS_BUILD_TAG) $(LIBSUBID_BUILD_TAG) $(SQLITE_BUILD_TAG) BUILDTAGS += $(LOCAL_BUILD_TAGS) ifeq ($(DISABLE_CGO), 1) override BUILDTAGS = exclude_graphdriver_btrfs containers_image_openpgp endif # make all DEBUG=1 # Note: Uses the -N -l go compiler options to disable compiler optimizations # and inlining. Using these build options allows you to subsequently # use source debugging tools like delve. all: bin/skopeo docs codespell: codespell -S Makefile,build,buildah,buildah.spec,imgtype,copy,AUTHORS,bin,vendor,.git,go.sum,CHANGELOG.md,changelog.txt,seccomp.json,.cirrus.yml,"*.xz,*.gz,*.tar,*.tgz,*ico,*.png,*.1,*.5,*.orig,*.rej" -L fpr,uint,iff,od,ERRO -w help: @echo "Usage: make " @echo @echo "Defaults to building bin/skopeo and docs" @echo @echo " * 'install' - Install binaries and documents to system locations" @echo " * 'binary' - Build skopeo with a container" @echo " * 'bin/skopeo' - Build skopeo locally" @echo " * 'bin/skopeo.OS.ARCH' - Build skopeo for specific OS and ARCH" @echo " * 'test-unit' - Execute unit tests" @echo " * 'test-integration' - Execute integration tests" @echo " * 'validate' - Verify whether there is no conflict and all Go source files have been formatted, linted and vetted" @echo " * 'check' - Including above validate, test-integration and test-unit" @echo " * 'shell' - Run the built image and attach to a shell" @echo " * 'clean' - Clean artifacts" # Do the build and the output (skopeo) should appear in current dir binary: cmd/skopeo $(CONTAINER_RUN) make bin/skopeo $(if $(DEBUG),DEBUG=$(DEBUG)) BUILDTAGS='$(BUILDTAGS)' # Build w/o using containers .PHONY: bin/skopeo bin/skopeo: $(GO) build ${GO_DYN_FLAGS} ${SKOPEO_LDFLAGS} -gcflags "$(GOGCFLAGS)" -tags "$(BUILDTAGS)" -o $@ ./cmd/skopeo bin/skopeo.%: GOOS=$(word 2,$(subst ., ,$@)) GOARCH=$(word 3,$(subst ., ,$@)) $(GO) build ${SKOPEO_LDFLAGS} -tags "containers_image_openpgp $(BUILDTAGS)" -o $@ ./cmd/skopeo local-cross: bin/skopeo.darwin.amd64 bin/skopeo.linux.arm bin/skopeo.linux.arm64 bin/skopeo.windows.386.exe bin/skopeo.windows.amd64.exe $(MANPAGES): %: %.md ifneq ($(DISABLE_DOCS), 1) sed -e 's/\((skopeo.*\.md)\)//' -e 's/\[\(skopeo.*\)\]/\1/' $< | $(GOMD2MAN) -in /dev/stdin -out $@ endif docs: $(MANPAGES) docs-in-container: ${CONTAINER_RUN} $(MAKE) docs $(if $(DEBUG),DEBUG=$(DEBUG)) .PHONY: completions completions: bin/skopeo install -d -m 755 completions/bash completions/zsh completions/fish completions/powershell ./bin/skopeo completion bash >| completions/bash/skopeo ./bin/skopeo completion zsh >| completions/zsh/_skopeo ./bin/skopeo completion fish >| completions/fish/skopeo.fish ./bin/skopeo completion powershell >| completions/powershell/skopeo.ps1 clean: rm -rf bin docs/*.1 completions/ install: install-binary install-docs install-completions install -d -m 755 ${DESTDIR}${LOOKASIDEDIR} install -d -m 755 ${DESTDIR}${CONTAINERSCONFDIR} install -m 644 default-policy.json ${DESTDIR}${CONTAINERSCONFDIR}/policy.json install -d -m 755 ${DESTDIR}${REGISTRIESDDIR} install -m 644 default.yaml ${DESTDIR}${REGISTRIESDDIR}/default.yaml install-binary: bin/skopeo install -d -m 755 ${DESTDIR}${BINDIR} install -m 755 bin/skopeo ${DESTDIR}${BINDIR}/skopeo install-docs: docs ifneq ($(DISABLE_DOCS), 1) install -d -m 755 ${DESTDIR}${MANDIR}/man1 install -m 644 docs/*.1 ${DESTDIR}${MANDIR}/man1 endif install-completions: completions install -d -m 755 ${DESTDIR}${BASHINSTALLDIR} install -m 644 completions/bash/skopeo ${DESTDIR}${BASHINSTALLDIR} install -d -m 755 ${DESTDIR}${ZSHINSTALLDIR} install -m 644 completions/zsh/_skopeo ${DESTDIR}${ZSHINSTALLDIR} install -d -m 755 ${DESTDIR}${FISHINSTALLDIR} install -m 644 completions/fish/skopeo.fish ${DESTDIR}${FISHINSTALLDIR} # There is no common location for powershell files so do not install them. Users have to source the file from their powershell profile. shell: $(CONTAINER_RUN) bash tools: if [ ! -x "$(GOBIN)/golangci-lint" ]; then \ curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOBIN) v$(GOLANGCI_LINT_VERSION) ; \ fi check: validate test-unit test-integration test-system test-integration: # This is intended to be equal to $(CONTAINER_RUN), but with --cap-add=cap_mknod. # --cap-add=cap_mknod is important to allow skopeo to use containers-storage: directly as it exists in the callers’ environment, without # creating a nested user namespace (which requires /etc/subuid and /etc/subgid to be set up) $(CONTAINER_CMD) --security-opt label=disable --cap-add=cap_mknod -v $(CURDIR):$(CONTAINER_GOSRC) -w $(CONTAINER_GOSRC) $(SKOPEO_CIDEV_CONTAINER_FQIN) \ $(MAKE) test-integration-local # Helper target to set up SKOPEO_BINARY variable for local test targets # SKOPEO_BINARY only takes effect on `test-integration-local` and # `test-system-local` targets. It's not propagated into the container used for `test-integration` and # `test-system`. These targets will (build and) use skopeo binary at # ./bin/skopeo. .eval-skopeo-binary: $(if $(SKOPEO_BINARY),,bin/skopeo) $(eval SKOPEO_BINARY := $(or $(SKOPEO_BINARY),./bin/skopeo)) @echo "Testing with $(SKOPEO_BINARY) ..." # Primarily intended for CI. test-integration-local: .eval-skopeo-binary hack/warn-destructive-tests.sh cd ./integration && SKOPEO_BINARY="$(abspath $(SKOPEO_BINARY))" $(GO) test $(SKOPEO_LDFLAGS) $(TESTFLAGS) $(if $(BUILDTAGS),-tags "$(BUILDTAGS)") # complicated set of options needed to run podman-in-podman test-system: DTEMP=$(shell mktemp -d --tmpdir=/var/tmp podman-tmp.XXXXXX); \ $(CONTAINER_CMD) --privileged \ -v $(CURDIR):$(CONTAINER_GOSRC) -w $(CONTAINER_GOSRC) \ -v $$DTEMP:/var/lib/containers:Z -v /run/systemd/journal/socket:/run/systemd/journal/socket \ "$(SKOPEO_CIDEV_CONTAINER_FQIN)" \ $(MAKE) test-system-local; \ rc=$$?; \ $(CONTAINER_RUNTIME) unshare rm -rf $$DTEMP; # This probably doesn't work with Docker, oh well, better than nothing... \ exit $$rc # Primarily intended for CI. test-system-local: .eval-skopeo-binary hack/warn-destructive-tests.sh hack/test-system.sh test-unit: # Just call (make test unit-local) here instead of worrying about environment differences $(CONTAINER_RUN) $(MAKE) test-unit-local validate: $(CONTAINER_RUN) $(MAKE) validate-local # This target is only intended for development, e.g. executing it from an IDE. Use (make test) for CI or pre-release testing. test-all-local: validate-local validate-docs test-unit-local .PHONY: fmt fmt: tools $(GOBIN)/golangci-lint fmt .PHONY: validate-local validate-local: tools hack/validate-git-marks.sh $(GOBIN)/golangci-lint run --build-tags "${BUILDTAGS}" # An extra run with --tests=false allows detecting code unused outside of tests; # ideally the linter should be able to find this automatically. # Since everything is already cached, this additional run doesn't take much time. $(GOBIN)/golangci-lint run --build-tags "${BUILDTAGS}" --tests=false BUILDTAGS="${BUILDTAGS}" hack/validate-vet.sh # This invokes bin/skopeo, hence cannot be run as part of validate-local .PHONY: validate-docs validate-docs: bin/skopeo hack/man-page-checker hack/xref-helpmsgs-manpages test-unit-local: $(GO) test $(SKOPEO_LDFLAGS) -tags "$(BUILDTAGS)" $$($(GO) list -tags "$(BUILDTAGS)" -e ./... | grep -v '^github\.com/containers/skopeo/\(integration\|vendor/.*\)$$') vendor: $(GO) mod tidy $(GO) mod vendor $(GO) mod verify vendor-in-container: podman run --privileged --rm --env HOME=/root -v $(CURDIR):/src -w /src golang $(MAKE) vendor ================================================ FILE: OWNERS ================================================ approvers: - baude - giuseppe - lsm5 - Luap99 - mheon - mtrmac - nalind - rhatdan - TomSweeneyRedHat reviewers: - ashley-cui - baude - cgwalters - giuseppe - lsm5 - Luap99 - mheon - mtrmac - nalind - rhatdan - TomSweeneyRedHat - vrothberg ================================================ FILE: README.md ================================================

Skopeo

---- ![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg) ![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/containers/skopeo) [![Go Report Card](https://goreportcard.com/badge/github.com/containers/skopeo)](https://goreportcard.com/report/github.com/containers/skopeo) [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/10516/badge)](https://www.bestpractices.dev/projects/10516) `skopeo` is a command line utility that performs various operations on container images and image repositories. `skopeo` does not require the user to be running as root to do most of its operations. `skopeo` does not require a daemon to be running to perform its operations. `skopeo` can work with [OCI images](https://github.com/opencontainers/image-spec) as well as the original Docker v2 images. Skopeo works with API V2 container image registries such as [docker.io](https://docker.io) and [quay.io](https://quay.io) registries, private registries, local directories and local OCI-layout directories. Skopeo can perform operations which consist of: * Copying an image from and to various storage mechanisms. For example you can copy images from one registry to another, without requiring privilege. * Inspecting a remote image showing its properties including its layers, without requiring you to pull the image to the host. * Deleting an image from an image repository. * Syncing an external image repository to an internal registry for air-gapped deployments. * When required by the repository, skopeo can pass the appropriate credentials and certificates for authentication. Skopeo operates on the following image and repository types: * containers-storage:docker-reference An image located in a local containers/storage image store. Both the location and image store are specified in /etc/containers/storage.conf. (This is the backend for [Podman](https://podman.io), [CRI-O](https://cri-o.io), [Buildah](https://buildah.io) and friends) * dir:path An existing local directory path storing the manifest, layer tarballs and signatures as individual files. This is a non-standardized format, primarily useful for debugging or noninvasive container inspection. * docker://docker-reference An image in a registry implementing the "Docker Registry HTTP API V2". By default, uses the authorization state in `$XDG_RUNTIME_DIR/containers/auth.json`, which is set using `skopeo login`. * docker-archive:path[:docker-reference] An image is stored in a `docker save`-formatted file. docker-reference is only used when creating such a file, and it must not contain a digest. * docker-daemon:docker-reference An image docker-reference stored in the docker daemon internal storage. docker-reference must contain either a tag or a digest. Alternatively, when reading images, the format can also be docker-daemon:algo:digest (an image ID). * oci:path:tag An image tag in a directory compliant with "Open Container Image Layout Specification" at path. [Obtaining skopeo](./install.md) - For a detailed description how to install or build skopeo, see [install.md](./install.md). Skopeo is also available as a Container Image on [quay.io](https://quay.io/skopeo/stable). For more information, see the [Skopeo Image](https://github.com/containers/image_build/blob/main/skopeo/README.md) page. ## Inspecting a repository `skopeo` is able to _inspect_ a repository on a container registry and fetch images layers. The _inspect_ command fetches the repository's manifest and it is able to show you a `docker inspect`-like json output about a whole repository or a tag. This tool, in contrast to `docker inspect`, helps you gather useful information about a repository or a tag before pulling it (using disk space). The inspect command can show you which tags are available for the given repository, the labels the image has, the creation date and operating system of the image and more. Examples: #### Show properties of fedora:latest ```console $ skopeo inspect docker://registry.fedoraproject.org/fedora:latest { "Name": "registry.fedoraproject.org/fedora", "Digest": "sha256:0f65bee641e821f8118acafb44c2f8fe30c2fc6b9a2b3729c0660376391aa117", "RepoTags": [ "34-aarch64", "34", "latest", ... ], "Created": "2022-11-24T13:54:18Z", "DockerVersion": "1.10.1", "Labels": { "license": "MIT", "name": "fedora", "vendor": "Fedora Project", "version": "37" }, "Architecture": "amd64", "Os": "linux", "Layers": [ "sha256:2a0fc6bf62e155737f0ace6142ee686f3c471c1aab4241dc3128904db46288f0" ], "LayersData": [ { "MIMEType": "application/vnd.docker.image.rootfs.diff.tar.gzip", "Digest": "sha256:2a0fc6bf62e155737f0ace6142ee686f3c471c1aab4241dc3128904db46288f0", "Size": 71355009, "Annotations": null } ], "Env": [ "DISTTAG=f37container", "FGC=f37", "container=oci" ] } ``` #### Show container configuration from `fedora:latest` ```console $ skopeo inspect --config docker://registry.fedoraproject.org/fedora:latest | jq { "created": "2020-04-29T06:48:16Z", "architecture": "amd64", "os": "linux", "config": { "Env": [ "DISTTAG=f32container", "FGC=f32", "container=oci" ], "Cmd": [ "/bin/bash" ], "Labels": { "license": "MIT", "name": "fedora", "vendor": "Fedora Project", "version": "32" } }, "rootfs": { "type": "layers", "diff_ids": [ "sha256:a4c0fa2b217d3fd63d51e55a6fd59432e543d499c0df2b1acd48fbe424f2ddd1" ] }, "history": [ { "created": "2020-04-29T06:48:16Z", "comment": "Created by Image Factory" } ] } ``` #### Show unverified image's digest ```console $ skopeo inspect docker://registry.fedoraproject.org/fedora:latest | jq '.Digest' "sha256:655721ff613ee766a4126cb5e0d5ae81598e1b0c3bcf7017c36c4d72cb092fe9" ``` ## Copying images `skopeo` can copy container images between various storage mechanisms, including: * Container registries - The Quay, Docker Hub, OpenShift, GCR, Artifactory ... * Container Storage backends - [github.com/containers/storage](https://github.com/containers/storage) (Backend for [Podman](https://podman.io), [CRI-O](https://cri-o.io), [Buildah](https://buildah.io) and friends) - Docker daemon storage * Local directories * Local OCI-layout directories ```console $ skopeo copy docker://quay.io/buildah/stable docker://registry.internal.company.com/buildah $ skopeo copy oci:busybox_ocilayout:latest dir:existingemptydirectory ``` ## Deleting images ```console $ skopeo delete docker://localhost:5000/imagename:latest ``` ## Syncing registries ```console $ skopeo sync --src docker --dest dir registry.example.com/busybox /media/usb ``` ## Authenticating to a registry #### Private registries with authentication skopeo uses credentials from the --creds (for skopeo inspect|delete) or --src-creds|--dest-creds (for skopeo copy) flags, if set; otherwise it uses configuration set by skopeo login, podman login, buildah login, or docker login. ```console $ skopeo login --username USER myregistrydomain.com:5000 Password: $ skopeo inspect docker://myregistrydomain.com:5000/busybox {"Tag":"latest","Digest":"sha256:473bb2189d7b913ed7187a33d11e743fdc2f88931122a44d91a301b64419f092","RepoTags":["latest"],"Comment":"","Created":"2016-01-15T18:06:41.282540103Z","ContainerConfig":{"Hostname":"aded96b43f48","Domainname":"","User":"","AttachStdin":false,"AttachStdout":false,"AttachStderr":false,"Tty":false,"OpenStdin":false,"StdinOnce":false,"Env":null,"Cmd":["/bin/sh","-c","#(nop) CMD [\"sh\"]"],"Image":"9e77fef7a1c9f989988c06620dabc4020c607885b959a2cbd7c2283c91da3e33","Volumes":null,"WorkingDir":"","Entrypoint":null,"OnBuild":null,"Labels":null},"DockerVersion":"1.8.3","Author":"","Config":{"Hostname":"aded96b43f48","Domainname":"","User":"","AttachStdin":false,"AttachStdout":false,"AttachStderr":false,"Tty":false,"OpenStdin":false,"StdinOnce":false,"Env":null,"Cmd":["sh"],"Image":"9e77fef7a1c9f989988c06620dabc4020c607885b959a2cbd7c2283c91da3e33","Volumes":null,"WorkingDir":"","Entrypoint":null,"OnBuild":null,"Labels":null},"Architecture":"amd64","Os":"linux"} $ skopeo logout myregistrydomain.com:5000 ``` #### Using --creds directly ```console $ skopeo inspect --creds=testuser:testpassword docker://myregistrydomain.com:5000/busybox {"Tag":"latest","Digest":"sha256:473bb2189d7b913ed7187a33d11e743fdc2f88931122a44d91a301b64419f092","RepoTags":["latest"],"Comment":"","Created":"2016-01-15T18:06:41.282540103Z","ContainerConfig":{"Hostname":"aded96b43f48","Domainname":"","User":"","AttachStdin":false,"AttachStdout":false,"AttachStderr":false,"Tty":false,"OpenStdin":false,"StdinOnce":false,"Env":null,"Cmd":["/bin/sh","-c","#(nop) CMD [\"sh\"]"],"Image":"9e77fef7a1c9f989988c06620dabc4020c607885b959a2cbd7c2283c91da3e33","Volumes":null,"WorkingDir":"","Entrypoint":null,"OnBuild":null,"Labels":null},"DockerVersion":"1.8.3","Author":"","Config":{"Hostname":"aded96b43f48","Domainname":"","User":"","AttachStdin":false,"AttachStdout":false,"AttachStderr":false,"Tty":false,"OpenStdin":false,"StdinOnce":false,"Env":null,"Cmd":["sh"],"Image":"9e77fef7a1c9f989988c06620dabc4020c607885b959a2cbd7c2283c91da3e33","Volumes":null,"WorkingDir":"","Entrypoint":null,"OnBuild":null,"Labels":null},"Architecture":"amd64","Os":"linux"} ``` ```console $ skopeo copy --src-creds=testuser:testpassword docker://myregistrydomain.com:5000/private oci:local_oci_image ``` Contributing - Please read the [contribution guide](CONTRIBUTING.md) if you want to collaborate in the project. ## Commands | Command | Description | | -------------------------------------------------- | ---------------------------------------------------------------------------------------------| | [skopeo-copy(1)](/docs/skopeo-copy.1.md) | Copy an image (manifest, filesystem layers, signatures) from one location to another. | | [skopeo-delete(1)](/docs/skopeo-delete.1.md) | Mark the image-name for later deletion by the registry's garbage collector. | | [skopeo-generate-sigstore-key(1)](/docs/skopeo-generate-sigstore-key.1.md) | Generate a sigstore public/private key pair. | | [skopeo-inspect(1)](/docs/skopeo-inspect.1.md) | Return low-level information about image-name in a registry. | | [skopeo-list-tags(1)](/docs/skopeo-list-tags.1.md) | Return a list of tags for the transport-specific image repository. | | [skopeo-login(1)](/docs/skopeo-login.1.md) | Login to a container registry. | | [skopeo-logout(1)](/docs/skopeo-logout.1.md) | Logout of a container registry. | | [skopeo-manifest-digest(1)](/docs/skopeo-manifest-digest.1.md) | Compute a manifest digest for a manifest-file and write it to standard output. | | [skopeo-standalone-sign(1)](/docs/skopeo-standalone-sign.1.md) | Debugging tool - Sign an image locally without uploading. | | [skopeo-standalone-verify(1)](/docs/skopeo-standalone-verify.1.md)| Debugging tool - Verify an image signature from local files. | | [skopeo-sync(1)](/docs/skopeo-sync.1.md) | Synchronize images between registry repositories and local directories. | License - skopeo is licensed under the Apache License, Version 2.0. See [LICENSE](LICENSE) for the full license text. ================================================ FILE: ROADMAP.md ================================================ # Skopeo Roadmap Skopeo intends to mostly continue to be a very thin CLI wrapper over the [https://github.com/containers/image](containers/image) library, with most features being added there, not to this repo. A typical new Skopeo feature would only add a CLI for a recent containers/image feature. ## Future feature focus (most of the work must be done in the containers/image library) * OCI artifact support. * Integration of composefs. * Partial pull support (zstd:chunked). * Performance and stability improvements. * Reductions to the size of the Skopeo binary. * `skopeo sync` exists, and bugs in it should be fixed, but we don’t have much of an ambition to compete with much larger projects like [https://github.com/openshift/oc-mirror](oc-mirror). ================================================ FILE: SECURITY.md ================================================ ## Security and Disclosure Information Policy for the skopeo Project The skopeo Project follows the [Security and Disclosure Information Policy](https://github.com/containers/common/blob/main/SECURITY.md) for the Containers Projects. ================================================ FILE: cmd/skopeo/completions.go ================================================ package main import ( "strings" "github.com/spf13/cobra" "go.podman.io/image/v5/directory" "go.podman.io/image/v5/docker" dockerArchive "go.podman.io/image/v5/docker/archive" ociArchive "go.podman.io/image/v5/oci/archive" oci "go.podman.io/image/v5/oci/layout" "go.podman.io/image/v5/sif" "go.podman.io/image/v5/tarball" "go.podman.io/image/v5/transports" ) func autocompleteImageNames(cmd *cobra.Command, args []string, toComplete string) ([]cobra.Completion, cobra.ShellCompDirective) { transport, details, haveTransport := strings.Cut(toComplete, ":") if !haveTransport { transports := supportedTransportSuggestions() return transports, cobra.ShellCompDirectiveNoSpace | cobra.ShellCompDirectiveNoFileComp } switch transport { case ociArchive.Transport.Name(), dockerArchive.Transport.Name(): // Can have [:{*reference|@source-index}] // FIXME: `oci-archive:/path/to/a.oci:` completes paths return nil, cobra.ShellCompDirectiveNoSpace case sif.Transport.Name(): return nil, cobra.ShellCompDirectiveDefault // Both directory and oci should have ShellCompDirectiveFilterDirs to complete only directories, but it doesn't currently work in bash: https://github.com/spf13/cobra/issues/2242 case oci.Transport.Name(): // Can have '[:{reference|@source-index}]' // FIXME: `oci:/path/to/dir/:` completes paths return nil, cobra.ShellCompDirectiveDefault | cobra.ShellCompDirectiveNoSpace case directory.Transport.Name(): return nil, cobra.ShellCompDirectiveDefault case docker.Transport.Name(): if details == "" { return []cobra.Completion{transport + "://"}, cobra.ShellCompDirectiveNoSpace | cobra.ShellCompDirectiveNoFileComp } } return nil, cobra.ShellCompDirectiveNoSpace | cobra.ShellCompDirectiveNoFileComp } // supportedTransportSuggestions list all supported transports with the colon suffix. func supportedTransportSuggestions() []string { tps := transports.ListNames() suggestions := make([]cobra.Completion, 0, len(tps)) for _, tp := range tps { // ListNames is generally expected to filter out deprecated transports. // tarball: is not deprecated, but it is only usable from a Go caller (using tarball.ConfigUpdater), // so don’t offer it on the CLI. if tp != tarball.Transport.Name() { suggestions = append(suggestions, tp+":") } } return suggestions } ================================================ FILE: cmd/skopeo/copy.go ================================================ package main import ( "errors" "fmt" "io" "os" "strings" encconfig "github.com/containers/ocicrypt/config" enchelpers "github.com/containers/ocicrypt/helpers" "github.com/spf13/cobra" commonFlag "go.podman.io/common/pkg/flag" "go.podman.io/common/pkg/retry" "go.podman.io/image/v5/copy" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/manifest" "go.podman.io/image/v5/transports" "go.podman.io/image/v5/transports/alltransports" ) type copyOptions struct { global *globalOptions deprecatedTLSVerify *deprecatedTLSVerifyOption srcImage *imageOptions destImage *imageDestOptions retryOpts *retry.Options copy *sharedCopyOptions additionalTags []string // For docker-archive: destinations, in addition to the name:tag specified as destination, also add these signIdentity string // Identity of the signed image, must be a fully specified docker reference digestFile string // Write digest to this file quiet bool // Suppress output information when copying images all bool // Copy all of the images if the source is a list multiArch commonFlag.OptionalString // How to handle multi architecture images encryptLayer []int // The list of layers to encrypt encryptionKeys []string // Keys needed to encrypt the image decryptionKeys []string // Keys needed to decrypt the image imageParallelCopies uint // Maximum number of parallel requests when copying images } func copyCmd(global *globalOptions) *cobra.Command { sharedFlags, sharedOpts := sharedImageFlags() deprecatedTLSVerifyFlags, deprecatedTLSVerifyOpt := deprecatedTLSVerifyFlags() srcFlags, srcOpts := imageFlags(global, sharedOpts, deprecatedTLSVerifyOpt, "src-", "screds") destFlags, destOpts := imageDestFlags(global, sharedOpts, deprecatedTLSVerifyOpt, "dest-", "dcreds") retryFlags, retryOpts := retryFlags() copyFlags, copyOpts := sharedCopyFlags() opts := copyOptions{ global: global, deprecatedTLSVerify: deprecatedTLSVerifyOpt, srcImage: srcOpts, destImage: destOpts, retryOpts: retryOpts, copy: copyOpts, } cmd := &cobra.Command{ Use: "copy [command options] SOURCE-IMAGE DESTINATION-IMAGE", Short: "Copy an IMAGE-NAME from one location to another", Long: fmt.Sprintf(`Container "IMAGE-NAME" uses a "transport":"details" format. Supported transports: %s See skopeo(1) section "IMAGE NAMES" for the expected format `, strings.Join(transports.ListNames(), ", ")), RunE: commandAction(opts.run), Example: `skopeo copy docker://quay.io/skopeo/stable:latest docker://registry.example.com/skopeo:latest`, ValidArgsFunction: autocompleteImageNames, } adjustUsage(cmd) flags := cmd.Flags() flags.AddFlagSet(&sharedFlags) flags.AddFlagSet(&deprecatedTLSVerifyFlags) flags.AddFlagSet(&srcFlags) flags.AddFlagSet(&destFlags) flags.AddFlagSet(&retryFlags) flags.AddFlagSet(©Flags) flags.StringSliceVar(&opts.additionalTags, "additional-tag", []string{}, "additional tags (supports docker-archive)") flags.BoolVarP(&opts.quiet, "quiet", "q", false, "Suppress output information when copying images") flags.BoolVarP(&opts.all, "all", "a", false, "Copy all images if SOURCE-IMAGE is a list") flags.Var(commonFlag.NewOptionalStringValue(&opts.multiArch), "multi-arch", `How to handle multi-architecture images (system, all, or index-only)`) flags.StringVar(&opts.signIdentity, "sign-identity", "", "Identity of signed image, must be a fully specified docker reference. Defaults to the target docker reference.") flags.StringVar(&opts.digestFile, "digestfile", "", "Write the digest of the pushed image to the specified file") flags.StringSliceVar(&opts.encryptionKeys, "encryption-key", []string{}, "*Experimental* key with the encryption protocol to use needed to encrypt the image (e.g. jwe:/path/to/key.pem)") flags.IntSliceVar(&opts.encryptLayer, "encrypt-layer", []int{}, "*Experimental* the 0-indexed layer indices, with support for negative indexing (e.g. 0 is the first layer, -1 is the last layer)") flags.StringSliceVar(&opts.decryptionKeys, "decryption-key", []string{}, "*Experimental* key needed to decrypt the image") flags.UintVar(&opts.imageParallelCopies, "image-parallel-copies", 0, "Maximum number of image layers to be copied (pulled/pushed) simultaneously. Not setting this field will fall back to containers/image defaults.") return cmd } // parseMultiArch parses the list processing selection // It returns the copy.ImageListSelection to use with image.Copy option func parseMultiArch(multiArch string) (copy.ImageListSelection, error) { switch multiArch { case "system": return copy.CopySystemImage, nil case "all": return copy.CopyAllImages, nil // There is no CopyNoImages value in copy.ImageListSelection, but because we // don't provide an option to select a set of images to copy, we can use // CopySpecificImages. case "index-only": return copy.CopySpecificImages, nil // We don't expose CopySpecificImages other than index-only above, because // we currently don't provide an option to choose the images to copy. That // could be added in the future. default: return copy.CopySystemImage, fmt.Errorf("unknown multi-arch option %q. Choose one of the supported options: 'system', 'all', or 'index-only'", multiArch) } } func (opts *copyOptions) run(args []string, stdout io.Writer) (retErr error) { if len(args) != 2 { return errorShouldDisplayUsage{errors.New("Exactly two arguments expected")} } opts.deprecatedTLSVerify.warnIfUsed([]string{"--src-tls-verify", "--dest-tls-verify"}) imageNames := args if err := reexecIfNecessaryForImages(imageNames...); err != nil { return err } policyContext, err := opts.global.getPolicyContext() if err != nil { return fmt.Errorf("Error loading trust policy: %v", err) } defer func() { if err := policyContext.Destroy(); err != nil { retErr = noteCloseFailure(retErr, "tearing down policy context", err) } }() srcRef, err := alltransports.ParseImageName(imageNames[0]) if err != nil { return fmt.Errorf("Invalid source name %s: %v", imageNames[0], err) } destRef, err := alltransports.ParseImageName(imageNames[1]) if err != nil { return fmt.Errorf("Invalid destination name %s: %v", imageNames[1], err) } sourceCtx, err := opts.srcImage.newSystemContext() if err != nil { return err } destinationCtx, err := opts.destImage.newSystemContext() if err != nil { return err } for _, image := range opts.additionalTags { ref, err := reference.ParseNormalizedNamed(image) if err != nil { return fmt.Errorf("error parsing additional-tag '%s': %v", image, err) } namedTagged, isNamedTagged := ref.(reference.NamedTagged) if !isNamedTagged { return fmt.Errorf("additional-tag '%s' must be a tagged reference", image) } destinationCtx.DockerArchiveAdditionalTags = append(destinationCtx.DockerArchiveAdditionalTags, namedTagged) } ctx, cancel := opts.global.commandTimeoutContext() defer cancel() if opts.quiet { stdout = nil } imageListSelection := copy.CopySystemImage if opts.multiArch.Present() && opts.all { return fmt.Errorf("Cannot use --all and --multi-arch flags together") } if opts.multiArch.Present() { imageListSelection, err = parseMultiArch(opts.multiArch.Value()) if err != nil { return err } } if opts.all { imageListSelection = copy.CopyAllImages } if len(opts.encryptionKeys) > 0 && len(opts.decryptionKeys) > 0 { return fmt.Errorf("--encryption-key and --decryption-key cannot be specified together") } var encLayers *[]int var encConfig *encconfig.EncryptConfig var decConfig *encconfig.DecryptConfig if len(opts.encryptLayer) > 0 && len(opts.encryptionKeys) == 0 { return fmt.Errorf("--encrypt-layer can only be used with --encryption-key") } if len(opts.encryptionKeys) > 0 { // encryption p := opts.encryptLayer encLayers = &p encryptionKeys := opts.encryptionKeys ecc, err := enchelpers.CreateCryptoConfig(encryptionKeys, []string{}) if err != nil { return fmt.Errorf("Invalid encryption keys: %v", err) } cc := encconfig.CombineCryptoConfigs([]encconfig.CryptoConfig{ecc}) encConfig = cc.EncryptConfig } if len(opts.decryptionKeys) > 0 { // decryption decryptionKeys := opts.decryptionKeys dcc, err := enchelpers.CreateCryptoConfig([]string{}, decryptionKeys) if err != nil { return fmt.Errorf("Invalid decryption keys: %v", err) } cc := encconfig.CombineCryptoConfigs([]encconfig.CryptoConfig{dcc}) decConfig = cc.DecryptConfig } var signIdentity reference.Named = nil if opts.signIdentity != "" { signIdentity, err = reference.ParseNamed(opts.signIdentity) if err != nil { return fmt.Errorf("Could not parse --sign-identity: %v", err) } } opts.destImage.warnAboutIneffectiveOptions(destRef.Transport()) copyOpts, cleanupOptions, err := opts.copy.copyOptions(stdout) if err != nil { return err } defer cleanupOptions() copyOpts.SignIdentity = signIdentity copyOpts.SourceCtx = sourceCtx copyOpts.DestinationCtx = destinationCtx copyOpts.ImageListSelection = imageListSelection copyOpts.OciDecryptConfig = decConfig copyOpts.OciEncryptLayers = encLayers copyOpts.OciEncryptConfig = encConfig copyOpts.MaxParallelDownloads = opts.imageParallelCopies copyOpts.ForceCompressionFormat = opts.destImage.forceCompressionFormat return retry.IfNecessary(ctx, func() error { manifestBytes, err := copy.Image(ctx, policyContext, destRef, srcRef, copyOpts) if err != nil { return err } if opts.digestFile != "" { manifestDigest, err := manifest.Digest(manifestBytes) if err != nil { return err } if err = os.WriteFile(opts.digestFile, []byte(manifestDigest.String()), 0o644); err != nil { return fmt.Errorf("Failed to write digest to file %q: %w", opts.digestFile, err) } } return nil }, opts.retryOpts) } ================================================ FILE: cmd/skopeo/copy_test.go ================================================ package main import "testing" func TestCopy(t *testing.T) { // Invalid command-line arguments for _, args := range [][]string{ {}, {"a1"}, {"a1", "a2", "a3"}, } { out, err := runSkopeo(append([]string{"--insecure-policy", "copy"}, args...)...) assertTestFailed(t, out, err, "Exactly two arguments expected") } // FIXME: Much more test coverage // Actual feature tests exist in integration and systemtest } ================================================ FILE: cmd/skopeo/delete.go ================================================ package main import ( "errors" "fmt" "io" "strings" "github.com/spf13/cobra" "go.podman.io/common/pkg/retry" "go.podman.io/image/v5/transports" "go.podman.io/image/v5/transports/alltransports" ) type deleteOptions struct { global *globalOptions image *imageOptions retryOpts *retry.Options } func deleteCmd(global *globalOptions) *cobra.Command { sharedFlags, sharedOpts := sharedImageFlags() imageFlags, imageOpts := imageFlags(global, sharedOpts, nil, "", "") retryFlags, retryOpts := retryFlags() opts := deleteOptions{ global: global, image: imageOpts, retryOpts: retryOpts, } cmd := &cobra.Command{ Use: "delete [command options] IMAGE-NAME", Short: "Delete image IMAGE-NAME", Long: fmt.Sprintf(`Delete an "IMAGE_NAME" from a transport Supported transports: %s See skopeo(1) section "IMAGE NAMES" for the expected format `, strings.Join(transports.ListNames(), ", ")), RunE: commandAction(opts.run), Example: `skopeo delete docker://registry.example.com/example/pause:latest`, ValidArgsFunction: autocompleteImageNames, } adjustUsage(cmd) flags := cmd.Flags() flags.AddFlagSet(&sharedFlags) flags.AddFlagSet(&imageFlags) flags.AddFlagSet(&retryFlags) return cmd } func (opts *deleteOptions) run(args []string, stdout io.Writer) error { if len(args) != 1 { return errors.New("Usage: delete imageReference") } imageName := args[0] if err := reexecIfNecessaryForImages(imageName); err != nil { return err } ref, err := alltransports.ParseImageName(imageName) if err != nil { return fmt.Errorf("Invalid source name %s: %v", imageName, err) } sys, err := opts.image.newSystemContext() if err != nil { return err } ctx, cancel := opts.global.commandTimeoutContext() defer cancel() return retry.IfNecessary(ctx, func() error { return ref.DeleteImage(ctx, sys) }, opts.retryOpts) } ================================================ FILE: cmd/skopeo/fixtures/.gitignore ================================================ /*.gpg~ /.gpg-v21-migrated /private-keys-v1.d /random_seed ================================================ FILE: cmd/skopeo/fixtures/empty.passphrase ================================================ ================================================ FILE: cmd/skopeo/fixtures/image.manifest.json ================================================ { "schemaVersion": 2, "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "config": { "mediaType": "application/vnd.docker.container.image.v1+json", "size": 7023, "digest": "sha256:b5b2b2c507a0944348e0303114d8d93aaaa081732b86451d9bce1f432a537bc7" }, "layers": [ { "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip", "size": 32654, "digest": "sha256:e692418e4cbaf90ca69d05a66403747baa33ee08806650b51fab815ad7fc331f" }, { "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip", "size": 16724, "digest": "sha256:3c3a4604a545cdc127456d94e421cd355bca5b528f4a9c1905b15da2eb4a4c6b" }, { "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip", "size": 73109, "digest": "sha256:ec4b8955958665577945c89419d1af06b5f7636b4ac3da7f12184802ad867736" } ] } ================================================ FILE: cmd/skopeo/fixtures/v2s1-invalid-signatures.manifest.json ================================================ { "schemaVersion": 1, "name": "mitr/buxybox", "tag": "latest", "architecture": "amd64", "fsLayers": [ ], "history": [ ], "signatures": 1 } ================================================ FILE: cmd/skopeo/generate_sigstore_key.go ================================================ package main import ( "errors" "fmt" "io" "io/fs" "os" "github.com/spf13/cobra" "go.podman.io/image/v5/pkg/cli" "go.podman.io/image/v5/signature/sigstore" ) type generateSigstoreKeyOptions struct { outputPrefix string passphraseFile string } func generateSigstoreKeyCmd() *cobra.Command { var opts generateSigstoreKeyOptions cmd := &cobra.Command{ Use: "generate-sigstore-key [command options] --output-prefix PREFIX", Short: "Generate a sigstore public/private key pair", RunE: commandAction(opts.run), Example: "skopeo generate-sigstore-key --output-prefix my-key", } adjustUsage(cmd) flags := cmd.Flags() flags.StringVar(&opts.outputPrefix, "output-prefix", "", "Write the keys to `PREFIX`.pub and `PREFIX`.private") flags.StringVar(&opts.passphraseFile, "passphrase-file", "", "Read a passphrase for the private key from `PATH`") return cmd } // ensurePathDoesNotExist verifies that path does not refer to an existing file, // and returns an error if so. func ensurePathDoesNotExist(path string) error { switch _, err := os.Stat(path); { case err == nil: return fmt.Errorf("Refusing to overwrite existing %q", path) case errors.Is(err, fs.ErrNotExist): return nil default: return fmt.Errorf("Error checking existence of %q: %w", path, err) } } func (opts *generateSigstoreKeyOptions) run(args []string, stdout io.Writer) error { if len(args) != 0 || opts.outputPrefix == "" { return errors.New("Usage: generate-sigstore-key --output-prefix PREFIX") } pubKeyPath := opts.outputPrefix + ".pub" privateKeyPath := opts.outputPrefix + ".private" if err := ensurePathDoesNotExist(pubKeyPath); err != nil { return err } if err := ensurePathDoesNotExist(privateKeyPath); err != nil { return err } var passphrase string if opts.passphraseFile != "" { p, err := cli.ReadPassphraseFile(opts.passphraseFile) if err != nil { return err } passphrase = p } else { p, err := promptForPassphrase(privateKeyPath, os.Stdin, os.Stdout) if err != nil { return err } passphrase = p } keys, err := sigstore.GenerateKeyPair([]byte(passphrase)) if err != nil { return fmt.Errorf("Error generating key pair: %w", err) } if err := os.WriteFile(privateKeyPath, keys.PrivateKey, 0o600); err != nil { return fmt.Errorf("Error writing private key to %q: %w", privateKeyPath, err) } if err := os.WriteFile(pubKeyPath, keys.PublicKey, 0o644); err != nil { return fmt.Errorf("Error writing private key to %q: %w", pubKeyPath, err) } fmt.Fprintf(stdout, "Key written to %q and %q\n", privateKeyPath, pubKeyPath) return nil } ================================================ FILE: cmd/skopeo/generate_sigstore_key_test.go ================================================ package main import ( "os" "path/filepath" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestGenerateSigstoreKey(t *testing.T) { // Invalid command-line arguments for _, args := range [][]string{ {}, {"--output-prefix", "foo", "a1"}, } { out, err := runSkopeo(append([]string{"generate-sigstore-key"}, args...)...) assertTestFailed(t, out, err, "Usage") } // One of the destination files already exists outputSuffixes := []string{".pub", ".private"} for _, suffix := range outputSuffixes { dir := t.TempDir() prefix := filepath.Join(dir, "prefix") err := os.WriteFile(prefix+suffix, []byte{}, 0o600) require.NoError(t, err) out, err := runSkopeo("generate-sigstore-key", "--output-prefix", prefix, "--passphrase-file", "/dev/null", ) assertTestFailed(t, out, err, "Refusing to overwrite") } // One of the destinations is inaccessible (simulate by a symlink that tries to // traverse a non-directory) for _, suffix := range outputSuffixes { dir := t.TempDir() nonDirectory := filepath.Join(dir, "nondirectory") err := os.WriteFile(nonDirectory, []byte{}, 0o600) require.NoError(t, err) prefix := filepath.Join(dir, "prefix") err = os.Symlink(filepath.Join(nonDirectory, "unaccessible"), prefix+suffix) require.NoError(t, err) out, err := runSkopeo("generate-sigstore-key", "--output-prefix", prefix, "--passphrase-file", "/dev/null", ) assertTestFailed(t, out, err, prefix+suffix) // + an OS-specific error message } destDir := t.TempDir() // Error reading passphrase out, err := runSkopeo("generate-sigstore-key", "--output-prefix", filepath.Join(destDir, "prefix"), "--passphrase-file", filepath.Join(destDir, "this-does-not-exist"), ) assertTestFailed(t, out, err, "this-does-not-exist") // (The interactive passphrase prompting is not yet tested) // Error writing outputs is untested: when unit tests run as root, we can’t use permissions on a directory to cause write failures, // with the --output-prefix mechanism, and refusing to even start writing to pre-exisiting files, directories are the only mechanism // we have to trigger a write failure. // Success // Just a smoke-test, usability of the keys is tested in the generate implementation. dir := t.TempDir() prefix := filepath.Join(dir, "prefix") passphraseFile := filepath.Join(dir, "passphrase") err = os.WriteFile(passphraseFile, []byte("some passphrase"), 0o600) require.NoError(t, err) out, err = runSkopeo("generate-sigstore-key", "--output-prefix", prefix, "--passphrase-file", passphraseFile, ) assert.NoError(t, err) for _, suffix := range outputSuffixes { assert.Contains(t, out, prefix+suffix) } } ================================================ FILE: cmd/skopeo/inspect/output.go ================================================ package inspect import ( "time" digest "github.com/opencontainers/go-digest" "go.podman.io/image/v5/types" ) // Output is the output format of (skopeo inspect), // primarily so that we can format it with a simple json.MarshalIndent. type Output struct { Name string `json:",omitempty"` Tag string `json:",omitempty"` Digest digest.Digest RepoTags []string Created *time.Time DockerVersion string Labels map[string]string Architecture string Os string Layers []string LayersData []types.ImageInspectLayer Env []string } ================================================ FILE: cmd/skopeo/inspect.go ================================================ package main import ( "encoding/json" "errors" "fmt" "io" "strings" "github.com/containers/skopeo/cmd/skopeo/inspect" "github.com/docker/distribution/registry/api/errcode" "github.com/opencontainers/go-digest" v1 "github.com/opencontainers/image-spec/specs-go/v1" "github.com/sirupsen/logrus" "github.com/spf13/cobra" "go.podman.io/common/pkg/report" "go.podman.io/common/pkg/retry" "go.podman.io/image/v5/docker" "go.podman.io/image/v5/image" "go.podman.io/image/v5/manifest" "go.podman.io/image/v5/transports" "go.podman.io/image/v5/types" ) type inspectOptions struct { global *globalOptions image *imageOptions retryOpts *retry.Options format string raw bool // Output the raw manifest instead of parsing information about the image config bool // Output the raw config blob instead of parsing information about the image doNotListTags bool // Do not list all tags available in the same repository manifestDigest digest.Algorithm // Algorithm to use for computing manifest digest } func inspectCmd(global *globalOptions) *cobra.Command { sharedFlags, sharedOpts := sharedImageFlags() imageFlags, imageOpts := imageFlags(global, sharedOpts, nil, "", "") retryFlags, retryOpts := retryFlags() opts := inspectOptions{ global: global, image: imageOpts, retryOpts: retryOpts, } cmd := &cobra.Command{ Use: "inspect [command options] IMAGE-NAME", Short: "Inspect image IMAGE-NAME", Long: fmt.Sprintf(`Return low-level information about "IMAGE-NAME" in a registry/transport Supported transports: %s See skopeo(1) section "IMAGE NAMES" for the expected format `, strings.Join(transports.ListNames(), ", ")), RunE: commandAction(opts.run), Example: `skopeo inspect docker://registry.fedoraproject.org/fedora skopeo inspect --config docker://docker.io/alpine skopeo inspect --format "Name: {{.Name}} Digest: {{.Digest}}" docker://registry.access.redhat.com/ubi8`, ValidArgsFunction: autocompleteImageNames, } adjustUsage(cmd) flags := cmd.Flags() flags.AddFlagSet(&sharedFlags) flags.AddFlagSet(&imageFlags) flags.AddFlagSet(&retryFlags) flags.BoolVar(&opts.raw, "raw", false, "output raw manifest or configuration") flags.BoolVar(&opts.config, "config", false, "output configuration") flags.StringVarP(&opts.format, "format", "f", "", "Format the output to a Go template") flags.BoolVarP(&opts.doNotListTags, "no-tags", "n", false, "Do not list the available tags from the repository in the output") flags.Var(newAlgorithmValue(&opts.manifestDigest), "manifest-digest", "Algorithm to use for computing manifest digest (sha256, sha512); defaults to algorithm used in config digest") return cmd } func (opts *inspectOptions) run(args []string, stdout io.Writer) (retErr error) { var ( rawManifest []byte src types.ImageSource imgInspect *types.ImageInspectInfo ) ctx, cancel := opts.global.commandTimeoutContext() defer cancel() if len(args) != 1 { return errors.New("Exactly one argument expected") } if opts.raw && opts.format != "" { return errors.New("raw output does not support format option") } imageName := args[0] if err := reexecIfNecessaryForImages(imageName); err != nil { return err } sys, err := opts.image.newSystemContext() if err != nil { return err } if err := retry.IfNecessary(ctx, func() error { src, err = parseImageSource(ctx, opts.image, imageName) return err }, opts.retryOpts); err != nil { return fmt.Errorf("Error parsing image name %q: %w", imageName, err) } defer func() { if err := src.Close(); err != nil { retErr = noteCloseFailure(retErr, "closing image", err) } }() unparsedInstance := image.UnparsedInstance(src, nil) if err := retry.IfNecessary(ctx, func() error { rawManifest, _, err = unparsedInstance.Manifest(ctx) return err }, opts.retryOpts); err != nil { return fmt.Errorf("Error retrieving manifest for image: %w", err) } if opts.raw && !opts.config { _, err := stdout.Write(rawManifest) if err != nil { return fmt.Errorf("Error writing manifest to standard output: %w", err) } return nil } img, err := image.FromUnparsedImage(ctx, sys, unparsedInstance) if err != nil { return fmt.Errorf("Error parsing manifest for image: %w", err) } if opts.config && opts.raw { var configBlob []byte if err := retry.IfNecessary(ctx, func() error { configBlob, err = img.ConfigBlob(ctx) return err }, opts.retryOpts); err != nil { return fmt.Errorf("Error reading configuration blob: %w", err) } _, err = stdout.Write(configBlob) if err != nil { return fmt.Errorf("Error writing configuration blob to standard output: %w", err) } return nil } else if opts.config { var config *v1.Image if err := retry.IfNecessary(ctx, func() error { config, err = img.OCIConfig(ctx) return err }, opts.retryOpts); err != nil { return fmt.Errorf("Error reading OCI-formatted configuration data: %w", err) } if err := opts.writeOutput(stdout, config); err != nil { return fmt.Errorf("Error writing OCI-formatted configuration data to standard output: %w", err) } return nil } if err := retry.IfNecessary(ctx, func() error { imgInspect, err = img.Inspect(ctx) return err }, opts.retryOpts); err != nil { return err } outputData := inspect.Output{ Name: "", // Set below if DockerReference() is known Tag: imgInspect.Tag, // Digest is set below. RepoTags: []string{}, // Possibly overridden for docker.Transport. Created: imgInspect.Created, DockerVersion: imgInspect.DockerVersion, Labels: imgInspect.Labels, Architecture: imgInspect.Architecture, Os: imgInspect.Os, Layers: imgInspect.Layers, LayersData: imgInspect.LayersData, Env: imgInspect.Env, } outputData.Digest, err = manifestDigestFromManifest(rawManifest, img, opts.manifestDigest) if err != nil { return fmt.Errorf("Error computing manifest digest: %w", err) } if dockerRef := img.Reference().DockerReference(); dockerRef != nil { outputData.Name = dockerRef.Name() } if !opts.doNotListTags && img.Reference().Transport() == docker.Transport { sys, err := opts.image.newSystemContext() if err != nil { return err } outputData.RepoTags, err = docker.GetRepositoryTags(ctx, sys, img.Reference()) if err != nil { // Some registries may decide to block the "list all tags" endpoint; // gracefully allow the inspect to continue in this case: fatalFailure := true // - AWS ECR rejects it if the "ecr:ListImages" action is not allowed. // https://github.com/containers/skopeo/issues/726 var ec errcode.ErrorCoder if ok := errors.As(err, &ec); ok && ec.ErrorCode() == errcode.ErrorCodeDenied { fatalFailure = false } // - public.ecr.aws does not implement the endpoint at all, and fails with 404: // https://github.com/containers/skopeo/issues/1230 // This is actually "code":"NOT_FOUND", and the parser doesn’t preserve that. // So, also check the error text. if ok := errors.As(err, &ec); ok && ec.ErrorCode() == errcode.ErrorCodeUnknown { var e errcode.Error if ok := errors.As(err, &e); ok && e.Code == errcode.ErrorCodeUnknown && e.Message == "404 page not found" { fatalFailure = false } } if fatalFailure { return fmt.Errorf("Error determining repository tags: %w", err) } logrus.Warnf("Registry disallows tag list retrieval; skipping") } } return opts.writeOutput(stdout, outputData) } // writeOutput writes data depending on opts.format to stdout func (opts *inspectOptions) writeOutput(stdout io.Writer, data any) error { if report.IsJSON(opts.format) || opts.format == "" { out, err := json.MarshalIndent(data, "", " ") if err == nil { fmt.Fprintf(stdout, "%s\n", string(out)) } return err } rpt, err := report.New(stdout, "skopeo inspect").Parse(report.OriginUser, opts.format) if err != nil { return err } defer rpt.Flush() return rpt.Execute([]any{data}) } func manifestDigestFromManifest(manifestBlob []byte, img types.Image, userAlgorithm digest.Algorithm) (digest.Digest, error) { if userAlgorithm != "" { if !userAlgorithm.Available() { return "", fmt.Errorf("digest algorithm %q is not available", userAlgorithm) } return manifest.DigestWithAlgorithm(manifestBlob, userAlgorithm) } configInfo := img.ConfigInfo() if configInfo.Digest != "" { alg := configInfo.Digest.Algorithm() if !alg.Available() { return "", fmt.Errorf("config digest algorithm %q is not available", alg) } return manifest.DigestWithAlgorithm(manifestBlob, alg) } return manifest.Digest(manifestBlob) } type algorithmValue digest.Algorithm func newAlgorithmValue(alg *digest.Algorithm) *algorithmValue { return (*algorithmValue)(alg) } func (a *algorithmValue) Set(value string) error { algorithm := digest.Algorithm(value) *a = algorithmValue(algorithm) if algorithm == "" { *a = algorithmValue(digest.Canonical) } return nil } func (a *algorithmValue) String() string { return digest.Algorithm(*a).String() } func (a *algorithmValue) Type() string { return "algorithm" } ================================================ FILE: cmd/skopeo/layers.go ================================================ package main import ( "errors" "fmt" "io" "os" "strings" "github.com/opencontainers/go-digest" "github.com/spf13/cobra" "go.podman.io/common/pkg/retry" "go.podman.io/image/v5/directory" "go.podman.io/image/v5/image" "go.podman.io/image/v5/pkg/blobinfocache" "go.podman.io/image/v5/types" ) type layersOptions struct { global *globalOptions image *imageOptions retryOpts *retry.Options } func layersCmd(global *globalOptions) *cobra.Command { sharedFlags, sharedOpts := sharedImageFlags() imageFlags, imageOpts := imageFlags(global, sharedOpts, nil, "", "") retryFlags, retryOpts := retryFlags() opts := layersOptions{ global: global, image: imageOpts, retryOpts: retryOpts, } cmd := &cobra.Command{ Hidden: true, Use: "layers [command options] IMAGE-NAME [LAYER...]", Short: "Get layers of IMAGE-NAME", RunE: commandAction(opts.run), } adjustUsage(cmd) flags := cmd.Flags() flags.AddFlagSet(&sharedFlags) flags.AddFlagSet(&imageFlags) flags.AddFlagSet(&retryFlags) return cmd } func (opts *layersOptions) run(args []string, stdout io.Writer) (retErr error) { fmt.Fprintln(os.Stderr, `DEPRECATED: skopeo layers is deprecated in favor of skopeo copy`) if len(args) == 0 { return errors.New("Usage: layers imageReference [layer...]") } imageName := args[0] if err := reexecIfNecessaryForImages(imageName); err != nil { return err } ctx, cancel := opts.global.commandTimeoutContext() defer cancel() sys, err := opts.image.newSystemContext() if err != nil { return err } cache := blobinfocache.DefaultCache(sys) var ( rawSource types.ImageSource src types.ImageCloser ) if err = retry.IfNecessary(ctx, func() error { rawSource, err = parseImageSource(ctx, opts.image, imageName) return err }, opts.retryOpts); err != nil { return err } if err = retry.IfNecessary(ctx, func() error { src, err = image.FromSource(ctx, sys, rawSource) return err }, opts.retryOpts); err != nil { if closeErr := rawSource.Close(); closeErr != nil { return fmt.Errorf("%w (closing image source: %v)", err, closeErr) } return err } defer func() { if err := src.Close(); err != nil { retErr = noteCloseFailure(retErr, "closing image", err) } }() type blobDigest struct { digest digest.Digest isConfig bool } var blobDigests []blobDigest for _, dString := range args[1:] { if !strings.HasPrefix(dString, "sha256:") { dString = "sha256:" + dString } d, err := digest.Parse(dString) if err != nil { return err } blobDigests = append(blobDigests, blobDigest{digest: d, isConfig: false}) } if len(blobDigests) == 0 { layers := src.LayerInfos() seenLayers := map[digest.Digest]struct{}{} for _, info := range layers { if _, ok := seenLayers[info.Digest]; !ok { blobDigests = append(blobDigests, blobDigest{digest: info.Digest, isConfig: false}) seenLayers[info.Digest] = struct{}{} } } configInfo := src.ConfigInfo() if configInfo.Digest != "" { blobDigests = append(blobDigests, blobDigest{digest: configInfo.Digest, isConfig: true}) } } tmpDir, err := os.MkdirTemp(".", "layers-") if err != nil { return err } tmpDirRef, err := directory.NewReference(tmpDir) if err != nil { return err } dest, err := tmpDirRef.NewImageDestination(ctx, nil) if err != nil { return err } defer func() { if err := dest.Close(); err != nil { retErr = noteCloseFailure(retErr, "closing destination", err) } }() for _, bd := range blobDigests { var ( r io.ReadCloser blobSize int64 ) if err = retry.IfNecessary(ctx, func() error { r, blobSize, err = rawSource.GetBlob(ctx, types.BlobInfo{Digest: bd.digest, Size: -1}, cache) return err }, opts.retryOpts); err != nil { return err } defer func() { if err := r.Close(); err != nil { retErr = noteCloseFailure(retErr, fmt.Sprintf("closing blob %q", bd.digest.String()), err) } }() verifier := bd.digest.Verifier() tr := io.TeeReader(r, verifier) if _, err := dest.PutBlob(ctx, tr, types.BlobInfo{Digest: bd.digest, Size: blobSize}, cache, bd.isConfig); err != nil { return err } if _, err := io.Copy(io.Discard, tr); err != nil { // Ensure we process all of tr, so that we can validate the digest. return err } if !verifier.Verified() { return fmt.Errorf("corrupt blob %q", bd.digest.String()) } } var manifest []byte if err = retry.IfNecessary(ctx, func() error { manifest, _, err = src.Manifest(ctx) return err }, opts.retryOpts); err != nil { return err } if err := dest.PutManifest(ctx, manifest, nil); err != nil { return err } return dest.Commit(ctx, image.UnparsedInstance(rawSource, nil)) } ================================================ FILE: cmd/skopeo/list_tags.go ================================================ package main import ( "context" "encoding/json" "errors" "fmt" "io" "maps" "slices" "strings" "github.com/spf13/cobra" "go.podman.io/common/pkg/retry" "go.podman.io/image/v5/docker" "go.podman.io/image/v5/docker/archive" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/transports/alltransports" "go.podman.io/image/v5/types" ) // tagListOutput is the output format of (skopeo list-tags), primarily so that we can format it with a simple json.MarshalIndent. type tagListOutput struct { Repository string `json:",omitempty"` Tags []string } type tagsOptions struct { global *globalOptions image *imageOptions retryOpts *retry.Options } var transportHandlers = map[string]func(ctx context.Context, sys *types.SystemContext, opts *tagsOptions, userInput string) (repositoryName string, tagListing []string, err error){ docker.Transport.Name(): listDockerRepoTags, archive.Transport.Name(): listDockerArchiveTags, } // supportedTransports returns all the supported transports func supportedTransports(joinStr string) string { res := slices.Sorted(maps.Keys(transportHandlers)) return strings.Join(res, joinStr) } func tagsCmd(global *globalOptions) *cobra.Command { sharedFlags, sharedOpts := sharedImageFlags() imageFlags, imageOpts := dockerImageFlags(global, sharedOpts, nil, "", "") retryFlags, retryOpts := retryFlags() opts := tagsOptions{ global: global, image: imageOpts, retryOpts: retryOpts, } cmd := &cobra.Command{ Use: "list-tags [command options] SOURCE-IMAGE", Short: "List tags in the transport/repository specified by the SOURCE-IMAGE", Long: `Return the list of tags from the transport/repository "SOURCE-IMAGE" Supported transports: ` + supportedTransports(" ") + ` See skopeo-list-tags(1) section "REPOSITORY NAMES" for the expected format `, RunE: commandAction(opts.run), Example: `skopeo list-tags docker://docker.io/fedora`, } adjustUsage(cmd) flags := cmd.Flags() flags.AddFlagSet(&sharedFlags) flags.AddFlagSet(&imageFlags) flags.AddFlagSet(&retryFlags) return cmd } // Customized version of the alltransports.ParseImageName and docker.ParseReference that does not place a default tag in the reference // Would really love to not have this, but needed to enforce tag-less and digest-less names func parseDockerRepositoryReference(refString string) (types.ImageReference, error) { dockerRefString, ok := strings.CutPrefix(refString, docker.Transport.Name()+"://") if !ok { return nil, fmt.Errorf("docker: image reference %s does not start with %s://", refString, docker.Transport.Name()) } ref, err := reference.ParseNormalizedNamed(dockerRefString) if err != nil { return nil, err } if !reference.IsNameOnly(ref) { return nil, errors.New(`No tag or digest allowed in reference`) } // Checks ok, now return a reference. This is a hack because the tag listing code expects a full image reference even though the tag is ignored return docker.NewReference(reference.TagNameOnly(ref)) } // List the tags from a repository contained in the imgRef reference. Any tag value in the reference is ignored func listDockerTags(ctx context.Context, sys *types.SystemContext, imgRef types.ImageReference) (string, []string, error) { repositoryName := imgRef.DockerReference().Name() tags, err := docker.GetRepositoryTags(ctx, sys, imgRef) if err != nil { return ``, nil, fmt.Errorf("Error listing repository tags: %w", err) } return repositoryName, tags, nil } // return the tagLists from a docker repo func listDockerRepoTags(ctx context.Context, sys *types.SystemContext, opts *tagsOptions, userInput string) (repositoryName string, tagListing []string, err error) { // Do transport-specific parsing and validation to get an image reference imgRef, err := parseDockerRepositoryReference(userInput) if err != nil { return } if err = retry.IfNecessary(ctx, func() error { repositoryName, tagListing, err = listDockerTags(ctx, sys, imgRef) return err }, opts.retryOpts); err != nil { return } return } // return the tagLists from a docker archive file func listDockerArchiveTags(_ context.Context, sys *types.SystemContext, _ *tagsOptions, userInput string) (repositoryName string, tagListing []string, err error) { ref, err := alltransports.ParseImageName(userInput) if err != nil { return } tarReader, _, err := archive.NewReaderForReference(sys, ref) if err != nil { return } defer tarReader.Close() imageRefs, err := tarReader.List() if err != nil { return } var repoTags []string for imageIndex, items := range imageRefs { for _, ref := range items { repoTags, err = tarReader.ManifestTagsForReference(ref) if err != nil { return } // handle for each untagged image if len(repoTags) == 0 { repoTags = []string{fmt.Sprintf("@%d", imageIndex)} } tagListing = append(tagListing, repoTags...) } } return } func (opts *tagsOptions) run(args []string, stdout io.Writer) (retErr error) { ctx, cancel := opts.global.commandTimeoutContext() defer cancel() if len(args) != 1 { return errorShouldDisplayUsage{errors.New("Exactly one non-option argument expected")} } sys, err := opts.image.newSystemContext() if err != nil { return err } transport := alltransports.TransportFromImageName(args[0]) if transport == nil { return fmt.Errorf("Invalid %q: does not specify a transport", args[0]) } var repositoryName string var tagListing []string if val, ok := transportHandlers[transport.Name()]; ok { repositoryName, tagListing, err = val(ctx, sys, opts, args[0]) if err != nil { return err } } else { return fmt.Errorf("Unsupported transport '%s' for tag listing. Only supported: %s", transport.Name(), supportedTransports(", ")) } outputData := tagListOutput{ Repository: repositoryName, Tags: tagListing, } out, err := json.MarshalIndent(outputData, "", " ") if err != nil { return err } _, err = fmt.Fprintf(stdout, "%s\n", string(out)) return err } ================================================ FILE: cmd/skopeo/list_tags_test.go ================================================ package main import ( "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.podman.io/image/v5/transports/alltransports" ) // Tests the kinds of inputs allowed and expected to the command func TestDockerRepositoryReferenceParser(t *testing.T) { for _, test := range [][]string{ {"docker://myhost.com:1000/nginx"}, // no tag {"docker://myhost.com/nginx"}, // no port or tag {"docker://somehost.com"}, // Valid default expansion {"docker://nginx"}, // Valid default expansion } { ref, err := parseDockerRepositoryReference(test[0]) require.NoError(t, err) expected, err := alltransports.ParseImageName(test[0]) require.NoError(t, err) assert.Equal(t, expected.DockerReference().Name(), ref.DockerReference().Name(), "Mismatched parse result for input %v", test[0]) } for _, test := range [][]string{ {"oci://somedir"}, {"dir:/somepath"}, {"docker-archive:/tmp/dir"}, {"container-storage:myhost.com/someimage"}, {"docker-daemon:myhost.com/someimage"}, {"docker://myhost.com:1000/nginx:foobar:foobar"}, // Invalid repository ref {"docker://somehost.com:5000/"}, // no repo {"docker://myhost.com:1000/nginx:latest"}, // tag not allowed {"docker://myhost.com:1000/nginx@sha256:abcdef1234567890"}, // digest not allowed } { _, err := parseDockerRepositoryReference(test[0]) assert.Error(t, err, test[0]) } } func TestDockerRepositoryReferenceParserDrift(t *testing.T) { for _, test := range [][]string{ {"docker://myhost.com:1000/nginx", "myhost.com:1000/nginx"}, // no tag {"docker://myhost.com/nginx", "myhost.com/nginx"}, // no port or tag {"docker://somehost.com", "docker.io/library/somehost.com"}, // Valid default expansion {"docker://nginx", "docker.io/library/nginx"}, // Valid default expansion } { ref, err := parseDockerRepositoryReference(test[0]) ref2, err2 := alltransports.ParseImageName(test[0]) if assert.NoError(t, err, "Could not parse, got error on %v", test[0]) && assert.NoError(t, err2, "Could not parse with regular parser, got error on %v", test[0]) { assert.Equal(t, ref.DockerReference().String(), ref2.DockerReference().String(), "Different parsing output for input %v. Repo parse = %v, regular parser = %v", test[0], ref, ref2) } } } func TestListTags(t *testing.T) { // Invalid command-line arguments for _, args := range [][]string{ {}, {"a1", "a2"}, } { out, err := runSkopeo(append([]string{"list-tags"}, args...)...) assertTestFailed(t, out, err, "Exactly one non-option argument expected") } // FIXME: Much more test coverage // Actual feature tests exist in systemtest } ================================================ FILE: cmd/skopeo/login.go ================================================ package main import ( "io" "os" "github.com/spf13/cobra" "go.podman.io/common/pkg/auth" commonFlag "go.podman.io/common/pkg/flag" "go.podman.io/image/v5/types" ) type loginOptions struct { global *globalOptions loginOpts auth.LoginOptions tlsVerify commonFlag.OptionalBool } func loginCmd(global *globalOptions) *cobra.Command { opts := loginOptions{ global: global, } cmd := &cobra.Command{ Use: "login [command options] REGISTRY", Short: "Login to a container registry", Long: "Login to a container registry on a specified server.", RunE: commandAction(opts.run), Example: `skopeo login quay.io`, } adjustUsage(cmd) flags := cmd.Flags() flags.AddFlagSet(auth.GetLoginFlags(&opts.loginOpts)) commonFlag.OptionalBoolFlag(flags, &opts.tlsVerify, "tls-verify", "require HTTPS and verify certificates when accessing the registry") return cmd } func (opts *loginOptions) run(args []string, stdout io.Writer) error { ctx, cancel := opts.global.commandTimeoutContext() defer cancel() opts.loginOpts.Stdout = stdout opts.loginOpts.Stdin = os.Stdin opts.loginOpts.AcceptRepositories = true sys, err := opts.global.newSystemContext() if err != nil { return err } if opts.tlsVerify.Present() { sys.DockerInsecureSkipTLSVerify = types.NewOptionalBool(!opts.tlsVerify.Value()) } return auth.Login(ctx, sys, &opts.loginOpts, args) } ================================================ FILE: cmd/skopeo/login_test.go ================================================ package main import ( "path/filepath" "testing" ) func TestLogin(t *testing.T) { dir := t.TempDir() authFile := filepath.Join(dir, "auth.json") compatAuthFile := filepath.Join(dir, "config.json") // Just a trivial smoke-test exercising one error-handling path. // We can’t test full operation without a registry, unit tests should mostly // exist in c/common/pkg/auth, not here. out, err := runSkopeo("login", "--authfile", authFile, "--compat-auth-file", compatAuthFile, "example.com") assertTestFailed(t, out, err, "options for paths to the credential file and to the Docker-compatible credential file can not be set simultaneously") } ================================================ FILE: cmd/skopeo/logout.go ================================================ package main import ( "io" "github.com/spf13/cobra" "go.podman.io/common/pkg/auth" commonFlag "go.podman.io/common/pkg/flag" "go.podman.io/image/v5/types" ) type logoutOptions struct { global *globalOptions logoutOpts auth.LogoutOptions tlsVerify commonFlag.OptionalBool } func logoutCmd(global *globalOptions) *cobra.Command { opts := logoutOptions{ global: global, } cmd := &cobra.Command{ Use: "logout [command options] REGISTRY", Short: "Logout of a container registry", Long: "Logout of a container registry on a specified server.", RunE: commandAction(opts.run), Example: `skopeo logout quay.io`, } adjustUsage(cmd) flags := cmd.Flags() flags.AddFlagSet(auth.GetLogoutFlags(&opts.logoutOpts)) commonFlag.OptionalBoolFlag(flags, &opts.tlsVerify, "tls-verify", "require HTTPS and verify certificates when accessing the registry") return cmd } func (opts *logoutOptions) run(args []string, stdout io.Writer) error { opts.logoutOpts.Stdout = stdout opts.logoutOpts.AcceptRepositories = true sys, err := opts.global.newSystemContext() if err != nil { return err } if opts.tlsVerify.Present() { sys.DockerInsecureSkipTLSVerify = types.NewOptionalBool(!opts.tlsVerify.Value()) } return auth.Logout(sys, &opts.logoutOpts, args) } ================================================ FILE: cmd/skopeo/logout_test.go ================================================ package main import ( "os" "path/filepath" "testing" "github.com/stretchr/testify/require" ) func TestLogout(t *testing.T) { dir := t.TempDir() authFile := filepath.Join(dir, "auth.json") compatAuthFile := filepath.Join(dir, "config.json") // Just a trivial smoke-test exercising one error-handling path. // We can’t test full operation without a registry, unit tests should mostly // exist in c/common/pkg/auth, not here. err := os.WriteFile(authFile, []byte("{}"), 0o700) require.NoError(t, err) err = os.WriteFile(compatAuthFile, []byte("{}"), 0o700) require.NoError(t, err) out, err := runSkopeo("logout", "--authfile", authFile, "--compat-auth-file", compatAuthFile, "example.com") assertTestFailed(t, out, err, "options for paths to the credential file and to the Docker-compatible credential file can not be set simultaneously") } ================================================ FILE: cmd/skopeo/main.go ================================================ package main import ( "context" "fmt" "runtime/debug" "strings" "time" "github.com/containers/skopeo/version" "github.com/sirupsen/logrus" "github.com/spf13/cobra" commonFlag "go.podman.io/common/pkg/flag" "go.podman.io/image/v5/pkg/cli/basetls/tlsdetails" "go.podman.io/image/v5/signature" "go.podman.io/image/v5/types" "go.podman.io/storage/pkg/reexec" ) var defaultUserAgent = "skopeo/" + version.Version type globalOptions struct { debug bool // Enable debug output tlsVerify commonFlag.OptionalBool // Require HTTPS and verify certificates (for docker: and docker-daemon:) tlsDetailsPath string // Path to a containers-tls-details.yaml(5) file policyPath string // Path to a signature verification policy file insecurePolicy bool // Use an "allow everything" signature verification policy registriesDirPath string // Path to a "registries.d" registry configuration directory overrideArch string // Architecture to use for choosing images, instead of the runtime one overrideOS string // OS to use for choosing images, instead of the runtime one overrideVariant string // Architecture variant to use for choosing images, instead of the runtime one commandTimeout time.Duration // Timeout for the command execution registriesConfPath string // Path to the "registries.conf" file tmpDir string // Path to use for big temporary files userAgentPrefix string // Prefix to add to the user agent string requireSigned bool // Require any pulled image to be signed } // requireSubcommand returns an error if no sub command is provided // This was copied from podman: `github.com/containers/podman/cmd/podman/validate/args.go // Some small style changes to match skopeo were applied, but try to apply any // bugfixes there first. func requireSubcommand(cmd *cobra.Command, args []string) error { if len(args) > 0 { suggestions := cmd.SuggestionsFor(args[0]) if len(suggestions) == 0 { return fmt.Errorf("Unrecognized command `%[1]s %[2]s`\nTry '%[1]s --help' for more information", cmd.CommandPath(), args[0]) } return fmt.Errorf("Unrecognized command `%[1]s %[2]s`\n\nDid you mean this?\n\t%[3]s\n\nTry '%[1]s --help' for more information", cmd.CommandPath(), args[0], strings.Join(suggestions, "\n\t")) } return fmt.Errorf("Missing command '%[1]s COMMAND'\nTry '%[1]s --help' for more information", cmd.CommandPath()) } // createApp returns a cobra.Command, and the underlying globalOptions object, to be run or tested. func createApp() (*cobra.Command, *globalOptions) { opts := globalOptions{} rootCommand := &cobra.Command{ Use: "skopeo", Long: "Various operations with container images and container image registries", RunE: requireSubcommand, PersistentPreRunE: opts.before, SilenceUsage: true, SilenceErrors: true, // Hide the completion command which is provided by cobra CompletionOptions: cobra.CompletionOptions{HiddenDefaultCmd: true}, // This is documented to parse "local" (non-PersistentFlags) flags of parent commands before // running subcommands and handling their options. We don't really run into such cases, // because all of our flags on rootCommand are in PersistentFlags, except for the deprecated --tls-verify; // in that case we need TraverseChildren so that we can distinguish between // (skopeo --tls-verify inspect) (causes a warning) and (skopeo inspect --tls-verify) (no warning). TraverseChildren: true, } // We don’t use debug.ReadBuildInfo to automate version.Version, because that would not work well for builds from // a released tarball (e.g. RPM builds). if commit := gitCommit(); commit != "" { rootCommand.Version = fmt.Sprintf("%s commit: %s", version.Version, commit) } else { rootCommand.Version = version.Version } // Override default `--version` global flag to enable `-v` shorthand var dummyVersion bool rootCommand.Flags().BoolVarP(&dummyVersion, "version", "v", false, "Version for Skopeo") rootCommand.PersistentFlags().BoolVar(&opts.debug, "debug", false, "enable debug output") rootCommand.PersistentFlags().StringVar(&opts.tlsDetailsPath, "tls-details", "", "path to a containers-tls-details.yaml(5) file") rootCommand.PersistentFlags().StringVar(&opts.policyPath, "policy", "", "Path to a trust policy file") rootCommand.PersistentFlags().BoolVar(&opts.insecurePolicy, "insecure-policy", false, "run the tool without any policy check") rootCommand.PersistentFlags().BoolVar(&opts.requireSigned, "require-signed", false, "require any pulled image to be signed") rootCommand.PersistentFlags().StringVar(&opts.registriesDirPath, "registries.d", "", "use registry configuration files in `DIR` (e.g. for container signature storage)") rootCommand.PersistentFlags().StringVar(&opts.overrideArch, "override-arch", "", "use `ARCH` instead of the architecture of the machine for choosing images") rootCommand.PersistentFlags().StringVar(&opts.overrideOS, "override-os", "", "use `OS` instead of the running OS for choosing images") rootCommand.PersistentFlags().StringVar(&opts.overrideVariant, "override-variant", "", "use `VARIANT` instead of the running architecture variant for choosing images") rootCommand.PersistentFlags().DurationVar(&opts.commandTimeout, "command-timeout", 0, "timeout for the command execution") rootCommand.PersistentFlags().StringVar(&opts.registriesConfPath, "registries-conf", "", "path to the registries.conf file") if err := rootCommand.PersistentFlags().MarkHidden("registries-conf"); err != nil { logrus.Fatal("unable to mark registries-conf flag as hidden") } rootCommand.PersistentFlags().StringVar(&opts.tmpDir, "tmpdir", "", "directory used to store temporary files") rootCommand.PersistentFlags().StringVar(&opts.userAgentPrefix, "user-agent-prefix", "", "prefix to add to the user agent string") flag := commonFlag.OptionalBoolFlag(rootCommand.Flags(), &opts.tlsVerify, "tls-verify", "Require HTTPS and verify certificates when accessing the registry") flag.Hidden = true rootCommand.AddCommand( copyCmd(&opts), deleteCmd(&opts), generateSigstoreKeyCmd(), inspectCmd(&opts), layersCmd(&opts), loginCmd(&opts), logoutCmd(&opts), manifestDigestCmd(), proxyCmd(&opts), syncCmd(&opts), standaloneSignCmd(), standaloneVerifyCmd(), tagsCmd(&opts), untrustedSignatureDumpCmd(), ) return rootCommand, &opts } // gitCommit returns the git commit for this codebase, if we are built from a git repo; "" otherwise. func gitCommit() string { bi, ok := debug.ReadBuildInfo() if !ok { logrus.Fatal("runtime.ReadBuildInfo failed") } for _, e := range bi.Settings { if e.Key == "vcs.revision" { return e.Value } } return "" } // before is run by the cli package for any command, before running the command-specific handler. func (opts *globalOptions) before(cmd *cobra.Command, args []string) error { if opts.debug { logrus.SetLevel(logrus.DebugLevel) } if opts.tlsVerify.Present() { logrus.Warn("'--tls-verify' is deprecated, please set this on the specific subcommand") } if opts.insecurePolicy && opts.requireSigned { return fmt.Errorf("--insecure-policy and --require-signed are mutually exclusive") } return nil } func main() { if reexec.Init() { return } rootCmd, _ := createApp() if err := rootCmd.Execute(); err != nil { if isNotFoundImageError(err) { logrus.StandardLogger().Log(logrus.FatalLevel, err) logrus.Exit(2) } logrus.Fatal(err) } } // getPolicyContext returns a *signature.PolicyContext based on opts. func (opts *globalOptions) getPolicyContext() (*signature.PolicyContext, error) { var policy *signature.Policy // This could be cached across calls in opts. if opts.insecurePolicy { policy = &signature.Policy{Default: []signature.PolicyRequirement{signature.NewPRInsecureAcceptAnything()}} } else if opts.policyPath == "" { sys, err := opts.newSystemContext() if err != nil { return nil, err } p, err := signature.DefaultPolicy(sys) if err != nil { return nil, err } policy = p } else { p, err := signature.NewPolicyFromFile(opts.policyPath) if err != nil { return nil, err } policy = p } pc, err := signature.NewPolicyContext(policy) if err != nil { return nil, err } if opts.requireSigned { pc.RequireSignatureVerification(true) } return pc, nil } // commandTimeoutContext returns a context.Context and a cancellation callback based on opts. // The caller should usually "defer cancel()" immediately after calling this. func (opts *globalOptions) commandTimeoutContext() (context.Context, context.CancelFunc) { ctx := context.Background() var cancel context.CancelFunc = func() {} if opts.commandTimeout > 0 { ctx, cancel = context.WithTimeout(ctx, opts.commandTimeout) } return ctx, cancel } // newSystemContext returns a *types.SystemContext corresponding to opts. // It is guaranteed to return a fresh instance, so it is safe to make additional updates to it. func (opts *globalOptions) newSystemContext() (*types.SystemContext, error) { userAgent := defaultUserAgent if opts.userAgentPrefix != "" { userAgent = opts.userAgentPrefix + " " + defaultUserAgent } baseTLSConfig, err := tlsdetails.BaseTLSFromOptionalFile(opts.tlsDetailsPath) if err != nil { return nil, err } ctx := &types.SystemContext{ RegistriesDirPath: opts.registriesDirPath, ArchitectureChoice: opts.overrideArch, OSChoice: opts.overrideOS, VariantChoice: opts.overrideVariant, SystemRegistriesConfPath: opts.registriesConfPath, BigFilesTemporaryDir: opts.tmpDir, BaseTLSConfig: baseTLSConfig.TLSConfig(), DockerRegistryUserAgent: userAgent, } // DEPRECATED: We support this for backward compatibility, but override it if a per-image flag is provided. if opts.tlsVerify.Present() { ctx.DockerInsecureSkipTLSVerify = types.NewOptionalBool(!opts.tlsVerify.Value()) } return ctx, nil } ================================================ FILE: cmd/skopeo/main_test.go ================================================ package main import ( "bytes" "crypto/tls" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.podman.io/image/v5/types" ) // runSkopeo creates an app object and runs it with args, with an implied first "skopeo". // Returns output intended for stdout and the returned error, if any. func runSkopeo(args ...string) (string, error) { app, _ := createApp() stdout := bytes.Buffer{} app.SetOut(&stdout) app.SetArgs(args) err := app.Execute() return stdout.String(), err } func TestGlobalOptionsNewSystemContext(t *testing.T) { // Default state opts, _ := fakeGlobalOptions(t, []string{}) res, err := opts.newSystemContext() require.NoError(t, err) assert.Equal(t, &types.SystemContext{ // User-Agent is set by default. DockerRegistryUserAgent: defaultUserAgent, }, res) // Set everything to non-default values. opts, _ = fakeGlobalOptions(t, []string{ "--registries.d", "/srv/registries.d", "--override-arch", "overridden-arch", "--override-os", "overridden-os", "--override-variant", "overridden-variant", "--tls-details", "../../integration/fixtures/tls-details-pqc-only.yaml", "--tmpdir", "/srv", "--registries-conf", "/srv/registries.conf", "--tls-verify=false", }) res, err = opts.newSystemContext() require.NoError(t, err) assert.Equal(t, &types.SystemContext{ RegistriesDirPath: "/srv/registries.d", ArchitectureChoice: "overridden-arch", OSChoice: "overridden-os", VariantChoice: "overridden-variant", BaseTLSConfig: &tls.Config{ MinVersion: tls.VersionTLS13, CurvePreferences: []tls.CurveID{tls.X25519MLKEM768}, }, BigFilesTemporaryDir: "/srv", SystemRegistriesConfPath: "/srv/registries.conf", DockerInsecureSkipTLSVerify: types.OptionalBoolTrue, DockerRegistryUserAgent: defaultUserAgent, }, res) } ================================================ FILE: cmd/skopeo/manifest.go ================================================ package main import ( "errors" "fmt" "io" "os" "github.com/spf13/cobra" "go.podman.io/image/v5/manifest" ) type manifestDigestOptions struct{} func manifestDigestCmd() *cobra.Command { var opts manifestDigestOptions cmd := &cobra.Command{ Use: "manifest-digest MANIFEST-FILE", Short: "Compute a manifest digest of a file", RunE: commandAction(opts.run), Example: "skopeo manifest-digest manifest.json", } adjustUsage(cmd) return cmd } func (opts *manifestDigestOptions) run(args []string, stdout io.Writer) error { if len(args) != 1 { return errors.New("Usage: skopeo manifest-digest manifest") } manifestPath := args[0] man, err := os.ReadFile(manifestPath) if err != nil { return fmt.Errorf("Error reading manifest from %s: %v", manifestPath, err) } digest, err := manifest.Digest(man) if err != nil { return fmt.Errorf("Error computing digest: %v", err) } fmt.Fprintf(stdout, "%s\n", digest) return nil } ================================================ FILE: cmd/skopeo/manifest_test.go ================================================ package main import ( "testing" "github.com/stretchr/testify/assert" ) func TestManifestDigest(t *testing.T) { // Invalid command-line arguments for _, args := range [][]string{ {}, {"a1", "a2"}, } { out, err := runSkopeo(append([]string{"manifest-digest"}, args...)...) assertTestFailed(t, out, err, "Usage") } // Error reading manifest out, err := runSkopeo("manifest-digest", "/this/does/not/exist") assertTestFailed(t, out, err, "/this/does/not/exist") // Error computing manifest out, err = runSkopeo("manifest-digest", "fixtures/v2s1-invalid-signatures.manifest.json") assertTestFailed(t, out, err, "computing digest") // Success out, err = runSkopeo("manifest-digest", "fixtures/image.manifest.json") assert.NoError(t, err) assert.Equal(t, fixturesTestImageManifestDigest.String()+"\n", out) } ================================================ FILE: cmd/skopeo/proxy.go ================================================ //go:build !windows package main /* This command is still experimental. Documentation is available in docs-experimental/skopeo-experimental-image-proxy.1.md */ import ( "context" "io" "github.com/spf13/cobra" "go.podman.io/common/pkg/json-proxy" ) type proxyOptions struct { global *globalOptions imageOpts *imageOptions sockFd int } func proxyCmd(global *globalOptions) *cobra.Command { sharedFlags, sharedOpts := sharedImageFlags() imageFlags, imageOpts := imageFlags(global, sharedOpts, nil, "", "") opts := proxyOptions{global: global, imageOpts: imageOpts} cmd := &cobra.Command{ Use: "experimental-image-proxy [command options] IMAGE", Short: "Interactive proxy for fetching container images (EXPERIMENTAL)", Long: `Run skopeo as a proxy, supporting HTTP requests to fetch manifests and blobs.`, RunE: commandAction(opts.run), Args: cobra.ExactArgs(0), // Not stabilized yet Hidden: true, Example: `skopeo experimental-image-proxy --sockfd 3`, } adjustUsage(cmd) flags := cmd.Flags() flags.AddFlagSet(&sharedFlags) flags.AddFlagSet(&imageFlags) flags.IntVar(&opts.sockFd, "sockfd", 0, "Serve on opened socket pair (default 0/stdin)") return cmd } // Implementation of podman experimental-image-proxy using the library func (opts *proxyOptions) run(args []string, stdout io.Writer) error { manager, err := jsonproxy.NewManager( jsonproxy.WithSystemContext(opts.imageOpts.newSystemContext), jsonproxy.WithPolicyContext(opts.global.getPolicyContext), ) if err != nil { return err } defer manager.Close() return manager.Serve(context.Background(), opts.sockFd) } ================================================ FILE: cmd/skopeo/proxy_windows.go ================================================ //go:build windows package main import ( "fmt" "io" "github.com/spf13/cobra" ) type proxyOptions struct { global *globalOptions } func proxyCmd(global *globalOptions) *cobra.Command { opts := proxyOptions{global: global} cmd := &cobra.Command{ RunE: commandAction(opts.run), Args: cobra.ExactArgs(0), // Not stabilized yet Hidden: true, } return cmd } func (opts *proxyOptions) run(args []string, stdout io.Writer) error { return fmt.Errorf("This command is not supported on Windows") } ================================================ FILE: cmd/skopeo/signing.go ================================================ package main import ( "encoding/json" "errors" "fmt" "io" "os" "strings" "github.com/spf13/cobra" "go.podman.io/image/v5/pkg/cli" "go.podman.io/image/v5/signature" ) type standaloneSignOptions struct { output string // Output file path passphraseFile string // Path pointing to a passphrase file when signing } func standaloneSignCmd() *cobra.Command { opts := standaloneSignOptions{} cmd := &cobra.Command{ Use: "standalone-sign [command options] MANIFEST DOCKER-REFERENCE KEY-FINGERPRINT --output|-o SIGNATURE", Short: "Create a signature using local files", RunE: commandAction(opts.run), } adjustUsage(cmd) flags := cmd.Flags() flags.StringVarP(&opts.output, "output", "o", "", "output the signature to `SIGNATURE`") flags.StringVarP(&opts.passphraseFile, "passphrase-file", "", "", "file that contains a passphrase for the --sign-by key") return cmd } func (opts *standaloneSignOptions) run(args []string, stdout io.Writer) error { if len(args) != 3 || opts.output == "" { return errors.New("Usage: skopeo standalone-sign manifest docker-reference key-fingerprint -o signature") } manifestPath := args[0] dockerReference := args[1] fingerprint := args[2] manifest, err := os.ReadFile(manifestPath) if err != nil { return fmt.Errorf("Error reading %s: %w", manifestPath, err) } mech, err := signature.NewGPGSigningMechanism() if err != nil { return fmt.Errorf("Error initializing GPG: %w", err) } defer mech.Close() passphrase, err := cli.ReadPassphraseFile(opts.passphraseFile) if err != nil { return err } signature, err := signature.SignDockerManifestWithOptions(manifest, dockerReference, mech, fingerprint, &signature.SignOptions{Passphrase: passphrase}) if err != nil { return fmt.Errorf("Error creating signature: %w", err) } if err := os.WriteFile(opts.output, signature, 0o644); err != nil { return fmt.Errorf("Error writing signature to %s: %w", opts.output, err) } return nil } type standaloneVerifyOptions struct { publicKeyFile string } func standaloneVerifyCmd() *cobra.Command { opts := standaloneVerifyOptions{} cmd := &cobra.Command{ Use: "standalone-verify MANIFEST DOCKER-REFERENCE KEY-FINGERPRINTS SIGNATURE", Short: "Verify a signature using local files", Long: `Verify a signature using local files KEY-FINGERPRINTS can be a comma separated list of fingerprints, or "any" if you trust all the keys in the public key file.`, RunE: commandAction(opts.run), } flags := cmd.Flags() flags.StringVar(&opts.publicKeyFile, "public-key-file", "", `File containing public keys. If not specified, will use local GPG keys.`) adjustUsage(cmd) return cmd } func (opts *standaloneVerifyOptions) run(args []string, stdout io.Writer) error { if len(args) != 4 { return errors.New("Usage: skopeo standalone-verify manifest docker-reference key-fingerprint signature") } manifestPath := args[0] expectedDockerReference := args[1] expectedFingerprints := strings.Split(args[2], ",") signaturePath := args[3] if opts.publicKeyFile == "" && len(expectedFingerprints) == 1 && expectedFingerprints[0] == "any" { return fmt.Errorf("Cannot use any fingerprint without a public key file") } unverifiedManifest, err := os.ReadFile(manifestPath) if err != nil { return fmt.Errorf("Error reading manifest from %s: %w", manifestPath, err) } unverifiedSignature, err := os.ReadFile(signaturePath) if err != nil { return fmt.Errorf("Error reading signature from %s: %w", signaturePath, err) } var mech signature.SigningMechanism var publicKeyfingerprints []string if opts.publicKeyFile != "" { publicKeys, err := os.ReadFile(opts.publicKeyFile) if err != nil { return fmt.Errorf("Error reading public keys from %s: %w", opts.publicKeyFile, err) } mech, publicKeyfingerprints, err = signature.NewEphemeralGPGSigningMechanism(publicKeys) if err != nil { return fmt.Errorf("Error initializing GPG: %w", err) } } else { mech, err = signature.NewGPGSigningMechanism() if err != nil { return fmt.Errorf("Error initializing GPG: %w", err) } } defer mech.Close() if len(expectedFingerprints) == 1 && expectedFingerprints[0] == "any" { expectedFingerprints = publicKeyfingerprints } sig, verificationFingerprint, err := signature.VerifyImageManifestSignatureUsingKeyIdentityList(unverifiedSignature, unverifiedManifest, expectedDockerReference, mech, expectedFingerprints) if err != nil { return fmt.Errorf("Error verifying signature: %w", err) } fmt.Fprintf(stdout, "Signature verified using fingerprint %s, digest %s\n", verificationFingerprint, sig.DockerManifestDigest) return nil } // WARNING: Do not use the contents of this for ANY security decisions, // and be VERY CAREFUL about showing this information to humans in any way which suggest that these values “are probably” reliable. // There is NO REASON to expect the values to be correct, or not intentionally misleading // (including things like “✅ Verified by $authority”) // // The subcommand is undocumented, and it may be renamed or entirely disappear in the future. type untrustedSignatureDumpOptions struct{} func untrustedSignatureDumpCmd() *cobra.Command { opts := untrustedSignatureDumpOptions{} cmd := &cobra.Command{ Use: "untrusted-signature-dump-without-verification SIGNATURE", Short: "Dump contents of a signature WITHOUT VERIFYING IT", RunE: commandAction(opts.run), Hidden: true, } adjustUsage(cmd) return cmd } func (opts *untrustedSignatureDumpOptions) run(args []string, stdout io.Writer) error { if len(args) != 1 { return errors.New("Usage: skopeo untrusted-signature-dump-without-verification signature") } untrustedSignaturePath := args[0] untrustedSignature, err := os.ReadFile(untrustedSignaturePath) if err != nil { return fmt.Errorf("Error reading untrusted signature from %s: %w", untrustedSignaturePath, err) } untrustedInfo, err := signature.GetUntrustedSignatureInformationWithoutVerifying(untrustedSignature) if err != nil { return fmt.Errorf("Error decoding untrusted signature: %v", err) } untrustedOut, err := json.MarshalIndent(untrustedInfo, "", " ") if err != nil { return err } fmt.Fprintln(stdout, string(untrustedOut)) return nil } ================================================ FILE: cmd/skopeo/signing_test.go ================================================ package main import ( "encoding/json" "os" "path/filepath" "testing" "time" "github.com/opencontainers/go-digest" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.podman.io/image/v5/signature" ) const ( // fixturesTestImageManifestDigest is the Docker manifest digest of "image.manifest.json" fixturesTestImageManifestDigest = digest.Digest("sha256:20bf21ed457b390829cdbeec8795a7bea1626991fda603e0d01b4e7f60427e55") // fixturesTestKeyFingerprint is the fingerprint of the private key. fixturesTestKeyFingerprint = "08CD26E446E2E95249B7A405E932F44B23E8DD43" // fixturesTestKeyFingerprint is the key ID of the private key. fixturesTestKeyShortID = "E932F44B23E8DD43" ) // Test that results of runSkopeo failed with nothing on stdout, and substring // within the error message. func assertTestFailed(t *testing.T, stdout string, err error, substring string) { assert.ErrorContains(t, err, substring) assert.Empty(t, stdout) } func TestStandaloneSign(t *testing.T) { t.Setenv("GNUPGHOME", "fixtures") mech, err := signature.NewGPGSigningMechanism() require.NoError(t, err) defer mech.Close() if err := mech.SupportsSigning(); err != nil { t.Skipf("Signing not supported: %v", err) } manifestPath := "fixtures/image.manifest.json" dockerReference := "testing/manifest" // Invalid command-line arguments for _, args := range [][]string{ {}, {"a1", "a2"}, {"a1", "a2", "a3"}, {"a1", "a2", "a3", "a4"}, {"-o", "o", "a1", "a2"}, {"-o", "o", "a1", "a2", "a3", "a4"}, } { out, err := runSkopeo(append([]string{"standalone-sign"}, args...)...) assertTestFailed(t, out, err, "Usage") } // Error reading manifest out, err := runSkopeo("standalone-sign", "-o", "/dev/null", "/this/does/not/exist", dockerReference, fixturesTestKeyFingerprint) assertTestFailed(t, out, err, "/this/does/not/exist") // Invalid Docker reference out, err = runSkopeo("standalone-sign", "-o", "/dev/null", manifestPath, "" /* empty reference */, fixturesTestKeyFingerprint) assertTestFailed(t, out, err, "empty signature content") // Unknown key. out, err = runSkopeo("standalone-sign", "-o", "/dev/null", manifestPath, dockerReference, "UNKNOWN GPG FINGERPRINT") assert.Error(t, err) assert.Empty(t, out) // Error writing output out, err = runSkopeo("standalone-sign", "-o", "/dev/full", manifestPath, dockerReference, fixturesTestKeyFingerprint) assertTestFailed(t, out, err, "/dev/full") // Success sigOutput := filepath.Join(t.TempDir(), "sig") out, err = runSkopeo("standalone-sign", "-o", sigOutput, manifestPath, dockerReference, fixturesTestKeyFingerprint) require.NoError(t, err) assert.Empty(t, out) sig, err := os.ReadFile(sigOutput) require.NoError(t, err) manifest, err := os.ReadFile(manifestPath) require.NoError(t, err) verified, err := signature.VerifyDockerManifestSignature(sig, manifest, dockerReference, mech, fixturesTestKeyFingerprint) require.NoError(t, err) assert.Equal(t, dockerReference, verified.DockerReference) assert.Equal(t, fixturesTestImageManifestDigest, verified.DockerManifestDigest) } func TestStandaloneVerify(t *testing.T) { manifestPath := "fixtures/image.manifest.json" signaturePath := "fixtures/image.signature" dockerReference := "testing/manifest" t.Setenv("GNUPGHOME", "fixtures") // Invalid command-line arguments for _, args := range [][]string{ {}, {"a1", "a2", "a3"}, {"a1", "a2", "a3", "a4", "a5"}, } { out, err := runSkopeo(append([]string{"standalone-verify"}, args...)...) assertTestFailed(t, out, err, "Usage") } // Error reading manifest out, err := runSkopeo("standalone-verify", "/this/does/not/exist", dockerReference, fixturesTestKeyFingerprint, signaturePath) assertTestFailed(t, out, err, "/this/does/not/exist") // Error reading signature out, err = runSkopeo("standalone-verify", manifestPath, dockerReference, fixturesTestKeyFingerprint, "/this/does/not/exist") assertTestFailed(t, out, err, "/this/does/not/exist") // Error verifying signature out, err = runSkopeo("standalone-verify", manifestPath, dockerReference, fixturesTestKeyFingerprint, "fixtures/corrupt.signature") assertTestFailed(t, out, err, "Error verifying signature") // Error using any without a public key file out, err = runSkopeo("standalone-verify", manifestPath, dockerReference, "any", signaturePath) assertTestFailed(t, out, err, "Cannot use any fingerprint without a public key file") // Success out, err = runSkopeo("standalone-verify", manifestPath, dockerReference, fixturesTestKeyFingerprint, signaturePath) assert.NoError(t, err) assert.Equal(t, "Signature verified using fingerprint "+fixturesTestKeyFingerprint+", digest "+fixturesTestImageManifestDigest.String()+"\n", out) // Using multiple fingerprints out, err = runSkopeo("standalone-verify", manifestPath, dockerReference, "0123456789ABCDEF0123456789ABCDEF01234567,"+fixturesTestKeyFingerprint+",DEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEF", signaturePath) assert.NoError(t, err) assert.Equal(t, "Signature verified using fingerprint "+fixturesTestKeyFingerprint+", digest "+fixturesTestImageManifestDigest.String()+"\n", out) // Using a public key file t.Setenv("GNUPGHOME", "") out, err = runSkopeo("standalone-verify", "--public-key-file", "fixtures/pubring.gpg", manifestPath, dockerReference, fixturesTestKeyFingerprint, signaturePath) assert.NoError(t, err) assert.Equal(t, "Signature verified using fingerprint "+fixturesTestKeyFingerprint+", digest "+fixturesTestImageManifestDigest.String()+"\n", out) // Using a public key file matching any public key t.Setenv("GNUPGHOME", "") out, err = runSkopeo("standalone-verify", "--public-key-file", "fixtures/pubring.gpg", manifestPath, dockerReference, "any", signaturePath) assert.NoError(t, err) assert.Equal(t, "Signature verified using fingerprint "+fixturesTestKeyFingerprint+", digest "+fixturesTestImageManifestDigest.String()+"\n", out) } func TestUntrustedSignatureDump(t *testing.T) { // Invalid command-line arguments for _, args := range [][]string{ {}, {"a1", "a2"}, {"a1", "a2", "a3", "a4"}, } { out, err := runSkopeo(append([]string{"untrusted-signature-dump-without-verification"}, args...)...) assertTestFailed(t, out, err, "Usage") } // Error reading manifest out, err := runSkopeo("untrusted-signature-dump-without-verification", "/this/does/not/exist") assertTestFailed(t, out, err, "/this/does/not/exist") // Error reading signature (input is not a signature) out, err = runSkopeo("untrusted-signature-dump-without-verification", "fixtures/image.manifest.json") assertTestFailed(t, out, err, "Error decoding untrusted signature") // Success for _, path := range []string{"fixtures/image.signature", "fixtures/corrupt.signature"} { // Success out, err = runSkopeo("untrusted-signature-dump-without-verification", path) require.NoError(t, err) var info signature.UntrustedSignatureInformation err := json.Unmarshal([]byte(out), &info) require.NoError(t, err) assert.Equal(t, fixturesTestImageManifestDigest, info.UntrustedDockerManifestDigest) assert.Equal(t, "testing/manifest", info.UntrustedDockerReference) assert.NotNil(t, info.UntrustedCreatorID) assert.Equal(t, "atomic ", *info.UntrustedCreatorID) assert.NotNil(t, info.UntrustedTimestamp) assert.True(t, time.Unix(1458239713, 0).Equal(*info.UntrustedTimestamp)) assert.Equal(t, fixturesTestKeyShortID, info.UntrustedShortKeyIdentifier) } } ================================================ FILE: cmd/skopeo/sync.go ================================================ package main import ( "context" "errors" "fmt" "io" "io/fs" "os" "path" "path/filepath" "regexp" "slices" "strings" "github.com/Masterminds/semver/v3" "github.com/opencontainers/go-digest" "github.com/sirupsen/logrus" "github.com/spf13/cobra" "go.podman.io/common/pkg/retry" "go.podman.io/image/v5/copy" "go.podman.io/image/v5/directory" "go.podman.io/image/v5/docker" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/manifest" "go.podman.io/image/v5/transports" "go.podman.io/image/v5/types" "gopkg.in/yaml.v3" ) // syncOptions contains information retrieved from the skopeo sync command line. type syncOptions struct { global *globalOptions // Global (not command dependent) skopeo options deprecatedTLSVerify *deprecatedTLSVerifyOption srcImage *imageOptions // Source image options destImage *imageDestOptions // Destination image options retryOpts *retry.Options copy *sharedCopyOptions source string // Source repository name destination string // Destination registry name digestFile string // Write digest to this file scoped bool // When true, namespace copied images at destination using the source repository name all bool // Copy all of the images if an image in the source is a list dryRun bool // Don't actually copy anything, just output what it would have done keepGoing bool // Whether or not to abort the sync if there are any errors during syncing the images appendSuffix string // Suffix to append to destination image tag } // repoDescriptor contains information of a single repository used as a sync source. type repoDescriptor struct { DirBasePath string // base path when source is 'dir' ImageRefs []types.ImageReference // List of tagged image found for the repository Context *types.SystemContext // SystemContext for the sync command } // tlsVerifyConfig is an implementation of the Unmarshaler interface, used to // customize the unmarshaling behaviour of the tls-verify YAML key. type tlsVerifyConfig struct { skip types.OptionalBool // skip TLS verification check (false by default) } // registrySyncConfig contains information about a single registry, read from // the source YAML file type registrySyncConfig struct { Images map[string][]string // Images map images name to slices with the images' references (tags, digests) ImagesByTagRegex map[string]string `yaml:"images-by-tag-regex"` // Images map images name to regular expression with the images' tags ImagesBySemver map[string]string `yaml:"images-by-semver"` // ImagesBySemver maps a repository to a semver constraint (e.g. '>=3.14') to match images' tags to Credentials types.DockerAuthConfig // Username and password used to authenticate with the registry TLSVerify tlsVerifyConfig `yaml:"tls-verify"` // TLS verification mode (enabled by default) CertDir string `yaml:"cert-dir"` // Path to the TLS certificates of the registry } // sourceConfig contains all registries information read from the source YAML file type sourceConfig map[string]registrySyncConfig func syncCmd(global *globalOptions) *cobra.Command { sharedFlags, sharedOpts := sharedImageFlags() deprecatedTLSVerifyFlags, deprecatedTLSVerifyOpt := deprecatedTLSVerifyFlags() srcFlags, srcOpts := dockerImageFlags(global, sharedOpts, deprecatedTLSVerifyOpt, "src-", "screds") destFlags, destOpts := dockerImageFlags(global, sharedOpts, deprecatedTLSVerifyOpt, "dest-", "dcreds") retryFlags, retryOpts := retryFlags() copyFlags, copyOpts := sharedCopyFlags() opts := syncOptions{ global: global, deprecatedTLSVerify: deprecatedTLSVerifyOpt, srcImage: srcOpts, destImage: &imageDestOptions{imageOptions: destOpts}, retryOpts: retryOpts, copy: copyOpts, } cmd := &cobra.Command{ Use: "sync [command options] --src TRANSPORT --dest TRANSPORT SOURCE DESTINATION", Short: "Synchronize one or more images from one location to another", Long: `Copy all the images from a SOURCE to a DESTINATION. Allowed SOURCE transports (specified with --src): docker, dir, yaml. Allowed DESTINATION transports (specified with --dest): docker, dir. See skopeo-sync(1) for details. `, RunE: commandAction(opts.run), Example: `skopeo sync --src docker --dest dir --scoped registry.example.com/busybox /media/usb`, } adjustUsage(cmd) flags := cmd.Flags() flags.AddFlagSet(&sharedFlags) flags.AddFlagSet(&deprecatedTLSVerifyFlags) flags.AddFlagSet(&srcFlags) flags.AddFlagSet(&destFlags) flags.AddFlagSet(&retryFlags) flags.AddFlagSet(©Flags) flags.StringVarP(&opts.source, "src", "s", "", "SOURCE transport type") flags.StringVarP(&opts.destination, "dest", "d", "", "DESTINATION transport type") flags.BoolVar(&opts.scoped, "scoped", false, "Images at DESTINATION are prefix using the full source image path as scope") flags.StringVar(&opts.appendSuffix, "append-suffix", "", "String to append to DESTINATION tags") flags.StringVar(&opts.digestFile, "digestfile", "", "Write the digests and Image References of the resulting images to the specified file, separated by newlines") flags.BoolVarP(&opts.all, "all", "a", false, "Copy all images if SOURCE-IMAGE is a list") flags.BoolVar(&opts.dryRun, "dry-run", false, "Run without actually copying data") flags.BoolVarP(&opts.keepGoing, "keep-going", "", false, "Do not abort the sync if any image copy fails") return cmd } // UnmarshalYAML is the implementation of the Unmarshaler interface method // for the tlsVerifyConfig type. // It unmarshals the 'tls-verify' YAML key so that, when they key is not // specified, tls verification is enforced. func (tls *tlsVerifyConfig) UnmarshalYAML(value *yaml.Node) error { var verify bool if err := value.Decode(&verify); err != nil { return err } tls.skip = types.NewOptionalBool(!verify) return nil } // newSourceConfig unmarshals the provided YAML file path to the sourceConfig type. // It returns a new unmarshaled sourceConfig object and any error encountered. func newSourceConfig(yamlFile string) (sourceConfig, error) { var cfg sourceConfig source, err := os.ReadFile(yamlFile) if err != nil { return cfg, err } err = yaml.Unmarshal(source, &cfg) if err != nil { return cfg, fmt.Errorf("Failed to unmarshal %q: %w", yamlFile, err) } return cfg, nil } // parseRepositoryReference parses input into a reference.Named, and verifies that it names a repository, not an image. func parseRepositoryReference(input string) (reference.Named, error) { ref, err := reference.ParseNormalizedNamed(input) if err != nil { return nil, err } if !reference.IsNameOnly(ref) { return nil, errors.New("input names a reference, not a repository") } return ref, nil } // destinationReference creates an image reference using the provided transport. // It returns a image reference to be used as destination of an image copy and // any error encountered. func destinationReference(destination string, transport string) (types.ImageReference, error) { var imageTransport types.ImageTransport switch transport { case docker.Transport.Name(): destination = fmt.Sprintf("//%s", destination) imageTransport = docker.Transport case directory.Transport.Name(): _, err := os.Stat(destination) if err == nil { return nil, fmt.Errorf("Refusing to overwrite destination directory %q", destination) } if !os.IsNotExist(err) { return nil, fmt.Errorf("Destination directory could not be used: %w", err) } // the directory holding the image must be created here if err = os.MkdirAll(destination, 0o755); err != nil { return nil, fmt.Errorf("Error creating directory for image %s: %w", destination, err) } imageTransport = directory.Transport default: return nil, fmt.Errorf("%q is not a valid destination transport", transport) } logrus.Debugf("Destination for transport %q: %s", transport, destination) destRef, err := imageTransport.ParseReference(destination) if err != nil { return nil, fmt.Errorf("Cannot obtain a valid image reference for transport %q and reference %q: %w", imageTransport.Name(), destination, err) } return destRef, nil } // getImageTags lists all tags in a repository. // It returns a string slice of tags and any error encountered. func getImageTags(ctx context.Context, sysCtx *types.SystemContext, repoRef reference.Named) ([]string, error) { name := repoRef.Name() logrus.WithFields(logrus.Fields{ "image": name, }).Info("Getting tags") // Ugly: NewReference rejects IsNameOnly references, and GetRepositoryTags ignores the tag/digest. // So, we use TagNameOnly here only to shut up NewReference dockerRef, err := docker.NewReference(reference.TagNameOnly(repoRef)) if err != nil { return nil, err // Should never happen for a reference with tag and no digest } tags, err := docker.GetRepositoryTags(ctx, sysCtx, dockerRef) if err != nil { return nil, fmt.Errorf("Error determining repository tags for repo %s: %w", name, err) } return tags, nil } // imagesToCopyFromRepo builds a list of image references from the tags // found in a source repository. // It returns an image reference slice with as many elements as the tags found // and any error encountered. func imagesToCopyFromRepo(sys *types.SystemContext, repoRef reference.Named) ([]types.ImageReference, error) { tags, err := getImageTags(context.Background(), sys, repoRef) if err != nil { return nil, err } var sourceReferences []types.ImageReference for _, tag := range tags { taggedRef, err := reference.WithTag(repoRef, tag) if err != nil { logrus.WithFields(logrus.Fields{ "repo": repoRef.Name(), "tag": tag, }).Errorf("Error creating a tagged reference from registry tag list: %v", err) continue } ref, err := docker.NewReference(taggedRef) if err != nil { return nil, fmt.Errorf("Cannot obtain a valid image reference for transport %q and reference %s: %w", docker.Transport.Name(), taggedRef.String(), err) } sourceReferences = append(sourceReferences, ref) } return sourceReferences, nil } // imagesToCopyFromDir builds a list of image references from the images found // in the source directory. // It returns an image reference slice with as many elements as the images found // and any error encountered. func imagesToCopyFromDir(dirPath string) ([]types.ImageReference, error) { var sourceReferences []types.ImageReference err := filepath.WalkDir(dirPath, func(path string, d fs.DirEntry, err error) error { if err != nil { return err } if !d.IsDir() && d.Name() == "manifest.json" { dirname := filepath.Dir(path) ref, err := directory.Transport.ParseReference(dirname) if err != nil { return fmt.Errorf("Cannot obtain a valid image reference for transport %q and reference %q: %w", directory.Transport.Name(), dirname, err) } sourceReferences = append(sourceReferences, ref) return filepath.SkipDir } return nil }) if err != nil { return sourceReferences, fmt.Errorf("Error walking the path %q: %w", dirPath, err) } return sourceReferences, nil } // imagesToCopyFromRegistry builds a list of repository descriptors from the images // in a registry configuration. // It returns a repository descriptors slice with as many elements as the images // found and any error encountered. Each element of the slice is a list of // image references, to be used as sync source. func imagesToCopyFromRegistry(registryName string, cfg registrySyncConfig, sourceCtx types.SystemContext) ([]repoDescriptor, error) { serverCtx := &sourceCtx // override ctx with per-registryName options serverCtx.DockerCertPath = cfg.CertDir serverCtx.DockerDaemonCertPath = cfg.CertDir // Only override TLS verification if explicitly specified in YAML; otherwise, keep CLI/global settings. if cfg.TLSVerify.skip != types.OptionalBoolUndefined { serverCtx.DockerDaemonInsecureSkipTLSVerify = (cfg.TLSVerify.skip == types.OptionalBoolTrue) serverCtx.DockerInsecureSkipTLSVerify = cfg.TLSVerify.skip } if cfg.Credentials != (types.DockerAuthConfig{}) { serverCtx.DockerAuthConfig = &cfg.Credentials } var repoDescList []repoDescriptor if len(cfg.Images) == 0 && len(cfg.ImagesByTagRegex) == 0 && len(cfg.ImagesBySemver) == 0 { logrus.WithFields(logrus.Fields{ "registry": registryName, }).Warn("No images specified for registry") return repoDescList, nil } for imageName, refs := range cfg.Images { repoLogger := logrus.WithFields(logrus.Fields{ "repo": imageName, "registry": registryName, }) repoRef, err := parseRepositoryReference(fmt.Sprintf("%s/%s", registryName, imageName)) if err != nil { repoLogger.Error("Error parsing repository name, skipping") logrus.Error(err) continue } repoLogger.Info("Processing repo") var sourceReferences []types.ImageReference if len(refs) != 0 { for _, ref := range refs { tagLogger := logrus.WithFields(logrus.Fields{"ref": ref}) var named reference.Named // first try as digest if d, err := digest.Parse(ref); err == nil { named, err = reference.WithDigest(repoRef, d) if err != nil { tagLogger.Error("Error processing ref, skipping") logrus.Error(err) continue } } else { tagLogger.Debugf("Ref was not a digest, trying as a tag: %s", err) named, err = reference.WithTag(repoRef, ref) if err != nil { tagLogger.Error("Error parsing ref, skipping") logrus.Error(err) continue } } imageRef, err := docker.NewReference(named) if err != nil { tagLogger.Error("Error processing ref, skipping") logrus.Errorf("Error getting image reference: %s", err) continue } sourceReferences = append(sourceReferences, imageRef) } } else { // len(refs) == 0 repoLogger.Info("Querying registry for image tags") sourceReferences, err = imagesToCopyFromRepo(serverCtx, repoRef) if err != nil { repoLogger.Error("Error processing repo, skipping") logrus.Error(err) continue } } if len(sourceReferences) == 0 { repoLogger.Warnf("No refs to sync found") continue } repoDescList = append(repoDescList, repoDescriptor{ ImageRefs: sourceReferences, Context: serverCtx, }) } // include repository descriptors for cfg.ImagesByTagRegex { filterCollection, err := tagRegexFilterCollection(cfg.ImagesByTagRegex) if err != nil { logrus.Error(err) } else { additionalRepoDescList := filterSourceReferences(serverCtx, registryName, filterCollection) repoDescList = append(repoDescList, additionalRepoDescList...) } } // include repository descriptors for cfg.ImagesBySemver { filterCollection, err := semverFilterCollection(cfg.ImagesBySemver) if err != nil { logrus.Error(err) } else { additionalRepoDescList := filterSourceReferences(serverCtx, registryName, filterCollection) repoDescList = append(repoDescList, additionalRepoDescList...) } } return repoDescList, nil } // filterFunc is a function used to limit the initial set of image references // using tags, patterns, semver, etc. type filterFunc func(*logrus.Entry, types.ImageReference) bool // filterCollection is a map of repository names to filter functions. type filterCollection map[string]filterFunc // filterSourceReferences lists tags for images specified in the collection and // filters them using assigned filter functions. // It returns a list of repoDescriptors. func filterSourceReferences(sys *types.SystemContext, registryName string, collection filterCollection) []repoDescriptor { var repoDescList []repoDescriptor for repoName, filter := range collection { logger := logrus.WithFields(logrus.Fields{ "repo": repoName, "registry": registryName, }) repoRef, err := parseRepositoryReference(fmt.Sprintf("%s/%s", registryName, repoName)) if err != nil { logger.Error("Error parsing repository name, skipping") logrus.Error(err) continue } logger.Info("Processing repo") var sourceReferences []types.ImageReference logger.Info("Querying registry for image tags") sourceReferences, err = imagesToCopyFromRepo(sys, repoRef) if err != nil { logger.Error("Error processing repo, skipping") logrus.Error(err) continue } var filteredSourceReferences []types.ImageReference for _, ref := range sourceReferences { if filter(logger, ref) { filteredSourceReferences = append(filteredSourceReferences, ref) } } if len(filteredSourceReferences) == 0 { logger.Warnf("No refs to sync found") continue } repoDescList = append(repoDescList, repoDescriptor{ ImageRefs: filteredSourceReferences, Context: sys, }) } return repoDescList } // tagRegexFilterCollection converts a map of (repository name, tag regex) pairs // into a filterCollection, which is a map of (repository name, filter function) // pairs. func tagRegexFilterCollection(collection map[string]string) (filterCollection, error) { filters := filterCollection{} for repoName, tagRegex := range collection { pattern, err := regexp.Compile(tagRegex) if err != nil { return nil, err } f := func(logger *logrus.Entry, sourceReference types.ImageReference) bool { tagged, isTagged := sourceReference.DockerReference().(reference.Tagged) if !isTagged { logger.Errorf("Internal error, reference %s does not have a tag, skipping", sourceReference.DockerReference()) return false } return pattern.MatchString(tagged.Tag()) } filters[repoName] = f } return filters, nil } // semverFilterCollection converts a map of (repository name, array of semver constraints) pairs // into a filterCollection, which is a map of (repository name, filter function) // pairs. func semverFilterCollection(collection map[string]string) (filterCollection, error) { filters := filterCollection{} for repoName, constraintString := range collection { constraint, err := semver.NewConstraint(constraintString) if err != nil { return nil, err } f := func(logger *logrus.Entry, sourceReference types.ImageReference) bool { tagged, isTagged := sourceReference.DockerReference().(reference.Tagged) if !isTagged { logger.Errorf("Internal error, reference %s does not have a tag, skipping", sourceReference.DockerReference()) return false } tagVersion, err := semver.NewVersion(tagged.Tag()) if err != nil { logger.Tracef("Tag %q cannot be parsed as semver, skipping", tagged.Tag()) return false } return constraint.Check(tagVersion) } filters[repoName] = f } return filters, nil } // imagesToCopy retrieves all the images to copy from a specified sync source // and transport. // It returns a slice of repository descriptors, where each descriptor is a // list of tagged image references to be used as sync source, and any error // encountered. func imagesToCopy(source string, transport string, sourceCtx *types.SystemContext) ([]repoDescriptor, error) { var descriptors []repoDescriptor switch transport { case docker.Transport.Name(): desc := repoDescriptor{ Context: sourceCtx, } named, err := reference.ParseNormalizedNamed(source) // May be a repository or an image. if err != nil { return nil, fmt.Errorf("Cannot obtain a valid image reference for transport %q and reference %q: %w", docker.Transport.Name(), source, err) } imageTagged := !reference.IsNameOnly(named) logrus.WithFields(logrus.Fields{ "imagename": source, "tagged": imageTagged, }).Info("Tag presence check") if imageTagged { srcRef, err := docker.NewReference(named) if err != nil { return nil, fmt.Errorf("Cannot obtain a valid image reference for transport %q and reference %q: %w", docker.Transport.Name(), named.String(), err) } desc.ImageRefs = []types.ImageReference{srcRef} } else { desc.ImageRefs, err = imagesToCopyFromRepo(sourceCtx, named) if err != nil { return descriptors, err } if len(desc.ImageRefs) == 0 { return descriptors, fmt.Errorf("No images to sync found in %q", source) } } descriptors = append(descriptors, desc) case directory.Transport.Name(): desc := repoDescriptor{ Context: sourceCtx, } if _, err := os.Stat(source); err != nil { return descriptors, fmt.Errorf("Invalid source directory specified: %w", err) } desc.DirBasePath = source var err error desc.ImageRefs, err = imagesToCopyFromDir(source) if err != nil { return descriptors, err } if len(desc.ImageRefs) == 0 { return descriptors, fmt.Errorf("No images to sync found in %q", source) } descriptors = append(descriptors, desc) case "yaml": cfg, err := newSourceConfig(source) if err != nil { return descriptors, err } for registryName, registryConfig := range cfg { descs, err := imagesToCopyFromRegistry(registryName, registryConfig, *sourceCtx) if err != nil { return descriptors, fmt.Errorf("Failed to retrieve list of images from registry %q: %w", registryName, err) } descriptors = append(descriptors, descs...) } } return descriptors, nil } func (opts *syncOptions) run(args []string, stdout io.Writer) (retErr error) { if len(args) != 2 { return errorShouldDisplayUsage{errors.New("Exactly two arguments expected")} } opts.deprecatedTLSVerify.warnIfUsed([]string{"--src-tls-verify", "--dest-tls-verify"}) policyContext, err := opts.global.getPolicyContext() if err != nil { return fmt.Errorf("Error loading trust policy: %w", err) } defer func() { if err := policyContext.Destroy(); err != nil { retErr = noteCloseFailure(retErr, "tearing down policy context", err) } }() // validate source and destination options if len(opts.source) == 0 { return errors.New("A source transport must be specified") } if !slices.Contains([]string{docker.Transport.Name(), directory.Transport.Name(), "yaml"}, opts.source) { return fmt.Errorf("%q is not a valid source transport", opts.source) } if len(opts.destination) == 0 { return errors.New("A destination transport must be specified") } if !slices.Contains([]string{docker.Transport.Name(), directory.Transport.Name()}, opts.destination) { return fmt.Errorf("%q is not a valid destination transport", opts.destination) } if opts.source == opts.destination && opts.source == directory.Transport.Name() { return errors.New("sync from 'dir' to 'dir' not implemented, consider using rsync instead") } opts.destImage.warnAboutIneffectiveOptions(transports.Get(opts.destination)) imageListSelection := copy.CopySystemImage if opts.all { imageListSelection = copy.CopyAllImages } sourceCtx, err := opts.srcImage.newSystemContext() if err != nil { return err } ctx, cancel := opts.global.commandTimeoutContext() defer cancel() sourceArg := args[0] var srcRepoList []repoDescriptor if err = retry.IfNecessary(ctx, func() error { srcRepoList, err = imagesToCopy(sourceArg, opts.source, sourceCtx) return err }, opts.retryOpts); err != nil { return err } destination := args[1] destinationCtx, err := opts.destImage.newSystemContext() if err != nil { return err } options, cleanupOptions, err := opts.copy.copyOptions(stdout) if err != nil { return err } defer cleanupOptions() options.DestinationCtx = destinationCtx options.ImageListSelection = imageListSelection options.OptimizeDestinationImageAlreadyExists = true errorsPresent := false imagesNumber := 0 if opts.dryRun { logrus.Warn("Running in dry-run mode") } var digestFile *os.File if opts.digestFile != "" && !opts.dryRun { digestFile, err = os.OpenFile(opts.digestFile, os.O_TRUNC|os.O_CREATE|os.O_WRONLY, 0o644) if err != nil { return fmt.Errorf("Error creating digest file: %w", err) } defer func() { if err := digestFile.Close(); err != nil { retErr = noteCloseFailure(retErr, "closing digest file", err) } }() } for _, srcRepo := range srcRepoList { options.SourceCtx = srcRepo.Context for counter, ref := range srcRepo.ImageRefs { var destSuffix string var manifestBytes []byte switch ref.Transport() { case docker.Transport: // docker -> dir or docker -> docker destSuffix = ref.DockerReference().String() case directory.Transport: // dir -> docker (we don't allow `dir` -> `dir` sync operations) destSuffix = strings.TrimPrefix(ref.StringWithinTransport(), srcRepo.DirBasePath) if destSuffix == "" { // if source is a full path to an image, have destPath scoped to repo:tag destSuffix = path.Base(srcRepo.DirBasePath) } } if !opts.scoped { destSuffix = path.Base(destSuffix) } destRef, err := destinationReference(path.Join(destination, destSuffix)+opts.appendSuffix, opts.destination) if err != nil { return err } fromToFields := logrus.Fields{ "from": transports.ImageName(ref), "to": transports.ImageName(destRef), } if opts.dryRun { logrus.WithFields(fromToFields).Infof("Would have copied image ref %d/%d", counter+1, len(srcRepo.ImageRefs)) } else { logrus.WithFields(fromToFields).Infof("Copying image ref %d/%d", counter+1, len(srcRepo.ImageRefs)) if err = retry.IfNecessary(ctx, func() error { manifestBytes, err = copy.Image(ctx, policyContext, destRef, ref, options) return err }, opts.retryOpts); err != nil { if !opts.keepGoing { return fmt.Errorf("Error copying ref %q: %w", transports.ImageName(ref), err) } // log the error, keep a note that there was a failure and move on to the next // image ref errorsPresent = true logrus.WithError(err).Errorf("Error copying ref %q", transports.ImageName(ref)) continue } // Ensure that we log the manifest digest to a file only if the copy operation was successful if opts.digestFile != "" { manifestDigest, err := manifest.Digest(manifestBytes) if err != nil { return err } outputStr := fmt.Sprintf("%s %s", manifestDigest.String(), transports.ImageName(destRef)) if _, err = digestFile.WriteString(outputStr + "\n"); err != nil { return fmt.Errorf("Failed to write digest to file %q: %w", opts.digestFile, err) } } } imagesNumber++ } } if opts.dryRun { logrus.Infof("Would have synced %d images from %d sources", imagesNumber, len(srcRepoList)) } else { logrus.Infof("Synced %d images from %d sources", imagesNumber, len(srcRepoList)) } if !errorsPresent { return nil } return errors.New("Sync failed due to previous reported error(s) for one or more images") } ================================================ FILE: cmd/skopeo/sync_test.go ================================================ package main import ( "fmt" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.podman.io/image/v5/types" "gopkg.in/yaml.v3" ) var _ yaml.Unmarshaler = (*tlsVerifyConfig)(nil) func TestTLSVerifyConfig(t *testing.T) { type container struct { // An example of a larger config file TLSVerify tlsVerifyConfig `yaml:"tls-verify"` } for _, c := range []struct { input string expected tlsVerifyConfig }{ { input: `tls-verify: true`, expected: tlsVerifyConfig{skip: types.OptionalBoolFalse}, }, { input: `tls-verify: false`, expected: tlsVerifyConfig{skip: types.OptionalBoolTrue}, }, { input: ``, // No value expected: tlsVerifyConfig{skip: types.OptionalBoolUndefined}, }, } { config := container{} err := yaml.Unmarshal([]byte(c.input), &config) require.NoError(t, err, c.input) assert.Equal(t, c.expected, config.TLSVerify, c.input) } // Invalid input config := container{} err := yaml.Unmarshal([]byte(`tls-verify: "not a valid bool"`), &config) assert.Error(t, err) } func TestSync(t *testing.T) { // Invalid command-line arguments for _, args := range [][]string{ {}, {"a1"}, {"a1", "a2", "a3"}, } { out, err := runSkopeo(append([]string{"sync"}, args...)...) assertTestFailed(t, out, err, "Exactly two arguments expected") } // FIXME: Much more test coverage // Actual feature tests exist in integration and systemtest } // TestSyncTLSPrecedence validates the interactions of tls-verify in YAML and --src-tls-verify in the CLI. func TestSyncTLSPrecedence(t *testing.T) { for _, tt := range []struct { cli string yaml string wantSkip types.OptionalBool wantDaemonSkip bool }{ {"--src-tls-verify=false", `# nothing`, types.OptionalBoolTrue, true}, {"--src-tls-verify=true", `# nothing`, types.OptionalBoolFalse, false}, {"", `# nothing`, types.OptionalBoolUndefined, false}, {"--src-tls-verify=false", "tls-verify: true", types.OptionalBoolFalse, false}, {"--src-tls-verify=true", "tls-verify: false", types.OptionalBoolTrue, true}, } { t.Run(fmt.Sprintf("%#v + %q", tt.cli, tt.yaml), func(t *testing.T) { opts := fakeImageOptions(t, "src-", true, []string{}, []string{tt.cli}) sourceCtx, err := opts.newSystemContext() require.NoError(t, err) var cfg registrySyncConfig err = yaml.Unmarshal(fmt.Appendf(nil, ` %s images: repo: # Specifying an explicit repo+tag avoids imagesToCopyFromRegistry trying to contact the registry. - latest `, tt.yaml, ), &cfg) require.NoError(t, err) descs, err := imagesToCopyFromRegistry("example.com", cfg, *sourceCtx) require.NoError(t, err) require.NotEmpty(t, descs) ctx := descs[0].Context require.NotNil(t, ctx) assert.Equal(t, tt.wantSkip, ctx.DockerInsecureSkipTLSVerify) assert.Equal(t, tt.wantDaemonSkip, ctx.DockerDaemonInsecureSkipTLSVerify) }) } } ================================================ FILE: cmd/skopeo/unshare.go ================================================ //go:build !linux package main func reexecIfNecessaryForImages(_ ...string) error { return nil } ================================================ FILE: cmd/skopeo/unshare_linux.go ================================================ package main import ( "fmt" "slices" "github.com/moby/sys/capability" "go.podman.io/image/v5/transports/alltransports" "go.podman.io/storage/pkg/unshare" ) var neededCapabilities = []capability.Cap{ capability.CAP_CHOWN, capability.CAP_DAC_OVERRIDE, capability.CAP_FOWNER, capability.CAP_FSETID, capability.CAP_MKNOD, capability.CAP_SETFCAP, capability.CAP_SYS_ADMIN, } func maybeReexec() error { // With Skopeo we need only the subset of the root capabilities necessary // for pulling an image to the storage. Do not attempt to create a namespace // if we already have the capabilities we need. capabilities, err := capability.NewPid2(0) if err != nil { return fmt.Errorf("error reading the current capabilities sets: %w", err) } if err := capabilities.Load(); err != nil { return fmt.Errorf("error loading the current capabilities sets: %w", err) } if slices.ContainsFunc(neededCapabilities, func(cap capability.Cap) bool { return !capabilities.Get(capability.EFFECTIVE, cap) }) { // We miss a capability we need, create a user namespaces unshare.MaybeReexecUsingUserNamespace(true) return nil } return nil } func reexecIfNecessaryForImages(imageNames ...string) error { // Check if container-storage is used before doing unshare if slices.ContainsFunc(imageNames, func(imageName string) bool { transport := alltransports.TransportFromImageName(imageName) // Hard-code the storage name to avoid a reference on c/image/storage. // See https://github.com/containers/skopeo/issues/771#issuecomment-563125006. return transport != nil && transport.Name() == "containers-storage" }) { return maybeReexec() } return nil } ================================================ FILE: cmd/skopeo/utils.go ================================================ package main import ( "context" "errors" "fmt" "io" "os" "strings" "time" dockerdistributionerrcode "github.com/docker/distribution/registry/api/errcode" dockerdistributionapi "github.com/docker/distribution/registry/api/v2" imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" "github.com/sirupsen/logrus" "github.com/spf13/cobra" "github.com/spf13/pflag" commonFlag "go.podman.io/common/pkg/flag" "go.podman.io/common/pkg/retry" "go.podman.io/image/v5/copy" "go.podman.io/image/v5/directory" "go.podman.io/image/v5/manifest" ociarchive "go.podman.io/image/v5/oci/archive" ocilayout "go.podman.io/image/v5/oci/layout" "go.podman.io/image/v5/pkg/cli" "go.podman.io/image/v5/pkg/cli/sigstore" "go.podman.io/image/v5/pkg/compression" "go.podman.io/image/v5/signature/signer" "go.podman.io/image/v5/signature/simplesequoia" "go.podman.io/image/v5/storage" "go.podman.io/image/v5/transports/alltransports" "go.podman.io/image/v5/types" "golang.org/x/term" ) // errorShouldDisplayUsage is a subtype of error used by command handlers to indicate that the command’s help should be included. type errorShouldDisplayUsage struct { error } // noteCloseFailure returns (possibly-nil) err modified to account for (non-nil) closeErr. // The error for closeErr is annotated with description (which is not a format string) // Typical usage: // // defer func() { // if err := something.Close(); err != nil { // returnedErr = noteCloseFailure(returnedErr, "closing something", err) // } // } func noteCloseFailure(err error, description string, closeErr error) error { // We don’t accept a Closer() and close it ourselves because signature.PolicyContext has .Destroy(), not .Close(). // This also makes it harder for a caller to do // defer noteCloseFailure(returnedErr, …) // which doesn’t use the right value of returnedErr, and doesn’t update it. if err == nil { return fmt.Errorf("%s: %w", description, closeErr) } // In this case we prioritize the primary error for use with %w; closeErr is usually less relevant, or might be a consequence of the primary error. return fmt.Errorf("%w (%s: %v)", err, description, closeErr) } // commandAction intermediates between the RunE interface and the real handler, // primarily to ensure that cobra.Command is not available to the handler, which in turn // makes sure that the cmd.Flags() etc. flag access functions are not used, // and everything is done using the *Options structures and the *Var() methods of cmd.Flag(). // handler may return errorShouldDisplayUsage to cause c.Help to be called. func commandAction(handler func(args []string, stdout io.Writer) error) func(cmd *cobra.Command, args []string) error { return func(c *cobra.Command, args []string) error { err := handler(args, c.OutOrStdout()) var shouldDisplayUsage errorShouldDisplayUsage if errors.As(err, &shouldDisplayUsage) { c.SetOut(c.ErrOrStderr()) // This mutates c, but we are failing anyway. _ = c.Help() // Even if this failed, we prefer to report the original error } return err } } // deprecatedTLSVerifyOption represents a deprecated --tls-verify option, // which was accepted for all subcommands, for a time. // Every user should call deprecatedTLSVerifyOption.warnIfUsed() as part of handling the CLI, // whether or not the value actually ends up being used. // DO NOT ADD ANY NEW USES OF THIS; just call dockerImageFlags with an appropriate, possibly empty, flagPrefix. type deprecatedTLSVerifyOption struct { tlsVerify commonFlag.OptionalBool // FIXME FIXME: Warn if this is used, or even if it is ignored. } // warnIfUsed warns if tlsVerify was set by the user, and suggests alternatives (which should // start with "--"). // Every user should call this as part of handling the CLI, whether or not the value actually // ends up being used. func (opts *deprecatedTLSVerifyOption) warnIfUsed(alternatives []string) { if opts.tlsVerify.Present() { logrus.Warnf("'--tls-verify' is deprecated, instead use: %s", strings.Join(alternatives, ", ")) } } // deprecatedTLSVerifyFlags prepares the CLI flag writing into deprecatedTLSVerifyOption, and the managed deprecatedTLSVerifyOption structure. // DO NOT ADD ANY NEW USES OF THIS; just call dockerImageFlags with an appropriate, possibly empty, flagPrefix. func deprecatedTLSVerifyFlags() (pflag.FlagSet, *deprecatedTLSVerifyOption) { opts := deprecatedTLSVerifyOption{} fs := pflag.FlagSet{} flag := commonFlag.OptionalBoolFlag(&fs, &opts.tlsVerify, "tls-verify", "require HTTPS and verify certificates when accessing the container registry") flag.Hidden = true return fs, &opts } // sharedImageOptions collects CLI flags which are image-related, but do not change across images. // This really should be a part of globalOptions, but that would break existing users of (skopeo copy --authfile=). type sharedImageOptions struct { authFilePath string // Path to a */containers/auth.json } // sharedImageFlags prepares a collection of CLI flags writing into sharedImageOptions, and the managed sharedImageOptions structure. func sharedImageFlags() (pflag.FlagSet, *sharedImageOptions) { opts := sharedImageOptions{} fs := pflag.FlagSet{} fs.StringVar(&opts.authFilePath, "authfile", os.Getenv("REGISTRY_AUTH_FILE"), "path of the registry credentials file. Default is ${XDG_RUNTIME_DIR}/containers/auth.json") return fs, &opts } // dockerImageOptions collects CLI flags specific to the "docker" transport, which are // the same across subcommands, but may be different for each image // (e.g. may differ between the source and destination of a copy) type dockerImageOptions struct { global *globalOptions // May be shared across several imageOptions instances. shared *sharedImageOptions // May be shared across several imageOptions instances. deprecatedTLSVerify *deprecatedTLSVerifyOption // May be shared across several imageOptions instances, or nil. authFilePath commonFlag.OptionalString // Path to a */containers/auth.json (prefixed version to override shared image option). credsOption commonFlag.OptionalString // username[:password] for accessing a registry userName commonFlag.OptionalString // username for accessing a registry password commonFlag.OptionalString // password for accessing a registry registryToken commonFlag.OptionalString // token to be used directly as a Bearer token when accessing the registry dockerCertPath string // A directory using Docker-like *.{crt,cert,key} files for connecting to a registry or a daemon tlsVerify commonFlag.OptionalBool // Require HTTPS and verify certificates (for docker: and docker-daemon:) noCreds bool // Access the registry anonymously } // imageOptions collects CLI flags which are the same across subcommands, but may be different for each image // (e.g. may differ between the source and destination of a copy) type imageOptions struct { dockerImageOptions sharedBlobDir string // A directory to use for OCI blobs, shared across repositories dockerDaemonHost string // docker-daemon: host to connect to } // dockerImageFlags prepares a collection of docker-transport specific CLI flags // writing into imageOptions, and the managed imageOptions structure. func dockerImageFlags(global *globalOptions, shared *sharedImageOptions, deprecatedTLSVerify *deprecatedTLSVerifyOption, flagPrefix, credsOptionAlias string) (pflag.FlagSet, *imageOptions) { flags := imageOptions{ dockerImageOptions: dockerImageOptions{ global: global, shared: shared, deprecatedTLSVerify: deprecatedTLSVerify, }, } fs := pflag.FlagSet{} if flagPrefix != "" { // the non-prefixed flag is handled by a shared flag. fs.Var(commonFlag.NewOptionalStringValue(&flags.authFilePath), flagPrefix+"authfile", "path of the registry credentials file. Default is ${XDG_RUNTIME_DIR}/containers/auth.json") } fs.Var(commonFlag.NewOptionalStringValue(&flags.credsOption), flagPrefix+"creds", "Use `USERNAME[:PASSWORD]` for accessing the registry") fs.Var(commonFlag.NewOptionalStringValue(&flags.userName), flagPrefix+"username", "Username for accessing the registry") fs.Var(commonFlag.NewOptionalStringValue(&flags.password), flagPrefix+"password", "Password for accessing the registry") if credsOptionAlias != "" { // This is horribly ugly, but we need to support the old option forms of (skopeo copy) for compatibility. // Don't add any more cases like this. f := fs.VarPF(commonFlag.NewOptionalStringValue(&flags.credsOption), credsOptionAlias, "", "Use `USERNAME[:PASSWORD]` for accessing the registry") f.Hidden = true } fs.Var(commonFlag.NewOptionalStringValue(&flags.registryToken), flagPrefix+"registry-token", "Provide a Bearer token for accessing the registry") fs.StringVar(&flags.dockerCertPath, flagPrefix+"cert-dir", "", "use certificates at `PATH` (*.crt, *.cert, *.key) to connect to the registry or daemon") commonFlag.OptionalBoolFlag(&fs, &flags.tlsVerify, flagPrefix+"tls-verify", "require HTTPS and verify certificates when talking to the container registry or daemon") fs.BoolVar(&flags.noCreds, flagPrefix+"no-creds", false, "Access the registry anonymously") return fs, &flags } // imageFlags prepares a collection of CLI flags writing into imageOptions, and the managed imageOptions structure. func imageFlags(global *globalOptions, shared *sharedImageOptions, deprecatedTLSVerify *deprecatedTLSVerifyOption, flagPrefix, credsOptionAlias string) (pflag.FlagSet, *imageOptions) { dockerFlags, opts := dockerImageFlags(global, shared, deprecatedTLSVerify, flagPrefix, credsOptionAlias) fs := pflag.FlagSet{} fs.AddFlagSet(&dockerFlags) fs.StringVar(&opts.sharedBlobDir, flagPrefix+"shared-blob-dir", "", "`DIRECTORY` to use to share blobs across OCI repositories") fs.StringVar(&opts.dockerDaemonHost, flagPrefix+"daemon-host", "", "use docker daemon host at `HOST` (docker-daemon: only)") return fs, opts } func retryFlags() (pflag.FlagSet, *retry.Options) { opts := retry.Options{} fs := pflag.FlagSet{} fs.IntVar(&opts.MaxRetry, "retry-times", 0, "the number of times to possibly retry") fs.DurationVar(&opts.Delay, "retry-delay", 0*time.Second, "Fixed delay between retries. If not set, retry uses an exponential backoff delay.") return fs, &opts } // newSystemContext returns a *types.SystemContext corresponding to opts. // It is guaranteed to return a fresh instance, so it is safe to make additional updates to it. func (opts *imageOptions) newSystemContext() (*types.SystemContext, error) { // *types.SystemContext instance from globalOptions // imageOptions option overrides the instance if both are present. ctx, err := opts.global.newSystemContext() if err != nil { return nil, err } ctx.DockerCertPath = opts.dockerCertPath ctx.OCISharedBlobDirPath = opts.sharedBlobDir ctx.AuthFilePath = opts.shared.authFilePath ctx.DockerDaemonHost = opts.dockerDaemonHost ctx.DockerDaemonCertPath = opts.dockerCertPath if opts.authFilePath.Present() { ctx.AuthFilePath = opts.authFilePath.Value() } if opts.deprecatedTLSVerify != nil && opts.deprecatedTLSVerify.tlsVerify.Present() { // If both this deprecated option and a non-deprecated option is present, we use the latter value. ctx.DockerInsecureSkipTLSVerify = types.NewOptionalBool(!opts.deprecatedTLSVerify.tlsVerify.Value()) } if opts.tlsVerify.Present() { ctx.DockerDaemonInsecureSkipTLSVerify = !opts.tlsVerify.Value() } if opts.tlsVerify.Present() { ctx.DockerInsecureSkipTLSVerify = types.NewOptionalBool(!opts.tlsVerify.Value()) } if opts.credsOption.Present() && opts.noCreds { return nil, errors.New("creds and no-creds cannot be specified at the same time") } if opts.userName.Present() && opts.noCreds { return nil, errors.New("username and no-creds cannot be specified at the same time") } if opts.credsOption.Present() && opts.userName.Present() { return nil, errors.New("creds and username cannot be specified at the same time") } // if any of username or password is present, then both are expected to be present if opts.userName.Present() != opts.password.Present() { if opts.userName.Present() { return nil, errors.New("password must be specified when username is specified") } return nil, errors.New("username must be specified when password is specified") } if opts.credsOption.Present() { var err error ctx.DockerAuthConfig, err = getDockerAuth(opts.credsOption.Value()) if err != nil { return nil, err } } else if opts.userName.Present() { ctx.DockerAuthConfig = &types.DockerAuthConfig{ Username: opts.userName.Value(), Password: opts.password.Value(), } } if opts.registryToken.Present() { ctx.DockerBearerRegistryToken = opts.registryToken.Value() } if opts.noCreds { ctx.DockerAuthConfig = &types.DockerAuthConfig{} } return ctx, nil } // imageDestOptions is a superset of imageOptions specialized for image destinations. // Every user should call imageDestOptions.warnAboutIneffectiveOptions() as part of handling the CLI type imageDestOptions struct { *imageOptions dirForceCompression bool // Compress layers when saving to the dir: transport dirForceDecompression bool // Decompress layers when saving to the dir: transport ociAcceptUncompressedLayers bool // Whether to accept uncompressed layers in the oci: transport compressionFormat string // Format to use for the compression compressionLevel commonFlag.OptionalInt // Level to use for the compression precomputeDigests bool // Precompute digests to dedup layers when saving to the docker: transport forceCompressionFormat bool // Ensures that the compression algorithm set in compressionFormat is used exclusively imageDestFlagPrefix string } // imageDestFlags prepares a collection of CLI flags writing into imageDestOptions, and the managed imageDestOptions structure. func imageDestFlags(global *globalOptions, shared *sharedImageOptions, deprecatedTLSVerify *deprecatedTLSVerifyOption, flagPrefix, credsOptionAlias string) (pflag.FlagSet, *imageDestOptions) { genericFlags, genericOptions := imageFlags(global, shared, deprecatedTLSVerify, flagPrefix, credsOptionAlias) opts := imageDestOptions{imageOptions: genericOptions, imageDestFlagPrefix: flagPrefix} fs := pflag.FlagSet{} fs.AddFlagSet(&genericFlags) fs.BoolVar(&opts.dirForceCompression, flagPrefix+"compress", false, "Compress tarball image layers when saving to directory using the 'dir' transport. (default is same compression type as source)") fs.BoolVar(&opts.dirForceDecompression, flagPrefix+"decompress", false, "Decompress tarball image layers when saving to directory using the 'dir' transport. (default is same compression type as source)") fs.BoolVar(&opts.ociAcceptUncompressedLayers, flagPrefix+"oci-accept-uncompressed-layers", false, "Allow uncompressed image layers when saving to an OCI image using the 'oci' transport. (default is to compress things that aren't compressed)") fs.StringVar(&opts.compressionFormat, flagPrefix+"compress-format", "", "`FORMAT` to use for the compression") fs.Var(commonFlag.NewOptionalIntValue(&opts.compressionLevel), flagPrefix+"compress-level", "`LEVEL` to use for the compression") fs.BoolVar(&opts.precomputeDigests, flagPrefix+"precompute-digests", false, "Precompute digests to prevent uploading layers already on the registry using the 'docker' transport.") fs.BoolVar(&opts.forceCompressionFormat, flagPrefix+"force-compress-format", false, "Force exclusive use of the compression algorithm set in --dest-compress-format") return fs, &opts } // newSystemContext returns a *types.SystemContext corresponding to opts. // It is guaranteed to return a fresh instance, so it is safe to make additional updates to it. func (opts *imageDestOptions) newSystemContext() (*types.SystemContext, error) { ctx, err := opts.imageOptions.newSystemContext() if err != nil { return nil, err } ctx.DirForceCompress = opts.dirForceCompression ctx.DirForceDecompress = opts.dirForceDecompression ctx.OCIAcceptUncompressedLayers = opts.ociAcceptUncompressedLayers if opts.compressionFormat != "" { cf, err := compression.AlgorithmByName(opts.compressionFormat) if err != nil { return nil, err } ctx.CompressionFormat = &cf } if opts.compressionLevel.Present() { value := opts.compressionLevel.Value() ctx.CompressionLevel = &value } ctx.DockerRegistryPushPrecomputeDigests = opts.precomputeDigests return ctx, err } // warnAboutIneffectiveOptions warns if any ineffective option was set by the user // Every user should call this as part of handling the CLI func (opts *imageDestOptions) warnAboutIneffectiveOptions(destTransport types.ImageTransport) { if destTransport.Name() != directory.Transport.Name() { if opts.dirForceCompression { logrus.Warnf("--%s can only be used if the destination transport is 'dir'", opts.imageDestFlagPrefix+"compress") } if opts.dirForceDecompression { logrus.Warnf("--%s can only be used if the destination transport is 'dir'", opts.imageDestFlagPrefix+"decompress") } } } // sharedCopyOptions collects CLI flags that affect copying images, currently shared between the copy and sync commands. type sharedCopyOptions struct { removeSignatures bool // Do not copy signatures from the source image signByFingerprint string // Sign the image using a GPG key with the specified fingerprint signBySequoiaFingerprint string // Sign the image using a Sequoia-PGP key with the specified fingerprint signBySigstoreParamFile string // Sign the image using a sigstore signature per configuration in a param file signBySigstorePrivateKey string // Sign the image using a sigstore private key signPassphraseFile string // Path pointing to a passphrase file when signing preserveDigests bool // Preserve digests during copy format commonFlag.OptionalString // Force conversion of the image to a specified format } // sharedCopyFlags prepares a collection of CLI flags writing into sharedCopyoptions. func sharedCopyFlags() (pflag.FlagSet, *sharedCopyOptions) { opts := sharedCopyOptions{} fs := pflag.FlagSet{} fs.BoolVar(&opts.removeSignatures, "remove-signatures", false, "Do not copy signatures from source") fs.StringVar(&opts.signByFingerprint, "sign-by", "", "Sign the image using a GPG key with the specified `FINGERPRINT`") fs.StringVar(&opts.signBySequoiaFingerprint, "sign-by-sq-fingerprint", "", "Sign the image using a Sequoia-PGP key with the specified `FINGERPRINT`") fs.StringVar(&opts.signBySigstoreParamFile, "sign-by-sigstore", "", "Sign the image using a sigstore parameter file at `PATH`") fs.StringVar(&opts.signBySigstorePrivateKey, "sign-by-sigstore-private-key", "", "Sign the image using a sigstore private key at `PATH`") fs.StringVar(&opts.signPassphraseFile, "sign-passphrase-file", "", "Read a passphrase for signing an image from `PATH`") fs.VarP(commonFlag.NewOptionalStringValue(&opts.format), "format", "f", `MANIFEST TYPE (oci, v2s1, or v2s2) to use in the destination (default is manifest type of source, with fallbacks)`) fs.BoolVar(&opts.preserveDigests, "preserve-digests", false, "Preserve digests of images and lists") return fs, &opts } // copyOptions interprets opts, returns a partially-filled *copy.Options, // and a function that should be called to clean up. func (opts *sharedCopyOptions) copyOptions(stdout io.Writer) (*copy.Options, func(), error) { var manifestType string if opts.format.Present() { mt, err := parseManifestFormat(opts.format.Value()) if err != nil { return nil, nil, err } manifestType = mt } // c/image/copy.Image does allow creating both simple signing and sigstore signatures simultaneously, // with independent passphrases, but that would make the CLI probably too confusing. // For now, use the passphrase with either, but only one of them. if opts.signPassphraseFile != "" { count := 0 if opts.signByFingerprint != "" { count++ } if opts.signBySequoiaFingerprint != "" { count++ } if opts.signBySigstorePrivateKey != "" { count++ } if count > 1 { return nil, nil, fmt.Errorf("Only one of --sign-by, --sign-by-sq-fingerprint and --sign-by-sigstore-private-key can be used with --sign-passphrase-file") } } // Simple signing does not really allow empty but present passphrases — but for sigstore, cosign does support creating keys encrypted with an empty passphrase; // so, at least for that case, we must track the distinction between an empty and a missing passphrase precisely. var passphrase string passphraseSet := false if opts.signPassphraseFile != "" { p, err := cli.ReadPassphraseFile(opts.signPassphraseFile) if err != nil { return nil, nil, err } passphrase = p passphraseSet = true } else if opts.signBySigstorePrivateKey != "" { p, err := promptForPassphrase(opts.signBySigstorePrivateKey, os.Stdin, os.Stdout) if err != nil { return nil, nil, err } passphrase = p passphraseSet = true } // opts.signByFingerprint triggers a GPG-agent passphrase prompt, possibly using a more secure channel, so we usually shouldn’t prompt ourselves if no passphrase was explicitly provided. // With opts.signBySequoiaFingerprint, we don’t prompt for a passphrase (for now??): We don’t know whether the key requires a passphrase. var passphraseBytes []byte if passphraseSet { passphraseBytes = []byte(passphrase) } var signers []*signer.Signer closeSigners := func() { for _, signer := range signers { signer.Close() } } succeeded := false defer func() { if !succeeded { closeSigners() } }() if opts.signBySigstoreParamFile != "" { signer, err := sigstore.NewSignerFromParameterFile(opts.signBySigstoreParamFile, &sigstore.Options{ PrivateKeyPassphrasePrompt: func(keyFile string) (string, error) { return promptForPassphrase(keyFile, os.Stdin, os.Stdout) }, Stdin: os.Stdin, Stdout: stdout, }) if err != nil { return nil, nil, fmt.Errorf("Error using --sign-by-sigstore: %w", err) } signers = append(signers, signer) } if opts.signBySequoiaFingerprint != "" { sqOpts := []simplesequoia.Option{ simplesequoia.WithKeyFingerprint(opts.signBySequoiaFingerprint), } if passphraseSet { sqOpts = append(sqOpts, simplesequoia.WithPassphrase(passphrase)) } signer, err := simplesequoia.NewSigner(sqOpts...) if err != nil { return nil, nil, fmt.Errorf("Error using --sign-by-sq-fingerprint: %w", err) } signers = append(signers, signer) } succeeded = true return ©.Options{ RemoveSignatures: opts.removeSignatures, Signers: signers, SignBy: opts.signByFingerprint, SignPassphrase: passphrase, SignBySigstorePrivateKeyFile: opts.signBySigstorePrivateKey, SignSigstorePrivateKeyPassphrase: passphraseBytes, ReportWriter: stdout, PreserveDigests: opts.preserveDigests, ForceManifestMIMEType: manifestType, }, closeSigners, nil } func parseCreds(creds string) (string, string, error) { if creds == "" { return "", "", errors.New("credentials can't be empty") } username, password, _ := strings.Cut(creds, ":") // Sets password to "" if there is no ":" if username == "" { return "", "", errors.New("username can't be empty") } return username, password, nil } func getDockerAuth(creds string) (*types.DockerAuthConfig, error) { username, password, err := parseCreds(creds) if err != nil { return nil, err } return &types.DockerAuthConfig{ Username: username, Password: password, }, nil } // parseImageSource converts image URL-like string to an ImageSource. // The caller must call .Close() on the returned ImageSource. func parseImageSource(ctx context.Context, opts *imageOptions, name string) (types.ImageSource, error) { ref, err := alltransports.ParseImageName(name) if err != nil { return nil, err } sys, err := opts.newSystemContext() if err != nil { return nil, err } return ref.NewImageSource(ctx, sys) } // parseManifestFormat parses format parameter for copy and sync command. // It returns string value to use as manifest MIME type func parseManifestFormat(manifestFormat string) (string, error) { switch manifestFormat { case "oci": return imgspecv1.MediaTypeImageManifest, nil case "v2s1": return manifest.DockerV2Schema1SignedMediaType, nil case "v2s2": return manifest.DockerV2Schema2MediaType, nil default: return "", fmt.Errorf("unknown format %q. Choose one of the supported formats: 'oci', 'v2s1', or 'v2s2'", manifestFormat) } } // usageTemplate returns the usage template for skopeo commands // This blocks the displaying of the global options. The main skopeo // command should not use this. const usageTemplate = `Usage:{{if .Runnable}} {{.UseLine}}{{end}}{{if .HasAvailableSubCommands}} {{.CommandPath}} [command]{{end}}{{if gt (len .Aliases) 0}} Aliases: {{.NameAndAliases}}{{end}}{{if .HasExample}} Examples: {{.Example}}{{end}}{{if .HasAvailableSubCommands}} Available Commands:{{range .Commands}}{{if (or .IsAvailableCommand (eq .Name "help"))}} {{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{end}}{{if .HasAvailableLocalFlags}} Flags: {{.LocalFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if .HasAvailableInheritedFlags}} {{end}} ` // adjustUsage uses usageTemplate template to get rid the GlobalOption from usage // and disable [flag] at the end of command usage func adjustUsage(c *cobra.Command) { c.SetUsageTemplate(usageTemplate) c.DisableFlagsInUseLine = true } // promptForPassphrase interactively prompts for a passphrase related to privateKeyFile func promptForPassphrase(privateKeyFile string, stdin, stdout *os.File) (string, error) { stdinFd := int(stdin.Fd()) if !term.IsTerminal(stdinFd) { return "", fmt.Errorf("Cannot prompt for a passphrase for key %s, standard input is not a TTY", privateKeyFile) } fmt.Fprintf(stdout, "Passphrase for key %s: ", privateKeyFile) passphrase, err := term.ReadPassword(stdinFd) if err != nil { return "", fmt.Errorf("Error reading password: %w", err) } fmt.Fprintf(stdout, "\n") return string(passphrase), nil } // isNotFoundImageError heuristically attempts to determine whether an error // is saying the remote source couldn't find the image (as opposed to an // authentication error, an I/O error etc.) // TODO drive this into containers/image properly func isNotFoundImageError(err error) bool { var layoutImageNotFoundError ocilayout.ImageNotFoundError var archiveImageNotFoundError ociarchive.ImageNotFoundError return isDockerManifestUnknownError(err) || errors.Is(err, storage.ErrNoSuchImage) || errors.As(err, &layoutImageNotFoundError) || errors.As(err, &archiveImageNotFoundError) } // isDockerManifestUnknownError is a copy of code from containers/image, // please update there first. func isDockerManifestUnknownError(err error) bool { var ec dockerdistributionerrcode.ErrorCoder if !errors.As(err, &ec) { return false } return ec.ErrorCode() == dockerdistributionapi.ErrorCodeManifestUnknown } ================================================ FILE: cmd/skopeo/utils_nosequoia_test.go ================================================ //go:build !containers_image_sequoia package main const buildWithSequoia = false ================================================ FILE: cmd/skopeo/utils_sequoia_test.go ================================================ //go:build containers_image_sequoia package main const buildWithSequoia = true ================================================ FILE: cmd/skopeo/utils_test.go ================================================ package main import ( "bytes" "errors" "os" "path/filepath" "testing" imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" "github.com/spf13/cobra" "github.com/spf13/pflag" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.podman.io/image/v5/copy" "go.podman.io/image/v5/manifest" "go.podman.io/image/v5/types" ) func TestNoteCloseFailure(t *testing.T) { const description = "description" mainErr := errors.New("main") closeErr := errors.New("closing") // Main success, closing failed res := noteCloseFailure(nil, description, closeErr) require.NotNil(t, res) assert.Contains(t, res.Error(), description) assert.Contains(t, res.Error(), closeErr.Error()) // Both main and closing failed res = noteCloseFailure(mainErr, description, closeErr) require.NotNil(t, res) assert.Contains(t, res.Error(), mainErr.Error()) assert.Contains(t, res.Error(), description) assert.Contains(t, res.Error(), closeErr.Error()) assert.ErrorIs(t, res, mainErr) } // fakeGlobalOptions creates globalOptions and sets it according to flags. func fakeGlobalOptions(t *testing.T, flags []string) (*globalOptions, *cobra.Command) { app, opts := createApp() cmd := &cobra.Command{} app.AddCommand(cmd) err := app.ParseFlags(flags) require.NoError(t, err) return opts, cmd } // fakeImageOptions creates imageOptions and sets it according to globalFlags/cmdFlags. func fakeImageOptions(t *testing.T, flagPrefix string, useDeprecatedTLSVerify bool, globalFlags []string, cmdFlags []string, ) *imageOptions { globalOpts, cmd := fakeGlobalOptions(t, globalFlags) sharedFlags, sharedOpts := sharedImageFlags() var deprecatedTLSVerifyFlag pflag.FlagSet var deprecatedTLSVerifyOpt *deprecatedTLSVerifyOption if useDeprecatedTLSVerify { deprecatedTLSVerifyFlag, deprecatedTLSVerifyOpt = deprecatedTLSVerifyFlags() } imageFlags, imageOpts := imageFlags(globalOpts, sharedOpts, deprecatedTLSVerifyOpt, flagPrefix, "") cmd.Flags().AddFlagSet(&sharedFlags) if useDeprecatedTLSVerify { cmd.Flags().AddFlagSet(&deprecatedTLSVerifyFlag) } cmd.Flags().AddFlagSet(&imageFlags) err := cmd.ParseFlags(cmdFlags) require.NoError(t, err) return imageOpts } func TestImageOptionsNewSystemContext(t *testing.T) { // Default state opts := fakeImageOptions(t, "dest-", true, []string{}, []string{}) res, err := opts.newSystemContext() require.NoError(t, err) assert.Equal(t, &types.SystemContext{ DockerRegistryUserAgent: defaultUserAgent, }, res) // Set everything to non-default values. opts = fakeImageOptions(t, "dest-", true, []string{ "--registries.d", "/srv/registries.d", "--override-arch", "overridden-arch", "--override-os", "overridden-os", "--override-variant", "overridden-variant", "--tmpdir", "/srv", }, []string{ "--authfile", "/srv/authfile", "--dest-authfile", "/srv/dest-authfile", "--dest-cert-dir", "/srv/cert-dir", "--dest-shared-blob-dir", "/srv/shared-blob-dir", "--dest-daemon-host", "daemon-host.example.com", "--dest-tls-verify=false", "--dest-creds", "creds-user:creds-password", "--dest-registry-token", "faketoken", }) res, err = opts.newSystemContext() require.NoError(t, err) assert.Equal(t, &types.SystemContext{ RegistriesDirPath: "/srv/registries.d", AuthFilePath: "/srv/dest-authfile", ArchitectureChoice: "overridden-arch", OSChoice: "overridden-os", VariantChoice: "overridden-variant", OCISharedBlobDirPath: "/srv/shared-blob-dir", DockerCertPath: "/srv/cert-dir", DockerInsecureSkipTLSVerify: types.OptionalBoolTrue, DockerAuthConfig: &types.DockerAuthConfig{Username: "creds-user", Password: "creds-password"}, DockerBearerRegistryToken: "faketoken", DockerDaemonCertPath: "/srv/cert-dir", DockerDaemonHost: "daemon-host.example.com", DockerDaemonInsecureSkipTLSVerify: true, DockerRegistryUserAgent: defaultUserAgent, BigFilesTemporaryDir: "/srv", }, res) // Global/per-command tlsVerify behavior is tested in TestTLSVerifyFlags. // Invalid option values opts = fakeImageOptions(t, "dest-", true, []string{}, []string{"--dest-creds", ""}) _, err = opts.newSystemContext() assert.Error(t, err) } // fakeImageDestOptions creates imageDestOptions and sets it according to globalFlags/cmdFlags. func fakeImageDestOptions(t *testing.T, flagPrefix string, useDeprecatedTLSVerify bool, globalFlags []string, cmdFlags []string, ) *imageDestOptions { globalOpts, cmd := fakeGlobalOptions(t, globalFlags) sharedFlags, sharedOpts := sharedImageFlags() var deprecatedTLSVerifyFlag pflag.FlagSet var deprecatedTLSVerifyOpt *deprecatedTLSVerifyOption if useDeprecatedTLSVerify { deprecatedTLSVerifyFlag, deprecatedTLSVerifyOpt = deprecatedTLSVerifyFlags() } imageFlags, imageOpts := imageDestFlags(globalOpts, sharedOpts, deprecatedTLSVerifyOpt, flagPrefix, "") cmd.Flags().AddFlagSet(&sharedFlags) if useDeprecatedTLSVerify { cmd.Flags().AddFlagSet(&deprecatedTLSVerifyFlag) } cmd.Flags().AddFlagSet(&imageFlags) err := cmd.ParseFlags(cmdFlags) require.NoError(t, err) return imageOpts } func TestImageDestOptionsNewSystemContext(t *testing.T) { // Default state opts := fakeImageDestOptions(t, "dest-", true, []string{}, []string{}) res, err := opts.newSystemContext() require.NoError(t, err) assert.Equal(t, &types.SystemContext{ DockerRegistryUserAgent: defaultUserAgent, }, res) authFile := "/tmp/auth.json" // Make sure when REGISTRY_AUTH_FILE is set the auth file is used t.Setenv("REGISTRY_AUTH_FILE", authFile) // Explicitly set everything to default, except for when the default is “not present” opts = fakeImageDestOptions(t, "dest-", true, []string{}, []string{ "--dest-compress=false", }) res, err = opts.newSystemContext() require.NoError(t, err) assert.Equal(t, &types.SystemContext{ AuthFilePath: authFile, DockerRegistryUserAgent: defaultUserAgent, }, res) // Set everything to non-default values. opts = fakeImageDestOptions(t, "dest-", true, []string{ "--registries.d", "/srv/registries.d", "--override-arch", "overridden-arch", "--override-os", "overridden-os", "--override-variant", "overridden-variant", "--tmpdir", "/srv", }, []string{ "--authfile", "/srv/authfile", "--dest-cert-dir", "/srv/cert-dir", "--dest-shared-blob-dir", "/srv/shared-blob-dir", "--dest-compress=true", "--dest-daemon-host", "daemon-host.example.com", "--dest-tls-verify=false", "--dest-creds", "creds-user:creds-password", "--dest-registry-token", "faketoken", "--dest-precompute-digests=true", }) res, err = opts.newSystemContext() require.NoError(t, err) assert.Equal(t, &types.SystemContext{ RegistriesDirPath: "/srv/registries.d", AuthFilePath: "/srv/authfile", ArchitectureChoice: "overridden-arch", OSChoice: "overridden-os", VariantChoice: "overridden-variant", OCISharedBlobDirPath: "/srv/shared-blob-dir", DockerCertPath: "/srv/cert-dir", DockerInsecureSkipTLSVerify: types.OptionalBoolTrue, DockerAuthConfig: &types.DockerAuthConfig{Username: "creds-user", Password: "creds-password"}, DockerBearerRegistryToken: "faketoken", DockerDaemonCertPath: "/srv/cert-dir", DockerDaemonHost: "daemon-host.example.com", DockerDaemonInsecureSkipTLSVerify: true, DockerRegistryUserAgent: defaultUserAgent, DirForceCompress: true, BigFilesTemporaryDir: "/srv", DockerRegistryPushPrecomputeDigests: true, }, res) // Global/per-command tlsVerify behavior is tested in TestTLSVerifyFlags. // Invalid option values in imageOptions opts = fakeImageDestOptions(t, "dest-", true, []string{}, []string{"--dest-creds", ""}) _, err = opts.newSystemContext() assert.Error(t, err) } // TestImageOptionsUsernamePassword verifies that using the username and password // options works as expected func TestImageOptionsUsernamePassword(t *testing.T) { for _, command := range []struct { commandArgs []string expectedAuthConfig *types.DockerAuthConfig // data to expect, or nil if an error is expected }{ // Set only username/password (without --creds), expected to pass { commandArgs: []string{"--dest-username", "foo", "--dest-password", "bar"}, expectedAuthConfig: &types.DockerAuthConfig{Username: "foo", Password: "bar"}, }, // no username but set password, expect error { commandArgs: []string{"--dest-password", "foo"}, expectedAuthConfig: nil, }, // set username but no password. expected to fail (we currently don't allow a user without password) { commandArgs: []string{"--dest-username", "bar"}, expectedAuthConfig: nil, }, // set username with --creds, expected to fail { commandArgs: []string{"--dest-username", "bar", "--dest-creds", "hello:world", "--dest-password", "foo"}, expectedAuthConfig: nil, }, // set username with --no-creds, expected to fail { commandArgs: []string{"--dest-username", "bar", "--dest-no-creds", "--dest-password", "foo"}, expectedAuthConfig: nil, }, } { opts := fakeImageDestOptions(t, "dest-", true, []string{}, command.commandArgs) // parse the command options res, err := opts.newSystemContext() if command.expectedAuthConfig == nil { assert.Error(t, err) } else { require.NoError(t, err) assert.Equal(t, &types.SystemContext{ DockerRegistryUserAgent: defaultUserAgent, DockerAuthConfig: command.expectedAuthConfig, }, res) } } } func TestTLSVerifyFlags(t *testing.T) { type systemContextOpts interface { // Either *imageOptions or *imageDestOptions newSystemContext() (*types.SystemContext, error) } for _, creator := range []struct { name string newOpts func(useDeprecatedTLSVerify bool, globalFlags, cmdFlags []string) systemContextOpts }{ { "imageFlags", func(useDeprecatedTLSVerify bool, globalFlags, cmdFlags []string) systemContextOpts { return fakeImageOptions(t, "dest-", useDeprecatedTLSVerify, globalFlags, cmdFlags) }, }, { "imageDestFlags", func(useDeprecatedTLSVerify bool, globalFlags, cmdFlags []string) systemContextOpts { return fakeImageDestOptions(t, "dest-", useDeprecatedTLSVerify, globalFlags, cmdFlags) }, }, } { t.Run(creator.name, func(t *testing.T) { for _, c := range []struct { global, deprecatedCmd, cmd string expectedDocker types.OptionalBool expectedDockerDaemon bool }{ {"", "", "", types.OptionalBoolUndefined, false}, {"", "", "false", types.OptionalBoolTrue, true}, {"", "", "true", types.OptionalBoolFalse, false}, {"", "false", "", types.OptionalBoolTrue, false}, {"", "false", "false", types.OptionalBoolTrue, true}, {"", "false", "true", types.OptionalBoolFalse, false}, {"", "true", "", types.OptionalBoolFalse, false}, {"", "true", "false", types.OptionalBoolTrue, true}, {"", "true", "true", types.OptionalBoolFalse, false}, {"false", "", "", types.OptionalBoolTrue, false}, {"false", "", "false", types.OptionalBoolTrue, true}, {"false", "", "true", types.OptionalBoolFalse, false}, {"false", "false", "", types.OptionalBoolTrue, false}, {"false", "false", "false", types.OptionalBoolTrue, true}, {"false", "false", "true", types.OptionalBoolFalse, false}, {"false", "true", "", types.OptionalBoolFalse, false}, {"false", "true", "false", types.OptionalBoolTrue, true}, {"false", "true", "true", types.OptionalBoolFalse, false}, {"true", "", "", types.OptionalBoolFalse, false}, {"true", "", "false", types.OptionalBoolTrue, true}, {"true", "", "true", types.OptionalBoolFalse, false}, {"true", "false", "", types.OptionalBoolTrue, false}, {"true", "false", "false", types.OptionalBoolTrue, true}, {"true", "false", "true", types.OptionalBoolFalse, false}, {"true", "true", "", types.OptionalBoolFalse, false}, {"true", "true", "false", types.OptionalBoolTrue, true}, {"true", "true", "true", types.OptionalBoolFalse, false}, } { globalFlags := []string{} if c.global != "" { globalFlags = append(globalFlags, "--tls-verify="+c.global) } cmdFlags := []string{} if c.deprecatedCmd != "" { cmdFlags = append(cmdFlags, "--tls-verify="+c.deprecatedCmd) } if c.cmd != "" { cmdFlags = append(cmdFlags, "--dest-tls-verify="+c.cmd) } opts := creator.newOpts(true, globalFlags, cmdFlags) res, err := opts.newSystemContext() require.NoError(t, err) assert.Equal(t, c.expectedDocker, res.DockerInsecureSkipTLSVerify, "%#v", c) assert.Equal(t, c.expectedDockerDaemon, res.DockerDaemonInsecureSkipTLSVerify, "%#v", c) if c.deprecatedCmd == "" { // Test also the behavior when deprecatedTLSFlag is not recognized // Use globalFlags from the previous test cmdFlags := []string{} if c.cmd != "" { cmdFlags = append(cmdFlags, "--dest-tls-verify="+c.cmd) } opts := creator.newOpts(false, globalFlags, cmdFlags) res, err = opts.newSystemContext() require.NoError(t, err) assert.Equal(t, c.expectedDocker, res.DockerInsecureSkipTLSVerify, "%#v", c) assert.Equal(t, c.expectedDockerDaemon, res.DockerDaemonInsecureSkipTLSVerify, "%#v", c) } } }) } } // fakeSharedCopyOptions creates sharedCopyOptions and sets it according to cmdFlags. func fakeSharedCopyOptions(t *testing.T, cmdFlags []string) *sharedCopyOptions { _, cmd := fakeGlobalOptions(t, []string{}) sharedCopyFlags, sharedCopyOpts := sharedCopyFlags() cmd.Flags().AddFlagSet(&sharedCopyFlags) err := cmd.ParseFlags(cmdFlags) require.NoError(t, err) return sharedCopyOpts } func TestSharedCopyOptionsCopyOptions(t *testing.T) { someStdout := bytes.Buffer{} passphraseFile := filepath.Join(t.TempDir(), "passphrase") // Eventually we could refer to a passphrase fixture instead err := os.WriteFile(passphraseFile, []byte("test-passphrase"), 0o600) require.NoError(t, err) type tc struct { options []string expected copy.Options expectedSigner bool } c := []tc{ { // Default state options: []string{}, expected: copy.Options{ ReportWriter: &someStdout, }, }, // Set most flags to non-default values // This should also test --sign-by-sigstore and --sign-by-sigstore-private-key; we would have // to create test keys for that. // This does not test --sign-by-sq-fingerprint, because that needs to be conditional based on buildWithSequoia. { options: []string{ "--remove-signatures", "--sign-by", "gpgFingerprint", "--format", "oci", "--preserve-digests", }, expected: copy.Options{ RemoveSignatures: true, SignBy: "gpgFingerprint", ReportWriter: &someStdout, PreserveDigests: true, ForceManifestMIMEType: imgspecv1.MediaTypeImageManifest, }, }, { // --sign-passphrase-file + --sign-by work options: []string{ "--sign-by", "gpgFingerprint", "--sign-passphrase-file", passphraseFile, }, expected: copy.Options{ SignBy: "gpgFingerprint", SignPassphrase: "test-passphrase", SignSigstorePrivateKeyPassphrase: []byte("test-passphrase"), ReportWriter: &someStdout, }, }, { // --sign-passphrase-file + --sign-by-sigstore-private-key work options: []string{ "--sign-by-sigstore-private-key", "/some/key/path.private", "--sign-passphrase-file", passphraseFile, }, expected: copy.Options{ SignPassphrase: "test-passphrase", SignBySigstorePrivateKeyFile: "/some/key/path.private", SignSigstorePrivateKeyPassphrase: []byte("test-passphrase"), ReportWriter: &someStdout, }, }, { // --sign-passphrase-file + --sign-by-sigstore-private-key work with an empty passphrase options: []string{ "--sign-by-sigstore-private-key", "/some/key/path.private", "--sign-passphrase-file", "./fixtures/empty.passphrase", }, expected: copy.Options{ SignPassphrase: "", SignBySigstorePrivateKeyFile: "/some/key/path.private", SignSigstorePrivateKeyPassphrase: []byte(""), ReportWriter: &someStdout, }, }, } // If Sequoia is supported, --sign-passphrase-file + --sign-by-sq-fingerprint work if buildWithSequoia { c = append(c, tc{ options: []string{ "--sign-by-sq-fingerprint", "sqFingerprint", "--sign-passphrase-file", passphraseFile, }, expected: copy.Options{ SignPassphrase: "test-passphrase", SignSigstorePrivateKeyPassphrase: []byte("test-passphrase"), ReportWriter: &someStdout, }, expectedSigner: true, }) } for _, c := range c { opts := fakeSharedCopyOptions(t, c.options) res, cleanup, err := opts.copyOptions(&someStdout) require.NoError(t, err) defer cleanup() if c.expectedSigner { assert.NotNil(t, res.Signers) res.Signers = nil // To allow the comparison below } assert.Equal(t, &c.expected, res) } for _, opts := range [][]string{ {"--format", "invalid"}, // Invalid --format // More --sign-by-sigstore-private-key, --sign-by-sigstore failure cases should be tested here. // --sign-passphrase-file + more than one key option {"--sign-by", "gpgFingerprint", "--sign-by-sq-fingerprint", "sqFingerprint", "--sign-passphrase-file", passphraseFile}, {"--sign-by", "gpgFingerprint", "--sign-by-sigstore-private-key", "sigstorePrivateKey", "--sign-passphrase-file", passphraseFile}, {"--sign-by-sq-fingerprint", "sqFingerprint", "--sign-by-sigstore-private-key", "sigstorePrivateKey", "--sign-passphrase-file", passphraseFile}, {"--sign-by", "gpgFingerprint", "--sign-passphrase-file", "/dev/null/this/does/not/exist"}, // --sign-passphrase-file not found {"--sign-by-sigstore", "/dev/null/this/does/not/exist"}, // --sign-by-sigstore file not found } { opts := fakeSharedCopyOptions(t, opts) _, _, err = opts.copyOptions(&someStdout) assert.Error(t, err) } } func TestParseManifestFormat(t *testing.T) { for _, testCase := range []struct { formatParam string expectedManifestType string expectErr bool }{ { "oci", imgspecv1.MediaTypeImageManifest, false, }, { "v2s1", manifest.DockerV2Schema1SignedMediaType, false, }, { "v2s2", manifest.DockerV2Schema2MediaType, false, }, { "", "", true, }, { "badValue", "", true, }, } { manifestType, err := parseManifestFormat(testCase.formatParam) if testCase.expectErr { require.Error(t, err) } else { require.NoError(t, err) } assert.Equal(t, manifestType, testCase.expectedManifestType) } } // since there is a shared authfile image option and a non-shared (prefixed) one, make sure the override logic // works correctly. func TestImageOptionsAuthfileOverride(t *testing.T) { for _, testCase := range []struct { flagPrefix string cmdFlags []string expectedAuthfilePath string }{ // if there is no prefix, only authfile is allowed. { "", []string{ "--authfile", "/srv/authfile", }, "/srv/authfile", }, // if authfile and dest-authfile is provided, dest-authfile wins { "dest-", []string{ "--authfile", "/srv/authfile", "--dest-authfile", "/srv/dest-authfile", }, "/srv/dest-authfile", }, // if only the shared authfile is provided, authfile must be present in system context { "dest-", []string{ "--authfile", "/srv/authfile", }, "/srv/authfile", }, // if only the dest authfile is provided, dest-authfile must be present in system context { "dest-", []string{ "--dest-authfile", "/srv/dest-authfile", }, "/srv/dest-authfile", }, } { opts := fakeImageOptions(t, testCase.flagPrefix, false, []string{}, testCase.cmdFlags) res, err := opts.newSystemContext() require.NoError(t, err) assert.Equal(t, &types.SystemContext{ AuthFilePath: testCase.expectedAuthfilePath, DockerRegistryUserAgent: defaultUserAgent, }, res) } } ================================================ FILE: contrib/cirrus/mac_cleanup.sh ================================================ #!/bin/bash # This script is intended to be called by Cirrus-CI on a Mac M1 persistent worker. # It performs a best-effort attempt at cleaning up from one task execution to the next. # Since it run both before and after tasks, it must exit cleanly if there was a cleanup # failure (i.e. file or directory not found). # Help anybody debugging side-effects, since failures are ignored (by necessity). set +e -x # These are the main processes which could leak out of testing. killall podman vfkit gvproxy make go ginkgo mkdir -p $TMPDIR # Golang will leave behind lots of read-only bits, ref: # https://go.dev/ref/mod#module-cache # However other tools/scripts could also set things read-only. # At this point in CI, we really want all this stuff gone-gone, # so there's actually zero-chance it can interfere. chmod -R u+w $TMPDIR/* $TMPDIR/.??* # This is defined as $TMPDIR during setup. Name must be kept # "short" as sockets may reside here. Darwin suffers from # the same limited socket-pathname character-length restriction # as Linux. rm -rf $TMPDIR/* $TMPDIR/.??* # Don't change or clobber anything under $CIRRUS_WORKING_DIR for # the currently running task. But make sure we have write permission # (go get sets dependencies ro) for everything else, before removing it. # First make everything writeable - see the "Golang will..." comment above. # shellcheck disable=SC2154 find "$HOME/ci" -mindepth 1 -maxdepth 1 \ -not -name "*task-${CIRRUS_TASK_ID}*" -prune -exec chmod -R u+w '{}' + find "$HOME/ci" -mindepth 1 -maxdepth 1 \ -not -name "*task-${CIRRUS_TASK_ID}*" -prune -exec rm -rf '{}' + # Bash scripts exit with the status of the last command. true ================================================ FILE: contrib/cirrus/ostree_ext.dockerfile ================================================ ARG BASE_FQIN=quay.io/coreos-assembler/fcos-buildroot:testing-devel FROM $BASE_FQIN # See 'Danger of using COPY and ADD instructions' # at https://cirrus-ci.org/guide/docker-builder-vm/#dockerfile-as-a-ci-environment # Provide easy way to force-invalidate image cache by .cirrus.yml change ARG CIRRUS_IMAGE_VERSION ENV CIRRUS_IMAGE_VERSION=$CIRRUS_IMAGE_VERSION ADD https://sh.rustup.rs /var/tmp/rustup_installer.sh RUN dnf remove -y rust && \ chmod +x /var/tmp/rustup_installer.sh && \ /var/tmp/rustup_installer.sh -y --default-toolchain stable --profile minimal ENV PATH=/root/.cargo/bin:/root/.local/bin:/root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin ================================================ FILE: contrib/cirrus/runner.sh ================================================ #!/bin/bash # This script is intended to be executed by automation or humans # under a hack/get_ci_vm.sh context. Use under any other circumstances # is unlikely to function. set -e # BEGIN Global export of all variables set -a # Due to differences across platforms and runtime execution environments, # handling of the (otherwise) default shell setup is non-uniform. Rather # than attempt to workaround differences, simply force-load/set required # items every time this library is utilized. USER="$(whoami)" HOME="$(getent passwd $USER | cut -d : -f 6)" # Some platforms set and make this read-only [[ -n "$UID" ]] || \ UID=$(getent passwd $USER | cut -d : -f 3) if [[ -r "/etc/automation_environment" ]]; then source /etc/automation_environment source $AUTOMATION_LIB_PATH/common_lib.sh else ( echo "WARNING: It does not appear that containers/automation was installed." echo " Functionality of most of ${BASH_SOURCE[0]} will be negatively" echo " impacted." ) > /dev/stderr fi # This is the magic interpreted by the tests to allow modifying local config/services. SKOPEO_CONTAINER_TESTS=1 PATH=$PATH:$GOPATH/bin # END Global export of all variables set +a _run_setup() { local mnt local errmsg req_env_vars SKOPEO_CIDEV_CONTAINER_FQIN if [[ "$OS_RELEASE_ID" != "fedora" ]]; then die "Unknown/unsupported distro. $OS_REL_VER" fi if [[ -r "/.ci_setup_complete" ]]; then warn "Thwarted an attempt to execute setup more than once." return fi # VM's come with the distro. skopeo package pre-installed dnf remove -y skopeo msg "Removing systemd-resolved from nsswitch.conf" # /etc/resolv.conf is already set to bypass systemd-resolvd sed -i -r -e 's/^(hosts.+)resolve.+dns/\1dns/' /etc/nsswitch.conf # A slew of compiled binaries are pre-built and distributed # within the CI/Dev container image, but we want to run # things directly on the host VM. Fortunately they're all # located in the container under /usr/local/bin msg "Accessing contents of $SKOPEO_CIDEV_CONTAINER_FQIN" podman pull --retry 3 --quiet $SKOPEO_CIDEV_CONTAINER_FQIN mnt=$(podman mount $(podman create $SKOPEO_CIDEV_CONTAINER_FQIN)) # The container and VM images are built in tandem in the same repo. # automation, but the sources are in different directories. It's # possible for a mismatch to happen, but should (hopefully) be unlikely. # Double-check to make sure. # Temporarily, allow running on Rawhide VMs and consuming older binaries: # that should be compatible enough. Eventually, we’ll stop using Rawhide again. if ! grep -Fqx "ID=$OS_RELEASE_ID" $mnt/etc/os-release || \ { ! [[ "$VM_IMAGE_NAME" =~ "rawhide" ]] && ! grep -Fqx "VERSION_ID=$OS_RELEASE_VER" $mnt/etc/os-release; } then die "Somehow $SKOPEO_CIDEV_CONTAINER_FQIN is not based on $OS_REL_VER." fi msg "Copying test binaries from $SKOPEO_CIDEV_CONTAINER_FQIN /usr/local/bin/" cp -a "$mnt/usr/local/bin/"* "/usr/local/bin/" msg "Configuring the openshift registry" # TODO: Put directory & yaml into more sensible place + update integration tests mkdir -vp /registry cp -a "$mnt/atomic-registry-config.yml" / msg "Cleaning up" podman umount --latest podman rm --latest # Ensure setup can only run once touch "/.ci_setup_complete" } _run_vendor() { make vendor BUILDTAGS="$BUILDTAGS" } _run_build() { make bin/skopeo BUILDTAGS="$BUILDTAGS" make install PREFIX=/usr/local BUILDTAGS="$BUILDTAGS" } _run_cross() { make local-cross BUILDTAGS="$BUILDTAGS" } _run_doccheck() { make validate-docs BUILDTAGS="$BUILDTAGS" } _run_unit() { make test-unit-local BUILDTAGS="$BUILDTAGS" } _podman_reset() { # Ensure we start with a clean-slate showrun podman system reset --force } _run_integration() { _podman_reset make test-integration-local BUILDTAGS="$BUILDTAGS" } _run_system() { _podman_reset ##### Note: Test MODIFIES THE HOST SETUP ##### make test-system-local BUILDTAGS="$BUILDTAGS" } req_env_vars SKOPEO_PATH handler="_run_${1}" if [ "$(type -t $handler)" != "function" ]; then die "Unknown/Unsupported command-line argument '$1'" fi msg "************************************************************" msg "Runner executing $1 on $OS_REL_VER" msg "************************************************************" cd "$SKOPEO_PATH" $handler ================================================ FILE: contrib/skopeoimage/README.md ================================================ The skopeo container image build context and automation have been moved to [https://github.com/containers/image_build/tree/main/skopeo](https://github.com/containers/image_build/tree/main/skopeo) ================================================ FILE: default-policy.json ================================================ { "default": [ { "type": "insecureAcceptAnything" } ], "transports": { "docker-daemon": { "": [{"type":"insecureAcceptAnything"}] } } } ================================================ FILE: default.yaml ================================================ # This is a default registries.d configuration file. You may # add to this file or create additional files in registries.d/. # # lookaside: for reading/writing simple signing signatures # lookaside-staging: for writing simple signing signatures, preferred over lookaside # # lookaside and lookaside-staging take a value of the following: # lookaside: {schema}://location # # For reading signatures, schema may be http, https, or file. # For writing signatures, schema may only be file. # The default locations are built-in, for both reading and writing: # /var/lib/containers/sigstore for root, or # ~/.local/share/containers/sigstore for non-root users. default-docker: # lookaside: https://… # lookaside-staging: file:///… # The 'docker' indicator here is the start of the configuration # for docker registries. # # docker: # # privateregistry.com: # lookaside: https://privateregistry.com/sigstore/ # lookaside-staging: /mnt/nfs/privateregistry/sigstore ================================================ FILE: docs/skopeo-copy.1.md ================================================ % skopeo-copy(1) ## NAME skopeo\-copy - Copy an image (manifest, filesystem layers, signatures) from one location to another. ## SYNOPSIS **skopeo copy** [*options*] _source-image_ _destination-image_ ## DESCRIPTION Copy an image (manifest, filesystem layers, signatures) from one location to another. Uses the system's trust policy to validate images, rejects images not trusted by the policy. _source-image_ use the "image name" format described above _destination-image_ use the "image name" format described above _source-image_ and _destination-image_ are interpreted completely independently; e.g. the destination name does not automatically inherit any parts of the source name. ## OPTIONS See also [skopeo(1)](skopeo.1.md) for options placed before the subcommand name. **--additional-tag**=_strings_ Additional tags (supports docker-archive). **--all**, **-a** If _source-image_ refers to a list of images, instead of copying just the image which matches the current OS and architecture (subject to the use of the global --override-os, --override-arch and --override-variant options), attempt to copy all of the images in the list, and the list itself. **--authfile** _path_ Path of the primary registry credentials file. On Linux, the default is ${XDG\_RUNTIME\_DIR}/containers/auth.json. See **containers-auth.json**(5) for more details about the credential search mechanism and defaults on other platforms. Use `skopeo login` to manage the credentials. The default value of this option is read from the `REGISTRY\_AUTH\_FILE` environment variable. **--src-authfile** _path_ Path of the primary registry credentials file for the source registry. Uses path given by `--authfile`, if not provided. **--dest-authfile** _path_ Path of the primary registry credentials file for the destination registry. Uses path given by `--authfile`, if not provided. **--dest-shared-blob-dir** _directory_ Directory to use to share blobs across OCI repositories. **--digestfile** _path_ After copying the image, write the digest of the resulting image to the file. **--preserve-digests** Preserve the digests during copying. Fail if the digest cannot be preserved. This option does not change what will be copied; consider using `--all` at the same time. **--encrypt-layer** _ints_ *Experimental* the 0-indexed layer indices, with support for negative indexing (e.g. 0 is the first layer, -1 is the last layer) **--format**, **-f** _manifest-type_ MANIFEST TYPE (oci, v2s1, or v2s2) to use in the destination (default is manifest type of source, with fallbacks) **--help**, **-h** Print usage statement **--multi-arch** _option_ Control what is copied if _source-image_ refers to a multi-architecture image. Default is system. Options: - system: Copy only the image that matches the system architecture - all: Copy the full multi-architecture image - index-only: Copy only the index The index-only option usually fails unless the referenced per-architecture images are already present in the destination, or the target registry supports sparse indexes. **--quiet**, **-q** Suppress output information when copying images. **--remove-signatures** Do not copy signatures, if any, from _source-image_. Necessary when copying a signed image to a destination which does not support signatures. **--sign-by** _key-id_ Add a “simple signing” signature using that key ID for an image name corresponding to _destination-image_ **--sign-by-sigstore** _param-file_ Add a sigstore signature based on the options in the specified containers sigstore signing parameter file, _param-file_. See containers-sigstore-signing-params.yaml(5) for details about the file format. **--sign-by-sigstore-private-key** _path_ Add a sigstore signature using a private key at _path_ for an image name corresponding to _destination-image_ **--sign-by-sq-fingerprint** _fingerprint_ Add a “simple signing” signature using a Sequoia-PGP key with the specified _fingerprint_. **--sign-passphrase-file** _path_ The passphrase to use when signing with `--sign-by`, `--sign-by-sigstore-private-key` or `--sign-by-sq-fingerprint`. Only the first line will be read. A passphrase stored in a file is of questionable security if other users can read this file. Do not use this option if at all avoidable. **--sign-identity** _reference_ The identity to use when signing the image. The identity must be a fully specified docker reference. If the identity is not specified, the target docker reference will be used. **--src-shared-blob-dir** _directory_ Directory to use to share blobs across OCI repositories. **--encryption-key** _protocol:keyfile_ Specifies the encryption protocol, which can be JWE (RFC7516), PGP (RFC4880), and PKCS7 (RFC2315) and the key material required for image encryption. For instance, jwe:/path/to/key.pem or pgp:admin@example.com or pkcs7:/path/to/x509-file. **--decryption-key** _key[:passphrase]_ Key to be used for decryption of images. Key can point to keys and/or certificates. Decryption will be tried with all keys. If the key is protected by a passphrase, it is required to be passed in the argument and omitted otherwise. **--src-creds** _username[:password]_ Credentials for accessing the source registry. **--dest-compress** Compress tarball image layers when saving to directory using the 'dir' transport. (default is same compression type as source). **--dest-decompress** Decompress tarball image layers when saving to directory using the 'dir' transport. (default is same compression type as source). **--dest-oci-accept-uncompressed-layers** Allow uncompressed image layers when saving to an OCI image using the 'oci' transport. (default is to compress things that aren't compressed). **--dest-creds** _username[:password]_ Credentials for accessing the destination registry. **--src-cert-dir** _path_ Use certificates at _path_ (*.crt, *.cert, *.key) to connect to the source registry or daemon. **--src-no-creds** Access the registry anonymously. **--src-tls-verify**=_bool_ Require HTTPS and verify certificates when talking to container source registry or daemon. Default to source registry setting. **--dest-cert-dir** _path_ Use certificates at _path_ (*.crt, *.cert, *.key) to connect to the destination registry or daemon. **--dest-no-creds** Access the registry anonymously. **--dest-tls-verify**=_bool_ Require HTTPS and verify certificates when talking to container destination registry or daemon. Default to destination registry setting. **--src-daemon-host** _host_ Copy from docker daemon at _host_. If _host_ starts with `tcp://`, HTTPS is enabled by default. To use plain HTTP, use the form `http://` (default is `unix:///var/run/docker.sock`). **--dest-daemon-host** _host_ Copy to docker daemon at _host_. If _host_ starts with `tcp://`, HTTPS is enabled by default. To use plain HTTP, use the form `http://` (default is `unix:///var/run/docker.sock`). Existing signatures, if any, are preserved as well. **--dest-compress-format** _format_ Specifies the compression format to use. Supported values are: `gzip`, `zstd` and `zstd:chunked`. `zstd:chunked` is incompatible with encrypting images, and will be treated as `zstd` with a warning in that case. **--dest-compress-level** _format_ Specifies the compression level to use. The value is specific to the compression algorithm used, e.g. for zstd the accepted values are in the range 1-20 (inclusive), while for gzip it is 1-9 (inclusive). **--dest-force-compress-format** Ensures that the compression algorithm set in --dest-compress-format is used exclusively. **--src-registry-token** _token_ Bearer token for accessing the source registry. **--dest-registry-token** _token_ Bearer token for accessing the destination registry. **--dest-precompute-digests** Precompute digests to ensure layers are not uploaded that already exist on the destination registry. Layers with initially unknown digests (ex. compressing "on the fly") will be temporarily streamed to disk. **--retry-times** The number of times to retry. By default, no retries are attempted. **--retry-delay** Fixed delay between retries. If not set (or set to 0s), retry wait time will be exponentially increased based on the number of failed attempts. **--src-username** The username to access the source registry. **--src-password** The password to access the source registry. **--dest-username** The username to access the destination registry. **--dest-password** The password to access the destination registry. **--image-parallel-copies** _n_ Maximum number of image layers to be copied (pulled/pushed) simultaneously. Not setting this field will fall back to containers/image defaults. ## EXAMPLES To just copy an image from one registry to another: ```console $ skopeo copy docker://quay.io/skopeo/stable:latest docker://registry.example.com/skopeo:latest ``` To copy the layers of the docker.io busybox image to a local directory: ```console $ mkdir -p /var/lib/images/busybox $ skopeo copy docker://busybox:latest dir:/var/lib/images/busybox $ ls /var/lib/images/busybox/* /tmp/busybox/2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749.tar /tmp/busybox/manifest.json /tmp/busybox/8ddc19f16526912237dd8af81971d5e4dd0587907234be2b83e249518d5b673f.tar ``` To create an archive consumable by `docker load` (but note that using a registry is almost always more efficient): ```console $ skopeo copy docker://busybox:latest docker-archive:archive-file.tar:busybox:latest ``` To copy and sign an image: ```console $ skopeo copy --sign-by dev@example.com containers-storage:example/busybox:streaming docker://example/busybox:gold ``` To encrypt an image: ```console $ skopeo copy docker://docker.io/library/nginx:1.17.8 oci:local_nginx:1.17.8 $ openssl genrsa -out private.key 1024 $ openssl rsa -in private.key -pubout > public.key $ skopeo copy --encryption-key jwe:./public.key oci:local_nginx:1.17.8 oci:try-encrypt:encrypted ``` To decrypt an image: ```console $ skopeo copy --decryption-key ./private.key oci:try-encrypt:encrypted oci:try-decrypt:decrypted ``` To copy encrypted image without decryption: ```console $ skopeo copy oci:try-encrypt:encrypted oci:try-encrypt-copy:encrypted ``` To decrypt an image that requires more than one key: ```console $ skopeo copy --decryption-key ./private1.key --decryption-key ./private2.key --decryption-key ./private3.key oci:try-encrypt:encrypted oci:try-decrypt:decrypted ``` Container images can also be partially encrypted by specifying the index of the layer. Layers are 0-indexed indices, with support for negative indexing. i.e. 0 is the first layer, -1 is the last layer. Let's say out of 3 layers that the image `docker.io/library/nginx:1.17.8` is made up of, we only want to encrypt the 2nd layer, ```console $ skopeo copy --encryption-key jwe:./public.key --encrypt-layer 1 oci:local_nginx:1.17.8 oci:try-encrypt:encrypted ``` ## SEE ALSO skopeo(1), skopeo-login(1), docker-login(1), containers-auth.json(5), containers-policy.json(5), containers-transports(5), containers-signature(5) ## AUTHORS Antonio Murdaca , Miloslav Trmac , Jhon Honce ================================================ FILE: docs/skopeo-delete.1.md ================================================ % skopeo-delete(1) ## NAME skopeo\-delete - Mark the _image-name_ for later deletion by the registry's garbage collector. ## SYNOPSIS **skopeo delete** [*options*] _image-name_ ## DESCRIPTION Mark _image-name_ for deletion. The effect of this is registry-specific; many registries don’t support this operation, or don’t allow it in some circumstances / configurations. **WARNING**: If _image-name_ contains a digest, this affects the referenced manifest, and may delete all tags (within the current repository?) pointing to that manifest. **WARNING**: If _image-name_ contains a tag (but not a digest), in the current version of Skopeo this resolves the tag into a digest, and then deletes the manifest by digest, as described above (possibly deleting all tags pointing to that manifest, not just the provided tag). This behavior may change in the future. When using the github.com/distribution/distribution registry server: To release the allocated disk space, you must login to the container registry server and execute the container registry garbage collector. E.g., ``` /usr/bin/registry garbage-collect /etc/docker-distribution/registry/config.yml ``` Note: sometimes the config.yml is stored in /etc/docker/registry/config.yml If you are running the container registry inside of a container you would execute something like: ``` $ docker exec -it registry /usr/bin/registry garbage-collect /etc/docker-distribution/registry/config.yml ``` ## OPTIONS See also [skopeo(1)](skopeo.1.md) for options placed before the subcommand name. **--authfile** _path_ Path of the primary registry credentials file. On Linux, the default is ${XDG\_RUNTIME\_DIR}/containers/auth.json. See **containers-auth.json**(5) for more details about the credential search mechanism and defaults on other platforms. Use `skopeo login` to manage the credentials. The default value of this option is read from the `REGISTRY\_AUTH\_FILE` environment variable. **--creds** _username[:password]_ Credentials for accessing the registry. **--cert-dir** _path_ Use certificates at _path_ (*.crt, *.cert, *.key) to connect to the registry. **--daemon-host** _host_ Use docker daemon host at _host_ (`docker-daemon:` transport only) **--help**, **-h** Print usage statement **--no-creds** Access the registry anonymously. Additionally, the registry must allow deletions by setting `REGISTRY_STORAGE_DELETE_ENABLED=true` for the registry daemon. **--registry-token** _token_ Bearer token for accessing the registry. **--retry-times** The number of times to retry. By default, no retries are attempted. **--retry-delay** Fixed delay between retries. If not set (or set to 0s), retry wait time will be exponentially increased based on the number of failed attempts. **--shared-blob-dir** _directory_ Directory to use to share blobs across OCI repositories. **--tls-verify**=_bool_ Require HTTPS and verify certificates when talking to the container registry or daemon. Default to registry.conf setting. **--username** The username to access the registry. **--password** The password to access the registry. ## EXAMPLES Mark image example/pause for deletion from the registry.example.com registry: ```console $ skopeo delete docker://registry.example.com/example/pause:latest ``` See above for additional details on using the command **delete**. ## SEE ALSO skopeo(1), skopeo-login(1), docker-login(1), containers-auth.json(5) ## AUTHORS Antonio Murdaca , Miloslav Trmac , Jhon Honce ================================================ FILE: docs/skopeo-generate-sigstore-key.1.md ================================================ % skopeo-generate-sigstore-key(1) ## NAME skopeo\-generate-sigstore-key - Generate a sigstore public/private key pair. ## SYNOPSIS **skopeo generate-sigstore-key** [*options*] **--output-prefix** _prefix_ ## DESCRIPTION Generates a public/private key pair suitable for creating sigstore image signatures. The private key is encrypted with a passphrase; if one is not provided using an option, this command prompts for it interactively. The private key is written to _prefix_**.private** . The public key is written to _prefix_**.pub** . ## OPTIONS See also [skopeo(1)](skopeo.1.md) for options placed before the subcommand name. **--help**, **-h** Print usage statement **--output-prefix** _prefix_ Mandatory. Path prefix for the output keys (_prefix_**.private** and _prefix_**.pub**). **--passphrase-file** _path_ The passphare to use to encrypt the private key. Only the first line will be read. A passphrase stored in a file is of questionable security if other users can read this file. Do not use this option if at all avoidable. ## EXAMPLES ```console $ skopeo generate-sigstore-key --output-prefix mykey ``` # SEE ALSO skopeo(1), skopeo-copy(1), containers-policy.json(5) ## AUTHORS Miloslav Trmač ================================================ FILE: docs/skopeo-inspect.1.md ================================================ % skopeo-inspect(1) ## NAME skopeo\-inspect - Return low-level information about _image-name_ in a registry. ## SYNOPSIS **skopeo inspect** [*options*] _image-name_ ## DESCRIPTION Return low-level information about _image-name_ in a registry. See [skopeo(1)](skopeo.1.md) for the format of _image-name_. The default output includes data from various sources: user input (**Name**), the remote repository, if any (**RepoTags**), the top-level manifest (**Digest**), and a per-architecture/OS image matching the current run-time environment (most other values). To see values for a different architecture/OS, use the **--override-os** / **--override-arch** options documented in [skopeo(1)](skopeo.1.md). ## OPTIONS See also [skopeo(1)](skopeo.1.md) for options placed before the subcommand name. **--authfile** _path_ Path of the primary registry credentials file. On Linux, the default is ${XDG\_RUNTIME\_DIR}/containers/auth.json. See **containers-auth.json**(5) for more details about the credential search mechanism and defaults on other platforms. Use `skopeo login` to manage the credentials. The default value of this option is read from the `REGISTRY\_AUTH\_FILE` environment variable. **--cert-dir** _path_ Use certificates at _path_ (\*.crt, \*.cert, \*.key) to connect to the registry. **--config** Output configuration in OCI format, default is to format in JSON format. **--creds** _username[:password]_ Username and password for accessing the registry. **--daemon-host** _host_ Use docker daemon host at _host_ (`docker-daemon:` transport only) **--format**, **-f**=*format* Format the output using the given Go template. The keys of the returned JSON can be used as the values for the --format flag (see examples below). Supports the Go templating functions available at https://pkg.go.dev/github.com/containers/common/pkg/report#hdr-Template_Functions **--help**, **-h** Print usage statement **--no-creds** Access the registry anonymously. **--raw** Output raw manifest or config data depending on --config option. The --format option is not supported with --raw option. **--registry-token** _Bearer token_ Registry token for accessing the registry. **--retry-times** The number of times to retry. By default, no retries are attempted. **--retry-delay** Fixed delay between retries. If not set (or set to 0s), retry wait time will be exponentially increased based on the number of failed attempts. **--shared-blob-dir** _directory_ Directory to use to share blobs across OCI repositories. **--tls-verify**=_bool_ Require HTTPS and verify certificates when talking to the container registry or daemon. Default to registry.conf setting. **--username** The username to access the registry. **--password** The password to access the registry. **--no-tags**, **-n** Do not list the available tags from the repository in the output. When `true`, the `RepoTags` array will be empty. Defaults to `false`, which includes all available tags. **--manifest-digest**=_algorithm_ **EXPERIMENTAL** Algorithm to use for computing manifest digest (sha256, sha512); defaults to algorithm used in config digest. **Note:** This flag is experimental and its behavior may change in future releases. ## EXAMPLES To review information for the image fedora from the docker.io registry: ```console $ skopeo inspect docker://docker.io/fedora { "Name": "docker.io/library/fedora", "Digest": "sha256:f99efcddc4dd6736d8a88cc1ab6722098ec1d77dbf7aed9a7a514fc997ca08e0", "RepoTags": [ "20", "21", "..." ], "Created": "2022-11-16T07:26:42.618327645Z", "DockerVersion": "20.10.12", "Labels": { "maintainer": "Clement Verna \u003ccverna@fedoraproject.org\u003e" }, "Architecture": "amd64", "Os": "linux", "Layers": [ "sha256:cb8b1ed77979b894115a983f391465651aa7eb3edd036be4b508eea47271eb93" ], "LayersData": [ { "MIMEType": "application/vnd.docker.image.rootfs.diff.tar.gzip", "Digest": "sha256:cb8b1ed77979b894115a983f391465651aa7eb3edd036be4b508eea47271eb93", "Size": 65990920, "Annotations": null } ], "Env": [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "DISTTAG=f37container", "FGC=f37", "FBR=f37" ] } ``` To inspect python from the docker.io registry and not show the available tags: ```console $ skopeo inspect --no-tags docker://docker.io/library/python { "Name": "docker.io/library/python", "Digest": "sha256:10fc14aa6ae69f69e4c953cffd9b0964843d8c163950491d2138af891377bc1d", "RepoTags": [], "Created": "2022-11-16T06:55:28.566254104Z", "DockerVersion": "20.10.12", "Labels": null, "Architecture": "amd64", "Os": "linux", "Layers": [ "sha256:a8ca11554fce00d9177da2d76307bdc06df7faeb84529755c648ac4886192ed1", "sha256:e4e46864aba2e62ba7c75965e4aa33ec856ee1b1074dda6b478101c577b63abd", "..." ], "LayersData": [ { "MIMEType": "application/vnd.docker.image.rootfs.diff.tar.gzip", "Digest": "sha256:a8ca11554fce00d9177da2d76307bdc06df7faeb84529755c648ac4886192ed1", "Size": 55038615, "Annotations": null }, { "MIMEType": "application/vnd.docker.image.rootfs.diff.tar.gzip", "Digest": "sha256:e4e46864aba2e62ba7c75965e4aa33ec856ee1b1074dda6b478101c577b63abd", "Size": 5164893, "Annotations": null }, "..." ], "Env": [ "PATH=/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "LANG=C.UTF-8", "...", ] } ``` ```console $ /bin/skopeo inspect --config docker://registry.fedoraproject.org/fedora --format "{{ .Architecture }}" amd64 ``` ```console $ /bin/skopeo inspect --format '{{ .Env }}' docker://registry.access.redhat.com/ubi8 [PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin container=oci] ``` To get the digest using a specific algorithm: ```console $ skopeo inspect --manifest-digest=sha512 docker://docker.io/library/alpine:latest --format "Digest: {{.Digest}}" Digest: sha512:5acb33fb56a7791bf0c69d5b19a1c70272148e4107be5261d57305d14e9509792bbca53e5277c456181ecfa1c20ad8427f9b8ba46868020584a819de1128dbd2 ``` # SEE ALSO skopeo(1), skopeo-login(1), docker-login(1), containers-auth.json(5) ## AUTHORS Antonio Murdaca , Miloslav Trmac , Jhon Honce ================================================ FILE: docs/skopeo-list-tags.1.md ================================================ % skopeo-list-tags(1) ## NAME skopeo\-list\-tags - List image names in a transport-specific collection of images. ## SYNOPSIS **skopeo list-tags** [*options*] _source-image_ Return a list of tags from _source-image_ in a registry or a local docker-archive file. _source-image_ name of the repository to retrieve a tag listing from or a local docker-archive file. ## OPTIONS See also [skopeo(1)](skopeo.1.md) for options placed before the subcommand name. **--authfile** _path_ Path of the updated registry credentials file. On Linux, the default is ${XDG\_RUNTIME\_DIR}/containers/auth.json. See **containers-auth.json**(5) for more details about the credential search mechanism and defaults on other platforms. Use `skopeo login` to manage the credentials. The default value of this option is read from the `REGISTRY\_AUTH\_FILE` environment variable. **--creds** _username[:password]_ for accessing the registry. **--cert-dir** _path_ Use certificates at _path_ (\*.crt, \*.cert, \*.key) to connect to the registry. **--help**, **-h** Print usage statement **--no-creds** Access the registry anonymously. **--registry-token** _Bearer token_ Bearer token for accessing the registry. **--retry-times** The number of times to retry. By default, no retries are attempted. **--retry-delay** Fixed delay between retries. If not set (or set to 0s), retry wait time will be exponentially increased based on the number of failed attempts. **--tls-verify**=_bool_ Require HTTPS and verify certificates when talking to the container registry or daemon. Default to registry.conf setting. **--username** The username to access the registry. **--password** The password to access the registry. ## REPOSITORY NAMES Repository names are transport-specific references as each transport may have its own concept of a "repository" and "tags". This commands refers to repositories using a _transport_`:`_details_ format. The following formats are supported: **docker://**_docker-repository-reference_ A repository in a registry implementing the "Docker Registry HTTP API V2". A _docker-repository-reference_ is of the form: **registryhost:port/repositoryname** which is similar to an _image-reference_ but with no tag or digest allowed as the last component (e.g no `:latest` or `@sha256:xyz`) Examples of valid docker-repository-references: "docker.io/myuser/myrepo" "docker.io/nginx" "docker.io/library/fedora" "localhost:5000/myrepository" Examples of invalid references: "docker.io/nginx:latest" "docker.io/myuser/myimage:v1.0" "docker.io/myuser/myimage@sha256:f48c4cc192f4c3c6a069cb5cca6d0a9e34d6076ba7c214fd0cc3ca60e0af76bb" **docker-archive:path[:docker-reference] more than one images were stored in a docker save-formatted file. ## EXAMPLES ### Docker Transport To get the list of tags in the "fedora" repository from the docker.io registry (the repository name expands to "library/fedora" per docker transport canonical form): ```console $ skopeo list-tags docker://docker.io/fedora { "Repository": "docker.io/library/fedora", "Tags": [ "20", "21", "22", "23", "24", "25", "26-modular", "26", "27", "28", "29", "30", "31", "32", "branched", "heisenbug", "latest", "modular", "rawhide" ] } ``` To list the tags in a local host docker/distribution registry on port 5000, in this case for the "fedora" repository: ```console $ skopeo list-tags docker://localhost:5000/fedora { "Repository": "localhost:5000/fedora", "Tags": [ "latest", "30", "31" ] } ``` ### Docker-archive Transport To list the tags in a local docker-archive file: ```console $ skopeo list-tags docker-archive:/tmp/busybox.tar.gz { "Tags": [ "busybox:1.28.3" ] } ``` Also supports more than one tags in an archive: ```console $ skopeo list-tags docker-archive:/tmp/docker-two-images.tar.gz { "Tags": [ "example.com/empty:latest", "example.com/empty/but:different" ] } ``` Will include a source-index entry for each untagged image: ```console $ skopeo list-tags docker-archive:/tmp/four-tags-with-an-untag.tar { "Tags": [ "image1:tag1", "image2:tag2", "@2", "image4:tag4" ] } ``` # SEE ALSO skopeo(1), skopeo-login(1), docker-login(1), containers-auth.json(5), containers-transports(1) ## AUTHORS Zach Hill ================================================ FILE: docs/skopeo-login.1.md ================================================ % skopeo-login(1) ## NAME skopeo\-login - Login to a container registry. ## SYNOPSIS **skopeo login** [*options*] _registry_ ## DESCRIPTION **skopeo login** logs into a specified registry server with the correct username and password. **skopeo login** reads in the username and password from STDIN. The username and password can also be set using the **username** and **password** flags. The path of the credentials file can be specified by the user by setting the **authfile** flag. ## OPTIONS See also [skopeo(1)](skopeo.1.md) for options placed before the subcommand name. **--password**, **-p**=*password* Password for registry **--password-stdin** Take the password from stdin **--username**, **-u**=*username* Username for registry **--authfile**=*path* Path of the managed registry credentials file. On Linux, the default is ${XDG\_RUNTIME\_DIR}/containers/auth.json. See **containers-auth.json**(5) for more details about the default on other platforms. The default value of this option is read from the `REGISTRY\_AUTH\_FILE` environment variable. **--compat-auth-file**=*path* Instead of updating the default credentials file, update the one at *path*, and use a Docker-compatible format. **--get-login** Return the logged-in user for the registry. Return error if no login is found. **--cert-dir**=*path* Use certificates at *path* (\*.crt, \*.cert, \*.key) to connect to the registry. Default certificates directory is _/etc/containers/certs.d_. **--help**, **-h** Print usage statement **--tls-verify**=_bool_ Require HTTPS and verify certificates when talking to the container registry or daemon. Default to registry.conf setting. **--verbose**, **-v** Write more detailed information to stdout ## EXAMPLES ```console $ skopeo login docker.io Username: testuser Password: Login Succeeded! ``` ```console $ skopeo login -u testuser -p testpassword localhost:5000 Login Succeeded! ``` ```console $ skopeo login --authfile authdir/myauths.json docker.io Username: testuser Password: Login Succeeded! ``` ```console $ skopeo login --tls-verify=false -u test -p test localhost:5000 Login Succeeded! ``` ```console $ skopeo login --cert-dir /etc/containers/certs.d/ -u foo -p bar localhost:5000 Login Succeeded! ``` ```console $ skopeo login -u testuser --password-stdin < testpassword.txt docker.io Login Succeeded! ``` ```console $ echo $testpassword | skopeo login -u testuser --password-stdin docker.io Login Succeeded! ``` ## SEE ALSO skopeo(1), skopeo-logout(1), containers-auth.json(5), containers-registries.conf(5), containers-certs.d.5.md ## HISTORY May 2020, Originally compiled by Qi Wang ================================================ FILE: docs/skopeo-logout.1.md ================================================ % skopeo-logout(1) ## NAME skopeo\-logout - Logout of a container registry. ## SYNOPSIS **skopeo logout** [*options*] _registry_ ## DESCRIPTION **skopeo logout** logs out of a specified registry server by deleting the cached credentials stored in the **auth.json** file. The path of the credentials file can be overridden by the user by setting the **authfile** flag. All the cached credentials can be removed by setting the **all** flag. ## OPTIONS See also [skopeo(1)](skopeo.1.md) for options placed before the subcommand name. **--authfile**=*path* Path of the managed registry credentials file. On Linux, the default is ${XDG\_RUNTIME\_DIR}/containers/auth.json. See **containers-auth.json**(5) for more details about the default on other platforms. The default value of this option is read from the `REGISTRY\_AUTH\_FILE` environment variable. **--compat-auth-file**=*path* Instead of updating the default credentials file, update the one at *path*, and use a Docker-compatible format. **--all**, **-a** Remove the cached credentials for all registries in the auth file **--help**, **-h** Print usage statement **--tls-verify**=_bool_ Require HTTPS and verify certificates when talking to the container registry or daemon. Default to registry.conf setting. ## EXAMPLES ```console $ skopeo logout docker.io Remove login credentials for docker.io ``` ```console $ skopeo logout --authfile authdir/myauths.json docker.io Remove login credentials for docker.io ``` ```console $ skopeo logout --all Remove login credentials for all registries ``` ## SEE ALSO skopeo(1), skopeo-login(1), containers-auth.json(5) ## HISTORY May 2020, Originally compiled by Qi Wang ================================================ FILE: docs/skopeo-manifest-digest.1.md ================================================ % skopeo-manifest-digest(1) ## NAME skopeo\-manifest\-digest - Compute a manifest digest for a manifest-file and write it to standard output. ## SYNOPSIS **skopeo manifest-digest** _manifest-file_ ## DESCRIPTION Compute a manifest digest of _manifest-file_ and write it to standard output. ## OPTIONS **--help**, **-h** Print usage statement ## EXAMPLES ```console $ skopeo manifest-digest manifest.json sha256:a59906e33509d14c036c8678d687bd4eec81ed7c4b8ce907b888c607f6a1e0e6 ``` ## SEE ALSO skopeo(1) ## AUTHORS Antonio Murdaca , Miloslav Trmac , Jhon Honce ================================================ FILE: docs/skopeo-standalone-sign.1.md ================================================ % skopeo-standalone-sign(1) ## NAME skopeo\-standalone-sign - Debugging tool - Sign an image locally without uploading. ## SYNOPSIS **skopeo standalone-sign** [*options*] _manifest_ _docker-reference_ _key-fingerprint_ **--output**|**-o** _signature_ ## DESCRIPTION This is primarily a debugging tool, useful for special cases, and usually should not be a part of your normal operational workflow; use `skopeo copy --sign-by` instead to publish and sign an image in one step. _manifest_ Path to a file containing the image manifest _docker-reference_ A docker reference to identify the image with _key-fingerprint_ Key identity to use for signing ## OPTIONS See also [skopeo(1)](skopeo.1.md) for options placed before the subcommand name. **--help**, **-h** Print usage statement **--output**, **-o** _output file_ Write signature to _output file_. **--passphrase-file**=_path_ The passphare to use when signing with the key ID from `--sign-by`. Only the first line will be read. A passphrase stored in a file is of questionable security if other users can read this file. Do not use this option if at all avoidable. ## EXAMPLES ```console $ skopeo standalone-sign busybox-manifest.json registry.example.com/example/busybox 1D8230F6CDB6A06716E414C1DB72F2188BB46CC8 --output busybox.signature $ ``` ## NOTES This command is intended for use with local signatures e.g. OpenPGP ( other signature formats may be added in the future ), as per containers-signature(5). Furthermore, this command does **not** interact with the artifacts generated by Docker Content Trust (DCT). For more information, please see [containers-signature(5)](https://github.com/containers/image/blob/main/docs/containers-signature.5.md). ## SEE ALSO skopeo(1), skopeo-copy(1), containers-signature(5) ## AUTHORS Antonio Murdaca , Miloslav Trmac , Jhon Honce ================================================ FILE: docs/skopeo-standalone-verify.1.md ================================================ % skopeo-standalone-verify(1) ## NAME skopeo\-standalone\-verify - Debugging tool - Verify an image signature from local files. ## SYNOPSIS **skopeo standalone-verify** _manifest_ _docker-reference_ _key-fingerprints_ _signature_ ## DESCRIPTION Verify a signature using local files; the digest will be printed on success. This is primarily a debugging tool, useful for special cases, and usually should not be a part of your normal operational workflow. Additionally, consider configuring a signature verification policy file, as per containers-policy.json(5). _manifest_ Path to a file containing the image manifest _docker-reference_ A docker reference expected to identify the image in the signature _key-fingerprints_ Identities of trusted signing keys (comma separated), or "any" to trust any known key when using a public key file _signature_ Path to signature file **Note:** If you do use this, make sure that the image can not be changed at the source location between the times of its verification and use. ## OPTIONS See also [skopeo(1)](skopeo.1.md) for options placed before the subcommand name. **--help**, **-h** Print usage statement **--public-key-file** _public key file_ File containing the public keys to use when verifying signatures. If this is not specified, keys from the GPG homedir are used. ## EXAMPLES ```console $ skopeo standalone-verify busybox-manifest.json registry.example.com/example/busybox 1D8230F6CDB6A06716E414C1DB72F2188BB46CC8 busybox.signature Signature verified, digest sha256:20bf21ed457b390829cdbeec8795a7bea1626991fda603e0d01b4e7f60427e55 ``` ## NOTES This command is intended for use with local signatures e.g. OpenPGP ( other signature formats may be added in the future ), as per containers-signature(5). Furthermore, this command does **not** interact with the artifacts generated by Docker Content Trust (DCT). For more information, please see [containers-signature(5)](https://github.com/containers/image/blob/main/docs/containers-signature.5.md). ## SEE ALSO skopeo(1), containers-signature(5), containers-policy.json(5) ## AUTHORS Antonio Murdaca , Miloslav Trmac , Jhon Honce ================================================ FILE: docs/skopeo-sync.1.md ================================================ % skopeo-sync(1) ## NAME skopeo\-sync - Synchronize images between registry repositories and local directories. ## SYNOPSIS **skopeo sync** [*options*] --src _transport_ --dest _transport_ _source_ _destination_ ## DESCRIPTION Synchronize images between registry repositories and local directories. Synchronization is achieved by copying all the images found at _source_ to _destination_ - useful when synchronizing a local container registry mirror or for populating registries running inside of air-gapped environments. Differently from other skopeo commands, skopeo sync requires both source and destination transports to be specified separately from _source_ and _destination_. One of the problems of prefixing a destination with its transport is that, the registry `docker://hostname:port` would be wrongly interpreted as an image reference at a non-fully qualified registry, with `hostname` and `port` the image name and tag. Available _source_ transports: - _docker_ (i.e. `--src docker`): _source_ is a repository hosted on a container registry (e.g.: `registry.example.com/busybox`). If no image tag is specified, skopeo sync copies all the tags found in that repository. - _dir_ (i.e. `--src dir`): _source_ is a local directory path (e.g.: `/media/usb/`). Refer to skopeo(1) **dir:**_path_ for the local image format. - _yaml_ (i.e. `--src yaml`): _source_ is local YAML file path. The YAML file should specify the list of images copied from different container registries (local directories are not supported). Refer to EXAMPLES for the file format. Available _destination_ transports: - _docker_ (i.e. `--dest docker`): _destination_ is a container registry (e.g.: `my-registry.local.lan`). - _dir_ (i.e. `--dest dir`): _destination_ is a local directory path (e.g.: `/media/usb/`). One directory per source 'image:tag' is created for each copied image. When the `--scoped` option is specified, images are prefixed with the source image path so that multiple images with the same name can be stored at _destination_. ## OPTIONS See also [skopeo(1)](skopeo.1.md) for options placed before the subcommand name. **--all**, **-a** If one of the images in __src__ refers to a list of images, instead of copying just the image which matches the current OS and architecture (subject to the use of the global --override-os, --override-arch and --override-variant options), attempt to copy all of the images in the list, and the list itself. **--authfile** _path_ Path of the primary registry credentials file. On Linux, the default is ${XDG\_RUNTIME\_DIR}/containers/auth.json. See **containers-auth.json**(5) for more details about the credential search mechanism and defaults on other platforms. Use `skopeo login` to manage the credentials. The default value of this option is read from the `REGISTRY\_AUTH\_FILE` environment variable. **--src-authfile** _path_ Path of the primary registry credentials file for the source registry. Uses path given by `--authfile`, if not provided. **--dest-authfile** _path_ Path of the primary registry credentials file for the destination registry. Uses path given by `--authfile`, if not provided. **--dry-run** Run the sync without actually copying data to the destination. **--src**, **-s** _transport_ Transport for the source repository. **--dest**, **-d** _transport_ Destination transport. **--format**, **-f** _manifest-type_ Manifest Type (oci, v2s1, or v2s2) to use when syncing image(s) to a destination (default is manifest type of source, with fallbacks). **--help**, **-h** Print usage statement. **--scoped** Prefix images with the source image path, so that multiple images with the same name can be stored at _destination_. **--append-suffix** _tag-suffix_ String to append to destination tags. **--digestfile** _path_ After copying the images from source, write the digest of the resulting images along with Image Reference. ``` sha256:bf91f90823248017a4f920fb541727fa8368dc6cf377a7debbd271cf6a31c8a7 docker://myhost.com/alpine:edge sha256:31603596830fc7e56753139f9c2c6bd3759e48a850659506ebfb885d1cf3aef5 docker://myhost.com/postgres:14.3 ``` **--preserve-digests** Preserve the digests during copying. Fail if the digest cannot be preserved. This option does not change what will be copied; consider using `--all` at the same time. **--remove-signatures** Do not copy signatures, if any, from _source-image_. This is necessary when copying a signed image to a destination which does not support signatures. **--sign-by** _key-id_ Add a “simple signing” signature using that key ID for an image name corresponding to _destination-image_ **--sign-by-sigstore** _param-file_ Add a sigstore signature based on the options in the specified containers sigstore signing parameter file, _param-file_. See containers-sigstore-signing-params.yaml(5) for details about the file format. **--sign-by-sigstore-private-key** _path_ Add a sigstore signature using a private key at _path_ for an image name corresponding to _destination-image_ **--sign-by-sq-fingerprint** _fingerprint_ Add a “simple signing” signature using a Sequoia-PGP key with the specified _fingerprint_. **--sign-passphrase-file** _path_ The passphrase to use when signing with `--sign-by`, `--sign-by-sigstore-private-key` or `--sign-by-sq-fingerprint`. Only the first line will be read. A passphrase stored in a file is of questionable security if other users can read this file. Do not use this option if at all avoidable. **--src-creds** _username[:password]_ for accessing the source registry. **--dest-creds** _username[:password]_ for accessing the destination registry. **--src-cert-dir** _path_ Use certificates (*.crt, *.cert, *.key) at _path_ to connect to the source registry or daemon. **--src-no-creds** Access the registry anonymously. **--src-tls-verify**=_bool_ Require HTTPS and verify certificates when talking to a container source registry or daemon. Default to source registry entry in registry.conf setting. **--dest-cert-dir** _path_ Use certificates (*.crt, *.cert, *.key) at _path_ to connect to the destination registry or daemon. **--dest-no-creds** Access the registry anonymously. **--dest-tls-verify**=_bool_ Require HTTPS and verify certificates when talking to a container destination registry or daemon. Default to destination registry entry in registry.conf setting. **--src-registry-token** _Bearer token_ for accessing the source registry. **--dest-registry-token** _Bearer token_ for accessing the destination registry. **--retry-times** The number of times to retry. By default, no retries are attempted. **--retry-delay** Fixed delay between retries. If not set (or set to 0s), retry wait time will be exponentially increased based on the number of failed attempts. **--keep-going** If any errors occur during copying of images, those errors are logged and the process continues syncing rest of the images and finally fails at the end. **--src-username** The username to access the source registry. **--src-password** The password to access the source registry. **--dest-username** The username to access the destination registry. **--dest-password** The password to access the destination registry. ## EXAMPLES ### Synchronizing to a local directory ```console $ skopeo sync --src docker --dest dir registry.example.com/busybox /media/usb ``` Images are located at: ``` /media/usb/busybox:1-glibc /media/usb/busybox:1-musl /media/usb/busybox:1-ubuntu ... /media/usb/busybox:latest ``` ### Synchronizing to a container registry from local Images are located at: ``` /media/usb/busybox:1-glibc ``` Sync run ```console $ skopeo sync --src dir --dest docker /media/usb/busybox:1-glibc my-registry.local.lan/test/ ``` Destination registry content: ``` REPO TAGS my-registry.local.lan/test/busybox 1-glibc ``` ### Synchronizing to a local directory, scoped ```console $ skopeo sync --src docker --dest dir --scoped registry.example.com/busybox /media/usb ``` Images are located at: ``` /media/usb/registry.example.com/busybox:1-glibc /media/usb/registry.example.com/busybox:1-musl /media/usb/registry.example.com/busybox:1-ubuntu ... /media/usb/registry.example.com/busybox:latest ``` ### Synchronizing to a container registry ```console $ skopeo sync --src docker --dest docker registry.example.com/busybox my-registry.local.lan ``` Destination registry content: ``` REPO TAGS registry.local.lan/busybox 1-glibc, 1-musl, 1-ubuntu, ..., latest ``` ### Synchronizing to a container registry keeping the repository ```console $ skopeo sync --src docker --dest docker registry.example.com/repo/busybox my-registry.local.lan/repo ``` Destination registry content: ``` REPO TAGS registry.local.lan/repo/busybox 1-glibc, 1-musl, 1-ubuntu, ..., latest ``` ### Synchronizing to a container registry with tag suffix ```console $ skopeo sync --src docker --dest docker --append-suffix '-mirror' registry.example.com/busybox my-registry.local.lan ``` Destination registry content: ``` REPO TAGS registry.local.lan/busybox 1-glibc-mirror, 1-musl-mirror, 1-ubuntu-mirror, ..., latest-mirror ``` ### YAML file content (used _source_ for `**--src yaml**`) ```yaml registry.example.com: images: busybox: [] redis: - "1.0" - "2.0" - "sha256:0000000000000000000000000000000011111111111111111111111111111111" images-by-tag-regex: nginx: ^1\.13\.[12]-alpine-perl$ images-by-semver: alpine: ">= 3.12.0" credentials: username: john password: this is a secret tls-verify: true cert-dir: /home/john/certs quay.io: tls-verify: false images: coreos/etcd: - latest ``` If the yaml filename is `sync.yml`, sync run: ```console $ skopeo sync --src yaml --dest docker sync.yml my-registry.local.lan/repo/ ``` This will copy the following images: - Repository `registry.example.com/busybox`: all images, as no tags are specified. - Repository `registry.example.com/redis`: images tagged "1.0" and "2.0" along with image with digest "sha256:0000000000000000000000000000000011111111111111111111111111111111". - Repository `registry.example.com/nginx`: images tagged "1.13.1-alpine-perl" and "1.13.2-alpine-perl". - Repository `quay.io/coreos/etcd`: images tagged "latest". - Repository `registry.example.com/alpine`: all images with tags match the semantic version constraint ">= 3.12.0" ("3.12.0, "3.12.1", ... ,"4.0.0", ...) The full list of possible semantic version comparisons can be found in the upstream library's documentation: https://github.com/Masterminds/semver/tree/v3.2.0#basic-comparisons. Version ordering and precedence is understood as defined here: https://semver.org/#spec-item-11. For the registry `registry.example.com`, the "john"/"this is a secret" credentials are used, with server TLS certificates located at `/home/john/certs`. TLS verification is normally enabled, and it can be disabled setting `tls-verify` to `false`. In the above example, TLS verification is enabled for `registry.example.com`, while is disabled for `quay.io`. ## SEE ALSO skopeo(1), skopeo-login(1), docker-login(1), containers-auth.json(5), containers-policy.json(5), containers-transports(5) ## AUTHORS Flavio Castelli , Marco Vedovati ================================================ FILE: docs/skopeo.1.md ================================================ % SKOPEO(1) Skopeo Man Pages % Jhon Honce % August 2016 ## NAME skopeo -- Command line utility used to interact with local and remote container images and container image registries ## SYNOPSIS **skopeo** [_global options_] _command_ [_command options_] ## DESCRIPTION `skopeo` is a command line utility providing various operations with container images and container image registries. `skopeo` can copy container images between various containers image stores, converting them as necessary. For example you can use `skopeo` to copy container images from one container registry to another. `skopeo` can convert a Docker schema 2 or schema 1 container image to an OCI image. `skopeo` can inspect a repository on a container registry without needlessly pulling the image. Pulling an image from a repository, especially a remote repository, is an expensive network and storage operation. Skopeo fetches the repository's manifest and displays a `docker inspect`-like json output about the repository or a tag. `skopeo`, in contrast to `docker inspect`, helps you gather useful information about a repository or a tag without requiring you to run `docker pull` - e.g. - Which tags are available for the given repository? Which labels does the image have? `skopeo` can sign and verify container images. `skopeo` can delete container images from a remote container registry. Note: `skopeo` does not require any container runtimes to be running, to do most of its functionality. It also does not require root, unless you are copying images into a container runtime storage backend, like the docker daemon or github.com/containers/storage. ## IMAGE NAMES Most commands refer to container images, using a _transport_`:`_details_ format. The following formats are supported: **containers-storage:**_docker-reference_ An image located in a local containers/storage image store. Both the location and image store are specified in /etc/containers/storage.conf. (Backend for Podman, CRI-O, Buildah and friends) **dir:**_path_ An existing local directory _path_ storing the manifest, layer tarballs and signatures as individual files. This is a non-standardized format, primarily useful for debugging or noninvasive container inspection. **docker://**_docker-reference_ An image in a registry implementing the "Docker Registry HTTP API V2". Credentials are typically managed using `(skopeo login)`; see **containers-auth.json**(5) for more details about the credential search mechanism. **docker-archive:**_path_[**:**_docker-reference_] An image is stored in the `docker save` formatted file. _docker-reference_ is only used when creating such a file, and it must not contain a digest. **docker-daemon:**_docker-reference_ An image _docker-reference_ stored in the docker daemon internal storage. _docker-reference_ must contain either a tag or a digest. Alternatively, when reading images, the format can be docker-daemon:algo:digest (an image ID). **oci:**_path_**:**_tag_ An image _tag_ in a directory compliant with "Open Container Image Layout Specification" at _path_. **oci-archive:**_path_**:**_tag_ An image _tag_ in a tar archive compliant with "Open Container Image Layout Specification" at _path_. See [containers-transports(5)](https://github.com/containers/image/blob/main/docs/containers-transports.5.md) for details. ## OPTIONS These options should be placed before the subcommand name. Individual subcommands have their own options. **--command-timeout** _duration_ Timeout for the command execution. **--debug** enable debug output **--help**, **-h** Show help **--insecure-policy** Adopt an insecure, permissive policy that allows anything. This obviates the need for a policy file. **--override-arch** _arch_ Use _arch_ instead of the architecture of the machine for choosing images. **--override-os** _os_ Use _OS_ instead of the running OS for choosing images. **--override-variant** _variant_ Use _variant_ instead of the running architecture variant for choosing images. **--policy** _path-to-policy_ Path to a policy.json file to use for verifying signatures and deciding whether an image is trusted, overriding the default trust policy file. **--registries.d** _dir_ Use registry configuration files in _dir_ (e.g. for container signature storage), overriding the default path. **--require-signed** Require that any pulled image must be signed regardless of what the default or provided trust policy file says. **--tls-details** _path_ Path to a containers-tls-details(5) file, affecting TLS behavior throughout the program. If not set, defaults to a reasonable default that may change over time (depending on system’s global policy, version of the program, version of the Go language, and the like). Users should generally not use this option unless they have a process to ensure that the configuration will be kept up to date. **--tmpdir** _dir_ Directory used to store temporary files. Defaults to /var/tmp. **--user-agent-prefix** _prefix_ Prefix to add to the user agent string. The resulting user agent will be in the format "_prefix_ skopeo/_version_". **--version**, **-v** Print the version number ## COMMANDS | Command | Description | | ----------------------------------------- | ------------------------------------------------------------------------------ | | [skopeo-copy(1)](skopeo-copy.1.md) | Copy an image (manifest, filesystem layers, signatures) from one location to another. | | [skopeo-delete(1)](skopeo-delete.1.md) | Mark the _image-name_ for later deletion by the registry's garbage collector. | | [skopeo-generate-sigstore-key(1)](skopeo-generate-sigstore-key.1.md) | Generate a sigstore public/private key pair. | | [skopeo-inspect(1)](skopeo-inspect.1.md) | Return low-level information about _image-name_ in a registry. | | [skopeo-list-tags(1)](skopeo-list-tags.1.md) | List image names in a transport-specific collection of images.| | [skopeo-login(1)](skopeo-login.1.md) | Login to a container registry. | | [skopeo-logout(1)](skopeo-logout.1.md) | Logout of a container registry. | | [skopeo-manifest-digest(1)](skopeo-manifest-digest.1.md) | Compute a manifest digest for a manifest-file and write it to standard output. | | [skopeo-standalone-sign(1)](skopeo-standalone-sign.1.md) | Debugging tool - Sign an image locally without uploading. | | [skopeo-standalone-verify(1)](skopeo-standalone-verify.1.md)| Debugging tool - Verify an image signature from local files. | | [skopeo-sync(1)](skopeo-sync.1.md)| Synchronize images between registry repositories and local directories. | ## EXIT STATUS `skopeo` exits with status 0 on success, non-zero on error. Details about the exit statuses: **1** Generic error, details can be found in the error message. **2** The input image cannot be found. Note that this is best effort and for remote registries the status often cannot be reliably reported. ## FILES **/etc/containers/policy.json** Default trust policy file, if **--policy** is not specified. The policy format is documented in [containers-policy.json(5)](https://github.com/containers/image/blob/main/docs/containers-policy.json.5.md) . **/etc/containers/registries.d** Default directory containing registry configuration, if **--registries.d** is not specified. The contents of this directory are documented in [containers-registries.d(5)](https://github.com/containers/image/blob/main/docs/containers-registries.d.5.md). ## SEE ALSO skopeo-login(1), docker-login(1), containers-auth.json(5), containers-storage.conf(5), containers-policy.json(5), containers-transports(5) ## AUTHORS Antonio Murdaca , Miloslav Trmac , Jhon Honce ================================================ FILE: docs-experimental/skopeo-experimental-image-proxy.1.md ================================================ % skopeo-experimental-image-proxy(1) # NAME skopeo-experimental-image-proxy - API server for fetching container images (EXPERIMENTAL) # SYNOPSIS **skopeo experimental-image-proxy** [*options*] # DESCRIPTION **EXPERIMENTAL COMMAND**: This command is experimental, and its API is subject to change. It is currently hidden from the main help output and not supported on Windows. `skopeo experimental-image-proxy` exposes core container image fetching APIs via custom JSON+fd-passing protocol. This provides a lightweight way to fetch container image content (manifests and blobs). This command is primarily intended for programs that want to operate on a storage type that skopeo doesn't natively handle. For example, the bootc project currently has a custom ostree-based container storage backend. The client process that invokes `skopeo experimental-image-proxy` is responsible for creating a socket pair and passing one of the file descriptors to the proxy. By default, the proxy expects this file descriptor to be its standard input (fd 0), but a different fd can be specified using the **--sockfd** option. **Protocol Overview** The protocol requires a `socketpair(2)` of type `SOCK_SEQPACKET`, over which a single JSON message is sent per packet. Large data payloads, such as image manifests and blobs, are transferred over separate pipes (`pipe(2)`), with the read-ends of these pipes passed to the client via file descriptor (FD) passing. * **Request Format**: A JSON object: `{ "method": "MethodName", "args": [arguments] }` * **Reply Format**: A JSON object: `{ "success": boolean, "value": JSONValue, "pipeid": number, "error_code": string, "error": string }` * `success`: `true` if the call succeeded, `false` otherwise. * `value`: The return value of the method, if any. * `pipeid`: An integer identifying a pipe for data transfer. This ID is used with the `FinishPipe` method. * `error_code`: A string indicating the type of error if `success` is `false` (e.g., "EPIPE", "retryable", "other"). (Introduced in protocol version 0.2.8) * `error`: A string describing the error if `success` is `false`. The current protocol version is `0.2.8`. **Supported Protocol Methods** The server supports the following methods: * **Initialize**: Initializes the proxy. This method must be called before any other method. * Args: `[]` (empty array) * Returns: `string` (the protocol version, e.g., "0.2.8") * **OpenImage**: Opens an image reference (e.g., `docker://quay.io/example/image:latest`). * Args: `[string imageName]` * Returns: `uint64` (an opaque image ID to be used in subsequent calls) * **OpenImageOptional**: Similar to `OpenImage`, but if the image is not found, it returns `0` (a sentinel image ID) instead of an error. * Args: `[string imageName]` * Returns: `uint64` (opaque image ID, or `0` if the image is not found) * **CloseImage**: Closes a previously opened image, releasing associated resources. * Args: `[uint64 imageID]` * Returns: `null` * **GetManifest**: Retrieves the image manifest. If the image is a manifest list, it is resolved to an image matching the proxy's current OS and architecture. The manifest is converted to OCI format if it isn't already. The `value` field in the reply contains the original digest of the manifest (if the image is a manifest list, this is the digest of the list, not the per-platform instance). The manifest content is streamed over a pipe. * Args: `[uint64 imageID]` * Returns: `string` (manifest digest in `value`), manifest data via pipe. * **GetFullConfig**: Retrieves the full image configuration, conforming to the OCI Image Format Specification. Configuration data is streamed over a pipe. * Args: `[uint64 imageID]` * Returns: `null`, configuration data via pipe. * **GetBlob**: Fetches an image blob (e.g., a layer) by its digest and expected size. The proxy performs digest verification on the blob data. The `value` field in the reply contains the blob size. Blob data is streamed over a pipe. * Args: `[uint64 imageID, string digest, uint64 size]` * Returns: `int64` (blob size in `value`, `-1` if unknown), blob data via pipe. * **GetRawBlob**: Fetches an image blob by its digest. Unlike `GetBlob`, this method does not perform server-side digest verification. It returns two file descriptors to the client: one for the blob data and another for reporting errors that occur during the streaming. This method does not use the `FinishPipe` mechanism. The `value` field in the reply contains the blob size. (Introduced in protocol version 0.2.8) * Args: `[uint64 imageID, string digest]` * Returns: `int64` (blob size in `value`, `-1` if unknown), and *two* file descriptors: one for the blob data, one for errors. The error is a `ProxyError` type, see below. * **GetLayerInfoPiped**: Retrieves information about image layers. This replaces `GetLayerInfo`. Layer information data is streamed over a pipe, which makes it more reliable for images with many layers that would exceed message size limits with `GetLayerInfo`. The returned data is a JSON array of `{digest: string, size: int64, media_type: string}`. (Introduced in protocol version 0.2.7) * Args: `[uint64 imageID]` * Returns: `null`, layer information data via pipe. * **FinishPipe**: Signals that the client has finished reading all data from a pipe associated with a `pipeid` (obtained from methods like `GetManifest` or `GetBlob`). This allows the server to close its end of the pipe and report any pending errors (e.g., digest verification failure for `GetBlob`). This method **must** be called by the client after consuming data from a pipe, except for pipes from `GetRawBlob`. * Args: `[uint32 pipeID]` * Returns: `null` * **Shutdown**: Instructs the proxy server to terminate gracefully. * Args: `[]` (empty array) * Returns: `null` The following methods are deprecated: * **GetConfig**: (deprecated) Retrieves the container runtime configuration part of the image (the OCI `config` field). **Note**: This method returns only a part of the full image configuration due to a historical oversight. Use `GetFullConfig` for the complete image configuration. Configuration data is streamed over a pipe. * Args: `[uint64 imageID]` * Returns: `null`, configuration data via pipe. * **GetLayerInfo**: (deprecated) Retrieves an array of objects, each describing an image layer (digest, size, mediaType). **Note**: This method returns data inline and may fail for images with many layers due to message size limits. Use `GetLayerInfoPiped` for a more robust solution. * Args: `[uint64 imageID]` * Returns: `array` of `{digest: string, size: int64, media_type: string}`. **Data Transfer for Pipes** When a method returns a `pipeid`, the server also passes the read-end of a pipe via file descriptor (FD) passing. The client reads the data (e.g., manifest content, blob content) from this FD. After successfully reading all data, the client **must** call `FinishPipe` with the corresponding `pipeid`. This signals to the server that the transfer is complete, allows the server to clean up resources, and enables the client to check for any errors that might have occurred during the data streaming process (e.g., a digest mismatch during `GetBlob`). The `GetRawBlob` method is an exception; it uses a dedicated error pipe instead of the `FinishPipe` mechanism. **ProxyError** `GetBlobRaw` returns a JSON object of the following form in the error pipe where: ``` { "code": "EPIPE" | "retryable" | "other", "message": "error message" } ``` - EPIPE: The client closed the pipe before reading all data. - retryable: The operation failed but might succeed if retried. - other: A generic error occurred. # OPTIONS **--sockfd**=*fd* Serve on the opened socket passed as file descriptor *fd*. Defaults to 0 (standard input). The command also supports common skopeo options for interacting with image registries and local storage. These include: **--authfile**=*path* Path of the primary registry credentials file. On Linux, the default is ${XDG\_RUNTIME\_DIR}/containers/auth.json. See **containers-auth.json**(5) for more details about the credential search mechanism and defaults on other platforms. Use `skopeo login` to manage the credentials. The default value of this option is read from the `REGISTRY\_AUTH\_FILE` environment variable. **--cert-dir**=*path* Use certificates at *path* (\*.crt, \*.cert, \*.key) to connect to the registry. **--creds** _username[:password]_ Username and password for accessing the registry. **--daemon-host** _host_ Use docker daemon host at _host_ (`docker-daemon:` transport only) **--no-creds** Access the registry anonymously. **--password**=*password* Password for accessing the registry. Use with **--username**. **--registry-token**=*token* Provide a Bearer *token* for accessing the registry. **--shared-blob-dir** _directory_ Directory to use to share blobs across OCI repositories. **--tls-verify**=_bool_ Require HTTPS and verify certificates when talking to the container registry or daemon. Default to registry.conf setting. **--username**=*username* Username for accessing the registry. Use with **--password**. # REFERENCE CLIENT LIBRARIES - Rust: The [containers-image-proxy-rs project](https://github.com/containers/containers-image-proxy-rs) serves as the reference Rust client. # PROTOCOL HISTORY - 0.2.1: Initial version - 0.2.2: Added support for fetching image configuration as OCI - 0.2.3: Added GetFullConfig - 0.2.4: Added OpenImageOptional - 0.2.5: Added LayerInfoJSON - 0.2.6: Policy Verification before pulling OCI - 0.2.7: Added GetLayerInfoPiped - 0.2.8: Added GetRawBlob and error_code to replies ## SEE ALSO skopeo(1), containers-auth.json(5) ================================================ FILE: go.mod ================================================ module github.com/containers/skopeo // Minimum required golang version go 1.25.0 // Warning: Ensure the "go" and "toolchain" versions match exactly to prevent unwanted auto-updates require ( github.com/Masterminds/semver/v3 v3.4.0 github.com/containers/ocicrypt v1.2.1 github.com/docker/distribution v2.8.3+incompatible github.com/moby/sys/capability v0.4.0 github.com/opencontainers/go-digest v1.0.0 github.com/opencontainers/image-spec v1.1.2-0.20260226102121-a4c6ade7bb82 github.com/opencontainers/image-tools v1.0.0-rc3 github.com/sirupsen/logrus v1.9.4 github.com/spf13/cobra v1.10.2 github.com/spf13/pflag v1.0.10 github.com/stretchr/testify v1.11.1 go.podman.io/common v0.67.1-0.20260319154331-44a8de38c431 go.podman.io/image/v5 v5.39.2-0.20260313202710-ddaabae34a06 go.podman.io/storage v1.62.1-0.20260316152041-ebc34488c338 golang.org/x/term v0.41.0 gopkg.in/yaml.v3 v3.0.1 ) require ( cyphar.com/go-pathrs v0.2.4 // indirect dario.cat/mergo v1.0.2 // indirect github.com/BurntSushi/toml v1.6.0 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/VividCortex/ewma v1.2.0 // indirect github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/clipperhouse/uax29/v2 v2.7.0 // indirect github.com/containerd/errdefs v1.0.0 // indirect github.com/containerd/errdefs/pkg v0.3.0 // indirect github.com/containerd/stargz-snapshotter/estargz v0.18.2 // indirect github.com/containers/libtrust v0.0.0-20230121012942-c1716e8a8d01 // indirect github.com/coreos/go-oidc/v3 v3.17.0 // indirect github.com/cyberphone/json-canonicalization v0.0.0-20241213102144-19d51d7fe467 // indirect github.com/cyphar/filepath-securejoin v0.6.1 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/distribution/reference v0.6.0 // indirect github.com/docker/docker-credential-helpers v0.9.5 // indirect github.com/docker/go-connections v0.6.0 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/go-jose/go-jose/v4 v4.1.3 // indirect github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/google/go-containerregistry v0.20.7 // indirect github.com/google/go-intervals v0.0.2 // indirect github.com/google/uuid v1.6.0 // indirect github.com/gorilla/mux v1.8.1 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-multierror v1.1.2-0.20250313123807-1ee6e1a1957a // indirect github.com/hashicorp/go-retryablehttp v0.7.8 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.18.4 // indirect github.com/klauspost/pgzip v1.2.6 // indirect github.com/mattn/go-runewidth v0.0.20 // indirect github.com/mattn/go-sqlite3 v1.14.34 // indirect github.com/miekg/pkcs11 v1.1.1 // indirect github.com/mistifyio/go-zfs/v4 v4.0.0 // indirect github.com/moby/docker-image-spec v1.3.1 // indirect github.com/moby/moby/api v1.54.0 // indirect github.com/moby/moby/client v0.3.0 // indirect github.com/moby/sys/mountinfo v0.7.2 // indirect github.com/moby/sys/user v0.4.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect github.com/opencontainers/image-spec/schema v0.0.0-20250717171153-ab80ff15c2dd // indirect github.com/opencontainers/runtime-spec v1.3.0 // indirect github.com/opencontainers/selinux v1.13.1 // indirect github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/proglottis/gpgme v0.1.6 // indirect github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 // indirect github.com/secure-systems-lab/go-securesystemslib v0.10.0 // indirect github.com/sigstore/fulcio v1.8.5 // indirect github.com/sigstore/protobuf-specs v0.5.0 // indirect github.com/sigstore/sigstore v1.10.4 // indirect github.com/smallstep/pkcs7 v0.1.1 // indirect github.com/stefanberger/go-pkcs11uri v0.0.0-20230803200340-78284954bff6 // indirect github.com/sylabs/sif/v2 v2.22.0 // indirect github.com/tchap/go-patricia/v2 v2.3.3 // indirect github.com/ulikunitz/xz v0.5.15 // indirect github.com/vbatts/tar-split v0.12.2 // indirect github.com/vbauerster/mpb/v8 v8.12.0 // indirect go.opentelemetry.io/auto/sdk v1.2.1 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.65.0 // indirect go.opentelemetry.io/otel v1.40.0 // indirect go.opentelemetry.io/otel/metric v1.40.0 // indirect go.opentelemetry.io/otel/trace v1.40.0 // indirect golang.org/x/crypto v0.49.0 // indirect golang.org/x/net v0.51.0 // indirect golang.org/x/oauth2 v0.36.0 // indirect golang.org/x/sync v0.20.0 // indirect golang.org/x/sys v0.42.0 // indirect golang.org/x/text v0.35.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20260128011058-8636f8732409 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20260128011058-8636f8732409 // indirect google.golang.org/grpc v1.78.0 // indirect google.golang.org/protobuf v1.36.11 // indirect ) ================================================ FILE: go.sum ================================================ cyphar.com/go-pathrs v0.2.4 h1:iD/mge36swa1UFKdINkr1Frkpp6wZsy3YYEildj9cLY= cyphar.com/go-pathrs v0.2.4/go.mod h1:y8f1EMG7r+hCuFf/rXsKqMJrJAUoADZGNh5/vZPKcGc= dario.cat/mergo v1.0.2 h1:85+piFYR1tMbRrLcDwR18y4UKJ3aH1Tbzi24VRW1TK8= dario.cat/mergo v1.0.2/go.mod h1:E/hbnu0NxMFBjpMIE34DRGLWqDy0g5FuKDhCb31ngxA= github.com/BurntSushi/toml v1.6.0 h1:dRaEfpa2VI55EwlIW72hMRHdWouJeRF7TPYhI+AUQjk= github.com/BurntSushi/toml v1.6.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0= github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/VividCortex/ewma v1.2.0 h1:f58SaIzcDXrSy3kWaHNvuJgJ3Nmz59Zji6XoJR/q1ow= github.com/VividCortex/ewma v1.2.0/go.mod h1:nz4BbCtbLyFDeC9SUHbtcT5644juEuWfUAUnGx7j5l4= github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d h1:licZJFw2RwpHMqeKTCYkitsPqHNxTmd4SNR5r94FGM8= github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d/go.mod h1:asat636LX7Bqt5lYEZ27JNDcqxfjdBQuJ/MM4CN/Lzo= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/clipperhouse/uax29/v2 v2.7.0 h1:+gs4oBZ2gPfVrKPthwbMzWZDaAFPGYK72F0NJv2v7Vk= github.com/clipperhouse/uax29/v2 v2.7.0/go.mod h1:EFJ2TJMRUaplDxHKj1qAEhCtQPW2tJSwu5BF98AuoVM= github.com/containerd/errdefs v1.0.0 h1:tg5yIfIlQIrxYtu9ajqY42W3lpS19XqdxRQeEwYG8PI= github.com/containerd/errdefs v1.0.0/go.mod h1:+YBYIdtsnF4Iw6nWZhJcqGSg/dwvV7tyJ/kCkyJ2k+M= github.com/containerd/errdefs/pkg v0.3.0 h1:9IKJ06FvyNlexW690DXuQNx2KA2cUJXx151Xdx3ZPPE= github.com/containerd/errdefs/pkg v0.3.0/go.mod h1:NJw6s9HwNuRhnjJhM7pylWwMyAkmCQvQ4GpJHEqRLVk= github.com/containerd/stargz-snapshotter/estargz v0.18.2 h1:yXkZFYIzz3eoLwlTUZKz2iQ4MrckBxJjkmD16ynUTrw= github.com/containerd/stargz-snapshotter/estargz v0.18.2/go.mod h1:XyVU5tcJ3PRpkA9XS2T5us6Eg35yM0214Y+wvrZTBrY= github.com/containers/libtrust v0.0.0-20230121012942-c1716e8a8d01 h1:Qzk5C6cYglewc+UyGf6lc8Mj2UaPTHy/iF2De0/77CA= github.com/containers/libtrust v0.0.0-20230121012942-c1716e8a8d01/go.mod h1:9rfv8iPl1ZP7aqh9YA68wnZv2NUDbXdcdPHVz0pFbPY= github.com/containers/ocicrypt v1.2.1 h1:0qIOTT9DoYwcKmxSt8QJt+VzMY18onl9jUXsxpVhSmM= github.com/containers/ocicrypt v1.2.1/go.mod h1:aD0AAqfMp0MtwqWgHM1bUwe1anx0VazI108CRrSKINQ= github.com/coreos/go-oidc/v3 v3.17.0 h1:hWBGaQfbi0iVviX4ibC7bk8OKT5qNr4klBaCHVNvehc= github.com/coreos/go-oidc/v3 v3.17.0/go.mod h1:wqPbKFrVnE90vty060SB40FCJ8fTHTxSwyXJqZH+sI8= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/cyberphone/json-canonicalization v0.0.0-20241213102144-19d51d7fe467 h1:uX1JmpONuD549D73r6cgnxyUu18Zb7yHAy5AYU0Pm4Q= github.com/cyberphone/json-canonicalization v0.0.0-20241213102144-19d51d7fe467/go.mod h1:uzvlm1mxhHkdfqitSA92i7Se+S9ksOn3a3qmv/kyOCw= github.com/cyphar/filepath-securejoin v0.6.1 h1:5CeZ1jPXEiYt3+Z6zqprSAgSWiggmpVyciv8syjIpVE= github.com/cyphar/filepath-securejoin v0.6.1/go.mod h1:A8hd4EnAeyujCJRrICiOWqjS1AX0a9kM5XL+NwKoYSc= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/dlclark/regexp2 v1.11.0 h1:G/nrcoOa7ZXlpoa/91N3X7mM3r8eIlMBBJZvsz/mxKI= github.com/dlclark/regexp2 v1.11.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= github.com/docker/cli v29.3.0+incompatible h1:z3iWveU7h19Pqx7alZES8j+IeFQZ1lhTwb2F+V9SVvk= github.com/docker/cli v29.3.0+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk= github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker-credential-helpers v0.9.5 h1:EFNN8DHvaiK8zVqFA2DT6BjXE0GzfLOZ38ggPTKePkY= github.com/docker/docker-credential-helpers v0.9.5/go.mod h1:v1S+hepowrQXITkEfw6o4+BMbGot02wiKpzWhGUZK6c= github.com/docker/go-connections v0.6.0 h1:LlMG9azAe1TqfR7sO+NJttz1gy6KO7VJBh+pMmjSD94= github.com/docker/go-connections v0.6.0/go.mod h1:AahvXYshr6JgfUJGdDCs2b5EZG/vmaMAntpSFH5BFKE= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707 h1:2tV76y6Q9BB+NEBasnqvs7e49aEBFI8ejC89PSnWH+4= github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707/go.mod h1:qssHWj60/X5sZFNxpG4HBPDHVqxNm4DfnCKgrbZOT+s= github.com/dsnet/golib v0.0.0-20171103203638-1ea166775780/go.mod h1:Lj+Z9rebOhdfkVLjJ8T6VcRQv3SXugXy999NBtR9aFY= github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/go-jose/go-jose/v4 v4.1.3 h1:CVLmWDhDVRa6Mi/IgCgaopNosCaHz7zrMeF9MlZRkrs= github.com/go-jose/go-jose/v4 v4.1.3/go.mod h1:x4oUasVrzR7071A4TnHLGSPpNOm2a21K9Kf04k1rs08= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-rod/rod v0.116.2 h1:A5t2Ky2A+5eD/ZJQr1EfsQSe5rms5Xof/qj296e+ZqA= github.com/go-rod/rod v0.116.2/go.mod h1:H+CMO9SCNc2TJ2WfrG+pKhITz57uGNYU43qYHh438Mg= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/go-containerregistry v0.20.7 h1:24VGNpS0IwrOZ2ms2P1QE3Xa5X9p4phx0aUgzYzHW6I= github.com/google/go-containerregistry v0.20.7/go.mod h1:Lx5LCZQjLH1QBaMPeGwsME9biPeo1lPx6lbGj/UmzgM= github.com/google/go-intervals v0.0.2 h1:FGrVEiUnTRKR8yE04qzXYaJMtnIYqobR5QbblK3ixcM= github.com/google/go-intervals v0.0.2/go.mod h1:MkaR3LNRfeKLPmqgJYs4E66z5InYjmCjbbr4TQlcT6Y= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/pprof v0.0.0-20260115054156-294ebfa9ad83 h1:z2ogiKUYzX5Is6zr/vP9vJGqPwcdqsWjOt+V8J7+bTc= github.com/google/pprof v0.0.0-20260115054156-294ebfa9ad83/go.mod h1:MxpfABSjhmINe3F1It9d+8exIHFvUqtLIRCdOGNXqiI= github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k= github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-multierror v1.1.2-0.20250313123807-1ee6e1a1957a h1:zTI4FFCOXw14aUC78fxMh4tS7jJI7Fm51sH4smjl+Fc= github.com/hashicorp/go-multierror v1.1.2-0.20250313123807-1ee6e1a1957a/go.mod h1:RYOtqYU2MvOrqUMooJlQoFFuqR6sazGdm1ubZTL++r8= github.com/hashicorp/go-retryablehttp v0.7.8 h1:ylXZWnqa7Lhqpk0L1P1LzDtGcCR0rPVUrx/c8Unxc48= github.com/hashicorp/go-retryablehttp v0.7.8/go.mod h1:rjiScheydd+CxvumBsIrFKlx3iS0jrZ7LvzFGFmuKbw= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.18.4 h1:RPhnKRAQ4Fh8zU2FY/6ZFDwTVTxgJ/EMydqSTzE9a2c= github.com/klauspost/compress v1.18.4/go.mod h1:R0h/fSBs8DE4ENlcrlib3PsXS61voFxhIs2DeRhCvJ4= github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/pgzip v1.2.6 h1:8RXeL5crjEUFnR2/Sn6GJNWtSQ3Dk8pq4CL3jvdDyjU= github.com/klauspost/pgzip v1.2.6/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE= github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.20 h1:WcT52H91ZUAwy8+HUkdM3THM6gXqXuLJi9O3rjcQQaQ= github.com/mattn/go-runewidth v0.0.20/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs= github.com/mattn/go-sqlite3 v1.14.34 h1:3NtcvcUnFBPsuRcno8pUtupspG/GM+9nZ88zgJcp6Zk= github.com/mattn/go-sqlite3 v1.14.34/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= github.com/miekg/pkcs11 v1.1.1 h1:Ugu9pdy6vAYku5DEpVWVFPYnzV+bxB+iRdbuFSu7TvU= github.com/miekg/pkcs11 v1.1.1/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= github.com/mistifyio/go-zfs/v4 v4.0.0 h1:sU0+5dX45tdDK5xNZ3HBi95nxUc48FS92qbIZEvpAg4= github.com/mistifyio/go-zfs/v4 v4.0.0/go.mod h1:weotFtXTHvBwhr9Mv96KYnDkTPBOHFUbm9cBmQpesL0= github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0= github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= github.com/moby/moby/api v1.54.0 h1:7kbUgyiKcoBhm0UrWbdrMs7RX8dnwzURKVbZGy2GnL0= github.com/moby/moby/api v1.54.0/go.mod h1:8mb+ReTlisw4pS6BRzCMts5M49W5M7bKt1cJy/YbAqc= github.com/moby/moby/client v0.3.0 h1:UUGL5okry+Aomj3WhGt9Aigl3ZOxZGqR7XPo+RLPlKs= github.com/moby/moby/client v0.3.0/go.mod h1:HJgFbJRvogDQjbM8fqc1MCEm4mIAGMLjXbgwoZp6jCQ= github.com/moby/sys/capability v0.4.0 h1:4D4mI6KlNtWMCM1Z/K0i7RV1FkX+DBDHKVJpCndZoHk= github.com/moby/sys/capability v0.4.0/go.mod h1:4g9IK291rVkms3LKCDOoYlnV8xKwoDTpIrNEE35Wq0I= github.com/moby/sys/mountinfo v0.7.2 h1:1shs6aH5s4o5H2zQLn796ADW1wMrIwHsyJ2v9KouLrg= github.com/moby/sys/mountinfo v0.7.2/go.mod h1:1YOa8w8Ih7uW0wALDUgT1dTTSBrZ+HiBLGws92L2RU4= github.com/moby/sys/user v0.4.0 h1:jhcMKit7SA80hivmFJcbB1vqmw//wU61Zdui2eQXuMs= github.com/moby/sys/user v0.4.0/go.mod h1:bG+tYYYJgaMtRKgEmuueC0hJEAZWwtIbZTB+85uoHjs= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8= github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/onsi/ginkgo/v2 v2.28.1 h1:S4hj+HbZp40fNKuLUQOYLDgZLwNUVn19N3Atb98NCyI= github.com/onsi/ginkgo/v2 v2.28.1/go.mod h1:CLtbVInNckU3/+gC8LzkGUb9oF+e8W8TdUsxPwvdOgE= github.com/onsi/gomega v1.39.1 h1:1IJLAad4zjPn2PsnhH70V4DKRFlrCzGBNrNaru+Vf28= github.com/onsi/gomega v1.39.1/go.mod h1:hL6yVALoTOxeWudERyfppUcZXjMwIMLnuSfruD2lcfg= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.2-0.20260226102121-a4c6ade7bb82 h1:E+Fkd2gXu1H0wGsF/81ghtqacuzl+OkuS4rEnGOsTCw= github.com/opencontainers/image-spec v1.1.2-0.20260226102121-a4c6ade7bb82/go.mod h1:GRy5q9c6/vsqXmQ1I6TL1PkhA64F6eXG9fUOQ9tFvm8= github.com/opencontainers/image-spec/schema v0.0.0-20250717171153-ab80ff15c2dd h1:demTtfPH+DsqagnumQZv8nQrFoUqCJDNVrw+6LsGpm4= github.com/opencontainers/image-spec/schema v0.0.0-20250717171153-ab80ff15c2dd/go.mod h1:vPOv9cXqxB6ycHY5iVwqL4rkYbwRh46GZj13CfkZ6As= github.com/opencontainers/image-tools v1.0.0-rc3 h1:ZR837lBIxq6mmwEqfYrbLMuf75eBSHhccVHy6lsBeM4= github.com/opencontainers/image-tools v1.0.0-rc3/go.mod h1:A9btVpZLzttF4iFaKNychhPyrhfOjJ1OF5KrA8GcLj4= github.com/opencontainers/runtime-spec v1.3.0 h1:YZupQUdctfhpZy3TM39nN9Ika5CBWT5diQ8ibYCRkxg= github.com/opencontainers/runtime-spec v1.3.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/selinux v1.13.1 h1:A8nNeceYngH9Ow++M+VVEwJVpdFmrlxsN22F+ISDCJE= github.com/opencontainers/selinux v1.13.1/go.mod h1:S10WXZ/osk2kWOYKy1x2f/eXF5ZHJoUs8UU/2caNRbg= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/proglottis/gpgme v0.1.6 h1:8WpQ8VWggLdxkuTnW+sZ1r1t92XBNd8GZNDhQ4Rz+98= github.com/proglottis/gpgme v0.1.6/go.mod h1:5LoXMgpE4bttgwwdv9bLs/vwqv3qV7F4glEEZ7mRKrM= github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 h1:KRzFb2m7YtdldCEkzs6KqmJw4nqEVZGK7IN2kJkjTuQ= github.com/santhosh-tekuri/jsonschema/v6 v6.0.2/go.mod h1:JXeL+ps8p7/KNMjDQk3TCwPpBy0wYklyWTfbkIzdIFU= github.com/sebdah/goldie/v2 v2.7.1 h1:PkBHymaYdtvEkZV7TmyqKxdmn5/Vcj+8TpATWZjnG5E= github.com/sebdah/goldie/v2 v2.7.1/go.mod h1:oZ9fp0+se1eapSRjfYbsV/0Hqhbuu3bJVvKI/NNtssI= github.com/secure-systems-lab/go-securesystemslib v0.10.0 h1:l+H5ErcW0PAehBNrBxoGv1jjNpGYdZ9RcheFkB2WI14= github.com/secure-systems-lab/go-securesystemslib v0.10.0/go.mod h1:MRKONWmRoFzPNQ9USRF9i1mc7MvAVvF1LlW8X5VWDvk= github.com/sergi/go-diff v1.4.0 h1:n/SP9D5ad1fORl+llWyN+D6qoUETXNZARKjyY2/KVCw= github.com/sergi/go-diff v1.4.0/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= github.com/sigstore/fulcio v1.8.5 h1:HYTD1/L5wlBp8JxsWxUf8hmfaNBBF/x3r3p5l6tZwbA= github.com/sigstore/fulcio v1.8.5/go.mod h1:tSLYK3JsKvJpDW1BsIsVHZgHj+f8TjXARzqIUWSsSPQ= github.com/sigstore/protobuf-specs v0.5.0 h1:F8YTI65xOHw70NrvPwJ5PhAzsvTnuJMGLkA4FIkofAY= github.com/sigstore/protobuf-specs v0.5.0/go.mod h1:+gXR+38nIa2oEupqDdzg4qSBT0Os+sP7oYv6alWewWc= github.com/sigstore/sigstore v1.10.4 h1:ytOmxMgLdcUed3w1SbbZOgcxqwMG61lh1TmZLN+WeZE= github.com/sigstore/sigstore v1.10.4/go.mod h1:tDiyrdOref3q6qJxm2G+JHghqfmvifB7hw+EReAfnbI= github.com/sirupsen/logrus v1.9.4 h1:TsZE7l11zFCLZnZ+teH4Umoq5BhEIfIzfRDZ1Uzql2w= github.com/sirupsen/logrus v1.9.4/go.mod h1:ftWc9WdOfJ0a92nsE2jF5u5ZwH8Bv2zdeOC42RjbV2g= github.com/smallstep/pkcs7 v0.1.1 h1:x+rPdt2W088V9Vkjho4KtoggyktZJlMduZAtRHm68LU= github.com/smallstep/pkcs7 v0.1.1/go.mod h1:dL6j5AIz9GHjVEBTXtW+QliALcgM19RtXaTeyxI+AfA= github.com/spf13/cobra v1.10.2 h1:DMTTonx5m65Ic0GOoRY2c16WCbHxOOw6xxezuLaBpcU= github.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiTUUS4= github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk= github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stefanberger/go-pkcs11uri v0.0.0-20230803200340-78284954bff6 h1:pnnLyeX7o/5aX8qUQ69P/mLojDqwda8hFOCBTmP/6hw= github.com/stefanberger/go-pkcs11uri v0.0.0-20230803200340-78284954bff6/go.mod h1:39R/xuhNgVhi+K0/zst4TLrJrVmbm6LVgl4A0+ZFS5M= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/sylabs/sif/v2 v2.22.0 h1:Y+xXufp4RdgZe02SR3nWEg7S6q4tPWN237WHYzkDSKA= github.com/sylabs/sif/v2 v2.22.0/go.mod h1:W1XhWTmG1KcG7j5a3KSYdMcUIFvbs240w/MMVW627hs= github.com/tchap/go-patricia/v2 v2.3.3 h1:xfNEsODumaEcCcY3gI0hYPZ/PcpVv5ju6RMAhgwZDDc= github.com/tchap/go-patricia/v2 v2.3.3/go.mod h1:VZRHKAb53DLaG+nA9EaYYiaEx6YztwDlLElMsnSHD4k= github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/ulikunitz/xz v0.5.15 h1:9DNdB5s+SgV3bQ2ApL10xRc35ck0DuIX/isZvIk+ubY= github.com/ulikunitz/xz v0.5.15/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/vbatts/tar-split v0.12.2 h1:w/Y6tjxpeiFMR47yzZPlPj/FcPLpXbTUi/9H7d3CPa4= github.com/vbatts/tar-split v0.12.2/go.mod h1:eF6B6i6ftWQcDqEn3/iGFRFRo8cBIMSJVOpnNdfTMFA= github.com/vbauerster/mpb/v8 v8.12.0 h1:+gneY3ifzc88tKDzOtfG8k8gfngCx615S2ZmFM4liWg= github.com/vbauerster/mpb/v8 v8.12.0/go.mod h1:V02YIuMVo301Y1VE9VtZlD8s84OMsk+EKN6mwvf/588= github.com/ysmood/fetchup v0.2.3 h1:ulX+SonA0Vma5zUFXtv52Kzip/xe7aj4vqT5AJwQ+ZQ= github.com/ysmood/fetchup v0.2.3/go.mod h1:xhibcRKziSvol0H1/pj33dnKrYyI2ebIvz5cOOkYGns= github.com/ysmood/goob v0.4.0 h1:HsxXhyLBeGzWXnqVKtmT9qM7EuVs/XOgkX7T6r1o1AQ= github.com/ysmood/goob v0.4.0/go.mod h1:u6yx7ZhS4Exf2MwciFr6nIM8knHQIE22lFpWHnfql18= github.com/ysmood/got v0.40.0 h1:ZQk1B55zIvS7zflRrkGfPDrPG3d7+JOza1ZkNxcc74Q= github.com/ysmood/got v0.40.0/go.mod h1:W7DdpuX6skL3NszLmAsC5hT7JAhuLZhByVzHTq874Qg= github.com/ysmood/gson v0.7.3 h1:QFkWbTH8MxyUTKPkVWAENJhxqdBa4lYTQWqZCiLG6kE= github.com/ysmood/gson v0.7.3/go.mod h1:3Kzs5zDl21g5F/BlLTNcuAGAYLKt2lV5G8D1zF3RNmg= github.com/ysmood/leakless v0.9.0 h1:qxCG5VirSBvmi3uynXFkcnLMzkphdh3xx5FtrORwDCU= github.com/ysmood/leakless v0.9.0/go.mod h1:R8iAXPRaG97QJwqxs74RdwzcRHT1SWCGTNqY8q0JvMQ= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.65.0 h1:7iP2uCb7sGddAr30RRS6xjKy7AZ2JtTOPA3oolgVSw8= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.65.0/go.mod h1:c7hN3ddxs/z6q9xwvfLPk+UHlWRQyaeR1LdgfL/66l0= go.opentelemetry.io/otel v1.40.0 h1:oA5YeOcpRTXq6NN7frwmwFR0Cn3RhTVZvXsP4duvCms= go.opentelemetry.io/otel v1.40.0/go.mod h1:IMb+uXZUKkMXdPddhwAHm6UfOwJyh4ct1ybIlV14J0g= go.opentelemetry.io/otel/metric v1.40.0 h1:rcZe317KPftE2rstWIBitCdVp89A2HqjkxR3c11+p9g= go.opentelemetry.io/otel/metric v1.40.0/go.mod h1:ib/crwQH7N3r5kfiBZQbwrTge743UDc7DTFVZrrXnqc= go.opentelemetry.io/otel/sdk v1.40.0 h1:KHW/jUzgo6wsPh9At46+h4upjtccTmuZCFAc9OJ71f8= go.opentelemetry.io/otel/sdk v1.40.0/go.mod h1:Ph7EFdYvxq72Y8Li9q8KebuYUr2KoeyHx0DRMKrYBUE= go.opentelemetry.io/otel/sdk/metric v1.40.0 h1:mtmdVqgQkeRxHgRv4qhyJduP3fYJRMX4AtAlbuWdCYw= go.opentelemetry.io/otel/sdk/metric v1.40.0/go.mod h1:4Z2bGMf0KSK3uRjlczMOeMhKU2rhUqdWNoKcYrtcBPg= go.opentelemetry.io/otel/trace v1.40.0 h1:WA4etStDttCSYuhwvEa8OP8I5EWu24lkOzp+ZYblVjw= go.opentelemetry.io/otel/trace v1.40.0/go.mod h1:zeAhriXecNGP/s2SEG3+Y8X9ujcJOTqQ5RgdEJcawiA= go.podman.io/common v0.67.1-0.20260319154331-44a8de38c431 h1:tG3+wYtVCBg6/liqIX6al82gBAzm1GtSPo+rQBRDuAI= go.podman.io/common v0.67.1-0.20260319154331-44a8de38c431/go.mod h1:sugHfpSU9btZ6KRTruHrfbzTO8HbOCX9s++p7kmdbOQ= go.podman.io/image/v5 v5.39.2-0.20260313202710-ddaabae34a06 h1:Al947Qn6b4o516JBCH/GuZOZM/6sEkAiZYXhvq4VWPk= go.podman.io/image/v5 v5.39.2-0.20260313202710-ddaabae34a06/go.mod h1:iHfw/1S1llpOEh3P5P9nU8ZZAY9Jv8QmjV7u567Y5BE= go.podman.io/storage v1.62.1-0.20260316152041-ebc34488c338 h1:UPjZRS9elc2XH/xAZkhLJvLc7j8s1XCO3sxkGA7khzs= go.podman.io/storage v1.62.1-0.20260316152041-ebc34488c338/go.mod h1:k8lWBDknm4IJEfY9Gy3P/wRFT8aWvtk+rPtD8FKxIBE= go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/crypto v0.30.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/crypto v0.49.0 h1:+Ng2ULVvLHnJ/ZFEq4KdcDd/cfjrrjjNSXNzxg0Y4U4= golang.org/x/crypto v0.49.0/go.mod h1:ErX4dUh2UM+CFYiXZRTcMpEcN8b/1gxEuv3nODoYtCA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.33.0 h1:tHFzIWbBifEmbwtGz65eaWyGiGZatSrT9prnU8DbVL8= golang.org/x/mod v0.33.0/go.mod h1:swjeQEj+6r7fODbD2cqrnje9PnziFuw4bmLbBZFrQ5w= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/net v0.51.0 h1:94R/GTO7mt3/4wIKpcR5gkGmRLOuE/2hNGeWq/GBIFo= golang.org/x/net v0.51.0/go.mod h1:aamm+2QF5ogm02fjy5Bb7CQ0WMt1/WVM7FtyaTLlA9Y= golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs= golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo= golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= golang.org/x/term v0.41.0 h1:QCgPso/Q3RTJx2Th4bDLqML4W6iJiaXFq2/ftQF13YU= golang.org/x/term v0.41.0/go.mod h1:3pfBgksrReYfZ5lvYM0kSO0LIkAl4Yl2bXOkKP7Ec2A= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/text v0.35.0 h1:JOVx6vVDFokkpaq1AEptVzLTpDe9KGpj5tR4/X+ybL8= golang.org/x/text v0.35.0/go.mod h1:khi/HExzZJ2pGnjenulevKNX1W67CUy0AsXcNubPGCA= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/tools v0.42.0 h1:uNgphsn75Tdz5Ji2q36v/nsFSfR/9BRFvqhGBaJGd5k= golang.org/x/tools v0.42.0/go.mod h1:Ma6lCIwGZvHK6XtgbswSoWroEkhugApmsXyrUmBhfr0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= google.golang.org/genproto/googleapis/api v0.0.0-20260128011058-8636f8732409 h1:merA0rdPeUV3YIIfHHcH4qBkiQAc1nfCKSI7lB4cV2M= google.golang.org/genproto/googleapis/api v0.0.0-20260128011058-8636f8732409/go.mod h1:fl8J1IvUjCilwZzQowmw2b7HQB2eAuYBabMXzWurF+I= google.golang.org/genproto/googleapis/rpc v0.0.0-20260128011058-8636f8732409 h1:H86B94AW+VfJWDqFeEbBPhEtHzJwJfTbgE2lZa54ZAQ= google.golang.org/genproto/googleapis/rpc v0.0.0-20260128011058-8636f8732409/go.mod h1:j9x/tPzZkyxcgEFkiKEEGxfvyumM01BEtsW8xzOahRQ= google.golang.org/grpc v1.78.0 h1:K1XZG/yGDJnzMdd/uZHAkVqJE+xIDOcmdSFZkBUicNc= google.golang.org/grpc v1.78.0/go.mod h1:I47qjTo4OKbMkjA/aOOwxDIiPSBofUtQUI5EfpWvW7U= google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q= gotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA= pgregory.net/rapid v1.2.0 h1:keKAYRcjm+e1F0oAuU5F5+YPAWcyxNNRK2wud503Gnk= pgregory.net/rapid v1.2.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= ================================================ FILE: hack/btrfs_installed_tag.sh ================================================ #!/usr/bin/env bash ${CPP:-${CC:-cc} -E} ${CPPFLAGS} - > /dev/null 2> /dev/null << EOF #include EOF if test $? -ne 0 ; then echo exclude_graphdriver_btrfs fi ================================================ FILE: hack/get_ci_vm.sh ================================================ #!/usr/bin/env bash # # For help and usage information, simply execute the script w/o any arguments. # # This script is intended to be run by Red Hat skopeo developers who need # to debug problems specifically related to Cirrus-CI automated testing. # It requires that you have been granted prior access to create VMs in # google-cloud. For non-Red Hat contributors, VMs are available as-needed, # with supervision upon request. set -e SCRIPT_FILEPATH=$(realpath "${BASH_SOURCE[0]}") SCRIPT_DIRPATH=$(dirname "$SCRIPT_FILEPATH") REPO_DIRPATH=$(realpath "$SCRIPT_DIRPATH/../") # Help detect if we were called by get_ci_vm container GET_CI_VM="${GET_CI_VM:-0}" in_get_ci_vm() { if ((GET_CI_VM==0)); then echo "Error: $1 is not intended for use in this context" exit 2 fi } # get_ci_vm APIv1 container entrypoint calls into this script # to obtain required repo. specific configuration options. if [[ "$1" == "--config" ]]; then in_get_ci_vm "$1" cat < /dev/stderr ${GOSRC}/${SCRIPT_BASE}/runner.sh setup else # Create and access VM for specified Cirrus-CI task mkdir -p $HOME/.config/gcloud/ssh podman run -it --rm \ --tz=local \ -e NAME="$USER" \ -e SRCDIR=/src \ -e GCLOUD_ZONE="$GCLOUD_ZONE" \ -e DEBUG="${DEBUG:-0}" \ -v $REPO_DIRPATH:/src:O \ -v $HOME/.config/gcloud:/root/.config/gcloud:z \ -v $HOME/.config/gcloud/ssh:/root/.ssh:z \ quay.io/libpod/get_ci_vm:latest "$@" fi ================================================ FILE: hack/get_fqin.sh ================================================ #!/usr/bin/env bash # This script is intended to be called from the Makefile. It's purpose # is to automation correspondence between the environment used for local # development and CI. set -e SCRIPT_FILEPATH=$(realpath "${BASH_SOURCE[0]}") SCRIPT_DIRPATH=$(dirname "$SCRIPT_FILEPATH") REPO_DIRPATH=$(realpath "$SCRIPT_DIRPATH/../") # When running under CI, we already have the necessary information, # simply provide it to the Makefile. if [[ -n "$SKOPEO_CIDEV_CONTAINER_FQIN" ]]; then echo "$SKOPEO_CIDEV_CONTAINER_FQIN" exit 0 fi if [[ -n $(command -v podman) ]]; then CONTAINER_RUNTIME=podman; fi CONTAINER_RUNTIME=${CONTAINER_RUNTIME:-docker} # Borrow the get_ci_vm container image since it's small, and # by necessity contains a script that can accurately interpret # env. var. values from any .cirrus.yml runtime context. $CONTAINER_RUNTIME run --rm \ --security-opt label=disable \ -v $REPO_DIRPATH:/src:ro \ --entrypoint=/usr/share/automation/bin/cirrus-ci_env.py \ quay.io/libpod/get_ci_vm:latest \ --envs="Skopeo Test" /src/.cirrus.yml | \ grep -E -m1 '^SKOPEO_CIDEV_CONTAINER_FQIN' | \ awk -F "=" -e '{print $2}' | \ tr -d \'\" ================================================ FILE: hack/libsubid_tag.sh ================================================ #!/usr/bin/env bash if test $(${GO:-go} env GOOS) != "linux" ; then exit 0 fi tmpdir="$PWD/tmp.$RANDOM" mkdir -p "$tmpdir" trap 'rm -fr "$tmpdir"' EXIT ${CC:-cc} ${CPPFLAGS} ${CFLAGS} -o "$tmpdir"/libsubid_tag -x c - -l subid \ > /dev/null 2> /dev/null << EOF #include #include int main() { struct subid_range *ranges = NULL; #if SUBID_ABI_MAJOR >= 4 subid_get_uid_ranges("root", &ranges); #else get_subuid_ranges("root", &ranges); #endif free(ranges); return 0; } EOF if test $? -eq 0 ; then echo libsubid fi ================================================ FILE: hack/man-page-checker ================================================ #!/usr/bin/env bash # # man-page-checker - validate and cross-reference man page names # # This is the script that cross-checks BETWEEN MAN PAGES. It is not the # script that cross-checks that each option in skopeo foo --help is listed # in skopeo-foo.1.md and vice-versa; that one is xref-helpmsgs-manpages. # verbose= for i; do case "$i" in -v|--verbose) verbose=verbose ;; esac done die() { echo "$(basename $0): $*" >&2 exit 1 } cd $(dirname $0)/../docs || die "Please run me from top-level skopeo dir" rc=0 # Pass 1: cross-check file names with NAME section # # for a given skopeo-foo.1.md, the NAME should be 'skopeo-foo' for md in *.1.md;do # Read the first line after '## NAME' name=$(grep -E -A1 '^## NAME' $md|tail -1|awk '{print $1}' | tr -d \\\\) expect=$(basename $md .1.md) if [ "$name" != "$expect" ]; then echo printf "Inconsistent program NAME in %s:\n" $md printf " NAME= %s (expected: %s)\n" $name $expect rc=1 fi done # Pass 2: compare descriptions. # # Make sure the descriptive text in skopeo-foo.1.md matches the one # in the table in skopeo.1.md. for md in $(ls -1 *-*.1.md);do desc=$(grep -E -A1 '^## NAME' $md|tail -1|sed -E -e 's/^skopeo[^[:space:]]+ - //') # Find the descriptive text in the main skopeo man page. parent=skopeo.1.md parent_desc=$(grep $md $parent | awk -F'|' '{print $3}' | sed -E -e 's/^[[:space:]]+//' -e 's/[[:space:]]+$//') if [ "$desc" != "$parent_desc" ]; then echo printf "Inconsistent subcommand descriptions:\n" printf " %-32s = '%s'\n" $md "$desc" printf " %-32s = '%s'\n" $parent "$parent_desc" printf "Please ensure that the NAME section of $md\n" printf "matches the subcommand description in $parent\n" rc=1 fi done # Helper function: compares man page synopsis vs --help usage message function compare_usage() { local cmd="$1" local from_man="$2" # Run 'cmd --help', grab the line immediately after 'Usage:' local help_output=$(../bin/$cmd --help) local from_help=$(echo "$help_output" | grep -A1 '^Usage:' | tail -1) # strip off command name from both from_man=$(sed -E -e "s/\*\*$cmd\*\*[[:space:]]*//" <<<"$from_man") from_help=$(sed -E -e "s/^[[:space:]]*$cmd[[:space:]]*//" <<<"$from_help") # man page lists 'foo [*options*]', help msg shows 'foo [command options]'. # Make sure if one has it, the other does too. if expr "$from_man" : "\[\*options\*\]" >/dev/null; then if expr "$from_help" : "\[command options\]" >/dev/null; then : else echo "WARNING: $cmd: man page shows '[*options*]', help does not show [command options]" rc=1 fi elif expr "$from_help" : "\[command options\]" >/dev/null; then echo "WARNING: $cmd: --help shows [command options], man page does not show [*options*]" rc=1 fi # Strip off options and flags; start comparing arguments from_man=$(sed -E -e 's/^\[\*options\*\][[:space:]]*//' <<<"$from_man") from_help=$(sed -E -e 's/^\[command options\][[:space:]]*//' <<<"$from_help") # Constant strings in man page are '**foo**', in --help are 'foo'. from_man=$(sed -E -e 's/\*\*([^*]+)\*\*/\1/g' <<<"$from_man") # Args in man page are '_foo_', in --help are 'FOO'. Convert all to # UPCASE simply because it stands out better to the eye. from_man=$(sed -E -e 's/_([a-z-]+)_/\U\1/g' <<<"$from_man") # Compare man-page and --help usage strings. Skip 'skopeo' itself, # because the man page includes '[global options]' which we don't grok. if [[ "$from_man" != "$from_help" && "$cmd" != "skopeo" ]]; then printf "%-25s man='%s' help='%s'\n" "$cmd:" "$from_man" "$from_help" rc=1 fi } # Pass 3: compare synopses. # # Make sure the SYNOPSIS line in skopeo-foo.1.md reads '**skopeo foo** ...' for md in *.1.md;do synopsis=$(grep -E -A1 '^#* SYNOPSIS' $md|tail -1) # Command name must be bracketed by double asterisks; options and # arguments are bracketed by single ones. # E.g. '**skopeo copy** [*options*] _..._' # Get the command name, and confirm that it matches the md file name. cmd=$(echo "$synopsis" | sed -E -e 's/^\*\*([^*]+)\*\*.*/\1/' | tr -d \*) # Use sed, not tr, so we only replace the first dash: we want # skopeo-list-tags -> "skopeo list-tags", not "skopeo list tags" md_nodash=$(basename "$md" .1.md | sed -e 's/-/ /') if [ "$cmd" != "$md_nodash" ]; then echo printf "Inconsistent program name in SYNOPSIS in %s:\n" $md printf " SYNOPSIS = %s (expected: '%s')\n" "$cmd" "$md_nodash" rc=1 fi # The convention is to use UPPER CASE in 'skopeo foo --help', # but *lower case bracketed by asterisks* in the man page if expr "$synopsis" : ".*[A-Z]" >/dev/null; then echo printf "Inconsistent capitalization in SYNOPSIS in %s\n" $md printf " '%s' should not contain upper-case characters\n" "$synopsis" rc=1 fi # (for debugging, and getting a sense of standard conventions) #printf " %-32s ------ '%s'\n" $md "$synopsis" # If bin/skopeo is available, run "cmd --help" and compare Usage # messages. This is complicated, so do it in a helper function. compare_usage "$md_nodash" "$synopsis" done exit $rc ================================================ FILE: hack/sqlite_tag.sh ================================================ #!/usr/bin/env bash ${CPP:-${CC:-cc} -E} ${CPPFLAGS} - &> /dev/null << EOF #include EOF if test $? -eq 0 ; then echo libsqlite3 fi ================================================ FILE: hack/test-system.sh ================================================ #!/bin/bash set -e # These tests can run in/outside of a container. However, # not all storage drivers are supported in a container # environment. Detect this and setup storage when # running in a container. # # Paradoxically (FIXME: clean this up), SKOPEO_CONTAINER_TESTS is set # both inside a container and without a container (in a CI VM); it actually means # "it is safe to destructively modify the system for tests". # # On a CI VM, we can just use Podman as it is already configured; the changes below, # to use VFS, are necessary only inside a container, because overlay-inside-overlay # does not work. So, make these changes conditional on both # SKOPEO_CONTAINER_TESTS (for acceptability to do destructive modification) and !CI # (for necessity to adjust for in-container operation) if ((SKOPEO_CONTAINER_TESTS)) && [[ "$CI" != true ]]; then if [[ -r /etc/containers/storage.conf ]]; then echo "MODIFYING existing storage.conf" sed -i \ -e 's/^driver\s*=.*/driver = "vfs"/' \ -e 's/^mountopt/#mountopt/' \ /etc/containers/storage.conf else echo "CREATING NEW storage.conf" cat >> /etc/containers/storage.conf << EOF [storage] driver = "vfs" runroot = "/run/containers/storage" graphroot = "/var/lib/containers/storage" EOF fi # The logic of finding the relevant storage.conf file is convoluted # and in effect differs between Skopeo and Podman, at least in some versions; # explicitly point at the file we want to use to hopefully avoid that. export CONTAINERS_STORAGE_CONF=/etc/containers/storage.conf fi bats --tap systemtest ================================================ FILE: hack/tree_status.sh ================================================ #!/usr/bin/env bash set -e STATUS=$(git status --porcelain) if [[ -z $STATUS ]] then echo "tree is clean" else echo "tree is dirty, please commit all changes and sync the vendor.conf" echo "" echo "$STATUS" exit 1 fi ================================================ FILE: hack/validate-git-marks.sh ================================================ #!/usr/bin/env bash IFS=$'\n' files=( $(git ls-tree -r HEAD --name-only | grep -v '^vendor/' || true) ) unset IFS badFiles=() for f in "${files[@]}"; do if [ $(grep -r "^\(<<<<<<<\|>>>>>>>\|^=======$\)" $f) ]; then badFiles+=( "$f" ) continue fi set -e done if [ ${#badFiles[@]} -eq 0 ]; then echo 'Congratulations! There is no conflict.' else { echo "There is trace of conflict(s) in the following files :" for f in "${badFiles[@]}"; do echo " - $f" done echo echo 'Please fix the conflict(s) commit the result.' echo } >&2 exit 1 fi ================================================ FILE: hack/validate-vet.sh ================================================ #!/bin/bash errors=$(go vet -tags="${BUILDTAGS}" ./... 2>&1) if [ -z "$errors" ]; then echo 'Congratulations! All Go source files have been vetted.' else { echo "Errors from go vet:" echo "$errors" echo echo 'Please fix the above errors. You can test via "go vet" and commit the result.' echo } >&2 exit 1 fi ================================================ FILE: hack/warn-destructive-tests.sh ================================================ #!/usr/bin/env bash set -e # Set this to 1 to enable installation/modification of environment/services export SKOPEO_CONTAINER_TESTS=${SKOPEO_CONTAINER_TESTS:-0} if [[ "$SKOPEO_CONTAINER_TESTS" == "0" ]] && [[ "$CI" != "true" ]]; then ( echo "***************************************************************" echo "WARNING: Executing tests directly on the local development" echo " host is highly discouraged. Many important items" echo " will be skipped. For manual execution, please utilize" echo " the Makefile targets WITHOUT the '-local' suffix." echo "***************************************************************" ) > /dev/stderr sleep 5 fi ================================================ FILE: hack/xref-helpmsgs-manpages ================================================ #!/usr/bin/perl # # xref-helpmsgs-manpages - cross-reference --help options against man pages # package LibPod::CI::XrefHelpmsgsManpages; use v5.14; use utf8; use strict; use warnings; (our $ME = $0) =~ s|.*/||; our $VERSION = '0.1'; # For debugging, show data structures using DumpTree($var) #use Data::TreeDumper; $Data::TreeDumper::Displayaddress = 0; # unbuffer output $| = 1; ############################################################################### # BEGIN user-customizable section # Path to skopeo executable my $Default_Skopeo = './bin/skopeo'; my $SKOPEO = $ENV{SKOPEO} || $Default_Skopeo; # Path to all doc files (markdown) my $Docs_Path = 'docs'; # Global error count my $Errs = 0; # END user-customizable section ############################################################################### ############################################################################### # BEGIN boilerplate args checking, usage messages sub usage { print <<"END_USAGE"; Usage: $ME [OPTIONS] $ME recursively runs 'skopeo --help' against all subcommands; and recursively reads skopeo-*.1.md files in $Docs_Path, then cross-references that each --help option is listed in the appropriate man page and vice-versa. $ME invokes '\$SKOPEO' (default: $Default_Skopeo). Exit status is zero if no inconsistencies found, one otherwise OPTIONS: -v, --verbose show verbose progress indicators -n, --dry-run make no actual changes --help display this message --version display program name and version END_USAGE exit; } # Command-line options. Note that this operates directly on @ARGV ! our $debug = 0; our $verbose = 0; sub handle_opts { use Getopt::Long; GetOptions( 'debug!' => \$debug, 'verbose|v' => \$verbose, help => \&usage, version => sub { print "$ME version $VERSION\n"; exit 0 }, ) or die "Try `$ME --help' for help\n"; } # END boilerplate args checking, usage messages ############################################################################### ############################## CODE BEGINS HERE ############################### # The term is "modulino". __PACKAGE__->main() unless caller(); # Main code. sub main { # Note that we operate directly on @ARGV, not on function parameters. # This is deliberate: it's because Getopt::Long only operates on @ARGV # and there's no clean way to make it use @_. handle_opts(); # will set package globals # Fetch command-line arguments. Barf if too many. die "$ME: Too many arguments; try $ME --help\n" if @ARGV; my $help = skopeo_help(); my $man = skopeo_man('skopeo'); xref_by_help($help, $man); xref_by_man($help, $man); exit !!$Errs; } ############################################################################### # BEGIN cross-referencing ################## # xref_by_help # Find keys in '--help' but not in man ################## sub xref_by_help { my ($help, $man, @subcommand) = @_; for my $k (sort keys %$help) { if (exists $man->{$k}) { if (ref $help->{$k}) { xref_by_help($help->{$k}, $man->{$k}, @subcommand, $k); } # Otherwise, non-ref is leaf node such as a --option } else { my $man = $man->{_path} || 'man'; warn "$ME: skopeo @subcommand --help lists $k, but $k not in $man\n"; ++$Errs; } } } ################# # xref_by_man # Find keys in man pages but not in --help ################# # # In an ideal world we could share the functionality in one function; but # there are just too many special cases in man pages. # sub xref_by_man { my ($help, $man, @subcommand) = @_; # FIXME: this generates way too much output for my $k (grep { $_ ne '_path' } sort keys %$man) { if (exists $help->{$k}) { if (ref $man->{$k}) { xref_by_man($help->{$k}, $man->{$k}, @subcommand, $k); } } elsif ($k ne '--help' && $k ne '-h') { my $man = $man->{_path} || 'man'; warn "$ME: skopeo @subcommand: $k in $man, but not --help\n"; ++$Errs; } } } # END cross-referencing ############################################################################### # BEGIN data gathering ################# # skopeo_help # Parse output of 'skopeo [subcommand] --help' ################# sub skopeo_help { my %help; open my $fh, '-|', $SKOPEO, @_, '--help' or die "$ME: Cannot fork: $!\n"; my $section = ''; while (my $line = <$fh>) { # Cobra is blessedly consistent in its output: # Usage: ... # Available Commands: # .... # Options: # .... # # Start by identifying the section we're in... if ($line =~ /^Available\s+(Commands):/) { $section = lc $1; } elsif ($line =~ /^(Flags):/) { $section = lc $1; } # ...then track commands and options. For subcommands, recurse. elsif ($section eq 'commands') { if ($line =~ /^\s{1,4}(\S+)\s/) { my $subcommand = $1; print "> skopeo @_ $subcommand\n" if $debug; $help{$subcommand} = skopeo_help(@_, $subcommand) unless $subcommand eq 'help'; # 'help' not in man } } elsif ($section eq 'flags') { # Handle '--foo' or '-f, --foo' if ($line =~ /^\s{1,10}(--\S+)\s/) { print "> skopeo @_ $1\n" if $debug; $help{$1} = 1; } elsif ($line =~ /^\s{1,10}(-\S),\s+(--\S+)\s/) { print "> skopeo @_ $1, $2\n" if $debug; $help{$1} = $help{$2} = 1; } } } close $fh or die "$ME: Error running 'skopeo @_ --help'\n"; return \%help; } ################ # skopeo_man # Parse contents of skopeo-*.1.md ################ sub skopeo_man { my $command = shift; my $manpath = "$Docs_Path/$command.1.md"; print "** $manpath \n" if $debug; my %man = (_path => $manpath); open my $fh, '<', $manpath or die "$ME: Cannot read $manpath: $!\n"; my $section = ''; my @most_recent_flags; my $previous_subcmd = ''; while (my $line = <$fh>) { chomp $line; next unless $line; # skip empty lines # .md files designate sections with leading double hash if ($line =~ /^##\s*OPTIONS/) { $section = 'flags'; } elsif ($line =~ /^\#\#\s+(SUB)?COMMANDS/) { $section = 'commands'; } elsif ($line =~ /^\#\#[^#]/) { $section = ''; } # This will be a table containing subcommand names, links to man pages. elsif ($section eq 'commands') { # In skopeo.1.md if ($line =~ /^\|\s*\[skopeo-(\S+?)\(\d\)\]/) { # $1 will be changed by recursion _*BEFORE*_ left-hand assignment my $subcmd = $1; $man{$subcmd} = skopeo_man("skopeo-$1"); } } # Options should always be of the form '**-f**' or '**\-\-flag**', # possibly separated by comma-space. elsif ($section eq 'flags') { # If option has long and short form, long must come first. # This is a while-loop because there may be multiple long # option names (not in skopeo ATM, but leave the possibility open) while ($line =~ s/^\*\*(--[a-z0-9.-]+)\*\*(=\*[a-zA-Z0-9-]+\*)?(,\s+)?//g) { $man{$1} = 1; } # Short form if ($line =~ s/^\*\*(-[a-zA-Z0-9.])\*\*(=\*[a-zA-Z0-9-]+\*)?//g) { $man{$1} = 1; } } } close $fh; return \%man; } # END data gathering ############################################################################### 1; ================================================ FILE: install.md ================================================ # Installing Skopeo ## Distribution Packages `skopeo` may already be packaged in your distribution. This document lists the installation steps for many distros, along with their information and support links. ### Fedora ```sh sudo dnf -y install skopeo ``` [Package Info](https://src.fedoraproject.org/rpms/skopeo) and [Bugzilla](https://bugzilla.redhat.com/buglist.cgi?bug_status=__open__&classification=Fedora&component=skopeo&product=Fedora) Fedora bugs can be reported on the Skopeo GitHub [Issues](https://github.com/containers/skopeo/issues) page. ### RHEL / CentOS Stream ≥ 8 ```sh sudo dnf -y install skopeo ``` If you are a RHEL customer, please reach out through the official RHEL support channels for any issues. CentOS Stream 9: [Package Info](https://gitlab.com/redhat/centos-stream/rpms/skopeo/-/tree/c9s) and [Bugzilla](https://bugzilla.redhat.com/buglist.cgi?bug_status=__open__&classification=Red%20Hat&component=skopeo&product=Red%20Hat%20Enterprise%20Linux%209&version=CentOS%20Stream) CentOS Stream 8: [Package Info](https://git.centos.org/rpms/skopeo/tree/c8s-stream-rhel8) and [Bugzilla](https://bugzilla.redhat.com/buglist.cgi?bug_status=__open__&classification=Red%20Hat&component=skopeo&product=Red%20Hat%20Enterprise%20Linux%208&version=CentOS%20Stream) ### RHEL/CentOS ≤ 7.x ```sh sudo yum -y install skopeo ``` CentOS 7: [Package Repo](https://git.centos.org/rpms/skopeo/tree/c7-extras) ### openSUSE ```sh sudo zypper install skopeo ``` [Package Info](https://software.opensuse.org/package/skopeo) ### Alpine ```sh sudo apk add skopeo ``` [Package Info](https://pkgs.alpinelinux.org/packages?name=skopeo) ### Gentoo ```sh sudo emerge app-containers/skopeo ``` [Package Info](https://packages.gentoo.org/packages/app-containers/skopeo) ### Arch Linux ```sh sudo pacman -S skopeo ``` [Package Info](https://archlinux.org/packages/extra/x86_64/skopeo/) ### macOS ```sh brew install skopeo ``` ### Nix / NixOS ```sh $ nix-env -i skopeo ``` [Package Info](https://search.nixos.org/packages?&show=skopeo&query=skopeo) ### Debian The skopeo package is available on [Bullseye](https://packages.debian.org/bullseye/skopeo), and Debian Testing and Unstable. ```bash # Debian Bullseye, Testing or Unstable/Sid sudo apt-get update sudo apt-get -y install skopeo ``` [Package Info](https://packages.debian.org/stable/skopeo) ### Raspberry Pi OS arm64 (beta) Raspberry Pi OS uses the standard Debian's repositories, so it is fully compatible with Debian's arm64 repository. You can simply follow the [steps for Debian](#debian) to install Skopeo. ### Ubuntu The skopeo package is available in the official repositories for Ubuntu 20.10 and newer. ```bash # Ubuntu 20.10 and newer sudo apt-get -y update sudo apt-get -y install skopeo ``` [Package Info](https://packages.ubuntu.com/jammy/skopeo) ### Windows Skopeo has not yet been packaged for Windows. There is an [open feature request](https://github.com/containers/skopeo/issues/715) and contributions are always welcome. ## Container Images Skopeo container images are available at `quay.io/skopeo/stable:latest`. For example, ```bash podman run docker://quay.io/skopeo/stable:latest copy --help ``` The skopeo container image build context and automation are located at [https://github.com/containers/image_build/tree/main/skopeo](https://github.com/containers/image_build/tree/main/skopeo) ## Building from Source Otherwise, read on for building and installing it from source: To build the `skopeo` binary you need at least Go 1.23. There are two ways to build skopeo: in a container, or locally without a container. Choose the one which better matches your needs and environment. ### Building without a container Building without a container requires a bit more manual work and setup in your environment, but it is more flexible: - It should work in more environments (e.g. for native macOS builds) - It does not require root privileges (after dependencies are installed) - It is faster, therefore more convenient for developing `skopeo`. Install the necessary dependencies: ```bash # Fedora: sudo dnf install gpgme-devel libassuan-devel btrfs-progs-devel ``` ```bash # Ubuntu (`libbtrfs-dev` requires Ubuntu 18.10 and above): sudo apt install libgpgme-dev libassuan-dev libbtrfs-dev pkg-config ``` ```bash # macOS: brew install gpgme ``` ```bash # openSUSE: sudo zypper install libgpgme-devel libbtrfs-devel glib2-devel ``` ```bash # Arch Linux: sudo pacman -S base-devel gpgme btrfs-progs ``` Make sure to clone this repository in your `GOPATH` - otherwise compilation fails. ```bash git clone https://github.com/containers/skopeo $GOPATH/src/github.com/containers/skopeo cd $GOPATH/src/github.com/containers/skopeo && make bin/skopeo ``` By default the `make` command (make all) will build bin/skopeo and the documentation locally. Building of documentation requires `go-md2man`. On systems that do not have this tool, the document generation can be skipped by passing `DISABLE_DOCS=1`: ``` DISABLE_DOCS=1 make ``` #### Additional prerequisites In order to dynamically link against system libraries and avoid compilation errors the ```CGO_ENABLED='1'``` flag must be enabled. You can easily check by ```go env | grep CGO_ENABLED```. An alternative would be to set the `BUILDTAGS=containers_image_openpgp` (this removes the dependency on `libgpgme` and its companion libraries). ### Cross-compilation For cross-building skopeo, use the command `make bin/skopeo.OS.ARCH`, where OS represents the target operating system and ARCH stands for the desired architecture. For instance, to build skopeo for RISC-V 64-bit Linux, execute: ```bash make bin/skopeo.linux.riscv64 ``` ### Building documentation To build the manual you will need go-md2man. ```bash # Debian: sudo apt-get install go-md2man ``` ``` # Fedora: sudo dnf install go-md2man ``` ``` # MacOS: brew install go-md2man ``` Then ```bash make docs ``` ### Building in a container Building in a container is simpler, but more restrictive: - It requires the `podman` command and the ability to run Linux containers. - The created executable is a Linux executable, and depends on dynamic libraries which may only be available only in a container of a similar Linux distribution. ```bash $ make binary ``` ### Shell completion scripts Skopeo has shell completion scripts for bash, zsh, fish and powershell. They are installed as part of `make install`. You may have to restart your shell in order for them to take effect. For instructions to manually generate and load the scripts please see `skopeo completion --help`. ### Installation Finally, after the binary and documentation is built: ```bash sudo make install ``` ### Building a static binary There have been efforts in the past to produce and maintain static builds, but the maintainers prefer to run Skopeo using distro packages or within containers. This is because static builds of Skopeo tend to be unreliable and functionally restricted. Specifically: - Some features of Skopeo depend on non-Go libraries like `libgpgme`. - Generating static Go binaries uses native Go libraries, which don't support e.g. `.local` or LDAP-based name resolution. That being said, if you would like to build Skopeo statically, you might be able to do it by combining all the following steps. - Export environment variable `CGO_ENABLED=0` (disabling CGO causes Go to prefer native libraries when possible, instead of dynamically linking against system libraries). - Set the `BUILDTAGS=containers_image_openpgp` Make variable (this removes the dependency on `libgpgme` and its companion libraries). - Clear the `GO_DYN_FLAGS` Make variable if even a dependency on the ELF interpreter is undesirable. Keep in mind that the resulting binary is unsupported and might crash randomly. Only use if you know what you're doing! For more information, history, and context about static builds, check the following issues: - [#391] - Consider distributing statically built binaries as part of release - [#669] - Static build fails with segmentation violation - [#670] - Fixing static binary build using container - [#755] - Remove static and in-container targets from Makefile - [#932] - Add nix derivation for static builds - [#1336] - Unable to run skopeo on Fedora 30 (due to dyn lib dependency) - [#1478] - Publish binary releases to GitHub (request+discussion) [#391]: https://github.com/containers/skopeo/issues/391 [#669]: https://github.com/containers/skopeo/issues/669 [#670]: https://github.com/containers/skopeo/issues/670 [#755]: https://github.com/containers/skopeo/issues/755 [#932]: https://github.com/containers/skopeo/issues/932 [#1336]: https://github.com/containers/skopeo/issues/1336 [#1478]: https://github.com/containers/skopeo/issues/1478 ================================================ FILE: integration/blocked_test.go ================================================ package main const ( blockedRegistriesConf = "./fixtures/blocked-registries.conf" blockedErrorRegex = `.*registry registry-blocked.com is blocked in .*` ) func (s *skopeoSuite) TestCopyBlockedSource() { t := s.T() assertSkopeoFails(t, blockedErrorRegex, "--registries-conf", blockedRegistriesConf, "copy", "docker://registry-blocked.com/image:test", "docker://registry-unblocked.com/image:test") } func (s *skopeoSuite) TestCopyBlockedDestination() { t := s.T() assertSkopeoFails(t, blockedErrorRegex, "--registries-conf", blockedRegistriesConf, "copy", "docker://registry-unblocked.com/image:test", "docker://registry-blocked.com/image:test") } func (s *skopeoSuite) TestInspectBlocked() { t := s.T() assertSkopeoFails(t, blockedErrorRegex, "--registries-conf", blockedRegistriesConf, "inspect", "docker://registry-blocked.com/image:test") } func (s *skopeoSuite) TestDeleteBlocked() { t := s.T() assertSkopeoFails(t, blockedErrorRegex, "--registries-conf", blockedRegistriesConf, "delete", "docker://registry-blocked.com/image:test") } ================================================ FILE: integration/check_test.go ================================================ package main import ( "fmt" "os/exec" "testing" "github.com/containers/skopeo/version" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" ) const ( privateRegistryURL0 = "127.0.0.1:5000" privateRegistryURL1 = "127.0.0.1:5001" ) func TestSkopeo(t *testing.T) { suite.Run(t, &skopeoSuite{}) } type skopeoSuite struct { suite.Suite regV2 *testRegistryV2 regV2WithAuth *testRegistryV2 } var ( _ = suite.SetupAllSuite(&skopeoSuite{}) _ = suite.TearDownAllSuite(&skopeoSuite{}) ) func (s *skopeoSuite) SetupSuite() { t := s.T() _, err := exec.LookPath(skopeoBinary) require.NoError(t, err) s.regV2 = setupRegistryV2At(t, privateRegistryURL0, false, registryVersionModern) s.regV2WithAuth = setupRegistryV2At(t, privateRegistryURL1, true, registryVersionModern) } func (s *skopeoSuite) TearDownSuite() { if s.regV2 != nil { s.regV2.tearDown() } if s.regV2WithAuth != nil { // cmd := exec.Command("docker", "logout", s.regV2WithAuth) // require.Noerror(t, cmd.Run()) s.regV2WithAuth.tearDown() } } func (s *skopeoSuite) TestVersion() { t := s.T() assertSkopeoSucceeds(t, fmt.Sprintf(".*skopeo version %s.*", version.Version), "--version") } func (s *skopeoSuite) TestCanAuthToPrivateRegistryV2WithoutDockerCfg() { t := s.T() assertSkopeoFails(t, ".*manifest unknown.*", "--tls-verify=false", "inspect", "--creds="+s.regV2WithAuth.username+":"+s.regV2WithAuth.password, fmt.Sprintf("docker://%s/busybox:latest", s.regV2WithAuth.url)) } func (s *skopeoSuite) TestNeedAuthToPrivateRegistryV2WithoutDockerCfg() { t := s.T() assertSkopeoFails(t, ".*authentication required.*", "--tls-verify=false", "inspect", fmt.Sprintf("docker://%s/busybox:latest", s.regV2WithAuth.url)) } func (s *skopeoSuite) TestCertDirInsteadOfCertPath() { t := s.T() assertSkopeoFails(t, ".*unknown flag: --cert-path.*", "--tls-verify=false", "inspect", fmt.Sprintf("docker://%s/busybox:latest", s.regV2WithAuth.url), "--cert-path=/") assertSkopeoFails(t, ".*authentication required.*", "--tls-verify=false", "inspect", fmt.Sprintf("docker://%s/busybox:latest", s.regV2WithAuth.url), "--cert-dir=/etc/docker/certs.d/") } // TODO(runcom): as soon as we can push to registries ensure you can inspect here // not just get image not found :) func (s *skopeoSuite) TestNoNeedAuthToPrivateRegistryV2ImageNotFound() { t := s.T() out, err := exec.Command(skopeoBinary, "--tls-verify=false", "inspect", fmt.Sprintf("docker://%s/busybox:latest", s.regV2.url)).CombinedOutput() assert.Error(t, err, "%s", string(out)) assert.Regexp(t, "(?s).*manifest unknown.*", string(out)) // (?s) : '.' will also match newlines assert.NotRegexp(t, "(?s).*unauthorized: authentication required.*", string(out)) // (?s) : '.' will also match newlines } func (s *skopeoSuite) TestInspectFailsWhenReferenceIsInvalid() { t := s.T() assertSkopeoFails(t, `.*Invalid image name.*`, "inspect", "unknown") } func (s *skopeoSuite) TestLoginLogout() { t := s.T() assertSkopeoSucceeds(t, "^Login Succeeded!\n$", "login", "--tls-verify=false", "--username="+s.regV2WithAuth.username, "--password="+s.regV2WithAuth.password, s.regV2WithAuth.url) // test --get-login returns username assertSkopeoSucceeds(t, fmt.Sprintf("^%s\n$", s.regV2WithAuth.username), "login", "--tls-verify=false", "--get-login", s.regV2WithAuth.url) // test logout assertSkopeoSucceeds(t, fmt.Sprintf("^Removed login credentials for %s\n$", s.regV2WithAuth.url), "logout", s.regV2WithAuth.url) } func (s *skopeoSuite) TestCopyWithLocalAuth() { t := s.T() assertSkopeoSucceeds(t, "^Login Succeeded!\n$", "login", "--tls-verify=false", "--username="+s.regV2WithAuth.username, "--password="+s.regV2WithAuth.password, s.regV2WithAuth.url) // copy to private registry using local authentication imageName := fmt.Sprintf("docker://%s/busybox:mine", s.regV2WithAuth.url) assertSkopeoSucceeds(t, "", "copy", "--dest-tls-verify=false", "--retry-times", "3", testFQIN+":latest", imageName) // inspect from private registry assertSkopeoSucceeds(t, "", "inspect", "--tls-verify=false", imageName) // logout from the registry assertSkopeoSucceeds(t, fmt.Sprintf("^Removed login credentials for %s\n$", s.regV2WithAuth.url), "logout", s.regV2WithAuth.url) // inspect from private registry should fail after logout assertSkopeoFails(t, ".*authentication required.*", "inspect", "--tls-verify=false", imageName) } ================================================ FILE: integration/copy_test.go ================================================ package main import ( "crypto/rand" "crypto/rsa" "crypto/x509" "encoding/json" "fmt" "io/fs" "log" "maps" "net/http" "net/http/httptest" "os" "os/exec" "path/filepath" "strings" "testing" digest "github.com/opencontainers/go-digest" imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" "github.com/opencontainers/image-tools/image" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" "go.podman.io/image/v5/manifest" "go.podman.io/image/v5/signature" "go.podman.io/image/v5/signature/simplesequoia" "go.podman.io/image/v5/types" ) const ( v2DockerRegistryURL = "localhost:5555" // Update also policy.json v2s1OnlyDockerRegistryURL = "localhost:5556" v2s1SupportedDockerRegistryURL = "localhost:5557" knownWindowsOnlyImage = "docker://mcr.microsoft.com/windows/nanoserver:1909" knownListImageRepo = "docker://registry.fedoraproject.org/fedora-minimal" knownListImage = knownListImageRepo + ":38" ) func TestCopy(t *testing.T) { suite.Run(t, ©Suite{}) } type copySuite struct { suite.Suite cluster *openshiftCluster registry *testRegistryV2 s1OnlyRegistry *testRegistryV2 s1SupportedRegistry *testRegistryV2 gpgHome string fingerprint string } var ( _ = suite.SetupAllSuite(©Suite{}) _ = suite.TearDownAllSuite(©Suite{}) ) func (s *copySuite) SetupSuite() { t := s.T() if os.Getenv("SKOPEO_CONTAINER_TESTS") != "1" { t.Skip("Not running in a container, refusing to affect user state") } s.cluster = startOpenshiftCluster(t) // FIXME: Set up TLS for the docker registry port instead of using "--tls-verify=false" all over the place. for _, stream := range []string{"unsigned", "personal", "official", "naming", "cosigned", "compression", "schema1", "schema2"} { isJSON := fmt.Sprintf(`{ "kind": "ImageStream", "apiVersion": "v1", "metadata": { "name": "%s" }, "spec": {} }`, stream) runCommandWithInput(t, isJSON, "oc", "create", "-f", "-") } // FIXME: Set up TLS for the docker registry port instead of using "--tls-verify=false" all over the place. s.registry = setupRegistryV2At(t, v2DockerRegistryURL, false, registryVersionModern) s.s1OnlyRegistry = setupRegistryV2At(t, v2s1OnlyDockerRegistryURL, false, registryVersionSchema1Only) s.s1SupportedRegistry = setupRegistryV2At(t, v2s1SupportedDockerRegistryURL, false, registryVersionSchema1Supported) s.gpgHome = t.TempDir() t.Setenv("GNUPGHOME", s.gpgHome) for _, key := range []string{"personal", "official"} { batchInput := fmt.Sprintf("Key-Type: RSA\nName-Real: Test key - %s\nName-email: %s@example.com\n%%no-protection\n%%commit\n", key, key) runCommandWithInput(t, batchInput, gpgBinary, "--batch", "--gen-key") out := combinedOutputOfCommand(t, gpgBinary, "--armor", "--export", fmt.Sprintf("%s@example.com", key)) err := os.WriteFile(filepath.Join(s.gpgHome, fmt.Sprintf("%s-pubkey.gpg", key)), []byte(out), 0o600) require.NoError(t, err) } // Get fingerprint for the personal key (used by some tests) lines, err := exec.Command(gpgBinary, "--homedir", s.gpgHome, "--with-colons", "--no-permission-warning", "--fingerprint", "personal@example.com").Output() require.NoError(t, err) s.fingerprint, err = findFingerprint(lines) require.NoError(t, err) } func (s *copySuite) TearDownSuite() { t := s.T() if s.registry != nil { s.registry.tearDown() } if s.s1OnlyRegistry != nil { s.s1OnlyRegistry.tearDown() } if s.s1SupportedRegistry != nil { s.s1SupportedRegistry.tearDown() } if s.cluster != nil { s.cluster.tearDown(t) } } // policyFixture applies the general edits, as well as extraSubstitutions, to the policy.json fixture, // and returns a path to a policy, which will be automatically removed when the test completes. func (s *copySuite) policyFixture(extraSubstitutions map[string]string) string { t := s.T() fixtureDir, err := filepath.Abs("fixtures") require.NoError(t, err) edits := map[string]string{"@keydir@": s.gpgHome, "@fixturedir@": fixtureDir} maps.Copy(edits, extraSubstitutions) policyPath := fileFromFixture(t, "fixtures/policy.json", edits) return policyPath } func (s *copySuite) TestCopyWithManifestList() { t := s.T() dir := t.TempDir() assertSkopeoSucceeds(t, "", "copy", "--retry-times", "3", knownListImage, "dir:"+dir) } func (s *copySuite) TestCopyAllWithManifestList() { t := s.T() dir := t.TempDir() assertSkopeoSucceeds(t, "", "copy", "--retry-times", "3", "--all", knownListImage, "dir:"+dir) } func (s *copySuite) TestCopyAllWithManifestListRoundTrip() { t := s.T() oci1 := t.TempDir() oci2 := t.TempDir() dir1 := t.TempDir() dir2 := t.TempDir() assertSkopeoSucceeds(t, "", "copy", "--retry-times", "3", "--multi-arch=all", knownListImage, "oci:"+oci1) assertSkopeoSucceeds(t, "", "copy", "--multi-arch=all", "oci:"+oci1, "dir:"+dir1) assertSkopeoSucceeds(t, "", "copy", "--multi-arch=all", "dir:"+dir1, "oci:"+oci2) assertSkopeoSucceeds(t, "", "copy", "--multi-arch=all", "oci:"+oci2, "dir:"+dir2) assertDirImagesAreEqual(t, dir1, dir2) out := combinedOutputOfCommand(t, "diff", "-urN", oci1, oci2) assert.Equal(t, "", out) } func (s *copySuite) TestCopyAllWithManifestListConverge() { t := s.T() oci1 := t.TempDir() oci2 := t.TempDir() dir1 := t.TempDir() dir2 := t.TempDir() assertSkopeoSucceeds(t, "", "copy", "--retry-times", "3", "--multi-arch=all", knownListImage, "oci:"+oci1) assertSkopeoSucceeds(t, "", "copy", "--multi-arch=all", "oci:"+oci1, "dir:"+dir1) assertSkopeoSucceeds(t, "", "copy", "--retry-times", "3", "--multi-arch=all", "--format", "oci", knownListImage, "dir:"+dir2) assertSkopeoSucceeds(t, "", "copy", "--multi-arch=all", "dir:"+dir2, "oci:"+oci2) assertDirImagesAreEqual(t, dir1, dir2) out := combinedOutputOfCommand(t, "diff", "-urN", oci1, oci2) assert.Equal(t, "", out) } func (s *copySuite) TestCopyNoneWithManifestList() { t := s.T() dir1 := t.TempDir() assertSkopeoSucceeds(t, "", "copy", "--retry-times", "3", "--multi-arch=index-only", knownListImage, "dir:"+dir1) manifestPath := filepath.Join(dir1, "manifest.json") readManifest, err := os.ReadFile(manifestPath) require.NoError(t, err) mimeType := manifest.GuessMIMEType(readManifest) assert.Equal(t, "application/vnd.docker.distribution.manifest.list.v2+json", mimeType) out := combinedOutputOfCommand(t, "ls", "-1", dir1) assert.Equal(t, "manifest.json\nversion\n", out) } func (s *copySuite) TestCopyWithManifestListConverge() { t := s.T() oci1 := t.TempDir() oci2 := t.TempDir() dir1 := t.TempDir() dir2 := t.TempDir() assertSkopeoSucceeds(t, "", "copy", "--retry-times", "3", knownListImage, "oci:"+oci1) assertSkopeoSucceeds(t, "", "copy", "--multi-arch=all", "oci:"+oci1, "dir:"+dir1) assertSkopeoSucceeds(t, "", "copy", "--retry-times", "3", "--format", "oci", knownListImage, "dir:"+dir2) assertSkopeoSucceeds(t, "", "copy", "--multi-arch=all", "dir:"+dir2, "oci:"+oci2) assertDirImagesAreEqual(t, dir1, dir2) out := combinedOutputOfCommand(t, "diff", "-urN", oci1, oci2) assert.Equal(t, "", out) } func (s *copySuite) TestCopyAllWithManifestListStorageFails() { t := s.T() storage := t.TempDir() storage = fmt.Sprintf("[vfs@%s/root+%s/runroot]", storage, storage) assertSkopeoFails(t, `.*destination transport .* does not support copying multiple images as a group.*`, "copy", "--retry-times", "3", "--multi-arch=all", knownListImage, "containers-storage:"+storage+"test") } func (s *copySuite) TestCopyWithManifestListStorage() { t := s.T() storage := t.TempDir() storage = fmt.Sprintf("[vfs@%s/root+%s/runroot]", storage, storage) dir1 := t.TempDir() dir2 := t.TempDir() assertSkopeoSucceeds(t, "", "copy", "--retry-times", "3", knownListImage, "containers-storage:"+storage+"test") assertSkopeoSucceeds(t, "", "copy", "--retry-times", "3", knownListImage, "dir:"+dir1) assertSkopeoSucceeds(t, "", "copy", "containers-storage:"+storage+"test", "dir:"+dir2) decompressDirs(t, dir1, dir2) assertDirImagesAreEqual(t, dir1, dir2) } func (s *copySuite) TestCopyWithManifestListStorageMultiple() { t := s.T() storage := t.TempDir() storage = fmt.Sprintf("[vfs@%s/root+%s/runroot]", storage, storage) dir1 := t.TempDir() dir2 := t.TempDir() assertSkopeoSucceeds(t, "", "--override-arch", "amd64", "copy", "--retry-times", "3", knownListImage, "containers-storage:"+storage+"test") assertSkopeoSucceeds(t, "", "--override-arch", "arm64", "copy", "--retry-times", "3", knownListImage, "containers-storage:"+storage+"test") assertSkopeoSucceeds(t, "", "--override-arch", "arm64", "copy", "--retry-times", "3", knownListImage, "dir:"+dir1) assertSkopeoSucceeds(t, "", "copy", "containers-storage:"+storage+"test", "dir:"+dir2) decompressDirs(t, dir1, dir2) assertDirImagesAreEqual(t, dir1, dir2) } func (s *copySuite) TestCopyWithManifestListDigest() { t := s.T() dir1 := t.TempDir() dir2 := t.TempDir() oci1 := t.TempDir() oci2 := t.TempDir() m := combinedOutputOfCommand(t, skopeoBinary, "inspect", "--retry-times", "3", "--raw", knownListImage) manifestDigest, err := manifest.Digest([]byte(m)) require.NoError(t, err) digest := manifestDigest.String() assertSkopeoSucceeds(t, "", "copy", "--retry-times", "3", knownListImageRepo+"@"+digest, "dir:"+dir1) assertSkopeoSucceeds(t, "", "copy", "--retry-times", "3", "--multi-arch=all", knownListImageRepo+"@"+digest, "dir:"+dir2) assertSkopeoSucceeds(t, "", "copy", "dir:"+dir1, "oci:"+oci1) assertSkopeoSucceeds(t, "", "copy", "dir:"+dir2, "oci:"+oci2) out := combinedOutputOfCommand(t, "diff", "-urN", oci1, oci2) assert.Equal(t, "", out) } func (s *copySuite) TestCopyWithDigestfileOutput() { t := s.T() tempdir := t.TempDir() dir1 := t.TempDir() digestOutPath := filepath.Join(tempdir, "digest.txt") assertSkopeoSucceeds(t, "", "copy", "--retry-times", "3", "--digestfile="+digestOutPath, knownListImage, "dir:"+dir1) readDigest, err := os.ReadFile(digestOutPath) require.NoError(t, err) _, err = digest.Parse(string(readDigest)) require.NoError(t, err) } func (s *copySuite) TestCopyWithManifestListStorageDigest() { t := s.T() storage := t.TempDir() storage = fmt.Sprintf("[vfs@%s/root+%s/runroot]", storage, storage) dir1 := t.TempDir() dir2 := t.TempDir() m := combinedOutputOfCommand(t, skopeoBinary, "inspect", "--retry-times", "3", "--raw", knownListImage) manifestDigest, err := manifest.Digest([]byte(m)) require.NoError(t, err) digest := manifestDigest.String() assertSkopeoSucceeds(t, "", "copy", "--retry-times", "3", knownListImageRepo+"@"+digest, "containers-storage:"+storage+"test@"+digest) assertSkopeoSucceeds(t, "", "copy", "containers-storage:"+storage+"test@"+digest, "dir:"+dir1) assertSkopeoSucceeds(t, "", "copy", "--retry-times", "3", knownListImageRepo+"@"+digest, "dir:"+dir2) decompressDirs(t, dir1, dir2) assertDirImagesAreEqual(t, dir1, dir2) } func (s *copySuite) TestCopyWithManifestListStorageDigestMultipleArches() { t := s.T() storage := t.TempDir() storage = fmt.Sprintf("[vfs@%s/root+%s/runroot]", storage, storage) dir1 := t.TempDir() dir2 := t.TempDir() m := combinedOutputOfCommand(t, skopeoBinary, "inspect", "--retry-times", "3", "--raw", knownListImage) manifestDigest, err := manifest.Digest([]byte(m)) require.NoError(t, err) digest := manifestDigest.String() assertSkopeoSucceeds(t, "", "copy", "--retry-times", "3", knownListImageRepo+"@"+digest, "containers-storage:"+storage+"test@"+digest) assertSkopeoSucceeds(t, "", "copy", "containers-storage:"+storage+"test@"+digest, "dir:"+dir1) assertSkopeoSucceeds(t, "", "copy", "--retry-times", "3", knownListImageRepo+"@"+digest, "dir:"+dir2) decompressDirs(t, dir1, dir2) assertDirImagesAreEqual(t, dir1, dir2) } func (s *copySuite) TestCopyWithManifestListStorageDigestMultipleArchesBothUseListDigest() { t := s.T() storage := t.TempDir() storage = fmt.Sprintf("[vfs@%s/root+%s/runroot]", storage, storage) m := combinedOutputOfCommand(t, skopeoBinary, "inspect", "--retry-times", "3", "--raw", knownListImage) manifestDigest, err := manifest.Digest([]byte(m)) require.NoError(t, err) digest := manifestDigest.String() _, err = manifest.ListFromBlob([]byte(m), manifest.GuessMIMEType([]byte(m))) require.NoError(t, err) assertSkopeoSucceeds(t, "", "--override-arch=amd64", "copy", "--retry-times", "3", knownListImageRepo+"@"+digest, "containers-storage:"+storage+"test@"+digest) assertSkopeoSucceeds(t, "", "--override-arch=arm64", "copy", "--retry-times", "3", knownListImageRepo+"@"+digest, "containers-storage:"+storage+"test@"+digest) assertSkopeoFails(t, `.*reading manifest for image instance.*does not exist.*`, "--override-arch=amd64", "inspect", "containers-storage:"+storage+"test@"+digest) assertSkopeoFails(t, `.*reading manifest for image instance.*does not exist.*`, "--override-arch=amd64", "inspect", "--config", "containers-storage:"+storage+"test@"+digest) i2 := combinedOutputOfCommand(t, skopeoBinary, "--override-arch=arm64", "inspect", "--config", "containers-storage:"+storage+"test@"+digest) var image2 imgspecv1.Image err = json.Unmarshal([]byte(i2), &image2) require.NoError(t, err) assert.Equal(t, "arm64", image2.Architecture) } func (s *copySuite) TestCopyWithManifestListStorageDigestMultipleArchesFirstUsesListDigest() { t := s.T() storage := t.TempDir() storage = fmt.Sprintf("[vfs@%s/root+%s/runroot]", storage, storage) m := combinedOutputOfCommand(t, skopeoBinary, "inspect", "--retry-times", "3", "--raw", knownListImage) manifestDigest, err := manifest.Digest([]byte(m)) require.NoError(t, err) digest := manifestDigest.String() list, err := manifest.ListFromBlob([]byte(m), manifest.GuessMIMEType([]byte(m))) require.NoError(t, err) amd64Instance, err := list.ChooseInstance(&types.SystemContext{ArchitectureChoice: "amd64"}) require.NoError(t, err) arm64Instance, err := list.ChooseInstance(&types.SystemContext{ArchitectureChoice: "arm64"}) require.NoError(t, err) assertSkopeoSucceeds(t, "", "--override-arch=amd64", "copy", "--retry-times", "3", knownListImageRepo+"@"+digest, "containers-storage:"+storage+"test@"+digest) assertSkopeoSucceeds(t, "", "--override-arch=arm64", "copy", "--retry-times", "3", knownListImageRepo+"@"+arm64Instance.String(), "containers-storage:"+storage+"test@"+arm64Instance.String()) i1 := combinedOutputOfCommand(t, skopeoBinary, "--override-arch=amd64", "inspect", "--config", "containers-storage:"+storage+"test@"+digest) var image1 imgspecv1.Image err = json.Unmarshal([]byte(i1), &image1) require.NoError(t, err) assert.Equal(t, "amd64", image1.Architecture) i2 := combinedOutputOfCommand(t, skopeoBinary, "--override-arch=amd64", "inspect", "--config", "containers-storage:"+storage+"test@"+amd64Instance.String()) var image2 imgspecv1.Image err = json.Unmarshal([]byte(i2), &image2) require.NoError(t, err) assert.Equal(t, "amd64", image2.Architecture) assertSkopeoFails(t, `.*reading manifest for image instance.*does not exist.*`, "--override-arch=arm64", "inspect", "containers-storage:"+storage+"test@"+digest) assertSkopeoFails(t, `.*reading manifest for image instance.*does not exist.*`, "--override-arch=arm64", "inspect", "--config", "containers-storage:"+storage+"test@"+digest) i3 := combinedOutputOfCommand(t, skopeoBinary, "--override-arch=arm64", "inspect", "--config", "containers-storage:"+storage+"test@"+arm64Instance.String()) var image3 imgspecv1.Image err = json.Unmarshal([]byte(i3), &image3) require.NoError(t, err) assert.Equal(t, "arm64", image3.Architecture) } func (s *copySuite) TestCopyWithManifestListStorageDigestMultipleArchesSecondUsesListDigest() { t := s.T() storage := t.TempDir() storage = fmt.Sprintf("[vfs@%s/root+%s/runroot]", storage, storage) m := combinedOutputOfCommand(t, skopeoBinary, "inspect", "--retry-times", "3", "--raw", knownListImage) manifestDigest, err := manifest.Digest([]byte(m)) require.NoError(t, err) digest := manifestDigest.String() list, err := manifest.ListFromBlob([]byte(m), manifest.GuessMIMEType([]byte(m))) require.NoError(t, err) amd64Instance, err := list.ChooseInstance(&types.SystemContext{ArchitectureChoice: "amd64"}) require.NoError(t, err) arm64Instance, err := list.ChooseInstance(&types.SystemContext{ArchitectureChoice: "arm64"}) require.NoError(t, err) assertSkopeoSucceeds(t, "", "--override-arch=amd64", "copy", "--retry-times", "3", knownListImageRepo+"@"+amd64Instance.String(), "containers-storage:"+storage+"test@"+amd64Instance.String()) assertSkopeoSucceeds(t, "", "--override-arch=arm64", "copy", "--retry-times", "3", knownListImageRepo+"@"+digest, "containers-storage:"+storage+"test@"+digest) i1 := combinedOutputOfCommand(t, skopeoBinary, "--override-arch=amd64", "inspect", "--config", "containers-storage:"+storage+"test@"+amd64Instance.String()) var image1 imgspecv1.Image err = json.Unmarshal([]byte(i1), &image1) require.NoError(t, err) assert.Equal(t, "amd64", image1.Architecture) assertSkopeoFails(t, `.*reading manifest for image instance.*does not exist.*`, "--override-arch=amd64", "inspect", "containers-storage:"+storage+"test@"+digest) assertSkopeoFails(t, `.*reading manifest for image instance.*does not exist.*`, "--override-arch=amd64", "inspect", "--config", "containers-storage:"+storage+"test@"+digest) i2 := combinedOutputOfCommand(t, skopeoBinary, "--override-arch=arm64", "inspect", "--config", "containers-storage:"+storage+"test@"+digest) var image2 imgspecv1.Image err = json.Unmarshal([]byte(i2), &image2) require.NoError(t, err) assert.Equal(t, "arm64", image2.Architecture) i3 := combinedOutputOfCommand(t, skopeoBinary, "--override-arch=arm64", "inspect", "--config", "containers-storage:"+storage+"test@"+arm64Instance.String()) var image3 imgspecv1.Image err = json.Unmarshal([]byte(i3), &image3) require.NoError(t, err) assert.Equal(t, "arm64", image3.Architecture) } func (s *copySuite) TestCopyWithManifestListStorageDigestMultipleArchesThirdUsesListDigest() { t := s.T() storage := t.TempDir() storage = fmt.Sprintf("[vfs@%s/root+%s/runroot]", storage, storage) m := combinedOutputOfCommand(t, skopeoBinary, "inspect", "--retry-times", "3", "--raw", knownListImage) manifestDigest, err := manifest.Digest([]byte(m)) require.NoError(t, err) digest := manifestDigest.String() list, err := manifest.ListFromBlob([]byte(m), manifest.GuessMIMEType([]byte(m))) require.NoError(t, err) amd64Instance, err := list.ChooseInstance(&types.SystemContext{ArchitectureChoice: "amd64"}) require.NoError(t, err) arm64Instance, err := list.ChooseInstance(&types.SystemContext{ArchitectureChoice: "arm64"}) require.NoError(t, err) assertSkopeoSucceeds(t, "", "--override-arch=amd64", "copy", "--retry-times", "3", knownListImageRepo+"@"+amd64Instance.String(), "containers-storage:"+storage+"test@"+amd64Instance.String()) assertSkopeoSucceeds(t, "", "--override-arch=amd64", "copy", "--retry-times", "3", knownListImageRepo+"@"+digest, "containers-storage:"+storage+"test@"+digest) assertSkopeoSucceeds(t, "", "--override-arch=arm64", "copy", "--retry-times", "3", knownListImageRepo+"@"+digest, "containers-storage:"+storage+"test@"+digest) assertSkopeoFails(t, `.*reading manifest for image instance.*does not exist.*`, "--override-arch=amd64", "inspect", "--config", "containers-storage:"+storage+"test@"+digest) i1 := combinedOutputOfCommand(t, skopeoBinary, "--override-arch=amd64", "inspect", "--config", "containers-storage:"+storage+"test@"+amd64Instance.String()) var image1 imgspecv1.Image err = json.Unmarshal([]byte(i1), &image1) require.NoError(t, err) assert.Equal(t, "amd64", image1.Architecture) i2 := combinedOutputOfCommand(t, skopeoBinary, "--override-arch=arm64", "inspect", "--config", "containers-storage:"+storage+"test@"+digest) var image2 imgspecv1.Image err = json.Unmarshal([]byte(i2), &image2) require.NoError(t, err) assert.Equal(t, "arm64", image2.Architecture) i3 := combinedOutputOfCommand(t, skopeoBinary, "--override-arch=arm64", "inspect", "--config", "containers-storage:"+storage+"test@"+arm64Instance.String()) var image3 imgspecv1.Image err = json.Unmarshal([]byte(i3), &image3) require.NoError(t, err) assert.Equal(t, "arm64", image3.Architecture) } func (s *copySuite) TestCopyWithManifestListStorageDigestMultipleArchesTagAndDigest() { t := s.T() storage := t.TempDir() storage = fmt.Sprintf("[vfs@%s/root+%s/runroot]", storage, storage) m := combinedOutputOfCommand(t, skopeoBinary, "inspect", "--retry-times", "3", "--raw", knownListImage) manifestDigest, err := manifest.Digest([]byte(m)) require.NoError(t, err) digest := manifestDigest.String() list, err := manifest.ListFromBlob([]byte(m), manifest.GuessMIMEType([]byte(m))) require.NoError(t, err) amd64Instance, err := list.ChooseInstance(&types.SystemContext{ArchitectureChoice: "amd64"}) require.NoError(t, err) arm64Instance, err := list.ChooseInstance(&types.SystemContext{ArchitectureChoice: "arm64"}) require.NoError(t, err) assertSkopeoSucceeds(t, "", "--override-arch=amd64", "copy", "--retry-times", "3", knownListImage, "containers-storage:"+storage+"test:latest") assertSkopeoSucceeds(t, "", "--override-arch=arm64", "copy", "--retry-times", "3", knownListImageRepo+"@"+digest, "containers-storage:"+storage+"test@"+digest) assertSkopeoFails(t, `.*reading manifest for image instance.*does not exist.*`, "--override-arch=amd64", "inspect", "--config", "containers-storage:"+storage+"test@"+digest) i1 := combinedOutputOfCommand(t, skopeoBinary, "--override-arch=arm64", "inspect", "--config", "containers-storage:"+storage+"test:latest") var image1 imgspecv1.Image err = json.Unmarshal([]byte(i1), &image1) require.NoError(t, err) assert.Equal(t, "amd64", image1.Architecture) i2 := combinedOutputOfCommand(t, skopeoBinary, "--override-arch=amd64", "inspect", "--config", "containers-storage:"+storage+"test@"+amd64Instance.String()) var image2 imgspecv1.Image err = json.Unmarshal([]byte(i2), &image2) require.NoError(t, err) assert.Equal(t, "amd64", image2.Architecture) i3 := combinedOutputOfCommand(t, skopeoBinary, "--override-arch=amd64", "inspect", "--config", "containers-storage:"+storage+"test:latest") var image3 imgspecv1.Image err = json.Unmarshal([]byte(i3), &image3) require.NoError(t, err) assert.Equal(t, "amd64", image3.Architecture) i4 := combinedOutputOfCommand(t, skopeoBinary, "--override-arch=arm64", "inspect", "--config", "containers-storage:"+storage+"test@"+arm64Instance.String()) var image4 imgspecv1.Image err = json.Unmarshal([]byte(i4), &image4) require.NoError(t, err) assert.Equal(t, "arm64", image4.Architecture) i5 := combinedOutputOfCommand(t, skopeoBinary, "--override-arch=arm64", "inspect", "--config", "containers-storage:"+storage+"test@"+digest) var image5 imgspecv1.Image err = json.Unmarshal([]byte(i5), &image5) require.NoError(t, err) assert.Equal(t, "arm64", image5.Architecture) } func (s *copySuite) TestCopyFailsWhenImageOSDoesNotMatchRuntimeOS() { t := s.T() storage := t.TempDir() storage = fmt.Sprintf("[vfs@%s/root+%s/runroot]", storage, storage) assertSkopeoFails(t, `.*no image found in manifest list for architecture .*, variant .*, OS .*`, "copy", "--retry-times", "3", knownWindowsOnlyImage, "containers-storage:"+storage+"test") } func (s *copySuite) TestCopySucceedsWhenImageDoesNotMatchRuntimeButWeOverride() { t := s.T() storage := t.TempDir() storage = fmt.Sprintf("[vfs@%s/root+%s/runroot]", storage, storage) assertSkopeoSucceeds(t, "", "--override-os=windows", "--override-arch=amd64", "copy", "--retry-times", "3", knownWindowsOnlyImage, "containers-storage:"+storage+"test") } func (s *copySuite) TestCopySimpleAtomicRegistry() { t := s.T() dir1 := t.TempDir() dir2 := t.TempDir() // FIXME: It would be nice to use one of the local Docker registries instead of needing an Internet connection. // "pull": docker: → dir: assertSkopeoSucceeds(t, "", "copy", testFQIN64, "--retry-times", "3", "dir:"+dir1) // "push": dir: → atomic: assertSkopeoSucceeds(t, "", "--tls-verify=false", "--debug", "copy", "dir:"+dir1, "atomic:localhost:5000/myns/unsigned:unsigned") // The result of pushing and pulling is an equivalent image, except for schema1 embedded names. assertSkopeoSucceeds(t, "", "--tls-verify=false", "copy", "atomic:localhost:5000/myns/unsigned:unsigned", "dir:"+dir2) assertSchema1DirImagesAreEqualExceptNames(t, dir1, "libpod/busybox:amd64", dir2, "myns/unsigned:unsigned") } // The most basic (skopeo copy) use: func (s *copySuite) TestCopySimple() { t := s.T() const ourRegistry = "docker://" + v2DockerRegistryURL + "/" dir1 := t.TempDir() dir2 := t.TempDir() // FIXME: It would be nice to use one of the local Docker registries instead of needing an Internet connection. // "pull": docker: → dir: assertSkopeoSucceeds(t, "", "copy", "--retry-times", "3", "docker://registry.k8s.io/pause", "dir:"+dir1) // "push": dir: → docker(v2s2): assertSkopeoSucceeds(t, "", "--tls-verify=false", "--debug", "copy", "dir:"+dir1, ourRegistry+"pause:unsigned") // The result of pushing and pulling is an unmodified image. assertSkopeoSucceeds(t, "", "--tls-verify=false", "copy", ourRegistry+"pause:unsigned", "dir:"+dir2) out := combinedOutputOfCommand(t, "diff", "-urN", dir1, dir2) assert.Equal(t, "", out) // docker v2s2 -> OCI image layout with image name // ociDest will be created by oci: if it doesn't exist // so don't create it here to exercise auto-creation ociDest := "pause-latest-image" ociImgName := "pause" defer os.RemoveAll(ociDest) assertSkopeoSucceeds(t, "", "copy", "--retry-times", "3", "docker://registry.k8s.io/pause:latest", "oci:"+ociDest+":"+ociImgName) _, err := os.Stat(ociDest) require.NoError(t, err) // copy exits with status 2 if the image is not found within the container, in some transports. assertSkopeoFailsWithStatus(t, 2, "copy", "oci:"+ociDest+":thisdoesnotexist", "dir:"+t.TempDir()) // docker v2s2 -> OCI image layout without image name ociDest = "pause-latest-noimage" defer os.RemoveAll(ociDest) assertSkopeoSucceeds(t, "", "copy", "--retry-times", "3", "docker://registry.k8s.io/pause:latest", "oci:"+ociDest) _, err = os.Stat(ociDest) require.NoError(t, err) } func (s *copySuite) TestCopyEncryption() { t := s.T() originalImageDir := t.TempDir() encryptedImgDir := t.TempDir() decryptedImgDir := t.TempDir() keysDir := t.TempDir() undecryptedImgDir := t.TempDir() multiLayerImageDir := t.TempDir() partiallyEncryptedImgDir := t.TempDir() partiallyDecryptedImgDir := t.TempDir() // Create RSA key pair privateKey, err := rsa.GenerateKey(rand.Reader, 4096) require.NoError(t, err) publicKey := &privateKey.PublicKey privateKeyBytes := x509.MarshalPKCS1PrivateKey(privateKey) publicKeyBytes, err := x509.MarshalPKIXPublicKey(publicKey) require.NoError(t, err) err = os.WriteFile(keysDir+"/private.key", privateKeyBytes, 0o644) require.NoError(t, err) err = os.WriteFile(keysDir+"/public.key", publicKeyBytes, 0o644) require.NoError(t, err) // We can either perform encryption or decryption on the image. // This is why use should not be able to specify both encryption and decryption // during copy at the same time. assertSkopeoFails(t, ".*--encryption-key and --decryption-key cannot be specified together.*", "copy", "--encryption-key", "jwe:"+keysDir+"/public.key", "--decryption-key", keysDir+"/private.key", "oci:"+encryptedImgDir+":encrypted", "oci:"+decryptedImgDir+":decrypted") assertSkopeoFails(t, ".*--encryption-key and --decryption-key cannot be specified together.*", "copy", "--decryption-key", keysDir+"/private.key", "--encryption-key", "jwe:"+keysDir+"/public.key", "oci:"+encryptedImgDir+":encrypted", "oci:"+decryptedImgDir+":decrypted") // Copy a standard busybox image locally assertSkopeoSucceeds(t, "", "copy", "--retry-times", "3", testFQIN+":1.30.1", "oci:"+originalImageDir+":latest") // Encrypt the image assertSkopeoSucceeds(t, "", "copy", "--encryption-key", "jwe:"+keysDir+"/public.key", "oci:"+originalImageDir+":latest", "oci:"+encryptedImgDir+":encrypted") // An attempt to decrypt an encrypted image without a valid private key should fail invalidPrivateKey, err := rsa.GenerateKey(rand.Reader, 4096) require.NoError(t, err) invalidPrivateKeyBytes := x509.MarshalPKCS1PrivateKey(invalidPrivateKey) err = os.WriteFile(keysDir+"/invalid_private.key", invalidPrivateKeyBytes, 0o644) require.NoError(t, err) assertSkopeoFails(t, ".*no suitable key unwrapper found or none of the private keys could be used for decryption.*", "copy", "--decryption-key", keysDir+"/invalid_private.key", "oci:"+encryptedImgDir+":encrypted", "oci:"+decryptedImgDir+":decrypted") // Copy encrypted image without decrypting it assertSkopeoSucceeds(t, "", "copy", "oci:"+encryptedImgDir+":encrypted", "oci:"+undecryptedImgDir+":encrypted") // Original busybox image has gzipped layers. But encrypted busybox layers should // not be of gzip type matchLayerBlobBinaryType(t, undecryptedImgDir+"/blobs/sha256", "application/x-gzip", 0) // Decrypt the image assertSkopeoSucceeds(t, "", "copy", "--decryption-key", keysDir+"/private.key", "oci:"+undecryptedImgDir+":encrypted", "oci:"+decryptedImgDir+":decrypted") // After successful decryption we should find the gzipped layer from the // busybox image matchLayerBlobBinaryType(t, decryptedImgDir+"/blobs/sha256", "application/x-gzip", 1) // Copy a standard multi layer nginx image locally assertSkopeoSucceeds(t, "", "copy", "--retry-times", "3", testFQINMultiLayer, "oci:"+multiLayerImageDir+":latest") // Partially encrypt the image assertSkopeoSucceeds(t, "", "copy", "--encryption-key", "jwe:"+keysDir+"/public.key", "--encrypt-layer", "1", "oci:"+multiLayerImageDir+":latest", "oci:"+partiallyEncryptedImgDir+":encrypted") // Since the image is partially encrypted we should find layers that aren't encrypted matchLayerBlobBinaryType(t, partiallyEncryptedImgDir+"/blobs/sha256", "application/x-gzip", 2) // Decrypt the partially encrypted image assertSkopeoSucceeds(t, "", "copy", "--decryption-key", keysDir+"/private.key", "oci:"+partiallyEncryptedImgDir+":encrypted", "oci:"+partiallyDecryptedImgDir+":decrypted") // After successful decryption we should find the gzipped layers from the nginx image matchLayerBlobBinaryType(t, partiallyDecryptedImgDir+"/blobs/sha256", "application/x-gzip", 3) } func matchLayerBlobBinaryType(t *testing.T, ociImageDirPath string, contentType string, matchCount int) { files, err := os.ReadDir(ociImageDirPath) require.NoError(t, err) foundCount := 0 for _, f := range files { fileContent, err := os.Open(ociImageDirPath + "/" + f.Name()) require.NoError(t, err) layerContentType, err := getFileContentType(fileContent) require.NoError(t, err) if layerContentType == contentType { foundCount++ } } assert.Equal(t, matchCount, foundCount) } func getFileContentType(out *os.File) (string, error) { buffer := make([]byte, 512) if _, err := out.Read(buffer); err != nil { return "", err } contentType := http.DetectContentType(buffer) return contentType, nil } // Check whether dir: images in dir1 and dir2 are equal, ignoring schema1 signatures. func assertDirImagesAreEqual(t *testing.T, dir1, dir2 string) { // The manifests may have different JWS signatures; so, compare the manifests by digests, which // strips the signatures. digests := []digest.Digest{} for _, dir := range []string{dir1, dir2} { manifestPath := filepath.Join(dir, "manifest.json") m, err := os.ReadFile(manifestPath) require.NoError(t, err) digest, err := manifest.Digest(m) require.NoError(t, err) digests = append(digests, digest) } assert.Equal(t, digests[1], digests[0]) // Then compare the rest file by file. out := combinedOutputOfCommand(t, "diff", "-urN", "-x", "manifest.json", dir1, dir2) assert.Equal(t, "", out) } // Check whether schema1 dir: images in dir1 and dir2 are equal, ignoring schema1 signatures and the embedded path/tag values, which should have the expected values. func assertSchema1DirImagesAreEqualExceptNames(t *testing.T, dir1, ref1, dir2, ref2 string) { // The manifests may have different JWS signatures and names; so, unmarshal and delete these elements. manifests := []map[string]any{} for dir, ref := range map[string]string{dir1: ref1, dir2: ref2} { manifestPath := filepath.Join(dir, "manifest.json") m, err := os.ReadFile(manifestPath) require.NoError(t, err) data := map[string]any{} err = json.Unmarshal(m, &data) require.NoError(t, err) assert.Equal(t, float64(1), data["schemaVersion"]) colon := strings.LastIndex(ref, ":") require.NotEqual(t, -1, colon) assert.Equal(t, ref[:colon], data["name"]) assert.Equal(t, ref[colon+1:], data["tag"]) for _, key := range []string{"signatures", "name", "tag"} { delete(data, key) } manifests = append(manifests, data) } assert.Equal(t, manifests[0], manifests[1]) // Then compare the rest file by file. out := combinedOutputOfCommand(t, "diff", "-urN", "-x", "manifest.json", dir1, dir2) assert.Equal(t, "", out) } // Streaming (skopeo copy) func (s *copySuite) TestCopyStreaming() { t := s.T() dir1 := t.TempDir() dir2 := t.TempDir() // FIXME: It would be nice to use one of the local Docker registries instead of needing an Internet connection. // streaming: docker: → atomic: assertSkopeoSucceeds(t, "", "--tls-verify=false", "--debug", "copy", "--retry-times", "3", testFQIN64, "atomic:localhost:5000/myns/unsigned:streaming") // Compare (copies of) the original and the copy: assertSkopeoSucceeds(t, "", "copy", "--retry-times", "3", testFQIN64, "dir:"+dir1) assertSkopeoSucceeds(t, "", "--tls-verify=false", "copy", "atomic:localhost:5000/myns/unsigned:streaming", "dir:"+dir2) assertSchema1DirImagesAreEqualExceptNames(t, dir1, "libpod/busybox:amd64", dir2, "myns/unsigned:streaming") // FIXME: Also check pushing to docker:// } // OCI round-trip testing. It's very important to make sure that OCI <-> Docker // conversion works (while skopeo handles many things, one of the most obvious // benefits of a tool like skopeo is that you can use OCI tooling to create an // image and then as the final step convert the image to a non-standard format // like Docker). But this only works if we _test_ it. func (s *copySuite) TestCopyOCIRoundTrip() { t := s.T() const ourRegistry = "docker://" + v2DockerRegistryURL + "/" oci1 := t.TempDir() oci2 := t.TempDir() // Docker -> OCI assertSkopeoSucceeds(t, "", "--tls-verify=false", "--debug", "copy", "--retry-times", "3", testFQIN, "oci:"+oci1+":latest") // OCI -> Docker assertSkopeoSucceeds(t, "", "--tls-verify=false", "--debug", "copy", "oci:"+oci1+":latest", ourRegistry+"original/busybox:oci_copy") // Docker -> OCI assertSkopeoSucceeds(t, "", "--tls-verify=false", "--debug", "copy", ourRegistry+"original/busybox:oci_copy", "oci:"+oci2+":latest") // OCI -> Docker assertSkopeoSucceeds(t, "", "--tls-verify=false", "--debug", "copy", "oci:"+oci2+":latest", ourRegistry+"original/busybox:oci_copy2") // TODO: Add some more tags to output to and check those work properly. // First, make sure the OCI blobs are the same. This should _always_ be true. out := combinedOutputOfCommand(t, "diff", "-urN", oci1+"/blobs", oci2+"/blobs") assert.Equal(t, "", out) // For some silly reason we pass a logger to the OCI library here... logger := log.New(os.Stderr, "", 0) // Verify using the upstream OCI image validator, this should catch most // non-compliance errors. DO NOT REMOVE THIS TEST UNLESS IT'S ABSOLUTELY // NECESSARY. err := image.ValidateLayout(oci1, nil, logger) require.NoError(t, err) err = image.ValidateLayout(oci2, nil, logger) require.NoError(t, err) // Now verify that everything is identical. Currently this is true, but // because we recompute the manifests on-the-fly this doesn't necessarily // always have to be true (but if this breaks in the future __PLEASE__ make // sure that the breakage actually makes sense before removing this check). out = combinedOutputOfCommand(t, "diff", "-urN", oci1, oci2) assert.Equal(t, "", out) } // --sign-by and --policy copy, primarily using atomic: func (s *copySuite) TestCopySignatures() { t := s.T() mech, err := signature.NewGPGSigningMechanism() require.NoError(t, err) defer mech.Close() if err := mech.SupportsSigning(); err != nil { // FIXME? Test that verification and policy enforcement works, using signatures from fixtures t.Skipf("Signing not supported: %v", err) } dir := t.TempDir() dirDest := "dir:" + dir policy := s.policyFixture(nil) // type: reject assertSkopeoFails(t, fmt.Sprintf(".*Source image rejected: Running image %s:latest is rejected by policy.*", testFQIN), "--policy", policy, "copy", "--retry-times", "3", testFQIN+":latest", dirDest) // type: insecureAcceptAnything assertSkopeoSucceeds(t, "", "--policy", policy, "copy", "--retry-times", "3", "docker://quay.io/openshift/origin-hello-openshift", dirDest) // type: signedBy // Sign the images assertSkopeoSucceeds(t, "", "--tls-verify=false", "copy", "--retry-times", "3", "--sign-by", "personal@example.com", testFQIN+":1.26", "atomic:localhost:5006/myns/personal:personal") assertSkopeoSucceeds(t, "", "--tls-verify=false", "copy", "--retry-times", "3", "--sign-by", "official@example.com", testFQIN+":1.26.1", "atomic:localhost:5006/myns/official:official") // Verify that we can pull them assertSkopeoSucceeds(t, "", "--tls-verify=false", "--policy", policy, "copy", "atomic:localhost:5006/myns/personal:personal", dirDest) assertSkopeoSucceeds(t, "", "--tls-verify=false", "--policy", policy, "copy", "atomic:localhost:5006/myns/official:official", dirDest) // Verify that mis-signed images are rejected assertSkopeoSucceeds(t, "", "--tls-verify=false", "copy", "atomic:localhost:5006/myns/personal:personal", "atomic:localhost:5006/myns/official:attack") assertSkopeoSucceeds(t, "", "--tls-verify=false", "copy", "atomic:localhost:5006/myns/official:official", "atomic:localhost:5006/myns/personal:attack") // "Invalid GPG signature" is reported by the gpgme mechanism; "Missing key: $fingerprint" or "Missing key $fingerprint" by Sequoia. assertSkopeoFails(t, ".*Source image rejected: (Invalid GPG signature|Missing key).*", "--tls-verify=false", "--policy", policy, "copy", "atomic:localhost:5006/myns/personal:attack", dirDest) assertSkopeoFails(t, ".*Source image rejected: (Invalid GPG signature|Missing key).*", "--tls-verify=false", "--policy", policy, "copy", "atomic:localhost:5006/myns/official:attack", dirDest) // Verify that signed identity is verified. assertSkopeoSucceeds(t, "", "--tls-verify=false", "copy", "atomic:localhost:5006/myns/official:official", "atomic:localhost:5006/myns/naming:test1") assertSkopeoFails(t, `.*Source image rejected: Signature for identity \\"localhost:5006/myns/official:official\\" is not accepted.*`, "--tls-verify=false", "--policy", policy, "copy", "atomic:localhost:5006/myns/naming:test1", dirDest) // signedIdentity works assertSkopeoSucceeds(t, "", "--tls-verify=false", "copy", "atomic:localhost:5006/myns/official:official", "atomic:localhost:5006/myns/naming:naming") assertSkopeoSucceeds(t, "", "--tls-verify=false", "--policy", policy, "copy", "atomic:localhost:5006/myns/naming:naming", dirDest) // Verify that cosigning requirements are enforced assertSkopeoSucceeds(t, "", "--tls-verify=false", "copy", "atomic:localhost:5006/myns/official:official", "atomic:localhost:5006/myns/cosigned:cosigned") // "Invalid GPG signature" is reported by the gpgme mechanism; "Missing key: $fingerprint" or "Missing key $fingerprint" by Sequoia. assertSkopeoFails(t, ".*Source image rejected: (Invalid GPG signature|Missing key).*", "--tls-verify=false", "--policy", policy, "copy", "atomic:localhost:5006/myns/cosigned:cosigned", dirDest) assertSkopeoSucceeds(t, "", "--tls-verify=false", "copy", "--sign-by", "personal@example.com", "atomic:localhost:5006/myns/official:official", "atomic:localhost:5006/myns/cosigned:cosigned") assertSkopeoSucceeds(t, "", "--tls-verify=false", "--policy", policy, "copy", "atomic:localhost:5006/myns/cosigned:cosigned", dirDest) } // --policy copy for dir: sources func (s *copySuite) TestCopyDirSignatures() { t := s.T() mech, err := signature.NewGPGSigningMechanism() require.NoError(t, err) defer mech.Close() if err := mech.SupportsSigning(); err != nil { // FIXME? Test that verification and policy enforcement works, using signatures from fixtures t.Skipf("Signing not supported: %v", err) } topDir := t.TempDir() topDirDest := "dir:" + topDir for _, suffix := range []string{"/dir1", "/dir2", "/restricted/personal", "/restricted/official", "/restricted/badidentity", "/dest"} { err := os.MkdirAll(topDir+suffix, 0o755) require.NoError(t, err) } // Note the "/@dirpath@": The value starts with a slash so that it is not rejected in other tests which do not replace it, // but we must ensure that the result is a canonical path, not something starting with a "//". policy := s.policyFixture(map[string]string{"/@dirpath@": topDir + "/restricted"}) // Get some images. assertSkopeoSucceeds(t, "", "copy", "--retry-times", "3", testFQIN+":armfh", topDirDest+"/dir1") assertSkopeoSucceeds(t, "", "copy", "--retry-times", "3", testFQIN+":s390x", topDirDest+"/dir2") // Sign the images. By coping from a topDirDest/dirN, also test that non-/restricted paths // use the dir:"" default of insecureAcceptAnything. // (For signing, we must push to atomic: to get a Docker identity to use in the signature.) assertSkopeoSucceeds(t, "", "--tls-verify=false", "--policy", policy, "copy", "--sign-by", "personal@example.com", topDirDest+"/dir1", "atomic:localhost:5000/myns/personal:dirstaging") assertSkopeoSucceeds(t, "", "--tls-verify=false", "--policy", policy, "copy", "--sign-by", "official@example.com", topDirDest+"/dir2", "atomic:localhost:5000/myns/official:dirstaging") assertSkopeoSucceeds(t, "", "--tls-verify=false", "copy", "atomic:localhost:5000/myns/personal:dirstaging", topDirDest+"/restricted/personal") assertSkopeoSucceeds(t, "", "--tls-verify=false", "copy", "atomic:localhost:5000/myns/official:dirstaging", topDirDest+"/restricted/official") // type: signedBy, with a signedIdentity override (necessary because dir: identities can't be signed) // Verify that correct images are accepted assertSkopeoSucceeds(t, "", "--policy", policy, "copy", topDirDest+"/restricted/official", topDirDest+"/dest") // ... and that mis-signed images are rejected. // "Invalid GPG signature" is reported by the gpgme mechanism; "Missing key: $fingerprint" or "Missing key $fingerprint" by Sequoia. assertSkopeoFails(t, ".*Source image rejected: (Invalid GPG signature|Missing key).*", "--policy", policy, "copy", topDirDest+"/restricted/personal", topDirDest+"/dest") // Verify that the signed identity is verified. assertSkopeoSucceeds(t, "", "--tls-verify=false", "--policy", policy, "copy", "--sign-by", "official@example.com", topDirDest+"/dir1", "atomic:localhost:5000/myns/personal:dirstaging2") assertSkopeoSucceeds(t, "", "--tls-verify=false", "copy", "atomic:localhost:5000/myns/personal:dirstaging2", topDirDest+"/restricted/badidentity") assertSkopeoFails(t, `.*Source image rejected: .*Signature for identity \\"localhost:5000/myns/personal:dirstaging2\\" is not accepted.*`, "--policy", policy, "copy", topDirDest+"/restricted/badidentity", topDirDest+"/dest") } func (s *copySuite) TestCopySequoiaSignatures() { t := s.T() signer, err := simplesequoia.NewSigner(simplesequoia.WithSequoiaHome(testSequoiaHome), simplesequoia.WithKeyFingerprint(testSequoiaKeyFingerprint)) if err != nil { t.Skipf("Sequoia not supported: %v", err) } signer.Close() const ourRegistry = "docker://" + v2DockerRegistryURL + "/" dirDest := "dir:" + t.TempDir() policy := s.policyFixture(nil) registriesDir := t.TempDir() registriesFile := fileFromFixture(t, "fixtures/registries.yaml", map[string]string{"@lookaside@": t.TempDir(), "@split-staging@": "/var/empty", "@split-read@": "file://var/empty"}) err = os.Symlink(registriesFile, filepath.Join(registriesDir, "registries.yaml")) require.NoError(t, err) // Sign the images absSequoiaHome, err := filepath.Abs(testSequoiaHome) require.NoError(t, err) t.Setenv("SEQUOIA_HOME", absSequoiaHome) assertSkopeoSucceeds(t, "", "copy", "--retry-times", "3", "--dest-tls-verify=false", "--sign-by-sq-fingerprint", testSequoiaKeyFingerprint, testFQIN+":1.26", ourRegistry+"sequoia-no-passphrase") assertSkopeoSucceeds(t, "", "copy", "--retry-times", "3", "--dest-tls-verify=false", "--sign-by-sq-fingerprint", testSequoiaKeyFingerprintWithPassphrase, "--sign-passphrase-file", filepath.Join(absSequoiaHome, "with-passphrase.passphrase"), testFQIN+":1.26.1", ourRegistry+"sequoia-with-passphrase") // Verify that we can pull them assertSkopeoSucceeds(t, "", "--policy", policy, "copy", "--src-tls-verify=false", ourRegistry+"sequoia-no-passphrase", dirDest) assertSkopeoSucceeds(t, "", "--policy", policy, "copy", "--src-tls-verify=false", ourRegistry+"sequoia-with-passphrase", dirDest) } // Compression during copy func (s *copySuite) TestCopyCompression() { t := s.T() const uncompresssedLayerFile = "160d823fdc48e62f97ba62df31e55424f8f5eb6b679c865eec6e59adfe304710" topDir := t.TempDir() for i, c := range []struct{ fixture, remote string }{ {"uncompressed-image-s1", "docker://" + v2s1SupportedDockerRegistryURL + "/compression/compression:s1"}, {"uncompressed-image-s2", "docker://" + v2DockerRegistryURL + "/compression/compression:s2"}, {"uncompressed-image-s1", "atomic:localhost:5000/myns/compression:s1"}, {"uncompressed-image-s2", "atomic:localhost:5000/myns/compression:s2"}, } { dir := filepath.Join(topDir, fmt.Sprintf("case%d", i)) err := os.MkdirAll(dir, 0o755) require.NoError(t, err) assertSkopeoSucceeds(t, "", "--tls-verify=false", "copy", "dir:fixtures/"+c.fixture, c.remote) assertSkopeoSucceeds(t, "", "--tls-verify=false", "copy", c.remote, "dir:"+dir) // The original directory contained an uncompressed file, the copy after pushing and pulling doesn't (we use a different name for the compressed file). _, err = os.Lstat(filepath.Join("fixtures", c.fixture, uncompresssedLayerFile)) require.NoError(t, err) _, err = os.Lstat(filepath.Join(dir, uncompresssedLayerFile)) require.Error(t, err) assert.True(t, os.IsNotExist(err)) // All pulled layers are smaller than the uncompressed size of uncompresssedLayerFile. (Note that this includes the manifest in s2, but that works out OK). dirf, err := os.Open(dir) require.NoError(t, err) fis, err := dirf.Readdir(-1) require.NoError(t, err) for _, fi := range fis { assert.Less(t, fi.Size(), int64(2048)) } } } func findRegularFiles(t *testing.T, root string) []string { result := []string{} err := filepath.WalkDir(root, func(path string, d fs.DirEntry, err error) error { if err != nil { return err } if d.Type().IsRegular() { result = append(result, path) } return nil }) require.NoError(t, err) return result } // --sign-by and policy use for docker: with lookaside func (s *copySuite) TestCopyDockerLookaside() { t := s.T() mech, err := signature.NewGPGSigningMechanism() require.NoError(t, err) defer mech.Close() if err := mech.SupportsSigning(); err != nil { // FIXME? Test that verification and policy enforcement works, using signatures from fixtures t.Skipf("Signing not supported: %v", err) } const ourRegistry = "docker://" + v2DockerRegistryURL + "/" tmpDir := t.TempDir() copyDest := filepath.Join(tmpDir, "dest") err = os.Mkdir(copyDest, 0o755) require.NoError(t, err) dirDest := "dir:" + copyDest plainLookaside := filepath.Join(tmpDir, "lookaside") splitLookasideStaging := filepath.Join(tmpDir, "lookaside-staging") splitLookasideReadServerHandler := http.NotFoundHandler() splitLookasideReadServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { splitLookasideReadServerHandler.ServeHTTP(w, r) })) defer splitLookasideReadServer.Close() policy := s.policyFixture(nil) registriesDir := filepath.Join(tmpDir, "registries.d") err = os.Mkdir(registriesDir, 0o755) require.NoError(t, err) registriesFile := fileFromFixture(t, "fixtures/registries.yaml", map[string]string{"@lookaside@": plainLookaside, "@split-staging@": splitLookasideStaging, "@split-read@": splitLookasideReadServer.URL}) err = os.Symlink(registriesFile, filepath.Join(registriesDir, "registries.yaml")) require.NoError(t, err) // Get an image to work with. Also verifies that we can use Docker repositories with no lookaside configured. assertSkopeoSucceeds(t, "", "--tls-verify=false", "--registries.d", registriesDir, "copy", "--retry-times", "3", testFQIN, ourRegistry+"original/busybox") // Pulling an unsigned image fails. assertSkopeoFails(t, ".*Source image rejected: A signature was required, but no signature exists.*", "--tls-verify=false", "--policy", policy, "--registries.d", registriesDir, "copy", ourRegistry+"original/busybox", dirDest) // Signing with lookaside defined succeeds, assertSkopeoSucceeds(t, "", "--tls-verify=false", "--registries.d", registriesDir, "copy", "--sign-by", "personal@example.com", ourRegistry+"original/busybox", ourRegistry+"signed/busybox") // a signature file has been created, foundFiles := findRegularFiles(t, plainLookaside) assert.Len(t, foundFiles, 1) // and pulling a signed image succeeds. assertSkopeoSucceeds(t, "", "--tls-verify=false", "--policy", policy, "--registries.d", registriesDir, "copy", ourRegistry+"signed/busybox", dirDest) // Deleting the image succeeds, assertSkopeoSucceeds(t, "", "--tls-verify=false", "--registries.d", registriesDir, "delete", ourRegistry+"signed/busybox") // and the signature file has been deleted (but we leave the directories around). foundFiles = findRegularFiles(t, plainLookaside) assert.Len(t, foundFiles, 0) // Signing with a read/write lookaside split succeeds, assertSkopeoSucceeds(t, "", "--tls-verify=false", "--registries.d", registriesDir, "copy", "--sign-by", "personal@example.com", ourRegistry+"original/busybox", ourRegistry+"public/busybox") // and a signature file has been created. foundFiles = findRegularFiles(t, splitLookasideStaging) assert.Len(t, foundFiles, 1) // Pulling the image fails because the read lookaside URL has not been populated: assertSkopeoFails(t, ".*Source image rejected: A signature was required, but no signature exists.*", "--tls-verify=false", "--policy", policy, "--registries.d", registriesDir, "copy", ourRegistry+"public/busybox", dirDest) // Pulling the image succeeds after the read lookaside URL is available: splitLookasideReadServerHandler = http.FileServer(http.Dir(splitLookasideStaging)) assertSkopeoSucceeds(t, "", "--tls-verify=false", "--policy", policy, "--registries.d", registriesDir, "copy", ourRegistry+"public/busybox", dirDest) } // atomic: and docker: X-Registry-Supports-Signatures works and interoperates func (s *copySuite) TestCopyAtomicExtension() { t := s.T() mech, err := signature.NewGPGSigningMechanism() require.NoError(t, err) defer mech.Close() if err := mech.SupportsSigning(); err != nil { // FIXME? Test that the reading/writing works using signatures from fixtures t.Skipf("Signing not supported: %v", err) } topDir := t.TempDir() for _, subdir := range []string{"dirAA", "dirAD", "dirDA", "dirDD", "registries.d"} { err := os.MkdirAll(filepath.Join(topDir, subdir), 0o755) require.NoError(t, err) } registriesDir := filepath.Join(topDir, "registries.d") dirDest := "dir:" + topDir policy := s.policyFixture(nil) // Get an image to work with to an atomic: destination. Also verifies that we can use Docker repositories without X-Registry-Supports-Signatures assertSkopeoSucceeds(t, "", "--tls-verify=false", "--registries.d", registriesDir, "copy", "--retry-times", "3", testFQIN, "atomic:localhost:5000/myns/extension:unsigned") // Pulling an unsigned image using atomic: fails. assertSkopeoFails(t, ".*Source image rejected: A signature was required, but no signature exists.*", "--tls-verify=false", "--policy", policy, "copy", "atomic:localhost:5000/myns/extension:unsigned", dirDest+"/dirAA") // The same when pulling using docker: assertSkopeoFails(t, ".*Source image rejected: A signature was required, but no signature exists.*", "--tls-verify=false", "--policy", policy, "--registries.d", registriesDir, "copy", "docker://localhost:5000/myns/extension:unsigned", dirDest+"/dirAD") // Sign the image using atomic: assertSkopeoSucceeds(t, "", "--tls-verify=false", "copy", "--sign-by", "personal@example.com", "atomic:localhost:5000/myns/extension:unsigned", "atomic:localhost:5000/myns/extension:atomic") // Pulling the image using atomic: now succeeds. assertSkopeoSucceeds(t, "", "--tls-verify=false", "--policy", policy, "copy", "atomic:localhost:5000/myns/extension:atomic", dirDest+"/dirAA") // The same when pulling using docker: assertSkopeoSucceeds(t, "", "--tls-verify=false", "--policy", policy, "--registries.d", registriesDir, "copy", "docker://localhost:5000/myns/extension:atomic", dirDest+"/dirAD") // Both access methods result in the same data. assertDirImagesAreEqual(t, filepath.Join(topDir, "dirAA"), filepath.Join(topDir, "dirAD")) // Get another image (different so that they don't share signatures, and sign it using docker://) assertSkopeoSucceeds(t, "", "--tls-verify=false", "--registries.d", registriesDir, "copy", "--retry-times", "3", "--sign-by", "personal@example.com", testFQIN+":ppc64le", "docker://localhost:5000/myns/extension:extension") t.Logf("%s", combinedOutputOfCommand(t, "oc", "get", "istag", "extension:extension", "-o", "json")) // Pulling the image using atomic: succeeds. assertSkopeoSucceeds(t, "", "--debug", "--tls-verify=false", "--policy", policy, "copy", "atomic:localhost:5000/myns/extension:extension", dirDest+"/dirDA") // The same when pulling using docker: assertSkopeoSucceeds(t, "", "--debug", "--tls-verify=false", "--policy", policy, "--registries.d", registriesDir, "copy", "docker://localhost:5000/myns/extension:extension", dirDest+"/dirDD") // Both access methods result in the same data. assertDirImagesAreEqual(t, filepath.Join(topDir, "dirDA"), filepath.Join(topDir, "dirDD")) } // Both mirroring support in registries.conf, and mirrored remapIdentity support in policy.json func (s *copySuite) TestCopyVerifyingMirroredSignatures() { t := s.T() const regPrefix = "docker://localhost:5006/myns/mirroring-" mech, err := signature.NewGPGSigningMechanism() require.NoError(t, err) defer mech.Close() if err := mech.SupportsSigning(); err != nil { // FIXME? Test that verification and policy enforcement works, using signatures from fixtures t.Skipf("Signing not supported: %v", err) } topDir := t.TempDir() registriesDir := filepath.Join(topDir, "registries.d") // An empty directory to disable lookaside use dirDest := "dir:" + filepath.Join(topDir, "unused-dest") policy := s.policyFixture(nil) // We use X-R-S-S for this testing to avoid having to deal with the lookasides. // A downside is that OpenShift records signatures per image, so the error messages below // list all signatures for other tags used for the same image as well. // So, make sure to never create a signature that could be considered valid in a different part of the test (i.e. don't reuse tags). // Get an image to work with. assertSkopeoSucceeds(t, "", "copy", "--retry-times", "3", "--dest-tls-verify=false", testFQIN, regPrefix+"primary:unsigned") // Verify that unsigned images are rejected assertSkopeoFails(t, ".*Source image rejected: A signature was required, but no signature exists.*", "--policy", policy, "--registries.d", registriesDir, "--registries-conf", "fixtures/registries.conf", "copy", "--src-tls-verify=false", regPrefix+"primary:unsigned", dirDest) // Sign the image for the primary location assertSkopeoSucceeds(t, "", "--registries.d", registriesDir, "copy", "--src-tls-verify=false", "--dest-tls-verify=false", "--sign-by", "personal@example.com", regPrefix+"primary:unsigned", regPrefix+"primary:direct") // Verify that a correctly signed image in the primary location is usable. assertSkopeoSucceeds(t, "", "--policy", policy, "--registries.d", registriesDir, "--registries-conf", "fixtures/registries.conf", "copy", "--src-tls-verify=false", regPrefix+"primary:direct", dirDest) // Sign the image for the mirror assertSkopeoSucceeds(t, "", "--registries.d", registriesDir, "copy", "--src-tls-verify=false", "--dest-tls-verify=false", "--sign-by", "personal@example.com", regPrefix+"primary:unsigned", regPrefix+"mirror:mirror-signed") // Verify that a correctly signed image for the mirror is accessible using the mirror's reference assertSkopeoSucceeds(t, "", "--policy", policy, "--registries.d", registriesDir, "--registries-conf", "fixtures/registries.conf", "copy", "--src-tls-verify=false", regPrefix+"mirror:mirror-signed", dirDest) // … but verify that while it is accessible using the primary location redirecting to the mirror, … assertSkopeoSucceeds(t, "" /* no --policy */, "--registries-conf", "fixtures/registries.conf", "copy", "--src-tls-verify=false", regPrefix+"primary:mirror-signed", dirDest) // … verify it is NOT accessible when requiring a signature. assertSkopeoFails(t, `.*Source image rejected: None of the signatures were accepted, reasons: Signature for identity \\"localhost:5006/myns/mirroring-primary:direct\\" is not accepted; Signature for identity \\"localhost:5006/myns/mirroring-mirror:mirror-signed\\" is not accepted.*`, "--policy", policy, "--registries.d", registriesDir, "--registries-conf", "fixtures/registries.conf", "copy", "--src-tls-verify=false", regPrefix+"primary:mirror-signed", dirDest) // Fail if we specify an unqualified identity assertSkopeoFails(t, ".*Could not parse --sign-identity: repository name must be canonical.*", "--registries.d", registriesDir, "copy", "--src-tls-verify=false", "--dest-tls-verify=false", "--sign-by=personal@example.com", "--sign-identity=this-is-not-fully-specified", regPrefix+"primary:unsigned", regPrefix+"mirror:primary-signed") // Create a signature for mirroring-primary:primary-signed without pushing there. assertSkopeoSucceeds(t, "", "--registries.d", registriesDir, "copy", "--src-tls-verify=false", "--dest-tls-verify=false", "--sign-by=personal@example.com", "--sign-identity=localhost:5006/myns/mirroring-primary:primary-signed", regPrefix+"primary:unsigned", regPrefix+"mirror:primary-signed") // Verify that a correctly signed image for the primary is accessible using the primary's reference assertSkopeoSucceeds(t, "", "--policy", policy, "--registries.d", registriesDir, "--registries-conf", "fixtures/registries.conf", "copy", "--src-tls-verify=false", regPrefix+"primary:primary-signed", dirDest) // … but verify that while it is accessible using the mirror location assertSkopeoSucceeds(t, "" /* no --policy */, "--registries-conf", "fixtures/registries.conf", "copy", "--src-tls-verify=false", regPrefix+"mirror:primary-signed", dirDest) // … verify it is NOT accessible when requiring a signature. assertSkopeoFails(t, `.*Source image rejected: None of the signatures were accepted, reasons: Signature for identity \\"localhost:5006/myns/mirroring-primary:direct\\" is not accepted; Signature for identity \\"localhost:5006/myns/mirroring-mirror:mirror-signed\\" is not accepted; Signature for identity \\"localhost:5006/myns/mirroring-primary:primary-signed\\" is not accepted.*`, "--policy", policy, "--registries.d", registriesDir, "--registries-conf", "fixtures/registries.conf", "copy", "--src-tls-verify=false", regPrefix+"mirror:primary-signed", dirDest) assertSkopeoSucceeds(t, "", "--registries.d", registriesDir, "--registries-conf", "fixtures/registries.conf", "copy", "--src-tls-verify=false", "--dest-tls-verify=false", regPrefix+"primary:unsigned", regPrefix+"remap:remapped") // Verify that while a remapIdentity image is accessible using the remapped (mirror) location assertSkopeoSucceeds(t, "" /* no --policy */, "--registries.d", registriesDir, "--registries-conf", "fixtures/registries.conf", "copy", "--src-tls-verify=false", regPrefix+"remap:remapped", dirDest) // … it is NOT accessible when requiring a signature … assertSkopeoFails(t, `.*Source image rejected: None of the signatures were accepted, reasons: Signature for identity \\"localhost:5006/myns/mirroring-primary:direct\\" is not accepted; Signature for identity \\"localhost:5006/myns/mirroring-mirror:mirror-signed\\" is not accepted; Signature for identity \\"localhost:5006/myns/mirroring-primary:primary-signed\\" is not accepted.*`, "--policy", policy, "--registries.d", registriesDir, "--registries-conf", "fixtures/registries.conf", "copy", "--src-tls-verify=false", regPrefix+"remap:remapped", dirDest) // … until signed. assertSkopeoSucceeds(t, "", "--registries.d", registriesDir, "copy", "--src-tls-verify=false", "--dest-tls-verify=false", "--sign-by=personal@example.com", "--sign-identity=localhost:5006/myns/mirroring-primary:remapped", regPrefix+"remap:remapped", regPrefix+"remap:remapped") assertSkopeoSucceeds(t, "", "--policy", policy, "--registries.d", registriesDir, "--registries-conf", "fixtures/registries.conf", "copy", "--src-tls-verify=false", regPrefix+"remap:remapped", dirDest) // To be extra clear about the semantics, verify that the signedPrefix (primary) location never exists // and only the remapped prefix (mirror) is accessed. assertSkopeoFails(t, ".*initializing source docker://localhost:5006/myns/mirroring-primary:remapped:.*manifest unknown.*", "--policy", policy, "--registries.d", registriesDir, "--registries-conf", "fixtures/registries.conf", "copy", "--src-tls-verify=false", regPrefix+"primary:remapped", dirDest) } func (s *skopeoSuite) TestCopySrcWithAuth() { t := s.T() assertSkopeoSucceeds(t, "", "--tls-verify=false", "copy", "--retry-times", "3", "--dest-creds=testuser:testpassword", testFQIN, fmt.Sprintf("docker://%s/busybox:latest", s.regV2WithAuth.url)) dir1 := t.TempDir() assertSkopeoSucceeds(t, "", "--tls-verify=false", "copy", "--src-creds=testuser:testpassword", fmt.Sprintf("docker://%s/busybox:latest", s.regV2WithAuth.url), "dir:"+dir1) } func (s *skopeoSuite) TestCopyDestWithAuth() { t := s.T() assertSkopeoSucceeds(t, "", "--tls-verify=false", "copy", "--retry-times", "3", "--dest-creds=testuser:testpassword", testFQIN, fmt.Sprintf("docker://%s/busybox:latest", s.regV2WithAuth.url)) } func (s *skopeoSuite) TestCopySrcAndDestWithAuth() { t := s.T() assertSkopeoSucceeds(t, "", "--tls-verify=false", "copy", "--retry-times", "3", "--dest-creds=testuser:testpassword", testFQIN, fmt.Sprintf("docker://%s/busybox:latest", s.regV2WithAuth.url)) assertSkopeoSucceeds(t, "", "--tls-verify=false", "copy", "--src-creds=testuser:testpassword", "--dest-creds=testuser:testpassword", fmt.Sprintf("docker://%s/busybox:latest", s.regV2WithAuth.url), fmt.Sprintf("docker://%s/test:auth", s.regV2WithAuth.url)) } func (s *copySuite) TestCopyNoPanicOnHTTPResponseWithoutTLSVerifyFalse() { t := s.T() topDir := t.TempDir() const ourRegistry = "docker://" + v2DockerRegistryURL + "/" assertSkopeoFails(t, ".*server gave HTTP response to HTTPS client.*", "copy", ourRegistry+"foobar", "dir:"+topDir) } func (s *copySuite) TestCopySchemaConversion() { t := s.T() // Test conversion / schema autodetection both for the OpenShift embedded registry… s.testCopySchemaConversionRegistries(t, "docker://localhost:5005/myns/schema1", "docker://localhost:5006/myns/schema2") // … and for various docker/distribution registry versions. s.testCopySchemaConversionRegistries(t, "docker://"+v2s1OnlyDockerRegistryURL+"/schema1", "docker://"+v2s1SupportedDockerRegistryURL+"/schema2") } func (s *copySuite) TestCopyManifestConversion() { t := s.T() topDir := t.TempDir() srcDir := filepath.Join(topDir, "source") destDir1 := filepath.Join(topDir, "dest1") destDir2 := filepath.Join(topDir, "dest2") // oci to v2s1 and vice-versa not supported yet // get v2s2 manifest type assertSkopeoSucceeds(t, "", "copy", "--retry-times", "3", testFQIN, "dir:"+srcDir) verifyManifestMIMEType(t, srcDir, manifest.DockerV2Schema2MediaType) // convert from v2s2 to oci assertSkopeoSucceeds(t, "", "copy", "--format=oci", "dir:"+srcDir, "dir:"+destDir1) verifyManifestMIMEType(t, destDir1, imgspecv1.MediaTypeImageManifest) // convert from oci to v2s2 assertSkopeoSucceeds(t, "", "copy", "--format=v2s2", "dir:"+destDir1, "dir:"+destDir2) verifyManifestMIMEType(t, destDir2, manifest.DockerV2Schema2MediaType) // convert from v2s2 to v2s1 assertSkopeoSucceeds(t, "", "copy", "--format=v2s1", "dir:"+srcDir, "dir:"+destDir1) verifyManifestMIMEType(t, destDir1, manifest.DockerV2Schema1SignedMediaType) // convert from v2s1 to v2s2 assertSkopeoSucceeds(t, "", "copy", "--format=v2s2", "dir:"+destDir1, "dir:"+destDir2) verifyManifestMIMEType(t, destDir2, manifest.DockerV2Schema2MediaType) } func (s *copySuite) TestCopyPreserveDigests() { t := s.T() topDir := t.TempDir() assertSkopeoSucceeds(t, "", "copy", "--retry-times", "3", knownListImage, "--multi-arch=all", "--preserve-digests", "dir:"+topDir) assertSkopeoFails(t, ".*Instructed to preserve digests.*", "copy", "--retry-times", "3", knownListImage, "--multi-arch=all", "--preserve-digests", "--format=oci", "dir:"+topDir) } func (s *copySuite) testCopySchemaConversionRegistries(t *testing.T, schema1Registry, schema2Registry string) { topDir := t.TempDir() for _, subdir := range []string{"input1", "input2", "dest2"} { err := os.MkdirAll(filepath.Join(topDir, subdir), 0o755) require.NoError(t, err) } input1Dir := filepath.Join(topDir, "input1") input2Dir := filepath.Join(topDir, "input2") destDir := filepath.Join(topDir, "dest2") // Ensure we are working with a schema2 image. // dir: accepts any manifest format, i.e. this makes …/input2 a schema2 source which cannot be asked to produce schema1 like ordinary docker: registries can. assertSkopeoSucceeds(t, "", "copy", "--retry-times", "3", testFQIN, "dir:"+input2Dir) verifyManifestMIMEType(t, input2Dir, manifest.DockerV2Schema2MediaType) // 2→2 (the "f2t2" in tag means "from 2 to 2") assertSkopeoSucceeds(t, "", "copy", "--dest-tls-verify=false", "dir:"+input2Dir, schema2Registry+":f2t2") assertSkopeoSucceeds(t, "", "copy", "--src-tls-verify=false", schema2Registry+":f2t2", "dir:"+destDir) verifyManifestMIMEType(t, destDir, manifest.DockerV2Schema2MediaType) // 2→1; we will use the result as a schema1 image for further tests. assertSkopeoSucceeds(t, "", "copy", "--dest-tls-verify=false", "dir:"+input2Dir, schema1Registry+":f2t1") assertSkopeoSucceeds(t, "", "copy", "--src-tls-verify=false", schema1Registry+":f2t1", "dir:"+input1Dir) verifyManifestMIMEType(t, input1Dir, manifest.DockerV2Schema1SignedMediaType) // 1→1 assertSkopeoSucceeds(t, "", "copy", "--dest-tls-verify=false", "dir:"+input1Dir, schema1Registry+":f1t1") assertSkopeoSucceeds(t, "", "copy", "--src-tls-verify=false", schema1Registry+":f1t1", "dir:"+destDir) verifyManifestMIMEType(t, destDir, manifest.DockerV2Schema1SignedMediaType) // 1→2: image stays unmodified schema1 assertSkopeoSucceeds(t, "", "copy", "--dest-tls-verify=false", "dir:"+input1Dir, schema2Registry+":f1t2") assertSkopeoSucceeds(t, "", "copy", "--src-tls-verify=false", schema2Registry+":f1t2", "dir:"+destDir) verifyManifestMIMEType(t, destDir, manifest.DockerV2Schema1SignedMediaType) } const regConfFixture = "./fixtures/registries.conf" func (s *skopeoSuite) TestSuccessCopySrcWithMirror() { t := s.T() dir := t.TempDir() assertSkopeoSucceeds(t, "", "--registries-conf="+regConfFixture, "copy", "docker://mirror.invalid/busybox", "dir:"+dir) } func (s *skopeoSuite) TestFailureCopySrcWithMirrorsUnavailable() { t := s.T() dir := t.TempDir() // .invalid domains are, per RFC 6761, supposed to result in NXDOMAIN. // With systemd-resolved (used only via NSS?), we instead seem to get “Temporary failure in name resolution” assertSkopeoFails(t, ".*(no such host|Temporary failure in name resolution).*", "--registries-conf="+regConfFixture, "copy", "docker://invalid.invalid/busybox", "dir:"+dir) } func (s *skopeoSuite) TestSuccessCopySrcWithMirrorAndPrefix() { t := s.T() dir := t.TempDir() assertSkopeoSucceeds(t, "", "--registries-conf="+regConfFixture, "copy", "docker://gcr.invalid/foo/bar/busybox", "dir:"+dir) } func (s *skopeoSuite) TestFailureCopySrcWithMirrorAndPrefixUnavailable() { t := s.T() dir := t.TempDir() // .invalid domains are, per RFC 6761, supposed to result in NXDOMAIN. // With systemd-resolved (used only via NSS?), we instead seem to get “Temporary failure in name resolution” assertSkopeoFails(t, ".*(no such host|Temporary failure in name resolution).*", "--registries-conf="+regConfFixture, "copy", "docker://gcr.invalid/wrong/prefix/busybox", "dir:"+dir) } func (s *copySuite) TestCopyFailsWhenReferenceIsInvalid() { t := s.T() assertSkopeoFails(t, `.*Invalid image name.*`, "copy", "unknown:transport", "unknown:test") } func (s *copySuite) TestInsecurePolicyAndRequireSignedConflict() { t := s.T() assertSkopeoFails(t, ".*--insecure-policy and --require-signed are mutually exclusive.*", "--insecure-policy", "--require-signed", "inspect", "dir:/nonexistent") } func (s *copySuite) TestRequireSignedAcceptsSignedImage() { t := s.T() mech, err := signature.NewGPGSigningMechanism() require.NoError(t, err) defer mech.Close() if err := mech.SupportsSigning(); err != nil { t.Skipf("Signing not supported: %v", err) } srcDir := t.TempDir() // get an image to work with assertSkopeoSucceeds(t, "", "copy", "--retry-times", "3", testFQIN64, "dir:"+srcDir) // first, sanity-check that without --require-signed, we can copy it since by default, `dir:` is insecureAcceptAnything destDir1 := t.TempDir() assertSkopeoSucceeds(t, "", "copy", "dir:"+srcDir, "dir:"+destDir1) // now verify that copying fails with --require-signed destDir2 := t.TempDir() assertSkopeoFails(t, ".*Source image rejected: No signature verification policy found for image.*", "--require-signed", "copy", "dir:"+srcDir, "dir:"+destDir2) // sign the image manifestPath := filepath.Join(srcDir, "manifest.json") signaturePath := filepath.Join(srcDir, "signature-1") dockerReference := "localhost/test:latest" assertSkopeoSucceeds(t, "", "standalone-sign", "-o", signaturePath, manifestPath, dockerReference, s.fingerprint) // sanity-check signature file is there _, err = os.Stat(signaturePath) require.NoError(t, err) // create a basic policy that requires signatures policy := map[string]any{ "default": []map[string]any{{ "type": "signedBy", "keyType": "GPGKeys", "keyPath": filepath.Join(s.gpgHome, "personal-pubkey.gpg"), "signedIdentity": map[string]any{ "type": "exactRepository", "dockerRepository": dockerReference, }, }}, } policyJSON, err := json.Marshal(policy) require.NoError(t, err) policyFile := filepath.Join(t.TempDir(), "policy.json") err = os.WriteFile(policyFile, policyJSON, 0o600) require.NoError(t, err) // now copying with --require-signed should pass destDir3 := t.TempDir() assertSkopeoSucceeds(t, "", "--policy", policyFile, "--require-signed", "copy", "dir:"+srcDir, "dir:"+destDir3) // Delete the signature and sanity-check that copying fails. This doesn't // strictly test --require-signed, but rather the PolicyRequirements logic, but // it makes the test feel complete. err = os.Remove(signaturePath) require.NoError(t, err) destDir4 := t.TempDir() assertSkopeoFails(t, ".*Source image rejected: A signature was required, but no signature exists.*", "--policy", policyFile, "--require-signed", "copy", "dir:"+srcDir, "dir:"+destDir4) } ================================================ FILE: integration/fixtures/.gitignore ================================================ /data/pgp.cert.d/_sequoia* ================================================ FILE: integration/fixtures/blocked-registries.conf ================================================ [[registry]] location = "registry-unblocked.com" [[registry]] location = "registry-blocked.com" blocked = true ================================================ FILE: integration/fixtures/data/keystore/keystore.cookie ================================================ ================================================ FILE: integration/fixtures/data/pgp.cert.d/writelock ================================================ ================================================ FILE: integration/fixtures/image.manifest.json ================================================ { "schemaVersion": 2, "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "config": { "mediaType": "application/vnd.docker.container.image.v1+json", "size": 7023, "digest": "sha256:b5b2b2c507a0944348e0303114d8d93aaaa081732b86451d9bce1f432a537bc7" }, "layers": [ { "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip", "size": 32654, "digest": "sha256:e692418e4cbaf90ca69d05a66403747baa33ee08806650b51fab815ad7fc331f" }, { "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip", "size": 16724, "digest": "sha256:3c3a4604a545cdc127456d94e421cd355bca5b528f4a9c1905b15da2eb4a4c6b" }, { "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip", "size": 73109, "digest": "sha256:ec4b8955958665577945c89419d1af06b5f7636b4ac3da7f12184802ad867736" } ] } ================================================ FILE: integration/fixtures/no-passphrase.pub ================================================ -----BEGIN PGP PUBLIC KEY BLOCK----- xjMEaGwFVhYJKwYBBAHaRw8BAQdAZzfnqEAgvE3RoCtPWEOc3Xp8oMURR0qjq+Ru PHJrc6TCwAsEHxYKAH0FgmhsBVYDCwkHCRD2+Qi2+kiiKUcUAAAAAAAeACBzYWx0 QG5vdGF0aW9ucy5zZXF1b2lhLXBncC5vcmcEjRQtILaFnIhczxeUkcfW0KMHEZ30 wTdJ1v1iHB7NKQMVCggCmwECHgkWIQRQ3eiY305IdVyMK3r2+Qi2+kiiKQAA86gA /1ZkXWPHUxh3nQu/EL72ZeP9k/SLWkEuNKs6dJrmRud9AQCHbWwSUwKyt12EFVt/ QvMFSQ95brUxsWLHgFMPpNfWAc0aU2tvcGVvIFNlcXVvaWEgdGVzdGluZyBrZXnC wA4EExYKAIAFgmhsBVYDCwkHCRD2+Qi2+kiiKUcUAAAAAAAeACBzYWx0QG5vdGF0 aW9ucy5zZXF1b2lhLXBncC5vcmctF7xuY06GUyedOGjd2iNKwab85gV64zEAGKgi ExHRxgMVCggCmQECmwECHgkWIQRQ3eiY305IdVyMK3r2+Qi2+kiiKQAA3SEBAMe1 y6rWaPjDpkeiDthLV1Umr6NsXVBv/IJTcP9RM4quAQCwmlsdQMddCsc+K3Y5KH88 saIG0/MRZaPJdsd8vRGUCs4zBGhsBVYWCSsGAQQB2kcPAQEHQLN8yt/21QDMzcB4 2bzFRg1LpkFZWECjkb2ty7Iju/aOwsC/BBgWCgExBYJobAVWCRD2+Qi2+kiiKUcU AAAAAAAeACBzYWx0QG5vdGF0aW9ucy5zZXF1b2lhLXBncC5vcmce9QEurrtI24ys vXssO/40rI5rlsNokEEFr7CVwVgWvAKbAr6gBBkWCgBvBYJobAVWCRB63Ra9Qdgp tkcUAAAAAAAeACBzYWx0QG5vdGF0aW9ucy5zZXF1b2lhLXBncC5vcmcBWCJsdUfj oYpld4qcYBqjxsyScwpID2vkNlYMLmS+IhYhBKyZqvZ6WI3zgaapXHrdFr1B2Cm2 AAAEZwEA/UhpNN1XElYx6Xq+JMKlXywoIgButkQy1+H2EcRBeHsBAM7lq8BXvRKz bDjRlgxiIAYl77p7ihVQ5NYcuZcAlH0CFiEEUN3omN9OSHVcjCt69vkItvpIoikA AJcwAP9D4spfb28k16w2cemrWAtAE1WUgV8V+OEpE7+gpV+17gEA+0Kzf7jBHgd3 pBAWwttuRd8OHlZZzKs3f26z28I6mgLOMwRobAVWFgkrBgEEAdpHDwEBB0DPyS14 jQk1mSWNmuYR4P9M5zOfU2mkhwaqx1l3OWTZD8LAvwQYFgoBMQWCaGwFVgkQ9vkI tvpIoilHFAAAAAAAHgAgc2FsdEBub3RhdGlvbnMuc2VxdW9pYS1wZ3Aub3Jn+wfK FmPmtrsi0sY5zIq9KFmbrQyhXz/VZIw6K8D1zdECmyC+oAQZFgoAbwWCaGwFVgkQ bwujLUxU69BHFAAAAAAAHgAgc2FsdEBub3RhdGlvbnMuc2VxdW9pYS1wZ3Aub3Jn xF3KXB4+dN9suOhCD2XkYlAWUJ4GVBVV2wAmdQAueyEWIQTv1sMw2eUTIMQmb7Zv C6MtTFTr0AAA/LYA/iBkRh6dGbp76VzuuHVNUNgTqvXgz9FjizZGJKnVZctXAPwL TlHxcH6XX96AuiCy9QAMUpm8ZvMu8TAgjgOrlFPKCBYhBFDd6JjfTkh1XIwrevb5 CLb6SKIpAAA0rQD9HWbBeSoshjH6/k5ntZjOfIAha4/TLlBrMq2w+t4LWD0A/2q5 DEbYh6PwMidDxXteyHWf4Qnr0vH8vip9d+WHbDYEzjgEaGwFVhIKKwYBBAGXVQEF AQEHQLxXHw9STOAhb2PLEjrl3uQDwpaXIdigg67vId0jSstVAwEIB8LAAAQYFgoA cgWCaGwFVgkQ9vkItvpIoilHFAAAAAAAHgAgc2FsdEBub3RhdGlvbnMuc2VxdW9p YS1wZ3Aub3Jn8bvuQCv3uEYJtK6h5y5e4AY9lJtVXx3brexR5bmFCwcCmwwWIQRQ 3eiY305IdVyMK3r2+Qi2+kiiKQAAEzkA/Az97rdlp3hf97S6a5AxU8pTry4gKI63 lwKtBAT+uF/pAP9lAziQRlNEa1sX6qCXrQqeA/aQ0nj9gRJ1Wvi1PMxWBA== =7jmE -----END PGP PUBLIC KEY BLOCK----- ================================================ FILE: integration/fixtures/policy.json ================================================ { "default": [ { "type": "reject" } ], "transports": { "docker": { "localhost:5555": [ { "type": "signedBy", "keyType": "GPGKeys", "keyPath": "@keydir@/personal-pubkey.gpg" } ], "localhost:5555/sequoia-no-passphrase": [ { "type": "signedBy", "keyType": "GPGKeys", "keyPath": "@fixturedir@/no-passphrase.pub" } ], "localhost:5555/sequoia-with-passphrase": [ { "type": "signedBy", "keyType": "GPGKeys", "keyPath": "@fixturedir@/with-passphrase.pub" } ], "localhost:5000/myns/extension": [ { "type": "signedBy", "keyType": "GPGKeys", "keyPath": "@keydir@/personal-pubkey.gpg" } ], "localhost:5006/myns/mirroring-primary": [ { "type": "signedBy", "keyType": "GPGKeys", "keyPath": "@keydir@/personal-pubkey.gpg" } ], "localhost:5006/myns/mirroring-mirror": [ { "type": "signedBy", "keyType": "GPGKeys", "keyPath": "@keydir@/personal-pubkey.gpg" } ], "localhost:5006/myns/mirroring-remap": [ { "type": "signedBy", "keyType": "GPGKeys", "keyPath": "@keydir@/personal-pubkey.gpg", "signedIdentity": { "type": "remapIdentity", "prefix": "localhost:5006/myns/mirroring-remap", "signedPrefix": "localhost:5006/myns/mirroring-primary" } } ], "docker.io/openshift": [ { "type": "insecureAcceptAnything" } ], "quay.io/openshift": [ { "type": "insecureAcceptAnything" } ] }, "dir": { "/@dirpath@": [ { "type": "signedBy", "keyType": "GPGKeys", "keyPath": "@keydir@/official-pubkey.gpg", "signedIdentity": { "type": "exactRepository", "dockerRepository": "localhost:5000/myns/official" } } ], "": [ { "type": "insecureAcceptAnything" } ] }, "atomic": { "localhost:5006/myns/personal": [ { "type": "signedBy", "keyType": "GPGKeys", "keyPath": "@keydir@/personal-pubkey.gpg" } ], "localhost:5006/myns/official": [ { "type": "signedBy", "keyType": "GPGKeys", "keyPath": "@keydir@/official-pubkey.gpg" } ], "localhost:5006/myns/naming:test1": [ { "type": "signedBy", "keyType": "GPGKeys", "keyPath": "@keydir@/official-pubkey.gpg" } ], "localhost:5006/myns/naming:naming": [ { "type": "signedBy", "keyType": "GPGKeys", "keyPath": "@keydir@/official-pubkey.gpg", "signedIdentity": { "type": "exactRepository", "dockerRepository": "localhost:5006/myns/official" } } ], "localhost:5006/myns/cosigned:cosigned": [ { "type": "signedBy", "keyType": "GPGKeys", "keyPath": "@keydir@/official-pubkey.gpg", "signedIdentity": { "type": "exactRepository", "dockerRepository": "localhost:5006/myns/official" } }, { "type": "signedBy", "keyType": "GPGKeys", "keyPath": "@keydir@/personal-pubkey.gpg" } ], "localhost:5000/myns/extension": [ { "type": "signedBy", "keyType": "GPGKeys", "keyPath": "@keydir@/personal-pubkey.gpg" } ] } } } ================================================ FILE: integration/fixtures/registries.conf ================================================ [[registry]] location = "mirror.invalid" mirror = [ { location = "mirror-0.invalid" }, { location = "mirror-1.invalid" }, { location = "gcr.io/google-containers" }, ] # This entry is currently unused and exists only to ensure # that the mirror.invalid/busybox is not rewritten twice. [[registry]] location = "gcr.io" prefix = "gcr.io/google-containers" [[registry]] location = "invalid.invalid" mirror = [ { location = "invalid-mirror-0.invalid" }, { location = "invalid-mirror-1.invalid" }, ] [[registry]] location = "gcr.invalid" prefix = "gcr.invalid/foo/bar" mirror = [ { location = "wrong-mirror-0.invalid" }, { location = "gcr.io/google-containers" }, ] [[registry]] location = "localhost:5006/myns/mirroring-primary" mirror = [ { location = "localhost:5006/myns/mirroring-mirror"}, ] ================================================ FILE: integration/fixtures/registries.yaml ================================================ docker: localhost:5555: lookaside: file://@lookaside@ localhost:5555/public: lookaside-staging: file://@split-staging@ lookaside: @split-read@ ================================================ FILE: integration/fixtures/tls-details-1.3.yaml ================================================ minVersion: "1.3" ================================================ FILE: integration/fixtures/tls-details-anything.yaml ================================================ {} # No fields ================================================ FILE: integration/fixtures/tls-details-pqc-only.yaml ================================================ minVersion: "1.3" namedGroups: - "X25519MLKEM768" ================================================ FILE: integration/fixtures/uncompressed-image-s1/manifest.json ================================================ { "schemaVersion": 1, "name": "nonempty", "tag": "nonempty", "architecture": "amd64", "fsLayers": [ { "blobSum": "sha256:160d823fdc48e62f97ba62df31e55424f8f5eb6b679c865eec6e59adfe304710" } ], "history": [ { "v1Compatibility": "{\"architecture\":\"amd64\",\"config\":{\"Hostname\":\"59c20544b2f4\",\"Domainname\":\"\",\"User\":\"\",\"AttachStdin\":false,\"AttachStdout\":false,\"AttachStderr\":false,\"Tty\":false,\"OpenStdin\":false,\"StdinOnce\":false,\"Env\":[\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"],\"Cmd\":null,\"Image\":\"\",\"Volumes\":null,\"WorkingDir\":\"\",\"Entrypoint\":null,\"OnBuild\":null,\"Labels\":null},\"container\":\"59c20544b2f4ad7a8639433bacb1ec215b7dad4a7bf1a83b5ab4679329a46c1d\",\"container_config\":{\"Hostname\":\"59c20544b2f4\",\"Domainname\":\"\",\"User\":\"\",\"AttachStdin\":false,\"AttachStdout\":false,\"AttachStderr\":false,\"Tty\":false,\"OpenStdin\":false,\"StdinOnce\":false,\"Env\":[\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"],\"Cmd\":[\"/bin/sh\",\"-c\",\"#(nop) ADD file:14f49faade3db5e596826746d9ed3dfd658490c16c4d61d4886726153ad0591a in /\"],\"Image\":\"\",\"Volumes\":null,\"WorkingDir\":\"\",\"Entrypoint\":null,\"OnBuild\":null,\"Labels\":null},\"created\":\"2016-09-19T18:23:54.9949213Z\",\"docker_version\":\"1.10.3\",\"id\":\"4c224eac5061bb85f523ca4e3316618fd7921a80fe94286979667b1edb8e1bdd\",\"os\":\"linux\"}" } ], "signatures": [ { "header": { "jwk": { "crv": "P-256", "kid": "DGWZ:GAUM:WCOC:IMDL:D67M:CEI6:YTVH:M2CM:5HX4:FYDD:77OD:D3F7", "kty": "EC", "x": "eprZNqLO9mHZ4Z4GxefucEgov_1gwEi9lehpJR2suRo", "y": "wIr2ucNg32ROfVCkR_8A5VbBJ-mFmsoIUVa6vt8lIxM" }, "alg": "ES256" }, "signature": "bvTLWW4YVFRjAanN1EJqwQw60fWSWJPxcGO3UZGFI_gyV6ucGdW4x7jyYL6g06sg925s9cy0wN1lw91CCFv4BA", "protected": "eyJmb3JtYXRMZW5ndGgiOjE0ODcsImZvcm1hdFRhaWwiOiJDbjBLIiwidGltZSI6IjIwMTYtMDktMTlUMTg6NDM6MzNaIn0" } ] } ================================================ FILE: integration/fixtures/uncompressed-image-s2/86ce150e65c72b30f885c261449d18b7c6832596916e7f654e08377b5a67b4ff ================================================ {"architecture":"amd64","config":{"Hostname":"59c20544b2f4","Domainname":"","User":"","AttachStdin":false,"AttachStdout":false,"AttachStderr":false,"Tty":false,"OpenStdin":false,"StdinOnce":false,"Env":["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"],"Cmd":null,"Image":"","Volumes":null,"WorkingDir":"","Entrypoint":null,"OnBuild":null,"Labels":null},"container":"59c20544b2f4ad7a8639433bacb1ec215b7dad4a7bf1a83b5ab4679329a46c1d","container_config":{"Hostname":"59c20544b2f4","Domainname":"","User":"","AttachStdin":false,"AttachStdout":false,"AttachStderr":false,"Tty":false,"OpenStdin":false,"StdinOnce":false,"Env":["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"],"Cmd":["/bin/sh","-c","#(nop) ADD file:14f49faade3db5e596826746d9ed3dfd658490c16c4d61d4886726153ad0591a in /"],"Image":"","Volumes":null,"WorkingDir":"","Entrypoint":null,"OnBuild":null,"Labels":null},"created":"2016-09-19T18:23:54.9949213Z","docker_version":"1.10.3","history":[{"created":"2016-09-19T18:23:54.9949213Z","created_by":"/bin/sh -c #(nop) ADD file:14f49faade3db5e596826746d9ed3dfd658490c16c4d61d4886726153ad0591a in /"}],"os":"linux","rootfs":{"type":"layers","diff_ids":["sha256:160d823fdc48e62f97ba62df31e55424f8f5eb6b679c865eec6e59adfe304710"]}} ================================================ FILE: integration/fixtures/uncompressed-image-s2/manifest.json ================================================ { "schemaVersion": 2, "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "config": { "mediaType": "application/octet-stream", "size": 1272, "digest": "sha256:86ce150e65c72b30f885c261449d18b7c6832596916e7f654e08377b5a67b4ff" }, "layers": [ { "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip", "size": 2048, "digest": "sha256:160d823fdc48e62f97ba62df31e55424f8f5eb6b679c865eec6e59adfe304710" } ] } ================================================ FILE: integration/fixtures/with-passphrase.passphrase ================================================ WithPassphrase123 ================================================ FILE: integration/fixtures/with-passphrase.pub ================================================ -----BEGIN PGP PUBLIC KEY BLOCK----- xjMEaGwF3RYJKwYBBAHaRw8BAQdAouHF6y7foOScub78AINlTzXnEQrYrAJyH8fr 3biwuMzCwAsEHxYKAH0FgmhsBd0DCwkHCRAtEaGaukHGrkcUAAAAAAAeACBzYWx0 QG5vdGF0aW9ucy5zZXF1b2lhLXBncC5vcmdRHdDbkndmp7Q96YisL7ezwrLxSfQj 46zFb8wob+6yvgMVCggCmwECHgkWIQQfWCUoW3heHbE7820tEaGaukHGrgAAbd8A /3iwAF7qTVgqqCqLVIj8oJxrZr/jWbHbjO1DzFafQQjMAQDwwOuL9dhy9Q7N5UkW x3kq3WLEIuogh+0meAwfMrJMAM0qU2tvcGVvIFNlcXVvaWEgdGVzdGluZyBrZXkg d2l0aCBwYXNzcGhyYXNlwsAOBBMWCgCABYJobAXdAwsJBwkQLRGhmrpBxq5HFAAA AAAAHgAgc2FsdEBub3RhdGlvbnMuc2VxdW9pYS1wZ3Aub3JnwGFwQkw9BWc963pG lBgz8D9CbfsqoDS58GXyd24W8g4DFQoIApkBApsBAh4JFiEEH1glKFt4Xh2xO/Nt LRGhmrpBxq4AAKTpAPsHMyzeL+fT/EdPbU/+fi/+RbGuRQH5QHtzaDfAu+ZGUwD+ Oeoi7OOy8+bgvnEdj31TohAGEexTvhMIILglL9ymTgfOMwRobAXdFgkrBgEEAdpH DwEBB0DNeYLgt7VaYbdJ3TyTqiYp7pEuXYVYjeqRtt055Hs60cLAvwQYFgoBMQWC aGwF3QkQLRGhmrpBxq5HFAAAAAAAHgAgc2FsdEBub3RhdGlvbnMuc2VxdW9pYS1w Z3Aub3Jnr08xd/fCttifQZ/b+oVq2huO6HT9zpTITLIzPLLBI6cCmwK+oAQZFgoA bwWCaGwF3QkQVNJA3Fgs7h9HFAAAAAAAHgAgc2FsdEBub3RhdGlvbnMuc2VxdW9p YS1wZ3Aub3JnN1Kokqv7bIxnM7EODP0bX7yuAV8OP+kCivD84d8TrkEWIQQemi42 PEh1us0v16FU0kDcWCzuHwAAUisBAKBMLjhkVO+KCFNKxYoak/Hj7VAHwiqnEAXB aMstWEE1AP9rVWwZ85IdlSejb475H9HGl+Nl0a5BOioR/Y+Kl15UBxYhBB9YJShb eF4dsTvzbS0RoZq6QcauAAAKnAEAvgb1r2cteb+9wd9U5vYZ7/xXKEljojjA7CQT QFmecoYBAO3/rNK3xYcKleni3lknNhzQap+Ed6ri2WVQCKujRgIAzjMEaGwF3RYJ KwYBBAHaRw8BAQdA1JYMc2I192WwvCI/qFcLrwmFPwDDkHvNDDt4Kc2ziHjCwL8E GBYKATEFgmhsBd0JEC0RoZq6QcauRxQAAAAAAB4AIHNhbHRAbm90YXRpb25zLnNl cXVvaWEtcGdwLm9yZxDKeHct4SrN5lJ3oAkhIfwcJpCTVv9Sux05J7Pn0U6TApsg vqAEGRYKAG8FgmhsBd0JEMb35fxT9XmfRxQAAAAAAB4AIHNhbHRAbm90YXRpb25z LnNlcXVvaWEtcGdwLm9yZ9MZe54S5aYMdKLQmZiNN7Q1tot0zCuRp0DOMrZIsWQg FiEEzXeihzhK/PSlCtVwxvfl/FP1eZ8AAFpUAQC1WlWjrTCL+ZiG3X9ThPO8418f wu+p3l9jJAF1SK15QQEA6Go0+bbWOHMpkMNckSwlXhbBKVp53y2IhQnwLAfbZwoW IQQfWCUoW3heHbE7820tEaGaukHGrgAAhYMA/iuXYUHqeXNpFCmoDFWmvwHDoPIs 8ZrgBJOfSnzg+x5wAQCFIWANcwYD/rCHTN6KQY70VI/x7SmkqKJZVrIBCB7DB844 BGhsBd0SCisGAQQBl1UBBQEBB0CYZYh5OKFAiuKOx4MIk6pocGCdfpL/XrJVoWjT 9aDSNAMBCAfCwAAEGBYKAHIFgmhsBd0JEC0RoZq6QcauRxQAAAAAAB4AIHNhbHRA bm90YXRpb25zLnNlcXVvaWEtcGdwLm9yZ0oyJPZxXWc2dSxHpS1UAuvCfc80DaDy mr1nRs5/QO0aApsMFiEEH1glKFt4Xh2xO/NtLRGhmrpBxq4AANKZAP0T00LyderN Qsdk2UgpeeoZhN4wKtlUGocUs7I90P3AhgD/WuDXAlF6b9IXyTUoG9VkLrnlemCx Dii+5qsdk0HFcgA= =YS7U -----END PGP PUBLIC KEY BLOCK----- ================================================ FILE: integration/fixtures_info_test.go ================================================ package main const ( // TestImageManifestDigest is the Docker manifest digest of "fixtures/image.manifest.json" TestImageManifestDigest = "sha256:20bf21ed457b390829cdbeec8795a7bea1626991fda603e0d01b4e7f60427e55" testSequoiaHome = "./fixtures" // testSequoiaKeyFingerprint is a fingerprint of a test key in testSequoiaHome, generated using // > sq --home $(pwd)/signature/simplesequoia/testdata key generate --name 'Skopeo Sequoia testing key' --own-key --expiration=never testSequoiaKeyFingerprint = "50DDE898DF4E48755C8C2B7AF6F908B6FA48A229" // testSequoiaKeyFingerprintWithPassphrase is a fingerprint of a test key in testSequoiaHome, generated using // > sq --home $(pwd)/signature/simplesequoia/testdata key generate --name 'Skopeo Sequoia testing key with passphrase' --own-key --expiration=never testSequoiaKeyFingerprintWithPassphrase = "1F5825285B785E1DB13BF36D2D11A19ABA41C6AE" ) ================================================ FILE: integration/openshift_shell_test.go ================================================ //go:build openshift_shell package main import ( "os" "os/exec" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) /* TestRunShell is not really a test; it is a convenient way to use the registry setup code in openshift.go and CopySuite to get an interactive environment for experimentation. To use it, run: sudo make shell to start a container, then within the container: SKOPEO_CONTAINER_TESTS=1 PS1='nested> ' go test -tags openshift_shell -timeout=24h ./integration -v -run='copySuite.TestRunShell' An example of what can be done within the container: cd ..; make bin/skopeo PREFIX=/usr install ./skopeo --tls-verify=false copy --sign-by=personal@example.com docker://quay.io/libpod/busybox:latest atomic:localhost:5000/myns/personal:personal oc get istag personal:personal -o json curl -L -v 'http://localhost:5000/v2/' cat ~/.docker/config.json curl -L -v 'http://localhost:5000/openshift/token&scope=repository:myns/personal:pull' --header 'Authorization: Basic $auth_from_docker' curl -L -v 'http://localhost:5000/v2/myns/personal/manifests/personal' --header 'Authorization: Bearer $token_from_oauth' curl -L -v 'http://localhost:5000/extensions/v2/myns/personal/signatures/$manifest_digest' --header 'Authorization: Bearer $token_from_oauth' */ func (s *copySuite) TestRunShell() { t := s.T() cmd := exec.Command("bash", "-i") tty, err := os.OpenFile("/dev/tty", os.O_RDWR, 0) require.NoError(t, err) cmd.Stdin = tty cmd.Stdout = tty cmd.Stderr = tty err = cmd.Run() assert.NoError(t, err) } ================================================ FILE: integration/openshift_test.go ================================================ package main import ( "bufio" "context" "encoding/base64" "fmt" "os" "os/exec" "path/filepath" "slices" "strings" "testing" "time" "github.com/stretchr/testify/require" "go.podman.io/storage/pkg/homedir" ) var adminKUBECONFIG = map[string]string{ "KUBECONFIG": "openshift.local.config/master/admin.kubeconfig", } // openshiftCluster is an OpenShift API master and integrated registry // running on localhost. type openshiftCluster struct { workingDir string dockerDir string processes []*exec.Cmd // Processes to terminate on teardown; append to the end, terminate from end to the start. } // startOpenshiftCluster creates a new openshiftCluster. // WARNING: This affects state in users' home directory! Only run // in isolated test environment. func startOpenshiftCluster(t *testing.T) *openshiftCluster { cluster := &openshiftCluster{} cluster.workingDir = t.TempDir() cluster.startMaster(t) cluster.prepareRegistryConfig(t) cluster.startRegistry(t) cluster.ocLoginToProject(t) cluster.dockerLogin(t) cluster.relaxImageSignerPermissions(t) return cluster } // clusterCmd creates an exec.Cmd in cluster.workingDir with current environment modified by environment. func (cluster *openshiftCluster) clusterCmd(env map[string]string, name string, args ...string) *exec.Cmd { cmd := exec.Command(name, args...) cmd.Dir = cluster.workingDir cmd.Env = os.Environ() for key, value := range env { cmd.Env = modifyEnviron(cmd.Env, key, value) } return cmd } // startMaster starts the OpenShift master (etcd+API server) and waits for it to be ready, or terminates on failure. func (cluster *openshiftCluster) startMaster(t *testing.T) { cmd := cluster.clusterCmd(nil, "openshift", "start", "master") cluster.processes = append(cluster.processes, cmd) stdout, err := cmd.StdoutPipe() require.NoError(t, err) // but logging actually goes only to stderr - this primarily ensure we log any // unexpected output to stdout. cmd.Stderr = cmd.Stdout err = cmd.Start() require.NoError(t, err) portOpen, terminatePortCheck := newPortChecker(t, 8443) defer func() { t.Logf("Terminating port check") terminatePortCheck <- true }() terminateLogCheck := make(chan bool, 1) logCheckFound := make(chan bool) go func() { defer func() { t.Logf("Log checker exiting") }() scanner := bufio.NewScanner(stdout) for scanner.Scan() { line := scanner.Text() t.Logf("Log line: %s", line) if strings.Contains(line, "Started Origin Controllers") { logCheckFound <- true return // FIXME? We stop reading from stdout; could this block the master? } // Note: we can block before we get here. select { case <-terminateLogCheck: t.Logf("terminated") return default: // Do not block here and read the next line. } } logCheckFound <- false }() defer func() { t.Logf("Terminating log check") terminateLogCheck <- true }() gotPortCheck := false gotLogCheck := false ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute) defer cancel() for !gotPortCheck || !gotLogCheck { t.Logf("Waiting for master") select { case <-portOpen: t.Logf("port check done") gotPortCheck = true case found := <-logCheckFound: t.Logf("log check done, found: %t", found) if !found { t.Fatal("log check done, success message not found") } gotLogCheck = true case <-ctx.Done(): t.Fatalf("Timed out waiting for master: %v", ctx.Err()) } } t.Logf("OK, master started!") } // prepareRegistryConfig creates a registry service account and a related k8s client configuration in ${cluster.workingDir}/openshift.local.registry. func (cluster *openshiftCluster) prepareRegistryConfig(t *testing.T) { // This partially mimics the objects created by (oadm registry), except that we run the // server directly as an ordinary process instead of a pod with an implicitly attached service account. saJSON := `{ "apiVersion": "v1", "kind": "ServiceAccount", "metadata": { "name": "registry" } }` cmd := cluster.clusterCmd(adminKUBECONFIG, "oc", "create", "-f", "-") runExecCmdWithInput(t, cmd, saJSON) cmd = cluster.clusterCmd(adminKUBECONFIG, "oadm", "policy", "add-cluster-role-to-user", "system:registry", "-z", "registry") out, err := cmd.CombinedOutput() require.NoError(t, err, "%s", string(out)) require.Equal(t, "cluster role \"system:registry\" added: \"registry\"\n", string(out)) cmd = cluster.clusterCmd(adminKUBECONFIG, "oadm", "create-api-client-config", "--client-dir=openshift.local.registry", "--basename=openshift-registry", "--user=system:serviceaccount:default:registry") out, err = cmd.CombinedOutput() require.NoError(t, err, "%s", string(out)) require.Equal(t, "", string(out)) } // startRegistryProcess starts the OpenShift registry with configPart on port, waits for it to be ready, and returns the process object, or terminates on failure. func (cluster *openshiftCluster) startRegistryProcess(t *testing.T, port uint16, configPath string) *exec.Cmd { cmd := cluster.clusterCmd(map[string]string{ "KUBECONFIG": "openshift.local.registry/openshift-registry.kubeconfig", "DOCKER_REGISTRY_URL": fmt.Sprintf("127.0.0.1:%d", port), }, "dockerregistry", configPath) consumeAndLogOutputs(t, fmt.Sprintf("registry-%d", port), cmd) err := cmd.Start() require.NoError(t, err, "%s") portOpen, terminatePortCheck := newPortChecker(t, port) defer func() { terminatePortCheck <- true }() t.Logf("Waiting for registry to start") ctx, cancel := context.WithTimeout(context.Background(), 1*time.Minute) defer cancel() select { case <-portOpen: t.Logf("OK, Registry port open") case <-ctx.Done(): t.Fatalf("Timed out waiting for registry to start: %v", ctx.Err()) } return cmd } // startRegistry starts the OpenShift registry and waits for it to be ready, or terminates on failure. func (cluster *openshiftCluster) startRegistry(t *testing.T) { // Our “primary” registry cluster.processes = append(cluster.processes, cluster.startRegistryProcess(t, 5000, "/atomic-registry-config.yml")) // A registry configured with acceptschema2:false schema1Config := fileFromFixture(t, "/atomic-registry-config.yml", map[string]string{ "addr: :5000": "addr: :5005", "rootdirectory: /registry": "rootdirectory: /registry-schema1", // The default configuration currently already contains acceptschema2: false }) // Make sure the configuration contains "acceptschema2: false", because eventually it will be enabled upstream and this function will need to be updated. configContents, err := os.ReadFile(schema1Config) require.NoError(t, err) require.Regexp(t, "(?s).*acceptschema2: false.*", string(configContents)) cluster.processes = append(cluster.processes, cluster.startRegistryProcess(t, 5005, schema1Config)) // A registry configured with acceptschema2:true schema2Config := fileFromFixture(t, "/atomic-registry-config.yml", map[string]string{ "addr: :5000": "addr: :5006", "rootdirectory: /registry": "rootdirectory: /registry-schema2", "acceptschema2: false": "acceptschema2: true", }) cluster.processes = append(cluster.processes, cluster.startRegistryProcess(t, 5006, schema2Config)) } // ocLoginToProject runs (oc login) and (oc new-project) on the cluster, or terminates on failure. func (cluster *openshiftCluster) ocLoginToProject(t *testing.T) { t.Logf("oc login") cmd := cluster.clusterCmd(nil, "oc", "login", "--certificate-authority=openshift.local.config/master/ca.crt", "-u", "myuser", "-p", "mypw", "https://localhost:8443") out, err := cmd.CombinedOutput() require.NoError(t, err, "%s", out) require.Regexp(t, "(?s).*Login successful.*", string(out)) // (?s) : '.' will also match newlines outString := combinedOutputOfCommand(t, "oc", "new-project", "myns") require.Regexp(t, `(?s).*Now using project "myns".*`, outString) // (?s) : '.' will also match newlines } // dockerLogin simulates (docker login) to the cluster, or terminates on failure. // We do not run (docker login) directly, because that requires a running daemon and a docker package. func (cluster *openshiftCluster) dockerLogin(t *testing.T) { cluster.dockerDir = filepath.Join(homedir.Get(), ".docker") err := os.MkdirAll(cluster.dockerDir, 0o700) require.NoError(t, err) out := combinedOutputOfCommand(t, "oc", "config", "view", "-o", "json", "-o", "jsonpath={.users[*].user.token}") t.Logf("oc config value: %s", out) authValue := base64.StdEncoding.EncodeToString([]byte("unused:" + out)) auths := []string{} for _, port := range []int{5000, 5005, 5006} { auths = append(auths, fmt.Sprintf(`"localhost:%d": { "auth": "%s", "email": "unused" }`, port, authValue)) } configJSON := `{"auths": {` + strings.Join(auths, ",") + `}}` err = os.WriteFile(filepath.Join(cluster.dockerDir, "config.json"), []byte(configJSON), 0o600) require.NoError(t, err) } // relaxImageSignerPermissions opens up the system:image-signer permissions so that // anyone can work with signatures // FIXME: This also allows anyone to DoS anyone else; this design is really not all // that workable, but it is the best we can do for now. func (cluster *openshiftCluster) relaxImageSignerPermissions(t *testing.T) { cmd := cluster.clusterCmd(adminKUBECONFIG, "oadm", "policy", "add-cluster-role-to-group", "system:image-signer", "system:authenticated") out, err := cmd.CombinedOutput() require.NoError(t, err, "%s", string(out)) require.Equal(t, "cluster role \"system:image-signer\" added: \"system:authenticated\"\n", string(out)) } // tearDown stops the cluster services and deletes (only some!) of the state. func (cluster *openshiftCluster) tearDown(t *testing.T) { for _, process := range slices.Backward(cluster.processes) { // It’s undocumented what Kill() returns if the process has terminated, // so we couldn’t check just for that. This is running in a container anyway… _ = process.Process.Kill() } if cluster.dockerDir != "" { err := os.RemoveAll(cluster.dockerDir) require.NoError(t, err) } } ================================================ FILE: integration/procutils_linux_test.go ================================================ package main import ( "os/exec" "syscall" ) // cmdLifecycleToParentIfPossible is a thin wrapper around prctl(PR_SET_PDEATHSIG) // on Linux. func cmdLifecycleToParentIfPossible(c *exec.Cmd) { c.SysProcAttr = &syscall.SysProcAttr{ Pdeathsig: syscall.SIGTERM, } } ================================================ FILE: integration/procutils_test.go ================================================ //go:build unix && !linux package main import ( "os/exec" ) // cmdLifecycleToParentIfPossible tries to exit if the parent process exits (only works on Linux). func cmdLifecycleToParentIfPossible(c *exec.Cmd) { } ================================================ FILE: integration/proxy_test.go ================================================ //go:build unix package main import ( "encoding/json" "fmt" "io" "net" "os" "os/exec" "strings" "sync" "syscall" "testing" "time" imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" "go.podman.io/image/v5/manifest" ) // This image is known to be x86_64 only right now const knownNotManifestListedImageX8664 = "docker://quay.io/coreos/11bot" // knownNotExtantImage would be very surprising if it did exist const knownNotExtantImage = "docker://quay.io/centos/centos:opensusewindowsubuntu" const expectedProxySemverMajor = "0.2" // request is copied from proxy.go // We intentionally copy to ensure that we catch any unexpected "API" changes // in the JSON. type request struct { // Method is the name of the function Method string `json:"method"` // Args is the arguments (parsed inside the function) Args []any `json:"args"` } // reply is copied from proxy.go type reply struct { // Success is true if and only if the call succeeded. Success bool `json:"success"` // Value is an arbitrary value (or values, as array/map) returned from the call. Value any `json:"value"` // PipeID is an index into open pipes, and should be passed to FinishPipe PipeID uint32 `json:"pipeid"` // Error should be non-empty if Success == false Error string `json:"error"` } // maxMsgSize is also copied from proxy.go const maxMsgSize = 32 * 1024 type proxy struct { c *net.UnixConn } type pipefd struct { // id is the remote identifier "pipeid" id uint datafd *os.File errfd *os.File } func (p *proxy) call(method string, args []any) (rval any, fd *pipefd, err error) { req := request{ Method: method, Args: args, } reqbuf, err := json.Marshal(&req) if err != nil { return } n, err := p.c.Write(reqbuf) if err != nil { return } if n != len(reqbuf) { err = fmt.Errorf("short write during call of %d bytes", n) return } oob := make([]byte, syscall.CmsgSpace(1)) replybuf := make([]byte, maxMsgSize) n, oobn, _, _, err := p.c.ReadMsgUnix(replybuf, oob) if err != nil { err = fmt.Errorf("reading reply: %w", err) return } var reply reply err = json.Unmarshal(replybuf[0:n], &reply) if err != nil { err = fmt.Errorf("Failed to parse reply: %w", err) return } if !reply.Success { err = fmt.Errorf("remote error: %s", reply.Error) return } var scms []syscall.SocketControlMessage scms, err = syscall.ParseSocketControlMessage(oob[:oobn]) if err != nil { err = fmt.Errorf("failed to parse control message: %w", err) return } if reply.PipeID > 0 { if len(scms) != 1 { err = fmt.Errorf("Expected 1 socket control message, found %d", len(scms)) return } } if len(scms) > 2 { err = fmt.Errorf("Expected 1 or 2 socket control message, found %d", len(scms)) return } if len(scms) != 0 { var fds []int fds, err = syscall.ParseUnixRights(&scms[0]) if err != nil { err = fmt.Errorf("failed to parse unix rights: %w", err) return } if len(fds) < 1 || len(fds) > 2 { err = fmt.Errorf("expected 1 or 2 fds, found %d", len(fds)) return } var errfd *os.File if len(fds) == 2 { errfd = os.NewFile(uintptr(fds[1]), "errfd") } fd = &pipefd{ datafd: os.NewFile(uintptr(fds[0]), "replyfd"), id: uint(reply.PipeID), errfd: errfd, } } rval = reply.Value return } func (p *proxy) callNoFd(method string, args []any) (rval any, err error) { var fd *pipefd rval, fd, err = p.call(method, args) if err != nil { return } if fd != nil { err = fmt.Errorf("Unexpected fd from method %s", method) return } return rval, nil } func (p *proxy) callReadAllBytes(method string, args []any) (rval any, buf []byte, err error) { var fd *pipefd rval, fd, err = p.call(method, args) if err != nil { return } if fd == nil { err = fmt.Errorf("Expected fd from method %s", method) return } fetchchan := make(chan byteFetch) go func() { manifestBytes, err := io.ReadAll(fd.datafd) fetchchan <- byteFetch{ content: manifestBytes, err: err, } }() _, err = p.callNoFd("FinishPipe", []any{fd.id}) if err != nil { return } select { case fetchRes := <-fetchchan: err = fetchRes.err if err != nil { return } buf = fetchRes.content case <-time.After(5 * time.Minute): err = fmt.Errorf("timed out during proxy fetch") } return } type proxyError struct { Code string `json:"code"` Message string `json:"message"` } func (p *proxy) callGetRawBlob(args []any) (rval any, buf []byte, err error) { var fd *pipefd rval, fd, err = p.call("GetRawBlob", args) if err != nil { return } if fd == nil { err = fmt.Errorf("Expected fds from method GetRawBlob") return } if fd.errfd == nil { err = fmt.Errorf("Expected errfd from method GetRawBlob") return } var wg sync.WaitGroup fetchchan := make(chan byteFetch, 1) errchan := make(chan proxyError, 1) wg.Go(func() { defer close(fetchchan) defer fd.datafd.Close() buf, err := io.ReadAll(fd.datafd) fetchchan <- byteFetch{ content: buf, err: err, } }) wg.Go(func() { defer fd.errfd.Close() defer close(errchan) buf, err := io.ReadAll(fd.errfd) var proxyErr proxyError if err != nil { proxyErr.Code = "read-from-proxy" proxyErr.Message = err.Error() errchan <- proxyErr return } // No error, leave code+message unset if len(buf) == 0 { return } unmarshalErr := json.Unmarshal(buf, &proxyErr) // Shouldn't happen if unmarshalErr != nil { panic(unmarshalErr) } errchan <- proxyErr }) wg.Wait() errMsg := <-errchan if errMsg.Code != "" { return nil, nil, fmt.Errorf("(%s) %s", errMsg.Code, errMsg.Message) } fetchRes := <-fetchchan err = fetchRes.err if err != nil { return } buf = fetchRes.content return } func newProxy() (*proxy, error) { fds, err := syscall.Socketpair(syscall.AF_LOCAL, syscall.SOCK_SEQPACKET, 0) if err != nil { return nil, err } myfd := os.NewFile(uintptr(fds[0]), "myfd") defer myfd.Close() theirfd := os.NewFile(uintptr(fds[1]), "theirfd") defer theirfd.Close() mysock, err := net.FileConn(myfd) if err != nil { return nil, err } // Note ExtraFiles starts at 3 proc := exec.Command(skopeoBinary, "experimental-image-proxy", "--sockfd", "3") proc.Stderr = os.Stderr cmdLifecycleToParentIfPossible(proc) proc.ExtraFiles = append(proc.ExtraFiles, theirfd) if err = proc.Start(); err != nil { return nil, err } p := &proxy{ c: mysock.(*net.UnixConn), } v, err := p.callNoFd("Initialize", nil) if err != nil { return nil, err } semver, ok := v.(string) if !ok { return nil, fmt.Errorf("proxy Initialize: Unexpected value %T", v) } if !strings.HasPrefix(semver, expectedProxySemverMajor) { return nil, fmt.Errorf("Unexpected semver %s", semver) } return p, nil } func TestProxy(t *testing.T) { suite.Run(t, &proxySuite{}) } type proxySuite struct { suite.Suite } type byteFetch struct { content []byte err error } // This exercises all the metadata fetching APIs. func runTestMetadataAPIs(p *proxy, img string) error { v, err := p.callNoFd("OpenImage", []any{img}) if err != nil { return err } imgidv, ok := v.(float64) if !ok { return fmt.Errorf("OpenImage return value is %T", v) } imgid := uint64(imgidv) if imgid == 0 { return fmt.Errorf("got zero from expected image") } // Also verify the optional path v, err = p.callNoFd("OpenImageOptional", []any{img}) if err != nil { return err } imgidv, ok = v.(float64) if !ok { return fmt.Errorf("OpenImageOptional return value is %T", v) } imgid2 := uint64(imgidv) if imgid2 == 0 { return fmt.Errorf("got zero from expected image") } _, err = p.callNoFd("CloseImage", []any{imgid2}) if err != nil { return err } _, manifestBytes, err := p.callReadAllBytes("GetManifest", []any{imgid}) if err != nil { return err } _, err = manifest.OCI1FromManifest(manifestBytes) if err != nil { return err } _, configBytes, err := p.callReadAllBytes("GetFullConfig", []any{imgid}) if err != nil { return err } var config imgspecv1.Image err = json.Unmarshal(configBytes, &config) if err != nil { return err } // Validate that the image config seems sane if config.Architecture == "" { return fmt.Errorf("No architecture found") } if len(config.Config.Cmd) == 0 && len(config.Config.Entrypoint) == 0 { return fmt.Errorf("No CMD or ENTRYPOINT set") } _, layerInfoBytes, err := p.callReadAllBytes("GetLayerInfoPiped", []any{imgid}) if err != nil { return err } var layerInfoBytesData []any err = json.Unmarshal(layerInfoBytes, &layerInfoBytesData) if err != nil { return err } if len(layerInfoBytesData) == 0 { return fmt.Errorf("expected layer info data") } // Also test this legacy interface _, ctrconfigBytes, err := p.callReadAllBytes("GetConfig", []any{imgid}) if err != nil { return err } var ctrconfig imgspecv1.ImageConfig err = json.Unmarshal(ctrconfigBytes, &ctrconfig) if err != nil { return err } // Validate that the config seems sane if len(ctrconfig.Cmd) == 0 && len(ctrconfig.Entrypoint) == 0 { return fmt.Errorf("No CMD or ENTRYPOINT set") } _, err = p.callNoFd("CloseImage", []any{imgid}) if err != nil { return err } return nil } func runTestOpenImageOptionalNotFound(p *proxy, img string) error { v, err := p.callNoFd("OpenImageOptional", []any{img}) if err != nil { return err } imgidv, ok := v.(float64) if !ok { return fmt.Errorf("OpenImageOptional return value is %T", v) } imgid := uint64(imgidv) if imgid != 0 { return fmt.Errorf("Unexpected optional image id %v", imgid) } return nil } func runTestGetBlob(p *proxy, img string) error { imgid, err := p.callNoFd("OpenImage", []any{img}) if err != nil { return err } _, manifestBytes, err := p.callReadAllBytes("GetManifest", []any{imgid}) if err != nil { return err } mfest, err := manifest.OCI1FromManifest(manifestBytes) if err != nil { return err } for _, layer := range mfest.Layers { _, blobBytes, err := p.callGetRawBlob([]any{imgid, layer.Digest}) if err != nil { return err } if len(blobBytes) != int(layer.Size) { panic(fmt.Sprintf("Expected %d bytes, got %d", layer.Size, len(blobBytes))) } } // echo "not a valid layer" | sha256sum invalidDigest := "sha256:21a9aab5a3494674d2b4d8e7381c236a799384dd10545531014606cf652c119f" _, blobBytes, err := p.callGetRawBlob([]any{imgid, invalidDigest}) if err == nil { panic("Expected error fetching invalid blob") } if blobBytes != nil { panic("Expected no bytes fetching invalid blob") } return nil } func (s *proxySuite) TestProxyMetadata() { t := s.T() p, err := newProxy() require.NoError(t, err) err = runTestMetadataAPIs(p, knownNotManifestListedImageX8664) if err != nil { err = fmt.Errorf("Testing image %s: %v", knownNotManifestListedImageX8664, err) } assert.NoError(t, err) err = runTestMetadataAPIs(p, knownListImage) if err != nil { err = fmt.Errorf("Testing image %s: %v", knownListImage, err) } assert.NoError(t, err) err = runTestOpenImageOptionalNotFound(p, knownNotExtantImage) if err != nil { err = fmt.Errorf("Testing optional image %s: %v", knownNotExtantImage, err) } assert.NoError(t, err) } func (s *proxySuite) TestProxyGetBlob() { t := s.T() p, err := newProxy() require.NoError(t, err) err = runTestGetBlob(p, knownListImage) if err != nil { err = fmt.Errorf("Testing GetBLob for %s: %v", knownListImage, err) } assert.NoError(t, err) } ================================================ FILE: integration/registry_test.go ================================================ package main import ( "fmt" "net/http" "os" "os/exec" "path/filepath" "testing" "time" "github.com/stretchr/testify/require" ) const ( binaryV2 = "registry" binaryV2Schema1Only = "registry-v2-schema1-only" binaryV2Schema1Supported = "registry-v2-schema1-supported" ) type registryVersion int const ( registryVersionInvalid registryVersion = iota registryVersionModern // Whatever comes from a packaged docker-distribution; as of 2026-03 supports schema2, not schema1. registryVersionSchema1Only // Supports only schema1 registryVersionSchema1Supported // Supports both schema1 and schema2 ) type testRegistryV2 struct { cmd *exec.Cmd url string username string password string email string } func setupRegistryV2At(t *testing.T, url string, auth bool, version registryVersion) *testRegistryV2 { reg, err := newTestRegistryV2At(t, url, auth, version) require.NoError(t, err) // Wait for registry to be ready to serve requests. for range 50 { if err = reg.Ping(); err == nil { break } time.Sleep(100 * time.Millisecond) } if err != nil { t.Fatal("Timeout waiting for test registry to become available") } return reg } func newTestRegistryV2At(t *testing.T, url string, auth bool, version registryVersion) (*testRegistryV2, error) { tmp := t.TempDir() template := `version: 0.1 loglevel: debug storage: filesystem: rootdirectory: %s delete: enabled: true http: addr: %s compatibility: schema1: enabled: true %s` var ( htpasswd string username string password string email string ) if auth { htpasswdPath := filepath.Join(tmp, "htpasswd") userpasswd := "testuser:$2y$05$sBsSqk0OpSD1uTZkHXc4FeJ0Z70wLQdAX/82UiHuQOKbNbBrzs63m" username = "testuser" password = "testpassword" email = "test@test.org" if err := os.WriteFile(htpasswdPath, []byte(userpasswd), os.FileMode(0o644)); err != nil { return nil, err } htpasswd = fmt.Sprintf(`auth: htpasswd: realm: basic-realm path: %s `, htpasswdPath) } confPath := filepath.Join(tmp, "config.yaml") config, err := os.Create(confPath) if err != nil { return nil, err } if _, err := fmt.Fprintf(config, template, tmp, url, htpasswd); err != nil { return nil, err } var cmd *exec.Cmd switch version { case registryVersionModern: cmd = exec.Command(binaryV2, "serve", confPath) case registryVersionSchema1Only: cmd = exec.Command(binaryV2Schema1Only, confPath) case registryVersionSchema1Supported: cmd = exec.Command(binaryV2Schema1Supported, "serve", confPath) default: return nil, fmt.Errorf("invalid registry version: %v", version) } consumeAndLogOutputs(t, fmt.Sprintf("registry-%s", url), cmd) if err := cmd.Start(); err != nil { if os.IsNotExist(err) { t.Skip(err.Error()) } return nil, err } return &testRegistryV2{ cmd: cmd, url: url, username: username, password: password, email: email, }, nil } func (r *testRegistryV2) Ping() error { // We always ping through HTTP for our test registry. resp, err := http.Get(fmt.Sprintf("http://%s/v2/", r.url)) if err != nil { return err } defer resp.Body.Close() if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusUnauthorized { return fmt.Errorf("registry ping replied with an unexpected status code %d", resp.StatusCode) } return nil } func (r *testRegistryV2) tearDown() { // It’s undocumented what Kill() returns if the process has terminated, // so we couldn’t check just for that. This is running in a container anyway… _ = r.cmd.Process.Kill() } ================================================ FILE: integration/signing_test.go ================================================ package main import ( "fmt" "os/exec" "path/filepath" "testing" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" "go.podman.io/image/v5/signature" ) const ( gpgBinary = "gpg" ) func TestSigning(t *testing.T) { suite.Run(t, &signingSuite{}) } type signingSuite struct { suite.Suite fingerprint string } var _ = suite.SetupAllSuite(&signingSuite{}) func (s *signingSuite) SetupSuite() { t := s.T() _, err := exec.LookPath(skopeoBinary) require.NoError(t, err) gpgHome := t.TempDir() t.Setenv("GNUPGHOME", gpgHome) runCommandWithInput(t, "Key-Type: RSA\nName-Real: Testing user\n%no-protection\n%commit\n", gpgBinary, "--homedir", gpgHome, "--batch", "--gen-key") lines, err := exec.Command(gpgBinary, "--homedir", gpgHome, "--with-colons", "--no-permission-warning", "--fingerprint").Output() require.NoError(t, err) s.fingerprint, err = findFingerprint(lines) require.NoError(t, err) } func (s *signingSuite) TestSignVerifySmoke() { t := s.T() mech, err := signature.NewGPGSigningMechanism() require.NoError(t, err) defer mech.Close() if err := mech.SupportsSigning(); err != nil { // FIXME? Test that verification and policy enforcement works, using signatures from fixtures t.Skipf("Signing not supported: %v", err) } manifestPath := "fixtures/image.manifest.json" dockerReference := "testing/smoketest" sigOutput := filepath.Join(t.TempDir(), "sig") assertSkopeoSucceeds(t, "^$", "standalone-sign", "-o", sigOutput, manifestPath, dockerReference, s.fingerprint) expected := fmt.Sprintf("^Signature verified using fingerprint %s, digest %s\n$", s.fingerprint, TestImageManifestDigest) assertSkopeoSucceeds(t, expected, "standalone-verify", manifestPath, dockerReference, s.fingerprint, sigOutput) } ================================================ FILE: integration/sync_test.go ================================================ package main import ( "context" "fmt" "io/fs" "os" "path" "path/filepath" "regexp" "strings" "testing" imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" "go.podman.io/image/v5/docker" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/manifest" "go.podman.io/image/v5/types" ) const ( // A repository with a path with multiple components in it which // contains multiple tags, preferably with some tags pointing to // manifest lists, and with some tags that don't. pullableRepo = "registry.k8s.io/coredns/coredns" // A tagged image in the repository that we can inspect and copy. pullableTaggedImage = "registry.k8s.io/coredns/coredns:v1.6.6" // A tagged manifest list in the repository that we can inspect and copy. pullableTaggedManifestList = "registry.k8s.io/coredns/coredns:v1.8.0" // A repository containing multiple tags, some of which are for // manifest lists, and which includes a "latest" tag. We specify the // name here without a tag. pullableRepoWithLatestTag = "registry.k8s.io/pause" ) func TestSync(t *testing.T) { suite.Run(t, &syncSuite{}) } type syncSuite struct { suite.Suite cluster *openshiftCluster registry *testRegistryV2 } var ( _ = suite.SetupAllSuite(&syncSuite{}) _ = suite.TearDownAllSuite(&syncSuite{}) ) func (s *syncSuite) SetupSuite() { t := s.T() if os.Getenv("SKOPEO_LOCAL_TESTS") == "1" { t.Log("Running tests without a container") fmt.Printf("NOTE: tests requires a V2 registry at url=%s\n", v2DockerRegistryURL) return } if os.Getenv("SKOPEO_CONTAINER_TESTS") != "1" { t.Skip("Not running in a container, refusing to affect user state") } s.cluster = startOpenshiftCluster(t) // FIXME: Set up TLS for the docker registry port instead of using "--tls-verify=false" all over the place. for _, stream := range []string{"unsigned", "personal", "official", "naming", "cosigned", "compression", "schema1", "schema2"} { isJSON := fmt.Sprintf(`{ "kind": "ImageStream", "apiVersion": "v1", "metadata": { "name": "%s" }, "spec": {} }`, stream) runCommandWithInput(t, isJSON, "oc", "create", "-f", "-") } // FIXME: Set up TLS for the docker registry port instead of using "--tls-verify=false" all over the place. s.registry = setupRegistryV2At(t, v2DockerRegistryURL, false, registryVersionModern) gpgHome := t.TempDir() t.Setenv("GNUPGHOME", gpgHome) for _, key := range []string{"personal", "official"} { batchInput := fmt.Sprintf("Key-Type: RSA\nName-Real: Test key - %s\nName-email: %s@example.com\n%%no-protection\n%%commit\n", key, key) runCommandWithInput(t, batchInput, gpgBinary, "--batch", "--gen-key") out := combinedOutputOfCommand(t, gpgBinary, "--armor", "--export", fmt.Sprintf("%s@example.com", key)) err := os.WriteFile(filepath.Join(gpgHome, fmt.Sprintf("%s-pubkey.gpg", key)), []byte(out), 0o600) require.NoError(t, err) } } func (s *syncSuite) TearDownSuite() { t := s.T() if os.Getenv("SKOPEO_LOCAL_TESTS") == "1" { return } if s.registry != nil { s.registry.tearDown() } if s.cluster != nil { s.cluster.tearDown(t) } } func assertNumberOfManifestsInSubdirs(t *testing.T, dir string, expectedCount int) { nManifests := 0 err := filepath.WalkDir(dir, func(path string, d fs.DirEntry, err error) error { if err != nil { return err } if !d.IsDir() && d.Name() == "manifest.json" { nManifests++ return filepath.SkipDir } return nil }) require.NoError(t, err) assert.Equal(t, expectedCount, nManifests) } func (s *syncSuite) TestDocker2DirTagged() { t := s.T() tmpDir := t.TempDir() // FIXME: It would be nice to use one of the local Docker registries instead of needing an Internet connection. image := pullableTaggedImage imageRef, err := docker.ParseReference(fmt.Sprintf("//%s", image)) require.NoError(t, err) imagePath := imageRef.DockerReference().String() dir1 := path.Join(tmpDir, "dir1") dir2 := path.Join(tmpDir, "dir2") // sync docker => dir assertSkopeoSucceeds(t, "", "sync", "--retry-times", "3", "--scoped", "--src", "docker", "--dest", "dir", image, dir1) _, err = os.Stat(path.Join(dir1, imagePath, "manifest.json")) require.NoError(t, err) // copy docker => dir assertSkopeoSucceeds(t, "", "copy", "--retry-times", "3", "docker://"+image, "dir:"+dir2) _, err = os.Stat(path.Join(dir2, "manifest.json")) require.NoError(t, err) out := combinedOutputOfCommand(t, "diff", "-urN", path.Join(dir1, imagePath), dir2) assert.Equal(t, "", out) } func (s *syncSuite) TestDocker2DirTaggedAll() { t := s.T() tmpDir := t.TempDir() // FIXME: It would be nice to use one of the local Docker registries instead of needing an Internet connection. image := pullableTaggedManifestList imageRef, err := docker.ParseReference(fmt.Sprintf("//%s", image)) require.NoError(t, err) imagePath := imageRef.DockerReference().String() dir1 := path.Join(tmpDir, "dir1") dir2 := path.Join(tmpDir, "dir2") // sync docker => dir assertSkopeoSucceeds(t, "", "sync", "--retry-times", "3", "--all", "--scoped", "--src", "docker", "--dest", "dir", image, dir1) _, err = os.Stat(path.Join(dir1, imagePath, "manifest.json")) require.NoError(t, err) // copy docker => dir assertSkopeoSucceeds(t, "", "copy", "--retry-times", "3", "--all", "docker://"+image, "dir:"+dir2) _, err = os.Stat(path.Join(dir2, "manifest.json")) require.NoError(t, err) out := combinedOutputOfCommand(t, "diff", "-urN", path.Join(dir1, imagePath), dir2) assert.Equal(t, "", out) } func (s *syncSuite) TestPreserveDigests() { t := s.T() tmpDir := t.TempDir() // FIXME: It would be nice to use one of the local Docker registries instead of needing an Internet connection. image := pullableTaggedManifestList // copy docker => dir assertSkopeoSucceeds(t, "", "copy", "--retry-times", "3", "--all", "--preserve-digests", "docker://"+image, "dir:"+tmpDir) _, err := os.Stat(path.Join(tmpDir, "manifest.json")) require.NoError(t, err) assertSkopeoFails(t, ".*Instructed to preserve digests.*", "copy", "--retry-times", "3", "--all", "--preserve-digests", "--format=oci", "docker://"+image, "dir:"+tmpDir) } func (s *syncSuite) TestScoped() { t := s.T() // FIXME: It would be nice to use one of the local Docker registries instead of needing an Internet connection. image := pullableTaggedImage imageRef, err := docker.ParseReference(fmt.Sprintf("//%s", image)) require.NoError(t, err) imagePath := imageRef.DockerReference().String() dir1 := t.TempDir() assertSkopeoSucceeds(t, "", "sync", "--retry-times", "3", "--src", "docker", "--dest", "dir", image, dir1) _, err = os.Stat(path.Join(dir1, path.Base(imagePath), "manifest.json")) require.NoError(t, err) assertSkopeoSucceeds(t, "", "sync", "--retry-times", "3", "--scoped", "--src", "docker", "--dest", "dir", image, dir1) _, err = os.Stat(path.Join(dir1, imagePath, "manifest.json")) require.NoError(t, err) } func (s *syncSuite) TestDirIsNotOverwritten() { t := s.T() // FIXME: It would be nice to use one of the local Docker registries instead of needing an Internet connection. image := pullableRepoWithLatestTag imageRef, err := docker.ParseReference(fmt.Sprintf("//%s", image)) require.NoError(t, err) imagePath := imageRef.DockerReference().String() // make a copy of the image in the local registry assertSkopeoSucceeds(t, "", "copy", "--retry-times", "3", "--dest-tls-verify=false", "docker://"+image, "docker://"+path.Join(v2DockerRegistryURL, reference.Path(imageRef.DockerReference()))) // sync upstream image to dir, not scoped dir1 := t.TempDir() assertSkopeoSucceeds(t, "", "sync", "--retry-times", "3", "--src", "docker", "--dest", "dir", image, dir1) _, err = os.Stat(path.Join(dir1, path.Base(imagePath), "manifest.json")) require.NoError(t, err) // sync local registry image to dir, not scoped assertSkopeoFails(t, ".*Refusing to overwrite destination directory.*", "sync", "--src-tls-verify=false", "--src", "docker", "--dest", "dir", path.Join(v2DockerRegistryURL, reference.Path(imageRef.DockerReference())), dir1) // sync local registry image to dir, scoped imageRef, err = docker.ParseReference(fmt.Sprintf("//%s", path.Join(v2DockerRegistryURL, reference.Path(imageRef.DockerReference())))) require.NoError(t, err) imagePath = imageRef.DockerReference().String() assertSkopeoSucceeds(t, "", "sync", "--scoped", "--src-tls-verify=false", "--src", "docker", "--dest", "dir", path.Join(v2DockerRegistryURL, reference.Path(imageRef.DockerReference())), dir1) _, err = os.Stat(path.Join(dir1, imagePath, "manifest.json")) require.NoError(t, err) } func (s *syncSuite) TestDocker2DirUntagged() { t := s.T() tmpDir := t.TempDir() // FIXME: It would be nice to use one of the local Docker registries instead of needing an Internet connection. image := pullableRepo imageRef, err := docker.ParseReference(fmt.Sprintf("//%s", image)) require.NoError(t, err) imagePath := imageRef.DockerReference().String() dir1 := path.Join(tmpDir, "dir1") assertSkopeoSucceeds(t, "", "sync", "--retry-times", "3", "--scoped", "--src", "docker", "--dest", "dir", image, dir1) sysCtx := types.SystemContext{} tags, err := docker.GetRepositoryTags(context.Background(), &sysCtx, imageRef) require.NoError(t, err) assert.NotZero(t, len(tags)) nManifests, err := filepath.Glob(path.Join(dir1, path.Dir(imagePath), "*", "manifest.json")) require.NoError(t, err) assert.Len(t, nManifests, len(tags)) } func (s *syncSuite) TestYamlUntagged() { t := s.T() tmpDir := t.TempDir() dir1 := path.Join(tmpDir, "dir1") image := pullableRepo imageRef, err := docker.ParseReference(fmt.Sprintf("//%s", image)) require.NoError(t, err) imagePath := imageRef.DockerReference().Name() sysCtx := types.SystemContext{} tags, err := docker.GetRepositoryTags(context.Background(), &sysCtx, imageRef) require.NoError(t, err) assert.NotZero(t, len(tags)) yamlConfig := fmt.Sprintf(` %s: images: %s: [] `, reference.Domain(imageRef.DockerReference()), reference.Path(imageRef.DockerReference())) // sync to the local registry yamlFile := path.Join(tmpDir, "registries.yaml") err = os.WriteFile(yamlFile, []byte(yamlConfig), 0o644) require.NoError(t, err) assertSkopeoSucceeds(t, "", "sync", "--retry-times", "3", "--scoped", "--src", "yaml", "--dest", "docker", "--dest-tls-verify=false", yamlFile, v2DockerRegistryURL) // sync back from local registry to a folder os.Remove(yamlFile) yamlConfig = fmt.Sprintf(` %s: tls-verify: false images: %s: [] `, v2DockerRegistryURL, imagePath) err = os.WriteFile(yamlFile, []byte(yamlConfig), 0o644) require.NoError(t, err) assertSkopeoSucceeds(t, "", "sync", "--scoped", "--src", "yaml", "--dest", "dir", yamlFile, dir1) sysCtx = types.SystemContext{ DockerInsecureSkipTLSVerify: types.NewOptionalBool(true), } localImageRef, err := docker.ParseReference(fmt.Sprintf("//%s/%s", v2DockerRegistryURL, imagePath)) require.NoError(t, err) localTags, err := docker.GetRepositoryTags(context.Background(), &sysCtx, localImageRef) require.NoError(t, err) assert.NotZero(t, len(localTags)) assert.Len(t, localTags, len(tags)) assertNumberOfManifestsInSubdirs(t, dir1, len(tags)) } func (s *syncSuite) TestYamlRegex2Dir() { t := s.T() tmpDir := t.TempDir() dir1 := path.Join(tmpDir, "dir1") yamlConfig := ` registry.k8s.io: images-by-tag-regex: pause: ^[12]\.0$ # regex string test ` // the ↑ regex strings always matches only 2 images nTags := 2 assert.NotZero(t, nTags) yamlFile := path.Join(tmpDir, "registries.yaml") err := os.WriteFile(yamlFile, []byte(yamlConfig), 0o644) require.NoError(t, err) assertSkopeoSucceeds(t, "", "sync", "--retry-times", "3", "--scoped", "--src", "yaml", "--dest", "dir", yamlFile, dir1) assertNumberOfManifestsInSubdirs(t, dir1, nTags) } func (s *syncSuite) TestYamlDigest2Dir() { t := s.T() tmpDir := t.TempDir() dir1 := path.Join(tmpDir, "dir1") yamlConfig := ` registry.k8s.io: images: pause: - sha256:59eec8837a4d942cc19a52b8c09ea75121acc38114a2c68b98983ce9356b8610 ` yamlFile := path.Join(tmpDir, "registries.yaml") err := os.WriteFile(yamlFile, []byte(yamlConfig), 0o644) require.NoError(t, err) assertSkopeoSucceeds(t, "", "sync", "--retry-times", "3", "--scoped", "--src", "yaml", "--dest", "dir", yamlFile, dir1) assertNumberOfManifestsInSubdirs(t, dir1, 1) } func (s *syncSuite) TestYaml2Dir() { t := s.T() tmpDir := t.TempDir() dir1 := path.Join(tmpDir, "dir1") yamlConfig := ` registry.k8s.io: images: coredns/coredns: - v1.8.0 - v1.7.1 k8s-dns-kube-dns: - 1.14.12 - 1.14.13 pause: - latest quay.io: images: quay/busybox: - latest` // get the number of tags re := regexp.MustCompile(`^ +- +[^:/ ]+`) var nTags int for l := range strings.SplitSeq(yamlConfig, "\n") { if re.MatchString(l) { nTags++ } } assert.NotZero(t, nTags) yamlFile := path.Join(tmpDir, "registries.yaml") err := os.WriteFile(yamlFile, []byte(yamlConfig), 0o644) require.NoError(t, err) assertSkopeoSucceeds(t, "", "sync", "--retry-times", "3", "--scoped", "--src", "yaml", "--dest", "dir", yamlFile, dir1) assertNumberOfManifestsInSubdirs(t, dir1, nTags) } func (s *syncSuite) TestYamlTLSVerify() { t := s.T() const localRegURL = "docker://" + v2DockerRegistryURL + "/" tmpDir := t.TempDir() dir1 := path.Join(tmpDir, "dir1") image := pullableRepoWithLatestTag tag := "latest" // FIXME: It would be nice to use one of the local Docker registries instead of needing an Internet connection. // copy docker => docker assertSkopeoSucceeds(t, "", "copy", "--retry-times", "3", "--dest-tls-verify=false", "docker://"+image+":"+tag, localRegURL+image+":"+tag) yamlTemplate := ` %s: %s images: %s: - %s` testCfg := []struct { tlsVerify string msg string checker func(t *testing.T, regexp string, args ...string) }{ { tlsVerify: "tls-verify: false", msg: "", checker: assertSkopeoSucceeds, }, { tlsVerify: "tls-verify: true", msg: ".*server gave HTTP response to HTTPS client.*", checker: assertSkopeoFails, }, // no "tls-verify" line means default TLS verify must be ON { tlsVerify: "", msg: ".*server gave HTTP response to HTTPS client.*", checker: assertSkopeoFails, }, } for _, cfg := range testCfg { yamlConfig := fmt.Sprintf(yamlTemplate, v2DockerRegistryURL, cfg.tlsVerify, image, tag) yamlFile := path.Join(tmpDir, "registries.yaml") err := os.WriteFile(yamlFile, []byte(yamlConfig), 0o644) require.NoError(t, err) cfg.checker(t, cfg.msg, "sync", "--scoped", "--src", "yaml", "--dest", "dir", yamlFile, dir1) os.Remove(yamlFile) os.RemoveAll(dir1) } } func (s *syncSuite) TestSyncManifestOutput() { t := s.T() tmpDir := t.TempDir() destDir1 := filepath.Join(tmpDir, "dest1") destDir2 := filepath.Join(tmpDir, "dest2") destDir3 := filepath.Join(tmpDir, "dest3") // Split image:tag path from image URI for manifest comparison imageDir := pullableTaggedImage[strings.LastIndex(pullableTaggedImage, "/")+1:] assertSkopeoSucceeds(t, "", "sync", "--retry-times", "3", "--format=oci", "--all", "--src", "docker", "--dest", "dir", pullableTaggedImage, destDir1) verifyManifestMIMEType(t, filepath.Join(destDir1, imageDir), imgspecv1.MediaTypeImageManifest) assertSkopeoSucceeds(t, "", "sync", "--retry-times", "3", "--format=v2s2", "--all", "--src", "docker", "--dest", "dir", pullableTaggedImage, destDir2) verifyManifestMIMEType(t, filepath.Join(destDir2, imageDir), manifest.DockerV2Schema2MediaType) assertSkopeoSucceeds(t, "", "sync", "--retry-times", "3", "--format=v2s1", "--all", "--src", "docker", "--dest", "dir", pullableTaggedImage, destDir3) verifyManifestMIMEType(t, filepath.Join(destDir3, imageDir), manifest.DockerV2Schema1SignedMediaType) } func (s *syncSuite) TestDocker2DockerTagged() { t := s.T() const localRegURL = "docker://" + v2DockerRegistryURL + "/" tmpDir := t.TempDir() // FIXME: It would be nice to use one of the local Docker registries instead of needing an Internet connection. image := pullableTaggedImage imageRef, err := docker.ParseReference(fmt.Sprintf("//%s", image)) require.NoError(t, err) imagePath := imageRef.DockerReference().String() dir1 := path.Join(tmpDir, "dir1") dir2 := path.Join(tmpDir, "dir2") // sync docker => docker assertSkopeoSucceeds(t, "", "sync", "--retry-times", "3", "--scoped", "--dest-tls-verify=false", "--src", "docker", "--dest", "docker", image, v2DockerRegistryURL) // copy docker => dir assertSkopeoSucceeds(t, "", "copy", "--retry-times", "3", "docker://"+image, "dir:"+dir1) _, err = os.Stat(path.Join(dir1, "manifest.json")) require.NoError(t, err) // copy docker => dir assertSkopeoSucceeds(t, "", "copy", "--src-tls-verify=false", localRegURL+imagePath, "dir:"+dir2) _, err = os.Stat(path.Join(dir2, "manifest.json")) require.NoError(t, err) out := combinedOutputOfCommand(t, "diff", "-urN", dir1, dir2) assert.Equal(t, "", out) } func (s *syncSuite) TestDir2DockerTagged() { t := s.T() const localRegURL = "docker://" + v2DockerRegistryURL + "/" tmpDir := t.TempDir() // FIXME: It would be nice to use one of the local Docker registries instead of needing an Internet connection. image := pullableRepoWithLatestTag dir1 := path.Join(tmpDir, "dir1") err := os.Mkdir(dir1, 0o755) require.NoError(t, err) dir2 := path.Join(tmpDir, "dir2") err = os.Mkdir(dir2, 0o755) require.NoError(t, err) // create leading dirs err = os.MkdirAll(path.Dir(path.Join(dir1, image)), 0o755) require.NoError(t, err) // copy docker => dir assertSkopeoSucceeds(t, "", "copy", "--retry-times", "3", "docker://"+image, "dir:"+path.Join(dir1, image)) _, err = os.Stat(path.Join(dir1, image, "manifest.json")) require.NoError(t, err) // sync dir => docker assertSkopeoSucceeds(t, "", "sync", "--scoped", "--dest-tls-verify=false", "--src", "dir", "--dest", "docker", dir1, v2DockerRegistryURL) // create leading dirs err = os.MkdirAll(path.Dir(path.Join(dir2, image)), 0o755) require.NoError(t, err) // copy docker => dir assertSkopeoSucceeds(t, "", "copy", "--src-tls-verify=false", localRegURL+image, "dir:"+path.Join(dir2, image)) _, err = os.Stat(path.Join(dir2, image, "manifest.json")) require.NoError(t, err) out := combinedOutputOfCommand(t, "diff", "-urN", dir1, dir2) assert.Equal(t, "", out) } func (s *syncSuite) TestFailsWithDir2Dir() { t := s.T() tmpDir := t.TempDir() dir1 := path.Join(tmpDir, "dir1") dir2 := path.Join(tmpDir, "dir2") // sync dir => dir is not allowed assertSkopeoFails(t, ".*sync from 'dir' to 'dir' not implemented.*", "sync", "--scoped", "--src", "dir", "--dest", "dir", dir1, dir2) } func (s *syncSuite) TestFailsNoSourceImages() { t := s.T() tmpDir := t.TempDir() assertSkopeoFails(t, ".*No images to sync found in .*", "sync", "--scoped", "--dest-tls-verify=false", "--src", "dir", "--dest", "docker", tmpDir, v2DockerRegistryURL) assertSkopeoFails(t, ".*Error determining repository tags for repo docker.io/library/hopefully_no_images_will_ever_be_called_like_this: fetching tags list: requested access to the resource is denied.*", "sync", "--scoped", "--dest-tls-verify=false", "--src", "docker", "--dest", "docker", "hopefully_no_images_will_ever_be_called_like_this", v2DockerRegistryURL) } func (s *syncSuite) TestFailsWithDockerSourceNoRegistry() { t := s.T() const regURL = "google.com/namespace/imagename" tmpDir := t.TempDir() // untagged assertSkopeoFails(t, ".*StatusCode: 404.*", "sync", "--scoped", "--src", "docker", "--dest", "dir", regURL, tmpDir) // tagged assertSkopeoFails(t, ".*StatusCode: 404.*", "sync", "--scoped", "--src", "docker", "--dest", "dir", regURL+":thetag", tmpDir) } func (s *syncSuite) TestFailsWithDockerSourceUnauthorized() { t := s.T() const repo = "privateimagenamethatshouldnotbepublic" tmpDir := t.TempDir() // untagged assertSkopeoFails(t, ".*requested access to the resource is denied.*", "sync", "--scoped", "--src", "docker", "--dest", "dir", repo, tmpDir) // tagged assertSkopeoFails(t, ".*requested access to the resource is denied.*", "sync", "--scoped", "--src", "docker", "--dest", "dir", repo+":thetag", tmpDir) } func (s *syncSuite) TestFailsWithDockerSourceNotExisting() { t := s.T() repo := path.Join(v2DockerRegistryURL, "imagedoesnotexist") tmpDir := t.TempDir() // untagged assertSkopeoFails(t, ".*repository name not known to registry.*", "sync", "--scoped", "--src-tls-verify=false", "--src", "docker", "--dest", "dir", repo, tmpDir) // tagged assertSkopeoFails(t, ".*reading manifest.*", "sync", "--scoped", "--src-tls-verify=false", "--src", "docker", "--dest", "dir", repo+":thetag", tmpDir) } func (s *syncSuite) TestFailsWithDirSourceNotExisting() { t := s.T() // Make sure the dir does not exist! tmpDir := t.TempDir() tmpDir = filepath.Join(tmpDir, "this-does-not-exist") err := os.RemoveAll(tmpDir) require.NoError(t, err) _, err = os.Stat(path.Join(tmpDir)) assert.True(t, os.IsNotExist(err)) assertSkopeoFails(t, ".*no such file or directory.*", "sync", "--scoped", "--dest-tls-verify=false", "--src", "dir", "--dest", "docker", tmpDir, v2DockerRegistryURL) } ================================================ FILE: integration/tls_test.go ================================================ package main import ( "context" "crypto/rand" "crypto/rsa" "crypto/tls" "crypto/x509" "crypto/x509/pkix" "encoding/json" "encoding/pem" "fmt" "net/http" "net/http/httptest" "os" "path/filepath" "testing" "time" "github.com/opencontainers/image-spec/specs-go" imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" "go.podman.io/image/v5/oci/layout" ) func TestTLS(t *testing.T) { suite.Run(t, &tlsSuite{}) } type tlsSuite struct { suite.Suite defaultServer *tlsConfigServer tls12Server *tlsConfigServer nonPQCserver *tlsConfigServer pqcServer *tlsConfigServer expected []expectedBehavior } var ( _ = suite.SetupAllSuite(&tlsSuite{}) _ = suite.TearDownAllSuite(&tlsSuite{}) ) type expectedBehavior struct { server *tlsConfigServer tlsDetails string expected string } func (s *tlsSuite) SetupSuite() { t := s.T() s.defaultServer = newServer(t, &tls.Config{}) s.tls12Server = newServer(t, &tls.Config{ MaxVersion: tls.VersionTLS12, }) s.nonPQCserver = newServer(t, &tls.Config{ MinVersion: tls.VersionTLS13, CurvePreferences: []tls.CurveID{tls.X25519, tls.CurveP256, tls.CurveP384, tls.CurveP521}, }) s.pqcServer = newServer(t, &tls.Config{ MinVersion: tls.VersionTLS13, CurvePreferences: []tls.CurveID{tls.X25519MLKEM768}, }) s.expected = []expectedBehavior{ { server: s.defaultServer, tlsDetails: "fixtures/tls-details-anything.yaml", expected: `\b418\b`, // "I'm a teapot" }, { server: s.tls12Server, tlsDetails: "fixtures/tls-details-anything.yaml", expected: `\b418\b`, // "I'm a teapot" }, { server: s.nonPQCserver, tlsDetails: "fixtures/tls-details-anything.yaml", expected: `\b418\b`, // "I'm a teapot" }, { server: s.pqcServer, tlsDetails: "fixtures/tls-details-anything.yaml", expected: `\b418\b`, // "I'm a teapot" }, { server: s.defaultServer, tlsDetails: "fixtures/tls-details-1.3.yaml", expected: `\b418\b`, // "I'm a teapot" }, { server: s.tls12Server, tlsDetails: "fixtures/tls-details-1.3.yaml", expected: `protocol version not supported`, }, { server: s.nonPQCserver, tlsDetails: "fixtures/tls-details-1.3.yaml", expected: `\b418\b`, // "I'm a teapot" }, { server: s.pqcServer, tlsDetails: "fixtures/tls-details-1.3.yaml", expected: `\b418\b`, // "I'm a teapot" }, { server: s.defaultServer, tlsDetails: "fixtures/tls-details-pqc-only.yaml", expected: `\b418\b`, // "I'm a teapot" }, { server: s.tls12Server, tlsDetails: "fixtures/tls-details-pqc-only.yaml", expected: `protocol version not supported`, }, { server: s.nonPQCserver, tlsDetails: "fixtures/tls-details-pqc-only.yaml", expected: `handshake failure`, }, { server: s.pqcServer, tlsDetails: "fixtures/tls-details-pqc-only.yaml", expected: `\b418\b`, // "I'm a teapot" }, } } func (s *tlsSuite) TearDownSuite() { } func (s *tlsSuite) TestDockerDaemon() { t := s.T() // Our server doesn’t perform client authentication, but the docker-daemon: option semantics // requires us to provide a certificate if we want to specify a CA. dockerCertPath := t.TempDir() caPath := filepath.Join(dockerCertPath, "ca.pem") privateKey, err := rsa.GenerateKey(rand.Reader, 4096) require.NoError(t, err) publicKey := &privateKey.PublicKey err = os.WriteFile(filepath.Join(dockerCertPath, "key.pem"), pem.EncodeToMemory(&pem.Block{ Type: "RSA PRIVATE KEY", Bytes: x509.MarshalPKCS1PrivateKey(privateKey), }), 0o644) require.NoError(t, err) referenceTime := time.Now() template := &x509.Certificate{ Subject: pkix.Name{ CommonName: "client", }, NotBefore: referenceTime.Add(-1 * time.Minute), NotAfter: referenceTime.Add(1 * time.Hour), } certDER, err := x509.CreateCertificate(rand.Reader, template, template, publicKey, privateKey) require.NoError(t, err) err = os.WriteFile(filepath.Join(dockerCertPath, "cert.pem"), pem.EncodeToMemory(&pem.Block{ Type: "CERTIFICATE", Bytes: certDER, }), 0o644) require.NoError(t, err) for _, e := range s.expected { err := os.WriteFile(caPath, e.server.certBytes, 0o644) require.NoError(t, err) assertSkopeoFails(t, e.expected, "--tls-details", e.tlsDetails, "inspect", "--daemon-host", e.server.server.URL, "--cert-dir", dockerCertPath, "docker-daemon:repo:tag") } } func (s *tlsSuite) TestRegistry() { t := s.T() caDir := t.TempDir() caPath := filepath.Join(caDir, "ca.crt") for _, e := range s.expected { err := os.WriteFile(caPath, e.server.certBytes, 0o644) require.NoError(t, err) assertSkopeoFails(t, e.expected, "--tls-details", e.tlsDetails, "inspect", "--cert-dir", caDir, "docker://"+e.server.hostPort+"/repo") } } func (s *tlsSuite) TestOCILayout() { t := s.T() caDir := t.TempDir() caPath := filepath.Join(caDir, "ca.crt") for _, e := range s.expected { err := os.WriteFile(caPath, e.server.certBytes, 0o644) require.NoError(t, err) ociLayoutDir := t.TempDir() destRef, err := layout.NewReference(ociLayoutDir, "repo:tag") require.NoError(t, err) dest, err := destRef.NewImageDestination(context.Background(), nil) require.NoError(t, err) manifestBytes, err := json.Marshal(imgspecv1.Manifest{ Versioned: specs.Versioned{SchemaVersion: 2}, MediaType: imgspecv1.MediaTypeImageManifest, Config: imgspecv1.Descriptor{ MediaType: imgspecv1.MediaTypeImageConfig, Digest: "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", Size: 42, URLs: []string{e.server.server.URL + "/config.json"}, }, Layers: []imgspecv1.Descriptor{}, ArtifactType: "", Subject: &imgspecv1.Descriptor{}, Annotations: map[string]string{}, }) require.NoError(t, err) err = dest.PutManifest(context.Background(), manifestBytes, nil) require.NoError(t, err) err = dest.Commit(context.Background(), nil) // nil is technically invalid, but works here require.NoError(t, err) err = dest.Close() require.NoError(t, err) // We don’t expose types.OCICertPath in the CLI. But if we get far enough to be worrying about certificates, // we already negotiated the TLS version and named group. expected := e.expected if expected == `\b418\b` { expected = `certificate signed by unknown authority` } assertSkopeoFails(t, expected, "--tls-details", e.tlsDetails, "inspect", "oci:"+ociLayoutDir) } } func (s *tlsSuite) TestOpenShift() { t := s.T() configDir := t.TempDir() configPath := filepath.Join(configDir, "kubeconfig") t.Setenv("KUBECONFIG", configPath) for _, e := range s.expected { err := os.WriteFile(configPath, fmt.Appendf(nil, `apiVersion: v1 clusters: - cluster: certificate-authority: "%s" server: "%s" name: our-cluster contexts: - context: cluster: our-cluster namespace: default name: our-context current-context: our-context kind: Config `, e.server.certPath, e.server.server.URL), 0o644) require.NoError(t, err) // The atomic: image access starts with resolving the tag in a k8s API (and that will always fail, one way or another), // so we never actually contact registry.example. assertSkopeoFails(t, e.expected, "--tls-details", e.tlsDetails, "inspect", "atomic:registry.example/namespace/repo:tag") } } // tlsConfigServer serves TLS with a specific configuration. // It returns StatusTeapot on all requests; we use that to detect that the TLS negotiation succeeded, // without bothering to actually implement any of the protocols. type tlsConfigServer struct { server *httptest.Server hostPort string certBytes []byte certPath string } func newServer(t *testing.T, config *tls.Config) *tlsConfigServer { server := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusTeapot) })) t.Cleanup(server.Close) server.TLS = config.Clone() server.StartTLS() certBytes := pem.EncodeToMemory(&pem.Block{ Type: "CERTIFICATE", Bytes: server.Certificate().Raw, }) certDir := t.TempDir() certPath := filepath.Join(certDir, "cert.pem") err := os.WriteFile(certPath, certBytes, 0o644) require.NoError(t, err) return &tlsConfigServer{ server: server, hostPort: server.Listener.Addr().String(), certBytes: certBytes, certPath: certPath, } } ================================================ FILE: integration/user_agent_test.go ================================================ package main import ( "net/http" "net/http/httptest" "slices" "strings" "sync" "testing" "github.com/stretchr/testify/require" ) // mockRegistryHandler implements a minimal Docker Registry V2 API that captures User-Agent headers type mockRegistryHandler struct { mu sync.Mutex userAgents []string } func (h *mockRegistryHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { // Capture the User-Agent header h.mu.Lock() h.userAgents = append(h.userAgents, r.Header.Get("User-Agent")) h.mu.Unlock() // Implement minimal Docker Registry V2 API endpoints for inspect --raw switch { case r.URL.Path == "/v2/": // Registry version check endpoint w.Header().Set("Docker-Distribution-API-Version", "registry/2.0") w.WriteHeader(http.StatusOK) case strings.HasSuffix(r.URL.Path, "/manifests/latest"): // Return a minimal OCI manifest as raw string // The digest matches this exact content manifest := `{"schemaVersion":2,"mediaType":"application/vnd.oci.image.manifest.v1+json","config":{"mediaType":"application/vnd.oci.image.config.v1+json","digest":"sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a","size":2},"layers":[{"mediaType":"application/vnd.oci.image.layer.v1.tar+gzip","digest":"sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","size":0}]}` w.Header().Set("Content-Type", "application/vnd.oci.image.manifest.v1+json") w.WriteHeader(http.StatusOK) if _, err := w.Write([]byte(manifest)); err != nil { panic(err) } default: w.WriteHeader(http.StatusNotFound) } } func (h *mockRegistryHandler) getUserAgents() []string { h.mu.Lock() defer h.mu.Unlock() return slices.Clone(h.userAgents) } func TestUserAgent(t *testing.T) { testCases := []struct { name string extraArgs []string userAgentValidator func(string) bool description string }{ { name: "default user agent", extraArgs: []string{}, userAgentValidator: func(ua string) bool { return strings.HasPrefix(ua, "skopeo/") }, description: "Default user agent should start with 'skopeo/'", }, { name: "custom user agent prefix", extraArgs: []string{"--user-agent-prefix", "bootc/1.0"}, userAgentValidator: func(ua string) bool { return strings.HasPrefix(ua, "bootc/1.0 skopeo/") }, description: "Custom user agent should be in format 'prefix skopeo/version'", }, { name: "prefix with spaces", extraArgs: []string{"--user-agent-prefix", "my cool app"}, userAgentValidator: func(ua string) bool { return strings.HasPrefix(ua, "my cool app skopeo/") }, description: "User agent with spaces should work correctly", }, } for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { handler := &mockRegistryHandler{} server := httptest.NewServer(handler) defer server.Close() // Extract host:port from the test server URL registryAddr := strings.TrimPrefix(server.URL, "http://") imageRef := "docker://" + registryAddr + "/test/image:latest" // Build arguments: base args + test-specific args + image ref args := append([]string{"--tls-verify=false"}, tc.extraArgs...) args = append(args, "inspect", "--raw", imageRef) // Run skopeo inspect --raw assertSkopeoSucceeds(t, "", args...) // Verify that at least one request was made with the expected User-Agent userAgents := handler.getUserAgents() require.NotEmpty(t, userAgents, "Expected at least one request to be made") // Check that at least one User-Agent matches the validator require.True(t, slices.ContainsFunc(userAgents, tc.userAgentValidator), "%s, got: %v", tc.description, userAgents) }) } } ================================================ FILE: integration/utils_test.go ================================================ package main import ( "bytes" "compress/gzip" "encoding/json" "errors" "io" "net" "net/netip" "os" "os/exec" "path/filepath" "strings" "testing" "time" "github.com/opencontainers/go-digest" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.podman.io/image/v5/manifest" ) // FIXME: Move to SetupSuite // https://github.com/containers/skopeo/pull/2703#discussion_r2331374730 var skopeoBinary = func() string { if binary := os.Getenv("SKOPEO_BINARY"); binary != "" { return binary } return "skopeo" }() // findFingerprint extracts the GPG key fingerprint from gpg --with-colons output. func findFingerprint(lineBytes []byte) (string, error) { for line := range bytes.SplitSeq(lineBytes, []byte{'\n'}) { fields := strings.Split(string(line), ":") if len(fields) >= 10 && fields[0] == "fpr" { return fields[9], nil } } return "", errors.New("No fingerprint found") } const ( testFQIN = "docker://quay.io/libpod/busybox" // tag left off on purpose, some tests need to add a special one testFQIN64 = "docker://quay.io/libpod/busybox:amd64" testFQINMultiLayer = "docker://quay.io/libpod/alpine_nginx:latest" // multi-layer ) // consumeAndLogOutputStream takes (f, err) from an exec.*Pipe(), and causes all output to it to be logged to t. func consumeAndLogOutputStream(t *testing.T, id string, f io.ReadCloser, err error) { require.NoError(t, err) go func() { defer func() { f.Close() t.Logf("Output %s: Closed", id) }() buf := make([]byte, 1024) for { t.Logf("Output %s: waiting", id) n, err := f.Read(buf) t.Logf("Output %s: got %d,%#v: %s", id, n, err, strings.TrimSuffix(string(buf[:n]), "\n")) if n <= 0 { break } } }() } // consumeAndLogOutputs causes all output to stdout and stderr from an *exec.Cmd to be logged to c. func consumeAndLogOutputs(t *testing.T, id string, cmd *exec.Cmd) { stdout, err := cmd.StdoutPipe() consumeAndLogOutputStream(t, id+" stdout", stdout, err) stderr, err := cmd.StderrPipe() consumeAndLogOutputStream(t, id+" stderr", stderr, err) } // combinedOutputOfCommand runs a command as if exec.Command().CombinedOutput(), verifies that the exit status is 0, and returns the output, // or terminates t on failure. func combinedOutputOfCommand(t *testing.T, name string, args ...string) string { t.Logf("Running %s %s", name, strings.Join(args, " ")) out, err := exec.Command(name, args...).CombinedOutput() require.NoError(t, err, "%s", out) return string(out) } // assertSkopeoSucceeds runs a skopeo command as if exec.Command().CombinedOutput, verifies that the exit status is 0, // and optionally that the output matches a multi-line regexp if it is nonempty func assertSkopeoSucceeds(t *testing.T, regexp string, args ...string) { t.Logf("Running %s %s", skopeoBinary, strings.Join(args, " ")) out, err := exec.Command(skopeoBinary, args...).CombinedOutput() assert.NoError(t, err, "%s", out) if regexp != "" { assert.Regexp(t, "(?s)"+regexp, string(out)) // (?s) : '.' will also match newlines } } // assertSkopeoFails runs a skopeo command as if exec.Command().CombinedOutput, verifies that the exit status is not 0, // and that the output matches a multi-line regexp func assertSkopeoFails(t *testing.T, regexp string, args ...string) { t.Logf("Running %s %s", skopeoBinary, strings.Join(args, " ")) out, err := exec.Command(skopeoBinary, args...).CombinedOutput() assert.Error(t, err, "%s", out) assert.Regexp(t, "(?s)"+regexp, string(out)) // (?s) : '.' will also match newlines } // assertSkopeoFailsWithStatus runs a skopeo command as if exec.Command().CombinedOutput, // and verifies that it fails with a specific exit status. func assertSkopeoFailsWithStatus(t *testing.T, status int, args ...string) { t.Logf("Running %s %s", skopeoBinary, strings.Join(args, " ")) _, err := exec.Command(skopeoBinary, args...).CombinedOutput() var exitErr *exec.ExitError require.ErrorAs(t, err, &exitErr) assert.Equal(t, status, exitErr.ExitCode()) } // runCommandWithInput runs a command as if exec.Command(), sending it the input to stdin, // and verifies that the exit status is 0, or terminates t on failure. func runCommandWithInput(t *testing.T, input string, name string, args ...string) { cmd := exec.Command(name, args...) runExecCmdWithInput(t, cmd, input) } // runExecCmdWithInput runs an exec.Cmd, sending it the input to stdin, // and verifies that the exit status is 0, or terminates t on failure. func runExecCmdWithInput(t *testing.T, cmd *exec.Cmd, input string) { t.Logf("Running %s %s", cmd.Path, strings.Join(cmd.Args, " ")) consumeAndLogOutputs(t, cmd.Path+" "+strings.Join(cmd.Args, " "), cmd) stdin, err := cmd.StdinPipe() require.NoError(t, err) err = cmd.Start() require.NoError(t, err) _, err = io.WriteString(stdin, input) require.NoError(t, err) err = stdin.Close() require.NoError(t, err) err = cmd.Wait() assert.NoError(t, err) } // isPortOpen returns true iff the specified port on localhost is open. func isPortOpen(port uint16) bool { ap := netip.AddrPortFrom(netip.AddrFrom4([4]byte{127, 0, 0, 1}), port) conn, err := net.DialTCP("tcp", nil, net.TCPAddrFromAddrPort(ap)) if err != nil { return false } conn.Close() return true } // newPortChecker sets up a portOpen channel which will receive true after the specified port is open. // The checking can be aborted by sending a value to the terminate channel, which the caller should // always do using // defer func() {terminate <- true}() func newPortChecker(t *testing.T, port uint16) (portOpen <-chan bool, terminate chan<- bool) { portOpenBidi := make(chan bool) // Buffered, so that sending a terminate request after the goroutine has exited does not block. terminateBidi := make(chan bool, 1) go func() { defer func() { t.Logf("Port checker for port %d exiting", port) }() for { t.Logf("Checking for port %d...", port) if isPortOpen(port) { t.Logf("Port %d open", port) portOpenBidi <- true return } t.Logf("Sleeping for port %d", port) sleepChan := time.After(100 * time.Millisecond) select { case <-sleepChan: // Try again t.Logf("Sleeping for port %d done, will retry", port) case <-terminateBidi: t.Logf("Check for port %d terminated", port) return } } }() return portOpenBidi, terminateBidi } // modifyEnviron modifies os.Environ()-like list of name=value assignments to set name to value. func modifyEnviron(env []string, name, value string) []string { prefix := name + "=" res := []string{} for _, e := range env { if !strings.HasPrefix(e, prefix) { res = append(res, e) } } return append(res, prefix+value) } // fileFromFixture applies edits to inputPath and returns a path to the temporary file with the edits, // which will be automatically removed when the test completes. func fileFromFixture(t *testing.T, inputPath string, edits map[string]string) string { contents, err := os.ReadFile(inputPath) require.NoError(t, err) for template, value := range edits { updated := bytes.ReplaceAll(contents, []byte(template), []byte(value)) require.NotEqual(t, contents, updated, "Replacing %s in %#v failed", template, string(contents)) // Verify that the template has matched something and we are not silently ignoring it. contents = updated } path := filepath.Join(t.TempDir(), "policy.json") err = os.WriteFile(path, contents, 0o600) require.NoError(t, err) return path } // decompressDirs decompresses specified dir:-formatted directories func decompressDirs(t *testing.T, dirs ...string) { t.Logf("Decompressing %s", strings.Join(dirs, " ")) for i, dir := range dirs { m, err := os.ReadFile(filepath.Join(dir, "manifest.json")) require.NoError(t, err) t.Logf("manifest %d before: %s", i+1, string(m)) decompressDir(t, dir) m, err = os.ReadFile(filepath.Join(dir, "manifest.json")) require.NoError(t, err) t.Logf("manifest %d after: %s", i+1, string(m)) } } // getRawMapField assigns a value of rawMap[key] to dest, // failing if it does not exist or if it doesn’t have the expected type func getRawMapField[T any](t *testing.T, rawMap map[string]any, key string, dest *T) { rawValue, ok := rawMap[key] require.True(t, ok, key) value, ok := rawValue.(T) require.True(t, ok, key, "%#v", value) *dest = value } // decompressDir modifies a dir:-formatted directory to replace gzip-compressed layers with uncompressed variants, // and to use a ~canonical formatting of manifest.json. func decompressDir(t *testing.T, dir string) { // This is, overall, very dumb; the “obvious” way would be to invoke skopeo to decompress, // or at least to use c/image to parse/format the manifest. // // But this is used to test (aspects of) those code paths… so, it’s acceptable for this to be // dumb and to make assumptions about the data, but it should not share code. manifestBlob, err := os.ReadFile(filepath.Join(dir, "manifest.json")) require.NoError(t, err) var rawManifest map[string]any err = json.Unmarshal(manifestBlob, &rawManifest) require.NoError(t, err) var rawLayers []any getRawMapField(t, rawManifest, "layers", &rawLayers) for i, rawLayerValue := range rawLayers { rawLayer, ok := rawLayerValue.(map[string]any) require.True(t, ok) var digestString string getRawMapField(t, rawLayer, "digest", &digestString) compressedDigest, err := digest.Parse(digestString) require.NoError(t, err) if compressedDigest.String() == "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" { // An empty file continue } compressedPath := filepath.Join(dir, compressedDigest.Encoded()) compressedStream, err := os.Open(compressedPath) require.NoError(t, err) defer compressedStream.Close() uncompressedStream, err := gzip.NewReader(compressedStream) if err != nil { continue // Silently assume the layer is not gzip-compressed } tempDest, err := os.CreateTemp(dir, "decompressing") require.NoError(t, err) digester := digest.Canonical.Digester() uncompressedSize, err := io.Copy(tempDest, io.TeeReader(uncompressedStream, digester.Hash())) require.NoError(t, err) err = uncompressedStream.Close() require.NoError(t, err) uncompressedDigest := digester.Digest() uncompressedPath := filepath.Join(dir, uncompressedDigest.Encoded()) err = os.Rename(tempDest.Name(), uncompressedPath) require.NoError(t, err) err = os.Remove(compressedPath) require.NoError(t, err) rawLayer["digest"] = uncompressedDigest.String() rawLayer["size"] = uncompressedSize var mimeType string getRawMapField(t, rawLayer, "mediaType", &mimeType) if uncompressedMIMEType, ok := strings.CutSuffix(mimeType, ".gzip"); ok { rawLayer["mediaType"] = uncompressedMIMEType } rawLayers[i] = rawLayer } rawManifest["layers"] = rawLayers manifestBlob, err = json.Marshal(rawManifest) require.NoError(t, err) err = os.WriteFile(filepath.Join(dir, "manifest.json"), manifestBlob, 0o600) require.NoError(t, err) } // Verify manifest in a dir: image at dir is expectedMIMEType. func verifyManifestMIMEType(t *testing.T, dir string, expectedMIMEType string) { manifestBlob, err := os.ReadFile(filepath.Join(dir, "manifest.json")) require.NoError(t, err) mimeType := manifest.GuessMIMEType(manifestBlob) assert.Equal(t, expectedMIMEType, mimeType) } ================================================ FILE: plans/main.fmf ================================================ discover: how: fmf execute: how: tmt prepare: - when: distro == centos-stream or distro == rhel how: shell script: | # Install bats # https://bats-core.readthedocs.io/en/stable/installation.html BATS_VERSION=1.12.0 curl -L https://github.com/bats-core/bats-core/archive/refs/tags/v"$BATS_VERSION".tar.gz | tar -xz pushd bats-core-"$BATS_VERSION" ./install.sh /usr popd rm -rf bats-core-"$BATS_VERSION" order: 10 - when: initiator == packit how: shell script: | COPR_REPO_FILE="/etc/yum.repos.d/*podman-next*.repo" if compgen -G $COPR_REPO_FILE > /dev/null; then sed -i -n '/^priority=/!p;$apriority=1' $COPR_REPO_FILE fi dnf -y upgrade --allowerasing order: 20 - name: Disable installing everything from srpm how: install exclude: - ".*" - name: Install the main package how: install package: - skopeo-tests ================================================ FILE: rpm/skopeo.spec ================================================ %global with_debug 1 %if 0%{?with_debug} %global _find_debuginfo_dwz_opts %{nil} %global _dwz_low_mem_die_limit 0 %else %global debug_package %{nil} %endif %global gomodulesmode GO111MODULE=on # Distro and environment conditionals %if %{defined fedora} # Fedora conditionals %define build_with_btrfs 1 %define conditional_epoch 1 %if %{?fedora} >= 43 %define sequoia 1 %endif %else # RHEL conditionals %define conditional_epoch 2 %define fips 1 %endif # set higher Epoch only for podman-next builds %if %{defined copr_username} && "%{copr_username}" == "rhcontainerbot" && "%{copr_projectname}" == "podman-next" %define next_build 1 %endif Name: skopeo %if %{defined next_build} Epoch: 102 %else Epoch: %{conditional_epoch} %endif # DO NOT TOUCH the Version string! # The TRUE source of this specfile is: # https://github.com/containers/skopeo/blob/main/rpm/skopeo.spec # If that's what you're reading, Version must be 0, and will be updated by Packit for # copr and koji builds. # If you're reading this on dist-git, the version is automatically filled in by Packit. Version: 0 # The `AND` needs to be uppercase in the License for SPDX compatibility License: Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 Release: %autorelease %if %{defined golang_arches_future} ExclusiveArch: %{golang_arches_future} %else ExclusiveArch: aarch64 ppc64le s390x x86_64 %endif Summary: Inspect container images and repositories on registries URL: https://github.com/containers/%{name} # Tarball fetched from upstream Source0: %{url}/archive/v%{version}.tar.gz BuildRequires: %{_bindir}/go-md2man %if %{defined build_with_btrfs} BuildRequires: btrfs-progs-devel %endif BuildRequires: git-core BuildRequires: golang %if !%{defined gobuild} BuildRequires: go-rpm-macros %endif BuildRequires: gpgme-devel BuildRequires: libassuan-devel BuildRequires: glib2-devel BuildRequires: make BuildRequires: shadow-utils-subid-devel BuildRequires: sqlite-devel Requires: containers-common >= 4:1-21 %if %{defined sequoia} Requires: podman-sequoia %endif %description Command line utility to inspect images and repositories directly on Docker registries without the need to pull them. # NOTE: The tests subpackage is only intended for testing and will not be supported # for end-users and/or customers. %package tests Summary: Test dependencies for %{name} Requires: %{name} = %{epoch}:%{version}-%{release} Requires: gnupg Requires: jq Requires: golang Requires: podman Requires: crun Requires: httpd-tools Requires: openssl Requires: squashfs-tools # bats and fakeroot are not present on RHEL and ELN so they shouldn't be strong deps Recommends: bats Recommends: fakeroot %description tests This package installs system test dependencies for %{name} %prep %autosetup -Sgit %{name}-%{version} # The %%install stage should not rebuild anything but only install what's # built in the %%build stage. So, remove any dependency on build targets. sed -i 's/^install-binary: bin\/%{name}.*/install-binary:/' Makefile sed -i 's/^completions: bin\/%{name}.*/completions:/' Makefile sed -i 's/^install-docs: docs.*/install-docs:/' Makefile %build %set_build_flags export CGO_CFLAGS=$CFLAGS # These extra flags present in $CFLAGS have been skipped for now as they break the build CGO_CFLAGS=$(echo $CGO_CFLAGS | sed 's/-flto=auto//g') CGO_CFLAGS=$(echo $CGO_CFLAGS | sed 's/-Wp,D_GLIBCXX_ASSERTIONS//g') CGO_CFLAGS=$(echo $CGO_CFLAGS | sed 's/-specs=\/usr\/lib\/rpm\/redhat\/redhat-annobin-cc1//g') %ifarch x86_64 export CGO_CFLAGS="$CGO_CFLAGS -m64 -mtune=generic -fcf-protection=full" %endif BASEBUILDTAGS="$(hack/libsubid_tag.sh) libsqlite3" %if %{defined build_with_btrfs} export BUILDTAGS="$BASEBUILDTAGS $(hack/btrfs_installed_tag.sh)" %else export BUILDTAGS="$BASEBUILDTAGS exclude_graphdriver_btrfs" %endif %if %{defined fips} export BUILDTAGS="$BUILDTAGS libtrust_openssl" %endif %if %{defined sequoia} export BUILDTAGS="$BUILDTAGS containers_image_sequoia" %endif # unset LDFLAGS earlier set from set_build_flags LDFLAGS='' %gobuild -o bin/%{name} ./cmd/%{name} %{__make} docs %install make \ DESTDIR=%{buildroot} \ PREFIX=%{_prefix} \ install-binary install-docs install-completions #define license tag if not already defined %{!?_licensedir:%global license %doc} # Include this to silence rpmlint. # Especially annoying if you use syntastic vim plugin. %check %files %license LICENSE %doc README.md %{_bindir}/%{name} %{_mandir}/man1/%{name}* %dir %{_datadir}/bash-completion %dir %{_datadir}/bash-completion/completions %{_datadir}/bash-completion/completions/%{name} %dir %{_datadir}/fish/vendor_completions.d %{_datadir}/fish/vendor_completions.d/%{name}.fish %dir %{_datadir}/zsh/site-functions %{_datadir}/zsh/site-functions/_%{name} # Only test dependencies installed, no files. %files tests %changelog %autochangelog ================================================ FILE: systemtest/001-basic.bats ================================================ #!/usr/bin/env bats # # Simplest set of skopeo tests. If any of these fail, we have serious problems. # load helpers # Override standard setup! We don't yet trust anything function setup() { : } @test "skopeo version emits reasonable output" { run_skopeo --version expect_output --substring "skopeo version [0-9.]+" } @test "skopeo release isn't a development version" { [[ "${RELEASE_TESTING:-false}" == "true" ]] || \ skip "Release testing may be enabled by setting \$RELEASE_TESTING = 'true'." run_skopeo --version # expect_output() doesn't support negative matching if [[ "$output" =~ "dev" ]]; then # This is a multi-line message, which may in turn contain multi-line # output, so let's format it ourselves, readably local -a output_split readarray -t output_split <<<"$output" printf "#/vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\n" >&2 printf "#| FAIL: $BATS_TEST_NAME\n" >&2 printf "#| unexpected: 'dev'\n" >&2 printf "#| actual: '%s'\n" "${output_split[0]}" >&2 local line for line in "${output_split[@]:1}"; do printf "#| > '%s'\n" "$line" >&2 done printf "#\\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" >&2 false fi } # vim: filetype=sh ================================================ FILE: systemtest/010-inspect.bats ================================================ #!/usr/bin/env bats # # Simplest test for skopeo inspect # load helpers @test "inspect: basic" { workdir=$TESTDIR/inspect remote_image=docker://quay.io/libpod/alpine_labels:latest # Inspect remote source, then pull it. There's a small race condition # in which the remote image can get updated between the inspect and # the copy; let's just not worry about it. run_skopeo inspect $remote_image inspect_remote=$output # Now pull it into a directory run_skopeo copy $remote_image dir:$workdir expect_output --substring "Getting image source signatures" expect_output --substring "Writing manifest to image destination" # Unpacked contents must include a manifest and version [ -e $workdir/manifest.json ] [ -e $workdir/version ] # Now run inspect locally run_skopeo inspect dir:$workdir inspect_local=$output run_skopeo inspect --raw dir:$workdir inspect_local_raw=$output config_digest=$(jq -r '.config.digest' <<<"$inspect_local_raw") # Each SHA-named layer file (but not the config) must be listed in the output of 'inspect'. # In all existing versions of Skopeo (with 1.6 being the current as of this comment), # the output of 'inspect' lists layer digests, # but not the digest of the config blob ($config_digest), if any. layers=$(jq -r '.Layers' <<<"$inspect_local") for sha in $(find $workdir -type f | xargs -l1 basename | grep -E '^[0-9a-f]{64}$'); do if [ "sha256:$sha" != "$config_digest" ]; then expect_output --from="$layers" --substring "sha256:$sha" \ "Locally-extracted SHA file is present in 'inspect'" fi done # Simple sanity check on 'inspect' output. # For each of the given keys (LHS of the table below): # 1) Get local and remote values # 2) Sanity-check local value using simple expression # 3) Confirm that local and remote values match. # # The reason for (2) is to make sure that we don't compare bad results # # The reason for a hardcoded list, instead of 'jq keys', is that RepoTags # is always empty locally, but a list remotely. while read key expect; do local=$(echo "$inspect_local" | jq -r ".$key") remote=$(echo "$inspect_remote" | jq -r ".$key") expect_output --from="$local" --substring "$expect" \ "local $key is sane" expect_output --from="$remote" "$local" \ "local $key matches remote" done < storage -> oci-archive @test "copy: registry -> storage -> oci-archive" { local alpine=quay.io/libpod/alpine:latest local tmp=$TESTDIR/oci run_skopeo copy docker://$alpine containers-storage:$alpine run_skopeo copy containers-storage:$alpine oci-archive:$tmp } # This one seems unlikely to get fixed @test "copy: bug 651" { skip "Enable this once skopeo issue #651 has been fixed" run_skopeo copy --dest-tls-verify=false \ docker://quay.io/libpod/alpine_labels:latest \ docker://localhost:5000/foo } # manifest format @test "copy: manifest format" { local remote_image=docker://quay.io/libpod/busybox:latest local dir1=$TESTDIR/dir1 local dir2=$TESTDIR/dir2 run_skopeo copy --format v2s2 $remote_image dir:$dir1 run_skopeo copy --format oci $remote_image dir:$dir2 grep 'application/vnd.docker.distribution.manifest.v2' $dir1/manifest.json grep 'application/vnd.oci.image' $dir2/manifest.json } # additional tag @test "copy: additional tag" { local remote_image=docker://quay.io/libpod/busybox:latest # additional-tag is supported only for docker-archive run_skopeo copy --additional-tag busybox:mine $remote_image \ docker-archive:$TESTDIR/mybusybox.tar:busybox:latest mkdir -p $TESTDIR/podmanroot run podman --root $TESTDIR/podmanroot load -i $TESTDIR/mybusybox.tar run podman --root $TESTDIR/podmanroot images expect_output --substring "mine" # rootless cleanup needs to be done with unshare due to subuids if [[ "$(id -u)" != "0" ]]; then run podman unshare rm -rf $TESTDIR/podmanroot fi } # shared blob directory @test "copy: shared blob directory" { local remote_image=docker://quay.io/libpod/busybox:latest local shareddir=$TESTDIR/shareddir local dir1=$TESTDIR/dir1 local dir2=$TESTDIR/dir2 run_skopeo copy --dest-shared-blob-dir $shareddir \ $remote_image oci:$dir1 [ -n "$(ls $shareddir)" ] [ -z "$(ls $dir1/blobs)" ] run_skopeo copy --src-shared-blob-dir $shareddir \ oci:$dir1 oci:$dir2 diff -urN $shareddir $dir2/blobs } @test "copy: sif image" { type -path fakeroot || skip "'fakeroot' tool not available" local localimg=dir:$TESTDIR/dir run_skopeo copy sif:${TEST_SOURCE_DIR}/testdata/busybox_latest.sif $localimg run_skopeo inspect $localimg --format "{{.Architecture}}" expect_output "amd64" } teardown() { podman rm -f reg standard_teardown } # vim: filetype=sh ================================================ FILE: systemtest/030-local-registry-tls.bats ================================================ #!/usr/bin/env bats # # Confirm that skopeo will push to and pull from a local # registry with locally-created TLS certificates. # load helpers function setup() { standard_setup start_registry --with-cert --enable-delete=true reg } @test "local registry, with cert" { # Push to local registry... run_skopeo copy --dest-cert-dir=$TESTDIR/client-auth \ docker://quay.io/libpod/busybox:latest \ docker://localhost:5000/busybox:unsigned # ...and pull it back out run_skopeo copy --src-cert-dir=$TESTDIR/client-auth \ docker://localhost:5000/busybox:unsigned \ dir:$TESTDIR/extracted # inspect with cert run_skopeo inspect --cert-dir=$TESTDIR/client-auth \ docker://localhost:5000/busybox:unsigned expect_output --substring "localhost:5000/busybox" # delete with cert run_skopeo delete --cert-dir=$TESTDIR/client-auth \ docker://localhost:5000/busybox:unsigned } teardown() { podman rm -f reg standard_teardown } # vim: filetype=sh ================================================ FILE: systemtest/040-local-registry-auth.bats ================================================ #!/usr/bin/env bats # # Tests with a local registry with auth # load helpers function setup() { standard_setup # Start authenticated registry with random password testuser=testuser testpassword=$(random_string 15) start_registry --testuser=$testuser --testpassword=$testpassword --enable-delete=true reg _cred_dir=$TESTDIR/credentials # It is important to change XDG_RUNTIME_DIR only after we start the registry, otherwise it affects the path of $XDG_RUNTIME_DIR/netns maintained by Podman, # making it impossible to clean up after ourselves. export XDG_RUNTIME_DIR_OLD=$XDG_RUNTIME_DIR export XDG_RUNTIME_DIR=$_cred_dir mkdir -p $_cred_dir/containers # Remove old/stale cred file rm -f $_cred_dir/containers/auth.json } @test "auth: credentials on command line" { # No creds run_skopeo 1 inspect --tls-verify=false docker://localhost:5000/nonesuch expect_output --substring "authentication required" # Wrong user run_skopeo 1 inspect --tls-verify=false --creds=baduser:badpassword \ docker://localhost:5000/nonesuch expect_output --substring "authentication required" # Wrong password run_skopeo 1 inspect --tls-verify=false --creds=$testuser:badpassword \ docker://localhost:5000/nonesuch expect_output --substring "authentication required" # Correct creds, but no such image run_skopeo 2 inspect --tls-verify=false --creds=$testuser:$testpassword \ docker://localhost:5000/nonesuch expect_output --substring "manifest unknown" # These should pass run_skopeo copy --dest-tls-verify=false --dcreds=$testuser:$testpassword \ docker://quay.io/libpod/busybox:latest \ docker://localhost:5000/busybox:mine run_skopeo inspect --tls-verify=false --creds=$testuser:$testpassword \ docker://localhost:5000/busybox:mine expect_output --substring "localhost:5000/busybox" } @test "auth: credentials via podman login" { # Logged in: skopeo should work podman login --tls-verify=false -u $testuser -p $testpassword localhost:5000 run_skopeo copy --dest-tls-verify=false \ docker://quay.io/libpod/busybox:latest \ docker://localhost:5000/busybox:mine run_skopeo inspect --tls-verify=false docker://localhost:5000/busybox:mine expect_output --substring "localhost:5000/busybox" # Logged out: should fail podman logout localhost:5000 run_skopeo 1 inspect --tls-verify=false docker://localhost:5000/busybox:mine expect_output --substring "authentication required" } @test "auth: copy with --src-creds and --dest-creds" { run_skopeo copy --dest-tls-verify=false --dest-creds=$testuser:$testpassword \ docker://quay.io/libpod/busybox:latest \ docker://localhost:5000/busybox:mine run_skopeo copy --src-tls-verify=false --src-creds=$testuser:$testpassword \ docker://localhost:5000/busybox:mine \ dir:$TESTDIR/dir1 run ls $TESTDIR/dir1 expect_output --substring "manifest.json" } @test "auth: credentials via authfile" { podman login --tls-verify=false --authfile $TESTDIR/test.auth -u $testuser -p $testpassword localhost:5000 # copy without authfile: should fail run_skopeo 1 copy --dest-tls-verify=false \ docker://quay.io/libpod/busybox:latest \ docker://localhost:5000/busybox:mine # copy with authfile: should work run_skopeo copy --dest-tls-verify=false \ --authfile $TESTDIR/test.auth \ docker://quay.io/libpod/busybox:latest \ docker://localhost:5000/busybox:mine # inspect without authfile: should fail run_skopeo 1 inspect --tls-verify=false docker://localhost:5000/busybox:mine expect_output --substring "authentication required" # inspect with authfile: should work run_skopeo inspect --tls-verify=false --authfile $TESTDIR/test.auth docker://localhost:5000/busybox:mine expect_output --substring "localhost:5000/busybox" # delete without authfile: should fail run_skopeo 1 delete --tls-verify=false docker://localhost:5000/busybox:mine expect_output --substring "authentication required" # delete with authfile: should work run_skopeo delete --tls-verify=false --authfile $TESTDIR/test.auth docker://localhost:5000/busybox:mine } teardown() { # Need to restore XDG_RUNTIME_DIR. XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR_OLD podman rm -f reg if [[ -n $_cred_dir ]]; then rm -rf $_cred_dir fi standard_teardown } # vim: filetype=sh ================================================ FILE: systemtest/050-signing.bats ================================================ #!/usr/bin/env bats # # Tests with gpg signing # load helpers function setup() { standard_setup # Create dummy gpg keys export GNUPGHOME=$TESTDIR/skopeo-gpg mkdir --mode=0700 $GNUPGHOME PASSPHRASE_FILE=$TESTDIR/passphrase-file passphrase=$(random_string 20) echo $passphrase > $PASSPHRASE_FILE PASSPHRASE_FILE_WRONG=$TESTDIR/passphrase-file-wrong echo $(random_string 10) > $PASSPHRASE_FILE_WRONG # gpg on f30 needs this, otherwise: # gpg: agent_genkey failed: Inappropriate ioctl for device # ...but gpg on f29 (and, probably, Ubuntu) doesn't grok this GPGOPTS='--pinentry-mode loopback' if gpg --pinentry-mode asdf 2>&1 | grep -qi 'Invalid option'; then GPGOPTS= fi for k in alice bob;do gpg --batch $GPGOPTS --gen-key --passphrase $passphrase <$GNUPGHOME/pubkey-$k.gpg done # Registries. The important part here seems to be sigstore, # because (I guess?) the registry itself has no mechanism # for storing or validating signatures. REGISTRIES_D=$TESTDIR/registries.d mkdir $REGISTRIES_D $TESTDIR/sigstore cat >$REGISTRIES_D/registries.yaml <$POLICY_JSON </dev/null; then echo "*** TIMED OUT ***" false fi if [ -n "$expected_rc" ]; then if [ "$status" -ne "$expected_rc" ]; then die "exit code is $status; expected $expected_rc" fi fi } ################# # log_and_run # log a command for later debugging, then run it ################# # # When diagnosing a test failure, it can be really nice to see the # more important commands that have been run in test setup: openssl, # podman registry, other complex commands that can give one a boost # when trying to reproduce problems. This simple wrapper takes a # command as its arg, echoes it to stdout (with a '$' prefix), # then runs the command. BATS does not show stdout unless there's # an error. Use this judiciously. # function log_and_run() { echo "\$ $*" "$@" } ######### # die # Abort with helpful message ######### function die() { echo "#/vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv" >&2 echo "#| FAIL: $*" >&2 echo "#\\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" >&2 false } ################### # expect_output # Compare actual vs expected string; fail if mismatch ################### # # Compares $output against the given string argument. Optional second # argument is descriptive text to show as the error message (default: # the command most recently run by 'run_skopeo'). This text can be # useful to isolate a failure when there are multiple identical # run_skopeo invocations, and the difference is solely in the # config or setup; see, e.g., run.bats:run-cmd(). # # By default we run an exact string comparison; use --substring to # look for the given string anywhere in $output. # # By default we look in "$output", which is set in run_skopeo(). # To override, use --from="some-other-string" (e.g. "${lines[0]}") # # Examples: # # expect_output "this is exactly what we expect" # expect_output "foo=bar" "description of this particular test" # expect_output --from="${lines[0]}" "expected first line" # function expect_output() { # By default we examine $output, the result of run_skopeo local actual="$output" local check_substring= # option processing: recognize --from="...", --substring local opt for opt; do local value=$(expr "$opt" : '[^=]*=\(.*\)') case "$opt" in --from=*) actual="$value"; shift;; --substring) check_substring=1; shift;; --) shift; break;; -*) die "Invalid option '$opt'" ;; *) break;; esac done local expect="$1" local testname="${2:-${MOST_RECENT_SKOPEO_COMMAND:-[no test name given]}}" if [ -z "$expect" ]; then if [ -z "$actual" ]; then return fi expect='[no output]' elif [ "$actual" = "$expect" ]; then return elif [ -n "$check_substring" ]; then if [[ "$actual" =~ $expect ]]; then return fi fi # This is a multi-line message, which may in turn contain multi-line # output, so let's format it ourselves, readably local -a actual_split readarray -t actual_split <<<"$actual" printf "#/vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\n" >&2 printf "#| FAIL: $testname\n" >&2 printf "#| expected: '%s'\n" "$expect" >&2 printf "#| actual: '%s'\n" "${actual_split[0]}" >&2 local line for line in "${actual_split[@]:1}"; do printf "#| > '%s'\n" "$line" >&2 done printf "#\\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" >&2 false } ####################### # expect_line_count # Check the expected number of output lines ####################### # # ...from the most recent run_skopeo command # function expect_line_count() { local expect="$1" local testname="${2:-${MOST_RECENT_SKOPEO_COMMAND:-[no test name given]}}" local actual="${#lines[@]}" if [ "$actual" -eq "$expect" ]; then return fi printf "#/vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\n" >&2 printf "#| FAIL: $testname\n" >&2 printf "#| Expected %d lines of output, got %d\n" $expect $actual >&2 printf "#| Output was:\n" >&2 local line for line in "${lines[@]}"; do printf "#| >%s\n" "$line" >&2 done printf "#\\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" >&2 false } # END standard helpers for running skopeo and testing results ############################################################################### # BEGIN helpers for starting/stopping registries #################### # start_registry # Run a local registry container #################### # # Usage: start_registry [OPTIONS] NAME # # OPTIONS # --port=NNNN Port to listen on (default: 5000) # --testuser=XXX Require authentication; this is the username # --testpassword=XXX ...and the password (these two go together) # --with-cert Create a cert for running with TLS (not working) # --enable-delete Set allowing registry deletions (default: false) # # NAME is the container name to assign. # start_registry() { local port=5000 local testuser= local testpassword= local create_cert= local enable_delete=false # option processing: recognize options for running the registry # in different modes. local opt for opt; do local value=$(expr "$opt" : '[^=]*=\(.*\)') case "$opt" in --port=*) port="$value"; shift;; --testuser=*) testuser="$value"; shift;; --testpassword=*) testpassword="$value"; shift;; --with-cert) create_cert=1; shift;; --enable-delete=*) enable_delete="$value"; shift;; -*) die "Invalid option '$opt'" ;; *) break;; esac done local name=${1?start_registry() invoked without a NAME} # Temp directory must be defined and must exist [[ -n $TESTDIR && -d $TESTDIR ]] AUTHDIR=$TESTDIR/auth mkdir -p $AUTHDIR local -a reg_args=(-v $AUTHDIR:/auth:Z -p $port:5000) if [[ "$enable_delete" == "true" ]]; then reg_args+=( -e REGISTRY_STORAGE_DELETE_ENABLED=true) fi # TODO: This is TEMPORARY (as of 2020-03-30); remove once crun is fixed. # Skopeo PR #836 claims there's a "regression" in crun with cgroupsv1, # but offers no details about what it is (crun issue nor PR) nor when/if # it's fixed. It's simply a workaround, forcing podman to use runc, # which might work great for skopeo CI but breaks Fedora gating tests. # Instead of always forcing runc, do so only when under cgroups v1: local runtime= cgroup_type=$(stat -f -c %T /sys/fs/cgroup) if [[ $cgroup_type == "tmpfs" ]]; then runtime="--runtime runc" fi # cgroup option necessary under podman-in-podman (CI tests), # and doesn't seem to do any harm otherwise. PODMAN="podman $runtime --cgroup-manager=cgroupfs" # Called with --testuser? Create an htpasswd file if [[ -n $testuser ]]; then if [[ -z $testpassword ]]; then die "start_registry() invoked with testuser but no testpassword" fi if ! grep -E -q "^$testuser:" $AUTHDIR/htpasswd; then htpasswd -Bbn $testuser $testpassword >> $AUTHDIR/htpasswd fi reg_args+=( -e REGISTRY_AUTH=htpasswd -e REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd -e REGISTRY_AUTH_HTPASSWD_REALM="Registry Realm" ) fi # Called with --with-cert? Create certificates. if [[ -n $create_cert ]]; then CERT=$AUTHDIR/domain.crt if [ ! -e $CERT ]; then log_and_run openssl req -newkey rsa:4096 -nodes -sha256 \ -keyout $AUTHDIR/domain.key -x509 -days 2 \ -out $CERT \ -subj "/C=US/ST=Foo/L=Bar/O=Red Hat, Inc./CN=registry host certificate" \ -addext subjectAltName=DNS:localhost fi reg_args+=( -e REGISTRY_HTTP_TLS_CERTIFICATE=/auth/domain.crt -e REGISTRY_HTTP_TLS_KEY=/auth/domain.key ) # Copy .crt file to a directory *without* the .key one, so we can # test the client. (If client sees a matching .key file, it fails) # Thanks to Miloslav Trmac for this hint. mkdir -p $TESTDIR/client-auth log_and_run cp $CERT $TESTDIR/client-auth/ fi log_and_run $PODMAN run -d --name $name "${reg_args[@]}" $REGISTRY_FQIN # Wait for registry to actually come up timeout=10 while [[ $timeout -ge 1 ]]; do if echo -n >/dev/tcp/127.0.0.1/$port; then return fi timeout=$(( timeout - 1 )) sleep 1 done log_and_run $PODMAN logs $name die "Timed out waiting for registry container to respond on :$port" } # END helpers for starting/stopping registries ############################################################################### # BEGIN miscellaneous tools ################### # random_string # Returns a pseudorandom human-readable string ################### # # Numeric argument, if present, is desired length of string # function random_string() { local length=${1:-10} head /dev/urandom | tr -dc a-zA-Z0-9 | head -c$length } # END miscellaneous tools ############################################################################### ================================================ FILE: systemtest/make-noarch-manifest ================================================ #!/bin/sh # # Tool for creating an image whose OS and arch will (probably) never # match a system on which skopeo will run. This image will be used # in the 'inspect' test. # set -ex # Name and tag of the image we create imgname=notmyarch imgtag=$(date +%Y%m%d) # (In case older image exists from a prior run) buildah rmi $imgname:$imgtag &>/dev/null || true # # Step 1: create an image containing only a README and a copy of this script # id=$(buildah from scratch) now=$(date --rfc-3339=seconds) readme=$(mktemp -t README.XXXXXXXX) ME=$(basename $0) cat >| $readme < # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at https://mozilla.org/MPL/2.0/. version: "2" linters: enable: - bidichk - cyclop - errname - errorlint - exhaustive - goconst - godot - gomoddirectives - gosec - mirror - misspell - mnd - nilerr - nilnil - perfsprint - prealloc - reassign - revive - unconvert - unparam - usestdlibvars - wastedassign formatters: enable: - gofumpt - goimports settings: goimports: local-prefixes: - cyphar.com/go-pathrs ================================================ FILE: vendor/cyphar.com/go-pathrs/COPYING ================================================ Mozilla Public License Version 2.0 ================================== 1. Definitions -------------- 1.1. "Contributor" means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software. 1.2. "Contributor Version" means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor's Contribution. 1.3. "Contribution" means Covered Software of a particular Contributor. 1.4. "Covered Software" means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof. 1.5. "Incompatible With Secondary Licenses" means (a) that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or (b) that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License. 1.6. "Executable Form" means any form of the work other than Source Code Form. 1.7. "Larger Work" means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software. 1.8. "License" means this document. 1.9. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License. 1.10. "Modifications" means any of the following: (a) any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or (b) any new file in Source Code Form that contains any Covered Software. 1.11. "Patent Claims" of a Contributor means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version. 1.12. "Secondary License" means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses. 1.13. "Source Code Form" means the form of the work preferred for making modifications. 1.14. "You" (or "Your") means an individual or a legal entity exercising rights under this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. 2. License Grants and Conditions -------------------------------- 2.1. Grants Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: (a) under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and (b) under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version. 2.2. Effective Date The licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution. 2.3. Limitations on Grant Scope The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor: (a) for any code that a Contributor has removed from Covered Software; or (b) for infringements caused by: (i) Your and any other third party's modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or (c) under Patent Claims infringed by Covered Software in the absence of its Contributions. This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4). 2.4. Subsequent Licenses No Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section 10.2) or under the terms of a Secondary License (if permitted under the terms of Section 3.3). 2.5. Representation Each Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License. 2.6. Fair Use This License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents. 2.7. Conditions Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1. 3. Responsibilities ------------------- 3.1. Distribution of Source Form All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients' rights in the Source Code Form. 3.2. Distribution of Executable Form If You distribute Covered Software in Executable Form then: (a) such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and (b) You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients' rights in the Source Code Form under this License. 3.3. Distribution of a Larger Work You may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s). 3.4. Notices You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies. 3.5. Application of Additional Terms You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction. 4. Inability to Comply Due to Statute or Regulation --------------------------------------------------- If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. 5. Termination -------------- 5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice. 5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate. 5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination. ************************************************************************ * * * 6. Disclaimer of Warranty * * ------------------------- * * * * Covered Software is provided under this License on an "as is" * * basis, without warranty of any kind, either expressed, implied, or * * statutory, including, without limitation, warranties that the * * Covered Software is free of defects, merchantable, fit for a * * particular purpose or non-infringing. The entire risk as to the * * quality and performance of the Covered Software is with You. * * Should any Covered Software prove defective in any respect, You * * (not any Contributor) assume the cost of any necessary servicing, * * repair, or correction. This disclaimer of warranty constitutes an * * essential part of this License. No use of any Covered Software is * * authorized under this License except under this disclaimer. * * * ************************************************************************ ************************************************************************ * * * 7. Limitation of Liability * * -------------------------- * * * * Under no circumstances and under no legal theory, whether tort * * (including negligence), contract, or otherwise, shall any * * Contributor, or anyone who distributes Covered Software as * * permitted above, be liable to You for any direct, indirect, * * special, incidental, or consequential damages of any character * * including, without limitation, damages for lost profits, loss of * * goodwill, work stoppage, computer failure or malfunction, or any * * and all other commercial damages or losses, even if such party * * shall have been informed of the possibility of such damages. This * * limitation of liability shall not apply to liability for death or * * personal injury resulting from such party's negligence to the * * extent applicable law prohibits such limitation. Some * * jurisdictions do not allow the exclusion or limitation of * * incidental or consequential damages, so this exclusion and * * limitation may not apply to You. * * * ************************************************************************ 8. Litigation ------------- Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party's ability to bring cross-claims or counter-claims. 9. Miscellaneous ---------------- This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor. 10. Versions of the License --------------------------- 10.1. New Versions Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number. 10.2. Effect of New Versions You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward. 10.3. Modified Versions If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License). 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached. Exhibit A - Source Code Form License Notice ------------------------------------------- This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. You may add additional accurate notices of copyright ownership. Exhibit B - "Incompatible With Secondary Licenses" Notice --------------------------------------------------------- This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0. ================================================ FILE: vendor/cyphar.com/go-pathrs/doc.go ================================================ // SPDX-License-Identifier: MPL-2.0 /* * libpathrs: safe path resolution on Linux * Copyright (C) 2019-2025 SUSE LLC * Copyright (C) 2026 Aleksa Sarai * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // Package pathrs provides bindings for libpathrs, a library for safe path // resolution on Linux. package pathrs ================================================ FILE: vendor/cyphar.com/go-pathrs/handle_linux.go ================================================ //go:build linux // SPDX-License-Identifier: MPL-2.0 /* * libpathrs: safe path resolution on Linux * Copyright (C) 2019-2025 SUSE LLC * Copyright (C) 2026 Aleksa Sarai * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ package pathrs import ( "fmt" "os" "cyphar.com/go-pathrs/internal/fdutils" "cyphar.com/go-pathrs/internal/libpathrs" ) // Handle is a handle for a path within a given [Root]. This handle references // an already-resolved path which can be used for only one purpose -- to // "re-open" the handle and get an actual [os.File] which can be used for // ordinary operations. // // If you wish to open a file without having an intermediate [Handle] object, // you can try to use [Root.Open] or [Root.OpenFile]. // // It is critical that perform all relevant operations through this [Handle] // (rather than fetching the underlying [os.File] yourself with [Handle.IntoFile]), // because the security properties of libpathrs depend on users doing all // relevant filesystem operations through libpathrs. type Handle struct { inner *os.File } // HandleFromFile creates a new [Handle] from an existing file handle. The // handle will be copied by this method, so the original handle should still be // freed by the caller. // // This is effectively the inverse operation of [Handle.IntoFile], and is used // for "deserialising" pathrs root handles. func HandleFromFile(file *os.File) (*Handle, error) { newFile, err := fdutils.DupFile(file) if err != nil { return nil, fmt.Errorf("duplicate handle fd: %w", err) } return &Handle{inner: newFile}, nil } // Open creates an "upgraded" file handle to the file referenced by the // [Handle]. Note that the original [Handle] is not consumed by this operation, // and can be opened multiple times. // // The handle returned is only usable for reading, and this is method is // shorthand for [Handle.OpenFile] with os.O_RDONLY. // // TODO: Rename these to "Reopen" or something. func (h *Handle) Open() (*os.File, error) { return h.OpenFile(os.O_RDONLY) } // OpenFile creates an "upgraded" file handle to the file referenced by the // [Handle]. Note that the original [Handle] is not consumed by this operation, // and can be opened multiple times. // // The provided flags indicate which open(2) flags are used to create the new // handle. // // TODO: Rename these to "Reopen" or something. func (h *Handle) OpenFile(flags int) (*os.File, error) { return fdutils.WithFileFd(h.inner, func(fd uintptr) (*os.File, error) { newFd, err := libpathrs.Reopen(fd, flags) if err != nil { return nil, err } return os.NewFile(newFd, h.inner.Name()), nil }) } // IntoFile unwraps the [Handle] into its underlying [os.File]. // // You almost certainly want to use [Handle.OpenFile] to get a non-O_PATH // version of this [Handle]. // // This operation returns the internal [os.File] of the [Handle] directly, so // calling [Handle.Close] will also close any copies of the returned [os.File]. // If you want to get an independent copy, use [Handle.Clone] followed by // [Handle.IntoFile] on the cloned [Handle]. func (h *Handle) IntoFile() *os.File { // TODO: Figure out if we really don't want to make a copy. // TODO: We almost certainly want to clear r.inner here, but we can't do // that easily atomically (we could use atomic.Value but that'll make // things quite a bit uglier). return h.inner } // Clone creates a copy of a [Handle], such that it has a separate lifetime to // the original (while referring to the same underlying file). func (h *Handle) Clone() (*Handle, error) { return HandleFromFile(h.inner) } // Close frees all of the resources used by the [Handle]. func (h *Handle) Close() error { return h.inner.Close() } ================================================ FILE: vendor/cyphar.com/go-pathrs/internal/fdutils/fd_linux.go ================================================ //go:build linux // SPDX-License-Identifier: MPL-2.0 /* * libpathrs: safe path resolution on Linux * Copyright (C) 2019-2025 SUSE LLC * Copyright (C) 2026 Aleksa Sarai * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // Package fdutils contains a few helper methods when dealing with *os.File and // file descriptors. package fdutils import ( "fmt" "os" "golang.org/x/sys/unix" "cyphar.com/go-pathrs/internal/libpathrs" ) // DupFd makes a duplicate of the given fd. func DupFd(fd uintptr, name string) (*os.File, error) { newFd, err := unix.FcntlInt(fd, unix.F_DUPFD_CLOEXEC, 0) if err != nil { return nil, fmt.Errorf("fcntl(F_DUPFD_CLOEXEC): %w", err) } return os.NewFile(uintptr(newFd), name), nil } // WithFileFd is a more ergonomic wrapper around file.SyscallConn().Control(). func WithFileFd[T any](file *os.File, fn func(fd uintptr) (T, error)) (T, error) { conn, err := file.SyscallConn() if err != nil { return *new(T), err } var ( ret T innerErr error ) if err := conn.Control(func(fd uintptr) { ret, innerErr = fn(fd) }); err != nil { return *new(T), err } return ret, innerErr } // DupFile makes a duplicate of the given file. func DupFile(file *os.File) (*os.File, error) { return WithFileFd(file, func(fd uintptr) (*os.File, error) { return DupFd(fd, file.Name()) }) } // MkFile creates a new *os.File from the provided file descriptor. However, // unlike os.NewFile, the file's Name is based on the real path (provided by // /proc/self/fd/$n). func MkFile(fd uintptr) (*os.File, error) { fdPath := fmt.Sprintf("fd/%d", fd) fdName, err := libpathrs.ProcReadlinkat(libpathrs.ProcDefaultRootFd, libpathrs.ProcThreadSelf, fdPath) if err != nil { _ = unix.Close(int(fd)) return nil, fmt.Errorf("failed to fetch real name of fd %d: %w", fd, err) } // TODO: Maybe we should prefix this name with something to indicate to // users that they must not use this path as a "safe" path. Something like // "//pathrs-handle:/foo/bar"? return os.NewFile(fd, fdName), nil } ================================================ FILE: vendor/cyphar.com/go-pathrs/internal/libpathrs/error_unix.go ================================================ //go:build linux // TODO: Use "go:build unix" once we bump the minimum Go version 1.19. // SPDX-License-Identifier: MPL-2.0 /* * libpathrs: safe path resolution on Linux * Copyright (C) 2019-2025 SUSE LLC * Copyright (C) 2026 Aleksa Sarai * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ package libpathrs import ( "syscall" ) // Error represents an underlying libpathrs error. type Error struct { description string errno syscall.Errno } // Error returns a textual description of the error. func (err *Error) Error() string { return err.description } // Unwrap returns the underlying error which was wrapped by this error (if // applicable). func (err *Error) Unwrap() error { if err.errno != 0 { return err.errno } return nil } ================================================ FILE: vendor/cyphar.com/go-pathrs/internal/libpathrs/libpathrs_linux.go ================================================ //go:build linux // SPDX-License-Identifier: MPL-2.0 /* * libpathrs: safe path resolution on Linux * Copyright (C) 2019-2025 SUSE LLC * Copyright (C) 2026 Aleksa Sarai * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // Package libpathrs is an internal thin wrapper around the libpathrs C API. package libpathrs import ( "fmt" "syscall" "unsafe" ) /* // TODO: Figure out if we need to add support for linking against libpathrs // statically even if in dynamically linked builds in order to make // packaging a bit easier (using "-Wl,-Bstatic -lpathrs -Wl,-Bdynamic" or // "-l:pathrs.a"). #cgo pkg-config: pathrs #include // This is a workaround for unsafe.Pointer() not working for non-void pointers. char *cast_ptr(void *ptr) { return ptr; } */ import "C" func fetchError(errID C.int) error { if errID >= C.__PATHRS_MAX_ERR_VALUE { return nil } cErr := C.pathrs_errorinfo(errID) defer C.pathrs_errorinfo_free(cErr) var err error if cErr != nil { err = &Error{ errno: syscall.Errno(cErr.saved_errno), description: C.GoString(cErr.description), } } return err } // OpenRoot wraps pathrs_open_root. func OpenRoot(path string) (uintptr, error) { cPath := C.CString(path) defer C.free(unsafe.Pointer(cPath)) fd := C.pathrs_open_root(cPath) return uintptr(fd), fetchError(fd) } // Reopen wraps pathrs_reopen. func Reopen(fd uintptr, flags int) (uintptr, error) { newFd := C.pathrs_reopen(C.int(fd), C.int(flags)) return uintptr(newFd), fetchError(newFd) } // InRootResolve wraps pathrs_inroot_resolve. func InRootResolve(rootFd uintptr, path string) (uintptr, error) { cPath := C.CString(path) defer C.free(unsafe.Pointer(cPath)) fd := C.pathrs_inroot_resolve(C.int(rootFd), cPath) return uintptr(fd), fetchError(fd) } // InRootResolveNoFollow wraps pathrs_inroot_resolve_nofollow. func InRootResolveNoFollow(rootFd uintptr, path string) (uintptr, error) { cPath := C.CString(path) defer C.free(unsafe.Pointer(cPath)) fd := C.pathrs_inroot_resolve_nofollow(C.int(rootFd), cPath) return uintptr(fd), fetchError(fd) } // InRootOpen wraps pathrs_inroot_open. func InRootOpen(rootFd uintptr, path string, flags int) (uintptr, error) { cPath := C.CString(path) defer C.free(unsafe.Pointer(cPath)) fd := C.pathrs_inroot_open(C.int(rootFd), cPath, C.int(flags)) return uintptr(fd), fetchError(fd) } // InRootReadlink wraps pathrs_inroot_readlink. func InRootReadlink(rootFd uintptr, path string) (string, error) { cPath := C.CString(path) defer C.free(unsafe.Pointer(cPath)) size := 128 for { linkBuf := make([]byte, size) n := C.pathrs_inroot_readlink(C.int(rootFd), cPath, C.cast_ptr(unsafe.Pointer(&linkBuf[0])), C.size_t(len(linkBuf))) switch { case int(n) < C.__PATHRS_MAX_ERR_VALUE: return "", fetchError(n) case int(n) <= len(linkBuf): return string(linkBuf[:int(n)]), nil default: // The contents were truncated. Unlike readlinkat, pathrs returns // the size of the link when it checked. So use the returned size // as a basis for the reallocated size (but in order to avoid a DoS // where a magic-link is growing by a single byte each iteration, // make sure we are a fair bit larger). size += int(n) } } } // InRootRmdir wraps pathrs_inroot_rmdir. func InRootRmdir(rootFd uintptr, path string) error { cPath := C.CString(path) defer C.free(unsafe.Pointer(cPath)) err := C.pathrs_inroot_rmdir(C.int(rootFd), cPath) return fetchError(err) } // InRootUnlink wraps pathrs_inroot_unlink. func InRootUnlink(rootFd uintptr, path string) error { cPath := C.CString(path) defer C.free(unsafe.Pointer(cPath)) err := C.pathrs_inroot_unlink(C.int(rootFd), cPath) return fetchError(err) } // InRootRemoveAll wraps pathrs_inroot_remove_all. func InRootRemoveAll(rootFd uintptr, path string) error { cPath := C.CString(path) defer C.free(unsafe.Pointer(cPath)) err := C.pathrs_inroot_remove_all(C.int(rootFd), cPath) return fetchError(err) } // InRootCreat wraps pathrs_inroot_creat. func InRootCreat(rootFd uintptr, path string, flags int, mode uint32) (uintptr, error) { cPath := C.CString(path) defer C.free(unsafe.Pointer(cPath)) fd := C.pathrs_inroot_creat(C.int(rootFd), cPath, C.int(flags), C.uint(mode)) return uintptr(fd), fetchError(fd) } // InRootRename wraps pathrs_inroot_rename. func InRootRename(rootFd uintptr, src, dst string, flags uint) error { cSrc := C.CString(src) defer C.free(unsafe.Pointer(cSrc)) cDst := C.CString(dst) defer C.free(unsafe.Pointer(cDst)) err := C.pathrs_inroot_rename(C.int(rootFd), cSrc, cDst, C.uint(flags)) return fetchError(err) } // InRootMkdir wraps pathrs_inroot_mkdir. func InRootMkdir(rootFd uintptr, path string, mode uint32) error { cPath := C.CString(path) defer C.free(unsafe.Pointer(cPath)) err := C.pathrs_inroot_mkdir(C.int(rootFd), cPath, C.uint(mode)) return fetchError(err) } // InRootMkdirAll wraps pathrs_inroot_mkdir_all. func InRootMkdirAll(rootFd uintptr, path string, mode uint32) (uintptr, error) { cPath := C.CString(path) defer C.free(unsafe.Pointer(cPath)) fd := C.pathrs_inroot_mkdir_all(C.int(rootFd), cPath, C.uint(mode)) return uintptr(fd), fetchError(fd) } // InRootMknod wraps pathrs_inroot_mknod. func InRootMknod(rootFd uintptr, path string, mode uint32, dev uint64) error { cPath := C.CString(path) defer C.free(unsafe.Pointer(cPath)) err := C.pathrs_inroot_mknod(C.int(rootFd), cPath, C.uint(mode), C.dev_t(dev)) return fetchError(err) } // InRootSymlink wraps pathrs_inroot_symlink. func InRootSymlink(rootFd uintptr, path, target string) error { cPath := C.CString(path) defer C.free(unsafe.Pointer(cPath)) cTarget := C.CString(target) defer C.free(unsafe.Pointer(cTarget)) err := C.pathrs_inroot_symlink(C.int(rootFd), cPath, cTarget) return fetchError(err) } // InRootHardlink wraps pathrs_inroot_hardlink. func InRootHardlink(rootFd uintptr, path, target string) error { cPath := C.CString(path) defer C.free(unsafe.Pointer(cPath)) cTarget := C.CString(target) defer C.free(unsafe.Pointer(cTarget)) err := C.pathrs_inroot_hardlink(C.int(rootFd), cPath, cTarget) return fetchError(err) } // ProcBase is pathrs_proc_base_t (uint64_t). type ProcBase C.pathrs_proc_base_t // FIXME: We need to open-code the constants because CGo unfortunately will // implicitly convert any non-literal constants (i.e. those resolved using gcc) // to signed integers. See for some // more information on the underlying issue (though. const ( // ProcRoot is PATHRS_PROC_ROOT. ProcRoot ProcBase = 0xFFFF_FFFE_7072_6F63 // C.PATHRS_PROC_ROOT // ProcSelf is PATHRS_PROC_SELF. ProcSelf ProcBase = 0xFFFF_FFFE_091D_5E1F // C.PATHRS_PROC_SELF // ProcThreadSelf is PATHRS_PROC_THREAD_SELF. ProcThreadSelf ProcBase = 0xFFFF_FFFE_3EAD_5E1F // C.PATHRS_PROC_THREAD_SELF // ProcBaseTypeMask is __PATHRS_PROC_TYPE_MASK. ProcBaseTypeMask ProcBase = 0xFFFF_FFFF_0000_0000 // C.__PATHRS_PROC_TYPE_MASK // ProcBaseTypePid is __PATHRS_PROC_TYPE_PID. ProcBaseTypePid ProcBase = 0x8000_0000_0000_0000 // C.__PATHRS_PROC_TYPE_PID // ProcDefaultRootFd is PATHRS_PROC_DEFAULT_ROOTFD. ProcDefaultRootFd = -int(syscall.EBADF) // C.PATHRS_PROC_DEFAULT_ROOTFD ) func assertEqual[T comparable](a, b T, msg string) { if a != b { panic(fmt.Sprintf("%s ((%T) %#v != (%T) %#v)", msg, a, a, b, b)) } } // Verify that the values above match the actual C values. Unfortunately, Go // only allows us to forcefully cast int64 to uint64 if you use a temporary // variable, which means we cannot do it in a const context and thus need to do // it at runtime (even though it is a check that fundamentally could be done at // compile-time)... func init() { var ( actualProcRoot int64 = C.PATHRS_PROC_ROOT actualProcSelf int64 = C.PATHRS_PROC_SELF actualProcThreadSelf int64 = C.PATHRS_PROC_THREAD_SELF ) assertEqual(ProcRoot, ProcBase(actualProcRoot), "PATHRS_PROC_ROOT") assertEqual(ProcSelf, ProcBase(actualProcSelf), "PATHRS_PROC_SELF") assertEqual(ProcThreadSelf, ProcBase(actualProcThreadSelf), "PATHRS_PROC_THREAD_SELF") var ( actualProcBaseTypeMask uint64 = C.__PATHRS_PROC_TYPE_MASK actualProcBaseTypePid uint64 = C.__PATHRS_PROC_TYPE_PID ) assertEqual(ProcBaseTypeMask, ProcBase(actualProcBaseTypeMask), "__PATHRS_PROC_TYPE_MASK") assertEqual(ProcBaseTypePid, ProcBase(actualProcBaseTypePid), "__PATHRS_PROC_TYPE_PID") assertEqual(ProcDefaultRootFd, int(C.PATHRS_PROC_DEFAULT_ROOTFD), "PATHRS_PROC_DEFAULT_ROOTFD") } // ProcPid reimplements the PROC_PID(x) conversion. func ProcPid(pid uint32) ProcBase { return ProcBaseTypePid | ProcBase(pid) } // ProcOpenat wraps pathrs_proc_openat. func ProcOpenat(procRootFd int, base ProcBase, path string, flags int) (uintptr, error) { cBase := C.pathrs_proc_base_t(base) cPath := C.CString(path) defer C.free(unsafe.Pointer(cPath)) fd := C.pathrs_proc_openat(C.int(procRootFd), cBase, cPath, C.int(flags)) return uintptr(fd), fetchError(fd) } // ProcReadlinkat wraps pathrs_proc_readlinkat. func ProcReadlinkat(procRootFd int, base ProcBase, path string) (string, error) { // TODO: See if we can unify this code with InRootReadlink. cBase := C.pathrs_proc_base_t(base) cPath := C.CString(path) defer C.free(unsafe.Pointer(cPath)) size := 128 for { linkBuf := make([]byte, size) n := C.pathrs_proc_readlinkat( C.int(procRootFd), cBase, cPath, C.cast_ptr(unsafe.Pointer(&linkBuf[0])), C.size_t(len(linkBuf))) switch { case int(n) < C.__PATHRS_MAX_ERR_VALUE: return "", fetchError(n) case int(n) <= len(linkBuf): return string(linkBuf[:int(n)]), nil default: // The contents were truncated. Unlike readlinkat, pathrs returns // the size of the link when it checked. So use the returned size // as a basis for the reallocated size (but in order to avoid a DoS // where a magic-link is growing by a single byte each iteration, // make sure we are a fair bit larger). size += int(n) } } } // ProcfsOpenHow is pathrs_procfs_open_how (struct). type ProcfsOpenHow C.pathrs_procfs_open_how const ( // ProcfsNewUnmasked is PATHRS_PROCFS_NEW_UNMASKED. ProcfsNewUnmasked = C.PATHRS_PROCFS_NEW_UNMASKED ) // Flags returns a pointer to the internal flags field to allow other packages // to modify structure fields that are internal due to Go's visibility model. func (how *ProcfsOpenHow) Flags() *C.uint64_t { return &how.flags } // ProcfsOpen is pathrs_procfs_open (sizeof(*how) is passed automatically). func ProcfsOpen(how *ProcfsOpenHow) (uintptr, error) { fd := C.pathrs_procfs_open((*C.pathrs_procfs_open_how)(how), C.size_t(unsafe.Sizeof(*how))) return uintptr(fd), fetchError(fd) } ================================================ FILE: vendor/cyphar.com/go-pathrs/procfs/procfs_linux.go ================================================ //go:build linux // SPDX-License-Identifier: MPL-2.0 /* * libpathrs: safe path resolution on Linux * Copyright (C) 2019-2025 SUSE LLC * Copyright (C) 2026 Aleksa Sarai * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // Package procfs provides a safe API for operating on /proc on Linux. package procfs import ( "os" "runtime" "cyphar.com/go-pathrs/internal/fdutils" "cyphar.com/go-pathrs/internal/libpathrs" ) // ProcBase is used with [ProcReadlink] and related functions to indicate what // /proc subpath path operations should be done relative to. type ProcBase struct { inner libpathrs.ProcBase } var ( // ProcRoot indicates to use /proc. Note that this mode may be more // expensive because we have to take steps to try to avoid leaking unmasked // procfs handles, so you should use [ProcBaseSelf] if you can. ProcRoot = ProcBase{inner: libpathrs.ProcRoot} // ProcSelf indicates to use /proc/self. For most programs, this is the // standard choice. ProcSelf = ProcBase{inner: libpathrs.ProcSelf} // ProcThreadSelf indicates to use /proc/thread-self. In multi-threaded // programs where one thread has a different CLONE_FS, it is possible for // /proc/self to point the wrong thread and so /proc/thread-self may be // necessary. ProcThreadSelf = ProcBase{inner: libpathrs.ProcThreadSelf} ) // ProcPid returns a ProcBase which indicates to use /proc/$pid for the given // PID (or TID). Be aware that due to PID recycling, using this is generally // not safe except in certain circumstances. Namely: // // - PID 1 (the init process), as that PID cannot ever get recycled. // - Your current PID (though you should just use [ProcBaseSelf]). // - Your current TID if you have used [runtime.LockOSThread] (though you // should just use [ProcBaseThreadSelf]). // - PIDs of child processes (as long as you are sure that no other part of // your program incorrectly catches or ignores SIGCHLD, and that you do it // *before* you call wait(2)or any equivalent method that could reap // zombies). func ProcPid(pid int) ProcBase { if pid < 0 || uint64(pid) >= 1<<31 { panic("invalid ProcBasePid value") // TODO: should this be an error? } pid32 := uint32(pid) //nolint:gosec // G115 false positive return ProcBase{inner: libpathrs.ProcPid(pid32)} } // ThreadCloser is a callback that needs to be called when you are done // operating on an [os.File] fetched using [Handle.OpenThreadSelf]. type ThreadCloser func() // Handle is a wrapper around an *os.File handle to "/proc", which can be // used to do further procfs-related operations in a safe way. type Handle struct { inner *os.File } // Close releases all internal resources for this [Handle]. // // Note that if the handle is actually the global cached handle, this operation // is a no-op. func (proc *Handle) Close() error { var err error if proc.inner != nil { err = proc.inner.Close() } return err } // OpenOption is a configuration function passed as an argument to [Open]. type OpenOption func(*libpathrs.ProcfsOpenHow) error // UnmaskedProcRoot can be passed to [Open] to request an unmasked procfs // handle be created. // // procfs, err := procfs.OpenRoot(procfs.UnmaskedProcRoot) func UnmaskedProcRoot(how *libpathrs.ProcfsOpenHow) error { *how.Flags() |= libpathrs.ProcfsNewUnmasked return nil } // Open creates a new [Handle] to a safe "/proc", based on the passed // configuration options (in the form of a series of [OpenOption]s). func Open(opts ...OpenOption) (*Handle, error) { var how libpathrs.ProcfsOpenHow for _, opt := range opts { if err := opt(&how); err != nil { return nil, err } } fd, err := libpathrs.ProcfsOpen(&how) if err != nil { return nil, err } var procFile *os.File if int(fd) >= 0 { procFile = os.NewFile(fd, "/proc") } // TODO: Check that fd == PATHRS_PROC_DEFAULT_ROOTFD in the <0 case? return &Handle{inner: procFile}, nil } // TODO: Switch to something fdutils.WithFileFd-like. func (proc *Handle) fd() int { if proc.inner != nil { return int(proc.inner.Fd()) } return libpathrs.ProcDefaultRootFd } // TODO: Should we expose open? func (proc *Handle) open(base ProcBase, path string, flags int) (_ *os.File, Closer ThreadCloser, Err error) { var closer ThreadCloser if base == ProcThreadSelf { runtime.LockOSThread() closer = runtime.UnlockOSThread } defer func() { if closer != nil && Err != nil { closer() Closer = nil } }() fd, err := libpathrs.ProcOpenat(proc.fd(), base.inner, path, flags) if err != nil { return nil, nil, err } file, err := fdutils.MkFile(fd) return file, closer, err } // OpenRoot safely opens a given path from inside /proc/. // // This function must only be used for accessing global information from procfs // (such as /proc/cpuinfo) or information about other processes (such as // /proc/1). Accessing your own process information should be done using // [Handle.OpenSelf] or [Handle.OpenThreadSelf]. func (proc *Handle) OpenRoot(path string, flags int) (*os.File, error) { file, closer, err := proc.open(ProcRoot, path, flags) if closer != nil { // should not happen panic("non-zero closer returned from procOpen(ProcRoot)") } return file, err } // OpenSelf safely opens a given path from inside /proc/self/. // // This method is recommend for getting process information about the current // process for almost all Go processes *except* for cases where there are // [runtime.LockOSThread] threads that have changed some aspect of their state // (such as through unshare(CLONE_FS) or changing namespaces). // // For such non-heterogeneous processes, /proc/self may reference to a task // that has different state from the current goroutine and so it may be // preferable to use [Handle.OpenThreadSelf]. The same is true if a user // really wants to inspect the current OS thread's information (such as // /proc/thread-self/stack or /proc/thread-self/status which is always uniquely // per-thread). // // Unlike [Handle.OpenThreadSelf], this method does not involve locking // the goroutine to the current OS thread and so is simpler to use and // theoretically has slightly less overhead. func (proc *Handle) OpenSelf(path string, flags int) (*os.File, error) { file, closer, err := proc.open(ProcSelf, path, flags) if closer != nil { // should not happen panic("non-zero closer returned from procOpen(ProcSelf)") } return file, err } // OpenPid safely opens a given path from inside /proc/$pid/, where pid can be // either a PID or TID. // // This is effectively equivalent to calling [Handle.OpenRoot] with the // pid prefixed to the subpath. // // Be aware that due to PID recycling, using this is generally not safe except // in certain circumstances. See the documentation of [ProcPid] for more // details. func (proc *Handle) OpenPid(pid int, path string, flags int) (*os.File, error) { file, closer, err := proc.open(ProcPid(pid), path, flags) if closer != nil { // should not happen panic("non-zero closer returned from procOpen(ProcPidOpen)") } return file, err } // OpenThreadSelf safely opens a given path from inside /proc/thread-self/. // // Most Go processes have heterogeneous threads (all threads have most of the // same kernel state such as CLONE_FS) and so [Handle.OpenSelf] is // preferable for most users. // // For non-heterogeneous threads, or users that actually want thread-specific // information (such as /proc/thread-self/stack or /proc/thread-self/status), // this method is necessary. // // Because Go can change the running OS thread of your goroutine without notice // (and then subsequently kill the old thread), this method will lock the // current goroutine to the OS thread (with [runtime.LockOSThread]) and the // caller is responsible for unlocking the the OS thread with the // [ThreadCloser] callback once they are done using the returned file. This // callback MUST be called AFTER you have finished using the returned // [os.File]. This callback is completely separate to [os.File.Close], so it // must be called regardless of how you close the handle. func (proc *Handle) OpenThreadSelf(path string, flags int) (*os.File, ThreadCloser, error) { return proc.open(ProcThreadSelf, path, flags) } // Readlink safely reads the contents of a symlink from the given procfs base. // // This is effectively equivalent to doing an Open*(O_PATH|O_NOFOLLOW) of the // path and then doing unix.Readlinkat(fd, ""), but with the benefit that // thread locking is not necessary for [ProcThreadSelf]. func (proc *Handle) Readlink(base ProcBase, path string) (string, error) { return libpathrs.ProcReadlinkat(proc.fd(), base.inner, path) } ================================================ FILE: vendor/cyphar.com/go-pathrs/root_linux.go ================================================ //go:build linux // SPDX-License-Identifier: MPL-2.0 /* * libpathrs: safe path resolution on Linux * Copyright (C) 2019-2025 SUSE LLC * Copyright (C) 2026 Aleksa Sarai * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ package pathrs import ( "errors" "fmt" "os" "syscall" "cyphar.com/go-pathrs/internal/fdutils" "cyphar.com/go-pathrs/internal/libpathrs" ) // Root is a handle to the root of a directory tree to resolve within. The only // purpose of this "root handle" is to perform operations within the directory // tree, or to get a [Handle] to inodes within the directory tree. // // At time of writing, it is considered a *VERY BAD IDEA* to open a [Root] // inside a possibly-attacker-controlled directory tree. While we do have // protections that should defend against it, it's far more dangerous than just // opening a directory tree which is not inside a potentially-untrusted // directory. type Root struct { inner *os.File } // OpenRoot creates a new [Root] handle to the directory at the given path. func OpenRoot(path string) (*Root, error) { fd, err := libpathrs.OpenRoot(path) if err != nil { return nil, err } file, err := fdutils.MkFile(fd) if err != nil { return nil, err } return &Root{inner: file}, nil } // RootFromFile creates a new [Root] handle from an [os.File] referencing a // directory. The provided file will be duplicated, so the original file should // still be closed by the caller. // // This is effectively the inverse operation of [Root.IntoFile]. func RootFromFile(file *os.File) (*Root, error) { newFile, err := fdutils.DupFile(file) if err != nil { return nil, fmt.Errorf("duplicate root fd: %w", err) } return &Root{inner: newFile}, nil } // Resolve resolves the given path within the [Root]'s directory tree, and // returns a [Handle] to the resolved path. The path must already exist, // otherwise an error will occur. // // All symlinks (including trailing symlinks) are followed, but they are // resolved within the rootfs. If you wish to open a handle to the symlink // itself, use [ResolveNoFollow]. func (r *Root) Resolve(path string) (*Handle, error) { return fdutils.WithFileFd(r.inner, func(rootFd uintptr) (*Handle, error) { handleFd, err := libpathrs.InRootResolve(rootFd, path) if err != nil { return nil, err } handleFile, err := fdutils.MkFile(handleFd) if err != nil { return nil, err } return &Handle{inner: handleFile}, nil }) } // ResolveNoFollow is effectively an O_NOFOLLOW version of [Resolve]. Their // behaviour is identical, except that *trailing* symlinks will not be // followed. If the final component is a trailing symlink, an O_PATH|O_NOFOLLOW // handle to the symlink itself is returned. func (r *Root) ResolveNoFollow(path string) (*Handle, error) { return fdutils.WithFileFd(r.inner, func(rootFd uintptr) (*Handle, error) { handleFd, err := libpathrs.InRootResolveNoFollow(rootFd, path) if err != nil { return nil, err } handleFile, err := fdutils.MkFile(handleFd) if err != nil { return nil, err } return &Handle{inner: handleFile}, nil }) } // Open is effectively shorthand for [Resolve] followed by [Handle.Open], but // can be slightly more efficient (it reduces CGo overhead and the number of // syscalls used when using the openat2-based resolver) and is arguably more // ergonomic to use. // // This is effectively equivalent to [os.Open]. func (r *Root) Open(path string) (*os.File, error) { return r.OpenFile(path, os.O_RDONLY) } // OpenFile is effectively shorthand for [Resolve] followed by // [Handle.OpenFile], but can be slightly more efficient (it reduces CGo // overhead and the number of syscalls used when using the openat2-based // resolver) and is arguably more ergonomic to use. // // However, if flags contains os.O_NOFOLLOW and the path is a symlink, then // OpenFile's behaviour will match that of openat2. In most cases an error will // be returned, but if os.O_PATH is provided along with os.O_NOFOLLOW then a // file equivalent to [ResolveNoFollow] will be returned instead. // // This is effectively equivalent to [os.OpenFile], except that os.O_CREAT is // not supported. func (r *Root) OpenFile(path string, flags int) (*os.File, error) { return fdutils.WithFileFd(r.inner, func(rootFd uintptr) (*os.File, error) { fd, err := libpathrs.InRootOpen(rootFd, path, flags) if err != nil { return nil, err } return fdutils.MkFile(fd) }) } // Create creates a file within the [Root]'s directory tree at the given path, // and returns a handle to the file. The provided mode is used for the new file // (the process's umask applies). // // Unlike [os.Create], if the file already exists an error is created rather // than the file being opened and truncated. func (r *Root) Create(path string, flags int, mode os.FileMode) (*os.File, error) { unixMode, err := toUnixMode(mode, false) if err != nil { return nil, err } return fdutils.WithFileFd(r.inner, func(rootFd uintptr) (*os.File, error) { handleFd, err := libpathrs.InRootCreat(rootFd, path, flags, unixMode) if err != nil { return nil, err } return fdutils.MkFile(handleFd) }) } // Rename two paths within a [Root]'s directory tree. The flags argument is // identical to the RENAME_* flags to the renameat2(2) system call. func (r *Root) Rename(src, dst string, flags uint) error { _, err := fdutils.WithFileFd(r.inner, func(rootFd uintptr) (struct{}, error) { err := libpathrs.InRootRename(rootFd, src, dst, flags) return struct{}{}, err }) return err } // RemoveDir removes the named empty directory within a [Root]'s directory // tree. func (r *Root) RemoveDir(path string) error { _, err := fdutils.WithFileFd(r.inner, func(rootFd uintptr) (struct{}, error) { err := libpathrs.InRootRmdir(rootFd, path) return struct{}{}, err }) return err } // RemoveFile removes the named file within a [Root]'s directory tree. func (r *Root) RemoveFile(path string) error { _, err := fdutils.WithFileFd(r.inner, func(rootFd uintptr) (struct{}, error) { err := libpathrs.InRootUnlink(rootFd, path) return struct{}{}, err }) return err } // Remove removes the named file or (empty) directory within a [Root]'s // directory tree. // // This is effectively equivalent to [os.Remove]. func (r *Root) Remove(path string) error { // In order to match os.Remove's implementation we need to also do both // syscalls unconditionally and adjust the error based on whether // pathrs_inroot_rmdir() returned ENOTDIR. unlinkErr := r.RemoveFile(path) if unlinkErr == nil { return nil } rmdirErr := r.RemoveDir(path) if rmdirErr == nil { return nil } // Both failed, adjust the error in the same way that os.Remove does. err := rmdirErr if errors.Is(err, syscall.ENOTDIR) { err = unlinkErr } return err } // RemoveAll recursively deletes a path and all of its children. // // This is effectively equivalent to [os.RemoveAll]. func (r *Root) RemoveAll(path string) error { _, err := fdutils.WithFileFd(r.inner, func(rootFd uintptr) (struct{}, error) { err := libpathrs.InRootRemoveAll(rootFd, path) return struct{}{}, err }) return err } // Mkdir creates a directory within a [Root]'s directory tree. The provided // mode is used for the new directory (the process's umask applies). // // This is effectively equivalent to [os.Mkdir]. func (r *Root) Mkdir(path string, mode os.FileMode) error { unixMode, err := toUnixMode(mode, false) if err != nil { return err } _, err = fdutils.WithFileFd(r.inner, func(rootFd uintptr) (struct{}, error) { err := libpathrs.InRootMkdir(rootFd, path, unixMode) return struct{}{}, err }) return err } // MkdirAll creates a directory (and any parent path components if they don't // exist) within a [Root]'s directory tree. The provided mode is used for any // directories created by this function (the process's umask applies). // // This is effectively equivalent to [os.MkdirAll]. func (r *Root) MkdirAll(path string, mode os.FileMode) (*Handle, error) { unixMode, err := toUnixMode(mode, false) if err != nil { return nil, err } return fdutils.WithFileFd(r.inner, func(rootFd uintptr) (*Handle, error) { handleFd, err := libpathrs.InRootMkdirAll(rootFd, path, unixMode) if err != nil { return nil, err } handleFile, err := fdutils.MkFile(handleFd) if err != nil { return nil, err } return &Handle{inner: handleFile}, err }) } // Mknod creates a new device inode of the given type within a [Root]'s // directory tree. The provided mode is used for the new directory (the // process's umask applies). // // This is effectively equivalent to [golang.org/x/sys/unix.Mknod]. func (r *Root) Mknod(path string, mode os.FileMode, dev uint64) error { unixMode, err := toUnixMode(mode, true) if err != nil { return err } _, err = fdutils.WithFileFd(r.inner, func(rootFd uintptr) (struct{}, error) { err := libpathrs.InRootMknod(rootFd, path, unixMode, dev) return struct{}{}, err }) return err } // Symlink creates a symlink within a [Root]'s directory tree. The symlink is // created at path and is a link to target. // // This is effectively equivalent to [os.Symlink]. func (r *Root) Symlink(path, target string) error { _, err := fdutils.WithFileFd(r.inner, func(rootFd uintptr) (struct{}, error) { err := libpathrs.InRootSymlink(rootFd, path, target) return struct{}{}, err }) return err } // Hardlink creates a hardlink within a [Root]'s directory tree. The hardlink // is created at path and is a link to target. Both paths are within the // [Root]'s directory tree (you cannot hardlink to a different [Root] or the // host). // // This is effectively equivalent to [os.Link]. func (r *Root) Hardlink(path, target string) error { _, err := fdutils.WithFileFd(r.inner, func(rootFd uintptr) (struct{}, error) { err := libpathrs.InRootHardlink(rootFd, path, target) return struct{}{}, err }) return err } // Readlink returns the target of a symlink with a [Root]'s directory tree. // // This is effectively equivalent to [os.Readlink]. func (r *Root) Readlink(path string) (string, error) { return fdutils.WithFileFd(r.inner, func(rootFd uintptr) (string, error) { return libpathrs.InRootReadlink(rootFd, path) }) } // IntoFile unwraps the [Root] into its underlying [os.File]. // // It is critical that you do not operate on this file descriptor yourself, // because the security properties of libpathrs depend on users doing all // relevant filesystem operations through libpathrs. // // This operation returns the internal [os.File] of the [Root] directly, so // calling [Root.Close] will also close any copies of the returned [os.File]. // If you want to get an independent copy, use [Root.Clone] followed by // [Root.IntoFile] on the cloned [Root]. func (r *Root) IntoFile() *os.File { // TODO: Figure out if we really don't want to make a copy. // TODO: We almost certainly want to clear r.inner here, but we can't do // that easily atomically (we could use atomic.Value but that'll make // things quite a bit uglier). return r.inner } // Clone creates a copy of a [Root] handle, such that it has a separate // lifetime to the original (while referring to the same underlying directory). func (r *Root) Clone() (*Root, error) { return RootFromFile(r.inner) } // Close frees all of the resources used by the [Root] handle. func (r *Root) Close() error { return r.inner.Close() } ================================================ FILE: vendor/cyphar.com/go-pathrs/utils_linux.go ================================================ //go:build linux // SPDX-License-Identifier: MPL-2.0 /* * libpathrs: safe path resolution on Linux * Copyright (C) 2019-2025 SUSE LLC * Copyright (C) 2026 Aleksa Sarai * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ package pathrs import ( "fmt" "os" "golang.org/x/sys/unix" ) //nolint:cyclop // this function needs to handle a lot of cases func toUnixMode(mode os.FileMode, needsType bool) (uint32, error) { sysMode := uint32(mode.Perm()) switch mode & os.ModeType { //nolint:exhaustive // we only care about ModeType bits case 0: if needsType { sysMode |= unix.S_IFREG } case os.ModeDir: sysMode |= unix.S_IFDIR case os.ModeSymlink: sysMode |= unix.S_IFLNK case os.ModeCharDevice | os.ModeDevice: sysMode |= unix.S_IFCHR case os.ModeDevice: sysMode |= unix.S_IFBLK case os.ModeNamedPipe: sysMode |= unix.S_IFIFO case os.ModeSocket: sysMode |= unix.S_IFSOCK default: return 0, fmt.Errorf("invalid mode filetype %+o", mode) } if mode&os.ModeSetuid != 0 { sysMode |= unix.S_ISUID } if mode&os.ModeSetgid != 0 { sysMode |= unix.S_ISGID } if mode&os.ModeSticky != 0 { sysMode |= unix.S_ISVTX } return sysMode, nil } ================================================ FILE: vendor/dario.cat/mergo/.deepsource.toml ================================================ version = 1 test_patterns = [ "*_test.go" ] [[analyzers]] name = "go" enabled = true [analyzers.meta] import_path = "dario.cat/mergo" ================================================ FILE: vendor/dario.cat/mergo/.gitignore ================================================ #### joe made this: http://goel.io/joe #### go #### # Binaries for programs and plugins *.exe *.dll *.so *.dylib # Test binary, build with `go test -c` *.test # Output of the go coverage tool, specifically when used with LiteIDE *.out # Golang/Intellij .idea # Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736 .glide/ #### vim #### # Swap [._]*.s[a-v][a-z] [._]*.sw[a-p] [._]s[a-v][a-z] [._]sw[a-p] # Session Session.vim # Temporary .netrwhist *~ # Auto-generated tag files tags ================================================ FILE: vendor/dario.cat/mergo/.travis.yml ================================================ language: go arch: - amd64 - ppc64le install: - go get -t - go get golang.org/x/tools/cmd/cover - go get github.com/mattn/goveralls script: - go test -race -v ./... after_script: - $HOME/gopath/bin/goveralls -service=travis-ci -repotoken $COVERALLS_TOKEN ================================================ FILE: vendor/dario.cat/mergo/CODE_OF_CONDUCT.md ================================================ # Contributor Covenant Code of Conduct ## Our Pledge In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. ## Our Standards Examples of behavior that contributes to creating a positive environment include: * Using welcoming and inclusive language * Being respectful of differing viewpoints and experiences * Gracefully accepting constructive criticism * Focusing on what is best for the community * Showing empathy towards other community members Examples of unacceptable behavior by participants include: * The use of sexualized language or imagery and unwelcome sexual attention or advances * Trolling, insulting/derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or electronic address, without explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. ## Scope This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at i@dario.im. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] [homepage]: http://contributor-covenant.org [version]: http://contributor-covenant.org/version/1/4/ ================================================ FILE: vendor/dario.cat/mergo/CONTRIBUTING.md ================================================ # Contributing to mergo First off, thanks for taking the time to contribute! ❤️ All types of contributions are encouraged and valued. See the [Table of Contents](#table-of-contents) for different ways to help and details about how this project handles them. Please make sure to read the relevant section before making your contribution. It will make it a lot easier for us maintainers and smooth out the experience for all involved. The community looks forward to your contributions. 🎉 > And if you like the project, but just don't have time to contribute, that's fine. There are other easy ways to support the project and show your appreciation, which we would also be very happy about: > - Star the project > - Tweet about it > - Refer this project in your project's readme > - Mention the project at local meetups and tell your friends/colleagues ## Table of Contents - [Code of Conduct](#code-of-conduct) - [I Have a Question](#i-have-a-question) - [I Want To Contribute](#i-want-to-contribute) - [Reporting Bugs](#reporting-bugs) - [Suggesting Enhancements](#suggesting-enhancements) ## Code of Conduct This project and everyone participating in it is governed by the [mergo Code of Conduct](https://github.com/imdario/mergoblob/master/CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to <>. ## I Have a Question > If you want to ask a question, we assume that you have read the available [Documentation](https://pkg.go.dev/github.com/imdario/mergo). Before you ask a question, it is best to search for existing [Issues](https://github.com/imdario/mergo/issues) that might help you. In case you have found a suitable issue and still need clarification, you can write your question in this issue. It is also advisable to search the internet for answers first. If you then still feel the need to ask a question and need clarification, we recommend the following: - Open an [Issue](https://github.com/imdario/mergo/issues/new). - Provide as much context as you can about what you're running into. - Provide project and platform versions (nodejs, npm, etc), depending on what seems relevant. We will then take care of the issue as soon as possible. ## I Want To Contribute > ### Legal Notice > When contributing to this project, you must agree that you have authored 100% of the content, that you have the necessary rights to the content and that the content you contribute may be provided under the project license. ### Reporting Bugs #### Before Submitting a Bug Report A good bug report shouldn't leave others needing to chase you up for more information. Therefore, we ask you to investigate carefully, collect information and describe the issue in detail in your report. Please complete the following steps in advance to help us fix any potential bug as fast as possible. - Make sure that you are using the latest version. - Determine if your bug is really a bug and not an error on your side e.g. using incompatible environment components/versions (Make sure that you have read the [documentation](). If you are looking for support, you might want to check [this section](#i-have-a-question)). - To see if other users have experienced (and potentially already solved) the same issue you are having, check if there is not already a bug report existing for your bug or error in the [bug tracker](https://github.com/imdario/mergoissues?q=label%3Abug). - Also make sure to search the internet (including Stack Overflow) to see if users outside of the GitHub community have discussed the issue. - Collect information about the bug: - Stack trace (Traceback) - OS, Platform and Version (Windows, Linux, macOS, x86, ARM) - Version of the interpreter, compiler, SDK, runtime environment, package manager, depending on what seems relevant. - Possibly your input and the output - Can you reliably reproduce the issue? And can you also reproduce it with older versions? #### How Do I Submit a Good Bug Report? > You must never report security related issues, vulnerabilities or bugs including sensitive information to the issue tracker, or elsewhere in public. Instead sensitive bugs must be sent by email to . We use GitHub issues to track bugs and errors. If you run into an issue with the project: - Open an [Issue](https://github.com/imdario/mergo/issues/new). (Since we can't be sure at this point whether it is a bug or not, we ask you not to talk about a bug yet and not to label the issue.) - Explain the behavior you would expect and the actual behavior. - Please provide as much context as possible and describe the *reproduction steps* that someone else can follow to recreate the issue on their own. This usually includes your code. For good bug reports you should isolate the problem and create a reduced test case. - Provide the information you collected in the previous section. Once it's filed: - The project team will label the issue accordingly. - A team member will try to reproduce the issue with your provided steps. If there are no reproduction steps or no obvious way to reproduce the issue, the team will ask you for those steps and mark the issue as `needs-repro`. Bugs with the `needs-repro` tag will not be addressed until they are reproduced. - If the team is able to reproduce the issue, it will be marked `needs-fix`, as well as possibly other tags (such as `critical`), and the issue will be left to be implemented by someone. ### Suggesting Enhancements This section guides you through submitting an enhancement suggestion for mergo, **including completely new features and minor improvements to existing functionality**. Following these guidelines will help maintainers and the community to understand your suggestion and find related suggestions. #### Before Submitting an Enhancement - Make sure that you are using the latest version. - Read the [documentation]() carefully and find out if the functionality is already covered, maybe by an individual configuration. - Perform a [search](https://github.com/imdario/mergo/issues) to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one. - Find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to convince the project's developers of the merits of this feature. Keep in mind that we want features that will be useful to the majority of our users and not just a small subset. If you're just targeting a minority of users, consider writing an add-on/plugin library. #### How Do I Submit a Good Enhancement Suggestion? Enhancement suggestions are tracked as [GitHub issues](https://github.com/imdario/mergo/issues). - Use a **clear and descriptive title** for the issue to identify the suggestion. - Provide a **step-by-step description of the suggested enhancement** in as many details as possible. - **Describe the current behavior** and **explain which behavior you expected to see instead** and why. At this point you can also tell which alternatives do not work for you. - You may want to **include screenshots and animated GIFs** which help you demonstrate the steps or point out the part which the suggestion is related to. You can use [this tool](https://www.cockos.com/licecap/) to record GIFs on macOS and Windows, and [this tool](https://github.com/colinkeenan/silentcast) or [this tool](https://github.com/GNOME/byzanz) on Linux. - **Explain why this enhancement would be useful** to most mergo users. You may also want to point out the other projects that solved it better and which could serve as inspiration. ## Attribution This guide is based on the **contributing-gen**. [Make your own](https://github.com/bttger/contributing-gen)! ================================================ FILE: vendor/dario.cat/mergo/FUNDING.json ================================================ { "drips": { "ethereum": { "ownedBy": "0x6160020e7102237aC41bdb156e94401692D76930" } } } ================================================ FILE: vendor/dario.cat/mergo/LICENSE ================================================ Copyright (c) 2013 Dario Castañé. All rights reserved. Copyright (c) 2012 The Go Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: vendor/dario.cat/mergo/README.md ================================================ # Mergo [![GitHub release][5]][6] [![GoCard][7]][8] [![Test status][1]][2] [![OpenSSF Scorecard][21]][22] [![OpenSSF Best Practices][19]][20] [![Coverage status][9]][10] [![Sourcegraph][11]][12] [![FOSSA status][13]][14] [![GoDoc][3]][4] [![Become my sponsor][15]][16] [![Tidelift][17]][18] [1]: https://github.com/imdario/mergo/workflows/tests/badge.svg?branch=master [2]: https://github.com/imdario/mergo/actions/workflows/tests.yml [3]: https://godoc.org/github.com/imdario/mergo?status.svg [4]: https://godoc.org/github.com/imdario/mergo [5]: https://img.shields.io/github/release/imdario/mergo.svg [6]: https://github.com/imdario/mergo/releases [7]: https://goreportcard.com/badge/imdario/mergo [8]: https://goreportcard.com/report/github.com/imdario/mergo [9]: https://coveralls.io/repos/github/imdario/mergo/badge.svg?branch=master [10]: https://coveralls.io/github/imdario/mergo?branch=master [11]: https://sourcegraph.com/github.com/imdario/mergo/-/badge.svg [12]: https://sourcegraph.com/github.com/imdario/mergo?badge [13]: https://app.fossa.io/api/projects/git%2Bgithub.com%2Fimdario%2Fmergo.svg?type=shield [14]: https://app.fossa.io/projects/git%2Bgithub.com%2Fimdario%2Fmergo?ref=badge_shield [15]: https://img.shields.io/github/sponsors/imdario [16]: https://github.com/sponsors/imdario [17]: https://tidelift.com/badges/package/go/github.com%2Fimdario%2Fmergo [18]: https://tidelift.com/subscription/pkg/go-github.com-imdario-mergo [19]: https://bestpractices.coreinfrastructure.org/projects/7177/badge [20]: https://bestpractices.coreinfrastructure.org/projects/7177 [21]: https://api.securityscorecards.dev/projects/github.com/imdario/mergo/badge [22]: https://api.securityscorecards.dev/projects/github.com/imdario/mergo A helper to merge structs and maps in Golang. Useful for configuration default values, avoiding messy if-statements. Mergo merges same-type structs and maps by setting default values in zero-value fields. Mergo won't merge unexported (private) fields. It will do recursively any exported one. It also won't merge structs inside maps (because they are not addressable using Go reflection). Also a lovely [comune](http://en.wikipedia.org/wiki/Mergo) (municipality) in the Province of Ancona in the Italian region of Marche. ## Status Mergo is stable and frozen, ready for production. Check a short list of the projects using at large scale it [here](https://github.com/imdario/mergo#mergo-in-the-wild). No new features are accepted. They will be considered for a future v2 that improves the implementation and fixes bugs for corner cases. ### Important notes #### 1.0.0 In [1.0.0](//github.com/imdario/mergo/releases/tag/1.0.0) Mergo moves to a vanity URL `dario.cat/mergo`. No more v1 versions will be released. If the vanity URL is causing issues in your project due to a dependency pulling Mergo - it isn't a direct dependency in your project - it is recommended to use [replace](https://github.com/golang/go/wiki/Modules#when-should-i-use-the-replace-directive) to pin the version to the last one with the old import URL: ``` replace github.com/imdario/mergo => github.com/imdario/mergo v0.3.16 ``` #### 0.3.9 Please keep in mind that a problematic PR broke [0.3.9](//github.com/imdario/mergo/releases/tag/0.3.9). I reverted it in [0.3.10](//github.com/imdario/mergo/releases/tag/0.3.10), and I consider it stable but not bug-free. Also, this version adds support for go modules. Keep in mind that in [0.3.2](//github.com/imdario/mergo/releases/tag/0.3.2), Mergo changed `Merge()`and `Map()` signatures to support [transformers](#transformers). I added an optional/variadic argument so that it won't break the existing code. If you were using Mergo before April 6th, 2015, please check your project works as intended after updating your local copy with ```go get -u dario.cat/mergo```. I apologize for any issue caused by its previous behavior and any future bug that Mergo could cause in existing projects after the change (release 0.2.0). ### Donations If Mergo is useful to you, consider buying me a coffee, a beer, or making a monthly donation to allow me to keep building great free software. :heart_eyes: Donate using Liberapay Become my sponsor ### Mergo in the wild Mergo is used by [thousands](https://deps.dev/go/dario.cat%2Fmergo/v1.0.0/dependents) [of](https://deps.dev/go/github.com%2Fimdario%2Fmergo/v0.3.16/dependents) [projects](https://deps.dev/go/github.com%2Fimdario%2Fmergo/v0.3.12), including: * [containerd/containerd](https://github.com/containerd/containerd) * [datadog/datadog-agent](https://github.com/datadog/datadog-agent) * [docker/cli/](https://github.com/docker/cli/) * [goreleaser/goreleaser](https://github.com/goreleaser/goreleaser) * [go-micro/go-micro](https://github.com/go-micro/go-micro) * [grafana/loki](https://github.com/grafana/loki) * [masterminds/sprig](github.com/Masterminds/sprig) * [moby/moby](https://github.com/moby/moby) * [slackhq/nebula](https://github.com/slackhq/nebula) * [volcano-sh/volcano](https://github.com/volcano-sh/volcano) ## Install go get dario.cat/mergo // use in your .go code import ( "dario.cat/mergo" ) ## Usage You 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. It won't merge empty structs value as [they are zero values](https://golang.org/ref/spec#The_zero_value) too. Also, maps will be merged recursively except for structs inside maps (because they are not addressable using Go reflection). ```go if err := mergo.Merge(&dst, src); err != nil { // ... } ``` Also, you can merge overwriting values using the transformer `WithOverride`. ```go if err := mergo.Merge(&dst, src, mergo.WithOverride); err != nil { // ... } ``` If you need to override pointers, so the source pointer's value is assigned to the destination's pointer, you must use `WithoutDereference`: ```go package main import ( "fmt" "dario.cat/mergo" ) type Foo struct { A *string B int64 } func main() { first := "first" second := "second" src := Foo{ A: &first, B: 2, } dest := Foo{ A: &second, B: 1, } mergo.Merge(&dest, src, mergo.WithOverride, mergo.WithoutDereference) } ``` Additionally, 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. ```go if err := mergo.Map(&dst, srcMap); err != nil { // ... } ``` Warning: 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. Here is a nice example: ```go package main import ( "fmt" "dario.cat/mergo" ) type Foo struct { A string B int64 } func main() { src := Foo{ A: "one", B: 2, } dest := Foo{ A: "two", } mergo.Merge(&dest, src) fmt.Println(dest) // Will print // {two 2} } ``` ### Transformers Transformers allow to merge specific types differently than in the default behavior. In other words, now you can customize how some types are merged. For example, `time.Time` is a struct; it doesn't have zero value but IsZero can return true because it has fields with zero value. How can we merge a non-zero `time.Time`? ```go package main import ( "fmt" "dario.cat/mergo" "reflect" "time" ) type timeTransformer struct { } func (t timeTransformer) Transformer(typ reflect.Type) func(dst, src reflect.Value) error { if typ == reflect.TypeOf(time.Time{}) { return func(dst, src reflect.Value) error { if dst.CanSet() { isZero := dst.MethodByName("IsZero") result := isZero.Call([]reflect.Value{}) if result[0].Bool() { dst.Set(src) } } return nil } } return nil } type Snapshot struct { Time time.Time // ... } func main() { src := Snapshot{time.Now()} dest := Snapshot{} mergo.Merge(&dest, src, mergo.WithTransformers(timeTransformer{})) fmt.Println(dest) // Will print // { 2018-01-12 01:15:00 +0000 UTC m=+0.000000001 } } ``` ## Contact me If 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) ## About Written by [Dario Castañé](http://dario.im). ## License [BSD 3-Clause](http://opensource.org/licenses/BSD-3-Clause) license, as [Go language](http://golang.org/LICENSE). [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fimdario%2Fmergo.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fimdario%2Fmergo?ref=badge_large) ================================================ FILE: vendor/dario.cat/mergo/SECURITY.md ================================================ # Security Policy ## Supported Versions | Version | Supported | | ------- | ------------------ | | 1.x.x | :white_check_mark: | | < 1.0 | :x: | ## Security contact information To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. ================================================ FILE: vendor/dario.cat/mergo/doc.go ================================================ // Copyright 2013 Dario Castañé. All rights reserved. // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* A helper to merge structs and maps in Golang. Useful for configuration default values, avoiding messy if-statements. Mergo merges same-type structs and maps by setting default values in zero-value fields. Mergo won't merge unexported (private) fields. It will do recursively any exported one. It also won't merge structs inside maps (because they are not addressable using Go reflection). # Status It is ready for production use. It is used in several projects by Docker, Google, The Linux Foundation, VMWare, Shopify, etc. # Important notes 1.0.0 In 1.0.0 Mergo moves to a vanity URL `dario.cat/mergo`. 0.3.9 Please keep in mind that a problematic PR broke 0.3.9. We reverted it in 0.3.10. We consider 0.3.10 as stable but not bug-free. . Also, this version adds suppot for go modules. Keep in mind that in 0.3.2, Mergo changed Merge() and Map() signatures to support transformers. We added an optional/variadic argument so that it won't break the existing code. If you were using Mergo before April 6th, 2015, please check your project works as intended after updating your local copy with go get -u dario.cat/mergo. I apologize for any issue caused by its previous behavior and any future bug that Mergo could cause in existing projects after the change (release 0.2.0). # Install Do your usual installation procedure: go get dario.cat/mergo // use in your .go code import ( "dario.cat/mergo" ) # Usage You 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. It won't merge empty structs value as they are zero values too. Also, maps will be merged recursively except for structs inside maps (because they are not addressable using Go reflection). if err := mergo.Merge(&dst, src); err != nil { // ... } Also, you can merge overwriting values using the transformer WithOverride. if err := mergo.Merge(&dst, src, mergo.WithOverride); err != nil { // ... } Additionally, 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. if err := mergo.Map(&dst, srcMap); err != nil { // ... } Warning: 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. Here is a nice example: package main import ( "fmt" "dario.cat/mergo" ) type Foo struct { A string B int64 } func main() { src := Foo{ A: "one", B: 2, } dest := Foo{ A: "two", } mergo.Merge(&dest, src) fmt.Println(dest) // Will print // {two 2} } # Transformers Transformers allow to merge specific types differently than in the default behavior. In other words, now you can customize how some types are merged. For example, time.Time is a struct; it doesn't have zero value but IsZero can return true because it has fields with zero value. How can we merge a non-zero time.Time? package main import ( "fmt" "dario.cat/mergo" "reflect" "time" ) type timeTransformer struct { } func (t timeTransformer) Transformer(typ reflect.Type) func(dst, src reflect.Value) error { if typ == reflect.TypeOf(time.Time{}) { return func(dst, src reflect.Value) error { if dst.CanSet() { isZero := dst.MethodByName("IsZero") result := isZero.Call([]reflect.Value{}) if result[0].Bool() { dst.Set(src) } } return nil } } return nil } type Snapshot struct { Time time.Time // ... } func main() { src := Snapshot{time.Now()} dest := Snapshot{} mergo.Merge(&dest, src, mergo.WithTransformers(timeTransformer{})) fmt.Println(dest) // Will print // { 2018-01-12 01:15:00 +0000 UTC m=+0.000000001 } } # Contact me If 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): https://twitter.com/im_dario # About Written by Dario Castañé: https://da.rio.hn # License BSD 3-Clause license, as Go language. */ package mergo ================================================ FILE: vendor/dario.cat/mergo/map.go ================================================ // Copyright 2014 Dario Castañé. All rights reserved. // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Based on src/pkg/reflect/deepequal.go from official // golang's stdlib. package mergo import ( "fmt" "reflect" "unicode" "unicode/utf8" ) func changeInitialCase(s string, mapper func(rune) rune) string { if s == "" { return s } r, n := utf8.DecodeRuneInString(s) return string(mapper(r)) + s[n:] } func isExported(field reflect.StructField) bool { r, _ := utf8.DecodeRuneInString(field.Name) return r >= 'A' && r <= 'Z' } // Traverses recursively both values, assigning src's fields values to dst. // The map argument tracks comparisons that have already been seen, which allows // short circuiting on recursive types. func deepMap(dst, src reflect.Value, visited map[uintptr]*visit, depth int, config *Config) (err error) { overwrite := config.Overwrite if dst.CanAddr() { addr := dst.UnsafeAddr() h := 17 * addr seen := visited[h] typ := dst.Type() for p := seen; p != nil; p = p.next { if p.ptr == addr && p.typ == typ { return nil } } // Remember, remember... visited[h] = &visit{typ, seen, addr} } zeroValue := reflect.Value{} switch dst.Kind() { case reflect.Map: dstMap := dst.Interface().(map[string]interface{}) for i, n := 0, src.NumField(); i < n; i++ { srcType := src.Type() field := srcType.Field(i) if !isExported(field) { continue } fieldName := field.Name fieldName = changeInitialCase(fieldName, unicode.ToLower) if _, ok := dstMap[fieldName]; !ok || (!isEmptyValue(reflect.ValueOf(src.Field(i).Interface()), !config.ShouldNotDereference) && overwrite) || config.overwriteWithEmptyValue { dstMap[fieldName] = src.Field(i).Interface() } } case reflect.Ptr: if dst.IsNil() { v := reflect.New(dst.Type().Elem()) dst.Set(v) } dst = dst.Elem() fallthrough case reflect.Struct: srcMap := src.Interface().(map[string]interface{}) for key := range srcMap { config.overwriteWithEmptyValue = true srcValue := srcMap[key] fieldName := changeInitialCase(key, unicode.ToUpper) dstElement := dst.FieldByName(fieldName) if dstElement == zeroValue { // We discard it because the field doesn't exist. continue } srcElement := reflect.ValueOf(srcValue) dstKind := dstElement.Kind() srcKind := srcElement.Kind() if srcKind == reflect.Ptr && dstKind != reflect.Ptr { srcElement = srcElement.Elem() srcKind = reflect.TypeOf(srcElement.Interface()).Kind() } else if dstKind == reflect.Ptr { // Can this work? I guess it can't. if srcKind != reflect.Ptr && srcElement.CanAddr() { srcPtr := srcElement.Addr() srcElement = reflect.ValueOf(srcPtr) srcKind = reflect.Ptr } } if !srcElement.IsValid() { continue } if srcKind == dstKind { if err = deepMerge(dstElement, srcElement, visited, depth+1, config); err != nil { return } } else if dstKind == reflect.Interface && dstElement.Kind() == reflect.Interface { if err = deepMerge(dstElement, srcElement, visited, depth+1, config); err != nil { return } } else if srcKind == reflect.Map { if err = deepMap(dstElement, srcElement, visited, depth+1, config); err != nil { return } } else { return fmt.Errorf("type mismatch on %s field: found %v, expected %v", fieldName, srcKind, dstKind) } } } return } // Map sets fields' values in dst from src. // src can be a map with string keys or a struct. dst must be the opposite: // if src is a map, dst must be a valid pointer to struct. If src is a struct, // dst must be map[string]interface{}. // It won't merge unexported (private) fields and will do recursively // any exported field. // If dst is a map, keys will be src fields' names in lower camel case. // Missing key in src that doesn't match a field in dst will be skipped. This // doesn't apply if dst is a map. // This is separated method from Merge because it is cleaner and it keeps sane // semantics: merging equal types, mapping different (restricted) types. func Map(dst, src interface{}, opts ...func(*Config)) error { return _map(dst, src, opts...) } // MapWithOverwrite will do the same as Map except that non-empty dst attributes will be overridden by // non-empty src attribute values. // Deprecated: Use Map(…) with WithOverride func MapWithOverwrite(dst, src interface{}, opts ...func(*Config)) error { return _map(dst, src, append(opts, WithOverride)...) } func _map(dst, src interface{}, opts ...func(*Config)) error { if dst != nil && reflect.ValueOf(dst).Kind() != reflect.Ptr { return ErrNonPointerArgument } var ( vDst, vSrc reflect.Value err error ) config := &Config{} for _, opt := range opts { opt(config) } if vDst, vSrc, err = resolveValues(dst, src); err != nil { return err } // To be friction-less, we redirect equal-type arguments // to deepMerge. Only because arguments can be anything. if vSrc.Kind() == vDst.Kind() { return deepMerge(vDst, vSrc, make(map[uintptr]*visit), 0, config) } switch vSrc.Kind() { case reflect.Struct: if vDst.Kind() != reflect.Map { return ErrExpectedMapAsDestination } case reflect.Map: if vDst.Kind() != reflect.Struct { return ErrExpectedStructAsDestination } default: return ErrNotSupported } return deepMap(vDst, vSrc, make(map[uintptr]*visit), 0, config) } ================================================ FILE: vendor/dario.cat/mergo/merge.go ================================================ // Copyright 2013 Dario Castañé. All rights reserved. // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Based on src/pkg/reflect/deepequal.go from official // golang's stdlib. package mergo import ( "fmt" "reflect" ) func hasMergeableFields(dst reflect.Value) (exported bool) { for i, n := 0, dst.NumField(); i < n; i++ { field := dst.Type().Field(i) if field.Anonymous && dst.Field(i).Kind() == reflect.Struct { exported = exported || hasMergeableFields(dst.Field(i)) } else if isExportedComponent(&field) { exported = exported || len(field.PkgPath) == 0 } } return } func isExportedComponent(field *reflect.StructField) bool { pkgPath := field.PkgPath if len(pkgPath) > 0 { return false } c := field.Name[0] if 'a' <= c && c <= 'z' || c == '_' { return false } return true } type Config struct { Transformers Transformers Overwrite bool ShouldNotDereference bool AppendSlice bool TypeCheck bool overwriteWithEmptyValue bool overwriteSliceWithEmptyValue bool sliceDeepCopy bool debug bool } type Transformers interface { Transformer(reflect.Type) func(dst, src reflect.Value) error } // Traverses recursively both values, assigning src's fields values to dst. // The map argument tracks comparisons that have already been seen, which allows // short circuiting on recursive types. func deepMerge(dst, src reflect.Value, visited map[uintptr]*visit, depth int, config *Config) (err error) { overwrite := config.Overwrite typeCheck := config.TypeCheck overwriteWithEmptySrc := config.overwriteWithEmptyValue overwriteSliceWithEmptySrc := config.overwriteSliceWithEmptyValue sliceDeepCopy := config.sliceDeepCopy if !src.IsValid() { return } if dst.CanAddr() { addr := dst.UnsafeAddr() h := 17 * addr seen := visited[h] typ := dst.Type() for p := seen; p != nil; p = p.next { if p.ptr == addr && p.typ == typ { return nil } } // Remember, remember... visited[h] = &visit{typ, seen, addr} } if config.Transformers != nil && !isReflectNil(dst) && dst.IsValid() { if fn := config.Transformers.Transformer(dst.Type()); fn != nil { err = fn(dst, src) return } } switch dst.Kind() { case reflect.Struct: if hasMergeableFields(dst) { for i, n := 0, dst.NumField(); i < n; i++ { if err = deepMerge(dst.Field(i), src.Field(i), visited, depth+1, config); err != nil { return } } } else { if dst.CanSet() && (isReflectNil(dst) || overwrite) && (!isEmptyValue(src, !config.ShouldNotDereference) || overwriteWithEmptySrc) { dst.Set(src) } } case reflect.Map: if dst.IsNil() && !src.IsNil() { if dst.CanSet() { dst.Set(reflect.MakeMap(dst.Type())) } else { dst = src return } } if src.Kind() != reflect.Map { if overwrite && dst.CanSet() { dst.Set(src) } return } for _, key := range src.MapKeys() { srcElement := src.MapIndex(key) if !srcElement.IsValid() { continue } dstElement := dst.MapIndex(key) switch srcElement.Kind() { case reflect.Chan, reflect.Func, reflect.Map, reflect.Interface, reflect.Slice: if srcElement.IsNil() { if overwrite { dst.SetMapIndex(key, srcElement) } continue } fallthrough default: if !srcElement.CanInterface() { continue } switch reflect.TypeOf(srcElement.Interface()).Kind() { case reflect.Struct: fallthrough case reflect.Ptr: fallthrough case reflect.Map: srcMapElm := srcElement dstMapElm := dstElement if srcMapElm.CanInterface() { srcMapElm = reflect.ValueOf(srcMapElm.Interface()) if dstMapElm.IsValid() { dstMapElm = reflect.ValueOf(dstMapElm.Interface()) } } if err = deepMerge(dstMapElm, srcMapElm, visited, depth+1, config); err != nil { return } case reflect.Slice: srcSlice := reflect.ValueOf(srcElement.Interface()) var dstSlice reflect.Value if !dstElement.IsValid() || dstElement.IsNil() { dstSlice = reflect.MakeSlice(srcSlice.Type(), 0, srcSlice.Len()) } else { dstSlice = reflect.ValueOf(dstElement.Interface()) } if (!isEmptyValue(src, !config.ShouldNotDereference) || overwriteWithEmptySrc || overwriteSliceWithEmptySrc) && (overwrite || isEmptyValue(dst, !config.ShouldNotDereference)) && !config.AppendSlice && !sliceDeepCopy { if typeCheck && srcSlice.Type() != dstSlice.Type() { return fmt.Errorf("cannot override two slices with different type (%s, %s)", srcSlice.Type(), dstSlice.Type()) } dstSlice = srcSlice } else if config.AppendSlice { if srcSlice.Type() != dstSlice.Type() { return fmt.Errorf("cannot append two slices with different type (%s, %s)", srcSlice.Type(), dstSlice.Type()) } dstSlice = reflect.AppendSlice(dstSlice, srcSlice) } else if sliceDeepCopy { i := 0 for ; i < srcSlice.Len() && i < dstSlice.Len(); i++ { srcElement := srcSlice.Index(i) dstElement := dstSlice.Index(i) if srcElement.CanInterface() { srcElement = reflect.ValueOf(srcElement.Interface()) } if dstElement.CanInterface() { dstElement = reflect.ValueOf(dstElement.Interface()) } if err = deepMerge(dstElement, srcElement, visited, depth+1, config); err != nil { return } } } dst.SetMapIndex(key, dstSlice) } } if dstElement.IsValid() && !isEmptyValue(dstElement, !config.ShouldNotDereference) { if reflect.TypeOf(srcElement.Interface()).Kind() == reflect.Slice { continue } if reflect.TypeOf(srcElement.Interface()).Kind() == reflect.Map && reflect.TypeOf(dstElement.Interface()).Kind() == reflect.Map { continue } } if srcElement.IsValid() && ((srcElement.Kind() != reflect.Ptr && overwrite) || !dstElement.IsValid() || isEmptyValue(dstElement, !config.ShouldNotDereference)) { if dst.IsNil() { dst.Set(reflect.MakeMap(dst.Type())) } dst.SetMapIndex(key, srcElement) } } // Ensure that all keys in dst are deleted if they are not in src. if overwriteWithEmptySrc { for _, key := range dst.MapKeys() { srcElement := src.MapIndex(key) if !srcElement.IsValid() { dst.SetMapIndex(key, reflect.Value{}) } } } case reflect.Slice: if !dst.CanSet() { break } if (!isEmptyValue(src, !config.ShouldNotDereference) || overwriteWithEmptySrc || overwriteSliceWithEmptySrc) && (overwrite || isEmptyValue(dst, !config.ShouldNotDereference)) && !config.AppendSlice && !sliceDeepCopy { dst.Set(src) } else if config.AppendSlice { if src.Type() != dst.Type() { return fmt.Errorf("cannot append two slice with different type (%s, %s)", src.Type(), dst.Type()) } dst.Set(reflect.AppendSlice(dst, src)) } else if sliceDeepCopy { for i := 0; i < src.Len() && i < dst.Len(); i++ { srcElement := src.Index(i) dstElement := dst.Index(i) if srcElement.CanInterface() { srcElement = reflect.ValueOf(srcElement.Interface()) } if dstElement.CanInterface() { dstElement = reflect.ValueOf(dstElement.Interface()) } if err = deepMerge(dstElement, srcElement, visited, depth+1, config); err != nil { return } } } case reflect.Ptr: fallthrough case reflect.Interface: if isReflectNil(src) { if overwriteWithEmptySrc && dst.CanSet() && src.Type().AssignableTo(dst.Type()) { dst.Set(src) } break } if src.Kind() != reflect.Interface { if dst.IsNil() || (src.Kind() != reflect.Ptr && overwrite) { if dst.CanSet() && (overwrite || isEmptyValue(dst, !config.ShouldNotDereference)) { dst.Set(src) } } else if src.Kind() == reflect.Ptr { if !config.ShouldNotDereference { if err = deepMerge(dst.Elem(), src.Elem(), visited, depth+1, config); err != nil { return } } else if src.Elem().Kind() != reflect.Struct { if overwriteWithEmptySrc || (overwrite && !src.IsNil()) || dst.IsNil() { dst.Set(src) } } } else if dst.Elem().Type() == src.Type() { if err = deepMerge(dst.Elem(), src, visited, depth+1, config); err != nil { return } } else { return ErrDifferentArgumentsTypes } break } if dst.IsNil() || overwrite { if dst.CanSet() && (overwrite || isEmptyValue(dst, !config.ShouldNotDereference)) { dst.Set(src) } break } if dst.Elem().Kind() == src.Elem().Kind() { if err = deepMerge(dst.Elem(), src.Elem(), visited, depth+1, config); err != nil { return } break } default: mustSet := (isEmptyValue(dst, !config.ShouldNotDereference) || overwrite) && (!isEmptyValue(src, !config.ShouldNotDereference) || overwriteWithEmptySrc) if mustSet { if dst.CanSet() { dst.Set(src) } else { dst = src } } } return } // Merge will fill any empty for value type attributes on the dst struct using corresponding // src attributes if they themselves are not empty. dst and src must be valid same-type structs // and dst must be a pointer to struct. // It won't merge unexported (private) fields and will do recursively any exported field. func Merge(dst, src interface{}, opts ...func(*Config)) error { return merge(dst, src, opts...) } // MergeWithOverwrite will do the same as Merge except that non-empty dst attributes will be overridden by // non-empty src attribute values. // Deprecated: use Merge(…) with WithOverride func MergeWithOverwrite(dst, src interface{}, opts ...func(*Config)) error { return merge(dst, src, append(opts, WithOverride)...) } // WithTransformers adds transformers to merge, allowing to customize the merging of some types. func WithTransformers(transformers Transformers) func(*Config) { return func(config *Config) { config.Transformers = transformers } } // WithOverride will make merge override non-empty dst attributes with non-empty src attributes values. func WithOverride(config *Config) { config.Overwrite = true } // WithOverwriteWithEmptyValue will make merge override non empty dst attributes with empty src attributes values. func WithOverwriteWithEmptyValue(config *Config) { config.Overwrite = true config.overwriteWithEmptyValue = true } // WithOverrideEmptySlice will make merge override empty dst slice with empty src slice. func WithOverrideEmptySlice(config *Config) { config.overwriteSliceWithEmptyValue = true } // WithoutDereference prevents dereferencing pointers when evaluating whether they are empty // (i.e. a non-nil pointer is never considered empty). func WithoutDereference(config *Config) { config.ShouldNotDereference = true } // WithAppendSlice will make merge append slices instead of overwriting it. func WithAppendSlice(config *Config) { config.AppendSlice = true } // WithTypeCheck will make merge check types while overwriting it (must be used with WithOverride). func WithTypeCheck(config *Config) { config.TypeCheck = true } // WithSliceDeepCopy will merge slice element one by one with Overwrite flag. func WithSliceDeepCopy(config *Config) { config.sliceDeepCopy = true config.Overwrite = true } func merge(dst, src interface{}, opts ...func(*Config)) error { if dst != nil && reflect.ValueOf(dst).Kind() != reflect.Ptr { return ErrNonPointerArgument } var ( vDst, vSrc reflect.Value err error ) config := &Config{} for _, opt := range opts { opt(config) } if vDst, vSrc, err = resolveValues(dst, src); err != nil { return err } if vDst.Type() != vSrc.Type() { return ErrDifferentArgumentsTypes } return deepMerge(vDst, vSrc, make(map[uintptr]*visit), 0, config) } // IsReflectNil is the reflect value provided nil func isReflectNil(v reflect.Value) bool { k := v.Kind() switch k { case reflect.Interface, reflect.Slice, reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr: // Both interface and slice are nil if first word is 0. // Both are always bigger than a word; assume flagIndir. return v.IsNil() default: return false } } ================================================ FILE: vendor/dario.cat/mergo/mergo.go ================================================ // Copyright 2013 Dario Castañé. All rights reserved. // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Based on src/pkg/reflect/deepequal.go from official // golang's stdlib. package mergo import ( "errors" "reflect" ) // Errors reported by Mergo when it finds invalid arguments. var ( ErrNilArguments = errors.New("src and dst must not be nil") ErrDifferentArgumentsTypes = errors.New("src and dst must be of same type") ErrNotSupported = errors.New("only structs, maps, and slices are supported") ErrExpectedMapAsDestination = errors.New("dst was expected to be a map") ErrExpectedStructAsDestination = errors.New("dst was expected to be a struct") ErrNonPointerArgument = errors.New("dst must be a pointer") ) // During deepMerge, must keep track of checks that are // in progress. The comparison algorithm assumes that all // checks in progress are true when it reencounters them. // Visited are stored in a map indexed by 17 * a1 + a2; type visit struct { typ reflect.Type next *visit ptr uintptr } // From src/pkg/encoding/json/encode.go. func isEmptyValue(v reflect.Value, shouldDereference bool) bool { switch v.Kind() { case reflect.Array, reflect.Map, reflect.Slice, reflect.String: return v.Len() == 0 case reflect.Bool: return !v.Bool() case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: return v.Int() == 0 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: return v.Uint() == 0 case reflect.Float32, reflect.Float64: return v.Float() == 0 case reflect.Interface, reflect.Ptr: if v.IsNil() { return true } if shouldDereference { return isEmptyValue(v.Elem(), shouldDereference) } return false case reflect.Func: return v.IsNil() case reflect.Invalid: return true } return false } func resolveValues(dst, src interface{}) (vDst, vSrc reflect.Value, err error) { if dst == nil || src == nil { err = ErrNilArguments return } vDst = reflect.ValueOf(dst).Elem() if vDst.Kind() != reflect.Struct && vDst.Kind() != reflect.Map && vDst.Kind() != reflect.Slice { err = ErrNotSupported return } vSrc = reflect.ValueOf(src) // We check if vSrc is a pointer to dereference it. if vSrc.Kind() == reflect.Ptr { vSrc = vSrc.Elem() } return } ================================================ FILE: vendor/github.com/BurntSushi/toml/.gitignore ================================================ /toml.test /toml-test ================================================ FILE: vendor/github.com/BurntSushi/toml/COPYING ================================================ The MIT License (MIT) Copyright (c) 2013 TOML authors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: vendor/github.com/BurntSushi/toml/README.md ================================================ TOML stands for Tom's Obvious, Minimal Language. This Go package provides a reflection interface similar to Go's standard library `json` and `xml` packages. Compatible with TOML version [v1.1.0](https://toml.io/en/v1.1.0). Documentation: https://pkg.go.dev/github.com/BurntSushi/toml See the [releases page](https://github.com/BurntSushi/toml/releases) for a changelog; this information is also in the git tag annotations (e.g. `git show v0.4.0`). This library requires Go 1.18 or newer; add it to your go.mod with: % go get github.com/BurntSushi/toml@latest It also comes with a TOML validator CLI tool: % go install github.com/BurntSushi/toml/cmd/tomlv@latest % tomlv some-toml-file.toml ### Examples For the simplest example, consider some TOML file as just a list of keys and values: ```toml Age = 25 Cats = [ "Cauchy", "Plato" ] Pi = 3.14 Perfection = [ 6, 28, 496, 8128 ] DOB = 1987-07-05T05:45:00Z ``` Which can be decoded with: ```go type Config struct { Age int Cats []string Pi float64 Perfection []int DOB time.Time } var conf Config _, err := toml.Decode(tomlData, &conf) ``` You can also use struct tags if your struct field name doesn't map to a TOML key value directly: ```toml some_key_NAME = "wat" ``` ```go type TOML struct { ObscureKey string `toml:"some_key_NAME"` } ``` Beware that like other decoders **only exported fields** are considered when encoding and decoding; private fields are silently ignored. ### Using the `Marshaler` and `encoding.TextUnmarshaler` interfaces Here's an example that automatically parses values in a `mail.Address`: ```toml contacts = [ "Donald Duck ", "Scrooge McDuck ", ] ``` Can be decoded with: ```go // Create address type which satisfies the encoding.TextUnmarshaler interface. type address struct { *mail.Address } func (a *address) UnmarshalText(text []byte) error { var err error a.Address, err = mail.ParseAddress(string(text)) return err } // Decode it. func decode() { blob := ` contacts = [ "Donald Duck ", "Scrooge McDuck ", ] ` var contacts struct { Contacts []address } _, err := toml.Decode(blob, &contacts) if err != nil { log.Fatal(err) } for _, c := range contacts.Contacts { fmt.Printf("%#v\n", c.Address) } // Output: // &mail.Address{Name:"Donald Duck", Address:"donald@duckburg.com"} // &mail.Address{Name:"Scrooge McDuck", Address:"scrooge@duckburg.com"} } ``` To target TOML specifically you can implement `UnmarshalTOML` TOML interface in a similar way. ### More complex usage See the [`_example/`](/_example) directory for a more complex example. ================================================ FILE: vendor/github.com/BurntSushi/toml/decode.go ================================================ package toml import ( "bytes" "encoding" "encoding/json" "fmt" "io" "io/fs" "math" "os" "reflect" "strconv" "strings" "time" ) // Unmarshaler is the interface implemented by objects that can unmarshal a // TOML description of themselves. type Unmarshaler interface { UnmarshalTOML(any) error } // Unmarshal decodes the contents of data in TOML format into a pointer v. // // See [Decoder] for a description of the decoding process. func Unmarshal(data []byte, v any) error { _, err := NewDecoder(bytes.NewReader(data)).Decode(v) return err } // Decode the TOML data in to the pointer v. // // See [Decoder] for a description of the decoding process. func Decode(data string, v any) (MetaData, error) { return NewDecoder(strings.NewReader(data)).Decode(v) } // DecodeFile reads the contents of a file and decodes it with [Decode]. func DecodeFile(path string, v any) (MetaData, error) { fp, err := os.Open(path) if err != nil { return MetaData{}, err } defer fp.Close() return NewDecoder(fp).Decode(v) } // DecodeFS reads the contents of a file from [fs.FS] and decodes it with // [Decode]. func DecodeFS(fsys fs.FS, path string, v any) (MetaData, error) { fp, err := fsys.Open(path) if err != nil { return MetaData{}, err } defer fp.Close() return NewDecoder(fp).Decode(v) } // Primitive is a TOML value that hasn't been decoded into a Go value. // // This type can be used for any value, which will cause decoding to be delayed. // You can use [PrimitiveDecode] to "manually" decode these values. // // NOTE: The underlying representation of a `Primitive` value is subject to // change. Do not rely on it. // // NOTE: Primitive values are still parsed, so using them will only avoid the // overhead of reflection. They can be useful when you don't know the exact type // of TOML data until runtime. type Primitive struct { undecoded any context Key } // The significand precision for float32 and float64 is 24 and 53 bits; this is // the range a natural number can be stored in a float without loss of data. const ( maxSafeFloat32Int = 16777215 // 2^24-1 maxSafeFloat64Int = int64(9007199254740991) // 2^53-1 ) // Decoder decodes TOML data. // // TOML tables correspond to Go structs or maps; they can be used // interchangeably, but structs offer better type safety. // // TOML table arrays correspond to either a slice of structs or a slice of maps. // // TOML datetimes correspond to [time.Time]. Local datetimes are parsed in the // local timezone. // // [time.Duration] types are treated as nanoseconds if the TOML value is an // integer, or they're parsed with time.ParseDuration() if they're strings. // // All other TOML types (float, string, int, bool and array) correspond to the // obvious Go types. // // An exception to the above rules is if a type implements the TextUnmarshaler // interface, in which case any primitive TOML value (floats, strings, integers, // booleans, datetimes) will be converted to a []byte and given to the value's // UnmarshalText method. See the Unmarshaler example for a demonstration with // email addresses. // // # Key mapping // // TOML keys can map to either keys in a Go map or field names in a Go struct. // The special `toml` struct tag can be used to map TOML keys to struct fields // that don't match the key name exactly (see the example). A case insensitive // match to struct names will be tried if an exact match can't be found. // // The mapping between TOML values and Go values is loose. That is, there may // exist TOML values that cannot be placed into your representation, and there // may be parts of your representation that do not correspond to TOML values. // This loose mapping can be made stricter by using the IsDefined and/or // Undecoded methods on the MetaData returned. // // This decoder does not handle cyclic types. Decode will not terminate if a // cyclic type is passed. type Decoder struct { r io.Reader } // NewDecoder creates a new Decoder. func NewDecoder(r io.Reader) *Decoder { return &Decoder{r: r} } var ( unmarshalToml = reflect.TypeOf((*Unmarshaler)(nil)).Elem() unmarshalText = reflect.TypeOf((*encoding.TextUnmarshaler)(nil)).Elem() primitiveType = reflect.TypeOf((*Primitive)(nil)).Elem() ) // Decode TOML data in to the pointer `v`. func (dec *Decoder) Decode(v any) (MetaData, error) { rv := reflect.ValueOf(v) if rv.Kind() != reflect.Ptr { s := "%q" if reflect.TypeOf(v) == nil { s = "%v" } return MetaData{}, fmt.Errorf("toml: cannot decode to non-pointer "+s, reflect.TypeOf(v)) } if rv.IsNil() { return MetaData{}, fmt.Errorf("toml: cannot decode to nil value of %q", reflect.TypeOf(v)) } // Check if this is a supported type: struct, map, any, or something that // implements UnmarshalTOML or UnmarshalText. rv = indirect(rv) rt := rv.Type() if rv.Kind() != reflect.Struct && rv.Kind() != reflect.Map && !(rv.Kind() == reflect.Interface && rv.NumMethod() == 0) && !rt.Implements(unmarshalToml) && !rt.Implements(unmarshalText) { return MetaData{}, fmt.Errorf("toml: cannot decode to type %s", rt) } // TODO: parser should read from io.Reader? Or at the very least, make it // read from []byte rather than string data, err := io.ReadAll(dec.r) if err != nil { return MetaData{}, err } p, err := parse(string(data)) if err != nil { return MetaData{}, err } md := MetaData{ mapping: p.mapping, keyInfo: p.keyInfo, keys: p.ordered, decoded: make(map[string]struct{}, len(p.ordered)), context: nil, data: data, } return md, md.unify(p.mapping, rv) } // PrimitiveDecode is just like the other Decode* functions, except it decodes a // TOML value that has already been parsed. Valid primitive values can *only* be // obtained from values filled by the decoder functions, including this method. // (i.e., v may contain more [Primitive] values.) // // Meta data for primitive values is included in the meta data returned by the // Decode* functions with one exception: keys returned by the Undecoded method // will only reflect keys that were decoded. Namely, any keys hidden behind a // Primitive will be considered undecoded. Executing this method will update the // undecoded keys in the meta data. (See the example.) func (md *MetaData) PrimitiveDecode(primValue Primitive, v any) error { md.context = primValue.context defer func() { md.context = nil }() return md.unify(primValue.undecoded, rvalue(v)) } // markDecodedRecursive is a helper to mark any key under the given tmap as // decoded, recursing as needed func markDecodedRecursive(md *MetaData, tmap map[string]any) { for key := range tmap { md.decoded[md.context.add(key).String()] = struct{}{} if tmap, ok := tmap[key].(map[string]any); ok { md.context = append(md.context, key) markDecodedRecursive(md, tmap) md.context = md.context[0 : len(md.context)-1] } if tarr, ok := tmap[key].([]map[string]any); ok { for _, elm := range tarr { md.context = append(md.context, key) markDecodedRecursive(md, elm) md.context = md.context[0 : len(md.context)-1] } } } } // unify performs a sort of type unification based on the structure of `rv`, // which is the client representation. // // Any type mismatch produces an error. Finding a type that we don't know // how to handle produces an unsupported type error. func (md *MetaData) unify(data any, rv reflect.Value) error { // Special case. Look for a `Primitive` value. // TODO: #76 would make this superfluous after implemented. if rv.Type() == primitiveType { // Save the undecoded data and the key context into the primitive // value. context := make(Key, len(md.context)) copy(context, md.context) rv.Set(reflect.ValueOf(Primitive{ undecoded: data, context: context, })) return nil } rvi := rv.Interface() if v, ok := rvi.(Unmarshaler); ok { err := v.UnmarshalTOML(data) if err != nil { return md.parseErr(err) } // Assume the Unmarshaler decoded everything, so mark all keys under // this table as decoded. if tmap, ok := data.(map[string]any); ok { markDecodedRecursive(md, tmap) } if aot, ok := data.([]map[string]any); ok { for _, tmap := range aot { markDecodedRecursive(md, tmap) } } return nil } if v, ok := rvi.(encoding.TextUnmarshaler); ok { return md.unifyText(data, v) } // TODO: // The behavior here is incorrect whenever a Go type satisfies the // encoding.TextUnmarshaler interface but also corresponds to a TOML hash or // array. In particular, the unmarshaler should only be applied to primitive // TOML values. But at this point, it will be applied to all kinds of values // and produce an incorrect error whenever those values are hashes or arrays // (including arrays of tables). k := rv.Kind() if k >= reflect.Int && k <= reflect.Uint64 { return md.unifyInt(data, rv) } switch k { case reflect.Struct: return md.unifyStruct(data, rv) case reflect.Map: return md.unifyMap(data, rv) case reflect.Array: return md.unifyArray(data, rv) case reflect.Slice: return md.unifySlice(data, rv) case reflect.String: return md.unifyString(data, rv) case reflect.Bool: return md.unifyBool(data, rv) case reflect.Interface: if rv.NumMethod() > 0 { /// Only empty interfaces are supported. return md.e("unsupported type %s", rv.Type()) } return md.unifyAnything(data, rv) case reflect.Float32, reflect.Float64: return md.unifyFloat64(data, rv) } return md.e("unsupported type %s", rv.Kind()) } func (md *MetaData) unifyStruct(mapping any, rv reflect.Value) error { tmap, ok := mapping.(map[string]any) if !ok { if mapping == nil { return nil } return md.e("type mismatch for %s: expected table but found %s", rv.Type().String(), fmtType(mapping)) } for key, datum := range tmap { var f *field fields := cachedTypeFields(rv.Type()) for i := range fields { ff := &fields[i] if ff.name == key { f = ff break } if f == nil && strings.EqualFold(ff.name, key) { f = ff } } if f != nil { subv := rv for _, i := range f.index { subv = indirect(subv.Field(i)) } if isUnifiable(subv) { md.decoded[md.context.add(key).String()] = struct{}{} md.context = append(md.context, key) err := md.unify(datum, subv) if err != nil { return err } md.context = md.context[0 : len(md.context)-1] } else if f.name != "" { return md.e("cannot write unexported field %s.%s", rv.Type().String(), f.name) } } } return nil } func (md *MetaData) unifyMap(mapping any, rv reflect.Value) error { keyType := rv.Type().Key().Kind() if keyType != reflect.String && keyType != reflect.Interface { return fmt.Errorf("toml: cannot decode to a map with non-string key type (%s in %q)", keyType, rv.Type()) } tmap, ok := mapping.(map[string]any) if !ok { if tmap == nil { return nil } return md.badtype("map", mapping) } if rv.IsNil() { rv.Set(reflect.MakeMap(rv.Type())) } for k, v := range tmap { md.decoded[md.context.add(k).String()] = struct{}{} md.context = append(md.context, k) rvval := reflect.Indirect(reflect.New(rv.Type().Elem())) err := md.unify(v, indirect(rvval)) if err != nil { return err } md.context = md.context[0 : len(md.context)-1] rvkey := indirect(reflect.New(rv.Type().Key())) switch keyType { case reflect.Interface: rvkey.Set(reflect.ValueOf(k)) case reflect.String: rvkey.SetString(k) } rv.SetMapIndex(rvkey, rvval) } return nil } func (md *MetaData) unifyArray(data any, rv reflect.Value) error { datav := reflect.ValueOf(data) if datav.Kind() != reflect.Slice { if !datav.IsValid() { return nil } return md.badtype("slice", data) } if l := datav.Len(); l != rv.Len() { return md.e("expected array length %d; got TOML array of length %d", rv.Len(), l) } return md.unifySliceArray(datav, rv) } func (md *MetaData) unifySlice(data any, rv reflect.Value) error { datav := reflect.ValueOf(data) if datav.Kind() != reflect.Slice { if !datav.IsValid() { return nil } return md.badtype("slice", data) } n := datav.Len() if rv.IsNil() || rv.Cap() < n { rv.Set(reflect.MakeSlice(rv.Type(), n, n)) } rv.SetLen(n) return md.unifySliceArray(datav, rv) } func (md *MetaData) unifySliceArray(data, rv reflect.Value) error { l := data.Len() for i := 0; i < l; i++ { err := md.unify(data.Index(i).Interface(), indirect(rv.Index(i))) if err != nil { return err } } return nil } func (md *MetaData) unifyString(data any, rv reflect.Value) error { _, ok := rv.Interface().(json.Number) if ok { if i, ok := data.(int64); ok { rv.SetString(strconv.FormatInt(i, 10)) } else if f, ok := data.(float64); ok { rv.SetString(strconv.FormatFloat(f, 'g', -1, 64)) } else { return md.badtype("string", data) } return nil } if s, ok := data.(string); ok { rv.SetString(s) return nil } return md.badtype("string", data) } func (md *MetaData) unifyFloat64(data any, rv reflect.Value) error { rvk := rv.Kind() if num, ok := data.(float64); ok { switch rvk { case reflect.Float32: if num < -math.MaxFloat32 || num > math.MaxFloat32 { return md.parseErr(errParseRange{i: num, size: rvk.String()}) } fallthrough case reflect.Float64: rv.SetFloat(num) default: panic("bug") } return nil } if num, ok := data.(int64); ok { if (rvk == reflect.Float32 && (num < -maxSafeFloat32Int || num > maxSafeFloat32Int)) || (rvk == reflect.Float64 && (num < -maxSafeFloat64Int || num > maxSafeFloat64Int)) { return md.parseErr(errUnsafeFloat{i: num, size: rvk.String()}) } rv.SetFloat(float64(num)) return nil } return md.badtype("float", data) } func (md *MetaData) unifyInt(data any, rv reflect.Value) error { _, ok := rv.Interface().(time.Duration) if ok { // Parse as string duration, and fall back to regular integer parsing // (as nanosecond) if this is not a string. if s, ok := data.(string); ok { dur, err := time.ParseDuration(s) if err != nil { return md.parseErr(errParseDuration{s}) } rv.SetInt(int64(dur)) return nil } } num, ok := data.(int64) if !ok { return md.badtype("integer", data) } rvk := rv.Kind() switch { case rvk >= reflect.Int && rvk <= reflect.Int64: if (rvk == reflect.Int8 && (num < math.MinInt8 || num > math.MaxInt8)) || (rvk == reflect.Int16 && (num < math.MinInt16 || num > math.MaxInt16)) || (rvk == reflect.Int32 && (num < math.MinInt32 || num > math.MaxInt32)) { return md.parseErr(errParseRange{i: num, size: rvk.String()}) } rv.SetInt(num) case rvk >= reflect.Uint && rvk <= reflect.Uint64: unum := uint64(num) if rvk == reflect.Uint8 && (num < 0 || unum > math.MaxUint8) || rvk == reflect.Uint16 && (num < 0 || unum > math.MaxUint16) || rvk == reflect.Uint32 && (num < 0 || unum > math.MaxUint32) { return md.parseErr(errParseRange{i: num, size: rvk.String()}) } rv.SetUint(unum) default: panic("unreachable") } return nil } func (md *MetaData) unifyBool(data any, rv reflect.Value) error { if b, ok := data.(bool); ok { rv.SetBool(b) return nil } return md.badtype("boolean", data) } func (md *MetaData) unifyAnything(data any, rv reflect.Value) error { rv.Set(reflect.ValueOf(data)) return nil } func (md *MetaData) unifyText(data any, v encoding.TextUnmarshaler) error { var s string switch sdata := data.(type) { case Marshaler: text, err := sdata.MarshalTOML() if err != nil { return err } s = string(text) case encoding.TextMarshaler: text, err := sdata.MarshalText() if err != nil { return err } s = string(text) case fmt.Stringer: s = sdata.String() case string: s = sdata case bool: s = fmt.Sprintf("%v", sdata) case int64: s = fmt.Sprintf("%d", sdata) case float64: s = fmt.Sprintf("%f", sdata) default: return md.badtype("primitive (string-like)", data) } if err := v.UnmarshalText([]byte(s)); err != nil { return md.parseErr(err) } return nil } func (md *MetaData) badtype(dst string, data any) error { return md.e("incompatible types: TOML value has type %s; destination has type %s", fmtType(data), dst) } func (md *MetaData) parseErr(err error) error { k := md.context.String() d := string(md.data) return ParseError{ Message: err.Error(), err: err, LastKey: k, Position: md.keyInfo[k].pos.withCol(d), Line: md.keyInfo[k].pos.Line, input: d, } } func (md *MetaData) e(format string, args ...any) error { f := "toml: " if len(md.context) > 0 { f = fmt.Sprintf("toml: (last key %q): ", md.context) p := md.keyInfo[md.context.String()].pos if p.Line > 0 { f = fmt.Sprintf("toml: line %d (last key %q): ", p.Line, md.context) } } return fmt.Errorf(f+format, args...) } // rvalue returns a reflect.Value of `v`. All pointers are resolved. func rvalue(v any) reflect.Value { return indirect(reflect.ValueOf(v)) } // indirect returns the value pointed to by a pointer. // // Pointers are followed until the value is not a pointer. New values are // allocated for each nil pointer. // // An exception to this rule is if the value satisfies an interface of interest // to us (like encoding.TextUnmarshaler). func indirect(v reflect.Value) reflect.Value { if v.Kind() != reflect.Ptr { if v.CanSet() { pv := v.Addr() pvi := pv.Interface() if _, ok := pvi.(encoding.TextUnmarshaler); ok { return pv } if _, ok := pvi.(Unmarshaler); ok { return pv } } return v } if v.IsNil() { v.Set(reflect.New(v.Type().Elem())) } return indirect(reflect.Indirect(v)) } func isUnifiable(rv reflect.Value) bool { if rv.CanSet() { return true } rvi := rv.Interface() if _, ok := rvi.(encoding.TextUnmarshaler); ok { return true } if _, ok := rvi.(Unmarshaler); ok { return true } return false } // fmt %T with "interface {}" replaced with "any", which is far more readable. func fmtType(t any) string { return strings.ReplaceAll(fmt.Sprintf("%T", t), "interface {}", "any") } ================================================ FILE: vendor/github.com/BurntSushi/toml/deprecated.go ================================================ package toml import ( "encoding" "io" ) // TextMarshaler is an alias for encoding.TextMarshaler. // // Deprecated: use encoding.TextMarshaler type TextMarshaler encoding.TextMarshaler // TextUnmarshaler is an alias for encoding.TextUnmarshaler. // // Deprecated: use encoding.TextUnmarshaler type TextUnmarshaler encoding.TextUnmarshaler // DecodeReader is an alias for NewDecoder(r).Decode(v). // // Deprecated: use NewDecoder(reader).Decode(&value). func DecodeReader(r io.Reader, v any) (MetaData, error) { return NewDecoder(r).Decode(v) } // PrimitiveDecode is an alias for MetaData.PrimitiveDecode(). // // Deprecated: use MetaData.PrimitiveDecode. func PrimitiveDecode(primValue Primitive, v any) error { md := MetaData{decoded: make(map[string]struct{})} return md.unify(primValue.undecoded, rvalue(v)) } ================================================ FILE: vendor/github.com/BurntSushi/toml/doc.go ================================================ // Package toml implements decoding and encoding of TOML files. // // This package supports TOML v1.0.0, as specified at https://toml.io // // The github.com/BurntSushi/toml/cmd/tomlv package implements a TOML validator, // and can be used to verify if TOML document is valid. It can also be used to // print the type of each key. package toml ================================================ FILE: vendor/github.com/BurntSushi/toml/encode.go ================================================ package toml import ( "bufio" "bytes" "encoding" "encoding/json" "errors" "fmt" "io" "math" "reflect" "sort" "strconv" "strings" "time" "github.com/BurntSushi/toml/internal" ) type tomlEncodeError struct{ error } var ( errArrayNilElement = errors.New("toml: cannot encode array with nil element") errNonString = errors.New("toml: cannot encode a map with non-string key type") errNoKey = errors.New("toml: top-level values must be Go maps or structs") errAnything = errors.New("") // used in testing ) var dblQuotedReplacer = strings.NewReplacer( "\"", "\\\"", "\\", "\\\\", "\x00", `\u0000`, "\x01", `\u0001`, "\x02", `\u0002`, "\x03", `\u0003`, "\x04", `\u0004`, "\x05", `\u0005`, "\x06", `\u0006`, "\x07", `\u0007`, "\b", `\b`, "\t", `\t`, "\n", `\n`, "\x0b", `\u000b`, "\f", `\f`, "\r", `\r`, "\x0e", `\u000e`, "\x0f", `\u000f`, "\x10", `\u0010`, "\x11", `\u0011`, "\x12", `\u0012`, "\x13", `\u0013`, "\x14", `\u0014`, "\x15", `\u0015`, "\x16", `\u0016`, "\x17", `\u0017`, "\x18", `\u0018`, "\x19", `\u0019`, "\x1a", `\u001a`, "\x1b", `\u001b`, "\x1c", `\u001c`, "\x1d", `\u001d`, "\x1e", `\u001e`, "\x1f", `\u001f`, "\x7f", `\u007f`, ) var ( marshalToml = reflect.TypeOf((*Marshaler)(nil)).Elem() marshalText = reflect.TypeOf((*encoding.TextMarshaler)(nil)).Elem() timeType = reflect.TypeOf((*time.Time)(nil)).Elem() ) // Marshaler is the interface implemented by types that can marshal themselves // into valid TOML. type Marshaler interface { MarshalTOML() ([]byte, error) } // Marshal returns a TOML representation of the Go value. // // See [Encoder] for a description of the encoding process. func Marshal(v any) ([]byte, error) { buff := new(bytes.Buffer) if err := NewEncoder(buff).Encode(v); err != nil { return nil, err } return buff.Bytes(), nil } // Encoder encodes a Go to a TOML document. // // The mapping between Go values and TOML values should be precisely the same as // for [Decode]. // // time.Time is encoded as a RFC 3339 string, and time.Duration as its string // representation. // // The [Marshaler] and [encoding.TextMarshaler] interfaces are supported to // encoding the value as custom TOML. // // If you want to write arbitrary binary data then you will need to use // something like base64 since TOML does not have any binary types. // // When encoding TOML hashes (Go maps or structs), keys without any sub-hashes // are encoded first. // // Go maps will be sorted alphabetically by key for deterministic output. // // The toml struct tag can be used to provide the key name; if omitted the // struct field name will be used. If the "omitempty" option is present the // following value will be skipped: // // - arrays, slices, maps, and string with len of 0 // - struct with all zero values // - bool false // // If omitzero is given all int and float types with a value of 0 will be // skipped. // // Encoding Go values without a corresponding TOML representation will return an // error. Examples of this includes maps with non-string keys, slices with nil // elements, embedded non-struct types, and nested slices containing maps or // structs. (e.g. [][]map[string]string is not allowed but []map[string]string // is okay, as is []map[string][]string). // // NOTE: only exported keys are encoded due to the use of reflection. Unexported // keys are silently discarded. type Encoder struct { Indent string // string for a single indentation level; default is two spaces. hasWritten bool // written any output to w yet? w *bufio.Writer } // NewEncoder create a new Encoder. func NewEncoder(w io.Writer) *Encoder { return &Encoder{w: bufio.NewWriter(w), Indent: " "} } // Encode writes a TOML representation of the Go value to the [Encoder]'s writer. // // An error is returned if the value given cannot be encoded to a valid TOML // document. func (enc *Encoder) Encode(v any) error { rv := eindirect(reflect.ValueOf(v)) err := enc.safeEncode(Key([]string{}), rv) if err != nil { return err } return enc.w.Flush() } func (enc *Encoder) safeEncode(key Key, rv reflect.Value) (err error) { defer func() { if r := recover(); r != nil { if terr, ok := r.(tomlEncodeError); ok { err = terr.error return } panic(r) } }() enc.encode(key, rv) return nil } func (enc *Encoder) encode(key Key, rv reflect.Value) { // If we can marshal the type to text, then we use that. This prevents the // encoder for handling these types as generic structs (or whatever the // underlying type of a TextMarshaler is). switch { case isMarshaler(rv): enc.writeKeyValue(key, rv, false) return case rv.Type() == primitiveType: // TODO: #76 would make this superfluous after implemented. enc.encode(key, reflect.ValueOf(rv.Interface().(Primitive).undecoded)) return } k := rv.Kind() switch k { case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Float32, reflect.Float64, reflect.String, reflect.Bool: enc.writeKeyValue(key, rv, false) case reflect.Array, reflect.Slice: if typeEqual(tomlArrayHash, tomlTypeOfGo(rv)) { enc.eArrayOfTables(key, rv) } else { enc.writeKeyValue(key, rv, false) } case reflect.Interface: if rv.IsNil() { return } enc.encode(key, rv.Elem()) case reflect.Map: if rv.IsNil() { return } enc.eTable(key, rv) case reflect.Ptr: if rv.IsNil() { return } enc.encode(key, rv.Elem()) case reflect.Struct: enc.eTable(key, rv) default: encPanic(fmt.Errorf("unsupported type for key '%s': %s", key, k)) } } // eElement encodes any value that can be an array element. func (enc *Encoder) eElement(rv reflect.Value) { switch v := rv.Interface().(type) { case time.Time: // Using TextMarshaler adds extra quotes, which we don't want. format := time.RFC3339Nano switch v.Location() { case internal.LocalDatetime: format = "2006-01-02T15:04:05.999999999" case internal.LocalDate: format = "2006-01-02" case internal.LocalTime: format = "15:04:05.999999999" } switch v.Location() { default: enc.write(v.Format(format)) case internal.LocalDatetime, internal.LocalDate, internal.LocalTime: enc.write(v.In(time.UTC).Format(format)) } return case Marshaler: s, err := v.MarshalTOML() if err != nil { encPanic(err) } if s == nil { encPanic(errors.New("MarshalTOML returned nil and no error")) } enc.w.Write(s) return case encoding.TextMarshaler: s, err := v.MarshalText() if err != nil { encPanic(err) } if s == nil { encPanic(errors.New("MarshalText returned nil and no error")) } enc.writeQuoted(string(s)) return case time.Duration: enc.writeQuoted(v.String()) return case json.Number: n, _ := rv.Interface().(json.Number) if n == "" { /// Useful zero value. enc.w.WriteByte('0') return } else if v, err := n.Int64(); err == nil { enc.eElement(reflect.ValueOf(v)) return } else if v, err := n.Float64(); err == nil { enc.eElement(reflect.ValueOf(v)) return } encPanic(fmt.Errorf("unable to convert %q to int64 or float64", n)) } switch rv.Kind() { case reflect.Ptr: enc.eElement(rv.Elem()) return case reflect.String: enc.writeQuoted(rv.String()) case reflect.Bool: enc.write(strconv.FormatBool(rv.Bool())) case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: enc.write(strconv.FormatInt(rv.Int(), 10)) case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: enc.write(strconv.FormatUint(rv.Uint(), 10)) case reflect.Float32: f := rv.Float() if math.IsNaN(f) { if math.Signbit(f) { enc.write("-") } enc.write("nan") } else if math.IsInf(f, 0) { if math.Signbit(f) { enc.write("-") } enc.write("inf") } else { enc.write(floatAddDecimal(strconv.FormatFloat(f, 'g', -1, 32))) } case reflect.Float64: f := rv.Float() if math.IsNaN(f) { if math.Signbit(f) { enc.write("-") } enc.write("nan") } else if math.IsInf(f, 0) { if math.Signbit(f) { enc.write("-") } enc.write("inf") } else { enc.write(floatAddDecimal(strconv.FormatFloat(f, 'g', -1, 64))) } case reflect.Array, reflect.Slice: enc.eArrayOrSliceElement(rv) case reflect.Struct: enc.eStruct(nil, rv, true) case reflect.Map: enc.eMap(nil, rv, true) case reflect.Interface: enc.eElement(rv.Elem()) default: encPanic(fmt.Errorf("unexpected type: %s", fmtType(rv.Interface()))) } } // By the TOML spec, all floats must have a decimal with at least one number on // either side. func floatAddDecimal(fstr string) string { for _, c := range fstr { if c == 'e' { // Exponent syntax return fstr } if c == '.' { return fstr } } return fstr + ".0" } func (enc *Encoder) writeQuoted(s string) { enc.write(`"` + dblQuotedReplacer.Replace(s) + `"`) } func (enc *Encoder) eArrayOrSliceElement(rv reflect.Value) { length := rv.Len() enc.write("[") for i := 0; i < length; i++ { elem := eindirect(rv.Index(i)) enc.eElement(elem) if i != length-1 { enc.write(", ") } } enc.write("]") } func (enc *Encoder) eArrayOfTables(key Key, rv reflect.Value) { if len(key) == 0 { encPanic(errNoKey) } for i := 0; i < rv.Len(); i++ { trv := eindirect(rv.Index(i)) if isNil(trv) { continue } enc.newline() enc.writef("%s[[%s]]", enc.indentStr(key), key) enc.newline() enc.eMapOrStruct(key, trv, false) } } func (enc *Encoder) eTable(key Key, rv reflect.Value) { if len(key) == 1 { // Output an extra newline between top-level tables. // (The newline isn't written if nothing else has been written though.) enc.newline() } if len(key) > 0 { enc.writef("%s[%s]", enc.indentStr(key), key) enc.newline() } enc.eMapOrStruct(key, rv, false) } func (enc *Encoder) eMapOrStruct(key Key, rv reflect.Value, inline bool) { switch rv.Kind() { case reflect.Map: enc.eMap(key, rv, inline) case reflect.Struct: enc.eStruct(key, rv, inline) default: // Should never happen? panic("eTable: unhandled reflect.Value Kind: " + rv.Kind().String()) } } func (enc *Encoder) eMap(key Key, rv reflect.Value, inline bool) { rt := rv.Type() if rt.Key().Kind() != reflect.String { encPanic(errNonString) } // Sort keys so that we have deterministic output. And write keys directly // underneath this key first, before writing sub-structs or sub-maps. var mapKeysDirect, mapKeysSub []reflect.Value for _, mapKey := range rv.MapKeys() { if typeIsTable(tomlTypeOfGo(eindirect(rv.MapIndex(mapKey)))) { mapKeysSub = append(mapKeysSub, mapKey) } else { mapKeysDirect = append(mapKeysDirect, mapKey) } } writeMapKeys := func(mapKeys []reflect.Value, trailC bool) { sort.Slice(mapKeys, func(i, j int) bool { return mapKeys[i].String() < mapKeys[j].String() }) for i, mapKey := range mapKeys { val := eindirect(rv.MapIndex(mapKey)) if isNil(val) { continue } if inline { enc.writeKeyValue(Key{mapKey.String()}, val, true) if trailC || i != len(mapKeys)-1 { enc.write(", ") } } else { enc.encode(key.add(mapKey.String()), val) } } } if inline { enc.write("{") } writeMapKeys(mapKeysDirect, len(mapKeysSub) > 0) writeMapKeys(mapKeysSub, false) if inline { enc.write("}") } } func pointerTo(t reflect.Type) reflect.Type { if t.Kind() == reflect.Ptr { return pointerTo(t.Elem()) } return t } func (enc *Encoder) eStruct(key Key, rv reflect.Value, inline bool) { // Write keys for fields directly under this key first, because if we write // a field that creates a new table then all keys under it will be in that // table (not the one we're writing here). // // Fields is a [][]int: for fieldsDirect this always has one entry (the // struct index). For fieldsSub it contains two entries: the parent field // index from tv, and the field indexes for the fields of the sub. var ( rt = rv.Type() fieldsDirect, fieldsSub [][]int addFields func(rt reflect.Type, rv reflect.Value, start []int) ) addFields = func(rt reflect.Type, rv reflect.Value, start []int) { for i := 0; i < rt.NumField(); i++ { f := rt.Field(i) isEmbed := f.Anonymous && pointerTo(f.Type).Kind() == reflect.Struct if f.PkgPath != "" && !isEmbed { /// Skip unexported fields. continue } opts := getOptions(f.Tag) if opts.skip { continue } frv := eindirect(rv.Field(i)) // Need to make a copy because ... ehm, I don't know why... I guess // allocating a new array can cause it to fail(?) // // Done for: https://github.com/BurntSushi/toml/issues/430 // Previously only on 32bit for: https://github.com/BurntSushi/toml/issues/314 copyStart := make([]int, len(start)) copy(copyStart, start) start = copyStart // Treat anonymous struct fields with tag names as though they are // not anonymous, like encoding/json does. // // Non-struct anonymous fields use the normal encoding logic. if isEmbed { if getOptions(f.Tag).name == "" && frv.Kind() == reflect.Struct { addFields(frv.Type(), frv, append(start, f.Index...)) continue } } if typeIsTable(tomlTypeOfGo(frv)) { fieldsSub = append(fieldsSub, append(start, f.Index...)) } else { fieldsDirect = append(fieldsDirect, append(start, f.Index...)) } } } addFields(rt, rv, nil) writeFields := func(fields [][]int, totalFields int) { for _, fieldIndex := range fields { fieldType := rt.FieldByIndex(fieldIndex) fieldVal := rv.FieldByIndex(fieldIndex) opts := getOptions(fieldType.Tag) if opts.skip { continue } if opts.omitempty && isEmpty(fieldVal) { continue } fieldVal = eindirect(fieldVal) if isNil(fieldVal) { /// Don't write anything for nil fields. continue } keyName := fieldType.Name if opts.name != "" { keyName = opts.name } if opts.omitzero && isZero(fieldVal) { continue } if inline { enc.writeKeyValue(Key{keyName}, fieldVal, true) if fieldIndex[0] != totalFields-1 { enc.write(", ") } } else { enc.encode(key.add(keyName), fieldVal) } } } if inline { enc.write("{") } l := len(fieldsDirect) + len(fieldsSub) writeFields(fieldsDirect, l) writeFields(fieldsSub, l) if inline { enc.write("}") } } // tomlTypeOfGo returns the TOML type name of the Go value's type. // // It is used to determine whether the types of array elements are mixed (which // is forbidden). If the Go value is nil, then it is illegal for it to be an // array element, and valueIsNil is returned as true. // // The type may be `nil`, which means no concrete TOML type could be found. func tomlTypeOfGo(rv reflect.Value) tomlType { if isNil(rv) || !rv.IsValid() { return nil } if rv.Kind() == reflect.Struct { if rv.Type() == timeType { return tomlDatetime } if isMarshaler(rv) { return tomlString } return tomlHash } if isMarshaler(rv) { return tomlString } switch rv.Kind() { case reflect.Bool: return tomlBool case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: return tomlInteger case reflect.Float32, reflect.Float64: return tomlFloat case reflect.Array, reflect.Slice: if isTableArray(rv) { return tomlArrayHash } return tomlArray case reflect.Ptr, reflect.Interface: return tomlTypeOfGo(rv.Elem()) case reflect.String: return tomlString case reflect.Map: return tomlHash default: encPanic(errors.New("unsupported type: " + rv.Kind().String())) panic("unreachable") } } func isMarshaler(rv reflect.Value) bool { return rv.Type().Implements(marshalText) || rv.Type().Implements(marshalToml) } // isTableArray reports if all entries in the array or slice are a table. func isTableArray(arr reflect.Value) bool { if isNil(arr) || !arr.IsValid() || arr.Len() == 0 { return false } ret := true for i := 0; i < arr.Len(); i++ { tt := tomlTypeOfGo(eindirect(arr.Index(i))) // Don't allow nil. if tt == nil { encPanic(errArrayNilElement) } if ret && !typeEqual(tomlHash, tt) { ret = false } } return ret } type tagOptions struct { skip bool // "-" name string omitempty bool omitzero bool } func getOptions(tag reflect.StructTag) tagOptions { t := tag.Get("toml") if t == "-" { return tagOptions{skip: true} } var opts tagOptions parts := strings.Split(t, ",") opts.name = parts[0] for _, s := range parts[1:] { switch s { case "omitempty": opts.omitempty = true case "omitzero": opts.omitzero = true } } return opts } func isZero(rv reflect.Value) bool { switch rv.Kind() { case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: return rv.Int() == 0 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: return rv.Uint() == 0 case reflect.Float32, reflect.Float64: return rv.Float() == 0.0 } return false } func isEmpty(rv reflect.Value) bool { switch rv.Kind() { case reflect.Array, reflect.Slice, reflect.Map, reflect.String: return rv.Len() == 0 case reflect.Struct: if rv.Type().Comparable() { return reflect.Zero(rv.Type()).Interface() == rv.Interface() } // Need to also check if all the fields are empty, otherwise something // like this with uncomparable types will always return true: // // type a struct{ field b } // type b struct{ s []string } // s := a{field: b{s: []string{"AAA"}}} for i := 0; i < rv.NumField(); i++ { if !isEmpty(rv.Field(i)) { return false } } return true case reflect.Bool: return !rv.Bool() case reflect.Ptr: return rv.IsNil() } return false } func (enc *Encoder) newline() { if enc.hasWritten { enc.write("\n") } } // Write a key/value pair: // // key = // // This is also used for "k = v" in inline tables; so something like this will // be written in three calls: // // ┌───────────────────┐ // │ ┌───┐ ┌────┐│ // v v v v vv // key = {k = 1, k2 = 2} func (enc *Encoder) writeKeyValue(key Key, val reflect.Value, inline bool) { /// Marshaler used on top-level document; call eElement() to just call /// Marshal{TOML,Text}. if len(key) == 0 { enc.eElement(val) return } enc.writef("%s%s = ", enc.indentStr(key), key.maybeQuoted(len(key)-1)) enc.eElement(val) if !inline { enc.newline() } } func (enc *Encoder) write(s string) { _, err := enc.w.WriteString(s) if err != nil { encPanic(err) } enc.hasWritten = true } func (enc *Encoder) writef(format string, v ...any) { _, err := fmt.Fprintf(enc.w, format, v...) if err != nil { encPanic(err) } enc.hasWritten = true } func (enc *Encoder) indentStr(key Key) string { return strings.Repeat(enc.Indent, len(key)-1) } func encPanic(err error) { panic(tomlEncodeError{err}) } // Resolve any level of pointers to the actual value (e.g. **string → string). func eindirect(v reflect.Value) reflect.Value { if v.Kind() != reflect.Ptr && v.Kind() != reflect.Interface { if isMarshaler(v) { return v } if v.CanAddr() { /// Special case for marshalers; see #358. if pv := v.Addr(); isMarshaler(pv) { return pv } } return v } if v.IsNil() { return v } return eindirect(v.Elem()) } func isNil(rv reflect.Value) bool { switch rv.Kind() { case reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice: return rv.IsNil() default: return false } } ================================================ FILE: vendor/github.com/BurntSushi/toml/error.go ================================================ package toml import ( "fmt" "strings" ) // ParseError is returned when there is an error parsing the TOML syntax such as // invalid syntax, duplicate keys, etc. // // In addition to the error message itself, you can also print detailed location // information with context by using [ErrorWithPosition]: // // toml: error: Key 'fruit' was already created and cannot be used as an array. // // At line 4, column 2-7: // // 2 | fruit = [] // 3 | // 4 | [[fruit]] # Not allowed // ^^^^^ // // [ErrorWithUsage] can be used to print the above with some more detailed usage // guidance: // // toml: error: newlines not allowed within inline tables // // At line 1, column 18: // // 1 | x = [{ key = 42 # // ^ // // Error help: // // Inline tables must always be on a single line: // // table = {key = 42, second = 43} // // It is invalid to split them over multiple lines like so: // // # INVALID // table = { // key = 42, // second = 43 // } // // Use regular for this: // // [table] // key = 42 // second = 43 type ParseError struct { Message string // Short technical message. Usage string // Longer message with usage guidance; may be blank. Position Position // Position of the error LastKey string // Last parsed key, may be blank. // Line the error occurred. // // Deprecated: use [Position]. Line int err error input string } // Position of an error. type Position struct { Line int // Line number, starting at 1. Col int // Error column, starting at 1. Start int // Start of error, as byte offset starting at 0. Len int // Length of the error in bytes. } func (p Position) withCol(tomlFile string) Position { var ( pos int lines = strings.Split(tomlFile, "\n") ) for i := range lines { ll := len(lines[i]) + 1 // +1 for the removed newline if pos+ll >= p.Start { p.Col = p.Start - pos + 1 if p.Col < 1 { // Should never happen, but just in case. p.Col = 1 } break } pos += ll } return p } func (pe ParseError) Error() string { if pe.LastKey == "" { return fmt.Sprintf("toml: line %d: %s", pe.Position.Line, pe.Message) } return fmt.Sprintf("toml: line %d (last key %q): %s", pe.Position.Line, pe.LastKey, pe.Message) } // ErrorWithPosition returns the error with detailed location context. // // See the documentation on [ParseError]. func (pe ParseError) ErrorWithPosition() string { if pe.input == "" { // Should never happen, but just in case. return pe.Error() } // TODO: don't show control characters as literals? This may not show up // well everywhere. var ( lines = strings.Split(pe.input, "\n") b = new(strings.Builder) ) if pe.Position.Len == 1 { fmt.Fprintf(b, "toml: error: %s\n\nAt line %d, column %d:\n\n", pe.Message, pe.Position.Line, pe.Position.Col) } else { fmt.Fprintf(b, "toml: error: %s\n\nAt line %d, column %d-%d:\n\n", pe.Message, pe.Position.Line, pe.Position.Col, pe.Position.Col+pe.Position.Len-1) } if pe.Position.Line > 2 { fmt.Fprintf(b, "% 7d | %s\n", pe.Position.Line-2, expandTab(lines[pe.Position.Line-3])) } if pe.Position.Line > 1 { fmt.Fprintf(b, "% 7d | %s\n", pe.Position.Line-1, expandTab(lines[pe.Position.Line-2])) } /// Expand tabs, so that the ^^^s are at the correct position, but leave /// "column 10-13" intact. Adjusting this to the visual column would be /// better, but we don't know the tabsize of the user in their editor, which /// can be 8, 4, 2, or something else. We can't know. So leaving it as the /// character index is probably the "most correct". expanded := expandTab(lines[pe.Position.Line-1]) diff := len(expanded) - len(lines[pe.Position.Line-1]) fmt.Fprintf(b, "% 7d | %s\n", pe.Position.Line, expanded) fmt.Fprintf(b, "% 10s%s%s\n", "", strings.Repeat(" ", pe.Position.Col-1+diff), strings.Repeat("^", pe.Position.Len)) return b.String() } // ErrorWithUsage returns the error with detailed location context and usage // guidance. // // See the documentation on [ParseError]. func (pe ParseError) ErrorWithUsage() string { m := pe.ErrorWithPosition() if u, ok := pe.err.(interface{ Usage() string }); ok && u.Usage() != "" { lines := strings.Split(strings.TrimSpace(u.Usage()), "\n") for i := range lines { if lines[i] != "" { lines[i] = " " + lines[i] } } return m + "Error help:\n\n" + strings.Join(lines, "\n") + "\n" } return m } func expandTab(s string) string { var ( b strings.Builder l int fill = func(n int) string { b := make([]byte, n) for i := range b { b[i] = ' ' } return string(b) } ) b.Grow(len(s)) for _, r := range s { switch r { case '\t': tw := 8 - l%8 b.WriteString(fill(tw)) l += tw default: b.WriteRune(r) l += 1 } } return b.String() } type ( errLexControl struct{ r rune } errLexEscape struct{ r rune } errLexUTF8 struct{ b byte } errParseDate struct{ v string } errLexInlineTableNL struct{} errLexStringNL struct{} errParseRange struct { i any // int or float size string // "int64", "uint16", etc. } errUnsafeFloat struct { i interface{} // float32 or float64 size string // "float32" or "float64" } errParseDuration struct{ d string } ) func (e errLexControl) Error() string { return fmt.Sprintf("TOML files cannot contain control characters: '0x%02x'", e.r) } func (e errLexControl) Usage() string { return "" } func (e errLexEscape) Error() string { return fmt.Sprintf(`invalid escape in string '\%c'`, e.r) } func (e errLexEscape) Usage() string { return usageEscape } func (e errLexUTF8) Error() string { return fmt.Sprintf("invalid UTF-8 byte: 0x%02x", e.b) } func (e errLexUTF8) Usage() string { return "" } func (e errParseDate) Error() string { return fmt.Sprintf("invalid datetime: %q", e.v) } func (e errParseDate) Usage() string { return usageDate } func (e errLexInlineTableNL) Error() string { return "newlines not allowed within inline tables" } func (e errLexInlineTableNL) Usage() string { return usageInlineNewline } func (e errLexStringNL) Error() string { return "strings cannot contain newlines" } func (e errLexStringNL) Usage() string { return usageStringNewline } func (e errParseRange) Error() string { return fmt.Sprintf("%v is out of range for %s", e.i, e.size) } func (e errParseRange) Usage() string { return usageIntOverflow } func (e errUnsafeFloat) Error() string { return fmt.Sprintf("%v is out of the safe %s range", e.i, e.size) } func (e errUnsafeFloat) Usage() string { return usageUnsafeFloat } func (e errParseDuration) Error() string { return fmt.Sprintf("invalid duration: %q", e.d) } func (e errParseDuration) Usage() string { return usageDuration } const usageEscape = ` A '\' inside a "-delimited string is interpreted as an escape character. The following escape sequences are supported: \b, \t, \n, \f, \r, \", \\, \uXXXX, and \UXXXXXXXX To prevent a '\' from being recognized as an escape character, use either: - a ' or '''-delimited string; escape characters aren't processed in them; or - write two backslashes to get a single backslash: '\\'. If you're trying to add a Windows path (e.g. "C:\Users\martin") then using '/' instead of '\' will usually also work: "C:/Users/martin". ` const usageInlineNewline = ` Inline tables must always be on a single line: table = {key = 42, second = 43} It is invalid to split them over multiple lines like so: # INVALID table = { key = 42, second = 43 } Use regular for this: [table] key = 42 second = 43 ` const usageStringNewline = ` Strings must always be on a single line, and cannot span more than one line: # INVALID string = "Hello, world!" Instead use """ or ''' to split strings over multiple lines: string = """Hello, world!""" ` const usageIntOverflow = ` This number is too large; this may be an error in the TOML, but it can also be a bug in the program that uses too small of an integer. The maximum and minimum values are: size │ lowest │ highest ───────┼────────────────┼────────────── int8 │ -128 │ 127 int16 │ -32,768 │ 32,767 int32 │ -2,147,483,648 │ 2,147,483,647 int64 │ -9.2 × 10¹⁷ │ 9.2 × 10¹⁷ uint8 │ 0 │ 255 uint16 │ 0 │ 65,535 uint32 │ 0 │ 4,294,967,295 uint64 │ 0 │ 1.8 × 10¹⁸ int refers to int32 on 32-bit systems and int64 on 64-bit systems. ` const usageUnsafeFloat = ` This number is outside of the "safe" range for floating point numbers; whole (non-fractional) numbers outside the below range can not always be represented accurately in a float, leading to some loss of accuracy. Explicitly mark a number as a fractional unit by adding ".0", which will incur some loss of accuracy; for example: f = 2_000_000_000.0 Accuracy ranges: float32 = 16,777,215 float64 = 9,007,199,254,740,991 ` const usageDuration = ` A duration must be as "number", without any spaces. Valid units are: ns nanoseconds (billionth of a second) us, µs microseconds (millionth of a second) ms milliseconds (thousands of a second) s seconds m minutes h hours You can combine multiple units; for example "5m10s" for 5 minutes and 10 seconds. ` const usageDate = ` A TOML datetime must be in one of the following formats: 2006-01-02T15:04:05Z07:00 Date and time, with timezone. 2006-01-02T15:04:05 Date and time, but without timezone. 2006-01-02 Date without a time or timezone. 15:04:05 Just a time, without any timezone. Seconds may optionally have a fraction, up to nanosecond precision: 15:04:05.123 15:04:05.856018510 ` // TOML 1.1: // The seconds part in times is optional, and may be omitted: // 2006-01-02T15:04Z07:00 // 2006-01-02T15:04 // 15:04 ================================================ FILE: vendor/github.com/BurntSushi/toml/internal/tz.go ================================================ package internal import "time" // Timezones used for local datetime, date, and time TOML types. // // The exact way times and dates without a timezone should be interpreted is not // well-defined in the TOML specification and left to the implementation. These // defaults to current local timezone offset of the computer, but this can be // changed by changing these variables before decoding. // // TODO: // Ideally we'd like to offer people the ability to configure the used timezone // by setting Decoder.Timezone and Encoder.Timezone; however, this is a bit // tricky: the reason we use three different variables for this is to support // round-tripping – without these specific TZ names we wouldn't know which // format to use. // // There isn't a good way to encode this right now though, and passing this sort // of information also ties in to various related issues such as string format // encoding, encoding of comments, etc. // // So, for the time being, just put this in internal until we can write a good // comprehensive API for doing all of this. // // The reason they're exported is because they're referred from in e.g. // internal/tag. // // Note that this behaviour is valid according to the TOML spec as the exact // behaviour is left up to implementations. var ( localOffset = func() int { _, o := time.Now().Zone(); return o }() LocalDatetime = time.FixedZone("datetime-local", localOffset) LocalDate = time.FixedZone("date-local", localOffset) LocalTime = time.FixedZone("time-local", localOffset) ) ================================================ FILE: vendor/github.com/BurntSushi/toml/lex.go ================================================ package toml import ( "fmt" "reflect" "runtime" "strings" "unicode" "unicode/utf8" ) type itemType int const ( itemError itemType = iota itemEOF itemText itemString itemStringEsc itemRawString itemMultilineString itemRawMultilineString itemBool itemInteger itemFloat itemDatetime itemArray // the start of an array itemArrayEnd itemTableStart itemTableEnd itemArrayTableStart itemArrayTableEnd itemKeyStart itemKeyEnd itemCommentStart itemInlineTableStart itemInlineTableEnd ) const eof = 0 type stateFn func(lx *lexer) stateFn func (p Position) String() string { return fmt.Sprintf("at line %d; start %d; length %d", p.Line, p.Start, p.Len) } type lexer struct { input string start int pos int line int state stateFn items chan item esc bool // Allow for backing up up to 4 runes. This is necessary because TOML // contains 3-rune tokens (""" and '''). prevWidths [4]int nprev int // how many of prevWidths are in use atEOF bool // If we emit an eof, we can still back up, but it is not OK to call next again. // A stack of state functions used to maintain context. // // The idea is to reuse parts of the state machine in various places. For // example, values can appear at the top level or within arbitrarily nested // arrays. The last state on the stack is used after a value has been lexed. // Similarly for comments. stack []stateFn } type item struct { typ itemType val string err error pos Position } func (lx *lexer) nextItem() item { for { select { case item := <-lx.items: return item default: lx.state = lx.state(lx) //fmt.Printf(" STATE %-24s current: %-10s stack: %s\n", lx.state, lx.current(), lx.stack) } } } func lex(input string) *lexer { lx := &lexer{ input: input, state: lexTop, items: make(chan item, 10), stack: make([]stateFn, 0, 10), line: 1, } return lx } func (lx *lexer) push(state stateFn) { lx.stack = append(lx.stack, state) } func (lx *lexer) pop() stateFn { if len(lx.stack) == 0 { panic("BUG in lexer: no states to pop") } last := lx.stack[len(lx.stack)-1] lx.stack = lx.stack[0 : len(lx.stack)-1] return last } func (lx *lexer) current() string { return lx.input[lx.start:lx.pos] } func (lx lexer) getPos() Position { p := Position{ Line: lx.line, Start: lx.start, Len: lx.pos - lx.start, } if p.Len <= 0 { p.Len = 1 } return p } func (lx *lexer) emit(typ itemType) { // Needed for multiline strings ending with an incomplete UTF-8 sequence. if lx.start > lx.pos { lx.error(errLexUTF8{lx.input[lx.pos]}) return } lx.items <- item{typ: typ, pos: lx.getPos(), val: lx.current()} lx.start = lx.pos } func (lx *lexer) emitTrim(typ itemType) { lx.items <- item{typ: typ, pos: lx.getPos(), val: strings.TrimSpace(lx.current())} lx.start = lx.pos } func (lx *lexer) next() (r rune) { if lx.atEOF { panic("BUG in lexer: next called after EOF") } if lx.pos >= len(lx.input) { lx.atEOF = true return eof } if lx.input[lx.pos] == '\n' { lx.line++ } lx.prevWidths[3] = lx.prevWidths[2] lx.prevWidths[2] = lx.prevWidths[1] lx.prevWidths[1] = lx.prevWidths[0] if lx.nprev < 4 { lx.nprev++ } r, w := utf8.DecodeRuneInString(lx.input[lx.pos:]) if r == utf8.RuneError && w == 1 { lx.error(errLexUTF8{lx.input[lx.pos]}) return utf8.RuneError } // Note: don't use peek() here, as this calls next(). if isControl(r) || (r == '\r' && (len(lx.input)-1 == lx.pos || lx.input[lx.pos+1] != '\n')) { lx.errorControlChar(r) return utf8.RuneError } lx.prevWidths[0] = w lx.pos += w return r } // ignore skips over the pending input before this point. func (lx *lexer) ignore() { lx.start = lx.pos } // backup steps back one rune. Can be called 4 times between calls to next. func (lx *lexer) backup() { if lx.atEOF { lx.atEOF = false return } if lx.nprev < 1 { panic("BUG in lexer: backed up too far") } w := lx.prevWidths[0] lx.prevWidths[0] = lx.prevWidths[1] lx.prevWidths[1] = lx.prevWidths[2] lx.prevWidths[2] = lx.prevWidths[3] lx.nprev-- lx.pos -= w if lx.pos < len(lx.input) && lx.input[lx.pos] == '\n' { lx.line-- } } // accept consumes the next rune if it's equal to `valid`. func (lx *lexer) accept(valid rune) bool { if lx.next() == valid { return true } lx.backup() return false } // peek returns but does not consume the next rune in the input. func (lx *lexer) peek() rune { r := lx.next() lx.backup() return r } // skip ignores all input that matches the given predicate. func (lx *lexer) skip(pred func(rune) bool) { for { r := lx.next() if pred(r) { continue } lx.backup() lx.ignore() return } } // error stops all lexing by emitting an error and returning `nil`. // // Note that any value that is a character is escaped if it's a special // character (newlines, tabs, etc.). func (lx *lexer) error(err error) stateFn { if lx.atEOF { return lx.errorPrevLine(err) } lx.items <- item{typ: itemError, pos: lx.getPos(), err: err} return nil } // errorfPrevline is like error(), but sets the position to the last column of // the previous line. // // This is so that unexpected EOF or NL errors don't show on a new blank line. func (lx *lexer) errorPrevLine(err error) stateFn { pos := lx.getPos() pos.Line-- pos.Len = 1 pos.Start = lx.pos - 1 lx.items <- item{typ: itemError, pos: pos, err: err} return nil } // errorPos is like error(), but allows explicitly setting the position. func (lx *lexer) errorPos(start, length int, err error) stateFn { pos := lx.getPos() pos.Start = start pos.Len = length lx.items <- item{typ: itemError, pos: pos, err: err} return nil } // errorf is like error, and creates a new error. func (lx *lexer) errorf(format string, values ...any) stateFn { if lx.atEOF { pos := lx.getPos() if lx.pos >= 1 && lx.input[lx.pos-1] == '\n' { pos.Line-- } pos.Len = 1 pos.Start = lx.pos - 1 lx.items <- item{typ: itemError, pos: pos, err: fmt.Errorf(format, values...)} return nil } lx.items <- item{typ: itemError, pos: lx.getPos(), err: fmt.Errorf(format, values...)} return nil } func (lx *lexer) errorControlChar(cc rune) stateFn { return lx.errorPos(lx.pos-1, 1, errLexControl{cc}) } // lexTop consumes elements at the top level of TOML data. func lexTop(lx *lexer) stateFn { r := lx.next() if isWhitespace(r) || isNL(r) { return lexSkip(lx, lexTop) } switch r { case '#': lx.push(lexTop) return lexCommentStart case '[': return lexTableStart case eof: if lx.pos > lx.start { // TODO: never reached? I think this can only occur on a bug in the // lexer(?) return lx.errorf("unexpected EOF") } lx.emit(itemEOF) return nil } // At this point, the only valid item can be a key, so we back up // and let the key lexer do the rest. lx.backup() lx.push(lexTopEnd) return lexKeyStart } // lexTopEnd is entered whenever a top-level item has been consumed. (A value // or a table.) It must see only whitespace, and will turn back to lexTop // upon a newline. If it sees EOF, it will quit the lexer successfully. func lexTopEnd(lx *lexer) stateFn { r := lx.next() switch { case r == '#': // a comment will read to a newline for us. lx.push(lexTop) return lexCommentStart case isWhitespace(r): return lexTopEnd case isNL(r): lx.ignore() return lexTop case r == eof: lx.emit(itemEOF) return nil } return lx.errorf("expected a top-level item to end with a newline, comment, or EOF, but got %q instead", r) } // lexTable lexes the beginning of a table. Namely, it makes sure that // it starts with a character other than '.' and ']'. // It assumes that '[' has already been consumed. // It also handles the case that this is an item in an array of tables. // e.g., '[[name]]'. func lexTableStart(lx *lexer) stateFn { if lx.peek() == '[' { lx.next() lx.emit(itemArrayTableStart) lx.push(lexArrayTableEnd) } else { lx.emit(itemTableStart) lx.push(lexTableEnd) } return lexTableNameStart } func lexTableEnd(lx *lexer) stateFn { lx.emit(itemTableEnd) return lexTopEnd } func lexArrayTableEnd(lx *lexer) stateFn { if r := lx.next(); r != ']' { return lx.errorf("expected end of table array name delimiter ']', but got %q instead", r) } lx.emit(itemArrayTableEnd) return lexTopEnd } func lexTableNameStart(lx *lexer) stateFn { lx.skip(isWhitespace) switch r := lx.peek(); { case r == ']' || r == eof: return lx.errorf("unexpected end of table name (table names cannot be empty)") case r == '.': return lx.errorf("unexpected table separator (table names cannot be empty)") case r == '"' || r == '\'': lx.ignore() lx.push(lexTableNameEnd) return lexQuotedName default: lx.push(lexTableNameEnd) return lexBareName } } // lexTableNameEnd reads the end of a piece of a table name, optionally // consuming whitespace. func lexTableNameEnd(lx *lexer) stateFn { lx.skip(isWhitespace) switch r := lx.next(); { case r == '.': lx.ignore() return lexTableNameStart case r == ']': return lx.pop() default: return lx.errorf("expected '.' or ']' to end table name, but got %q instead", r) } } // lexBareName lexes one part of a key or table. // // It assumes that at least one valid character for the table has already been // read. // // Lexes only one part, e.g. only 'a' inside 'a.b'. func lexBareName(lx *lexer) stateFn { r := lx.next() if isBareKeyChar(r) { return lexBareName } lx.backup() lx.emit(itemText) return lx.pop() } // lexQuotedName lexes one part of a quoted key or table name. It assumes that // it starts lexing at the quote itself (" or '). // // Lexes only one part, e.g. only '"a"' inside '"a".b'. func lexQuotedName(lx *lexer) stateFn { r := lx.next() switch { case r == '"': lx.ignore() // ignore the '"' return lexString case r == '\'': lx.ignore() // ignore the "'" return lexRawString // TODO: I don't think any of the below conditions can ever be reached? case isWhitespace(r): return lexSkip(lx, lexValue) case r == eof: return lx.errorf("unexpected EOF; expected value") default: return lx.errorf("expected value but found %q instead", r) } } // lexKeyStart consumes all key parts until a '='. func lexKeyStart(lx *lexer) stateFn { lx.skip(isWhitespace) switch r := lx.peek(); { case r == '=' || r == eof: return lx.errorf("unexpected '=': key name appears blank") case r == '.': return lx.errorf("unexpected '.': keys cannot start with a '.'") case r == '"' || r == '\'': lx.ignore() fallthrough default: // Bare key lx.emit(itemKeyStart) return lexKeyNameStart } } func lexKeyNameStart(lx *lexer) stateFn { lx.skip(isWhitespace) switch r := lx.peek(); { default: lx.push(lexKeyEnd) return lexBareName case r == '"' || r == '\'': lx.ignore() lx.push(lexKeyEnd) return lexQuotedName // TODO: I think these can never be reached? case r == '=' || r == eof: return lx.errorf("unexpected '='") case r == '.': return lx.errorf("unexpected '.'") } } // lexKeyEnd consumes the end of a key and trims whitespace (up to the key // separator). func lexKeyEnd(lx *lexer) stateFn { lx.skip(isWhitespace) switch r := lx.next(); { case isWhitespace(r): return lexSkip(lx, lexKeyEnd) case r == eof: // TODO: never reached return lx.errorf("unexpected EOF; expected key separator '='") case r == '.': lx.ignore() return lexKeyNameStart case r == '=': lx.emit(itemKeyEnd) return lexSkip(lx, lexValue) default: if r == '\n' { return lx.errorPrevLine(fmt.Errorf("expected '.' or '=', but got %q instead", r)) } return lx.errorf("expected '.' or '=', but got %q instead", r) } } // lexValue starts the consumption of a value anywhere a value is expected. // lexValue will ignore whitespace. // After a value is lexed, the last state on the next is popped and returned. func lexValue(lx *lexer) stateFn { // We allow whitespace to precede a value, but NOT newlines. // In array syntax, the array states are responsible for ignoring newlines. r := lx.next() switch { case isWhitespace(r): return lexSkip(lx, lexValue) case isDigit(r): lx.backup() // avoid an extra state and use the same as above return lexNumberOrDateStart } switch r { case '[': lx.ignore() lx.emit(itemArray) return lexArrayValue case '{': lx.ignore() lx.emit(itemInlineTableStart) return lexInlineTableValue case '"': if lx.accept('"') { if lx.accept('"') { lx.ignore() // Ignore """ return lexMultilineString } lx.backup() } lx.ignore() // ignore the '"' return lexString case '\'': if lx.accept('\'') { if lx.accept('\'') { lx.ignore() // Ignore """ return lexMultilineRawString } lx.backup() } lx.ignore() // ignore the "'" return lexRawString case '.': // special error case, be kind to users return lx.errorf("floats must start with a digit, not '.'") case 'i', 'n': if (lx.accept('n') && lx.accept('f')) || (lx.accept('a') && lx.accept('n')) { lx.emit(itemFloat) return lx.pop() } case '-', '+': return lexDecimalNumberStart } if unicode.IsLetter(r) { // Be permissive here; lexBool will give a nice error if the // user wrote something like // x = foo // (i.e. not 'true' or 'false' but is something else word-like.) lx.backup() return lexBool } if r == eof { return lx.errorf("unexpected EOF; expected value") } if r == '\n' { return lx.errorPrevLine(fmt.Errorf("expected value but found %q instead", r)) } return lx.errorf("expected value but found %q instead", r) } // lexArrayValue consumes one value in an array. It assumes that '[' or ',' // have already been consumed. All whitespace and newlines are ignored. func lexArrayValue(lx *lexer) stateFn { r := lx.next() switch { case isWhitespace(r) || isNL(r): return lexSkip(lx, lexArrayValue) case r == '#': lx.push(lexArrayValue) return lexCommentStart case r == ',': return lx.errorf("unexpected comma") case r == ']': return lexArrayEnd } lx.backup() lx.push(lexArrayValueEnd) return lexValue } // lexArrayValueEnd consumes everything between the end of an array value and // the next value (or the end of the array): it ignores whitespace and newlines // and expects either a ',' or a ']'. func lexArrayValueEnd(lx *lexer) stateFn { switch r := lx.next(); { case isWhitespace(r) || isNL(r): return lexSkip(lx, lexArrayValueEnd) case r == '#': lx.push(lexArrayValueEnd) return lexCommentStart case r == ',': lx.ignore() return lexArrayValue // move on to the next value case r == ']': return lexArrayEnd default: return lx.errorf("expected a comma (',') or array terminator (']'), but got %s", runeOrEOF(r)) } } // lexArrayEnd finishes the lexing of an array. // It assumes that a ']' has just been consumed. func lexArrayEnd(lx *lexer) stateFn { lx.ignore() lx.emit(itemArrayEnd) return lx.pop() } // lexInlineTableValue consumes one key/value pair in an inline table. // It assumes that '{' or ',' have already been consumed. Whitespace is ignored. func lexInlineTableValue(lx *lexer) stateFn { r := lx.next() switch { case isWhitespace(r): return lexSkip(lx, lexInlineTableValue) case isNL(r): return lexSkip(lx, lexInlineTableValue) case r == '#': lx.push(lexInlineTableValue) return lexCommentStart case r == ',': return lx.errorf("unexpected comma") case r == '}': return lexInlineTableEnd } lx.backup() lx.push(lexInlineTableValueEnd) return lexKeyStart } // lexInlineTableValueEnd consumes everything between the end of an inline table // key/value pair and the next pair (or the end of the table): // it ignores whitespace and expects either a ',' or a '}'. func lexInlineTableValueEnd(lx *lexer) stateFn { switch r := lx.next(); { case isWhitespace(r): return lexSkip(lx, lexInlineTableValueEnd) case isNL(r): return lexSkip(lx, lexInlineTableValueEnd) case r == '#': lx.push(lexInlineTableValueEnd) return lexCommentStart case r == ',': lx.ignore() lx.skip(isWhitespace) if lx.peek() == '}' { return lexInlineTableValueEnd } return lexInlineTableValue case r == '}': return lexInlineTableEnd default: return lx.errorf("expected a comma or an inline table terminator '}', but got %s instead", runeOrEOF(r)) } } func runeOrEOF(r rune) string { if r == eof { return "end of file" } return "'" + string(r) + "'" } // lexInlineTableEnd finishes the lexing of an inline table. // It assumes that a '}' has just been consumed. func lexInlineTableEnd(lx *lexer) stateFn { lx.ignore() lx.emit(itemInlineTableEnd) return lx.pop() } // lexString consumes the inner contents of a string. It assumes that the // beginning '"' has already been consumed and ignored. func lexString(lx *lexer) stateFn { r := lx.next() switch { case r == eof: return lx.errorf(`unexpected EOF; expected '"'`) case isNL(r): return lx.errorPrevLine(errLexStringNL{}) case r == '\\': lx.push(lexString) return lexStringEscape case r == '"': lx.backup() if lx.esc { lx.esc = false lx.emit(itemStringEsc) } else { lx.emit(itemString) } lx.next() lx.ignore() return lx.pop() } return lexString } // lexMultilineString consumes the inner contents of a string. It assumes that // the beginning '"""' has already been consumed and ignored. func lexMultilineString(lx *lexer) stateFn { r := lx.next() switch r { default: return lexMultilineString case eof: return lx.errorf(`unexpected EOF; expected '"""'`) case '\\': return lexMultilineStringEscape case '"': /// Found " → try to read two more "". if lx.accept('"') { if lx.accept('"') { /// Peek ahead: the string can contain " and "", including at the /// end: """str""""" /// 6 or more at the end, however, is an error. if lx.peek() == '"' { /// Check if we already lexed 5 's; if so we have 6 now, and /// that's just too many man! /// /// Second check is for the edge case: /// /// two quotes allowed. /// vv /// """lol \"""""" /// ^^ ^^^---- closing three /// escaped /// /// But ugly, but it works if strings.HasSuffix(lx.current(), `"""""`) && !strings.HasSuffix(lx.current(), `\"""""`) { return lx.errorf(`unexpected '""""""'`) } lx.backup() lx.backup() return lexMultilineString } lx.backup() /// backup: don't include the """ in the item. lx.backup() lx.backup() lx.esc = false lx.emit(itemMultilineString) lx.next() /// Read over ''' again and discard it. lx.next() lx.next() lx.ignore() return lx.pop() } lx.backup() } return lexMultilineString } } // lexRawString consumes a raw string. Nothing can be escaped in such a string. // It assumes that the beginning "'" has already been consumed and ignored. func lexRawString(lx *lexer) stateFn { r := lx.next() switch { default: return lexRawString case r == eof: return lx.errorf(`unexpected EOF; expected "'"`) case isNL(r): return lx.errorPrevLine(errLexStringNL{}) case r == '\'': lx.backup() lx.emit(itemRawString) lx.next() lx.ignore() return lx.pop() } } // lexMultilineRawString consumes a raw string. Nothing can be escaped in such a // string. It assumes that the beginning triple-' has already been consumed and // ignored. func lexMultilineRawString(lx *lexer) stateFn { r := lx.next() switch r { default: return lexMultilineRawString case eof: return lx.errorf(`unexpected EOF; expected "'''"`) case '\'': /// Found ' → try to read two more ''. if lx.accept('\'') { if lx.accept('\'') { /// Peek ahead: the string can contain ' and '', including at the /// end: '''str''''' /// 6 or more at the end, however, is an error. if lx.peek() == '\'' { /// Check if we already lexed 5 's; if so we have 6 now, and /// that's just too many man! if strings.HasSuffix(lx.current(), "'''''") { return lx.errorf(`unexpected "''''''"`) } lx.backup() lx.backup() return lexMultilineRawString } lx.backup() /// backup: don't include the ''' in the item. lx.backup() lx.backup() lx.emit(itemRawMultilineString) lx.next() /// Read over ''' again and discard it. lx.next() lx.next() lx.ignore() return lx.pop() } lx.backup() } return lexMultilineRawString } } // lexMultilineStringEscape consumes an escaped character. It assumes that the // preceding '\\' has already been consumed. func lexMultilineStringEscape(lx *lexer) stateFn { if isNL(lx.next()) { /// \ escaping newline. return lexMultilineString } lx.backup() lx.push(lexMultilineString) return lexStringEscape(lx) } func lexStringEscape(lx *lexer) stateFn { lx.esc = true r := lx.next() switch r { case 'e': fallthrough case 'b': fallthrough case 't': fallthrough case 'n': fallthrough case 'f': fallthrough case 'r': fallthrough case '"': fallthrough case ' ', '\t': // Inside """ .. """ strings you can use \ to escape newlines, and any // amount of whitespace can be between the \ and \n. fallthrough case '\\': return lx.pop() case 'x': return lexHexEscape case 'u': return lexShortUnicodeEscape case 'U': return lexLongUnicodeEscape } return lx.error(errLexEscape{r}) } func lexHexEscape(lx *lexer) stateFn { var r rune for i := 0; i < 2; i++ { r = lx.next() if !isHex(r) { return lx.errorf(`expected two hexadecimal digits after '\x', but got %q instead`, lx.current()) } } return lx.pop() } func lexShortUnicodeEscape(lx *lexer) stateFn { var r rune for i := 0; i < 4; i++ { r = lx.next() if !isHex(r) { return lx.errorf(`expected four hexadecimal digits after '\u', but got %q instead`, lx.current()) } } return lx.pop() } func lexLongUnicodeEscape(lx *lexer) stateFn { var r rune for i := 0; i < 8; i++ { r = lx.next() if !isHex(r) { return lx.errorf(`expected eight hexadecimal digits after '\U', but got %q instead`, lx.current()) } } return lx.pop() } // lexNumberOrDateStart processes the first character of a value which begins // with a digit. It exists to catch values starting with '0', so that // lexBaseNumberOrDate can differentiate base prefixed integers from other // types. func lexNumberOrDateStart(lx *lexer) stateFn { if lx.next() == '0' { return lexBaseNumberOrDate } return lexNumberOrDate } // lexNumberOrDate consumes either an integer, float or datetime. func lexNumberOrDate(lx *lexer) stateFn { r := lx.next() if isDigit(r) { return lexNumberOrDate } switch r { case '-', ':': return lexDatetime case '_': return lexDecimalNumber case '.', 'e', 'E': return lexFloat } lx.backup() lx.emit(itemInteger) return lx.pop() } // lexDatetime consumes a Datetime, to a first approximation. // The parser validates that it matches one of the accepted formats. func lexDatetime(lx *lexer) stateFn { r := lx.next() if isDigit(r) { return lexDatetime } switch r { case '-', ':', 'T', 't', ' ', '.', 'Z', 'z', '+': return lexDatetime } lx.backup() lx.emitTrim(itemDatetime) return lx.pop() } // lexHexInteger consumes a hexadecimal integer after seeing the '0x' prefix. func lexHexInteger(lx *lexer) stateFn { r := lx.next() if isHex(r) { return lexHexInteger } switch r { case '_': return lexHexInteger } lx.backup() lx.emit(itemInteger) return lx.pop() } // lexOctalInteger consumes an octal integer after seeing the '0o' prefix. func lexOctalInteger(lx *lexer) stateFn { r := lx.next() if isOctal(r) { return lexOctalInteger } switch r { case '_': return lexOctalInteger } lx.backup() lx.emit(itemInteger) return lx.pop() } // lexBinaryInteger consumes a binary integer after seeing the '0b' prefix. func lexBinaryInteger(lx *lexer) stateFn { r := lx.next() if isBinary(r) { return lexBinaryInteger } switch r { case '_': return lexBinaryInteger } lx.backup() lx.emit(itemInteger) return lx.pop() } // lexDecimalNumber consumes a decimal float or integer. func lexDecimalNumber(lx *lexer) stateFn { r := lx.next() if isDigit(r) { return lexDecimalNumber } switch r { case '.', 'e', 'E': return lexFloat case '_': return lexDecimalNumber } lx.backup() lx.emit(itemInteger) return lx.pop() } // lexDecimalNumber consumes the first digit of a number beginning with a sign. // It assumes the sign has already been consumed. Values which start with a sign // are only allowed to be decimal integers or floats. // // The special "nan" and "inf" values are also recognized. func lexDecimalNumberStart(lx *lexer) stateFn { r := lx.next() // Special error cases to give users better error messages switch r { case 'i': if !lx.accept('n') || !lx.accept('f') { return lx.errorf("invalid float: '%s'", lx.current()) } lx.emit(itemFloat) return lx.pop() case 'n': if !lx.accept('a') || !lx.accept('n') { return lx.errorf("invalid float: '%s'", lx.current()) } lx.emit(itemFloat) return lx.pop() case '0': p := lx.peek() switch p { case 'b', 'o', 'x': return lx.errorf("cannot use sign with non-decimal numbers: '%s%c'", lx.current(), p) } case '.': return lx.errorf("floats must start with a digit, not '.'") } if isDigit(r) { return lexDecimalNumber } return lx.errorf("expected a digit but got %q", r) } // lexBaseNumberOrDate differentiates between the possible values which // start with '0'. It assumes that before reaching this state, the initial '0' // has been consumed. func lexBaseNumberOrDate(lx *lexer) stateFn { r := lx.next() // Note: All datetimes start with at least two digits, so we don't // handle date characters (':', '-', etc.) here. if isDigit(r) { return lexNumberOrDate } switch r { case '_': // Can only be decimal, because there can't be an underscore // between the '0' and the base designator, and dates can't // contain underscores. return lexDecimalNumber case '.', 'e', 'E': return lexFloat case 'b': r = lx.peek() if !isBinary(r) { lx.errorf("not a binary number: '%s%c'", lx.current(), r) } return lexBinaryInteger case 'o': r = lx.peek() if !isOctal(r) { lx.errorf("not an octal number: '%s%c'", lx.current(), r) } return lexOctalInteger case 'x': r = lx.peek() if !isHex(r) { lx.errorf("not a hexadecimal number: '%s%c'", lx.current(), r) } return lexHexInteger } lx.backup() lx.emit(itemInteger) return lx.pop() } // lexFloat consumes the elements of a float. It allows any sequence of // float-like characters, so floats emitted by the lexer are only a first // approximation and must be validated by the parser. func lexFloat(lx *lexer) stateFn { r := lx.next() if isDigit(r) { return lexFloat } switch r { case '_', '.', '-', '+', 'e', 'E': return lexFloat } lx.backup() lx.emit(itemFloat) return lx.pop() } // lexBool consumes a bool string: 'true' or 'false. func lexBool(lx *lexer) stateFn { var rs []rune for { r := lx.next() if !unicode.IsLetter(r) { lx.backup() break } rs = append(rs, r) } s := string(rs) switch s { case "true", "false": lx.emit(itemBool) return lx.pop() } return lx.errorf("expected value but found %q instead", s) } // lexCommentStart begins the lexing of a comment. It will emit // itemCommentStart and consume no characters, passing control to lexComment. func lexCommentStart(lx *lexer) stateFn { lx.ignore() lx.emit(itemCommentStart) return lexComment } // lexComment lexes an entire comment. It assumes that '#' has been consumed. // It will consume *up to* the first newline character, and pass control // back to the last state on the stack. func lexComment(lx *lexer) stateFn { switch r := lx.next(); { case isNL(r) || r == eof: lx.backup() lx.emit(itemText) return lx.pop() default: return lexComment } } // lexSkip ignores all slurped input and moves on to the next state. func lexSkip(lx *lexer, nextState stateFn) stateFn { lx.ignore() return nextState } func (s stateFn) String() string { if s == nil { return "" } name := runtime.FuncForPC(reflect.ValueOf(s).Pointer()).Name() if i := strings.LastIndexByte(name, '.'); i > -1 { name = name[i+1:] } return name + "()" } func (itype itemType) String() string { switch itype { case itemError: return "Error" case itemEOF: return "EOF" case itemText: return "Text" case itemString, itemStringEsc, itemRawString, itemMultilineString, itemRawMultilineString: return "String" case itemBool: return "Bool" case itemInteger: return "Integer" case itemFloat: return "Float" case itemDatetime: return "DateTime" case itemArray: return "Array" case itemArrayEnd: return "ArrayEnd" case itemTableStart: return "TableStart" case itemTableEnd: return "TableEnd" case itemArrayTableStart: return "ArrayTableStart" case itemArrayTableEnd: return "ArrayTableEnd" case itemKeyStart: return "KeyStart" case itemKeyEnd: return "KeyEnd" case itemCommentStart: return "CommentStart" case itemInlineTableStart: return "InlineTableStart" case itemInlineTableEnd: return "InlineTableEnd" } panic(fmt.Sprintf("BUG: Unknown type '%d'.", int(itype))) } func (item item) String() string { return fmt.Sprintf("(%s, %s)", item.typ, item.val) } func isWhitespace(r rune) bool { return r == '\t' || r == ' ' } func isNL(r rune) bool { return r == '\n' || r == '\r' } func isControl(r rune) bool { // Control characters except \t, \r, \n switch r { case '\t', '\r', '\n': return false default: return (r >= 0x00 && r <= 0x1f) || r == 0x7f } } func isDigit(r rune) bool { return r >= '0' && r <= '9' } func isBinary(r rune) bool { return r == '0' || r == '1' } func isOctal(r rune) bool { return r >= '0' && r <= '7' } func isHex(r rune) bool { return (r >= '0' && r <= '9') || (r|0x20 >= 'a' && r|0x20 <= 'f') } func isBareKeyChar(r rune) bool { return (r >= 'A' && r <= 'Z') || (r >= 'a' && r <= 'z') || (r >= '0' && r <= '9') || r == '_' || r == '-' } ================================================ FILE: vendor/github.com/BurntSushi/toml/meta.go ================================================ package toml import ( "strings" ) // MetaData allows access to meta information about TOML data that's not // accessible otherwise. // // It allows checking if a key is defined in the TOML data, whether any keys // were undecoded, and the TOML type of a key. type MetaData struct { context Key // Used only during decoding. keyInfo map[string]keyInfo mapping map[string]any keys []Key decoded map[string]struct{} data []byte // Input file; for errors. } // IsDefined reports if the key exists in the TOML data. // // The key should be specified hierarchically, for example to access the TOML // key "a.b.c" you would use IsDefined("a", "b", "c"). Keys are case sensitive. // // Returns false for an empty key. func (md *MetaData) IsDefined(key ...string) bool { if len(key) == 0 { return false } var ( hash map[string]any ok bool hashOrVal any = md.mapping ) for _, k := range key { if hash, ok = hashOrVal.(map[string]any); !ok { return false } if hashOrVal, ok = hash[k]; !ok { return false } } return true } // Type returns a string representation of the type of the key specified. // // Type will return the empty string if given an empty key or a key that does // not exist. Keys are case sensitive. func (md *MetaData) Type(key ...string) string { if ki, ok := md.keyInfo[Key(key).String()]; ok { return ki.tomlType.typeString() } return "" } // Keys returns a slice of every key in the TOML data, including key groups. // // Each key is itself a slice, where the first element is the top of the // hierarchy and the last is the most specific. The list will have the same // order as the keys appeared in the TOML data. // // All keys returned are non-empty. func (md *MetaData) Keys() []Key { return md.keys } // Undecoded returns all keys that have not been decoded in the order in which // they appear in the original TOML document. // // This includes keys that haven't been decoded because of a [Primitive] value. // Once the Primitive value is decoded, the keys will be considered decoded. // // Also note that decoding into an empty interface will result in no decoding, // and so no keys will be considered decoded. // // In this sense, the Undecoded keys correspond to keys in the TOML document // that do not have a concrete type in your representation. func (md *MetaData) Undecoded() []Key { undecoded := make([]Key, 0, len(md.keys)) for _, key := range md.keys { if _, ok := md.decoded[key.String()]; !ok { undecoded = append(undecoded, key) } } return undecoded } // Key represents any TOML key, including key groups. Use [MetaData.Keys] to get // values of this type. type Key []string func (k Key) String() string { // This is called quite often, so it's a bit funky to make it faster. var b strings.Builder b.Grow(len(k) * 25) outer: for i, kk := range k { if i > 0 { b.WriteByte('.') } if kk == "" { b.WriteString(`""`) } else { for _, r := range kk { // "Inline" isBareKeyChar if !((r >= 'A' && r <= 'Z') || (r >= 'a' && r <= 'z') || (r >= '0' && r <= '9') || r == '_' || r == '-') { b.WriteByte('"') b.WriteString(dblQuotedReplacer.Replace(kk)) b.WriteByte('"') continue outer } } b.WriteString(kk) } } return b.String() } func (k Key) maybeQuoted(i int) string { if k[i] == "" { return `""` } for _, r := range k[i] { if (r >= 'A' && r <= 'Z') || (r >= 'a' && r <= 'z') || (r >= '0' && r <= '9') || r == '_' || r == '-' { continue } return `"` + dblQuotedReplacer.Replace(k[i]) + `"` } return k[i] } // Like append(), but only increase the cap by 1. func (k Key) add(piece string) Key { newKey := make(Key, len(k)+1) copy(newKey, k) newKey[len(k)] = piece return newKey } func (k Key) parent() Key { return k[:len(k)-1] } // all except the last piece. func (k Key) last() string { return k[len(k)-1] } // last piece of this key. ================================================ FILE: vendor/github.com/BurntSushi/toml/parse.go ================================================ package toml import ( "fmt" "math" "strconv" "strings" "time" "unicode/utf8" "github.com/BurntSushi/toml/internal" ) type parser struct { lx *lexer context Key // Full key for the current hash in scope. currentKey string // Base key name for everything except hashes. pos Position // Current position in the TOML file. ordered []Key // List of keys in the order that they appear in the TOML data. keyInfo map[string]keyInfo // Map keyname → info about the TOML key. mapping map[string]any // Map keyname → key value. implicits map[string]struct{} // Record implicit keys (e.g. "key.group.names"). } type keyInfo struct { pos Position tomlType tomlType } func parse(data string) (p *parser, err error) { defer func() { if r := recover(); r != nil { if pErr, ok := r.(ParseError); ok { pErr.input = data err = pErr return } panic(r) } }() // Read over BOM; do this here as the lexer calls utf8.DecodeRuneInString() // which mangles stuff. UTF-16 BOM isn't strictly valid, but some tools add // it anyway. if strings.HasPrefix(data, "\xff\xfe") || strings.HasPrefix(data, "\xfe\xff") { // UTF-16 data = data[2:] } else if strings.HasPrefix(data, "\xef\xbb\xbf") { // UTF-8 data = data[3:] } // Examine first few bytes for NULL bytes; this probably means it's a UTF-16 // file (second byte in surrogate pair being NULL). Again, do this here to // avoid having to deal with UTF-8/16 stuff in the lexer. ex := 6 if len(data) < 6 { ex = len(data) } if i := strings.IndexRune(data[:ex], 0); i > -1 { return nil, ParseError{ Message: "files cannot contain NULL bytes; probably using UTF-16; TOML files must be UTF-8", Position: Position{Line: 1, Col: 1, Start: i, Len: 1}, Line: 1, input: data, } } p = &parser{ keyInfo: make(map[string]keyInfo), mapping: make(map[string]any), lx: lex(data), ordered: make([]Key, 0), implicits: make(map[string]struct{}), } for { item := p.next() if item.typ == itemEOF { break } p.topLevel(item) } return p, nil } func (p *parser) panicErr(it item, err error) { panic(ParseError{ Message: err.Error(), err: err, Position: it.pos.withCol(p.lx.input), Line: it.pos.Len, LastKey: p.current(), }) } func (p *parser) panicItemf(it item, format string, v ...any) { panic(ParseError{ Message: fmt.Sprintf(format, v...), Position: it.pos.withCol(p.lx.input), Line: it.pos.Len, LastKey: p.current(), }) } func (p *parser) panicf(format string, v ...any) { panic(ParseError{ Message: fmt.Sprintf(format, v...), Position: p.pos.withCol(p.lx.input), Line: p.pos.Line, LastKey: p.current(), }) } func (p *parser) next() item { it := p.lx.nextItem() //fmt.Printf("ITEM %-18s line %-3d │ %q\n", it.typ, it.pos.Line, it.val) if it.typ == itemError { if it.err != nil { panic(ParseError{ Message: it.err.Error(), err: it.err, Position: it.pos.withCol(p.lx.input), Line: it.pos.Line, LastKey: p.current(), }) } p.panicItemf(it, "%s", it.val) } return it } func (p *parser) nextPos() item { it := p.next() p.pos = it.pos return it } func (p *parser) bug(format string, v ...any) { panic(fmt.Sprintf("BUG: "+format+"\n\n", v...)) } func (p *parser) expect(typ itemType) item { it := p.next() p.assertEqual(typ, it.typ) return it } func (p *parser) assertEqual(expected, got itemType) { if expected != got { p.bug("Expected '%s' but got '%s'.", expected, got) } } func (p *parser) topLevel(item item) { switch item.typ { case itemCommentStart: // # .. p.expect(itemText) case itemTableStart: // [ .. ] name := p.nextPos() var key Key for ; name.typ != itemTableEnd && name.typ != itemEOF; name = p.next() { key = append(key, p.keyString(name)) } p.assertEqual(itemTableEnd, name.typ) p.addContext(key, false) p.setType("", tomlHash, item.pos) p.ordered = append(p.ordered, key) case itemArrayTableStart: // [[ .. ]] name := p.nextPos() var key Key for ; name.typ != itemArrayTableEnd && name.typ != itemEOF; name = p.next() { key = append(key, p.keyString(name)) } p.assertEqual(itemArrayTableEnd, name.typ) p.addContext(key, true) p.setType("", tomlArrayHash, item.pos) p.ordered = append(p.ordered, key) case itemKeyStart: // key = .. outerContext := p.context /// Read all the key parts (e.g. 'a' and 'b' in 'a.b') k := p.nextPos() var key Key for ; k.typ != itemKeyEnd && k.typ != itemEOF; k = p.next() { key = append(key, p.keyString(k)) } p.assertEqual(itemKeyEnd, k.typ) /// The current key is the last part. p.currentKey = key.last() /// All the other parts (if any) are the context; need to set each part /// as implicit. context := key.parent() for i := range context { p.addImplicitContext(append(p.context, context[i:i+1]...)) } p.ordered = append(p.ordered, p.context.add(p.currentKey)) /// Set value. vItem := p.next() val, typ := p.value(vItem, false) p.setValue(p.currentKey, val) p.setType(p.currentKey, typ, vItem.pos) /// Remove the context we added (preserving any context from [tbl] lines). p.context = outerContext p.currentKey = "" default: p.bug("Unexpected type at top level: %s", item.typ) } } // Gets a string for a key (or part of a key in a table name). func (p *parser) keyString(it item) string { switch it.typ { case itemText: return it.val case itemString, itemStringEsc, itemMultilineString, itemRawString, itemRawMultilineString: s, _ := p.value(it, false) return s.(string) default: p.bug("Unexpected key type: %s", it.typ) } panic("unreachable") } var datetimeRepl = strings.NewReplacer( "z", "Z", "t", "T", " ", "T") // value translates an expected value from the lexer into a Go value wrapped // as an empty interface. func (p *parser) value(it item, parentIsArray bool) (any, tomlType) { switch it.typ { case itemString: return it.val, p.typeOfPrimitive(it) case itemStringEsc: return p.replaceEscapes(it, it.val), p.typeOfPrimitive(it) case itemMultilineString: return p.replaceEscapes(it, p.stripEscapedNewlines(stripFirstNewline(it.val))), p.typeOfPrimitive(it) case itemRawString: return it.val, p.typeOfPrimitive(it) case itemRawMultilineString: return stripFirstNewline(it.val), p.typeOfPrimitive(it) case itemInteger: return p.valueInteger(it) case itemFloat: return p.valueFloat(it) case itemBool: switch it.val { case "true": return true, p.typeOfPrimitive(it) case "false": return false, p.typeOfPrimitive(it) default: p.bug("Expected boolean value, but got '%s'.", it.val) } case itemDatetime: return p.valueDatetime(it) case itemArray: return p.valueArray(it) case itemInlineTableStart: return p.valueInlineTable(it, parentIsArray) default: p.bug("Unexpected value type: %s", it.typ) } panic("unreachable") } func (p *parser) valueInteger(it item) (any, tomlType) { if !numUnderscoresOK(it.val) { p.panicItemf(it, "Invalid integer %q: underscores must be surrounded by digits", it.val) } if numHasLeadingZero(it.val) { p.panicItemf(it, "Invalid integer %q: cannot have leading zeroes", it.val) } num, err := strconv.ParseInt(it.val, 0, 64) if err != nil { // Distinguish integer values. Normally, it'd be a bug if the lexer // provides an invalid integer, but it's possible that the number is // out of range of valid values (which the lexer cannot determine). // So mark the former as a bug but the latter as a legitimate user // error. if e, ok := err.(*strconv.NumError); ok && e.Err == strconv.ErrRange { p.panicErr(it, errParseRange{i: it.val, size: "int64"}) } else { p.bug("Expected integer value, but got '%s'.", it.val) } } return num, p.typeOfPrimitive(it) } func (p *parser) valueFloat(it item) (any, tomlType) { parts := strings.FieldsFunc(it.val, func(r rune) bool { switch r { case '.', 'e', 'E': return true } return false }) for _, part := range parts { if !numUnderscoresOK(part) { p.panicItemf(it, "Invalid float %q: underscores must be surrounded by digits", it.val) } } if len(parts) > 0 && numHasLeadingZero(parts[0]) { p.panicItemf(it, "Invalid float %q: cannot have leading zeroes", it.val) } if !numPeriodsOK(it.val) { // As a special case, numbers like '123.' or '1.e2', // which are valid as far as Go/strconv are concerned, // must be rejected because TOML says that a fractional // part consists of '.' followed by 1+ digits. p.panicItemf(it, "Invalid float %q: '.' must be followed by one or more digits", it.val) } val := strings.Replace(it.val, "_", "", -1) signbit := false if val == "+nan" || val == "-nan" { signbit = val == "-nan" val = "nan" } num, err := strconv.ParseFloat(val, 64) if err != nil { if e, ok := err.(*strconv.NumError); ok && e.Err == strconv.ErrRange { p.panicErr(it, errParseRange{i: it.val, size: "float64"}) } else { p.panicItemf(it, "Invalid float value: %q", it.val) } } if signbit { num = math.Copysign(num, -1) } return num, p.typeOfPrimitive(it) } var dtTypes = []struct { fmt string zone *time.Location }{ {time.RFC3339Nano, time.Local}, {"2006-01-02T15:04:05.999999999", internal.LocalDatetime}, {"2006-01-02", internal.LocalDate}, {"15:04:05.999999999", internal.LocalTime}, {"2006-01-02T15:04Z07:00", time.Local}, {"2006-01-02T15:04", internal.LocalDatetime}, {"15:04", internal.LocalTime}, } func (p *parser) valueDatetime(it item) (any, tomlType) { it.val = datetimeRepl.Replace(it.val) var ( t time.Time ok bool err error ) for _, dt := range dtTypes { t, err = time.ParseInLocation(dt.fmt, it.val, dt.zone) if err == nil { if missingLeadingZero(it.val, dt.fmt) { p.panicErr(it, errParseDate{it.val}) } ok = true break } } if !ok { p.panicErr(it, errParseDate{it.val}) } return t, p.typeOfPrimitive(it) } // Go's time.Parse() will accept numbers without a leading zero; there isn't any // way to require it. https://github.com/golang/go/issues/29911 // // Depend on the fact that the separators (- and :) should always be at the same // location. func missingLeadingZero(d, l string) bool { for i, c := range []byte(l) { if c == '.' || c == 'Z' { return false } if (c < '0' || c > '9') && d[i] != c { return true } } return false } func (p *parser) valueArray(it item) (any, tomlType) { p.setType(p.currentKey, tomlArray, it.pos) var ( // Initialize to a non-nil slice to make it consistent with how S = [] // decodes into a non-nil slice inside something like struct { S // []string }. See #338 array = make([]any, 0, 2) ) for it = p.next(); it.typ != itemArrayEnd; it = p.next() { if it.typ == itemCommentStart { p.expect(itemText) continue } val, typ := p.value(it, true) array = append(array, val) // XXX: type isn't used here, we need it to record the accurate type // information. // // Not entirely sure how to best store this; could use "key[0]", // "key[1]" notation, or maybe store it on the Array type? _ = typ } return array, tomlArray } func (p *parser) valueInlineTable(it item, parentIsArray bool) (any, tomlType) { var ( topHash = make(map[string]any) outerContext = p.context outerKey = p.currentKey ) p.context = append(p.context, p.currentKey) prevContext := p.context p.currentKey = "" p.addImplicit(p.context) p.addContext(p.context, parentIsArray) /// Loop over all table key/value pairs. for it := p.next(); it.typ != itemInlineTableEnd; it = p.next() { if it.typ == itemCommentStart { p.expect(itemText) continue } /// Read all key parts. k := p.nextPos() var key Key for ; k.typ != itemKeyEnd && k.typ != itemEOF; k = p.next() { key = append(key, p.keyString(k)) } p.assertEqual(itemKeyEnd, k.typ) /// The current key is the last part. p.currentKey = key.last() /// All the other parts (if any) are the context; need to set each part /// as implicit. context := key.parent() for i := range context { p.addImplicitContext(append(p.context, context[i:i+1]...)) } p.ordered = append(p.ordered, p.context.add(p.currentKey)) /// Set the value. val, typ := p.value(p.next(), false) p.setValue(p.currentKey, val) p.setType(p.currentKey, typ, it.pos) hash := topHash for _, c := range context { h, ok := hash[c] if !ok { h = make(map[string]any) hash[c] = h } hash, ok = h.(map[string]any) if !ok { p.panicf("%q is not a table", p.context) } } hash[p.currentKey] = val /// Restore context. p.context = prevContext } p.context = outerContext p.currentKey = outerKey return topHash, tomlHash } // numHasLeadingZero checks if this number has leading zeroes, allowing for '0', // +/- signs, and base prefixes. func numHasLeadingZero(s string) bool { if len(s) > 1 && s[0] == '0' && !(s[1] == 'b' || s[1] == 'o' || s[1] == 'x') { // Allow 0b, 0o, 0x return true } if len(s) > 2 && (s[0] == '-' || s[0] == '+') && s[1] == '0' { return true } return false } // numUnderscoresOK checks whether each underscore in s is surrounded by // characters that are not underscores. func numUnderscoresOK(s string) bool { switch s { case "nan", "+nan", "-nan", "inf", "-inf", "+inf": return true } accept := false for _, r := range s { if r == '_' { if !accept { return false } } // isHex is a superset of all the permissible characters surrounding an // underscore. accept = isHex(r) } return accept } // numPeriodsOK checks whether every period in s is followed by a digit. func numPeriodsOK(s string) bool { period := false for _, r := range s { if period && !isDigit(r) { return false } period = r == '.' } return !period } // Set the current context of the parser, where the context is either a hash or // an array of hashes, depending on the value of the `array` parameter. // // Establishing the context also makes sure that the key isn't a duplicate, and // will create implicit hashes automatically. func (p *parser) addContext(key Key, array bool) { /// Always start at the top level and drill down for our context. hashContext := p.mapping keyContext := make(Key, 0, len(key)-1) /// We only need implicit hashes for the parents. for _, k := range key.parent() { _, ok := hashContext[k] keyContext = append(keyContext, k) // No key? Make an implicit hash and move on. if !ok { p.addImplicit(keyContext) hashContext[k] = make(map[string]any) } // If the hash context is actually an array of tables, then set // the hash context to the last element in that array. // // Otherwise, it better be a table, since this MUST be a key group (by // virtue of it not being the last element in a key). switch t := hashContext[k].(type) { case []map[string]any: hashContext = t[len(t)-1] case map[string]any: hashContext = t default: p.panicf("Key '%s' was already created as a hash.", keyContext) } } p.context = keyContext if array { // If this is the first element for this array, then allocate a new // list of tables for it. k := key.last() if _, ok := hashContext[k]; !ok { hashContext[k] = make([]map[string]any, 0, 4) } // Add a new table. But make sure the key hasn't already been used // for something else. if hash, ok := hashContext[k].([]map[string]any); ok { hashContext[k] = append(hash, make(map[string]any)) } else { p.panicf("Key '%s' was already created and cannot be used as an array.", key) } } else { p.setValue(key.last(), make(map[string]any)) } p.context = append(p.context, key.last()) } // setValue sets the given key to the given value in the current context. // It will make sure that the key hasn't already been defined, account for // implicit key groups. func (p *parser) setValue(key string, value any) { var ( tmpHash any ok bool hash = p.mapping keyContext = make(Key, 0, len(p.context)+1) ) for _, k := range p.context { keyContext = append(keyContext, k) if tmpHash, ok = hash[k]; !ok { p.bug("Context for key '%s' has not been established.", keyContext) } switch t := tmpHash.(type) { case []map[string]any: // The context is a table of hashes. Pick the most recent table // defined as the current hash. hash = t[len(t)-1] case map[string]any: hash = t default: p.panicf("Key '%s' has already been defined.", keyContext) } } keyContext = append(keyContext, key) if _, ok := hash[key]; ok { // Normally redefining keys isn't allowed, but the key could have been // defined implicitly and it's allowed to be redefined concretely. (See // the `valid/implicit-and-explicit-after.toml` in toml-test) // // But we have to make sure to stop marking it as an implicit. (So that // another redefinition provokes an error.) // // Note that since it has already been defined (as a hash), we don't // want to overwrite it. So our business is done. if p.isArray(keyContext) { if !p.isImplicit(keyContext) { if _, ok := hash[key]; ok { p.panicf("Key '%s' has already been defined.", keyContext) } } p.removeImplicit(keyContext) hash[key] = value return } if p.isImplicit(keyContext) { p.removeImplicit(keyContext) return } // Otherwise, we have a concrete key trying to override a previous key, // which is *always* wrong. p.panicf("Key '%s' has already been defined.", keyContext) } hash[key] = value } // setType sets the type of a particular value at a given key. It should be // called immediately AFTER setValue. // // Note that if `key` is empty, then the type given will be applied to the // current context (which is either a table or an array of tables). func (p *parser) setType(key string, typ tomlType, pos Position) { keyContext := make(Key, 0, len(p.context)+1) keyContext = append(keyContext, p.context...) if len(key) > 0 { // allow type setting for hashes keyContext = append(keyContext, key) } // Special case to make empty keys ("" = 1) work. // Without it it will set "" rather than `""`. // TODO: why is this needed? And why is this only needed here? if len(keyContext) == 0 { keyContext = Key{""} } p.keyInfo[keyContext.String()] = keyInfo{tomlType: typ, pos: pos} } // Implicit keys need to be created when tables are implied in "a.b.c.d = 1" and // "[a.b.c]" (the "a", "b", and "c" hashes are never created explicitly). func (p *parser) addImplicit(key Key) { p.implicits[key.String()] = struct{}{} } func (p *parser) removeImplicit(key Key) { delete(p.implicits, key.String()) } func (p *parser) isImplicit(key Key) bool { _, ok := p.implicits[key.String()]; return ok } func (p *parser) isArray(key Key) bool { return p.keyInfo[key.String()].tomlType == tomlArray } func (p *parser) addImplicitContext(key Key) { p.addImplicit(key); p.addContext(key, false) } // current returns the full key name of the current context. func (p *parser) current() string { if len(p.currentKey) == 0 { return p.context.String() } if len(p.context) == 0 { return p.currentKey } return fmt.Sprintf("%s.%s", p.context, p.currentKey) } func stripFirstNewline(s string) string { if len(s) > 0 && s[0] == '\n' { return s[1:] } if len(s) > 1 && s[0] == '\r' && s[1] == '\n' { return s[2:] } return s } // stripEscapedNewlines removes whitespace after line-ending backslashes in // multiline strings. // // A line-ending backslash is an unescaped \ followed only by whitespace until // the next newline. After a line-ending backslash, all whitespace is removed // until the next non-whitespace character. func (p *parser) stripEscapedNewlines(s string) string { var ( b strings.Builder i int ) b.Grow(len(s)) for { ix := strings.Index(s[i:], `\`) if ix < 0 { b.WriteString(s) return b.String() } i += ix if len(s) > i+1 && s[i+1] == '\\' { // Escaped backslash. i += 2 continue } // Scan until the next non-whitespace. j := i + 1 whitespaceLoop: for ; j < len(s); j++ { switch s[j] { case ' ', '\t', '\r', '\n': default: break whitespaceLoop } } if j == i+1 { // Not a whitespace escape. i++ continue } if !strings.Contains(s[i:j], "\n") { // This is not a line-ending backslash. (It's a bad escape sequence, // but we can let replaceEscapes catch it.) i++ continue } b.WriteString(s[:i]) s = s[j:] i = 0 } } func (p *parser) replaceEscapes(it item, str string) string { var ( b strings.Builder skip = 0 ) b.Grow(len(str)) for i, c := range str { if skip > 0 { skip-- continue } if c != '\\' { b.WriteRune(c) continue } if i >= len(str) { p.bug("Escape sequence at end of string.") return "" } switch str[i+1] { default: p.bug("Expected valid escape code after \\, but got %q.", str[i+1]) case ' ', '\t': p.panicItemf(it, "invalid escape: '\\%c'", str[i+1]) case 'b': b.WriteByte(0x08) skip = 1 case 't': b.WriteByte(0x09) skip = 1 case 'n': b.WriteByte(0x0a) skip = 1 case 'f': b.WriteByte(0x0c) skip = 1 case 'r': b.WriteByte(0x0d) skip = 1 case 'e': b.WriteByte(0x1b) skip = 1 case '"': b.WriteByte(0x22) skip = 1 case '\\': b.WriteByte(0x5c) skip = 1 // The lexer guarantees the correct number of characters are present; // don't need to check here. case 'x': escaped := p.asciiEscapeToUnicode(it, str[i+2:i+4]) b.WriteRune(escaped) skip = 3 case 'u': escaped := p.asciiEscapeToUnicode(it, str[i+2:i+6]) b.WriteRune(escaped) skip = 5 case 'U': escaped := p.asciiEscapeToUnicode(it, str[i+2:i+10]) b.WriteRune(escaped) skip = 9 } } return b.String() } func (p *parser) asciiEscapeToUnicode(it item, s string) rune { hex, err := strconv.ParseUint(strings.ToLower(s), 16, 32) if err != nil { p.bug("Could not parse '%s' as a hexadecimal number, but the lexer claims it's OK: %s", s, err) } if !utf8.ValidRune(rune(hex)) { p.panicItemf(it, "Escaped character '\\u%s' is not valid UTF-8.", s) } return rune(hex) } ================================================ FILE: vendor/github.com/BurntSushi/toml/type_fields.go ================================================ package toml // Struct field handling is adapted from code in encoding/json: // // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the Go distribution. import ( "reflect" "sort" "sync" ) // A field represents a single field found in a struct. type field struct { name string // the name of the field (`toml` tag included) tag bool // whether field has a `toml` tag index []int // represents the depth of an anonymous field typ reflect.Type // the type of the field } // byName sorts field by name, breaking ties with depth, // then breaking ties with "name came from toml tag", then // breaking ties with index sequence. type byName []field func (x byName) Len() int { return len(x) } func (x byName) Swap(i, j int) { x[i], x[j] = x[j], x[i] } func (x byName) Less(i, j int) bool { if x[i].name != x[j].name { return x[i].name < x[j].name } if len(x[i].index) != len(x[j].index) { return len(x[i].index) < len(x[j].index) } if x[i].tag != x[j].tag { return x[i].tag } return byIndex(x).Less(i, j) } // byIndex sorts field by index sequence. type byIndex []field func (x byIndex) Len() int { return len(x) } func (x byIndex) Swap(i, j int) { x[i], x[j] = x[j], x[i] } func (x byIndex) Less(i, j int) bool { for k, xik := range x[i].index { if k >= len(x[j].index) { return false } if xik != x[j].index[k] { return xik < x[j].index[k] } } return len(x[i].index) < len(x[j].index) } // typeFields returns a list of fields that TOML should recognize for the given // type. The algorithm is breadth-first search over the set of structs to // include - the top struct and then any reachable anonymous structs. func typeFields(t reflect.Type) []field { // Anonymous fields to explore at the current level and the next. current := []field{} next := []field{{typ: t}} // Count of queued names for current level and the next. var count map[reflect.Type]int var nextCount map[reflect.Type]int // Types already visited at an earlier level. visited := map[reflect.Type]bool{} // Fields found. var fields []field for len(next) > 0 { current, next = next, current[:0] count, nextCount = nextCount, map[reflect.Type]int{} for _, f := range current { if visited[f.typ] { continue } visited[f.typ] = true // Scan f.typ for fields to include. for i := 0; i < f.typ.NumField(); i++ { sf := f.typ.Field(i) if sf.PkgPath != "" && !sf.Anonymous { // unexported continue } opts := getOptions(sf.Tag) if opts.skip { continue } index := make([]int, len(f.index)+1) copy(index, f.index) index[len(f.index)] = i ft := sf.Type if ft.Name() == "" && ft.Kind() == reflect.Ptr { // Follow pointer. ft = ft.Elem() } // Record found field and index sequence. if opts.name != "" || !sf.Anonymous || ft.Kind() != reflect.Struct { tagged := opts.name != "" name := opts.name if name == "" { name = sf.Name } fields = append(fields, field{name, tagged, index, ft}) if count[f.typ] > 1 { // If there were multiple instances, add a second, // so that the annihilation code will see a duplicate. // It only cares about the distinction between 1 or 2, // so don't bother generating any more copies. fields = append(fields, fields[len(fields)-1]) } continue } // Record new anonymous struct to explore in next round. nextCount[ft]++ if nextCount[ft] == 1 { f := field{name: ft.Name(), index: index, typ: ft} next = append(next, f) } } } } sort.Sort(byName(fields)) // Delete all fields that are hidden by the Go rules for embedded fields, // except that fields with TOML tags are promoted. // The fields are sorted in primary order of name, secondary order // of field index length. Loop over names; for each name, delete // hidden fields by choosing the one dominant field that survives. out := fields[:0] for advance, i := 0, 0; i < len(fields); i += advance { // One iteration per name. // Find the sequence of fields with the name of this first field. fi := fields[i] name := fi.name for advance = 1; i+advance < len(fields); advance++ { fj := fields[i+advance] if fj.name != name { break } } if advance == 1 { // Only one field with this name out = append(out, fi) continue } dominant, ok := dominantField(fields[i : i+advance]) if ok { out = append(out, dominant) } } fields = out sort.Sort(byIndex(fields)) return fields } // dominantField looks through the fields, all of which are known to // have the same name, to find the single field that dominates the // others using Go's embedding rules, modified by the presence of // TOML tags. If there are multiple top-level fields, the boolean // will be false: This condition is an error in Go and we skip all // the fields. func dominantField(fields []field) (field, bool) { // The fields are sorted in increasing index-length order. The winner // must therefore be one with the shortest index length. Drop all // longer entries, which is easy: just truncate the slice. length := len(fields[0].index) tagged := -1 // Index of first tagged field. for i, f := range fields { if len(f.index) > length { fields = fields[:i] break } if f.tag { if tagged >= 0 { // Multiple tagged fields at the same level: conflict. // Return no field. return field{}, false } tagged = i } } if tagged >= 0 { return fields[tagged], true } // All remaining fields have the same length. If there's more than one, // we have a conflict (two fields named "X" at the same level) and we // return no field. if len(fields) > 1 { return field{}, false } return fields[0], true } var fieldCache struct { sync.RWMutex m map[reflect.Type][]field } // cachedTypeFields is like typeFields but uses a cache to avoid repeated work. func cachedTypeFields(t reflect.Type) []field { fieldCache.RLock() f := fieldCache.m[t] fieldCache.RUnlock() if f != nil { return f } // Compute fields without lock. // Might duplicate effort but won't hold other computations back. f = typeFields(t) if f == nil { f = []field{} } fieldCache.Lock() if fieldCache.m == nil { fieldCache.m = map[reflect.Type][]field{} } fieldCache.m[t] = f fieldCache.Unlock() return f } ================================================ FILE: vendor/github.com/BurntSushi/toml/type_toml.go ================================================ package toml // tomlType represents any Go type that corresponds to a TOML type. // While the first draft of the TOML spec has a simplistic type system that // probably doesn't need this level of sophistication, we seem to be militating // toward adding real composite types. type tomlType interface { typeString() string } // typeEqual accepts any two types and returns true if they are equal. func typeEqual(t1, t2 tomlType) bool { if t1 == nil || t2 == nil { return false } return t1.typeString() == t2.typeString() } func typeIsTable(t tomlType) bool { return typeEqual(t, tomlHash) || typeEqual(t, tomlArrayHash) } type tomlBaseType string func (btype tomlBaseType) typeString() string { return string(btype) } func (btype tomlBaseType) String() string { return btype.typeString() } var ( tomlInteger tomlBaseType = "Integer" tomlFloat tomlBaseType = "Float" tomlDatetime tomlBaseType = "Datetime" tomlString tomlBaseType = "String" tomlBool tomlBaseType = "Bool" tomlArray tomlBaseType = "Array" tomlHash tomlBaseType = "Hash" tomlArrayHash tomlBaseType = "ArrayHash" ) // typeOfPrimitive returns a tomlType of any primitive value in TOML. // Primitive values are: Integer, Float, Datetime, String and Bool. // // Passing a lexer item other than the following will cause a BUG message // to occur: itemString, itemBool, itemInteger, itemFloat, itemDatetime. func (p *parser) typeOfPrimitive(lexItem item) tomlType { switch lexItem.typ { case itemInteger: return tomlInteger case itemFloat: return tomlFloat case itemDatetime: return tomlDatetime case itemString, itemStringEsc: return tomlString case itemMultilineString: return tomlString case itemRawString: return tomlString case itemRawMultilineString: return tomlString case itemBool: return tomlBool } p.bug("Cannot infer primitive type of lex item '%s'.", lexItem) panic("unreachable") } ================================================ FILE: vendor/github.com/Masterminds/semver/v3/.gitignore ================================================ _fuzz/ ================================================ FILE: vendor/github.com/Masterminds/semver/v3/.golangci.yml ================================================ run: deadline: 2m linters: disable-all: true enable: - misspell - govet - staticcheck - errcheck - unparam - ineffassign - nakedret - gocyclo - dupl - goimports - revive - gosec - gosimple - typecheck - unused linters-settings: gofmt: simplify: true dupl: threshold: 600 ================================================ FILE: vendor/github.com/Masterminds/semver/v3/CHANGELOG.md ================================================ # Changelog ## 3.4.0 (2025-06-27) ### Added - #268: Added property to Constraints to include prereleases for Check and Validate ### Changed - #263: Updated Go testing for 1.24, 1.23, and 1.22 - #269: Updated the error message handling for message case and wrapping errors - #266: Restore the ability to have leading 0's when parsing with NewVersion. Opt-out of this by setting CoerceNewVersion to false. ### Fixed - #257: Fixed the CodeQL link (thanks @dmitris) - #262: Restored detailed errors when failed to parse with NewVersion. Opt-out of this by setting DetailedNewVersionErrors to false for faster performance. - #267: Handle pre-releases for an "and" group if one constraint includes them ## 3.3.1 (2024-11-19) ### Fixed - #253: Fix for allowing some version that were invalid ## 3.3.0 (2024-08-27) ### Added - #238: Add LessThanEqual and GreaterThanEqual functions (thanks @grosser) - #213: nil version equality checking (thanks @KnutZuidema) ### Changed - #241: Simplify StrictNewVersion parsing (thanks @grosser) - Testing support up through Go 1.23 - Minimum version set to 1.21 as this is what's tested now - Fuzz testing now supports caching ## 3.2.1 (2023-04-10) ### Changed - #198: Improved testing around pre-release names - #200: Improved code scanning with addition of CodeQL - #201: Testing now includes Go 1.20. Go 1.17 has been dropped - #202: Migrated Fuzz testing to Go built-in Fuzzing. CI runs daily - #203: Docs updated for security details ### Fixed - #199: Fixed issue with range transformations ## 3.2.0 (2022-11-28) ### Added - #190: Added text marshaling and unmarshaling - #167: Added JSON marshalling for constraints (thanks @SimonTheLeg) - #173: Implement encoding.TextMarshaler and encoding.TextUnmarshaler on Version (thanks @MarkRosemaker) - #179: Added New() version constructor (thanks @kazhuravlev) ### Changed - #182/#183: Updated CI testing setup ### Fixed - #186: Fixing issue where validation of constraint section gave false positives - #176: Fix constraints check with *-0 (thanks @mtt0) - #181: Fixed Caret operator (^) gives unexpected results when the minor version in constraint is 0 (thanks @arshchimni) - #161: Fixed godoc (thanks @afirth) ## 3.1.1 (2020-11-23) ### Fixed - #158: Fixed issue with generated regex operation order that could cause problem ## 3.1.0 (2020-04-15) ### Added - #131: Add support for serializing/deserializing SQL (thanks @ryancurrah) ### Changed - #148: More accurate validation messages on constraints ## 3.0.3 (2019-12-13) ### Fixed - #141: Fixed issue with <= comparison ## 3.0.2 (2019-11-14) ### Fixed - #134: Fixed broken constraint checking with ^0.0 (thanks @krmichelos) ## 3.0.1 (2019-09-13) ### Fixed - #125: Fixes issue with module path for v3 ## 3.0.0 (2019-09-12) This is a major release of the semver package which includes API changes. The Go API is compatible with ^1. The Go API was not changed because many people are using `go get` without Go modules for their applications and API breaking changes cause errors which we have or would need to support. The changes in this release are the handling based on the data passed into the functions. These are described in the added and changed sections below. ### Added - StrictNewVersion function. This is similar to NewVersion but will return an error if the version passed in is not a strict semantic version. For example, 1.2.3 would pass but v1.2.3 or 1.2 would fail because they are not strictly speaking semantic versions. This function is faster, performs fewer operations, and uses fewer allocations than NewVersion. - Fuzzing has been performed on NewVersion, StrictNewVersion, and NewConstraint. The Makefile contains the operations used. For more information on you can start on Wikipedia at https://en.wikipedia.org/wiki/Fuzzing - Now using Go modules ### Changed - NewVersion has proper prerelease and metadata validation with error messages to signal an issue with either of them - ^ now operates using a similar set of rules to npm/js and Rust/Cargo. If the version is >=1 the ^ ranges works the same as v1. For major versions of 0 the rules have changed. The minor version is treated as the stable version unless a patch is specified and then it is equivalent to =. One difference from npm/js is that prereleases there are only to a specific version (e.g. 1.2.3). Prereleases here look over multiple versions and follow semantic version ordering rules. This pattern now follows along with the expected and requested handling of this packaged by numerous users. ## 1.5.0 (2019-09-11) ### Added - #103: Add basic fuzzing for `NewVersion()` (thanks @jesse-c) ### Changed - #82: Clarify wildcard meaning in range constraints and update tests for it (thanks @greysteil) - #83: Clarify caret operator range for pre-1.0.0 dependencies (thanks @greysteil) - #72: Adding docs comment pointing to vert for a cli - #71: Update the docs on pre-release comparator handling - #89: Test with new go versions (thanks @thedevsaddam) - #87: Added $ to ValidPrerelease for better validation (thanks @jeremycarroll) ### Fixed - #78: Fix unchecked error in example code (thanks @ravron) - #70: Fix the handling of pre-releases and the 0.0.0 release edge case - #97: Fixed copyright file for proper display on GitHub - #107: Fix handling prerelease when sorting alphanum and num - #109: Fixed where Validate sometimes returns wrong message on error ## 1.4.2 (2018-04-10) ### Changed - #72: Updated the docs to point to vert for a console appliaction - #71: Update the docs on pre-release comparator handling ### Fixed - #70: Fix the handling of pre-releases and the 0.0.0 release edge case ## 1.4.1 (2018-04-02) ### Fixed - Fixed #64: Fix pre-release precedence issue (thanks @uudashr) ## 1.4.0 (2017-10-04) ### Changed - #61: Update NewVersion to parse ints with a 64bit int size (thanks @zknill) ## 1.3.1 (2017-07-10) ### Fixed - Fixed #57: number comparisons in prerelease sometimes inaccurate ## 1.3.0 (2017-05-02) ### Added - #45: Added json (un)marshaling support (thanks @mh-cbon) - Stability marker. See https://masterminds.github.io/stability/ ### Fixed - #51: Fix handling of single digit tilde constraint (thanks @dgodd) ### Changed - #55: The godoc icon moved from png to svg ## 1.2.3 (2017-04-03) ### Fixed - #46: Fixed 0.x.x and 0.0.x in constraints being treated as * ## Release 1.2.2 (2016-12-13) ### Fixed - #34: Fixed issue where hyphen range was not working with pre-release parsing. ## Release 1.2.1 (2016-11-28) ### Fixed - #24: Fixed edge case issue where constraint "> 0" does not handle "0.0.1-alpha" properly. ## Release 1.2.0 (2016-11-04) ### Added - #20: Added MustParse function for versions (thanks @adamreese) - #15: Added increment methods on versions (thanks @mh-cbon) ### Fixed - Issue #21: Per the SemVer spec (section 9) a pre-release is unstable and might not satisfy the intended compatibility. The change here ignores pre-releases on constraint checks (e.g., ~ or ^) when a pre-release is not part of the constraint. For example, `^1.2.3` will ignore pre-releases while `^1.2.3-alpha` will include them. ## Release 1.1.1 (2016-06-30) ### Changed - Issue #9: Speed up version comparison performance (thanks @sdboyer) - Issue #8: Added benchmarks (thanks @sdboyer) - Updated Go Report Card URL to new location - Updated Readme to add code snippet formatting (thanks @mh-cbon) - Updating tagging to v[SemVer] structure for compatibility with other tools. ## Release 1.1.0 (2016-03-11) - Issue #2: Implemented validation to provide reasons a versions failed a constraint. ## Release 1.0.1 (2015-12-31) - Fixed #1: * constraint failing on valid versions. ## Release 1.0.0 (2015-10-20) - Initial release ================================================ FILE: vendor/github.com/Masterminds/semver/v3/LICENSE.txt ================================================ Copyright (C) 2014-2019, Matt Butcher and Matt Farina Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: vendor/github.com/Masterminds/semver/v3/Makefile ================================================ GOPATH=$(shell go env GOPATH) GOLANGCI_LINT=$(GOPATH)/bin/golangci-lint .PHONY: lint lint: $(GOLANGCI_LINT) @echo "==> Linting codebase" @$(GOLANGCI_LINT) run .PHONY: test test: @echo "==> Running tests" GO111MODULE=on go test -v .PHONY: test-cover test-cover: @echo "==> Running Tests with coverage" GO111MODULE=on go test -cover . .PHONY: fuzz fuzz: @echo "==> Running Fuzz Tests" go env GOCACHE go test -fuzz=FuzzNewVersion -fuzztime=15s . go test -fuzz=FuzzStrictNewVersion -fuzztime=15s . go test -fuzz=FuzzNewConstraint -fuzztime=15s . $(GOLANGCI_LINT): # Install golangci-lint. The configuration for it is in the .golangci.yml # file in the root of the repository echo ${GOPATH} curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(GOPATH)/bin v1.56.2 ================================================ FILE: vendor/github.com/Masterminds/semver/v3/README.md ================================================ # SemVer The `semver` package provides the ability to work with [Semantic Versions](http://semver.org) in Go. Specifically it provides the ability to: * Parse semantic versions * Sort semantic versions * Check if a semantic version fits within a set of constraints * Optionally work with a `v` prefix [![Stability: Active](https://masterminds.github.io/stability/active.svg)](https://masterminds.github.io/stability/active.html) [![](https://github.com/Masterminds/semver/workflows/Tests/badge.svg)](https://github.com/Masterminds/semver/actions) [![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/Masterminds/semver/v3) [![Go Report Card](https://goreportcard.com/badge/github.com/Masterminds/semver)](https://goreportcard.com/report/github.com/Masterminds/semver) ## Package Versions Note, import `github.com/Masterminds/semver/v3` to use the latest version. There are three major versions fo the `semver` package. * 3.x.x is the stable and active version. This version is focused on constraint compatibility for range handling in other tools from other languages. It has a similar API to the v1 releases. The development of this version is on the master branch. The documentation for this version is below. * 2.x was developed primarily for [dep](https://github.com/golang/dep). There are no tagged releases and the development was performed by [@sdboyer](https://github.com/sdboyer). There are API breaking changes from v1. This version lives on the [2.x branch](https://github.com/Masterminds/semver/tree/2.x). * 1.x.x is the original release. It is no longer maintained. You should use the v3 release instead. You can read the documentation for the 1.x.x release [here](https://github.com/Masterminds/semver/blob/release-1/README.md). ## Parsing Semantic Versions There are two functions that can parse semantic versions. The `StrictNewVersion` function only parses valid version 2 semantic versions as outlined in the specification. The `NewVersion` function attempts to coerce a version into a semantic version and parse it. For example, if there is a leading v or a version listed without all 3 parts (e.g. `v1.2`) it will attempt to coerce it into a valid semantic version (e.g., 1.2.0). In both cases a `Version` object is returned that can be sorted, compared, and used in constraints. When parsing a version an error is returned if there is an issue parsing the version. For example, v, err := semver.NewVersion("1.2.3-beta.1+build345") The version object has methods to get the parts of the version, compare it to other versions, convert the version back into a string, and get the original string. Getting the original string is useful if the semantic version was coerced into a valid form. There are package level variables that affect how `NewVersion` handles parsing. - `CoerceNewVersion` is `true` by default. When set to `true` it coerces non-compliant versions into SemVer. For example, allowing a leading 0 in a major, minor, or patch part. This enables the use of CalVer in versions even when not compliant with SemVer. When set to `false` less coercion work is done. - `DetailedNewVersionErrors` provides more detailed errors. It only has an affect when `CoerceNewVersion` is set to `false`. When `DetailedNewVersionErrors` is set to `true` it can provide some more insight into why a version is invalid. Setting `DetailedNewVersionErrors` to `false` is faster on performance but provides less detailed error messages if a version fails to parse. ## Sorting Semantic Versions A set of versions can be sorted using the `sort` package from the standard library. For example, ```go raw := []string{"1.2.3", "1.0", "1.3", "2", "0.4.2",} vs := make([]*semver.Version, len(raw)) for i, r := range raw { v, err := semver.NewVersion(r) if err != nil { t.Errorf("Error parsing version: %s", err) } vs[i] = v } sort.Sort(semver.Collection(vs)) ``` ## Checking Version Constraints There are two methods for comparing versions. One uses comparison methods on `Version` instances and the other uses `Constraints`. There are some important differences to notes between these two methods of comparison. 1. When two versions are compared using functions such as `Compare`, `LessThan`, and others it will follow the specification and always include pre-releases within the comparison. It will provide an answer that is valid with the comparison section of the spec at https://semver.org/#spec-item-11 2. When constraint checking is used for checks or validation it will follow a different set of rules that are common for ranges with tools like npm/js and Rust/Cargo. This includes considering pre-releases to be invalid if the ranges does not include one. If you want to have it include pre-releases a simple solution is to include `-0` in your range. 3. Constraint ranges can have some complex rules including the shorthand use of ~ and ^. For more details on those see the options below. There are differences between the two methods or checking versions because the comparison methods on `Version` follow the specification while comparison ranges are not part of the specification. Different packages and tools have taken it upon themselves to come up with range rules. This has resulted in differences. For example, npm/js and Cargo/Rust follow similar patterns while PHP has a different pattern for ^. The comparison features in this package follow the npm/js and Cargo/Rust lead because applications using it have followed similar patters with their versions. Checking a version against version constraints is one of the most featureful parts of the package. ```go c, err := semver.NewConstraint(">= 1.2.3") if err != nil { // Handle constraint not being parsable. } v, err := semver.NewVersion("1.3") if err != nil { // Handle version not being parsable. } // Check if the version meets the constraints. The variable a will be true. a := c.Check(v) ``` ### Basic Comparisons There are two elements to the comparisons. First, a comparison string is a list of space or comma separated AND comparisons. These are then separated by || (OR) comparisons. For example, `">= 1.2 < 3.0.0 || >= 4.2.3"` is looking for a comparison that's greater than or equal to 1.2 and less than 3.0.0 or is greater than or equal to 4.2.3. The basic comparisons are: * `=`: equal (aliased to no operator) * `!=`: not equal * `>`: greater than * `<`: less than * `>=`: greater than or equal to * `<=`: less than or equal to ### Working With Prerelease Versions Pre-releases, for those not familiar with them, are used for software releases prior to stable or generally available releases. Examples of pre-releases include development, alpha, beta, and release candidate releases. A pre-release may be a version such as `1.2.3-beta.1` while the stable release would be `1.2.3`. In the order of precedence, pre-releases come before their associated releases. In this example `1.2.3-beta.1 < 1.2.3`. According to the Semantic Version specification, pre-releases may not be API compliant with their release counterpart. It says, > A pre-release version indicates that the version is unstable and might not satisfy the intended compatibility requirements as denoted by its associated normal version. SemVer's comparisons using constraints without a pre-release comparator will skip pre-release versions. For example, `>=1.2.3` will skip pre-releases when looking at a list of releases while `>=1.2.3-0` will evaluate and find pre-releases. The reason for the `0` as a pre-release version in the example comparison is because pre-releases can only contain ASCII alphanumerics and hyphens (along with `.` separators), per the spec. Sorting happens in ASCII sort order, again per the spec. The lowest character is a `0` in ASCII sort order (see an [ASCII Table](http://www.asciitable.com/)) Understanding ASCII sort ordering is important because A-Z comes before a-z. That means `>=1.2.3-BETA` will return `1.2.3-alpha`. What you might expect from case sensitivity doesn't apply here. This is due to ASCII sort ordering which is what the spec specifies. The `Constraints` instance returned from `semver.NewConstraint()` has a property `IncludePrerelease` that, when set to true, will return prerelease versions when calls to `Check()` and `Validate()` are made. ### Hyphen Range Comparisons There are multiple methods to handle ranges and the first is hyphens ranges. These look like: * `1.2 - 1.4.5` which is equivalent to `>= 1.2 <= 1.4.5` * `2.3.4 - 4.5` which is equivalent to `>= 2.3.4 <= 4.5` Note that `1.2-1.4.5` without whitespace is parsed completely differently; it's parsed as a single constraint `1.2.0` with _prerelease_ `1.4.5`. ### Wildcards In Comparisons The `x`, `X`, and `*` characters can be used as a wildcard character. This works for all comparison operators. When used on the `=` operator it falls back to the patch level comparison (see tilde below). For example, * `1.2.x` is equivalent to `>= 1.2.0, < 1.3.0` * `>= 1.2.x` is equivalent to `>= 1.2.0` * `<= 2.x` is equivalent to `< 3` * `*` is equivalent to `>= 0.0.0` ### Tilde Range Comparisons (Patch) The tilde (`~`) comparison operator is for patch level ranges when a minor version is specified and major level changes when the minor number is missing. For example, * `~1.2.3` is equivalent to `>= 1.2.3, < 1.3.0` * `~1` is equivalent to `>= 1, < 2` * `~2.3` is equivalent to `>= 2.3, < 2.4` * `~1.2.x` is equivalent to `>= 1.2.0, < 1.3.0` * `~1.x` is equivalent to `>= 1, < 2` ### Caret Range Comparisons (Major) The caret (`^`) comparison operator is for major level changes once a stable (1.0.0) release has occurred. Prior to a 1.0.0 release the minor versions acts as the API stability level. This is useful when comparisons of API versions as a major change is API breaking. For example, * `^1.2.3` is equivalent to `>= 1.2.3, < 2.0.0` * `^1.2.x` is equivalent to `>= 1.2.0, < 2.0.0` * `^2.3` is equivalent to `>= 2.3, < 3` * `^2.x` is equivalent to `>= 2.0.0, < 3` * `^0.2.3` is equivalent to `>=0.2.3 <0.3.0` * `^0.2` is equivalent to `>=0.2.0 <0.3.0` * `^0.0.3` is equivalent to `>=0.0.3 <0.0.4` * `^0.0` is equivalent to `>=0.0.0 <0.1.0` * `^0` is equivalent to `>=0.0.0 <1.0.0` ## Validation In addition to testing a version against a constraint, a version can be validated against a constraint. When validation fails a slice of errors containing why a version didn't meet the constraint is returned. For example, ```go c, err := semver.NewConstraint("<= 1.2.3, >= 1.4") if err != nil { // Handle constraint not being parseable. } v, err := semver.NewVersion("1.3") if err != nil { // Handle version not being parseable. } // Validate a version against a constraint. a, msgs := c.Validate(v) // a is false for _, m := range msgs { fmt.Println(m) // Loops over the errors which would read // "1.3 is greater than 1.2.3" // "1.3 is less than 1.4" } ``` ## Contribute If you find an issue or want to contribute please file an [issue](https://github.com/Masterminds/semver/issues) or [create a pull request](https://github.com/Masterminds/semver/pulls). ## Security Security is an important consideration for this project. The project currently uses the following tools to help discover security issues: * [CodeQL](https://codeql.github.com) * [gosec](https://github.com/securego/gosec) * Daily Fuzz testing If you believe you have found a security vulnerability you can privately disclose it through the [GitHub security page](https://github.com/Masterminds/semver/security). ================================================ FILE: vendor/github.com/Masterminds/semver/v3/SECURITY.md ================================================ # Security Policy ## Supported Versions The following versions of semver are currently supported: | Version | Supported | | ------- | ------------------ | | 3.x | :white_check_mark: | | 2.x | :x: | | 1.x | :x: | Fixes are only released for the latest minor version in the form of a patch release. ## Reporting a Vulnerability You can privately disclose a vulnerability through GitHubs [private vulnerability reporting](https://github.com/Masterminds/semver/security/advisories) mechanism. ================================================ FILE: vendor/github.com/Masterminds/semver/v3/collection.go ================================================ package semver // Collection is a collection of Version instances and implements the sort // interface. See the sort package for more details. // https://golang.org/pkg/sort/ type Collection []*Version // Len returns the length of a collection. The number of Version instances // on the slice. func (c Collection) Len() int { return len(c) } // Less is needed for the sort interface to compare two Version objects on the // slice. If checks if one is less than the other. func (c Collection) Less(i, j int) bool { return c[i].LessThan(c[j]) } // Swap is needed for the sort interface to replace the Version objects // at two different positions in the slice. func (c Collection) Swap(i, j int) { c[i], c[j] = c[j], c[i] } ================================================ FILE: vendor/github.com/Masterminds/semver/v3/constraints.go ================================================ package semver import ( "bytes" "errors" "fmt" "regexp" "strings" ) // Constraints is one or more constraint that a semantic version can be // checked against. type Constraints struct { constraints [][]*constraint containsPre []bool // IncludePrerelease specifies if pre-releases should be included in // the results. Note, if a constraint range has a prerelease than // prereleases will be included for that AND group even if this is // set to false. IncludePrerelease bool } // NewConstraint returns a Constraints instance that a Version instance can // be checked against. If there is a parse error it will be returned. func NewConstraint(c string) (*Constraints, error) { // Rewrite - ranges into a comparison operation. c = rewriteRange(c) ors := strings.Split(c, "||") lenors := len(ors) or := make([][]*constraint, lenors) hasPre := make([]bool, lenors) for k, v := range ors { // Validate the segment if !validConstraintRegex.MatchString(v) { return nil, fmt.Errorf("improper constraint: %s", v) } cs := findConstraintRegex.FindAllString(v, -1) if cs == nil { cs = append(cs, v) } result := make([]*constraint, len(cs)) for i, s := range cs { pc, err := parseConstraint(s) if err != nil { return nil, err } // If one of the constraints has a prerelease record this. // This information is used when checking all in an "and" // group to ensure they all check for prereleases. if pc.con.pre != "" { hasPre[k] = true } result[i] = pc } or[k] = result } o := &Constraints{ constraints: or, containsPre: hasPre, } return o, nil } // Check tests if a version satisfies the constraints. func (cs Constraints) Check(v *Version) bool { // TODO(mattfarina): For v4 of this library consolidate the Check and Validate // functions as the underlying functions make that possible now. // loop over the ORs and check the inner ANDs for i, o := range cs.constraints { joy := true for _, c := range o { if check, _ := c.check(v, (cs.IncludePrerelease || cs.containsPre[i])); !check { joy = false break } } if joy { return true } } return false } // Validate checks if a version satisfies a constraint. If not a slice of // reasons for the failure are returned in addition to a bool. func (cs Constraints) Validate(v *Version) (bool, []error) { // loop over the ORs and check the inner ANDs var e []error // Capture the prerelease message only once. When it happens the first time // this var is marked var prerelesase bool for i, o := range cs.constraints { joy := true for _, c := range o { // Before running the check handle the case there the version is // a prerelease and the check is not searching for prereleases. if !(cs.IncludePrerelease || cs.containsPre[i]) && v.pre != "" { if !prerelesase { em := fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v) e = append(e, em) prerelesase = true } joy = false } else { if _, err := c.check(v, (cs.IncludePrerelease || cs.containsPre[i])); err != nil { e = append(e, err) joy = false } } } if joy { return true, []error{} } } return false, e } func (cs Constraints) String() string { buf := make([]string, len(cs.constraints)) var tmp bytes.Buffer for k, v := range cs.constraints { tmp.Reset() vlen := len(v) for kk, c := range v { tmp.WriteString(c.string()) // Space separate the AND conditions if vlen > 1 && kk < vlen-1 { tmp.WriteString(" ") } } buf[k] = tmp.String() } return strings.Join(buf, " || ") } // UnmarshalText implements the encoding.TextUnmarshaler interface. func (cs *Constraints) UnmarshalText(text []byte) error { temp, err := NewConstraint(string(text)) if err != nil { return err } *cs = *temp return nil } // MarshalText implements the encoding.TextMarshaler interface. func (cs Constraints) MarshalText() ([]byte, error) { return []byte(cs.String()), nil } var constraintOps map[string]cfunc var constraintRegex *regexp.Regexp var constraintRangeRegex *regexp.Regexp // Used to find individual constraints within a multi-constraint string var findConstraintRegex *regexp.Regexp // Used to validate an segment of ANDs is valid var validConstraintRegex *regexp.Regexp const cvRegex string = `v?([0-9|x|X|\*]+)(\.[0-9|x|X|\*]+)?(\.[0-9|x|X|\*]+)?` + `(-([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?` + `(\+([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?` func init() { constraintOps = map[string]cfunc{ "": constraintTildeOrEqual, "=": constraintTildeOrEqual, "!=": constraintNotEqual, ">": constraintGreaterThan, "<": constraintLessThan, ">=": constraintGreaterThanEqual, "=>": constraintGreaterThanEqual, "<=": constraintLessThanEqual, "=<": constraintLessThanEqual, "~": constraintTilde, "~>": constraintTilde, "^": constraintCaret, } ops := `=||!=|>|<|>=|=>|<=|=<|~|~>|\^` constraintRegex = regexp.MustCompile(fmt.Sprintf( `^\s*(%s)\s*(%s)\s*$`, ops, cvRegex)) constraintRangeRegex = regexp.MustCompile(fmt.Sprintf( `\s*(%s)\s+-\s+(%s)\s*`, cvRegex, cvRegex)) findConstraintRegex = regexp.MustCompile(fmt.Sprintf( `(%s)\s*(%s)`, ops, cvRegex)) // The first time a constraint shows up will look slightly different from // future times it shows up due to a leading space or comma in a given // string. validConstraintRegex = regexp.MustCompile(fmt.Sprintf( `^(\s*(%s)\s*(%s)\s*)((?:\s+|,\s*)(%s)\s*(%s)\s*)*$`, ops, cvRegex, ops, cvRegex)) } // An individual constraint type constraint struct { // The version used in the constraint check. For example, if a constraint // is '<= 2.0.0' the con a version instance representing 2.0.0. con *Version // The original parsed version (e.g., 4.x from != 4.x) orig string // The original operator for the constraint origfunc string // When an x is used as part of the version (e.g., 1.x) minorDirty bool dirty bool patchDirty bool } // Check if a version meets the constraint func (c *constraint) check(v *Version, includePre bool) (bool, error) { return constraintOps[c.origfunc](v, c, includePre) } // String prints an individual constraint into a string func (c *constraint) string() string { return c.origfunc + c.orig } type cfunc func(v *Version, c *constraint, includePre bool) (bool, error) func parseConstraint(c string) (*constraint, error) { if len(c) > 0 { m := constraintRegex.FindStringSubmatch(c) if m == nil { return nil, fmt.Errorf("improper constraint: %s", c) } cs := &constraint{ orig: m[2], origfunc: m[1], } ver := m[2] minorDirty := false patchDirty := false dirty := false if isX(m[3]) || m[3] == "" { ver = fmt.Sprintf("0.0.0%s", m[6]) dirty = true } else if isX(strings.TrimPrefix(m[4], ".")) || m[4] == "" { minorDirty = true dirty = true ver = fmt.Sprintf("%s.0.0%s", m[3], m[6]) } else if isX(strings.TrimPrefix(m[5], ".")) || m[5] == "" { dirty = true patchDirty = true ver = fmt.Sprintf("%s%s.0%s", m[3], m[4], m[6]) } con, err := NewVersion(ver) if err != nil { // The constraintRegex should catch any regex parsing errors. So, // we should never get here. return nil, errors.New("constraint parser error") } cs.con = con cs.minorDirty = minorDirty cs.patchDirty = patchDirty cs.dirty = dirty return cs, nil } // The rest is the special case where an empty string was passed in which // is equivalent to * or >=0.0.0 con, err := StrictNewVersion("0.0.0") if err != nil { // The constraintRegex should catch any regex parsing errors. So, // we should never get here. return nil, errors.New("constraint parser error") } cs := &constraint{ con: con, orig: c, origfunc: "", minorDirty: false, patchDirty: false, dirty: true, } return cs, nil } // Constraint functions func constraintNotEqual(v *Version, c *constraint, includePre bool) (bool, error) { // The existence of prereleases is checked at the group level and passed in. // Exit early if the version has a prerelease but those are to be ignored. if v.Prerelease() != "" && !includePre { return false, fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v) } if c.dirty { if c.con.Major() != v.Major() { return true, nil } if c.con.Minor() != v.Minor() && !c.minorDirty { return true, nil } else if c.minorDirty { return false, fmt.Errorf("%s is equal to %s", v, c.orig) } else if c.con.Patch() != v.Patch() && !c.patchDirty { return true, nil } else if c.patchDirty { // Need to handle prereleases if present if v.Prerelease() != "" || c.con.Prerelease() != "" { eq := comparePrerelease(v.Prerelease(), c.con.Prerelease()) != 0 if eq { return true, nil } return false, fmt.Errorf("%s is equal to %s", v, c.orig) } return false, fmt.Errorf("%s is equal to %s", v, c.orig) } } eq := v.Equal(c.con) if eq { return false, fmt.Errorf("%s is equal to %s", v, c.orig) } return true, nil } func constraintGreaterThan(v *Version, c *constraint, includePre bool) (bool, error) { // The existence of prereleases is checked at the group level and passed in. // Exit early if the version has a prerelease but those are to be ignored. if v.Prerelease() != "" && !includePre { return false, fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v) } var eq bool if !c.dirty { eq = v.Compare(c.con) == 1 if eq { return true, nil } return false, fmt.Errorf("%s is less than or equal to %s", v, c.orig) } if v.Major() > c.con.Major() { return true, nil } else if v.Major() < c.con.Major() { return false, fmt.Errorf("%s is less than or equal to %s", v, c.orig) } else if c.minorDirty { // This is a range case such as >11. When the version is something like // 11.1.0 is it not > 11. For that we would need 12 or higher return false, fmt.Errorf("%s is less than or equal to %s", v, c.orig) } else if c.patchDirty { // This is for ranges such as >11.1. A version of 11.1.1 is not greater // which one of 11.2.1 is greater eq = v.Minor() > c.con.Minor() if eq { return true, nil } return false, fmt.Errorf("%s is less than or equal to %s", v, c.orig) } // If we have gotten here we are not comparing pre-preleases and can use the // Compare function to accomplish that. eq = v.Compare(c.con) == 1 if eq { return true, nil } return false, fmt.Errorf("%s is less than or equal to %s", v, c.orig) } func constraintLessThan(v *Version, c *constraint, includePre bool) (bool, error) { // The existence of prereleases is checked at the group level and passed in. // Exit early if the version has a prerelease but those are to be ignored. if v.Prerelease() != "" && !includePre { return false, fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v) } eq := v.Compare(c.con) < 0 if eq { return true, nil } return false, fmt.Errorf("%s is greater than or equal to %s", v, c.orig) } func constraintGreaterThanEqual(v *Version, c *constraint, includePre bool) (bool, error) { // The existence of prereleases is checked at the group level and passed in. // Exit early if the version has a prerelease but those are to be ignored. if v.Prerelease() != "" && !includePre { return false, fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v) } eq := v.Compare(c.con) >= 0 if eq { return true, nil } return false, fmt.Errorf("%s is less than %s", v, c.orig) } func constraintLessThanEqual(v *Version, c *constraint, includePre bool) (bool, error) { // The existence of prereleases is checked at the group level and passed in. // Exit early if the version has a prerelease but those are to be ignored. if v.Prerelease() != "" && !includePre { return false, fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v) } var eq bool if !c.dirty { eq = v.Compare(c.con) <= 0 if eq { return true, nil } return false, fmt.Errorf("%s is greater than %s", v, c.orig) } if v.Major() > c.con.Major() { return false, fmt.Errorf("%s is greater than %s", v, c.orig) } else if v.Major() == c.con.Major() && v.Minor() > c.con.Minor() && !c.minorDirty { return false, fmt.Errorf("%s is greater than %s", v, c.orig) } return true, nil } // ~*, ~>* --> >= 0.0.0 (any) // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0, <3.0.0 // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0, <2.1.0 // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0, <1.3.0 // ~1.2.3, ~>1.2.3 --> >=1.2.3, <1.3.0 // ~1.2.0, ~>1.2.0 --> >=1.2.0, <1.3.0 func constraintTilde(v *Version, c *constraint, includePre bool) (bool, error) { // The existence of prereleases is checked at the group level and passed in. // Exit early if the version has a prerelease but those are to be ignored. if v.Prerelease() != "" && !includePre { return false, fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v) } if v.LessThan(c.con) { return false, fmt.Errorf("%s is less than %s", v, c.orig) } // ~0.0.0 is a special case where all constraints are accepted. It's // equivalent to >= 0.0.0. if c.con.Major() == 0 && c.con.Minor() == 0 && c.con.Patch() == 0 && !c.minorDirty && !c.patchDirty { return true, nil } if v.Major() != c.con.Major() { return false, fmt.Errorf("%s does not have same major version as %s", v, c.orig) } if v.Minor() != c.con.Minor() && !c.minorDirty { return false, fmt.Errorf("%s does not have same major and minor version as %s", v, c.orig) } return true, nil } // When there is a .x (dirty) status it automatically opts in to ~. Otherwise // it's a straight = func constraintTildeOrEqual(v *Version, c *constraint, includePre bool) (bool, error) { // The existence of prereleases is checked at the group level and passed in. // Exit early if the version has a prerelease but those are to be ignored. if v.Prerelease() != "" && !includePre { return false, fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v) } if c.dirty { return constraintTilde(v, c, includePre) } eq := v.Equal(c.con) if eq { return true, nil } return false, fmt.Errorf("%s is not equal to %s", v, c.orig) } // ^* --> (any) // ^1.2.3 --> >=1.2.3 <2.0.0 // ^1.2 --> >=1.2.0 <2.0.0 // ^1 --> >=1.0.0 <2.0.0 // ^0.2.3 --> >=0.2.3 <0.3.0 // ^0.2 --> >=0.2.0 <0.3.0 // ^0.0.3 --> >=0.0.3 <0.0.4 // ^0.0 --> >=0.0.0 <0.1.0 // ^0 --> >=0.0.0 <1.0.0 func constraintCaret(v *Version, c *constraint, includePre bool) (bool, error) { // The existence of prereleases is checked at the group level and passed in. // Exit early if the version has a prerelease but those are to be ignored. if v.Prerelease() != "" && !includePre { return false, fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v) } // This less than handles prereleases if v.LessThan(c.con) { return false, fmt.Errorf("%s is less than %s", v, c.orig) } var eq bool // ^ when the major > 0 is >=x.y.z < x+1 if c.con.Major() > 0 || c.minorDirty { // ^ has to be within a major range for > 0. Everything less than was // filtered out with the LessThan call above. This filters out those // that greater but not within the same major range. eq = v.Major() == c.con.Major() if eq { return true, nil } return false, fmt.Errorf("%s does not have same major version as %s", v, c.orig) } // ^ when the major is 0 and minor > 0 is >=0.y.z < 0.y+1 if c.con.Major() == 0 && v.Major() > 0 { return false, fmt.Errorf("%s does not have same major version as %s", v, c.orig) } // If the con Minor is > 0 it is not dirty if c.con.Minor() > 0 || c.patchDirty { eq = v.Minor() == c.con.Minor() if eq { return true, nil } return false, fmt.Errorf("%s does not have same minor version as %s. Expected minor versions to match when constraint major version is 0", v, c.orig) } // ^ when the minor is 0 and minor > 0 is =0.0.z if c.con.Minor() == 0 && v.Minor() > 0 { return false, fmt.Errorf("%s does not have same minor version as %s", v, c.orig) } // At this point the major is 0 and the minor is 0 and not dirty. The patch // is not dirty so we need to check if they are equal. If they are not equal eq = c.con.Patch() == v.Patch() if eq { return true, nil } return false, fmt.Errorf("%s does not equal %s. Expect version and constraint to equal when major and minor versions are 0", v, c.orig) } func isX(x string) bool { switch x { case "x", "*", "X": return true default: return false } } func rewriteRange(i string) string { m := constraintRangeRegex.FindAllStringSubmatch(i, -1) if m == nil { return i } o := i for _, v := range m { t := fmt.Sprintf(">= %s, <= %s ", v[1], v[11]) o = strings.Replace(o, v[0], t, 1) } return o } ================================================ FILE: vendor/github.com/Masterminds/semver/v3/doc.go ================================================ /* Package semver provides the ability to work with Semantic Versions (http://semver.org) in Go. Specifically it provides the ability to: - Parse semantic versions - Sort semantic versions - Check if a semantic version fits within a set of constraints - Optionally work with a `v` prefix # Parsing Semantic Versions There are two functions that can parse semantic versions. The `StrictNewVersion` function only parses valid version 2 semantic versions as outlined in the specification. The `NewVersion` function attempts to coerce a version into a semantic version and parse it. For example, if there is a leading v or a version listed without all 3 parts (e.g. 1.2) it will attempt to coerce it into a valid semantic version (e.g., 1.2.0). In both cases a `Version` object is returned that can be sorted, compared, and used in constraints. When parsing a version an optional error can be returned if there is an issue parsing the version. For example, v, err := semver.NewVersion("1.2.3-beta.1+b345") The version object has methods to get the parts of the version, compare it to other versions, convert the version back into a string, and get the original string. For more details please see the documentation at https://godoc.org/github.com/Masterminds/semver. # Sorting Semantic Versions A set of versions can be sorted using the `sort` package from the standard library. For example, raw := []string{"1.2.3", "1.0", "1.3", "2", "0.4.2",} vs := make([]*semver.Version, len(raw)) for i, r := range raw { v, err := semver.NewVersion(r) if err != nil { t.Errorf("Error parsing version: %s", err) } vs[i] = v } sort.Sort(semver.Collection(vs)) # Checking Version Constraints and Comparing Versions There are two methods for comparing versions. One uses comparison methods on `Version` instances and the other is using Constraints. There are some important differences to notes between these two methods of comparison. 1. When two versions are compared using functions such as `Compare`, `LessThan`, and others it will follow the specification and always include prereleases within the comparison. It will provide an answer valid with the comparison spec section at https://semver.org/#spec-item-11 2. When constraint checking is used for checks or validation it will follow a different set of rules that are common for ranges with tools like npm/js and Rust/Cargo. This includes considering prereleases to be invalid if the ranges does not include on. If you want to have it include pre-releases a simple solution is to include `-0` in your range. 3. Constraint ranges can have some complex rules including the shorthard use of ~ and ^. For more details on those see the options below. There are differences between the two methods or checking versions because the comparison methods on `Version` follow the specification while comparison ranges are not part of the specification. Different packages and tools have taken it upon themselves to come up with range rules. This has resulted in differences. For example, npm/js and Cargo/Rust follow similar patterns which PHP has a different pattern for ^. The comparison features in this package follow the npm/js and Cargo/Rust lead because applications using it have followed similar patters with their versions. Checking a version against version constraints is one of the most featureful parts of the package. c, err := semver.NewConstraint(">= 1.2.3") if err != nil { // Handle constraint not being parsable. } v, err := semver.NewVersion("1.3") if err != nil { // Handle version not being parsable. } // Check if the version meets the constraints. The a variable will be true. a := c.Check(v) # Basic Comparisons There are two elements to the comparisons. First, a comparison string is a list of comma or space separated AND comparisons. These are then separated by || (OR) comparisons. For example, `">= 1.2 < 3.0.0 || >= 4.2.3"` is looking for a comparison that's greater than or equal to 1.2 and less than 3.0.0 or is greater than or equal to 4.2.3. This can also be written as `">= 1.2, < 3.0.0 || >= 4.2.3"` The basic comparisons are: - `=`: equal (aliased to no operator) - `!=`: not equal - `>`: greater than - `<`: less than - `>=`: greater than or equal to - `<=`: less than or equal to # Hyphen Range Comparisons There are multiple methods to handle ranges and the first is hyphens ranges. These look like: - `1.2 - 1.4.5` which is equivalent to `>= 1.2, <= 1.4.5` - `2.3.4 - 4.5` which is equivalent to `>= 2.3.4 <= 4.5` # Wildcards In Comparisons The `x`, `X`, and `*` characters can be used as a wildcard character. This works for all comparison operators. When used on the `=` operator it falls back to the tilde operation. For example, - `1.2.x` is equivalent to `>= 1.2.0 < 1.3.0` - `>= 1.2.x` is equivalent to `>= 1.2.0` - `<= 2.x` is equivalent to `<= 3` - `*` is equivalent to `>= 0.0.0` Tilde Range Comparisons (Patch) The tilde (`~`) comparison operator is for patch level ranges when a minor version is specified and major level changes when the minor number is missing. For example, - `~1.2.3` is equivalent to `>= 1.2.3 < 1.3.0` - `~1` is equivalent to `>= 1, < 2` - `~2.3` is equivalent to `>= 2.3 < 2.4` - `~1.2.x` is equivalent to `>= 1.2.0 < 1.3.0` - `~1.x` is equivalent to `>= 1 < 2` Caret Range Comparisons (Major) The caret (`^`) comparison operator is for major level changes once a stable (1.0.0) release has occurred. Prior to a 1.0.0 release the minor versions acts as the API stability level. This is useful when comparisons of API versions as a major change is API breaking. For example, - `^1.2.3` is equivalent to `>= 1.2.3, < 2.0.0` - `^1.2.x` is equivalent to `>= 1.2.0, < 2.0.0` - `^2.3` is equivalent to `>= 2.3, < 3` - `^2.x` is equivalent to `>= 2.0.0, < 3` - `^0.2.3` is equivalent to `>=0.2.3 <0.3.0` - `^0.2` is equivalent to `>=0.2.0 <0.3.0` - `^0.0.3` is equivalent to `>=0.0.3 <0.0.4` - `^0.0` is equivalent to `>=0.0.0 <0.1.0` - `^0` is equivalent to `>=0.0.0 <1.0.0` # Validation In addition to testing a version against a constraint, a version can be validated against a constraint. When validation fails a slice of errors containing why a version didn't meet the constraint is returned. For example, c, err := semver.NewConstraint("<= 1.2.3, >= 1.4") if err != nil { // Handle constraint not being parseable. } v, _ := semver.NewVersion("1.3") if err != nil { // Handle version not being parseable. } // Validate a version against a constraint. a, msgs := c.Validate(v) // a is false for _, m := range msgs { fmt.Println(m) // Loops over the errors which would read // "1.3 is greater than 1.2.3" // "1.3 is less than 1.4" } */ package semver ================================================ FILE: vendor/github.com/Masterminds/semver/v3/version.go ================================================ package semver import ( "bytes" "database/sql/driver" "encoding/json" "errors" "fmt" "regexp" "strconv" "strings" ) // The compiled version of the regex created at init() is cached here so it // only needs to be created once. var versionRegex *regexp.Regexp var looseVersionRegex *regexp.Regexp // CoerceNewVersion sets if leading 0's are allowd in the version part. Leading 0's are // not allowed in a valid semantic version. When set to true, NewVersion will coerce // leading 0's into a valid version. var CoerceNewVersion = true // DetailedNewVersionErrors specifies if detailed errors are returned from the NewVersion // function. This is used when CoerceNewVersion is set to false. If set to false // ErrInvalidSemVer is returned for an invalid version. This does not apply to // StrictNewVersion. Setting this function to false returns errors more quickly. var DetailedNewVersionErrors = true var ( // ErrInvalidSemVer is returned a version is found to be invalid when // being parsed. ErrInvalidSemVer = errors.New("invalid semantic version") // ErrEmptyString is returned when an empty string is passed in for parsing. ErrEmptyString = errors.New("version string empty") // ErrInvalidCharacters is returned when invalid characters are found as // part of a version ErrInvalidCharacters = errors.New("invalid characters in version") // ErrSegmentStartsZero is returned when a version segment starts with 0. // This is invalid in SemVer. ErrSegmentStartsZero = errors.New("version segment starts with 0") // ErrInvalidMetadata is returned when the metadata is an invalid format ErrInvalidMetadata = errors.New("invalid metadata string") // ErrInvalidPrerelease is returned when the pre-release is an invalid format ErrInvalidPrerelease = errors.New("invalid prerelease string") ) // semVerRegex is the regular expression used to parse a semantic version. // This is not the official regex from the semver spec. It has been modified to allow for loose handling // where versions like 2.1 are detected. const semVerRegex string = `v?(0|[1-9]\d*)(?:\.(0|[1-9]\d*))?(?:\.(0|[1-9]\d*))?` + `(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?` + `(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?` // looseSemVerRegex is a regular expression that lets invalid semver expressions through // with enough detail that certain errors can be checked for. const looseSemVerRegex string = `v?([0-9]+)(\.[0-9]+)?(\.[0-9]+)?` + `(-([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?` + `(\+([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?` // Version represents a single semantic version. type Version struct { major, minor, patch uint64 pre string metadata string original string } func init() { versionRegex = regexp.MustCompile("^" + semVerRegex + "$") looseVersionRegex = regexp.MustCompile("^" + looseSemVerRegex + "$") } const ( num string = "0123456789" allowed string = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-" + num ) // StrictNewVersion parses a given version and returns an instance of Version or // an error if unable to parse the version. Only parses valid semantic versions. // Performs checking that can find errors within the version. // If you want to coerce a version such as 1 or 1.2 and parse it as the 1.x // releases of semver did, use the NewVersion() function. func StrictNewVersion(v string) (*Version, error) { // Parsing here does not use RegEx in order to increase performance and reduce // allocations. if len(v) == 0 { return nil, ErrEmptyString } // Split the parts into [0]major, [1]minor, and [2]patch,prerelease,build parts := strings.SplitN(v, ".", 3) if len(parts) != 3 { return nil, ErrInvalidSemVer } sv := &Version{ original: v, } // Extract build metadata if strings.Contains(parts[2], "+") { extra := strings.SplitN(parts[2], "+", 2) sv.metadata = extra[1] parts[2] = extra[0] if err := validateMetadata(sv.metadata); err != nil { return nil, err } } // Extract build prerelease if strings.Contains(parts[2], "-") { extra := strings.SplitN(parts[2], "-", 2) sv.pre = extra[1] parts[2] = extra[0] if err := validatePrerelease(sv.pre); err != nil { return nil, err } } // Validate the number segments are valid. This includes only having positive // numbers and no leading 0's. for _, p := range parts { if !containsOnly(p, num) { return nil, ErrInvalidCharacters } if len(p) > 1 && p[0] == '0' { return nil, ErrSegmentStartsZero } } // Extract major, minor, and patch var err error sv.major, err = strconv.ParseUint(parts[0], 10, 64) if err != nil { return nil, err } sv.minor, err = strconv.ParseUint(parts[1], 10, 64) if err != nil { return nil, err } sv.patch, err = strconv.ParseUint(parts[2], 10, 64) if err != nil { return nil, err } return sv, nil } // NewVersion parses a given version and returns an instance of Version or // an error if unable to parse the version. If the version is SemVer-ish it // attempts to convert it to SemVer. If you want to validate it was a strict // semantic version at parse time see StrictNewVersion(). func NewVersion(v string) (*Version, error) { if CoerceNewVersion { return coerceNewVersion(v) } m := versionRegex.FindStringSubmatch(v) if m == nil { // Disabling detailed errors is first so that it is in the fast path. if !DetailedNewVersionErrors { return nil, ErrInvalidSemVer } // Check for specific errors with the semver string and return a more detailed // error. m = looseVersionRegex.FindStringSubmatch(v) if m == nil { return nil, ErrInvalidSemVer } err := validateVersion(m) if err != nil { return nil, err } return nil, ErrInvalidSemVer } sv := &Version{ metadata: m[5], pre: m[4], original: v, } var err error sv.major, err = strconv.ParseUint(m[1], 10, 64) if err != nil { return nil, fmt.Errorf("error parsing version segment: %w", err) } if m[2] != "" { sv.minor, err = strconv.ParseUint(m[2], 10, 64) if err != nil { return nil, fmt.Errorf("error parsing version segment: %w", err) } } else { sv.minor = 0 } if m[3] != "" { sv.patch, err = strconv.ParseUint(m[3], 10, 64) if err != nil { return nil, fmt.Errorf("error parsing version segment: %w", err) } } else { sv.patch = 0 } // Perform some basic due diligence on the extra parts to ensure they are // valid. if sv.pre != "" { if err = validatePrerelease(sv.pre); err != nil { return nil, err } } if sv.metadata != "" { if err = validateMetadata(sv.metadata); err != nil { return nil, err } } return sv, nil } func coerceNewVersion(v string) (*Version, error) { m := looseVersionRegex.FindStringSubmatch(v) if m == nil { return nil, ErrInvalidSemVer } sv := &Version{ metadata: m[8], pre: m[5], original: v, } var err error sv.major, err = strconv.ParseUint(m[1], 10, 64) if err != nil { return nil, fmt.Errorf("error parsing version segment: %w", err) } if m[2] != "" { sv.minor, err = strconv.ParseUint(strings.TrimPrefix(m[2], "."), 10, 64) if err != nil { return nil, fmt.Errorf("error parsing version segment: %w", err) } } else { sv.minor = 0 } if m[3] != "" { sv.patch, err = strconv.ParseUint(strings.TrimPrefix(m[3], "."), 10, 64) if err != nil { return nil, fmt.Errorf("error parsing version segment: %w", err) } } else { sv.patch = 0 } // Perform some basic due diligence on the extra parts to ensure they are // valid. if sv.pre != "" { if err = validatePrerelease(sv.pre); err != nil { return nil, err } } if sv.metadata != "" { if err = validateMetadata(sv.metadata); err != nil { return nil, err } } return sv, nil } // New creates a new instance of Version with each of the parts passed in as // arguments instead of parsing a version string. func New(major, minor, patch uint64, pre, metadata string) *Version { v := Version{ major: major, minor: minor, patch: patch, pre: pre, metadata: metadata, original: "", } v.original = v.String() return &v } // MustParse parses a given version and panics on error. func MustParse(v string) *Version { sv, err := NewVersion(v) if err != nil { panic(err) } return sv } // String converts a Version object to a string. // Note, if the original version contained a leading v this version will not. // See the Original() method to retrieve the original value. Semantic Versions // don't contain a leading v per the spec. Instead it's optional on // implementation. func (v Version) String() string { var buf bytes.Buffer fmt.Fprintf(&buf, "%d.%d.%d", v.major, v.minor, v.patch) if v.pre != "" { fmt.Fprintf(&buf, "-%s", v.pre) } if v.metadata != "" { fmt.Fprintf(&buf, "+%s", v.metadata) } return buf.String() } // Original returns the original value passed in to be parsed. func (v *Version) Original() string { return v.original } // Major returns the major version. func (v Version) Major() uint64 { return v.major } // Minor returns the minor version. func (v Version) Minor() uint64 { return v.minor } // Patch returns the patch version. func (v Version) Patch() uint64 { return v.patch } // Prerelease returns the pre-release version. func (v Version) Prerelease() string { return v.pre } // Metadata returns the metadata on the version. func (v Version) Metadata() string { return v.metadata } // originalVPrefix returns the original 'v' prefix if any. func (v Version) originalVPrefix() string { // Note, only lowercase v is supported as a prefix by the parser. if v.original != "" && v.original[:1] == "v" { return v.original[:1] } return "" } // IncPatch produces the next patch version. // If the current version does not have prerelease/metadata information, // it unsets metadata and prerelease values, increments patch number. // If the current version has any of prerelease or metadata information, // it unsets both values and keeps current patch value func (v Version) IncPatch() Version { vNext := v // according to http://semver.org/#spec-item-9 // Pre-release versions have a lower precedence than the associated normal version. // according to http://semver.org/#spec-item-10 // Build metadata SHOULD be ignored when determining version precedence. if v.pre != "" { vNext.metadata = "" vNext.pre = "" } else { vNext.metadata = "" vNext.pre = "" vNext.patch = v.patch + 1 } vNext.original = v.originalVPrefix() + "" + vNext.String() return vNext } // IncMinor produces the next minor version. // Sets patch to 0. // Increments minor number. // Unsets metadata. // Unsets prerelease status. func (v Version) IncMinor() Version { vNext := v vNext.metadata = "" vNext.pre = "" vNext.patch = 0 vNext.minor = v.minor + 1 vNext.original = v.originalVPrefix() + "" + vNext.String() return vNext } // IncMajor produces the next major version. // Sets patch to 0. // Sets minor to 0. // Increments major number. // Unsets metadata. // Unsets prerelease status. func (v Version) IncMajor() Version { vNext := v vNext.metadata = "" vNext.pre = "" vNext.patch = 0 vNext.minor = 0 vNext.major = v.major + 1 vNext.original = v.originalVPrefix() + "" + vNext.String() return vNext } // SetPrerelease defines the prerelease value. // Value must not include the required 'hyphen' prefix. func (v Version) SetPrerelease(prerelease string) (Version, error) { vNext := v if len(prerelease) > 0 { if err := validatePrerelease(prerelease); err != nil { return vNext, err } } vNext.pre = prerelease vNext.original = v.originalVPrefix() + "" + vNext.String() return vNext, nil } // SetMetadata defines metadata value. // Value must not include the required 'plus' prefix. func (v Version) SetMetadata(metadata string) (Version, error) { vNext := v if len(metadata) > 0 { if err := validateMetadata(metadata); err != nil { return vNext, err } } vNext.metadata = metadata vNext.original = v.originalVPrefix() + "" + vNext.String() return vNext, nil } // LessThan tests if one version is less than another one. func (v *Version) LessThan(o *Version) bool { return v.Compare(o) < 0 } // LessThanEqual tests if one version is less or equal than another one. func (v *Version) LessThanEqual(o *Version) bool { return v.Compare(o) <= 0 } // GreaterThan tests if one version is greater than another one. func (v *Version) GreaterThan(o *Version) bool { return v.Compare(o) > 0 } // GreaterThanEqual tests if one version is greater or equal than another one. func (v *Version) GreaterThanEqual(o *Version) bool { return v.Compare(o) >= 0 } // Equal tests if two versions are equal to each other. // Note, versions can be equal with different metadata since metadata // is not considered part of the comparable version. func (v *Version) Equal(o *Version) bool { if v == o { return true } if v == nil || o == nil { return false } return v.Compare(o) == 0 } // Compare compares this version to another one. It returns -1, 0, or 1 if // the version smaller, equal, or larger than the other version. // // Versions are compared by X.Y.Z. Build metadata is ignored. Prerelease is // lower than the version without a prerelease. Compare always takes into account // prereleases. If you want to work with ranges using typical range syntaxes that // skip prereleases if the range is not looking for them use constraints. func (v *Version) Compare(o *Version) int { // Compare the major, minor, and patch version for differences. If a // difference is found return the comparison. if d := compareSegment(v.Major(), o.Major()); d != 0 { return d } if d := compareSegment(v.Minor(), o.Minor()); d != 0 { return d } if d := compareSegment(v.Patch(), o.Patch()); d != 0 { return d } // At this point the major, minor, and patch versions are the same. ps := v.pre po := o.Prerelease() if ps == "" && po == "" { return 0 } if ps == "" { return 1 } if po == "" { return -1 } return comparePrerelease(ps, po) } // UnmarshalJSON implements JSON.Unmarshaler interface. func (v *Version) UnmarshalJSON(b []byte) error { var s string if err := json.Unmarshal(b, &s); err != nil { return err } temp, err := NewVersion(s) if err != nil { return err } v.major = temp.major v.minor = temp.minor v.patch = temp.patch v.pre = temp.pre v.metadata = temp.metadata v.original = temp.original return nil } // MarshalJSON implements JSON.Marshaler interface. func (v Version) MarshalJSON() ([]byte, error) { return json.Marshal(v.String()) } // UnmarshalText implements the encoding.TextUnmarshaler interface. func (v *Version) UnmarshalText(text []byte) error { temp, err := NewVersion(string(text)) if err != nil { return err } *v = *temp return nil } // MarshalText implements the encoding.TextMarshaler interface. func (v Version) MarshalText() ([]byte, error) { return []byte(v.String()), nil } // Scan implements the SQL.Scanner interface. func (v *Version) Scan(value interface{}) error { var s string s, _ = value.(string) temp, err := NewVersion(s) if err != nil { return err } v.major = temp.major v.minor = temp.minor v.patch = temp.patch v.pre = temp.pre v.metadata = temp.metadata v.original = temp.original return nil } // Value implements the Driver.Valuer interface. func (v Version) Value() (driver.Value, error) { return v.String(), nil } func compareSegment(v, o uint64) int { if v < o { return -1 } if v > o { return 1 } return 0 } func comparePrerelease(v, o string) int { // split the prelease versions by their part. The separator, per the spec, // is a . sparts := strings.Split(v, ".") oparts := strings.Split(o, ".") // Find the longer length of the parts to know how many loop iterations to // go through. slen := len(sparts) olen := len(oparts) l := slen if olen > slen { l = olen } // Iterate over each part of the prereleases to compare the differences. for i := 0; i < l; i++ { // Since the lentgh of the parts can be different we need to create // a placeholder. This is to avoid out of bounds issues. stemp := "" if i < slen { stemp = sparts[i] } otemp := "" if i < olen { otemp = oparts[i] } d := comparePrePart(stemp, otemp) if d != 0 { return d } } // Reaching here means two versions are of equal value but have different // metadata (the part following a +). They are not identical in string form // but the version comparison finds them to be equal. return 0 } func comparePrePart(s, o string) int { // Fastpath if they are equal if s == o { return 0 } // When s or o are empty we can use the other in an attempt to determine // the response. if s == "" { if o != "" { return -1 } return 1 } if o == "" { if s != "" { return 1 } return -1 } // When comparing strings "99" is greater than "103". To handle // cases like this we need to detect numbers and compare them. According // to the semver spec, numbers are always positive. If there is a - at the // start like -99 this is to be evaluated as an alphanum. numbers always // have precedence over alphanum. Parsing as Uints because negative numbers // are ignored. oi, n1 := strconv.ParseUint(o, 10, 64) si, n2 := strconv.ParseUint(s, 10, 64) // The case where both are strings compare the strings if n1 != nil && n2 != nil { if s > o { return 1 } return -1 } else if n1 != nil { // o is a string and s is a number return -1 } else if n2 != nil { // s is a string and o is a number return 1 } // Both are numbers if si > oi { return 1 } return -1 } // Like strings.ContainsAny but does an only instead of any. func containsOnly(s string, comp string) bool { return strings.IndexFunc(s, func(r rune) bool { return !strings.ContainsRune(comp, r) }) == -1 } // From the spec, "Identifiers MUST comprise only // ASCII alphanumerics and hyphen [0-9A-Za-z-]. Identifiers MUST NOT be empty. // Numeric identifiers MUST NOT include leading zeroes.". These segments can // be dot separated. func validatePrerelease(p string) error { eparts := strings.Split(p, ".") for _, p := range eparts { if p == "" { return ErrInvalidPrerelease } else if containsOnly(p, num) { if len(p) > 1 && p[0] == '0' { return ErrSegmentStartsZero } } else if !containsOnly(p, allowed) { return ErrInvalidPrerelease } } return nil } // From the spec, "Build metadata MAY be denoted by // appending a plus sign and a series of dot separated identifiers immediately // following the patch or pre-release version. Identifiers MUST comprise only // ASCII alphanumerics and hyphen [0-9A-Za-z-]. Identifiers MUST NOT be empty." func validateMetadata(m string) error { eparts := strings.Split(m, ".") for _, p := range eparts { if p == "" { return ErrInvalidMetadata } else if !containsOnly(p, allowed) { return ErrInvalidMetadata } } return nil } // validateVersion checks for common validation issues but may not catch all errors func validateVersion(m []string) error { var err error var v string if m[1] != "" { if len(m[1]) > 1 && m[1][0] == '0' { return ErrSegmentStartsZero } _, err = strconv.ParseUint(m[1], 10, 64) if err != nil { return fmt.Errorf("error parsing version segment: %w", err) } } if m[2] != "" { v = strings.TrimPrefix(m[2], ".") if len(v) > 1 && v[0] == '0' { return ErrSegmentStartsZero } _, err = strconv.ParseUint(v, 10, 64) if err != nil { return fmt.Errorf("error parsing version segment: %w", err) } } if m[3] != "" { v = strings.TrimPrefix(m[3], ".") if len(v) > 1 && v[0] == '0' { return ErrSegmentStartsZero } _, err = strconv.ParseUint(v, 10, 64) if err != nil { return fmt.Errorf("error parsing version segment: %w", err) } } if m[5] != "" { if err = validatePrerelease(m[5]); err != nil { return err } } if m[8] != "" { if err = validateMetadata(m[8]); err != nil { return err } } return nil } ================================================ FILE: vendor/github.com/Microsoft/go-winio/.gitattributes ================================================ * text=auto eol=lf ================================================ FILE: vendor/github.com/Microsoft/go-winio/.gitignore ================================================ .vscode/ *.exe # testing testdata # go workspaces go.work go.work.sum ================================================ FILE: vendor/github.com/Microsoft/go-winio/.golangci.yml ================================================ linters: enable: # style - containedctx # struct contains a context - dupl # duplicate code - errname # erorrs are named correctly - nolintlint # "//nolint" directives are properly explained - revive # golint replacement - unconvert # unnecessary conversions - wastedassign # bugs, performance, unused, etc ... - contextcheck # function uses a non-inherited context - errorlint # errors not wrapped for 1.13 - exhaustive # check exhaustiveness of enum switch statements - gofmt # files are gofmt'ed - gosec # security - nilerr # returns nil even with non-nil error - thelper # test helpers without t.Helper() - unparam # unused function params issues: exclude-dirs: - pkg/etw/sample exclude-rules: # err is very often shadowed in nested scopes - linters: - govet text: '^shadow: declaration of "err" shadows declaration' # ignore long lines for skip autogen directives - linters: - revive text: "^line-length-limit: " source: "^//(go:generate|sys) " #TODO: remove after upgrading to go1.18 # ignore comment spacing for nolint and sys directives - linters: - revive text: "^comment-spacings: no space between comment delimiter and comment text" source: "//(cspell:|nolint:|sys |todo)" # not on go 1.18 yet, so no any - linters: - revive text: "^use-any: since GO 1.18 'interface{}' can be replaced by 'any'" # allow unjustified ignores of error checks in defer statements - linters: - nolintlint text: "^directive `//nolint:errcheck` should provide explanation" source: '^\s*defer ' # allow unjustified ignores of error lints for io.EOF - linters: - nolintlint text: "^directive `//nolint:errorlint` should provide explanation" source: '[=|!]= io.EOF' linters-settings: exhaustive: default-signifies-exhaustive: true govet: enable-all: true disable: # struct order is often for Win32 compat # also, ignore pointer bytes/GC issues for now until performance becomes an issue - fieldalignment nolintlint: require-explanation: true require-specific: true revive: # revive is more configurable than static check, so likely the preferred alternative to static-check # (once the perf issue is solved: https://github.com/golangci/golangci-lint/issues/2997) enable-all-rules: true # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md rules: # rules with required arguments - name: argument-limit disabled: true - name: banned-characters disabled: true - name: cognitive-complexity disabled: true - name: cyclomatic disabled: true - name: file-header disabled: true - name: function-length disabled: true - name: function-result-limit disabled: true - name: max-public-structs disabled: true # geneally annoying rules - name: add-constant # complains about any and all strings and integers disabled: true - name: confusing-naming # we frequently use "Foo()" and "foo()" together disabled: true - name: flag-parameter # excessive, and a common idiom we use disabled: true - name: unhandled-error # warns over common fmt.Print* and io.Close; rely on errcheck instead disabled: true # general config - name: line-length-limit arguments: - 140 - name: var-naming arguments: - [] - - CID - CRI - CTRD - DACL - DLL - DOS - ETW - FSCTL - GCS - GMSA - HCS - HV - IO - LCOW - LDAP - LPAC - LTSC - MMIO - NT - OCI - PMEM - PWSH - RX - SACl - SID - SMB - TX - VHD - VHDX - VMID - VPCI - WCOW - WIM ================================================ FILE: vendor/github.com/Microsoft/go-winio/CODEOWNERS ================================================ * @microsoft/containerplat ================================================ FILE: vendor/github.com/Microsoft/go-winio/LICENSE ================================================ The MIT License (MIT) Copyright (c) 2015 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: vendor/github.com/Microsoft/go-winio/README.md ================================================ # go-winio [![Build Status](https://github.com/microsoft/go-winio/actions/workflows/ci.yml/badge.svg)](https://github.com/microsoft/go-winio/actions/workflows/ci.yml) This repository contains utilities for efficiently performing Win32 IO operations in Go. Currently, this is focused on accessing named pipes and other file handles, and for using named pipes as a net transport. This code relies on IO completion ports to avoid blocking IO on system threads, allowing Go to reuse the thread to schedule another goroutine. This limits support to Windows Vista and newer operating systems. This is similar to the implementation of network sockets in Go's net package. Please see the LICENSE file for licensing information. ## Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit [Microsoft CLA](https://cla.microsoft.com). When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. Additionally, the pull request pipeline requires the following steps to be performed before mergining. ### Code Sign-Off We require that contributors sign their commits using [`git commit --signoff`][git-commit-s] to certify they either authored the work themselves or otherwise have permission to use it in this project. A range of commits can be signed off using [`git rebase --signoff`][git-rebase-s]. Please see [the developer certificate](https://developercertificate.org) for more info, as well as to make sure that you can attest to the rules listed. Our CI uses the DCO Github app to ensure that all commits in a given PR are signed-off. ### Linting Code must pass a linting stage, which uses [`golangci-lint`][lint]. The linting settings are stored in [`.golangci.yaml`](./.golangci.yaml), and can be run automatically with VSCode by adding the following to your workspace or folder settings: ```json "go.lintTool": "golangci-lint", "go.lintOnSave": "package", ``` Additional editor [integrations options are also available][lint-ide]. Alternatively, `golangci-lint` can be [installed locally][lint-install] and run from the repo root: ```shell # use . or specify a path to only lint a package # to show all lint errors, use flags "--max-issues-per-linter=0 --max-same-issues=0" > golangci-lint run ./... ``` ### Go Generate The pipeline checks that auto-generated code, via `go generate`, are up to date. This can be done for the entire repo: ```shell > go generate ./... ``` ## Code of Conduct This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. ## Special Thanks Thanks to [natefinch][natefinch] for the inspiration for this library. See [npipe](https://github.com/natefinch/npipe) for another named pipe implementation. [lint]: https://golangci-lint.run/ [lint-ide]: https://golangci-lint.run/usage/integrations/#editor-integration [lint-install]: https://golangci-lint.run/usage/install/#local-installation [git-commit-s]: https://git-scm.com/docs/git-commit#Documentation/git-commit.txt--s [git-rebase-s]: https://git-scm.com/docs/git-rebase#Documentation/git-rebase.txt---signoff [natefinch]: https://github.com/natefinch ================================================ FILE: vendor/github.com/Microsoft/go-winio/SECURITY.md ================================================ ## Security Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below. ## Reporting Security Issues **Please do not report security vulnerabilities through public GitHub issues.** Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report). If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey). You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc). Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) * Full paths of source file(s) related to the manifestation of the issue * The location of the affected source code (tag/branch/commit or direct URL) * Any special configuration required to reproduce the issue * Step-by-step instructions to reproduce the issue * Proof-of-concept or exploit code (if possible) * Impact of the issue, including how an attacker might exploit the issue This information will help us triage your report more quickly. If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs. ## Preferred Languages We prefer all communications to be in English. ## Policy Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd). ================================================ FILE: vendor/github.com/Microsoft/go-winio/backup.go ================================================ //go:build windows // +build windows package winio import ( "encoding/binary" "errors" "fmt" "io" "os" "runtime" "unicode/utf16" "github.com/Microsoft/go-winio/internal/fs" "golang.org/x/sys/windows" ) //sys backupRead(h windows.Handle, b []byte, bytesRead *uint32, abort bool, processSecurity bool, context *uintptr) (err error) = BackupRead //sys backupWrite(h windows.Handle, b []byte, bytesWritten *uint32, abort bool, processSecurity bool, context *uintptr) (err error) = BackupWrite const ( BackupData = uint32(iota + 1) BackupEaData BackupSecurity BackupAlternateData BackupLink BackupPropertyData BackupObjectId //revive:disable-line:var-naming ID, not Id BackupReparseData BackupSparseBlock BackupTxfsData ) const ( StreamSparseAttributes = uint32(8) ) //nolint:revive // var-naming: ALL_CAPS const ( WRITE_DAC = windows.WRITE_DAC WRITE_OWNER = windows.WRITE_OWNER ACCESS_SYSTEM_SECURITY = windows.ACCESS_SYSTEM_SECURITY ) // BackupHeader represents a backup stream of a file. type BackupHeader struct { //revive:disable-next-line:var-naming ID, not Id Id uint32 // The backup stream ID Attributes uint32 // Stream attributes Size int64 // The size of the stream in bytes Name string // The name of the stream (for BackupAlternateData only). Offset int64 // The offset of the stream in the file (for BackupSparseBlock only). } type win32StreamID struct { StreamID uint32 Attributes uint32 Size uint64 NameSize uint32 } // BackupStreamReader reads from a stream produced by the BackupRead Win32 API and produces a series // of BackupHeader values. type BackupStreamReader struct { r io.Reader bytesLeft int64 } // NewBackupStreamReader produces a BackupStreamReader from any io.Reader. func NewBackupStreamReader(r io.Reader) *BackupStreamReader { return &BackupStreamReader{r, 0} } // Next returns the next backup stream and prepares for calls to Read(). It skips the remainder of the current stream if // it was not completely read. func (r *BackupStreamReader) Next() (*BackupHeader, error) { if r.bytesLeft > 0 { //nolint:nestif // todo: flatten this if s, ok := r.r.(io.Seeker); ok { // Make sure Seek on io.SeekCurrent sometimes succeeds // before trying the actual seek. if _, err := s.Seek(0, io.SeekCurrent); err == nil { if _, err = s.Seek(r.bytesLeft, io.SeekCurrent); err != nil { return nil, err } r.bytesLeft = 0 } } if _, err := io.Copy(io.Discard, r); err != nil { return nil, err } } var wsi win32StreamID if err := binary.Read(r.r, binary.LittleEndian, &wsi); err != nil { return nil, err } hdr := &BackupHeader{ Id: wsi.StreamID, Attributes: wsi.Attributes, Size: int64(wsi.Size), } if wsi.NameSize != 0 { name := make([]uint16, int(wsi.NameSize/2)) if err := binary.Read(r.r, binary.LittleEndian, name); err != nil { return nil, err } hdr.Name = windows.UTF16ToString(name) } if wsi.StreamID == BackupSparseBlock { if err := binary.Read(r.r, binary.LittleEndian, &hdr.Offset); err != nil { return nil, err } hdr.Size -= 8 } r.bytesLeft = hdr.Size return hdr, nil } // Read reads from the current backup stream. func (r *BackupStreamReader) Read(b []byte) (int, error) { if r.bytesLeft == 0 { return 0, io.EOF } if int64(len(b)) > r.bytesLeft { b = b[:r.bytesLeft] } n, err := r.r.Read(b) r.bytesLeft -= int64(n) if err == io.EOF { err = io.ErrUnexpectedEOF } else if r.bytesLeft == 0 && err == nil { err = io.EOF } return n, err } // BackupStreamWriter writes a stream compatible with the BackupWrite Win32 API. type BackupStreamWriter struct { w io.Writer bytesLeft int64 } // NewBackupStreamWriter produces a BackupStreamWriter on top of an io.Writer. func NewBackupStreamWriter(w io.Writer) *BackupStreamWriter { return &BackupStreamWriter{w, 0} } // WriteHeader writes the next backup stream header and prepares for calls to Write(). func (w *BackupStreamWriter) WriteHeader(hdr *BackupHeader) error { if w.bytesLeft != 0 { return fmt.Errorf("missing %d bytes", w.bytesLeft) } name := utf16.Encode([]rune(hdr.Name)) wsi := win32StreamID{ StreamID: hdr.Id, Attributes: hdr.Attributes, Size: uint64(hdr.Size), NameSize: uint32(len(name) * 2), } if hdr.Id == BackupSparseBlock { // Include space for the int64 block offset wsi.Size += 8 } if err := binary.Write(w.w, binary.LittleEndian, &wsi); err != nil { return err } if len(name) != 0 { if err := binary.Write(w.w, binary.LittleEndian, name); err != nil { return err } } if hdr.Id == BackupSparseBlock { if err := binary.Write(w.w, binary.LittleEndian, hdr.Offset); err != nil { return err } } w.bytesLeft = hdr.Size return nil } // Write writes to the current backup stream. func (w *BackupStreamWriter) Write(b []byte) (int, error) { if w.bytesLeft < int64(len(b)) { return 0, fmt.Errorf("too many bytes by %d", int64(len(b))-w.bytesLeft) } n, err := w.w.Write(b) w.bytesLeft -= int64(n) return n, err } // BackupFileReader provides an io.ReadCloser interface on top of the BackupRead Win32 API. type BackupFileReader struct { f *os.File includeSecurity bool ctx uintptr } // NewBackupFileReader returns a new BackupFileReader from a file handle. If includeSecurity is true, // Read will attempt to read the security descriptor of the file. func NewBackupFileReader(f *os.File, includeSecurity bool) *BackupFileReader { r := &BackupFileReader{f, includeSecurity, 0} return r } // Read reads a backup stream from the file by calling the Win32 API BackupRead(). func (r *BackupFileReader) Read(b []byte) (int, error) { var bytesRead uint32 err := backupRead(windows.Handle(r.f.Fd()), b, &bytesRead, false, r.includeSecurity, &r.ctx) if err != nil { return 0, &os.PathError{Op: "BackupRead", Path: r.f.Name(), Err: err} } runtime.KeepAlive(r.f) if bytesRead == 0 { return 0, io.EOF } return int(bytesRead), nil } // Close frees Win32 resources associated with the BackupFileReader. It does not close // the underlying file. func (r *BackupFileReader) Close() error { if r.ctx != 0 { _ = backupRead(windows.Handle(r.f.Fd()), nil, nil, true, false, &r.ctx) runtime.KeepAlive(r.f) r.ctx = 0 } return nil } // BackupFileWriter provides an io.WriteCloser interface on top of the BackupWrite Win32 API. type BackupFileWriter struct { f *os.File includeSecurity bool ctx uintptr } // NewBackupFileWriter returns a new BackupFileWriter from a file handle. If includeSecurity is true, // Write() will attempt to restore the security descriptor from the stream. func NewBackupFileWriter(f *os.File, includeSecurity bool) *BackupFileWriter { w := &BackupFileWriter{f, includeSecurity, 0} return w } // Write restores a portion of the file using the provided backup stream. func (w *BackupFileWriter) Write(b []byte) (int, error) { var bytesWritten uint32 err := backupWrite(windows.Handle(w.f.Fd()), b, &bytesWritten, false, w.includeSecurity, &w.ctx) if err != nil { return 0, &os.PathError{Op: "BackupWrite", Path: w.f.Name(), Err: err} } runtime.KeepAlive(w.f) if int(bytesWritten) != len(b) { return int(bytesWritten), errors.New("not all bytes could be written") } return len(b), nil } // Close frees Win32 resources associated with the BackupFileWriter. It does not // close the underlying file. func (w *BackupFileWriter) Close() error { if w.ctx != 0 { _ = backupWrite(windows.Handle(w.f.Fd()), nil, nil, true, false, &w.ctx) runtime.KeepAlive(w.f) w.ctx = 0 } return nil } // OpenForBackup opens a file or directory, potentially skipping access checks if the backup // or restore privileges have been acquired. // // If the file opened was a directory, it cannot be used with Readdir(). func OpenForBackup(path string, access uint32, share uint32, createmode uint32) (*os.File, error) { h, err := fs.CreateFile(path, fs.AccessMask(access), fs.FileShareMode(share), nil, fs.FileCreationDisposition(createmode), fs.FILE_FLAG_BACKUP_SEMANTICS|fs.FILE_FLAG_OPEN_REPARSE_POINT, 0, ) if err != nil { err = &os.PathError{Op: "open", Path: path, Err: err} return nil, err } return os.NewFile(uintptr(h), path), nil } ================================================ FILE: vendor/github.com/Microsoft/go-winio/doc.go ================================================ // This package provides utilities for efficiently performing Win32 IO operations in Go. // Currently, this package is provides support for genreal IO and management of // - named pipes // - files // - [Hyper-V sockets] // // This code is similar to Go's [net] package, and uses IO completion ports to avoid // blocking IO on system threads, allowing Go to reuse the thread to schedule other goroutines. // // This limits support to Windows Vista and newer operating systems. // // Additionally, this package provides support for: // - creating and managing GUIDs // - writing to [ETW] // - opening and manageing VHDs // - parsing [Windows Image files] // - auto-generating Win32 API code // // [Hyper-V sockets]: https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/user-guide/make-integration-service // [ETW]: https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/event-tracing-for-windows--etw- // [Windows Image files]: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/work-with-windows-images package winio ================================================ FILE: vendor/github.com/Microsoft/go-winio/ea.go ================================================ package winio import ( "bytes" "encoding/binary" "errors" ) type fileFullEaInformation struct { NextEntryOffset uint32 Flags uint8 NameLength uint8 ValueLength uint16 } var ( fileFullEaInformationSize = binary.Size(&fileFullEaInformation{}) errInvalidEaBuffer = errors.New("invalid extended attribute buffer") errEaNameTooLarge = errors.New("extended attribute name too large") errEaValueTooLarge = errors.New("extended attribute value too large") ) // ExtendedAttribute represents a single Windows EA. type ExtendedAttribute struct { Name string Value []byte Flags uint8 } func parseEa(b []byte) (ea ExtendedAttribute, nb []byte, err error) { var info fileFullEaInformation err = binary.Read(bytes.NewReader(b), binary.LittleEndian, &info) if err != nil { err = errInvalidEaBuffer return ea, nb, err } nameOffset := fileFullEaInformationSize nameLen := int(info.NameLength) valueOffset := nameOffset + int(info.NameLength) + 1 valueLen := int(info.ValueLength) nextOffset := int(info.NextEntryOffset) if valueLen+valueOffset > len(b) || nextOffset < 0 || nextOffset > len(b) { err = errInvalidEaBuffer return ea, nb, err } ea.Name = string(b[nameOffset : nameOffset+nameLen]) ea.Value = b[valueOffset : valueOffset+valueLen] ea.Flags = info.Flags if info.NextEntryOffset != 0 { nb = b[info.NextEntryOffset:] } return ea, nb, err } // DecodeExtendedAttributes decodes a list of EAs from a FILE_FULL_EA_INFORMATION // buffer retrieved from BackupRead, ZwQueryEaFile, etc. func DecodeExtendedAttributes(b []byte) (eas []ExtendedAttribute, err error) { for len(b) != 0 { ea, nb, err := parseEa(b) if err != nil { return nil, err } eas = append(eas, ea) b = nb } return eas, err } func writeEa(buf *bytes.Buffer, ea *ExtendedAttribute, last bool) error { if int(uint8(len(ea.Name))) != len(ea.Name) { return errEaNameTooLarge } if int(uint16(len(ea.Value))) != len(ea.Value) { return errEaValueTooLarge } entrySize := uint32(fileFullEaInformationSize + len(ea.Name) + 1 + len(ea.Value)) withPadding := (entrySize + 3) &^ 3 nextOffset := uint32(0) if !last { nextOffset = withPadding } info := fileFullEaInformation{ NextEntryOffset: nextOffset, Flags: ea.Flags, NameLength: uint8(len(ea.Name)), ValueLength: uint16(len(ea.Value)), } err := binary.Write(buf, binary.LittleEndian, &info) if err != nil { return err } _, err = buf.Write([]byte(ea.Name)) if err != nil { return err } err = buf.WriteByte(0) if err != nil { return err } _, err = buf.Write(ea.Value) if err != nil { return err } _, err = buf.Write([]byte{0, 0, 0}[0 : withPadding-entrySize]) if err != nil { return err } return nil } // EncodeExtendedAttributes encodes a list of EAs into a FILE_FULL_EA_INFORMATION // buffer for use with BackupWrite, ZwSetEaFile, etc. func EncodeExtendedAttributes(eas []ExtendedAttribute) ([]byte, error) { var buf bytes.Buffer for i := range eas { last := false if i == len(eas)-1 { last = true } err := writeEa(&buf, &eas[i], last) if err != nil { return nil, err } } return buf.Bytes(), nil } ================================================ FILE: vendor/github.com/Microsoft/go-winio/file.go ================================================ //go:build windows // +build windows package winio import ( "errors" "io" "runtime" "sync" "sync/atomic" "syscall" "time" "golang.org/x/sys/windows" ) //sys cancelIoEx(file windows.Handle, o *windows.Overlapped) (err error) = CancelIoEx //sys createIoCompletionPort(file windows.Handle, port windows.Handle, key uintptr, threadCount uint32) (newport windows.Handle, err error) = CreateIoCompletionPort //sys getQueuedCompletionStatus(port windows.Handle, bytes *uint32, key *uintptr, o **ioOperation, timeout uint32) (err error) = GetQueuedCompletionStatus //sys setFileCompletionNotificationModes(h windows.Handle, flags uint8) (err error) = SetFileCompletionNotificationModes //sys wsaGetOverlappedResult(h windows.Handle, o *windows.Overlapped, bytes *uint32, wait bool, flags *uint32) (err error) = ws2_32.WSAGetOverlappedResult var ( ErrFileClosed = errors.New("file has already been closed") ErrTimeout = &timeoutError{} ) type timeoutError struct{} func (*timeoutError) Error() string { return "i/o timeout" } func (*timeoutError) Timeout() bool { return true } func (*timeoutError) Temporary() bool { return true } type timeoutChan chan struct{} var ioInitOnce sync.Once var ioCompletionPort windows.Handle // ioResult contains the result of an asynchronous IO operation. type ioResult struct { bytes uint32 err error } // ioOperation represents an outstanding asynchronous Win32 IO. type ioOperation struct { o windows.Overlapped ch chan ioResult } func initIO() { h, err := createIoCompletionPort(windows.InvalidHandle, 0, 0, 0xffffffff) if err != nil { panic(err) } ioCompletionPort = h go ioCompletionProcessor(h) } // win32File implements Reader, Writer, and Closer on a Win32 handle without blocking in a syscall. // It takes ownership of this handle and will close it if it is garbage collected. type win32File struct { handle windows.Handle wg sync.WaitGroup wgLock sync.RWMutex closing atomic.Bool socket bool readDeadline deadlineHandler writeDeadline deadlineHandler } type deadlineHandler struct { setLock sync.Mutex channel timeoutChan channelLock sync.RWMutex timer *time.Timer timedout atomic.Bool } // makeWin32File makes a new win32File from an existing file handle. func makeWin32File(h windows.Handle) (*win32File, error) { f := &win32File{handle: h} ioInitOnce.Do(initIO) _, err := createIoCompletionPort(h, ioCompletionPort, 0, 0xffffffff) if err != nil { return nil, err } err = setFileCompletionNotificationModes(h, windows.FILE_SKIP_COMPLETION_PORT_ON_SUCCESS|windows.FILE_SKIP_SET_EVENT_ON_HANDLE) if err != nil { return nil, err } f.readDeadline.channel = make(timeoutChan) f.writeDeadline.channel = make(timeoutChan) return f, nil } // Deprecated: use NewOpenFile instead. func MakeOpenFile(h syscall.Handle) (io.ReadWriteCloser, error) { return NewOpenFile(windows.Handle(h)) } func NewOpenFile(h windows.Handle) (io.ReadWriteCloser, error) { // If we return the result of makeWin32File directly, it can result in an // interface-wrapped nil, rather than a nil interface value. f, err := makeWin32File(h) if err != nil { return nil, err } return f, nil } // closeHandle closes the resources associated with a Win32 handle. func (f *win32File) closeHandle() { f.wgLock.Lock() // Atomically set that we are closing, releasing the resources only once. if !f.closing.Swap(true) { f.wgLock.Unlock() // cancel all IO and wait for it to complete _ = cancelIoEx(f.handle, nil) f.wg.Wait() // at this point, no new IO can start windows.Close(f.handle) f.handle = 0 } else { f.wgLock.Unlock() } } // Close closes a win32File. func (f *win32File) Close() error { f.closeHandle() return nil } // IsClosed checks if the file has been closed. func (f *win32File) IsClosed() bool { return f.closing.Load() } // prepareIO prepares for a new IO operation. // The caller must call f.wg.Done() when the IO is finished, prior to Close() returning. func (f *win32File) prepareIO() (*ioOperation, error) { f.wgLock.RLock() if f.closing.Load() { f.wgLock.RUnlock() return nil, ErrFileClosed } f.wg.Add(1) f.wgLock.RUnlock() c := &ioOperation{} c.ch = make(chan ioResult) return c, nil } // ioCompletionProcessor processes completed async IOs forever. func ioCompletionProcessor(h windows.Handle) { for { var bytes uint32 var key uintptr var op *ioOperation err := getQueuedCompletionStatus(h, &bytes, &key, &op, windows.INFINITE) if op == nil { panic(err) } op.ch <- ioResult{bytes, err} } } // todo: helsaawy - create an asyncIO version that takes a context // asyncIO processes the return value from ReadFile or WriteFile, blocking until // the operation has actually completed. func (f *win32File) asyncIO(c *ioOperation, d *deadlineHandler, bytes uint32, err error) (int, error) { if err != windows.ERROR_IO_PENDING { //nolint:errorlint // err is Errno return int(bytes), err } if f.closing.Load() { _ = cancelIoEx(f.handle, &c.o) } var timeout timeoutChan if d != nil { d.channelLock.Lock() timeout = d.channel d.channelLock.Unlock() } var r ioResult select { case r = <-c.ch: err = r.err if err == windows.ERROR_OPERATION_ABORTED { //nolint:errorlint // err is Errno if f.closing.Load() { err = ErrFileClosed } } else if err != nil && f.socket { // err is from Win32. Query the overlapped structure to get the winsock error. var bytes, flags uint32 err = wsaGetOverlappedResult(f.handle, &c.o, &bytes, false, &flags) } case <-timeout: _ = cancelIoEx(f.handle, &c.o) r = <-c.ch err = r.err if err == windows.ERROR_OPERATION_ABORTED { //nolint:errorlint // err is Errno err = ErrTimeout } } // runtime.KeepAlive is needed, as c is passed via native // code to ioCompletionProcessor, c must remain alive // until the channel read is complete. // todo: (de)allocate *ioOperation via win32 heap functions, instead of needing to KeepAlive? runtime.KeepAlive(c) return int(r.bytes), err } // Read reads from a file handle. func (f *win32File) Read(b []byte) (int, error) { c, err := f.prepareIO() if err != nil { return 0, err } defer f.wg.Done() if f.readDeadline.timedout.Load() { return 0, ErrTimeout } var bytes uint32 err = windows.ReadFile(f.handle, b, &bytes, &c.o) n, err := f.asyncIO(c, &f.readDeadline, bytes, err) runtime.KeepAlive(b) // Handle EOF conditions. if err == nil && n == 0 && len(b) != 0 { return 0, io.EOF } else if err == windows.ERROR_BROKEN_PIPE { //nolint:errorlint // err is Errno return 0, io.EOF } return n, err } // Write writes to a file handle. func (f *win32File) Write(b []byte) (int, error) { c, err := f.prepareIO() if err != nil { return 0, err } defer f.wg.Done() if f.writeDeadline.timedout.Load() { return 0, ErrTimeout } var bytes uint32 err = windows.WriteFile(f.handle, b, &bytes, &c.o) n, err := f.asyncIO(c, &f.writeDeadline, bytes, err) runtime.KeepAlive(b) return n, err } func (f *win32File) SetReadDeadline(deadline time.Time) error { return f.readDeadline.set(deadline) } func (f *win32File) SetWriteDeadline(deadline time.Time) error { return f.writeDeadline.set(deadline) } func (f *win32File) Flush() error { return windows.FlushFileBuffers(f.handle) } func (f *win32File) Fd() uintptr { return uintptr(f.handle) } func (d *deadlineHandler) set(deadline time.Time) error { d.setLock.Lock() defer d.setLock.Unlock() if d.timer != nil { if !d.timer.Stop() { <-d.channel } d.timer = nil } d.timedout.Store(false) select { case <-d.channel: d.channelLock.Lock() d.channel = make(chan struct{}) d.channelLock.Unlock() default: } if deadline.IsZero() { return nil } timeoutIO := func() { d.timedout.Store(true) close(d.channel) } now := time.Now() duration := deadline.Sub(now) if deadline.After(now) { // Deadline is in the future, set a timer to wait d.timer = time.AfterFunc(duration, timeoutIO) } else { // Deadline is in the past. Cancel all pending IO now. timeoutIO() } return nil } ================================================ FILE: vendor/github.com/Microsoft/go-winio/fileinfo.go ================================================ //go:build windows // +build windows package winio import ( "os" "runtime" "unsafe" "golang.org/x/sys/windows" ) // FileBasicInfo contains file access time and file attributes information. type FileBasicInfo struct { CreationTime, LastAccessTime, LastWriteTime, ChangeTime windows.Filetime FileAttributes uint32 _ uint32 // padding } // alignedFileBasicInfo is a FileBasicInfo, but aligned to uint64 by containing // uint64 rather than windows.Filetime. Filetime contains two uint32s. uint64 // alignment is necessary to pass this as FILE_BASIC_INFO. type alignedFileBasicInfo struct { CreationTime, LastAccessTime, LastWriteTime, ChangeTime uint64 FileAttributes uint32 _ uint32 // padding } // GetFileBasicInfo retrieves times and attributes for a file. func GetFileBasicInfo(f *os.File) (*FileBasicInfo, error) { bi := &alignedFileBasicInfo{} if err := windows.GetFileInformationByHandleEx( windows.Handle(f.Fd()), windows.FileBasicInfo, (*byte)(unsafe.Pointer(bi)), uint32(unsafe.Sizeof(*bi)), ); err != nil { return nil, &os.PathError{Op: "GetFileInformationByHandleEx", Path: f.Name(), Err: err} } runtime.KeepAlive(f) // Reinterpret the alignedFileBasicInfo as a FileBasicInfo so it matches the // public API of this module. The data may be unnecessarily aligned. return (*FileBasicInfo)(unsafe.Pointer(bi)), nil } // SetFileBasicInfo sets times and attributes for a file. func SetFileBasicInfo(f *os.File, bi *FileBasicInfo) error { // Create an alignedFileBasicInfo based on a FileBasicInfo. The copy is // suitable to pass to GetFileInformationByHandleEx. biAligned := *(*alignedFileBasicInfo)(unsafe.Pointer(bi)) if err := windows.SetFileInformationByHandle( windows.Handle(f.Fd()), windows.FileBasicInfo, (*byte)(unsafe.Pointer(&biAligned)), uint32(unsafe.Sizeof(biAligned)), ); err != nil { return &os.PathError{Op: "SetFileInformationByHandle", Path: f.Name(), Err: err} } runtime.KeepAlive(f) return nil } // FileStandardInfo contains extended information for the file. // FILE_STANDARD_INFO in WinBase.h // https://docs.microsoft.com/en-us/windows/win32/api/winbase/ns-winbase-file_standard_info type FileStandardInfo struct { AllocationSize, EndOfFile int64 NumberOfLinks uint32 DeletePending, Directory bool } // GetFileStandardInfo retrieves ended information for the file. func GetFileStandardInfo(f *os.File) (*FileStandardInfo, error) { si := &FileStandardInfo{} if err := windows.GetFileInformationByHandleEx(windows.Handle(f.Fd()), windows.FileStandardInfo, (*byte)(unsafe.Pointer(si)), uint32(unsafe.Sizeof(*si))); err != nil { return nil, &os.PathError{Op: "GetFileInformationByHandleEx", Path: f.Name(), Err: err} } runtime.KeepAlive(f) return si, nil } // FileIDInfo contains the volume serial number and file ID for a file. This pair should be // unique on a system. type FileIDInfo struct { VolumeSerialNumber uint64 FileID [16]byte } // GetFileID retrieves the unique (volume, file ID) pair for a file. func GetFileID(f *os.File) (*FileIDInfo, error) { fileID := &FileIDInfo{} if err := windows.GetFileInformationByHandleEx( windows.Handle(f.Fd()), windows.FileIdInfo, (*byte)(unsafe.Pointer(fileID)), uint32(unsafe.Sizeof(*fileID)), ); err != nil { return nil, &os.PathError{Op: "GetFileInformationByHandleEx", Path: f.Name(), Err: err} } runtime.KeepAlive(f) return fileID, nil } ================================================ FILE: vendor/github.com/Microsoft/go-winio/hvsock.go ================================================ //go:build windows // +build windows package winio import ( "context" "errors" "fmt" "io" "net" "os" "time" "unsafe" "golang.org/x/sys/windows" "github.com/Microsoft/go-winio/internal/socket" "github.com/Microsoft/go-winio/pkg/guid" ) const afHVSock = 34 // AF_HYPERV // Well known Service and VM IDs // https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/user-guide/make-integration-service#vmid-wildcards // HvsockGUIDWildcard is the wildcard VmId for accepting connections from all partitions. func HvsockGUIDWildcard() guid.GUID { // 00000000-0000-0000-0000-000000000000 return guid.GUID{} } // HvsockGUIDBroadcast is the wildcard VmId for broadcasting sends to all partitions. func HvsockGUIDBroadcast() guid.GUID { // ffffffff-ffff-ffff-ffff-ffffffffffff return guid.GUID{ Data1: 0xffffffff, Data2: 0xffff, Data3: 0xffff, Data4: [8]uint8{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, } } // HvsockGUIDLoopback is the Loopback VmId for accepting connections to the same partition as the connector. func HvsockGUIDLoopback() guid.GUID { // e0e16197-dd56-4a10-9195-5ee7a155a838 return guid.GUID{ Data1: 0xe0e16197, Data2: 0xdd56, Data3: 0x4a10, Data4: [8]uint8{0x91, 0x95, 0x5e, 0xe7, 0xa1, 0x55, 0xa8, 0x38}, } } // HvsockGUIDSiloHost is the address of a silo's host partition: // - The silo host of a hosted silo is the utility VM. // - The silo host of a silo on a physical host is the physical host. func HvsockGUIDSiloHost() guid.GUID { // 36bd0c5c-7276-4223-88ba-7d03b654c568 return guid.GUID{ Data1: 0x36bd0c5c, Data2: 0x7276, Data3: 0x4223, Data4: [8]byte{0x88, 0xba, 0x7d, 0x03, 0xb6, 0x54, 0xc5, 0x68}, } } // HvsockGUIDChildren is the wildcard VmId for accepting connections from the connector's child partitions. func HvsockGUIDChildren() guid.GUID { // 90db8b89-0d35-4f79-8ce9-49ea0ac8b7cd return guid.GUID{ Data1: 0x90db8b89, Data2: 0xd35, Data3: 0x4f79, Data4: [8]uint8{0x8c, 0xe9, 0x49, 0xea, 0xa, 0xc8, 0xb7, 0xcd}, } } // HvsockGUIDParent is the wildcard VmId for accepting connections from the connector's parent partition. // Listening on this VmId accepts connection from: // - Inside silos: silo host partition. // - Inside hosted silo: host of the VM. // - Inside VM: VM host. // - Physical host: Not supported. func HvsockGUIDParent() guid.GUID { // a42e7cda-d03f-480c-9cc2-a4de20abb878 return guid.GUID{ Data1: 0xa42e7cda, Data2: 0xd03f, Data3: 0x480c, Data4: [8]uint8{0x9c, 0xc2, 0xa4, 0xde, 0x20, 0xab, 0xb8, 0x78}, } } // hvsockVsockServiceTemplate is the Service GUID used for the VSOCK protocol. func hvsockVsockServiceTemplate() guid.GUID { // 00000000-facb-11e6-bd58-64006a7986d3 return guid.GUID{ Data2: 0xfacb, Data3: 0x11e6, Data4: [8]uint8{0xbd, 0x58, 0x64, 0x00, 0x6a, 0x79, 0x86, 0xd3}, } } // An HvsockAddr is an address for a AF_HYPERV socket. type HvsockAddr struct { VMID guid.GUID ServiceID guid.GUID } type rawHvsockAddr struct { Family uint16 _ uint16 VMID guid.GUID ServiceID guid.GUID } var _ socket.RawSockaddr = &rawHvsockAddr{} // Network returns the address's network name, "hvsock". func (*HvsockAddr) Network() string { return "hvsock" } func (addr *HvsockAddr) String() string { return fmt.Sprintf("%s:%s", &addr.VMID, &addr.ServiceID) } // VsockServiceID returns an hvsock service ID corresponding to the specified AF_VSOCK port. func VsockServiceID(port uint32) guid.GUID { g := hvsockVsockServiceTemplate() // make a copy g.Data1 = port return g } func (addr *HvsockAddr) raw() rawHvsockAddr { return rawHvsockAddr{ Family: afHVSock, VMID: addr.VMID, ServiceID: addr.ServiceID, } } func (addr *HvsockAddr) fromRaw(raw *rawHvsockAddr) { addr.VMID = raw.VMID addr.ServiceID = raw.ServiceID } // Sockaddr returns a pointer to and the size of this struct. // // Implements the [socket.RawSockaddr] interface, and allows use in // [socket.Bind] and [socket.ConnectEx]. func (r *rawHvsockAddr) Sockaddr() (unsafe.Pointer, int32, error) { return unsafe.Pointer(r), int32(unsafe.Sizeof(rawHvsockAddr{})), nil } // Sockaddr interface allows use with `sockets.Bind()` and `.ConnectEx()`. func (r *rawHvsockAddr) FromBytes(b []byte) error { n := int(unsafe.Sizeof(rawHvsockAddr{})) if len(b) < n { return fmt.Errorf("got %d, want %d: %w", len(b), n, socket.ErrBufferSize) } copy(unsafe.Slice((*byte)(unsafe.Pointer(r)), n), b[:n]) if r.Family != afHVSock { return fmt.Errorf("got %d, want %d: %w", r.Family, afHVSock, socket.ErrAddrFamily) } return nil } // HvsockListener is a socket listener for the AF_HYPERV address family. type HvsockListener struct { sock *win32File addr HvsockAddr } var _ net.Listener = &HvsockListener{} // HvsockConn is a connected socket of the AF_HYPERV address family. type HvsockConn struct { sock *win32File local, remote HvsockAddr } var _ net.Conn = &HvsockConn{} func newHVSocket() (*win32File, error) { fd, err := windows.Socket(afHVSock, windows.SOCK_STREAM, 1) if err != nil { return nil, os.NewSyscallError("socket", err) } f, err := makeWin32File(fd) if err != nil { windows.Close(fd) return nil, err } f.socket = true return f, nil } // ListenHvsock listens for connections on the specified hvsock address. func ListenHvsock(addr *HvsockAddr) (_ *HvsockListener, err error) { l := &HvsockListener{addr: *addr} var sock *win32File sock, err = newHVSocket() if err != nil { return nil, l.opErr("listen", err) } defer func() { if err != nil { _ = sock.Close() } }() sa := addr.raw() err = socket.Bind(sock.handle, &sa) if err != nil { return nil, l.opErr("listen", os.NewSyscallError("socket", err)) } err = windows.Listen(sock.handle, 16) if err != nil { return nil, l.opErr("listen", os.NewSyscallError("listen", err)) } return &HvsockListener{sock: sock, addr: *addr}, nil } func (l *HvsockListener) opErr(op string, err error) error { return &net.OpError{Op: op, Net: "hvsock", Addr: &l.addr, Err: err} } // Addr returns the listener's network address. func (l *HvsockListener) Addr() net.Addr { return &l.addr } // Accept waits for the next connection and returns it. func (l *HvsockListener) Accept() (_ net.Conn, err error) { sock, err := newHVSocket() if err != nil { return nil, l.opErr("accept", err) } defer func() { if sock != nil { sock.Close() } }() c, err := l.sock.prepareIO() if err != nil { return nil, l.opErr("accept", err) } defer l.sock.wg.Done() // AcceptEx, per documentation, requires an extra 16 bytes per address. // // https://docs.microsoft.com/en-us/windows/win32/api/mswsock/nf-mswsock-acceptex const addrlen = uint32(16 + unsafe.Sizeof(rawHvsockAddr{})) var addrbuf [addrlen * 2]byte var bytes uint32 err = windows.AcceptEx(l.sock.handle, sock.handle, &addrbuf[0], 0 /* rxdatalen */, addrlen, addrlen, &bytes, &c.o) if _, err = l.sock.asyncIO(c, nil, bytes, err); err != nil { return nil, l.opErr("accept", os.NewSyscallError("acceptex", err)) } conn := &HvsockConn{ sock: sock, } // The local address returned in the AcceptEx buffer is the same as the Listener socket's // address. However, the service GUID reported by GetSockName is different from the Listeners // socket, and is sometimes the same as the local address of the socket that dialed the // address, with the service GUID.Data1 incremented, but othertimes is different. // todo: does the local address matter? is the listener's address or the actual address appropriate? conn.local.fromRaw((*rawHvsockAddr)(unsafe.Pointer(&addrbuf[0]))) conn.remote.fromRaw((*rawHvsockAddr)(unsafe.Pointer(&addrbuf[addrlen]))) // initialize the accepted socket and update its properties with those of the listening socket if err = windows.Setsockopt(sock.handle, windows.SOL_SOCKET, windows.SO_UPDATE_ACCEPT_CONTEXT, (*byte)(unsafe.Pointer(&l.sock.handle)), int32(unsafe.Sizeof(l.sock.handle))); err != nil { return nil, conn.opErr("accept", os.NewSyscallError("setsockopt", err)) } sock = nil return conn, nil } // Close closes the listener, causing any pending Accept calls to fail. func (l *HvsockListener) Close() error { return l.sock.Close() } // HvsockDialer configures and dials a Hyper-V Socket (ie, [HvsockConn]). type HvsockDialer struct { // Deadline is the time the Dial operation must connect before erroring. Deadline time.Time // Retries is the number of additional connects to try if the connection times out, is refused, // or the host is unreachable Retries uint // RetryWait is the time to wait after a connection error to retry RetryWait time.Duration rt *time.Timer // redial wait timer } // Dial the Hyper-V socket at addr. // // See [HvsockDialer.Dial] for more information. func Dial(ctx context.Context, addr *HvsockAddr) (conn *HvsockConn, err error) { return (&HvsockDialer{}).Dial(ctx, addr) } // Dial attempts to connect to the Hyper-V socket at addr, and returns a connection if successful. // Will attempt (HvsockDialer).Retries if dialing fails, waiting (HvsockDialer).RetryWait between // retries. // // Dialing can be cancelled either by providing (HvsockDialer).Deadline, or cancelling ctx. func (d *HvsockDialer) Dial(ctx context.Context, addr *HvsockAddr) (conn *HvsockConn, err error) { op := "dial" // create the conn early to use opErr() conn = &HvsockConn{ remote: *addr, } if !d.Deadline.IsZero() { var cancel context.CancelFunc ctx, cancel = context.WithDeadline(ctx, d.Deadline) defer cancel() } // preemptive timeout/cancellation check if err = ctx.Err(); err != nil { return nil, conn.opErr(op, err) } sock, err := newHVSocket() if err != nil { return nil, conn.opErr(op, err) } defer func() { if sock != nil { sock.Close() } }() sa := addr.raw() err = socket.Bind(sock.handle, &sa) if err != nil { return nil, conn.opErr(op, os.NewSyscallError("bind", err)) } c, err := sock.prepareIO() if err != nil { return nil, conn.opErr(op, err) } defer sock.wg.Done() var bytes uint32 for i := uint(0); i <= d.Retries; i++ { err = socket.ConnectEx( sock.handle, &sa, nil, // sendBuf 0, // sendDataLen &bytes, (*windows.Overlapped)(unsafe.Pointer(&c.o))) _, err = sock.asyncIO(c, nil, bytes, err) if i < d.Retries && canRedial(err) { if err = d.redialWait(ctx); err == nil { continue } } break } if err != nil { return nil, conn.opErr(op, os.NewSyscallError("connectex", err)) } // update the connection properties, so shutdown can be used if err = windows.Setsockopt( sock.handle, windows.SOL_SOCKET, windows.SO_UPDATE_CONNECT_CONTEXT, nil, // optvalue 0, // optlen ); err != nil { return nil, conn.opErr(op, os.NewSyscallError("setsockopt", err)) } // get the local name var sal rawHvsockAddr err = socket.GetSockName(sock.handle, &sal) if err != nil { return nil, conn.opErr(op, os.NewSyscallError("getsockname", err)) } conn.local.fromRaw(&sal) // one last check for timeout, since asyncIO doesn't check the context if err = ctx.Err(); err != nil { return nil, conn.opErr(op, err) } conn.sock = sock sock = nil return conn, nil } // redialWait waits before attempting to redial, resetting the timer as appropriate. func (d *HvsockDialer) redialWait(ctx context.Context) (err error) { if d.RetryWait == 0 { return nil } if d.rt == nil { d.rt = time.NewTimer(d.RetryWait) } else { // should already be stopped and drained d.rt.Reset(d.RetryWait) } select { case <-ctx.Done(): case <-d.rt.C: return nil } // stop and drain the timer if !d.rt.Stop() { <-d.rt.C } return ctx.Err() } // assumes error is a plain, unwrapped windows.Errno provided by direct syscall. func canRedial(err error) bool { //nolint:errorlint // guaranteed to be an Errno switch err { case windows.WSAECONNREFUSED, windows.WSAENETUNREACH, windows.WSAETIMEDOUT, windows.ERROR_CONNECTION_REFUSED, windows.ERROR_CONNECTION_UNAVAIL: return true default: return false } } func (conn *HvsockConn) opErr(op string, err error) error { // translate from "file closed" to "socket closed" if errors.Is(err, ErrFileClosed) { err = socket.ErrSocketClosed } return &net.OpError{Op: op, Net: "hvsock", Source: &conn.local, Addr: &conn.remote, Err: err} } func (conn *HvsockConn) Read(b []byte) (int, error) { c, err := conn.sock.prepareIO() if err != nil { return 0, conn.opErr("read", err) } defer conn.sock.wg.Done() buf := windows.WSABuf{Buf: &b[0], Len: uint32(len(b))} var flags, bytes uint32 err = windows.WSARecv(conn.sock.handle, &buf, 1, &bytes, &flags, &c.o, nil) n, err := conn.sock.asyncIO(c, &conn.sock.readDeadline, bytes, err) if err != nil { var eno windows.Errno if errors.As(err, &eno) { err = os.NewSyscallError("wsarecv", eno) } return 0, conn.opErr("read", err) } else if n == 0 { err = io.EOF } return n, err } func (conn *HvsockConn) Write(b []byte) (int, error) { t := 0 for len(b) != 0 { n, err := conn.write(b) if err != nil { return t + n, err } t += n b = b[n:] } return t, nil } func (conn *HvsockConn) write(b []byte) (int, error) { c, err := conn.sock.prepareIO() if err != nil { return 0, conn.opErr("write", err) } defer conn.sock.wg.Done() buf := windows.WSABuf{Buf: &b[0], Len: uint32(len(b))} var bytes uint32 err = windows.WSASend(conn.sock.handle, &buf, 1, &bytes, 0, &c.o, nil) n, err := conn.sock.asyncIO(c, &conn.sock.writeDeadline, bytes, err) if err != nil { var eno windows.Errno if errors.As(err, &eno) { err = os.NewSyscallError("wsasend", eno) } return 0, conn.opErr("write", err) } return n, err } // Close closes the socket connection, failing any pending read or write calls. func (conn *HvsockConn) Close() error { return conn.sock.Close() } func (conn *HvsockConn) IsClosed() bool { return conn.sock.IsClosed() } // shutdown disables sending or receiving on a socket. func (conn *HvsockConn) shutdown(how int) error { if conn.IsClosed() { return socket.ErrSocketClosed } err := windows.Shutdown(conn.sock.handle, how) if err != nil { // If the connection was closed, shutdowns fail with "not connected" if errors.Is(err, windows.WSAENOTCONN) || errors.Is(err, windows.WSAESHUTDOWN) { err = socket.ErrSocketClosed } return os.NewSyscallError("shutdown", err) } return nil } // CloseRead shuts down the read end of the socket, preventing future read operations. func (conn *HvsockConn) CloseRead() error { err := conn.shutdown(windows.SHUT_RD) if err != nil { return conn.opErr("closeread", err) } return nil } // CloseWrite shuts down the write end of the socket, preventing future write operations and // notifying the other endpoint that no more data will be written. func (conn *HvsockConn) CloseWrite() error { err := conn.shutdown(windows.SHUT_WR) if err != nil { return conn.opErr("closewrite", err) } return nil } // LocalAddr returns the local address of the connection. func (conn *HvsockConn) LocalAddr() net.Addr { return &conn.local } // RemoteAddr returns the remote address of the connection. func (conn *HvsockConn) RemoteAddr() net.Addr { return &conn.remote } // SetDeadline implements the net.Conn SetDeadline method. func (conn *HvsockConn) SetDeadline(t time.Time) error { // todo: implement `SetDeadline` for `win32File` if err := conn.SetReadDeadline(t); err != nil { return fmt.Errorf("set read deadline: %w", err) } if err := conn.SetWriteDeadline(t); err != nil { return fmt.Errorf("set write deadline: %w", err) } return nil } // SetReadDeadline implements the net.Conn SetReadDeadline method. func (conn *HvsockConn) SetReadDeadline(t time.Time) error { return conn.sock.SetReadDeadline(t) } // SetWriteDeadline implements the net.Conn SetWriteDeadline method. func (conn *HvsockConn) SetWriteDeadline(t time.Time) error { return conn.sock.SetWriteDeadline(t) } ================================================ FILE: vendor/github.com/Microsoft/go-winio/internal/fs/doc.go ================================================ // This package contains Win32 filesystem functionality. package fs ================================================ FILE: vendor/github.com/Microsoft/go-winio/internal/fs/fs.go ================================================ //go:build windows package fs import ( "golang.org/x/sys/windows" "github.com/Microsoft/go-winio/internal/stringbuffer" ) //go:generate go run github.com/Microsoft/go-winio/tools/mkwinsyscall -output zsyscall_windows.go fs.go // https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilew //sys CreateFile(name string, access AccessMask, mode FileShareMode, sa *windows.SecurityAttributes, createmode FileCreationDisposition, attrs FileFlagOrAttribute, templatefile windows.Handle) (handle windows.Handle, err error) [failretval==windows.InvalidHandle] = CreateFileW const NullHandle windows.Handle = 0 // AccessMask defines standard, specific, and generic rights. // // Used with CreateFile and NtCreateFile (and co.). // // Bitmask: // 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 // 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 // +---------------+---------------+-------------------------------+ // |G|G|G|G|Resvd|A| StandardRights| SpecificRights | // |R|W|E|A| |S| | | // +-+-------------+---------------+-------------------------------+ // // GR Generic Read // GW Generic Write // GE Generic Exectue // GA Generic All // Resvd Reserved // AS Access Security System // // https://learn.microsoft.com/en-us/windows/win32/secauthz/access-mask // // https://learn.microsoft.com/en-us/windows/win32/secauthz/generic-access-rights // // https://learn.microsoft.com/en-us/windows/win32/fileio/file-access-rights-constants type AccessMask = windows.ACCESS_MASK //nolint:revive // SNAKE_CASE is not idiomatic in Go, but aligned with Win32 API. const ( // Not actually any. // // For CreateFile: "query certain metadata such as file, directory, or device attributes without accessing that file or device" // https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilew#parameters FILE_ANY_ACCESS AccessMask = 0 GENERIC_READ AccessMask = 0x8000_0000 GENERIC_WRITE AccessMask = 0x4000_0000 GENERIC_EXECUTE AccessMask = 0x2000_0000 GENERIC_ALL AccessMask = 0x1000_0000 ACCESS_SYSTEM_SECURITY AccessMask = 0x0100_0000 // Specific Object Access // from ntioapi.h FILE_READ_DATA AccessMask = (0x0001) // file & pipe FILE_LIST_DIRECTORY AccessMask = (0x0001) // directory FILE_WRITE_DATA AccessMask = (0x0002) // file & pipe FILE_ADD_FILE AccessMask = (0x0002) // directory FILE_APPEND_DATA AccessMask = (0x0004) // file FILE_ADD_SUBDIRECTORY AccessMask = (0x0004) // directory FILE_CREATE_PIPE_INSTANCE AccessMask = (0x0004) // named pipe FILE_READ_EA AccessMask = (0x0008) // file & directory FILE_READ_PROPERTIES AccessMask = FILE_READ_EA FILE_WRITE_EA AccessMask = (0x0010) // file & directory FILE_WRITE_PROPERTIES AccessMask = FILE_WRITE_EA FILE_EXECUTE AccessMask = (0x0020) // file FILE_TRAVERSE AccessMask = (0x0020) // directory FILE_DELETE_CHILD AccessMask = (0x0040) // directory FILE_READ_ATTRIBUTES AccessMask = (0x0080) // all FILE_WRITE_ATTRIBUTES AccessMask = (0x0100) // all FILE_ALL_ACCESS AccessMask = (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x1FF) FILE_GENERIC_READ AccessMask = (STANDARD_RIGHTS_READ | FILE_READ_DATA | FILE_READ_ATTRIBUTES | FILE_READ_EA | SYNCHRONIZE) FILE_GENERIC_WRITE AccessMask = (STANDARD_RIGHTS_WRITE | FILE_WRITE_DATA | FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA | FILE_APPEND_DATA | SYNCHRONIZE) FILE_GENERIC_EXECUTE AccessMask = (STANDARD_RIGHTS_EXECUTE | FILE_READ_ATTRIBUTES | FILE_EXECUTE | SYNCHRONIZE) SPECIFIC_RIGHTS_ALL AccessMask = 0x0000FFFF // Standard Access // from ntseapi.h DELETE AccessMask = 0x0001_0000 READ_CONTROL AccessMask = 0x0002_0000 WRITE_DAC AccessMask = 0x0004_0000 WRITE_OWNER AccessMask = 0x0008_0000 SYNCHRONIZE AccessMask = 0x0010_0000 STANDARD_RIGHTS_REQUIRED AccessMask = 0x000F_0000 STANDARD_RIGHTS_READ AccessMask = READ_CONTROL STANDARD_RIGHTS_WRITE AccessMask = READ_CONTROL STANDARD_RIGHTS_EXECUTE AccessMask = READ_CONTROL STANDARD_RIGHTS_ALL AccessMask = 0x001F_0000 ) type FileShareMode uint32 //nolint:revive // SNAKE_CASE is not idiomatic in Go, but aligned with Win32 API. const ( FILE_SHARE_NONE FileShareMode = 0x00 FILE_SHARE_READ FileShareMode = 0x01 FILE_SHARE_WRITE FileShareMode = 0x02 FILE_SHARE_DELETE FileShareMode = 0x04 FILE_SHARE_VALID_FLAGS FileShareMode = 0x07 ) type FileCreationDisposition uint32 //nolint:revive // SNAKE_CASE is not idiomatic in Go, but aligned with Win32 API. const ( // from winbase.h CREATE_NEW FileCreationDisposition = 0x01 CREATE_ALWAYS FileCreationDisposition = 0x02 OPEN_EXISTING FileCreationDisposition = 0x03 OPEN_ALWAYS FileCreationDisposition = 0x04 TRUNCATE_EXISTING FileCreationDisposition = 0x05 ) // Create disposition values for NtCreate* type NTFileCreationDisposition uint32 //nolint:revive // SNAKE_CASE is not idiomatic in Go, but aligned with Win32 API. const ( // From ntioapi.h FILE_SUPERSEDE NTFileCreationDisposition = 0x00 FILE_OPEN NTFileCreationDisposition = 0x01 FILE_CREATE NTFileCreationDisposition = 0x02 FILE_OPEN_IF NTFileCreationDisposition = 0x03 FILE_OVERWRITE NTFileCreationDisposition = 0x04 FILE_OVERWRITE_IF NTFileCreationDisposition = 0x05 FILE_MAXIMUM_DISPOSITION NTFileCreationDisposition = 0x05 ) // CreateFile and co. take flags or attributes together as one parameter. // Define alias until we can use generics to allow both // // https://learn.microsoft.com/en-us/windows/win32/fileio/file-attribute-constants type FileFlagOrAttribute uint32 //nolint:revive // SNAKE_CASE is not idiomatic in Go, but aligned with Win32 API. const ( // from winnt.h FILE_FLAG_WRITE_THROUGH FileFlagOrAttribute = 0x8000_0000 FILE_FLAG_OVERLAPPED FileFlagOrAttribute = 0x4000_0000 FILE_FLAG_NO_BUFFERING FileFlagOrAttribute = 0x2000_0000 FILE_FLAG_RANDOM_ACCESS FileFlagOrAttribute = 0x1000_0000 FILE_FLAG_SEQUENTIAL_SCAN FileFlagOrAttribute = 0x0800_0000 FILE_FLAG_DELETE_ON_CLOSE FileFlagOrAttribute = 0x0400_0000 FILE_FLAG_BACKUP_SEMANTICS FileFlagOrAttribute = 0x0200_0000 FILE_FLAG_POSIX_SEMANTICS FileFlagOrAttribute = 0x0100_0000 FILE_FLAG_OPEN_REPARSE_POINT FileFlagOrAttribute = 0x0020_0000 FILE_FLAG_OPEN_NO_RECALL FileFlagOrAttribute = 0x0010_0000 FILE_FLAG_FIRST_PIPE_INSTANCE FileFlagOrAttribute = 0x0008_0000 ) // NtCreate* functions take a dedicated CreateOptions parameter. // // https://learn.microsoft.com/en-us/windows/win32/api/Winternl/nf-winternl-ntcreatefile // // https://learn.microsoft.com/en-us/windows/win32/devnotes/nt-create-named-pipe-file type NTCreateOptions uint32 //nolint:revive // SNAKE_CASE is not idiomatic in Go, but aligned with Win32 API. const ( // From ntioapi.h FILE_DIRECTORY_FILE NTCreateOptions = 0x0000_0001 FILE_WRITE_THROUGH NTCreateOptions = 0x0000_0002 FILE_SEQUENTIAL_ONLY NTCreateOptions = 0x0000_0004 FILE_NO_INTERMEDIATE_BUFFERING NTCreateOptions = 0x0000_0008 FILE_SYNCHRONOUS_IO_ALERT NTCreateOptions = 0x0000_0010 FILE_SYNCHRONOUS_IO_NONALERT NTCreateOptions = 0x0000_0020 FILE_NON_DIRECTORY_FILE NTCreateOptions = 0x0000_0040 FILE_CREATE_TREE_CONNECTION NTCreateOptions = 0x0000_0080 FILE_COMPLETE_IF_OPLOCKED NTCreateOptions = 0x0000_0100 FILE_NO_EA_KNOWLEDGE NTCreateOptions = 0x0000_0200 FILE_DISABLE_TUNNELING NTCreateOptions = 0x0000_0400 FILE_RANDOM_ACCESS NTCreateOptions = 0x0000_0800 FILE_DELETE_ON_CLOSE NTCreateOptions = 0x0000_1000 FILE_OPEN_BY_FILE_ID NTCreateOptions = 0x0000_2000 FILE_OPEN_FOR_BACKUP_INTENT NTCreateOptions = 0x0000_4000 FILE_NO_COMPRESSION NTCreateOptions = 0x0000_8000 ) type FileSQSFlag = FileFlagOrAttribute //nolint:revive // SNAKE_CASE is not idiomatic in Go, but aligned with Win32 API. const ( // from winbase.h SECURITY_ANONYMOUS FileSQSFlag = FileSQSFlag(SecurityAnonymous << 16) SECURITY_IDENTIFICATION FileSQSFlag = FileSQSFlag(SecurityIdentification << 16) SECURITY_IMPERSONATION FileSQSFlag = FileSQSFlag(SecurityImpersonation << 16) SECURITY_DELEGATION FileSQSFlag = FileSQSFlag(SecurityDelegation << 16) SECURITY_SQOS_PRESENT FileSQSFlag = 0x0010_0000 SECURITY_VALID_SQOS_FLAGS FileSQSFlag = 0x001F_0000 ) // GetFinalPathNameByHandle flags // // https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getfinalpathnamebyhandlew#parameters type GetFinalPathFlag uint32 //nolint:revive // SNAKE_CASE is not idiomatic in Go, but aligned with Win32 API. const ( GetFinalPathDefaultFlag GetFinalPathFlag = 0x0 FILE_NAME_NORMALIZED GetFinalPathFlag = 0x0 FILE_NAME_OPENED GetFinalPathFlag = 0x8 VOLUME_NAME_DOS GetFinalPathFlag = 0x0 VOLUME_NAME_GUID GetFinalPathFlag = 0x1 VOLUME_NAME_NT GetFinalPathFlag = 0x2 VOLUME_NAME_NONE GetFinalPathFlag = 0x4 ) // getFinalPathNameByHandle facilitates calling the Windows API GetFinalPathNameByHandle // with the given handle and flags. It transparently takes care of creating a buffer of the // correct size for the call. // // https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getfinalpathnamebyhandlew func GetFinalPathNameByHandle(h windows.Handle, flags GetFinalPathFlag) (string, error) { b := stringbuffer.NewWString() //TODO: can loop infinitely if Win32 keeps returning the same (or a larger) n? for { n, err := windows.GetFinalPathNameByHandle(h, b.Pointer(), b.Cap(), uint32(flags)) if err != nil { return "", err } // If the buffer wasn't large enough, n will be the total size needed (including null terminator). // Resize and try again. if n > b.Cap() { b.ResizeTo(n) continue } // If the buffer is large enough, n will be the size not including the null terminator. // Convert to a Go string and return. return b.String(), nil } } ================================================ FILE: vendor/github.com/Microsoft/go-winio/internal/fs/security.go ================================================ package fs // https://learn.microsoft.com/en-us/windows/win32/api/winnt/ne-winnt-security_impersonation_level type SecurityImpersonationLevel int32 // C default enums underlying type is `int`, which is Go `int32` // Impersonation levels const ( SecurityAnonymous SecurityImpersonationLevel = 0 SecurityIdentification SecurityImpersonationLevel = 1 SecurityImpersonation SecurityImpersonationLevel = 2 SecurityDelegation SecurityImpersonationLevel = 3 ) ================================================ FILE: vendor/github.com/Microsoft/go-winio/internal/fs/zsyscall_windows.go ================================================ //go:build windows // Code generated by 'go generate' using "github.com/Microsoft/go-winio/tools/mkwinsyscall"; DO NOT EDIT. package fs import ( "syscall" "unsafe" "golang.org/x/sys/windows" ) var _ unsafe.Pointer // Do the interface allocations only once for common // Errno values. const ( errnoERROR_IO_PENDING = 997 ) var ( errERROR_IO_PENDING error = syscall.Errno(errnoERROR_IO_PENDING) errERROR_EINVAL error = syscall.EINVAL ) // errnoErr returns common boxed Errno values, to prevent // allocations at runtime. func errnoErr(e syscall.Errno) error { switch e { case 0: return errERROR_EINVAL case errnoERROR_IO_PENDING: return errERROR_IO_PENDING } return e } var ( modkernel32 = windows.NewLazySystemDLL("kernel32.dll") procCreateFileW = modkernel32.NewProc("CreateFileW") ) func CreateFile(name string, access AccessMask, mode FileShareMode, sa *windows.SecurityAttributes, createmode FileCreationDisposition, attrs FileFlagOrAttribute, templatefile windows.Handle) (handle windows.Handle, err error) { var _p0 *uint16 _p0, err = syscall.UTF16PtrFromString(name) if err != nil { return } return _CreateFile(_p0, access, mode, sa, createmode, attrs, templatefile) } func _CreateFile(name *uint16, access AccessMask, mode FileShareMode, sa *windows.SecurityAttributes, createmode FileCreationDisposition, attrs FileFlagOrAttribute, templatefile windows.Handle) (handle windows.Handle, err error) { r0, _, e1 := syscall.SyscallN(procCreateFileW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(access), uintptr(mode), uintptr(unsafe.Pointer(sa)), uintptr(createmode), uintptr(attrs), uintptr(templatefile)) handle = windows.Handle(r0) if handle == windows.InvalidHandle { err = errnoErr(e1) } return } ================================================ FILE: vendor/github.com/Microsoft/go-winio/internal/socket/rawaddr.go ================================================ package socket import ( "unsafe" ) // RawSockaddr allows structs to be used with [Bind] and [ConnectEx]. The // struct must meet the Win32 sockaddr requirements specified here: // https://docs.microsoft.com/en-us/windows/win32/winsock/sockaddr-2 // // Specifically, the struct size must be least larger than an int16 (unsigned short) // for the address family. type RawSockaddr interface { // Sockaddr returns a pointer to the RawSockaddr and its struct size, allowing // for the RawSockaddr's data to be overwritten by syscalls (if necessary). // // It is the callers responsibility to validate that the values are valid; invalid // pointers or size can cause a panic. Sockaddr() (unsafe.Pointer, int32, error) } ================================================ FILE: vendor/github.com/Microsoft/go-winio/internal/socket/socket.go ================================================ //go:build windows package socket import ( "errors" "fmt" "net" "sync" "syscall" "unsafe" "github.com/Microsoft/go-winio/pkg/guid" "golang.org/x/sys/windows" ) //go:generate go run github.com/Microsoft/go-winio/tools/mkwinsyscall -output zsyscall_windows.go socket.go //sys getsockname(s windows.Handle, name unsafe.Pointer, namelen *int32) (err error) [failretval==socketError] = ws2_32.getsockname //sys getpeername(s windows.Handle, name unsafe.Pointer, namelen *int32) (err error) [failretval==socketError] = ws2_32.getpeername //sys bind(s windows.Handle, name unsafe.Pointer, namelen int32) (err error) [failretval==socketError] = ws2_32.bind const socketError = uintptr(^uint32(0)) var ( // todo(helsaawy): create custom error types to store the desired vs actual size and addr family? ErrBufferSize = errors.New("buffer size") ErrAddrFamily = errors.New("address family") ErrInvalidPointer = errors.New("invalid pointer") ErrSocketClosed = fmt.Errorf("socket closed: %w", net.ErrClosed) ) // todo(helsaawy): replace these with generics, ie: GetSockName[S RawSockaddr](s windows.Handle) (S, error) // GetSockName writes the local address of socket s to the [RawSockaddr] rsa. // If rsa is not large enough, the [windows.WSAEFAULT] is returned. func GetSockName(s windows.Handle, rsa RawSockaddr) error { ptr, l, err := rsa.Sockaddr() if err != nil { return fmt.Errorf("could not retrieve socket pointer and size: %w", err) } // although getsockname returns WSAEFAULT if the buffer is too small, it does not set // &l to the correct size, so--apart from doubling the buffer repeatedly--there is no remedy return getsockname(s, ptr, &l) } // GetPeerName returns the remote address the socket is connected to. // // See [GetSockName] for more information. func GetPeerName(s windows.Handle, rsa RawSockaddr) error { ptr, l, err := rsa.Sockaddr() if err != nil { return fmt.Errorf("could not retrieve socket pointer and size: %w", err) } return getpeername(s, ptr, &l) } func Bind(s windows.Handle, rsa RawSockaddr) (err error) { ptr, l, err := rsa.Sockaddr() if err != nil { return fmt.Errorf("could not retrieve socket pointer and size: %w", err) } return bind(s, ptr, l) } // "golang.org/x/sys/windows".ConnectEx and .Bind only accept internal implementations of the // their sockaddr interface, so they cannot be used with HvsockAddr // Replicate functionality here from // https://cs.opensource.google/go/x/sys/+/master:windows/syscall_windows.go // The function pointers to `AcceptEx`, `ConnectEx` and `GetAcceptExSockaddrs` must be loaded at // runtime via a WSAIoctl call: // https://docs.microsoft.com/en-us/windows/win32/api/Mswsock/nc-mswsock-lpfn_connectex#remarks type runtimeFunc struct { id guid.GUID once sync.Once addr uintptr err error } func (f *runtimeFunc) Load() error { f.once.Do(func() { var s windows.Handle s, f.err = windows.Socket(windows.AF_INET, windows.SOCK_STREAM, windows.IPPROTO_TCP) if f.err != nil { return } defer windows.CloseHandle(s) //nolint:errcheck var n uint32 f.err = windows.WSAIoctl(s, windows.SIO_GET_EXTENSION_FUNCTION_POINTER, (*byte)(unsafe.Pointer(&f.id)), uint32(unsafe.Sizeof(f.id)), (*byte)(unsafe.Pointer(&f.addr)), uint32(unsafe.Sizeof(f.addr)), &n, nil, // overlapped 0, // completionRoutine ) }) return f.err } var ( // todo: add `AcceptEx` and `GetAcceptExSockaddrs` WSAID_CONNECTEX = guid.GUID{ //revive:disable-line:var-naming ALL_CAPS Data1: 0x25a207b9, Data2: 0xddf3, Data3: 0x4660, Data4: [8]byte{0x8e, 0xe9, 0x76, 0xe5, 0x8c, 0x74, 0x06, 0x3e}, } connectExFunc = runtimeFunc{id: WSAID_CONNECTEX} ) func ConnectEx( fd windows.Handle, rsa RawSockaddr, sendBuf *byte, sendDataLen uint32, bytesSent *uint32, overlapped *windows.Overlapped, ) error { if err := connectExFunc.Load(); err != nil { return fmt.Errorf("failed to load ConnectEx function pointer: %w", err) } ptr, n, err := rsa.Sockaddr() if err != nil { return err } return connectEx(fd, ptr, n, sendBuf, sendDataLen, bytesSent, overlapped) } // BOOL LpfnConnectex( // [in] SOCKET s, // [in] const sockaddr *name, // [in] int namelen, // [in, optional] PVOID lpSendBuffer, // [in] DWORD dwSendDataLength, // [out] LPDWORD lpdwBytesSent, // [in] LPOVERLAPPED lpOverlapped // ) func connectEx( s windows.Handle, name unsafe.Pointer, namelen int32, sendBuf *byte, sendDataLen uint32, bytesSent *uint32, overlapped *windows.Overlapped, ) (err error) { r1, _, e1 := syscall.SyscallN(connectExFunc.addr, uintptr(s), uintptr(name), uintptr(namelen), uintptr(unsafe.Pointer(sendBuf)), uintptr(sendDataLen), uintptr(unsafe.Pointer(bytesSent)), uintptr(unsafe.Pointer(overlapped)), ) if r1 == 0 { if e1 != 0 { err = error(e1) } else { err = syscall.EINVAL } } return err } ================================================ FILE: vendor/github.com/Microsoft/go-winio/internal/socket/zsyscall_windows.go ================================================ //go:build windows // Code generated by 'go generate' using "github.com/Microsoft/go-winio/tools/mkwinsyscall"; DO NOT EDIT. package socket import ( "syscall" "unsafe" "golang.org/x/sys/windows" ) var _ unsafe.Pointer // Do the interface allocations only once for common // Errno values. const ( errnoERROR_IO_PENDING = 997 ) var ( errERROR_IO_PENDING error = syscall.Errno(errnoERROR_IO_PENDING) errERROR_EINVAL error = syscall.EINVAL ) // errnoErr returns common boxed Errno values, to prevent // allocations at runtime. func errnoErr(e syscall.Errno) error { switch e { case 0: return errERROR_EINVAL case errnoERROR_IO_PENDING: return errERROR_IO_PENDING } return e } var ( modws2_32 = windows.NewLazySystemDLL("ws2_32.dll") procbind = modws2_32.NewProc("bind") procgetpeername = modws2_32.NewProc("getpeername") procgetsockname = modws2_32.NewProc("getsockname") ) func bind(s windows.Handle, name unsafe.Pointer, namelen int32) (err error) { r1, _, e1 := syscall.SyscallN(procbind.Addr(), uintptr(s), uintptr(name), uintptr(namelen)) if r1 == socketError { err = errnoErr(e1) } return } func getpeername(s windows.Handle, name unsafe.Pointer, namelen *int32) (err error) { r1, _, e1 := syscall.SyscallN(procgetpeername.Addr(), uintptr(s), uintptr(name), uintptr(unsafe.Pointer(namelen))) if r1 == socketError { err = errnoErr(e1) } return } func getsockname(s windows.Handle, name unsafe.Pointer, namelen *int32) (err error) { r1, _, e1 := syscall.SyscallN(procgetsockname.Addr(), uintptr(s), uintptr(name), uintptr(unsafe.Pointer(namelen))) if r1 == socketError { err = errnoErr(e1) } return } ================================================ FILE: vendor/github.com/Microsoft/go-winio/internal/stringbuffer/wstring.go ================================================ package stringbuffer import ( "sync" "unicode/utf16" ) // TODO: worth exporting and using in mkwinsyscall? // Uint16BufferSize is the buffer size in the pool, chosen somewhat arbitrarily to accommodate // large path strings: // MAX_PATH (260) + size of volume GUID prefix (49) + null terminator = 310. const MinWStringCap = 310 // use *[]uint16 since []uint16 creates an extra allocation where the slice header // is copied to heap and then referenced via pointer in the interface header that sync.Pool // stores. var pathPool = sync.Pool{ // if go1.18+ adds Pool[T], use that to store []uint16 directly New: func() interface{} { b := make([]uint16, MinWStringCap) return &b }, } func newBuffer() []uint16 { return *(pathPool.Get().(*[]uint16)) } // freeBuffer copies the slice header data, and puts a pointer to that in the pool. // This avoids taking a pointer to the slice header in WString, which can be set to nil. func freeBuffer(b []uint16) { pathPool.Put(&b) } // WString is a wide string buffer ([]uint16) meant for storing UTF-16 encoded strings // for interacting with Win32 APIs. // Sizes are specified as uint32 and not int. // // It is not thread safe. type WString struct { // type-def allows casting to []uint16 directly, use struct to prevent that and allow adding fields in the future. // raw buffer b []uint16 } // NewWString returns a [WString] allocated from a shared pool with an // initial capacity of at least [MinWStringCap]. // Since the buffer may have been previously used, its contents are not guaranteed to be empty. // // The buffer should be freed via [WString.Free] func NewWString() *WString { return &WString{ b: newBuffer(), } } func (b *WString) Free() { if b.empty() { return } freeBuffer(b.b) b.b = nil } // ResizeTo grows the buffer to at least c and returns the new capacity, freeing the // previous buffer back into pool. func (b *WString) ResizeTo(c uint32) uint32 { // already sufficient (or n is 0) if c <= b.Cap() { return b.Cap() } if c <= MinWStringCap { c = MinWStringCap } // allocate at-least double buffer size, as is done in [bytes.Buffer] and other places if c <= 2*b.Cap() { c = 2 * b.Cap() } b2 := make([]uint16, c) if !b.empty() { copy(b2, b.b) freeBuffer(b.b) } b.b = b2 return c } // Buffer returns the underlying []uint16 buffer. func (b *WString) Buffer() []uint16 { if b.empty() { return nil } return b.b } // Pointer returns a pointer to the first uint16 in the buffer. // If the [WString.Free] has already been called, the pointer will be nil. func (b *WString) Pointer() *uint16 { if b.empty() { return nil } return &b.b[0] } // String returns the returns the UTF-8 encoding of the UTF-16 string in the buffer. // // It assumes that the data is null-terminated. func (b *WString) String() string { // Using [windows.UTF16ToString] would require importing "golang.org/x/sys/windows" // and would make this code Windows-only, which makes no sense. // So copy UTF16ToString code into here. // If other windows-specific code is added, switch to [windows.UTF16ToString] s := b.b for i, v := range s { if v == 0 { s = s[:i] break } } return string(utf16.Decode(s)) } // Cap returns the underlying buffer capacity. func (b *WString) Cap() uint32 { if b.empty() { return 0 } return b.cap() } func (b *WString) cap() uint32 { return uint32(cap(b.b)) } func (b *WString) empty() bool { return b == nil || b.cap() == 0 } ================================================ FILE: vendor/github.com/Microsoft/go-winio/pipe.go ================================================ //go:build windows // +build windows package winio import ( "context" "errors" "fmt" "io" "net" "os" "runtime" "time" "unsafe" "golang.org/x/sys/windows" "github.com/Microsoft/go-winio/internal/fs" ) //sys connectNamedPipe(pipe windows.Handle, o *windows.Overlapped) (err error) = ConnectNamedPipe //sys createNamedPipe(name string, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *windows.SecurityAttributes) (handle windows.Handle, err error) [failretval==windows.InvalidHandle] = CreateNamedPipeW //sys disconnectNamedPipe(pipe windows.Handle) (err error) = DisconnectNamedPipe //sys getNamedPipeInfo(pipe windows.Handle, flags *uint32, outSize *uint32, inSize *uint32, maxInstances *uint32) (err error) = GetNamedPipeInfo //sys getNamedPipeHandleState(pipe windows.Handle, state *uint32, curInstances *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32, userName *uint16, maxUserNameSize uint32) (err error) = GetNamedPipeHandleStateW //sys ntCreateNamedPipeFile(pipe *windows.Handle, access ntAccessMask, oa *objectAttributes, iosb *ioStatusBlock, share ntFileShareMode, disposition ntFileCreationDisposition, options ntFileOptions, typ uint32, readMode uint32, completionMode uint32, maxInstances uint32, inboundQuota uint32, outputQuota uint32, timeout *int64) (status ntStatus) = ntdll.NtCreateNamedPipeFile //sys rtlNtStatusToDosError(status ntStatus) (winerr error) = ntdll.RtlNtStatusToDosErrorNoTeb //sys rtlDosPathNameToNtPathName(name *uint16, ntName *unicodeString, filePart uintptr, reserved uintptr) (status ntStatus) = ntdll.RtlDosPathNameToNtPathName_U //sys rtlDefaultNpAcl(dacl *uintptr) (status ntStatus) = ntdll.RtlDefaultNpAcl type PipeConn interface { net.Conn Disconnect() error Flush() error } // type aliases for mkwinsyscall code type ( ntAccessMask = fs.AccessMask ntFileShareMode = fs.FileShareMode ntFileCreationDisposition = fs.NTFileCreationDisposition ntFileOptions = fs.NTCreateOptions ) type ioStatusBlock struct { Status, Information uintptr } // typedef struct _OBJECT_ATTRIBUTES { // ULONG Length; // HANDLE RootDirectory; // PUNICODE_STRING ObjectName; // ULONG Attributes; // PVOID SecurityDescriptor; // PVOID SecurityQualityOfService; // } OBJECT_ATTRIBUTES; // // https://learn.microsoft.com/en-us/windows/win32/api/ntdef/ns-ntdef-_object_attributes type objectAttributes struct { Length uintptr RootDirectory uintptr ObjectName *unicodeString Attributes uintptr SecurityDescriptor *securityDescriptor SecurityQoS uintptr } type unicodeString struct { Length uint16 MaximumLength uint16 Buffer uintptr } // typedef struct _SECURITY_DESCRIPTOR { // BYTE Revision; // BYTE Sbz1; // SECURITY_DESCRIPTOR_CONTROL Control; // PSID Owner; // PSID Group; // PACL Sacl; // PACL Dacl; // } SECURITY_DESCRIPTOR, *PISECURITY_DESCRIPTOR; // // https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-security_descriptor type securityDescriptor struct { Revision byte Sbz1 byte Control uint16 Owner uintptr Group uintptr Sacl uintptr //revive:disable-line:var-naming SACL, not Sacl Dacl uintptr //revive:disable-line:var-naming DACL, not Dacl } type ntStatus int32 func (status ntStatus) Err() error { if status >= 0 { return nil } return rtlNtStatusToDosError(status) } var ( // ErrPipeListenerClosed is returned for pipe operations on listeners that have been closed. ErrPipeListenerClosed = net.ErrClosed errPipeWriteClosed = errors.New("pipe has been closed for write") ) type win32Pipe struct { *win32File path string } var _ PipeConn = (*win32Pipe)(nil) type win32MessageBytePipe struct { win32Pipe writeClosed bool readEOF bool } type pipeAddress string func (f *win32Pipe) LocalAddr() net.Addr { return pipeAddress(f.path) } func (f *win32Pipe) RemoteAddr() net.Addr { return pipeAddress(f.path) } func (f *win32Pipe) SetDeadline(t time.Time) error { if err := f.SetReadDeadline(t); err != nil { return err } return f.SetWriteDeadline(t) } func (f *win32Pipe) Disconnect() error { return disconnectNamedPipe(f.win32File.handle) } // CloseWrite closes the write side of a message pipe in byte mode. func (f *win32MessageBytePipe) CloseWrite() error { if f.writeClosed { return errPipeWriteClosed } err := f.win32File.Flush() if err != nil { return err } _, err = f.win32File.Write(nil) if err != nil { return err } f.writeClosed = true return nil } // Write writes bytes to a message pipe in byte mode. Zero-byte writes are ignored, since // they are used to implement CloseWrite(). func (f *win32MessageBytePipe) Write(b []byte) (int, error) { if f.writeClosed { return 0, errPipeWriteClosed } if len(b) == 0 { return 0, nil } return f.win32File.Write(b) } // Read reads bytes from a message pipe in byte mode. A read of a zero-byte message on a message // mode pipe will return io.EOF, as will all subsequent reads. func (f *win32MessageBytePipe) Read(b []byte) (int, error) { if f.readEOF { return 0, io.EOF } n, err := f.win32File.Read(b) if err == io.EOF { //nolint:errorlint // If this was the result of a zero-byte read, then // it is possible that the read was due to a zero-size // message. Since we are simulating CloseWrite with a // zero-byte message, ensure that all future Read() calls // also return EOF. f.readEOF = true } else if err == windows.ERROR_MORE_DATA { //nolint:errorlint // err is Errno // ERROR_MORE_DATA indicates that the pipe's read mode is message mode // and the message still has more bytes. Treat this as a success, since // this package presents all named pipes as byte streams. err = nil } return n, err } func (pipeAddress) Network() string { return "pipe" } func (s pipeAddress) String() string { return string(s) } // tryDialPipe attempts to dial the pipe at `path` until `ctx` cancellation or timeout. func tryDialPipe(ctx context.Context, path *string, access fs.AccessMask, impLevel PipeImpLevel) (windows.Handle, error) { for { select { case <-ctx.Done(): return windows.Handle(0), ctx.Err() default: h, err := fs.CreateFile(*path, access, 0, // mode nil, // security attributes fs.OPEN_EXISTING, fs.FILE_FLAG_OVERLAPPED|fs.SECURITY_SQOS_PRESENT|fs.FileSQSFlag(impLevel), 0, // template file handle ) if err == nil { return h, nil } if err != windows.ERROR_PIPE_BUSY { //nolint:errorlint // err is Errno return h, &os.PathError{Err: err, Op: "open", Path: *path} } // Wait 10 msec and try again. This is a rather simplistic // view, as we always try each 10 milliseconds. time.Sleep(10 * time.Millisecond) } } } // DialPipe connects to a named pipe by path, timing out if the connection // takes longer than the specified duration. If timeout is nil, then we use // a default timeout of 2 seconds. (We do not use WaitNamedPipe.) func DialPipe(path string, timeout *time.Duration) (net.Conn, error) { var absTimeout time.Time if timeout != nil { absTimeout = time.Now().Add(*timeout) } else { absTimeout = time.Now().Add(2 * time.Second) } ctx, cancel := context.WithDeadline(context.Background(), absTimeout) defer cancel() conn, err := DialPipeContext(ctx, path) if errors.Is(err, context.DeadlineExceeded) { return nil, ErrTimeout } return conn, err } // DialPipeContext attempts to connect to a named pipe by `path` until `ctx` // cancellation or timeout. func DialPipeContext(ctx context.Context, path string) (net.Conn, error) { return DialPipeAccess(ctx, path, uint32(fs.GENERIC_READ|fs.GENERIC_WRITE)) } // PipeImpLevel is an enumeration of impersonation levels that may be set // when calling DialPipeAccessImpersonation. type PipeImpLevel uint32 const ( PipeImpLevelAnonymous = PipeImpLevel(fs.SECURITY_ANONYMOUS) PipeImpLevelIdentification = PipeImpLevel(fs.SECURITY_IDENTIFICATION) PipeImpLevelImpersonation = PipeImpLevel(fs.SECURITY_IMPERSONATION) PipeImpLevelDelegation = PipeImpLevel(fs.SECURITY_DELEGATION) ) // DialPipeAccess attempts to connect to a named pipe by `path` with `access` until `ctx` // cancellation or timeout. func DialPipeAccess(ctx context.Context, path string, access uint32) (net.Conn, error) { return DialPipeAccessImpLevel(ctx, path, access, PipeImpLevelAnonymous) } // DialPipeAccessImpLevel attempts to connect to a named pipe by `path` with // `access` at `impLevel` until `ctx` cancellation or timeout. The other // DialPipe* implementations use PipeImpLevelAnonymous. func DialPipeAccessImpLevel(ctx context.Context, path string, access uint32, impLevel PipeImpLevel) (net.Conn, error) { var err error var h windows.Handle h, err = tryDialPipe(ctx, &path, fs.AccessMask(access), impLevel) if err != nil { return nil, err } var flags uint32 err = getNamedPipeInfo(h, &flags, nil, nil, nil) if err != nil { return nil, err } f, err := makeWin32File(h) if err != nil { windows.Close(h) return nil, err } // If the pipe is in message mode, return a message byte pipe, which // supports CloseWrite(). if flags&windows.PIPE_TYPE_MESSAGE != 0 { return &win32MessageBytePipe{ win32Pipe: win32Pipe{win32File: f, path: path}, }, nil } return &win32Pipe{win32File: f, path: path}, nil } type acceptResponse struct { f *win32File err error } type win32PipeListener struct { firstHandle windows.Handle path string config PipeConfig acceptCh chan (chan acceptResponse) closeCh chan int doneCh chan int } func makeServerPipeHandle(path string, sd []byte, c *PipeConfig, first bool) (windows.Handle, error) { path16, err := windows.UTF16FromString(path) if err != nil { return 0, &os.PathError{Op: "open", Path: path, Err: err} } var oa objectAttributes oa.Length = unsafe.Sizeof(oa) var ntPath unicodeString if err := rtlDosPathNameToNtPathName(&path16[0], &ntPath, 0, 0, ).Err(); err != nil { return 0, &os.PathError{Op: "open", Path: path, Err: err} } defer windows.LocalFree(windows.Handle(ntPath.Buffer)) //nolint:errcheck oa.ObjectName = &ntPath oa.Attributes = windows.OBJ_CASE_INSENSITIVE // The security descriptor is only needed for the first pipe. if first { if sd != nil { //todo: does `sdb` need to be allocated on the heap, or can go allocate it? l := uint32(len(sd)) sdb, err := windows.LocalAlloc(0, l) if err != nil { return 0, fmt.Errorf("LocalAlloc for security descriptor with of length %d: %w", l, err) } defer windows.LocalFree(windows.Handle(sdb)) //nolint:errcheck copy((*[0xffff]byte)(unsafe.Pointer(sdb))[:], sd) oa.SecurityDescriptor = (*securityDescriptor)(unsafe.Pointer(sdb)) } else { // Construct the default named pipe security descriptor. var dacl uintptr if err := rtlDefaultNpAcl(&dacl).Err(); err != nil { return 0, fmt.Errorf("getting default named pipe ACL: %w", err) } defer windows.LocalFree(windows.Handle(dacl)) //nolint:errcheck sdb := &securityDescriptor{ Revision: 1, Control: windows.SE_DACL_PRESENT, Dacl: dacl, } oa.SecurityDescriptor = sdb } } typ := uint32(windows.FILE_PIPE_REJECT_REMOTE_CLIENTS) if c.MessageMode { typ |= windows.FILE_PIPE_MESSAGE_TYPE } disposition := fs.FILE_OPEN access := fs.GENERIC_READ | fs.GENERIC_WRITE | fs.SYNCHRONIZE if first { disposition = fs.FILE_CREATE // By not asking for read or write access, the named pipe file system // will put this pipe into an initially disconnected state, blocking // client connections until the next call with first == false. access = fs.SYNCHRONIZE } timeout := int64(-50 * 10000) // 50ms var ( h windows.Handle iosb ioStatusBlock ) err = ntCreateNamedPipeFile(&h, access, &oa, &iosb, fs.FILE_SHARE_READ|fs.FILE_SHARE_WRITE, disposition, 0, typ, 0, 0, 0xffffffff, uint32(c.InputBufferSize), uint32(c.OutputBufferSize), &timeout).Err() if err != nil { return 0, &os.PathError{Op: "open", Path: path, Err: err} } runtime.KeepAlive(ntPath) return h, nil } func (l *win32PipeListener) makeServerPipe() (*win32File, error) { h, err := makeServerPipeHandle(l.path, nil, &l.config, false) if err != nil { return nil, err } f, err := makeWin32File(h) if err != nil { windows.Close(h) return nil, err } return f, nil } func (l *win32PipeListener) makeConnectedServerPipe() (*win32File, error) { p, err := l.makeServerPipe() if err != nil { return nil, err } // Wait for the client to connect. ch := make(chan error) go func(p *win32File) { ch <- connectPipe(p) }(p) select { case err = <-ch: if err != nil { p.Close() p = nil } case <-l.closeCh: // Abort the connect request by closing the handle. p.Close() p = nil err = <-ch if err == nil || err == ErrFileClosed { //nolint:errorlint // err is Errno err = ErrPipeListenerClosed } } return p, err } func (l *win32PipeListener) listenerRoutine() { closed := false for !closed { select { case <-l.closeCh: closed = true case responseCh := <-l.acceptCh: var ( p *win32File err error ) for { p, err = l.makeConnectedServerPipe() // If the connection was immediately closed by the client, try // again. if err != windows.ERROR_NO_DATA { //nolint:errorlint // err is Errno break } } responseCh <- acceptResponse{p, err} closed = err == ErrPipeListenerClosed //nolint:errorlint // err is Errno } } windows.Close(l.firstHandle) l.firstHandle = 0 // Notify Close() and Accept() callers that the handle has been closed. close(l.doneCh) } // PipeConfig contain configuration for the pipe listener. type PipeConfig struct { // SecurityDescriptor contains a Windows security descriptor in SDDL format. SecurityDescriptor string // MessageMode determines whether the pipe is in byte or message mode. In either // case the pipe is read in byte mode by default. The only practical difference in // this implementation is that CloseWrite() is only supported for message mode pipes; // CloseWrite() is implemented as a zero-byte write, but zero-byte writes are only // transferred to the reader (and returned as io.EOF in this implementation) // when the pipe is in message mode. MessageMode bool // InputBufferSize specifies the size of the input buffer, in bytes. InputBufferSize int32 // OutputBufferSize specifies the size of the output buffer, in bytes. OutputBufferSize int32 } // ListenPipe creates a listener on a Windows named pipe path, e.g. \\.\pipe\mypipe. // The pipe must not already exist. func ListenPipe(path string, c *PipeConfig) (net.Listener, error) { var ( sd []byte err error ) if c == nil { c = &PipeConfig{} } if c.SecurityDescriptor != "" { sd, err = SddlToSecurityDescriptor(c.SecurityDescriptor) if err != nil { return nil, err } } h, err := makeServerPipeHandle(path, sd, c, true) if err != nil { return nil, err } l := &win32PipeListener{ firstHandle: h, path: path, config: *c, acceptCh: make(chan (chan acceptResponse)), closeCh: make(chan int), doneCh: make(chan int), } go l.listenerRoutine() return l, nil } func connectPipe(p *win32File) error { c, err := p.prepareIO() if err != nil { return err } defer p.wg.Done() err = connectNamedPipe(p.handle, &c.o) _, err = p.asyncIO(c, nil, 0, err) if err != nil && err != windows.ERROR_PIPE_CONNECTED { //nolint:errorlint // err is Errno return err } return nil } func (l *win32PipeListener) Accept() (net.Conn, error) { ch := make(chan acceptResponse) select { case l.acceptCh <- ch: response := <-ch err := response.err if err != nil { return nil, err } if l.config.MessageMode { return &win32MessageBytePipe{ win32Pipe: win32Pipe{win32File: response.f, path: l.path}, }, nil } return &win32Pipe{win32File: response.f, path: l.path}, nil case <-l.doneCh: return nil, ErrPipeListenerClosed } } func (l *win32PipeListener) Close() error { select { case l.closeCh <- 1: <-l.doneCh case <-l.doneCh: } return nil } func (l *win32PipeListener) Addr() net.Addr { return pipeAddress(l.path) } ================================================ FILE: vendor/github.com/Microsoft/go-winio/pkg/guid/guid.go ================================================ // Package guid provides a GUID type. The backing structure for a GUID is // identical to that used by the golang.org/x/sys/windows GUID type. // There are two main binary encodings used for a GUID, the big-endian encoding, // and the Windows (mixed-endian) encoding. See here for details: // https://en.wikipedia.org/wiki/Universally_unique_identifier#Encoding package guid import ( "crypto/rand" "crypto/sha1" //nolint:gosec // not used for secure application "encoding" "encoding/binary" "fmt" "strconv" ) //go:generate go run golang.org/x/tools/cmd/stringer -type=Variant -trimprefix=Variant -linecomment // Variant specifies which GUID variant (or "type") of the GUID. It determines // how the entirety of the rest of the GUID is interpreted. type Variant uint8 // The variants specified by RFC 4122 section 4.1.1. const ( // VariantUnknown specifies a GUID variant which does not conform to one of // the variant encodings specified in RFC 4122. VariantUnknown Variant = iota VariantNCS VariantRFC4122 // RFC 4122 VariantMicrosoft VariantFuture ) // Version specifies how the bits in the GUID were generated. For instance, a // version 4 GUID is randomly generated, and a version 5 is generated from the // hash of an input string. type Version uint8 func (v Version) String() string { return strconv.FormatUint(uint64(v), 10) } var _ = (encoding.TextMarshaler)(GUID{}) var _ = (encoding.TextUnmarshaler)(&GUID{}) // NewV4 returns a new version 4 (pseudorandom) GUID, as defined by RFC 4122. func NewV4() (GUID, error) { var b [16]byte if _, err := rand.Read(b[:]); err != nil { return GUID{}, err } g := FromArray(b) g.setVersion(4) // Version 4 means randomly generated. g.setVariant(VariantRFC4122) return g, nil } // NewV5 returns a new version 5 (generated from a string via SHA-1 hashing) // GUID, as defined by RFC 4122. The RFC is unclear on the encoding of the name, // and the sample code treats it as a series of bytes, so we do the same here. // // Some implementations, such as those found on Windows, treat the name as a // big-endian UTF16 stream of bytes. If that is desired, the string can be // encoded as such before being passed to this function. func NewV5(namespace GUID, name []byte) (GUID, error) { b := sha1.New() //nolint:gosec // not used for secure application namespaceBytes := namespace.ToArray() b.Write(namespaceBytes[:]) b.Write(name) a := [16]byte{} copy(a[:], b.Sum(nil)) g := FromArray(a) g.setVersion(5) // Version 5 means generated from a string. g.setVariant(VariantRFC4122) return g, nil } func fromArray(b [16]byte, order binary.ByteOrder) GUID { var g GUID g.Data1 = order.Uint32(b[0:4]) g.Data2 = order.Uint16(b[4:6]) g.Data3 = order.Uint16(b[6:8]) copy(g.Data4[:], b[8:16]) return g } func (g GUID) toArray(order binary.ByteOrder) [16]byte { b := [16]byte{} order.PutUint32(b[0:4], g.Data1) order.PutUint16(b[4:6], g.Data2) order.PutUint16(b[6:8], g.Data3) copy(b[8:16], g.Data4[:]) return b } // FromArray constructs a GUID from a big-endian encoding array of 16 bytes. func FromArray(b [16]byte) GUID { return fromArray(b, binary.BigEndian) } // ToArray returns an array of 16 bytes representing the GUID in big-endian // encoding. func (g GUID) ToArray() [16]byte { return g.toArray(binary.BigEndian) } // FromWindowsArray constructs a GUID from a Windows encoding array of bytes. func FromWindowsArray(b [16]byte) GUID { return fromArray(b, binary.LittleEndian) } // ToWindowsArray returns an array of 16 bytes representing the GUID in Windows // encoding. func (g GUID) ToWindowsArray() [16]byte { return g.toArray(binary.LittleEndian) } func (g GUID) String() string { return fmt.Sprintf( "%08x-%04x-%04x-%04x-%012x", g.Data1, g.Data2, g.Data3, g.Data4[:2], g.Data4[2:]) } // FromString parses a string containing a GUID and returns the GUID. The only // format currently supported is the `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` // format. func FromString(s string) (GUID, error) { if len(s) != 36 { return GUID{}, fmt.Errorf("invalid GUID %q", s) } if s[8] != '-' || s[13] != '-' || s[18] != '-' || s[23] != '-' { return GUID{}, fmt.Errorf("invalid GUID %q", s) } var g GUID data1, err := strconv.ParseUint(s[0:8], 16, 32) if err != nil { return GUID{}, fmt.Errorf("invalid GUID %q", s) } g.Data1 = uint32(data1) data2, err := strconv.ParseUint(s[9:13], 16, 16) if err != nil { return GUID{}, fmt.Errorf("invalid GUID %q", s) } g.Data2 = uint16(data2) data3, err := strconv.ParseUint(s[14:18], 16, 16) if err != nil { return GUID{}, fmt.Errorf("invalid GUID %q", s) } g.Data3 = uint16(data3) for i, x := range []int{19, 21, 24, 26, 28, 30, 32, 34} { v, err := strconv.ParseUint(s[x:x+2], 16, 8) if err != nil { return GUID{}, fmt.Errorf("invalid GUID %q", s) } g.Data4[i] = uint8(v) } return g, nil } func (g *GUID) setVariant(v Variant) { d := g.Data4[0] switch v { case VariantNCS: d = (d & 0x7f) case VariantRFC4122: d = (d & 0x3f) | 0x80 case VariantMicrosoft: d = (d & 0x1f) | 0xc0 case VariantFuture: d = (d & 0x0f) | 0xe0 case VariantUnknown: fallthrough default: panic(fmt.Sprintf("invalid variant: %d", v)) } g.Data4[0] = d } // Variant returns the GUID variant, as defined in RFC 4122. func (g GUID) Variant() Variant { b := g.Data4[0] if b&0x80 == 0 { return VariantNCS } else if b&0xc0 == 0x80 { return VariantRFC4122 } else if b&0xe0 == 0xc0 { return VariantMicrosoft } else if b&0xe0 == 0xe0 { return VariantFuture } return VariantUnknown } func (g *GUID) setVersion(v Version) { g.Data3 = (g.Data3 & 0x0fff) | (uint16(v) << 12) } // Version returns the GUID version, as defined in RFC 4122. func (g GUID) Version() Version { return Version((g.Data3 & 0xF000) >> 12) } // MarshalText returns the textual representation of the GUID. func (g GUID) MarshalText() ([]byte, error) { return []byte(g.String()), nil } // UnmarshalText takes the textual representation of a GUID, and unmarhals it // into this GUID. func (g *GUID) UnmarshalText(text []byte) error { g2, err := FromString(string(text)) if err != nil { return err } *g = g2 return nil } ================================================ FILE: vendor/github.com/Microsoft/go-winio/pkg/guid/guid_nonwindows.go ================================================ //go:build !windows // +build !windows package guid // GUID represents a GUID/UUID. It has the same structure as // golang.org/x/sys/windows.GUID so that it can be used with functions expecting // that type. It is defined as its own type as that is only available to builds // targeted at `windows`. The representation matches that used by native Windows // code. type GUID struct { Data1 uint32 Data2 uint16 Data3 uint16 Data4 [8]byte } ================================================ FILE: vendor/github.com/Microsoft/go-winio/pkg/guid/guid_windows.go ================================================ //go:build windows // +build windows package guid import "golang.org/x/sys/windows" // GUID represents a GUID/UUID. It has the same structure as // golang.org/x/sys/windows.GUID so that it can be used with functions expecting // that type. It is defined as its own type so that stringification and // marshaling can be supported. The representation matches that used by native // Windows code. type GUID windows.GUID ================================================ FILE: vendor/github.com/Microsoft/go-winio/pkg/guid/variant_string.go ================================================ // Code generated by "stringer -type=Variant -trimprefix=Variant -linecomment"; DO NOT EDIT. package guid import "strconv" func _() { // An "invalid array index" compiler error signifies that the constant values have changed. // Re-run the stringer command to generate them again. var x [1]struct{} _ = x[VariantUnknown-0] _ = x[VariantNCS-1] _ = x[VariantRFC4122-2] _ = x[VariantMicrosoft-3] _ = x[VariantFuture-4] } const _Variant_name = "UnknownNCSRFC 4122MicrosoftFuture" var _Variant_index = [...]uint8{0, 7, 10, 18, 27, 33} func (i Variant) String() string { if i >= Variant(len(_Variant_index)-1) { return "Variant(" + strconv.FormatInt(int64(i), 10) + ")" } return _Variant_name[_Variant_index[i]:_Variant_index[i+1]] } ================================================ FILE: vendor/github.com/Microsoft/go-winio/privilege.go ================================================ //go:build windows // +build windows package winio import ( "bytes" "encoding/binary" "fmt" "runtime" "sync" "unicode/utf16" "golang.org/x/sys/windows" ) //sys adjustTokenPrivileges(token windows.Token, releaseAll bool, input *byte, outputSize uint32, output *byte, requiredSize *uint32) (success bool, err error) [true] = advapi32.AdjustTokenPrivileges //sys impersonateSelf(level uint32) (err error) = advapi32.ImpersonateSelf //sys revertToSelf() (err error) = advapi32.RevertToSelf //sys openThreadToken(thread windows.Handle, accessMask uint32, openAsSelf bool, token *windows.Token) (err error) = advapi32.OpenThreadToken //sys getCurrentThread() (h windows.Handle) = GetCurrentThread //sys lookupPrivilegeValue(systemName string, name string, luid *uint64) (err error) = advapi32.LookupPrivilegeValueW //sys lookupPrivilegeName(systemName string, luid *uint64, buffer *uint16, size *uint32) (err error) = advapi32.LookupPrivilegeNameW //sys lookupPrivilegeDisplayName(systemName string, name *uint16, buffer *uint16, size *uint32, languageId *uint32) (err error) = advapi32.LookupPrivilegeDisplayNameW const ( //revive:disable-next-line:var-naming ALL_CAPS SE_PRIVILEGE_ENABLED = windows.SE_PRIVILEGE_ENABLED //revive:disable-next-line:var-naming ALL_CAPS ERROR_NOT_ALL_ASSIGNED windows.Errno = windows.ERROR_NOT_ALL_ASSIGNED SeBackupPrivilege = "SeBackupPrivilege" SeRestorePrivilege = "SeRestorePrivilege" SeSecurityPrivilege = "SeSecurityPrivilege" ) var ( privNames = make(map[string]uint64) privNameMutex sync.Mutex ) // PrivilegeError represents an error enabling privileges. type PrivilegeError struct { privileges []uint64 } func (e *PrivilegeError) Error() string { s := "Could not enable privilege " if len(e.privileges) > 1 { s = "Could not enable privileges " } for i, p := range e.privileges { if i != 0 { s += ", " } s += `"` s += getPrivilegeName(p) s += `"` } return s } // RunWithPrivilege enables a single privilege for a function call. func RunWithPrivilege(name string, fn func() error) error { return RunWithPrivileges([]string{name}, fn) } // RunWithPrivileges enables privileges for a function call. func RunWithPrivileges(names []string, fn func() error) error { privileges, err := mapPrivileges(names) if err != nil { return err } runtime.LockOSThread() defer runtime.UnlockOSThread() token, err := newThreadToken() if err != nil { return err } defer releaseThreadToken(token) err = adjustPrivileges(token, privileges, SE_PRIVILEGE_ENABLED) if err != nil { return err } return fn() } func mapPrivileges(names []string) ([]uint64, error) { privileges := make([]uint64, 0, len(names)) privNameMutex.Lock() defer privNameMutex.Unlock() for _, name := range names { p, ok := privNames[name] if !ok { err := lookupPrivilegeValue("", name, &p) if err != nil { return nil, err } privNames[name] = p } privileges = append(privileges, p) } return privileges, nil } // EnableProcessPrivileges enables privileges globally for the process. func EnableProcessPrivileges(names []string) error { return enableDisableProcessPrivilege(names, SE_PRIVILEGE_ENABLED) } // DisableProcessPrivileges disables privileges globally for the process. func DisableProcessPrivileges(names []string) error { return enableDisableProcessPrivilege(names, 0) } func enableDisableProcessPrivilege(names []string, action uint32) error { privileges, err := mapPrivileges(names) if err != nil { return err } p := windows.CurrentProcess() var token windows.Token err = windows.OpenProcessToken(p, windows.TOKEN_ADJUST_PRIVILEGES|windows.TOKEN_QUERY, &token) if err != nil { return err } defer token.Close() return adjustPrivileges(token, privileges, action) } func adjustPrivileges(token windows.Token, privileges []uint64, action uint32) error { var b bytes.Buffer _ = binary.Write(&b, binary.LittleEndian, uint32(len(privileges))) for _, p := range privileges { _ = binary.Write(&b, binary.LittleEndian, p) _ = binary.Write(&b, binary.LittleEndian, action) } prevState := make([]byte, b.Len()) reqSize := uint32(0) success, err := adjustTokenPrivileges(token, false, &b.Bytes()[0], uint32(len(prevState)), &prevState[0], &reqSize) if !success { return err } if err == ERROR_NOT_ALL_ASSIGNED { //nolint:errorlint // err is Errno return &PrivilegeError{privileges} } return nil } func getPrivilegeName(luid uint64) string { var nameBuffer [256]uint16 bufSize := uint32(len(nameBuffer)) err := lookupPrivilegeName("", &luid, &nameBuffer[0], &bufSize) if err != nil { return fmt.Sprintf("", luid) } var displayNameBuffer [256]uint16 displayBufSize := uint32(len(displayNameBuffer)) var langID uint32 err = lookupPrivilegeDisplayName("", &nameBuffer[0], &displayNameBuffer[0], &displayBufSize, &langID) if err != nil { return fmt.Sprintf("", string(utf16.Decode(nameBuffer[:bufSize]))) } return string(utf16.Decode(displayNameBuffer[:displayBufSize])) } func newThreadToken() (windows.Token, error) { err := impersonateSelf(windows.SecurityImpersonation) if err != nil { return 0, err } var token windows.Token err = openThreadToken(getCurrentThread(), windows.TOKEN_ADJUST_PRIVILEGES|windows.TOKEN_QUERY, false, &token) if err != nil { rerr := revertToSelf() if rerr != nil { panic(rerr) } return 0, err } return token, nil } func releaseThreadToken(h windows.Token) { err := revertToSelf() if err != nil { panic(err) } h.Close() } ================================================ FILE: vendor/github.com/Microsoft/go-winio/reparse.go ================================================ //go:build windows // +build windows package winio import ( "bytes" "encoding/binary" "fmt" "strings" "unicode/utf16" "unsafe" ) const ( reparseTagMountPoint = 0xA0000003 reparseTagSymlink = 0xA000000C ) type reparseDataBuffer struct { ReparseTag uint32 ReparseDataLength uint16 Reserved uint16 SubstituteNameOffset uint16 SubstituteNameLength uint16 PrintNameOffset uint16 PrintNameLength uint16 } // ReparsePoint describes a Win32 symlink or mount point. type ReparsePoint struct { Target string IsMountPoint bool } // UnsupportedReparsePointError is returned when trying to decode a non-symlink or // mount point reparse point. type UnsupportedReparsePointError struct { Tag uint32 } func (e *UnsupportedReparsePointError) Error() string { return fmt.Sprintf("unsupported reparse point %x", e.Tag) } // DecodeReparsePoint decodes a Win32 REPARSE_DATA_BUFFER structure containing either a symlink // or a mount point. func DecodeReparsePoint(b []byte) (*ReparsePoint, error) { tag := binary.LittleEndian.Uint32(b[0:4]) return DecodeReparsePointData(tag, b[8:]) } func DecodeReparsePointData(tag uint32, b []byte) (*ReparsePoint, error) { isMountPoint := false switch tag { case reparseTagMountPoint: isMountPoint = true case reparseTagSymlink: default: return nil, &UnsupportedReparsePointError{tag} } nameOffset := 8 + binary.LittleEndian.Uint16(b[4:6]) if !isMountPoint { nameOffset += 4 } nameLength := binary.LittleEndian.Uint16(b[6:8]) name := make([]uint16, nameLength/2) err := binary.Read(bytes.NewReader(b[nameOffset:nameOffset+nameLength]), binary.LittleEndian, &name) if err != nil { return nil, err } return &ReparsePoint{string(utf16.Decode(name)), isMountPoint}, nil } func isDriveLetter(c byte) bool { return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') } // EncodeReparsePoint encodes a Win32 REPARSE_DATA_BUFFER structure describing a symlink or // mount point. func EncodeReparsePoint(rp *ReparsePoint) []byte { // Generate an NT path and determine if this is a relative path. var ntTarget string relative := false if strings.HasPrefix(rp.Target, `\\?\`) { ntTarget = `\??\` + rp.Target[4:] } else if strings.HasPrefix(rp.Target, `\\`) { ntTarget = `\??\UNC\` + rp.Target[2:] } else if len(rp.Target) >= 2 && isDriveLetter(rp.Target[0]) && rp.Target[1] == ':' { ntTarget = `\??\` + rp.Target } else { ntTarget = rp.Target relative = true } // The paths must be NUL-terminated even though they are counted strings. target16 := utf16.Encode([]rune(rp.Target + "\x00")) ntTarget16 := utf16.Encode([]rune(ntTarget + "\x00")) size := int(unsafe.Sizeof(reparseDataBuffer{})) - 8 size += len(ntTarget16)*2 + len(target16)*2 tag := uint32(reparseTagMountPoint) if !rp.IsMountPoint { tag = reparseTagSymlink size += 4 // Add room for symlink flags } data := reparseDataBuffer{ ReparseTag: tag, ReparseDataLength: uint16(size), SubstituteNameOffset: 0, SubstituteNameLength: uint16((len(ntTarget16) - 1) * 2), PrintNameOffset: uint16(len(ntTarget16) * 2), PrintNameLength: uint16((len(target16) - 1) * 2), } var b bytes.Buffer _ = binary.Write(&b, binary.LittleEndian, &data) if !rp.IsMountPoint { flags := uint32(0) if relative { flags |= 1 } _ = binary.Write(&b, binary.LittleEndian, flags) } _ = binary.Write(&b, binary.LittleEndian, ntTarget16) _ = binary.Write(&b, binary.LittleEndian, target16) return b.Bytes() } ================================================ FILE: vendor/github.com/Microsoft/go-winio/sd.go ================================================ //go:build windows // +build windows package winio import ( "errors" "fmt" "unsafe" "golang.org/x/sys/windows" ) //sys lookupAccountName(systemName *uint16, accountName string, sid *byte, sidSize *uint32, refDomain *uint16, refDomainSize *uint32, sidNameUse *uint32) (err error) = advapi32.LookupAccountNameW //sys lookupAccountSid(systemName *uint16, sid *byte, name *uint16, nameSize *uint32, refDomain *uint16, refDomainSize *uint32, sidNameUse *uint32) (err error) = advapi32.LookupAccountSidW //sys convertSidToStringSid(sid *byte, str **uint16) (err error) = advapi32.ConvertSidToStringSidW //sys convertStringSidToSid(str *uint16, sid **byte) (err error) = advapi32.ConvertStringSidToSidW type AccountLookupError struct { Name string Err error } func (e *AccountLookupError) Error() string { if e.Name == "" { return "lookup account: empty account name specified" } var s string switch { case errors.Is(e.Err, windows.ERROR_INVALID_SID): s = "the security ID structure is invalid" case errors.Is(e.Err, windows.ERROR_NONE_MAPPED): s = "not found" default: s = e.Err.Error() } return "lookup account " + e.Name + ": " + s } func (e *AccountLookupError) Unwrap() error { return e.Err } type SddlConversionError struct { Sddl string Err error } func (e *SddlConversionError) Error() string { return "convert " + e.Sddl + ": " + e.Err.Error() } func (e *SddlConversionError) Unwrap() error { return e.Err } // LookupSidByName looks up the SID of an account by name // //revive:disable-next-line:var-naming SID, not Sid func LookupSidByName(name string) (sid string, err error) { if name == "" { return "", &AccountLookupError{name, windows.ERROR_NONE_MAPPED} } var sidSize, sidNameUse, refDomainSize uint32 err = lookupAccountName(nil, name, nil, &sidSize, nil, &refDomainSize, &sidNameUse) if err != nil && err != windows.ERROR_INSUFFICIENT_BUFFER { //nolint:errorlint // err is Errno return "", &AccountLookupError{name, err} } sidBuffer := make([]byte, sidSize) refDomainBuffer := make([]uint16, refDomainSize) err = lookupAccountName(nil, name, &sidBuffer[0], &sidSize, &refDomainBuffer[0], &refDomainSize, &sidNameUse) if err != nil { return "", &AccountLookupError{name, err} } var strBuffer *uint16 err = convertSidToStringSid(&sidBuffer[0], &strBuffer) if err != nil { return "", &AccountLookupError{name, err} } sid = windows.UTF16ToString((*[0xffff]uint16)(unsafe.Pointer(strBuffer))[:]) _, _ = windows.LocalFree(windows.Handle(unsafe.Pointer(strBuffer))) return sid, nil } // LookupNameBySid looks up the name of an account by SID // //revive:disable-next-line:var-naming SID, not Sid func LookupNameBySid(sid string) (name string, err error) { if sid == "" { return "", &AccountLookupError{sid, windows.ERROR_NONE_MAPPED} } sidBuffer, err := windows.UTF16PtrFromString(sid) if err != nil { return "", &AccountLookupError{sid, err} } var sidPtr *byte if err = convertStringSidToSid(sidBuffer, &sidPtr); err != nil { return "", &AccountLookupError{sid, err} } defer windows.LocalFree(windows.Handle(unsafe.Pointer(sidPtr))) //nolint:errcheck var nameSize, refDomainSize, sidNameUse uint32 err = lookupAccountSid(nil, sidPtr, nil, &nameSize, nil, &refDomainSize, &sidNameUse) if err != nil && err != windows.ERROR_INSUFFICIENT_BUFFER { //nolint:errorlint // err is Errno return "", &AccountLookupError{sid, err} } nameBuffer := make([]uint16, nameSize) refDomainBuffer := make([]uint16, refDomainSize) err = lookupAccountSid(nil, sidPtr, &nameBuffer[0], &nameSize, &refDomainBuffer[0], &refDomainSize, &sidNameUse) if err != nil { return "", &AccountLookupError{sid, err} } name = windows.UTF16ToString(nameBuffer) return name, nil } func SddlToSecurityDescriptor(sddl string) ([]byte, error) { sd, err := windows.SecurityDescriptorFromString(sddl) if err != nil { return nil, &SddlConversionError{Sddl: sddl, Err: err} } b := unsafe.Slice((*byte)(unsafe.Pointer(sd)), sd.Length()) return b, nil } func SecurityDescriptorToSddl(sd []byte) (string, error) { if l := int(unsafe.Sizeof(windows.SECURITY_DESCRIPTOR{})); len(sd) < l { return "", fmt.Errorf("SecurityDescriptor (%d) smaller than expected (%d): %w", len(sd), l, windows.ERROR_INCORRECT_SIZE) } s := (*windows.SECURITY_DESCRIPTOR)(unsafe.Pointer(&sd[0])) return s.String(), nil } ================================================ FILE: vendor/github.com/Microsoft/go-winio/syscall.go ================================================ //go:build windows package winio //go:generate go run github.com/Microsoft/go-winio/tools/mkwinsyscall -output zsyscall_windows.go ./*.go ================================================ FILE: vendor/github.com/Microsoft/go-winio/zsyscall_windows.go ================================================ //go:build windows // Code generated by 'go generate' using "github.com/Microsoft/go-winio/tools/mkwinsyscall"; DO NOT EDIT. package winio import ( "syscall" "unsafe" "golang.org/x/sys/windows" ) var _ unsafe.Pointer // Do the interface allocations only once for common // Errno values. const ( errnoERROR_IO_PENDING = 997 ) var ( errERROR_IO_PENDING error = syscall.Errno(errnoERROR_IO_PENDING) errERROR_EINVAL error = syscall.EINVAL ) // errnoErr returns common boxed Errno values, to prevent // allocations at runtime. func errnoErr(e syscall.Errno) error { switch e { case 0: return errERROR_EINVAL case errnoERROR_IO_PENDING: return errERROR_IO_PENDING } return e } var ( modadvapi32 = windows.NewLazySystemDLL("advapi32.dll") modkernel32 = windows.NewLazySystemDLL("kernel32.dll") modntdll = windows.NewLazySystemDLL("ntdll.dll") modws2_32 = windows.NewLazySystemDLL("ws2_32.dll") procAdjustTokenPrivileges = modadvapi32.NewProc("AdjustTokenPrivileges") procConvertSidToStringSidW = modadvapi32.NewProc("ConvertSidToStringSidW") procConvertStringSidToSidW = modadvapi32.NewProc("ConvertStringSidToSidW") procImpersonateSelf = modadvapi32.NewProc("ImpersonateSelf") procLookupAccountNameW = modadvapi32.NewProc("LookupAccountNameW") procLookupAccountSidW = modadvapi32.NewProc("LookupAccountSidW") procLookupPrivilegeDisplayNameW = modadvapi32.NewProc("LookupPrivilegeDisplayNameW") procLookupPrivilegeNameW = modadvapi32.NewProc("LookupPrivilegeNameW") procLookupPrivilegeValueW = modadvapi32.NewProc("LookupPrivilegeValueW") procOpenThreadToken = modadvapi32.NewProc("OpenThreadToken") procRevertToSelf = modadvapi32.NewProc("RevertToSelf") procBackupRead = modkernel32.NewProc("BackupRead") procBackupWrite = modkernel32.NewProc("BackupWrite") procCancelIoEx = modkernel32.NewProc("CancelIoEx") procConnectNamedPipe = modkernel32.NewProc("ConnectNamedPipe") procCreateIoCompletionPort = modkernel32.NewProc("CreateIoCompletionPort") procCreateNamedPipeW = modkernel32.NewProc("CreateNamedPipeW") procDisconnectNamedPipe = modkernel32.NewProc("DisconnectNamedPipe") procGetCurrentThread = modkernel32.NewProc("GetCurrentThread") procGetNamedPipeHandleStateW = modkernel32.NewProc("GetNamedPipeHandleStateW") procGetNamedPipeInfo = modkernel32.NewProc("GetNamedPipeInfo") procGetQueuedCompletionStatus = modkernel32.NewProc("GetQueuedCompletionStatus") procSetFileCompletionNotificationModes = modkernel32.NewProc("SetFileCompletionNotificationModes") procNtCreateNamedPipeFile = modntdll.NewProc("NtCreateNamedPipeFile") procRtlDefaultNpAcl = modntdll.NewProc("RtlDefaultNpAcl") procRtlDosPathNameToNtPathName_U = modntdll.NewProc("RtlDosPathNameToNtPathName_U") procRtlNtStatusToDosErrorNoTeb = modntdll.NewProc("RtlNtStatusToDosErrorNoTeb") procWSAGetOverlappedResult = modws2_32.NewProc("WSAGetOverlappedResult") ) func adjustTokenPrivileges(token windows.Token, releaseAll bool, input *byte, outputSize uint32, output *byte, requiredSize *uint32) (success bool, err error) { var _p0 uint32 if releaseAll { _p0 = 1 } r0, _, e1 := syscall.SyscallN(procAdjustTokenPrivileges.Addr(), uintptr(token), uintptr(_p0), uintptr(unsafe.Pointer(input)), uintptr(outputSize), uintptr(unsafe.Pointer(output)), uintptr(unsafe.Pointer(requiredSize))) success = r0 != 0 if true { err = errnoErr(e1) } return } func convertSidToStringSid(sid *byte, str **uint16) (err error) { r1, _, e1 := syscall.SyscallN(procConvertSidToStringSidW.Addr(), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(str))) if r1 == 0 { err = errnoErr(e1) } return } func convertStringSidToSid(str *uint16, sid **byte) (err error) { r1, _, e1 := syscall.SyscallN(procConvertStringSidToSidW.Addr(), uintptr(unsafe.Pointer(str)), uintptr(unsafe.Pointer(sid))) if r1 == 0 { err = errnoErr(e1) } return } func impersonateSelf(level uint32) (err error) { r1, _, e1 := syscall.SyscallN(procImpersonateSelf.Addr(), uintptr(level)) if r1 == 0 { err = errnoErr(e1) } return } func lookupAccountName(systemName *uint16, accountName string, sid *byte, sidSize *uint32, refDomain *uint16, refDomainSize *uint32, sidNameUse *uint32) (err error) { var _p0 *uint16 _p0, err = syscall.UTF16PtrFromString(accountName) if err != nil { return } return _lookupAccountName(systemName, _p0, sid, sidSize, refDomain, refDomainSize, sidNameUse) } func _lookupAccountName(systemName *uint16, accountName *uint16, sid *byte, sidSize *uint32, refDomain *uint16, refDomainSize *uint32, sidNameUse *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procLookupAccountNameW.Addr(), uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(accountName)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(sidSize)), uintptr(unsafe.Pointer(refDomain)), uintptr(unsafe.Pointer(refDomainSize)), uintptr(unsafe.Pointer(sidNameUse))) if r1 == 0 { err = errnoErr(e1) } return } func lookupAccountSid(systemName *uint16, sid *byte, name *uint16, nameSize *uint32, refDomain *uint16, refDomainSize *uint32, sidNameUse *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procLookupAccountSidW.Addr(), uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(nameSize)), uintptr(unsafe.Pointer(refDomain)), uintptr(unsafe.Pointer(refDomainSize)), uintptr(unsafe.Pointer(sidNameUse))) if r1 == 0 { err = errnoErr(e1) } return } func lookupPrivilegeDisplayName(systemName string, name *uint16, buffer *uint16, size *uint32, languageId *uint32) (err error) { var _p0 *uint16 _p0, err = syscall.UTF16PtrFromString(systemName) if err != nil { return } return _lookupPrivilegeDisplayName(_p0, name, buffer, size, languageId) } func _lookupPrivilegeDisplayName(systemName *uint16, name *uint16, buffer *uint16, size *uint32, languageId *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procLookupPrivilegeDisplayNameW.Addr(), uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(buffer)), uintptr(unsafe.Pointer(size)), uintptr(unsafe.Pointer(languageId))) if r1 == 0 { err = errnoErr(e1) } return } func lookupPrivilegeName(systemName string, luid *uint64, buffer *uint16, size *uint32) (err error) { var _p0 *uint16 _p0, err = syscall.UTF16PtrFromString(systemName) if err != nil { return } return _lookupPrivilegeName(_p0, luid, buffer, size) } func _lookupPrivilegeName(systemName *uint16, luid *uint64, buffer *uint16, size *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procLookupPrivilegeNameW.Addr(), uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(luid)), uintptr(unsafe.Pointer(buffer)), uintptr(unsafe.Pointer(size))) if r1 == 0 { err = errnoErr(e1) } return } func lookupPrivilegeValue(systemName string, name string, luid *uint64) (err error) { var _p0 *uint16 _p0, err = syscall.UTF16PtrFromString(systemName) if err != nil { return } var _p1 *uint16 _p1, err = syscall.UTF16PtrFromString(name) if err != nil { return } return _lookupPrivilegeValue(_p0, _p1, luid) } func _lookupPrivilegeValue(systemName *uint16, name *uint16, luid *uint64) (err error) { r1, _, e1 := syscall.SyscallN(procLookupPrivilegeValueW.Addr(), uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(luid))) if r1 == 0 { err = errnoErr(e1) } return } func openThreadToken(thread windows.Handle, accessMask uint32, openAsSelf bool, token *windows.Token) (err error) { var _p0 uint32 if openAsSelf { _p0 = 1 } r1, _, e1 := syscall.SyscallN(procOpenThreadToken.Addr(), uintptr(thread), uintptr(accessMask), uintptr(_p0), uintptr(unsafe.Pointer(token))) if r1 == 0 { err = errnoErr(e1) } return } func revertToSelf() (err error) { r1, _, e1 := syscall.SyscallN(procRevertToSelf.Addr()) if r1 == 0 { err = errnoErr(e1) } return } func backupRead(h windows.Handle, b []byte, bytesRead *uint32, abort bool, processSecurity bool, context *uintptr) (err error) { var _p0 *byte if len(b) > 0 { _p0 = &b[0] } var _p1 uint32 if abort { _p1 = 1 } var _p2 uint32 if processSecurity { _p2 = 1 } r1, _, e1 := syscall.SyscallN(procBackupRead.Addr(), uintptr(h), uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), uintptr(unsafe.Pointer(bytesRead)), uintptr(_p1), uintptr(_p2), uintptr(unsafe.Pointer(context))) if r1 == 0 { err = errnoErr(e1) } return } func backupWrite(h windows.Handle, b []byte, bytesWritten *uint32, abort bool, processSecurity bool, context *uintptr) (err error) { var _p0 *byte if len(b) > 0 { _p0 = &b[0] } var _p1 uint32 if abort { _p1 = 1 } var _p2 uint32 if processSecurity { _p2 = 1 } r1, _, e1 := syscall.SyscallN(procBackupWrite.Addr(), uintptr(h), uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), uintptr(unsafe.Pointer(bytesWritten)), uintptr(_p1), uintptr(_p2), uintptr(unsafe.Pointer(context))) if r1 == 0 { err = errnoErr(e1) } return } func cancelIoEx(file windows.Handle, o *windows.Overlapped) (err error) { r1, _, e1 := syscall.SyscallN(procCancelIoEx.Addr(), uintptr(file), uintptr(unsafe.Pointer(o))) if r1 == 0 { err = errnoErr(e1) } return } func connectNamedPipe(pipe windows.Handle, o *windows.Overlapped) (err error) { r1, _, e1 := syscall.SyscallN(procConnectNamedPipe.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(o))) if r1 == 0 { err = errnoErr(e1) } return } func createIoCompletionPort(file windows.Handle, port windows.Handle, key uintptr, threadCount uint32) (newport windows.Handle, err error) { r0, _, e1 := syscall.SyscallN(procCreateIoCompletionPort.Addr(), uintptr(file), uintptr(port), uintptr(key), uintptr(threadCount)) newport = windows.Handle(r0) if newport == 0 { err = errnoErr(e1) } return } func createNamedPipe(name string, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *windows.SecurityAttributes) (handle windows.Handle, err error) { var _p0 *uint16 _p0, err = syscall.UTF16PtrFromString(name) if err != nil { return } return _createNamedPipe(_p0, flags, pipeMode, maxInstances, outSize, inSize, defaultTimeout, sa) } func _createNamedPipe(name *uint16, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *windows.SecurityAttributes) (handle windows.Handle, err error) { r0, _, e1 := syscall.SyscallN(procCreateNamedPipeW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(flags), uintptr(pipeMode), uintptr(maxInstances), uintptr(outSize), uintptr(inSize), uintptr(defaultTimeout), uintptr(unsafe.Pointer(sa))) handle = windows.Handle(r0) if handle == windows.InvalidHandle { err = errnoErr(e1) } return } func disconnectNamedPipe(pipe windows.Handle) (err error) { r1, _, e1 := syscall.SyscallN(procDisconnectNamedPipe.Addr(), uintptr(pipe)) if r1 == 0 { err = errnoErr(e1) } return } func getCurrentThread() (h windows.Handle) { r0, _, _ := syscall.SyscallN(procGetCurrentThread.Addr()) h = windows.Handle(r0) return } func getNamedPipeHandleState(pipe windows.Handle, state *uint32, curInstances *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32, userName *uint16, maxUserNameSize uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetNamedPipeHandleStateW.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(state)), uintptr(unsafe.Pointer(curInstances)), uintptr(unsafe.Pointer(maxCollectionCount)), uintptr(unsafe.Pointer(collectDataTimeout)), uintptr(unsafe.Pointer(userName)), uintptr(maxUserNameSize)) if r1 == 0 { err = errnoErr(e1) } return } func getNamedPipeInfo(pipe windows.Handle, flags *uint32, outSize *uint32, inSize *uint32, maxInstances *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetNamedPipeInfo.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(flags)), uintptr(unsafe.Pointer(outSize)), uintptr(unsafe.Pointer(inSize)), uintptr(unsafe.Pointer(maxInstances))) if r1 == 0 { err = errnoErr(e1) } return } func getQueuedCompletionStatus(port windows.Handle, bytes *uint32, key *uintptr, o **ioOperation, timeout uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetQueuedCompletionStatus.Addr(), uintptr(port), uintptr(unsafe.Pointer(bytes)), uintptr(unsafe.Pointer(key)), uintptr(unsafe.Pointer(o)), uintptr(timeout)) if r1 == 0 { err = errnoErr(e1) } return } func setFileCompletionNotificationModes(h windows.Handle, flags uint8) (err error) { r1, _, e1 := syscall.SyscallN(procSetFileCompletionNotificationModes.Addr(), uintptr(h), uintptr(flags)) if r1 == 0 { err = errnoErr(e1) } return } func ntCreateNamedPipeFile(pipe *windows.Handle, access ntAccessMask, oa *objectAttributes, iosb *ioStatusBlock, share ntFileShareMode, disposition ntFileCreationDisposition, options ntFileOptions, typ uint32, readMode uint32, completionMode uint32, maxInstances uint32, inboundQuota uint32, outputQuota uint32, timeout *int64) (status ntStatus) { r0, _, _ := syscall.SyscallN(procNtCreateNamedPipeFile.Addr(), uintptr(unsafe.Pointer(pipe)), uintptr(access), uintptr(unsafe.Pointer(oa)), uintptr(unsafe.Pointer(iosb)), uintptr(share), uintptr(disposition), uintptr(options), uintptr(typ), uintptr(readMode), uintptr(completionMode), uintptr(maxInstances), uintptr(inboundQuota), uintptr(outputQuota), uintptr(unsafe.Pointer(timeout))) status = ntStatus(r0) return } func rtlDefaultNpAcl(dacl *uintptr) (status ntStatus) { r0, _, _ := syscall.SyscallN(procRtlDefaultNpAcl.Addr(), uintptr(unsafe.Pointer(dacl))) status = ntStatus(r0) return } func rtlDosPathNameToNtPathName(name *uint16, ntName *unicodeString, filePart uintptr, reserved uintptr) (status ntStatus) { r0, _, _ := syscall.SyscallN(procRtlDosPathNameToNtPathName_U.Addr(), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(ntName)), uintptr(filePart), uintptr(reserved)) status = ntStatus(r0) return } func rtlNtStatusToDosError(status ntStatus) (winerr error) { r0, _, _ := syscall.SyscallN(procRtlNtStatusToDosErrorNoTeb.Addr(), uintptr(status)) if r0 != 0 { winerr = syscall.Errno(r0) } return } func wsaGetOverlappedResult(h windows.Handle, o *windows.Overlapped, bytes *uint32, wait bool, flags *uint32) (err error) { var _p0 uint32 if wait { _p0 = 1 } r1, _, e1 := syscall.SyscallN(procWSAGetOverlappedResult.Addr(), uintptr(h), uintptr(unsafe.Pointer(o)), uintptr(unsafe.Pointer(bytes)), uintptr(_p0), uintptr(unsafe.Pointer(flags))) if r1 == 0 { err = errnoErr(e1) } return } ================================================ FILE: vendor/github.com/VividCortex/ewma/.gitignore ================================================ .DS_Store .*.sw? /coverage.txt ================================================ FILE: vendor/github.com/VividCortex/ewma/.whitesource ================================================ { "settingsInheritedFrom": "VividCortex/whitesource-config@master" } ================================================ FILE: vendor/github.com/VividCortex/ewma/LICENSE ================================================ The MIT License Copyright (c) 2013 VividCortex Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: vendor/github.com/VividCortex/ewma/README.md ================================================ # EWMA [![GoDoc](https://godoc.org/github.com/VividCortex/ewma?status.svg)](https://godoc.org/github.com/VividCortex/ewma) ![build](https://github.com/VividCortex/ewma/workflows/build/badge.svg) [![codecov](https://codecov.io/gh/VividCortex/ewma/branch/master/graph/badge.svg)](https://codecov.io/gh/VividCortex/ewma) This repo provides Exponentially Weighted Moving Average algorithms, or EWMAs for short, [based on our Quantifying Abnormal Behavior talk](https://vividcortex.com/blog/2013/07/23/a-fast-go-library-for-exponential-moving-averages/). ### Exponentially Weighted Moving Average An exponentially weighted moving average is a way to continuously compute a type of average for a series of numbers, as the numbers arrive. After a value in the series is added to the average, its weight in the average decreases exponentially over time. This biases the average towards more recent data. EWMAs are useful for several reasons, chiefly their inexpensive computational and memory cost, as well as the fact that they represent the recent central tendency of the series of values. The EWMA algorithm requires a decay factor, alpha. The larger the alpha, the more the average is biased towards recent history. The alpha must be between 0 and 1, and is typically a fairly small number, such as 0.04. We will discuss the choice of alpha later. The algorithm works thus, in pseudocode: 1. Multiply the next number in the series by alpha. 2. Multiply the current value of the average by 1 minus alpha. 3. Add the result of steps 1 and 2, and store it as the new current value of the average. 4. Repeat for each number in the series. There are special-case behaviors for how to initialize the current value, and these vary between implementations. One approach is to start with the first value in the series; another is to average the first 10 or so values in the series using an arithmetic average, and then begin the incremental updating of the average. Each method has pros and cons. It may help to look at it pictorially. Suppose the series has five numbers, and we choose alpha to be 0.50 for simplicity. Here's the series, with numbers in the neighborhood of 300. ![Data Series](https://user-images.githubusercontent.com/279875/28242350-463289a2-6977-11e7-88ca-fd778ccef1f0.png) Now let's take the moving average of those numbers. First we set the average to the value of the first number. ![EWMA Step 1](https://user-images.githubusercontent.com/279875/28242353-464c96bc-6977-11e7-9981-dc4e0789c7ba.png) Next we multiply the next number by alpha, multiply the current value by 1-alpha, and add them to generate a new value. ![EWMA Step 2](https://user-images.githubusercontent.com/279875/28242351-464abefa-6977-11e7-95d0-43900f29bef2.png) This continues until we are done. ![EWMA Step N](https://user-images.githubusercontent.com/279875/28242352-464c58f0-6977-11e7-8cd0-e01e4efaac7f.png) Notice how each of the values in the series decays by half each time a new value is added, and the top of the bars in the lower portion of the image represents the size of the moving average. It is a smoothed, or low-pass, average of the original series. For further reading, see [Exponentially weighted moving average](http://en.wikipedia.org/wiki/Moving_average#Exponential_moving_average) on wikipedia. ### Choosing Alpha Consider a fixed-size sliding-window moving average (not an exponentially weighted moving average) that averages over the previous N samples. What is the average age of each sample? It is N/2. Now suppose that you wish to construct a EWMA whose samples have the same average age. The formula to compute the alpha required for this is: alpha = 2/(N+1). Proof is in the book "Production and Operations Analysis" by Steven Nahmias. So, for example, if you have a time-series with samples once per second, and you want to get the moving average over the previous minute, you should use an alpha of .032786885. This, by the way, is the constant alpha used for this repository's SimpleEWMA. ### Implementations This repository contains two implementations of the EWMA algorithm, with different properties. The implementations all conform to the MovingAverage interface, and the constructor returns that type. Current implementations assume an implicit time interval of 1.0 between every sample added. That is, the passage of time is treated as though it's the same as the arrival of samples. If you need time-based decay when samples are not arriving precisely at set intervals, then this package will not support your needs at present. #### SimpleEWMA A SimpleEWMA is designed for low CPU and memory consumption. It **will** have different behavior than the VariableEWMA for multiple reasons. It has no warm-up period and it uses a constant decay. These properties let it use less memory. It will also behave differently when it's equal to zero, which is assumed to mean uninitialized, so if a value is likely to actually become zero over time, then any non-zero value will cause a sharp jump instead of a small change. #### VariableEWMA Unlike SimpleEWMA, this supports a custom age which must be stored, and thus uses more memory. It also has a "warmup" time when you start adding values to it. It will report a value of 0.0 until you have added the required number of samples to it. It uses some memory to store the number of samples added to it. As a result it uses a little over twice the memory of SimpleEWMA. ## Usage ### API Documentation View the GoDoc generated documentation [here](http://godoc.org/github.com/VividCortex/ewma). ```go package main import "github.com/VividCortex/ewma" func main() { samples := [100]float64{ 4599, 5711, 4746, 4621, 5037, 4218, 4925, 4281, 5207, 5203, 5594, 5149, } e := ewma.NewMovingAverage() //=> Returns a SimpleEWMA if called without params a := ewma.NewMovingAverage(5) //=> returns a VariableEWMA with a decay of 2 / (5 + 1) for _, f := range samples { e.Add(f) a.Add(f) } e.Value() //=> 13.577404704631077 a.Value() //=> 1.5806140565521463e-12 } ``` ## Contributing We only accept pull requests for minor fixes or improvements. This includes: * Small bug fixes * Typos * Documentation or comments Please open issues to discuss new features. Pull requests for new features will be rejected, so we recommend forking the repository and making changes in your fork for your use case. ## License This repository is Copyright (c) 2013 VividCortex, Inc. All rights reserved. It is licensed under the MIT license. Please see the LICENSE file for applicable license terms. ================================================ FILE: vendor/github.com/VividCortex/ewma/codecov.yml ================================================ coverage: status: project: default: threshold: 15% patch: off ================================================ FILE: vendor/github.com/VividCortex/ewma/ewma.go ================================================ // Package ewma implements exponentially weighted moving averages. package ewma // Copyright (c) 2013 VividCortex, Inc. All rights reserved. // Please see the LICENSE file for applicable license terms. const ( // By default, we average over a one-minute period, which means the average // age of the metrics in the period is 30 seconds. AVG_METRIC_AGE float64 = 30.0 // The formula for computing the decay factor from the average age comes // from "Production and Operations Analysis" by Steven Nahmias. DECAY float64 = 2 / (float64(AVG_METRIC_AGE) + 1) // For best results, the moving average should not be initialized to the // samples it sees immediately. The book "Production and Operations // Analysis" by Steven Nahmias suggests initializing the moving average to // the mean of the first 10 samples. Until the VariableEwma has seen this // many samples, it is not "ready" to be queried for the value of the // moving average. This adds some memory cost. WARMUP_SAMPLES uint8 = 10 ) // MovingAverage is the interface that computes a moving average over a time- // series stream of numbers. The average may be over a window or exponentially // decaying. type MovingAverage interface { Add(float64) Value() float64 Set(float64) } // NewMovingAverage constructs a MovingAverage that computes an average with the // desired characteristics in the moving window or exponential decay. If no // age is given, it constructs a default exponentially weighted implementation // that consumes minimal memory. The age is related to the decay factor alpha // by the formula given for the DECAY constant. It signifies the average age // of the samples as time goes to infinity. func NewMovingAverage(age ...float64) MovingAverage { if len(age) == 0 || age[0] == AVG_METRIC_AGE { return new(SimpleEWMA) } return &VariableEWMA{ decay: 2 / (age[0] + 1), } } // A SimpleEWMA represents the exponentially weighted moving average of a // series of numbers. It WILL have different behavior than the VariableEWMA // for multiple reasons. It has no warm-up period and it uses a constant // decay. These properties let it use less memory. It will also behave // differently when it's equal to zero, which is assumed to mean // uninitialized, so if a value is likely to actually become zero over time, // then any non-zero value will cause a sharp jump instead of a small change. // However, note that this takes a long time, and the value may just // decays to a stable value that's close to zero, but which won't be mistaken // for uninitialized. See http://play.golang.org/p/litxBDr_RC for example. type SimpleEWMA struct { // The current value of the average. After adding with Add(), this is // updated to reflect the average of all values seen thus far. value float64 } // Add adds a value to the series and updates the moving average. func (e *SimpleEWMA) Add(value float64) { if e.value == 0 { // this is a proxy for "uninitialized" e.value = value } else { e.value = (value * DECAY) + (e.value * (1 - DECAY)) } } // Value returns the current value of the moving average. func (e *SimpleEWMA) Value() float64 { return e.value } // Set sets the EWMA's value. func (e *SimpleEWMA) Set(value float64) { e.value = value } // VariableEWMA represents the exponentially weighted moving average of a series of // numbers. Unlike SimpleEWMA, it supports a custom age, and thus uses more memory. type VariableEWMA struct { // The multiplier factor by which the previous samples decay. decay float64 // The current value of the average. value float64 // The number of samples added to this instance. count uint8 } // Add adds a value to the series and updates the moving average. func (e *VariableEWMA) Add(value float64) { switch { case e.count < WARMUP_SAMPLES: e.count++ e.value += value case e.count == WARMUP_SAMPLES: e.count++ e.value = e.value / float64(WARMUP_SAMPLES) e.value = (value * e.decay) + (e.value * (1 - e.decay)) default: e.value = (value * e.decay) + (e.value * (1 - e.decay)) } } // Value returns the current value of the average, or 0.0 if the series hasn't // warmed up yet. func (e *VariableEWMA) Value() float64 { if e.count <= WARMUP_SAMPLES { return 0.0 } return e.value } // Set sets the EWMA's value. func (e *VariableEWMA) Set(value float64) { e.value = value if e.count <= WARMUP_SAMPLES { e.count = WARMUP_SAMPLES + 1 } } ================================================ FILE: vendor/github.com/acarl005/stripansi/LICENSE ================================================ MIT License Copyright (c) 2018 Andrew Carlson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: vendor/github.com/acarl005/stripansi/README.md ================================================ Strip ANSI ========== This Go package removes ANSI escape codes from strings. Ideally, we would prevent these from appearing in any text we want to process. However, sometimes this can't be helped, and we need to be able to deal with that noise. This will use a regexp to remove those unwanted escape codes. ## Install ```sh $ go get -u github.com/acarl005/stripansi ``` ## Usage ```go import ( "fmt" "github.com/acarl005/stripansi" ) func main() { msg := "\x1b[38;5;140m foo\x1b[0m bar" cleanMsg := stripansi.Strip(msg) fmt.Println(cleanMsg) // " foo bar" } ``` ================================================ FILE: vendor/github.com/acarl005/stripansi/stripansi.go ================================================ package stripansi import ( "regexp" ) const ansi = "[\u001B\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\u0007)|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))" var re = regexp.MustCompile(ansi) func Strip(str string) string { return re.ReplaceAllString(str, "") } ================================================ FILE: vendor/github.com/cespare/xxhash/v2/LICENSE.txt ================================================ Copyright (c) 2016 Caleb Spare MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: vendor/github.com/cespare/xxhash/v2/README.md ================================================ # xxhash [![Go Reference](https://pkg.go.dev/badge/github.com/cespare/xxhash/v2.svg)](https://pkg.go.dev/github.com/cespare/xxhash/v2) [![Test](https://github.com/cespare/xxhash/actions/workflows/test.yml/badge.svg)](https://github.com/cespare/xxhash/actions/workflows/test.yml) xxhash is a Go implementation of the 64-bit [xxHash] algorithm, XXH64. This is a high-quality hashing algorithm that is much faster than anything in the Go standard library. This package provides a straightforward API: ``` func Sum64(b []byte) uint64 func Sum64String(s string) uint64 type Digest struct{ ... } func New() *Digest ``` The `Digest` type implements hash.Hash64. Its key methods are: ``` func (*Digest) Write([]byte) (int, error) func (*Digest) WriteString(string) (int, error) func (*Digest) Sum64() uint64 ``` The package is written with optimized pure Go and also contains even faster assembly implementations for amd64 and arm64. If desired, the `purego` build tag opts into using the Go code even on those architectures. [xxHash]: http://cyan4973.github.io/xxHash/ ## Compatibility This package is in a module and the latest code is in version 2 of the module. You need a version of Go with at least "minimal module compatibility" to use github.com/cespare/xxhash/v2: * 1.9.7+ for Go 1.9 * 1.10.3+ for Go 1.10 * Go 1.11 or later I recommend using the latest release of Go. ## Benchmarks Here are some quick benchmarks comparing the pure-Go and assembly implementations of Sum64. | input size | purego | asm | | ---------- | --------- | --------- | | 4 B | 1.3 GB/s | 1.2 GB/s | | 16 B | 2.9 GB/s | 3.5 GB/s | | 100 B | 6.9 GB/s | 8.1 GB/s | | 4 KB | 11.7 GB/s | 16.7 GB/s | | 10 MB | 12.0 GB/s | 17.3 GB/s | These numbers were generated on Ubuntu 20.04 with an Intel Xeon Platinum 8252C CPU using the following commands under Go 1.19.2: ``` benchstat <(go test -tags purego -benchtime 500ms -count 15 -bench 'Sum64$') benchstat <(go test -benchtime 500ms -count 15 -bench 'Sum64$') ``` ## Projects using this package - [InfluxDB](https://github.com/influxdata/influxdb) - [Prometheus](https://github.com/prometheus/prometheus) - [VictoriaMetrics](https://github.com/VictoriaMetrics/VictoriaMetrics) - [FreeCache](https://github.com/coocood/freecache) - [FastCache](https://github.com/VictoriaMetrics/fastcache) - [Ristretto](https://github.com/dgraph-io/ristretto) - [Badger](https://github.com/dgraph-io/badger) ================================================ FILE: vendor/github.com/cespare/xxhash/v2/testall.sh ================================================ #!/bin/bash set -eu -o pipefail # Small convenience script for running the tests with various combinations of # arch/tags. This assumes we're running on amd64 and have qemu available. go test ./... go test -tags purego ./... GOARCH=arm64 go test GOARCH=arm64 go test -tags purego ================================================ FILE: vendor/github.com/cespare/xxhash/v2/xxhash.go ================================================ // Package xxhash implements the 64-bit variant of xxHash (XXH64) as described // at http://cyan4973.github.io/xxHash/. package xxhash import ( "encoding/binary" "errors" "math/bits" ) const ( prime1 uint64 = 11400714785074694791 prime2 uint64 = 14029467366897019727 prime3 uint64 = 1609587929392839161 prime4 uint64 = 9650029242287828579 prime5 uint64 = 2870177450012600261 ) // Store the primes in an array as well. // // The consts are used when possible in Go code to avoid MOVs but we need a // contiguous array for the assembly code. var primes = [...]uint64{prime1, prime2, prime3, prime4, prime5} // Digest implements hash.Hash64. // // Note that a zero-valued Digest is not ready to receive writes. // Call Reset or create a Digest using New before calling other methods. type Digest struct { v1 uint64 v2 uint64 v3 uint64 v4 uint64 total uint64 mem [32]byte n int // how much of mem is used } // New creates a new Digest with a zero seed. func New() *Digest { return NewWithSeed(0) } // NewWithSeed creates a new Digest with the given seed. func NewWithSeed(seed uint64) *Digest { var d Digest d.ResetWithSeed(seed) return &d } // Reset clears the Digest's state so that it can be reused. // It uses a seed value of zero. func (d *Digest) Reset() { d.ResetWithSeed(0) } // ResetWithSeed clears the Digest's state so that it can be reused. // It uses the given seed to initialize the state. func (d *Digest) ResetWithSeed(seed uint64) { d.v1 = seed + prime1 + prime2 d.v2 = seed + prime2 d.v3 = seed d.v4 = seed - prime1 d.total = 0 d.n = 0 } // Size always returns 8 bytes. func (d *Digest) Size() int { return 8 } // BlockSize always returns 32 bytes. func (d *Digest) BlockSize() int { return 32 } // Write adds more data to d. It always returns len(b), nil. func (d *Digest) Write(b []byte) (n int, err error) { n = len(b) d.total += uint64(n) memleft := d.mem[d.n&(len(d.mem)-1):] if d.n+n < 32 { // This new data doesn't even fill the current block. copy(memleft, b) d.n += n return } if d.n > 0 { // Finish off the partial block. c := copy(memleft, b) d.v1 = round(d.v1, u64(d.mem[0:8])) d.v2 = round(d.v2, u64(d.mem[8:16])) d.v3 = round(d.v3, u64(d.mem[16:24])) d.v4 = round(d.v4, u64(d.mem[24:32])) b = b[c:] d.n = 0 } if len(b) >= 32 { // One or more full blocks left. nw := writeBlocks(d, b) b = b[nw:] } // Store any remaining partial block. copy(d.mem[:], b) d.n = len(b) return } // Sum appends the current hash to b and returns the resulting slice. func (d *Digest) Sum(b []byte) []byte { s := d.Sum64() return append( b, byte(s>>56), byte(s>>48), byte(s>>40), byte(s>>32), byte(s>>24), byte(s>>16), byte(s>>8), byte(s), ) } // Sum64 returns the current hash. func (d *Digest) Sum64() uint64 { var h uint64 if d.total >= 32 { v1, v2, v3, v4 := d.v1, d.v2, d.v3, d.v4 h = rol1(v1) + rol7(v2) + rol12(v3) + rol18(v4) h = mergeRound(h, v1) h = mergeRound(h, v2) h = mergeRound(h, v3) h = mergeRound(h, v4) } else { h = d.v3 + prime5 } h += d.total b := d.mem[:d.n&(len(d.mem)-1)] for ; len(b) >= 8; b = b[8:] { k1 := round(0, u64(b[:8])) h ^= k1 h = rol27(h)*prime1 + prime4 } if len(b) >= 4 { h ^= uint64(u32(b[:4])) * prime1 h = rol23(h)*prime2 + prime3 b = b[4:] } for ; len(b) > 0; b = b[1:] { h ^= uint64(b[0]) * prime5 h = rol11(h) * prime1 } h ^= h >> 33 h *= prime2 h ^= h >> 29 h *= prime3 h ^= h >> 32 return h } const ( magic = "xxh\x06" marshaledSize = len(magic) + 8*5 + 32 ) // MarshalBinary implements the encoding.BinaryMarshaler interface. func (d *Digest) MarshalBinary() ([]byte, error) { b := make([]byte, 0, marshaledSize) b = append(b, magic...) b = appendUint64(b, d.v1) b = appendUint64(b, d.v2) b = appendUint64(b, d.v3) b = appendUint64(b, d.v4) b = appendUint64(b, d.total) b = append(b, d.mem[:d.n]...) b = b[:len(b)+len(d.mem)-d.n] return b, nil } // UnmarshalBinary implements the encoding.BinaryUnmarshaler interface. func (d *Digest) UnmarshalBinary(b []byte) error { if len(b) < len(magic) || string(b[:len(magic)]) != magic { return errors.New("xxhash: invalid hash state identifier") } if len(b) != marshaledSize { return errors.New("xxhash: invalid hash state size") } b = b[len(magic):] b, d.v1 = consumeUint64(b) b, d.v2 = consumeUint64(b) b, d.v3 = consumeUint64(b) b, d.v4 = consumeUint64(b) b, d.total = consumeUint64(b) copy(d.mem[:], b) d.n = int(d.total % uint64(len(d.mem))) return nil } func appendUint64(b []byte, x uint64) []byte { var a [8]byte binary.LittleEndian.PutUint64(a[:], x) return append(b, a[:]...) } func consumeUint64(b []byte) ([]byte, uint64) { x := u64(b) return b[8:], x } func u64(b []byte) uint64 { return binary.LittleEndian.Uint64(b) } func u32(b []byte) uint32 { return binary.LittleEndian.Uint32(b) } func round(acc, input uint64) uint64 { acc += input * prime2 acc = rol31(acc) acc *= prime1 return acc } func mergeRound(acc, val uint64) uint64 { val = round(0, val) acc ^= val acc = acc*prime1 + prime4 return acc } func rol1(x uint64) uint64 { return bits.RotateLeft64(x, 1) } func rol7(x uint64) uint64 { return bits.RotateLeft64(x, 7) } func rol11(x uint64) uint64 { return bits.RotateLeft64(x, 11) } func rol12(x uint64) uint64 { return bits.RotateLeft64(x, 12) } func rol18(x uint64) uint64 { return bits.RotateLeft64(x, 18) } func rol23(x uint64) uint64 { return bits.RotateLeft64(x, 23) } func rol27(x uint64) uint64 { return bits.RotateLeft64(x, 27) } func rol31(x uint64) uint64 { return bits.RotateLeft64(x, 31) } ================================================ FILE: vendor/github.com/cespare/xxhash/v2/xxhash_amd64.s ================================================ //go:build !appengine && gc && !purego // +build !appengine // +build gc // +build !purego #include "textflag.h" // Registers: #define h AX #define d AX #define p SI // pointer to advance through b #define n DX #define end BX // loop end #define v1 R8 #define v2 R9 #define v3 R10 #define v4 R11 #define x R12 #define prime1 R13 #define prime2 R14 #define prime4 DI #define round(acc, x) \ IMULQ prime2, x \ ADDQ x, acc \ ROLQ $31, acc \ IMULQ prime1, acc // round0 performs the operation x = round(0, x). #define round0(x) \ IMULQ prime2, x \ ROLQ $31, x \ IMULQ prime1, x // mergeRound applies a merge round on the two registers acc and x. // It assumes that prime1, prime2, and prime4 have been loaded. #define mergeRound(acc, x) \ round0(x) \ XORQ x, acc \ IMULQ prime1, acc \ ADDQ prime4, acc // blockLoop processes as many 32-byte blocks as possible, // updating v1, v2, v3, and v4. It assumes that there is at least one block // to process. #define blockLoop() \ loop: \ MOVQ +0(p), x \ round(v1, x) \ MOVQ +8(p), x \ round(v2, x) \ MOVQ +16(p), x \ round(v3, x) \ MOVQ +24(p), x \ round(v4, x) \ ADDQ $32, p \ CMPQ p, end \ JLE loop // func Sum64(b []byte) uint64 TEXT ·Sum64(SB), NOSPLIT|NOFRAME, $0-32 // Load fixed primes. MOVQ ·primes+0(SB), prime1 MOVQ ·primes+8(SB), prime2 MOVQ ·primes+24(SB), prime4 // Load slice. MOVQ b_base+0(FP), p MOVQ b_len+8(FP), n LEAQ (p)(n*1), end // The first loop limit will be len(b)-32. SUBQ $32, end // Check whether we have at least one block. CMPQ n, $32 JLT noBlocks // Set up initial state (v1, v2, v3, v4). MOVQ prime1, v1 ADDQ prime2, v1 MOVQ prime2, v2 XORQ v3, v3 XORQ v4, v4 SUBQ prime1, v4 blockLoop() MOVQ v1, h ROLQ $1, h MOVQ v2, x ROLQ $7, x ADDQ x, h MOVQ v3, x ROLQ $12, x ADDQ x, h MOVQ v4, x ROLQ $18, x ADDQ x, h mergeRound(h, v1) mergeRound(h, v2) mergeRound(h, v3) mergeRound(h, v4) JMP afterBlocks noBlocks: MOVQ ·primes+32(SB), h afterBlocks: ADDQ n, h ADDQ $24, end CMPQ p, end JG try4 loop8: MOVQ (p), x ADDQ $8, p round0(x) XORQ x, h ROLQ $27, h IMULQ prime1, h ADDQ prime4, h CMPQ p, end JLE loop8 try4: ADDQ $4, end CMPQ p, end JG try1 MOVL (p), x ADDQ $4, p IMULQ prime1, x XORQ x, h ROLQ $23, h IMULQ prime2, h ADDQ ·primes+16(SB), h try1: ADDQ $4, end CMPQ p, end JGE finalize loop1: MOVBQZX (p), x ADDQ $1, p IMULQ ·primes+32(SB), x XORQ x, h ROLQ $11, h IMULQ prime1, h CMPQ p, end JL loop1 finalize: MOVQ h, x SHRQ $33, x XORQ x, h IMULQ prime2, h MOVQ h, x SHRQ $29, x XORQ x, h IMULQ ·primes+16(SB), h MOVQ h, x SHRQ $32, x XORQ x, h MOVQ h, ret+24(FP) RET // func writeBlocks(d *Digest, b []byte) int TEXT ·writeBlocks(SB), NOSPLIT|NOFRAME, $0-40 // Load fixed primes needed for round. MOVQ ·primes+0(SB), prime1 MOVQ ·primes+8(SB), prime2 // Load slice. MOVQ b_base+8(FP), p MOVQ b_len+16(FP), n LEAQ (p)(n*1), end SUBQ $32, end // Load vN from d. MOVQ s+0(FP), d MOVQ 0(d), v1 MOVQ 8(d), v2 MOVQ 16(d), v3 MOVQ 24(d), v4 // We don't need to check the loop condition here; this function is // always called with at least one block of data to process. blockLoop() // Copy vN back to d. MOVQ v1, 0(d) MOVQ v2, 8(d) MOVQ v3, 16(d) MOVQ v4, 24(d) // The number of bytes written is p minus the old base pointer. SUBQ b_base+8(FP), p MOVQ p, ret+32(FP) RET ================================================ FILE: vendor/github.com/cespare/xxhash/v2/xxhash_arm64.s ================================================ //go:build !appengine && gc && !purego // +build !appengine // +build gc // +build !purego #include "textflag.h" // Registers: #define digest R1 #define h R2 // return value #define p R3 // input pointer #define n R4 // input length #define nblocks R5 // n / 32 #define prime1 R7 #define prime2 R8 #define prime3 R9 #define prime4 R10 #define prime5 R11 #define v1 R12 #define v2 R13 #define v3 R14 #define v4 R15 #define x1 R20 #define x2 R21 #define x3 R22 #define x4 R23 #define round(acc, x) \ MADD prime2, acc, x, acc \ ROR $64-31, acc \ MUL prime1, acc // round0 performs the operation x = round(0, x). #define round0(x) \ MUL prime2, x \ ROR $64-31, x \ MUL prime1, x #define mergeRound(acc, x) \ round0(x) \ EOR x, acc \ MADD acc, prime4, prime1, acc // blockLoop processes as many 32-byte blocks as possible, // updating v1, v2, v3, and v4. It assumes that n >= 32. #define blockLoop() \ LSR $5, n, nblocks \ PCALIGN $16 \ loop: \ LDP.P 16(p), (x1, x2) \ LDP.P 16(p), (x3, x4) \ round(v1, x1) \ round(v2, x2) \ round(v3, x3) \ round(v4, x4) \ SUB $1, nblocks \ CBNZ nblocks, loop // func Sum64(b []byte) uint64 TEXT ·Sum64(SB), NOSPLIT|NOFRAME, $0-32 LDP b_base+0(FP), (p, n) LDP ·primes+0(SB), (prime1, prime2) LDP ·primes+16(SB), (prime3, prime4) MOVD ·primes+32(SB), prime5 CMP $32, n CSEL LT, prime5, ZR, h // if n < 32 { h = prime5 } else { h = 0 } BLT afterLoop ADD prime1, prime2, v1 MOVD prime2, v2 MOVD $0, v3 NEG prime1, v4 blockLoop() ROR $64-1, v1, x1 ROR $64-7, v2, x2 ADD x1, x2 ROR $64-12, v3, x3 ROR $64-18, v4, x4 ADD x3, x4 ADD x2, x4, h mergeRound(h, v1) mergeRound(h, v2) mergeRound(h, v3) mergeRound(h, v4) afterLoop: ADD n, h TBZ $4, n, try8 LDP.P 16(p), (x1, x2) round0(x1) // NOTE: here and below, sequencing the EOR after the ROR (using a // rotated register) is worth a small but measurable speedup for small // inputs. ROR $64-27, h EOR x1 @> 64-27, h, h MADD h, prime4, prime1, h round0(x2) ROR $64-27, h EOR x2 @> 64-27, h, h MADD h, prime4, prime1, h try8: TBZ $3, n, try4 MOVD.P 8(p), x1 round0(x1) ROR $64-27, h EOR x1 @> 64-27, h, h MADD h, prime4, prime1, h try4: TBZ $2, n, try2 MOVWU.P 4(p), x2 MUL prime1, x2 ROR $64-23, h EOR x2 @> 64-23, h, h MADD h, prime3, prime2, h try2: TBZ $1, n, try1 MOVHU.P 2(p), x3 AND $255, x3, x1 LSR $8, x3, x2 MUL prime5, x1 ROR $64-11, h EOR x1 @> 64-11, h, h MUL prime1, h MUL prime5, x2 ROR $64-11, h EOR x2 @> 64-11, h, h MUL prime1, h try1: TBZ $0, n, finalize MOVBU (p), x4 MUL prime5, x4 ROR $64-11, h EOR x4 @> 64-11, h, h MUL prime1, h finalize: EOR h >> 33, h MUL prime2, h EOR h >> 29, h MUL prime3, h EOR h >> 32, h MOVD h, ret+24(FP) RET // func writeBlocks(d *Digest, b []byte) int TEXT ·writeBlocks(SB), NOSPLIT|NOFRAME, $0-40 LDP ·primes+0(SB), (prime1, prime2) // Load state. Assume v[1-4] are stored contiguously. MOVD d+0(FP), digest LDP 0(digest), (v1, v2) LDP 16(digest), (v3, v4) LDP b_base+8(FP), (p, n) blockLoop() // Store updated state. STP (v1, v2), 0(digest) STP (v3, v4), 16(digest) BIC $31, n MOVD n, ret+32(FP) RET ================================================ FILE: vendor/github.com/cespare/xxhash/v2/xxhash_asm.go ================================================ //go:build (amd64 || arm64) && !appengine && gc && !purego // +build amd64 arm64 // +build !appengine // +build gc // +build !purego package xxhash // Sum64 computes the 64-bit xxHash digest of b with a zero seed. // //go:noescape func Sum64(b []byte) uint64 //go:noescape func writeBlocks(d *Digest, b []byte) int ================================================ FILE: vendor/github.com/cespare/xxhash/v2/xxhash_other.go ================================================ //go:build (!amd64 && !arm64) || appengine || !gc || purego // +build !amd64,!arm64 appengine !gc purego package xxhash // Sum64 computes the 64-bit xxHash digest of b with a zero seed. func Sum64(b []byte) uint64 { // A simpler version would be // d := New() // d.Write(b) // return d.Sum64() // but this is faster, particularly for small inputs. n := len(b) var h uint64 if n >= 32 { v1 := primes[0] + prime2 v2 := prime2 v3 := uint64(0) v4 := -primes[0] for len(b) >= 32 { v1 = round(v1, u64(b[0:8:len(b)])) v2 = round(v2, u64(b[8:16:len(b)])) v3 = round(v3, u64(b[16:24:len(b)])) v4 = round(v4, u64(b[24:32:len(b)])) b = b[32:len(b):len(b)] } h = rol1(v1) + rol7(v2) + rol12(v3) + rol18(v4) h = mergeRound(h, v1) h = mergeRound(h, v2) h = mergeRound(h, v3) h = mergeRound(h, v4) } else { h = prime5 } h += uint64(n) for ; len(b) >= 8; b = b[8:] { k1 := round(0, u64(b[:8])) h ^= k1 h = rol27(h)*prime1 + prime4 } if len(b) >= 4 { h ^= uint64(u32(b[:4])) * prime1 h = rol23(h)*prime2 + prime3 b = b[4:] } for ; len(b) > 0; b = b[1:] { h ^= uint64(b[0]) * prime5 h = rol11(h) * prime1 } h ^= h >> 33 h *= prime2 h ^= h >> 29 h *= prime3 h ^= h >> 32 return h } func writeBlocks(d *Digest, b []byte) int { v1, v2, v3, v4 := d.v1, d.v2, d.v3, d.v4 n := len(b) for len(b) >= 32 { v1 = round(v1, u64(b[0:8:len(b)])) v2 = round(v2, u64(b[8:16:len(b)])) v3 = round(v3, u64(b[16:24:len(b)])) v4 = round(v4, u64(b[24:32:len(b)])) b = b[32:len(b):len(b)] } d.v1, d.v2, d.v3, d.v4 = v1, v2, v3, v4 return n - len(b) } ================================================ FILE: vendor/github.com/cespare/xxhash/v2/xxhash_safe.go ================================================ //go:build appengine // +build appengine // This file contains the safe implementations of otherwise unsafe-using code. package xxhash // Sum64String computes the 64-bit xxHash digest of s with a zero seed. func Sum64String(s string) uint64 { return Sum64([]byte(s)) } // WriteString adds more data to d. It always returns len(s), nil. func (d *Digest) WriteString(s string) (n int, err error) { return d.Write([]byte(s)) } ================================================ FILE: vendor/github.com/cespare/xxhash/v2/xxhash_unsafe.go ================================================ //go:build !appengine // +build !appengine // This file encapsulates usage of unsafe. // xxhash_safe.go contains the safe implementations. package xxhash import ( "unsafe" ) // In the future it's possible that compiler optimizations will make these // XxxString functions unnecessary by realizing that calls such as // Sum64([]byte(s)) don't need to copy s. See https://go.dev/issue/2205. // If that happens, even if we keep these functions they can be replaced with // the trivial safe code. // NOTE: The usual way of doing an unsafe string-to-[]byte conversion is: // // var b []byte // bh := (*reflect.SliceHeader)(unsafe.Pointer(&b)) // bh.Data = (*reflect.StringHeader)(unsafe.Pointer(&s)).Data // bh.Len = len(s) // bh.Cap = len(s) // // Unfortunately, as of Go 1.15.3 the inliner's cost model assigns a high enough // weight to this sequence of expressions that any function that uses it will // not be inlined. Instead, the functions below use a different unsafe // conversion designed to minimize the inliner weight and allow both to be // inlined. There is also a test (TestInlining) which verifies that these are // inlined. // // See https://github.com/golang/go/issues/42739 for discussion. // Sum64String computes the 64-bit xxHash digest of s with a zero seed. // It may be faster than Sum64([]byte(s)) by avoiding a copy. func Sum64String(s string) uint64 { b := *(*[]byte)(unsafe.Pointer(&sliceHeader{s, len(s)})) return Sum64(b) } // WriteString adds more data to d. It always returns len(s), nil. // It may be faster than Write([]byte(s)) by avoiding a copy. func (d *Digest) WriteString(s string) (n int, err error) { d.Write(*(*[]byte)(unsafe.Pointer(&sliceHeader{s, len(s)}))) // d.Write always returns len(s), nil. // Ignoring the return output and returning these fixed values buys a // savings of 6 in the inliner's cost model. return len(s), nil } // sliceHeader is similar to reflect.SliceHeader, but it assumes that the layout // of the first two words is the same as the layout of a string. type sliceHeader struct { s string cap int } ================================================ FILE: vendor/github.com/clipperhouse/uax29/v2/LICENSE ================================================ MIT License Copyright (c) 2020 Matt Sherman Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: vendor/github.com/clipperhouse/uax29/v2/graphemes/README.md ================================================ An implementation of grapheme cluster boundaries from [Unicode text segmentation](https://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries) (UAX 29), for Unicode 17. [![Documentation](https://pkg.go.dev/badge/github.com/clipperhouse/uax29/v2/graphemes.svg)](https://pkg.go.dev/github.com/clipperhouse/uax29/v2/graphemes) ![Tests](https://github.com/clipperhouse/uax29/actions/workflows/gotest.yml/badge.svg) ![Fuzz](https://github.com/clipperhouse/uax29/actions/workflows/gofuzz.yml/badge.svg) ## Quick start ``` go get github.com/clipperhouse/uax29/v2/graphemes ``` ```go import "github.com/clipperhouse/uax29/v2/graphemes" text := "Hello, 世界. Nice dog! 👍🐶" g := graphemes.FromString(text) for g.Next() { // Next() returns true until end of data fmt.Println(g.Value()) // Do something with the current grapheme } ``` _A grapheme is a “single visible character”, which might be a simple as a single letter, or a complex emoji that consists of several Unicode code points._ ## Conformance We use the Unicode [test suite](https://unicode.org/reports/tr41/tr41-36.html#Tests29). ![Tests](https://github.com/clipperhouse/uax29/actions/workflows/gotest.yml/badge.svg) ![Fuzz](https://github.com/clipperhouse/uax29/actions/workflows/gofuzz.yml/badge.svg) ## APIs ### If you have a `string` ```go text := "Hello, 世界. Nice dog! 👍🐶" g := graphemes.FromString(text) for g.Next() { // Next() returns true until end of data fmt.Println(g.Value()) // Do something with the current grapheme } ``` ### If you have an `io.Reader` `FromReader` embeds a [`bufio.Scanner`](https://pkg.go.dev/bufio#Scanner), so just use those methods. ```go r := getYourReader() // from a file or network maybe g := graphemes.FromReader(r) for g.Scan() { // Scan() returns true until error or EOF fmt.Println(g.Text()) // Do something with the current grapheme } if g.Err() != nil { // Check the error log.Fatal(g.Err()) } ``` ### If you have a `[]byte` ```go b := []byte("Hello, 世界. Nice dog! 👍🐶") g := graphemes.FromBytes(b) for g.Next() { // Next() returns true until end of data fmt.Println(g.Value()) // Do something with the current grapheme } ``` ### ANSI escape sequences By the UAX 29 specification, ANSI escape sequences are not grapheme clusters. To treat 7-bit ANSI escape sequences as a single cluster, set `AnsiEscapeSequences` to true. ```go text := "Hello, \x1b[31mworld\x1b[0m!" g := graphemes.FromString(text) g.AnsiEscapeSequences = true for g.Next() { fmt.Println(g.Value()) } ``` To also parse 8-bit C1 controls (non-UTF-8 bytes), set `AnsiEscapeSequences8Bit` to true. ```go g.AnsiEscapeSequences = true // 7-bit forms (ESC ...) g.AnsiEscapeSequences8Bit = true // 8-bit C1 forms (0x80-0x9F), not valid UTF-8 ``` For ESC-initiated (7-bit) control strings, only 7-bit terminators are recognized. For C1-initiated (8-bit) control strings, only C1 ST (`0x9C`) is recognized as ST. We implement [ECMA-48](https://ecma-international.org/publications-and-standards/standards/ecma-48/) control codes in both 7-bit and 8-bit representations. 8-bit control codes are not UTF-8 encoded and are not valid UTF-8, caveat emptor. ### Benchmarks ``` goos: darwin goarch: arm64 pkg: github.com/clipperhouse/uax29/graphemes/comparative cpu: Apple M2 BenchmarkGraphemesMixed/clipperhouse/uax29-8 142635 ns/op 245.12 MB/s 0 B/op 0 allocs/op BenchmarkGraphemesMixed/rivo/uniseg-8 2018284 ns/op 17.32 MB/s 0 B/op 0 allocs/op BenchmarkGraphemesASCII/clipperhouse/uax29-8 8846 ns/op 508.73 MB/s 0 B/op 0 allocs/op BenchmarkGraphemesASCII/rivo/uniseg-8 366760 ns/op 12.27 MB/s 0 B/op 0 allocs/op ``` ### Invalid inputs Invalid UTF-8 input is considered undefined behavior. We test to ensure that bad inputs will not cause pathological outcomes, such as a panic or infinite loop. Callers should expect “garbage-in, garbage-out”. Your pipeline should probably include a call to [`utf8.Valid()`](https://pkg.go.dev/unicode/utf8#Valid). ================================================ FILE: vendor/github.com/clipperhouse/uax29/v2/graphemes/ansi.go ================================================ package graphemes // ansiEscapeLength returns the byte length of a valid 7-bit ANSI escape // sequence at the start of data, or 0 if none. // // Recognized forms (ECMA-48 / ISO 6429): // - CSI: ESC [ then parameter bytes (0x30-0x3F), intermediate (0x20-0x2F), final (0x40-0x7E) // - OSC: ESC ] then payload until BEL (0x07), 7-bit ST (ESC \), CAN (0x18), or SUB (0x1A) // - DCS, SOS, PM, APC: ESC P/X/^/_ then payload until 7-bit ST (ESC \), CAN, or SUB // - Two-byte: ESC + Fe/Fs (0x40-0x7E excluding above), or Fp (0x30-0x3F), or nF (0x20-0x2F then final) func ansiEscapeLength[T ~string | ~[]byte](data T) int { n := len(data) if n < 2 || data[0] != esc { return 0 } b1 := data[1] switch b1 { case '[': // CSI body := csiBodyLength(data[2:]) if body == 0 { return 0 } return 2 + body case ']': // OSC - allows BEL or 7-bit ST terminator body := oscLength(data[2:]) if body < 0 { return 0 } return 2 + body case 'P', 'X', '^', '_': // DCS, SOS, PM, APC body := stSequenceLength(data[2:]) if body < 0 { return 0 } return 2 + body } if b1 >= 0x40 && b1 <= 0x7E { // Fe/Fs two-byte; [ ] P X ^ _ handled above return 2 } if b1 >= 0x30 && b1 <= 0x3F { // Fp (private) two-byte return 2 } if b1 >= 0x20 && b1 <= 0x2F { // nF: intermediates then one final (0x30-0x7E) i := 2 for i < n && data[i] >= 0x20 && data[i] <= 0x2F { i++ } if i < n && data[i] >= 0x30 && data[i] <= 0x7E { return i + 1 } return 0 } return 0 } // csiBodyLength returns the length of the CSI body (param/intermediate/final bytes). // data is the slice after "ESC [". // Per ECMA-48, the CSI body has the form: // // parameters (0x30–0x3F)*, intermediates (0x20–0x2F)*, final (0x40–0x7E) // // Once an intermediate byte is seen, subsequent parameter bytes are invalid. func csiBodyLength[T ~string | ~[]byte](data T) int { seenIntermediate := false for i := 0; i < len(data); i++ { b := data[i] if b >= 0x30 && b <= 0x3F { if seenIntermediate { return 0 } continue } if b >= 0x20 && b <= 0x2F { seenIntermediate = true continue } if b >= 0x40 && b <= 0x7E { return i + 1 } return 0 } return 0 } // oscLength returns the length of the OSC body. // data is the slice after "ESC ]". // // Returns: // - n >= 0: consumed body length (includes BEL/ST terminator when present) // - -1: not terminated in the provided data // // OSC accepts BEL (0x07) or 7-bit ST (ESC \) as terminators by widespread convention. // Per ECMA-48, CAN (0x18) and SUB (0x1A) cancel the control string; in that // case they are not part of the OSC sequence length. func oscLength[T ~string | ~[]byte](data T) int { for i := 0; i < len(data); i++ { b := data[i] if b == bel { return i + 1 } if b == can || b == sub { return i } if b == esc && i+1 < len(data) && data[i+1] == '\\' { return i + 2 } } return -1 } // stSequenceLength returns the length of a control-string body. // data is the slice after "ESC x". // // Returns: // - n >= 0: consumed body length (includes ST terminator when present) // - -1: not terminated in the provided data // // Used for DCS, SOS, PM, and APC, which per ECMA-48 terminate with ST. // ST here is the 7-bit form (ESC \). // CAN (0x18) and SUB (0x1A) cancel the control string; in that case they are // not part of the sequence length. func stSequenceLength[T ~string | ~[]byte](data T) int { for i := 0; i < len(data); i++ { if data[i] == can || data[i] == sub { return i } if data[i] == esc && i+1 < len(data) && data[i+1] == '\\' { return i + 2 } } return -1 } ================================================ FILE: vendor/github.com/clipperhouse/uax29/v2/graphemes/ansi8.go ================================================ package graphemes // ansiEscapeLength8Bit returns the byte length of a valid 8-bit C1 ANSI // sequence at the start of data, or 0 if none. // // Recognized forms (ECMA-48 / ISO 6429): // - C1 CSI (0x9B) body as parameter/intermediate/final bytes // - C1 OSC (0x9D) body terminated by BEL, C1 ST, CAN, or SUB // - C1 DCS/SOS/PM/APC (0x90/0x98/0x9E/0x9F) body terminated by C1 ST, CAN, or SUB // - Standalone C1 controls (0x80..0x9F not listed above): single byte func ansiEscapeLength8Bit[T ~string | ~[]byte](data T) int { if len(data) == 0 { return 0 } switch data[0] { case 0x9B: // C1 CSI body := csiBodyLength(data[1:]) if body == 0 { return 0 } return 1 + body case 0x9D: // C1 OSC body := oscLengthC1(data[1:]) if body < 0 { return 0 } return 1 + body case 0x90, 0x98, 0x9E, 0x9F: // C1 DCS, SOS, PM, APC body := stSequenceLengthC1(data[1:]) if body < 0 { return 0 } return 1 + body default: if data[0] >= 0x80 && data[0] <= 0x9F { return 1 } } return 0 } // oscLengthC1 returns the length of a C1 OSC body. // data is the slice after the C1 OSC initiator (0x9D). // // Returns: // - n >= 0: consumed body length (includes BEL/ST terminator when present) // - -1: not terminated in the provided data // // Terminators: BEL (0x07) or C1 ST (0x9C). // CAN (0x18) and SUB (0x1A) cancel the control string. func oscLengthC1[T ~string | ~[]byte](data T) int { for i := 0; i < len(data); i++ { b := data[i] if b == bel || b == st { return i + 1 } if b == can || b == sub { return i } } return -1 } // stSequenceLengthC1 parses DCS/SOS/PM/APC bodies that terminate with C1 ST // (0x9C), or are canceled by CAN/SUB. func stSequenceLengthC1[T ~string | ~[]byte](data T) int { for i := 0; i < len(data); i++ { b := data[i] if b == can || b == sub { return i } if b == st { return i + 1 } } return -1 } ================================================ FILE: vendor/github.com/clipperhouse/uax29/v2/graphemes/iterator.go ================================================ package graphemes import "unicode/utf8" // FromString returns an iterator for the grapheme clusters in the input string. // Iterate while Next() is true, and access the grapheme via Value(). func FromString(s string) *Iterator[string] { return &Iterator[string]{ split: splitFuncString, data: s, } } // FromBytes returns an iterator for the grapheme clusters in the input bytes. // Iterate while Next() is true, and access the grapheme via Value(). func FromBytes(b []byte) *Iterator[[]byte] { return &Iterator[[]byte]{ split: splitFuncBytes, data: b, } } // Iterator is a generic iterator for grapheme clusters in strings or byte slices, // with an ASCII hot path optimization. type Iterator[T ~string | ~[]byte] struct { split func(T, bool) (int, T, error) data T pos int start int // AnsiEscapeSequences treats 7-bit ANSI escape sequences (ECMA-48) as // single grapheme clusters when true. The default is false. // // 8-bit controls are not enabled by this option. See [AnsiEscapeSequences8Bit]. AnsiEscapeSequences bool // AnsiEscapeSequences8Bit treats 8-bit C1 ANSI escape sequences (ECMA-48) as single // grapheme clusters when true. The default is false. // // 8-bit control bytes are not UTF-8 encoded, i.e. not valid UTF-8. If you // choose this option, you are choosing to interpret non-UTF-8 data, caveat // emptor. AnsiEscapeSequences8Bit bool } var ( splitFuncString = splitFunc[string] splitFuncBytes = splitFunc[[]byte] ) const ( esc = 0x1B cr = 0x0D bel = 0x07 can = 0x18 sub = 0x1A st = 0x9C ) // Next advances the iterator to the next grapheme cluster. // Returns false when there are no more grapheme clusters. func (iter *Iterator[T]) Next() bool { if iter.pos >= len(iter.data) { return false } iter.start = iter.pos b := iter.data[iter.pos] if iter.AnsiEscapeSequences && b == esc { if a := ansiEscapeLength(iter.data[iter.pos:]); a > 0 { iter.pos += a return true } } if iter.AnsiEscapeSequences8Bit && b >= 0x80 && b <= 0x9F { if a := ansiEscapeLength8Bit(iter.data[iter.pos:]); a > 0 { iter.pos += a return true } } // ASCII hot path: any ASCII is one grapheme when next byte is ASCII or end. if b < utf8.RuneSelf && b != cr { if iter.pos+1 >= len(iter.data) || iter.data[iter.pos+1] < utf8.RuneSelf { iter.pos++ return true } } // Fall back to UAX29 grapheme parsing remaining := iter.data[iter.pos:] advance, _, err := iter.split(remaining, true) if err != nil { panic(err) } if advance <= 0 { panic("splitFunc returned a zero or negative advance") } iter.pos += advance if iter.pos > len(iter.data) { panic("splitFunc advanced beyond end of data") } return true } // Value returns the current grapheme cluster. func (iter *Iterator[T]) Value() T { return iter.data[iter.start:iter.pos] } // Start returns the byte position of the current grapheme in the original data. func (iter *Iterator[T]) Start() int { return iter.start } // End returns the byte position after the current grapheme in the original data. func (iter *Iterator[T]) End() int { return iter.pos } // Reset resets the iterator to the beginning of the data. func (iter *Iterator[T]) Reset() { iter.start = 0 iter.pos = 0 } // SetText sets the data for the iterator to operate on, and resets all state. func (iter *Iterator[T]) SetText(data T) { iter.data = data iter.start = 0 iter.pos = 0 } // First returns the first grapheme cluster without advancing the iterator. func (iter *Iterator[T]) First() T { if len(iter.data) == 0 { return iter.data } // Use a copy to leverage Next()'s ASCII optimization cp := *iter cp.pos = 0 cp.start = 0 cp.Next() return cp.Value() } ================================================ FILE: vendor/github.com/clipperhouse/uax29/v2/graphemes/reader.go ================================================ // Package graphemes implements Unicode grapheme cluster boundaries: https://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries package graphemes import ( "bufio" "io" ) type Scanner struct { *bufio.Scanner } // FromReader returns a Scanner, to split graphemes per // https://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries. // // It embeds a [bufio.Scanner], so you can use its methods. // // Iterate through graphemes by calling Scan() until false, then check Err(). func FromReader(r io.Reader) *Scanner { sc := bufio.NewScanner(r) sc.Split(SplitFunc) return &Scanner{ Scanner: sc, } } ================================================ FILE: vendor/github.com/clipperhouse/uax29/v2/graphemes/splitfunc.go ================================================ package graphemes import ( "bufio" ) // is determines if lookup intersects propert(ies) func (lookup property) is(properties property) bool { return (lookup & properties) != 0 } const _Ignore = _Extend // incbState tracks state for GB9c rule (Indic conjunct clusters) // Pattern: Consonant (Extend|Linker)* Linker (Extend|Linker)* × Consonant type incbState int const ( incbNone incbState = iota // initial/reset incbConsonant // seen Consonant, awaiting Linker incbLinker // seen Consonant and Linker (conjunct ready) ) // SplitFunc is a bufio.SplitFunc implementation of Unicode grapheme cluster segmentation, for use with bufio.Scanner. // // See https://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries. var SplitFunc bufio.SplitFunc = splitFunc[[]byte] func splitFunc[T ~string | ~[]byte](data T, atEOF bool) (advance int, token T, err error) { var empty T if len(data) == 0 { return 0, empty, nil } // These vars are stateful across loop iterations var pos int var lastExIgnore property = 0 // "last excluding ignored categories" var lastLastExIgnore property = 0 // "last one before that" var regionalIndicatorCount int // GB9c state: tracking Indic conjunct clusters var incb incbState // Rules are usually of the form Cat1 × Cat2; "current" refers to the first property // to the right of the ×, from which we look back or forward current, w := lookup(data[pos:]) if w == 0 { if !atEOF { // Rune extends past current data, request more return 0, empty, nil } pos = len(data) return pos, data[:pos], nil } // https://unicode.org/reports/tr29/#GB1 // Start of text always advances pos += w for { eot := pos == len(data) // "end of text" if eot { if !atEOF { // Token extends past current data, request more return 0, empty, nil } // https://unicode.org/reports/tr29/#GB2 break } /* We've switched the evaluation order of GB1↓ and GB2↑. It's ok: because we've checked for len(data) at the top of this function, sot and eot are mutually exclusive, order doesn't matter. */ // Rules are usually of the form Cat1 × Cat2; "current" refers to the first property // to the right of the ×, from which we look back or forward // Remember previous properties to avoid lookups/lookbacks last := current if !last.is(_Ignore) { lastLastExIgnore = lastExIgnore lastExIgnore = last } // Update GB9c state based on what we just advanced past if last.is(_InCBConsonant | _InCBLinker | _InCBExtend) { switch { case last.is(_InCBConsonant): if incb != incbLinker { incb = incbConsonant } case last.is(_InCBLinker): if incb >= incbConsonant { incb = incbLinker } // case last.is(_InCBExtend): stay in current state } } else { incb = incbNone } current, w = lookup(data[pos:]) if w == 0 { if atEOF { // Just return the bytes, we can't do anything with them pos = len(data) break } // Rune extends past current data, request more return 0, empty, nil } // Optimization: no rule can possibly apply if current|last == 0 { // i.e. both are zero break } // https://unicode.org/reports/tr29/#GB3 if current.is(_LF) && last.is(_CR) { pos += w continue } // https://unicode.org/reports/tr29/#GB4 // https://unicode.org/reports/tr29/#GB5 if (current | last).is(_Control | _CR | _LF) { break } // https://unicode.org/reports/tr29/#GB6 if current.is(_L|_V|_LV|_LVT) && last.is(_L) { pos += w continue } // https://unicode.org/reports/tr29/#GB7 if current.is(_V|_T) && last.is(_LV|_V) { pos += w continue } // https://unicode.org/reports/tr29/#GB8 if current.is(_T) && last.is(_LVT|_T) { pos += w continue } // https://unicode.org/reports/tr29/#GB9 if current.is(_Extend | _ZWJ) { pos += w continue } // https://unicode.org/reports/tr29/#GB9a if current.is(_SpacingMark) { pos += w continue } // https://unicode.org/reports/tr29/#GB9b if last.is(_Prepend) { pos += w continue } // https://unicode.org/reports/tr29/#GB9c // Do not break within certain combinations with Indic_Conjunct_Break (InCB)=Linker. if incb == incbLinker && current.is(_InCBConsonant) { // After matching the pattern, reset state to start tracking a new pattern // The current Consonant becomes the start of the new pattern incb = incbConsonant pos += w continue } // https://unicode.org/reports/tr29/#GB11 if current.is(_ExtendedPictographic) && last.is(_ZWJ) && lastLastExIgnore.is(_ExtendedPictographic) { pos += w continue } // https://unicode.org/reports/tr29/#GB12 // https://unicode.org/reports/tr29/#GB13 if (current & last).is(_RegionalIndicator) { regionalIndicatorCount++ odd := regionalIndicatorCount%2 == 1 if odd { pos += w continue } } // If we fall through all the above rules, it's a grapheme cluster break break } // Return token return pos, data[:pos], nil } ================================================ FILE: vendor/github.com/clipperhouse/uax29/v2/graphemes/trie.go ================================================ package graphemes // generated by github.com/clipperhouse/uax29/v2 // from https://www.unicode.org/Public/17.0.0/ucd/auxiliary/GraphemeBreakProperty.txt type property uint32 const ( _CR property = 1 << iota _Control _Extend _ExtendedPictographic _InCBConsonant _InCBExtend _InCBLinker _L _LF _LV _LVT _Prepend _RegionalIndicator _SpacingMark _T _V _ZWJ ) // lookup returns the trie value for the first UTF-8 encoding in s and // the width in bytes of this encoding. The size will be 0 if s does not // hold enough bytes to complete the encoding. len(s) must be greater than 0. func lookup[T ~string | ~[]byte](s T) (v property, sz int) { c0 := s[0] switch { case c0 < 0x80: // is ASCII return graphemesValues[c0], 1 case c0 < 0xC2: return 0, 1 // Illegal UTF-8: not a starter, not ASCII. case c0 < 0xE0: // 2-byte UTF-8 if len(s) < 2 { return 0, 0 } i := graphemesIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } return lookupValue(uint32(i), c1), 2 case c0 < 0xF0: // 3-byte UTF-8 if len(s) < 3 { return 0, 0 } i := graphemesIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = graphemesIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } return lookupValue(uint32(i), c2), 3 case c0 < 0xF8: // 4-byte UTF-8 if len(s) < 4 { return 0, 0 } i := graphemesIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = graphemesIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } o = uint32(i)<<6 + uint32(c2) i = graphemesIndex[o] c3 := s[3] if c3 < 0x80 || 0xC0 <= c3 { return 0, 3 // Illegal UTF-8: not a continuation byte. } return lookupValue(uint32(i), c3), 4 } // Illegal rune return 0, 1 } // graphemesTrie. Total size: 61760 bytes (60.31 KiB). Checksum: af733ba94cd94ba6. // type graphemesTrie struct { } // func newGraphemesTrie(i int) *graphemesTrie { // return &graphemesTrie{} // } // lookupValue determines the type of block n and looks up the value for b. func lookupValue(n uint32, b byte) property { switch { default: return property(graphemesValues[n<<6+uint32(b)]) } } // graphemesValues: 235 blocks, 15040 entries, 60160 bytes // The third block is the zero block. var graphemesValues = [15040]property{ // Block 0x0, offset 0x0 0x00: 0x0002, 0x01: 0x0002, 0x02: 0x0002, 0x03: 0x0002, 0x04: 0x0002, 0x05: 0x0002, 0x06: 0x0002, 0x07: 0x0002, 0x08: 0x0002, 0x09: 0x0002, 0x0a: 0x0100, 0x0b: 0x0002, 0x0c: 0x0002, 0x0d: 0x0001, 0x0e: 0x0002, 0x0f: 0x0002, 0x10: 0x0002, 0x11: 0x0002, 0x12: 0x0002, 0x13: 0x0002, 0x14: 0x0002, 0x15: 0x0002, 0x16: 0x0002, 0x17: 0x0002, 0x18: 0x0002, 0x19: 0x0002, 0x1a: 0x0002, 0x1b: 0x0002, 0x1c: 0x0002, 0x1d: 0x0002, 0x1e: 0x0002, 0x1f: 0x0002, // Block 0x1, offset 0x40 0x7f: 0x0002, // Block 0x2, offset 0x80 // Block 0x3, offset 0xc0 0xc0: 0x0002, 0xc1: 0x0002, 0xc2: 0x0002, 0xc3: 0x0002, 0xc4: 0x0002, 0xc5: 0x0002, 0xc6: 0x0002, 0xc7: 0x0002, 0xc8: 0x0002, 0xc9: 0x0002, 0xca: 0x0002, 0xcb: 0x0002, 0xcc: 0x0002, 0xcd: 0x0002, 0xce: 0x0002, 0xcf: 0x0002, 0xd0: 0x0002, 0xd1: 0x0002, 0xd2: 0x0002, 0xd3: 0x0002, 0xd4: 0x0002, 0xd5: 0x0002, 0xd6: 0x0002, 0xd7: 0x0002, 0xd8: 0x0002, 0xd9: 0x0002, 0xda: 0x0002, 0xdb: 0x0002, 0xdc: 0x0002, 0xdd: 0x0002, 0xde: 0x0002, 0xdf: 0x0002, 0xe9: 0x0008, 0xed: 0x0002, 0xee: 0x0008, // Block 0x4, offset 0x100 0x100: 0x0024, 0x101: 0x0024, 0x102: 0x0024, 0x103: 0x0024, 0x104: 0x0024, 0x105: 0x0024, 0x106: 0x0024, 0x107: 0x0024, 0x108: 0x0024, 0x109: 0x0024, 0x10a: 0x0024, 0x10b: 0x0024, 0x10c: 0x0024, 0x10d: 0x0024, 0x10e: 0x0024, 0x10f: 0x0024, 0x110: 0x0024, 0x111: 0x0024, 0x112: 0x0024, 0x113: 0x0024, 0x114: 0x0024, 0x115: 0x0024, 0x116: 0x0024, 0x117: 0x0024, 0x118: 0x0024, 0x119: 0x0024, 0x11a: 0x0024, 0x11b: 0x0024, 0x11c: 0x0024, 0x11d: 0x0024, 0x11e: 0x0024, 0x11f: 0x0024, 0x120: 0x0024, 0x121: 0x0024, 0x122: 0x0024, 0x123: 0x0024, 0x124: 0x0024, 0x125: 0x0024, 0x126: 0x0024, 0x127: 0x0024, 0x128: 0x0024, 0x129: 0x0024, 0x12a: 0x0024, 0x12b: 0x0024, 0x12c: 0x0024, 0x12d: 0x0024, 0x12e: 0x0024, 0x12f: 0x0024, 0x130: 0x0024, 0x131: 0x0024, 0x132: 0x0024, 0x133: 0x0024, 0x134: 0x0024, 0x135: 0x0024, 0x136: 0x0024, 0x137: 0x0024, 0x138: 0x0024, 0x139: 0x0024, 0x13a: 0x0024, 0x13b: 0x0024, 0x13c: 0x0024, 0x13d: 0x0024, 0x13e: 0x0024, 0x13f: 0x0024, // Block 0x5, offset 0x140 0x140: 0x0024, 0x141: 0x0024, 0x142: 0x0024, 0x143: 0x0024, 0x144: 0x0024, 0x145: 0x0024, 0x146: 0x0024, 0x147: 0x0024, 0x148: 0x0024, 0x149: 0x0024, 0x14a: 0x0024, 0x14b: 0x0024, 0x14c: 0x0024, 0x14d: 0x0024, 0x14e: 0x0024, 0x14f: 0x0024, 0x150: 0x0024, 0x151: 0x0024, 0x152: 0x0024, 0x153: 0x0024, 0x154: 0x0024, 0x155: 0x0024, 0x156: 0x0024, 0x157: 0x0024, 0x158: 0x0024, 0x159: 0x0024, 0x15a: 0x0024, 0x15b: 0x0024, 0x15c: 0x0024, 0x15d: 0x0024, 0x15e: 0x0024, 0x15f: 0x0024, 0x160: 0x0024, 0x161: 0x0024, 0x162: 0x0024, 0x163: 0x0024, 0x164: 0x0024, 0x165: 0x0024, 0x166: 0x0024, 0x167: 0x0024, 0x168: 0x0024, 0x169: 0x0024, 0x16a: 0x0024, 0x16b: 0x0024, 0x16c: 0x0024, 0x16d: 0x0024, 0x16e: 0x0024, 0x16f: 0x0024, // Block 0x6, offset 0x180 0x183: 0x0024, 0x184: 0x0024, 0x185: 0x0024, 0x186: 0x0024, 0x187: 0x0024, 0x188: 0x0024, 0x189: 0x0024, // Block 0x7, offset 0x1c0 0x1d1: 0x0024, 0x1d2: 0x0024, 0x1d3: 0x0024, 0x1d4: 0x0024, 0x1d5: 0x0024, 0x1d6: 0x0024, 0x1d7: 0x0024, 0x1d8: 0x0024, 0x1d9: 0x0024, 0x1da: 0x0024, 0x1db: 0x0024, 0x1dc: 0x0024, 0x1dd: 0x0024, 0x1de: 0x0024, 0x1df: 0x0024, 0x1e0: 0x0024, 0x1e1: 0x0024, 0x1e2: 0x0024, 0x1e3: 0x0024, 0x1e4: 0x0024, 0x1e5: 0x0024, 0x1e6: 0x0024, 0x1e7: 0x0024, 0x1e8: 0x0024, 0x1e9: 0x0024, 0x1ea: 0x0024, 0x1eb: 0x0024, 0x1ec: 0x0024, 0x1ed: 0x0024, 0x1ee: 0x0024, 0x1ef: 0x0024, 0x1f0: 0x0024, 0x1f1: 0x0024, 0x1f2: 0x0024, 0x1f3: 0x0024, 0x1f4: 0x0024, 0x1f5: 0x0024, 0x1f6: 0x0024, 0x1f7: 0x0024, 0x1f8: 0x0024, 0x1f9: 0x0024, 0x1fa: 0x0024, 0x1fb: 0x0024, 0x1fc: 0x0024, 0x1fd: 0x0024, 0x1ff: 0x0024, // Block 0x8, offset 0x200 0x201: 0x0024, 0x202: 0x0024, 0x204: 0x0024, 0x205: 0x0024, 0x207: 0x0024, // Block 0x9, offset 0x240 0x240: 0x0800, 0x241: 0x0800, 0x242: 0x0800, 0x243: 0x0800, 0x244: 0x0800, 0x245: 0x0800, 0x250: 0x0024, 0x251: 0x0024, 0x252: 0x0024, 0x253: 0x0024, 0x254: 0x0024, 0x255: 0x0024, 0x256: 0x0024, 0x257: 0x0024, 0x258: 0x0024, 0x259: 0x0024, 0x25a: 0x0024, 0x25c: 0x0002, // Block 0xa, offset 0x280 0x28b: 0x0024, 0x28c: 0x0024, 0x28d: 0x0024, 0x28e: 0x0024, 0x28f: 0x0024, 0x290: 0x0024, 0x291: 0x0024, 0x292: 0x0024, 0x293: 0x0024, 0x294: 0x0024, 0x295: 0x0024, 0x296: 0x0024, 0x297: 0x0024, 0x298: 0x0024, 0x299: 0x0024, 0x29a: 0x0024, 0x29b: 0x0024, 0x29c: 0x0024, 0x29d: 0x0024, 0x29e: 0x0024, 0x29f: 0x0024, 0x2b0: 0x0024, // Block 0xb, offset 0x2c0 0x2d6: 0x0024, 0x2d7: 0x0024, 0x2d8: 0x0024, 0x2d9: 0x0024, 0x2da: 0x0024, 0x2db: 0x0024, 0x2dc: 0x0024, 0x2dd: 0x0800, 0x2df: 0x0024, 0x2e0: 0x0024, 0x2e1: 0x0024, 0x2e2: 0x0024, 0x2e3: 0x0024, 0x2e4: 0x0024, 0x2e7: 0x0024, 0x2e8: 0x0024, 0x2ea: 0x0024, 0x2eb: 0x0024, 0x2ec: 0x0024, 0x2ed: 0x0024, // Block 0xc, offset 0x300 0x30f: 0x0800, 0x311: 0x0024, 0x330: 0x0024, 0x331: 0x0024, 0x332: 0x0024, 0x333: 0x0024, 0x334: 0x0024, 0x335: 0x0024, 0x336: 0x0024, 0x337: 0x0024, 0x338: 0x0024, 0x339: 0x0024, 0x33a: 0x0024, 0x33b: 0x0024, 0x33c: 0x0024, 0x33d: 0x0024, 0x33e: 0x0024, 0x33f: 0x0024, // Block 0xd, offset 0x340 0x340: 0x0024, 0x341: 0x0024, 0x342: 0x0024, 0x343: 0x0024, 0x344: 0x0024, 0x345: 0x0024, 0x346: 0x0024, 0x347: 0x0024, 0x348: 0x0024, 0x349: 0x0024, 0x34a: 0x0024, // Block 0xe, offset 0x380 0x3a6: 0x0024, 0x3a7: 0x0024, 0x3a8: 0x0024, 0x3a9: 0x0024, 0x3aa: 0x0024, 0x3ab: 0x0024, 0x3ac: 0x0024, 0x3ad: 0x0024, 0x3ae: 0x0024, 0x3af: 0x0024, 0x3b0: 0x0024, // Block 0xf, offset 0x3c0 0x3eb: 0x0024, 0x3ec: 0x0024, 0x3ed: 0x0024, 0x3ee: 0x0024, 0x3ef: 0x0024, 0x3f0: 0x0024, 0x3f1: 0x0024, 0x3f2: 0x0024, 0x3f3: 0x0024, 0x3fd: 0x0024, // Block 0x10, offset 0x400 0x416: 0x0024, 0x417: 0x0024, 0x418: 0x0024, 0x419: 0x0024, 0x41b: 0x0024, 0x41c: 0x0024, 0x41d: 0x0024, 0x41e: 0x0024, 0x41f: 0x0024, 0x420: 0x0024, 0x421: 0x0024, 0x422: 0x0024, 0x423: 0x0024, 0x425: 0x0024, 0x426: 0x0024, 0x427: 0x0024, 0x429: 0x0024, 0x42a: 0x0024, 0x42b: 0x0024, 0x42c: 0x0024, 0x42d: 0x0024, // Block 0x11, offset 0x440 0x459: 0x0024, 0x45a: 0x0024, 0x45b: 0x0024, // Block 0x12, offset 0x480 0x490: 0x0800, 0x491: 0x0800, 0x497: 0x0024, 0x498: 0x0024, 0x499: 0x0024, 0x49a: 0x0024, 0x49b: 0x0024, 0x49c: 0x0024, 0x49d: 0x0024, 0x49e: 0x0024, 0x49f: 0x0024, // Block 0x13, offset 0x4c0 0x4ca: 0x0024, 0x4cb: 0x0024, 0x4cc: 0x0024, 0x4cd: 0x0024, 0x4ce: 0x0024, 0x4cf: 0x0024, 0x4d0: 0x0024, 0x4d1: 0x0024, 0x4d2: 0x0024, 0x4d3: 0x0024, 0x4d4: 0x0024, 0x4d5: 0x0024, 0x4d6: 0x0024, 0x4d7: 0x0024, 0x4d8: 0x0024, 0x4d9: 0x0024, 0x4da: 0x0024, 0x4db: 0x0024, 0x4dc: 0x0024, 0x4dd: 0x0024, 0x4de: 0x0024, 0x4df: 0x0024, 0x4e0: 0x0024, 0x4e1: 0x0024, 0x4e2: 0x0800, 0x4e3: 0x0024, 0x4e4: 0x0024, 0x4e5: 0x0024, 0x4e6: 0x0024, 0x4e7: 0x0024, 0x4e8: 0x0024, 0x4e9: 0x0024, 0x4ea: 0x0024, 0x4eb: 0x0024, 0x4ec: 0x0024, 0x4ed: 0x0024, 0x4ee: 0x0024, 0x4ef: 0x0024, 0x4f0: 0x0024, 0x4f1: 0x0024, 0x4f2: 0x0024, 0x4f3: 0x0024, 0x4f4: 0x0024, 0x4f5: 0x0024, 0x4f6: 0x0024, 0x4f7: 0x0024, 0x4f8: 0x0024, 0x4f9: 0x0024, 0x4fa: 0x0024, 0x4fb: 0x0024, 0x4fc: 0x0024, 0x4fd: 0x0024, 0x4fe: 0x0024, 0x4ff: 0x0024, // Block 0x14, offset 0x500 0x500: 0x0024, 0x501: 0x0024, 0x502: 0x0024, 0x503: 0x2000, 0x515: 0x0010, 0x516: 0x0010, 0x517: 0x0010, 0x518: 0x0010, 0x519: 0x0010, 0x51a: 0x0010, 0x51b: 0x0010, 0x51c: 0x0010, 0x51d: 0x0010, 0x51e: 0x0010, 0x51f: 0x0010, 0x520: 0x0010, 0x521: 0x0010, 0x522: 0x0010, 0x523: 0x0010, 0x524: 0x0010, 0x525: 0x0010, 0x526: 0x0010, 0x527: 0x0010, 0x528: 0x0010, 0x529: 0x0010, 0x52a: 0x0010, 0x52b: 0x0010, 0x52c: 0x0010, 0x52d: 0x0010, 0x52e: 0x0010, 0x52f: 0x0010, 0x530: 0x0010, 0x531: 0x0010, 0x532: 0x0010, 0x533: 0x0010, 0x534: 0x0010, 0x535: 0x0010, 0x536: 0x0010, 0x537: 0x0010, 0x538: 0x0010, 0x539: 0x0010, 0x53a: 0x0024, 0x53b: 0x2000, 0x53c: 0x0024, 0x53e: 0x2000, 0x53f: 0x2000, // Block 0x15, offset 0x540 0x540: 0x2000, 0x541: 0x0024, 0x542: 0x0024, 0x543: 0x0024, 0x544: 0x0024, 0x545: 0x0024, 0x546: 0x0024, 0x547: 0x0024, 0x548: 0x0024, 0x549: 0x2000, 0x54a: 0x2000, 0x54b: 0x2000, 0x54c: 0x2000, 0x54d: 0x0044, 0x54e: 0x2000, 0x54f: 0x2000, 0x551: 0x0024, 0x552: 0x0024, 0x553: 0x0024, 0x554: 0x0024, 0x555: 0x0024, 0x556: 0x0024, 0x557: 0x0024, 0x558: 0x0010, 0x559: 0x0010, 0x55a: 0x0010, 0x55b: 0x0010, 0x55c: 0x0010, 0x55d: 0x0010, 0x55e: 0x0010, 0x55f: 0x0010, 0x562: 0x0024, 0x563: 0x0024, 0x578: 0x0010, 0x579: 0x0010, 0x57a: 0x0010, 0x57b: 0x0010, 0x57c: 0x0010, 0x57d: 0x0010, 0x57e: 0x0010, 0x57f: 0x0010, // Block 0x16, offset 0x580 0x581: 0x0024, 0x582: 0x2000, 0x583: 0x2000, 0x595: 0x0010, 0x596: 0x0010, 0x597: 0x0010, 0x598: 0x0010, 0x599: 0x0010, 0x59a: 0x0010, 0x59b: 0x0010, 0x59c: 0x0010, 0x59d: 0x0010, 0x59e: 0x0010, 0x59f: 0x0010, 0x5a0: 0x0010, 0x5a1: 0x0010, 0x5a2: 0x0010, 0x5a3: 0x0010, 0x5a4: 0x0010, 0x5a5: 0x0010, 0x5a6: 0x0010, 0x5a7: 0x0010, 0x5a8: 0x0010, 0x5aa: 0x0010, 0x5ab: 0x0010, 0x5ac: 0x0010, 0x5ad: 0x0010, 0x5ae: 0x0010, 0x5af: 0x0010, 0x5b0: 0x0010, 0x5b2: 0x0010, 0x5b6: 0x0010, 0x5b7: 0x0010, 0x5b8: 0x0010, 0x5b9: 0x0010, 0x5bc: 0x0024, 0x5be: 0x0024, 0x5bf: 0x2000, // Block 0x17, offset 0x5c0 0x5c0: 0x2000, 0x5c1: 0x0024, 0x5c2: 0x0024, 0x5c3: 0x0024, 0x5c4: 0x0024, 0x5c7: 0x2000, 0x5c8: 0x2000, 0x5cb: 0x2000, 0x5cc: 0x2000, 0x5cd: 0x0044, 0x5d7: 0x0024, 0x5dc: 0x0010, 0x5dd: 0x0010, 0x5df: 0x0010, 0x5e2: 0x0024, 0x5e3: 0x0024, 0x5f0: 0x0010, 0x5f1: 0x0010, 0x5fe: 0x0024, // Block 0x18, offset 0x600 0x601: 0x0024, 0x602: 0x0024, 0x603: 0x2000, 0x63c: 0x0024, 0x63e: 0x2000, 0x63f: 0x2000, // Block 0x19, offset 0x640 0x640: 0x2000, 0x641: 0x0024, 0x642: 0x0024, 0x647: 0x0024, 0x648: 0x0024, 0x64b: 0x0024, 0x64c: 0x0024, 0x64d: 0x0024, 0x651: 0x0024, 0x670: 0x0024, 0x671: 0x0024, 0x675: 0x0024, // Block 0x1a, offset 0x680 0x681: 0x0024, 0x682: 0x0024, 0x683: 0x2000, 0x695: 0x0010, 0x696: 0x0010, 0x697: 0x0010, 0x698: 0x0010, 0x699: 0x0010, 0x69a: 0x0010, 0x69b: 0x0010, 0x69c: 0x0010, 0x69d: 0x0010, 0x69e: 0x0010, 0x69f: 0x0010, 0x6a0: 0x0010, 0x6a1: 0x0010, 0x6a2: 0x0010, 0x6a3: 0x0010, 0x6a4: 0x0010, 0x6a5: 0x0010, 0x6a6: 0x0010, 0x6a7: 0x0010, 0x6a8: 0x0010, 0x6aa: 0x0010, 0x6ab: 0x0010, 0x6ac: 0x0010, 0x6ad: 0x0010, 0x6ae: 0x0010, 0x6af: 0x0010, 0x6b0: 0x0010, 0x6b2: 0x0010, 0x6b3: 0x0010, 0x6b5: 0x0010, 0x6b6: 0x0010, 0x6b7: 0x0010, 0x6b8: 0x0010, 0x6b9: 0x0010, 0x6bc: 0x0024, 0x6be: 0x2000, 0x6bf: 0x2000, // Block 0x1b, offset 0x6c0 0x6c0: 0x2000, 0x6c1: 0x0024, 0x6c2: 0x0024, 0x6c3: 0x0024, 0x6c4: 0x0024, 0x6c5: 0x0024, 0x6c7: 0x0024, 0x6c8: 0x0024, 0x6c9: 0x2000, 0x6cb: 0x2000, 0x6cc: 0x2000, 0x6cd: 0x0044, 0x6e2: 0x0024, 0x6e3: 0x0024, 0x6f9: 0x0010, 0x6fa: 0x0024, 0x6fb: 0x0024, 0x6fc: 0x0024, 0x6fd: 0x0024, 0x6fe: 0x0024, 0x6ff: 0x0024, // Block 0x1c, offset 0x700 0x701: 0x0024, 0x702: 0x2000, 0x703: 0x2000, 0x715: 0x0010, 0x716: 0x0010, 0x717: 0x0010, 0x718: 0x0010, 0x719: 0x0010, 0x71a: 0x0010, 0x71b: 0x0010, 0x71c: 0x0010, 0x71d: 0x0010, 0x71e: 0x0010, 0x71f: 0x0010, 0x720: 0x0010, 0x721: 0x0010, 0x722: 0x0010, 0x723: 0x0010, 0x724: 0x0010, 0x725: 0x0010, 0x726: 0x0010, 0x727: 0x0010, 0x728: 0x0010, 0x72a: 0x0010, 0x72b: 0x0010, 0x72c: 0x0010, 0x72d: 0x0010, 0x72e: 0x0010, 0x72f: 0x0010, 0x730: 0x0010, 0x732: 0x0010, 0x733: 0x0010, 0x735: 0x0010, 0x736: 0x0010, 0x737: 0x0010, 0x738: 0x0010, 0x739: 0x0010, 0x73c: 0x0024, 0x73e: 0x0024, 0x73f: 0x0024, // Block 0x1d, offset 0x740 0x740: 0x2000, 0x741: 0x0024, 0x742: 0x0024, 0x743: 0x0024, 0x744: 0x0024, 0x747: 0x2000, 0x748: 0x2000, 0x74b: 0x2000, 0x74c: 0x2000, 0x74d: 0x0044, 0x755: 0x0024, 0x756: 0x0024, 0x757: 0x0024, 0x75c: 0x0010, 0x75d: 0x0010, 0x75f: 0x0010, 0x762: 0x0024, 0x763: 0x0024, 0x771: 0x0010, // Block 0x1e, offset 0x780 0x782: 0x0024, 0x7be: 0x0024, 0x7bf: 0x2000, // Block 0x1f, offset 0x7c0 0x7c0: 0x0024, 0x7c1: 0x2000, 0x7c2: 0x2000, 0x7c6: 0x2000, 0x7c7: 0x2000, 0x7c8: 0x2000, 0x7ca: 0x2000, 0x7cb: 0x2000, 0x7cc: 0x2000, 0x7cd: 0x0024, 0x7d7: 0x0024, // Block 0x20, offset 0x800 0x800: 0x0024, 0x801: 0x2000, 0x802: 0x2000, 0x803: 0x2000, 0x804: 0x0024, 0x815: 0x0010, 0x816: 0x0010, 0x817: 0x0010, 0x818: 0x0010, 0x819: 0x0010, 0x81a: 0x0010, 0x81b: 0x0010, 0x81c: 0x0010, 0x81d: 0x0010, 0x81e: 0x0010, 0x81f: 0x0010, 0x820: 0x0010, 0x821: 0x0010, 0x822: 0x0010, 0x823: 0x0010, 0x824: 0x0010, 0x825: 0x0010, 0x826: 0x0010, 0x827: 0x0010, 0x828: 0x0010, 0x82a: 0x0010, 0x82b: 0x0010, 0x82c: 0x0010, 0x82d: 0x0010, 0x82e: 0x0010, 0x82f: 0x0010, 0x830: 0x0010, 0x831: 0x0010, 0x832: 0x0010, 0x833: 0x0010, 0x834: 0x0010, 0x835: 0x0010, 0x836: 0x0010, 0x837: 0x0010, 0x838: 0x0010, 0x839: 0x0010, 0x83c: 0x0024, 0x83e: 0x0024, 0x83f: 0x0024, // Block 0x21, offset 0x840 0x840: 0x0024, 0x841: 0x2000, 0x842: 0x2000, 0x843: 0x2000, 0x844: 0x2000, 0x846: 0x0024, 0x847: 0x0024, 0x848: 0x0024, 0x84a: 0x0024, 0x84b: 0x0024, 0x84c: 0x0024, 0x84d: 0x0044, 0x855: 0x0024, 0x856: 0x0024, 0x858: 0x0010, 0x859: 0x0010, 0x85a: 0x0010, 0x862: 0x0024, 0x863: 0x0024, // Block 0x22, offset 0x880 0x881: 0x0024, 0x882: 0x2000, 0x883: 0x2000, 0x8bc: 0x0024, 0x8be: 0x2000, 0x8bf: 0x0024, // Block 0x23, offset 0x8c0 0x8c0: 0x0024, 0x8c1: 0x2000, 0x8c2: 0x0024, 0x8c3: 0x2000, 0x8c4: 0x2000, 0x8c6: 0x0024, 0x8c7: 0x0024, 0x8c8: 0x0024, 0x8ca: 0x0024, 0x8cb: 0x0024, 0x8cc: 0x0024, 0x8cd: 0x0024, 0x8d5: 0x0024, 0x8d6: 0x0024, 0x8e2: 0x0024, 0x8e3: 0x0024, 0x8f3: 0x2000, // Block 0x24, offset 0x900 0x900: 0x0024, 0x901: 0x0024, 0x902: 0x2000, 0x903: 0x2000, 0x915: 0x0010, 0x916: 0x0010, 0x917: 0x0010, 0x918: 0x0010, 0x919: 0x0010, 0x91a: 0x0010, 0x91b: 0x0010, 0x91c: 0x0010, 0x91d: 0x0010, 0x91e: 0x0010, 0x91f: 0x0010, 0x920: 0x0010, 0x921: 0x0010, 0x922: 0x0010, 0x923: 0x0010, 0x924: 0x0010, 0x925: 0x0010, 0x926: 0x0010, 0x927: 0x0010, 0x928: 0x0010, 0x929: 0x0010, 0x92a: 0x0010, 0x92b: 0x0010, 0x92c: 0x0010, 0x92d: 0x0010, 0x92e: 0x0010, 0x92f: 0x0010, 0x930: 0x0010, 0x931: 0x0010, 0x932: 0x0010, 0x933: 0x0010, 0x934: 0x0010, 0x935: 0x0010, 0x936: 0x0010, 0x937: 0x0010, 0x938: 0x0010, 0x939: 0x0010, 0x93a: 0x0010, 0x93b: 0x0024, 0x93c: 0x0024, 0x93e: 0x0024, 0x93f: 0x2000, // Block 0x25, offset 0x940 0x940: 0x2000, 0x941: 0x0024, 0x942: 0x0024, 0x943: 0x0024, 0x944: 0x0024, 0x946: 0x2000, 0x947: 0x2000, 0x948: 0x2000, 0x94a: 0x2000, 0x94b: 0x2000, 0x94c: 0x2000, 0x94d: 0x0044, 0x94e: 0x0800, 0x957: 0x0024, 0x962: 0x0024, 0x963: 0x0024, // Block 0x26, offset 0x980 0x981: 0x0024, 0x982: 0x2000, 0x983: 0x2000, // Block 0x27, offset 0x9c0 0x9ca: 0x0024, 0x9cf: 0x0024, 0x9d0: 0x2000, 0x9d1: 0x2000, 0x9d2: 0x0024, 0x9d3: 0x0024, 0x9d4: 0x0024, 0x9d6: 0x0024, 0x9d8: 0x2000, 0x9d9: 0x2000, 0x9da: 0x2000, 0x9db: 0x2000, 0x9dc: 0x2000, 0x9dd: 0x2000, 0x9de: 0x2000, 0x9df: 0x0024, 0x9f2: 0x2000, 0x9f3: 0x2000, // Block 0x28, offset 0xa00 0xa31: 0x0024, 0xa33: 0x2000, 0xa34: 0x0024, 0xa35: 0x0024, 0xa36: 0x0024, 0xa37: 0x0024, 0xa38: 0x0024, 0xa39: 0x0024, 0xa3a: 0x0024, // Block 0x29, offset 0xa40 0xa47: 0x0024, 0xa48: 0x0024, 0xa49: 0x0024, 0xa4a: 0x0024, 0xa4b: 0x0024, 0xa4c: 0x0024, 0xa4d: 0x0024, 0xa4e: 0x0024, // Block 0x2a, offset 0xa80 0xab1: 0x0024, 0xab3: 0x2000, 0xab4: 0x0024, 0xab5: 0x0024, 0xab6: 0x0024, 0xab7: 0x0024, 0xab8: 0x0024, 0xab9: 0x0024, 0xaba: 0x0024, 0xabb: 0x0024, 0xabc: 0x0024, // Block 0x2b, offset 0xac0 0xac8: 0x0024, 0xac9: 0x0024, 0xaca: 0x0024, 0xacb: 0x0024, 0xacc: 0x0024, 0xacd: 0x0024, 0xace: 0x0024, // Block 0x2c, offset 0xb00 0xb18: 0x0024, 0xb19: 0x0024, 0xb35: 0x0024, 0xb37: 0x0024, 0xb39: 0x0024, 0xb3e: 0x2000, 0xb3f: 0x2000, // Block 0x2d, offset 0xb40 0xb71: 0x0024, 0xb72: 0x0024, 0xb73: 0x0024, 0xb74: 0x0024, 0xb75: 0x0024, 0xb76: 0x0024, 0xb77: 0x0024, 0xb78: 0x0024, 0xb79: 0x0024, 0xb7a: 0x0024, 0xb7b: 0x0024, 0xb7c: 0x0024, 0xb7d: 0x0024, 0xb7e: 0x0024, 0xb7f: 0x2000, // Block 0x2e, offset 0xb80 0xb80: 0x0024, 0xb81: 0x0024, 0xb82: 0x0024, 0xb83: 0x0024, 0xb84: 0x0024, 0xb86: 0x0024, 0xb87: 0x0024, 0xb8d: 0x0024, 0xb8e: 0x0024, 0xb8f: 0x0024, 0xb90: 0x0024, 0xb91: 0x0024, 0xb92: 0x0024, 0xb93: 0x0024, 0xb94: 0x0024, 0xb95: 0x0024, 0xb96: 0x0024, 0xb97: 0x0024, 0xb99: 0x0024, 0xb9a: 0x0024, 0xb9b: 0x0024, 0xb9c: 0x0024, 0xb9d: 0x0024, 0xb9e: 0x0024, 0xb9f: 0x0024, 0xba0: 0x0024, 0xba1: 0x0024, 0xba2: 0x0024, 0xba3: 0x0024, 0xba4: 0x0024, 0xba5: 0x0024, 0xba6: 0x0024, 0xba7: 0x0024, 0xba8: 0x0024, 0xba9: 0x0024, 0xbaa: 0x0024, 0xbab: 0x0024, 0xbac: 0x0024, 0xbad: 0x0024, 0xbae: 0x0024, 0xbaf: 0x0024, 0xbb0: 0x0024, 0xbb1: 0x0024, 0xbb2: 0x0024, 0xbb3: 0x0024, 0xbb4: 0x0024, 0xbb5: 0x0024, 0xbb6: 0x0024, 0xbb7: 0x0024, 0xbb8: 0x0024, 0xbb9: 0x0024, 0xbba: 0x0024, 0xbbb: 0x0024, 0xbbc: 0x0024, // Block 0x2f, offset 0xbc0 0xbc6: 0x0024, // Block 0x30, offset 0xc00 0xc00: 0x0010, 0xc01: 0x0010, 0xc02: 0x0010, 0xc03: 0x0010, 0xc04: 0x0010, 0xc05: 0x0010, 0xc06: 0x0010, 0xc07: 0x0010, 0xc08: 0x0010, 0xc09: 0x0010, 0xc0a: 0x0010, 0xc0b: 0x0010, 0xc0c: 0x0010, 0xc0d: 0x0010, 0xc0e: 0x0010, 0xc0f: 0x0010, 0xc10: 0x0010, 0xc11: 0x0010, 0xc12: 0x0010, 0xc13: 0x0010, 0xc14: 0x0010, 0xc15: 0x0010, 0xc16: 0x0010, 0xc17: 0x0010, 0xc18: 0x0010, 0xc19: 0x0010, 0xc1a: 0x0010, 0xc1b: 0x0010, 0xc1c: 0x0010, 0xc1d: 0x0010, 0xc1e: 0x0010, 0xc1f: 0x0010, 0xc20: 0x0010, 0xc21: 0x0010, 0xc22: 0x0010, 0xc23: 0x0010, 0xc24: 0x0010, 0xc25: 0x0010, 0xc26: 0x0010, 0xc27: 0x0010, 0xc28: 0x0010, 0xc29: 0x0010, 0xc2a: 0x0010, 0xc2d: 0x0024, 0xc2e: 0x0024, 0xc2f: 0x0024, 0xc30: 0x0024, 0xc31: 0x2000, 0xc32: 0x0024, 0xc33: 0x0024, 0xc34: 0x0024, 0xc35: 0x0024, 0xc36: 0x0024, 0xc37: 0x0024, 0xc39: 0x0044, 0xc3a: 0x0024, 0xc3b: 0x2000, 0xc3c: 0x2000, 0xc3d: 0x0024, 0xc3e: 0x0024, 0xc3f: 0x0010, // Block 0x31, offset 0xc40 0xc50: 0x0010, 0xc51: 0x0010, 0xc52: 0x0010, 0xc53: 0x0010, 0xc54: 0x0010, 0xc55: 0x0010, 0xc56: 0x2000, 0xc57: 0x2000, 0xc58: 0x0024, 0xc59: 0x0024, 0xc5a: 0x0010, 0xc5b: 0x0010, 0xc5c: 0x0010, 0xc5d: 0x0010, 0xc5e: 0x0024, 0xc5f: 0x0024, 0xc60: 0x0024, 0xc61: 0x0010, 0xc65: 0x0010, 0xc66: 0x0010, 0xc6e: 0x0010, 0xc6f: 0x0010, 0xc70: 0x0010, 0xc71: 0x0024, 0xc72: 0x0024, 0xc73: 0x0024, 0xc74: 0x0024, 0xc75: 0x0010, 0xc76: 0x0010, 0xc77: 0x0010, 0xc78: 0x0010, 0xc79: 0x0010, 0xc7a: 0x0010, 0xc7b: 0x0010, 0xc7c: 0x0010, 0xc7d: 0x0010, 0xc7e: 0x0010, 0xc7f: 0x0010, // Block 0x32, offset 0xc80 0xc80: 0x0010, 0xc81: 0x0010, 0xc82: 0x0024, 0xc84: 0x2000, 0xc85: 0x0024, 0xc86: 0x0024, 0xc8d: 0x0024, 0xc8e: 0x0010, 0xc9d: 0x0024, // Block 0x33, offset 0xcc0 0xcc0: 0x0080, 0xcc1: 0x0080, 0xcc2: 0x0080, 0xcc3: 0x0080, 0xcc4: 0x0080, 0xcc5: 0x0080, 0xcc6: 0x0080, 0xcc7: 0x0080, 0xcc8: 0x0080, 0xcc9: 0x0080, 0xcca: 0x0080, 0xccb: 0x0080, 0xccc: 0x0080, 0xccd: 0x0080, 0xcce: 0x0080, 0xccf: 0x0080, 0xcd0: 0x0080, 0xcd1: 0x0080, 0xcd2: 0x0080, 0xcd3: 0x0080, 0xcd4: 0x0080, 0xcd5: 0x0080, 0xcd6: 0x0080, 0xcd7: 0x0080, 0xcd8: 0x0080, 0xcd9: 0x0080, 0xcda: 0x0080, 0xcdb: 0x0080, 0xcdc: 0x0080, 0xcdd: 0x0080, 0xcde: 0x0080, 0xcdf: 0x0080, 0xce0: 0x0080, 0xce1: 0x0080, 0xce2: 0x0080, 0xce3: 0x0080, 0xce4: 0x0080, 0xce5: 0x0080, 0xce6: 0x0080, 0xce7: 0x0080, 0xce8: 0x0080, 0xce9: 0x0080, 0xcea: 0x0080, 0xceb: 0x0080, 0xcec: 0x0080, 0xced: 0x0080, 0xcee: 0x0080, 0xcef: 0x0080, 0xcf0: 0x0080, 0xcf1: 0x0080, 0xcf2: 0x0080, 0xcf3: 0x0080, 0xcf4: 0x0080, 0xcf5: 0x0080, 0xcf6: 0x0080, 0xcf7: 0x0080, 0xcf8: 0x0080, 0xcf9: 0x0080, 0xcfa: 0x0080, 0xcfb: 0x0080, 0xcfc: 0x0080, 0xcfd: 0x0080, 0xcfe: 0x0080, 0xcff: 0x0080, // Block 0x34, offset 0xd00 0xd00: 0x0080, 0xd01: 0x0080, 0xd02: 0x0080, 0xd03: 0x0080, 0xd04: 0x0080, 0xd05: 0x0080, 0xd06: 0x0080, 0xd07: 0x0080, 0xd08: 0x0080, 0xd09: 0x0080, 0xd0a: 0x0080, 0xd0b: 0x0080, 0xd0c: 0x0080, 0xd0d: 0x0080, 0xd0e: 0x0080, 0xd0f: 0x0080, 0xd10: 0x0080, 0xd11: 0x0080, 0xd12: 0x0080, 0xd13: 0x0080, 0xd14: 0x0080, 0xd15: 0x0080, 0xd16: 0x0080, 0xd17: 0x0080, 0xd18: 0x0080, 0xd19: 0x0080, 0xd1a: 0x0080, 0xd1b: 0x0080, 0xd1c: 0x0080, 0xd1d: 0x0080, 0xd1e: 0x0080, 0xd1f: 0x0080, 0xd20: 0x8000, 0xd21: 0x8000, 0xd22: 0x8000, 0xd23: 0x8000, 0xd24: 0x8000, 0xd25: 0x8000, 0xd26: 0x8000, 0xd27: 0x8000, 0xd28: 0x8000, 0xd29: 0x8000, 0xd2a: 0x8000, 0xd2b: 0x8000, 0xd2c: 0x8000, 0xd2d: 0x8000, 0xd2e: 0x8000, 0xd2f: 0x8000, 0xd30: 0x8000, 0xd31: 0x8000, 0xd32: 0x8000, 0xd33: 0x8000, 0xd34: 0x8000, 0xd35: 0x8000, 0xd36: 0x8000, 0xd37: 0x8000, 0xd38: 0x8000, 0xd39: 0x8000, 0xd3a: 0x8000, 0xd3b: 0x8000, 0xd3c: 0x8000, 0xd3d: 0x8000, 0xd3e: 0x8000, 0xd3f: 0x8000, // Block 0x35, offset 0xd40 0xd40: 0x8000, 0xd41: 0x8000, 0xd42: 0x8000, 0xd43: 0x8000, 0xd44: 0x8000, 0xd45: 0x8000, 0xd46: 0x8000, 0xd47: 0x8000, 0xd48: 0x8000, 0xd49: 0x8000, 0xd4a: 0x8000, 0xd4b: 0x8000, 0xd4c: 0x8000, 0xd4d: 0x8000, 0xd4e: 0x8000, 0xd4f: 0x8000, 0xd50: 0x8000, 0xd51: 0x8000, 0xd52: 0x8000, 0xd53: 0x8000, 0xd54: 0x8000, 0xd55: 0x8000, 0xd56: 0x8000, 0xd57: 0x8000, 0xd58: 0x8000, 0xd59: 0x8000, 0xd5a: 0x8000, 0xd5b: 0x8000, 0xd5c: 0x8000, 0xd5d: 0x8000, 0xd5e: 0x8000, 0xd5f: 0x8000, 0xd60: 0x8000, 0xd61: 0x8000, 0xd62: 0x8000, 0xd63: 0x8000, 0xd64: 0x8000, 0xd65: 0x8000, 0xd66: 0x8000, 0xd67: 0x8000, 0xd68: 0x4000, 0xd69: 0x4000, 0xd6a: 0x4000, 0xd6b: 0x4000, 0xd6c: 0x4000, 0xd6d: 0x4000, 0xd6e: 0x4000, 0xd6f: 0x4000, 0xd70: 0x4000, 0xd71: 0x4000, 0xd72: 0x4000, 0xd73: 0x4000, 0xd74: 0x4000, 0xd75: 0x4000, 0xd76: 0x4000, 0xd77: 0x4000, 0xd78: 0x4000, 0xd79: 0x4000, 0xd7a: 0x4000, 0xd7b: 0x4000, 0xd7c: 0x4000, 0xd7d: 0x4000, 0xd7e: 0x4000, 0xd7f: 0x4000, // Block 0x36, offset 0xd80 0xd80: 0x4000, 0xd81: 0x4000, 0xd82: 0x4000, 0xd83: 0x4000, 0xd84: 0x4000, 0xd85: 0x4000, 0xd86: 0x4000, 0xd87: 0x4000, 0xd88: 0x4000, 0xd89: 0x4000, 0xd8a: 0x4000, 0xd8b: 0x4000, 0xd8c: 0x4000, 0xd8d: 0x4000, 0xd8e: 0x4000, 0xd8f: 0x4000, 0xd90: 0x4000, 0xd91: 0x4000, 0xd92: 0x4000, 0xd93: 0x4000, 0xd94: 0x4000, 0xd95: 0x4000, 0xd96: 0x4000, 0xd97: 0x4000, 0xd98: 0x4000, 0xd99: 0x4000, 0xd9a: 0x4000, 0xd9b: 0x4000, 0xd9c: 0x4000, 0xd9d: 0x4000, 0xd9e: 0x4000, 0xd9f: 0x4000, 0xda0: 0x4000, 0xda1: 0x4000, 0xda2: 0x4000, 0xda3: 0x4000, 0xda4: 0x4000, 0xda5: 0x4000, 0xda6: 0x4000, 0xda7: 0x4000, 0xda8: 0x4000, 0xda9: 0x4000, 0xdaa: 0x4000, 0xdab: 0x4000, 0xdac: 0x4000, 0xdad: 0x4000, 0xdae: 0x4000, 0xdaf: 0x4000, 0xdb0: 0x4000, 0xdb1: 0x4000, 0xdb2: 0x4000, 0xdb3: 0x4000, 0xdb4: 0x4000, 0xdb5: 0x4000, 0xdb6: 0x4000, 0xdb7: 0x4000, 0xdb8: 0x4000, 0xdb9: 0x4000, 0xdba: 0x4000, 0xdbb: 0x4000, 0xdbc: 0x4000, 0xdbd: 0x4000, 0xdbe: 0x4000, 0xdbf: 0x4000, // Block 0x37, offset 0xdc0 0xddd: 0x0024, 0xdde: 0x0024, 0xddf: 0x0024, // Block 0x38, offset 0xe00 0xe12: 0x0024, 0xe13: 0x0024, 0xe14: 0x0024, 0xe15: 0x0024, 0xe32: 0x0024, 0xe33: 0x0024, 0xe34: 0x0024, // Block 0x39, offset 0xe40 0xe52: 0x0024, 0xe53: 0x0024, 0xe72: 0x0024, 0xe73: 0x0024, // Block 0x3a, offset 0xe80 0xe80: 0x0010, 0xe81: 0x0010, 0xe82: 0x0010, 0xe83: 0x0010, 0xe84: 0x0010, 0xe85: 0x0010, 0xe86: 0x0010, 0xe87: 0x0010, 0xe88: 0x0010, 0xe89: 0x0010, 0xe8a: 0x0010, 0xe8b: 0x0010, 0xe8c: 0x0010, 0xe8d: 0x0010, 0xe8e: 0x0010, 0xe8f: 0x0010, 0xe90: 0x0010, 0xe91: 0x0010, 0xe92: 0x0010, 0xe93: 0x0010, 0xe94: 0x0010, 0xe95: 0x0010, 0xe96: 0x0010, 0xe97: 0x0010, 0xe98: 0x0010, 0xe99: 0x0010, 0xe9a: 0x0010, 0xe9b: 0x0010, 0xe9c: 0x0010, 0xe9d: 0x0010, 0xe9e: 0x0010, 0xe9f: 0x0010, 0xea0: 0x0010, 0xea1: 0x0010, 0xea2: 0x0010, 0xea3: 0x0010, 0xea4: 0x0010, 0xea5: 0x0010, 0xea6: 0x0010, 0xea7: 0x0010, 0xea8: 0x0010, 0xea9: 0x0010, 0xeaa: 0x0010, 0xeab: 0x0010, 0xeac: 0x0010, 0xead: 0x0010, 0xeae: 0x0010, 0xeaf: 0x0010, 0xeb0: 0x0010, 0xeb1: 0x0010, 0xeb2: 0x0010, 0xeb3: 0x0010, 0xeb4: 0x0024, 0xeb5: 0x0024, 0xeb6: 0x2000, 0xeb7: 0x0024, 0xeb8: 0x0024, 0xeb9: 0x0024, 0xeba: 0x0024, 0xebb: 0x0024, 0xebc: 0x0024, 0xebd: 0x0024, 0xebe: 0x2000, 0xebf: 0x2000, // Block 0x3b, offset 0xec0 0xec0: 0x2000, 0xec1: 0x2000, 0xec2: 0x2000, 0xec3: 0x2000, 0xec4: 0x2000, 0xec5: 0x2000, 0xec6: 0x0024, 0xec7: 0x2000, 0xec8: 0x2000, 0xec9: 0x0024, 0xeca: 0x0024, 0xecb: 0x0024, 0xecc: 0x0024, 0xecd: 0x0024, 0xece: 0x0024, 0xecf: 0x0024, 0xed0: 0x0024, 0xed1: 0x0024, 0xed2: 0x0044, 0xed3: 0x0024, 0xedd: 0x0024, // Block 0x3c, offset 0xf00 0xf0b: 0x0024, 0xf0c: 0x0024, 0xf0d: 0x0024, 0xf0e: 0x0002, 0xf0f: 0x0024, // Block 0x3d, offset 0xf40 0xf45: 0x0024, 0xf46: 0x0024, 0xf69: 0x0024, // Block 0x3e, offset 0xf80 0xfa0: 0x0024, 0xfa1: 0x0024, 0xfa2: 0x0024, 0xfa3: 0x2000, 0xfa4: 0x2000, 0xfa5: 0x2000, 0xfa6: 0x2000, 0xfa7: 0x0024, 0xfa8: 0x0024, 0xfa9: 0x2000, 0xfaa: 0x2000, 0xfab: 0x2000, 0xfb0: 0x2000, 0xfb1: 0x2000, 0xfb2: 0x0024, 0xfb3: 0x2000, 0xfb4: 0x2000, 0xfb5: 0x2000, 0xfb6: 0x2000, 0xfb7: 0x2000, 0xfb8: 0x2000, 0xfb9: 0x0024, 0xfba: 0x0024, 0xfbb: 0x0024, // Block 0x3f, offset 0xfc0 0xfd7: 0x0024, 0xfd8: 0x0024, 0xfd9: 0x2000, 0xfda: 0x2000, 0xfdb: 0x0024, 0xfe0: 0x0010, 0xfe1: 0x0010, 0xfe2: 0x0010, 0xfe3: 0x0010, 0xfe4: 0x0010, 0xfe5: 0x0010, 0xfe6: 0x0010, 0xfe7: 0x0010, 0xfe8: 0x0010, 0xfe9: 0x0010, 0xfea: 0x0010, 0xfeb: 0x0010, 0xfec: 0x0010, 0xfed: 0x0010, 0xfee: 0x0010, 0xfef: 0x0010, 0xff0: 0x0010, 0xff1: 0x0010, 0xff2: 0x0010, 0xff3: 0x0010, 0xff4: 0x0010, 0xff5: 0x0010, 0xff6: 0x0010, 0xff7: 0x0010, 0xff8: 0x0010, 0xff9: 0x0010, 0xffa: 0x0010, 0xffb: 0x0010, 0xffc: 0x0010, 0xffd: 0x0010, 0xffe: 0x0010, 0xfff: 0x0010, // Block 0x40, offset 0x1000 0x1000: 0x0010, 0x1001: 0x0010, 0x1002: 0x0010, 0x1003: 0x0010, 0x1004: 0x0010, 0x1005: 0x0010, 0x1006: 0x0010, 0x1007: 0x0010, 0x1008: 0x0010, 0x1009: 0x0010, 0x100a: 0x0010, 0x100b: 0x0010, 0x100c: 0x0010, 0x100d: 0x0010, 0x100e: 0x0010, 0x100f: 0x0010, 0x1010: 0x0010, 0x1011: 0x0010, 0x1012: 0x0010, 0x1013: 0x0010, 0x1014: 0x0010, 0x1015: 0x2000, 0x1016: 0x0024, 0x1017: 0x2000, 0x1018: 0x0024, 0x1019: 0x0024, 0x101a: 0x0024, 0x101b: 0x0024, 0x101c: 0x0024, 0x101d: 0x0024, 0x101e: 0x0024, 0x1020: 0x0044, 0x1022: 0x0024, 0x1025: 0x0024, 0x1026: 0x0024, 0x1027: 0x0024, 0x1028: 0x0024, 0x1029: 0x0024, 0x102a: 0x0024, 0x102b: 0x0024, 0x102c: 0x0024, 0x102d: 0x2000, 0x102e: 0x2000, 0x102f: 0x2000, 0x1030: 0x2000, 0x1031: 0x2000, 0x1032: 0x2000, 0x1033: 0x0024, 0x1034: 0x0024, 0x1035: 0x0024, 0x1036: 0x0024, 0x1037: 0x0024, 0x1038: 0x0024, 0x1039: 0x0024, 0x103a: 0x0024, 0x103b: 0x0024, 0x103c: 0x0024, 0x103f: 0x0024, // Block 0x41, offset 0x1040 0x1070: 0x0024, 0x1071: 0x0024, 0x1072: 0x0024, 0x1073: 0x0024, 0x1074: 0x0024, 0x1075: 0x0024, 0x1076: 0x0024, 0x1077: 0x0024, 0x1078: 0x0024, 0x1079: 0x0024, 0x107a: 0x0024, 0x107b: 0x0024, 0x107c: 0x0024, 0x107d: 0x0024, 0x107e: 0x0024, 0x107f: 0x0024, // Block 0x42, offset 0x1080 0x1080: 0x0024, 0x1081: 0x0024, 0x1082: 0x0024, 0x1083: 0x0024, 0x1084: 0x0024, 0x1085: 0x0024, 0x1086: 0x0024, 0x1087: 0x0024, 0x1088: 0x0024, 0x1089: 0x0024, 0x108a: 0x0024, 0x108b: 0x0024, 0x108c: 0x0024, 0x108d: 0x0024, 0x108e: 0x0024, 0x108f: 0x0024, 0x1090: 0x0024, 0x1091: 0x0024, 0x1092: 0x0024, 0x1093: 0x0024, 0x1094: 0x0024, 0x1095: 0x0024, 0x1096: 0x0024, 0x1097: 0x0024, 0x1098: 0x0024, 0x1099: 0x0024, 0x109a: 0x0024, 0x109b: 0x0024, 0x109c: 0x0024, 0x109d: 0x0024, 0x10a0: 0x0024, 0x10a1: 0x0024, 0x10a2: 0x0024, 0x10a3: 0x0024, 0x10a4: 0x0024, 0x10a5: 0x0024, 0x10a6: 0x0024, 0x10a7: 0x0024, 0x10a8: 0x0024, 0x10a9: 0x0024, 0x10aa: 0x0024, 0x10ab: 0x0024, // Block 0x43, offset 0x10c0 0x10c0: 0x0024, 0x10c1: 0x0024, 0x10c2: 0x0024, 0x10c3: 0x0024, 0x10c4: 0x2000, 0x10cb: 0x0010, 0x10cc: 0x0010, 0x10d3: 0x0010, 0x10d4: 0x0010, 0x10d5: 0x0010, 0x10d6: 0x0010, 0x10d7: 0x0010, 0x10d8: 0x0010, 0x10d9: 0x0010, 0x10da: 0x0010, 0x10db: 0x0010, 0x10dc: 0x0010, 0x10dd: 0x0010, 0x10de: 0x0010, 0x10df: 0x0010, 0x10e0: 0x0010, 0x10e1: 0x0010, 0x10e2: 0x0010, 0x10e3: 0x0010, 0x10e4: 0x0010, 0x10e5: 0x0010, 0x10e6: 0x0010, 0x10e7: 0x0010, 0x10e8: 0x0010, 0x10e9: 0x0010, 0x10ea: 0x0010, 0x10eb: 0x0010, 0x10ec: 0x0010, 0x10ed: 0x0010, 0x10ee: 0x0010, 0x10ef: 0x0010, 0x10f0: 0x0010, 0x10f1: 0x0010, 0x10f2: 0x0010, 0x10f3: 0x0010, 0x10f4: 0x0024, 0x10f5: 0x0024, 0x10f6: 0x0024, 0x10f7: 0x0024, 0x10f8: 0x0024, 0x10f9: 0x0024, 0x10fa: 0x0024, 0x10fb: 0x0024, 0x10fc: 0x0024, 0x10fd: 0x0024, 0x10fe: 0x2000, 0x10ff: 0x2000, // Block 0x44, offset 0x1100 0x1100: 0x2000, 0x1101: 0x2000, 0x1102: 0x0024, 0x1103: 0x0024, 0x1104: 0x0044, 0x1105: 0x0010, 0x1106: 0x0010, 0x1107: 0x0010, 0x1108: 0x0010, 0x1109: 0x0010, 0x110a: 0x0010, 0x110b: 0x0010, 0x110c: 0x0010, 0x112b: 0x0024, 0x112c: 0x0024, 0x112d: 0x0024, 0x112e: 0x0024, 0x112f: 0x0024, 0x1130: 0x0024, 0x1131: 0x0024, 0x1132: 0x0024, 0x1133: 0x0024, // Block 0x45, offset 0x1140 0x1140: 0x0024, 0x1141: 0x0024, 0x1142: 0x2000, 0x1143: 0x0010, 0x1144: 0x0010, 0x1145: 0x0010, 0x1146: 0x0010, 0x1147: 0x0010, 0x1148: 0x0010, 0x1149: 0x0010, 0x114a: 0x0010, 0x114b: 0x0010, 0x114c: 0x0010, 0x114d: 0x0010, 0x114e: 0x0010, 0x114f: 0x0010, 0x1150: 0x0010, 0x1151: 0x0010, 0x1152: 0x0010, 0x1153: 0x0010, 0x1154: 0x0010, 0x1155: 0x0010, 0x1156: 0x0010, 0x1157: 0x0010, 0x1158: 0x0010, 0x1159: 0x0010, 0x115a: 0x0010, 0x115b: 0x0010, 0x115c: 0x0010, 0x115d: 0x0010, 0x115e: 0x0010, 0x115f: 0x0010, 0x1160: 0x0010, 0x1161: 0x2000, 0x1162: 0x0024, 0x1163: 0x0024, 0x1164: 0x0024, 0x1165: 0x0024, 0x1166: 0x2000, 0x1167: 0x2000, 0x1168: 0x0024, 0x1169: 0x0024, 0x116a: 0x0024, 0x116b: 0x0044, 0x116c: 0x0024, 0x116d: 0x0024, 0x116e: 0x0010, 0x116f: 0x0010, 0x117b: 0x0010, 0x117c: 0x0010, 0x117d: 0x0010, // Block 0x46, offset 0x1180 0x11a6: 0x0024, 0x11a7: 0x2000, 0x11a8: 0x0024, 0x11a9: 0x0024, 0x11aa: 0x2000, 0x11ab: 0x2000, 0x11ac: 0x2000, 0x11ad: 0x0024, 0x11ae: 0x2000, 0x11af: 0x0024, 0x11b0: 0x0024, 0x11b1: 0x0024, 0x11b2: 0x0024, 0x11b3: 0x0024, // Block 0x47, offset 0x11c0 0x11e4: 0x2000, 0x11e5: 0x2000, 0x11e6: 0x2000, 0x11e7: 0x2000, 0x11e8: 0x2000, 0x11e9: 0x2000, 0x11ea: 0x2000, 0x11eb: 0x2000, 0x11ec: 0x0024, 0x11ed: 0x0024, 0x11ee: 0x0024, 0x11ef: 0x0024, 0x11f0: 0x0024, 0x11f1: 0x0024, 0x11f2: 0x0024, 0x11f3: 0x0024, 0x11f4: 0x2000, 0x11f5: 0x2000, 0x11f6: 0x0024, 0x11f7: 0x0024, // Block 0x48, offset 0x1200 0x1210: 0x0024, 0x1211: 0x0024, 0x1212: 0x0024, 0x1214: 0x0024, 0x1215: 0x0024, 0x1216: 0x0024, 0x1217: 0x0024, 0x1218: 0x0024, 0x1219: 0x0024, 0x121a: 0x0024, 0x121b: 0x0024, 0x121c: 0x0024, 0x121d: 0x0024, 0x121e: 0x0024, 0x121f: 0x0024, 0x1220: 0x0024, 0x1221: 0x2000, 0x1222: 0x0024, 0x1223: 0x0024, 0x1224: 0x0024, 0x1225: 0x0024, 0x1226: 0x0024, 0x1227: 0x0024, 0x1228: 0x0024, 0x122d: 0x0024, 0x1234: 0x0024, 0x1237: 0x2000, 0x1238: 0x0024, 0x1239: 0x0024, // Block 0x49, offset 0x1240 0x124b: 0x0002, 0x124c: 0x0004, 0x124d: 0x10020, 0x124e: 0x0002, 0x124f: 0x0002, 0x1268: 0x0002, 0x1269: 0x0002, 0x126a: 0x0002, 0x126b: 0x0002, 0x126c: 0x0002, 0x126d: 0x0002, 0x126e: 0x0002, 0x127c: 0x0008, // Block 0x4a, offset 0x1280 0x1289: 0x0008, 0x12a0: 0x0002, 0x12a1: 0x0002, 0x12a2: 0x0002, 0x12a3: 0x0002, 0x12a4: 0x0002, 0x12a5: 0x0002, 0x12a6: 0x0002, 0x12a7: 0x0002, 0x12a8: 0x0002, 0x12a9: 0x0002, 0x12aa: 0x0002, 0x12ab: 0x0002, 0x12ac: 0x0002, 0x12ad: 0x0002, 0x12ae: 0x0002, 0x12af: 0x0002, // Block 0x4b, offset 0x12c0 0x12d0: 0x0024, 0x12d1: 0x0024, 0x12d2: 0x0024, 0x12d3: 0x0024, 0x12d4: 0x0024, 0x12d5: 0x0024, 0x12d6: 0x0024, 0x12d7: 0x0024, 0x12d8: 0x0024, 0x12d9: 0x0024, 0x12da: 0x0024, 0x12db: 0x0024, 0x12dc: 0x0024, 0x12dd: 0x0024, 0x12de: 0x0024, 0x12df: 0x0024, 0x12e0: 0x0024, 0x12e1: 0x0024, 0x12e2: 0x0024, 0x12e3: 0x0024, 0x12e4: 0x0024, 0x12e5: 0x0024, 0x12e6: 0x0024, 0x12e7: 0x0024, 0x12e8: 0x0024, 0x12e9: 0x0024, 0x12ea: 0x0024, 0x12eb: 0x0024, 0x12ec: 0x0024, 0x12ed: 0x0024, 0x12ee: 0x0024, 0x12ef: 0x0024, 0x12f0: 0x0024, // Block 0x4c, offset 0x1300 0x1322: 0x0008, 0x1339: 0x0008, // Block 0x4d, offset 0x1340 0x1354: 0x0008, 0x1355: 0x0008, 0x1356: 0x0008, 0x1357: 0x0008, 0x1358: 0x0008, 0x1359: 0x0008, 0x1369: 0x0008, 0x136a: 0x0008, // Block 0x4e, offset 0x1380 0x139a: 0x0008, 0x139b: 0x0008, 0x13a8: 0x0008, // Block 0x4f, offset 0x13c0 0x13cf: 0x0008, 0x13e9: 0x0008, 0x13ea: 0x0008, 0x13eb: 0x0008, 0x13ec: 0x0008, 0x13ed: 0x0008, 0x13ee: 0x0008, 0x13ef: 0x0008, 0x13f0: 0x0008, 0x13f1: 0x0008, 0x13f2: 0x0008, 0x13f3: 0x0008, 0x13f8: 0x0008, 0x13f9: 0x0008, 0x13fa: 0x0008, // Block 0x50, offset 0x1400 0x1402: 0x0008, // Block 0x51, offset 0x1440 0x146a: 0x0008, 0x146b: 0x0008, 0x1476: 0x0008, // Block 0x52, offset 0x1480 0x1480: 0x0008, 0x14bb: 0x0008, 0x14bc: 0x0008, 0x14bd: 0x0008, 0x14be: 0x0008, // Block 0x53, offset 0x14c0 0x14c0: 0x0008, 0x14c1: 0x0008, 0x14c2: 0x0008, 0x14c3: 0x0008, 0x14c4: 0x0008, 0x14ce: 0x0008, 0x14d1: 0x0008, 0x14d4: 0x0008, 0x14d5: 0x0008, 0x14d8: 0x0008, 0x14dd: 0x0008, 0x14e0: 0x0008, 0x14e2: 0x0008, 0x14e3: 0x0008, 0x14e6: 0x0008, 0x14ea: 0x0008, 0x14ee: 0x0008, 0x14ef: 0x0008, 0x14f8: 0x0008, 0x14f9: 0x0008, 0x14fa: 0x0008, // Block 0x54, offset 0x1500 0x1500: 0x0008, 0x1502: 0x0008, 0x1508: 0x0008, 0x1509: 0x0008, 0x150a: 0x0008, 0x150b: 0x0008, 0x150c: 0x0008, 0x150d: 0x0008, 0x150e: 0x0008, 0x150f: 0x0008, 0x1510: 0x0008, 0x1511: 0x0008, 0x1512: 0x0008, 0x1513: 0x0008, 0x151f: 0x0008, 0x1520: 0x0008, 0x1523: 0x0008, 0x1525: 0x0008, 0x1526: 0x0008, 0x1528: 0x0008, 0x153b: 0x0008, 0x153e: 0x0008, 0x153f: 0x0008, // Block 0x55, offset 0x1540 0x1552: 0x0008, 0x1553: 0x0008, 0x1554: 0x0008, 0x1555: 0x0008, 0x1556: 0x0008, 0x1557: 0x0008, 0x1559: 0x0008, 0x155b: 0x0008, 0x155c: 0x0008, 0x1560: 0x0008, 0x1561: 0x0008, 0x1567: 0x0008, 0x156a: 0x0008, 0x156b: 0x0008, 0x1570: 0x0008, 0x1571: 0x0008, 0x157d: 0x0008, 0x157e: 0x0008, // Block 0x56, offset 0x1580 0x1584: 0x0008, 0x1585: 0x0008, 0x1588: 0x0008, 0x158e: 0x0008, 0x158f: 0x0008, 0x1591: 0x0008, 0x1593: 0x0008, 0x1594: 0x0008, 0x15a9: 0x0008, 0x15aa: 0x0008, 0x15b0: 0x0008, 0x15b1: 0x0008, 0x15b2: 0x0008, 0x15b3: 0x0008, 0x15b4: 0x0008, 0x15b5: 0x0008, 0x15b7: 0x0008, 0x15b8: 0x0008, 0x15b9: 0x0008, 0x15ba: 0x0008, 0x15bd: 0x0008, // Block 0x57, offset 0x15c0 0x15c2: 0x0008, 0x15c5: 0x0008, 0x15c8: 0x0008, 0x15c9: 0x0008, 0x15ca: 0x0008, 0x15cb: 0x0008, 0x15cc: 0x0008, 0x15cd: 0x0008, 0x15cf: 0x0008, 0x15d2: 0x0008, 0x15d4: 0x0008, 0x15d6: 0x0008, 0x15dd: 0x0008, 0x15e1: 0x0008, 0x15e8: 0x0008, 0x15f3: 0x0008, 0x15f4: 0x0008, // Block 0x58, offset 0x1600 0x1604: 0x0008, 0x1607: 0x0008, 0x160c: 0x0008, 0x160e: 0x0008, 0x1613: 0x0008, 0x1614: 0x0008, 0x1615: 0x0008, 0x1617: 0x0008, 0x1623: 0x0008, 0x1624: 0x0008, // Block 0x59, offset 0x1640 0x1655: 0x0008, 0x1656: 0x0008, 0x1657: 0x0008, 0x1661: 0x0008, 0x1670: 0x0008, 0x167f: 0x0008, // Block 0x5a, offset 0x1680 0x16b4: 0x0008, 0x16b5: 0x0008, // Block 0x5b, offset 0x16c0 0x16c5: 0x0008, 0x16c6: 0x0008, 0x16c7: 0x0008, 0x16db: 0x0008, 0x16dc: 0x0008, // Block 0x5c, offset 0x1700 0x1710: 0x0008, 0x1715: 0x0008, // Block 0x5d, offset 0x1740 0x176f: 0x0024, 0x1770: 0x0024, 0x1771: 0x0024, // Block 0x5e, offset 0x1780 0x17bf: 0x0024, // Block 0x5f, offset 0x17c0 0x17e0: 0x0024, 0x17e1: 0x0024, 0x17e2: 0x0024, 0x17e3: 0x0024, 0x17e4: 0x0024, 0x17e5: 0x0024, 0x17e6: 0x0024, 0x17e7: 0x0024, 0x17e8: 0x0024, 0x17e9: 0x0024, 0x17ea: 0x0024, 0x17eb: 0x0024, 0x17ec: 0x0024, 0x17ed: 0x0024, 0x17ee: 0x0024, 0x17ef: 0x0024, 0x17f0: 0x0024, 0x17f1: 0x0024, 0x17f2: 0x0024, 0x17f3: 0x0024, 0x17f4: 0x0024, 0x17f5: 0x0024, 0x17f6: 0x0024, 0x17f7: 0x0024, 0x17f8: 0x0024, 0x17f9: 0x0024, 0x17fa: 0x0024, 0x17fb: 0x0024, 0x17fc: 0x0024, 0x17fd: 0x0024, 0x17fe: 0x0024, 0x17ff: 0x0024, // Block 0x60, offset 0x1800 0x182a: 0x0024, 0x182b: 0x0024, 0x182c: 0x0024, 0x182d: 0x0024, 0x182e: 0x0024, 0x182f: 0x0024, 0x1830: 0x0008, 0x183d: 0x0008, // Block 0x61, offset 0x1840 0x1859: 0x0024, 0x185a: 0x0024, // Block 0x62, offset 0x1880 0x1897: 0x0008, 0x1899: 0x0008, // Block 0x63, offset 0x18c0 0x18ef: 0x0024, 0x18f0: 0x0024, 0x18f1: 0x0024, 0x18f2: 0x0024, 0x18f4: 0x0024, 0x18f5: 0x0024, 0x18f6: 0x0024, 0x18f7: 0x0024, 0x18f8: 0x0024, 0x18f9: 0x0024, 0x18fa: 0x0024, 0x18fb: 0x0024, 0x18fc: 0x0024, 0x18fd: 0x0024, // Block 0x64, offset 0x1900 0x191e: 0x0024, 0x191f: 0x0024, // Block 0x65, offset 0x1940 0x1970: 0x0024, 0x1971: 0x0024, // Block 0x66, offset 0x1980 0x1982: 0x0024, 0x1986: 0x0024, 0x198b: 0x0024, 0x19a3: 0x2000, 0x19a4: 0x2000, 0x19a5: 0x0024, 0x19a6: 0x0024, 0x19a7: 0x2000, 0x19ac: 0x0024, // Block 0x67, offset 0x19c0 0x19c0: 0x2000, 0x19c1: 0x2000, 0x19f4: 0x2000, 0x19f5: 0x2000, 0x19f6: 0x2000, 0x19f7: 0x2000, 0x19f8: 0x2000, 0x19f9: 0x2000, 0x19fa: 0x2000, 0x19fb: 0x2000, 0x19fc: 0x2000, 0x19fd: 0x2000, 0x19fe: 0x2000, 0x19ff: 0x2000, // Block 0x68, offset 0x1a00 0x1a00: 0x2000, 0x1a01: 0x2000, 0x1a02: 0x2000, 0x1a03: 0x2000, 0x1a04: 0x0024, 0x1a05: 0x0024, 0x1a20: 0x0024, 0x1a21: 0x0024, 0x1a22: 0x0024, 0x1a23: 0x0024, 0x1a24: 0x0024, 0x1a25: 0x0024, 0x1a26: 0x0024, 0x1a27: 0x0024, 0x1a28: 0x0024, 0x1a29: 0x0024, 0x1a2a: 0x0024, 0x1a2b: 0x0024, 0x1a2c: 0x0024, 0x1a2d: 0x0024, 0x1a2e: 0x0024, 0x1a2f: 0x0024, 0x1a30: 0x0024, 0x1a31: 0x0024, 0x1a3f: 0x0024, // Block 0x69, offset 0x1a40 0x1a66: 0x0024, 0x1a67: 0x0024, 0x1a68: 0x0024, 0x1a69: 0x0024, 0x1a6a: 0x0024, 0x1a6b: 0x0024, 0x1a6c: 0x0024, 0x1a6d: 0x0024, // Block 0x6a, offset 0x1a80 0x1a87: 0x0024, 0x1a88: 0x0024, 0x1a89: 0x0024, 0x1a8a: 0x0024, 0x1a8b: 0x0024, 0x1a8c: 0x0024, 0x1a8d: 0x0024, 0x1a8e: 0x0024, 0x1a8f: 0x0024, 0x1a90: 0x0024, 0x1a91: 0x0024, 0x1a92: 0x2000, 0x1a93: 0x0024, 0x1aa0: 0x0080, 0x1aa1: 0x0080, 0x1aa2: 0x0080, 0x1aa3: 0x0080, 0x1aa4: 0x0080, 0x1aa5: 0x0080, 0x1aa6: 0x0080, 0x1aa7: 0x0080, 0x1aa8: 0x0080, 0x1aa9: 0x0080, 0x1aaa: 0x0080, 0x1aab: 0x0080, 0x1aac: 0x0080, 0x1aad: 0x0080, 0x1aae: 0x0080, 0x1aaf: 0x0080, 0x1ab0: 0x0080, 0x1ab1: 0x0080, 0x1ab2: 0x0080, 0x1ab3: 0x0080, 0x1ab4: 0x0080, 0x1ab5: 0x0080, 0x1ab6: 0x0080, 0x1ab7: 0x0080, 0x1ab8: 0x0080, 0x1ab9: 0x0080, 0x1aba: 0x0080, 0x1abb: 0x0080, 0x1abc: 0x0080, // Block 0x6b, offset 0x1ac0 0x1ac0: 0x0024, 0x1ac1: 0x0024, 0x1ac2: 0x0024, 0x1ac3: 0x2000, 0x1ac9: 0x0010, 0x1aca: 0x0010, 0x1acb: 0x0010, 0x1acf: 0x0010, 0x1ad0: 0x0010, 0x1ad1: 0x0010, 0x1ad2: 0x0010, 0x1ad3: 0x0010, 0x1ad4: 0x0010, 0x1ad5: 0x0010, 0x1ad6: 0x0010, 0x1ad7: 0x0010, 0x1ad8: 0x0010, 0x1ad9: 0x0010, 0x1ada: 0x0010, 0x1adb: 0x0010, 0x1adc: 0x0010, 0x1add: 0x0010, 0x1ade: 0x0010, 0x1adf: 0x0010, 0x1ae0: 0x0010, 0x1ae1: 0x0010, 0x1ae2: 0x0010, 0x1ae3: 0x0010, 0x1ae4: 0x0010, 0x1ae5: 0x0010, 0x1ae6: 0x0010, 0x1ae7: 0x0010, 0x1ae8: 0x0010, 0x1ae9: 0x0010, 0x1aea: 0x0010, 0x1aeb: 0x0010, 0x1aec: 0x0010, 0x1aed: 0x0010, 0x1aee: 0x0010, 0x1aef: 0x0010, 0x1af0: 0x0010, 0x1af1: 0x0010, 0x1af2: 0x0010, 0x1af3: 0x0024, 0x1af4: 0x2000, 0x1af5: 0x2000, 0x1af6: 0x0024, 0x1af7: 0x0024, 0x1af8: 0x0024, 0x1af9: 0x0024, 0x1afa: 0x2000, 0x1afb: 0x2000, 0x1afc: 0x0024, 0x1afd: 0x0024, 0x1afe: 0x2000, 0x1aff: 0x2000, // Block 0x6c, offset 0x1b00 0x1b00: 0x0044, 0x1b20: 0x0010, 0x1b21: 0x0010, 0x1b22: 0x0010, 0x1b23: 0x0010, 0x1b24: 0x0010, 0x1b25: 0x0024, 0x1b27: 0x0010, 0x1b28: 0x0010, 0x1b29: 0x0010, 0x1b2a: 0x0010, 0x1b2b: 0x0010, 0x1b2c: 0x0010, 0x1b2d: 0x0010, 0x1b2e: 0x0010, 0x1b2f: 0x0010, 0x1b3a: 0x0010, 0x1b3b: 0x0010, 0x1b3c: 0x0010, 0x1b3d: 0x0010, 0x1b3e: 0x0010, // Block 0x6d, offset 0x1b40 0x1b69: 0x0024, 0x1b6a: 0x0024, 0x1b6b: 0x0024, 0x1b6c: 0x0024, 0x1b6d: 0x0024, 0x1b6e: 0x0024, 0x1b6f: 0x2000, 0x1b70: 0x2000, 0x1b71: 0x0024, 0x1b72: 0x0024, 0x1b73: 0x2000, 0x1b74: 0x2000, 0x1b75: 0x0024, 0x1b76: 0x0024, // Block 0x6e, offset 0x1b80 0x1b83: 0x0024, 0x1b8c: 0x0024, 0x1b8d: 0x2000, 0x1ba0: 0x0010, 0x1ba1: 0x0010, 0x1ba2: 0x0010, 0x1ba3: 0x0010, 0x1ba4: 0x0010, 0x1ba5: 0x0010, 0x1ba6: 0x0010, 0x1ba7: 0x0010, 0x1ba8: 0x0010, 0x1ba9: 0x0010, 0x1baa: 0x0010, 0x1bab: 0x0010, 0x1bac: 0x0010, 0x1bad: 0x0010, 0x1bae: 0x0010, 0x1baf: 0x0010, 0x1bb1: 0x0010, 0x1bb2: 0x0010, 0x1bb3: 0x0010, 0x1bba: 0x0010, 0x1bbc: 0x0024, 0x1bbe: 0x0010, 0x1bbf: 0x0010, // Block 0x6f, offset 0x1bc0 0x1bf0: 0x0024, 0x1bf2: 0x0024, 0x1bf3: 0x0024, 0x1bf4: 0x0024, 0x1bf7: 0x0024, 0x1bf8: 0x0024, 0x1bfe: 0x0024, 0x1bff: 0x0024, // Block 0x70, offset 0x1c00 0x1c01: 0x0024, 0x1c20: 0x0010, 0x1c21: 0x0010, 0x1c22: 0x0010, 0x1c23: 0x0010, 0x1c24: 0x0010, 0x1c25: 0x0010, 0x1c26: 0x0010, 0x1c27: 0x0010, 0x1c28: 0x0010, 0x1c29: 0x0010, 0x1c2a: 0x0010, 0x1c2b: 0x2000, 0x1c2c: 0x0024, 0x1c2d: 0x0024, 0x1c2e: 0x2000, 0x1c2f: 0x2000, 0x1c35: 0x2000, 0x1c36: 0x0044, // Block 0x71, offset 0x1c40 0x1c40: 0x0010, 0x1c41: 0x0010, 0x1c42: 0x0010, 0x1c43: 0x0010, 0x1c44: 0x0010, 0x1c45: 0x0010, 0x1c46: 0x0010, 0x1c47: 0x0010, 0x1c48: 0x0010, 0x1c49: 0x0010, 0x1c4a: 0x0010, 0x1c4b: 0x0010, 0x1c4c: 0x0010, 0x1c4d: 0x0010, 0x1c4e: 0x0010, 0x1c4f: 0x0010, 0x1c50: 0x0010, 0x1c51: 0x0010, 0x1c52: 0x0010, 0x1c53: 0x0010, 0x1c54: 0x0010, 0x1c55: 0x0010, 0x1c56: 0x0010, 0x1c57: 0x0010, 0x1c58: 0x0010, 0x1c59: 0x0010, 0x1c5a: 0x0010, 0x1c63: 0x2000, 0x1c64: 0x2000, 0x1c65: 0x0024, 0x1c66: 0x2000, 0x1c67: 0x2000, 0x1c68: 0x0024, 0x1c69: 0x2000, 0x1c6a: 0x2000, 0x1c6c: 0x2000, 0x1c6d: 0x0024, // Block 0x72, offset 0x1c80 0x1c80: 0x0200, 0x1c81: 0x0400, 0x1c82: 0x0400, 0x1c83: 0x0400, 0x1c84: 0x0400, 0x1c85: 0x0400, 0x1c86: 0x0400, 0x1c87: 0x0400, 0x1c88: 0x0400, 0x1c89: 0x0400, 0x1c8a: 0x0400, 0x1c8b: 0x0400, 0x1c8c: 0x0400, 0x1c8d: 0x0400, 0x1c8e: 0x0400, 0x1c8f: 0x0400, 0x1c90: 0x0400, 0x1c91: 0x0400, 0x1c92: 0x0400, 0x1c93: 0x0400, 0x1c94: 0x0400, 0x1c95: 0x0400, 0x1c96: 0x0400, 0x1c97: 0x0400, 0x1c98: 0x0400, 0x1c99: 0x0400, 0x1c9a: 0x0400, 0x1c9b: 0x0400, 0x1c9c: 0x0200, 0x1c9d: 0x0400, 0x1c9e: 0x0400, 0x1c9f: 0x0400, 0x1ca0: 0x0400, 0x1ca1: 0x0400, 0x1ca2: 0x0400, 0x1ca3: 0x0400, 0x1ca4: 0x0400, 0x1ca5: 0x0400, 0x1ca6: 0x0400, 0x1ca7: 0x0400, 0x1ca8: 0x0400, 0x1ca9: 0x0400, 0x1caa: 0x0400, 0x1cab: 0x0400, 0x1cac: 0x0400, 0x1cad: 0x0400, 0x1cae: 0x0400, 0x1caf: 0x0400, 0x1cb0: 0x0400, 0x1cb1: 0x0400, 0x1cb2: 0x0400, 0x1cb3: 0x0400, 0x1cb4: 0x0400, 0x1cb5: 0x0400, 0x1cb6: 0x0400, 0x1cb7: 0x0400, 0x1cb8: 0x0200, 0x1cb9: 0x0400, 0x1cba: 0x0400, 0x1cbb: 0x0400, 0x1cbc: 0x0400, 0x1cbd: 0x0400, 0x1cbe: 0x0400, 0x1cbf: 0x0400, // Block 0x73, offset 0x1cc0 0x1cc0: 0x0400, 0x1cc1: 0x0400, 0x1cc2: 0x0400, 0x1cc3: 0x0400, 0x1cc4: 0x0400, 0x1cc5: 0x0400, 0x1cc6: 0x0400, 0x1cc7: 0x0400, 0x1cc8: 0x0400, 0x1cc9: 0x0400, 0x1cca: 0x0400, 0x1ccb: 0x0400, 0x1ccc: 0x0400, 0x1ccd: 0x0400, 0x1cce: 0x0400, 0x1ccf: 0x0400, 0x1cd0: 0x0400, 0x1cd1: 0x0400, 0x1cd2: 0x0400, 0x1cd3: 0x0400, 0x1cd4: 0x0200, 0x1cd5: 0x0400, 0x1cd6: 0x0400, 0x1cd7: 0x0400, 0x1cd8: 0x0400, 0x1cd9: 0x0400, 0x1cda: 0x0400, 0x1cdb: 0x0400, 0x1cdc: 0x0400, 0x1cdd: 0x0400, 0x1cde: 0x0400, 0x1cdf: 0x0400, 0x1ce0: 0x0400, 0x1ce1: 0x0400, 0x1ce2: 0x0400, 0x1ce3: 0x0400, 0x1ce4: 0x0400, 0x1ce5: 0x0400, 0x1ce6: 0x0400, 0x1ce7: 0x0400, 0x1ce8: 0x0400, 0x1ce9: 0x0400, 0x1cea: 0x0400, 0x1ceb: 0x0400, 0x1cec: 0x0400, 0x1ced: 0x0400, 0x1cee: 0x0400, 0x1cef: 0x0400, 0x1cf0: 0x0200, 0x1cf1: 0x0400, 0x1cf2: 0x0400, 0x1cf3: 0x0400, 0x1cf4: 0x0400, 0x1cf5: 0x0400, 0x1cf6: 0x0400, 0x1cf7: 0x0400, 0x1cf8: 0x0400, 0x1cf9: 0x0400, 0x1cfa: 0x0400, 0x1cfb: 0x0400, 0x1cfc: 0x0400, 0x1cfd: 0x0400, 0x1cfe: 0x0400, 0x1cff: 0x0400, // Block 0x74, offset 0x1d00 0x1d00: 0x0400, 0x1d01: 0x0400, 0x1d02: 0x0400, 0x1d03: 0x0400, 0x1d04: 0x0400, 0x1d05: 0x0400, 0x1d06: 0x0400, 0x1d07: 0x0400, 0x1d08: 0x0400, 0x1d09: 0x0400, 0x1d0a: 0x0400, 0x1d0b: 0x0400, 0x1d0c: 0x0200, 0x1d0d: 0x0400, 0x1d0e: 0x0400, 0x1d0f: 0x0400, 0x1d10: 0x0400, 0x1d11: 0x0400, 0x1d12: 0x0400, 0x1d13: 0x0400, 0x1d14: 0x0400, 0x1d15: 0x0400, 0x1d16: 0x0400, 0x1d17: 0x0400, 0x1d18: 0x0400, 0x1d19: 0x0400, 0x1d1a: 0x0400, 0x1d1b: 0x0400, 0x1d1c: 0x0400, 0x1d1d: 0x0400, 0x1d1e: 0x0400, 0x1d1f: 0x0400, 0x1d20: 0x0400, 0x1d21: 0x0400, 0x1d22: 0x0400, 0x1d23: 0x0400, 0x1d24: 0x0400, 0x1d25: 0x0400, 0x1d26: 0x0400, 0x1d27: 0x0400, 0x1d28: 0x0200, 0x1d29: 0x0400, 0x1d2a: 0x0400, 0x1d2b: 0x0400, 0x1d2c: 0x0400, 0x1d2d: 0x0400, 0x1d2e: 0x0400, 0x1d2f: 0x0400, 0x1d30: 0x0400, 0x1d31: 0x0400, 0x1d32: 0x0400, 0x1d33: 0x0400, 0x1d34: 0x0400, 0x1d35: 0x0400, 0x1d36: 0x0400, 0x1d37: 0x0400, 0x1d38: 0x0400, 0x1d39: 0x0400, 0x1d3a: 0x0400, 0x1d3b: 0x0400, 0x1d3c: 0x0400, 0x1d3d: 0x0400, 0x1d3e: 0x0400, 0x1d3f: 0x0400, // Block 0x75, offset 0x1d40 0x1d40: 0x0400, 0x1d41: 0x0400, 0x1d42: 0x0400, 0x1d43: 0x0400, 0x1d44: 0x0200, 0x1d45: 0x0400, 0x1d46: 0x0400, 0x1d47: 0x0400, 0x1d48: 0x0400, 0x1d49: 0x0400, 0x1d4a: 0x0400, 0x1d4b: 0x0400, 0x1d4c: 0x0400, 0x1d4d: 0x0400, 0x1d4e: 0x0400, 0x1d4f: 0x0400, 0x1d50: 0x0400, 0x1d51: 0x0400, 0x1d52: 0x0400, 0x1d53: 0x0400, 0x1d54: 0x0400, 0x1d55: 0x0400, 0x1d56: 0x0400, 0x1d57: 0x0400, 0x1d58: 0x0400, 0x1d59: 0x0400, 0x1d5a: 0x0400, 0x1d5b: 0x0400, 0x1d5c: 0x0400, 0x1d5d: 0x0400, 0x1d5e: 0x0400, 0x1d5f: 0x0400, 0x1d60: 0x0200, 0x1d61: 0x0400, 0x1d62: 0x0400, 0x1d63: 0x0400, 0x1d64: 0x0400, 0x1d65: 0x0400, 0x1d66: 0x0400, 0x1d67: 0x0400, 0x1d68: 0x0400, 0x1d69: 0x0400, 0x1d6a: 0x0400, 0x1d6b: 0x0400, 0x1d6c: 0x0400, 0x1d6d: 0x0400, 0x1d6e: 0x0400, 0x1d6f: 0x0400, 0x1d70: 0x0400, 0x1d71: 0x0400, 0x1d72: 0x0400, 0x1d73: 0x0400, 0x1d74: 0x0400, 0x1d75: 0x0400, 0x1d76: 0x0400, 0x1d77: 0x0400, 0x1d78: 0x0400, 0x1d79: 0x0400, 0x1d7a: 0x0400, 0x1d7b: 0x0400, 0x1d7c: 0x0200, 0x1d7d: 0x0400, 0x1d7e: 0x0400, 0x1d7f: 0x0400, // Block 0x76, offset 0x1d80 0x1d80: 0x0400, 0x1d81: 0x0400, 0x1d82: 0x0400, 0x1d83: 0x0400, 0x1d84: 0x0400, 0x1d85: 0x0400, 0x1d86: 0x0400, 0x1d87: 0x0400, 0x1d88: 0x0400, 0x1d89: 0x0400, 0x1d8a: 0x0400, 0x1d8b: 0x0400, 0x1d8c: 0x0400, 0x1d8d: 0x0400, 0x1d8e: 0x0400, 0x1d8f: 0x0400, 0x1d90: 0x0400, 0x1d91: 0x0400, 0x1d92: 0x0400, 0x1d93: 0x0400, 0x1d94: 0x0400, 0x1d95: 0x0400, 0x1d96: 0x0400, 0x1d97: 0x0400, 0x1d98: 0x0200, 0x1d99: 0x0400, 0x1d9a: 0x0400, 0x1d9b: 0x0400, 0x1d9c: 0x0400, 0x1d9d: 0x0400, 0x1d9e: 0x0400, 0x1d9f: 0x0400, 0x1da0: 0x0400, 0x1da1: 0x0400, 0x1da2: 0x0400, 0x1da3: 0x0400, 0x1da4: 0x0400, 0x1da5: 0x0400, 0x1da6: 0x0400, 0x1da7: 0x0400, 0x1da8: 0x0400, 0x1da9: 0x0400, 0x1daa: 0x0400, 0x1dab: 0x0400, 0x1dac: 0x0400, 0x1dad: 0x0400, 0x1dae: 0x0400, 0x1daf: 0x0400, 0x1db0: 0x0400, 0x1db1: 0x0400, 0x1db2: 0x0400, 0x1db3: 0x0400, 0x1db4: 0x0200, 0x1db5: 0x0400, 0x1db6: 0x0400, 0x1db7: 0x0400, 0x1db8: 0x0400, 0x1db9: 0x0400, 0x1dba: 0x0400, 0x1dbb: 0x0400, 0x1dbc: 0x0400, 0x1dbd: 0x0400, 0x1dbe: 0x0400, 0x1dbf: 0x0400, // Block 0x77, offset 0x1dc0 0x1dc0: 0x0400, 0x1dc1: 0x0400, 0x1dc2: 0x0400, 0x1dc3: 0x0400, 0x1dc4: 0x0400, 0x1dc5: 0x0400, 0x1dc6: 0x0400, 0x1dc7: 0x0400, 0x1dc8: 0x0400, 0x1dc9: 0x0400, 0x1dca: 0x0400, 0x1dcb: 0x0400, 0x1dcc: 0x0400, 0x1dcd: 0x0400, 0x1dce: 0x0400, 0x1dcf: 0x0400, 0x1dd0: 0x0200, 0x1dd1: 0x0400, 0x1dd2: 0x0400, 0x1dd3: 0x0400, 0x1dd4: 0x0400, 0x1dd5: 0x0400, 0x1dd6: 0x0400, 0x1dd7: 0x0400, 0x1dd8: 0x0400, 0x1dd9: 0x0400, 0x1dda: 0x0400, 0x1ddb: 0x0400, 0x1ddc: 0x0400, 0x1ddd: 0x0400, 0x1dde: 0x0400, 0x1ddf: 0x0400, 0x1de0: 0x0400, 0x1de1: 0x0400, 0x1de2: 0x0400, 0x1de3: 0x0400, 0x1de4: 0x0400, 0x1de5: 0x0400, 0x1de6: 0x0400, 0x1de7: 0x0400, 0x1de8: 0x0400, 0x1de9: 0x0400, 0x1dea: 0x0400, 0x1deb: 0x0400, 0x1dec: 0x0200, 0x1ded: 0x0400, 0x1dee: 0x0400, 0x1def: 0x0400, 0x1df0: 0x0400, 0x1df1: 0x0400, 0x1df2: 0x0400, 0x1df3: 0x0400, 0x1df4: 0x0400, 0x1df5: 0x0400, 0x1df6: 0x0400, 0x1df7: 0x0400, 0x1df8: 0x0400, 0x1df9: 0x0400, 0x1dfa: 0x0400, 0x1dfb: 0x0400, 0x1dfc: 0x0400, 0x1dfd: 0x0400, 0x1dfe: 0x0400, 0x1dff: 0x0400, // Block 0x78, offset 0x1e00 0x1e00: 0x0400, 0x1e01: 0x0400, 0x1e02: 0x0400, 0x1e03: 0x0400, 0x1e04: 0x0400, 0x1e05: 0x0400, 0x1e06: 0x0400, 0x1e07: 0x0400, 0x1e08: 0x0200, 0x1e09: 0x0400, 0x1e0a: 0x0400, 0x1e0b: 0x0400, 0x1e0c: 0x0400, 0x1e0d: 0x0400, 0x1e0e: 0x0400, 0x1e0f: 0x0400, 0x1e10: 0x0400, 0x1e11: 0x0400, 0x1e12: 0x0400, 0x1e13: 0x0400, 0x1e14: 0x0400, 0x1e15: 0x0400, 0x1e16: 0x0400, 0x1e17: 0x0400, 0x1e18: 0x0400, 0x1e19: 0x0400, 0x1e1a: 0x0400, 0x1e1b: 0x0400, 0x1e1c: 0x0400, 0x1e1d: 0x0400, 0x1e1e: 0x0400, 0x1e1f: 0x0400, 0x1e20: 0x0400, 0x1e21: 0x0400, 0x1e22: 0x0400, 0x1e23: 0x0400, 0x1e24: 0x0200, 0x1e25: 0x0400, 0x1e26: 0x0400, 0x1e27: 0x0400, 0x1e28: 0x0400, 0x1e29: 0x0400, 0x1e2a: 0x0400, 0x1e2b: 0x0400, 0x1e2c: 0x0400, 0x1e2d: 0x0400, 0x1e2e: 0x0400, 0x1e2f: 0x0400, 0x1e30: 0x0400, 0x1e31: 0x0400, 0x1e32: 0x0400, 0x1e33: 0x0400, 0x1e34: 0x0400, 0x1e35: 0x0400, 0x1e36: 0x0400, 0x1e37: 0x0400, 0x1e38: 0x0400, 0x1e39: 0x0400, 0x1e3a: 0x0400, 0x1e3b: 0x0400, 0x1e3c: 0x0400, 0x1e3d: 0x0400, 0x1e3e: 0x0400, 0x1e3f: 0x0400, // Block 0x79, offset 0x1e40 0x1e40: 0x0400, 0x1e41: 0x0400, 0x1e42: 0x0400, 0x1e43: 0x0400, 0x1e44: 0x0400, 0x1e45: 0x0400, 0x1e46: 0x0400, 0x1e47: 0x0400, 0x1e48: 0x0200, 0x1e49: 0x0400, 0x1e4a: 0x0400, 0x1e4b: 0x0400, 0x1e4c: 0x0400, 0x1e4d: 0x0400, 0x1e4e: 0x0400, 0x1e4f: 0x0400, 0x1e50: 0x0400, 0x1e51: 0x0400, 0x1e52: 0x0400, 0x1e53: 0x0400, 0x1e54: 0x0400, 0x1e55: 0x0400, 0x1e56: 0x0400, 0x1e57: 0x0400, 0x1e58: 0x0400, 0x1e59: 0x0400, 0x1e5a: 0x0400, 0x1e5b: 0x0400, 0x1e5c: 0x0400, 0x1e5d: 0x0400, 0x1e5e: 0x0400, 0x1e5f: 0x0400, 0x1e60: 0x0400, 0x1e61: 0x0400, 0x1e62: 0x0400, 0x1e63: 0x0400, 0x1e70: 0x8000, 0x1e71: 0x8000, 0x1e72: 0x8000, 0x1e73: 0x8000, 0x1e74: 0x8000, 0x1e75: 0x8000, 0x1e76: 0x8000, 0x1e77: 0x8000, 0x1e78: 0x8000, 0x1e79: 0x8000, 0x1e7a: 0x8000, 0x1e7b: 0x8000, 0x1e7c: 0x8000, 0x1e7d: 0x8000, 0x1e7e: 0x8000, 0x1e7f: 0x8000, // Block 0x7a, offset 0x1e80 0x1e80: 0x8000, 0x1e81: 0x8000, 0x1e82: 0x8000, 0x1e83: 0x8000, 0x1e84: 0x8000, 0x1e85: 0x8000, 0x1e86: 0x8000, 0x1e8b: 0x4000, 0x1e8c: 0x4000, 0x1e8d: 0x4000, 0x1e8e: 0x4000, 0x1e8f: 0x4000, 0x1e90: 0x4000, 0x1e91: 0x4000, 0x1e92: 0x4000, 0x1e93: 0x4000, 0x1e94: 0x4000, 0x1e95: 0x4000, 0x1e96: 0x4000, 0x1e97: 0x4000, 0x1e98: 0x4000, 0x1e99: 0x4000, 0x1e9a: 0x4000, 0x1e9b: 0x4000, 0x1e9c: 0x4000, 0x1e9d: 0x4000, 0x1e9e: 0x4000, 0x1e9f: 0x4000, 0x1ea0: 0x4000, 0x1ea1: 0x4000, 0x1ea2: 0x4000, 0x1ea3: 0x4000, 0x1ea4: 0x4000, 0x1ea5: 0x4000, 0x1ea6: 0x4000, 0x1ea7: 0x4000, 0x1ea8: 0x4000, 0x1ea9: 0x4000, 0x1eaa: 0x4000, 0x1eab: 0x4000, 0x1eac: 0x4000, 0x1ead: 0x4000, 0x1eae: 0x4000, 0x1eaf: 0x4000, 0x1eb0: 0x4000, 0x1eb1: 0x4000, 0x1eb2: 0x4000, 0x1eb3: 0x4000, 0x1eb4: 0x4000, 0x1eb5: 0x4000, 0x1eb6: 0x4000, 0x1eb7: 0x4000, 0x1eb8: 0x4000, 0x1eb9: 0x4000, 0x1eba: 0x4000, 0x1ebb: 0x4000, // Block 0x7b, offset 0x1ec0 0x1ede: 0x0024, // Block 0x7c, offset 0x1f00 0x1f00: 0x0024, 0x1f01: 0x0024, 0x1f02: 0x0024, 0x1f03: 0x0024, 0x1f04: 0x0024, 0x1f05: 0x0024, 0x1f06: 0x0024, 0x1f07: 0x0024, 0x1f08: 0x0024, 0x1f09: 0x0024, 0x1f0a: 0x0024, 0x1f0b: 0x0024, 0x1f0c: 0x0024, 0x1f0d: 0x0024, 0x1f0e: 0x0024, 0x1f0f: 0x0024, 0x1f20: 0x0024, 0x1f21: 0x0024, 0x1f22: 0x0024, 0x1f23: 0x0024, 0x1f24: 0x0024, 0x1f25: 0x0024, 0x1f26: 0x0024, 0x1f27: 0x0024, 0x1f28: 0x0024, 0x1f29: 0x0024, 0x1f2a: 0x0024, 0x1f2b: 0x0024, 0x1f2c: 0x0024, 0x1f2d: 0x0024, 0x1f2e: 0x0024, 0x1f2f: 0x0024, // Block 0x7d, offset 0x1f40 0x1f7f: 0x0002, // Block 0x7e, offset 0x1f80 0x1fb0: 0x0002, 0x1fb1: 0x0002, 0x1fb2: 0x0002, 0x1fb3: 0x0002, 0x1fb4: 0x0002, 0x1fb5: 0x0002, 0x1fb6: 0x0002, 0x1fb7: 0x0002, 0x1fb8: 0x0002, 0x1fb9: 0x0002, 0x1fba: 0x0002, 0x1fbb: 0x0002, // Block 0x7f, offset 0x1fc0 0x1ffd: 0x0024, // Block 0x80, offset 0x2000 0x2020: 0x0024, // Block 0x81, offset 0x2040 0x2076: 0x0024, 0x2077: 0x0024, 0x2078: 0x0024, 0x2079: 0x0024, 0x207a: 0x0024, // Block 0x82, offset 0x2080 0x2080: 0x0010, 0x2081: 0x0024, 0x2082: 0x0024, 0x2083: 0x0024, 0x2085: 0x0024, 0x2086: 0x0024, 0x208c: 0x0024, 0x208d: 0x0024, 0x208e: 0x0024, 0x208f: 0x0024, 0x2090: 0x0010, 0x2091: 0x0010, 0x2092: 0x0010, 0x2093: 0x0010, 0x2095: 0x0010, 0x2096: 0x0010, 0x2097: 0x0010, 0x2099: 0x0010, 0x209a: 0x0010, 0x209b: 0x0010, 0x209c: 0x0010, 0x209d: 0x0010, 0x209e: 0x0010, 0x209f: 0x0010, 0x20a0: 0x0010, 0x20a1: 0x0010, 0x20a2: 0x0010, 0x20a3: 0x0010, 0x20a4: 0x0010, 0x20a5: 0x0010, 0x20a6: 0x0010, 0x20a7: 0x0010, 0x20a8: 0x0010, 0x20a9: 0x0010, 0x20aa: 0x0010, 0x20ab: 0x0010, 0x20ac: 0x0010, 0x20ad: 0x0010, 0x20ae: 0x0010, 0x20af: 0x0010, 0x20b0: 0x0010, 0x20b1: 0x0010, 0x20b2: 0x0010, 0x20b3: 0x0010, 0x20b4: 0x0010, 0x20b5: 0x0010, 0x20b8: 0x0024, 0x20b9: 0x0024, 0x20ba: 0x0024, 0x20bf: 0x0044, // Block 0x83, offset 0x20c0 0x20e5: 0x0024, 0x20e6: 0x0024, // Block 0x84, offset 0x2100 0x2124: 0x0024, 0x2125: 0x0024, 0x2126: 0x0024, 0x2127: 0x0024, // Block 0x85, offset 0x2140 0x2169: 0x0024, 0x216a: 0x0024, 0x216b: 0x0024, 0x216c: 0x0024, 0x216d: 0x0024, // Block 0x86, offset 0x2180 0x21ab: 0x0024, 0x21ac: 0x0024, // Block 0x87, offset 0x21c0 0x21fa: 0x0024, 0x21fb: 0x0024, 0x21fc: 0x0024, 0x21fd: 0x0024, 0x21fe: 0x0024, 0x21ff: 0x0024, // Block 0x88, offset 0x2200 0x2206: 0x0024, 0x2207: 0x0024, 0x2208: 0x0024, 0x2209: 0x0024, 0x220a: 0x0024, 0x220b: 0x0024, 0x220c: 0x0024, 0x220d: 0x0024, 0x220e: 0x0024, 0x220f: 0x0024, 0x2210: 0x0024, // Block 0x89, offset 0x2240 0x2242: 0x0024, 0x2243: 0x0024, 0x2244: 0x0024, 0x2245: 0x0024, // Block 0x8a, offset 0x2280 0x2280: 0x2000, 0x2281: 0x0024, 0x2282: 0x2000, 0x22b8: 0x0024, 0x22b9: 0x0024, 0x22ba: 0x0024, 0x22bb: 0x0024, 0x22bc: 0x0024, 0x22bd: 0x0024, 0x22be: 0x0024, 0x22bf: 0x0024, // Block 0x8b, offset 0x22c0 0x22c0: 0x0024, 0x22c1: 0x0024, 0x22c2: 0x0024, 0x22c3: 0x0024, 0x22c4: 0x0024, 0x22c5: 0x0024, 0x22c6: 0x0024, 0x22f0: 0x0024, 0x22f3: 0x0024, 0x22f4: 0x0024, 0x22ff: 0x0024, // Block 0x8c, offset 0x2300 0x2300: 0x0024, 0x2301: 0x0024, 0x2302: 0x2000, 0x2330: 0x2000, 0x2331: 0x2000, 0x2332: 0x2000, 0x2333: 0x0024, 0x2334: 0x0024, 0x2335: 0x0024, 0x2336: 0x0024, 0x2337: 0x2000, 0x2338: 0x2000, 0x2339: 0x0024, 0x233a: 0x0024, 0x233d: 0x0800, // Block 0x8d, offset 0x2340 0x2342: 0x0024, 0x234d: 0x0800, // Block 0x8e, offset 0x2380 0x2380: 0x0024, 0x2381: 0x0024, 0x2382: 0x0024, 0x2383: 0x0010, 0x2384: 0x0010, 0x2385: 0x0010, 0x2386: 0x0010, 0x2387: 0x0010, 0x2388: 0x0010, 0x2389: 0x0010, 0x238a: 0x0010, 0x238b: 0x0010, 0x238c: 0x0010, 0x238d: 0x0010, 0x238e: 0x0010, 0x238f: 0x0010, 0x2390: 0x0010, 0x2391: 0x0010, 0x2392: 0x0010, 0x2393: 0x0010, 0x2394: 0x0010, 0x2395: 0x0010, 0x2396: 0x0010, 0x2397: 0x0010, 0x2398: 0x0010, 0x2399: 0x0010, 0x239a: 0x0010, 0x239b: 0x0010, 0x239c: 0x0010, 0x239d: 0x0010, 0x239e: 0x0010, 0x239f: 0x0010, 0x23a0: 0x0010, 0x23a1: 0x0010, 0x23a2: 0x0010, 0x23a3: 0x0010, 0x23a4: 0x0010, 0x23a5: 0x0010, 0x23a6: 0x0010, 0x23a7: 0x0024, 0x23a8: 0x0024, 0x23a9: 0x0024, 0x23aa: 0x0024, 0x23ab: 0x0024, 0x23ac: 0x2000, 0x23ad: 0x0024, 0x23ae: 0x0024, 0x23af: 0x0024, 0x23b0: 0x0024, 0x23b1: 0x0024, 0x23b2: 0x0024, 0x23b3: 0x0044, 0x23b4: 0x0024, // Block 0x8f, offset 0x23c0 0x23c4: 0x0010, 0x23c5: 0x2000, 0x23c6: 0x2000, 0x23c7: 0x0010, 0x23f3: 0x0024, // Block 0x90, offset 0x2400 0x2400: 0x0024, 0x2401: 0x0024, 0x2402: 0x2000, 0x2433: 0x2000, 0x2434: 0x2000, 0x2435: 0x2000, 0x2436: 0x0024, 0x2437: 0x0024, 0x2438: 0x0024, 0x2439: 0x0024, 0x243a: 0x0024, 0x243b: 0x0024, 0x243c: 0x0024, 0x243d: 0x0024, 0x243e: 0x0024, 0x243f: 0x2000, // Block 0x91, offset 0x2440 0x2440: 0x0024, 0x2442: 0x0800, 0x2443: 0x0800, 0x2449: 0x0024, 0x244a: 0x0024, 0x244b: 0x0024, 0x244c: 0x0024, 0x244e: 0x2000, 0x244f: 0x0024, // Block 0x92, offset 0x2480 0x24ac: 0x2000, 0x24ad: 0x2000, 0x24ae: 0x2000, 0x24af: 0x0024, 0x24b0: 0x0024, 0x24b1: 0x0024, 0x24b2: 0x2000, 0x24b3: 0x2000, 0x24b4: 0x0024, 0x24b5: 0x0024, 0x24b6: 0x0024, 0x24b7: 0x0024, 0x24be: 0x0024, // Block 0x93, offset 0x24c0 0x24c1: 0x0024, // Block 0x94, offset 0x2500 0x251f: 0x0024, 0x2520: 0x2000, 0x2521: 0x2000, 0x2522: 0x2000, 0x2523: 0x0024, 0x2524: 0x0024, 0x2525: 0x0024, 0x2526: 0x0024, 0x2527: 0x0024, 0x2528: 0x0024, 0x2529: 0x0024, 0x252a: 0x0024, // Block 0x95, offset 0x2540 0x2540: 0x0024, 0x2541: 0x0024, 0x2542: 0x2000, 0x2543: 0x2000, 0x257b: 0x0024, 0x257c: 0x0024, 0x257e: 0x0024, 0x257f: 0x2000, // Block 0x96, offset 0x2580 0x2580: 0x0024, 0x2581: 0x2000, 0x2582: 0x2000, 0x2583: 0x2000, 0x2584: 0x2000, 0x2587: 0x2000, 0x2588: 0x2000, 0x258b: 0x2000, 0x258c: 0x2000, 0x258d: 0x0024, 0x2597: 0x0024, 0x25a2: 0x2000, 0x25a3: 0x2000, 0x25a6: 0x0024, 0x25a7: 0x0024, 0x25a8: 0x0024, 0x25a9: 0x0024, 0x25aa: 0x0024, 0x25ab: 0x0024, 0x25ac: 0x0024, 0x25b0: 0x0024, 0x25b1: 0x0024, 0x25b2: 0x0024, 0x25b3: 0x0024, 0x25b4: 0x0024, // Block 0x97, offset 0x25c0 0x25c0: 0x0010, 0x25c1: 0x0010, 0x25c2: 0x0010, 0x25c3: 0x0010, 0x25c4: 0x0010, 0x25c5: 0x0010, 0x25c6: 0x0010, 0x25c7: 0x0010, 0x25c8: 0x0010, 0x25c9: 0x0010, 0x25cb: 0x0010, 0x25ce: 0x0010, 0x25d0: 0x0010, 0x25d1: 0x0010, 0x25d2: 0x0010, 0x25d3: 0x0010, 0x25d4: 0x0010, 0x25d5: 0x0010, 0x25d6: 0x0010, 0x25d7: 0x0010, 0x25d8: 0x0010, 0x25d9: 0x0010, 0x25da: 0x0010, 0x25db: 0x0010, 0x25dc: 0x0010, 0x25dd: 0x0010, 0x25de: 0x0010, 0x25df: 0x0010, 0x25e0: 0x0010, 0x25e1: 0x0010, 0x25e2: 0x0010, 0x25e3: 0x0010, 0x25e4: 0x0010, 0x25e5: 0x0010, 0x25e6: 0x0010, 0x25e7: 0x0010, 0x25e8: 0x0010, 0x25e9: 0x0010, 0x25ea: 0x0010, 0x25eb: 0x0010, 0x25ec: 0x0010, 0x25ed: 0x0010, 0x25ee: 0x0010, 0x25ef: 0x0010, 0x25f0: 0x0010, 0x25f1: 0x0010, 0x25f2: 0x0010, 0x25f3: 0x0010, 0x25f4: 0x0010, 0x25f5: 0x0010, 0x25f8: 0x0024, 0x25f9: 0x2000, 0x25fa: 0x2000, 0x25fb: 0x0024, 0x25fc: 0x0024, 0x25fd: 0x0024, 0x25fe: 0x0024, 0x25ff: 0x0024, // Block 0x98, offset 0x2600 0x2600: 0x0024, 0x2602: 0x0024, 0x2605: 0x0024, 0x2607: 0x0024, 0x2608: 0x0024, 0x2609: 0x0024, 0x260a: 0x2000, 0x260c: 0x2000, 0x260d: 0x2000, 0x260e: 0x0024, 0x260f: 0x0024, 0x2610: 0x0044, 0x2611: 0x0800, 0x2612: 0x0024, 0x2621: 0x0024, 0x2622: 0x0024, // Block 0x99, offset 0x2640 0x2675: 0x2000, 0x2676: 0x2000, 0x2677: 0x2000, 0x2678: 0x0024, 0x2679: 0x0024, 0x267a: 0x0024, 0x267b: 0x0024, 0x267c: 0x0024, 0x267d: 0x0024, 0x267e: 0x0024, 0x267f: 0x0024, // Block 0x9a, offset 0x2680 0x2680: 0x2000, 0x2681: 0x2000, 0x2682: 0x0024, 0x2683: 0x0024, 0x2684: 0x0024, 0x2685: 0x2000, 0x2686: 0x0024, 0x269e: 0x0024, // Block 0x9b, offset 0x26c0 0x26f0: 0x0024, 0x26f1: 0x2000, 0x26f2: 0x2000, 0x26f3: 0x0024, 0x26f4: 0x0024, 0x26f5: 0x0024, 0x26f6: 0x0024, 0x26f7: 0x0024, 0x26f8: 0x0024, 0x26f9: 0x2000, 0x26fa: 0x0024, 0x26fb: 0x2000, 0x26fc: 0x2000, 0x26fd: 0x0024, 0x26fe: 0x2000, 0x26ff: 0x0024, // Block 0x9c, offset 0x2700 0x2700: 0x0024, 0x2701: 0x2000, 0x2702: 0x0024, 0x2703: 0x0024, // Block 0x9d, offset 0x2740 0x276f: 0x0024, 0x2770: 0x2000, 0x2771: 0x2000, 0x2772: 0x0024, 0x2773: 0x0024, 0x2774: 0x0024, 0x2775: 0x0024, 0x2778: 0x2000, 0x2779: 0x2000, 0x277a: 0x2000, 0x277b: 0x2000, 0x277c: 0x0024, 0x277d: 0x0024, 0x277e: 0x2000, 0x277f: 0x0024, // Block 0x9e, offset 0x2780 0x2780: 0x0024, 0x279c: 0x0024, 0x279d: 0x0024, // Block 0x9f, offset 0x27c0 0x27f0: 0x2000, 0x27f1: 0x2000, 0x27f2: 0x2000, 0x27f3: 0x0024, 0x27f4: 0x0024, 0x27f5: 0x0024, 0x27f6: 0x0024, 0x27f7: 0x0024, 0x27f8: 0x0024, 0x27f9: 0x0024, 0x27fa: 0x0024, 0x27fb: 0x2000, 0x27fc: 0x2000, 0x27fd: 0x0024, 0x27fe: 0x2000, 0x27ff: 0x0024, // Block 0xa0, offset 0x2800 0x2800: 0x0024, // Block 0xa1, offset 0x2840 0x286b: 0x0024, 0x286c: 0x2000, 0x286d: 0x0024, 0x286e: 0x2000, 0x286f: 0x2000, 0x2870: 0x0024, 0x2871: 0x0024, 0x2872: 0x0024, 0x2873: 0x0024, 0x2874: 0x0024, 0x2875: 0x0024, 0x2876: 0x0024, 0x2877: 0x0024, // Block 0xa2, offset 0x2880 0x289d: 0x0024, 0x289e: 0x2000, 0x289f: 0x0024, 0x28a2: 0x0024, 0x28a3: 0x0024, 0x28a4: 0x0024, 0x28a5: 0x0024, 0x28a6: 0x2000, 0x28a7: 0x0024, 0x28a8: 0x0024, 0x28a9: 0x0024, 0x28aa: 0x0024, 0x28ab: 0x0024, // Block 0xa3, offset 0x28c0 0x28ec: 0x2000, 0x28ed: 0x2000, 0x28ee: 0x2000, 0x28ef: 0x0024, 0x28f0: 0x0024, 0x28f1: 0x0024, 0x28f2: 0x0024, 0x28f3: 0x0024, 0x28f4: 0x0024, 0x28f5: 0x0024, 0x28f6: 0x0024, 0x28f7: 0x0024, 0x28f8: 0x2000, 0x28f9: 0x0024, 0x28fa: 0x0024, // Block 0xa4, offset 0x2900 0x2900: 0x0010, 0x2901: 0x0010, 0x2902: 0x0010, 0x2903: 0x0010, 0x2904: 0x0010, 0x2905: 0x0010, 0x2906: 0x0010, 0x2909: 0x0010, 0x290c: 0x0010, 0x290d: 0x0010, 0x290e: 0x0010, 0x290f: 0x0010, 0x2910: 0x0010, 0x2911: 0x0010, 0x2912: 0x0010, 0x2913: 0x0010, 0x2915: 0x0010, 0x2916: 0x0010, 0x2918: 0x0010, 0x2919: 0x0010, 0x291a: 0x0010, 0x291b: 0x0010, 0x291c: 0x0010, 0x291d: 0x0010, 0x291e: 0x0010, 0x291f: 0x0010, 0x2920: 0x0010, 0x2921: 0x0010, 0x2922: 0x0010, 0x2923: 0x0010, 0x2924: 0x0010, 0x2925: 0x0010, 0x2926: 0x0010, 0x2927: 0x0010, 0x2928: 0x0010, 0x2929: 0x0010, 0x292a: 0x0010, 0x292b: 0x0010, 0x292c: 0x0010, 0x292d: 0x0010, 0x292e: 0x0010, 0x292f: 0x0010, 0x2930: 0x0024, 0x2931: 0x2000, 0x2932: 0x2000, 0x2933: 0x2000, 0x2934: 0x2000, 0x2935: 0x2000, 0x2937: 0x2000, 0x2938: 0x2000, 0x293b: 0x0024, 0x293c: 0x0024, 0x293d: 0x0024, 0x293e: 0x0044, 0x293f: 0x0800, // Block 0xa5, offset 0x2940 0x2940: 0x2000, 0x2941: 0x0800, 0x2942: 0x2000, 0x2943: 0x0024, // Block 0xa6, offset 0x2980 0x2991: 0x2000, 0x2992: 0x2000, 0x2993: 0x2000, 0x2994: 0x0024, 0x2995: 0x0024, 0x2996: 0x0024, 0x2997: 0x0024, 0x299a: 0x0024, 0x299b: 0x0024, 0x299c: 0x2000, 0x299d: 0x2000, 0x299e: 0x2000, 0x299f: 0x2000, 0x29a0: 0x0024, 0x29a4: 0x2000, // Block 0xa7, offset 0x29c0 0x29c0: 0x0010, 0x29c1: 0x0024, 0x29c2: 0x0024, 0x29c3: 0x0024, 0x29c4: 0x0024, 0x29c5: 0x0024, 0x29c6: 0x0024, 0x29c7: 0x0024, 0x29c8: 0x0024, 0x29c9: 0x0024, 0x29ca: 0x0024, 0x29cb: 0x0010, 0x29cc: 0x0010, 0x29cd: 0x0010, 0x29ce: 0x0010, 0x29cf: 0x0010, 0x29d0: 0x0010, 0x29d1: 0x0010, 0x29d2: 0x0010, 0x29d3: 0x0010, 0x29d4: 0x0010, 0x29d5: 0x0010, 0x29d6: 0x0010, 0x29d7: 0x0010, 0x29d8: 0x0010, 0x29d9: 0x0010, 0x29da: 0x0010, 0x29db: 0x0010, 0x29dc: 0x0010, 0x29dd: 0x0010, 0x29de: 0x0010, 0x29df: 0x0010, 0x29e0: 0x0010, 0x29e1: 0x0010, 0x29e2: 0x0010, 0x29e3: 0x0010, 0x29e4: 0x0010, 0x29e5: 0x0010, 0x29e6: 0x0010, 0x29e7: 0x0010, 0x29e8: 0x0010, 0x29e9: 0x0010, 0x29ea: 0x0010, 0x29eb: 0x0010, 0x29ec: 0x0010, 0x29ed: 0x0010, 0x29ee: 0x0010, 0x29ef: 0x0010, 0x29f0: 0x0010, 0x29f1: 0x0010, 0x29f2: 0x0010, 0x29f3: 0x0024, 0x29f4: 0x0024, 0x29f5: 0x0024, 0x29f6: 0x0024, 0x29f7: 0x0024, 0x29f8: 0x0024, 0x29f9: 0x2000, 0x29fb: 0x0024, 0x29fc: 0x0024, 0x29fd: 0x0024, 0x29fe: 0x0024, // Block 0xa8, offset 0x2a00 0x2a07: 0x0044, 0x2a10: 0x0010, 0x2a11: 0x0024, 0x2a12: 0x0024, 0x2a13: 0x0024, 0x2a14: 0x0024, 0x2a15: 0x0024, 0x2a16: 0x0024, 0x2a17: 0x2000, 0x2a18: 0x2000, 0x2a19: 0x0024, 0x2a1a: 0x0024, 0x2a1b: 0x0024, 0x2a1c: 0x0010, 0x2a1d: 0x0010, 0x2a1e: 0x0010, 0x2a1f: 0x0010, 0x2a20: 0x0010, 0x2a21: 0x0010, 0x2a22: 0x0010, 0x2a23: 0x0010, 0x2a24: 0x0010, 0x2a25: 0x0010, 0x2a26: 0x0010, 0x2a27: 0x0010, 0x2a28: 0x0010, 0x2a29: 0x0010, 0x2a2a: 0x0010, 0x2a2b: 0x0010, 0x2a2c: 0x0010, 0x2a2d: 0x0010, 0x2a2e: 0x0010, 0x2a2f: 0x0010, 0x2a30: 0x0010, 0x2a31: 0x0010, 0x2a32: 0x0010, 0x2a33: 0x0010, 0x2a34: 0x0010, 0x2a35: 0x0010, 0x2a36: 0x0010, 0x2a37: 0x0010, 0x2a38: 0x0010, 0x2a39: 0x0010, 0x2a3a: 0x0010, 0x2a3b: 0x0010, 0x2a3c: 0x0010, 0x2a3d: 0x0010, 0x2a3e: 0x0010, 0x2a3f: 0x0010, // Block 0xa9, offset 0x2a40 0x2a40: 0x0010, 0x2a41: 0x0010, 0x2a42: 0x0010, 0x2a43: 0x0010, 0x2a44: 0x0800, 0x2a45: 0x0800, 0x2a46: 0x0800, 0x2a47: 0x0800, 0x2a48: 0x0800, 0x2a49: 0x0800, 0x2a4a: 0x0024, 0x2a4b: 0x0024, 0x2a4c: 0x0024, 0x2a4d: 0x0024, 0x2a4e: 0x0024, 0x2a4f: 0x0024, 0x2a50: 0x0024, 0x2a51: 0x0024, 0x2a52: 0x0024, 0x2a53: 0x0024, 0x2a54: 0x0024, 0x2a55: 0x0024, 0x2a56: 0x0024, 0x2a57: 0x2000, 0x2a58: 0x0024, 0x2a59: 0x0044, // Block 0xaa, offset 0x2a80 0x2aa0: 0x0024, 0x2aa1: 0x2000, 0x2aa2: 0x0024, 0x2aa3: 0x0024, 0x2aa4: 0x0024, 0x2aa5: 0x2000, 0x2aa6: 0x0024, 0x2aa7: 0x2000, // Block 0xab, offset 0x2ac0 0x2aef: 0x2000, 0x2af0: 0x0024, 0x2af1: 0x0024, 0x2af2: 0x0024, 0x2af3: 0x0024, 0x2af4: 0x0024, 0x2af5: 0x0024, 0x2af6: 0x0024, 0x2af8: 0x0024, 0x2af9: 0x0024, 0x2afa: 0x0024, 0x2afb: 0x0024, 0x2afc: 0x0024, 0x2afd: 0x0024, 0x2afe: 0x2000, 0x2aff: 0x0024, // Block 0xac, offset 0x2b00 0x2b12: 0x0024, 0x2b13: 0x0024, 0x2b14: 0x0024, 0x2b15: 0x0024, 0x2b16: 0x0024, 0x2b17: 0x0024, 0x2b18: 0x0024, 0x2b19: 0x0024, 0x2b1a: 0x0024, 0x2b1b: 0x0024, 0x2b1c: 0x0024, 0x2b1d: 0x0024, 0x2b1e: 0x0024, 0x2b1f: 0x0024, 0x2b20: 0x0024, 0x2b21: 0x0024, 0x2b22: 0x0024, 0x2b23: 0x0024, 0x2b24: 0x0024, 0x2b25: 0x0024, 0x2b26: 0x0024, 0x2b27: 0x0024, 0x2b29: 0x2000, 0x2b2a: 0x0024, 0x2b2b: 0x0024, 0x2b2c: 0x0024, 0x2b2d: 0x0024, 0x2b2e: 0x0024, 0x2b2f: 0x0024, 0x2b30: 0x0024, 0x2b31: 0x2000, 0x2b32: 0x0024, 0x2b33: 0x0024, 0x2b34: 0x2000, 0x2b35: 0x0024, 0x2b36: 0x0024, // Block 0xad, offset 0x2b40 0x2b71: 0x0024, 0x2b72: 0x0024, 0x2b73: 0x0024, 0x2b74: 0x0024, 0x2b75: 0x0024, 0x2b76: 0x0024, 0x2b7a: 0x0024, 0x2b7c: 0x0024, 0x2b7d: 0x0024, 0x2b7f: 0x0024, // Block 0xae, offset 0x2b80 0x2b80: 0x0024, 0x2b81: 0x0024, 0x2b82: 0x0024, 0x2b83: 0x0024, 0x2b84: 0x0024, 0x2b85: 0x0024, 0x2b86: 0x0800, 0x2b87: 0x0024, // Block 0xaf, offset 0x2bc0 0x2bca: 0x2000, 0x2bcb: 0x2000, 0x2bcc: 0x2000, 0x2bcd: 0x2000, 0x2bce: 0x2000, 0x2bd0: 0x0024, 0x2bd1: 0x0024, 0x2bd3: 0x2000, 0x2bd4: 0x2000, 0x2bd5: 0x0024, 0x2bd6: 0x2000, 0x2bd7: 0x0024, // Block 0xb0, offset 0x2c00 0x2c33: 0x0024, 0x2c34: 0x0024, 0x2c35: 0x2000, 0x2c36: 0x2000, // Block 0xb1, offset 0x2c40 0x2c40: 0x0024, 0x2c41: 0x0024, 0x2c42: 0x0800, 0x2c43: 0x2000, 0x2c44: 0x0010, 0x2c45: 0x0010, 0x2c46: 0x0010, 0x2c47: 0x0010, 0x2c48: 0x0010, 0x2c49: 0x0010, 0x2c4a: 0x0010, 0x2c4b: 0x0010, 0x2c4c: 0x0010, 0x2c4d: 0x0010, 0x2c4e: 0x0010, 0x2c4f: 0x0010, 0x2c50: 0x0010, 0x2c52: 0x0010, 0x2c53: 0x0010, 0x2c54: 0x0010, 0x2c55: 0x0010, 0x2c56: 0x0010, 0x2c57: 0x0010, 0x2c58: 0x0010, 0x2c59: 0x0010, 0x2c5a: 0x0010, 0x2c5b: 0x0010, 0x2c5c: 0x0010, 0x2c5d: 0x0010, 0x2c5e: 0x0010, 0x2c5f: 0x0010, 0x2c60: 0x0010, 0x2c61: 0x0010, 0x2c62: 0x0010, 0x2c63: 0x0010, 0x2c64: 0x0010, 0x2c65: 0x0010, 0x2c66: 0x0010, 0x2c67: 0x0010, 0x2c68: 0x0010, 0x2c69: 0x0010, 0x2c6a: 0x0010, 0x2c6b: 0x0010, 0x2c6c: 0x0010, 0x2c6d: 0x0010, 0x2c6e: 0x0010, 0x2c6f: 0x0010, 0x2c70: 0x0010, 0x2c71: 0x0010, 0x2c72: 0x0010, 0x2c73: 0x0010, 0x2c74: 0x2000, 0x2c75: 0x2000, 0x2c76: 0x0024, 0x2c77: 0x0024, 0x2c78: 0x0024, 0x2c79: 0x0024, 0x2c7a: 0x0024, 0x2c7e: 0x2000, 0x2c7f: 0x2000, // Block 0xb2, offset 0x2c80 0x2c80: 0x0024, 0x2c81: 0x0024, 0x2c82: 0x0044, 0x2c9a: 0x0024, // Block 0xb3, offset 0x2cc0 0x2cf0: 0x0002, 0x2cf1: 0x0002, 0x2cf2: 0x0002, 0x2cf3: 0x0002, 0x2cf4: 0x0002, 0x2cf5: 0x0002, 0x2cf6: 0x0002, 0x2cf7: 0x0002, 0x2cf8: 0x0002, 0x2cf9: 0x0002, 0x2cfa: 0x0002, 0x2cfb: 0x0002, 0x2cfc: 0x0002, 0x2cfd: 0x0002, 0x2cfe: 0x0002, 0x2cff: 0x0002, // Block 0xb4, offset 0x2d00 0x2d00: 0x0024, 0x2d07: 0x0024, 0x2d08: 0x0024, 0x2d09: 0x0024, 0x2d0a: 0x0024, 0x2d0b: 0x0024, 0x2d0c: 0x0024, 0x2d0d: 0x0024, 0x2d0e: 0x0024, 0x2d0f: 0x0024, 0x2d10: 0x0024, 0x2d11: 0x0024, 0x2d12: 0x0024, 0x2d13: 0x0024, 0x2d14: 0x0024, 0x2d15: 0x0024, // Block 0xb5, offset 0x2d40 0x2d5e: 0x0024, 0x2d5f: 0x0024, 0x2d60: 0x0024, 0x2d61: 0x0024, 0x2d62: 0x0024, 0x2d63: 0x0024, 0x2d64: 0x0024, 0x2d65: 0x0024, 0x2d66: 0x0024, 0x2d67: 0x0024, 0x2d68: 0x0024, 0x2d69: 0x0024, 0x2d6a: 0x2000, 0x2d6b: 0x2000, 0x2d6c: 0x2000, 0x2d6d: 0x0024, 0x2d6e: 0x0024, 0x2d6f: 0x0024, // Block 0xb6, offset 0x2d80 0x2db0: 0x0024, 0x2db1: 0x0024, 0x2db2: 0x0024, 0x2db3: 0x0024, 0x2db4: 0x0024, // Block 0xb7, offset 0x2dc0 0x2df0: 0x0024, 0x2df1: 0x0024, 0x2df2: 0x0024, 0x2df3: 0x0024, 0x2df4: 0x0024, 0x2df5: 0x0024, 0x2df6: 0x0024, // Block 0xb8, offset 0x2e00 0x2e23: 0x8000, 0x2e27: 0x8000, 0x2e28: 0x8000, 0x2e29: 0x8000, 0x2e2a: 0x8000, // Block 0xb9, offset 0x2e40 0x2e4f: 0x0024, 0x2e51: 0x2000, 0x2e52: 0x2000, 0x2e53: 0x2000, 0x2e54: 0x2000, 0x2e55: 0x2000, 0x2e56: 0x2000, 0x2e57: 0x2000, 0x2e58: 0x2000, 0x2e59: 0x2000, 0x2e5a: 0x2000, 0x2e5b: 0x2000, 0x2e5c: 0x2000, 0x2e5d: 0x2000, 0x2e5e: 0x2000, 0x2e5f: 0x2000, 0x2e60: 0x2000, 0x2e61: 0x2000, 0x2e62: 0x2000, 0x2e63: 0x2000, 0x2e64: 0x2000, 0x2e65: 0x2000, 0x2e66: 0x2000, 0x2e67: 0x2000, 0x2e68: 0x2000, 0x2e69: 0x2000, 0x2e6a: 0x2000, 0x2e6b: 0x2000, 0x2e6c: 0x2000, 0x2e6d: 0x2000, 0x2e6e: 0x2000, 0x2e6f: 0x2000, 0x2e70: 0x2000, 0x2e71: 0x2000, 0x2e72: 0x2000, 0x2e73: 0x2000, 0x2e74: 0x2000, 0x2e75: 0x2000, 0x2e76: 0x2000, 0x2e77: 0x2000, 0x2e78: 0x2000, 0x2e79: 0x2000, 0x2e7a: 0x2000, 0x2e7b: 0x2000, 0x2e7c: 0x2000, 0x2e7d: 0x2000, 0x2e7e: 0x2000, 0x2e7f: 0x2000, // Block 0xba, offset 0x2e80 0x2e80: 0x2000, 0x2e81: 0x2000, 0x2e82: 0x2000, 0x2e83: 0x2000, 0x2e84: 0x2000, 0x2e85: 0x2000, 0x2e86: 0x2000, 0x2e87: 0x2000, 0x2e8f: 0x0024, 0x2e90: 0x0024, 0x2e91: 0x0024, 0x2e92: 0x0024, // Block 0xbb, offset 0x2ec0 0x2ee4: 0x0024, 0x2ef0: 0x0024, 0x2ef1: 0x0024, // Block 0xbc, offset 0x2f00 0x2f1d: 0x0024, 0x2f1e: 0x0024, 0x2f20: 0x0002, 0x2f21: 0x0002, 0x2f22: 0x0002, 0x2f23: 0x0002, // Block 0xbd, offset 0x2f40 0x2f40: 0x0024, 0x2f41: 0x0024, 0x2f42: 0x0024, 0x2f43: 0x0024, 0x2f44: 0x0024, 0x2f45: 0x0024, 0x2f46: 0x0024, 0x2f47: 0x0024, 0x2f48: 0x0024, 0x2f49: 0x0024, 0x2f4a: 0x0024, 0x2f4b: 0x0024, 0x2f4c: 0x0024, 0x2f4d: 0x0024, 0x2f4e: 0x0024, 0x2f4f: 0x0024, 0x2f50: 0x0024, 0x2f51: 0x0024, 0x2f52: 0x0024, 0x2f53: 0x0024, 0x2f54: 0x0024, 0x2f55: 0x0024, 0x2f56: 0x0024, 0x2f57: 0x0024, 0x2f58: 0x0024, 0x2f59: 0x0024, 0x2f5a: 0x0024, 0x2f5b: 0x0024, 0x2f5c: 0x0024, 0x2f5d: 0x0024, 0x2f5e: 0x0024, 0x2f5f: 0x0024, 0x2f60: 0x0024, 0x2f61: 0x0024, 0x2f62: 0x0024, 0x2f63: 0x0024, 0x2f64: 0x0024, 0x2f65: 0x0024, 0x2f66: 0x0024, 0x2f67: 0x0024, 0x2f68: 0x0024, 0x2f69: 0x0024, 0x2f6a: 0x0024, 0x2f6b: 0x0024, 0x2f6c: 0x0024, 0x2f6d: 0x0024, 0x2f70: 0x0024, 0x2f71: 0x0024, 0x2f72: 0x0024, 0x2f73: 0x0024, 0x2f74: 0x0024, 0x2f75: 0x0024, 0x2f76: 0x0024, 0x2f77: 0x0024, 0x2f78: 0x0024, 0x2f79: 0x0024, 0x2f7a: 0x0024, 0x2f7b: 0x0024, 0x2f7c: 0x0024, 0x2f7d: 0x0024, 0x2f7e: 0x0024, 0x2f7f: 0x0024, // Block 0xbe, offset 0x2f80 0x2f80: 0x0024, 0x2f81: 0x0024, 0x2f82: 0x0024, 0x2f83: 0x0024, 0x2f84: 0x0024, 0x2f85: 0x0024, 0x2f86: 0x0024, // Block 0xbf, offset 0x2fc0 0x2fe5: 0x0024, 0x2fe6: 0x0024, 0x2fe7: 0x0024, 0x2fe8: 0x0024, 0x2fe9: 0x0024, 0x2fed: 0x0024, 0x2fee: 0x0024, 0x2fef: 0x0024, 0x2ff0: 0x0024, 0x2ff1: 0x0024, 0x2ff2: 0x0024, 0x2ff3: 0x0002, 0x2ff4: 0x0002, 0x2ff5: 0x0002, 0x2ff6: 0x0002, 0x2ff7: 0x0002, 0x2ff8: 0x0002, 0x2ff9: 0x0002, 0x2ffa: 0x0002, 0x2ffb: 0x0024, 0x2ffc: 0x0024, 0x2ffd: 0x0024, 0x2ffe: 0x0024, 0x2fff: 0x0024, // Block 0xc0, offset 0x3000 0x3000: 0x0024, 0x3001: 0x0024, 0x3002: 0x0024, 0x3005: 0x0024, 0x3006: 0x0024, 0x3007: 0x0024, 0x3008: 0x0024, 0x3009: 0x0024, 0x300a: 0x0024, 0x300b: 0x0024, 0x302a: 0x0024, 0x302b: 0x0024, 0x302c: 0x0024, 0x302d: 0x0024, // Block 0xc1, offset 0x3040 0x3042: 0x0024, 0x3043: 0x0024, 0x3044: 0x0024, // Block 0xc2, offset 0x3080 0x3080: 0x0024, 0x3081: 0x0024, 0x3082: 0x0024, 0x3083: 0x0024, 0x3084: 0x0024, 0x3085: 0x0024, 0x3086: 0x0024, 0x3087: 0x0024, 0x3088: 0x0024, 0x3089: 0x0024, 0x308a: 0x0024, 0x308b: 0x0024, 0x308c: 0x0024, 0x308d: 0x0024, 0x308e: 0x0024, 0x308f: 0x0024, 0x3090: 0x0024, 0x3091: 0x0024, 0x3092: 0x0024, 0x3093: 0x0024, 0x3094: 0x0024, 0x3095: 0x0024, 0x3096: 0x0024, 0x3097: 0x0024, 0x3098: 0x0024, 0x3099: 0x0024, 0x309a: 0x0024, 0x309b: 0x0024, 0x309c: 0x0024, 0x309d: 0x0024, 0x309e: 0x0024, 0x309f: 0x0024, 0x30a0: 0x0024, 0x30a1: 0x0024, 0x30a2: 0x0024, 0x30a3: 0x0024, 0x30a4: 0x0024, 0x30a5: 0x0024, 0x30a6: 0x0024, 0x30a7: 0x0024, 0x30a8: 0x0024, 0x30a9: 0x0024, 0x30aa: 0x0024, 0x30ab: 0x0024, 0x30ac: 0x0024, 0x30ad: 0x0024, 0x30ae: 0x0024, 0x30af: 0x0024, 0x30b0: 0x0024, 0x30b1: 0x0024, 0x30b2: 0x0024, 0x30b3: 0x0024, 0x30b4: 0x0024, 0x30b5: 0x0024, 0x30b6: 0x0024, 0x30bb: 0x0024, 0x30bc: 0x0024, 0x30bd: 0x0024, 0x30be: 0x0024, 0x30bf: 0x0024, // Block 0xc3, offset 0x30c0 0x30c0: 0x0024, 0x30c1: 0x0024, 0x30c2: 0x0024, 0x30c3: 0x0024, 0x30c4: 0x0024, 0x30c5: 0x0024, 0x30c6: 0x0024, 0x30c7: 0x0024, 0x30c8: 0x0024, 0x30c9: 0x0024, 0x30ca: 0x0024, 0x30cb: 0x0024, 0x30cc: 0x0024, 0x30cd: 0x0024, 0x30ce: 0x0024, 0x30cf: 0x0024, 0x30d0: 0x0024, 0x30d1: 0x0024, 0x30d2: 0x0024, 0x30d3: 0x0024, 0x30d4: 0x0024, 0x30d5: 0x0024, 0x30d6: 0x0024, 0x30d7: 0x0024, 0x30d8: 0x0024, 0x30d9: 0x0024, 0x30da: 0x0024, 0x30db: 0x0024, 0x30dc: 0x0024, 0x30dd: 0x0024, 0x30de: 0x0024, 0x30df: 0x0024, 0x30e0: 0x0024, 0x30e1: 0x0024, 0x30e2: 0x0024, 0x30e3: 0x0024, 0x30e4: 0x0024, 0x30e5: 0x0024, 0x30e6: 0x0024, 0x30e7: 0x0024, 0x30e8: 0x0024, 0x30e9: 0x0024, 0x30ea: 0x0024, 0x30eb: 0x0024, 0x30ec: 0x0024, 0x30f5: 0x0024, // Block 0xc4, offset 0x3100 0x3104: 0x0024, 0x311b: 0x0024, 0x311c: 0x0024, 0x311d: 0x0024, 0x311e: 0x0024, 0x311f: 0x0024, 0x3121: 0x0024, 0x3122: 0x0024, 0x3123: 0x0024, 0x3124: 0x0024, 0x3125: 0x0024, 0x3126: 0x0024, 0x3127: 0x0024, 0x3128: 0x0024, 0x3129: 0x0024, 0x312a: 0x0024, 0x312b: 0x0024, 0x312c: 0x0024, 0x312d: 0x0024, 0x312e: 0x0024, 0x312f: 0x0024, // Block 0xc5, offset 0x3140 0x3140: 0x0024, 0x3141: 0x0024, 0x3142: 0x0024, 0x3143: 0x0024, 0x3144: 0x0024, 0x3145: 0x0024, 0x3146: 0x0024, 0x3148: 0x0024, 0x3149: 0x0024, 0x314a: 0x0024, 0x314b: 0x0024, 0x314c: 0x0024, 0x314d: 0x0024, 0x314e: 0x0024, 0x314f: 0x0024, 0x3150: 0x0024, 0x3151: 0x0024, 0x3152: 0x0024, 0x3153: 0x0024, 0x3154: 0x0024, 0x3155: 0x0024, 0x3156: 0x0024, 0x3157: 0x0024, 0x3158: 0x0024, 0x315b: 0x0024, 0x315c: 0x0024, 0x315d: 0x0024, 0x315e: 0x0024, 0x315f: 0x0024, 0x3160: 0x0024, 0x3161: 0x0024, 0x3163: 0x0024, 0x3164: 0x0024, 0x3166: 0x0024, 0x3167: 0x0024, 0x3168: 0x0024, 0x3169: 0x0024, 0x316a: 0x0024, // Block 0xc6, offset 0x3180 0x318f: 0x0024, // Block 0xc7, offset 0x31c0 0x31ee: 0x0024, // Block 0xc8, offset 0x3200 0x322c: 0x0024, 0x322d: 0x0024, 0x322e: 0x0024, 0x322f: 0x0024, // Block 0xc9, offset 0x3240 0x326e: 0x0024, 0x326f: 0x0024, // Block 0xca, offset 0x3280 0x32a3: 0x0024, 0x32a6: 0x0024, 0x32ae: 0x0024, 0x32af: 0x0024, 0x32b5: 0x0024, // Block 0xcb, offset 0x32c0 0x32d0: 0x0024, 0x32d1: 0x0024, 0x32d2: 0x0024, 0x32d3: 0x0024, 0x32d4: 0x0024, 0x32d5: 0x0024, 0x32d6: 0x0024, // Block 0xcc, offset 0x3300 0x3304: 0x0024, 0x3305: 0x0024, 0x3306: 0x0024, 0x3307: 0x0024, 0x3308: 0x0024, 0x3309: 0x0024, 0x330a: 0x0024, // Block 0xcd, offset 0x3340 0x3344: 0x0008, 0x336c: 0x0008, 0x336d: 0x0008, 0x336e: 0x0008, 0x336f: 0x0008, // Block 0xce, offset 0x3380 0x3394: 0x0008, 0x3395: 0x0008, 0x3396: 0x0008, 0x3397: 0x0008, 0x3398: 0x0008, 0x3399: 0x0008, 0x339a: 0x0008, 0x339b: 0x0008, 0x339c: 0x0008, 0x339d: 0x0008, 0x339e: 0x0008, 0x339f: 0x0008, 0x33af: 0x0008, 0x33b0: 0x0008, // Block 0xcf, offset 0x33c0 0x33c0: 0x0008, 0x33cf: 0x0008, 0x33d0: 0x0008, 0x33f6: 0x0008, 0x33f7: 0x0008, 0x33f8: 0x0008, 0x33f9: 0x0008, 0x33fa: 0x0008, 0x33fb: 0x0008, 0x33fc: 0x0008, 0x33fd: 0x0008, 0x33fe: 0x0008, 0x33ff: 0x0008, // Block 0xd0, offset 0x3400 0x3430: 0x0008, 0x3431: 0x0008, 0x343e: 0x0008, 0x343f: 0x0008, // Block 0xd1, offset 0x3440 0x344e: 0x0008, 0x3451: 0x0008, 0x3452: 0x0008, 0x3453: 0x0008, 0x3454: 0x0008, 0x3455: 0x0008, 0x3456: 0x0008, 0x3457: 0x0008, 0x3458: 0x0008, 0x3459: 0x0008, 0x345a: 0x0008, 0x346e: 0x0008, 0x346f: 0x0008, 0x3470: 0x0008, 0x3471: 0x0008, 0x3472: 0x0008, 0x3473: 0x0008, 0x3474: 0x0008, 0x3475: 0x0008, 0x3476: 0x0008, 0x3477: 0x0008, 0x3478: 0x0008, 0x3479: 0x0008, 0x347a: 0x0008, 0x347b: 0x0008, 0x347c: 0x0008, 0x347d: 0x0008, 0x347e: 0x0008, 0x347f: 0x0008, // Block 0xd2, offset 0x3480 0x3480: 0x0008, 0x3481: 0x0008, 0x3482: 0x0008, 0x3483: 0x0008, 0x3484: 0x0008, 0x3485: 0x0008, 0x3486: 0x0008, 0x3487: 0x0008, 0x3488: 0x0008, 0x3489: 0x0008, 0x348a: 0x0008, 0x348b: 0x0008, 0x348c: 0x0008, 0x348d: 0x0008, 0x348e: 0x0008, 0x348f: 0x0008, 0x3490: 0x0008, 0x3491: 0x0008, 0x3492: 0x0008, 0x3493: 0x0008, 0x3494: 0x0008, 0x3495: 0x0008, 0x3496: 0x0008, 0x3497: 0x0008, 0x3498: 0x0008, 0x3499: 0x0008, 0x349a: 0x0008, 0x349b: 0x0008, 0x349c: 0x0008, 0x349d: 0x0008, 0x349e: 0x0008, 0x349f: 0x0008, 0x34a0: 0x0008, 0x34a1: 0x0008, 0x34a2: 0x0008, 0x34a3: 0x0008, 0x34a4: 0x0008, 0x34a5: 0x0008, 0x34a6: 0x1000, 0x34a7: 0x1000, 0x34a8: 0x1000, 0x34a9: 0x1000, 0x34aa: 0x1000, 0x34ab: 0x1000, 0x34ac: 0x1000, 0x34ad: 0x1000, 0x34ae: 0x1000, 0x34af: 0x1000, 0x34b0: 0x1000, 0x34b1: 0x1000, 0x34b2: 0x1000, 0x34b3: 0x1000, 0x34b4: 0x1000, 0x34b5: 0x1000, 0x34b6: 0x1000, 0x34b7: 0x1000, 0x34b8: 0x1000, 0x34b9: 0x1000, 0x34ba: 0x1000, 0x34bb: 0x1000, 0x34bc: 0x1000, 0x34bd: 0x1000, 0x34be: 0x1000, 0x34bf: 0x1000, // Block 0xd3, offset 0x34c0 0x34c1: 0x0008, 0x34c2: 0x0008, 0x34c3: 0x0008, 0x34c4: 0x0008, 0x34c5: 0x0008, 0x34c6: 0x0008, 0x34c7: 0x0008, 0x34c8: 0x0008, 0x34c9: 0x0008, 0x34ca: 0x0008, 0x34cb: 0x0008, 0x34cc: 0x0008, 0x34cd: 0x0008, 0x34ce: 0x0008, 0x34cf: 0x0008, 0x34da: 0x0008, 0x34ef: 0x0008, 0x34f2: 0x0008, 0x34f3: 0x0008, 0x34f4: 0x0008, 0x34f5: 0x0008, 0x34f6: 0x0008, 0x34f7: 0x0008, 0x34f8: 0x0008, 0x34f9: 0x0008, 0x34fa: 0x0008, 0x34fc: 0x0008, 0x34fd: 0x0008, 0x34fe: 0x0008, 0x34ff: 0x0008, // Block 0xd4, offset 0x3500 0x3509: 0x0008, 0x350a: 0x0008, 0x350b: 0x0008, 0x350c: 0x0008, 0x350d: 0x0008, 0x350e: 0x0008, 0x350f: 0x0008, 0x3510: 0x0008, 0x3511: 0x0008, 0x3512: 0x0008, 0x3513: 0x0008, 0x3514: 0x0008, 0x3515: 0x0008, 0x3516: 0x0008, 0x3517: 0x0008, 0x3518: 0x0008, 0x3519: 0x0008, 0x351a: 0x0008, 0x351b: 0x0008, 0x351c: 0x0008, 0x351d: 0x0008, 0x351e: 0x0008, 0x351f: 0x0008, 0x3526: 0x0008, 0x3527: 0x0008, 0x3528: 0x0008, 0x3529: 0x0008, 0x352a: 0x0008, 0x352b: 0x0008, 0x352c: 0x0008, 0x352d: 0x0008, 0x352e: 0x0008, 0x352f: 0x0008, 0x3530: 0x0008, 0x3531: 0x0008, 0x3532: 0x0008, 0x3533: 0x0008, 0x3534: 0x0008, 0x3535: 0x0008, 0x3536: 0x0008, 0x3537: 0x0008, 0x3538: 0x0008, 0x3539: 0x0008, 0x353a: 0x0008, 0x353b: 0x0008, 0x353c: 0x0008, 0x353d: 0x0008, 0x353e: 0x0008, 0x353f: 0x0008, // Block 0xd5, offset 0x3540 0x3540: 0x0008, 0x3541: 0x0008, 0x3542: 0x0008, 0x3543: 0x0008, 0x3544: 0x0008, 0x3545: 0x0008, 0x3546: 0x0008, 0x3547: 0x0008, 0x3548: 0x0008, 0x3549: 0x0008, 0x354a: 0x0008, 0x354b: 0x0008, 0x354c: 0x0008, 0x354d: 0x0008, 0x354e: 0x0008, 0x354f: 0x0008, 0x3550: 0x0008, 0x3551: 0x0008, 0x3552: 0x0008, 0x3553: 0x0008, 0x3554: 0x0008, 0x3555: 0x0008, 0x3556: 0x0008, 0x3557: 0x0008, 0x3558: 0x0008, 0x3559: 0x0008, 0x355a: 0x0008, 0x355b: 0x0008, 0x355c: 0x0008, 0x355d: 0x0008, 0x355e: 0x0008, 0x355f: 0x0008, 0x3560: 0x0008, 0x3561: 0x0008, 0x3562: 0x0008, 0x3563: 0x0008, 0x3564: 0x0008, 0x3565: 0x0008, 0x3566: 0x0008, 0x3567: 0x0008, 0x3568: 0x0008, 0x3569: 0x0008, 0x356a: 0x0008, 0x356b: 0x0008, 0x356c: 0x0008, 0x356d: 0x0008, 0x356e: 0x0008, 0x356f: 0x0008, 0x3570: 0x0008, 0x3571: 0x0008, 0x3572: 0x0008, 0x3573: 0x0008, 0x3574: 0x0008, 0x3575: 0x0008, 0x3576: 0x0008, 0x3577: 0x0008, 0x3578: 0x0008, 0x3579: 0x0008, 0x357a: 0x0008, 0x357b: 0x0008, 0x357c: 0x0008, 0x357d: 0x0008, 0x357e: 0x0008, 0x357f: 0x0008, // Block 0xd6, offset 0x3580 0x3580: 0x0008, 0x3581: 0x0008, 0x3582: 0x0008, 0x3583: 0x0008, 0x3584: 0x0008, 0x3585: 0x0008, 0x3586: 0x0008, 0x3587: 0x0008, 0x3588: 0x0008, 0x3589: 0x0008, 0x358a: 0x0008, 0x358b: 0x0008, 0x358c: 0x0008, 0x358d: 0x0008, 0x358e: 0x0008, 0x358f: 0x0008, 0x3590: 0x0008, 0x3591: 0x0008, 0x3592: 0x0008, 0x3593: 0x0008, 0x3594: 0x0008, 0x3595: 0x0008, 0x3596: 0x0008, 0x3597: 0x0008, 0x3598: 0x0008, 0x3599: 0x0008, 0x359a: 0x0008, 0x359b: 0x0008, 0x359c: 0x0008, 0x359d: 0x0008, 0x359e: 0x0008, 0x359f: 0x0008, 0x35a0: 0x0008, 0x35a1: 0x0008, 0x35a4: 0x0008, 0x35a5: 0x0008, 0x35a6: 0x0008, 0x35a7: 0x0008, 0x35a8: 0x0008, 0x35a9: 0x0008, 0x35aa: 0x0008, 0x35ab: 0x0008, 0x35ac: 0x0008, 0x35ad: 0x0008, 0x35ae: 0x0008, 0x35af: 0x0008, 0x35b0: 0x0008, 0x35b1: 0x0008, 0x35b2: 0x0008, 0x35b3: 0x0008, 0x35b4: 0x0008, 0x35b5: 0x0008, 0x35b6: 0x0008, 0x35b7: 0x0008, 0x35b8: 0x0008, 0x35b9: 0x0008, 0x35ba: 0x0008, 0x35bb: 0x0008, 0x35bc: 0x0008, 0x35bd: 0x0008, 0x35be: 0x0008, 0x35bf: 0x0008, // Block 0xd7, offset 0x35c0 0x35c0: 0x0008, 0x35c1: 0x0008, 0x35c2: 0x0008, 0x35c3: 0x0008, 0x35c4: 0x0008, 0x35c5: 0x0008, 0x35c6: 0x0008, 0x35c7: 0x0008, 0x35c8: 0x0008, 0x35c9: 0x0008, 0x35ca: 0x0008, 0x35cb: 0x0008, 0x35cc: 0x0008, 0x35cd: 0x0008, 0x35ce: 0x0008, 0x35cf: 0x0008, 0x35d0: 0x0008, 0x35d1: 0x0008, 0x35d2: 0x0008, 0x35d3: 0x0008, 0x35d6: 0x0008, 0x35d7: 0x0008, 0x35d9: 0x0008, 0x35da: 0x0008, 0x35db: 0x0008, 0x35de: 0x0008, 0x35df: 0x0008, 0x35e0: 0x0008, 0x35e1: 0x0008, 0x35e2: 0x0008, 0x35e3: 0x0008, 0x35e4: 0x0008, 0x35e5: 0x0008, 0x35e6: 0x0008, 0x35e7: 0x0008, 0x35e8: 0x0008, 0x35e9: 0x0008, 0x35ea: 0x0008, 0x35eb: 0x0008, 0x35ec: 0x0008, 0x35ed: 0x0008, 0x35ee: 0x0008, 0x35ef: 0x0008, 0x35f0: 0x0008, 0x35f1: 0x0008, 0x35f2: 0x0008, 0x35f3: 0x0008, 0x35f4: 0x0008, 0x35f5: 0x0008, 0x35f6: 0x0008, 0x35f7: 0x0008, 0x35f8: 0x0008, 0x35f9: 0x0008, 0x35fa: 0x0008, 0x35fb: 0x0008, 0x35fc: 0x0008, 0x35fd: 0x0008, 0x35fe: 0x0008, 0x35ff: 0x0008, // Block 0xd8, offset 0x3600 0x3600: 0x0008, 0x3601: 0x0008, 0x3602: 0x0008, 0x3603: 0x0008, 0x3604: 0x0008, 0x3605: 0x0008, 0x3606: 0x0008, 0x3607: 0x0008, 0x3608: 0x0008, 0x3609: 0x0008, 0x360a: 0x0008, 0x360b: 0x0008, 0x360c: 0x0008, 0x360d: 0x0008, 0x360e: 0x0008, 0x360f: 0x0008, 0x3610: 0x0008, 0x3611: 0x0008, 0x3612: 0x0008, 0x3613: 0x0008, 0x3614: 0x0008, 0x3615: 0x0008, 0x3616: 0x0008, 0x3617: 0x0008, 0x3618: 0x0008, 0x3619: 0x0008, 0x361a: 0x0008, 0x361b: 0x0008, 0x361c: 0x0008, 0x361d: 0x0008, 0x361e: 0x0008, 0x361f: 0x0008, 0x3620: 0x0008, 0x3621: 0x0008, 0x3622: 0x0008, 0x3623: 0x0008, 0x3624: 0x0008, 0x3625: 0x0008, 0x3626: 0x0008, 0x3627: 0x0008, 0x3628: 0x0008, 0x3629: 0x0008, 0x362a: 0x0008, 0x362b: 0x0008, 0x362c: 0x0008, 0x362d: 0x0008, 0x362e: 0x0008, 0x362f: 0x0008, 0x3630: 0x0008, 0x3633: 0x0008, 0x3634: 0x0008, 0x3635: 0x0008, 0x3637: 0x0008, 0x3638: 0x0008, 0x3639: 0x0008, 0x363a: 0x0008, 0x363b: 0x0024, 0x363c: 0x0024, 0x363d: 0x0024, 0x363e: 0x0024, 0x363f: 0x0024, // Block 0xd9, offset 0x3640 0x3640: 0x0008, 0x3641: 0x0008, 0x3642: 0x0008, 0x3643: 0x0008, 0x3644: 0x0008, 0x3645: 0x0008, 0x3646: 0x0008, 0x3647: 0x0008, 0x3648: 0x0008, 0x3649: 0x0008, 0x364a: 0x0008, 0x364b: 0x0008, 0x364c: 0x0008, 0x364d: 0x0008, 0x364e: 0x0008, 0x364f: 0x0008, 0x3650: 0x0008, 0x3651: 0x0008, 0x3652: 0x0008, 0x3653: 0x0008, 0x3654: 0x0008, 0x3655: 0x0008, 0x3656: 0x0008, 0x3657: 0x0008, 0x3658: 0x0008, 0x3659: 0x0008, 0x365a: 0x0008, 0x365b: 0x0008, 0x365c: 0x0008, 0x365d: 0x0008, 0x365e: 0x0008, 0x365f: 0x0008, 0x3660: 0x0008, 0x3661: 0x0008, 0x3662: 0x0008, 0x3663: 0x0008, 0x3664: 0x0008, 0x3665: 0x0008, 0x3666: 0x0008, 0x3667: 0x0008, 0x3668: 0x0008, 0x3669: 0x0008, 0x366a: 0x0008, 0x366b: 0x0008, 0x366c: 0x0008, 0x366d: 0x0008, 0x366e: 0x0008, 0x366f: 0x0008, 0x3670: 0x0008, 0x3671: 0x0008, 0x3672: 0x0008, 0x3673: 0x0008, 0x3674: 0x0008, 0x3675: 0x0008, 0x3676: 0x0008, 0x3677: 0x0008, 0x3678: 0x0008, 0x3679: 0x0008, 0x367a: 0x0008, 0x367b: 0x0008, 0x367c: 0x0008, 0x367d: 0x0008, 0x367f: 0x0008, // Block 0xda, offset 0x3680 0x3680: 0x0008, 0x3681: 0x0008, 0x3682: 0x0008, 0x3683: 0x0008, 0x3684: 0x0008, 0x3685: 0x0008, 0x3686: 0x0008, 0x3687: 0x0008, 0x3688: 0x0008, 0x3689: 0x0008, 0x368a: 0x0008, 0x368b: 0x0008, 0x368c: 0x0008, 0x368d: 0x0008, 0x368e: 0x0008, 0x368f: 0x0008, 0x3690: 0x0008, 0x3691: 0x0008, 0x3692: 0x0008, 0x3693: 0x0008, 0x3694: 0x0008, 0x3695: 0x0008, 0x3696: 0x0008, 0x3697: 0x0008, 0x3698: 0x0008, 0x3699: 0x0008, 0x369a: 0x0008, 0x369b: 0x0008, 0x369c: 0x0008, 0x369d: 0x0008, 0x369e: 0x0008, 0x369f: 0x0008, 0x36a0: 0x0008, 0x36a1: 0x0008, 0x36a2: 0x0008, 0x36a3: 0x0008, 0x36a4: 0x0008, 0x36a5: 0x0008, 0x36a6: 0x0008, 0x36a7: 0x0008, 0x36a8: 0x0008, 0x36a9: 0x0008, 0x36aa: 0x0008, 0x36ab: 0x0008, 0x36ac: 0x0008, 0x36ad: 0x0008, 0x36ae: 0x0008, 0x36af: 0x0008, 0x36b0: 0x0008, 0x36b1: 0x0008, 0x36b2: 0x0008, 0x36b3: 0x0008, 0x36b4: 0x0008, 0x36b5: 0x0008, 0x36b6: 0x0008, 0x36b7: 0x0008, 0x36b8: 0x0008, 0x36b9: 0x0008, 0x36ba: 0x0008, 0x36bb: 0x0008, 0x36bc: 0x0008, 0x36bd: 0x0008, // Block 0xdb, offset 0x36c0 0x36c9: 0x0008, 0x36ca: 0x0008, 0x36cb: 0x0008, 0x36cc: 0x0008, 0x36cd: 0x0008, 0x36ce: 0x0008, 0x36d0: 0x0008, 0x36d1: 0x0008, 0x36d2: 0x0008, 0x36d3: 0x0008, 0x36d4: 0x0008, 0x36d5: 0x0008, 0x36d6: 0x0008, 0x36d7: 0x0008, 0x36d8: 0x0008, 0x36d9: 0x0008, 0x36da: 0x0008, 0x36db: 0x0008, 0x36dc: 0x0008, 0x36dd: 0x0008, 0x36de: 0x0008, 0x36df: 0x0008, 0x36e0: 0x0008, 0x36e1: 0x0008, 0x36e2: 0x0008, 0x36e3: 0x0008, 0x36e4: 0x0008, 0x36e5: 0x0008, 0x36e6: 0x0008, 0x36e7: 0x0008, 0x36ef: 0x0008, 0x36f0: 0x0008, 0x36f3: 0x0008, 0x36f4: 0x0008, 0x36f5: 0x0008, 0x36f6: 0x0008, 0x36f7: 0x0008, 0x36f8: 0x0008, 0x36f9: 0x0008, 0x36fa: 0x0008, // Block 0xdc, offset 0x3700 0x3707: 0x0008, 0x370a: 0x0008, 0x370b: 0x0008, 0x370c: 0x0008, 0x370d: 0x0008, 0x3710: 0x0008, 0x3715: 0x0008, 0x3716: 0x0008, 0x3724: 0x0008, 0x3725: 0x0008, 0x3728: 0x0008, 0x3731: 0x0008, 0x3732: 0x0008, 0x373c: 0x0008, // Block 0xdd, offset 0x3740 0x3742: 0x0008, 0x3743: 0x0008, 0x3744: 0x0008, 0x3751: 0x0008, 0x3752: 0x0008, 0x3753: 0x0008, 0x375c: 0x0008, 0x375d: 0x0008, 0x375e: 0x0008, 0x3761: 0x0008, 0x3763: 0x0008, 0x3768: 0x0008, 0x376f: 0x0008, 0x3773: 0x0008, 0x377a: 0x0008, 0x377b: 0x0008, 0x377c: 0x0008, 0x377d: 0x0008, 0x377e: 0x0008, 0x377f: 0x0008, // Block 0xde, offset 0x3780 0x3780: 0x0008, 0x3781: 0x0008, 0x3782: 0x0008, 0x3783: 0x0008, 0x3784: 0x0008, 0x3785: 0x0008, 0x3786: 0x0008, 0x3787: 0x0008, 0x3788: 0x0008, 0x3789: 0x0008, 0x378a: 0x0008, 0x378b: 0x0008, 0x378c: 0x0008, 0x378d: 0x0008, 0x378e: 0x0008, 0x378f: 0x0008, // Block 0xdf, offset 0x37c0 0x37c0: 0x0008, 0x37c1: 0x0008, 0x37c2: 0x0008, 0x37c3: 0x0008, 0x37c4: 0x0008, 0x37c5: 0x0008, 0x37cb: 0x0008, 0x37cc: 0x0008, 0x37cd: 0x0008, 0x37ce: 0x0008, 0x37cf: 0x0008, 0x37d0: 0x0008, 0x37d1: 0x0008, 0x37d2: 0x0008, 0x37d5: 0x0008, 0x37d6: 0x0008, 0x37d7: 0x0008, 0x37d8: 0x0008, 0x37d9: 0x0008, 0x37da: 0x0008, 0x37db: 0x0008, 0x37dc: 0x0008, 0x37dd: 0x0008, 0x37de: 0x0008, 0x37df: 0x0008, 0x37e0: 0x0008, 0x37e1: 0x0008, 0x37e2: 0x0008, 0x37e3: 0x0008, 0x37e4: 0x0008, 0x37e5: 0x0008, 0x37e9: 0x0008, 0x37eb: 0x0008, 0x37ec: 0x0008, 0x37ed: 0x0008, 0x37ee: 0x0008, 0x37ef: 0x0008, 0x37f0: 0x0008, 0x37f3: 0x0008, 0x37f4: 0x0008, 0x37f5: 0x0008, 0x37f6: 0x0008, 0x37f7: 0x0008, 0x37f8: 0x0008, 0x37f9: 0x0008, 0x37fa: 0x0008, 0x37fb: 0x0008, 0x37fc: 0x0008, 0x37fd: 0x0008, 0x37fe: 0x0008, 0x37ff: 0x0008, // Block 0xe0, offset 0x3800 0x381a: 0x0008, 0x381b: 0x0008, 0x381c: 0x0008, 0x381d: 0x0008, 0x381e: 0x0008, 0x381f: 0x0008, 0x3820: 0x0008, 0x3821: 0x0008, 0x3822: 0x0008, 0x3823: 0x0008, 0x3824: 0x0008, 0x3825: 0x0008, 0x3826: 0x0008, 0x3827: 0x0008, 0x3828: 0x0008, 0x3829: 0x0008, 0x382a: 0x0008, 0x382b: 0x0008, 0x382c: 0x0008, 0x382d: 0x0008, 0x382e: 0x0008, 0x382f: 0x0008, 0x3830: 0x0008, 0x3831: 0x0008, 0x3832: 0x0008, 0x3833: 0x0008, 0x3834: 0x0008, 0x3835: 0x0008, 0x3836: 0x0008, 0x3837: 0x0008, 0x3838: 0x0008, 0x3839: 0x0008, 0x383a: 0x0008, 0x383b: 0x0008, 0x383c: 0x0008, 0x383d: 0x0008, 0x383e: 0x0008, 0x383f: 0x0008, // Block 0xe1, offset 0x3840 0x384c: 0x0008, 0x384d: 0x0008, 0x384e: 0x0008, 0x384f: 0x0008, // Block 0xe2, offset 0x3880 0x3888: 0x0008, 0x3889: 0x0008, 0x388a: 0x0008, 0x388b: 0x0008, 0x388c: 0x0008, 0x388d: 0x0008, 0x388e: 0x0008, 0x388f: 0x0008, 0x389a: 0x0008, 0x389b: 0x0008, 0x389c: 0x0008, 0x389d: 0x0008, 0x389e: 0x0008, 0x389f: 0x0008, // Block 0xe3, offset 0x38c0 0x38c8: 0x0008, 0x38c9: 0x0008, 0x38ca: 0x0008, 0x38cb: 0x0008, 0x38cc: 0x0008, 0x38cd: 0x0008, 0x38ce: 0x0008, 0x38cf: 0x0008, 0x38ee: 0x0008, 0x38ef: 0x0008, 0x38fc: 0x0008, 0x38fd: 0x0008, 0x38fe: 0x0008, 0x38ff: 0x0008, // Block 0xe4, offset 0x3900 0x3902: 0x0008, 0x3903: 0x0008, 0x3904: 0x0008, 0x3905: 0x0008, 0x3906: 0x0008, 0x3907: 0x0008, 0x3908: 0x0008, 0x3909: 0x0008, 0x390a: 0x0008, 0x390b: 0x0008, 0x390c: 0x0008, 0x390d: 0x0008, 0x390e: 0x0008, 0x390f: 0x0008, 0x3919: 0x0008, 0x391a: 0x0008, 0x391b: 0x0008, 0x391c: 0x0008, 0x391d: 0x0008, 0x391e: 0x0008, 0x391f: 0x0008, 0x3920: 0x0008, 0x3921: 0x0008, 0x3922: 0x0008, 0x3923: 0x0008, 0x3924: 0x0008, 0x3925: 0x0008, 0x3926: 0x0008, 0x3927: 0x0008, 0x3928: 0x0008, 0x3929: 0x0008, 0x392a: 0x0008, 0x392b: 0x0008, 0x392c: 0x0008, 0x392d: 0x0008, 0x392e: 0x0008, 0x392f: 0x0008, 0x3930: 0x0008, 0x3931: 0x0008, 0x3932: 0x0008, 0x3933: 0x0008, 0x3934: 0x0008, 0x3935: 0x0008, 0x3936: 0x0008, 0x3937: 0x0008, 0x3938: 0x0008, 0x3939: 0x0008, 0x393a: 0x0008, 0x393b: 0x0008, 0x393c: 0x0008, 0x393d: 0x0008, 0x393e: 0x0008, 0x393f: 0x0008, // Block 0xe5, offset 0x3940 0x394c: 0x0008, 0x394d: 0x0008, 0x394e: 0x0008, 0x394f: 0x0008, 0x3950: 0x0008, 0x3951: 0x0008, 0x3952: 0x0008, 0x3953: 0x0008, 0x3954: 0x0008, 0x3955: 0x0008, 0x3956: 0x0008, 0x3957: 0x0008, 0x3958: 0x0008, 0x3959: 0x0008, 0x395a: 0x0008, 0x395b: 0x0008, 0x395c: 0x0008, 0x395d: 0x0008, 0x395e: 0x0008, 0x395f: 0x0008, 0x3960: 0x0008, 0x3961: 0x0008, 0x3962: 0x0008, 0x3963: 0x0008, 0x3964: 0x0008, 0x3965: 0x0008, 0x3966: 0x0008, 0x3967: 0x0008, 0x3968: 0x0008, 0x3969: 0x0008, 0x396a: 0x0008, 0x396b: 0x0008, 0x396c: 0x0008, 0x396d: 0x0008, 0x396e: 0x0008, 0x396f: 0x0008, 0x3970: 0x0008, 0x3971: 0x0008, 0x3972: 0x0008, 0x3973: 0x0008, 0x3974: 0x0008, 0x3975: 0x0008, 0x3976: 0x0008, 0x3977: 0x0008, 0x3978: 0x0008, 0x3979: 0x0008, 0x397a: 0x0008, 0x397c: 0x0008, 0x397d: 0x0008, 0x397e: 0x0008, 0x397f: 0x0008, // Block 0xe6, offset 0x3980 0x3980: 0x0008, 0x3981: 0x0008, 0x3982: 0x0008, 0x3983: 0x0008, 0x3984: 0x0008, 0x3985: 0x0008, 0x3987: 0x0008, 0x3988: 0x0008, 0x3989: 0x0008, 0x398a: 0x0008, 0x398b: 0x0008, 0x398c: 0x0008, 0x398d: 0x0008, 0x398e: 0x0008, 0x398f: 0x0008, 0x3990: 0x0008, 0x3991: 0x0008, 0x3992: 0x0008, 0x3993: 0x0008, 0x3994: 0x0008, 0x3995: 0x0008, 0x3996: 0x0008, 0x3997: 0x0008, 0x3998: 0x0008, 0x3999: 0x0008, 0x399a: 0x0008, 0x399b: 0x0008, 0x399c: 0x0008, 0x399d: 0x0008, 0x399e: 0x0008, 0x399f: 0x0008, 0x39a0: 0x0008, 0x39a1: 0x0008, 0x39a2: 0x0008, 0x39a3: 0x0008, 0x39a4: 0x0008, 0x39a5: 0x0008, 0x39a6: 0x0008, 0x39a7: 0x0008, 0x39a8: 0x0008, 0x39a9: 0x0008, 0x39aa: 0x0008, 0x39ab: 0x0008, 0x39ac: 0x0008, 0x39ad: 0x0008, 0x39ae: 0x0008, 0x39af: 0x0008, 0x39b0: 0x0008, 0x39b1: 0x0008, 0x39b2: 0x0008, 0x39b3: 0x0008, 0x39b4: 0x0008, 0x39b5: 0x0008, 0x39b6: 0x0008, 0x39b7: 0x0008, 0x39b8: 0x0008, 0x39b9: 0x0008, 0x39ba: 0x0008, 0x39bb: 0x0008, 0x39bc: 0x0008, 0x39bd: 0x0008, 0x39be: 0x0008, 0x39bf: 0x0008, // Block 0xe7, offset 0x39c0 0x39d8: 0x0008, 0x39d9: 0x0008, 0x39da: 0x0008, 0x39db: 0x0008, 0x39dc: 0x0008, 0x39dd: 0x0008, 0x39de: 0x0008, 0x39df: 0x0008, 0x39ee: 0x0008, 0x39ef: 0x0008, 0x39f0: 0x0008, 0x39f1: 0x0008, 0x39f2: 0x0008, 0x39f3: 0x0008, 0x39f4: 0x0008, 0x39f5: 0x0008, 0x39f6: 0x0008, 0x39f7: 0x0008, 0x39f8: 0x0008, 0x39f9: 0x0008, 0x39fa: 0x0008, 0x39fb: 0x0008, 0x39fc: 0x0008, 0x39fd: 0x0008, 0x39fe: 0x0008, 0x39ff: 0x0008, // Block 0xe8, offset 0x3a00 0x3a00: 0x0002, 0x3a01: 0x0002, 0x3a02: 0x0002, 0x3a03: 0x0002, 0x3a04: 0x0002, 0x3a05: 0x0002, 0x3a06: 0x0002, 0x3a07: 0x0002, 0x3a08: 0x0002, 0x3a09: 0x0002, 0x3a0a: 0x0002, 0x3a0b: 0x0002, 0x3a0c: 0x0002, 0x3a0d: 0x0002, 0x3a0e: 0x0002, 0x3a0f: 0x0002, 0x3a10: 0x0002, 0x3a11: 0x0002, 0x3a12: 0x0002, 0x3a13: 0x0002, 0x3a14: 0x0002, 0x3a15: 0x0002, 0x3a16: 0x0002, 0x3a17: 0x0002, 0x3a18: 0x0002, 0x3a19: 0x0002, 0x3a1a: 0x0002, 0x3a1b: 0x0002, 0x3a1c: 0x0002, 0x3a1d: 0x0002, 0x3a1e: 0x0002, 0x3a1f: 0x0002, 0x3a20: 0x0024, 0x3a21: 0x0024, 0x3a22: 0x0024, 0x3a23: 0x0024, 0x3a24: 0x0024, 0x3a25: 0x0024, 0x3a26: 0x0024, 0x3a27: 0x0024, 0x3a28: 0x0024, 0x3a29: 0x0024, 0x3a2a: 0x0024, 0x3a2b: 0x0024, 0x3a2c: 0x0024, 0x3a2d: 0x0024, 0x3a2e: 0x0024, 0x3a2f: 0x0024, 0x3a30: 0x0024, 0x3a31: 0x0024, 0x3a32: 0x0024, 0x3a33: 0x0024, 0x3a34: 0x0024, 0x3a35: 0x0024, 0x3a36: 0x0024, 0x3a37: 0x0024, 0x3a38: 0x0024, 0x3a39: 0x0024, 0x3a3a: 0x0024, 0x3a3b: 0x0024, 0x3a3c: 0x0024, 0x3a3d: 0x0024, 0x3a3e: 0x0024, 0x3a3f: 0x0024, // Block 0xe9, offset 0x3a40 0x3a40: 0x0002, 0x3a41: 0x0002, 0x3a42: 0x0002, 0x3a43: 0x0002, 0x3a44: 0x0002, 0x3a45: 0x0002, 0x3a46: 0x0002, 0x3a47: 0x0002, 0x3a48: 0x0002, 0x3a49: 0x0002, 0x3a4a: 0x0002, 0x3a4b: 0x0002, 0x3a4c: 0x0002, 0x3a4d: 0x0002, 0x3a4e: 0x0002, 0x3a4f: 0x0002, 0x3a50: 0x0002, 0x3a51: 0x0002, 0x3a52: 0x0002, 0x3a53: 0x0002, 0x3a54: 0x0002, 0x3a55: 0x0002, 0x3a56: 0x0002, 0x3a57: 0x0002, 0x3a58: 0x0002, 0x3a59: 0x0002, 0x3a5a: 0x0002, 0x3a5b: 0x0002, 0x3a5c: 0x0002, 0x3a5d: 0x0002, 0x3a5e: 0x0002, 0x3a5f: 0x0002, 0x3a60: 0x0002, 0x3a61: 0x0002, 0x3a62: 0x0002, 0x3a63: 0x0002, 0x3a64: 0x0002, 0x3a65: 0x0002, 0x3a66: 0x0002, 0x3a67: 0x0002, 0x3a68: 0x0002, 0x3a69: 0x0002, 0x3a6a: 0x0002, 0x3a6b: 0x0002, 0x3a6c: 0x0002, 0x3a6d: 0x0002, 0x3a6e: 0x0002, 0x3a6f: 0x0002, 0x3a70: 0x0002, 0x3a71: 0x0002, 0x3a72: 0x0002, 0x3a73: 0x0002, 0x3a74: 0x0002, 0x3a75: 0x0002, 0x3a76: 0x0002, 0x3a77: 0x0002, 0x3a78: 0x0002, 0x3a79: 0x0002, 0x3a7a: 0x0002, 0x3a7b: 0x0002, 0x3a7c: 0x0002, 0x3a7d: 0x0002, 0x3a7e: 0x0002, 0x3a7f: 0x0002, // Block 0xea, offset 0x3a80 0x3a80: 0x0024, 0x3a81: 0x0024, 0x3a82: 0x0024, 0x3a83: 0x0024, 0x3a84: 0x0024, 0x3a85: 0x0024, 0x3a86: 0x0024, 0x3a87: 0x0024, 0x3a88: 0x0024, 0x3a89: 0x0024, 0x3a8a: 0x0024, 0x3a8b: 0x0024, 0x3a8c: 0x0024, 0x3a8d: 0x0024, 0x3a8e: 0x0024, 0x3a8f: 0x0024, 0x3a90: 0x0024, 0x3a91: 0x0024, 0x3a92: 0x0024, 0x3a93: 0x0024, 0x3a94: 0x0024, 0x3a95: 0x0024, 0x3a96: 0x0024, 0x3a97: 0x0024, 0x3a98: 0x0024, 0x3a99: 0x0024, 0x3a9a: 0x0024, 0x3a9b: 0x0024, 0x3a9c: 0x0024, 0x3a9d: 0x0024, 0x3a9e: 0x0024, 0x3a9f: 0x0024, 0x3aa0: 0x0024, 0x3aa1: 0x0024, 0x3aa2: 0x0024, 0x3aa3: 0x0024, 0x3aa4: 0x0024, 0x3aa5: 0x0024, 0x3aa6: 0x0024, 0x3aa7: 0x0024, 0x3aa8: 0x0024, 0x3aa9: 0x0024, 0x3aaa: 0x0024, 0x3aab: 0x0024, 0x3aac: 0x0024, 0x3aad: 0x0024, 0x3aae: 0x0024, 0x3aaf: 0x0024, 0x3ab0: 0x0002, 0x3ab1: 0x0002, 0x3ab2: 0x0002, 0x3ab3: 0x0002, 0x3ab4: 0x0002, 0x3ab5: 0x0002, 0x3ab6: 0x0002, 0x3ab7: 0x0002, 0x3ab8: 0x0002, 0x3ab9: 0x0002, 0x3aba: 0x0002, 0x3abb: 0x0002, 0x3abc: 0x0002, 0x3abd: 0x0002, 0x3abe: 0x0002, 0x3abf: 0x0002, } // graphemesIndex: 25 blocks, 1600 entries, 1600 bytes // Block 0 is the zero block. var graphemesIndex = [1600]property{ // Block 0x0, offset 0x0 // Block 0x1, offset 0x40 // Block 0x2, offset 0x80 // Block 0x3, offset 0xc0 0xc2: 0x01, 0xcc: 0x02, 0xcd: 0x03, 0xd2: 0x04, 0xd6: 0x05, 0xd7: 0x06, 0xd8: 0x07, 0xd9: 0x08, 0xdb: 0x09, 0xdc: 0x0a, 0xdd: 0x0b, 0xde: 0x0c, 0xdf: 0x0d, 0xe0: 0x02, 0xe1: 0x03, 0xe2: 0x04, 0xe3: 0x05, 0xea: 0x06, 0xeb: 0x07, 0xec: 0x08, 0xed: 0x09, 0xef: 0x0a, 0xf0: 0x14, 0xf3: 0x16, // Block 0x4, offset 0x100 0x120: 0x0e, 0x121: 0x0f, 0x122: 0x10, 0x123: 0x11, 0x124: 0x12, 0x125: 0x13, 0x126: 0x14, 0x127: 0x15, 0x128: 0x16, 0x129: 0x17, 0x12a: 0x18, 0x12b: 0x19, 0x12c: 0x1a, 0x12d: 0x1b, 0x12e: 0x1c, 0x12f: 0x1d, 0x130: 0x1e, 0x131: 0x1f, 0x132: 0x20, 0x133: 0x21, 0x134: 0x22, 0x135: 0x23, 0x136: 0x24, 0x137: 0x25, 0x138: 0x26, 0x139: 0x27, 0x13a: 0x28, 0x13b: 0x29, 0x13c: 0x2a, 0x13d: 0x2b, 0x13e: 0x2c, 0x13f: 0x2d, // Block 0x5, offset 0x140 0x140: 0x2e, 0x141: 0x2f, 0x142: 0x30, 0x144: 0x31, 0x145: 0x32, 0x146: 0x33, 0x147: 0x34, 0x14d: 0x35, 0x15c: 0x36, 0x15d: 0x37, 0x15e: 0x38, 0x15f: 0x39, 0x160: 0x3a, 0x162: 0x3b, 0x164: 0x3c, 0x168: 0x3d, 0x169: 0x3e, 0x16a: 0x3f, 0x16b: 0x40, 0x16c: 0x41, 0x16d: 0x42, 0x16e: 0x43, 0x16f: 0x44, 0x170: 0x45, 0x173: 0x46, 0x177: 0x02, // Block 0x6, offset 0x180 0x180: 0x47, 0x181: 0x48, 0x183: 0x49, 0x184: 0x4a, 0x186: 0x4b, 0x18c: 0x4c, 0x18f: 0x4d, 0x193: 0x4e, 0x196: 0x4f, 0x197: 0x50, 0x198: 0x51, 0x199: 0x52, 0x19a: 0x53, 0x19b: 0x54, 0x19c: 0x55, 0x19d: 0x56, 0x19e: 0x57, 0x1a4: 0x58, 0x1ac: 0x59, 0x1ad: 0x5a, 0x1b3: 0x5b, 0x1b5: 0x5c, 0x1b7: 0x5d, // Block 0x7, offset 0x1c0 0x1c0: 0x5e, 0x1c2: 0x5f, 0x1ca: 0x60, // Block 0x8, offset 0x200 0x219: 0x61, 0x21a: 0x62, 0x21b: 0x63, 0x220: 0x64, 0x222: 0x65, 0x223: 0x66, 0x224: 0x67, 0x225: 0x68, 0x226: 0x69, 0x227: 0x6a, 0x228: 0x6b, 0x229: 0x6c, 0x22a: 0x6d, 0x22b: 0x6e, 0x22f: 0x6f, 0x230: 0x70, 0x231: 0x71, 0x232: 0x72, 0x233: 0x73, 0x234: 0x74, 0x235: 0x75, 0x236: 0x76, 0x237: 0x70, 0x238: 0x71, 0x239: 0x72, 0x23a: 0x73, 0x23b: 0x74, 0x23c: 0x75, 0x23d: 0x76, 0x23e: 0x70, 0x23f: 0x71, // Block 0x9, offset 0x240 0x240: 0x72, 0x241: 0x73, 0x242: 0x74, 0x243: 0x75, 0x244: 0x76, 0x245: 0x70, 0x246: 0x71, 0x247: 0x72, 0x248: 0x73, 0x249: 0x74, 0x24a: 0x75, 0x24b: 0x76, 0x24c: 0x70, 0x24d: 0x71, 0x24e: 0x72, 0x24f: 0x73, 0x250: 0x74, 0x251: 0x75, 0x252: 0x76, 0x253: 0x70, 0x254: 0x71, 0x255: 0x72, 0x256: 0x73, 0x257: 0x74, 0x258: 0x75, 0x259: 0x76, 0x25a: 0x70, 0x25b: 0x71, 0x25c: 0x72, 0x25d: 0x73, 0x25e: 0x74, 0x25f: 0x75, 0x260: 0x76, 0x261: 0x70, 0x262: 0x71, 0x263: 0x72, 0x264: 0x73, 0x265: 0x74, 0x266: 0x75, 0x267: 0x76, 0x268: 0x70, 0x269: 0x71, 0x26a: 0x72, 0x26b: 0x73, 0x26c: 0x74, 0x26d: 0x75, 0x26e: 0x76, 0x26f: 0x70, 0x270: 0x71, 0x271: 0x72, 0x272: 0x73, 0x273: 0x74, 0x274: 0x75, 0x275: 0x76, 0x276: 0x70, 0x277: 0x71, 0x278: 0x72, 0x279: 0x73, 0x27a: 0x74, 0x27b: 0x75, 0x27c: 0x76, 0x27d: 0x70, 0x27e: 0x71, 0x27f: 0x72, // Block 0xa, offset 0x280 0x280: 0x73, 0x281: 0x74, 0x282: 0x75, 0x283: 0x76, 0x284: 0x70, 0x285: 0x71, 0x286: 0x72, 0x287: 0x73, 0x288: 0x74, 0x289: 0x75, 0x28a: 0x76, 0x28b: 0x70, 0x28c: 0x71, 0x28d: 0x72, 0x28e: 0x73, 0x28f: 0x74, 0x290: 0x75, 0x291: 0x76, 0x292: 0x70, 0x293: 0x71, 0x294: 0x72, 0x295: 0x73, 0x296: 0x74, 0x297: 0x75, 0x298: 0x76, 0x299: 0x70, 0x29a: 0x71, 0x29b: 0x72, 0x29c: 0x73, 0x29d: 0x74, 0x29e: 0x75, 0x29f: 0x76, 0x2a0: 0x70, 0x2a1: 0x71, 0x2a2: 0x72, 0x2a3: 0x73, 0x2a4: 0x74, 0x2a5: 0x75, 0x2a6: 0x76, 0x2a7: 0x70, 0x2a8: 0x71, 0x2a9: 0x72, 0x2aa: 0x73, 0x2ab: 0x74, 0x2ac: 0x75, 0x2ad: 0x76, 0x2ae: 0x70, 0x2af: 0x71, 0x2b0: 0x72, 0x2b1: 0x73, 0x2b2: 0x74, 0x2b3: 0x75, 0x2b4: 0x76, 0x2b5: 0x70, 0x2b6: 0x71, 0x2b7: 0x72, 0x2b8: 0x73, 0x2b9: 0x74, 0x2ba: 0x75, 0x2bb: 0x76, 0x2bc: 0x70, 0x2bd: 0x71, 0x2be: 0x72, 0x2bf: 0x73, // Block 0xb, offset 0x2c0 0x2c0: 0x74, 0x2c1: 0x75, 0x2c2: 0x76, 0x2c3: 0x70, 0x2c4: 0x71, 0x2c5: 0x72, 0x2c6: 0x73, 0x2c7: 0x74, 0x2c8: 0x75, 0x2c9: 0x76, 0x2ca: 0x70, 0x2cb: 0x71, 0x2cc: 0x72, 0x2cd: 0x73, 0x2ce: 0x74, 0x2cf: 0x75, 0x2d0: 0x76, 0x2d1: 0x70, 0x2d2: 0x71, 0x2d3: 0x72, 0x2d4: 0x73, 0x2d5: 0x74, 0x2d6: 0x75, 0x2d7: 0x76, 0x2d8: 0x70, 0x2d9: 0x71, 0x2da: 0x72, 0x2db: 0x73, 0x2dc: 0x74, 0x2dd: 0x75, 0x2de: 0x77, 0x2df: 0x78, // Block 0xc, offset 0x300 0x32c: 0x79, 0x338: 0x7a, 0x33b: 0x7b, 0x33e: 0x62, 0x33f: 0x7c, // Block 0xd, offset 0x340 0x347: 0x7d, 0x34b: 0x7e, 0x34d: 0x7f, 0x368: 0x80, 0x36b: 0x81, 0x374: 0x82, 0x375: 0x83, 0x37a: 0x84, 0x37b: 0x85, 0x37d: 0x86, 0x37e: 0x87, // Block 0xe, offset 0x380 0x380: 0x88, 0x381: 0x89, 0x382: 0x8a, 0x383: 0x8b, 0x384: 0x8c, 0x385: 0x8d, 0x386: 0x8e, 0x387: 0x8f, 0x388: 0x90, 0x389: 0x91, 0x38b: 0x92, 0x38c: 0x93, 0x38d: 0x94, 0x38e: 0x95, 0x38f: 0x96, 0x390: 0x97, 0x391: 0x98, 0x392: 0x99, 0x393: 0x9a, 0x396: 0x9b, 0x397: 0x9c, 0x398: 0x9d, 0x399: 0x9e, 0x39a: 0x9f, 0x39c: 0xa0, 0x3a0: 0xa1, 0x3a4: 0xa2, 0x3a5: 0xa3, 0x3a7: 0xa4, 0x3a8: 0xa5, 0x3a9: 0xa6, 0x3aa: 0xa7, 0x3ad: 0xa8, 0x3b0: 0xa9, 0x3b2: 0xaa, 0x3b4: 0xab, 0x3b5: 0xac, 0x3b6: 0xad, 0x3bb: 0xae, 0x3bc: 0xaf, 0x3bd: 0xb0, // Block 0xf, offset 0x3c0 0x3d0: 0xb1, 0x3d1: 0xb2, // Block 0x10, offset 0x400 0x404: 0xb3, 0x42b: 0xb4, 0x42c: 0xb5, 0x435: 0xb6, 0x43d: 0xb7, 0x43e: 0xb8, 0x43f: 0xb9, // Block 0x11, offset 0x440 0x472: 0xba, // Block 0x12, offset 0x480 0x4bc: 0xbb, 0x4bd: 0xbc, // Block 0x13, offset 0x4c0 0x4c5: 0xbd, 0x4c6: 0xbe, 0x4c9: 0xbf, 0x4e8: 0xc0, 0x4e9: 0xc1, 0x4ea: 0xc2, // Block 0x14, offset 0x500 0x500: 0xc3, 0x502: 0xc4, 0x504: 0xb5, 0x50a: 0xc5, 0x50b: 0xc6, 0x513: 0xc6, 0x517: 0xc7, 0x51b: 0xc8, 0x523: 0xc9, 0x525: 0xca, // Block 0x15, offset 0x540 0x540: 0xcb, 0x542: 0xcc, 0x543: 0xcd, 0x545: 0xce, 0x546: 0xcf, 0x547: 0xd0, 0x548: 0xd1, 0x549: 0xd2, 0x54a: 0xd3, 0x54b: 0xd3, 0x54c: 0xd4, 0x54d: 0xd3, 0x54e: 0xd5, 0x54f: 0xd6, 0x550: 0xd3, 0x551: 0xd3, 0x552: 0xd3, 0x553: 0xd7, 0x554: 0xd8, 0x555: 0xd9, 0x556: 0xda, 0x557: 0xdb, 0x558: 0xd3, 0x559: 0xdc, 0x55a: 0xd3, 0x55b: 0xdd, 0x55f: 0xde, 0x560: 0xdf, 0x561: 0xe0, 0x562: 0xe1, 0x563: 0xe2, 0x564: 0xe3, 0x565: 0xe4, 0x566: 0xd3, 0x567: 0xd3, 0x569: 0xe5, 0x56a: 0xd3, 0x56b: 0xd3, 0x570: 0xd3, 0x571: 0xd3, 0x572: 0xd3, 0x573: 0xd3, 0x574: 0xd3, 0x575: 0xd3, 0x576: 0xd3, 0x577: 0xd3, 0x578: 0xd3, 0x579: 0xd3, 0x57a: 0xd3, 0x57b: 0xd3, 0x57c: 0xd3, 0x57d: 0xd3, 0x57e: 0xd3, 0x57f: 0xd8, // Block 0x16, offset 0x580 0x590: 0x0b, 0x591: 0x0c, 0x593: 0x0d, 0x596: 0x0e, 0x59b: 0x0f, 0x59c: 0x10, 0x59d: 0x11, 0x59e: 0x12, 0x59f: 0x13, // Block 0x17, offset 0x5c0 0x5c0: 0xe6, 0x5c1: 0x02, 0x5c2: 0xe7, 0x5c3: 0xe7, 0x5c4: 0x02, 0x5c5: 0x02, 0x5c6: 0x02, 0x5c7: 0xe8, 0x5c8: 0xe7, 0x5c9: 0xe7, 0x5ca: 0xe7, 0x5cb: 0xe7, 0x5cc: 0xe7, 0x5cd: 0xe7, 0x5ce: 0xe7, 0x5cf: 0xe7, 0x5d0: 0xe7, 0x5d1: 0xe7, 0x5d2: 0xe7, 0x5d3: 0xe7, 0x5d4: 0xe7, 0x5d5: 0xe7, 0x5d6: 0xe7, 0x5d7: 0xe7, 0x5d8: 0xe7, 0x5d9: 0xe7, 0x5da: 0xe7, 0x5db: 0xe7, 0x5dc: 0xe7, 0x5dd: 0xe7, 0x5de: 0xe7, 0x5df: 0xe7, 0x5e0: 0xe7, 0x5e1: 0xe7, 0x5e2: 0xe7, 0x5e3: 0xe7, 0x5e4: 0xe7, 0x5e5: 0xe7, 0x5e6: 0xe7, 0x5e7: 0xe7, 0x5e8: 0xe7, 0x5e9: 0xe7, 0x5ea: 0xe7, 0x5eb: 0xe7, 0x5ec: 0xe7, 0x5ed: 0xe7, 0x5ee: 0xe7, 0x5ef: 0xe7, 0x5f0: 0xe7, 0x5f1: 0xe7, 0x5f2: 0xe7, 0x5f3: 0xe7, 0x5f4: 0xe7, 0x5f5: 0xe7, 0x5f6: 0xe7, 0x5f7: 0xe7, 0x5f8: 0xe7, 0x5f9: 0xe7, 0x5fa: 0xe7, 0x5fb: 0xe7, 0x5fc: 0xe7, 0x5fd: 0xe7, 0x5fe: 0xe7, 0x5ff: 0xe7, // Block 0x18, offset 0x600 0x620: 0x15, } ================================================ FILE: vendor/github.com/containerd/errdefs/LICENSE ================================================ Apache License Version 2.0, January 2004 https://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS Copyright The containerd Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: vendor/github.com/containerd/errdefs/README.md ================================================ # errdefs A Go package for defining and checking common containerd errors. ## Project details **errdefs** is a containerd sub-project, licensed under the [Apache 2.0 license](./LICENSE). As a containerd sub-project, you will find the: * [Project governance](https://github.com/containerd/project/blob/main/GOVERNANCE.md), * [Maintainers](https://github.com/containerd/project/blob/main/MAINTAINERS), * and [Contributing guidelines](https://github.com/containerd/project/blob/main/CONTRIBUTING.md) information in our [`containerd/project`](https://github.com/containerd/project) repository. ================================================ FILE: vendor/github.com/containerd/errdefs/errors.go ================================================ /* Copyright The containerd Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Package errdefs defines the common errors used throughout containerd // packages. // // Use with fmt.Errorf to add context to an error. // // To detect an error class, use the IsXXX functions to tell whether an error // is of a certain type. package errdefs import ( "context" "errors" ) // Definitions of common error types used throughout containerd. All containerd // errors returned by most packages will map into one of these errors classes. // Packages should return errors of these types when they want to instruct a // client to take a particular action. // // These errors map closely to grpc errors. var ( ErrUnknown = errUnknown{} ErrInvalidArgument = errInvalidArgument{} ErrNotFound = errNotFound{} ErrAlreadyExists = errAlreadyExists{} ErrPermissionDenied = errPermissionDenied{} ErrResourceExhausted = errResourceExhausted{} ErrFailedPrecondition = errFailedPrecondition{} ErrConflict = errConflict{} ErrNotModified = errNotModified{} ErrAborted = errAborted{} ErrOutOfRange = errOutOfRange{} ErrNotImplemented = errNotImplemented{} ErrInternal = errInternal{} ErrUnavailable = errUnavailable{} ErrDataLoss = errDataLoss{} ErrUnauthenticated = errUnauthorized{} ) // cancelled maps to Moby's "ErrCancelled" type cancelled interface { Cancelled() } // IsCanceled returns true if the error is due to `context.Canceled`. func IsCanceled(err error) bool { return errors.Is(err, context.Canceled) || isInterface[cancelled](err) } type errUnknown struct{} func (errUnknown) Error() string { return "unknown" } func (errUnknown) Unknown() {} func (e errUnknown) WithMessage(msg string) error { return customMessage{e, msg} } // unknown maps to Moby's "ErrUnknown" type unknown interface { Unknown() } // IsUnknown returns true if the error is due to an unknown error, // unhandled condition or unexpected response. func IsUnknown(err error) bool { return errors.Is(err, errUnknown{}) || isInterface[unknown](err) } type errInvalidArgument struct{} func (errInvalidArgument) Error() string { return "invalid argument" } func (errInvalidArgument) InvalidParameter() {} func (e errInvalidArgument) WithMessage(msg string) error { return customMessage{e, msg} } // invalidParameter maps to Moby's "ErrInvalidParameter" type invalidParameter interface { InvalidParameter() } // IsInvalidArgument returns true if the error is due to an invalid argument func IsInvalidArgument(err error) bool { return errors.Is(err, ErrInvalidArgument) || isInterface[invalidParameter](err) } // deadlineExceed maps to Moby's "ErrDeadline" type deadlineExceeded interface { DeadlineExceeded() } // IsDeadlineExceeded returns true if the error is due to // `context.DeadlineExceeded`. func IsDeadlineExceeded(err error) bool { return errors.Is(err, context.DeadlineExceeded) || isInterface[deadlineExceeded](err) } type errNotFound struct{} func (errNotFound) Error() string { return "not found" } func (errNotFound) NotFound() {} func (e errNotFound) WithMessage(msg string) error { return customMessage{e, msg} } // notFound maps to Moby's "ErrNotFound" type notFound interface { NotFound() } // IsNotFound returns true if the error is due to a missing object func IsNotFound(err error) bool { return errors.Is(err, ErrNotFound) || isInterface[notFound](err) } type errAlreadyExists struct{} func (errAlreadyExists) Error() string { return "already exists" } func (errAlreadyExists) AlreadyExists() {} func (e errAlreadyExists) WithMessage(msg string) error { return customMessage{e, msg} } type alreadyExists interface { AlreadyExists() } // IsAlreadyExists returns true if the error is due to an already existing // metadata item func IsAlreadyExists(err error) bool { return errors.Is(err, ErrAlreadyExists) || isInterface[alreadyExists](err) } type errPermissionDenied struct{} func (errPermissionDenied) Error() string { return "permission denied" } func (errPermissionDenied) Forbidden() {} func (e errPermissionDenied) WithMessage(msg string) error { return customMessage{e, msg} } // forbidden maps to Moby's "ErrForbidden" type forbidden interface { Forbidden() } // IsPermissionDenied returns true if the error is due to permission denied // or forbidden (403) response func IsPermissionDenied(err error) bool { return errors.Is(err, ErrPermissionDenied) || isInterface[forbidden](err) } type errResourceExhausted struct{} func (errResourceExhausted) Error() string { return "resource exhausted" } func (errResourceExhausted) ResourceExhausted() {} func (e errResourceExhausted) WithMessage(msg string) error { return customMessage{e, msg} } type resourceExhausted interface { ResourceExhausted() } // IsResourceExhausted returns true if the error is due to // a lack of resources or too many attempts. func IsResourceExhausted(err error) bool { return errors.Is(err, errResourceExhausted{}) || isInterface[resourceExhausted](err) } type errFailedPrecondition struct{} func (e errFailedPrecondition) Error() string { return "failed precondition" } func (errFailedPrecondition) FailedPrecondition() {} func (e errFailedPrecondition) WithMessage(msg string) error { return customMessage{e, msg} } type failedPrecondition interface { FailedPrecondition() } // IsFailedPrecondition returns true if an operation could not proceed due to // the lack of a particular condition func IsFailedPrecondition(err error) bool { return errors.Is(err, errFailedPrecondition{}) || isInterface[failedPrecondition](err) } type errConflict struct{} func (errConflict) Error() string { return "conflict" } func (errConflict) Conflict() {} func (e errConflict) WithMessage(msg string) error { return customMessage{e, msg} } // conflict maps to Moby's "ErrConflict" type conflict interface { Conflict() } // IsConflict returns true if an operation could not proceed due to // a conflict. func IsConflict(err error) bool { return errors.Is(err, errConflict{}) || isInterface[conflict](err) } type errNotModified struct{} func (errNotModified) Error() string { return "not modified" } func (errNotModified) NotModified() {} func (e errNotModified) WithMessage(msg string) error { return customMessage{e, msg} } // notModified maps to Moby's "ErrNotModified" type notModified interface { NotModified() } // IsNotModified returns true if an operation could not proceed due // to an object not modified from a previous state. func IsNotModified(err error) bool { return errors.Is(err, errNotModified{}) || isInterface[notModified](err) } type errAborted struct{} func (errAborted) Error() string { return "aborted" } func (errAborted) Aborted() {} func (e errAborted) WithMessage(msg string) error { return customMessage{e, msg} } type aborted interface { Aborted() } // IsAborted returns true if an operation was aborted. func IsAborted(err error) bool { return errors.Is(err, errAborted{}) || isInterface[aborted](err) } type errOutOfRange struct{} func (errOutOfRange) Error() string { return "out of range" } func (errOutOfRange) OutOfRange() {} func (e errOutOfRange) WithMessage(msg string) error { return customMessage{e, msg} } type outOfRange interface { OutOfRange() } // IsOutOfRange returns true if an operation could not proceed due // to data being out of the expected range. func IsOutOfRange(err error) bool { return errors.Is(err, errOutOfRange{}) || isInterface[outOfRange](err) } type errNotImplemented struct{} func (errNotImplemented) Error() string { return "not implemented" } func (errNotImplemented) NotImplemented() {} func (e errNotImplemented) WithMessage(msg string) error { return customMessage{e, msg} } // notImplemented maps to Moby's "ErrNotImplemented" type notImplemented interface { NotImplemented() } // IsNotImplemented returns true if the error is due to not being implemented func IsNotImplemented(err error) bool { return errors.Is(err, errNotImplemented{}) || isInterface[notImplemented](err) } type errInternal struct{} func (errInternal) Error() string { return "internal" } func (errInternal) System() {} func (e errInternal) WithMessage(msg string) error { return customMessage{e, msg} } // system maps to Moby's "ErrSystem" type system interface { System() } // IsInternal returns true if the error returns to an internal or system error func IsInternal(err error) bool { return errors.Is(err, errInternal{}) || isInterface[system](err) } type errUnavailable struct{} func (errUnavailable) Error() string { return "unavailable" } func (errUnavailable) Unavailable() {} func (e errUnavailable) WithMessage(msg string) error { return customMessage{e, msg} } // unavailable maps to Moby's "ErrUnavailable" type unavailable interface { Unavailable() } // IsUnavailable returns true if the error is due to a resource being unavailable func IsUnavailable(err error) bool { return errors.Is(err, errUnavailable{}) || isInterface[unavailable](err) } type errDataLoss struct{} func (errDataLoss) Error() string { return "data loss" } func (errDataLoss) DataLoss() {} func (e errDataLoss) WithMessage(msg string) error { return customMessage{e, msg} } // dataLoss maps to Moby's "ErrDataLoss" type dataLoss interface { DataLoss() } // IsDataLoss returns true if data during an operation was lost or corrupted func IsDataLoss(err error) bool { return errors.Is(err, errDataLoss{}) || isInterface[dataLoss](err) } type errUnauthorized struct{} func (errUnauthorized) Error() string { return "unauthorized" } func (errUnauthorized) Unauthorized() {} func (e errUnauthorized) WithMessage(msg string) error { return customMessage{e, msg} } // unauthorized maps to Moby's "ErrUnauthorized" type unauthorized interface { Unauthorized() } // IsUnauthorized returns true if the error indicates that the user was // unauthenticated or unauthorized. func IsUnauthorized(err error) bool { return errors.Is(err, errUnauthorized{}) || isInterface[unauthorized](err) } func isInterface[T any](err error) bool { for { switch x := err.(type) { case T: return true case customMessage: err = x.err case interface{ Unwrap() error }: err = x.Unwrap() if err == nil { return false } case interface{ Unwrap() []error }: for _, err := range x.Unwrap() { if isInterface[T](err) { return true } } return false default: return false } } } // customMessage is used to provide a defined error with a custom message. // The message is not wrapped but can be compared by the `Is(error) bool` interface. type customMessage struct { err error msg string } func (c customMessage) Is(err error) bool { return c.err == err } func (c customMessage) As(target any) bool { return errors.As(c.err, target) } func (c customMessage) Error() string { return c.msg } ================================================ FILE: vendor/github.com/containerd/errdefs/pkg/LICENSE ================================================ Apache License Version 2.0, January 2004 https://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS Copyright The containerd Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: vendor/github.com/containerd/errdefs/pkg/errhttp/http.go ================================================ /* Copyright The containerd Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Package errhttp provides utility functions for translating errors to // and from a HTTP context. // // The functions ToHTTP and ToNative can be used to map server-side and // client-side errors to the correct types. package errhttp import ( "errors" "net/http" "github.com/containerd/errdefs" "github.com/containerd/errdefs/pkg/internal/cause" ) // ToHTTP returns the best status code for the given error func ToHTTP(err error) int { switch { case errdefs.IsNotFound(err): return http.StatusNotFound case errdefs.IsInvalidArgument(err): return http.StatusBadRequest case errdefs.IsConflict(err): return http.StatusConflict case errdefs.IsNotModified(err): return http.StatusNotModified case errdefs.IsFailedPrecondition(err): return http.StatusPreconditionFailed case errdefs.IsUnauthorized(err): return http.StatusUnauthorized case errdefs.IsPermissionDenied(err): return http.StatusForbidden case errdefs.IsResourceExhausted(err): return http.StatusTooManyRequests case errdefs.IsInternal(err): return http.StatusInternalServerError case errdefs.IsNotImplemented(err): return http.StatusNotImplemented case errdefs.IsUnavailable(err): return http.StatusServiceUnavailable case errdefs.IsUnknown(err): var unexpected cause.ErrUnexpectedStatus if errors.As(err, &unexpected) && unexpected.Status >= 200 && unexpected.Status < 600 { return unexpected.Status } return http.StatusInternalServerError default: return http.StatusInternalServerError } } // ToNative returns the error best matching the HTTP status code func ToNative(statusCode int) error { switch statusCode { case http.StatusNotFound: return errdefs.ErrNotFound case http.StatusBadRequest: return errdefs.ErrInvalidArgument case http.StatusConflict: return errdefs.ErrConflict case http.StatusPreconditionFailed: return errdefs.ErrFailedPrecondition case http.StatusUnauthorized: return errdefs.ErrUnauthenticated case http.StatusForbidden: return errdefs.ErrPermissionDenied case http.StatusNotModified: return errdefs.ErrNotModified case http.StatusTooManyRequests: return errdefs.ErrResourceExhausted case http.StatusInternalServerError: return errdefs.ErrInternal case http.StatusNotImplemented: return errdefs.ErrNotImplemented case http.StatusServiceUnavailable: return errdefs.ErrUnavailable default: return cause.ErrUnexpectedStatus{Status: statusCode} } } ================================================ FILE: vendor/github.com/containerd/errdefs/pkg/internal/cause/cause.go ================================================ /* Copyright The containerd Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Package cause is used to define root causes for errors // common to errors packages like grpc and http. package cause import "fmt" type ErrUnexpectedStatus struct { Status int } const UnexpectedStatusPrefix = "unexpected status " func (e ErrUnexpectedStatus) Error() string { return fmt.Sprintf("%s%d", UnexpectedStatusPrefix, e.Status) } func (ErrUnexpectedStatus) Unknown() {} ================================================ FILE: vendor/github.com/containerd/errdefs/resolve.go ================================================ /* Copyright The containerd Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package errdefs import "context" // Resolve returns the first error found in the error chain which matches an // error defined in this package or context error. A raw, unwrapped error is // returned or ErrUnknown if no matching error is found. // // This is useful for determining a response code based on the outermost wrapped // error rather than the original cause. For example, a not found error deep // in the code may be wrapped as an invalid argument. When determining status // code from Is* functions, the depth or ordering of the error is not // considered. // // The search order is depth first, a wrapped error returned from any part of // the chain from `Unwrap() error` will be returned before any joined errors // as returned by `Unwrap() []error`. func Resolve(err error) error { if err == nil { return nil } err = firstError(err) if err == nil { err = ErrUnknown } return err } func firstError(err error) error { for { switch err { case ErrUnknown, ErrInvalidArgument, ErrNotFound, ErrAlreadyExists, ErrPermissionDenied, ErrResourceExhausted, ErrFailedPrecondition, ErrConflict, ErrNotModified, ErrAborted, ErrOutOfRange, ErrNotImplemented, ErrInternal, ErrUnavailable, ErrDataLoss, ErrUnauthenticated, context.DeadlineExceeded, context.Canceled: return err } switch e := err.(type) { case customMessage: err = e.err case unknown: return ErrUnknown case invalidParameter: return ErrInvalidArgument case notFound: return ErrNotFound case alreadyExists: return ErrAlreadyExists case forbidden: return ErrPermissionDenied case resourceExhausted: return ErrResourceExhausted case failedPrecondition: return ErrFailedPrecondition case conflict: return ErrConflict case notModified: return ErrNotModified case aborted: return ErrAborted case errOutOfRange: return ErrOutOfRange case notImplemented: return ErrNotImplemented case system: return ErrInternal case unavailable: return ErrUnavailable case dataLoss: return ErrDataLoss case unauthorized: return ErrUnauthenticated case deadlineExceeded: return context.DeadlineExceeded case cancelled: return context.Canceled case interface{ Unwrap() error }: err = e.Unwrap() if err == nil { return nil } case interface{ Unwrap() []error }: for _, ue := range e.Unwrap() { if fe := firstError(ue); fe != nil { return fe } } return nil case interface{ Is(error) bool }: for _, target := range []error{ErrUnknown, ErrInvalidArgument, ErrNotFound, ErrAlreadyExists, ErrPermissionDenied, ErrResourceExhausted, ErrFailedPrecondition, ErrConflict, ErrNotModified, ErrAborted, ErrOutOfRange, ErrNotImplemented, ErrInternal, ErrUnavailable, ErrDataLoss, ErrUnauthenticated, context.DeadlineExceeded, context.Canceled} { if e.Is(target) { return target } } return nil default: return nil } } } ================================================ FILE: vendor/github.com/containerd/stargz-snapshotter/estargz/LICENSE ================================================ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: vendor/github.com/containerd/stargz-snapshotter/estargz/build.go ================================================ /* Copyright The containerd Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Copyright 2019 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. */ package estargz import ( "archive/tar" "bytes" "compress/gzip" "context" "errors" "fmt" "io" "os" "path" "runtime" "strings" "sync" "sync/atomic" "github.com/containerd/stargz-snapshotter/estargz/errorutil" "github.com/klauspost/compress/zstd" digest "github.com/opencontainers/go-digest" "golang.org/x/sync/errgroup" ) type GzipHelperFunc func(io.Reader) (io.ReadCloser, error) type options struct { chunkSize int compressionLevel int prioritizedFiles []string missedPrioritizedFiles *[]string compression Compression ctx context.Context minChunkSize int gzipHelperFunc GzipHelperFunc } type Option func(o *options) error // WithChunkSize option specifies the chunk size of eStargz blob to build. func WithChunkSize(chunkSize int) Option { return func(o *options) error { o.chunkSize = chunkSize return nil } } // WithCompressionLevel option specifies the gzip compression level. // The default is gzip.BestCompression. // This option will be ignored if WithCompression option is used. // See also: https://godoc.org/compress/gzip#pkg-constants func WithCompressionLevel(level int) Option { return func(o *options) error { o.compressionLevel = level return nil } } // WithPrioritizedFiles option specifies the list of prioritized files. // These files must be complete paths that are absolute or relative to "/" // For example, all of "foo/bar", "/foo/bar", "./foo/bar" and "../foo/bar" // are treated as "/foo/bar". func WithPrioritizedFiles(files []string) Option { return func(o *options) error { o.prioritizedFiles = files return nil } } // WithAllowPrioritizeNotFound makes Build continue the execution even if some // of prioritized files specified by WithPrioritizedFiles option aren't found // in the input tar. Instead, this records all missed file names to the passed // slice. func WithAllowPrioritizeNotFound(missedFiles *[]string) Option { return func(o *options) error { if missedFiles == nil { return fmt.Errorf("WithAllowPrioritizeNotFound: slice must be passed") } o.missedPrioritizedFiles = missedFiles return nil } } // WithCompression specifies compression algorithm to be used. // Default is gzip. func WithCompression(compression Compression) Option { return func(o *options) error { o.compression = compression return nil } } // WithContext specifies a context that can be used for clean canceleration. func WithContext(ctx context.Context) Option { return func(o *options) error { o.ctx = ctx return nil } } // WithMinChunkSize option specifies the minimal number of bytes of data // must be written in one gzip stream. // By increasing this number, one gzip stream can contain multiple files // and it hopefully leads to smaller result blob. // NOTE: This adds a TOC property that old reader doesn't understand. func WithMinChunkSize(minChunkSize int) Option { return func(o *options) error { o.minChunkSize = minChunkSize return nil } } // WithGzipHelperFunc option specifies a custom function to decompress gzip-compressed layers. // When a gzip-compressed layer is detected, this function will be used instead of the // Go standard library gzip decompression for better performance. // The function should take an io.Reader as input and return an io.ReadCloser. // If nil, the Go standard library gzip.NewReader will be used. func WithGzipHelperFunc(gzipHelperFunc GzipHelperFunc) Option { return func(o *options) error { o.gzipHelperFunc = gzipHelperFunc return nil } } // Blob is an eStargz blob. type Blob struct { io.ReadCloser diffID digest.Digester tocDigest digest.Digest readCompleted *atomic.Bool uncompressedSize *atomic.Int64 } // DiffID returns the digest of uncompressed blob. // It is only valid to call DiffID after Close. func (b *Blob) DiffID() digest.Digest { return b.diffID.Digest() } // TOCDigest returns the digest of uncompressed TOC JSON. func (b *Blob) TOCDigest() digest.Digest { return b.tocDigest } // UncompressedSize returns the size of uncompressed blob. // UncompressedSize should only be called after the blob has been fully read. func (b *Blob) UncompressedSize() (int64, error) { switch { case b.uncompressedSize == nil || b.readCompleted == nil: return -1, fmt.Errorf("readCompleted or uncompressedSize is not initialized") case !b.readCompleted.Load(): return -1, fmt.Errorf("called UncompressedSize before the blob has been fully read") default: return b.uncompressedSize.Load(), nil } } // Build builds an eStargz blob which is an extended version of stargz, from a blob (gzip, zstd // or plain tar) passed through the argument. If there are some prioritized files are listed in // the option, these files are grouped as "prioritized" and can be used for runtime optimization // (e.g. prefetch). This function builds a blob in parallel, with dividing that blob into several // (at least the number of runtime.GOMAXPROCS(0)) sub-blobs. func Build(tarBlob *io.SectionReader, opt ...Option) (_ *Blob, rErr error) { var opts options opts.compressionLevel = gzip.BestCompression // BestCompression by default for _, o := range opt { if err := o(&opts); err != nil { return nil, err } } if opts.compression == nil { opts.compression = newGzipCompressionWithLevel(opts.compressionLevel) } layerFiles := newTempFiles() ctx := opts.ctx if ctx == nil { ctx = context.Background() } done := make(chan struct{}) defer close(done) go func() { select { case <-done: // nop case <-ctx.Done(): layerFiles.CleanupAll() } }() defer func() { if rErr != nil { if err := layerFiles.CleanupAll(); err != nil { rErr = fmt.Errorf("failed to cleanup tmp files: %v: %w", err, rErr) } } if cErr := ctx.Err(); cErr != nil { rErr = fmt.Errorf("error from context %q: %w", cErr, rErr) } }() tarBlob, err := decompressBlob(tarBlob, layerFiles, opts.gzipHelperFunc) if err != nil { return nil, err } entries, err := sortEntries(tarBlob, opts.prioritizedFiles, opts.missedPrioritizedFiles) if err != nil { return nil, err } var tarParts [][]*entry if opts.minChunkSize > 0 { // Each entry needs to know the size of the current gzip stream so they // cannot be processed in parallel. tarParts = [][]*entry{entries} } else { tarParts = divideEntries(entries, runtime.GOMAXPROCS(0)) } writers := make([]*Writer, len(tarParts)) payloads := make([]*os.File, len(tarParts)) var mu sync.Mutex var eg errgroup.Group for i, parts := range tarParts { i, parts := i, parts // builds verifiable stargz sub-blobs eg.Go(func() error { esgzFile, err := layerFiles.TempFile("", "esgzdata") if err != nil { return err } sw := NewWriterWithCompressor(esgzFile, opts.compression) sw.ChunkSize = opts.chunkSize sw.MinChunkSize = opts.minChunkSize if sw.needsOpenGzEntries == nil { sw.needsOpenGzEntries = make(map[string]struct{}) } for _, f := range []string{PrefetchLandmark, NoPrefetchLandmark} { sw.needsOpenGzEntries[f] = struct{}{} } if err := sw.AppendTar(readerFromEntries(parts...)); err != nil { return err } mu.Lock() writers[i] = sw payloads[i] = esgzFile mu.Unlock() return nil }) } if err := eg.Wait(); err != nil { rErr = err return nil, err } tocAndFooter, tocDgst, err := closeWithCombine(writers...) if err != nil { rErr = err return nil, err } var rs []io.Reader for _, p := range payloads { fs, err := fileSectionReader(p) if err != nil { return nil, err } rs = append(rs, fs) } diffID := digest.Canonical.Digester() pr, pw := io.Pipe() readCompleted := new(atomic.Bool) uncompressedSize := new(atomic.Int64) go func() { var size int64 var decompressFunc func(io.Reader) (io.ReadCloser, error) if _, ok := opts.compression.(*gzipCompression); ok && opts.gzipHelperFunc != nil { decompressFunc = opts.gzipHelperFunc } else { decompressFunc = opts.compression.Reader } decompressR, err := decompressFunc(io.TeeReader(io.MultiReader(append(rs, tocAndFooter)...), pw)) if err != nil { pw.CloseWithError(err) return } defer decompressR.Close() if size, err = io.Copy(diffID.Hash(), decompressR); err != nil { pw.CloseWithError(err) return } uncompressedSize.Store(size) readCompleted.Store(true) pw.Close() }() return &Blob{ ReadCloser: readCloser{ Reader: pr, closeFunc: layerFiles.CleanupAll, }, tocDigest: tocDgst, diffID: diffID, readCompleted: readCompleted, uncompressedSize: uncompressedSize, }, nil } // closeWithCombine takes unclosed Writers and close them. This also returns the // toc that combined all Writers into. // Writers doesn't write TOC and footer to the underlying writers so they can be // combined into a single eStargz and tocAndFooter returned by this function can // be appended at the tail of that combined blob. func closeWithCombine(ws ...*Writer) (tocAndFooterR io.Reader, tocDgst digest.Digest, err error) { if len(ws) == 0 { return nil, "", fmt.Errorf("at least one writer must be passed") } for _, w := range ws { if w.closed { return nil, "", fmt.Errorf("writer must be unclosed") } defer func(w *Writer) { w.closed = true }(w) if err := w.closeGz(); err != nil { return nil, "", err } if err := w.bw.Flush(); err != nil { return nil, "", err } } var ( mtoc = new(JTOC) currentOffset int64 ) mtoc.Version = ws[0].toc.Version for _, w := range ws { for _, e := range w.toc.Entries { // Recalculate Offset of non-empty files/chunks if (e.Type == "reg" && e.Size > 0) || e.Type == "chunk" { e.Offset += currentOffset } mtoc.Entries = append(mtoc.Entries, e) } if w.toc.Version > mtoc.Version { mtoc.Version = w.toc.Version } currentOffset += w.cw.n } return tocAndFooter(ws[0].compressor, mtoc, currentOffset) } func tocAndFooter(compressor Compressor, toc *JTOC, offset int64) (io.Reader, digest.Digest, error) { buf := new(bytes.Buffer) tocDigest, err := compressor.WriteTOCAndFooter(buf, offset, toc, nil) if err != nil { return nil, "", err } return buf, tocDigest, nil } // divideEntries divides passed entries to the parts at least the number specified by the // argument. func divideEntries(entries []*entry, minPartsNum int) (set [][]*entry) { var estimatedSize int64 for _, e := range entries { estimatedSize += e.header.Size } unitSize := estimatedSize / int64(minPartsNum) var ( nextEnd = unitSize offset int64 ) set = append(set, []*entry{}) for _, e := range entries { set[len(set)-1] = append(set[len(set)-1], e) offset += e.header.Size if offset > nextEnd { set = append(set, []*entry{}) nextEnd += unitSize } } return } var errNotFound = errors.New("not found") // sortEntries reads the specified tar blob and returns a list of tar entries. // If some of prioritized files are specified, the list starts from these // files with keeping the order specified by the argument. func sortEntries(in io.ReaderAt, prioritized []string, missedPrioritized *[]string) ([]*entry, error) { // Import tar file. intar, err := importTar(in) if err != nil { return nil, fmt.Errorf("failed to sort: %w", err) } // Sort the tar file respecting to the prioritized files list. sorted := &tarFile{} picked := make(map[string]struct{}) for _, l := range prioritized { if err := moveRec(l, intar, sorted, picked); err != nil { if errors.Is(err, errNotFound) && missedPrioritized != nil { *missedPrioritized = append(*missedPrioritized, l) continue // allow not found } return nil, fmt.Errorf("failed to sort tar entries: %w", err) } } if len(prioritized) == 0 { sorted.add(&entry{ header: &tar.Header{ Name: NoPrefetchLandmark, Typeflag: tar.TypeReg, Size: int64(len([]byte{landmarkContents})), }, payload: bytes.NewReader([]byte{landmarkContents}), }) } else { sorted.add(&entry{ header: &tar.Header{ Name: PrefetchLandmark, Typeflag: tar.TypeReg, Size: int64(len([]byte{landmarkContents})), }, payload: bytes.NewReader([]byte{landmarkContents}), }) } // Dump prioritized entries followed by the rest entries while skipping picked ones. return append(sorted.dump(nil), intar.dump(picked)...), nil } // readerFromEntries returns a reader of tar archive that contains entries passed // through the arguments. func readerFromEntries(entries ...*entry) io.Reader { pr, pw := io.Pipe() go func() { tw := tar.NewWriter(pw) defer tw.Close() for _, entry := range entries { if err := tw.WriteHeader(entry.header); err != nil { pw.CloseWithError(fmt.Errorf("failed to write tar header: %v", err)) return } if _, err := io.Copy(tw, entry.payload); err != nil { pw.CloseWithError(fmt.Errorf("failed to write tar payload: %v", err)) return } } pw.Close() }() return pr } func importTar(in io.ReaderAt) (*tarFile, error) { tf := &tarFile{} pw, err := newCountReadSeeker(in) if err != nil { return nil, fmt.Errorf("failed to make position watcher: %w", err) } tr := tar.NewReader(pw) // Walk through all nodes. for { // Fetch and parse next header. h, err := tr.Next() if err != nil { if err == io.EOF { break } return nil, fmt.Errorf("failed to parse tar file, %w", err) } switch cleanEntryName(h.Name) { case PrefetchLandmark, NoPrefetchLandmark: // Ignore existing landmark continue } // Add entry. If it already exists, replace it. if _, ok := tf.get(h.Name); ok { tf.remove(h.Name) } tf.add(&entry{ header: h, payload: io.NewSectionReader(in, pw.currentPos(), h.Size), }) } return tf, nil } func moveRec(name string, in *tarFile, out *tarFile, picked map[string]struct{}) error { name = cleanEntryName(name) if name == "" { // root directory. stop recursion. if e, ok := in.get(name); ok { // entry of the root directory exists. we should move it as well. // this case will occur if tar entries are prefixed with "./", "/", etc. if _, done := picked[name]; !done { out.add(e) picked[name] = struct{}{} } } return nil } _, okIn := in.get(name) _, okOut := out.get(name) _, okPicked := picked[name] if !okIn && !okOut && !okPicked { return fmt.Errorf("file: %q: %w", name, errNotFound) } parent, _ := path.Split(strings.TrimSuffix(name, "/")) if err := moveRec(parent, in, out, picked); err != nil { return err } if e, ok := in.get(name); ok && e.header.Typeflag == tar.TypeLink { if err := moveRec(e.header.Linkname, in, out, picked); err != nil { return err } } if _, done := picked[name]; done { return nil } if e, ok := in.get(name); ok { out.add(e) picked[name] = struct{}{} } return nil } type entry struct { header *tar.Header payload io.ReadSeeker } type tarFile struct { index map[string]*entry stream []*entry } func (f *tarFile) add(e *entry) { if f.index == nil { f.index = make(map[string]*entry) } f.index[cleanEntryName(e.header.Name)] = e f.stream = append(f.stream, e) } func (f *tarFile) remove(name string) { name = cleanEntryName(name) if f.index != nil { delete(f.index, name) } var filtered []*entry for _, e := range f.stream { if cleanEntryName(e.header.Name) == name { continue } filtered = append(filtered, e) } f.stream = filtered } func (f *tarFile) get(name string) (e *entry, ok bool) { if f.index == nil { return nil, false } e, ok = f.index[cleanEntryName(name)] return } func (f *tarFile) dump(skip map[string]struct{}) []*entry { if len(skip) == 0 { return f.stream } var out []*entry for _, e := range f.stream { if _, ok := skip[cleanEntryName(e.header.Name)]; ok { continue } out = append(out, e) } return out } type readCloser struct { io.Reader closeFunc func() error } func (rc readCloser) Close() error { return rc.closeFunc() } func fileSectionReader(file *os.File) (*io.SectionReader, error) { info, err := file.Stat() if err != nil { return nil, err } return io.NewSectionReader(file, 0, info.Size()), nil } func newTempFiles() *tempFiles { return &tempFiles{} } type tempFiles struct { files []*os.File filesMu sync.Mutex cleanupOnce sync.Once } func (tf *tempFiles) TempFile(dir, pattern string) (*os.File, error) { f, err := os.CreateTemp(dir, pattern) if err != nil { return nil, err } tf.filesMu.Lock() tf.files = append(tf.files, f) tf.filesMu.Unlock() return f, nil } func (tf *tempFiles) CleanupAll() (err error) { tf.cleanupOnce.Do(func() { err = tf.cleanupAll() }) return } func (tf *tempFiles) cleanupAll() error { tf.filesMu.Lock() defer tf.filesMu.Unlock() var allErr []error for _, f := range tf.files { if err := f.Close(); err != nil { allErr = append(allErr, err) } if err := os.Remove(f.Name()); err != nil { allErr = append(allErr, err) } } tf.files = nil return errorutil.Aggregate(allErr) } func newCountReadSeeker(r io.ReaderAt) (*countReadSeeker, error) { pos := int64(0) return &countReadSeeker{r: r, cPos: &pos}, nil } type countReadSeeker struct { r io.ReaderAt cPos *int64 mu sync.Mutex } func (cr *countReadSeeker) Read(p []byte) (int, error) { cr.mu.Lock() defer cr.mu.Unlock() n, err := cr.r.ReadAt(p, *cr.cPos) if err == nil { *cr.cPos += int64(n) } return n, err } func (cr *countReadSeeker) Seek(offset int64, whence int) (int64, error) { cr.mu.Lock() defer cr.mu.Unlock() switch whence { default: return 0, fmt.Errorf("unknown whence: %v", whence) case io.SeekStart: case io.SeekCurrent: offset += *cr.cPos case io.SeekEnd: return 0, fmt.Errorf("unsupported whence: %v", whence) } if offset < 0 { return 0, fmt.Errorf("invalid offset") } *cr.cPos = offset return offset, nil } func (cr *countReadSeeker) currentPos() int64 { cr.mu.Lock() defer cr.mu.Unlock() return *cr.cPos } func decompressBlob(org *io.SectionReader, tmp *tempFiles, gzipHelperFunc GzipHelperFunc) (*io.SectionReader, error) { if org.Size() < 4 { return org, nil } src := make([]byte, 4) if _, err := org.Read(src); err != nil && err != io.EOF { return nil, err } var dR io.Reader if bytes.Equal([]byte{0x1F, 0x8B, 0x08}, src[:3]) { // gzip var dgR io.ReadCloser var err error if gzipHelperFunc != nil { dgR, err = gzipHelperFunc(io.NewSectionReader(org, 0, org.Size())) } else { dgR, err = gzip.NewReader(io.NewSectionReader(org, 0, org.Size())) } if err != nil { return nil, err } defer dgR.Close() dR = io.Reader(dgR) } else if bytes.Equal([]byte{0x28, 0xb5, 0x2f, 0xfd}, src[:4]) { // zstd dzR, err := zstd.NewReader(io.NewSectionReader(org, 0, org.Size())) if err != nil { return nil, err } defer dzR.Close() dR = io.Reader(dzR) } else { // uncompressed return io.NewSectionReader(org, 0, org.Size()), nil } b, err := tmp.TempFile("", "uncompresseddata") if err != nil { return nil, err } if _, err := io.Copy(b, dR); err != nil { return nil, err } return fileSectionReader(b) } ================================================ FILE: vendor/github.com/containerd/stargz-snapshotter/estargz/errorutil/errors.go ================================================ /* Copyright The containerd Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package errorutil import ( "errors" "fmt" "strings" ) // Aggregate combines a list of errors into a single new error. func Aggregate(errs []error) error { switch len(errs) { case 0: return nil case 1: return errs[0] default: points := make([]string, len(errs)+1) points[0] = fmt.Sprintf("%d error(s) occurred:", len(errs)) for i, err := range errs { points[i+1] = fmt.Sprintf("* %s", err) } return errors.New(strings.Join(points, "\n\t")) } } ================================================ FILE: vendor/github.com/containerd/stargz-snapshotter/estargz/estargz.go ================================================ /* Copyright The containerd Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Copyright 2019 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. */ package estargz import ( "bufio" "bytes" "compress/gzip" "crypto/sha256" "errors" "fmt" "hash" "io" "os" "path" "sort" "strings" "sync" "time" "github.com/containerd/stargz-snapshotter/estargz/errorutil" digest "github.com/opencontainers/go-digest" "github.com/vbatts/tar-split/archive/tar" ) // A Reader permits random access reads from a stargz file. type Reader struct { sr *io.SectionReader toc *JTOC tocDigest digest.Digest // m stores all non-chunk entries, keyed by name. m map[string]*TOCEntry // chunks stores all TOCEntry values for regular files that // are split up. For a file with a single chunk, it's only // stored in m. chunks map[string][]*TOCEntry decompressor Decompressor } type openOpts struct { tocOffset int64 decompressors []Decompressor telemetry *Telemetry } // OpenOption is an option used during opening the layer type OpenOption func(o *openOpts) error // WithTOCOffset option specifies the offset of TOC func WithTOCOffset(tocOffset int64) OpenOption { return func(o *openOpts) error { o.tocOffset = tocOffset return nil } } // WithDecompressors option specifies decompressors to use. // Default is gzip-based decompressor. func WithDecompressors(decompressors ...Decompressor) OpenOption { return func(o *openOpts) error { o.decompressors = decompressors return nil } } // WithTelemetry option specifies the telemetry hooks func WithTelemetry(telemetry *Telemetry) OpenOption { return func(o *openOpts) error { o.telemetry = telemetry return nil } } // MeasureLatencyHook is a func which takes start time and records the diff type MeasureLatencyHook func(time.Time) // Telemetry is a struct which defines telemetry hooks. By implementing these hooks you should be able to record // the latency metrics of the respective steps of estargz open operation. To be used with estargz.OpenWithTelemetry(...) type Telemetry struct { GetFooterLatency MeasureLatencyHook // measure time to get stargz footer (in milliseconds) GetTocLatency MeasureLatencyHook // measure time to GET TOC JSON (in milliseconds) DeserializeTocLatency MeasureLatencyHook // measure time to deserialize TOC JSON (in milliseconds) } // Open opens a stargz file for reading. // The behavior is configurable using options. // // Note that each entry name is normalized as the path that is relative to root. func Open(sr *io.SectionReader, opt ...OpenOption) (*Reader, error) { var opts openOpts for _, o := range opt { if err := o(&opts); err != nil { return nil, err } } gzipCompressors := []Decompressor{new(GzipDecompressor), new(LegacyGzipDecompressor)} decompressors := append(gzipCompressors, opts.decompressors...) // Determine the size to fetch. Try to fetch as many bytes as possible. fetchSize := maxFooterSize(sr.Size(), decompressors...) if maybeTocOffset := opts.tocOffset; maybeTocOffset > fetchSize { if maybeTocOffset > sr.Size() { return nil, fmt.Errorf("blob size %d is smaller than the toc offset", sr.Size()) } fetchSize = sr.Size() - maybeTocOffset } start := time.Now() // before getting layer footer footer := make([]byte, fetchSize) if _, err := sr.ReadAt(footer, sr.Size()-fetchSize); err != nil { return nil, fmt.Errorf("error reading footer: %v", err) } if opts.telemetry != nil && opts.telemetry.GetFooterLatency != nil { opts.telemetry.GetFooterLatency(start) } var allErr []error var found bool var r *Reader for _, d := range decompressors { fSize := d.FooterSize() fOffset := positive(int64(len(footer)) - fSize) maybeTocBytes := footer[:fOffset] _, tocOffset, tocSize, err := d.ParseFooter(footer[fOffset:]) if err != nil { allErr = append(allErr, err) continue } if tocOffset >= 0 && tocSize <= 0 { tocSize = sr.Size() - tocOffset - fSize } if tocOffset >= 0 && tocSize < int64(len(maybeTocBytes)) { maybeTocBytes = maybeTocBytes[:tocSize] } r, err = parseTOC(d, sr, tocOffset, tocSize, maybeTocBytes, opts) if err == nil { found = true break } allErr = append(allErr, err) } if !found { return nil, errorutil.Aggregate(allErr) } if err := r.initFields(); err != nil { return nil, fmt.Errorf("failed to initialize fields of entries: %v", err) } return r, nil } // OpenFooter extracts and parses footer from the given blob. // only supports gzip-based eStargz. func OpenFooter(sr *io.SectionReader) (tocOffset int64, footerSize int64, rErr error) { if sr.Size() < FooterSize && sr.Size() < legacyFooterSize { return 0, 0, fmt.Errorf("blob size %d is smaller than the footer size", sr.Size()) } var footer [FooterSize]byte if _, err := sr.ReadAt(footer[:], sr.Size()-FooterSize); err != nil { return 0, 0, fmt.Errorf("error reading footer: %v", err) } var allErr []error for _, d := range []Decompressor{new(GzipDecompressor), new(LegacyGzipDecompressor)} { fSize := d.FooterSize() fOffset := positive(int64(len(footer)) - fSize) _, tocOffset, _, err := d.ParseFooter(footer[fOffset:]) if err == nil { return tocOffset, fSize, err } allErr = append(allErr, err) } return 0, 0, errorutil.Aggregate(allErr) } // initFields populates the Reader from r.toc after decoding it from // JSON. // // Unexported fields are populated and TOCEntry fields that were // implicit in the JSON are populated. func (r *Reader) initFields() error { r.m = make(map[string]*TOCEntry, len(r.toc.Entries)) r.chunks = make(map[string][]*TOCEntry) var lastPath string uname := map[int]string{} gname := map[int]string{} var lastRegEnt *TOCEntry var chunkTopIndex int for i, ent := range r.toc.Entries { ent.Name = cleanEntryName(ent.Name) switch ent.Type { case "reg", "chunk": if ent.Offset != r.toc.Entries[chunkTopIndex].Offset { chunkTopIndex = i } ent.chunkTopIndex = chunkTopIndex } if ent.Type == "reg" { lastRegEnt = ent } if ent.Type == "chunk" { ent.Name = lastPath r.chunks[ent.Name] = append(r.chunks[ent.Name], ent) if ent.ChunkSize == 0 && lastRegEnt != nil { ent.ChunkSize = lastRegEnt.Size - ent.ChunkOffset } } else { lastPath = ent.Name if ent.Uname != "" { uname[ent.UID] = ent.Uname } else { ent.Uname = uname[ent.UID] } if ent.Gname != "" { gname[ent.GID] = ent.Gname } else { ent.Gname = gname[ent.GID] } ent.modTime, _ = time.Parse(time.RFC3339, ent.ModTime3339) if ent.Type == "dir" { ent.NumLink++ // Parent dir links to this directory } r.m[ent.Name] = ent } if ent.Type == "reg" && ent.ChunkSize > 0 && ent.ChunkSize < ent.Size { r.chunks[ent.Name] = make([]*TOCEntry, 0, ent.Size/ent.ChunkSize+1) r.chunks[ent.Name] = append(r.chunks[ent.Name], ent) } if ent.ChunkSize == 0 && ent.Size != 0 { ent.ChunkSize = ent.Size } } // Populate children, add implicit directories: for _, ent := range r.toc.Entries { if ent.Type == "chunk" { continue } // add "foo/": // add "foo" child to "" (creating "" if necessary) // // add "foo/bar/": // add "bar" child to "foo" (creating "foo" if necessary) // // add "foo/bar.txt": // add "bar.txt" child to "foo" (creating "foo" if necessary) // // add "a/b/c/d/e/f.txt": // create "a/b/c/d/e" node // add "f.txt" child to "e" name := ent.Name pdirName := parentDir(name) if name == pdirName { // This entry and its parent are the same. // Ignore this for avoiding infinite loop of the reference. // The example case where this can occur is when tar contains the root // directory itself (e.g. "./", "/"). continue } pdir := r.getOrCreateDir(pdirName) ent.NumLink++ // at least one name(ent.Name) references this entry. if ent.Type == "hardlink" { org, err := r.getSource(ent) if err != nil { return err } org.NumLink++ // original entry is referenced by this ent.Name. ent = org } pdir.addChild(path.Base(name), ent) } lastOffset := r.sr.Size() for i := len(r.toc.Entries) - 1; i >= 0; i-- { e := r.toc.Entries[i] if e.isDataType() { e.nextOffset = lastOffset } if e.Offset != 0 && e.InnerOffset == 0 { lastOffset = e.Offset } } if len(r.m) == 0 { r.m[""] = &TOCEntry{ Name: "", Type: "dir", Mode: 0755, NumLink: 1, } } return nil } func (r *Reader) getSource(ent *TOCEntry) (_ *TOCEntry, err error) { if ent.Type == "hardlink" { org, ok := r.m[cleanEntryName(ent.LinkName)] if !ok { return nil, fmt.Errorf("%q is a hardlink but the linkname %q isn't found", ent.Name, ent.LinkName) } ent, err = r.getSource(org) if err != nil { return nil, err } } return ent, nil } func parentDir(p string) string { dir, _ := path.Split(p) return strings.TrimSuffix(dir, "/") } func (r *Reader) getOrCreateDir(d string) *TOCEntry { e, ok := r.m[d] if !ok { e = &TOCEntry{ Name: d, Type: "dir", Mode: 0755, NumLink: 2, // The directory itself(.) and the parent link to this directory. } r.m[d] = e if d != "" { pdir := r.getOrCreateDir(parentDir(d)) pdir.addChild(path.Base(d), e) } } return e } func (r *Reader) TOCDigest() digest.Digest { return r.tocDigest } // VerifyTOC checks that the TOC JSON in the passed blob matches the // passed digests and that the TOC JSON contains digests for all chunks // contained in the blob. If the verification succceeds, this function // returns TOCEntryVerifier which holds all chunk digests in the stargz blob. func (r *Reader) VerifyTOC(tocDigest digest.Digest) (TOCEntryVerifier, error) { // Verify the digest of TOC JSON if r.tocDigest != tocDigest { return nil, fmt.Errorf("invalid TOC JSON %q; want %q", r.tocDigest, tocDigest) } return r.Verifiers() } // Verifiers returns TOCEntryVerifier of this chunk. Use VerifyTOC instead in most cases // because this doesn't verify TOC. func (r *Reader) Verifiers() (TOCEntryVerifier, error) { chunkDigestMap := make(map[int64]digest.Digest) // map from chunk offset to the chunk digest regDigestMap := make(map[int64]digest.Digest) // map from chunk offset to the reg file digest var chunkDigestMapIncomplete bool var regDigestMapIncomplete bool var containsChunk bool for _, e := range r.toc.Entries { if e.Type != "reg" && e.Type != "chunk" { continue } // offset must be unique in stargz blob _, dOK := chunkDigestMap[e.Offset] _, rOK := regDigestMap[e.Offset] if dOK || rOK { return nil, fmt.Errorf("offset %d found twice", e.Offset) } if e.Type == "reg" { if e.Size == 0 { continue // ignores empty file } // record the digest of regular file payload if e.Digest != "" { d, err := digest.Parse(e.Digest) if err != nil { return nil, fmt.Errorf("failed to parse regular file digest %q: %w", e.Digest, err) } regDigestMap[e.Offset] = d } else { regDigestMapIncomplete = true } } else { containsChunk = true // this layer contains "chunk" entries. } // "reg" also can contain ChunkDigest (e.g. when "reg" is the first entry of // chunked file) if e.ChunkDigest != "" { d, err := digest.Parse(e.ChunkDigest) if err != nil { return nil, fmt.Errorf("failed to parse chunk digest %q: %w", e.ChunkDigest, err) } chunkDigestMap[e.Offset] = d } else { chunkDigestMapIncomplete = true } } if chunkDigestMapIncomplete { // Though some chunk digests are not found, if this layer doesn't contain // "chunk"s and all digest of "reg" files are recorded, we can use them instead. if !containsChunk && !regDigestMapIncomplete { return &verifier{digestMap: regDigestMap}, nil } return nil, fmt.Errorf("some ChunkDigest not found in TOC JSON") } return &verifier{digestMap: chunkDigestMap}, nil } // verifier is an implementation of TOCEntryVerifier which holds verifiers keyed by // offset of the chunk. type verifier struct { digestMap map[int64]digest.Digest digestMapMu sync.Mutex } // Verifier returns a content verifier specified by TOCEntry. func (v *verifier) Verifier(ce *TOCEntry) (digest.Verifier, error) { v.digestMapMu.Lock() defer v.digestMapMu.Unlock() d, ok := v.digestMap[ce.Offset] if !ok { return nil, fmt.Errorf("verifier for offset=%d,size=%d hasn't been registered", ce.Offset, ce.ChunkSize) } return d.Verifier(), nil } // ChunkEntryForOffset returns the TOCEntry containing the byte of the // named file at the given offset within the file. // Name must be absolute path or one that is relative to root. func (r *Reader) ChunkEntryForOffset(name string, offset int64) (e *TOCEntry, ok bool) { name = cleanEntryName(name) e, ok = r.Lookup(name) if !ok || !e.isDataType() { return nil, false } ents := r.chunks[name] if len(ents) < 2 { if offset >= e.ChunkSize { return nil, false } return e, true } i := sort.Search(len(ents), func(i int) bool { e := ents[i] return e.ChunkOffset >= offset || (offset > e.ChunkOffset && offset < e.ChunkOffset+e.ChunkSize) }) if i == len(ents) { return nil, false } return ents[i], true } // Lookup returns the Table of Contents entry for the given path. // // To get the root directory, use the empty string. // Path must be absolute path or one that is relative to root. func (r *Reader) Lookup(path string) (e *TOCEntry, ok bool) { path = cleanEntryName(path) if r == nil { return } e, ok = r.m[path] if ok && e.Type == "hardlink" { var err error e, err = r.getSource(e) if err != nil { return nil, false } } return } // OpenFile returns the reader of the specified file payload. // // Name must be absolute path or one that is relative to root. func (r *Reader) OpenFile(name string) (*io.SectionReader, error) { fr, err := r.newFileReader(name) if err != nil { return nil, err } return io.NewSectionReader(fr, 0, fr.size), nil } func (r *Reader) newFileReader(name string) (*fileReader, error) { name = cleanEntryName(name) ent, ok := r.Lookup(name) if !ok { // TODO: come up with some error plan. This is lazy: return nil, &os.PathError{ Path: name, Op: "OpenFile", Err: os.ErrNotExist, } } if ent.Type != "reg" { return nil, &os.PathError{ Path: name, Op: "OpenFile", Err: errors.New("not a regular file"), } } return &fileReader{ r: r, size: ent.Size, ents: r.getChunks(ent), }, nil } func (r *Reader) OpenFileWithPreReader(name string, preRead func(*TOCEntry, io.Reader) error) (*io.SectionReader, error) { fr, err := r.newFileReader(name) if err != nil { return nil, err } fr.preRead = preRead return io.NewSectionReader(fr, 0, fr.size), nil } func (r *Reader) getChunks(ent *TOCEntry) []*TOCEntry { if ents, ok := r.chunks[ent.Name]; ok { return ents } return []*TOCEntry{ent} } type fileReader struct { r *Reader size int64 ents []*TOCEntry // 1 or more reg/chunk entries preRead func(*TOCEntry, io.Reader) error } func (fr *fileReader) ReadAt(p []byte, off int64) (n int, err error) { if off >= fr.size { return 0, io.EOF } if off < 0 { return 0, errors.New("invalid offset") } var i int if len(fr.ents) > 1 { i = sort.Search(len(fr.ents), func(i int) bool { return fr.ents[i].ChunkOffset >= off }) if i == len(fr.ents) { i = len(fr.ents) - 1 } } ent := fr.ents[i] if ent.ChunkOffset > off { if i == 0 { return 0, errors.New("internal error; first chunk offset is non-zero") } ent = fr.ents[i-1] } // If ent is a chunk of a large file, adjust the ReadAt // offset by the chunk's offset. off -= ent.ChunkOffset finalEnt := fr.ents[len(fr.ents)-1] compressedOff := ent.Offset // compressedBytesRemain is the number of compressed bytes in this // file remaining, over 1+ chunks. compressedBytesRemain := finalEnt.NextOffset() - compressedOff sr := io.NewSectionReader(fr.r.sr, compressedOff, compressedBytesRemain) const maxRead = 2 << 20 var bufSize = maxRead if compressedBytesRemain < maxRead { bufSize = int(compressedBytesRemain) } br := bufio.NewReaderSize(sr, bufSize) if _, err := br.Peek(bufSize); err != nil { return 0, fmt.Errorf("fileReader.ReadAt.peek: %v", err) } dr, err := fr.r.decompressor.Reader(br) if err != nil { return 0, fmt.Errorf("fileReader.ReadAt.decompressor.Reader: %v", err) } defer dr.Close() if fr.preRead == nil { if n, err := io.CopyN(io.Discard, dr, ent.InnerOffset+off); n != ent.InnerOffset+off || err != nil { return 0, fmt.Errorf("discard of %d bytes != %v, %v", ent.InnerOffset+off, n, err) } return io.ReadFull(dr, p) } var retN int var retErr error var found bool var nr int64 for _, e := range fr.r.toc.Entries[ent.chunkTopIndex:] { if !e.isDataType() { continue } if e.Offset != fr.r.toc.Entries[ent.chunkTopIndex].Offset { break } if in, err := io.CopyN(io.Discard, dr, e.InnerOffset-nr); err != nil || in != e.InnerOffset-nr { return 0, fmt.Errorf("discard of remaining %d bytes != %v, %v", e.InnerOffset-nr, in, err) } nr = e.InnerOffset if e == ent { found = true if n, err := io.CopyN(io.Discard, dr, off); n != off || err != nil { return 0, fmt.Errorf("discard of offset %d bytes != %v, %v", off, n, err) } retN, retErr = io.ReadFull(dr, p) nr += off + int64(retN) continue } cr := &countReader{r: io.LimitReader(dr, e.ChunkSize)} if err := fr.preRead(e, cr); err != nil { return 0, fmt.Errorf("failed to pre read: %w", err) } nr += cr.n } if !found { return 0, fmt.Errorf("fileReader.ReadAt: target entry not found") } return retN, retErr } // A Writer writes stargz files. // // Use NewWriter to create a new Writer. type Writer struct { bw *bufio.Writer cw *countWriter toc *JTOC diffHash hash.Hash // SHA-256 of uncompressed tar closed bool gz io.WriteCloser lastUsername map[int]string lastGroupname map[int]string compressor Compressor uncompressedCounter *countWriteFlusher // ChunkSize optionally controls the maximum number of bytes // of data of a regular file that can be written in one gzip // stream before a new gzip stream is started. // Zero means to use a default, currently 4 MiB. ChunkSize int // MinChunkSize optionally controls the minimum number of bytes // of data must be written in one gzip stream before a new gzip // NOTE: This adds a TOC property that stargz snapshotter < v0.13.0 doesn't understand. MinChunkSize int needsOpenGzEntries map[string]struct{} } // currentCompressionWriter writes to the current w.gz field, which can // change throughout writing a tar entry. // // Additionally, it updates w's SHA-256 of the uncompressed bytes // of the tar file. type currentCompressionWriter struct{ w *Writer } func (ccw currentCompressionWriter) Write(p []byte) (int, error) { ccw.w.diffHash.Write(p) if ccw.w.gz == nil { if err := ccw.w.condOpenGz(); err != nil { return 0, err } } return ccw.w.gz.Write(p) } func (w *Writer) chunkSize() int { if w.ChunkSize <= 0 { return 4 << 20 } return w.ChunkSize } // Unpack decompresses the given estargz blob and returns a ReadCloser of the tar blob. // TOC JSON and footer are removed. func Unpack(sr *io.SectionReader, c Decompressor) (io.ReadCloser, error) { footerSize := c.FooterSize() if sr.Size() < footerSize { return nil, fmt.Errorf("blob is too small; %d < %d", sr.Size(), footerSize) } footerOffset := sr.Size() - footerSize footer := make([]byte, footerSize) if _, err := sr.ReadAt(footer, footerOffset); err != nil { return nil, err } blobPayloadSize, _, _, err := c.ParseFooter(footer) if err != nil { return nil, fmt.Errorf("failed to parse footer: %w", err) } if blobPayloadSize < 0 { blobPayloadSize = sr.Size() } return c.Reader(io.LimitReader(sr, blobPayloadSize)) } // NewWriter returns a new stargz writer (gzip-based) writing to w. // // The writer must be closed to write its trailing table of contents. func NewWriter(w io.Writer) *Writer { return NewWriterLevel(w, gzip.BestCompression) } // NewWriterLevel returns a new stargz writer (gzip-based) writing to w. // The compression level is configurable. // // The writer must be closed to write its trailing table of contents. func NewWriterLevel(w io.Writer, compressionLevel int) *Writer { return NewWriterWithCompressor(w, NewGzipCompressorWithLevel(compressionLevel)) } // NewWriterWithCompressor returns a new stargz writer writing to w. // The compression method is configurable. // // The writer must be closed to write its trailing table of contents. func NewWriterWithCompressor(w io.Writer, c Compressor) *Writer { bw := bufio.NewWriter(w) cw := &countWriter{w: bw} return &Writer{ bw: bw, cw: cw, toc: &JTOC{Version: 1}, diffHash: sha256.New(), compressor: c, uncompressedCounter: &countWriteFlusher{}, } } // Close writes the stargz's table of contents and flushes all the // buffers, returning any error. func (w *Writer) Close() (digest.Digest, error) { if w.closed { return "", nil } defer func() { w.closed = true }() if err := w.closeGz(); err != nil { return "", err } // Write the TOC index and footer. tocDigest, err := w.compressor.WriteTOCAndFooter(w.cw, w.cw.n, w.toc, w.diffHash) if err != nil { return "", err } if err := w.bw.Flush(); err != nil { return "", err } return tocDigest, nil } func (w *Writer) closeGz() error { if w.closed { return errors.New("write on closed Writer") } if w.gz != nil { if err := w.gz.Close(); err != nil { return err } w.gz = nil } return nil } func (w *Writer) flushGz() error { if w.closed { return errors.New("flush on closed Writer") } if w.gz != nil { if f, ok := w.gz.(interface { Flush() error }); ok { return f.Flush() } } return nil } // nameIfChanged returns name, unless it was the already the value of (*mp)[id], // in which case it returns the empty string. func (w *Writer) nameIfChanged(mp *map[int]string, id int, name string) string { if name == "" { return "" } if *mp == nil { *mp = make(map[int]string) } if (*mp)[id] == name { return "" } (*mp)[id] = name return name } func (w *Writer) condOpenGz() (err error) { if w.gz == nil { w.gz, err = w.compressor.Writer(w.cw) if w.gz != nil { w.gz = w.uncompressedCounter.register(w.gz) } } return } // AppendTar reads the tar or tar.gz file from r and appends // each of its contents to w. // // The input r can optionally be gzip compressed but the output will // always be compressed by the specified compressor. func (w *Writer) AppendTar(r io.Reader) error { return w.appendTar(r, false) } // AppendTarLossLess reads the tar or tar.gz file from r and appends // each of its contents to w. // // The input r can optionally be gzip compressed but the output will // always be compressed by the specified compressor. // // The difference of this func with AppendTar is that this writes // the input tar stream into w without any modification (e.g. to header bytes). // // Note that if the input tar stream already contains TOC JSON, this returns // error because w cannot overwrite the TOC JSON to the one generated by w without // lossy modification. To avoid this error, if the input stream is known to be stargz/estargz, // you shoud decompress it and remove TOC JSON in advance. func (w *Writer) AppendTarLossLess(r io.Reader) error { return w.appendTar(r, true) } func (w *Writer) appendTar(r io.Reader, lossless bool) error { var src io.Reader br := bufio.NewReader(r) if isGzip(br) { zr, _ := gzip.NewReader(br) src = zr } else { src = io.Reader(br) } dst := currentCompressionWriter{w} var tw *tar.Writer if !lossless { tw = tar.NewWriter(dst) // use tar writer only when this isn't lossless mode. } tr := tar.NewReader(src) if lossless { tr.RawAccounting = true } prevOffset := w.cw.n var prevOffsetUncompressed int64 for { h, err := tr.Next() if err == io.EOF { if lossless { if remain := tr.RawBytes(); len(remain) > 0 { // Collect the remaining null bytes. // https://github.com/vbatts/tar-split/blob/80a436fd6164c557b131f7c59ed69bd81af69761/concept/main.go#L49-L53 if _, err := dst.Write(remain); err != nil { return err } } } break } if err != nil { return fmt.Errorf("error reading from source tar: tar.Reader.Next: %v", err) } if cleanEntryName(h.Name) == TOCTarName { // It is possible for a layer to be "stargzified" twice during the // distribution lifecycle. So we reserve "TOCTarName" here to avoid // duplicated entries in the resulting layer. if lossless { // We cannot handle this in lossless way. return fmt.Errorf("existing TOC JSON is not allowed; decompress layer before append") } continue } xattrs := make(map[string][]byte) const xattrPAXRecordsPrefix = "SCHILY.xattr." if h.PAXRecords != nil { for k, v := range h.PAXRecords { if strings.HasPrefix(k, xattrPAXRecordsPrefix) { xattrs[k[len(xattrPAXRecordsPrefix):]] = []byte(v) } } } ent := &TOCEntry{ Name: h.Name, Mode: h.Mode, UID: h.Uid, GID: h.Gid, Uname: w.nameIfChanged(&w.lastUsername, h.Uid, h.Uname), Gname: w.nameIfChanged(&w.lastGroupname, h.Gid, h.Gname), ModTime3339: formatModtime(h.ModTime), Xattrs: xattrs, } if err := w.condOpenGz(); err != nil { return err } if tw != nil { if err := tw.WriteHeader(h); err != nil { return err } } else { if _, err := dst.Write(tr.RawBytes()); err != nil { return err } } switch h.Typeflag { case tar.TypeLink: ent.Type = "hardlink" ent.LinkName = h.Linkname case tar.TypeSymlink: ent.Type = "symlink" ent.LinkName = h.Linkname case tar.TypeDir: ent.Type = "dir" case tar.TypeReg: ent.Type = "reg" ent.Size = h.Size case tar.TypeChar: ent.Type = "char" ent.DevMajor = int(h.Devmajor) ent.DevMinor = int(h.Devminor) case tar.TypeBlock: ent.Type = "block" ent.DevMajor = int(h.Devmajor) ent.DevMinor = int(h.Devminor) case tar.TypeFifo: ent.Type = "fifo" default: return fmt.Errorf("unsupported input tar entry %q", h.Typeflag) } // We need to keep a reference to the TOC entry for regular files, so that we // can fill the digest later. var regFileEntry *TOCEntry var payloadDigest digest.Digester if h.Typeflag == tar.TypeReg { regFileEntry = ent payloadDigest = digest.Canonical.Digester() } if h.Typeflag == tar.TypeReg && ent.Size > 0 { var written int64 totalSize := ent.Size // save it before we destroy ent tee := io.TeeReader(tr, payloadDigest.Hash()) for written < totalSize { chunkSize := int64(w.chunkSize()) remain := totalSize - written if remain < chunkSize { chunkSize = remain } else { ent.ChunkSize = chunkSize } // We flush the underlying compression writer here to correctly calculate "w.cw.n". if err := w.flushGz(); err != nil { return err } if w.needsOpenGz(ent) || w.cw.n-prevOffset >= int64(w.MinChunkSize) { if err := w.closeGz(); err != nil { return err } ent.Offset = w.cw.n prevOffset = ent.Offset prevOffsetUncompressed = w.uncompressedCounter.n } else { ent.Offset = prevOffset ent.InnerOffset = w.uncompressedCounter.n - prevOffsetUncompressed } ent.ChunkOffset = written chunkDigest := digest.Canonical.Digester() if err := w.condOpenGz(); err != nil { return err } teeChunk := io.TeeReader(tee, chunkDigest.Hash()) var out io.Writer if tw != nil { out = tw } else { out = dst } if _, err := io.CopyN(out, teeChunk, chunkSize); err != nil { return fmt.Errorf("error copying %q: %v", h.Name, err) } ent.ChunkDigest = chunkDigest.Digest().String() w.toc.Entries = append(w.toc.Entries, ent) written += chunkSize ent = &TOCEntry{ Name: h.Name, Type: "chunk", } } } else { w.toc.Entries = append(w.toc.Entries, ent) } if payloadDigest != nil { regFileEntry.Digest = payloadDigest.Digest().String() } if tw != nil { if err := tw.Flush(); err != nil { return err } } } remainDest := io.Discard if lossless { remainDest = dst // Preserve the remaining bytes in lossless mode } _, err := io.Copy(remainDest, src) return err } func (w *Writer) needsOpenGz(ent *TOCEntry) bool { if ent.Type != "reg" { return false } if w.needsOpenGzEntries == nil { return false } _, ok := w.needsOpenGzEntries[ent.Name] return ok } // DiffID returns the SHA-256 of the uncompressed tar bytes. // It is only valid to call DiffID after Close. func (w *Writer) DiffID() string { return fmt.Sprintf("sha256:%x", w.diffHash.Sum(nil)) } func maxFooterSize(blobSize int64, decompressors ...Decompressor) (res int64) { for _, d := range decompressors { if s := d.FooterSize(); res < s && s <= blobSize { res = s } } return } func parseTOC(d Decompressor, sr *io.SectionReader, tocOff, tocSize int64, tocBytes []byte, opts openOpts) (*Reader, error) { if tocOff < 0 { // This means that TOC isn't contained in the blob. // We pass nil reader to ParseTOC and expect that ParseTOC acquire TOC from // the external location. start := time.Now() toc, tocDgst, err := d.ParseTOC(nil) if err != nil { return nil, err } if opts.telemetry != nil && opts.telemetry.GetTocLatency != nil { opts.telemetry.GetTocLatency(start) } if opts.telemetry != nil && opts.telemetry.DeserializeTocLatency != nil { opts.telemetry.DeserializeTocLatency(start) } return &Reader{ sr: sr, toc: toc, tocDigest: tocDgst, decompressor: d, }, nil } if len(tocBytes) > 0 { start := time.Now() toc, tocDgst, err := d.ParseTOC(bytes.NewReader(tocBytes)) if err == nil { if opts.telemetry != nil && opts.telemetry.DeserializeTocLatency != nil { opts.telemetry.DeserializeTocLatency(start) } return &Reader{ sr: sr, toc: toc, tocDigest: tocDgst, decompressor: d, }, nil } } start := time.Now() tocBytes = make([]byte, tocSize) if _, err := sr.ReadAt(tocBytes, tocOff); err != nil { return nil, fmt.Errorf("error reading %d byte TOC targz: %v", len(tocBytes), err) } if opts.telemetry != nil && opts.telemetry.GetTocLatency != nil { opts.telemetry.GetTocLatency(start) } start = time.Now() toc, tocDgst, err := d.ParseTOC(bytes.NewReader(tocBytes)) if err != nil { return nil, err } if opts.telemetry != nil && opts.telemetry.DeserializeTocLatency != nil { opts.telemetry.DeserializeTocLatency(start) } return &Reader{ sr: sr, toc: toc, tocDigest: tocDgst, decompressor: d, }, nil } func formatModtime(t time.Time) string { if t.IsZero() || t.Unix() == 0 { return "" } return t.UTC().Round(time.Second).Format(time.RFC3339) } func cleanEntryName(name string) string { // Use path.Clean to consistently deal with path separators across platforms. return strings.TrimPrefix(path.Clean("/"+name), "/") } // countWriter counts how many bytes have been written to its wrapped // io.Writer. type countWriter struct { w io.Writer n int64 } func (cw *countWriter) Write(p []byte) (n int, err error) { n, err = cw.w.Write(p) cw.n += int64(n) return } type countWriteFlusher struct { io.WriteCloser n int64 } func (wc *countWriteFlusher) register(w io.WriteCloser) io.WriteCloser { wc.WriteCloser = w return wc } func (wc *countWriteFlusher) Write(p []byte) (n int, err error) { n, err = wc.WriteCloser.Write(p) wc.n += int64(n) return } func (wc *countWriteFlusher) Flush() error { if f, ok := wc.WriteCloser.(interface { Flush() error }); ok { return f.Flush() } return nil } func (wc *countWriteFlusher) Close() error { err := wc.WriteCloser.Close() wc.WriteCloser = nil return err } // isGzip reports whether br is positioned right before an upcoming gzip stream. // It does not consume any bytes from br. func isGzip(br *bufio.Reader) bool { const ( gzipID1 = 0x1f gzipID2 = 0x8b gzipDeflate = 8 ) peek, _ := br.Peek(3) return len(peek) >= 3 && peek[0] == gzipID1 && peek[1] == gzipID2 && peek[2] == gzipDeflate } func positive(n int64) int64 { if n < 0 { return 0 } return n } type countReader struct { r io.Reader n int64 } func (cr *countReader) Read(p []byte) (n int, err error) { n, err = cr.r.Read(p) cr.n += int64(n) return } ================================================ FILE: vendor/github.com/containerd/stargz-snapshotter/estargz/gzip.go ================================================ /* Copyright The containerd Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Copyright 2019 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. */ package estargz import ( "archive/tar" "bytes" "compress/gzip" "encoding/binary" "encoding/json" "fmt" "hash" "io" "strconv" digest "github.com/opencontainers/go-digest" ) type gzipCompression struct { *GzipCompressor *GzipDecompressor } func newGzipCompressionWithLevel(level int) Compression { return &gzipCompression{ &GzipCompressor{level}, &GzipDecompressor{}, } } func NewGzipCompressor() *GzipCompressor { return &GzipCompressor{gzip.BestCompression} } func NewGzipCompressorWithLevel(level int) *GzipCompressor { return &GzipCompressor{level} } type GzipCompressor struct { compressionLevel int } func (gc *GzipCompressor) Writer(w io.Writer) (WriteFlushCloser, error) { return gzip.NewWriterLevel(w, gc.compressionLevel) } func (gc *GzipCompressor) WriteTOCAndFooter(w io.Writer, off int64, toc *JTOC, diffHash hash.Hash) (digest.Digest, error) { tocJSON, err := json.MarshalIndent(toc, "", "\t") if err != nil { return "", err } gz, _ := gzip.NewWriterLevel(w, gc.compressionLevel) gw := io.Writer(gz) if diffHash != nil { gw = io.MultiWriter(gz, diffHash) } tw := tar.NewWriter(gw) if err := tw.WriteHeader(&tar.Header{ Typeflag: tar.TypeReg, Name: TOCTarName, Size: int64(len(tocJSON)), }); err != nil { return "", err } if _, err := tw.Write(tocJSON); err != nil { return "", err } if err := tw.Close(); err != nil { return "", err } if err := gz.Close(); err != nil { return "", err } if _, err := w.Write(gzipFooterBytes(off)); err != nil { return "", err } return digest.FromBytes(tocJSON), nil } // gzipFooterBytes returns the 51 bytes footer. func gzipFooterBytes(tocOff int64) []byte { buf := bytes.NewBuffer(make([]byte, 0, FooterSize)) gz, _ := gzip.NewWriterLevel(buf, gzip.NoCompression) // MUST be NoCompression to keep 51 bytes // Extra header indicating the offset of TOCJSON // https://tools.ietf.org/html/rfc1952#section-2.3.1.1 header := make([]byte, 4) header[0], header[1] = 'S', 'G' subfield := fmt.Sprintf("%016xSTARGZ", tocOff) binary.LittleEndian.PutUint16(header[2:4], uint16(len(subfield))) // little-endian per RFC1952 gz.Extra = append(header, []byte(subfield)...) gz.Close() if buf.Len() != FooterSize { panic(fmt.Sprintf("footer buffer = %d, not %d", buf.Len(), FooterSize)) } return buf.Bytes() } type GzipDecompressor struct{} func (gz *GzipDecompressor) Reader(r io.Reader) (io.ReadCloser, error) { return gzip.NewReader(r) } func (gz *GzipDecompressor) ParseTOC(r io.Reader) (toc *JTOC, tocDgst digest.Digest, err error) { return parseTOCEStargz(r) } func (gz *GzipDecompressor) ParseFooter(p []byte) (blobPayloadSize, tocOffset, tocSize int64, err error) { if len(p) != FooterSize { return 0, 0, 0, fmt.Errorf("invalid length %d cannot be parsed", len(p)) } zr, err := gzip.NewReader(bytes.NewReader(p)) if err != nil { return 0, 0, 0, err } defer zr.Close() extra := zr.Extra si1, si2, subfieldlen, subfield := extra[0], extra[1], extra[2:4], extra[4:] if si1 != 'S' || si2 != 'G' { return 0, 0, 0, fmt.Errorf("invalid subfield IDs: %q, %q; want E, S", si1, si2) } if slen := binary.LittleEndian.Uint16(subfieldlen); slen != uint16(16+len("STARGZ")) { return 0, 0, 0, fmt.Errorf("invalid length of subfield %d; want %d", slen, 16+len("STARGZ")) } if string(subfield[16:]) != "STARGZ" { return 0, 0, 0, fmt.Errorf("STARGZ magic string must be included in the footer subfield") } tocOffset, err = strconv.ParseInt(string(subfield[:16]), 16, 64) if err != nil { return 0, 0, 0, fmt.Errorf("legacy: failed to parse toc offset: %w", err) } return tocOffset, tocOffset, 0, nil } func (gz *GzipDecompressor) FooterSize() int64 { return FooterSize } func (gz *GzipDecompressor) DecompressTOC(r io.Reader) (tocJSON io.ReadCloser, err error) { return decompressTOCEStargz(r) } type LegacyGzipDecompressor struct{} func (gz *LegacyGzipDecompressor) Reader(r io.Reader) (io.ReadCloser, error) { return gzip.NewReader(r) } func (gz *LegacyGzipDecompressor) ParseTOC(r io.Reader) (toc *JTOC, tocDgst digest.Digest, err error) { return parseTOCEStargz(r) } func (gz *LegacyGzipDecompressor) ParseFooter(p []byte) (blobPayloadSize, tocOffset, tocSize int64, err error) { if len(p) != legacyFooterSize { return 0, 0, 0, fmt.Errorf("legacy: invalid length %d cannot be parsed", len(p)) } zr, err := gzip.NewReader(bytes.NewReader(p)) if err != nil { return 0, 0, 0, fmt.Errorf("legacy: failed to get footer gzip reader: %w", err) } defer zr.Close() extra := zr.Extra if len(extra) != 16+len("STARGZ") { return 0, 0, 0, fmt.Errorf("legacy: invalid stargz's extra field size") } if string(extra[16:]) != "STARGZ" { return 0, 0, 0, fmt.Errorf("legacy: magic string STARGZ not found") } tocOffset, err = strconv.ParseInt(string(extra[:16]), 16, 64) if err != nil { return 0, 0, 0, fmt.Errorf("legacy: failed to parse toc offset: %w", err) } return tocOffset, tocOffset, 0, nil } func (gz *LegacyGzipDecompressor) FooterSize() int64 { return legacyFooterSize } func (gz *LegacyGzipDecompressor) DecompressTOC(r io.Reader) (tocJSON io.ReadCloser, err error) { return decompressTOCEStargz(r) } func parseTOCEStargz(r io.Reader) (toc *JTOC, tocDgst digest.Digest, err error) { tr, err := decompressTOCEStargz(r) if err != nil { return nil, "", err } dgstr := digest.Canonical.Digester() toc = new(JTOC) if err := json.NewDecoder(io.TeeReader(tr, dgstr.Hash())).Decode(&toc); err != nil { return nil, "", fmt.Errorf("error decoding TOC JSON: %v", err) } if err := tr.Close(); err != nil { return nil, "", err } return toc, dgstr.Digest(), nil } func decompressTOCEStargz(r io.Reader) (tocJSON io.ReadCloser, err error) { zr, err := gzip.NewReader(r) if err != nil { return nil, fmt.Errorf("malformed TOC gzip header: %v", err) } zr.Multistream(false) tr := tar.NewReader(zr) h, err := tr.Next() if err != nil { return nil, fmt.Errorf("failed to find tar header in TOC gzip stream: %v", err) } if h.Name != TOCTarName { return nil, fmt.Errorf("TOC tar entry had name %q; expected %q", h.Name, TOCTarName) } return readCloser{tr, zr.Close}, nil } ================================================ FILE: vendor/github.com/containerd/stargz-snapshotter/estargz/testutil.go ================================================ /* Copyright The containerd Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Copyright 2019 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. */ package estargz import ( "archive/tar" "bytes" "compress/gzip" "crypto/rand" "crypto/sha256" "encoding/json" "errors" "fmt" "io" "math/big" "os" "path/filepath" "reflect" "sort" "strings" "time" "github.com/containerd/stargz-snapshotter/estargz/errorutil" "github.com/klauspost/compress/zstd" digest "github.com/opencontainers/go-digest" ) // TestingController is Compression with some helper methods necessary for testing. type TestingController interface { Compression TestStreams(t TestingT, b []byte, streams []int64) DiffIDOf(TestingT, []byte) string String() string } // TestingT is the minimal set of testing.T required to run the // tests defined in CompressionTestSuite. This interface exists to prevent // leaking the testing package from being exposed outside tests. type TestingT interface { Errorf(format string, args ...any) FailNow() Failed() bool Fatal(args ...any) Fatalf(format string, args ...any) Logf(format string, args ...any) Parallel() } // Runner allows running subtests of TestingT. This exists instead of adding // a Run method to TestingT interface because the Run implementation of // testing.T would not satisfy the interface. type Runner func(t TestingT, name string, fn func(t TestingT)) type TestRunner struct { TestingT Runner Runner } func (r *TestRunner) Run(name string, run func(*TestRunner)) { r.Runner(r.TestingT, name, func(t TestingT) { run(&TestRunner{TestingT: t, Runner: r.Runner}) }) } // CompressionTestSuite tests this pkg with controllers can build valid eStargz blobs and parse them. func CompressionTestSuite(t *TestRunner, controllers ...TestingControllerFactory) { t.Run("testBuild", func(t *TestRunner) { t.Parallel(); testBuild(t, controllers...) }) t.Run("testDigestAndVerify", func(t *TestRunner) { t.Parallel() testDigestAndVerify(t, controllers...) }) t.Run("testWriteAndOpen", func(t *TestRunner) { t.Parallel(); testWriteAndOpen(t, controllers...) }) } type TestingControllerFactory func() TestingController const ( uncompressedType int = iota gzipType zstdType ) var srcCompressions = []int{ uncompressedType, gzipType, zstdType, } var allowedPrefix = [4]string{"", "./", "/", "../"} // testBuild tests the resulting stargz blob built by this pkg has the same // contents as the normal stargz blob. func testBuild(t *TestRunner, controllers ...TestingControllerFactory) { tests := []struct { name string chunkSize int minChunkSize []int in []tarEntry }{ { name: "regfiles and directories", chunkSize: 4, in: tarOf( file("foo", "test1"), dir("foo2/"), file("foo2/bar", "test2", xAttr(map[string]string{"test": "sample"})), ), }, { name: "empty files", chunkSize: 4, in: tarOf( file("foo", "tttttt"), file("foo_empty", ""), file("foo2", "tttttt"), file("foo_empty2", ""), file("foo3", "tttttt"), file("foo_empty3", ""), file("foo4", "tttttt"), file("foo_empty4", ""), file("foo5", "tttttt"), file("foo_empty5", ""), file("foo6", "tttttt"), ), }, { name: "various files", chunkSize: 4, minChunkSize: []int{0, 64000}, in: tarOf( file("baz.txt", "bazbazbazbazbazbazbaz"), file("foo1.txt", "a"), file("bar/foo2.txt", "b"), file("foo3.txt", "c"), symlink("barlink", "test/bar.txt"), dir("test/"), dir("dev/"), blockdev("dev/testblock", 3, 4), fifo("dev/testfifo"), chardev("dev/testchar1", 5, 6), file("test/bar.txt", "testbartestbar", xAttr(map[string]string{"test2": "sample2"})), dir("test2/"), link("test2/bazlink", "baz.txt"), chardev("dev/testchar2", 1, 2), ), }, { name: "no contents", chunkSize: 4, in: tarOf( file("baz.txt", ""), symlink("barlink", "test/bar.txt"), dir("test/"), dir("dev/"), blockdev("dev/testblock", 3, 4), fifo("dev/testfifo"), chardev("dev/testchar1", 5, 6), file("test/bar.txt", "", xAttr(map[string]string{"test2": "sample2"})), dir("test2/"), link("test2/bazlink", "baz.txt"), chardev("dev/testchar2", 1, 2), ), }, } for _, tt := range tests { if len(tt.minChunkSize) == 0 { tt.minChunkSize = []int{0} } for _, srcCompression := range srcCompressions { srcCompression := srcCompression for _, newCL := range controllers { newCL := newCL for _, srcTarFormat := range []tar.Format{tar.FormatUSTAR, tar.FormatPAX, tar.FormatGNU} { srcTarFormat := srcTarFormat for _, prefix := range allowedPrefix { prefix := prefix for _, minChunkSize := range tt.minChunkSize { minChunkSize := minChunkSize t.Run(tt.name+"-"+fmt.Sprintf("compression=%v,prefix=%q,src=%d,format=%s,minChunkSize=%d", newCL(), prefix, srcCompression, srcTarFormat, minChunkSize), func(t *TestRunner) { tarBlob := buildTar(t, tt.in, prefix, srcTarFormat) // Test divideEntries() entries, err := sortEntries(tarBlob, nil, nil) // identical order if err != nil { t.Fatalf("failed to parse tar: %v", err) } var merged []*entry for _, part := range divideEntries(entries, 4) { merged = append(merged, part...) } if !reflect.DeepEqual(entries, merged) { for _, e := range entries { t.Logf("Original: %v", e.header) } for _, e := range merged { t.Logf("Merged: %v", e.header) } t.Errorf("divided entries couldn't be merged") return } // Prepare sample data cl1 := newCL() wantBuf := new(bytes.Buffer) sw := NewWriterWithCompressor(wantBuf, cl1) sw.MinChunkSize = minChunkSize sw.ChunkSize = tt.chunkSize if err := sw.AppendTar(tarBlob); err != nil { t.Fatalf("failed to append tar to want stargz: %v", err) } if _, err := sw.Close(); err != nil { t.Fatalf("failed to prepare want stargz: %v", err) } wantData := wantBuf.Bytes() want, err := Open(io.NewSectionReader( bytes.NewReader(wantData), 0, int64(len(wantData))), WithDecompressors(cl1), ) if err != nil { t.Fatalf("failed to parse the want stargz: %v", err) } // Prepare testing data var opts []Option if minChunkSize > 0 { opts = append(opts, WithMinChunkSize(minChunkSize)) } cl2 := newCL() rc, err := Build(compressBlob(t, tarBlob, srcCompression), append(opts, WithChunkSize(tt.chunkSize), WithCompression(cl2))...) if err != nil { t.Fatalf("failed to build stargz: %v", err) } defer rc.Close() gotBuf := new(bytes.Buffer) if _, err := io.Copy(gotBuf, rc); err != nil { t.Fatalf("failed to copy built stargz blob: %v", err) } gotData := gotBuf.Bytes() got, err := Open(io.NewSectionReader( bytes.NewReader(gotBuf.Bytes()), 0, int64(len(gotData))), WithDecompressors(cl2), ) if err != nil { t.Fatalf("failed to parse the got stargz: %v", err) } // Check DiffID is properly calculated rc.Close() diffID := rc.DiffID() wantDiffID := cl2.DiffIDOf(t, gotData) if diffID.String() != wantDiffID { t.Errorf("DiffID = %q; want %q", diffID, wantDiffID) } // Compare as stargz if !isSameVersion(t, cl1, wantData, cl2, gotData) { t.Errorf("built stargz hasn't same json") return } if !isSameEntries(t, want, got) { t.Errorf("built stargz isn't same as the original") return } // Compare as tar.gz if !isSameTarGz(t, cl1, wantData, cl2, gotData) { t.Errorf("built stargz isn't same tar.gz") return } }) } } } } } } } func isSameTarGz(t TestingT, cla TestingController, a []byte, clb TestingController, b []byte) bool { aGz, err := cla.Reader(bytes.NewReader(a)) if err != nil { t.Fatalf("failed to read A") } defer aGz.Close() bGz, err := clb.Reader(bytes.NewReader(b)) if err != nil { t.Fatalf("failed to read B") } defer bGz.Close() // Same as tar's Next() method but ignores landmarks and TOCJSON file next := func(r *tar.Reader) (h *tar.Header, err error) { for { if h, err = r.Next(); err != nil { return } if h.Name != PrefetchLandmark && h.Name != NoPrefetchLandmark && h.Name != TOCTarName { return } } } aTar := tar.NewReader(aGz) bTar := tar.NewReader(bGz) for { // Fetch and parse next header. aH, aErr := next(aTar) bH, bErr := next(bTar) if aErr != nil || bErr != nil { if aErr == io.EOF && bErr == io.EOF { break } t.Fatalf("Failed to parse tar file: A: %v, B: %v", aErr, bErr) } if !reflect.DeepEqual(aH, bH) { t.Logf("different header (A = %v; B = %v)", aH, bH) return false } aFile, err := io.ReadAll(aTar) if err != nil { t.Fatal("failed to read tar payload of A") } bFile, err := io.ReadAll(bTar) if err != nil { t.Fatal("failed to read tar payload of B") } if !bytes.Equal(aFile, bFile) { t.Logf("different tar payload (A = %q; B = %q)", string(a), string(b)) return false } } return true } func isSameVersion(t TestingT, cla TestingController, a []byte, clb TestingController, b []byte) bool { aJTOC, _, err := parseStargz(io.NewSectionReader(bytes.NewReader(a), 0, int64(len(a))), cla) if err != nil { t.Fatalf("failed to parse A: %v", err) } bJTOC, _, err := parseStargz(io.NewSectionReader(bytes.NewReader(b), 0, int64(len(b))), clb) if err != nil { t.Fatalf("failed to parse B: %v", err) } t.Logf("A: TOCJSON: %v", dumpTOCJSON(t, aJTOC)) t.Logf("B: TOCJSON: %v", dumpTOCJSON(t, bJTOC)) return aJTOC.Version == bJTOC.Version } func isSameEntries(t TestingT, a, b *Reader) bool { aroot, ok := a.Lookup("") if !ok { t.Fatalf("failed to get root of A") } broot, ok := b.Lookup("") if !ok { t.Fatalf("failed to get root of B") } aEntry := stargzEntry{aroot, a} bEntry := stargzEntry{broot, b} return contains(t, aEntry, bEntry) && contains(t, bEntry, aEntry) } func compressBlob(t TestingT, src *io.SectionReader, srcCompression int) *io.SectionReader { buf := new(bytes.Buffer) var w io.WriteCloser var err error switch srcCompression { case gzipType: w = gzip.NewWriter(buf) case zstdType: w, err = zstd.NewWriter(buf) if err != nil { t.Fatalf("failed to init zstd writer: %v", err) } default: return src } src.Seek(0, io.SeekStart) if _, err := io.Copy(w, src); err != nil { t.Fatalf("failed to compress source") } if err := w.Close(); err != nil { t.Fatalf("failed to finalize compress source") } data := buf.Bytes() return io.NewSectionReader(bytes.NewReader(data), 0, int64(len(data))) } type stargzEntry struct { e *TOCEntry r *Reader } // contains checks if all child entries in "b" are also contained in "a". // This function also checks if the files/chunks contain the same contents among "a" and "b". func contains(t TestingT, a, b stargzEntry) bool { ae, ar := a.e, a.r be, br := b.e, b.r t.Logf("Comparing: %q vs %q", ae.Name, be.Name) if !equalEntry(ae, be) { t.Logf("%q != %q: entry: a: %v, b: %v", ae.Name, be.Name, ae, be) return false } if ae.Type == "dir" { t.Logf("Directory: %q vs %q: %v vs %v", ae.Name, be.Name, allChildrenName(ae), allChildrenName(be)) iscontain := true ae.ForeachChild(func(aBaseName string, aChild *TOCEntry) bool { // Walk through all files on this stargz file. if aChild.Name == PrefetchLandmark || aChild.Name == NoPrefetchLandmark { return true // Ignore landmarks } // Ignore a TOCEntry of "./" (formated as "" by stargz lib) on root directory // because this points to the root directory itself. if aChild.Name == "" && ae.Name == "" { return true } bChild, ok := be.LookupChild(aBaseName) if !ok { t.Logf("%q (base: %q): not found in b: %v", ae.Name, aBaseName, allChildrenName(be)) iscontain = false return false } childcontain := contains(t, stargzEntry{aChild, a.r}, stargzEntry{bChild, b.r}) if !childcontain { t.Logf("%q != %q: non-equal dir", ae.Name, be.Name) iscontain = false return false } return true }) return iscontain } else if ae.Type == "reg" { af, err := ar.OpenFile(ae.Name) if err != nil { t.Fatalf("failed to open file %q on A: %v", ae.Name, err) } bf, err := br.OpenFile(be.Name) if err != nil { t.Fatalf("failed to open file %q on B: %v", be.Name, err) } var nr int64 for nr < ae.Size { abytes, anext, aok := readOffset(t, af, nr, a) bbytes, bnext, bok := readOffset(t, bf, nr, b) if !aok && !bok { break } else if !aok || !bok || anext != bnext { t.Logf("%q != %q (offset=%d): chunk existence a=%v vs b=%v, anext=%v vs bnext=%v", ae.Name, be.Name, nr, aok, bok, anext, bnext) return false } nr = anext if !bytes.Equal(abytes, bbytes) { t.Logf("%q != %q: different contents %v vs %v", ae.Name, be.Name, string(abytes), string(bbytes)) return false } } return true } return true } func allChildrenName(e *TOCEntry) (children []string) { e.ForeachChild(func(baseName string, _ *TOCEntry) bool { children = append(children, baseName) return true }) return } func equalEntry(a, b *TOCEntry) bool { // Here, we selectively compare fileds that we are interested in. return a.Name == b.Name && a.Type == b.Type && a.Size == b.Size && a.ModTime3339 == b.ModTime3339 && a.Stat().ModTime().Equal(b.Stat().ModTime()) && // modTime time.Time a.LinkName == b.LinkName && a.Mode == b.Mode && a.UID == b.UID && a.GID == b.GID && a.Uname == b.Uname && a.Gname == b.Gname && (a.Offset >= 0) == (b.Offset >= 0) && (a.NextOffset() > 0) == (b.NextOffset() > 0) && a.DevMajor == b.DevMajor && a.DevMinor == b.DevMinor && a.NumLink == b.NumLink && reflect.DeepEqual(a.Xattrs, b.Xattrs) && // chunk-related infomations aren't compared in this function. // ChunkOffset int64 `json:"chunkOffset,omitempty"` // ChunkSize int64 `json:"chunkSize,omitempty"` // children map[string]*TOCEntry a.Digest == b.Digest } func readOffset(t TestingT, r *io.SectionReader, offset int64, e stargzEntry) ([]byte, int64, bool) { ce, ok := e.r.ChunkEntryForOffset(e.e.Name, offset) if !ok { return nil, 0, false } data := make([]byte, ce.ChunkSize) t.Logf("Offset: %v, NextOffset: %v", ce.Offset, ce.NextOffset()) n, err := r.ReadAt(data, ce.ChunkOffset) if err != nil { t.Fatalf("failed to read file payload of %q (offset:%d,size:%d): %v", e.e.Name, ce.ChunkOffset, ce.ChunkSize, err) } if int64(n) != ce.ChunkSize { t.Fatalf("unexpected copied data size %d; want %d", n, ce.ChunkSize) } return data[:n], offset + ce.ChunkSize, true } func dumpTOCJSON(t TestingT, tocJSON *JTOC) string { jtocData, err := json.Marshal(*tocJSON) if err != nil { t.Fatalf("failed to marshal TOC JSON: %v", err) } buf := new(bytes.Buffer) if _, err := io.Copy(buf, bytes.NewReader(jtocData)); err != nil { t.Fatalf("failed to read toc json blob: %v", err) } return buf.String() } const chunkSize = 3 type check func(t *TestRunner, sgzData []byte, tocDigest digest.Digest, dgstMap map[string]digest.Digest, controller TestingController, newController TestingControllerFactory) // testDigestAndVerify runs specified checks against sample stargz blobs. func testDigestAndVerify(t *TestRunner, controllers ...TestingControllerFactory) { tests := []struct { name string tarInit func(t TestingT, dgstMap map[string]digest.Digest) (blob []tarEntry) checks []check minChunkSize []int }{ { name: "no-regfile", tarInit: func(t TestingT, dgstMap map[string]digest.Digest) (blob []tarEntry) { return tarOf( dir("test/"), ) }, checks: []check{ checkStargzTOC, checkVerifyTOC, checkVerifyInvalidStargzFail(buildTar(t, tarOf( dir("test2/"), // modified ), allowedPrefix[0])), }, }, { name: "small-files", tarInit: func(t TestingT, dgstMap map[string]digest.Digest) (blob []tarEntry) { return tarOf( regDigest(t, "baz.txt", "", dgstMap), regDigest(t, "foo.txt", "a", dgstMap), dir("test/"), regDigest(t, "test/bar.txt", "bbb", dgstMap), ) }, minChunkSize: []int{0, 64000}, checks: []check{ checkStargzTOC, checkVerifyTOC, checkVerifyInvalidStargzFail(buildTar(t, tarOf( file("baz.txt", ""), file("foo.txt", "M"), // modified dir("test/"), file("test/bar.txt", "bbb"), ), allowedPrefix[0])), // checkVerifyInvalidTOCEntryFail("foo.txt"), // TODO checkVerifyBrokenContentFail("foo.txt"), }, }, { name: "big-files", tarInit: func(t TestingT, dgstMap map[string]digest.Digest) (blob []tarEntry) { return tarOf( regDigest(t, "baz.txt", "bazbazbazbazbazbazbaz", dgstMap), regDigest(t, "foo.txt", "a", dgstMap), dir("test/"), regDigest(t, "test/bar.txt", "testbartestbar", dgstMap), ) }, checks: []check{ checkStargzTOC, checkVerifyTOC, checkVerifyInvalidStargzFail(buildTar(t, tarOf( file("baz.txt", "bazbazbazMMMbazbazbaz"), // modified file("foo.txt", "a"), dir("test/"), file("test/bar.txt", "testbartestbar"), ), allowedPrefix[0])), checkVerifyInvalidTOCEntryFail("test/bar.txt"), checkVerifyBrokenContentFail("test/bar.txt"), }, }, { name: "with-non-regfiles", minChunkSize: []int{0, 64000}, tarInit: func(t TestingT, dgstMap map[string]digest.Digest) (blob []tarEntry) { return tarOf( regDigest(t, "baz.txt", "bazbazbazbazbazbazbaz", dgstMap), regDigest(t, "foo.txt", "a", dgstMap), regDigest(t, "bar/foo2.txt", "b", dgstMap), regDigest(t, "foo3.txt", "c", dgstMap), symlink("barlink", "test/bar.txt"), dir("test/"), regDigest(t, "test/bar.txt", "testbartestbar", dgstMap), dir("test2/"), link("test2/bazlink", "baz.txt"), ) }, checks: []check{ checkStargzTOC, checkVerifyTOC, checkVerifyInvalidStargzFail(buildTar(t, tarOf( file("baz.txt", "bazbazbazbazbazbazbaz"), file("foo.txt", "a"), file("bar/foo2.txt", "b"), file("foo3.txt", "c"), symlink("barlink", "test/bar.txt"), dir("test/"), file("test/bar.txt", "testbartestbar"), dir("test2/"), link("test2/bazlink", "foo.txt"), // modified ), allowedPrefix[0])), checkVerifyInvalidTOCEntryFail("test/bar.txt"), checkVerifyBrokenContentFail("test/bar.txt"), }, }, } for _, tt := range tests { if len(tt.minChunkSize) == 0 { tt.minChunkSize = []int{0} } for _, srcCompression := range srcCompressions { srcCompression := srcCompression for _, newCL := range controllers { newCL := newCL for _, prefix := range allowedPrefix { prefix := prefix for _, srcTarFormat := range []tar.Format{tar.FormatUSTAR, tar.FormatPAX, tar.FormatGNU} { srcTarFormat := srcTarFormat for _, minChunkSize := range tt.minChunkSize { minChunkSize := minChunkSize t.Run(tt.name+"-"+fmt.Sprintf("compression=%v,prefix=%q,format=%s,minChunkSize=%d", newCL(), prefix, srcTarFormat, minChunkSize), func(t *TestRunner) { // Get original tar file and chunk digests dgstMap := make(map[string]digest.Digest) tarBlob := buildTar(t, tt.tarInit(t, dgstMap), prefix, srcTarFormat) cl := newCL() rc, err := Build(compressBlob(t, tarBlob, srcCompression), WithChunkSize(chunkSize), WithCompression(cl)) if err != nil { t.Fatalf("failed to convert stargz: %v", err) } tocDigest := rc.TOCDigest() defer rc.Close() buf := new(bytes.Buffer) if _, err := io.Copy(buf, rc); err != nil { t.Fatalf("failed to copy built stargz blob: %v", err) } newStargz := buf.Bytes() // NoPrefetchLandmark is added during `Bulid`, which is expected behaviour. dgstMap[chunkID(NoPrefetchLandmark, 0, int64(len([]byte{landmarkContents})))] = digest.FromBytes([]byte{landmarkContents}) for _, check := range tt.checks { check(t, newStargz, tocDigest, dgstMap, cl, newCL) } }) } } } } } } } // checkStargzTOC checks the TOC JSON of the passed stargz has the expected // digest and contains valid chunks. It walks all entries in the stargz and // checks all chunk digests stored to the TOC JSON match the actual contents. func checkStargzTOC(t *TestRunner, sgzData []byte, tocDigest digest.Digest, dgstMap map[string]digest.Digest, controller TestingController, newController TestingControllerFactory) { sgz, err := Open( io.NewSectionReader(bytes.NewReader(sgzData), 0, int64(len(sgzData))), WithDecompressors(controller), ) if err != nil { t.Errorf("failed to parse converted stargz: %v", err) return } digestMapTOC, err := listDigests(io.NewSectionReader( bytes.NewReader(sgzData), 0, int64(len(sgzData))), controller, ) if err != nil { t.Fatalf("failed to list digest: %v", err) } found := make(map[string]bool) for id := range dgstMap { found[id] = false } zr, err := controller.Reader(bytes.NewReader(sgzData)) if err != nil { t.Fatalf("failed to decompress converted stargz: %v", err) } defer zr.Close() tr := tar.NewReader(zr) for { h, err := tr.Next() if err != nil { if err != io.EOF { t.Errorf("failed to read tar entry: %v", err) return } break } if h.Name == TOCTarName { // Check the digest of TOC JSON based on the actual contents // It's sure that TOC JSON exists in this archive because // Open succeeded. dgstr := digest.Canonical.Digester() if _, err := io.Copy(dgstr.Hash(), tr); err != nil { t.Fatalf("failed to calculate digest of TOC JSON: %v", err) } if dgstr.Digest() != tocDigest { t.Errorf("invalid TOC JSON %q; want %q", tocDigest, dgstr.Digest()) } continue } if _, ok := sgz.Lookup(h.Name); !ok { t.Errorf("lost stargz entry %q in the converted TOC", h.Name) return } var n int64 for n < h.Size { ce, ok := sgz.ChunkEntryForOffset(h.Name, n) if !ok { t.Errorf("lost chunk %q(offset=%d) in the converted TOC", h.Name, n) return } // Get the original digest to make sure the file contents are kept unchanged // from the original tar, during the whole conversion steps. id := chunkID(h.Name, n, ce.ChunkSize) want, ok := dgstMap[id] if !ok { t.Errorf("Unexpected chunk %q(offset=%d,size=%d): %v", h.Name, n, ce.ChunkSize, dgstMap) return } found[id] = true // Check the file contents dgstr := digest.Canonical.Digester() if _, err := io.CopyN(dgstr.Hash(), tr, ce.ChunkSize); err != nil { t.Fatalf("failed to calculate digest of %q (offset=%d,size=%d)", h.Name, n, ce.ChunkSize) } if want != dgstr.Digest() { t.Errorf("Invalid contents in converted stargz %q: %q; want %q", h.Name, dgstr.Digest(), want) return } // Check the digest stored in TOC JSON dgstTOC, ok := digestMapTOC[ce.Offset] if !ok { t.Errorf("digest of %q(offset=%d,size=%d,chunkOffset=%d) isn't registered", h.Name, ce.Offset, ce.ChunkSize, ce.ChunkOffset) } if want != dgstTOC { t.Errorf("Invalid digest in TOCEntry %q: %q; want %q", h.Name, dgstTOC, want) return } n += ce.ChunkSize } } for id, ok := range found { if !ok { t.Errorf("required chunk %q not found in the converted stargz: %v", id, found) } } } // checkVerifyTOC checks the verification works for the TOC JSON of the passed // stargz. It walks all entries in the stargz and checks the verifications for // all chunks work. func checkVerifyTOC(t *TestRunner, sgzData []byte, tocDigest digest.Digest, dgstMap map[string]digest.Digest, controller TestingController, newController TestingControllerFactory) { sgz, err := Open( io.NewSectionReader(bytes.NewReader(sgzData), 0, int64(len(sgzData))), WithDecompressors(controller), ) if err != nil { t.Errorf("failed to parse converted stargz: %v", err) return } ev, err := sgz.VerifyTOC(tocDigest) if err != nil { t.Errorf("failed to verify stargz: %v", err) return } found := make(map[string]bool) for id := range dgstMap { found[id] = false } zr, err := controller.Reader(bytes.NewReader(sgzData)) if err != nil { t.Fatalf("failed to decompress converted stargz: %v", err) } defer zr.Close() tr := tar.NewReader(zr) for { h, err := tr.Next() if err != nil { if err != io.EOF { t.Errorf("failed to read tar entry: %v", err) return } break } if h.Name == TOCTarName { continue } if _, ok := sgz.Lookup(h.Name); !ok { t.Errorf("lost stargz entry %q in the converted TOC", h.Name) return } var n int64 for n < h.Size { ce, ok := sgz.ChunkEntryForOffset(h.Name, n) if !ok { t.Errorf("lost chunk %q(offset=%d) in the converted TOC", h.Name, n) return } v, err := ev.Verifier(ce) if err != nil { t.Errorf("failed to get verifier for %q(offset=%d)", h.Name, n) } found[chunkID(h.Name, n, ce.ChunkSize)] = true // Check the file contents if _, err := io.CopyN(v, tr, ce.ChunkSize); err != nil { t.Fatalf("failed to get chunk of %q (offset=%d,size=%d)", h.Name, n, ce.ChunkSize) } if !v.Verified() { t.Errorf("Invalid contents in converted stargz %q (should be succeeded)", h.Name) return } n += ce.ChunkSize } } for id, ok := range found { if !ok { t.Errorf("required chunk %q not found in the converted stargz: %v", id, found) } } } // checkVerifyInvalidTOCEntryFail checks if misconfigured TOC JSON can be // detected during the verification and the verification returns an error. func checkVerifyInvalidTOCEntryFail(filename string) check { return func(t *TestRunner, sgzData []byte, tocDigest digest.Digest, dgstMap map[string]digest.Digest, controller TestingController, newController TestingControllerFactory) { funcs := map[string]rewriteFunc{ "lost digest in a entry": func(t TestingT, toc *JTOC, sgz *io.SectionReader) { var found bool for _, e := range toc.Entries { if cleanEntryName(e.Name) == filename { if e.Type != "reg" && e.Type != "chunk" { t.Fatalf("entry %q to break must be regfile or chunk", filename) } if e.ChunkDigest == "" { t.Fatalf("entry %q is already invalid", filename) } e.ChunkDigest = "" found = true } } if !found { t.Fatalf("rewrite target not found") } }, "duplicated entry offset": func(t TestingT, toc *JTOC, sgz *io.SectionReader) { var ( sampleEntry *TOCEntry targetEntry *TOCEntry ) for _, e := range toc.Entries { if e.Type == "reg" || e.Type == "chunk" { if cleanEntryName(e.Name) == filename { targetEntry = e } else { sampleEntry = e } } } if sampleEntry == nil { t.Fatalf("TOC must contain at least one regfile or chunk entry other than the rewrite target") return } if targetEntry == nil { t.Fatalf("rewrite target not found") return } targetEntry.Offset = sampleEntry.Offset }, } for name, rFunc := range funcs { t.Run(name, func(t *TestRunner) { newSgz, newTocDigest := rewriteTOCJSON(t, io.NewSectionReader(bytes.NewReader(sgzData), 0, int64(len(sgzData))), rFunc, controller) buf := new(bytes.Buffer) if _, err := io.Copy(buf, newSgz); err != nil { t.Fatalf("failed to get converted stargz") } isgz := buf.Bytes() sgz, err := Open( io.NewSectionReader(bytes.NewReader(isgz), 0, int64(len(isgz))), WithDecompressors(controller), ) if err != nil { t.Fatalf("failed to parse converted stargz: %v", err) return } _, err = sgz.VerifyTOC(newTocDigest) if err == nil { t.Errorf("must fail for invalid TOC") return } }) } } } // checkVerifyInvalidStargzFail checks if the verification detects that the // given stargz file doesn't match to the expected digest and returns error. func checkVerifyInvalidStargzFail(invalid *io.SectionReader) check { return func(t *TestRunner, sgzData []byte, tocDigest digest.Digest, dgstMap map[string]digest.Digest, controller TestingController, newController TestingControllerFactory) { cl := newController() rc, err := Build(invalid, WithChunkSize(chunkSize), WithCompression(cl)) if err != nil { t.Fatalf("failed to convert stargz: %v", err) } defer rc.Close() buf := new(bytes.Buffer) if _, err := io.Copy(buf, rc); err != nil { t.Fatalf("failed to copy built stargz blob: %v", err) } mStargz := buf.Bytes() sgz, err := Open( io.NewSectionReader(bytes.NewReader(mStargz), 0, int64(len(mStargz))), WithDecompressors(cl), ) if err != nil { t.Fatalf("failed to parse converted stargz: %v", err) return } _, err = sgz.VerifyTOC(tocDigest) if err == nil { t.Errorf("must fail for invalid TOC") return } } } // checkVerifyBrokenContentFail checks if the verifier detects broken contents // that doesn't match to the expected digest and returns error. func checkVerifyBrokenContentFail(filename string) check { return func(t *TestRunner, sgzData []byte, tocDigest digest.Digest, dgstMap map[string]digest.Digest, controller TestingController, newController TestingControllerFactory) { // Parse stargz file sgz, err := Open( io.NewSectionReader(bytes.NewReader(sgzData), 0, int64(len(sgzData))), WithDecompressors(controller), ) if err != nil { t.Fatalf("failed to parse converted stargz: %v", err) return } ev, err := sgz.VerifyTOC(tocDigest) if err != nil { t.Fatalf("failed to verify stargz: %v", err) return } // Open the target file sr, err := sgz.OpenFile(filename) if err != nil { t.Fatalf("failed to open file %q", filename) } ce, ok := sgz.ChunkEntryForOffset(filename, 0) if !ok { t.Fatalf("lost chunk %q(offset=%d) in the converted TOC", filename, 0) return } if ce.ChunkSize == 0 { t.Fatalf("file mustn't be empty") return } data := make([]byte, ce.ChunkSize) if _, err := sr.ReadAt(data, ce.ChunkOffset); err != nil { t.Errorf("failed to get data of a chunk of %q(offset=%q)", filename, ce.ChunkOffset) } // Check the broken chunk (must fail) v, err := ev.Verifier(ce) if err != nil { t.Fatalf("failed to get verifier for %q", filename) } broken := append([]byte{^data[0]}, data[1:]...) if _, err := io.CopyN(v, bytes.NewReader(broken), ce.ChunkSize); err != nil { t.Fatalf("failed to get chunk of %q (offset=%d,size=%d)", filename, ce.ChunkOffset, ce.ChunkSize) } if v.Verified() { t.Errorf("verification must fail for broken file chunk %q(org:%q,broken:%q)", filename, data, broken) } } } func chunkID(name string, offset, size int64) string { return fmt.Sprintf("%s-%d-%d", cleanEntryName(name), offset, size) } type rewriteFunc func(t TestingT, toc *JTOC, sgz *io.SectionReader) func rewriteTOCJSON(t TestingT, sgz *io.SectionReader, rewrite rewriteFunc, controller TestingController) (newSgz io.Reader, tocDigest digest.Digest) { decodedJTOC, jtocOffset, err := parseStargz(sgz, controller) if err != nil { t.Fatalf("failed to extract TOC JSON: %v", err) } rewrite(t, decodedJTOC, sgz) tocFooter, tocDigest, err := tocAndFooter(controller, decodedJTOC, jtocOffset) if err != nil { t.Fatalf("failed to create toc and footer: %v", err) } // Reconstruct stargz file with the modified TOC JSON if _, err := sgz.Seek(0, io.SeekStart); err != nil { t.Fatalf("failed to reset the seek position of stargz: %v", err) } return io.MultiReader( io.LimitReader(sgz, jtocOffset), // Original stargz (before TOC JSON) tocFooter, // Rewritten TOC and footer ), tocDigest } func listDigests(sgz *io.SectionReader, controller TestingController) (map[int64]digest.Digest, error) { decodedJTOC, _, err := parseStargz(sgz, controller) if err != nil { return nil, err } digestMap := make(map[int64]digest.Digest) for _, e := range decodedJTOC.Entries { if e.Type == "reg" || e.Type == "chunk" { if e.Type == "reg" && e.Size == 0 { continue // ignores empty file } if e.ChunkDigest == "" { return nil, fmt.Errorf("ChunkDigest of %q(off=%d) not found in TOC JSON", e.Name, e.Offset) } d, err := digest.Parse(e.ChunkDigest) if err != nil { return nil, err } digestMap[e.Offset] = d } } return digestMap, nil } func parseStargz(sgz *io.SectionReader, controller TestingController) (decodedJTOC *JTOC, jtocOffset int64, err error) { fSize := controller.FooterSize() footer := make([]byte, fSize) if _, err := sgz.ReadAt(footer, sgz.Size()-fSize); err != nil { return nil, 0, fmt.Errorf("error reading footer: %w", err) } _, tocOffset, _, err := controller.ParseFooter(footer[positive(int64(len(footer))-fSize):]) if err != nil { return nil, 0, fmt.Errorf("failed to parse footer: %w", err) } // Decode the TOC JSON var tocReader io.Reader if tocOffset >= 0 { tocReader = io.NewSectionReader(sgz, tocOffset, sgz.Size()-tocOffset-fSize) } decodedJTOC, _, err = controller.ParseTOC(tocReader) if err != nil { return nil, 0, fmt.Errorf("failed to parse TOC: %w", err) } return decodedJTOC, tocOffset, nil } func testWriteAndOpen(t *TestRunner, controllers ...TestingControllerFactory) { const content = "Some contents" invalidUtf8 := "\xff\xfe\xfd" xAttrFile := xAttr{"foo": "bar", "invalid-utf8": invalidUtf8} sampleOwner := owner{uid: 50, gid: 100} data64KB := randomContents(64000) tests := []struct { name string chunkSize int minChunkSize int in []tarEntry want []stargzCheck wantNumGz int // expected number of streams wantNumGzLossLess int // expected number of streams (> 0) in lossless mode if it's different from wantNumGz wantFailOnLossLess bool wantTOCVersion int // default = 1 }{ { name: "empty", in: tarOf(), wantNumGz: 2, // (empty tar) + TOC + footer want: checks( numTOCEntries(0), ), }, { name: "1dir_1empty_file", in: tarOf( dir("foo/"), file("foo/bar.txt", ""), ), wantNumGz: 3, // dir, TOC, footer want: checks( numTOCEntries(2), hasDir("foo/"), hasFileLen("foo/bar.txt", 0), entryHasChildren("foo", "bar.txt"), hasFileDigest("foo/bar.txt", digestFor("")), ), }, { name: "1dir_1file", in: tarOf( dir("foo/"), file("foo/bar.txt", content, xAttrFile), ), wantNumGz: 4, // var dir, foo.txt alone, TOC, footer want: checks( numTOCEntries(2), hasDir("foo/"), hasFileLen("foo/bar.txt", len(content)), hasFileDigest("foo/bar.txt", digestFor(content)), hasFileContentsRange("foo/bar.txt", 0, content), hasFileContentsRange("foo/bar.txt", 1, content[1:]), entryHasChildren("", "foo"), entryHasChildren("foo", "bar.txt"), hasFileXattrs("foo/bar.txt", "foo", "bar"), hasFileXattrs("foo/bar.txt", "invalid-utf8", invalidUtf8), ), }, { name: "2meta_2file", in: tarOf( dir("bar/", sampleOwner), dir("foo/", sampleOwner), file("foo/bar.txt", content, sampleOwner), ), wantNumGz: 4, // both dirs, foo.txt alone, TOC, footer want: checks( numTOCEntries(3), hasDir("bar/"), hasDir("foo/"), hasFileLen("foo/bar.txt", len(content)), entryHasChildren("", "bar", "foo"), entryHasChildren("foo", "bar.txt"), hasChunkEntries("foo/bar.txt", 1), hasEntryOwner("bar/", sampleOwner), hasEntryOwner("foo/", sampleOwner), hasEntryOwner("foo/bar.txt", sampleOwner), ), }, { name: "3dir", in: tarOf( dir("bar/"), dir("foo/"), dir("foo/bar/"), ), wantNumGz: 3, // 3 dirs, TOC, footer want: checks( hasDirLinkCount("bar/", 2), hasDirLinkCount("foo/", 3), hasDirLinkCount("foo/bar/", 2), ), }, { name: "symlink", in: tarOf( dir("foo/"), symlink("foo/bar", "../../x"), ), wantNumGz: 3, // metas + TOC + footer want: checks( numTOCEntries(2), hasSymlink("foo/bar", "../../x"), entryHasChildren("", "foo"), entryHasChildren("foo", "bar"), ), }, { name: "chunked_file", chunkSize: 4, in: tarOf( dir("foo/"), file("foo/big.txt", "This "+"is s"+"uch "+"a bi"+"g fi"+"le"), ), wantNumGz: 9, // dir + big.txt(6 chunks) + TOC + footer want: checks( numTOCEntries(7), // 1 for foo dir, 6 for the foo/big.txt file hasDir("foo/"), hasFileLen("foo/big.txt", len("This is such a big file")), hasFileDigest("foo/big.txt", digestFor("This is such a big file")), hasFileContentsRange("foo/big.txt", 0, "This is such a big file"), hasFileContentsRange("foo/big.txt", 1, "his is such a big file"), hasFileContentsRange("foo/big.txt", 2, "is is such a big file"), hasFileContentsRange("foo/big.txt", 3, "s is such a big file"), hasFileContentsRange("foo/big.txt", 4, " is such a big file"), hasFileContentsRange("foo/big.txt", 5, "is such a big file"), hasFileContentsRange("foo/big.txt", 6, "s such a big file"), hasFileContentsRange("foo/big.txt", 7, " such a big file"), hasFileContentsRange("foo/big.txt", 8, "such a big file"), hasFileContentsRange("foo/big.txt", 9, "uch a big file"), hasFileContentsRange("foo/big.txt", 10, "ch a big file"), hasFileContentsRange("foo/big.txt", 11, "h a big file"), hasFileContentsRange("foo/big.txt", 12, " a big file"), hasFileContentsRange("foo/big.txt", len("This is such a big file")-1, ""), hasChunkEntries("foo/big.txt", 6), ), }, { name: "recursive", in: tarOf( dir("/", sampleOwner), dir("bar/", sampleOwner), dir("foo/", sampleOwner), file("foo/bar.txt", content, sampleOwner), ), wantNumGz: 4, // dirs, bar.txt alone, TOC, footer want: checks( maxDepth(2), // 0: root directory, 1: "foo/", 2: "bar.txt" ), }, { name: "block_char_fifo", in: tarOf( tarEntryFunc(func(w *tar.Writer, prefix string, format tar.Format) error { return w.WriteHeader(&tar.Header{ Name: prefix + "b", Typeflag: tar.TypeBlock, Devmajor: 123, Devminor: 456, Format: format, }) }), tarEntryFunc(func(w *tar.Writer, prefix string, format tar.Format) error { return w.WriteHeader(&tar.Header{ Name: prefix + "c", Typeflag: tar.TypeChar, Devmajor: 111, Devminor: 222, Format: format, }) }), tarEntryFunc(func(w *tar.Writer, prefix string, format tar.Format) error { return w.WriteHeader(&tar.Header{ Name: prefix + "f", Typeflag: tar.TypeFifo, Format: format, }) }), ), wantNumGz: 3, want: checks( lookupMatch("b", &TOCEntry{Name: "b", Type: "block", DevMajor: 123, DevMinor: 456, NumLink: 1}), lookupMatch("c", &TOCEntry{Name: "c", Type: "char", DevMajor: 111, DevMinor: 222, NumLink: 1}), lookupMatch("f", &TOCEntry{Name: "f", Type: "fifo", NumLink: 1}), ), }, { name: "modes", in: tarOf( dir("foo1/", 0755|os.ModeDir|os.ModeSetgid), file("foo1/bar1", content, 0700|os.ModeSetuid), file("foo1/bar2", content, 0755|os.ModeSetgid), dir("foo2/", 0755|os.ModeDir|os.ModeSticky), file("foo2/bar3", content, 0755|os.ModeSticky), dir("foo3/", 0755|os.ModeDir), file("foo3/bar4", content, os.FileMode(0700)), file("foo3/bar5", content, os.FileMode(0755)), ), wantNumGz: 8, // dir, bar1 alone, bar2 alone + dir, bar3 alone + dir, bar4 alone, bar5 alone, TOC, footer want: checks( hasMode("foo1/", 0755|os.ModeDir|os.ModeSetgid), hasMode("foo1/bar1", 0700|os.ModeSetuid), hasMode("foo1/bar2", 0755|os.ModeSetgid), hasMode("foo2/", 0755|os.ModeDir|os.ModeSticky), hasMode("foo2/bar3", 0755|os.ModeSticky), hasMode("foo3/", 0755|os.ModeDir), hasMode("foo3/bar4", os.FileMode(0700)), hasMode("foo3/bar5", os.FileMode(0755)), ), }, { name: "lossy", in: tarOf( dir("bar/", sampleOwner), dir("foo/", sampleOwner), file("foo/bar.txt", content, sampleOwner), file(TOCTarName, "dummy"), // ignored by the writer. (lossless write returns error) ), wantNumGz: 4, // both dirs, foo.txt alone, TOC, footer want: checks( numTOCEntries(3), hasDir("bar/"), hasDir("foo/"), hasFileLen("foo/bar.txt", len(content)), entryHasChildren("", "bar", "foo"), entryHasChildren("foo", "bar.txt"), hasChunkEntries("foo/bar.txt", 1), hasEntryOwner("bar/", sampleOwner), hasEntryOwner("foo/", sampleOwner), hasEntryOwner("foo/bar.txt", sampleOwner), ), wantFailOnLossLess: true, }, { name: "hardlink should be replaced to the destination entry", in: tarOf( dir("foo/"), file("foo/foo1", "test"), link("foolink", "foo/foo1"), ), wantNumGz: 4, // dir, foo1 + link, TOC, footer want: checks( mustSameEntry("foo/foo1", "foolink"), ), }, { name: "several_files_in_chunk", minChunkSize: 8000, in: tarOf( dir("foo/"), file("foo/foo1", data64KB), file("foo2", "bb"), file("foo22", "ccc"), dir("bar/"), file("bar/bar.txt", "aaa"), file("foo3", data64KB), ), // NOTE: we assume that the compressed "data64KB" is still larger than 8KB wantNumGz: 4, // dir+foo1, foo2+foo22+dir+bar.txt+foo3, TOC, footer want: checks( numTOCEntries(7), // dir, foo1, foo2, foo22, dir, bar.txt, foo3 hasDir("foo/"), hasDir("bar/"), hasFileLen("foo/foo1", len(data64KB)), hasFileLen("foo2", len("bb")), hasFileLen("foo22", len("ccc")), hasFileLen("bar/bar.txt", len("aaa")), hasFileLen("foo3", len(data64KB)), hasFileDigest("foo/foo1", digestFor(data64KB)), hasFileDigest("foo2", digestFor("bb")), hasFileDigest("foo22", digestFor("ccc")), hasFileDigest("bar/bar.txt", digestFor("aaa")), hasFileDigest("foo3", digestFor(data64KB)), hasFileContentsWithPreRead("foo22", 0, "ccc", chunkInfo{"foo2", "bb"}, chunkInfo{"bar/bar.txt", "aaa"}, chunkInfo{"foo3", data64KB}), hasFileContentsRange("foo/foo1", 0, data64KB), hasFileContentsRange("foo2", 0, "bb"), hasFileContentsRange("foo2", 1, "b"), hasFileContentsRange("foo22", 0, "ccc"), hasFileContentsRange("foo22", 1, "cc"), hasFileContentsRange("foo22", 2, "c"), hasFileContentsRange("bar/bar.txt", 0, "aaa"), hasFileContentsRange("bar/bar.txt", 1, "aa"), hasFileContentsRange("bar/bar.txt", 2, "a"), hasFileContentsRange("foo3", 0, data64KB), hasFileContentsRange("foo3", 1, data64KB[1:]), hasFileContentsRange("foo3", 2, data64KB[2:]), hasFileContentsRange("foo3", len(data64KB)/2, data64KB[len(data64KB)/2:]), hasFileContentsRange("foo3", len(data64KB)-1, data64KB[len(data64KB)-1:]), ), }, { name: "several_files_in_chunk_chunked", minChunkSize: 8000, chunkSize: 32000, in: tarOf( dir("foo/"), file("foo/foo1", data64KB), file("foo2", "bb"), dir("bar/"), file("foo3", data64KB), ), // NOTE: we assume that the compressed chunk of "data64KB" is still larger than 8KB wantNumGz: 6, // dir+foo1(1), foo1(2), foo2+dir+foo3(1), foo3(2), TOC, footer want: checks( numTOCEntries(7), // dir, foo1(2 chunks), foo2, dir, foo3(2 chunks) hasDir("foo/"), hasDir("bar/"), hasFileLen("foo/foo1", len(data64KB)), hasFileLen("foo2", len("bb")), hasFileLen("foo3", len(data64KB)), hasFileDigest("foo/foo1", digestFor(data64KB)), hasFileDigest("foo2", digestFor("bb")), hasFileDigest("foo3", digestFor(data64KB)), hasFileContentsWithPreRead("foo2", 0, "bb", chunkInfo{"foo3", data64KB[:32000]}), hasFileContentsRange("foo/foo1", 0, data64KB), hasFileContentsRange("foo/foo1", 1, data64KB[1:]), hasFileContentsRange("foo/foo1", 2, data64KB[2:]), hasFileContentsRange("foo/foo1", len(data64KB)/2, data64KB[len(data64KB)/2:]), hasFileContentsRange("foo/foo1", len(data64KB)-1, data64KB[len(data64KB)-1:]), hasFileContentsRange("foo2", 0, "bb"), hasFileContentsRange("foo2", 1, "b"), hasFileContentsRange("foo3", 0, data64KB), hasFileContentsRange("foo3", 1, data64KB[1:]), hasFileContentsRange("foo3", 2, data64KB[2:]), hasFileContentsRange("foo3", len(data64KB)/2, data64KB[len(data64KB)/2:]), hasFileContentsRange("foo3", len(data64KB)-1, data64KB[len(data64KB)-1:]), ), }, } for _, tt := range tests { for _, newCL := range controllers { newCL := newCL for _, prefix := range allowedPrefix { prefix := prefix for _, srcTarFormat := range []tar.Format{tar.FormatUSTAR, tar.FormatPAX, tar.FormatGNU} { srcTarFormat := srcTarFormat for _, lossless := range []bool{true, false} { t.Run(tt.name+"-"+fmt.Sprintf("compression=%v,prefix=%q,lossless=%v,format=%s", newCL(), prefix, lossless, srcTarFormat), func(t *TestRunner) { var tr io.Reader = buildTar(t, tt.in, prefix, srcTarFormat) origTarDgstr := digest.Canonical.Digester() tr = io.TeeReader(tr, origTarDgstr.Hash()) var stargzBuf bytes.Buffer cl1 := newCL() w := NewWriterWithCompressor(&stargzBuf, cl1) w.ChunkSize = tt.chunkSize w.MinChunkSize = tt.minChunkSize if lossless { err := w.AppendTarLossLess(tr) if tt.wantFailOnLossLess { if err != nil { return // expected to fail } t.Fatalf("Append wanted to fail on lossless") } if err != nil { t.Fatalf("Append(lossless): %v", err) } } else { if err := w.AppendTar(tr); err != nil { t.Fatalf("Append: %v", err) } } if _, err := w.Close(); err != nil { t.Fatalf("Writer.Close: %v", err) } b := stargzBuf.Bytes() if lossless { // Check if the result blob reserves original tar metadata rc, err := Unpack(io.NewSectionReader(bytes.NewReader(b), 0, int64(len(b))), cl1) if err != nil { t.Errorf("failed to decompress blob: %v", err) return } defer rc.Close() resultDgstr := digest.Canonical.Digester() if _, err := io.Copy(resultDgstr.Hash(), rc); err != nil { t.Errorf("failed to read result decompressed blob: %v", err) return } if resultDgstr.Digest() != origTarDgstr.Digest() { t.Errorf("lossy compression occurred: digest=%v; want %v", resultDgstr.Digest(), origTarDgstr.Digest()) return } } diffID := w.DiffID() wantDiffID := cl1.DiffIDOf(t, b) if diffID != wantDiffID { t.Errorf("DiffID = %q; want %q", diffID, wantDiffID) } telemetry, checkCalled := newCalledTelemetry() sr := io.NewSectionReader(bytes.NewReader(b), 0, int64(len(b))) r, err := Open( sr, WithDecompressors(cl1), WithTelemetry(telemetry), ) if err != nil { t.Fatalf("stargz.Open: %v", err) } if _, ok := r.Lookup(""); !ok { t.Fatalf("failed to lookup rootdir: %v", err) } wantTOCVersion := 1 if tt.wantTOCVersion > 0 { wantTOCVersion = tt.wantTOCVersion } if r.toc.Version != wantTOCVersion { t.Fatalf("invalid TOC Version %d; wanted %d", r.toc.Version, wantTOCVersion) } footerSize := cl1.FooterSize() footerOffset := sr.Size() - footerSize footer := make([]byte, footerSize) if _, err := sr.ReadAt(footer, footerOffset); err != nil { t.Errorf("failed to read footer: %v", err) } _, tocOffset, _, err := cl1.ParseFooter(footer) if err != nil { t.Errorf("failed to parse footer: %v", err) } if err := checkCalled(tocOffset >= 0); err != nil { t.Errorf("telemetry failure: %v", err) } wantNumGz := tt.wantNumGz if lossless && tt.wantNumGzLossLess > 0 { wantNumGz = tt.wantNumGzLossLess } streamOffsets := []int64{0} prevOffset := int64(-1) streams := 0 for _, e := range r.toc.Entries { if e.Offset > prevOffset { streamOffsets = append(streamOffsets, e.Offset) prevOffset = e.Offset streams++ } } streams++ // TOC if tocOffset >= 0 { // toc is in the blob streamOffsets = append(streamOffsets, tocOffset) } streams++ // footer streamOffsets = append(streamOffsets, footerOffset) if streams != wantNumGz { t.Errorf("number of streams in TOC = %d; want %d", streams, wantNumGz) } t.Logf("testing streams: %+v", streamOffsets) cl1.TestStreams(t, b, streamOffsets) for _, want := range tt.want { want.check(t, r) } }) } } } } } } type chunkInfo struct { name string data string } func newCalledTelemetry() (telemetry *Telemetry, check func(needsGetTOC bool) error) { var getFooterLatencyCalled bool var getTocLatencyCalled bool var deserializeTocLatencyCalled bool return &Telemetry{ func(time.Time) { getFooterLatencyCalled = true }, func(time.Time) { getTocLatencyCalled = true }, func(time.Time) { deserializeTocLatencyCalled = true }, }, func(needsGetTOC bool) error { var allErr []error if !getFooterLatencyCalled { allErr = append(allErr, fmt.Errorf("metrics GetFooterLatency isn't called")) } if needsGetTOC { if !getTocLatencyCalled { allErr = append(allErr, fmt.Errorf("metrics GetTocLatency isn't called")) } } if !deserializeTocLatencyCalled { allErr = append(allErr, fmt.Errorf("metrics DeserializeTocLatency isn't called")) } return errorutil.Aggregate(allErr) } } func digestFor(content string) string { sum := sha256.Sum256([]byte(content)) return fmt.Sprintf("sha256:%x", sum) } type numTOCEntries int func (n numTOCEntries) check(t TestingT, r *Reader) { if r.toc == nil { t.Fatal("nil TOC") } if got, want := len(r.toc.Entries), int(n); got != want { t.Errorf("got %d TOC entries; want %d", got, want) } t.Logf("got TOC entries:") for i, ent := range r.toc.Entries { entj, _ := json.Marshal(ent) t.Logf(" [%d]: %s\n", i, entj) } if t.Failed() { t.FailNow() } } func checks(s ...stargzCheck) []stargzCheck { return s } type stargzCheck interface { check(t TestingT, r *Reader) } type stargzCheckFn func(TestingT, *Reader) func (f stargzCheckFn) check(t TestingT, r *Reader) { f(t, r) } func maxDepth(max int) stargzCheck { return stargzCheckFn(func(t TestingT, r *Reader) { e, ok := r.Lookup("") if !ok { t.Fatal("root directory not found") } d, err := getMaxDepth(t, e, 0, 10*max) if err != nil { t.Errorf("failed to get max depth (wanted %d): %v", max, err) return } if d != max { t.Errorf("invalid depth %d; want %d", d, max) return } }) } func getMaxDepth(t TestingT, e *TOCEntry, current, limit int) (max int, rErr error) { if current > limit { return -1, fmt.Errorf("walkMaxDepth: exceeds limit: current:%d > limit:%d", current, limit) } max = current e.ForeachChild(func(baseName string, ent *TOCEntry) bool { t.Logf("%q(basename:%q) is child of %q\n", ent.Name, baseName, e.Name) d, err := getMaxDepth(t, ent, current+1, limit) if err != nil { rErr = err return false } if d > max { max = d } return true }) return } func hasFileLen(file string, wantLen int) stargzCheck { return stargzCheckFn(func(t TestingT, r *Reader) { for _, ent := range r.toc.Entries { if ent.Name == file { if ent.Type != "reg" { t.Errorf("file type of %q is %q; want \"reg\"", file, ent.Type) } else if ent.Size != int64(wantLen) { t.Errorf("file size of %q = %d; want %d", file, ent.Size, wantLen) } return } } t.Errorf("file %q not found", file) }) } func hasFileXattrs(file, name, value string) stargzCheck { return stargzCheckFn(func(t TestingT, r *Reader) { for _, ent := range r.toc.Entries { if ent.Name == file { if ent.Type != "reg" { t.Errorf("file type of %q is %q; want \"reg\"", file, ent.Type) } if ent.Xattrs == nil { t.Errorf("file %q has no xattrs", file) return } valueFound, found := ent.Xattrs[name] if !found { t.Errorf("file %q has no xattr %q", file, name) return } if string(valueFound) != value { t.Errorf("file %q has xattr %q with value %q instead of %q", file, name, valueFound, value) } return } } t.Errorf("file %q not found", file) }) } func hasFileDigest(file string, digest string) stargzCheck { return stargzCheckFn(func(t TestingT, r *Reader) { ent, ok := r.Lookup(file) if !ok { t.Fatalf("didn't find TOCEntry for file %q", file) } if ent.Digest != digest { t.Fatalf("Digest(%q) = %q, want %q", file, ent.Digest, digest) } }) } func hasFileContentsWithPreRead(file string, offset int, want string, extra ...chunkInfo) stargzCheck { return stargzCheckFn(func(t TestingT, r *Reader) { extraMap := make(map[string]chunkInfo) for _, e := range extra { extraMap[e.name] = e } var extraNames []string for n := range extraMap { extraNames = append(extraNames, n) } f, err := r.OpenFileWithPreReader(file, func(e *TOCEntry, cr io.Reader) error { t.Logf("On %q: got preread of %q", file, e.Name) ex, ok := extraMap[e.Name] if !ok { t.Fatalf("fail on %q: unexpected entry %q: %+v, %+v", file, e.Name, e, extraNames) } got, err := io.ReadAll(cr) if err != nil { t.Fatalf("fail on %q: failed to read %q: %v", file, e.Name, err) } if ex.data != string(got) { t.Fatalf("fail on %q: unexpected contents of %q: len=%d; want=%d", file, e.Name, len(got), len(ex.data)) } delete(extraMap, e.Name) return nil }) if err != nil { t.Fatal(err) } got := make([]byte, len(want)) n, err := f.ReadAt(got, int64(offset)) if err != nil { t.Fatalf("ReadAt(len %d, offset %d, size %d) = %v, %v", len(got), offset, f.Size(), n, err) } if string(got) != want { t.Fatalf("ReadAt(len %d, offset %d) = %q, want %q", len(got), offset, viewContent(got), viewContent([]byte(want))) } if len(extraMap) != 0 { var exNames []string for _, ex := range extraMap { exNames = append(exNames, ex.name) } t.Fatalf("fail on %q: some entries aren't read: %+v", file, exNames) } }) } func hasFileContentsRange(file string, offset int, want string) stargzCheck { return stargzCheckFn(func(t TestingT, r *Reader) { f, err := r.OpenFile(file) if err != nil { t.Fatal(err) } got := make([]byte, len(want)) n, err := f.ReadAt(got, int64(offset)) if err != nil { t.Fatalf("ReadAt(len %d, offset %d) = %v, %v", len(got), offset, n, err) } if string(got) != want { t.Fatalf("ReadAt(len %d, offset %d) = %q, want %q", len(got), offset, viewContent(got), viewContent([]byte(want))) } }) } func hasChunkEntries(file string, wantChunks int) stargzCheck { return stargzCheckFn(func(t TestingT, r *Reader) { ent, ok := r.Lookup(file) if !ok { t.Fatalf("no file for %q", file) } if ent.Type != "reg" { t.Fatalf("file %q has unexpected type %q; want reg", file, ent.Type) } chunks := r.getChunks(ent) if len(chunks) != wantChunks { t.Errorf("len(r.getChunks(%q)) = %d; want %d", file, len(chunks), wantChunks) return } f := chunks[0] var gotChunks []*TOCEntry var last *TOCEntry for off := int64(0); off < f.Size; off++ { e, ok := r.ChunkEntryForOffset(file, off) if !ok { t.Errorf("no ChunkEntryForOffset at %d", off) return } if last != e { gotChunks = append(gotChunks, e) last = e } } if !reflect.DeepEqual(chunks, gotChunks) { t.Errorf("gotChunks=%d, want=%d; contents mismatch", len(gotChunks), wantChunks) } // And verify the NextOffset for i := 0; i < len(gotChunks)-1; i++ { ci := gotChunks[i] cnext := gotChunks[i+1] if ci.NextOffset() != cnext.Offset { t.Errorf("chunk %d NextOffset %d != next chunk's Offset of %d", i, ci.NextOffset(), cnext.Offset) } } }) } func entryHasChildren(dir string, want ...string) stargzCheck { return stargzCheckFn(func(t TestingT, r *Reader) { want := append([]string(nil), want...) var got []string ent, ok := r.Lookup(dir) if !ok { t.Fatalf("didn't find TOCEntry for dir node %q", dir) } for baseName := range ent.children { got = append(got, baseName) } sort.Strings(got) sort.Strings(want) if !reflect.DeepEqual(got, want) { t.Errorf("children of %q = %q; want %q", dir, got, want) } }) } func hasDir(file string) stargzCheck { return stargzCheckFn(func(t TestingT, r *Reader) { for _, ent := range r.toc.Entries { if ent.Name == cleanEntryName(file) { if ent.Type != "dir" { t.Errorf("file type of %q is %q; want \"dir\"", file, ent.Type) } return } } t.Errorf("directory %q not found", file) }) } func hasDirLinkCount(file string, count int) stargzCheck { return stargzCheckFn(func(t TestingT, r *Reader) { for _, ent := range r.toc.Entries { if ent.Name == cleanEntryName(file) { if ent.Type != "dir" { t.Errorf("file type of %q is %q; want \"dir\"", file, ent.Type) return } if ent.NumLink != count { t.Errorf("link count of %q = %d; want %d", file, ent.NumLink, count) } return } } t.Errorf("directory %q not found", file) }) } func hasMode(file string, mode os.FileMode) stargzCheck { return stargzCheckFn(func(t TestingT, r *Reader) { for _, ent := range r.toc.Entries { if ent.Name == cleanEntryName(file) { if ent.Stat().Mode() != mode { t.Errorf("invalid mode: got %v; want %v", ent.Stat().Mode(), mode) return } return } } t.Errorf("file %q not found", file) }) } func hasSymlink(file, target string) stargzCheck { return stargzCheckFn(func(t TestingT, r *Reader) { for _, ent := range r.toc.Entries { if ent.Name == file { if ent.Type != "symlink" { t.Errorf("file type of %q is %q; want \"symlink\"", file, ent.Type) } else if ent.LinkName != target { t.Errorf("link target of symlink %q is %q; want %q", file, ent.LinkName, target) } return } } t.Errorf("symlink %q not found", file) }) } func lookupMatch(name string, want *TOCEntry) stargzCheck { return stargzCheckFn(func(t TestingT, r *Reader) { e, ok := r.Lookup(name) if !ok { t.Fatalf("failed to Lookup entry %q", name) } if !reflect.DeepEqual(e, want) { t.Errorf("entry %q mismatch.\n got: %+v\nwant: %+v\n", name, e, want) } }) } func hasEntryOwner(entry string, owner owner) stargzCheck { return stargzCheckFn(func(t TestingT, r *Reader) { ent, ok := r.Lookup(strings.TrimSuffix(entry, "/")) if !ok { t.Errorf("entry %q not found", entry) return } if ent.UID != owner.uid || ent.GID != owner.gid { t.Errorf("entry %q has invalid owner (uid:%d, gid:%d) instead of (uid:%d, gid:%d)", entry, ent.UID, ent.GID, owner.uid, owner.gid) return } }) } func mustSameEntry(files ...string) stargzCheck { return stargzCheckFn(func(t TestingT, r *Reader) { var first *TOCEntry for _, f := range files { if first == nil { var ok bool first, ok = r.Lookup(f) if !ok { t.Errorf("unknown first file on Lookup: %q", f) return } } // Test Lookup e, ok := r.Lookup(f) if !ok { t.Errorf("unknown file on Lookup: %q", f) return } if e != first { t.Errorf("Lookup: %+v(%p) != %+v(%p)", e, e, first, first) return } // Test LookupChild pe, ok := r.Lookup(filepath.Dir(filepath.Clean(f))) if !ok { t.Errorf("failed to get parent of %q", f) return } e, ok = pe.LookupChild(filepath.Base(filepath.Clean(f))) if !ok { t.Errorf("failed to get %q as the child of %+v", f, pe) return } if e != first { t.Errorf("LookupChild: %+v(%p) != %+v(%p)", e, e, first, first) return } // Test ForeachChild pe.ForeachChild(func(baseName string, e *TOCEntry) bool { if baseName == filepath.Base(filepath.Clean(f)) { if e != first { t.Errorf("ForeachChild: %+v(%p) != %+v(%p)", e, e, first, first) return false } } return true }) } }) } func viewContent(c []byte) string { if len(c) < 100 { return string(c) } return string(c[:50]) + "...(omit)..." + string(c[50:100]) } func tarOf(s ...tarEntry) []tarEntry { return s } type tarEntry interface { appendTar(tw *tar.Writer, prefix string, format tar.Format) error } type tarEntryFunc func(*tar.Writer, string, tar.Format) error func (f tarEntryFunc) appendTar(tw *tar.Writer, prefix string, format tar.Format) error { return f(tw, prefix, format) } func buildTar(t TestingT, ents []tarEntry, prefix string, opts ...interface{}) *io.SectionReader { format := tar.FormatUnknown for _, opt := range opts { switch v := opt.(type) { case tar.Format: format = v default: panic(fmt.Errorf("unsupported opt for buildTar: %v", opt)) } } buf := new(bytes.Buffer) tw := tar.NewWriter(buf) for _, ent := range ents { if err := ent.appendTar(tw, prefix, format); err != nil { t.Fatalf("building input tar: %v", err) } } if err := tw.Close(); err != nil { t.Errorf("closing write of input tar: %v", err) } data := append(buf.Bytes(), make([]byte, 100)...) // append empty bytes at the tail to see lossless works return io.NewSectionReader(bytes.NewReader(data), 0, int64(len(data))) } func dir(name string, opts ...interface{}) tarEntry { return tarEntryFunc(func(tw *tar.Writer, prefix string, format tar.Format) error { var o owner mode := os.FileMode(0755) for _, opt := range opts { switch v := opt.(type) { case owner: o = v case os.FileMode: mode = v default: return errors.New("unsupported opt") } } if !strings.HasSuffix(name, "/") { panic(fmt.Sprintf("missing trailing slash in dir %q ", name)) } tm, err := fileModeToTarMode(mode) if err != nil { return err } return tw.WriteHeader(&tar.Header{ Typeflag: tar.TypeDir, Name: prefix + name, Mode: tm, Uid: o.uid, Gid: o.gid, Format: format, }) }) } // xAttr are extended attributes to set on test files created with the file func. type xAttr map[string]string // owner is owner ot set on test files and directories with the file and dir functions. type owner struct { uid int gid int } func file(name, contents string, opts ...interface{}) tarEntry { return tarEntryFunc(func(tw *tar.Writer, prefix string, format tar.Format) error { var xattrs xAttr var o owner mode := os.FileMode(0644) for _, opt := range opts { switch v := opt.(type) { case xAttr: xattrs = v case owner: o = v case os.FileMode: mode = v default: return errors.New("unsupported opt") } } if strings.HasSuffix(name, "/") { return fmt.Errorf("bogus trailing slash in file %q", name) } tm, err := fileModeToTarMode(mode) if err != nil { return err } if len(xattrs) > 0 { format = tar.FormatPAX // only PAX supports xattrs } if err := tw.WriteHeader(&tar.Header{ Typeflag: tar.TypeReg, Name: prefix + name, Mode: tm, Xattrs: xattrs, Size: int64(len(contents)), Uid: o.uid, Gid: o.gid, Format: format, }); err != nil { return err } _, err = io.WriteString(tw, contents) return err }) } func symlink(name, target string) tarEntry { return tarEntryFunc(func(tw *tar.Writer, prefix string, format tar.Format) error { return tw.WriteHeader(&tar.Header{ Typeflag: tar.TypeSymlink, Name: prefix + name, Linkname: target, Mode: 0644, Format: format, }) }) } func link(name string, linkname string) tarEntry { now := time.Now() return tarEntryFunc(func(w *tar.Writer, prefix string, format tar.Format) error { return w.WriteHeader(&tar.Header{ Typeflag: tar.TypeLink, Name: prefix + name, Linkname: linkname, ModTime: now, Format: format, }) }) } func chardev(name string, major, minor int64) tarEntry { now := time.Now() return tarEntryFunc(func(w *tar.Writer, prefix string, format tar.Format) error { return w.WriteHeader(&tar.Header{ Typeflag: tar.TypeChar, Name: prefix + name, Devmajor: major, Devminor: minor, ModTime: now, Format: format, }) }) } func blockdev(name string, major, minor int64) tarEntry { now := time.Now() return tarEntryFunc(func(w *tar.Writer, prefix string, format tar.Format) error { return w.WriteHeader(&tar.Header{ Typeflag: tar.TypeBlock, Name: prefix + name, Devmajor: major, Devminor: minor, ModTime: now, Format: format, }) }) } func fifo(name string) tarEntry { now := time.Now() return tarEntryFunc(func(w *tar.Writer, prefix string, format tar.Format) error { return w.WriteHeader(&tar.Header{ Typeflag: tar.TypeFifo, Name: prefix + name, ModTime: now, Format: format, }) }) } func prefetchLandmark() tarEntry { return tarEntryFunc(func(w *tar.Writer, prefix string, format tar.Format) error { if err := w.WriteHeader(&tar.Header{ Name: PrefetchLandmark, Typeflag: tar.TypeReg, Size: int64(len([]byte{landmarkContents})), Format: format, }); err != nil { return err } contents := []byte{landmarkContents} if _, err := io.CopyN(w, bytes.NewReader(contents), int64(len(contents))); err != nil { return err } return nil }) } func noPrefetchLandmark() tarEntry { return tarEntryFunc(func(w *tar.Writer, prefix string, format tar.Format) error { if err := w.WriteHeader(&tar.Header{ Name: NoPrefetchLandmark, Typeflag: tar.TypeReg, Size: int64(len([]byte{landmarkContents})), Format: format, }); err != nil { return err } contents := []byte{landmarkContents} if _, err := io.CopyN(w, bytes.NewReader(contents), int64(len(contents))); err != nil { return err } return nil }) } func regDigest(t TestingT, name string, contentStr string, digestMap map[string]digest.Digest) tarEntry { if digestMap == nil { t.Fatalf("digest map mustn't be nil") } content := []byte(contentStr) var n int64 for n < int64(len(content)) { size := int64(chunkSize) remain := int64(len(content)) - n if remain < size { size = remain } dgstr := digest.Canonical.Digester() if _, err := io.CopyN(dgstr.Hash(), bytes.NewReader(content[n:n+size]), size); err != nil { t.Fatalf("failed to calculate digest of %q (name=%q,offset=%d,size=%d)", string(content[n:n+size]), name, n, size) } digestMap[chunkID(name, n, size)] = dgstr.Digest() n += size } return tarEntryFunc(func(w *tar.Writer, prefix string, format tar.Format) error { if err := w.WriteHeader(&tar.Header{ Typeflag: tar.TypeReg, Name: prefix + name, Size: int64(len(content)), Format: format, }); err != nil { return err } if _, err := io.CopyN(w, bytes.NewReader(content), int64(len(content))); err != nil { return err } return nil }) } var runes = []rune("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") func randomContents(n int) string { b := make([]rune, n) for i := range b { bi, err := rand.Int(rand.Reader, big.NewInt(int64(len(runes)))) if err != nil { panic(err) } b[i] = runes[int(bi.Int64())] } return string(b) } func fileModeToTarMode(mode os.FileMode) (int64, error) { h, err := tar.FileInfoHeader(fileInfoOnlyMode(mode), "") if err != nil { return 0, err } return h.Mode, nil } // fileInfoOnlyMode is os.FileMode that populates only file mode. type fileInfoOnlyMode os.FileMode func (f fileInfoOnlyMode) Name() string { return "" } func (f fileInfoOnlyMode) Size() int64 { return 0 } func (f fileInfoOnlyMode) Mode() os.FileMode { return os.FileMode(f) } func (f fileInfoOnlyMode) ModTime() time.Time { return time.Now() } func (f fileInfoOnlyMode) IsDir() bool { return os.FileMode(f).IsDir() } func (f fileInfoOnlyMode) Sys() interface{} { return nil } func CheckGzipHasStreams(t TestingT, b []byte, streams []int64) { if len(streams) == 0 { return // nop } wants := map[int64]struct{}{} for _, s := range streams { wants[s] = struct{}{} } len0 := len(b) br := bytes.NewReader(b) zr := new(gzip.Reader) t.Logf("got gzip streams:") numStreams := 0 for { zoff := len0 - br.Len() if err := zr.Reset(br); err != nil { if err == io.EOF { return } t.Fatalf("countStreams(gzip), Reset: %v", err) } zr.Multistream(false) n, err := io.Copy(io.Discard, zr) if err != nil { t.Fatalf("countStreams(gzip), Copy: %v", err) } var extra string if len(zr.Extra) > 0 { extra = fmt.Sprintf("; extra=%q", zr.Extra) } t.Logf(" [%d] at %d in stargz, uncompressed length %d%s", numStreams, zoff, n, extra) delete(wants, int64(zoff)) numStreams++ } } func GzipDiffIDOf(t TestingT, b []byte) string { h := sha256.New() zr, err := gzip.NewReader(bytes.NewReader(b)) if err != nil { t.Fatalf("diffIDOf(gzip): %v", err) } defer zr.Close() if _, err := io.Copy(h, zr); err != nil { t.Fatalf("diffIDOf(gzip).Copy: %v", err) } return fmt.Sprintf("sha256:%x", h.Sum(nil)) } ================================================ FILE: vendor/github.com/containerd/stargz-snapshotter/estargz/types.go ================================================ /* Copyright The containerd Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Copyright 2019 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. */ package estargz import ( "archive/tar" "hash" "io" "os" "path" "time" digest "github.com/opencontainers/go-digest" ) const ( // TOCTarName is the name of the JSON file in the tar archive in the // table of contents gzip stream. TOCTarName = "stargz.index.json" // FooterSize is the number of bytes in the footer // // The footer is an empty gzip stream with no compression and an Extra // header of the form "%016xSTARGZ", where the 64 bit hex-encoded // number is the offset to the gzip stream of JSON TOC. // // 51 comes from: // // 10 bytes gzip header // 2 bytes XLEN (length of Extra field) = 26 (4 bytes header + 16 hex digits + len("STARGZ")) // 2 bytes Extra: SI1 = 'S', SI2 = 'G' // 2 bytes Extra: LEN = 22 (16 hex digits + len("STARGZ")) // 22 bytes Extra: subfield = fmt.Sprintf("%016xSTARGZ", offsetOfTOC) // 5 bytes flate header // 8 bytes gzip footer // (End of the eStargz blob) // // NOTE: For Extra fields, subfield IDs SI1='S' SI2='G' is used for eStargz. FooterSize = 51 // legacyFooterSize is the number of bytes in the legacy stargz footer. // // 47 comes from: // // 10 byte gzip header + // 2 byte (LE16) length of extra, encoding 22 (16 hex digits + len("STARGZ")) == "\x16\x00" + // 22 bytes of extra (fmt.Sprintf("%016xSTARGZ", tocGzipOffset)) // 5 byte flate header // 8 byte gzip footer (two little endian uint32s: digest, size) legacyFooterSize = 47 // TOCJSONDigestAnnotation is an annotation for an image layer. This stores the // digest of the TOC JSON. // This annotation is valid only when it is specified in `.[]layers.annotations` // of an image manifest. TOCJSONDigestAnnotation = "containerd.io/snapshot/stargz/toc.digest" // StoreUncompressedSizeAnnotation is an additional annotation key for eStargz to enable lazy // pulling on containers/storage. Stargz Store is required to expose the layer's uncompressed size // to the runtime but current OCI image doesn't ship this information by default. So we store this // to the special annotation. StoreUncompressedSizeAnnotation = "io.containers.estargz.uncompressed-size" // PrefetchLandmark is a file entry which indicates the end position of // prefetch in the stargz file. PrefetchLandmark = ".prefetch.landmark" // NoPrefetchLandmark is a file entry which indicates that no prefetch should // occur in the stargz file. NoPrefetchLandmark = ".no.prefetch.landmark" landmarkContents = 0xf ) // JTOC is the JSON-serialized table of contents index of the files in the stargz file. type JTOC struct { Version int `json:"version"` Entries []*TOCEntry `json:"entries"` } // TOCEntry is an entry in the stargz file's TOC (Table of Contents). type TOCEntry struct { // Name is the tar entry's name. It is the complete path // stored in the tar file, not just the base name. Name string `json:"name"` // Type is one of "dir", "reg", "symlink", "hardlink", "char", // "block", "fifo", or "chunk". // The "chunk" type is used for regular file data chunks past the first // TOCEntry; the 2nd chunk and on have only Type ("chunk"), Offset, // ChunkOffset, and ChunkSize populated. Type string `json:"type"` // Size, for regular files, is the logical size of the file. Size int64 `json:"size,omitempty"` // ModTime3339 is the modification time of the tar entry. Empty // means zero or unknown. Otherwise it's in UTC RFC3339 // format. Use the ModTime method to access the time.Time value. ModTime3339 string `json:"modtime,omitempty"` modTime time.Time // LinkName, for symlinks and hardlinks, is the link target. LinkName string `json:"linkName,omitempty"` // Mode is the permission and mode bits. Mode int64 `json:"mode,omitempty"` // UID is the user ID of the owner. UID int `json:"uid,omitempty"` // GID is the group ID of the owner. GID int `json:"gid,omitempty"` // Uname is the username of the owner. // // In the serialized JSON, this field may only be present for // the first entry with the same UID. Uname string `json:"userName,omitempty"` // Gname is the group name of the owner. // // In the serialized JSON, this field may only be present for // the first entry with the same GID. Gname string `json:"groupName,omitempty"` // Offset, for regular files, provides the offset in the // stargz file to the file's data bytes. See ChunkOffset and // ChunkSize. Offset int64 `json:"offset,omitempty"` // InnerOffset is an optional field indicates uncompressed offset // of this "reg" or "chunk" payload in a stream starts from Offset. // This field enables to put multiple "reg" or "chunk" payloads // in one chunk with having the same Offset but different InnerOffset. InnerOffset int64 `json:"innerOffset,omitempty"` nextOffset int64 // the Offset of the next entry with a non-zero Offset // DevMajor is the major device number for "char" and "block" types. DevMajor int `json:"devMajor,omitempty"` // DevMinor is the major device number for "char" and "block" types. DevMinor int `json:"devMinor,omitempty"` // NumLink is the number of entry names pointing to this entry. // Zero means one name references this entry. // This field is calculated during runtime and not recorded in TOC JSON. NumLink int `json:"-"` // Xattrs are the extended attribute for the entry. Xattrs map[string][]byte `json:"xattrs,omitempty"` // Digest stores the OCI checksum for regular files payload. // It has the form "sha256:abcdef01234....". Digest string `json:"digest,omitempty"` // ChunkOffset is non-zero if this is a chunk of a large, // regular file. If so, the Offset is where the gzip header of // ChunkSize bytes at ChunkOffset in Name begin. // // In serialized form, a "chunkSize" JSON field of zero means // that the chunk goes to the end of the file. After reading // from the stargz TOC, though, the ChunkSize is initialized // to a non-zero file for when Type is either "reg" or // "chunk". ChunkOffset int64 `json:"chunkOffset,omitempty"` ChunkSize int64 `json:"chunkSize,omitempty"` // ChunkDigest stores an OCI digest of the chunk. This must be formed // as "sha256:0123abcd...". ChunkDigest string `json:"chunkDigest,omitempty"` children map[string]*TOCEntry // chunkTopIndex is index of the entry where Offset starts in the blob. chunkTopIndex int } // ModTime returns the entry's modification time. func (e *TOCEntry) ModTime() time.Time { return e.modTime } // NextOffset returns the position (relative to the start of the // stargz file) of the next gzip boundary after e.Offset. func (e *TOCEntry) NextOffset() int64 { return e.nextOffset } func (e *TOCEntry) addChild(baseName string, child *TOCEntry) { if e.children == nil { e.children = make(map[string]*TOCEntry) } if child.Type == "dir" { e.NumLink++ // Entry ".." in the subdirectory links to this directory } e.children[baseName] = child } // isDataType reports whether TOCEntry is a regular file or chunk (something that // contains regular file data). func (e *TOCEntry) isDataType() bool { return e.Type == "reg" || e.Type == "chunk" } // Stat returns a FileInfo value representing e. func (e *TOCEntry) Stat() os.FileInfo { return fileInfo{e} } // ForeachChild calls f for each child item. If f returns false, iteration ends. // If e is not a directory, f is not called. func (e *TOCEntry) ForeachChild(f func(baseName string, ent *TOCEntry) bool) { for name, ent := range e.children { if !f(name, ent) { return } } } // LookupChild returns the directory e's child by its base name. func (e *TOCEntry) LookupChild(baseName string) (child *TOCEntry, ok bool) { child, ok = e.children[baseName] return } // fileInfo implements os.FileInfo using the wrapped *TOCEntry. type fileInfo struct{ e *TOCEntry } var _ os.FileInfo = fileInfo{} func (fi fileInfo) Name() string { return path.Base(fi.e.Name) } func (fi fileInfo) IsDir() bool { return fi.e.Type == "dir" } func (fi fileInfo) Size() int64 { return fi.e.Size } func (fi fileInfo) ModTime() time.Time { return fi.e.ModTime() } func (fi fileInfo) Sys() interface{} { return fi.e } func (fi fileInfo) Mode() (m os.FileMode) { // TOCEntry.Mode is tar.Header.Mode so we can understand the these bits using `tar` pkg. m = (&tar.Header{Mode: fi.e.Mode}).FileInfo().Mode() & (os.ModePerm | os.ModeSetuid | os.ModeSetgid | os.ModeSticky) switch fi.e.Type { case "dir": m |= os.ModeDir case "symlink": m |= os.ModeSymlink case "char": m |= os.ModeDevice | os.ModeCharDevice case "block": m |= os.ModeDevice case "fifo": m |= os.ModeNamedPipe } return m } // TOCEntryVerifier holds verifiers that are usable for verifying chunks contained // in a eStargz blob. type TOCEntryVerifier interface { // Verifier provides a content verifier that can be used for verifying the // contents of the specified TOCEntry. Verifier(ce *TOCEntry) (digest.Verifier, error) } // Compression provides the compression helper to be used creating and parsing eStargz. // This package provides gzip-based Compression by default, but any compression // algorithm (e.g. zstd) can be used as long as it implements Compression. type Compression interface { Compressor Decompressor } // Compressor represents the helper mothods to be used for creating eStargz. type Compressor interface { // Writer returns WriteCloser to be used for writing a chunk to eStargz. // Everytime a chunk is written, the WriteCloser is closed and Writer is // called again for writing the next chunk. // // The returned writer should implement "Flush() error" function that flushes // any pending compressed data to the underlying writer. Writer(w io.Writer) (WriteFlushCloser, error) // WriteTOCAndFooter is called to write JTOC to the passed Writer. // diffHash calculates the DiffID (uncompressed sha256 hash) of the blob // WriteTOCAndFooter can optionally write anything that affects DiffID calculation // (e.g. uncompressed TOC JSON). // // This function returns tocDgst that represents the digest of TOC that will be used // to verify this blob when it's parsed. WriteTOCAndFooter(w io.Writer, off int64, toc *JTOC, diffHash hash.Hash) (tocDgst digest.Digest, err error) } // Decompressor represents the helper mothods to be used for parsing eStargz. type Decompressor interface { // Reader returns ReadCloser to be used for decompressing file payload. Reader(r io.Reader) (io.ReadCloser, error) // FooterSize returns the size of the footer of this blob. FooterSize() int64 // ParseFooter parses the footer and returns the offset and (compressed) size of TOC. // payloadBlobSize is the (compressed) size of the blob payload (i.e. the size between // the top until the TOC JSON). // // If tocOffset < 0, we assume that TOC isn't contained in the blob and pass nil reader // to ParseTOC. We expect that ParseTOC acquire TOC from the external location and return it. // // tocSize is optional. If tocSize <= 0, it's by default the size of the range from tocOffset until the beginning of the // footer (blob size - tocOff - FooterSize). // If blobPayloadSize < 0, blobPayloadSize become the blob size. ParseFooter(p []byte) (blobPayloadSize, tocOffset, tocSize int64, err error) // ParseTOC parses TOC from the passed reader. The reader provides the partial contents // of the underlying blob that has the range specified by ParseFooter method. // // This function returns tocDgst that represents the digest of TOC that will be used // to verify this blob. This must match to the value returned from // Compressor.WriteTOCAndFooter that is used when creating this blob. // // If tocOffset returned by ParseFooter is < 0, we assume that TOC isn't contained in the blob. // Pass nil reader to ParseTOC then we expect that ParseTOC acquire TOC from the external location // and return it. ParseTOC(r io.Reader) (toc *JTOC, tocDgst digest.Digest, err error) } type WriteFlushCloser interface { io.WriteCloser Flush() error } ================================================ FILE: vendor/github.com/containers/libtrust/CODE-OF-CONDUCT.md ================================================ ## The libtrust Project Community Code of Conduct The libtrust project follows the [Containers Community Code of Conduct](https://github.com/containers/common/blob/main/CODE-OF-CONDUCT.md). ================================================ FILE: vendor/github.com/containers/libtrust/CONTRIBUTING.md ================================================ # Contributing to libtrust Want to hack on libtrust? Awesome! Here are instructions to get you started. libtrust is a part of the [Docker](https://www.docker.com) project, and follows the same rules and principles. If you're already familiar with the way Docker does things, you'll feel right at home. Otherwise, go read [Docker's contributions guidelines](https://github.com/docker/docker/blob/master/CONTRIBUTING.md). Happy hacking! ================================================ FILE: vendor/github.com/containers/libtrust/LICENSE ================================================ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS Copyright 2014 Docker, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: vendor/github.com/containers/libtrust/MAINTAINERS ================================================ Solomon Hykes Josh Hawn (github: jlhawn) Derek McGowan (github: dmcgowan) ================================================ FILE: vendor/github.com/containers/libtrust/README.md ================================================ # libtrust > **WARNING** this library is no longer actively developed, and will be integrated > in the [docker/distribution][https://www.github.com/docker/distribution] > repository in future. Libtrust is library for managing authentication and authorization using public key cryptography. Authentication is handled using the identity attached to the public key. Libtrust provides multiple methods to prove possession of the private key associated with an identity. - TLS x509 certificates - Signature verification - Key Challenge Authorization and access control is managed through a distributed trust graph. Trust servers are used as the authorities of the trust graph and allow caching portions of the graph for faster access. ## Copyright and license Code and documentation copyright 2014 Docker, inc. Code released under the Apache 2.0 license. Docs released under Creative commons. ================================================ FILE: vendor/github.com/containers/libtrust/SECURITY.md ================================================ ## Security and Disclosure Information Policy for the libtrust Project The libtrust Project follows the [Security and Disclosure Information Policy](https://github.com/containers/common/blob/main/SECURITY.md) for the Containers Projects. ================================================ FILE: vendor/github.com/containers/libtrust/certificates.go ================================================ package libtrust import ( "crypto/rand" "crypto/x509" "crypto/x509/pkix" "encoding/pem" "fmt" "io/ioutil" "math/big" "net" "time" ) type certTemplateInfo struct { commonName string domains []string ipAddresses []net.IP isCA bool clientAuth bool serverAuth bool } func generateCertTemplate(info *certTemplateInfo) *x509.Certificate { // Generate a certificate template which is valid from the past week to // 10 years from now. The usage of the certificate depends on the // specified fields in the given certTempInfo object. var ( keyUsage x509.KeyUsage extKeyUsage []x509.ExtKeyUsage ) if info.isCA { keyUsage = x509.KeyUsageCertSign } if info.clientAuth { extKeyUsage = append(extKeyUsage, x509.ExtKeyUsageClientAuth) } if info.serverAuth { extKeyUsage = append(extKeyUsage, x509.ExtKeyUsageServerAuth) } return &x509.Certificate{ SerialNumber: big.NewInt(0), Subject: pkix.Name{ CommonName: info.commonName, }, NotBefore: time.Now().Add(-time.Hour * 24 * 7), NotAfter: time.Now().Add(time.Hour * 24 * 365 * 10), DNSNames: info.domains, IPAddresses: info.ipAddresses, IsCA: info.isCA, KeyUsage: keyUsage, ExtKeyUsage: extKeyUsage, BasicConstraintsValid: info.isCA, } } func generateCert(pub PublicKey, priv PrivateKey, subInfo, issInfo *certTemplateInfo) (cert *x509.Certificate, err error) { pubCertTemplate := generateCertTemplate(subInfo) privCertTemplate := generateCertTemplate(issInfo) certDER, err := x509.CreateCertificate( rand.Reader, pubCertTemplate, privCertTemplate, pub.CryptoPublicKey(), priv.CryptoPrivateKey(), ) if err != nil { return nil, fmt.Errorf("failed to create certificate: %s", err) } cert, err = x509.ParseCertificate(certDER) if err != nil { return nil, fmt.Errorf("failed to parse certificate: %s", err) } return } // GenerateSelfSignedServerCert creates a self-signed certificate for the // given key which is to be used for TLS servers with the given domains and // IP addresses. func GenerateSelfSignedServerCert(key PrivateKey, domains []string, ipAddresses []net.IP) (*x509.Certificate, error) { info := &certTemplateInfo{ commonName: key.KeyID(), domains: domains, ipAddresses: ipAddresses, serverAuth: true, } return generateCert(key.PublicKey(), key, info, info) } // GenerateSelfSignedClientCert creates a self-signed certificate for the // given key which is to be used for TLS clients. func GenerateSelfSignedClientCert(key PrivateKey) (*x509.Certificate, error) { info := &certTemplateInfo{ commonName: key.KeyID(), clientAuth: true, } return generateCert(key.PublicKey(), key, info, info) } // GenerateCACert creates a certificate which can be used as a trusted // certificate authority. func GenerateCACert(signer PrivateKey, trustedKey PublicKey) (*x509.Certificate, error) { subjectInfo := &certTemplateInfo{ commonName: trustedKey.KeyID(), isCA: true, } issuerInfo := &certTemplateInfo{ commonName: signer.KeyID(), } return generateCert(trustedKey, signer, subjectInfo, issuerInfo) } // GenerateCACertPool creates a certificate authority pool to be used for a // TLS configuration. Any self-signed certificates issued by the specified // trusted keys will be verified during a TLS handshake func GenerateCACertPool(signer PrivateKey, trustedKeys []PublicKey) (*x509.CertPool, error) { certPool := x509.NewCertPool() for _, trustedKey := range trustedKeys { cert, err := GenerateCACert(signer, trustedKey) if err != nil { return nil, fmt.Errorf("failed to generate CA certificate: %s", err) } certPool.AddCert(cert) } return certPool, nil } // LoadCertificateBundle loads certificates from the given file. The file should be pem encoded // containing one or more certificates. The expected pem type is "CERTIFICATE". func LoadCertificateBundle(filename string) ([]*x509.Certificate, error) { b, err := ioutil.ReadFile(filename) if err != nil { return nil, err } certificates := []*x509.Certificate{} var block *pem.Block block, b = pem.Decode(b) for ; block != nil; block, b = pem.Decode(b) { if block.Type == "CERTIFICATE" { cert, err := x509.ParseCertificate(block.Bytes) if err != nil { return nil, err } certificates = append(certificates, cert) } else { return nil, fmt.Errorf("invalid pem block type: %s", block.Type) } } return certificates, nil } // LoadCertificatePool loads a CA pool from the given file. The file should be pem encoded // containing one or more certificates. The expected pem type is "CERTIFICATE". func LoadCertificatePool(filename string) (*x509.CertPool, error) { certs, err := LoadCertificateBundle(filename) if err != nil { return nil, err } pool := x509.NewCertPool() for _, cert := range certs { pool.AddCert(cert) } return pool, nil } ================================================ FILE: vendor/github.com/containers/libtrust/doc.go ================================================ /* Package libtrust provides an interface for managing authentication and authorization using public key cryptography. Authentication is handled using the identity attached to the public key and verified through TLS x509 certificates, a key challenge, or signature. Authorization and access control is managed through a trust graph distributed between both remote trust servers and locally cached and managed data. */ package libtrust ================================================ FILE: vendor/github.com/containers/libtrust/ec_key.go ================================================ package libtrust import ( "crypto" "crypto/ecdsa" "crypto/elliptic" "crypto/rand" "crypto/x509" "encoding/json" "encoding/pem" "errors" "fmt" "io" "math/big" ) /* * EC DSA PUBLIC KEY */ // ecPublicKey implements a libtrust.PublicKey using elliptic curve digital // signature algorithms. type ecPublicKey struct { *ecdsa.PublicKey curveName string signatureAlgorithm *signatureAlgorithm extended map[string]interface{} } func fromECPublicKey(cryptoPublicKey *ecdsa.PublicKey) (*ecPublicKey, error) { curve := cryptoPublicKey.Curve switch { case curve == elliptic.P256(): return &ecPublicKey{cryptoPublicKey, "P-256", es256, map[string]interface{}{}}, nil case curve == elliptic.P384(): return &ecPublicKey{cryptoPublicKey, "P-384", es384, map[string]interface{}{}}, nil case curve == elliptic.P521(): return &ecPublicKey{cryptoPublicKey, "P-521", es512, map[string]interface{}{}}, nil default: return nil, errors.New("unsupported elliptic curve") } } // KeyType returns the key type for elliptic curve keys, i.e., "EC". func (k *ecPublicKey) KeyType() string { return "EC" } // CurveName returns the elliptic curve identifier. // Possible values are "P-256", "P-384", and "P-521". func (k *ecPublicKey) CurveName() string { return k.curveName } // KeyID returns a distinct identifier which is unique to this Public Key. func (k *ecPublicKey) KeyID() string { return keyIDFromCryptoKey(k) } func (k *ecPublicKey) String() string { return fmt.Sprintf("EC Public Key <%s>", k.KeyID()) } // Verify verifyies the signature of the data in the io.Reader using this // PublicKey. The alg parameter should identify the digital signature // algorithm which was used to produce the signature and should be supported // by this public key. Returns a nil error if the signature is valid. func (k *ecPublicKey) Verify(data io.Reader, alg string, signature []byte) error { // For EC keys there is only one supported signature algorithm depending // on the curve parameters. if k.signatureAlgorithm.HeaderParam() != alg { return fmt.Errorf("unable to verify signature: EC Public Key with curve %q does not support signature algorithm %q", k.curveName, alg) } // signature is the concatenation of (r, s), base64Url encoded. sigLength := len(signature) expectedOctetLength := 2 * ((k.Params().BitSize + 7) >> 3) if sigLength != expectedOctetLength { return fmt.Errorf("signature length is %d octets long, should be %d", sigLength, expectedOctetLength) } rBytes, sBytes := signature[:sigLength/2], signature[sigLength/2:] r := new(big.Int).SetBytes(rBytes) s := new(big.Int).SetBytes(sBytes) hasher := k.signatureAlgorithm.HashID().New() _, err := io.Copy(hasher, data) if err != nil { return fmt.Errorf("error reading data to sign: %s", err) } hash := hasher.Sum(nil) if !ecdsa.Verify(k.PublicKey, hash, r, s) { return errors.New("invalid signature") } return nil } // CryptoPublicKey returns the internal object which can be used as a // crypto.PublicKey for use with other standard library operations. The type // is either *rsa.PublicKey or *ecdsa.PublicKey func (k *ecPublicKey) CryptoPublicKey() crypto.PublicKey { return k.PublicKey } func (k *ecPublicKey) toMap() map[string]interface{} { jwk := make(map[string]interface{}) for k, v := range k.extended { jwk[k] = v } jwk["kty"] = k.KeyType() jwk["kid"] = k.KeyID() jwk["crv"] = k.CurveName() xBytes := k.X.Bytes() yBytes := k.Y.Bytes() octetLength := (k.Params().BitSize + 7) >> 3 // MUST include leading zeros in the output so that x, y are each // *octetLength* bytes long. xBuf := make([]byte, octetLength-len(xBytes), octetLength) yBuf := make([]byte, octetLength-len(yBytes), octetLength) xBuf = append(xBuf, xBytes...) yBuf = append(yBuf, yBytes...) jwk["x"] = joseBase64UrlEncode(xBuf) jwk["y"] = joseBase64UrlEncode(yBuf) return jwk } // MarshalJSON serializes this Public Key using the JWK JSON serialization format for // elliptic curve keys. func (k *ecPublicKey) MarshalJSON() (data []byte, err error) { return json.Marshal(k.toMap()) } // PEMBlock serializes this Public Key to DER-encoded PKIX format. func (k *ecPublicKey) PEMBlock() (*pem.Block, error) { derBytes, err := x509.MarshalPKIXPublicKey(k.PublicKey) if err != nil { return nil, fmt.Errorf("unable to serialize EC PublicKey to DER-encoded PKIX format: %s", err) } k.extended["kid"] = k.KeyID() // For display purposes. return createPemBlock("PUBLIC KEY", derBytes, k.extended) } func (k *ecPublicKey) AddExtendedField(field string, value interface{}) { k.extended[field] = value } func (k *ecPublicKey) GetExtendedField(field string) interface{} { v, ok := k.extended[field] if !ok { return nil } return v } func ecPublicKeyFromMap(jwk map[string]interface{}) (*ecPublicKey, error) { // JWK key type (kty) has already been determined to be "EC". // Need to extract 'crv', 'x', 'y', and 'kid' and check for // consistency. // Get the curve identifier value. crv, err := stringFromMap(jwk, "crv") if err != nil { return nil, fmt.Errorf("JWK EC Public Key curve identifier: %s", err) } var ( curve elliptic.Curve sigAlg *signatureAlgorithm ) switch { case crv == "P-256": curve = elliptic.P256() sigAlg = es256 case crv == "P-384": curve = elliptic.P384() sigAlg = es384 case crv == "P-521": curve = elliptic.P521() sigAlg = es512 default: return nil, fmt.Errorf("JWK EC Public Key curve identifier not supported: %q\n", crv) } // Get the X and Y coordinates for the public key point. xB64Url, err := stringFromMap(jwk, "x") if err != nil { return nil, fmt.Errorf("JWK EC Public Key x-coordinate: %s", err) } x, err := parseECCoordinate(xB64Url, curve) if err != nil { return nil, fmt.Errorf("JWK EC Public Key x-coordinate: %s", err) } yB64Url, err := stringFromMap(jwk, "y") if err != nil { return nil, fmt.Errorf("JWK EC Public Key y-coordinate: %s", err) } y, err := parseECCoordinate(yB64Url, curve) if err != nil { return nil, fmt.Errorf("JWK EC Public Key y-coordinate: %s", err) } key := &ecPublicKey{ PublicKey: &ecdsa.PublicKey{Curve: curve, X: x, Y: y}, curveName: crv, signatureAlgorithm: sigAlg, } // Key ID is optional too, but if it exists, it should match the key. _, ok := jwk["kid"] if ok { kid, err := stringFromMap(jwk, "kid") if err != nil { return nil, fmt.Errorf("JWK EC Public Key ID: %s", err) } if kid != key.KeyID() { return nil, fmt.Errorf("JWK EC Public Key ID does not match: %s", kid) } } key.extended = jwk return key, nil } /* * EC DSA PRIVATE KEY */ // ecPrivateKey implements a JWK Private Key using elliptic curve digital signature // algorithms. type ecPrivateKey struct { ecPublicKey *ecdsa.PrivateKey } func fromECPrivateKey(cryptoPrivateKey *ecdsa.PrivateKey) (*ecPrivateKey, error) { publicKey, err := fromECPublicKey(&cryptoPrivateKey.PublicKey) if err != nil { return nil, err } return &ecPrivateKey{*publicKey, cryptoPrivateKey}, nil } // PublicKey returns the Public Key data associated with this Private Key. func (k *ecPrivateKey) PublicKey() PublicKey { return &k.ecPublicKey } func (k *ecPrivateKey) String() string { return fmt.Sprintf("EC Private Key <%s>", k.KeyID()) } // Sign signs the data read from the io.Reader using a signature algorithm supported // by the elliptic curve private key. If the specified hashing algorithm is // supported by this key, that hash function is used to generate the signature // otherwise the the default hashing algorithm for this key is used. Returns // the signature and the name of the JWK signature algorithm used, e.g., // "ES256", "ES384", "ES512". func (k *ecPrivateKey) Sign(data io.Reader, hashID crypto.Hash) (signature []byte, alg string, err error) { // Generate a signature of the data using the internal alg. // The given hashId is only a suggestion, and since EC keys only support // on signature/hash algorithm given the curve name, we disregard it for // the elliptic curve JWK signature implementation. r, s, err := k.sign(data, hashID) if err != nil { return nil, "", fmt.Errorf("error producing signature: %s", err) } rBytes, sBytes := r.Bytes(), s.Bytes() octetLength := (k.ecPublicKey.Params().BitSize + 7) >> 3 // MUST include leading zeros in the output rBuf := make([]byte, octetLength-len(rBytes), octetLength) sBuf := make([]byte, octetLength-len(sBytes), octetLength) rBuf = append(rBuf, rBytes...) sBuf = append(sBuf, sBytes...) signature = append(rBuf, sBuf...) alg = k.signatureAlgorithm.HeaderParam() return } // CryptoPrivateKey returns the internal object which can be used as a // crypto.PublicKey for use with other standard library operations. The type // is either *rsa.PublicKey or *ecdsa.PublicKey func (k *ecPrivateKey) CryptoPrivateKey() crypto.PrivateKey { return k.PrivateKey } func (k *ecPrivateKey) toMap() map[string]interface{} { jwk := k.ecPublicKey.toMap() dBytes := k.D.Bytes() // The length of this octet string MUST be ceiling(log-base-2(n)/8) // octets (where n is the order of the curve). This is because the private // key d must be in the interval [1, n-1] so the bitlength of d should be // no larger than the bitlength of n-1. The easiest way to find the octet // length is to take bitlength(n-1), add 7 to force a carry, and shift this // bit sequence right by 3, which is essentially dividing by 8 and adding // 1 if there is any remainder. Thus, the private key value d should be // output to (bitlength(n-1)+7)>>3 octets. n := k.ecPublicKey.Params().N octetLength := (new(big.Int).Sub(n, big.NewInt(1)).BitLen() + 7) >> 3 // Create a buffer with the necessary zero-padding. dBuf := make([]byte, octetLength-len(dBytes), octetLength) dBuf = append(dBuf, dBytes...) jwk["d"] = joseBase64UrlEncode(dBuf) return jwk } // MarshalJSON serializes this Private Key using the JWK JSON serialization format for // elliptic curve keys. func (k *ecPrivateKey) MarshalJSON() (data []byte, err error) { return json.Marshal(k.toMap()) } // PEMBlock serializes this Private Key to DER-encoded PKIX format. func (k *ecPrivateKey) PEMBlock() (*pem.Block, error) { derBytes, err := x509.MarshalECPrivateKey(k.PrivateKey) if err != nil { return nil, fmt.Errorf("unable to serialize EC PrivateKey to DER-encoded PKIX format: %s", err) } k.extended["keyID"] = k.KeyID() // For display purposes. return createPemBlock("EC PRIVATE KEY", derBytes, k.extended) } func ecPrivateKeyFromMap(jwk map[string]interface{}) (*ecPrivateKey, error) { dB64Url, err := stringFromMap(jwk, "d") if err != nil { return nil, fmt.Errorf("JWK EC Private Key: %s", err) } // JWK key type (kty) has already been determined to be "EC". // Need to extract the public key information, then extract the private // key value 'd'. publicKey, err := ecPublicKeyFromMap(jwk) if err != nil { return nil, err } d, err := parseECPrivateParam(dB64Url, publicKey.Curve) if err != nil { return nil, fmt.Errorf("JWK EC Private Key d-param: %s", err) } key := &ecPrivateKey{ ecPublicKey: *publicKey, PrivateKey: &ecdsa.PrivateKey{ PublicKey: *publicKey.PublicKey, D: d, }, } return key, nil } /* * Key Generation Functions. */ func generateECPrivateKey(curve elliptic.Curve) (k *ecPrivateKey, err error) { k = new(ecPrivateKey) k.PrivateKey, err = ecdsa.GenerateKey(curve, rand.Reader) if err != nil { return nil, err } k.ecPublicKey.PublicKey = &k.PrivateKey.PublicKey k.extended = make(map[string]interface{}) return } // GenerateECP256PrivateKey generates a key pair using elliptic curve P-256. func GenerateECP256PrivateKey() (PrivateKey, error) { k, err := generateECPrivateKey(elliptic.P256()) if err != nil { return nil, fmt.Errorf("error generating EC P-256 key: %s", err) } k.curveName = "P-256" k.signatureAlgorithm = es256 return k, nil } // GenerateECP384PrivateKey generates a key pair using elliptic curve P-384. func GenerateECP384PrivateKey() (PrivateKey, error) { k, err := generateECPrivateKey(elliptic.P384()) if err != nil { return nil, fmt.Errorf("error generating EC P-384 key: %s", err) } k.curveName = "P-384" k.signatureAlgorithm = es384 return k, nil } // GenerateECP521PrivateKey generates aß key pair using elliptic curve P-521. func GenerateECP521PrivateKey() (PrivateKey, error) { k, err := generateECPrivateKey(elliptic.P521()) if err != nil { return nil, fmt.Errorf("error generating EC P-521 key: %s", err) } k.curveName = "P-521" k.signatureAlgorithm = es512 return k, nil } ================================================ FILE: vendor/github.com/containers/libtrust/ec_key_no_openssl.go ================================================ // +build !libtrust_openssl package libtrust import ( "crypto" "crypto/ecdsa" "crypto/rand" "fmt" "io" "math/big" ) func (k *ecPrivateKey) sign(data io.Reader, hashID crypto.Hash) (r, s *big.Int, err error) { hasher := k.signatureAlgorithm.HashID().New() _, err = io.Copy(hasher, data) if err != nil { return nil, nil, fmt.Errorf("error reading data to sign: %s", err) } hash := hasher.Sum(nil) return ecdsa.Sign(rand.Reader, k.PrivateKey, hash) } ================================================ FILE: vendor/github.com/containers/libtrust/ec_key_openssl.go ================================================ // +build libtrust_openssl package libtrust import ( "bytes" "crypto" "crypto/ecdsa" "crypto/rand" "fmt" "io" "math/big" ) func (k *ecPrivateKey) sign(data io.Reader, hashID crypto.Hash) (r, s *big.Int, err error) { hId := k.signatureAlgorithm.HashID() buf := new(bytes.Buffer) _, err = buf.ReadFrom(data) if err != nil { return nil, nil, fmt.Errorf("error reading data: %s", err) } return ecdsa.HashSign(rand.Reader, k.PrivateKey, buf.Bytes(), hId) } ================================================ FILE: vendor/github.com/containers/libtrust/filter.go ================================================ package libtrust import ( "path/filepath" ) // FilterByHosts filters the list of PublicKeys to only those which contain a // 'hosts' pattern which matches the given host. If *includeEmpty* is true, // then keys which do not specify any hosts are also returned. func FilterByHosts(keys []PublicKey, host string, includeEmpty bool) ([]PublicKey, error) { filtered := make([]PublicKey, 0, len(keys)) for _, pubKey := range keys { var hosts []string switch v := pubKey.GetExtendedField("hosts").(type) { case []string: hosts = v case []interface{}: for _, value := range v { h, ok := value.(string) if !ok { continue } hosts = append(hosts, h) } } if len(hosts) == 0 { if includeEmpty { filtered = append(filtered, pubKey) } continue } // Check if any hosts match pattern for _, hostPattern := range hosts { match, err := filepath.Match(hostPattern, host) if err != nil { return nil, err } if match { filtered = append(filtered, pubKey) continue } } } return filtered, nil } ================================================ FILE: vendor/github.com/containers/libtrust/hash.go ================================================ package libtrust import ( "crypto" _ "crypto/sha256" // Registrer SHA224 and SHA256 _ "crypto/sha512" // Registrer SHA384 and SHA512 "fmt" ) type signatureAlgorithm struct { algHeaderParam string hashID crypto.Hash } func (h *signatureAlgorithm) HeaderParam() string { return h.algHeaderParam } func (h *signatureAlgorithm) HashID() crypto.Hash { return h.hashID } var ( rs256 = &signatureAlgorithm{"RS256", crypto.SHA256} rs384 = &signatureAlgorithm{"RS384", crypto.SHA384} rs512 = &signatureAlgorithm{"RS512", crypto.SHA512} es256 = &signatureAlgorithm{"ES256", crypto.SHA256} es384 = &signatureAlgorithm{"ES384", crypto.SHA384} es512 = &signatureAlgorithm{"ES512", crypto.SHA512} ) func rsaSignatureAlgorithmByName(alg string) (*signatureAlgorithm, error) { switch { case alg == "RS256": return rs256, nil case alg == "RS384": return rs384, nil case alg == "RS512": return rs512, nil default: return nil, fmt.Errorf("RSA Digital Signature Algorithm %q not supported", alg) } } func rsaPKCS1v15SignatureAlgorithmForHashID(hashID crypto.Hash) *signatureAlgorithm { switch { case hashID == crypto.SHA512: return rs512 case hashID == crypto.SHA384: return rs384 case hashID == crypto.SHA256: fallthrough default: return rs256 } } ================================================ FILE: vendor/github.com/containers/libtrust/jsonsign.go ================================================ package libtrust import ( "bytes" "crypto" "crypto/x509" "encoding/base64" "encoding/json" "errors" "fmt" "sort" "time" "unicode" ) var ( // ErrInvalidSignContent is used when the content to be signed is invalid. ErrInvalidSignContent = errors.New("invalid sign content") // ErrInvalidJSONContent is used when invalid json is encountered. ErrInvalidJSONContent = errors.New("invalid json content") // ErrMissingSignatureKey is used when the specified signature key // does not exist in the JSON content. ErrMissingSignatureKey = errors.New("missing signature key") ) type jsHeader struct { JWK PublicKey `json:"jwk,omitempty"` Algorithm string `json:"alg"` Chain []string `json:"x5c,omitempty"` } type jsSignature struct { Header jsHeader `json:"header"` Signature string `json:"signature"` Protected string `json:"protected,omitempty"` } type jsSignaturesSorted []jsSignature func (jsbkid jsSignaturesSorted) Swap(i, j int) { jsbkid[i], jsbkid[j] = jsbkid[j], jsbkid[i] } func (jsbkid jsSignaturesSorted) Len() int { return len(jsbkid) } func (jsbkid jsSignaturesSorted) Less(i, j int) bool { ki, kj := jsbkid[i].Header.JWK.KeyID(), jsbkid[j].Header.JWK.KeyID() si, sj := jsbkid[i].Signature, jsbkid[j].Signature if ki == kj { return si < sj } return ki < kj } type signKey struct { PrivateKey Chain []*x509.Certificate } // JSONSignature represents a signature of a json object. type JSONSignature struct { payload string signatures []jsSignature indent string formatLength int formatTail []byte } func newJSONSignature() *JSONSignature { return &JSONSignature{ signatures: make([]jsSignature, 0, 1), } } // Payload returns the encoded payload of the signature. This // payload should not be signed directly func (js *JSONSignature) Payload() ([]byte, error) { return joseBase64UrlDecode(js.payload) } func (js *JSONSignature) protectedHeader() (string, error) { protected := map[string]interface{}{ "formatLength": js.formatLength, "formatTail": joseBase64UrlEncode(js.formatTail), "time": time.Now().UTC().Format(time.RFC3339), } protectedBytes, err := json.Marshal(protected) if err != nil { return "", err } return joseBase64UrlEncode(protectedBytes), nil } func (js *JSONSignature) signBytes(protectedHeader string) ([]byte, error) { buf := make([]byte, len(js.payload)+len(protectedHeader)+1) copy(buf, protectedHeader) buf[len(protectedHeader)] = '.' copy(buf[len(protectedHeader)+1:], js.payload) return buf, nil } // Sign adds a signature using the given private key. func (js *JSONSignature) Sign(key PrivateKey) error { protected, err := js.protectedHeader() if err != nil { return err } signBytes, err := js.signBytes(protected) if err != nil { return err } sigBytes, algorithm, err := key.Sign(bytes.NewReader(signBytes), crypto.SHA256) if err != nil { return err } js.signatures = append(js.signatures, jsSignature{ Header: jsHeader{ JWK: key.PublicKey(), Algorithm: algorithm, }, Signature: joseBase64UrlEncode(sigBytes), Protected: protected, }) return nil } // SignWithChain adds a signature using the given private key // and setting the x509 chain. The public key of the first element // in the chain must be the public key corresponding with the sign key. func (js *JSONSignature) SignWithChain(key PrivateKey, chain []*x509.Certificate) error { // Ensure key.Chain[0] is public key for key //key.Chain.PublicKey //key.PublicKey().CryptoPublicKey() // Verify chain protected, err := js.protectedHeader() if err != nil { return err } signBytes, err := js.signBytes(protected) if err != nil { return err } sigBytes, algorithm, err := key.Sign(bytes.NewReader(signBytes), crypto.SHA256) if err != nil { return err } header := jsHeader{ Chain: make([]string, len(chain)), Algorithm: algorithm, } for i, cert := range chain { header.Chain[i] = base64.StdEncoding.EncodeToString(cert.Raw) } js.signatures = append(js.signatures, jsSignature{ Header: header, Signature: joseBase64UrlEncode(sigBytes), Protected: protected, }) return nil } // Verify verifies all the signatures and returns the list of // public keys used to sign. Any x509 chains are not checked. func (js *JSONSignature) Verify() ([]PublicKey, error) { keys := make([]PublicKey, len(js.signatures)) for i, signature := range js.signatures { signBytes, err := js.signBytes(signature.Protected) if err != nil { return nil, err } var publicKey PublicKey if len(signature.Header.Chain) > 0 { certBytes, err := base64.StdEncoding.DecodeString(signature.Header.Chain[0]) if err != nil { return nil, err } cert, err := x509.ParseCertificate(certBytes) if err != nil { return nil, err } publicKey, err = FromCryptoPublicKey(cert.PublicKey) if err != nil { return nil, err } } else if signature.Header.JWK != nil { publicKey = signature.Header.JWK } else { return nil, errors.New("missing public key") } sigBytes, err := joseBase64UrlDecode(signature.Signature) if err != nil { return nil, err } err = publicKey.Verify(bytes.NewReader(signBytes), signature.Header.Algorithm, sigBytes) if err != nil { return nil, err } keys[i] = publicKey } return keys, nil } // VerifyChains verifies all the signatures and the chains associated // with each signature and returns the list of verified chains. // Signatures without an x509 chain are not checked. func (js *JSONSignature) VerifyChains(ca *x509.CertPool) ([][]*x509.Certificate, error) { chains := make([][]*x509.Certificate, 0, len(js.signatures)) for _, signature := range js.signatures { signBytes, err := js.signBytes(signature.Protected) if err != nil { return nil, err } var publicKey PublicKey if len(signature.Header.Chain) > 0 { certBytes, err := base64.StdEncoding.DecodeString(signature.Header.Chain[0]) if err != nil { return nil, err } cert, err := x509.ParseCertificate(certBytes) if err != nil { return nil, err } publicKey, err = FromCryptoPublicKey(cert.PublicKey) if err != nil { return nil, err } intermediates := x509.NewCertPool() if len(signature.Header.Chain) > 1 { intermediateChain := signature.Header.Chain[1:] for i := range intermediateChain { certBytes, err := base64.StdEncoding.DecodeString(intermediateChain[i]) if err != nil { return nil, err } intermediate, err := x509.ParseCertificate(certBytes) if err != nil { return nil, err } intermediates.AddCert(intermediate) } } verifyOptions := x509.VerifyOptions{ Intermediates: intermediates, Roots: ca, } verifiedChains, err := cert.Verify(verifyOptions) if err != nil { return nil, err } chains = append(chains, verifiedChains...) sigBytes, err := joseBase64UrlDecode(signature.Signature) if err != nil { return nil, err } err = publicKey.Verify(bytes.NewReader(signBytes), signature.Header.Algorithm, sigBytes) if err != nil { return nil, err } } } return chains, nil } // JWS returns JSON serialized JWS according to // http://tools.ietf.org/html/draft-ietf-jose-json-web-signature-31#section-7.2 func (js *JSONSignature) JWS() ([]byte, error) { if len(js.signatures) == 0 { return nil, errors.New("missing signature") } sort.Sort(jsSignaturesSorted(js.signatures)) jsonMap := map[string]interface{}{ "payload": js.payload, "signatures": js.signatures, } return json.MarshalIndent(jsonMap, "", " ") } func notSpace(r rune) bool { return !unicode.IsSpace(r) } func detectJSONIndent(jsonContent []byte) (indent string) { if len(jsonContent) > 2 && jsonContent[0] == '{' && jsonContent[1] == '\n' { quoteIndex := bytes.IndexRune(jsonContent[1:], '"') if quoteIndex > 0 { indent = string(jsonContent[2 : quoteIndex+1]) } } return } type jsParsedHeader struct { JWK json.RawMessage `json:"jwk"` Algorithm string `json:"alg"` Chain []string `json:"x5c"` } type jsParsedSignature struct { Header jsParsedHeader `json:"header"` Signature string `json:"signature"` Protected string `json:"protected"` } // ParseJWS parses a JWS serialized JSON object into a Json Signature. func ParseJWS(content []byte) (*JSONSignature, error) { type jsParsed struct { Payload string `json:"payload"` Signatures []jsParsedSignature `json:"signatures"` } parsed := &jsParsed{} err := json.Unmarshal(content, parsed) if err != nil { return nil, err } if len(parsed.Signatures) == 0 { return nil, errors.New("missing signatures") } payload, err := joseBase64UrlDecode(parsed.Payload) if err != nil { return nil, err } js, err := NewJSONSignature(payload) if err != nil { return nil, err } js.signatures = make([]jsSignature, len(parsed.Signatures)) for i, signature := range parsed.Signatures { header := jsHeader{ Algorithm: signature.Header.Algorithm, } if signature.Header.Chain != nil { header.Chain = signature.Header.Chain } if signature.Header.JWK != nil { publicKey, err := UnmarshalPublicKeyJWK([]byte(signature.Header.JWK)) if err != nil { return nil, err } header.JWK = publicKey } js.signatures[i] = jsSignature{ Header: header, Signature: signature.Signature, Protected: signature.Protected, } } return js, nil } // NewJSONSignature returns a new unsigned JWS from a json byte array. // JSONSignature will need to be signed before serializing or storing. // Optionally, one or more signatures can be provided as byte buffers, // containing serialized JWS signatures, to assemble a fully signed JWS // package. It is the callers responsibility to ensure uniqueness of the // provided signatures. func NewJSONSignature(content []byte, signatures ...[]byte) (*JSONSignature, error) { var dataMap map[string]interface{} err := json.Unmarshal(content, &dataMap) if err != nil { return nil, err } js := newJSONSignature() js.indent = detectJSONIndent(content) js.payload = joseBase64UrlEncode(content) // Find trailing } and whitespace, put in protected header closeIndex := bytes.LastIndexFunc(content, notSpace) if content[closeIndex] != '}' { return nil, ErrInvalidJSONContent } lastRuneIndex := bytes.LastIndexFunc(content[:closeIndex], notSpace) if content[lastRuneIndex] == ',' { return nil, ErrInvalidJSONContent } js.formatLength = lastRuneIndex + 1 js.formatTail = content[js.formatLength:] if len(signatures) > 0 { for _, signature := range signatures { var parsedJSig jsParsedSignature if err := json.Unmarshal(signature, &parsedJSig); err != nil { return nil, err } // TODO(stevvooe): A lot of the code below is repeated in // ParseJWS. It will require more refactoring to fix that. jsig := jsSignature{ Header: jsHeader{ Algorithm: parsedJSig.Header.Algorithm, }, Signature: parsedJSig.Signature, Protected: parsedJSig.Protected, } if parsedJSig.Header.Chain != nil { jsig.Header.Chain = parsedJSig.Header.Chain } if parsedJSig.Header.JWK != nil { publicKey, err := UnmarshalPublicKeyJWK([]byte(parsedJSig.Header.JWK)) if err != nil { return nil, err } jsig.Header.JWK = publicKey } js.signatures = append(js.signatures, jsig) } } return js, nil } // NewJSONSignatureFromMap returns a new unsigned JSONSignature from a map or // struct. JWS will need to be signed before serializing or storing. func NewJSONSignatureFromMap(content interface{}) (*JSONSignature, error) { switch content.(type) { case map[string]interface{}: case struct{}: default: return nil, errors.New("invalid data type") } js := newJSONSignature() js.indent = " " payload, err := json.MarshalIndent(content, "", js.indent) if err != nil { return nil, err } js.payload = joseBase64UrlEncode(payload) // Remove '\n}' from formatted section, put in protected header js.formatLength = len(payload) - 2 js.formatTail = payload[js.formatLength:] return js, nil } func readIntFromMap(key string, m map[string]interface{}) (int, bool) { value, ok := m[key] if !ok { return 0, false } switch v := value.(type) { case int: return v, true case float64: return int(v), true default: return 0, false } } func readStringFromMap(key string, m map[string]interface{}) (v string, ok bool) { value, ok := m[key] if !ok { return "", false } v, ok = value.(string) return } // ParsePrettySignature parses a formatted signature into a // JSON signature. If the signatures are missing the format information // an error is thrown. The formatted signature must be created by // the same method as format signature. func ParsePrettySignature(content []byte, signatureKey string) (*JSONSignature, error) { var contentMap map[string]json.RawMessage err := json.Unmarshal(content, &contentMap) if err != nil { return nil, fmt.Errorf("error unmarshalling content: %s", err) } sigMessage, ok := contentMap[signatureKey] if !ok { return nil, ErrMissingSignatureKey } var signatureBlocks []jsParsedSignature err = json.Unmarshal([]byte(sigMessage), &signatureBlocks) if err != nil { return nil, fmt.Errorf("error unmarshalling signatures: %s", err) } js := newJSONSignature() js.signatures = make([]jsSignature, len(signatureBlocks)) for i, signatureBlock := range signatureBlocks { protectedBytes, err := joseBase64UrlDecode(signatureBlock.Protected) if err != nil { return nil, fmt.Errorf("base64 decode error: %s", err) } var protectedHeader map[string]interface{} err = json.Unmarshal(protectedBytes, &protectedHeader) if err != nil { return nil, fmt.Errorf("error unmarshalling protected header: %s", err) } formatLength, ok := readIntFromMap("formatLength", protectedHeader) if !ok { return nil, errors.New("missing formatted length") } encodedTail, ok := readStringFromMap("formatTail", protectedHeader) if !ok { return nil, errors.New("missing formatted tail") } formatTail, err := joseBase64UrlDecode(encodedTail) if err != nil { return nil, fmt.Errorf("base64 decode error on tail: %s", err) } if js.formatLength == 0 { js.formatLength = formatLength } else if js.formatLength != formatLength { return nil, errors.New("conflicting format length") } if len(js.formatTail) == 0 { js.formatTail = formatTail } else if bytes.Compare(js.formatTail, formatTail) != 0 { return nil, errors.New("conflicting format tail") } header := jsHeader{ Algorithm: signatureBlock.Header.Algorithm, Chain: signatureBlock.Header.Chain, } if signatureBlock.Header.JWK != nil { publicKey, err := UnmarshalPublicKeyJWK([]byte(signatureBlock.Header.JWK)) if err != nil { return nil, fmt.Errorf("error unmarshalling public key: %s", err) } header.JWK = publicKey } js.signatures[i] = jsSignature{ Header: header, Signature: signatureBlock.Signature, Protected: signatureBlock.Protected, } } if js.formatLength > len(content) { return nil, errors.New("invalid format length") } formatted := make([]byte, js.formatLength+len(js.formatTail)) copy(formatted, content[:js.formatLength]) copy(formatted[js.formatLength:], js.formatTail) js.indent = detectJSONIndent(formatted) js.payload = joseBase64UrlEncode(formatted) return js, nil } // PrettySignature formats a json signature into an easy to read // single json serialized object. func (js *JSONSignature) PrettySignature(signatureKey string) ([]byte, error) { if len(js.signatures) == 0 { return nil, errors.New("no signatures") } payload, err := joseBase64UrlDecode(js.payload) if err != nil { return nil, err } payload = payload[:js.formatLength] sort.Sort(jsSignaturesSorted(js.signatures)) var marshalled []byte var marshallErr error if js.indent != "" { marshalled, marshallErr = json.MarshalIndent(js.signatures, js.indent, js.indent) } else { marshalled, marshallErr = json.Marshal(js.signatures) } if marshallErr != nil { return nil, marshallErr } buf := bytes.NewBuffer(make([]byte, 0, len(payload)+len(marshalled)+34)) buf.Write(payload) buf.WriteByte(',') if js.indent != "" { buf.WriteByte('\n') buf.WriteString(js.indent) buf.WriteByte('"') buf.WriteString(signatureKey) buf.WriteString("\": ") buf.Write(marshalled) buf.WriteByte('\n') } else { buf.WriteByte('"') buf.WriteString(signatureKey) buf.WriteString("\":") buf.Write(marshalled) } buf.WriteByte('}') return buf.Bytes(), nil } // Signatures provides the signatures on this JWS as opaque blobs, sorted by // keyID. These blobs can be stored and reassembled with payloads. Internally, // they are simply marshaled json web signatures but implementations should // not rely on this. func (js *JSONSignature) Signatures() ([][]byte, error) { sort.Sort(jsSignaturesSorted(js.signatures)) var sb [][]byte for _, jsig := range js.signatures { p, err := json.Marshal(jsig) if err != nil { return nil, err } sb = append(sb, p) } return sb, nil } // Merge combines the signatures from one or more other signatures into the // method receiver. If the payloads differ for any argument, an error will be // returned and the receiver will not be modified. func (js *JSONSignature) Merge(others ...*JSONSignature) error { merged := js.signatures for _, other := range others { if js.payload != other.payload { return fmt.Errorf("payloads differ from merge target") } merged = append(merged, other.signatures...) } js.signatures = merged return nil } ================================================ FILE: vendor/github.com/containers/libtrust/key.go ================================================ package libtrust import ( "crypto" "crypto/ecdsa" "crypto/rsa" "crypto/x509" "encoding/json" "encoding/pem" "errors" "fmt" "io" ) // PublicKey is a generic interface for a Public Key. type PublicKey interface { // KeyType returns the key type for this key. For elliptic curve keys, // this value should be "EC". For RSA keys, this value should be "RSA". KeyType() string // KeyID returns a distinct identifier which is unique to this Public Key. // The format generated by this library is a base32 encoding of a 240 bit // hash of the public key data divided into 12 groups like so: // ABCD:EFGH:IJKL:MNOP:QRST:UVWX:YZ23:4567:ABCD:EFGH:IJKL:MNOP KeyID() string // Verify verifyies the signature of the data in the io.Reader using this // Public Key. The alg parameter should identify the digital signature // algorithm which was used to produce the signature and should be // supported by this public key. Returns a nil error if the signature // is valid. Verify(data io.Reader, alg string, signature []byte) error // CryptoPublicKey returns the internal object which can be used as a // crypto.PublicKey for use with other standard library operations. The type // is either *rsa.PublicKey or *ecdsa.PublicKey CryptoPublicKey() crypto.PublicKey // These public keys can be serialized to the standard JSON encoding for // JSON Web Keys. See section 6 of the IETF draft RFC for JOSE JSON Web // Algorithms. MarshalJSON() ([]byte, error) // These keys can also be serialized to the standard PEM encoding. PEMBlock() (*pem.Block, error) // The string representation of a key is its key type and ID. String() string AddExtendedField(string, interface{}) GetExtendedField(string) interface{} } // PrivateKey is a generic interface for a Private Key. type PrivateKey interface { // A PrivateKey contains all fields and methods of a PublicKey of the // same type. The MarshalJSON method also outputs the private key as a // JSON Web Key, and the PEMBlock method outputs the private key as a // PEM block. PublicKey // PublicKey returns the PublicKey associated with this PrivateKey. PublicKey() PublicKey // Sign signs the data read from the io.Reader using a signature algorithm // supported by the private key. If the specified hashing algorithm is // supported by this key, that hash function is used to generate the // signature otherwise the the default hashing algorithm for this key is // used. Returns the signature and identifier of the algorithm used. Sign(data io.Reader, hashID crypto.Hash) (signature []byte, alg string, err error) // CryptoPrivateKey returns the internal object which can be used as a // crypto.PublicKey for use with other standard library operations. The // type is either *rsa.PublicKey or *ecdsa.PublicKey CryptoPrivateKey() crypto.PrivateKey } // FromCryptoPublicKey returns a libtrust PublicKey representation of the given // *ecdsa.PublicKey or *rsa.PublicKey. Returns a non-nil error when the given // key is of an unsupported type. func FromCryptoPublicKey(cryptoPublicKey crypto.PublicKey) (PublicKey, error) { switch cryptoPublicKey := cryptoPublicKey.(type) { case *ecdsa.PublicKey: return fromECPublicKey(cryptoPublicKey) case *rsa.PublicKey: return fromRSAPublicKey(cryptoPublicKey), nil default: return nil, fmt.Errorf("public key type %T is not supported", cryptoPublicKey) } } // FromCryptoPrivateKey returns a libtrust PrivateKey representation of the given // *ecdsa.PrivateKey or *rsa.PrivateKey. Returns a non-nil error when the given // key is of an unsupported type. func FromCryptoPrivateKey(cryptoPrivateKey crypto.PrivateKey) (PrivateKey, error) { switch cryptoPrivateKey := cryptoPrivateKey.(type) { case *ecdsa.PrivateKey: return fromECPrivateKey(cryptoPrivateKey) case *rsa.PrivateKey: return fromRSAPrivateKey(cryptoPrivateKey), nil default: return nil, fmt.Errorf("private key type %T is not supported", cryptoPrivateKey) } } // UnmarshalPublicKeyPEM parses the PEM encoded data and returns a libtrust // PublicKey or an error if there is a problem with the encoding. func UnmarshalPublicKeyPEM(data []byte) (PublicKey, error) { pemBlock, _ := pem.Decode(data) if pemBlock == nil { return nil, errors.New("unable to find PEM encoded data") } else if pemBlock.Type != "PUBLIC KEY" { return nil, fmt.Errorf("unable to get PublicKey from PEM type: %s", pemBlock.Type) } return pubKeyFromPEMBlock(pemBlock) } // UnmarshalPublicKeyPEMBundle parses the PEM encoded data as a bundle of // PEM blocks appended one after the other and returns a slice of PublicKey // objects that it finds. func UnmarshalPublicKeyPEMBundle(data []byte) ([]PublicKey, error) { pubKeys := []PublicKey{} for { var pemBlock *pem.Block pemBlock, data = pem.Decode(data) if pemBlock == nil { break } else if pemBlock.Type != "PUBLIC KEY" { return nil, fmt.Errorf("unable to get PublicKey from PEM type: %s", pemBlock.Type) } pubKey, err := pubKeyFromPEMBlock(pemBlock) if err != nil { return nil, err } pubKeys = append(pubKeys, pubKey) } return pubKeys, nil } // UnmarshalPrivateKeyPEM parses the PEM encoded data and returns a libtrust // PrivateKey or an error if there is a problem with the encoding. func UnmarshalPrivateKeyPEM(data []byte) (PrivateKey, error) { pemBlock, _ := pem.Decode(data) if pemBlock == nil { return nil, errors.New("unable to find PEM encoded data") } var key PrivateKey switch { case pemBlock.Type == "RSA PRIVATE KEY": rsaPrivateKey, err := x509.ParsePKCS1PrivateKey(pemBlock.Bytes) if err != nil { return nil, fmt.Errorf("unable to decode RSA Private Key PEM data: %s", err) } key = fromRSAPrivateKey(rsaPrivateKey) case pemBlock.Type == "EC PRIVATE KEY": ecPrivateKey, err := x509.ParseECPrivateKey(pemBlock.Bytes) if err != nil { return nil, fmt.Errorf("unable to decode EC Private Key PEM data: %s", err) } key, err = fromECPrivateKey(ecPrivateKey) if err != nil { return nil, err } default: return nil, fmt.Errorf("unable to get PrivateKey from PEM type: %s", pemBlock.Type) } addPEMHeadersToKey(pemBlock, key.PublicKey()) return key, nil } // UnmarshalPublicKeyJWK unmarshals the given JSON Web Key into a generic // Public Key to be used with libtrust. func UnmarshalPublicKeyJWK(data []byte) (PublicKey, error) { jwk := make(map[string]interface{}) err := json.Unmarshal(data, &jwk) if err != nil { return nil, fmt.Errorf( "decoding JWK Public Key JSON data: %s\n", err, ) } // Get the Key Type value. kty, err := stringFromMap(jwk, "kty") if err != nil { return nil, fmt.Errorf("JWK Public Key type: %s", err) } switch { case kty == "EC": // Call out to unmarshal EC public key. return ecPublicKeyFromMap(jwk) case kty == "RSA": // Call out to unmarshal RSA public key. return rsaPublicKeyFromMap(jwk) default: return nil, fmt.Errorf( "JWK Public Key type not supported: %q\n", kty, ) } } // UnmarshalPublicKeyJWKSet parses the JSON encoded data as a JSON Web Key Set // and returns a slice of Public Key objects. func UnmarshalPublicKeyJWKSet(data []byte) ([]PublicKey, error) { rawKeys, err := loadJSONKeySetRaw(data) if err != nil { return nil, err } pubKeys := make([]PublicKey, 0, len(rawKeys)) for _, rawKey := range rawKeys { pubKey, err := UnmarshalPublicKeyJWK(rawKey) if err != nil { return nil, err } pubKeys = append(pubKeys, pubKey) } return pubKeys, nil } // UnmarshalPrivateKeyJWK unmarshals the given JSON Web Key into a generic // Private Key to be used with libtrust. func UnmarshalPrivateKeyJWK(data []byte) (PrivateKey, error) { jwk := make(map[string]interface{}) err := json.Unmarshal(data, &jwk) if err != nil { return nil, fmt.Errorf( "decoding JWK Private Key JSON data: %s\n", err, ) } // Get the Key Type value. kty, err := stringFromMap(jwk, "kty") if err != nil { return nil, fmt.Errorf("JWK Private Key type: %s", err) } switch { case kty == "EC": // Call out to unmarshal EC private key. return ecPrivateKeyFromMap(jwk) case kty == "RSA": // Call out to unmarshal RSA private key. return rsaPrivateKeyFromMap(jwk) default: return nil, fmt.Errorf( "JWK Private Key type not supported: %q\n", kty, ) } } ================================================ FILE: vendor/github.com/containers/libtrust/key_files.go ================================================ package libtrust import ( "encoding/json" "encoding/pem" "errors" "fmt" "io/ioutil" "os" "strings" ) var ( // ErrKeyFileDoesNotExist indicates that the private key file does not exist. ErrKeyFileDoesNotExist = errors.New("key file does not exist") ) func readKeyFileBytes(filename string) ([]byte, error) { data, err := ioutil.ReadFile(filename) if err != nil { if os.IsNotExist(err) { err = ErrKeyFileDoesNotExist } else { err = fmt.Errorf("unable to read key file %s: %s", filename, err) } return nil, err } return data, nil } /* Loading and Saving of Public and Private Keys in either PEM or JWK format. */ // LoadKeyFile opens the given filename and attempts to read a Private Key // encoded in either PEM or JWK format (if .json or .jwk file extension). func LoadKeyFile(filename string) (PrivateKey, error) { contents, err := readKeyFileBytes(filename) if err != nil { return nil, err } var key PrivateKey if strings.HasSuffix(filename, ".json") || strings.HasSuffix(filename, ".jwk") { key, err = UnmarshalPrivateKeyJWK(contents) if err != nil { return nil, fmt.Errorf("unable to decode private key JWK: %s", err) } } else { key, err = UnmarshalPrivateKeyPEM(contents) if err != nil { return nil, fmt.Errorf("unable to decode private key PEM: %s", err) } } return key, nil } // LoadPublicKeyFile opens the given filename and attempts to read a Public Key // encoded in either PEM or JWK format (if .json or .jwk file extension). func LoadPublicKeyFile(filename string) (PublicKey, error) { contents, err := readKeyFileBytes(filename) if err != nil { return nil, err } var key PublicKey if strings.HasSuffix(filename, ".json") || strings.HasSuffix(filename, ".jwk") { key, err = UnmarshalPublicKeyJWK(contents) if err != nil { return nil, fmt.Errorf("unable to decode public key JWK: %s", err) } } else { key, err = UnmarshalPublicKeyPEM(contents) if err != nil { return nil, fmt.Errorf("unable to decode public key PEM: %s", err) } } return key, nil } // SaveKey saves the given key to a file using the provided filename. // This process will overwrite any existing file at the provided location. func SaveKey(filename string, key PrivateKey) error { var encodedKey []byte var err error if strings.HasSuffix(filename, ".json") || strings.HasSuffix(filename, ".jwk") { // Encode in JSON Web Key format. encodedKey, err = json.MarshalIndent(key, "", " ") if err != nil { return fmt.Errorf("unable to encode private key JWK: %s", err) } } else { // Encode in PEM format. pemBlock, err := key.PEMBlock() if err != nil { return fmt.Errorf("unable to encode private key PEM: %s", err) } encodedKey = pem.EncodeToMemory(pemBlock) } err = ioutil.WriteFile(filename, encodedKey, os.FileMode(0600)) if err != nil { return fmt.Errorf("unable to write private key file %s: %s", filename, err) } return nil } // SavePublicKey saves the given public key to the file. func SavePublicKey(filename string, key PublicKey) error { var encodedKey []byte var err error if strings.HasSuffix(filename, ".json") || strings.HasSuffix(filename, ".jwk") { // Encode in JSON Web Key format. encodedKey, err = json.MarshalIndent(key, "", " ") if err != nil { return fmt.Errorf("unable to encode public key JWK: %s", err) } } else { // Encode in PEM format. pemBlock, err := key.PEMBlock() if err != nil { return fmt.Errorf("unable to encode public key PEM: %s", err) } encodedKey = pem.EncodeToMemory(pemBlock) } err = ioutil.WriteFile(filename, encodedKey, os.FileMode(0644)) if err != nil { return fmt.Errorf("unable to write public key file %s: %s", filename, err) } return nil } // Public Key Set files type jwkSet struct { Keys []json.RawMessage `json:"keys"` } // LoadKeySetFile loads a key set func LoadKeySetFile(filename string) ([]PublicKey, error) { if strings.HasSuffix(filename, ".json") || strings.HasSuffix(filename, ".jwk") { return loadJSONKeySetFile(filename) } // Must be a PEM format file return loadPEMKeySetFile(filename) } func loadJSONKeySetRaw(data []byte) ([]json.RawMessage, error) { if len(data) == 0 { // This is okay, just return an empty slice. return []json.RawMessage{}, nil } keySet := jwkSet{} err := json.Unmarshal(data, &keySet) if err != nil { return nil, fmt.Errorf("unable to decode JSON Web Key Set: %s", err) } return keySet.Keys, nil } func loadJSONKeySetFile(filename string) ([]PublicKey, error) { contents, err := readKeyFileBytes(filename) if err != nil && err != ErrKeyFileDoesNotExist { return nil, err } return UnmarshalPublicKeyJWKSet(contents) } func loadPEMKeySetFile(filename string) ([]PublicKey, error) { data, err := readKeyFileBytes(filename) if err != nil && err != ErrKeyFileDoesNotExist { return nil, err } return UnmarshalPublicKeyPEMBundle(data) } // AddKeySetFile adds a key to a key set func AddKeySetFile(filename string, key PublicKey) error { if strings.HasSuffix(filename, ".json") || strings.HasSuffix(filename, ".jwk") { return addKeySetJSONFile(filename, key) } // Must be a PEM format file return addKeySetPEMFile(filename, key) } func addKeySetJSONFile(filename string, key PublicKey) error { encodedKey, err := json.Marshal(key) if err != nil { return fmt.Errorf("unable to encode trusted client key: %s", err) } contents, err := readKeyFileBytes(filename) if err != nil && err != ErrKeyFileDoesNotExist { return err } rawEntries, err := loadJSONKeySetRaw(contents) if err != nil { return err } rawEntries = append(rawEntries, json.RawMessage(encodedKey)) entriesWrapper := jwkSet{Keys: rawEntries} encodedEntries, err := json.MarshalIndent(entriesWrapper, "", " ") if err != nil { return fmt.Errorf("unable to encode trusted client keys: %s", err) } err = ioutil.WriteFile(filename, encodedEntries, os.FileMode(0644)) if err != nil { return fmt.Errorf("unable to write trusted client keys file %s: %s", filename, err) } return nil } func addKeySetPEMFile(filename string, key PublicKey) error { // Encode to PEM, open file for appending, write PEM. file, err := os.OpenFile(filename, os.O_CREATE|os.O_APPEND|os.O_RDWR, os.FileMode(0644)) if err != nil { return fmt.Errorf("unable to open trusted client keys file %s: %s", filename, err) } defer file.Close() pemBlock, err := key.PEMBlock() if err != nil { return fmt.Errorf("unable to encoded trusted key: %s", err) } _, err = file.Write(pem.EncodeToMemory(pemBlock)) if err != nil { return fmt.Errorf("unable to write trusted keys file: %s", err) } return nil } ================================================ FILE: vendor/github.com/containers/libtrust/key_manager.go ================================================ package libtrust import ( "crypto/tls" "crypto/x509" "fmt" "io/ioutil" "net" "os" "path" "sync" ) // ClientKeyManager manages client keys on the filesystem type ClientKeyManager struct { key PrivateKey clientFile string clientDir string clientLock sync.RWMutex clients []PublicKey configLock sync.Mutex configs []*tls.Config } // NewClientKeyManager loads a new manager from a set of key files // and managed by the given private key. func NewClientKeyManager(trustKey PrivateKey, clientFile, clientDir string) (*ClientKeyManager, error) { m := &ClientKeyManager{ key: trustKey, clientFile: clientFile, clientDir: clientDir, } if err := m.loadKeys(); err != nil { return nil, err } // TODO Start watching file and directory return m, nil } func (c *ClientKeyManager) loadKeys() (err error) { // Load authorized keys file var clients []PublicKey if c.clientFile != "" { clients, err = LoadKeySetFile(c.clientFile) if err != nil { return fmt.Errorf("unable to load authorized keys: %s", err) } } // Add clients from authorized keys directory files, err := ioutil.ReadDir(c.clientDir) if err != nil && !os.IsNotExist(err) { return fmt.Errorf("unable to open authorized keys directory: %s", err) } for _, f := range files { if !f.IsDir() { publicKey, err := LoadPublicKeyFile(path.Join(c.clientDir, f.Name())) if err != nil { return fmt.Errorf("unable to load authorized key file: %s", err) } clients = append(clients, publicKey) } } c.clientLock.Lock() c.clients = clients c.clientLock.Unlock() return nil } // RegisterTLSConfig registers a tls configuration to manager // such that any changes to the keys may be reflected in // the tls client CA pool func (c *ClientKeyManager) RegisterTLSConfig(tlsConfig *tls.Config) error { c.clientLock.RLock() certPool, err := GenerateCACertPool(c.key, c.clients) if err != nil { return fmt.Errorf("CA pool generation error: %s", err) } c.clientLock.RUnlock() tlsConfig.ClientCAs = certPool c.configLock.Lock() c.configs = append(c.configs, tlsConfig) c.configLock.Unlock() return nil } // NewIdentityAuthTLSConfig creates a tls.Config for the server to use for // libtrust identity authentication for the domain specified func NewIdentityAuthTLSConfig(trustKey PrivateKey, clients *ClientKeyManager, addr string, domain string) (*tls.Config, error) { tlsConfig := newTLSConfig() tlsConfig.ClientAuth = tls.RequireAndVerifyClientCert if err := clients.RegisterTLSConfig(tlsConfig); err != nil { return nil, err } // Generate cert ips, domains, err := parseAddr(addr) if err != nil { return nil, err } // add domain that it expects clients to use domains = append(domains, domain) x509Cert, err := GenerateSelfSignedServerCert(trustKey, domains, ips) if err != nil { return nil, fmt.Errorf("certificate generation error: %s", err) } tlsConfig.Certificates = []tls.Certificate{{ Certificate: [][]byte{x509Cert.Raw}, PrivateKey: trustKey.CryptoPrivateKey(), Leaf: x509Cert, }} return tlsConfig, nil } // NewCertAuthTLSConfig creates a tls.Config for the server to use for // certificate authentication func NewCertAuthTLSConfig(caPath, certPath, keyPath string) (*tls.Config, error) { tlsConfig := newTLSConfig() cert, err := tls.LoadX509KeyPair(certPath, keyPath) if err != nil { return nil, fmt.Errorf("Couldn't load X509 key pair (%s, %s): %s. Key encrypted?", certPath, keyPath, err) } tlsConfig.Certificates = []tls.Certificate{cert} // Verify client certificates against a CA? if caPath != "" { certPool := x509.NewCertPool() file, err := ioutil.ReadFile(caPath) if err != nil { return nil, fmt.Errorf("Couldn't read CA certificate: %s", err) } certPool.AppendCertsFromPEM(file) tlsConfig.ClientAuth = tls.RequireAndVerifyClientCert tlsConfig.ClientCAs = certPool } return tlsConfig, nil } func newTLSConfig() *tls.Config { return &tls.Config{ NextProtos: []string{"http/1.1"}, // Avoid fallback on insecure SSL protocols MinVersion: tls.VersionTLS10, } } // parseAddr parses an address into an array of IPs and domains func parseAddr(addr string) ([]net.IP, []string, error) { host, _, err := net.SplitHostPort(addr) if err != nil { return nil, nil, err } var domains []string var ips []net.IP ip := net.ParseIP(host) if ip != nil { ips = []net.IP{ip} } else { domains = []string{host} } return ips, domains, nil } ================================================ FILE: vendor/github.com/containers/libtrust/rsa_key.go ================================================ package libtrust import ( "crypto" "crypto/rand" "crypto/rsa" "crypto/x509" "encoding/json" "encoding/pem" "errors" "fmt" "io" "math/big" ) /* * RSA DSA PUBLIC KEY */ // rsaPublicKey implements a JWK Public Key using RSA digital signature algorithms. type rsaPublicKey struct { *rsa.PublicKey extended map[string]interface{} } func fromRSAPublicKey(cryptoPublicKey *rsa.PublicKey) *rsaPublicKey { return &rsaPublicKey{cryptoPublicKey, map[string]interface{}{}} } // KeyType returns the JWK key type for RSA keys, i.e., "RSA". func (k *rsaPublicKey) KeyType() string { return "RSA" } // KeyID returns a distinct identifier which is unique to this Public Key. func (k *rsaPublicKey) KeyID() string { return keyIDFromCryptoKey(k) } func (k *rsaPublicKey) String() string { return fmt.Sprintf("RSA Public Key <%s>", k.KeyID()) } // Verify verifyies the signature of the data in the io.Reader using this Public Key. // The alg parameter should be the name of the JWA digital signature algorithm // which was used to produce the signature and should be supported by this // public key. Returns a nil error if the signature is valid. func (k *rsaPublicKey) Verify(data io.Reader, alg string, signature []byte) error { // Verify the signature of the given date, return non-nil error if valid. sigAlg, err := rsaSignatureAlgorithmByName(alg) if err != nil { return fmt.Errorf("unable to verify Signature: %s", err) } hasher := sigAlg.HashID().New() _, err = io.Copy(hasher, data) if err != nil { return fmt.Errorf("error reading data to sign: %s", err) } hash := hasher.Sum(nil) err = rsa.VerifyPKCS1v15(k.PublicKey, sigAlg.HashID(), hash, signature) if err != nil { return fmt.Errorf("invalid %s signature: %s", sigAlg.HeaderParam(), err) } return nil } // CryptoPublicKey returns the internal object which can be used as a // crypto.PublicKey for use with other standard library operations. The type // is either *rsa.PublicKey or *ecdsa.PublicKey func (k *rsaPublicKey) CryptoPublicKey() crypto.PublicKey { return k.PublicKey } func (k *rsaPublicKey) toMap() map[string]interface{} { jwk := make(map[string]interface{}) for k, v := range k.extended { jwk[k] = v } jwk["kty"] = k.KeyType() jwk["kid"] = k.KeyID() jwk["n"] = joseBase64UrlEncode(k.N.Bytes()) jwk["e"] = joseBase64UrlEncode(serializeRSAPublicExponentParam(k.E)) return jwk } // MarshalJSON serializes this Public Key using the JWK JSON serialization format for // RSA keys. func (k *rsaPublicKey) MarshalJSON() (data []byte, err error) { return json.Marshal(k.toMap()) } // PEMBlock serializes this Public Key to DER-encoded PKIX format. func (k *rsaPublicKey) PEMBlock() (*pem.Block, error) { derBytes, err := x509.MarshalPKIXPublicKey(k.PublicKey) if err != nil { return nil, fmt.Errorf("unable to serialize RSA PublicKey to DER-encoded PKIX format: %s", err) } k.extended["kid"] = k.KeyID() // For display purposes. return createPemBlock("PUBLIC KEY", derBytes, k.extended) } func (k *rsaPublicKey) AddExtendedField(field string, value interface{}) { k.extended[field] = value } func (k *rsaPublicKey) GetExtendedField(field string) interface{} { v, ok := k.extended[field] if !ok { return nil } return v } func rsaPublicKeyFromMap(jwk map[string]interface{}) (*rsaPublicKey, error) { // JWK key type (kty) has already been determined to be "RSA". // Need to extract 'n', 'e', and 'kid' and check for // consistency. // Get the modulus parameter N. nB64Url, err := stringFromMap(jwk, "n") if err != nil { return nil, fmt.Errorf("JWK RSA Public Key modulus: %s", err) } n, err := parseRSAModulusParam(nB64Url) if err != nil { return nil, fmt.Errorf("JWK RSA Public Key modulus: %s", err) } // Get the public exponent E. eB64Url, err := stringFromMap(jwk, "e") if err != nil { return nil, fmt.Errorf("JWK RSA Public Key exponent: %s", err) } e, err := parseRSAPublicExponentParam(eB64Url) if err != nil { return nil, fmt.Errorf("JWK RSA Public Key exponent: %s", err) } key := &rsaPublicKey{ PublicKey: &rsa.PublicKey{N: n, E: e}, } // Key ID is optional, but if it exists, it should match the key. _, ok := jwk["kid"] if ok { kid, err := stringFromMap(jwk, "kid") if err != nil { return nil, fmt.Errorf("JWK RSA Public Key ID: %s", err) } if kid != key.KeyID() { return nil, fmt.Errorf("JWK RSA Public Key ID does not match: %s", kid) } } if _, ok := jwk["d"]; ok { return nil, fmt.Errorf("JWK RSA Public Key cannot contain private exponent") } key.extended = jwk return key, nil } /* * RSA DSA PRIVATE KEY */ // rsaPrivateKey implements a JWK Private Key using RSA digital signature algorithms. type rsaPrivateKey struct { rsaPublicKey *rsa.PrivateKey } func fromRSAPrivateKey(cryptoPrivateKey *rsa.PrivateKey) *rsaPrivateKey { return &rsaPrivateKey{ *fromRSAPublicKey(&cryptoPrivateKey.PublicKey), cryptoPrivateKey, } } // PublicKey returns the Public Key data associated with this Private Key. func (k *rsaPrivateKey) PublicKey() PublicKey { return &k.rsaPublicKey } func (k *rsaPrivateKey) String() string { return fmt.Sprintf("RSA Private Key <%s>", k.KeyID()) } // Sign signs the data read from the io.Reader using a signature algorithm supported // by the RSA private key. If the specified hashing algorithm is supported by // this key, that hash function is used to generate the signature otherwise the // the default hashing algorithm for this key is used. Returns the signature // and the name of the JWK signature algorithm used, e.g., "RS256", "RS384", // "RS512". func (k *rsaPrivateKey) Sign(data io.Reader, hashID crypto.Hash) (signature []byte, alg string, err error) { // Generate a signature of the data using the internal alg. sigAlg := rsaPKCS1v15SignatureAlgorithmForHashID(hashID) hasher := sigAlg.HashID().New() _, err = io.Copy(hasher, data) if err != nil { return nil, "", fmt.Errorf("error reading data to sign: %s", err) } hash := hasher.Sum(nil) signature, err = rsa.SignPKCS1v15(rand.Reader, k.PrivateKey, sigAlg.HashID(), hash) if err != nil { return nil, "", fmt.Errorf("error producing signature: %s", err) } alg = sigAlg.HeaderParam() return } // CryptoPrivateKey returns the internal object which can be used as a // crypto.PublicKey for use with other standard library operations. The type // is either *rsa.PublicKey or *ecdsa.PublicKey func (k *rsaPrivateKey) CryptoPrivateKey() crypto.PrivateKey { return k.PrivateKey } func (k *rsaPrivateKey) toMap() map[string]interface{} { k.Precompute() // Make sure the precomputed values are stored. jwk := k.rsaPublicKey.toMap() jwk["d"] = joseBase64UrlEncode(k.D.Bytes()) jwk["p"] = joseBase64UrlEncode(k.Primes[0].Bytes()) jwk["q"] = joseBase64UrlEncode(k.Primes[1].Bytes()) jwk["dp"] = joseBase64UrlEncode(k.Precomputed.Dp.Bytes()) jwk["dq"] = joseBase64UrlEncode(k.Precomputed.Dq.Bytes()) jwk["qi"] = joseBase64UrlEncode(k.Precomputed.Qinv.Bytes()) otherPrimes := k.Primes[2:] if len(otherPrimes) > 0 { otherPrimesInfo := make([]interface{}, len(otherPrimes)) for i, r := range otherPrimes { otherPrimeInfo := make(map[string]string, 3) otherPrimeInfo["r"] = joseBase64UrlEncode(r.Bytes()) crtVal := k.Precomputed.CRTValues[i] otherPrimeInfo["d"] = joseBase64UrlEncode(crtVal.Exp.Bytes()) otherPrimeInfo["t"] = joseBase64UrlEncode(crtVal.Coeff.Bytes()) otherPrimesInfo[i] = otherPrimeInfo } jwk["oth"] = otherPrimesInfo } return jwk } // MarshalJSON serializes this Private Key using the JWK JSON serialization format for // RSA keys. func (k *rsaPrivateKey) MarshalJSON() (data []byte, err error) { return json.Marshal(k.toMap()) } // PEMBlock serializes this Private Key to DER-encoded PKIX format. func (k *rsaPrivateKey) PEMBlock() (*pem.Block, error) { derBytes := x509.MarshalPKCS1PrivateKey(k.PrivateKey) k.extended["keyID"] = k.KeyID() // For display purposes. return createPemBlock("RSA PRIVATE KEY", derBytes, k.extended) } func rsaPrivateKeyFromMap(jwk map[string]interface{}) (*rsaPrivateKey, error) { // The JWA spec for RSA Private Keys (draft rfc section 5.3.2) states that // only the private key exponent 'd' is REQUIRED, the others are just for // signature/decryption optimizations and SHOULD be included when the JWK // is produced. We MAY choose to accept a JWK which only includes 'd', but // we're going to go ahead and not choose to accept it without the extra // fields. Only the 'oth' field will be optional (for multi-prime keys). privateExponent, err := parseRSAPrivateKeyParamFromMap(jwk, "d") if err != nil { return nil, fmt.Errorf("JWK RSA Private Key exponent: %s", err) } firstPrimeFactor, err := parseRSAPrivateKeyParamFromMap(jwk, "p") if err != nil { return nil, fmt.Errorf("JWK RSA Private Key prime factor: %s", err) } secondPrimeFactor, err := parseRSAPrivateKeyParamFromMap(jwk, "q") if err != nil { return nil, fmt.Errorf("JWK RSA Private Key prime factor: %s", err) } firstFactorCRT, err := parseRSAPrivateKeyParamFromMap(jwk, "dp") if err != nil { return nil, fmt.Errorf("JWK RSA Private Key CRT exponent: %s", err) } secondFactorCRT, err := parseRSAPrivateKeyParamFromMap(jwk, "dq") if err != nil { return nil, fmt.Errorf("JWK RSA Private Key CRT exponent: %s", err) } crtCoeff, err := parseRSAPrivateKeyParamFromMap(jwk, "qi") if err != nil { return nil, fmt.Errorf("JWK RSA Private Key CRT coefficient: %s", err) } var oth interface{} if _, ok := jwk["oth"]; ok { oth = jwk["oth"] delete(jwk, "oth") } // JWK key type (kty) has already been determined to be "RSA". // Need to extract the public key information, then extract the private // key values. publicKey, err := rsaPublicKeyFromMap(jwk) if err != nil { return nil, err } privateKey := &rsa.PrivateKey{ PublicKey: *publicKey.PublicKey, D: privateExponent, Primes: []*big.Int{firstPrimeFactor, secondPrimeFactor}, Precomputed: rsa.PrecomputedValues{ Dp: firstFactorCRT, Dq: secondFactorCRT, Qinv: crtCoeff, }, } if oth != nil { // Should be an array of more JSON objects. otherPrimesInfo, ok := oth.([]interface{}) if !ok { return nil, errors.New("JWK RSA Private Key: Invalid other primes info: must be an array") } numOtherPrimeFactors := len(otherPrimesInfo) if numOtherPrimeFactors == 0 { return nil, errors.New("JWK RSA Privake Key: Invalid other primes info: must be absent or non-empty") } otherPrimeFactors := make([]*big.Int, numOtherPrimeFactors) productOfPrimes := new(big.Int).Mul(firstPrimeFactor, secondPrimeFactor) crtValues := make([]rsa.CRTValue, numOtherPrimeFactors) for i, val := range otherPrimesInfo { otherPrimeinfo, ok := val.(map[string]interface{}) if !ok { return nil, errors.New("JWK RSA Private Key: Invalid other prime info: must be a JSON object") } otherPrimeFactor, err := parseRSAPrivateKeyParamFromMap(otherPrimeinfo, "r") if err != nil { return nil, fmt.Errorf("JWK RSA Private Key prime factor: %s", err) } otherFactorCRT, err := parseRSAPrivateKeyParamFromMap(otherPrimeinfo, "d") if err != nil { return nil, fmt.Errorf("JWK RSA Private Key CRT exponent: %s", err) } otherCrtCoeff, err := parseRSAPrivateKeyParamFromMap(otherPrimeinfo, "t") if err != nil { return nil, fmt.Errorf("JWK RSA Private Key CRT coefficient: %s", err) } crtValue := crtValues[i] crtValue.Exp = otherFactorCRT crtValue.Coeff = otherCrtCoeff crtValue.R = productOfPrimes otherPrimeFactors[i] = otherPrimeFactor productOfPrimes = new(big.Int).Mul(productOfPrimes, otherPrimeFactor) } privateKey.Primes = append(privateKey.Primes, otherPrimeFactors...) privateKey.Precomputed.CRTValues = crtValues } key := &rsaPrivateKey{ rsaPublicKey: *publicKey, PrivateKey: privateKey, } return key, nil } /* * Key Generation Functions. */ func generateRSAPrivateKey(bits int) (k *rsaPrivateKey, err error) { k = new(rsaPrivateKey) k.PrivateKey, err = rsa.GenerateKey(rand.Reader, bits) if err != nil { return nil, err } k.rsaPublicKey.PublicKey = &k.PrivateKey.PublicKey k.extended = make(map[string]interface{}) return } // GenerateRSA2048PrivateKey generates a key pair using 2048-bit RSA. func GenerateRSA2048PrivateKey() (PrivateKey, error) { k, err := generateRSAPrivateKey(2048) if err != nil { return nil, fmt.Errorf("error generating RSA 2048-bit key: %s", err) } return k, nil } // GenerateRSA3072PrivateKey generates a key pair using 3072-bit RSA. func GenerateRSA3072PrivateKey() (PrivateKey, error) { k, err := generateRSAPrivateKey(3072) if err != nil { return nil, fmt.Errorf("error generating RSA 3072-bit key: %s", err) } return k, nil } // GenerateRSA4096PrivateKey generates a key pair using 4096-bit RSA. func GenerateRSA4096PrivateKey() (PrivateKey, error) { k, err := generateRSAPrivateKey(4096) if err != nil { return nil, fmt.Errorf("error generating RSA 4096-bit key: %s", err) } return k, nil } ================================================ FILE: vendor/github.com/containers/libtrust/util.go ================================================ package libtrust import ( "bytes" "crypto" "crypto/elliptic" "crypto/tls" "crypto/x509" "encoding/base32" "encoding/base64" "encoding/binary" "encoding/pem" "errors" "fmt" "math/big" "net/url" "os" "path/filepath" "strings" "time" ) // LoadOrCreateTrustKey will load a PrivateKey from the specified path func LoadOrCreateTrustKey(trustKeyPath string) (PrivateKey, error) { if err := os.MkdirAll(filepath.Dir(trustKeyPath), 0700); err != nil { return nil, err } trustKey, err := LoadKeyFile(trustKeyPath) if err == ErrKeyFileDoesNotExist { trustKey, err = GenerateECP256PrivateKey() if err != nil { return nil, fmt.Errorf("error generating key: %s", err) } if err := SaveKey(trustKeyPath, trustKey); err != nil { return nil, fmt.Errorf("error saving key file: %s", err) } dir, file := filepath.Split(trustKeyPath) if err := SavePublicKey(filepath.Join(dir, "public-"+file), trustKey.PublicKey()); err != nil { return nil, fmt.Errorf("error saving public key file: %s", err) } } else if err != nil { return nil, fmt.Errorf("error loading key file: %s", err) } return trustKey, nil } // NewIdentityAuthTLSClientConfig returns a tls.Config configured to use identity // based authentication from the specified dockerUrl, the rootConfigPath and // the server name to which it is connecting. // If trustUnknownHosts is true it will automatically add the host to the // known-hosts.json in rootConfigPath. func NewIdentityAuthTLSClientConfig(dockerUrl string, trustUnknownHosts bool, rootConfigPath string, serverName string) (*tls.Config, error) { tlsConfig := newTLSConfig() trustKeyPath := filepath.Join(rootConfigPath, "key.json") knownHostsPath := filepath.Join(rootConfigPath, "known-hosts.json") u, err := url.Parse(dockerUrl) if err != nil { return nil, fmt.Errorf("unable to parse machine url") } if u.Scheme == "unix" { return nil, nil } addr := u.Host proto := "tcp" trustKey, err := LoadOrCreateTrustKey(trustKeyPath) if err != nil { return nil, fmt.Errorf("unable to load trust key: %s", err) } knownHosts, err := LoadKeySetFile(knownHostsPath) if err != nil { return nil, fmt.Errorf("could not load trusted hosts file: %s", err) } allowedHosts, err := FilterByHosts(knownHosts, addr, false) if err != nil { return nil, fmt.Errorf("error filtering hosts: %s", err) } certPool, err := GenerateCACertPool(trustKey, allowedHosts) if err != nil { return nil, fmt.Errorf("Could not create CA pool: %s", err) } tlsConfig.ServerName = serverName tlsConfig.RootCAs = certPool x509Cert, err := GenerateSelfSignedClientCert(trustKey) if err != nil { return nil, fmt.Errorf("certificate generation error: %s", err) } tlsConfig.Certificates = []tls.Certificate{{ Certificate: [][]byte{x509Cert.Raw}, PrivateKey: trustKey.CryptoPrivateKey(), Leaf: x509Cert, }} tlsConfig.InsecureSkipVerify = true testConn, err := tls.Dial(proto, addr, tlsConfig) if err != nil { return nil, fmt.Errorf("tls Handshake error: %s", err) } opts := x509.VerifyOptions{ Roots: tlsConfig.RootCAs, CurrentTime: time.Now(), DNSName: tlsConfig.ServerName, Intermediates: x509.NewCertPool(), } certs := testConn.ConnectionState().PeerCertificates for i, cert := range certs { if i == 0 { continue } opts.Intermediates.AddCert(cert) } if _, err := certs[0].Verify(opts); err != nil { if _, ok := err.(x509.UnknownAuthorityError); ok { if trustUnknownHosts { pubKey, err := FromCryptoPublicKey(certs[0].PublicKey) if err != nil { return nil, fmt.Errorf("error extracting public key from cert: %s", err) } pubKey.AddExtendedField("hosts", []string{addr}) if err := AddKeySetFile(knownHostsPath, pubKey); err != nil { return nil, fmt.Errorf("error adding machine to known hosts: %s", err) } } else { return nil, fmt.Errorf("unable to connect. unknown host: %s", addr) } } } testConn.Close() tlsConfig.InsecureSkipVerify = false return tlsConfig, nil } // joseBase64UrlEncode encodes the given data using the standard base64 url // encoding format but with all trailing '=' characters omitted in accordance // with the jose specification. // http://tools.ietf.org/html/draft-ietf-jose-json-web-signature-31#section-2 func joseBase64UrlEncode(b []byte) string { return strings.TrimRight(base64.URLEncoding.EncodeToString(b), "=") } // joseBase64UrlDecode decodes the given string using the standard base64 url // decoder but first adds the appropriate number of trailing '=' characters in // accordance with the jose specification. // http://tools.ietf.org/html/draft-ietf-jose-json-web-signature-31#section-2 func joseBase64UrlDecode(s string) ([]byte, error) { s = strings.Replace(s, "\n", "", -1) s = strings.Replace(s, " ", "", -1) switch len(s) % 4 { case 0: case 2: s += "==" case 3: s += "=" default: return nil, errors.New("illegal base64url string") } return base64.URLEncoding.DecodeString(s) } func keyIDEncode(b []byte) string { s := strings.TrimRight(base32.StdEncoding.EncodeToString(b), "=") var buf bytes.Buffer var i int for i = 0; i < len(s)/4-1; i++ { start := i * 4 end := start + 4 buf.WriteString(s[start:end] + ":") } buf.WriteString(s[i*4:]) return buf.String() } func keyIDFromCryptoKey(pubKey PublicKey) string { // Generate and return a 'libtrust' fingerprint of the public key. // For an RSA key this should be: // SHA256(DER encoded ASN1) // Then truncated to 240 bits and encoded into 12 base32 groups like so: // ABCD:EFGH:IJKL:MNOP:QRST:UVWX:YZ23:4567:ABCD:EFGH:IJKL:MNOP derBytes, err := x509.MarshalPKIXPublicKey(pubKey.CryptoPublicKey()) if err != nil { return "" } hasher := crypto.SHA256.New() hasher.Write(derBytes) return keyIDEncode(hasher.Sum(nil)[:30]) } func stringFromMap(m map[string]interface{}, key string) (string, error) { val, ok := m[key] if !ok { return "", fmt.Errorf("%q value not specified", key) } str, ok := val.(string) if !ok { return "", fmt.Errorf("%q value must be a string", key) } delete(m, key) return str, nil } func parseECCoordinate(cB64Url string, curve elliptic.Curve) (*big.Int, error) { curveByteLen := (curve.Params().BitSize + 7) >> 3 cBytes, err := joseBase64UrlDecode(cB64Url) if err != nil { return nil, fmt.Errorf("invalid base64 URL encoding: %s", err) } cByteLength := len(cBytes) if cByteLength != curveByteLen { return nil, fmt.Errorf("invalid number of octets: got %d, should be %d", cByteLength, curveByteLen) } return new(big.Int).SetBytes(cBytes), nil } func parseECPrivateParam(dB64Url string, curve elliptic.Curve) (*big.Int, error) { dBytes, err := joseBase64UrlDecode(dB64Url) if err != nil { return nil, fmt.Errorf("invalid base64 URL encoding: %s", err) } // The length of this octet string MUST be ceiling(log-base-2(n)/8) // octets (where n is the order of the curve). This is because the private // key d must be in the interval [1, n-1] so the bitlength of d should be // no larger than the bitlength of n-1. The easiest way to find the octet // length is to take bitlength(n-1), add 7 to force a carry, and shift this // bit sequence right by 3, which is essentially dividing by 8 and adding // 1 if there is any remainder. Thus, the private key value d should be // output to (bitlength(n-1)+7)>>3 octets. n := curve.Params().N octetLength := (new(big.Int).Sub(n, big.NewInt(1)).BitLen() + 7) >> 3 dByteLength := len(dBytes) if dByteLength != octetLength { return nil, fmt.Errorf("invalid number of octets: got %d, should be %d", dByteLength, octetLength) } return new(big.Int).SetBytes(dBytes), nil } func parseRSAModulusParam(nB64Url string) (*big.Int, error) { nBytes, err := joseBase64UrlDecode(nB64Url) if err != nil { return nil, fmt.Errorf("invalid base64 URL encoding: %s", err) } return new(big.Int).SetBytes(nBytes), nil } func serializeRSAPublicExponentParam(e int) []byte { // We MUST use the minimum number of octets to represent E. // E is supposed to be 65537 for performance and security reasons // and is what golang's rsa package generates, but it might be // different if imported from some other generator. buf := make([]byte, 4) binary.BigEndian.PutUint32(buf, uint32(e)) var i int for i = 0; i < 8; i++ { if buf[i] != 0 { break } } return buf[i:] } func parseRSAPublicExponentParam(eB64Url string) (int, error) { eBytes, err := joseBase64UrlDecode(eB64Url) if err != nil { return 0, fmt.Errorf("invalid base64 URL encoding: %s", err) } // Only the minimum number of bytes were used to represent E, but // binary.BigEndian.Uint32 expects at least 4 bytes, so we need // to add zero padding if necassary. byteLen := len(eBytes) buf := make([]byte, 4-byteLen, 4) eBytes = append(buf, eBytes...) return int(binary.BigEndian.Uint32(eBytes)), nil } func parseRSAPrivateKeyParamFromMap(m map[string]interface{}, key string) (*big.Int, error) { b64Url, err := stringFromMap(m, key) if err != nil { return nil, err } paramBytes, err := joseBase64UrlDecode(b64Url) if err != nil { return nil, fmt.Errorf("invaled base64 URL encoding: %s", err) } return new(big.Int).SetBytes(paramBytes), nil } func createPemBlock(name string, derBytes []byte, headers map[string]interface{}) (*pem.Block, error) { pemBlock := &pem.Block{Type: name, Bytes: derBytes, Headers: map[string]string{}} for k, v := range headers { switch val := v.(type) { case string: pemBlock.Headers[k] = val case []string: if k == "hosts" { pemBlock.Headers[k] = strings.Join(val, ",") } else { // Return error, non-encodable type } default: // Return error, non-encodable type } } return pemBlock, nil } func pubKeyFromPEMBlock(pemBlock *pem.Block) (PublicKey, error) { cryptoPublicKey, err := x509.ParsePKIXPublicKey(pemBlock.Bytes) if err != nil { return nil, fmt.Errorf("unable to decode Public Key PEM data: %s", err) } pubKey, err := FromCryptoPublicKey(cryptoPublicKey) if err != nil { return nil, err } addPEMHeadersToKey(pemBlock, pubKey) return pubKey, nil } func addPEMHeadersToKey(pemBlock *pem.Block, pubKey PublicKey) { for key, value := range pemBlock.Headers { var safeVal interface{} if key == "hosts" { safeVal = strings.Split(value, ",") } else { safeVal = value } pubKey.AddExtendedField(key, safeVal) } } ================================================ FILE: vendor/github.com/containers/ocicrypt/.gitignore ================================================ *~ ================================================ FILE: vendor/github.com/containers/ocicrypt/.golangci.yml ================================================ linters: enable: - depguard - staticcheck - unconvert - gofmt - goimports - revive - ineffassign - govet - unused - misspell linters-settings: depguard: rules: main: files: - $all deny: - pkg: "io/ioutil" revive: severity: error rules: - name: indent-error-flow severity: warning disabled: false - name: error-strings disabled: false staticcheck: # Suppress reports of deprecated packages checks: ["-SA1019"] ================================================ FILE: vendor/github.com/containers/ocicrypt/ADOPTERS.md ================================================ Below are list of adopters of the `ocicrypt` library or supports use of OCI encrypted images: - [skopeo](https://github.com/containers/skopeo) - [buildah](https://github.com/containers/buildah) - [containerd](https://github.com/containerd/imgcrypt) - [nerdctl](https://github.com/containerd/nerdctl) - [distribution](https://github.com/distribution/distribution) Below are the list of projects that are in the process of adopting support: - [quay](https://github.com/quay/quay) - [kata-containers](https://github.com/kata-containers/kata-containers) ================================================ FILE: vendor/github.com/containers/ocicrypt/CODE-OF-CONDUCT.md ================================================ ## The OCIcrypt Library Project Community Code of Conduct The OCIcrypt Library project follows the [Containers Community Code of Conduct](https://github.com/containers/common/blob/main/CODE-OF-CONDUCT.md). ================================================ FILE: vendor/github.com/containers/ocicrypt/LICENSE ================================================ Apache License Version 2.0, January 2004 https://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: vendor/github.com/containers/ocicrypt/MAINTAINERS ================================================ # ocicrypt maintainers # # Github ID, Name, Email Address lumjjb, Brandon Lum, lumjjb@gmail.com stefanberger, Stefan Berger, stefanb@linux.ibm.com arronwy, Arron Wang, arron.wang@intel.com ================================================ FILE: vendor/github.com/containers/ocicrypt/Makefile ================================================ # Copyright The containerd Authors. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. .PHONY: check build decoder generate-protobuf all: build FORCE: check: golangci-lint run build: vendor go build ./... vendor: go mod tidy test: go clean -testcache go test ./... -test.v generate-protobuf: protoc -I utils/keyprovider/ utils/keyprovider/keyprovider.proto --go_out=plugins=grpc:utils/keyprovider ================================================ FILE: vendor/github.com/containers/ocicrypt/README.md ================================================ # OCIcrypt Library The `ocicrypt` library is the OCI image spec implementation of container image encryption. More details of the spec can be seen in the [OCI repository](https://github.com/opencontainers/image-spec/pull/775). The purpose of this library is to encode spec structures and consts in code, as well as provide a consistent implementation of image encryption across container runtimes and build tools. Consumers of OCIcrypt: - [containerd/imgcrypt](https://github.com/containerd/imgcrypt) - [cri-o](https://github.com/cri-o/cri-o) - [skopeo](https://github.com/containers/skopeo) ## Usage There are various levels of usage for this library. The main consumers of these would be runtime/build tools, and a more specific use would be in the ability to extend cryptographic function. ### Runtime/Build tool usage The general exposed interface a runtime/build tool would use, would be to perform encryption or decryption of layers: ``` package "github.com/containers/ocicrypt" func EncryptLayer(ec *config.EncryptConfig, encOrPlainLayerReader io.Reader, desc ocispec.Descriptor) (io.Reader, EncryptLayerFinalizer, error) func DecryptLayer(dc *config.DecryptConfig, encLayerReader io.Reader, desc ocispec.Descriptor, unwrapOnly bool) (io.Reader, digest.Digest, error) ``` The settings/parameters to these functions can be specified via creation of an encryption config with the `github.com/containers/ocicrypt/config` package. We note that because setting of annotations and other fields of the layer descriptor is done through various means in different runtimes/build tools, it is the responsibility of the caller to still ensure that the layer descriptor follows the OCI specification (i.e. encoding, setting annotations, etc.). ### Crypto Agility and Extensibility The implementation for both symmetric and asymmetric encryption used in this library are behind 2 main interfaces, which users can extend if need be. These are in the following packages: - github.com/containers/ocicrypt/blockcipher - LayerBlockCipher interface for block ciphers - github.com/containers/ocicrypt/keywrap - KeyWrapper interface for key wrapping We note that adding interfaces here is risky outside the OCI spec is not recommended, unless for very specialized and confined usecases. Please open an issue or PR if there is a general usecase that could be added to the OCI spec. #### Keyprovider interface As part of the keywrap interface, there is a [keyprovider](https://github.com/containers/ocicrypt/blob/main/docs/keyprovider.md) implementation that allows one to call out to a binary or service. ## Security Issues We consider security issues related to this library critical. Please report and security related issues by emailing maintainers in the [MAINTAINERS](MAINTAINERS) file. ## Ocicrypt Pkcs11 Support Ocicrypt Pkcs11 support is currently experiemental. For more details, please refer to the [this document](docs/pkcs11.md). ================================================ FILE: vendor/github.com/containers/ocicrypt/SECURITY.md ================================================ ## Security and Disclosure Information Policy for the OCIcrypt Library Project The OCIcrypt Library Project follows the [Security and Disclosure Information Policy](https://github.com/containers/common/blob/main/SECURITY.md) for the Containers Projects. ================================================ FILE: vendor/github.com/containers/ocicrypt/blockcipher/blockcipher.go ================================================ /* Copyright The ocicrypt Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package blockcipher import ( "errors" "fmt" "io" "github.com/opencontainers/go-digest" ) // LayerCipherType is the ciphertype as specified in the layer metadata type LayerCipherType string // TODO: Should be obtained from OCI spec once included const ( AES256CTR LayerCipherType = "AES_256_CTR_HMAC_SHA256" ) // PrivateLayerBlockCipherOptions includes the information required to encrypt/decrypt // an image which are sensitive and should not be in plaintext type PrivateLayerBlockCipherOptions struct { // SymmetricKey represents the symmetric key used for encryption/decryption // This field should be populated by Encrypt/Decrypt calls SymmetricKey []byte `json:"symkey"` // Digest is the digest of the original data for verification. // This is NOT populated by Encrypt/Decrypt calls Digest digest.Digest `json:"digest"` // CipherOptions contains the cipher metadata used for encryption/decryption // This field should be populated by Encrypt/Decrypt calls CipherOptions map[string][]byte `json:"cipheroptions"` } // PublicLayerBlockCipherOptions includes the information required to encrypt/decrypt // an image which are public and can be deduplicated in plaintext across multiple // recipients type PublicLayerBlockCipherOptions struct { // CipherType denotes the cipher type according to the list of OCI suppported // cipher types. CipherType LayerCipherType `json:"cipher"` // Hmac contains the hmac string to help verify encryption Hmac []byte `json:"hmac"` // CipherOptions contains the cipher metadata used for encryption/decryption // This field should be populated by Encrypt/Decrypt calls CipherOptions map[string][]byte `json:"cipheroptions"` } // LayerBlockCipherOptions contains the public and private LayerBlockCipherOptions // required to encrypt/decrypt an image type LayerBlockCipherOptions struct { Public PublicLayerBlockCipherOptions Private PrivateLayerBlockCipherOptions } // LayerBlockCipher returns a provider for encrypt/decrypt functionality // for handling the layer data for a specific algorithm type LayerBlockCipher interface { // GenerateKey creates a symmetric key GenerateKey() ([]byte, error) // Encrypt takes in layer data and returns the ciphertext and relevant LayerBlockCipherOptions Encrypt(layerDataReader io.Reader, opt LayerBlockCipherOptions) (io.Reader, Finalizer, error) // Decrypt takes in layer ciphertext data and returns the plaintext and relevant LayerBlockCipherOptions Decrypt(layerDataReader io.Reader, opt LayerBlockCipherOptions) (io.Reader, LayerBlockCipherOptions, error) } // LayerBlockCipherHandler is the handler for encrypt/decrypt for layers type LayerBlockCipherHandler struct { cipherMap map[LayerCipherType]LayerBlockCipher } // Finalizer is called after data blobs are written, and returns the LayerBlockCipherOptions for the encrypted blob type Finalizer func() (LayerBlockCipherOptions, error) // GetOpt returns the value of the cipher option and if the option exists func (lbco LayerBlockCipherOptions) GetOpt(key string) (value []byte, ok bool) { if v, ok := lbco.Public.CipherOptions[key]; ok { return v, ok } else if v, ok := lbco.Private.CipherOptions[key]; ok { return v, ok } return nil, false } func wrapFinalizerWithType(fin Finalizer, typ LayerCipherType) Finalizer { return func() (LayerBlockCipherOptions, error) { lbco, err := fin() if err != nil { return LayerBlockCipherOptions{}, err } lbco.Public.CipherType = typ return lbco, err } } // Encrypt is the handler for the layer decryption routine func (h *LayerBlockCipherHandler) Encrypt(plainDataReader io.Reader, typ LayerCipherType) (io.Reader, Finalizer, error) { if c, ok := h.cipherMap[typ]; ok { sk, err := c.GenerateKey() if err != nil { return nil, nil, err } opt := LayerBlockCipherOptions{ Private: PrivateLayerBlockCipherOptions{ SymmetricKey: sk, }, } encDataReader, fin, err := c.Encrypt(plainDataReader, opt) if err == nil { fin = wrapFinalizerWithType(fin, typ) } return encDataReader, fin, err } return nil, nil, fmt.Errorf("unsupported cipher type: %s", typ) } // Decrypt is the handler for the layer decryption routine func (h *LayerBlockCipherHandler) Decrypt(encDataReader io.Reader, opt LayerBlockCipherOptions) (io.Reader, LayerBlockCipherOptions, error) { typ := opt.Public.CipherType if typ == "" { return nil, LayerBlockCipherOptions{}, errors.New("no cipher type provided") } if c, ok := h.cipherMap[typ]; ok { return c.Decrypt(encDataReader, opt) } return nil, LayerBlockCipherOptions{}, fmt.Errorf("unsupported cipher type: %s", typ) } // NewLayerBlockCipherHandler returns a new default handler func NewLayerBlockCipherHandler() (*LayerBlockCipherHandler, error) { h := LayerBlockCipherHandler{ cipherMap: map[LayerCipherType]LayerBlockCipher{}, } var err error h.cipherMap[AES256CTR], err = NewAESCTRLayerBlockCipher(256) if err != nil { return nil, fmt.Errorf("unable to set up Cipher AES-256-CTR: %w", err) } return &h, nil } ================================================ FILE: vendor/github.com/containers/ocicrypt/blockcipher/blockcipher_aes_ctr.go ================================================ /* Copyright The ocicrypt Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package blockcipher import ( "crypto/aes" "crypto/cipher" "crypto/hmac" "crypto/rand" "crypto/sha256" "errors" "fmt" "hash" "io" "github.com/containers/ocicrypt/utils" ) // AESCTRLayerBlockCipher implements the AES CTR stream cipher type AESCTRLayerBlockCipher struct { keylen int // in bytes reader io.Reader encrypt bool stream cipher.Stream err error hmac hash.Hash expHmac []byte doneEncrypting bool } type aesctrcryptor struct { bc *AESCTRLayerBlockCipher } // NewAESCTRLayerBlockCipher returns a new AES SIV block cipher of 256 or 512 bits func NewAESCTRLayerBlockCipher(bits int) (LayerBlockCipher, error) { if bits != 256 { return nil, errors.New("AES CTR bit count not supported") } return &AESCTRLayerBlockCipher{keylen: bits / 8}, nil } func (r *aesctrcryptor) Read(p []byte) (int, error) { var ( o int ) if r.bc.err != nil { return 0, r.bc.err } o, err := utils.FillBuffer(r.bc.reader, p) if err != nil { if err == io.EOF { r.bc.err = err } else { return 0, err } } if !r.bc.encrypt { if _, err := r.bc.hmac.Write(p[:o]); err != nil { r.bc.err = fmt.Errorf("could not write to hmac: %w", err) return 0, r.bc.err } if r.bc.err == io.EOF { // Before we return EOF we let the HMAC comparison // provide a verdict if !hmac.Equal(r.bc.hmac.Sum(nil), r.bc.expHmac) { r.bc.err = fmt.Errorf("could not properly decrypt byte stream; exp hmac: '%x', actual hmac: '%s'", r.bc.expHmac, r.bc.hmac.Sum(nil)) return 0, r.bc.err } } } r.bc.stream.XORKeyStream(p[:o], p[:o]) if r.bc.encrypt { if _, err := r.bc.hmac.Write(p[:o]); err != nil { r.bc.err = fmt.Errorf("could not write to hmac: %w", err) return 0, r.bc.err } if r.bc.err == io.EOF { // Final data encrypted; Do the 'then-MAC' part r.bc.doneEncrypting = true } } return o, r.bc.err } // init initializes an instance func (bc *AESCTRLayerBlockCipher) init(encrypt bool, reader io.Reader, opts LayerBlockCipherOptions) (LayerBlockCipherOptions, error) { var ( err error ) key := opts.Private.SymmetricKey if len(key) != bc.keylen { return LayerBlockCipherOptions{}, fmt.Errorf("invalid key length of %d bytes; need %d bytes", len(key), bc.keylen) } nonce, ok := opts.GetOpt("nonce") if !ok { nonce = make([]byte, aes.BlockSize) if _, err := io.ReadFull(rand.Reader, nonce); err != nil { return LayerBlockCipherOptions{}, fmt.Errorf("unable to generate random nonce: %w", err) } } block, err := aes.NewCipher(key) if err != nil { return LayerBlockCipherOptions{}, fmt.Errorf("aes.NewCipher failed: %w", err) } bc.reader = reader bc.encrypt = encrypt bc.stream = cipher.NewCTR(block, nonce) bc.err = nil bc.hmac = hmac.New(sha256.New, key) bc.expHmac = opts.Public.Hmac bc.doneEncrypting = false if !encrypt && len(bc.expHmac) == 0 { return LayerBlockCipherOptions{}, errors.New("HMAC is not provided for decryption process") } lbco := LayerBlockCipherOptions{ Private: PrivateLayerBlockCipherOptions{ SymmetricKey: key, CipherOptions: map[string][]byte{ "nonce": nonce, }, }, } return lbco, nil } // GenerateKey creates a synmmetric key func (bc *AESCTRLayerBlockCipher) GenerateKey() ([]byte, error) { key := make([]byte, bc.keylen) if _, err := io.ReadFull(rand.Reader, key); err != nil { return nil, err } return key, nil } // Encrypt takes in layer data and returns the ciphertext and relevant LayerBlockCipherOptions func (bc *AESCTRLayerBlockCipher) Encrypt(plainDataReader io.Reader, opt LayerBlockCipherOptions) (io.Reader, Finalizer, error) { lbco, err := bc.init(true, plainDataReader, opt) if err != nil { return nil, nil, err } finalizer := func() (LayerBlockCipherOptions, error) { if !bc.doneEncrypting { return LayerBlockCipherOptions{}, errors.New("Read()ing not complete, unable to finalize") } if lbco.Public.CipherOptions == nil { lbco.Public.CipherOptions = map[string][]byte{} } lbco.Public.Hmac = bc.hmac.Sum(nil) return lbco, nil } return &aesctrcryptor{bc}, finalizer, nil } // Decrypt takes in layer ciphertext data and returns the plaintext and relevant LayerBlockCipherOptions func (bc *AESCTRLayerBlockCipher) Decrypt(encDataReader io.Reader, opt LayerBlockCipherOptions) (io.Reader, LayerBlockCipherOptions, error) { lbco, err := bc.init(false, encDataReader, opt) if err != nil { return nil, LayerBlockCipherOptions{}, err } return utils.NewDelayedReader(&aesctrcryptor{bc}, 1024*10), lbco, nil } ================================================ FILE: vendor/github.com/containers/ocicrypt/config/config.go ================================================ /* Copyright The ocicrypt Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package config // EncryptConfig is the container image PGP encryption configuration holding // the identifiers of those that will be able to decrypt the container and // the PGP public keyring file data that contains their public keys. type EncryptConfig struct { // map holding 'gpg-recipients', 'gpg-pubkeyringfile', 'pubkeys', 'x509s' Parameters map[string][][]byte DecryptConfig DecryptConfig } // DecryptConfig wraps the Parameters map that holds the decryption key type DecryptConfig struct { // map holding 'privkeys', 'x509s', 'gpg-privatekeys' Parameters map[string][][]byte } // CryptoConfig is a common wrapper for EncryptConfig and DecrypConfig that can // be passed through functions that share much code for encryption and decryption type CryptoConfig struct { EncryptConfig *EncryptConfig DecryptConfig *DecryptConfig } // InitDecryption initialized a CryptoConfig object with parameters used for decryption func InitDecryption(dcparameters map[string][][]byte) CryptoConfig { return CryptoConfig{ DecryptConfig: &DecryptConfig{ Parameters: dcparameters, }, } } // InitEncryption initializes a CryptoConfig object with parameters used for encryption // It also takes dcparameters that may be needed for decryption when adding a recipient // to an already encrypted image func InitEncryption(parameters, dcparameters map[string][][]byte) CryptoConfig { return CryptoConfig{ EncryptConfig: &EncryptConfig{ Parameters: parameters, DecryptConfig: DecryptConfig{ Parameters: dcparameters, }, }, } } // CombineCryptoConfigs takes a CryptoConfig list and creates a single CryptoConfig // containing the crypto configuration of all the key bundles func CombineCryptoConfigs(ccs []CryptoConfig) CryptoConfig { ecparam := map[string][][]byte{} ecdcparam := map[string][][]byte{} dcparam := map[string][][]byte{} for _, cc := range ccs { if ec := cc.EncryptConfig; ec != nil { addToMap(ecparam, ec.Parameters) addToMap(ecdcparam, ec.DecryptConfig.Parameters) } if dc := cc.DecryptConfig; dc != nil { addToMap(dcparam, dc.Parameters) } } return CryptoConfig{ EncryptConfig: &EncryptConfig{ Parameters: ecparam, DecryptConfig: DecryptConfig{ Parameters: ecdcparam, }, }, DecryptConfig: &DecryptConfig{ Parameters: dcparam, }, } } // AttachDecryptConfig adds DecryptConfig to the field of EncryptConfig so that // the decryption parameters can be used to add recipients to an existing image // if the user is able to decrypt it. func (ec *EncryptConfig) AttachDecryptConfig(dc *DecryptConfig) { if dc != nil { addToMap(ec.DecryptConfig.Parameters, dc.Parameters) } } func addToMap(orig map[string][][]byte, add map[string][][]byte) { for k, v := range add { if ov, ok := orig[k]; ok { orig[k] = append(ov, v...) } else { orig[k] = v } } } ================================================ FILE: vendor/github.com/containers/ocicrypt/config/constructors.go ================================================ /* Copyright The ocicrypt Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package config import ( "errors" "fmt" "strings" "github.com/containers/ocicrypt/crypto/pkcs11" "gopkg.in/yaml.v3" ) // EncryptWithJwe returns a CryptoConfig to encrypt with jwe public keys func EncryptWithJwe(pubKeys [][]byte) (CryptoConfig, error) { dc := DecryptConfig{} ep := map[string][][]byte{ "pubkeys": pubKeys, } return CryptoConfig{ EncryptConfig: &EncryptConfig{ Parameters: ep, DecryptConfig: dc, }, DecryptConfig: &dc, }, nil } // EncryptWithPkcs7 returns a CryptoConfig to encrypt with pkcs7 x509 certs func EncryptWithPkcs7(x509s [][]byte) (CryptoConfig, error) { dc := DecryptConfig{} ep := map[string][][]byte{ "x509s": x509s, } return CryptoConfig{ EncryptConfig: &EncryptConfig{ Parameters: ep, DecryptConfig: dc, }, DecryptConfig: &dc, }, nil } // EncryptWithGpg returns a CryptoConfig to encrypt with configured gpg parameters func EncryptWithGpg(gpgRecipients [][]byte, gpgPubRingFile []byte) (CryptoConfig, error) { dc := DecryptConfig{} ep := map[string][][]byte{ "gpg-recipients": gpgRecipients, "gpg-pubkeyringfile": {gpgPubRingFile}, } return CryptoConfig{ EncryptConfig: &EncryptConfig{ Parameters: ep, DecryptConfig: dc, }, DecryptConfig: &dc, }, nil } // EncryptWithPkcs11 returns a CryptoConfig to encrypt with configured pkcs11 parameters func EncryptWithPkcs11(pkcs11Config *pkcs11.Pkcs11Config, pkcs11Pubkeys, pkcs11Yamls [][]byte) (CryptoConfig, error) { dc := DecryptConfig{} ep := map[string][][]byte{} if len(pkcs11Yamls) > 0 { if pkcs11Config == nil { return CryptoConfig{}, errors.New("pkcs11Config must not be nil") } p11confYaml, err := yaml.Marshal(pkcs11Config) if err != nil { return CryptoConfig{}, fmt.Errorf("Could not marshal Pkcs11Config to Yaml: %w", err) } dc = DecryptConfig{ Parameters: map[string][][]byte{ "pkcs11-config": {p11confYaml}, }, } ep["pkcs11-yamls"] = pkcs11Yamls } if len(pkcs11Pubkeys) > 0 { ep["pkcs11-pubkeys"] = pkcs11Pubkeys } return CryptoConfig{ EncryptConfig: &EncryptConfig{ Parameters: ep, DecryptConfig: dc, }, DecryptConfig: &dc, }, nil } // EncryptWithKeyProvider returns a CryptoConfig to encrypt with configured keyprovider parameters func EncryptWithKeyProvider(keyProviders [][]byte) (CryptoConfig, error) { dc := DecryptConfig{} ep := make(map[string][][]byte) for _, keyProvider := range keyProviders { keyProvidersStr := string(keyProvider) idx := strings.Index(keyProvidersStr, ":") if idx > 0 { ep[keyProvidersStr[:idx]] = append(ep[keyProvidersStr[:idx]], []byte(keyProvidersStr[idx+1:])) } else { ep[keyProvidersStr] = append(ep[keyProvidersStr], []byte("Enabled")) } } return CryptoConfig{ EncryptConfig: &EncryptConfig{ Parameters: ep, DecryptConfig: dc, }, DecryptConfig: &dc, }, nil } // DecryptWithKeyProvider returns a CryptoConfig to decrypt with configured keyprovider parameters func DecryptWithKeyProvider(keyProviders [][]byte) (CryptoConfig, error) { dp := make(map[string][][]byte) ep := map[string][][]byte{} for _, keyProvider := range keyProviders { keyProvidersStr := string(keyProvider) idx := strings.Index(keyProvidersStr, ":") if idx > 0 { dp[keyProvidersStr[:idx]] = append(dp[keyProvidersStr[:idx]], []byte(keyProvidersStr[idx+1:])) } else { dp[keyProvidersStr] = append(dp[keyProvidersStr], []byte("Enabled")) } } dc := DecryptConfig{ Parameters: dp, } return CryptoConfig{ EncryptConfig: &EncryptConfig{ Parameters: ep, DecryptConfig: dc, }, DecryptConfig: &dc, }, nil } // DecryptWithPrivKeys returns a CryptoConfig to decrypt with configured private keys func DecryptWithPrivKeys(privKeys [][]byte, privKeysPasswords [][]byte) (CryptoConfig, error) { if len(privKeys) != len(privKeysPasswords) { return CryptoConfig{}, errors.New("Length of privKeys should match length of privKeysPasswords") } dc := DecryptConfig{ Parameters: map[string][][]byte{ "privkeys": privKeys, "privkeys-passwords": privKeysPasswords, }, } ep := map[string][][]byte{} return CryptoConfig{ EncryptConfig: &EncryptConfig{ Parameters: ep, DecryptConfig: dc, }, DecryptConfig: &dc, }, nil } // DecryptWithX509s returns a CryptoConfig to decrypt with configured x509 certs func DecryptWithX509s(x509s [][]byte) (CryptoConfig, error) { dc := DecryptConfig{ Parameters: map[string][][]byte{ "x509s": x509s, }, } ep := map[string][][]byte{} return CryptoConfig{ EncryptConfig: &EncryptConfig{ Parameters: ep, DecryptConfig: dc, }, DecryptConfig: &dc, }, nil } // DecryptWithGpgPrivKeys returns a CryptoConfig to decrypt with configured gpg private keys func DecryptWithGpgPrivKeys(gpgPrivKeys, gpgPrivKeysPwds [][]byte) (CryptoConfig, error) { dc := DecryptConfig{ Parameters: map[string][][]byte{ "gpg-privatekeys": gpgPrivKeys, "gpg-privatekeys-passwords": gpgPrivKeysPwds, }, } ep := map[string][][]byte{} return CryptoConfig{ EncryptConfig: &EncryptConfig{ Parameters: ep, DecryptConfig: dc, }, DecryptConfig: &dc, }, nil } // DecryptWithPkcs11Yaml returns a CryptoConfig to decrypt with pkcs11 YAML formatted key files func DecryptWithPkcs11Yaml(pkcs11Config *pkcs11.Pkcs11Config, pkcs11Yamls [][]byte) (CryptoConfig, error) { p11confYaml, err := yaml.Marshal(pkcs11Config) if err != nil { return CryptoConfig{}, fmt.Errorf("Could not marshal Pkcs11Config to Yaml: %w", err) } dc := DecryptConfig{ Parameters: map[string][][]byte{ "pkcs11-yamls": pkcs11Yamls, "pkcs11-config": {p11confYaml}, }, } ep := map[string][][]byte{} return CryptoConfig{ EncryptConfig: &EncryptConfig{ Parameters: ep, DecryptConfig: dc, }, DecryptConfig: &dc, }, nil } ================================================ FILE: vendor/github.com/containers/ocicrypt/config/keyprovider-config/config.go ================================================ /* Copyright The ocicrypt Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package config import ( "encoding/json" "fmt" "os" ) // Command describes the structure of command, it consist of path and args, where path defines the location of // binary executable and args are passed on to the binary executable type Command struct { Path string `json:"path,omitempty"` Args []string `json:"args,omitempty"` } // KeyProviderAttrs describes the structure of key provider, it defines the way of invocation to key provider type KeyProviderAttrs struct { Command *Command `json:"cmd,omitempty"` Grpc string `json:"grpc,omitempty"` } // OcicryptConfig represents the format of an ocicrypt_provider.conf config file type OcicryptConfig struct { KeyProviderConfig map[string]KeyProviderAttrs `json:"key-providers"` } const ENVVARNAME = "OCICRYPT_KEYPROVIDER_CONFIG" // parseConfigFile parses a configuration file; it is not an error if the configuration file does // not exist, so no error is returned. func parseConfigFile(filename string) (*OcicryptConfig, error) { // a non-existent config file is not an error _, err := os.Stat(filename) if os.IsNotExist(err) { return nil, nil } data, err := os.ReadFile(filename) if err != nil { return nil, err } ic := &OcicryptConfig{} err = json.Unmarshal(data, ic) return ic, err } // getConfiguration tries to read the configuration file at the following locations // ${OCICRYPT_KEYPROVIDER_CONFIG} == "/etc/ocicrypt_keyprovider.yaml" // If no configuration file could be found or read a null pointer is returned func GetConfiguration() (*OcicryptConfig, error) { var ic *OcicryptConfig var err error filename := os.Getenv(ENVVARNAME) if len(filename) > 0 { ic, err = parseConfigFile(filename) if err != nil { return nil, fmt.Errorf("Error while parsing keyprovider config file: %w", err) } } else { return nil, nil } return ic, nil } ================================================ FILE: vendor/github.com/containers/ocicrypt/config/pkcs11config/config.go ================================================ /* Copyright The containerd Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package pkcs11config import ( "errors" "fmt" "os" "path" "github.com/containers/ocicrypt/crypto/pkcs11" "gopkg.in/yaml.v3" ) // OcicryptConfig represents the format of an imgcrypt.conf config file type OcicryptConfig struct { Pkcs11Config pkcs11.Pkcs11Config `yaml:"pkcs11"` } const CONFIGFILE = "ocicrypt.conf" const ENVVARNAME = "OCICRYPT_CONFIG" // parseConfigFile parses a configuration file; it is not an error if the configuration file does // not exist, so no error is returned. // A config file may look like this: // module-directories: // - /usr/lib64/pkcs11/ // - /usr/lib/pkcs11/ // allowed-module-paths: // - /usr/lib64/pkcs11/ // - /usr/lib/pkcs11/ func parseConfigFile(filename string) (*OcicryptConfig, error) { // a non-existent config file is not an error _, err := os.Stat(filename) if os.IsNotExist(err) { return nil, nil } data, err := os.ReadFile(filename) if err != nil { return nil, err } ic := &OcicryptConfig{} err = yaml.Unmarshal(data, ic) return ic, err } // getConfiguration tries to read the configuration file at the following locations // 1) ${OCICRYPT_CONFIG} == "internal": use internal default allow-all policy // 2) ${OCICRYPT_CONFIG} // 3) ${XDG_CONFIG_HOME}/ocicrypt-pkcs11.conf // 4) ${HOME}/.config/ocicrypt-pkcs11.conf // 5) /etc/ocicrypt-pkcs11.conf // If no configuration file could be found or read a null pointer is returned func getConfiguration() (*OcicryptConfig, error) { filename := os.Getenv(ENVVARNAME) if len(filename) > 0 { if filename == "internal" { return getDefaultCryptoConfigOpts() } ic, err := parseConfigFile(filename) if err != nil || ic != nil { return ic, err } } envvar := os.Getenv("XDG_CONFIG_HOME") if len(envvar) > 0 { ic, err := parseConfigFile(path.Join(envvar, CONFIGFILE)) if err != nil || ic != nil { return ic, err } } envvar = os.Getenv("HOME") if len(envvar) > 0 { ic, err := parseConfigFile(path.Join(envvar, ".config", CONFIGFILE)) if err != nil || ic != nil { return ic, err } } return parseConfigFile(path.Join("etc", CONFIGFILE)) } // getDefaultCryptoConfigOpts returns default crypto config opts needed for pkcs11 module access func getDefaultCryptoConfigOpts() (*OcicryptConfig, error) { mdyaml := pkcs11.GetDefaultModuleDirectoriesYaml("") config := fmt.Sprintf("module-directories:\n"+ "%s"+ "allowed-module-paths:\n"+ "%s", mdyaml, mdyaml) p11conf, err := pkcs11.ParsePkcs11ConfigFile([]byte(config)) return &OcicryptConfig{ Pkcs11Config: *p11conf, }, err } // GetUserPkcs11Config gets the user's Pkcs11Conig either from a configuration file or if none is // found the default ones are returned func GetUserPkcs11Config() (*pkcs11.Pkcs11Config, error) { fmt.Print("Note: pkcs11 support is currently experimental\n") ic, err := getConfiguration() if err != nil { return &pkcs11.Pkcs11Config{}, err } if ic == nil { return &pkcs11.Pkcs11Config{}, errors.New("No ocicrypt config file was found") } return &ic.Pkcs11Config, nil } ================================================ FILE: vendor/github.com/containers/ocicrypt/crypto/pkcs11/common.go ================================================ /* Copyright The ocicrypt Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package pkcs11 import ( "fmt" pkcs11uri "github.com/stefanberger/go-pkcs11uri" "gopkg.in/yaml.v3" ) // Pkcs11KeyFile describes the format of the pkcs11 (private) key file. // It also carries pkcs11 module related environment variables that are transferred to the // Pkcs11URI object and activated when the pkcs11 module is used. type Pkcs11KeyFile struct { Pkcs11 struct { Uri string `yaml:"uri"` } `yaml:"pkcs11"` Module struct { Env map[string]string `yaml:"env,omitempty"` } `yaml:"module"` } // Pkcs11KeyFileObject is a representation of the Pkcs11KeyFile with the pkcs11 URI as an object type Pkcs11KeyFileObject struct { Uri *pkcs11uri.Pkcs11URI } // ParsePkcs11Uri parses a pkcs11 URI func ParsePkcs11Uri(uri string) (*pkcs11uri.Pkcs11URI, error) { p11uri := pkcs11uri.New() err := p11uri.Parse(uri) if err != nil { return nil, fmt.Errorf("Could not parse Pkcs11URI from file: %w", err) } return p11uri, err } // ParsePkcs11KeyFile parses a pkcs11 key file holding a pkcs11 URI describing a private key. // The file has the following yaml format: // pkcs11: // - uri : // An error is returned if the pkcs11 URI is malformed func ParsePkcs11KeyFile(yamlstr []byte) (*Pkcs11KeyFileObject, error) { p11keyfile := Pkcs11KeyFile{} err := yaml.Unmarshal(yamlstr, &p11keyfile) if err != nil { return nil, fmt.Errorf("Could not unmarshal pkcs11 keyfile: %w", err) } p11uri, err := ParsePkcs11Uri(p11keyfile.Pkcs11.Uri) if err != nil { return nil, err } p11uri.SetEnvMap(p11keyfile.Module.Env) return &Pkcs11KeyFileObject{Uri: p11uri}, err } // IsPkcs11PrivateKey checks whether the given YAML represents a Pkcs11 private key func IsPkcs11PrivateKey(yamlstr []byte) bool { _, err := ParsePkcs11KeyFile(yamlstr) return err == nil } // IsPkcs11PublicKey checks whether the given YAML represents a Pkcs11 public key func IsPkcs11PublicKey(yamlstr []byte) bool { _, err := ParsePkcs11KeyFile(yamlstr) return err == nil } // Pkcs11Config describes the layout of a pkcs11 config file // The file has the following yaml format: // module-directories: // - /usr/lib64/pkcs11/ // allowd-module-paths // - /usr/lib64/pkcs11/libsofthsm2.so type Pkcs11Config struct { ModuleDirectories []string `yaml:"module-directories"` AllowedModulePaths []string `yaml:"allowed-module-paths"` } // GetDefaultModuleDirectories returns module directories covering // a variety of Linux distros func GetDefaultModuleDirectories() []string { dirs := []string{ "/usr/lib64/pkcs11/", // Fedora,RHEL,openSUSE "/usr/lib/pkcs11/", // Fedora,ArchLinux "/usr/local/lib/pkcs11/", "/usr/lib/softhsm/", // Debian,Ubuntu } // Debian directory: /usr/lib/(x86_64|aarch64|arm|powerpc64le|riscv64|s390x)-linux-gnu/ hosttype, ostype, q := getHostAndOsType() if len(hosttype) > 0 { dir := fmt.Sprintf("/usr/lib/%s-%s-%s/", hosttype, ostype, q) dirs = append(dirs, dir) } return dirs } // GetDefaultModuleDirectoresFormatted returns the default module directories formatted for YAML func GetDefaultModuleDirectoriesYaml(indent string) string { res := "" for _, dir := range GetDefaultModuleDirectories() { res += indent + "- " + dir + "\n" } return res } // ParsePkcs11ConfigFile parses a pkcs11 config file hat influences the module search behavior // as well as the set of modules that users are allowed to use func ParsePkcs11ConfigFile(yamlstr []byte) (*Pkcs11Config, error) { p11conf := Pkcs11Config{} err := yaml.Unmarshal(yamlstr, &p11conf) if err != nil { return &p11conf, fmt.Errorf("Could not parse Pkcs11Config: %w", err) } return &p11conf, nil } ================================================ FILE: vendor/github.com/containers/ocicrypt/crypto/pkcs11/pkcs11helpers.go ================================================ //go:build cgo // +build cgo /* Copyright The ocicrypt Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package pkcs11 import ( "crypto/rand" "crypto/rsa" "crypto/sha1" "crypto/sha256" "encoding/base64" "encoding/json" "errors" "fmt" "hash" "net/url" "os" "strconv" "strings" "github.com/miekg/pkcs11" pkcs11uri "github.com/stefanberger/go-pkcs11uri" ) var ( // OAEPLabel defines the label we use for OAEP encryption; this cannot be changed OAEPLabel = []byte("") // OAEPSha1Params describes the OAEP parameters with sha1 hash algorithm; needed by SoftHSM OAEPSha1Params = &pkcs11.OAEPParams{ HashAlg: pkcs11.CKM_SHA_1, MGF: pkcs11.CKG_MGF1_SHA1, SourceType: pkcs11.CKZ_DATA_SPECIFIED, SourceData: OAEPLabel, } // OAEPSha256Params describes the OAEP parameters with sha256 hash algorithm OAEPSha256Params = &pkcs11.OAEPParams{ HashAlg: pkcs11.CKM_SHA256, MGF: pkcs11.CKG_MGF1_SHA256, SourceType: pkcs11.CKZ_DATA_SPECIFIED, SourceData: OAEPLabel, } ) // rsaPublicEncryptOAEP encrypts the given plaintext with the given *rsa.PublicKey; the // environment variable OCICRYPT_OAEP_HASHALG can be set to 'sha1' to force usage of sha1 for OAEP (SoftHSM). // This function is needed by clients who are using a public key file for pkcs11 encryption func rsaPublicEncryptOAEP(pubKey *rsa.PublicKey, plaintext []byte) ([]byte, string, error) { var ( hashfunc hash.Hash hashalg string ) oaephash := os.Getenv("OCICRYPT_OAEP_HASHALG") // The default is sha256 (previously was sha1) switch strings.ToLower(oaephash) { case "sha1": hashfunc = sha1.New() hashalg = "sha1" case "sha256", "": hashfunc = sha256.New() hashalg = "sha256" default: return nil, "", fmt.Errorf("Unsupported OAEP hash '%s'", oaephash) } ciphertext, err := rsa.EncryptOAEP(hashfunc, rand.Reader, pubKey, plaintext, OAEPLabel) if err != nil { return nil, "", fmt.Errorf("rss.EncryptOAEP failed: %w", err) } return ciphertext, hashalg, nil } // pkcs11UriGetLoginParameters gets the parameters necessary for login from the Pkcs11URI // PIN and module are mandatory; slot-id is optional and if not found -1 will be returned // For a privateKeyOperation a PIN is required and if none is given, this function will return an error func pkcs11UriGetLoginParameters(p11uri *pkcs11uri.Pkcs11URI, privateKeyOperation bool) (string, string, int64, error) { var ( pin string err error ) if privateKeyOperation { if !p11uri.HasPIN() { return "", "", 0, errors.New("Missing PIN for private key operation") } } // some devices require a PIN to find a *public* key object, others don't pin, _ = p11uri.GetPIN() module, err := p11uri.GetModule() if err != nil { return "", "", 0, fmt.Errorf("No module available in pkcs11 URI: %w", err) } slotid := int64(-1) slot, ok := p11uri.GetPathAttribute("slot-id", false) if ok { slotid, err = strconv.ParseInt(slot, 10, 64) if err != nil { return "", "", 0, fmt.Errorf("slot-id is not a valid number: %w", err) } if slotid < 0 { return "", "", 0, fmt.Errorf("slot-id is a negative number") } if uint64(slotid) > 0xffffffff { return "", "", 0, fmt.Errorf("slot-id is larger than 32 bit") } } return pin, module, slotid, nil } // pkcs11UriGetKeyIdAndLabel gets the key label by retrieving the value of the 'object' attribute func pkcs11UriGetKeyIdAndLabel(p11uri *pkcs11uri.Pkcs11URI) (string, string, error) { keyid, ok2 := p11uri.GetPathAttribute("id", false) label, ok1 := p11uri.GetPathAttribute("object", false) if !ok1 && !ok2 { return "", "", errors.New("Neither 'id' nor 'object' attributes were found in pkcs11 URI") } return keyid, label, nil } // pkcs11OpenSession opens a session with a pkcs11 device at the given slot and logs in with the given PIN func pkcs11OpenSession(p11ctx *pkcs11.Ctx, slotid uint, pin string) (session pkcs11.SessionHandle, err error) { session, err = p11ctx.OpenSession(slotid, pkcs11.CKF_SERIAL_SESSION|pkcs11.CKF_RW_SESSION) if err != nil { return 0, fmt.Errorf("OpenSession to slot %d failed: %w", slotid, err) } if len(pin) > 0 { err = p11ctx.Login(session, pkcs11.CKU_USER, pin) if err != nil { _ = p11ctx.CloseSession(session) return 0, fmt.Errorf("Could not login to device: %w", err) } } return session, nil } // pkcs11UriLogin uses the given pkcs11 URI to select the pkcs11 module (shared library) and to get // the PIN to use for login; if the URI contains a slot-id, the given slot-id will be used, otherwise // one slot after the other will be attempted and the first one where login succeeds will be used func pkcs11UriLogin(p11uri *pkcs11uri.Pkcs11URI, privateKeyOperation bool) (ctx *pkcs11.Ctx, session pkcs11.SessionHandle, err error) { pin, module, slotid, err := pkcs11UriGetLoginParameters(p11uri, privateKeyOperation) if err != nil { return nil, 0, err } p11ctx := pkcs11.New(module) if p11ctx == nil { return nil, 0, errors.New("Please check module path, input is: " + module) } err = p11ctx.Initialize() if err != nil { p11Err := err.(pkcs11.Error) if p11Err != pkcs11.CKR_CRYPTOKI_ALREADY_INITIALIZED { return nil, 0, fmt.Errorf("Initialize failed: %w", err) } } if slotid >= 0 { session, err := pkcs11OpenSession(p11ctx, uint(slotid), pin) return p11ctx, session, err } slots, err := p11ctx.GetSlotList(true) if err != nil { return nil, 0, fmt.Errorf("GetSlotList failed: %w", err) } tokenlabel, ok := p11uri.GetPathAttribute("token", false) if !ok { return nil, 0, errors.New("Missing 'token' attribute since 'slot-id' was not given") } for _, slot := range slots { ti, err := p11ctx.GetTokenInfo(slot) if err != nil || ti.Label != tokenlabel { continue } session, err = pkcs11OpenSession(p11ctx, slot, pin) if err == nil { return p11ctx, session, err } } if len(pin) > 0 { return nil, 0, errors.New("Could not create session to any slot and/or log in") } return nil, 0, errors.New("Could not create session to any slot") } func pkcs11Logout(ctx *pkcs11.Ctx, session pkcs11.SessionHandle) { _ = ctx.Logout(session) _ = ctx.CloseSession(session) _ = ctx.Finalize() ctx.Destroy() } // findObject finds an object of the given class with the given keyid and/or label func findObject(p11ctx *pkcs11.Ctx, session pkcs11.SessionHandle, class uint, keyid, label string) (pkcs11.ObjectHandle, error) { msg := "" template := []*pkcs11.Attribute{ pkcs11.NewAttribute(pkcs11.CKA_CLASS, class), } if len(label) > 0 { template = append(template, pkcs11.NewAttribute(pkcs11.CKA_LABEL, label)) msg = fmt.Sprintf("label '%s'", label) } if len(keyid) > 0 { template = append(template, pkcs11.NewAttribute(pkcs11.CKA_ID, keyid)) if len(msg) > 0 { msg += " and " } msg += url.PathEscape(keyid) } if err := p11ctx.FindObjectsInit(session, template); err != nil { return 0, fmt.Errorf("FindObjectsInit failed: %w", err) } obj, _, err := p11ctx.FindObjects(session, 100) if err != nil { return 0, fmt.Errorf("FindObjects failed: %w", err) } if err := p11ctx.FindObjectsFinal(session); err != nil { return 0, fmt.Errorf("FindObjectsFinal failed: %w", err) } if len(obj) > 1 { return 0, fmt.Errorf("There are too many (=%d) keys with %s", len(obj), msg) } else if len(obj) == 1 { return obj[0], nil } return 0, fmt.Errorf("Could not find any object with %s", msg) } // publicEncryptOAEP uses a public key described by a pkcs11 URI to OAEP encrypt the given plaintext func publicEncryptOAEP(pubKey *Pkcs11KeyFileObject, plaintext []byte) ([]byte, string, error) { oldenv, err := setEnvVars(pubKey.Uri.GetEnvMap()) if err != nil { return nil, "", err } defer restoreEnv(oldenv) p11ctx, session, err := pkcs11UriLogin(pubKey.Uri, false) if err != nil { return nil, "", err } defer pkcs11Logout(p11ctx, session) keyid, label, err := pkcs11UriGetKeyIdAndLabel(pubKey.Uri) if err != nil { return nil, "", err } p11PubKey, err := findObject(p11ctx, session, pkcs11.CKO_PUBLIC_KEY, keyid, label) if err != nil { return nil, "", err } var hashalg string var oaep *pkcs11.OAEPParams oaephash := os.Getenv("OCICRYPT_OAEP_HASHALG") // The default is sha256 (previously was sha1) switch strings.ToLower(oaephash) { case "sha1": oaep = OAEPSha1Params hashalg = "sha1" case "sha256", "": oaep = OAEPSha256Params hashalg = "sha256" default: return nil, "", fmt.Errorf("Unsupported OAEP hash '%s'", oaephash) } err = p11ctx.EncryptInit(session, []*pkcs11.Mechanism{pkcs11.NewMechanism(pkcs11.CKM_RSA_PKCS_OAEP, oaep)}, p11PubKey) if err != nil { return nil, "", fmt.Errorf("EncryptInit error: %w", err) } ciphertext, err := p11ctx.Encrypt(session, plaintext) if err != nil { return nil, "", fmt.Errorf("Encrypt failed: %w", err) } return ciphertext, hashalg, nil } // privateDecryptOAEP uses a pkcs11 URI describing a private key to OAEP decrypt a ciphertext func privateDecryptOAEP(privKeyObj *Pkcs11KeyFileObject, ciphertext []byte, hashalg string) ([]byte, error) { oldenv, err := setEnvVars(privKeyObj.Uri.GetEnvMap()) if err != nil { return nil, err } defer restoreEnv(oldenv) p11ctx, session, err := pkcs11UriLogin(privKeyObj.Uri, true) if err != nil { return nil, err } defer pkcs11Logout(p11ctx, session) keyid, label, err := pkcs11UriGetKeyIdAndLabel(privKeyObj.Uri) if err != nil { return nil, err } p11PrivKey, err := findObject(p11ctx, session, pkcs11.CKO_PRIVATE_KEY, keyid, label) if err != nil { return nil, err } var oaep *pkcs11.OAEPParams // An empty string from the Hash in the JSON historically defaults to sha1. switch hashalg { case "sha1", "": oaep = OAEPSha1Params case "sha256": oaep = OAEPSha256Params default: return nil, fmt.Errorf("Unsupported hash algorithm '%s' for decryption", hashalg) } err = p11ctx.DecryptInit(session, []*pkcs11.Mechanism{pkcs11.NewMechanism(pkcs11.CKM_RSA_PKCS_OAEP, oaep)}, p11PrivKey) if err != nil { return nil, fmt.Errorf("DecryptInit failed: %w", err) } plaintext, err := p11ctx.Decrypt(session, ciphertext) if err != nil { return nil, fmt.Errorf("Decrypt failed: %w", err) } return plaintext, err } // // The following part deals with the JSON formatted message for multiple pkcs11 recipients // // Pkcs11Blob holds the encrypted blobs for all recipients; this is what we will put into the image's annotations type Pkcs11Blob struct { Version uint `json:"version"` Recipients []Pkcs11Recipient `json:"recipients"` } // Pkcs11Recipient holds the b64-encoded and encrypted blob for a particular recipient type Pkcs11Recipient struct { Version uint `json:"version"` Blob string `json:"blob"` Hash string `json:"hash,omitempty"` } // EncryptMultiple encrypts for one or multiple pkcs11 devices; the public keys passed to this function // may either be *rsa.PublicKey or *pkcs11uri.Pkcs11URI; the returned byte array is a JSON string of the // following format: // { // recipients: [ // recipient list // { // "version": 0, // "blob": , // "hash": // } , // { // "version": 0, // "blob": , // "hash": // } , // [...] // ] // } func EncryptMultiple(pubKeys []interface{}, data []byte) ([]byte, error) { var ( ciphertext []byte err error pkcs11blob Pkcs11Blob = Pkcs11Blob{Version: 0} hashalg string ) for _, pubKey := range pubKeys { switch pkey := pubKey.(type) { case *rsa.PublicKey: ciphertext, hashalg, err = rsaPublicEncryptOAEP(pkey, data) case *Pkcs11KeyFileObject: ciphertext, hashalg, err = publicEncryptOAEP(pkey, data) default: err = fmt.Errorf("Unsupported key object type for pkcs11 public key") } if err != nil { return nil, err } recipient := Pkcs11Recipient{ Version: 0, Blob: base64.StdEncoding.EncodeToString(ciphertext), Hash: hashalg, } pkcs11blob.Recipients = append(pkcs11blob.Recipients, recipient) } return json.Marshal(&pkcs11blob) } // Decrypt tries to decrypt one of the recipients' blobs using a pkcs11 private key. // The input pkcs11blobstr is a string with the following format: // { // recipients: [ // recipient list // { // "version": 0, // "blob": , // "hash": // } , // { // "version": 0, // "blob": , // "hash": // } , // [...] // } // Note: More recent versions of this code explicitly write 'sha1' // while older versions left it empty in case of 'sha1'. func Decrypt(privKeyObjs []*Pkcs11KeyFileObject, pkcs11blobstr []byte) ([]byte, error) { pkcs11blob := Pkcs11Blob{} err := json.Unmarshal(pkcs11blobstr, &pkcs11blob) if err != nil { return nil, fmt.Errorf("Could not parse Pkcs11Blob: %w", err) } switch pkcs11blob.Version { case 0: // latest supported version default: return nil, fmt.Errorf("found Pkcs11Blob with version %d but maximum supported version is 0", pkcs11blob.Version) } // since we do trial and error, collect all encountered errors errs := "" for _, recipient := range pkcs11blob.Recipients { switch recipient.Version { case 0: // last supported version default: return nil, fmt.Errorf("found Pkcs11Recipient with version %d but maximum supported version is 0", recipient.Version) } ciphertext, err := base64.StdEncoding.DecodeString(recipient.Blob) if err != nil || len(ciphertext) == 0 { // This should never happen... we skip over decoding issues errs += fmt.Sprintf("Base64 decoding failed: %s\n", err) continue } // try all keys until one works for _, privKeyObj := range privKeyObjs { plaintext, err := privateDecryptOAEP(privKeyObj, ciphertext, recipient.Hash) if err == nil { return plaintext, nil } if uri, err2 := privKeyObj.Uri.Format(); err2 == nil { errs += fmt.Sprintf("%s : %s\n", uri, err) } else { errs += fmt.Sprintf("%s\n", err) } } } return nil, fmt.Errorf("Could not find a pkcs11 key for decryption:\n%s", errs) } ================================================ FILE: vendor/github.com/containers/ocicrypt/crypto/pkcs11/pkcs11helpers_nocgo.go ================================================ //go:build !cgo // +build !cgo /* Copyright The ocicrypt Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package pkcs11 import "fmt" func EncryptMultiple(pubKeys []interface{}, data []byte) ([]byte, error) { return nil, fmt.Errorf("ocicrypt pkcs11 not supported on this build") } func Decrypt(privKeyObjs []*Pkcs11KeyFileObject, pkcs11blobstr []byte) ([]byte, error) { return nil, fmt.Errorf("ocicrypt pkcs11 not supported on this build") } ================================================ FILE: vendor/github.com/containers/ocicrypt/crypto/pkcs11/utils.go ================================================ /* Copyright The ocicrypt Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package pkcs11 import ( "fmt" "os" "runtime" "strings" "sync" ) var ( envLock sync.Mutex ) // setEnvVars sets the environment variables given in the map and locks the environment from // modification with the same function; if successful, you *must* call restoreEnv with the return // value from this function func setEnvVars(env map[string]string) ([]string, error) { envLock.Lock() if len(env) == 0 { return nil, nil } oldenv := os.Environ() for k, v := range env { err := os.Setenv(k, v) if err != nil { restoreEnv(oldenv) return nil, fmt.Errorf("Could not set environment variable '%s' to '%s': %w", k, v, err) } } return oldenv, nil } func arrayToMap(elements []string) map[string]string { o := make(map[string]string) for _, element := range elements { p := strings.SplitN(element, "=", 2) if len(p) == 2 { o[p[0]] = p[1] } } return o } // restoreEnv restores the environment to be exactly as given in the array of strings // and unlocks the lock func restoreEnv(envs []string) { if envs != nil && len(envs) >= 0 { target := arrayToMap(envs) curr := arrayToMap(os.Environ()) for nc, vc := range curr { vt, ok := target[nc] if !ok { os.Unsetenv(nc) } else if vc == vt { delete(target, nc) } } for nt, vt := range target { os.Setenv(nt, vt) } } envLock.Unlock() } func getHostAndOsType() (string, string, string) { ht := "" ot := "" st := "" switch runtime.GOOS { case "linux": ot = "linux" st = "gnu" switch runtime.GOARCH { case "arm": ht = "arm" case "arm64": ht = "aarch64" case "amd64": ht = "x86_64" case "ppc64le": ht = "powerpc64le" case "riscv64": ht = "riscv64" case "s390x": ht = "s390x" } } return ht, ot, st } ================================================ FILE: vendor/github.com/containers/ocicrypt/encryption.go ================================================ /* Copyright The ocicrypt Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package ocicrypt import ( "encoding/base64" "encoding/json" "errors" "fmt" "io" "strings" "github.com/containers/ocicrypt/blockcipher" "github.com/containers/ocicrypt/config" keyproviderconfig "github.com/containers/ocicrypt/config/keyprovider-config" "github.com/containers/ocicrypt/keywrap" "github.com/containers/ocicrypt/keywrap/jwe" "github.com/containers/ocicrypt/keywrap/keyprovider" "github.com/containers/ocicrypt/keywrap/pgp" "github.com/containers/ocicrypt/keywrap/pkcs11" "github.com/containers/ocicrypt/keywrap/pkcs7" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" log "github.com/sirupsen/logrus" ) // EncryptLayerFinalizer is a finalizer run to return the annotations to set for // the encrypted layer type EncryptLayerFinalizer func() (map[string]string, error) func init() { keyWrappers = make(map[string]keywrap.KeyWrapper) keyWrapperAnnotations = make(map[string]string) RegisterKeyWrapper("pgp", pgp.NewKeyWrapper()) RegisterKeyWrapper("jwe", jwe.NewKeyWrapper()) RegisterKeyWrapper("pkcs7", pkcs7.NewKeyWrapper()) RegisterKeyWrapper("pkcs11", pkcs11.NewKeyWrapper()) ic, err := keyproviderconfig.GetConfiguration() if err != nil { log.Error(err) } else if ic != nil { for provider, attrs := range ic.KeyProviderConfig { RegisterKeyWrapper("provider."+provider, keyprovider.NewKeyWrapper(provider, attrs)) } } } var keyWrappers map[string]keywrap.KeyWrapper var keyWrapperAnnotations map[string]string // RegisterKeyWrapper allows to register key wrappers by their encryption scheme func RegisterKeyWrapper(scheme string, iface keywrap.KeyWrapper) { keyWrappers[scheme] = iface keyWrapperAnnotations[iface.GetAnnotationID()] = scheme } // GetKeyWrapper looks up the encryptor interface given an encryption scheme (gpg, jwe) func GetKeyWrapper(scheme string) keywrap.KeyWrapper { return keyWrappers[scheme] } // GetWrappedKeysMap returns a map of wrappedKeys as values in a // map with the encryption scheme(s) as the key(s) func GetWrappedKeysMap(desc ocispec.Descriptor) map[string]string { wrappedKeysMap := make(map[string]string) for annotationsID, scheme := range keyWrapperAnnotations { if annotation, ok := desc.Annotations[annotationsID]; ok { wrappedKeysMap[scheme] = annotation } } return wrappedKeysMap } // EncryptLayer encrypts the layer by running one encryptor after the other func EncryptLayer(ec *config.EncryptConfig, encOrPlainLayerReader io.Reader, desc ocispec.Descriptor) (io.Reader, EncryptLayerFinalizer, error) { var ( encLayerReader io.Reader err error encrypted bool bcFin blockcipher.Finalizer privOptsData []byte pubOptsData []byte ) if ec == nil { return nil, nil, errors.New("EncryptConfig must not be nil") } for annotationsID := range keyWrapperAnnotations { annotation := desc.Annotations[annotationsID] if annotation != "" { privOptsData, err = decryptLayerKeyOptsData(&ec.DecryptConfig, desc) if err != nil { return nil, nil, err } pubOptsData, err = getLayerPubOpts(desc) if err != nil { return nil, nil, err } // already encrypted! encrypted = true } } if !encrypted { encLayerReader, bcFin, err = commonEncryptLayer(encOrPlainLayerReader, desc.Digest, blockcipher.AES256CTR) if err != nil { return nil, nil, err } } encLayerFinalizer := func() (map[string]string, error) { // If layer was already encrypted, bcFin should be nil, use existing optsData if bcFin != nil { opts, err := bcFin() if err != nil { return nil, err } privOptsData, err = json.Marshal(opts.Private) if err != nil { return nil, fmt.Errorf("could not JSON marshal opts: %w", err) } pubOptsData, err = json.Marshal(opts.Public) if err != nil { return nil, fmt.Errorf("could not JSON marshal opts: %w", err) } } newAnnotations := make(map[string]string) keysWrapped := false if len(keyWrapperAnnotations) == 0 { return nil, errors.New("missing Annotations needed for decryption") } for annotationsID, scheme := range keyWrapperAnnotations { b64Annotations := desc.Annotations[annotationsID] keywrapper := GetKeyWrapper(scheme) b64Annotations, err = preWrapKeys(keywrapper, ec, b64Annotations, privOptsData) if err != nil { return nil, err } if b64Annotations != "" { keysWrapped = true newAnnotations[annotationsID] = b64Annotations } } if !keysWrapped { return nil, errors.New("no wrapped keys produced by encryption") } newAnnotations["org.opencontainers.image.enc.pubopts"] = base64.StdEncoding.EncodeToString(pubOptsData) if len(newAnnotations) == 0 { return nil, errors.New("no encryptor found to handle encryption") } return newAnnotations, err } // if nothing was encrypted, we just return encLayer = nil return encLayerReader, encLayerFinalizer, err } // preWrapKeys calls WrapKeys and handles the base64 encoding and concatenation of the // annotation data func preWrapKeys(keywrapper keywrap.KeyWrapper, ec *config.EncryptConfig, b64Annotations string, optsData []byte) (string, error) { newAnnotation, err := keywrapper.WrapKeys(ec, optsData) if err != nil || len(newAnnotation) == 0 { return b64Annotations, err } b64newAnnotation := base64.StdEncoding.EncodeToString(newAnnotation) if b64Annotations == "" { return b64newAnnotation, nil } return b64Annotations + "," + b64newAnnotation, nil } // DecryptLayer decrypts a layer trying one keywrap.KeyWrapper after the other to see whether it // can apply the provided private key // If unwrapOnly is set we will only try to decrypt the layer encryption key and return func DecryptLayer(dc *config.DecryptConfig, encLayerReader io.Reader, desc ocispec.Descriptor, unwrapOnly bool) (io.Reader, digest.Digest, error) { if dc == nil { return nil, "", errors.New("DecryptConfig must not be nil") } privOptsData, err := decryptLayerKeyOptsData(dc, desc) if err != nil || unwrapOnly { return nil, "", err } var pubOptsData []byte pubOptsData, err = getLayerPubOpts(desc) if err != nil { return nil, "", err } return commonDecryptLayer(encLayerReader, privOptsData, pubOptsData) } func decryptLayerKeyOptsData(dc *config.DecryptConfig, desc ocispec.Descriptor) ([]byte, error) { privKeyGiven := false errs := "" if len(keyWrapperAnnotations) == 0 { return nil, errors.New("missing Annotations needed for decryption") } for annotationsID, scheme := range keyWrapperAnnotations { b64Annotation := desc.Annotations[annotationsID] if b64Annotation != "" { keywrapper := GetKeyWrapper(scheme) if keywrapper.NoPossibleKeys(dc.Parameters) { continue } if len(keywrapper.GetPrivateKeys(dc.Parameters)) > 0 { privKeyGiven = true } optsData, err := preUnwrapKey(keywrapper, dc, b64Annotation) if err != nil { // try next keywrap.KeyWrapper errs += fmt.Sprintf("%s\n", err) continue } if optsData == nil { // try next keywrap.KeyWrapper continue } return optsData, nil } } if !privKeyGiven { return nil, fmt.Errorf("missing private key needed for decryption:\n%s", errs) } return nil, fmt.Errorf("no suitable key unwrapper found or none of the private keys could be used for decryption:\n%s", errs) } func getLayerPubOpts(desc ocispec.Descriptor) ([]byte, error) { pubOptsString := desc.Annotations["org.opencontainers.image.enc.pubopts"] if pubOptsString == "" { return json.Marshal(blockcipher.PublicLayerBlockCipherOptions{}) } return base64.StdEncoding.DecodeString(pubOptsString) } // preUnwrapKey decodes the comma separated base64 strings and calls the Unwrap function // of the given keywrapper with it and returns the result in case the Unwrap functions // does not return an error. If all attempts fail, an error is returned. func preUnwrapKey(keywrapper keywrap.KeyWrapper, dc *config.DecryptConfig, b64Annotations string) ([]byte, error) { if b64Annotations == "" { return nil, nil } errs := "" for _, b64Annotation := range strings.Split(b64Annotations, ",") { annotation, err := base64.StdEncoding.DecodeString(b64Annotation) if err != nil { return nil, errors.New("could not base64 decode the annotation") } optsData, err := keywrapper.UnwrapKey(dc, annotation) if err != nil { errs += fmt.Sprintf("- %s\n", err) continue } return optsData, nil } return nil, fmt.Errorf("no suitable key found for decrypting layer key:\n%s", errs) } // commonEncryptLayer is a function to encrypt the plain layer using a new random // symmetric key and return the LayerBlockCipherHandler's JSON in string form for // later use during decryption func commonEncryptLayer(plainLayerReader io.Reader, d digest.Digest, typ blockcipher.LayerCipherType) (io.Reader, blockcipher.Finalizer, error) { lbch, err := blockcipher.NewLayerBlockCipherHandler() if err != nil { return nil, nil, err } encLayerReader, bcFin, err := lbch.Encrypt(plainLayerReader, typ) if err != nil { return nil, nil, err } newBcFin := func() (blockcipher.LayerBlockCipherOptions, error) { lbco, err := bcFin() if err != nil { return blockcipher.LayerBlockCipherOptions{}, err } lbco.Private.Digest = d return lbco, nil } return encLayerReader, newBcFin, err } // commonDecryptLayer decrypts an encrypted layer previously encrypted with commonEncryptLayer // by passing along the optsData func commonDecryptLayer(encLayerReader io.Reader, privOptsData []byte, pubOptsData []byte) (io.Reader, digest.Digest, error) { privOpts := blockcipher.PrivateLayerBlockCipherOptions{} err := json.Unmarshal(privOptsData, &privOpts) if err != nil { return nil, "", fmt.Errorf("could not JSON unmarshal privOptsData: %w", err) } lbch, err := blockcipher.NewLayerBlockCipherHandler() if err != nil { return nil, "", err } pubOpts := blockcipher.PublicLayerBlockCipherOptions{} if len(pubOptsData) > 0 { err := json.Unmarshal(pubOptsData, &pubOpts) if err != nil { return nil, "", fmt.Errorf("could not JSON unmarshal pubOptsData: %w", err) } } opts := blockcipher.LayerBlockCipherOptions{ Private: privOpts, Public: pubOpts, } plainLayerReader, opts, err := lbch.Decrypt(encLayerReader, opts) if err != nil { return nil, "", err } return plainLayerReader, opts.Private.Digest, nil } // FilterOutAnnotations filters out the annotations belonging to the image encryption 'namespace' // and returns a map with those taken out func FilterOutAnnotations(annotations map[string]string) map[string]string { a := make(map[string]string) if len(annotations) > 0 { for k, v := range annotations { if strings.HasPrefix(k, "org.opencontainers.image.enc.") { continue } a[k] = v } } return a } ================================================ FILE: vendor/github.com/containers/ocicrypt/gpg.go ================================================ /* Copyright The ocicrypt Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package ocicrypt import ( "errors" "fmt" "io" "os" "os/exec" "regexp" "strconv" "strings" "sync" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "golang.org/x/term" ) // GPGVersion enum representing the GPG client version to use. type GPGVersion int const ( // GPGv2 signifies gpgv2+ GPGv2 GPGVersion = iota // GPGv1 signifies gpgv1+ GPGv1 // GPGVersionUndetermined signifies gpg client version undetermined GPGVersionUndetermined ) // GPGClient defines an interface for wrapping the gpg command line tools type GPGClient interface { // ReadGPGPubRingFile gets the byte sequence of the gpg public keyring ReadGPGPubRingFile() ([]byte, error) // GetGPGPrivateKey gets the private key bytes of a keyid given a passphrase GetGPGPrivateKey(keyid uint64, passphrase string) ([]byte, error) // GetSecretKeyDetails gets the details of a secret key GetSecretKeyDetails(keyid uint64) ([]byte, bool, error) // GetKeyDetails gets the details of a public key GetKeyDetails(keyid uint64) ([]byte, bool, error) // ResolveRecipients resolves PGP key ids to user names ResolveRecipients([]string) []string } // gpgClient contains generic gpg client information type gpgClient struct { gpgHomeDir string } // gpgv2Client is a gpg2 client type gpgv2Client struct { gpgClient } // gpgv1Client is a gpg client type gpgv1Client struct { gpgClient } // GuessGPGVersion guesses the version of gpg. Defaults to gpg2 if exists, if // not defaults to regular gpg. func GuessGPGVersion() GPGVersion { if err := exec.Command("gpg2", "--version").Run(); err == nil { return GPGv2 } else if err := exec.Command("gpg", "--version").Run(); err == nil { return GPGv1 } return GPGVersionUndetermined } // NewGPGClient creates a new GPGClient object representing the given version // and using the given home directory func NewGPGClient(gpgVersion, gpgHomeDir string) (GPGClient, error) { v := new(GPGVersion) switch gpgVersion { case "v1": *v = GPGv1 case "v2": *v = GPGv2 default: v = nil } return newGPGClient(v, gpgHomeDir) } func newGPGClient(version *GPGVersion, homedir string) (GPGClient, error) { var gpgVersion GPGVersion if version != nil { gpgVersion = *version } else { gpgVersion = GuessGPGVersion() } switch gpgVersion { case GPGv1: return &gpgv1Client{ gpgClient: gpgClient{gpgHomeDir: homedir}, }, nil case GPGv2: return &gpgv2Client{ gpgClient: gpgClient{gpgHomeDir: homedir}, }, nil case GPGVersionUndetermined: return nil, fmt.Errorf("unable to determine GPG version") default: return nil, fmt.Errorf("unhandled case: NewGPGClient") } } // GetGPGPrivateKey gets the bytes of a specified keyid, supplying a passphrase func (gc *gpgv2Client) GetGPGPrivateKey(keyid uint64, passphrase string) ([]byte, error) { var args []string if gc.gpgHomeDir != "" { args = append(args, []string{"--homedir", gc.gpgHomeDir}...) } rfile, wfile, err := os.Pipe() if err != nil { return nil, fmt.Errorf("could not create pipe: %w", err) } defer func() { rfile.Close() wfile.Close() }() // fill pipe in background go func(passphrase string) { _, _ = wfile.Write([]byte(passphrase)) wfile.Close() }(passphrase) args = append(args, []string{"--pinentry-mode", "loopback", "--batch", "--passphrase-fd", fmt.Sprintf("%d", 3), "--export-secret-key", fmt.Sprintf("0x%x", keyid)}...) cmd := exec.Command("gpg2", args...) cmd.ExtraFiles = []*os.File{rfile} return runGPGGetOutput(cmd) } // ReadGPGPubRingFile reads the GPG public key ring file func (gc *gpgv2Client) ReadGPGPubRingFile() ([]byte, error) { var args []string if gc.gpgHomeDir != "" { args = append(args, []string{"--homedir", gc.gpgHomeDir}...) } args = append(args, []string{"--batch", "--export"}...) cmd := exec.Command("gpg2", args...) return runGPGGetOutput(cmd) } func (gc *gpgv2Client) getKeyDetails(option string, keyid uint64) ([]byte, bool, error) { var args []string if gc.gpgHomeDir != "" { args = []string{"--homedir", gc.gpgHomeDir} } args = append(args, option, fmt.Sprintf("0x%x", keyid)) cmd := exec.Command("gpg2", args...) keydata, err := runGPGGetOutput(cmd) return keydata, err == nil, err } // GetSecretKeyDetails retrieves the secret key details of key with keyid. // returns a byte array of the details and a bool if the key exists func (gc *gpgv2Client) GetSecretKeyDetails(keyid uint64) ([]byte, bool, error) { return gc.getKeyDetails("-K", keyid) } // GetKeyDetails retrieves the public key details of key with keyid. // returns a byte array of the details and a bool if the key exists func (gc *gpgv2Client) GetKeyDetails(keyid uint64) ([]byte, bool, error) { return gc.getKeyDetails("-k", keyid) } // ResolveRecipients converts PGP keyids to email addresses, if possible func (gc *gpgv2Client) ResolveRecipients(recipients []string) []string { return resolveRecipients(gc, recipients) } // GetGPGPrivateKey gets the bytes of a specified keyid, supplying a passphrase func (gc *gpgv1Client) GetGPGPrivateKey(keyid uint64, _ string) ([]byte, error) { var args []string if gc.gpgHomeDir != "" { args = append(args, []string{"--homedir", gc.gpgHomeDir}...) } args = append(args, []string{"--batch", "--export-secret-key", fmt.Sprintf("0x%x", keyid)}...) cmd := exec.Command("gpg", args...) return runGPGGetOutput(cmd) } // ReadGPGPubRingFile reads the GPG public key ring file func (gc *gpgv1Client) ReadGPGPubRingFile() ([]byte, error) { var args []string if gc.gpgHomeDir != "" { args = append(args, []string{"--homedir", gc.gpgHomeDir}...) } args = append(args, []string{"--batch", "--export"}...) cmd := exec.Command("gpg", args...) return runGPGGetOutput(cmd) } func (gc *gpgv1Client) getKeyDetails(option string, keyid uint64) ([]byte, bool, error) { var args []string if gc.gpgHomeDir != "" { args = []string{"--homedir", gc.gpgHomeDir} } args = append(args, option, fmt.Sprintf("0x%x", keyid)) cmd := exec.Command("gpg", args...) keydata, err := runGPGGetOutput(cmd) return keydata, err == nil, err } // GetSecretKeyDetails retrieves the secret key details of key with keyid. // returns a byte array of the details and a bool if the key exists func (gc *gpgv1Client) GetSecretKeyDetails(keyid uint64) ([]byte, bool, error) { return gc.getKeyDetails("-K", keyid) } // GetKeyDetails retrieves the public key details of key with keyid. // returns a byte array of the details and a bool if the key exists func (gc *gpgv1Client) GetKeyDetails(keyid uint64) ([]byte, bool, error) { return gc.getKeyDetails("-k", keyid) } // ResolveRecipients converts PGP keyids to email addresses, if possible func (gc *gpgv1Client) ResolveRecipients(recipients []string) []string { return resolveRecipients(gc, recipients) } // runGPGGetOutput runs the GPG commandline and returns stdout as byte array // and any stderr in the error func runGPGGetOutput(cmd *exec.Cmd) ([]byte, error) { stdout, err := cmd.StdoutPipe() if err != nil { return nil, err } stderr, err := cmd.StderrPipe() if err != nil { return nil, err } if err := cmd.Start(); err != nil { return nil, err } stdoutstr, err2 := io.ReadAll(stdout) stderrstr, _ := io.ReadAll(stderr) if err := cmd.Wait(); err != nil { return nil, fmt.Errorf("error from %s: %s", cmd.Path, string(stderrstr)) } return stdoutstr, err2 } // resolveRecipients walks the list of recipients and attempts to convert // all keyIds to email addresses; if something goes wrong during the // conversion of a recipient, the original string is returned for that // recpient func resolveRecipients(gc GPGClient, recipients []string) []string { var result []string for _, recipient := range recipients { keyID, err := strconv.ParseUint(recipient, 0, 64) if err != nil { result = append(result, recipient) } else { details, found, _ := gc.GetKeyDetails(keyID) if !found { result = append(result, recipient) } else { email := extractEmailFromDetails(details) if email == "" { result = append(result, recipient) } else { result = append(result, email) } } } } return result } var ( onceRegexp sync.Once emailPattern *regexp.Regexp ) func extractEmailFromDetails(details []byte) string { onceRegexp.Do(func() { emailPattern = regexp.MustCompile(`uid\s+\[.*\]\s.*\s<(?P.+)>`) }) loc := emailPattern.FindSubmatchIndex(details) if len(loc) == 0 { return "" } return string(emailPattern.Expand(nil, []byte("$email"), details, loc)) } // uint64ToStringArray converts an array of uint64's to an array of strings // by applying a format string to each uint64 func uint64ToStringArray(format string, in []uint64) []string { var ret []string for _, v := range in { ret = append(ret, fmt.Sprintf(format, v)) } return ret } // GPGGetPrivateKey walks the list of layerInfos and tries to decrypt the // wrapped symmetric keys. For this it determines whether a private key is // in the GPGVault or on this system and prompts for the passwords for those // that are available. If we do not find a private key on the system for // getting to the symmetric key of a layer then an error is generated. func GPGGetPrivateKey(descs []ocispec.Descriptor, gpgClient GPGClient, gpgVault GPGVault, mustFindKey bool) (gpgPrivKeys [][]byte, gpgPrivKeysPwds [][]byte, err error) { // PrivateKeyData describes a private key type PrivateKeyData struct { KeyData []byte KeyDataPassword []byte } var pkd PrivateKeyData keyIDPasswordMap := make(map[uint64]PrivateKeyData) for _, desc := range descs { for scheme, b64pgpPackets := range GetWrappedKeysMap(desc) { if scheme != "pgp" { continue } keywrapper := GetKeyWrapper(scheme) if keywrapper == nil { return nil, nil, fmt.Errorf("could not get KeyWrapper for %s", scheme) } keyIds, err := keywrapper.GetKeyIdsFromPacket(b64pgpPackets) if err != nil { return nil, nil, err } found := false for _, keyid := range keyIds { // do we have this key? -- first check the vault if gpgVault != nil { _, keydata := gpgVault.GetGPGPrivateKey(keyid) if len(keydata) > 0 { pkd = PrivateKeyData{ KeyData: keydata, KeyDataPassword: nil, // password not supported in this case } keyIDPasswordMap[keyid] = pkd found = true break } } else if gpgClient != nil { // check the local system's gpg installation keyinfo, haveKey, _ := gpgClient.GetSecretKeyDetails(keyid) // this may fail if the key is not here; we ignore the error if !haveKey { // key not on this system continue } _, found = keyIDPasswordMap[keyid] if !found { fmt.Printf("Passphrase required for Key id 0x%x: \n%v", keyid, string(keyinfo)) fmt.Printf("Enter passphrase for key with Id 0x%x: ", keyid) password, err := term.ReadPassword(int(os.Stdin.Fd())) fmt.Printf("\n") if err != nil { return nil, nil, err } keydata, err := gpgClient.GetGPGPrivateKey(keyid, string(password)) if err != nil { return nil, nil, err } pkd = PrivateKeyData{ KeyData: keydata, KeyDataPassword: password, } keyIDPasswordMap[keyid] = pkd found = true } break } else { return nil, nil, errors.New("no GPGVault or GPGClient passed") } } if !found && len(b64pgpPackets) > 0 && mustFindKey { ids := uint64ToStringArray("0x%x", keyIds) return nil, nil, fmt.Errorf("missing key for decryption of layer %x of %s. Need one of the following keys: %s", desc.Digest, desc.Platform, strings.Join(ids, ", ")) } } } for _, pkd := range keyIDPasswordMap { gpgPrivKeys = append(gpgPrivKeys, pkd.KeyData) gpgPrivKeysPwds = append(gpgPrivKeysPwds, pkd.KeyDataPassword) } return gpgPrivKeys, gpgPrivKeysPwds, nil } ================================================ FILE: vendor/github.com/containers/ocicrypt/gpgvault.go ================================================ /* Copyright The ocicrypt Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package ocicrypt import ( "bytes" "fmt" "os" "golang.org/x/crypto/openpgp" "golang.org/x/crypto/openpgp/packet" ) // GPGVault defines an interface for wrapping multiple secret key rings type GPGVault interface { // AddSecretKeyRingData adds a secret keyring via its raw byte array AddSecretKeyRingData(gpgSecretKeyRingData []byte) error // AddSecretKeyRingDataArray adds secret keyring via its raw byte arrays AddSecretKeyRingDataArray(gpgSecretKeyRingDataArray [][]byte) error // AddSecretKeyRingFiles adds secret keyrings given their filenames AddSecretKeyRingFiles(filenames []string) error // GetGPGPrivateKey gets the private key bytes of a keyid given a passphrase GetGPGPrivateKey(keyid uint64) ([]openpgp.Key, []byte) } // gpgVault wraps an array of gpgSecretKeyRing type gpgVault struct { entityLists []openpgp.EntityList keyDataList [][]byte // the raw data original passed in } // NewGPGVault creates an empty GPGVault func NewGPGVault() GPGVault { return &gpgVault{} } // AddSecretKeyRingData adds a secret keyring's to the gpgVault; the raw byte // array read from the file must be passed and will be parsed by this function func (g *gpgVault) AddSecretKeyRingData(gpgSecretKeyRingData []byte) error { // read the private keys r := bytes.NewReader(gpgSecretKeyRingData) entityList, err := openpgp.ReadKeyRing(r) if err != nil { return fmt.Errorf("could not read keyring: %w", err) } g.entityLists = append(g.entityLists, entityList) g.keyDataList = append(g.keyDataList, gpgSecretKeyRingData) return nil } // AddSecretKeyRingDataArray adds secret keyrings to the gpgVault; the raw byte // arrays read from files must be passed func (g *gpgVault) AddSecretKeyRingDataArray(gpgSecretKeyRingDataArray [][]byte) error { for _, gpgSecretKeyRingData := range gpgSecretKeyRingDataArray { if err := g.AddSecretKeyRingData(gpgSecretKeyRingData); err != nil { return err } } return nil } // AddSecretKeyRingFiles adds the secret key rings given their filenames func (g *gpgVault) AddSecretKeyRingFiles(filenames []string) error { for _, filename := range filenames { gpgSecretKeyRingData, err := os.ReadFile(filename) if err != nil { return err } err = g.AddSecretKeyRingData(gpgSecretKeyRingData) if err != nil { return err } } return nil } // GetGPGPrivateKey gets the bytes of a specified keyid, supplying a passphrase func (g *gpgVault) GetGPGPrivateKey(keyid uint64) ([]openpgp.Key, []byte) { for i, el := range g.entityLists { decKeys := el.KeysByIdUsage(keyid, packet.KeyFlagEncryptCommunications) if len(decKeys) > 0 { return decKeys, g.keyDataList[i] } } return nil, nil } ================================================ FILE: vendor/github.com/containers/ocicrypt/helpers/parse_helpers.go ================================================ package helpers import ( "errors" "fmt" "os" "strconv" "strings" "github.com/containers/ocicrypt" encconfig "github.com/containers/ocicrypt/config" "github.com/containers/ocicrypt/config/pkcs11config" "github.com/containers/ocicrypt/crypto/pkcs11" encutils "github.com/containers/ocicrypt/utils" ) // processRecipientKeys sorts the array of recipients by type. Recipients may be either // x509 certificates, public keys, or PGP public keys identified by email address or name func processRecipientKeys(recipients []string) ([][]byte, [][]byte, [][]byte, [][]byte, [][]byte, [][]byte, error) { var ( gpgRecipients [][]byte pubkeys [][]byte x509s [][]byte pkcs11Pubkeys [][]byte pkcs11Yamls [][]byte keyProviders [][]byte ) for _, recipient := range recipients { idx := strings.Index(recipient, ":") if idx < 0 { return nil, nil, nil, nil, nil, nil, errors.New("Invalid recipient format") } protocol := recipient[:idx] value := recipient[idx+1:] switch protocol { case "pgp": gpgRecipients = append(gpgRecipients, []byte(value)) case "jwe": tmp, err := os.ReadFile(value) if err != nil { return nil, nil, nil, nil, nil, nil, fmt.Errorf("Unable to read file: %w", err) } if !encutils.IsPublicKey(tmp) { return nil, nil, nil, nil, nil, nil, errors.New("File provided is not a public key") } pubkeys = append(pubkeys, tmp) case "pkcs7": tmp, err := os.ReadFile(value) if err != nil { return nil, nil, nil, nil, nil, nil, fmt.Errorf("Unable to read file: %w", err) } if !encutils.IsCertificate(tmp) { return nil, nil, nil, nil, nil, nil, errors.New("File provided is not an x509 cert") } x509s = append(x509s, tmp) case "pkcs11": tmp, err := os.ReadFile(value) if err != nil { return nil, nil, nil, nil, nil, nil, fmt.Errorf("Unable to read file: %w", err) } if encutils.IsPkcs11PublicKey(tmp) { pkcs11Yamls = append(pkcs11Yamls, tmp) } else if encutils.IsPublicKey(tmp) { pkcs11Pubkeys = append(pkcs11Pubkeys, tmp) } else { return nil, nil, nil, nil, nil, nil, errors.New("Provided file is not a public key") } case "provider": keyProviders = append(keyProviders, []byte(value)) default: return nil, nil, nil, nil, nil, nil, errors.New("Provided protocol not recognized") } } return gpgRecipients, pubkeys, x509s, pkcs11Pubkeys, pkcs11Yamls, keyProviders, nil } // processx509Certs processes x509 certificate files func processx509Certs(keys []string) ([][]byte, error) { var x509s [][]byte for _, key := range keys { fileName := strings.Split(key, ":")[0] if _, err := os.Stat(fileName); os.IsNotExist(err) { continue } tmp, err := os.ReadFile(fileName) if err != nil { return nil, fmt.Errorf("Unable to read file: %w", err) } if !encutils.IsCertificate(tmp) { continue } x509s = append(x509s, tmp) } return x509s, nil } // processPwdString process a password that may be in any of the following formats: // - file= // - pass= // - fd= // - func processPwdString(pwdString string) ([]byte, error) { if strings.HasPrefix(pwdString, "file=") { return os.ReadFile(pwdString[5:]) } else if strings.HasPrefix(pwdString, "pass=") { return []byte(pwdString[5:]), nil } else if strings.HasPrefix(pwdString, "fd=") { fdStr := pwdString[3:] fd, err := strconv.Atoi(fdStr) if err != nil { return nil, fmt.Errorf("could not parse file descriptor %s: %w", fdStr, err) } f := os.NewFile(uintptr(fd), "pwdfile") if f == nil { return nil, fmt.Errorf("%s is not a valid file descriptor", fdStr) } defer f.Close() pwd := make([]byte, 64) n, err := f.Read(pwd) if err != nil { return nil, fmt.Errorf("could not read from file descriptor: %w", err) } return pwd[:n], nil } return []byte(pwdString), nil } // processPrivateKeyFiles sorts the different types of private key files; private key files may either be // private keys or GPG private key ring files. The private key files may include the password for the // private key and take any of the following forms: // - // - :file= // - :pass= // - :fd= // - : // - keyprovider:<...> func processPrivateKeyFiles(keyFilesAndPwds []string) ([][]byte, [][]byte, [][]byte, [][]byte, [][]byte, [][]byte, error) { var ( gpgSecretKeyRingFiles [][]byte gpgSecretKeyPasswords [][]byte privkeys [][]byte privkeysPasswords [][]byte pkcs11Yamls [][]byte keyProviders [][]byte err error ) // keys needed for decryption in case of adding a recipient for _, keyfileAndPwd := range keyFilesAndPwds { var password []byte // treat "provider" protocol separately if strings.HasPrefix(keyfileAndPwd, "provider:") { keyProviders = append(keyProviders, []byte(keyfileAndPwd[len("provider:"):])) continue } parts := strings.Split(keyfileAndPwd, ":") if len(parts) == 2 { password, err = processPwdString(parts[1]) if err != nil { return nil, nil, nil, nil, nil, nil, err } } keyfile := parts[0] tmp, err := os.ReadFile(keyfile) if err != nil { return nil, nil, nil, nil, nil, nil, err } isPrivKey, err := encutils.IsPrivateKey(tmp, password) if encutils.IsPasswordError(err) { return nil, nil, nil, nil, nil, nil, err } if encutils.IsPkcs11PrivateKey(tmp) { pkcs11Yamls = append(pkcs11Yamls, tmp) } else if isPrivKey { privkeys = append(privkeys, tmp) privkeysPasswords = append(privkeysPasswords, password) } else if encutils.IsGPGPrivateKeyRing(tmp) { gpgSecretKeyRingFiles = append(gpgSecretKeyRingFiles, tmp) gpgSecretKeyPasswords = append(gpgSecretKeyPasswords, password) } else { // ignore if file is not recognized, so as not to error if additional // metadata/cert files exists continue } } return gpgSecretKeyRingFiles, gpgSecretKeyPasswords, privkeys, privkeysPasswords, pkcs11Yamls, keyProviders, nil } // CreateDecryptCryptoConfig creates the CryptoConfig object that contains the necessary // information to perform decryption from command line options. func CreateDecryptCryptoConfig(keys []string, decRecipients []string) (encconfig.CryptoConfig, error) { ccs := []encconfig.CryptoConfig{} // x509 cert is needed for PKCS7 decryption _, _, x509s, _, _, _, err := processRecipientKeys(decRecipients) if err != nil { return encconfig.CryptoConfig{}, err } // x509 certs can also be passed in via keys x509FromKeys, err := processx509Certs(keys) if err != nil { return encconfig.CryptoConfig{}, err } x509s = append(x509s, x509FromKeys...) gpgSecretKeyRingFiles, gpgSecretKeyPasswords, privKeys, privKeysPasswords, pkcs11Yamls, keyProviders, err := processPrivateKeyFiles(keys) if err != nil { return encconfig.CryptoConfig{}, err } if len(gpgSecretKeyRingFiles) > 0 { gpgCc, err := encconfig.DecryptWithGpgPrivKeys(gpgSecretKeyRingFiles, gpgSecretKeyPasswords) if err != nil { return encconfig.CryptoConfig{}, err } ccs = append(ccs, gpgCc) } /* TODO: Add in GPG client query for secret keys in the future. _, err = createGPGClient(context) gpgInstalled := err == nil if gpgInstalled { if len(gpgSecretKeyRingFiles) == 0 && len(privKeys) == 0 && len(pkcs11Yamls) == 0 && len(keyProviders) == 0 && descs != nil { // Get pgp private keys from keyring only if no private key was passed gpgPrivKeys, gpgPrivKeyPasswords, err := getGPGPrivateKeys(context, gpgSecretKeyRingFiles, descs, true) if err != nil { return encconfig.CryptoConfig{}, err } gpgCc, err := encconfig.DecryptWithGpgPrivKeys(gpgPrivKeys, gpgPrivKeyPasswords) if err != nil { return encconfig.CryptoConfig{}, err } ccs = append(ccs, gpgCc) } else if len(gpgSecretKeyRingFiles) > 0 { gpgCc, err := encconfig.DecryptWithGpgPrivKeys(gpgSecretKeyRingFiles, gpgSecretKeyPasswords) if err != nil { return encconfig.CryptoConfig{}, err } ccs = append(ccs, gpgCc) } } */ if len(x509s) > 0 { x509sCc, err := encconfig.DecryptWithX509s(x509s) if err != nil { return encconfig.CryptoConfig{}, err } ccs = append(ccs, x509sCc) } if len(privKeys) > 0 { privKeysCc, err := encconfig.DecryptWithPrivKeys(privKeys, privKeysPasswords) if err != nil { return encconfig.CryptoConfig{}, err } ccs = append(ccs, privKeysCc) } if len(pkcs11Yamls) > 0 { p11conf, err := pkcs11config.GetUserPkcs11Config() if err != nil { return encconfig.CryptoConfig{}, err } pkcs11PrivKeysCc, err := encconfig.DecryptWithPkcs11Yaml(p11conf, pkcs11Yamls) if err != nil { return encconfig.CryptoConfig{}, err } ccs = append(ccs, pkcs11PrivKeysCc) } if len(keyProviders) > 0 { keyProviderCc, err := encconfig.DecryptWithKeyProvider(keyProviders) if err != nil { return encconfig.CryptoConfig{}, err } ccs = append(ccs, keyProviderCc) } return encconfig.CombineCryptoConfigs(ccs), nil } // CreateCryptoConfig from the list of recipient strings and list of key paths of private keys func CreateCryptoConfig(recipients []string, keys []string) (encconfig.CryptoConfig, error) { var decryptCc *encconfig.CryptoConfig ccs := []encconfig.CryptoConfig{} if len(keys) > 0 { dcc, err := CreateDecryptCryptoConfig(keys, []string{}) if err != nil { return encconfig.CryptoConfig{}, err } decryptCc = &dcc ccs = append(ccs, dcc) } if len(recipients) > 0 { gpgRecipients, pubKeys, x509s, pkcs11Pubkeys, pkcs11Yamls, keyProvider, err := processRecipientKeys(recipients) if err != nil { return encconfig.CryptoConfig{}, err } encryptCcs := []encconfig.CryptoConfig{} // Create GPG client with guessed GPG version and default homedir gpgClient, err := ocicrypt.NewGPGClient("", "") gpgInstalled := err == nil if len(gpgRecipients) > 0 && gpgInstalled { gpgPubRingFile, err := gpgClient.ReadGPGPubRingFile() if err != nil { return encconfig.CryptoConfig{}, err } gpgCc, err := encconfig.EncryptWithGpg(gpgRecipients, gpgPubRingFile) if err != nil { return encconfig.CryptoConfig{}, err } encryptCcs = append(encryptCcs, gpgCc) } // Create Encryption Crypto Config if len(x509s) > 0 { pkcs7Cc, err := encconfig.EncryptWithPkcs7(x509s) if err != nil { return encconfig.CryptoConfig{}, err } encryptCcs = append(encryptCcs, pkcs7Cc) } if len(pubKeys) > 0 { jweCc, err := encconfig.EncryptWithJwe(pubKeys) if err != nil { return encconfig.CryptoConfig{}, err } encryptCcs = append(encryptCcs, jweCc) } var p11conf *pkcs11.Pkcs11Config if len(pkcs11Yamls) > 0 || len(pkcs11Pubkeys) > 0 { p11conf, err = pkcs11config.GetUserPkcs11Config() if err != nil { return encconfig.CryptoConfig{}, err } pkcs11Cc, err := encconfig.EncryptWithPkcs11(p11conf, pkcs11Pubkeys, pkcs11Yamls) if err != nil { return encconfig.CryptoConfig{}, err } encryptCcs = append(encryptCcs, pkcs11Cc) } if len(keyProvider) > 0 { keyProviderCc, err := encconfig.EncryptWithKeyProvider(keyProvider) if err != nil { return encconfig.CryptoConfig{}, err } encryptCcs = append(encryptCcs, keyProviderCc) } ecc := encconfig.CombineCryptoConfigs(encryptCcs) if decryptCc != nil { ecc.EncryptConfig.AttachDecryptConfig(decryptCc.DecryptConfig) } ccs = append(ccs, ecc) } if len(ccs) > 0 { return encconfig.CombineCryptoConfigs(ccs), nil } return encconfig.CryptoConfig{}, nil } ================================================ FILE: vendor/github.com/containers/ocicrypt/keywrap/jwe/keywrapper_jwe.go ================================================ /* Copyright The ocicrypt Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package jwe import ( "crypto/ecdsa" "errors" "fmt" "github.com/containers/ocicrypt/config" "github.com/containers/ocicrypt/keywrap" "github.com/containers/ocicrypt/utils" "github.com/go-jose/go-jose/v4" ) type jweKeyWrapper struct { } func (kw *jweKeyWrapper) GetAnnotationID() string { return "org.opencontainers.image.enc.keys.jwe" } // NewKeyWrapper returns a new key wrapping interface using jwe func NewKeyWrapper() keywrap.KeyWrapper { return &jweKeyWrapper{} } // WrapKeys wraps the session key for recpients and encrypts the optsData, which // describe the symmetric key used for encrypting the layer func (kw *jweKeyWrapper) WrapKeys(ec *config.EncryptConfig, optsData []byte) ([]byte, error) { var joseRecipients []jose.Recipient err := addPubKeys(&joseRecipients, ec.Parameters["pubkeys"]) if err != nil { return nil, err } // no recipients is not an error... if len(joseRecipients) == 0 { return nil, nil } encrypter, err := jose.NewMultiEncrypter(jose.A256GCM, joseRecipients, nil) if err != nil { return nil, fmt.Errorf("jose.NewMultiEncrypter failed: %w", err) } jwe, err := encrypter.Encrypt(optsData) if err != nil { return nil, fmt.Errorf("JWE Encrypt failed: %w", err) } return []byte(jwe.FullSerialize()), nil } func (kw *jweKeyWrapper) UnwrapKey(dc *config.DecryptConfig, jweString []byte) ([]byte, error) { // cf. list of algorithms in func addPubKeys() below keyEncryptionAlgorithms := []jose.KeyAlgorithm{jose.RSA_OAEP, jose.RSA_OAEP_256, jose.ECDH_ES_A128KW, jose.ECDH_ES_A192KW, jose.ECDH_ES_A256KW} // accept all algorithms defined in RFC 7518, section 5.1 contentEncryption := []jose.ContentEncryption{jose.A128CBC_HS256, jose.A192CBC_HS384, jose.A256CBC_HS512, jose.A128GCM, jose.A192GCM, jose.A256GCM} jwe, err := jose.ParseEncrypted(string(jweString), keyEncryptionAlgorithms, contentEncryption) if err != nil { return nil, errors.New("jose.ParseEncrypted failed") } privKeys := kw.GetPrivateKeys(dc.Parameters) if len(privKeys) == 0 { return nil, errors.New("No private keys found for JWE decryption") } privKeysPasswords := kw.getPrivateKeysPasswords(dc.Parameters) if len(privKeysPasswords) != len(privKeys) { return nil, errors.New("Private key password array length must be same as that of private keys") } for idx, privKey := range privKeys { key, err := utils.ParsePrivateKey(privKey, privKeysPasswords[idx], "JWE") if err != nil { return nil, err } _, _, plain, err := jwe.DecryptMulti(key) if err == nil { return plain, nil } } return nil, errors.New("JWE: No suitable private key found for decryption") } func (kw *jweKeyWrapper) NoPossibleKeys(dcparameters map[string][][]byte) bool { return len(kw.GetPrivateKeys(dcparameters)) == 0 } func (kw *jweKeyWrapper) GetPrivateKeys(dcparameters map[string][][]byte) [][]byte { return dcparameters["privkeys"] } func (kw *jweKeyWrapper) getPrivateKeysPasswords(dcparameters map[string][][]byte) [][]byte { return dcparameters["privkeys-passwords"] } func (kw *jweKeyWrapper) GetKeyIdsFromPacket(b64jwes string) ([]uint64, error) { return nil, nil } func (kw *jweKeyWrapper) GetRecipients(b64jwes string) ([]string, error) { return []string{"[jwe]"}, nil } func addPubKeys(joseRecipients *[]jose.Recipient, pubKeys [][]byte) error { if len(pubKeys) == 0 { return nil } for _, pubKey := range pubKeys { key, err := utils.ParsePublicKey(pubKey, "JWE") if err != nil { return err } alg := jose.RSA_OAEP switch key := key.(type) { case *ecdsa.PublicKey: alg = jose.ECDH_ES_A256KW case *jose.JSONWebKey: if key.Algorithm != "" { alg = jose.KeyAlgorithm(key.Algorithm) switch alg { /* accepted algorithms */ case jose.RSA_OAEP: case jose.RSA_OAEP_256: case jose.ECDH_ES_A128KW: case jose.ECDH_ES_A192KW: case jose.ECDH_ES_A256KW: /* all others are rejected */ default: return fmt.Errorf("%s is an unsupported JWE key algorithm", alg) } } } *joseRecipients = append(*joseRecipients, jose.Recipient{ Algorithm: alg, Key: key, }) } return nil } ================================================ FILE: vendor/github.com/containers/ocicrypt/keywrap/keyprovider/keyprovider.go ================================================ /* Copyright The ocicrypt Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package keyprovider import ( "context" "encoding/json" "errors" "fmt" "github.com/containers/ocicrypt/config" keyproviderconfig "github.com/containers/ocicrypt/config/keyprovider-config" "github.com/containers/ocicrypt/keywrap" "github.com/containers/ocicrypt/utils" keyproviderpb "github.com/containers/ocicrypt/utils/keyprovider" log "github.com/sirupsen/logrus" "google.golang.org/grpc" ) type keyProviderKeyWrapper struct { provider string attrs keyproviderconfig.KeyProviderAttrs } func (kw *keyProviderKeyWrapper) GetAnnotationID() string { return "org.opencontainers.image.enc.keys.provider." + kw.provider } // NewKeyWrapper returns a new key wrapping interface using keyprovider func NewKeyWrapper(p string, a keyproviderconfig.KeyProviderAttrs) keywrap.KeyWrapper { return &keyProviderKeyWrapper{provider: p, attrs: a} } type KeyProviderKeyWrapProtocolOperation string var ( OpKeyWrap KeyProviderKeyWrapProtocolOperation = "keywrap" OpKeyUnwrap KeyProviderKeyWrapProtocolOperation = "keyunwrap" ) // KeyProviderKeyWrapProtocolInput defines the input to the key provider binary or grpc method. type KeyProviderKeyWrapProtocolInput struct { // Operation is either "keywrap" or "keyunwrap" Operation KeyProviderKeyWrapProtocolOperation `json:"op"` // KeyWrapParams encodes the arguments to key wrap if operation is set to wrap KeyWrapParams KeyWrapParams `json:"keywrapparams,omitempty"` // KeyUnwrapParams encodes the arguments to key unwrap if operation is set to unwrap KeyUnwrapParams KeyUnwrapParams `json:"keyunwrapparams,omitempty"` } // KeyProviderKeyWrapProtocolOutput defines the output of the key provider binary or grpc method. type KeyProviderKeyWrapProtocolOutput struct { // KeyWrapResult encodes the results to key wrap if operation is to wrap KeyWrapResults KeyWrapResults `json:"keywrapresults,omitempty"` // KeyUnwrapResult encodes the result to key unwrap if operation is to unwrap KeyUnwrapResults KeyUnwrapResults `json:"keyunwrapresults,omitempty"` } type KeyWrapParams struct { Ec *config.EncryptConfig `json:"ec"` OptsData []byte `json:"optsdata"` } type KeyUnwrapParams struct { Dc *config.DecryptConfig `json:"dc"` Annotation []byte `json:"annotation"` } type KeyUnwrapResults struct { OptsData []byte `json:"optsdata"` } type KeyWrapResults struct { Annotation []byte `json:"annotation"` } var runner utils.CommandExecuter func init() { runner = utils.Runner{} } // WrapKeys calls appropriate binary executable/grpc server for wrapping the session key for recipients and gets encrypted optsData, which // describe the symmetric key used for encrypting the layer func (kw *keyProviderKeyWrapper) WrapKeys(ec *config.EncryptConfig, optsData []byte) ([]byte, error) { input, err := json.Marshal(KeyProviderKeyWrapProtocolInput{ Operation: OpKeyWrap, KeyWrapParams: KeyWrapParams{ Ec: ec, OptsData: optsData, }, }) if err != nil { return nil, err } if _, ok := ec.Parameters[kw.provider]; ok { if kw.attrs.Command != nil { protocolOuput, err := getProviderCommandOutput(input, kw.attrs.Command) if err != nil { return nil, fmt.Errorf("error while retrieving keyprovider protocol command output: %w", err) } return protocolOuput.KeyWrapResults.Annotation, nil } else if kw.attrs.Grpc != "" { protocolOuput, err := getProviderGRPCOutput(input, kw.attrs.Grpc, OpKeyWrap) if err != nil { return nil, fmt.Errorf("error while retrieving keyprovider protocol grpc output: %w", err) } return protocolOuput.KeyWrapResults.Annotation, nil } return nil, errors.New("Unsupported keyprovider invocation. Supported invocation methods are grpc and cmd") } return nil, nil } // UnwrapKey calls appropriate binary executable/grpc server for unwrapping the session key based on the protocol given in annotation for recipients and gets decrypted optsData, // which describe the symmetric key used for decrypting the layer func (kw *keyProviderKeyWrapper) UnwrapKey(dc *config.DecryptConfig, jsonString []byte) ([]byte, error) { input, err := json.Marshal(KeyProviderKeyWrapProtocolInput{ Operation: OpKeyUnwrap, KeyUnwrapParams: KeyUnwrapParams{ Dc: dc, Annotation: jsonString, }, }) if err != nil { return nil, err } if kw.attrs.Command != nil { protocolOuput, err := getProviderCommandOutput(input, kw.attrs.Command) if err != nil { // If err is not nil, then ignore it and continue with rest of the given keyproviders return nil, err } return protocolOuput.KeyUnwrapResults.OptsData, nil } else if kw.attrs.Grpc != "" { protocolOuput, err := getProviderGRPCOutput(input, kw.attrs.Grpc, OpKeyUnwrap) if err != nil { // If err is not nil, then ignore it and continue with rest of the given keyproviders return nil, err } return protocolOuput.KeyUnwrapResults.OptsData, nil } return nil, errors.New("Unsupported keyprovider invocation. Supported invocation methods are grpc and cmd") } func getProviderGRPCOutput(input []byte, connString string, operation KeyProviderKeyWrapProtocolOperation) (*KeyProviderKeyWrapProtocolOutput, error) { var protocolOuput KeyProviderKeyWrapProtocolOutput var grpcOutput *keyproviderpb.KeyProviderKeyWrapProtocolOutput cc, err := grpc.Dial(connString, grpc.WithInsecure()) if err != nil { return nil, fmt.Errorf("error while dialing rpc server: %w", err) } defer func() { derr := cc.Close() if derr != nil { log.WithError(derr).Error("Error closing grpc socket") } }() client := keyproviderpb.NewKeyProviderServiceClient(cc) req := &keyproviderpb.KeyProviderKeyWrapProtocolInput{ KeyProviderKeyWrapProtocolInput: input, } if operation == OpKeyWrap { grpcOutput, err = client.WrapKey(context.Background(), req) if err != nil { return nil, fmt.Errorf("Error from grpc method: %w", err) } } else if operation == OpKeyUnwrap { grpcOutput, err = client.UnWrapKey(context.Background(), req) if err != nil { return nil, fmt.Errorf("Error from grpc method: %w", err) } } else { return nil, errors.New("Unsupported operation") } respBytes := grpcOutput.GetKeyProviderKeyWrapProtocolOutput() err = json.Unmarshal(respBytes, &protocolOuput) if err != nil { return nil, fmt.Errorf("Error while unmarshalling grpc method output: %w", err) } return &protocolOuput, nil } func getProviderCommandOutput(input []byte, command *keyproviderconfig.Command) (*KeyProviderKeyWrapProtocolOutput, error) { var protocolOuput KeyProviderKeyWrapProtocolOutput // Convert interface to command structure respBytes, err := runner.Exec(command.Path, command.Args, input) if err != nil { return nil, err } err = json.Unmarshal(respBytes, &protocolOuput) if err != nil { return nil, fmt.Errorf("Error while unmarshalling binary executable command output: %w", err) } return &protocolOuput, nil } // Return false as it is not applicable to keyprovider protocol func (kw *keyProviderKeyWrapper) NoPossibleKeys(dcparameters map[string][][]byte) bool { return false } // Return nil as it is not applicable to keyprovider protocol func (kw *keyProviderKeyWrapper) GetPrivateKeys(dcparameters map[string][][]byte) [][]byte { return nil } // Return nil as it is not applicable to keyprovider protocol func (kw *keyProviderKeyWrapper) GetKeyIdsFromPacket(_ string) ([]uint64, error) { return nil, nil } // Return nil as it is not applicable to keyprovider protocol func (kw *keyProviderKeyWrapper) GetRecipients(_ string) ([]string, error) { return nil, nil } ================================================ FILE: vendor/github.com/containers/ocicrypt/keywrap/keywrap.go ================================================ /* Copyright The ocicrypt Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package keywrap import ( "github.com/containers/ocicrypt/config" ) // KeyWrapper is the interface used for wrapping keys using // a specific encryption technology (pgp, jwe) type KeyWrapper interface { WrapKeys(ec *config.EncryptConfig, optsData []byte) ([]byte, error) UnwrapKey(dc *config.DecryptConfig, annotation []byte) ([]byte, error) GetAnnotationID() string // NoPossibleKeys returns true if there is no possibility of performing // decryption for parameters provided. NoPossibleKeys(dcparameters map[string][][]byte) bool // GetPrivateKeys (optional) gets the array of private keys. It is an optional implementation // as in some key services, a private key may not be exportable (i.e. HSM) // If not implemented, return nil GetPrivateKeys(dcparameters map[string][][]byte) [][]byte // GetKeyIdsFromPacket (optional) gets a list of key IDs. This is optional as some encryption // schemes may not have a notion of key IDs // If not implemented, return the nil slice GetKeyIdsFromPacket(packet string) ([]uint64, error) // GetRecipients (optional) gets a list of recipients. It is optional due to the validity of // recipients in a particular encryptiong scheme // If not implemented, return the nil slice GetRecipients(packet string) ([]string, error) } ================================================ FILE: vendor/github.com/containers/ocicrypt/keywrap/pgp/keywrapper_gpg.go ================================================ /* Copyright The ocicrypt Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package pgp import ( "bytes" "crypto" "crypto/rand" "encoding/base64" "errors" "fmt" "io" "net/mail" "strconv" "strings" "github.com/containers/ocicrypt/config" "github.com/containers/ocicrypt/keywrap" "golang.org/x/crypto/openpgp" "golang.org/x/crypto/openpgp/packet" ) type gpgKeyWrapper struct { } // NewKeyWrapper returns a new key wrapping interface for pgp func NewKeyWrapper() keywrap.KeyWrapper { return &gpgKeyWrapper{} } var ( // GPGDefaultEncryptConfig is the default configuration for layer encryption/decryption GPGDefaultEncryptConfig = &packet.Config{ Rand: rand.Reader, DefaultHash: crypto.SHA256, DefaultCipher: packet.CipherAES256, CompressionConfig: &packet.CompressionConfig{Level: 0}, // No compression RSABits: 2048, } ) func (kw *gpgKeyWrapper) GetAnnotationID() string { return "org.opencontainers.image.enc.keys.pgp" } // WrapKeys wraps the session key for recpients and encrypts the optsData, which // describe the symmetric key used for encrypting the layer func (kw *gpgKeyWrapper) WrapKeys(ec *config.EncryptConfig, optsData []byte) ([]byte, error) { ciphertext := new(bytes.Buffer) el, err := kw.createEntityList(ec) if err != nil { return nil, fmt.Errorf("unable to create entity list: %w", err) } if len(el) == 0 { // nothing to do -- not an error return nil, nil } plaintextWriter, err := openpgp.Encrypt(ciphertext, el, /*EntityList*/ nil, /* Sign*/ nil, /* FileHint */ GPGDefaultEncryptConfig) if err != nil { return nil, err } if _, err = plaintextWriter.Write(optsData); err != nil { return nil, err } else if err = plaintextWriter.Close(); err != nil { return nil, err } return ciphertext.Bytes(), err } // UnwrapKey unwraps the symmetric key with which the layer is encrypted // This symmetric key is encrypted in the PGP payload. func (kw *gpgKeyWrapper) UnwrapKey(dc *config.DecryptConfig, pgpPacket []byte) ([]byte, error) { pgpPrivateKeys, pgpPrivateKeysPwd, err := kw.getKeyParameters(dc.Parameters) if err != nil { return nil, err } for idx, pgpPrivateKey := range pgpPrivateKeys { r := bytes.NewBuffer(pgpPrivateKey) entityList, err := openpgp.ReadKeyRing(r) if err != nil { return nil, fmt.Errorf("unable to parse private keys: %w", err) } var prompt openpgp.PromptFunction if len(pgpPrivateKeysPwd) > idx { responded := false prompt = func(keys []openpgp.Key, symmetric bool) ([]byte, error) { if responded { return nil, fmt.Errorf("don't seem to have the right password") } responded = true for _, key := range keys { if key.PrivateKey != nil { _ = key.PrivateKey.Decrypt(pgpPrivateKeysPwd[idx]) } } return pgpPrivateKeysPwd[idx], nil } } r = bytes.NewBuffer(pgpPacket) md, err := openpgp.ReadMessage(r, entityList, prompt, GPGDefaultEncryptConfig) if err != nil { continue } // we get the plain key options back optsData, err := io.ReadAll(md.UnverifiedBody) if err != nil { continue } return optsData, nil } return nil, errors.New("PGP: No suitable key found to unwrap key") } // GetKeyIdsFromWrappedKeys converts the base64 encoded PGPPacket to uint64 keyIds func (kw *gpgKeyWrapper) GetKeyIdsFromPacket(b64pgpPackets string) ([]uint64, error) { var keyids []uint64 for _, b64pgpPacket := range strings.Split(b64pgpPackets, ",") { pgpPacket, err := base64.StdEncoding.DecodeString(b64pgpPacket) if err != nil { return nil, fmt.Errorf("could not decode base64 encoded PGP packet: %w", err) } newids, err := kw.getKeyIDs(pgpPacket) if err != nil { return nil, err } keyids = append(keyids, newids...) } return keyids, nil } // getKeyIDs parses a PGPPacket and gets the list of recipients' key IDs func (kw *gpgKeyWrapper) getKeyIDs(pgpPacket []byte) ([]uint64, error) { var keyids []uint64 kbuf := bytes.NewBuffer(pgpPacket) packets := packet.NewReader(kbuf) ParsePackets: for { p, err := packets.Next() if err == io.EOF { break ParsePackets } if err != nil { return []uint64{}, fmt.Errorf("packets.Next() failed: %w", err) } switch p := p.(type) { case *packet.EncryptedKey: keyids = append(keyids, p.KeyId) case *packet.SymmetricallyEncrypted: break ParsePackets } } return keyids, nil } // GetRecipients converts the wrappedKeys to an array of recipients func (kw *gpgKeyWrapper) GetRecipients(b64pgpPackets string) ([]string, error) { keyIds, err := kw.GetKeyIdsFromPacket(b64pgpPackets) if err != nil { return nil, err } var array []string for _, keyid := range keyIds { array = append(array, "0x"+strconv.FormatUint(keyid, 16)) } return array, nil } func (kw *gpgKeyWrapper) NoPossibleKeys(dcparameters map[string][][]byte) bool { return len(kw.GetPrivateKeys(dcparameters)) == 0 } func (kw *gpgKeyWrapper) GetPrivateKeys(dcparameters map[string][][]byte) [][]byte { return dcparameters["gpg-privatekeys"] } func (kw *gpgKeyWrapper) getKeyParameters(dcparameters map[string][][]byte) ([][]byte, [][]byte, error) { privKeys := kw.GetPrivateKeys(dcparameters) if len(privKeys) == 0 { return nil, nil, errors.New("GPG: Missing private key parameter") } return privKeys, dcparameters["gpg-privatekeys-passwords"], nil } // createEntityList creates the opengpg EntityList by reading the KeyRing // first and then filtering out recipients' keys func (kw *gpgKeyWrapper) createEntityList(ec *config.EncryptConfig) (openpgp.EntityList, error) { pgpPubringFile := ec.Parameters["gpg-pubkeyringfile"] if len(pgpPubringFile) == 0 { return nil, nil } r := bytes.NewReader(pgpPubringFile[0]) entityList, err := openpgp.ReadKeyRing(r) if err != nil { return nil, err } gpgRecipients := ec.Parameters["gpg-recipients"] if len(gpgRecipients) == 0 { return nil, nil } rSet := make(map[string]int) for _, r := range gpgRecipients { rSet[string(r)] = 0 } var filteredList openpgp.EntityList for _, entity := range entityList { for k := range entity.Identities { addr, err := mail.ParseAddress(k) if err != nil { return nil, err } for _, r := range gpgRecipients { recp := string(r) if strings.Compare(addr.Name, recp) == 0 || strings.Compare(addr.Address, recp) == 0 { filteredList = append(filteredList, entity) rSet[recp] = rSet[recp] + 1 } } } } // make sure we found keys for all the Recipients... var buffer bytes.Buffer notFound := false buffer.WriteString("PGP: No key found for the following recipients: ") for k, v := range rSet { if v == 0 { if notFound { buffer.WriteString(", ") } buffer.WriteString(k) notFound = true } } if notFound { return nil, errors.New(buffer.String()) } return filteredList, nil } ================================================ FILE: vendor/github.com/containers/ocicrypt/keywrap/pkcs11/keywrapper_pkcs11.go ================================================ /* Copyright The ocicrypt Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package pkcs11 import ( "errors" "fmt" "github.com/containers/ocicrypt/config" "github.com/containers/ocicrypt/crypto/pkcs11" "github.com/containers/ocicrypt/keywrap" "github.com/containers/ocicrypt/utils" ) type pkcs11KeyWrapper struct { } func (kw *pkcs11KeyWrapper) GetAnnotationID() string { return "org.opencontainers.image.enc.keys.pkcs11" } // NewKeyWrapper returns a new key wrapping interface using pkcs11 func NewKeyWrapper() keywrap.KeyWrapper { return &pkcs11KeyWrapper{} } // WrapKeys wraps the session key for recpients and encrypts the optsData, which // describe the symmetric key used for encrypting the layer func (kw *pkcs11KeyWrapper) WrapKeys(ec *config.EncryptConfig, optsData []byte) ([]byte, error) { // append({}, ...) allocates a fresh backing array, and that's necessary to guarantee concurrent calls to WrapKeys (as in c/image/copy.Image) // can't race writing to the same backing array. pubKeys := append([][]byte{}, ec.Parameters["pkcs11-pubkeys"]...) // In Go 1.21, slices.Clone(ec.Parameters["pkcs11-pubkeys"]) pubKeys = append(pubKeys, ec.Parameters["pkcs11-yamls"]...) pkcs11Recipients, err := addPubKeys(&ec.DecryptConfig, pubKeys) if err != nil { return nil, err } // no recipients is not an error... if len(pkcs11Recipients) == 0 { return nil, nil } jsonString, err := pkcs11.EncryptMultiple(pkcs11Recipients, optsData) if err != nil { return nil, fmt.Errorf("PKCS11 EncryptMulitple failed: %w", err) } return jsonString, nil } func (kw *pkcs11KeyWrapper) UnwrapKey(dc *config.DecryptConfig, jsonString []byte) ([]byte, error) { var pkcs11PrivKeys []*pkcs11.Pkcs11KeyFileObject privKeys := kw.GetPrivateKeys(dc.Parameters) if len(privKeys) == 0 { return nil, errors.New("No private keys found for PKCS11 decryption") } p11conf, err := p11confFromParameters(dc.Parameters) if err != nil { return nil, err } for _, privKey := range privKeys { key, err := utils.ParsePrivateKey(privKey, nil, "PKCS11") if err != nil { return nil, err } switch pkcs11PrivKey := key.(type) { case *pkcs11.Pkcs11KeyFileObject: if p11conf != nil { pkcs11PrivKey.Uri.SetModuleDirectories(p11conf.ModuleDirectories) pkcs11PrivKey.Uri.SetAllowedModulePaths(p11conf.AllowedModulePaths) } pkcs11PrivKeys = append(pkcs11PrivKeys, pkcs11PrivKey) default: continue } } plaintext, err := pkcs11.Decrypt(pkcs11PrivKeys, jsonString) if err == nil { return plaintext, nil } return nil, fmt.Errorf("PKCS11: No suitable private key found for decryption: %w", err) } func (kw *pkcs11KeyWrapper) NoPossibleKeys(dcparameters map[string][][]byte) bool { return len(kw.GetPrivateKeys(dcparameters)) == 0 } func (kw *pkcs11KeyWrapper) GetPrivateKeys(dcparameters map[string][][]byte) [][]byte { return dcparameters["pkcs11-yamls"] } func (kw *pkcs11KeyWrapper) GetKeyIdsFromPacket(_ string) ([]uint64, error) { return nil, nil } func (kw *pkcs11KeyWrapper) GetRecipients(_ string) ([]string, error) { return []string{"[pkcs11]"}, nil } func addPubKeys(dc *config.DecryptConfig, pubKeys [][]byte) ([]interface{}, error) { var pkcs11Keys []interface{} if len(pubKeys) == 0 { return pkcs11Keys, nil } p11conf, err := p11confFromParameters(dc.Parameters) if err != nil { return nil, err } for _, pubKey := range pubKeys { key, err := utils.ParsePublicKey(pubKey, "PKCS11") if err != nil { return nil, err } switch pkcs11PubKey := key.(type) { case *pkcs11.Pkcs11KeyFileObject: if p11conf != nil { pkcs11PubKey.Uri.SetModuleDirectories(p11conf.ModuleDirectories) pkcs11PubKey.Uri.SetAllowedModulePaths(p11conf.AllowedModulePaths) } } pkcs11Keys = append(pkcs11Keys, key) } return pkcs11Keys, nil } func p11confFromParameters(dcparameters map[string][][]byte) (*pkcs11.Pkcs11Config, error) { if _, ok := dcparameters["pkcs11-config"]; ok { return pkcs11.ParsePkcs11ConfigFile(dcparameters["pkcs11-config"][0]) } return nil, nil } ================================================ FILE: vendor/github.com/containers/ocicrypt/keywrap/pkcs7/keywrapper_pkcs7.go ================================================ /* Copyright The ocicrypt Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package pkcs7 import ( "crypto" "crypto/x509" "errors" "fmt" "github.com/containers/ocicrypt/config" "github.com/containers/ocicrypt/keywrap" "github.com/containers/ocicrypt/utils" "github.com/smallstep/pkcs7" ) type pkcs7KeyWrapper struct { } // NewKeyWrapper returns a new key wrapping interface using jwe func NewKeyWrapper() keywrap.KeyWrapper { return &pkcs7KeyWrapper{} } func (kw *pkcs7KeyWrapper) GetAnnotationID() string { return "org.opencontainers.image.enc.keys.pkcs7" } // WrapKeys wraps the session key for recpients and encrypts the optsData, which // describe the symmetric key used for encrypting the layer func (kw *pkcs7KeyWrapper) WrapKeys(ec *config.EncryptConfig, optsData []byte) ([]byte, error) { x509Certs, err := collectX509s(ec.Parameters["x509s"]) if err != nil { return nil, err } // no recipients is not an error... if len(x509Certs) == 0 { return nil, nil } pkcs7.ContentEncryptionAlgorithm = pkcs7.EncryptionAlgorithmAES128GCM return pkcs7.Encrypt(optsData, x509Certs) } func collectX509s(x509s [][]byte) ([]*x509.Certificate, error) { if len(x509s) == 0 { return nil, nil } var x509Certs []*x509.Certificate for _, x509 := range x509s { x509Cert, err := utils.ParseCertificate(x509, "PKCS7") if err != nil { return nil, err } x509Certs = append(x509Certs, x509Cert) } return x509Certs, nil } func (kw *pkcs7KeyWrapper) NoPossibleKeys(dcparameters map[string][][]byte) bool { return len(kw.GetPrivateKeys(dcparameters)) == 0 } func (kw *pkcs7KeyWrapper) GetPrivateKeys(dcparameters map[string][][]byte) [][]byte { return dcparameters["privkeys"] } func (kw *pkcs7KeyWrapper) getPrivateKeysPasswords(dcparameters map[string][][]byte) [][]byte { return dcparameters["privkeys-passwords"] } // UnwrapKey unwraps the symmetric key with which the layer is encrypted // This symmetric key is encrypted in the PKCS7 payload. func (kw *pkcs7KeyWrapper) UnwrapKey(dc *config.DecryptConfig, pkcs7Packet []byte) ([]byte, error) { privKeys := kw.GetPrivateKeys(dc.Parameters) if len(privKeys) == 0 { return nil, errors.New("no private keys found for PKCS7 decryption") } privKeysPasswords := kw.getPrivateKeysPasswords(dc.Parameters) if len(privKeysPasswords) != len(privKeys) { return nil, errors.New("private key password array length must be same as that of private keys") } x509Certs, err := collectX509s(dc.Parameters["x509s"]) if err != nil { return nil, err } if len(x509Certs) == 0 { return nil, errors.New("no x509 certificates found needed for PKCS7 decryption") } p7, err := pkcs7.Parse(pkcs7Packet) if err != nil { return nil, fmt.Errorf("could not parse PKCS7 packet: %w", err) } for idx, privKey := range privKeys { key, err := utils.ParsePrivateKey(privKey, privKeysPasswords[idx], "PKCS7") if err != nil { return nil, err } for _, x509Cert := range x509Certs { optsData, err := p7.Decrypt(x509Cert, crypto.PrivateKey(key)) if err != nil { continue } return optsData, nil } } return nil, errors.New("PKCS7: No suitable private key found for decryption") } // GetKeyIdsFromWrappedKeys converts the base64 encoded Packet to uint64 keyIds; // We cannot do this with pkcs7 func (kw *pkcs7KeyWrapper) GetKeyIdsFromPacket(b64pkcs7Packets string) ([]uint64, error) { return nil, nil } // GetRecipients converts the wrappedKeys to an array of recipients // We cannot do this with pkcs7 func (kw *pkcs7KeyWrapper) GetRecipients(b64pkcs7Packets string) ([]string, error) { return []string{"[pkcs7]"}, nil } ================================================ FILE: vendor/github.com/containers/ocicrypt/reader.go ================================================ /* Copyright The ocicrypt Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package ocicrypt import ( "io" ) type readerAtReader struct { r io.ReaderAt off int64 } // ReaderFromReaderAt takes an io.ReaderAt and returns an io.Reader func ReaderFromReaderAt(r io.ReaderAt) io.Reader { return &readerAtReader{ r: r, off: 0, } } func (rar *readerAtReader) Read(p []byte) (n int, err error) { n, err = rar.r.ReadAt(p, rar.off) rar.off += int64(n) return n, err } ================================================ FILE: vendor/github.com/containers/ocicrypt/spec/spec.go ================================================ package spec const ( // MediaTypeLayerEnc is MIME type used for encrypted layers. MediaTypeLayerEnc = "application/vnd.oci.image.layer.v1.tar+encrypted" // MediaTypeLayerGzipEnc is MIME type used for encrypted gzip-compressed layers. MediaTypeLayerGzipEnc = "application/vnd.oci.image.layer.v1.tar+gzip+encrypted" // MediaTypeLayerZstdEnc is MIME type used for encrypted zstd-compressed layers. MediaTypeLayerZstdEnc = "application/vnd.oci.image.layer.v1.tar+zstd+encrypted" // MediaTypeLayerNonDistributableEnc is MIME type used for non distributable encrypted layers. MediaTypeLayerNonDistributableEnc = "application/vnd.oci.image.layer.nondistributable.v1.tar+encrypted" // MediaTypeLayerNonDistributableGzipEnc is MIME type used for non distributable encrypted gzip-compressed layers. MediaTypeLayerNonDistributableGzipEnc = "application/vnd.oci.image.layer.nondistributable.v1.tar+gzip+encrypted" // MediaTypeLayerNonDistributableZstdEnc is MIME type used for non distributable encrypted zstd-compressed layers. MediaTypeLayerNonDistributableZstdEnc = "application/vnd.oci.image.layer.nondistributable.v1.tar+zstd+encrypted" // MediaTypeLayerNonDistributableZsdtEnc is MIME type used for non distributable encrypted zstd-compressed layers. // // Deprecated: Use [MediaTypeLayerNonDistributableZstdEnc]. MediaTypeLayerNonDistributableZsdtEnc = MediaTypeLayerNonDistributableZstdEnc ) ================================================ FILE: vendor/github.com/containers/ocicrypt/utils/delayedreader.go ================================================ /* Copyright The ocicrypt Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package utils import ( "io" ) func min(a, b int) int { if a < b { return a } return b } // DelayedReader wraps a io.Reader and allows a client to use the Reader // interface. The DelayedReader holds back some buffer to the client // so that it can report any error that occurred on the Reader it wraps // early to the client while it may still have held some data back. type DelayedReader struct { reader io.Reader // Reader to Read() bytes from and delay them err error // error that occurred on the reader buffer []byte // delay buffer bufbytes int // number of bytes in the delay buffer to give to Read(); on '0' we return 'EOF' to caller bufoff int // offset in the delay buffer to give to Read() } // NewDelayedReader wraps a io.Reader and allocates a delay buffer of bufsize bytes func NewDelayedReader(reader io.Reader, bufsize uint) io.Reader { return &DelayedReader{ reader: reader, buffer: make([]byte, bufsize), } } // Read implements the io.Reader interface func (dr *DelayedReader) Read(p []byte) (int, error) { if dr.err != nil && dr.err != io.EOF { return 0, dr.err } // if we are completely drained, return io.EOF if dr.err == io.EOF && dr.bufbytes == 0 { return 0, io.EOF } // only at the beginning we fill our delay buffer in an extra step if dr.bufbytes < len(dr.buffer) && dr.err == nil { dr.bufbytes, dr.err = FillBuffer(dr.reader, dr.buffer) if dr.err != nil && dr.err != io.EOF { return 0, dr.err } } // dr.err != nil means we have EOF and can drain the delay buffer // otherwise we need to still read from the reader var tmpbuf []byte tmpbufbytes := 0 if dr.err == nil { tmpbuf = make([]byte, len(p)) tmpbufbytes, dr.err = FillBuffer(dr.reader, tmpbuf) if dr.err != nil && dr.err != io.EOF { return 0, dr.err } } // copy out of the delay buffer into 'p' tocopy1 := min(len(p), dr.bufbytes) c1 := copy(p[:tocopy1], dr.buffer[dr.bufoff:]) dr.bufoff += c1 dr.bufbytes -= c1 c2 := 0 // can p still hold more data? if c1 < len(p) { // copy out of the tmpbuf into 'p' c2 = copy(p[tocopy1:], tmpbuf[:tmpbufbytes]) } // if tmpbuf holds data we need to hold onto, copy them // into the delay buffer if tmpbufbytes-c2 > 0 { // left-shift the delay buffer and append the tmpbuf's remaining data dr.buffer = dr.buffer[dr.bufoff : dr.bufoff+dr.bufbytes] dr.buffer = append(dr.buffer, tmpbuf[c2:tmpbufbytes]...) dr.bufoff = 0 dr.bufbytes = len(dr.buffer) } var err error if dr.bufbytes == 0 { err = io.EOF } return c1 + c2, err } ================================================ FILE: vendor/github.com/containers/ocicrypt/utils/ioutils.go ================================================ /* Copyright The ocicrypt Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package utils import ( "bytes" "fmt" "io" "os/exec" ) // FillBuffer fills the given buffer with as many bytes from the reader as possible. It returns // EOF if an EOF was encountered or any other error. func FillBuffer(reader io.Reader, buffer []byte) (int, error) { n, err := io.ReadFull(reader, buffer) if err == io.ErrUnexpectedEOF { return n, io.EOF } return n, err } // first argument is the command, like cat or echo, // the second is the list of args to pass to it type CommandExecuter interface { Exec(string, []string, []byte) ([]byte, error) } type Runner struct{} // ExecuteCommand is used to execute a linux command line command and return the output of the command with an error if it exists. func (r Runner) Exec(cmdName string, args []string, input []byte) ([]byte, error) { var out bytes.Buffer var stderr bytes.Buffer stdInputBuffer := bytes.NewBuffer(input) cmd := exec.Command(cmdName, args...) cmd.Stdin = stdInputBuffer cmd.Stdout = &out cmd.Stderr = &stderr err := cmd.Run() if err != nil { return nil, fmt.Errorf("Error while running command: %s. stderr: %s: %w", cmdName, stderr.String(), err) } return out.Bytes(), nil } ================================================ FILE: vendor/github.com/containers/ocicrypt/utils/keyprovider/keyprovider.pb.go ================================================ // Code generated by protoc-gen-go. DO NOT EDIT. // source: keyprovider.proto package keyprovider import ( context "context" fmt "fmt" proto "github.com/golang/protobuf/proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" math "math" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package type KeyProviderKeyWrapProtocolInput struct { KeyProviderKeyWrapProtocolInput []byte `protobuf:"bytes,1,opt,name=KeyProviderKeyWrapProtocolInput,proto3" json:"KeyProviderKeyWrapProtocolInput,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *KeyProviderKeyWrapProtocolInput) Reset() { *m = KeyProviderKeyWrapProtocolInput{} } func (m *KeyProviderKeyWrapProtocolInput) String() string { return proto.CompactTextString(m) } func (*KeyProviderKeyWrapProtocolInput) ProtoMessage() {} func (*KeyProviderKeyWrapProtocolInput) Descriptor() ([]byte, []int) { return fileDescriptor_da74c8e785ad390c, []int{0} } func (m *KeyProviderKeyWrapProtocolInput) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_KeyProviderKeyWrapProtocolInput.Unmarshal(m, b) } func (m *KeyProviderKeyWrapProtocolInput) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_KeyProviderKeyWrapProtocolInput.Marshal(b, m, deterministic) } func (m *KeyProviderKeyWrapProtocolInput) XXX_Merge(src proto.Message) { xxx_messageInfo_KeyProviderKeyWrapProtocolInput.Merge(m, src) } func (m *KeyProviderKeyWrapProtocolInput) XXX_Size() int { return xxx_messageInfo_KeyProviderKeyWrapProtocolInput.Size(m) } func (m *KeyProviderKeyWrapProtocolInput) XXX_DiscardUnknown() { xxx_messageInfo_KeyProviderKeyWrapProtocolInput.DiscardUnknown(m) } var xxx_messageInfo_KeyProviderKeyWrapProtocolInput proto.InternalMessageInfo func (m *KeyProviderKeyWrapProtocolInput) GetKeyProviderKeyWrapProtocolInput() []byte { if m != nil { return m.KeyProviderKeyWrapProtocolInput } return nil } type KeyProviderKeyWrapProtocolOutput struct { KeyProviderKeyWrapProtocolOutput []byte `protobuf:"bytes,1,opt,name=KeyProviderKeyWrapProtocolOutput,proto3" json:"KeyProviderKeyWrapProtocolOutput,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *KeyProviderKeyWrapProtocolOutput) Reset() { *m = KeyProviderKeyWrapProtocolOutput{} } func (m *KeyProviderKeyWrapProtocolOutput) String() string { return proto.CompactTextString(m) } func (*KeyProviderKeyWrapProtocolOutput) ProtoMessage() {} func (*KeyProviderKeyWrapProtocolOutput) Descriptor() ([]byte, []int) { return fileDescriptor_da74c8e785ad390c, []int{1} } func (m *KeyProviderKeyWrapProtocolOutput) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_KeyProviderKeyWrapProtocolOutput.Unmarshal(m, b) } func (m *KeyProviderKeyWrapProtocolOutput) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_KeyProviderKeyWrapProtocolOutput.Marshal(b, m, deterministic) } func (m *KeyProviderKeyWrapProtocolOutput) XXX_Merge(src proto.Message) { xxx_messageInfo_KeyProviderKeyWrapProtocolOutput.Merge(m, src) } func (m *KeyProviderKeyWrapProtocolOutput) XXX_Size() int { return xxx_messageInfo_KeyProviderKeyWrapProtocolOutput.Size(m) } func (m *KeyProviderKeyWrapProtocolOutput) XXX_DiscardUnknown() { xxx_messageInfo_KeyProviderKeyWrapProtocolOutput.DiscardUnknown(m) } var xxx_messageInfo_KeyProviderKeyWrapProtocolOutput proto.InternalMessageInfo func (m *KeyProviderKeyWrapProtocolOutput) GetKeyProviderKeyWrapProtocolOutput() []byte { if m != nil { return m.KeyProviderKeyWrapProtocolOutput } return nil } func init() { proto.RegisterType((*KeyProviderKeyWrapProtocolInput)(nil), "keyprovider.keyProviderKeyWrapProtocolInput") proto.RegisterType((*KeyProviderKeyWrapProtocolOutput)(nil), "keyprovider.keyProviderKeyWrapProtocolOutput") } func init() { proto.RegisterFile("keyprovider.proto", fileDescriptor_da74c8e785ad390c) } var fileDescriptor_da74c8e785ad390c = []byte{ // 169 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0x12, 0xcc, 0x4e, 0xad, 0x2c, 0x28, 0xca, 0x2f, 0xcb, 0x4c, 0x49, 0x2d, 0xd2, 0x03, 0x32, 0x4a, 0xf2, 0x85, 0xb8, 0x91, 0x84, 0x94, 0xb2, 0xb9, 0xe4, 0x81, 0xdc, 0x00, 0x28, 0xd7, 0x3b, 0xb5, 0x32, 0xbc, 0x28, 0xb1, 0x20, 0x00, 0xa4, 0x2e, 0x39, 0x3f, 0xc7, 0x33, 0xaf, 0xa0, 0xb4, 0x44, 0xc8, 0x83, 0x4b, 0xde, 0x1b, 0xbf, 0x12, 0x09, 0x46, 0x05, 0x46, 0x0d, 0x9e, 0x20, 0x42, 0xca, 0x94, 0xf2, 0xb8, 0x14, 0x70, 0x5b, 0xe6, 0x5f, 0x5a, 0x02, 0xb2, 0xcd, 0x8b, 0x4b, 0xc1, 0x9b, 0x80, 0x1a, 0xa8, 0x75, 0x04, 0xd5, 0x19, 0xbd, 0x62, 0xe4, 0x12, 0x42, 0x52, 0x14, 0x9c, 0x5a, 0x54, 0x96, 0x99, 0x9c, 0x2a, 0x94, 0xc1, 0xc5, 0x0e, 0x52, 0x0c, 0x94, 0x11, 0xd2, 0xd1, 0x43, 0x0e, 0x1f, 0x02, 0x21, 0x21, 0xa5, 0x4b, 0xa4, 0x6a, 0x88, 0xf5, 0x4a, 0x0c, 0x42, 0x59, 0x5c, 0x9c, 0xa1, 0x79, 0xf4, 0xb1, 0xcb, 0x89, 0x37, 0x0a, 0x39, 0x62, 0x93, 0xd8, 0xc0, 0x91, 0x6d, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x9a, 0x10, 0xcb, 0xf9, 0x01, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. var _ context.Context var _ grpc.ClientConnInterface // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. const _ = grpc.SupportPackageIsVersion6 // KeyProviderServiceClient is the client API for KeyProviderService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type KeyProviderServiceClient interface { WrapKey(ctx context.Context, in *KeyProviderKeyWrapProtocolInput, opts ...grpc.CallOption) (*KeyProviderKeyWrapProtocolOutput, error) UnWrapKey(ctx context.Context, in *KeyProviderKeyWrapProtocolInput, opts ...grpc.CallOption) (*KeyProviderKeyWrapProtocolOutput, error) } type keyProviderServiceClient struct { cc grpc.ClientConnInterface } func NewKeyProviderServiceClient(cc grpc.ClientConnInterface) KeyProviderServiceClient { return &keyProviderServiceClient{cc} } func (c *keyProviderServiceClient) WrapKey(ctx context.Context, in *KeyProviderKeyWrapProtocolInput, opts ...grpc.CallOption) (*KeyProviderKeyWrapProtocolOutput, error) { out := new(KeyProviderKeyWrapProtocolOutput) err := c.cc.Invoke(ctx, "/keyprovider.KeyProviderService/WrapKey", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *keyProviderServiceClient) UnWrapKey(ctx context.Context, in *KeyProviderKeyWrapProtocolInput, opts ...grpc.CallOption) (*KeyProviderKeyWrapProtocolOutput, error) { out := new(KeyProviderKeyWrapProtocolOutput) err := c.cc.Invoke(ctx, "/keyprovider.KeyProviderService/UnWrapKey", in, out, opts...) if err != nil { return nil, err } return out, nil } // KeyProviderServiceServer is the server API for KeyProviderService service. type KeyProviderServiceServer interface { WrapKey(context.Context, *KeyProviderKeyWrapProtocolInput) (*KeyProviderKeyWrapProtocolOutput, error) UnWrapKey(context.Context, *KeyProviderKeyWrapProtocolInput) (*KeyProviderKeyWrapProtocolOutput, error) } // UnimplementedKeyProviderServiceServer can be embedded to have forward compatible implementations. type UnimplementedKeyProviderServiceServer struct { } func (*UnimplementedKeyProviderServiceServer) WrapKey(ctx context.Context, req *KeyProviderKeyWrapProtocolInput) (*KeyProviderKeyWrapProtocolOutput, error) { return nil, status.Errorf(codes.Unimplemented, "method WrapKey not implemented") } func (*UnimplementedKeyProviderServiceServer) UnWrapKey(ctx context.Context, req *KeyProviderKeyWrapProtocolInput) (*KeyProviderKeyWrapProtocolOutput, error) { return nil, status.Errorf(codes.Unimplemented, "method UnWrapKey not implemented") } func RegisterKeyProviderServiceServer(s *grpc.Server, srv KeyProviderServiceServer) { s.RegisterService(&_KeyProviderService_serviceDesc, srv) } func _KeyProviderService_WrapKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(KeyProviderKeyWrapProtocolInput) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(KeyProviderServiceServer).WrapKey(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/keyprovider.KeyProviderService/WrapKey", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(KeyProviderServiceServer).WrapKey(ctx, req.(*KeyProviderKeyWrapProtocolInput)) } return interceptor(ctx, in, info, handler) } func _KeyProviderService_UnWrapKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(KeyProviderKeyWrapProtocolInput) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(KeyProviderServiceServer).UnWrapKey(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/keyprovider.KeyProviderService/UnWrapKey", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(KeyProviderServiceServer).UnWrapKey(ctx, req.(*KeyProviderKeyWrapProtocolInput)) } return interceptor(ctx, in, info, handler) } var _KeyProviderService_serviceDesc = grpc.ServiceDesc{ ServiceName: "keyprovider.KeyProviderService", HandlerType: (*KeyProviderServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "WrapKey", Handler: _KeyProviderService_WrapKey_Handler, }, { MethodName: "UnWrapKey", Handler: _KeyProviderService_UnWrapKey_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "keyprovider.proto", } ================================================ FILE: vendor/github.com/containers/ocicrypt/utils/keyprovider/keyprovider.proto ================================================ syntax = "proto3"; package keyprovider; option go_package = "keyprovider"; message keyProviderKeyWrapProtocolInput { bytes KeyProviderKeyWrapProtocolInput = 1; } message keyProviderKeyWrapProtocolOutput { bytes KeyProviderKeyWrapProtocolOutput = 1; } service KeyProviderService { rpc WrapKey(keyProviderKeyWrapProtocolInput) returns (keyProviderKeyWrapProtocolOutput) {}; rpc UnWrapKey(keyProviderKeyWrapProtocolInput) returns (keyProviderKeyWrapProtocolOutput) {}; } ================================================ FILE: vendor/github.com/containers/ocicrypt/utils/testing.go ================================================ /* Copyright The ocicrypt Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package utils import ( "crypto/ecdsa" "crypto/elliptic" "crypto/rand" "crypto/rsa" "crypto/x509" "crypto/x509/pkix" "encoding/pem" "fmt" "math/big" "time" ) // CreateRSAKey creates an RSA key func CreateRSAKey(bits int) (*rsa.PrivateKey, error) { key, err := rsa.GenerateKey(rand.Reader, bits) if err != nil { return nil, fmt.Errorf("rsa.GenerateKey failed: %w", err) } return key, nil } // CreateECDSAKey creates an elliptic curve key for the given curve func CreateECDSAKey(curve elliptic.Curve) (*ecdsa.PrivateKey, error) { key, err := ecdsa.GenerateKey(curve, rand.Reader) if err != nil { return nil, fmt.Errorf("ecdsa.GenerateKey failed: %w", err) } return key, nil } // CreateRSATestKey creates an RSA key of the given size and returns // the public and private key in PEM or DER format func CreateRSATestKey(bits int, password []byte, pemencode bool) ([]byte, []byte, error) { key, err := CreateRSAKey(bits) if err != nil { return nil, nil, err } pubData, err := x509.MarshalPKIXPublicKey(&key.PublicKey) if err != nil { return nil, nil, fmt.Errorf("x509.MarshalPKIXPublicKey failed: %w", err) } privData := x509.MarshalPKCS1PrivateKey(key) // no more encoding needed for DER if !pemencode { return pubData, privData, nil } publicKey := pem.EncodeToMemory(&pem.Block{ Type: "PUBLIC KEY", Bytes: pubData, }) var block *pem.Block typ := "RSA PRIVATE KEY" if len(password) > 0 { block, err = x509.EncryptPEMBlock(rand.Reader, typ, privData, password, x509.PEMCipherAES256) //nolint:staticcheck // ignore SA1019, which is kept for backward compatibility if err != nil { return nil, nil, fmt.Errorf("x509.EncryptPEMBlock failed: %w", err) } } else { block = &pem.Block{ Type: typ, Bytes: privData, } } privateKey := pem.EncodeToMemory(block) return publicKey, privateKey, nil } // CreateECDSATestKey creates and elliptic curve key for the given curve and returns // the public and private key in DER format func CreateECDSATestKey(curve elliptic.Curve) ([]byte, []byte, error) { key, err := CreateECDSAKey(curve) if err != nil { return nil, nil, err } pubData, err := x509.MarshalPKIXPublicKey(&key.PublicKey) if err != nil { return nil, nil, fmt.Errorf("x509.MarshalPKIXPublicKey failed: %w", err) } privData, err := x509.MarshalECPrivateKey(key) if err != nil { return nil, nil, fmt.Errorf("x509.MarshalECPrivateKey failed: %w", err) } return pubData, privData, nil } // CreateTestCA creates a root CA for testing func CreateTestCA() (*rsa.PrivateKey, *x509.Certificate, error) { key, err := rsa.GenerateKey(rand.Reader, 2048) if err != nil { return nil, nil, fmt.Errorf("rsa.GenerateKey failed: %w", err) } ca := &x509.Certificate{ SerialNumber: big.NewInt(1), Subject: pkix.Name{ CommonName: "test-ca", }, NotBefore: time.Now(), NotAfter: time.Now().AddDate(1, 0, 0), IsCA: true, KeyUsage: x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign, BasicConstraintsValid: true, } caCert, err := certifyKey(&key.PublicKey, ca, key, ca) return key, caCert, err } // CertifyKey certifies a public key using the given CA's private key and cert; // The certificate template for the public key is optional func CertifyKey(pubbytes []byte, template *x509.Certificate, caKey *rsa.PrivateKey, caCert *x509.Certificate) (*x509.Certificate, error) { pubKey, err := ParsePublicKey(pubbytes, "CertifyKey") if err != nil { return nil, err } return certifyKey(pubKey, template, caKey, caCert) } func certifyKey(pub interface{}, template *x509.Certificate, caKey *rsa.PrivateKey, caCert *x509.Certificate) (*x509.Certificate, error) { if template == nil { template = &x509.Certificate{ SerialNumber: big.NewInt(1), Subject: pkix.Name{ CommonName: "testkey", }, NotBefore: time.Now(), NotAfter: time.Now().Add(time.Hour), IsCA: false, KeyUsage: x509.KeyUsageDigitalSignature, BasicConstraintsValid: true, } } certDER, err := x509.CreateCertificate(rand.Reader, template, caCert, pub, caKey) if err != nil { return nil, fmt.Errorf("x509.CreateCertificate failed: %w", err) } cert, err := x509.ParseCertificate(certDER) if err != nil { return nil, fmt.Errorf("x509.ParseCertificate failed: %w", err) } return cert, nil } ================================================ FILE: vendor/github.com/containers/ocicrypt/utils/utils.go ================================================ /* Copyright The ocicrypt Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package utils import ( "bytes" "crypto/x509" "encoding/base64" "encoding/pem" "errors" "fmt" "strings" "github.com/containers/ocicrypt/crypto/pkcs11" "github.com/go-jose/go-jose/v4" "golang.org/x/crypto/openpgp" ) // parseJWKPrivateKey parses the input byte array as a JWK and makes sure it's a private key func parseJWKPrivateKey(privKey []byte, prefix string) (interface{}, error) { jwk := jose.JSONWebKey{} err := jwk.UnmarshalJSON(privKey) if err != nil { return nil, fmt.Errorf("%s: Could not parse input as JWK: %w", prefix, err) } if jwk.IsPublic() { return nil, fmt.Errorf("%s: JWK is not a private key", prefix) } return &jwk, nil } // parseJWKPublicKey parses the input byte array as a JWK func parseJWKPublicKey(privKey []byte, prefix string) (interface{}, error) { jwk := jose.JSONWebKey{} err := jwk.UnmarshalJSON(privKey) if err != nil { return nil, fmt.Errorf("%s: Could not parse input as JWK: %w", prefix, err) } if !jwk.IsPublic() { return nil, fmt.Errorf("%s: JWK is not a public key", prefix) } return &jwk, nil } // parsePkcs11PrivateKeyYaml parses the input byte array as pkcs11 key file yaml format) func parsePkcs11PrivateKeyYaml(yaml []byte, prefix string) (*pkcs11.Pkcs11KeyFileObject, error) { // if the URI does not have enough attributes, we will throw an error when decrypting return pkcs11.ParsePkcs11KeyFile(yaml) } // parsePkcs11URIPublicKey parses the input byte array as a pkcs11 key file yaml func parsePkcs11PublicKeyYaml(yaml []byte, prefix string) (*pkcs11.Pkcs11KeyFileObject, error) { // if the URI does not have enough attributes, we will throw an error when decrypting return pkcs11.ParsePkcs11KeyFile(yaml) } // IsPasswordError checks whether an error is related to a missing or wrong // password func IsPasswordError(err error) bool { if err == nil { return false } msg := strings.ToLower(err.Error()) return strings.Contains(msg, "password") && (strings.Contains(msg, "missing") || strings.Contains(msg, "wrong")) } // ParsePrivateKey tries to parse a private key in DER format first and // PEM format after, returning an error if the parsing failed func ParsePrivateKey(privKey, privKeyPassword []byte, prefix string) (interface{}, error) { key, err := x509.ParsePKCS8PrivateKey(privKey) if err != nil { key, err = x509.ParsePKCS1PrivateKey(privKey) if err != nil { key, err = x509.ParseECPrivateKey(privKey) } } if err != nil { block, _ := pem.Decode(privKey) if block != nil { var der []byte if x509.IsEncryptedPEMBlock(block) { //nolint:staticcheck // ignore SA1019, which is kept for backward compatibility if privKeyPassword == nil { return nil, fmt.Errorf("%s: Missing password for encrypted private key", prefix) } der, err = x509.DecryptPEMBlock(block, privKeyPassword) //nolint:staticcheck // ignore SA1019, which is kept for backward compatibility if err != nil { return nil, fmt.Errorf("%s: Wrong password: could not decrypt private key", prefix) } } else { der = block.Bytes } key, err = x509.ParsePKCS8PrivateKey(der) if err != nil { key, err = x509.ParsePKCS1PrivateKey(der) if err != nil { return nil, fmt.Errorf("%s: Could not parse private key: %w", prefix, err) } } } else { key, err = parseJWKPrivateKey(privKey, prefix) if err != nil { key, err = parsePkcs11PrivateKeyYaml(privKey, prefix) } } } return key, err } // IsPrivateKey returns true in case the given byte array represents a private key // It returns an error if for example the password is wrong func IsPrivateKey(data []byte, password []byte) (bool, error) { _, err := ParsePrivateKey(data, password, "") return err == nil, err } // IsPkcs11PrivateKey returns true in case the given byte array represents a pkcs11 private key func IsPkcs11PrivateKey(data []byte) bool { return pkcs11.IsPkcs11PrivateKey(data) } // ParsePublicKey tries to parse a public key in DER format first and // PEM format after, returning an error if the parsing failed func ParsePublicKey(pubKey []byte, prefix string) (interface{}, error) { key, err := x509.ParsePKIXPublicKey(pubKey) if err != nil { block, _ := pem.Decode(pubKey) if block != nil { key, err = x509.ParsePKIXPublicKey(block.Bytes) if err != nil { return nil, fmt.Errorf("%s: Could not parse public key: %w", prefix, err) } } else { key, err = parseJWKPublicKey(pubKey, prefix) if err != nil { key, err = parsePkcs11PublicKeyYaml(pubKey, prefix) } } } return key, err } // IsPublicKey returns true in case the given byte array represents a public key func IsPublicKey(data []byte) bool { _, err := ParsePublicKey(data, "") return err == nil } // IsPkcs11PublicKey returns true in case the given byte array represents a pkcs11 public key func IsPkcs11PublicKey(data []byte) bool { return pkcs11.IsPkcs11PublicKey(data) } // ParseCertificate tries to parse a public key in DER format first and // PEM format after, returning an error if the parsing failed func ParseCertificate(certBytes []byte, prefix string) (*x509.Certificate, error) { x509Cert, err := x509.ParseCertificate(certBytes) if err != nil { block, _ := pem.Decode(certBytes) if block == nil { return nil, fmt.Errorf("%s: Could not PEM decode x509 certificate", prefix) } x509Cert, err = x509.ParseCertificate(block.Bytes) if err != nil { return nil, fmt.Errorf("%s: Could not parse x509 certificate: %w", prefix, err) } } return x509Cert, err } // IsCertificate returns true in case the given byte array represents an x.509 certificate func IsCertificate(data []byte) bool { _, err := ParseCertificate(data, "") return err == nil } // IsGPGPrivateKeyRing returns true in case the given byte array represents a GPG private key ring file func IsGPGPrivateKeyRing(data []byte) bool { r := bytes.NewBuffer(data) _, err := openpgp.ReadKeyRing(r) return err == nil } // SortDecryptionKeys parses a list of comma separated base64 entries and sorts the data into // a map. Each entry in the list may be either a GPG private key ring, private key, or x.509 // certificate func SortDecryptionKeys(b64ItemList string) (map[string][][]byte, error) { dcparameters := make(map[string][][]byte) for _, b64Item := range strings.Split(b64ItemList, ",") { var password []byte b64Data := strings.Split(b64Item, ":") keyData, err := base64.StdEncoding.DecodeString(b64Data[0]) if err != nil { return nil, errors.New("Could not base64 decode a passed decryption key") } if len(b64Data) == 2 { password, err = base64.StdEncoding.DecodeString(b64Data[1]) if err != nil { return nil, errors.New("Could not base64 decode a passed decryption key password") } } var key string isPrivKey, err := IsPrivateKey(keyData, password) if IsPasswordError(err) { return nil, err } if isPrivKey { key = "privkeys" if _, ok := dcparameters["privkeys-passwords"]; !ok { dcparameters["privkeys-passwords"] = [][]byte{password} } else { dcparameters["privkeys-passwords"] = append(dcparameters["privkeys-passwords"], password) } } else if IsCertificate(keyData) { key = "x509s" } else if IsGPGPrivateKeyRing(keyData) { key = "gpg-privatekeys" } if key != "" { values := dcparameters[key] if values == nil { dcparameters[key] = [][]byte{keyData} } else { dcparameters[key] = append(dcparameters[key], keyData) } } else { return nil, errors.New("Unknown decryption key type") } } return dcparameters, nil } ================================================ FILE: vendor/github.com/coreos/go-oidc/v3/LICENSE ================================================ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "{}" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright {yyyy} {name of copyright owner} Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: vendor/github.com/coreos/go-oidc/v3/NOTICE ================================================ CoreOS Project Copyright 2014 CoreOS, Inc This product includes software developed at CoreOS, Inc. (http://www.coreos.com/). ================================================ FILE: vendor/github.com/coreos/go-oidc/v3/oidc/jose.go ================================================ package oidc import jose "github.com/go-jose/go-jose/v4" // JOSE asymmetric signing algorithm values as defined by RFC 7518 // // see: https://tools.ietf.org/html/rfc7518#section-3.1 const ( RS256 = "RS256" // RSASSA-PKCS-v1.5 using SHA-256 RS384 = "RS384" // RSASSA-PKCS-v1.5 using SHA-384 RS512 = "RS512" // RSASSA-PKCS-v1.5 using SHA-512 ES256 = "ES256" // ECDSA using P-256 and SHA-256 ES384 = "ES384" // ECDSA using P-384 and SHA-384 ES512 = "ES512" // ECDSA using P-521 and SHA-512 PS256 = "PS256" // RSASSA-PSS using SHA256 and MGF1-SHA256 PS384 = "PS384" // RSASSA-PSS using SHA384 and MGF1-SHA384 PS512 = "PS512" // RSASSA-PSS using SHA512 and MGF1-SHA512 EdDSA = "EdDSA" // Ed25519 using SHA-512 ) var allAlgs = []jose.SignatureAlgorithm{ jose.RS256, jose.RS384, jose.RS512, jose.ES256, jose.ES384, jose.ES512, jose.PS256, jose.PS384, jose.PS512, jose.EdDSA, } ================================================ FILE: vendor/github.com/coreos/go-oidc/v3/oidc/jwks.go ================================================ package oidc import ( "context" "crypto" "crypto/ecdsa" "crypto/ed25519" "crypto/rsa" "errors" "fmt" "io" "net/http" "sync" jose "github.com/go-jose/go-jose/v4" ) // StaticKeySet is a verifier that validates JWT against a static set of public keys. type StaticKeySet struct { // PublicKeys used to verify the JWT. Supported types are *rsa.PublicKey and // *ecdsa.PublicKey. PublicKeys []crypto.PublicKey } // VerifySignature compares the signature against a static set of public keys. func (s *StaticKeySet) VerifySignature(ctx context.Context, jwt string) ([]byte, error) { // Algorithms are already checked by Verifier, so this parse method accepts // any algorithm. jws, err := jose.ParseSigned(jwt, allAlgs) if err != nil { return nil, fmt.Errorf("parsing jwt: %v", err) } for _, pub := range s.PublicKeys { switch pub.(type) { case *rsa.PublicKey: case *ecdsa.PublicKey: case ed25519.PublicKey: default: return nil, fmt.Errorf("invalid public key type provided: %T", pub) } payload, err := jws.Verify(pub) if err != nil { continue } return payload, nil } return nil, fmt.Errorf("no public keys able to verify jwt") } // NewRemoteKeySet returns a KeySet that can validate JSON web tokens by using HTTP // GETs to fetch JSON web token sets hosted at a remote URL. This is automatically // used by NewProvider using the URLs returned by OpenID Connect discovery, but is // exposed for providers that don't support discovery or to prevent round trips to the // discovery URL. // // The returned KeySet is a long lived verifier that caches keys based on any // keys change. Reuse a common remote key set instead of creating new ones as needed. func NewRemoteKeySet(ctx context.Context, jwksURL string) *RemoteKeySet { return newRemoteKeySet(ctx, jwksURL) } func newRemoteKeySet(ctx context.Context, jwksURL string) *RemoteKeySet { return &RemoteKeySet{ jwksURL: jwksURL, // For historical reasons, this package uses contexts for configuration, not just // cancellation. In hindsight, this was a bad idea. // // Attemps to reason about how cancels should work with background requests have // largely lead to confusion. Use the context here as a config bag-of-values and // ignore the cancel function. ctx: context.WithoutCancel(ctx), } } // RemoteKeySet is a KeySet implementation that validates JSON web tokens against // a jwks_uri endpoint. type RemoteKeySet struct { jwksURL string // Used for configuration. Cancelation is ignored. ctx context.Context // guard all other fields mu sync.RWMutex // inflight suppresses parallel execution of updateKeys and allows // multiple goroutines to wait for its result. inflight *inflight // A set of cached keys. cachedKeys []jose.JSONWebKey } // inflight is used to wait on some in-flight request from multiple goroutines. type inflight struct { doneCh chan struct{} keys []jose.JSONWebKey err error } func newInflight() *inflight { return &inflight{doneCh: make(chan struct{})} } // wait returns a channel that multiple goroutines can receive on. Once it returns // a value, the inflight request is done and result() can be inspected. func (i *inflight) wait() <-chan struct{} { return i.doneCh } // done can only be called by a single goroutine. It records the result of the // inflight request and signals other goroutines that the result is safe to // inspect. func (i *inflight) done(keys []jose.JSONWebKey, err error) { i.keys = keys i.err = err close(i.doneCh) } // result cannot be called until the wait() channel has returned a value. func (i *inflight) result() ([]jose.JSONWebKey, error) { return i.keys, i.err } // paresdJWTKey is a context key that allows common setups to avoid parsing the // JWT twice. It holds a *jose.JSONWebSignature value. var parsedJWTKey contextKey // VerifySignature validates a payload against a signature from the jwks_uri. // // Users MUST NOT call this method directly and should use an IDTokenVerifier // instead. This method skips critical validations such as 'alg' values and is // only exported to implement the KeySet interface. func (r *RemoteKeySet) VerifySignature(ctx context.Context, jwt string) ([]byte, error) { jws, ok := ctx.Value(parsedJWTKey).(*jose.JSONWebSignature) if !ok { // The algorithm values are already enforced by the Validator, which also sets // the context value above to pre-parsed signature. // // Practically, this codepath isn't called in normal use of this package, but // if it is, the algorithms have already been checked. var err error jws, err = jose.ParseSigned(jwt, allAlgs) if err != nil { return nil, fmt.Errorf("oidc: malformed jwt: %v", err) } } return r.verify(ctx, jws) } func (r *RemoteKeySet) verify(ctx context.Context, jws *jose.JSONWebSignature) ([]byte, error) { // We don't support JWTs signed with multiple signatures. keyID := "" for _, sig := range jws.Signatures { keyID = sig.Header.KeyID break } keys := r.keysFromCache() for _, key := range keys { if keyID == "" || key.KeyID == keyID { if payload, err := jws.Verify(&key); err == nil { return payload, nil } } } // If the kid doesn't match, check for new keys from the remote. This is the // strategy recommended by the spec. // // https://openid.net/specs/openid-connect-core-1_0.html#RotateSigKeys keys, err := r.keysFromRemote(ctx) if err != nil { return nil, fmt.Errorf("fetching keys %w", err) } for _, key := range keys { if keyID == "" || key.KeyID == keyID { if payload, err := jws.Verify(&key); err == nil { return payload, nil } } } return nil, errors.New("failed to verify id token signature") } func (r *RemoteKeySet) keysFromCache() (keys []jose.JSONWebKey) { r.mu.RLock() defer r.mu.RUnlock() return r.cachedKeys } // keysFromRemote syncs the key set from the remote set, records the values in the // cache, and returns the key set. func (r *RemoteKeySet) keysFromRemote(ctx context.Context) ([]jose.JSONWebKey, error) { // Need to lock to inspect the inflight request field. r.mu.Lock() // If there's not a current inflight request, create one. if r.inflight == nil { r.inflight = newInflight() // This goroutine has exclusive ownership over the current inflight // request. It releases the resource by nil'ing the inflight field // once the goroutine is done. go func() { // Sync keys and finish inflight when that's done. keys, err := r.updateKeys() r.inflight.done(keys, err) // Lock to update the keys and indicate that there is no longer an // inflight request. r.mu.Lock() defer r.mu.Unlock() if err == nil { r.cachedKeys = keys } // Free inflight so a different request can run. r.inflight = nil }() } inflight := r.inflight r.mu.Unlock() select { case <-ctx.Done(): return nil, ctx.Err() case <-inflight.wait(): return inflight.result() } } func (r *RemoteKeySet) updateKeys() ([]jose.JSONWebKey, error) { req, err := http.NewRequest("GET", r.jwksURL, nil) if err != nil { return nil, fmt.Errorf("oidc: can't create request: %v", err) } resp, err := doRequest(r.ctx, req) if err != nil { return nil, fmt.Errorf("oidc: get keys failed %w", err) } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { return nil, fmt.Errorf("unable to read response body: %v", err) } if resp.StatusCode != http.StatusOK { return nil, fmt.Errorf("oidc: get keys failed: %s %s", resp.Status, body) } var keySet jose.JSONWebKeySet err = unmarshalResp(resp, body, &keySet) if err != nil { return nil, fmt.Errorf("oidc: failed to decode keys: %v %s", err, body) } return keySet.Keys, nil } ================================================ FILE: vendor/github.com/coreos/go-oidc/v3/oidc/oidc.go ================================================ // Package oidc implements OpenID Connect client logic for the golang.org/x/oauth2 package. package oidc import ( "context" "crypto/sha256" "crypto/sha512" "encoding/base64" "encoding/json" "errors" "fmt" "hash" "io" "mime" "net/http" "strings" "sync" "time" "golang.org/x/oauth2" ) const ( // ScopeOpenID is the mandatory scope for all OpenID Connect OAuth2 requests. ScopeOpenID = "openid" // ScopeOfflineAccess is an optional scope defined by OpenID Connect for requesting // OAuth2 refresh tokens. // // Support for this scope differs between OpenID Connect providers. For instance // Google rejects it, favoring appending "access_type=offline" as part of the // authorization request instead. // // See: https://openid.net/specs/openid-connect-core-1_0.html#OfflineAccess ScopeOfflineAccess = "offline_access" ) var ( errNoAtHash = errors.New("id token did not have an access token hash") errInvalidAtHash = errors.New("access token hash does not match value in ID token") ) type contextKey int var issuerURLKey contextKey // ClientContext returns a new Context that carries the provided HTTP client. // // This method sets the same context key used by the golang.org/x/oauth2 package, // so the returned context works for that package too. // // myClient := &http.Client{} // ctx := oidc.ClientContext(parentContext, myClient) // // // This will use the custom client // provider, err := oidc.NewProvider(ctx, "https://accounts.example.com") func ClientContext(ctx context.Context, client *http.Client) context.Context { return context.WithValue(ctx, oauth2.HTTPClient, client) } func getClient(ctx context.Context) *http.Client { if c, ok := ctx.Value(oauth2.HTTPClient).(*http.Client); ok { return c } return nil } // InsecureIssuerURLContext allows discovery to work when the issuer_url reported // by upstream is mismatched with the discovery URL. This is meant for integration // with off-spec providers such as Azure. // // discoveryBaseURL := "https://login.microsoftonline.com/organizations/v2.0" // issuerURL := "https://login.microsoftonline.com/my-tenantid/v2.0" // // ctx := oidc.InsecureIssuerURLContext(parentContext, issuerURL) // // // Provider will be discovered with the discoveryBaseURL, but use issuerURL // // for future issuer validation. // provider, err := oidc.NewProvider(ctx, discoveryBaseURL) // // This is insecure because validating the correct issuer is critical for multi-tenant // providers. Any overrides here MUST be carefully reviewed. func InsecureIssuerURLContext(ctx context.Context, issuerURL string) context.Context { return context.WithValue(ctx, issuerURLKey, issuerURL) } func doRequest(ctx context.Context, req *http.Request) (*http.Response, error) { client := http.DefaultClient if c := getClient(ctx); c != nil { client = c } return client.Do(req.WithContext(ctx)) } // Provider represents an OpenID Connect server's configuration. type Provider struct { issuer string authURL string tokenURL string deviceAuthURL string userInfoURL string jwksURL string algorithms []string // Raw claims returned by the server. rawClaims []byte // Guards all of the following fields. mu sync.Mutex // HTTP client specified from the initial NewProvider request. This is used // when creating the common key set. client *http.Client // A key set that uses context.Background() and is shared between all code paths // that don't have a convinent way of supplying a unique context. commonRemoteKeySet KeySet } func (p *Provider) remoteKeySet() KeySet { p.mu.Lock() defer p.mu.Unlock() if p.commonRemoteKeySet == nil { ctx := context.Background() if p.client != nil { ctx = ClientContext(ctx, p.client) } p.commonRemoteKeySet = NewRemoteKeySet(ctx, p.jwksURL) } return p.commonRemoteKeySet } type providerJSON struct { Issuer string `json:"issuer"` AuthURL string `json:"authorization_endpoint"` TokenURL string `json:"token_endpoint"` DeviceAuthURL string `json:"device_authorization_endpoint"` JWKSURL string `json:"jwks_uri"` UserInfoURL string `json:"userinfo_endpoint"` Algorithms []string `json:"id_token_signing_alg_values_supported"` } // supportedAlgorithms is a list of algorithms explicitly supported by this // package. If a provider supports other algorithms, such as HS256 or none, // those values won't be passed to the IDTokenVerifier. var supportedAlgorithms = map[string]bool{ RS256: true, RS384: true, RS512: true, ES256: true, ES384: true, ES512: true, PS256: true, PS384: true, PS512: true, EdDSA: true, } // ProviderConfig allows direct creation of a [Provider] from metadata // configuration. This is intended for interop with providers that don't support // discovery, or host the JSON discovery document at an off-spec path. // // The ProviderConfig struct specifies JSON struct tags to support document // parsing. // // // Directly fetch the metadata document. // resp, err := http.Get("https://login.example.com/custom-metadata-path") // if err != nil { // // ... // } // defer resp.Body.Close() // // // Parse config from JSON metadata. // config := &oidc.ProviderConfig{} // if err := json.NewDecoder(resp.Body).Decode(config); err != nil { // // ... // } // p := config.NewProvider(context.Background()) // // For providers that implement discovery, use [NewProvider] instead. // // See: https://openid.net/specs/openid-connect-discovery-1_0.html type ProviderConfig struct { // IssuerURL is the identity of the provider, and the string it uses to sign // ID tokens with. For example "https://accounts.google.com". This value MUST // match ID tokens exactly. IssuerURL string `json:"issuer"` // AuthURL is the endpoint used by the provider to support the OAuth 2.0 // authorization endpoint. AuthURL string `json:"authorization_endpoint"` // TokenURL is the endpoint used by the provider to support the OAuth 2.0 // token endpoint. TokenURL string `json:"token_endpoint"` // DeviceAuthURL is the endpoint used by the provider to support the OAuth 2.0 // device authorization endpoint. DeviceAuthURL string `json:"device_authorization_endpoint"` // UserInfoURL is the endpoint used by the provider to support the OpenID // Connect UserInfo flow. // // https://openid.net/specs/openid-connect-core-1_0.html#UserInfo UserInfoURL string `json:"userinfo_endpoint"` // JWKSURL is the endpoint used by the provider to advertise public keys to // verify issued ID tokens. This endpoint is polled as new keys are made // available. JWKSURL string `json:"jwks_uri"` // Algorithms, if provided, indicate a list of JWT algorithms allowed to sign // ID tokens. If not provided, this defaults to the algorithms advertised by // the JWK endpoint, then the set of algorithms supported by this package. Algorithms []string `json:"id_token_signing_alg_values_supported"` } // NewProvider initializes a provider from a set of endpoints, rather than // through discovery. // // The provided context is only used for [http.Client] configuration through // [ClientContext], not cancelation. func (p *ProviderConfig) NewProvider(ctx context.Context) *Provider { return &Provider{ issuer: p.IssuerURL, authURL: p.AuthURL, tokenURL: p.TokenURL, deviceAuthURL: p.DeviceAuthURL, userInfoURL: p.UserInfoURL, jwksURL: p.JWKSURL, algorithms: p.Algorithms, client: getClient(ctx), } } // NewProvider uses the OpenID Connect discovery mechanism to construct a Provider. // The issuer is the URL identifier for the service. For example: "https://accounts.google.com" // or "https://login.salesforce.com". // // OpenID Connect providers that don't implement discovery or host the discovery // document at a non-spec complaint path (such as requiring a URL parameter), // should use [ProviderConfig] instead. // // See: https://openid.net/specs/openid-connect-discovery-1_0.html func NewProvider(ctx context.Context, issuer string) (*Provider, error) { wellKnown := strings.TrimSuffix(issuer, "/") + "/.well-known/openid-configuration" req, err := http.NewRequest("GET", wellKnown, nil) if err != nil { return nil, err } resp, err := doRequest(ctx, req) if err != nil { return nil, err } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { return nil, fmt.Errorf("unable to read response body: %v", err) } if resp.StatusCode != http.StatusOK { return nil, fmt.Errorf("%s: %s", resp.Status, body) } var p providerJSON err = unmarshalResp(resp, body, &p) if err != nil { return nil, fmt.Errorf("oidc: failed to decode provider discovery object: %v", err) } issuerURL, skipIssuerValidation := ctx.Value(issuerURLKey).(string) if !skipIssuerValidation { issuerURL = issuer } if p.Issuer != issuerURL && !skipIssuerValidation { return nil, fmt.Errorf("oidc: issuer URL provided to client (%q) did not match the issuer URL returned by provider (%q)", issuer, p.Issuer) } var algs []string for _, a := range p.Algorithms { if supportedAlgorithms[a] { algs = append(algs, a) } } return &Provider{ issuer: issuerURL, authURL: p.AuthURL, tokenURL: p.TokenURL, deviceAuthURL: p.DeviceAuthURL, userInfoURL: p.UserInfoURL, jwksURL: p.JWKSURL, algorithms: algs, rawClaims: body, client: getClient(ctx), }, nil } // Claims unmarshals raw fields returned by the server during discovery. // // var claims struct { // ScopesSupported []string `json:"scopes_supported"` // ClaimsSupported []string `json:"claims_supported"` // } // // if err := provider.Claims(&claims); err != nil { // // handle unmarshaling error // } // // For a list of fields defined by the OpenID Connect spec see: // https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata func (p *Provider) Claims(v interface{}) error { if p.rawClaims == nil { return errors.New("oidc: claims not set") } return json.Unmarshal(p.rawClaims, v) } // Endpoint returns the OAuth2 auth and token endpoints for the given provider. func (p *Provider) Endpoint() oauth2.Endpoint { return oauth2.Endpoint{AuthURL: p.authURL, DeviceAuthURL: p.deviceAuthURL, TokenURL: p.tokenURL} } // UserInfoEndpoint returns the OpenID Connect userinfo endpoint for the given // provider. func (p *Provider) UserInfoEndpoint() string { return p.userInfoURL } // UserInfo represents the OpenID Connect userinfo claims. type UserInfo struct { Subject string `json:"sub"` Profile string `json:"profile"` Email string `json:"email"` EmailVerified bool `json:"email_verified"` claims []byte } type userInfoRaw struct { Subject string `json:"sub"` Profile string `json:"profile"` Email string `json:"email"` // Handle providers that return email_verified as a string // https://forums.aws.amazon.com/thread.jspa?messageID=949441󧳁 and // https://discuss.elastic.co/t/openid-error-after-authenticating-against-aws-cognito/206018/11 EmailVerified stringAsBool `json:"email_verified"` } // Claims unmarshals the raw JSON object claims into the provided object. func (u *UserInfo) Claims(v interface{}) error { if u.claims == nil { return errors.New("oidc: claims not set") } return json.Unmarshal(u.claims, v) } // UserInfo uses the token source to query the provider's user info endpoint. func (p *Provider) UserInfo(ctx context.Context, tokenSource oauth2.TokenSource) (*UserInfo, error) { if p.userInfoURL == "" { return nil, errors.New("oidc: user info endpoint is not supported by this provider") } req, err := http.NewRequest("GET", p.userInfoURL, nil) if err != nil { return nil, fmt.Errorf("oidc: create GET request: %v", err) } token, err := tokenSource.Token() if err != nil { return nil, fmt.Errorf("oidc: get access token: %v", err) } token.SetAuthHeader(req) resp, err := doRequest(ctx, req) if err != nil { return nil, err } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { return nil, err } if resp.StatusCode != http.StatusOK { return nil, fmt.Errorf("%s: %s", resp.Status, body) } ct := resp.Header.Get("Content-Type") mediaType, _, parseErr := mime.ParseMediaType(ct) if parseErr == nil && mediaType == "application/jwt" { payload, err := p.remoteKeySet().VerifySignature(ctx, string(body)) if err != nil { return nil, fmt.Errorf("oidc: invalid userinfo jwt signature %v", err) } body = payload } var userInfo userInfoRaw if err := json.Unmarshal(body, &userInfo); err != nil { return nil, fmt.Errorf("oidc: failed to decode userinfo: %v", err) } return &UserInfo{ Subject: userInfo.Subject, Profile: userInfo.Profile, Email: userInfo.Email, EmailVerified: bool(userInfo.EmailVerified), claims: body, }, nil } // IDToken is an OpenID Connect extension that provides a predictable representation // of an authorization event. // // The ID Token only holds fields OpenID Connect requires. To access additional // claims returned by the server, use the Claims method. type IDToken struct { // The URL of the server which issued this token. OpenID Connect // requires this value always be identical to the URL used for // initial discovery. // // Note: Because of a known issue with Google Accounts' implementation // this value may differ when using Google. // // See: https://developers.google.com/identity/protocols/OpenIDConnect#obtainuserinfo Issuer string // The client ID, or set of client IDs, that this token is issued for. For // common uses, this is the client that initialized the auth flow. // // This package ensures the audience contains an expected value. Audience []string // A unique string which identifies the end user. Subject string // Expiry of the token. Ths package will not process tokens that have // expired unless that validation is explicitly turned off. Expiry time.Time // When the token was issued by the provider. IssuedAt time.Time // Initial nonce provided during the authentication redirect. // // This package does NOT provided verification on the value of this field // and it's the user's responsibility to ensure it contains a valid value. Nonce string // at_hash claim, if set in the ID token. Callers can verify an access token // that corresponds to the ID token using the VerifyAccessToken method. AccessTokenHash string // signature algorithm used for ID token, needed to compute a verification hash of an // access token sigAlgorithm string // Raw payload of the id_token. claims []byte // Map of distributed claim names to claim sources distributedClaims map[string]claimSource } // Claims unmarshals the raw JSON payload of the ID Token into a provided struct. // // idToken, err := idTokenVerifier.Verify(rawIDToken) // if err != nil { // // handle error // } // var claims struct { // Email string `json:"email"` // EmailVerified bool `json:"email_verified"` // } // if err := idToken.Claims(&claims); err != nil { // // handle error // } func (i *IDToken) Claims(v interface{}) error { if i.claims == nil { return errors.New("oidc: claims not set") } return json.Unmarshal(i.claims, v) } // VerifyAccessToken verifies that the hash of the access token that corresponds to the iD token // matches the hash in the id token. It returns an error if the hashes don't match. // It is the caller's responsibility to ensure that the optional access token hash is present for the ID token // before calling this method. See https://openid.net/specs/openid-connect-core-1_0.html#CodeIDToken func (i *IDToken) VerifyAccessToken(accessToken string) error { if i.AccessTokenHash == "" { return errNoAtHash } var h hash.Hash switch i.sigAlgorithm { case RS256, ES256, PS256: h = sha256.New() case RS384, ES384, PS384: h = sha512.New384() case RS512, ES512, PS512, EdDSA: h = sha512.New() default: return fmt.Errorf("oidc: unsupported signing algorithm %q", i.sigAlgorithm) } h.Write([]byte(accessToken)) // hash documents that Write will never return an error sum := h.Sum(nil)[:h.Size()/2] actual := base64.RawURLEncoding.EncodeToString(sum) if actual != i.AccessTokenHash { return errInvalidAtHash } return nil } type idToken struct { Issuer string `json:"iss"` Subject string `json:"sub"` Audience audience `json:"aud"` Expiry jsonTime `json:"exp"` IssuedAt jsonTime `json:"iat"` NotBefore *jsonTime `json:"nbf"` Nonce string `json:"nonce"` AtHash string `json:"at_hash"` ClaimNames map[string]string `json:"_claim_names"` ClaimSources map[string]claimSource `json:"_claim_sources"` } type claimSource struct { Endpoint string `json:"endpoint"` AccessToken string `json:"access_token"` } type stringAsBool bool func (sb *stringAsBool) UnmarshalJSON(b []byte) error { switch string(b) { case "true", `"true"`: *sb = true case "false", `"false"`: *sb = false default: return errors.New("invalid value for boolean") } return nil } type audience []string func (a *audience) UnmarshalJSON(b []byte) error { var s string if json.Unmarshal(b, &s) == nil { *a = audience{s} return nil } var auds []string if err := json.Unmarshal(b, &auds); err != nil { return err } *a = auds return nil } type jsonTime time.Time func (j *jsonTime) UnmarshalJSON(b []byte) error { var n json.Number if err := json.Unmarshal(b, &n); err != nil { return err } var unix int64 if t, err := n.Int64(); err == nil { unix = t } else { f, err := n.Float64() if err != nil { return err } unix = int64(f) } *j = jsonTime(time.Unix(unix, 0)) return nil } func unmarshalResp(r *http.Response, body []byte, v interface{}) error { err := json.Unmarshal(body, &v) if err == nil { return nil } ct := r.Header.Get("Content-Type") mediaType, _, parseErr := mime.ParseMediaType(ct) if parseErr == nil && mediaType == "application/json" { return fmt.Errorf("got Content-Type = application/json, but could not unmarshal as JSON: %v", err) } return fmt.Errorf("expected Content-Type = application/json, got %q: %v", ct, err) } ================================================ FILE: vendor/github.com/coreos/go-oidc/v3/oidc/verify.go ================================================ package oidc import ( "context" "encoding/json" "fmt" "io" "net/http" "time" jose "github.com/go-jose/go-jose/v4" "golang.org/x/oauth2" ) const ( issuerGoogleAccounts = "https://accounts.google.com" issuerGoogleAccountsNoScheme = "accounts.google.com" ) // TokenExpiredError indicates that Verify failed because the token was expired. This // error does NOT indicate that the token is not also invalid for other reasons. Other // checks might have failed if the expiration check had not failed. type TokenExpiredError struct { // Expiry is the time when the token expired. Expiry time.Time } func (e *TokenExpiredError) Error() string { return fmt.Sprintf("oidc: token is expired (Token Expiry: %v)", e.Expiry) } // KeySet is a set of publc JSON Web Keys that can be used to validate the signature // of JSON web tokens. This is expected to be backed by a remote key set through // provider metadata discovery or an in-memory set of keys delivered out-of-band. type KeySet interface { // VerifySignature parses the JSON web token, verifies the signature, and returns // the raw payload. Header and claim fields are validated by other parts of the // package. For example, the KeySet does not need to check values such as signature // algorithm, issuer, and audience since the IDTokenVerifier validates these values // independently. // // If VerifySignature makes HTTP requests to verify the token, it's expected to // use any HTTP client associated with the context through ClientContext. VerifySignature(ctx context.Context, jwt string) (payload []byte, err error) } // IDTokenVerifier provides verification for ID Tokens. type IDTokenVerifier struct { keySet KeySet config *Config issuer string } // NewVerifier returns a verifier manually constructed from a key set and issuer URL. // // It's easier to use provider discovery to construct an IDTokenVerifier than creating // one directly. This method is intended to be used with provider that don't support // metadata discovery, or avoiding round trips when the key set URL is already known. // // This constructor can be used to create a verifier directly using the issuer URL and // JSON Web Key Set URL without using discovery: // // keySet := oidc.NewRemoteKeySet(ctx, "https://www.googleapis.com/oauth2/v3/certs") // verifier := oidc.NewVerifier("https://accounts.google.com", keySet, config) // // Or a static key set (e.g. for testing): // // keySet := &oidc.StaticKeySet{PublicKeys: []crypto.PublicKey{pub1, pub2}} // verifier := oidc.NewVerifier("https://accounts.google.com", keySet, config) func NewVerifier(issuerURL string, keySet KeySet, config *Config) *IDTokenVerifier { return &IDTokenVerifier{keySet: keySet, config: config, issuer: issuerURL} } // Config is the configuration for an IDTokenVerifier. type Config struct { // Expected audience of the token. For a majority of the cases this is expected to be // the ID of the client that initialized the login flow. It may occasionally differ if // the provider supports the authorizing party (azp) claim. // // If not provided, users must explicitly set SkipClientIDCheck. ClientID string // If specified, only this set of algorithms may be used to sign the JWT. // // If the IDTokenVerifier is created from a provider with (*Provider).Verifier, this // defaults to the set of algorithms the provider supports. Otherwise this values // defaults to RS256. SupportedSigningAlgs []string // If true, no ClientID check performed. Must be true if ClientID field is empty. SkipClientIDCheck bool // If true, token expiry is not checked. SkipExpiryCheck bool // SkipIssuerCheck is intended for specialized cases where the the caller wishes to // defer issuer validation. When enabled, callers MUST independently verify the Token's // Issuer is a known good value. // // Mismatched issuers often indicate client mis-configuration. If mismatches are // unexpected, evaluate if the provided issuer URL is incorrect instead of enabling // this option. SkipIssuerCheck bool // Time function to check Token expiry. Defaults to time.Now Now func() time.Time // InsecureSkipSignatureCheck causes this package to skip JWT signature validation. // It's intended for special cases where providers (such as Azure), use the "none" // algorithm. // // This option can only be enabled safely when the ID Token is received directly // from the provider after the token exchange. // // This option MUST NOT be used when receiving an ID Token from sources other // than the token endpoint. InsecureSkipSignatureCheck bool } // VerifierContext returns an IDTokenVerifier that uses the provider's key set to // verify JWTs. As opposed to Verifier, the context is used to configure requests // to the upstream JWKs endpoint. The provided context's cancellation is ignored. func (p *Provider) VerifierContext(ctx context.Context, config *Config) *IDTokenVerifier { return p.newVerifier(NewRemoteKeySet(ctx, p.jwksURL), config) } // Verifier returns an IDTokenVerifier that uses the provider's key set to verify JWTs. // // The returned verifier uses a background context for all requests to the upstream // JWKs endpoint. To control that context, use VerifierContext instead. func (p *Provider) Verifier(config *Config) *IDTokenVerifier { return p.newVerifier(p.remoteKeySet(), config) } func (p *Provider) newVerifier(keySet KeySet, config *Config) *IDTokenVerifier { if len(config.SupportedSigningAlgs) == 0 && len(p.algorithms) > 0 { // Make a copy so we don't modify the config values. cp := &Config{} *cp = *config cp.SupportedSigningAlgs = p.algorithms config = cp } return NewVerifier(p.issuer, keySet, config) } func contains(sli []string, ele string) bool { for _, s := range sli { if s == ele { return true } } return false } // Returns the Claims from the distributed JWT token func resolveDistributedClaim(ctx context.Context, verifier *IDTokenVerifier, src claimSource) ([]byte, error) { req, err := http.NewRequest("GET", src.Endpoint, nil) if err != nil { return nil, fmt.Errorf("malformed request: %v", err) } if src.AccessToken != "" { req.Header.Set("Authorization", "Bearer "+src.AccessToken) } resp, err := doRequest(ctx, req) if err != nil { return nil, fmt.Errorf("oidc: Request to endpoint failed: %v", err) } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { return nil, fmt.Errorf("unable to read response body: %v", err) } if resp.StatusCode != http.StatusOK { return nil, fmt.Errorf("oidc: request failed: %v", resp.StatusCode) } token, err := verifier.Verify(ctx, string(body)) if err != nil { return nil, fmt.Errorf("malformed response body: %v", err) } return token.claims, nil } // Verify parses a raw ID Token, verifies it's been signed by the provider, performs // any additional checks depending on the Config, and returns the payload. // // Verify does NOT do nonce validation, which is the callers responsibility. // // See: https://openid.net/specs/openid-connect-core-1_0.html#IDTokenValidation // // oauth2Token, err := oauth2Config.Exchange(ctx, r.URL.Query().Get("code")) // if err != nil { // // handle error // } // // // Extract the ID Token from oauth2 token. // rawIDToken, ok := oauth2Token.Extra("id_token").(string) // if !ok { // // handle error // } // // token, err := verifier.Verify(ctx, rawIDToken) func (v *IDTokenVerifier) Verify(ctx context.Context, rawIDToken string) (*IDToken, error) { var supportedSigAlgs []jose.SignatureAlgorithm for _, alg := range v.config.SupportedSigningAlgs { supportedSigAlgs = append(supportedSigAlgs, jose.SignatureAlgorithm(alg)) } if len(supportedSigAlgs) == 0 { // If no algorithms were specified by both the config and discovery, default // to the one mandatory algorithm "RS256". supportedSigAlgs = []jose.SignatureAlgorithm{jose.RS256} } if v.config.InsecureSkipSignatureCheck { // "none" is a required value to even parse a JWT with the "none" algorithm // using go-jose. supportedSigAlgs = append(supportedSigAlgs, "none") } // Parse and verify the signature first. This at least forces the user to have // a valid, signed ID token before we do any other processing. jws, err := jose.ParseSigned(rawIDToken, supportedSigAlgs) if err != nil { return nil, fmt.Errorf("oidc: malformed jwt: %v", err) } switch len(jws.Signatures) { case 0: return nil, fmt.Errorf("oidc: id token not signed") case 1: default: return nil, fmt.Errorf("oidc: multiple signatures on id token not supported") } sig := jws.Signatures[0] var payload []byte if v.config.InsecureSkipSignatureCheck { // Yolo mode. payload = jws.UnsafePayloadWithoutVerification() } else { // The JWT is attached here for the happy path to avoid the verifier from // having to parse the JWT twice. ctx = context.WithValue(ctx, parsedJWTKey, jws) payload, err = v.keySet.VerifySignature(ctx, rawIDToken) if err != nil { return nil, fmt.Errorf("failed to verify signature: %v", err) } } var token idToken if err := json.Unmarshal(payload, &token); err != nil { return nil, fmt.Errorf("oidc: failed to unmarshal claims: %v", err) } distributedClaims := make(map[string]claimSource) //step through the token to map claim names to claim sources" for cn, src := range token.ClaimNames { if src == "" { return nil, fmt.Errorf("oidc: failed to obtain source from claim name") } s, ok := token.ClaimSources[src] if !ok { return nil, fmt.Errorf("oidc: source does not exist") } distributedClaims[cn] = s } t := &IDToken{ Issuer: token.Issuer, Subject: token.Subject, Audience: []string(token.Audience), Expiry: time.Time(token.Expiry), IssuedAt: time.Time(token.IssuedAt), Nonce: token.Nonce, AccessTokenHash: token.AtHash, claims: payload, distributedClaims: distributedClaims, sigAlgorithm: sig.Header.Algorithm, } // Check issuer. if !v.config.SkipIssuerCheck && t.Issuer != v.issuer { // Google sometimes returns "accounts.google.com" as the issuer claim instead of // the required "https://accounts.google.com". Detect this case and allow it only // for Google. // // We will not add hooks to let other providers go off spec like this. if !(v.issuer == issuerGoogleAccounts && t.Issuer == issuerGoogleAccountsNoScheme) { return nil, fmt.Errorf("oidc: id token issued by a different provider, expected %q got %q", v.issuer, t.Issuer) } } // If a client ID has been provided, make sure it's part of the audience. SkipClientIDCheck must be true if ClientID is empty. // // This check DOES NOT ensure that the ClientID is the party to which the ID Token was issued (i.e. Authorized party). if !v.config.SkipClientIDCheck { if v.config.ClientID != "" { if !contains(t.Audience, v.config.ClientID) { return nil, fmt.Errorf("oidc: expected audience %q got %q", v.config.ClientID, t.Audience) } } else { return nil, fmt.Errorf("oidc: invalid configuration, clientID must be provided or SkipClientIDCheck must be set") } } // If a SkipExpiryCheck is false, make sure token is not expired. if !v.config.SkipExpiryCheck { now := time.Now if v.config.Now != nil { now = v.config.Now } nowTime := now() if t.Expiry.Before(nowTime) { return nil, &TokenExpiredError{Expiry: t.Expiry} } // If nbf claim is provided in token, ensure that it is indeed in the past. if token.NotBefore != nil { nbfTime := time.Time(*token.NotBefore) // Set to 5 minutes since this is what other OpenID Connect providers do to deal with clock skew. // https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/blob/6.12.2/src/Microsoft.IdentityModel.Tokens/TokenValidationParameters.cs#L149-L153 leeway := 5 * time.Minute if nowTime.Add(leeway).Before(nbfTime) { return nil, fmt.Errorf("oidc: current time %v before the nbf (not before) time: %v", nowTime, nbfTime) } } } return t, nil } // Nonce returns an auth code option which requires the ID Token created by the // OpenID Connect provider to contain the specified nonce. func Nonce(nonce string) oauth2.AuthCodeOption { return oauth2.SetAuthURLParam("nonce", nonce) } ================================================ FILE: vendor/github.com/cyberphone/json-canonicalization/LICENSE ================================================ Copyright 2018 Anders Rundgren Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: vendor/github.com/cyberphone/json-canonicalization/go/src/webpki.org/jsoncanonicalizer/es6numfmt.go ================================================ // // Copyright 2006-2019 WebPKI.org (http://webpki.org). // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // This package converts numbers in IEEE-754 double precision into the // format specified for JSON in EcmaScript Version 6 and forward. // The core application for this is canonicalization: // https://tools.ietf.org/html/draft-rundgren-json-canonicalization-scheme-02 package jsoncanonicalizer import ( "errors" "math" "strconv" "strings" ) const invalidPattern uint64 = 0x7ff0000000000000 func NumberToJSON(ieeeF64 float64) (res string, err error) { ieeeU64 := math.Float64bits(ieeeF64) // Special case: NaN and Infinity are invalid in JSON if (ieeeU64 & invalidPattern) == invalidPattern { return "null", errors.New("Invalid JSON number: " + strconv.FormatUint(ieeeU64, 16)) } // Special case: eliminate "-0" as mandated by the ES6-JSON/JCS specifications if ieeeF64 == 0 { // Right, this line takes both -0 and 0 return "0", nil } // Deal with the sign separately var sign string = "" if ieeeF64 < 0 { ieeeF64 =-ieeeF64 sign = "-" } // ES6 has a unique "g" format var format byte = 'e' if ieeeF64 < 1e+21 && ieeeF64 >= 1e-6 { format = 'f' } // The following should do the trick: es6Formatted := strconv.FormatFloat(ieeeF64, format, -1, 64) // Minor cleanup exponent := strings.IndexByte(es6Formatted, 'e') if exponent > 0 { // Go outputs "1e+09" which must be rewritten as "1e+9" if es6Formatted[exponent + 2] == '0' { es6Formatted = es6Formatted[:exponent + 2] + es6Formatted[exponent + 3:] } } return sign + es6Formatted, nil } ================================================ FILE: vendor/github.com/cyberphone/json-canonicalization/go/src/webpki.org/jsoncanonicalizer/jsoncanonicalizer.go ================================================ // // Copyright 2006-2019 WebPKI.org (http://webpki.org). // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // This package transforms JSON data in UTF-8 according to: // https://tools.ietf.org/html/draft-rundgren-json-canonicalization-scheme-02 package jsoncanonicalizer import ( "errors" "container/list" "fmt" "strconv" "strings" "unicode/utf16" ) type nameValueType struct { name string sortKey []uint16 value string } // JSON standard escapes (modulo \u) var asciiEscapes = []byte{'\\', '"', 'b', 'f', 'n', 'r', 't'} var binaryEscapes = []byte{'\\', '"', '\b', '\f', '\n', '\r', '\t'} // JSON literals var literals = []string{"true", "false", "null"} func Transform(jsonData []byte) (result []byte, e error) { // JSON data MUST be UTF-8 encoded var jsonDataLength int = len(jsonData) // Current pointer in jsonData var index int = 0 // "Forward" declarations are needed for closures referring each other var parseElement func() string var parseSimpleType func() string var parseQuotedString func() string var parseObject func() string var parseArray func() string var globalError error = nil checkError := func(e error) { // We only honor the first reported error if globalError == nil { globalError = e } } setError := func(msg string) { checkError(errors.New(msg)) } isWhiteSpace := func(c byte) bool { return c == 0x20 || c == 0x0a || c == 0x0d || c == 0x09 } nextChar := func() byte { if index < jsonDataLength { c := jsonData[index] if c > 0x7f { setError("Unexpected non-ASCII character") } index++ return c } setError("Unexpected EOF reached") return '"' } scan := func() byte { for { c := nextChar() if isWhiteSpace(c) { continue; } return c } } scanFor := func(expected byte) { c := scan() if c != expected { setError("Expected '" + string(expected) + "' but got '" + string(c) + "'") } } getUEscape := func() rune { start := index nextChar() nextChar() nextChar() nextChar() if globalError != nil { return 0 } u16, err := strconv.ParseUint(string(jsonData[start:index]), 16, 64) checkError(err) return rune(u16) } testNextNonWhiteSpaceChar := func() byte { save := index c := scan() index = save return c } decorateString := func(rawUTF8 string) string { var quotedString strings.Builder quotedString.WriteByte('"') CoreLoop: for _, c := range []byte(rawUTF8) { // Is this within the JSON standard escapes? for i, esc := range binaryEscapes { if esc == c { quotedString.WriteByte('\\') quotedString.WriteByte(asciiEscapes[i]) continue CoreLoop } } if c < 0x20 { // Other ASCII control characters must be escaped with \uhhhh quotedString.WriteString(fmt.Sprintf("\\u%04x", c)) } else { quotedString.WriteByte(c) } } quotedString.WriteByte('"') return quotedString.String() } parseQuotedString = func() string { var rawString strings.Builder CoreLoop: for globalError == nil { var c byte if index < jsonDataLength { c = jsonData[index] index++ } else { nextChar() break } if (c == '"') { break; } if c < ' ' { setError("Unterminated string literal") } else if c == '\\' { // Escape sequence c = nextChar() if c == 'u' { // The \u escape firstUTF16 := getUEscape() if utf16.IsSurrogate(firstUTF16) { // If the first UTF-16 code unit has a certain value there must be // another succeeding UTF-16 code unit as well if nextChar() != '\\' || nextChar() != 'u' { setError("Missing surrogate") } else { // Output the UTF-32 code point as UTF-8 rawString.WriteRune(utf16.DecodeRune(firstUTF16, getUEscape())) } } else { // Single UTF-16 code identical to UTF-32. Output as UTF-8 rawString.WriteRune(firstUTF16) } } else if c == '/' { // Benign but useless escape rawString.WriteByte('/') } else { // The JSON standard escapes for i, esc := range asciiEscapes { if esc == c { rawString.WriteByte(binaryEscapes[i]) continue CoreLoop } } setError("Unexpected escape: \\" + string(c)) } } else { // Just an ordinary ASCII character alternatively a UTF-8 byte // outside of ASCII. // Note that properly formatted UTF-8 never clashes with ASCII // making byte per byte search for ASCII break characters work // as expected. rawString.WriteByte(c) } } return rawString.String() } parseSimpleType = func() string { var token strings.Builder index-- for globalError == nil { c := testNextNonWhiteSpaceChar() if c == ',' || c == ']' || c == '}' { break; } c = nextChar() if isWhiteSpace(c) { break } token.WriteByte(c) } if token.Len() == 0 { setError("Missing argument") } value := token.String() // Is it a JSON literal? for _, literal := range literals { if literal == value { return literal } } // Apparently not so we assume that it is a I-JSON number ieeeF64, err := strconv.ParseFloat(value, 64) checkError(err) value, err = NumberToJSON(ieeeF64) checkError(err) return value } parseElement = func() string { switch scan() { case '{': return parseObject() case '"': return decorateString(parseQuotedString()) case '[': return parseArray() default: return parseSimpleType() } } parseArray = func() string { var arrayData strings.Builder arrayData.WriteByte('[') var next bool = false for globalError == nil && testNextNonWhiteSpaceChar() != ']' { if next { scanFor(',') arrayData.WriteByte(',') } else { next = true } arrayData.WriteString(parseElement()) } scan() arrayData.WriteByte(']') return arrayData.String() } lexicographicallyPrecedes := func(sortKey []uint16, e *list.Element) bool { // Find the minimum length of the sortKeys oldSortKey := e.Value.(nameValueType).sortKey minLength := len(oldSortKey) if minLength > len(sortKey) { minLength = len(sortKey) } for q := 0; q < minLength; q++ { diff := int(sortKey[q]) - int(oldSortKey[q]) if diff < 0 { // Smaller => Precedes return true } else if diff > 0 { // Bigger => No match return false } // Still equal => Continue } // The sortKeys compared equal up to minLength if len(sortKey) < len(oldSortKey) { // Shorter => Precedes return true } if len(sortKey) == len(oldSortKey) { setError("Duplicate key: " + e.Value.(nameValueType).name) } // Longer => No match return false } parseObject = func() string { nameValueList := list.New() var next bool = false CoreLoop: for globalError == nil && testNextNonWhiteSpaceChar() != '}' { if next { scanFor(',') } next = true scanFor('"') rawUTF8 := parseQuotedString() if globalError != nil { break; } // Sort keys on UTF-16 code units // Since UTF-8 doesn't have endianess this is just a value transformation // In the Go case the transformation is UTF-8 => UTF-32 => UTF-16 sortKey := utf16.Encode([]rune(rawUTF8)) scanFor(':') nameValue := nameValueType{rawUTF8, sortKey, parseElement()} for e := nameValueList.Front(); e != nil; e = e.Next() { // Check if the key is smaller than a previous key if lexicographicallyPrecedes(sortKey, e) { // Precedes => Insert before and exit sorting nameValueList.InsertBefore(nameValue, e) continue CoreLoop } // Continue searching for a possibly succeeding sortKey // (which is straightforward since the list is ordered) } // The sortKey is either the first or is succeeding all previous sortKeys nameValueList.PushBack(nameValue) } // Scan away '}' scan() // Now everything is sorted so we can properly serialize the object var objectData strings.Builder objectData.WriteByte('{') next = false for e := nameValueList.Front(); e != nil; e = e.Next() { if next { objectData.WriteByte(',') } next = true nameValue := e.Value.(nameValueType) objectData.WriteString(decorateString(nameValue.name)) objectData.WriteByte(':') objectData.WriteString(nameValue.value) } objectData.WriteByte('}') return objectData.String() } ///////////////////////////////////////////////// // This is where Transform actually begins... // ///////////////////////////////////////////////// var transformed string if testNextNonWhiteSpaceChar() == '[' { scan() transformed = parseArray() } else { scanFor('{') transformed = parseObject() } for index < jsonDataLength { if !isWhiteSpace(jsonData[index]) { setError("Improperly terminated JSON object") break; } index++ } return []byte(transformed), globalError } ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/.golangci.yml ================================================ # SPDX-License-Identifier: MPL-2.0 # Copyright (C) 2025 Aleksa Sarai # Copyright (C) 2025 SUSE LLC # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at https://mozilla.org/MPL/2.0/. version: "2" run: build-tags: - libpathrs linters: enable: - asasalint - asciicheck - containedctx - contextcheck - errcheck - errorlint - exhaustive - forcetypeassert - godot - goprintffuncname - govet - importas - ineffassign - makezero - misspell - musttag - nilerr - nilnesserr - nilnil - noctx - prealloc - revive - staticcheck - testifylint - unconvert - unparam - unused - usetesting settings: govet: enable: - nilness testifylint: enable-all: true formatters: enable: - gofumpt - goimports settings: goimports: local-prefixes: - github.com/cyphar/filepath-securejoin ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/CHANGELOG.md ================================================ # Changelog # All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] ## ## [0.6.1] - 2025-11-19 ## > At last up jumped the cunning spider, and fiercely held her fast. ### Fixed ### - Our logic for deciding whether to use `openat2(2)` or fallback to an `O_PATH` resolver would cache the result to avoid doing needless test runs of `openat2(2)`. However, this causes issues when `pathrs-lite` is being used by a program that applies new seccomp-bpf filters onto itself -- if the filter denies `openat2(2)` then we would return that error rather than falling back to the `O_PATH` resolver. To resolve this issue, we no longer cache the result if `openat2(2)` was successful, only if there was an error. - A file descriptor leak in our `openat2` wrapper (when doing the necessary `dup` for `RESOLVE_IN_ROOT`) has been removed. ## [0.5.2] - 2025-11-19 ## > "Will you walk into my parlour?" said a spider to a fly. ### Fixed ### - Our logic for deciding whether to use `openat2(2)` or fallback to an `O_PATH` resolver would cache the result to avoid doing needless test runs of `openat2(2)`. However, this causes issues when `pathrs-lite` is being used by a program that applies new seccomp-bpf filters onto itself -- if the filter denies `openat2(2)` then we would return that error rather than falling back to the `O_PATH` resolver. To resolve this issue, we no longer cache the result if `openat2(2)` was successful, only if there was an error. - A file descriptor leak in our `openat2` wrapper (when doing the necessary `dup` for `RESOLVE_IN_ROOT`) has been removed. ## [0.6.0] - 2025-11-03 ## > By the Power of Greyskull! ### Breaking ### - The deprecated `MkdirAll`, `MkdirAllHandle`, `OpenInRoot`, `OpenatInRoot` and `Reopen` wrappers have been removed. Please switch to using `pathrs-lite` directly. ### Added ### - `pathrs-lite` now has support for using libpathrs as a backend. This is opt-in and can be enabled at build time with the `libpathrs` build tag. The intention is to allow for downstream libraries and other projects to make use of the pure-Go `github.com/cyphar/filepath-securejoin/pathrs-lite` package and distributors can then opt-in to using `libpathrs` for the entire binary if they wish. ## [0.5.1] - 2025-10-31 ## > Spooky scary skeletons send shivers down your spine! ### Changed ### - `openat2` can return `-EAGAIN` if it detects a possible attack in certain scenarios (namely if there was a rename or mount while walking a path with a `..` component). While this is necessary to avoid a denial-of-service in the kernel, it does require retry loops in userspace. In previous versions, `pathrs-lite` would retry `openat2` 32 times before returning an error, but we've received user reports that this limit can be hit on systems with very heavy load. In some synthetic benchmarks (testing the worst-case of an attacker doing renames in a tight loop on every core of a 16-core machine) we managed to get a ~3% failure rate in runc. We have improved this situation in two ways: * We have now increased this limit to 128, which should be good enough for most use-cases without becoming a denial-of-service vector (the number of syscalls called by the `O_PATH` resolver in a typical case is within the same ballpark). The same benchmarks show a failure rate of ~0.12% which (while not zero) is probably sufficient for most users. * In addition, we now return a `unix.EAGAIN` error that is bubbled up and can be detected by callers. This means that callers with stricter requirements to avoid spurious errors can choose to do their own infinite `EAGAIN` retry loop (though we would strongly recommend users use time-based deadlines in such retry loops to avoid potentially unbounded denials-of-service). ## [0.5.0] - 2025-09-26 ## > Let the past die. Kill it if you have to. > **NOTE**: With this release, some parts of > `github.com/cyphar/filepath-securejoin` are now licensed under the Mozilla > Public License (version 2). Please see [COPYING.md][] as well as the the > license header in each file for more details. [COPYING.md]: ./COPYING.md ### Breaking ### - The new API introduced in the [0.3.0][] release has been moved to a new subpackage called `pathrs-lite`. This was primarily done to better indicate the split between the new and old APIs, as well as indicate to users the purpose of this subpackage (it is a less complete version of [libpathrs][]). We have added some wrappers to the top-level package to ease the transition, but those are deprecated and will be removed in the next minor release of filepath-securejoin. Users should update their import paths. This new subpackage has also been relicensed under the Mozilla Public License (version 2), please see [COPYING.md][] for more details. ### Added ### - Most of the key bits the safe `procfs` API have now been exported and are available in `github.com/cyphar/filepath-securejoin/pathrs-lite/procfs`. At the moment this primarily consists of a new `procfs.Handle` API: * `OpenProcRoot` returns a new handle to `/proc`, endeavouring to make it safe if possible (`subset=pid` to protect against mistaken write attacks and leaks, as well as using `fsopen(2)` to avoid racing mount attacks). `OpenUnsafeProcRoot` returns a handle without attempting to create one with `subset=pid`, which makes it more dangerous to leak. Most users should use `OpenProcRoot` (even if you need to use `ProcRoot` as the base of an operation, as filepath-securejoin will internally open a handle when necessary). * The `(*procfs.Handle).Open*` family of methods lets you get a safe `O_PATH` handle to subpaths within `/proc` for certain subpaths. For `OpenThreadSelf`, the returned `ProcThreadSelfCloser` needs to be called after you completely finish using the handle (this is necessary because Go is multi-threaded and `ProcThreadSelf` references `/proc/thread-self` which may disappear if we do not `runtime.LockOSThread` -- `ProcThreadSelfCloser` is currently equivalent to `runtime.UnlockOSThread`). Note that you cannot open any `procfs` symlinks (most notably magic-links) using this API. At the moment, filepath-securejoin does not support this feature (but [libpathrs][] does). * `ProcSelfFdReadlink` lets you get the in-kernel path representation of a file descriptor (think `readlink("/proc/self/fd/...")`), except that we verify that there aren't any tricky overmounts that could fool the process. Please be aware that the returned string is simply a snapshot at that particular moment, and an attacker could move the file being pointed to. In addition, complex namespace configurations could result in non-sensical or confusing paths to be returned. The value received from this function should only be used as secondary verification of some security property, not as proof that a particular handle has a particular path. The procfs handle used internally by the API is the same as the rest of `filepath-securejoin` (for privileged programs this is usually a private in-process `procfs` instance created with `fsopen(2)`). As before, this is intended as a stop-gap before users migrate to [libpathrs][], which provides a far more extensive safe `procfs` API and is generally more robust. - Previously, the hardened procfs implementation (used internally within `Reopen` and `Open(at)InRoot`) only protected against overmount attacks on systems with `openat2(2)` (Linux 5.6) or systems with `fsopen(2)` or `open_tree(2)` (Linux 5.2) and programs with privileges to use them (with some caveats about locked mounts that probably affect very few users). For other users, an attacker with the ability to create malicious mounts (on most systems, a sysadmin) could trick you into operating on files you didn't expect. This attack only really makes sense in the context of container runtime implementations. This was considered a reasonable trade-off, as the long-term intention was to get all users to just switch to [libpathrs][] if they wanted to use the safe `procfs` API (which had more extensive protections, and is what these new protections in `filepath-securejoin` are based on). However, as the API is now being exported it seems unwise to advertise the API as "safe" if we do not protect against known attacks. The procfs API is now more protected against attackers on systems lacking the aforementioned protections. However, the most comprehensive of these protections effectively rely on [`statx(STATX_MNT_ID)`][statx.2] (Linux 5.8). On older kernel versions, there is no effective protection (there is some minimal protection against non-`procfs` filesystem components but a sufficiently clever attacker can work around those). In addition, `STATX_MNT_ID` is vulnerable to mount ID reuse attacks by sufficiently motivated and privileged attackers -- this problem is mitigated with `STATX_MNT_ID_UNIQUE` (Linux 6.8) but that raises the minimum kernel version for more protection. The fact that these protections are quite limited despite needing a fair bit of extra code to handle was one of the primary reasons we did not initially implement this in `filepath-securejoin` ([libpathrs][] supports all of this, of course). ### Fixed ### - RHEL 8 kernels have backports of `fsopen(2)` but in some testing we've found that it has very bad (and very difficult to debug) performance issues, and so we will explicitly refuse to use `fsopen(2)` if the running kernel version is pre-5.2 and will instead fallback to `open("/proc")`. [CVE-2024-21626]: https://github.com/opencontainers/runc/security/advisories/GHSA-xr7r-f8xq-vfvv [libpathrs]: https://github.com/cyphar/libpathrs [statx.2]: https://www.man7.org/linux/man-pages/man2/statx.2.html ## [0.4.1] - 2025-01-28 ## ### Fixed ### - The restrictions added for `root` paths passed to `SecureJoin` in 0.4.0 was found to be too strict and caused some regressions when folks tried to update, so this restriction has been relaxed to only return an error if the path contains a `..` component. We still recommend users use `filepath.Clean` (and even `filepath.EvalSymlinks`) on the `root` path they are using, but at least you will no longer be punished for "trivial" unclean paths. ## [0.4.0] - 2025-01-13 ## ### Breaking #### - `SecureJoin(VFS)` will now return an error if the provided `root` is not a `filepath.Clean`'d path. While it is ultimately the responsibility of the caller to ensure the root is a safe path to use, passing a path like `/symlink/..` as a root would result in the `SecureJoin`'d path being placed in `/` even though `/symlink/..` might be a different directory, and so we should more strongly discourage such usage. All major users of `securejoin.SecureJoin` already ensure that the paths they provide are safe (and this is ultimately a question of user error), but removing this foot-gun is probably a good idea. Of course, this is necessarily a breaking API change (though we expect no real users to be affected by it). Thanks to [Erik Sjölund](https://github.com/eriksjolund), who initially reported this issue as a possible security issue. - `MkdirAll` and `MkdirHandle` now take an `os.FileMode`-style mode argument instead of a raw `unix.S_*`-style mode argument, which may cause compile-time type errors depending on how you use `filepath-securejoin`. For most users, there will be no change in behaviour aside from the type change (as the bottom `0o777` bits are the same in both formats, and most users are probably only using those bits). However, if you were using `unix.S_ISVTX` to set the sticky bit with `MkdirAll(Handle)` you will need to switch to `os.ModeSticky` otherwise you will get a runtime error with this update. In addition, the error message you will get from passing `unix.S_ISUID` and `unix.S_ISGID` will be different as they are treated as invalid bits now (note that previously passing said bits was also an error). ## [0.3.6] - 2024-12-17 ## ### Compatibility ### - The minimum Go version requirement for `filepath-securejoin` is now Go 1.18 (we use generics internally). For reference, `filepath-securejoin@v0.3.0` somewhat-arbitrarily bumped the Go version requirement to 1.21. While we did make some use of Go 1.21 stdlib features (and in principle Go versions <= 1.21 are no longer even supported by upstream anymore), some downstreams have complained that the version bump has meant that they have to do workarounds when backporting fixes that use the new `filepath-securejoin` API onto old branches. This is not an ideal situation, but since using this library is probably better for most downstreams than a hand-rolled workaround, we now have compatibility shims that allow us to build on older Go versions. - Lower minimum version requirement for `golang.org/x/sys` to `v0.18.0` (we need the wrappers for `fsconfig(2)`), which should also make backporting patches to older branches easier. ## [0.3.5] - 2024-12-06 ## ### Fixed ### - `MkdirAll` will now no longer return an `EEXIST` error if two racing processes are creating the same directory. We will still verify that the path is a directory, but this will avoid spurious errors when multiple threads or programs are trying to `MkdirAll` the same path. opencontainers/runc#4543 ## [0.3.4] - 2024-10-09 ## ### Fixed ### - Previously, some testing mocks we had resulted in us doing `import "testing"` in non-`_test.go` code, which made some downstreams like Kubernetes unhappy. This has been fixed. (#32) ## [0.3.3] - 2024-09-30 ## ### Fixed ### - The mode and owner verification logic in `MkdirAll` has been removed. This was originally intended to protect against some theoretical attacks but upon further consideration these protections don't actually buy us anything and they were causing spurious errors with more complicated filesystem setups. - The "is the created directory empty" logic in `MkdirAll` has also been removed. This was not causing us issues yet, but some pseudofilesystems (such as `cgroup`) create non-empty directories and so this logic would've been wrong for such cases. ## [0.3.2] - 2024-09-13 ## ### Changed ### - Passing the `S_ISUID` or `S_ISGID` modes to `MkdirAllInRoot` will now return an explicit error saying that those bits are ignored by `mkdirat(2)`. In the past a different error was returned, but since the silent ignoring behaviour is codified in the man pages a more explicit error seems apt. While silently ignoring these bits would be the most compatible option, it could lead to users thinking their code sets these bits when it doesn't. Programs that need to deal with compatibility can mask the bits themselves. (#23, #25) ### Fixed ### - If a directory has `S_ISGID` set, then all child directories will have `S_ISGID` set when created and a different gid will be used for any inode created under the directory. Previously, the "expected owner and mode" validation in `securejoin.MkdirAll` did not correctly handle this. We now correctly handle this case. (#24, #25) ## [0.3.1] - 2024-07-23 ## ### Changed ### - By allowing `Open(at)InRoot` to opt-out of the extra work done by `MkdirAll` to do the necessary "partial lookups", `Open(at)InRoot` now does less work for both implementations (resulting in a many-fold decrease in the number of operations for `openat2`, and a modest improvement for non-`openat2`) and is far more guaranteed to match the correct `openat2(RESOLVE_IN_ROOT)` behaviour. - We now use `readlinkat(fd, "")` where possible. For `Open(at)InRoot` this effectively just means that we no longer risk getting spurious errors during rename races. However, for our hardened procfs handler, this in theory should prevent mount attacks from tricking us when doing magic-link readlinks (even when using the unsafe host `/proc` handle). Unfortunately `Reopen` is still potentially vulnerable to those kinds of somewhat-esoteric attacks. Technically this [will only work on post-2.6.39 kernels][linux-readlinkat-emptypath] but it seems incredibly unlikely anyone is using `filepath-securejoin` on a pre-2011 kernel. ### Fixed ### - Several improvements were made to the errors returned by `Open(at)InRoot` and `MkdirAll` when dealing with invalid paths under the emulated (ie. non-`openat2`) implementation. Previously, some paths would return the wrong error (`ENOENT` when the last component was a non-directory), and other paths would be returned as though they were acceptable (trailing-slash components after a non-directory would be ignored by `Open(at)InRoot`). These changes were done to match `openat2`'s behaviour and purely is a consistency fix (most users are going to be using `openat2` anyway). [linux-readlinkat-emptypath]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=65cfc6722361570bfe255698d9cd4dccaf47570d ## [0.3.0] - 2024-07-11 ## ### Added ### - A new set of `*os.File`-based APIs have been added. These are adapted from [libpathrs][] and we strongly suggest using them if possible (as they provide far more protection against attacks than `SecureJoin`): - `Open(at)InRoot` resolves a path inside a rootfs and returns an `*os.File` handle to the path. Note that the handle returned is an `O_PATH` handle, which cannot be used for reading or writing (as well as some other operations -- [see open(2) for more details][open.2]) - `Reopen` takes an `O_PATH` file handle and safely re-opens it to upgrade it to a regular handle. This can also be used with non-`O_PATH` handles, but `O_PATH` is the most obvious application. - `MkdirAll` is an implementation of `os.MkdirAll` that is safe to use to create a directory tree within a rootfs. As these are new APIs, they may change in the future. However, they should be safe to start migrating to as we have extensive tests ensuring they behave correctly and are safe against various races and other attacks. [libpathrs]: https://github.com/cyphar/libpathrs [open.2]: https://www.man7.org/linux/man-pages/man2/open.2.html ## [0.2.5] - 2024-05-03 ## ### Changed ### - Some minor changes were made to how lexical components (like `..` and `.`) are handled during path generation in `SecureJoin`. There is no behaviour change as a result of this fix (the resulting paths are the same). ### Fixed ### - The error returned when we hit a symlink loop now references the correct path. (#10) ## [0.2.4] - 2023-09-06 ## ### Security ### - This release fixes a potential security issue in filepath-securejoin when used on Windows ([GHSA-6xv5-86q9-7xr8][], which could be used to generate paths outside of the provided rootfs in certain cases), as well as improving the overall behaviour of filepath-securejoin when dealing with Windows paths that contain volume names. Thanks to Paulo Gomes for discovering and fixing these issues. ### Fixed ### - Switch to GitHub Actions for CI so we can test on Windows as well as Linux and MacOS. [GHSA-6xv5-86q9-7xr8]: https://github.com/advisories/GHSA-6xv5-86q9-7xr8 ## [0.2.3] - 2021-06-04 ## ### Changed ### - Switch to Go 1.13-style `%w` error wrapping, letting us drop the dependency on `github.com/pkg/errors`. ## [0.2.2] - 2018-09-05 ## ### Changed ### - Use `syscall.ELOOP` as the base error for symlink loops, rather than our own (internal) error. This allows callers to more easily use `errors.Is` to check for this case. ## [0.2.1] - 2018-09-05 ## ### Fixed ### - Use our own `IsNotExist` implementation, which lets us handle `ENOTDIR` properly within `SecureJoin`. ## [0.2.0] - 2017-07-19 ## We now have 100% test coverage! ### Added ### - Add a `SecureJoinVFS` API that can be used for mocking (as we do in our new tests) or for implementing custom handling of lookup operations (such as for rootless containers, where work is necessary to access directories with weird modes because we don't have `CAP_DAC_READ_SEARCH` or `CAP_DAC_OVERRIDE`). ## 0.1.0 - 2017-07-19 This is our first release of `github.com/cyphar/filepath-securejoin`, containing a full implementation with a coverage of 93.5% (the only missing cases are the error cases, which are hard to mocktest at the moment). [Unreleased]: https://github.com/cyphar/filepath-securejoin/compare/v0.6.1...HEAD [0.6.1]: https://github.com/cyphar/filepath-securejoin/compare/v0.6.0...v0.6.1 [0.6.0]: https://github.com/cyphar/filepath-securejoin/compare/v0.5.0...v0.6.0 [0.5.2]: https://github.com/cyphar/filepath-securejoin/compare/v0.5.1...v0.5.2 [0.5.1]: https://github.com/cyphar/filepath-securejoin/compare/v0.5.0...v0.5.1 [0.5.0]: https://github.com/cyphar/filepath-securejoin/compare/v0.4.1...v0.5.0 [0.4.1]: https://github.com/cyphar/filepath-securejoin/compare/v0.4.0...v0.4.1 [0.4.0]: https://github.com/cyphar/filepath-securejoin/compare/v0.3.6...v0.4.0 [0.3.6]: https://github.com/cyphar/filepath-securejoin/compare/v0.3.5...v0.3.6 [0.3.5]: https://github.com/cyphar/filepath-securejoin/compare/v0.3.4...v0.3.5 [0.3.4]: https://github.com/cyphar/filepath-securejoin/compare/v0.3.3...v0.3.4 [0.3.3]: https://github.com/cyphar/filepath-securejoin/compare/v0.3.2...v0.3.3 [0.3.2]: https://github.com/cyphar/filepath-securejoin/compare/v0.3.1...v0.3.2 [0.3.1]: https://github.com/cyphar/filepath-securejoin/compare/v0.3.0...v0.3.1 [0.3.0]: https://github.com/cyphar/filepath-securejoin/compare/v0.2.5...v0.3.0 [0.2.5]: https://github.com/cyphar/filepath-securejoin/compare/v0.2.4...v0.2.5 [0.2.4]: https://github.com/cyphar/filepath-securejoin/compare/v0.2.3...v0.2.4 [0.2.3]: https://github.com/cyphar/filepath-securejoin/compare/v0.2.2...v0.2.3 [0.2.2]: https://github.com/cyphar/filepath-securejoin/compare/v0.2.1...v0.2.2 [0.2.1]: https://github.com/cyphar/filepath-securejoin/compare/v0.2.0...v0.2.1 [0.2.0]: https://github.com/cyphar/filepath-securejoin/compare/v0.1.0...v0.2.0 ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/COPYING.md ================================================ ## COPYING ## `SPDX-License-Identifier: BSD-3-Clause AND MPL-2.0` This project is made up of code licensed under different licenses. Which code you use will have an impact on whether only one or both licenses apply to your usage of this library. Note that **each file** in this project individually has a code comment at the start describing the license of that particular file -- this is the most accurate license information of this project; in case there is any conflict between this document and the comment at the start of a file, the comment shall take precedence. The only purpose of this document is to work around [a known technical limitation of pkg.go.dev's license checking tool when dealing with non-trivial project licenses][go75067]. [go75067]: https://go.dev/issue/75067 ### `BSD-3-Clause` ### At time of writing, the following files and directories are licensed under the BSD-3-Clause license: * `doc.go` * `join*.go` * `vfs.go` * `internal/consts/*.go` * `pathrs-lite/internal/gocompat/*.go` * `pathrs-lite/internal/kernelversion/*.go` The text of the BSD-3-Clause license used by this project is the following (the text is also available from the [`LICENSE.BSD`](./LICENSE.BSD) file): ``` Copyright (C) 2014-2015 Docker Inc & Go Authors. All rights reserved. Copyright (C) 2017-2024 SUSE LLC. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ``` ### `MPL-2.0` ### All other files (unless otherwise marked) are licensed under the Mozilla Public License (version 2.0). The text of the Mozilla Public License (version 2.0) is the following (the text is also available from the [`LICENSE.MPL-2.0`](./LICENSE.MPL-2.0) file): ``` Mozilla Public License Version 2.0 ================================== 1. Definitions -------------- 1.1. "Contributor" means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software. 1.2. "Contributor Version" means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor's Contribution. 1.3. "Contribution" means Covered Software of a particular Contributor. 1.4. "Covered Software" means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof. 1.5. "Incompatible With Secondary Licenses" means (a) that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or (b) that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License. 1.6. "Executable Form" means any form of the work other than Source Code Form. 1.7. "Larger Work" means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software. 1.8. "License" means this document. 1.9. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License. 1.10. "Modifications" means any of the following: (a) any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or (b) any new file in Source Code Form that contains any Covered Software. 1.11. "Patent Claims" of a Contributor means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version. 1.12. "Secondary License" means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses. 1.13. "Source Code Form" means the form of the work preferred for making modifications. 1.14. "You" (or "Your") means an individual or a legal entity exercising rights under this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. 2. License Grants and Conditions -------------------------------- 2.1. Grants Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: (a) under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and (b) under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version. 2.2. Effective Date The licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution. 2.3. Limitations on Grant Scope The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor: (a) for any code that a Contributor has removed from Covered Software; or (b) for infringements caused by: (i) Your and any other third party's modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or (c) under Patent Claims infringed by Covered Software in the absence of its Contributions. This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4). 2.4. Subsequent Licenses No Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section 10.2) or under the terms of a Secondary License (if permitted under the terms of Section 3.3). 2.5. Representation Each Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License. 2.6. Fair Use This License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents. 2.7. Conditions Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1. 3. Responsibilities ------------------- 3.1. Distribution of Source Form All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients' rights in the Source Code Form. 3.2. Distribution of Executable Form If You distribute Covered Software in Executable Form then: (a) such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and (b) You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients' rights in the Source Code Form under this License. 3.3. Distribution of a Larger Work You may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s). 3.4. Notices You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies. 3.5. Application of Additional Terms You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction. 4. Inability to Comply Due to Statute or Regulation --------------------------------------------------- If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. 5. Termination -------------- 5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice. 5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate. 5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination. ************************************************************************ * * * 6. Disclaimer of Warranty * * ------------------------- * * * * Covered Software is provided under this License on an "as is" * * basis, without warranty of any kind, either expressed, implied, or * * statutory, including, without limitation, warranties that the * * Covered Software is free of defects, merchantable, fit for a * * particular purpose or non-infringing. The entire risk as to the * * quality and performance of the Covered Software is with You. * * Should any Covered Software prove defective in any respect, You * * (not any Contributor) assume the cost of any necessary servicing, * * repair, or correction. This disclaimer of warranty constitutes an * * essential part of this License. No use of any Covered Software is * * authorized under this License except under this disclaimer. * * * ************************************************************************ ************************************************************************ * * * 7. Limitation of Liability * * -------------------------- * * * * Under no circumstances and under no legal theory, whether tort * * (including negligence), contract, or otherwise, shall any * * Contributor, or anyone who distributes Covered Software as * * permitted above, be liable to You for any direct, indirect, * * special, incidental, or consequential damages of any character * * including, without limitation, damages for lost profits, loss of * * goodwill, work stoppage, computer failure or malfunction, or any * * and all other commercial damages or losses, even if such party * * shall have been informed of the possibility of such damages. This * * limitation of liability shall not apply to liability for death or * * personal injury resulting from such party's negligence to the * * extent applicable law prohibits such limitation. Some * * jurisdictions do not allow the exclusion or limitation of * * incidental or consequential damages, so this exclusion and * * limitation may not apply to You. * * * ************************************************************************ 8. Litigation ------------- Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party's ability to bring cross-claims or counter-claims. 9. Miscellaneous ---------------- This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor. 10. Versions of the License --------------------------- 10.1. New Versions Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number. 10.2. Effect of New Versions You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward. 10.3. Modified Versions If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License). 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached. Exhibit A - Source Code Form License Notice ------------------------------------------- This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. You may add additional accurate notices of copyright ownership. Exhibit B - "Incompatible With Secondary Licenses" Notice --------------------------------------------------------- This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0. ``` ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/LICENSE.BSD ================================================ Copyright (C) 2014-2015 Docker Inc & Go Authors. All rights reserved. Copyright (C) 2017-2024 SUSE LLC. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/LICENSE.MPL-2.0 ================================================ Mozilla Public License Version 2.0 ================================== 1. Definitions -------------- 1.1. "Contributor" means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software. 1.2. "Contributor Version" means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor's Contribution. 1.3. "Contribution" means Covered Software of a particular Contributor. 1.4. "Covered Software" means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof. 1.5. "Incompatible With Secondary Licenses" means (a) that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or (b) that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License. 1.6. "Executable Form" means any form of the work other than Source Code Form. 1.7. "Larger Work" means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software. 1.8. "License" means this document. 1.9. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License. 1.10. "Modifications" means any of the following: (a) any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or (b) any new file in Source Code Form that contains any Covered Software. 1.11. "Patent Claims" of a Contributor means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version. 1.12. "Secondary License" means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses. 1.13. "Source Code Form" means the form of the work preferred for making modifications. 1.14. "You" (or "Your") means an individual or a legal entity exercising rights under this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. 2. License Grants and Conditions -------------------------------- 2.1. Grants Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: (a) under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and (b) under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version. 2.2. Effective Date The licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution. 2.3. Limitations on Grant Scope The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor: (a) for any code that a Contributor has removed from Covered Software; or (b) for infringements caused by: (i) Your and any other third party's modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or (c) under Patent Claims infringed by Covered Software in the absence of its Contributions. This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4). 2.4. Subsequent Licenses No Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section 10.2) or under the terms of a Secondary License (if permitted under the terms of Section 3.3). 2.5. Representation Each Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License. 2.6. Fair Use This License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents. 2.7. Conditions Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1. 3. Responsibilities ------------------- 3.1. Distribution of Source Form All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients' rights in the Source Code Form. 3.2. Distribution of Executable Form If You distribute Covered Software in Executable Form then: (a) such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and (b) You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients' rights in the Source Code Form under this License. 3.3. Distribution of a Larger Work You may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s). 3.4. Notices You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies. 3.5. Application of Additional Terms You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction. 4. Inability to Comply Due to Statute or Regulation --------------------------------------------------- If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. 5. Termination -------------- 5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice. 5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate. 5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination. ************************************************************************ * * * 6. Disclaimer of Warranty * * ------------------------- * * * * Covered Software is provided under this License on an "as is" * * basis, without warranty of any kind, either expressed, implied, or * * statutory, including, without limitation, warranties that the * * Covered Software is free of defects, merchantable, fit for a * * particular purpose or non-infringing. The entire risk as to the * * quality and performance of the Covered Software is with You. * * Should any Covered Software prove defective in any respect, You * * (not any Contributor) assume the cost of any necessary servicing, * * repair, or correction. This disclaimer of warranty constitutes an * * essential part of this License. No use of any Covered Software is * * authorized under this License except under this disclaimer. * * * ************************************************************************ ************************************************************************ * * * 7. Limitation of Liability * * -------------------------- * * * * Under no circumstances and under no legal theory, whether tort * * (including negligence), contract, or otherwise, shall any * * Contributor, or anyone who distributes Covered Software as * * permitted above, be liable to You for any direct, indirect, * * special, incidental, or consequential damages of any character * * including, without limitation, damages for lost profits, loss of * * goodwill, work stoppage, computer failure or malfunction, or any * * and all other commercial damages or losses, even if such party * * shall have been informed of the possibility of such damages. This * * limitation of liability shall not apply to liability for death or * * personal injury resulting from such party's negligence to the * * extent applicable law prohibits such limitation. Some * * jurisdictions do not allow the exclusion or limitation of * * incidental or consequential damages, so this exclusion and * * limitation may not apply to You. * * * ************************************************************************ 8. Litigation ------------- Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party's ability to bring cross-claims or counter-claims. 9. Miscellaneous ---------------- This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor. 10. Versions of the License --------------------------- 10.1. New Versions Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number. 10.2. Effect of New Versions You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward. 10.3. Modified Versions If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License). 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached. Exhibit A - Source Code Form License Notice ------------------------------------------- This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. You may add additional accurate notices of copyright ownership. Exhibit B - "Incompatible With Secondary Licenses" Notice --------------------------------------------------------- This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0. ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/README.md ================================================ ## `filepath-securejoin` ## [![Go Documentation](https://pkg.go.dev/badge/github.com/cyphar/filepath-securejoin.svg)](https://pkg.go.dev/github.com/cyphar/filepath-securejoin) [![Build Status](https://github.com/cyphar/filepath-securejoin/actions/workflows/ci.yml/badge.svg)](https://github.com/cyphar/filepath-securejoin/actions/workflows/ci.yml) ### Old API ### This library was originally just an implementation of `SecureJoin` which was [intended to be included in the Go standard library][go#20126] as a safer `filepath.Join` that would restrict the path lookup to be inside a root directory. The implementation was based on code that existed in several container runtimes. Unfortunately, this API is **fundamentally unsafe** against attackers that can modify path components after `SecureJoin` returns and before the caller uses the path, allowing for some fairly trivial TOCTOU attacks. `SecureJoin` (and `SecureJoinVFS`) are still provided by this library to support legacy users, but new users are strongly suggested to avoid using `SecureJoin` and instead use the [new api](#new-api) or switch to [libpathrs][libpathrs]. With the above limitations in mind, this library guarantees the following: * If no error is set, the resulting string **must** be a child path of `root` and will not contain any symlink path components (they will all be expanded). * When expanding symlinks, all symlink path components **must** be resolved relative to the provided root. In particular, this can be considered a userspace implementation of how `chroot(2)` operates on file paths. Note that these symlinks will **not** be expanded lexically (`filepath.Clean` is not called on the input before processing). * Non-existent path components are unaffected by `SecureJoin` (similar to `filepath.EvalSymlinks`'s semantics). * The returned path will always be `filepath.Clean`ed and thus not contain any `..` components. A (trivial) implementation of this function on GNU/Linux systems could be done with the following (note that this requires root privileges and is far more opaque than the implementation in this library, and also requires that `readlink` is inside the `root` path and is trustworthy): ```go package securejoin import ( "os/exec" "path/filepath" ) func SecureJoin(root, unsafePath string) (string, error) { unsafePath = string(filepath.Separator) + unsafePath cmd := exec.Command("chroot", root, "readlink", "--canonicalize-missing", "--no-newline", unsafePath) output, err := cmd.CombinedOutput() if err != nil { return "", err } expanded := string(output) return filepath.Join(root, expanded), nil } ``` [libpathrs]: https://github.com/openSUSE/libpathrs [go#20126]: https://github.com/golang/go/issues/20126 ### New API ### [#new-api]: #new-api While we recommend users switch to [libpathrs][libpathrs] as soon as it has a stable release, some methods implemented by libpathrs have been ported to this library to ease the transition. These APIs are only supported on Linux. These APIs are implemented such that `filepath-securejoin` will opportunistically use certain newer kernel APIs that make these operations far more secure. In particular: * All of the lookup operations will use [`openat2`][openat2.2] on new enough kernels (Linux 5.6 or later) to restrict lookups through magic-links and bind-mounts (for certain operations) and to make use of `RESOLVE_IN_ROOT` to efficiently resolve symlinks within a rootfs. * The APIs provide hardening against a malicious `/proc` mount to either detect or avoid being tricked by a `/proc` that is not legitimate. This is done using [`openat2`][openat2.2] for all users, and privileged users will also be further protected by using [`fsopen`][fsopen.2] and [`open_tree`][open_tree.2] (Linux 5.2 or later). [openat2.2]: https://www.man7.org/linux/man-pages/man2/openat2.2.html [fsopen.2]: https://github.com/brauner/man-pages-md/blob/main/fsopen.md [open_tree.2]: https://github.com/brauner/man-pages-md/blob/main/open_tree.md #### `OpenInRoot` #### ```go func OpenInRoot(root, unsafePath string) (*os.File, error) func OpenatInRoot(root *os.File, unsafePath string) (*os.File, error) func Reopen(handle *os.File, flags int) (*os.File, error) ``` `OpenInRoot` is a much safer version of ```go path, err := securejoin.SecureJoin(root, unsafePath) file, err := os.OpenFile(path, unix.O_PATH|unix.O_CLOEXEC) ``` that protects against various race attacks that could lead to serious security issues, depending on the application. Note that the returned `*os.File` is an `O_PATH` file descriptor, which is quite restricted. Callers will probably need to use `Reopen` to get a more usable handle (this split is done to provide useful features like PTY spawning and to avoid users accidentally opening bad inodes that could cause a DoS). Callers need to be careful in how they use the returned `*os.File`. Usually it is only safe to operate on the handle directly, and it is very easy to create a security issue. [libpathrs][libpathrs] provides far more helpers to make using these handles safer -- there is currently no plan to port them to `filepath-securejoin`. `OpenatInRoot` is like `OpenInRoot` except that the root is provided using an `*os.File`. This allows you to ensure that multiple `OpenatInRoot` (or `MkdirAllHandle`) calls are operating on the same rootfs. > **NOTE**: Unlike `SecureJoin`, `OpenInRoot` will error out as soon as it hits > a dangling symlink or non-existent path. This is in contrast to `SecureJoin` > which treated non-existent components as though they were real directories, > and would allow for partial resolution of dangling symlinks. These behaviours > are at odds with how Linux treats non-existent paths and dangling symlinks, > and so these are no longer allowed. #### `MkdirAll` #### ```go func MkdirAll(root, unsafePath string, mode int) error func MkdirAllHandle(root *os.File, unsafePath string, mode int) (*os.File, error) ``` `MkdirAll` is a much safer version of ```go path, err := securejoin.SecureJoin(root, unsafePath) err = os.MkdirAll(path, mode) ``` that protects against the same kinds of races that `OpenInRoot` protects against. `MkdirAllHandle` is like `MkdirAll` except that the root is provided using an `*os.File` (the reason for this is the same as with `OpenatInRoot`) and an `*os.File` of the final created directory is returned (this directory is guaranteed to be effectively identical to the directory created by `MkdirAllHandle`, which is not possible to ensure by just using `OpenatInRoot` after `MkdirAll`). > **NOTE**: Unlike `SecureJoin`, `MkdirAll` will error out as soon as it hits > a dangling symlink or non-existent path. This is in contrast to `SecureJoin` > which treated non-existent components as though they were real directories, > and would allow for partial resolution of dangling symlinks. These behaviours > are at odds with how Linux treats non-existent paths and dangling symlinks, > and so these are no longer allowed. This means that `MkdirAll` will not > create non-existent directories referenced by a dangling symlink. ### License ### `SPDX-License-Identifier: BSD-3-Clause AND MPL-2.0` Some of the code in this project is derived from Go, and is licensed under a BSD 3-clause license (available in `LICENSE.BSD`). Other files (many of which are derived from [libpathrs][libpathrs]) are licensed under the Mozilla Public License version 2.0 (available in `LICENSE.MPL-2.0`). If you are using the ["New API" described above][#new-api], you are probably using code from files released under this license. Every source file in this project has a copyright header describing its license. Please check the license headers of each file to see what license applies to it. See [COPYING.md](./COPYING.md) for some more details. [umoci]: https://github.com/opencontainers/umoci ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/VERSION ================================================ 0.6.1 ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/codecov.yml ================================================ # SPDX-License-Identifier: MPL-2.0 # Copyright (C) 2025 Aleksa Sarai # Copyright (C) 2025 SUSE LLC # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at https://mozilla.org/MPL/2.0/. comment: layout: "condensed_header, reach, diff, components, condensed_files, condensed_footer" require_changes: true branches: - main coverage: range: 60..100 status: project: default: target: 85% threshold: 0% patch: default: target: auto informational: true github_checks: annotations: false ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/doc.go ================================================ // SPDX-License-Identifier: BSD-3-Clause // Copyright (C) 2014-2015 Docker Inc & Go Authors. All rights reserved. // Copyright (C) 2017-2024 SUSE LLC. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package securejoin implements a set of helpers to make it easier to write Go // code that is safe against symlink-related escape attacks. The primary idea // is to let you resolve a path within a rootfs directory as if the rootfs was // a chroot. // // securejoin has two APIs, a "legacy" API and a "modern" API. // // The legacy API is [SecureJoin] and [SecureJoinVFS]. These methods are // **not** safe against race conditions where an attacker changes the // filesystem after (or during) the [SecureJoin] operation. // // The new API is available in the [pathrs-lite] subpackage, and provide // protections against racing attackers as well as several other key // protections against attacks often seen by container runtimes. As the name // suggests, [pathrs-lite] is a stripped down (pure Go) reimplementation of // [libpathrs]. The main APIs provided are [OpenInRoot], [MkdirAll], and // [procfs.Handle] -- other APIs are not planned to be ported. The long-term // goal is for users to migrate to [libpathrs] which is more fully-featured. // // securejoin has been used by several container runtimes (Docker, runc, // Kubernetes, etc) for quite a few years as a de-facto standard for operating // on container filesystem paths "safely". However, most users still use the // legacy API which is unsafe against various attacks (there is a fairly long // history of CVEs in dependent as a result). Users should switch to the modern // API as soon as possible (or even better, switch to libpathrs). // // This project was initially intended to be included in the Go standard // library, but it was rejected (see https://go.dev/issue/20126). Much later, // [os.Root] was added to the Go stdlib that shares some of the goals of // filepath-securejoin. However, its design is intended to work like // openat2(RESOLVE_BENEATH) which does not fit the usecase of container // runtimes and most system tools. // // [pathrs-lite]: https://pkg.go.dev/github.com/cyphar/filepath-securejoin/pathrs-lite // [libpathrs]: https://github.com/openSUSE/libpathrs // [OpenInRoot]: https://pkg.go.dev/github.com/cyphar/filepath-securejoin/pathrs-lite#OpenInRoot // [MkdirAll]: https://pkg.go.dev/github.com/cyphar/filepath-securejoin/pathrs-lite#MkdirAll // [procfs.Handle]: https://pkg.go.dev/github.com/cyphar/filepath-securejoin/pathrs-lite/procfs#Handle // [os.Root]: https:///pkg.go.dev/os#Root package securejoin ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/internal/consts/consts.go ================================================ // SPDX-License-Identifier: BSD-3-Clause // Copyright (C) 2014-2015 Docker Inc & Go Authors. All rights reserved. // Copyright (C) 2017-2025 SUSE LLC. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package consts contains the definitions of internal constants used // throughout filepath-securejoin. package consts // MaxSymlinkLimit is the maximum number of symlinks that can be encountered // during a single lookup before returning -ELOOP. At time of writing, Linux // has an internal limit of 40. const MaxSymlinkLimit = 255 ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/join.go ================================================ // SPDX-License-Identifier: BSD-3-Clause // Copyright (C) 2014-2015 Docker Inc & Go Authors. All rights reserved. // Copyright (C) 2017-2025 SUSE LLC. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package securejoin import ( "errors" "os" "path/filepath" "strings" "syscall" "github.com/cyphar/filepath-securejoin/internal/consts" ) // IsNotExist tells you if err is an error that implies that either the path // accessed does not exist (or path components don't exist). This is // effectively a more broad version of [os.IsNotExist]. func IsNotExist(err error) bool { // Check that it's not actually an ENOTDIR, which in some cases is a more // convoluted case of ENOENT (usually involving weird paths). return errors.Is(err, os.ErrNotExist) || errors.Is(err, syscall.ENOTDIR) || errors.Is(err, syscall.ENOENT) } // errUnsafeRoot is returned if the user provides SecureJoinVFS with a path // that contains ".." components. var errUnsafeRoot = errors.New("root path provided to SecureJoin contains '..' components") // stripVolume just gets rid of the Windows volume included in a path. Based on // some godbolt tests, the Go compiler is smart enough to make this a no-op on // Linux. func stripVolume(path string) string { return path[len(filepath.VolumeName(path)):] } // hasDotDot checks if the path contains ".." components in a platform-agnostic // way. func hasDotDot(path string) bool { // If we are on Windows, strip any volume letters. It turns out that // C:..\foo may (or may not) be a valid pathname and we need to handle that // leading "..". path = stripVolume(path) // Look for "/../" in the path, but we need to handle leading and trailing // ".."s by adding separators. Doing this with filepath.Separator is ugly // so just convert to Unix-style "/" first. path = filepath.ToSlash(path) return strings.Contains("/"+path+"/", "/../") } // SecureJoinVFS joins the two given path components (similar to // [filepath.Join]) except that the returned path is guaranteed to be scoped // inside the provided root path (when evaluated). Any symbolic links in the // path are evaluated with the given root treated as the root of the // filesystem, similar to a chroot. The filesystem state is evaluated through // the given [VFS] interface (if nil, the standard [os].* family of functions // are used). // // Note that the guarantees provided by this function only apply if the path // components in the returned string are not modified (in other words are not // replaced with symlinks on the filesystem) after this function has returned. // Such a symlink race is necessarily out-of-scope of SecureJoinVFS. // // NOTE: Due to the above limitation, Linux users are strongly encouraged to // use [OpenInRoot] instead, which does safely protect against these kinds of // attacks. There is no way to solve this problem with SecureJoinVFS because // the API is fundamentally wrong (you cannot return a "safe" path string and // guarantee it won't be modified afterwards). // // Volume names in unsafePath are always discarded, regardless if they are // provided via direct input or when evaluating symlinks. Therefore: // // "C:\Temp" + "D:\path\to\file.txt" results in "C:\Temp\path\to\file.txt" // // If the provided root is not [filepath.Clean] then an error will be returned, // as such root paths are bordering on somewhat unsafe and using such paths is // not best practice. We also strongly suggest that any root path is first // fully resolved using [filepath.EvalSymlinks] or otherwise constructed to // avoid containing symlink components. Of course, the root also *must not* be // attacker-controlled. func SecureJoinVFS(root, unsafePath string, vfs VFS) (string, error) { //nolint:revive // name is part of public API // The root path must not contain ".." components, otherwise when we join // the subpath we will end up with a weird path. We could work around this // in other ways but users shouldn't be giving us non-lexical root paths in // the first place. if hasDotDot(root) { return "", errUnsafeRoot } // Use the os.* VFS implementation if none was specified. if vfs == nil { vfs = osVFS{} } unsafePath = filepath.FromSlash(unsafePath) var ( currentPath string remainingPath = unsafePath linksWalked int ) for remainingPath != "" { // On Windows, if we managed to end up at a path referencing a volume, // drop the volume to make sure we don't end up with broken paths or // escaping the root volume. remainingPath = stripVolume(remainingPath) // Get the next path component. var part string if i := strings.IndexRune(remainingPath, filepath.Separator); i == -1 { part, remainingPath = remainingPath, "" } else { part, remainingPath = remainingPath[:i], remainingPath[i+1:] } // Apply the component lexically to the path we are building. // currentPath does not contain any symlinks, and we are lexically // dealing with a single component, so it's okay to do a filepath.Clean // here. nextPath := filepath.Join(string(filepath.Separator), currentPath, part) if nextPath == string(filepath.Separator) { currentPath = "" continue } fullPath := root + string(filepath.Separator) + nextPath // Figure out whether the path is a symlink. fi, err := vfs.Lstat(fullPath) if err != nil && !IsNotExist(err) { return "", err } // Treat non-existent path components the same as non-symlinks (we // can't do any better here). if IsNotExist(err) || fi.Mode()&os.ModeSymlink == 0 { currentPath = nextPath continue } // It's a symlink, so get its contents and expand it by prepending it // to the yet-unparsed path. linksWalked++ if linksWalked > consts.MaxSymlinkLimit { return "", &os.PathError{Op: "SecureJoin", Path: root + string(filepath.Separator) + unsafePath, Err: syscall.ELOOP} } dest, err := vfs.Readlink(fullPath) if err != nil { return "", err } remainingPath = dest + string(filepath.Separator) + remainingPath // Absolute symlinks reset any work we've already done. if filepath.IsAbs(dest) { currentPath = "" } } // There should be no lexical components like ".." left in the path here, // but for safety clean up the path before joining it to the root. finalPath := filepath.Join(string(filepath.Separator), currentPath) return filepath.Join(root, finalPath), nil } // SecureJoin is a wrapper around [SecureJoinVFS] that just uses the [os].* library // of functions as the [VFS]. If in doubt, use this function over [SecureJoinVFS]. func SecureJoin(root, unsafePath string) (string, error) { return SecureJoinVFS(root, unsafePath, nil) } ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/pathrs-lite/README.md ================================================ ## `pathrs-lite` ## `github.com/cyphar/filepath-securejoin/pathrs-lite` provides a minimal **pure Go** implementation of the core bits of [libpathrs][]. This is not intended to be a complete replacement for libpathrs, instead it is mainly intended to be useful as a transition tool for existing Go projects. `pathrs-lite` also provides a very easy way to switch to `libpathrs` (even for downstreams where `pathrs-lite` is being used in a third-party package and is not interested in using CGo). At build time, if you use the `libpathrs` build tag then `pathrs-lite` will use `libpathrs` directly instead of the pure Go implementation. The two backends are functionally equivalent (and we have integration tests to verify this), so this migration should be very easy with no user-visible impact. [libpathrs]: https://github.com/cyphar/libpathrs ### License ### Most of this subpackage is licensed under the Mozilla Public License (version 2.0). For more information, see the top-level [COPYING.md][] and [LICENSE.MPL-2.0][] files, as well as the individual license headers for each file. ``` Copyright (C) 2024-2025 Aleksa Sarai Copyright (C) 2024-2025 SUSE LLC This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. ``` [COPYING.md]: ../COPYING.md [LICENSE.MPL-2.0]: ../LICENSE.MPL-2.0 ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/pathrs-lite/doc.go ================================================ // SPDX-License-Identifier: MPL-2.0 //go:build linux // Copyright (C) 2024-2025 Aleksa Sarai // Copyright (C) 2024-2025 SUSE LLC // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. // Package pathrs (pathrs-lite) is a less complete pure Go implementation of // some of the APIs provided by [libpathrs]. // // [libpathrs]: https://github.com/cyphar/libpathrs package pathrs ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/pathrs-lite/internal/assert/assert.go ================================================ // SPDX-License-Identifier: MPL-2.0 // Copyright (C) 2025 Aleksa Sarai // Copyright (C) 2025 SUSE LLC // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. // Package assert provides some basic assertion helpers for Go. package assert import ( "fmt" ) // Assert panics if the predicate is false with the provided argument. func Assert(predicate bool, msg any) { if !predicate { panic(msg) } } // Assertf panics if the predicate is false and formats the message using the // same formatting as [fmt.Printf]. // // [fmt.Printf]: https://pkg.go.dev/fmt#Printf func Assertf(predicate bool, fmtMsg string, args ...any) { Assert(predicate, fmt.Sprintf(fmtMsg, args...)) } ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/pathrs-lite/internal/errors_linux.go ================================================ // SPDX-License-Identifier: MPL-2.0 //go:build linux // Copyright (C) 2024-2025 Aleksa Sarai // Copyright (C) 2024-2025 SUSE LLC // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. // Package internal contains unexported common code for filepath-securejoin. package internal import ( "errors" "golang.org/x/sys/unix" ) type xdevErrorish struct { description string } func (err xdevErrorish) Error() string { return err.description } func (err xdevErrorish) Is(target error) bool { return target == unix.EXDEV } var ( // ErrPossibleAttack indicates that some attack was detected. ErrPossibleAttack error = xdevErrorish{"possible attack detected"} // ErrPossibleBreakout indicates that during an operation we ended up in a // state that could be a breakout but we detected it. ErrPossibleBreakout error = xdevErrorish{"possible breakout detected"} // ErrInvalidDirectory indicates an unlinked directory. ErrInvalidDirectory = errors.New("wandered into deleted directory") // ErrDeletedInode indicates an unlinked file (non-directory). ErrDeletedInode = errors.New("cannot verify path of deleted inode") ) ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/pathrs-lite/internal/fd/at_linux.go ================================================ // SPDX-License-Identifier: MPL-2.0 //go:build linux // Copyright (C) 2024-2025 Aleksa Sarai // Copyright (C) 2024-2025 SUSE LLC // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. package fd import ( "fmt" "os" "path/filepath" "runtime" "golang.org/x/sys/unix" "github.com/cyphar/filepath-securejoin/pathrs-lite/internal/gocompat" ) // prepareAtWith returns -EBADF (an invalid fd) if dir is nil, otherwise using // the dir.Fd(). We use -EBADF because in filepath-securejoin we generally // don't want to allow relative-to-cwd paths. The returned path is an // *informational* string that describes a reasonable pathname for the given // *at(2) arguments. You must not use the full path for any actual filesystem // operations. func prepareAt(dir Fd, path string) (dirFd int, unsafeUnmaskedPath string) { dirFd, dirPath := -int(unix.EBADF), "." if dir != nil { dirFd, dirPath = int(dir.Fd()), dir.Name() } if !filepath.IsAbs(path) { // only prepend the dirfd path for relative paths path = dirPath + "/" + path } // NOTE: If path is "." or "", the returned path won't be filepath.Clean, // but that's okay since this path is either used for errors (in which case // a trailing "/" or "/." is important information) or will be // filepath.Clean'd later (in the case of fd.Openat). return dirFd, path } // Openat is an [Fd]-based wrapper around unix.Openat. func Openat(dir Fd, path string, flags int, mode int) (*os.File, error) { //nolint:unparam // wrapper func dirFd, fullPath := prepareAt(dir, path) // Make sure we always set O_CLOEXEC. flags |= unix.O_CLOEXEC fd, err := unix.Openat(dirFd, path, flags, uint32(mode)) if err != nil { return nil, &os.PathError{Op: "openat", Path: fullPath, Err: err} } runtime.KeepAlive(dir) // openat is only used with lexically-safe paths so we can use // filepath.Clean here, and also the path itself is not going to be used // for actual path operations. fullPath = filepath.Clean(fullPath) return os.NewFile(uintptr(fd), fullPath), nil } // Fstatat is an [Fd]-based wrapper around unix.Fstatat. func Fstatat(dir Fd, path string, flags int) (unix.Stat_t, error) { dirFd, fullPath := prepareAt(dir, path) var stat unix.Stat_t if err := unix.Fstatat(dirFd, path, &stat, flags); err != nil { return stat, &os.PathError{Op: "fstatat", Path: fullPath, Err: err} } runtime.KeepAlive(dir) return stat, nil } // Faccessat is an [Fd]-based wrapper around unix.Faccessat. func Faccessat(dir Fd, path string, mode uint32, flags int) error { dirFd, fullPath := prepareAt(dir, path) err := unix.Faccessat(dirFd, path, mode, flags) if err != nil { err = &os.PathError{Op: "faccessat", Path: fullPath, Err: err} } runtime.KeepAlive(dir) return err } // Readlinkat is an [Fd]-based wrapper around unix.Readlinkat. func Readlinkat(dir Fd, path string) (string, error) { dirFd, fullPath := prepareAt(dir, path) size := 4096 for { linkBuf := make([]byte, size) n, err := unix.Readlinkat(dirFd, path, linkBuf) if err != nil { return "", &os.PathError{Op: "readlinkat", Path: fullPath, Err: err} } runtime.KeepAlive(dir) if n != size { return string(linkBuf[:n]), nil } // Possible truncation, resize the buffer. size *= 2 } } const ( // STATX_MNT_ID_UNIQUE is provided in golang.org/x/sys@v0.20.0, but in order to // avoid bumping the requirement for a single constant we can just define it // ourselves. _STATX_MNT_ID_UNIQUE = 0x4000 //nolint:revive // unix.* name // We don't care which mount ID we get. The kernel will give us the unique // one if it is supported. If the kernel doesn't support // STATX_MNT_ID_UNIQUE, the bit is ignored and the returned request mask // will only contain STATX_MNT_ID (if supported). wantStatxMntMask = _STATX_MNT_ID_UNIQUE | unix.STATX_MNT_ID ) var hasStatxMountID = gocompat.SyncOnceValue(func() bool { var stx unix.Statx_t err := unix.Statx(-int(unix.EBADF), "/", 0, wantStatxMntMask, &stx) return err == nil && stx.Mask&wantStatxMntMask != 0 }) // GetMountID gets the mount identifier associated with the fd and path // combination. It is effectively a wrapper around fetching // STATX_MNT_ID{,_UNIQUE} with unix.Statx, but with a fallback to 0 if the // kernel doesn't support the feature. func GetMountID(dir Fd, path string) (uint64, error) { // If we don't have statx(STATX_MNT_ID*) support, we can't do anything. if !hasStatxMountID() { return 0, nil } dirFd, fullPath := prepareAt(dir, path) var stx unix.Statx_t err := unix.Statx(dirFd, path, unix.AT_EMPTY_PATH|unix.AT_SYMLINK_NOFOLLOW, wantStatxMntMask, &stx) if stx.Mask&wantStatxMntMask == 0 { // It's not a kernel limitation, for some reason we couldn't get a // mount ID. Assume it's some kind of attack. err = fmt.Errorf("could not get mount id: %w", err) } if err != nil { return 0, &os.PathError{Op: "statx(STATX_MNT_ID_...)", Path: fullPath, Err: err} } runtime.KeepAlive(dir) return stx.Mnt_id, nil } ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/pathrs-lite/internal/fd/fd.go ================================================ // SPDX-License-Identifier: MPL-2.0 // Copyright (C) 2025 Aleksa Sarai // Copyright (C) 2025 SUSE LLC // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. // Package fd provides a drop-in interface-based replacement of [*os.File] that // allows for things like noop-Close wrappers to be used. // // [*os.File]: https://pkg.go.dev/os#File package fd import ( "io" "os" ) // Fd is an interface that mirrors most of the API of [*os.File], allowing you // to create wrappers that can be used in place of [*os.File]. // // [*os.File]: https://pkg.go.dev/os#File type Fd interface { io.Closer Name() string Fd() uintptr } // Compile-time interface checks. var ( _ Fd = (*os.File)(nil) _ Fd = noClose{} ) type noClose struct{ inner Fd } func (f noClose) Name() string { return f.inner.Name() } func (f noClose) Fd() uintptr { return f.inner.Fd() } func (f noClose) Close() error { return nil } // NopCloser returns an [*os.File]-like object where the [Close] method is now // a no-op. // // Note that for [*os.File] and similar objects, the Go garbage collector will // still call [Close] on the underlying file unless you use // [runtime.SetFinalizer] to disable this behaviour. This is up to the caller // to do (if necessary). // // [*os.File]: https://pkg.go.dev/os#File // [Close]: https://pkg.go.dev/io#Closer // [runtime.SetFinalizer]: https://pkg.go.dev/runtime#SetFinalizer func NopCloser(f Fd) Fd { return noClose{inner: f} } ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/pathrs-lite/internal/fd/fd_linux.go ================================================ // SPDX-License-Identifier: MPL-2.0 //go:build linux // Copyright (C) 2024-2025 Aleksa Sarai // Copyright (C) 2024-2025 SUSE LLC // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. package fd import ( "fmt" "os" "runtime" "golang.org/x/sys/unix" "github.com/cyphar/filepath-securejoin/pathrs-lite/internal" ) // DupWithName creates a new file descriptor referencing the same underlying // file, but with the provided name instead of fd.Name(). func DupWithName(fd Fd, name string) (*os.File, error) { fd2, err := unix.FcntlInt(fd.Fd(), unix.F_DUPFD_CLOEXEC, 0) if err != nil { return nil, os.NewSyscallError("fcntl(F_DUPFD_CLOEXEC)", err) } runtime.KeepAlive(fd) return os.NewFile(uintptr(fd2), name), nil } // Dup creates a new file description referencing the same underlying file. func Dup(fd Fd) (*os.File, error) { return DupWithName(fd, fd.Name()) } // Fstat is an [Fd]-based wrapper around unix.Fstat. func Fstat(fd Fd) (unix.Stat_t, error) { var stat unix.Stat_t if err := unix.Fstat(int(fd.Fd()), &stat); err != nil { return stat, &os.PathError{Op: "fstat", Path: fd.Name(), Err: err} } runtime.KeepAlive(fd) return stat, nil } // Fstatfs is an [Fd]-based wrapper around unix.Fstatfs. func Fstatfs(fd Fd) (unix.Statfs_t, error) { var statfs unix.Statfs_t if err := unix.Fstatfs(int(fd.Fd()), &statfs); err != nil { return statfs, &os.PathError{Op: "fstatfs", Path: fd.Name(), Err: err} } runtime.KeepAlive(fd) return statfs, nil } // IsDeadInode detects whether the file has been unlinked from a filesystem and // is thus a "dead inode" from the kernel's perspective. func IsDeadInode(file Fd) error { // If the nlink of a file drops to 0, there is an attacker deleting // directories during our walk, which could result in weird /proc values. // It's better to error out in this case. stat, err := Fstat(file) if err != nil { return fmt.Errorf("check for dead inode: %w", err) } if stat.Nlink == 0 { err := internal.ErrDeletedInode if stat.Mode&unix.S_IFMT == unix.S_IFDIR { err = internal.ErrInvalidDirectory } return fmt.Errorf("%w %q", err, file.Name()) } return nil } ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/pathrs-lite/internal/fd/mount_linux.go ================================================ // SPDX-License-Identifier: MPL-2.0 //go:build linux // Copyright (C) 2024-2025 Aleksa Sarai // Copyright (C) 2024-2025 SUSE LLC // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. package fd import ( "os" "runtime" "golang.org/x/sys/unix" ) // Fsopen is an [Fd]-based wrapper around unix.Fsopen. func Fsopen(fsName string, flags int) (*os.File, error) { // Make sure we always set O_CLOEXEC. flags |= unix.FSOPEN_CLOEXEC fd, err := unix.Fsopen(fsName, flags) if err != nil { return nil, os.NewSyscallError("fsopen "+fsName, err) } return os.NewFile(uintptr(fd), "fscontext:"+fsName), nil } // Fsmount is an [Fd]-based wrapper around unix.Fsmount. func Fsmount(ctx Fd, flags, mountAttrs int) (*os.File, error) { // Make sure we always set O_CLOEXEC. flags |= unix.FSMOUNT_CLOEXEC fd, err := unix.Fsmount(int(ctx.Fd()), flags, mountAttrs) if err != nil { return nil, os.NewSyscallError("fsmount "+ctx.Name(), err) } return os.NewFile(uintptr(fd), "fsmount:"+ctx.Name()), nil } // OpenTree is an [Fd]-based wrapper around unix.OpenTree. func OpenTree(dir Fd, path string, flags uint) (*os.File, error) { dirFd, fullPath := prepareAt(dir, path) // Make sure we always set O_CLOEXEC. flags |= unix.OPEN_TREE_CLOEXEC fd, err := unix.OpenTree(dirFd, path, flags) if err != nil { return nil, &os.PathError{Op: "open_tree", Path: fullPath, Err: err} } runtime.KeepAlive(dir) return os.NewFile(uintptr(fd), fullPath), nil } ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/pathrs-lite/internal/fd/openat2_linux.go ================================================ // SPDX-License-Identifier: MPL-2.0 //go:build linux // Copyright (C) 2024-2025 Aleksa Sarai // Copyright (C) 2024-2025 SUSE LLC // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. package fd import ( "errors" "os" "runtime" "golang.org/x/sys/unix" ) func scopedLookupShouldRetry(how *unix.OpenHow, err error) bool { // RESOLVE_IN_ROOT (and RESOLVE_BENEATH) can return -EAGAIN if we resolve // ".." while a mount or rename occurs anywhere on the system. This could // happen spuriously, or as the result of an attacker trying to mess with // us during lookup. // // In addition, scoped lookups have a "safety check" at the end of // complete_walk which will return -EXDEV if the final path is not in the // root. return how.Resolve&(unix.RESOLVE_IN_ROOT|unix.RESOLVE_BENEATH) != 0 && (errors.Is(err, unix.EAGAIN) || errors.Is(err, unix.EXDEV)) } // This is a fairly arbitrary limit we have just to avoid an attacker being // able to make us spin in an infinite retry loop -- callers can choose to // retry on EAGAIN if they prefer. const scopedLookupMaxRetries = 128 // Openat2 is an [Fd]-based wrapper around unix.Openat2, but with some retry // logic in case of EAGAIN errors. // // NOTE: This is a variable so that the lookup tests can force openat2 to fail. var Openat2 = func(dir Fd, path string, how *unix.OpenHow) (*os.File, error) { dirFd, fullPath := prepareAt(dir, path) // Make sure we always set O_CLOEXEC. how.Flags |= unix.O_CLOEXEC var tries int for { fd, err := unix.Openat2(dirFd, path, how) if err != nil { if scopedLookupShouldRetry(how, err) && tries < scopedLookupMaxRetries { // We retry a couple of times to avoid the spurious errors, and // if we are being attacked then returning -EAGAIN is the best // we can do. tries++ continue } return nil, &os.PathError{Op: "openat2", Path: fullPath, Err: err} } runtime.KeepAlive(dir) return os.NewFile(uintptr(fd), fullPath), nil } } ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/pathrs-lite/internal/gocompat/README.md ================================================ ## gocompat ## This directory contains backports of stdlib functions from later Go versions so the filepath-securejoin can continue to be used by projects that are stuck with Go 1.18 support. Note that often filepath-securejoin is added in security patches for old releases, so avoiding the need to bump Go compiler requirements is a huge plus to downstreams. The source code is licensed under the same license as the Go stdlib. See the source files for the precise license information. ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/pathrs-lite/internal/gocompat/doc.go ================================================ // SPDX-License-Identifier: BSD-3-Clause //go:build linux && go1.20 // Copyright (C) 2025 SUSE LLC. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package gocompat includes compatibility shims (backported from future Go // stdlib versions) to permit filepath-securejoin to be used with older Go // versions (often filepath-securejoin is added in security patches for old // releases, so avoiding the need to bump Go compiler requirements is a huge // plus to downstreams). package gocompat ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/pathrs-lite/internal/gocompat/gocompat_atomic_go119.go ================================================ // SPDX-License-Identifier: BSD-3-Clause //go:build linux && go1.19 // Copyright 2022 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package gocompat import ( "sync/atomic" ) // A Bool is an atomic boolean value. // The zero value is false. // // Bool must not be copied after first use. type Bool = atomic.Bool ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/pathrs-lite/internal/gocompat/gocompat_atomic_unsupported.go ================================================ // SPDX-License-Identifier: BSD-3-Clause //go:build linux && !go1.19 // Copyright (C) 2024-2025 SUSE LLC. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package gocompat import ( "sync/atomic" ) // noCopy may be added to structs which must not be copied // after the first use. // // See https://golang.org/issues/8005#issuecomment-190753527 // for details. // // Note that it must not be embedded, due to the Lock and Unlock methods. type noCopy struct{} // Lock is a no-op used by -copylocks checker from `go vet`. func (*noCopy) Lock() {} // b32 returns a uint32 0 or 1 representing b. func b32(b bool) uint32 { if b { return 1 } return 0 } // A Bool is an atomic boolean value. // The zero value is false. // // Bool must not be copied after first use. type Bool struct { _ noCopy v uint32 } // Load atomically loads and returns the value stored in x. func (x *Bool) Load() bool { return atomic.LoadUint32(&x.v) != 0 } // Store atomically stores val into x. func (x *Bool) Store(val bool) { atomic.StoreUint32(&x.v, b32(val)) } ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/pathrs-lite/internal/gocompat/gocompat_errors_go120.go ================================================ // SPDX-License-Identifier: BSD-3-Clause //go:build linux && go1.20 // Copyright (C) 2024 SUSE LLC. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package gocompat import ( "fmt" ) // WrapBaseError is a helper that is equivalent to fmt.Errorf("%w: %w"), except // that on pre-1.20 Go versions only errors.Is() works properly (errors.Unwrap) // is only guaranteed to give you baseErr. func WrapBaseError(baseErr, extraErr error) error { return fmt.Errorf("%w: %w", extraErr, baseErr) } ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/pathrs-lite/internal/gocompat/gocompat_errors_unsupported.go ================================================ // SPDX-License-Identifier: BSD-3-Clause //go:build linux && !go1.20 // Copyright (C) 2024 SUSE LLC. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package gocompat import ( "fmt" ) type wrappedError struct { inner error isError error } func (err wrappedError) Is(target error) bool { return err.isError == target } func (err wrappedError) Unwrap() error { return err.inner } func (err wrappedError) Error() string { return fmt.Sprintf("%v: %v", err.isError, err.inner) } // WrapBaseError is a helper that is equivalent to fmt.Errorf("%w: %w"), except // that on pre-1.20 Go versions only errors.Is() works properly (errors.Unwrap) // is only guaranteed to give you baseErr. func WrapBaseError(baseErr, extraErr error) error { return wrappedError{ inner: baseErr, isError: extraErr, } } ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/pathrs-lite/internal/gocompat/gocompat_generics_go121.go ================================================ // SPDX-License-Identifier: BSD-3-Clause //go:build linux && go1.21 // Copyright (C) 2024-2025 SUSE LLC. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package gocompat import ( "cmp" "slices" "sync" ) // SlicesDeleteFunc is equivalent to Go 1.21's slices.DeleteFunc. func SlicesDeleteFunc[S ~[]E, E any](slice S, delFn func(E) bool) S { return slices.DeleteFunc(slice, delFn) } // SlicesContains is equivalent to Go 1.21's slices.Contains. func SlicesContains[S ~[]E, E comparable](slice S, val E) bool { return slices.Contains(slice, val) } // SlicesClone is equivalent to Go 1.21's slices.Clone. func SlicesClone[S ~[]E, E any](slice S) S { return slices.Clone(slice) } // SyncOnceValue is equivalent to Go 1.21's sync.OnceValue. func SyncOnceValue[T any](f func() T) func() T { return sync.OnceValue(f) } // SyncOnceValues is equivalent to Go 1.21's sync.OnceValues. func SyncOnceValues[T1, T2 any](f func() (T1, T2)) func() (T1, T2) { return sync.OnceValues(f) } // CmpOrdered is equivalent to Go 1.21's cmp.Ordered generic type definition. type CmpOrdered = cmp.Ordered // CmpCompare is equivalent to Go 1.21's cmp.Compare. func CmpCompare[T CmpOrdered](x, y T) int { return cmp.Compare(x, y) } // Max2 is equivalent to Go 1.21's max builtin (but only for two parameters). func Max2[T CmpOrdered](x, y T) T { return max(x, y) } ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/pathrs-lite/internal/gocompat/gocompat_generics_unsupported.go ================================================ // SPDX-License-Identifier: BSD-3-Clause //go:build linux && !go1.21 // Copyright (C) 2021, 2022 The Go Authors. All rights reserved. // Copyright (C) 2024-2025 SUSE LLC. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE.BSD file. package gocompat import ( "sync" ) // These are very minimal implementations of functions that appear in Go 1.21's // stdlib, included so that we can build on older Go versions. Most are // borrowed directly from the stdlib, and a few are modified to be "obviously // correct" without needing to copy too many other helpers. // clearSlice is equivalent to Go 1.21's builtin clear. // Copied from the Go 1.24 stdlib implementation. func clearSlice[S ~[]E, E any](slice S) { var zero E for i := range slice { slice[i] = zero } } // slicesIndexFunc is equivalent to Go 1.21's slices.IndexFunc. // Copied from the Go 1.24 stdlib implementation. func slicesIndexFunc[S ~[]E, E any](s S, f func(E) bool) int { for i := range s { if f(s[i]) { return i } } return -1 } // SlicesDeleteFunc is equivalent to Go 1.21's slices.DeleteFunc. // Copied from the Go 1.24 stdlib implementation. func SlicesDeleteFunc[S ~[]E, E any](s S, del func(E) bool) S { i := slicesIndexFunc(s, del) if i == -1 { return s } // Don't start copying elements until we find one to delete. for j := i + 1; j < len(s); j++ { if v := s[j]; !del(v) { s[i] = v i++ } } clearSlice(s[i:]) // zero/nil out the obsolete elements, for GC return s[:i] } // SlicesContains is equivalent to Go 1.21's slices.Contains. // Similar to the stdlib slices.Contains, except that we don't have // slices.Index so we need to use slices.IndexFunc for this non-Func helper. func SlicesContains[S ~[]E, E comparable](s S, v E) bool { return slicesIndexFunc(s, func(e E) bool { return e == v }) >= 0 } // SlicesClone is equivalent to Go 1.21's slices.Clone. // Copied from the Go 1.24 stdlib implementation. func SlicesClone[S ~[]E, E any](s S) S { // Preserve nil in case it matters. if s == nil { return nil } return append(S([]E{}), s...) } // SyncOnceValue is equivalent to Go 1.21's sync.OnceValue. // Copied from the Go 1.25 stdlib implementation. func SyncOnceValue[T any](f func() T) func() T { // Use a struct so that there's a single heap allocation. d := struct { f func() T once sync.Once valid bool p any result T }{ f: f, } return func() T { d.once.Do(func() { defer func() { d.f = nil d.p = recover() if !d.valid { panic(d.p) } }() d.result = d.f() d.valid = true }) if !d.valid { panic(d.p) } return d.result } } // SyncOnceValues is equivalent to Go 1.21's sync.OnceValues. // Copied from the Go 1.25 stdlib implementation. func SyncOnceValues[T1, T2 any](f func() (T1, T2)) func() (T1, T2) { // Use a struct so that there's a single heap allocation. d := struct { f func() (T1, T2) once sync.Once valid bool p any r1 T1 r2 T2 }{ f: f, } return func() (T1, T2) { d.once.Do(func() { defer func() { d.f = nil d.p = recover() if !d.valid { panic(d.p) } }() d.r1, d.r2 = d.f() d.valid = true }) if !d.valid { panic(d.p) } return d.r1, d.r2 } } // CmpOrdered is equivalent to Go 1.21's cmp.Ordered generic type definition. // Copied from the Go 1.25 stdlib implementation. type CmpOrdered interface { ~int | ~int8 | ~int16 | ~int32 | ~int64 | ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr | ~float32 | ~float64 | ~string } // isNaN reports whether x is a NaN without requiring the math package. // This will always return false if T is not floating-point. // Copied from the Go 1.25 stdlib implementation. func isNaN[T CmpOrdered](x T) bool { return x != x } // CmpCompare is equivalent to Go 1.21's cmp.Compare. // Copied from the Go 1.25 stdlib implementation. func CmpCompare[T CmpOrdered](x, y T) int { xNaN := isNaN(x) yNaN := isNaN(y) if xNaN { if yNaN { return 0 } return -1 } if yNaN { return +1 } if x < y { return -1 } if x > y { return +1 } return 0 } // Max2 is equivalent to Go 1.21's max builtin for two parameters. func Max2[T CmpOrdered](x, y T) T { m := x if y > m { m = y } return m } ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/pathrs-lite/internal/gopathrs/doc.go ================================================ // SPDX-License-Identifier: MPL-2.0 //go:build linux // Copyright (C) 2024-2025 Aleksa Sarai // Copyright (C) 2024-2025 SUSE LLC // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. // Package gopathrs is a less complete pure Go implementation of some of the // APIs provided by [libpathrs]. // // [libpathrs]: https://github.com/cyphar/libpathrs package gopathrs ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/pathrs-lite/internal/gopathrs/lookup_linux.go ================================================ // SPDX-License-Identifier: MPL-2.0 //go:build linux // Copyright (C) 2024-2025 Aleksa Sarai // Copyright (C) 2024-2025 SUSE LLC // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. package gopathrs import ( "errors" "fmt" "os" "path" "path/filepath" "strings" "golang.org/x/sys/unix" "github.com/cyphar/filepath-securejoin/internal/consts" "github.com/cyphar/filepath-securejoin/pathrs-lite/internal/fd" "github.com/cyphar/filepath-securejoin/pathrs-lite/internal/gocompat" "github.com/cyphar/filepath-securejoin/pathrs-lite/internal/linux" "github.com/cyphar/filepath-securejoin/pathrs-lite/internal/procfs" ) type symlinkStackEntry struct { // (dir, remainingPath) is what we would've returned if the link didn't // exist. This matches what openat2(RESOLVE_IN_ROOT) would return in // this case. dir *os.File remainingPath string // linkUnwalked is the remaining path components from the original // Readlink which we have yet to walk. When this slice is empty, we // drop the link from the stack. linkUnwalked []string } func (se symlinkStackEntry) String() string { return fmt.Sprintf("<%s>/%s [->%s]", se.dir.Name(), se.remainingPath, strings.Join(se.linkUnwalked, "/")) } func (se symlinkStackEntry) Close() { _ = se.dir.Close() } type symlinkStack []*symlinkStackEntry func (s *symlinkStack) IsEmpty() bool { return s == nil || len(*s) == 0 } func (s *symlinkStack) Close() { if s != nil { for _, link := range *s { link.Close() } // TODO: Switch to clear once we switch to Go 1.21. *s = nil } } var ( errEmptyStack = errors.New("[internal] stack is empty") errBrokenSymlinkStack = errors.New("[internal error] broken symlink stack") ) func (s *symlinkStack) popPart(part string) error { if s == nil || s.IsEmpty() { // If there is nothing in the symlink stack, then the part was from the // real path provided by the user, and this is a no-op. return errEmptyStack } if part == "." { // "." components are no-ops -- we drop them when doing SwapLink. return nil } tailEntry := (*s)[len(*s)-1] // Double-check that we are popping the component we expect. if len(tailEntry.linkUnwalked) == 0 { return fmt.Errorf("%w: trying to pop component %q of empty stack entry %s", errBrokenSymlinkStack, part, tailEntry) } headPart := tailEntry.linkUnwalked[0] if headPart != part { return fmt.Errorf("%w: trying to pop component %q but the last stack entry is %s (%q)", errBrokenSymlinkStack, part, tailEntry, headPart) } // Drop the component, but keep the entry around in case we are dealing // with a "tail-chained" symlink. tailEntry.linkUnwalked = tailEntry.linkUnwalked[1:] return nil } func (s *symlinkStack) PopPart(part string) error { if err := s.popPart(part); err != nil { if errors.Is(err, errEmptyStack) { // Skip empty stacks. err = nil } return err } // Clean up any of the trailing stack entries that are empty. for lastGood := len(*s) - 1; lastGood >= 0; lastGood-- { entry := (*s)[lastGood] if len(entry.linkUnwalked) > 0 { break } entry.Close() (*s) = (*s)[:lastGood] } return nil } func (s *symlinkStack) push(dir *os.File, remainingPath, linkTarget string) error { if s == nil { return nil } // Split the link target and clean up any "" parts. linkTargetParts := gocompat.SlicesDeleteFunc( strings.Split(linkTarget, "/"), func(part string) bool { return part == "" || part == "." }) // Copy the directory so the caller doesn't close our copy. dirCopy, err := fd.Dup(dir) if err != nil { return err } // Add to the stack. *s = append(*s, &symlinkStackEntry{ dir: dirCopy, remainingPath: remainingPath, linkUnwalked: linkTargetParts, }) return nil } func (s *symlinkStack) SwapLink(linkPart string, dir *os.File, remainingPath, linkTarget string) error { // If we are currently inside a symlink resolution, remove the symlink // component from the last symlink entry, but don't remove the entry even // if it's empty. If we are a "tail-chained" symlink (a trailing symlink we // hit during a symlink resolution) we need to keep the old symlink until // we finish the resolution. if err := s.popPart(linkPart); err != nil { if !errors.Is(err, errEmptyStack) { return err } // Push the component regardless of whether the stack was empty. } return s.push(dir, remainingPath, linkTarget) } func (s *symlinkStack) PopTopSymlink() (*os.File, string, bool) { if s == nil || s.IsEmpty() { return nil, "", false } tailEntry := (*s)[0] *s = (*s)[1:] return tailEntry.dir, tailEntry.remainingPath, true } // PartialLookupInRoot tries to lookup as much of the request path as possible // within the provided root (a-la RESOLVE_IN_ROOT) and opens the final existing // component of the requested path, returning a file handle to the final // existing component and a string containing the remaining path components. func PartialLookupInRoot(root fd.Fd, unsafePath string) (*os.File, string, error) { return lookupInRoot(root, unsafePath, true) } func completeLookupInRoot(root fd.Fd, unsafePath string) (*os.File, error) { handle, remainingPath, err := lookupInRoot(root, unsafePath, false) if remainingPath != "" && err == nil { // should never happen err = fmt.Errorf("[bug] non-empty remaining path when doing a non-partial lookup: %q", remainingPath) } // lookupInRoot(partial=false) will always close the handle if an error is // returned, so no need to double-check here. return handle, err } func lookupInRoot(root fd.Fd, unsafePath string, partial bool) (Handle *os.File, _ string, _ error) { unsafePath = filepath.ToSlash(unsafePath) // noop // This is very similar to SecureJoin, except that we operate on the // components using file descriptors. We then return the last component we // managed open, along with the remaining path components not opened. // Try to use openat2 if possible. // // NOTE: If openat2(2) works normally but fails for this lookup, it is // probably not a good idea to fall-back to the O_PATH resolver. An // attacker could find a bug in the O_PATH resolver and uncontionally // falling back to the O_PATH resolver would form a downgrade attack. if handle, remainingPath, err := lookupOpenat2(root, unsafePath, partial); err == nil || linux.HasOpenat2() { return handle, remainingPath, err } // Get the "actual" root path from /proc/self/fd. This is necessary if the // root is some magic-link like /proc/$pid/root, in which case we want to // make sure when we do procfs.CheckProcSelfFdPath that we are using the // correct root path. logicalRootPath, err := procfs.ProcSelfFdReadlink(root) if err != nil { return nil, "", fmt.Errorf("get real root path: %w", err) } currentDir, err := fd.Dup(root) if err != nil { return nil, "", fmt.Errorf("clone root fd: %w", err) } defer func() { // If a handle is not returned, close the internal handle. if Handle == nil { _ = currentDir.Close() } }() // symlinkStack is used to emulate how openat2(RESOLVE_IN_ROOT) treats // dangling symlinks. If we hit a non-existent path while resolving a // symlink, we need to return the (dir, remainingPath) that we had when we // hit the symlink (treating the symlink as though it were a regular file). // The set of (dir, remainingPath) sets is stored within the symlinkStack // and we add and remove parts when we hit symlink and non-symlink // components respectively. We need a stack because of recursive symlinks // (symlinks that contain symlink components in their target). // // Note that the stack is ONLY used for book-keeping. All of the actual // path walking logic is still based on currentPath/remainingPath and // currentDir (as in SecureJoin). var symStack *symlinkStack if partial { symStack = new(symlinkStack) defer symStack.Close() } var ( linksWalked int currentPath string remainingPath = unsafePath ) for remainingPath != "" { // Save the current remaining path so if the part is not real we can // return the path including the component. oldRemainingPath := remainingPath // Get the next path component. var part string if i := strings.IndexByte(remainingPath, '/'); i == -1 { part, remainingPath = remainingPath, "" } else { part, remainingPath = remainingPath[:i], remainingPath[i+1:] } // If we hit an empty component, we need to treat it as though it is // "." so that trailing "/" and "//" components on a non-directory // correctly return the right error code. if part == "" { part = "." } // Apply the component lexically to the path we are building. // currentPath does not contain any symlinks, and we are lexically // dealing with a single component, so it's okay to do a filepath.Clean // here. nextPath := path.Join("/", currentPath, part) // If we logically hit the root, just clone the root rather than // opening the part and doing all of the other checks. if nextPath == "/" { if err := symStack.PopPart(part); err != nil { return nil, "", fmt.Errorf("walking into root with part %q failed: %w", part, err) } // Jump to root. rootClone, err := fd.Dup(root) if err != nil { return nil, "", fmt.Errorf("clone root fd: %w", err) } _ = currentDir.Close() currentDir = rootClone currentPath = nextPath continue } // Try to open the next component. nextDir, err := fd.Openat(currentDir, part, unix.O_PATH|unix.O_NOFOLLOW|unix.O_CLOEXEC, 0) switch err { case nil: st, err := nextDir.Stat() if err != nil { _ = nextDir.Close() return nil, "", fmt.Errorf("stat component %q: %w", part, err) } switch st.Mode() & os.ModeType { //nolint:exhaustive // just a glorified if statement case os.ModeSymlink: // readlinkat implies AT_EMPTY_PATH since Linux 2.6.39. See // Linux commit 65cfc6722361 ("readlinkat(), fchownat() and // fstatat() with empty relative pathnames"). linkDest, err := fd.Readlinkat(nextDir, "") // We don't need the handle anymore. _ = nextDir.Close() if err != nil { return nil, "", err } linksWalked++ if linksWalked > consts.MaxSymlinkLimit { return nil, "", &os.PathError{Op: "securejoin.lookupInRoot", Path: logicalRootPath + "/" + unsafePath, Err: unix.ELOOP} } // Swap out the symlink's component for the link entry itself. if err := symStack.SwapLink(part, currentDir, oldRemainingPath, linkDest); err != nil { return nil, "", fmt.Errorf("walking into symlink %q failed: push symlink: %w", part, err) } // Update our logical remaining path. remainingPath = linkDest + "/" + remainingPath // Absolute symlinks reset any work we've already done. if path.IsAbs(linkDest) { // Jump to root. rootClone, err := fd.Dup(root) if err != nil { return nil, "", fmt.Errorf("clone root fd: %w", err) } _ = currentDir.Close() currentDir = rootClone currentPath = "/" } default: // If we are dealing with a directory, simply walk into it. _ = currentDir.Close() currentDir = nextDir currentPath = nextPath // The part was real, so drop it from the symlink stack. if err := symStack.PopPart(part); err != nil { return nil, "", fmt.Errorf("walking into directory %q failed: %w", part, err) } // If we are operating on a .., make sure we haven't escaped. // We only have to check for ".." here because walking down // into a regular component component cannot cause you to // escape. This mirrors the logic in RESOLVE_IN_ROOT, except we // have to check every ".." rather than only checking after a // rename or mount on the system. if part == ".." { // Make sure the root hasn't moved. if err := procfs.CheckProcSelfFdPath(logicalRootPath, root); err != nil { return nil, "", fmt.Errorf("root path moved during lookup: %w", err) } // Make sure the path is what we expect. fullPath := logicalRootPath + nextPath if err := procfs.CheckProcSelfFdPath(fullPath, currentDir); err != nil { return nil, "", fmt.Errorf("walking into %q had unexpected result: %w", part, err) } } } default: if !partial { return nil, "", err } // If there are any remaining components in the symlink stack, we // are still within a symlink resolution and thus we hit a dangling // symlink. So pretend that the first symlink in the stack we hit // was an ENOENT (to match openat2). if oldDir, remainingPath, ok := symStack.PopTopSymlink(); ok { _ = currentDir.Close() return oldDir, remainingPath, err } // We have hit a final component that doesn't exist, so we have our // partial open result. Note that we have to use the OLD remaining // path, since the lookup failed. return currentDir, oldRemainingPath, err } } // If the unsafePath had a trailing slash, we need to make sure we try to // do a relative "." open so that we will correctly return an error when // the final component is a non-directory (to match openat2). In the // context of openat2, a trailing slash and a trailing "/." are completely // equivalent. if strings.HasSuffix(unsafePath, "/") { nextDir, err := fd.Openat(currentDir, ".", unix.O_PATH|unix.O_NOFOLLOW|unix.O_CLOEXEC, 0) if err != nil { if !partial { _ = currentDir.Close() currentDir = nil } return currentDir, "", err } _ = currentDir.Close() currentDir = nextDir } // All of the components existed! return currentDir, "", nil } ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/pathrs-lite/internal/gopathrs/mkdir_linux.go ================================================ // SPDX-License-Identifier: MPL-2.0 //go:build linux // Copyright (C) 2024-2025 Aleksa Sarai // Copyright (C) 2024-2025 SUSE LLC // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. package gopathrs import ( "errors" "fmt" "os" "path/filepath" "strings" "golang.org/x/sys/unix" "github.com/cyphar/filepath-securejoin/pathrs-lite/internal/fd" "github.com/cyphar/filepath-securejoin/pathrs-lite/internal/gocompat" "github.com/cyphar/filepath-securejoin/pathrs-lite/internal/linux" "github.com/cyphar/filepath-securejoin/pathrs-lite/internal/procfs" ) // ErrInvalidMode is returned from [MkdirAll] when the requested mode is // invalid. var ErrInvalidMode = errors.New("invalid permission mode") // modePermExt is like os.ModePerm except that it also includes the set[ug]id // and sticky bits. const modePermExt = os.ModePerm | os.ModeSetuid | os.ModeSetgid | os.ModeSticky //nolint:cyclop // this function needs to handle a lot of cases func toUnixMode(mode os.FileMode) (uint32, error) { sysMode := uint32(mode.Perm()) if mode&os.ModeSetuid != 0 { sysMode |= unix.S_ISUID } if mode&os.ModeSetgid != 0 { sysMode |= unix.S_ISGID } if mode&os.ModeSticky != 0 { sysMode |= unix.S_ISVTX } // We don't allow file type bits. if mode&os.ModeType != 0 { return 0, fmt.Errorf("%w %+.3o (%s): type bits not permitted", ErrInvalidMode, mode, mode) } // We don't allow other unknown modes. if mode&^modePermExt != 0 || sysMode&unix.S_IFMT != 0 { return 0, fmt.Errorf("%w %+.3o (%s): unknown mode bits", ErrInvalidMode, mode, mode) } return sysMode, nil } // MkdirAllHandle is equivalent to [MkdirAll], except that it is safer to use // in two respects: // // - The caller provides the root directory as an *[os.File] (preferably O_PATH) // handle. This means that the caller can be sure which root directory is // being used. Note that this can be emulated by using /proc/self/fd/... as // the root path with [os.MkdirAll]. // // - Once all of the directories have been created, an *[os.File] O_PATH handle // to the directory at unsafePath is returned to the caller. This is done in // an effectively-race-free way (an attacker would only be able to swap the // final directory component), which is not possible to emulate with // [MkdirAll]. // // In addition, the returned handle is obtained far more efficiently than doing // a brand new lookup of unsafePath (such as with [SecureJoin] or openat2) after // doing [MkdirAll]. If you intend to open the directory after creating it, you // should use MkdirAllHandle. // // [SecureJoin]: https://pkg.go.dev/github.com/cyphar/filepath-securejoin#SecureJoin func MkdirAllHandle(root *os.File, unsafePath string, mode os.FileMode) (_ *os.File, Err error) { unixMode, err := toUnixMode(mode) if err != nil { return nil, err } // On Linux, mkdirat(2) (and os.Mkdir) silently ignore the suid and sgid // bits. We could also silently ignore them but since we have very few // users it seems more prudent to return an error so users notice that // these bits will not be set. if unixMode&^0o1777 != 0 { return nil, fmt.Errorf("%w for mkdir %+.3o: suid and sgid are ignored by mkdir", ErrInvalidMode, mode) } // Try to open as much of the path as possible. currentDir, remainingPath, err := PartialLookupInRoot(root, unsafePath) defer func() { if Err != nil { _ = currentDir.Close() } }() if err != nil && !errors.Is(err, unix.ENOENT) { return nil, fmt.Errorf("find existing subpath of %q: %w", unsafePath, err) } // If there is an attacker deleting directories as we walk into them, // detect this proactively. Note this is guaranteed to detect if the // attacker deleted any part of the tree up to currentDir. // // Once we walk into a dead directory, partialLookupInRoot would not be // able to walk further down the tree (directories must be empty before // they are deleted), and if the attacker has removed the entire tree we // can be sure that anything that was originally inside a dead directory // must also be deleted and thus is a dead directory in its own right. // // This is mostly a quality-of-life check, because mkdir will simply fail // later if the attacker deletes the tree after this check. if err := fd.IsDeadInode(currentDir); err != nil { return nil, fmt.Errorf("finding existing subpath of %q: %w", unsafePath, err) } // Re-open the path to match the O_DIRECTORY reopen loop later (so that we // always return a non-O_PATH handle). We also check that we actually got a // directory. if reopenDir, err := procfs.ReopenFd(currentDir, unix.O_DIRECTORY|unix.O_CLOEXEC); errors.Is(err, unix.ENOTDIR) { return nil, fmt.Errorf("cannot create subdirectories in %q: %w", currentDir.Name(), unix.ENOTDIR) } else if err != nil { return nil, fmt.Errorf("re-opening handle to %q: %w", currentDir.Name(), err) } else { //nolint:revive // indent-error-flow lint doesn't make sense here _ = currentDir.Close() currentDir = reopenDir } remainingParts := strings.Split(remainingPath, string(filepath.Separator)) if gocompat.SlicesContains(remainingParts, "..") { // The path contained ".." components after the end of the "real" // components. We could try to safely resolve ".." here but that would // add a bunch of extra logic for something that it's not clear even // needs to be supported. So just return an error. // // If we do filepath.Clean(remainingPath) then we end up with the // problem that ".." can erase a trailing dangling symlink and produce // a path that doesn't quite match what the user asked for. return nil, fmt.Errorf("%w: yet-to-be-created path %q contains '..' components", unix.ENOENT, remainingPath) } // Create the remaining components. for _, part := range remainingParts { switch part { case "", ".": // Skip over no-op paths. continue } // NOTE: mkdir(2) will not follow trailing symlinks, so we can safely // create the final component without worrying about symlink-exchange // attacks. // // If we get -EEXIST, it's possible that another program created the // directory at the same time as us. In that case, just continue on as // if we created it (if the created inode is not a directory, the // following open call will fail). if err := unix.Mkdirat(int(currentDir.Fd()), part, unixMode); err != nil && !errors.Is(err, unix.EEXIST) { err = &os.PathError{Op: "mkdirat", Path: currentDir.Name() + "/" + part, Err: err} // Make the error a bit nicer if the directory is dead. if deadErr := fd.IsDeadInode(currentDir); deadErr != nil { // TODO: Once we bump the minimum Go version to 1.20, we can use // multiple %w verbs for this wrapping. For now we need to use a // compatibility shim for older Go versions. // err = fmt.Errorf("%w (%w)", err, deadErr) err = gocompat.WrapBaseError(err, deadErr) } return nil, err } // Get a handle to the next component. O_DIRECTORY means we don't need // to use O_PATH. var nextDir *os.File if linux.HasOpenat2() { nextDir, err = openat2(currentDir, part, &unix.OpenHow{ Flags: unix.O_NOFOLLOW | unix.O_DIRECTORY | unix.O_CLOEXEC, Resolve: unix.RESOLVE_BENEATH | unix.RESOLVE_NO_SYMLINKS | unix.RESOLVE_NO_XDEV, }) } else { nextDir, err = fd.Openat(currentDir, part, unix.O_NOFOLLOW|unix.O_DIRECTORY|unix.O_CLOEXEC, 0) } if err != nil { return nil, err } _ = currentDir.Close() currentDir = nextDir // It's possible that the directory we just opened was swapped by an // attacker. Unfortunately there isn't much we can do to protect // against this, and MkdirAll's behaviour is that we will reuse // existing directories anyway so the need to protect against this is // incredibly limited (and arguably doesn't even deserve mention here). // // Ideally we might want to check that the owner and mode match what we // would've created -- unfortunately, it is non-trivial to verify that // the owner and mode of the created directory match. While plain Unix // DAC rules seem simple enough to emulate, there are a bunch of other // factors that can change the mode or owner of created directories // (default POSIX ACLs, mount options like uid=1,gid=2,umask=0 on // filesystems like vfat, etc etc). We used to try to verify this but // it just lead to a series of spurious errors. // // We could also check that the directory is non-empty, but // unfortunately some pseduofilesystems (like cgroupfs) create // non-empty directories, which would result in different spurious // errors. } return currentDir, nil } ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/pathrs-lite/internal/gopathrs/open_linux.go ================================================ // SPDX-License-Identifier: MPL-2.0 //go:build linux // Copyright (C) 2024-2025 Aleksa Sarai // Copyright (C) 2024-2025 SUSE LLC // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. package gopathrs import ( "os" ) // OpenatInRoot is equivalent to [OpenInRoot], except that the root is provided // using an *[os.File] handle, to ensure that the correct root directory is used. func OpenatInRoot(root *os.File, unsafePath string) (*os.File, error) { handle, err := completeLookupInRoot(root, unsafePath) if err != nil { return nil, &os.PathError{Op: "securejoin.OpenInRoot", Path: unsafePath, Err: err} } return handle, nil } ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/pathrs-lite/internal/gopathrs/openat2_linux.go ================================================ // SPDX-License-Identifier: MPL-2.0 //go:build linux // Copyright (C) 2024-2025 Aleksa Sarai // Copyright (C) 2024-2025 SUSE LLC // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. package gopathrs import ( "errors" "fmt" "os" "path/filepath" "strings" "golang.org/x/sys/unix" "github.com/cyphar/filepath-securejoin/pathrs-lite/internal/fd" "github.com/cyphar/filepath-securejoin/pathrs-lite/procfs" ) func openat2(dir fd.Fd, path string, how *unix.OpenHow) (*os.File, error) { file, err := fd.Openat2(dir, path, how) if err != nil { return nil, err } // If we are using RESOLVE_IN_ROOT, the name we generated may be wrong. if how.Resolve&unix.RESOLVE_IN_ROOT == unix.RESOLVE_IN_ROOT { if actualPath, err := procfs.ProcSelfFdReadlink(file); err == nil { // TODO: Ideally we would not need to dup the fd, but you cannot // easily just swap an *os.File with one from the same fd // (the GC will close the old one, and you cannot clear the // finaliser easily because it is associated with an internal // field of *os.File not *os.File itself). newFile, err := fd.DupWithName(file, actualPath) if err != nil { return nil, err } _ = file.Close() file = newFile } } return file, nil } func lookupOpenat2(root fd.Fd, unsafePath string, partial bool) (*os.File, string, error) { if !partial { file, err := openat2(root, unsafePath, &unix.OpenHow{ Flags: unix.O_PATH | unix.O_CLOEXEC, Resolve: unix.RESOLVE_IN_ROOT | unix.RESOLVE_NO_MAGICLINKS, }) return file, "", err } return partialLookupOpenat2(root, unsafePath) } // partialLookupOpenat2 is an alternative implementation of // partialLookupInRoot, using openat2(RESOLVE_IN_ROOT) to more safely get a // handle to the deepest existing child of the requested path within the root. func partialLookupOpenat2(root fd.Fd, unsafePath string) (*os.File, string, error) { // TODO: Implement this as a git-bisect-like binary search. unsafePath = filepath.ToSlash(unsafePath) // noop endIdx := len(unsafePath) var lastError error for endIdx > 0 { subpath := unsafePath[:endIdx] handle, err := openat2(root, subpath, &unix.OpenHow{ Flags: unix.O_PATH | unix.O_CLOEXEC, Resolve: unix.RESOLVE_IN_ROOT | unix.RESOLVE_NO_MAGICLINKS, }) if err == nil { // Jump over the slash if we have a non-"" remainingPath. if endIdx < len(unsafePath) { endIdx++ } // We found a subpath! return handle, unsafePath[endIdx:], lastError } if errors.Is(err, unix.ENOENT) || errors.Is(err, unix.ENOTDIR) { // That path doesn't exist, let's try the next directory up. endIdx = strings.LastIndexByte(subpath, '/') lastError = err continue } return nil, "", fmt.Errorf("open subpath: %w", err) } // If we couldn't open anything, the whole subpath is missing. Return a // copy of the root fd so that the caller doesn't close this one by // accident. rootClone, err := fd.Dup(root) if err != nil { return nil, "", err } return rootClone, unsafePath, lastError } ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/pathrs-lite/internal/kernelversion/kernel_linux.go ================================================ // SPDX-License-Identifier: BSD-3-Clause // Copyright (C) 2022 The Go Authors. All rights reserved. // Copyright (C) 2025 SUSE LLC. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE.BSD file. // The parsing logic is very loosely based on the Go stdlib's // src/internal/syscall/unix/kernel_version_linux.go but with an API that looks // a bit like runc's libcontainer/system/kernelversion. // // TODO(cyphar): This API has been copied around to a lot of different projects // (Docker, containerd, runc, and now filepath-securejoin) -- maybe we should // put it in a separate project? // Package kernelversion provides a simple mechanism for checking whether the // running kernel is at least as new as some baseline kernel version. This is // often useful when checking for features that would be too complicated to // test support for (or in cases where we know that some kernel features in // backport-heavy kernels are broken and need to be avoided). package kernelversion import ( "bytes" "errors" "fmt" "strconv" "strings" "golang.org/x/sys/unix" "github.com/cyphar/filepath-securejoin/pathrs-lite/internal/gocompat" ) // KernelVersion is a numeric representation of the key numerical elements of a // kernel version (for instance, "4.1.2-default-1" would be represented as // KernelVersion{4, 1, 2}). type KernelVersion []uint64 func (kver KernelVersion) String() string { var str strings.Builder for idx, elem := range kver { if idx != 0 { _, _ = str.WriteRune('.') } _, _ = str.WriteString(strconv.FormatUint(elem, 10)) } return str.String() } var errInvalidKernelVersion = errors.New("invalid kernel version") // parseKernelVersion parses a string and creates a KernelVersion based on it. func parseKernelVersion(kverStr string) (KernelVersion, error) { kver := make(KernelVersion, 1, 3) for idx, ch := range kverStr { if '0' <= ch && ch <= '9' { v := &kver[len(kver)-1] *v = (*v * 10) + uint64(ch-'0') } else { if idx == 0 || kverStr[idx-1] < '0' || '9' < kverStr[idx-1] { // "." must be preceded by a digit while in version section return nil, fmt.Errorf("%w %q: kernel version has dot(s) followed by non-digit in version section", errInvalidKernelVersion, kverStr) } if ch != '.' { break } kver = append(kver, 0) } } if len(kver) < 2 { return nil, fmt.Errorf("%w %q: kernel versions must contain at least two components", errInvalidKernelVersion, kverStr) } return kver, nil } // getKernelVersion gets the current kernel version. var getKernelVersion = gocompat.SyncOnceValues(func() (KernelVersion, error) { var uts unix.Utsname if err := unix.Uname(&uts); err != nil { return nil, err } // Remove the \x00 from the release. release := uts.Release[:] return parseKernelVersion(string(release[:bytes.IndexByte(release, 0)])) }) // GreaterEqualThan returns true if the the host kernel version is greater than // or equal to the provided [KernelVersion]. When doing this comparison, any // non-numerical suffixes of the host kernel version are ignored. // // If the number of components provided is not equal to the number of numerical // components of the host kernel version, any missing components are treated as // 0. This means that GreaterEqualThan(KernelVersion{4}) will be treated the // same as GreaterEqualThan(KernelVersion{4, 0, 0, ..., 0, 0}), and that if the // host kernel version is "4" then GreaterEqualThan(KernelVersion{4, 1}) will // return false (because the host version will be treated as "4.0"). func GreaterEqualThan(wantKver KernelVersion) (bool, error) { hostKver, err := getKernelVersion() if err != nil { return false, err } // Pad out the kernel version lengths to match one another. cmpLen := gocompat.Max2(len(hostKver), len(wantKver)) hostKver = append(hostKver, make(KernelVersion, cmpLen-len(hostKver))...) wantKver = append(wantKver, make(KernelVersion, cmpLen-len(wantKver))...) for i := 0; i < cmpLen; i++ { switch gocompat.CmpCompare(hostKver[i], wantKver[i]) { case -1: // host < want return false, nil case +1: // host > want return true, nil case 0: continue } } // equal version values return true, nil } ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/pathrs-lite/internal/linux/doc.go ================================================ // SPDX-License-Identifier: MPL-2.0 // Copyright (C) 2024-2025 Aleksa Sarai // Copyright (C) 2024-2025 SUSE LLC // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. // Package linux returns information about what features are supported on the // running kernel. package linux ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/pathrs-lite/internal/linux/mount_linux.go ================================================ // SPDX-License-Identifier: MPL-2.0 //go:build linux // Copyright (C) 2024-2025 Aleksa Sarai // Copyright (C) 2024-2025 SUSE LLC // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. package linux import ( "golang.org/x/sys/unix" "github.com/cyphar/filepath-securejoin/pathrs-lite/internal/gocompat" "github.com/cyphar/filepath-securejoin/pathrs-lite/internal/kernelversion" ) // HasNewMountAPI returns whether the new fsopen(2) mount API is supported on // the running kernel. var HasNewMountAPI = gocompat.SyncOnceValue(func() bool { // All of the pieces of the new mount API we use (fsopen, fsconfig, // fsmount, open_tree) were added together in Linux 5.2[1,2], so we can // just check for one of the syscalls and the others should also be // available. // // Just try to use open_tree(2) to open a file without OPEN_TREE_CLONE. // This is equivalent to openat(2), but tells us if open_tree is // available (and thus all of the other basic new mount API syscalls). // open_tree(2) is most light-weight syscall to test here. // // [1]: merge commit 400913252d09 // [2]: fd, err := unix.OpenTree(-int(unix.EBADF), "/", unix.OPEN_TREE_CLOEXEC) if err != nil { return false } _ = unix.Close(fd) // RHEL 8 has a backport of fsopen(2) that appears to have some very // difficult to debug performance pathology. As such, it seems prudent to // simply reject pre-5.2 kernels. isNotBackport, _ := kernelversion.GreaterEqualThan(kernelversion.KernelVersion{5, 2}) return isNotBackport }) ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/pathrs-lite/internal/linux/openat2_linux.go ================================================ // SPDX-License-Identifier: MPL-2.0 //go:build linux // Copyright (C) 2024-2025 Aleksa Sarai // Copyright (C) 2024-2025 SUSE LLC // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. package linux import ( "golang.org/x/sys/unix" "github.com/cyphar/filepath-securejoin/pathrs-lite/internal/gocompat" ) // sawOpenat2Error stores whether we have seen an error from HasOpenat2. This // is a one-way toggle, so as soon as we see an error we "lock" into that mode. // We cannot use sync.OnceValue to store the success/fail state once because it // is possible for the program we are running in to apply a seccomp-bpf filter // and thus disable openat2 during execution. var sawOpenat2Error gocompat.Bool // HasOpenat2 returns whether openat2(2) is supported on the running kernel. var HasOpenat2 = func() bool { if sawOpenat2Error.Load() { return false } fd, err := unix.Openat2(unix.AT_FDCWD, ".", &unix.OpenHow{ Flags: unix.O_PATH | unix.O_CLOEXEC, Resolve: unix.RESOLVE_NO_SYMLINKS | unix.RESOLVE_IN_ROOT, }) if err != nil { sawOpenat2Error.Store(true) // doesn't matter if we race here return false } _ = unix.Close(fd) return true } ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/pathrs-lite/internal/procfs/procfs_linux.go ================================================ // SPDX-License-Identifier: MPL-2.0 //go:build linux // Copyright (C) 2024-2025 Aleksa Sarai // Copyright (C) 2024-2025 SUSE LLC // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. // Package procfs provides a safe API for operating on /proc on Linux. Note // that this is the *internal* procfs API, mainy needed due to Go's // restrictions on cyclic dependencies and its incredibly minimal visibility // system without making a separate internal/ package. package procfs import ( "errors" "fmt" "io" "os" "runtime" "strconv" "golang.org/x/sys/unix" "github.com/cyphar/filepath-securejoin/pathrs-lite/internal" "github.com/cyphar/filepath-securejoin/pathrs-lite/internal/assert" "github.com/cyphar/filepath-securejoin/pathrs-lite/internal/fd" "github.com/cyphar/filepath-securejoin/pathrs-lite/internal/gocompat" "github.com/cyphar/filepath-securejoin/pathrs-lite/internal/linux" ) // The kernel guarantees that the root inode of a procfs mount has an // f_type of PROC_SUPER_MAGIC and st_ino of PROC_ROOT_INO. const ( procSuperMagic = 0x9fa0 // PROC_SUPER_MAGIC procRootIno = 1 // PROC_ROOT_INO ) // verifyProcHandle checks that the handle is from a procfs filesystem. // Contrast this to [verifyProcRoot], which also verifies that the handle is // the root of a procfs mount. func verifyProcHandle(procHandle fd.Fd) error { if statfs, err := fd.Fstatfs(procHandle); err != nil { return err } else if statfs.Type != procSuperMagic { return fmt.Errorf("%w: incorrect procfs root filesystem type 0x%x", errUnsafeProcfs, statfs.Type) } return nil } // verifyProcRoot verifies that the handle is the root of a procfs filesystem. // Contrast this to [verifyProcHandle], which only verifies if the handle is // some file on procfs (regardless of what file it is). func verifyProcRoot(procRoot fd.Fd) error { if err := verifyProcHandle(procRoot); err != nil { return err } if stat, err := fd.Fstat(procRoot); err != nil { return err } else if stat.Ino != procRootIno { return fmt.Errorf("%w: incorrect procfs root inode number %d", errUnsafeProcfs, stat.Ino) } return nil } type procfsFeatures struct { // hasSubsetPid was added in Linux 5.8, along with hidepid=ptraceable (and // string-based hidepid= values). Before this patchset, it was not really // safe to try to modify procfs superblock flags because the superblock was // shared -- so if this feature is not available, **you should not set any // superblock flags**. // // 6814ef2d992a ("proc: add option to mount only a pids subset") // fa10fed30f25 ("proc: allow to mount many instances of proc in one pid namespace") // 24a71ce5c47f ("proc: instantiate only pids that we can ptrace on 'hidepid=4' mount option") // 1c6c4d112e81 ("proc: use human-readable values for hidepid") // 9ff7258575d5 ("Merge branch 'proc-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace") hasSubsetPid bool } var getProcfsFeatures = gocompat.SyncOnceValue(func() procfsFeatures { if !linux.HasNewMountAPI() { return procfsFeatures{} } procfsCtx, err := fd.Fsopen("proc", unix.FSOPEN_CLOEXEC) if err != nil { return procfsFeatures{} } defer procfsCtx.Close() //nolint:errcheck // close failures aren't critical here return procfsFeatures{ hasSubsetPid: unix.FsconfigSetString(int(procfsCtx.Fd()), "subset", "pid") == nil, } }) func newPrivateProcMount(subset bool) (_ *Handle, Err error) { procfsCtx, err := fd.Fsopen("proc", unix.FSOPEN_CLOEXEC) if err != nil { return nil, err } defer procfsCtx.Close() //nolint:errcheck // close failures aren't critical here if subset && getProcfsFeatures().hasSubsetPid { // Try to configure hidepid=ptraceable,subset=pid if possible, but // ignore errors. _ = unix.FsconfigSetString(int(procfsCtx.Fd()), "hidepid", "ptraceable") _ = unix.FsconfigSetString(int(procfsCtx.Fd()), "subset", "pid") } // Get an actual handle. if err := unix.FsconfigCreate(int(procfsCtx.Fd())); err != nil { return nil, os.NewSyscallError("fsconfig create procfs", err) } // TODO: Output any information from the fscontext log to debug logs. procRoot, err := fd.Fsmount(procfsCtx, unix.FSMOUNT_CLOEXEC, unix.MS_NODEV|unix.MS_NOEXEC|unix.MS_NOSUID) if err != nil { return nil, err } defer func() { if Err != nil { _ = procRoot.Close() } }() return newHandle(procRoot) } func clonePrivateProcMount() (_ *Handle, Err error) { // Try to make a clone without using AT_RECURSIVE if we can. If this works, // we can be sure there are no over-mounts and so if the root is valid then // we're golden. Otherwise, we have to deal with over-mounts. procRoot, err := fd.OpenTree(nil, "/proc", unix.OPEN_TREE_CLONE) if err != nil || hookForcePrivateProcRootOpenTreeAtRecursive(procRoot) { procRoot, err = fd.OpenTree(nil, "/proc", unix.OPEN_TREE_CLONE|unix.AT_RECURSIVE) } if err != nil { return nil, fmt.Errorf("creating a detached procfs clone: %w", err) } defer func() { if Err != nil { _ = procRoot.Close() } }() return newHandle(procRoot) } func privateProcRoot(subset bool) (*Handle, error) { if !linux.HasNewMountAPI() || hookForceGetProcRootUnsafe() { return nil, fmt.Errorf("new mount api: %w", unix.ENOTSUP) } // Try to create a new procfs mount from scratch if we can. This ensures we // can get a procfs mount even if /proc is fake (for whatever reason). procRoot, err := newPrivateProcMount(subset) if err != nil || hookForcePrivateProcRootOpenTree(procRoot) { // Try to clone /proc then... procRoot, err = clonePrivateProcMount() } return procRoot, err } func unsafeHostProcRoot() (_ *Handle, Err error) { procRoot, err := os.OpenFile("/proc", unix.O_PATH|unix.O_NOFOLLOW|unix.O_DIRECTORY|unix.O_CLOEXEC, 0) if err != nil { return nil, err } defer func() { if Err != nil { _ = procRoot.Close() } }() return newHandle(procRoot) } // Handle is a wrapper around an *os.File handle to "/proc", which can be used // to do further procfs-related operations in a safe way. type Handle struct { Inner fd.Fd // Does this handle have subset=pid set? isSubset bool } func newHandle(procRoot fd.Fd) (*Handle, error) { if err := verifyProcRoot(procRoot); err != nil { // This is only used in methods that _ = procRoot.Close() return nil, err } proc := &Handle{Inner: procRoot} // With subset=pid we can be sure that /proc/uptime will not exist. if err := fd.Faccessat(proc.Inner, "uptime", unix.F_OK, unix.AT_SYMLINK_NOFOLLOW); err != nil { proc.isSubset = errors.Is(err, os.ErrNotExist) } return proc, nil } // Close closes the underlying file for the Handle. func (proc *Handle) Close() error { return proc.Inner.Close() } var getCachedProcRoot = gocompat.SyncOnceValue(func() *Handle { procRoot, err := getProcRoot(true) if err != nil { return nil // just don't cache if we see an error } if !procRoot.isSubset { return nil // we only cache verified subset=pid handles } // Disarm (*Handle).Close() to stop someone from accidentally closing // the global handle. procRoot.Inner = fd.NopCloser(procRoot.Inner) return procRoot }) // OpenProcRoot tries to open a "safer" handle to "/proc". func OpenProcRoot() (*Handle, error) { if proc := getCachedProcRoot(); proc != nil { return proc, nil } return getProcRoot(true) } // OpenUnsafeProcRoot opens a handle to "/proc" without any overmounts or // masked paths (but also without "subset=pid"). func OpenUnsafeProcRoot() (*Handle, error) { return getProcRoot(false) } func getProcRoot(subset bool) (*Handle, error) { proc, err := privateProcRoot(subset) if err != nil { // Fall back to using a /proc handle if making a private mount failed. // If we have openat2, at least we can avoid some kinds of over-mount // attacks, but without openat2 there's not much we can do. proc, err = unsafeHostProcRoot() } return proc, err } var hasProcThreadSelf = gocompat.SyncOnceValue(func() bool { return unix.Access("/proc/thread-self/", unix.F_OK) == nil }) var errUnsafeProcfs = errors.New("unsafe procfs detected") // lookup is a very minimal wrapper around [procfsLookupInRoot] which is // intended to be called from the external API. func (proc *Handle) lookup(subpath string) (*os.File, error) { handle, err := procfsLookupInRoot(proc.Inner, subpath) if err != nil { return nil, err } return handle, nil } // procfsBase is an enum indicating the prefix of a subpath in operations // involving [Handle]s. type procfsBase string const ( // ProcRoot refers to the root of the procfs (i.e., "/proc/"). ProcRoot procfsBase = "/proc" // ProcSelf refers to the current process' subdirectory (i.e., // "/proc/self/"). ProcSelf procfsBase = "/proc/self" // ProcThreadSelf refers to the current thread's subdirectory (i.e., // "/proc/thread-self/"). In multi-threaded programs (i.e., all Go // programs) where one thread has a different CLONE_FS, it is possible for // "/proc/self" to point the wrong thread and so "/proc/thread-self" may be // necessary. Note that on pre-3.17 kernels, "/proc/thread-self" doesn't // exist and so a fallback will be used in that case. ProcThreadSelf procfsBase = "/proc/thread-self" // TODO: Switch to an interface setup so we can have a more type-safe // version of ProcPid and remove the need to worry about invalid string // values. ) // prefix returns a prefix that can be used with the given [Handle]. func (base procfsBase) prefix(proc *Handle) (string, error) { switch base { case ProcRoot: return ".", nil case ProcSelf: return "self", nil case ProcThreadSelf: threadSelf := "thread-self" if !hasProcThreadSelf() || hookForceProcSelfTask() { // Pre-3.17 kernels don't have /proc/thread-self, so do it // manually. threadSelf = "self/task/" + strconv.Itoa(unix.Gettid()) if err := fd.Faccessat(proc.Inner, threadSelf, unix.F_OK, unix.AT_SYMLINK_NOFOLLOW); err != nil || hookForceProcSelf() { // In this case, we running in a pid namespace that doesn't // match the /proc mount we have. This can happen inside runc. // // Unfortunately, there is no nice way to get the correct TID // to use here because of the age of the kernel, so we have to // just use /proc/self and hope that it works. threadSelf = "self" } } return threadSelf, nil } return "", fmt.Errorf("invalid procfs base %q", base) } // ProcThreadSelfCloser is a callback that needs to be called when you are done // operating on an [os.File] fetched using [ProcThreadSelf]. // // [os.File]: https://pkg.go.dev/os#File type ProcThreadSelfCloser func() // open is the core lookup operation for [Handle]. It returns a handle to // "/proc//". If the returned [ProcThreadSelfCloser] is non-nil, // you should call it after you are done interacting with the returned handle. // // In general you should use prefer to use the other helpers, as they remove // the need to interact with [procfsBase] and do not return a nil // [ProcThreadSelfCloser] for [procfsBase] values other than [ProcThreadSelf] // where it is necessary. func (proc *Handle) open(base procfsBase, subpath string) (_ *os.File, closer ProcThreadSelfCloser, Err error) { prefix, err := base.prefix(proc) if err != nil { return nil, nil, err } subpath = prefix + "/" + subpath switch base { case ProcRoot: file, err := proc.lookup(subpath) if errors.Is(err, os.ErrNotExist) { // The Handle handle in use might be a subset=pid one, which will // result in spurious errors. In this case, just open a temporary // unmasked procfs handle for this operation. proc, err2 := OpenUnsafeProcRoot() // !subset=pid if err2 != nil { return nil, nil, err } defer proc.Close() //nolint:errcheck // close failures aren't critical here file, err = proc.lookup(subpath) } return file, nil, err case ProcSelf: file, err := proc.lookup(subpath) return file, nil, err case ProcThreadSelf: // We need to lock our thread until the caller is done with the handle // because between getting the handle and using it we could get // interrupted by the Go runtime and hit the case where the underlying // thread is swapped out and the original thread is killed, resulting // in pull-your-hair-out-hard-to-debug issues in the caller. runtime.LockOSThread() defer func() { if Err != nil { runtime.UnlockOSThread() closer = nil } }() file, err := proc.lookup(subpath) return file, runtime.UnlockOSThread, err } // should never be reached return nil, nil, fmt.Errorf("[internal error] invalid procfs base %q", base) } // OpenThreadSelf returns a handle to "/proc/thread-self/" (or an // equivalent handle on older kernels where "/proc/thread-self" doesn't exist). // Once finished with the handle, you must call the returned closer function // (runtime.UnlockOSThread). You must not pass the returned *os.File to other // Go threads or use the handle after calling the closer. func (proc *Handle) OpenThreadSelf(subpath string) (_ *os.File, _ ProcThreadSelfCloser, Err error) { return proc.open(ProcThreadSelf, subpath) } // OpenSelf returns a handle to /proc/self/. func (proc *Handle) OpenSelf(subpath string) (*os.File, error) { file, closer, err := proc.open(ProcSelf, subpath) assert.Assert(closer == nil, "closer for ProcSelf must be nil") return file, err } // OpenRoot returns a handle to /proc/. func (proc *Handle) OpenRoot(subpath string) (*os.File, error) { file, closer, err := proc.open(ProcRoot, subpath) assert.Assert(closer == nil, "closer for ProcRoot must be nil") return file, err } // OpenPid returns a handle to /proc/$pid/ (pid can be a pid or tid). // This is mainly intended for usage when operating on other processes. func (proc *Handle) OpenPid(pid int, subpath string) (*os.File, error) { return proc.OpenRoot(strconv.Itoa(pid) + "/" + subpath) } // checkSubpathOvermount checks if the dirfd and path combination is on the // same mount as the given root. func checkSubpathOvermount(root, dir fd.Fd, path string) error { // Get the mntID of our procfs handle. expectedMountID, err := fd.GetMountID(root, "") if err != nil { return fmt.Errorf("get root mount id: %w", err) } // Get the mntID of the target magic-link. gotMountID, err := fd.GetMountID(dir, path) if err != nil { return fmt.Errorf("get subpath mount id: %w", err) } // As long as the directory mount is alive, even with wrapping mount IDs, // we would expect to see a different mount ID here. (Of course, if we're // using unsafeHostProcRoot() then an attaker could change this after we // did this check.) if expectedMountID != gotMountID { return fmt.Errorf("%w: subpath %s/%s has an overmount obscuring the real path (mount ids do not match %d != %d)", errUnsafeProcfs, dir.Name(), path, expectedMountID, gotMountID) } return nil } // Readlink performs a readlink operation on "/proc//" in a way // that should be free from race attacks. This is most commonly used to get the // real path of a file by looking at "/proc/self/fd/$n", with the same safety // protections as [Open] (as well as some additional checks against // overmounts). func (proc *Handle) Readlink(base procfsBase, subpath string) (string, error) { link, closer, err := proc.open(base, subpath) if closer != nil { defer closer() } if err != nil { return "", fmt.Errorf("get safe %s/%s handle: %w", base, subpath, err) } defer link.Close() //nolint:errcheck // close failures aren't critical here // Try to detect if there is a mount on top of the magic-link. This should // be safe in general (a mount on top of the path afterwards would not // affect the handle itself) and will definitely be safe if we are using // privateProcRoot() (at least since Linux 5.12[1], when anonymous mount // namespaces were completely isolated from external mounts including mount // propagation events). // // [1]: Linux commit ee2e3f50629f ("mount: fix mounting of detached mounts // onto targets that reside on shared mounts"). if err := checkSubpathOvermount(proc.Inner, link, ""); err != nil { return "", fmt.Errorf("check safety of %s/%s magiclink: %w", base, subpath, err) } // readlinkat implies AT_EMPTY_PATH since Linux 2.6.39. See Linux commit // 65cfc6722361 ("readlinkat(), fchownat() and fstatat() with empty // relative pathnames"). return fd.Readlinkat(link, "") } // ProcSelfFdReadlink gets the real path of the given file by looking at // readlink(/proc/thread-self/fd/$n). // // This is just a wrapper around [Handle.Readlink]. func ProcSelfFdReadlink(fd fd.Fd) (string, error) { procRoot, err := OpenProcRoot() // subset=pid if err != nil { return "", err } defer procRoot.Close() //nolint:errcheck // close failures aren't critical here fdPath := "fd/" + strconv.Itoa(int(fd.Fd())) return procRoot.Readlink(ProcThreadSelf, fdPath) } // CheckProcSelfFdPath returns whether the given file handle matches the // expected path. (This is inherently racy.) func CheckProcSelfFdPath(path string, file fd.Fd) error { if err := fd.IsDeadInode(file); err != nil { return err } actualPath, err := ProcSelfFdReadlink(file) if err != nil { return fmt.Errorf("get path of handle: %w", err) } if actualPath != path { return fmt.Errorf("%w: handle path %q doesn't match expected path %q", internal.ErrPossibleBreakout, actualPath, path) } return nil } // ReopenFd takes an existing file descriptor and "re-opens" it through // /proc/thread-self/fd/. This allows for O_PATH file descriptors to be // upgraded to regular file descriptors, as well as changing the open mode of a // regular file descriptor. Some filesystems have unique handling of open(2) // which make this incredibly useful (such as /dev/ptmx). func ReopenFd(handle fd.Fd, flags int) (*os.File, error) { procRoot, err := OpenProcRoot() // subset=pid if err != nil { return nil, err } defer procRoot.Close() //nolint:errcheck // close failures aren't critical here // We can't operate on /proc/thread-self/fd/$n directly when doing a // re-open, so we need to open /proc/thread-self/fd and then open a single // final component. procFdDir, closer, err := procRoot.OpenThreadSelf("fd/") if err != nil { return nil, fmt.Errorf("get safe /proc/thread-self/fd handle: %w", err) } defer procFdDir.Close() //nolint:errcheck // close failures aren't critical here defer closer() // Try to detect if there is a mount on top of the magic-link we are about // to open. If we are using unsafeHostProcRoot(), this could change after // we check it (and there's nothing we can do about that) but for // privateProcRoot() this should be guaranteed to be safe (at least since // Linux 5.12[1], when anonymous mount namespaces were completely isolated // from external mounts including mount propagation events). // // [1]: Linux commit ee2e3f50629f ("mount: fix mounting of detached mounts // onto targets that reside on shared mounts"). fdStr := strconv.Itoa(int(handle.Fd())) if err := checkSubpathOvermount(procRoot.Inner, procFdDir, fdStr); err != nil { return nil, fmt.Errorf("check safety of /proc/thread-self/fd/%s magiclink: %w", fdStr, err) } flags |= unix.O_CLOEXEC // Rather than just wrapping fd.Openat, open-code it so we can copy // handle.Name(). reopenFd, err := unix.Openat(int(procFdDir.Fd()), fdStr, flags, 0) if err != nil { return nil, fmt.Errorf("reopen fd %d: %w", handle.Fd(), err) } return os.NewFile(uintptr(reopenFd), handle.Name()), nil } // Test hooks used in the procfs tests to verify that the fallback logic works. // See testing_mocks_linux_test.go and procfs_linux_test.go for more details. var ( hookForcePrivateProcRootOpenTree = hookDummyFile hookForcePrivateProcRootOpenTreeAtRecursive = hookDummyFile hookForceGetProcRootUnsafe = hookDummy hookForceProcSelfTask = hookDummy hookForceProcSelf = hookDummy ) func hookDummy() bool { return false } func hookDummyFile(_ io.Closer) bool { return false } ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/pathrs-lite/internal/procfs/procfs_lookup_linux.go ================================================ // SPDX-License-Identifier: MPL-2.0 //go:build linux // Copyright (C) 2024-2025 Aleksa Sarai // Copyright (C) 2024-2025 SUSE LLC // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. // This code is adapted to be a minimal version of the libpathrs proc resolver // . // As we only need O_PATH|O_NOFOLLOW support, this is not too much to port. package procfs import ( "fmt" "os" "path" "path/filepath" "strings" "golang.org/x/sys/unix" "github.com/cyphar/filepath-securejoin/internal/consts" "github.com/cyphar/filepath-securejoin/pathrs-lite/internal" "github.com/cyphar/filepath-securejoin/pathrs-lite/internal/fd" "github.com/cyphar/filepath-securejoin/pathrs-lite/internal/gocompat" "github.com/cyphar/filepath-securejoin/pathrs-lite/internal/linux" ) // procfsLookupInRoot is a stripped down version of completeLookupInRoot, // entirely designed to support the very small set of features necessary to // make procfs handling work. Unlike completeLookupInRoot, we always have // O_PATH|O_NOFOLLOW behaviour for trailing symlinks. // // The main restrictions are: // // - ".." is not supported (as it requires either os.Root-style replays, // which is more bug-prone; or procfs verification, which is not possible // due to re-entrancy issues). // - Absolute symlinks for the same reason (and all absolute symlinks in // procfs are magic-links, which we want to skip anyway). // - If statx is supported (checkSymlinkOvermount), any mount-point crossings // (which is the main attack of concern against /proc). // - Partial lookups are not supported, so the symlink stack is not needed. // - Trailing slash special handling is not necessary in most cases (if we // operating on procfs, it's usually with programmer-controlled strings // that will then be re-opened), so we skip it since whatever re-opens it // can deal with it. It's a creature comfort anyway. // // If the system supports openat2(), this is implemented using equivalent flags // (RESOLVE_BENEATH | RESOLVE_NO_XDEV | RESOLVE_NO_MAGICLINKS). func procfsLookupInRoot(procRoot fd.Fd, unsafePath string) (Handle *os.File, _ error) { unsafePath = filepath.ToSlash(unsafePath) // noop // Make sure that an empty unsafe path still returns something sane, even // with openat2 (which doesn't have AT_EMPTY_PATH semantics yet). if unsafePath == "" { unsafePath = "." } // This is already checked by getProcRoot, but make sure here since the // core security of this lookup is based on this assumption. if err := verifyProcRoot(procRoot); err != nil { return nil, err } if linux.HasOpenat2() { // We prefer being able to use RESOLVE_NO_XDEV if we can, to be // absolutely sure we are operating on a clean /proc handle that // doesn't have any cheeky overmounts that could trick us (including // symlink mounts on top of /proc/thread-self). RESOLVE_BENEATH isn't // strictly needed, but just use it since we have it. // // NOTE: /proc/self is technically a magic-link (the contents of the // symlink are generated dynamically), but it doesn't use // nd_jump_link() so RESOLVE_NO_MAGICLINKS allows it. // // TODO: It would be nice to have RESOLVE_NO_DOTDOT, purely for // self-consistency with the backup O_PATH resolver. handle, err := fd.Openat2(procRoot, unsafePath, &unix.OpenHow{ Flags: unix.O_PATH | unix.O_NOFOLLOW | unix.O_CLOEXEC, Resolve: unix.RESOLVE_BENEATH | unix.RESOLVE_NO_XDEV | unix.RESOLVE_NO_MAGICLINKS, }) if err != nil { // TODO: Once we bump the minimum Go version to 1.20, we can use // multiple %w verbs for this wrapping. For now we need to use a // compatibility shim for older Go versions. // err = fmt.Errorf("%w: %w", errUnsafeProcfs, err) return nil, gocompat.WrapBaseError(err, errUnsafeProcfs) } return handle, nil } // To mirror openat2(RESOLVE_BENEATH), we need to return an error if the // path is absolute. if path.IsAbs(unsafePath) { return nil, fmt.Errorf("%w: cannot resolve absolute paths in procfs resolver", internal.ErrPossibleBreakout) } currentDir, err := fd.Dup(procRoot) if err != nil { return nil, fmt.Errorf("clone root fd: %w", err) } defer func() { // If a handle is not returned, close the internal handle. if Handle == nil { _ = currentDir.Close() } }() var ( linksWalked int currentPath string remainingPath = unsafePath ) for remainingPath != "" { // Get the next path component. var part string if i := strings.IndexByte(remainingPath, '/'); i == -1 { part, remainingPath = remainingPath, "" } else { part, remainingPath = remainingPath[:i], remainingPath[i+1:] } if part == "" { // no-op component, but treat it the same as "." part = "." } if part == ".." { // not permitted return nil, fmt.Errorf("%w: cannot walk into '..' in procfs resolver", internal.ErrPossibleBreakout) } // Apply the component lexically to the path we are building. // currentPath does not contain any symlinks, and we are lexically // dealing with a single component, so it's okay to do a filepath.Clean // here. (Not to mention that ".." isn't allowed.) nextPath := path.Join("/", currentPath, part) // If we logically hit the root, just clone the root rather than // opening the part and doing all of the other checks. if nextPath == "/" { // Jump to root. rootClone, err := fd.Dup(procRoot) if err != nil { return nil, fmt.Errorf("clone root fd: %w", err) } _ = currentDir.Close() currentDir = rootClone currentPath = nextPath continue } // Try to open the next component. nextDir, err := fd.Openat(currentDir, part, unix.O_PATH|unix.O_NOFOLLOW|unix.O_CLOEXEC, 0) if err != nil { return nil, err } // Make sure we are still on procfs and haven't crossed mounts. if err := verifyProcHandle(nextDir); err != nil { _ = nextDir.Close() return nil, fmt.Errorf("check %q component is on procfs: %w", part, err) } if err := checkSubpathOvermount(procRoot, nextDir, ""); err != nil { _ = nextDir.Close() return nil, fmt.Errorf("check %q component is not overmounted: %w", part, err) } // We are emulating O_PATH|O_NOFOLLOW, so we only need to traverse into // trailing symlinks if we are not the final component. Otherwise we // can just return the currentDir. if remainingPath != "" { st, err := nextDir.Stat() if err != nil { _ = nextDir.Close() return nil, fmt.Errorf("stat component %q: %w", part, err) } if st.Mode()&os.ModeType == os.ModeSymlink { // readlinkat implies AT_EMPTY_PATH since Linux 2.6.39. See // Linux commit 65cfc6722361 ("readlinkat(), fchownat() and // fstatat() with empty relative pathnames"). linkDest, err := fd.Readlinkat(nextDir, "") // We don't need the handle anymore. _ = nextDir.Close() if err != nil { return nil, err } linksWalked++ if linksWalked > consts.MaxSymlinkLimit { return nil, &os.PathError{Op: "securejoin.procfsLookupInRoot", Path: "/proc/" + unsafePath, Err: unix.ELOOP} } // Update our logical remaining path. remainingPath = linkDest + "/" + remainingPath // Absolute symlinks are probably magiclinks, we reject them. if path.IsAbs(linkDest) { return nil, fmt.Errorf("%w: cannot jump to / in procfs resolver -- possible magiclink", internal.ErrPossibleBreakout) } continue } } // Walk into the next component. _ = currentDir.Close() currentDir = nextDir currentPath = nextPath } // One final sanity-check. if err := verifyProcHandle(currentDir); err != nil { return nil, fmt.Errorf("check final handle is on procfs: %w", err) } if err := checkSubpathOvermount(procRoot, currentDir, ""); err != nil { return nil, fmt.Errorf("check final handle is not overmounted: %w", err) } return currentDir, nil } ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/pathrs-lite/mkdir.go ================================================ // SPDX-License-Identifier: MPL-2.0 //go:build linux // Copyright (C) 2024-2025 Aleksa Sarai // Copyright (C) 2024-2025 SUSE LLC // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. package pathrs import ( "os" "golang.org/x/sys/unix" ) // MkdirAll is a race-safe alternative to the [os.MkdirAll] function, // where the new directory is guaranteed to be within the root directory (if an // attacker can move directories from inside the root to outside the root, the // created directory tree might be outside of the root but the key constraint // is that at no point will we walk outside of the directory tree we are // creating). // // Effectively, MkdirAll(root, unsafePath, mode) is equivalent to // // path, _ := securejoin.SecureJoin(root, unsafePath) // err := os.MkdirAll(path, mode) // // But is much safer. The above implementation is unsafe because if an attacker // can modify the filesystem tree between [SecureJoin] and [os.MkdirAll], it is // possible for MkdirAll to resolve unsafe symlink components and create // directories outside of the root. // // If you plan to open the directory after you have created it or want to use // an open directory handle as the root, you should use [MkdirAllHandle] instead. // This function is a wrapper around [MkdirAllHandle]. // // [SecureJoin]: https://pkg.go.dev/github.com/cyphar/filepath-securejoin#SecureJoin func MkdirAll(root, unsafePath string, mode os.FileMode) error { rootDir, err := os.OpenFile(root, unix.O_PATH|unix.O_DIRECTORY|unix.O_CLOEXEC, 0) if err != nil { return err } defer rootDir.Close() //nolint:errcheck // close failures aren't critical here f, err := MkdirAllHandle(rootDir, unsafePath, mode) if err != nil { return err } _ = f.Close() return nil } ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/pathrs-lite/mkdir_libpathrs.go ================================================ // SPDX-License-Identifier: MPL-2.0 //go:build libpathrs // Copyright (C) 2024-2025 Aleksa Sarai // Copyright (C) 2024-2025 SUSE LLC // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. package pathrs import ( "os" "cyphar.com/go-pathrs" ) // MkdirAllHandle is equivalent to [MkdirAll], except that it is safer to use // in two respects: // // - The caller provides the root directory as an *[os.File] (preferably O_PATH) // handle. This means that the caller can be sure which root directory is // being used. Note that this can be emulated by using /proc/self/fd/... as // the root path with [os.MkdirAll]. // // - Once all of the directories have been created, an *[os.File] O_PATH handle // to the directory at unsafePath is returned to the caller. This is done in // an effectively-race-free way (an attacker would only be able to swap the // final directory component), which is not possible to emulate with // [MkdirAll]. // // In addition, the returned handle is obtained far more efficiently than doing // a brand new lookup of unsafePath (such as with [SecureJoin] or openat2) after // doing [MkdirAll]. If you intend to open the directory after creating it, you // should use MkdirAllHandle. // // [SecureJoin]: https://pkg.go.dev/github.com/cyphar/filepath-securejoin#SecureJoin func MkdirAllHandle(root *os.File, unsafePath string, mode os.FileMode) (*os.File, error) { rootRef, err := pathrs.RootFromFile(root) if err != nil { return nil, err } defer rootRef.Close() //nolint:errcheck // close failures aren't critical here handle, err := rootRef.MkdirAll(unsafePath, mode) if err != nil { return nil, err } return handle.IntoFile(), nil } ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/pathrs-lite/mkdir_purego.go ================================================ // SPDX-License-Identifier: MPL-2.0 //go:build linux && !libpathrs // Copyright (C) 2024-2025 Aleksa Sarai // Copyright (C) 2024-2025 SUSE LLC // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. package pathrs import ( "os" "github.com/cyphar/filepath-securejoin/pathrs-lite/internal/gopathrs" ) // MkdirAllHandle is equivalent to [MkdirAll], except that it is safer to use // in two respects: // // - The caller provides the root directory as an *[os.File] (preferably O_PATH) // handle. This means that the caller can be sure which root directory is // being used. Note that this can be emulated by using /proc/self/fd/... as // the root path with [os.MkdirAll]. // // - Once all of the directories have been created, an *[os.File] O_PATH handle // to the directory at unsafePath is returned to the caller. This is done in // an effectively-race-free way (an attacker would only be able to swap the // final directory component), which is not possible to emulate with // [MkdirAll]. // // In addition, the returned handle is obtained far more efficiently than doing // a brand new lookup of unsafePath (such as with [SecureJoin] or openat2) after // doing [MkdirAll]. If you intend to open the directory after creating it, you // should use MkdirAllHandle. // // [SecureJoin]: https://pkg.go.dev/github.com/cyphar/filepath-securejoin#SecureJoin func MkdirAllHandle(root *os.File, unsafePath string, mode os.FileMode) (*os.File, error) { return gopathrs.MkdirAllHandle(root, unsafePath, mode) } ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/pathrs-lite/open.go ================================================ // SPDX-License-Identifier: MPL-2.0 //go:build linux // Copyright (C) 2024-2025 Aleksa Sarai // Copyright (C) 2024-2025 SUSE LLC // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. package pathrs import ( "os" "golang.org/x/sys/unix" ) // OpenInRoot safely opens the provided unsafePath within the root. // Effectively, OpenInRoot(root, unsafePath) is equivalent to // // path, _ := securejoin.SecureJoin(root, unsafePath) // handle, err := os.OpenFile(path, unix.O_PATH|unix.O_CLOEXEC) // // But is much safer. The above implementation is unsafe because if an attacker // can modify the filesystem tree between [SecureJoin] and [os.OpenFile], it is // possible for the returned file to be outside of the root. // // Note that the returned handle is an O_PATH handle, meaning that only a very // limited set of operations will work on the handle. This is done to avoid // accidentally opening an untrusted file that could cause issues (such as a // disconnected TTY that could cause a DoS, or some other issue). In order to // use the returned handle, you can "upgrade" it to a proper handle using // [Reopen]. // // [SecureJoin]: https://pkg.go.dev/github.com/cyphar/filepath-securejoin#SecureJoin func OpenInRoot(root, unsafePath string) (*os.File, error) { rootDir, err := os.OpenFile(root, unix.O_PATH|unix.O_DIRECTORY|unix.O_CLOEXEC, 0) if err != nil { return nil, err } defer rootDir.Close() //nolint:errcheck // close failures aren't critical here return OpenatInRoot(rootDir, unsafePath) } ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/pathrs-lite/open_libpathrs.go ================================================ // SPDX-License-Identifier: MPL-2.0 //go:build libpathrs // Copyright (C) 2024-2025 Aleksa Sarai // Copyright (C) 2024-2025 SUSE LLC // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. package pathrs import ( "os" "cyphar.com/go-pathrs" ) // OpenatInRoot is equivalent to [OpenInRoot], except that the root is provided // using an *[os.File] handle, to ensure that the correct root directory is used. func OpenatInRoot(root *os.File, unsafePath string) (*os.File, error) { rootRef, err := pathrs.RootFromFile(root) if err != nil { return nil, err } defer rootRef.Close() //nolint:errcheck // close failures aren't critical here handle, err := rootRef.Resolve(unsafePath) if err != nil { return nil, err } return handle.IntoFile(), nil } // Reopen takes an *[os.File] handle and re-opens it through /proc/self/fd. // Reopen(file, flags) is effectively equivalent to // // fdPath := fmt.Sprintf("/proc/self/fd/%d", file.Fd()) // os.OpenFile(fdPath, flags|unix.O_CLOEXEC) // // But with some extra hardenings to ensure that we are not tricked by a // maliciously-configured /proc mount. While this attack scenario is not // common, in container runtimes it is possible for higher-level runtimes to be // tricked into configuring an unsafe /proc that can be used to attack file // operations. See [CVE-2019-19921] for more details. // // [CVE-2019-19921]: https://github.com/advisories/GHSA-fh74-hm69-rqjw func Reopen(file *os.File, flags int) (*os.File, error) { handle, err := pathrs.HandleFromFile(file) if err != nil { return nil, err } defer handle.Close() //nolint:errcheck // close failures aren't critical here return handle.OpenFile(flags) } ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/pathrs-lite/open_purego.go ================================================ // SPDX-License-Identifier: MPL-2.0 //go:build linux && !libpathrs // Copyright (C) 2024-2025 Aleksa Sarai // Copyright (C) 2024-2025 SUSE LLC // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. package pathrs import ( "os" "github.com/cyphar/filepath-securejoin/pathrs-lite/internal/gopathrs" "github.com/cyphar/filepath-securejoin/pathrs-lite/internal/procfs" ) // OpenatInRoot is equivalent to [OpenInRoot], except that the root is provided // using an *[os.File] handle, to ensure that the correct root directory is used. func OpenatInRoot(root *os.File, unsafePath string) (*os.File, error) { return gopathrs.OpenatInRoot(root, unsafePath) } // Reopen takes an *[os.File] handle and re-opens it through /proc/self/fd. // Reopen(file, flags) is effectively equivalent to // // fdPath := fmt.Sprintf("/proc/self/fd/%d", file.Fd()) // os.OpenFile(fdPath, flags|unix.O_CLOEXEC) // // But with some extra hardenings to ensure that we are not tricked by a // maliciously-configured /proc mount. While this attack scenario is not // common, in container runtimes it is possible for higher-level runtimes to be // tricked into configuring an unsafe /proc that can be used to attack file // operations. See [CVE-2019-19921] for more details. // // [CVE-2019-19921]: https://github.com/advisories/GHSA-fh74-hm69-rqjw func Reopen(handle *os.File, flags int) (*os.File, error) { return procfs.ReopenFd(handle, flags) } ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/pathrs-lite/procfs/procfs_libpathrs.go ================================================ // SPDX-License-Identifier: MPL-2.0 //go:build libpathrs // Copyright (C) 2024-2025 Aleksa Sarai // Copyright (C) 2024-2025 SUSE LLC // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. // Package procfs provides a safe API for operating on /proc on Linux. package procfs import ( "os" "strconv" "cyphar.com/go-pathrs/procfs" "golang.org/x/sys/unix" ) // ProcThreadSelfCloser is a callback that needs to be called when you are done // operating on an [os.File] fetched using [Handle.OpenThreadSelf]. // // [os.File]: https://pkg.go.dev/os#File type ProcThreadSelfCloser = procfs.ThreadCloser // Handle is a wrapper around an *os.File handle to "/proc", which can be used // to do further procfs-related operations in a safe way. type Handle struct { inner *procfs.Handle } // Close close the resources associated with this [Handle]. Note that if this // [Handle] was created with [OpenProcRoot], on some kernels the underlying // procfs handle is cached and so this Close operation may be a no-op. However, // you should always call Close on [Handle]s once you are done with them. func (proc *Handle) Close() error { return proc.inner.Close() } // OpenProcRoot tries to open a "safer" handle to "/proc" (i.e., one with the // "subset=pid" mount option applied, available from Linux 5.8). Unless you // plan to do many [Handle.OpenRoot] operations, users should prefer to use // this over [OpenUnsafeProcRoot] which is far more dangerous to keep open. // // If a safe handle cannot be opened, OpenProcRoot will fall back to opening a // regular "/proc" handle. // // Note that using [Handle.OpenRoot] will still work with handles returned by // this function. If a subpath cannot be operated on with a safe "/proc" // handle, then [OpenUnsafeProcRoot] will be called internally and a temporary // unsafe handle will be used. func OpenProcRoot() (*Handle, error) { proc, err := procfs.Open() if err != nil { return nil, err } return &Handle{inner: proc}, nil } // OpenUnsafeProcRoot opens a handle to "/proc" without any overmounts or // masked paths. You must be extremely careful to make sure this handle is // never leaked to a container and that you program cannot be tricked into // writing to arbitrary paths within it. // // This is not necessary if you just wish to use [Handle.OpenRoot], as handles // returned by [OpenProcRoot] will fall back to using a *temporary* unsafe // handle in that case. You should only really use this if you need to do many // operations with [Handle.OpenRoot] and the performance overhead of making // many procfs handles is an issue. If you do use OpenUnsafeProcRoot, you // should make sure to close the handle as soon as possible to avoid // known-fd-number attacks. func OpenUnsafeProcRoot() (*Handle, error) { proc, err := procfs.Open(procfs.UnmaskedProcRoot) if err != nil { return nil, err } return &Handle{inner: proc}, nil } // OpenThreadSelf returns a handle to "/proc/thread-self/" (or an // equivalent handle on older kernels where "/proc/thread-self" doesn't exist). // Once finished with the handle, you must call the returned closer function // ([runtime.UnlockOSThread]). You must not pass the returned *os.File to other // Go threads or use the handle after calling the closer. // // [runtime.UnlockOSThread]: https://pkg.go.dev/runtime#UnlockOSThread func (proc *Handle) OpenThreadSelf(subpath string) (*os.File, ProcThreadSelfCloser, error) { return proc.inner.OpenThreadSelf(subpath, unix.O_PATH|unix.O_NOFOLLOW) } // OpenSelf returns a handle to /proc/self/. // // Note that in Go programs with non-homogenous threads, this may result in // spurious errors. If you are monkeying around with APIs that are // thread-specific, you probably want to use [Handle.OpenThreadSelf] instead // which will guarantee that the handle refers to the same thread as the caller // is executing on. func (proc *Handle) OpenSelf(subpath string) (*os.File, error) { return proc.inner.OpenSelf(subpath, unix.O_PATH|unix.O_NOFOLLOW) } // OpenRoot returns a handle to /proc/. // // You should only use this when you need to operate on global procfs files // (such as sysctls in /proc/sys). Unlike [Handle.OpenThreadSelf], // [Handle.OpenSelf], and [Handle.OpenPid], the procfs handle used internally // for this operation will never use "subset=pid", which makes it a more juicy // target for [CVE-2024-21626]-style attacks (and doing something like opening // a directory with OpenRoot effectively leaks [OpenUnsafeProcRoot] as long as // the file descriptor is open). // // [CVE-2024-21626]: https://github.com/opencontainers/runc/security/advisories/GHSA-xr7r-f8xq-vfvv func (proc *Handle) OpenRoot(subpath string) (*os.File, error) { return proc.inner.OpenRoot(subpath, unix.O_PATH|unix.O_NOFOLLOW) } // OpenPid returns a handle to /proc/$pid/ (pid can be a pid or tid). // This is mainly intended for usage when operating on other processes. // // You should not use this for the current thread, as special handling is // needed for /proc/thread-self (or /proc/self/task/) when dealing with // goroutine scheduling -- use [Handle.OpenThreadSelf] instead. // // To refer to the current thread-group, you should use prefer // [Handle.OpenSelf] to passing os.Getpid as the pid argument. func (proc *Handle) OpenPid(pid int, subpath string) (*os.File, error) { return proc.inner.OpenPid(pid, subpath, unix.O_PATH|unix.O_NOFOLLOW) } // ProcSelfFdReadlink gets the real path of the given file by looking at // /proc/self/fd/ with [readlink]. It is effectively just shorthand for // something along the lines of: // // proc, err := procfs.OpenProcRoot() // if err != nil { // return err // } // link, err := proc.OpenThreadSelf(fmt.Sprintf("fd/%d", f.Fd())) // if err != nil { // return err // } // defer link.Close() // var buf [4096]byte // n, err := unix.Readlinkat(int(link.Fd()), "", buf[:]) // if err != nil { // return err // } // pathname := buf[:n] // // [readlink]: https://pkg.go.dev/golang.org/x/sys/unix#Readlinkat func ProcSelfFdReadlink(f *os.File) (string, error) { proc, err := procfs.Open() if err != nil { return "", err } defer proc.Close() //nolint:errcheck // close failures aren't critical here fdPath := "fd/" + strconv.Itoa(int(f.Fd())) return proc.Readlink(procfs.ProcThreadSelf, fdPath) } ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/pathrs-lite/procfs/procfs_purego.go ================================================ // SPDX-License-Identifier: MPL-2.0 //go:build linux && !libpathrs // Copyright (C) 2024-2025 Aleksa Sarai // Copyright (C) 2024-2025 SUSE LLC // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. // Package procfs provides a safe API for operating on /proc on Linux. package procfs import ( "os" "github.com/cyphar/filepath-securejoin/pathrs-lite/internal/procfs" ) // This package mostly just wraps internal/procfs APIs. This is necessary // because we are forced to export some things from internal/procfs in order to // avoid some dependency cycle issues, but we don't want users to see or use // them. // ProcThreadSelfCloser is a callback that needs to be called when you are done // operating on an [os.File] fetched using [Handle.OpenThreadSelf]. // // [os.File]: https://pkg.go.dev/os#File type ProcThreadSelfCloser = procfs.ProcThreadSelfCloser // Handle is a wrapper around an *os.File handle to "/proc", which can be used // to do further procfs-related operations in a safe way. type Handle struct { inner *procfs.Handle } // Close close the resources associated with this [Handle]. Note that if this // [Handle] was created with [OpenProcRoot], on some kernels the underlying // procfs handle is cached and so this Close operation may be a no-op. However, // you should always call Close on [Handle]s once you are done with them. func (proc *Handle) Close() error { return proc.inner.Close() } // OpenProcRoot tries to open a "safer" handle to "/proc" (i.e., one with the // "subset=pid" mount option applied, available from Linux 5.8). Unless you // plan to do many [Handle.OpenRoot] operations, users should prefer to use // this over [OpenUnsafeProcRoot] which is far more dangerous to keep open. // // If a safe handle cannot be opened, OpenProcRoot will fall back to opening a // regular "/proc" handle. // // Note that using [Handle.OpenRoot] will still work with handles returned by // this function. If a subpath cannot be operated on with a safe "/proc" // handle, then [OpenUnsafeProcRoot] will be called internally and a temporary // unsafe handle will be used. func OpenProcRoot() (*Handle, error) { proc, err := procfs.OpenProcRoot() if err != nil { return nil, err } return &Handle{inner: proc}, nil } // OpenUnsafeProcRoot opens a handle to "/proc" without any overmounts or // masked paths. You must be extremely careful to make sure this handle is // never leaked to a container and that you program cannot be tricked into // writing to arbitrary paths within it. // // This is not necessary if you just wish to use [Handle.OpenRoot], as handles // returned by [OpenProcRoot] will fall back to using a *temporary* unsafe // handle in that case. You should only really use this if you need to do many // operations with [Handle.OpenRoot] and the performance overhead of making // many procfs handles is an issue. If you do use OpenUnsafeProcRoot, you // should make sure to close the handle as soon as possible to avoid // known-fd-number attacks. func OpenUnsafeProcRoot() (*Handle, error) { proc, err := procfs.OpenUnsafeProcRoot() if err != nil { return nil, err } return &Handle{inner: proc}, nil } // OpenThreadSelf returns a handle to "/proc/thread-self/" (or an // equivalent handle on older kernels where "/proc/thread-self" doesn't exist). // Once finished with the handle, you must call the returned closer function // ([runtime.UnlockOSThread]). You must not pass the returned *os.File to other // Go threads or use the handle after calling the closer. // // [runtime.UnlockOSThread]: https://pkg.go.dev/runtime#UnlockOSThread func (proc *Handle) OpenThreadSelf(subpath string) (*os.File, ProcThreadSelfCloser, error) { return proc.inner.OpenThreadSelf(subpath) } // OpenSelf returns a handle to /proc/self/. // // Note that in Go programs with non-homogenous threads, this may result in // spurious errors. If you are monkeying around with APIs that are // thread-specific, you probably want to use [Handle.OpenThreadSelf] instead // which will guarantee that the handle refers to the same thread as the caller // is executing on. func (proc *Handle) OpenSelf(subpath string) (*os.File, error) { return proc.inner.OpenSelf(subpath) } // OpenRoot returns a handle to /proc/. // // You should only use this when you need to operate on global procfs files // (such as sysctls in /proc/sys). Unlike [Handle.OpenThreadSelf], // [Handle.OpenSelf], and [Handle.OpenPid], the procfs handle used internally // for this operation will never use "subset=pid", which makes it a more juicy // target for [CVE-2024-21626]-style attacks (and doing something like opening // a directory with OpenRoot effectively leaks [OpenUnsafeProcRoot] as long as // the file descriptor is open). // // [CVE-2024-21626]: https://github.com/opencontainers/runc/security/advisories/GHSA-xr7r-f8xq-vfvv func (proc *Handle) OpenRoot(subpath string) (*os.File, error) { return proc.inner.OpenRoot(subpath) } // OpenPid returns a handle to /proc/$pid/ (pid can be a pid or tid). // This is mainly intended for usage when operating on other processes. // // You should not use this for the current thread, as special handling is // needed for /proc/thread-self (or /proc/self/task/) when dealing with // goroutine scheduling -- use [Handle.OpenThreadSelf] instead. // // To refer to the current thread-group, you should use prefer // [Handle.OpenSelf] to passing os.Getpid as the pid argument. func (proc *Handle) OpenPid(pid int, subpath string) (*os.File, error) { return proc.inner.OpenPid(pid, subpath) } // ProcSelfFdReadlink gets the real path of the given file by looking at // /proc/self/fd/ with [readlink]. It is effectively just shorthand for // something along the lines of: // // proc, err := procfs.OpenProcRoot() // if err != nil { // return err // } // link, err := proc.OpenThreadSelf(fmt.Sprintf("fd/%d", f.Fd())) // if err != nil { // return err // } // defer link.Close() // var buf [4096]byte // n, err := unix.Readlinkat(int(link.Fd()), "", buf[:]) // if err != nil { // return err // } // pathname := buf[:n] // // [readlink]: https://pkg.go.dev/golang.org/x/sys/unix#Readlinkat func ProcSelfFdReadlink(f *os.File) (string, error) { return procfs.ProcSelfFdReadlink(f) } ================================================ FILE: vendor/github.com/cyphar/filepath-securejoin/vfs.go ================================================ // SPDX-License-Identifier: BSD-3-Clause // Copyright (C) 2017-2024 SUSE LLC. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package securejoin import "os" // In future this should be moved into a separate package, because now there // are several projects (umoci and go-mtree) that are using this sort of // interface. // VFS is the minimal interface necessary to use [SecureJoinVFS]. A nil VFS is // equivalent to using the standard [os].* family of functions. This is mainly // used for the purposes of mock testing, but also can be used to otherwise use // [SecureJoinVFS] with VFS-like system. type VFS interface { // Lstat returns an [os.FileInfo] describing the named file. If the // file is a symbolic link, the returned [os.FileInfo] describes the // symbolic link. Lstat makes no attempt to follow the link. // The semantics are identical to [os.Lstat]. Lstat(name string) (os.FileInfo, error) // Readlink returns the destination of the named symbolic link. // The semantics are identical to [os.Readlink]. Readlink(name string) (string, error) } // osVFS is the "nil" VFS, in that it just passes everything through to the os // module. type osVFS struct{} func (o osVFS) Lstat(name string) (os.FileInfo, error) { return os.Lstat(name) } func (o osVFS) Readlink(name string) (string, error) { return os.Readlink(name) } ================================================ FILE: vendor/github.com/davecgh/go-spew/LICENSE ================================================ ISC License Copyright (c) 2012-2016 Dave Collins Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ================================================ FILE: vendor/github.com/davecgh/go-spew/spew/bypass.go ================================================ // Copyright (c) 2015-2016 Dave Collins // // Permission to use, copy, modify, and distribute this software for any // purpose with or without fee is hereby granted, provided that the above // copyright notice and this permission notice appear in all copies. // // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. // NOTE: Due to the following build constraints, this file will only be compiled // when the code is not running on Google App Engine, compiled by GopherJS, and // "-tags safe" is not added to the go build command line. The "disableunsafe" // tag is deprecated and thus should not be used. // Go versions prior to 1.4 are disabled because they use a different layout // for interfaces which make the implementation of unsafeReflectValue more complex. // +build !js,!appengine,!safe,!disableunsafe,go1.4 package spew import ( "reflect" "unsafe" ) const ( // UnsafeDisabled is a build-time constant which specifies whether or // not access to the unsafe package is available. UnsafeDisabled = false // ptrSize is the size of a pointer on the current arch. ptrSize = unsafe.Sizeof((*byte)(nil)) ) type flag uintptr var ( // flagRO indicates whether the value field of a reflect.Value // is read-only. flagRO flag // flagAddr indicates whether the address of the reflect.Value's // value may be taken. flagAddr flag ) // flagKindMask holds the bits that make up the kind // part of the flags field. In all the supported versions, // it is in the lower 5 bits. const flagKindMask = flag(0x1f) // Different versions of Go have used different // bit layouts for the flags type. This table // records the known combinations. var okFlags = []struct { ro, addr flag }{{ // From Go 1.4 to 1.5 ro: 1 << 5, addr: 1 << 7, }, { // Up to Go tip. ro: 1<<5 | 1<<6, addr: 1 << 8, }} var flagValOffset = func() uintptr { field, ok := reflect.TypeOf(reflect.Value{}).FieldByName("flag") if !ok { panic("reflect.Value has no flag field") } return field.Offset }() // flagField returns a pointer to the flag field of a reflect.Value. func flagField(v *reflect.Value) *flag { return (*flag)(unsafe.Pointer(uintptr(unsafe.Pointer(v)) + flagValOffset)) } // unsafeReflectValue converts the passed reflect.Value into a one that bypasses // the typical safety restrictions preventing access to unaddressable and // unexported data. It works by digging the raw pointer to the underlying // value out of the protected value and generating a new unprotected (unsafe) // reflect.Value to it. // // This allows us to check for implementations of the Stringer and error // interfaces to be used for pretty printing ordinarily unaddressable and // inaccessible values such as unexported struct fields. func unsafeReflectValue(v reflect.Value) reflect.Value { if !v.IsValid() || (v.CanInterface() && v.CanAddr()) { return v } flagFieldPtr := flagField(&v) *flagFieldPtr &^= flagRO *flagFieldPtr |= flagAddr return v } // Sanity checks against future reflect package changes // to the type or semantics of the Value.flag field. func init() { field, ok := reflect.TypeOf(reflect.Value{}).FieldByName("flag") if !ok { panic("reflect.Value has no flag field") } if field.Type.Kind() != reflect.TypeOf(flag(0)).Kind() { panic("reflect.Value flag field has changed kind") } type t0 int var t struct { A t0 // t0 will have flagEmbedRO set. t0 // a will have flagStickyRO set a t0 } vA := reflect.ValueOf(t).FieldByName("A") va := reflect.ValueOf(t).FieldByName("a") vt0 := reflect.ValueOf(t).FieldByName("t0") // Infer flagRO from the difference between the flags // for the (otherwise identical) fields in t. flagPublic := *flagField(&vA) flagWithRO := *flagField(&va) | *flagField(&vt0) flagRO = flagPublic ^ flagWithRO // Infer flagAddr from the difference between a value // taken from a pointer and not. vPtrA := reflect.ValueOf(&t).Elem().FieldByName("A") flagNoPtr := *flagField(&vA) flagPtr := *flagField(&vPtrA) flagAddr = flagNoPtr ^ flagPtr // Check that the inferred flags tally with one of the known versions. for _, f := range okFlags { if flagRO == f.ro && flagAddr == f.addr { return } } panic("reflect.Value read-only flag has changed semantics") } ================================================ FILE: vendor/github.com/davecgh/go-spew/spew/bypasssafe.go ================================================ // Copyright (c) 2015-2016 Dave Collins // // Permission to use, copy, modify, and distribute this software for any // purpose with or without fee is hereby granted, provided that the above // copyright notice and this permission notice appear in all copies. // // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. // NOTE: Due to the following build constraints, this file will only be compiled // when the code is running on Google App Engine, compiled by GopherJS, or // "-tags safe" is added to the go build command line. The "disableunsafe" // tag is deprecated and thus should not be used. // +build js appengine safe disableunsafe !go1.4 package spew import "reflect" const ( // UnsafeDisabled is a build-time constant which specifies whether or // not access to the unsafe package is available. UnsafeDisabled = true ) // unsafeReflectValue typically converts the passed reflect.Value into a one // that bypasses the typical safety restrictions preventing access to // unaddressable and unexported data. However, doing this relies on access to // the unsafe package. This is a stub version which simply returns the passed // reflect.Value when the unsafe package is not available. func unsafeReflectValue(v reflect.Value) reflect.Value { return v } ================================================ FILE: vendor/github.com/davecgh/go-spew/spew/common.go ================================================ /* * Copyright (c) 2013-2016 Dave Collins * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ package spew import ( "bytes" "fmt" "io" "reflect" "sort" "strconv" ) // Some constants in the form of bytes to avoid string overhead. This mirrors // the technique used in the fmt package. var ( panicBytes = []byte("(PANIC=") plusBytes = []byte("+") iBytes = []byte("i") trueBytes = []byte("true") falseBytes = []byte("false") interfaceBytes = []byte("(interface {})") commaNewlineBytes = []byte(",\n") newlineBytes = []byte("\n") openBraceBytes = []byte("{") openBraceNewlineBytes = []byte("{\n") closeBraceBytes = []byte("}") asteriskBytes = []byte("*") colonBytes = []byte(":") colonSpaceBytes = []byte(": ") openParenBytes = []byte("(") closeParenBytes = []byte(")") spaceBytes = []byte(" ") pointerChainBytes = []byte("->") nilAngleBytes = []byte("") maxNewlineBytes = []byte("\n") maxShortBytes = []byte("") circularBytes = []byte("") circularShortBytes = []byte("") invalidAngleBytes = []byte("") openBracketBytes = []byte("[") closeBracketBytes = []byte("]") percentBytes = []byte("%") precisionBytes = []byte(".") openAngleBytes = []byte("<") closeAngleBytes = []byte(">") openMapBytes = []byte("map[") closeMapBytes = []byte("]") lenEqualsBytes = []byte("len=") capEqualsBytes = []byte("cap=") ) // hexDigits is used to map a decimal value to a hex digit. var hexDigits = "0123456789abcdef" // catchPanic handles any panics that might occur during the handleMethods // calls. func catchPanic(w io.Writer, v reflect.Value) { if err := recover(); err != nil { w.Write(panicBytes) fmt.Fprintf(w, "%v", err) w.Write(closeParenBytes) } } // handleMethods attempts to call the Error and String methods on the underlying // type the passed reflect.Value represents and outputes the result to Writer w. // // It handles panics in any called methods by catching and displaying the error // as the formatted value. func handleMethods(cs *ConfigState, w io.Writer, v reflect.Value) (handled bool) { // We need an interface to check if the type implements the error or // Stringer interface. However, the reflect package won't give us an // interface on certain things like unexported struct fields in order // to enforce visibility rules. We use unsafe, when it's available, // to bypass these restrictions since this package does not mutate the // values. if !v.CanInterface() { if UnsafeDisabled { return false } v = unsafeReflectValue(v) } // Choose whether or not to do error and Stringer interface lookups against // the base type or a pointer to the base type depending on settings. // Technically calling one of these methods with a pointer receiver can // mutate the value, however, types which choose to satisify an error or // Stringer interface with a pointer receiver should not be mutating their // state inside these interface methods. if !cs.DisablePointerMethods && !UnsafeDisabled && !v.CanAddr() { v = unsafeReflectValue(v) } if v.CanAddr() { v = v.Addr() } // Is it an error or Stringer? switch iface := v.Interface().(type) { case error: defer catchPanic(w, v) if cs.ContinueOnMethod { w.Write(openParenBytes) w.Write([]byte(iface.Error())) w.Write(closeParenBytes) w.Write(spaceBytes) return false } w.Write([]byte(iface.Error())) return true case fmt.Stringer: defer catchPanic(w, v) if cs.ContinueOnMethod { w.Write(openParenBytes) w.Write([]byte(iface.String())) w.Write(closeParenBytes) w.Write(spaceBytes) return false } w.Write([]byte(iface.String())) return true } return false } // printBool outputs a boolean value as true or false to Writer w. func printBool(w io.Writer, val bool) { if val { w.Write(trueBytes) } else { w.Write(falseBytes) } } // printInt outputs a signed integer value to Writer w. func printInt(w io.Writer, val int64, base int) { w.Write([]byte(strconv.FormatInt(val, base))) } // printUint outputs an unsigned integer value to Writer w. func printUint(w io.Writer, val uint64, base int) { w.Write([]byte(strconv.FormatUint(val, base))) } // printFloat outputs a floating point value using the specified precision, // which is expected to be 32 or 64bit, to Writer w. func printFloat(w io.Writer, val float64, precision int) { w.Write([]byte(strconv.FormatFloat(val, 'g', -1, precision))) } // printComplex outputs a complex value using the specified float precision // for the real and imaginary parts to Writer w. func printComplex(w io.Writer, c complex128, floatPrecision int) { r := real(c) w.Write(openParenBytes) w.Write([]byte(strconv.FormatFloat(r, 'g', -1, floatPrecision))) i := imag(c) if i >= 0 { w.Write(plusBytes) } w.Write([]byte(strconv.FormatFloat(i, 'g', -1, floatPrecision))) w.Write(iBytes) w.Write(closeParenBytes) } // printHexPtr outputs a uintptr formatted as hexadecimal with a leading '0x' // prefix to Writer w. func printHexPtr(w io.Writer, p uintptr) { // Null pointer. num := uint64(p) if num == 0 { w.Write(nilAngleBytes) return } // Max uint64 is 16 bytes in hex + 2 bytes for '0x' prefix buf := make([]byte, 18) // It's simpler to construct the hex string right to left. base := uint64(16) i := len(buf) - 1 for num >= base { buf[i] = hexDigits[num%base] num /= base i-- } buf[i] = hexDigits[num] // Add '0x' prefix. i-- buf[i] = 'x' i-- buf[i] = '0' // Strip unused leading bytes. buf = buf[i:] w.Write(buf) } // valuesSorter implements sort.Interface to allow a slice of reflect.Value // elements to be sorted. type valuesSorter struct { values []reflect.Value strings []string // either nil or same len and values cs *ConfigState } // newValuesSorter initializes a valuesSorter instance, which holds a set of // surrogate keys on which the data should be sorted. It uses flags in // ConfigState to decide if and how to populate those surrogate keys. func newValuesSorter(values []reflect.Value, cs *ConfigState) sort.Interface { vs := &valuesSorter{values: values, cs: cs} if canSortSimply(vs.values[0].Kind()) { return vs } if !cs.DisableMethods { vs.strings = make([]string, len(values)) for i := range vs.values { b := bytes.Buffer{} if !handleMethods(cs, &b, vs.values[i]) { vs.strings = nil break } vs.strings[i] = b.String() } } if vs.strings == nil && cs.SpewKeys { vs.strings = make([]string, len(values)) for i := range vs.values { vs.strings[i] = Sprintf("%#v", vs.values[i].Interface()) } } return vs } // canSortSimply tests whether a reflect.Kind is a primitive that can be sorted // directly, or whether it should be considered for sorting by surrogate keys // (if the ConfigState allows it). func canSortSimply(kind reflect.Kind) bool { // This switch parallels valueSortLess, except for the default case. switch kind { case reflect.Bool: return true case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int: return true case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint: return true case reflect.Float32, reflect.Float64: return true case reflect.String: return true case reflect.Uintptr: return true case reflect.Array: return true } return false } // Len returns the number of values in the slice. It is part of the // sort.Interface implementation. func (s *valuesSorter) Len() int { return len(s.values) } // Swap swaps the values at the passed indices. It is part of the // sort.Interface implementation. func (s *valuesSorter) Swap(i, j int) { s.values[i], s.values[j] = s.values[j], s.values[i] if s.strings != nil { s.strings[i], s.strings[j] = s.strings[j], s.strings[i] } } // valueSortLess returns whether the first value should sort before the second // value. It is used by valueSorter.Less as part of the sort.Interface // implementation. func valueSortLess(a, b reflect.Value) bool { switch a.Kind() { case reflect.Bool: return !a.Bool() && b.Bool() case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int: return a.Int() < b.Int() case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint: return a.Uint() < b.Uint() case reflect.Float32, reflect.Float64: return a.Float() < b.Float() case reflect.String: return a.String() < b.String() case reflect.Uintptr: return a.Uint() < b.Uint() case reflect.Array: // Compare the contents of both arrays. l := a.Len() for i := 0; i < l; i++ { av := a.Index(i) bv := b.Index(i) if av.Interface() == bv.Interface() { continue } return valueSortLess(av, bv) } } return a.String() < b.String() } // Less returns whether the value at index i should sort before the // value at index j. It is part of the sort.Interface implementation. func (s *valuesSorter) Less(i, j int) bool { if s.strings == nil { return valueSortLess(s.values[i], s.values[j]) } return s.strings[i] < s.strings[j] } // sortValues is a sort function that handles both native types and any type that // can be converted to error or Stringer. Other inputs are sorted according to // their Value.String() value to ensure display stability. func sortValues(values []reflect.Value, cs *ConfigState) { if len(values) == 0 { return } sort.Sort(newValuesSorter(values, cs)) } ================================================ FILE: vendor/github.com/davecgh/go-spew/spew/config.go ================================================ /* * Copyright (c) 2013-2016 Dave Collins * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ package spew import ( "bytes" "fmt" "io" "os" ) // ConfigState houses the configuration options used by spew to format and // display values. There is a global instance, Config, that is used to control // all top-level Formatter and Dump functionality. Each ConfigState instance // provides methods equivalent to the top-level functions. // // The zero value for ConfigState provides no indentation. You would typically // want to set it to a space or a tab. // // Alternatively, you can use NewDefaultConfig to get a ConfigState instance // with default settings. See the documentation of NewDefaultConfig for default // values. type ConfigState struct { // Indent specifies the string to use for each indentation level. The // global config instance that all top-level functions use set this to a // single space by default. If you would like more indentation, you might // set this to a tab with "\t" or perhaps two spaces with " ". Indent string // MaxDepth controls the maximum number of levels to descend into nested // data structures. The default, 0, means there is no limit. // // NOTE: Circular data structures are properly detected, so it is not // necessary to set this value unless you specifically want to limit deeply // nested data structures. MaxDepth int // DisableMethods specifies whether or not error and Stringer interfaces are // invoked for types that implement them. DisableMethods bool // DisablePointerMethods specifies whether or not to check for and invoke // error and Stringer interfaces on types which only accept a pointer // receiver when the current type is not a pointer. // // NOTE: This might be an unsafe action since calling one of these methods // with a pointer receiver could technically mutate the value, however, // in practice, types which choose to satisify an error or Stringer // interface with a pointer receiver should not be mutating their state // inside these interface methods. As a result, this option relies on // access to the unsafe package, so it will not have any effect when // running in environments without access to the unsafe package such as // Google App Engine or with the "safe" build tag specified. DisablePointerMethods bool // DisablePointerAddresses specifies whether to disable the printing of // pointer addresses. This is useful when diffing data structures in tests. DisablePointerAddresses bool // DisableCapacities specifies whether to disable the printing of capacities // for arrays, slices, maps and channels. This is useful when diffing // data structures in tests. DisableCapacities bool // ContinueOnMethod specifies whether or not recursion should continue once // a custom error or Stringer interface is invoked. The default, false, // means it will print the results of invoking the custom error or Stringer // interface and return immediately instead of continuing to recurse into // the internals of the data type. // // NOTE: This flag does not have any effect if method invocation is disabled // via the DisableMethods or DisablePointerMethods options. ContinueOnMethod bool // SortKeys specifies map keys should be sorted before being printed. Use // this to have a more deterministic, diffable output. Note that only // native types (bool, int, uint, floats, uintptr and string) and types // that support the error or Stringer interfaces (if methods are // enabled) are supported, with other types sorted according to the // reflect.Value.String() output which guarantees display stability. SortKeys bool // SpewKeys specifies that, as a last resort attempt, map keys should // be spewed to strings and sorted by those strings. This is only // considered if SortKeys is true. SpewKeys bool } // Config is the active configuration of the top-level functions. // The configuration can be changed by modifying the contents of spew.Config. var Config = ConfigState{Indent: " "} // Errorf is a wrapper for fmt.Errorf that treats each argument as if it were // passed with a Formatter interface returned by c.NewFormatter. It returns // the formatted string as a value that satisfies error. See NewFormatter // for formatting details. // // This function is shorthand for the following syntax: // // fmt.Errorf(format, c.NewFormatter(a), c.NewFormatter(b)) func (c *ConfigState) Errorf(format string, a ...interface{}) (err error) { return fmt.Errorf(format, c.convertArgs(a)...) } // Fprint is a wrapper for fmt.Fprint that treats each argument as if it were // passed with a Formatter interface returned by c.NewFormatter. It returns // the number of bytes written and any write error encountered. See // NewFormatter for formatting details. // // This function is shorthand for the following syntax: // // fmt.Fprint(w, c.NewFormatter(a), c.NewFormatter(b)) func (c *ConfigState) Fprint(w io.Writer, a ...interface{}) (n int, err error) { return fmt.Fprint(w, c.convertArgs(a)...) } // Fprintf is a wrapper for fmt.Fprintf that treats each argument as if it were // passed with a Formatter interface returned by c.NewFormatter. It returns // the number of bytes written and any write error encountered. See // NewFormatter for formatting details. // // This function is shorthand for the following syntax: // // fmt.Fprintf(w, format, c.NewFormatter(a), c.NewFormatter(b)) func (c *ConfigState) Fprintf(w io.Writer, format string, a ...interface{}) (n int, err error) { return fmt.Fprintf(w, format, c.convertArgs(a)...) } // Fprintln is a wrapper for fmt.Fprintln that treats each argument as if it // passed with a Formatter interface returned by c.NewFormatter. See // NewFormatter for formatting details. // // This function is shorthand for the following syntax: // // fmt.Fprintln(w, c.NewFormatter(a), c.NewFormatter(b)) func (c *ConfigState) Fprintln(w io.Writer, a ...interface{}) (n int, err error) { return fmt.Fprintln(w, c.convertArgs(a)...) } // Print is a wrapper for fmt.Print that treats each argument as if it were // passed with a Formatter interface returned by c.NewFormatter. It returns // the number of bytes written and any write error encountered. See // NewFormatter for formatting details. // // This function is shorthand for the following syntax: // // fmt.Print(c.NewFormatter(a), c.NewFormatter(b)) func (c *ConfigState) Print(a ...interface{}) (n int, err error) { return fmt.Print(c.convertArgs(a)...) } // Printf is a wrapper for fmt.Printf that treats each argument as if it were // passed with a Formatter interface returned by c.NewFormatter. It returns // the number of bytes written and any write error encountered. See // NewFormatter for formatting details. // // This function is shorthand for the following syntax: // // fmt.Printf(format, c.NewFormatter(a), c.NewFormatter(b)) func (c *ConfigState) Printf(format string, a ...interface{}) (n int, err error) { return fmt.Printf(format, c.convertArgs(a)...) } // Println is a wrapper for fmt.Println that treats each argument as if it were // passed with a Formatter interface returned by c.NewFormatter. It returns // the number of bytes written and any write error encountered. See // NewFormatter for formatting details. // // This function is shorthand for the following syntax: // // fmt.Println(c.NewFormatter(a), c.NewFormatter(b)) func (c *ConfigState) Println(a ...interface{}) (n int, err error) { return fmt.Println(c.convertArgs(a)...) } // Sprint is a wrapper for fmt.Sprint that treats each argument as if it were // passed with a Formatter interface returned by c.NewFormatter. It returns // the resulting string. See NewFormatter for formatting details. // // This function is shorthand for the following syntax: // // fmt.Sprint(c.NewFormatter(a), c.NewFormatter(b)) func (c *ConfigState) Sprint(a ...interface{}) string { return fmt.Sprint(c.convertArgs(a)...) } // Sprintf is a wrapper for fmt.Sprintf that treats each argument as if it were // passed with a Formatter interface returned by c.NewFormatter. It returns // the resulting string. See NewFormatter for formatting details. // // This function is shorthand for the following syntax: // // fmt.Sprintf(format, c.NewFormatter(a), c.NewFormatter(b)) func (c *ConfigState) Sprintf(format string, a ...interface{}) string { return fmt.Sprintf(format, c.convertArgs(a)...) } // Sprintln is a wrapper for fmt.Sprintln that treats each argument as if it // were passed with a Formatter interface returned by c.NewFormatter. It // returns the resulting string. See NewFormatter for formatting details. // // This function is shorthand for the following syntax: // // fmt.Sprintln(c.NewFormatter(a), c.NewFormatter(b)) func (c *ConfigState) Sprintln(a ...interface{}) string { return fmt.Sprintln(c.convertArgs(a)...) } /* NewFormatter returns a custom formatter that satisfies the fmt.Formatter interface. As a result, it integrates cleanly with standard fmt package printing functions. The formatter is useful for inline printing of smaller data types similar to the standard %v format specifier. The custom formatter only responds to the %v (most compact), %+v (adds pointer addresses), %#v (adds types), and %#+v (adds types and pointer addresses) verb combinations. Any other verbs such as %x and %q will be sent to the the standard fmt package for formatting. In addition, the custom formatter ignores the width and precision arguments (however they will still work on the format specifiers not handled by the custom formatter). Typically this function shouldn't be called directly. It is much easier to make use of the custom formatter by calling one of the convenience functions such as c.Printf, c.Println, or c.Printf. */ func (c *ConfigState) NewFormatter(v interface{}) fmt.Formatter { return newFormatter(c, v) } // Fdump formats and displays the passed arguments to io.Writer w. It formats // exactly the same as Dump. func (c *ConfigState) Fdump(w io.Writer, a ...interface{}) { fdump(c, w, a...) } /* Dump displays the passed parameters to standard out with newlines, customizable indentation, and additional debug information such as complete types and all pointer addresses used to indirect to the final value. It provides the following features over the built-in printing facilities provided by the fmt package: * Pointers are dereferenced and followed * Circular data structures are detected and handled properly * Custom Stringer/error interfaces are optionally invoked, including on unexported types * Custom types which only implement the Stringer/error interfaces via a pointer receiver are optionally invoked when passing non-pointer variables * Byte arrays and slices are dumped like the hexdump -C command which includes offsets, byte values in hex, and ASCII output The configuration options are controlled by modifying the public members of c. See ConfigState for options documentation. See Fdump if you would prefer dumping to an arbitrary io.Writer or Sdump to get the formatted result as a string. */ func (c *ConfigState) Dump(a ...interface{}) { fdump(c, os.Stdout, a...) } // Sdump returns a string with the passed arguments formatted exactly the same // as Dump. func (c *ConfigState) Sdump(a ...interface{}) string { var buf bytes.Buffer fdump(c, &buf, a...) return buf.String() } // convertArgs accepts a slice of arguments and returns a slice of the same // length with each argument converted to a spew Formatter interface using // the ConfigState associated with s. func (c *ConfigState) convertArgs(args []interface{}) (formatters []interface{}) { formatters = make([]interface{}, len(args)) for index, arg := range args { formatters[index] = newFormatter(c, arg) } return formatters } // NewDefaultConfig returns a ConfigState with the following default settings. // // Indent: " " // MaxDepth: 0 // DisableMethods: false // DisablePointerMethods: false // ContinueOnMethod: false // SortKeys: false func NewDefaultConfig() *ConfigState { return &ConfigState{Indent: " "} } ================================================ FILE: vendor/github.com/davecgh/go-spew/spew/doc.go ================================================ /* * Copyright (c) 2013-2016 Dave Collins * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* Package spew implements a deep pretty printer for Go data structures to aid in debugging. A quick overview of the additional features spew provides over the built-in printing facilities for Go data types are as follows: * Pointers are dereferenced and followed * Circular data structures are detected and handled properly * Custom Stringer/error interfaces are optionally invoked, including on unexported types * Custom types which only implement the Stringer/error interfaces via a pointer receiver are optionally invoked when passing non-pointer variables * Byte arrays and slices are dumped like the hexdump -C command which includes offsets, byte values in hex, and ASCII output (only when using Dump style) There are two different approaches spew allows for dumping Go data structures: * Dump style which prints with newlines, customizable indentation, and additional debug information such as types and all pointer addresses used to indirect to the final value * A custom Formatter interface that integrates cleanly with the standard fmt package and replaces %v, %+v, %#v, and %#+v to provide inline printing similar to the default %v while providing the additional functionality outlined above and passing unsupported format verbs such as %x and %q along to fmt Quick Start This section demonstrates how to quickly get started with spew. See the sections below for further details on formatting and configuration options. To dump a variable with full newlines, indentation, type, and pointer information use Dump, Fdump, or Sdump: spew.Dump(myVar1, myVar2, ...) spew.Fdump(someWriter, myVar1, myVar2, ...) str := spew.Sdump(myVar1, myVar2, ...) Alternatively, if you would prefer to use format strings with a compacted inline printing style, use the convenience wrappers Printf, Fprintf, etc with %v (most compact), %+v (adds pointer addresses), %#v (adds types), or %#+v (adds types and pointer addresses): spew.Printf("myVar1: %v -- myVar2: %+v", myVar1, myVar2) spew.Printf("myVar3: %#v -- myVar4: %#+v", myVar3, myVar4) spew.Fprintf(someWriter, "myVar1: %v -- myVar2: %+v", myVar1, myVar2) spew.Fprintf(someWriter, "myVar3: %#v -- myVar4: %#+v", myVar3, myVar4) Configuration Options Configuration of spew is handled by fields in the ConfigState type. For convenience, all of the top-level functions use a global state available via the spew.Config global. It is also possible to create a ConfigState instance that provides methods equivalent to the top-level functions. This allows concurrent configuration options. See the ConfigState documentation for more details. The following configuration options are available: * Indent String to use for each indentation level for Dump functions. It is a single space by default. A popular alternative is "\t". * MaxDepth Maximum number of levels to descend into nested data structures. There is no limit by default. * DisableMethods Disables invocation of error and Stringer interface methods. Method invocation is enabled by default. * DisablePointerMethods Disables invocation of error and Stringer interface methods on types which only accept pointer receivers from non-pointer variables. Pointer method invocation is enabled by default. * DisablePointerAddresses DisablePointerAddresses specifies whether to disable the printing of pointer addresses. This is useful when diffing data structures in tests. * DisableCapacities DisableCapacities specifies whether to disable the printing of capacities for arrays, slices, maps and channels. This is useful when diffing data structures in tests. * ContinueOnMethod Enables recursion into types after invoking error and Stringer interface methods. Recursion after method invocation is disabled by default. * SortKeys Specifies map keys should be sorted before being printed. Use this to have a more deterministic, diffable output. Note that only native types (bool, int, uint, floats, uintptr and string) and types which implement error or Stringer interfaces are supported with other types sorted according to the reflect.Value.String() output which guarantees display stability. Natural map order is used by default. * SpewKeys Specifies that, as a last resort attempt, map keys should be spewed to strings and sorted by those strings. This is only considered if SortKeys is true. Dump Usage Simply call spew.Dump with a list of variables you want to dump: spew.Dump(myVar1, myVar2, ...) You may also call spew.Fdump if you would prefer to output to an arbitrary io.Writer. For example, to dump to standard error: spew.Fdump(os.Stderr, myVar1, myVar2, ...) A third option is to call spew.Sdump to get the formatted output as a string: str := spew.Sdump(myVar1, myVar2, ...) Sample Dump Output See the Dump example for details on the setup of the types and variables being shown here. (main.Foo) { unexportedField: (*main.Bar)(0xf84002e210)({ flag: (main.Flag) flagTwo, data: (uintptr) }), ExportedField: (map[interface {}]interface {}) (len=1) { (string) (len=3) "one": (bool) true } } Byte (and uint8) arrays and slices are displayed uniquely like the hexdump -C command as shown. ([]uint8) (len=32 cap=32) { 00000000 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 |............... | 00000010 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 |!"#$%&'()*+,-./0| 00000020 31 32 |12| } Custom Formatter Spew provides a custom formatter that implements the fmt.Formatter interface so that it integrates cleanly with standard fmt package printing functions. The formatter is useful for inline printing of smaller data types similar to the standard %v format specifier. The custom formatter only responds to the %v (most compact), %+v (adds pointer addresses), %#v (adds types), or %#+v (adds types and pointer addresses) verb combinations. Any other verbs such as %x and %q will be sent to the the standard fmt package for formatting. In addition, the custom formatter ignores the width and precision arguments (however they will still work on the format specifiers not handled by the custom formatter). Custom Formatter Usage The simplest way to make use of the spew custom formatter is to call one of the convenience functions such as spew.Printf, spew.Println, or spew.Printf. The functions have syntax you are most likely already familiar with: spew.Printf("myVar1: %v -- myVar2: %+v", myVar1, myVar2) spew.Printf("myVar3: %#v -- myVar4: %#+v", myVar3, myVar4) spew.Println(myVar, myVar2) spew.Fprintf(os.Stderr, "myVar1: %v -- myVar2: %+v", myVar1, myVar2) spew.Fprintf(os.Stderr, "myVar3: %#v -- myVar4: %#+v", myVar3, myVar4) See the Index for the full list convenience functions. Sample Formatter Output Double pointer to a uint8: %v: <**>5 %+v: <**>(0xf8400420d0->0xf8400420c8)5 %#v: (**uint8)5 %#+v: (**uint8)(0xf8400420d0->0xf8400420c8)5 Pointer to circular struct with a uint8 field and a pointer to itself: %v: <*>{1 <*>} %+v: <*>(0xf84003e260){ui8:1 c:<*>(0xf84003e260)} %#v: (*main.circular){ui8:(uint8)1 c:(*main.circular)} %#+v: (*main.circular)(0xf84003e260){ui8:(uint8)1 c:(*main.circular)(0xf84003e260)} See the Printf example for details on the setup of variables being shown here. Errors Since it is possible for custom Stringer/error interfaces to panic, spew detects them and handles them internally by printing the panic information inline with the output. Since spew is intended to provide deep pretty printing capabilities on structures, it intentionally does not return any errors. */ package spew ================================================ FILE: vendor/github.com/davecgh/go-spew/spew/dump.go ================================================ /* * Copyright (c) 2013-2016 Dave Collins * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ package spew import ( "bytes" "encoding/hex" "fmt" "io" "os" "reflect" "regexp" "strconv" "strings" ) var ( // uint8Type is a reflect.Type representing a uint8. It is used to // convert cgo types to uint8 slices for hexdumping. uint8Type = reflect.TypeOf(uint8(0)) // cCharRE is a regular expression that matches a cgo char. // It is used to detect character arrays to hexdump them. cCharRE = regexp.MustCompile(`^.*\._Ctype_char$`) // cUnsignedCharRE is a regular expression that matches a cgo unsigned // char. It is used to detect unsigned character arrays to hexdump // them. cUnsignedCharRE = regexp.MustCompile(`^.*\._Ctype_unsignedchar$`) // cUint8tCharRE is a regular expression that matches a cgo uint8_t. // It is used to detect uint8_t arrays to hexdump them. cUint8tCharRE = regexp.MustCompile(`^.*\._Ctype_uint8_t$`) ) // dumpState contains information about the state of a dump operation. type dumpState struct { w io.Writer depth int pointers map[uintptr]int ignoreNextType bool ignoreNextIndent bool cs *ConfigState } // indent performs indentation according to the depth level and cs.Indent // option. func (d *dumpState) indent() { if d.ignoreNextIndent { d.ignoreNextIndent = false return } d.w.Write(bytes.Repeat([]byte(d.cs.Indent), d.depth)) } // unpackValue returns values inside of non-nil interfaces when possible. // This is useful for data types like structs, arrays, slices, and maps which // can contain varying types packed inside an interface. func (d *dumpState) unpackValue(v reflect.Value) reflect.Value { if v.Kind() == reflect.Interface && !v.IsNil() { v = v.Elem() } return v } // dumpPtr handles formatting of pointers by indirecting them as necessary. func (d *dumpState) dumpPtr(v reflect.Value) { // Remove pointers at or below the current depth from map used to detect // circular refs. for k, depth := range d.pointers { if depth >= d.depth { delete(d.pointers, k) } } // Keep list of all dereferenced pointers to show later. pointerChain := make([]uintptr, 0) // Figure out how many levels of indirection there are by dereferencing // pointers and unpacking interfaces down the chain while detecting circular // references. nilFound := false cycleFound := false indirects := 0 ve := v for ve.Kind() == reflect.Ptr { if ve.IsNil() { nilFound = true break } indirects++ addr := ve.Pointer() pointerChain = append(pointerChain, addr) if pd, ok := d.pointers[addr]; ok && pd < d.depth { cycleFound = true indirects-- break } d.pointers[addr] = d.depth ve = ve.Elem() if ve.Kind() == reflect.Interface { if ve.IsNil() { nilFound = true break } ve = ve.Elem() } } // Display type information. d.w.Write(openParenBytes) d.w.Write(bytes.Repeat(asteriskBytes, indirects)) d.w.Write([]byte(ve.Type().String())) d.w.Write(closeParenBytes) // Display pointer information. if !d.cs.DisablePointerAddresses && len(pointerChain) > 0 { d.w.Write(openParenBytes) for i, addr := range pointerChain { if i > 0 { d.w.Write(pointerChainBytes) } printHexPtr(d.w, addr) } d.w.Write(closeParenBytes) } // Display dereferenced value. d.w.Write(openParenBytes) switch { case nilFound: d.w.Write(nilAngleBytes) case cycleFound: d.w.Write(circularBytes) default: d.ignoreNextType = true d.dump(ve) } d.w.Write(closeParenBytes) } // dumpSlice handles formatting of arrays and slices. Byte (uint8 under // reflection) arrays and slices are dumped in hexdump -C fashion. func (d *dumpState) dumpSlice(v reflect.Value) { // Determine whether this type should be hex dumped or not. Also, // for types which should be hexdumped, try to use the underlying data // first, then fall back to trying to convert them to a uint8 slice. var buf []uint8 doConvert := false doHexDump := false numEntries := v.Len() if numEntries > 0 { vt := v.Index(0).Type() vts := vt.String() switch { // C types that need to be converted. case cCharRE.MatchString(vts): fallthrough case cUnsignedCharRE.MatchString(vts): fallthrough case cUint8tCharRE.MatchString(vts): doConvert = true // Try to use existing uint8 slices and fall back to converting // and copying if that fails. case vt.Kind() == reflect.Uint8: // We need an addressable interface to convert the type // to a byte slice. However, the reflect package won't // give us an interface on certain things like // unexported struct fields in order to enforce // visibility rules. We use unsafe, when available, to // bypass these restrictions since this package does not // mutate the values. vs := v if !vs.CanInterface() || !vs.CanAddr() { vs = unsafeReflectValue(vs) } if !UnsafeDisabled { vs = vs.Slice(0, numEntries) // Use the existing uint8 slice if it can be // type asserted. iface := vs.Interface() if slice, ok := iface.([]uint8); ok { buf = slice doHexDump = true break } } // The underlying data needs to be converted if it can't // be type asserted to a uint8 slice. doConvert = true } // Copy and convert the underlying type if needed. if doConvert && vt.ConvertibleTo(uint8Type) { // Convert and copy each element into a uint8 byte // slice. buf = make([]uint8, numEntries) for i := 0; i < numEntries; i++ { vv := v.Index(i) buf[i] = uint8(vv.Convert(uint8Type).Uint()) } doHexDump = true } } // Hexdump the entire slice as needed. if doHexDump { indent := strings.Repeat(d.cs.Indent, d.depth) str := indent + hex.Dump(buf) str = strings.Replace(str, "\n", "\n"+indent, -1) str = strings.TrimRight(str, d.cs.Indent) d.w.Write([]byte(str)) return } // Recursively call dump for each item. for i := 0; i < numEntries; i++ { d.dump(d.unpackValue(v.Index(i))) if i < (numEntries - 1) { d.w.Write(commaNewlineBytes) } else { d.w.Write(newlineBytes) } } } // dump is the main workhorse for dumping a value. It uses the passed reflect // value to figure out what kind of object we are dealing with and formats it // appropriately. It is a recursive function, however circular data structures // are detected and handled properly. func (d *dumpState) dump(v reflect.Value) { // Handle invalid reflect values immediately. kind := v.Kind() if kind == reflect.Invalid { d.w.Write(invalidAngleBytes) return } // Handle pointers specially. if kind == reflect.Ptr { d.indent() d.dumpPtr(v) return } // Print type information unless already handled elsewhere. if !d.ignoreNextType { d.indent() d.w.Write(openParenBytes) d.w.Write([]byte(v.Type().String())) d.w.Write(closeParenBytes) d.w.Write(spaceBytes) } d.ignoreNextType = false // Display length and capacity if the built-in len and cap functions // work with the value's kind and the len/cap itself is non-zero. valueLen, valueCap := 0, 0 switch v.Kind() { case reflect.Array, reflect.Slice, reflect.Chan: valueLen, valueCap = v.Len(), v.Cap() case reflect.Map, reflect.String: valueLen = v.Len() } if valueLen != 0 || !d.cs.DisableCapacities && valueCap != 0 { d.w.Write(openParenBytes) if valueLen != 0 { d.w.Write(lenEqualsBytes) printInt(d.w, int64(valueLen), 10) } if !d.cs.DisableCapacities && valueCap != 0 { if valueLen != 0 { d.w.Write(spaceBytes) } d.w.Write(capEqualsBytes) printInt(d.w, int64(valueCap), 10) } d.w.Write(closeParenBytes) d.w.Write(spaceBytes) } // Call Stringer/error interfaces if they exist and the handle methods flag // is enabled if !d.cs.DisableMethods { if (kind != reflect.Invalid) && (kind != reflect.Interface) { if handled := handleMethods(d.cs, d.w, v); handled { return } } } switch kind { case reflect.Invalid: // Do nothing. We should never get here since invalid has already // been handled above. case reflect.Bool: printBool(d.w, v.Bool()) case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int: printInt(d.w, v.Int(), 10) case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint: printUint(d.w, v.Uint(), 10) case reflect.Float32: printFloat(d.w, v.Float(), 32) case reflect.Float64: printFloat(d.w, v.Float(), 64) case reflect.Complex64: printComplex(d.w, v.Complex(), 32) case reflect.Complex128: printComplex(d.w, v.Complex(), 64) case reflect.Slice: if v.IsNil() { d.w.Write(nilAngleBytes) break } fallthrough case reflect.Array: d.w.Write(openBraceNewlineBytes) d.depth++ if (d.cs.MaxDepth != 0) && (d.depth > d.cs.MaxDepth) { d.indent() d.w.Write(maxNewlineBytes) } else { d.dumpSlice(v) } d.depth-- d.indent() d.w.Write(closeBraceBytes) case reflect.String: d.w.Write([]byte(strconv.Quote(v.String()))) case reflect.Interface: // The only time we should get here is for nil interfaces due to // unpackValue calls. if v.IsNil() { d.w.Write(nilAngleBytes) } case reflect.Ptr: // Do nothing. We should never get here since pointers have already // been handled above. case reflect.Map: // nil maps should be indicated as different than empty maps if v.IsNil() { d.w.Write(nilAngleBytes) break } d.w.Write(openBraceNewlineBytes) d.depth++ if (d.cs.MaxDepth != 0) && (d.depth > d.cs.MaxDepth) { d.indent() d.w.Write(maxNewlineBytes) } else { numEntries := v.Len() keys := v.MapKeys() if d.cs.SortKeys { sortValues(keys, d.cs) } for i, key := range keys { d.dump(d.unpackValue(key)) d.w.Write(colonSpaceBytes) d.ignoreNextIndent = true d.dump(d.unpackValue(v.MapIndex(key))) if i < (numEntries - 1) { d.w.Write(commaNewlineBytes) } else { d.w.Write(newlineBytes) } } } d.depth-- d.indent() d.w.Write(closeBraceBytes) case reflect.Struct: d.w.Write(openBraceNewlineBytes) d.depth++ if (d.cs.MaxDepth != 0) && (d.depth > d.cs.MaxDepth) { d.indent() d.w.Write(maxNewlineBytes) } else { vt := v.Type() numFields := v.NumField() for i := 0; i < numFields; i++ { d.indent() vtf := vt.Field(i) d.w.Write([]byte(vtf.Name)) d.w.Write(colonSpaceBytes) d.ignoreNextIndent = true d.dump(d.unpackValue(v.Field(i))) if i < (numFields - 1) { d.w.Write(commaNewlineBytes) } else { d.w.Write(newlineBytes) } } } d.depth-- d.indent() d.w.Write(closeBraceBytes) case reflect.Uintptr: printHexPtr(d.w, uintptr(v.Uint())) case reflect.UnsafePointer, reflect.Chan, reflect.Func: printHexPtr(d.w, v.Pointer()) // There were not any other types at the time this code was written, but // fall back to letting the default fmt package handle it in case any new // types are added. default: if v.CanInterface() { fmt.Fprintf(d.w, "%v", v.Interface()) } else { fmt.Fprintf(d.w, "%v", v.String()) } } } // fdump is a helper function to consolidate the logic from the various public // methods which take varying writers and config states. func fdump(cs *ConfigState, w io.Writer, a ...interface{}) { for _, arg := range a { if arg == nil { w.Write(interfaceBytes) w.Write(spaceBytes) w.Write(nilAngleBytes) w.Write(newlineBytes) continue } d := dumpState{w: w, cs: cs} d.pointers = make(map[uintptr]int) d.dump(reflect.ValueOf(arg)) d.w.Write(newlineBytes) } } // Fdump formats and displays the passed arguments to io.Writer w. It formats // exactly the same as Dump. func Fdump(w io.Writer, a ...interface{}) { fdump(&Config, w, a...) } // Sdump returns a string with the passed arguments formatted exactly the same // as Dump. func Sdump(a ...interface{}) string { var buf bytes.Buffer fdump(&Config, &buf, a...) return buf.String() } /* Dump displays the passed parameters to standard out with newlines, customizable indentation, and additional debug information such as complete types and all pointer addresses used to indirect to the final value. It provides the following features over the built-in printing facilities provided by the fmt package: * Pointers are dereferenced and followed * Circular data structures are detected and handled properly * Custom Stringer/error interfaces are optionally invoked, including on unexported types * Custom types which only implement the Stringer/error interfaces via a pointer receiver are optionally invoked when passing non-pointer variables * Byte arrays and slices are dumped like the hexdump -C command which includes offsets, byte values in hex, and ASCII output The configuration options are controlled by an exported package global, spew.Config. See ConfigState for options documentation. See Fdump if you would prefer dumping to an arbitrary io.Writer or Sdump to get the formatted result as a string. */ func Dump(a ...interface{}) { fdump(&Config, os.Stdout, a...) } ================================================ FILE: vendor/github.com/davecgh/go-spew/spew/format.go ================================================ /* * Copyright (c) 2013-2016 Dave Collins * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ package spew import ( "bytes" "fmt" "reflect" "strconv" "strings" ) // supportedFlags is a list of all the character flags supported by fmt package. const supportedFlags = "0-+# " // formatState implements the fmt.Formatter interface and contains information // about the state of a formatting operation. The NewFormatter function can // be used to get a new Formatter which can be used directly as arguments // in standard fmt package printing calls. type formatState struct { value interface{} fs fmt.State depth int pointers map[uintptr]int ignoreNextType bool cs *ConfigState } // buildDefaultFormat recreates the original format string without precision // and width information to pass in to fmt.Sprintf in the case of an // unrecognized type. Unless new types are added to the language, this // function won't ever be called. func (f *formatState) buildDefaultFormat() (format string) { buf := bytes.NewBuffer(percentBytes) for _, flag := range supportedFlags { if f.fs.Flag(int(flag)) { buf.WriteRune(flag) } } buf.WriteRune('v') format = buf.String() return format } // constructOrigFormat recreates the original format string including precision // and width information to pass along to the standard fmt package. This allows // automatic deferral of all format strings this package doesn't support. func (f *formatState) constructOrigFormat(verb rune) (format string) { buf := bytes.NewBuffer(percentBytes) for _, flag := range supportedFlags { if f.fs.Flag(int(flag)) { buf.WriteRune(flag) } } if width, ok := f.fs.Width(); ok { buf.WriteString(strconv.Itoa(width)) } if precision, ok := f.fs.Precision(); ok { buf.Write(precisionBytes) buf.WriteString(strconv.Itoa(precision)) } buf.WriteRune(verb) format = buf.String() return format } // unpackValue returns values inside of non-nil interfaces when possible and // ensures that types for values which have been unpacked from an interface // are displayed when the show types flag is also set. // This is useful for data types like structs, arrays, slices, and maps which // can contain varying types packed inside an interface. func (f *formatState) unpackValue(v reflect.Value) reflect.Value { if v.Kind() == reflect.Interface { f.ignoreNextType = false if !v.IsNil() { v = v.Elem() } } return v } // formatPtr handles formatting of pointers by indirecting them as necessary. func (f *formatState) formatPtr(v reflect.Value) { // Display nil if top level pointer is nil. showTypes := f.fs.Flag('#') if v.IsNil() && (!showTypes || f.ignoreNextType) { f.fs.Write(nilAngleBytes) return } // Remove pointers at or below the current depth from map used to detect // circular refs. for k, depth := range f.pointers { if depth >= f.depth { delete(f.pointers, k) } } // Keep list of all dereferenced pointers to possibly show later. pointerChain := make([]uintptr, 0) // Figure out how many levels of indirection there are by derferencing // pointers and unpacking interfaces down the chain while detecting circular // references. nilFound := false cycleFound := false indirects := 0 ve := v for ve.Kind() == reflect.Ptr { if ve.IsNil() { nilFound = true break } indirects++ addr := ve.Pointer() pointerChain = append(pointerChain, addr) if pd, ok := f.pointers[addr]; ok && pd < f.depth { cycleFound = true indirects-- break } f.pointers[addr] = f.depth ve = ve.Elem() if ve.Kind() == reflect.Interface { if ve.IsNil() { nilFound = true break } ve = ve.Elem() } } // Display type or indirection level depending on flags. if showTypes && !f.ignoreNextType { f.fs.Write(openParenBytes) f.fs.Write(bytes.Repeat(asteriskBytes, indirects)) f.fs.Write([]byte(ve.Type().String())) f.fs.Write(closeParenBytes) } else { if nilFound || cycleFound { indirects += strings.Count(ve.Type().String(), "*") } f.fs.Write(openAngleBytes) f.fs.Write([]byte(strings.Repeat("*", indirects))) f.fs.Write(closeAngleBytes) } // Display pointer information depending on flags. if f.fs.Flag('+') && (len(pointerChain) > 0) { f.fs.Write(openParenBytes) for i, addr := range pointerChain { if i > 0 { f.fs.Write(pointerChainBytes) } printHexPtr(f.fs, addr) } f.fs.Write(closeParenBytes) } // Display dereferenced value. switch { case nilFound: f.fs.Write(nilAngleBytes) case cycleFound: f.fs.Write(circularShortBytes) default: f.ignoreNextType = true f.format(ve) } } // format is the main workhorse for providing the Formatter interface. It // uses the passed reflect value to figure out what kind of object we are // dealing with and formats it appropriately. It is a recursive function, // however circular data structures are detected and handled properly. func (f *formatState) format(v reflect.Value) { // Handle invalid reflect values immediately. kind := v.Kind() if kind == reflect.Invalid { f.fs.Write(invalidAngleBytes) return } // Handle pointers specially. if kind == reflect.Ptr { f.formatPtr(v) return } // Print type information unless already handled elsewhere. if !f.ignoreNextType && f.fs.Flag('#') { f.fs.Write(openParenBytes) f.fs.Write([]byte(v.Type().String())) f.fs.Write(closeParenBytes) } f.ignoreNextType = false // Call Stringer/error interfaces if they exist and the handle methods // flag is enabled. if !f.cs.DisableMethods { if (kind != reflect.Invalid) && (kind != reflect.Interface) { if handled := handleMethods(f.cs, f.fs, v); handled { return } } } switch kind { case reflect.Invalid: // Do nothing. We should never get here since invalid has already // been handled above. case reflect.Bool: printBool(f.fs, v.Bool()) case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int: printInt(f.fs, v.Int(), 10) case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint: printUint(f.fs, v.Uint(), 10) case reflect.Float32: printFloat(f.fs, v.Float(), 32) case reflect.Float64: printFloat(f.fs, v.Float(), 64) case reflect.Complex64: printComplex(f.fs, v.Complex(), 32) case reflect.Complex128: printComplex(f.fs, v.Complex(), 64) case reflect.Slice: if v.IsNil() { f.fs.Write(nilAngleBytes) break } fallthrough case reflect.Array: f.fs.Write(openBracketBytes) f.depth++ if (f.cs.MaxDepth != 0) && (f.depth > f.cs.MaxDepth) { f.fs.Write(maxShortBytes) } else { numEntries := v.Len() for i := 0; i < numEntries; i++ { if i > 0 { f.fs.Write(spaceBytes) } f.ignoreNextType = true f.format(f.unpackValue(v.Index(i))) } } f.depth-- f.fs.Write(closeBracketBytes) case reflect.String: f.fs.Write([]byte(v.String())) case reflect.Interface: // The only time we should get here is for nil interfaces due to // unpackValue calls. if v.IsNil() { f.fs.Write(nilAngleBytes) } case reflect.Ptr: // Do nothing. We should never get here since pointers have already // been handled above. case reflect.Map: // nil maps should be indicated as different than empty maps if v.IsNil() { f.fs.Write(nilAngleBytes) break } f.fs.Write(openMapBytes) f.depth++ if (f.cs.MaxDepth != 0) && (f.depth > f.cs.MaxDepth) { f.fs.Write(maxShortBytes) } else { keys := v.MapKeys() if f.cs.SortKeys { sortValues(keys, f.cs) } for i, key := range keys { if i > 0 { f.fs.Write(spaceBytes) } f.ignoreNextType = true f.format(f.unpackValue(key)) f.fs.Write(colonBytes) f.ignoreNextType = true f.format(f.unpackValue(v.MapIndex(key))) } } f.depth-- f.fs.Write(closeMapBytes) case reflect.Struct: numFields := v.NumField() f.fs.Write(openBraceBytes) f.depth++ if (f.cs.MaxDepth != 0) && (f.depth > f.cs.MaxDepth) { f.fs.Write(maxShortBytes) } else { vt := v.Type() for i := 0; i < numFields; i++ { if i > 0 { f.fs.Write(spaceBytes) } vtf := vt.Field(i) if f.fs.Flag('+') || f.fs.Flag('#') { f.fs.Write([]byte(vtf.Name)) f.fs.Write(colonBytes) } f.format(f.unpackValue(v.Field(i))) } } f.depth-- f.fs.Write(closeBraceBytes) case reflect.Uintptr: printHexPtr(f.fs, uintptr(v.Uint())) case reflect.UnsafePointer, reflect.Chan, reflect.Func: printHexPtr(f.fs, v.Pointer()) // There were not any other types at the time this code was written, but // fall back to letting the default fmt package handle it if any get added. default: format := f.buildDefaultFormat() if v.CanInterface() { fmt.Fprintf(f.fs, format, v.Interface()) } else { fmt.Fprintf(f.fs, format, v.String()) } } } // Format satisfies the fmt.Formatter interface. See NewFormatter for usage // details. func (f *formatState) Format(fs fmt.State, verb rune) { f.fs = fs // Use standard formatting for verbs that are not v. if verb != 'v' { format := f.constructOrigFormat(verb) fmt.Fprintf(fs, format, f.value) return } if f.value == nil { if fs.Flag('#') { fs.Write(interfaceBytes) } fs.Write(nilAngleBytes) return } f.format(reflect.ValueOf(f.value)) } // newFormatter is a helper function to consolidate the logic from the various // public methods which take varying config states. func newFormatter(cs *ConfigState, v interface{}) fmt.Formatter { fs := &formatState{value: v, cs: cs} fs.pointers = make(map[uintptr]int) return fs } /* NewFormatter returns a custom formatter that satisfies the fmt.Formatter interface. As a result, it integrates cleanly with standard fmt package printing functions. The formatter is useful for inline printing of smaller data types similar to the standard %v format specifier. The custom formatter only responds to the %v (most compact), %+v (adds pointer addresses), %#v (adds types), or %#+v (adds types and pointer addresses) verb combinations. Any other verbs such as %x and %q will be sent to the the standard fmt package for formatting. In addition, the custom formatter ignores the width and precision arguments (however they will still work on the format specifiers not handled by the custom formatter). Typically this function shouldn't be called directly. It is much easier to make use of the custom formatter by calling one of the convenience functions such as Printf, Println, or Fprintf. */ func NewFormatter(v interface{}) fmt.Formatter { return newFormatter(&Config, v) } ================================================ FILE: vendor/github.com/davecgh/go-spew/spew/spew.go ================================================ /* * Copyright (c) 2013-2016 Dave Collins * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ package spew import ( "fmt" "io" ) // Errorf is a wrapper for fmt.Errorf that treats each argument as if it were // passed with a default Formatter interface returned by NewFormatter. It // returns the formatted string as a value that satisfies error. See // NewFormatter for formatting details. // // This function is shorthand for the following syntax: // // fmt.Errorf(format, spew.NewFormatter(a), spew.NewFormatter(b)) func Errorf(format string, a ...interface{}) (err error) { return fmt.Errorf(format, convertArgs(a)...) } // Fprint is a wrapper for fmt.Fprint that treats each argument as if it were // passed with a default Formatter interface returned by NewFormatter. It // returns the number of bytes written and any write error encountered. See // NewFormatter for formatting details. // // This function is shorthand for the following syntax: // // fmt.Fprint(w, spew.NewFormatter(a), spew.NewFormatter(b)) func Fprint(w io.Writer, a ...interface{}) (n int, err error) { return fmt.Fprint(w, convertArgs(a)...) } // Fprintf is a wrapper for fmt.Fprintf that treats each argument as if it were // passed with a default Formatter interface returned by NewFormatter. It // returns the number of bytes written and any write error encountered. See // NewFormatter for formatting details. // // This function is shorthand for the following syntax: // // fmt.Fprintf(w, format, spew.NewFormatter(a), spew.NewFormatter(b)) func Fprintf(w io.Writer, format string, a ...interface{}) (n int, err error) { return fmt.Fprintf(w, format, convertArgs(a)...) } // Fprintln is a wrapper for fmt.Fprintln that treats each argument as if it // passed with a default Formatter interface returned by NewFormatter. See // NewFormatter for formatting details. // // This function is shorthand for the following syntax: // // fmt.Fprintln(w, spew.NewFormatter(a), spew.NewFormatter(b)) func Fprintln(w io.Writer, a ...interface{}) (n int, err error) { return fmt.Fprintln(w, convertArgs(a)...) } // Print is a wrapper for fmt.Print that treats each argument as if it were // passed with a default Formatter interface returned by NewFormatter. It // returns the number of bytes written and any write error encountered. See // NewFormatter for formatting details. // // This function is shorthand for the following syntax: // // fmt.Print(spew.NewFormatter(a), spew.NewFormatter(b)) func Print(a ...interface{}) (n int, err error) { return fmt.Print(convertArgs(a)...) } // Printf is a wrapper for fmt.Printf that treats each argument as if it were // passed with a default Formatter interface returned by NewFormatter. It // returns the number of bytes written and any write error encountered. See // NewFormatter for formatting details. // // This function is shorthand for the following syntax: // // fmt.Printf(format, spew.NewFormatter(a), spew.NewFormatter(b)) func Printf(format string, a ...interface{}) (n int, err error) { return fmt.Printf(format, convertArgs(a)...) } // Println is a wrapper for fmt.Println that treats each argument as if it were // passed with a default Formatter interface returned by NewFormatter. It // returns the number of bytes written and any write error encountered. See // NewFormatter for formatting details. // // This function is shorthand for the following syntax: // // fmt.Println(spew.NewFormatter(a), spew.NewFormatter(b)) func Println(a ...interface{}) (n int, err error) { return fmt.Println(convertArgs(a)...) } // Sprint is a wrapper for fmt.Sprint that treats each argument as if it were // passed with a default Formatter interface returned by NewFormatter. It // returns the resulting string. See NewFormatter for formatting details. // // This function is shorthand for the following syntax: // // fmt.Sprint(spew.NewFormatter(a), spew.NewFormatter(b)) func Sprint(a ...interface{}) string { return fmt.Sprint(convertArgs(a)...) } // Sprintf is a wrapper for fmt.Sprintf that treats each argument as if it were // passed with a default Formatter interface returned by NewFormatter. It // returns the resulting string. See NewFormatter for formatting details. // // This function is shorthand for the following syntax: // // fmt.Sprintf(format, spew.NewFormatter(a), spew.NewFormatter(b)) func Sprintf(format string, a ...interface{}) string { return fmt.Sprintf(format, convertArgs(a)...) } // Sprintln is a wrapper for fmt.Sprintln that treats each argument as if it // were passed with a default Formatter interface returned by NewFormatter. It // returns the resulting string. See NewFormatter for formatting details. // // This function is shorthand for the following syntax: // // fmt.Sprintln(spew.NewFormatter(a), spew.NewFormatter(b)) func Sprintln(a ...interface{}) string { return fmt.Sprintln(convertArgs(a)...) } // convertArgs accepts a slice of arguments and returns a slice of the same // length with each argument converted to a default spew Formatter interface. func convertArgs(args []interface{}) (formatters []interface{}) { formatters = make([]interface{}, len(args)) for index, arg := range args { formatters[index] = NewFormatter(arg) } return formatters } ================================================ FILE: vendor/github.com/distribution/reference/.gitattributes ================================================ *.go text eol=lf ================================================ FILE: vendor/github.com/distribution/reference/.gitignore ================================================ # Cover profiles *.out ================================================ FILE: vendor/github.com/distribution/reference/.golangci.yml ================================================ linters: enable: - bodyclose - dupword # Checks for duplicate words in the source code - gofmt - goimports - ineffassign - misspell - revive - staticcheck - unconvert - unused - vet disable: - errcheck run: deadline: 2m ================================================ FILE: vendor/github.com/distribution/reference/CODE-OF-CONDUCT.md ================================================ # Code of Conduct We follow the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/main/code-of-conduct.md). Please contact the [CNCF Code of Conduct Committee](mailto:conduct@cncf.io) in order to report violations of the Code of Conduct. ================================================ FILE: vendor/github.com/distribution/reference/CONTRIBUTING.md ================================================ # Contributing to the reference library ## Community help If you need help, please ask in the [#distribution](https://cloud-native.slack.com/archives/C01GVR8SY4R) channel on CNCF community slack. [Click here for an invite to the CNCF community slack](https://slack.cncf.io/) ## Reporting security issues The maintainers take security seriously. If you discover a security issue, please bring it to their attention right away! Please **DO NOT** file a public issue, instead send your report privately to [cncf-distribution-security@lists.cncf.io](mailto:cncf-distribution-security@lists.cncf.io). ## Reporting an issue properly By following these simple rules you will get better and faster feedback on your issue. - search the bugtracker for an already reported issue ### If you found an issue that describes your problem: - please read other user comments first, and confirm this is the same issue: a given error condition might be indicative of different problems - you may also find a workaround in the comments - please refrain from adding "same thing here" or "+1" comments - you don't need to comment on an issue to get notified of updates: just hit the "subscribe" button - comment if you have some new, technical and relevant information to add to the case - __DO NOT__ comment on closed issues or merged PRs. If you think you have a related problem, open up a new issue and reference the PR or issue. ### If you have not found an existing issue that describes your problem: 1. create a new issue, with a succinct title that describes your issue: - bad title: "It doesn't work with my docker" - good title: "Private registry push fail: 400 error with E_INVALID_DIGEST" 2. copy the output of (or similar for other container tools): - `docker version` - `docker info` - `docker exec registry --version` 3. copy the command line you used to launch your Registry 4. restart your docker daemon in debug mode (add `-D` to the daemon launch arguments) 5. reproduce your problem and get your docker daemon logs showing the error 6. if relevant, copy your registry logs that show the error 7. provide any relevant detail about your specific Registry configuration (e.g., storage backend used) 8. indicate if you are using an enterprise proxy, Nginx, or anything else between you and your Registry ## Contributing Code Contributions should be made via pull requests. Pull requests will be reviewed by one or more maintainers or reviewers and merged when acceptable. You should follow the basic GitHub workflow: 1. Use your own [fork](https://help.github.com/en/articles/about-forks) 2. Create your [change](https://github.com/containerd/project/blob/master/CONTRIBUTING.md#successful-changes) 3. Test your code 4. [Commit](https://github.com/containerd/project/blob/master/CONTRIBUTING.md#commit-messages) your work, always [sign your commits](https://github.com/containerd/project/blob/master/CONTRIBUTING.md#commit-messages) 5. Push your change to your fork and create a [Pull Request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork) Refer to [containerd's contribution guide](https://github.com/containerd/project/blob/master/CONTRIBUTING.md#successful-changes) for tips on creating a successful contribution. ## Sign your work The sign-off is a simple line at the end of the explanation for the patch. Your signature certifies that you wrote the patch or otherwise have the right to pass it on as an open-source patch. The rules are pretty simple: if you can certify the below (from [developercertificate.org](http://developercertificate.org/)): ``` Developer Certificate of Origin Version 1.1 Copyright (C) 2004, 2006 The Linux Foundation and its contributors. 660 York Street, Suite 102, San Francisco, CA 94110 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Developer's Certificate of Origin 1.1 By making a contribution to this project, I certify that: (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. ``` Then you just add a line to every git commit message: Signed-off-by: Joe Smith Use your real name (sorry, no pseudonyms or anonymous contributions.) If you set your `user.name` and `user.email` git configs, you can sign your commit automatically with `git commit -s`. ================================================ FILE: vendor/github.com/distribution/reference/GOVERNANCE.md ================================================ # distribution/reference Project Governance Distribution [Code of Conduct](./CODE-OF-CONDUCT.md) can be found here. For specific guidance on practical contribution steps please see our [CONTRIBUTING.md](./CONTRIBUTING.md) guide. ## Maintainership There are different types of maintainers, with different responsibilities, but all maintainers have 3 things in common: 1) They share responsibility in the project's success. 2) They have made a long-term, recurring time investment to improve the project. 3) They spend that time doing whatever needs to be done, not necessarily what is the most interesting or fun. Maintainers are often under-appreciated, because their work is harder to appreciate. It's easy to appreciate a really cool and technically advanced feature. It's harder to appreciate the absence of bugs, the slow but steady improvement in stability, or the reliability of a release process. But those things distinguish a good project from a great one. ## Reviewers A reviewer is a core role within the project. They share in reviewing issues and pull requests and their LGTM counts towards the required LGTM count to merge a code change into the project. Reviewers are part of the organization but do not have write access. Becoming a reviewer is a core aspect in the journey to becoming a maintainer. ## Adding maintainers Maintainers are first and foremost contributors that have shown they are committed to the long term success of a project. Contributors wanting to become maintainers are expected to be deeply involved in contributing code, pull request review, and triage of issues in the project for more than three months. Just contributing does not make you a maintainer, it is about building trust with the current maintainers of the project and being a person that they can depend on and trust to make decisions in the best interest of the project. Periodically, the existing maintainers curate a list of contributors that have shown regular activity on the project over the prior months. From this list, maintainer candidates are selected and proposed in a pull request or a maintainers communication channel. After a candidate has been announced to the maintainers, the existing maintainers are given five business days to discuss the candidate, raise objections and cast their vote. Votes may take place on the communication channel or via pull request comment. Candidates must be approved by at least 66% of the current maintainers by adding their vote on the mailing list. The reviewer role has the same process but only requires 33% of current maintainers. Only maintainers of the repository that the candidate is proposed for are allowed to vote. If a candidate is approved, a maintainer will contact the candidate to invite the candidate to open a pull request that adds the contributor to the MAINTAINERS file. The voting process may take place inside a pull request if a maintainer has already discussed the candidacy with the candidate and a maintainer is willing to be a sponsor by opening the pull request. The candidate becomes a maintainer once the pull request is merged. ## Stepping down policy Life priorities, interests, and passions can change. If you're a maintainer but feel you must remove yourself from the list, inform other maintainers that you intend to step down, and if possible, help find someone to pick up your work. At the very least, ensure your work can be continued where you left off. After you've informed other maintainers, create a pull request to remove yourself from the MAINTAINERS file. ## Removal of inactive maintainers Similar to the procedure for adding new maintainers, existing maintainers can be removed from the list if they do not show significant activity on the project. Periodically, the maintainers review the list of maintainers and their activity over the last three months. If a maintainer has shown insufficient activity over this period, a neutral person will contact the maintainer to ask if they want to continue being a maintainer. If the maintainer decides to step down as a maintainer, they open a pull request to be removed from the MAINTAINERS file. If the maintainer wants to remain a maintainer, but is unable to perform the required duties they can be removed with a vote of at least 66% of the current maintainers. In this case, maintainers should first propose the change to maintainers via the maintainers communication channel, then open a pull request for voting. The voting period is five business days. The voting pull request should not come as a surpise to any maintainer and any discussion related to performance must not be discussed on the pull request. ## How are decisions made? Docker distribution is an open-source project with an open design philosophy. This means that the repository is the source of truth for EVERY aspect of the project, including its philosophy, design, road map, and APIs. *If it's part of the project, it's in the repo. If it's in the repo, it's part of the project.* As a result, all decisions can be expressed as changes to the repository. An implementation change is a change to the source code. An API change is a change to the API specification. A philosophy change is a change to the philosophy manifesto, and so on. All decisions affecting distribution, big and small, follow the same 3 steps: * Step 1: Open a pull request. Anyone can do this. * Step 2: Discuss the pull request. Anyone can do this. * Step 3: Merge or refuse the pull request. Who does this depends on the nature of the pull request and which areas of the project it affects. ## Helping contributors with the DCO The [DCO or `Sign your work`](./CONTRIBUTING.md#sign-your-work) requirement is not intended as a roadblock or speed bump. Some contributors are not as familiar with `git`, or have used a web based editor, and thus asking them to `git commit --amend -s` is not the best way forward. In this case, maintainers can update the commits based on clause (c) of the DCO. The most trivial way for a contributor to allow the maintainer to do this, is to add a DCO signature in a pull requests's comment, or a maintainer can simply note that the change is sufficiently trivial that it does not substantially change the existing contribution - i.e., a spelling change. When you add someone's DCO, please also add your own to keep a log. ## I'm a maintainer. Should I make pull requests too? Yes. Nobody should ever push to master directly. All changes should be made through a pull request. ## Conflict Resolution If you have a technical dispute that you feel has reached an impasse with a subset of the community, any contributor may open an issue, specifically calling for a resolution vote of the current core maintainers to resolve the dispute. The same voting quorums required (2/3) for adding and removing maintainers will apply to conflict resolution. ================================================ FILE: vendor/github.com/distribution/reference/LICENSE ================================================ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "{}" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright {yyyy} {name of copyright owner} Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: vendor/github.com/distribution/reference/MAINTAINERS ================================================ # Distribution project maintainers & reviewers # # See GOVERNANCE.md for maintainer versus reviewer roles # # MAINTAINERS (cncf-distribution-maintainers@lists.cncf.io) # GitHub ID, Name, Email address "chrispat","Chris Patterson","chrispat@github.com" "clarkbw","Bryan Clark","clarkbw@github.com" "corhere","Cory Snider","csnider@mirantis.com" "deleteriousEffect","Hayley Swimelar","hswimelar@gitlab.com" "heww","He Weiwei","hweiwei@vmware.com" "joaodrp","João Pereira","jpereira@gitlab.com" "justincormack","Justin Cormack","justin.cormack@docker.com" "squizzi","Kyle Squizzato","ksquizzato@mirantis.com" "milosgajdos","Milos Gajdos","milosthegajdos@gmail.com" "sargun","Sargun Dhillon","sargun@sargun.me" "wy65701436","Wang Yan","wangyan@vmware.com" "stevelasker","Steve Lasker","steve.lasker@microsoft.com" # # REVIEWERS # GitHub ID, Name, Email address "dmcgowan","Derek McGowan","derek@mcgstyle.net" "stevvooe","Stephen Day","stevvooe@gmail.com" "thajeztah","Sebastiaan van Stijn","github@gone.nl" "DavidSpek", "David van der Spek", "vanderspek.david@gmail.com" "Jamstah", "James Hewitt", "james.hewitt@gmail.com" ================================================ FILE: vendor/github.com/distribution/reference/Makefile ================================================ # Project packages. PACKAGES=$(shell go list ./...) # Flags passed to `go test` BUILDFLAGS ?= TESTFLAGS ?= .PHONY: all build test coverage .DEFAULT: all all: build build: ## no binaries to build, so just check compilation suceeds go build ${BUILDFLAGS} ./... test: ## run tests go test ${TESTFLAGS} ./... coverage: ## generate coverprofiles from the unit tests rm -f coverage.txt go test ${TESTFLAGS} -cover -coverprofile=cover.out ./... .PHONY: help help: @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[a-zA-Z_\/%-]+:.*?##/ { printf " \033[36m%-27s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) ================================================ FILE: vendor/github.com/distribution/reference/README.md ================================================ # Distribution reference Go library to handle references to container images. [![Build Status](https://github.com/distribution/reference/actions/workflows/test.yml/badge.svg?branch=main&event=push)](https://github.com/distribution/reference/actions?query=workflow%3ACI) [![GoDoc](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/github.com/distribution/reference) [![License: Apache-2.0](https://img.shields.io/badge/License-Apache--2.0-blue.svg)](LICENSE) [![codecov](https://codecov.io/gh/distribution/reference/branch/main/graph/badge.svg)](https://codecov.io/gh/distribution/reference) [![FOSSA Status](https://app.fossa.com/api/projects/custom%2B162%2Fgithub.com%2Fdistribution%2Freference.svg?type=shield)](https://app.fossa.com/projects/custom%2B162%2Fgithub.com%2Fdistribution%2Freference?ref=badge_shield) This repository contains a library for handling references to container images held in container registries. Please see [godoc](https://pkg.go.dev/github.com/distribution/reference) for details. ## Contribution Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute issues, fixes, and patches to this project. ## Communication For async communication and long running discussions please use issues and pull requests on the github repo. This will be the best place to discuss design and implementation. For sync communication we have a #distribution channel in the [CNCF Slack](https://slack.cncf.io/) that everyone is welcome to join and chat about development. ## Licenses The distribution codebase is released under the [Apache 2.0 license](LICENSE). ================================================ FILE: vendor/github.com/distribution/reference/SECURITY.md ================================================ # Security Policy ## Reporting a Vulnerability The maintainers take security seriously. If you discover a security issue, please bring it to their attention right away! Please DO NOT file a public issue, instead send your report privately to cncf-distribution-security@lists.cncf.io. ================================================ FILE: vendor/github.com/distribution/reference/helpers.go ================================================ package reference import "path" // IsNameOnly returns true if reference only contains a repo name. func IsNameOnly(ref Named) bool { if _, ok := ref.(NamedTagged); ok { return false } if _, ok := ref.(Canonical); ok { return false } return true } // FamiliarName returns the familiar name string // for the given named, familiarizing if needed. func FamiliarName(ref Named) string { if nn, ok := ref.(normalizedNamed); ok { return nn.Familiar().Name() } return ref.Name() } // FamiliarString returns the familiar string representation // for the given reference, familiarizing if needed. func FamiliarString(ref Reference) string { if nn, ok := ref.(normalizedNamed); ok { return nn.Familiar().String() } return ref.String() } // FamiliarMatch reports whether ref matches the specified pattern. // See [path.Match] for supported patterns. func FamiliarMatch(pattern string, ref Reference) (bool, error) { matched, err := path.Match(pattern, FamiliarString(ref)) if namedRef, isNamed := ref.(Named); isNamed && !matched { matched, _ = path.Match(pattern, FamiliarName(namedRef)) } return matched, err } ================================================ FILE: vendor/github.com/distribution/reference/normalize.go ================================================ package reference import ( "fmt" "strings" "github.com/opencontainers/go-digest" ) const ( // legacyDefaultDomain is the legacy domain for Docker Hub (which was // originally named "the Docker Index"). This domain is still used for // authentication and image search, which were part of the "v1" Docker // registry specification. // // This domain will continue to be supported, but there are plans to consolidate // legacy domains to new "canonical" domains. Once those domains are decided // on, we must update the normalization functions, but preserve compatibility // with existing installs, clients, and user configuration. legacyDefaultDomain = "index.docker.io" // defaultDomain is the default domain used for images on Docker Hub. // It is used to normalize "familiar" names to canonical names, for example, // to convert "ubuntu" to "docker.io/library/ubuntu:latest". // // Note that actual domain of Docker Hub's registry is registry-1.docker.io. // This domain will continue to be supported, but there are plans to consolidate // legacy domains to new "canonical" domains. Once those domains are decided // on, we must update the normalization functions, but preserve compatibility // with existing installs, clients, and user configuration. defaultDomain = "docker.io" // officialRepoPrefix is the namespace used for official images on Docker Hub. // It is used to normalize "familiar" names to canonical names, for example, // to convert "ubuntu" to "docker.io/library/ubuntu:latest". officialRepoPrefix = "library/" // defaultTag is the default tag if no tag is provided. defaultTag = "latest" ) // normalizedNamed represents a name which has been // normalized and has a familiar form. A familiar name // is what is used in Docker UI. An example normalized // name is "docker.io/library/ubuntu" and corresponding // familiar name of "ubuntu". type normalizedNamed interface { Named Familiar() Named } // ParseNormalizedNamed parses a string into a named reference // transforming a familiar name from Docker UI to a fully // qualified reference. If the value may be an identifier // use ParseAnyReference. func ParseNormalizedNamed(s string) (Named, error) { if ok := anchoredIdentifierRegexp.MatchString(s); ok { return nil, fmt.Errorf("invalid repository name (%s), cannot specify 64-byte hexadecimal strings", s) } domain, remainder := splitDockerDomain(s) var remote string if tagSep := strings.IndexRune(remainder, ':'); tagSep > -1 { remote = remainder[:tagSep] } else { remote = remainder } if strings.ToLower(remote) != remote { return nil, fmt.Errorf("invalid reference format: repository name (%s) must be lowercase", remote) } ref, err := Parse(domain + "/" + remainder) if err != nil { return nil, err } named, isNamed := ref.(Named) if !isNamed { return nil, fmt.Errorf("reference %s has no name", ref.String()) } return named, nil } // namedTaggedDigested is a reference that has both a tag and a digest. type namedTaggedDigested interface { NamedTagged Digested } // ParseDockerRef normalizes the image reference following the docker convention, // which allows for references to contain both a tag and a digest. It returns a // reference that is either tagged or digested. For references containing both // a tag and a digest, it returns a digested reference. For example, the following // reference: // // docker.io/library/busybox:latest@sha256:7cc4b5aefd1d0cadf8d97d4350462ba51c694ebca145b08d7d41b41acc8db5aa // // Is returned as a digested reference (with the ":latest" tag removed): // // docker.io/library/busybox@sha256:7cc4b5aefd1d0cadf8d97d4350462ba51c694ebca145b08d7d41b41acc8db5aa // // References that are already "tagged" or "digested" are returned unmodified: // // // Already a digested reference // docker.io/library/busybox@sha256:7cc4b5aefd1d0cadf8d97d4350462ba51c694ebca145b08d7d41b41acc8db5aa // // // Already a named reference // docker.io/library/busybox:latest func ParseDockerRef(ref string) (Named, error) { named, err := ParseNormalizedNamed(ref) if err != nil { return nil, err } if canonical, ok := named.(namedTaggedDigested); ok { // The reference is both tagged and digested; only return digested. newNamed, err := WithName(canonical.Name()) if err != nil { return nil, err } return WithDigest(newNamed, canonical.Digest()) } return TagNameOnly(named), nil } // splitDockerDomain splits a repository name to domain and remote-name. // If no valid domain is found, the default domain is used. Repository name // needs to be already validated before. func splitDockerDomain(name string) (domain, remoteName string) { maybeDomain, maybeRemoteName, ok := strings.Cut(name, "/") if !ok { // Fast-path for single element ("familiar" names), such as "ubuntu" // or "ubuntu:latest". Familiar names must be handled separately, to // prevent them from being handled as "hostname:port". // // Canonicalize them as "docker.io/library/name[:tag]" // FIXME(thaJeztah): account for bare "localhost" or "example.com" names, which SHOULD be considered a domain. return defaultDomain, officialRepoPrefix + name } switch { case maybeDomain == localhost: // localhost is a reserved namespace and always considered a domain. domain, remoteName = maybeDomain, maybeRemoteName case maybeDomain == legacyDefaultDomain: // canonicalize the Docker Hub and legacy "Docker Index" domains. domain, remoteName = defaultDomain, maybeRemoteName case strings.ContainsAny(maybeDomain, ".:"): // Likely a domain or IP-address: // // - contains a "." (e.g., "example.com" or "127.0.0.1") // - contains a ":" (e.g., "example:5000", "::1", or "[::1]:5000") domain, remoteName = maybeDomain, maybeRemoteName case strings.ToLower(maybeDomain) != maybeDomain: // Uppercase namespaces are not allowed, so if the first element // is not lowercase, we assume it to be a domain-name. domain, remoteName = maybeDomain, maybeRemoteName default: // None of the above: it's not a domain, so use the default, and // use the name input the remote-name. domain, remoteName = defaultDomain, name } if domain == defaultDomain && !strings.ContainsRune(remoteName, '/') { // Canonicalize "familiar" names, but only on Docker Hub, not // on other domains: // // "docker.io/ubuntu[:tag]" => "docker.io/library/ubuntu[:tag]" remoteName = officialRepoPrefix + remoteName } return domain, remoteName } // familiarizeName returns a shortened version of the name familiar // to the Docker UI. Familiar names have the default domain // "docker.io" and "library/" repository prefix removed. // For example, "docker.io/library/redis" will have the familiar // name "redis" and "docker.io/dmcgowan/myapp" will be "dmcgowan/myapp". // Returns a familiarized named only reference. func familiarizeName(named namedRepository) repository { repo := repository{ domain: named.Domain(), path: named.Path(), } if repo.domain == defaultDomain { repo.domain = "" // Handle official repositories which have the pattern "library/" if strings.HasPrefix(repo.path, officialRepoPrefix) { // TODO(thaJeztah): this check may be too strict, as it assumes the // "library/" namespace does not have nested namespaces. While this // is true (currently), technically it would be possible for Docker // Hub to use those (e.g. "library/distros/ubuntu:latest"). // See https://github.com/distribution/distribution/pull/3769#issuecomment-1302031785. if remainder := strings.TrimPrefix(repo.path, officialRepoPrefix); !strings.ContainsRune(remainder, '/') { repo.path = remainder } } } return repo } func (r reference) Familiar() Named { return reference{ namedRepository: familiarizeName(r.namedRepository), tag: r.tag, digest: r.digest, } } func (r repository) Familiar() Named { return familiarizeName(r) } func (t taggedReference) Familiar() Named { return taggedReference{ namedRepository: familiarizeName(t.namedRepository), tag: t.tag, } } func (c canonicalReference) Familiar() Named { return canonicalReference{ namedRepository: familiarizeName(c.namedRepository), digest: c.digest, } } // TagNameOnly adds the default tag "latest" to a reference if it only has // a repo name. func TagNameOnly(ref Named) Named { if IsNameOnly(ref) { namedTagged, err := WithTag(ref, defaultTag) if err != nil { // Default tag must be valid, to create a NamedTagged // type with non-validated input the WithTag function // should be used instead panic(err) } return namedTagged } return ref } // ParseAnyReference parses a reference string as a possible identifier, // full digest, or familiar name. func ParseAnyReference(ref string) (Reference, error) { if ok := anchoredIdentifierRegexp.MatchString(ref); ok { return digestReference("sha256:" + ref), nil } if dgst, err := digest.Parse(ref); err == nil { return digestReference(dgst), nil } return ParseNormalizedNamed(ref) } ================================================ FILE: vendor/github.com/distribution/reference/reference.go ================================================ // Package reference provides a general type to represent any way of referencing images within the registry. // Its main purpose is to abstract tags and digests (content-addressable hash). // // Grammar // // reference := name [ ":" tag ] [ "@" digest ] // name := [domain '/'] remote-name // domain := host [':' port-number] // host := domain-name | IPv4address | \[ IPv6address \] ; rfc3986 appendix-A // domain-name := domain-component ['.' domain-component]* // domain-component := /([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])/ // port-number := /[0-9]+/ // path-component := alpha-numeric [separator alpha-numeric]* // path (or "remote-name") := path-component ['/' path-component]* // alpha-numeric := /[a-z0-9]+/ // separator := /[_.]|__|[-]*/ // // tag := /[\w][\w.-]{0,127}/ // // digest := digest-algorithm ":" digest-hex // digest-algorithm := digest-algorithm-component [ digest-algorithm-separator digest-algorithm-component ]* // digest-algorithm-separator := /[+.-_]/ // digest-algorithm-component := /[A-Za-z][A-Za-z0-9]*/ // digest-hex := /[0-9a-fA-F]{32,}/ ; At least 128 bit digest value // // identifier := /[a-f0-9]{64}/ package reference import ( "errors" "fmt" "strings" "github.com/opencontainers/go-digest" ) const ( // RepositoryNameTotalLengthMax is the maximum total number of characters in a repository name. RepositoryNameTotalLengthMax = 255 // NameTotalLengthMax is the maximum total number of characters in a repository name. // // Deprecated: use [RepositoryNameTotalLengthMax] instead. NameTotalLengthMax = RepositoryNameTotalLengthMax ) var ( // ErrReferenceInvalidFormat represents an error while trying to parse a string as a reference. ErrReferenceInvalidFormat = errors.New("invalid reference format") // ErrTagInvalidFormat represents an error while trying to parse a string as a tag. ErrTagInvalidFormat = errors.New("invalid tag format") // ErrDigestInvalidFormat represents an error while trying to parse a string as a tag. ErrDigestInvalidFormat = errors.New("invalid digest format") // ErrNameContainsUppercase is returned for invalid repository names that contain uppercase characters. ErrNameContainsUppercase = errors.New("repository name must be lowercase") // ErrNameEmpty is returned for empty, invalid repository names. ErrNameEmpty = errors.New("repository name must have at least one component") // ErrNameTooLong is returned when a repository name is longer than RepositoryNameTotalLengthMax. ErrNameTooLong = fmt.Errorf("repository name must not be more than %v characters", RepositoryNameTotalLengthMax) // ErrNameNotCanonical is returned when a name is not canonical. ErrNameNotCanonical = errors.New("repository name must be canonical") ) // Reference is an opaque object reference identifier that may include // modifiers such as a hostname, name, tag, and digest. type Reference interface { // String returns the full reference String() string } // Field provides a wrapper type for resolving correct reference types when // working with encoding. type Field struct { reference Reference } // AsField wraps a reference in a Field for encoding. func AsField(reference Reference) Field { return Field{reference} } // Reference unwraps the reference type from the field to // return the Reference object. This object should be // of the appropriate type to further check for different // reference types. func (f Field) Reference() Reference { return f.reference } // MarshalText serializes the field to byte text which // is the string of the reference. func (f Field) MarshalText() (p []byte, err error) { return []byte(f.reference.String()), nil } // UnmarshalText parses text bytes by invoking the // reference parser to ensure the appropriately // typed reference object is wrapped by field. func (f *Field) UnmarshalText(p []byte) error { r, err := Parse(string(p)) if err != nil { return err } f.reference = r return nil } // Named is an object with a full name type Named interface { Reference Name() string } // Tagged is an object which has a tag type Tagged interface { Reference Tag() string } // NamedTagged is an object including a name and tag. type NamedTagged interface { Named Tag() string } // Digested is an object which has a digest // in which it can be referenced by type Digested interface { Reference Digest() digest.Digest } // Canonical reference is an object with a fully unique // name including a name with domain and digest type Canonical interface { Named Digest() digest.Digest } // namedRepository is a reference to a repository with a name. // A namedRepository has both domain and path components. type namedRepository interface { Named Domain() string Path() string } // Domain returns the domain part of the [Named] reference. func Domain(named Named) string { if r, ok := named.(namedRepository); ok { return r.Domain() } domain, _ := splitDomain(named.Name()) return domain } // Path returns the name without the domain part of the [Named] reference. func Path(named Named) (name string) { if r, ok := named.(namedRepository); ok { return r.Path() } _, path := splitDomain(named.Name()) return path } // splitDomain splits a named reference into a hostname and path string. // If no valid hostname is found, the hostname is empty and the full value // is returned as name func splitDomain(name string) (string, string) { match := anchoredNameRegexp.FindStringSubmatch(name) if len(match) != 3 { return "", name } return match[1], match[2] } // Parse parses s and returns a syntactically valid Reference. // If an error was encountered it is returned, along with a nil Reference. func Parse(s string) (Reference, error) { matches := ReferenceRegexp.FindStringSubmatch(s) if matches == nil { if s == "" { return nil, ErrNameEmpty } if ReferenceRegexp.FindStringSubmatch(strings.ToLower(s)) != nil { return nil, ErrNameContainsUppercase } return nil, ErrReferenceInvalidFormat } var repo repository nameMatch := anchoredNameRegexp.FindStringSubmatch(matches[1]) if len(nameMatch) == 3 { repo.domain = nameMatch[1] repo.path = nameMatch[2] } else { repo.domain = "" repo.path = matches[1] } if len(repo.path) > RepositoryNameTotalLengthMax { return nil, ErrNameTooLong } ref := reference{ namedRepository: repo, tag: matches[2], } if matches[3] != "" { var err error ref.digest, err = digest.Parse(matches[3]) if err != nil { return nil, err } } r := getBestReferenceType(ref) if r == nil { return nil, ErrNameEmpty } return r, nil } // ParseNamed parses s and returns a syntactically valid reference implementing // the Named interface. The reference must have a name and be in the canonical // form, otherwise an error is returned. // If an error was encountered it is returned, along with a nil Reference. func ParseNamed(s string) (Named, error) { named, err := ParseNormalizedNamed(s) if err != nil { return nil, err } if named.String() != s { return nil, ErrNameNotCanonical } return named, nil } // WithName returns a named object representing the given string. If the input // is invalid ErrReferenceInvalidFormat will be returned. func WithName(name string) (Named, error) { match := anchoredNameRegexp.FindStringSubmatch(name) if match == nil || len(match) != 3 { return nil, ErrReferenceInvalidFormat } if len(match[2]) > RepositoryNameTotalLengthMax { return nil, ErrNameTooLong } return repository{ domain: match[1], path: match[2], }, nil } // WithTag combines the name from "name" and the tag from "tag" to form a // reference incorporating both the name and the tag. func WithTag(name Named, tag string) (NamedTagged, error) { if !anchoredTagRegexp.MatchString(tag) { return nil, ErrTagInvalidFormat } var repo repository if r, ok := name.(namedRepository); ok { repo.domain = r.Domain() repo.path = r.Path() } else { repo.path = name.Name() } if canonical, ok := name.(Canonical); ok { return reference{ namedRepository: repo, tag: tag, digest: canonical.Digest(), }, nil } return taggedReference{ namedRepository: repo, tag: tag, }, nil } // WithDigest combines the name from "name" and the digest from "digest" to form // a reference incorporating both the name and the digest. func WithDigest(name Named, digest digest.Digest) (Canonical, error) { if !anchoredDigestRegexp.MatchString(digest.String()) { return nil, ErrDigestInvalidFormat } var repo repository if r, ok := name.(namedRepository); ok { repo.domain = r.Domain() repo.path = r.Path() } else { repo.path = name.Name() } if tagged, ok := name.(Tagged); ok { return reference{ namedRepository: repo, tag: tagged.Tag(), digest: digest, }, nil } return canonicalReference{ namedRepository: repo, digest: digest, }, nil } // TrimNamed removes any tag or digest from the named reference. func TrimNamed(ref Named) Named { repo := repository{} if r, ok := ref.(namedRepository); ok { repo.domain, repo.path = r.Domain(), r.Path() } else { repo.domain, repo.path = splitDomain(ref.Name()) } return repo } func getBestReferenceType(ref reference) Reference { if ref.Name() == "" { // Allow digest only references if ref.digest != "" { return digestReference(ref.digest) } return nil } if ref.tag == "" { if ref.digest != "" { return canonicalReference{ namedRepository: ref.namedRepository, digest: ref.digest, } } return ref.namedRepository } if ref.digest == "" { return taggedReference{ namedRepository: ref.namedRepository, tag: ref.tag, } } return ref } type reference struct { namedRepository tag string digest digest.Digest } func (r reference) String() string { return r.Name() + ":" + r.tag + "@" + r.digest.String() } func (r reference) Tag() string { return r.tag } func (r reference) Digest() digest.Digest { return r.digest } type repository struct { domain string path string } func (r repository) String() string { return r.Name() } func (r repository) Name() string { if r.domain == "" { return r.path } return r.domain + "/" + r.path } func (r repository) Domain() string { return r.domain } func (r repository) Path() string { return r.path } type digestReference digest.Digest func (d digestReference) String() string { return digest.Digest(d).String() } func (d digestReference) Digest() digest.Digest { return digest.Digest(d) } type taggedReference struct { namedRepository tag string } func (t taggedReference) String() string { return t.Name() + ":" + t.tag } func (t taggedReference) Tag() string { return t.tag } type canonicalReference struct { namedRepository digest digest.Digest } func (c canonicalReference) String() string { return c.Name() + "@" + c.digest.String() } func (c canonicalReference) Digest() digest.Digest { return c.digest } ================================================ FILE: vendor/github.com/distribution/reference/regexp.go ================================================ package reference import ( "regexp" "strings" ) // DigestRegexp matches well-formed digests, including algorithm (e.g. "sha256:"). var DigestRegexp = regexp.MustCompile(digestPat) // DomainRegexp matches hostname or IP-addresses, optionally including a port // number. It defines the structure of potential domain components that may be // part of image names. This is purposely a subset of what is allowed by DNS to // ensure backwards compatibility with Docker image names. It may be a subset of // DNS domain name, an IPv4 address in decimal format, or an IPv6 address between // square brackets (excluding zone identifiers as defined by [RFC 6874] or special // addresses such as IPv4-Mapped). // // [RFC 6874]: https://www.rfc-editor.org/rfc/rfc6874. var DomainRegexp = regexp.MustCompile(domainAndPort) // IdentifierRegexp is the format for string identifier used as a // content addressable identifier using sha256. These identifiers // are like digests without the algorithm, since sha256 is used. var IdentifierRegexp = regexp.MustCompile(identifier) // NameRegexp is the format for the name component of references, including // an optional domain and port, but without tag or digest suffix. var NameRegexp = regexp.MustCompile(namePat) // ReferenceRegexp is the full supported format of a reference. The regexp // is anchored and has capturing groups for name, tag, and digest // components. var ReferenceRegexp = regexp.MustCompile(referencePat) // TagRegexp matches valid tag names. From [docker/docker:graph/tags.go]. // // [docker/docker:graph/tags.go]: https://github.com/moby/moby/blob/v1.6.0/graph/tags.go#L26-L28 var TagRegexp = regexp.MustCompile(tag) const ( // alphanumeric defines the alphanumeric atom, typically a // component of names. This only allows lower case characters and digits. alphanumeric = `[a-z0-9]+` // separator defines the separators allowed to be embedded in name // components. This allows one period, one or two underscore and multiple // dashes. Repeated dashes and underscores are intentionally treated // differently. In order to support valid hostnames as name components, // supporting repeated dash was added. Additionally double underscore is // now allowed as a separator to loosen the restriction for previously // supported names. separator = `(?:[._]|__|[-]+)` // localhost is treated as a special value for domain-name. Any other // domain-name without a "." or a ":port" are considered a path component. localhost = `localhost` // domainNameComponent restricts the registry domain component of a // repository name to start with a component as defined by DomainRegexp. domainNameComponent = `(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])` // optionalPort matches an optional port-number including the port separator // (e.g. ":80"). optionalPort = `(?::[0-9]+)?` // tag matches valid tag names. From docker/docker:graph/tags.go. tag = `[\w][\w.-]{0,127}` // digestPat matches well-formed digests, including algorithm (e.g. "sha256:"). // // TODO(thaJeztah): this should follow the same rules as https://pkg.go.dev/github.com/opencontainers/go-digest@v1.0.0#DigestRegexp // so that go-digest defines the canonical format. Note that the go-digest is // more relaxed: // - it allows multiple algorithms (e.g. "sha256+b64:") to allow // future expansion of supported algorithms. // - it allows the "" value to use urlsafe base64 encoding as defined // in [rfc4648, section 5]. // // [rfc4648, section 5]: https://www.rfc-editor.org/rfc/rfc4648#section-5. digestPat = `[A-Za-z][A-Za-z0-9]*(?:[-_+.][A-Za-z][A-Za-z0-9]*)*[:][[:xdigit:]]{32,}` // identifier is the format for a content addressable identifier using sha256. // These identifiers are like digests without the algorithm, since sha256 is used. identifier = `([a-f0-9]{64})` // ipv6address are enclosed between square brackets and may be represented // in many ways, see rfc5952. Only IPv6 in compressed or uncompressed format // are allowed, IPv6 zone identifiers (rfc6874) or Special addresses such as // IPv4-Mapped are deliberately excluded. ipv6address = `\[(?:[a-fA-F0-9:]+)\]` ) var ( // domainName defines the structure of potential domain components // that may be part of image names. This is purposely a subset of what is // allowed by DNS to ensure backwards compatibility with Docker image // names. This includes IPv4 addresses on decimal format. domainName = domainNameComponent + anyTimes(`\.`+domainNameComponent) // host defines the structure of potential domains based on the URI // Host subcomponent on rfc3986. It may be a subset of DNS domain name, // or an IPv4 address in decimal format, or an IPv6 address between square // brackets (excluding zone identifiers as defined by rfc6874 or special // addresses such as IPv4-Mapped). host = `(?:` + domainName + `|` + ipv6address + `)` // allowed by the URI Host subcomponent on rfc3986 to ensure backwards // compatibility with Docker image names. domainAndPort = host + optionalPort // anchoredTagRegexp matches valid tag names, anchored at the start and // end of the matched string. anchoredTagRegexp = regexp.MustCompile(anchored(tag)) // anchoredDigestRegexp matches valid digests, anchored at the start and // end of the matched string. anchoredDigestRegexp = regexp.MustCompile(anchored(digestPat)) // pathComponent restricts path-components to start with an alphanumeric // character, with following parts able to be separated by a separator // (one period, one or two underscore and multiple dashes). pathComponent = alphanumeric + anyTimes(separator+alphanumeric) // remoteName matches the remote-name of a repository. It consists of one // or more forward slash (/) delimited path-components: // // pathComponent[[/pathComponent] ...] // e.g., "library/ubuntu" remoteName = pathComponent + anyTimes(`/`+pathComponent) namePat = optional(domainAndPort+`/`) + remoteName // anchoredNameRegexp is used to parse a name value, capturing the // domain and trailing components. anchoredNameRegexp = regexp.MustCompile(anchored(optional(capture(domainAndPort), `/`), capture(remoteName))) referencePat = anchored(capture(namePat), optional(`:`, capture(tag)), optional(`@`, capture(digestPat))) // anchoredIdentifierRegexp is used to check or match an // identifier value, anchored at start and end of string. anchoredIdentifierRegexp = regexp.MustCompile(anchored(identifier)) ) // optional wraps the expression in a non-capturing group and makes the // production optional. func optional(res ...string) string { return `(?:` + strings.Join(res, "") + `)?` } // anyTimes wraps the expression in a non-capturing group that can occur // any number of times. func anyTimes(res ...string) string { return `(?:` + strings.Join(res, "") + `)*` } // capture wraps the expression in a capturing group. func capture(res ...string) string { return `(` + strings.Join(res, "") + `)` } // anchored anchors the regular expression by adding start and end delimiters. func anchored(res ...string) string { return `^` + strings.Join(res, "") + `$` } ================================================ FILE: vendor/github.com/distribution/reference/sort.go ================================================ /* Copyright The containerd Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package reference import ( "sort" ) // Sort sorts string references preferring higher information references. // // The precedence is as follows: // // 1. [Named] + [Tagged] + [Digested] (e.g., "docker.io/library/busybox:latest@sha256:") // 2. [Named] + [Tagged] (e.g., "docker.io/library/busybox:latest") // 3. [Named] + [Digested] (e.g., "docker.io/library/busybo@sha256:") // 4. [Named] (e.g., "docker.io/library/busybox") // 5. [Digested] (e.g., "docker.io@sha256:") // 6. Parse error func Sort(references []string) []string { var prefs []Reference var bad []string for _, ref := range references { pref, err := ParseAnyReference(ref) if err != nil { bad = append(bad, ref) } else { prefs = append(prefs, pref) } } sort.Slice(prefs, func(a, b int) bool { ar := refRank(prefs[a]) br := refRank(prefs[b]) if ar == br { return prefs[a].String() < prefs[b].String() } return ar < br }) sort.Strings(bad) var refs []string for _, pref := range prefs { refs = append(refs, pref.String()) } return append(refs, bad...) } func refRank(ref Reference) uint8 { if _, ok := ref.(Named); ok { if _, ok = ref.(Tagged); ok { if _, ok = ref.(Digested); ok { return 1 } return 2 } if _, ok = ref.(Digested); ok { return 3 } return 4 } return 5 } ================================================ FILE: vendor/github.com/docker/distribution/LICENSE ================================================ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "{}" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright {yyyy} {name of copyright owner} Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: vendor/github.com/docker/distribution/registry/api/errcode/errors.go ================================================ package errcode import ( "encoding/json" "fmt" "strings" ) // ErrorCoder is the base interface for ErrorCode and Error allowing // users of each to just call ErrorCode to get the real ID of each type ErrorCoder interface { ErrorCode() ErrorCode } // ErrorCode represents the error type. The errors are serialized via strings // and the integer format may change and should *never* be exported. type ErrorCode int var _ error = ErrorCode(0) // ErrorCode just returns itself func (ec ErrorCode) ErrorCode() ErrorCode { return ec } // Error returns the ID/Value func (ec ErrorCode) Error() string { // NOTE(stevvooe): Cannot use message here since it may have unpopulated args. return strings.ToLower(strings.Replace(ec.String(), "_", " ", -1)) } // Descriptor returns the descriptor for the error code. func (ec ErrorCode) Descriptor() ErrorDescriptor { d, ok := errorCodeToDescriptors[ec] if !ok { return ErrorCodeUnknown.Descriptor() } return d } // String returns the canonical identifier for this error code. func (ec ErrorCode) String() string { return ec.Descriptor().Value } // Message returned the human-readable error message for this error code. func (ec ErrorCode) Message() string { return ec.Descriptor().Message } // MarshalText encodes the receiver into UTF-8-encoded text and returns the // result. func (ec ErrorCode) MarshalText() (text []byte, err error) { return []byte(ec.String()), nil } // UnmarshalText decodes the form generated by MarshalText. func (ec *ErrorCode) UnmarshalText(text []byte) error { desc, ok := idToDescriptors[string(text)] if !ok { desc = ErrorCodeUnknown.Descriptor() } *ec = desc.Code return nil } // WithMessage creates a new Error struct based on the passed-in info and // overrides the Message property. func (ec ErrorCode) WithMessage(message string) Error { return Error{ Code: ec, Message: message, } } // WithDetail creates a new Error struct based on the passed-in info and // set the Detail property appropriately func (ec ErrorCode) WithDetail(detail interface{}) Error { return Error{ Code: ec, Message: ec.Message(), }.WithDetail(detail) } // WithArgs creates a new Error struct and sets the Args slice func (ec ErrorCode) WithArgs(args ...interface{}) Error { return Error{ Code: ec, Message: ec.Message(), }.WithArgs(args...) } // Error provides a wrapper around ErrorCode with extra Details provided. type Error struct { Code ErrorCode `json:"code"` Message string `json:"message"` Detail interface{} `json:"detail,omitempty"` // TODO(duglin): See if we need an "args" property so we can do the // variable substitution right before showing the message to the user } var _ error = Error{} // ErrorCode returns the ID/Value of this Error func (e Error) ErrorCode() ErrorCode { return e.Code } // Error returns a human readable representation of the error. func (e Error) Error() string { return fmt.Sprintf("%s: %s", e.Code.Error(), e.Message) } // WithDetail will return a new Error, based on the current one, but with // some Detail info added func (e Error) WithDetail(detail interface{}) Error { return Error{ Code: e.Code, Message: e.Message, Detail: detail, } } // WithArgs uses the passed-in list of interface{} as the substitution // variables in the Error's Message string, but returns a new Error func (e Error) WithArgs(args ...interface{}) Error { return Error{ Code: e.Code, Message: fmt.Sprintf(e.Code.Message(), args...), Detail: e.Detail, } } // ErrorDescriptor provides relevant information about a given error code. type ErrorDescriptor struct { // Code is the error code that this descriptor describes. Code ErrorCode // Value provides a unique, string key, often captilized with // underscores, to identify the error code. This value is used as the // keyed value when serializing api errors. Value string // Message is a short, human readable decription of the error condition // included in API responses. Message string // Description provides a complete account of the errors purpose, suitable // for use in documentation. Description string // HTTPStatusCode provides the http status code that is associated with // this error condition. HTTPStatusCode int } // ParseErrorCode returns the value by the string error code. // `ErrorCodeUnknown` will be returned if the error is not known. func ParseErrorCode(value string) ErrorCode { ed, ok := idToDescriptors[value] if ok { return ed.Code } return ErrorCodeUnknown } // Errors provides the envelope for multiple errors and a few sugar methods // for use within the application. type Errors []error var _ error = Errors{} func (errs Errors) Error() string { switch len(errs) { case 0: return "" case 1: return errs[0].Error() default: msg := "errors:\n" for _, err := range errs { msg += err.Error() + "\n" } return msg } } // Len returns the current number of errors. func (errs Errors) Len() int { return len(errs) } // MarshalJSON converts slice of error, ErrorCode or Error into a // slice of Error - then serializes func (errs Errors) MarshalJSON() ([]byte, error) { var tmpErrs struct { Errors []Error `json:"errors,omitempty"` } for _, daErr := range errs { var err Error switch daErr := daErr.(type) { case ErrorCode: err = daErr.WithDetail(nil) case Error: err = daErr default: err = ErrorCodeUnknown.WithDetail(daErr) } // If the Error struct was setup and they forgot to set the // Message field (meaning its "") then grab it from the ErrCode msg := err.Message if msg == "" { msg = err.Code.Message() } tmpErrs.Errors = append(tmpErrs.Errors, Error{ Code: err.Code, Message: msg, Detail: err.Detail, }) } return json.Marshal(tmpErrs) } // UnmarshalJSON deserializes []Error and then converts it into slice of // Error or ErrorCode func (errs *Errors) UnmarshalJSON(data []byte) error { var tmpErrs struct { Errors []Error } if err := json.Unmarshal(data, &tmpErrs); err != nil { return err } var newErrs Errors for _, daErr := range tmpErrs.Errors { // If Message is empty or exactly matches the Code's message string // then just use the Code, no need for a full Error struct if daErr.Detail == nil && (daErr.Message == "" || daErr.Message == daErr.Code.Message()) { // Error's w/o details get converted to ErrorCode newErrs = append(newErrs, daErr.Code) } else { // Error's w/ details are untouched newErrs = append(newErrs, Error{ Code: daErr.Code, Message: daErr.Message, Detail: daErr.Detail, }) } } *errs = newErrs return nil } ================================================ FILE: vendor/github.com/docker/distribution/registry/api/errcode/handler.go ================================================ package errcode import ( "encoding/json" "net/http" ) // ServeJSON attempts to serve the errcode in a JSON envelope. It marshals err // and sets the content-type header to 'application/json'. It will handle // ErrorCoder and Errors, and if necessary will create an envelope. func ServeJSON(w http.ResponseWriter, err error) error { w.Header().Set("Content-Type", "application/json; charset=utf-8") var sc int switch errs := err.(type) { case Errors: if len(errs) < 1 { break } if err, ok := errs[0].(ErrorCoder); ok { sc = err.ErrorCode().Descriptor().HTTPStatusCode } case ErrorCoder: sc = errs.ErrorCode().Descriptor().HTTPStatusCode err = Errors{err} // create an envelope. default: // We just have an unhandled error type, so just place in an envelope // and move along. err = Errors{err} } if sc == 0 { sc = http.StatusInternalServerError } w.WriteHeader(sc) return json.NewEncoder(w).Encode(err) } ================================================ FILE: vendor/github.com/docker/distribution/registry/api/errcode/register.go ================================================ package errcode import ( "fmt" "net/http" "sort" "sync" ) var ( errorCodeToDescriptors = map[ErrorCode]ErrorDescriptor{} idToDescriptors = map[string]ErrorDescriptor{} groupToDescriptors = map[string][]ErrorDescriptor{} ) var ( // ErrorCodeUnknown is a generic error that can be used as a last // resort if there is no situation-specific error message that can be used ErrorCodeUnknown = Register("errcode", ErrorDescriptor{ Value: "UNKNOWN", Message: "unknown error", Description: `Generic error returned when the error does not have an API classification.`, HTTPStatusCode: http.StatusInternalServerError, }) // ErrorCodeUnsupported is returned when an operation is not supported. ErrorCodeUnsupported = Register("errcode", ErrorDescriptor{ Value: "UNSUPPORTED", Message: "The operation is unsupported.", Description: `The operation was unsupported due to a missing implementation or invalid set of parameters.`, HTTPStatusCode: http.StatusMethodNotAllowed, }) // ErrorCodeUnauthorized is returned if a request requires // authentication. ErrorCodeUnauthorized = Register("errcode", ErrorDescriptor{ Value: "UNAUTHORIZED", Message: "authentication required", Description: `The access controller was unable to authenticate the client. Often this will be accompanied by a Www-Authenticate HTTP response header indicating how to authenticate.`, HTTPStatusCode: http.StatusUnauthorized, }) // ErrorCodeDenied is returned if a client does not have sufficient // permission to perform an action. ErrorCodeDenied = Register("errcode", ErrorDescriptor{ Value: "DENIED", Message: "requested access to the resource is denied", Description: `The access controller denied access for the operation on a resource.`, HTTPStatusCode: http.StatusForbidden, }) // ErrorCodeUnavailable provides a common error to report unavailability // of a service or endpoint. ErrorCodeUnavailable = Register("errcode", ErrorDescriptor{ Value: "UNAVAILABLE", Message: "service unavailable", Description: "Returned when a service is not available", HTTPStatusCode: http.StatusServiceUnavailable, }) // ErrorCodeTooManyRequests is returned if a client attempts too many // times to contact a service endpoint. ErrorCodeTooManyRequests = Register("errcode", ErrorDescriptor{ Value: "TOOMANYREQUESTS", Message: "too many requests", Description: `Returned when a client attempts to contact a service too many times`, HTTPStatusCode: http.StatusTooManyRequests, }) ) var nextCode = 1000 var registerLock sync.Mutex // Register will make the passed-in error known to the environment and // return a new ErrorCode func Register(group string, descriptor ErrorDescriptor) ErrorCode { registerLock.Lock() defer registerLock.Unlock() descriptor.Code = ErrorCode(nextCode) if _, ok := idToDescriptors[descriptor.Value]; ok { panic(fmt.Sprintf("ErrorValue %q is already registered", descriptor.Value)) } if _, ok := errorCodeToDescriptors[descriptor.Code]; ok { panic(fmt.Sprintf("ErrorCode %v is already registered", descriptor.Code)) } groupToDescriptors[group] = append(groupToDescriptors[group], descriptor) errorCodeToDescriptors[descriptor.Code] = descriptor idToDescriptors[descriptor.Value] = descriptor nextCode++ return descriptor.Code } type byValue []ErrorDescriptor func (a byValue) Len() int { return len(a) } func (a byValue) Swap(i, j int) { a[i], a[j] = a[j], a[i] } func (a byValue) Less(i, j int) bool { return a[i].Value < a[j].Value } // GetGroupNames returns the list of Error group names that are registered func GetGroupNames() []string { keys := []string{} for k := range groupToDescriptors { keys = append(keys, k) } sort.Strings(keys) return keys } // GetErrorCodeGroup returns the named group of error descriptors func GetErrorCodeGroup(name string) []ErrorDescriptor { desc := groupToDescriptors[name] sort.Sort(byValue(desc)) return desc } // GetErrorAllDescriptors returns a slice of all ErrorDescriptors that are // registered, irrespective of what group they're in func GetErrorAllDescriptors() []ErrorDescriptor { result := []ErrorDescriptor{} for _, group := range GetGroupNames() { result = append(result, GetErrorCodeGroup(group)...) } sort.Sort(byValue(result)) return result } ================================================ FILE: vendor/github.com/docker/distribution/registry/api/v2/descriptors.go ================================================ package v2 import ( "net/http" "regexp" "github.com/distribution/reference" "github.com/docker/distribution/registry/api/errcode" "github.com/opencontainers/go-digest" ) var ( nameParameterDescriptor = ParameterDescriptor{ Name: "name", Type: "string", Format: reference.NameRegexp.String(), Required: true, Description: `Name of the target repository.`, } referenceParameterDescriptor = ParameterDescriptor{ Name: "reference", Type: "string", Format: reference.TagRegexp.String(), Required: true, Description: `Tag or digest of the target manifest.`, } uuidParameterDescriptor = ParameterDescriptor{ Name: "uuid", Type: "opaque", Required: true, Description: "A uuid identifying the upload. This field can accept characters that match `[a-zA-Z0-9-_.=]+`.", } digestPathParameter = ParameterDescriptor{ Name: "digest", Type: "path", Required: true, Format: digest.DigestRegexp.String(), Description: `Digest of desired blob.`, } hostHeader = ParameterDescriptor{ Name: "Host", Type: "string", Description: "Standard HTTP Host Header. Should be set to the registry host.", Format: "", Examples: []string{"registry-1.docker.io"}, } authHeader = ParameterDescriptor{ Name: "Authorization", Type: "string", Description: "An RFC7235 compliant authorization header.", Format: " ", Examples: []string{"Bearer dGhpcyBpcyBhIGZha2UgYmVhcmVyIHRva2VuIQ=="}, } authChallengeHeader = ParameterDescriptor{ Name: "WWW-Authenticate", Type: "string", Description: "An RFC7235 compliant authentication challenge header.", Format: ` realm="", ..."`, Examples: []string{ `Bearer realm="https://auth.docker.com/", service="registry.docker.com", scopes="repository:library/ubuntu:pull"`, }, } contentLengthZeroHeader = ParameterDescriptor{ Name: "Content-Length", Description: "The `Content-Length` header must be zero and the body must be empty.", Type: "integer", Format: "0", } dockerUploadUUIDHeader = ParameterDescriptor{ Name: "Docker-Upload-UUID", Description: "Identifies the docker upload uuid for the current request.", Type: "uuid", Format: "", } digestHeader = ParameterDescriptor{ Name: "Docker-Content-Digest", Description: "Digest of the targeted content for the request.", Type: "digest", Format: "", } linkHeader = ParameterDescriptor{ Name: "Link", Type: "link", Description: "RFC5988 compliant rel='next' with URL to next result set, if available", Format: `<?n=&last=>; rel="next"`, } paginationParameters = []ParameterDescriptor{ { Name: "n", Type: "integer", Description: "Limit the number of entries in each response. It not present, all entries will be returned.", Format: "", Required: false, }, { Name: "last", Type: "string", Description: "Result set will include values lexically after last.", Format: "", Required: false, }, } unauthorizedResponseDescriptor = ResponseDescriptor{ Name: "Authentication Required", StatusCode: http.StatusUnauthorized, Description: "The client is not authenticated.", Headers: []ParameterDescriptor{ authChallengeHeader, { Name: "Content-Length", Type: "integer", Description: "Length of the JSON response body.", Format: "", }, }, Body: BodyDescriptor{ ContentType: "application/json; charset=utf-8", Format: errorsBody, }, ErrorCodes: []errcode.ErrorCode{ errcode.ErrorCodeUnauthorized, }, } invalidPaginationResponseDescriptor = ResponseDescriptor{ Name: "Invalid pagination number", Description: "The received parameter n was invalid in some way, as described by the error code. The client should resolve the issue and retry the request.", StatusCode: http.StatusBadRequest, Body: BodyDescriptor{ ContentType: "application/json", Format: errorsBody, }, ErrorCodes: []errcode.ErrorCode{ ErrorCodePaginationNumberInvalid, }, } repositoryNotFoundResponseDescriptor = ResponseDescriptor{ Name: "No Such Repository Error", StatusCode: http.StatusNotFound, Description: "The repository is not known to the registry.", Headers: []ParameterDescriptor{ { Name: "Content-Length", Type: "integer", Description: "Length of the JSON response body.", Format: "", }, }, Body: BodyDescriptor{ ContentType: "application/json; charset=utf-8", Format: errorsBody, }, ErrorCodes: []errcode.ErrorCode{ ErrorCodeNameUnknown, }, } deniedResponseDescriptor = ResponseDescriptor{ Name: "Access Denied", StatusCode: http.StatusForbidden, Description: "The client does not have required access to the repository.", Headers: []ParameterDescriptor{ { Name: "Content-Length", Type: "integer", Description: "Length of the JSON response body.", Format: "", }, }, Body: BodyDescriptor{ ContentType: "application/json; charset=utf-8", Format: errorsBody, }, ErrorCodes: []errcode.ErrorCode{ errcode.ErrorCodeDenied, }, } tooManyRequestsDescriptor = ResponseDescriptor{ Name: "Too Many Requests", StatusCode: http.StatusTooManyRequests, Description: "The client made too many requests within a time interval.", Headers: []ParameterDescriptor{ { Name: "Content-Length", Type: "integer", Description: "Length of the JSON response body.", Format: "", }, }, Body: BodyDescriptor{ ContentType: "application/json; charset=utf-8", Format: errorsBody, }, ErrorCodes: []errcode.ErrorCode{ errcode.ErrorCodeTooManyRequests, }, } ) const ( manifestBody = `{ "name": , "tag": , "fsLayers": [ { "blobSum": "" }, ... ] ], "history": , "signature": }` errorsBody = `{ "errors:" [ { "code": , "message": "", "detail": ... }, ... ] }` ) // APIDescriptor exports descriptions of the layout of the v2 registry API. var APIDescriptor = struct { // RouteDescriptors provides a list of the routes available in the API. RouteDescriptors []RouteDescriptor }{ RouteDescriptors: routeDescriptors, } // RouteDescriptor describes a route specified by name. type RouteDescriptor struct { // Name is the name of the route, as specified in RouteNameXXX exports. // These names a should be considered a unique reference for a route. If // the route is registered with gorilla, this is the name that will be // used. Name string // Path is a gorilla/mux-compatible regexp that can be used to match the // route. For any incoming method and path, only one route descriptor // should match. Path string // Entity should be a short, human-readalbe description of the object // targeted by the endpoint. Entity string // Description should provide an accurate overview of the functionality // provided by the route. Description string // Methods should describe the various HTTP methods that may be used on // this route, including request and response formats. Methods []MethodDescriptor } // MethodDescriptor provides a description of the requests that may be // conducted with the target method. type MethodDescriptor struct { // Method is an HTTP method, such as GET, PUT or POST. Method string // Description should provide an overview of the functionality provided by // the covered method, suitable for use in documentation. Use of markdown // here is encouraged. Description string // Requests is a slice of request descriptors enumerating how this // endpoint may be used. Requests []RequestDescriptor } // RequestDescriptor covers a particular set of headers and parameters that // can be carried out with the parent method. Its most helpful to have one // RequestDescriptor per API use case. type RequestDescriptor struct { // Name provides a short identifier for the request, usable as a title or // to provide quick context for the particular request. Name string // Description should cover the requests purpose, covering any details for // this particular use case. Description string // Headers describes headers that must be used with the HTTP request. Headers []ParameterDescriptor // PathParameters enumerate the parameterized path components for the // given request, as defined in the route's regular expression. PathParameters []ParameterDescriptor // QueryParameters provides a list of query parameters for the given // request. QueryParameters []ParameterDescriptor // Body describes the format of the request body. Body BodyDescriptor // Successes enumerates the possible responses that are considered to be // the result of a successful request. Successes []ResponseDescriptor // Failures covers the possible failures from this particular request. Failures []ResponseDescriptor } // ResponseDescriptor describes the components of an API response. type ResponseDescriptor struct { // Name provides a short identifier for the response, usable as a title or // to provide quick context for the particular response. Name string // Description should provide a brief overview of the role of the // response. Description string // StatusCode specifies the status received by this particular response. StatusCode int // Headers covers any headers that may be returned from the response. Headers []ParameterDescriptor // Fields describes any fields that may be present in the response. Fields []ParameterDescriptor // ErrorCodes enumerates the error codes that may be returned along with // the response. ErrorCodes []errcode.ErrorCode // Body describes the body of the response, if any. Body BodyDescriptor } // BodyDescriptor describes a request body and its expected content type. For // the most part, it should be example json or some placeholder for body // data in documentation. type BodyDescriptor struct { ContentType string Format string } // ParameterDescriptor describes the format of a request parameter, which may // be a header, path parameter or query parameter. type ParameterDescriptor struct { // Name is the name of the parameter, either of the path component or // query parameter. Name string // Type specifies the type of the parameter, such as string, integer, etc. Type string // Description provides a human-readable description of the parameter. Description string // Required means the field is required when set. Required bool // Format is a specifying the string format accepted by this parameter. Format string // Regexp is a compiled regular expression that can be used to validate // the contents of the parameter. Regexp *regexp.Regexp // Examples provides multiple examples for the values that might be valid // for this parameter. Examples []string } var routeDescriptors = []RouteDescriptor{ { Name: RouteNameBase, Path: "/v2/", Entity: "Base", Description: `Base V2 API route. Typically, this can be used for lightweight version checks and to validate registry authentication.`, Methods: []MethodDescriptor{ { Method: "GET", Description: "Check that the endpoint implements Docker Registry API V2.", Requests: []RequestDescriptor{ { Headers: []ParameterDescriptor{ hostHeader, authHeader, }, Successes: []ResponseDescriptor{ { Description: "The API implements V2 protocol and is accessible.", StatusCode: http.StatusOK, }, }, Failures: []ResponseDescriptor{ { Description: "The registry does not implement the V2 API.", StatusCode: http.StatusNotFound, }, unauthorizedResponseDescriptor, tooManyRequestsDescriptor, }, }, }, }, }, }, { Name: RouteNameTags, Path: "/v2/{name:" + reference.NameRegexp.String() + "}/tags/list", Entity: "Tags", Description: "Retrieve information about tags.", Methods: []MethodDescriptor{ { Method: "GET", Description: "Fetch the tags under the repository identified by `name`.", Requests: []RequestDescriptor{ { Name: "Tags", Description: "Return all tags for the repository", Headers: []ParameterDescriptor{ hostHeader, authHeader, }, PathParameters: []ParameterDescriptor{ nameParameterDescriptor, }, Successes: []ResponseDescriptor{ { StatusCode: http.StatusOK, Description: "A list of tags for the named repository.", Headers: []ParameterDescriptor{ { Name: "Content-Length", Type: "integer", Description: "Length of the JSON response body.", Format: "", }, }, Body: BodyDescriptor{ ContentType: "application/json; charset=utf-8", Format: `{ "name": , "tags": [ , ... ] }`, }, }, }, Failures: []ResponseDescriptor{ unauthorizedResponseDescriptor, repositoryNotFoundResponseDescriptor, deniedResponseDescriptor, tooManyRequestsDescriptor, }, }, { Name: "Tags Paginated", Description: "Return a portion of the tags for the specified repository.", PathParameters: []ParameterDescriptor{nameParameterDescriptor}, QueryParameters: paginationParameters, Successes: []ResponseDescriptor{ { StatusCode: http.StatusOK, Description: "A list of tags for the named repository.", Headers: []ParameterDescriptor{ { Name: "Content-Length", Type: "integer", Description: "Length of the JSON response body.", Format: "", }, linkHeader, }, Body: BodyDescriptor{ ContentType: "application/json; charset=utf-8", Format: `{ "name": , "tags": [ , ... ], }`, }, }, }, Failures: []ResponseDescriptor{ invalidPaginationResponseDescriptor, unauthorizedResponseDescriptor, repositoryNotFoundResponseDescriptor, deniedResponseDescriptor, tooManyRequestsDescriptor, }, }, }, }, }, }, { Name: RouteNameManifest, Path: "/v2/{name:" + reference.NameRegexp.String() + "}/manifests/{reference:" + reference.TagRegexp.String() + "|" + digest.DigestRegexp.String() + "}", Entity: "Manifest", Description: "Create, update, delete and retrieve manifests.", Methods: []MethodDescriptor{ { Method: "GET", Description: "Fetch the manifest identified by `name` and `reference` where `reference` can be a tag or digest. A `HEAD` request can also be issued to this endpoint to obtain resource information without receiving all data.", Requests: []RequestDescriptor{ { Headers: []ParameterDescriptor{ hostHeader, authHeader, }, PathParameters: []ParameterDescriptor{ nameParameterDescriptor, referenceParameterDescriptor, }, Successes: []ResponseDescriptor{ { Description: "The manifest identified by `name` and `reference`. The contents can be used to identify and resolve resources required to run the specified image.", StatusCode: http.StatusOK, Headers: []ParameterDescriptor{ digestHeader, }, Body: BodyDescriptor{ ContentType: "", Format: manifestBody, }, }, }, Failures: []ResponseDescriptor{ { Description: "The name or reference was invalid.", StatusCode: http.StatusBadRequest, ErrorCodes: []errcode.ErrorCode{ ErrorCodeNameInvalid, ErrorCodeTagInvalid, }, Body: BodyDescriptor{ ContentType: "application/json; charset=utf-8", Format: errorsBody, }, }, unauthorizedResponseDescriptor, repositoryNotFoundResponseDescriptor, deniedResponseDescriptor, tooManyRequestsDescriptor, }, }, }, }, { Method: "PUT", Description: "Put the manifest identified by `name` and `reference` where `reference` can be a tag or digest.", Requests: []RequestDescriptor{ { Headers: []ParameterDescriptor{ hostHeader, authHeader, }, PathParameters: []ParameterDescriptor{ nameParameterDescriptor, referenceParameterDescriptor, }, Body: BodyDescriptor{ ContentType: "", Format: manifestBody, }, Successes: []ResponseDescriptor{ { Description: "The manifest has been accepted by the registry and is stored under the specified `name` and `tag`.", StatusCode: http.StatusCreated, Headers: []ParameterDescriptor{ { Name: "Location", Type: "url", Description: "The canonical location url of the uploaded manifest.", Format: "", }, contentLengthZeroHeader, digestHeader, }, }, }, Failures: []ResponseDescriptor{ { Name: "Invalid Manifest", Description: "The received manifest was invalid in some way, as described by the error codes. The client should resolve the issue and retry the request.", StatusCode: http.StatusBadRequest, Body: BodyDescriptor{ ContentType: "application/json; charset=utf-8", Format: errorsBody, }, ErrorCodes: []errcode.ErrorCode{ ErrorCodeNameInvalid, ErrorCodeTagInvalid, ErrorCodeManifestInvalid, ErrorCodeManifestUnverified, ErrorCodeBlobUnknown, }, }, unauthorizedResponseDescriptor, repositoryNotFoundResponseDescriptor, deniedResponseDescriptor, tooManyRequestsDescriptor, { Name: "Missing Layer(s)", Description: "One or more layers may be missing during a manifest upload. If so, the missing layers will be enumerated in the error response.", StatusCode: http.StatusBadRequest, ErrorCodes: []errcode.ErrorCode{ ErrorCodeBlobUnknown, }, Body: BodyDescriptor{ ContentType: "application/json; charset=utf-8", Format: `{ "errors:" [{ "code": "BLOB_UNKNOWN", "message": "blob unknown to registry", "detail": { "digest": "" } }, ... ] }`, }, }, { Name: "Not allowed", Description: "Manifest put is not allowed because the registry is configured as a pull-through cache or for some other reason", StatusCode: http.StatusMethodNotAllowed, ErrorCodes: []errcode.ErrorCode{ errcode.ErrorCodeUnsupported, }, }, }, }, }, }, { Method: "DELETE", Description: "Delete the manifest identified by `name` and `reference`. Note that a manifest can _only_ be deleted by `digest`.", Requests: []RequestDescriptor{ { Headers: []ParameterDescriptor{ hostHeader, authHeader, }, PathParameters: []ParameterDescriptor{ nameParameterDescriptor, referenceParameterDescriptor, }, Successes: []ResponseDescriptor{ { StatusCode: http.StatusAccepted, }, }, Failures: []ResponseDescriptor{ { Name: "Invalid Name or Reference", Description: "The specified `name` or `reference` were invalid and the delete was unable to proceed.", StatusCode: http.StatusBadRequest, ErrorCodes: []errcode.ErrorCode{ ErrorCodeNameInvalid, ErrorCodeTagInvalid, }, Body: BodyDescriptor{ ContentType: "application/json; charset=utf-8", Format: errorsBody, }, }, unauthorizedResponseDescriptor, repositoryNotFoundResponseDescriptor, deniedResponseDescriptor, tooManyRequestsDescriptor, { Name: "Unknown Manifest", Description: "The specified `name` or `reference` are unknown to the registry and the delete was unable to proceed. Clients can assume the manifest was already deleted if this response is returned.", StatusCode: http.StatusNotFound, ErrorCodes: []errcode.ErrorCode{ ErrorCodeNameUnknown, ErrorCodeManifestUnknown, }, Body: BodyDescriptor{ ContentType: "application/json; charset=utf-8", Format: errorsBody, }, }, { Name: "Not allowed", Description: "Manifest delete is not allowed because the registry is configured as a pull-through cache or `delete` has been disabled.", StatusCode: http.StatusMethodNotAllowed, ErrorCodes: []errcode.ErrorCode{ errcode.ErrorCodeUnsupported, }, }, }, }, }, }, }, }, { Name: RouteNameBlob, Path: "/v2/{name:" + reference.NameRegexp.String() + "}/blobs/{digest:" + digest.DigestRegexp.String() + "}", Entity: "Blob", Description: "Operations on blobs identified by `name` and `digest`. Used to fetch or delete layers by digest.", Methods: []MethodDescriptor{ { Method: "GET", Description: "Retrieve the blob from the registry identified by `digest`. A `HEAD` request can also be issued to this endpoint to obtain resource information without receiving all data.", Requests: []RequestDescriptor{ { Name: "Fetch Blob", Headers: []ParameterDescriptor{ hostHeader, authHeader, }, PathParameters: []ParameterDescriptor{ nameParameterDescriptor, digestPathParameter, }, Successes: []ResponseDescriptor{ { Description: "The blob identified by `digest` is available. The blob content will be present in the body of the request.", StatusCode: http.StatusOK, Headers: []ParameterDescriptor{ { Name: "Content-Length", Type: "integer", Description: "The length of the requested blob content.", Format: "", }, digestHeader, }, Body: BodyDescriptor{ ContentType: "application/octet-stream", Format: "", }, }, { Description: "The blob identified by `digest` is available at the provided location.", StatusCode: http.StatusTemporaryRedirect, Headers: []ParameterDescriptor{ { Name: "Location", Type: "url", Description: "The location where the layer should be accessible.", Format: "", }, digestHeader, }, }, }, Failures: []ResponseDescriptor{ { Description: "There was a problem with the request that needs to be addressed by the client, such as an invalid `name` or `tag`.", StatusCode: http.StatusBadRequest, ErrorCodes: []errcode.ErrorCode{ ErrorCodeNameInvalid, ErrorCodeDigestInvalid, }, Body: BodyDescriptor{ ContentType: "application/json; charset=utf-8", Format: errorsBody, }, }, { Description: "The blob, identified by `name` and `digest`, is unknown to the registry.", StatusCode: http.StatusNotFound, Body: BodyDescriptor{ ContentType: "application/json; charset=utf-8", Format: errorsBody, }, ErrorCodes: []errcode.ErrorCode{ ErrorCodeNameUnknown, ErrorCodeBlobUnknown, }, }, unauthorizedResponseDescriptor, repositoryNotFoundResponseDescriptor, deniedResponseDescriptor, tooManyRequestsDescriptor, }, }, { Name: "Fetch Blob Part", Description: "This endpoint may also support RFC7233 compliant range requests. Support can be detected by issuing a HEAD request. If the header `Accept-Range: bytes` is returned, range requests can be used to fetch partial content.", Headers: []ParameterDescriptor{ hostHeader, authHeader, { Name: "Range", Type: "string", Description: "HTTP Range header specifying blob chunk.", Format: "bytes=-", }, }, PathParameters: []ParameterDescriptor{ nameParameterDescriptor, digestPathParameter, }, Successes: []ResponseDescriptor{ { Description: "The blob identified by `digest` is available. The specified chunk of blob content will be present in the body of the request.", StatusCode: http.StatusPartialContent, Headers: []ParameterDescriptor{ { Name: "Content-Length", Type: "integer", Description: "The length of the requested blob chunk.", Format: "", }, { Name: "Content-Range", Type: "byte range", Description: "Content range of blob chunk.", Format: "bytes -/", }, }, Body: BodyDescriptor{ ContentType: "application/octet-stream", Format: "", }, }, }, Failures: []ResponseDescriptor{ { Description: "There was a problem with the request that needs to be addressed by the client, such as an invalid `name` or `tag`.", StatusCode: http.StatusBadRequest, ErrorCodes: []errcode.ErrorCode{ ErrorCodeNameInvalid, ErrorCodeDigestInvalid, }, Body: BodyDescriptor{ ContentType: "application/json; charset=utf-8", Format: errorsBody, }, }, { StatusCode: http.StatusNotFound, ErrorCodes: []errcode.ErrorCode{ ErrorCodeNameUnknown, ErrorCodeBlobUnknown, }, Body: BodyDescriptor{ ContentType: "application/json; charset=utf-8", Format: errorsBody, }, }, { Description: "The range specification cannot be satisfied for the requested content. This can happen when the range is not formatted correctly or if the range is outside of the valid size of the content.", StatusCode: http.StatusRequestedRangeNotSatisfiable, }, unauthorizedResponseDescriptor, repositoryNotFoundResponseDescriptor, deniedResponseDescriptor, tooManyRequestsDescriptor, }, }, }, }, { Method: "DELETE", Description: "Delete the blob identified by `name` and `digest`", Requests: []RequestDescriptor{ { Headers: []ParameterDescriptor{ hostHeader, authHeader, }, PathParameters: []ParameterDescriptor{ nameParameterDescriptor, digestPathParameter, }, Successes: []ResponseDescriptor{ { StatusCode: http.StatusAccepted, Headers: []ParameterDescriptor{ { Name: "Content-Length", Type: "integer", Description: "0", Format: "0", }, digestHeader, }, }, }, Failures: []ResponseDescriptor{ { Name: "Invalid Name or Digest", StatusCode: http.StatusBadRequest, ErrorCodes: []errcode.ErrorCode{ ErrorCodeDigestInvalid, ErrorCodeNameInvalid, }, }, { Description: "The blob, identified by `name` and `digest`, is unknown to the registry.", StatusCode: http.StatusNotFound, Body: BodyDescriptor{ ContentType: "application/json; charset=utf-8", Format: errorsBody, }, ErrorCodes: []errcode.ErrorCode{ ErrorCodeNameUnknown, ErrorCodeBlobUnknown, }, }, { Description: "Blob delete is not allowed because the registry is configured as a pull-through cache or `delete` has been disabled", StatusCode: http.StatusMethodNotAllowed, Body: BodyDescriptor{ ContentType: "application/json; charset=utf-8", Format: errorsBody, }, ErrorCodes: []errcode.ErrorCode{ errcode.ErrorCodeUnsupported, }, }, unauthorizedResponseDescriptor, repositoryNotFoundResponseDescriptor, deniedResponseDescriptor, tooManyRequestsDescriptor, }, }, }, }, // TODO(stevvooe): We may want to add a PUT request here to // kickoff an upload of a blob, integrated with the blob upload // API. }, }, { Name: RouteNameBlobUpload, Path: "/v2/{name:" + reference.NameRegexp.String() + "}/blobs/uploads/", Entity: "Initiate Blob Upload", Description: "Initiate a blob upload. This endpoint can be used to create resumable uploads or monolithic uploads.", Methods: []MethodDescriptor{ { Method: "POST", Description: "Initiate a resumable blob upload. If successful, an upload location will be provided to complete the upload. Optionally, if the `digest` parameter is present, the request body will be used to complete the upload in a single request.", Requests: []RequestDescriptor{ { Name: "Initiate Monolithic Blob Upload", Description: "Upload a blob identified by the `digest` parameter in single request. This upload will not be resumable unless a recoverable error is returned.", Headers: []ParameterDescriptor{ hostHeader, authHeader, { Name: "Content-Length", Type: "integer", Format: "", }, }, PathParameters: []ParameterDescriptor{ nameParameterDescriptor, }, QueryParameters: []ParameterDescriptor{ { Name: "digest", Type: "query", Format: "", Regexp: digest.DigestRegexp, Description: `Digest of uploaded blob. If present, the upload will be completed, in a single request, with contents of the request body as the resulting blob.`, }, }, Body: BodyDescriptor{ ContentType: "application/octect-stream", Format: "", }, Successes: []ResponseDescriptor{ { Description: "The blob has been created in the registry and is available at the provided location.", StatusCode: http.StatusCreated, Headers: []ParameterDescriptor{ { Name: "Location", Type: "url", Format: "", }, contentLengthZeroHeader, dockerUploadUUIDHeader, }, }, }, Failures: []ResponseDescriptor{ { Name: "Invalid Name or Digest", StatusCode: http.StatusBadRequest, ErrorCodes: []errcode.ErrorCode{ ErrorCodeDigestInvalid, ErrorCodeNameInvalid, }, }, { Name: "Not allowed", Description: "Blob upload is not allowed because the registry is configured as a pull-through cache or for some other reason", StatusCode: http.StatusMethodNotAllowed, ErrorCodes: []errcode.ErrorCode{ errcode.ErrorCodeUnsupported, }, }, unauthorizedResponseDescriptor, repositoryNotFoundResponseDescriptor, deniedResponseDescriptor, tooManyRequestsDescriptor, }, }, { Name: "Initiate Resumable Blob Upload", Description: "Initiate a resumable blob upload with an empty request body.", Headers: []ParameterDescriptor{ hostHeader, authHeader, contentLengthZeroHeader, }, PathParameters: []ParameterDescriptor{ nameParameterDescriptor, }, Successes: []ResponseDescriptor{ { Description: "The upload has been created. The `Location` header must be used to complete the upload. The response should be identical to a `GET` request on the contents of the returned `Location` header.", StatusCode: http.StatusAccepted, Headers: []ParameterDescriptor{ contentLengthZeroHeader, { Name: "Location", Type: "url", Format: "/v2//blobs/uploads/", Description: "The location of the created upload. Clients should use the contents verbatim to complete the upload, adding parameters where required.", }, { Name: "Range", Format: "0-0", Description: "Range header indicating the progress of the upload. When starting an upload, it will return an empty range, since no content has been received.", }, dockerUploadUUIDHeader, }, }, }, Failures: []ResponseDescriptor{ { Name: "Invalid Name or Digest", StatusCode: http.StatusBadRequest, ErrorCodes: []errcode.ErrorCode{ ErrorCodeDigestInvalid, ErrorCodeNameInvalid, }, }, unauthorizedResponseDescriptor, repositoryNotFoundResponseDescriptor, deniedResponseDescriptor, tooManyRequestsDescriptor, }, }, { Name: "Mount Blob", Description: "Mount a blob identified by the `mount` parameter from another repository.", Headers: []ParameterDescriptor{ hostHeader, authHeader, contentLengthZeroHeader, }, PathParameters: []ParameterDescriptor{ nameParameterDescriptor, }, QueryParameters: []ParameterDescriptor{ { Name: "mount", Type: "query", Format: "", Regexp: digest.DigestRegexp, Description: `Digest of blob to mount from the source repository.`, }, { Name: "from", Type: "query", Format: "", Regexp: reference.NameRegexp, Description: `Name of the source repository.`, }, }, Successes: []ResponseDescriptor{ { Description: "The blob has been mounted in the repository and is available at the provided location.", StatusCode: http.StatusCreated, Headers: []ParameterDescriptor{ { Name: "Location", Type: "url", Format: "", }, contentLengthZeroHeader, dockerUploadUUIDHeader, }, }, }, Failures: []ResponseDescriptor{ { Name: "Invalid Name or Digest", StatusCode: http.StatusBadRequest, ErrorCodes: []errcode.ErrorCode{ ErrorCodeDigestInvalid, ErrorCodeNameInvalid, }, }, { Name: "Not allowed", Description: "Blob mount is not allowed because the registry is configured as a pull-through cache or for some other reason", StatusCode: http.StatusMethodNotAllowed, ErrorCodes: []errcode.ErrorCode{ errcode.ErrorCodeUnsupported, }, }, unauthorizedResponseDescriptor, repositoryNotFoundResponseDescriptor, deniedResponseDescriptor, tooManyRequestsDescriptor, }, }, }, }, }, }, { Name: RouteNameBlobUploadChunk, Path: "/v2/{name:" + reference.NameRegexp.String() + "}/blobs/uploads/{uuid:[a-zA-Z0-9-_.=]+}", Entity: "Blob Upload", Description: "Interact with blob uploads. Clients should never assemble URLs for this endpoint and should only take it through the `Location` header on related API requests. The `Location` header and its parameters should be preserved by clients, using the latest value returned via upload related API calls.", Methods: []MethodDescriptor{ { Method: "GET", Description: "Retrieve status of upload identified by `uuid`. The primary purpose of this endpoint is to resolve the current status of a resumable upload.", Requests: []RequestDescriptor{ { Description: "Retrieve the progress of the current upload, as reported by the `Range` header.", Headers: []ParameterDescriptor{ hostHeader, authHeader, }, PathParameters: []ParameterDescriptor{ nameParameterDescriptor, uuidParameterDescriptor, }, Successes: []ResponseDescriptor{ { Name: "Upload Progress", Description: "The upload is known and in progress. The last received offset is available in the `Range` header.", StatusCode: http.StatusNoContent, Headers: []ParameterDescriptor{ { Name: "Range", Type: "header", Format: "0-", Description: "Range indicating the current progress of the upload.", }, contentLengthZeroHeader, dockerUploadUUIDHeader, }, }, }, Failures: []ResponseDescriptor{ { Description: "There was an error processing the upload and it must be restarted.", StatusCode: http.StatusBadRequest, ErrorCodes: []errcode.ErrorCode{ ErrorCodeDigestInvalid, ErrorCodeNameInvalid, ErrorCodeBlobUploadInvalid, }, Body: BodyDescriptor{ ContentType: "application/json; charset=utf-8", Format: errorsBody, }, }, { Description: "The upload is unknown to the registry. The upload must be restarted.", StatusCode: http.StatusNotFound, ErrorCodes: []errcode.ErrorCode{ ErrorCodeBlobUploadUnknown, }, Body: BodyDescriptor{ ContentType: "application/json; charset=utf-8", Format: errorsBody, }, }, unauthorizedResponseDescriptor, repositoryNotFoundResponseDescriptor, deniedResponseDescriptor, tooManyRequestsDescriptor, }, }, }, }, { Method: "PATCH", Description: "Upload a chunk of data for the specified upload.", Requests: []RequestDescriptor{ { Name: "Stream upload", Description: "Upload a stream of data to upload without completing the upload.", PathParameters: []ParameterDescriptor{ nameParameterDescriptor, uuidParameterDescriptor, }, Headers: []ParameterDescriptor{ hostHeader, authHeader, }, Body: BodyDescriptor{ ContentType: "application/octet-stream", Format: "", }, Successes: []ResponseDescriptor{ { Name: "Data Accepted", Description: "The stream of data has been accepted and the current progress is available in the range header. The updated upload location is available in the `Location` header.", StatusCode: http.StatusNoContent, Headers: []ParameterDescriptor{ { Name: "Location", Type: "url", Format: "/v2//blobs/uploads/", Description: "The location of the upload. Clients should assume this changes after each request. Clients should use the contents verbatim to complete the upload, adding parameters where required.", }, { Name: "Range", Type: "header", Format: "0-", Description: "Range indicating the current progress of the upload.", }, contentLengthZeroHeader, dockerUploadUUIDHeader, }, }, }, Failures: []ResponseDescriptor{ { Description: "There was an error processing the upload and it must be restarted.", StatusCode: http.StatusBadRequest, ErrorCodes: []errcode.ErrorCode{ ErrorCodeDigestInvalid, ErrorCodeNameInvalid, ErrorCodeBlobUploadInvalid, }, Body: BodyDescriptor{ ContentType: "application/json; charset=utf-8", Format: errorsBody, }, }, { Description: "The upload is unknown to the registry. The upload must be restarted.", StatusCode: http.StatusNotFound, ErrorCodes: []errcode.ErrorCode{ ErrorCodeBlobUploadUnknown, }, Body: BodyDescriptor{ ContentType: "application/json; charset=utf-8", Format: errorsBody, }, }, unauthorizedResponseDescriptor, repositoryNotFoundResponseDescriptor, deniedResponseDescriptor, tooManyRequestsDescriptor, }, }, { Name: "Chunked upload", Description: "Upload a chunk of data to specified upload without completing the upload. The data will be uploaded to the specified Content Range.", PathParameters: []ParameterDescriptor{ nameParameterDescriptor, uuidParameterDescriptor, }, Headers: []ParameterDescriptor{ hostHeader, authHeader, { Name: "Content-Range", Type: "header", Format: "-", Required: true, Description: "Range of bytes identifying the desired block of content represented by the body. Start must the end offset retrieved via status check plus one. Note that this is a non-standard use of the `Content-Range` header.", }, { Name: "Content-Length", Type: "integer", Format: "", Description: "Length of the chunk being uploaded, corresponding the length of the request body.", }, }, Body: BodyDescriptor{ ContentType: "application/octet-stream", Format: "", }, Successes: []ResponseDescriptor{ { Name: "Chunk Accepted", Description: "The chunk of data has been accepted and the current progress is available in the range header. The updated upload location is available in the `Location` header.", StatusCode: http.StatusNoContent, Headers: []ParameterDescriptor{ { Name: "Location", Type: "url", Format: "/v2//blobs/uploads/", Description: "The location of the upload. Clients should assume this changes after each request. Clients should use the contents verbatim to complete the upload, adding parameters where required.", }, { Name: "Range", Type: "header", Format: "0-", Description: "Range indicating the current progress of the upload.", }, contentLengthZeroHeader, dockerUploadUUIDHeader, }, }, }, Failures: []ResponseDescriptor{ { Description: "There was an error processing the upload and it must be restarted.", StatusCode: http.StatusBadRequest, ErrorCodes: []errcode.ErrorCode{ ErrorCodeDigestInvalid, ErrorCodeNameInvalid, ErrorCodeBlobUploadInvalid, }, Body: BodyDescriptor{ ContentType: "application/json; charset=utf-8", Format: errorsBody, }, }, { Description: "The upload is unknown to the registry. The upload must be restarted.", StatusCode: http.StatusNotFound, ErrorCodes: []errcode.ErrorCode{ ErrorCodeBlobUploadUnknown, }, Body: BodyDescriptor{ ContentType: "application/json; charset=utf-8", Format: errorsBody, }, }, { Description: "The `Content-Range` specification cannot be accepted, either because it does not overlap with the current progress or it is invalid.", StatusCode: http.StatusRequestedRangeNotSatisfiable, }, unauthorizedResponseDescriptor, repositoryNotFoundResponseDescriptor, deniedResponseDescriptor, tooManyRequestsDescriptor, }, }, }, }, { Method: "PUT", Description: "Complete the upload specified by `uuid`, optionally appending the body as the final chunk.", Requests: []RequestDescriptor{ { Description: "Complete the upload, providing all the data in the body, if necessary. A request without a body will just complete the upload with previously uploaded content.", Headers: []ParameterDescriptor{ hostHeader, authHeader, { Name: "Content-Length", Type: "integer", Format: "", Description: "Length of the data being uploaded, corresponding to the length of the request body. May be zero if no data is provided.", }, }, PathParameters: []ParameterDescriptor{ nameParameterDescriptor, uuidParameterDescriptor, }, QueryParameters: []ParameterDescriptor{ { Name: "digest", Type: "string", Format: "", Regexp: digest.DigestRegexp, Required: true, Description: `Digest of uploaded blob.`, }, }, Body: BodyDescriptor{ ContentType: "application/octet-stream", Format: "", }, Successes: []ResponseDescriptor{ { Name: "Upload Complete", Description: "The upload has been completed and accepted by the registry. The canonical location will be available in the `Location` header.", StatusCode: http.StatusNoContent, Headers: []ParameterDescriptor{ { Name: "Location", Type: "url", Format: "", Description: "The canonical location of the blob for retrieval", }, { Name: "Content-Range", Type: "header", Format: "-", Description: "Range of bytes identifying the desired block of content represented by the body. Start must match the end of offset retrieved via status check. Note that this is a non-standard use of the `Content-Range` header.", }, contentLengthZeroHeader, digestHeader, }, }, }, Failures: []ResponseDescriptor{ { Description: "There was an error processing the upload and it must be restarted.", StatusCode: http.StatusBadRequest, ErrorCodes: []errcode.ErrorCode{ ErrorCodeDigestInvalid, ErrorCodeNameInvalid, ErrorCodeBlobUploadInvalid, errcode.ErrorCodeUnsupported, }, Body: BodyDescriptor{ ContentType: "application/json; charset=utf-8", Format: errorsBody, }, }, { Description: "The upload is unknown to the registry. The upload must be restarted.", StatusCode: http.StatusNotFound, ErrorCodes: []errcode.ErrorCode{ ErrorCodeBlobUploadUnknown, }, Body: BodyDescriptor{ ContentType: "application/json; charset=utf-8", Format: errorsBody, }, }, unauthorizedResponseDescriptor, repositoryNotFoundResponseDescriptor, deniedResponseDescriptor, tooManyRequestsDescriptor, }, }, }, }, { Method: "DELETE", Description: "Cancel outstanding upload processes, releasing associated resources. If this is not called, the unfinished uploads will eventually timeout.", Requests: []RequestDescriptor{ { Description: "Cancel the upload specified by `uuid`.", PathParameters: []ParameterDescriptor{ nameParameterDescriptor, uuidParameterDescriptor, }, Headers: []ParameterDescriptor{ hostHeader, authHeader, contentLengthZeroHeader, }, Successes: []ResponseDescriptor{ { Name: "Upload Deleted", Description: "The upload has been successfully deleted.", StatusCode: http.StatusNoContent, Headers: []ParameterDescriptor{ contentLengthZeroHeader, }, }, }, Failures: []ResponseDescriptor{ { Description: "An error was encountered processing the delete. The client may ignore this error.", StatusCode: http.StatusBadRequest, ErrorCodes: []errcode.ErrorCode{ ErrorCodeNameInvalid, ErrorCodeBlobUploadInvalid, }, Body: BodyDescriptor{ ContentType: "application/json; charset=utf-8", Format: errorsBody, }, }, { Description: "The upload is unknown to the registry. The client may ignore this error and assume the upload has been deleted.", StatusCode: http.StatusNotFound, ErrorCodes: []errcode.ErrorCode{ ErrorCodeBlobUploadUnknown, }, Body: BodyDescriptor{ ContentType: "application/json; charset=utf-8", Format: errorsBody, }, }, unauthorizedResponseDescriptor, repositoryNotFoundResponseDescriptor, deniedResponseDescriptor, tooManyRequestsDescriptor, }, }, }, }, }, }, { Name: RouteNameCatalog, Path: "/v2/_catalog", Entity: "Catalog", Description: "List a set of available repositories in the local registry cluster. Does not provide any indication of what may be available upstream. Applications can only determine if a repository is available but not if it is not available.", Methods: []MethodDescriptor{ { Method: "GET", Description: "Retrieve a sorted, json list of repositories available in the registry.", Requests: []RequestDescriptor{ { Name: "Catalog Fetch", Description: "Request an unabridged list of repositories available. The implementation may impose a maximum limit and return a partial set with pagination links.", Successes: []ResponseDescriptor{ { Description: "Returns the unabridged list of repositories as a json response.", StatusCode: http.StatusOK, Headers: []ParameterDescriptor{ { Name: "Content-Length", Type: "integer", Description: "Length of the JSON response body.", Format: "", }, }, Body: BodyDescriptor{ ContentType: "application/json; charset=utf-8", Format: `{ "repositories": [ , ... ] }`, }, }, }, }, { Name: "Catalog Fetch Paginated", Description: "Return the specified portion of repositories.", QueryParameters: paginationParameters, Successes: []ResponseDescriptor{ { StatusCode: http.StatusOK, Body: BodyDescriptor{ ContentType: "application/json; charset=utf-8", Format: `{ "repositories": [ , ... ] "next": "?last=&n=" }`, }, Headers: []ParameterDescriptor{ { Name: "Content-Length", Type: "integer", Description: "Length of the JSON response body.", Format: "", }, linkHeader, }, }, }, Failures: []ResponseDescriptor{ invalidPaginationResponseDescriptor, }, }, }, }, }, }, } var routeDescriptorsMap map[string]RouteDescriptor func init() { routeDescriptorsMap = make(map[string]RouteDescriptor, len(routeDescriptors)) for _, descriptor := range routeDescriptors { routeDescriptorsMap[descriptor.Name] = descriptor } } ================================================ FILE: vendor/github.com/docker/distribution/registry/api/v2/doc.go ================================================ // Package v2 describes routes, urls and the error codes used in the Docker // Registry JSON HTTP API V2. In addition to declarations, descriptors are // provided for routes and error codes that can be used for implementation and // automatically generating documentation. // // Definitions here are considered to be locked down for the V2 registry api. // Any changes must be considered carefully and should not proceed without a // change proposal in docker core. package v2 ================================================ FILE: vendor/github.com/docker/distribution/registry/api/v2/errors.go ================================================ package v2 import ( "net/http" "github.com/docker/distribution/registry/api/errcode" ) const errGroup = "registry.api.v2" var ( // ErrorCodeDigestInvalid is returned when uploading a blob if the // provided digest does not match the blob contents. ErrorCodeDigestInvalid = errcode.Register(errGroup, errcode.ErrorDescriptor{ Value: "DIGEST_INVALID", Message: "provided digest did not match uploaded content", Description: `When a blob is uploaded, the registry will check that the content matches the digest provided by the client. The error may include a detail structure with the key "digest", including the invalid digest string. This error may also be returned when a manifest includes an invalid layer digest.`, HTTPStatusCode: http.StatusBadRequest, }) // ErrorCodeSizeInvalid is returned when uploading a blob if the provided ErrorCodeSizeInvalid = errcode.Register(errGroup, errcode.ErrorDescriptor{ Value: "SIZE_INVALID", Message: "provided length did not match content length", Description: `When a layer is uploaded, the provided size will be checked against the uploaded content. If they do not match, this error will be returned.`, HTTPStatusCode: http.StatusBadRequest, }) // ErrorCodeNameInvalid is returned when the name in the manifest does not // match the provided name. ErrorCodeNameInvalid = errcode.Register(errGroup, errcode.ErrorDescriptor{ Value: "NAME_INVALID", Message: "invalid repository name", Description: `Invalid repository name encountered either during manifest validation or any API operation.`, HTTPStatusCode: http.StatusBadRequest, }) // ErrorCodeTagInvalid is returned when the tag in the manifest does not // match the provided tag. ErrorCodeTagInvalid = errcode.Register(errGroup, errcode.ErrorDescriptor{ Value: "TAG_INVALID", Message: "manifest tag did not match URI", Description: `During a manifest upload, if the tag in the manifest does not match the uri tag, this error will be returned.`, HTTPStatusCode: http.StatusBadRequest, }) // ErrorCodeNameUnknown when the repository name is not known. ErrorCodeNameUnknown = errcode.Register(errGroup, errcode.ErrorDescriptor{ Value: "NAME_UNKNOWN", Message: "repository name not known to registry", Description: `This is returned if the name used during an operation is unknown to the registry.`, HTTPStatusCode: http.StatusNotFound, }) // ErrorCodeManifestUnknown returned when image manifest is unknown. ErrorCodeManifestUnknown = errcode.Register(errGroup, errcode.ErrorDescriptor{ Value: "MANIFEST_UNKNOWN", Message: "manifest unknown", Description: `This error is returned when the manifest, identified by name and tag is unknown to the repository.`, HTTPStatusCode: http.StatusNotFound, }) // ErrorCodeManifestInvalid returned when an image manifest is invalid, // typically during a PUT operation. This error encompasses all errors // encountered during manifest validation that aren't signature errors. ErrorCodeManifestInvalid = errcode.Register(errGroup, errcode.ErrorDescriptor{ Value: "MANIFEST_INVALID", Message: "manifest invalid", Description: `During upload, manifests undergo several checks ensuring validity. If those checks fail, this error may be returned, unless a more specific error is included. The detail will contain information the failed validation.`, HTTPStatusCode: http.StatusBadRequest, }) // ErrorCodeManifestUnverified is returned when the manifest fails // signature verification. ErrorCodeManifestUnverified = errcode.Register(errGroup, errcode.ErrorDescriptor{ Value: "MANIFEST_UNVERIFIED", Message: "manifest failed signature verification", Description: `During manifest upload, if the manifest fails signature verification, this error will be returned.`, HTTPStatusCode: http.StatusBadRequest, }) // ErrorCodeManifestBlobUnknown is returned when a manifest blob is // unknown to the registry. ErrorCodeManifestBlobUnknown = errcode.Register(errGroup, errcode.ErrorDescriptor{ Value: "MANIFEST_BLOB_UNKNOWN", Message: "blob unknown to registry", Description: `This error may be returned when a manifest blob is unknown to the registry.`, HTTPStatusCode: http.StatusBadRequest, }) // ErrorCodeBlobUnknown is returned when a blob is unknown to the // registry. This can happen when the manifest references a nonexistent // layer or the result is not found by a blob fetch. ErrorCodeBlobUnknown = errcode.Register(errGroup, errcode.ErrorDescriptor{ Value: "BLOB_UNKNOWN", Message: "blob unknown to registry", Description: `This error may be returned when a blob is unknown to the registry in a specified repository. This can be returned with a standard get or if a manifest references an unknown layer during upload.`, HTTPStatusCode: http.StatusNotFound, }) // ErrorCodeBlobUploadUnknown is returned when an upload is unknown. ErrorCodeBlobUploadUnknown = errcode.Register(errGroup, errcode.ErrorDescriptor{ Value: "BLOB_UPLOAD_UNKNOWN", Message: "blob upload unknown to registry", Description: `If a blob upload has been cancelled or was never started, this error code may be returned.`, HTTPStatusCode: http.StatusNotFound, }) // ErrorCodeBlobUploadInvalid is returned when an upload is invalid. ErrorCodeBlobUploadInvalid = errcode.Register(errGroup, errcode.ErrorDescriptor{ Value: "BLOB_UPLOAD_INVALID", Message: "blob upload invalid", Description: `The blob upload encountered an error and can no longer proceed.`, HTTPStatusCode: http.StatusNotFound, }) ErrorCodePaginationNumberInvalid = errcode.Register(errGroup, errcode.ErrorDescriptor{ Value: "PAGINATION_NUMBER_INVALID", Message: "invalid number of results requested", Description: `Returned when the "n" parameter (number of results to return) is not an integer, "n" is negative or "n" is bigger than the maximum allowed.`, HTTPStatusCode: http.StatusBadRequest, }) ) ================================================ FILE: vendor/github.com/docker/distribution/registry/api/v2/headerparser.go ================================================ package v2 import ( "fmt" "regexp" "strings" "unicode" ) var ( // according to rfc7230 reToken = regexp.MustCompile(`^[^"(),/:;<=>?@[\]{}[:space:][:cntrl:]]+`) reQuotedValue = regexp.MustCompile(`^[^\\"]+`) reEscapedCharacter = regexp.MustCompile(`^[[:blank:][:graph:]]`) ) // parseForwardedHeader is a benevolent parser of Forwarded header defined in rfc7239. The header contains // a comma-separated list of forwarding key-value pairs. Each list element is set by single proxy. The // function parses only the first element of the list, which is set by the very first proxy. It returns a map // of corresponding key-value pairs and an unparsed slice of the input string. // // Examples of Forwarded header values: // // 1. Forwarded: For=192.0.2.43; Proto=https,For="[2001:db8:cafe::17]",For=unknown // 2. Forwarded: for="192.0.2.43:443"; host="registry.example.org", for="10.10.05.40:80" // // The first will be parsed into {"for": "192.0.2.43", "proto": "https"} while the second into // {"for": "192.0.2.43:443", "host": "registry.example.org"}. func parseForwardedHeader(forwarded string) (map[string]string, string, error) { // Following are states of forwarded header parser. Any state could transition to a failure. const ( // terminating state; can transition to Parameter stateElement = iota // terminating state; can transition to KeyValueDelimiter stateParameter // can transition to Value stateKeyValueDelimiter // can transition to one of { QuotedValue, PairEnd } stateValue // can transition to one of { EscapedCharacter, PairEnd } stateQuotedValue // can transition to one of { QuotedValue } stateEscapedCharacter // terminating state; can transition to one of { Parameter, Element } statePairEnd ) var ( parameter string value string parse = forwarded[:] res = map[string]string{} state = stateElement ) Loop: for { // skip spaces unless in quoted value if state != stateQuotedValue && state != stateEscapedCharacter { parse = strings.TrimLeftFunc(parse, unicode.IsSpace) } if len(parse) == 0 { if state != stateElement && state != statePairEnd && state != stateParameter { return nil, parse, fmt.Errorf("unexpected end of input") } // terminating break } switch state { // terminate at list element delimiter case stateElement: if parse[0] == ',' { parse = parse[1:] break Loop } state = stateParameter // parse parameter (the key of key-value pair) case stateParameter: match := reToken.FindString(parse) if len(match) == 0 { return nil, parse, fmt.Errorf("failed to parse token at position %d", len(forwarded)-len(parse)) } parameter = strings.ToLower(match) parse = parse[len(match):] state = stateKeyValueDelimiter // parse '=' case stateKeyValueDelimiter: if parse[0] != '=' { return nil, parse, fmt.Errorf("expected '=', not '%c' at position %d", parse[0], len(forwarded)-len(parse)) } parse = parse[1:] state = stateValue // parse value or quoted value case stateValue: if parse[0] == '"' { parse = parse[1:] state = stateQuotedValue } else { value = reToken.FindString(parse) if len(value) == 0 { return nil, parse, fmt.Errorf("failed to parse value at position %d", len(forwarded)-len(parse)) } if _, exists := res[parameter]; exists { return nil, parse, fmt.Errorf("duplicate parameter %q at position %d", parameter, len(forwarded)-len(parse)) } res[parameter] = value parse = parse[len(value):] value = "" state = statePairEnd } // parse a part of quoted value until the first backslash case stateQuotedValue: match := reQuotedValue.FindString(parse) value += match parse = parse[len(match):] switch { case len(parse) == 0: return nil, parse, fmt.Errorf("unterminated quoted string") case parse[0] == '"': res[parameter] = value value = "" parse = parse[1:] state = statePairEnd case parse[0] == '\\': parse = parse[1:] state = stateEscapedCharacter } // parse escaped character in a quoted string, ignore the backslash // transition back to QuotedValue state case stateEscapedCharacter: c := reEscapedCharacter.FindString(parse) if len(c) == 0 { return nil, parse, fmt.Errorf("invalid escape sequence at position %d", len(forwarded)-len(parse)-1) } value += c parse = parse[1:] state = stateQuotedValue // expect either a new key-value pair, new list or end of input case statePairEnd: switch parse[0] { case ';': parse = parse[1:] state = stateParameter case ',': state = stateElement default: return nil, parse, fmt.Errorf("expected ',' or ';', not %c at position %d", parse[0], len(forwarded)-len(parse)) } } } return res, parse, nil } ================================================ FILE: vendor/github.com/docker/distribution/registry/api/v2/routes.go ================================================ package v2 import "github.com/gorilla/mux" // The following are definitions of the name under which all V2 routes are // registered. These symbols can be used to look up a route based on the name. const ( RouteNameBase = "base" RouteNameManifest = "manifest" RouteNameTags = "tags" RouteNameBlob = "blob" RouteNameBlobUpload = "blob-upload" RouteNameBlobUploadChunk = "blob-upload-chunk" RouteNameCatalog = "catalog" ) // Router builds a gorilla router with named routes for the various API // methods. This can be used directly by both server implementations and // clients. func Router() *mux.Router { return RouterWithPrefix("") } // RouterWithPrefix builds a gorilla router with a configured prefix // on all routes. func RouterWithPrefix(prefix string) *mux.Router { rootRouter := mux.NewRouter() router := rootRouter if prefix != "" { router = router.PathPrefix(prefix).Subrouter() } router.StrictSlash(true) for _, descriptor := range routeDescriptors { router.Path(descriptor.Path).Name(descriptor.Name) } return rootRouter } ================================================ FILE: vendor/github.com/docker/distribution/registry/api/v2/urls.go ================================================ package v2 import ( "fmt" "net/http" "net/url" "strings" "github.com/distribution/reference" "github.com/gorilla/mux" ) // URLBuilder creates registry API urls from a single base endpoint. It can be // used to create urls for use in a registry client or server. // // All urls will be created from the given base, including the api version. // For example, if a root of "/foo/" is provided, urls generated will be fall // under "/foo/v2/...". Most application will only provide a schema, host and // port, such as "https://localhost:5000/". type URLBuilder struct { root *url.URL // url root (ie http://localhost/) router *mux.Router relative bool } // NewURLBuilder creates a URLBuilder with provided root url object. func NewURLBuilder(root *url.URL, relative bool) *URLBuilder { return &URLBuilder{ root: root, router: Router(), relative: relative, } } // NewURLBuilderFromString workes identically to NewURLBuilder except it takes // a string argument for the root, returning an error if it is not a valid // url. func NewURLBuilderFromString(root string, relative bool) (*URLBuilder, error) { u, err := url.Parse(root) if err != nil { return nil, err } return NewURLBuilder(u, relative), nil } // NewURLBuilderFromRequest uses information from an *http.Request to // construct the root url. func NewURLBuilderFromRequest(r *http.Request, relative bool) *URLBuilder { var ( scheme = "http" host = r.Host ) if r.TLS != nil { scheme = "https" } else if len(r.URL.Scheme) > 0 { scheme = r.URL.Scheme } // Handle fowarded headers // Prefer "Forwarded" header as defined by rfc7239 if given // see https://tools.ietf.org/html/rfc7239 if forwarded := r.Header.Get("Forwarded"); len(forwarded) > 0 { forwardedHeader, _, err := parseForwardedHeader(forwarded) if err == nil { if fproto := forwardedHeader["proto"]; len(fproto) > 0 { scheme = fproto } if fhost := forwardedHeader["host"]; len(fhost) > 0 { host = fhost } } } else { if forwardedProto := r.Header.Get("X-Forwarded-Proto"); len(forwardedProto) > 0 { scheme = forwardedProto } if forwardedHost := r.Header.Get("X-Forwarded-Host"); len(forwardedHost) > 0 { // According to the Apache mod_proxy docs, X-Forwarded-Host can be a // comma-separated list of hosts, to which each proxy appends the // requested host. We want to grab the first from this comma-separated // list. hosts := strings.SplitN(forwardedHost, ",", 2) host = strings.TrimSpace(hosts[0]) } } basePath := routeDescriptorsMap[RouteNameBase].Path requestPath := r.URL.Path index := strings.Index(requestPath, basePath) u := &url.URL{ Scheme: scheme, Host: host, } if index > 0 { // N.B. index+1 is important because we want to include the trailing / u.Path = requestPath[0 : index+1] } return NewURLBuilder(u, relative) } // BuildBaseURL constructs a base url for the API, typically just "/v2/". func (ub *URLBuilder) BuildBaseURL() (string, error) { route := ub.cloneRoute(RouteNameBase) baseURL, err := route.URL() if err != nil { return "", err } return baseURL.String(), nil } // BuildCatalogURL constructs a url get a catalog of repositories func (ub *URLBuilder) BuildCatalogURL(values ...url.Values) (string, error) { route := ub.cloneRoute(RouteNameCatalog) catalogURL, err := route.URL() if err != nil { return "", err } return appendValuesURL(catalogURL, values...).String(), nil } // BuildTagsURL constructs a url to list the tags in the named repository. func (ub *URLBuilder) BuildTagsURL(name reference.Named) (string, error) { route := ub.cloneRoute(RouteNameTags) tagsURL, err := route.URL("name", name.Name()) if err != nil { return "", err } return tagsURL.String(), nil } // BuildManifestURL constructs a url for the manifest identified by name and // reference. The argument reference may be either a tag or digest. func (ub *URLBuilder) BuildManifestURL(ref reference.Named) (string, error) { route := ub.cloneRoute(RouteNameManifest) tagOrDigest := "" switch v := ref.(type) { case reference.Tagged: tagOrDigest = v.Tag() case reference.Digested: tagOrDigest = v.Digest().String() default: return "", fmt.Errorf("reference must have a tag or digest") } manifestURL, err := route.URL("name", ref.Name(), "reference", tagOrDigest) if err != nil { return "", err } return manifestURL.String(), nil } // BuildBlobURL constructs the url for the blob identified by name and dgst. func (ub *URLBuilder) BuildBlobURL(ref reference.Canonical) (string, error) { route := ub.cloneRoute(RouteNameBlob) layerURL, err := route.URL("name", ref.Name(), "digest", ref.Digest().String()) if err != nil { return "", err } return layerURL.String(), nil } // BuildBlobUploadURL constructs a url to begin a blob upload in the // repository identified by name. func (ub *URLBuilder) BuildBlobUploadURL(name reference.Named, values ...url.Values) (string, error) { route := ub.cloneRoute(RouteNameBlobUpload) uploadURL, err := route.URL("name", name.Name()) if err != nil { return "", err } return appendValuesURL(uploadURL, values...).String(), nil } // BuildBlobUploadChunkURL constructs a url for the upload identified by uuid, // including any url values. This should generally not be used by clients, as // this url is provided by server implementations during the blob upload // process. func (ub *URLBuilder) BuildBlobUploadChunkURL(name reference.Named, uuid string, values ...url.Values) (string, error) { route := ub.cloneRoute(RouteNameBlobUploadChunk) uploadURL, err := route.URL("name", name.Name(), "uuid", uuid) if err != nil { return "", err } return appendValuesURL(uploadURL, values...).String(), nil } // clondedRoute returns a clone of the named route from the router. Routes // must be cloned to avoid modifying them during url generation. func (ub *URLBuilder) cloneRoute(name string) clonedRoute { route := new(mux.Route) root := new(url.URL) *route = *ub.router.GetRoute(name) // clone the route *root = *ub.root return clonedRoute{Route: route, root: root, relative: ub.relative} } type clonedRoute struct { *mux.Route root *url.URL relative bool } func (cr clonedRoute) URL(pairs ...string) (*url.URL, error) { routeURL, err := cr.Route.URL(pairs...) if err != nil { return nil, err } if cr.relative { return routeURL, nil } if routeURL.Scheme == "" && routeURL.User == nil && routeURL.Host == "" { routeURL.Path = routeURL.Path[1:] } url := cr.root.ResolveReference(routeURL) url.Scheme = cr.root.Scheme return url, nil } // appendValuesURL appends the parameters to the url. func appendValuesURL(u *url.URL, values ...url.Values) *url.URL { merged := u.Query() for _, v := range values { for k, vv := range v { merged[k] = append(merged[k], vv...) } } u.RawQuery = merged.Encode() return u } ================================================ FILE: vendor/github.com/docker/docker-credential-helpers/LICENSE ================================================ Copyright (c) 2016 David Calavera Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: vendor/github.com/docker/docker-credential-helpers/client/client.go ================================================ package client import ( "bytes" "encoding/json" "fmt" "strings" "github.com/docker/docker-credential-helpers/credentials" ) // isValidCredsMessage checks if 'msg' contains invalid credentials error message. // It returns whether the logs are free of invalid credentials errors and the error if it isn't. // error values can be errCredentialsMissingServerURL or errCredentialsMissingUsername. func isValidCredsMessage(msg string) error { if credentials.IsCredentialsMissingServerURLMessage(msg) { return credentials.NewErrCredentialsMissingServerURL() } if credentials.IsCredentialsMissingUsernameMessage(msg) { return credentials.NewErrCredentialsMissingUsername() } return nil } // Store uses an external program to save credentials. func Store(program ProgramFunc, creds *credentials.Credentials) error { cmd := program(credentials.ActionStore) buffer := new(bytes.Buffer) if err := json.NewEncoder(buffer).Encode(creds); err != nil { return err } cmd.Input(buffer) out, err := cmd.Output() if err != nil { if isValidErr := isValidCredsMessage(string(out)); isValidErr != nil { err = isValidErr } return fmt.Errorf("error storing credentials - err: %v, out: `%s`", err, strings.TrimSpace(string(out))) } return nil } // Get executes an external program to get the credentials from a native store. func Get(program ProgramFunc, serverURL string) (*credentials.Credentials, error) { cmd := program(credentials.ActionGet) cmd.Input(strings.NewReader(serverURL)) out, err := cmd.Output() if err != nil { if credentials.IsErrCredentialsNotFoundMessage(string(out)) { return nil, credentials.NewErrCredentialsNotFound() } if isValidErr := isValidCredsMessage(string(out)); isValidErr != nil { err = isValidErr } return nil, fmt.Errorf("error getting credentials - err: %v, out: `%s`", err, strings.TrimSpace(string(out))) } resp := &credentials.Credentials{ ServerURL: serverURL, } if err := json.NewDecoder(bytes.NewReader(out)).Decode(resp); err != nil { return nil, err } return resp, nil } // Erase executes a program to remove the server credentials from the native store. func Erase(program ProgramFunc, serverURL string) error { cmd := program(credentials.ActionErase) cmd.Input(strings.NewReader(serverURL)) out, err := cmd.Output() if err != nil { t := strings.TrimSpace(string(out)) if isValidErr := isValidCredsMessage(t); isValidErr != nil { err = isValidErr } return fmt.Errorf("error erasing credentials - err: %v, out: `%s`", err, t) } return nil } // List executes a program to list server credentials in the native store. func List(program ProgramFunc) (map[string]string, error) { cmd := program(credentials.ActionList) cmd.Input(strings.NewReader("unused")) out, err := cmd.Output() if err != nil { t := strings.TrimSpace(string(out)) if isValidErr := isValidCredsMessage(t); isValidErr != nil { err = isValidErr } return nil, fmt.Errorf("error listing credentials - err: %v, out: `%s`", err, t) } var resp map[string]string if err = json.NewDecoder(bytes.NewReader(out)).Decode(&resp); err != nil { return nil, err } return resp, nil } ================================================ FILE: vendor/github.com/docker/docker-credential-helpers/client/command.go ================================================ package client import ( "io" "os" "os/exec" ) // Program is an interface to execute external programs. type Program interface { Output() ([]byte, error) Input(in io.Reader) } // ProgramFunc is a type of function that initializes programs based on arguments. type ProgramFunc func(args ...string) Program // NewShellProgramFunc creates a [ProgramFunc] to run command in a [Shell]. func NewShellProgramFunc(command string) ProgramFunc { return func(args ...string) Program { return createProgramCmdRedirectErr(command, args, nil) } } // NewShellProgramFuncWithEnv creates a [ProgramFunc] tu run command // in a [Shell] with the given environment variables. func NewShellProgramFuncWithEnv(command string, env *map[string]string) ProgramFunc { return func(args ...string) Program { return createProgramCmdRedirectErr(command, args, env) } } func createProgramCmdRedirectErr(command string, args []string, env *map[string]string) *Shell { ec := exec.Command(command, args...) if env != nil { for k, v := range *env { ec.Env = append(ec.Environ(), k+"="+v) } } ec.Stderr = os.Stderr return &Shell{cmd: ec} } // Shell invokes shell commands to talk with a remote credentials-helper. type Shell struct { cmd *exec.Cmd } // Output returns responses from the remote credentials-helper. func (s *Shell) Output() ([]byte, error) { return s.cmd.Output() } // Input sets the input to send to a remote credentials-helper. func (s *Shell) Input(in io.Reader) { s.cmd.Stdin = in } ================================================ FILE: vendor/github.com/docker/docker-credential-helpers/credentials/credentials.go ================================================ package credentials import ( "bufio" "bytes" "encoding/json" "fmt" "io" "os" "strings" ) // Action defines the name of an action (sub-command) supported by a // credential-helper binary. It is an alias for "string", and mostly // for convenience. type Action = string // List of actions (sub-commands) supported by credential-helper binaries. const ( ActionStore Action = "store" ActionGet Action = "get" ActionErase Action = "erase" ActionList Action = "list" ActionVersion Action = "version" ) // Credentials holds the information shared between docker and the credentials store. type Credentials struct { ServerURL string Username string Secret string } // isValid checks the integrity of Credentials object such that no credentials lack // a server URL or a username. // It returns whether the credentials are valid and the error if it isn't. // error values can be errCredentialsMissingServerURL or errCredentialsMissingUsername func (c *Credentials) isValid() (bool, error) { if len(c.ServerURL) == 0 { return false, NewErrCredentialsMissingServerURL() } if len(c.Username) == 0 { return false, NewErrCredentialsMissingUsername() } return true, nil } // CredsLabel holds the way Docker credentials should be labeled as such in credentials stores that allow labelling. // That label allows to filter out non-Docker credentials too at lookup/search in macOS keychain, // Windows credentials manager and Linux libsecret. Default value is "Docker Credentials" var CredsLabel = "Docker Credentials" // SetCredsLabel is a simple setter for CredsLabel func SetCredsLabel(label string) { CredsLabel = label } // Serve initializes the credentials-helper and parses the action argument. // This function is designed to be called from a command line interface. // It uses os.Args[1] as the key for the action. // It uses os.Stdin as input and os.Stdout as output. // This function terminates the program with os.Exit(1) if there is an error. func Serve(helper Helper) { if len(os.Args) != 2 { _, _ = fmt.Fprintln(os.Stdout, usage()) os.Exit(1) } switch os.Args[1] { case "--version", "-v": _ = PrintVersion(os.Stdout) os.Exit(0) case "--help", "-h": _, _ = fmt.Fprintln(os.Stdout, usage()) os.Exit(0) } if err := HandleCommand(helper, os.Args[1], os.Stdin, os.Stdout); err != nil { _, _ = fmt.Fprintln(os.Stdout, err) os.Exit(1) } } func usage() string { return fmt.Sprintf("Usage: %s ", Name) } // HandleCommand runs a helper to execute a credential action. func HandleCommand(helper Helper, action Action, in io.Reader, out io.Writer) error { switch action { case ActionStore: return Store(helper, in) case ActionGet: return Get(helper, in, out) case ActionErase: return Erase(helper, in) case ActionList: return List(helper, out) case ActionVersion: return PrintVersion(out) default: return fmt.Errorf("%s: unknown action: %s", Name, action) } } // Store uses a helper and an input reader to save credentials. // The reader must contain the JSON serialization of a Credentials struct. func Store(helper Helper, reader io.Reader) error { scanner := bufio.NewScanner(reader) buffer := new(bytes.Buffer) for scanner.Scan() { buffer.Write(scanner.Bytes()) } if err := scanner.Err(); err != nil && err != io.EOF { return err } var creds Credentials if err := json.NewDecoder(buffer).Decode(&creds); err != nil { return err } if ok, err := creds.isValid(); !ok { return err } return helper.Add(&creds) } // Get retrieves the credentials for a given server url. // The reader must contain the server URL to search. // The writer is used to write the JSON serialization of the credentials. func Get(helper Helper, reader io.Reader, writer io.Writer) error { scanner := bufio.NewScanner(reader) buffer := new(bytes.Buffer) for scanner.Scan() { buffer.Write(scanner.Bytes()) } if err := scanner.Err(); err != nil && err != io.EOF { return err } serverURL := strings.TrimSpace(buffer.String()) if len(serverURL) == 0 { return NewErrCredentialsMissingServerURL() } username, secret, err := helper.Get(serverURL) if err != nil { return err } buffer.Reset() err = json.NewEncoder(buffer).Encode(Credentials{ ServerURL: serverURL, Username: username, Secret: secret, }) if err != nil { return err } _, _ = fmt.Fprint(writer, buffer.String()) return nil } // Erase removes credentials from the store. // The reader must contain the server URL to remove. func Erase(helper Helper, reader io.Reader) error { scanner := bufio.NewScanner(reader) buffer := new(bytes.Buffer) for scanner.Scan() { buffer.Write(scanner.Bytes()) } if err := scanner.Err(); err != nil && err != io.EOF { return err } serverURL := strings.TrimSpace(buffer.String()) if len(serverURL) == 0 { return NewErrCredentialsMissingServerURL() } return helper.Delete(serverURL) } // List returns all the serverURLs of keys in // the OS store as a list of strings func List(helper Helper, writer io.Writer) error { accts, err := helper.List() if err != nil { return err } return json.NewEncoder(writer).Encode(accts) } // PrintVersion outputs the current version. func PrintVersion(writer io.Writer) error { _, _ = fmt.Fprintf(writer, "%s (%s) %s\n", Name, Package, Version) return nil } ================================================ FILE: vendor/github.com/docker/docker-credential-helpers/credentials/error.go ================================================ package credentials import ( "errors" "strings" ) const ( // ErrCredentialsNotFound standardizes the not found error, so every helper returns // the same message and docker can handle it properly. errCredentialsNotFoundMessage = "credentials not found in native keychain" // ErrCredentialsMissingServerURL and ErrCredentialsMissingUsername standardize // invalid credentials or credentials management operations errCredentialsMissingServerURLMessage = "no credentials server URL" errCredentialsMissingUsernameMessage = "no credentials username" ) // errCredentialsNotFound represents an error // raised when credentials are not in the store. type errCredentialsNotFound struct{} // Error returns the standard error message // for when the credentials are not in the store. func (errCredentialsNotFound) Error() string { return errCredentialsNotFoundMessage } // NotFound implements the [ErrNotFound][errdefs.ErrNotFound] interface. // // [errdefs.ErrNotFound]: https://pkg.go.dev/github.com/docker/docker@v24.0.1+incompatible/errdefs#ErrNotFound func (errCredentialsNotFound) NotFound() {} // NewErrCredentialsNotFound creates a new error // for when the credentials are not in the store. func NewErrCredentialsNotFound() error { return errCredentialsNotFound{} } // IsErrCredentialsNotFound returns true if the error // was caused by not having a set of credentials in a store. func IsErrCredentialsNotFound(err error) bool { var target errCredentialsNotFound return errors.As(err, &target) } // IsErrCredentialsNotFoundMessage returns true if the error // was caused by not having a set of credentials in a store. // // This function helps to check messages returned by an // external program via its standard output. func IsErrCredentialsNotFoundMessage(err string) bool { return strings.TrimSpace(err) == errCredentialsNotFoundMessage } // errCredentialsMissingServerURL represents an error raised // when the credentials object has no server URL or when no // server URL is provided to a credentials operation requiring // one. type errCredentialsMissingServerURL struct{} func (errCredentialsMissingServerURL) Error() string { return errCredentialsMissingServerURLMessage } // InvalidParameter implements the [ErrInvalidParameter][errdefs.ErrInvalidParameter] // interface. // // [errdefs.ErrInvalidParameter]: https://pkg.go.dev/github.com/docker/docker@v24.0.1+incompatible/errdefs#ErrInvalidParameter func (errCredentialsMissingServerURL) InvalidParameter() {} // errCredentialsMissingUsername represents an error raised // when the credentials object has no username or when no // username is provided to a credentials operation requiring // one. type errCredentialsMissingUsername struct{} func (errCredentialsMissingUsername) Error() string { return errCredentialsMissingUsernameMessage } // InvalidParameter implements the [ErrInvalidParameter][errdefs.ErrInvalidParameter] // interface. // // [errdefs.ErrInvalidParameter]: https://pkg.go.dev/github.com/docker/docker@v24.0.1+incompatible/errdefs#ErrInvalidParameter func (errCredentialsMissingUsername) InvalidParameter() {} // NewErrCredentialsMissingServerURL creates a new error for // errCredentialsMissingServerURL. func NewErrCredentialsMissingServerURL() error { return errCredentialsMissingServerURL{} } // NewErrCredentialsMissingUsername creates a new error for // errCredentialsMissingUsername. func NewErrCredentialsMissingUsername() error { return errCredentialsMissingUsername{} } // IsCredentialsMissingServerURL returns true if the error // was an errCredentialsMissingServerURL. func IsCredentialsMissingServerURL(err error) bool { var target errCredentialsMissingServerURL return errors.As(err, &target) } // IsCredentialsMissingServerURLMessage checks for an // errCredentialsMissingServerURL in the error message. func IsCredentialsMissingServerURLMessage(err string) bool { return strings.TrimSpace(err) == errCredentialsMissingServerURLMessage } // IsCredentialsMissingUsername returns true if the error // was an errCredentialsMissingUsername. func IsCredentialsMissingUsername(err error) bool { var target errCredentialsMissingUsername return errors.As(err, &target) } // IsCredentialsMissingUsernameMessage checks for an // errCredentialsMissingUsername in the error message. func IsCredentialsMissingUsernameMessage(err string) bool { return strings.TrimSpace(err) == errCredentialsMissingUsernameMessage } ================================================ FILE: vendor/github.com/docker/docker-credential-helpers/credentials/helper.go ================================================ package credentials // Helper is the interface a credentials store helper must implement. type Helper interface { // Add appends credentials to the store. Add(*Credentials) error // Delete removes credentials from the store. Delete(serverURL string) error // Get retrieves credentials from the store. // It returns username and secret as strings. Get(serverURL string) (string, string, error) // List returns the stored serverURLs and their associated usernames. List() (map[string]string, error) } ================================================ FILE: vendor/github.com/docker/docker-credential-helpers/credentials/version.go ================================================ package credentials var ( // Name is filled at linking time Name = "" // Package is filled at linking time Package = "github.com/docker/docker-credential-helpers" // Version holds the complete version number. Filled in at linking time. Version = "v0.0.0+unknown" // Revision is filled with the VCS (e.g. git) revision being used to build // the program at linking time. Revision = "" ) ================================================ FILE: vendor/github.com/docker/go-connections/LICENSE ================================================ Apache License Version 2.0, January 2004 https://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS Copyright 2015 Docker, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: vendor/github.com/docker/go-connections/sockets/inmem_socket.go ================================================ package sockets import ( "errors" "net" "sync" ) var errClosed = errors.New("use of closed network connection") // InmemSocket implements net.Listener using in-memory only connections. type InmemSocket struct { chConn chan net.Conn chClose chan struct{} addr string mu sync.Mutex } // dummyAddr is used to satisfy net.Addr for the in-mem socket // it is just stored as a string and returns the string for all calls type dummyAddr string // NewInmemSocket creates an in-memory only net.Listener // The addr argument can be any string, but is used to satisfy the `Addr()` part // of the net.Listener interface func NewInmemSocket(addr string, bufSize int) *InmemSocket { return &InmemSocket{ chConn: make(chan net.Conn, bufSize), chClose: make(chan struct{}), addr: addr, } } // Addr returns the socket's addr string to satisfy net.Listener func (s *InmemSocket) Addr() net.Addr { return dummyAddr(s.addr) } // Accept implements the Accept method in the Listener interface; it waits for the next call and returns a generic Conn. func (s *InmemSocket) Accept() (net.Conn, error) { select { case conn := <-s.chConn: return conn, nil case <-s.chClose: return nil, errClosed } } // Close closes the listener. It will be unavailable for use once closed. func (s *InmemSocket) Close() error { s.mu.Lock() defer s.mu.Unlock() select { case <-s.chClose: default: close(s.chClose) } return nil } // Dial is used to establish a connection with the in-mem server func (s *InmemSocket) Dial(network, addr string) (net.Conn, error) { srvConn, clientConn := net.Pipe() select { case s.chConn <- srvConn: case <-s.chClose: return nil, errClosed } return clientConn, nil } // Network returns the addr string, satisfies net.Addr func (a dummyAddr) Network() string { return string(a) } // String returns the string form func (a dummyAddr) String() string { return string(a) } ================================================ FILE: vendor/github.com/docker/go-connections/sockets/proxy.go ================================================ package sockets import ( "net" "os" "strings" ) // GetProxyEnv allows access to the uppercase and the lowercase forms of // proxy-related variables. See the Go specification for details on these // variables. https://golang.org/pkg/net/http/ // // Deprecated: this function was used as helper for [DialerFromEnvironment] and is no longer used. It will be removed in the next release. func GetProxyEnv(key string) string { proxyValue := os.Getenv(strings.ToUpper(key)) if proxyValue == "" { return os.Getenv(strings.ToLower(key)) } return proxyValue } // DialerFromEnvironment was previously used to configure a net.Dialer to route // connections through a SOCKS proxy. // // Deprecated: SOCKS proxies are now supported by configuring only // http.Transport.Proxy, and no longer require changing http.Transport.Dial. // Therefore, only [sockets.ConfigureTransport] needs to be called, and any // [sockets.DialerFromEnvironment] calls can be dropped. func DialerFromEnvironment(direct *net.Dialer) (*net.Dialer, error) { return direct, nil } ================================================ FILE: vendor/github.com/docker/go-connections/sockets/sockets.go ================================================ // Package sockets provides helper functions to create and configure Unix or TCP sockets. package sockets import ( "context" "errors" "fmt" "net" "net/http" "syscall" "time" ) const ( defaultTimeout = 10 * time.Second maxUnixSocketPathSize = len(syscall.RawSockaddrUnix{}.Path) ) // ErrProtocolNotAvailable is returned when a given transport protocol is not provided by the operating system. var ErrProtocolNotAvailable = errors.New("protocol not available") // ConfigureTransport configures the specified [http.Transport] according to the specified proto // and addr. // // If the proto is unix (using a unix socket to communicate) or npipe the compression is disabled. // For other protos, compression is enabled. If you want to manually enable/disable compression, // make sure you do it _after_ any subsequent calls to ConfigureTransport is made against the same // [http.Transport]. func ConfigureTransport(tr *http.Transport, proto, addr string) error { switch proto { case "unix": return configureUnixTransport(tr, proto, addr) case "npipe": return configureNpipeTransport(tr, proto, addr) default: tr.Proxy = http.ProxyFromEnvironment tr.DisableCompression = false tr.DialContext = (&net.Dialer{ Timeout: defaultTimeout, }).DialContext } return nil } // DialPipe connects to a Windows named pipe. It is not supported on // non-Windows platforms. // // Deprecated: use [github.com/Microsoft/go-winio.DialPipe] or [github.com/Microsoft/go-winio.DialPipeContext]. func DialPipe(addr string, timeout time.Duration) (net.Conn, error) { return dialPipe(addr, timeout) } func configureUnixTransport(tr *http.Transport, proto, addr string) error { if len(addr) > maxUnixSocketPathSize { return fmt.Errorf("unix socket path %q is too long", addr) } // No need for compression in local communications. tr.DisableCompression = true dialer := &net.Dialer{ Timeout: defaultTimeout, } tr.DialContext = func(ctx context.Context, _, _ string) (net.Conn, error) { return dialer.DialContext(ctx, proto, addr) } return nil } ================================================ FILE: vendor/github.com/docker/go-connections/sockets/sockets_unix.go ================================================ //go:build !windows package sockets import ( "net" "net/http" "syscall" "time" ) func configureNpipeTransport(tr *http.Transport, proto, addr string) error { return ErrProtocolNotAvailable } func dialPipe(_ string, _ time.Duration) (net.Conn, error) { return nil, syscall.EAFNOSUPPORT } ================================================ FILE: vendor/github.com/docker/go-connections/sockets/sockets_windows.go ================================================ package sockets import ( "context" "net" "net/http" "time" "github.com/Microsoft/go-winio" ) func configureNpipeTransport(tr *http.Transport, proto, addr string) error { // No need for compression in local communications. tr.DisableCompression = true tr.DialContext = func(ctx context.Context, _, _ string) (net.Conn, error) { return winio.DialPipeContext(ctx, addr) } return nil } func dialPipe(addr string, timeout time.Duration) (net.Conn, error) { return winio.DialPipe(addr, &timeout) } ================================================ FILE: vendor/github.com/docker/go-connections/sockets/tcp_socket.go ================================================ // Package sockets provides helper functions to create and configure Unix or TCP sockets. package sockets import ( "crypto/tls" "net" ) // NewTCPSocket creates a TCP socket listener with the specified address and // the specified tls configuration. If TLSConfig is set, will encapsulate the // TCP listener inside a TLS one. func NewTCPSocket(addr string, tlsConfig *tls.Config) (net.Listener, error) { l, err := net.Listen("tcp", addr) if err != nil { return nil, err } if tlsConfig != nil { tlsConfig.NextProtos = []string{"http/1.1"} l = tls.NewListener(l, tlsConfig) } return l, nil } ================================================ FILE: vendor/github.com/docker/go-connections/sockets/unix_socket.go ================================================ /* Package sockets is a simple unix domain socket wrapper. # Usage For example: import( "fmt" "net" "os" "github.com/docker/go-connections/sockets" ) func main() { l, err := sockets.NewUnixSocketWithOpts("/path/to/sockets", sockets.WithChown(0,0),sockets.WithChmod(0660)) if err != nil { panic(err) } echoStr := "hello" go func() { for { conn, err := l.Accept() if err != nil { return } conn.Write([]byte(echoStr)) conn.Close() } }() conn, err := net.Dial("unix", path) if err != nil { t.Fatal(err) } buf := make([]byte, 5) if _, err := conn.Read(buf); err != nil { panic(err) } else if string(buf) != echoStr { panic(fmt.Errorf("msg may lost")) } } */ package sockets import ( "net" "os" "syscall" ) // SockOption sets up socket file's creating option type SockOption func(string) error // NewUnixSocketWithOpts creates a unix socket with the specified options. // By default, socket permissions are 0000 (i.e.: no access for anyone); pass // WithChmod() and WithChown() to set the desired ownership and permissions. // // This function temporarily changes the system's "umask" to 0777 to work around // a race condition between creating the socket and setting its permissions. While // this should only be for a short duration, it may affect other processes that // create files/directories during that period. func NewUnixSocketWithOpts(path string, opts ...SockOption) (net.Listener, error) { if err := syscall.Unlink(path); err != nil && !os.IsNotExist(err) { return nil, err } l, err := listenUnix(path) if err != nil { return nil, err } for _, op := range opts { if err := op(path); err != nil { _ = l.Close() return nil, err } } return l, nil } ================================================ FILE: vendor/github.com/docker/go-connections/sockets/unix_socket_unix.go ================================================ //go:build !windows package sockets import ( "net" "os" "syscall" ) // WithChown modifies the socket file's uid and gid func WithChown(uid, gid int) SockOption { return func(path string) error { if err := os.Chown(path, uid, gid); err != nil { return err } return nil } } // WithChmod modifies socket file's access mode. func WithChmod(mask os.FileMode) SockOption { return func(path string) error { if err := os.Chmod(path, mask); err != nil { return err } return nil } } // NewUnixSocket creates a unix socket with the specified path and group. func NewUnixSocket(path string, gid int) (net.Listener, error) { return NewUnixSocketWithOpts(path, WithChown(0, gid), WithChmod(0o660)) } func listenUnix(path string) (net.Listener, error) { // net.Listen does not allow for permissions to be set. As a result, when // specifying custom permissions ("WithChmod()"), there is a short time // between creating the socket and applying the permissions, during which // the socket permissions are Less restrictive than desired. // // To work around this limitation of net.Listen(), we temporarily set the // umask to 0777, which forces the socket to be created with 000 permissions // (i.e.: no access for anyone). After that, WithChmod() must be used to set // the desired permissions. // // We don't use "defer" here, to reset the umask to its original value as soon // as possible. Ideally we'd be able to detect if WithChmod() was passed as // an option, and skip changing umask if default permissions are used. origUmask := syscall.Umask(0o777) l, err := net.Listen("unix", path) syscall.Umask(origUmask) return l, err } ================================================ FILE: vendor/github.com/docker/go-connections/sockets/unix_socket_windows.go ================================================ package sockets import "net" func listenUnix(path string) (net.Listener, error) { return net.Listen("unix", path) } ================================================ FILE: vendor/github.com/docker/go-connections/tlsconfig/certpool.go ================================================ package tlsconfig import ( "crypto/x509" "runtime" ) // SystemCertPool returns a copy of the system cert pool, // returns an error if failed to load or empty pool on windows. func SystemCertPool() (*x509.CertPool, error) { certpool, err := x509.SystemCertPool() if err != nil && runtime.GOOS == "windows" { return x509.NewCertPool(), nil } return certpool, err } ================================================ FILE: vendor/github.com/docker/go-connections/tlsconfig/config.go ================================================ // Package tlsconfig provides primitives to retrieve secure-enough TLS configurations for both clients and servers. // // As a reminder from https://golang.org/pkg/crypto/tls/#Config: // // A 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. // A Config may be reused; the tls package will also not modify it. package tlsconfig import ( "crypto/tls" "crypto/x509" "encoding/pem" "errors" "fmt" "os" ) // Options represents the information needed to create client and server TLS configurations. type Options struct { CAFile string // If either CertFile or KeyFile is empty, Client() will not load them // preventing the client from authenticating to the server. // However, Server() requires them and will error out if they are empty. CertFile string KeyFile string // client-only option InsecureSkipVerify bool // server-only option ClientAuth tls.ClientAuthType // If ExclusiveRootPools is set, then if a CA file is provided, the root pool used for TLS // creds will include exclusively the roots in that CA file. If no CA file is provided, // the system pool will be used. ExclusiveRootPools bool MinVersion uint16 } // DefaultServerAcceptedCiphers should be uses by code which already has a crypto/tls // options struct but wants to use a commonly accepted set of TLS cipher suites, with // known weak algorithms removed. var DefaultServerAcceptedCiphers = defaultCipherSuites // defaultCipherSuites is shared by both client and server as the default set. var defaultCipherSuites = []uint16{ tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, } // ServerDefault returns a secure-enough TLS configuration for the server TLS configuration. func ServerDefault(ops ...func(*tls.Config)) *tls.Config { return defaultConfig(ops...) } // ClientDefault returns a secure-enough TLS configuration for the client TLS configuration. func ClientDefault(ops ...func(*tls.Config)) *tls.Config { return defaultConfig(ops...) } // defaultConfig is the default config used by both client and server TLS configuration. func defaultConfig(ops ...func(*tls.Config)) *tls.Config { tlsConfig := &tls.Config{ // Avoid fallback by default to SSL protocols < TLS1.2 MinVersion: tls.VersionTLS12, CipherSuites: defaultCipherSuites, } for _, op := range ops { op(tlsConfig) } return tlsConfig } // certPool returns an X.509 certificate pool from `caFile`, the certificate file. func certPool(caFile string, exclusivePool bool) (*x509.CertPool, error) { // If we should verify the server, we need to load a trusted ca var ( pool *x509.CertPool err error ) if exclusivePool { pool = x509.NewCertPool() } else { pool, err = SystemCertPool() if err != nil { return nil, fmt.Errorf("failed to read system certificates: %v", err) } } pemData, err := os.ReadFile(caFile) if err != nil { return nil, fmt.Errorf("could not read CA certificate %q: %v", caFile, err) } if !pool.AppendCertsFromPEM(pemData) { return nil, fmt.Errorf("failed to append certificates from PEM file: %q", caFile) } return pool, nil } // allTLSVersions lists all the TLS versions and is used by the code that validates // a uint16 value as a TLS version. var allTLSVersions = map[uint16]struct{}{ tls.VersionTLS10: {}, tls.VersionTLS11: {}, tls.VersionTLS12: {}, tls.VersionTLS13: {}, } // isValidMinVersion checks that the input value is a valid tls minimum version func isValidMinVersion(version uint16) bool { _, ok := allTLSVersions[version] return ok } // adjustMinVersion sets the MinVersion on `config`, the input configuration. // It assumes the current MinVersion on the `config` is the lowest allowed. func adjustMinVersion(options Options, config *tls.Config) error { if options.MinVersion > 0 { if !isValidMinVersion(options.MinVersion) { return fmt.Errorf("invalid minimum TLS version: %x", options.MinVersion) } if options.MinVersion < config.MinVersion { return fmt.Errorf("requested minimum TLS version is too low. Should be at-least: %x", config.MinVersion) } config.MinVersion = options.MinVersion } return nil } // errEncryptedKeyDeprecated is produced when we encounter an encrypted // (password-protected) key. From https://go-review.googlesource.com/c/go/+/264159; // // > Legacy PEM encryption as specified in RFC 1423 is insecure by design. Since // > it does not authenticate the ciphertext, it is vulnerable to padding oracle // > attacks that can let an attacker recover the plaintext // > // > It's unfortunate that we don't implement PKCS#8 encryption so we can't // > recommend an alternative but PEM encryption is so broken that it's worth // > deprecating outright. // // Also see https://docs.docker.com/go/deprecated/ var errEncryptedKeyDeprecated = errors.New("private key is encrypted; encrypted private keys are obsolete, and not supported") // getPrivateKey returns the private key in 'keyBytes', in PEM-encoded format. // It returns an error if the file could not be decoded or was protected by // a passphrase. func getPrivateKey(keyBytes []byte) ([]byte, error) { // this section makes some small changes to code from notary/tuf/utils/x509.go pemBlock, _ := pem.Decode(keyBytes) if pemBlock == nil { return nil, fmt.Errorf("no valid private key found") } if x509.IsEncryptedPEMBlock(pemBlock) { //nolint:staticcheck // Ignore SA1019 (IsEncryptedPEMBlock is deprecated) return nil, errEncryptedKeyDeprecated } return keyBytes, nil } // getCert returns a Certificate from the CertFile and KeyFile in 'options', // if the key is encrypted, the Passphrase in 'options' will be used to // decrypt it. func getCert(options Options) ([]tls.Certificate, error) { if options.CertFile == "" && options.KeyFile == "" { return nil, nil } cert, err := os.ReadFile(options.CertFile) if err != nil { return nil, err } prKeyBytes, err := os.ReadFile(options.KeyFile) if err != nil { return nil, err } prKeyBytes, err = getPrivateKey(prKeyBytes) if err != nil { return nil, err } tlsCert, err := tls.X509KeyPair(cert, prKeyBytes) if err != nil { return nil, err } return []tls.Certificate{tlsCert}, nil } // Client returns a TLS configuration meant to be used by a client. func Client(options Options) (*tls.Config, error) { tlsConfig := defaultConfig() tlsConfig.InsecureSkipVerify = options.InsecureSkipVerify if !options.InsecureSkipVerify && options.CAFile != "" { CAs, err := certPool(options.CAFile, options.ExclusiveRootPools) if err != nil { return nil, err } tlsConfig.RootCAs = CAs } tlsCerts, err := getCert(options) if err != nil { return nil, fmt.Errorf("could not load X509 key pair: %w", err) } tlsConfig.Certificates = tlsCerts if err := adjustMinVersion(options, tlsConfig); err != nil { return nil, err } return tlsConfig, nil } // Server returns a TLS configuration meant to be used by a server. func Server(options Options) (*tls.Config, error) { tlsConfig := defaultConfig() tlsConfig.ClientAuth = options.ClientAuth tlsCert, err := tls.LoadX509KeyPair(options.CertFile, options.KeyFile) if err != nil { if os.IsNotExist(err) { return nil, fmt.Errorf("could not load X509 key pair (cert: %q, key: %q): %v", options.CertFile, options.KeyFile, err) } return nil, fmt.Errorf("error reading X509 key pair - make sure the key is not encrypted (cert: %q, key: %q): %v", options.CertFile, options.KeyFile, err) } tlsConfig.Certificates = []tls.Certificate{tlsCert} if options.ClientAuth >= tls.VerifyClientCertIfGiven && options.CAFile != "" { CAs, err := certPool(options.CAFile, options.ExclusiveRootPools) if err != nil { return nil, err } tlsConfig.ClientCAs = CAs } if err := adjustMinVersion(options, tlsConfig); err != nil { return nil, err } return tlsConfig, nil } ================================================ FILE: vendor/github.com/docker/go-units/CONTRIBUTING.md ================================================ # Contributing to go-units Want to hack on go-units? Awesome! Here are instructions to get you started. go-units is a part of the [Docker](https://www.docker.com) project, and follows the same rules and principles. If you're already familiar with the way Docker does things, you'll feel right at home. Otherwise, go read Docker's [contributions guidelines](https://github.com/docker/docker/blob/master/CONTRIBUTING.md), [issue triaging](https://github.com/docker/docker/blob/master/project/ISSUE-TRIAGE.md), [review process](https://github.com/docker/docker/blob/master/project/REVIEWING.md) and [branches and tags](https://github.com/docker/docker/blob/master/project/BRANCHES-AND-TAGS.md). ### Sign your work The sign-off is a simple line at the end of the explanation for the patch. Your signature certifies that you wrote the patch or otherwise have the right to pass it on as an open-source patch. The rules are pretty simple: if you can certify the below (from [developercertificate.org](http://developercertificate.org/)): ``` Developer Certificate of Origin Version 1.1 Copyright (C) 2004, 2006 The Linux Foundation and its contributors. 660 York Street, Suite 102, San Francisco, CA 94110 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Developer's Certificate of Origin 1.1 By making a contribution to this project, I certify that: (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. ``` Then you just add a line to every git commit message: Signed-off-by: Joe Smith Use your real name (sorry, no pseudonyms or anonymous contributions.) If you set your `user.name` and `user.email` git configs, you can sign your commit automatically with `git commit -s`. ================================================ FILE: vendor/github.com/docker/go-units/LICENSE ================================================ Apache License Version 2.0, January 2004 https://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS Copyright 2015 Docker, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: vendor/github.com/docker/go-units/MAINTAINERS ================================================ # go-units maintainers file # # This file describes who runs the docker/go-units project and how. # This is a living document - if you see something out of date or missing, speak up! # # It is structured to be consumable by both humans and programs. # To extract its contents programmatically, use any TOML-compliant parser. # # This file is compiled into the MAINTAINERS file in docker/opensource. # [Org] [Org."Core maintainers"] people = [ "akihirosuda", "dnephin", "thajeztah", "vdemeester", ] [people] # A reference list of all people associated with the project. # All other sections should refer to people by their canonical key # in the people section. # ADD YOURSELF HERE IN ALPHABETICAL ORDER [people.akihirosuda] Name = "Akihiro Suda" Email = "akihiro.suda.cz@hco.ntt.co.jp" GitHub = "AkihiroSuda" [people.dnephin] Name = "Daniel Nephin" Email = "dnephin@gmail.com" GitHub = "dnephin" [people.thajeztah] Name = "Sebastiaan van Stijn" Email = "github@gone.nl" GitHub = "thaJeztah" [people.vdemeester] Name = "Vincent Demeester" Email = "vincent@sbr.pm" GitHub = "vdemeester" ================================================ FILE: vendor/github.com/docker/go-units/README.md ================================================ [![GoDoc](https://godoc.org/github.com/docker/go-units?status.svg)](https://godoc.org/github.com/docker/go-units) # Introduction go-units is a library to transform human friendly measurements into machine friendly values. ## Usage See the [docs in godoc](https://godoc.org/github.com/docker/go-units) for examples and documentation. ## Copyright and license Copyright © 2015 Docker, Inc. go-units is licensed under the Apache License, Version 2.0. See [LICENSE](LICENSE) for the full text of the license. ================================================ FILE: vendor/github.com/docker/go-units/circle.yml ================================================ dependencies: post: # install golint - go get golang.org/x/lint/golint test: pre: # run analysis before tests - go vet ./... - test -z "$(golint ./... | tee /dev/stderr)" - test -z "$(gofmt -s -l . | tee /dev/stderr)" ================================================ FILE: vendor/github.com/docker/go-units/duration.go ================================================ // Package units provides helper function to parse and print size and time units // in human-readable format. package units import ( "fmt" "time" ) // HumanDuration returns a human-readable approximation of a duration // (eg. "About a minute", "4 hours ago", etc.). func HumanDuration(d time.Duration) string { if seconds := int(d.Seconds()); seconds < 1 { return "Less than a second" } else if seconds == 1 { return "1 second" } else if seconds < 60 { return fmt.Sprintf("%d seconds", seconds) } else if minutes := int(d.Minutes()); minutes == 1 { return "About a minute" } else if minutes < 60 { return fmt.Sprintf("%d minutes", minutes) } else if hours := int(d.Hours() + 0.5); hours == 1 { return "About an hour" } else if hours < 48 { return fmt.Sprintf("%d hours", hours) } else if hours < 24*7*2 { return fmt.Sprintf("%d days", hours/24) } else if hours < 24*30*2 { return fmt.Sprintf("%d weeks", hours/24/7) } else if hours < 24*365*2 { return fmt.Sprintf("%d months", hours/24/30) } return fmt.Sprintf("%d years", int(d.Hours())/24/365) } ================================================ FILE: vendor/github.com/docker/go-units/size.go ================================================ package units import ( "fmt" "strconv" "strings" ) // See: http://en.wikipedia.org/wiki/Binary_prefix const ( // Decimal KB = 1000 MB = 1000 * KB GB = 1000 * MB TB = 1000 * GB PB = 1000 * TB // Binary KiB = 1024 MiB = 1024 * KiB GiB = 1024 * MiB TiB = 1024 * GiB PiB = 1024 * TiB ) type unitMap map[byte]int64 var ( decimalMap = unitMap{'k': KB, 'm': MB, 'g': GB, 't': TB, 'p': PB} binaryMap = unitMap{'k': KiB, 'm': MiB, 'g': GiB, 't': TiB, 'p': PiB} ) var ( decimapAbbrs = []string{"B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"} binaryAbbrs = []string{"B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB"} ) func getSizeAndUnit(size float64, base float64, _map []string) (float64, string) { i := 0 unitsLimit := len(_map) - 1 for size >= base && i < unitsLimit { size = size / base i++ } return size, _map[i] } // CustomSize returns a human-readable approximation of a size // using custom format. func CustomSize(format string, size float64, base float64, _map []string) string { size, unit := getSizeAndUnit(size, base, _map) return fmt.Sprintf(format, size, unit) } // HumanSizeWithPrecision allows the size to be in any precision, // instead of 4 digit precision used in units.HumanSize. func HumanSizeWithPrecision(size float64, precision int) string { size, unit := getSizeAndUnit(size, 1000.0, decimapAbbrs) return fmt.Sprintf("%.*g%s", precision, size, unit) } // HumanSize returns a human-readable approximation of a size // capped at 4 valid numbers (eg. "2.746 MB", "796 KB"). func HumanSize(size float64) string { return HumanSizeWithPrecision(size, 4) } // BytesSize returns a human-readable size in bytes, kibibytes, // mebibytes, gibibytes, or tebibytes (eg. "44kiB", "17MiB"). func BytesSize(size float64) string { return CustomSize("%.4g%s", size, 1024.0, binaryAbbrs) } // FromHumanSize returns an integer from a human-readable specification of a // size using SI standard (eg. "44kB", "17MB"). func FromHumanSize(size string) (int64, error) { return parseSize(size, decimalMap) } // RAMInBytes parses a human-readable string representing an amount of RAM // in bytes, kibibytes, mebibytes, gibibytes, or tebibytes and // returns the number of bytes, or -1 if the string is unparseable. // Units are case-insensitive, and the 'b' suffix is optional. func RAMInBytes(size string) (int64, error) { return parseSize(size, binaryMap) } // Parses the human-readable size string into the amount it represents. func parseSize(sizeStr string, uMap unitMap) (int64, error) { // TODO: rewrite to use strings.Cut if there's a space // once Go < 1.18 is deprecated. sep := strings.LastIndexAny(sizeStr, "01234567890. ") if sep == -1 { // There should be at least a digit. return -1, fmt.Errorf("invalid size: '%s'", sizeStr) } var num, sfx string if sizeStr[sep] != ' ' { num = sizeStr[:sep+1] sfx = sizeStr[sep+1:] } else { // Omit the space separator. num = sizeStr[:sep] sfx = sizeStr[sep+1:] } size, err := strconv.ParseFloat(num, 64) if err != nil { return -1, err } // Backward compatibility: reject negative sizes. if size < 0 { return -1, fmt.Errorf("invalid size: '%s'", sizeStr) } if len(sfx) == 0 { return int64(size), nil } // Process the suffix. if len(sfx) > 3 { // Too long. goto badSuffix } sfx = strings.ToLower(sfx) // Trivial case: b suffix. if sfx[0] == 'b' { if len(sfx) > 1 { // no extra characters allowed after b. goto badSuffix } return int64(size), nil } // A suffix from the map. if mul, ok := uMap[sfx[0]]; ok { size *= float64(mul) } else { goto badSuffix } // The suffix may have extra "b" or "ib" (e.g. KiB or MB). switch { case len(sfx) == 2 && sfx[1] != 'b': goto badSuffix case len(sfx) == 3 && sfx[1:] != "ib": goto badSuffix } return int64(size), nil badSuffix: return -1, fmt.Errorf("invalid suffix: '%s'", sfx) } ================================================ FILE: vendor/github.com/docker/go-units/ulimit.go ================================================ package units import ( "fmt" "strconv" "strings" ) // Ulimit is a human friendly version of Rlimit. type Ulimit struct { Name string Hard int64 Soft int64 } // Rlimit specifies the resource limits, such as max open files. type Rlimit struct { Type int `json:"type,omitempty"` Hard uint64 `json:"hard,omitempty"` Soft uint64 `json:"soft,omitempty"` } const ( // magic numbers for making the syscall // some of these are defined in the syscall package, but not all. // Also since Windows client doesn't get access to the syscall package, need to // define these here rlimitAs = 9 rlimitCore = 4 rlimitCPU = 0 rlimitData = 2 rlimitFsize = 1 rlimitLocks = 10 rlimitMemlock = 8 rlimitMsgqueue = 12 rlimitNice = 13 rlimitNofile = 7 rlimitNproc = 6 rlimitRss = 5 rlimitRtprio = 14 rlimitRttime = 15 rlimitSigpending = 11 rlimitStack = 3 ) var ulimitNameMapping = map[string]int{ //"as": rlimitAs, // Disabled since this doesn't seem usable with the way Docker inits a container. "core": rlimitCore, "cpu": rlimitCPU, "data": rlimitData, "fsize": rlimitFsize, "locks": rlimitLocks, "memlock": rlimitMemlock, "msgqueue": rlimitMsgqueue, "nice": rlimitNice, "nofile": rlimitNofile, "nproc": rlimitNproc, "rss": rlimitRss, "rtprio": rlimitRtprio, "rttime": rlimitRttime, "sigpending": rlimitSigpending, "stack": rlimitStack, } // ParseUlimit parses and returns a Ulimit from the specified string. func ParseUlimit(val string) (*Ulimit, error) { parts := strings.SplitN(val, "=", 2) if len(parts) != 2 { return nil, fmt.Errorf("invalid ulimit argument: %s", val) } if _, exists := ulimitNameMapping[parts[0]]; !exists { return nil, fmt.Errorf("invalid ulimit type: %s", parts[0]) } var ( soft int64 hard = &soft // default to soft in case no hard was set temp int64 err error ) switch limitVals := strings.Split(parts[1], ":"); len(limitVals) { case 2: temp, err = strconv.ParseInt(limitVals[1], 10, 64) if err != nil { return nil, err } hard = &temp fallthrough case 1: soft, err = strconv.ParseInt(limitVals[0], 10, 64) if err != nil { return nil, err } default: return nil, fmt.Errorf("too many limit value arguments - %s, can only have up to two, `soft[:hard]`", parts[1]) } if *hard != -1 { if soft == -1 { return nil, fmt.Errorf("ulimit soft limit must be less than or equal to hard limit: soft: -1 (unlimited), hard: %d", *hard) } if soft > *hard { return nil, fmt.Errorf("ulimit soft limit must be less than or equal to hard limit: %d > %d", soft, *hard) } } return &Ulimit{Name: parts[0], Soft: soft, Hard: *hard}, nil } // GetRlimit returns the RLimit corresponding to Ulimit. func (u *Ulimit) GetRlimit() (*Rlimit, error) { t, exists := ulimitNameMapping[u.Name] if !exists { return nil, fmt.Errorf("invalid ulimit name %s", u.Name) } return &Rlimit{Type: t, Soft: uint64(u.Soft), Hard: uint64(u.Hard)}, nil } func (u *Ulimit) String() string { return fmt.Sprintf("%s=%d:%d", u.Name, u.Soft, u.Hard) } ================================================ FILE: vendor/github.com/felixge/httpsnoop/.gitignore ================================================ ================================================ FILE: vendor/github.com/felixge/httpsnoop/LICENSE.txt ================================================ Copyright (c) 2016 Felix Geisendörfer (felix@debuggable.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: vendor/github.com/felixge/httpsnoop/Makefile ================================================ .PHONY: ci generate clean ci: clean generate go test -race -v ./... generate: go generate . clean: rm -rf *_generated*.go ================================================ FILE: vendor/github.com/felixge/httpsnoop/README.md ================================================ # httpsnoop Package httpsnoop provides an easy way to capture http related metrics (i.e. response time, bytes written, and http status code) from your application's http.Handlers. Doing this requires non-trivial wrapping of the http.ResponseWriter interface, which is also exposed for users interested in a more low-level API. [![Go Reference](https://pkg.go.dev/badge/github.com/felixge/httpsnoop.svg)](https://pkg.go.dev/github.com/felixge/httpsnoop) [![Build Status](https://github.com/felixge/httpsnoop/actions/workflows/main.yaml/badge.svg)](https://github.com/felixge/httpsnoop/actions/workflows/main.yaml) ## Usage Example ```go // myH is your app's http handler, perhaps a http.ServeMux or similar. var myH http.Handler // wrappedH wraps myH in order to log every request. wrappedH := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { m := httpsnoop.CaptureMetrics(myH, w, r) log.Printf( "%s %s (code=%d dt=%s written=%d)", r.Method, r.URL, m.Code, m.Duration, m.Written, ) }) http.ListenAndServe(":8080", wrappedH) ``` ## Why this package exists Instrumenting an application's http.Handler is surprisingly difficult. However if you google for e.g. "capture ResponseWriter status code" you'll find lots of advise and code examples that suggest it to be a fairly trivial undertaking. Unfortunately everything I've seen so far has a high chance of breaking your application. The main problem is that a `http.ResponseWriter` often implements additional interfaces such as `http.Flusher`, `http.CloseNotifier`, `http.Hijacker`, `http.Pusher`, and `io.ReaderFrom`. So the naive approach of just wrapping `http.ResponseWriter` in your own struct that also implements the `http.ResponseWriter` interface will hide the additional interfaces mentioned above. This has a high change of introducing subtle bugs into any non-trivial application. Another approach I've seen people take is to return a struct that implements all of the interfaces above. However, that's also problematic, because it's difficult to fake some of these interfaces behaviors when the underlying `http.ResponseWriter` doesn't have an implementation. It's also dangerous, because an application may choose to operate differently, merely because it detects the presence of these additional interfaces. This package solves this problem by checking which additional interfaces a `http.ResponseWriter` implements, returning a wrapped version implementing the exact same set of interfaces. Additionally this package properly handles edge cases such as `WriteHeader` not being called, or called more than once, as well as concurrent calls to `http.ResponseWriter` methods, and even calls happening after the wrapped `ServeHTTP` has already returned. Unfortunately this package is not perfect either. It's possible that it is still missing some interfaces provided by the go core (let me know if you find one), and it won't work for applications adding their own interfaces into the mix. You can however use `httpsnoop.Unwrap(w)` to access the underlying `http.ResponseWriter` and type-assert the result to its other interfaces. However, hopefully the explanation above has sufficiently scared you of rolling your own solution to this problem. httpsnoop may still break your application, but at least it tries to avoid it as much as possible. Anyway, the real problem here is that smuggling additional interfaces inside `http.ResponseWriter` is a problematic design choice, but it probably goes as deep as the Go language specification itself. But that's okay, I still prefer Go over the alternatives ;). ## Performance ``` BenchmarkBaseline-8 20000 94912 ns/op BenchmarkCaptureMetrics-8 20000 95461 ns/op ``` As you can see, using `CaptureMetrics` on a vanilla http.Handler introduces an overhead of ~500 ns per http request on my machine. However, the margin of error appears to be larger than that, therefor it should be reasonable to assume that the overhead introduced by `CaptureMetrics` is absolutely negligible. ## License MIT ================================================ FILE: vendor/github.com/felixge/httpsnoop/capture_metrics.go ================================================ package httpsnoop import ( "io" "net/http" "time" ) // Metrics holds metrics captured from CaptureMetrics. type Metrics struct { // Code is the first http response code passed to the WriteHeader func of // the ResponseWriter. If no such call is made, a default code of 200 is // assumed instead. Code int // Duration is the time it took to execute the handler. Duration time.Duration // Written is the number of bytes successfully written by the Write or // ReadFrom function of the ResponseWriter. ResponseWriters may also write // data to their underlaying connection directly (e.g. headers), but those // are not tracked. Therefor the number of Written bytes will usually match // the size of the response body. Written int64 } // CaptureMetrics wraps the given hnd, executes it with the given w and r, and // returns the metrics it captured from it. func CaptureMetrics(hnd http.Handler, w http.ResponseWriter, r *http.Request) Metrics { return CaptureMetricsFn(w, func(ww http.ResponseWriter) { hnd.ServeHTTP(ww, r) }) } // CaptureMetricsFn wraps w and calls fn with the wrapped w and returns the // resulting metrics. This is very similar to CaptureMetrics (which is just // sugar on top of this func), but is a more usable interface if your // application doesn't use the Go http.Handler interface. func CaptureMetricsFn(w http.ResponseWriter, fn func(http.ResponseWriter)) Metrics { m := Metrics{Code: http.StatusOK} m.CaptureMetrics(w, fn) return m } // CaptureMetrics wraps w and calls fn with the wrapped w and updates // Metrics m with the resulting metrics. This is similar to CaptureMetricsFn, // but allows one to customize starting Metrics object. func (m *Metrics) CaptureMetrics(w http.ResponseWriter, fn func(http.ResponseWriter)) { var ( start = time.Now() headerWritten bool hooks = Hooks{ WriteHeader: func(next WriteHeaderFunc) WriteHeaderFunc { return func(code int) { next(code) if !(code >= 100 && code <= 199) && !headerWritten { m.Code = code headerWritten = true } } }, Write: func(next WriteFunc) WriteFunc { return func(p []byte) (int, error) { n, err := next(p) m.Written += int64(n) headerWritten = true return n, err } }, ReadFrom: func(next ReadFromFunc) ReadFromFunc { return func(src io.Reader) (int64, error) { n, err := next(src) headerWritten = true m.Written += n return n, err } }, } ) fn(Wrap(w, hooks)) m.Duration += time.Since(start) } ================================================ FILE: vendor/github.com/felixge/httpsnoop/docs.go ================================================ // Package httpsnoop provides an easy way to capture http related metrics (i.e. // response time, bytes written, and http status code) from your application's // http.Handlers. // // Doing this requires non-trivial wrapping of the http.ResponseWriter // interface, which is also exposed for users interested in a more low-level // API. package httpsnoop //go:generate go run codegen/main.go ================================================ FILE: vendor/github.com/felixge/httpsnoop/wrap_generated_gteq_1.8.go ================================================ // +build go1.8 // Code generated by "httpsnoop/codegen"; DO NOT EDIT. package httpsnoop import ( "bufio" "io" "net" "net/http" ) // HeaderFunc is part of the http.ResponseWriter interface. type HeaderFunc func() http.Header // WriteHeaderFunc is part of the http.ResponseWriter interface. type WriteHeaderFunc func(code int) // WriteFunc is part of the http.ResponseWriter interface. type WriteFunc func(b []byte) (int, error) // FlushFunc is part of the http.Flusher interface. type FlushFunc func() // CloseNotifyFunc is part of the http.CloseNotifier interface. type CloseNotifyFunc func() <-chan bool // HijackFunc is part of the http.Hijacker interface. type HijackFunc func() (net.Conn, *bufio.ReadWriter, error) // ReadFromFunc is part of the io.ReaderFrom interface. type ReadFromFunc func(src io.Reader) (int64, error) // PushFunc is part of the http.Pusher interface. type PushFunc func(target string, opts *http.PushOptions) error // Hooks defines a set of method interceptors for methods included in // http.ResponseWriter as well as some others. You can think of them as // middleware for the function calls they target. See Wrap for more details. type Hooks struct { Header func(HeaderFunc) HeaderFunc WriteHeader func(WriteHeaderFunc) WriteHeaderFunc Write func(WriteFunc) WriteFunc Flush func(FlushFunc) FlushFunc CloseNotify func(CloseNotifyFunc) CloseNotifyFunc Hijack func(HijackFunc) HijackFunc ReadFrom func(ReadFromFunc) ReadFromFunc Push func(PushFunc) PushFunc } // Wrap returns a wrapped version of w that provides the exact same interface // as w. Specifically if w implements any combination of: // // - http.Flusher // - http.CloseNotifier // - http.Hijacker // - io.ReaderFrom // - http.Pusher // // The wrapped version will implement the exact same combination. If no hooks // are set, the wrapped version also behaves exactly as w. Hooks targeting // methods not supported by w are ignored. Any other hooks will intercept the // method they target and may modify the call's arguments and/or return values. // The CaptureMetrics implementation serves as a working example for how the // hooks can be used. func Wrap(w http.ResponseWriter, hooks Hooks) http.ResponseWriter { rw := &rw{w: w, h: hooks} _, i0 := w.(http.Flusher) _, i1 := w.(http.CloseNotifier) _, i2 := w.(http.Hijacker) _, i3 := w.(io.ReaderFrom) _, i4 := w.(http.Pusher) switch { // combination 1/32 case !i0 && !i1 && !i2 && !i3 && !i4: return struct { Unwrapper http.ResponseWriter }{rw, rw} // combination 2/32 case !i0 && !i1 && !i2 && !i3 && i4: return struct { Unwrapper http.ResponseWriter http.Pusher }{rw, rw, rw} // combination 3/32 case !i0 && !i1 && !i2 && i3 && !i4: return struct { Unwrapper http.ResponseWriter io.ReaderFrom }{rw, rw, rw} // combination 4/32 case !i0 && !i1 && !i2 && i3 && i4: return struct { Unwrapper http.ResponseWriter io.ReaderFrom http.Pusher }{rw, rw, rw, rw} // combination 5/32 case !i0 && !i1 && i2 && !i3 && !i4: return struct { Unwrapper http.ResponseWriter http.Hijacker }{rw, rw, rw} // combination 6/32 case !i0 && !i1 && i2 && !i3 && i4: return struct { Unwrapper http.ResponseWriter http.Hijacker http.Pusher }{rw, rw, rw, rw} // combination 7/32 case !i0 && !i1 && i2 && i3 && !i4: return struct { Unwrapper http.ResponseWriter http.Hijacker io.ReaderFrom }{rw, rw, rw, rw} // combination 8/32 case !i0 && !i1 && i2 && i3 && i4: return struct { Unwrapper http.ResponseWriter http.Hijacker io.ReaderFrom http.Pusher }{rw, rw, rw, rw, rw} // combination 9/32 case !i0 && i1 && !i2 && !i3 && !i4: return struct { Unwrapper http.ResponseWriter http.CloseNotifier }{rw, rw, rw} // combination 10/32 case !i0 && i1 && !i2 && !i3 && i4: return struct { Unwrapper http.ResponseWriter http.CloseNotifier http.Pusher }{rw, rw, rw, rw} // combination 11/32 case !i0 && i1 && !i2 && i3 && !i4: return struct { Unwrapper http.ResponseWriter http.CloseNotifier io.ReaderFrom }{rw, rw, rw, rw} // combination 12/32 case !i0 && i1 && !i2 && i3 && i4: return struct { Unwrapper http.ResponseWriter http.CloseNotifier io.ReaderFrom http.Pusher }{rw, rw, rw, rw, rw} // combination 13/32 case !i0 && i1 && i2 && !i3 && !i4: return struct { Unwrapper http.ResponseWriter http.CloseNotifier http.Hijacker }{rw, rw, rw, rw} // combination 14/32 case !i0 && i1 && i2 && !i3 && i4: return struct { Unwrapper http.ResponseWriter http.CloseNotifier http.Hijacker http.Pusher }{rw, rw, rw, rw, rw} // combination 15/32 case !i0 && i1 && i2 && i3 && !i4: return struct { Unwrapper http.ResponseWriter http.CloseNotifier http.Hijacker io.ReaderFrom }{rw, rw, rw, rw, rw} // combination 16/32 case !i0 && i1 && i2 && i3 && i4: return struct { Unwrapper http.ResponseWriter http.CloseNotifier http.Hijacker io.ReaderFrom http.Pusher }{rw, rw, rw, rw, rw, rw} // combination 17/32 case i0 && !i1 && !i2 && !i3 && !i4: return struct { Unwrapper http.ResponseWriter http.Flusher }{rw, rw, rw} // combination 18/32 case i0 && !i1 && !i2 && !i3 && i4: return struct { Unwrapper http.ResponseWriter http.Flusher http.Pusher }{rw, rw, rw, rw} // combination 19/32 case i0 && !i1 && !i2 && i3 && !i4: return struct { Unwrapper http.ResponseWriter http.Flusher io.ReaderFrom }{rw, rw, rw, rw} // combination 20/32 case i0 && !i1 && !i2 && i3 && i4: return struct { Unwrapper http.ResponseWriter http.Flusher io.ReaderFrom http.Pusher }{rw, rw, rw, rw, rw} // combination 21/32 case i0 && !i1 && i2 && !i3 && !i4: return struct { Unwrapper http.ResponseWriter http.Flusher http.Hijacker }{rw, rw, rw, rw} // combination 22/32 case i0 && !i1 && i2 && !i3 && i4: return struct { Unwrapper http.ResponseWriter http.Flusher http.Hijacker http.Pusher }{rw, rw, rw, rw, rw} // combination 23/32 case i0 && !i1 && i2 && i3 && !i4: return struct { Unwrapper http.ResponseWriter http.Flusher http.Hijacker io.ReaderFrom }{rw, rw, rw, rw, rw} // combination 24/32 case i0 && !i1 && i2 && i3 && i4: return struct { Unwrapper http.ResponseWriter http.Flusher http.Hijacker io.ReaderFrom http.Pusher }{rw, rw, rw, rw, rw, rw} // combination 25/32 case i0 && i1 && !i2 && !i3 && !i4: return struct { Unwrapper http.ResponseWriter http.Flusher http.CloseNotifier }{rw, rw, rw, rw} // combination 26/32 case i0 && i1 && !i2 && !i3 && i4: return struct { Unwrapper http.ResponseWriter http.Flusher http.CloseNotifier http.Pusher }{rw, rw, rw, rw, rw} // combination 27/32 case i0 && i1 && !i2 && i3 && !i4: return struct { Unwrapper http.ResponseWriter http.Flusher http.CloseNotifier io.ReaderFrom }{rw, rw, rw, rw, rw} // combination 28/32 case i0 && i1 && !i2 && i3 && i4: return struct { Unwrapper http.ResponseWriter http.Flusher http.CloseNotifier io.ReaderFrom http.Pusher }{rw, rw, rw, rw, rw, rw} // combination 29/32 case i0 && i1 && i2 && !i3 && !i4: return struct { Unwrapper http.ResponseWriter http.Flusher http.CloseNotifier http.Hijacker }{rw, rw, rw, rw, rw} // combination 30/32 case i0 && i1 && i2 && !i3 && i4: return struct { Unwrapper http.ResponseWriter http.Flusher http.CloseNotifier http.Hijacker http.Pusher }{rw, rw, rw, rw, rw, rw} // combination 31/32 case i0 && i1 && i2 && i3 && !i4: return struct { Unwrapper http.ResponseWriter http.Flusher http.CloseNotifier http.Hijacker io.ReaderFrom }{rw, rw, rw, rw, rw, rw} // combination 32/32 case i0 && i1 && i2 && i3 && i4: return struct { Unwrapper http.ResponseWriter http.Flusher http.CloseNotifier http.Hijacker io.ReaderFrom http.Pusher }{rw, rw, rw, rw, rw, rw, rw} } panic("unreachable") } type rw struct { w http.ResponseWriter h Hooks } func (w *rw) Unwrap() http.ResponseWriter { return w.w } func (w *rw) Header() http.Header { f := w.w.(http.ResponseWriter).Header if w.h.Header != nil { f = w.h.Header(f) } return f() } func (w *rw) WriteHeader(code int) { f := w.w.(http.ResponseWriter).WriteHeader if w.h.WriteHeader != nil { f = w.h.WriteHeader(f) } f(code) } func (w *rw) Write(b []byte) (int, error) { f := w.w.(http.ResponseWriter).Write if w.h.Write != nil { f = w.h.Write(f) } return f(b) } func (w *rw) Flush() { f := w.w.(http.Flusher).Flush if w.h.Flush != nil { f = w.h.Flush(f) } f() } func (w *rw) CloseNotify() <-chan bool { f := w.w.(http.CloseNotifier).CloseNotify if w.h.CloseNotify != nil { f = w.h.CloseNotify(f) } return f() } func (w *rw) Hijack() (net.Conn, *bufio.ReadWriter, error) { f := w.w.(http.Hijacker).Hijack if w.h.Hijack != nil { f = w.h.Hijack(f) } return f() } func (w *rw) ReadFrom(src io.Reader) (int64, error) { f := w.w.(io.ReaderFrom).ReadFrom if w.h.ReadFrom != nil { f = w.h.ReadFrom(f) } return f(src) } func (w *rw) Push(target string, opts *http.PushOptions) error { f := w.w.(http.Pusher).Push if w.h.Push != nil { f = w.h.Push(f) } return f(target, opts) } type Unwrapper interface { Unwrap() http.ResponseWriter } // Unwrap returns the underlying http.ResponseWriter from within zero or more // layers of httpsnoop wrappers. func Unwrap(w http.ResponseWriter) http.ResponseWriter { if rw, ok := w.(Unwrapper); ok { // recurse until rw.Unwrap() returns a non-Unwrapper return Unwrap(rw.Unwrap()) } else { return w } } ================================================ FILE: vendor/github.com/felixge/httpsnoop/wrap_generated_lt_1.8.go ================================================ // +build !go1.8 // Code generated by "httpsnoop/codegen"; DO NOT EDIT. package httpsnoop import ( "bufio" "io" "net" "net/http" ) // HeaderFunc is part of the http.ResponseWriter interface. type HeaderFunc func() http.Header // WriteHeaderFunc is part of the http.ResponseWriter interface. type WriteHeaderFunc func(code int) // WriteFunc is part of the http.ResponseWriter interface. type WriteFunc func(b []byte) (int, error) // FlushFunc is part of the http.Flusher interface. type FlushFunc func() // CloseNotifyFunc is part of the http.CloseNotifier interface. type CloseNotifyFunc func() <-chan bool // HijackFunc is part of the http.Hijacker interface. type HijackFunc func() (net.Conn, *bufio.ReadWriter, error) // ReadFromFunc is part of the io.ReaderFrom interface. type ReadFromFunc func(src io.Reader) (int64, error) // Hooks defines a set of method interceptors for methods included in // http.ResponseWriter as well as some others. You can think of them as // middleware for the function calls they target. See Wrap for more details. type Hooks struct { Header func(HeaderFunc) HeaderFunc WriteHeader func(WriteHeaderFunc) WriteHeaderFunc Write func(WriteFunc) WriteFunc Flush func(FlushFunc) FlushFunc CloseNotify func(CloseNotifyFunc) CloseNotifyFunc Hijack func(HijackFunc) HijackFunc ReadFrom func(ReadFromFunc) ReadFromFunc } // Wrap returns a wrapped version of w that provides the exact same interface // as w. Specifically if w implements any combination of: // // - http.Flusher // - http.CloseNotifier // - http.Hijacker // - io.ReaderFrom // // The wrapped version will implement the exact same combination. If no hooks // are set, the wrapped version also behaves exactly as w. Hooks targeting // methods not supported by w are ignored. Any other hooks will intercept the // method they target and may modify the call's arguments and/or return values. // The CaptureMetrics implementation serves as a working example for how the // hooks can be used. func Wrap(w http.ResponseWriter, hooks Hooks) http.ResponseWriter { rw := &rw{w: w, h: hooks} _, i0 := w.(http.Flusher) _, i1 := w.(http.CloseNotifier) _, i2 := w.(http.Hijacker) _, i3 := w.(io.ReaderFrom) switch { // combination 1/16 case !i0 && !i1 && !i2 && !i3: return struct { Unwrapper http.ResponseWriter }{rw, rw} // combination 2/16 case !i0 && !i1 && !i2 && i3: return struct { Unwrapper http.ResponseWriter io.ReaderFrom }{rw, rw, rw} // combination 3/16 case !i0 && !i1 && i2 && !i3: return struct { Unwrapper http.ResponseWriter http.Hijacker }{rw, rw, rw} // combination 4/16 case !i0 && !i1 && i2 && i3: return struct { Unwrapper http.ResponseWriter http.Hijacker io.ReaderFrom }{rw, rw, rw, rw} // combination 5/16 case !i0 && i1 && !i2 && !i3: return struct { Unwrapper http.ResponseWriter http.CloseNotifier }{rw, rw, rw} // combination 6/16 case !i0 && i1 && !i2 && i3: return struct { Unwrapper http.ResponseWriter http.CloseNotifier io.ReaderFrom }{rw, rw, rw, rw} // combination 7/16 case !i0 && i1 && i2 && !i3: return struct { Unwrapper http.ResponseWriter http.CloseNotifier http.Hijacker }{rw, rw, rw, rw} // combination 8/16 case !i0 && i1 && i2 && i3: return struct { Unwrapper http.ResponseWriter http.CloseNotifier http.Hijacker io.ReaderFrom }{rw, rw, rw, rw, rw} // combination 9/16 case i0 && !i1 && !i2 && !i3: return struct { Unwrapper http.ResponseWriter http.Flusher }{rw, rw, rw} // combination 10/16 case i0 && !i1 && !i2 && i3: return struct { Unwrapper http.ResponseWriter http.Flusher io.ReaderFrom }{rw, rw, rw, rw} // combination 11/16 case i0 && !i1 && i2 && !i3: return struct { Unwrapper http.ResponseWriter http.Flusher http.Hijacker }{rw, rw, rw, rw} // combination 12/16 case i0 && !i1 && i2 && i3: return struct { Unwrapper http.ResponseWriter http.Flusher http.Hijacker io.ReaderFrom }{rw, rw, rw, rw, rw} // combination 13/16 case i0 && i1 && !i2 && !i3: return struct { Unwrapper http.ResponseWriter http.Flusher http.CloseNotifier }{rw, rw, rw, rw} // combination 14/16 case i0 && i1 && !i2 && i3: return struct { Unwrapper http.ResponseWriter http.Flusher http.CloseNotifier io.ReaderFrom }{rw, rw, rw, rw, rw} // combination 15/16 case i0 && i1 && i2 && !i3: return struct { Unwrapper http.ResponseWriter http.Flusher http.CloseNotifier http.Hijacker }{rw, rw, rw, rw, rw} // combination 16/16 case i0 && i1 && i2 && i3: return struct { Unwrapper http.ResponseWriter http.Flusher http.CloseNotifier http.Hijacker io.ReaderFrom }{rw, rw, rw, rw, rw, rw} } panic("unreachable") } type rw struct { w http.ResponseWriter h Hooks } func (w *rw) Unwrap() http.ResponseWriter { return w.w } func (w *rw) Header() http.Header { f := w.w.(http.ResponseWriter).Header if w.h.Header != nil { f = w.h.Header(f) } return f() } func (w *rw) WriteHeader(code int) { f := w.w.(http.ResponseWriter).WriteHeader if w.h.WriteHeader != nil { f = w.h.WriteHeader(f) } f(code) } func (w *rw) Write(b []byte) (int, error) { f := w.w.(http.ResponseWriter).Write if w.h.Write != nil { f = w.h.Write(f) } return f(b) } func (w *rw) Flush() { f := w.w.(http.Flusher).Flush if w.h.Flush != nil { f = w.h.Flush(f) } f() } func (w *rw) CloseNotify() <-chan bool { f := w.w.(http.CloseNotifier).CloseNotify if w.h.CloseNotify != nil { f = w.h.CloseNotify(f) } return f() } func (w *rw) Hijack() (net.Conn, *bufio.ReadWriter, error) { f := w.w.(http.Hijacker).Hijack if w.h.Hijack != nil { f = w.h.Hijack(f) } return f() } func (w *rw) ReadFrom(src io.Reader) (int64, error) { f := w.w.(io.ReaderFrom).ReadFrom if w.h.ReadFrom != nil { f = w.h.ReadFrom(f) } return f(src) } type Unwrapper interface { Unwrap() http.ResponseWriter } // Unwrap returns the underlying http.ResponseWriter from within zero or more // layers of httpsnoop wrappers. func Unwrap(w http.ResponseWriter) http.ResponseWriter { if rw, ok := w.(Unwrapper); ok { // recurse until rw.Unwrap() returns a non-Unwrapper return Unwrap(rw.Unwrap()) } else { return w } } ================================================ FILE: vendor/github.com/go-jose/go-jose/v4/.gitignore ================================================ jose-util/jose-util jose-util.t.err ================================================ FILE: vendor/github.com/go-jose/go-jose/v4/.golangci.yml ================================================ # https://github.com/golangci/golangci-lint run: skip-files: - doc_test.go modules-download-mode: readonly linters: enable-all: true disable: - gochecknoglobals - goconst - lll - maligned - nakedret - scopelint - unparam - funlen # added in 1.18 (requires go-jose changes before it can be enabled) linters-settings: gocyclo: min-complexity: 35 issues: exclude-rules: - text: "don't use ALL_CAPS in Go names" linters: - golint - text: "hardcoded credentials" linters: - gosec - text: "weak cryptographic primitive" linters: - gosec - path: json/ linters: - dupl - errcheck - gocritic - gocyclo - golint - govet - ineffassign - staticcheck - structcheck - stylecheck - unused - path: _test\.go linters: - scopelint - path: jwk.go linters: - gocyclo ================================================ FILE: vendor/github.com/go-jose/go-jose/v4/.travis.yml ================================================ language: go matrix: fast_finish: true allow_failures: - go: tip go: - "1.13.x" - "1.14.x" - tip before_script: - export PATH=$HOME/.local/bin:$PATH before_install: - go get -u github.com/mattn/goveralls github.com/wadey/gocovmerge - curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.18.0 - pip install cram --user script: - go test -v -covermode=count -coverprofile=profile.cov . - go test -v -covermode=count -coverprofile=cryptosigner/profile.cov ./cryptosigner - go test -v -covermode=count -coverprofile=cipher/profile.cov ./cipher - go test -v -covermode=count -coverprofile=jwt/profile.cov ./jwt - go test -v ./json # no coverage for forked encoding/json package - golangci-lint run - cd jose-util && go build && PATH=$PWD:$PATH cram -v jose-util.t # cram tests jose-util - cd .. after_success: - gocovmerge *.cov */*.cov > merged.coverprofile - goveralls -coverprofile merged.coverprofile -service=travis-ci ================================================ FILE: vendor/github.com/go-jose/go-jose/v4/CONTRIBUTING.md ================================================ # Contributing If you would like to contribute code to go-jose you can do so through GitHub by forking the repository and sending a pull request. When submitting code, please make every effort to follow existing conventions and style in order to keep the code as readable as possible. Please also make sure all tests pass by running `go test`, and format your code with `go fmt`. We also recommend using `golint` and `errcheck`. ================================================ FILE: vendor/github.com/go-jose/go-jose/v4/LICENSE ================================================ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: vendor/github.com/go-jose/go-jose/v4/README.md ================================================ # Go JOSE [![godoc](https://pkg.go.dev/badge/github.com/go-jose/go-jose/v4.svg)](https://pkg.go.dev/github.com/go-jose/go-jose/v4) [![godoc](https://pkg.go.dev/badge/github.com/go-jose/go-jose/v4/jwt.svg)](https://pkg.go.dev/github.com/go-jose/go-jose/v4/jwt) [![license](https://img.shields.io/badge/license-apache_2.0-blue.svg?style=flat)](https://raw.githubusercontent.com/go-jose/go-jose/master/LICENSE) Package jose aims to provide an implementation of the Javascript Object Signing and Encryption set of standards. This includes support for JSON Web Encryption, JSON Web Signature, and JSON Web Token standards. ## Overview The implementation follows the [JSON Web Encryption](https://dx.doi.org/10.17487/RFC7516) (RFC 7516), [JSON Web Signature](https://dx.doi.org/10.17487/RFC7515) (RFC 7515), and [JSON Web Token](https://dx.doi.org/10.17487/RFC7519) (RFC 7519) specifications. Tables of supported algorithms are shown below. The library supports both the compact and JWS/JWE JSON Serialization formats, and has optional support for multiple recipients. It also comes with a small command-line utility ([`jose-util`](https://pkg.go.dev/github.com/go-jose/go-jose/jose-util)) for dealing with JOSE messages in a shell. **Note**: We use a forked version of the `encoding/json` package from the Go standard library which uses case-sensitive matching for member names (instead of [case-insensitive matching](https://www.ietf.org/mail-archive/web/json/current/msg03763.html)). This is to avoid differences in interpretation of messages between go-jose and libraries in other languages. ### Versions The forthcoming Version 5 will be released with several breaking API changes, and will require Golang's `encoding/json/v2`, which is currently requires Go 1.25 built with GOEXPERIMENT=jsonv2. Version 4 is the current stable version: import "github.com/go-jose/go-jose/v4" It supports at least the current and previous Golang release. Currently it requires Golang 1.24. Version 3 is only receiving critical security updates. Migration to Version 4 is recommended. Versions 1 and 2 are obsolete, but can be found in the old repository, [square/go-jose](https://github.com/square/go-jose). ### Supported algorithms See below for a table of supported algorithms. Algorithm identifiers match the names in the [JSON Web Algorithms](https://dx.doi.org/10.17487/RFC7518) standard where possible. The Godoc reference has a list of constants. | Key encryption | Algorithm identifier(s) | |:-----------------------|:-----------------------------------------------| | RSA-PKCS#1v1.5 | RSA1_5 | | RSA-OAEP | RSA-OAEP, RSA-OAEP-256 | | AES key wrap | A128KW, A192KW, A256KW | | AES-GCM key wrap | A128GCMKW, A192GCMKW, A256GCMKW | | ECDH-ES + AES key wrap | ECDH-ES+A128KW, ECDH-ES+A192KW, ECDH-ES+A256KW | | ECDH-ES (direct) | ECDH-ES1 | | Direct encryption | dir1 | 1. Not supported in multi-recipient mode | Signing / MAC | Algorithm identifier(s) | |:------------------|:------------------------| | RSASSA-PKCS#1v1.5 | RS256, RS384, RS512 | | RSASSA-PSS | PS256, PS384, PS512 | | HMAC | HS256, HS384, HS512 | | ECDSA | ES256, ES384, ES512 | | Ed25519 | EdDSA2 | 2. Only available in version 2 of the package | Content encryption | Algorithm identifier(s) | |:-------------------|:--------------------------------------------| | AES-CBC+HMAC | A128CBC-HS256, A192CBC-HS384, A256CBC-HS512 | | AES-GCM | A128GCM, A192GCM, A256GCM | | Compression | Algorithm identifiers(s) | |:-------------------|--------------------------| | DEFLATE (RFC 1951) | DEF | ### Supported key types See below for a table of supported key types. These are understood by the library, and can be passed to corresponding functions such as `NewEncrypter` or `NewSigner`. Each of these keys can also be wrapped in a JWK if desired, which allows attaching a key id. | Algorithm(s) | Corresponding types | |:------------------|--------------------------------------------------------------------------------------------------------------------------------------| | RSA | *[rsa.PublicKey](https://pkg.go.dev/crypto/rsa/#PublicKey), *[rsa.PrivateKey](https://pkg.go.dev/crypto/rsa/#PrivateKey) | | ECDH, ECDSA | *[ecdsa.PublicKey](https://pkg.go.dev/crypto/ecdsa/#PublicKey), *[ecdsa.PrivateKey](https://pkg.go.dev/crypto/ecdsa/#PrivateKey) | | EdDSA1 | [ed25519.PublicKey](https://pkg.go.dev/crypto/ed25519#PublicKey), [ed25519.PrivateKey](https://pkg.go.dev/crypto/ed25519#PrivateKey) | | AES, HMAC | []byte | 1. Only available in version 2 or later of the package ## Examples [![godoc](https://pkg.go.dev/badge/github.com/go-jose/go-jose/v4.svg)](https://pkg.go.dev/github.com/go-jose/go-jose/v4) [![godoc](https://pkg.go.dev/badge/github.com/go-jose/go-jose/v4/jwt.svg)](https://pkg.go.dev/github.com/go-jose/go-jose/v4/jwt) Examples can be found in the Godoc reference for this package. The [`jose-util`](https://github.com/go-jose/go-jose/tree/main/jose-util) subdirectory also contains a small command-line utility which might be useful as an example as well. ================================================ FILE: vendor/github.com/go-jose/go-jose/v4/SECURITY.md ================================================ # Security Policy This document explains how to contact the Let's Encrypt security team to report security vulnerabilities. ## Supported Versions | Version | Supported | | ------- | ----------| | >= v3 | ✓ | | v2 | ✗ | | v1 | ✗ | ## Reporting a vulnerability Please see [https://letsencrypt.org/contact/#security](https://letsencrypt.org/contact/#security) for the email address to report a vulnerability. Ensure that the subject line for your report contains the word `vulnerability` and is descriptive. Your email should be acknowledged within 24 hours. If you do not receive a response within 24 hours, please follow-up again with another email. ================================================ FILE: vendor/github.com/go-jose/go-jose/v4/asymmetric.go ================================================ /*- * Copyright 2014 Square Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package jose import ( "crypto" "crypto/aes" "crypto/ecdsa" "crypto/ed25519" "crypto/rand" "crypto/rsa" "crypto/sha1" "crypto/sha256" "errors" "fmt" "math/big" josecipher "github.com/go-jose/go-jose/v4/cipher" "github.com/go-jose/go-jose/v4/json" ) // A generic RSA-based encrypter/verifier type rsaEncrypterVerifier struct { publicKey *rsa.PublicKey } // A generic RSA-based decrypter/signer type rsaDecrypterSigner struct { privateKey *rsa.PrivateKey } // A generic EC-based encrypter/verifier type ecEncrypterVerifier struct { publicKey *ecdsa.PublicKey } type edEncrypterVerifier struct { publicKey ed25519.PublicKey } // A key generator for ECDH-ES type ecKeyGenerator struct { size int algID string publicKey *ecdsa.PublicKey } // A generic EC-based decrypter/signer type ecDecrypterSigner struct { privateKey *ecdsa.PrivateKey } type edDecrypterSigner struct { privateKey ed25519.PrivateKey } // newRSARecipient creates recipientKeyInfo based on the given key. func newRSARecipient(keyAlg KeyAlgorithm, publicKey *rsa.PublicKey) (recipientKeyInfo, error) { // Verify that key management algorithm is supported by this encrypter switch keyAlg { case RSA1_5, RSA_OAEP, RSA_OAEP_256: default: return recipientKeyInfo{}, ErrUnsupportedAlgorithm } if publicKey == nil { return recipientKeyInfo{}, errors.New("invalid public key") } return recipientKeyInfo{ keyAlg: keyAlg, keyEncrypter: &rsaEncrypterVerifier{ publicKey: publicKey, }, }, nil } // newRSASigner creates a recipientSigInfo based on the given key. func newRSASigner(sigAlg SignatureAlgorithm, privateKey *rsa.PrivateKey) (recipientSigInfo, error) { // Verify that key management algorithm is supported by this encrypter switch sigAlg { case RS256, RS384, RS512, PS256, PS384, PS512: default: return recipientSigInfo{}, ErrUnsupportedAlgorithm } if privateKey == nil { return recipientSigInfo{}, errors.New("invalid private key") } return recipientSigInfo{ sigAlg: sigAlg, publicKey: staticPublicKey(&JSONWebKey{ Key: privateKey.Public(), }), signer: &rsaDecrypterSigner{ privateKey: privateKey, }, }, nil } func newEd25519Signer(sigAlg SignatureAlgorithm, privateKey ed25519.PrivateKey) (recipientSigInfo, error) { if sigAlg != EdDSA { return recipientSigInfo{}, ErrUnsupportedAlgorithm } if privateKey == nil { return recipientSigInfo{}, errors.New("invalid private key") } return recipientSigInfo{ sigAlg: sigAlg, publicKey: staticPublicKey(&JSONWebKey{ Key: privateKey.Public(), }), signer: &edDecrypterSigner{ privateKey: privateKey, }, }, nil } // newECDHRecipient creates recipientKeyInfo based on the given key. func newECDHRecipient(keyAlg KeyAlgorithm, publicKey *ecdsa.PublicKey) (recipientKeyInfo, error) { // Verify that key management algorithm is supported by this encrypter switch keyAlg { case ECDH_ES, ECDH_ES_A128KW, ECDH_ES_A192KW, ECDH_ES_A256KW: default: return recipientKeyInfo{}, ErrUnsupportedAlgorithm } if publicKey == nil || !publicKey.Curve.IsOnCurve(publicKey.X, publicKey.Y) { return recipientKeyInfo{}, errors.New("invalid public key") } return recipientKeyInfo{ keyAlg: keyAlg, keyEncrypter: &ecEncrypterVerifier{ publicKey: publicKey, }, }, nil } // newECDSASigner creates a recipientSigInfo based on the given key. func newECDSASigner(sigAlg SignatureAlgorithm, privateKey *ecdsa.PrivateKey) (recipientSigInfo, error) { // Verify that key management algorithm is supported by this encrypter switch sigAlg { case ES256, ES384, ES512: default: return recipientSigInfo{}, ErrUnsupportedAlgorithm } if privateKey == nil { return recipientSigInfo{}, errors.New("invalid private key") } return recipientSigInfo{ sigAlg: sigAlg, publicKey: staticPublicKey(&JSONWebKey{ Key: privateKey.Public(), }), signer: &ecDecrypterSigner{ privateKey: privateKey, }, }, nil } // Encrypt the given payload and update the object. func (ctx rsaEncrypterVerifier) encryptKey(cek []byte, alg KeyAlgorithm) (recipientInfo, error) { encryptedKey, err := ctx.encrypt(cek, alg) if err != nil { return recipientInfo{}, err } return recipientInfo{ encryptedKey: encryptedKey, header: &rawHeader{}, }, nil } // Encrypt the given payload. Based on the key encryption algorithm, // this will either use RSA-PKCS1v1.5 or RSA-OAEP (with SHA-1 or SHA-256). func (ctx rsaEncrypterVerifier) encrypt(cek []byte, alg KeyAlgorithm) ([]byte, error) { switch alg { case RSA1_5: return rsa.EncryptPKCS1v15(RandReader, ctx.publicKey, cek) case RSA_OAEP: return rsa.EncryptOAEP(sha1.New(), RandReader, ctx.publicKey, cek, []byte{}) case RSA_OAEP_256: return rsa.EncryptOAEP(sha256.New(), RandReader, ctx.publicKey, cek, []byte{}) } return nil, ErrUnsupportedAlgorithm } // Decrypt the given payload and return the content encryption key. func (ctx rsaDecrypterSigner) decryptKey(headers rawHeader, recipient *recipientInfo, generator keyGenerator) ([]byte, error) { return ctx.decrypt(recipient.encryptedKey, headers.getAlgorithm(), generator) } // Decrypt the given payload. Based on the key encryption algorithm, // this will either use RSA-PKCS1v1.5 or RSA-OAEP (with SHA-1 or SHA-256). func (ctx rsaDecrypterSigner) decrypt(jek []byte, alg KeyAlgorithm, generator keyGenerator) ([]byte, error) { // Note: The random reader on decrypt operations is only used for blinding, // so stubbing is meanlingless (hence the direct use of rand.Reader). switch alg { case RSA1_5: defer func() { // DecryptPKCS1v15SessionKey sometimes panics on an invalid payload // because of an index out of bounds error, which we want to ignore. // This has been fixed in Go 1.3.1 (released 2014/08/13), the recover() // only exists for preventing crashes with unpatched versions. // See: https://groups.google.com/forum/#!topic/golang-dev/7ihX6Y6kx9k // See: https://code.google.com/p/go/source/detail?r=58ee390ff31602edb66af41ed10901ec95904d33 _ = recover() }() // Perform some input validation. keyBytes := ctx.privateKey.PublicKey.N.BitLen() / 8 if keyBytes != len(jek) { // Input size is incorrect, the encrypted payload should always match // the size of the public modulus (e.g. using a 2048 bit key will // produce 256 bytes of output). Reject this since it's invalid input. return nil, ErrCryptoFailure } cek, _, err := generator.genKey() if err != nil { return nil, ErrCryptoFailure } // When decrypting an RSA-PKCS1v1.5 payload, we must take precautions to // prevent chosen-ciphertext attacks as described in RFC 3218, "Preventing // the Million Message Attack on Cryptographic Message Syntax". We are // therefore deliberately ignoring errors here. _ = rsa.DecryptPKCS1v15SessionKey(rand.Reader, ctx.privateKey, jek, cek) return cek, nil case RSA_OAEP: // Use rand.Reader for RSA blinding return rsa.DecryptOAEP(sha1.New(), rand.Reader, ctx.privateKey, jek, []byte{}) case RSA_OAEP_256: // Use rand.Reader for RSA blinding return rsa.DecryptOAEP(sha256.New(), rand.Reader, ctx.privateKey, jek, []byte{}) } return nil, ErrUnsupportedAlgorithm } // Sign the given payload func (ctx rsaDecrypterSigner) signPayload(payload []byte, alg SignatureAlgorithm) (Signature, error) { var hash crypto.Hash switch alg { case RS256, PS256: hash = crypto.SHA256 case RS384, PS384: hash = crypto.SHA384 case RS512, PS512: hash = crypto.SHA512 default: return Signature{}, ErrUnsupportedAlgorithm } hasher := hash.New() // According to documentation, Write() on hash never fails _, _ = hasher.Write(payload) hashed := hasher.Sum(nil) var out []byte var err error switch alg { case RS256, RS384, RS512: // TODO(https://github.com/go-jose/go-jose/issues/40): As of go1.20, the // random parameter is legacy and ignored, and it can be nil. // https://cs.opensource.google/go/go/+/refs/tags/go1.20:src/crypto/rsa/pkcs1v15.go;l=263;bpv=0;bpt=1 out, err = rsa.SignPKCS1v15(RandReader, ctx.privateKey, hash, hashed) case PS256, PS384, PS512: out, err = rsa.SignPSS(RandReader, ctx.privateKey, hash, hashed, &rsa.PSSOptions{ SaltLength: rsa.PSSSaltLengthEqualsHash, }) } if err != nil { return Signature{}, err } return Signature{ Signature: out, protected: &rawHeader{}, }, nil } // Verify the given payload func (ctx rsaEncrypterVerifier) verifyPayload(payload []byte, signature []byte, alg SignatureAlgorithm) error { var hash crypto.Hash switch alg { case RS256, PS256: hash = crypto.SHA256 case RS384, PS384: hash = crypto.SHA384 case RS512, PS512: hash = crypto.SHA512 default: return ErrUnsupportedAlgorithm } hasher := hash.New() // According to documentation, Write() on hash never fails _, _ = hasher.Write(payload) hashed := hasher.Sum(nil) switch alg { case RS256, RS384, RS512: return rsa.VerifyPKCS1v15(ctx.publicKey, hash, hashed, signature) case PS256, PS384, PS512: return rsa.VerifyPSS(ctx.publicKey, hash, hashed, signature, nil) } return ErrUnsupportedAlgorithm } // Encrypt the given payload and update the object. func (ctx ecEncrypterVerifier) encryptKey(cek []byte, alg KeyAlgorithm) (recipientInfo, error) { switch alg { case ECDH_ES: // ECDH-ES mode doesn't wrap a key, the shared secret is used directly as the key. return recipientInfo{ header: &rawHeader{}, }, nil case ECDH_ES_A128KW, ECDH_ES_A192KW, ECDH_ES_A256KW: default: return recipientInfo{}, ErrUnsupportedAlgorithm } generator := ecKeyGenerator{ algID: string(alg), publicKey: ctx.publicKey, } switch alg { case ECDH_ES_A128KW: generator.size = 16 case ECDH_ES_A192KW: generator.size = 24 case ECDH_ES_A256KW: generator.size = 32 } kek, header, err := generator.genKey() if err != nil { return recipientInfo{}, err } block, err := aes.NewCipher(kek) if err != nil { return recipientInfo{}, err } jek, err := josecipher.KeyWrap(block, cek) if err != nil { return recipientInfo{}, err } return recipientInfo{ encryptedKey: jek, header: &header, }, nil } // Get key size for EC key generator func (ctx ecKeyGenerator) keySize() int { return ctx.size } // Get a content encryption key for ECDH-ES func (ctx ecKeyGenerator) genKey() ([]byte, rawHeader, error) { priv, err := ecdsa.GenerateKey(ctx.publicKey.Curve, RandReader) if err != nil { return nil, rawHeader{}, err } out := josecipher.DeriveECDHES(ctx.algID, []byte{}, []byte{}, priv, ctx.publicKey, ctx.size) b, err := json.Marshal(&JSONWebKey{ Key: &priv.PublicKey, }) if err != nil { return nil, nil, err } headers := rawHeader{ headerEPK: makeRawMessage(b), } return out, headers, nil } // Decrypt the given payload and return the content encryption key. func (ctx ecDecrypterSigner) decryptKey(headers rawHeader, recipient *recipientInfo, generator keyGenerator) ([]byte, error) { epk, err := headers.getEPK() if err != nil { return nil, errors.New("go-jose/go-jose: invalid epk header") } if epk == nil { return nil, errors.New("go-jose/go-jose: missing epk header") } publicKey, ok := epk.Key.(*ecdsa.PublicKey) if publicKey == nil || !ok { return nil, errors.New("go-jose/go-jose: invalid epk header") } if !ctx.privateKey.Curve.IsOnCurve(publicKey.X, publicKey.Y) { return nil, errors.New("go-jose/go-jose: invalid public key in epk header") } apuData, err := headers.getAPU() if err != nil { return nil, errors.New("go-jose/go-jose: invalid apu header") } apvData, err := headers.getAPV() if err != nil { return nil, errors.New("go-jose/go-jose: invalid apv header") } deriveKey := func(algID string, size int) []byte { return josecipher.DeriveECDHES(algID, apuData.bytes(), apvData.bytes(), ctx.privateKey, publicKey, size) } var keySize int algorithm := headers.getAlgorithm() switch algorithm { case ECDH_ES: // ECDH-ES uses direct key agreement, no key unwrapping necessary. return deriveKey(string(headers.getEncryption()), generator.keySize()), nil case ECDH_ES_A128KW: keySize = 16 case ECDH_ES_A192KW: keySize = 24 case ECDH_ES_A256KW: keySize = 32 default: return nil, ErrUnsupportedAlgorithm } key := deriveKey(string(algorithm), keySize) block, err := aes.NewCipher(key) if err != nil { return nil, err } return josecipher.KeyUnwrap(block, recipient.encryptedKey) } func (ctx edDecrypterSigner) signPayload(payload []byte, alg SignatureAlgorithm) (Signature, error) { if alg != EdDSA { return Signature{}, ErrUnsupportedAlgorithm } sig, err := ctx.privateKey.Sign(RandReader, payload, crypto.Hash(0)) if err != nil { return Signature{}, err } return Signature{ Signature: sig, protected: &rawHeader{}, }, nil } func (ctx edEncrypterVerifier) verifyPayload(payload []byte, signature []byte, alg SignatureAlgorithm) error { if alg != EdDSA { return ErrUnsupportedAlgorithm } ok := ed25519.Verify(ctx.publicKey, payload, signature) if !ok { return errors.New("go-jose/go-jose: ed25519 signature failed to verify") } return nil } // Sign the given payload func (ctx ecDecrypterSigner) signPayload(payload []byte, alg SignatureAlgorithm) (Signature, error) { var expectedBitSize int var hash crypto.Hash switch alg { case ES256: expectedBitSize = 256 hash = crypto.SHA256 case ES384: expectedBitSize = 384 hash = crypto.SHA384 case ES512: expectedBitSize = 521 hash = crypto.SHA512 } curveBits := ctx.privateKey.Curve.Params().BitSize if expectedBitSize != curveBits { return Signature{}, fmt.Errorf("go-jose/go-jose: expected %d bit key, got %d bits instead", expectedBitSize, curveBits) } hasher := hash.New() // According to documentation, Write() on hash never fails _, _ = hasher.Write(payload) hashed := hasher.Sum(nil) r, s, err := ecdsa.Sign(RandReader, ctx.privateKey, hashed) if err != nil { return Signature{}, err } keyBytes := curveBits / 8 if curveBits%8 > 0 { keyBytes++ } // We serialize the outputs (r and s) into big-endian byte arrays and pad // them with zeros on the left to make sure the sizes work out. Both arrays // must be keyBytes long, and the output must be 2*keyBytes long. rBytes := r.Bytes() rBytesPadded := make([]byte, keyBytes) copy(rBytesPadded[keyBytes-len(rBytes):], rBytes) sBytes := s.Bytes() sBytesPadded := make([]byte, keyBytes) copy(sBytesPadded[keyBytes-len(sBytes):], sBytes) out := append(rBytesPadded, sBytesPadded...) return Signature{ Signature: out, protected: &rawHeader{}, }, nil } // Verify the given payload func (ctx ecEncrypterVerifier) verifyPayload(payload []byte, signature []byte, alg SignatureAlgorithm) error { var keySize int var hash crypto.Hash switch alg { case ES256: keySize = 32 hash = crypto.SHA256 case ES384: keySize = 48 hash = crypto.SHA384 case ES512: keySize = 66 hash = crypto.SHA512 default: return ErrUnsupportedAlgorithm } if len(signature) != 2*keySize { return fmt.Errorf("go-jose/go-jose: invalid signature size, have %d bytes, wanted %d", len(signature), 2*keySize) } hasher := hash.New() // According to documentation, Write() on hash never fails _, _ = hasher.Write(payload) hashed := hasher.Sum(nil) r := big.NewInt(0).SetBytes(signature[:keySize]) s := big.NewInt(0).SetBytes(signature[keySize:]) match := ecdsa.Verify(ctx.publicKey, hashed, r, s) if !match { return errors.New("go-jose/go-jose: ecdsa signature failed to verify") } return nil } ================================================ FILE: vendor/github.com/go-jose/go-jose/v4/cipher/cbc_hmac.go ================================================ /*- * Copyright 2014 Square Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package josecipher import ( "bytes" "crypto/cipher" "crypto/hmac" "crypto/sha256" "crypto/sha512" "crypto/subtle" "encoding/binary" "errors" "hash" ) const ( nonceBytes = 16 ) // NewCBCHMAC instantiates a new AEAD based on CBC+HMAC. func NewCBCHMAC(key []byte, newBlockCipher func([]byte) (cipher.Block, error)) (cipher.AEAD, error) { keySize := len(key) / 2 integrityKey := key[:keySize] encryptionKey := key[keySize:] blockCipher, err := newBlockCipher(encryptionKey) if err != nil { return nil, err } var hash func() hash.Hash switch keySize { case 16: hash = sha256.New case 24: hash = sha512.New384 case 32: hash = sha512.New } return &cbcAEAD{ hash: hash, blockCipher: blockCipher, authtagBytes: keySize, integrityKey: integrityKey, }, nil } // An AEAD based on CBC+HMAC type cbcAEAD struct { hash func() hash.Hash authtagBytes int integrityKey []byte blockCipher cipher.Block } func (ctx *cbcAEAD) NonceSize() int { return nonceBytes } func (ctx *cbcAEAD) Overhead() int { // Maximum overhead is block size (for padding) plus auth tag length, where // the length of the auth tag is equivalent to the key size. return ctx.blockCipher.BlockSize() + ctx.authtagBytes } // Seal encrypts and authenticates the plaintext. func (ctx *cbcAEAD) Seal(dst, nonce, plaintext, data []byte) []byte { // Output buffer -- must take care not to mangle plaintext input. ciphertext := make([]byte, uint64(len(plaintext))+uint64(ctx.Overhead()))[:len(plaintext)] copy(ciphertext, plaintext) ciphertext = padBuffer(ciphertext, ctx.blockCipher.BlockSize()) cbc := cipher.NewCBCEncrypter(ctx.blockCipher, nonce) cbc.CryptBlocks(ciphertext, ciphertext) authtag := ctx.computeAuthTag(data, nonce, ciphertext) ret, out := resize(dst, uint64(len(dst))+uint64(len(ciphertext))+uint64(len(authtag))) copy(out, ciphertext) copy(out[len(ciphertext):], authtag) return ret } // Open decrypts and authenticates the ciphertext. func (ctx *cbcAEAD) Open(dst, nonce, ciphertext, data []byte) ([]byte, error) { if len(ciphertext) < ctx.authtagBytes { return nil, errors.New("go-jose/go-jose: invalid ciphertext (too short)") } offset := len(ciphertext) - ctx.authtagBytes expectedTag := ctx.computeAuthTag(data, nonce, ciphertext[:offset]) match := subtle.ConstantTimeCompare(expectedTag, ciphertext[offset:]) if match != 1 { return nil, errors.New("go-jose/go-jose: invalid ciphertext (auth tag mismatch)") } cbc := cipher.NewCBCDecrypter(ctx.blockCipher, nonce) // Make copy of ciphertext buffer, don't want to modify in place buffer := append([]byte{}, ciphertext[:offset]...) if len(buffer)%ctx.blockCipher.BlockSize() > 0 { return nil, errors.New("go-jose/go-jose: invalid ciphertext (invalid length)") } cbc.CryptBlocks(buffer, buffer) // Remove padding plaintext, err := unpadBuffer(buffer, ctx.blockCipher.BlockSize()) if err != nil { return nil, err } ret, out := resize(dst, uint64(len(dst))+uint64(len(plaintext))) copy(out, plaintext) return ret, nil } // Compute an authentication tag func (ctx *cbcAEAD) computeAuthTag(aad, nonce, ciphertext []byte) []byte { buffer := make([]byte, uint64(len(aad))+uint64(len(nonce))+uint64(len(ciphertext))+8) n := 0 n += copy(buffer, aad) n += copy(buffer[n:], nonce) n += copy(buffer[n:], ciphertext) binary.BigEndian.PutUint64(buffer[n:], uint64(len(aad))*8) // According to documentation, Write() on hash.Hash never fails. hmac := hmac.New(ctx.hash, ctx.integrityKey) _, _ = hmac.Write(buffer) return hmac.Sum(nil)[:ctx.authtagBytes] } // resize ensures that the given slice has a capacity of at least n bytes. // If the capacity of the slice is less than n, a new slice is allocated // and the existing data will be copied. func resize(in []byte, n uint64) (head, tail []byte) { if uint64(cap(in)) >= n { head = in[:n] } else { head = make([]byte, n) copy(head, in) } tail = head[len(in):] return } // Apply padding func padBuffer(buffer []byte, blockSize int) []byte { missing := blockSize - (len(buffer) % blockSize) ret, out := resize(buffer, uint64(len(buffer))+uint64(missing)) padding := bytes.Repeat([]byte{byte(missing)}, missing) copy(out, padding) return ret } // Remove padding func unpadBuffer(buffer []byte, blockSize int) ([]byte, error) { if len(buffer)%blockSize != 0 { return nil, errors.New("go-jose/go-jose: invalid padding") } last := buffer[len(buffer)-1] count := int(last) if count == 0 || count > blockSize || count > len(buffer) { return nil, errors.New("go-jose/go-jose: invalid padding") } padding := bytes.Repeat([]byte{last}, count) if !bytes.HasSuffix(buffer, padding) { return nil, errors.New("go-jose/go-jose: invalid padding") } return buffer[:len(buffer)-count], nil } ================================================ FILE: vendor/github.com/go-jose/go-jose/v4/cipher/concat_kdf.go ================================================ /*- * Copyright 2014 Square Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package josecipher import ( "crypto" "encoding/binary" "hash" "io" ) type concatKDF struct { z, info []byte i uint32 cache []byte hasher hash.Hash } // NewConcatKDF builds a KDF reader based on the given inputs. func NewConcatKDF(hash crypto.Hash, z, algID, ptyUInfo, ptyVInfo, supPubInfo, supPrivInfo []byte) io.Reader { buffer := make([]byte, uint64(len(algID))+uint64(len(ptyUInfo))+uint64(len(ptyVInfo))+uint64(len(supPubInfo))+uint64(len(supPrivInfo))) n := 0 n += copy(buffer, algID) n += copy(buffer[n:], ptyUInfo) n += copy(buffer[n:], ptyVInfo) n += copy(buffer[n:], supPubInfo) copy(buffer[n:], supPrivInfo) hasher := hash.New() return &concatKDF{ z: z, info: buffer, hasher: hasher, cache: []byte{}, i: 1, } } func (ctx *concatKDF) Read(out []byte) (int, error) { copied := copy(out, ctx.cache) ctx.cache = ctx.cache[copied:] for copied < len(out) { ctx.hasher.Reset() // Write on a hash.Hash never fails _ = binary.Write(ctx.hasher, binary.BigEndian, ctx.i) _, _ = ctx.hasher.Write(ctx.z) _, _ = ctx.hasher.Write(ctx.info) hash := ctx.hasher.Sum(nil) chunkCopied := copy(out[copied:], hash) copied += chunkCopied ctx.cache = hash[chunkCopied:] ctx.i++ } return copied, nil } ================================================ FILE: vendor/github.com/go-jose/go-jose/v4/cipher/ecdh_es.go ================================================ /*- * Copyright 2014 Square Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package josecipher import ( "bytes" "crypto" "crypto/ecdsa" "crypto/elliptic" "encoding/binary" ) // DeriveECDHES derives a shared encryption key using ECDH/ConcatKDF as described in JWE/JWA. // It is an error to call this function with a private/public key that are not on the same // curve. Callers must ensure that the keys are valid before calling this function. Output // size may be at most 1<<16 bytes (64 KiB). func DeriveECDHES(alg string, apuData, apvData []byte, priv *ecdsa.PrivateKey, pub *ecdsa.PublicKey, size int) []byte { if size > 1<<16 { panic("ECDH-ES output size too large, must be less than or equal to 1<<16") } // algId, partyUInfo, partyVInfo inputs must be prefixed with the length algID := lengthPrefixed([]byte(alg)) ptyUInfo := lengthPrefixed(apuData) ptyVInfo := lengthPrefixed(apvData) // suppPubInfo is the encoded length of the output size in bits supPubInfo := make([]byte, 4) binary.BigEndian.PutUint32(supPubInfo, uint32(size)*8) if !priv.PublicKey.Curve.IsOnCurve(pub.X, pub.Y) { panic("public key not on same curve as private key") } z, _ := priv.Curve.ScalarMult(pub.X, pub.Y, priv.D.Bytes()) zBytes := z.Bytes() // Note that calling z.Bytes() on a big.Int may strip leading zero bytes from // the returned byte array. This can lead to a problem where zBytes will be // shorter than expected which breaks the key derivation. Therefore we must pad // to the full length of the expected coordinate here before calling the KDF. octSize := dSize(priv.Curve) if len(zBytes) != octSize { zBytes = append(bytes.Repeat([]byte{0}, octSize-len(zBytes)), zBytes...) } reader := NewConcatKDF(crypto.SHA256, zBytes, algID, ptyUInfo, ptyVInfo, supPubInfo, []byte{}) key := make([]byte, size) // Read on the KDF will never fail _, _ = reader.Read(key) return key } // dSize returns the size in octets for a coordinate on a elliptic curve. func dSize(curve elliptic.Curve) int { order := curve.Params().P bitLen := order.BitLen() size := bitLen / 8 if bitLen%8 != 0 { size++ } return size } func lengthPrefixed(data []byte) []byte { out := make([]byte, len(data)+4) binary.BigEndian.PutUint32(out, uint32(len(data))) copy(out[4:], data) return out } ================================================ FILE: vendor/github.com/go-jose/go-jose/v4/cipher/key_wrap.go ================================================ /*- * Copyright 2014 Square Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package josecipher import ( "crypto/cipher" "crypto/subtle" "encoding/binary" "errors" ) var defaultIV = []byte{0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6} // KeyWrap implements NIST key wrapping; it wraps a content encryption key (cek) with the given block cipher. func KeyWrap(block cipher.Block, cek []byte) ([]byte, error) { if len(cek)%8 != 0 { return nil, errors.New("go-jose/go-jose: key wrap input must be 8 byte blocks") } n := len(cek) / 8 r := make([][]byte, n) for i := range r { r[i] = make([]byte, 8) copy(r[i], cek[i*8:]) } buffer := make([]byte, 16) tBytes := make([]byte, 8) copy(buffer, defaultIV) for t := 0; t < 6*n; t++ { copy(buffer[8:], r[t%n]) block.Encrypt(buffer, buffer) binary.BigEndian.PutUint64(tBytes, uint64(t+1)) for i := 0; i < 8; i++ { buffer[i] ^= tBytes[i] } copy(r[t%n], buffer[8:]) } out := make([]byte, (n+1)*8) copy(out, buffer[:8]) for i := range r { copy(out[(i+1)*8:], r[i]) } return out, nil } // KeyUnwrap implements NIST key unwrapping; it unwraps a content encryption key (cek) with the given block cipher. func KeyUnwrap(block cipher.Block, ciphertext []byte) ([]byte, error) { if len(ciphertext)%8 != 0 { return nil, errors.New("go-jose/go-jose: key wrap input must be 8 byte blocks") } n := (len(ciphertext) / 8) - 1 r := make([][]byte, n) for i := range r { r[i] = make([]byte, 8) copy(r[i], ciphertext[(i+1)*8:]) } buffer := make([]byte, 16) tBytes := make([]byte, 8) copy(buffer[:8], ciphertext[:8]) for t := 6*n - 1; t >= 0; t-- { binary.BigEndian.PutUint64(tBytes, uint64(t+1)) for i := 0; i < 8; i++ { buffer[i] ^= tBytes[i] } copy(buffer[8:], r[t%n]) block.Decrypt(buffer, buffer) copy(r[t%n], buffer[8:]) } if subtle.ConstantTimeCompare(buffer[:8], defaultIV) == 0 { return nil, errors.New("go-jose/go-jose: failed to unwrap key") } out := make([]byte, n*8) for i := range r { copy(out[i*8:], r[i]) } return out, nil } ================================================ FILE: vendor/github.com/go-jose/go-jose/v4/crypter.go ================================================ /*- * Copyright 2014 Square Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package jose import ( "crypto/ecdsa" "crypto/rsa" "errors" "fmt" "github.com/go-jose/go-jose/v4/json" ) // Encrypter represents an encrypter which produces an encrypted JWE object. type Encrypter interface { Encrypt(plaintext []byte) (*JSONWebEncryption, error) EncryptWithAuthData(plaintext []byte, aad []byte) (*JSONWebEncryption, error) Options() EncrypterOptions } // A generic content cipher type contentCipher interface { keySize() int encrypt(cek []byte, aad, plaintext []byte) (*aeadParts, error) decrypt(cek []byte, aad []byte, parts *aeadParts) ([]byte, error) } // A key generator (for generating/getting a CEK) type keyGenerator interface { keySize() int genKey() ([]byte, rawHeader, error) } // A generic key encrypter type keyEncrypter interface { encryptKey(cek []byte, alg KeyAlgorithm) (recipientInfo, error) // Encrypt a key } // A generic key decrypter type keyDecrypter interface { decryptKey(headers rawHeader, recipient *recipientInfo, generator keyGenerator) ([]byte, error) // Decrypt a key } // A generic encrypter based on the given key encrypter and content cipher. type genericEncrypter struct { contentAlg ContentEncryption compressionAlg CompressionAlgorithm cipher contentCipher recipients []recipientKeyInfo keyGenerator keyGenerator extraHeaders map[HeaderKey]interface{} } type recipientKeyInfo struct { keyID string keyAlg KeyAlgorithm keyEncrypter keyEncrypter } // EncrypterOptions represents options that can be set on new encrypters. type EncrypterOptions struct { Compression CompressionAlgorithm // Optional map of name/value pairs to be inserted into the protected // header of a JWS object. Some specifications which make use of // JWS require additional values here. // // Values will be serialized by [json.Marshal] and must be valid inputs to // that function. // // [json.Marshal]: https://pkg.go.dev/encoding/json#Marshal ExtraHeaders map[HeaderKey]interface{} } // WithHeader adds an arbitrary value to the ExtraHeaders map, initializing it // if necessary, and returns the updated EncrypterOptions. // // The v parameter will be serialized by [json.Marshal] and must be a valid // input to that function. // // [json.Marshal]: https://pkg.go.dev/encoding/json#Marshal func (eo *EncrypterOptions) WithHeader(k HeaderKey, v interface{}) *EncrypterOptions { if eo.ExtraHeaders == nil { eo.ExtraHeaders = map[HeaderKey]interface{}{} } eo.ExtraHeaders[k] = v return eo } // WithContentType adds a content type ("cty") header and returns the updated // EncrypterOptions. func (eo *EncrypterOptions) WithContentType(contentType ContentType) *EncrypterOptions { return eo.WithHeader(HeaderContentType, contentType) } // WithType adds a type ("typ") header and returns the updated EncrypterOptions. func (eo *EncrypterOptions) WithType(typ ContentType) *EncrypterOptions { return eo.WithHeader(HeaderType, typ) } // Recipient represents an algorithm/key to encrypt messages to. // // PBES2Count and PBES2Salt correspond with the "p2c" and "p2s" headers used // on the password-based encryption algorithms PBES2-HS256+A128KW, // PBES2-HS384+A192KW, and PBES2-HS512+A256KW. If they are not provided a safe // default of 100000 will be used for the count and a 128-bit random salt will // be generated. type Recipient struct { Algorithm KeyAlgorithm // Key must have one of these types: // - ed25519.PublicKey // - *ecdsa.PublicKey // - *rsa.PublicKey // - *JSONWebKey // - JSONWebKey // - []byte (a symmetric key) // - Any type that satisfies the OpaqueKeyEncrypter interface // // The type of Key must match the value of Algorithm. Key interface{} KeyID string PBES2Count int PBES2Salt []byte } // NewEncrypter creates an appropriate encrypter based on the key type func NewEncrypter(enc ContentEncryption, rcpt Recipient, opts *EncrypterOptions) (Encrypter, error) { encrypter := &genericEncrypter{ contentAlg: enc, recipients: []recipientKeyInfo{}, cipher: getContentCipher(enc), } if opts != nil { encrypter.compressionAlg = opts.Compression encrypter.extraHeaders = opts.ExtraHeaders } if encrypter.cipher == nil { return nil, ErrUnsupportedAlgorithm } var keyID string var rawKey interface{} switch encryptionKey := rcpt.Key.(type) { case JSONWebKey: keyID, rawKey = encryptionKey.KeyID, encryptionKey.Key case *JSONWebKey: keyID, rawKey = encryptionKey.KeyID, encryptionKey.Key case OpaqueKeyEncrypter: keyID, rawKey = encryptionKey.KeyID(), encryptionKey default: rawKey = encryptionKey } switch rcpt.Algorithm { case DIRECT: // Direct encryption mode must be treated differently keyBytes, ok := rawKey.([]byte) if !ok { return nil, ErrUnsupportedKeyType } if encrypter.cipher.keySize() != len(keyBytes) { return nil, ErrInvalidKeySize } encrypter.keyGenerator = staticKeyGenerator{ key: keyBytes, } recipientInfo, _ := newSymmetricRecipient(rcpt.Algorithm, keyBytes) recipientInfo.keyID = keyID if rcpt.KeyID != "" { recipientInfo.keyID = rcpt.KeyID } encrypter.recipients = []recipientKeyInfo{recipientInfo} return encrypter, nil case ECDH_ES: // ECDH-ES (w/o key wrapping) is similar to DIRECT mode keyDSA, ok := rawKey.(*ecdsa.PublicKey) if !ok { return nil, ErrUnsupportedKeyType } encrypter.keyGenerator = ecKeyGenerator{ size: encrypter.cipher.keySize(), algID: string(enc), publicKey: keyDSA, } recipientInfo, _ := newECDHRecipient(rcpt.Algorithm, keyDSA) recipientInfo.keyID = keyID if rcpt.KeyID != "" { recipientInfo.keyID = rcpt.KeyID } encrypter.recipients = []recipientKeyInfo{recipientInfo} return encrypter, nil default: // Can just add a standard recipient encrypter.keyGenerator = randomKeyGenerator{ size: encrypter.cipher.keySize(), } err := encrypter.addRecipient(rcpt) return encrypter, err } } // NewMultiEncrypter creates a multi-encrypter based on the given parameters func NewMultiEncrypter(enc ContentEncryption, rcpts []Recipient, opts *EncrypterOptions) (Encrypter, error) { cipher := getContentCipher(enc) if cipher == nil { return nil, ErrUnsupportedAlgorithm } if len(rcpts) == 0 { return nil, fmt.Errorf("go-jose/go-jose: recipients is nil or empty") } encrypter := &genericEncrypter{ contentAlg: enc, recipients: []recipientKeyInfo{}, cipher: cipher, keyGenerator: randomKeyGenerator{ size: cipher.keySize(), }, } if opts != nil { encrypter.compressionAlg = opts.Compression encrypter.extraHeaders = opts.ExtraHeaders } for _, recipient := range rcpts { err := encrypter.addRecipient(recipient) if err != nil { return nil, err } } return encrypter, nil } func (ctx *genericEncrypter) addRecipient(recipient Recipient) (err error) { var recipientInfo recipientKeyInfo switch recipient.Algorithm { case DIRECT, ECDH_ES: return fmt.Errorf("go-jose/go-jose: key algorithm '%s' not supported in multi-recipient mode", recipient.Algorithm) } recipientInfo, err = makeJWERecipient(recipient.Algorithm, recipient.Key) if recipient.KeyID != "" { recipientInfo.keyID = recipient.KeyID } switch recipient.Algorithm { case PBES2_HS256_A128KW, PBES2_HS384_A192KW, PBES2_HS512_A256KW: if sr, ok := recipientInfo.keyEncrypter.(*symmetricKeyCipher); ok { sr.p2c = recipient.PBES2Count sr.p2s = recipient.PBES2Salt } } if err == nil { ctx.recipients = append(ctx.recipients, recipientInfo) } return err } func makeJWERecipient(alg KeyAlgorithm, encryptionKey interface{}) (recipientKeyInfo, error) { switch encryptionKey := encryptionKey.(type) { case *rsa.PublicKey: return newRSARecipient(alg, encryptionKey) case *ecdsa.PublicKey: return newECDHRecipient(alg, encryptionKey) case []byte: return newSymmetricRecipient(alg, encryptionKey) case string: return newSymmetricRecipient(alg, []byte(encryptionKey)) case JSONWebKey: recipient, err := makeJWERecipient(alg, encryptionKey.Key) recipient.keyID = encryptionKey.KeyID return recipient, err case *JSONWebKey: recipient, err := makeJWERecipient(alg, encryptionKey.Key) recipient.keyID = encryptionKey.KeyID return recipient, err case OpaqueKeyEncrypter: return newOpaqueKeyEncrypter(alg, encryptionKey) } return recipientKeyInfo{}, ErrUnsupportedKeyType } // newDecrypter creates an appropriate decrypter based on the key type func newDecrypter(decryptionKey interface{}) (keyDecrypter, error) { switch decryptionKey := decryptionKey.(type) { case *rsa.PrivateKey: return &rsaDecrypterSigner{ privateKey: decryptionKey, }, nil case *ecdsa.PrivateKey: return &ecDecrypterSigner{ privateKey: decryptionKey, }, nil case []byte: return &symmetricKeyCipher{ key: decryptionKey, }, nil case string: return &symmetricKeyCipher{ key: []byte(decryptionKey), }, nil case JSONWebKey: return newDecrypter(decryptionKey.Key) case *JSONWebKey: return newDecrypter(decryptionKey.Key) case OpaqueKeyDecrypter: return &opaqueKeyDecrypter{decrypter: decryptionKey}, nil default: return nil, ErrUnsupportedKeyType } } // Implementation of encrypt method producing a JWE object. func (ctx *genericEncrypter) Encrypt(plaintext []byte) (*JSONWebEncryption, error) { return ctx.EncryptWithAuthData(plaintext, nil) } // Implementation of encrypt method producing a JWE object. func (ctx *genericEncrypter) EncryptWithAuthData(plaintext, aad []byte) (*JSONWebEncryption, error) { obj := &JSONWebEncryption{} obj.aad = aad obj.protected = &rawHeader{} err := obj.protected.set(headerEncryption, ctx.contentAlg) if err != nil { return nil, err } obj.recipients = make([]recipientInfo, len(ctx.recipients)) if len(ctx.recipients) == 0 { return nil, fmt.Errorf("go-jose/go-jose: no recipients to encrypt to") } cek, headers, err := ctx.keyGenerator.genKey() if err != nil { return nil, err } obj.protected.merge(&headers) for i, info := range ctx.recipients { recipient, err := info.keyEncrypter.encryptKey(cek, info.keyAlg) if err != nil { return nil, err } err = recipient.header.set(headerAlgorithm, info.keyAlg) if err != nil { return nil, err } if info.keyID != "" { err = recipient.header.set(headerKeyID, info.keyID) if err != nil { return nil, err } } obj.recipients[i] = recipient } if len(ctx.recipients) == 1 { // Move per-recipient headers into main protected header if there's // only a single recipient. obj.protected.merge(obj.recipients[0].header) obj.recipients[0].header = nil } if ctx.compressionAlg != NONE { plaintext, err = compress(ctx.compressionAlg, plaintext) if err != nil { return nil, err } err = obj.protected.set(headerCompression, ctx.compressionAlg) if err != nil { return nil, err } } for k, v := range ctx.extraHeaders { b, err := json.Marshal(v) if err != nil { return nil, err } (*obj.protected)[k] = makeRawMessage(b) } authData := obj.computeAuthData() parts, err := ctx.cipher.encrypt(cek, authData, plaintext) if err != nil { return nil, err } obj.iv = parts.iv obj.ciphertext = parts.ciphertext obj.tag = parts.tag return obj, nil } func (ctx *genericEncrypter) Options() EncrypterOptions { return EncrypterOptions{ Compression: ctx.compressionAlg, ExtraHeaders: ctx.extraHeaders, } } // Decrypt and validate the object and return the plaintext. This // function does not support multi-recipient. If you desire multi-recipient // decryption use DecryptMulti instead. // // The decryptionKey argument must contain a private or symmetric key // and must have one of these types: // - *ecdsa.PrivateKey // - *rsa.PrivateKey // - *JSONWebKey // - JSONWebKey // - *JSONWebKeySet // - JSONWebKeySet // - []byte (a symmetric key) // - string (a symmetric key) // - Any type that satisfies the OpaqueKeyDecrypter interface. // // Note that ed25519 is only available for signatures, not encryption, so is // not an option here. // // Automatically decompresses plaintext, but returns an error if the decompressed // data would be >250kB or >10x the size of the compressed data, whichever is larger. func (obj JSONWebEncryption) Decrypt(decryptionKey interface{}) ([]byte, error) { headers := obj.mergedHeaders(nil) if len(obj.recipients) > 1 { return nil, errors.New("go-jose/go-jose: too many recipients in payload; expecting only one") } err := headers.checkNoCritical() if err != nil { return nil, err } key, err := tryJWKS(decryptionKey, obj.Header) if err != nil { return nil, err } decrypter, err := newDecrypter(key) if err != nil { return nil, err } cipher := getContentCipher(headers.getEncryption()) if cipher == nil { return nil, fmt.Errorf("go-jose/go-jose: unsupported enc value '%s'", string(headers.getEncryption())) } generator := randomKeyGenerator{ size: cipher.keySize(), } parts := &aeadParts{ iv: obj.iv, ciphertext: obj.ciphertext, tag: obj.tag, } authData := obj.computeAuthData() var plaintext []byte recipient := obj.recipients[0] recipientHeaders := obj.mergedHeaders(&recipient) cek, err := decrypter.decryptKey(recipientHeaders, &recipient, generator) if err == nil { // Found a valid CEK -- let's try to decrypt. plaintext, err = cipher.decrypt(cek, authData, parts) } if plaintext == nil { return nil, ErrCryptoFailure } // The "zip" header parameter may only be present in the protected header. if comp := obj.protected.getCompression(); comp != "" { plaintext, err = decompress(comp, plaintext) if err != nil { return nil, fmt.Errorf("go-jose/go-jose: failed to decompress plaintext: %v", err) } } return plaintext, nil } // DecryptMulti decrypts and validates the object and returns the plaintexts, // with support for multiple recipients. It returns the index of the recipient // for which the decryption was successful, the merged headers for that recipient, // and the plaintext. // // The decryptionKey argument must have one of the types allowed for the // decryptionKey argument of Decrypt(). // // Automatically decompresses plaintext, but returns an error if the decompressed // data would be >250kB or >3x the size of the compressed data, whichever is larger. func (obj JSONWebEncryption) DecryptMulti(decryptionKey interface{}) (int, Header, []byte, error) { globalHeaders := obj.mergedHeaders(nil) err := globalHeaders.checkNoCritical() if err != nil { return -1, Header{}, nil, err } key, err := tryJWKS(decryptionKey, obj.Header) if err != nil { return -1, Header{}, nil, err } decrypter, err := newDecrypter(key) if err != nil { return -1, Header{}, nil, err } encryption := globalHeaders.getEncryption() cipher := getContentCipher(encryption) if cipher == nil { return -1, Header{}, nil, fmt.Errorf("go-jose/go-jose: unsupported enc value '%s'", string(encryption)) } generator := randomKeyGenerator{ size: cipher.keySize(), } parts := &aeadParts{ iv: obj.iv, ciphertext: obj.ciphertext, tag: obj.tag, } authData := obj.computeAuthData() index := -1 var plaintext []byte var headers rawHeader for i, recipient := range obj.recipients { recipientHeaders := obj.mergedHeaders(&recipient) cek, err := decrypter.decryptKey(recipientHeaders, &recipient, generator) if err == nil { // Found a valid CEK -- let's try to decrypt. plaintext, err = cipher.decrypt(cek, authData, parts) if err == nil { index = i headers = recipientHeaders break } } } if plaintext == nil { return -1, Header{}, nil, ErrCryptoFailure } // The "zip" header parameter may only be present in the protected header. if comp := obj.protected.getCompression(); comp != "" { plaintext, err = decompress(comp, plaintext) if err != nil { return -1, Header{}, nil, fmt.Errorf("go-jose/go-jose: failed to decompress plaintext: %v", err) } } sanitized, err := headers.sanitized() if err != nil { return -1, Header{}, nil, fmt.Errorf("go-jose/go-jose: failed to sanitize header: %v", err) } return index, sanitized, plaintext, err } ================================================ FILE: vendor/github.com/go-jose/go-jose/v4/doc.go ================================================ /*- * Copyright 2014 Square Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* Package jose aims to provide an implementation of the Javascript Object Signing and Encryption set of standards. It implements encryption and signing based on the JSON Web Encryption and JSON Web Signature standards, with optional JSON Web Token support available in a sub-package. The library supports both the compact and JWS/JWE JSON Serialization formats, and has optional support for multiple recipients. */ package jose ================================================ FILE: vendor/github.com/go-jose/go-jose/v4/encoding.go ================================================ /*- * Copyright 2014 Square Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package jose import ( "bytes" "compress/flate" "encoding/base64" "encoding/binary" "fmt" "io" "math/big" "strings" "unicode" "github.com/go-jose/go-jose/v4/json" ) // Helper function to serialize known-good objects. // Precondition: value is not a nil pointer. func mustSerializeJSON(value interface{}) []byte { out, err := json.Marshal(value) if err != nil { panic(err) } // We never want to serialize the top-level value "null," since it's not a // valid JOSE message. But if a caller passes in a nil pointer to this method, // MarshalJSON will happily serialize it as the top-level value "null". If // that value is then embedded in another operation, for instance by being // base64-encoded and fed as input to a signing algorithm // (https://github.com/go-jose/go-jose/issues/22), the result will be // incorrect. Because this method is intended for known-good objects, and a nil // pointer is not a known-good object, we are free to panic in this case. // Note: It's not possible to directly check whether the data pointed at by an // interface is a nil pointer, so we do this hacky workaround. // https://groups.google.com/forum/#!topic/golang-nuts/wnH302gBa4I if string(out) == "null" { panic("Tried to serialize a nil pointer.") } return out } // Strip all newlines and whitespace func stripWhitespace(data string) string { buf := strings.Builder{} buf.Grow(len(data)) for _, r := range data { if !unicode.IsSpace(r) { buf.WriteRune(r) } } return buf.String() } // Perform compression based on algorithm func compress(algorithm CompressionAlgorithm, input []byte) ([]byte, error) { switch algorithm { case DEFLATE: return deflate(input) default: return nil, ErrUnsupportedAlgorithm } } // Perform decompression based on algorithm func decompress(algorithm CompressionAlgorithm, input []byte) ([]byte, error) { switch algorithm { case DEFLATE: return inflate(input) default: return nil, ErrUnsupportedAlgorithm } } // deflate compresses the input. func deflate(input []byte) ([]byte, error) { output := new(bytes.Buffer) // Writing to byte buffer, err is always nil writer, _ := flate.NewWriter(output, 1) _, _ = io.Copy(writer, bytes.NewBuffer(input)) err := writer.Close() return output.Bytes(), err } // inflate decompresses the input. // // Errors if the decompressed data would be >250kB or >10x the size of the // compressed data, whichever is larger. func inflate(input []byte) ([]byte, error) { output := new(bytes.Buffer) reader := flate.NewReader(bytes.NewBuffer(input)) maxCompressedSize := max(250_000, 10*int64(len(input))) limit := maxCompressedSize + 1 n, err := io.CopyN(output, reader, limit) if err != nil && err != io.EOF { return nil, err } if n == limit { return nil, fmt.Errorf("uncompressed data would be too large (>%d bytes)", maxCompressedSize) } err = reader.Close() return output.Bytes(), err } // byteBuffer represents a slice of bytes that can be serialized to url-safe base64. type byteBuffer struct { data []byte } func newBuffer(data []byte) *byteBuffer { if data == nil { return nil } return &byteBuffer{ data: data, } } func newFixedSizeBuffer(data []byte, length int) *byteBuffer { if len(data) > length { panic("go-jose/go-jose: invalid call to newFixedSizeBuffer (len(data) > length)") } pad := make([]byte, length-len(data)) return newBuffer(append(pad, data...)) } func newBufferFromInt(num uint64) *byteBuffer { data := make([]byte, 8) binary.BigEndian.PutUint64(data, num) return newBuffer(bytes.TrimLeft(data, "\x00")) } func (b *byteBuffer) MarshalJSON() ([]byte, error) { return json.Marshal(b.base64()) } func (b *byteBuffer) UnmarshalJSON(data []byte) error { var encoded string err := json.Unmarshal(data, &encoded) if err != nil { return err } if encoded == "" { return nil } decoded, err := base64.RawURLEncoding.DecodeString(encoded) if err != nil { return err } *b = *newBuffer(decoded) return nil } func (b *byteBuffer) base64() string { return base64.RawURLEncoding.EncodeToString(b.data) } func (b *byteBuffer) bytes() []byte { // Handling nil here allows us to transparently handle nil slices when serializing. if b == nil { return nil } return b.data } func (b byteBuffer) bigInt() *big.Int { return new(big.Int).SetBytes(b.data) } func (b byteBuffer) toInt() int { return int(b.bigInt().Int64()) } func base64EncodeLen(sl []byte) int { return base64.RawURLEncoding.EncodedLen(len(sl)) } func base64JoinWithDots(inputs ...[]byte) string { if len(inputs) == 0 { return "" } // Count of dots. totalCount := len(inputs) - 1 for _, input := range inputs { totalCount += base64EncodeLen(input) } out := make([]byte, totalCount) startEncode := 0 for i, input := range inputs { base64.RawURLEncoding.Encode(out[startEncode:], input) if i == len(inputs)-1 { continue } startEncode += base64EncodeLen(input) out[startEncode] = '.' startEncode++ } return string(out) } ================================================ FILE: vendor/github.com/go-jose/go-jose/v4/json/LICENSE ================================================ Copyright (c) 2012 The Go Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: vendor/github.com/go-jose/go-jose/v4/json/README.md ================================================ # Safe JSON This repository contains a fork of the `encoding/json` package from Go 1.6. The following changes were made: * Object deserialization uses case-sensitive member name matching instead of [case-insensitive matching](https://www.ietf.org/mail-archive/web/json/current/msg03763.html). This is to avoid differences in the interpretation of JOSE messages between go-jose and libraries written in other languages. * When deserializing a JSON object, we check for duplicate keys and reject the input whenever we detect a duplicate. Rather than trying to work with malformed data, we prefer to reject it right away. ================================================ FILE: vendor/github.com/go-jose/go-jose/v4/json/decode.go ================================================ // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Represents JSON data structure using native Go types: booleans, floats, // strings, arrays, and maps. package json import ( "bytes" "encoding" "encoding/base64" "errors" "fmt" "math" "reflect" "runtime" "strconv" "unicode" "unicode/utf16" "unicode/utf8" ) // Unmarshal parses the JSON-encoded data and stores the result // in the value pointed to by v. // // Unmarshal uses the inverse of the encodings that // Marshal uses, allocating maps, slices, and pointers as necessary, // with the following additional rules: // // To unmarshal JSON into a pointer, Unmarshal first handles the case of // the JSON being the JSON literal null. In that case, Unmarshal sets // the pointer to nil. Otherwise, Unmarshal unmarshals the JSON into // the value pointed at by the pointer. If the pointer is nil, Unmarshal // allocates a new value for it to point to. // // To unmarshal JSON into a struct, Unmarshal matches incoming object // keys to the keys used by Marshal (either the struct field name or its tag), // preferring an exact match but also accepting a case-insensitive match. // Unmarshal will only set exported fields of the struct. // // To unmarshal JSON into an interface value, // Unmarshal stores one of these in the interface value: // // bool, for JSON booleans // float64, for JSON numbers // string, for JSON strings // []interface{}, for JSON arrays // map[string]interface{}, for JSON objects // nil for JSON null // // To unmarshal a JSON array into a slice, Unmarshal resets the slice length // to zero and then appends each element to the slice. // As a special case, to unmarshal an empty JSON array into a slice, // Unmarshal replaces the slice with a new empty slice. // // To unmarshal a JSON array into a Go array, Unmarshal decodes // JSON array elements into corresponding Go array elements. // If the Go array is smaller than the JSON array, // the additional JSON array elements are discarded. // If the JSON array is smaller than the Go array, // the additional Go array elements are set to zero values. // // To unmarshal a JSON object into a string-keyed map, Unmarshal first // establishes a map to use, If the map is nil, Unmarshal allocates a new map. // Otherwise Unmarshal reuses the existing map, keeping existing entries. // Unmarshal then stores key-value pairs from the JSON object into the map. // // If a JSON value is not appropriate for a given target type, // or if a JSON number overflows the target type, Unmarshal // skips that field and completes the unmarshaling as best it can. // If no more serious errors are encountered, Unmarshal returns // an UnmarshalTypeError describing the earliest such error. // // The JSON null value unmarshals into an interface, map, pointer, or slice // by setting that Go value to nil. Because null is often used in JSON to mean // “not present,” unmarshaling a JSON null into any other Go type has no effect // on the value and produces no error. // // When unmarshaling quoted strings, invalid UTF-8 or // invalid UTF-16 surrogate pairs are not treated as an error. // Instead, they are replaced by the Unicode replacement // character U+FFFD. func Unmarshal(data []byte, v interface{}) error { // Check for well-formedness. // Avoids filling out half a data structure // before discovering a JSON syntax error. var d decodeState err := checkValid(data, &d.scan) if err != nil { return err } d.init(data) return d.unmarshal(v) } // Unmarshaler is the interface implemented by objects // that can unmarshal a JSON description of themselves. // The input can be assumed to be a valid encoding of // a JSON value. UnmarshalJSON must copy the JSON data // if it wishes to retain the data after returning. type Unmarshaler interface { UnmarshalJSON([]byte) error } // An UnmarshalTypeError describes a JSON value that was // not appropriate for a value of a specific Go type. type UnmarshalTypeError struct { Value string // description of JSON value - "bool", "array", "number -5" Type reflect.Type // type of Go value it could not be assigned to Offset int64 // error occurred after reading Offset bytes } func (e *UnmarshalTypeError) Error() string { return "json: cannot unmarshal " + e.Value + " into Go value of type " + e.Type.String() } // An UnmarshalFieldError describes a JSON object key that // led to an unexported (and therefore unwritable) struct field. // (No longer used; kept for compatibility.) type UnmarshalFieldError struct { Key string Type reflect.Type Field reflect.StructField } func (e *UnmarshalFieldError) Error() string { return "json: cannot unmarshal object key " + strconv.Quote(e.Key) + " into unexported field " + e.Field.Name + " of type " + e.Type.String() } // An InvalidUnmarshalError describes an invalid argument passed to Unmarshal. // (The argument to Unmarshal must be a non-nil pointer.) type InvalidUnmarshalError struct { Type reflect.Type } func (e *InvalidUnmarshalError) Error() string { if e.Type == nil { return "json: Unmarshal(nil)" } if e.Type.Kind() != reflect.Ptr { return "json: Unmarshal(non-pointer " + e.Type.String() + ")" } return "json: Unmarshal(nil " + e.Type.String() + ")" } func (d *decodeState) unmarshal(v interface{}) (err error) { defer func() { if r := recover(); r != nil { if _, ok := r.(runtime.Error); ok { panic(r) } err = r.(error) } }() rv := reflect.ValueOf(v) if rv.Kind() != reflect.Ptr || rv.IsNil() { return &InvalidUnmarshalError{reflect.TypeOf(v)} } d.scan.reset() // We decode rv not rv.Elem because the Unmarshaler interface // test must be applied at the top level of the value. d.value(rv) return d.savedError } // A Number represents a JSON number literal. type Number string // String returns the literal text of the number. func (n Number) String() string { return string(n) } // Float64 returns the number as a float64. func (n Number) Float64() (float64, error) { return strconv.ParseFloat(string(n), 64) } // Int64 returns the number as an int64. func (n Number) Int64() (int64, error) { return strconv.ParseInt(string(n), 10, 64) } // isValidNumber reports whether s is a valid JSON number literal. func isValidNumber(s string) bool { // This function implements the JSON numbers grammar. // See https://tools.ietf.org/html/rfc7159#section-6 // and http://json.org/number.gif if s == "" { return false } // Optional - if s[0] == '-' { s = s[1:] if s == "" { return false } } // Digits switch { default: return false case s[0] == '0': s = s[1:] case '1' <= s[0] && s[0] <= '9': s = s[1:] for len(s) > 0 && '0' <= s[0] && s[0] <= '9' { s = s[1:] } } // . followed by 1 or more digits. if len(s) >= 2 && s[0] == '.' && '0' <= s[1] && s[1] <= '9' { s = s[2:] for len(s) > 0 && '0' <= s[0] && s[0] <= '9' { s = s[1:] } } // e or E followed by an optional - or + and // 1 or more digits. if len(s) >= 2 && (s[0] == 'e' || s[0] == 'E') { s = s[1:] if s[0] == '+' || s[0] == '-' { s = s[1:] if s == "" { return false } } for len(s) > 0 && '0' <= s[0] && s[0] <= '9' { s = s[1:] } } // Make sure we are at the end. return s == "" } type NumberUnmarshalType int const ( // unmarshal a JSON number into an interface{} as a float64 UnmarshalFloat NumberUnmarshalType = iota // unmarshal a JSON number into an interface{} as a `json.Number` UnmarshalJSONNumber // unmarshal a JSON number into an interface{} as a int64 // if value is an integer otherwise float64 UnmarshalIntOrFloat ) // decodeState represents the state while decoding a JSON value. type decodeState struct { data []byte off int // read offset in data scan scanner nextscan scanner // for calls to nextValue savedError error numberType NumberUnmarshalType } // errPhase is used for errors that should not happen unless // there is a bug in the JSON decoder or something is editing // the data slice while the decoder executes. var errPhase = errors.New("JSON decoder out of sync - data changing underfoot?") func (d *decodeState) init(data []byte) *decodeState { d.data = data d.off = 0 d.savedError = nil return d } // error aborts the decoding by panicking with err. func (d *decodeState) error(err error) { panic(err) } // saveError saves the first err it is called with, // for reporting at the end of the unmarshal. func (d *decodeState) saveError(err error) { if d.savedError == nil { d.savedError = err } } // next cuts off and returns the next full JSON value in d.data[d.off:]. // The next value is known to be an object or array, not a literal. func (d *decodeState) next() []byte { c := d.data[d.off] item, rest, err := nextValue(d.data[d.off:], &d.nextscan) if err != nil { d.error(err) } d.off = len(d.data) - len(rest) // Our scanner has seen the opening brace/bracket // and thinks we're still in the middle of the object. // invent a closing brace/bracket to get it out. if c == '{' { d.scan.step(&d.scan, '}') } else { d.scan.step(&d.scan, ']') } return item } // scanWhile processes bytes in d.data[d.off:] until it // receives a scan code not equal to op. // It updates d.off and returns the new scan code. func (d *decodeState) scanWhile(op int) int { var newOp int for { if d.off >= len(d.data) { newOp = d.scan.eof() d.off = len(d.data) + 1 // mark processed EOF with len+1 } else { c := d.data[d.off] d.off++ newOp = d.scan.step(&d.scan, c) } if newOp != op { break } } return newOp } // value decodes a JSON value from d.data[d.off:] into the value. // it updates d.off to point past the decoded value. func (d *decodeState) value(v reflect.Value) { if !v.IsValid() { _, rest, err := nextValue(d.data[d.off:], &d.nextscan) if err != nil { d.error(err) } d.off = len(d.data) - len(rest) // d.scan thinks we're still at the beginning of the item. // Feed in an empty string - the shortest, simplest value - // so that it knows we got to the end of the value. if d.scan.redo { // rewind. d.scan.redo = false d.scan.step = stateBeginValue } d.scan.step(&d.scan, '"') d.scan.step(&d.scan, '"') n := len(d.scan.parseState) if n > 0 && d.scan.parseState[n-1] == parseObjectKey { // d.scan thinks we just read an object key; finish the object d.scan.step(&d.scan, ':') d.scan.step(&d.scan, '"') d.scan.step(&d.scan, '"') d.scan.step(&d.scan, '}') } return } switch op := d.scanWhile(scanSkipSpace); op { default: d.error(errPhase) case scanBeginArray: d.array(v) case scanBeginObject: d.object(v) case scanBeginLiteral: d.literal(v) } } type unquotedValue struct{} // valueQuoted is like value but decodes a // quoted string literal or literal null into an interface value. // If it finds anything other than a quoted string literal or null, // valueQuoted returns unquotedValue{}. func (d *decodeState) valueQuoted() interface{} { switch op := d.scanWhile(scanSkipSpace); op { default: d.error(errPhase) case scanBeginArray: d.array(reflect.Value{}) case scanBeginObject: d.object(reflect.Value{}) case scanBeginLiteral: switch v := d.literalInterface().(type) { case nil, string: return v } } return unquotedValue{} } // indirect walks down v allocating pointers as needed, // until it gets to a non-pointer. // if it encounters an Unmarshaler, indirect stops and returns that. // if decodingNull is true, indirect stops at the last pointer so it can be set to nil. func (d *decodeState) indirect(v reflect.Value, decodingNull bool) (Unmarshaler, encoding.TextUnmarshaler, reflect.Value) { // If v is a named type and is addressable, // start with its address, so that if the type has pointer methods, // we find them. if v.Kind() != reflect.Ptr && v.Type().Name() != "" && v.CanAddr() { v = v.Addr() } for { // Load value from interface, but only if the result will be // usefully addressable. if v.Kind() == reflect.Interface && !v.IsNil() { e := v.Elem() if e.Kind() == reflect.Ptr && !e.IsNil() && (!decodingNull || e.Elem().Kind() == reflect.Ptr) { v = e continue } } if v.Kind() != reflect.Ptr { break } if v.Elem().Kind() != reflect.Ptr && decodingNull && v.CanSet() { break } if v.IsNil() { v.Set(reflect.New(v.Type().Elem())) } if v.Type().NumMethod() > 0 { if u, ok := v.Interface().(Unmarshaler); ok { return u, nil, reflect.Value{} } if u, ok := v.Interface().(encoding.TextUnmarshaler); ok { return nil, u, reflect.Value{} } } v = v.Elem() } return nil, nil, v } // array consumes an array from d.data[d.off-1:], decoding into the value v. // the first byte of the array ('[') has been read already. func (d *decodeState) array(v reflect.Value) { // Check for unmarshaler. u, ut, pv := d.indirect(v, false) if u != nil { d.off-- err := u.UnmarshalJSON(d.next()) if err != nil { d.error(err) } return } if ut != nil { d.saveError(&UnmarshalTypeError{"array", v.Type(), int64(d.off)}) d.off-- d.next() return } v = pv // Check type of target. switch v.Kind() { case reflect.Interface: if v.NumMethod() == 0 { // Decoding into nil interface? Switch to non-reflect code. v.Set(reflect.ValueOf(d.arrayInterface())) return } // Otherwise it's invalid. fallthrough default: d.saveError(&UnmarshalTypeError{"array", v.Type(), int64(d.off)}) d.off-- d.next() return case reflect.Array: case reflect.Slice: break } i := 0 for { // Look ahead for ] - can only happen on first iteration. op := d.scanWhile(scanSkipSpace) if op == scanEndArray { break } // Back up so d.value can have the byte we just read. d.off-- d.scan.undo(op) // Get element of array, growing if necessary. if v.Kind() == reflect.Slice { // Grow slice if necessary if i >= v.Cap() { newcap := v.Cap() + v.Cap()/2 if newcap < 4 { newcap = 4 } newv := reflect.MakeSlice(v.Type(), v.Len(), newcap) reflect.Copy(newv, v) v.Set(newv) } if i >= v.Len() { v.SetLen(i + 1) } } if i < v.Len() { // Decode into element. d.value(v.Index(i)) } else { // Ran out of fixed array: skip. d.value(reflect.Value{}) } i++ // Next token must be , or ]. op = d.scanWhile(scanSkipSpace) if op == scanEndArray { break } if op != scanArrayValue { d.error(errPhase) } } if i < v.Len() { if v.Kind() == reflect.Array { // Array. Zero the rest. z := reflect.Zero(v.Type().Elem()) for ; i < v.Len(); i++ { v.Index(i).Set(z) } } else { v.SetLen(i) } } if i == 0 && v.Kind() == reflect.Slice { v.Set(reflect.MakeSlice(v.Type(), 0, 0)) } } var nullLiteral = []byte("null") // object consumes an object from d.data[d.off-1:], decoding into the value v. // the first byte ('{') of the object has been read already. func (d *decodeState) object(v reflect.Value) { // Check for unmarshaler. u, ut, pv := d.indirect(v, false) if u != nil { d.off-- err := u.UnmarshalJSON(d.next()) if err != nil { d.error(err) } return } if ut != nil { d.saveError(&UnmarshalTypeError{"object", v.Type(), int64(d.off)}) d.off-- d.next() // skip over { } in input return } v = pv // Decoding into nil interface? Switch to non-reflect code. if v.Kind() == reflect.Interface && v.NumMethod() == 0 { v.Set(reflect.ValueOf(d.objectInterface())) return } // Check type of target: struct or map[string]T switch v.Kind() { case reflect.Map: // map must have string kind t := v.Type() if t.Key().Kind() != reflect.String { d.saveError(&UnmarshalTypeError{"object", v.Type(), int64(d.off)}) d.off-- d.next() // skip over { } in input return } if v.IsNil() { v.Set(reflect.MakeMap(t)) } case reflect.Struct: default: d.saveError(&UnmarshalTypeError{"object", v.Type(), int64(d.off)}) d.off-- d.next() // skip over { } in input return } var mapElem reflect.Value keys := map[string]bool{} for { // Read opening " of string key or closing }. op := d.scanWhile(scanSkipSpace) if op == scanEndObject { // closing } - can only happen on first iteration. break } if op != scanBeginLiteral { d.error(errPhase) } // Read key. start := d.off - 1 op = d.scanWhile(scanContinue) item := d.data[start : d.off-1] key, ok := unquote(item) if !ok { d.error(errPhase) } // Check for duplicate keys. _, ok = keys[key] if !ok { keys[key] = true } else { d.error(fmt.Errorf("json: duplicate key '%s' in object", key)) } // Figure out field corresponding to key. var subv reflect.Value destring := false // whether the value is wrapped in a string to be decoded first if v.Kind() == reflect.Map { elemType := v.Type().Elem() if !mapElem.IsValid() { mapElem = reflect.New(elemType).Elem() } else { mapElem.Set(reflect.Zero(elemType)) } subv = mapElem } else { var f *field fields := cachedTypeFields(v.Type()) for i := range fields { ff := &fields[i] if bytes.Equal(ff.nameBytes, []byte(key)) { f = ff break } } if f != nil { subv = v destring = f.quoted for _, i := range f.index { if subv.Kind() == reflect.Ptr { if subv.IsNil() { subv.Set(reflect.New(subv.Type().Elem())) } subv = subv.Elem() } subv = subv.Field(i) } } } // Read : before value. if op == scanSkipSpace { op = d.scanWhile(scanSkipSpace) } if op != scanObjectKey { d.error(errPhase) } // Read value. if destring { switch qv := d.valueQuoted().(type) { case nil: d.literalStore(nullLiteral, subv, false) case string: d.literalStore([]byte(qv), subv, true) default: d.saveError(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal unquoted value into %v", subv.Type())) } } else { d.value(subv) } // Write value back to map; // if using struct, subv points into struct already. if v.Kind() == reflect.Map { kv := reflect.ValueOf(key).Convert(v.Type().Key()) v.SetMapIndex(kv, subv) } // Next token must be , or }. op = d.scanWhile(scanSkipSpace) if op == scanEndObject { break } if op != scanObjectValue { d.error(errPhase) } } } // literal consumes a literal from d.data[d.off-1:], decoding into the value v. // The first byte of the literal has been read already // (that's how the caller knows it's a literal). func (d *decodeState) literal(v reflect.Value) { // All bytes inside literal return scanContinue op code. start := d.off - 1 op := d.scanWhile(scanContinue) // Scan read one byte too far; back up. d.off-- d.scan.undo(op) d.literalStore(d.data[start:d.off], v, false) } // convertNumber converts the number literal s to a float64, int64 or a Number // depending on d.numberDecodeType. func (d *decodeState) convertNumber(s string) (interface{}, error) { switch d.numberType { case UnmarshalJSONNumber: return Number(s), nil case UnmarshalIntOrFloat: v, err := strconv.ParseInt(s, 10, 64) if err == nil { return v, nil } // tries to parse integer number in scientific notation f, err := strconv.ParseFloat(s, 64) if err != nil { return nil, &UnmarshalTypeError{"number " + s, reflect.TypeOf(0.0), int64(d.off)} } // if it has no decimal value use int64 if fi, fd := math.Modf(f); fd == 0.0 { return int64(fi), nil } return f, nil default: f, err := strconv.ParseFloat(s, 64) if err != nil { return nil, &UnmarshalTypeError{"number " + s, reflect.TypeOf(0.0), int64(d.off)} } return f, nil } } var numberType = reflect.TypeOf(Number("")) // literalStore decodes a literal stored in item into v. // // fromQuoted indicates whether this literal came from unwrapping a // string from the ",string" struct tag option. this is used only to // produce more helpful error messages. func (d *decodeState) literalStore(item []byte, v reflect.Value, fromQuoted bool) { // Check for unmarshaler. if len(item) == 0 { //Empty string given d.saveError(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type())) return } wantptr := item[0] == 'n' // null u, ut, pv := d.indirect(v, wantptr) if u != nil { err := u.UnmarshalJSON(item) if err != nil { d.error(err) } return } if ut != nil { if item[0] != '"' { if fromQuoted { d.saveError(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type())) } else { d.saveError(&UnmarshalTypeError{"string", v.Type(), int64(d.off)}) } return } s, ok := unquoteBytes(item) if !ok { if fromQuoted { d.error(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type())) } else { d.error(errPhase) } } err := ut.UnmarshalText(s) if err != nil { d.error(err) } return } v = pv switch c := item[0]; c { case 'n': // null switch v.Kind() { case reflect.Interface, reflect.Ptr, reflect.Map, reflect.Slice: v.Set(reflect.Zero(v.Type())) // otherwise, ignore null for primitives/string } case 't', 'f': // true, false value := c == 't' switch v.Kind() { default: if fromQuoted { d.saveError(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type())) } else { d.saveError(&UnmarshalTypeError{"bool", v.Type(), int64(d.off)}) } case reflect.Bool: v.SetBool(value) case reflect.Interface: if v.NumMethod() == 0 { v.Set(reflect.ValueOf(value)) } else { d.saveError(&UnmarshalTypeError{"bool", v.Type(), int64(d.off)}) } } case '"': // string s, ok := unquoteBytes(item) if !ok { if fromQuoted { d.error(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type())) } else { d.error(errPhase) } } switch v.Kind() { default: d.saveError(&UnmarshalTypeError{"string", v.Type(), int64(d.off)}) case reflect.Slice: if v.Type().Elem().Kind() != reflect.Uint8 { d.saveError(&UnmarshalTypeError{"string", v.Type(), int64(d.off)}) break } b := make([]byte, base64.StdEncoding.DecodedLen(len(s))) n, err := base64.StdEncoding.Decode(b, s) if err != nil { d.saveError(err) break } v.SetBytes(b[:n]) case reflect.String: v.SetString(string(s)) case reflect.Interface: if v.NumMethod() == 0 { v.Set(reflect.ValueOf(string(s))) } else { d.saveError(&UnmarshalTypeError{"string", v.Type(), int64(d.off)}) } } default: // number if c != '-' && (c < '0' || c > '9') { if fromQuoted { d.error(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type())) } else { d.error(errPhase) } } s := string(item) switch v.Kind() { default: if v.Kind() == reflect.String && v.Type() == numberType { v.SetString(s) if !isValidNumber(s) { d.error(fmt.Errorf("json: invalid number literal, trying to unmarshal %q into Number", item)) } break } if fromQuoted { d.error(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type())) } else { d.error(&UnmarshalTypeError{"number", v.Type(), int64(d.off)}) } case reflect.Interface: n, err := d.convertNumber(s) if err != nil { d.saveError(err) break } if v.NumMethod() != 0 { d.saveError(&UnmarshalTypeError{"number", v.Type(), int64(d.off)}) break } v.Set(reflect.ValueOf(n)) case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: n, err := strconv.ParseInt(s, 10, 64) if err != nil || v.OverflowInt(n) { d.saveError(&UnmarshalTypeError{"number " + s, v.Type(), int64(d.off)}) break } v.SetInt(n) case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: n, err := strconv.ParseUint(s, 10, 64) if err != nil || v.OverflowUint(n) { d.saveError(&UnmarshalTypeError{"number " + s, v.Type(), int64(d.off)}) break } v.SetUint(n) case reflect.Float32, reflect.Float64: n, err := strconv.ParseFloat(s, v.Type().Bits()) if err != nil || v.OverflowFloat(n) { d.saveError(&UnmarshalTypeError{"number " + s, v.Type(), int64(d.off)}) break } v.SetFloat(n) } } } // The xxxInterface routines build up a value to be stored // in an empty interface. They are not strictly necessary, // but they avoid the weight of reflection in this common case. // valueInterface is like value but returns interface{} func (d *decodeState) valueInterface() interface{} { switch d.scanWhile(scanSkipSpace) { default: d.error(errPhase) panic("unreachable") case scanBeginArray: return d.arrayInterface() case scanBeginObject: return d.objectInterface() case scanBeginLiteral: return d.literalInterface() } } // arrayInterface is like array but returns []interface{}. func (d *decodeState) arrayInterface() []interface{} { var v = make([]interface{}, 0) for { // Look ahead for ] - can only happen on first iteration. op := d.scanWhile(scanSkipSpace) if op == scanEndArray { break } // Back up so d.value can have the byte we just read. d.off-- d.scan.undo(op) v = append(v, d.valueInterface()) // Next token must be , or ]. op = d.scanWhile(scanSkipSpace) if op == scanEndArray { break } if op != scanArrayValue { d.error(errPhase) } } return v } // objectInterface is like object but returns map[string]interface{}. func (d *decodeState) objectInterface() map[string]interface{} { m := make(map[string]interface{}) keys := map[string]bool{} for { // Read opening " of string key or closing }. op := d.scanWhile(scanSkipSpace) if op == scanEndObject { // closing } - can only happen on first iteration. break } if op != scanBeginLiteral { d.error(errPhase) } // Read string key. start := d.off - 1 op = d.scanWhile(scanContinue) item := d.data[start : d.off-1] key, ok := unquote(item) if !ok { d.error(errPhase) } // Check for duplicate keys. _, ok = keys[key] if !ok { keys[key] = true } else { d.error(fmt.Errorf("json: duplicate key '%s' in object", key)) } // Read : before value. if op == scanSkipSpace { op = d.scanWhile(scanSkipSpace) } if op != scanObjectKey { d.error(errPhase) } // Read value. m[key] = d.valueInterface() // Next token must be , or }. op = d.scanWhile(scanSkipSpace) if op == scanEndObject { break } if op != scanObjectValue { d.error(errPhase) } } return m } // literalInterface is like literal but returns an interface value. func (d *decodeState) literalInterface() interface{} { // All bytes inside literal return scanContinue op code. start := d.off - 1 op := d.scanWhile(scanContinue) // Scan read one byte too far; back up. d.off-- d.scan.undo(op) item := d.data[start:d.off] switch c := item[0]; c { case 'n': // null return nil case 't', 'f': // true, false return c == 't' case '"': // string s, ok := unquote(item) if !ok { d.error(errPhase) } return s default: // number if c != '-' && (c < '0' || c > '9') { d.error(errPhase) } n, err := d.convertNumber(string(item)) if err != nil { d.saveError(err) } return n } } // getu4 decodes \uXXXX from the beginning of s, returning the hex value, // or it returns -1. func getu4(s []byte) rune { if len(s) < 6 || s[0] != '\\' || s[1] != 'u' { return -1 } r, err := strconv.ParseUint(string(s[2:6]), 16, 64) if err != nil { return -1 } return rune(r) } // unquote converts a quoted JSON string literal s into an actual string t. // The rules are different than for Go, so cannot use strconv.Unquote. func unquote(s []byte) (t string, ok bool) { s, ok = unquoteBytes(s) t = string(s) return } func unquoteBytes(s []byte) (t []byte, ok bool) { if len(s) < 2 || s[0] != '"' || s[len(s)-1] != '"' { return } s = s[1 : len(s)-1] // Check for unusual characters. If there are none, // then no unquoting is needed, so return a slice of the // original bytes. r := 0 for r < len(s) { c := s[r] if c == '\\' || c == '"' || c < ' ' { break } if c < utf8.RuneSelf { r++ continue } rr, size := utf8.DecodeRune(s[r:]) if rr == utf8.RuneError && size == 1 { break } r += size } if r == len(s) { return s, true } b := make([]byte, len(s)+2*utf8.UTFMax) w := copy(b, s[0:r]) for r < len(s) { // Out of room? Can only happen if s is full of // malformed UTF-8 and we're replacing each // byte with RuneError. if w >= len(b)-2*utf8.UTFMax { nb := make([]byte, (len(b)+utf8.UTFMax)*2) copy(nb, b[0:w]) b = nb } switch c := s[r]; { case c == '\\': r++ if r >= len(s) { return } switch s[r] { default: return case '"', '\\', '/', '\'': b[w] = s[r] r++ w++ case 'b': b[w] = '\b' r++ w++ case 'f': b[w] = '\f' r++ w++ case 'n': b[w] = '\n' r++ w++ case 'r': b[w] = '\r' r++ w++ case 't': b[w] = '\t' r++ w++ case 'u': r-- rr := getu4(s[r:]) if rr < 0 { return } r += 6 if utf16.IsSurrogate(rr) { rr1 := getu4(s[r:]) if dec := utf16.DecodeRune(rr, rr1); dec != unicode.ReplacementChar { // A valid pair; consume. r += 6 w += utf8.EncodeRune(b[w:], dec) break } // Invalid surrogate; fall back to replacement rune. rr = unicode.ReplacementChar } w += utf8.EncodeRune(b[w:], rr) } // Quote, control characters are invalid. case c == '"', c < ' ': return // ASCII case c < utf8.RuneSelf: b[w] = c r++ w++ // Coerce to well-formed UTF-8. default: rr, size := utf8.DecodeRune(s[r:]) r += size w += utf8.EncodeRune(b[w:], rr) } } return b[0:w], true } ================================================ FILE: vendor/github.com/go-jose/go-jose/v4/json/encode.go ================================================ // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package json implements encoding and decoding of JSON objects as defined in // RFC 4627. The mapping between JSON objects and Go values is described // in the documentation for the Marshal and Unmarshal functions. // // See "JSON and Go" for an introduction to this package: // https://golang.org/doc/articles/json_and_go.html package json import ( "bytes" "encoding" "encoding/base64" "fmt" "math" "reflect" "runtime" "sort" "strconv" "strings" "sync" "unicode" "unicode/utf8" ) // Marshal returns the JSON encoding of v. // // Marshal traverses the value v recursively. // If an encountered value implements the Marshaler interface // and is not a nil pointer, Marshal calls its MarshalJSON method // to produce JSON. If no MarshalJSON method is present but the // value implements encoding.TextMarshaler instead, Marshal calls // its MarshalText method. // The nil pointer exception is not strictly necessary // but mimics a similar, necessary exception in the behavior of // UnmarshalJSON. // // Otherwise, Marshal uses the following type-dependent default encodings: // // Boolean values encode as JSON booleans. // // Floating point, integer, and Number values encode as JSON numbers. // // String values encode as JSON strings coerced to valid UTF-8, // replacing invalid bytes with the Unicode replacement rune. // The angle brackets "<" and ">" are escaped to "\u003c" and "\u003e" // to keep some browsers from misinterpreting JSON output as HTML. // Ampersand "&" is also escaped to "\u0026" for the same reason. // // Array and slice values encode as JSON arrays, except that // []byte encodes as a base64-encoded string, and a nil slice // encodes as the null JSON object. // // Struct values encode as JSON objects. Each exported struct field // becomes a member of the object unless // - the field's tag is "-", or // - the field is empty and its tag specifies the "omitempty" option. // // The empty values are false, 0, any // nil pointer or interface value, and any array, slice, map, or string of // length zero. The object's default key string is the struct field name // but can be specified in the struct field's tag value. The "json" key in // the struct field's tag value is the key name, followed by an optional comma // and options. Examples: // // // Field is ignored by this package. // Field int `json:"-"` // // // Field appears in JSON as key "myName". // Field int `json:"myName"` // // // Field appears in JSON as key "myName" and // // the field is omitted from the object if its value is empty, // // as defined above. // Field int `json:"myName,omitempty"` // // // Field appears in JSON as key "Field" (the default), but // // the field is skipped if empty. // // Note the leading comma. // Field int `json:",omitempty"` // // The "string" option signals that a field is stored as JSON inside a // JSON-encoded string. It applies only to fields of string, floating point, // integer, or boolean types. This extra level of encoding is sometimes used // when communicating with JavaScript programs: // // Int64String int64 `json:",string"` // // The key name will be used if it's a non-empty string consisting of // only Unicode letters, digits, dollar signs, percent signs, hyphens, // underscores and slashes. // // Anonymous struct fields are usually marshaled as if their inner exported fields // were fields in the outer struct, subject to the usual Go visibility rules amended // as described in the next paragraph. // An anonymous struct field with a name given in its JSON tag is treated as // having that name, rather than being anonymous. // An anonymous struct field of interface type is treated the same as having // that type as its name, rather than being anonymous. // // The Go visibility rules for struct fields are amended for JSON when // deciding which field to marshal or unmarshal. If there are // multiple fields at the same level, and that level is the least // nested (and would therefore be the nesting level selected by the // usual Go rules), the following extra rules apply: // // 1) Of those fields, if any are JSON-tagged, only tagged fields are considered, // even if there are multiple untagged fields that would otherwise conflict. // 2) If there is exactly one field (tagged or not according to the first rule), that is selected. // 3) Otherwise there are multiple fields, and all are ignored; no error occurs. // // Handling of anonymous struct fields is new in Go 1.1. // Prior to Go 1.1, anonymous struct fields were ignored. To force ignoring of // an anonymous struct field in both current and earlier versions, give the field // a JSON tag of "-". // // Map values encode as JSON objects. // The map's key type must be string; the map keys are used as JSON object // keys, subject to the UTF-8 coercion described for string values above. // // Pointer values encode as the value pointed to. // A nil pointer encodes as the null JSON object. // // Interface values encode as the value contained in the interface. // A nil interface value encodes as the null JSON object. // // Channel, complex, and function values cannot be encoded in JSON. // Attempting to encode such a value causes Marshal to return // an UnsupportedTypeError. // // JSON cannot represent cyclic data structures and Marshal does not // handle them. Passing cyclic structures to Marshal will result in // an infinite recursion. func Marshal(v interface{}) ([]byte, error) { e := &encodeState{} err := e.marshal(v) if err != nil { return nil, err } return e.Bytes(), nil } // MarshalIndent is like Marshal but applies Indent to format the output. func MarshalIndent(v interface{}, prefix, indent string) ([]byte, error) { b, err := Marshal(v) if err != nil { return nil, err } var buf bytes.Buffer err = Indent(&buf, b, prefix, indent) if err != nil { return nil, err } return buf.Bytes(), nil } // HTMLEscape appends to dst the JSON-encoded src with <, >, &, U+2028 and U+2029 // characters inside string literals changed to \u003c, \u003e, \u0026, \u2028, \u2029 // so that the JSON will be safe to embed inside HTML {{ if .Autoclose -}} {{- end }} ` // Parse the template tmpl, err := template.New("success").Parse(successTemplate) if err != nil { return "", fmt.Errorf("error parsing success template: %w", err) } // Pass autoclose and timeout to the template data := struct { Autoclose bool Timeout int }{ autoclose, timeout, } var htmlPage bytes.Buffer if err := tmpl.Execute(&htmlPage, data); err != nil { return "", fmt.Errorf("error executing template: %w", err) } return htmlPage.String(), nil } const ( // InteractiveSuccessHTML (deprecated) is the page displayed upon success when using a web browser during an interactive Oauth token flow. InteractiveSuccessHTML = ` Sigstore Authentication
sigstore authentication successful!
You may now close this page.
` ) ================================================ FILE: vendor/github.com/sigstore/sigstore/pkg/oauthflow/client_credentials.go ================================================ // // Copyright 2024 The Sigstore Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package oauthflow import ( "context" "encoding/json" "fmt" "io" "net/http" "net/url" "strings" "time" "github.com/coreos/go-oidc/v3/oidc" "golang.org/x/oauth2" ) // CodeURL fetches the client credentials token authorization endpoint URL from the provider's well-known configuration endpoint func (d *DefaultFlowClientCredentials) CodeURL() (string, error) { if d.codeURL != "" { return d.codeURL, nil } wellKnown := strings.TrimSuffix(d.Issuer, "/") + "/.well-known/openid-configuration" /* #nosec */ httpClient := &http.Client{ Timeout: 3 * time.Second, } resp, err := httpClient.Get(wellKnown) if err != nil { return "", err } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { return "", fmt.Errorf("unable to read response body: %w", err) } if resp.StatusCode != http.StatusOK { return "", fmt.Errorf("%s: %s", resp.Status, body) } providerConfig := struct { Issuer string `json:"issuer"` TokenEndpoint string `json:"token_endpoint"` }{} if err = json.Unmarshal(body, &providerConfig); err != nil { return "", fmt.Errorf("oidc: failed to decode provider discovery object: %w", err) } if d.Issuer != providerConfig.Issuer { return "", fmt.Errorf("oidc: issuer did not match the issuer returned by provider, expected %q got %q", d.Issuer, providerConfig.Issuer) } if providerConfig.TokenEndpoint == "" { return "", fmt.Errorf("oidc: client credentials token authorization endpoint not returned by provider") } d.codeURL = providerConfig.TokenEndpoint return d.codeURL, nil } // DefaultFlowClientCredentials fetches an OIDC Identity token using the Client Credentials Grant flow as specified in RFC8628 type DefaultFlowClientCredentials struct { Issuer string codeURL string } // NewClientCredentialsFlow creates a new DefaultFlowClientCredentials that retrieves an OIDC Identity Token using a Client Credentials Grant func NewClientCredentialsFlow(issuer string) *DefaultFlowClientCredentials { return &DefaultFlowClientCredentials{ Issuer: issuer, } } func (d *DefaultFlowClientCredentials) clientCredentialsFlow(_ *oidc.Provider, clientID, clientSecret, redirectURL string) (string, error) { data := url.Values{ "client_id": []string{clientID}, "client_secret": []string{clientSecret}, "scope": []string{"openid email"}, "grant_type": []string{"client_credentials"}, } if redirectURL != "" { // If a redirect uri is provided then use it data["redirect_uri"] = []string{redirectURL} } codeURL, err := d.CodeURL() if err != nil { return "", err } /* #nosec */ resp, err := http.PostForm(codeURL, data) if err != nil { return "", err } defer resp.Body.Close() b, err := io.ReadAll(resp.Body) if err != nil { return "", err } if resp.StatusCode != http.StatusOK { return "", fmt.Errorf("%s: %s", resp.Status, b) } tr := tokenResp{} if err := json.Unmarshal(b, &tr); err != nil { return "", err } if tr.IDToken != "" { fmt.Println("Token received!") return tr.IDToken, nil } return "", fmt.Errorf("unexpected error in client flow: %s", tr.Error) } // GetIDToken gets an OIDC ID Token from the specified provider using the Client Credentials Grant flow func (d *DefaultFlowClientCredentials) GetIDToken(p *oidc.Provider, cfg oauth2.Config) (*OIDCIDToken, error) { idToken, err := d.clientCredentialsFlow(p, cfg.ClientID, cfg.ClientSecret, cfg.RedirectURL) if err != nil { return nil, err } verifier := p.Verifier(&oidc.Config{ClientID: cfg.ClientID}) parsedIDToken, err := verifier.Verify(context.Background(), idToken) if err != nil { return nil, err } subj, err := SubjectFromToken(parsedIDToken) if err != nil { return nil, err } return &OIDCIDToken{ RawString: idToken, Subject: subj, }, nil } ================================================ FILE: vendor/github.com/sigstore/sigstore/pkg/oauthflow/device.go ================================================ // // Copyright 2021 The Sigstore Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Package oauthflow implements OAuth/OIDC support for device and token flows package oauthflow import ( "context" "encoding/json" "fmt" "io" "net/http" "net/url" "strings" "time" "github.com/coreos/go-oidc/v3/oidc" "golang.org/x/oauth2" ) const ( // SigstoreDeviceURL specifies the Device Code endpoint for the public good Sigstore service /* #nosec */ // Deprecated: this constant (while correct) should not be used SigstoreDeviceURL = "https://oauth2.sigstore.dev/auth/device/code" // SigstoreTokenURL specifies the Token endpoint for the public good Sigstore service /* #nosec */ // Deprecated: this constant (while correct) should not be used SigstoreTokenURL = "https://oauth2.sigstore.dev/auth/device/token" ) type deviceResp struct { DeviceCode string `json:"device_code"` UserCode string `json:"user_code"` VerificationURI string `json:"verification_uri"` VerificationURIComplete string `json:"verification_uri_complete"` Interval int `json:"interval"` ExpiresIn int `json:"expires_in"` } type tokenResp struct { IDToken string `json:"id_token"` Error string `json:"error"` } // DeviceFlowTokenGetter fetches an OIDC Identity token using the Device Code Grant flow as specified in RFC8628 type DeviceFlowTokenGetter struct { MessagePrinter func(string) Sleeper func(time.Duration) Issuer string codeURL string } // NewDeviceFlowTokenGetter creates a new DeviceFlowTokenGetter that retrieves an OIDC Identity Token using a Device Code Grant // Deprecated: NewDeviceFlowTokenGetter is deprecated; use NewDeviceFlowTokenGetterForIssuer() instead func NewDeviceFlowTokenGetter(issuer, codeURL, _ string) *DeviceFlowTokenGetter { return &DeviceFlowTokenGetter{ MessagePrinter: func(s string) { fmt.Println(s) }, Sleeper: time.Sleep, Issuer: issuer, codeURL: codeURL, } } // NewDeviceFlowTokenGetterForIssuer creates a new DeviceFlowTokenGetter that retrieves an OIDC Identity Token using a Device Code Grant func NewDeviceFlowTokenGetterForIssuer(issuer string) *DeviceFlowTokenGetter { return &DeviceFlowTokenGetter{ MessagePrinter: func(s string) { fmt.Println(s) }, Sleeper: time.Sleep, Issuer: issuer, } } func (d *DeviceFlowTokenGetter) deviceFlow(p *oidc.Provider, clientID, redirectURL string) (string, error) { // require that OIDC provider support PKCE to provide sufficient security for the CLI pkce, err := NewPKCE(p) if err != nil { return "", err } data := url.Values{ "client_id": []string{clientID}, "scope": []string{"openid email"}, "code_challenge_method": []string{pkce.Method}, "code_challenge": []string{pkce.Challenge}, } if redirectURL != "" { // If a redirect uri is provided then use it data["redirect_uri"] = []string{redirectURL} } codeURL, err := d.CodeURL() if err != nil { return "", err } /* #nosec */ resp, err := http.PostForm(codeURL, data) if err != nil { return "", err } defer resp.Body.Close() b, err := io.ReadAll(resp.Body) if err != nil { return "", err } if resp.StatusCode != http.StatusOK { return "", fmt.Errorf("%s: %s", resp.Status, b) } parsed := deviceResp{} if err := json.Unmarshal(b, &parsed); err != nil { return "", err } uri := parsed.VerificationURIComplete if uri == "" { uri = parsed.VerificationURI } d.MessagePrinter(fmt.Sprintf("Enter the verification code %s in your browser at: %s", parsed.UserCode, uri)) d.MessagePrinter(fmt.Sprintf("Code will be valid for %d seconds", parsed.ExpiresIn)) for { // Some providers use a secret here, we don't need for sigstore oauth one so leave it off. data := url.Values{ "grant_type": []string{"urn:ietf:params:oauth:grant-type:device_code"}, "client_id": []string{clientID}, "device_code": []string{parsed.DeviceCode}, "scope": []string{"openid email"}, "code_verifier": []string{pkce.Value}, } /* #nosec */ resp, err := http.PostForm(p.Endpoint().TokenURL, data) if err != nil { return "", err } defer resp.Body.Close() b, err := io.ReadAll(resp.Body) if err != nil { return "", err } tr := tokenResp{} if err := json.Unmarshal(b, &tr); err != nil { return "", err } if tr.IDToken != "" { d.MessagePrinter("Token received!") return tr.IDToken, nil } switch tr.Error { case "access_denied", "expired_token": return "", fmt.Errorf("error obtaining token: %s", tr.Error) case "authorization_pending": d.Sleeper(time.Duration(parsed.Interval) * time.Second) case "slow_down": // Add ten seconds if we got told to slow down d.Sleeper(time.Duration(parsed.Interval)*time.Second + 10*time.Second) default: return "", fmt.Errorf("unexpected error in device flow: %s", tr.Error) } } } // GetIDToken gets an OIDC ID Token from the specified provider using the device code grant flow func (d *DeviceFlowTokenGetter) GetIDToken(p *oidc.Provider, cfg oauth2.Config) (*OIDCIDToken, error) { idToken, err := d.deviceFlow(p, cfg.ClientID, cfg.RedirectURL) if err != nil { return nil, err } verifier := p.Verifier(&oidc.Config{ClientID: cfg.ClientID}) parsedIDToken, err := verifier.Verify(context.Background(), idToken) if err != nil { return nil, err } subj, err := SubjectFromToken(parsedIDToken) if err != nil { return nil, err } return &OIDCIDToken{ RawString: idToken, Subject: subj, }, nil } // CodeURL fetches the device authorization endpoint URL from the provider's well-known configuration endpoint func (d *DeviceFlowTokenGetter) CodeURL() (string, error) { if d.codeURL != "" { return d.codeURL, nil } wellKnown := strings.TrimSuffix(d.Issuer, "/") + "/.well-known/openid-configuration" /* #nosec */ httpClient := &http.Client{ Timeout: 3 * time.Second, } resp, err := httpClient.Get(wellKnown) if err != nil { return "", err } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { return "", fmt.Errorf("unable to read response body: %w", err) } if resp.StatusCode != http.StatusOK { return "", fmt.Errorf("%s: %s", resp.Status, body) } providerConfig := struct { Issuer string `json:"issuer"` DeviceEndpoint string `json:"device_authorization_endpoint"` }{} if err = json.Unmarshal(body, &providerConfig); err != nil { return "", fmt.Errorf("oidc: failed to decode provider discovery object: %w", err) } if d.Issuer != providerConfig.Issuer { return "", fmt.Errorf("oidc: issuer did not match the issuer returned by provider, expected %q got %q", d.Issuer, providerConfig.Issuer) } if providerConfig.DeviceEndpoint == "" { return "", fmt.Errorf("oidc: device authorization endpoint not returned by provider") } d.codeURL = providerConfig.DeviceEndpoint return d.codeURL, nil } ================================================ FILE: vendor/github.com/sigstore/sigstore/pkg/oauthflow/doc.go ================================================ // // Copyright 2022 The Sigstore Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Package oauthflow contains utilities to obtain OAuth2/OIDC tokens. package oauthflow ================================================ FILE: vendor/github.com/sigstore/sigstore/pkg/oauthflow/flow.go ================================================ // // Copyright 2021 The Sigstore Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package oauthflow import ( "context" "encoding/json" "errors" "log" "github.com/coreos/go-oidc/v3/oidc" "github.com/go-jose/go-jose/v4" soauth "github.com/sigstore/sigstore/pkg/oauth" "golang.org/x/oauth2" ) const ( // PublicInstanceGithubAuthSubURL Default connector ids used by `oauth2.sigstore.dev` for Github PublicInstanceGithubAuthSubURL = "https://github.com/login/oauth" // PublicInstanceGoogleAuthSubURL Default connector ids used by `oauth2.sigstore.dev` for Google PublicInstanceGoogleAuthSubURL = "https://accounts.google.com" // PublicInstanceMicrosoftAuthSubURL Default connector ids used by `oauth2.sigstore.dev` for Microsoft PublicInstanceMicrosoftAuthSubURL = "https://login.microsoftonline.com" ) // TokenGetter provides a way to get an OIDC ID Token from an OIDC IdP type TokenGetter interface { GetIDToken(provider *oidc.Provider, config oauth2.Config) (*OIDCIDToken, error) } // OIDCIDToken represents an OIDC Identity Token type OIDCIDToken struct { RawString string // RawString provides the raw token (a base64-encoded JWT) value Subject string // Subject is the extracted subject from the raw token } // init func init() { // set the default HTML page for the DefaultIDTokenGetter htmlPage, err := soauth.GetInteractiveSuccessHTML(false, 10) if err != nil { log.Print("failed to get interactive success html, defaulting to original static page") } else { DefaultIDTokenGetter.HTMLPage = htmlPage } } // ConnectorIDOpt requests the value of prov as a the connector_id (either on URL or in form body) on the initial request; // this is used by Dex func ConnectorIDOpt(prov string) oauth2.AuthCodeOption { return oauth2.SetAuthURLParam("connector_id", prov) } // DefaultIDTokenGetter is the default implementation. // The HTML page and message printed to the terminal can be customized. var DefaultIDTokenGetter = &InteractiveIDTokenGetter{ HTMLPage: soauth.InteractiveSuccessHTML, } // PublicInstanceGithubIDTokenGetter is a `oauth2.sigstore.dev` flow selecting github as an Idp // Flow is based on `DefaultIDTokenGetter` fields var PublicInstanceGithubIDTokenGetter = &InteractiveIDTokenGetter{ HTMLPage: DefaultIDTokenGetter.HTMLPage, ExtraAuthURLParams: []oauth2.AuthCodeOption{ConnectorIDOpt(PublicInstanceGithubAuthSubURL)}, } // PublicInstanceGoogleIDTokenGetter is a `oauth2.sigstore.dev` flow selecting github as an Idp // Flow is based on `DefaultIDTokenGetter` fields var PublicInstanceGoogleIDTokenGetter = &InteractiveIDTokenGetter{ HTMLPage: DefaultIDTokenGetter.HTMLPage, ExtraAuthURLParams: []oauth2.AuthCodeOption{ConnectorIDOpt(PublicInstanceGoogleAuthSubURL)}, } // PublicInstanceMicrosoftIDTokenGetter is a `oauth2.sigstore.dev` flow selecting microsoft as an Idp // Flow is based on `DefaultIDTokenGetter` fields var PublicInstanceMicrosoftIDTokenGetter = &InteractiveIDTokenGetter{ HTMLPage: DefaultIDTokenGetter.HTMLPage, ExtraAuthURLParams: []oauth2.AuthCodeOption{ConnectorIDOpt(PublicInstanceMicrosoftAuthSubURL)}, } // OIDConnect requests an OIDC Identity Token from the specified issuer using the specified client credentials and TokenGetter // NOTE: If the redirectURL is empty a listener on localhost:0 is configured with '/auth/callback' as default path. func OIDConnect(issuer, id, secret, redirectURL string, tg TokenGetter) (*OIDCIDToken, error) { // Check if it's a StaticTokenGetter since NewProvider below will make // network calls unnecessarily and they are ignored. if sg, ok := tg.(*StaticTokenGetter); ok { return sg.GetIDToken(nil, oauth2.Config{}) } provider, err := oidc.NewProvider(context.Background(), issuer) if err != nil { return nil, err } config := oauth2.Config{ ClientID: id, ClientSecret: secret, Endpoint: provider.Endpoint(), Scopes: []string{oidc.ScopeOpenID, "email"}, RedirectURL: redirectURL, } return tg.GetIDToken(provider, config) } type stringAsBool bool func (sb *stringAsBool) UnmarshalJSON(b []byte) error { switch string(b) { case "true", `"true"`, "True", `"True"`: *sb = true case "false", `"false"`, "False", `"False"`: *sb = false default: return errors.New("invalid value for boolean") } return nil } type claims struct { Email string `json:"email"` Verified stringAsBool `json:"email_verified"` Subject string `json:"sub"` } // SubjectFromToken extracts the subject claim from an OIDC Identity Token func SubjectFromToken(tok *oidc.IDToken) (string, error) { claims := claims{} if err := tok.Claims(&claims); err != nil { return "", err } return subjectFromClaims(claims) } // SubjectFromUnverifiedToken extracts the subject claim from the raw bytes of // an OIDC identity token. func SubjectFromUnverifiedToken(tok []byte) (string, error) { claims := claims{} if err := json.Unmarshal(tok, &claims); err != nil { return "", err } return subjectFromClaims(claims) } func subjectFromClaims(c claims) (string, error) { if c.Email != "" { if !c.Verified { return "", errors.New("not verified by identity provider") } return c.Email, nil } if c.Subject == "" { return "", errors.New("no subject found in claims") } return c.Subject, nil } // StaticTokenGetter is a token getter that works on a JWT that is already known type StaticTokenGetter struct { RawToken string } // https://datatracker.ietf.org/doc/html/rfc7518#section-3.1 var allowedSignatureAlgorithms = []jose.SignatureAlgorithm{ jose.ES256, jose.ES384, jose.ES512, jose.RS256, jose.RS384, jose.RS512, jose.PS256, jose.PS384, jose.PS512, jose.EdDSA, jose.HS256, jose.HS384, jose.HS512, } // GetIDToken extracts an OIDCIDToken from the raw token *without verification* func (stg *StaticTokenGetter) GetIDToken(_ *oidc.Provider, _ oauth2.Config) (*OIDCIDToken, error) { unsafeTok, err := jose.ParseSigned(stg.RawToken, allowedSignatureAlgorithms) if err != nil { return nil, err } // THIS LOGIC IS GENERALLY UNSAFE BUT OK HERE // We are only parsing the id-token passed directly to a command line tool by a user, so it is trusted locally. // We need to extract the email address to attach an additional signed proof to the server. // THE SERVER WILL DO REAL VERIFICATION HERE unsafePayload := unsafeTok.UnsafePayloadWithoutVerification() claims := claims{} if err := json.Unmarshal(unsafePayload, &claims); err != nil { return nil, err } subj, err := subjectFromClaims(claims) if err != nil { return nil, err } return &OIDCIDToken{ RawString: stg.RawToken, Subject: subj, }, nil } ================================================ FILE: vendor/github.com/sigstore/sigstore/pkg/oauthflow/interactive.go ================================================ // // Copyright 2021 The Sigstore Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package oauthflow import ( "context" "errors" "fmt" "io" "net" "net/http" "net/url" "os" "time" "github.com/coreos/go-oidc/v3/oidc" "github.com/pkg/browser" "github.com/sigstore/sigstore/pkg/cryptoutils" "golang.org/x/oauth2" ) const oobRedirectURI = "urn:ietf:wg:oauth:2.0:oob" var browserOpener = browser.OpenURL // InteractiveIDTokenGetter is a type to get ID tokens for oauth flows type InteractiveIDTokenGetter struct { HTMLPage string ExtraAuthURLParams []oauth2.AuthCodeOption Input io.Reader Output io.Writer } // GetIDToken gets an OIDC ID Token from the specified provider using an interactive browser session func (i *InteractiveIDTokenGetter) GetIDToken(p *oidc.Provider, cfg oauth2.Config) (*OIDCIDToken, error) { // generate random fields and save them for comparison after OAuth2 dance stateToken := cryptoutils.GenerateRandomURLSafeString(128) nonce := cryptoutils.GenerateRandomURLSafeString(128) doneCh := make(chan string) errCh := make(chan error) // starts listener using the redirect_uri, otherwise starts on ephemeral port redirectServer, redirectURL, err := startRedirectListener(stateToken, i.HTMLPage, cfg.RedirectURL, doneCh, errCh) if err != nil { return nil, fmt.Errorf("starting redirect listener: %w", err) } defer func() { go func() { _ = redirectServer.Shutdown(context.Background()) }() }() cfg.RedirectURL = redirectURL.String() // require that OIDC provider support PKCE to provide sufficient security for the CLI pkce, err := NewPKCE(p) if err != nil { return nil, err } opts := append(pkce.AuthURLOpts(), oauth2.AccessTypeOnline, oidc.Nonce(nonce)) if len(i.ExtraAuthURLParams) > 0 { opts = append(opts, i.ExtraAuthURLParams...) } authCodeURL := cfg.AuthCodeURL(stateToken, opts...) var code string if err := browserOpener(authCodeURL); err != nil { // Swap to the out of band flow if we can't open the browser fmt.Fprintf(i.GetOutput(), "error opening browser: %v\n", err) code = i.doOobFlow(&cfg, stateToken, opts) } else { fmt.Fprintf(i.GetOutput(), "Your browser will now be opened to:\n%s\n", authCodeURL) code, err = getCode(doneCh, errCh) if err != nil { fmt.Fprintf(i.GetOutput(), "error getting code from local server: %v\n", err) code = i.doOobFlow(&cfg, stateToken, opts) } } token, err := cfg.Exchange(context.Background(), code, append(pkce.TokenURLOpts(), oidc.Nonce(nonce))...) if err != nil { return nil, err } // requesting 'openid' scope should ensure an id_token is given when exchanging the code for an access token idToken, ok := token.Extra("id_token").(string) if !ok { return nil, errors.New("id_token not present") } // verify nonce, client ID, access token hash before using it verifier := p.Verifier(&oidc.Config{ClientID: cfg.ClientID}) parsedIDToken, err := verifier.Verify(context.Background(), idToken) if err != nil { return nil, err } if parsedIDToken.Nonce != nonce { return nil, errors.New("nonce does not match value sent") } if parsedIDToken.AccessTokenHash != "" { if err := parsedIDToken.VerifyAccessToken(token.AccessToken); err != nil { return nil, err } } email, err := SubjectFromToken(parsedIDToken) if err != nil { return nil, err } returnToken := OIDCIDToken{ RawString: idToken, Subject: email, } return &returnToken, nil } func (i *InteractiveIDTokenGetter) doOobFlow(cfg *oauth2.Config, stateToken string, opts []oauth2.AuthCodeOption) string { cfg.RedirectURL = oobRedirectURI authURL := cfg.AuthCodeURL(stateToken, opts...) fmt.Fprintln(i.GetOutput(), "Go to the following link in a browser:\n\n\t", authURL) fmt.Fprintf(i.GetOutput(), "Enter verification code: ") var code string _, _ = fmt.Fscanf(i.GetInput(), "%s", &code) // New line in case read input doesn't move cursor to next line. fmt.Fprintln(i.GetOutput()) return code } // GetInput returns the input reader for the token getter. If one is not set, // it defaults to stdin. func (i *InteractiveIDTokenGetter) GetInput() io.Reader { if i.Input == nil { return os.Stdin } return i.Input } // GetOutput returns the output writer for the token getter. If one is not set, // it defaults to stderr. func (i *InteractiveIDTokenGetter) GetOutput() io.Writer { if i.Output == nil { return os.Stderr } return i.Output } func startRedirectListener(state, htmlPage, redirectURL string, doneCh chan string, errCh chan error) (*http.Server, *url.URL, error) { var listener net.Listener var urlListener *url.URL var err error if redirectURL == "" { listener, err = net.Listen("tcp", "localhost:0") if err != nil { return nil, nil, err } addr, ok := listener.Addr().(*net.TCPAddr) if !ok { return nil, nil, fmt.Errorf("listener addr is not TCPAddr") } urlListener = &url.URL{ Scheme: "http", Host: fmt.Sprintf("localhost:%d", addr.Port), Path: "/auth/callback", } } else { urlListener, err = url.Parse(redirectURL) if err != nil { return nil, nil, err } listener, err = net.Listen("tcp", urlListener.Host) if err != nil { return nil, nil, err } } m := http.NewServeMux() s := &http.Server{ Addr: urlListener.Host, Handler: m, // an arbitrary reasonable value to fix gosec lint error ReadHeaderTimeout: 2 * time.Second, } m.HandleFunc(urlListener.Path, func(w http.ResponseWriter, r *http.Request) { // even though these are fetched from the FormValue method, // these are supplied as query parameters if r.FormValue("state") != state { errCh <- errors.New("invalid state token") return } doneCh <- r.FormValue("code") fmt.Fprint(w, htmlPage) }) go func() { if err := s.Serve(listener); err != nil && err != http.ErrServerClosed { errCh <- err } }() return s, urlListener, nil } func getCode(doneCh chan string, errCh chan error) (string, error) { timeoutCh := time.NewTimer(120 * time.Second) select { case code := <-doneCh: return code, nil case err := <-errCh: return "", err case <-timeoutCh.C: return "", errors.New("timeout") } } ================================================ FILE: vendor/github.com/sigstore/sigstore/pkg/oauthflow/pkce.go ================================================ // // Copyright 2021 The Sigstore Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package oauthflow import ( "crypto/sha256" "encoding/base64" "fmt" "regexp" "github.com/coreos/go-oidc/v3/oidc" "github.com/sigstore/sigstore/pkg/cryptoutils" "golang.org/x/oauth2" ) const ( // PKCES256 is the SHA256 option required by the PKCE RFC PKCES256 = "S256" ) // PKCE specifies the challenge and value pair required to fulfill RFC7636 type PKCE struct { Challenge string Method string Value string } // NewPKCE creates a new PKCE challenge for the specified provider per its supported methods (obtained through OIDC discovery endpoint) func NewPKCE(provider *oidc.Provider) (*PKCE, error) { var providerClaims struct { CodeChallengeMethodsSupported []string `json:"code_challenge_methods_supported"` } if err := provider.Claims(&providerClaims); err != nil { // will only error out if the JSON was malformed, which shouldn't happen at this point return nil, err } var chosenMethod string for _, method := range providerClaims.CodeChallengeMethodsSupported { // per RFC7636, any server that supports PKCE must support S256 if method == PKCES256 && chosenMethod != PKCES256 { chosenMethod = PKCES256 break } else if method != "plain" { fmt.Printf("Unsupported code challenge method in list: '%v'", method) } } if chosenMethod == "" { if providerIsAzureBacked(provider) { chosenMethod = PKCES256 } else { return nil, fmt.Errorf("PKCE is not supported by OIDC provider '%v'", provider.Endpoint().AuthURL) } } // The value must meet requirements of RFC 7636: // (minimum length of 43 characters and a maximum length of 128 characters) // 384 bits of entropy (48 bytes) to be encoded in base64 URL-safe without padding yields 64 characters. value := cryptoutils.GenerateRandomURLSafeString(384) h := sha256.New() _, _ = h.Write([]byte(value)) challenge := base64.RawURLEncoding.EncodeToString(h.Sum(nil)) return &PKCE{ Challenge: challenge, Method: chosenMethod, Value: value, }, nil } // AuthURLOpts returns the set of request parameters required during the initial exchange of the OAuth2 flow func (p *PKCE) AuthURLOpts() []oauth2.AuthCodeOption { return []oauth2.AuthCodeOption{ oauth2.SetAuthURLParam("code_challenge_method", p.Method), oauth2.SetAuthURLParam("code_challenge", p.Challenge), } } // TokenURLOpts returns the set of request parameters required during the token request exchange flow func (p *PKCE) TokenURLOpts() []oauth2.AuthCodeOption { return []oauth2.AuthCodeOption{ oauth2.SetAuthURLParam("code_verifier", p.Value), } } var azureregex = regexp.MustCompile(`^https:\/\/login\.microsoftonline\.(com|us)\/`) // providerIsAzureBacked returns a boolean indicating whether the provider is Azure-backed; // Azure supports PKCE but does not advertise it in their OIDC discovery endpoint func providerIsAzureBacked(p *oidc.Provider) bool { // Per https://docs.microsoft.com/en-us/azure/active-directory/develop/authentication-national-cloud#azure-ad-authentication-endpoints // if endpoint starts with any of these strings then we should attempt PKCE anyway as their OIDC discovery doc // does not advertise supporting PKCE but they actually do return p != nil && azureregex.MatchString(p.Endpoint().AuthURL) } ================================================ FILE: vendor/github.com/sigstore/sigstore/pkg/signature/algorithm_registry.go ================================================ // // Copyright 2024 The Sigstore Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package signature import ( "crypto" "crypto/ecdsa" "crypto/ed25519" "crypto/elliptic" "crypto/rsa" "errors" "fmt" v1 "github.com/sigstore/protobuf-specs/gen/pb-go/common/v1" ) // PublicKeyType represents the public key algorithm for a given signature algorithm. type PublicKeyType uint const ( // RSA public key RSA PublicKeyType = iota // ECDSA public key ECDSA // ED25519 public key ED25519 ) // RSAKeySize represents the size of an RSA public key in bits. type RSAKeySize int // AlgorithmDetails exposes relevant information for a given signature algorithm. type AlgorithmDetails struct { // knownAlgorithm is the signature algorithm that the following details refer to. knownAlgorithm v1.PublicKeyDetails // keyType is the public key algorithm being used. keyType PublicKeyType // hashType is the hash algorithm being used. hashType crypto.Hash // protoHashType is the hash algorithm being used as a proto message, it must be the protobuf-specs // v1.HashAlgorithm equivalent of the hashType. protoHashType v1.HashAlgorithm // extraKeyParams contains any extra parameters required to check a given public key against this entry. // // The underlying type of these parameters is dependent on the keyType. // For example, ECDSA algorithms will store an elliptic curve here whereas, RSA keys will store the key size. // Algorithms that don't require any extra parameters leave this set to nil. extraKeyParams interface{} // flagValue is a string representation of the signature algorithm that follows the naming conventions of CLI // arguments that are used for Sigstore services. flagValue string } // GetSignatureAlgorithm returns the PublicKeyDetails associated with the algorithm details. func (a AlgorithmDetails) GetSignatureAlgorithm() v1.PublicKeyDetails { return a.knownAlgorithm } // GetKeyType returns the PublicKeyType for the algorithm details. func (a AlgorithmDetails) GetKeyType() PublicKeyType { return a.keyType } // GetHashType returns the hash algorithm that should be used with this algorithm. func (a AlgorithmDetails) GetHashType() crypto.Hash { return a.hashType } // GetProtoHashType is a convenience method to get the protobuf-specs type of the hash algorithm. func (a AlgorithmDetails) GetProtoHashType() v1.HashAlgorithm { return a.protoHashType } // GetRSAKeySize returns the RSA key size for the algorithm details, if the key type is RSA. func (a AlgorithmDetails) GetRSAKeySize() (RSAKeySize, error) { if a.keyType != RSA { return 0, fmt.Errorf("unable to retrieve RSA key size for key type: %T", a.keyType) } rsaKeySize, ok := a.extraKeyParams.(RSAKeySize) if !ok { // This should be unreachable. return 0, fmt.Errorf("unable to retrieve key size for RSA, malformed algorithm details?: %T", a.keyType) } return rsaKeySize, nil } // GetECDSACurve returns the elliptic curve for the algorithm details, if the key type is ECDSA. func (a AlgorithmDetails) GetECDSACurve() (*elliptic.Curve, error) { if a.keyType != ECDSA { return nil, fmt.Errorf("unable to retrieve ECDSA curve for key type: %T", a.keyType) } ecdsaCurve, ok := a.extraKeyParams.(elliptic.Curve) if !ok { // This should be unreachable. return nil, fmt.Errorf("unable to retrieve curve for ECDSA, malformed algorithm details?: %T", a.keyType) } return &ecdsaCurve, nil } func (a AlgorithmDetails) checkKey(pubKey crypto.PublicKey) (bool, error) { switch a.keyType { case RSA: rsaKey, ok := pubKey.(*rsa.PublicKey) if !ok { return false, nil } keySize, err := a.GetRSAKeySize() if err != nil { return false, err } return rsaKey.Size()*8 == int(keySize), nil case ECDSA: ecdsaKey, ok := pubKey.(*ecdsa.PublicKey) if !ok { return false, nil } curve, err := a.GetECDSACurve() if err != nil { return false, err } return ecdsaKey.Curve == *curve, nil case ED25519: _, ok := pubKey.(ed25519.PublicKey) return ok, nil } return false, fmt.Errorf("unrecognized key type: %T", a.keyType) } func (a AlgorithmDetails) checkHash(hashType crypto.Hash) bool { return a.hashType == hashType } // Note that deprecated options in PublicKeyDetails are not included in this // list, including PKCS1v1.5 encoded RSA. Refer to the v1.PublicKeyDetails enum // for more details. var supportedAlgorithms = []AlgorithmDetails{ {v1.PublicKeyDetails_PKIX_RSA_PKCS1V15_2048_SHA256, RSA, crypto.SHA256, v1.HashAlgorithm_SHA2_256, RSAKeySize(2048), "rsa-sign-pkcs1-2048-sha256"}, {v1.PublicKeyDetails_PKIX_RSA_PKCS1V15_3072_SHA256, RSA, crypto.SHA256, v1.HashAlgorithm_SHA2_256, RSAKeySize(3072), "rsa-sign-pkcs1-3072-sha256"}, {v1.PublicKeyDetails_PKIX_RSA_PKCS1V15_4096_SHA256, RSA, crypto.SHA256, v1.HashAlgorithm_SHA2_256, RSAKeySize(4096), "rsa-sign-pkcs1-4096-sha256"}, {v1.PublicKeyDetails_PKIX_RSA_PSS_2048_SHA256, RSA, crypto.SHA256, v1.HashAlgorithm_SHA2_256, RSAKeySize(2048), "rsa-sign-pss-2048-sha256"}, {v1.PublicKeyDetails_PKIX_RSA_PSS_3072_SHA256, RSA, crypto.SHA256, v1.HashAlgorithm_SHA2_256, RSAKeySize(3072), "rsa-sign-pss-3072-sha256"}, {v1.PublicKeyDetails_PKIX_RSA_PSS_4096_SHA256, RSA, crypto.SHA256, v1.HashAlgorithm_SHA2_256, RSAKeySize(4096), "rsa-sign-pss-4092-sha256"}, {v1.PublicKeyDetails_PKIX_ECDSA_P256_SHA_256, ECDSA, crypto.SHA256, v1.HashAlgorithm_SHA2_256, elliptic.P256(), "ecdsa-sha2-256-nistp256"}, {v1.PublicKeyDetails_PKIX_ECDSA_P384_SHA_384, ECDSA, crypto.SHA384, v1.HashAlgorithm_SHA2_384, elliptic.P384(), "ecdsa-sha2-384-nistp384"}, {v1.PublicKeyDetails_PKIX_ECDSA_P384_SHA_256, ECDSA, crypto.SHA256, v1.HashAlgorithm_SHA2_256, elliptic.P384(), "ecdsa-sha2-256-nistp384"}, //nolint:staticcheck {v1.PublicKeyDetails_PKIX_ECDSA_P521_SHA_512, ECDSA, crypto.SHA512, v1.HashAlgorithm_SHA2_512, elliptic.P521(), "ecdsa-sha2-512-nistp521"}, {v1.PublicKeyDetails_PKIX_ECDSA_P521_SHA_256, ECDSA, crypto.SHA256, v1.HashAlgorithm_SHA2_256, elliptic.P521(), "ecdsa-sha2-256-nistp521"}, //nolint:staticcheck {v1.PublicKeyDetails_PKIX_ED25519, ED25519, crypto.Hash(0), v1.HashAlgorithm_HASH_ALGORITHM_UNSPECIFIED, nil, "ed25519"}, {v1.PublicKeyDetails_PKIX_ED25519_PH, ED25519, crypto.SHA512, v1.HashAlgorithm_SHA2_512, nil, "ed25519-ph"}, } // AlgorithmRegistryConfig represents a set of permitted algorithms for a given Sigstore service or component. // // Individual services may wish to restrict what algorithms are allowed to a subset of what is covered in the algorithm // registry (represented by v1.PublicKeyDetails). type AlgorithmRegistryConfig struct { permittedAlgorithms []AlgorithmDetails } // GetAlgorithmDetails retrieves a set of details for a given v1.PublicKeyDetails flag that allows users to // introspect the public key algorithm, hash algorithm and more. func GetAlgorithmDetails(knownSignatureAlgorithm v1.PublicKeyDetails) (AlgorithmDetails, error) { for _, detail := range supportedAlgorithms { if detail.knownAlgorithm == knownSignatureAlgorithm { return detail, nil } } return AlgorithmDetails{}, fmt.Errorf("could not find algorithm details for known signature algorithm: %s", knownSignatureAlgorithm) } // NewAlgorithmRegistryConfig creates a new AlgorithmRegistryConfig for a set of permitted signature algorithms. func NewAlgorithmRegistryConfig(algorithmConfig []v1.PublicKeyDetails) (*AlgorithmRegistryConfig, error) { permittedAlgorithms := make([]AlgorithmDetails, 0, len(supportedAlgorithms)) for _, algorithm := range algorithmConfig { a, err := GetAlgorithmDetails(algorithm) if err != nil { return nil, err } permittedAlgorithms = append(permittedAlgorithms, a) } return &AlgorithmRegistryConfig{permittedAlgorithms: permittedAlgorithms}, nil } // IsAlgorithmPermitted checks whether a given public key/hash algorithm combination is permitted by a registry config. func (registryConfig AlgorithmRegistryConfig) IsAlgorithmPermitted(key crypto.PublicKey, hash crypto.Hash) (bool, error) { for _, algorithm := range registryConfig.permittedAlgorithms { keyMatch, err := algorithm.checkKey(key) if err != nil { return false, err } if keyMatch && algorithm.checkHash(hash) { return true, nil } } return false, nil } // FormatSignatureAlgorithmFlag formats a v1.PublicKeyDetails to a string that conforms to the naming conventions // of CLI arguments that are used for Sigstore services. func FormatSignatureAlgorithmFlag(algorithm v1.PublicKeyDetails) (string, error) { for _, a := range supportedAlgorithms { if a.knownAlgorithm == algorithm { return a.flagValue, nil } } return "", fmt.Errorf("could not find matching flag for signature algorithm: %s", algorithm) } // ParseSignatureAlgorithmFlag parses a string produced by FormatSignatureAlgorithmFlag and returns the corresponding // v1.PublicKeyDetails value. func ParseSignatureAlgorithmFlag(flag string) (v1.PublicKeyDetails, error) { for _, a := range supportedAlgorithms { if a.flagValue == flag { return a.knownAlgorithm, nil } } return v1.PublicKeyDetails_PUBLIC_KEY_DETAILS_UNSPECIFIED, fmt.Errorf("could not find matching signature algorithm for flag: %s", flag) } // GetDefaultPublicKeyDetails returns the default public key details for a given key. // // RSA 2048 => v1.PublicKeyDetails_PKIX_RSA_PKCS1V15_2048_SHA256 // RSA 3072 => v1.PublicKeyDetails_PKIX_RSA_PKCS1V15_3072_SHA256 // RSA 4096 => v1.PublicKeyDetails_PKIX_RSA_PKCS1V15_4096_SHA256 // ECDSA P256 => v1.PublicKeyDetails_PKIX_ECDSA_P256_SHA_256 // ECDSA P384 => v1.PublicKeyDetails_PKIX_ECDSA_P384_SHA_384 // ECDSA P521 => v1.PublicKeyDetails_PKIX_ECDSA_P521_SHA_512 // ED25519 => v1.PublicKeyDetails_PKIX_ED25519_PH // // This function accepts LoadOptions, which are used to determine the default // public key details when there may be ambiguities. For example, RSA keys may // be PSS or PKCS1v1.5 encoded, and ED25519 keys may be used with PureEd25519 or // with Ed25519ph. The Hash option is ignored if passed, because each of the // supported algorithms already has a default hash. func GetDefaultPublicKeyDetails(publicKey crypto.PublicKey, opts ...LoadOption) (v1.PublicKeyDetails, error) { var rsaPSSOptions *rsa.PSSOptions var useED25519ph bool for _, o := range opts { o.ApplyED25519ph(&useED25519ph) o.ApplyRSAPSS(&rsaPSSOptions) } switch pk := publicKey.(type) { case *rsa.PublicKey: if rsaPSSOptions != nil { switch pk.Size() * 8 { case 2048: return v1.PublicKeyDetails_PKIX_RSA_PSS_2048_SHA256, nil case 3072: return v1.PublicKeyDetails_PKIX_RSA_PSS_3072_SHA256, nil case 4096: return v1.PublicKeyDetails_PKIX_RSA_PSS_4096_SHA256, nil } } else { switch pk.Size() * 8 { case 2048: return v1.PublicKeyDetails_PKIX_RSA_PKCS1V15_2048_SHA256, nil case 3072: return v1.PublicKeyDetails_PKIX_RSA_PKCS1V15_3072_SHA256, nil case 4096: return v1.PublicKeyDetails_PKIX_RSA_PKCS1V15_4096_SHA256, nil } } case *ecdsa.PublicKey: switch pk.Curve { case elliptic.P256(): return v1.PublicKeyDetails_PKIX_ECDSA_P256_SHA_256, nil case elliptic.P384(): return v1.PublicKeyDetails_PKIX_ECDSA_P384_SHA_384, nil case elliptic.P521(): return v1.PublicKeyDetails_PKIX_ECDSA_P521_SHA_512, nil } case ed25519.PublicKey: if useED25519ph { return v1.PublicKeyDetails_PKIX_ED25519_PH, nil } return v1.PublicKeyDetails_PKIX_ED25519, nil } return v1.PublicKeyDetails_PUBLIC_KEY_DETAILS_UNSPECIFIED, errors.New("unsupported public key type") } // GetDefaultAlgorithmDetails returns the default algorithm details for a given // key, according to GetDefaultPublicKeyDetails. // // This function accepts LoadOptions, which are used to determine the default // algorithm details when there may be ambiguities. For example, RSA keys may be // PSS or PKCS1v1.5 encoded, and ED25519 keys may be used with PureEd25519 or // with Ed25519ph. The Hash option is ignored if passed, because each of the // supported algorithms already has a default hash. func GetDefaultAlgorithmDetails(publicKey crypto.PublicKey, opts ...LoadOption) (AlgorithmDetails, error) { knownAlgorithm, err := GetDefaultPublicKeyDetails(publicKey, opts...) if err != nil { return AlgorithmDetails{}, err } return GetAlgorithmDetails(knownAlgorithm) } ================================================ FILE: vendor/github.com/sigstore/sigstore/pkg/signature/doc.go ================================================ // // Copyright 2021 The Sigstore Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Package signature contains types and utilities related to Sigstore signatures. package signature ================================================ FILE: vendor/github.com/sigstore/sigstore/pkg/signature/ecdsa.go ================================================ // // Copyright 2021 The Sigstore Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package signature import ( "crypto" "crypto/ecdsa" "crypto/elliptic" "crypto/rand" "encoding/asn1" "errors" "fmt" "io" "math/big" "github.com/sigstore/sigstore/pkg/signature/options" ) // checked on LoadSigner, LoadVerifier and SignMessage var ecdsaSupportedHashFuncs = []crypto.Hash{ crypto.SHA256, crypto.SHA512, crypto.SHA384, crypto.SHA224, } // checked on VerifySignature. Supports SHA1 verification. var ecdsaSupportedVerifyHashFuncs = []crypto.Hash{ crypto.SHA256, crypto.SHA512, crypto.SHA384, crypto.SHA224, crypto.SHA1, } // ECDSASigner is a signature.Signer that uses an Elliptic Curve DSA algorithm type ECDSASigner struct { hashFunc crypto.Hash priv *ecdsa.PrivateKey } // LoadECDSASigner calculates signatures using the specified private key and hash algorithm. // // hf must not be crypto.Hash(0). func LoadECDSASigner(priv *ecdsa.PrivateKey, hf crypto.Hash) (*ECDSASigner, error) { if priv == nil { return nil, errors.New("invalid ECDSA private key specified") } if !isSupportedAlg(hf, ecdsaSupportedHashFuncs) { return nil, errors.New("invalid hash function specified") } return &ECDSASigner{ priv: priv, hashFunc: hf, }, nil } // SignMessage signs the provided message. If the message is provided, // this method will compute the digest according to the hash function specified // when the ECDSASigner was created. // // This function recognizes the following Options listed in order of preference: // // - WithRand() // // - WithDigest() // // - WithCryptoSignerOpts() // // All other options are ignored if specified. func (e ECDSASigner) SignMessage(message io.Reader, opts ...SignOption) ([]byte, error) { digest, _, err := ComputeDigestForSigning(message, e.hashFunc, ecdsaSupportedHashFuncs, opts...) if err != nil { return nil, err } rand := selectRandFromOpts(opts...) return ecdsa.SignASN1(rand, e.priv, digest) } // Public returns the public key that can be used to verify signatures created by // this signer. func (e ECDSASigner) Public() crypto.PublicKey { if e.priv == nil { return nil } return e.priv.Public() } // PublicKey returns the public key that can be used to verify signatures created by // this signer. As this value is held in memory, all options provided in arguments // to this method are ignored. func (e ECDSASigner) PublicKey(_ ...PublicKeyOption) (crypto.PublicKey, error) { return e.Public(), nil } // Sign computes the signature for the specified digest. If a source of entropy is // given in rand, it will be used instead of the default value (rand.Reader from crypto/rand). // // If opts are specified, the hash function in opts.Hash should be the one used to compute // digest. If opts are not specified, the value provided when the signer was created will be used instead. func (e ECDSASigner) Sign(rand io.Reader, digest []byte, opts crypto.SignerOpts) ([]byte, error) { ecdsaOpts := []SignOption{options.WithDigest(digest), options.WithRand(rand)} if opts != nil { ecdsaOpts = append(ecdsaOpts, options.WithCryptoSignerOpts(opts)) } return e.SignMessage(nil, ecdsaOpts...) } // ECDSAVerifier is a signature.Verifier that uses an Elliptic Curve DSA algorithm type ECDSAVerifier struct { publicKey *ecdsa.PublicKey hashFunc crypto.Hash } // LoadECDSAVerifier returns a Verifier that verifies signatures using the specified // ECDSA public key and hash algorithm. // // hf must not be crypto.Hash(0). func LoadECDSAVerifier(pub *ecdsa.PublicKey, hashFunc crypto.Hash) (*ECDSAVerifier, error) { if pub == nil { return nil, errors.New("invalid ECDSA public key specified") } if !isSupportedAlg(hashFunc, ecdsaSupportedHashFuncs) { return nil, errors.New("invalid hash function specified") } return &ECDSAVerifier{ publicKey: pub, hashFunc: hashFunc, }, nil } // PublicKey returns the public key that is used to verify signatures by // this verifier. As this value is held in memory, all options provided in arguments // to this method are ignored. func (e ECDSAVerifier) PublicKey(_ ...PublicKeyOption) (crypto.PublicKey, error) { return e.publicKey, nil } // VerifySignature verifies the signature for the given message. Unless provided // in an option, the digest of the message will be computed using the hash function specified // when the ECDSAVerifier was created. // // This function returns nil if the verification succeeded, and an error message otherwise. // // This function recognizes the following Options listed in order of preference: // // - WithDigest() // // All other options are ignored if specified. func (e ECDSAVerifier) VerifySignature(signature, message io.Reader, opts ...VerifyOption) error { if e.publicKey == nil { return errors.New("no public key set for ECDSAVerifier") } digest, _, err := ComputeDigestForVerifying(message, e.hashFunc, ecdsaSupportedVerifyHashFuncs, opts...) if err != nil { return err } if signature == nil { return errors.New("nil signature passed to VerifySignature") } sigBytes, err := io.ReadAll(signature) if err != nil { return fmt.Errorf("reading signature: %w", err) } // Without this check, VerifyASN1 panics on an invalid key. if !e.publicKey.IsOnCurve(e.publicKey.X, e.publicKey.Y) { return fmt.Errorf("invalid ECDSA public key for %s", e.publicKey.Params().Name) } asnParseTest := struct { R, S *big.Int }{} if _, err := asn1.Unmarshal(sigBytes, &asnParseTest); err == nil { if !ecdsa.VerifyASN1(e.publicKey, digest, sigBytes) { return errors.New("invalid signature when validating ASN.1 encoded signature") } } else { // deal with IEEE P1363 encoding of signatures if len(sigBytes) == 0 || len(sigBytes) > 132 || len(sigBytes)%2 != 0 { return errors.New("ecdsa: Invalid IEEE_P1363 encoded bytes") } r := new(big.Int).SetBytes(sigBytes[:len(sigBytes)/2]) s := new(big.Int).SetBytes(sigBytes[len(sigBytes)/2:]) if !ecdsa.Verify(e.publicKey, digest, r, s) { return errors.New("invalid signature when validating IEEE_P1363 encoded signature") } } return nil } // ECDSASignerVerifier is a signature.SignerVerifier that uses an Elliptic Curve DSA algorithm type ECDSASignerVerifier struct { *ECDSASigner *ECDSAVerifier } // LoadECDSASignerVerifier creates a combined signer and verifier. This is a convenience object // that simply wraps an instance of ECDSASigner and ECDSAVerifier. func LoadECDSASignerVerifier(priv *ecdsa.PrivateKey, hf crypto.Hash) (*ECDSASignerVerifier, error) { signer, err := LoadECDSASigner(priv, hf) if err != nil { return nil, fmt.Errorf("initializing signer: %w", err) } verifier, err := LoadECDSAVerifier(&priv.PublicKey, hf) if err != nil { return nil, fmt.Errorf("initializing verifier: %w", err) } return &ECDSASignerVerifier{ ECDSASigner: signer, ECDSAVerifier: verifier, }, nil } // NewDefaultECDSASignerVerifier creates a combined signer and verifier using ECDSA. // // This creates a new ECDSA key using the P-256 curve and uses the SHA256 hashing algorithm. func NewDefaultECDSASignerVerifier() (*ECDSASignerVerifier, *ecdsa.PrivateKey, error) { return NewECDSASignerVerifier(elliptic.P256(), rand.Reader, crypto.SHA256) } // NewECDSASignerVerifier creates a combined signer and verifier using ECDSA. // // This creates a new ECDSA key using the specified elliptic curve, entropy source, and hashing function. func NewECDSASignerVerifier(curve elliptic.Curve, rand io.Reader, hashFunc crypto.Hash) (*ECDSASignerVerifier, *ecdsa.PrivateKey, error) { priv, err := ecdsa.GenerateKey(curve, rand) if err != nil { return nil, nil, err } sv, err := LoadECDSASignerVerifier(priv, hashFunc) if err != nil { return nil, nil, err } return sv, priv, nil } // PublicKey returns the public key that is used to verify signatures by // this verifier. As this value is held in memory, all options provided in arguments // to this method are ignored. func (e ECDSASignerVerifier) PublicKey(_ ...PublicKeyOption) (crypto.PublicKey, error) { return e.publicKey, nil } ================================================ FILE: vendor/github.com/sigstore/sigstore/pkg/signature/ed25519.go ================================================ // // Copyright 2021 The Sigstore Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package signature import ( "bytes" "crypto" "crypto/ed25519" "crypto/rand" "errors" "fmt" "io" ) var ed25519SupportedHashFuncs = []crypto.Hash{ crypto.Hash(0), } // ED25519Signer is a signature.Signer that uses the Ed25519 public-key signature system type ED25519Signer struct { priv ed25519.PrivateKey } // LoadED25519Signer calculates signatures using the specified private key. func LoadED25519Signer(priv ed25519.PrivateKey) (*ED25519Signer, error) { if priv == nil { return nil, errors.New("invalid ED25519 private key specified") } // check this to avoid panic and throw error gracefully if len(priv) != ed25519.PrivateKeySize { return nil, errors.New("invalid size for ED25519 key") } return &ED25519Signer{ priv: priv, }, nil } // SignMessage signs the provided message. Passing the WithDigest option is not // supported as ED25519 performs a two pass hash over the message during the // signing process. // // All options are ignored. func (e ED25519Signer) SignMessage(message io.Reader, _ ...SignOption) ([]byte, error) { messageBytes, _, err := ComputeDigestForSigning(message, crypto.Hash(0), ed25519SupportedHashFuncs) if err != nil { return nil, err } return ed25519.Sign(e.priv, messageBytes), nil } // Public returns the public key that can be used to verify signatures created by // this signer. func (e ED25519Signer) Public() crypto.PublicKey { if e.priv == nil { return nil } return e.priv.Public() } // PublicKey returns the public key that can be used to verify signatures created by // this signer. As this value is held in memory, all options provided in arguments // to this method are ignored. func (e ED25519Signer) PublicKey(_ ...PublicKeyOption) (crypto.PublicKey, error) { return e.Public(), nil } // Sign computes the signature for the specified message; the first and third arguments to this // function are ignored as they are not used by the ED25519 algorithm. func (e ED25519Signer) Sign(_ io.Reader, message []byte, _ crypto.SignerOpts) ([]byte, error) { if message == nil { return nil, errors.New("message must not be nil") } return e.SignMessage(bytes.NewReader(message)) } // ED25519Verifier is a signature.Verifier that uses the Ed25519 public-key signature system type ED25519Verifier struct { publicKey ed25519.PublicKey } // LoadED25519Verifier returns a Verifier that verifies signatures using the specified ED25519 public key. func LoadED25519Verifier(pub ed25519.PublicKey) (*ED25519Verifier, error) { if pub == nil { return nil, errors.New("invalid ED25519 public key specified") } return &ED25519Verifier{ publicKey: pub, }, nil } // PublicKey returns the public key that is used to verify signatures by // this verifier. As this value is held in memory, all options provided in arguments // to this method are ignored. func (e *ED25519Verifier) PublicKey(_ ...PublicKeyOption) (crypto.PublicKey, error) { return e.publicKey, nil } // VerifySignature verifies the signature for the given message. // // This function returns nil if the verification succeeded, and an error message otherwise. // // All options are ignored if specified. func (e *ED25519Verifier) VerifySignature(signature, message io.Reader, _ ...VerifyOption) error { messageBytes, _, err := ComputeDigestForVerifying(message, crypto.Hash(0), ed25519SupportedHashFuncs) if err != nil { return err } if signature == nil { return errors.New("nil signature passed to VerifySignature") } sigBytes, err := io.ReadAll(signature) if err != nil { return fmt.Errorf("reading signature: %w", err) } if !ed25519.Verify(e.publicKey, messageBytes, sigBytes) { return errors.New("failed to verify signature") } return nil } // ED25519SignerVerifier is a signature.SignerVerifier that uses the Ed25519 public-key signature system type ED25519SignerVerifier struct { *ED25519Signer *ED25519Verifier } // LoadED25519SignerVerifier creates a combined signer and verifier. This is // a convenience object that simply wraps an instance of ED25519Signer and ED25519Verifier. func LoadED25519SignerVerifier(priv ed25519.PrivateKey) (*ED25519SignerVerifier, error) { signer, err := LoadED25519Signer(priv) if err != nil { return nil, fmt.Errorf("initializing signer: %w", err) } pub, ok := priv.Public().(ed25519.PublicKey) if !ok { return nil, fmt.Errorf("given key is not ed25519.PublicKey") } verifier, err := LoadED25519Verifier(pub) if err != nil { return nil, fmt.Errorf("initializing verifier: %w", err) } return &ED25519SignerVerifier{ ED25519Signer: signer, ED25519Verifier: verifier, }, nil } // NewDefaultED25519SignerVerifier creates a combined signer and verifier using ED25519. // This creates a new ED25519 key using crypto/rand as an entropy source. func NewDefaultED25519SignerVerifier() (*ED25519SignerVerifier, ed25519.PrivateKey, error) { return NewED25519SignerVerifier(rand.Reader) } // NewED25519SignerVerifier creates a combined signer and verifier using ED25519. // This creates a new ED25519 key using the specified entropy source. func NewED25519SignerVerifier(rand io.Reader) (*ED25519SignerVerifier, ed25519.PrivateKey, error) { _, priv, err := ed25519.GenerateKey(rand) if err != nil { return nil, nil, err } sv, err := LoadED25519SignerVerifier(priv) if err != nil { return nil, nil, err } return sv, priv, nil } // PublicKey returns the public key that is used to verify signatures by // this verifier. As this value is held in memory, all options provided in arguments // to this method are ignored. func (e ED25519SignerVerifier) PublicKey(_ ...PublicKeyOption) (crypto.PublicKey, error) { return e.publicKey, nil } ================================================ FILE: vendor/github.com/sigstore/sigstore/pkg/signature/ed25519ph.go ================================================ // // Copyright 2024 The Sigstore Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package signature import ( "crypto" "crypto/ed25519" "crypto/rand" "errors" "fmt" "io" "github.com/sigstore/sigstore/pkg/signature/options" ) var ed25519phSupportedHashFuncs = []crypto.Hash{ crypto.SHA512, } // ED25519phSigner is a signature.Signer that uses the Ed25519 public-key signature system with pre-hashing type ED25519phSigner struct { priv ed25519.PrivateKey } // LoadED25519phSigner calculates signatures using the specified private key. func LoadED25519phSigner(priv ed25519.PrivateKey) (*ED25519phSigner, error) { if priv == nil { return nil, errors.New("invalid ED25519 private key specified") } return &ED25519phSigner{ priv: priv, }, nil } // ToED25519SignerVerifier creates a ED25519SignerVerifier from a ED25519phSignerVerifier // // Clients that use ED25519phSignerVerifier should use this method to get a // SignerVerifier that uses the same ED25519 private key, but with the Pure // Ed25519 algorithm. This might be necessary to interact with Fulcio, which // only supports the Pure Ed25519 algorithm. func (e ED25519phSignerVerifier) ToED25519SignerVerifier() (*ED25519SignerVerifier, error) { return LoadED25519SignerVerifier(e.priv) } // SignMessage signs the provided message. If the message is provided, // this method will compute the digest according to the hash function specified // when the ED25519phSigner was created. // // This function recognizes the following Options listed in order of preference: // // - WithDigest() // // All other options are ignored if specified. func (e ED25519phSigner) SignMessage(message io.Reader, opts ...SignOption) ([]byte, error) { digest, _, err := ComputeDigestForSigning(message, crypto.SHA512, ed25519phSupportedHashFuncs, opts...) if err != nil { return nil, err } return e.priv.Sign(nil, digest, crypto.SHA512) } // Public returns the public key that can be used to verify signatures created by // this signer. func (e ED25519phSigner) Public() crypto.PublicKey { if e.priv == nil { return nil } return e.priv.Public() } // PublicKey returns the public key that can be used to verify signatures created by // this signer. As this value is held in memory, all options provided in arguments // to this method are ignored. func (e ED25519phSigner) PublicKey(_ ...PublicKeyOption) (crypto.PublicKey, error) { return e.Public(), nil } // Sign computes the signature for the specified message; the first and third arguments to this // function are ignored as they are not used by the ED25519ph algorithm. func (e ED25519phSigner) Sign(_ io.Reader, digest []byte, _ crypto.SignerOpts) ([]byte, error) { return e.SignMessage(nil, options.WithDigest(digest)) } // ED25519phVerifier is a signature.Verifier that uses the Ed25519 public-key signature system type ED25519phVerifier struct { publicKey ed25519.PublicKey } // LoadED25519phVerifier returns a Verifier that verifies signatures using the // specified ED25519 public key. func LoadED25519phVerifier(pub ed25519.PublicKey) (*ED25519phVerifier, error) { if pub == nil { return nil, errors.New("invalid ED25519 public key specified") } return &ED25519phVerifier{ publicKey: pub, }, nil } // PublicKey returns the public key that is used to verify signatures by // this verifier. As this value is held in memory, all options provided in arguments // to this method are ignored. func (e *ED25519phVerifier) PublicKey(_ ...PublicKeyOption) (crypto.PublicKey, error) { return e.publicKey, nil } // VerifySignature verifies the signature for the given message. Unless provided // in an option, the digest of the message will be computed using the hash function specified // when the ED25519phVerifier was created. // // This function returns nil if the verification succeeded, and an error message otherwise. // // This function recognizes the following Options listed in order of preference: // // - WithDigest() // // All other options are ignored if specified. func (e *ED25519phVerifier) VerifySignature(signature, message io.Reader, opts ...VerifyOption) error { if signature == nil { return errors.New("nil signature passed to VerifySignature") } digest, _, err := ComputeDigestForVerifying(message, crypto.SHA512, ed25519phSupportedHashFuncs, opts...) if err != nil { return err } sigBytes, err := io.ReadAll(signature) if err != nil { return fmt.Errorf("reading signature: %w", err) } if err := ed25519.VerifyWithOptions(e.publicKey, digest, sigBytes, &ed25519.Options{Hash: crypto.SHA512}); err != nil { return fmt.Errorf("failed to verify signature: %w", err) } return nil } // ED25519phSignerVerifier is a signature.SignerVerifier that uses the Ed25519 public-key signature system type ED25519phSignerVerifier struct { *ED25519phSigner *ED25519phVerifier } // LoadED25519phSignerVerifier creates a combined signer and verifier. This is // a convenience object that simply wraps an instance of ED25519phSigner and ED25519phVerifier. func LoadED25519phSignerVerifier(priv ed25519.PrivateKey) (*ED25519phSignerVerifier, error) { signer, err := LoadED25519phSigner(priv) if err != nil { return nil, fmt.Errorf("initializing signer: %w", err) } pub, ok := priv.Public().(ed25519.PublicKey) if !ok { return nil, fmt.Errorf("given key is not ed25519.PublicKey") } verifier, err := LoadED25519phVerifier(pub) if err != nil { return nil, fmt.Errorf("initializing verifier: %w", err) } return &ED25519phSignerVerifier{ ED25519phSigner: signer, ED25519phVerifier: verifier, }, nil } // NewDefaultED25519phSignerVerifier creates a combined signer and verifier using ED25519. // This creates a new ED25519 key using crypto/rand as an entropy source. func NewDefaultED25519phSignerVerifier() (*ED25519phSignerVerifier, ed25519.PrivateKey, error) { return NewED25519phSignerVerifier(rand.Reader) } // NewED25519phSignerVerifier creates a combined signer and verifier using ED25519. // This creates a new ED25519 key using the specified entropy source. func NewED25519phSignerVerifier(rand io.Reader) (*ED25519phSignerVerifier, ed25519.PrivateKey, error) { _, priv, err := ed25519.GenerateKey(rand) if err != nil { return nil, nil, err } sv, err := LoadED25519phSignerVerifier(priv) if err != nil { return nil, nil, err } return sv, priv, nil } // PublicKey returns the public key that is used to verify signatures by // this verifier. As this value is held in memory, all options provided in arguments // to this method are ignored. func (e ED25519phSignerVerifier) PublicKey(_ ...PublicKeyOption) (crypto.PublicKey, error) { return e.publicKey, nil } ================================================ FILE: vendor/github.com/sigstore/sigstore/pkg/signature/message.go ================================================ // // Copyright 2021 The Sigstore Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package signature import ( "crypto" crand "crypto/rand" "errors" "fmt" "io" ) func isSupportedAlg(alg crypto.Hash, supportedAlgs []crypto.Hash) bool { if supportedAlgs == nil { return true } for _, supportedAlg := range supportedAlgs { if alg == supportedAlg { return true } } return false } // ComputeDigestForSigning calculates the digest value for the specified message using a hash function selected by the following process: // // - if a digest value is already specified in a SignOption and the length of the digest matches that of the selected hash function, the // digest value will be returned without any further computation // - if a hash function is given using WithCryptoSignerOpts(opts) as a SignOption, it will be used (if it is in the supported list) // - otherwise defaultHashFunc will be used (if it is in the supported list) func ComputeDigestForSigning(rawMessage io.Reader, defaultHashFunc crypto.Hash, supportedHashFuncs []crypto.Hash, opts ...SignOption) (digest []byte, hashedWith crypto.Hash, err error) { var cryptoSignerOpts crypto.SignerOpts = defaultHashFunc for _, opt := range opts { opt.ApplyDigest(&digest) opt.ApplyCryptoSignerOpts(&cryptoSignerOpts) } hashedWith = cryptoSignerOpts.HashFunc() if !isSupportedAlg(hashedWith, supportedHashFuncs) { return nil, crypto.Hash(0), fmt.Errorf("unsupported hash algorithm: %q not in %v", hashedWith.String(), supportedHashFuncs) } if len(digest) > 0 { if hashedWith != crypto.Hash(0) && len(digest) != hashedWith.Size() { err = errors.New("unexpected length of digest for hash function specified") } return digest, hashedWith, err } digest, err = hashMessage(rawMessage, hashedWith) return digest, hashedWith, err } // ComputeDigestForVerifying calculates the digest value for the specified message using a hash function selected by the following process: // // - if a digest value is already specified in a SignOption and the length of the digest matches that of the selected hash function, the // digest value will be returned without any further computation // - if a hash function is given using WithCryptoSignerOpts(opts) as a SignOption, it will be used (if it is in the supported list) // - otherwise defaultHashFunc will be used (if it is in the supported list) func ComputeDigestForVerifying(rawMessage io.Reader, defaultHashFunc crypto.Hash, supportedHashFuncs []crypto.Hash, opts ...VerifyOption) (digest []byte, hashedWith crypto.Hash, err error) { var cryptoSignerOpts crypto.SignerOpts = defaultHashFunc for _, opt := range opts { opt.ApplyDigest(&digest) opt.ApplyCryptoSignerOpts(&cryptoSignerOpts) } hashedWith = cryptoSignerOpts.HashFunc() if !isSupportedAlg(hashedWith, supportedHashFuncs) { return nil, crypto.Hash(0), fmt.Errorf("unsupported hash algorithm: %q not in %v", hashedWith.String(), supportedHashFuncs) } if len(digest) > 0 { if hashedWith != crypto.Hash(0) && len(digest) != hashedWith.Size() { err = errors.New("unexpected length of digest for hash function specified") } return digest, hashedWith, err } digest, err = hashMessage(rawMessage, hashedWith) return digest, hashedWith, err } func hashMessage(rawMessage io.Reader, hashFunc crypto.Hash) ([]byte, error) { if rawMessage == nil { return nil, errors.New("message cannot be nil") } if hashFunc == crypto.Hash(0) { return io.ReadAll(rawMessage) } hasher := hashFunc.New() // avoids reading entire message into memory if _, err := io.Copy(hasher, rawMessage); err != nil { return nil, fmt.Errorf("hashing message: %w", err) } return hasher.Sum(nil), nil } func selectRandFromOpts(opts ...SignOption) io.Reader { rand := crand.Reader for _, opt := range opts { opt.ApplyRand(&rand) } return rand } ================================================ FILE: vendor/github.com/sigstore/sigstore/pkg/signature/options/context.go ================================================ // // Copyright 2021 The Sigstore Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Package options defines options for KMS clients package options import ( "context" ) // RequestContext implements the functional option pattern for including a context during RPC type RequestContext struct { NoOpOptionImpl ctx context.Context } // ApplyContext sets the specified context as the functional option func (r RequestContext) ApplyContext(ctx *context.Context) { *ctx = r.ctx } // WithContext specifies that the given context should be used in RPC to external services func WithContext(ctx context.Context) RequestContext { return RequestContext{ctx: ctx} } ================================================ FILE: vendor/github.com/sigstore/sigstore/pkg/signature/options/digest.go ================================================ // // Copyright 2021 The Sigstore Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package options // RequestDigest implements the functional option pattern for specifying a digest value type RequestDigest struct { NoOpOptionImpl digest []byte } // ApplyDigest sets the specified digest value as the functional option func (r RequestDigest) ApplyDigest(digest *[]byte) { *digest = r.digest } // WithDigest specifies that the given digest can be used by underlying signature implementations // WARNING: When verifying a digest with ECDSA, it is trivial to craft a valid signature // over a random message given a public key. Do not use this unles you understand the // implications and do not need to protect against malleability. func WithDigest(digest []byte) RequestDigest { return RequestDigest{digest: digest} } ================================================ FILE: vendor/github.com/sigstore/sigstore/pkg/signature/options/doc.go ================================================ // // Copyright 2022 The Sigstore Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Package options contains functional options for the various SignerVerifiers package options ================================================ FILE: vendor/github.com/sigstore/sigstore/pkg/signature/options/keyversion.go ================================================ // // Copyright 2022 The Sigstore Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package options // RequestKeyVersion implements the functional option pattern for specifying the KMS key version during signing or verification type RequestKeyVersion struct { NoOpOptionImpl keyVersion string } // ApplyKeyVersion sets the KMS's key version as a functional option func (r RequestKeyVersion) ApplyKeyVersion(keyVersion *string) { *keyVersion = r.keyVersion } // WithKeyVersion specifies that a specific KMS key version be used during signing and verification operations; // a value of 0 will use the latest version of the key (default) func WithKeyVersion(keyVersion string) RequestKeyVersion { return RequestKeyVersion{keyVersion: keyVersion} } // RequestKeyVersionUsed implements the functional option pattern for obtaining the KMS key version used during signing type RequestKeyVersionUsed struct { NoOpOptionImpl keyVersionUsed *string } // ApplyKeyVersionUsed requests to store the KMS's key version that was used as a functional option func (r RequestKeyVersionUsed) ApplyKeyVersionUsed(keyVersionUsed **string) { *keyVersionUsed = r.keyVersionUsed } // ReturnKeyVersionUsed specifies that the specific KMS key version that was used during signing should be stored // in the pointer provided func ReturnKeyVersionUsed(keyVersionUsed *string) RequestKeyVersionUsed { return RequestKeyVersionUsed{keyVersionUsed: keyVersionUsed} } ================================================ FILE: vendor/github.com/sigstore/sigstore/pkg/signature/options/loadoptions.go ================================================ // // Copyright 2024 The Sigstore Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package options import ( "crypto" "crypto/rsa" ) // RequestHash implements the functional option pattern for setting a Hash // function when loading a signer or verifier type RequestHash struct { NoOpOptionImpl hashFunc crypto.Hash } // ApplyHash sets the hash as requested by the functional option func (r RequestHash) ApplyHash(hash *crypto.Hash) { *hash = r.hashFunc } // WithHash specifies that the given hash function should be used when loading a signer or verifier func WithHash(hash crypto.Hash) RequestHash { return RequestHash{hashFunc: hash} } // RequestED25519ph implements the functional option pattern for specifying // ED25519ph (pre-hashed) should be used when loading a signer or verifier and a // ED25519 key is type RequestED25519ph struct { NoOpOptionImpl useED25519ph bool } // ApplyED25519ph sets the ED25519ph flag as requested by the functional option func (r RequestED25519ph) ApplyED25519ph(useED25519ph *bool) { *useED25519ph = r.useED25519ph } // WithED25519ph specifies that the ED25519ph algorithm should be used when a ED25519 key is used func WithED25519ph() RequestED25519ph { return RequestED25519ph{useED25519ph: true} } // RequestPSSOptions implements the functional option pattern for specifying RSA // PSS should be used when loading a signer or verifier and a RSA key is // detected type RequestPSSOptions struct { NoOpOptionImpl opts *rsa.PSSOptions } // ApplyRSAPSS sets the RSAPSS options as requested by the functional option func (r RequestPSSOptions) ApplyRSAPSS(opts **rsa.PSSOptions) { *opts = r.opts } // WithRSAPSS specifies that the RSAPSS algorithm should be used when a RSA key is used // Note that the RSA PSSOptions contains an hash algorithm, which will override // the hash function specified with WithHash. func WithRSAPSS(opts *rsa.PSSOptions) RequestPSSOptions { return RequestPSSOptions{opts: opts} } ================================================ FILE: vendor/github.com/sigstore/sigstore/pkg/signature/options/noop.go ================================================ // // Copyright 2021 The Sigstore Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package options import ( "context" "crypto" "crypto/rsa" "io" ) // NoOpOptionImpl implements the RPCOption, SignOption, VerifyOption interfaces as no-ops. type NoOpOptionImpl struct{} // ApplyContext is a no-op required to fully implement the requisite interfaces func (NoOpOptionImpl) ApplyContext(_ *context.Context) {} // ApplyCryptoSignerOpts is a no-op required to fully implement the requisite interfaces func (NoOpOptionImpl) ApplyCryptoSignerOpts(_ *crypto.SignerOpts) {} // ApplyDigest is a no-op required to fully implement the requisite interfaces func (NoOpOptionImpl) ApplyDigest(_ *[]byte) {} // ApplyRand is a no-op required to fully implement the requisite interfaces func (NoOpOptionImpl) ApplyRand(_ *io.Reader) {} // ApplyRemoteVerification is a no-op required to fully implement the requisite interfaces func (NoOpOptionImpl) ApplyRemoteVerification(_ *bool) {} // ApplyRPCAuthOpts is a no-op required to fully implement the requisite interfaces func (NoOpOptionImpl) ApplyRPCAuthOpts(_ *RPCAuth) {} // ApplyKeyVersion is a no-op required to fully implement the requisite interfaces func (NoOpOptionImpl) ApplyKeyVersion(_ *string) {} // ApplyKeyVersionUsed is a no-op required to fully implement the requisite interfaces func (NoOpOptionImpl) ApplyKeyVersionUsed(_ **string) {} // ApplyHash is a no-op required to fully implement the requisite interfaces func (NoOpOptionImpl) ApplyHash(_ *crypto.Hash) {} // ApplyED25519ph is a no-op required to fully implement the requisite interfaces func (NoOpOptionImpl) ApplyED25519ph(_ *bool) {} // ApplyRSAPSS is a no-op required to fully implement the requisite interfaces func (NoOpOptionImpl) ApplyRSAPSS(_ **rsa.PSSOptions) {} ================================================ FILE: vendor/github.com/sigstore/sigstore/pkg/signature/options/rand.go ================================================ // // Copyright 2021 The Sigstore Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package options import ( crand "crypto/rand" "io" ) // RequestRand implements the functional option pattern for using a specific source of entropy type RequestRand struct { NoOpOptionImpl rand io.Reader } // ApplyRand sets the specified source of entropy as the functional option func (r RequestRand) ApplyRand(rand *io.Reader) { *rand = r.rand } // WithRand specifies that the given source of entropy should be used in signing operations func WithRand(rand io.Reader) RequestRand { r := rand if r == nil { r = crand.Reader } return RequestRand{rand: r} } ================================================ FILE: vendor/github.com/sigstore/sigstore/pkg/signature/options/remoteverification.go ================================================ // // Copyright 2021 The Sigstore Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package options // RequestRemoteVerification implements the functional option pattern for remotely verifiying signatures when possible type RequestRemoteVerification struct { NoOpOptionImpl remoteVerification bool } // ApplyRemoteVerification sets remote verification as a functional option func (r RequestRemoteVerification) ApplyRemoteVerification(remoteVerification *bool) { *remoteVerification = r.remoteVerification } // WithRemoteVerification specifies that the verification operation should be performed remotely (vs in the process of the caller) func WithRemoteVerification(remoteVerification bool) RequestRemoteVerification { return RequestRemoteVerification{remoteVerification: remoteVerification} } ================================================ FILE: vendor/github.com/sigstore/sigstore/pkg/signature/options/rpcauth.go ================================================ // // Copyright 2021 The Sigstore Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package options // RPCAuthOpts includes authentication settings for RPC calls type RPCAuthOpts struct { NoOpOptionImpl opts RPCAuth } // RPCAuth provides credentials for RPC calls, empty fields are ignored type RPCAuth struct { Address string // address is the remote server address, e.g. https://vault:8200 Path string // path for the RPC, in vault this is the transit path which default to "transit" Token string // token used for RPC, in vault this is the VAULT_TOKEN value OIDC RPCAuthOIDC } // RPCAuthOIDC is used to perform the RPC login using OIDC instead of a fixed token type RPCAuthOIDC struct { Path string // path defaults to "jwt" for vault Role string // role is required for jwt logins Token string // token is a jwt with vault } // ApplyRPCAuthOpts sets the RPCAuth as a function option func (r RPCAuthOpts) ApplyRPCAuthOpts(opts *RPCAuth) { if r.opts.Address != "" { opts.Address = r.opts.Address } if r.opts.Path != "" { opts.Path = r.opts.Path } if r.opts.Token != "" { opts.Token = r.opts.Token } if r.opts.OIDC.Token != "" { opts.OIDC = r.opts.OIDC } } // WithRPCAuthOpts specifies RPCAuth settings to be used with RPC logins func WithRPCAuthOpts(opts RPCAuth) RPCAuthOpts { return RPCAuthOpts{opts: opts} } ================================================ FILE: vendor/github.com/sigstore/sigstore/pkg/signature/options/signeropts.go ================================================ // // Copyright 2021 The Sigstore Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package options import ( "crypto" ) // RequestCryptoSignerOpts implements the functional option pattern for supplying crypto.SignerOpts when signing or verifying type RequestCryptoSignerOpts struct { NoOpOptionImpl opts crypto.SignerOpts } // ApplyCryptoSignerOpts sets crypto.SignerOpts as a functional option func (r RequestCryptoSignerOpts) ApplyCryptoSignerOpts(opts *crypto.SignerOpts) { *opts = r.opts } // WithCryptoSignerOpts specifies that provided crypto.SignerOpts be used during signing and verification operations func WithCryptoSignerOpts(opts crypto.SignerOpts) RequestCryptoSignerOpts { var optsToUse crypto.SignerOpts = crypto.SHA256 if opts != nil { optsToUse = opts } return RequestCryptoSignerOpts{opts: optsToUse} } ================================================ FILE: vendor/github.com/sigstore/sigstore/pkg/signature/options.go ================================================ // // Copyright 2021 The Sigstore Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package signature import ( "context" "crypto" "crypto/rsa" "io" "github.com/sigstore/sigstore/pkg/signature/options" ) // RPCOption specifies options to be used when performing RPC type RPCOption interface { ApplyContext(*context.Context) ApplyRemoteVerification(*bool) ApplyRPCAuthOpts(opts *options.RPCAuth) ApplyKeyVersion(keyVersion *string) } // PublicKeyOption specifies options to be used when obtaining a public key type PublicKeyOption interface { RPCOption } // MessageOption specifies options to be used when processing messages during signing or verification type MessageOption interface { ApplyDigest(*[]byte) ApplyCryptoSignerOpts(*crypto.SignerOpts) } // SignOption specifies options to be used when signing a message type SignOption interface { RPCOption MessageOption ApplyRand(*io.Reader) ApplyKeyVersionUsed(**string) } // VerifyOption specifies options to be used when verifying a signature type VerifyOption interface { RPCOption MessageOption } // LoadOption specifies options to be used when creating a Signer/Verifier type LoadOption interface { ApplyHash(*crypto.Hash) ApplyED25519ph(*bool) ApplyRSAPSS(**rsa.PSSOptions) } ================================================ FILE: vendor/github.com/sigstore/sigstore/pkg/signature/payload/doc.go ================================================ // // Copyright 2022 The Sigstore Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Package payload contains types and utilities related to the Cosign signature format. package payload ================================================ FILE: vendor/github.com/sigstore/sigstore/pkg/signature/payload/payload.go ================================================ // // Copyright 2021 The Sigstore Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Package payload defines a container image package payload import ( "encoding/json" "fmt" "github.com/google/go-containerregistry/pkg/name" ) // CosignSignatureType is the value of `critical.type` in a SimpleContainerImage payload. const CosignSignatureType = "cosign container image signature" // SimpleContainerImage describes the structure of a basic container image signature payload, as defined at: // https://github.com/containers/image/blob/main/docs/containers-signature.5.md#json-data-format type SimpleContainerImage struct { Critical Critical `json:"critical"` // Critical data critical to correctly evaluating the validity of the signature Optional map[string]interface{} `json:"optional"` // Optional optional metadata about the image } // Critical data critical to correctly evaluating the validity of a signature type Critical struct { Identity Identity `json:"identity"` // Identity claimed identity of the image Image Image `json:"image"` // Image identifies the container that the signature applies to Type string `json:"type"` // Type must be 'atomic container signature' } // Identity is the claimed identity of the image type Identity struct { DockerReference string `json:"docker-reference"` // DockerReference is a reference used to refer to or download the image } // Image identifies the container image that the signature applies to type Image struct { DockerManifestDigest string `json:"docker-manifest-digest"` // DockerManifestDigest the manifest digest of the signed container image } // Cosign describes a container image signed using Cosign type Cosign struct { Image name.Digest // ClaimedIdentity is what the signer claims the image to be; usually a registry.com/…/repo:tag, but can also use a digest instead. // ALMOST ALL consumers MUST verify that ClaimedIdentity in the signature is correct given how user refers to the image; // e.g. if the user asks to access a signed image example.com/repo/mysql:3.14, // it is ALMOST ALWAYS necessary to validate that ClaimedIdentity = example.com/repo/mysql:3.14 // // Considerations: // - The user might refer to an image using a digest (example.com/repo/mysql@sha256:…); in that case the registry/…/repo should still match // - If the image is multi-arch, ClaimedIdentity usually refers to the top-level multi-arch image index also on the per-arch images // (possibly even if ClaimedIdentity contains a digest!) // - Older versions of cosign generate signatures where ClaimedIdentity only contains a registry/…/repo ; signature consumers should allow users // to determine whether such images should be accepted (and, long-term, the default SHOULD be to reject them) ClaimedIdentity string Annotations map[string]interface{} } // SimpleContainerImage returns information about a container image in the github.com/containers/image/signature format func (p Cosign) SimpleContainerImage() SimpleContainerImage { dockerReference := p.Image.Repository.Name() if p.ClaimedIdentity != "" { dockerReference = p.ClaimedIdentity } return SimpleContainerImage{ Critical: Critical{ Identity: Identity{ DockerReference: dockerReference, }, Image: Image{ DockerManifestDigest: p.Image.DigestStr(), }, Type: CosignSignatureType, }, Optional: p.Annotations, } } // MarshalJSON marshals the container signature into a []byte of JSON data func (p Cosign) MarshalJSON() ([]byte, error) { return json.Marshal(p.SimpleContainerImage()) } var _ json.Marshaler = Cosign{} // UnmarshalJSON unmarshals []byte of JSON data into a container signature object func (p *Cosign) UnmarshalJSON(data []byte) error { if string(data) == "null" { // JSON "null" is a no-op by convention return nil } var simple SimpleContainerImage if err := json.Unmarshal(data, &simple); err != nil { return err } if simple.Critical.Type != CosignSignatureType { return fmt.Errorf("Cosign signature payload was of an unknown type: %q", simple.Critical.Type) } digestStr := simple.Critical.Identity.DockerReference + "@" + simple.Critical.Image.DockerManifestDigest digest, err := name.NewDigest(digestStr) if err != nil { return fmt.Errorf("could not parse image digest string %q: %w", digestStr, err) } p.Image = digest p.ClaimedIdentity = simple.Critical.Identity.DockerReference p.Annotations = simple.Optional return nil } var _ json.Unmarshaler = (*Cosign)(nil) ================================================ FILE: vendor/github.com/sigstore/sigstore/pkg/signature/publickey.go ================================================ // // Copyright 2021 The Sigstore Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package signature import ( "crypto" ) // PublicKeyProvider returns a PublicKey associated with a digital signature type PublicKeyProvider interface { PublicKey(opts ...PublicKeyOption) (crypto.PublicKey, error) } ================================================ FILE: vendor/github.com/sigstore/sigstore/pkg/signature/rsapkcs1v15.go ================================================ // // Copyright 2021 The Sigstore Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package signature import ( "crypto" "crypto/rand" "crypto/rsa" "errors" "fmt" "io" "github.com/sigstore/sigstore/pkg/signature/options" ) // RSAPKCS1v15Signer is a signature.Signer that uses the RSA PKCS1v15 algorithm type RSAPKCS1v15Signer struct { hashFunc crypto.Hash priv *rsa.PrivateKey } // LoadRSAPKCS1v15Signer calculates signatures using the specified private key and hash algorithm. // // hf must be either SHA256, SHA388, or SHA512. func LoadRSAPKCS1v15Signer(priv *rsa.PrivateKey, hf crypto.Hash) (*RSAPKCS1v15Signer, error) { if priv == nil { return nil, errors.New("invalid RSA private key specified") } if !isSupportedAlg(hf, rsaSupportedHashFuncs) { return nil, errors.New("invalid hash function specified") } return &RSAPKCS1v15Signer{ priv: priv, hashFunc: hf, }, nil } // SignMessage signs the provided message using PKCS1v15. If the message is provided, // this method will compute the digest according to the hash function specified // when the RSAPKCS1v15Signer was created. // // SignMessage recognizes the following Options listed in order of preference: // // - WithRand() // // - WithDigest() // // - WithCryptoSignerOpts() // // All other options are ignored if specified. func (r RSAPKCS1v15Signer) SignMessage(message io.Reader, opts ...SignOption) ([]byte, error) { digest, hf, err := ComputeDigestForSigning(message, r.hashFunc, rsaSupportedHashFuncs, opts...) if err != nil { return nil, err } rand := selectRandFromOpts(opts...) return rsa.SignPKCS1v15(rand, r.priv, hf, digest) } // Public returns the public key that can be used to verify signatures created by // this signer. func (r RSAPKCS1v15Signer) Public() crypto.PublicKey { if r.priv == nil { return nil } return r.priv.Public() } // PublicKey returns the public key that can be used to verify signatures created by // this signer. As this value is held in memory, all options provided in arguments // to this method are ignored. func (r RSAPKCS1v15Signer) PublicKey(_ ...PublicKeyOption) (crypto.PublicKey, error) { return r.Public(), nil } // Sign computes the signature for the specified digest using PKCS1v15. // // If a source of entropy is given in rand, it will be used instead of the default value (rand.Reader // from crypto/rand). // // If opts are specified, they should specify the hash function used to compute digest. If opts are // not specified, this function assumes the hash function provided when the signer was created was // used to create the value specified in digest. func (r RSAPKCS1v15Signer) Sign(rand io.Reader, digest []byte, opts crypto.SignerOpts) ([]byte, error) { rsaOpts := []SignOption{options.WithDigest(digest), options.WithRand(rand)} if opts != nil { rsaOpts = append(rsaOpts, options.WithCryptoSignerOpts(opts)) } return r.SignMessage(nil, rsaOpts...) } // RSAPKCS1v15Verifier is a signature.Verifier that uses the RSA PKCS1v15 algorithm type RSAPKCS1v15Verifier struct { publicKey *rsa.PublicKey hashFunc crypto.Hash } // LoadRSAPKCS1v15Verifier returns a Verifier that verifies signatures using the specified // RSA public key and hash algorithm. // // hf must be either SHA256, SHA388, or SHA512. func LoadRSAPKCS1v15Verifier(pub *rsa.PublicKey, hashFunc crypto.Hash) (*RSAPKCS1v15Verifier, error) { if pub == nil { return nil, errors.New("invalid RSA public key specified") } if !isSupportedAlg(hashFunc, rsaSupportedHashFuncs) { return nil, errors.New("invalid hash function specified") } return &RSAPKCS1v15Verifier{ publicKey: pub, hashFunc: hashFunc, }, nil } // PublicKey returns the public key that is used to verify signatures by // this verifier. As this value is held in memory, all options provided in arguments // to this method are ignored. func (r RSAPKCS1v15Verifier) PublicKey(_ ...PublicKeyOption) (crypto.PublicKey, error) { return r.publicKey, nil } // VerifySignature verifies the signature for the given message using PKCS1v15. Unless provided // in an option, the digest of the message will be computed using the hash function specified // when the RSAPKCS1v15Verifier was created. // // This function returns nil if the verification succeeded, and an error message otherwise. // // This function recognizes the following Options listed in order of preference: // // - WithDigest() // // - WithCryptoSignerOpts() // // All other options are ignored if specified. func (r RSAPKCS1v15Verifier) VerifySignature(signature, message io.Reader, opts ...VerifyOption) error { digest, hf, err := ComputeDigestForVerifying(message, r.hashFunc, rsaSupportedVerifyHashFuncs, opts...) if err != nil { return err } if signature == nil { return errors.New("nil signature passed to VerifySignature") } sigBytes, err := io.ReadAll(signature) if err != nil { return fmt.Errorf("reading signature: %w", err) } return rsa.VerifyPKCS1v15(r.publicKey, hf, digest, sigBytes) } // RSAPKCS1v15SignerVerifier is a signature.SignerVerifier that uses the RSA PKCS1v15 algorithm type RSAPKCS1v15SignerVerifier struct { *RSAPKCS1v15Signer *RSAPKCS1v15Verifier } // LoadRSAPKCS1v15SignerVerifier creates a combined signer and verifier. This is a convenience object // that simply wraps an instance of RSAPKCS1v15Signer and RSAPKCS1v15Verifier. func LoadRSAPKCS1v15SignerVerifier(priv *rsa.PrivateKey, hf crypto.Hash) (*RSAPKCS1v15SignerVerifier, error) { signer, err := LoadRSAPKCS1v15Signer(priv, hf) if err != nil { return nil, fmt.Errorf("initializing signer: %w", err) } verifier, err := LoadRSAPKCS1v15Verifier(&priv.PublicKey, hf) if err != nil { return nil, fmt.Errorf("initializing verifier: %w", err) } return &RSAPKCS1v15SignerVerifier{ RSAPKCS1v15Signer: signer, RSAPKCS1v15Verifier: verifier, }, nil } // NewDefaultRSAPKCS1v15SignerVerifier creates a combined signer and verifier using RSA PKCS1v15. // This creates a new RSA key of 2048 bits and uses the SHA256 hashing algorithm. func NewDefaultRSAPKCS1v15SignerVerifier() (*RSAPKCS1v15SignerVerifier, *rsa.PrivateKey, error) { return NewRSAPKCS1v15SignerVerifier(rand.Reader, 2048, crypto.SHA256) } // NewRSAPKCS1v15SignerVerifier creates a combined signer and verifier using RSA PKCS1v15. // This creates a new RSA key of the specified length of bits, entropy source, and hash function. func NewRSAPKCS1v15SignerVerifier(rand io.Reader, bits int, hashFunc crypto.Hash) (*RSAPKCS1v15SignerVerifier, *rsa.PrivateKey, error) { priv, err := rsa.GenerateKey(rand, bits) if err != nil { return nil, nil, err } sv, err := LoadRSAPKCS1v15SignerVerifier(priv, hashFunc) if err != nil { return nil, nil, err } return sv, priv, nil } // PublicKey returns the public key that is used to verify signatures by // this verifier. As this value is held in memory, all options provided in arguments // to this method are ignored. func (r RSAPKCS1v15SignerVerifier) PublicKey(_ ...PublicKeyOption) (crypto.PublicKey, error) { return r.publicKey, nil } ================================================ FILE: vendor/github.com/sigstore/sigstore/pkg/signature/rsapss.go ================================================ // // Copyright 2021 The Sigstore Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package signature import ( "crypto" "crypto/rand" "crypto/rsa" "errors" "fmt" "io" "github.com/sigstore/sigstore/pkg/signature/options" ) // checked on LoadSigner, LoadVerifier, and SignMessage var rsaSupportedHashFuncs = []crypto.Hash{ crypto.SHA256, crypto.SHA384, crypto.SHA512, } // checked on VerifySignature. Supports SHA1 verification. var rsaSupportedVerifyHashFuncs = []crypto.Hash{ crypto.SHA1, crypto.SHA256, crypto.SHA384, crypto.SHA512, } // RSAPSSSigner is a signature.Signer that uses the RSA PSS algorithm type RSAPSSSigner struct { hashFunc crypto.Hash priv *rsa.PrivateKey pssOpts *rsa.PSSOptions } // LoadRSAPSSSigner calculates signatures using the specified private key and hash algorithm. // // If opts are specified, then they will be stored and used as a default if not overridden // by the value passed to Sign(). // // hf must be either SHA256, SHA388, or SHA512. opts.Hash is ignored. func LoadRSAPSSSigner(priv *rsa.PrivateKey, hf crypto.Hash, opts *rsa.PSSOptions) (*RSAPSSSigner, error) { if priv == nil { return nil, errors.New("invalid RSA private key specified") } if !isSupportedAlg(hf, rsaSupportedHashFuncs) { return nil, errors.New("invalid hash function specified") } return &RSAPSSSigner{ priv: priv, pssOpts: opts, hashFunc: hf, }, nil } // SignMessage signs the provided message using PSS. If the message is provided, // this method will compute the digest according to the hash function specified // when the RSAPSSSigner was created. // // This function recognizes the following Options listed in order of preference: // // - WithRand() // // - WithDigest() // // - WithCryptoSignerOpts() // // All other options are ignored if specified. func (r RSAPSSSigner) SignMessage(message io.Reader, opts ...SignOption) ([]byte, error) { digest, hf, err := ComputeDigestForSigning(message, r.hashFunc, rsaSupportedHashFuncs, opts...) if err != nil { return nil, err } rand := selectRandFromOpts(opts...) pssOpts := r.pssOpts if pssOpts == nil { pssOpts = &rsa.PSSOptions{ SaltLength: rsa.PSSSaltLengthAuto, } } pssOpts.Hash = hf return rsa.SignPSS(rand, r.priv, hf, digest, pssOpts) } // Public returns the public key that can be used to verify signatures created by // this signer. func (r RSAPSSSigner) Public() crypto.PublicKey { if r.priv == nil { return nil } return r.priv.Public() } // PublicKey returns the public key that can be used to verify signatures created by // this signer. As this value is held in memory, all options provided in arguments // to this method are ignored. func (r RSAPSSSigner) PublicKey(_ ...PublicKeyOption) (crypto.PublicKey, error) { return r.Public(), nil } // Sign computes the signature for the specified digest using PSS. // // If a source of entropy is given in rand, it will be used instead of the default value (rand.Reader // from crypto/rand). // // If opts are specified, they must be *rsa.PSSOptions. If opts are not specified, the hash function // provided when the signer was created will be assumed. func (r RSAPSSSigner) Sign(rand io.Reader, digest []byte, opts crypto.SignerOpts) ([]byte, error) { rsaOpts := []SignOption{options.WithDigest(digest), options.WithRand(rand)} if opts != nil { rsaOpts = append(rsaOpts, options.WithCryptoSignerOpts(opts)) } return r.SignMessage(nil, rsaOpts...) } // RSAPSSVerifier is a signature.Verifier that uses the RSA PSS algorithm type RSAPSSVerifier struct { publicKey *rsa.PublicKey hashFunc crypto.Hash pssOpts *rsa.PSSOptions } // LoadRSAPSSVerifier verifies signatures using the specified public key and hash algorithm. // // hf must be either SHA256, SHA388, or SHA512. opts.Hash is ignored. func LoadRSAPSSVerifier(pub *rsa.PublicKey, hashFunc crypto.Hash, opts *rsa.PSSOptions) (*RSAPSSVerifier, error) { if pub == nil { return nil, errors.New("invalid RSA public key specified") } if !isSupportedAlg(hashFunc, rsaSupportedHashFuncs) { return nil, errors.New("invalid hash function specified") } return &RSAPSSVerifier{ publicKey: pub, hashFunc: hashFunc, pssOpts: opts, }, nil } // PublicKey returns the public key that is used to verify signatures by // this verifier. As this value is held in memory, all options provided in arguments // to this method are ignored. func (r RSAPSSVerifier) PublicKey(_ ...PublicKeyOption) (crypto.PublicKey, error) { return r.publicKey, nil } // VerifySignature verifies the signature for the given message using PSS. Unless provided // in an option, the digest of the message will be computed using the hash function specified // when the RSAPSSVerifier was created. // // This function returns nil if the verification succeeded, and an error message otherwise. // // This function recognizes the following Options listed in order of preference: // // - WithDigest() // // - WithCryptoSignerOpts() // // All other options are ignored if specified. func (r RSAPSSVerifier) VerifySignature(signature, message io.Reader, opts ...VerifyOption) error { digest, hf, err := ComputeDigestForVerifying(message, r.hashFunc, rsaSupportedVerifyHashFuncs, opts...) if err != nil { return err } if signature == nil { return errors.New("nil signature passed to VerifySignature") } sigBytes, err := io.ReadAll(signature) if err != nil { return fmt.Errorf("reading signature: %w", err) } // rsa.VerifyPSS ignores pssOpts.Hash, so we don't set it pssOpts := r.pssOpts if pssOpts == nil { pssOpts = &rsa.PSSOptions{ SaltLength: rsa.PSSSaltLengthAuto, } } return rsa.VerifyPSS(r.publicKey, hf, digest, sigBytes, pssOpts) } // RSAPSSSignerVerifier is a signature.SignerVerifier that uses the RSA PSS algorithm type RSAPSSSignerVerifier struct { *RSAPSSSigner *RSAPSSVerifier } // LoadRSAPSSSignerVerifier creates a combined signer and verifier using RSA PSS. This is // a convenience object that simply wraps an instance of RSAPSSSigner and RSAPSSVerifier. func LoadRSAPSSSignerVerifier(priv *rsa.PrivateKey, hf crypto.Hash, opts *rsa.PSSOptions) (*RSAPSSSignerVerifier, error) { signer, err := LoadRSAPSSSigner(priv, hf, opts) if err != nil { return nil, fmt.Errorf("initializing signer: %w", err) } verifier, err := LoadRSAPSSVerifier(&priv.PublicKey, hf, opts) if err != nil { return nil, fmt.Errorf("initializing verifier: %w", err) } return &RSAPSSSignerVerifier{ RSAPSSSigner: signer, RSAPSSVerifier: verifier, }, nil } // NewDefaultRSAPSSSignerVerifier creates a combined signer and verifier using RSA PSS. // This creates a new RSA key of 2048 bits and uses the SHA256 hashing algorithm. func NewDefaultRSAPSSSignerVerifier() (*RSAPSSSignerVerifier, *rsa.PrivateKey, error) { return NewRSAPSSSignerVerifier(rand.Reader, 2048, crypto.SHA256) } // NewRSAPSSSignerVerifier creates a combined signer and verifier using RSA PSS. // This creates a new RSA key of the specified length of bits, entropy source, and hash function. func NewRSAPSSSignerVerifier(rand io.Reader, bits int, hashFunc crypto.Hash) (*RSAPSSSignerVerifier, *rsa.PrivateKey, error) { priv, err := rsa.GenerateKey(rand, bits) if err != nil { return nil, nil, err } sv, err := LoadRSAPSSSignerVerifier(priv, hashFunc, &rsa.PSSOptions{Hash: hashFunc}) if err != nil { return nil, nil, err } return sv, priv, nil } // PublicKey returns the public key that is used to verify signatures by // this verifier. As this value is held in memory, all options provided in arguments // to this method are ignored. func (r RSAPSSSignerVerifier) PublicKey(_ ...PublicKeyOption) (crypto.PublicKey, error) { return r.publicKey, nil } ================================================ FILE: vendor/github.com/sigstore/sigstore/pkg/signature/signer.go ================================================ // // Copyright 2021 The Sigstore Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package signature import ( "crypto" "crypto/ecdsa" "crypto/ed25519" "crypto/rsa" "errors" "io" "os" "path/filepath" // these ensure we have the implementations loaded _ "crypto/sha256" _ "crypto/sha512" "github.com/sigstore/sigstore/pkg/cryptoutils" "github.com/sigstore/sigstore/pkg/signature/options" ) // Signer creates digital signatures over a message using a specified key pair type Signer interface { PublicKeyProvider SignMessage(message io.Reader, opts ...SignOption) ([]byte, error) } // SignerOpts implements crypto.SignerOpts but also allows callers to specify // additional options that may be utilized in signing the digest provided. type SignerOpts struct { Hash crypto.Hash Opts []SignOption } // HashFunc returns the hash function for this object func (s SignerOpts) HashFunc() crypto.Hash { return s.Hash } // LoadSigner returns a signature.Signer based on the algorithm of the private key // provided. // // If privateKey is an RSA key, a RSAPKCS1v15Signer will be returned. If a // RSAPSSSigner is desired instead, use the LoadRSAPSSSigner() method directly. func LoadSigner(privateKey crypto.PrivateKey, hashFunc crypto.Hash) (Signer, error) { return LoadSignerWithOpts(privateKey, options.WithHash(hashFunc)) } // LoadSignerWithOpts returns a signature.Signer based on the algorithm of the private key // provided. func LoadSignerWithOpts(privateKey crypto.PrivateKey, opts ...LoadOption) (Signer, error) { var rsaPSSOptions *rsa.PSSOptions var useED25519ph bool hashFunc := crypto.SHA256 for _, o := range opts { o.ApplyED25519ph(&useED25519ph) o.ApplyHash(&hashFunc) o.ApplyRSAPSS(&rsaPSSOptions) } switch pk := privateKey.(type) { case *rsa.PrivateKey: if rsaPSSOptions != nil { return LoadRSAPSSSigner(pk, hashFunc, rsaPSSOptions) } return LoadRSAPKCS1v15Signer(pk, hashFunc) case *ecdsa.PrivateKey: return LoadECDSASigner(pk, hashFunc) case ed25519.PrivateKey: if useED25519ph { return LoadED25519phSigner(pk) } return LoadED25519Signer(pk) } return nil, errors.New("unsupported public key type") } // LoadSignerFromPEMFile returns a signature.Signer based on the algorithm of the private key // in the file. The Signer will use the hash function specified when computing digests. // // If key is an RSA key, a RSAPKCS1v15Signer will be returned. If a // RSAPSSSigner is desired instead, use the LoadRSAPSSSigner() and // cryptoutils.UnmarshalPEMToPrivateKey() methods directly. func LoadSignerFromPEMFile(path string, hashFunc crypto.Hash, pf cryptoutils.PassFunc) (Signer, error) { fileBytes, err := os.ReadFile(filepath.Clean(path)) if err != nil { return nil, err } priv, err := cryptoutils.UnmarshalPEMToPrivateKey(fileBytes, pf) if err != nil { return nil, err } return LoadSigner(priv, hashFunc) } // LoadSignerFromPEMFileWithOpts returns a signature.Signer based on the algorithm of the private key // in the file. The Signer will use the hash function specified in the options when computing digests. func LoadSignerFromPEMFileWithOpts(path string, pf cryptoutils.PassFunc, opts ...LoadOption) (Signer, error) { fileBytes, err := os.ReadFile(filepath.Clean(path)) if err != nil { return nil, err } priv, err := cryptoutils.UnmarshalPEMToPrivateKey(fileBytes, pf) if err != nil { return nil, err } return LoadSignerWithOpts(priv, opts...) } // LoadDefaultSigner returns a signature.Signer based on the private key. // Each private key has a corresponding PublicKeyDetails associated in the // Sigstore ecosystem, see Algorithm Registry for more details. func LoadDefaultSigner(privateKey crypto.PrivateKey, opts ...LoadOption) (Signer, error) { signer, ok := privateKey.(crypto.Signer) if !ok { return nil, errors.New("private key does not implement signature.Signer") } algorithmDetails, err := GetDefaultAlgorithmDetails(signer.Public(), opts...) if err != nil { return nil, err } return LoadSignerFromAlgorithmDetails(privateKey, algorithmDetails, opts...) } // LoadSignerFromAlgorithmDetails returns a signature.Signer based on // the algorithm details and the user's choice of options. func LoadSignerFromAlgorithmDetails(privateKey crypto.PrivateKey, algorithmDetails AlgorithmDetails, opts ...LoadOption) (Signer, error) { filteredOpts := GetOptsFromAlgorithmDetails(algorithmDetails, opts...) return LoadSignerWithOpts(privateKey, filteredOpts...) } ================================================ FILE: vendor/github.com/sigstore/sigstore/pkg/signature/signerverifier.go ================================================ // // Copyright 2021 The Sigstore Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package signature import ( "crypto" "crypto/ecdsa" "crypto/ed25519" "crypto/rsa" "errors" "os" "path/filepath" "github.com/sigstore/sigstore/pkg/cryptoutils" "github.com/sigstore/sigstore/pkg/signature/options" ) // SignerVerifier creates and verifies digital signatures over a message using a specified key pair type SignerVerifier interface { Signer Verifier } // LoadSignerVerifier returns a signature.SignerVerifier based on the algorithm of the private key // provided. // // If privateKey is an RSA key, a RSAPKCS1v15SignerVerifier will be returned. If a // RSAPSSSignerVerifier is desired instead, use the LoadRSAPSSSignerVerifier() method directly. func LoadSignerVerifier(privateKey crypto.PrivateKey, hashFunc crypto.Hash) (SignerVerifier, error) { return LoadSignerVerifierWithOpts(privateKey, options.WithHash(hashFunc)) } // LoadSignerVerifierWithOpts returns a signature.SignerVerifier based on the // algorithm of the private key provided and the user's choice. func LoadSignerVerifierWithOpts(privateKey crypto.PrivateKey, opts ...LoadOption) (SignerVerifier, error) { var rsaPSSOptions *rsa.PSSOptions var useED25519ph bool hashFunc := crypto.SHA256 for _, o := range opts { o.ApplyED25519ph(&useED25519ph) o.ApplyHash(&hashFunc) o.ApplyRSAPSS(&rsaPSSOptions) } switch pk := privateKey.(type) { case *rsa.PrivateKey: if rsaPSSOptions != nil { return LoadRSAPSSSignerVerifier(pk, hashFunc, rsaPSSOptions) } return LoadRSAPKCS1v15SignerVerifier(pk, hashFunc) case *ecdsa.PrivateKey: return LoadECDSASignerVerifier(pk, hashFunc) case ed25519.PrivateKey: if useED25519ph { return LoadED25519phSignerVerifier(pk) } return LoadED25519SignerVerifier(pk) } return nil, errors.New("unsupported public key type") } // LoadSignerVerifierFromPEMFile returns a signature.SignerVerifier based on the algorithm of the private key // in the file. The SignerVerifier will use the hash function specified when computing digests. // // If publicKey is an RSA key, a RSAPKCS1v15SignerVerifier will be returned. If a // RSAPSSSignerVerifier is desired instead, use the LoadRSAPSSSignerVerifier() and // cryptoutils.UnmarshalPEMToPrivateKey() methods directly. func LoadSignerVerifierFromPEMFile(path string, hashFunc crypto.Hash, pf cryptoutils.PassFunc) (SignerVerifier, error) { fileBytes, err := os.ReadFile(filepath.Clean(path)) if err != nil { return nil, err } priv, err := cryptoutils.UnmarshalPEMToPrivateKey(fileBytes, pf) if err != nil { return nil, err } return LoadSignerVerifier(priv, hashFunc) } // LoadSignerVerifierFromPEMFileWithOpts returns a signature.SignerVerifier based on the algorithm of the private key // in the file. The SignerVerifier will use the hash function specified in the options when computing digests. func LoadSignerVerifierFromPEMFileWithOpts(path string, pf cryptoutils.PassFunc, opts ...LoadOption) (SignerVerifier, error) { fileBytes, err := os.ReadFile(filepath.Clean(path)) if err != nil { return nil, err } priv, err := cryptoutils.UnmarshalPEMToPrivateKey(fileBytes, pf) if err != nil { return nil, err } return LoadSignerVerifierWithOpts(priv, opts...) } // LoadDefaultSignerVerifier returns a signature.SignerVerifier based on // the private key. Each private key has a corresponding PublicKeyDetails // associated in the Sigstore ecosystem, see Algorithm Registry for more details. func LoadDefaultSignerVerifier(privateKey crypto.PrivateKey, opts ...LoadOption) (SignerVerifier, error) { signer, ok := privateKey.(crypto.Signer) if !ok { return nil, errors.New("private key does not implement signature.Signer") } algorithmDetails, err := GetDefaultAlgorithmDetails(signer.Public(), opts...) if err != nil { return nil, err } return LoadSignerVerifierFromAlgorithmDetails(privateKey, algorithmDetails, opts...) } // LoadSignerVerifierFromAlgorithmDetails returns a signature.SignerVerifier based on // the algorithm details and the user's choice of options. func LoadSignerVerifierFromAlgorithmDetails(privateKey crypto.PrivateKey, algorithmDetails AlgorithmDetails, opts ...LoadOption) (SignerVerifier, error) { filteredOpts := GetOptsFromAlgorithmDetails(algorithmDetails, opts...) return LoadSignerVerifierWithOpts(privateKey, filteredOpts...) } ================================================ FILE: vendor/github.com/sigstore/sigstore/pkg/signature/util.go ================================================ // // Copyright 2021 The Sigstore Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package signature import ( "bytes" "crypto/rsa" "encoding/json" "fmt" "github.com/google/go-containerregistry/pkg/name" "github.com/sigstore/sigstore/pkg/signature/options" sigpayload "github.com/sigstore/sigstore/pkg/signature/payload" ) // SignImage signs a container manifest using the specified signer object func SignImage(signer SignerVerifier, image name.Digest, optionalAnnotations map[string]interface{}) (payload, signature []byte, err error) { imgPayload := sigpayload.Cosign{ Image: image, Annotations: optionalAnnotations, } payload, err = json.Marshal(imgPayload) if err != nil { return nil, nil, fmt.Errorf("failed to marshal payload to JSON: %w", err) } signature, err = signer.SignMessage(bytes.NewReader(payload)) if err != nil { return nil, nil, fmt.Errorf("failed to sign payload: %w", err) } return payload, signature, nil } // VerifyImageSignature verifies a signature over a container manifest func VerifyImageSignature(signer SignerVerifier, payload, signature []byte) (image name.Digest, annotations map[string]interface{}, err error) { if err := signer.VerifySignature(bytes.NewReader(signature), bytes.NewReader(payload)); err != nil { return name.Digest{}, nil, fmt.Errorf("signature verification failed: %w", err) } var imgPayload sigpayload.Cosign if err := json.Unmarshal(payload, &imgPayload); err != nil { return name.Digest{}, nil, fmt.Errorf("could not deserialize image payload: %w", err) } return imgPayload.Image, imgPayload.Annotations, nil } // GetOptsFromAlgorithmDetails returns a list of LoadOptions that are // appropriate for the given algorithm details. It ignores the hash type because // that can be retrieved from the algorithm details. func GetOptsFromAlgorithmDetails(algorithmDetails AlgorithmDetails, opts ...LoadOption) []LoadOption { res := []LoadOption{options.WithHash(algorithmDetails.hashType)} for _, opt := range opts { var useED25519ph bool var rsaPSSOptions *rsa.PSSOptions opt.ApplyED25519ph(&useED25519ph) opt.ApplyRSAPSS(&rsaPSSOptions) if useED25519ph || rsaPSSOptions != nil { res = append(res, opt) } } return res } ================================================ FILE: vendor/github.com/sigstore/sigstore/pkg/signature/verifier.go ================================================ // // Copyright 2021 The Sigstore Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package signature import ( "crypto" "crypto/ecdsa" "crypto/ed25519" "crypto/rsa" "errors" "io" "os" "path/filepath" "github.com/sigstore/sigstore/pkg/cryptoutils" "github.com/sigstore/sigstore/pkg/signature/options" ) // Verifier verifies the digital signature using a specified public key type Verifier interface { PublicKeyProvider VerifySignature(signature, message io.Reader, opts ...VerifyOption) error } // LoadVerifier returns a signature.Verifier based on the algorithm of the public key // provided that will use the hash function specified when computing digests. // // If publicKey is an RSA key, a RSAPKCS1v15Verifier will be returned. If a // RSAPSSVerifier is desired instead, use the LoadRSAPSSVerifier() method directly. func LoadVerifier(publicKey crypto.PublicKey, hashFunc crypto.Hash) (Verifier, error) { return LoadVerifierWithOpts(publicKey, options.WithHash(hashFunc)) } // LoadVerifierWithOpts returns a signature.Verifier based on the algorithm of the public key // provided that will use the hash function specified when computing digests. func LoadVerifierWithOpts(publicKey crypto.PublicKey, opts ...LoadOption) (Verifier, error) { var rsaPSSOptions *rsa.PSSOptions var useED25519ph bool hashFunc := crypto.SHA256 for _, o := range opts { o.ApplyED25519ph(&useED25519ph) o.ApplyHash(&hashFunc) o.ApplyRSAPSS(&rsaPSSOptions) } switch pk := publicKey.(type) { case *rsa.PublicKey: if rsaPSSOptions != nil { return LoadRSAPSSVerifier(pk, hashFunc, rsaPSSOptions) } return LoadRSAPKCS1v15Verifier(pk, hashFunc) case *ecdsa.PublicKey: return LoadECDSAVerifier(pk, hashFunc) case ed25519.PublicKey: if useED25519ph { return LoadED25519phVerifier(pk) } return LoadED25519Verifier(pk) } return nil, errors.New("unsupported public key type") } // LoadUnsafeVerifier returns a signature.Verifier based on the algorithm of the public key // provided that will use SHA1 when computing digests for RSA and ECDSA signatures. // // If publicKey is an RSA key, a RSAPKCS1v15Verifier will be returned. If a // RSAPSSVerifier is desired instead, use the LoadRSAPSSVerifier() method directly. func LoadUnsafeVerifier(publicKey crypto.PublicKey) (Verifier, error) { switch pk := publicKey.(type) { case *rsa.PublicKey: if pk == nil { return nil, errors.New("invalid RSA public key specified") } return &RSAPKCS1v15Verifier{ publicKey: pk, hashFunc: crypto.SHA1, }, nil case *ecdsa.PublicKey: if pk == nil { return nil, errors.New("invalid ECDSA public key specified") } return &ECDSAVerifier{ publicKey: pk, hashFunc: crypto.SHA1, }, nil case ed25519.PublicKey: return LoadED25519Verifier(pk) } return nil, errors.New("unsupported public key type") } // LoadVerifierFromPEMFile returns a signature.Verifier based on the contents of a // file located at path. The Verifier wil use the hash function specified when computing digests. // // If the publickey is an RSA key, a RSAPKCS1v15Verifier will be returned. If a // RSAPSSVerifier is desired instead, use the LoadRSAPSSVerifier() and cryptoutils.UnmarshalPEMToPublicKey() methods directly. func LoadVerifierFromPEMFile(path string, hashFunc crypto.Hash) (Verifier, error) { fileBytes, err := os.ReadFile(filepath.Clean(path)) if err != nil { return nil, err } pubKey, err := cryptoutils.UnmarshalPEMToPublicKey(fileBytes) if err != nil { return nil, err } return LoadVerifier(pubKey, hashFunc) } // LoadVerifierFromPEMFileWithOpts returns a signature.Verifier based on the contents of a // file located at path. The Verifier wil use the hash function specified in the options when computing digests. func LoadVerifierFromPEMFileWithOpts(path string, opts ...LoadOption) (Verifier, error) { fileBytes, err := os.ReadFile(filepath.Clean(path)) if err != nil { return nil, err } pubKey, err := cryptoutils.UnmarshalPEMToPublicKey(fileBytes) if err != nil { return nil, err } return LoadVerifierWithOpts(pubKey, opts...) } // LoadDefaultVerifier returns a signature.Verifier based on the public key. // Each public key has a corresponding PublicKeyDetails associated in the // Sigstore ecosystem, see Algorithm Registry for more details. func LoadDefaultVerifier(publicKey crypto.PublicKey, opts ...LoadOption) (Verifier, error) { algorithmDetails, err := GetDefaultAlgorithmDetails(publicKey, opts...) if err != nil { return nil, err } return LoadVerifierFromAlgorithmDetails(publicKey, algorithmDetails, opts...) } // LoadVerifierFromAlgorithmDetails returns a signature.Verifier based on // the algorithm details and the user's choice of options. func LoadVerifierFromAlgorithmDetails(publicKey crypto.PublicKey, algorithmDetails AlgorithmDetails, opts ...LoadOption) (Verifier, error) { filteredOpts := GetOptsFromAlgorithmDetails(algorithmDetails, opts...) return LoadVerifierWithOpts(publicKey, filteredOpts...) } ================================================ FILE: vendor/github.com/smallstep/pkcs7/.gitignore ================================================ # Compiled Object files, Static and Dynamic libs (Shared Objects) *.o *.a *.so # Folders _obj _test # Architecture specific extensions/prefixes *.[568vq] [568vq].out *.cgo1.go *.cgo2.c _cgo_defun.c _cgo_gotypes.go _cgo_export.* _testmain.go *.exe *.test *.prof # Development .envrc coverage.out ================================================ FILE: vendor/github.com/smallstep/pkcs7/LICENSE ================================================ The MIT License (MIT) Copyright (c) 2015 Andrew Smith Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: vendor/github.com/smallstep/pkcs7/Makefile ================================================ all: vet staticcheck test test: go test -covermode=count -coverprofile=coverage.out . showcoverage: test go tool cover -html=coverage.out vet: go vet . lint: golint . staticcheck: staticcheck . gettools: go get -u honnef.co/go/tools/... go get -u golang.org/x/lint/golint ================================================ FILE: vendor/github.com/smallstep/pkcs7/README.md ================================================ # pkcs7 [![Go Reference](https://pkg.go.dev/badge/github.com/smallstep/pkcs7.svg)](https://pkg.go.dev/github.com/smallstep/pkcs7) [![Build Status](https://github.com/smallstep/pkcs7/workflows/CI/badge.svg?query=branch%3Amain+event%3Apush)](https://github.com/smallstep/pkcs7/actions/workflows/ci.yml?query=branch%3Amain+event%3Apush) pkcs7 implements parsing and creating signed and enveloped messages. ```go package main import ( "bytes" "crypto/rsa" "crypto/x509" "encoding/pem" "fmt" "os" "github.com/smallstep/pkcs7" ) func SignAndDetach(content []byte, cert *x509.Certificate, privkey *rsa.PrivateKey) (signed []byte, err error) { toBeSigned, err := NewSignedData(content) if err != nil { return fmt.Errorf("Cannot initialize signed data: %w", err) } if err = toBeSigned.AddSigner(cert, privkey, SignerInfoConfig{}); err != nil { return fmt.Errorf("Cannot add signer: %w", err) } // Detach signature, omit if you want an embedded signature toBeSigned.Detach() signed, err = toBeSigned.Finish() if err != nil { return fmt.Errorf("Cannot finish signing data: %w", err) } // Verify the signature pem.Encode(os.Stdout, &pem.Block{Type: "PKCS7", Bytes: signed}) p7, err := pkcs7.Parse(signed) if err != nil { return fmt.Errorf("Cannot parse our signed data: %w", err) } // since the signature was detached, reattach the content here p7.Content = content if bytes.Compare(content, p7.Content) != 0 { return fmt.Errorf("Our content was not in the parsed data:\n\tExpected: %s\n\tActual: %s", content, p7.Content) } if err = p7.Verify(); err != nil { return fmt.Errorf("Cannot verify our signed data: %w", err) } return signed, nil } ``` ## Credits This is a fork of [mozilla-services/pkcs7](https://github.com/mozilla-services/pkcs7) which, itself, was a fork of [fullsailor/pkcs7](https://github.com/fullsailor/pkcs7). ================================================ FILE: vendor/github.com/smallstep/pkcs7/ber.go ================================================ package pkcs7 import ( "bytes" "errors" ) type asn1Object interface { EncodeTo(writer *bytes.Buffer) error } type asn1Structured struct { tagBytes []byte content []asn1Object } func (s asn1Structured) EncodeTo(out *bytes.Buffer) error { inner := new(bytes.Buffer) for _, obj := range s.content { err := obj.EncodeTo(inner) if err != nil { return err } } out.Write(s.tagBytes) encodeLength(out, inner.Len()) out.Write(inner.Bytes()) return nil } type asn1Primitive struct { tagBytes []byte length int content []byte } func (p asn1Primitive) EncodeTo(out *bytes.Buffer) error { _, err := out.Write(p.tagBytes) if err != nil { return err } if err = encodeLength(out, p.length); err != nil { return err } // fmt.Printf("%s--> tag: % X length: %d\n", strings.Repeat("| ", encodeIndent), p.tagBytes, p.length) // fmt.Printf("%s--> content length: %d\n", strings.Repeat("| ", encodeIndent), len(p.content)) out.Write(p.content) return nil } func ber2der(ber []byte) ([]byte, error) { if len(ber) == 0 { return nil, errors.New("ber2der: input ber is empty") } // fmt.Printf("--> ber2der: Transcoding %d bytes\n", len(ber)) out := new(bytes.Buffer) obj, _, err := readObject(ber, 0) if err != nil { return nil, err } obj.EncodeTo(out) // if offset < len(ber) { // return nil, fmt.Errorf("ber2der: Content longer than expected. Got %d, expected %d", offset, len(ber)) // } return out.Bytes(), nil } // encodes lengths that are longer than 127 into string of bytes func marshalLongLength(out *bytes.Buffer, i int) (err error) { n := lengthLength(i) for ; n > 0; n-- { err = out.WriteByte(byte(i >> uint((n-1)*8))) if err != nil { return } } return nil } // computes the byte length of an encoded length value func lengthLength(i int) (numBytes int) { numBytes = 1 for i > 255 { numBytes++ i >>= 8 } return } // encodes the length in DER format // If the length fits in 7 bits, the value is encoded directly. // // Otherwise, the number of bytes to encode the length is first determined. // This number is likely to be 4 or less for a 32bit length. This number is // added to 0x80. The length is encoded in big endian encoding follow after // // Examples: // length | byte 1 | bytes n // 0 | 0x00 | - // 120 | 0x78 | - // 200 | 0x81 | 0xC8 // 500 | 0x82 | 0x01 0xF4 // func encodeLength(out *bytes.Buffer, length int) (err error) { if length >= 128 { l := lengthLength(length) err = out.WriteByte(0x80 | byte(l)) if err != nil { return } err = marshalLongLength(out, length) if err != nil { return } } else { err = out.WriteByte(byte(length)) if err != nil { return } } return } func readObject(ber []byte, offset int) (asn1Object, int, error) { berLen := len(ber) if offset >= berLen { return nil, 0, errors.New("ber2der: offset is after end of ber data") } tagStart := offset b := ber[offset] offset++ if offset >= berLen { return nil, 0, errors.New("ber2der: cannot move offset forward, end of ber data reached") } tag := b & 0x1F // last 5 bits if tag == 0x1F { tag = 0 for ber[offset] >= 0x80 { tag = tag*128 + ber[offset] - 0x80 offset++ if offset > berLen { return nil, 0, errors.New("ber2der: cannot move offset forward, end of ber data reached") } } // jvehent 20170227: this doesn't appear to be used anywhere... // tag = tag*128 + ber[offset] - 0x80 offset++ if offset > berLen { return nil, 0, errors.New("ber2der: cannot move offset forward, end of ber data reached") } } tagEnd := offset kind := b & 0x20 if kind == 0 { debugprint("--> Primitive\n") } else { debugprint("--> Constructed\n") } // read length var length int l := ber[offset] offset++ if offset > berLen { return nil, 0, errors.New("ber2der: cannot move offset forward, end of ber data reached") } indefinite := false if l > 0x80 { numberOfBytes := (int)(l & 0x7F) if numberOfBytes > 4 { // int is only guaranteed to be 32bit return nil, 0, errors.New("ber2der: BER tag length too long") } if numberOfBytes == 4 && (int)(ber[offset]) > 0x7F { return nil, 0, errors.New("ber2der: BER tag length is negative") } if (int)(ber[offset]) == 0x0 { return nil, 0, errors.New("ber2der: BER tag length has leading zero") } debugprint("--> (compute length) indicator byte: %x\n", l) debugprint("--> (compute length) length bytes: % X\n", ber[offset:offset+numberOfBytes]) for i := 0; i < numberOfBytes; i++ { length = length*256 + (int)(ber[offset]) offset++ if offset > berLen { return nil, 0, errors.New("ber2der: cannot move offset forward, end of ber data reached") } } } else if l == 0x80 { indefinite = true } else { length = (int)(l) } if length < 0 { return nil, 0, errors.New("ber2der: invalid negative value found in BER tag length") } // fmt.Printf("--> length : %d\n", length) contentEnd := offset + length if contentEnd > len(ber) { return nil, 0, errors.New("ber2der: BER tag length is more than available data") } debugprint("--> content start : %d\n", offset) debugprint("--> content end : %d\n", contentEnd) debugprint("--> content : % X\n", ber[offset:contentEnd]) var obj asn1Object if indefinite && kind == 0 { return nil, 0, errors.New("ber2der: Indefinite form tag must have constructed encoding") } if kind == 0 { obj = asn1Primitive{ tagBytes: ber[tagStart:tagEnd], length: length, content: ber[offset:contentEnd], } } else { var subObjects []asn1Object for (offset < contentEnd) || indefinite { var subObj asn1Object var err error subObj, offset, err = readObject(ber, offset) if err != nil { return nil, 0, err } subObjects = append(subObjects, subObj) if indefinite { terminated, err := isIndefiniteTermination(ber, offset) if err != nil { return nil, 0, err } if terminated { break } } } obj = asn1Structured{ tagBytes: ber[tagStart:tagEnd], content: subObjects, } } // Apply indefinite form length with 0x0000 terminator. if indefinite { contentEnd = offset + 2 } return obj, contentEnd, nil } func isIndefiniteTermination(ber []byte, offset int) (bool, error) { if len(ber)-offset < 2 { return false, errors.New("ber2der: Invalid BER format") } return bytes.Index(ber[offset:], []byte{0x0, 0x0}) == 0, nil } func debugprint(format string, a ...interface{}) { // fmt.Printf(format, a) } ================================================ FILE: vendor/github.com/smallstep/pkcs7/decrypt.go ================================================ package pkcs7 import ( "bytes" "crypto" "crypto/aes" "crypto/cipher" "crypto/des" "crypto/rand" "crypto/rsa" "crypto/x509" "crypto/x509/pkix" "encoding/asn1" "errors" "fmt" ) // ErrUnsupportedAlgorithm tells you when our quick dev assumptions have failed var ErrUnsupportedAlgorithm = errors.New("pkcs7: cannot decrypt data: only RSA, DES, DES-EDE3, AES-256-CBC and AES-128-GCM supported") // ErrUnsupportedAsymmetricEncryptionAlgorithm is returned when attempting to use an unknown asymmetric encryption algorithm var ErrUnsupportedAsymmetricEncryptionAlgorithm = errors.New("pkcs7: cannot decrypt data: only RSA PKCS#1 v1.5 and RSA OAEP are supported") // ErrUnsupportedKeyType is returned when attempting to encrypting keys using a key that's not an RSA key var ErrUnsupportedKeyType = errors.New("pkcs7: only RSA keys are supported") // ErrNotEncryptedContent is returned when attempting to Decrypt data that is not encrypted data var ErrNotEncryptedContent = errors.New("pkcs7: content data is a decryptable data type") // Decrypt decrypts encrypted content info for recipient cert and private key func (p7 *PKCS7) Decrypt(cert *x509.Certificate, pkey crypto.PrivateKey) ([]byte, error) { data, ok := p7.raw.(envelopedData) if !ok { return nil, ErrNotEncryptedContent } recipient := selectRecipientForCertificate(data.RecipientInfos, cert) if recipient.EncryptedKey == nil { return nil, errors.New("pkcs7: no enveloped recipient for provided certificate") } switch pkey := pkey.(type) { case crypto.Decrypter: var opts crypto.DecrypterOpts switch algorithm := recipient.KeyEncryptionAlgorithm.Algorithm; { case algorithm.Equal(OIDEncryptionAlgorithmRSAESOAEP): hashFunc, err := getHashFuncForKeyEncryptionAlgorithm(recipient.KeyEncryptionAlgorithm) if err != nil { return nil, err } opts = &rsa.OAEPOptions{Hash: hashFunc} case algorithm.Equal(OIDEncryptionAlgorithmRSA): opts = &rsa.PKCS1v15DecryptOptions{} default: return nil, ErrUnsupportedAsymmetricEncryptionAlgorithm } contentKey, err := pkey.Decrypt(rand.Reader, recipient.EncryptedKey, opts) if err != nil { return nil, err } return data.EncryptedContentInfo.decrypt(contentKey) } return nil, ErrUnsupportedAlgorithm } // RFC 4055, 4.1 // The current ASN.1 parser does not support non-integer defaults so the 'default:' tags here do nothing. type rsaOAEPAlgorithmParameters struct { HashFunc pkix.AlgorithmIdentifier `asn1:"optional,explicit,tag:0,default:sha1Identifier"` MaskGenFunc pkix.AlgorithmIdentifier `asn1:"optional,explicit,tag:1,default:mgf1SHA1Identifier"` PSourceFunc pkix.AlgorithmIdentifier `asn1:"optional,explicit,tag:2,default:pSpecifiedEmptyIdentifier"` } func getHashFuncForKeyEncryptionAlgorithm(keyEncryptionAlgorithm pkix.AlgorithmIdentifier) (crypto.Hash, error) { invalidHashFunc := crypto.Hash(0) params := &rsaOAEPAlgorithmParameters{ HashFunc: pkix.AlgorithmIdentifier{Algorithm: OIDDigestAlgorithmSHA1}, // set default hash algorithm to SHA1 } var rest []byte rest, err := asn1.Unmarshal(keyEncryptionAlgorithm.Parameters.FullBytes, params) if err != nil { return invalidHashFunc, fmt.Errorf("pkcs7: failed unmarshaling key encryption algorithm parameters: %v", err) } if len(rest) != 0 { return invalidHashFunc, errors.New("pkcs7: trailing data after RSA OAEP parameters") } switch { case params.HashFunc.Algorithm.Equal(OIDDigestAlgorithmSHA1): return crypto.SHA1, nil case params.HashFunc.Algorithm.Equal(OIDDigestAlgorithmSHA224): return crypto.SHA224, nil case params.HashFunc.Algorithm.Equal(OIDDigestAlgorithmSHA256): return crypto.SHA256, nil case params.HashFunc.Algorithm.Equal(OIDDigestAlgorithmSHA384): return crypto.SHA384, nil case params.HashFunc.Algorithm.Equal(OIDDigestAlgorithmSHA512): return crypto.SHA512, nil default: return invalidHashFunc, errors.New("pkcs7: unsupported hash function for RSA OAEP") } } // DecryptUsingPSK decrypts encrypted data using caller provided // pre-shared secret func (p7 *PKCS7) DecryptUsingPSK(key []byte) ([]byte, error) { data, ok := p7.raw.(encryptedData) if !ok { return nil, ErrNotEncryptedContent } return data.EncryptedContentInfo.decrypt(key) } func (eci encryptedContentInfo) decrypt(key []byte) ([]byte, error) { alg := eci.ContentEncryptionAlgorithm.Algorithm if !alg.Equal(OIDEncryptionAlgorithmDESCBC) && !alg.Equal(OIDEncryptionAlgorithmDESEDE3CBC) && !alg.Equal(OIDEncryptionAlgorithmAES256CBC) && !alg.Equal(OIDEncryptionAlgorithmAES128CBC) && !alg.Equal(OIDEncryptionAlgorithmAES128GCM) && !alg.Equal(OIDEncryptionAlgorithmAES256GCM) { return nil, ErrUnsupportedAlgorithm } // EncryptedContent can either be constructed of multple OCTET STRINGs // or _be_ a tagged OCTET STRING var cyphertext []byte if eci.EncryptedContent.IsCompound { // Complex case to concat all of the children OCTET STRINGs var buf bytes.Buffer cypherbytes := eci.EncryptedContent.Bytes for { var part []byte cypherbytes, _ = asn1.Unmarshal(cypherbytes, &part) buf.Write(part) if cypherbytes == nil { break } } cyphertext = buf.Bytes() } else { // Simple case, the bytes _are_ the cyphertext cyphertext = eci.EncryptedContent.Bytes } var block cipher.Block var err error switch { case alg.Equal(OIDEncryptionAlgorithmDESCBC): block, err = des.NewCipher(key) case alg.Equal(OIDEncryptionAlgorithmDESEDE3CBC): block, err = des.NewTripleDESCipher(key) case alg.Equal(OIDEncryptionAlgorithmAES256CBC), alg.Equal(OIDEncryptionAlgorithmAES256GCM): fallthrough case alg.Equal(OIDEncryptionAlgorithmAES128GCM), alg.Equal(OIDEncryptionAlgorithmAES128CBC): block, err = aes.NewCipher(key) } if err != nil { return nil, err } if alg.Equal(OIDEncryptionAlgorithmAES128GCM) || alg.Equal(OIDEncryptionAlgorithmAES256GCM) { params := aesGCMParameters{} paramBytes := eci.ContentEncryptionAlgorithm.Parameters.Bytes _, err := asn1.Unmarshal(paramBytes, ¶ms) if err != nil { return nil, err } gcm, err := cipher.NewGCM(block) if err != nil { return nil, err } if len(params.Nonce) != gcm.NonceSize() { return nil, errors.New("pkcs7: encryption algorithm parameters are incorrect") } if params.ICVLen != gcm.Overhead() { return nil, errors.New("pkcs7: encryption algorithm parameters are incorrect") } plaintext, err := gcm.Open(nil, params.Nonce, cyphertext, nil) if err != nil { return nil, err } return plaintext, nil } iv := eci.ContentEncryptionAlgorithm.Parameters.Bytes if len(iv) != block.BlockSize() { return nil, errors.New("pkcs7: encryption algorithm parameters are malformed") } mode := cipher.NewCBCDecrypter(block, iv) plaintext := make([]byte, len(cyphertext)) mode.CryptBlocks(plaintext, cyphertext) if plaintext, err = unpad(plaintext, mode.BlockSize()); err != nil { return nil, err } return plaintext, nil } func unpad(data []byte, blocklen int) ([]byte, error) { if blocklen < 1 { return nil, fmt.Errorf("pkcs7: invalid blocklen %d", blocklen) } if len(data)%blocklen != 0 || len(data) == 0 { return nil, fmt.Errorf("pkcs7: invalid data len %d", len(data)) } // the last byte is the length of padding padlen := int(data[len(data)-1]) // check padding integrity, all bytes should be the same pad := data[len(data)-padlen:] for _, padbyte := range pad { if padbyte != byte(padlen) { return nil, errors.New("pkcs7: invalid padding") } } return data[:len(data)-padlen], nil } func selectRecipientForCertificate(recipients []recipientInfo, cert *x509.Certificate) recipientInfo { for _, recp := range recipients { if isCertMatchForIssuerAndSerial(cert, recp.IssuerAndSerialNumber) { return recp } } return recipientInfo{} } ================================================ FILE: vendor/github.com/smallstep/pkcs7/encrypt.go ================================================ package pkcs7 import ( "bytes" "crypto" "crypto/aes" "crypto/cipher" "crypto/des" "crypto/rand" "crypto/rsa" "crypto/x509" "crypto/x509/pkix" "encoding/asn1" "errors" "fmt" ) type envelopedData struct { Version int RecipientInfos []recipientInfo `asn1:"set"` EncryptedContentInfo encryptedContentInfo } type encryptedData struct { Version int EncryptedContentInfo encryptedContentInfo } type recipientInfo struct { Version int IssuerAndSerialNumber issuerAndSerial KeyEncryptionAlgorithm pkix.AlgorithmIdentifier EncryptedKey []byte } type encryptedContentInfo struct { ContentType asn1.ObjectIdentifier ContentEncryptionAlgorithm pkix.AlgorithmIdentifier EncryptedContent asn1.RawValue `asn1:"tag:0,optional"` } const ( // EncryptionAlgorithmDESCBC is the DES CBC encryption algorithm EncryptionAlgorithmDESCBC = iota // EncryptionAlgorithmAES128CBC is the AES 128 bits with CBC encryption algorithm // Avoid this algorithm unless required for interoperability; use AES GCM instead. EncryptionAlgorithmAES128CBC // EncryptionAlgorithmAES256CBC is the AES 256 bits with CBC encryption algorithm // Avoid this algorithm unless required for interoperability; use AES GCM instead. EncryptionAlgorithmAES256CBC // EncryptionAlgorithmAES128GCM is the AES 128 bits with GCM encryption algorithm EncryptionAlgorithmAES128GCM // EncryptionAlgorithmAES256GCM is the AES 256 bits with GCM encryption algorithm EncryptionAlgorithmAES256GCM ) // ContentEncryptionAlgorithm determines the algorithm used to encrypt the // plaintext message. Change the value of this variable to change which // algorithm is used in the Encrypt() function. var ContentEncryptionAlgorithm = EncryptionAlgorithmDESCBC // ErrUnsupportedEncryptionAlgorithm is returned when attempting to encrypt // content with an unsupported algorithm. var ErrUnsupportedEncryptionAlgorithm = errors.New("pkcs7: cannot encrypt content: only DES-CBC, AES-CBC, and AES-GCM supported") // KeyEncryptionAlgorithm determines the algorithm used to encrypt a // content key. Change the value of this variable to change which // algorithm is used in the Encrypt() function. var KeyEncryptionAlgorithm = OIDEncryptionAlgorithmRSA // ErrUnsupportedKeyEncryptionAlgorithm is returned when an // unsupported key encryption algorithm OID is provided. var ErrUnsupportedKeyEncryptionAlgorithm = errors.New("pkcs7: unsupported key encryption algorithm provided") // KeyEncryptionHash determines the crypto.Hash algorithm to use // when encrypting a content key. Change the value of this variable // to change which algorithm is used in the Encrypt() function. var KeyEncryptionHash = crypto.SHA256 // ErrUnsupportedKeyEncryptionHash is returned when an // unsupported key encryption hash is provided. var ErrUnsupportedKeyEncryptionHash = errors.New("pkcs7: unsupported key encryption hash provided") // ErrPSKNotProvided is returned when attempting to encrypt // using a PSK without actually providing the PSK. var ErrPSKNotProvided = errors.New("pkcs7: cannot encrypt content: PSK not provided") const nonceSize = 12 type aesGCMParameters struct { Nonce []byte `asn1:"tag:4"` ICVLen int } func encryptAESGCM(content []byte, key []byte) ([]byte, *encryptedContentInfo, error) { var keyLen int var algID asn1.ObjectIdentifier switch ContentEncryptionAlgorithm { case EncryptionAlgorithmAES128GCM: keyLen = 16 algID = OIDEncryptionAlgorithmAES128GCM case EncryptionAlgorithmAES256GCM: keyLen = 32 algID = OIDEncryptionAlgorithmAES256GCM default: return nil, nil, fmt.Errorf("invalid ContentEncryptionAlgorithm in encryptAESGCM: %d", ContentEncryptionAlgorithm) } if key == nil { // Create AES key key = make([]byte, keyLen) _, err := rand.Read(key) if err != nil { return nil, nil, err } } // Create nonce nonce := make([]byte, nonceSize) _, err := rand.Read(nonce) if err != nil { return nil, nil, err } // Encrypt content block, err := aes.NewCipher(key) if err != nil { return nil, nil, err } gcm, err := cipher.NewGCM(block) if err != nil { return nil, nil, err } ciphertext := gcm.Seal(nil, nonce, content, nil) // Prepare ASN.1 Encrypted Content Info paramSeq := aesGCMParameters{ Nonce: nonce, ICVLen: gcm.Overhead(), } paramBytes, err := asn1.Marshal(paramSeq) if err != nil { return nil, nil, err } eci := encryptedContentInfo{ ContentType: OIDData, ContentEncryptionAlgorithm: pkix.AlgorithmIdentifier{ Algorithm: algID, Parameters: asn1.RawValue{ Tag: asn1.TagSequence, Bytes: paramBytes, }, }, EncryptedContent: marshalEncryptedContent(ciphertext), } return key, &eci, nil } func encryptDESCBC(content []byte, key []byte) ([]byte, *encryptedContentInfo, error) { if key == nil { // Create DES key key = make([]byte, 8) _, err := rand.Read(key) if err != nil { return nil, nil, err } } // Create CBC IV iv := make([]byte, des.BlockSize) _, err := rand.Read(iv) if err != nil { return nil, nil, err } // Encrypt padded content block, err := des.NewCipher(key) if err != nil { return nil, nil, err } mode := cipher.NewCBCEncrypter(block, iv) plaintext, err := pad(content, mode.BlockSize()) if err != nil { return nil, nil, err } cyphertext := make([]byte, len(plaintext)) mode.CryptBlocks(cyphertext, plaintext) // Prepare ASN.1 Encrypted Content Info eci := encryptedContentInfo{ ContentType: OIDData, ContentEncryptionAlgorithm: pkix.AlgorithmIdentifier{ Algorithm: OIDEncryptionAlgorithmDESCBC, Parameters: asn1.RawValue{Tag: 4, Bytes: iv}, }, EncryptedContent: marshalEncryptedContent(cyphertext), } return key, &eci, nil } func encryptAESCBC(content []byte, key []byte) ([]byte, *encryptedContentInfo, error) { var keyLen int var algID asn1.ObjectIdentifier switch ContentEncryptionAlgorithm { case EncryptionAlgorithmAES128CBC: keyLen = 16 algID = OIDEncryptionAlgorithmAES128CBC case EncryptionAlgorithmAES256CBC: keyLen = 32 algID = OIDEncryptionAlgorithmAES256CBC default: return nil, nil, fmt.Errorf("invalid ContentEncryptionAlgorithm in encryptAESCBC: %d", ContentEncryptionAlgorithm) } if key == nil { // Create AES key key = make([]byte, keyLen) _, err := rand.Read(key) if err != nil { return nil, nil, err } } // Create CBC IV iv := make([]byte, aes.BlockSize) _, err := rand.Read(iv) if err != nil { return nil, nil, err } // Encrypt padded content block, err := aes.NewCipher(key) if err != nil { return nil, nil, err } mode := cipher.NewCBCEncrypter(block, iv) plaintext, err := pad(content, mode.BlockSize()) if err != nil { return nil, nil, err } cyphertext := make([]byte, len(plaintext)) mode.CryptBlocks(cyphertext, plaintext) // Prepare ASN.1 Encrypted Content Info eci := encryptedContentInfo{ ContentType: OIDData, ContentEncryptionAlgorithm: pkix.AlgorithmIdentifier{ Algorithm: algID, Parameters: asn1.RawValue{Tag: 4, Bytes: iv}, }, EncryptedContent: marshalEncryptedContent(cyphertext), } return key, &eci, nil } // Encrypt creates and returns an envelope data PKCS7 structure with encrypted // recipient keys for each recipient public key. // // The algorithm used to perform encryption is determined by the current value // of the global ContentEncryptionAlgorithm package variable. By default, the // value is EncryptionAlgorithmDESCBC. To use a different algorithm, change the // value before calling Encrypt(). For example: // // ContentEncryptionAlgorithm = EncryptionAlgorithmAES256GCM // // TODO(fullsailor): Add support for encrypting content with other algorithms func Encrypt(content []byte, recipients []*x509.Certificate) ([]byte, error) { var eci *encryptedContentInfo var key []byte var err error // Apply chosen symmetric encryption method switch ContentEncryptionAlgorithm { case EncryptionAlgorithmDESCBC: key, eci, err = encryptDESCBC(content, nil) case EncryptionAlgorithmAES128CBC: fallthrough case EncryptionAlgorithmAES256CBC: key, eci, err = encryptAESCBC(content, nil) case EncryptionAlgorithmAES128GCM: fallthrough case EncryptionAlgorithmAES256GCM: key, eci, err = encryptAESGCM(content, nil) default: return nil, ErrUnsupportedEncryptionAlgorithm } if err != nil { return nil, err } // Prepare each recipient's encrypted cipher key recipientInfos := make([]recipientInfo, len(recipients)) for i, recipient := range recipients { algorithm := KeyEncryptionAlgorithm hash := KeyEncryptionHash var kea pkix.AlgorithmIdentifier switch { case algorithm.Equal(OIDEncryptionAlgorithmRSAESOAEP): parameters, err := getParametersForKeyEncryptionAlgorithm(algorithm, hash) if err != nil { return nil, fmt.Errorf("failed to get parameters for key encryption: %v", err) } kea = pkix.AlgorithmIdentifier{ Algorithm: algorithm, Parameters: parameters, } case algorithm.Equal(OIDEncryptionAlgorithmRSA): kea = pkix.AlgorithmIdentifier{ Algorithm: algorithm, } default: return nil, ErrUnsupportedKeyEncryptionAlgorithm } encrypted, err := encryptKey(key, recipient, algorithm, hash) if err != nil { return nil, err } ias, err := cert2issuerAndSerial(recipient) if err != nil { return nil, err } info := recipientInfo{ Version: 0, IssuerAndSerialNumber: ias, KeyEncryptionAlgorithm: kea, EncryptedKey: encrypted, } recipientInfos[i] = info } // Prepare envelope content envelope := envelopedData{ EncryptedContentInfo: *eci, Version: 0, RecipientInfos: recipientInfos, } innerContent, err := asn1.Marshal(envelope) if err != nil { return nil, err } // Prepare outer payload structure wrapper := contentInfo{ ContentType: OIDEnvelopedData, Content: asn1.RawValue{Class: 2, Tag: 0, IsCompound: true, Bytes: innerContent}, } return asn1.Marshal(wrapper) } func getParametersForKeyEncryptionAlgorithm(algorithm asn1.ObjectIdentifier, hash crypto.Hash) (asn1.RawValue, error) { if !algorithm.Equal(OIDEncryptionAlgorithmRSAESOAEP) { return asn1.RawValue{}, nil // return empty; not used } params := rsaOAEPAlgorithmParameters{} switch hash { case crypto.SHA1: params.HashFunc = pkix.AlgorithmIdentifier{Algorithm: OIDDigestAlgorithmSHA1} case crypto.SHA224: params.HashFunc = pkix.AlgorithmIdentifier{Algorithm: OIDDigestAlgorithmSHA224} case crypto.SHA256: params.HashFunc = pkix.AlgorithmIdentifier{Algorithm: OIDDigestAlgorithmSHA256} case crypto.SHA384: params.HashFunc = pkix.AlgorithmIdentifier{Algorithm: OIDDigestAlgorithmSHA384} case crypto.SHA512: params.HashFunc = pkix.AlgorithmIdentifier{Algorithm: OIDDigestAlgorithmSHA512} default: return asn1.RawValue{}, ErrUnsupportedAlgorithm } b, err := asn1.Marshal(params) if err != nil { return asn1.RawValue{}, fmt.Errorf("failed marshaling key encryption parameters: %v", err) } return asn1.RawValue{ FullBytes: b, }, nil } // EncryptUsingPSK creates and returns an encrypted data PKCS7 structure, // encrypted using caller provided pre-shared secret. func EncryptUsingPSK(content []byte, key []byte) ([]byte, error) { var eci *encryptedContentInfo var err error if key == nil { return nil, ErrPSKNotProvided } // Apply chosen symmetric encryption method switch ContentEncryptionAlgorithm { case EncryptionAlgorithmDESCBC: _, eci, err = encryptDESCBC(content, key) case EncryptionAlgorithmAES128GCM: fallthrough case EncryptionAlgorithmAES256GCM: _, eci, err = encryptAESGCM(content, key) default: return nil, ErrUnsupportedEncryptionAlgorithm } if err != nil { return nil, err } // Prepare encrypted-data content ed := encryptedData{ Version: 0, EncryptedContentInfo: *eci, } innerContent, err := asn1.Marshal(ed) if err != nil { return nil, err } // Prepare outer payload structure wrapper := contentInfo{ ContentType: OIDEncryptedData, Content: asn1.RawValue{Class: 2, Tag: 0, IsCompound: true, Bytes: innerContent}, } return asn1.Marshal(wrapper) } func marshalEncryptedContent(content []byte) asn1.RawValue { return asn1.RawValue{Bytes: content, Class: 2, IsCompound: false} } func encryptKey(key []byte, recipient *x509.Certificate, algorithm asn1.ObjectIdentifier, hash crypto.Hash) ([]byte, error) { pub, ok := recipient.PublicKey.(*rsa.PublicKey) if !ok { return nil, ErrUnsupportedKeyType } switch { case algorithm.Equal(OIDEncryptionAlgorithmRSA): return rsa.EncryptPKCS1v15(rand.Reader, pub, key) case algorithm.Equal(OIDEncryptionAlgorithmRSAESOAEP): return rsa.EncryptOAEP(hash.New(), rand.Reader, pub, key, nil) default: return nil, ErrUnsupportedKeyEncryptionAlgorithm } } func pad(data []byte, blocklen int) ([]byte, error) { if blocklen < 1 { return nil, fmt.Errorf("invalid blocklen %d", blocklen) } padlen := blocklen - (len(data) % blocklen) if padlen == 0 { padlen = blocklen } pad := bytes.Repeat([]byte{byte(padlen)}, padlen) return append(data, pad...), nil } ================================================ FILE: vendor/github.com/smallstep/pkcs7/internal/legacy/x509/debug.go ================================================ package legacyx509 import "fmt" // legacyGodebugSetting is a type mimicking Go's internal godebug package // settings, which are used to enable / disable certain functionalities at // build time. type legacyGodebugSetting int func (s legacyGodebugSetting) Value() string { return fmt.Sprintf("%d", s) } func (s legacyGodebugSetting) IncNonDefault() {} ================================================ FILE: vendor/github.com/smallstep/pkcs7/internal/legacy/x509/doc.go ================================================ /* Package legacyx509 is a copy of certain parts of Go's crypto/x509 package. It is based on Go 1.23, and has just the parts copied over required for parsing X509 certificates. The primary reason this copy exists is to keep support for parsing PKCS7 messages containing Simple Certificate Enrolment Protocol (SCEP) requests from Windows devices. Go 1.23 made a change marking certificates with a critical authority key identifier as invalid, which is mandated by RFC 5280, but apparently Windows marks those specific certificates as such, resulting in those SCEP requests failing from being parsed correctly. */ package legacyx509 ================================================ FILE: vendor/github.com/smallstep/pkcs7/internal/legacy/x509/oid.go ================================================ // Copyright 2023 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package legacyx509 import ( "bytes" "encoding/asn1" "errors" "math" "math/big" "math/bits" "strconv" "strings" ) var ( errInvalidOID = errors.New("invalid oid") ) // An OID represents an ASN.1 OBJECT IDENTIFIER. type OID struct { der []byte } // ParseOID parses a Object Identifier string, represented by ASCII numbers separated by dots. func ParseOID(oid string) (OID, error) { var o OID return o, o.unmarshalOIDText(oid) } func newOIDFromDER(der []byte) (OID, bool) { if len(der) == 0 || der[len(der)-1]&0x80 != 0 { return OID{}, false } start := 0 for i, v := range der { // ITU-T X.690, section 8.19.2: // The subidentifier shall be encoded in the fewest possible octets, // that is, the leading octet of the subidentifier shall not have the value 0x80. if i == start && v == 0x80 { return OID{}, false } if v&0x80 == 0 { start = i + 1 } } return OID{der}, true } // OIDFromInts creates a new OID using ints, each integer is a separate component. func OIDFromInts(oid []uint64) (OID, error) { if len(oid) < 2 || oid[0] > 2 || (oid[0] < 2 && oid[1] >= 40) { return OID{}, errInvalidOID } length := base128IntLength(oid[0]*40 + oid[1]) for _, v := range oid[2:] { length += base128IntLength(v) } der := make([]byte, 0, length) der = appendBase128Int(der, oid[0]*40+oid[1]) for _, v := range oid[2:] { der = appendBase128Int(der, v) } return OID{der}, nil } func base128IntLength(n uint64) int { if n == 0 { return 1 } return (bits.Len64(n) + 6) / 7 } func appendBase128Int(dst []byte, n uint64) []byte { for i := base128IntLength(n) - 1; i >= 0; i-- { o := byte(n >> uint(i*7)) o &= 0x7f if i != 0 { o |= 0x80 } dst = append(dst, o) } return dst } func base128BigIntLength(n *big.Int) int { if n.Cmp(big.NewInt(0)) == 0 { return 1 } return (n.BitLen() + 6) / 7 } func appendBase128BigInt(dst []byte, n *big.Int) []byte { if n.Cmp(big.NewInt(0)) == 0 { return append(dst, 0) } for i := base128BigIntLength(n) - 1; i >= 0; i-- { o := byte(big.NewInt(0).Rsh(n, uint(i)*7).Bits()[0]) o &= 0x7f if i != 0 { o |= 0x80 } dst = append(dst, o) } return dst } // AppendText implements [encoding.TextAppender] func (o OID) AppendText(b []byte) ([]byte, error) { return append(b, o.String()...), nil } // MarshalText implements [encoding.TextMarshaler] func (o OID) MarshalText() ([]byte, error) { return o.AppendText(nil) } // UnmarshalText implements [encoding.TextUnmarshaler] func (o *OID) UnmarshalText(text []byte) error { return o.unmarshalOIDText(string(text)) } // cutString slices s around the first instance of sep, // returning the text before and after sep. // The found result reports whether sep appears in s. // If sep does not appear in s, cut returns s, "", false. func cutString(s, sep string) (before, after string, found bool) { if i := strings.Index(s, sep); i >= 0 { return s[:i], s[i+len(sep):], true } return s, "", false } func (o *OID) unmarshalOIDText(oid string) error { // (*big.Int).SetString allows +/- signs, but we don't want // to allow them in the string representation of Object Identifier, so // reject such encodings. for _, c := range oid { isDigit := c >= '0' && c <= '9' if !isDigit && c != '.' { return errInvalidOID } } var ( firstNum string secondNum string ) var nextComponentExists bool firstNum, oid, nextComponentExists = cutString(oid, ".") if !nextComponentExists { return errInvalidOID } secondNum, oid, nextComponentExists = cutString(oid, ".") var ( first = big.NewInt(0) second = big.NewInt(0) ) if _, ok := first.SetString(firstNum, 10); !ok { return errInvalidOID } if _, ok := second.SetString(secondNum, 10); !ok { return errInvalidOID } if first.Cmp(big.NewInt(2)) > 0 || (first.Cmp(big.NewInt(2)) < 0 && second.Cmp(big.NewInt(40)) >= 0) { return errInvalidOID } firstComponent := first.Mul(first, big.NewInt(40)) firstComponent.Add(firstComponent, second) der := appendBase128BigInt(make([]byte, 0, 32), firstComponent) for nextComponentExists { var strNum string strNum, oid, nextComponentExists = cutString(oid, ".") b, ok := big.NewInt(0).SetString(strNum, 10) if !ok { return errInvalidOID } der = appendBase128BigInt(der, b) } o.der = der return nil } // AppendBinary implements [encoding.BinaryAppender] func (o OID) AppendBinary(b []byte) ([]byte, error) { return append(b, o.der...), nil } // MarshalBinary implements [encoding.BinaryMarshaler] func (o OID) MarshalBinary() ([]byte, error) { return o.AppendBinary(nil) } // cloneBytes returns a copy of b[:len(b)]. // The result may have additional unused capacity. // Clone(nil) returns nil. func cloneBytes(b []byte) []byte { if b == nil { return nil } return append([]byte{}, b...) } // UnmarshalBinary implements [encoding.BinaryUnmarshaler] func (o *OID) UnmarshalBinary(b []byte) error { oid, ok := newOIDFromDER(cloneBytes(b)) if !ok { return errInvalidOID } *o = oid return nil } // Equal returns true when oid and other represents the same Object Identifier. func (oid OID) Equal(other OID) bool { // There is only one possible DER encoding of // each unique Object Identifier. return bytes.Equal(oid.der, other.der) } func parseBase128Int(bytes []byte, initOffset int) (ret, offset int, failed bool) { offset = initOffset var ret64 int64 for shifted := 0; offset < len(bytes); shifted++ { // 5 * 7 bits per byte == 35 bits of data // Thus the representation is either non-minimal or too large for an int32 if shifted == 5 { failed = true return } ret64 <<= 7 b := bytes[offset] // integers should be minimally encoded, so the leading octet should // never be 0x80 if shifted == 0 && b == 0x80 { failed = true return } ret64 |= int64(b & 0x7f) offset++ if b&0x80 == 0 { ret = int(ret64) // Ensure that the returned value fits in an int on all platforms if ret64 > math.MaxInt32 { failed = true } return } } failed = true return } // EqualASN1OID returns whether an OID equals an asn1.ObjectIdentifier. If // asn1.ObjectIdentifier cannot represent the OID specified by oid, because // a component of OID requires more than 31 bits, it returns false. func (oid OID) EqualASN1OID(other asn1.ObjectIdentifier) bool { if len(other) < 2 { return false } v, offset, failed := parseBase128Int(oid.der, 0) if failed { // This should never happen, since we've already parsed the OID, // but just in case. return false } if v < 80 { a, b := v/40, v%40 if other[0] != a || other[1] != b { return false } } else { a, b := 2, v-80 if other[0] != a || other[1] != b { return false } } i := 2 for ; offset < len(oid.der); i++ { v, offset, failed = parseBase128Int(oid.der, offset) if failed { // Again, shouldn't happen, since we've already parsed // the OID, but better safe than sorry. return false } if i >= len(other) || v != other[i] { return false } } return i == len(other) } // Strings returns the string representation of the Object Identifier. func (oid OID) String() string { var b strings.Builder b.Grow(32) const ( valSize = 64 // size in bits of val. bitsPerByte = 7 maxValSafeShift = (1 << (valSize - bitsPerByte)) - 1 ) var ( start = 0 val = uint64(0) numBuf = make([]byte, 0, 21) bigVal *big.Int overflow bool ) for i, v := range oid.der { curVal := v & 0x7F valEnd := v&0x80 == 0 if valEnd { if start != 0 { b.WriteByte('.') } } if !overflow && val > maxValSafeShift { if bigVal == nil { bigVal = new(big.Int) } bigVal = bigVal.SetUint64(val) overflow = true } if overflow { bigVal = bigVal.Lsh(bigVal, bitsPerByte).Or(bigVal, big.NewInt(int64(curVal))) if valEnd { if start == 0 { b.WriteString("2.") bigVal = bigVal.Sub(bigVal, big.NewInt(80)) } numBuf = bigVal.Append(numBuf, 10) b.Write(numBuf) numBuf = numBuf[:0] val = 0 start = i + 1 overflow = false } continue } val <<= bitsPerByte val |= uint64(curVal) if valEnd { if start == 0 { if val < 80 { b.Write(strconv.AppendUint(numBuf, val/40, 10)) b.WriteByte('.') b.Write(strconv.AppendUint(numBuf, val%40, 10)) } else { b.WriteString("2.") b.Write(strconv.AppendUint(numBuf, val-80, 10)) } } else { b.Write(strconv.AppendUint(numBuf, val, 10)) } val = 0 start = i + 1 } } return b.String() } ================================================ FILE: vendor/github.com/smallstep/pkcs7/internal/legacy/x509/parser.go ================================================ // Copyright 2021 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package legacyx509 import ( "bytes" "crypto/dsa" "crypto/ecdsa" "crypto/ed25519" "crypto/elliptic" "crypto/rsa" "crypto/x509/pkix" "encoding/asn1" "errors" "fmt" "math/big" "net" "net/url" "strconv" "strings" "time" "unicode/utf16" "unicode/utf8" "golang.org/x/crypto/cryptobyte" cryptobyte_asn1 "golang.org/x/crypto/cryptobyte/asn1" stdx509 "crypto/x509" ) // ParseCertificates parses one or more certificates from the given ASN.1 DER // data. The certificates must be concatenated with no intermediate padding. func ParseCertificates(der []byte) ([]*stdx509.Certificate, error) { var certs []*stdx509.Certificate for len(der) > 0 { cert, err := parseCertificate(der) if err != nil { return nil, err } certs = append(certs, cert) der = der[len(cert.Raw):] } return certs, nil } // isPrintable reports whether the given b is in the ASN.1 PrintableString set. // This is a simplified version of encoding/asn1.isPrintable. func isPrintable(b byte) bool { return 'a' <= b && b <= 'z' || 'A' <= b && b <= 'Z' || '0' <= b && b <= '9' || '\'' <= b && b <= ')' || '+' <= b && b <= '/' || b == ' ' || b == ':' || b == '=' || b == '?' || // This is technically not allowed in a PrintableString. // However, x509 certificates with wildcard strings don't // always use the correct string type so we permit it. b == '*' || // This is not technically allowed either. However, not // only is it relatively common, but there are also a // handful of CA certificates that contain it. At least // one of which will not expire until 2027. b == '&' } // parseASN1String parses the ASN.1 string types T61String, PrintableString, // UTF8String, BMPString, IA5String, and NumericString. This is mostly copied // from the respective encoding/asn1.parse... methods, rather than just // increasing the API surface of that package. func parseASN1String(tag cryptobyte_asn1.Tag, value []byte) (string, error) { switch tag { case cryptobyte_asn1.T61String: return string(value), nil case cryptobyte_asn1.PrintableString: for _, b := range value { if !isPrintable(b) { return "", errors.New("invalid PrintableString") } } return string(value), nil case cryptobyte_asn1.UTF8String: if !utf8.Valid(value) { return "", errors.New("invalid UTF-8 string") } return string(value), nil case cryptobyte_asn1.Tag(asn1.TagBMPString): if len(value)%2 != 0 { return "", errors.New("invalid BMPString") } // Strip terminator if present. if l := len(value); l >= 2 && value[l-1] == 0 && value[l-2] == 0 { value = value[:l-2] } s := make([]uint16, 0, len(value)/2) for len(value) > 0 { s = append(s, uint16(value[0])<<8+uint16(value[1])) value = value[2:] } return string(utf16.Decode(s)), nil case cryptobyte_asn1.IA5String: s := string(value) if isIA5String(s) != nil { return "", errors.New("invalid IA5String") } return s, nil case cryptobyte_asn1.Tag(asn1.TagNumericString): for _, b := range value { if !('0' <= b && b <= '9' || b == ' ') { return "", errors.New("invalid NumericString") } } return string(value), nil } return "", fmt.Errorf("unsupported string type: %v", tag) } // parseName parses a DER encoded Name as defined in RFC 5280. We may // want to export this function in the future for use in crypto/tls. func parseName(raw cryptobyte.String) (*pkix.RDNSequence, error) { if !raw.ReadASN1(&raw, cryptobyte_asn1.SEQUENCE) { return nil, errors.New("x509: invalid RDNSequence") } var rdnSeq pkix.RDNSequence for !raw.Empty() { var rdnSet pkix.RelativeDistinguishedNameSET var set cryptobyte.String if !raw.ReadASN1(&set, cryptobyte_asn1.SET) { return nil, errors.New("x509: invalid RDNSequence") } for !set.Empty() { var atav cryptobyte.String if !set.ReadASN1(&atav, cryptobyte_asn1.SEQUENCE) { return nil, errors.New("x509: invalid RDNSequence: invalid attribute") } var attr pkix.AttributeTypeAndValue if !atav.ReadASN1ObjectIdentifier(&attr.Type) { return nil, errors.New("x509: invalid RDNSequence: invalid attribute type") } var rawValue cryptobyte.String var valueTag cryptobyte_asn1.Tag if !atav.ReadAnyASN1(&rawValue, &valueTag) { return nil, errors.New("x509: invalid RDNSequence: invalid attribute value") } var err error attr.Value, err = parseASN1String(valueTag, rawValue) if err != nil { return nil, fmt.Errorf("x509: invalid RDNSequence: invalid attribute value: %s", err) } rdnSet = append(rdnSet, attr) } rdnSeq = append(rdnSeq, rdnSet) } return &rdnSeq, nil } func parseAI(der cryptobyte.String) (pkix.AlgorithmIdentifier, error) { ai := pkix.AlgorithmIdentifier{} if !der.ReadASN1ObjectIdentifier(&ai.Algorithm) { return ai, errors.New("x509: malformed OID") } if der.Empty() { return ai, nil } var params cryptobyte.String var tag cryptobyte_asn1.Tag if !der.ReadAnyASN1Element(¶ms, &tag) { return ai, errors.New("x509: malformed parameters") } ai.Parameters.Tag = int(tag) ai.Parameters.FullBytes = params return ai, nil } func parseTime(der *cryptobyte.String) (time.Time, error) { var t time.Time switch { case der.PeekASN1Tag(cryptobyte_asn1.UTCTime): if !der.ReadASN1UTCTime(&t) { return t, errors.New("x509: malformed UTCTime") } case der.PeekASN1Tag(cryptobyte_asn1.GeneralizedTime): if !der.ReadASN1GeneralizedTime(&t) { return t, errors.New("x509: malformed GeneralizedTime") } default: return t, errors.New("x509: unsupported time format") } return t, nil } func parseValidity(der cryptobyte.String) (time.Time, time.Time, error) { notBefore, err := parseTime(&der) if err != nil { return time.Time{}, time.Time{}, err } notAfter, err := parseTime(&der) if err != nil { return time.Time{}, time.Time{}, err } return notBefore, notAfter, nil } func parseExtension(der cryptobyte.String) (pkix.Extension, error) { var ext pkix.Extension if !der.ReadASN1ObjectIdentifier(&ext.Id) { return ext, errors.New("x509: malformed extension OID field") } if der.PeekASN1Tag(cryptobyte_asn1.BOOLEAN) { if !der.ReadASN1Boolean(&ext.Critical) { return ext, errors.New("x509: malformed extension critical field") } } var val cryptobyte.String if !der.ReadASN1(&val, cryptobyte_asn1.OCTET_STRING) { return ext, errors.New("x509: malformed extension value field") } ext.Value = val return ext, nil } func parsePublicKey(keyData *publicKeyInfo) (interface{}, error) { oid := keyData.Algorithm.Algorithm params := keyData.Algorithm.Parameters der := cryptobyte.String(keyData.PublicKey.RightAlign()) switch { case oid.Equal(oidPublicKeyRSA): // RSA public keys must have a NULL in the parameters. // See RFC 3279, Section 2.3.1. if !bytes.Equal(params.FullBytes, asn1.NullBytes) { return nil, errors.New("x509: RSA key missing NULL parameters") } p := &pkcs1PublicKey{N: new(big.Int)} if !der.ReadASN1(&der, cryptobyte_asn1.SEQUENCE) { return nil, errors.New("x509: invalid RSA public key") } if !der.ReadASN1Integer(p.N) { return nil, errors.New("x509: invalid RSA modulus") } if !der.ReadASN1Integer(&p.E) { return nil, errors.New("x509: invalid RSA public exponent") } if p.N.Sign() <= 0 { return nil, errors.New("x509: RSA modulus is not a positive number") } if p.E <= 0 { return nil, errors.New("x509: RSA public exponent is not a positive number") } pub := &rsa.PublicKey{ E: p.E, N: p.N, } return pub, nil case oid.Equal(oidPublicKeyECDSA): paramsDer := cryptobyte.String(params.FullBytes) namedCurveOID := new(asn1.ObjectIdentifier) if !paramsDer.ReadASN1ObjectIdentifier(namedCurveOID) { return nil, errors.New("x509: invalid ECDSA parameters") } namedCurve := namedCurveFromOID(*namedCurveOID) if namedCurve == nil { return nil, errors.New("x509: unsupported elliptic curve") } x, y := elliptic.Unmarshal(namedCurve, der) if x == nil { return nil, errors.New("x509: failed to unmarshal elliptic curve point") } pub := &ecdsa.PublicKey{ Curve: namedCurve, X: x, Y: y, } return pub, nil case oid.Equal(oidPublicKeyEd25519): // RFC 8410, Section 3 // > For all of the OIDs, the parameters MUST be absent. if len(params.FullBytes) != 0 { return nil, errors.New("x509: Ed25519 key encoded with illegal parameters") } if len(der) != ed25519.PublicKeySize { return nil, errors.New("x509: wrong Ed25519 public key size") } return ed25519.PublicKey(der), nil // case oid.Equal(oidPublicKeyX25519): // // RFC 8410, Section 3 // // > For all of the OIDs, the parameters MUST be absent. // if len(params.FullBytes) != 0 { // return nil, errors.New("x509: X25519 key encoded with illegal parameters") // } // return ecdh.X25519().NewPublicKey(der) case oid.Equal(oidPublicKeyDSA): y := new(big.Int) if !der.ReadASN1Integer(y) { return nil, errors.New("x509: invalid DSA public key") } pub := &dsa.PublicKey{ Y: y, Parameters: dsa.Parameters{ P: new(big.Int), Q: new(big.Int), G: new(big.Int), }, } paramsDer := cryptobyte.String(params.FullBytes) if !paramsDer.ReadASN1(¶msDer, cryptobyte_asn1.SEQUENCE) || !paramsDer.ReadASN1Integer(pub.Parameters.P) || !paramsDer.ReadASN1Integer(pub.Parameters.Q) || !paramsDer.ReadASN1Integer(pub.Parameters.G) { return nil, errors.New("x509: invalid DSA parameters") } if pub.Y.Sign() <= 0 || pub.Parameters.P.Sign() <= 0 || pub.Parameters.Q.Sign() <= 0 || pub.Parameters.G.Sign() <= 0 { return nil, errors.New("x509: zero or negative DSA parameter") } return pub, nil default: return nil, errors.New("x509: unknown public key algorithm") } } func parseKeyUsageExtension(der cryptobyte.String) (stdx509.KeyUsage, error) { var usageBits asn1.BitString if !der.ReadASN1BitString(&usageBits) { return 0, errors.New("x509: invalid key usage") } var usage int for i := 0; i < 9; i++ { if usageBits.At(i) != 0 { usage |= 1 << uint(i) } } return stdx509.KeyUsage(usage), nil } func parseBasicConstraintsExtension(der cryptobyte.String) (bool, int, error) { var isCA bool if !der.ReadASN1(&der, cryptobyte_asn1.SEQUENCE) { return false, 0, errors.New("x509: invalid basic constraints") } if der.PeekASN1Tag(cryptobyte_asn1.BOOLEAN) { if !der.ReadASN1Boolean(&isCA) { return false, 0, errors.New("x509: invalid basic constraints") } } maxPathLen := -1 if der.PeekASN1Tag(cryptobyte_asn1.INTEGER) { if !der.ReadASN1Integer(&maxPathLen) { return false, 0, errors.New("x509: invalid basic constraints") } } // TODO: map out.MaxPathLen to 0 if it has the -1 default value? (Issue 19285) return isCA, maxPathLen, nil } func forEachSAN(der cryptobyte.String, callback func(tag int, data []byte) error) error { if !der.ReadASN1(&der, cryptobyte_asn1.SEQUENCE) { return errors.New("x509: invalid subject alternative names") } for !der.Empty() { var san cryptobyte.String var tag cryptobyte_asn1.Tag if !der.ReadAnyASN1(&san, &tag) { return errors.New("x509: invalid subject alternative name") } if err := callback(int(tag^0x80), san); err != nil { return err } } return nil } func parseSANExtension(der cryptobyte.String) (dnsNames, emailAddresses []string, ipAddresses []net.IP, uris []*url.URL, err error) { err = forEachSAN(der, func(tag int, data []byte) error { switch tag { case nameTypeEmail: email := string(data) if err := isIA5String(email); err != nil { return errors.New("x509: SAN rfc822Name is malformed") } emailAddresses = append(emailAddresses, email) case nameTypeDNS: name := string(data) if err := isIA5String(name); err != nil { return errors.New("x509: SAN dNSName is malformed") } dnsNames = append(dnsNames, string(name)) case nameTypeURI: uriStr := string(data) if err := isIA5String(uriStr); err != nil { return errors.New("x509: SAN uniformResourceIdentifier is malformed") } uri, err := url.Parse(uriStr) if err != nil { return fmt.Errorf("x509: cannot parse URI %q: %s", uriStr, err) } if len(uri.Host) > 0 { if _, ok := domainToReverseLabels(uri.Host); !ok { return fmt.Errorf("x509: cannot parse URI %q: invalid domain", uriStr) } } uris = append(uris, uri) case nameTypeIP: switch len(data) { case net.IPv4len, net.IPv6len: ipAddresses = append(ipAddresses, data) default: return errors.New("x509: cannot parse IP address of length " + strconv.Itoa(len(data))) } } return nil }) return } func parseAuthorityKeyIdentifier(e pkix.Extension) ([]byte, error) { // RFC 5280, Section 4.2.1.1 // if e.Critical { // // Conforming CAs MUST mark this extension as non-critical // return nil, errors.New("x509: authority key identifier incorrectly marked critical") // } val := cryptobyte.String(e.Value) var akid cryptobyte.String if !val.ReadASN1(&akid, cryptobyte_asn1.SEQUENCE) { return nil, errors.New("x509: invalid authority key identifier") } if akid.PeekASN1Tag(cryptobyte_asn1.Tag(0).ContextSpecific()) { if !akid.ReadASN1(&akid, cryptobyte_asn1.Tag(0).ContextSpecific()) { return nil, errors.New("x509: invalid authority key identifier") } return akid, nil } return nil, nil } func parseExtKeyUsageExtension(der cryptobyte.String) ([]stdx509.ExtKeyUsage, []asn1.ObjectIdentifier, error) { var extKeyUsages []stdx509.ExtKeyUsage var unknownUsages []asn1.ObjectIdentifier if !der.ReadASN1(&der, cryptobyte_asn1.SEQUENCE) { return nil, nil, errors.New("x509: invalid extended key usages") } for !der.Empty() { var eku asn1.ObjectIdentifier if !der.ReadASN1ObjectIdentifier(&eku) { return nil, nil, errors.New("x509: invalid extended key usages") } if extKeyUsage, ok := extKeyUsageFromOID(eku); ok { extKeyUsages = append(extKeyUsages, stdx509.ExtKeyUsage(extKeyUsage)) } else { unknownUsages = append(unknownUsages, eku) } } return extKeyUsages, unknownUsages, nil } // func parseCertificatePoliciesExtension(der cryptobyte.String) ([]OID, error) { // var oids []OID // if !der.ReadASN1(&der, cryptobyte_asn1.SEQUENCE) { // return nil, errors.New("x509: invalid certificate policies") // } // for !der.Empty() { // var cp cryptobyte.String // var OIDBytes cryptobyte.String // if !der.ReadASN1(&cp, cryptobyte_asn1.SEQUENCE) || !cp.ReadASN1(&OIDBytes, cryptobyte_asn1.OBJECT_IDENTIFIER) { // return nil, errors.New("x509: invalid certificate policies") // } // oid, ok := newOIDFromDER(OIDBytes) // if !ok { // return nil, errors.New("x509: invalid certificate policies") // } // oids = append(oids, oid) // } // return oids, nil // } // isValidIPMask reports whether mask consists of zero or more 1 bits, followed by zero bits. func isValidIPMask(mask []byte) bool { seenZero := false for _, b := range mask { if seenZero { if b != 0 { return false } continue } switch b { case 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe: seenZero = true case 0xff: default: return false } } return true } func parseNameConstraintsExtension(out *stdx509.Certificate, e pkix.Extension) (unhandled bool, err error) { // RFC 5280, 4.2.1.10 // NameConstraints ::= SEQUENCE { // permittedSubtrees [0] GeneralSubtrees OPTIONAL, // excludedSubtrees [1] GeneralSubtrees OPTIONAL } // // GeneralSubtrees ::= SEQUENCE SIZE (1..MAX) OF GeneralSubtree // // GeneralSubtree ::= SEQUENCE { // base GeneralName, // minimum [0] BaseDistance DEFAULT 0, // maximum [1] BaseDistance OPTIONAL } // // BaseDistance ::= INTEGER (0..MAX) outer := cryptobyte.String(e.Value) var toplevel, permitted, excluded cryptobyte.String var havePermitted, haveExcluded bool if !outer.ReadASN1(&toplevel, cryptobyte_asn1.SEQUENCE) || !outer.Empty() || !toplevel.ReadOptionalASN1(&permitted, &havePermitted, cryptobyte_asn1.Tag(0).ContextSpecific().Constructed()) || !toplevel.ReadOptionalASN1(&excluded, &haveExcluded, cryptobyte_asn1.Tag(1).ContextSpecific().Constructed()) || !toplevel.Empty() { return false, errors.New("x509: invalid NameConstraints extension") } if !havePermitted && !haveExcluded || len(permitted) == 0 && len(excluded) == 0 { // From RFC 5280, Section 4.2.1.10: // “either the permittedSubtrees field // or the excludedSubtrees MUST be // present” return false, errors.New("x509: empty name constraints extension") } getValues := func(subtrees cryptobyte.String) (dnsNames []string, ips []*net.IPNet, emails, uriDomains []string, err error) { for !subtrees.Empty() { var seq, value cryptobyte.String var tag cryptobyte_asn1.Tag if !subtrees.ReadASN1(&seq, cryptobyte_asn1.SEQUENCE) || !seq.ReadAnyASN1(&value, &tag) { return nil, nil, nil, nil, fmt.Errorf("x509: invalid NameConstraints extension") } var ( dnsTag = cryptobyte_asn1.Tag(2).ContextSpecific() emailTag = cryptobyte_asn1.Tag(1).ContextSpecific() ipTag = cryptobyte_asn1.Tag(7).ContextSpecific() uriTag = cryptobyte_asn1.Tag(6).ContextSpecific() ) switch tag { case dnsTag: domain := string(value) if err := isIA5String(domain); err != nil { return nil, nil, nil, nil, errors.New("x509: invalid constraint value: " + err.Error()) } trimmedDomain := domain if len(trimmedDomain) > 0 && trimmedDomain[0] == '.' { // constraints can have a leading // period to exclude the domain // itself, but that's not valid in a // normal domain name. trimmedDomain = trimmedDomain[1:] } if _, ok := domainToReverseLabels(trimmedDomain); !ok { return nil, nil, nil, nil, fmt.Errorf("x509: failed to parse dnsName constraint %q", domain) } dnsNames = append(dnsNames, domain) case ipTag: l := len(value) var ip, mask []byte switch l { case 8: ip = value[:4] mask = value[4:] case 32: ip = value[:16] mask = value[16:] default: return nil, nil, nil, nil, fmt.Errorf("x509: IP constraint contained value of length %d", l) } if !isValidIPMask(mask) { return nil, nil, nil, nil, fmt.Errorf("x509: IP constraint contained invalid mask %x", mask) } ips = append(ips, &net.IPNet{IP: net.IP(ip), Mask: net.IPMask(mask)}) case emailTag: constraint := string(value) if err := isIA5String(constraint); err != nil { return nil, nil, nil, nil, errors.New("x509: invalid constraint value: " + err.Error()) } // If the constraint contains an @ then // it specifies an exact mailbox name. if strings.Contains(constraint, "@") { if _, ok := parseRFC2821Mailbox(constraint); !ok { return nil, nil, nil, nil, fmt.Errorf("x509: failed to parse rfc822Name constraint %q", constraint) } } else { // Otherwise it's a domain name. domain := constraint if len(domain) > 0 && domain[0] == '.' { domain = domain[1:] } if _, ok := domainToReverseLabels(domain); !ok { return nil, nil, nil, nil, fmt.Errorf("x509: failed to parse rfc822Name constraint %q", constraint) } } emails = append(emails, constraint) case uriTag: domain := string(value) if err := isIA5String(domain); err != nil { return nil, nil, nil, nil, errors.New("x509: invalid constraint value: " + err.Error()) } if net.ParseIP(domain) != nil { return nil, nil, nil, nil, fmt.Errorf("x509: failed to parse URI constraint %q: cannot be IP address", domain) } trimmedDomain := domain if len(trimmedDomain) > 0 && trimmedDomain[0] == '.' { // constraints can have a leading // period to exclude the domain itself, // but that's not valid in a normal // domain name. trimmedDomain = trimmedDomain[1:] } if _, ok := domainToReverseLabels(trimmedDomain); !ok { return nil, nil, nil, nil, fmt.Errorf("x509: failed to parse URI constraint %q", domain) } uriDomains = append(uriDomains, domain) default: unhandled = true } } return dnsNames, ips, emails, uriDomains, nil } if out.PermittedDNSDomains, out.PermittedIPRanges, out.PermittedEmailAddresses, out.PermittedURIDomains, err = getValues(permitted); err != nil { return false, err } if out.ExcludedDNSDomains, out.ExcludedIPRanges, out.ExcludedEmailAddresses, out.ExcludedURIDomains, err = getValues(excluded); err != nil { return false, err } out.PermittedDNSDomainsCritical = e.Critical return unhandled, nil } func processExtensions(out *stdx509.Certificate) error { var err error for _, e := range out.Extensions { unhandled := false if len(e.Id) == 4 && e.Id[0] == 2 && e.Id[1] == 5 && e.Id[2] == 29 { switch e.Id[3] { case 15: out.KeyUsage, err = parseKeyUsageExtension(e.Value) if err != nil { return err } case 19: out.IsCA, out.MaxPathLen, err = parseBasicConstraintsExtension(e.Value) if err != nil { return err } out.BasicConstraintsValid = true out.MaxPathLenZero = out.MaxPathLen == 0 case 17: out.DNSNames, out.EmailAddresses, out.IPAddresses, out.URIs, err = parseSANExtension(e.Value) if err != nil { return err } if len(out.DNSNames) == 0 && len(out.EmailAddresses) == 0 && len(out.IPAddresses) == 0 && len(out.URIs) == 0 { // If we didn't parse anything then we do the critical check, below. unhandled = true } case 30: unhandled, err = parseNameConstraintsExtension(out, e) if err != nil { return err } case 31: // RFC 5280, 4.2.1.13 // CRLDistributionPoints ::= SEQUENCE SIZE (1..MAX) OF DistributionPoint // // DistributionPoint ::= SEQUENCE { // distributionPoint [0] DistributionPointName OPTIONAL, // reasons [1] ReasonFlags OPTIONAL, // cRLIssuer [2] GeneralNames OPTIONAL } // // DistributionPointName ::= CHOICE { // fullName [0] GeneralNames, // nameRelativeToCRLIssuer [1] RelativeDistinguishedName } val := cryptobyte.String(e.Value) if !val.ReadASN1(&val, cryptobyte_asn1.SEQUENCE) { return errors.New("x509: invalid CRL distribution points") } for !val.Empty() { var dpDER cryptobyte.String if !val.ReadASN1(&dpDER, cryptobyte_asn1.SEQUENCE) { return errors.New("x509: invalid CRL distribution point") } var dpNameDER cryptobyte.String var dpNamePresent bool if !dpDER.ReadOptionalASN1(&dpNameDER, &dpNamePresent, cryptobyte_asn1.Tag(0).Constructed().ContextSpecific()) { return errors.New("x509: invalid CRL distribution point") } if !dpNamePresent { continue } if !dpNameDER.ReadASN1(&dpNameDER, cryptobyte_asn1.Tag(0).Constructed().ContextSpecific()) { return errors.New("x509: invalid CRL distribution point") } for !dpNameDER.Empty() { if !dpNameDER.PeekASN1Tag(cryptobyte_asn1.Tag(6).ContextSpecific()) { break } var uri cryptobyte.String if !dpNameDER.ReadASN1(&uri, cryptobyte_asn1.Tag(6).ContextSpecific()) { return errors.New("x509: invalid CRL distribution point") } out.CRLDistributionPoints = append(out.CRLDistributionPoints, string(uri)) } } case 35: out.AuthorityKeyId, err = parseAuthorityKeyIdentifier(e) if err != nil { return err } case 37: out.ExtKeyUsage, out.UnknownExtKeyUsage, err = parseExtKeyUsageExtension(e.Value) if err != nil { return err } case 14: // RFC 5280, 4.2.1.2 if e.Critical { // Conforming CAs MUST mark this extension as non-critical return errors.New("x509: subject key identifier incorrectly marked critical") } val := cryptobyte.String(e.Value) var skid cryptobyte.String if !val.ReadASN1(&skid, cryptobyte_asn1.OCTET_STRING) { return errors.New("x509: invalid subject key identifier") } out.SubjectKeyId = skid // case 32: // out.Policies, err = parseCertificatePoliciesExtension(e.Value) // if err != nil { // return err // } // out.PolicyIdentifiers = make([]asn1.ObjectIdentifier, 0, len(out.Policies)) // for _, oid := range out.Policies { // if oid, ok := oid.toASN1OID(); ok { // out.PolicyIdentifiers = append(out.PolicyIdentifiers, oid) // } // } default: // Unknown extensions are recorded if critical. unhandled = true } } else if e.Id.Equal(oidExtensionAuthorityInfoAccess) { // RFC 5280 4.2.2.1: Authority Information Access if e.Critical { // Conforming CAs MUST mark this extension as non-critical return errors.New("x509: authority info access incorrectly marked critical") } val := cryptobyte.String(e.Value) if !val.ReadASN1(&val, cryptobyte_asn1.SEQUENCE) { return errors.New("x509: invalid authority info access") } for !val.Empty() { var aiaDER cryptobyte.String if !val.ReadASN1(&aiaDER, cryptobyte_asn1.SEQUENCE) { return errors.New("x509: invalid authority info access") } var method asn1.ObjectIdentifier if !aiaDER.ReadASN1ObjectIdentifier(&method) { return errors.New("x509: invalid authority info access") } if !aiaDER.PeekASN1Tag(cryptobyte_asn1.Tag(6).ContextSpecific()) { continue } if !aiaDER.ReadASN1(&aiaDER, cryptobyte_asn1.Tag(6).ContextSpecific()) { return errors.New("x509: invalid authority info access") } switch { case method.Equal(oidAuthorityInfoAccessOcsp): out.OCSPServer = append(out.OCSPServer, string(aiaDER)) case method.Equal(oidAuthorityInfoAccessIssuers): out.IssuingCertificateURL = append(out.IssuingCertificateURL, string(aiaDER)) } } } else { // Unknown extensions are recorded if critical. unhandled = true } if e.Critical && unhandled { out.UnhandledCriticalExtensions = append(out.UnhandledCriticalExtensions, e.Id) } } return nil } var x509negativeserial = legacyGodebugSetting(0) // replaces godebug.New("x509negativeserial") func parseCertificate(der []byte) (*stdx509.Certificate, error) { cert := &stdx509.Certificate{} input := cryptobyte.String(der) // we read the SEQUENCE including length and tag bytes so that // we can populate Certificate.Raw, before unwrapping the // SEQUENCE so it can be operated on if !input.ReadASN1Element(&input, cryptobyte_asn1.SEQUENCE) { return nil, errors.New("x509: malformed certificate") } cert.Raw = input if !input.ReadASN1(&input, cryptobyte_asn1.SEQUENCE) { return nil, errors.New("x509: malformed certificate") } var tbs cryptobyte.String // do the same trick again as above to extract the raw // bytes for Certificate.RawTBSCertificate if !input.ReadASN1Element(&tbs, cryptobyte_asn1.SEQUENCE) { return nil, errors.New("x509: malformed tbs certificate") } cert.RawTBSCertificate = tbs if !tbs.ReadASN1(&tbs, cryptobyte_asn1.SEQUENCE) { return nil, errors.New("x509: malformed tbs certificate") } if !tbs.ReadOptionalASN1Integer(&cert.Version, cryptobyte_asn1.Tag(0).Constructed().ContextSpecific(), 0) { return nil, errors.New("x509: malformed version") } if cert.Version < 0 { return nil, errors.New("x509: malformed version") } // for backwards compat reasons Version is one-indexed, // rather than zero-indexed as defined in 5280 cert.Version++ if cert.Version > 3 { return nil, errors.New("x509: invalid version") } serial := new(big.Int) if !tbs.ReadASN1Integer(serial) { return nil, errors.New("x509: malformed serial number") } if serial.Sign() == -1 { if x509negativeserial.Value() != "1" { return nil, errors.New("x509: negative serial number") } else { x509negativeserial.IncNonDefault() } } cert.SerialNumber = serial var sigAISeq cryptobyte.String if !tbs.ReadASN1(&sigAISeq, cryptobyte_asn1.SEQUENCE) { return nil, errors.New("x509: malformed signature algorithm identifier") } // Before parsing the inner algorithm identifier, extract // the outer algorithm identifier and make sure that they // match. var outerSigAISeq cryptobyte.String if !input.ReadASN1(&outerSigAISeq, cryptobyte_asn1.SEQUENCE) { return nil, errors.New("x509: malformed algorithm identifier") } if !bytes.Equal(outerSigAISeq, sigAISeq) { return nil, errors.New("x509: inner and outer signature algorithm identifiers don't match") } sigAI, err := parseAI(sigAISeq) if err != nil { return nil, err } cert.SignatureAlgorithm = getSignatureAlgorithmFromAI(sigAI) var issuerSeq cryptobyte.String if !tbs.ReadASN1Element(&issuerSeq, cryptobyte_asn1.SEQUENCE) { return nil, errors.New("x509: malformed issuer") } cert.RawIssuer = issuerSeq issuerRDNs, err := parseName(issuerSeq) if err != nil { return nil, err } cert.Issuer.FillFromRDNSequence(issuerRDNs) var validity cryptobyte.String if !tbs.ReadASN1(&validity, cryptobyte_asn1.SEQUENCE) { return nil, errors.New("x509: malformed validity") } cert.NotBefore, cert.NotAfter, err = parseValidity(validity) if err != nil { return nil, err } var subjectSeq cryptobyte.String if !tbs.ReadASN1Element(&subjectSeq, cryptobyte_asn1.SEQUENCE) { return nil, errors.New("x509: malformed issuer") } cert.RawSubject = subjectSeq subjectRDNs, err := parseName(subjectSeq) if err != nil { return nil, err } cert.Subject.FillFromRDNSequence(subjectRDNs) var spki cryptobyte.String if !tbs.ReadASN1Element(&spki, cryptobyte_asn1.SEQUENCE) { return nil, errors.New("x509: malformed spki") } cert.RawSubjectPublicKeyInfo = spki if !spki.ReadASN1(&spki, cryptobyte_asn1.SEQUENCE) { return nil, errors.New("x509: malformed spki") } var pkAISeq cryptobyte.String if !spki.ReadASN1(&pkAISeq, cryptobyte_asn1.SEQUENCE) { return nil, errors.New("x509: malformed public key algorithm identifier") } pkAI, err := parseAI(pkAISeq) if err != nil { return nil, err } cert.PublicKeyAlgorithm = getPublicKeyAlgorithmFromOID(pkAI.Algorithm) var spk asn1.BitString if !spki.ReadASN1BitString(&spk) { return nil, errors.New("x509: malformed subjectPublicKey") } if cert.PublicKeyAlgorithm != stdx509.UnknownPublicKeyAlgorithm { cert.PublicKey, err = parsePublicKey(&publicKeyInfo{ Algorithm: pkAI, PublicKey: spk, }) if err != nil { return nil, err } } if cert.Version > 1 { if !tbs.SkipOptionalASN1(cryptobyte_asn1.Tag(1).ContextSpecific()) { return nil, errors.New("x509: malformed issuerUniqueID") } if !tbs.SkipOptionalASN1(cryptobyte_asn1.Tag(2).ContextSpecific()) { return nil, errors.New("x509: malformed subjectUniqueID") } if cert.Version == 3 { var extensions cryptobyte.String var present bool if !tbs.ReadOptionalASN1(&extensions, &present, cryptobyte_asn1.Tag(3).Constructed().ContextSpecific()) { return nil, errors.New("x509: malformed extensions") } if present { seenExts := make(map[string]bool) if !extensions.ReadASN1(&extensions, cryptobyte_asn1.SEQUENCE) { return nil, errors.New("x509: malformed extensions") } for !extensions.Empty() { var extension cryptobyte.String if !extensions.ReadASN1(&extension, cryptobyte_asn1.SEQUENCE) { return nil, errors.New("x509: malformed extension") } ext, err := parseExtension(extension) if err != nil { return nil, err } oidStr := ext.Id.String() if seenExts[oidStr] { return nil, fmt.Errorf("x509: certificate contains duplicate extension with OID %q", oidStr) } seenExts[oidStr] = true cert.Extensions = append(cert.Extensions, ext) } err = processExtensions(cert) if err != nil { return nil, err } } } } var signature asn1.BitString if !input.ReadASN1BitString(&signature) { return nil, errors.New("x509: malformed signature") } cert.Signature = signature.RightAlign() return cert, nil } ================================================ FILE: vendor/github.com/smallstep/pkcs7/internal/legacy/x509/pkcs1.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package legacyx509 import ( "math/big" ) // pkcs1PublicKey reflects the ASN.1 structure of a PKCS #1 public key. type pkcs1PublicKey struct { N *big.Int E int } ================================================ FILE: vendor/github.com/smallstep/pkcs7/internal/legacy/x509/verify.go ================================================ package legacyx509 import ( "bytes" "strings" ) // rfc2821Mailbox represents a “mailbox” (which is an email address to most // people) by breaking it into the “local” (i.e. before the '@') and “domain” // parts. type rfc2821Mailbox struct { local, domain string } // parseRFC2821Mailbox parses an email address into local and domain parts, // based on the ABNF for a “Mailbox” from RFC 2821. According to RFC 5280, // Section 4.2.1.6 that's correct for an rfc822Name from a certificate: “The // format of an rfc822Name is a "Mailbox" as defined in RFC 2821, Section 4.1.2”. func parseRFC2821Mailbox(in string) (mailbox rfc2821Mailbox, ok bool) { if len(in) == 0 { return mailbox, false } localPartBytes := make([]byte, 0, len(in)/2) if in[0] == '"' { // Quoted-string = DQUOTE *qcontent DQUOTE // non-whitespace-control = %d1-8 / %d11 / %d12 / %d14-31 / %d127 // qcontent = qtext / quoted-pair // qtext = non-whitespace-control / // %d33 / %d35-91 / %d93-126 // quoted-pair = ("\" text) / obs-qp // text = %d1-9 / %d11 / %d12 / %d14-127 / obs-text // // (Names beginning with “obs-” are the obsolete syntax from RFC 2822, // Section 4. Since it has been 16 years, we no longer accept that.) in = in[1:] QuotedString: for { if len(in) == 0 { return mailbox, false } c := in[0] in = in[1:] switch { case c == '"': break QuotedString case c == '\\': // quoted-pair if len(in) == 0 { return mailbox, false } if in[0] == 11 || in[0] == 12 || (1 <= in[0] && in[0] <= 9) || (14 <= in[0] && in[0] <= 127) { localPartBytes = append(localPartBytes, in[0]) in = in[1:] } else { return mailbox, false } case c == 11 || c == 12 || // Space (char 32) is not allowed based on the // BNF, but RFC 3696 gives an example that // assumes that it is. Several “verified” // errata continue to argue about this point. // We choose to accept it. c == 32 || c == 33 || c == 127 || (1 <= c && c <= 8) || (14 <= c && c <= 31) || (35 <= c && c <= 91) || (93 <= c && c <= 126): // qtext localPartBytes = append(localPartBytes, c) default: return mailbox, false } } } else { // Atom ("." Atom)* NextChar: for len(in) > 0 { // atext from RFC 2822, Section 3.2.4 c := in[0] switch { case c == '\\': // Examples given in RFC 3696 suggest that // escaped characters can appear outside of a // quoted string. Several “verified” errata // continue to argue the point. We choose to // accept it. in = in[1:] if len(in) == 0 { return mailbox, false } fallthrough case ('0' <= c && c <= '9') || ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || c == '!' || c == '#' || c == '$' || c == '%' || c == '&' || c == '\'' || c == '*' || c == '+' || c == '-' || c == '/' || c == '=' || c == '?' || c == '^' || c == '_' || c == '`' || c == '{' || c == '|' || c == '}' || c == '~' || c == '.': localPartBytes = append(localPartBytes, in[0]) in = in[1:] default: break NextChar } } if len(localPartBytes) == 0 { return mailbox, false } // From RFC 3696, Section 3: // “period (".") may also appear, but may not be used to start // or end the local part, nor may two or more consecutive // periods appear.” twoDots := []byte{'.', '.'} if localPartBytes[0] == '.' || localPartBytes[len(localPartBytes)-1] == '.' || bytes.Contains(localPartBytes, twoDots) { return mailbox, false } } if len(in) == 0 || in[0] != '@' { return mailbox, false } in = in[1:] // The RFC species a format for domains, but that's known to be // violated in practice so we accept that anything after an '@' is the // domain part. if _, ok := domainToReverseLabels(in); !ok { return mailbox, false } mailbox.local = string(localPartBytes) mailbox.domain = in return mailbox, true } // domainToReverseLabels converts a textual domain name like foo.example.com to // the list of labels in reverse order, e.g. ["com", "example", "foo"]. func domainToReverseLabels(domain string) (reverseLabels []string, ok bool) { for len(domain) > 0 { if i := strings.LastIndexByte(domain, '.'); i == -1 { reverseLabels = append(reverseLabels, domain) domain = "" } else { reverseLabels = append(reverseLabels, domain[i+1:]) domain = domain[:i] if i == 0 { // domain == "" // domain is prefixed with an empty label, append an empty // string to reverseLabels to indicate this. reverseLabels = append(reverseLabels, "") } } } if len(reverseLabels) > 0 && len(reverseLabels[0]) == 0 { // An empty label at the end indicates an absolute value. return nil, false } for _, label := range reverseLabels { if len(label) == 0 { // Empty labels are otherwise invalid. return nil, false } for _, c := range label { if c < 33 || c > 126 { // Invalid character. return nil, false } } } return reverseLabels, true } ================================================ FILE: vendor/github.com/smallstep/pkcs7/internal/legacy/x509/x509.go ================================================ // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package x509 implements a subset of the X.509 standard. // // It allows parsing and generating certificates, certificate signing // requests, certificate revocation lists, and encoded public and private keys. // It provides a certificate verifier, complete with a chain builder. // // The package targets the X.509 technical profile defined by the IETF (RFC // 2459/3280/5280), and as further restricted by the CA/Browser Forum Baseline // Requirements. There is minimal support for features outside of these // profiles, as the primary goal of the package is to provide compatibility // with the publicly trusted TLS certificate ecosystem and its policies and // constraints. // // On macOS and Windows, certificate verification is handled by system APIs, but // the package aims to apply consistent validation rules across operating // systems. package legacyx509 import ( "bytes" "crypto" "crypto/elliptic" stdx509 "crypto/x509" "crypto/x509/pkix" "encoding/asn1" "fmt" "strconv" "unicode" // Explicitly import these for their crypto.RegisterHash init side-effects. // Keep these as blank imports, even if they're imported above. _ "crypto/sha1" _ "crypto/sha256" _ "crypto/sha512" ) type publicKeyInfo struct { Raw asn1.RawContent Algorithm pkix.AlgorithmIdentifier PublicKey asn1.BitString } type SignatureAlgorithm int const ( UnknownSignatureAlgorithm SignatureAlgorithm = iota MD2WithRSA // Unsupported. MD5WithRSA // Only supported for signing, not verification. SHA1WithRSA // Only supported for signing, and verification of CRLs, CSRs, and OCSP responses. SHA256WithRSA SHA384WithRSA SHA512WithRSA DSAWithSHA1 // Unsupported. DSAWithSHA256 // Unsupported. ECDSAWithSHA1 // Only supported for signing, and verification of CRLs, CSRs, and OCSP responses. ECDSAWithSHA256 ECDSAWithSHA384 ECDSAWithSHA512 SHA256WithRSAPSS SHA384WithRSAPSS SHA512WithRSAPSS PureEd25519 ) func (algo SignatureAlgorithm) String() string { for _, details := range signatureAlgorithmDetails { if details.algo == algo { return details.name } } return strconv.Itoa(int(algo)) } type PublicKeyAlgorithm int const ( UnknownPublicKeyAlgorithm PublicKeyAlgorithm = iota RSA DSA // Only supported for parsing. ECDSA Ed25519 ) var publicKeyAlgoName = [...]string{ RSA: "RSA", DSA: "DSA", ECDSA: "ECDSA", Ed25519: "Ed25519", } func (algo PublicKeyAlgorithm) String() string { if 0 < algo && int(algo) < len(publicKeyAlgoName) { return publicKeyAlgoName[algo] } return strconv.Itoa(int(algo)) } // OIDs for signature algorithms // // pkcs-1 OBJECT IDENTIFIER ::= { // iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 1 } // // RFC 3279 2.2.1 RSA Signature Algorithms // // md5WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 4 } // // sha-1WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 5 } // // dsaWithSha1 OBJECT IDENTIFIER ::= { // iso(1) member-body(2) us(840) x9-57(10040) x9cm(4) 3 } // // RFC 3279 2.2.3 ECDSA Signature Algorithm // // ecdsa-with-SHA1 OBJECT IDENTIFIER ::= { // iso(1) member-body(2) us(840) ansi-x962(10045) // signatures(4) ecdsa-with-SHA1(1)} // // RFC 4055 5 PKCS #1 Version 1.5 // // sha256WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 11 } // // sha384WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 12 } // // sha512WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 13 } // // RFC 5758 3.1 DSA Signature Algorithms // // dsaWithSha256 OBJECT IDENTIFIER ::= { // joint-iso-ccitt(2) country(16) us(840) organization(1) gov(101) // csor(3) algorithms(4) id-dsa-with-sha2(3) 2} // // RFC 5758 3.2 ECDSA Signature Algorithm // // ecdsa-with-SHA256 OBJECT IDENTIFIER ::= { iso(1) member-body(2) // us(840) ansi-X9-62(10045) signatures(4) ecdsa-with-SHA2(3) 2 } // // ecdsa-with-SHA384 OBJECT IDENTIFIER ::= { iso(1) member-body(2) // us(840) ansi-X9-62(10045) signatures(4) ecdsa-with-SHA2(3) 3 } // // ecdsa-with-SHA512 OBJECT IDENTIFIER ::= { iso(1) member-body(2) // us(840) ansi-X9-62(10045) signatures(4) ecdsa-with-SHA2(3) 4 } // // RFC 8410 3 Curve25519 and Curve448 Algorithm Identifiers // // id-Ed25519 OBJECT IDENTIFIER ::= { 1 3 101 112 } var ( oidSignatureMD5WithRSA = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 4} oidSignatureSHA1WithRSA = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 5} oidSignatureSHA256WithRSA = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 11} oidSignatureSHA384WithRSA = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 12} oidSignatureSHA512WithRSA = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 13} oidSignatureRSAPSS = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 10} oidSignatureDSAWithSHA1 = asn1.ObjectIdentifier{1, 2, 840, 10040, 4, 3} oidSignatureDSAWithSHA256 = asn1.ObjectIdentifier{2, 16, 840, 1, 101, 3, 4, 3, 2} oidSignatureECDSAWithSHA1 = asn1.ObjectIdentifier{1, 2, 840, 10045, 4, 1} oidSignatureECDSAWithSHA256 = asn1.ObjectIdentifier{1, 2, 840, 10045, 4, 3, 2} oidSignatureECDSAWithSHA384 = asn1.ObjectIdentifier{1, 2, 840, 10045, 4, 3, 3} oidSignatureECDSAWithSHA512 = asn1.ObjectIdentifier{1, 2, 840, 10045, 4, 3, 4} oidSignatureEd25519 = asn1.ObjectIdentifier{1, 3, 101, 112} oidSHA256 = asn1.ObjectIdentifier{2, 16, 840, 1, 101, 3, 4, 2, 1} oidSHA384 = asn1.ObjectIdentifier{2, 16, 840, 1, 101, 3, 4, 2, 2} oidSHA512 = asn1.ObjectIdentifier{2, 16, 840, 1, 101, 3, 4, 2, 3} oidMGF1 = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 8} // oidISOSignatureSHA1WithRSA means the same as oidSignatureSHA1WithRSA // but it's specified by ISO. Microsoft's makecert.exe has been known // to produce certificates with this OID. oidISOSignatureSHA1WithRSA = asn1.ObjectIdentifier{1, 3, 14, 3, 2, 29} ) var signatureAlgorithmDetails = []struct { algo SignatureAlgorithm name string oid asn1.ObjectIdentifier params asn1.RawValue pubKeyAlgo PublicKeyAlgorithm hash crypto.Hash isRSAPSS bool }{ {MD5WithRSA, "MD5-RSA", oidSignatureMD5WithRSA, asn1.NullRawValue, RSA, crypto.MD5, false}, {SHA1WithRSA, "SHA1-RSA", oidSignatureSHA1WithRSA, asn1.NullRawValue, RSA, crypto.SHA1, false}, {SHA1WithRSA, "SHA1-RSA", oidISOSignatureSHA1WithRSA, asn1.NullRawValue, RSA, crypto.SHA1, false}, {SHA256WithRSA, "SHA256-RSA", oidSignatureSHA256WithRSA, asn1.NullRawValue, RSA, crypto.SHA256, false}, {SHA384WithRSA, "SHA384-RSA", oidSignatureSHA384WithRSA, asn1.NullRawValue, RSA, crypto.SHA384, false}, {SHA512WithRSA, "SHA512-RSA", oidSignatureSHA512WithRSA, asn1.NullRawValue, RSA, crypto.SHA512, false}, {SHA256WithRSAPSS, "SHA256-RSAPSS", oidSignatureRSAPSS, pssParametersSHA256, RSA, crypto.SHA256, true}, {SHA384WithRSAPSS, "SHA384-RSAPSS", oidSignatureRSAPSS, pssParametersSHA384, RSA, crypto.SHA384, true}, {SHA512WithRSAPSS, "SHA512-RSAPSS", oidSignatureRSAPSS, pssParametersSHA512, RSA, crypto.SHA512, true}, {DSAWithSHA1, "DSA-SHA1", oidSignatureDSAWithSHA1, emptyRawValue, DSA, crypto.SHA1, false}, {DSAWithSHA256, "DSA-SHA256", oidSignatureDSAWithSHA256, emptyRawValue, DSA, crypto.SHA256, false}, {ECDSAWithSHA1, "ECDSA-SHA1", oidSignatureECDSAWithSHA1, emptyRawValue, ECDSA, crypto.SHA1, false}, {ECDSAWithSHA256, "ECDSA-SHA256", oidSignatureECDSAWithSHA256, emptyRawValue, ECDSA, crypto.SHA256, false}, {ECDSAWithSHA384, "ECDSA-SHA384", oidSignatureECDSAWithSHA384, emptyRawValue, ECDSA, crypto.SHA384, false}, {ECDSAWithSHA512, "ECDSA-SHA512", oidSignatureECDSAWithSHA512, emptyRawValue, ECDSA, crypto.SHA512, false}, {PureEd25519, "Ed25519", oidSignatureEd25519, emptyRawValue, Ed25519, crypto.Hash(0) /* no pre-hashing */, false}, } var emptyRawValue = asn1.RawValue{} // DER encoded RSA PSS parameters for the // SHA256, SHA384, and SHA512 hashes as defined in RFC 3447, Appendix A.2.3. // The parameters contain the following values: // - hashAlgorithm contains the associated hash identifier with NULL parameters // - maskGenAlgorithm always contains the default mgf1SHA1 identifier // - saltLength contains the length of the associated hash // - trailerField always contains the default trailerFieldBC value var ( pssParametersSHA256 = asn1.RawValue{FullBytes: []byte{48, 52, 160, 15, 48, 13, 6, 9, 96, 134, 72, 1, 101, 3, 4, 2, 1, 5, 0, 161, 28, 48, 26, 6, 9, 42, 134, 72, 134, 247, 13, 1, 1, 8, 48, 13, 6, 9, 96, 134, 72, 1, 101, 3, 4, 2, 1, 5, 0, 162, 3, 2, 1, 32}} pssParametersSHA384 = asn1.RawValue{FullBytes: []byte{48, 52, 160, 15, 48, 13, 6, 9, 96, 134, 72, 1, 101, 3, 4, 2, 2, 5, 0, 161, 28, 48, 26, 6, 9, 42, 134, 72, 134, 247, 13, 1, 1, 8, 48, 13, 6, 9, 96, 134, 72, 1, 101, 3, 4, 2, 2, 5, 0, 162, 3, 2, 1, 48}} pssParametersSHA512 = asn1.RawValue{FullBytes: []byte{48, 52, 160, 15, 48, 13, 6, 9, 96, 134, 72, 1, 101, 3, 4, 2, 3, 5, 0, 161, 28, 48, 26, 6, 9, 42, 134, 72, 134, 247, 13, 1, 1, 8, 48, 13, 6, 9, 96, 134, 72, 1, 101, 3, 4, 2, 3, 5, 0, 162, 3, 2, 1, 64}} ) // pssParameters reflects the parameters in an AlgorithmIdentifier that // specifies RSA PSS. See RFC 3447, Appendix A.2.3. type pssParameters struct { // The following three fields are not marked as // optional because the default values specify SHA-1, // which is no longer suitable for use in signatures. Hash pkix.AlgorithmIdentifier `asn1:"explicit,tag:0"` MGF pkix.AlgorithmIdentifier `asn1:"explicit,tag:1"` SaltLength int `asn1:"explicit,tag:2"` TrailerField int `asn1:"optional,explicit,tag:3,default:1"` } func getSignatureAlgorithmFromAI(ai pkix.AlgorithmIdentifier) stdx509.SignatureAlgorithm { if ai.Algorithm.Equal(oidSignatureEd25519) { // RFC 8410, Section 3 // > For all of the OIDs, the parameters MUST be absent. if len(ai.Parameters.FullBytes) != 0 { return stdx509.UnknownSignatureAlgorithm } } if !ai.Algorithm.Equal(oidSignatureRSAPSS) { for _, details := range signatureAlgorithmDetails { if ai.Algorithm.Equal(details.oid) { return stdx509.SignatureAlgorithm(details.algo) } } return stdx509.UnknownSignatureAlgorithm } // RSA PSS is special because it encodes important parameters // in the Parameters. var params pssParameters if _, err := asn1.Unmarshal(ai.Parameters.FullBytes, ¶ms); err != nil { return stdx509.UnknownSignatureAlgorithm } var mgf1HashFunc pkix.AlgorithmIdentifier if _, err := asn1.Unmarshal(params.MGF.Parameters.FullBytes, &mgf1HashFunc); err != nil { return stdx509.UnknownSignatureAlgorithm } // PSS is greatly overburdened with options. This code forces them into // three buckets by requiring that the MGF1 hash function always match the // message hash function (as recommended in RFC 3447, Section 8.1), that the // salt length matches the hash length, and that the trailer field has the // default value. if (len(params.Hash.Parameters.FullBytes) != 0 && !bytes.Equal(params.Hash.Parameters.FullBytes, asn1.NullBytes)) || !params.MGF.Algorithm.Equal(oidMGF1) || !mgf1HashFunc.Algorithm.Equal(params.Hash.Algorithm) || (len(mgf1HashFunc.Parameters.FullBytes) != 0 && !bytes.Equal(mgf1HashFunc.Parameters.FullBytes, asn1.NullBytes)) || params.TrailerField != 1 { return stdx509.UnknownSignatureAlgorithm } switch { case params.Hash.Algorithm.Equal(oidSHA256) && params.SaltLength == 32: return stdx509.SHA256WithRSAPSS case params.Hash.Algorithm.Equal(oidSHA384) && params.SaltLength == 48: return stdx509.SHA384WithRSAPSS case params.Hash.Algorithm.Equal(oidSHA512) && params.SaltLength == 64: return stdx509.SHA512WithRSAPSS } return stdx509.UnknownSignatureAlgorithm } var ( // RFC 3279, 2.3 Public Key Algorithms // // pkcs-1 OBJECT IDENTIFIER ::== { iso(1) member-body(2) us(840) // rsadsi(113549) pkcs(1) 1 } // // rsaEncryption OBJECT IDENTIFIER ::== { pkcs1-1 1 } // // id-dsa OBJECT IDENTIFIER ::== { iso(1) member-body(2) us(840) // x9-57(10040) x9cm(4) 1 } oidPublicKeyRSA = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 1} oidPublicKeyDSA = asn1.ObjectIdentifier{1, 2, 840, 10040, 4, 1} // RFC 5480, 2.1.1 Unrestricted Algorithm Identifier and Parameters // // id-ecPublicKey OBJECT IDENTIFIER ::= { // iso(1) member-body(2) us(840) ansi-X9-62(10045) keyType(2) 1 } oidPublicKeyECDSA = asn1.ObjectIdentifier{1, 2, 840, 10045, 2, 1} // RFC 8410, Section 3 // // id-X25519 OBJECT IDENTIFIER ::= { 1 3 101 110 } // id-Ed25519 OBJECT IDENTIFIER ::= { 1 3 101 112 } oidPublicKeyX25519 = asn1.ObjectIdentifier{1, 3, 101, 110} oidPublicKeyEd25519 = asn1.ObjectIdentifier{1, 3, 101, 112} ) // getPublicKeyAlgorithmFromOID returns the exposed PublicKeyAlgorithm // identifier for public key types supported in certificates and CSRs. Marshal // and Parse functions may support a different set of public key types. func getPublicKeyAlgorithmFromOID(oid asn1.ObjectIdentifier) stdx509.PublicKeyAlgorithm { switch { case oid.Equal(oidPublicKeyRSA): return stdx509.RSA case oid.Equal(oidPublicKeyDSA): return stdx509.DSA case oid.Equal(oidPublicKeyECDSA): return stdx509.ECDSA case oid.Equal(oidPublicKeyEd25519): return stdx509.Ed25519 } return stdx509.UnknownPublicKeyAlgorithm } // RFC 5480, 2.1.1.1. Named Curve // // secp224r1 OBJECT IDENTIFIER ::= { // iso(1) identified-organization(3) certicom(132) curve(0) 33 } // // secp256r1 OBJECT IDENTIFIER ::= { // iso(1) member-body(2) us(840) ansi-X9-62(10045) curves(3) // prime(1) 7 } // // secp384r1 OBJECT IDENTIFIER ::= { // iso(1) identified-organization(3) certicom(132) curve(0) 34 } // // secp521r1 OBJECT IDENTIFIER ::= { // iso(1) identified-organization(3) certicom(132) curve(0) 35 } // // NB: secp256r1 is equivalent to prime256v1 var ( oidNamedCurveP224 = asn1.ObjectIdentifier{1, 3, 132, 0, 33} oidNamedCurveP256 = asn1.ObjectIdentifier{1, 2, 840, 10045, 3, 1, 7} oidNamedCurveP384 = asn1.ObjectIdentifier{1, 3, 132, 0, 34} oidNamedCurveP521 = asn1.ObjectIdentifier{1, 3, 132, 0, 35} ) func namedCurveFromOID(oid asn1.ObjectIdentifier) elliptic.Curve { switch { case oid.Equal(oidNamedCurveP224): return elliptic.P224() case oid.Equal(oidNamedCurveP256): return elliptic.P256() case oid.Equal(oidNamedCurveP384): return elliptic.P384() case oid.Equal(oidNamedCurveP521): return elliptic.P521() } return nil } // KeyUsage represents the set of actions that are valid for a given key. It's // a bitmap of the KeyUsage* constants. type KeyUsage int const ( KeyUsageDigitalSignature KeyUsage = 1 << iota KeyUsageContentCommitment KeyUsageKeyEncipherment KeyUsageDataEncipherment KeyUsageKeyAgreement KeyUsageCertSign KeyUsageCRLSign KeyUsageEncipherOnly KeyUsageDecipherOnly ) // RFC 5280, 4.2.1.12 Extended Key Usage // // anyExtendedKeyUsage OBJECT IDENTIFIER ::= { id-ce-extKeyUsage 0 } // // id-kp OBJECT IDENTIFIER ::= { id-pkix 3 } // // id-kp-serverAuth OBJECT IDENTIFIER ::= { id-kp 1 } // id-kp-clientAuth OBJECT IDENTIFIER ::= { id-kp 2 } // id-kp-codeSigning OBJECT IDENTIFIER ::= { id-kp 3 } // id-kp-emailProtection OBJECT IDENTIFIER ::= { id-kp 4 } // id-kp-timeStamping OBJECT IDENTIFIER ::= { id-kp 8 } // id-kp-OCSPSigning OBJECT IDENTIFIER ::= { id-kp 9 } var ( oidExtKeyUsageAny = asn1.ObjectIdentifier{2, 5, 29, 37, 0} oidExtKeyUsageServerAuth = asn1.ObjectIdentifier{1, 3, 6, 1, 5, 5, 7, 3, 1} oidExtKeyUsageClientAuth = asn1.ObjectIdentifier{1, 3, 6, 1, 5, 5, 7, 3, 2} oidExtKeyUsageCodeSigning = asn1.ObjectIdentifier{1, 3, 6, 1, 5, 5, 7, 3, 3} oidExtKeyUsageEmailProtection = asn1.ObjectIdentifier{1, 3, 6, 1, 5, 5, 7, 3, 4} oidExtKeyUsageIPSECEndSystem = asn1.ObjectIdentifier{1, 3, 6, 1, 5, 5, 7, 3, 5} oidExtKeyUsageIPSECTunnel = asn1.ObjectIdentifier{1, 3, 6, 1, 5, 5, 7, 3, 6} oidExtKeyUsageIPSECUser = asn1.ObjectIdentifier{1, 3, 6, 1, 5, 5, 7, 3, 7} oidExtKeyUsageTimeStamping = asn1.ObjectIdentifier{1, 3, 6, 1, 5, 5, 7, 3, 8} oidExtKeyUsageOCSPSigning = asn1.ObjectIdentifier{1, 3, 6, 1, 5, 5, 7, 3, 9} oidExtKeyUsageMicrosoftServerGatedCrypto = asn1.ObjectIdentifier{1, 3, 6, 1, 4, 1, 311, 10, 3, 3} oidExtKeyUsageNetscapeServerGatedCrypto = asn1.ObjectIdentifier{2, 16, 840, 1, 113730, 4, 1} oidExtKeyUsageMicrosoftCommercialCodeSigning = asn1.ObjectIdentifier{1, 3, 6, 1, 4, 1, 311, 2, 1, 22} oidExtKeyUsageMicrosoftKernelCodeSigning = asn1.ObjectIdentifier{1, 3, 6, 1, 4, 1, 311, 61, 1, 1} ) // ExtKeyUsage represents an extended set of actions that are valid for a given key. // Each of the ExtKeyUsage* constants define a unique action. type ExtKeyUsage int const ( ExtKeyUsageAny ExtKeyUsage = iota ExtKeyUsageServerAuth ExtKeyUsageClientAuth ExtKeyUsageCodeSigning ExtKeyUsageEmailProtection ExtKeyUsageIPSECEndSystem ExtKeyUsageIPSECTunnel ExtKeyUsageIPSECUser ExtKeyUsageTimeStamping ExtKeyUsageOCSPSigning ExtKeyUsageMicrosoftServerGatedCrypto ExtKeyUsageNetscapeServerGatedCrypto ExtKeyUsageMicrosoftCommercialCodeSigning ExtKeyUsageMicrosoftKernelCodeSigning ) // extKeyUsageOIDs contains the mapping between an ExtKeyUsage and its OID. var extKeyUsageOIDs = []struct { extKeyUsage ExtKeyUsage oid asn1.ObjectIdentifier }{ {ExtKeyUsageAny, oidExtKeyUsageAny}, {ExtKeyUsageServerAuth, oidExtKeyUsageServerAuth}, {ExtKeyUsageClientAuth, oidExtKeyUsageClientAuth}, {ExtKeyUsageCodeSigning, oidExtKeyUsageCodeSigning}, {ExtKeyUsageEmailProtection, oidExtKeyUsageEmailProtection}, {ExtKeyUsageIPSECEndSystem, oidExtKeyUsageIPSECEndSystem}, {ExtKeyUsageIPSECTunnel, oidExtKeyUsageIPSECTunnel}, {ExtKeyUsageIPSECUser, oidExtKeyUsageIPSECUser}, {ExtKeyUsageTimeStamping, oidExtKeyUsageTimeStamping}, {ExtKeyUsageOCSPSigning, oidExtKeyUsageOCSPSigning}, {ExtKeyUsageMicrosoftServerGatedCrypto, oidExtKeyUsageMicrosoftServerGatedCrypto}, {ExtKeyUsageNetscapeServerGatedCrypto, oidExtKeyUsageNetscapeServerGatedCrypto}, {ExtKeyUsageMicrosoftCommercialCodeSigning, oidExtKeyUsageMicrosoftCommercialCodeSigning}, {ExtKeyUsageMicrosoftKernelCodeSigning, oidExtKeyUsageMicrosoftKernelCodeSigning}, } func extKeyUsageFromOID(oid asn1.ObjectIdentifier) (eku ExtKeyUsage, ok bool) { for _, pair := range extKeyUsageOIDs { if oid.Equal(pair.oid) { return pair.extKeyUsage, true } } return } const ( nameTypeEmail = 1 nameTypeDNS = 2 nameTypeURI = 6 nameTypeIP = 7 ) var ( oidExtensionAuthorityInfoAccess = []int{1, 3, 6, 1, 5, 5, 7, 1, 1} ) var ( oidAuthorityInfoAccessOcsp = asn1.ObjectIdentifier{1, 3, 6, 1, 5, 5, 7, 48, 1} oidAuthorityInfoAccessIssuers = asn1.ObjectIdentifier{1, 3, 6, 1, 5, 5, 7, 48, 2} ) func isIA5String(s string) error { for _, r := range s { // Per RFC5280 "IA5String is limited to the set of ASCII characters" if r > unicode.MaxASCII { return fmt.Errorf("x509: %q cannot be encoded as an IA5String", s) } } return nil } ================================================ FILE: vendor/github.com/smallstep/pkcs7/pkcs7.go ================================================ // Package pkcs7 implements parsing and generation of some PKCS#7 structures. package pkcs7 import ( "bytes" "crypto" "crypto/dsa" "crypto/ecdsa" "crypto/rsa" "crypto/x509" "crypto/x509/pkix" "encoding/asn1" "errors" "fmt" "sort" "sync" _ "crypto/sha1" // for crypto.SHA1 legacyx509 "github.com/smallstep/pkcs7/internal/legacy/x509" ) // PKCS7 Represents a PKCS7 structure type PKCS7 struct { Content []byte Certificates []*x509.Certificate CRLs []pkix.CertificateList Signers []signerInfo raw interface{} } type contentInfo struct { ContentType asn1.ObjectIdentifier Content asn1.RawValue `asn1:"explicit,optional,tag:0"` } // ErrUnsupportedContentType is returned when a PKCS7 content type is not supported. // Currently only Data (1.2.840.113549.1.7.1), Signed Data (1.2.840.113549.1.7.2), // and Enveloped Data are supported (1.2.840.113549.1.7.3) var ErrUnsupportedContentType = errors.New("pkcs7: cannot parse data: unimplemented content type") type unsignedData []byte var ( // Signed Data OIDs OIDData = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 7, 1} OIDSignedData = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 7, 2} OIDEnvelopedData = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 7, 3} OIDEncryptedData = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 7, 6} OIDAttributeContentType = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 9, 3} OIDAttributeMessageDigest = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 9, 4} OIDAttributeSigningTime = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 9, 5} // Digest Algorithms OIDDigestAlgorithmSHA1 = asn1.ObjectIdentifier{1, 3, 14, 3, 2, 26} OIDDigestAlgorithmSHA256 = asn1.ObjectIdentifier{2, 16, 840, 1, 101, 3, 4, 2, 1} OIDDigestAlgorithmSHA384 = asn1.ObjectIdentifier{2, 16, 840, 1, 101, 3, 4, 2, 2} OIDDigestAlgorithmSHA512 = asn1.ObjectIdentifier{2, 16, 840, 1, 101, 3, 4, 2, 3} OIDDigestAlgorithmSHA224 = asn1.ObjectIdentifier{2, 16, 840, 1, 101, 3, 4, 2, 4} OIDDigestAlgorithmDSA = asn1.ObjectIdentifier{1, 2, 840, 10040, 4, 1} OIDDigestAlgorithmDSASHA1 = asn1.ObjectIdentifier{1, 2, 840, 10040, 4, 3} OIDDigestAlgorithmECDSASHA1 = asn1.ObjectIdentifier{1, 2, 840, 10045, 4, 1} OIDDigestAlgorithmECDSASHA256 = asn1.ObjectIdentifier{1, 2, 840, 10045, 4, 3, 2} OIDDigestAlgorithmECDSASHA384 = asn1.ObjectIdentifier{1, 2, 840, 10045, 4, 3, 3} OIDDigestAlgorithmECDSASHA512 = asn1.ObjectIdentifier{1, 2, 840, 10045, 4, 3, 4} // Signature Algorithms OIDEncryptionAlgorithmRSAMD5 = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 4} // see https://www.rfc-editor.org/rfc/rfc8017#appendix-A.2.4 OIDEncryptionAlgorithmRSASHA1 = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 5} // ditto OIDEncryptionAlgorithmRSASHA256 = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 11} // ditto OIDEncryptionAlgorithmRSASHA384 = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 12} // ditto OIDEncryptionAlgorithmRSASHA512 = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 13} // ditto OIDEncryptionAlgorithmRSASHA224 = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 14} // ditto OIDEncryptionAlgorithmECDSAP256 = asn1.ObjectIdentifier{1, 2, 840, 10045, 3, 1, 7} OIDEncryptionAlgorithmECDSAP384 = asn1.ObjectIdentifier{1, 3, 132, 0, 34} OIDEncryptionAlgorithmECDSAP521 = asn1.ObjectIdentifier{1, 3, 132, 0, 35} // Asymmetric Encryption Algorithms OIDEncryptionAlgorithmRSA = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 1} // see https://www.rfc-editor.org/rfc/rfc8017#appendix-A.2.2 OIDEncryptionAlgorithmRSAESOAEP = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 7} // see https://www.rfc-editor.org/rfc/rfc8017#appendix-A.2.1 // Symmetric Encryption Algorithms OIDEncryptionAlgorithmDESCBC = asn1.ObjectIdentifier{1, 3, 14, 3, 2, 7} // see https://www.rfc-editor.org/rfc/rfc8018.html#appendix-B.2.1 OIDEncryptionAlgorithmDESEDE3CBC = asn1.ObjectIdentifier{1, 2, 840, 113549, 3, 7} // see https://www.rfc-editor.org/rfc/rfc8018.html#appendix-B.2.2 OIDEncryptionAlgorithmAES256CBC = asn1.ObjectIdentifier{2, 16, 840, 1, 101, 3, 4, 1, 42} // see https://www.rfc-editor.org/rfc/rfc3565.html#section-4.1 OIDEncryptionAlgorithmAES128GCM = asn1.ObjectIdentifier{2, 16, 840, 1, 101, 3, 4, 1, 6} // see https://www.rfc-editor.org/rfc/rfc5084.html#section-3.2 OIDEncryptionAlgorithmAES128CBC = asn1.ObjectIdentifier{2, 16, 840, 1, 101, 3, 4, 1, 2} // see https://www.rfc-editor.org/rfc/rfc8018.html#appendix-B.2.5 OIDEncryptionAlgorithmAES256GCM = asn1.ObjectIdentifier{2, 16, 840, 1, 101, 3, 4, 1, 46} // see https://www.rfc-editor.org/rfc/rfc5084.html#section-3.2 ) func getHashForOID(oid asn1.ObjectIdentifier) (crypto.Hash, error) { switch { case oid.Equal(OIDDigestAlgorithmSHA1), oid.Equal(OIDDigestAlgorithmECDSASHA1), oid.Equal(OIDDigestAlgorithmDSA), oid.Equal(OIDDigestAlgorithmDSASHA1), oid.Equal(OIDEncryptionAlgorithmRSA): return crypto.SHA1, nil case oid.Equal(OIDDigestAlgorithmSHA256), oid.Equal(OIDDigestAlgorithmECDSASHA256): return crypto.SHA256, nil case oid.Equal(OIDDigestAlgorithmSHA384), oid.Equal(OIDDigestAlgorithmECDSASHA384): return crypto.SHA384, nil case oid.Equal(OIDDigestAlgorithmSHA512), oid.Equal(OIDDigestAlgorithmECDSASHA512): return crypto.SHA512, nil } return crypto.Hash(0), ErrUnsupportedAlgorithm } // getDigestOIDForSignatureAlgorithm takes an x509.SignatureAlgorithm // and returns the corresponding OID digest algorithm func getDigestOIDForSignatureAlgorithm(digestAlg x509.SignatureAlgorithm) (asn1.ObjectIdentifier, error) { switch digestAlg { case x509.SHA1WithRSA, x509.ECDSAWithSHA1: return OIDDigestAlgorithmSHA1, nil case x509.SHA256WithRSA, x509.ECDSAWithSHA256: return OIDDigestAlgorithmSHA256, nil case x509.SHA384WithRSA, x509.ECDSAWithSHA384: return OIDDigestAlgorithmSHA384, nil case x509.SHA512WithRSA, x509.ECDSAWithSHA512: return OIDDigestAlgorithmSHA512, nil } return nil, fmt.Errorf("pkcs7: cannot convert hash to oid, unknown hash algorithm") } // getOIDForEncryptionAlgorithm takes the public or private key type of the signer and // the OID of a digest algorithm to return the appropriate signerInfo.DigestEncryptionAlgorithm func getOIDForEncryptionAlgorithm(pkey interface{}, OIDDigestAlg asn1.ObjectIdentifier) (asn1.ObjectIdentifier, error) { switch k := pkey.(type) { case *rsa.PrivateKey, *rsa.PublicKey: switch { default: return OIDEncryptionAlgorithmRSA, nil case OIDDigestAlg.Equal(OIDEncryptionAlgorithmRSA): return OIDEncryptionAlgorithmRSA, nil case OIDDigestAlg.Equal(OIDDigestAlgorithmSHA1): return OIDEncryptionAlgorithmRSASHA1, nil case OIDDigestAlg.Equal(OIDDigestAlgorithmSHA256): return OIDEncryptionAlgorithmRSASHA256, nil case OIDDigestAlg.Equal(OIDDigestAlgorithmSHA384): return OIDEncryptionAlgorithmRSASHA384, nil case OIDDigestAlg.Equal(OIDDigestAlgorithmSHA512): return OIDEncryptionAlgorithmRSASHA512, nil } case *ecdsa.PrivateKey, *ecdsa.PublicKey: switch { case OIDDigestAlg.Equal(OIDDigestAlgorithmSHA1): return OIDDigestAlgorithmECDSASHA1, nil case OIDDigestAlg.Equal(OIDDigestAlgorithmSHA256): return OIDDigestAlgorithmECDSASHA256, nil case OIDDigestAlg.Equal(OIDDigestAlgorithmSHA384): return OIDDigestAlgorithmECDSASHA384, nil case OIDDigestAlg.Equal(OIDDigestAlgorithmSHA512): return OIDDigestAlgorithmECDSASHA512, nil } case *dsa.PrivateKey, *dsa.PublicKey: return OIDDigestAlgorithmDSA, nil case crypto.Signer: // This generic case is here to cover types from other packages. It // was specifically added to handle the private keyRSA type in the // github.com/go-piv/piv-go/piv package. return getOIDForEncryptionAlgorithm(k.Public(), OIDDigestAlg) } return nil, fmt.Errorf("pkcs7: cannot convert encryption algorithm to oid, unknown private key type %T", pkey) } // Parse decodes a DER encoded PKCS7 package func Parse(data []byte) (p7 *PKCS7, err error) { if len(data) == 0 { return nil, errors.New("pkcs7: input data is empty") } var info contentInfo der, err := ber2der(data) if err != nil { return nil, err } rest, err := asn1.Unmarshal(der, &info) if len(rest) > 0 { err = asn1.SyntaxError{Msg: "trailing data"} return } if err != nil { return } // fmt.Printf("--> Content Type: %s", info.ContentType) switch { case info.ContentType.Equal(OIDSignedData): return parseSignedData(info.Content.Bytes) case info.ContentType.Equal(OIDEnvelopedData): return parseEnvelopedData(info.Content.Bytes) case info.ContentType.Equal(OIDEncryptedData): return parseEncryptedData(info.Content.Bytes) } return nil, ErrUnsupportedContentType } func parseEnvelopedData(data []byte) (*PKCS7, error) { var ed envelopedData if _, err := asn1.Unmarshal(data, &ed); err != nil { return nil, err } return &PKCS7{ raw: ed, }, nil } func parseEncryptedData(data []byte) (*PKCS7, error) { var ed encryptedData if _, err := asn1.Unmarshal(data, &ed); err != nil { return nil, err } return &PKCS7{ raw: ed, }, nil } // SetFallbackLegacyX509CertificateParserEnabled enables parsing certificates // embedded in a PKCS7 message using the logic from crypto/x509 from before // Go 1.23. Go 1.23 introduced a breaking change in case a certificate contains // a critical authority key identifier, which is the correct thing to do based // on RFC 5280, but it breaks Windows devices performing the Simple Certificate // Enrolment Protocol (SCEP), as the certificates embedded in those requests // apparently have authority key identifier extensions marked critical. // // See https://go-review.googlesource.com/c/go/+/562341 for the change in the // Go source. // // When [SetFallbackLegacyX509CertificateParserEnabled] is called with true, it // enables parsing using the legacy crypto/x509 certificate parser. It'll first // try to parse the certificates using the regular Go crypto/x509 package, but // if it fails on the above case, it'll retry parsing the certificates using a // copy of the crypto/x509 package based on Go 1.23, but skips checking the // authority key identifier extension being critical or not. func SetFallbackLegacyX509CertificateParserEnabled(v bool) { legacyX509CertificateParser.Lock() legacyX509CertificateParser.enabled = v legacyX509CertificateParser.Unlock() } var legacyX509CertificateParser struct { sync.RWMutex enabled bool } func isLegacyX509ParserEnabled() bool { legacyX509CertificateParser.RLock() defer legacyX509CertificateParser.RUnlock() return legacyX509CertificateParser.enabled } func (raw rawCertificates) Parse() ([]*x509.Certificate, error) { if len(raw.Raw) == 0 { return nil, nil } var val asn1.RawValue if _, err := asn1.Unmarshal(raw.Raw, &val); err != nil { return nil, err } certificates, err := x509.ParseCertificates(val.Bytes) if err != nil && err.Error() == "x509: authority key identifier incorrectly marked critical" { if isLegacyX509ParserEnabled() { certificates, err = legacyx509.ParseCertificates(val.Bytes) } } return certificates, err } func isCertMatchForIssuerAndSerial(cert *x509.Certificate, ias issuerAndSerial) bool { return cert.SerialNumber.Cmp(ias.SerialNumber) == 0 && bytes.Equal(cert.RawIssuer, ias.IssuerName.FullBytes) } // Attribute represents a key value pair attribute. Value must be marshalable byte // `encoding/asn1` type Attribute struct { Type asn1.ObjectIdentifier Value interface{} } type attributes struct { types []asn1.ObjectIdentifier values []interface{} } // Add adds the attribute, maintaining insertion order func (attrs *attributes) Add(attrType asn1.ObjectIdentifier, value interface{}) { attrs.types = append(attrs.types, attrType) attrs.values = append(attrs.values, value) } type sortableAttribute struct { SortKey []byte Attribute attribute } type attributeSet []sortableAttribute func (sa attributeSet) Len() int { return len(sa) } func (sa attributeSet) Less(i, j int) bool { return bytes.Compare(sa[i].SortKey, sa[j].SortKey) < 0 } func (sa attributeSet) Swap(i, j int) { sa[i], sa[j] = sa[j], sa[i] } func (sa attributeSet) Attributes() []attribute { attrs := make([]attribute, len(sa)) for i, attr := range sa { attrs[i] = attr.Attribute } return attrs } func (attrs *attributes) ForMarshalling() ([]attribute, error) { sortables := make(attributeSet, len(attrs.types)) for i := range sortables { attrType := attrs.types[i] attrValue := attrs.values[i] asn1Value, err := asn1.Marshal(attrValue) if err != nil { return nil, err } attr := attribute{ Type: attrType, Value: asn1.RawValue{Tag: 17, IsCompound: true, Bytes: asn1Value}, // 17 == SET tag } encoded, err := asn1.Marshal(attr) if err != nil { return nil, err } sortables[i] = sortableAttribute{ SortKey: encoded, Attribute: attr, } } sort.Sort(sortables) return sortables.Attributes(), nil } ================================================ FILE: vendor/github.com/smallstep/pkcs7/sign.go ================================================ package pkcs7 import ( "bytes" "crypto" "crypto/dsa" "crypto/rand" "crypto/x509" "crypto/x509/pkix" "encoding/asn1" "errors" "fmt" "math/big" "time" ) // SignedData is an opaque data structure for creating signed data payloads type SignedData struct { sd signedData certs []*x509.Certificate data, messageDigest []byte digestOid asn1.ObjectIdentifier encryptionOid asn1.ObjectIdentifier } // NewSignedData takes data and initializes a PKCS7 SignedData struct that is // ready to be signed via AddSigner. The digest algorithm is set to SHA1 by default // and can be changed by calling SetDigestAlgorithm. func NewSignedData(data []byte) (*SignedData, error) { content, err := asn1.Marshal(data) if err != nil { return nil, err } ci := contentInfo{ ContentType: OIDData, Content: asn1.RawValue{Class: 2, Tag: 0, Bytes: content, IsCompound: true}, } sd := signedData{ ContentInfo: ci, Version: 1, } return &SignedData{sd: sd, data: data, digestOid: OIDDigestAlgorithmSHA1}, nil } // SignerInfoConfig are optional values to include when adding a signer type SignerInfoConfig struct { ExtraSignedAttributes []Attribute ExtraUnsignedAttributes []Attribute } type signedData struct { Version int `asn1:"default:1"` DigestAlgorithmIdentifiers []pkix.AlgorithmIdentifier `asn1:"set"` ContentInfo contentInfo Certificates rawCertificates `asn1:"optional,tag:0"` CRLs []pkix.CertificateList `asn1:"optional,tag:1"` SignerInfos []signerInfo `asn1:"set"` } type signerInfo struct { Version int `asn1:"default:1"` IssuerAndSerialNumber issuerAndSerial DigestAlgorithm pkix.AlgorithmIdentifier AuthenticatedAttributes []attribute `asn1:"optional,omitempty,tag:0"` DigestEncryptionAlgorithm pkix.AlgorithmIdentifier EncryptedDigest []byte UnauthenticatedAttributes []attribute `asn1:"optional,omitempty,tag:1"` } type attribute struct { Type asn1.ObjectIdentifier Value asn1.RawValue `asn1:"set"` } func marshalAttributes(attrs []attribute) ([]byte, error) { encodedAttributes, err := asn1.Marshal(struct { A []attribute `asn1:"set"` }{A: attrs}) if err != nil { return nil, err } // Remove the leading sequence octets var raw asn1.RawValue asn1.Unmarshal(encodedAttributes, &raw) return raw.Bytes, nil } type rawCertificates struct { Raw asn1.RawContent } type issuerAndSerial struct { IssuerName asn1.RawValue SerialNumber *big.Int } // SetDigestAlgorithm sets the digest algorithm to be used in the signing process. // // This should be called before adding signers func (sd *SignedData) SetDigestAlgorithm(d asn1.ObjectIdentifier) { sd.digestOid = d } // SetEncryptionAlgorithm sets the encryption algorithm to be used in the signing process. // // This should be called before adding signers func (sd *SignedData) SetEncryptionAlgorithm(d asn1.ObjectIdentifier) { sd.encryptionOid = d } // AddSigner is a wrapper around AddSignerChain() that adds a signer without any parent. func (sd *SignedData) AddSigner(ee *x509.Certificate, pkey crypto.PrivateKey, config SignerInfoConfig) error { var parents []*x509.Certificate return sd.AddSignerChain(ee, pkey, parents, config) } // AddSignerChain signs attributes about the content and adds certificates // and signers infos to the Signed Data. The certificate and private key // of the end-entity signer are used to issue the signature, and any // parent of that end-entity that need to be added to the list of // certifications can be specified in the parents slice. // // The signature algorithm used to hash the data is the one of the end-entity // certificate. func (sd *SignedData) AddSignerChain(ee *x509.Certificate, pkey crypto.PrivateKey, parents []*x509.Certificate, config SignerInfoConfig) error { // Following RFC 2315, 9.2 SignerInfo type, the distinguished name of // the issuer of the end-entity signer is stored in the issuerAndSerialNumber // section of the SignedData.SignerInfo, alongside the serial number of // the end-entity. var ias issuerAndSerial ias.SerialNumber = ee.SerialNumber if len(parents) == 0 { // no parent, the issuer is the end-entity cert itself ias.IssuerName = asn1.RawValue{FullBytes: ee.RawIssuer} } else { err := verifyPartialChain(ee, parents) if err != nil { return err } // the first parent is the issuer ias.IssuerName = asn1.RawValue{FullBytes: parents[0].RawSubject} } sd.sd.DigestAlgorithmIdentifiers = append(sd.sd.DigestAlgorithmIdentifiers, pkix.AlgorithmIdentifier{Algorithm: sd.digestOid}, ) hash, err := getHashForOID(sd.digestOid) if err != nil { return err } h := hash.New() h.Write(sd.data) sd.messageDigest = h.Sum(nil) encryptionOid, err := getOIDForEncryptionAlgorithm(pkey, sd.digestOid) if err != nil { return err } attrs := &attributes{} attrs.Add(OIDAttributeContentType, sd.sd.ContentInfo.ContentType) attrs.Add(OIDAttributeMessageDigest, sd.messageDigest) attrs.Add(OIDAttributeSigningTime, time.Now().UTC()) for _, attr := range config.ExtraSignedAttributes { attrs.Add(attr.Type, attr.Value) } finalAttrs, err := attrs.ForMarshalling() if err != nil { return err } unsignedAttrs := &attributes{} for _, attr := range config.ExtraUnsignedAttributes { unsignedAttrs.Add(attr.Type, attr.Value) } finalUnsignedAttrs, err := unsignedAttrs.ForMarshalling() if err != nil { return err } // create signature of signed attributes signature, err := signAttributes(finalAttrs, pkey, hash) if err != nil { return err } signer := signerInfo{ AuthenticatedAttributes: finalAttrs, UnauthenticatedAttributes: finalUnsignedAttrs, DigestAlgorithm: pkix.AlgorithmIdentifier{Algorithm: sd.digestOid}, DigestEncryptionAlgorithm: pkix.AlgorithmIdentifier{Algorithm: encryptionOid}, IssuerAndSerialNumber: ias, EncryptedDigest: signature, Version: 1, } sd.certs = append(sd.certs, ee) if len(parents) > 0 { sd.certs = append(sd.certs, parents...) } sd.sd.SignerInfos = append(sd.sd.SignerInfos, signer) return nil } // SignWithoutAttr issues a signature on the content of the pkcs7 SignedData. // Unlike AddSigner/AddSignerChain, it calculates the digest on the data alone // and does not include any signed attributes like timestamp and so on. // // This function is needed to sign old Android APKs, something you probably // shouldn't do unless you're maintaining backward compatibility for old // applications. func (sd *SignedData) SignWithoutAttr(ee *x509.Certificate, pkey crypto.PrivateKey, config SignerInfoConfig) error { var signature []byte sd.sd.DigestAlgorithmIdentifiers = append(sd.sd.DigestAlgorithmIdentifiers, pkix.AlgorithmIdentifier{Algorithm: sd.digestOid}) hash, err := getHashForOID(sd.digestOid) if err != nil { return err } h := hash.New() h.Write(sd.data) sd.messageDigest = h.Sum(nil) switch pkey := pkey.(type) { case *dsa.PrivateKey: // dsa doesn't implement crypto.Signer so we make a special case // https://github.com/golang/go/issues/27889 r, s, err := dsa.Sign(rand.Reader, pkey, sd.messageDigest) if err != nil { return err } signature, err = asn1.Marshal(dsaSignature{r, s}) if err != nil { return err } default: key, ok := pkey.(crypto.Signer) if !ok { return errors.New("pkcs7: private key does not implement crypto.Signer") } signature, err = key.Sign(rand.Reader, sd.messageDigest, hash) if err != nil { return err } } var ias issuerAndSerial ias.SerialNumber = ee.SerialNumber // no parent, the issue is the end-entity cert itself ias.IssuerName = asn1.RawValue{FullBytes: ee.RawIssuer} if sd.encryptionOid == nil { // if the encryption algorithm wasn't set by SetEncryptionAlgorithm, // infer it from the digest algorithm sd.encryptionOid, err = getOIDForEncryptionAlgorithm(pkey, sd.digestOid) } if err != nil { return err } signer := signerInfo{ DigestAlgorithm: pkix.AlgorithmIdentifier{Algorithm: sd.digestOid}, DigestEncryptionAlgorithm: pkix.AlgorithmIdentifier{Algorithm: sd.encryptionOid}, IssuerAndSerialNumber: ias, EncryptedDigest: signature, Version: 1, } // create signature of signed attributes sd.certs = append(sd.certs, ee) sd.sd.SignerInfos = append(sd.sd.SignerInfos, signer) return nil } func (si *signerInfo) SetUnauthenticatedAttributes(extraUnsignedAttrs []Attribute) error { unsignedAttrs := &attributes{} for _, attr := range extraUnsignedAttrs { unsignedAttrs.Add(attr.Type, attr.Value) } finalUnsignedAttrs, err := unsignedAttrs.ForMarshalling() if err != nil { return err } si.UnauthenticatedAttributes = finalUnsignedAttrs return nil } // AddCertificate adds the certificate to the payload. Useful for parent certificates func (sd *SignedData) AddCertificate(cert *x509.Certificate) { sd.certs = append(sd.certs, cert) } // Detach removes content from the signed data struct to make it a detached signature. // This must be called right before Finish() func (sd *SignedData) Detach() { sd.sd.ContentInfo = contentInfo{ContentType: OIDData} } // GetSignedData returns the private Signed Data func (sd *SignedData) GetSignedData() *signedData { return &sd.sd } // Finish marshals the content and its signers func (sd *SignedData) Finish() ([]byte, error) { sd.sd.Certificates = marshalCertificates(sd.certs) inner, err := asn1.Marshal(sd.sd) if err != nil { return nil, err } outer := contentInfo{ ContentType: OIDSignedData, Content: asn1.RawValue{Class: 2, Tag: 0, Bytes: inner, IsCompound: true}, } return asn1.Marshal(outer) } // RemoveAuthenticatedAttributes removes authenticated attributes from signedData // similar to OpenSSL's PKCS7_NOATTR or -noattr flags func (sd *SignedData) RemoveAuthenticatedAttributes() { for i := range sd.sd.SignerInfos { sd.sd.SignerInfos[i].AuthenticatedAttributes = nil } } // RemoveUnauthenticatedAttributes removes unauthenticated attributes from signedData func (sd *SignedData) RemoveUnauthenticatedAttributes() { for i := range sd.sd.SignerInfos { sd.sd.SignerInfos[i].UnauthenticatedAttributes = nil } } // verifyPartialChain checks that a given cert is issued by the first parent in the list, // then continue down the path. It doesn't require the last parent to be a root CA, // or to be trusted in any truststore. It simply verifies that the chain provided, albeit // partial, makes sense. func verifyPartialChain(cert *x509.Certificate, parents []*x509.Certificate) error { if len(parents) == 0 { return fmt.Errorf("pkcs7: zero parents provided to verify the signature of certificate %q", cert.Subject.CommonName) } err := cert.CheckSignatureFrom(parents[0]) if err != nil { return fmt.Errorf("pkcs7: certificate signature from parent is invalid: %v", err) } if len(parents) == 1 { // there is no more parent to check, return return nil } return verifyPartialChain(parents[0], parents[1:]) } func cert2issuerAndSerial(cert *x509.Certificate) (issuerAndSerial, error) { var ias issuerAndSerial // The issuer RDNSequence has to match exactly the sequence in the certificate // We cannot use cert.Issuer.ToRDNSequence() here since it mangles the sequence ias.IssuerName = asn1.RawValue{FullBytes: cert.RawIssuer} ias.SerialNumber = cert.SerialNumber return ias, nil } // signs the DER encoded form of the attributes with the private key func signAttributes(attrs []attribute, pkey crypto.PrivateKey, digestAlg crypto.Hash) ([]byte, error) { attrBytes, err := marshalAttributes(attrs) if err != nil { return nil, err } h := digestAlg.New() h.Write(attrBytes) hash := h.Sum(nil) // dsa doesn't implement crypto.Signer so we make a special case // https://github.com/golang/go/issues/27889 switch pkey := pkey.(type) { case *dsa.PrivateKey: r, s, err := dsa.Sign(rand.Reader, pkey, hash) if err != nil { return nil, err } return asn1.Marshal(dsaSignature{r, s}) } key, ok := pkey.(crypto.Signer) if !ok { return nil, errors.New("pkcs7: private key does not implement crypto.Signer") } return key.Sign(rand.Reader, hash, digestAlg) } type dsaSignature struct { R, S *big.Int } // concats and wraps the certificates in the RawValue structure func marshalCertificates(certs []*x509.Certificate) rawCertificates { var buf bytes.Buffer for _, cert := range certs { buf.Write(cert.Raw) } rawCerts, _ := marshalCertificateBytes(buf.Bytes()) return rawCerts } // Even though, the tag & length are stripped out during marshalling the // RawContent, we have to encode it into the RawContent. If its missing, // then `asn1.Marshal()` will strip out the certificate wrapper instead. func marshalCertificateBytes(certs []byte) (rawCertificates, error) { var val = asn1.RawValue{Bytes: certs, Class: 2, Tag: 0, IsCompound: true} b, err := asn1.Marshal(val) if err != nil { return rawCertificates{}, err } return rawCertificates{Raw: b}, nil } // DegenerateCertificate creates a signed data structure containing only the // provided certificate or certificate chain. func DegenerateCertificate(cert []byte) ([]byte, error) { rawCert, err := marshalCertificateBytes(cert) if err != nil { return nil, err } emptyContent := contentInfo{ContentType: OIDData} sd := signedData{ Version: 1, ContentInfo: emptyContent, Certificates: rawCert, CRLs: []pkix.CertificateList{}, } content, err := asn1.Marshal(sd) if err != nil { return nil, err } signedContent := contentInfo{ ContentType: OIDSignedData, Content: asn1.RawValue{Class: 2, Tag: 0, Bytes: content, IsCompound: true}, } return asn1.Marshal(signedContent) } ================================================ FILE: vendor/github.com/smallstep/pkcs7/verify.go ================================================ package pkcs7 import ( "crypto/subtle" "crypto/x509" "crypto/x509/pkix" "encoding/asn1" "errors" "fmt" "time" ) // Verify is a wrapper around VerifyWithChain() that initializes an empty // trust store, effectively disabling certificate verification when validating // a signature. func (p7 *PKCS7) Verify() (err error) { return p7.VerifyWithChain(nil) } // VerifyWithChain checks the signatures of a PKCS7 object. // // If truststore is not nil, it also verifies the chain of trust of // the end-entity signer cert to one of the roots in the // truststore. When the PKCS7 object includes the signing time // authenticated attr verifies the chain at that time and UTC now // otherwise. func (p7 *PKCS7) VerifyWithChain(truststore *x509.CertPool) (err error) { if len(p7.Signers) == 0 { return errors.New("pkcs7: Message has no signers") } for _, signer := range p7.Signers { if err := verifySignature(p7, signer, truststore); err != nil { return err } } return nil } // VerifyWithChainAtTime checks the signatures of a PKCS7 object. // // If truststore is not nil, it also verifies the chain of trust of // the end-entity signer cert to a root in the truststore at // currentTime. It does not use the signing time authenticated // attribute. func (p7 *PKCS7) VerifyWithChainAtTime(truststore *x509.CertPool, currentTime time.Time) (err error) { if len(p7.Signers) == 0 { return errors.New("pkcs7: Message has no signers") } for _, signer := range p7.Signers { if err := verifySignatureAtTime(p7, signer, truststore, currentTime); err != nil { return err } } return nil } // SigningTimeNotValidError is returned when the signing time attribute // falls outside of the signer certificate validity. type SigningTimeNotValidError struct { SigningTime time.Time NotBefore time.Time // NotBefore of signer NotAfter time.Time // NotAfter of signer } func (e *SigningTimeNotValidError) Error() string { return fmt.Sprintf("pkcs7: signing time %q is outside of certificate validity %q to %q", e.SigningTime.Format(time.RFC3339), e.NotBefore.Format(time.RFC3339), e.NotAfter.Format(time.RFC3339)) } func verifySignatureAtTime(p7 *PKCS7, signer signerInfo, truststore *x509.CertPool, currentTime time.Time) (err error) { signedData := p7.Content ee := getCertFromCertsByIssuerAndSerial(p7.Certificates, signer.IssuerAndSerialNumber) if ee == nil { return errors.New("pkcs7: No certificate for signer") } if len(signer.AuthenticatedAttributes) > 0 { // TODO(fullsailor): First check the content type match var ( digest []byte signingTime time.Time ) err := unmarshalAttribute(signer.AuthenticatedAttributes, OIDAttributeMessageDigest, &digest) if err != nil { return err } hash, err := getHashForOID(signer.DigestAlgorithm.Algorithm) if err != nil { return err } h := hash.New() h.Write(p7.Content) computed := h.Sum(nil) if subtle.ConstantTimeCompare(digest, computed) != 1 { return &MessageDigestMismatchError{ ExpectedDigest: digest, ActualDigest: computed, } } signedData, err = marshalAttributes(signer.AuthenticatedAttributes) if err != nil { return err } err = unmarshalAttribute(signer.AuthenticatedAttributes, OIDAttributeSigningTime, &signingTime) if err == nil { // signing time found, performing validity check if signingTime.After(ee.NotAfter) || signingTime.Before(ee.NotBefore) { return &SigningTimeNotValidError{ SigningTime: signingTime, NotBefore: ee.NotBefore, NotAfter: ee.NotAfter, } } } } if truststore != nil { _, err = verifyCertChain(ee, p7.Certificates, truststore, currentTime) if err != nil { return err } } sigalg, err := getSignatureAlgorithm(signer.DigestEncryptionAlgorithm, signer.DigestAlgorithm) if err != nil { return err } return ee.CheckSignature(sigalg, signedData, signer.EncryptedDigest) } func verifySignature(p7 *PKCS7, signer signerInfo, truststore *x509.CertPool) (err error) { signedData := p7.Content ee := getCertFromCertsByIssuerAndSerial(p7.Certificates, signer.IssuerAndSerialNumber) if ee == nil { return errors.New("pkcs7: No certificate for signer") } signingTime := time.Now().UTC() if len(signer.AuthenticatedAttributes) > 0 { // TODO(fullsailor): First check the content type match var digest []byte err := unmarshalAttribute(signer.AuthenticatedAttributes, OIDAttributeMessageDigest, &digest) if err != nil { return err } hash, err := getHashForOID(signer.DigestAlgorithm.Algorithm) if err != nil { return err } h := hash.New() h.Write(p7.Content) computed := h.Sum(nil) if subtle.ConstantTimeCompare(digest, computed) != 1 { return &MessageDigestMismatchError{ ExpectedDigest: digest, ActualDigest: computed, } } signedData, err = marshalAttributes(signer.AuthenticatedAttributes) if err != nil { return err } err = unmarshalAttribute(signer.AuthenticatedAttributes, OIDAttributeSigningTime, &signingTime) if err == nil { // signing time found, performing validity check if signingTime.After(ee.NotAfter) || signingTime.Before(ee.NotBefore) { return &SigningTimeNotValidError{ SigningTime: signingTime, NotBefore: ee.NotBefore, NotAfter: ee.NotAfter, } } } } if truststore != nil { _, err = verifyCertChain(ee, p7.Certificates, truststore, signingTime) if err != nil { return err } } sigalg, err := getSignatureAlgorithm(signer.DigestEncryptionAlgorithm, signer.DigestAlgorithm) if err != nil { return err } return ee.CheckSignature(sigalg, signedData, signer.EncryptedDigest) } // GetOnlySigner returns an x509.Certificate for the first signer of the signed // data payload. If there are more or less than one signer, nil is returned func (p7 *PKCS7) GetOnlySigner() *x509.Certificate { if len(p7.Signers) != 1 { return nil } signer := p7.Signers[0] return getCertFromCertsByIssuerAndSerial(p7.Certificates, signer.IssuerAndSerialNumber) } // UnmarshalSignedAttribute decodes a single attribute from the signer info func (p7 *PKCS7) UnmarshalSignedAttribute(attributeType asn1.ObjectIdentifier, out interface{}) error { sd, ok := p7.raw.(signedData) if !ok { return errors.New("pkcs7: payload is not signedData content") } if len(sd.SignerInfos) < 1 { return errors.New("pkcs7: payload has no signers") } attributes := sd.SignerInfos[0].AuthenticatedAttributes return unmarshalAttribute(attributes, attributeType, out) } func parseSignedData(data []byte) (*PKCS7, error) { var sd signedData asn1.Unmarshal(data, &sd) certs, err := sd.Certificates.Parse() if err != nil { return nil, err } // fmt.Printf("--> Signed Data Version %d\n", sd.Version) var compound asn1.RawValue var content unsignedData // The Content.Bytes maybe empty on PKI responses. if len(sd.ContentInfo.Content.Bytes) > 0 { if _, err := asn1.Unmarshal(sd.ContentInfo.Content.Bytes, &compound); err != nil { return nil, err } } // Compound octet string if compound.IsCompound { if compound.Tag == 4 { for len(compound.Bytes) > 0 { var cdata asn1.RawValue if _, err = asn1.Unmarshal(compound.Bytes, &cdata); err != nil { return nil, err } content = append(content, cdata.Bytes...) compound.Bytes = compound.Bytes[len(cdata.FullBytes):] } } else { content = compound.Bytes } } else { // assuming this is tag 04 content = compound.Bytes } return &PKCS7{ Content: content, Certificates: certs, CRLs: sd.CRLs, Signers: sd.SignerInfos, raw: sd}, nil } // verifyCertChain takes an end-entity certs, a list of potential intermediates and a // truststore, and built all potential chains between the EE and a trusted root. // // When verifying chains that may have expired, currentTime can be set to a past date // to allow the verification to pass. If unset, currentTime is set to the current UTC time. func verifyCertChain(ee *x509.Certificate, certs []*x509.Certificate, truststore *x509.CertPool, currentTime time.Time) (chains [][]*x509.Certificate, err error) { intermediates := x509.NewCertPool() for _, intermediate := range certs { intermediates.AddCert(intermediate) } verifyOptions := x509.VerifyOptions{ Roots: truststore, Intermediates: intermediates, KeyUsages: []x509.ExtKeyUsage{x509.ExtKeyUsageAny}, CurrentTime: currentTime, } chains, err = ee.Verify(verifyOptions) if err != nil { return chains, fmt.Errorf("pkcs7: failed to verify certificate chain: %v", err) } return } // MessageDigestMismatchError is returned when the signer data digest does not // match the computed digest for the contained content type MessageDigestMismatchError struct { ExpectedDigest []byte ActualDigest []byte } func (err *MessageDigestMismatchError) Error() string { return fmt.Sprintf("pkcs7: Message digest mismatch\n\tExpected: %X\n\tActual : %X", err.ExpectedDigest, err.ActualDigest) } func getSignatureAlgorithm(digestEncryption, digest pkix.AlgorithmIdentifier) (x509.SignatureAlgorithm, error) { switch { case digestEncryption.Algorithm.Equal(OIDDigestAlgorithmECDSASHA1): return x509.ECDSAWithSHA1, nil case digestEncryption.Algorithm.Equal(OIDDigestAlgorithmECDSASHA256): return x509.ECDSAWithSHA256, nil case digestEncryption.Algorithm.Equal(OIDDigestAlgorithmECDSASHA384): return x509.ECDSAWithSHA384, nil case digestEncryption.Algorithm.Equal(OIDDigestAlgorithmECDSASHA512): return x509.ECDSAWithSHA512, nil case digestEncryption.Algorithm.Equal(OIDEncryptionAlgorithmRSA), digestEncryption.Algorithm.Equal(OIDEncryptionAlgorithmRSASHA1), digestEncryption.Algorithm.Equal(OIDEncryptionAlgorithmRSASHA256), digestEncryption.Algorithm.Equal(OIDEncryptionAlgorithmRSASHA384), digestEncryption.Algorithm.Equal(OIDEncryptionAlgorithmRSASHA512): switch { case digest.Algorithm.Equal(OIDDigestAlgorithmSHA1), digest.Algorithm.Equal(OIDEncryptionAlgorithmRSASHA1): return x509.SHA1WithRSA, nil case digest.Algorithm.Equal(OIDDigestAlgorithmSHA256), digest.Algorithm.Equal(OIDEncryptionAlgorithmRSASHA256): return x509.SHA256WithRSA, nil case digest.Algorithm.Equal(OIDDigestAlgorithmSHA384), digest.Algorithm.Equal(OIDEncryptionAlgorithmRSASHA384): return x509.SHA384WithRSA, nil case digest.Algorithm.Equal(OIDDigestAlgorithmSHA512), digest.Algorithm.Equal(OIDEncryptionAlgorithmRSASHA512): return x509.SHA512WithRSA, nil default: return -1, fmt.Errorf("pkcs7: unsupported digest %q for encryption algorithm %q", digest.Algorithm.String(), digestEncryption.Algorithm.String()) } case digestEncryption.Algorithm.Equal(OIDDigestAlgorithmDSA), digestEncryption.Algorithm.Equal(OIDDigestAlgorithmDSASHA1): switch { case digest.Algorithm.Equal(OIDDigestAlgorithmSHA1): return x509.DSAWithSHA1, nil case digest.Algorithm.Equal(OIDDigestAlgorithmSHA256): return x509.DSAWithSHA256, nil default: return -1, fmt.Errorf("pkcs7: unsupported digest %q for encryption algorithm %q", digest.Algorithm.String(), digestEncryption.Algorithm.String()) } case digestEncryption.Algorithm.Equal(OIDEncryptionAlgorithmECDSAP256), digestEncryption.Algorithm.Equal(OIDEncryptionAlgorithmECDSAP384), digestEncryption.Algorithm.Equal(OIDEncryptionAlgorithmECDSAP521): switch { case digest.Algorithm.Equal(OIDDigestAlgorithmSHA1): return x509.ECDSAWithSHA1, nil case digest.Algorithm.Equal(OIDDigestAlgorithmSHA256): return x509.ECDSAWithSHA256, nil case digest.Algorithm.Equal(OIDDigestAlgorithmSHA384): return x509.ECDSAWithSHA384, nil case digest.Algorithm.Equal(OIDDigestAlgorithmSHA512): return x509.ECDSAWithSHA512, nil default: return -1, fmt.Errorf("pkcs7: unsupported digest %q for encryption algorithm %q", digest.Algorithm.String(), digestEncryption.Algorithm.String()) } default: return -1, fmt.Errorf("pkcs7: unsupported algorithm %q", digestEncryption.Algorithm.String()) } } func getCertFromCertsByIssuerAndSerial(certs []*x509.Certificate, ias issuerAndSerial) *x509.Certificate { for _, cert := range certs { if isCertMatchForIssuerAndSerial(cert, ias) { return cert } } return nil } func unmarshalAttribute(attrs []attribute, attributeType asn1.ObjectIdentifier, out interface{}) error { for _, attr := range attrs { if attr.Type.Equal(attributeType) { _, err := asn1.Unmarshal(attr.Value.Bytes, out) return err } } return errors.New("pkcs7: attribute type not in attributes") } ================================================ FILE: vendor/github.com/spf13/cobra/.gitignore ================================================ # Compiled Object files, Static and Dynamic libs (Shared Objects) *.o *.a *.so # Folders _obj _test # Architecture specific extensions/prefixes *.[568vq] [568vq].out *.cgo1.go *.cgo2.c _cgo_defun.c _cgo_gotypes.go _cgo_export.* _testmain.go # Vim files https://github.com/github/gitignore/blob/master/Global/Vim.gitignore # swap [._]*.s[a-w][a-z] [._]s[a-w][a-z] # session Session.vim # temporary .netrwhist *~ # auto-generated tag files tags *.exe cobra.test bin .idea/ *.iml ================================================ FILE: vendor/github.com/spf13/cobra/.golangci.yml ================================================ # Copyright 2013-2023 The Cobra Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. version: "2" run: timeout: 5m formatters: enable: - gofmt - goimports linters: default: none enable: #- bodyclose #- depguard #- dogsled #- dupl - errcheck #- exhaustive #- funlen #- gochecknoinits - goconst - gocritic #- gocyclo #- goprintffuncname - gosec - govet - ineffassign #- lll - misspell #- mnd #- nakedret #- noctx - nolintlint #- rowserrcheck - staticcheck - unconvert #- unparam - unused #- whitespace exclusions: presets: - common-false-positives - legacy - std-error-handling settings: govet: # Disable buildtag check to allow dual build tag syntax (both //go:build and // +build). # This is necessary for Go 1.15 compatibility since //go:build was introduced in Go 1.17. # This can be removed once Cobra requires Go 1.17 or higher. disable: - buildtag ================================================ FILE: vendor/github.com/spf13/cobra/.mailmap ================================================ Steve Francia Bjørn Erik Pedersen Fabiano Franz ================================================ FILE: vendor/github.com/spf13/cobra/CONDUCT.md ================================================ ## Cobra User Contract ### Versioning Cobra will follow a steady release cadence. Non breaking changes will be released as minor versions quarterly. Patch bug releases are at the discretion of the maintainers. Users can expect security patch fixes to be released within relatively short order of a CVE becoming known. For more information on security patch fixes see the CVE section below. Releases will follow [Semantic Versioning](https://semver.org/). Users tracking the Master branch should expect unpredictable breaking changes as the project continues to move forward. For stability, it is highly recommended to use a release. ### Backward Compatibility We will maintain two major releases in a moving window. The N-1 release will only receive bug fixes and security updates and will be dropped once N+1 is released. ### Deprecation Deprecation of Go versions or dependent packages will only occur in major releases. To reduce the change of this taking users by surprise, any large deprecation will be preceded by an announcement in the [#cobra slack channel](https://gophers.slack.com/archives/CD3LP1199) and an Issue on Github. ### CVE Maintainers will make every effort to release security patches in the case of a medium to high severity CVE directly impacting the library. The speed in which these patches reach a release is up to the discretion of the maintainers. A low severity CVE may be a lower priority than a high severity one. ### Communication Cobra maintainers will use GitHub issues and the [#cobra slack channel](https://gophers.slack.com/archives/CD3LP1199) as the primary means of communication with the community. This is to foster open communication with all users and contributors. ### Breaking Changes Breaking changes are generally allowed in the master branch, as this is the branch used to develop the next release of Cobra. There may be times, however, when master is closed for breaking changes. This is likely to happen as we near the release of a new version. Breaking changes are not allowed in release branches, as these represent minor versions that have already been released. These version have consumers who expect the APIs, behaviors, etc, to remain stable during the lifetime of the patch stream for the minor release. Examples of breaking changes include: - Removing or renaming exported constant, variable, type, or function. - Updating the version of critical libraries such as `spf13/pflag`, `spf13/viper` etc... - Some version updates may be acceptable for picking up bug fixes, but maintainers must exercise caution when reviewing. There may, at times, need to be exceptions where breaking changes are allowed in release branches. These are at the discretion of the project's maintainers, and must be carefully considered before merging. ### CI Testing Maintainers will ensure the Cobra test suite utilizes the current supported versions of Golang. ### Disclaimer Changes to this document and the contents therein are at the discretion of the maintainers. None of the contents of this document are legally binding in any way to the maintainers or the users. ================================================ FILE: vendor/github.com/spf13/cobra/CONTRIBUTING.md ================================================ # Contributing to Cobra Thank you so much for contributing to Cobra. We appreciate your time and help. Here are some guidelines to help you get started. ## Code of Conduct Be kind and respectful to the members of the community. Take time to educate others who are seeking help. Harassment of any kind will not be tolerated. ## Questions If you have questions regarding Cobra, feel free to ask it in the community [#cobra Slack channel][cobra-slack] ## Filing a bug or feature 1. Before filing an issue, please check the existing issues to see if a similar one was already opened. If there is one already opened, feel free to comment on it. 1. If you believe you've found a bug, please provide detailed steps of reproduction, the version of Cobra and anything else you believe will be useful to help troubleshoot it (e.g. OS environment, environment variables, etc...). Also state the current behavior vs. the expected behavior. 1. If you'd like to see a feature or an enhancement please open an issue with a clear title and description of what the feature is and why it would be beneficial to the project and its users. ## Submitting changes 1. CLA: Upon submitting a Pull Request (PR), contributors will be prompted to sign a CLA. Please sign the CLA :slightly_smiling_face: 1. Tests: If you are submitting code, please ensure you have adequate tests for the feature. Tests can be run via `go test ./...` or `make test`. 1. Since this is golang project, ensure the new code is properly formatted to ensure code consistency. Run `make all`. ### Quick steps to contribute 1. Fork the project. 1. Download your fork to your PC (`git clone https://github.com/your_username/cobra && cd cobra`) 1. Create your feature branch (`git checkout -b my-new-feature`) 1. Make changes and run tests (`make test`) 1. Add them to staging (`git add .`) 1. Commit your changes (`git commit -m 'Add some feature'`) 1. Push to the branch (`git push origin my-new-feature`) 1. Create new pull request [cobra-slack]: https://gophers.slack.com/archives/CD3LP1199 ================================================ FILE: vendor/github.com/spf13/cobra/LICENSE.txt ================================================ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. ================================================ FILE: vendor/github.com/spf13/cobra/MAINTAINERS ================================================ maintainers: - spf13 - johnSchnake - jpmcb - marckhouzam inactive: - anthonyfok - bep - bogem - broady - eparis - jharshman - wfernandes ================================================ FILE: vendor/github.com/spf13/cobra/Makefile ================================================ BIN="./bin" SRC=$(shell find . -name "*.go") ifeq (, $(shell which golangci-lint)) $(warning "could not find golangci-lint in $(PATH), run: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh") endif .PHONY: fmt lint test install_deps clean default: all all: fmt test fmt: $(info ******************** checking formatting ********************) @test -z $(shell gofmt -l $(SRC)) || (gofmt -d $(SRC); exit 1) lint: $(info ******************** running lint tools ********************) golangci-lint run -v test: install_deps $(info ******************** running tests ********************) go test -v ./... richtest: install_deps $(info ******************** running tests with kyoh86/richgo ********************) richgo test -v ./... install_deps: $(info ******************** downloading dependencies ********************) go get -v ./... clean: rm -rf $(BIN) ================================================ FILE: vendor/github.com/spf13/cobra/README.md ================================================ Cobra is a library for creating powerful modern CLI applications. Visit Cobra.dev for extensive documentation Cobra is used in many Go projects such as [Kubernetes](https://kubernetes.io/), [Hugo](https://gohugo.io), and [GitHub CLI](https://github.com/cli/cli) to name a few. [This list](site/content/projects_using_cobra.md) contains a more extensive list of projects using Cobra. [![](https://img.shields.io/github/actions/workflow/status/spf13/cobra/test.yml?branch=main&longCache=true&label=Test&logo=github%20actions&logoColor=fff)](https://github.com/spf13/cobra/actions?query=workflow%3ATest) [![Go Reference](https://pkg.go.dev/badge/github.com/spf13/cobra.svg)](https://pkg.go.dev/github.com/spf13/cobra) [![Go Report Card](https://goreportcard.com/badge/github.com/spf13/cobra)](https://goreportcard.com/report/github.com/spf13/cobra) [![Slack](https://img.shields.io/badge/Slack-cobra-brightgreen)](https://gophers.slack.com/archives/CD3LP1199)
Supported by:

Warp sponsorship ### [Warp, the AI terminal for devs](https://www.warp.dev/cobra) [Try Cobra in Warp today](https://www.warp.dev/cobra)

# Overview Cobra is a library providing a simple interface to create powerful modern CLI interfaces similar to git & go tools. Cobra provides: * Easy subcommand-based CLIs: `app server`, `app fetch`, etc. * Fully POSIX-compliant flags (including short & long versions) * Nested subcommands * Global, local and cascading flags * Intelligent suggestions (`app srver`... did you mean `app server`?) * Automatic help generation for commands and flags * Grouping help for subcommands * Automatic help flag recognition of `-h`, `--help`, etc. * Automatically generated shell autocomplete for your application (bash, zsh, fish, powershell) * Automatically generated man pages for your application * Command aliases so you can change things without breaking them * The flexibility to define your own help, usage, etc. * Optional seamless integration with [viper](https://github.com/spf13/viper) for 12-factor apps # Concepts Cobra is built on a structure of commands, arguments & flags. **Commands** represent actions, **Args** are things and **Flags** are modifiers for those actions. The best applications read like sentences when used, and as a result, users intuitively know how to interact with them. The pattern to follow is `APPNAME VERB NOUN --ADJECTIVE` or `APPNAME COMMAND ARG --FLAG`. A few good real world examples may better illustrate this point. In the following example, 'server' is a command, and 'port' is a flag: hugo server --port=1313 In this command we are telling Git to clone the url bare. git clone URL --bare ## Commands Command is the central point of the application. Each interaction that the application supports will be contained in a Command. A command can have children commands and optionally run an action. In the example above, 'server' is the command. [More about cobra.Command](https://pkg.go.dev/github.com/spf13/cobra#Command) ## Flags A flag is a way to modify the behavior of a command. Cobra supports fully POSIX-compliant flags as well as the Go [flag package](https://golang.org/pkg/flag/). A Cobra command can define flags that persist through to children commands and flags that are only available to that command. In the example above, 'port' is the flag. Flag functionality is provided by the [pflag library](https://github.com/spf13/pflag), a fork of the flag standard library which maintains the same interface while adding POSIX compliance. # Installing Using Cobra is easy. First, use `go get` to install the latest version of the library. ``` go get -u github.com/spf13/cobra@latest ``` Next, include Cobra in your application: ```go import "github.com/spf13/cobra" ``` # Usage `cobra-cli` is a command line program to generate cobra applications and command files. It will bootstrap your application scaffolding to rapidly develop a Cobra-based application. It is the easiest way to incorporate Cobra into your application. It can be installed by running: ``` go install github.com/spf13/cobra-cli@latest ``` For complete details on using the Cobra-CLI generator, please read [The Cobra Generator README](https://github.com/spf13/cobra-cli/blob/main/README.md) For complete details on using the Cobra library, please read [The Cobra User Guide](site/content/user_guide.md). # License Cobra is released under the Apache 2.0 license. See [LICENSE.txt](LICENSE.txt) ================================================ FILE: vendor/github.com/spf13/cobra/SECURITY.md ================================================ # Security Policy ## Reporting a Vulnerability The `cobra` maintainers take security issues seriously and we appreciate your efforts to _**responsibly**_ disclose your findings. We will make every effort to swiftly respond and address concerns. To report a security vulnerability: 1. **DO NOT** create a public GitHub issue for the vulnerability! 2. **DO NOT** create a public GitHub Pull Request with a fix for the vulnerability! 3. Send an email to `cobra-security@googlegroups.com`. 4. Include the following details in your report: - Description of the vulnerability - Steps to reproduce - Potential impact of the vulnerability (to your downstream project, to the Go ecosystem, etc.) - Any potential mitigations you've already identified 5. Allow up to 7 days for an initial response. You should receive an acknowledgment of your report and an estimated timeline for a fix. 6. (Optional) If you have a fix and would like to contribute your patch, please work directly with the maintainers via `cobra-security@googlegroups.com` to coordinate pushing the patch to GitHub, cutting a new release, and disclosing the change. ## Response Process When a security vulnerability report is received, the `cobra` maintainers will: 1. Confirm receipt of the vulnerability report within 7 days. 2. Assess the report to determine if it constitutes a security vulnerability. 3. If confirmed, assign the vulnerability a severity level and create a timeline for addressing it. 4. Develop and test a fix. 5. Patch the vulnerability and make a new GitHub release: the maintainers will coordinate disclosure with the reporter. 6. Create a new GitHub Security Advisory to inform the broader Go ecosystem ## Disclosure Policy The `cobra` maintainers follow a coordinated disclosure process: 1. Security vulnerabilities will be addressed as quickly as possible. 2. A CVE (Common Vulnerabilities and Exposures) identifier will be requested for significant vulnerabilities that are within `cobra` itself. 3. Once a fix is ready, the maintainers will: - Release a new version containing the fix. - Update the security advisory with details about the vulnerability. - Credit the reporter (unless they wish to remain anonymous). - Credit the fixer (unless they wish to remain anonymous, this may be the same as the reporter). - Announce the vulnerability through appropriate channels (GitHub Security Advisory, mailing lists, GitHub Releases, etc.) ## Supported Versions Security fixes will typically only be released for the most recent major release. ## Upstream Security Issues `cobra` generally will not accept vulnerability reports that originate in upstream dependencies. I.e., if there is a problem in Go code that `cobra` depends on, it is best to engage that project's maintainers and owners. This security policy primarily pertains only to `cobra` itself but if you believe you've identified a problem that originates in an upstream dependency and is being widely distributed by `cobra`, please follow the disclosure procedure above: the `cobra` maintainers will work with you to determine the severity and ecosystem impact. ## Security Updates and CVEs Information about known security vulnerabilities and CVEs affecting `cobra` will be published as GitHub Security Advisories at https://github.com/spf13/cobra/security/advisories. All users are encouraged to watch the repository and upgrade promptly when security releases are published. ## `cobra` Security Best Practices for Users When using `cobra` in your CLIs, the `cobra` maintainers recommend the following: 1. Always use the latest version of `cobra`. 2. [Use Go modules](https://go.dev/blog/using-go-modules) for dependency management. 3. Always use the latest possible version of Go. ## Security Best Practices for Contributors When contributing to `cobra`: 1. Be mindful of security implications when adding new features or modifying existing ones. 2. Be aware of `cobra`'s extremely large reach: it is used in nearly every Go CLI (like Kubernetes, Docker, Prometheus, etc. etc.) 3. Write tests that explicitly cover edge cases and potential issues. 4. If you discover a security issue while working on `cobra`, please report it following the process above rather than opening a public pull request or issue that addresses the vulnerability. 5. Take personal sec-ops seriously and secure your GitHub account: use [two-factor authentication](https://docs.github.com/en/authentication/securing-your-account-with-two-factor-authentication-2fa), [sign your commits with a GPG or SSH key](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification), etc. ## Acknowledgments The `cobra` maintainers would like to thank all security researchers and community members who help keep cobra, its users, and the entire Go ecosystem secure through responsible disclosures!! --- *This security policy is inspired by the [Open Web Application Security Project (OWASP)](https://owasp.org/) guidelines and security best practices.* ================================================ FILE: vendor/github.com/spf13/cobra/active_help.go ================================================ // Copyright 2013-2023 The Cobra Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package cobra import ( "fmt" "os" ) const ( activeHelpMarker = "_activeHelp_ " // The below values should not be changed: programs will be using them explicitly // in their user documentation, and users will be using them explicitly. activeHelpEnvVarSuffix = "ACTIVE_HELP" activeHelpGlobalEnvVar = configEnvVarGlobalPrefix + "_" + activeHelpEnvVarSuffix activeHelpGlobalDisable = "0" ) // AppendActiveHelp adds the specified string to the specified array to be used as ActiveHelp. // Such strings will be processed by the completion script and will be shown as ActiveHelp // to the user. // The array parameter should be the array that will contain the completions. // This function can be called multiple times before and/or after completions are added to // the array. Each time this function is called with the same array, the new // ActiveHelp line will be shown below the previous ones when completion is triggered. func AppendActiveHelp(compArray []Completion, activeHelpStr string) []Completion { return append(compArray, fmt.Sprintf("%s%s", activeHelpMarker, activeHelpStr)) } // GetActiveHelpConfig returns the value of the ActiveHelp environment variable // _ACTIVE_HELP where is the name of the root command in upper // case, with all non-ASCII-alphanumeric characters replaced by `_`. // It will always return "0" if the global environment variable COBRA_ACTIVE_HELP // is set to "0". func GetActiveHelpConfig(cmd *Command) string { activeHelpCfg := os.Getenv(activeHelpGlobalEnvVar) if activeHelpCfg != activeHelpGlobalDisable { activeHelpCfg = os.Getenv(activeHelpEnvVar(cmd.Root().Name())) } return activeHelpCfg } // activeHelpEnvVar returns the name of the program-specific ActiveHelp environment // variable. It has the format _ACTIVE_HELP where is the name of the // root command in upper case, with all non-ASCII-alphanumeric characters replaced by `_`. func activeHelpEnvVar(name string) string { return configEnvVar(name, activeHelpEnvVarSuffix) } ================================================ FILE: vendor/github.com/spf13/cobra/args.go ================================================ // Copyright 2013-2023 The Cobra Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package cobra import ( "fmt" "strings" ) type PositionalArgs func(cmd *Command, args []string) error // legacyArgs validation has the following behaviour: // - root commands with no subcommands can take arbitrary arguments // - root commands with subcommands will do subcommand validity checking // - subcommands will always accept arbitrary arguments func legacyArgs(cmd *Command, args []string) error { // no subcommand, always take args if !cmd.HasSubCommands() { return nil } // root command with subcommands, do subcommand checking. if !cmd.HasParent() && len(args) > 0 { return fmt.Errorf("unknown command %q for %q%s", args[0], cmd.CommandPath(), cmd.findSuggestions(args[0])) } return nil } // NoArgs returns an error if any args are included. func NoArgs(cmd *Command, args []string) error { if len(args) > 0 { return fmt.Errorf("unknown command %q for %q", args[0], cmd.CommandPath()) } return nil } // OnlyValidArgs returns an error if there are any positional args that are not in // the `ValidArgs` field of `Command` func OnlyValidArgs(cmd *Command, args []string) error { if len(cmd.ValidArgs) > 0 { // Remove any description that may be included in ValidArgs. // A description is following a tab character. validArgs := make([]string, 0, len(cmd.ValidArgs)) for _, v := range cmd.ValidArgs { validArgs = append(validArgs, strings.SplitN(v, "\t", 2)[0]) } for _, v := range args { if !stringInSlice(v, validArgs) { return fmt.Errorf("invalid argument %q for %q%s", v, cmd.CommandPath(), cmd.findSuggestions(args[0])) } } } return nil } // ArbitraryArgs never returns an error. func ArbitraryArgs(cmd *Command, args []string) error { return nil } // MinimumNArgs returns an error if there is not at least N args. func MinimumNArgs(n int) PositionalArgs { return func(cmd *Command, args []string) error { if len(args) < n { return fmt.Errorf("requires at least %d arg(s), only received %d", n, len(args)) } return nil } } // MaximumNArgs returns an error if there are more than N args. func MaximumNArgs(n int) PositionalArgs { return func(cmd *Command, args []string) error { if len(args) > n { return fmt.Errorf("accepts at most %d arg(s), received %d", n, len(args)) } return nil } } // ExactArgs returns an error if there are not exactly n args. func ExactArgs(n int) PositionalArgs { return func(cmd *Command, args []string) error { if len(args) != n { return fmt.Errorf("accepts %d arg(s), received %d", n, len(args)) } return nil } } // RangeArgs returns an error if the number of args is not within the expected range. func RangeArgs(min int, max int) PositionalArgs { return func(cmd *Command, args []string) error { if len(args) < min || len(args) > max { return fmt.Errorf("accepts between %d and %d arg(s), received %d", min, max, len(args)) } return nil } } // MatchAll allows combining several PositionalArgs to work in concert. func MatchAll(pargs ...PositionalArgs) PositionalArgs { return func(cmd *Command, args []string) error { for _, parg := range pargs { if err := parg(cmd, args); err != nil { return err } } return nil } } // ExactValidArgs returns an error if there are not exactly N positional args OR // there are any positional args that are not in the `ValidArgs` field of `Command` // // Deprecated: use MatchAll(ExactArgs(n), OnlyValidArgs) instead func ExactValidArgs(n int) PositionalArgs { return MatchAll(ExactArgs(n), OnlyValidArgs) } ================================================ FILE: vendor/github.com/spf13/cobra/bash_completions.go ================================================ // Copyright 2013-2023 The Cobra Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package cobra import ( "bytes" "fmt" "io" "os" "sort" "strings" "github.com/spf13/pflag" ) // Annotations for Bash completion. const ( BashCompFilenameExt = "cobra_annotation_bash_completion_filename_extensions" BashCompCustom = "cobra_annotation_bash_completion_custom" BashCompOneRequiredFlag = "cobra_annotation_bash_completion_one_required_flag" BashCompSubdirsInDir = "cobra_annotation_bash_completion_subdirs_in_dir" ) func writePreamble(buf io.StringWriter, name string) { WriteStringAndCheck(buf, fmt.Sprintf("# bash completion for %-36s -*- shell-script -*-\n", name)) WriteStringAndCheck(buf, fmt.Sprintf(` __%[1]s_debug() { if [[ -n ${BASH_COMP_DEBUG_FILE:-} ]]; then echo "$*" >> "${BASH_COMP_DEBUG_FILE}" fi } # Homebrew on Macs have version 1.3 of bash-completion which doesn't include # _init_completion. This is a very minimal version of that function. __%[1]s_init_completion() { COMPREPLY=() _get_comp_words_by_ref "$@" cur prev words cword } __%[1]s_index_of_word() { local w word=$1 shift index=0 for w in "$@"; do [[ $w = "$word" ]] && return index=$((index+1)) done index=-1 } __%[1]s_contains_word() { local w word=$1; shift for w in "$@"; do [[ $w = "$word" ]] && return done return 1 } __%[1]s_handle_go_custom_completion() { __%[1]s_debug "${FUNCNAME[0]}: cur is ${cur}, words[*] is ${words[*]}, #words[@] is ${#words[@]}" local shellCompDirectiveError=%[3]d local shellCompDirectiveNoSpace=%[4]d local shellCompDirectiveNoFileComp=%[5]d local shellCompDirectiveFilterFileExt=%[6]d local shellCompDirectiveFilterDirs=%[7]d local out requestComp lastParam lastChar comp directive args # Prepare the command to request completions for the program. # Calling ${words[0]} instead of directly %[1]s allows handling aliases args=("${words[@]:1}") # Disable ActiveHelp which is not supported for bash completion v1 requestComp="%[8]s=0 ${words[0]} %[2]s ${args[*]}" lastParam=${words[$((${#words[@]}-1))]} lastChar=${lastParam:$((${#lastParam}-1)):1} __%[1]s_debug "${FUNCNAME[0]}: lastParam ${lastParam}, lastChar ${lastChar}" if [ -z "${cur}" ] && [ "${lastChar}" != "=" ]; then # If the last parameter is complete (there is a space following it) # We add an extra empty parameter so we can indicate this to the go method. __%[1]s_debug "${FUNCNAME[0]}: Adding extra empty parameter" requestComp="${requestComp} \"\"" fi __%[1]s_debug "${FUNCNAME[0]}: calling ${requestComp}" # Use eval to handle any environment variables and such out=$(eval "${requestComp}" 2>/dev/null) # Extract the directive integer at the very end of the output following a colon (:) directive=${out##*:} # Remove the directive out=${out%%:*} if [ "${directive}" = "${out}" ]; then # There is not directive specified directive=0 fi __%[1]s_debug "${FUNCNAME[0]}: the completion directive is: ${directive}" __%[1]s_debug "${FUNCNAME[0]}: the completions are: ${out}" if [ $((directive & shellCompDirectiveError)) -ne 0 ]; then # Error code. No completion. __%[1]s_debug "${FUNCNAME[0]}: received error from custom completion go code" return else if [ $((directive & shellCompDirectiveNoSpace)) -ne 0 ]; then if [[ $(type -t compopt) = "builtin" ]]; then __%[1]s_debug "${FUNCNAME[0]}: activating no space" compopt -o nospace fi fi if [ $((directive & shellCompDirectiveNoFileComp)) -ne 0 ]; then if [[ $(type -t compopt) = "builtin" ]]; then __%[1]s_debug "${FUNCNAME[0]}: activating no file completion" compopt +o default fi fi fi if [ $((directive & shellCompDirectiveFilterFileExt)) -ne 0 ]; then # File extension filtering local fullFilter filter filteringCmd # Do not use quotes around the $out variable or else newline # characters will be kept. for filter in ${out}; do fullFilter+="$filter|" done filteringCmd="_filedir $fullFilter" __%[1]s_debug "File filtering command: $filteringCmd" $filteringCmd elif [ $((directive & shellCompDirectiveFilterDirs)) -ne 0 ]; then # File completion for directories only local subdir # Use printf to strip any trailing newline subdir=$(printf "%%s" "${out}") if [ -n "$subdir" ]; then __%[1]s_debug "Listing directories in $subdir" __%[1]s_handle_subdirs_in_dir_flag "$subdir" else __%[1]s_debug "Listing directories in ." _filedir -d fi else while IFS='' read -r comp; do COMPREPLY+=("$comp") done < <(compgen -W "${out}" -- "$cur") fi } __%[1]s_handle_reply() { __%[1]s_debug "${FUNCNAME[0]}" local comp case $cur in -*) if [[ $(type -t compopt) = "builtin" ]]; then compopt -o nospace fi local allflags if [ ${#must_have_one_flag[@]} -ne 0 ]; then allflags=("${must_have_one_flag[@]}") else allflags=("${flags[*]} ${two_word_flags[*]}") fi while IFS='' read -r comp; do COMPREPLY+=("$comp") done < <(compgen -W "${allflags[*]}" -- "$cur") if [[ $(type -t compopt) = "builtin" ]]; then [[ "${COMPREPLY[0]}" == *= ]] || compopt +o nospace fi # complete after --flag=abc if [[ $cur == *=* ]]; then if [[ $(type -t compopt) = "builtin" ]]; then compopt +o nospace fi local index flag flag="${cur%%=*}" __%[1]s_index_of_word "${flag}" "${flags_with_completion[@]}" COMPREPLY=() if [[ ${index} -ge 0 ]]; then PREFIX="" cur="${cur#*=}" ${flags_completion[${index}]} if [ -n "${ZSH_VERSION:-}" ]; then # zsh completion needs --flag= prefix eval "COMPREPLY=( \"\${COMPREPLY[@]/#/${flag}=}\" )" fi fi fi if [[ -z "${flag_parsing_disabled}" ]]; then # If flag parsing is enabled, we have completed the flags and can return. # If flag parsing is disabled, we may not know all (or any) of the flags, so we fallthrough # to possibly call handle_go_custom_completion. return 0; fi ;; esac # check if we are handling a flag with special work handling local index __%[1]s_index_of_word "${prev}" "${flags_with_completion[@]}" if [[ ${index} -ge 0 ]]; then ${flags_completion[${index}]} return fi # we are parsing a flag and don't have a special handler, no completion if [[ ${cur} != "${words[cword]}" ]]; then return fi local completions completions=("${commands[@]}") if [[ ${#must_have_one_noun[@]} -ne 0 ]]; then completions+=("${must_have_one_noun[@]}") elif [[ -n "${has_completion_function}" ]]; then # if a go completion function is provided, defer to that function __%[1]s_handle_go_custom_completion fi if [[ ${#must_have_one_flag[@]} -ne 0 ]]; then completions+=("${must_have_one_flag[@]}") fi while IFS='' read -r comp; do COMPREPLY+=("$comp") done < <(compgen -W "${completions[*]}" -- "$cur") if [[ ${#COMPREPLY[@]} -eq 0 && ${#noun_aliases[@]} -gt 0 && ${#must_have_one_noun[@]} -ne 0 ]]; then while IFS='' read -r comp; do COMPREPLY+=("$comp") done < <(compgen -W "${noun_aliases[*]}" -- "$cur") fi if [[ ${#COMPREPLY[@]} -eq 0 ]]; then if declare -F __%[1]s_custom_func >/dev/null; then # try command name qualified custom func __%[1]s_custom_func else # otherwise fall back to unqualified for compatibility declare -F __custom_func >/dev/null && __custom_func fi fi # available in bash-completion >= 2, not always present on macOS if declare -F __ltrim_colon_completions >/dev/null; then __ltrim_colon_completions "$cur" fi # If there is only 1 completion and it is a flag with an = it will be completed # but we don't want a space after the = if [[ "${#COMPREPLY[@]}" -eq "1" ]] && [[ $(type -t compopt) = "builtin" ]] && [[ "${COMPREPLY[0]}" == --*= ]]; then compopt -o nospace fi } # The arguments should be in the form "ext1|ext2|extn" __%[1]s_handle_filename_extension_flag() { local ext="$1" _filedir "@(${ext})" } __%[1]s_handle_subdirs_in_dir_flag() { local dir="$1" pushd "${dir}" >/dev/null 2>&1 && _filedir -d && popd >/dev/null 2>&1 || return } __%[1]s_handle_flag() { __%[1]s_debug "${FUNCNAME[0]}: c is $c words[c] is ${words[c]}" # if a command required a flag, and we found it, unset must_have_one_flag() local flagname=${words[c]} local flagvalue="" # if the word contained an = if [[ ${words[c]} == *"="* ]]; then flagvalue=${flagname#*=} # take in as flagvalue after the = flagname=${flagname%%=*} # strip everything after the = flagname="${flagname}=" # but put the = back fi __%[1]s_debug "${FUNCNAME[0]}: looking for ${flagname}" if __%[1]s_contains_word "${flagname}" "${must_have_one_flag[@]}"; then must_have_one_flag=() fi # if you set a flag which only applies to this command, don't show subcommands if __%[1]s_contains_word "${flagname}" "${local_nonpersistent_flags[@]}"; then commands=() fi # keep flag value with flagname as flaghash # flaghash variable is an associative array which is only supported in bash > 3. if [[ -z "${BASH_VERSION:-}" || "${BASH_VERSINFO[0]:-}" -gt 3 ]]; then if [ -n "${flagvalue}" ] ; then flaghash[${flagname}]=${flagvalue} elif [ -n "${words[ $((c+1)) ]}" ] ; then flaghash[${flagname}]=${words[ $((c+1)) ]} else flaghash[${flagname}]="true" # pad "true" for bool flag fi fi # skip the argument to a two word flag if [[ ${words[c]} != *"="* ]] && __%[1]s_contains_word "${words[c]}" "${two_word_flags[@]}"; then __%[1]s_debug "${FUNCNAME[0]}: found a flag ${words[c]}, skip the next argument" c=$((c+1)) # if we are looking for a flags value, don't show commands if [[ $c -eq $cword ]]; then commands=() fi fi c=$((c+1)) } __%[1]s_handle_noun() { __%[1]s_debug "${FUNCNAME[0]}: c is $c words[c] is ${words[c]}" if __%[1]s_contains_word "${words[c]}" "${must_have_one_noun[@]}"; then must_have_one_noun=() elif __%[1]s_contains_word "${words[c]}" "${noun_aliases[@]}"; then must_have_one_noun=() fi nouns+=("${words[c]}") c=$((c+1)) } __%[1]s_handle_command() { __%[1]s_debug "${FUNCNAME[0]}: c is $c words[c] is ${words[c]}" local next_command if [[ -n ${last_command} ]]; then next_command="_${last_command}_${words[c]//:/__}" else if [[ $c -eq 0 ]]; then next_command="_%[1]s_root_command" else next_command="_${words[c]//:/__}" fi fi c=$((c+1)) __%[1]s_debug "${FUNCNAME[0]}: looking for ${next_command}" declare -F "$next_command" >/dev/null && $next_command } __%[1]s_handle_word() { if [[ $c -ge $cword ]]; then __%[1]s_handle_reply return fi __%[1]s_debug "${FUNCNAME[0]}: c is $c words[c] is ${words[c]}" if [[ "${words[c]}" == -* ]]; then __%[1]s_handle_flag elif __%[1]s_contains_word "${words[c]}" "${commands[@]}"; then __%[1]s_handle_command elif [[ $c -eq 0 ]]; then __%[1]s_handle_command elif __%[1]s_contains_word "${words[c]}" "${command_aliases[@]}"; then # aliashash variable is an associative array which is only supported in bash > 3. if [[ -z "${BASH_VERSION:-}" || "${BASH_VERSINFO[0]:-}" -gt 3 ]]; then words[c]=${aliashash[${words[c]}]} __%[1]s_handle_command else __%[1]s_handle_noun fi else __%[1]s_handle_noun fi __%[1]s_handle_word } `, name, ShellCompNoDescRequestCmd, ShellCompDirectiveError, ShellCompDirectiveNoSpace, ShellCompDirectiveNoFileComp, ShellCompDirectiveFilterFileExt, ShellCompDirectiveFilterDirs, activeHelpEnvVar(name))) } func writePostscript(buf io.StringWriter, name string) { name = strings.ReplaceAll(name, ":", "__") WriteStringAndCheck(buf, fmt.Sprintf("__start_%s()\n", name)) WriteStringAndCheck(buf, fmt.Sprintf(`{ local cur prev words cword split declare -A flaghash 2>/dev/null || : declare -A aliashash 2>/dev/null || : if declare -F _init_completion >/dev/null 2>&1; then _init_completion -s || return else __%[1]s_init_completion -n "=" || return fi local c=0 local flag_parsing_disabled= local flags=() local two_word_flags=() local local_nonpersistent_flags=() local flags_with_completion=() local flags_completion=() local commands=("%[1]s") local command_aliases=() local must_have_one_flag=() local must_have_one_noun=() local has_completion_function="" local last_command="" local nouns=() local noun_aliases=() __%[1]s_handle_word } `, name)) WriteStringAndCheck(buf, fmt.Sprintf(`if [[ $(type -t compopt) = "builtin" ]]; then complete -o default -F __start_%s %s else complete -o default -o nospace -F __start_%s %s fi `, name, name, name, name)) WriteStringAndCheck(buf, "# ex: ts=4 sw=4 et filetype=sh\n") } func writeCommands(buf io.StringWriter, cmd *Command) { WriteStringAndCheck(buf, " commands=()\n") for _, c := range cmd.Commands() { if !c.IsAvailableCommand() && c != cmd.helpCommand { continue } WriteStringAndCheck(buf, fmt.Sprintf(" commands+=(%q)\n", c.Name())) writeCmdAliases(buf, c) } WriteStringAndCheck(buf, "\n") } func writeFlagHandler(buf io.StringWriter, name string, annotations map[string][]string, cmd *Command) { for key, value := range annotations { switch key { case BashCompFilenameExt: WriteStringAndCheck(buf, fmt.Sprintf(" flags_with_completion+=(%q)\n", name)) var ext string if len(value) > 0 { ext = fmt.Sprintf("__%s_handle_filename_extension_flag ", cmd.Root().Name()) + strings.Join(value, "|") } else { ext = "_filedir" } WriteStringAndCheck(buf, fmt.Sprintf(" flags_completion+=(%q)\n", ext)) case BashCompCustom: WriteStringAndCheck(buf, fmt.Sprintf(" flags_with_completion+=(%q)\n", name)) if len(value) > 0 { handlers := strings.Join(value, "; ") WriteStringAndCheck(buf, fmt.Sprintf(" flags_completion+=(%q)\n", handlers)) } else { WriteStringAndCheck(buf, " flags_completion+=(:)\n") } case BashCompSubdirsInDir: WriteStringAndCheck(buf, fmt.Sprintf(" flags_with_completion+=(%q)\n", name)) var ext string if len(value) == 1 { ext = fmt.Sprintf("__%s_handle_subdirs_in_dir_flag ", cmd.Root().Name()) + value[0] } else { ext = "_filedir -d" } WriteStringAndCheck(buf, fmt.Sprintf(" flags_completion+=(%q)\n", ext)) } } } const cbn = "\")\n" func writeShortFlag(buf io.StringWriter, flag *pflag.Flag, cmd *Command) { name := flag.Shorthand format := " " if len(flag.NoOptDefVal) == 0 { format += "two_word_" } format += "flags+=(\"-%s" + cbn WriteStringAndCheck(buf, fmt.Sprintf(format, name)) writeFlagHandler(buf, "-"+name, flag.Annotations, cmd) } func writeFlag(buf io.StringWriter, flag *pflag.Flag, cmd *Command) { name := flag.Name format := " flags+=(\"--%s" if len(flag.NoOptDefVal) == 0 { format += "=" } format += cbn WriteStringAndCheck(buf, fmt.Sprintf(format, name)) if len(flag.NoOptDefVal) == 0 { format = " two_word_flags+=(\"--%s" + cbn WriteStringAndCheck(buf, fmt.Sprintf(format, name)) } writeFlagHandler(buf, "--"+name, flag.Annotations, cmd) } func writeLocalNonPersistentFlag(buf io.StringWriter, flag *pflag.Flag) { name := flag.Name format := " local_nonpersistent_flags+=(\"--%[1]s" + cbn if len(flag.NoOptDefVal) == 0 { format += " local_nonpersistent_flags+=(\"--%[1]s=" + cbn } WriteStringAndCheck(buf, fmt.Sprintf(format, name)) if len(flag.Shorthand) > 0 { WriteStringAndCheck(buf, fmt.Sprintf(" local_nonpersistent_flags+=(\"-%s\")\n", flag.Shorthand)) } } // prepareCustomAnnotationsForFlags setup annotations for go completions for registered flags func prepareCustomAnnotationsForFlags(cmd *Command) { flagCompletionMutex.RLock() defer flagCompletionMutex.RUnlock() for flag := range flagCompletionFunctions { // Make sure the completion script calls the __*_go_custom_completion function for // every registered flag. We need to do this here (and not when the flag was registered // for completion) so that we can know the root command name for the prefix // of ___go_custom_completion if flag.Annotations == nil { flag.Annotations = map[string][]string{} } flag.Annotations[BashCompCustom] = []string{fmt.Sprintf("__%[1]s_handle_go_custom_completion", cmd.Root().Name())} } } func writeFlags(buf io.StringWriter, cmd *Command) { prepareCustomAnnotationsForFlags(cmd) WriteStringAndCheck(buf, ` flags=() two_word_flags=() local_nonpersistent_flags=() flags_with_completion=() flags_completion=() `) if cmd.DisableFlagParsing { WriteStringAndCheck(buf, " flag_parsing_disabled=1\n") } localNonPersistentFlags := cmd.LocalNonPersistentFlags() cmd.NonInheritedFlags().VisitAll(func(flag *pflag.Flag) { if nonCompletableFlag(flag) { return } writeFlag(buf, flag, cmd) if len(flag.Shorthand) > 0 { writeShortFlag(buf, flag, cmd) } // localNonPersistentFlags are used to stop the completion of subcommands when one is set // if TraverseChildren is true we should allow to complete subcommands if localNonPersistentFlags.Lookup(flag.Name) != nil && !cmd.Root().TraverseChildren { writeLocalNonPersistentFlag(buf, flag) } }) cmd.InheritedFlags().VisitAll(func(flag *pflag.Flag) { if nonCompletableFlag(flag) { return } writeFlag(buf, flag, cmd) if len(flag.Shorthand) > 0 { writeShortFlag(buf, flag, cmd) } }) WriteStringAndCheck(buf, "\n") } func writeRequiredFlag(buf io.StringWriter, cmd *Command) { WriteStringAndCheck(buf, " must_have_one_flag=()\n") flags := cmd.NonInheritedFlags() flags.VisitAll(func(flag *pflag.Flag) { if nonCompletableFlag(flag) { return } if _, ok := flag.Annotations[BashCompOneRequiredFlag]; ok { format := " must_have_one_flag+=(\"--%s" if flag.Value.Type() != "bool" { format += "=" } format += cbn WriteStringAndCheck(buf, fmt.Sprintf(format, flag.Name)) if len(flag.Shorthand) > 0 { WriteStringAndCheck(buf, fmt.Sprintf(" must_have_one_flag+=(\"-%s"+cbn, flag.Shorthand)) } } }) } func writeRequiredNouns(buf io.StringWriter, cmd *Command) { WriteStringAndCheck(buf, " must_have_one_noun=()\n") sort.Strings(cmd.ValidArgs) for _, value := range cmd.ValidArgs { // Remove any description that may be included following a tab character. // Descriptions are not supported by bash completion. value = strings.SplitN(value, "\t", 2)[0] WriteStringAndCheck(buf, fmt.Sprintf(" must_have_one_noun+=(%q)\n", value)) } if cmd.ValidArgsFunction != nil { WriteStringAndCheck(buf, " has_completion_function=1\n") } } func writeCmdAliases(buf io.StringWriter, cmd *Command) { if len(cmd.Aliases) == 0 { return } sort.Strings(cmd.Aliases) WriteStringAndCheck(buf, fmt.Sprint(` if [[ -z "${BASH_VERSION:-}" || "${BASH_VERSINFO[0]:-}" -gt 3 ]]; then`, "\n")) for _, value := range cmd.Aliases { WriteStringAndCheck(buf, fmt.Sprintf(" command_aliases+=(%q)\n", value)) WriteStringAndCheck(buf, fmt.Sprintf(" aliashash[%q]=%q\n", value, cmd.Name())) } WriteStringAndCheck(buf, ` fi`) WriteStringAndCheck(buf, "\n") } func writeArgAliases(buf io.StringWriter, cmd *Command) { WriteStringAndCheck(buf, " noun_aliases=()\n") sort.Strings(cmd.ArgAliases) for _, value := range cmd.ArgAliases { WriteStringAndCheck(buf, fmt.Sprintf(" noun_aliases+=(%q)\n", value)) } } func gen(buf io.StringWriter, cmd *Command) { for _, c := range cmd.Commands() { if !c.IsAvailableCommand() && c != cmd.helpCommand { continue } gen(buf, c) } commandName := cmd.CommandPath() commandName = strings.ReplaceAll(commandName, " ", "_") commandName = strings.ReplaceAll(commandName, ":", "__") if cmd.Root() == cmd { WriteStringAndCheck(buf, fmt.Sprintf("_%s_root_command()\n{\n", commandName)) } else { WriteStringAndCheck(buf, fmt.Sprintf("_%s()\n{\n", commandName)) } WriteStringAndCheck(buf, fmt.Sprintf(" last_command=%q\n", commandName)) WriteStringAndCheck(buf, "\n") WriteStringAndCheck(buf, " command_aliases=()\n") WriteStringAndCheck(buf, "\n") writeCommands(buf, cmd) writeFlags(buf, cmd) writeRequiredFlag(buf, cmd) writeRequiredNouns(buf, cmd) writeArgAliases(buf, cmd) WriteStringAndCheck(buf, "}\n\n") } // GenBashCompletion generates bash completion file and writes to the passed writer. func (c *Command) GenBashCompletion(w io.Writer) error { buf := new(bytes.Buffer) writePreamble(buf, c.Name()) if len(c.BashCompletionFunction) > 0 { buf.WriteString(c.BashCompletionFunction + "\n") } gen(buf, c) writePostscript(buf, c.Name()) _, err := buf.WriteTo(w) return err } func nonCompletableFlag(flag *pflag.Flag) bool { return flag.Hidden || len(flag.Deprecated) > 0 } // GenBashCompletionFile generates bash completion file. func (c *Command) GenBashCompletionFile(filename string) error { outFile, err := os.Create(filename) if err != nil { return err } defer outFile.Close() return c.GenBashCompletion(outFile) } ================================================ FILE: vendor/github.com/spf13/cobra/bash_completionsV2.go ================================================ // Copyright 2013-2023 The Cobra Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package cobra import ( "bytes" "fmt" "io" "os" ) func (c *Command) genBashCompletion(w io.Writer, includeDesc bool) error { buf := new(bytes.Buffer) genBashComp(buf, c.Name(), includeDesc) _, err := buf.WriteTo(w) return err } func genBashComp(buf io.StringWriter, name string, includeDesc bool) { compCmd := ShellCompRequestCmd if !includeDesc { compCmd = ShellCompNoDescRequestCmd } WriteStringAndCheck(buf, fmt.Sprintf(`# bash completion V2 for %-36[1]s -*- shell-script -*- __%[1]s_debug() { if [[ -n ${BASH_COMP_DEBUG_FILE-} ]]; then echo "$*" >> "${BASH_COMP_DEBUG_FILE}" fi } # Macs have bash3 for which the bash-completion package doesn't include # _init_completion. This is a minimal version of that function. __%[1]s_init_completion() { COMPREPLY=() _get_comp_words_by_ref "$@" cur prev words cword } # This function calls the %[1]s program to obtain the completion # results and the directive. It fills the 'out' and 'directive' vars. __%[1]s_get_completion_results() { local requestComp lastParam lastChar args # Prepare the command to request completions for the program. # Calling ${words[0]} instead of directly %[1]s allows handling aliases args=("${words[@]:1}") requestComp="${words[0]} %[2]s ${args[*]}" lastParam=${words[$((${#words[@]}-1))]} lastChar=${lastParam:$((${#lastParam}-1)):1} __%[1]s_debug "lastParam ${lastParam}, lastChar ${lastChar}" if [[ -z ${cur} && ${lastChar} != = ]]; then # If the last parameter is complete (there is a space following it) # We add an extra empty parameter so we can indicate this to the go method. __%[1]s_debug "Adding extra empty parameter" requestComp="${requestComp} ''" fi # When completing a flag with an = (e.g., %[1]s -n=) # bash focuses on the part after the =, so we need to remove # the flag part from $cur if [[ ${cur} == -*=* ]]; then cur="${cur#*=}" fi __%[1]s_debug "Calling ${requestComp}" # Use eval to handle any environment variables and such out=$(eval "${requestComp}" 2>/dev/null) # Extract the directive integer at the very end of the output following a colon (:) directive=${out##*:} # Remove the directive out=${out%%:*} if [[ ${directive} == "${out}" ]]; then # There is not directive specified directive=0 fi __%[1]s_debug "The completion directive is: ${directive}" __%[1]s_debug "The completions are: ${out}" } __%[1]s_process_completion_results() { local shellCompDirectiveError=%[3]d local shellCompDirectiveNoSpace=%[4]d local shellCompDirectiveNoFileComp=%[5]d local shellCompDirectiveFilterFileExt=%[6]d local shellCompDirectiveFilterDirs=%[7]d local shellCompDirectiveKeepOrder=%[8]d if (((directive & shellCompDirectiveError) != 0)); then # Error code. No completion. __%[1]s_debug "Received error from custom completion go code" return else if (((directive & shellCompDirectiveNoSpace) != 0)); then if [[ $(type -t compopt) == builtin ]]; then __%[1]s_debug "Activating no space" compopt -o nospace else __%[1]s_debug "No space directive not supported in this version of bash" fi fi if (((directive & shellCompDirectiveKeepOrder) != 0)); then if [[ $(type -t compopt) == builtin ]]; then # no sort isn't supported for bash less than < 4.4 if [[ ${BASH_VERSINFO[0]} -lt 4 || ( ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 4 ) ]]; then __%[1]s_debug "No sort directive not supported in this version of bash" else __%[1]s_debug "Activating keep order" compopt -o nosort fi else __%[1]s_debug "No sort directive not supported in this version of bash" fi fi if (((directive & shellCompDirectiveNoFileComp) != 0)); then if [[ $(type -t compopt) == builtin ]]; then __%[1]s_debug "Activating no file completion" compopt +o default else __%[1]s_debug "No file completion directive not supported in this version of bash" fi fi fi # Separate activeHelp from normal completions local completions=() local activeHelp=() __%[1]s_extract_activeHelp if (((directive & shellCompDirectiveFilterFileExt) != 0)); then # File extension filtering local fullFilter="" filter filteringCmd # Do not use quotes around the $completions variable or else newline # characters will be kept. for filter in ${completions[*]}; do fullFilter+="$filter|" done filteringCmd="_filedir $fullFilter" __%[1]s_debug "File filtering command: $filteringCmd" $filteringCmd elif (((directive & shellCompDirectiveFilterDirs) != 0)); then # File completion for directories only local subdir subdir=${completions[0]} if [[ -n $subdir ]]; then __%[1]s_debug "Listing directories in $subdir" pushd "$subdir" >/dev/null 2>&1 && _filedir -d && popd >/dev/null 2>&1 || return else __%[1]s_debug "Listing directories in ." _filedir -d fi else __%[1]s_handle_completion_types fi __%[1]s_handle_special_char "$cur" : __%[1]s_handle_special_char "$cur" = # Print the activeHelp statements before we finish __%[1]s_handle_activeHelp } __%[1]s_handle_activeHelp() { # Print the activeHelp statements if ((${#activeHelp[*]} != 0)); then if [ -z $COMP_TYPE ]; then # Bash v3 does not set the COMP_TYPE variable. printf "\n"; printf "%%s\n" "${activeHelp[@]}" printf "\n" __%[1]s_reprint_commandLine return fi # Only print ActiveHelp on the second TAB press if [ $COMP_TYPE -eq 63 ]; then printf "\n" printf "%%s\n" "${activeHelp[@]}" if ((${#COMPREPLY[*]} == 0)); then # When there are no completion choices from the program, file completion # may kick in if the program has not disabled it; in such a case, we want # to know if any files will match what the user typed, so that we know if # there will be completions presented, so that we know how to handle ActiveHelp. # To find out, we actually trigger the file completion ourselves; # the call to _filedir will fill COMPREPLY if files match. if (((directive & shellCompDirectiveNoFileComp) == 0)); then __%[1]s_debug "Listing files" _filedir fi fi if ((${#COMPREPLY[*]} != 0)); then # If there are completion choices to be shown, print a delimiter. # Re-printing the command-line will automatically be done # by the shell when it prints the completion choices. printf -- "--" else # When there are no completion choices at all, we need # to re-print the command-line since the shell will # not be doing it itself. __%[1]s_reprint_commandLine fi elif [ $COMP_TYPE -eq 37 ] || [ $COMP_TYPE -eq 42 ]; then # For completion type: menu-complete/menu-complete-backward and insert-completions # the completions are immediately inserted into the command-line, so we first # print the activeHelp message and reprint the command-line since the shell won't. printf "\n" printf "%%s\n" "${activeHelp[@]}" __%[1]s_reprint_commandLine fi fi } __%[1]s_reprint_commandLine() { # The prompt format is only available from bash 4.4. # We test if it is available before using it. if (x=${PS1@P}) 2> /dev/null; then printf "%%s" "${PS1@P}${COMP_LINE[@]}" else # Can't print the prompt. Just print the # text the user had typed, it is workable enough. printf "%%s" "${COMP_LINE[@]}" fi } # Separate activeHelp lines from real completions. # Fills the $activeHelp and $completions arrays. __%[1]s_extract_activeHelp() { local activeHelpMarker="%[9]s" local endIndex=${#activeHelpMarker} while IFS='' read -r comp; do [[ -z $comp ]] && continue if [[ ${comp:0:endIndex} == $activeHelpMarker ]]; then comp=${comp:endIndex} __%[1]s_debug "ActiveHelp found: $comp" if [[ -n $comp ]]; then activeHelp+=("$comp") fi else # Not an activeHelp line but a normal completion completions+=("$comp") fi done <<<"${out}" } __%[1]s_handle_completion_types() { __%[1]s_debug "__%[1]s_handle_completion_types: COMP_TYPE is $COMP_TYPE" case $COMP_TYPE in 37|42) # Type: menu-complete/menu-complete-backward and insert-completions # If the user requested inserting one completion at a time, or all # completions at once on the command-line we must remove the descriptions. # https://github.com/spf13/cobra/issues/1508 # If there are no completions, we don't need to do anything (( ${#completions[@]} == 0 )) && return 0 local tab=$'\t' # Strip any description and escape the completion to handled special characters IFS=$'\n' read -ra completions -d '' < <(printf "%%q\n" "${completions[@]%%%%$tab*}") # Only consider the completions that match IFS=$'\n' read -ra COMPREPLY -d '' < <(IFS=$'\n'; compgen -W "${completions[*]}" -- "${cur}") # compgen looses the escaping so we need to escape all completions again since they will # all be inserted on the command-line. IFS=$'\n' read -ra COMPREPLY -d '' < <(printf "%%q\n" "${COMPREPLY[@]}") ;; *) # Type: complete (normal completion) __%[1]s_handle_standard_completion_case ;; esac } __%[1]s_handle_standard_completion_case() { local tab=$'\t' # If there are no completions, we don't need to do anything (( ${#completions[@]} == 0 )) && return 0 # Short circuit to optimize if we don't have descriptions if [[ "${completions[*]}" != *$tab* ]]; then # First, escape the completions to handle special characters IFS=$'\n' read -ra completions -d '' < <(printf "%%q\n" "${completions[@]}") # Only consider the completions that match what the user typed IFS=$'\n' read -ra COMPREPLY -d '' < <(IFS=$'\n'; compgen -W "${completions[*]}" -- "${cur}") # compgen looses the escaping so, if there is only a single completion, we need to # escape it again because it will be inserted on the command-line. If there are multiple # completions, we don't want to escape them because they will be printed in a list # and we don't want to show escape characters in that list. if (( ${#COMPREPLY[@]} == 1 )); then COMPREPLY[0]=$(printf "%%q" "${COMPREPLY[0]}") fi return 0 fi local longest=0 local compline # Look for the longest completion so that we can format things nicely while IFS='' read -r compline; do [[ -z $compline ]] && continue # Before checking if the completion matches what the user typed, # we need to strip any description and escape the completion to handle special # characters because those escape characters are part of what the user typed. # Don't call "printf" in a sub-shell because it will be much slower # since we are in a loop. printf -v comp "%%q" "${compline%%%%$tab*}" &>/dev/null || comp=$(printf "%%q" "${compline%%%%$tab*}") # Only consider the completions that match [[ $comp == "$cur"* ]] || continue # The completions matches. Add it to the list of full completions including # its description. We don't escape the completion because it may get printed # in a list if there are more than one and we don't want show escape characters # in that list. COMPREPLY+=("$compline") # Strip any description before checking the length, and again, don't escape # the completion because this length is only used when printing the completions # in a list and we don't want show escape characters in that list. comp=${compline%%%%$tab*} if ((${#comp}>longest)); then longest=${#comp} fi done < <(printf "%%s\n" "${completions[@]}") # If there is a single completion left, remove the description text and escape any special characters if ((${#COMPREPLY[*]} == 1)); then __%[1]s_debug "COMPREPLY[0]: ${COMPREPLY[0]}" COMPREPLY[0]=$(printf "%%q" "${COMPREPLY[0]%%%%$tab*}") __%[1]s_debug "Removed description from single completion, which is now: ${COMPREPLY[0]}" else # Format the descriptions __%[1]s_format_comp_descriptions $longest fi } __%[1]s_handle_special_char() { local comp="$1" local char=$2 if [[ "$comp" == *${char}* && "$COMP_WORDBREAKS" == *${char}* ]]; then local word=${comp%%"${comp##*${char}}"} local idx=${#COMPREPLY[*]} while ((--idx >= 0)); do COMPREPLY[idx]=${COMPREPLY[idx]#"$word"} done fi } __%[1]s_format_comp_descriptions() { local tab=$'\t' local comp desc maxdesclength local longest=$1 local i ci for ci in ${!COMPREPLY[*]}; do comp=${COMPREPLY[ci]} # Properly format the description string which follows a tab character if there is one if [[ "$comp" == *$tab* ]]; then __%[1]s_debug "Original comp: $comp" desc=${comp#*$tab} comp=${comp%%%%$tab*} # $COLUMNS stores the current shell width. # Remove an extra 4 because we add 2 spaces and 2 parentheses. maxdesclength=$(( COLUMNS - longest - 4 )) # Make sure we can fit a description of at least 8 characters # if we are to align the descriptions. if ((maxdesclength > 8)); then # Add the proper number of spaces to align the descriptions for ((i = ${#comp} ; i < longest ; i++)); do comp+=" " done else # Don't pad the descriptions so we can fit more text after the completion maxdesclength=$(( COLUMNS - ${#comp} - 4 )) fi # If there is enough space for any description text, # truncate the descriptions that are too long for the shell width if ((maxdesclength > 0)); then if ((${#desc} > maxdesclength)); then desc=${desc:0:$(( maxdesclength - 1 ))} desc+="…" fi comp+=" ($desc)" fi COMPREPLY[ci]=$comp __%[1]s_debug "Final comp: $comp" fi done } __start_%[1]s() { local cur prev words cword split COMPREPLY=() # Call _init_completion from the bash-completion package # to prepare the arguments properly if declare -F _init_completion >/dev/null 2>&1; then _init_completion -n =: || return else __%[1]s_init_completion -n =: || return fi __%[1]s_debug __%[1]s_debug "========= starting completion logic ==========" __%[1]s_debug "cur is ${cur}, words[*] is ${words[*]}, #words[@] is ${#words[@]}, cword is $cword" # The user could have moved the cursor backwards on the command-line. # We need to trigger completion from the $cword location, so we need # to truncate the command-line ($words) up to the $cword location. words=("${words[@]:0:$cword+1}") __%[1]s_debug "Truncated words[*]: ${words[*]}," local out directive __%[1]s_get_completion_results __%[1]s_process_completion_results } if [[ $(type -t compopt) = "builtin" ]]; then complete -o default -F __start_%[1]s %[1]s else complete -o default -o nospace -F __start_%[1]s %[1]s fi # ex: ts=4 sw=4 et filetype=sh `, name, compCmd, ShellCompDirectiveError, ShellCompDirectiveNoSpace, ShellCompDirectiveNoFileComp, ShellCompDirectiveFilterFileExt, ShellCompDirectiveFilterDirs, ShellCompDirectiveKeepOrder, activeHelpMarker)) } // GenBashCompletionFileV2 generates Bash completion version 2. func (c *Command) GenBashCompletionFileV2(filename string, includeDesc bool) error { outFile, err := os.Create(filename) if err != nil { return err } defer outFile.Close() return c.GenBashCompletionV2(outFile, includeDesc) } // GenBashCompletionV2 generates Bash completion file version 2 // and writes it to the passed writer. func (c *Command) GenBashCompletionV2(w io.Writer, includeDesc bool) error { return c.genBashCompletion(w, includeDesc) } ================================================ FILE: vendor/github.com/spf13/cobra/cobra.go ================================================ // Copyright 2013-2023 The Cobra Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Commands similar to git, go tools and other modern CLI tools // inspired by go, go-Commander, gh and subcommand package cobra import ( "fmt" "io" "os" "reflect" "strconv" "strings" "text/template" "time" "unicode" ) var templateFuncs = template.FuncMap{ "trim": strings.TrimSpace, "trimRightSpace": trimRightSpace, "trimTrailingWhitespaces": trimRightSpace, "appendIfNotPresent": appendIfNotPresent, "rpad": rpad, "gt": Gt, "eq": Eq, } var initializers []func() var finalizers []func() const ( defaultPrefixMatching = false defaultCommandSorting = true defaultCaseInsensitive = false defaultTraverseRunHooks = false ) // EnablePrefixMatching allows setting automatic prefix matching. Automatic prefix matching can be a dangerous thing // to automatically enable in CLI tools. // Set this to true to enable it. var EnablePrefixMatching = defaultPrefixMatching // EnableCommandSorting controls sorting of the slice of commands, which is turned on by default. // To disable sorting, set it to false. var EnableCommandSorting = defaultCommandSorting // EnableCaseInsensitive allows case-insensitive commands names. (case sensitive by default) var EnableCaseInsensitive = defaultCaseInsensitive // EnableTraverseRunHooks executes persistent pre-run and post-run hooks from all parents. // By default this is disabled, which means only the first run hook to be found is executed. var EnableTraverseRunHooks = defaultTraverseRunHooks // MousetrapHelpText enables an information splash screen on Windows // if the CLI is started from explorer.exe. // To disable the mousetrap, just set this variable to blank string (""). // Works only on Microsoft Windows. var MousetrapHelpText = `This is a command line tool. You need to open cmd.exe and run it from there. ` // MousetrapDisplayDuration controls how long the MousetrapHelpText message is displayed on Windows // if the CLI is started from explorer.exe. Set to 0 to wait for the return key to be pressed. // To disable the mousetrap, just set MousetrapHelpText to blank string (""). // Works only on Microsoft Windows. var MousetrapDisplayDuration = 5 * time.Second // AddTemplateFunc adds a template function that's available to Usage and Help // template generation. func AddTemplateFunc(name string, tmplFunc interface{}) { templateFuncs[name] = tmplFunc } // AddTemplateFuncs adds multiple template functions that are available to Usage and // Help template generation. func AddTemplateFuncs(tmplFuncs template.FuncMap) { for k, v := range tmplFuncs { templateFuncs[k] = v } } // OnInitialize sets the passed functions to be run when each command's // Execute method is called. func OnInitialize(y ...func()) { initializers = append(initializers, y...) } // OnFinalize sets the passed functions to be run when each command's // Execute method is terminated. func OnFinalize(y ...func()) { finalizers = append(finalizers, y...) } // FIXME Gt is unused by cobra and should be removed in a version 2. It exists only for compatibility with users of cobra. // Gt takes two types and checks whether the first type is greater than the second. In case of types Arrays, Chans, // Maps and Slices, Gt will compare their lengths. Ints are compared directly while strings are first parsed as // ints and then compared. func Gt(a interface{}, b interface{}) bool { var left, right int64 av := reflect.ValueOf(a) switch av.Kind() { case reflect.Array, reflect.Chan, reflect.Map, reflect.Slice: left = int64(av.Len()) case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: left = av.Int() case reflect.String: left, _ = strconv.ParseInt(av.String(), 10, 64) } bv := reflect.ValueOf(b) switch bv.Kind() { case reflect.Array, reflect.Chan, reflect.Map, reflect.Slice: right = int64(bv.Len()) case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: right = bv.Int() case reflect.String: right, _ = strconv.ParseInt(bv.String(), 10, 64) } return left > right } // FIXME Eq is unused by cobra and should be removed in a version 2. It exists only for compatibility with users of cobra. // Eq takes two types and checks whether they are equal. Supported types are int and string. Unsupported types will panic. func Eq(a interface{}, b interface{}) bool { av := reflect.ValueOf(a) bv := reflect.ValueOf(b) switch av.Kind() { case reflect.Array, reflect.Chan, reflect.Map, reflect.Slice: panic("Eq called on unsupported type") case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: return av.Int() == bv.Int() case reflect.String: return av.String() == bv.String() } return false } func trimRightSpace(s string) string { return strings.TrimRightFunc(s, unicode.IsSpace) } // FIXME appendIfNotPresent is unused by cobra and should be removed in a version 2. It exists only for compatibility with users of cobra. // appendIfNotPresent will append stringToAppend to the end of s, but only if it's not yet present in s. func appendIfNotPresent(s, stringToAppend string) string { if strings.Contains(s, stringToAppend) { return s } return s + " " + stringToAppend } // rpad adds padding to the right of a string. func rpad(s string, padding int) string { formattedString := fmt.Sprintf("%%-%ds", padding) return fmt.Sprintf(formattedString, s) } func tmpl(text string) *tmplFunc { return &tmplFunc{ tmpl: text, fn: func(w io.Writer, data interface{}) error { t := template.New("top") t.Funcs(templateFuncs) template.Must(t.Parse(text)) return t.Execute(w, data) }, } } // ld compares two strings and returns the levenshtein distance between them. func ld(s, t string, ignoreCase bool) int { if ignoreCase { s = strings.ToLower(s) t = strings.ToLower(t) } d := make([][]int, len(s)+1) for i := range d { d[i] = make([]int, len(t)+1) d[i][0] = i } for j := range d[0] { d[0][j] = j } for j := 1; j <= len(t); j++ { for i := 1; i <= len(s); i++ { if s[i-1] == t[j-1] { d[i][j] = d[i-1][j-1] } else { min := d[i-1][j] if d[i][j-1] < min { min = d[i][j-1] } if d[i-1][j-1] < min { min = d[i-1][j-1] } d[i][j] = min + 1 } } } return d[len(s)][len(t)] } func stringInSlice(a string, list []string) bool { for _, b := range list { if b == a { return true } } return false } // CheckErr prints the msg with the prefix 'Error:' and exits with error code 1. If the msg is nil, it does nothing. func CheckErr(msg interface{}) { if msg != nil { fmt.Fprintln(os.Stderr, "Error:", msg) os.Exit(1) } } // WriteStringAndCheck writes a string into a buffer, and checks if the error is not nil. func WriteStringAndCheck(b io.StringWriter, s string) { _, err := b.WriteString(s) CheckErr(err) } ================================================ FILE: vendor/github.com/spf13/cobra/command.go ================================================ // Copyright 2013-2023 The Cobra Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Package cobra is a commander providing a simple interface to create powerful modern CLI interfaces. // In addition to providing an interface, Cobra simultaneously provides a controller to organize your application code. package cobra import ( "bytes" "context" "errors" "fmt" "io" "os" "path/filepath" "sort" "strings" flag "github.com/spf13/pflag" ) const ( FlagSetByCobraAnnotation = "cobra_annotation_flag_set_by_cobra" CommandDisplayNameAnnotation = "cobra_annotation_command_display_name" helpFlagName = "help" helpCommandName = "help" ) // FParseErrWhitelist configures Flag parse errors to be ignored type FParseErrWhitelist flag.ParseErrorsAllowlist // Group Structure to manage groups for commands type Group struct { ID string Title string } // Command is just that, a command for your application. // E.g. 'go run ...' - 'run' is the command. Cobra requires // you to define the usage and description as part of your command // definition to ensure usability. type Command struct { // Use is the one-line usage message. // Recommended syntax is as follows: // [ ] identifies an optional argument. Arguments that are not enclosed in brackets are required. // ... indicates that you can specify multiple values for the previous argument. // | indicates mutually exclusive information. You can use the argument to the left of the separator or the // argument to the right of the separator. You cannot use both arguments in a single use of the command. // { } delimits a set of mutually exclusive arguments when one of the arguments is required. If the arguments are // optional, they are enclosed in brackets ([ ]). // Example: add [-F file | -D dir]... [-f format] profile Use string // Aliases is an array of aliases that can be used instead of the first word in Use. Aliases []string // SuggestFor is an array of command names for which this command will be suggested - // similar to aliases but only suggests. SuggestFor []string // Short is the short description shown in the 'help' output. Short string // The group id under which this subcommand is grouped in the 'help' output of its parent. GroupID string // Long is the long message shown in the 'help ' output. Long string // Example is examples of how to use the command. Example string // ValidArgs is list of all valid non-flag arguments that are accepted in shell completions ValidArgs []Completion // ValidArgsFunction is an optional function that provides valid non-flag arguments for shell completion. // It is a dynamic version of using ValidArgs. // Only one of ValidArgs and ValidArgsFunction can be used for a command. ValidArgsFunction CompletionFunc // Expected arguments Args PositionalArgs // ArgAliases is List of aliases for ValidArgs. // These are not suggested to the user in the shell completion, // but accepted if entered manually. ArgAliases []string // BashCompletionFunction is custom bash functions used by the legacy bash autocompletion generator. // For portability with other shells, it is recommended to instead use ValidArgsFunction BashCompletionFunction string // Deprecated defines, if this command is deprecated and should print this string when used. Deprecated string // Annotations are key/value pairs that can be used by applications to identify or // group commands or set special options. Annotations map[string]string // Version defines the version for this command. If this value is non-empty and the command does not // define a "version" flag, a "version" boolean flag will be added to the command and, if specified, // will print content of the "Version" variable. A shorthand "v" flag will also be added if the // command does not define one. Version string // The *Run functions are executed in the following order: // * PersistentPreRun() // * PreRun() // * Run() // * PostRun() // * PersistentPostRun() // All functions get the same args, the arguments after the command name. // The *PreRun and *PostRun functions will only be executed if the Run function of the current // command has been declared. // // PersistentPreRun: children of this command will inherit and execute. PersistentPreRun func(cmd *Command, args []string) // PersistentPreRunE: PersistentPreRun but returns an error. PersistentPreRunE func(cmd *Command, args []string) error // PreRun: children of this command will not inherit. PreRun func(cmd *Command, args []string) // PreRunE: PreRun but returns an error. PreRunE func(cmd *Command, args []string) error // Run: Typically the actual work function. Most commands will only implement this. Run func(cmd *Command, args []string) // RunE: Run but returns an error. RunE func(cmd *Command, args []string) error // PostRun: run after the Run command. PostRun func(cmd *Command, args []string) // PostRunE: PostRun but returns an error. PostRunE func(cmd *Command, args []string) error // PersistentPostRun: children of this command will inherit and execute after PostRun. PersistentPostRun func(cmd *Command, args []string) // PersistentPostRunE: PersistentPostRun but returns an error. PersistentPostRunE func(cmd *Command, args []string) error // groups for subcommands commandgroups []*Group // args is actual args parsed from flags. args []string // flagErrorBuf contains all error messages from pflag. flagErrorBuf *bytes.Buffer // flags is full set of flags. flags *flag.FlagSet // pflags contains persistent flags. pflags *flag.FlagSet // lflags contains local flags. // This field does not represent internal state, it's used as a cache to optimise LocalFlags function call lflags *flag.FlagSet // iflags contains inherited flags. // This field does not represent internal state, it's used as a cache to optimise InheritedFlags function call iflags *flag.FlagSet // parentsPflags is all persistent flags of cmd's parents. parentsPflags *flag.FlagSet // globNormFunc is the global normalization function // that we can use on every pflag set and children commands globNormFunc func(f *flag.FlagSet, name string) flag.NormalizedName // usageFunc is usage func defined by user. usageFunc func(*Command) error // usageTemplate is usage template defined by user. usageTemplate *tmplFunc // flagErrorFunc is func defined by user and it's called when the parsing of // flags returns an error. flagErrorFunc func(*Command, error) error // helpTemplate is help template defined by user. helpTemplate *tmplFunc // helpFunc is help func defined by user. helpFunc func(*Command, []string) // helpCommand is command with usage 'help'. If it's not defined by user, // cobra uses default help command. helpCommand *Command // helpCommandGroupID is the group id for the helpCommand helpCommandGroupID string // completionCommandGroupID is the group id for the completion command completionCommandGroupID string // versionTemplate is the version template defined by user. versionTemplate *tmplFunc // errPrefix is the error message prefix defined by user. errPrefix string // inReader is a reader defined by the user that replaces stdin inReader io.Reader // outWriter is a writer defined by the user that replaces stdout outWriter io.Writer // errWriter is a writer defined by the user that replaces stderr errWriter io.Writer // FParseErrWhitelist flag parse errors to be ignored FParseErrWhitelist FParseErrWhitelist // CompletionOptions is a set of options to control the handling of shell completion CompletionOptions CompletionOptions // commandsAreSorted defines, if command slice are sorted or not. commandsAreSorted bool // commandCalledAs is the name or alias value used to call this command. commandCalledAs struct { name string called bool } ctx context.Context // commands is the list of commands supported by this program. commands []*Command // parent is a parent command for this command. parent *Command // Max lengths of commands' string lengths for use in padding. commandsMaxUseLen int commandsMaxCommandPathLen int commandsMaxNameLen int // TraverseChildren parses flags on all parents before executing child command. TraverseChildren bool // Hidden defines, if this command is hidden and should NOT show up in the list of available commands. Hidden bool // SilenceErrors is an option to quiet errors down stream. SilenceErrors bool // SilenceUsage is an option to silence usage when an error occurs. SilenceUsage bool // DisableFlagParsing disables the flag parsing. // If this is true all flags will be passed to the command as arguments. DisableFlagParsing bool // DisableAutoGenTag defines, if gen tag ("Auto generated by spf13/cobra...") // will be printed by generating docs for this command. DisableAutoGenTag bool // DisableFlagsInUseLine will disable the addition of [flags] to the usage // line of a command when printing help or generating docs DisableFlagsInUseLine bool // DisableSuggestions disables the suggestions based on Levenshtein distance // that go along with 'unknown command' messages. DisableSuggestions bool // SuggestionsMinimumDistance defines minimum levenshtein distance to display suggestions. // Must be > 0. SuggestionsMinimumDistance int } // Context returns underlying command context. If command was executed // with ExecuteContext or the context was set with SetContext, the // previously set context will be returned. Otherwise, nil is returned. // // Notice that a call to Execute and ExecuteC will replace a nil context of // a command with a context.Background, so a background context will be // returned by Context after one of these functions has been called. func (c *Command) Context() context.Context { return c.ctx } // SetContext sets context for the command. This context will be overwritten by // Command.ExecuteContext or Command.ExecuteContextC. func (c *Command) SetContext(ctx context.Context) { c.ctx = ctx } // SetArgs sets arguments for the command. It is set to os.Args[1:] by default, if desired, can be overridden // particularly useful when testing. func (c *Command) SetArgs(a []string) { c.args = a } // SetOutput sets the destination for usage and error messages. // If output is nil, os.Stderr is used. // // Deprecated: Use SetOut and/or SetErr instead func (c *Command) SetOutput(output io.Writer) { c.outWriter = output c.errWriter = output } // SetOut sets the destination for usage messages. // If newOut is nil, os.Stdout is used. func (c *Command) SetOut(newOut io.Writer) { c.outWriter = newOut } // SetErr sets the destination for error messages. // If newErr is nil, os.Stderr is used. func (c *Command) SetErr(newErr io.Writer) { c.errWriter = newErr } // SetIn sets the source for input data // If newIn is nil, os.Stdin is used. func (c *Command) SetIn(newIn io.Reader) { c.inReader = newIn } // SetUsageFunc sets usage function. Usage can be defined by application. func (c *Command) SetUsageFunc(f func(*Command) error) { c.usageFunc = f } // SetUsageTemplate sets usage template. Can be defined by Application. func (c *Command) SetUsageTemplate(s string) { if s == "" { c.usageTemplate = nil return } c.usageTemplate = tmpl(s) } // SetFlagErrorFunc sets a function to generate an error when flag parsing // fails. func (c *Command) SetFlagErrorFunc(f func(*Command, error) error) { c.flagErrorFunc = f } // SetHelpFunc sets help function. Can be defined by Application. func (c *Command) SetHelpFunc(f func(*Command, []string)) { c.helpFunc = f } // SetHelpCommand sets help command. func (c *Command) SetHelpCommand(cmd *Command) { c.helpCommand = cmd } // SetHelpCommandGroupID sets the group id of the help command. func (c *Command) SetHelpCommandGroupID(groupID string) { if c.helpCommand != nil { c.helpCommand.GroupID = groupID } // helpCommandGroupID is used if no helpCommand is defined by the user c.helpCommandGroupID = groupID } // SetCompletionCommandGroupID sets the group id of the completion command. func (c *Command) SetCompletionCommandGroupID(groupID string) { // completionCommandGroupID is used if no completion command is defined by the user c.Root().completionCommandGroupID = groupID } // SetHelpTemplate sets help template to be used. Application can use it to set custom template. func (c *Command) SetHelpTemplate(s string) { if s == "" { c.helpTemplate = nil return } c.helpTemplate = tmpl(s) } // SetVersionTemplate sets version template to be used. Application can use it to set custom template. func (c *Command) SetVersionTemplate(s string) { if s == "" { c.versionTemplate = nil return } c.versionTemplate = tmpl(s) } // SetErrPrefix sets error message prefix to be used. Application can use it to set custom prefix. func (c *Command) SetErrPrefix(s string) { c.errPrefix = s } // SetGlobalNormalizationFunc sets a normalization function to all flag sets and also to child commands. // The user should not have a cyclic dependency on commands. func (c *Command) SetGlobalNormalizationFunc(n func(f *flag.FlagSet, name string) flag.NormalizedName) { c.Flags().SetNormalizeFunc(n) c.PersistentFlags().SetNormalizeFunc(n) c.globNormFunc = n for _, command := range c.commands { command.SetGlobalNormalizationFunc(n) } } // OutOrStdout returns output to stdout. func (c *Command) OutOrStdout() io.Writer { return c.getOut(os.Stdout) } // OutOrStderr returns output to stderr func (c *Command) OutOrStderr() io.Writer { return c.getOut(os.Stderr) } // ErrOrStderr returns output to stderr func (c *Command) ErrOrStderr() io.Writer { return c.getErr(os.Stderr) } // InOrStdin returns input to stdin func (c *Command) InOrStdin() io.Reader { return c.getIn(os.Stdin) } func (c *Command) getOut(def io.Writer) io.Writer { if c.outWriter != nil { return c.outWriter } if c.HasParent() { return c.parent.getOut(def) } return def } func (c *Command) getErr(def io.Writer) io.Writer { if c.errWriter != nil { return c.errWriter } if c.HasParent() { return c.parent.getErr(def) } return def } func (c *Command) getIn(def io.Reader) io.Reader { if c.inReader != nil { return c.inReader } if c.HasParent() { return c.parent.getIn(def) } return def } // UsageFunc returns either the function set by SetUsageFunc for this command // or a parent, or it returns a default usage function. func (c *Command) UsageFunc() (f func(*Command) error) { if c.usageFunc != nil { return c.usageFunc } if c.HasParent() { return c.Parent().UsageFunc() } return func(c *Command) error { c.mergePersistentFlags() fn := c.getUsageTemplateFunc() err := fn(c.OutOrStderr(), c) if err != nil { c.PrintErrln(err) } return err } } // getUsageTemplateFunc returns the usage template function for the command // going up the command tree if necessary. func (c *Command) getUsageTemplateFunc() func(w io.Writer, data interface{}) error { if c.usageTemplate != nil { return c.usageTemplate.fn } if c.HasParent() { return c.parent.getUsageTemplateFunc() } return defaultUsageFunc } // Usage puts out the usage for the command. // Used when a user provides invalid input. // Can be defined by user by overriding UsageFunc. func (c *Command) Usage() error { return c.UsageFunc()(c) } // HelpFunc returns either the function set by SetHelpFunc for this command // or a parent, or it returns a function with default help behavior. func (c *Command) HelpFunc() func(*Command, []string) { if c.helpFunc != nil { return c.helpFunc } if c.HasParent() { return c.Parent().HelpFunc() } return func(c *Command, a []string) { c.mergePersistentFlags() fn := c.getHelpTemplateFunc() // The help should be sent to stdout // See https://github.com/spf13/cobra/issues/1002 err := fn(c.OutOrStdout(), c) if err != nil { c.PrintErrln(err) } } } // getHelpTemplateFunc returns the help template function for the command // going up the command tree if necessary. func (c *Command) getHelpTemplateFunc() func(w io.Writer, data interface{}) error { if c.helpTemplate != nil { return c.helpTemplate.fn } if c.HasParent() { return c.parent.getHelpTemplateFunc() } return defaultHelpFunc } // Help puts out the help for the command. // Used when a user calls help [command]. // Can be defined by user by overriding HelpFunc. func (c *Command) Help() error { c.HelpFunc()(c, []string{}) return nil } // UsageString returns usage string. func (c *Command) UsageString() string { // Storing normal writers tmpOutput := c.outWriter tmpErr := c.errWriter bb := new(bytes.Buffer) c.outWriter = bb c.errWriter = bb CheckErr(c.Usage()) // Setting things back to normal c.outWriter = tmpOutput c.errWriter = tmpErr return bb.String() } // FlagErrorFunc returns either the function set by SetFlagErrorFunc for this // command or a parent, or it returns a function which returns the original // error. func (c *Command) FlagErrorFunc() (f func(*Command, error) error) { if c.flagErrorFunc != nil { return c.flagErrorFunc } if c.HasParent() { return c.parent.FlagErrorFunc() } return func(c *Command, err error) error { return err } } const minUsagePadding = 25 // UsagePadding return padding for the usage. func (c *Command) UsagePadding() int { if c.parent == nil || minUsagePadding > c.parent.commandsMaxUseLen { return minUsagePadding } return c.parent.commandsMaxUseLen } const minCommandPathPadding = 11 // CommandPathPadding return padding for the command path. func (c *Command) CommandPathPadding() int { if c.parent == nil || minCommandPathPadding > c.parent.commandsMaxCommandPathLen { return minCommandPathPadding } return c.parent.commandsMaxCommandPathLen } const minNamePadding = 11 // NamePadding returns padding for the name. func (c *Command) NamePadding() int { if c.parent == nil || minNamePadding > c.parent.commandsMaxNameLen { return minNamePadding } return c.parent.commandsMaxNameLen } // UsageTemplate returns usage template for the command. // This function is kept for backwards-compatibility reasons. func (c *Command) UsageTemplate() string { if c.usageTemplate != nil { return c.usageTemplate.tmpl } if c.HasParent() { return c.parent.UsageTemplate() } return defaultUsageTemplate } // HelpTemplate return help template for the command. // This function is kept for backwards-compatibility reasons. func (c *Command) HelpTemplate() string { if c.helpTemplate != nil { return c.helpTemplate.tmpl } if c.HasParent() { return c.parent.HelpTemplate() } return defaultHelpTemplate } // VersionTemplate return version template for the command. // This function is kept for backwards-compatibility reasons. func (c *Command) VersionTemplate() string { if c.versionTemplate != nil { return c.versionTemplate.tmpl } if c.HasParent() { return c.parent.VersionTemplate() } return defaultVersionTemplate } // getVersionTemplateFunc returns the version template function for the command // going up the command tree if necessary. func (c *Command) getVersionTemplateFunc() func(w io.Writer, data interface{}) error { if c.versionTemplate != nil { return c.versionTemplate.fn } if c.HasParent() { return c.parent.getVersionTemplateFunc() } return defaultVersionFunc } // ErrPrefix return error message prefix for the command func (c *Command) ErrPrefix() string { if c.errPrefix != "" { return c.errPrefix } if c.HasParent() { return c.parent.ErrPrefix() } return "Error:" } func hasNoOptDefVal(name string, fs *flag.FlagSet) bool { flag := fs.Lookup(name) if flag == nil { return false } return flag.NoOptDefVal != "" } func shortHasNoOptDefVal(name string, fs *flag.FlagSet) bool { if len(name) == 0 { return false } flag := fs.ShorthandLookup(name[:1]) if flag == nil { return false } return flag.NoOptDefVal != "" } func stripFlags(args []string, c *Command) []string { if len(args) == 0 { return args } c.mergePersistentFlags() commands := []string{} flags := c.Flags() Loop: for len(args) > 0 { s := args[0] args = args[1:] switch { case s == "--": // "--" terminates the flags break Loop case strings.HasPrefix(s, "--") && !strings.Contains(s, "=") && !hasNoOptDefVal(s[2:], flags): // If '--flag arg' then // delete arg from args. fallthrough // (do the same as below) case strings.HasPrefix(s, "-") && !strings.Contains(s, "=") && len(s) == 2 && !shortHasNoOptDefVal(s[1:], flags): // If '-f arg' then // delete 'arg' from args or break the loop if len(args) <= 1. if len(args) <= 1 { break Loop } else { args = args[1:] continue } case s != "" && !strings.HasPrefix(s, "-"): commands = append(commands, s) } } return commands } // argsMinusFirstX removes only the first x from args. Otherwise, commands that look like // openshift admin policy add-role-to-user admin my-user, lose the admin argument (arg[4]). // Special care needs to be taken not to remove a flag value. func (c *Command) argsMinusFirstX(args []string, x string) []string { if len(args) == 0 { return args } c.mergePersistentFlags() flags := c.Flags() Loop: for pos := 0; pos < len(args); pos++ { s := args[pos] switch { case s == "--": // -- means we have reached the end of the parseable args. Break out of the loop now. break Loop case strings.HasPrefix(s, "--") && !strings.Contains(s, "=") && !hasNoOptDefVal(s[2:], flags): fallthrough case strings.HasPrefix(s, "-") && !strings.Contains(s, "=") && len(s) == 2 && !shortHasNoOptDefVal(s[1:], flags): // This is a flag without a default value, and an equal sign is not used. Increment pos in order to skip // over the next arg, because that is the value of this flag. pos++ continue case !strings.HasPrefix(s, "-"): // This is not a flag or a flag value. Check to see if it matches what we're looking for, and if so, // return the args, excluding the one at this position. if s == x { ret := make([]string, 0, len(args)-1) ret = append(ret, args[:pos]...) ret = append(ret, args[pos+1:]...) return ret } } } return args } func isFlagArg(arg string) bool { return ((len(arg) >= 3 && arg[0:2] == "--") || (len(arg) >= 2 && arg[0] == '-' && arg[1] != '-')) } // Find the target command given the args and command tree // Meant to be run on the highest node. Only searches down. func (c *Command) Find(args []string) (*Command, []string, error) { var innerfind func(*Command, []string) (*Command, []string) innerfind = func(c *Command, innerArgs []string) (*Command, []string) { argsWOflags := stripFlags(innerArgs, c) if len(argsWOflags) == 0 { return c, innerArgs } nextSubCmd := argsWOflags[0] cmd := c.findNext(nextSubCmd) if cmd != nil { return innerfind(cmd, c.argsMinusFirstX(innerArgs, nextSubCmd)) } return c, innerArgs } commandFound, a := innerfind(c, args) if commandFound.Args == nil { return commandFound, a, legacyArgs(commandFound, stripFlags(a, commandFound)) } return commandFound, a, nil } func (c *Command) findSuggestions(arg string) string { if c.DisableSuggestions { return "" } if c.SuggestionsMinimumDistance <= 0 { c.SuggestionsMinimumDistance = 2 } var sb strings.Builder if suggestions := c.SuggestionsFor(arg); len(suggestions) > 0 { sb.WriteString("\n\nDid you mean this?\n") for _, s := range suggestions { _, _ = fmt.Fprintf(&sb, "\t%v\n", s) } } return sb.String() } func (c *Command) findNext(next string) *Command { matches := make([]*Command, 0) for _, cmd := range c.commands { if commandNameMatches(cmd.Name(), next) || cmd.HasAlias(next) { cmd.commandCalledAs.name = next return cmd } if EnablePrefixMatching && cmd.hasNameOrAliasPrefix(next) { matches = append(matches, cmd) } } if len(matches) == 1 { // Temporarily disable gosec G602, which produces a false positive. // See https://github.com/securego/gosec/issues/1005. return matches[0] // #nosec G602 } return nil } // Traverse the command tree to find the command, and parse args for // each parent. func (c *Command) Traverse(args []string) (*Command, []string, error) { flags := []string{} inFlag := false for i, arg := range args { switch { // A long flag with a space separated value case strings.HasPrefix(arg, "--") && !strings.Contains(arg, "="): // TODO: this isn't quite right, we should really check ahead for 'true' or 'false' inFlag = !hasNoOptDefVal(arg[2:], c.Flags()) flags = append(flags, arg) continue // A short flag with a space separated value case strings.HasPrefix(arg, "-") && !strings.Contains(arg, "=") && len(arg) == 2 && !shortHasNoOptDefVal(arg[1:], c.Flags()): inFlag = true flags = append(flags, arg) continue // The value for a flag case inFlag: inFlag = false flags = append(flags, arg) continue // A flag without a value, or with an `=` separated value case isFlagArg(arg): flags = append(flags, arg) continue } cmd := c.findNext(arg) if cmd == nil { return c, args, nil } if err := c.ParseFlags(flags); err != nil { return nil, args, err } return cmd.Traverse(args[i+1:]) } return c, args, nil } // SuggestionsFor provides suggestions for the typedName. func (c *Command) SuggestionsFor(typedName string) []string { suggestions := []string{} for _, cmd := range c.commands { if cmd.IsAvailableCommand() { levenshteinDistance := ld(typedName, cmd.Name(), true) suggestByLevenshtein := levenshteinDistance <= c.SuggestionsMinimumDistance suggestByPrefix := strings.HasPrefix(strings.ToLower(cmd.Name()), strings.ToLower(typedName)) if suggestByLevenshtein || suggestByPrefix { suggestions = append(suggestions, cmd.Name()) } for _, explicitSuggestion := range cmd.SuggestFor { if strings.EqualFold(typedName, explicitSuggestion) { suggestions = append(suggestions, cmd.Name()) } } } } return suggestions } // VisitParents visits all parents of the command and invokes fn on each parent. func (c *Command) VisitParents(fn func(*Command)) { if c.HasParent() { fn(c.Parent()) c.Parent().VisitParents(fn) } } // Root finds root command. func (c *Command) Root() *Command { if c.HasParent() { return c.Parent().Root() } return c } // ArgsLenAtDash will return the length of c.Flags().Args at the moment // when a -- was found during args parsing. func (c *Command) ArgsLenAtDash() int { return c.Flags().ArgsLenAtDash() } func (c *Command) execute(a []string) (err error) { if c == nil { return fmt.Errorf("called Execute() on a nil Command") } if len(c.Deprecated) > 0 { c.Printf("Command %q is deprecated, %s\n", c.Name(), c.Deprecated) } // initialize help and version flag at the last point possible to allow for user // overriding c.InitDefaultHelpFlag() c.InitDefaultVersionFlag() err = c.ParseFlags(a) if err != nil { return c.FlagErrorFunc()(c, err) } // If help is called, regardless of other flags, return we want help. // Also say we need help if the command isn't runnable. helpVal, err := c.Flags().GetBool(helpFlagName) if err != nil { // should be impossible to get here as we always declare a help // flag in InitDefaultHelpFlag() c.Println("\"help\" flag declared as non-bool. Please correct your code") return err } if helpVal { return flag.ErrHelp } // for back-compat, only add version flag behavior if version is defined if c.Version != "" { versionVal, err := c.Flags().GetBool("version") if err != nil { c.Println("\"version\" flag declared as non-bool. Please correct your code") return err } if versionVal { fn := c.getVersionTemplateFunc() err := fn(c.OutOrStdout(), c) if err != nil { c.Println(err) } return err } } if !c.Runnable() { return flag.ErrHelp } c.preRun() defer c.postRun() argWoFlags := c.Flags().Args() if c.DisableFlagParsing { argWoFlags = a } if err := c.ValidateArgs(argWoFlags); err != nil { return err } parents := make([]*Command, 0, 5) for p := c; p != nil; p = p.Parent() { if EnableTraverseRunHooks { // When EnableTraverseRunHooks is set: // - Execute all persistent pre-runs from the root parent till this command. // - Execute all persistent post-runs from this command till the root parent. parents = append([]*Command{p}, parents...) } else { // Otherwise, execute only the first found persistent hook. parents = append(parents, p) } } for _, p := range parents { if p.PersistentPreRunE != nil { if err := p.PersistentPreRunE(c, argWoFlags); err != nil { return err } if !EnableTraverseRunHooks { break } } else if p.PersistentPreRun != nil { p.PersistentPreRun(c, argWoFlags) if !EnableTraverseRunHooks { break } } } if c.PreRunE != nil { if err := c.PreRunE(c, argWoFlags); err != nil { return err } } else if c.PreRun != nil { c.PreRun(c, argWoFlags) } if err := c.ValidateRequiredFlags(); err != nil { return err } if err := c.ValidateFlagGroups(); err != nil { return err } if c.RunE != nil { if err := c.RunE(c, argWoFlags); err != nil { return err } } else { c.Run(c, argWoFlags) } if c.PostRunE != nil { if err := c.PostRunE(c, argWoFlags); err != nil { return err } } else if c.PostRun != nil { c.PostRun(c, argWoFlags) } for p := c; p != nil; p = p.Parent() { if p.PersistentPostRunE != nil { if err := p.PersistentPostRunE(c, argWoFlags); err != nil { return err } if !EnableTraverseRunHooks { break } } else if p.PersistentPostRun != nil { p.PersistentPostRun(c, argWoFlags) if !EnableTraverseRunHooks { break } } } return nil } func (c *Command) preRun() { for _, x := range initializers { x() } } func (c *Command) postRun() { for _, x := range finalizers { x() } } // ExecuteContext is the same as Execute(), but sets the ctx on the command. // Retrieve ctx by calling cmd.Context() inside your *Run lifecycle or ValidArgs // functions. func (c *Command) ExecuteContext(ctx context.Context) error { c.ctx = ctx return c.Execute() } // Execute uses the args (os.Args[1:] by default) // and run through the command tree finding appropriate matches // for commands and then corresponding flags. func (c *Command) Execute() error { _, err := c.ExecuteC() return err } // ExecuteContextC is the same as ExecuteC(), but sets the ctx on the command. // Retrieve ctx by calling cmd.Context() inside your *Run lifecycle or ValidArgs // functions. func (c *Command) ExecuteContextC(ctx context.Context) (*Command, error) { c.ctx = ctx return c.ExecuteC() } // ExecuteC executes the command. func (c *Command) ExecuteC() (cmd *Command, err error) { if c.ctx == nil { c.ctx = context.Background() } // Regardless of what command execute is called on, run on Root only if c.HasParent() { return c.Root().ExecuteC() } // windows hook if preExecHookFn != nil { preExecHookFn(c) } // initialize help at the last point to allow for user overriding c.InitDefaultHelpCmd() args := c.args // Workaround FAIL with "go test -v" or "cobra.test -test.v", see #155 if c.args == nil && filepath.Base(os.Args[0]) != "cobra.test" { args = os.Args[1:] } // initialize the __complete command to be used for shell completion c.initCompleteCmd(args) // initialize the default completion command c.InitDefaultCompletionCmd(args...) // Now that all commands have been created, let's make sure all groups // are properly created also c.checkCommandGroups() var flags []string if c.TraverseChildren { cmd, flags, err = c.Traverse(args) } else { cmd, flags, err = c.Find(args) } if err != nil { // If found parse to a subcommand and then failed, talk about the subcommand if cmd != nil { c = cmd } if !c.SilenceErrors { c.PrintErrln(c.ErrPrefix(), err.Error()) c.PrintErrf("Run '%v --help' for usage.\n", c.CommandPath()) } return c, err } cmd.commandCalledAs.called = true if cmd.commandCalledAs.name == "" { cmd.commandCalledAs.name = cmd.Name() } // We have to pass global context to children command // if context is present on the parent command. if cmd.ctx == nil { cmd.ctx = c.ctx } err = cmd.execute(flags) if err != nil { // Always show help if requested, even if SilenceErrors is in // effect if errors.Is(err, flag.ErrHelp) { cmd.HelpFunc()(cmd, args) return cmd, nil } // If root command has SilenceErrors flagged, // all subcommands should respect it if !cmd.SilenceErrors && !c.SilenceErrors { c.PrintErrln(cmd.ErrPrefix(), err.Error()) } // If root command has SilenceUsage flagged, // all subcommands should respect it if !cmd.SilenceUsage && !c.SilenceUsage { c.Println(cmd.UsageString()) } } return cmd, err } func (c *Command) ValidateArgs(args []string) error { if c.Args == nil { return ArbitraryArgs(c, args) } return c.Args(c, args) } // ValidateRequiredFlags validates all required flags are present and returns an error otherwise func (c *Command) ValidateRequiredFlags() error { if c.DisableFlagParsing { return nil } flags := c.Flags() missingFlagNames := []string{} flags.VisitAll(func(pflag *flag.Flag) { requiredAnnotation, found := pflag.Annotations[BashCompOneRequiredFlag] if !found { return } if (requiredAnnotation[0] == "true") && !pflag.Changed { missingFlagNames = append(missingFlagNames, pflag.Name) } }) if len(missingFlagNames) > 0 { return fmt.Errorf(`required flag(s) "%s" not set`, strings.Join(missingFlagNames, `", "`)) } return nil } // checkCommandGroups checks if a command has been added to a group that does not exists. // If so, we panic because it indicates a coding error that should be corrected. func (c *Command) checkCommandGroups() { for _, sub := range c.commands { // if Group is not defined let the developer know right away if sub.GroupID != "" && !c.ContainsGroup(sub.GroupID) { panic(fmt.Sprintf("group id '%s' is not defined for subcommand '%s'", sub.GroupID, sub.CommandPath())) } sub.checkCommandGroups() } } // InitDefaultHelpFlag adds default help flag to c. // It is called automatically by executing the c or by calling help and usage. // If c already has help flag, it will do nothing. func (c *Command) InitDefaultHelpFlag() { c.mergePersistentFlags() if c.Flags().Lookup(helpFlagName) == nil { usage := "help for " name := c.DisplayName() if name == "" { usage += "this command" } else { usage += name } c.Flags().BoolP(helpFlagName, "h", false, usage) _ = c.Flags().SetAnnotation(helpFlagName, FlagSetByCobraAnnotation, []string{"true"}) } } // InitDefaultVersionFlag adds default version flag to c. // It is called automatically by executing the c. // If c already has a version flag, it will do nothing. // If c.Version is empty, it will do nothing. func (c *Command) InitDefaultVersionFlag() { if c.Version == "" { return } c.mergePersistentFlags() if c.Flags().Lookup("version") == nil { usage := "version for " if c.Name() == "" { usage += "this command" } else { usage += c.DisplayName() } if c.Flags().ShorthandLookup("v") == nil { c.Flags().BoolP("version", "v", false, usage) } else { c.Flags().Bool("version", false, usage) } _ = c.Flags().SetAnnotation("version", FlagSetByCobraAnnotation, []string{"true"}) } } // InitDefaultHelpCmd adds default help command to c. // It is called automatically by executing the c or by calling help and usage. // If c already has help command or c has no subcommands, it will do nothing. func (c *Command) InitDefaultHelpCmd() { if !c.HasSubCommands() { return } if c.helpCommand == nil { c.helpCommand = &Command{ Use: "help [command]", Short: "Help about any command", Long: `Help provides help for any command in the application. Simply type ` + c.DisplayName() + ` help [path to command] for full details.`, ValidArgsFunction: func(c *Command, args []string, toComplete string) ([]Completion, ShellCompDirective) { var completions []Completion cmd, _, e := c.Root().Find(args) if e != nil { return nil, ShellCompDirectiveNoFileComp } if cmd == nil { // Root help command. cmd = c.Root() } for _, subCmd := range cmd.Commands() { if subCmd.IsAvailableCommand() || subCmd == cmd.helpCommand { if strings.HasPrefix(subCmd.Name(), toComplete) { completions = append(completions, CompletionWithDesc(subCmd.Name(), subCmd.Short)) } } } return completions, ShellCompDirectiveNoFileComp }, Run: func(c *Command, args []string) { cmd, _, e := c.Root().Find(args) if cmd == nil || e != nil { c.Printf("Unknown help topic %#q\n", args) CheckErr(c.Root().Usage()) } else { // FLow the context down to be used in help text if cmd.ctx == nil { cmd.ctx = c.ctx } cmd.InitDefaultHelpFlag() // make possible 'help' flag to be shown cmd.InitDefaultVersionFlag() // make possible 'version' flag to be shown CheckErr(cmd.Help()) } }, GroupID: c.helpCommandGroupID, } } c.RemoveCommand(c.helpCommand) c.AddCommand(c.helpCommand) } // ResetCommands delete parent, subcommand and help command from c. func (c *Command) ResetCommands() { c.parent = nil c.commands = nil c.helpCommand = nil c.parentsPflags = nil } // Sorts commands by their names. type commandSorterByName []*Command func (c commandSorterByName) Len() int { return len(c) } func (c commandSorterByName) Swap(i, j int) { c[i], c[j] = c[j], c[i] } func (c commandSorterByName) Less(i, j int) bool { return c[i].Name() < c[j].Name() } // Commands returns a sorted slice of child commands. func (c *Command) Commands() []*Command { // do not sort commands if it already sorted or sorting was disabled if EnableCommandSorting && !c.commandsAreSorted { sort.Sort(commandSorterByName(c.commands)) c.commandsAreSorted = true } return c.commands } // AddCommand adds one or more commands to this parent command. func (c *Command) AddCommand(cmds ...*Command) { for i, x := range cmds { if cmds[i] == c { panic("Command can't be a child of itself") } cmds[i].parent = c // update max lengths usageLen := len(x.Use) if usageLen > c.commandsMaxUseLen { c.commandsMaxUseLen = usageLen } commandPathLen := len(x.CommandPath()) if commandPathLen > c.commandsMaxCommandPathLen { c.commandsMaxCommandPathLen = commandPathLen } nameLen := len(x.Name()) if nameLen > c.commandsMaxNameLen { c.commandsMaxNameLen = nameLen } // If global normalization function exists, update all children if c.globNormFunc != nil { x.SetGlobalNormalizationFunc(c.globNormFunc) } c.commands = append(c.commands, x) c.commandsAreSorted = false } } // Groups returns a slice of child command groups. func (c *Command) Groups() []*Group { return c.commandgroups } // AllChildCommandsHaveGroup returns if all subcommands are assigned to a group func (c *Command) AllChildCommandsHaveGroup() bool { for _, sub := range c.commands { if (sub.IsAvailableCommand() || sub == c.helpCommand) && sub.GroupID == "" { return false } } return true } // ContainsGroup return if groupID exists in the list of command groups. func (c *Command) ContainsGroup(groupID string) bool { for _, x := range c.commandgroups { if x.ID == groupID { return true } } return false } // AddGroup adds one or more command groups to this parent command. func (c *Command) AddGroup(groups ...*Group) { c.commandgroups = append(c.commandgroups, groups...) } // RemoveCommand removes one or more commands from a parent command. func (c *Command) RemoveCommand(cmds ...*Command) { commands := []*Command{} main: for _, command := range c.commands { for _, cmd := range cmds { if command == cmd { command.parent = nil continue main } } commands = append(commands, command) } c.commands = commands // recompute all lengths c.commandsMaxUseLen = 0 c.commandsMaxCommandPathLen = 0 c.commandsMaxNameLen = 0 for _, command := range c.commands { usageLen := len(command.Use) if usageLen > c.commandsMaxUseLen { c.commandsMaxUseLen = usageLen } commandPathLen := len(command.CommandPath()) if commandPathLen > c.commandsMaxCommandPathLen { c.commandsMaxCommandPathLen = commandPathLen } nameLen := len(command.Name()) if nameLen > c.commandsMaxNameLen { c.commandsMaxNameLen = nameLen } } } // Print is a convenience method to Print to the defined output, fallback to Stderr if not set. func (c *Command) Print(i ...interface{}) { fmt.Fprint(c.OutOrStderr(), i...) } // Println is a convenience method to Println to the defined output, fallback to Stderr if not set. func (c *Command) Println(i ...interface{}) { c.Print(fmt.Sprintln(i...)) } // Printf is a convenience method to Printf to the defined output, fallback to Stderr if not set. func (c *Command) Printf(format string, i ...interface{}) { c.Print(fmt.Sprintf(format, i...)) } // PrintErr is a convenience method to Print to the defined Err output, fallback to Stderr if not set. func (c *Command) PrintErr(i ...interface{}) { fmt.Fprint(c.ErrOrStderr(), i...) } // PrintErrln is a convenience method to Println to the defined Err output, fallback to Stderr if not set. func (c *Command) PrintErrln(i ...interface{}) { c.PrintErr(fmt.Sprintln(i...)) } // PrintErrf is a convenience method to Printf to the defined Err output, fallback to Stderr if not set. func (c *Command) PrintErrf(format string, i ...interface{}) { c.PrintErr(fmt.Sprintf(format, i...)) } // CommandPath returns the full path to this command. func (c *Command) CommandPath() string { if c.HasParent() { return c.Parent().CommandPath() + " " + c.Name() } return c.DisplayName() } // DisplayName returns the name to display in help text. Returns command Name() // If CommandDisplayNameAnnoation is not set func (c *Command) DisplayName() string { if displayName, ok := c.Annotations[CommandDisplayNameAnnotation]; ok { return displayName } return c.Name() } // UseLine puts out the full usage for a given command (including parents). func (c *Command) UseLine() string { var useline string use := strings.Replace(c.Use, c.Name(), c.DisplayName(), 1) if c.HasParent() { useline = c.parent.CommandPath() + " " + use } else { useline = use } if c.DisableFlagsInUseLine { return useline } if c.HasAvailableFlags() && !strings.Contains(useline, "[flags]") { useline += " [flags]" } return useline } // DebugFlags used to determine which flags have been assigned to which commands // and which persist. func (c *Command) DebugFlags() { c.Println("DebugFlags called on", c.Name()) var debugflags func(*Command) debugflags = func(x *Command) { if x.HasFlags() || x.HasPersistentFlags() { c.Println(x.Name()) } if x.HasFlags() { x.flags.VisitAll(func(f *flag.Flag) { if x.HasPersistentFlags() && x.persistentFlag(f.Name) != nil { c.Println(" -"+f.Shorthand+",", "--"+f.Name, "["+f.DefValue+"]", "", f.Value, " [LP]") } else { c.Println(" -"+f.Shorthand+",", "--"+f.Name, "["+f.DefValue+"]", "", f.Value, " [L]") } }) } if x.HasPersistentFlags() { x.pflags.VisitAll(func(f *flag.Flag) { if x.HasFlags() { if x.flags.Lookup(f.Name) == nil { c.Println(" -"+f.Shorthand+",", "--"+f.Name, "["+f.DefValue+"]", "", f.Value, " [P]") } } else { c.Println(" -"+f.Shorthand+",", "--"+f.Name, "["+f.DefValue+"]", "", f.Value, " [P]") } }) } c.Println(x.flagErrorBuf) if x.HasSubCommands() { for _, y := range x.commands { debugflags(y) } } } debugflags(c) } // Name returns the command's name: the first word in the use line. func (c *Command) Name() string { name := c.Use i := strings.Index(name, " ") if i >= 0 { name = name[:i] } return name } // HasAlias determines if a given string is an alias of the command. func (c *Command) HasAlias(s string) bool { for _, a := range c.Aliases { if commandNameMatches(a, s) { return true } } return false } // CalledAs returns the command name or alias that was used to invoke // this command or an empty string if the command has not been called. func (c *Command) CalledAs() string { if c.commandCalledAs.called { return c.commandCalledAs.name } return "" } // hasNameOrAliasPrefix returns true if the Name or any of aliases start // with prefix func (c *Command) hasNameOrAliasPrefix(prefix string) bool { if strings.HasPrefix(c.Name(), prefix) { c.commandCalledAs.name = c.Name() return true } for _, alias := range c.Aliases { if strings.HasPrefix(alias, prefix) { c.commandCalledAs.name = alias return true } } return false } // NameAndAliases returns a list of the command name and all aliases func (c *Command) NameAndAliases() string { return strings.Join(append([]string{c.Name()}, c.Aliases...), ", ") } // HasExample determines if the command has example. func (c *Command) HasExample() bool { return len(c.Example) > 0 } // Runnable determines if the command is itself runnable. func (c *Command) Runnable() bool { return c.Run != nil || c.RunE != nil } // HasSubCommands determines if the command has children commands. func (c *Command) HasSubCommands() bool { return len(c.commands) > 0 } // IsAvailableCommand determines if a command is available as a non-help command // (this includes all non deprecated/hidden commands). func (c *Command) IsAvailableCommand() bool { if len(c.Deprecated) != 0 || c.Hidden { return false } if c.HasParent() && c.Parent().helpCommand == c { return false } if c.Runnable() || c.HasAvailableSubCommands() { return true } return false } // IsAdditionalHelpTopicCommand determines if a command is an additional // help topic command; additional help topic command is determined by the // fact that it is NOT runnable/hidden/deprecated, and has no sub commands that // are runnable/hidden/deprecated. // Concrete example: https://github.com/spf13/cobra/issues/393#issuecomment-282741924. func (c *Command) IsAdditionalHelpTopicCommand() bool { // if a command is runnable, deprecated, or hidden it is not a 'help' command if c.Runnable() || len(c.Deprecated) != 0 || c.Hidden { return false } // if any non-help sub commands are found, the command is not a 'help' command for _, sub := range c.commands { if !sub.IsAdditionalHelpTopicCommand() { return false } } // the command either has no sub commands, or no non-help sub commands return true } // HasHelpSubCommands determines if a command has any available 'help' sub commands // that need to be shown in the usage/help default template under 'additional help // topics'. func (c *Command) HasHelpSubCommands() bool { // return true on the first found available 'help' sub command for _, sub := range c.commands { if sub.IsAdditionalHelpTopicCommand() { return true } } // the command either has no sub commands, or no available 'help' sub commands return false } // HasAvailableSubCommands determines if a command has available sub commands that // need to be shown in the usage/help default template under 'available commands'. func (c *Command) HasAvailableSubCommands() bool { // return true on the first found available (non deprecated/help/hidden) // sub command for _, sub := range c.commands { if sub.IsAvailableCommand() { return true } } // the command either has no sub commands, or no available (non deprecated/help/hidden) // sub commands return false } // HasParent determines if the command is a child command. func (c *Command) HasParent() bool { return c.parent != nil } // GlobalNormalizationFunc returns the global normalization function or nil if it doesn't exist. func (c *Command) GlobalNormalizationFunc() func(f *flag.FlagSet, name string) flag.NormalizedName { return c.globNormFunc } // Flags returns the complete FlagSet that applies // to this command (local and persistent declared here and by all parents). func (c *Command) Flags() *flag.FlagSet { if c.flags == nil { c.flags = flag.NewFlagSet(c.DisplayName(), flag.ContinueOnError) if c.flagErrorBuf == nil { c.flagErrorBuf = new(bytes.Buffer) } c.flags.SetOutput(c.flagErrorBuf) } return c.flags } // LocalNonPersistentFlags are flags specific to this command which will NOT persist to subcommands. // This function does not modify the flags of the current command, it's purpose is to return the current state. func (c *Command) LocalNonPersistentFlags() *flag.FlagSet { persistentFlags := c.PersistentFlags() out := flag.NewFlagSet(c.DisplayName(), flag.ContinueOnError) c.LocalFlags().VisitAll(func(f *flag.Flag) { if persistentFlags.Lookup(f.Name) == nil { out.AddFlag(f) } }) return out } // LocalFlags returns the local FlagSet specifically set in the current command. // This function does not modify the flags of the current command, it's purpose is to return the current state. func (c *Command) LocalFlags() *flag.FlagSet { c.mergePersistentFlags() if c.lflags == nil { c.lflags = flag.NewFlagSet(c.DisplayName(), flag.ContinueOnError) if c.flagErrorBuf == nil { c.flagErrorBuf = new(bytes.Buffer) } c.lflags.SetOutput(c.flagErrorBuf) } c.lflags.SortFlags = c.Flags().SortFlags if c.globNormFunc != nil { c.lflags.SetNormalizeFunc(c.globNormFunc) } addToLocal := func(f *flag.Flag) { // Add the flag if it is not a parent PFlag, or it shadows a parent PFlag if c.lflags.Lookup(f.Name) == nil && f != c.parentsPflags.Lookup(f.Name) { c.lflags.AddFlag(f) } } c.Flags().VisitAll(addToLocal) c.PersistentFlags().VisitAll(addToLocal) return c.lflags } // InheritedFlags returns all flags which were inherited from parent commands. // This function does not modify the flags of the current command, it's purpose is to return the current state. func (c *Command) InheritedFlags() *flag.FlagSet { c.mergePersistentFlags() if c.iflags == nil { c.iflags = flag.NewFlagSet(c.DisplayName(), flag.ContinueOnError) if c.flagErrorBuf == nil { c.flagErrorBuf = new(bytes.Buffer) } c.iflags.SetOutput(c.flagErrorBuf) } local := c.LocalFlags() if c.globNormFunc != nil { c.iflags.SetNormalizeFunc(c.globNormFunc) } c.parentsPflags.VisitAll(func(f *flag.Flag) { if c.iflags.Lookup(f.Name) == nil && local.Lookup(f.Name) == nil { c.iflags.AddFlag(f) } }) return c.iflags } // NonInheritedFlags returns all flags which were not inherited from parent commands. // This function does not modify the flags of the current command, it's purpose is to return the current state. func (c *Command) NonInheritedFlags() *flag.FlagSet { return c.LocalFlags() } // PersistentFlags returns the persistent FlagSet specifically set in the current command. func (c *Command) PersistentFlags() *flag.FlagSet { if c.pflags == nil { c.pflags = flag.NewFlagSet(c.DisplayName(), flag.ContinueOnError) if c.flagErrorBuf == nil { c.flagErrorBuf = new(bytes.Buffer) } c.pflags.SetOutput(c.flagErrorBuf) } return c.pflags } // ResetFlags deletes all flags from command. func (c *Command) ResetFlags() { c.flagErrorBuf = new(bytes.Buffer) c.flagErrorBuf.Reset() c.flags = flag.NewFlagSet(c.DisplayName(), flag.ContinueOnError) c.flags.SetOutput(c.flagErrorBuf) c.pflags = flag.NewFlagSet(c.DisplayName(), flag.ContinueOnError) c.pflags.SetOutput(c.flagErrorBuf) c.lflags = nil c.iflags = nil c.parentsPflags = nil } // HasFlags checks if the command contains any flags (local plus persistent from the entire structure). func (c *Command) HasFlags() bool { return c.Flags().HasFlags() } // HasPersistentFlags checks if the command contains persistent flags. func (c *Command) HasPersistentFlags() bool { return c.PersistentFlags().HasFlags() } // HasLocalFlags checks if the command has flags specifically declared locally. func (c *Command) HasLocalFlags() bool { return c.LocalFlags().HasFlags() } // HasInheritedFlags checks if the command has flags inherited from its parent command. func (c *Command) HasInheritedFlags() bool { return c.InheritedFlags().HasFlags() } // HasAvailableFlags checks if the command contains any flags (local plus persistent from the entire // structure) which are not hidden or deprecated. func (c *Command) HasAvailableFlags() bool { return c.Flags().HasAvailableFlags() } // HasAvailablePersistentFlags checks if the command contains persistent flags which are not hidden or deprecated. func (c *Command) HasAvailablePersistentFlags() bool { return c.PersistentFlags().HasAvailableFlags() } // HasAvailableLocalFlags checks if the command has flags specifically declared locally which are not hidden // or deprecated. func (c *Command) HasAvailableLocalFlags() bool { return c.LocalFlags().HasAvailableFlags() } // HasAvailableInheritedFlags checks if the command has flags inherited from its parent command which are // not hidden or deprecated. func (c *Command) HasAvailableInheritedFlags() bool { return c.InheritedFlags().HasAvailableFlags() } // Flag climbs up the command tree looking for matching flag. func (c *Command) Flag(name string) (flag *flag.Flag) { flag = c.Flags().Lookup(name) if flag == nil { flag = c.persistentFlag(name) } return } // Recursively find matching persistent flag. func (c *Command) persistentFlag(name string) (flag *flag.Flag) { if c.HasPersistentFlags() { flag = c.PersistentFlags().Lookup(name) } if flag == nil { c.updateParentsPflags() flag = c.parentsPflags.Lookup(name) } return } // ParseFlags parses persistent flag tree and local flags. func (c *Command) ParseFlags(args []string) error { if c.DisableFlagParsing { return nil } if c.flagErrorBuf == nil { c.flagErrorBuf = new(bytes.Buffer) } beforeErrorBufLen := c.flagErrorBuf.Len() c.mergePersistentFlags() // do it here after merging all flags and just before parse c.Flags().ParseErrorsAllowlist = flag.ParseErrorsAllowlist(c.FParseErrWhitelist) err := c.Flags().Parse(args) // Print warnings if they occurred (e.g. deprecated flag messages). if c.flagErrorBuf.Len()-beforeErrorBufLen > 0 && err == nil { c.Print(c.flagErrorBuf.String()) } return err } // Parent returns a commands parent command. func (c *Command) Parent() *Command { return c.parent } // mergePersistentFlags merges c.PersistentFlags() to c.Flags() // and adds missing persistent flags of all parents. func (c *Command) mergePersistentFlags() { c.updateParentsPflags() c.Flags().AddFlagSet(c.PersistentFlags()) c.Flags().AddFlagSet(c.parentsPflags) } // updateParentsPflags updates c.parentsPflags by adding // new persistent flags of all parents. // If c.parentsPflags == nil, it makes new. func (c *Command) updateParentsPflags() { if c.parentsPflags == nil { c.parentsPflags = flag.NewFlagSet(c.DisplayName(), flag.ContinueOnError) c.parentsPflags.SetOutput(c.flagErrorBuf) c.parentsPflags.SortFlags = false } if c.globNormFunc != nil { c.parentsPflags.SetNormalizeFunc(c.globNormFunc) } c.Root().PersistentFlags().AddFlagSet(flag.CommandLine) c.VisitParents(func(parent *Command) { c.parentsPflags.AddFlagSet(parent.PersistentFlags()) }) } // commandNameMatches checks if two command names are equal // taking into account case sensitivity according to // EnableCaseInsensitive global configuration. func commandNameMatches(s string, t string) bool { if EnableCaseInsensitive { return strings.EqualFold(s, t) } return s == t } // tmplFunc holds a template and a function that will execute said template. type tmplFunc struct { tmpl string fn func(io.Writer, interface{}) error } const defaultUsageTemplate = `Usage:{{if .Runnable}} {{.UseLine}}{{end}}{{if .HasAvailableSubCommands}} {{.CommandPath}} [command]{{end}}{{if gt (len .Aliases) 0}} Aliases: {{.NameAndAliases}}{{end}}{{if .HasExample}} Examples: {{.Example}}{{end}}{{if .HasAvailableSubCommands}}{{$cmds := .Commands}}{{if eq (len .Groups) 0}} Available Commands:{{range $cmds}}{{if (or .IsAvailableCommand (eq .Name "help"))}} {{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{else}}{{range $group := .Groups}} {{.Title}}{{range $cmds}}{{if (and (eq .GroupID $group.ID) (or .IsAvailableCommand (eq .Name "help")))}} {{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{end}}{{if not .AllChildCommandsHaveGroup}} Additional Commands:{{range $cmds}}{{if (and (eq .GroupID "") (or .IsAvailableCommand (eq .Name "help")))}} {{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{end}}{{end}}{{end}}{{if .HasAvailableLocalFlags}} Flags: {{.LocalFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if .HasAvailableInheritedFlags}} Global Flags: {{.InheritedFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if .HasHelpSubCommands}} Additional help topics:{{range .Commands}}{{if .IsAdditionalHelpTopicCommand}} {{rpad .CommandPath .CommandPathPadding}} {{.Short}}{{end}}{{end}}{{end}}{{if .HasAvailableSubCommands}} Use "{{.CommandPath}} [command] --help" for more information about a command.{{end}} ` // defaultUsageFunc is equivalent to executing defaultUsageTemplate. The two should be changed in sync. func defaultUsageFunc(w io.Writer, in interface{}) error { c := in.(*Command) fmt.Fprint(w, "Usage:") if c.Runnable() { fmt.Fprintf(w, "\n %s", c.UseLine()) } if c.HasAvailableSubCommands() { fmt.Fprintf(w, "\n %s [command]", c.CommandPath()) } if len(c.Aliases) > 0 { fmt.Fprintf(w, "\n\nAliases:\n") fmt.Fprintf(w, " %s", c.NameAndAliases()) } if c.HasExample() { fmt.Fprintf(w, "\n\nExamples:\n") fmt.Fprintf(w, "%s", c.Example) } if c.HasAvailableSubCommands() { cmds := c.Commands() if len(c.Groups()) == 0 { fmt.Fprintf(w, "\n\nAvailable Commands:") for _, subcmd := range cmds { if subcmd.IsAvailableCommand() || subcmd.Name() == helpCommandName { fmt.Fprintf(w, "\n %s %s", rpad(subcmd.Name(), subcmd.NamePadding()), subcmd.Short) } } } else { for _, group := range c.Groups() { fmt.Fprintf(w, "\n\n%s", group.Title) for _, subcmd := range cmds { if subcmd.GroupID == group.ID && (subcmd.IsAvailableCommand() || subcmd.Name() == helpCommandName) { fmt.Fprintf(w, "\n %s %s", rpad(subcmd.Name(), subcmd.NamePadding()), subcmd.Short) } } } if !c.AllChildCommandsHaveGroup() { fmt.Fprintf(w, "\n\nAdditional Commands:") for _, subcmd := range cmds { if subcmd.GroupID == "" && (subcmd.IsAvailableCommand() || subcmd.Name() == helpCommandName) { fmt.Fprintf(w, "\n %s %s", rpad(subcmd.Name(), subcmd.NamePadding()), subcmd.Short) } } } } } if c.HasAvailableLocalFlags() { fmt.Fprintf(w, "\n\nFlags:\n") fmt.Fprint(w, trimRightSpace(c.LocalFlags().FlagUsages())) } if c.HasAvailableInheritedFlags() { fmt.Fprintf(w, "\n\nGlobal Flags:\n") fmt.Fprint(w, trimRightSpace(c.InheritedFlags().FlagUsages())) } if c.HasHelpSubCommands() { fmt.Fprintf(w, "\n\nAdditional help topics:") for _, subcmd := range c.Commands() { if subcmd.IsAdditionalHelpTopicCommand() { fmt.Fprintf(w, "\n %s %s", rpad(subcmd.CommandPath(), subcmd.CommandPathPadding()), subcmd.Short) } } } if c.HasAvailableSubCommands() { fmt.Fprintf(w, "\n\nUse \"%s [command] --help\" for more information about a command.", c.CommandPath()) } fmt.Fprintln(w) return nil } const defaultHelpTemplate = `{{with (or .Long .Short)}}{{. | trimTrailingWhitespaces}} {{end}}{{if or .Runnable .HasSubCommands}}{{.UsageString}}{{end}}` // defaultHelpFunc is equivalent to executing defaultHelpTemplate. The two should be changed in sync. func defaultHelpFunc(w io.Writer, in interface{}) error { c := in.(*Command) usage := c.Long if usage == "" { usage = c.Short } usage = trimRightSpace(usage) if usage != "" { fmt.Fprintln(w, usage) fmt.Fprintln(w) } if c.Runnable() || c.HasSubCommands() { fmt.Fprint(w, c.UsageString()) } return nil } const defaultVersionTemplate = `{{with .DisplayName}}{{printf "%s " .}}{{end}}{{printf "version %s" .Version}} ` // defaultVersionFunc is equivalent to executing defaultVersionTemplate. The two should be changed in sync. func defaultVersionFunc(w io.Writer, in interface{}) error { c := in.(*Command) _, err := fmt.Fprintf(w, "%s version %s\n", c.DisplayName(), c.Version) return err } ================================================ FILE: vendor/github.com/spf13/cobra/command_notwin.go ================================================ // Copyright 2013-2023 The Cobra Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. //go:build !windows // +build !windows package cobra var preExecHookFn func(*Command) ================================================ FILE: vendor/github.com/spf13/cobra/command_win.go ================================================ // Copyright 2013-2023 The Cobra Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. //go:build windows // +build windows package cobra import ( "fmt" "os" "time" "github.com/inconshreveable/mousetrap" ) var preExecHookFn = preExecHook func preExecHook(c *Command) { if MousetrapHelpText != "" && mousetrap.StartedByExplorer() { c.Print(MousetrapHelpText) if MousetrapDisplayDuration > 0 { time.Sleep(MousetrapDisplayDuration) } else { c.Println("Press return to continue...") fmt.Scanln() } os.Exit(1) } } ================================================ FILE: vendor/github.com/spf13/cobra/completions.go ================================================ // Copyright 2013-2023 The Cobra Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package cobra import ( "fmt" "os" "regexp" "strconv" "strings" "sync" "github.com/spf13/pflag" ) const ( // ShellCompRequestCmd is the name of the hidden command that is used to request // completion results from the program. It is used by the shell completion scripts. ShellCompRequestCmd = "__complete" // ShellCompNoDescRequestCmd is the name of the hidden command that is used to request // completion results without their description. It is used by the shell completion scripts. ShellCompNoDescRequestCmd = "__completeNoDesc" ) // Global map of flag completion functions. Make sure to use flagCompletionMutex before you try to read and write from it. var flagCompletionFunctions = map[*pflag.Flag]CompletionFunc{} // lock for reading and writing from flagCompletionFunctions var flagCompletionMutex = &sync.RWMutex{} // ShellCompDirective is a bit map representing the different behaviors the shell // can be instructed to have once completions have been provided. type ShellCompDirective int type flagCompError struct { subCommand string flagName string } func (e *flagCompError) Error() string { return "Subcommand '" + e.subCommand + "' does not support flag '" + e.flagName + "'" } const ( // ShellCompDirectiveError indicates an error occurred and completions should be ignored. ShellCompDirectiveError ShellCompDirective = 1 << iota // ShellCompDirectiveNoSpace indicates that the shell should not add a space // after the completion even if there is a single completion provided. ShellCompDirectiveNoSpace // ShellCompDirectiveNoFileComp indicates that the shell should not provide // file completion even when no completion is provided. ShellCompDirectiveNoFileComp // ShellCompDirectiveFilterFileExt indicates that the provided completions // should be used as file extension filters. // For flags, using Command.MarkFlagFilename() and Command.MarkPersistentFlagFilename() // is a shortcut to using this directive explicitly. The BashCompFilenameExt // annotation can also be used to obtain the same behavior for flags. ShellCompDirectiveFilterFileExt // ShellCompDirectiveFilterDirs indicates that only directory names should // be provided in file completion. To request directory names within another // directory, the returned completions should specify the directory within // which to search. The BashCompSubdirsInDir annotation can be used to // obtain the same behavior but only for flags. ShellCompDirectiveFilterDirs // ShellCompDirectiveKeepOrder indicates that the shell should preserve the order // in which the completions are provided ShellCompDirectiveKeepOrder // =========================================================================== // All directives using iota should be above this one. // For internal use. shellCompDirectiveMaxValue // ShellCompDirectiveDefault indicates to let the shell perform its default // behavior after completions have been provided. // This one must be last to avoid messing up the iota count. ShellCompDirectiveDefault ShellCompDirective = 0 ) const ( // Constants for the completion command compCmdName = "completion" compCmdNoDescFlagName = "no-descriptions" compCmdNoDescFlagDesc = "disable completion descriptions" compCmdNoDescFlagDefault = false ) // CompletionOptions are the options to control shell completion type CompletionOptions struct { // DisableDefaultCmd prevents Cobra from creating a default 'completion' command DisableDefaultCmd bool // DisableNoDescFlag prevents Cobra from creating the '--no-descriptions' flag // for shells that support completion descriptions DisableNoDescFlag bool // DisableDescriptions turns off all completion descriptions for shells // that support them DisableDescriptions bool // HiddenDefaultCmd makes the default 'completion' command hidden HiddenDefaultCmd bool // DefaultShellCompDirective sets the ShellCompDirective that is returned // if no special directive can be determined DefaultShellCompDirective *ShellCompDirective } func (receiver *CompletionOptions) SetDefaultShellCompDirective(directive ShellCompDirective) { receiver.DefaultShellCompDirective = &directive } // Completion is a string that can be used for completions // // two formats are supported: // - the completion choice // - the completion choice with a textual description (separated by a TAB). // // [CompletionWithDesc] can be used to create a completion string with a textual description. // // Note: Go type alias is used to provide a more descriptive name in the documentation, but any string can be used. type Completion = string // CompletionFunc is a function that provides completion results. type CompletionFunc = func(cmd *Command, args []string, toComplete string) ([]Completion, ShellCompDirective) // CompletionWithDesc returns a [Completion] with a description by using the TAB delimited format. func CompletionWithDesc(choice string, description string) Completion { return choice + "\t" + description } // NoFileCompletions can be used to disable file completion for commands that should // not trigger file completions. // // This method satisfies [CompletionFunc]. // It can be used with [Command.RegisterFlagCompletionFunc] and for [Command.ValidArgsFunction]. func NoFileCompletions(cmd *Command, args []string, toComplete string) ([]Completion, ShellCompDirective) { return nil, ShellCompDirectiveNoFileComp } // FixedCompletions can be used to create a completion function which always // returns the same results. // // This method returns a function that satisfies [CompletionFunc] // It can be used with [Command.RegisterFlagCompletionFunc] and for [Command.ValidArgsFunction]. func FixedCompletions(choices []Completion, directive ShellCompDirective) CompletionFunc { return func(cmd *Command, args []string, toComplete string) ([]Completion, ShellCompDirective) { return choices, directive } } // RegisterFlagCompletionFunc should be called to register a function to provide completion for a flag. // // You can use pre-defined completion functions such as [FixedCompletions] or [NoFileCompletions], // or you can define your own. func (c *Command) RegisterFlagCompletionFunc(flagName string, f CompletionFunc) error { flag := c.Flag(flagName) if flag == nil { return fmt.Errorf("RegisterFlagCompletionFunc: flag '%s' does not exist", flagName) } flagCompletionMutex.Lock() defer flagCompletionMutex.Unlock() if _, exists := flagCompletionFunctions[flag]; exists { return fmt.Errorf("RegisterFlagCompletionFunc: flag '%s' already registered", flagName) } flagCompletionFunctions[flag] = f return nil } // GetFlagCompletionFunc returns the completion function for the given flag of the command, if available. func (c *Command) GetFlagCompletionFunc(flagName string) (CompletionFunc, bool) { flag := c.Flag(flagName) if flag == nil { return nil, false } flagCompletionMutex.RLock() defer flagCompletionMutex.RUnlock() completionFunc, exists := flagCompletionFunctions[flag] return completionFunc, exists } // Returns a string listing the different directive enabled in the specified parameter func (d ShellCompDirective) string() string { var directives []string if d&ShellCompDirectiveError != 0 { directives = append(directives, "ShellCompDirectiveError") } if d&ShellCompDirectiveNoSpace != 0 { directives = append(directives, "ShellCompDirectiveNoSpace") } if d&ShellCompDirectiveNoFileComp != 0 { directives = append(directives, "ShellCompDirectiveNoFileComp") } if d&ShellCompDirectiveFilterFileExt != 0 { directives = append(directives, "ShellCompDirectiveFilterFileExt") } if d&ShellCompDirectiveFilterDirs != 0 { directives = append(directives, "ShellCompDirectiveFilterDirs") } if d&ShellCompDirectiveKeepOrder != 0 { directives = append(directives, "ShellCompDirectiveKeepOrder") } if len(directives) == 0 { directives = append(directives, "ShellCompDirectiveDefault") } if d >= shellCompDirectiveMaxValue { return fmt.Sprintf("ERROR: unexpected ShellCompDirective value: %d", d) } return strings.Join(directives, ", ") } // initCompleteCmd adds a special hidden command that can be used to request custom completions. func (c *Command) initCompleteCmd(args []string) { completeCmd := &Command{ Use: fmt.Sprintf("%s [command-line]", ShellCompRequestCmd), Aliases: []string{ShellCompNoDescRequestCmd}, DisableFlagsInUseLine: true, Hidden: true, DisableFlagParsing: true, Args: MinimumNArgs(1), Short: "Request shell completion choices for the specified command-line", Long: fmt.Sprintf("%[2]s is a special command that is used by the shell completion logic\n%[1]s", "to request completion choices for the specified command-line.", ShellCompRequestCmd), Run: func(cmd *Command, args []string) { finalCmd, completions, directive, err := cmd.getCompletions(args) if err != nil { CompErrorln(err.Error()) // Keep going for multiple reasons: // 1- There could be some valid completions even though there was an error // 2- Even without completions, we need to print the directive } noDescriptions := cmd.CalledAs() == ShellCompNoDescRequestCmd if !noDescriptions { if doDescriptions, err := strconv.ParseBool(getEnvConfig(cmd, configEnvVarSuffixDescriptions)); err == nil { noDescriptions = !doDescriptions } } noActiveHelp := GetActiveHelpConfig(finalCmd) == activeHelpGlobalDisable out := finalCmd.OutOrStdout() for _, comp := range completions { if noActiveHelp && strings.HasPrefix(comp, activeHelpMarker) { // Remove all activeHelp entries if it's disabled. continue } if noDescriptions { // Remove any description that may be included following a tab character. comp = strings.SplitN(comp, "\t", 2)[0] } // Make sure we only write the first line to the output. // This is needed if a description contains a linebreak. // Otherwise the shell scripts will interpret the other lines as new flags // and could therefore provide a wrong completion. comp = strings.SplitN(comp, "\n", 2)[0] // Finally trim the completion. This is especially important to get rid // of a trailing tab when there are no description following it. // For example, a sub-command without a description should not be completed // with a tab at the end (or else zsh will show a -- following it // although there is no description). comp = strings.TrimSpace(comp) // Print each possible completion to the output for the completion script to consume. fmt.Fprintln(out, comp) } // As the last printout, print the completion directive for the completion script to parse. // The directive integer must be that last character following a single colon (:). // The completion script expects : fmt.Fprintf(out, ":%d\n", directive) // Print some helpful info to stderr for the user to understand. // Output from stderr must be ignored by the completion script. fmt.Fprintf(finalCmd.ErrOrStderr(), "Completion ended with directive: %s\n", directive.string()) }, } c.AddCommand(completeCmd) subCmd, _, err := c.Find(args) if err != nil || subCmd.Name() != ShellCompRequestCmd { // Only create this special command if it is actually being called. // This reduces possible side-effects of creating such a command; // for example, having this command would cause problems to a // cobra program that only consists of the root command, since this // command would cause the root command to suddenly have a subcommand. c.RemoveCommand(completeCmd) } } // SliceValue is a reduced version of [pflag.SliceValue]. It is used to detect // flags that accept multiple values and therefore can provide completion // multiple times. type SliceValue interface { // GetSlice returns the flag value list as an array of strings. GetSlice() []string } func (c *Command) getCompletions(args []string) (*Command, []Completion, ShellCompDirective, error) { // The last argument, which is not completely typed by the user, // should not be part of the list of arguments toComplete := args[len(args)-1] trimmedArgs := args[:len(args)-1] var finalCmd *Command var finalArgs []string var err error // Find the real command for which completion must be performed // check if we need to traverse here to parse local flags on parent commands if c.Root().TraverseChildren { finalCmd, finalArgs, err = c.Root().Traverse(trimmedArgs) } else { // For Root commands that don't specify any value for their Args fields, when we call // Find(), if those Root commands don't have any sub-commands, they will accept arguments. // However, because we have added the __complete sub-command in the current code path, the // call to Find() -> legacyArgs() will return an error if there are any arguments. // To avoid this, we first remove the __complete command to get back to having no sub-commands. rootCmd := c.Root() if len(rootCmd.Commands()) == 1 { rootCmd.RemoveCommand(c) } finalCmd, finalArgs, err = rootCmd.Find(trimmedArgs) } if err != nil { // Unable to find the real command. E.g., someInvalidCmd return c, []Completion{}, ShellCompDirectiveDefault, fmt.Errorf("unable to find a command for arguments: %v", trimmedArgs) } finalCmd.ctx = c.ctx // These flags are normally added when `execute()` is called on `finalCmd`, // however, when doing completion, we don't call `finalCmd.execute()`. // Let's add the --help and --version flag ourselves but only if the finalCmd // has not disabled flag parsing; if flag parsing is disabled, it is up to the // finalCmd itself to handle the completion of *all* flags. if !finalCmd.DisableFlagParsing { finalCmd.InitDefaultHelpFlag() finalCmd.InitDefaultVersionFlag() } // Check if we are doing flag value completion before parsing the flags. // This is important because if we are completing a flag value, we need to also // remove the flag name argument from the list of finalArgs or else the parsing // could fail due to an invalid value (incomplete) for the flag. flag, finalArgs, toComplete, flagErr := checkIfFlagCompletion(finalCmd, finalArgs, toComplete) // Check if interspersed is false or -- was set on a previous arg. // This works by counting the arguments. Normally -- is not counted as arg but // if -- was already set or interspersed is false and there is already one arg then // the extra added -- is counted as arg. flagCompletion := true _ = finalCmd.ParseFlags(append(finalArgs, "--")) newArgCount := finalCmd.Flags().NArg() // Parse the flags early so we can check if required flags are set if err = finalCmd.ParseFlags(finalArgs); err != nil { return finalCmd, []Completion{}, ShellCompDirectiveDefault, fmt.Errorf("Error while parsing flags from args %v: %s", finalArgs, err.Error()) } realArgCount := finalCmd.Flags().NArg() if newArgCount > realArgCount { // don't do flag completion (see above) flagCompletion = false } // Error while attempting to parse flags if flagErr != nil { // If error type is flagCompError and we don't want flagCompletion we should ignore the error if _, ok := flagErr.(*flagCompError); !ok || flagCompletion { return finalCmd, []Completion{}, ShellCompDirectiveDefault, flagErr } } // Look for the --help or --version flags. If they are present, // there should be no further completions. if helpOrVersionFlagPresent(finalCmd) { return finalCmd, []Completion{}, ShellCompDirectiveNoFileComp, nil } // We only remove the flags from the arguments if DisableFlagParsing is not set. // This is important for commands which have requested to do their own flag completion. if !finalCmd.DisableFlagParsing { finalArgs = finalCmd.Flags().Args() } if flag != nil && flagCompletion { // Check if we are completing a flag value subject to annotations if validExts, present := flag.Annotations[BashCompFilenameExt]; present { if len(validExts) != 0 { // File completion filtered by extensions return finalCmd, validExts, ShellCompDirectiveFilterFileExt, nil } // The annotation requests simple file completion. There is no reason to do // that since it is the default behavior anyway. Let's ignore this annotation // in case the program also registered a completion function for this flag. // Even though it is a mistake on the program's side, let's be nice when we can. } if subDir, present := flag.Annotations[BashCompSubdirsInDir]; present { if len(subDir) == 1 { // Directory completion from within a directory return finalCmd, subDir, ShellCompDirectiveFilterDirs, nil } // Directory completion return finalCmd, []Completion{}, ShellCompDirectiveFilterDirs, nil } } var completions []Completion var directive ShellCompDirective // Enforce flag groups before doing flag completions finalCmd.enforceFlagGroupsForCompletion() // Note that we want to perform flagname completion even if finalCmd.DisableFlagParsing==true; // doing this allows for completion of persistent flag names even for commands that disable flag parsing. // // When doing completion of a flag name, as soon as an argument starts with // a '-' we know it is a flag. We cannot use isFlagArg() here as it requires // the flag name to be complete if flag == nil && len(toComplete) > 0 && toComplete[0] == '-' && !strings.Contains(toComplete, "=") && flagCompletion { // First check for required flags completions = completeRequireFlags(finalCmd, toComplete) // If we have not found any required flags, only then can we show regular flags if len(completions) == 0 { doCompleteFlags := func(flag *pflag.Flag) { _, acceptsMultiple := flag.Value.(SliceValue) acceptsMultiple = acceptsMultiple || strings.Contains(flag.Value.Type(), "Slice") || strings.Contains(flag.Value.Type(), "Array") || strings.HasPrefix(flag.Value.Type(), "stringTo") if !flag.Changed || acceptsMultiple { // If the flag is not already present, or if it can be specified multiple times (Array, Slice, or stringTo) // we suggest it as a completion completions = append(completions, getFlagNameCompletions(flag, toComplete)...) } } // We cannot use finalCmd.Flags() because we may not have called ParsedFlags() for commands // that have set DisableFlagParsing; it is ParseFlags() that merges the inherited and // non-inherited flags. finalCmd.InheritedFlags().VisitAll(func(flag *pflag.Flag) { doCompleteFlags(flag) }) // Try to complete non-inherited flags even if DisableFlagParsing==true. // This allows programs to tell Cobra about flags for completion even // if the actual parsing of flags is not done by Cobra. // For instance, Helm uses this to provide flag name completion for // some of its plugins. finalCmd.NonInheritedFlags().VisitAll(func(flag *pflag.Flag) { doCompleteFlags(flag) }) } directive = ShellCompDirectiveNoFileComp if len(completions) == 1 && strings.HasSuffix(completions[0], "=") { // If there is a single completion, the shell usually adds a space // after the completion. We don't want that if the flag ends with an = directive = ShellCompDirectiveNoSpace } if !finalCmd.DisableFlagParsing { // If DisableFlagParsing==false, we have completed the flags as known by Cobra; // we can return what we found. // If DisableFlagParsing==true, Cobra may not be aware of all flags, so we // let the logic continue to see if ValidArgsFunction needs to be called. return finalCmd, completions, directive, nil } } else { directive = ShellCompDirectiveDefault // check current and parent commands for a custom DefaultShellCompDirective for cmd := finalCmd; cmd != nil; cmd = cmd.parent { if cmd.CompletionOptions.DefaultShellCompDirective != nil { directive = *cmd.CompletionOptions.DefaultShellCompDirective break } } if flag == nil { foundLocalNonPersistentFlag := false // If TraverseChildren is true on the root command we don't check for // local flags because we can use a local flag on a parent command if !finalCmd.Root().TraverseChildren { // Check if there are any local, non-persistent flags on the command-line localNonPersistentFlags := finalCmd.LocalNonPersistentFlags() finalCmd.NonInheritedFlags().VisitAll(func(flag *pflag.Flag) { if localNonPersistentFlags.Lookup(flag.Name) != nil && flag.Changed { foundLocalNonPersistentFlag = true } }) } // Complete subcommand names, including the help command if len(finalArgs) == 0 && !foundLocalNonPersistentFlag { // We only complete sub-commands if: // - there are no arguments on the command-line and // - there are no local, non-persistent flags on the command-line or TraverseChildren is true for _, subCmd := range finalCmd.Commands() { if subCmd.IsAvailableCommand() || subCmd == finalCmd.helpCommand { if strings.HasPrefix(subCmd.Name(), toComplete) { completions = append(completions, CompletionWithDesc(subCmd.Name(), subCmd.Short)) } directive = ShellCompDirectiveNoFileComp } } } // Complete required flags even without the '-' prefix completions = append(completions, completeRequireFlags(finalCmd, toComplete)...) // Always complete ValidArgs, even if we are completing a subcommand name. // This is for commands that have both subcommands and ValidArgs. if len(finalCmd.ValidArgs) > 0 { if len(finalArgs) == 0 { // ValidArgs are only for the first argument for _, validArg := range finalCmd.ValidArgs { if strings.HasPrefix(validArg, toComplete) { completions = append(completions, validArg) } } directive = ShellCompDirectiveNoFileComp // If no completions were found within commands or ValidArgs, // see if there are any ArgAliases that should be completed. if len(completions) == 0 { for _, argAlias := range finalCmd.ArgAliases { if strings.HasPrefix(argAlias, toComplete) { completions = append(completions, argAlias) } } } } // If there are ValidArgs specified (even if they don't match), we stop completion. // Only one of ValidArgs or ValidArgsFunction can be used for a single command. return finalCmd, completions, directive, nil } // Let the logic continue so as to add any ValidArgsFunction completions, // even if we already found sub-commands. // This is for commands that have subcommands but also specify a ValidArgsFunction. } } // Find the completion function for the flag or command var completionFn CompletionFunc if flag != nil && flagCompletion { flagCompletionMutex.RLock() completionFn = flagCompletionFunctions[flag] flagCompletionMutex.RUnlock() } else { completionFn = finalCmd.ValidArgsFunction } if completionFn != nil { // Go custom completion defined for this flag or command. // Call the registered completion function to get the completions. var comps []Completion comps, directive = completionFn(finalCmd, finalArgs, toComplete) completions = append(completions, comps...) } return finalCmd, completions, directive, nil } func helpOrVersionFlagPresent(cmd *Command) bool { if versionFlag := cmd.Flags().Lookup("version"); versionFlag != nil && len(versionFlag.Annotations[FlagSetByCobraAnnotation]) > 0 && versionFlag.Changed { return true } if helpFlag := cmd.Flags().Lookup(helpFlagName); helpFlag != nil && len(helpFlag.Annotations[FlagSetByCobraAnnotation]) > 0 && helpFlag.Changed { return true } return false } func getFlagNameCompletions(flag *pflag.Flag, toComplete string) []Completion { if nonCompletableFlag(flag) { return []Completion{} } var completions []Completion flagName := "--" + flag.Name if strings.HasPrefix(flagName, toComplete) { // Flag without the = completions = append(completions, CompletionWithDesc(flagName, flag.Usage)) // Why suggest both long forms: --flag and --flag= ? // This forces the user to *always* have to type either an = or a space after the flag name. // Let's be nice and avoid making users have to do that. // Since boolean flags and shortname flags don't show the = form, let's go that route and never show it. // The = form will still work, we just won't suggest it. // This also makes the list of suggested flags shorter as we avoid all the = forms. // // if len(flag.NoOptDefVal) == 0 { // // Flag requires a value, so it can be suffixed with = // flagName += "=" // completions = append(completions, CompletionWithDesc(flagName, flag.Usage)) // } } flagName = "-" + flag.Shorthand if len(flag.Shorthand) > 0 && strings.HasPrefix(flagName, toComplete) { completions = append(completions, CompletionWithDesc(flagName, flag.Usage)) } return completions } func completeRequireFlags(finalCmd *Command, toComplete string) []Completion { var completions []Completion doCompleteRequiredFlags := func(flag *pflag.Flag) { if _, present := flag.Annotations[BashCompOneRequiredFlag]; present { if !flag.Changed { // If the flag is not already present, we suggest it as a completion completions = append(completions, getFlagNameCompletions(flag, toComplete)...) } } } // We cannot use finalCmd.Flags() because we may not have called ParsedFlags() for commands // that have set DisableFlagParsing; it is ParseFlags() that merges the inherited and // non-inherited flags. finalCmd.InheritedFlags().VisitAll(func(flag *pflag.Flag) { doCompleteRequiredFlags(flag) }) finalCmd.NonInheritedFlags().VisitAll(func(flag *pflag.Flag) { doCompleteRequiredFlags(flag) }) return completions } func checkIfFlagCompletion(finalCmd *Command, args []string, lastArg string) (*pflag.Flag, []string, string, error) { if finalCmd.DisableFlagParsing { // We only do flag completion if we are allowed to parse flags // This is important for commands which have requested to do their own flag completion. return nil, args, lastArg, nil } var flagName string trimmedArgs := args flagWithEqual := false orgLastArg := lastArg // When doing completion of a flag name, as soon as an argument starts with // a '-' we know it is a flag. We cannot use isFlagArg() here as that function // requires the flag name to be complete if len(lastArg) > 0 && lastArg[0] == '-' { if index := strings.Index(lastArg, "="); index >= 0 { // Flag with an = if strings.HasPrefix(lastArg[:index], "--") { // Flag has full name flagName = lastArg[2:index] } else { // Flag is shorthand // We have to get the last shorthand flag name // e.g. `-asd` => d to provide the correct completion // https://github.com/spf13/cobra/issues/1257 flagName = lastArg[index-1 : index] } lastArg = lastArg[index+1:] flagWithEqual = true } else { // Normal flag completion return nil, args, lastArg, nil } } if len(flagName) == 0 { if len(args) > 0 { prevArg := args[len(args)-1] if isFlagArg(prevArg) { // Only consider the case where the flag does not contain an =. // If the flag contains an = it means it has already been fully processed, // so we don't need to deal with it here. if index := strings.Index(prevArg, "="); index < 0 { if strings.HasPrefix(prevArg, "--") { // Flag has full name flagName = prevArg[2:] } else { // Flag is shorthand // We have to get the last shorthand flag name // e.g. `-asd` => d to provide the correct completion // https://github.com/spf13/cobra/issues/1257 flagName = prevArg[len(prevArg)-1:] } // Remove the uncompleted flag or else there could be an error created // for an invalid value for that flag trimmedArgs = args[:len(args)-1] } } } } if len(flagName) == 0 { // Not doing flag completion return nil, trimmedArgs, lastArg, nil } flag := findFlag(finalCmd, flagName) if flag == nil { // Flag not supported by this command, the interspersed option might be set so return the original args return nil, args, orgLastArg, &flagCompError{subCommand: finalCmd.Name(), flagName: flagName} } if !flagWithEqual { if len(flag.NoOptDefVal) != 0 { // We had assumed dealing with a two-word flag but the flag is a boolean flag. // In that case, there is no value following it, so we are not really doing flag completion. // Reset everything to do noun completion. trimmedArgs = args flag = nil } } return flag, trimmedArgs, lastArg, nil } // InitDefaultCompletionCmd adds a default 'completion' command to c. // This function will do nothing if any of the following is true: // 1- the feature has been explicitly disabled by the program, // 2- c has no subcommands (to avoid creating one), // 3- c already has a 'completion' command provided by the program. func (c *Command) InitDefaultCompletionCmd(args ...string) { if c.CompletionOptions.DisableDefaultCmd { return } for _, cmd := range c.commands { if cmd.Name() == compCmdName || cmd.HasAlias(compCmdName) { // A completion command is already available return } } haveNoDescFlag := !c.CompletionOptions.DisableNoDescFlag && !c.CompletionOptions.DisableDescriptions // Special case to know if there are sub-commands or not. hasSubCommands := false for _, cmd := range c.commands { if cmd.Name() != ShellCompRequestCmd && cmd.Name() != helpCommandName { // We found a real sub-command (not 'help' or '__complete') hasSubCommands = true break } } completionCmd := &Command{ Use: compCmdName, Short: "Generate the autocompletion script for the specified shell", Long: fmt.Sprintf(`Generate the autocompletion script for %[1]s for the specified shell. See each sub-command's help for details on how to use the generated script. `, c.Root().Name()), Args: NoArgs, ValidArgsFunction: NoFileCompletions, Hidden: c.CompletionOptions.HiddenDefaultCmd, GroupID: c.completionCommandGroupID, } c.AddCommand(completionCmd) if !hasSubCommands { // If the 'completion' command will be the only sub-command, // we only create it if it is actually being called. // This avoids breaking programs that would suddenly find themselves with // a subcommand, which would prevent them from accepting arguments. // We also create the 'completion' command if the user is triggering // shell completion for it (prog __complete completion '') subCmd, cmdArgs, err := c.Find(args) if err != nil || subCmd.Name() != compCmdName && (subCmd.Name() != ShellCompRequestCmd || len(cmdArgs) <= 1 || cmdArgs[0] != compCmdName) { // The completion command is not being called or being completed so we remove it. c.RemoveCommand(completionCmd) return } } out := c.OutOrStdout() noDesc := c.CompletionOptions.DisableDescriptions shortDesc := "Generate the autocompletion script for %s" bash := &Command{ Use: "bash", Short: fmt.Sprintf(shortDesc, "bash"), Long: fmt.Sprintf(`Generate the autocompletion script for the bash shell. This script depends on the 'bash-completion' package. If it is not installed already, you can install it via your OS's package manager. To load completions in your current shell session: source <(%[1]s completion bash) To load completions for every new session, execute once: #### Linux: %[1]s completion bash > /etc/bash_completion.d/%[1]s #### macOS: %[1]s completion bash > $(brew --prefix)/etc/bash_completion.d/%[1]s You will need to start a new shell for this setup to take effect. `, c.Root().Name()), Args: NoArgs, DisableFlagsInUseLine: true, ValidArgsFunction: NoFileCompletions, RunE: func(cmd *Command, args []string) error { return cmd.Root().GenBashCompletionV2(out, !noDesc) }, } if haveNoDescFlag { bash.Flags().BoolVar(&noDesc, compCmdNoDescFlagName, compCmdNoDescFlagDefault, compCmdNoDescFlagDesc) } zsh := &Command{ Use: "zsh", Short: fmt.Sprintf(shortDesc, "zsh"), Long: fmt.Sprintf(`Generate the autocompletion script for the zsh shell. If shell completion is not already enabled in your environment you will need to enable it. You can execute the following once: echo "autoload -U compinit; compinit" >> ~/.zshrc To load completions in your current shell session: source <(%[1]s completion zsh) To load completions for every new session, execute once: #### Linux: %[1]s completion zsh > "${fpath[1]}/_%[1]s" #### macOS: %[1]s completion zsh > $(brew --prefix)/share/zsh/site-functions/_%[1]s You will need to start a new shell for this setup to take effect. `, c.Root().Name()), Args: NoArgs, ValidArgsFunction: NoFileCompletions, RunE: func(cmd *Command, args []string) error { if noDesc { return cmd.Root().GenZshCompletionNoDesc(out) } return cmd.Root().GenZshCompletion(out) }, } if haveNoDescFlag { zsh.Flags().BoolVar(&noDesc, compCmdNoDescFlagName, compCmdNoDescFlagDefault, compCmdNoDescFlagDesc) } fish := &Command{ Use: "fish", Short: fmt.Sprintf(shortDesc, "fish"), Long: fmt.Sprintf(`Generate the autocompletion script for the fish shell. To load completions in your current shell session: %[1]s completion fish | source To load completions for every new session, execute once: %[1]s completion fish > ~/.config/fish/completions/%[1]s.fish You will need to start a new shell for this setup to take effect. `, c.Root().Name()), Args: NoArgs, ValidArgsFunction: NoFileCompletions, RunE: func(cmd *Command, args []string) error { return cmd.Root().GenFishCompletion(out, !noDesc) }, } if haveNoDescFlag { fish.Flags().BoolVar(&noDesc, compCmdNoDescFlagName, compCmdNoDescFlagDefault, compCmdNoDescFlagDesc) } powershell := &Command{ Use: "powershell", Short: fmt.Sprintf(shortDesc, "powershell"), Long: fmt.Sprintf(`Generate the autocompletion script for powershell. To load completions in your current shell session: %[1]s completion powershell | Out-String | Invoke-Expression To load completions for every new session, add the output of the above command to your powershell profile. `, c.Root().Name()), Args: NoArgs, ValidArgsFunction: NoFileCompletions, RunE: func(cmd *Command, args []string) error { if noDesc { return cmd.Root().GenPowerShellCompletion(out) } return cmd.Root().GenPowerShellCompletionWithDesc(out) }, } if haveNoDescFlag { powershell.Flags().BoolVar(&noDesc, compCmdNoDescFlagName, compCmdNoDescFlagDefault, compCmdNoDescFlagDesc) } completionCmd.AddCommand(bash, zsh, fish, powershell) } func findFlag(cmd *Command, name string) *pflag.Flag { flagSet := cmd.Flags() if len(name) == 1 { // First convert the short flag into a long flag // as the cmd.Flag() search only accepts long flags if short := flagSet.ShorthandLookup(name); short != nil { name = short.Name } else { set := cmd.InheritedFlags() if short = set.ShorthandLookup(name); short != nil { name = short.Name } else { return nil } } } return cmd.Flag(name) } // CompDebug prints the specified string to the same file as where the // completion script prints its logs. // Note that completion printouts should never be on stdout as they would // be wrongly interpreted as actual completion choices by the completion script. func CompDebug(msg string, printToStdErr bool) { msg = fmt.Sprintf("[Debug] %s", msg) // Such logs are only printed when the user has set the environment // variable BASH_COMP_DEBUG_FILE to the path of some file to be used. if path := os.Getenv("BASH_COMP_DEBUG_FILE"); path != "" { f, err := os.OpenFile(path, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) if err == nil { defer f.Close() WriteStringAndCheck(f, msg) } } if printToStdErr { // Must print to stderr for this not to be read by the completion script. fmt.Fprint(os.Stderr, msg) } } // CompDebugln prints the specified string with a newline at the end // to the same file as where the completion script prints its logs. // Such logs are only printed when the user has set the environment // variable BASH_COMP_DEBUG_FILE to the path of some file to be used. func CompDebugln(msg string, printToStdErr bool) { CompDebug(fmt.Sprintf("%s\n", msg), printToStdErr) } // CompError prints the specified completion message to stderr. func CompError(msg string) { msg = fmt.Sprintf("[Error] %s", msg) CompDebug(msg, true) } // CompErrorln prints the specified completion message to stderr with a newline at the end. func CompErrorln(msg string) { CompError(fmt.Sprintf("%s\n", msg)) } // These values should not be changed: users will be using them explicitly. const ( configEnvVarGlobalPrefix = "COBRA" configEnvVarSuffixDescriptions = "COMPLETION_DESCRIPTIONS" ) var configEnvVarPrefixSubstRegexp = regexp.MustCompile(`[^A-Z0-9_]`) // configEnvVar returns the name of the program-specific configuration environment // variable. It has the format _ where is the name of the // root command in upper case, with all non-ASCII-alphanumeric characters replaced by `_`. func configEnvVar(name, suffix string) string { // This format should not be changed: users will be using it explicitly. v := strings.ToUpper(fmt.Sprintf("%s_%s", name, suffix)) v = configEnvVarPrefixSubstRegexp.ReplaceAllString(v, "_") return v } // getEnvConfig returns the value of the configuration environment variable // _ where is the name of the root command in upper // case, with all non-ASCII-alphanumeric characters replaced by `_`. // If the value is empty or not set, the value of the environment variable // COBRA_ is returned instead. func getEnvConfig(cmd *Command, suffix string) string { v := os.Getenv(configEnvVar(cmd.Root().Name(), suffix)) if v == "" { v = os.Getenv(configEnvVar(configEnvVarGlobalPrefix, suffix)) } return v } ================================================ FILE: vendor/github.com/spf13/cobra/fish_completions.go ================================================ // Copyright 2013-2023 The Cobra Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package cobra import ( "bytes" "fmt" "io" "os" "strings" ) func genFishComp(buf io.StringWriter, name string, includeDesc bool) { // Variables should not contain a '-' or ':' character nameForVar := name nameForVar = strings.ReplaceAll(nameForVar, "-", "_") nameForVar = strings.ReplaceAll(nameForVar, ":", "_") compCmd := ShellCompRequestCmd if !includeDesc { compCmd = ShellCompNoDescRequestCmd } WriteStringAndCheck(buf, fmt.Sprintf("# fish completion for %-36s -*- shell-script -*-\n", name)) WriteStringAndCheck(buf, fmt.Sprintf(` function __%[1]s_debug set -l file "$BASH_COMP_DEBUG_FILE" if test -n "$file" echo "$argv" >> $file end end function __%[1]s_perform_completion __%[1]s_debug "Starting __%[1]s_perform_completion" # Extract all args except the last one set -l args (commandline -opc) # Extract the last arg and escape it in case it is a space set -l lastArg (string escape -- (commandline -ct)) __%[1]s_debug "args: $args" __%[1]s_debug "last arg: $lastArg" # Disable ActiveHelp which is not supported for fish shell set -l requestComp "%[10]s=0 $args[1] %[3]s $args[2..-1] $lastArg" __%[1]s_debug "Calling $requestComp" set -l results (eval $requestComp 2> /dev/null) # Some programs may output extra empty lines after the directive. # Let's ignore them or else it will break completion. # Ref: https://github.com/spf13/cobra/issues/1279 for line in $results[-1..1] if test (string trim -- $line) = "" # Found an empty line, remove it set results $results[1..-2] else # Found non-empty line, we have our proper output break end end set -l comps $results[1..-2] set -l directiveLine $results[-1] # For Fish, when completing a flag with an = (e.g., -n=) # completions must be prefixed with the flag set -l flagPrefix (string match -r -- '-.*=' "$lastArg") __%[1]s_debug "Comps: $comps" __%[1]s_debug "DirectiveLine: $directiveLine" __%[1]s_debug "flagPrefix: $flagPrefix" for comp in $comps printf "%%s%%s\n" "$flagPrefix" "$comp" end printf "%%s\n" "$directiveLine" end # this function limits calls to __%[1]s_perform_completion, by caching the result behind $__%[1]s_perform_completion_once_result function __%[1]s_perform_completion_once __%[1]s_debug "Starting __%[1]s_perform_completion_once" if test -n "$__%[1]s_perform_completion_once_result" __%[1]s_debug "Seems like a valid result already exists, skipping __%[1]s_perform_completion" return 0 end set --global __%[1]s_perform_completion_once_result (__%[1]s_perform_completion) if test -z "$__%[1]s_perform_completion_once_result" __%[1]s_debug "No completions, probably due to a failure" return 1 end __%[1]s_debug "Performed completions and set __%[1]s_perform_completion_once_result" return 0 end # this function is used to clear the $__%[1]s_perform_completion_once_result variable after completions are run function __%[1]s_clear_perform_completion_once_result __%[1]s_debug "" __%[1]s_debug "========= clearing previously set __%[1]s_perform_completion_once_result variable ==========" set --erase __%[1]s_perform_completion_once_result __%[1]s_debug "Successfully erased the variable __%[1]s_perform_completion_once_result" end function __%[1]s_requires_order_preservation __%[1]s_debug "" __%[1]s_debug "========= checking if order preservation is required ==========" __%[1]s_perform_completion_once if test -z "$__%[1]s_perform_completion_once_result" __%[1]s_debug "Error determining if order preservation is required" return 1 end set -l directive (string sub --start 2 $__%[1]s_perform_completion_once_result[-1]) __%[1]s_debug "Directive is: $directive" set -l shellCompDirectiveKeepOrder %[9]d set -l keeporder (math (math --scale 0 $directive / $shellCompDirectiveKeepOrder) %% 2) __%[1]s_debug "Keeporder is: $keeporder" if test $keeporder -ne 0 __%[1]s_debug "This does require order preservation" return 0 end __%[1]s_debug "This doesn't require order preservation" return 1 end # This function does two things: # - Obtain the completions and store them in the global __%[1]s_comp_results # - Return false if file completion should be performed function __%[1]s_prepare_completions __%[1]s_debug "" __%[1]s_debug "========= starting completion logic ==========" # Start fresh set --erase __%[1]s_comp_results __%[1]s_perform_completion_once __%[1]s_debug "Completion results: $__%[1]s_perform_completion_once_result" if test -z "$__%[1]s_perform_completion_once_result" __%[1]s_debug "No completion, probably due to a failure" # Might as well do file completion, in case it helps return 1 end set -l directive (string sub --start 2 $__%[1]s_perform_completion_once_result[-1]) set --global __%[1]s_comp_results $__%[1]s_perform_completion_once_result[1..-2] __%[1]s_debug "Completions are: $__%[1]s_comp_results" __%[1]s_debug "Directive is: $directive" set -l shellCompDirectiveError %[4]d set -l shellCompDirectiveNoSpace %[5]d set -l shellCompDirectiveNoFileComp %[6]d set -l shellCompDirectiveFilterFileExt %[7]d set -l shellCompDirectiveFilterDirs %[8]d if test -z "$directive" set directive 0 end set -l compErr (math (math --scale 0 $directive / $shellCompDirectiveError) %% 2) if test $compErr -eq 1 __%[1]s_debug "Received error directive: aborting." # Might as well do file completion, in case it helps return 1 end set -l filefilter (math (math --scale 0 $directive / $shellCompDirectiveFilterFileExt) %% 2) set -l dirfilter (math (math --scale 0 $directive / $shellCompDirectiveFilterDirs) %% 2) if test $filefilter -eq 1; or test $dirfilter -eq 1 __%[1]s_debug "File extension filtering or directory filtering not supported" # Do full file completion instead return 1 end set -l nospace (math (math --scale 0 $directive / $shellCompDirectiveNoSpace) %% 2) set -l nofiles (math (math --scale 0 $directive / $shellCompDirectiveNoFileComp) %% 2) __%[1]s_debug "nospace: $nospace, nofiles: $nofiles" # If we want to prevent a space, or if file completion is NOT disabled, # we need to count the number of valid completions. # To do so, we will filter on prefix as the completions we have received # may not already be filtered so as to allow fish to match on different # criteria than the prefix. if test $nospace -ne 0; or test $nofiles -eq 0 set -l prefix (commandline -t | string escape --style=regex) __%[1]s_debug "prefix: $prefix" set -l completions (string match -r -- "^$prefix.*" $__%[1]s_comp_results) set --global __%[1]s_comp_results $completions __%[1]s_debug "Filtered completions are: $__%[1]s_comp_results" # Important not to quote the variable for count to work set -l numComps (count $__%[1]s_comp_results) __%[1]s_debug "numComps: $numComps" if test $numComps -eq 1; and test $nospace -ne 0 # We must first split on \t to get rid of the descriptions to be # able to check what the actual completion will be. # We don't need descriptions anyway since there is only a single # real completion which the shell will expand immediately. set -l split (string split --max 1 \t $__%[1]s_comp_results[1]) # Fish won't add a space if the completion ends with any # of the following characters: @=/:., set -l lastChar (string sub -s -1 -- $split) if not string match -r -q "[@=/:.,]" -- "$lastChar" # In other cases, to support the "nospace" directive we trick the shell # by outputting an extra, longer completion. __%[1]s_debug "Adding second completion to perform nospace directive" set --global __%[1]s_comp_results $split[1] $split[1]. __%[1]s_debug "Completions are now: $__%[1]s_comp_results" end end if test $numComps -eq 0; and test $nofiles -eq 0 # To be consistent with bash and zsh, we only trigger file # completion when there are no other completions __%[1]s_debug "Requesting file completion" return 1 end end return 0 end # Since Fish completions are only loaded once the user triggers them, we trigger them ourselves # so we can properly delete any completions provided by another script. # Only do this if the program can be found, or else fish may print some errors; besides, # the existing completions will only be loaded if the program can be found. if type -q "%[2]s" # The space after the program name is essential to trigger completion for the program # and not completion of the program name itself. # Also, we use '> /dev/null 2>&1' since '&>' is not supported in older versions of fish. complete --do-complete "%[2]s " > /dev/null 2>&1 end # Remove any pre-existing completions for the program since we will be handling all of them. complete -c %[2]s -e # this will get called after the two calls below and clear the $__%[1]s_perform_completion_once_result global complete -c %[2]s -n '__%[1]s_clear_perform_completion_once_result' # The call to __%[1]s_prepare_completions will setup __%[1]s_comp_results # which provides the program's completion choices. # If this doesn't require order preservation, we don't use the -k flag complete -c %[2]s -n 'not __%[1]s_requires_order_preservation && __%[1]s_prepare_completions' -f -a '$__%[1]s_comp_results' # otherwise we use the -k flag complete -k -c %[2]s -n '__%[1]s_requires_order_preservation && __%[1]s_prepare_completions' -f -a '$__%[1]s_comp_results' `, nameForVar, name, compCmd, ShellCompDirectiveError, ShellCompDirectiveNoSpace, ShellCompDirectiveNoFileComp, ShellCompDirectiveFilterFileExt, ShellCompDirectiveFilterDirs, ShellCompDirectiveKeepOrder, activeHelpEnvVar(name))) } // GenFishCompletion generates fish completion file and writes to the passed writer. func (c *Command) GenFishCompletion(w io.Writer, includeDesc bool) error { buf := new(bytes.Buffer) genFishComp(buf, c.Name(), includeDesc) _, err := buf.WriteTo(w) return err } // GenFishCompletionFile generates fish completion file. func (c *Command) GenFishCompletionFile(filename string, includeDesc bool) error { outFile, err := os.Create(filename) if err != nil { return err } defer outFile.Close() return c.GenFishCompletion(outFile, includeDesc) } ================================================ FILE: vendor/github.com/spf13/cobra/flag_groups.go ================================================ // Copyright 2013-2023 The Cobra Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package cobra import ( "fmt" "sort" "strings" flag "github.com/spf13/pflag" ) const ( requiredAsGroupAnnotation = "cobra_annotation_required_if_others_set" oneRequiredAnnotation = "cobra_annotation_one_required" mutuallyExclusiveAnnotation = "cobra_annotation_mutually_exclusive" ) // MarkFlagsRequiredTogether marks the given flags with annotations so that Cobra errors // if the command is invoked with a subset (but not all) of the given flags. func (c *Command) MarkFlagsRequiredTogether(flagNames ...string) { c.mergePersistentFlags() for _, v := range flagNames { f := c.Flags().Lookup(v) if f == nil { panic(fmt.Sprintf("Failed to find flag %q and mark it as being required in a flag group", v)) } if err := c.Flags().SetAnnotation(v, requiredAsGroupAnnotation, append(f.Annotations[requiredAsGroupAnnotation], strings.Join(flagNames, " "))); err != nil { // Only errs if the flag isn't found. panic(err) } } } // MarkFlagsOneRequired marks the given flags with annotations so that Cobra errors // if the command is invoked without at least one flag from the given set of flags. func (c *Command) MarkFlagsOneRequired(flagNames ...string) { c.mergePersistentFlags() for _, v := range flagNames { f := c.Flags().Lookup(v) if f == nil { panic(fmt.Sprintf("Failed to find flag %q and mark it as being in a one-required flag group", v)) } if err := c.Flags().SetAnnotation(v, oneRequiredAnnotation, append(f.Annotations[oneRequiredAnnotation], strings.Join(flagNames, " "))); err != nil { // Only errs if the flag isn't found. panic(err) } } } // MarkFlagsMutuallyExclusive marks the given flags with annotations so that Cobra errors // if the command is invoked with more than one flag from the given set of flags. func (c *Command) MarkFlagsMutuallyExclusive(flagNames ...string) { c.mergePersistentFlags() for _, v := range flagNames { f := c.Flags().Lookup(v) if f == nil { panic(fmt.Sprintf("Failed to find flag %q and mark it as being in a mutually exclusive flag group", v)) } // Each time this is called is a single new entry; this allows it to be a member of multiple groups if needed. if err := c.Flags().SetAnnotation(v, mutuallyExclusiveAnnotation, append(f.Annotations[mutuallyExclusiveAnnotation], strings.Join(flagNames, " "))); err != nil { panic(err) } } } // ValidateFlagGroups validates the mutuallyExclusive/oneRequired/requiredAsGroup logic and returns the // first error encountered. func (c *Command) ValidateFlagGroups() error { if c.DisableFlagParsing { return nil } flags := c.Flags() // groupStatus format is the list of flags as a unique ID, // then a map of each flag name and whether it is set or not. groupStatus := map[string]map[string]bool{} oneRequiredGroupStatus := map[string]map[string]bool{} mutuallyExclusiveGroupStatus := map[string]map[string]bool{} flags.VisitAll(func(pflag *flag.Flag) { processFlagForGroupAnnotation(flags, pflag, requiredAsGroupAnnotation, groupStatus) processFlagForGroupAnnotation(flags, pflag, oneRequiredAnnotation, oneRequiredGroupStatus) processFlagForGroupAnnotation(flags, pflag, mutuallyExclusiveAnnotation, mutuallyExclusiveGroupStatus) }) if err := validateRequiredFlagGroups(groupStatus); err != nil { return err } if err := validateOneRequiredFlagGroups(oneRequiredGroupStatus); err != nil { return err } if err := validateExclusiveFlagGroups(mutuallyExclusiveGroupStatus); err != nil { return err } return nil } func hasAllFlags(fs *flag.FlagSet, flagnames ...string) bool { for _, fname := range flagnames { f := fs.Lookup(fname) if f == nil { return false } } return true } func processFlagForGroupAnnotation(flags *flag.FlagSet, pflag *flag.Flag, annotation string, groupStatus map[string]map[string]bool) { groupInfo, found := pflag.Annotations[annotation] if found { for _, group := range groupInfo { if groupStatus[group] == nil { flagnames := strings.Split(group, " ") // Only consider this flag group at all if all the flags are defined. if !hasAllFlags(flags, flagnames...) { continue } groupStatus[group] = make(map[string]bool, len(flagnames)) for _, name := range flagnames { groupStatus[group][name] = false } } groupStatus[group][pflag.Name] = pflag.Changed } } } func validateRequiredFlagGroups(data map[string]map[string]bool) error { keys := sortedKeys(data) for _, flagList := range keys { flagnameAndStatus := data[flagList] unset := []string{} for flagname, isSet := range flagnameAndStatus { if !isSet { unset = append(unset, flagname) } } if len(unset) == len(flagnameAndStatus) || len(unset) == 0 { continue } // Sort values, so they can be tested/scripted against consistently. sort.Strings(unset) return fmt.Errorf("if any flags in the group [%v] are set they must all be set; missing %v", flagList, unset) } return nil } func validateOneRequiredFlagGroups(data map[string]map[string]bool) error { keys := sortedKeys(data) for _, flagList := range keys { flagnameAndStatus := data[flagList] var set []string for flagname, isSet := range flagnameAndStatus { if isSet { set = append(set, flagname) } } if len(set) >= 1 { continue } // Sort values, so they can be tested/scripted against consistently. sort.Strings(set) return fmt.Errorf("at least one of the flags in the group [%v] is required", flagList) } return nil } func validateExclusiveFlagGroups(data map[string]map[string]bool) error { keys := sortedKeys(data) for _, flagList := range keys { flagnameAndStatus := data[flagList] var set []string for flagname, isSet := range flagnameAndStatus { if isSet { set = append(set, flagname) } } if len(set) == 0 || len(set) == 1 { continue } // Sort values, so they can be tested/scripted against consistently. sort.Strings(set) return fmt.Errorf("if any flags in the group [%v] are set none of the others can be; %v were all set", flagList, set) } return nil } func sortedKeys(m map[string]map[string]bool) []string { keys := make([]string, len(m)) i := 0 for k := range m { keys[i] = k i++ } sort.Strings(keys) return keys } // enforceFlagGroupsForCompletion will do the following: // - when a flag in a group is present, other flags in the group will be marked required // - when none of the flags in a one-required group are present, all flags in the group will be marked required // - when a flag in a mutually exclusive group is present, other flags in the group will be marked as hidden // This allows the standard completion logic to behave appropriately for flag groups func (c *Command) enforceFlagGroupsForCompletion() { if c.DisableFlagParsing { return } flags := c.Flags() groupStatus := map[string]map[string]bool{} oneRequiredGroupStatus := map[string]map[string]bool{} mutuallyExclusiveGroupStatus := map[string]map[string]bool{} c.Flags().VisitAll(func(pflag *flag.Flag) { processFlagForGroupAnnotation(flags, pflag, requiredAsGroupAnnotation, groupStatus) processFlagForGroupAnnotation(flags, pflag, oneRequiredAnnotation, oneRequiredGroupStatus) processFlagForGroupAnnotation(flags, pflag, mutuallyExclusiveAnnotation, mutuallyExclusiveGroupStatus) }) // If a flag that is part of a group is present, we make all the other flags // of that group required so that the shell completion suggests them automatically for flagList, flagnameAndStatus := range groupStatus { for _, isSet := range flagnameAndStatus { if isSet { // One of the flags of the group is set, mark the other ones as required for _, fName := range strings.Split(flagList, " ") { _ = c.MarkFlagRequired(fName) } } } } // If none of the flags of a one-required group are present, we make all the flags // of that group required so that the shell completion suggests them automatically for flagList, flagnameAndStatus := range oneRequiredGroupStatus { isSet := false for _, isSet = range flagnameAndStatus { if isSet { break } } // None of the flags of the group are set, mark all flags in the group // as required if !isSet { for _, fName := range strings.Split(flagList, " ") { _ = c.MarkFlagRequired(fName) } } } // If a flag that is mutually exclusive to others is present, we hide the other // flags of that group so the shell completion does not suggest them for flagList, flagnameAndStatus := range mutuallyExclusiveGroupStatus { for flagName, isSet := range flagnameAndStatus { if isSet { // One of the flags of the mutually exclusive group is set, mark the other ones as hidden // Don't mark the flag that is already set as hidden because it may be an // array or slice flag and therefore must continue being suggested for _, fName := range strings.Split(flagList, " ") { if fName != flagName { flag := c.Flags().Lookup(fName) flag.Hidden = true } } } } } } ================================================ FILE: vendor/github.com/spf13/cobra/powershell_completions.go ================================================ // Copyright 2013-2023 The Cobra Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // The generated scripts require PowerShell v5.0+ (which comes Windows 10, but // can be downloaded separately for windows 7 or 8.1). package cobra import ( "bytes" "fmt" "io" "os" "strings" ) func genPowerShellComp(buf io.StringWriter, name string, includeDesc bool) { // Variables should not contain a '-' or ':' character nameForVar := name nameForVar = strings.ReplaceAll(nameForVar, "-", "_") nameForVar = strings.ReplaceAll(nameForVar, ":", "_") compCmd := ShellCompRequestCmd if !includeDesc { compCmd = ShellCompNoDescRequestCmd } WriteStringAndCheck(buf, fmt.Sprintf(`# powershell completion for %-36[1]s -*- shell-script -*- function __%[1]s_debug { if ($env:BASH_COMP_DEBUG_FILE) { "$args" | Out-File -Append -FilePath "$env:BASH_COMP_DEBUG_FILE" } } filter __%[1]s_escapeStringWithSpecialChars { `+" $_ -replace '\\s|#|@|\\$|;|,|''|\\{|\\}|\\(|\\)|\"|`|\\||<|>|&','`$&'"+` } [scriptblock]${__%[2]sCompleterBlock} = { param( $WordToComplete, $CommandAst, $CursorPosition ) # Get the current command line and convert into a string $Command = $CommandAst.CommandElements $Command = "$Command" __%[1]s_debug "" __%[1]s_debug "========= starting completion logic ==========" __%[1]s_debug "WordToComplete: $WordToComplete Command: $Command CursorPosition: $CursorPosition" # The user could have moved the cursor backwards on the command-line. # We need to trigger completion from the $CursorPosition location, so we need # to truncate the command-line ($Command) up to the $CursorPosition location. # Make sure the $Command is longer then the $CursorPosition before we truncate. # This happens because the $Command does not include the last space. if ($Command.Length -gt $CursorPosition) { $Command=$Command.Substring(0,$CursorPosition) } __%[1]s_debug "Truncated command: $Command" $ShellCompDirectiveError=%[4]d $ShellCompDirectiveNoSpace=%[5]d $ShellCompDirectiveNoFileComp=%[6]d $ShellCompDirectiveFilterFileExt=%[7]d $ShellCompDirectiveFilterDirs=%[8]d $ShellCompDirectiveKeepOrder=%[9]d # Prepare the command to request completions for the program. # Split the command at the first space to separate the program and arguments. $Program,$Arguments = $Command.Split(" ",2) $RequestComp="$Program %[3]s $Arguments" __%[1]s_debug "RequestComp: $RequestComp" # we cannot use $WordToComplete because it # has the wrong values if the cursor was moved # so use the last argument if ($WordToComplete -ne "" ) { $WordToComplete = $Arguments.Split(" ")[-1] } __%[1]s_debug "New WordToComplete: $WordToComplete" # Check for flag with equal sign $IsEqualFlag = ($WordToComplete -Like "--*=*" ) if ( $IsEqualFlag ) { __%[1]s_debug "Completing equal sign flag" # Remove the flag part $Flag,$WordToComplete = $WordToComplete.Split("=",2) } if ( $WordToComplete -eq "" -And ( -Not $IsEqualFlag )) { # If the last parameter is complete (there is a space following it) # We add an extra empty parameter so we can indicate this to the go method. __%[1]s_debug "Adding extra empty parameter" # PowerShell 7.2+ changed the way how the arguments are passed to executables, # so for pre-7.2 or when Legacy argument passing is enabled we need to use `+" # `\"`\" to pass an empty argument, a \"\" or '' does not work!!!"+` if ($PSVersionTable.PsVersion -lt [version]'7.2.0' -or ($PSVersionTable.PsVersion -lt [version]'7.3.0' -and -not [ExperimentalFeature]::IsEnabled("PSNativeCommandArgumentPassing")) -or (($PSVersionTable.PsVersion -ge [version]'7.3.0' -or [ExperimentalFeature]::IsEnabled("PSNativeCommandArgumentPassing")) -and $PSNativeCommandArgumentPassing -eq 'Legacy')) { `+" $RequestComp=\"$RequestComp\" + ' `\"`\"'"+` } else { $RequestComp="$RequestComp" + ' ""' } } __%[1]s_debug "Calling $RequestComp" # First disable ActiveHelp which is not supported for Powershell ${env:%[10]s}=0 #call the command store the output in $out and redirect stderr and stdout to null # $Out is an array contains each line per element Invoke-Expression -OutVariable out "$RequestComp" 2>&1 | Out-Null # get directive from last line [int]$Directive = $Out[-1].TrimStart(':') if ($Directive -eq "") { # There is no directive specified $Directive = 0 } __%[1]s_debug "The completion directive is: $Directive" # remove directive (last element) from out $Out = $Out | Where-Object { $_ -ne $Out[-1] } __%[1]s_debug "The completions are: $Out" if (($Directive -band $ShellCompDirectiveError) -ne 0 ) { # Error code. No completion. __%[1]s_debug "Received error from custom completion go code" return } $Longest = 0 [Array]$Values = $Out | ForEach-Object { #Split the output in name and description `+" $Name, $Description = $_.Split(\"`t\",2)"+` __%[1]s_debug "Name: $Name Description: $Description" # Look for the longest completion so that we can format things nicely if ($Longest -lt $Name.Length) { $Longest = $Name.Length } # Set the description to a one space string if there is none set. # This is needed because the CompletionResult does not accept an empty string as argument if (-Not $Description) { $Description = " " } New-Object -TypeName PSCustomObject -Property @{ Name = "$Name" Description = "$Description" } } $Space = " " if (($Directive -band $ShellCompDirectiveNoSpace) -ne 0 ) { # remove the space here __%[1]s_debug "ShellCompDirectiveNoSpace is called" $Space = "" } if ((($Directive -band $ShellCompDirectiveFilterFileExt) -ne 0 ) -or (($Directive -band $ShellCompDirectiveFilterDirs) -ne 0 )) { __%[1]s_debug "ShellCompDirectiveFilterFileExt ShellCompDirectiveFilterDirs are not supported" # return here to prevent the completion of the extensions return } $Values = $Values | Where-Object { # filter the result $_.Name -like "$WordToComplete*" # Join the flag back if we have an equal sign flag if ( $IsEqualFlag ) { __%[1]s_debug "Join the equal sign flag back to the completion value" $_.Name = $Flag + "=" + $_.Name } } # we sort the values in ascending order by name if keep order isn't passed if (($Directive -band $ShellCompDirectiveKeepOrder) -eq 0 ) { $Values = $Values | Sort-Object -Property Name } if (($Directive -band $ShellCompDirectiveNoFileComp) -ne 0 ) { __%[1]s_debug "ShellCompDirectiveNoFileComp is called" if ($Values.Length -eq 0) { # Just print an empty string here so the # shell does not start to complete paths. # We cannot use CompletionResult here because # it does not accept an empty string as argument. "" return } } # Get the current mode $Mode = (Get-PSReadLineKeyHandler | Where-Object {$_.Key -eq "Tab" }).Function __%[1]s_debug "Mode: $Mode" $Values | ForEach-Object { # store temporary because switch will overwrite $_ $comp = $_ # PowerShell supports three different completion modes # - TabCompleteNext (default windows style - on each key press the next option is displayed) # - Complete (works like bash) # - MenuComplete (works like zsh) # You set the mode with Set-PSReadLineKeyHandler -Key Tab -Function # CompletionResult Arguments: # 1) CompletionText text to be used as the auto completion result # 2) ListItemText text to be displayed in the suggestion list # 3) ResultType type of completion result # 4) ToolTip text for the tooltip with details about the object switch ($Mode) { # bash like "Complete" { if ($Values.Length -eq 1) { __%[1]s_debug "Only one completion left" # insert space after value $CompletionText = $($comp.Name | __%[1]s_escapeStringWithSpecialChars) + $Space if ($ExecutionContext.SessionState.LanguageMode -eq "FullLanguage"){ [System.Management.Automation.CompletionResult]::new($CompletionText, "$($comp.Name)", 'ParameterValue', "$($comp.Description)") } else { $CompletionText } } else { # Add the proper number of spaces to align the descriptions while($comp.Name.Length -lt $Longest) { $comp.Name = $comp.Name + " " } # Check for empty description and only add parentheses if needed if ($($comp.Description) -eq " " ) { $Description = "" } else { $Description = " ($($comp.Description))" } $CompletionText = "$($comp.Name)$Description" if ($ExecutionContext.SessionState.LanguageMode -eq "FullLanguage"){ [System.Management.Automation.CompletionResult]::new($CompletionText, "$($comp.Name)$Description", 'ParameterValue', "$($comp.Description)") } else { $CompletionText } } } # zsh like "MenuComplete" { # insert space after value # MenuComplete will automatically show the ToolTip of # the highlighted value at the bottom of the suggestions. $CompletionText = $($comp.Name | __%[1]s_escapeStringWithSpecialChars) + $Space if ($ExecutionContext.SessionState.LanguageMode -eq "FullLanguage"){ [System.Management.Automation.CompletionResult]::new($CompletionText, "$($comp.Name)", 'ParameterValue', "$($comp.Description)") } else { $CompletionText } } # TabCompleteNext and in case we get something unknown Default { # Like MenuComplete but we don't want to add a space here because # the user need to press space anyway to get the completion. # Description will not be shown because that's not possible with TabCompleteNext $CompletionText = $($comp.Name | __%[1]s_escapeStringWithSpecialChars) if ($ExecutionContext.SessionState.LanguageMode -eq "FullLanguage"){ [System.Management.Automation.CompletionResult]::new($CompletionText, "$($comp.Name)", 'ParameterValue', "$($comp.Description)") } else { $CompletionText } } } } } Register-ArgumentCompleter -CommandName '%[1]s' -ScriptBlock ${__%[2]sCompleterBlock} `, name, nameForVar, compCmd, ShellCompDirectiveError, ShellCompDirectiveNoSpace, ShellCompDirectiveNoFileComp, ShellCompDirectiveFilterFileExt, ShellCompDirectiveFilterDirs, ShellCompDirectiveKeepOrder, activeHelpEnvVar(name))) } func (c *Command) genPowerShellCompletion(w io.Writer, includeDesc bool) error { buf := new(bytes.Buffer) genPowerShellComp(buf, c.Name(), includeDesc) _, err := buf.WriteTo(w) return err } func (c *Command) genPowerShellCompletionFile(filename string, includeDesc bool) error { outFile, err := os.Create(filename) if err != nil { return err } defer outFile.Close() return c.genPowerShellCompletion(outFile, includeDesc) } // GenPowerShellCompletionFile generates powershell completion file without descriptions. func (c *Command) GenPowerShellCompletionFile(filename string) error { return c.genPowerShellCompletionFile(filename, false) } // GenPowerShellCompletion generates powershell completion file without descriptions // and writes it to the passed writer. func (c *Command) GenPowerShellCompletion(w io.Writer) error { return c.genPowerShellCompletion(w, false) } // GenPowerShellCompletionFileWithDesc generates powershell completion file with descriptions. func (c *Command) GenPowerShellCompletionFileWithDesc(filename string) error { return c.genPowerShellCompletionFile(filename, true) } // GenPowerShellCompletionWithDesc generates powershell completion file with descriptions // and writes it to the passed writer. func (c *Command) GenPowerShellCompletionWithDesc(w io.Writer) error { return c.genPowerShellCompletion(w, true) } ================================================ FILE: vendor/github.com/spf13/cobra/shell_completions.go ================================================ // Copyright 2013-2023 The Cobra Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package cobra import ( "github.com/spf13/pflag" ) // MarkFlagRequired instructs the various shell completion implementations to // prioritize the named flag when performing completion, // and causes your command to report an error if invoked without the flag. func (c *Command) MarkFlagRequired(name string) error { return MarkFlagRequired(c.Flags(), name) } // MarkPersistentFlagRequired instructs the various shell completion implementations to // prioritize the named persistent flag when performing completion, // and causes your command to report an error if invoked without the flag. func (c *Command) MarkPersistentFlagRequired(name string) error { return MarkFlagRequired(c.PersistentFlags(), name) } // MarkFlagRequired instructs the various shell completion implementations to // prioritize the named flag when performing completion, // and causes your command to report an error if invoked without the flag. func MarkFlagRequired(flags *pflag.FlagSet, name string) error { return flags.SetAnnotation(name, BashCompOneRequiredFlag, []string{"true"}) } // MarkFlagFilename instructs the various shell completion implementations to // limit completions for the named flag to the specified file extensions. func (c *Command) MarkFlagFilename(name string, extensions ...string) error { return MarkFlagFilename(c.Flags(), name, extensions...) } // MarkFlagCustom adds the BashCompCustom annotation to the named flag, if it exists. // The bash completion script will call the bash function f for the flag. // // This will only work for bash completion. // It is recommended to instead use c.RegisterFlagCompletionFunc(...) which allows // to register a Go function which will work across all shells. func (c *Command) MarkFlagCustom(name string, f string) error { return MarkFlagCustom(c.Flags(), name, f) } // MarkPersistentFlagFilename instructs the various shell completion // implementations to limit completions for the named persistent flag to the // specified file extensions. func (c *Command) MarkPersistentFlagFilename(name string, extensions ...string) error { return MarkFlagFilename(c.PersistentFlags(), name, extensions...) } // MarkFlagFilename instructs the various shell completion implementations to // limit completions for the named flag to the specified file extensions. func MarkFlagFilename(flags *pflag.FlagSet, name string, extensions ...string) error { return flags.SetAnnotation(name, BashCompFilenameExt, extensions) } // MarkFlagCustom adds the BashCompCustom annotation to the named flag, if it exists. // The bash completion script will call the bash function f for the flag. // // This will only work for bash completion. // It is recommended to instead use c.RegisterFlagCompletionFunc(...) which allows // to register a Go function which will work across all shells. func MarkFlagCustom(flags *pflag.FlagSet, name string, f string) error { return flags.SetAnnotation(name, BashCompCustom, []string{f}) } // MarkFlagDirname instructs the various shell completion implementations to // limit completions for the named flag to directory names. func (c *Command) MarkFlagDirname(name string) error { return MarkFlagDirname(c.Flags(), name) } // MarkPersistentFlagDirname instructs the various shell completion // implementations to limit completions for the named persistent flag to // directory names. func (c *Command) MarkPersistentFlagDirname(name string) error { return MarkFlagDirname(c.PersistentFlags(), name) } // MarkFlagDirname instructs the various shell completion implementations to // limit completions for the named flag to directory names. func MarkFlagDirname(flags *pflag.FlagSet, name string) error { return flags.SetAnnotation(name, BashCompSubdirsInDir, []string{}) } ================================================ FILE: vendor/github.com/spf13/cobra/zsh_completions.go ================================================ // Copyright 2013-2023 The Cobra Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package cobra import ( "bytes" "fmt" "io" "os" ) // GenZshCompletionFile generates zsh completion file including descriptions. func (c *Command) GenZshCompletionFile(filename string) error { return c.genZshCompletionFile(filename, true) } // GenZshCompletion generates zsh completion file including descriptions // and writes it to the passed writer. func (c *Command) GenZshCompletion(w io.Writer) error { return c.genZshCompletion(w, true) } // GenZshCompletionFileNoDesc generates zsh completion file without descriptions. func (c *Command) GenZshCompletionFileNoDesc(filename string) error { return c.genZshCompletionFile(filename, false) } // GenZshCompletionNoDesc generates zsh completion file without descriptions // and writes it to the passed writer. func (c *Command) GenZshCompletionNoDesc(w io.Writer) error { return c.genZshCompletion(w, false) } // MarkZshCompPositionalArgumentFile only worked for zsh and its behavior was // not consistent with Bash completion. It has therefore been disabled. // Instead, when no other completion is specified, file completion is done by // default for every argument. One can disable file completion on a per-argument // basis by using ValidArgsFunction and ShellCompDirectiveNoFileComp. // To achieve file extension filtering, one can use ValidArgsFunction and // ShellCompDirectiveFilterFileExt. // // Deprecated func (c *Command) MarkZshCompPositionalArgumentFile(argPosition int, patterns ...string) error { return nil } // MarkZshCompPositionalArgumentWords only worked for zsh. It has therefore // been disabled. // To achieve the same behavior across all shells, one can use // ValidArgs (for the first argument only) or ValidArgsFunction for // any argument (can include the first one also). // // Deprecated func (c *Command) MarkZshCompPositionalArgumentWords(argPosition int, words ...string) error { return nil } func (c *Command) genZshCompletionFile(filename string, includeDesc bool) error { outFile, err := os.Create(filename) if err != nil { return err } defer outFile.Close() return c.genZshCompletion(outFile, includeDesc) } func (c *Command) genZshCompletion(w io.Writer, includeDesc bool) error { buf := new(bytes.Buffer) genZshComp(buf, c.Name(), includeDesc) _, err := buf.WriteTo(w) return err } func genZshComp(buf io.StringWriter, name string, includeDesc bool) { compCmd := ShellCompRequestCmd if !includeDesc { compCmd = ShellCompNoDescRequestCmd } WriteStringAndCheck(buf, fmt.Sprintf(`#compdef %[1]s compdef _%[1]s %[1]s # zsh completion for %-36[1]s -*- shell-script -*- __%[1]s_debug() { local file="$BASH_COMP_DEBUG_FILE" if [[ -n ${file} ]]; then echo "$*" >> "${file}" fi } _%[1]s() { local shellCompDirectiveError=%[3]d local shellCompDirectiveNoSpace=%[4]d local shellCompDirectiveNoFileComp=%[5]d local shellCompDirectiveFilterFileExt=%[6]d local shellCompDirectiveFilterDirs=%[7]d local shellCompDirectiveKeepOrder=%[8]d local lastParam lastChar flagPrefix requestComp out directive comp lastComp noSpace keepOrder local -a completions __%[1]s_debug "\n========= starting completion logic ==========" __%[1]s_debug "CURRENT: ${CURRENT}, words[*]: ${words[*]}" # The user could have moved the cursor backwards on the command-line. # We need to trigger completion from the $CURRENT location, so we need # to truncate the command-line ($words) up to the $CURRENT location. # (We cannot use $CURSOR as its value does not work when a command is an alias.) words=("${=words[1,CURRENT]}") __%[1]s_debug "Truncated words[*]: ${words[*]}," lastParam=${words[-1]} lastChar=${lastParam[-1]} __%[1]s_debug "lastParam: ${lastParam}, lastChar: ${lastChar}" # For zsh, when completing a flag with an = (e.g., %[1]s -n=) # completions must be prefixed with the flag setopt local_options BASH_REMATCH if [[ "${lastParam}" =~ '-.*=' ]]; then # We are dealing with a flag with an = flagPrefix="-P ${BASH_REMATCH}" fi # Prepare the command to obtain completions requestComp="${words[1]} %[2]s ${words[2,-1]}" if [ "${lastChar}" = "" ]; then # If the last parameter is complete (there is a space following it) # We add an extra empty parameter so we can indicate this to the go completion code. __%[1]s_debug "Adding extra empty parameter" requestComp="${requestComp} \"\"" fi __%[1]s_debug "About to call: eval ${requestComp}" # Use eval to handle any environment variables and such out=$(eval ${requestComp} 2>/dev/null) __%[1]s_debug "completion output: ${out}" # Extract the directive integer following a : from the last line local lastLine while IFS='\n' read -r line; do lastLine=${line} done < <(printf "%%s\n" "${out[@]}") __%[1]s_debug "last line: ${lastLine}" if [ "${lastLine[1]}" = : ]; then directive=${lastLine[2,-1]} # Remove the directive including the : and the newline local suffix (( suffix=${#lastLine}+2)) out=${out[1,-$suffix]} else # There is no directive specified. Leave $out as is. __%[1]s_debug "No directive found. Setting do default" directive=0 fi __%[1]s_debug "directive: ${directive}" __%[1]s_debug "completions: ${out}" __%[1]s_debug "flagPrefix: ${flagPrefix}" if [ $((directive & shellCompDirectiveError)) -ne 0 ]; then __%[1]s_debug "Completion received error. Ignoring completions." return fi local activeHelpMarker="%[9]s" local endIndex=${#activeHelpMarker} local startIndex=$((${#activeHelpMarker}+1)) local hasActiveHelp=0 while IFS='\n' read -r comp; do # Check if this is an activeHelp statement (i.e., prefixed with $activeHelpMarker) if [ "${comp[1,$endIndex]}" = "$activeHelpMarker" ];then __%[1]s_debug "ActiveHelp found: $comp" comp="${comp[$startIndex,-1]}" if [ -n "$comp" ]; then compadd -x "${comp}" __%[1]s_debug "ActiveHelp will need delimiter" hasActiveHelp=1 fi continue fi if [ -n "$comp" ]; then # If requested, completions are returned with a description. # The description is preceded by a TAB character. # For zsh's _describe, we need to use a : instead of a TAB. # We first need to escape any : as part of the completion itself. comp=${comp//:/\\:} local tab="$(printf '\t')" comp=${comp//$tab/:} __%[1]s_debug "Adding completion: ${comp}" completions+=${comp} lastComp=$comp fi done < <(printf "%%s\n" "${out[@]}") # Add a delimiter after the activeHelp statements, but only if: # - there are completions following the activeHelp statements, or # - file completion will be performed (so there will be choices after the activeHelp) if [ $hasActiveHelp -eq 1 ]; then if [ ${#completions} -ne 0 ] || [ $((directive & shellCompDirectiveNoFileComp)) -eq 0 ]; then __%[1]s_debug "Adding activeHelp delimiter" compadd -x "--" hasActiveHelp=0 fi fi if [ $((directive & shellCompDirectiveNoSpace)) -ne 0 ]; then __%[1]s_debug "Activating nospace." noSpace="-S ''" fi if [ $((directive & shellCompDirectiveKeepOrder)) -ne 0 ]; then __%[1]s_debug "Activating keep order." keepOrder="-V" fi if [ $((directive & shellCompDirectiveFilterFileExt)) -ne 0 ]; then # File extension filtering local filteringCmd filteringCmd='_files' for filter in ${completions[@]}; do if [ ${filter[1]} != '*' ]; then # zsh requires a glob pattern to do file filtering filter="\*.$filter" fi filteringCmd+=" -g $filter" done filteringCmd+=" ${flagPrefix}" __%[1]s_debug "File filtering command: $filteringCmd" _arguments '*:filename:'"$filteringCmd" elif [ $((directive & shellCompDirectiveFilterDirs)) -ne 0 ]; then # File completion for directories only local subdir subdir="${completions[1]}" if [ -n "$subdir" ]; then __%[1]s_debug "Listing directories in $subdir" pushd "${subdir}" >/dev/null 2>&1 else __%[1]s_debug "Listing directories in ." fi local result _arguments '*:dirname:_files -/'" ${flagPrefix}" result=$? if [ -n "$subdir" ]; then popd >/dev/null 2>&1 fi return $result else __%[1]s_debug "Calling _describe" if eval _describe $keepOrder "completions" completions $flagPrefix $noSpace; then __%[1]s_debug "_describe found some completions" # Return the success of having called _describe return 0 else __%[1]s_debug "_describe did not find completions." __%[1]s_debug "Checking if we should do file completion." if [ $((directive & shellCompDirectiveNoFileComp)) -ne 0 ]; then __%[1]s_debug "deactivating file completion" # We must return an error code here to let zsh know that there were no # completions found by _describe; this is what will trigger other # matching algorithms to attempt to find completions. # For example zsh can match letters in the middle of words. return 1 else # Perform file completion __%[1]s_debug "Activating file completion" # We must return the result of this command, so it must be the # last command, or else we must store its result to return it. _arguments '*:filename:_files'" ${flagPrefix}" fi fi fi } # don't run the completion function when being source-ed or eval-ed if [ "$funcstack[1]" = "_%[1]s" ]; then _%[1]s fi `, name, compCmd, ShellCompDirectiveError, ShellCompDirectiveNoSpace, ShellCompDirectiveNoFileComp, ShellCompDirectiveFilterFileExt, ShellCompDirectiveFilterDirs, ShellCompDirectiveKeepOrder, activeHelpMarker)) } ================================================ FILE: vendor/github.com/spf13/pflag/.editorconfig ================================================ root = true [*] charset = utf-8 end_of_line = lf indent_size = 4 indent_style = space insert_final_newline = true trim_trailing_whitespace = true [*.go] indent_style = tab ================================================ FILE: vendor/github.com/spf13/pflag/.gitignore ================================================ .idea/* ================================================ FILE: vendor/github.com/spf13/pflag/.golangci.yaml ================================================ linters: disable-all: true enable: - nolintlint ================================================ FILE: vendor/github.com/spf13/pflag/.travis.yml ================================================ sudo: false language: go go: - 1.9.x - 1.10.x - 1.11.x - tip matrix: allow_failures: - go: tip install: - go get golang.org/x/lint/golint - export PATH=$GOPATH/bin:$PATH - go install ./... script: - verify/all.sh -v - go test ./... ================================================ FILE: vendor/github.com/spf13/pflag/LICENSE ================================================ Copyright (c) 2012 Alex Ogier. All rights reserved. Copyright (c) 2012 The Go Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: vendor/github.com/spf13/pflag/README.md ================================================ [![Build Status](https://travis-ci.org/spf13/pflag.svg?branch=master)](https://travis-ci.org/spf13/pflag) [![Go Report Card](https://goreportcard.com/badge/github.com/spf13/pflag)](https://goreportcard.com/report/github.com/spf13/pflag) [![GoDoc](https://godoc.org/github.com/spf13/pflag?status.svg)](https://godoc.org/github.com/spf13/pflag) ## Description pflag is a drop-in replacement for Go's flag package, implementing POSIX/GNU-style --flags. pflag is compatible with the [GNU extensions to the POSIX recommendations for command-line options][1]. For a more precise description, see the "Command-line flag syntax" section below. [1]: http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html pflag is available under the same style of BSD license as the Go language, which can be found in the LICENSE file. ## Installation pflag is available using the standard `go get` command. Install by running: go get github.com/spf13/pflag Run tests by running: go test github.com/spf13/pflag ## Usage pflag is a drop-in replacement of Go's native flag package. If you import pflag under the name "flag" then all code should continue to function with no changes. ``` go import flag "github.com/spf13/pflag" ``` There is one exception to this: if you directly instantiate the Flag struct there is one more field "Shorthand" that you will need to set. Most code never instantiates this struct directly, and instead uses functions such as String(), BoolVar(), and Var(), and is therefore unaffected. Define flags using flag.String(), Bool(), Int(), etc. This declares an integer flag, -flagname, stored in the pointer ip, with type *int. ``` go var ip *int = flag.Int("flagname", 1234, "help message for flagname") ``` If you like, you can bind the flag to a variable using the Var() functions. ``` go var flagvar int func init() { flag.IntVar(&flagvar, "flagname", 1234, "help message for flagname") } ``` Or you can create custom flags that satisfy the Value interface (with pointer receivers) and couple them to flag parsing by ``` go flag.Var(&flagVal, "name", "help message for flagname") ``` For such flags, the default value is just the initial value of the variable. After all flags are defined, call ``` go flag.Parse() ``` to parse the command line into the defined flags. Flags may then be used directly. If you're using the flags themselves, they are all pointers; if you bind to variables, they're values. ``` go fmt.Println("ip has value ", *ip) fmt.Println("flagvar has value ", flagvar) ``` There are helper functions available to get the value stored in a Flag if you have a FlagSet but find it difficult to keep up with all of the pointers in your code. If you have a pflag.FlagSet with a flag called 'flagname' of type int you can use GetInt() to get the int value. But notice that 'flagname' must exist and it must be an int. GetString("flagname") will fail. ``` go i, err := flagset.GetInt("flagname") ``` After parsing, the arguments after the flag are available as the slice flag.Args() or individually as flag.Arg(i). The arguments are indexed from 0 through flag.NArg()-1. The pflag package also defines some new functions that are not in flag, that give one-letter shorthands for flags. You can use these by appending 'P' to the name of any function that defines a flag. ``` go var ip = flag.IntP("flagname", "f", 1234, "help message") var flagvar bool func init() { flag.BoolVarP(&flagvar, "boolname", "b", true, "help message") } flag.VarP(&flagVal, "varname", "v", "help message") ``` Shorthand letters can be used with single dashes on the command line. Boolean shorthand flags can be combined with other shorthand flags. The default set of command-line flags is controlled by top-level functions. The FlagSet type allows one to define independent sets of flags, such as to implement subcommands in a command-line interface. The methods of FlagSet are analogous to the top-level functions for the command-line flag set. ## Setting no option default values for flags After you create a flag it is possible to set the pflag.NoOptDefVal for the given flag. Doing this changes the meaning of the flag slightly. If a flag has a NoOptDefVal and the flag is set on the command line without an option the flag will be set to the NoOptDefVal. For example given: ``` go var ip = flag.IntP("flagname", "f", 1234, "help message") flag.Lookup("flagname").NoOptDefVal = "4321" ``` Would result in something like | Parsed Arguments | Resulting Value | | ------------- | ------------- | | --flagname=1357 | ip=1357 | | --flagname | ip=4321 | | [nothing] | ip=1234 | ## Command line flag syntax ``` --flag // boolean flags, or flags with no option default values --flag x // only on flags without a default value --flag=x ``` Unlike the flag package, a single dash before an option means something different than a double dash. Single dashes signify a series of shorthand letters for flags. All but the last shorthand letter must be boolean flags or a flag with a default value ``` // boolean or flags where the 'no option default value' is set -f -f=true -abc but -b true is INVALID // non-boolean and flags without a 'no option default value' -n 1234 -n=1234 -n1234 // mixed -abcs "hello" -absd="hello" -abcs1234 ``` Flag parsing stops after the terminator "--". Unlike the flag package, flags can be interspersed with arguments anywhere on the command line before this terminator. Integer flags accept 1234, 0664, 0x1234 and may be negative. Boolean flags (in their long form) accept 1, 0, t, f, true, false, TRUE, FALSE, True, False. Duration flags accept any input valid for time.ParseDuration. ## Mutating or "Normalizing" Flag names It 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. **Example #1**: You want -, _, and . in flags to compare the same. aka --my-flag == --my_flag == --my.flag ``` go func wordSepNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName { from := []string{"-", "_"} to := "." for _, sep := range from { name = strings.Replace(name, sep, to, -1) } return pflag.NormalizedName(name) } myFlagSet.SetNormalizeFunc(wordSepNormalizeFunc) ``` **Example #2**: You want to alias two flags. aka --old-flag-name == --new-flag-name ``` go func aliasNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName { switch name { case "old-flag-name": name = "new-flag-name" break } return pflag.NormalizedName(name) } myFlagSet.SetNormalizeFunc(aliasNormalizeFunc) ``` ## Deprecating a flag or its shorthand It 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. **Example #1**: You want to deprecate a flag named "badflag" as well as inform the users what flag they should use instead. ```go // deprecate a flag by specifying its name and a usage message flags.MarkDeprecated("badflag", "please use --good-flag instead") ``` This hides "badflag" from help text, and prints `Flag --badflag has been deprecated, please use --good-flag instead` when "badflag" is used. **Example #2**: You want to keep a flag name "noshorthandflag" but deprecate its shortname "n". ```go // deprecate a flag shorthand by specifying its flag name and a usage message flags.MarkShorthandDeprecated("noshorthandflag", "please use --noshorthandflag only") ``` This 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. Note that usage message is essential here, and it should not be empty. ## Hidden flags It is possible to mark a flag as hidden, meaning it will still function as normal, however will not show up in usage/help text. **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. ```go // hide a flag by specifying its name flags.MarkHidden("secretFlag") ``` ## Disable sorting of flags `pflag` allows you to disable sorting of flags for help and usage message. **Example**: ```go flags.BoolP("verbose", "v", false, "verbose output") flags.String("coolflag", "yeaah", "it's really cool flag") flags.Int("usefulflag", 777, "sometimes it's very useful") flags.SortFlags = false flags.PrintDefaults() ``` **Output**: ``` -v, --verbose verbose output --coolflag string it's really cool flag (default "yeaah") --usefulflag int sometimes it's very useful (default 777) ``` ## Supporting Go flags when using pflag In order to support flags defined using Go's `flag` package, they must be added to the `pflag` flagset. This is usually necessary to support flags defined by third-party dependencies (e.g. `golang/glog`). **Example**: You want to add the Go flags to the `CommandLine` flagset ```go import ( goflag "flag" flag "github.com/spf13/pflag" ) var ip *int = flag.Int("flagname", 1234, "help message for flagname") func main() { flag.CommandLine.AddGoFlagSet(goflag.CommandLine) flag.Parse() } ``` ### Using pflag with go test `pflag` does not parse the shorthand versions of go test's built-in flags (i.e., those starting with `-test.`). For more context, see issues [#63](https://github.com/spf13/pflag/issues/63) and [#238](https://github.com/spf13/pflag/issues/238) for more details. For example, if you use pflag in your `TestMain` function and call `pflag.Parse()` after defining your custom flags, running a test like this: ```bash go test /your/tests -run ^YourTest -v --your-test-pflags ``` will result in the `-v` flag being ignored. This happens because of the way pflag handles flag parsing, skipping over go test's built-in shorthand flags. To work around this, you can use the `ParseSkippedFlags` function, which ensures that go test's flags are parsed separately using the standard flag package. **Example**: You want to parse go test flags that are otherwise ignore by `pflag.Parse()` ```go import ( goflag "flag" flag "github.com/spf13/pflag" ) var ip *int = flag.Int("flagname", 1234, "help message for flagname") func main() { flag.CommandLine.AddGoFlagSet(goflag.CommandLine) flag.ParseSkippedFlags(os.Args[1:], goflag.CommandLine) flag.Parse() } ``` ## More info You can see the full reference documentation of the pflag package [at godoc.org][3], or through go's standard documentation system by running `godoc -http=:6060` and browsing to [http://localhost:6060/pkg/github.com/spf13/pflag][2] after installation. [2]: http://localhost:6060/pkg/github.com/spf13/pflag [3]: http://godoc.org/github.com/spf13/pflag ================================================ FILE: vendor/github.com/spf13/pflag/bool.go ================================================ package pflag import "strconv" // optional interface to indicate boolean flags that can be // supplied without "=value" text type boolFlag interface { Value IsBoolFlag() bool } // -- bool Value type boolValue bool func newBoolValue(val bool, p *bool) *boolValue { *p = val return (*boolValue)(p) } func (b *boolValue) Set(s string) error { v, err := strconv.ParseBool(s) *b = boolValue(v) return err } func (b *boolValue) Type() string { return "bool" } func (b *boolValue) String() string { return strconv.FormatBool(bool(*b)) } func (b *boolValue) IsBoolFlag() bool { return true } func boolConv(sval string) (interface{}, error) { return strconv.ParseBool(sval) } // GetBool return the bool value of a flag with the given name func (f *FlagSet) GetBool(name string) (bool, error) { val, err := f.getFlagType(name, "bool", boolConv) if err != nil { return false, err } return val.(bool), nil } // BoolVar defines a bool flag with specified name, default value, and usage string. // The argument p points to a bool variable in which to store the value of the flag. func (f *FlagSet) BoolVar(p *bool, name string, value bool, usage string) { f.BoolVarP(p, name, "", value, usage) } // BoolVarP is like BoolVar, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) BoolVarP(p *bool, name, shorthand string, value bool, usage string) { flag := f.VarPF(newBoolValue(value, p), name, shorthand, usage) flag.NoOptDefVal = "true" } // BoolVar defines a bool flag with specified name, default value, and usage string. // The argument p points to a bool variable in which to store the value of the flag. func BoolVar(p *bool, name string, value bool, usage string) { BoolVarP(p, name, "", value, usage) } // BoolVarP is like BoolVar, but accepts a shorthand letter that can be used after a single dash. func BoolVarP(p *bool, name, shorthand string, value bool, usage string) { flag := CommandLine.VarPF(newBoolValue(value, p), name, shorthand, usage) flag.NoOptDefVal = "true" } // Bool defines a bool flag with specified name, default value, and usage string. // The return value is the address of a bool variable that stores the value of the flag. func (f *FlagSet) Bool(name string, value bool, usage string) *bool { return f.BoolP(name, "", value, usage) } // BoolP is like Bool, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) BoolP(name, shorthand string, value bool, usage string) *bool { p := new(bool) f.BoolVarP(p, name, shorthand, value, usage) return p } // Bool defines a bool flag with specified name, default value, and usage string. // The return value is the address of a bool variable that stores the value of the flag. func Bool(name string, value bool, usage string) *bool { return BoolP(name, "", value, usage) } // BoolP is like Bool, but accepts a shorthand letter that can be used after a single dash. func BoolP(name, shorthand string, value bool, usage string) *bool { b := CommandLine.BoolP(name, shorthand, value, usage) return b } ================================================ FILE: vendor/github.com/spf13/pflag/bool_func.go ================================================ package pflag // -- func Value type boolfuncValue func(string) error func (f boolfuncValue) Set(s string) error { return f(s) } func (f boolfuncValue) Type() string { return "boolfunc" } func (f boolfuncValue) String() string { return "" } // same behavior as stdlib 'flag' package func (f boolfuncValue) IsBoolFlag() bool { return true } // BoolFunc defines a func flag with specified name, callback function and usage string. // // The callback function will be called every time "--{name}" (or any form that matches the flag) is parsed // on the command line. func (f *FlagSet) BoolFunc(name string, usage string, fn func(string) error) { f.BoolFuncP(name, "", usage, fn) } // BoolFuncP is like BoolFunc, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) BoolFuncP(name, shorthand string, usage string, fn func(string) error) { var val Value = boolfuncValue(fn) flag := f.VarPF(val, name, shorthand, usage) flag.NoOptDefVal = "true" } // BoolFunc defines a func flag with specified name, callback function and usage string. // // The callback function will be called every time "--{name}" (or any form that matches the flag) is parsed // on the command line. func BoolFunc(name string, usage string, fn func(string) error) { CommandLine.BoolFuncP(name, "", usage, fn) } // BoolFuncP is like BoolFunc, but accepts a shorthand letter that can be used after a single dash. func BoolFuncP(name, shorthand string, usage string, fn func(string) error) { CommandLine.BoolFuncP(name, shorthand, usage, fn) } ================================================ FILE: vendor/github.com/spf13/pflag/bool_slice.go ================================================ package pflag import ( "io" "strconv" "strings" ) // -- boolSlice Value type boolSliceValue struct { value *[]bool changed bool } func newBoolSliceValue(val []bool, p *[]bool) *boolSliceValue { bsv := new(boolSliceValue) bsv.value = p *bsv.value = val return bsv } // Set converts, and assigns, the comma-separated boolean argument string representation as the []bool value of this flag. // If Set is called on a flag that already has a []bool assigned, the newly converted values will be appended. func (s *boolSliceValue) Set(val string) error { // remove all quote characters rmQuote := strings.NewReplacer(`"`, "", `'`, "", "`", "") // read flag arguments with CSV parser boolStrSlice, err := readAsCSV(rmQuote.Replace(val)) if err != nil && err != io.EOF { return err } // parse boolean values into slice out := make([]bool, 0, len(boolStrSlice)) for _, boolStr := range boolStrSlice { b, err := strconv.ParseBool(strings.TrimSpace(boolStr)) if err != nil { return err } out = append(out, b) } if !s.changed { *s.value = out } else { *s.value = append(*s.value, out...) } s.changed = true return nil } // Type returns a string that uniquely represents this flag's type. func (s *boolSliceValue) Type() string { return "boolSlice" } // String defines a "native" format for this boolean slice flag value. func (s *boolSliceValue) String() string { boolStrSlice := make([]string, len(*s.value)) for i, b := range *s.value { boolStrSlice[i] = strconv.FormatBool(b) } out, _ := writeAsCSV(boolStrSlice) return "[" + out + "]" } func (s *boolSliceValue) fromString(val string) (bool, error) { return strconv.ParseBool(val) } func (s *boolSliceValue) toString(val bool) string { return strconv.FormatBool(val) } func (s *boolSliceValue) Append(val string) error { i, err := s.fromString(val) if err != nil { return err } *s.value = append(*s.value, i) return nil } func (s *boolSliceValue) Replace(val []string) error { out := make([]bool, len(val)) for i, d := range val { var err error out[i], err = s.fromString(d) if err != nil { return err } } *s.value = out return nil } func (s *boolSliceValue) GetSlice() []string { out := make([]string, len(*s.value)) for i, d := range *s.value { out[i] = s.toString(d) } return out } func boolSliceConv(val string) (interface{}, error) { val = strings.Trim(val, "[]") // Empty string would cause a slice with one (empty) entry if len(val) == 0 { return []bool{}, nil } ss := strings.Split(val, ",") out := make([]bool, len(ss)) for i, t := range ss { var err error out[i], err = strconv.ParseBool(t) if err != nil { return nil, err } } return out, nil } // GetBoolSlice returns the []bool value of a flag with the given name. func (f *FlagSet) GetBoolSlice(name string) ([]bool, error) { val, err := f.getFlagType(name, "boolSlice", boolSliceConv) if err != nil { return []bool{}, err } return val.([]bool), nil } // BoolSliceVar defines a boolSlice flag with specified name, default value, and usage string. // The argument p points to a []bool variable in which to store the value of the flag. func (f *FlagSet) BoolSliceVar(p *[]bool, name string, value []bool, usage string) { f.VarP(newBoolSliceValue(value, p), name, "", usage) } // BoolSliceVarP is like BoolSliceVar, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) BoolSliceVarP(p *[]bool, name, shorthand string, value []bool, usage string) { f.VarP(newBoolSliceValue(value, p), name, shorthand, usage) } // BoolSliceVar defines a []bool flag with specified name, default value, and usage string. // The argument p points to a []bool variable in which to store the value of the flag. func BoolSliceVar(p *[]bool, name string, value []bool, usage string) { CommandLine.VarP(newBoolSliceValue(value, p), name, "", usage) } // BoolSliceVarP is like BoolSliceVar, but accepts a shorthand letter that can be used after a single dash. func BoolSliceVarP(p *[]bool, name, shorthand string, value []bool, usage string) { CommandLine.VarP(newBoolSliceValue(value, p), name, shorthand, usage) } // BoolSlice defines a []bool flag with specified name, default value, and usage string. // The return value is the address of a []bool variable that stores the value of the flag. func (f *FlagSet) BoolSlice(name string, value []bool, usage string) *[]bool { p := []bool{} f.BoolSliceVarP(&p, name, "", value, usage) return &p } // BoolSliceP is like BoolSlice, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) BoolSliceP(name, shorthand string, value []bool, usage string) *[]bool { p := []bool{} f.BoolSliceVarP(&p, name, shorthand, value, usage) return &p } // BoolSlice defines a []bool flag with specified name, default value, and usage string. // The return value is the address of a []bool variable that stores the value of the flag. func BoolSlice(name string, value []bool, usage string) *[]bool { return CommandLine.BoolSliceP(name, "", value, usage) } // BoolSliceP is like BoolSlice, but accepts a shorthand letter that can be used after a single dash. func BoolSliceP(name, shorthand string, value []bool, usage string) *[]bool { return CommandLine.BoolSliceP(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/bytes.go ================================================ package pflag import ( "encoding/base64" "encoding/hex" "fmt" "strings" ) // BytesHex adapts []byte for use as a flag. Value of flag is HEX encoded type bytesHexValue []byte // String implements pflag.Value.String. func (bytesHex bytesHexValue) String() string { return fmt.Sprintf("%X", []byte(bytesHex)) } // Set implements pflag.Value.Set. func (bytesHex *bytesHexValue) Set(value string) error { bin, err := hex.DecodeString(strings.TrimSpace(value)) if err != nil { return err } *bytesHex = bin return nil } // Type implements pflag.Value.Type. func (*bytesHexValue) Type() string { return "bytesHex" } func newBytesHexValue(val []byte, p *[]byte) *bytesHexValue { *p = val return (*bytesHexValue)(p) } func bytesHexConv(sval string) (interface{}, error) { bin, err := hex.DecodeString(sval) if err == nil { return bin, nil } return nil, fmt.Errorf("invalid string being converted to Bytes: %s %s", sval, err) } // GetBytesHex return the []byte value of a flag with the given name func (f *FlagSet) GetBytesHex(name string) ([]byte, error) { val, err := f.getFlagType(name, "bytesHex", bytesHexConv) if err != nil { return []byte{}, err } return val.([]byte), nil } // BytesHexVar defines an []byte flag with specified name, default value, and usage string. // The argument p points to an []byte variable in which to store the value of the flag. func (f *FlagSet) BytesHexVar(p *[]byte, name string, value []byte, usage string) { f.VarP(newBytesHexValue(value, p), name, "", usage) } // BytesHexVarP is like BytesHexVar, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) BytesHexVarP(p *[]byte, name, shorthand string, value []byte, usage string) { f.VarP(newBytesHexValue(value, p), name, shorthand, usage) } // BytesHexVar defines an []byte flag with specified name, default value, and usage string. // The argument p points to an []byte variable in which to store the value of the flag. func BytesHexVar(p *[]byte, name string, value []byte, usage string) { CommandLine.VarP(newBytesHexValue(value, p), name, "", usage) } // BytesHexVarP is like BytesHexVar, but accepts a shorthand letter that can be used after a single dash. func BytesHexVarP(p *[]byte, name, shorthand string, value []byte, usage string) { CommandLine.VarP(newBytesHexValue(value, p), name, shorthand, usage) } // BytesHex defines an []byte flag with specified name, default value, and usage string. // The return value is the address of an []byte variable that stores the value of the flag. func (f *FlagSet) BytesHex(name string, value []byte, usage string) *[]byte { p := new([]byte) f.BytesHexVarP(p, name, "", value, usage) return p } // BytesHexP is like BytesHex, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) BytesHexP(name, shorthand string, value []byte, usage string) *[]byte { p := new([]byte) f.BytesHexVarP(p, name, shorthand, value, usage) return p } // BytesHex defines an []byte flag with specified name, default value, and usage string. // The return value is the address of an []byte variable that stores the value of the flag. func BytesHex(name string, value []byte, usage string) *[]byte { return CommandLine.BytesHexP(name, "", value, usage) } // BytesHexP is like BytesHex, but accepts a shorthand letter that can be used after a single dash. func BytesHexP(name, shorthand string, value []byte, usage string) *[]byte { return CommandLine.BytesHexP(name, shorthand, value, usage) } // BytesBase64 adapts []byte for use as a flag. Value of flag is Base64 encoded type bytesBase64Value []byte // String implements pflag.Value.String. func (bytesBase64 bytesBase64Value) String() string { return base64.StdEncoding.EncodeToString([]byte(bytesBase64)) } // Set implements pflag.Value.Set. func (bytesBase64 *bytesBase64Value) Set(value string) error { bin, err := base64.StdEncoding.DecodeString(strings.TrimSpace(value)) if err != nil { return err } *bytesBase64 = bin return nil } // Type implements pflag.Value.Type. func (*bytesBase64Value) Type() string { return "bytesBase64" } func newBytesBase64Value(val []byte, p *[]byte) *bytesBase64Value { *p = val return (*bytesBase64Value)(p) } func bytesBase64ValueConv(sval string) (interface{}, error) { bin, err := base64.StdEncoding.DecodeString(sval) if err == nil { return bin, nil } return nil, fmt.Errorf("invalid string being converted to Bytes: %s %s", sval, err) } // GetBytesBase64 return the []byte value of a flag with the given name func (f *FlagSet) GetBytesBase64(name string) ([]byte, error) { val, err := f.getFlagType(name, "bytesBase64", bytesBase64ValueConv) if err != nil { return []byte{}, err } return val.([]byte), nil } // BytesBase64Var defines an []byte flag with specified name, default value, and usage string. // The argument p points to an []byte variable in which to store the value of the flag. func (f *FlagSet) BytesBase64Var(p *[]byte, name string, value []byte, usage string) { f.VarP(newBytesBase64Value(value, p), name, "", usage) } // BytesBase64VarP is like BytesBase64Var, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) BytesBase64VarP(p *[]byte, name, shorthand string, value []byte, usage string) { f.VarP(newBytesBase64Value(value, p), name, shorthand, usage) } // BytesBase64Var defines an []byte flag with specified name, default value, and usage string. // The argument p points to an []byte variable in which to store the value of the flag. func BytesBase64Var(p *[]byte, name string, value []byte, usage string) { CommandLine.VarP(newBytesBase64Value(value, p), name, "", usage) } // BytesBase64VarP is like BytesBase64Var, but accepts a shorthand letter that can be used after a single dash. func BytesBase64VarP(p *[]byte, name, shorthand string, value []byte, usage string) { CommandLine.VarP(newBytesBase64Value(value, p), name, shorthand, usage) } // BytesBase64 defines an []byte flag with specified name, default value, and usage string. // The return value is the address of an []byte variable that stores the value of the flag. func (f *FlagSet) BytesBase64(name string, value []byte, usage string) *[]byte { p := new([]byte) f.BytesBase64VarP(p, name, "", value, usage) return p } // BytesBase64P is like BytesBase64, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) BytesBase64P(name, shorthand string, value []byte, usage string) *[]byte { p := new([]byte) f.BytesBase64VarP(p, name, shorthand, value, usage) return p } // BytesBase64 defines an []byte flag with specified name, default value, and usage string. // The return value is the address of an []byte variable that stores the value of the flag. func BytesBase64(name string, value []byte, usage string) *[]byte { return CommandLine.BytesBase64P(name, "", value, usage) } // BytesBase64P is like BytesBase64, but accepts a shorthand letter that can be used after a single dash. func BytesBase64P(name, shorthand string, value []byte, usage string) *[]byte { return CommandLine.BytesBase64P(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/count.go ================================================ package pflag import "strconv" // -- count Value type countValue int func newCountValue(val int, p *int) *countValue { *p = val return (*countValue)(p) } func (i *countValue) Set(s string) error { // "+1" means that no specific value was passed, so increment if s == "+1" { *i = countValue(*i + 1) return nil } v, err := strconv.ParseInt(s, 0, 0) *i = countValue(v) return err } func (i *countValue) Type() string { return "count" } func (i *countValue) String() string { return strconv.Itoa(int(*i)) } func countConv(sval string) (interface{}, error) { i, err := strconv.Atoi(sval) if err != nil { return nil, err } return i, nil } // GetCount return the int value of a flag with the given name func (f *FlagSet) GetCount(name string) (int, error) { val, err := f.getFlagType(name, "count", countConv) if err != nil { return 0, err } return val.(int), nil } // CountVar defines a count flag with specified name, default value, and usage string. // The argument p points to an int variable in which to store the value of the flag. // A count flag will add 1 to its value every time it is found on the command line func (f *FlagSet) CountVar(p *int, name string, usage string) { f.CountVarP(p, name, "", usage) } // CountVarP is like CountVar only take a shorthand for the flag name. func (f *FlagSet) CountVarP(p *int, name, shorthand string, usage string) { flag := f.VarPF(newCountValue(0, p), name, shorthand, usage) flag.NoOptDefVal = "+1" } // CountVar like CountVar only the flag is placed on the CommandLine instead of a given flag set func CountVar(p *int, name string, usage string) { CommandLine.CountVar(p, name, usage) } // CountVarP is like CountVar only take a shorthand for the flag name. func CountVarP(p *int, name, shorthand string, usage string) { CommandLine.CountVarP(p, name, shorthand, usage) } // Count defines a count flag with specified name, default value, and usage string. // The return value is the address of an int variable that stores the value of the flag. // A count flag will add 1 to its value every time it is found on the command line func (f *FlagSet) Count(name string, usage string) *int { p := new(int) f.CountVarP(p, name, "", usage) return p } // CountP is like Count only takes a shorthand for the flag name. func (f *FlagSet) CountP(name, shorthand string, usage string) *int { p := new(int) f.CountVarP(p, name, shorthand, usage) return p } // Count defines a count flag with specified name, default value, and usage string. // The return value is the address of an int variable that stores the value of the flag. // A count flag will add 1 to its value every time it is found on the command line func Count(name string, usage string) *int { return CommandLine.CountP(name, "", usage) } // CountP is like Count only takes a shorthand for the flag name. func CountP(name, shorthand string, usage string) *int { return CommandLine.CountP(name, shorthand, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/duration.go ================================================ package pflag import ( "time" ) // -- time.Duration Value type durationValue time.Duration func newDurationValue(val time.Duration, p *time.Duration) *durationValue { *p = val return (*durationValue)(p) } func (d *durationValue) Set(s string) error { v, err := time.ParseDuration(s) *d = durationValue(v) return err } func (d *durationValue) Type() string { return "duration" } func (d *durationValue) String() string { return (*time.Duration)(d).String() } func durationConv(sval string) (interface{}, error) { return time.ParseDuration(sval) } // GetDuration return the duration value of a flag with the given name func (f *FlagSet) GetDuration(name string) (time.Duration, error) { val, err := f.getFlagType(name, "duration", durationConv) if err != nil { return 0, err } return val.(time.Duration), nil } // DurationVar defines a time.Duration flag with specified name, default value, and usage string. // The argument p points to a time.Duration variable in which to store the value of the flag. func (f *FlagSet) DurationVar(p *time.Duration, name string, value time.Duration, usage string) { f.VarP(newDurationValue(value, p), name, "", usage) } // DurationVarP is like DurationVar, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) DurationVarP(p *time.Duration, name, shorthand string, value time.Duration, usage string) { f.VarP(newDurationValue(value, p), name, shorthand, usage) } // DurationVar defines a time.Duration flag with specified name, default value, and usage string. // The argument p points to a time.Duration variable in which to store the value of the flag. func DurationVar(p *time.Duration, name string, value time.Duration, usage string) { CommandLine.VarP(newDurationValue(value, p), name, "", usage) } // DurationVarP is like DurationVar, but accepts a shorthand letter that can be used after a single dash. func DurationVarP(p *time.Duration, name, shorthand string, value time.Duration, usage string) { CommandLine.VarP(newDurationValue(value, p), name, shorthand, usage) } // Duration defines a time.Duration flag with specified name, default value, and usage string. // The return value is the address of a time.Duration variable that stores the value of the flag. func (f *FlagSet) Duration(name string, value time.Duration, usage string) *time.Duration { p := new(time.Duration) f.DurationVarP(p, name, "", value, usage) return p } // DurationP is like Duration, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) DurationP(name, shorthand string, value time.Duration, usage string) *time.Duration { p := new(time.Duration) f.DurationVarP(p, name, shorthand, value, usage) return p } // Duration defines a time.Duration flag with specified name, default value, and usage string. // The return value is the address of a time.Duration variable that stores the value of the flag. func Duration(name string, value time.Duration, usage string) *time.Duration { return CommandLine.DurationP(name, "", value, usage) } // DurationP is like Duration, but accepts a shorthand letter that can be used after a single dash. func DurationP(name, shorthand string, value time.Duration, usage string) *time.Duration { return CommandLine.DurationP(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/duration_slice.go ================================================ package pflag import ( "fmt" "strings" "time" ) // -- durationSlice Value type durationSliceValue struct { value *[]time.Duration changed bool } func newDurationSliceValue(val []time.Duration, p *[]time.Duration) *durationSliceValue { dsv := new(durationSliceValue) dsv.value = p *dsv.value = val return dsv } func (s *durationSliceValue) Set(val string) error { ss := strings.Split(val, ",") out := make([]time.Duration, len(ss)) for i, d := range ss { var err error out[i], err = time.ParseDuration(d) if err != nil { return err } } if !s.changed { *s.value = out } else { *s.value = append(*s.value, out...) } s.changed = true return nil } func (s *durationSliceValue) Type() string { return "durationSlice" } func (s *durationSliceValue) String() string { out := make([]string, len(*s.value)) for i, d := range *s.value { out[i] = fmt.Sprintf("%s", d) } return "[" + strings.Join(out, ",") + "]" } func (s *durationSliceValue) fromString(val string) (time.Duration, error) { return time.ParseDuration(val) } func (s *durationSliceValue) toString(val time.Duration) string { return fmt.Sprintf("%s", val) } func (s *durationSliceValue) Append(val string) error { i, err := s.fromString(val) if err != nil { return err } *s.value = append(*s.value, i) return nil } func (s *durationSliceValue) Replace(val []string) error { out := make([]time.Duration, len(val)) for i, d := range val { var err error out[i], err = s.fromString(d) if err != nil { return err } } *s.value = out return nil } func (s *durationSliceValue) GetSlice() []string { out := make([]string, len(*s.value)) for i, d := range *s.value { out[i] = s.toString(d) } return out } func durationSliceConv(val string) (interface{}, error) { val = strings.Trim(val, "[]") // Empty string would cause a slice with one (empty) entry if len(val) == 0 { return []time.Duration{}, nil } ss := strings.Split(val, ",") out := make([]time.Duration, len(ss)) for i, d := range ss { var err error out[i], err = time.ParseDuration(d) if err != nil { return nil, err } } return out, nil } // GetDurationSlice returns the []time.Duration value of a flag with the given name func (f *FlagSet) GetDurationSlice(name string) ([]time.Duration, error) { val, err := f.getFlagType(name, "durationSlice", durationSliceConv) if err != nil { return []time.Duration{}, err } return val.([]time.Duration), nil } // DurationSliceVar defines a durationSlice flag with specified name, default value, and usage string. // The argument p points to a []time.Duration variable in which to store the value of the flag. func (f *FlagSet) DurationSliceVar(p *[]time.Duration, name string, value []time.Duration, usage string) { f.VarP(newDurationSliceValue(value, p), name, "", usage) } // DurationSliceVarP is like DurationSliceVar, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) DurationSliceVarP(p *[]time.Duration, name, shorthand string, value []time.Duration, usage string) { f.VarP(newDurationSliceValue(value, p), name, shorthand, usage) } // DurationSliceVar defines a duration[] flag with specified name, default value, and usage string. // The argument p points to a duration[] variable in which to store the value of the flag. func DurationSliceVar(p *[]time.Duration, name string, value []time.Duration, usage string) { CommandLine.VarP(newDurationSliceValue(value, p), name, "", usage) } // DurationSliceVarP is like DurationSliceVar, but accepts a shorthand letter that can be used after a single dash. func DurationSliceVarP(p *[]time.Duration, name, shorthand string, value []time.Duration, usage string) { CommandLine.VarP(newDurationSliceValue(value, p), name, shorthand, usage) } // DurationSlice defines a []time.Duration flag with specified name, default value, and usage string. // The return value is the address of a []time.Duration variable that stores the value of the flag. func (f *FlagSet) DurationSlice(name string, value []time.Duration, usage string) *[]time.Duration { p := []time.Duration{} f.DurationSliceVarP(&p, name, "", value, usage) return &p } // DurationSliceP is like DurationSlice, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) DurationSliceP(name, shorthand string, value []time.Duration, usage string) *[]time.Duration { p := []time.Duration{} f.DurationSliceVarP(&p, name, shorthand, value, usage) return &p } // DurationSlice defines a []time.Duration flag with specified name, default value, and usage string. // The return value is the address of a []time.Duration variable that stores the value of the flag. func DurationSlice(name string, value []time.Duration, usage string) *[]time.Duration { return CommandLine.DurationSliceP(name, "", value, usage) } // DurationSliceP is like DurationSlice, but accepts a shorthand letter that can be used after a single dash. func DurationSliceP(name, shorthand string, value []time.Duration, usage string) *[]time.Duration { return CommandLine.DurationSliceP(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/errors.go ================================================ package pflag import "fmt" // notExistErrorMessageType specifies which flavor of "flag does not exist" // is printed by NotExistError. This allows the related errors to be grouped // under a single NotExistError struct without making a breaking change to // the error message text. type notExistErrorMessageType int const ( flagNotExistMessage notExistErrorMessageType = iota flagNotDefinedMessage flagNoSuchFlagMessage flagUnknownFlagMessage flagUnknownShorthandFlagMessage ) // NotExistError is the error returned when trying to access a flag that // does not exist in the FlagSet. type NotExistError struct { name string specifiedShorthands string messageType notExistErrorMessageType } // Error implements error. func (e *NotExistError) Error() string { switch e.messageType { case flagNotExistMessage: return fmt.Sprintf("flag %q does not exist", e.name) case flagNotDefinedMessage: return fmt.Sprintf("flag accessed but not defined: %s", e.name) case flagNoSuchFlagMessage: return fmt.Sprintf("no such flag -%v", e.name) case flagUnknownFlagMessage: return fmt.Sprintf("unknown flag: --%s", e.name) case flagUnknownShorthandFlagMessage: c := rune(e.name[0]) return fmt.Sprintf("unknown shorthand flag: %q in -%s", c, e.specifiedShorthands) } panic(fmt.Errorf("unknown flagNotExistErrorMessageType: %v", e.messageType)) } // GetSpecifiedName returns the name of the flag (without dashes) as it // appeared in the parsed arguments. func (e *NotExistError) GetSpecifiedName() string { return e.name } // GetSpecifiedShortnames returns the group of shorthand arguments // (without dashes) that the flag appeared within. If the flag was not in a // shorthand group, this will return an empty string. func (e *NotExistError) GetSpecifiedShortnames() string { return e.specifiedShorthands } // ValueRequiredError is the error returned when a flag needs an argument but // no argument was provided. type ValueRequiredError struct { flag *Flag specifiedName string specifiedShorthands string } // Error implements error. func (e *ValueRequiredError) Error() string { if len(e.specifiedShorthands) > 0 { c := rune(e.specifiedName[0]) return fmt.Sprintf("flag needs an argument: %q in -%s", c, e.specifiedShorthands) } return fmt.Sprintf("flag needs an argument: --%s", e.specifiedName) } // GetFlag returns the flag for which the error occurred. func (e *ValueRequiredError) GetFlag() *Flag { return e.flag } // GetSpecifiedName returns the name of the flag (without dashes) as it // appeared in the parsed arguments. func (e *ValueRequiredError) GetSpecifiedName() string { return e.specifiedName } // GetSpecifiedShortnames returns the group of shorthand arguments // (without dashes) that the flag appeared within. If the flag was not in a // shorthand group, this will return an empty string. func (e *ValueRequiredError) GetSpecifiedShortnames() string { return e.specifiedShorthands } // InvalidValueError is the error returned when an invalid value is used // for a flag. type InvalidValueError struct { flag *Flag value string cause error } // Error implements error. func (e *InvalidValueError) Error() string { flag := e.flag var flagName string if flag.Shorthand != "" && flag.ShorthandDeprecated == "" { flagName = fmt.Sprintf("-%s, --%s", flag.Shorthand, flag.Name) } else { flagName = fmt.Sprintf("--%s", flag.Name) } return fmt.Sprintf("invalid argument %q for %q flag: %v", e.value, flagName, e.cause) } // Unwrap implements errors.Unwrap. func (e *InvalidValueError) Unwrap() error { return e.cause } // GetFlag returns the flag for which the error occurred. func (e *InvalidValueError) GetFlag() *Flag { return e.flag } // GetValue returns the invalid value that was provided. func (e *InvalidValueError) GetValue() string { return e.value } // InvalidSyntaxError is the error returned when a bad flag name is passed on // the command line. type InvalidSyntaxError struct { specifiedFlag string } // Error implements error. func (e *InvalidSyntaxError) Error() string { return fmt.Sprintf("bad flag syntax: %s", e.specifiedFlag) } // GetSpecifiedName returns the exact flag (with dashes) as it // appeared in the parsed arguments. func (e *InvalidSyntaxError) GetSpecifiedFlag() string { return e.specifiedFlag } ================================================ FILE: vendor/github.com/spf13/pflag/flag.go ================================================ // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Package pflag is a drop-in replacement for Go's flag package, implementing POSIX/GNU-style --flags. pflag is compatible with the GNU extensions to the POSIX recommendations for command-line options. See http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html Usage: pflag is a drop-in replacement of Go's native flag package. If you import pflag under the name "flag" then all code should continue to function with no changes. import flag "github.com/spf13/pflag" There is one exception to this: if you directly instantiate the Flag struct there is one more field "Shorthand" that you will need to set. Most code never instantiates this struct directly, and instead uses functions such as String(), BoolVar(), and Var(), and is therefore unaffected. Define flags using flag.String(), Bool(), Int(), etc. This declares an integer flag, -flagname, stored in the pointer ip, with type *int. var ip = flag.Int("flagname", 1234, "help message for flagname") If you like, you can bind the flag to a variable using the Var() functions. var flagvar int func init() { flag.IntVar(&flagvar, "flagname", 1234, "help message for flagname") } Or you can create custom flags that satisfy the Value interface (with pointer receivers) and couple them to flag parsing by flag.Var(&flagVal, "name", "help message for flagname") For such flags, the default value is just the initial value of the variable. After all flags are defined, call flag.Parse() to parse the command line into the defined flags. Flags may then be used directly. If you're using the flags themselves, they are all pointers; if you bind to variables, they're values. fmt.Println("ip has value ", *ip) fmt.Println("flagvar has value ", flagvar) After parsing, the arguments after the flag are available as the slice flag.Args() or individually as flag.Arg(i). The arguments are indexed from 0 through flag.NArg()-1. The pflag package also defines some new functions that are not in flag, that give one-letter shorthands for flags. You can use these by appending 'P' to the name of any function that defines a flag. var ip = flag.IntP("flagname", "f", 1234, "help message") var flagvar bool func init() { flag.BoolVarP(&flagvar, "boolname", "b", true, "help message") } flag.VarP(&flagval, "varname", "v", "help message") Shorthand letters can be used with single dashes on the command line. Boolean shorthand flags can be combined with other shorthand flags. Command line flag syntax: --flag // boolean flags only --flag=x Unlike the flag package, a single dash before an option means something different than a double dash. Single dashes signify a series of shorthand letters for flags. All but the last shorthand letter must be boolean flags. // boolean flags -f -abc // non-boolean flags -n 1234 -Ifile // mixed -abcs "hello" -abcn1234 Flag parsing stops after the terminator "--". Unlike the flag package, flags can be interspersed with arguments anywhere on the command line before this terminator. Integer flags accept 1234, 0664, 0x1234 and may be negative. Boolean flags (in their long form) accept 1, 0, t, f, true, false, TRUE, FALSE, True, False. Duration flags accept any input valid for time.ParseDuration. The default set of command-line flags is controlled by top-level functions. The FlagSet type allows one to define independent sets of flags, such as to implement subcommands in a command-line interface. The methods of FlagSet are analogous to the top-level functions for the command-line flag set. */ package pflag import ( "bytes" "errors" goflag "flag" "fmt" "io" "os" "sort" "strings" ) // ErrHelp is the error returned if the flag -help is invoked but no such flag is defined. var ErrHelp = errors.New("pflag: help requested") // ErrorHandling defines how to handle flag parsing errors. type ErrorHandling int const ( // ContinueOnError will return an err from Parse() if an error is found ContinueOnError ErrorHandling = iota // ExitOnError will call os.Exit(2) if an error is found when parsing ExitOnError // PanicOnError will panic() if an error is found when parsing flags PanicOnError ) // ParseErrorsAllowlist defines the parsing errors that can be ignored type ParseErrorsAllowlist struct { // UnknownFlags will ignore unknown flags errors and continue parsing rest of the flags UnknownFlags bool } // ParseErrorsWhitelist defines the parsing errors that can be ignored. // // Deprecated: use [ParseErrorsAllowlist] instead. This type will be removed in a future release. type ParseErrorsWhitelist = ParseErrorsAllowlist // NormalizedName is a flag name that has been normalized according to rules // for the FlagSet (e.g. making '-' and '_' equivalent). type NormalizedName string // A FlagSet represents a set of defined flags. type FlagSet struct { // Usage is the function called when an error occurs while parsing flags. // The field is a function (not a method) that may be changed to point to // a custom error handler. Usage func() // SortFlags is used to indicate, if user wants to have sorted flags in // help/usage messages. SortFlags bool // ParseErrorsAllowlist is used to configure an allowlist of errors ParseErrorsAllowlist ParseErrorsAllowlist // ParseErrorsAllowlist is used to configure an allowlist of errors. // // Deprecated: use [FlagSet.ParseErrorsAllowlist] instead. This field will be removed in a future release. ParseErrorsWhitelist ParseErrorsAllowlist name string parsed bool actual map[NormalizedName]*Flag orderedActual []*Flag sortedActual []*Flag formal map[NormalizedName]*Flag orderedFormal []*Flag sortedFormal []*Flag shorthands map[byte]*Flag args []string // arguments after flags argsLenAtDash int // len(args) when a '--' was located when parsing, or -1 if no -- errorHandling ErrorHandling output io.Writer // nil means stderr; use Output() accessor interspersed bool // allow interspersed option/non-option args normalizeNameFunc func(f *FlagSet, name string) NormalizedName addedGoFlagSets []*goflag.FlagSet } // A Flag represents the state of a flag. type Flag struct { Name string // name as it appears on command line Shorthand string // one-letter abbreviated flag Usage string // help message Value Value // value as set DefValue string // default value (as text); for usage message Changed bool // If the user set the value (or if left to default) NoOptDefVal string // default value (as text); if the flag is on the command line without any options Deprecated string // If this flag is deprecated, this string is the new or now thing to use Hidden bool // used by cobra.Command to allow flags to be hidden from help/usage text ShorthandDeprecated string // If the shorthand of this flag is deprecated, this string is the new or now thing to use Annotations map[string][]string // used by cobra.Command bash autocomple code } // Value is the interface to the dynamic value stored in a flag. // (The default value is represented as a string.) type Value interface { String() string Set(string) error Type() string } // SliceValue is a secondary interface to all flags which hold a list // of values. This allows full control over the value of list flags, // and avoids complicated marshalling and unmarshalling to csv. type SliceValue interface { // Append adds the specified value to the end of the flag value list. Append(string) error // Replace will fully overwrite any data currently in the flag value list. Replace([]string) error // GetSlice returns the flag value list as an array of strings. GetSlice() []string } // sortFlags returns the flags as a slice in lexicographical sorted order. func sortFlags(flags map[NormalizedName]*Flag) []*Flag { list := make(sort.StringSlice, len(flags)) i := 0 for k := range flags { list[i] = string(k) i++ } list.Sort() result := make([]*Flag, len(list)) for i, name := range list { result[i] = flags[NormalizedName(name)] } return result } // SetNormalizeFunc allows you to add a function which can translate flag names. // Flags added to the FlagSet will be translated and then when anything tries to // look up the flag that will also be translated. So it would be possible to create // a flag named "getURL" and have it translated to "geturl". A user could then pass // "--getUrl" which may also be translated to "geturl" and everything will work. func (f *FlagSet) SetNormalizeFunc(n func(f *FlagSet, name string) NormalizedName) { f.normalizeNameFunc = n f.sortedFormal = f.sortedFormal[:0] for fname, flag := range f.formal { nname := f.normalizeFlagName(flag.Name) if fname == nname { continue } flag.Name = string(nname) delete(f.formal, fname) f.formal[nname] = flag if _, set := f.actual[fname]; set { delete(f.actual, fname) f.actual[nname] = flag } } } // GetNormalizeFunc returns the previously set NormalizeFunc of a function which // does no translation, if not set previously. func (f *FlagSet) GetNormalizeFunc() func(f *FlagSet, name string) NormalizedName { if f.normalizeNameFunc != nil { return f.normalizeNameFunc } return func(f *FlagSet, name string) NormalizedName { return NormalizedName(name) } } func (f *FlagSet) normalizeFlagName(name string) NormalizedName { n := f.GetNormalizeFunc() return n(f, name) } // Output returns the destination for usage and error messages. os.Stderr is returned if // output was not set or was set to nil. func (f *FlagSet) Output() io.Writer { if f.output == nil { return os.Stderr } return f.output } // Name returns the name of the flag set. func (f *FlagSet) Name() string { return f.name } // SetOutput sets the destination for usage and error messages. // If output is nil, os.Stderr is used. func (f *FlagSet) SetOutput(output io.Writer) { f.output = output } // VisitAll visits the flags in lexicographical order or // in primordial order if f.SortFlags is false, calling fn for each. // It visits all flags, even those not set. func (f *FlagSet) VisitAll(fn func(*Flag)) { if len(f.formal) == 0 { return } var flags []*Flag if f.SortFlags { if len(f.formal) != len(f.sortedFormal) { f.sortedFormal = sortFlags(f.formal) } flags = f.sortedFormal } else { flags = f.orderedFormal } for _, flag := range flags { fn(flag) } } // HasFlags returns a bool to indicate if the FlagSet has any flags defined. func (f *FlagSet) HasFlags() bool { return len(f.formal) > 0 } // HasAvailableFlags returns a bool to indicate if the FlagSet has any flags // that are not hidden. func (f *FlagSet) HasAvailableFlags() bool { for _, flag := range f.formal { if !flag.Hidden { return true } } return false } // VisitAll visits the command-line flags in lexicographical order or // in primordial order if f.SortFlags is false, calling fn for each. // It visits all flags, even those not set. func VisitAll(fn func(*Flag)) { CommandLine.VisitAll(fn) } // Visit visits the flags in lexicographical order or // in primordial order if f.SortFlags is false, calling fn for each. // It visits only those flags that have been set. func (f *FlagSet) Visit(fn func(*Flag)) { if len(f.actual) == 0 { return } var flags []*Flag if f.SortFlags { if len(f.actual) != len(f.sortedActual) { f.sortedActual = sortFlags(f.actual) } flags = f.sortedActual } else { flags = f.orderedActual } for _, flag := range flags { fn(flag) } } // Visit visits the command-line flags in lexicographical order or // in primordial order if f.SortFlags is false, calling fn for each. // It visits only those flags that have been set. func Visit(fn func(*Flag)) { CommandLine.Visit(fn) } // Lookup returns the Flag structure of the named flag, returning nil if none exists. func (f *FlagSet) Lookup(name string) *Flag { return f.lookup(f.normalizeFlagName(name)) } // ShorthandLookup returns the Flag structure of the short handed flag, // returning nil if none exists. // It panics, if len(name) > 1. func (f *FlagSet) ShorthandLookup(name string) *Flag { if name == "" { return nil } if len(name) > 1 { msg := fmt.Sprintf("can not look up shorthand which is more than one ASCII character: %q", name) fmt.Fprintf(f.Output(), msg) panic(msg) } c := name[0] return f.shorthands[c] } // lookup returns the Flag structure of the named flag, returning nil if none exists. func (f *FlagSet) lookup(name NormalizedName) *Flag { return f.formal[name] } // func to return a given type for a given flag name func (f *FlagSet) getFlagType(name string, ftype string, convFunc func(sval string) (interface{}, error)) (interface{}, error) { flag := f.Lookup(name) if flag == nil { err := &NotExistError{name: name, messageType: flagNotDefinedMessage} return nil, err } if flag.Value.Type() != ftype { err := fmt.Errorf("trying to get %s value of flag of type %s", ftype, flag.Value.Type()) return nil, err } sval := flag.Value.String() result, err := convFunc(sval) if err != nil { return nil, err } return result, nil } // ArgsLenAtDash will return the length of f.Args at the moment when a -- was // found during arg parsing. This allows your program to know which args were // before the -- and which came after. func (f *FlagSet) ArgsLenAtDash() int { return f.argsLenAtDash } // MarkDeprecated indicated that a flag is deprecated in your program. It will // continue to function but will not show up in help or usage messages. Using // this flag will also print the given usageMessage. func (f *FlagSet) MarkDeprecated(name string, usageMessage string) error { flag := f.Lookup(name) if flag == nil { return &NotExistError{name: name, messageType: flagNotExistMessage} } if usageMessage == "" { return fmt.Errorf("deprecated message for flag %q must be set", name) } flag.Deprecated = usageMessage flag.Hidden = true return nil } // MarkShorthandDeprecated will mark the shorthand of a flag deprecated in your // program. It will continue to function but will not show up in help or usage // messages. Using this flag will also print the given usageMessage. func (f *FlagSet) MarkShorthandDeprecated(name string, usageMessage string) error { flag := f.Lookup(name) if flag == nil { return &NotExistError{name: name, messageType: flagNotExistMessage} } if usageMessage == "" { return fmt.Errorf("deprecated message for flag %q must be set", name) } flag.ShorthandDeprecated = usageMessage return nil } // MarkHidden sets a flag to 'hidden' in your program. It will continue to // function but will not show up in help or usage messages. func (f *FlagSet) MarkHidden(name string) error { flag := f.Lookup(name) if flag == nil { return &NotExistError{name: name, messageType: flagNotExistMessage} } flag.Hidden = true return nil } // Lookup returns the Flag structure of the named command-line flag, // returning nil if none exists. func Lookup(name string) *Flag { return CommandLine.Lookup(name) } // ShorthandLookup returns the Flag structure of the short handed flag, // returning nil if none exists. func ShorthandLookup(name string) *Flag { return CommandLine.ShorthandLookup(name) } // Set sets the value of the named flag. func (f *FlagSet) Set(name, value string) error { normalName := f.normalizeFlagName(name) flag, ok := f.formal[normalName] if !ok { return &NotExistError{name: name, messageType: flagNoSuchFlagMessage} } err := flag.Value.Set(value) if err != nil { return &InvalidValueError{ flag: flag, value: value, cause: err, } } if !flag.Changed { if f.actual == nil { f.actual = make(map[NormalizedName]*Flag) } f.actual[normalName] = flag f.orderedActual = append(f.orderedActual, flag) flag.Changed = true } if flag.Deprecated != "" { fmt.Fprintf(f.Output(), "Flag --%s has been deprecated, %s\n", flag.Name, flag.Deprecated) } return nil } // SetAnnotation allows one to set arbitrary annotations on a flag in the FlagSet. // This is sometimes used by spf13/cobra programs which want to generate additional // bash completion information. func (f *FlagSet) SetAnnotation(name, key string, values []string) error { normalName := f.normalizeFlagName(name) flag, ok := f.formal[normalName] if !ok { return &NotExistError{name: name, messageType: flagNoSuchFlagMessage} } if flag.Annotations == nil { flag.Annotations = map[string][]string{} } flag.Annotations[key] = values return nil } // Changed returns true if the flag was explicitly set during Parse() and false // otherwise func (f *FlagSet) Changed(name string) bool { flag := f.Lookup(name) // If a flag doesn't exist, it wasn't changed.... if flag == nil { return false } return flag.Changed } // Set sets the value of the named command-line flag. func Set(name, value string) error { return CommandLine.Set(name, value) } // PrintDefaults prints, to standard error unless configured // otherwise, the default values of all defined flags in the set. func (f *FlagSet) PrintDefaults() { usages := f.FlagUsages() fmt.Fprint(f.Output(), usages) } // defaultIsZeroValue returns true if the default value for this flag represents // a zero value. func (f *Flag) defaultIsZeroValue() bool { switch f.Value.(type) { case boolFlag: return f.DefValue == "false" || f.DefValue == "" case *durationValue: // Beginning in Go 1.7, duration zero values are "0s" return f.DefValue == "0" || f.DefValue == "0s" case *intValue, *int8Value, *int32Value, *int64Value, *uintValue, *uint8Value, *uint16Value, *uint32Value, *uint64Value, *countValue, *float32Value, *float64Value: return f.DefValue == "0" case *stringValue: return f.DefValue == "" case *ipValue, *ipMaskValue, *ipNetValue: return f.DefValue == "" case *intSliceValue, *stringSliceValue, *stringArrayValue: return f.DefValue == "[]" default: switch f.DefValue { case "false": return true case "": return true case "": return true case "0": return true } return false } } // UnquoteUsage extracts a back-quoted name from the usage // string for a flag and returns it and the un-quoted usage. // Given "a `name` to show" it returns ("name", "a name to show"). // If there are no back quotes, the name is an educated guess of the // type of the flag's value, or the empty string if the flag is boolean. func UnquoteUsage(flag *Flag) (name string, usage string) { // Look for a back-quoted name, but avoid the strings package. usage = flag.Usage for i := 0; i < len(usage); i++ { if usage[i] == '`' { for j := i + 1; j < len(usage); j++ { if usage[j] == '`' { name = usage[i+1 : j] usage = usage[:i] + name + usage[j+1:] return name, usage } } break // Only one back quote; use type name. } } name = flag.Value.Type() switch name { case "bool", "boolfunc": name = "" case "func": name = "value" case "float64": name = "float" case "int64": name = "int" case "uint64": name = "uint" case "stringSlice": name = "strings" case "intSlice": name = "ints" case "uintSlice": name = "uints" case "boolSlice": name = "bools" } return } // Splits the string `s` on whitespace into an initial substring up to // `i` runes in length and the remainder. Will go `slop` over `i` if // that encompasses the entire string (which allows the caller to // avoid short orphan words on the final line). func wrapN(i, slop int, s string) (string, string) { if i+slop > len(s) { return s, "" } w := strings.LastIndexAny(s[:i], " \t\n") if w <= 0 { return s, "" } nlPos := strings.LastIndex(s[:i], "\n") if nlPos > 0 && nlPos < w { return s[:nlPos], s[nlPos+1:] } return s[:w], s[w+1:] } // Wraps the string `s` to a maximum width `w` with leading indent // `i`. The first line is not indented (this is assumed to be done by // caller). Pass `w` == 0 to do no wrapping func wrap(i, w int, s string) string { if w == 0 { return strings.Replace(s, "\n", "\n"+strings.Repeat(" ", i), -1) } // space between indent i and end of line width w into which // we should wrap the text. wrap := w - i var r, l string // Not enough space for sensible wrapping. Wrap as a block on // the next line instead. if wrap < 24 { i = 16 wrap = w - i r += "\n" + strings.Repeat(" ", i) } // If still not enough space then don't even try to wrap. if wrap < 24 { return strings.Replace(s, "\n", r, -1) } // Try to avoid short orphan words on the final line, by // allowing wrapN to go a bit over if that would fit in the // remainder of the line. slop := 5 wrap = wrap - slop // Handle first line, which is indented by the caller (or the // special case above) l, s = wrapN(wrap, slop, s) r = r + strings.Replace(l, "\n", "\n"+strings.Repeat(" ", i), -1) // Now wrap the rest for s != "" { var t string t, s = wrapN(wrap, slop, s) r = r + "\n" + strings.Repeat(" ", i) + strings.Replace(t, "\n", "\n"+strings.Repeat(" ", i), -1) } return r } // FlagUsagesWrapped returns a string containing the usage information // for all flags in the FlagSet. Wrapped to `cols` columns (0 for no // wrapping) func (f *FlagSet) FlagUsagesWrapped(cols int) string { buf := new(bytes.Buffer) lines := make([]string, 0, len(f.formal)) maxlen := 0 f.VisitAll(func(flag *Flag) { if flag.Hidden { return } line := "" if flag.Shorthand != "" && flag.ShorthandDeprecated == "" { line = fmt.Sprintf(" -%s, --%s", flag.Shorthand, flag.Name) } else { line = fmt.Sprintf(" --%s", flag.Name) } varname, usage := UnquoteUsage(flag) if varname != "" { line += " " + varname } if flag.NoOptDefVal != "" { switch flag.Value.Type() { case "string": line += fmt.Sprintf("[=\"%s\"]", flag.NoOptDefVal) case "bool", "boolfunc": if flag.NoOptDefVal != "true" { line += fmt.Sprintf("[=%s]", flag.NoOptDefVal) } case "count": if flag.NoOptDefVal != "+1" { line += fmt.Sprintf("[=%s]", flag.NoOptDefVal) } default: line += fmt.Sprintf("[=%s]", flag.NoOptDefVal) } } // This special character will be replaced with spacing once the // correct alignment is calculated line += "\x00" if len(line) > maxlen { maxlen = len(line) } line += usage if !flag.defaultIsZeroValue() { if flag.Value.Type() == "string" { line += fmt.Sprintf(" (default %q)", flag.DefValue) } else { line += fmt.Sprintf(" (default %s)", flag.DefValue) } } if len(flag.Deprecated) != 0 { line += fmt.Sprintf(" (DEPRECATED: %s)", flag.Deprecated) } lines = append(lines, line) }) for _, line := range lines { sidx := strings.Index(line, "\x00") spacing := strings.Repeat(" ", maxlen-sidx) // maxlen + 2 comes from + 1 for the \x00 and + 1 for the (deliberate) off-by-one in maxlen-sidx fmt.Fprintln(buf, line[:sidx], spacing, wrap(maxlen+2, cols, line[sidx+1:])) } return buf.String() } // FlagUsages returns a string containing the usage information for all flags in // the FlagSet func (f *FlagSet) FlagUsages() string { return f.FlagUsagesWrapped(0) } // PrintDefaults prints to standard error the default values of all defined command-line flags. func PrintDefaults() { CommandLine.PrintDefaults() } // defaultUsage is the default function to print a usage message. func defaultUsage(f *FlagSet) { fmt.Fprintf(f.Output(), "Usage of %s:\n", f.name) f.PrintDefaults() } // NOTE: Usage is not just defaultUsage(CommandLine) // because it serves (via godoc flag Usage) as the example // for how to write your own usage function. // Usage prints to standard error a usage message documenting all defined command-line flags. // The function is a variable that may be changed to point to a custom function. // By default it prints a simple header and calls PrintDefaults; for details about the // format of the output and how to control it, see the documentation for PrintDefaults. var Usage = func() { fmt.Fprintf(os.Stderr, "Usage of %s:\n", os.Args[0]) PrintDefaults() } // NFlag returns the number of flags that have been set. func (f *FlagSet) NFlag() int { return len(f.actual) } // NFlag returns the number of command-line flags that have been set. func NFlag() int { return len(CommandLine.actual) } // Arg returns the i'th argument. Arg(0) is the first remaining argument // after flags have been processed. func (f *FlagSet) Arg(i int) string { if i < 0 || i >= len(f.args) { return "" } return f.args[i] } // Arg returns the i'th command-line argument. Arg(0) is the first remaining argument // after flags have been processed. func Arg(i int) string { return CommandLine.Arg(i) } // NArg is the number of arguments remaining after flags have been processed. func (f *FlagSet) NArg() int { return len(f.args) } // NArg is the number of arguments remaining after flags have been processed. func NArg() int { return len(CommandLine.args) } // Args returns the non-flag arguments. func (f *FlagSet) Args() []string { return f.args } // Args returns the non-flag command-line arguments. func Args() []string { return CommandLine.args } // Var defines a flag with the specified name and usage string. The type and // value of the flag are represented by the first argument, of type Value, which // typically holds a user-defined implementation of Value. For instance, the // caller could create a flag that turns a comma-separated string into a slice // of strings by giving the slice the methods of Value; in particular, Set would // decompose the comma-separated string into the slice. func (f *FlagSet) Var(value Value, name string, usage string) { f.VarP(value, name, "", usage) } // VarPF is like VarP, but returns the flag created func (f *FlagSet) VarPF(value Value, name, shorthand, usage string) *Flag { // Remember the default value as a string; it won't change. flag := &Flag{ Name: name, Shorthand: shorthand, Usage: usage, Value: value, DefValue: value.String(), } f.AddFlag(flag) return flag } // VarP is like Var, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) VarP(value Value, name, shorthand, usage string) { f.VarPF(value, name, shorthand, usage) } // AddFlag will add the flag to the FlagSet func (f *FlagSet) AddFlag(flag *Flag) { normalizedFlagName := f.normalizeFlagName(flag.Name) _, alreadyThere := f.formal[normalizedFlagName] if alreadyThere { msg := fmt.Sprintf("%s flag redefined: %s", f.name, flag.Name) fmt.Fprintln(f.Output(), msg) panic(msg) // Happens only if flags are declared with identical names } if f.formal == nil { f.formal = make(map[NormalizedName]*Flag) } flag.Name = string(normalizedFlagName) f.formal[normalizedFlagName] = flag f.orderedFormal = append(f.orderedFormal, flag) if flag.Shorthand == "" { return } if len(flag.Shorthand) > 1 { msg := fmt.Sprintf("%q shorthand is more than one ASCII character", flag.Shorthand) fmt.Fprintf(f.Output(), msg) panic(msg) } if f.shorthands == nil { f.shorthands = make(map[byte]*Flag) } c := flag.Shorthand[0] used, alreadyThere := f.shorthands[c] if alreadyThere { msg := fmt.Sprintf("unable to redefine %q shorthand in %q flagset: it's already used for %q flag", c, f.name, used.Name) fmt.Fprintf(f.Output(), msg) panic(msg) } f.shorthands[c] = flag } // AddFlagSet adds one FlagSet to another. If a flag is already present in f // the flag from newSet will be ignored. func (f *FlagSet) AddFlagSet(newSet *FlagSet) { if newSet == nil { return } newSet.VisitAll(func(flag *Flag) { if f.Lookup(flag.Name) == nil { f.AddFlag(flag) } }) } // Var defines a flag with the specified name and usage string. The type and // value of the flag are represented by the first argument, of type Value, which // typically holds a user-defined implementation of Value. For instance, the // caller could create a flag that turns a comma-separated string into a slice // of strings by giving the slice the methods of Value; in particular, Set would // decompose the comma-separated string into the slice. func Var(value Value, name string, usage string) { CommandLine.VarP(value, name, "", usage) } // VarP is like Var, but accepts a shorthand letter that can be used after a single dash. func VarP(value Value, name, shorthand, usage string) { CommandLine.VarP(value, name, shorthand, usage) } // fail prints an error message and usage message to standard error and // returns the error. func (f *FlagSet) fail(err error) error { if f.errorHandling != ContinueOnError { f.usage() } return err } // usage calls the Usage method for the flag set, or the usage function if // the flag set is CommandLine. func (f *FlagSet) usage() { if f == CommandLine { Usage() } else if f.Usage == nil { defaultUsage(f) } else { f.Usage() } } // --unknown (args will be empty) // --unknown --next-flag ... (args will be --next-flag ...) // --unknown arg ... (args will be arg ...) func stripUnknownFlagValue(args []string) []string { if len(args) == 0 { //--unknown return args } first := args[0] if len(first) > 0 && first[0] == '-' { //--unknown --next-flag ... return args } //--unknown arg ... (args will be arg ...) if len(args) > 1 { return args[1:] } return nil } func (f *FlagSet) parseLongArg(s string, args []string, fn parseFunc) (a []string, err error) { a = args name := s[2:] if len(name) == 0 || name[0] == '-' || name[0] == '=' { err = f.fail(&InvalidSyntaxError{specifiedFlag: s}) return } split := strings.SplitN(name, "=", 2) name = split[0] flag, exists := f.formal[f.normalizeFlagName(name)] if !exists { switch { case name == "help": f.usage() return a, ErrHelp case f.ParseErrorsWhitelist.UnknownFlags: fallthrough case f.ParseErrorsAllowlist.UnknownFlags: // --unknown=unknownval arg ... // we do not want to lose arg in this case if len(split) >= 2 { return a, nil } return stripUnknownFlagValue(a), nil default: err = f.fail(&NotExistError{name: name, messageType: flagUnknownFlagMessage}) return } } var value string if len(split) == 2 { // '--flag=arg' value = split[1] } else if flag.NoOptDefVal != "" { // '--flag' (arg was optional) value = flag.NoOptDefVal } else if len(a) > 0 { // '--flag arg' value = a[0] a = a[1:] } else { // '--flag' (arg was required) err = f.fail(&ValueRequiredError{ flag: flag, specifiedName: name, }) return } err = fn(flag, value) if err != nil { f.fail(err) } return } func (f *FlagSet) parseSingleShortArg(shorthands string, args []string, fn parseFunc) (outShorts string, outArgs []string, err error) { outArgs = args if isGotestShorthandFlag(shorthands) { return } outShorts = shorthands[1:] c := shorthands[0] flag, exists := f.shorthands[c] if !exists { switch { case c == 'h': f.usage() err = ErrHelp return case f.ParseErrorsWhitelist.UnknownFlags: fallthrough case f.ParseErrorsAllowlist.UnknownFlags: // '-f=arg arg ...' // we do not want to lose arg in this case if len(shorthands) > 2 && shorthands[1] == '=' { outShorts = "" return } outArgs = stripUnknownFlagValue(outArgs) return default: err = f.fail(&NotExistError{ name: string(c), specifiedShorthands: shorthands, messageType: flagUnknownShorthandFlagMessage, }) return } } var value string if len(shorthands) > 2 && shorthands[1] == '=' { // '-f=arg' value = shorthands[2:] outShorts = "" } else if flag.NoOptDefVal != "" { // '-f' (arg was optional) value = flag.NoOptDefVal } else if len(shorthands) > 1 { // '-farg' value = shorthands[1:] outShorts = "" } else if len(args) > 0 { // '-f arg' value = args[0] outArgs = args[1:] } else { // '-f' (arg was required) err = f.fail(&ValueRequiredError{ flag: flag, specifiedName: string(c), specifiedShorthands: shorthands, }) return } if flag.ShorthandDeprecated != "" { fmt.Fprintf(f.Output(), "Flag shorthand -%s has been deprecated, %s\n", flag.Shorthand, flag.ShorthandDeprecated) } err = fn(flag, value) if err != nil { f.fail(err) } return } func (f *FlagSet) parseShortArg(s string, args []string, fn parseFunc) (a []string, err error) { a = args shorthands := s[1:] // "shorthands" can be a series of shorthand letters of flags (e.g. "-vvv"). for len(shorthands) > 0 { shorthands, a, err = f.parseSingleShortArg(shorthands, args, fn) if err != nil { return } } return } func (f *FlagSet) parseArgs(args []string, fn parseFunc) (err error) { for len(args) > 0 { s := args[0] args = args[1:] if len(s) == 0 || s[0] != '-' || len(s) == 1 { if !f.interspersed { f.args = append(f.args, s) f.args = append(f.args, args...) return nil } f.args = append(f.args, s) continue } if s[1] == '-' { if len(s) == 2 { // "--" terminates the flags f.argsLenAtDash = len(f.args) f.args = append(f.args, args...) break } args, err = f.parseLongArg(s, args, fn) } else { args, err = f.parseShortArg(s, args, fn) } if err != nil { return } } return } // Parse parses flag definitions from the argument list, which should not // include the command name. Must be called after all flags in the FlagSet // are defined and before flags are accessed by the program. // The return value will be ErrHelp if -help was set but not defined. func (f *FlagSet) Parse(arguments []string) error { if f.addedGoFlagSets != nil { for _, goFlagSet := range f.addedGoFlagSets { goFlagSet.Parse(nil) } } f.parsed = true f.args = make([]string, 0, len(arguments)) if len(arguments) == 0 { return nil } set := func(flag *Flag, value string) error { return f.Set(flag.Name, value) } err := f.parseArgs(arguments, set) if err != nil { switch f.errorHandling { case ContinueOnError: return err case ExitOnError: if err == ErrHelp { os.Exit(0) } fmt.Fprintln(f.Output(), err) os.Exit(2) case PanicOnError: panic(err) } } return nil } type parseFunc func(flag *Flag, value string) error // ParseAll parses flag definitions from the argument list, which should not // include the command name. The arguments for fn are flag and value. Must be // called after all flags in the FlagSet are defined and before flags are // accessed by the program. The return value will be ErrHelp if -help was set // but not defined. func (f *FlagSet) ParseAll(arguments []string, fn func(flag *Flag, value string) error) error { f.parsed = true f.args = make([]string, 0, len(arguments)) err := f.parseArgs(arguments, fn) if err != nil { switch f.errorHandling { case ContinueOnError: return err case ExitOnError: if err == ErrHelp { os.Exit(0) } fmt.Fprintln(f.Output(), err) os.Exit(2) case PanicOnError: panic(err) } } return nil } // Parsed reports whether f.Parse has been called. func (f *FlagSet) Parsed() bool { return f.parsed } // Parse parses the command-line flags from os.Args[1:]. Must be called // after all flags are defined and before flags are accessed by the program. func Parse() { // Ignore errors; CommandLine is set for ExitOnError. CommandLine.Parse(os.Args[1:]) } // ParseAll parses the command-line flags from os.Args[1:] and called fn for each. // The arguments for fn are flag and value. Must be called after all flags are // defined and before flags are accessed by the program. func ParseAll(fn func(flag *Flag, value string) error) { // Ignore errors; CommandLine is set for ExitOnError. CommandLine.ParseAll(os.Args[1:], fn) } // SetInterspersed sets whether to support interspersed option/non-option arguments. func SetInterspersed(interspersed bool) { CommandLine.SetInterspersed(interspersed) } // Parsed returns true if the command-line flags have been parsed. func Parsed() bool { return CommandLine.Parsed() } // CommandLine is the default set of command-line flags, parsed from os.Args. var CommandLine = NewFlagSet(os.Args[0], ExitOnError) // NewFlagSet returns a new, empty flag set with the specified name, // error handling property and SortFlags set to true. func NewFlagSet(name string, errorHandling ErrorHandling) *FlagSet { f := &FlagSet{ name: name, errorHandling: errorHandling, argsLenAtDash: -1, interspersed: true, SortFlags: true, } return f } // SetInterspersed sets whether to support interspersed option/non-option arguments. func (f *FlagSet) SetInterspersed(interspersed bool) { f.interspersed = interspersed } // Init sets the name and error handling property for a flag set. // By default, the zero FlagSet uses an empty name and the // ContinueOnError error handling policy. func (f *FlagSet) Init(name string, errorHandling ErrorHandling) { f.name = name f.errorHandling = errorHandling f.argsLenAtDash = -1 } ================================================ FILE: vendor/github.com/spf13/pflag/float32.go ================================================ package pflag import "strconv" // -- float32 Value type float32Value float32 func newFloat32Value(val float32, p *float32) *float32Value { *p = val return (*float32Value)(p) } func (f *float32Value) Set(s string) error { v, err := strconv.ParseFloat(s, 32) *f = float32Value(v) return err } func (f *float32Value) Type() string { return "float32" } func (f *float32Value) String() string { return strconv.FormatFloat(float64(*f), 'g', -1, 32) } func float32Conv(sval string) (interface{}, error) { v, err := strconv.ParseFloat(sval, 32) if err != nil { return 0, err } return float32(v), nil } // GetFloat32 return the float32 value of a flag with the given name func (f *FlagSet) GetFloat32(name string) (float32, error) { val, err := f.getFlagType(name, "float32", float32Conv) if err != nil { return 0, err } return val.(float32), nil } // Float32Var defines a float32 flag with specified name, default value, and usage string. // The argument p points to a float32 variable in which to store the value of the flag. func (f *FlagSet) Float32Var(p *float32, name string, value float32, usage string) { f.VarP(newFloat32Value(value, p), name, "", usage) } // Float32VarP is like Float32Var, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Float32VarP(p *float32, name, shorthand string, value float32, usage string) { f.VarP(newFloat32Value(value, p), name, shorthand, usage) } // Float32Var defines a float32 flag with specified name, default value, and usage string. // The argument p points to a float32 variable in which to store the value of the flag. func Float32Var(p *float32, name string, value float32, usage string) { CommandLine.VarP(newFloat32Value(value, p), name, "", usage) } // Float32VarP is like Float32Var, but accepts a shorthand letter that can be used after a single dash. func Float32VarP(p *float32, name, shorthand string, value float32, usage string) { CommandLine.VarP(newFloat32Value(value, p), name, shorthand, usage) } // Float32 defines a float32 flag with specified name, default value, and usage string. // The return value is the address of a float32 variable that stores the value of the flag. func (f *FlagSet) Float32(name string, value float32, usage string) *float32 { p := new(float32) f.Float32VarP(p, name, "", value, usage) return p } // Float32P is like Float32, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Float32P(name, shorthand string, value float32, usage string) *float32 { p := new(float32) f.Float32VarP(p, name, shorthand, value, usage) return p } // Float32 defines a float32 flag with specified name, default value, and usage string. // The return value is the address of a float32 variable that stores the value of the flag. func Float32(name string, value float32, usage string) *float32 { return CommandLine.Float32P(name, "", value, usage) } // Float32P is like Float32, but accepts a shorthand letter that can be used after a single dash. func Float32P(name, shorthand string, value float32, usage string) *float32 { return CommandLine.Float32P(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/float32_slice.go ================================================ package pflag import ( "fmt" "strconv" "strings" ) // -- float32Slice Value type float32SliceValue struct { value *[]float32 changed bool } func newFloat32SliceValue(val []float32, p *[]float32) *float32SliceValue { isv := new(float32SliceValue) isv.value = p *isv.value = val return isv } func (s *float32SliceValue) Set(val string) error { ss := strings.Split(val, ",") out := make([]float32, len(ss)) for i, d := range ss { var err error var temp64 float64 temp64, err = strconv.ParseFloat(d, 32) if err != nil { return err } out[i] = float32(temp64) } if !s.changed { *s.value = out } else { *s.value = append(*s.value, out...) } s.changed = true return nil } func (s *float32SliceValue) Type() string { return "float32Slice" } func (s *float32SliceValue) String() string { out := make([]string, len(*s.value)) for i, d := range *s.value { out[i] = fmt.Sprintf("%f", d) } return "[" + strings.Join(out, ",") + "]" } func (s *float32SliceValue) fromString(val string) (float32, error) { t64, err := strconv.ParseFloat(val, 32) if err != nil { return 0, err } return float32(t64), nil } func (s *float32SliceValue) toString(val float32) string { return fmt.Sprintf("%f", val) } func (s *float32SliceValue) Append(val string) error { i, err := s.fromString(val) if err != nil { return err } *s.value = append(*s.value, i) return nil } func (s *float32SliceValue) Replace(val []string) error { out := make([]float32, len(val)) for i, d := range val { var err error out[i], err = s.fromString(d) if err != nil { return err } } *s.value = out return nil } func (s *float32SliceValue) GetSlice() []string { out := make([]string, len(*s.value)) for i, d := range *s.value { out[i] = s.toString(d) } return out } func float32SliceConv(val string) (interface{}, error) { val = strings.Trim(val, "[]") // Empty string would cause a slice with one (empty) entry if len(val) == 0 { return []float32{}, nil } ss := strings.Split(val, ",") out := make([]float32, len(ss)) for i, d := range ss { var err error var temp64 float64 temp64, err = strconv.ParseFloat(d, 32) if err != nil { return nil, err } out[i] = float32(temp64) } return out, nil } // GetFloat32Slice return the []float32 value of a flag with the given name func (f *FlagSet) GetFloat32Slice(name string) ([]float32, error) { val, err := f.getFlagType(name, "float32Slice", float32SliceConv) if err != nil { return []float32{}, err } return val.([]float32), nil } // Float32SliceVar defines a float32Slice flag with specified name, default value, and usage string. // The argument p points to a []float32 variable in which to store the value of the flag. func (f *FlagSet) Float32SliceVar(p *[]float32, name string, value []float32, usage string) { f.VarP(newFloat32SliceValue(value, p), name, "", usage) } // Float32SliceVarP is like Float32SliceVar, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Float32SliceVarP(p *[]float32, name, shorthand string, value []float32, usage string) { f.VarP(newFloat32SliceValue(value, p), name, shorthand, usage) } // Float32SliceVar defines a float32[] flag with specified name, default value, and usage string. // The argument p points to a float32[] variable in which to store the value of the flag. func Float32SliceVar(p *[]float32, name string, value []float32, usage string) { CommandLine.VarP(newFloat32SliceValue(value, p), name, "", usage) } // Float32SliceVarP is like Float32SliceVar, but accepts a shorthand letter that can be used after a single dash. func Float32SliceVarP(p *[]float32, name, shorthand string, value []float32, usage string) { CommandLine.VarP(newFloat32SliceValue(value, p), name, shorthand, usage) } // Float32Slice defines a []float32 flag with specified name, default value, and usage string. // The return value is the address of a []float32 variable that stores the value of the flag. func (f *FlagSet) Float32Slice(name string, value []float32, usage string) *[]float32 { p := []float32{} f.Float32SliceVarP(&p, name, "", value, usage) return &p } // Float32SliceP is like Float32Slice, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Float32SliceP(name, shorthand string, value []float32, usage string) *[]float32 { p := []float32{} f.Float32SliceVarP(&p, name, shorthand, value, usage) return &p } // Float32Slice defines a []float32 flag with specified name, default value, and usage string. // The return value is the address of a []float32 variable that stores the value of the flag. func Float32Slice(name string, value []float32, usage string) *[]float32 { return CommandLine.Float32SliceP(name, "", value, usage) } // Float32SliceP is like Float32Slice, but accepts a shorthand letter that can be used after a single dash. func Float32SliceP(name, shorthand string, value []float32, usage string) *[]float32 { return CommandLine.Float32SliceP(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/float64.go ================================================ package pflag import "strconv" // -- float64 Value type float64Value float64 func newFloat64Value(val float64, p *float64) *float64Value { *p = val return (*float64Value)(p) } func (f *float64Value) Set(s string) error { v, err := strconv.ParseFloat(s, 64) *f = float64Value(v) return err } func (f *float64Value) Type() string { return "float64" } func (f *float64Value) String() string { return strconv.FormatFloat(float64(*f), 'g', -1, 64) } func float64Conv(sval string) (interface{}, error) { return strconv.ParseFloat(sval, 64) } // GetFloat64 return the float64 value of a flag with the given name func (f *FlagSet) GetFloat64(name string) (float64, error) { val, err := f.getFlagType(name, "float64", float64Conv) if err != nil { return 0, err } return val.(float64), nil } // Float64Var defines a float64 flag with specified name, default value, and usage string. // The argument p points to a float64 variable in which to store the value of the flag. func (f *FlagSet) Float64Var(p *float64, name string, value float64, usage string) { f.VarP(newFloat64Value(value, p), name, "", usage) } // Float64VarP is like Float64Var, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Float64VarP(p *float64, name, shorthand string, value float64, usage string) { f.VarP(newFloat64Value(value, p), name, shorthand, usage) } // Float64Var defines a float64 flag with specified name, default value, and usage string. // The argument p points to a float64 variable in which to store the value of the flag. func Float64Var(p *float64, name string, value float64, usage string) { CommandLine.VarP(newFloat64Value(value, p), name, "", usage) } // Float64VarP is like Float64Var, but accepts a shorthand letter that can be used after a single dash. func Float64VarP(p *float64, name, shorthand string, value float64, usage string) { CommandLine.VarP(newFloat64Value(value, p), name, shorthand, usage) } // Float64 defines a float64 flag with specified name, default value, and usage string. // The return value is the address of a float64 variable that stores the value of the flag. func (f *FlagSet) Float64(name string, value float64, usage string) *float64 { p := new(float64) f.Float64VarP(p, name, "", value, usage) return p } // Float64P is like Float64, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Float64P(name, shorthand string, value float64, usage string) *float64 { p := new(float64) f.Float64VarP(p, name, shorthand, value, usage) return p } // Float64 defines a float64 flag with specified name, default value, and usage string. // The return value is the address of a float64 variable that stores the value of the flag. func Float64(name string, value float64, usage string) *float64 { return CommandLine.Float64P(name, "", value, usage) } // Float64P is like Float64, but accepts a shorthand letter that can be used after a single dash. func Float64P(name, shorthand string, value float64, usage string) *float64 { return CommandLine.Float64P(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/float64_slice.go ================================================ package pflag import ( "fmt" "strconv" "strings" ) // -- float64Slice Value type float64SliceValue struct { value *[]float64 changed bool } func newFloat64SliceValue(val []float64, p *[]float64) *float64SliceValue { isv := new(float64SliceValue) isv.value = p *isv.value = val return isv } func (s *float64SliceValue) Set(val string) error { ss := strings.Split(val, ",") out := make([]float64, len(ss)) for i, d := range ss { var err error out[i], err = strconv.ParseFloat(d, 64) if err != nil { return err } } if !s.changed { *s.value = out } else { *s.value = append(*s.value, out...) } s.changed = true return nil } func (s *float64SliceValue) Type() string { return "float64Slice" } func (s *float64SliceValue) String() string { out := make([]string, len(*s.value)) for i, d := range *s.value { out[i] = fmt.Sprintf("%f", d) } return "[" + strings.Join(out, ",") + "]" } func (s *float64SliceValue) fromString(val string) (float64, error) { return strconv.ParseFloat(val, 64) } func (s *float64SliceValue) toString(val float64) string { return fmt.Sprintf("%f", val) } func (s *float64SliceValue) Append(val string) error { i, err := s.fromString(val) if err != nil { return err } *s.value = append(*s.value, i) return nil } func (s *float64SliceValue) Replace(val []string) error { out := make([]float64, len(val)) for i, d := range val { var err error out[i], err = s.fromString(d) if err != nil { return err } } *s.value = out return nil } func (s *float64SliceValue) GetSlice() []string { out := make([]string, len(*s.value)) for i, d := range *s.value { out[i] = s.toString(d) } return out } func float64SliceConv(val string) (interface{}, error) { val = strings.Trim(val, "[]") // Empty string would cause a slice with one (empty) entry if len(val) == 0 { return []float64{}, nil } ss := strings.Split(val, ",") out := make([]float64, len(ss)) for i, d := range ss { var err error out[i], err = strconv.ParseFloat(d, 64) if err != nil { return nil, err } } return out, nil } // GetFloat64Slice return the []float64 value of a flag with the given name func (f *FlagSet) GetFloat64Slice(name string) ([]float64, error) { val, err := f.getFlagType(name, "float64Slice", float64SliceConv) if err != nil { return []float64{}, err } return val.([]float64), nil } // Float64SliceVar defines a float64Slice flag with specified name, default value, and usage string. // The argument p points to a []float64 variable in which to store the value of the flag. func (f *FlagSet) Float64SliceVar(p *[]float64, name string, value []float64, usage string) { f.VarP(newFloat64SliceValue(value, p), name, "", usage) } // Float64SliceVarP is like Float64SliceVar, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Float64SliceVarP(p *[]float64, name, shorthand string, value []float64, usage string) { f.VarP(newFloat64SliceValue(value, p), name, shorthand, usage) } // Float64SliceVar defines a float64[] flag with specified name, default value, and usage string. // The argument p points to a float64[] variable in which to store the value of the flag. func Float64SliceVar(p *[]float64, name string, value []float64, usage string) { CommandLine.VarP(newFloat64SliceValue(value, p), name, "", usage) } // Float64SliceVarP is like Float64SliceVar, but accepts a shorthand letter that can be used after a single dash. func Float64SliceVarP(p *[]float64, name, shorthand string, value []float64, usage string) { CommandLine.VarP(newFloat64SliceValue(value, p), name, shorthand, usage) } // Float64Slice defines a []float64 flag with specified name, default value, and usage string. // The return value is the address of a []float64 variable that stores the value of the flag. func (f *FlagSet) Float64Slice(name string, value []float64, usage string) *[]float64 { p := []float64{} f.Float64SliceVarP(&p, name, "", value, usage) return &p } // Float64SliceP is like Float64Slice, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Float64SliceP(name, shorthand string, value []float64, usage string) *[]float64 { p := []float64{} f.Float64SliceVarP(&p, name, shorthand, value, usage) return &p } // Float64Slice defines a []float64 flag with specified name, default value, and usage string. // The return value is the address of a []float64 variable that stores the value of the flag. func Float64Slice(name string, value []float64, usage string) *[]float64 { return CommandLine.Float64SliceP(name, "", value, usage) } // Float64SliceP is like Float64Slice, but accepts a shorthand letter that can be used after a single dash. func Float64SliceP(name, shorthand string, value []float64, usage string) *[]float64 { return CommandLine.Float64SliceP(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/func.go ================================================ package pflag // -- func Value type funcValue func(string) error func (f funcValue) Set(s string) error { return f(s) } func (f funcValue) Type() string { return "func" } func (f funcValue) String() string { return "" } // same behavior as stdlib 'flag' package // Func defines a func flag with specified name, callback function and usage string. // // The callback function will be called every time "--{name}={value}" (or equivalent) is // parsed on the command line, with "{value}" as an argument. func (f *FlagSet) Func(name string, usage string, fn func(string) error) { f.FuncP(name, "", usage, fn) } // FuncP is like Func, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) FuncP(name string, shorthand string, usage string, fn func(string) error) { var val Value = funcValue(fn) f.VarP(val, name, shorthand, usage) } // Func defines a func flag with specified name, callback function and usage string. // // The callback function will be called every time "--{name}={value}" (or equivalent) is // parsed on the command line, with "{value}" as an argument. func Func(name string, usage string, fn func(string) error) { CommandLine.FuncP(name, "", usage, fn) } // FuncP is like Func, but accepts a shorthand letter that can be used after a single dash. func FuncP(name, shorthand string, usage string, fn func(string) error) { CommandLine.FuncP(name, shorthand, usage, fn) } ================================================ FILE: vendor/github.com/spf13/pflag/golangflag.go ================================================ // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package pflag import ( goflag "flag" "reflect" "strings" "time" ) // go test flags prefixes func isGotestFlag(flag string) bool { return strings.HasPrefix(flag, "-test.") } func isGotestShorthandFlag(flag string) bool { return strings.HasPrefix(flag, "test.") } // flagValueWrapper implements pflag.Value around a flag.Value. The main // difference here is the addition of the Type method that returns a string // name of the type. As this is generally unknown, we approximate that with // reflection. type flagValueWrapper struct { inner goflag.Value flagType string } // We are just copying the boolFlag interface out of goflag as that is what // they use to decide if a flag should get "true" when no arg is given. type goBoolFlag interface { goflag.Value IsBoolFlag() bool } func wrapFlagValue(v goflag.Value) Value { // If the flag.Value happens to also be a pflag.Value, just use it directly. if pv, ok := v.(Value); ok { return pv } pv := &flagValueWrapper{ inner: v, } t := reflect.TypeOf(v) if t.Kind() == reflect.Interface || t.Kind() == reflect.Ptr { t = t.Elem() } pv.flagType = strings.TrimSuffix(t.Name(), "Value") return pv } func (v *flagValueWrapper) String() string { return v.inner.String() } func (v *flagValueWrapper) Set(s string) error { return v.inner.Set(s) } func (v *flagValueWrapper) Type() string { return v.flagType } // PFlagFromGoFlag will return a *pflag.Flag given a *flag.Flag // If the *flag.Flag.Name was a single character (ex: `v`) it will be accessiblei // with both `-v` and `--v` in flags. If the golang flag was more than a single // character (ex: `verbose`) it will only be accessible via `--verbose` func PFlagFromGoFlag(goflag *goflag.Flag) *Flag { // Remember the default value as a string; it won't change. flag := &Flag{ Name: goflag.Name, Usage: goflag.Usage, Value: wrapFlagValue(goflag.Value), // Looks like golang flags don't set DefValue correctly :-( //DefValue: goflag.DefValue, DefValue: goflag.Value.String(), } // Ex: if the golang flag was -v, allow both -v and --v to work if len(flag.Name) == 1 { flag.Shorthand = flag.Name } if fv, ok := goflag.Value.(goBoolFlag); ok && fv.IsBoolFlag() { flag.NoOptDefVal = "true" } return flag } // AddGoFlag will add the given *flag.Flag to the pflag.FlagSet func (f *FlagSet) AddGoFlag(goflag *goflag.Flag) { if f.Lookup(goflag.Name) != nil { return } newflag := PFlagFromGoFlag(goflag) f.AddFlag(newflag) } // AddGoFlagSet will add the given *flag.FlagSet to the pflag.FlagSet func (f *FlagSet) AddGoFlagSet(newSet *goflag.FlagSet) { if newSet == nil { return } newSet.VisitAll(func(goflag *goflag.Flag) { f.AddGoFlag(goflag) }) if f.addedGoFlagSets == nil { f.addedGoFlagSets = make([]*goflag.FlagSet, 0) } f.addedGoFlagSets = append(f.addedGoFlagSets, newSet) } // CopyToGoFlagSet will add all current flags to the given Go flag set. // Deprecation remarks get copied into the usage description. // Whenever possible, a flag gets added for which Go flags shows // a proper type in the help message. func (f *FlagSet) CopyToGoFlagSet(newSet *goflag.FlagSet) { f.VisitAll(func(flag *Flag) { usage := flag.Usage if flag.Deprecated != "" { usage += " (DEPRECATED: " + flag.Deprecated + ")" } switch value := flag.Value.(type) { case *stringValue: newSet.StringVar((*string)(value), flag.Name, flag.DefValue, usage) case *intValue: newSet.IntVar((*int)(value), flag.Name, *(*int)(value), usage) case *int64Value: newSet.Int64Var((*int64)(value), flag.Name, *(*int64)(value), usage) case *uintValue: newSet.UintVar((*uint)(value), flag.Name, *(*uint)(value), usage) case *uint64Value: newSet.Uint64Var((*uint64)(value), flag.Name, *(*uint64)(value), usage) case *durationValue: newSet.DurationVar((*time.Duration)(value), flag.Name, *(*time.Duration)(value), usage) case *float64Value: newSet.Float64Var((*float64)(value), flag.Name, *(*float64)(value), usage) default: newSet.Var(flag.Value, flag.Name, usage) } }) } // ParseSkippedFlags explicitly Parses go test flags (i.e. the one starting with '-test.') with goflag.Parse(), // since by default those are skipped by pflag.Parse(). // Typical usage example: `ParseGoTestFlags(os.Args[1:], goflag.CommandLine)` func ParseSkippedFlags(osArgs []string, goFlagSet *goflag.FlagSet) error { var skippedFlags []string for _, f := range osArgs { if isGotestFlag(f) { skippedFlags = append(skippedFlags, f) } } return goFlagSet.Parse(skippedFlags) } ================================================ FILE: vendor/github.com/spf13/pflag/int.go ================================================ package pflag import "strconv" // -- int Value type intValue int func newIntValue(val int, p *int) *intValue { *p = val return (*intValue)(p) } func (i *intValue) Set(s string) error { v, err := strconv.ParseInt(s, 0, 64) *i = intValue(v) return err } func (i *intValue) Type() string { return "int" } func (i *intValue) String() string { return strconv.Itoa(int(*i)) } func intConv(sval string) (interface{}, error) { return strconv.Atoi(sval) } // GetInt return the int value of a flag with the given name func (f *FlagSet) GetInt(name string) (int, error) { val, err := f.getFlagType(name, "int", intConv) if err != nil { return 0, err } return val.(int), nil } // IntVar defines an int flag with specified name, default value, and usage string. // The argument p points to an int variable in which to store the value of the flag. func (f *FlagSet) IntVar(p *int, name string, value int, usage string) { f.VarP(newIntValue(value, p), name, "", usage) } // IntVarP is like IntVar, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) IntVarP(p *int, name, shorthand string, value int, usage string) { f.VarP(newIntValue(value, p), name, shorthand, usage) } // IntVar defines an int flag with specified name, default value, and usage string. // The argument p points to an int variable in which to store the value of the flag. func IntVar(p *int, name string, value int, usage string) { CommandLine.VarP(newIntValue(value, p), name, "", usage) } // IntVarP is like IntVar, but accepts a shorthand letter that can be used after a single dash. func IntVarP(p *int, name, shorthand string, value int, usage string) { CommandLine.VarP(newIntValue(value, p), name, shorthand, usage) } // Int defines an int flag with specified name, default value, and usage string. // The return value is the address of an int variable that stores the value of the flag. func (f *FlagSet) Int(name string, value int, usage string) *int { p := new(int) f.IntVarP(p, name, "", value, usage) return p } // IntP is like Int, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) IntP(name, shorthand string, value int, usage string) *int { p := new(int) f.IntVarP(p, name, shorthand, value, usage) return p } // Int defines an int flag with specified name, default value, and usage string. // The return value is the address of an int variable that stores the value of the flag. func Int(name string, value int, usage string) *int { return CommandLine.IntP(name, "", value, usage) } // IntP is like Int, but accepts a shorthand letter that can be used after a single dash. func IntP(name, shorthand string, value int, usage string) *int { return CommandLine.IntP(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/int16.go ================================================ package pflag import "strconv" // -- int16 Value type int16Value int16 func newInt16Value(val int16, p *int16) *int16Value { *p = val return (*int16Value)(p) } func (i *int16Value) Set(s string) error { v, err := strconv.ParseInt(s, 0, 16) *i = int16Value(v) return err } func (i *int16Value) Type() string { return "int16" } func (i *int16Value) String() string { return strconv.FormatInt(int64(*i), 10) } func int16Conv(sval string) (interface{}, error) { v, err := strconv.ParseInt(sval, 0, 16) if err != nil { return 0, err } return int16(v), nil } // GetInt16 returns the int16 value of a flag with the given name func (f *FlagSet) GetInt16(name string) (int16, error) { val, err := f.getFlagType(name, "int16", int16Conv) if err != nil { return 0, err } return val.(int16), nil } // Int16Var defines an int16 flag with specified name, default value, and usage string. // The argument p points to an int16 variable in which to store the value of the flag. func (f *FlagSet) Int16Var(p *int16, name string, value int16, usage string) { f.VarP(newInt16Value(value, p), name, "", usage) } // Int16VarP is like Int16Var, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Int16VarP(p *int16, name, shorthand string, value int16, usage string) { f.VarP(newInt16Value(value, p), name, shorthand, usage) } // Int16Var defines an int16 flag with specified name, default value, and usage string. // The argument p points to an int16 variable in which to store the value of the flag. func Int16Var(p *int16, name string, value int16, usage string) { CommandLine.VarP(newInt16Value(value, p), name, "", usage) } // Int16VarP is like Int16Var, but accepts a shorthand letter that can be used after a single dash. func Int16VarP(p *int16, name, shorthand string, value int16, usage string) { CommandLine.VarP(newInt16Value(value, p), name, shorthand, usage) } // Int16 defines an int16 flag with specified name, default value, and usage string. // The return value is the address of an int16 variable that stores the value of the flag. func (f *FlagSet) Int16(name string, value int16, usage string) *int16 { p := new(int16) f.Int16VarP(p, name, "", value, usage) return p } // Int16P is like Int16, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Int16P(name, shorthand string, value int16, usage string) *int16 { p := new(int16) f.Int16VarP(p, name, shorthand, value, usage) return p } // Int16 defines an int16 flag with specified name, default value, and usage string. // The return value is the address of an int16 variable that stores the value of the flag. func Int16(name string, value int16, usage string) *int16 { return CommandLine.Int16P(name, "", value, usage) } // Int16P is like Int16, but accepts a shorthand letter that can be used after a single dash. func Int16P(name, shorthand string, value int16, usage string) *int16 { return CommandLine.Int16P(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/int32.go ================================================ package pflag import "strconv" // -- int32 Value type int32Value int32 func newInt32Value(val int32, p *int32) *int32Value { *p = val return (*int32Value)(p) } func (i *int32Value) Set(s string) error { v, err := strconv.ParseInt(s, 0, 32) *i = int32Value(v) return err } func (i *int32Value) Type() string { return "int32" } func (i *int32Value) String() string { return strconv.FormatInt(int64(*i), 10) } func int32Conv(sval string) (interface{}, error) { v, err := strconv.ParseInt(sval, 0, 32) if err != nil { return 0, err } return int32(v), nil } // GetInt32 return the int32 value of a flag with the given name func (f *FlagSet) GetInt32(name string) (int32, error) { val, err := f.getFlagType(name, "int32", int32Conv) if err != nil { return 0, err } return val.(int32), nil } // Int32Var defines an int32 flag with specified name, default value, and usage string. // The argument p points to an int32 variable in which to store the value of the flag. func (f *FlagSet) Int32Var(p *int32, name string, value int32, usage string) { f.VarP(newInt32Value(value, p), name, "", usage) } // Int32VarP is like Int32Var, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Int32VarP(p *int32, name, shorthand string, value int32, usage string) { f.VarP(newInt32Value(value, p), name, shorthand, usage) } // Int32Var defines an int32 flag with specified name, default value, and usage string. // The argument p points to an int32 variable in which to store the value of the flag. func Int32Var(p *int32, name string, value int32, usage string) { CommandLine.VarP(newInt32Value(value, p), name, "", usage) } // Int32VarP is like Int32Var, but accepts a shorthand letter that can be used after a single dash. func Int32VarP(p *int32, name, shorthand string, value int32, usage string) { CommandLine.VarP(newInt32Value(value, p), name, shorthand, usage) } // Int32 defines an int32 flag with specified name, default value, and usage string. // The return value is the address of an int32 variable that stores the value of the flag. func (f *FlagSet) Int32(name string, value int32, usage string) *int32 { p := new(int32) f.Int32VarP(p, name, "", value, usage) return p } // Int32P is like Int32, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Int32P(name, shorthand string, value int32, usage string) *int32 { p := new(int32) f.Int32VarP(p, name, shorthand, value, usage) return p } // Int32 defines an int32 flag with specified name, default value, and usage string. // The return value is the address of an int32 variable that stores the value of the flag. func Int32(name string, value int32, usage string) *int32 { return CommandLine.Int32P(name, "", value, usage) } // Int32P is like Int32, but accepts a shorthand letter that can be used after a single dash. func Int32P(name, shorthand string, value int32, usage string) *int32 { return CommandLine.Int32P(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/int32_slice.go ================================================ package pflag import ( "fmt" "strconv" "strings" ) // -- int32Slice Value type int32SliceValue struct { value *[]int32 changed bool } func newInt32SliceValue(val []int32, p *[]int32) *int32SliceValue { isv := new(int32SliceValue) isv.value = p *isv.value = val return isv } func (s *int32SliceValue) Set(val string) error { ss := strings.Split(val, ",") out := make([]int32, len(ss)) for i, d := range ss { var err error var temp64 int64 temp64, err = strconv.ParseInt(d, 0, 32) if err != nil { return err } out[i] = int32(temp64) } if !s.changed { *s.value = out } else { *s.value = append(*s.value, out...) } s.changed = true return nil } func (s *int32SliceValue) Type() string { return "int32Slice" } func (s *int32SliceValue) String() string { out := make([]string, len(*s.value)) for i, d := range *s.value { out[i] = fmt.Sprintf("%d", d) } return "[" + strings.Join(out, ",") + "]" } func (s *int32SliceValue) fromString(val string) (int32, error) { t64, err := strconv.ParseInt(val, 0, 32) if err != nil { return 0, err } return int32(t64), nil } func (s *int32SliceValue) toString(val int32) string { return fmt.Sprintf("%d", val) } func (s *int32SliceValue) Append(val string) error { i, err := s.fromString(val) if err != nil { return err } *s.value = append(*s.value, i) return nil } func (s *int32SliceValue) Replace(val []string) error { out := make([]int32, len(val)) for i, d := range val { var err error out[i], err = s.fromString(d) if err != nil { return err } } *s.value = out return nil } func (s *int32SliceValue) GetSlice() []string { out := make([]string, len(*s.value)) for i, d := range *s.value { out[i] = s.toString(d) } return out } func int32SliceConv(val string) (interface{}, error) { val = strings.Trim(val, "[]") // Empty string would cause a slice with one (empty) entry if len(val) == 0 { return []int32{}, nil } ss := strings.Split(val, ",") out := make([]int32, len(ss)) for i, d := range ss { var err error var temp64 int64 temp64, err = strconv.ParseInt(d, 0, 32) if err != nil { return nil, err } out[i] = int32(temp64) } return out, nil } // GetInt32Slice return the []int32 value of a flag with the given name func (f *FlagSet) GetInt32Slice(name string) ([]int32, error) { val, err := f.getFlagType(name, "int32Slice", int32SliceConv) if err != nil { return []int32{}, err } return val.([]int32), nil } // Int32SliceVar defines a int32Slice flag with specified name, default value, and usage string. // The argument p points to a []int32 variable in which to store the value of the flag. func (f *FlagSet) Int32SliceVar(p *[]int32, name string, value []int32, usage string) { f.VarP(newInt32SliceValue(value, p), name, "", usage) } // Int32SliceVarP is like Int32SliceVar, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Int32SliceVarP(p *[]int32, name, shorthand string, value []int32, usage string) { f.VarP(newInt32SliceValue(value, p), name, shorthand, usage) } // Int32SliceVar defines a int32[] flag with specified name, default value, and usage string. // The argument p points to a int32[] variable in which to store the value of the flag. func Int32SliceVar(p *[]int32, name string, value []int32, usage string) { CommandLine.VarP(newInt32SliceValue(value, p), name, "", usage) } // Int32SliceVarP is like Int32SliceVar, but accepts a shorthand letter that can be used after a single dash. func Int32SliceVarP(p *[]int32, name, shorthand string, value []int32, usage string) { CommandLine.VarP(newInt32SliceValue(value, p), name, shorthand, usage) } // Int32Slice defines a []int32 flag with specified name, default value, and usage string. // The return value is the address of a []int32 variable that stores the value of the flag. func (f *FlagSet) Int32Slice(name string, value []int32, usage string) *[]int32 { p := []int32{} f.Int32SliceVarP(&p, name, "", value, usage) return &p } // Int32SliceP is like Int32Slice, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Int32SliceP(name, shorthand string, value []int32, usage string) *[]int32 { p := []int32{} f.Int32SliceVarP(&p, name, shorthand, value, usage) return &p } // Int32Slice defines a []int32 flag with specified name, default value, and usage string. // The return value is the address of a []int32 variable that stores the value of the flag. func Int32Slice(name string, value []int32, usage string) *[]int32 { return CommandLine.Int32SliceP(name, "", value, usage) } // Int32SliceP is like Int32Slice, but accepts a shorthand letter that can be used after a single dash. func Int32SliceP(name, shorthand string, value []int32, usage string) *[]int32 { return CommandLine.Int32SliceP(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/int64.go ================================================ package pflag import "strconv" // -- int64 Value type int64Value int64 func newInt64Value(val int64, p *int64) *int64Value { *p = val return (*int64Value)(p) } func (i *int64Value) Set(s string) error { v, err := strconv.ParseInt(s, 0, 64) *i = int64Value(v) return err } func (i *int64Value) Type() string { return "int64" } func (i *int64Value) String() string { return strconv.FormatInt(int64(*i), 10) } func int64Conv(sval string) (interface{}, error) { return strconv.ParseInt(sval, 0, 64) } // GetInt64 return the int64 value of a flag with the given name func (f *FlagSet) GetInt64(name string) (int64, error) { val, err := f.getFlagType(name, "int64", int64Conv) if err != nil { return 0, err } return val.(int64), nil } // Int64Var defines an int64 flag with specified name, default value, and usage string. // The argument p points to an int64 variable in which to store the value of the flag. func (f *FlagSet) Int64Var(p *int64, name string, value int64, usage string) { f.VarP(newInt64Value(value, p), name, "", usage) } // Int64VarP is like Int64Var, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Int64VarP(p *int64, name, shorthand string, value int64, usage string) { f.VarP(newInt64Value(value, p), name, shorthand, usage) } // Int64Var defines an int64 flag with specified name, default value, and usage string. // The argument p points to an int64 variable in which to store the value of the flag. func Int64Var(p *int64, name string, value int64, usage string) { CommandLine.VarP(newInt64Value(value, p), name, "", usage) } // Int64VarP is like Int64Var, but accepts a shorthand letter that can be used after a single dash. func Int64VarP(p *int64, name, shorthand string, value int64, usage string) { CommandLine.VarP(newInt64Value(value, p), name, shorthand, usage) } // Int64 defines an int64 flag with specified name, default value, and usage string. // The return value is the address of an int64 variable that stores the value of the flag. func (f *FlagSet) Int64(name string, value int64, usage string) *int64 { p := new(int64) f.Int64VarP(p, name, "", value, usage) return p } // Int64P is like Int64, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Int64P(name, shorthand string, value int64, usage string) *int64 { p := new(int64) f.Int64VarP(p, name, shorthand, value, usage) return p } // Int64 defines an int64 flag with specified name, default value, and usage string. // The return value is the address of an int64 variable that stores the value of the flag. func Int64(name string, value int64, usage string) *int64 { return CommandLine.Int64P(name, "", value, usage) } // Int64P is like Int64, but accepts a shorthand letter that can be used after a single dash. func Int64P(name, shorthand string, value int64, usage string) *int64 { return CommandLine.Int64P(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/int64_slice.go ================================================ package pflag import ( "fmt" "strconv" "strings" ) // -- int64Slice Value type int64SliceValue struct { value *[]int64 changed bool } func newInt64SliceValue(val []int64, p *[]int64) *int64SliceValue { isv := new(int64SliceValue) isv.value = p *isv.value = val return isv } func (s *int64SliceValue) Set(val string) error { ss := strings.Split(val, ",") out := make([]int64, len(ss)) for i, d := range ss { var err error out[i], err = strconv.ParseInt(d, 0, 64) if err != nil { return err } } if !s.changed { *s.value = out } else { *s.value = append(*s.value, out...) } s.changed = true return nil } func (s *int64SliceValue) Type() string { return "int64Slice" } func (s *int64SliceValue) String() string { out := make([]string, len(*s.value)) for i, d := range *s.value { out[i] = fmt.Sprintf("%d", d) } return "[" + strings.Join(out, ",") + "]" } func (s *int64SliceValue) fromString(val string) (int64, error) { return strconv.ParseInt(val, 0, 64) } func (s *int64SliceValue) toString(val int64) string { return fmt.Sprintf("%d", val) } func (s *int64SliceValue) Append(val string) error { i, err := s.fromString(val) if err != nil { return err } *s.value = append(*s.value, i) return nil } func (s *int64SliceValue) Replace(val []string) error { out := make([]int64, len(val)) for i, d := range val { var err error out[i], err = s.fromString(d) if err != nil { return err } } *s.value = out return nil } func (s *int64SliceValue) GetSlice() []string { out := make([]string, len(*s.value)) for i, d := range *s.value { out[i] = s.toString(d) } return out } func int64SliceConv(val string) (interface{}, error) { val = strings.Trim(val, "[]") // Empty string would cause a slice with one (empty) entry if len(val) == 0 { return []int64{}, nil } ss := strings.Split(val, ",") out := make([]int64, len(ss)) for i, d := range ss { var err error out[i], err = strconv.ParseInt(d, 0, 64) if err != nil { return nil, err } } return out, nil } // GetInt64Slice return the []int64 value of a flag with the given name func (f *FlagSet) GetInt64Slice(name string) ([]int64, error) { val, err := f.getFlagType(name, "int64Slice", int64SliceConv) if err != nil { return []int64{}, err } return val.([]int64), nil } // Int64SliceVar defines a int64Slice flag with specified name, default value, and usage string. // The argument p points to a []int64 variable in which to store the value of the flag. func (f *FlagSet) Int64SliceVar(p *[]int64, name string, value []int64, usage string) { f.VarP(newInt64SliceValue(value, p), name, "", usage) } // Int64SliceVarP is like Int64SliceVar, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Int64SliceVarP(p *[]int64, name, shorthand string, value []int64, usage string) { f.VarP(newInt64SliceValue(value, p), name, shorthand, usage) } // Int64SliceVar defines a int64[] flag with specified name, default value, and usage string. // The argument p points to a int64[] variable in which to store the value of the flag. func Int64SliceVar(p *[]int64, name string, value []int64, usage string) { CommandLine.VarP(newInt64SliceValue(value, p), name, "", usage) } // Int64SliceVarP is like Int64SliceVar, but accepts a shorthand letter that can be used after a single dash. func Int64SliceVarP(p *[]int64, name, shorthand string, value []int64, usage string) { CommandLine.VarP(newInt64SliceValue(value, p), name, shorthand, usage) } // Int64Slice defines a []int64 flag with specified name, default value, and usage string. // The return value is the address of a []int64 variable that stores the value of the flag. func (f *FlagSet) Int64Slice(name string, value []int64, usage string) *[]int64 { p := []int64{} f.Int64SliceVarP(&p, name, "", value, usage) return &p } // Int64SliceP is like Int64Slice, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Int64SliceP(name, shorthand string, value []int64, usage string) *[]int64 { p := []int64{} f.Int64SliceVarP(&p, name, shorthand, value, usage) return &p } // Int64Slice defines a []int64 flag with specified name, default value, and usage string. // The return value is the address of a []int64 variable that stores the value of the flag. func Int64Slice(name string, value []int64, usage string) *[]int64 { return CommandLine.Int64SliceP(name, "", value, usage) } // Int64SliceP is like Int64Slice, but accepts a shorthand letter that can be used after a single dash. func Int64SliceP(name, shorthand string, value []int64, usage string) *[]int64 { return CommandLine.Int64SliceP(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/int8.go ================================================ package pflag import "strconv" // -- int8 Value type int8Value int8 func newInt8Value(val int8, p *int8) *int8Value { *p = val return (*int8Value)(p) } func (i *int8Value) Set(s string) error { v, err := strconv.ParseInt(s, 0, 8) *i = int8Value(v) return err } func (i *int8Value) Type() string { return "int8" } func (i *int8Value) String() string { return strconv.FormatInt(int64(*i), 10) } func int8Conv(sval string) (interface{}, error) { v, err := strconv.ParseInt(sval, 0, 8) if err != nil { return 0, err } return int8(v), nil } // GetInt8 return the int8 value of a flag with the given name func (f *FlagSet) GetInt8(name string) (int8, error) { val, err := f.getFlagType(name, "int8", int8Conv) if err != nil { return 0, err } return val.(int8), nil } // Int8Var defines an int8 flag with specified name, default value, and usage string. // The argument p points to an int8 variable in which to store the value of the flag. func (f *FlagSet) Int8Var(p *int8, name string, value int8, usage string) { f.VarP(newInt8Value(value, p), name, "", usage) } // Int8VarP is like Int8Var, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Int8VarP(p *int8, name, shorthand string, value int8, usage string) { f.VarP(newInt8Value(value, p), name, shorthand, usage) } // Int8Var defines an int8 flag with specified name, default value, and usage string. // The argument p points to an int8 variable in which to store the value of the flag. func Int8Var(p *int8, name string, value int8, usage string) { CommandLine.VarP(newInt8Value(value, p), name, "", usage) } // Int8VarP is like Int8Var, but accepts a shorthand letter that can be used after a single dash. func Int8VarP(p *int8, name, shorthand string, value int8, usage string) { CommandLine.VarP(newInt8Value(value, p), name, shorthand, usage) } // Int8 defines an int8 flag with specified name, default value, and usage string. // The return value is the address of an int8 variable that stores the value of the flag. func (f *FlagSet) Int8(name string, value int8, usage string) *int8 { p := new(int8) f.Int8VarP(p, name, "", value, usage) return p } // Int8P is like Int8, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Int8P(name, shorthand string, value int8, usage string) *int8 { p := new(int8) f.Int8VarP(p, name, shorthand, value, usage) return p } // Int8 defines an int8 flag with specified name, default value, and usage string. // The return value is the address of an int8 variable that stores the value of the flag. func Int8(name string, value int8, usage string) *int8 { return CommandLine.Int8P(name, "", value, usage) } // Int8P is like Int8, but accepts a shorthand letter that can be used after a single dash. func Int8P(name, shorthand string, value int8, usage string) *int8 { return CommandLine.Int8P(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/int_slice.go ================================================ package pflag import ( "fmt" "strconv" "strings" ) // -- intSlice Value type intSliceValue struct { value *[]int changed bool } func newIntSliceValue(val []int, p *[]int) *intSliceValue { isv := new(intSliceValue) isv.value = p *isv.value = val return isv } func (s *intSliceValue) Set(val string) error { ss := strings.Split(val, ",") out := make([]int, len(ss)) for i, d := range ss { var err error out[i], err = strconv.Atoi(d) if err != nil { return err } } if !s.changed { *s.value = out } else { *s.value = append(*s.value, out...) } s.changed = true return nil } func (s *intSliceValue) Type() string { return "intSlice" } func (s *intSliceValue) String() string { out := make([]string, len(*s.value)) for i, d := range *s.value { out[i] = fmt.Sprintf("%d", d) } return "[" + strings.Join(out, ",") + "]" } func (s *intSliceValue) Append(val string) error { i, err := strconv.Atoi(val) if err != nil { return err } *s.value = append(*s.value, i) return nil } func (s *intSliceValue) Replace(val []string) error { out := make([]int, len(val)) for i, d := range val { var err error out[i], err = strconv.Atoi(d) if err != nil { return err } } *s.value = out return nil } func (s *intSliceValue) GetSlice() []string { out := make([]string, len(*s.value)) for i, d := range *s.value { out[i] = strconv.Itoa(d) } return out } func intSliceConv(val string) (interface{}, error) { val = strings.Trim(val, "[]") // Empty string would cause a slice with one (empty) entry if len(val) == 0 { return []int{}, nil } ss := strings.Split(val, ",") out := make([]int, len(ss)) for i, d := range ss { var err error out[i], err = strconv.Atoi(d) if err != nil { return nil, err } } return out, nil } // GetIntSlice return the []int value of a flag with the given name func (f *FlagSet) GetIntSlice(name string) ([]int, error) { val, err := f.getFlagType(name, "intSlice", intSliceConv) if err != nil { return []int{}, err } return val.([]int), nil } // IntSliceVar defines a intSlice flag with specified name, default value, and usage string. // The argument p points to a []int variable in which to store the value of the flag. func (f *FlagSet) IntSliceVar(p *[]int, name string, value []int, usage string) { f.VarP(newIntSliceValue(value, p), name, "", usage) } // IntSliceVarP is like IntSliceVar, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) IntSliceVarP(p *[]int, name, shorthand string, value []int, usage string) { f.VarP(newIntSliceValue(value, p), name, shorthand, usage) } // IntSliceVar defines a int[] flag with specified name, default value, and usage string. // The argument p points to a int[] variable in which to store the value of the flag. func IntSliceVar(p *[]int, name string, value []int, usage string) { CommandLine.VarP(newIntSliceValue(value, p), name, "", usage) } // IntSliceVarP is like IntSliceVar, but accepts a shorthand letter that can be used after a single dash. func IntSliceVarP(p *[]int, name, shorthand string, value []int, usage string) { CommandLine.VarP(newIntSliceValue(value, p), name, shorthand, usage) } // IntSlice defines a []int flag with specified name, default value, and usage string. // The return value is the address of a []int variable that stores the value of the flag. func (f *FlagSet) IntSlice(name string, value []int, usage string) *[]int { p := []int{} f.IntSliceVarP(&p, name, "", value, usage) return &p } // IntSliceP is like IntSlice, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) IntSliceP(name, shorthand string, value []int, usage string) *[]int { p := []int{} f.IntSliceVarP(&p, name, shorthand, value, usage) return &p } // IntSlice defines a []int flag with specified name, default value, and usage string. // The return value is the address of a []int variable that stores the value of the flag. func IntSlice(name string, value []int, usage string) *[]int { return CommandLine.IntSliceP(name, "", value, usage) } // IntSliceP is like IntSlice, but accepts a shorthand letter that can be used after a single dash. func IntSliceP(name, shorthand string, value []int, usage string) *[]int { return CommandLine.IntSliceP(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/ip.go ================================================ package pflag import ( "fmt" "net" "strings" ) // -- net.IP value type ipValue net.IP func newIPValue(val net.IP, p *net.IP) *ipValue { *p = val return (*ipValue)(p) } func (i *ipValue) String() string { return net.IP(*i).String() } func (i *ipValue) Set(s string) error { if s == "" { return nil } ip := net.ParseIP(strings.TrimSpace(s)) if ip == nil { return fmt.Errorf("failed to parse IP: %q", s) } *i = ipValue(ip) return nil } func (i *ipValue) Type() string { return "ip" } func ipConv(sval string) (interface{}, error) { ip := net.ParseIP(sval) if ip != nil { return ip, nil } return nil, fmt.Errorf("invalid string being converted to IP address: %s", sval) } // GetIP return the net.IP value of a flag with the given name func (f *FlagSet) GetIP(name string) (net.IP, error) { val, err := f.getFlagType(name, "ip", ipConv) if err != nil { return nil, err } return val.(net.IP), nil } // IPVar defines an net.IP flag with specified name, default value, and usage string. // The argument p points to an net.IP variable in which to store the value of the flag. func (f *FlagSet) IPVar(p *net.IP, name string, value net.IP, usage string) { f.VarP(newIPValue(value, p), name, "", usage) } // IPVarP is like IPVar, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) IPVarP(p *net.IP, name, shorthand string, value net.IP, usage string) { f.VarP(newIPValue(value, p), name, shorthand, usage) } // IPVar defines an net.IP flag with specified name, default value, and usage string. // The argument p points to an net.IP variable in which to store the value of the flag. func IPVar(p *net.IP, name string, value net.IP, usage string) { CommandLine.VarP(newIPValue(value, p), name, "", usage) } // IPVarP is like IPVar, but accepts a shorthand letter that can be used after a single dash. func IPVarP(p *net.IP, name, shorthand string, value net.IP, usage string) { CommandLine.VarP(newIPValue(value, p), name, shorthand, usage) } // IP defines an net.IP flag with specified name, default value, and usage string. // The return value is the address of an net.IP variable that stores the value of the flag. func (f *FlagSet) IP(name string, value net.IP, usage string) *net.IP { p := new(net.IP) f.IPVarP(p, name, "", value, usage) return p } // IPP is like IP, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) IPP(name, shorthand string, value net.IP, usage string) *net.IP { p := new(net.IP) f.IPVarP(p, name, shorthand, value, usage) return p } // IP defines an net.IP flag with specified name, default value, and usage string. // The return value is the address of an net.IP variable that stores the value of the flag. func IP(name string, value net.IP, usage string) *net.IP { return CommandLine.IPP(name, "", value, usage) } // IPP is like IP, but accepts a shorthand letter that can be used after a single dash. func IPP(name, shorthand string, value net.IP, usage string) *net.IP { return CommandLine.IPP(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/ip_slice.go ================================================ package pflag import ( "fmt" "io" "net" "strings" ) // -- ipSlice Value type ipSliceValue struct { value *[]net.IP changed bool } func newIPSliceValue(val []net.IP, p *[]net.IP) *ipSliceValue { ipsv := new(ipSliceValue) ipsv.value = p *ipsv.value = val return ipsv } // Set converts, and assigns, the comma-separated IP argument string representation as the []net.IP value of this flag. // If Set is called on a flag that already has a []net.IP assigned, the newly converted values will be appended. func (s *ipSliceValue) Set(val string) error { // remove all quote characters rmQuote := strings.NewReplacer(`"`, "", `'`, "", "`", "") // read flag arguments with CSV parser ipStrSlice, err := readAsCSV(rmQuote.Replace(val)) if err != nil && err != io.EOF { return err } // parse ip values into slice out := make([]net.IP, 0, len(ipStrSlice)) for _, ipStr := range ipStrSlice { ip := net.ParseIP(strings.TrimSpace(ipStr)) if ip == nil { return fmt.Errorf("invalid string being converted to IP address: %s", ipStr) } out = append(out, ip) } if !s.changed { *s.value = out } else { *s.value = append(*s.value, out...) } s.changed = true return nil } // Type returns a string that uniquely represents this flag's type. func (s *ipSliceValue) Type() string { return "ipSlice" } // String defines a "native" format for this net.IP slice flag value. func (s *ipSliceValue) String() string { ipStrSlice := make([]string, len(*s.value)) for i, ip := range *s.value { ipStrSlice[i] = ip.String() } out, _ := writeAsCSV(ipStrSlice) return "[" + out + "]" } func (s *ipSliceValue) fromString(val string) (net.IP, error) { return net.ParseIP(strings.TrimSpace(val)), nil } func (s *ipSliceValue) toString(val net.IP) string { return val.String() } func (s *ipSliceValue) Append(val string) error { i, err := s.fromString(val) if err != nil { return err } *s.value = append(*s.value, i) return nil } func (s *ipSliceValue) Replace(val []string) error { out := make([]net.IP, len(val)) for i, d := range val { var err error out[i], err = s.fromString(d) if err != nil { return err } } *s.value = out return nil } func (s *ipSliceValue) GetSlice() []string { out := make([]string, len(*s.value)) for i, d := range *s.value { out[i] = s.toString(d) } return out } func ipSliceConv(val string) (interface{}, error) { val = strings.Trim(val, "[]") // Empty string would cause a slice with one (empty) entry if len(val) == 0 { return []net.IP{}, nil } ss := strings.Split(val, ",") out := make([]net.IP, len(ss)) for i, sval := range ss { ip := net.ParseIP(strings.TrimSpace(sval)) if ip == nil { return nil, fmt.Errorf("invalid string being converted to IP address: %s", sval) } out[i] = ip } return out, nil } // GetIPSlice returns the []net.IP value of a flag with the given name func (f *FlagSet) GetIPSlice(name string) ([]net.IP, error) { val, err := f.getFlagType(name, "ipSlice", ipSliceConv) if err != nil { return []net.IP{}, err } return val.([]net.IP), nil } // IPSliceVar defines a ipSlice flag with specified name, default value, and usage string. // The argument p points to a []net.IP variable in which to store the value of the flag. func (f *FlagSet) IPSliceVar(p *[]net.IP, name string, value []net.IP, usage string) { f.VarP(newIPSliceValue(value, p), name, "", usage) } // IPSliceVarP is like IPSliceVar, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) IPSliceVarP(p *[]net.IP, name, shorthand string, value []net.IP, usage string) { f.VarP(newIPSliceValue(value, p), name, shorthand, usage) } // IPSliceVar defines a []net.IP flag with specified name, default value, and usage string. // The argument p points to a []net.IP variable in which to store the value of the flag. func IPSliceVar(p *[]net.IP, name string, value []net.IP, usage string) { CommandLine.VarP(newIPSliceValue(value, p), name, "", usage) } // IPSliceVarP is like IPSliceVar, but accepts a shorthand letter that can be used after a single dash. func IPSliceVarP(p *[]net.IP, name, shorthand string, value []net.IP, usage string) { CommandLine.VarP(newIPSliceValue(value, p), name, shorthand, usage) } // IPSlice defines a []net.IP flag with specified name, default value, and usage string. // The return value is the address of a []net.IP variable that stores the value of that flag. func (f *FlagSet) IPSlice(name string, value []net.IP, usage string) *[]net.IP { p := []net.IP{} f.IPSliceVarP(&p, name, "", value, usage) return &p } // IPSliceP is like IPSlice, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) IPSliceP(name, shorthand string, value []net.IP, usage string) *[]net.IP { p := []net.IP{} f.IPSliceVarP(&p, name, shorthand, value, usage) return &p } // IPSlice defines a []net.IP flag with specified name, default value, and usage string. // The return value is the address of a []net.IP variable that stores the value of the flag. func IPSlice(name string, value []net.IP, usage string) *[]net.IP { return CommandLine.IPSliceP(name, "", value, usage) } // IPSliceP is like IPSlice, but accepts a shorthand letter that can be used after a single dash. func IPSliceP(name, shorthand string, value []net.IP, usage string) *[]net.IP { return CommandLine.IPSliceP(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/ipmask.go ================================================ package pflag import ( "fmt" "net" "strconv" ) // -- net.IPMask value type ipMaskValue net.IPMask func newIPMaskValue(val net.IPMask, p *net.IPMask) *ipMaskValue { *p = val return (*ipMaskValue)(p) } func (i *ipMaskValue) String() string { return net.IPMask(*i).String() } func (i *ipMaskValue) Set(s string) error { ip := ParseIPv4Mask(s) if ip == nil { return fmt.Errorf("failed to parse IP mask: %q", s) } *i = ipMaskValue(ip) return nil } func (i *ipMaskValue) Type() string { return "ipMask" } // ParseIPv4Mask written in IP form (e.g. 255.255.255.0). // This function should really belong to the net package. func ParseIPv4Mask(s string) net.IPMask { mask := net.ParseIP(s) if mask == nil { if len(s) != 8 { return nil } // net.IPMask.String() actually outputs things like ffffff00 // so write a horrible parser for that as well :-( m := []int{} for i := 0; i < 4; i++ { b := "0x" + s[2*i:2*i+2] d, err := strconv.ParseInt(b, 0, 0) if err != nil { return nil } m = append(m, int(d)) } s := fmt.Sprintf("%d.%d.%d.%d", m[0], m[1], m[2], m[3]) mask = net.ParseIP(s) if mask == nil { return nil } } return net.IPv4Mask(mask[12], mask[13], mask[14], mask[15]) } func parseIPv4Mask(sval string) (interface{}, error) { mask := ParseIPv4Mask(sval) if mask == nil { return nil, fmt.Errorf("unable to parse %s as net.IPMask", sval) } return mask, nil } // GetIPv4Mask return the net.IPv4Mask value of a flag with the given name func (f *FlagSet) GetIPv4Mask(name string) (net.IPMask, error) { val, err := f.getFlagType(name, "ipMask", parseIPv4Mask) if err != nil { return nil, err } return val.(net.IPMask), nil } // IPMaskVar defines an net.IPMask flag with specified name, default value, and usage string. // The argument p points to an net.IPMask variable in which to store the value of the flag. func (f *FlagSet) IPMaskVar(p *net.IPMask, name string, value net.IPMask, usage string) { f.VarP(newIPMaskValue(value, p), name, "", usage) } // IPMaskVarP is like IPMaskVar, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) IPMaskVarP(p *net.IPMask, name, shorthand string, value net.IPMask, usage string) { f.VarP(newIPMaskValue(value, p), name, shorthand, usage) } // IPMaskVar defines an net.IPMask flag with specified name, default value, and usage string. // The argument p points to an net.IPMask variable in which to store the value of the flag. func IPMaskVar(p *net.IPMask, name string, value net.IPMask, usage string) { CommandLine.VarP(newIPMaskValue(value, p), name, "", usage) } // IPMaskVarP is like IPMaskVar, but accepts a shorthand letter that can be used after a single dash. func IPMaskVarP(p *net.IPMask, name, shorthand string, value net.IPMask, usage string) { CommandLine.VarP(newIPMaskValue(value, p), name, shorthand, usage) } // IPMask defines an net.IPMask flag with specified name, default value, and usage string. // The return value is the address of an net.IPMask variable that stores the value of the flag. func (f *FlagSet) IPMask(name string, value net.IPMask, usage string) *net.IPMask { p := new(net.IPMask) f.IPMaskVarP(p, name, "", value, usage) return p } // IPMaskP is like IPMask, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) IPMaskP(name, shorthand string, value net.IPMask, usage string) *net.IPMask { p := new(net.IPMask) f.IPMaskVarP(p, name, shorthand, value, usage) return p } // IPMask defines an net.IPMask flag with specified name, default value, and usage string. // The return value is the address of an net.IPMask variable that stores the value of the flag. func IPMask(name string, value net.IPMask, usage string) *net.IPMask { return CommandLine.IPMaskP(name, "", value, usage) } // IPMaskP is like IP, but accepts a shorthand letter that can be used after a single dash. func IPMaskP(name, shorthand string, value net.IPMask, usage string) *net.IPMask { return CommandLine.IPMaskP(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/ipnet.go ================================================ package pflag import ( "fmt" "net" "strings" ) // IPNet adapts net.IPNet for use as a flag. type ipNetValue net.IPNet func (ipnet ipNetValue) String() string { n := net.IPNet(ipnet) return n.String() } func (ipnet *ipNetValue) Set(value string) error { _, n, err := net.ParseCIDR(strings.TrimSpace(value)) if err != nil { return err } *ipnet = ipNetValue(*n) return nil } func (*ipNetValue) Type() string { return "ipNet" } func newIPNetValue(val net.IPNet, p *net.IPNet) *ipNetValue { *p = val return (*ipNetValue)(p) } func ipNetConv(sval string) (interface{}, error) { _, n, err := net.ParseCIDR(strings.TrimSpace(sval)) if err == nil { return *n, nil } return nil, fmt.Errorf("invalid string being converted to IPNet: %s", sval) } // GetIPNet return the net.IPNet value of a flag with the given name func (f *FlagSet) GetIPNet(name string) (net.IPNet, error) { val, err := f.getFlagType(name, "ipNet", ipNetConv) if err != nil { return net.IPNet{}, err } return val.(net.IPNet), nil } // IPNetVar defines an net.IPNet flag with specified name, default value, and usage string. // The argument p points to an net.IPNet variable in which to store the value of the flag. func (f *FlagSet) IPNetVar(p *net.IPNet, name string, value net.IPNet, usage string) { f.VarP(newIPNetValue(value, p), name, "", usage) } // IPNetVarP is like IPNetVar, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) IPNetVarP(p *net.IPNet, name, shorthand string, value net.IPNet, usage string) { f.VarP(newIPNetValue(value, p), name, shorthand, usage) } // IPNetVar defines an net.IPNet flag with specified name, default value, and usage string. // The argument p points to an net.IPNet variable in which to store the value of the flag. func IPNetVar(p *net.IPNet, name string, value net.IPNet, usage string) { CommandLine.VarP(newIPNetValue(value, p), name, "", usage) } // IPNetVarP is like IPNetVar, but accepts a shorthand letter that can be used after a single dash. func IPNetVarP(p *net.IPNet, name, shorthand string, value net.IPNet, usage string) { CommandLine.VarP(newIPNetValue(value, p), name, shorthand, usage) } // IPNet defines an net.IPNet flag with specified name, default value, and usage string. // The return value is the address of an net.IPNet variable that stores the value of the flag. func (f *FlagSet) IPNet(name string, value net.IPNet, usage string) *net.IPNet { p := new(net.IPNet) f.IPNetVarP(p, name, "", value, usage) return p } // IPNetP is like IPNet, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) IPNetP(name, shorthand string, value net.IPNet, usage string) *net.IPNet { p := new(net.IPNet) f.IPNetVarP(p, name, shorthand, value, usage) return p } // IPNet defines an net.IPNet flag with specified name, default value, and usage string. // The return value is the address of an net.IPNet variable that stores the value of the flag. func IPNet(name string, value net.IPNet, usage string) *net.IPNet { return CommandLine.IPNetP(name, "", value, usage) } // IPNetP is like IPNet, but accepts a shorthand letter that can be used after a single dash. func IPNetP(name, shorthand string, value net.IPNet, usage string) *net.IPNet { return CommandLine.IPNetP(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/ipnet_slice.go ================================================ package pflag import ( "fmt" "io" "net" "strings" ) // -- ipNetSlice Value type ipNetSliceValue struct { value *[]net.IPNet changed bool } func newIPNetSliceValue(val []net.IPNet, p *[]net.IPNet) *ipNetSliceValue { ipnsv := new(ipNetSliceValue) ipnsv.value = p *ipnsv.value = val return ipnsv } // Set converts, and assigns, the comma-separated IPNet argument string representation as the []net.IPNet value of this flag. // If Set is called on a flag that already has a []net.IPNet assigned, the newly converted values will be appended. func (s *ipNetSliceValue) Set(val string) error { // remove all quote characters rmQuote := strings.NewReplacer(`"`, "", `'`, "", "`", "") // read flag arguments with CSV parser ipNetStrSlice, err := readAsCSV(rmQuote.Replace(val)) if err != nil && err != io.EOF { return err } // parse ip values into slice out := make([]net.IPNet, 0, len(ipNetStrSlice)) for _, ipNetStr := range ipNetStrSlice { _, n, err := net.ParseCIDR(strings.TrimSpace(ipNetStr)) if err != nil { return fmt.Errorf("invalid string being converted to CIDR: %s", ipNetStr) } out = append(out, *n) } if !s.changed { *s.value = out } else { *s.value = append(*s.value, out...) } s.changed = true return nil } // Type returns a string that uniquely represents this flag's type. func (s *ipNetSliceValue) Type() string { return "ipNetSlice" } // String defines a "native" format for this net.IPNet slice flag value. func (s *ipNetSliceValue) String() string { ipNetStrSlice := make([]string, len(*s.value)) for i, n := range *s.value { ipNetStrSlice[i] = n.String() } out, _ := writeAsCSV(ipNetStrSlice) return "[" + out + "]" } func ipNetSliceConv(val string) (interface{}, error) { val = strings.Trim(val, "[]") // Empty string would cause a slice with one (empty) entry if len(val) == 0 { return []net.IPNet{}, nil } ss := strings.Split(val, ",") out := make([]net.IPNet, len(ss)) for i, sval := range ss { _, n, err := net.ParseCIDR(strings.TrimSpace(sval)) if err != nil { return nil, fmt.Errorf("invalid string being converted to CIDR: %s", sval) } out[i] = *n } return out, nil } // GetIPNetSlice returns the []net.IPNet value of a flag with the given name func (f *FlagSet) GetIPNetSlice(name string) ([]net.IPNet, error) { val, err := f.getFlagType(name, "ipNetSlice", ipNetSliceConv) if err != nil { return []net.IPNet{}, err } return val.([]net.IPNet), nil } // IPNetSliceVar defines a ipNetSlice flag with specified name, default value, and usage string. // The argument p points to a []net.IPNet variable in which to store the value of the flag. func (f *FlagSet) IPNetSliceVar(p *[]net.IPNet, name string, value []net.IPNet, usage string) { f.VarP(newIPNetSliceValue(value, p), name, "", usage) } // IPNetSliceVarP is like IPNetSliceVar, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) IPNetSliceVarP(p *[]net.IPNet, name, shorthand string, value []net.IPNet, usage string) { f.VarP(newIPNetSliceValue(value, p), name, shorthand, usage) } // IPNetSliceVar defines a []net.IPNet flag with specified name, default value, and usage string. // The argument p points to a []net.IPNet variable in which to store the value of the flag. func IPNetSliceVar(p *[]net.IPNet, name string, value []net.IPNet, usage string) { CommandLine.VarP(newIPNetSliceValue(value, p), name, "", usage) } // IPNetSliceVarP is like IPNetSliceVar, but accepts a shorthand letter that can be used after a single dash. func IPNetSliceVarP(p *[]net.IPNet, name, shorthand string, value []net.IPNet, usage string) { CommandLine.VarP(newIPNetSliceValue(value, p), name, shorthand, usage) } // IPNetSlice defines a []net.IPNet flag with specified name, default value, and usage string. // The return value is the address of a []net.IPNet variable that stores the value of that flag. func (f *FlagSet) IPNetSlice(name string, value []net.IPNet, usage string) *[]net.IPNet { p := []net.IPNet{} f.IPNetSliceVarP(&p, name, "", value, usage) return &p } // IPNetSliceP is like IPNetSlice, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) IPNetSliceP(name, shorthand string, value []net.IPNet, usage string) *[]net.IPNet { p := []net.IPNet{} f.IPNetSliceVarP(&p, name, shorthand, value, usage) return &p } // IPNetSlice defines a []net.IPNet flag with specified name, default value, and usage string. // The return value is the address of a []net.IP variable that stores the value of the flag. func IPNetSlice(name string, value []net.IPNet, usage string) *[]net.IPNet { return CommandLine.IPNetSliceP(name, "", value, usage) } // IPNetSliceP is like IPNetSlice, but accepts a shorthand letter that can be used after a single dash. func IPNetSliceP(name, shorthand string, value []net.IPNet, usage string) *[]net.IPNet { return CommandLine.IPNetSliceP(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/string.go ================================================ package pflag // -- string Value type stringValue string func newStringValue(val string, p *string) *stringValue { *p = val return (*stringValue)(p) } func (s *stringValue) Set(val string) error { *s = stringValue(val) return nil } func (s *stringValue) Type() string { return "string" } func (s *stringValue) String() string { return string(*s) } func stringConv(sval string) (interface{}, error) { return sval, nil } // GetString return the string value of a flag with the given name func (f *FlagSet) GetString(name string) (string, error) { val, err := f.getFlagType(name, "string", stringConv) if err != nil { return "", err } return val.(string), nil } // StringVar defines a string flag with specified name, default value, and usage string. // The argument p points to a string variable in which to store the value of the flag. func (f *FlagSet) StringVar(p *string, name string, value string, usage string) { f.VarP(newStringValue(value, p), name, "", usage) } // StringVarP is like StringVar, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) StringVarP(p *string, name, shorthand string, value string, usage string) { f.VarP(newStringValue(value, p), name, shorthand, usage) } // StringVar defines a string flag with specified name, default value, and usage string. // The argument p points to a string variable in which to store the value of the flag. func StringVar(p *string, name string, value string, usage string) { CommandLine.VarP(newStringValue(value, p), name, "", usage) } // StringVarP is like StringVar, but accepts a shorthand letter that can be used after a single dash. func StringVarP(p *string, name, shorthand string, value string, usage string) { CommandLine.VarP(newStringValue(value, p), name, shorthand, usage) } // String defines a string flag with specified name, default value, and usage string. // The return value is the address of a string variable that stores the value of the flag. func (f *FlagSet) String(name string, value string, usage string) *string { p := new(string) f.StringVarP(p, name, "", value, usage) return p } // StringP is like String, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) StringP(name, shorthand string, value string, usage string) *string { p := new(string) f.StringVarP(p, name, shorthand, value, usage) return p } // String defines a string flag with specified name, default value, and usage string. // The return value is the address of a string variable that stores the value of the flag. func String(name string, value string, usage string) *string { return CommandLine.StringP(name, "", value, usage) } // StringP is like String, but accepts a shorthand letter that can be used after a single dash. func StringP(name, shorthand string, value string, usage string) *string { return CommandLine.StringP(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/string_array.go ================================================ package pflag // -- stringArray Value type stringArrayValue struct { value *[]string changed bool } func newStringArrayValue(val []string, p *[]string) *stringArrayValue { ssv := new(stringArrayValue) ssv.value = p *ssv.value = val return ssv } func (s *stringArrayValue) Set(val string) error { if !s.changed { *s.value = []string{val} s.changed = true } else { *s.value = append(*s.value, val) } return nil } func (s *stringArrayValue) Append(val string) error { *s.value = append(*s.value, val) return nil } func (s *stringArrayValue) Replace(val []string) error { out := make([]string, len(val)) for i, d := range val { out[i] = d } *s.value = out return nil } func (s *stringArrayValue) GetSlice() []string { out := make([]string, len(*s.value)) for i, d := range *s.value { out[i] = d } return out } func (s *stringArrayValue) Type() string { return "stringArray" } func (s *stringArrayValue) String() string { str, _ := writeAsCSV(*s.value) return "[" + str + "]" } func stringArrayConv(sval string) (interface{}, error) { sval = sval[1 : len(sval)-1] // An empty string would cause a array with one (empty) string if len(sval) == 0 { return []string{}, nil } return readAsCSV(sval) } // GetStringArray return the []string value of a flag with the given name func (f *FlagSet) GetStringArray(name string) ([]string, error) { val, err := f.getFlagType(name, "stringArray", stringArrayConv) if err != nil { return []string{}, err } return val.([]string), nil } // StringArrayVar defines a string flag with specified name, default value, and usage string. // The argument p points to a []string variable in which to store the values of the multiple flags. // The value of each argument will not try to be separated by comma. Use a StringSlice for that. func (f *FlagSet) StringArrayVar(p *[]string, name string, value []string, usage string) { f.VarP(newStringArrayValue(value, p), name, "", usage) } // StringArrayVarP is like StringArrayVar, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) StringArrayVarP(p *[]string, name, shorthand string, value []string, usage string) { f.VarP(newStringArrayValue(value, p), name, shorthand, usage) } // StringArrayVar defines a string flag with specified name, default value, and usage string. // The argument p points to a []string variable in which to store the value of the flag. // The value of each argument will not try to be separated by comma. Use a StringSlice for that. func StringArrayVar(p *[]string, name string, value []string, usage string) { CommandLine.VarP(newStringArrayValue(value, p), name, "", usage) } // StringArrayVarP is like StringArrayVar, but accepts a shorthand letter that can be used after a single dash. func StringArrayVarP(p *[]string, name, shorthand string, value []string, usage string) { CommandLine.VarP(newStringArrayValue(value, p), name, shorthand, usage) } // StringArray defines a string flag with specified name, default value, and usage string. // The return value is the address of a []string variable that stores the value of the flag. // The value of each argument will not try to be separated by comma. Use a StringSlice for that. func (f *FlagSet) StringArray(name string, value []string, usage string) *[]string { p := []string{} f.StringArrayVarP(&p, name, "", value, usage) return &p } // StringArrayP is like StringArray, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) StringArrayP(name, shorthand string, value []string, usage string) *[]string { p := []string{} f.StringArrayVarP(&p, name, shorthand, value, usage) return &p } // StringArray defines a string flag with specified name, default value, and usage string. // The return value is the address of a []string variable that stores the value of the flag. // The value of each argument will not try to be separated by comma. Use a StringSlice for that. func StringArray(name string, value []string, usage string) *[]string { return CommandLine.StringArrayP(name, "", value, usage) } // StringArrayP is like StringArray, but accepts a shorthand letter that can be used after a single dash. func StringArrayP(name, shorthand string, value []string, usage string) *[]string { return CommandLine.StringArrayP(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/string_slice.go ================================================ package pflag import ( "bytes" "encoding/csv" "strings" ) // -- stringSlice Value type stringSliceValue struct { value *[]string changed bool } func newStringSliceValue(val []string, p *[]string) *stringSliceValue { ssv := new(stringSliceValue) ssv.value = p *ssv.value = val return ssv } func readAsCSV(val string) ([]string, error) { if val == "" { return []string{}, nil } stringReader := strings.NewReader(val) csvReader := csv.NewReader(stringReader) return csvReader.Read() } func writeAsCSV(vals []string) (string, error) { b := &bytes.Buffer{} w := csv.NewWriter(b) err := w.Write(vals) if err != nil { return "", err } w.Flush() return strings.TrimSuffix(b.String(), "\n"), nil } func (s *stringSliceValue) Set(val string) error { v, err := readAsCSV(val) if err != nil { return err } if !s.changed { *s.value = v } else { *s.value = append(*s.value, v...) } s.changed = true return nil } func (s *stringSliceValue) Type() string { return "stringSlice" } func (s *stringSliceValue) String() string { str, _ := writeAsCSV(*s.value) return "[" + str + "]" } func (s *stringSliceValue) Append(val string) error { *s.value = append(*s.value, val) return nil } func (s *stringSliceValue) Replace(val []string) error { *s.value = val return nil } func (s *stringSliceValue) GetSlice() []string { return *s.value } func stringSliceConv(sval string) (interface{}, error) { sval = sval[1 : len(sval)-1] // An empty string would cause a slice with one (empty) string if len(sval) == 0 { return []string{}, nil } return readAsCSV(sval) } // GetStringSlice return the []string value of a flag with the given name func (f *FlagSet) GetStringSlice(name string) ([]string, error) { val, err := f.getFlagType(name, "stringSlice", stringSliceConv) if err != nil { return []string{}, err } return val.([]string), nil } // StringSliceVar defines a string flag with specified name, default value, and usage string. // The argument p points to a []string variable in which to store the value of the flag. // Compared to StringArray flags, StringSlice flags take comma-separated value as arguments and split them accordingly. // For example: // --ss="v1,v2" --ss="v3" // will result in // []string{"v1", "v2", "v3"} func (f *FlagSet) StringSliceVar(p *[]string, name string, value []string, usage string) { f.VarP(newStringSliceValue(value, p), name, "", usage) } // StringSliceVarP is like StringSliceVar, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) StringSliceVarP(p *[]string, name, shorthand string, value []string, usage string) { f.VarP(newStringSliceValue(value, p), name, shorthand, usage) } // StringSliceVar defines a string flag with specified name, default value, and usage string. // The argument p points to a []string variable in which to store the value of the flag. // Compared to StringArray flags, StringSlice flags take comma-separated value as arguments and split them accordingly. // For example: // --ss="v1,v2" --ss="v3" // will result in // []string{"v1", "v2", "v3"} func StringSliceVar(p *[]string, name string, value []string, usage string) { CommandLine.VarP(newStringSliceValue(value, p), name, "", usage) } // StringSliceVarP is like StringSliceVar, but accepts a shorthand letter that can be used after a single dash. func StringSliceVarP(p *[]string, name, shorthand string, value []string, usage string) { CommandLine.VarP(newStringSliceValue(value, p), name, shorthand, usage) } // StringSlice defines a string flag with specified name, default value, and usage string. // The return value is the address of a []string variable that stores the value of the flag. // Compared to StringArray flags, StringSlice flags take comma-separated value as arguments and split them accordingly. // For example: // --ss="v1,v2" --ss="v3" // will result in // []string{"v1", "v2", "v3"} func (f *FlagSet) StringSlice(name string, value []string, usage string) *[]string { p := []string{} f.StringSliceVarP(&p, name, "", value, usage) return &p } // StringSliceP is like StringSlice, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) StringSliceP(name, shorthand string, value []string, usage string) *[]string { p := []string{} f.StringSliceVarP(&p, name, shorthand, value, usage) return &p } // StringSlice defines a string flag with specified name, default value, and usage string. // The return value is the address of a []string variable that stores the value of the flag. // Compared to StringArray flags, StringSlice flags take comma-separated value as arguments and split them accordingly. // For example: // --ss="v1,v2" --ss="v3" // will result in // []string{"v1", "v2", "v3"} func StringSlice(name string, value []string, usage string) *[]string { return CommandLine.StringSliceP(name, "", value, usage) } // StringSliceP is like StringSlice, but accepts a shorthand letter that can be used after a single dash. func StringSliceP(name, shorthand string, value []string, usage string) *[]string { return CommandLine.StringSliceP(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/string_to_int.go ================================================ package pflag import ( "bytes" "fmt" "strconv" "strings" ) // -- stringToInt Value type stringToIntValue struct { value *map[string]int changed bool } func newStringToIntValue(val map[string]int, p *map[string]int) *stringToIntValue { ssv := new(stringToIntValue) ssv.value = p *ssv.value = val return ssv } // Format: a=1,b=2 func (s *stringToIntValue) Set(val string) error { ss := strings.Split(val, ",") out := make(map[string]int, len(ss)) for _, pair := range ss { kv := strings.SplitN(pair, "=", 2) if len(kv) != 2 { return fmt.Errorf("%s must be formatted as key=value", pair) } var err error out[kv[0]], err = strconv.Atoi(kv[1]) if err != nil { return err } } if !s.changed { *s.value = out } else { for k, v := range out { (*s.value)[k] = v } } s.changed = true return nil } func (s *stringToIntValue) Type() string { return "stringToInt" } func (s *stringToIntValue) String() string { var buf bytes.Buffer i := 0 for k, v := range *s.value { if i > 0 { buf.WriteRune(',') } buf.WriteString(k) buf.WriteRune('=') buf.WriteString(strconv.Itoa(v)) i++ } return "[" + buf.String() + "]" } func stringToIntConv(val string) (interface{}, error) { val = strings.Trim(val, "[]") // An empty string would cause an empty map if len(val) == 0 { return map[string]int{}, nil } ss := strings.Split(val, ",") out := make(map[string]int, len(ss)) for _, pair := range ss { kv := strings.SplitN(pair, "=", 2) if len(kv) != 2 { return nil, fmt.Errorf("%s must be formatted as key=value", pair) } var err error out[kv[0]], err = strconv.Atoi(kv[1]) if err != nil { return nil, err } } return out, nil } // GetStringToInt return the map[string]int value of a flag with the given name func (f *FlagSet) GetStringToInt(name string) (map[string]int, error) { val, err := f.getFlagType(name, "stringToInt", stringToIntConv) if err != nil { return map[string]int{}, err } return val.(map[string]int), nil } // StringToIntVar defines a string flag with specified name, default value, and usage string. // The argument p points to a map[string]int variable in which to store the values of the multiple flags. // The value of each argument will not try to be separated by comma func (f *FlagSet) StringToIntVar(p *map[string]int, name string, value map[string]int, usage string) { f.VarP(newStringToIntValue(value, p), name, "", usage) } // StringToIntVarP is like StringToIntVar, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) StringToIntVarP(p *map[string]int, name, shorthand string, value map[string]int, usage string) { f.VarP(newStringToIntValue(value, p), name, shorthand, usage) } // StringToIntVar defines a string flag with specified name, default value, and usage string. // The argument p points to a map[string]int variable in which to store the value of the flag. // The value of each argument will not try to be separated by comma func StringToIntVar(p *map[string]int, name string, value map[string]int, usage string) { CommandLine.VarP(newStringToIntValue(value, p), name, "", usage) } // StringToIntVarP is like StringToIntVar, but accepts a shorthand letter that can be used after a single dash. func StringToIntVarP(p *map[string]int, name, shorthand string, value map[string]int, usage string) { CommandLine.VarP(newStringToIntValue(value, p), name, shorthand, usage) } // StringToInt defines a string flag with specified name, default value, and usage string. // The return value is the address of a map[string]int variable that stores the value of the flag. // The value of each argument will not try to be separated by comma func (f *FlagSet) StringToInt(name string, value map[string]int, usage string) *map[string]int { p := map[string]int{} f.StringToIntVarP(&p, name, "", value, usage) return &p } // StringToIntP is like StringToInt, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) StringToIntP(name, shorthand string, value map[string]int, usage string) *map[string]int { p := map[string]int{} f.StringToIntVarP(&p, name, shorthand, value, usage) return &p } // StringToInt defines a string flag with specified name, default value, and usage string. // The return value is the address of a map[string]int variable that stores the value of the flag. // The value of each argument will not try to be separated by comma func StringToInt(name string, value map[string]int, usage string) *map[string]int { return CommandLine.StringToIntP(name, "", value, usage) } // StringToIntP is like StringToInt, but accepts a shorthand letter that can be used after a single dash. func StringToIntP(name, shorthand string, value map[string]int, usage string) *map[string]int { return CommandLine.StringToIntP(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/string_to_int64.go ================================================ package pflag import ( "bytes" "fmt" "strconv" "strings" ) // -- stringToInt64 Value type stringToInt64Value struct { value *map[string]int64 changed bool } func newStringToInt64Value(val map[string]int64, p *map[string]int64) *stringToInt64Value { ssv := new(stringToInt64Value) ssv.value = p *ssv.value = val return ssv } // Format: a=1,b=2 func (s *stringToInt64Value) Set(val string) error { ss := strings.Split(val, ",") out := make(map[string]int64, len(ss)) for _, pair := range ss { kv := strings.SplitN(pair, "=", 2) if len(kv) != 2 { return fmt.Errorf("%s must be formatted as key=value", pair) } var err error out[kv[0]], err = strconv.ParseInt(kv[1], 10, 64) if err != nil { return err } } if !s.changed { *s.value = out } else { for k, v := range out { (*s.value)[k] = v } } s.changed = true return nil } func (s *stringToInt64Value) Type() string { return "stringToInt64" } func (s *stringToInt64Value) String() string { var buf bytes.Buffer i := 0 for k, v := range *s.value { if i > 0 { buf.WriteRune(',') } buf.WriteString(k) buf.WriteRune('=') buf.WriteString(strconv.FormatInt(v, 10)) i++ } return "[" + buf.String() + "]" } func stringToInt64Conv(val string) (interface{}, error) { val = strings.Trim(val, "[]") // An empty string would cause an empty map if len(val) == 0 { return map[string]int64{}, nil } ss := strings.Split(val, ",") out := make(map[string]int64, len(ss)) for _, pair := range ss { kv := strings.SplitN(pair, "=", 2) if len(kv) != 2 { return nil, fmt.Errorf("%s must be formatted as key=value", pair) } var err error out[kv[0]], err = strconv.ParseInt(kv[1], 10, 64) if err != nil { return nil, err } } return out, nil } // GetStringToInt64 return the map[string]int64 value of a flag with the given name func (f *FlagSet) GetStringToInt64(name string) (map[string]int64, error) { val, err := f.getFlagType(name, "stringToInt64", stringToInt64Conv) if err != nil { return map[string]int64{}, err } return val.(map[string]int64), nil } // StringToInt64Var defines a string flag with specified name, default value, and usage string. // The argument p point64s to a map[string]int64 variable in which to store the values of the multiple flags. // The value of each argument will not try to be separated by comma func (f *FlagSet) StringToInt64Var(p *map[string]int64, name string, value map[string]int64, usage string) { f.VarP(newStringToInt64Value(value, p), name, "", usage) } // StringToInt64VarP is like StringToInt64Var, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) StringToInt64VarP(p *map[string]int64, name, shorthand string, value map[string]int64, usage string) { f.VarP(newStringToInt64Value(value, p), name, shorthand, usage) } // StringToInt64Var defines a string flag with specified name, default value, and usage string. // The argument p point64s to a map[string]int64 variable in which to store the value of the flag. // The value of each argument will not try to be separated by comma func StringToInt64Var(p *map[string]int64, name string, value map[string]int64, usage string) { CommandLine.VarP(newStringToInt64Value(value, p), name, "", usage) } // StringToInt64VarP is like StringToInt64Var, but accepts a shorthand letter that can be used after a single dash. func StringToInt64VarP(p *map[string]int64, name, shorthand string, value map[string]int64, usage string) { CommandLine.VarP(newStringToInt64Value(value, p), name, shorthand, usage) } // StringToInt64 defines a string flag with specified name, default value, and usage string. // The return value is the address of a map[string]int64 variable that stores the value of the flag. // The value of each argument will not try to be separated by comma func (f *FlagSet) StringToInt64(name string, value map[string]int64, usage string) *map[string]int64 { p := map[string]int64{} f.StringToInt64VarP(&p, name, "", value, usage) return &p } // StringToInt64P is like StringToInt64, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) StringToInt64P(name, shorthand string, value map[string]int64, usage string) *map[string]int64 { p := map[string]int64{} f.StringToInt64VarP(&p, name, shorthand, value, usage) return &p } // StringToInt64 defines a string flag with specified name, default value, and usage string. // The return value is the address of a map[string]int64 variable that stores the value of the flag. // The value of each argument will not try to be separated by comma func StringToInt64(name string, value map[string]int64, usage string) *map[string]int64 { return CommandLine.StringToInt64P(name, "", value, usage) } // StringToInt64P is like StringToInt64, but accepts a shorthand letter that can be used after a single dash. func StringToInt64P(name, shorthand string, value map[string]int64, usage string) *map[string]int64 { return CommandLine.StringToInt64P(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/string_to_string.go ================================================ package pflag import ( "bytes" "encoding/csv" "fmt" "sort" "strings" ) // -- stringToString Value type stringToStringValue struct { value *map[string]string changed bool } func newStringToStringValue(val map[string]string, p *map[string]string) *stringToStringValue { ssv := new(stringToStringValue) ssv.value = p *ssv.value = val return ssv } // Format: a=1,b=2 func (s *stringToStringValue) Set(val string) error { var ss []string n := strings.Count(val, "=") switch n { case 0: return fmt.Errorf("%s must be formatted as key=value", val) case 1: ss = append(ss, strings.Trim(val, `"`)) default: r := csv.NewReader(strings.NewReader(val)) var err error ss, err = r.Read() if err != nil { return err } } out := make(map[string]string, len(ss)) for _, pair := range ss { kv := strings.SplitN(pair, "=", 2) if len(kv) != 2 { return fmt.Errorf("%s must be formatted as key=value", pair) } out[kv[0]] = kv[1] } if !s.changed { *s.value = out } else { for k, v := range out { (*s.value)[k] = v } } s.changed = true return nil } func (s *stringToStringValue) Type() string { return "stringToString" } func (s *stringToStringValue) String() string { keys := make([]string, 0, len(*s.value)) for k := range *s.value { keys = append(keys, k) } sort.Strings(keys) records := make([]string, 0, len(*s.value)>>1) for _, k := range keys { v := (*s.value)[k] records = append(records, k+"="+v) } var buf bytes.Buffer w := csv.NewWriter(&buf) if err := w.Write(records); err != nil { panic(err) } w.Flush() return "[" + strings.TrimSpace(buf.String()) + "]" } func stringToStringConv(val string) (interface{}, error) { val = strings.Trim(val, "[]") // An empty string would cause an empty map if len(val) == 0 { return map[string]string{}, nil } r := csv.NewReader(strings.NewReader(val)) ss, err := r.Read() if err != nil { return nil, err } out := make(map[string]string, len(ss)) for _, pair := range ss { kv := strings.SplitN(pair, "=", 2) if len(kv) != 2 { return nil, fmt.Errorf("%s must be formatted as key=value", pair) } out[kv[0]] = kv[1] } return out, nil } // GetStringToString return the map[string]string value of a flag with the given name func (f *FlagSet) GetStringToString(name string) (map[string]string, error) { val, err := f.getFlagType(name, "stringToString", stringToStringConv) if err != nil { return map[string]string{}, err } return val.(map[string]string), nil } // StringToStringVar defines a string flag with specified name, default value, and usage string. // The argument p points to a map[string]string variable in which to store the values of the multiple flags. // The value of each argument will not try to be separated by comma func (f *FlagSet) StringToStringVar(p *map[string]string, name string, value map[string]string, usage string) { f.VarP(newStringToStringValue(value, p), name, "", usage) } // StringToStringVarP is like StringToStringVar, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) StringToStringVarP(p *map[string]string, name, shorthand string, value map[string]string, usage string) { f.VarP(newStringToStringValue(value, p), name, shorthand, usage) } // StringToStringVar defines a string flag with specified name, default value, and usage string. // The argument p points to a map[string]string variable in which to store the value of the flag. // The value of each argument will not try to be separated by comma func StringToStringVar(p *map[string]string, name string, value map[string]string, usage string) { CommandLine.VarP(newStringToStringValue(value, p), name, "", usage) } // StringToStringVarP is like StringToStringVar, but accepts a shorthand letter that can be used after a single dash. func StringToStringVarP(p *map[string]string, name, shorthand string, value map[string]string, usage string) { CommandLine.VarP(newStringToStringValue(value, p), name, shorthand, usage) } // StringToString defines a string flag with specified name, default value, and usage string. // The return value is the address of a map[string]string variable that stores the value of the flag. // The value of each argument will not try to be separated by comma func (f *FlagSet) StringToString(name string, value map[string]string, usage string) *map[string]string { p := map[string]string{} f.StringToStringVarP(&p, name, "", value, usage) return &p } // StringToStringP is like StringToString, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) StringToStringP(name, shorthand string, value map[string]string, usage string) *map[string]string { p := map[string]string{} f.StringToStringVarP(&p, name, shorthand, value, usage) return &p } // StringToString defines a string flag with specified name, default value, and usage string. // The return value is the address of a map[string]string variable that stores the value of the flag. // The value of each argument will not try to be separated by comma func StringToString(name string, value map[string]string, usage string) *map[string]string { return CommandLine.StringToStringP(name, "", value, usage) } // StringToStringP is like StringToString, but accepts a shorthand letter that can be used after a single dash. func StringToStringP(name, shorthand string, value map[string]string, usage string) *map[string]string { return CommandLine.StringToStringP(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/text.go ================================================ package pflag import ( "encoding" "fmt" "reflect" ) // following is copied from go 1.23.4 flag.go type textValue struct{ p encoding.TextUnmarshaler } func newTextValue(val encoding.TextMarshaler, p encoding.TextUnmarshaler) textValue { ptrVal := reflect.ValueOf(p) if ptrVal.Kind() != reflect.Ptr { panic("variable value type must be a pointer") } defVal := reflect.ValueOf(val) if defVal.Kind() == reflect.Ptr { defVal = defVal.Elem() } if defVal.Type() != ptrVal.Type().Elem() { panic(fmt.Sprintf("default type does not match variable type: %v != %v", defVal.Type(), ptrVal.Type().Elem())) } ptrVal.Elem().Set(defVal) return textValue{p} } func (v textValue) Set(s string) error { return v.p.UnmarshalText([]byte(s)) } func (v textValue) Get() interface{} { return v.p } func (v textValue) String() string { if m, ok := v.p.(encoding.TextMarshaler); ok { if b, err := m.MarshalText(); err == nil { return string(b) } } return "" } //end of copy func (v textValue) Type() string { return reflect.ValueOf(v.p).Type().Name() } // GetText set out, which implements encoding.UnmarshalText, to the value of a flag with given name func (f *FlagSet) GetText(name string, out encoding.TextUnmarshaler) error { flag := f.Lookup(name) if flag == nil { return fmt.Errorf("flag accessed but not defined: %s", name) } if flag.Value.Type() != reflect.TypeOf(out).Name() { return fmt.Errorf("trying to get %s value of flag of type %s", reflect.TypeOf(out).Name(), flag.Value.Type()) } return out.UnmarshalText([]byte(flag.Value.String())) } // TextVar defines a flag with a specified name, default value, and usage string. The argument p must be a pointer to a variable that will hold the value of the flag, and p must implement encoding.TextUnmarshaler. If the flag is used, the flag value will be passed to p's UnmarshalText method. The type of the default value must be the same as the type of p. func (f *FlagSet) TextVar(p encoding.TextUnmarshaler, name string, value encoding.TextMarshaler, usage string) { f.VarP(newTextValue(value, p), name, "", usage) } // TextVarP is like TextVar, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) TextVarP(p encoding.TextUnmarshaler, name, shorthand string, value encoding.TextMarshaler, usage string) { f.VarP(newTextValue(value, p), name, shorthand, usage) } // TextVar defines a flag with a specified name, default value, and usage string. The argument p must be a pointer to a variable that will hold the value of the flag, and p must implement encoding.TextUnmarshaler. If the flag is used, the flag value will be passed to p's UnmarshalText method. The type of the default value must be the same as the type of p. func TextVar(p encoding.TextUnmarshaler, name string, value encoding.TextMarshaler, usage string) { CommandLine.VarP(newTextValue(value, p), name, "", usage) } // TextVarP is like TextVar, but accepts a shorthand letter that can be used after a single dash. func TextVarP(p encoding.TextUnmarshaler, name, shorthand string, value encoding.TextMarshaler, usage string) { CommandLine.VarP(newTextValue(value, p), name, shorthand, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/time.go ================================================ package pflag import ( "fmt" "strings" "time" ) // TimeValue adapts time.Time for use as a flag. type timeValue struct { *time.Time formats []string } func newTimeValue(val time.Time, p *time.Time, formats []string) *timeValue { *p = val return &timeValue{ Time: p, formats: formats, } } // Set time.Time value from string based on accepted formats. func (d *timeValue) Set(s string) error { s = strings.TrimSpace(s) for _, f := range d.formats { v, err := time.Parse(f, s) if err != nil { continue } *d.Time = v return nil } formatsString := "" for i, f := range d.formats { if i > 0 { formatsString += ", " } formatsString += fmt.Sprintf("`%s`", f) } return fmt.Errorf("invalid time format `%s` must be one of: %s", s, formatsString) } // Type name for time.Time flags. func (d *timeValue) Type() string { return "time" } func (d *timeValue) String() string { if d.Time.IsZero() { return "" } else { return d.Time.Format(time.RFC3339Nano) } } // GetTime return the time value of a flag with the given name func (f *FlagSet) GetTime(name string) (time.Time, error) { flag := f.Lookup(name) if flag == nil { err := fmt.Errorf("flag accessed but not defined: %s", name) return time.Time{}, err } if flag.Value.Type() != "time" { err := fmt.Errorf("trying to get %s value of flag of type %s", "time", flag.Value.Type()) return time.Time{}, err } val, ok := flag.Value.(*timeValue) if !ok { return time.Time{}, fmt.Errorf("value %s is not a time", flag.Value) } return *val.Time, nil } // TimeVar defines a time.Time flag with specified name, default value, and usage string. // The argument p points to a time.Time variable in which to store the value of the flag. func (f *FlagSet) TimeVar(p *time.Time, name string, value time.Time, formats []string, usage string) { f.TimeVarP(p, name, "", value, formats, usage) } // TimeVarP is like TimeVar, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) TimeVarP(p *time.Time, name, shorthand string, value time.Time, formats []string, usage string) { f.VarP(newTimeValue(value, p, formats), name, shorthand, usage) } // TimeVar defines a time.Time flag with specified name, default value, and usage string. // The argument p points to a time.Time variable in which to store the value of the flag. func TimeVar(p *time.Time, name string, value time.Time, formats []string, usage string) { CommandLine.TimeVarP(p, name, "", value, formats, usage) } // TimeVarP is like TimeVar, but accepts a shorthand letter that can be used after a single dash. func TimeVarP(p *time.Time, name, shorthand string, value time.Time, formats []string, usage string) { CommandLine.VarP(newTimeValue(value, p, formats), name, shorthand, usage) } // Time defines a time.Time flag with specified name, default value, and usage string. // The return value is the address of a time.Time variable that stores the value of the flag. func (f *FlagSet) Time(name string, value time.Time, formats []string, usage string) *time.Time { return f.TimeP(name, "", value, formats, usage) } // TimeP is like Time, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) TimeP(name, shorthand string, value time.Time, formats []string, usage string) *time.Time { p := new(time.Time) f.TimeVarP(p, name, shorthand, value, formats, usage) return p } // Time defines a time.Time flag with specified name, default value, and usage string. // The return value is the address of a time.Time variable that stores the value of the flag. func Time(name string, value time.Time, formats []string, usage string) *time.Time { return CommandLine.TimeP(name, "", value, formats, usage) } // TimeP is like Time, but accepts a shorthand letter that can be used after a single dash. func TimeP(name, shorthand string, value time.Time, formats []string, usage string) *time.Time { return CommandLine.TimeP(name, shorthand, value, formats, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/uint.go ================================================ package pflag import "strconv" // -- uint Value type uintValue uint func newUintValue(val uint, p *uint) *uintValue { *p = val return (*uintValue)(p) } func (i *uintValue) Set(s string) error { v, err := strconv.ParseUint(s, 0, 64) *i = uintValue(v) return err } func (i *uintValue) Type() string { return "uint" } func (i *uintValue) String() string { return strconv.FormatUint(uint64(*i), 10) } func uintConv(sval string) (interface{}, error) { v, err := strconv.ParseUint(sval, 0, 0) if err != nil { return 0, err } return uint(v), nil } // GetUint return the uint value of a flag with the given name func (f *FlagSet) GetUint(name string) (uint, error) { val, err := f.getFlagType(name, "uint", uintConv) if err != nil { return 0, err } return val.(uint), nil } // UintVar defines a uint flag with specified name, default value, and usage string. // The argument p points to a uint variable in which to store the value of the flag. func (f *FlagSet) UintVar(p *uint, name string, value uint, usage string) { f.VarP(newUintValue(value, p), name, "", usage) } // UintVarP is like UintVar, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) UintVarP(p *uint, name, shorthand string, value uint, usage string) { f.VarP(newUintValue(value, p), name, shorthand, usage) } // UintVar defines a uint flag with specified name, default value, and usage string. // The argument p points to a uint variable in which to store the value of the flag. func UintVar(p *uint, name string, value uint, usage string) { CommandLine.VarP(newUintValue(value, p), name, "", usage) } // UintVarP is like UintVar, but accepts a shorthand letter that can be used after a single dash. func UintVarP(p *uint, name, shorthand string, value uint, usage string) { CommandLine.VarP(newUintValue(value, p), name, shorthand, usage) } // Uint defines a uint flag with specified name, default value, and usage string. // The return value is the address of a uint variable that stores the value of the flag. func (f *FlagSet) Uint(name string, value uint, usage string) *uint { p := new(uint) f.UintVarP(p, name, "", value, usage) return p } // UintP is like Uint, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) UintP(name, shorthand string, value uint, usage string) *uint { p := new(uint) f.UintVarP(p, name, shorthand, value, usage) return p } // Uint defines a uint flag with specified name, default value, and usage string. // The return value is the address of a uint variable that stores the value of the flag. func Uint(name string, value uint, usage string) *uint { return CommandLine.UintP(name, "", value, usage) } // UintP is like Uint, but accepts a shorthand letter that can be used after a single dash. func UintP(name, shorthand string, value uint, usage string) *uint { return CommandLine.UintP(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/uint16.go ================================================ package pflag import "strconv" // -- uint16 value type uint16Value uint16 func newUint16Value(val uint16, p *uint16) *uint16Value { *p = val return (*uint16Value)(p) } func (i *uint16Value) Set(s string) error { v, err := strconv.ParseUint(s, 0, 16) *i = uint16Value(v) return err } func (i *uint16Value) Type() string { return "uint16" } func (i *uint16Value) String() string { return strconv.FormatUint(uint64(*i), 10) } func uint16Conv(sval string) (interface{}, error) { v, err := strconv.ParseUint(sval, 0, 16) if err != nil { return 0, err } return uint16(v), nil } // GetUint16 return the uint16 value of a flag with the given name func (f *FlagSet) GetUint16(name string) (uint16, error) { val, err := f.getFlagType(name, "uint16", uint16Conv) if err != nil { return 0, err } return val.(uint16), nil } // Uint16Var defines a uint flag with specified name, default value, and usage string. // The argument p points to a uint variable in which to store the value of the flag. func (f *FlagSet) Uint16Var(p *uint16, name string, value uint16, usage string) { f.VarP(newUint16Value(value, p), name, "", usage) } // Uint16VarP is like Uint16Var, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Uint16VarP(p *uint16, name, shorthand string, value uint16, usage string) { f.VarP(newUint16Value(value, p), name, shorthand, usage) } // Uint16Var defines a uint flag with specified name, default value, and usage string. // The argument p points to a uint variable in which to store the value of the flag. func Uint16Var(p *uint16, name string, value uint16, usage string) { CommandLine.VarP(newUint16Value(value, p), name, "", usage) } // Uint16VarP is like Uint16Var, but accepts a shorthand letter that can be used after a single dash. func Uint16VarP(p *uint16, name, shorthand string, value uint16, usage string) { CommandLine.VarP(newUint16Value(value, p), name, shorthand, usage) } // Uint16 defines a uint flag with specified name, default value, and usage string. // The return value is the address of a uint variable that stores the value of the flag. func (f *FlagSet) Uint16(name string, value uint16, usage string) *uint16 { p := new(uint16) f.Uint16VarP(p, name, "", value, usage) return p } // Uint16P is like Uint16, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Uint16P(name, shorthand string, value uint16, usage string) *uint16 { p := new(uint16) f.Uint16VarP(p, name, shorthand, value, usage) return p } // Uint16 defines a uint flag with specified name, default value, and usage string. // The return value is the address of a uint variable that stores the value of the flag. func Uint16(name string, value uint16, usage string) *uint16 { return CommandLine.Uint16P(name, "", value, usage) } // Uint16P is like Uint16, but accepts a shorthand letter that can be used after a single dash. func Uint16P(name, shorthand string, value uint16, usage string) *uint16 { return CommandLine.Uint16P(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/uint32.go ================================================ package pflag import "strconv" // -- uint32 value type uint32Value uint32 func newUint32Value(val uint32, p *uint32) *uint32Value { *p = val return (*uint32Value)(p) } func (i *uint32Value) Set(s string) error { v, err := strconv.ParseUint(s, 0, 32) *i = uint32Value(v) return err } func (i *uint32Value) Type() string { return "uint32" } func (i *uint32Value) String() string { return strconv.FormatUint(uint64(*i), 10) } func uint32Conv(sval string) (interface{}, error) { v, err := strconv.ParseUint(sval, 0, 32) if err != nil { return 0, err } return uint32(v), nil } // GetUint32 return the uint32 value of a flag with the given name func (f *FlagSet) GetUint32(name string) (uint32, error) { val, err := f.getFlagType(name, "uint32", uint32Conv) if err != nil { return 0, err } return val.(uint32), nil } // Uint32Var defines a uint32 flag with specified name, default value, and usage string. // The argument p points to a uint32 variable in which to store the value of the flag. func (f *FlagSet) Uint32Var(p *uint32, name string, value uint32, usage string) { f.VarP(newUint32Value(value, p), name, "", usage) } // Uint32VarP is like Uint32Var, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Uint32VarP(p *uint32, name, shorthand string, value uint32, usage string) { f.VarP(newUint32Value(value, p), name, shorthand, usage) } // Uint32Var defines a uint32 flag with specified name, default value, and usage string. // The argument p points to a uint32 variable in which to store the value of the flag. func Uint32Var(p *uint32, name string, value uint32, usage string) { CommandLine.VarP(newUint32Value(value, p), name, "", usage) } // Uint32VarP is like Uint32Var, but accepts a shorthand letter that can be used after a single dash. func Uint32VarP(p *uint32, name, shorthand string, value uint32, usage string) { CommandLine.VarP(newUint32Value(value, p), name, shorthand, usage) } // Uint32 defines a uint32 flag with specified name, default value, and usage string. // The return value is the address of a uint32 variable that stores the value of the flag. func (f *FlagSet) Uint32(name string, value uint32, usage string) *uint32 { p := new(uint32) f.Uint32VarP(p, name, "", value, usage) return p } // Uint32P is like Uint32, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Uint32P(name, shorthand string, value uint32, usage string) *uint32 { p := new(uint32) f.Uint32VarP(p, name, shorthand, value, usage) return p } // Uint32 defines a uint32 flag with specified name, default value, and usage string. // The return value is the address of a uint32 variable that stores the value of the flag. func Uint32(name string, value uint32, usage string) *uint32 { return CommandLine.Uint32P(name, "", value, usage) } // Uint32P is like Uint32, but accepts a shorthand letter that can be used after a single dash. func Uint32P(name, shorthand string, value uint32, usage string) *uint32 { return CommandLine.Uint32P(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/uint64.go ================================================ package pflag import "strconv" // -- uint64 Value type uint64Value uint64 func newUint64Value(val uint64, p *uint64) *uint64Value { *p = val return (*uint64Value)(p) } func (i *uint64Value) Set(s string) error { v, err := strconv.ParseUint(s, 0, 64) *i = uint64Value(v) return err } func (i *uint64Value) Type() string { return "uint64" } func (i *uint64Value) String() string { return strconv.FormatUint(uint64(*i), 10) } func uint64Conv(sval string) (interface{}, error) { v, err := strconv.ParseUint(sval, 0, 64) if err != nil { return 0, err } return uint64(v), nil } // GetUint64 return the uint64 value of a flag with the given name func (f *FlagSet) GetUint64(name string) (uint64, error) { val, err := f.getFlagType(name, "uint64", uint64Conv) if err != nil { return 0, err } return val.(uint64), nil } // Uint64Var defines a uint64 flag with specified name, default value, and usage string. // The argument p points to a uint64 variable in which to store the value of the flag. func (f *FlagSet) Uint64Var(p *uint64, name string, value uint64, usage string) { f.VarP(newUint64Value(value, p), name, "", usage) } // Uint64VarP is like Uint64Var, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Uint64VarP(p *uint64, name, shorthand string, value uint64, usage string) { f.VarP(newUint64Value(value, p), name, shorthand, usage) } // Uint64Var defines a uint64 flag with specified name, default value, and usage string. // The argument p points to a uint64 variable in which to store the value of the flag. func Uint64Var(p *uint64, name string, value uint64, usage string) { CommandLine.VarP(newUint64Value(value, p), name, "", usage) } // Uint64VarP is like Uint64Var, but accepts a shorthand letter that can be used after a single dash. func Uint64VarP(p *uint64, name, shorthand string, value uint64, usage string) { CommandLine.VarP(newUint64Value(value, p), name, shorthand, usage) } // Uint64 defines a uint64 flag with specified name, default value, and usage string. // The return value is the address of a uint64 variable that stores the value of the flag. func (f *FlagSet) Uint64(name string, value uint64, usage string) *uint64 { p := new(uint64) f.Uint64VarP(p, name, "", value, usage) return p } // Uint64P is like Uint64, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Uint64P(name, shorthand string, value uint64, usage string) *uint64 { p := new(uint64) f.Uint64VarP(p, name, shorthand, value, usage) return p } // Uint64 defines a uint64 flag with specified name, default value, and usage string. // The return value is the address of a uint64 variable that stores the value of the flag. func Uint64(name string, value uint64, usage string) *uint64 { return CommandLine.Uint64P(name, "", value, usage) } // Uint64P is like Uint64, but accepts a shorthand letter that can be used after a single dash. func Uint64P(name, shorthand string, value uint64, usage string) *uint64 { return CommandLine.Uint64P(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/uint8.go ================================================ package pflag import "strconv" // -- uint8 Value type uint8Value uint8 func newUint8Value(val uint8, p *uint8) *uint8Value { *p = val return (*uint8Value)(p) } func (i *uint8Value) Set(s string) error { v, err := strconv.ParseUint(s, 0, 8) *i = uint8Value(v) return err } func (i *uint8Value) Type() string { return "uint8" } func (i *uint8Value) String() string { return strconv.FormatUint(uint64(*i), 10) } func uint8Conv(sval string) (interface{}, error) { v, err := strconv.ParseUint(sval, 0, 8) if err != nil { return 0, err } return uint8(v), nil } // GetUint8 return the uint8 value of a flag with the given name func (f *FlagSet) GetUint8(name string) (uint8, error) { val, err := f.getFlagType(name, "uint8", uint8Conv) if err != nil { return 0, err } return val.(uint8), nil } // Uint8Var defines a uint8 flag with specified name, default value, and usage string. // The argument p points to a uint8 variable in which to store the value of the flag. func (f *FlagSet) Uint8Var(p *uint8, name string, value uint8, usage string) { f.VarP(newUint8Value(value, p), name, "", usage) } // Uint8VarP is like Uint8Var, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Uint8VarP(p *uint8, name, shorthand string, value uint8, usage string) { f.VarP(newUint8Value(value, p), name, shorthand, usage) } // Uint8Var defines a uint8 flag with specified name, default value, and usage string. // The argument p points to a uint8 variable in which to store the value of the flag. func Uint8Var(p *uint8, name string, value uint8, usage string) { CommandLine.VarP(newUint8Value(value, p), name, "", usage) } // Uint8VarP is like Uint8Var, but accepts a shorthand letter that can be used after a single dash. func Uint8VarP(p *uint8, name, shorthand string, value uint8, usage string) { CommandLine.VarP(newUint8Value(value, p), name, shorthand, usage) } // Uint8 defines a uint8 flag with specified name, default value, and usage string. // The return value is the address of a uint8 variable that stores the value of the flag. func (f *FlagSet) Uint8(name string, value uint8, usage string) *uint8 { p := new(uint8) f.Uint8VarP(p, name, "", value, usage) return p } // Uint8P is like Uint8, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Uint8P(name, shorthand string, value uint8, usage string) *uint8 { p := new(uint8) f.Uint8VarP(p, name, shorthand, value, usage) return p } // Uint8 defines a uint8 flag with specified name, default value, and usage string. // The return value is the address of a uint8 variable that stores the value of the flag. func Uint8(name string, value uint8, usage string) *uint8 { return CommandLine.Uint8P(name, "", value, usage) } // Uint8P is like Uint8, but accepts a shorthand letter that can be used after a single dash. func Uint8P(name, shorthand string, value uint8, usage string) *uint8 { return CommandLine.Uint8P(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/uint_slice.go ================================================ package pflag import ( "fmt" "strconv" "strings" ) // -- uintSlice Value type uintSliceValue struct { value *[]uint changed bool } func newUintSliceValue(val []uint, p *[]uint) *uintSliceValue { uisv := new(uintSliceValue) uisv.value = p *uisv.value = val return uisv } func (s *uintSliceValue) Set(val string) error { ss := strings.Split(val, ",") out := make([]uint, len(ss)) for i, d := range ss { u, err := strconv.ParseUint(d, 10, 0) if err != nil { return err } out[i] = uint(u) } if !s.changed { *s.value = out } else { *s.value = append(*s.value, out...) } s.changed = true return nil } func (s *uintSliceValue) Type() string { return "uintSlice" } func (s *uintSliceValue) String() string { out := make([]string, len(*s.value)) for i, d := range *s.value { out[i] = fmt.Sprintf("%d", d) } return "[" + strings.Join(out, ",") + "]" } func (s *uintSliceValue) fromString(val string) (uint, error) { t, err := strconv.ParseUint(val, 10, 0) if err != nil { return 0, err } return uint(t), nil } func (s *uintSliceValue) toString(val uint) string { return fmt.Sprintf("%d", val) } func (s *uintSliceValue) Append(val string) error { i, err := s.fromString(val) if err != nil { return err } *s.value = append(*s.value, i) return nil } func (s *uintSliceValue) Replace(val []string) error { out := make([]uint, len(val)) for i, d := range val { var err error out[i], err = s.fromString(d) if err != nil { return err } } *s.value = out return nil } func (s *uintSliceValue) GetSlice() []string { out := make([]string, len(*s.value)) for i, d := range *s.value { out[i] = s.toString(d) } return out } func uintSliceConv(val string) (interface{}, error) { val = strings.Trim(val, "[]") // Empty string would cause a slice with one (empty) entry if len(val) == 0 { return []uint{}, nil } ss := strings.Split(val, ",") out := make([]uint, len(ss)) for i, d := range ss { u, err := strconv.ParseUint(d, 10, 0) if err != nil { return nil, err } out[i] = uint(u) } return out, nil } // GetUintSlice returns the []uint value of a flag with the given name. func (f *FlagSet) GetUintSlice(name string) ([]uint, error) { val, err := f.getFlagType(name, "uintSlice", uintSliceConv) if err != nil { return []uint{}, err } return val.([]uint), nil } // UintSliceVar defines a uintSlice flag with specified name, default value, and usage string. // The argument p points to a []uint variable in which to store the value of the flag. func (f *FlagSet) UintSliceVar(p *[]uint, name string, value []uint, usage string) { f.VarP(newUintSliceValue(value, p), name, "", usage) } // UintSliceVarP is like UintSliceVar, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) UintSliceVarP(p *[]uint, name, shorthand string, value []uint, usage string) { f.VarP(newUintSliceValue(value, p), name, shorthand, usage) } // UintSliceVar defines a uint[] flag with specified name, default value, and usage string. // The argument p points to a uint[] variable in which to store the value of the flag. func UintSliceVar(p *[]uint, name string, value []uint, usage string) { CommandLine.VarP(newUintSliceValue(value, p), name, "", usage) } // UintSliceVarP is like the UintSliceVar, but accepts a shorthand letter that can be used after a single dash. func UintSliceVarP(p *[]uint, name, shorthand string, value []uint, usage string) { CommandLine.VarP(newUintSliceValue(value, p), name, shorthand, usage) } // UintSlice defines a []uint flag with specified name, default value, and usage string. // The return value is the address of a []uint variable that stores the value of the flag. func (f *FlagSet) UintSlice(name string, value []uint, usage string) *[]uint { p := []uint{} f.UintSliceVarP(&p, name, "", value, usage) return &p } // UintSliceP is like UintSlice, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) UintSliceP(name, shorthand string, value []uint, usage string) *[]uint { p := []uint{} f.UintSliceVarP(&p, name, shorthand, value, usage) return &p } // UintSlice defines a []uint flag with specified name, default value, and usage string. // The return value is the address of a []uint variable that stores the value of the flag. func UintSlice(name string, value []uint, usage string) *[]uint { return CommandLine.UintSliceP(name, "", value, usage) } // UintSliceP is like UintSlice, but accepts a shorthand letter that can be used after a single dash. func UintSliceP(name, shorthand string, value []uint, usage string) *[]uint { return CommandLine.UintSliceP(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/stefanberger/go-pkcs11uri/.gitignore ================================================ *~ pkcs11uri ================================================ FILE: vendor/github.com/stefanberger/go-pkcs11uri/.travis.yml ================================================ dist: bionic language: go os: - linux go: - "1.19.x" matrix: include: - os: linux addons: apt: packages: - softhsm2 install: - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.53.2 script: - make - make check - make test ================================================ FILE: vendor/github.com/stefanberger/go-pkcs11uri/LICENSE ================================================ Apache License Version 2.0, January 2004 https://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS ================================================ FILE: vendor/github.com/stefanberger/go-pkcs11uri/Makefile ================================================ # Copyright IBM Corporation, 2020 # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. .PHONY: check build test all: build FORCE: check: golangci-lint run build: go build ./... test: go test ./... -test.v ================================================ FILE: vendor/github.com/stefanberger/go-pkcs11uri/README.md ================================================ # go-pkcs11uri Welcome to the go-pkcs11uri library. The implementation follows [RFC 7512](https://tools.ietf.org/html/rfc7512) and this [errata](https://www.rfc-editor.org/errata/rfc7512). # Exampe usage: The following example builds on this library [here](https://github.com/miekg/pkcs11) and are using softhsm2 on Fedora. ## Example This example program extending the one found [here](https://github.com/miekg/pkcs11/blob/master/README.md#examples): ``` package main import ( "fmt" "os" "strconv" "github.com/miekg/pkcs11" pkcs11uri "github.com/stefanberger/go-pkcs11uri" ) func main() { if len(os.Args) < 2 { panic("Missing pkcs11 URI argument") } uristr := os.Args[1] uri, err := pkcs11uri.New() if err != nil { panic(err) } err = uri.Parse(uristr) if err != nil { panic(err) } module, err := uri.GetModule() if err != nil { panic(err) } slot, ok := uri.GetPathAttribute("slot-id", false) if !ok { panic("No slot-id in pkcs11 URI") } slotid, err := strconv.Atoi(slot) if err != nil { panic(err) } pin, err := uri.GetPIN() if err != nil { panic(err) } p := pkcs11.New(module) err = p.Initialize() if err != nil { panic(err) } defer p.Destroy() defer p.Finalize() session, err := p.OpenSession(uint(slotid), pkcs11.CKF_SERIAL_SESSION|pkcs11.CKF_RW_SESSION) if err != nil { panic(err) } defer p.CloseSession(session) err = p.Login(session, pkcs11.CKU_USER, pin) if err != nil { panic(err) } defer p.Logout(session) p.DigestInit(session, []*pkcs11.Mechanism{pkcs11.NewMechanism(pkcs11.CKM_SHA_1, nil)}) hash, err := p.Digest(session, []byte("this is a string")) if err != nil { panic(err) } for _, d := range hash { fmt.Printf("%x", d) } fmt.Println() } ``` ## Exampe Usage ``` $ sudo softhsm2-util --init-token --slot 1 --label test --pin 1234 --so-pin 1234 The token has been initialized and is reassigned to slot 2053753261 $ go build ./... $ sudo ./pkcs11-example 'pkcs11:slot-id=2053753261?module-path=/usr/lib64/pkcs11/libsofthsm2.so&pin-value=1234' 517592df8fec3ad146a79a9af153db2a4d784ec5 ``` ================================================ FILE: vendor/github.com/stefanberger/go-pkcs11uri/pkcs11uri.go ================================================ /* (c) Copyright IBM Corporation, 2020 Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package pkcs11uri import ( "errors" "fmt" "net/url" "os" "path/filepath" "regexp" "strconv" "strings" ) // Pkcs11URI holds a pkcs11 URI object type Pkcs11URI struct { // path and query attributes may have custom attributes that either // have to be in the query or in the path part, so we use two maps pathAttributes map[string]string queryAttributes map[string]string // directories to search for pkcs11 modules moduleDirectories []string // file paths of allowed pkcs11 modules allowedModulePaths []string // whether any module is allowed to be loaded allowAnyModule bool // A map of environment variables needed by the pkcs11 module using this URI. // This map is not needed by this implementation but is there for convenience. env map[string]string } // upper character hex digits needed for pct-encoding const hex = "0123456789ABCDEF" // escapeAll pct-escapes all characters in the string func escapeAll(s string) string { res := make([]byte, len(s)*3) j := 0 for i := 0; i < len(s); i++ { c := s[i] res[j] = '%' res[j+1] = hex[c>>4] res[j+2] = hex[c&0xf] j += 3 } return string(res) } // escape pct-escapes the path and query part of the pkcs11 URI following the different rules of the // path and query part as decribed in RFC 7512 sec. 2.3 func escape(s string, isPath bool) string { res := make([]byte, len(s)*3) j := 0 for i := 0; i < len(s); i++ { c := s[i] // unreserved per RFC 3986 sec. 2.3 if (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') { res[j] = c } else if isPath && c == '&' { res[j] = c } else if !isPath && (c == '/' || c == '?' || c == '|') { res[j] = c } else { switch c { case '-', '.', '_', '~': // unreserved per RFC 3986 sec. 2.3 res[j] = c case ':', '[', ']', '@', '!', '$', '\'', '(', ')', '*', '+', ',', '=': res[j] = c default: res[j] = '%' res[j+1] = hex[c>>4] res[j+2] = hex[c&0xf] j += 2 } } j++ } return string(res[:j]) } // New creates a new Pkcs11URI object func New() *Pkcs11URI { return &Pkcs11URI{ pathAttributes: make(map[string]string), queryAttributes: make(map[string]string), env: make(map[string]string), } } func (uri *Pkcs11URI) setAttribute(attrMap map[string]string, name, value string) error { v, err := url.PathUnescape(value) if err != nil { return err } attrMap[name] = v return nil } // GetPathAttribute returns the value of a path attribute in unescaped form or // pct-encoded form func (uri *Pkcs11URI) GetPathAttribute(name string, pctencode bool) (string, bool) { v, ok := uri.pathAttributes[name] if ok && pctencode { v = escape(v, true) } return v, ok } // SetPathAttribute sets the value for a path attribute; this function may return an error // if the given value cannot be pct-unescaped func (uri *Pkcs11URI) SetPathAttribute(name, value string) error { return uri.setAttribute(uri.pathAttributes, name, value) } // SetPathAttributeUnencoded sets the value for a path attribute given as byte[]. // The value must not have been pct-encoded already. func (uri *Pkcs11URI) SetPathAttributeUnencoded(name string, value []byte) { uri.pathAttributes[name] = string(value) } // AddPathAttribute adds a path attribute; it returns an error if an attribute with the same // name already existed or if the given value cannot be pct-unescaped func (uri *Pkcs11URI) AddPathAttribute(name, value string) error { if _, ok := uri.pathAttributes[name]; ok { return errors.New("duplicate path attribute") } return uri.SetPathAttribute(name, value) } // AddPathAttributeUnencoded adds a path attribute given as byte[] which must not already be pct-encoded; // it returns an error if an attribute with the same name already existed func (uri *Pkcs11URI) AddPathAttributeUnencoded(name string, value []byte) error { if _, ok := uri.pathAttributes[name]; ok { return errors.New("duplicate path attribute") } uri.SetPathAttributeUnencoded(name, value) return nil } // RemovePathAttribute removes a path attribute func (uri *Pkcs11URI) RemovePathAttribute(name string) { delete(uri.pathAttributes, name) } // AddEnv adds an environment variable for the pkcs11 module func (uri *Pkcs11URI) AddEnv(name, value string) { uri.env[name] = value } // SetEnvMap sets the environment variables for the pkcs11 module func (uri *Pkcs11URI) SetEnvMap(env map[string]string) { uri.env = env } // GetEnvMap returns the map of environment variables func (uri *Pkcs11URI) GetEnvMap() map[string]string { return uri.env } // GetQueryAttribute returns the value of a query attribute in unescaped or // pct-encoded form func (uri *Pkcs11URI) GetQueryAttribute(name string, pctencode bool) (string, bool) { v, ok := uri.queryAttributes[name] if ok && pctencode { v = escape(v, false) } return v, ok } // SetQueryAttribute sets the value for a query attribute; this function may return an error // if the given value cannot pct-unescaped func (uri *Pkcs11URI) SetQueryAttribute(name, value string) error { return uri.setAttribute(uri.queryAttributes, name, value) } // SetQueryAttributeUnencoded sets the value for a quiery attribute given as byte[]. // The value must not have been pct-encoded already. func (uri *Pkcs11URI) SetQueryAttributeUnencoded(name string, value []byte) { uri.queryAttributes[name] = string(value) } // AddQueryAttribute adds a query attribute; it returns an error if an attribute with the same // name already existed or if the given value cannot be pct-unescaped func (uri *Pkcs11URI) AddQueryAttribute(name, value string) error { if _, ok := uri.queryAttributes[name]; ok { return errors.New("duplicate query attribute") } return uri.SetQueryAttribute(name, value) } // AddQueryAttributeUnencoded adds a query attribute given as byte[] which must not already be pct-encoded; // it returns an error if an attribute with the same name already existed func (uri *Pkcs11URI) AddQueryAttributeUnencoded(name string, value []byte) error { if _, ok := uri.queryAttributes[name]; ok { return errors.New("duplicate query attribute") } uri.SetQueryAttributeUnencoded(name, value) return nil } // RemoveQueryAttribute removes a path attribute func (uri *Pkcs11URI) RemoveQueryAttribute(name string) { delete(uri.queryAttributes, name) } // Validate validates a Pkcs11URI object's attributes following RFC 7512 rules and proper formatting of // their values func (uri *Pkcs11URI) Validate() error { /* RFC 7512: 2.3 */ /* slot-id should be DIGIT, but we go for number */ if v, ok := uri.pathAttributes["slot-id"]; ok { if _, err := strconv.Atoi(v); err != nil { return fmt.Errorf("slot-id must be a number: %s", v) } } /* library-version should 1*DIGIT [ "." 1 *DIGIT ]; allow NUMBERS for DIGIT */ if v, ok := uri.pathAttributes["library-version"]; ok { m, err := regexp.Match("^[0-9]+(\\.[0-9]+)?$", []byte(v)) if err != nil || !m { return fmt.Errorf("Invalid format for library-version '%s'", v) } } if v, ok := uri.pathAttributes["type"]; ok { m, err := regexp.Match("^(public|private|cert|secret-key}data)?$", []byte(v)) if err != nil || !m { return fmt.Errorf("Invalid type '%s'", v) } } /* RFC 7512: 2.4 */ _, ok1 := uri.queryAttributes["pin-source"] _, ok2 := uri.queryAttributes["pin-value"] if ok1 && ok2 { return errors.New("URI must not contain pin-source and pin-value") } if v, ok := uri.queryAttributes["module-path"]; ok { if !filepath.IsAbs(v) { return fmt.Errorf("path %s of module-name attribute must be absolute", v) } } return nil } // HasPIN allows the user to check whether a PIN has been provided either by the pin-value or the pin-source // attributes. It should be called before GetPIN(), which may still fail getting the PIN from a file for example. func (uri *Pkcs11URI) HasPIN() bool { _, ok := uri.queryAttributes["pin-value"] if ok { return true } _, ok = uri.queryAttributes["pin-source"] return ok } // GetPIN gets the PIN from either the pin-value or pin-source attribute; a user may want to call HasPIN() // before calling this function to determine whether a PIN has been provided at all so that an error code // returned by this function indicates that the PIN value could not be retrieved. func (uri *Pkcs11URI) GetPIN() (string, error) { if v, ok := uri.queryAttributes["pin-value"]; ok { return v, nil } if v, ok := uri.queryAttributes["pin-source"]; ok { pinuri, err := url.ParseRequestURI(v) if err != nil { return "", fmt.Errorf("Could not parse pin-source: %s ", err) } switch pinuri.Scheme { case "", "file": if !filepath.IsAbs(pinuri.Path) { return "", fmt.Errorf("PIN URI path '%s' is not absolute", pinuri.Path) } pin, err := os.ReadFile(pinuri.Path) if err != nil { return "", fmt.Errorf("Could not open PIN file: %s", err) } return string(pin), nil default: return "", fmt.Errorf("PIN URI scheme %s is not supported", pinuri.Scheme) } } return "", fmt.Errorf("Neither pin-source nor pin-value are available") } // Parse parses a pkcs11: URI string func (uri *Pkcs11URI) Parse(uristring string) error { if !strings.HasPrefix(uristring, "pkcs11:") { return errors.New("Malformed pkcs11 URI: missing pcks11: prefix") } parts := strings.SplitN(uristring[7:], "?", 2) uri.pathAttributes = make(map[string]string) uri.queryAttributes = make(map[string]string) if len(parts[0]) > 0 { /* parse path part */ for _, part := range strings.Split(parts[0], ";") { p := strings.SplitN(part, "=", 2) if len(p) != 2 { return errors.New("Malformed pkcs11 URI: malformed path attribute") } if err := uri.AddPathAttribute(p[0], p[1]); err != nil { return fmt.Errorf("Malformed pkcs11 URI: %s", err) } } } if len(parts) == 2 { /* parse query part */ for _, part := range strings.Split(parts[1], "&") { p := strings.SplitN(part, "=", 2) if len(p) != 2 { return errors.New("Malformed pkcs11 URI: malformed query attribute") } if err := uri.AddQueryAttribute(p[0], p[1]); err != nil { return fmt.Errorf("Malformed pkcs11 URI: %s", err) } } } return uri.Validate() } // formatAttribute formats attributes and escapes their values as needed func formatAttributes(attrMap map[string]string, ispath bool) string { res := "" for key, value := range attrMap { switch key { case "id": /* id is always pct-encoded */ value = escapeAll(value) default: if ispath { value = escape(value, true) } else { value = escape(value, false) } } if len(res) > 0 { if ispath { res += ";" } else { res += "&" } } res += key + "=" + value } return res } // Format formats a Pkcs11URI to it string representaion func (uri *Pkcs11URI) Format() (string, error) { if err := uri.Validate(); err != nil { return "", err } result := "pkcs11:" + formatAttributes(uri.pathAttributes, true) if len(uri.queryAttributes) > 0 { result += "?" + formatAttributes(uri.queryAttributes, false) } return result, nil } // SetModuleDirectories sets the search directories for pkcs11 modules func (uri *Pkcs11URI) SetModuleDirectories(moduleDirectories []string) { uri.moduleDirectories = moduleDirectories } // GetModuleDirectories gets the search directories for pkcs11 modules func (uri *Pkcs11URI) GetModuleDirectories() []string { return uri.moduleDirectories } // SetAllowedModulePaths sets allowed module paths to restrict access to modules. // Directory entries must end with a '/', all other ones are assumed to be file entries. // Allowed modules are filtered by string matching. func (uri *Pkcs11URI) SetAllowedModulePaths(allowedModulePaths []string) { uri.allowedModulePaths = allowedModulePaths } // SetAllowAnyModule allows any module to be loaded; by default this is not allowed func (uri *Pkcs11URI) SetAllowAnyModule(allowAnyModule bool) { uri.allowAnyModule = allowAnyModule } func (uri *Pkcs11URI) isAllowedPath(path string, allowedPaths []string) bool { if uri.allowAnyModule { return true } for _, allowedPath := range allowedPaths { if allowedPath == path { // exact filename match return true } if allowedPath[len(allowedPath)-1] == '/' && strings.HasPrefix(path, allowedPath) { // allowedPath no subdirectory is allowed idx := strings.IndexRune(path[len(allowedPath):], os.PathSeparator) if idx < 0 { return true } } } return false } // GetModule returns the module to use or an error in case no module could be found. // First the module-path is checked for whether it holds an absolute that can be read // by the current user. If this is the case the module is returned. Otherwise either the module-path // is used or the user-provided module path is used to match a module containing what is set in the // attribute module-name. func (uri *Pkcs11URI) GetModule() (string, error) { var searchdirs []string v, ok := uri.queryAttributes["module-path"] if ok { info, err := os.Stat(v) if err != nil { return "", fmt.Errorf("module-path '%s' is not accessible", v) } if err == nil && info.Mode().IsRegular() { // it's a file if uri.isAllowedPath(v, uri.allowedModulePaths) { return v, nil } return "", fmt.Errorf("module-path '%s' is not allowed by policy", v) } if !info.IsDir() { return "", fmt.Errorf("module-path '%s' points to an invalid file type", v) } // v is a directory searchdirs = []string{v} } else { searchdirs = uri.GetModuleDirectories() } moduleName, ok := uri.queryAttributes["module-name"] if !ok { return "", fmt.Errorf("module-name attribute is not set") } moduleName = strings.ToLower(moduleName) for _, dir := range searchdirs { files, err := os.ReadDir(dir) if err != nil { continue } for _, file := range files { fileLower := strings.ToLower(file.Name()) i := strings.Index(fileLower, moduleName) if i < 0 { continue } // we require that the fileLower ends with moduleName or that // a suffix follows so that softhsm will not match libsofthsm2.so but only // libsofthsm.so if len(fileLower) == i+len(moduleName) || fileLower[i+len(moduleName)] == '.' { f := filepath.Join(dir, file.Name()) if uri.isAllowedPath(f, uri.allowedModulePaths) { return f, nil } return "", fmt.Errorf("module '%s' is not allowed by policy", f) } } } return "", fmt.Errorf("No module could be found") } ================================================ FILE: vendor/github.com/stretchr/testify/LICENSE ================================================ MIT License Copyright (c) 2012-2020 Mat Ryer, Tyler Bunnell and contributors. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: vendor/github.com/stretchr/testify/assert/assertion_compare.go ================================================ package assert import ( "bytes" "fmt" "reflect" "time" ) // Deprecated: CompareType has only ever been for internal use and has accidentally been published since v1.6.0. Do not use it. type CompareType = compareResult type compareResult int const ( compareLess compareResult = iota - 1 compareEqual compareGreater ) var ( intType = reflect.TypeOf(int(1)) int8Type = reflect.TypeOf(int8(1)) int16Type = reflect.TypeOf(int16(1)) int32Type = reflect.TypeOf(int32(1)) int64Type = reflect.TypeOf(int64(1)) uintType = reflect.TypeOf(uint(1)) uint8Type = reflect.TypeOf(uint8(1)) uint16Type = reflect.TypeOf(uint16(1)) uint32Type = reflect.TypeOf(uint32(1)) uint64Type = reflect.TypeOf(uint64(1)) uintptrType = reflect.TypeOf(uintptr(1)) float32Type = reflect.TypeOf(float32(1)) float64Type = reflect.TypeOf(float64(1)) stringType = reflect.TypeOf("") timeType = reflect.TypeOf(time.Time{}) bytesType = reflect.TypeOf([]byte{}) ) func compare(obj1, obj2 interface{}, kind reflect.Kind) (compareResult, bool) { obj1Value := reflect.ValueOf(obj1) obj2Value := reflect.ValueOf(obj2) // throughout this switch we try and avoid calling .Convert() if possible, // as this has a pretty big performance impact switch kind { case reflect.Int: { intobj1, ok := obj1.(int) if !ok { intobj1 = obj1Value.Convert(intType).Interface().(int) } intobj2, ok := obj2.(int) if !ok { intobj2 = obj2Value.Convert(intType).Interface().(int) } if intobj1 > intobj2 { return compareGreater, true } if intobj1 == intobj2 { return compareEqual, true } if intobj1 < intobj2 { return compareLess, true } } case reflect.Int8: { int8obj1, ok := obj1.(int8) if !ok { int8obj1 = obj1Value.Convert(int8Type).Interface().(int8) } int8obj2, ok := obj2.(int8) if !ok { int8obj2 = obj2Value.Convert(int8Type).Interface().(int8) } if int8obj1 > int8obj2 { return compareGreater, true } if int8obj1 == int8obj2 { return compareEqual, true } if int8obj1 < int8obj2 { return compareLess, true } } case reflect.Int16: { int16obj1, ok := obj1.(int16) if !ok { int16obj1 = obj1Value.Convert(int16Type).Interface().(int16) } int16obj2, ok := obj2.(int16) if !ok { int16obj2 = obj2Value.Convert(int16Type).Interface().(int16) } if int16obj1 > int16obj2 { return compareGreater, true } if int16obj1 == int16obj2 { return compareEqual, true } if int16obj1 < int16obj2 { return compareLess, true } } case reflect.Int32: { int32obj1, ok := obj1.(int32) if !ok { int32obj1 = obj1Value.Convert(int32Type).Interface().(int32) } int32obj2, ok := obj2.(int32) if !ok { int32obj2 = obj2Value.Convert(int32Type).Interface().(int32) } if int32obj1 > int32obj2 { return compareGreater, true } if int32obj1 == int32obj2 { return compareEqual, true } if int32obj1 < int32obj2 { return compareLess, true } } case reflect.Int64: { int64obj1, ok := obj1.(int64) if !ok { int64obj1 = obj1Value.Convert(int64Type).Interface().(int64) } int64obj2, ok := obj2.(int64) if !ok { int64obj2 = obj2Value.Convert(int64Type).Interface().(int64) } if int64obj1 > int64obj2 { return compareGreater, true } if int64obj1 == int64obj2 { return compareEqual, true } if int64obj1 < int64obj2 { return compareLess, true } } case reflect.Uint: { uintobj1, ok := obj1.(uint) if !ok { uintobj1 = obj1Value.Convert(uintType).Interface().(uint) } uintobj2, ok := obj2.(uint) if !ok { uintobj2 = obj2Value.Convert(uintType).Interface().(uint) } if uintobj1 > uintobj2 { return compareGreater, true } if uintobj1 == uintobj2 { return compareEqual, true } if uintobj1 < uintobj2 { return compareLess, true } } case reflect.Uint8: { uint8obj1, ok := obj1.(uint8) if !ok { uint8obj1 = obj1Value.Convert(uint8Type).Interface().(uint8) } uint8obj2, ok := obj2.(uint8) if !ok { uint8obj2 = obj2Value.Convert(uint8Type).Interface().(uint8) } if uint8obj1 > uint8obj2 { return compareGreater, true } if uint8obj1 == uint8obj2 { return compareEqual, true } if uint8obj1 < uint8obj2 { return compareLess, true } } case reflect.Uint16: { uint16obj1, ok := obj1.(uint16) if !ok { uint16obj1 = obj1Value.Convert(uint16Type).Interface().(uint16) } uint16obj2, ok := obj2.(uint16) if !ok { uint16obj2 = obj2Value.Convert(uint16Type).Interface().(uint16) } if uint16obj1 > uint16obj2 { return compareGreater, true } if uint16obj1 == uint16obj2 { return compareEqual, true } if uint16obj1 < uint16obj2 { return compareLess, true } } case reflect.Uint32: { uint32obj1, ok := obj1.(uint32) if !ok { uint32obj1 = obj1Value.Convert(uint32Type).Interface().(uint32) } uint32obj2, ok := obj2.(uint32) if !ok { uint32obj2 = obj2Value.Convert(uint32Type).Interface().(uint32) } if uint32obj1 > uint32obj2 { return compareGreater, true } if uint32obj1 == uint32obj2 { return compareEqual, true } if uint32obj1 < uint32obj2 { return compareLess, true } } case reflect.Uint64: { uint64obj1, ok := obj1.(uint64) if !ok { uint64obj1 = obj1Value.Convert(uint64Type).Interface().(uint64) } uint64obj2, ok := obj2.(uint64) if !ok { uint64obj2 = obj2Value.Convert(uint64Type).Interface().(uint64) } if uint64obj1 > uint64obj2 { return compareGreater, true } if uint64obj1 == uint64obj2 { return compareEqual, true } if uint64obj1 < uint64obj2 { return compareLess, true } } case reflect.Float32: { float32obj1, ok := obj1.(float32) if !ok { float32obj1 = obj1Value.Convert(float32Type).Interface().(float32) } float32obj2, ok := obj2.(float32) if !ok { float32obj2 = obj2Value.Convert(float32Type).Interface().(float32) } if float32obj1 > float32obj2 { return compareGreater, true } if float32obj1 == float32obj2 { return compareEqual, true } if float32obj1 < float32obj2 { return compareLess, true } } case reflect.Float64: { float64obj1, ok := obj1.(float64) if !ok { float64obj1 = obj1Value.Convert(float64Type).Interface().(float64) } float64obj2, ok := obj2.(float64) if !ok { float64obj2 = obj2Value.Convert(float64Type).Interface().(float64) } if float64obj1 > float64obj2 { return compareGreater, true } if float64obj1 == float64obj2 { return compareEqual, true } if float64obj1 < float64obj2 { return compareLess, true } } case reflect.String: { stringobj1, ok := obj1.(string) if !ok { stringobj1 = obj1Value.Convert(stringType).Interface().(string) } stringobj2, ok := obj2.(string) if !ok { stringobj2 = obj2Value.Convert(stringType).Interface().(string) } if stringobj1 > stringobj2 { return compareGreater, true } if stringobj1 == stringobj2 { return compareEqual, true } if stringobj1 < stringobj2 { return compareLess, true } } // Check for known struct types we can check for compare results. case reflect.Struct: { // All structs enter here. We're not interested in most types. if !obj1Value.CanConvert(timeType) { break } // time.Time can be compared! timeObj1, ok := obj1.(time.Time) if !ok { timeObj1 = obj1Value.Convert(timeType).Interface().(time.Time) } timeObj2, ok := obj2.(time.Time) if !ok { timeObj2 = obj2Value.Convert(timeType).Interface().(time.Time) } if timeObj1.Before(timeObj2) { return compareLess, true } if timeObj1.Equal(timeObj2) { return compareEqual, true } return compareGreater, true } case reflect.Slice: { // We only care about the []byte type. if !obj1Value.CanConvert(bytesType) { break } // []byte can be compared! bytesObj1, ok := obj1.([]byte) if !ok { bytesObj1 = obj1Value.Convert(bytesType).Interface().([]byte) } bytesObj2, ok := obj2.([]byte) if !ok { bytesObj2 = obj2Value.Convert(bytesType).Interface().([]byte) } return compareResult(bytes.Compare(bytesObj1, bytesObj2)), true } case reflect.Uintptr: { uintptrObj1, ok := obj1.(uintptr) if !ok { uintptrObj1 = obj1Value.Convert(uintptrType).Interface().(uintptr) } uintptrObj2, ok := obj2.(uintptr) if !ok { uintptrObj2 = obj2Value.Convert(uintptrType).Interface().(uintptr) } if uintptrObj1 > uintptrObj2 { return compareGreater, true } if uintptrObj1 == uintptrObj2 { return compareEqual, true } if uintptrObj1 < uintptrObj2 { return compareLess, true } } } return compareEqual, false } // Greater asserts that the first element is greater than the second // // assert.Greater(t, 2, 1) // assert.Greater(t, float64(2), float64(1)) // assert.Greater(t, "b", "a") func Greater(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } failMessage := fmt.Sprintf("\"%v\" is not greater than \"%v\"", e1, e2) return compareTwoValues(t, e1, e2, []compareResult{compareGreater}, failMessage, msgAndArgs...) } // GreaterOrEqual asserts that the first element is greater than or equal to the second // // assert.GreaterOrEqual(t, 2, 1) // assert.GreaterOrEqual(t, 2, 2) // assert.GreaterOrEqual(t, "b", "a") // assert.GreaterOrEqual(t, "b", "b") func GreaterOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } failMessage := fmt.Sprintf("\"%v\" is not greater than or equal to \"%v\"", e1, e2) return compareTwoValues(t, e1, e2, []compareResult{compareGreater, compareEqual}, failMessage, msgAndArgs...) } // Less asserts that the first element is less than the second // // assert.Less(t, 1, 2) // assert.Less(t, float64(1), float64(2)) // assert.Less(t, "a", "b") func Less(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } failMessage := fmt.Sprintf("\"%v\" is not less than \"%v\"", e1, e2) return compareTwoValues(t, e1, e2, []compareResult{compareLess}, failMessage, msgAndArgs...) } // LessOrEqual asserts that the first element is less than or equal to the second // // assert.LessOrEqual(t, 1, 2) // assert.LessOrEqual(t, 2, 2) // assert.LessOrEqual(t, "a", "b") // assert.LessOrEqual(t, "b", "b") func LessOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } failMessage := fmt.Sprintf("\"%v\" is not less than or equal to \"%v\"", e1, e2) return compareTwoValues(t, e1, e2, []compareResult{compareLess, compareEqual}, failMessage, msgAndArgs...) } // Positive asserts that the specified element is positive // // assert.Positive(t, 1) // assert.Positive(t, 1.23) func Positive(t TestingT, e interface{}, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } zero := reflect.Zero(reflect.TypeOf(e)) failMessage := fmt.Sprintf("\"%v\" is not positive", e) return compareTwoValues(t, e, zero.Interface(), []compareResult{compareGreater}, failMessage, msgAndArgs...) } // Negative asserts that the specified element is negative // // assert.Negative(t, -1) // assert.Negative(t, -1.23) func Negative(t TestingT, e interface{}, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } zero := reflect.Zero(reflect.TypeOf(e)) failMessage := fmt.Sprintf("\"%v\" is not negative", e) return compareTwoValues(t, e, zero.Interface(), []compareResult{compareLess}, failMessage, msgAndArgs...) } func compareTwoValues(t TestingT, e1 interface{}, e2 interface{}, allowedComparesResults []compareResult, failMessage string, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } e1Kind := reflect.ValueOf(e1).Kind() e2Kind := reflect.ValueOf(e2).Kind() if e1Kind != e2Kind { return Fail(t, "Elements should be the same type", msgAndArgs...) } compareResult, isComparable := compare(e1, e2, e1Kind) if !isComparable { return Fail(t, fmt.Sprintf(`Can not compare type "%T"`, e1), msgAndArgs...) } if !containsValue(allowedComparesResults, compareResult) { return Fail(t, failMessage, msgAndArgs...) } return true } func containsValue(values []compareResult, value compareResult) bool { for _, v := range values { if v == value { return true } } return false } ================================================ FILE: vendor/github.com/stretchr/testify/assert/assertion_format.go ================================================ // Code generated with github.com/stretchr/testify/_codegen; DO NOT EDIT. package assert import ( http "net/http" url "net/url" time "time" ) // Conditionf uses a Comparison to assert a complex condition. func Conditionf(t TestingT, comp Comparison, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return Condition(t, comp, append([]interface{}{msg}, args...)...) } // Containsf asserts that the specified string, list(array, slice...) or map contains the // specified substring or element. // // assert.Containsf(t, "Hello World", "World", "error message %s", "formatted") // assert.Containsf(t, ["Hello", "World"], "World", "error message %s", "formatted") // assert.Containsf(t, {"Hello": "World"}, "Hello", "error message %s", "formatted") func Containsf(t TestingT, s interface{}, contains interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return Contains(t, s, contains, append([]interface{}{msg}, args...)...) } // DirExistsf checks whether a directory exists in the given path. It also fails // if the path is a file rather a directory or there is an error checking whether it exists. func DirExistsf(t TestingT, path string, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return DirExists(t, path, append([]interface{}{msg}, args...)...) } // ElementsMatchf asserts that the specified listA(array, slice...) is equal to specified // listB(array, slice...) ignoring the order of the elements. If there are duplicate elements, // the number of appearances of each of them in both lists should match. // // assert.ElementsMatchf(t, [1, 3, 2, 3], [1, 3, 3, 2], "error message %s", "formatted") func ElementsMatchf(t TestingT, listA interface{}, listB interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return ElementsMatch(t, listA, listB, append([]interface{}{msg}, args...)...) } // Emptyf asserts that the given value is "empty". // // [Zero values] are "empty". // // Arrays are "empty" if every element is the zero value of the type (stricter than "empty"). // // Slices, maps and channels with zero length are "empty". // // Pointer values are "empty" if the pointer is nil or if the pointed value is "empty". // // assert.Emptyf(t, obj, "error message %s", "formatted") // // [Zero values]: https://go.dev/ref/spec#The_zero_value func Emptyf(t TestingT, object interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return Empty(t, object, append([]interface{}{msg}, args...)...) } // Equalf asserts that two objects are equal. // // assert.Equalf(t, 123, 123, "error message %s", "formatted") // // Pointer variable equality is determined based on the equality of the // referenced values (as opposed to the memory addresses). Function equality // cannot be determined and will always fail. func Equalf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return Equal(t, expected, actual, append([]interface{}{msg}, args...)...) } // EqualErrorf asserts that a function returned an error (i.e. not `nil`) // and that it is equal to the provided error. // // actualObj, err := SomeFunction() // assert.EqualErrorf(t, err, expectedErrorString, "error message %s", "formatted") func EqualErrorf(t TestingT, theError error, errString string, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return EqualError(t, theError, errString, append([]interface{}{msg}, args...)...) } // EqualExportedValuesf asserts that the types of two objects are equal and their public // fields are also equal. This is useful for comparing structs that have private fields // that could potentially differ. // // type S struct { // Exported int // notExported int // } // assert.EqualExportedValuesf(t, S{1, 2}, S{1, 3}, "error message %s", "formatted") => true // assert.EqualExportedValuesf(t, S{1, 2}, S{2, 3}, "error message %s", "formatted") => false func EqualExportedValuesf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return EqualExportedValues(t, expected, actual, append([]interface{}{msg}, args...)...) } // EqualValuesf asserts that two objects are equal or convertible to the larger // type and equal. // // assert.EqualValuesf(t, uint32(123), int32(123), "error message %s", "formatted") func EqualValuesf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return EqualValues(t, expected, actual, append([]interface{}{msg}, args...)...) } // Errorf asserts that a function returned an error (i.e. not `nil`). // // actualObj, err := SomeFunction() // assert.Errorf(t, err, "error message %s", "formatted") func Errorf(t TestingT, err error, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return Error(t, err, append([]interface{}{msg}, args...)...) } // ErrorAsf asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. // This is a wrapper for errors.As. func ErrorAsf(t TestingT, err error, target interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return ErrorAs(t, err, target, append([]interface{}{msg}, args...)...) } // ErrorContainsf asserts that a function returned an error (i.e. not `nil`) // and that the error contains the specified substring. // // actualObj, err := SomeFunction() // assert.ErrorContainsf(t, err, expectedErrorSubString, "error message %s", "formatted") func ErrorContainsf(t TestingT, theError error, contains string, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return ErrorContains(t, theError, contains, append([]interface{}{msg}, args...)...) } // ErrorIsf asserts that at least one of the errors in err's chain matches target. // This is a wrapper for errors.Is. func ErrorIsf(t TestingT, err error, target error, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return ErrorIs(t, err, target, append([]interface{}{msg}, args...)...) } // Eventuallyf asserts that given condition will be met in waitFor time, // periodically checking target function each tick. // // assert.Eventuallyf(t, func() bool { return true; }, time.Second, 10*time.Millisecond, "error message %s", "formatted") func Eventuallyf(t TestingT, condition func() bool, waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return Eventually(t, condition, waitFor, tick, append([]interface{}{msg}, args...)...) } // EventuallyWithTf asserts that given condition will be met in waitFor time, // periodically checking target function each tick. In contrast to Eventually, // it supplies a CollectT to the condition function, so that the condition // function can use the CollectT to call other assertions. // The condition is considered "met" if no errors are raised in a tick. // The supplied CollectT collects all errors from one tick (if there are any). // If the condition is not met before waitFor, the collected errors of // the last tick are copied to t. // // externalValue := false // go func() { // time.Sleep(8*time.Second) // externalValue = true // }() // assert.EventuallyWithTf(t, func(c *assert.CollectT, "error message %s", "formatted") { // // add assertions as needed; any assertion failure will fail the current tick // assert.True(c, externalValue, "expected 'externalValue' to be true") // }, 10*time.Second, 1*time.Second, "external state has not changed to 'true'; still false") func EventuallyWithTf(t TestingT, condition func(collect *CollectT), waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return EventuallyWithT(t, condition, waitFor, tick, append([]interface{}{msg}, args...)...) } // Exactlyf asserts that two objects are equal in value and type. // // assert.Exactlyf(t, int32(123), int64(123), "error message %s", "formatted") func Exactlyf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return Exactly(t, expected, actual, append([]interface{}{msg}, args...)...) } // Failf reports a failure through func Failf(t TestingT, failureMessage string, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return Fail(t, failureMessage, append([]interface{}{msg}, args...)...) } // FailNowf fails test func FailNowf(t TestingT, failureMessage string, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return FailNow(t, failureMessage, append([]interface{}{msg}, args...)...) } // Falsef asserts that the specified value is false. // // assert.Falsef(t, myBool, "error message %s", "formatted") func Falsef(t TestingT, value bool, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return False(t, value, append([]interface{}{msg}, args...)...) } // FileExistsf checks whether a file exists in the given path. It also fails if // the path points to a directory or there is an error when trying to check the file. func FileExistsf(t TestingT, path string, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return FileExists(t, path, append([]interface{}{msg}, args...)...) } // Greaterf asserts that the first element is greater than the second // // assert.Greaterf(t, 2, 1, "error message %s", "formatted") // assert.Greaterf(t, float64(2), float64(1), "error message %s", "formatted") // assert.Greaterf(t, "b", "a", "error message %s", "formatted") func Greaterf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return Greater(t, e1, e2, append([]interface{}{msg}, args...)...) } // GreaterOrEqualf asserts that the first element is greater than or equal to the second // // assert.GreaterOrEqualf(t, 2, 1, "error message %s", "formatted") // assert.GreaterOrEqualf(t, 2, 2, "error message %s", "formatted") // assert.GreaterOrEqualf(t, "b", "a", "error message %s", "formatted") // assert.GreaterOrEqualf(t, "b", "b", "error message %s", "formatted") func GreaterOrEqualf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return GreaterOrEqual(t, e1, e2, append([]interface{}{msg}, args...)...) } // HTTPBodyContainsf asserts that a specified handler returns a // body that contains a string. // // assert.HTTPBodyContainsf(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted") // // Returns whether the assertion was successful (true) or not (false). func HTTPBodyContainsf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return HTTPBodyContains(t, handler, method, url, values, str, append([]interface{}{msg}, args...)...) } // HTTPBodyNotContainsf asserts that a specified handler returns a // body that does not contain a string. // // assert.HTTPBodyNotContainsf(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted") // // Returns whether the assertion was successful (true) or not (false). func HTTPBodyNotContainsf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return HTTPBodyNotContains(t, handler, method, url, values, str, append([]interface{}{msg}, args...)...) } // HTTPErrorf asserts that a specified handler returns an error status code. // // assert.HTTPErrorf(t, myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}} // // Returns whether the assertion was successful (true) or not (false). func HTTPErrorf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return HTTPError(t, handler, method, url, values, append([]interface{}{msg}, args...)...) } // HTTPRedirectf asserts that a specified handler returns a redirect status code. // // assert.HTTPRedirectf(t, myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}} // // Returns whether the assertion was successful (true) or not (false). func HTTPRedirectf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return HTTPRedirect(t, handler, method, url, values, append([]interface{}{msg}, args...)...) } // HTTPStatusCodef asserts that a specified handler returns a specified status code. // // assert.HTTPStatusCodef(t, myHandler, "GET", "/notImplemented", nil, 501, "error message %s", "formatted") // // Returns whether the assertion was successful (true) or not (false). func HTTPStatusCodef(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return HTTPStatusCode(t, handler, method, url, values, statuscode, append([]interface{}{msg}, args...)...) } // HTTPSuccessf asserts that a specified handler returns a success status code. // // assert.HTTPSuccessf(t, myHandler, "POST", "http://www.google.com", nil, "error message %s", "formatted") // // Returns whether the assertion was successful (true) or not (false). func HTTPSuccessf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return HTTPSuccess(t, handler, method, url, values, append([]interface{}{msg}, args...)...) } // Implementsf asserts that an object is implemented by the specified interface. // // assert.Implementsf(t, (*MyInterface)(nil), new(MyObject), "error message %s", "formatted") func Implementsf(t TestingT, interfaceObject interface{}, object interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return Implements(t, interfaceObject, object, append([]interface{}{msg}, args...)...) } // InDeltaf asserts that the two numerals are within delta of each other. // // assert.InDeltaf(t, math.Pi, 22/7.0, 0.01, "error message %s", "formatted") func InDeltaf(t TestingT, expected interface{}, actual interface{}, delta float64, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return InDelta(t, expected, actual, delta, append([]interface{}{msg}, args...)...) } // InDeltaMapValuesf is the same as InDelta, but it compares all values between two maps. Both maps must have exactly the same keys. func InDeltaMapValuesf(t TestingT, expected interface{}, actual interface{}, delta float64, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return InDeltaMapValues(t, expected, actual, delta, append([]interface{}{msg}, args...)...) } // InDeltaSlicef is the same as InDelta, except it compares two slices. func InDeltaSlicef(t TestingT, expected interface{}, actual interface{}, delta float64, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return InDeltaSlice(t, expected, actual, delta, append([]interface{}{msg}, args...)...) } // InEpsilonf asserts that expected and actual have a relative error less than epsilon func InEpsilonf(t TestingT, expected interface{}, actual interface{}, epsilon float64, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return InEpsilon(t, expected, actual, epsilon, append([]interface{}{msg}, args...)...) } // InEpsilonSlicef is the same as InEpsilon, except it compares each value from two slices. func InEpsilonSlicef(t TestingT, expected interface{}, actual interface{}, epsilon float64, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return InEpsilonSlice(t, expected, actual, epsilon, append([]interface{}{msg}, args...)...) } // IsDecreasingf asserts that the collection is decreasing // // assert.IsDecreasingf(t, []int{2, 1, 0}, "error message %s", "formatted") // assert.IsDecreasingf(t, []float{2, 1}, "error message %s", "formatted") // assert.IsDecreasingf(t, []string{"b", "a"}, "error message %s", "formatted") func IsDecreasingf(t TestingT, object interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return IsDecreasing(t, object, append([]interface{}{msg}, args...)...) } // IsIncreasingf asserts that the collection is increasing // // assert.IsIncreasingf(t, []int{1, 2, 3}, "error message %s", "formatted") // assert.IsIncreasingf(t, []float{1, 2}, "error message %s", "formatted") // assert.IsIncreasingf(t, []string{"a", "b"}, "error message %s", "formatted") func IsIncreasingf(t TestingT, object interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return IsIncreasing(t, object, append([]interface{}{msg}, args...)...) } // IsNonDecreasingf asserts that the collection is not decreasing // // assert.IsNonDecreasingf(t, []int{1, 1, 2}, "error message %s", "formatted") // assert.IsNonDecreasingf(t, []float{1, 2}, "error message %s", "formatted") // assert.IsNonDecreasingf(t, []string{"a", "b"}, "error message %s", "formatted") func IsNonDecreasingf(t TestingT, object interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return IsNonDecreasing(t, object, append([]interface{}{msg}, args...)...) } // IsNonIncreasingf asserts that the collection is not increasing // // assert.IsNonIncreasingf(t, []int{2, 1, 1}, "error message %s", "formatted") // assert.IsNonIncreasingf(t, []float{2, 1}, "error message %s", "formatted") // assert.IsNonIncreasingf(t, []string{"b", "a"}, "error message %s", "formatted") func IsNonIncreasingf(t TestingT, object interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return IsNonIncreasing(t, object, append([]interface{}{msg}, args...)...) } // IsNotTypef asserts that the specified objects are not of the same type. // // assert.IsNotTypef(t, &NotMyStruct{}, &MyStruct{}, "error message %s", "formatted") func IsNotTypef(t TestingT, theType interface{}, object interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return IsNotType(t, theType, object, append([]interface{}{msg}, args...)...) } // IsTypef asserts that the specified objects are of the same type. // // assert.IsTypef(t, &MyStruct{}, &MyStruct{}, "error message %s", "formatted") func IsTypef(t TestingT, expectedType interface{}, object interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return IsType(t, expectedType, object, append([]interface{}{msg}, args...)...) } // JSONEqf asserts that two JSON strings are equivalent. // // assert.JSONEqf(t, `{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`, "error message %s", "formatted") func JSONEqf(t TestingT, expected string, actual string, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return JSONEq(t, expected, actual, append([]interface{}{msg}, args...)...) } // Lenf asserts that the specified object has specific length. // Lenf also fails if the object has a type that len() not accept. // // assert.Lenf(t, mySlice, 3, "error message %s", "formatted") func Lenf(t TestingT, object interface{}, length int, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return Len(t, object, length, append([]interface{}{msg}, args...)...) } // Lessf asserts that the first element is less than the second // // assert.Lessf(t, 1, 2, "error message %s", "formatted") // assert.Lessf(t, float64(1), float64(2), "error message %s", "formatted") // assert.Lessf(t, "a", "b", "error message %s", "formatted") func Lessf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return Less(t, e1, e2, append([]interface{}{msg}, args...)...) } // LessOrEqualf asserts that the first element is less than or equal to the second // // assert.LessOrEqualf(t, 1, 2, "error message %s", "formatted") // assert.LessOrEqualf(t, 2, 2, "error message %s", "formatted") // assert.LessOrEqualf(t, "a", "b", "error message %s", "formatted") // assert.LessOrEqualf(t, "b", "b", "error message %s", "formatted") func LessOrEqualf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return LessOrEqual(t, e1, e2, append([]interface{}{msg}, args...)...) } // Negativef asserts that the specified element is negative // // assert.Negativef(t, -1, "error message %s", "formatted") // assert.Negativef(t, -1.23, "error message %s", "formatted") func Negativef(t TestingT, e interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return Negative(t, e, append([]interface{}{msg}, args...)...) } // Neverf asserts that the given condition doesn't satisfy in waitFor time, // periodically checking the target function each tick. // // assert.Neverf(t, func() bool { return false; }, time.Second, 10*time.Millisecond, "error message %s", "formatted") func Neverf(t TestingT, condition func() bool, waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return Never(t, condition, waitFor, tick, append([]interface{}{msg}, args...)...) } // Nilf asserts that the specified object is nil. // // assert.Nilf(t, err, "error message %s", "formatted") func Nilf(t TestingT, object interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return Nil(t, object, append([]interface{}{msg}, args...)...) } // NoDirExistsf checks whether a directory does not exist in the given path. // It fails if the path points to an existing _directory_ only. func NoDirExistsf(t TestingT, path string, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return NoDirExists(t, path, append([]interface{}{msg}, args...)...) } // NoErrorf asserts that a function returned no error (i.e. `nil`). // // actualObj, err := SomeFunction() // if assert.NoErrorf(t, err, "error message %s", "formatted") { // assert.Equal(t, expectedObj, actualObj) // } func NoErrorf(t TestingT, err error, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return NoError(t, err, append([]interface{}{msg}, args...)...) } // NoFileExistsf checks whether a file does not exist in a given path. It fails // if the path points to an existing _file_ only. func NoFileExistsf(t TestingT, path string, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return NoFileExists(t, path, append([]interface{}{msg}, args...)...) } // NotContainsf asserts that the specified string, list(array, slice...) or map does NOT contain the // specified substring or element. // // assert.NotContainsf(t, "Hello World", "Earth", "error message %s", "formatted") // assert.NotContainsf(t, ["Hello", "World"], "Earth", "error message %s", "formatted") // assert.NotContainsf(t, {"Hello": "World"}, "Earth", "error message %s", "formatted") func NotContainsf(t TestingT, s interface{}, contains interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return NotContains(t, s, contains, append([]interface{}{msg}, args...)...) } // NotElementsMatchf asserts that the specified listA(array, slice...) is NOT equal to specified // listB(array, slice...) ignoring the order of the elements. If there are duplicate elements, // the number of appearances of each of them in both lists should not match. // This is an inverse of ElementsMatch. // // assert.NotElementsMatchf(t, [1, 1, 2, 3], [1, 1, 2, 3], "error message %s", "formatted") -> false // // assert.NotElementsMatchf(t, [1, 1, 2, 3], [1, 2, 3], "error message %s", "formatted") -> true // // assert.NotElementsMatchf(t, [1, 2, 3], [1, 2, 4], "error message %s", "formatted") -> true func NotElementsMatchf(t TestingT, listA interface{}, listB interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return NotElementsMatch(t, listA, listB, append([]interface{}{msg}, args...)...) } // NotEmptyf asserts that the specified object is NOT [Empty]. // // if assert.NotEmptyf(t, obj, "error message %s", "formatted") { // assert.Equal(t, "two", obj[1]) // } func NotEmptyf(t TestingT, object interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return NotEmpty(t, object, append([]interface{}{msg}, args...)...) } // NotEqualf asserts that the specified values are NOT equal. // // assert.NotEqualf(t, obj1, obj2, "error message %s", "formatted") // // Pointer variable equality is determined based on the equality of the // referenced values (as opposed to the memory addresses). func NotEqualf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return NotEqual(t, expected, actual, append([]interface{}{msg}, args...)...) } // NotEqualValuesf asserts that two objects are not equal even when converted to the same type // // assert.NotEqualValuesf(t, obj1, obj2, "error message %s", "formatted") func NotEqualValuesf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return NotEqualValues(t, expected, actual, append([]interface{}{msg}, args...)...) } // NotErrorAsf asserts that none of the errors in err's chain matches target, // but if so, sets target to that error value. func NotErrorAsf(t TestingT, err error, target interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return NotErrorAs(t, err, target, append([]interface{}{msg}, args...)...) } // NotErrorIsf asserts that none of the errors in err's chain matches target. // This is a wrapper for errors.Is. func NotErrorIsf(t TestingT, err error, target error, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return NotErrorIs(t, err, target, append([]interface{}{msg}, args...)...) } // NotImplementsf asserts that an object does not implement the specified interface. // // assert.NotImplementsf(t, (*MyInterface)(nil), new(MyObject), "error message %s", "formatted") func NotImplementsf(t TestingT, interfaceObject interface{}, object interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return NotImplements(t, interfaceObject, object, append([]interface{}{msg}, args...)...) } // NotNilf asserts that the specified object is not nil. // // assert.NotNilf(t, err, "error message %s", "formatted") func NotNilf(t TestingT, object interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return NotNil(t, object, append([]interface{}{msg}, args...)...) } // NotPanicsf asserts that the code inside the specified PanicTestFunc does NOT panic. // // assert.NotPanicsf(t, func(){ RemainCalm() }, "error message %s", "formatted") func NotPanicsf(t TestingT, f PanicTestFunc, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return NotPanics(t, f, append([]interface{}{msg}, args...)...) } // NotRegexpf asserts that a specified regexp does not match a string. // // assert.NotRegexpf(t, regexp.MustCompile("starts"), "it's starting", "error message %s", "formatted") // assert.NotRegexpf(t, "^start", "it's not starting", "error message %s", "formatted") func NotRegexpf(t TestingT, rx interface{}, str interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return NotRegexp(t, rx, str, append([]interface{}{msg}, args...)...) } // NotSamef asserts that two pointers do not reference the same object. // // assert.NotSamef(t, ptr1, ptr2, "error message %s", "formatted") // // Both arguments must be pointer variables. Pointer variable sameness is // determined based on the equality of both type and value. func NotSamef(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return NotSame(t, expected, actual, append([]interface{}{msg}, args...)...) } // NotSubsetf asserts that the list (array, slice, or map) does NOT contain all // elements given in the subset (array, slice, or map). // Map elements are key-value pairs unless compared with an array or slice where // only the map key is evaluated. // // assert.NotSubsetf(t, [1, 3, 4], [1, 2], "error message %s", "formatted") // assert.NotSubsetf(t, {"x": 1, "y": 2}, {"z": 3}, "error message %s", "formatted") // assert.NotSubsetf(t, [1, 3, 4], {1: "one", 2: "two"}, "error message %s", "formatted") // assert.NotSubsetf(t, {"x": 1, "y": 2}, ["z"], "error message %s", "formatted") func NotSubsetf(t TestingT, list interface{}, subset interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return NotSubset(t, list, subset, append([]interface{}{msg}, args...)...) } // NotZerof asserts that i is not the zero value for its type. func NotZerof(t TestingT, i interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return NotZero(t, i, append([]interface{}{msg}, args...)...) } // Panicsf asserts that the code inside the specified PanicTestFunc panics. // // assert.Panicsf(t, func(){ GoCrazy() }, "error message %s", "formatted") func Panicsf(t TestingT, f PanicTestFunc, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return Panics(t, f, append([]interface{}{msg}, args...)...) } // PanicsWithErrorf asserts that the code inside the specified PanicTestFunc // panics, and that the recovered panic value is an error that satisfies the // EqualError comparison. // // assert.PanicsWithErrorf(t, "crazy error", func(){ GoCrazy() }, "error message %s", "formatted") func PanicsWithErrorf(t TestingT, errString string, f PanicTestFunc, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return PanicsWithError(t, errString, f, append([]interface{}{msg}, args...)...) } // PanicsWithValuef asserts that the code inside the specified PanicTestFunc panics, and that // the recovered panic value equals the expected panic value. // // assert.PanicsWithValuef(t, "crazy error", func(){ GoCrazy() }, "error message %s", "formatted") func PanicsWithValuef(t TestingT, expected interface{}, f PanicTestFunc, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return PanicsWithValue(t, expected, f, append([]interface{}{msg}, args...)...) } // Positivef asserts that the specified element is positive // // assert.Positivef(t, 1, "error message %s", "formatted") // assert.Positivef(t, 1.23, "error message %s", "formatted") func Positivef(t TestingT, e interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return Positive(t, e, append([]interface{}{msg}, args...)...) } // Regexpf asserts that a specified regexp matches a string. // // assert.Regexpf(t, regexp.MustCompile("start"), "it's starting", "error message %s", "formatted") // assert.Regexpf(t, "start...$", "it's not starting", "error message %s", "formatted") func Regexpf(t TestingT, rx interface{}, str interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return Regexp(t, rx, str, append([]interface{}{msg}, args...)...) } // Samef asserts that two pointers reference the same object. // // assert.Samef(t, ptr1, ptr2, "error message %s", "formatted") // // Both arguments must be pointer variables. Pointer variable sameness is // determined based on the equality of both type and value. func Samef(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return Same(t, expected, actual, append([]interface{}{msg}, args...)...) } // Subsetf asserts that the list (array, slice, or map) contains all elements // given in the subset (array, slice, or map). // Map elements are key-value pairs unless compared with an array or slice where // only the map key is evaluated. // // assert.Subsetf(t, [1, 2, 3], [1, 2], "error message %s", "formatted") // assert.Subsetf(t, {"x": 1, "y": 2}, {"x": 1}, "error message %s", "formatted") // assert.Subsetf(t, [1, 2, 3], {1: "one", 2: "two"}, "error message %s", "formatted") // assert.Subsetf(t, {"x": 1, "y": 2}, ["x"], "error message %s", "formatted") func Subsetf(t TestingT, list interface{}, subset interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return Subset(t, list, subset, append([]interface{}{msg}, args...)...) } // Truef asserts that the specified value is true. // // assert.Truef(t, myBool, "error message %s", "formatted") func Truef(t TestingT, value bool, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return True(t, value, append([]interface{}{msg}, args...)...) } // WithinDurationf asserts that the two times are within duration delta of each other. // // assert.WithinDurationf(t, time.Now(), time.Now(), 10*time.Second, "error message %s", "formatted") func WithinDurationf(t TestingT, expected time.Time, actual time.Time, delta time.Duration, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return WithinDuration(t, expected, actual, delta, append([]interface{}{msg}, args...)...) } // WithinRangef asserts that a time is within a time range (inclusive). // // assert.WithinRangef(t, time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second), "error message %s", "formatted") func WithinRangef(t TestingT, actual time.Time, start time.Time, end time.Time, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return WithinRange(t, actual, start, end, append([]interface{}{msg}, args...)...) } // YAMLEqf asserts that two YAML strings are equivalent. func YAMLEqf(t TestingT, expected string, actual string, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return YAMLEq(t, expected, actual, append([]interface{}{msg}, args...)...) } // Zerof asserts that i is the zero value for its type. func Zerof(t TestingT, i interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return Zero(t, i, append([]interface{}{msg}, args...)...) } ================================================ FILE: vendor/github.com/stretchr/testify/assert/assertion_format.go.tmpl ================================================ {{.CommentFormat}} func {{.DocInfo.Name}}f(t TestingT, {{.ParamsFormat}}) bool { if h, ok := t.(tHelper); ok { h.Helper() } return {{.DocInfo.Name}}(t, {{.ForwardedParamsFormat}}) } ================================================ FILE: vendor/github.com/stretchr/testify/assert/assertion_forward.go ================================================ // Code generated with github.com/stretchr/testify/_codegen; DO NOT EDIT. package assert import ( http "net/http" url "net/url" time "time" ) // Condition uses a Comparison to assert a complex condition. func (a *Assertions) Condition(comp Comparison, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return Condition(a.t, comp, msgAndArgs...) } // Conditionf uses a Comparison to assert a complex condition. func (a *Assertions) Conditionf(comp Comparison, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return Conditionf(a.t, comp, msg, args...) } // Contains asserts that the specified string, list(array, slice...) or map contains the // specified substring or element. // // a.Contains("Hello World", "World") // a.Contains(["Hello", "World"], "World") // a.Contains({"Hello": "World"}, "Hello") func (a *Assertions) Contains(s interface{}, contains interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return Contains(a.t, s, contains, msgAndArgs...) } // Containsf asserts that the specified string, list(array, slice...) or map contains the // specified substring or element. // // a.Containsf("Hello World", "World", "error message %s", "formatted") // a.Containsf(["Hello", "World"], "World", "error message %s", "formatted") // a.Containsf({"Hello": "World"}, "Hello", "error message %s", "formatted") func (a *Assertions) Containsf(s interface{}, contains interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return Containsf(a.t, s, contains, msg, args...) } // DirExists checks whether a directory exists in the given path. It also fails // if the path is a file rather a directory or there is an error checking whether it exists. func (a *Assertions) DirExists(path string, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return DirExists(a.t, path, msgAndArgs...) } // DirExistsf checks whether a directory exists in the given path. It also fails // if the path is a file rather a directory or there is an error checking whether it exists. func (a *Assertions) DirExistsf(path string, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return DirExistsf(a.t, path, msg, args...) } // ElementsMatch asserts that the specified listA(array, slice...) is equal to specified // listB(array, slice...) ignoring the order of the elements. If there are duplicate elements, // the number of appearances of each of them in both lists should match. // // a.ElementsMatch([1, 3, 2, 3], [1, 3, 3, 2]) func (a *Assertions) ElementsMatch(listA interface{}, listB interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return ElementsMatch(a.t, listA, listB, msgAndArgs...) } // ElementsMatchf asserts that the specified listA(array, slice...) is equal to specified // listB(array, slice...) ignoring the order of the elements. If there are duplicate elements, // the number of appearances of each of them in both lists should match. // // a.ElementsMatchf([1, 3, 2, 3], [1, 3, 3, 2], "error message %s", "formatted") func (a *Assertions) ElementsMatchf(listA interface{}, listB interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return ElementsMatchf(a.t, listA, listB, msg, args...) } // Empty asserts that the given value is "empty". // // [Zero values] are "empty". // // Arrays are "empty" if every element is the zero value of the type (stricter than "empty"). // // Slices, maps and channels with zero length are "empty". // // Pointer values are "empty" if the pointer is nil or if the pointed value is "empty". // // a.Empty(obj) // // [Zero values]: https://go.dev/ref/spec#The_zero_value func (a *Assertions) Empty(object interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return Empty(a.t, object, msgAndArgs...) } // Emptyf asserts that the given value is "empty". // // [Zero values] are "empty". // // Arrays are "empty" if every element is the zero value of the type (stricter than "empty"). // // Slices, maps and channels with zero length are "empty". // // Pointer values are "empty" if the pointer is nil or if the pointed value is "empty". // // a.Emptyf(obj, "error message %s", "formatted") // // [Zero values]: https://go.dev/ref/spec#The_zero_value func (a *Assertions) Emptyf(object interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return Emptyf(a.t, object, msg, args...) } // Equal asserts that two objects are equal. // // a.Equal(123, 123) // // Pointer variable equality is determined based on the equality of the // referenced values (as opposed to the memory addresses). Function equality // cannot be determined and will always fail. func (a *Assertions) Equal(expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return Equal(a.t, expected, actual, msgAndArgs...) } // EqualError asserts that a function returned an error (i.e. not `nil`) // and that it is equal to the provided error. // // actualObj, err := SomeFunction() // a.EqualError(err, expectedErrorString) func (a *Assertions) EqualError(theError error, errString string, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return EqualError(a.t, theError, errString, msgAndArgs...) } // EqualErrorf asserts that a function returned an error (i.e. not `nil`) // and that it is equal to the provided error. // // actualObj, err := SomeFunction() // a.EqualErrorf(err, expectedErrorString, "error message %s", "formatted") func (a *Assertions) EqualErrorf(theError error, errString string, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return EqualErrorf(a.t, theError, errString, msg, args...) } // EqualExportedValues asserts that the types of two objects are equal and their public // fields are also equal. This is useful for comparing structs that have private fields // that could potentially differ. // // type S struct { // Exported int // notExported int // } // a.EqualExportedValues(S{1, 2}, S{1, 3}) => true // a.EqualExportedValues(S{1, 2}, S{2, 3}) => false func (a *Assertions) EqualExportedValues(expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return EqualExportedValues(a.t, expected, actual, msgAndArgs...) } // EqualExportedValuesf asserts that the types of two objects are equal and their public // fields are also equal. This is useful for comparing structs that have private fields // that could potentially differ. // // type S struct { // Exported int // notExported int // } // a.EqualExportedValuesf(S{1, 2}, S{1, 3}, "error message %s", "formatted") => true // a.EqualExportedValuesf(S{1, 2}, S{2, 3}, "error message %s", "formatted") => false func (a *Assertions) EqualExportedValuesf(expected interface{}, actual interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return EqualExportedValuesf(a.t, expected, actual, msg, args...) } // EqualValues asserts that two objects are equal or convertible to the larger // type and equal. // // a.EqualValues(uint32(123), int32(123)) func (a *Assertions) EqualValues(expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return EqualValues(a.t, expected, actual, msgAndArgs...) } // EqualValuesf asserts that two objects are equal or convertible to the larger // type and equal. // // a.EqualValuesf(uint32(123), int32(123), "error message %s", "formatted") func (a *Assertions) EqualValuesf(expected interface{}, actual interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return EqualValuesf(a.t, expected, actual, msg, args...) } // Equalf asserts that two objects are equal. // // a.Equalf(123, 123, "error message %s", "formatted") // // Pointer variable equality is determined based on the equality of the // referenced values (as opposed to the memory addresses). Function equality // cannot be determined and will always fail. func (a *Assertions) Equalf(expected interface{}, actual interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return Equalf(a.t, expected, actual, msg, args...) } // Error asserts that a function returned an error (i.e. not `nil`). // // actualObj, err := SomeFunction() // a.Error(err) func (a *Assertions) Error(err error, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return Error(a.t, err, msgAndArgs...) } // ErrorAs asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. // This is a wrapper for errors.As. func (a *Assertions) ErrorAs(err error, target interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return ErrorAs(a.t, err, target, msgAndArgs...) } // ErrorAsf asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. // This is a wrapper for errors.As. func (a *Assertions) ErrorAsf(err error, target interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return ErrorAsf(a.t, err, target, msg, args...) } // ErrorContains asserts that a function returned an error (i.e. not `nil`) // and that the error contains the specified substring. // // actualObj, err := SomeFunction() // a.ErrorContains(err, expectedErrorSubString) func (a *Assertions) ErrorContains(theError error, contains string, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return ErrorContains(a.t, theError, contains, msgAndArgs...) } // ErrorContainsf asserts that a function returned an error (i.e. not `nil`) // and that the error contains the specified substring. // // actualObj, err := SomeFunction() // a.ErrorContainsf(err, expectedErrorSubString, "error message %s", "formatted") func (a *Assertions) ErrorContainsf(theError error, contains string, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return ErrorContainsf(a.t, theError, contains, msg, args...) } // ErrorIs asserts that at least one of the errors in err's chain matches target. // This is a wrapper for errors.Is. func (a *Assertions) ErrorIs(err error, target error, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return ErrorIs(a.t, err, target, msgAndArgs...) } // ErrorIsf asserts that at least one of the errors in err's chain matches target. // This is a wrapper for errors.Is. func (a *Assertions) ErrorIsf(err error, target error, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return ErrorIsf(a.t, err, target, msg, args...) } // Errorf asserts that a function returned an error (i.e. not `nil`). // // actualObj, err := SomeFunction() // a.Errorf(err, "error message %s", "formatted") func (a *Assertions) Errorf(err error, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return Errorf(a.t, err, msg, args...) } // Eventually asserts that given condition will be met in waitFor time, // periodically checking target function each tick. // // a.Eventually(func() bool { return true; }, time.Second, 10*time.Millisecond) func (a *Assertions) Eventually(condition func() bool, waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return Eventually(a.t, condition, waitFor, tick, msgAndArgs...) } // EventuallyWithT asserts that given condition will be met in waitFor time, // periodically checking target function each tick. In contrast to Eventually, // it supplies a CollectT to the condition function, so that the condition // function can use the CollectT to call other assertions. // The condition is considered "met" if no errors are raised in a tick. // The supplied CollectT collects all errors from one tick (if there are any). // If the condition is not met before waitFor, the collected errors of // the last tick are copied to t. // // externalValue := false // go func() { // time.Sleep(8*time.Second) // externalValue = true // }() // a.EventuallyWithT(func(c *assert.CollectT) { // // add assertions as needed; any assertion failure will fail the current tick // assert.True(c, externalValue, "expected 'externalValue' to be true") // }, 10*time.Second, 1*time.Second, "external state has not changed to 'true'; still false") func (a *Assertions) EventuallyWithT(condition func(collect *CollectT), waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return EventuallyWithT(a.t, condition, waitFor, tick, msgAndArgs...) } // EventuallyWithTf asserts that given condition will be met in waitFor time, // periodically checking target function each tick. In contrast to Eventually, // it supplies a CollectT to the condition function, so that the condition // function can use the CollectT to call other assertions. // The condition is considered "met" if no errors are raised in a tick. // The supplied CollectT collects all errors from one tick (if there are any). // If the condition is not met before waitFor, the collected errors of // the last tick are copied to t. // // externalValue := false // go func() { // time.Sleep(8*time.Second) // externalValue = true // }() // a.EventuallyWithTf(func(c *assert.CollectT, "error message %s", "formatted") { // // add assertions as needed; any assertion failure will fail the current tick // assert.True(c, externalValue, "expected 'externalValue' to be true") // }, 10*time.Second, 1*time.Second, "external state has not changed to 'true'; still false") func (a *Assertions) EventuallyWithTf(condition func(collect *CollectT), waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return EventuallyWithTf(a.t, condition, waitFor, tick, msg, args...) } // Eventuallyf asserts that given condition will be met in waitFor time, // periodically checking target function each tick. // // a.Eventuallyf(func() bool { return true; }, time.Second, 10*time.Millisecond, "error message %s", "formatted") func (a *Assertions) Eventuallyf(condition func() bool, waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return Eventuallyf(a.t, condition, waitFor, tick, msg, args...) } // Exactly asserts that two objects are equal in value and type. // // a.Exactly(int32(123), int64(123)) func (a *Assertions) Exactly(expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return Exactly(a.t, expected, actual, msgAndArgs...) } // Exactlyf asserts that two objects are equal in value and type. // // a.Exactlyf(int32(123), int64(123), "error message %s", "formatted") func (a *Assertions) Exactlyf(expected interface{}, actual interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return Exactlyf(a.t, expected, actual, msg, args...) } // Fail reports a failure through func (a *Assertions) Fail(failureMessage string, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return Fail(a.t, failureMessage, msgAndArgs...) } // FailNow fails test func (a *Assertions) FailNow(failureMessage string, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return FailNow(a.t, failureMessage, msgAndArgs...) } // FailNowf fails test func (a *Assertions) FailNowf(failureMessage string, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return FailNowf(a.t, failureMessage, msg, args...) } // Failf reports a failure through func (a *Assertions) Failf(failureMessage string, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return Failf(a.t, failureMessage, msg, args...) } // False asserts that the specified value is false. // // a.False(myBool) func (a *Assertions) False(value bool, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return False(a.t, value, msgAndArgs...) } // Falsef asserts that the specified value is false. // // a.Falsef(myBool, "error message %s", "formatted") func (a *Assertions) Falsef(value bool, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return Falsef(a.t, value, msg, args...) } // FileExists checks whether a file exists in the given path. It also fails if // the path points to a directory or there is an error when trying to check the file. func (a *Assertions) FileExists(path string, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return FileExists(a.t, path, msgAndArgs...) } // FileExistsf checks whether a file exists in the given path. It also fails if // the path points to a directory or there is an error when trying to check the file. func (a *Assertions) FileExistsf(path string, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return FileExistsf(a.t, path, msg, args...) } // Greater asserts that the first element is greater than the second // // a.Greater(2, 1) // a.Greater(float64(2), float64(1)) // a.Greater("b", "a") func (a *Assertions) Greater(e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return Greater(a.t, e1, e2, msgAndArgs...) } // GreaterOrEqual asserts that the first element is greater than or equal to the second // // a.GreaterOrEqual(2, 1) // a.GreaterOrEqual(2, 2) // a.GreaterOrEqual("b", "a") // a.GreaterOrEqual("b", "b") func (a *Assertions) GreaterOrEqual(e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return GreaterOrEqual(a.t, e1, e2, msgAndArgs...) } // GreaterOrEqualf asserts that the first element is greater than or equal to the second // // a.GreaterOrEqualf(2, 1, "error message %s", "formatted") // a.GreaterOrEqualf(2, 2, "error message %s", "formatted") // a.GreaterOrEqualf("b", "a", "error message %s", "formatted") // a.GreaterOrEqualf("b", "b", "error message %s", "formatted") func (a *Assertions) GreaterOrEqualf(e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return GreaterOrEqualf(a.t, e1, e2, msg, args...) } // Greaterf asserts that the first element is greater than the second // // a.Greaterf(2, 1, "error message %s", "formatted") // a.Greaterf(float64(2), float64(1), "error message %s", "formatted") // a.Greaterf("b", "a", "error message %s", "formatted") func (a *Assertions) Greaterf(e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return Greaterf(a.t, e1, e2, msg, args...) } // HTTPBodyContains asserts that a specified handler returns a // body that contains a string. // // a.HTTPBodyContains(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky") // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPBodyContains(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return HTTPBodyContains(a.t, handler, method, url, values, str, msgAndArgs...) } // HTTPBodyContainsf asserts that a specified handler returns a // body that contains a string. // // a.HTTPBodyContainsf(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted") // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPBodyContainsf(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return HTTPBodyContainsf(a.t, handler, method, url, values, str, msg, args...) } // HTTPBodyNotContains asserts that a specified handler returns a // body that does not contain a string. // // a.HTTPBodyNotContains(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky") // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPBodyNotContains(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return HTTPBodyNotContains(a.t, handler, method, url, values, str, msgAndArgs...) } // HTTPBodyNotContainsf asserts that a specified handler returns a // body that does not contain a string. // // a.HTTPBodyNotContainsf(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted") // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPBodyNotContainsf(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return HTTPBodyNotContainsf(a.t, handler, method, url, values, str, msg, args...) } // HTTPError asserts that a specified handler returns an error status code. // // a.HTTPError(myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}} // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPError(handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return HTTPError(a.t, handler, method, url, values, msgAndArgs...) } // HTTPErrorf asserts that a specified handler returns an error status code. // // a.HTTPErrorf(myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}} // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPErrorf(handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return HTTPErrorf(a.t, handler, method, url, values, msg, args...) } // HTTPRedirect asserts that a specified handler returns a redirect status code. // // a.HTTPRedirect(myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}} // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPRedirect(handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return HTTPRedirect(a.t, handler, method, url, values, msgAndArgs...) } // HTTPRedirectf asserts that a specified handler returns a redirect status code. // // a.HTTPRedirectf(myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}} // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPRedirectf(handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return HTTPRedirectf(a.t, handler, method, url, values, msg, args...) } // HTTPStatusCode asserts that a specified handler returns a specified status code. // // a.HTTPStatusCode(myHandler, "GET", "/notImplemented", nil, 501) // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPStatusCode(handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return HTTPStatusCode(a.t, handler, method, url, values, statuscode, msgAndArgs...) } // HTTPStatusCodef asserts that a specified handler returns a specified status code. // // a.HTTPStatusCodef(myHandler, "GET", "/notImplemented", nil, 501, "error message %s", "formatted") // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPStatusCodef(handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return HTTPStatusCodef(a.t, handler, method, url, values, statuscode, msg, args...) } // HTTPSuccess asserts that a specified handler returns a success status code. // // a.HTTPSuccess(myHandler, "POST", "http://www.google.com", nil) // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPSuccess(handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return HTTPSuccess(a.t, handler, method, url, values, msgAndArgs...) } // HTTPSuccessf asserts that a specified handler returns a success status code. // // a.HTTPSuccessf(myHandler, "POST", "http://www.google.com", nil, "error message %s", "formatted") // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPSuccessf(handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return HTTPSuccessf(a.t, handler, method, url, values, msg, args...) } // Implements asserts that an object is implemented by the specified interface. // // a.Implements((*MyInterface)(nil), new(MyObject)) func (a *Assertions) Implements(interfaceObject interface{}, object interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return Implements(a.t, interfaceObject, object, msgAndArgs...) } // Implementsf asserts that an object is implemented by the specified interface. // // a.Implementsf((*MyInterface)(nil), new(MyObject), "error message %s", "formatted") func (a *Assertions) Implementsf(interfaceObject interface{}, object interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return Implementsf(a.t, interfaceObject, object, msg, args...) } // InDelta asserts that the two numerals are within delta of each other. // // a.InDelta(math.Pi, 22/7.0, 0.01) func (a *Assertions) InDelta(expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return InDelta(a.t, expected, actual, delta, msgAndArgs...) } // InDeltaMapValues is the same as InDelta, but it compares all values between two maps. Both maps must have exactly the same keys. func (a *Assertions) InDeltaMapValues(expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return InDeltaMapValues(a.t, expected, actual, delta, msgAndArgs...) } // InDeltaMapValuesf is the same as InDelta, but it compares all values between two maps. Both maps must have exactly the same keys. func (a *Assertions) InDeltaMapValuesf(expected interface{}, actual interface{}, delta float64, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return InDeltaMapValuesf(a.t, expected, actual, delta, msg, args...) } // InDeltaSlice is the same as InDelta, except it compares two slices. func (a *Assertions) InDeltaSlice(expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return InDeltaSlice(a.t, expected, actual, delta, msgAndArgs...) } // InDeltaSlicef is the same as InDelta, except it compares two slices. func (a *Assertions) InDeltaSlicef(expected interface{}, actual interface{}, delta float64, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return InDeltaSlicef(a.t, expected, actual, delta, msg, args...) } // InDeltaf asserts that the two numerals are within delta of each other. // // a.InDeltaf(math.Pi, 22/7.0, 0.01, "error message %s", "formatted") func (a *Assertions) InDeltaf(expected interface{}, actual interface{}, delta float64, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return InDeltaf(a.t, expected, actual, delta, msg, args...) } // InEpsilon asserts that expected and actual have a relative error less than epsilon func (a *Assertions) InEpsilon(expected interface{}, actual interface{}, epsilon float64, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return InEpsilon(a.t, expected, actual, epsilon, msgAndArgs...) } // InEpsilonSlice is the same as InEpsilon, except it compares each value from two slices. func (a *Assertions) InEpsilonSlice(expected interface{}, actual interface{}, epsilon float64, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return InEpsilonSlice(a.t, expected, actual, epsilon, msgAndArgs...) } // InEpsilonSlicef is the same as InEpsilon, except it compares each value from two slices. func (a *Assertions) InEpsilonSlicef(expected interface{}, actual interface{}, epsilon float64, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return InEpsilonSlicef(a.t, expected, actual, epsilon, msg, args...) } // InEpsilonf asserts that expected and actual have a relative error less than epsilon func (a *Assertions) InEpsilonf(expected interface{}, actual interface{}, epsilon float64, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return InEpsilonf(a.t, expected, actual, epsilon, msg, args...) } // IsDecreasing asserts that the collection is decreasing // // a.IsDecreasing([]int{2, 1, 0}) // a.IsDecreasing([]float{2, 1}) // a.IsDecreasing([]string{"b", "a"}) func (a *Assertions) IsDecreasing(object interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return IsDecreasing(a.t, object, msgAndArgs...) } // IsDecreasingf asserts that the collection is decreasing // // a.IsDecreasingf([]int{2, 1, 0}, "error message %s", "formatted") // a.IsDecreasingf([]float{2, 1}, "error message %s", "formatted") // a.IsDecreasingf([]string{"b", "a"}, "error message %s", "formatted") func (a *Assertions) IsDecreasingf(object interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return IsDecreasingf(a.t, object, msg, args...) } // IsIncreasing asserts that the collection is increasing // // a.IsIncreasing([]int{1, 2, 3}) // a.IsIncreasing([]float{1, 2}) // a.IsIncreasing([]string{"a", "b"}) func (a *Assertions) IsIncreasing(object interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return IsIncreasing(a.t, object, msgAndArgs...) } // IsIncreasingf asserts that the collection is increasing // // a.IsIncreasingf([]int{1, 2, 3}, "error message %s", "formatted") // a.IsIncreasingf([]float{1, 2}, "error message %s", "formatted") // a.IsIncreasingf([]string{"a", "b"}, "error message %s", "formatted") func (a *Assertions) IsIncreasingf(object interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return IsIncreasingf(a.t, object, msg, args...) } // IsNonDecreasing asserts that the collection is not decreasing // // a.IsNonDecreasing([]int{1, 1, 2}) // a.IsNonDecreasing([]float{1, 2}) // a.IsNonDecreasing([]string{"a", "b"}) func (a *Assertions) IsNonDecreasing(object interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return IsNonDecreasing(a.t, object, msgAndArgs...) } // IsNonDecreasingf asserts that the collection is not decreasing // // a.IsNonDecreasingf([]int{1, 1, 2}, "error message %s", "formatted") // a.IsNonDecreasingf([]float{1, 2}, "error message %s", "formatted") // a.IsNonDecreasingf([]string{"a", "b"}, "error message %s", "formatted") func (a *Assertions) IsNonDecreasingf(object interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return IsNonDecreasingf(a.t, object, msg, args...) } // IsNonIncreasing asserts that the collection is not increasing // // a.IsNonIncreasing([]int{2, 1, 1}) // a.IsNonIncreasing([]float{2, 1}) // a.IsNonIncreasing([]string{"b", "a"}) func (a *Assertions) IsNonIncreasing(object interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return IsNonIncreasing(a.t, object, msgAndArgs...) } // IsNonIncreasingf asserts that the collection is not increasing // // a.IsNonIncreasingf([]int{2, 1, 1}, "error message %s", "formatted") // a.IsNonIncreasingf([]float{2, 1}, "error message %s", "formatted") // a.IsNonIncreasingf([]string{"b", "a"}, "error message %s", "formatted") func (a *Assertions) IsNonIncreasingf(object interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return IsNonIncreasingf(a.t, object, msg, args...) } // IsNotType asserts that the specified objects are not of the same type. // // a.IsNotType(&NotMyStruct{}, &MyStruct{}) func (a *Assertions) IsNotType(theType interface{}, object interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return IsNotType(a.t, theType, object, msgAndArgs...) } // IsNotTypef asserts that the specified objects are not of the same type. // // a.IsNotTypef(&NotMyStruct{}, &MyStruct{}, "error message %s", "formatted") func (a *Assertions) IsNotTypef(theType interface{}, object interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return IsNotTypef(a.t, theType, object, msg, args...) } // IsType asserts that the specified objects are of the same type. // // a.IsType(&MyStruct{}, &MyStruct{}) func (a *Assertions) IsType(expectedType interface{}, object interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return IsType(a.t, expectedType, object, msgAndArgs...) } // IsTypef asserts that the specified objects are of the same type. // // a.IsTypef(&MyStruct{}, &MyStruct{}, "error message %s", "formatted") func (a *Assertions) IsTypef(expectedType interface{}, object interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return IsTypef(a.t, expectedType, object, msg, args...) } // JSONEq asserts that two JSON strings are equivalent. // // a.JSONEq(`{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`) func (a *Assertions) JSONEq(expected string, actual string, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return JSONEq(a.t, expected, actual, msgAndArgs...) } // JSONEqf asserts that two JSON strings are equivalent. // // a.JSONEqf(`{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`, "error message %s", "formatted") func (a *Assertions) JSONEqf(expected string, actual string, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return JSONEqf(a.t, expected, actual, msg, args...) } // Len asserts that the specified object has specific length. // Len also fails if the object has a type that len() not accept. // // a.Len(mySlice, 3) func (a *Assertions) Len(object interface{}, length int, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return Len(a.t, object, length, msgAndArgs...) } // Lenf asserts that the specified object has specific length. // Lenf also fails if the object has a type that len() not accept. // // a.Lenf(mySlice, 3, "error message %s", "formatted") func (a *Assertions) Lenf(object interface{}, length int, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return Lenf(a.t, object, length, msg, args...) } // Less asserts that the first element is less than the second // // a.Less(1, 2) // a.Less(float64(1), float64(2)) // a.Less("a", "b") func (a *Assertions) Less(e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return Less(a.t, e1, e2, msgAndArgs...) } // LessOrEqual asserts that the first element is less than or equal to the second // // a.LessOrEqual(1, 2) // a.LessOrEqual(2, 2) // a.LessOrEqual("a", "b") // a.LessOrEqual("b", "b") func (a *Assertions) LessOrEqual(e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return LessOrEqual(a.t, e1, e2, msgAndArgs...) } // LessOrEqualf asserts that the first element is less than or equal to the second // // a.LessOrEqualf(1, 2, "error message %s", "formatted") // a.LessOrEqualf(2, 2, "error message %s", "formatted") // a.LessOrEqualf("a", "b", "error message %s", "formatted") // a.LessOrEqualf("b", "b", "error message %s", "formatted") func (a *Assertions) LessOrEqualf(e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return LessOrEqualf(a.t, e1, e2, msg, args...) } // Lessf asserts that the first element is less than the second // // a.Lessf(1, 2, "error message %s", "formatted") // a.Lessf(float64(1), float64(2), "error message %s", "formatted") // a.Lessf("a", "b", "error message %s", "formatted") func (a *Assertions) Lessf(e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return Lessf(a.t, e1, e2, msg, args...) } // Negative asserts that the specified element is negative // // a.Negative(-1) // a.Negative(-1.23) func (a *Assertions) Negative(e interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return Negative(a.t, e, msgAndArgs...) } // Negativef asserts that the specified element is negative // // a.Negativef(-1, "error message %s", "formatted") // a.Negativef(-1.23, "error message %s", "formatted") func (a *Assertions) Negativef(e interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return Negativef(a.t, e, msg, args...) } // Never asserts that the given condition doesn't satisfy in waitFor time, // periodically checking the target function each tick. // // a.Never(func() bool { return false; }, time.Second, 10*time.Millisecond) func (a *Assertions) Never(condition func() bool, waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return Never(a.t, condition, waitFor, tick, msgAndArgs...) } // Neverf asserts that the given condition doesn't satisfy in waitFor time, // periodically checking the target function each tick. // // a.Neverf(func() bool { return false; }, time.Second, 10*time.Millisecond, "error message %s", "formatted") func (a *Assertions) Neverf(condition func() bool, waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return Neverf(a.t, condition, waitFor, tick, msg, args...) } // Nil asserts that the specified object is nil. // // a.Nil(err) func (a *Assertions) Nil(object interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return Nil(a.t, object, msgAndArgs...) } // Nilf asserts that the specified object is nil. // // a.Nilf(err, "error message %s", "formatted") func (a *Assertions) Nilf(object interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return Nilf(a.t, object, msg, args...) } // NoDirExists checks whether a directory does not exist in the given path. // It fails if the path points to an existing _directory_ only. func (a *Assertions) NoDirExists(path string, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return NoDirExists(a.t, path, msgAndArgs...) } // NoDirExistsf checks whether a directory does not exist in the given path. // It fails if the path points to an existing _directory_ only. func (a *Assertions) NoDirExistsf(path string, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return NoDirExistsf(a.t, path, msg, args...) } // NoError asserts that a function returned no error (i.e. `nil`). // // actualObj, err := SomeFunction() // if a.NoError(err) { // assert.Equal(t, expectedObj, actualObj) // } func (a *Assertions) NoError(err error, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return NoError(a.t, err, msgAndArgs...) } // NoErrorf asserts that a function returned no error (i.e. `nil`). // // actualObj, err := SomeFunction() // if a.NoErrorf(err, "error message %s", "formatted") { // assert.Equal(t, expectedObj, actualObj) // } func (a *Assertions) NoErrorf(err error, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return NoErrorf(a.t, err, msg, args...) } // NoFileExists checks whether a file does not exist in a given path. It fails // if the path points to an existing _file_ only. func (a *Assertions) NoFileExists(path string, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return NoFileExists(a.t, path, msgAndArgs...) } // NoFileExistsf checks whether a file does not exist in a given path. It fails // if the path points to an existing _file_ only. func (a *Assertions) NoFileExistsf(path string, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return NoFileExistsf(a.t, path, msg, args...) } // NotContains asserts that the specified string, list(array, slice...) or map does NOT contain the // specified substring or element. // // a.NotContains("Hello World", "Earth") // a.NotContains(["Hello", "World"], "Earth") // a.NotContains({"Hello": "World"}, "Earth") func (a *Assertions) NotContains(s interface{}, contains interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return NotContains(a.t, s, contains, msgAndArgs...) } // NotContainsf asserts that the specified string, list(array, slice...) or map does NOT contain the // specified substring or element. // // a.NotContainsf("Hello World", "Earth", "error message %s", "formatted") // a.NotContainsf(["Hello", "World"], "Earth", "error message %s", "formatted") // a.NotContainsf({"Hello": "World"}, "Earth", "error message %s", "formatted") func (a *Assertions) NotContainsf(s interface{}, contains interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return NotContainsf(a.t, s, contains, msg, args...) } // NotElementsMatch asserts that the specified listA(array, slice...) is NOT equal to specified // listB(array, slice...) ignoring the order of the elements. If there are duplicate elements, // the number of appearances of each of them in both lists should not match. // This is an inverse of ElementsMatch. // // a.NotElementsMatch([1, 1, 2, 3], [1, 1, 2, 3]) -> false // // a.NotElementsMatch([1, 1, 2, 3], [1, 2, 3]) -> true // // a.NotElementsMatch([1, 2, 3], [1, 2, 4]) -> true func (a *Assertions) NotElementsMatch(listA interface{}, listB interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return NotElementsMatch(a.t, listA, listB, msgAndArgs...) } // NotElementsMatchf asserts that the specified listA(array, slice...) is NOT equal to specified // listB(array, slice...) ignoring the order of the elements. If there are duplicate elements, // the number of appearances of each of them in both lists should not match. // This is an inverse of ElementsMatch. // // a.NotElementsMatchf([1, 1, 2, 3], [1, 1, 2, 3], "error message %s", "formatted") -> false // // a.NotElementsMatchf([1, 1, 2, 3], [1, 2, 3], "error message %s", "formatted") -> true // // a.NotElementsMatchf([1, 2, 3], [1, 2, 4], "error message %s", "formatted") -> true func (a *Assertions) NotElementsMatchf(listA interface{}, listB interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return NotElementsMatchf(a.t, listA, listB, msg, args...) } // NotEmpty asserts that the specified object is NOT [Empty]. // // if a.NotEmpty(obj) { // assert.Equal(t, "two", obj[1]) // } func (a *Assertions) NotEmpty(object interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return NotEmpty(a.t, object, msgAndArgs...) } // NotEmptyf asserts that the specified object is NOT [Empty]. // // if a.NotEmptyf(obj, "error message %s", "formatted") { // assert.Equal(t, "two", obj[1]) // } func (a *Assertions) NotEmptyf(object interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return NotEmptyf(a.t, object, msg, args...) } // NotEqual asserts that the specified values are NOT equal. // // a.NotEqual(obj1, obj2) // // Pointer variable equality is determined based on the equality of the // referenced values (as opposed to the memory addresses). func (a *Assertions) NotEqual(expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return NotEqual(a.t, expected, actual, msgAndArgs...) } // NotEqualValues asserts that two objects are not equal even when converted to the same type // // a.NotEqualValues(obj1, obj2) func (a *Assertions) NotEqualValues(expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return NotEqualValues(a.t, expected, actual, msgAndArgs...) } // NotEqualValuesf asserts that two objects are not equal even when converted to the same type // // a.NotEqualValuesf(obj1, obj2, "error message %s", "formatted") func (a *Assertions) NotEqualValuesf(expected interface{}, actual interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return NotEqualValuesf(a.t, expected, actual, msg, args...) } // NotEqualf asserts that the specified values are NOT equal. // // a.NotEqualf(obj1, obj2, "error message %s", "formatted") // // Pointer variable equality is determined based on the equality of the // referenced values (as opposed to the memory addresses). func (a *Assertions) NotEqualf(expected interface{}, actual interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return NotEqualf(a.t, expected, actual, msg, args...) } // NotErrorAs asserts that none of the errors in err's chain matches target, // but if so, sets target to that error value. func (a *Assertions) NotErrorAs(err error, target interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return NotErrorAs(a.t, err, target, msgAndArgs...) } // NotErrorAsf asserts that none of the errors in err's chain matches target, // but if so, sets target to that error value. func (a *Assertions) NotErrorAsf(err error, target interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return NotErrorAsf(a.t, err, target, msg, args...) } // NotErrorIs asserts that none of the errors in err's chain matches target. // This is a wrapper for errors.Is. func (a *Assertions) NotErrorIs(err error, target error, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return NotErrorIs(a.t, err, target, msgAndArgs...) } // NotErrorIsf asserts that none of the errors in err's chain matches target. // This is a wrapper for errors.Is. func (a *Assertions) NotErrorIsf(err error, target error, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return NotErrorIsf(a.t, err, target, msg, args...) } // NotImplements asserts that an object does not implement the specified interface. // // a.NotImplements((*MyInterface)(nil), new(MyObject)) func (a *Assertions) NotImplements(interfaceObject interface{}, object interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return NotImplements(a.t, interfaceObject, object, msgAndArgs...) } // NotImplementsf asserts that an object does not implement the specified interface. // // a.NotImplementsf((*MyInterface)(nil), new(MyObject), "error message %s", "formatted") func (a *Assertions) NotImplementsf(interfaceObject interface{}, object interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return NotImplementsf(a.t, interfaceObject, object, msg, args...) } // NotNil asserts that the specified object is not nil. // // a.NotNil(err) func (a *Assertions) NotNil(object interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return NotNil(a.t, object, msgAndArgs...) } // NotNilf asserts that the specified object is not nil. // // a.NotNilf(err, "error message %s", "formatted") func (a *Assertions) NotNilf(object interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return NotNilf(a.t, object, msg, args...) } // NotPanics asserts that the code inside the specified PanicTestFunc does NOT panic. // // a.NotPanics(func(){ RemainCalm() }) func (a *Assertions) NotPanics(f PanicTestFunc, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return NotPanics(a.t, f, msgAndArgs...) } // NotPanicsf asserts that the code inside the specified PanicTestFunc does NOT panic. // // a.NotPanicsf(func(){ RemainCalm() }, "error message %s", "formatted") func (a *Assertions) NotPanicsf(f PanicTestFunc, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return NotPanicsf(a.t, f, msg, args...) } // NotRegexp asserts that a specified regexp does not match a string. // // a.NotRegexp(regexp.MustCompile("starts"), "it's starting") // a.NotRegexp("^start", "it's not starting") func (a *Assertions) NotRegexp(rx interface{}, str interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return NotRegexp(a.t, rx, str, msgAndArgs...) } // NotRegexpf asserts that a specified regexp does not match a string. // // a.NotRegexpf(regexp.MustCompile("starts"), "it's starting", "error message %s", "formatted") // a.NotRegexpf("^start", "it's not starting", "error message %s", "formatted") func (a *Assertions) NotRegexpf(rx interface{}, str interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return NotRegexpf(a.t, rx, str, msg, args...) } // NotSame asserts that two pointers do not reference the same object. // // a.NotSame(ptr1, ptr2) // // Both arguments must be pointer variables. Pointer variable sameness is // determined based on the equality of both type and value. func (a *Assertions) NotSame(expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return NotSame(a.t, expected, actual, msgAndArgs...) } // NotSamef asserts that two pointers do not reference the same object. // // a.NotSamef(ptr1, ptr2, "error message %s", "formatted") // // Both arguments must be pointer variables. Pointer variable sameness is // determined based on the equality of both type and value. func (a *Assertions) NotSamef(expected interface{}, actual interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return NotSamef(a.t, expected, actual, msg, args...) } // NotSubset asserts that the list (array, slice, or map) does NOT contain all // elements given in the subset (array, slice, or map). // Map elements are key-value pairs unless compared with an array or slice where // only the map key is evaluated. // // a.NotSubset([1, 3, 4], [1, 2]) // a.NotSubset({"x": 1, "y": 2}, {"z": 3}) // a.NotSubset([1, 3, 4], {1: "one", 2: "two"}) // a.NotSubset({"x": 1, "y": 2}, ["z"]) func (a *Assertions) NotSubset(list interface{}, subset interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return NotSubset(a.t, list, subset, msgAndArgs...) } // NotSubsetf asserts that the list (array, slice, or map) does NOT contain all // elements given in the subset (array, slice, or map). // Map elements are key-value pairs unless compared with an array or slice where // only the map key is evaluated. // // a.NotSubsetf([1, 3, 4], [1, 2], "error message %s", "formatted") // a.NotSubsetf({"x": 1, "y": 2}, {"z": 3}, "error message %s", "formatted") // a.NotSubsetf([1, 3, 4], {1: "one", 2: "two"}, "error message %s", "formatted") // a.NotSubsetf({"x": 1, "y": 2}, ["z"], "error message %s", "formatted") func (a *Assertions) NotSubsetf(list interface{}, subset interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return NotSubsetf(a.t, list, subset, msg, args...) } // NotZero asserts that i is not the zero value for its type. func (a *Assertions) NotZero(i interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return NotZero(a.t, i, msgAndArgs...) } // NotZerof asserts that i is not the zero value for its type. func (a *Assertions) NotZerof(i interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return NotZerof(a.t, i, msg, args...) } // Panics asserts that the code inside the specified PanicTestFunc panics. // // a.Panics(func(){ GoCrazy() }) func (a *Assertions) Panics(f PanicTestFunc, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return Panics(a.t, f, msgAndArgs...) } // PanicsWithError asserts that the code inside the specified PanicTestFunc // panics, and that the recovered panic value is an error that satisfies the // EqualError comparison. // // a.PanicsWithError("crazy error", func(){ GoCrazy() }) func (a *Assertions) PanicsWithError(errString string, f PanicTestFunc, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return PanicsWithError(a.t, errString, f, msgAndArgs...) } // PanicsWithErrorf asserts that the code inside the specified PanicTestFunc // panics, and that the recovered panic value is an error that satisfies the // EqualError comparison. // // a.PanicsWithErrorf("crazy error", func(){ GoCrazy() }, "error message %s", "formatted") func (a *Assertions) PanicsWithErrorf(errString string, f PanicTestFunc, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return PanicsWithErrorf(a.t, errString, f, msg, args...) } // PanicsWithValue asserts that the code inside the specified PanicTestFunc panics, and that // the recovered panic value equals the expected panic value. // // a.PanicsWithValue("crazy error", func(){ GoCrazy() }) func (a *Assertions) PanicsWithValue(expected interface{}, f PanicTestFunc, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return PanicsWithValue(a.t, expected, f, msgAndArgs...) } // PanicsWithValuef asserts that the code inside the specified PanicTestFunc panics, and that // the recovered panic value equals the expected panic value. // // a.PanicsWithValuef("crazy error", func(){ GoCrazy() }, "error message %s", "formatted") func (a *Assertions) PanicsWithValuef(expected interface{}, f PanicTestFunc, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return PanicsWithValuef(a.t, expected, f, msg, args...) } // Panicsf asserts that the code inside the specified PanicTestFunc panics. // // a.Panicsf(func(){ GoCrazy() }, "error message %s", "formatted") func (a *Assertions) Panicsf(f PanicTestFunc, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return Panicsf(a.t, f, msg, args...) } // Positive asserts that the specified element is positive // // a.Positive(1) // a.Positive(1.23) func (a *Assertions) Positive(e interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return Positive(a.t, e, msgAndArgs...) } // Positivef asserts that the specified element is positive // // a.Positivef(1, "error message %s", "formatted") // a.Positivef(1.23, "error message %s", "formatted") func (a *Assertions) Positivef(e interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return Positivef(a.t, e, msg, args...) } // Regexp asserts that a specified regexp matches a string. // // a.Regexp(regexp.MustCompile("start"), "it's starting") // a.Regexp("start...$", "it's not starting") func (a *Assertions) Regexp(rx interface{}, str interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return Regexp(a.t, rx, str, msgAndArgs...) } // Regexpf asserts that a specified regexp matches a string. // // a.Regexpf(regexp.MustCompile("start"), "it's starting", "error message %s", "formatted") // a.Regexpf("start...$", "it's not starting", "error message %s", "formatted") func (a *Assertions) Regexpf(rx interface{}, str interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return Regexpf(a.t, rx, str, msg, args...) } // Same asserts that two pointers reference the same object. // // a.Same(ptr1, ptr2) // // Both arguments must be pointer variables. Pointer variable sameness is // determined based on the equality of both type and value. func (a *Assertions) Same(expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return Same(a.t, expected, actual, msgAndArgs...) } // Samef asserts that two pointers reference the same object. // // a.Samef(ptr1, ptr2, "error message %s", "formatted") // // Both arguments must be pointer variables. Pointer variable sameness is // determined based on the equality of both type and value. func (a *Assertions) Samef(expected interface{}, actual interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return Samef(a.t, expected, actual, msg, args...) } // Subset asserts that the list (array, slice, or map) contains all elements // given in the subset (array, slice, or map). // Map elements are key-value pairs unless compared with an array or slice where // only the map key is evaluated. // // a.Subset([1, 2, 3], [1, 2]) // a.Subset({"x": 1, "y": 2}, {"x": 1}) // a.Subset([1, 2, 3], {1: "one", 2: "two"}) // a.Subset({"x": 1, "y": 2}, ["x"]) func (a *Assertions) Subset(list interface{}, subset interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return Subset(a.t, list, subset, msgAndArgs...) } // Subsetf asserts that the list (array, slice, or map) contains all elements // given in the subset (array, slice, or map). // Map elements are key-value pairs unless compared with an array or slice where // only the map key is evaluated. // // a.Subsetf([1, 2, 3], [1, 2], "error message %s", "formatted") // a.Subsetf({"x": 1, "y": 2}, {"x": 1}, "error message %s", "formatted") // a.Subsetf([1, 2, 3], {1: "one", 2: "two"}, "error message %s", "formatted") // a.Subsetf({"x": 1, "y": 2}, ["x"], "error message %s", "formatted") func (a *Assertions) Subsetf(list interface{}, subset interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return Subsetf(a.t, list, subset, msg, args...) } // True asserts that the specified value is true. // // a.True(myBool) func (a *Assertions) True(value bool, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return True(a.t, value, msgAndArgs...) } // Truef asserts that the specified value is true. // // a.Truef(myBool, "error message %s", "formatted") func (a *Assertions) Truef(value bool, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return Truef(a.t, value, msg, args...) } // WithinDuration asserts that the two times are within duration delta of each other. // // a.WithinDuration(time.Now(), time.Now(), 10*time.Second) func (a *Assertions) WithinDuration(expected time.Time, actual time.Time, delta time.Duration, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return WithinDuration(a.t, expected, actual, delta, msgAndArgs...) } // WithinDurationf asserts that the two times are within duration delta of each other. // // a.WithinDurationf(time.Now(), time.Now(), 10*time.Second, "error message %s", "formatted") func (a *Assertions) WithinDurationf(expected time.Time, actual time.Time, delta time.Duration, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return WithinDurationf(a.t, expected, actual, delta, msg, args...) } // WithinRange asserts that a time is within a time range (inclusive). // // a.WithinRange(time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second)) func (a *Assertions) WithinRange(actual time.Time, start time.Time, end time.Time, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return WithinRange(a.t, actual, start, end, msgAndArgs...) } // WithinRangef asserts that a time is within a time range (inclusive). // // a.WithinRangef(time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second), "error message %s", "formatted") func (a *Assertions) WithinRangef(actual time.Time, start time.Time, end time.Time, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return WithinRangef(a.t, actual, start, end, msg, args...) } // YAMLEq asserts that two YAML strings are equivalent. func (a *Assertions) YAMLEq(expected string, actual string, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return YAMLEq(a.t, expected, actual, msgAndArgs...) } // YAMLEqf asserts that two YAML strings are equivalent. func (a *Assertions) YAMLEqf(expected string, actual string, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return YAMLEqf(a.t, expected, actual, msg, args...) } // Zero asserts that i is the zero value for its type. func (a *Assertions) Zero(i interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return Zero(a.t, i, msgAndArgs...) } // Zerof asserts that i is the zero value for its type. func (a *Assertions) Zerof(i interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return Zerof(a.t, i, msg, args...) } ================================================ FILE: vendor/github.com/stretchr/testify/assert/assertion_forward.go.tmpl ================================================ {{.CommentWithoutT "a"}} func (a *Assertions) {{.DocInfo.Name}}({{.Params}}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() } return {{.DocInfo.Name}}(a.t, {{.ForwardedParams}}) } ================================================ FILE: vendor/github.com/stretchr/testify/assert/assertion_order.go ================================================ package assert import ( "fmt" "reflect" ) // isOrdered checks that collection contains orderable elements. func isOrdered(t TestingT, object interface{}, allowedComparesResults []compareResult, failMessage string, msgAndArgs ...interface{}) bool { objKind := reflect.TypeOf(object).Kind() if objKind != reflect.Slice && objKind != reflect.Array { return false } objValue := reflect.ValueOf(object) objLen := objValue.Len() if objLen <= 1 { return true } value := objValue.Index(0) valueInterface := value.Interface() firstValueKind := value.Kind() for i := 1; i < objLen; i++ { prevValue := value prevValueInterface := valueInterface value = objValue.Index(i) valueInterface = value.Interface() compareResult, isComparable := compare(prevValueInterface, valueInterface, firstValueKind) if !isComparable { return Fail(t, fmt.Sprintf(`Can not compare type "%T" and "%T"`, value, prevValue), msgAndArgs...) } if !containsValue(allowedComparesResults, compareResult) { return Fail(t, fmt.Sprintf(failMessage, prevValue, value), msgAndArgs...) } } return true } // IsIncreasing asserts that the collection is increasing // // assert.IsIncreasing(t, []int{1, 2, 3}) // assert.IsIncreasing(t, []float{1, 2}) // assert.IsIncreasing(t, []string{"a", "b"}) func IsIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { return isOrdered(t, object, []compareResult{compareLess}, "\"%v\" is not less than \"%v\"", msgAndArgs...) } // IsNonIncreasing asserts that the collection is not increasing // // assert.IsNonIncreasing(t, []int{2, 1, 1}) // assert.IsNonIncreasing(t, []float{2, 1}) // assert.IsNonIncreasing(t, []string{"b", "a"}) func IsNonIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { return isOrdered(t, object, []compareResult{compareEqual, compareGreater}, "\"%v\" is not greater than or equal to \"%v\"", msgAndArgs...) } // IsDecreasing asserts that the collection is decreasing // // assert.IsDecreasing(t, []int{2, 1, 0}) // assert.IsDecreasing(t, []float{2, 1}) // assert.IsDecreasing(t, []string{"b", "a"}) func IsDecreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { return isOrdered(t, object, []compareResult{compareGreater}, "\"%v\" is not greater than \"%v\"", msgAndArgs...) } // IsNonDecreasing asserts that the collection is not decreasing // // assert.IsNonDecreasing(t, []int{1, 1, 2}) // assert.IsNonDecreasing(t, []float{1, 2}) // assert.IsNonDecreasing(t, []string{"a", "b"}) func IsNonDecreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { return isOrdered(t, object, []compareResult{compareLess, compareEqual}, "\"%v\" is not less than or equal to \"%v\"", msgAndArgs...) } ================================================ FILE: vendor/github.com/stretchr/testify/assert/assertions.go ================================================ package assert import ( "bufio" "bytes" "encoding/json" "errors" "fmt" "math" "os" "reflect" "regexp" "runtime" "runtime/debug" "strings" "time" "unicode" "unicode/utf8" "github.com/davecgh/go-spew/spew" "github.com/pmezard/go-difflib/difflib" // Wrapper around gopkg.in/yaml.v3 "github.com/stretchr/testify/assert/yaml" ) //go:generate sh -c "cd ../_codegen && go build && cd - && ../_codegen/_codegen -output-package=assert -template=assertion_format.go.tmpl" // TestingT is an interface wrapper around *testing.T type TestingT interface { Errorf(format string, args ...interface{}) } // ComparisonAssertionFunc is a common function prototype when comparing two values. Can be useful // for table driven tests. type ComparisonAssertionFunc func(TestingT, interface{}, interface{}, ...interface{}) bool // ValueAssertionFunc is a common function prototype when validating a single value. Can be useful // for table driven tests. type ValueAssertionFunc func(TestingT, interface{}, ...interface{}) bool // BoolAssertionFunc is a common function prototype when validating a bool value. Can be useful // for table driven tests. type BoolAssertionFunc func(TestingT, bool, ...interface{}) bool // ErrorAssertionFunc is a common function prototype when validating an error value. Can be useful // for table driven tests. type ErrorAssertionFunc func(TestingT, error, ...interface{}) bool // PanicAssertionFunc is a common function prototype when validating a panic value. Can be useful // for table driven tests. type PanicAssertionFunc = func(t TestingT, f PanicTestFunc, msgAndArgs ...interface{}) bool // Comparison is a custom function that returns true on success and false on failure type Comparison func() (success bool) /* Helper functions */ // ObjectsAreEqual determines if two objects are considered equal. // // This function does no assertion of any kind. func ObjectsAreEqual(expected, actual interface{}) bool { if expected == nil || actual == nil { return expected == actual } exp, ok := expected.([]byte) if !ok { return reflect.DeepEqual(expected, actual) } act, ok := actual.([]byte) if !ok { return false } if exp == nil || act == nil { return exp == nil && act == nil } return bytes.Equal(exp, act) } // copyExportedFields iterates downward through nested data structures and creates a copy // that only contains the exported struct fields. func copyExportedFields(expected interface{}) interface{} { if isNil(expected) { return expected } expectedType := reflect.TypeOf(expected) expectedKind := expectedType.Kind() expectedValue := reflect.ValueOf(expected) switch expectedKind { case reflect.Struct: result := reflect.New(expectedType).Elem() for i := 0; i < expectedType.NumField(); i++ { field := expectedType.Field(i) isExported := field.IsExported() if isExported { fieldValue := expectedValue.Field(i) if isNil(fieldValue) || isNil(fieldValue.Interface()) { continue } newValue := copyExportedFields(fieldValue.Interface()) result.Field(i).Set(reflect.ValueOf(newValue)) } } return result.Interface() case reflect.Ptr: result := reflect.New(expectedType.Elem()) unexportedRemoved := copyExportedFields(expectedValue.Elem().Interface()) result.Elem().Set(reflect.ValueOf(unexportedRemoved)) return result.Interface() case reflect.Array, reflect.Slice: var result reflect.Value if expectedKind == reflect.Array { result = reflect.New(reflect.ArrayOf(expectedValue.Len(), expectedType.Elem())).Elem() } else { result = reflect.MakeSlice(expectedType, expectedValue.Len(), expectedValue.Len()) } for i := 0; i < expectedValue.Len(); i++ { index := expectedValue.Index(i) if isNil(index) { continue } unexportedRemoved := copyExportedFields(index.Interface()) result.Index(i).Set(reflect.ValueOf(unexportedRemoved)) } return result.Interface() case reflect.Map: result := reflect.MakeMap(expectedType) for _, k := range expectedValue.MapKeys() { index := expectedValue.MapIndex(k) unexportedRemoved := copyExportedFields(index.Interface()) result.SetMapIndex(k, reflect.ValueOf(unexportedRemoved)) } return result.Interface() default: return expected } } // ObjectsExportedFieldsAreEqual determines if the exported (public) fields of two objects are // considered equal. This comparison of only exported fields is applied recursively to nested data // structures. // // This function does no assertion of any kind. // // Deprecated: Use [EqualExportedValues] instead. func ObjectsExportedFieldsAreEqual(expected, actual interface{}) bool { expectedCleaned := copyExportedFields(expected) actualCleaned := copyExportedFields(actual) return ObjectsAreEqualValues(expectedCleaned, actualCleaned) } // ObjectsAreEqualValues gets whether two objects are equal, or if their // values are equal. func ObjectsAreEqualValues(expected, actual interface{}) bool { if ObjectsAreEqual(expected, actual) { return true } expectedValue := reflect.ValueOf(expected) actualValue := reflect.ValueOf(actual) if !expectedValue.IsValid() || !actualValue.IsValid() { return false } expectedType := expectedValue.Type() actualType := actualValue.Type() if !expectedType.ConvertibleTo(actualType) { return false } if !isNumericType(expectedType) || !isNumericType(actualType) { // Attempt comparison after type conversion return reflect.DeepEqual( expectedValue.Convert(actualType).Interface(), actual, ) } // If BOTH values are numeric, there are chances of false positives due // to overflow or underflow. So, we need to make sure to always convert // the smaller type to a larger type before comparing. if expectedType.Size() >= actualType.Size() { return actualValue.Convert(expectedType).Interface() == expected } return expectedValue.Convert(actualType).Interface() == actual } // isNumericType returns true if the type is one of: // int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64, // float32, float64, complex64, complex128 func isNumericType(t reflect.Type) bool { return t.Kind() >= reflect.Int && t.Kind() <= reflect.Complex128 } /* CallerInfo is necessary because the assert functions use the testing object internally, causing it to print the file:line of the assert method, rather than where the problem actually occurred in calling code.*/ // CallerInfo returns an array of strings containing the file and line number // of each stack frame leading from the current test to the assert call that // failed. func CallerInfo() []string { var pc uintptr var file string var line int var name string const stackFrameBufferSize = 10 pcs := make([]uintptr, stackFrameBufferSize) callers := []string{} offset := 1 for { n := runtime.Callers(offset, pcs) if n == 0 { break } frames := runtime.CallersFrames(pcs[:n]) for { frame, more := frames.Next() pc = frame.PC file = frame.File line = frame.Line // This is a huge edge case, but it will panic if this is the case, see #180 if file == "" { break } f := runtime.FuncForPC(pc) if f == nil { break } name = f.Name() // testing.tRunner is the standard library function that calls // tests. Subtests are called directly by tRunner, without going through // the Test/Benchmark/Example function that contains the t.Run calls, so // with subtests we should break when we hit tRunner, without adding it // to the list of callers. if name == "testing.tRunner" { break } parts := strings.Split(file, "/") if len(parts) > 1 { filename := parts[len(parts)-1] dir := parts[len(parts)-2] if (dir != "assert" && dir != "mock" && dir != "require") || filename == "mock_test.go" { callers = append(callers, fmt.Sprintf("%s:%d", file, line)) } } // Drop the package dotPos := strings.LastIndexByte(name, '.') name = name[dotPos+1:] if isTest(name, "Test") || isTest(name, "Benchmark") || isTest(name, "Example") { break } if !more { break } } // Next batch offset += cap(pcs) } return callers } // Stolen from the `go test` tool. // isTest tells whether name looks like a test (or benchmark, according to prefix). // It is a Test (say) if there is a character after Test that is not a lower-case letter. // We don't want TesticularCancer. func isTest(name, prefix string) bool { if !strings.HasPrefix(name, prefix) { return false } if len(name) == len(prefix) { // "Test" is ok return true } r, _ := utf8.DecodeRuneInString(name[len(prefix):]) return !unicode.IsLower(r) } func messageFromMsgAndArgs(msgAndArgs ...interface{}) string { if len(msgAndArgs) == 0 || msgAndArgs == nil { return "" } if len(msgAndArgs) == 1 { msg := msgAndArgs[0] if msgAsStr, ok := msg.(string); ok { return msgAsStr } return fmt.Sprintf("%+v", msg) } if len(msgAndArgs) > 1 { return fmt.Sprintf(msgAndArgs[0].(string), msgAndArgs[1:]...) } return "" } // Aligns the provided message so that all lines after the first line start at the same location as the first line. // Assumes that the first line starts at the correct location (after carriage return, tab, label, spacer and tab). // The longestLabelLen parameter specifies the length of the longest label in the output (required because this is the // basis on which the alignment occurs). func indentMessageLines(message string, longestLabelLen int) string { outBuf := new(bytes.Buffer) for i, scanner := 0, bufio.NewScanner(strings.NewReader(message)); scanner.Scan(); i++ { // no need to align first line because it starts at the correct location (after the label) if i != 0 { // append alignLen+1 spaces to align with "{{longestLabel}}:" before adding tab outBuf.WriteString("\n\t" + strings.Repeat(" ", longestLabelLen+1) + "\t") } outBuf.WriteString(scanner.Text()) } return outBuf.String() } type failNower interface { FailNow() } // FailNow fails test func FailNow(t TestingT, failureMessage string, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } Fail(t, failureMessage, msgAndArgs...) // We cannot extend TestingT with FailNow() and // maintain backwards compatibility, so we fallback // to panicking when FailNow is not available in // TestingT. // See issue #263 if t, ok := t.(failNower); ok { t.FailNow() } else { panic("test failed and t is missing `FailNow()`") } return false } // Fail reports a failure through func Fail(t TestingT, failureMessage string, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } content := []labeledContent{ {"Error Trace", strings.Join(CallerInfo(), "\n\t\t\t")}, {"Error", failureMessage}, } // Add test name if the Go version supports it if n, ok := t.(interface { Name() string }); ok { content = append(content, labeledContent{"Test", n.Name()}) } message := messageFromMsgAndArgs(msgAndArgs...) if len(message) > 0 { content = append(content, labeledContent{"Messages", message}) } t.Errorf("\n%s", ""+labeledOutput(content...)) return false } type labeledContent struct { label string content string } // labeledOutput returns a string consisting of the provided labeledContent. Each labeled output is appended in the following manner: // // \t{{label}}:{{align_spaces}}\t{{content}}\n // // The initial carriage return is required to undo/erase any padding added by testing.T.Errorf. The "\t{{label}}:" is for the label. // If a label is shorter than the longest label provided, padding spaces are added to make all the labels match in length. Once this // alignment is achieved, "\t{{content}}\n" is added for the output. // // If the content of the labeledOutput contains line breaks, the subsequent lines are aligned so that they start at the same location as the first line. func labeledOutput(content ...labeledContent) string { longestLabel := 0 for _, v := range content { if len(v.label) > longestLabel { longestLabel = len(v.label) } } var output string for _, v := range content { output += "\t" + v.label + ":" + strings.Repeat(" ", longestLabel-len(v.label)) + "\t" + indentMessageLines(v.content, longestLabel) + "\n" } return output } // Implements asserts that an object is implemented by the specified interface. // // assert.Implements(t, (*MyInterface)(nil), new(MyObject)) func Implements(t TestingT, interfaceObject interface{}, object interface{}, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } interfaceType := reflect.TypeOf(interfaceObject).Elem() if object == nil { return Fail(t, fmt.Sprintf("Cannot check if nil implements %v", interfaceType), msgAndArgs...) } if !reflect.TypeOf(object).Implements(interfaceType) { return Fail(t, fmt.Sprintf("%T must implement %v", object, interfaceType), msgAndArgs...) } return true } // NotImplements asserts that an object does not implement the specified interface. // // assert.NotImplements(t, (*MyInterface)(nil), new(MyObject)) func NotImplements(t TestingT, interfaceObject interface{}, object interface{}, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } interfaceType := reflect.TypeOf(interfaceObject).Elem() if object == nil { return Fail(t, fmt.Sprintf("Cannot check if nil does not implement %v", interfaceType), msgAndArgs...) } if reflect.TypeOf(object).Implements(interfaceType) { return Fail(t, fmt.Sprintf("%T implements %v", object, interfaceType), msgAndArgs...) } return true } func isType(expectedType, object interface{}) bool { return ObjectsAreEqual(reflect.TypeOf(object), reflect.TypeOf(expectedType)) } // IsType asserts that the specified objects are of the same type. // // assert.IsType(t, &MyStruct{}, &MyStruct{}) func IsType(t TestingT, expectedType, object interface{}, msgAndArgs ...interface{}) bool { if isType(expectedType, object) { return true } if h, ok := t.(tHelper); ok { h.Helper() } return Fail(t, fmt.Sprintf("Object expected to be of type %T, but was %T", expectedType, object), msgAndArgs...) } // IsNotType asserts that the specified objects are not of the same type. // // assert.IsNotType(t, &NotMyStruct{}, &MyStruct{}) func IsNotType(t TestingT, theType, object interface{}, msgAndArgs ...interface{}) bool { if !isType(theType, object) { return true } if h, ok := t.(tHelper); ok { h.Helper() } return Fail(t, fmt.Sprintf("Object type expected to be different than %T", theType), msgAndArgs...) } // Equal asserts that two objects are equal. // // assert.Equal(t, 123, 123) // // Pointer variable equality is determined based on the equality of the // referenced values (as opposed to the memory addresses). Function equality // cannot be determined and will always fail. func Equal(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } if err := validateEqualArgs(expected, actual); err != nil { return Fail(t, fmt.Sprintf("Invalid operation: %#v == %#v (%s)", expected, actual, err), msgAndArgs...) } if !ObjectsAreEqual(expected, actual) { diff := diff(expected, actual) expected, actual = formatUnequalValues(expected, actual) return Fail(t, fmt.Sprintf("Not equal: \n"+ "expected: %s\n"+ "actual : %s%s", expected, actual, diff), msgAndArgs...) } return true } // validateEqualArgs checks whether provided arguments can be safely used in the // Equal/NotEqual functions. func validateEqualArgs(expected, actual interface{}) error { if expected == nil && actual == nil { return nil } if isFunction(expected) || isFunction(actual) { return errors.New("cannot take func type as argument") } return nil } // Same asserts that two pointers reference the same object. // // assert.Same(t, ptr1, ptr2) // // Both arguments must be pointer variables. Pointer variable sameness is // determined based on the equality of both type and value. func Same(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } same, ok := samePointers(expected, actual) if !ok { return Fail(t, "Both arguments must be pointers", msgAndArgs...) } if !same { // both are pointers but not the same type & pointing to the same address return Fail(t, fmt.Sprintf("Not same: \n"+ "expected: %p %#[1]v\n"+ "actual : %p %#[2]v", expected, actual), msgAndArgs...) } return true } // NotSame asserts that two pointers do not reference the same object. // // assert.NotSame(t, ptr1, ptr2) // // Both arguments must be pointer variables. Pointer variable sameness is // determined based on the equality of both type and value. func NotSame(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } same, ok := samePointers(expected, actual) if !ok { // fails when the arguments are not pointers return !(Fail(t, "Both arguments must be pointers", msgAndArgs...)) } if same { return Fail(t, fmt.Sprintf( "Expected and actual point to the same object: %p %#[1]v", expected), msgAndArgs...) } return true } // samePointers checks if two generic interface objects are pointers of the same // type pointing to the same object. It returns two values: same indicating if // they are the same type and point to the same object, and ok indicating that // both inputs are pointers. func samePointers(first, second interface{}) (same bool, ok bool) { firstPtr, secondPtr := reflect.ValueOf(first), reflect.ValueOf(second) if firstPtr.Kind() != reflect.Ptr || secondPtr.Kind() != reflect.Ptr { return false, false // not both are pointers } firstType, secondType := reflect.TypeOf(first), reflect.TypeOf(second) if firstType != secondType { return false, true // both are pointers, but of different types } // compare pointer addresses return first == second, true } // formatUnequalValues takes two values of arbitrary types and returns string // representations appropriate to be presented to the user. // // If the values are not of like type, the returned strings will be prefixed // with the type name, and the value will be enclosed in parentheses similar // to a type conversion in the Go grammar. func formatUnequalValues(expected, actual interface{}) (e string, a string) { if reflect.TypeOf(expected) != reflect.TypeOf(actual) { return fmt.Sprintf("%T(%s)", expected, truncatingFormat(expected)), fmt.Sprintf("%T(%s)", actual, truncatingFormat(actual)) } switch expected.(type) { case time.Duration: return fmt.Sprintf("%v", expected), fmt.Sprintf("%v", actual) } return truncatingFormat(expected), truncatingFormat(actual) } // truncatingFormat formats the data and truncates it if it's too long. // // This helps keep formatted error messages lines from exceeding the // bufio.MaxScanTokenSize max line length that the go testing framework imposes. func truncatingFormat(data interface{}) string { value := fmt.Sprintf("%#v", data) max := bufio.MaxScanTokenSize - 100 // Give us some space the type info too if needed. if len(value) > max { value = value[0:max] + "<... truncated>" } return value } // EqualValues asserts that two objects are equal or convertible to the larger // type and equal. // // assert.EqualValues(t, uint32(123), int32(123)) func EqualValues(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } if !ObjectsAreEqualValues(expected, actual) { diff := diff(expected, actual) expected, actual = formatUnequalValues(expected, actual) return Fail(t, fmt.Sprintf("Not equal: \n"+ "expected: %s\n"+ "actual : %s%s", expected, actual, diff), msgAndArgs...) } return true } // EqualExportedValues asserts that the types of two objects are equal and their public // fields are also equal. This is useful for comparing structs that have private fields // that could potentially differ. // // type S struct { // Exported int // notExported int // } // assert.EqualExportedValues(t, S{1, 2}, S{1, 3}) => true // assert.EqualExportedValues(t, S{1, 2}, S{2, 3}) => false func EqualExportedValues(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } aType := reflect.TypeOf(expected) bType := reflect.TypeOf(actual) if aType != bType { return Fail(t, fmt.Sprintf("Types expected to match exactly\n\t%v != %v", aType, bType), msgAndArgs...) } expected = copyExportedFields(expected) actual = copyExportedFields(actual) if !ObjectsAreEqualValues(expected, actual) { diff := diff(expected, actual) expected, actual = formatUnequalValues(expected, actual) return Fail(t, fmt.Sprintf("Not equal (comparing only exported fields): \n"+ "expected: %s\n"+ "actual : %s%s", expected, actual, diff), msgAndArgs...) } return true } // Exactly asserts that two objects are equal in value and type. // // assert.Exactly(t, int32(123), int64(123)) func Exactly(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } aType := reflect.TypeOf(expected) bType := reflect.TypeOf(actual) if aType != bType { return Fail(t, fmt.Sprintf("Types expected to match exactly\n\t%v != %v", aType, bType), msgAndArgs...) } return Equal(t, expected, actual, msgAndArgs...) } // NotNil asserts that the specified object is not nil. // // assert.NotNil(t, err) func NotNil(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { if !isNil(object) { return true } if h, ok := t.(tHelper); ok { h.Helper() } return Fail(t, "Expected value not to be nil.", msgAndArgs...) } // isNil checks if a specified object is nil or not, without Failing. func isNil(object interface{}) bool { if object == nil { return true } value := reflect.ValueOf(object) switch value.Kind() { case reflect.Chan, reflect.Func, reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice, reflect.UnsafePointer: return value.IsNil() } return false } // Nil asserts that the specified object is nil. // // assert.Nil(t, err) func Nil(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { if isNil(object) { return true } if h, ok := t.(tHelper); ok { h.Helper() } return Fail(t, fmt.Sprintf("Expected nil, but got: %#v", object), msgAndArgs...) } // isEmpty gets whether the specified object is considered empty or not. func isEmpty(object interface{}) bool { // get nil case out of the way if object == nil { return true } return isEmptyValue(reflect.ValueOf(object)) } // isEmptyValue gets whether the specified reflect.Value is considered empty or not. func isEmptyValue(objValue reflect.Value) bool { if objValue.IsZero() { return true } // Special cases of non-zero values that we consider empty switch objValue.Kind() { // collection types are empty when they have no element // Note: array types are empty when they match their zero-initialized state. case reflect.Chan, reflect.Map, reflect.Slice: return objValue.Len() == 0 // non-nil pointers are empty if the value they point to is empty case reflect.Ptr: return isEmptyValue(objValue.Elem()) } return false } // Empty asserts that the given value is "empty". // // [Zero values] are "empty". // // Arrays are "empty" if every element is the zero value of the type (stricter than "empty"). // // Slices, maps and channels with zero length are "empty". // // Pointer values are "empty" if the pointer is nil or if the pointed value is "empty". // // assert.Empty(t, obj) // // [Zero values]: https://go.dev/ref/spec#The_zero_value func Empty(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { pass := isEmpty(object) if !pass { if h, ok := t.(tHelper); ok { h.Helper() } Fail(t, fmt.Sprintf("Should be empty, but was %v", object), msgAndArgs...) } return pass } // NotEmpty asserts that the specified object is NOT [Empty]. // // if assert.NotEmpty(t, obj) { // assert.Equal(t, "two", obj[1]) // } func NotEmpty(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { pass := !isEmpty(object) if !pass { if h, ok := t.(tHelper); ok { h.Helper() } Fail(t, fmt.Sprintf("Should NOT be empty, but was %v", object), msgAndArgs...) } return pass } // getLen tries to get the length of an object. // It returns (0, false) if impossible. func getLen(x interface{}) (length int, ok bool) { v := reflect.ValueOf(x) defer func() { ok = recover() == nil }() return v.Len(), true } // Len asserts that the specified object has specific length. // Len also fails if the object has a type that len() not accept. // // assert.Len(t, mySlice, 3) func Len(t TestingT, object interface{}, length int, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } l, ok := getLen(object) if !ok { return Fail(t, fmt.Sprintf("\"%v\" could not be applied builtin len()", object), msgAndArgs...) } if l != length { return Fail(t, fmt.Sprintf("\"%v\" should have %d item(s), but has %d", object, length, l), msgAndArgs...) } return true } // True asserts that the specified value is true. // // assert.True(t, myBool) func True(t TestingT, value bool, msgAndArgs ...interface{}) bool { if !value { if h, ok := t.(tHelper); ok { h.Helper() } return Fail(t, "Should be true", msgAndArgs...) } return true } // False asserts that the specified value is false. // // assert.False(t, myBool) func False(t TestingT, value bool, msgAndArgs ...interface{}) bool { if value { if h, ok := t.(tHelper); ok { h.Helper() } return Fail(t, "Should be false", msgAndArgs...) } return true } // NotEqual asserts that the specified values are NOT equal. // // assert.NotEqual(t, obj1, obj2) // // Pointer variable equality is determined based on the equality of the // referenced values (as opposed to the memory addresses). func NotEqual(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } if err := validateEqualArgs(expected, actual); err != nil { return Fail(t, fmt.Sprintf("Invalid operation: %#v != %#v (%s)", expected, actual, err), msgAndArgs...) } if ObjectsAreEqual(expected, actual) { return Fail(t, fmt.Sprintf("Should not be: %#v\n", actual), msgAndArgs...) } return true } // NotEqualValues asserts that two objects are not equal even when converted to the same type // // assert.NotEqualValues(t, obj1, obj2) func NotEqualValues(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } if ObjectsAreEqualValues(expected, actual) { return Fail(t, fmt.Sprintf("Should not be: %#v\n", actual), msgAndArgs...) } return true } // containsElement try loop over the list check if the list includes the element. // return (false, false) if impossible. // return (true, false) if element was not found. // return (true, true) if element was found. func containsElement(list interface{}, element interface{}) (ok, found bool) { listValue := reflect.ValueOf(list) listType := reflect.TypeOf(list) if listType == nil { return false, false } listKind := listType.Kind() defer func() { if e := recover(); e != nil { ok = false found = false } }() if listKind == reflect.String { elementValue := reflect.ValueOf(element) return true, strings.Contains(listValue.String(), elementValue.String()) } if listKind == reflect.Map { mapKeys := listValue.MapKeys() for i := 0; i < len(mapKeys); i++ { if ObjectsAreEqual(mapKeys[i].Interface(), element) { return true, true } } return true, false } for i := 0; i < listValue.Len(); i++ { if ObjectsAreEqual(listValue.Index(i).Interface(), element) { return true, true } } return true, false } // Contains asserts that the specified string, list(array, slice...) or map contains the // specified substring or element. // // assert.Contains(t, "Hello World", "World") // assert.Contains(t, ["Hello", "World"], "World") // assert.Contains(t, {"Hello": "World"}, "Hello") func Contains(t TestingT, s, contains interface{}, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } ok, found := containsElement(s, contains) if !ok { return Fail(t, fmt.Sprintf("%#v could not be applied builtin len()", s), msgAndArgs...) } if !found { return Fail(t, fmt.Sprintf("%#v does not contain %#v", s, contains), msgAndArgs...) } return true } // NotContains asserts that the specified string, list(array, slice...) or map does NOT contain the // specified substring or element. // // assert.NotContains(t, "Hello World", "Earth") // assert.NotContains(t, ["Hello", "World"], "Earth") // assert.NotContains(t, {"Hello": "World"}, "Earth") func NotContains(t TestingT, s, contains interface{}, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } ok, found := containsElement(s, contains) if !ok { return Fail(t, fmt.Sprintf("%#v could not be applied builtin len()", s), msgAndArgs...) } if found { return Fail(t, fmt.Sprintf("%#v should not contain %#v", s, contains), msgAndArgs...) } return true } // Subset asserts that the list (array, slice, or map) contains all elements // given in the subset (array, slice, or map). // Map elements are key-value pairs unless compared with an array or slice where // only the map key is evaluated. // // assert.Subset(t, [1, 2, 3], [1, 2]) // assert.Subset(t, {"x": 1, "y": 2}, {"x": 1}) // assert.Subset(t, [1, 2, 3], {1: "one", 2: "two"}) // assert.Subset(t, {"x": 1, "y": 2}, ["x"]) func Subset(t TestingT, list, subset interface{}, msgAndArgs ...interface{}) (ok bool) { if h, ok := t.(tHelper); ok { h.Helper() } if subset == nil { return true // we consider nil to be equal to the nil set } listKind := reflect.TypeOf(list).Kind() if listKind != reflect.Array && listKind != reflect.Slice && listKind != reflect.Map { return Fail(t, fmt.Sprintf("%q has an unsupported type %s", list, listKind), msgAndArgs...) } subsetKind := reflect.TypeOf(subset).Kind() if subsetKind != reflect.Array && subsetKind != reflect.Slice && subsetKind != reflect.Map { return Fail(t, fmt.Sprintf("%q has an unsupported type %s", subset, subsetKind), msgAndArgs...) } if subsetKind == reflect.Map && listKind == reflect.Map { subsetMap := reflect.ValueOf(subset) actualMap := reflect.ValueOf(list) for _, k := range subsetMap.MapKeys() { ev := subsetMap.MapIndex(k) av := actualMap.MapIndex(k) if !av.IsValid() { return Fail(t, fmt.Sprintf("%#v does not contain %#v", list, subset), msgAndArgs...) } if !ObjectsAreEqual(ev.Interface(), av.Interface()) { return Fail(t, fmt.Sprintf("%#v does not contain %#v", list, subset), msgAndArgs...) } } return true } subsetList := reflect.ValueOf(subset) if subsetKind == reflect.Map { keys := make([]interface{}, subsetList.Len()) for idx, key := range subsetList.MapKeys() { keys[idx] = key.Interface() } subsetList = reflect.ValueOf(keys) } for i := 0; i < subsetList.Len(); i++ { element := subsetList.Index(i).Interface() ok, found := containsElement(list, element) if !ok { return Fail(t, fmt.Sprintf("%#v could not be applied builtin len()", list), msgAndArgs...) } if !found { return Fail(t, fmt.Sprintf("%#v does not contain %#v", list, element), msgAndArgs...) } } return true } // NotSubset asserts that the list (array, slice, or map) does NOT contain all // elements given in the subset (array, slice, or map). // Map elements are key-value pairs unless compared with an array or slice where // only the map key is evaluated. // // assert.NotSubset(t, [1, 3, 4], [1, 2]) // assert.NotSubset(t, {"x": 1, "y": 2}, {"z": 3}) // assert.NotSubset(t, [1, 3, 4], {1: "one", 2: "two"}) // assert.NotSubset(t, {"x": 1, "y": 2}, ["z"]) func NotSubset(t TestingT, list, subset interface{}, msgAndArgs ...interface{}) (ok bool) { if h, ok := t.(tHelper); ok { h.Helper() } if subset == nil { return Fail(t, "nil is the empty set which is a subset of every set", msgAndArgs...) } listKind := reflect.TypeOf(list).Kind() if listKind != reflect.Array && listKind != reflect.Slice && listKind != reflect.Map { return Fail(t, fmt.Sprintf("%q has an unsupported type %s", list, listKind), msgAndArgs...) } subsetKind := reflect.TypeOf(subset).Kind() if subsetKind != reflect.Array && subsetKind != reflect.Slice && subsetKind != reflect.Map { return Fail(t, fmt.Sprintf("%q has an unsupported type %s", subset, subsetKind), msgAndArgs...) } if subsetKind == reflect.Map && listKind == reflect.Map { subsetMap := reflect.ValueOf(subset) actualMap := reflect.ValueOf(list) for _, k := range subsetMap.MapKeys() { ev := subsetMap.MapIndex(k) av := actualMap.MapIndex(k) if !av.IsValid() { return true } if !ObjectsAreEqual(ev.Interface(), av.Interface()) { return true } } return Fail(t, fmt.Sprintf("%q is a subset of %q", subset, list), msgAndArgs...) } subsetList := reflect.ValueOf(subset) if subsetKind == reflect.Map { keys := make([]interface{}, subsetList.Len()) for idx, key := range subsetList.MapKeys() { keys[idx] = key.Interface() } subsetList = reflect.ValueOf(keys) } for i := 0; i < subsetList.Len(); i++ { element := subsetList.Index(i).Interface() ok, found := containsElement(list, element) if !ok { return Fail(t, fmt.Sprintf("%q could not be applied builtin len()", list), msgAndArgs...) } if !found { return true } } return Fail(t, fmt.Sprintf("%q is a subset of %q", subset, list), msgAndArgs...) } // ElementsMatch asserts that the specified listA(array, slice...) is equal to specified // listB(array, slice...) ignoring the order of the elements. If there are duplicate elements, // the number of appearances of each of them in both lists should match. // // assert.ElementsMatch(t, [1, 3, 2, 3], [1, 3, 3, 2]) func ElementsMatch(t TestingT, listA, listB interface{}, msgAndArgs ...interface{}) (ok bool) { if h, ok := t.(tHelper); ok { h.Helper() } if isEmpty(listA) && isEmpty(listB) { return true } if !isList(t, listA, msgAndArgs...) || !isList(t, listB, msgAndArgs...) { return false } extraA, extraB := diffLists(listA, listB) if len(extraA) == 0 && len(extraB) == 0 { return true } return Fail(t, formatListDiff(listA, listB, extraA, extraB), msgAndArgs...) } // isList checks that the provided value is array or slice. func isList(t TestingT, list interface{}, msgAndArgs ...interface{}) (ok bool) { kind := reflect.TypeOf(list).Kind() if kind != reflect.Array && kind != reflect.Slice { return Fail(t, fmt.Sprintf("%q has an unsupported type %s, expecting array or slice", list, kind), msgAndArgs...) } return true } // diffLists diffs two arrays/slices and returns slices of elements that are only in A and only in B. // If some element is present multiple times, each instance is counted separately (e.g. if something is 2x in A and // 5x in B, it will be 0x in extraA and 3x in extraB). The order of items in both lists is ignored. func diffLists(listA, listB interface{}) (extraA, extraB []interface{}) { aValue := reflect.ValueOf(listA) bValue := reflect.ValueOf(listB) aLen := aValue.Len() bLen := bValue.Len() // Mark indexes in bValue that we already used visited := make([]bool, bLen) for i := 0; i < aLen; i++ { element := aValue.Index(i).Interface() found := false for j := 0; j < bLen; j++ { if visited[j] { continue } if ObjectsAreEqual(bValue.Index(j).Interface(), element) { visited[j] = true found = true break } } if !found { extraA = append(extraA, element) } } for j := 0; j < bLen; j++ { if visited[j] { continue } extraB = append(extraB, bValue.Index(j).Interface()) } return } func formatListDiff(listA, listB interface{}, extraA, extraB []interface{}) string { var msg bytes.Buffer msg.WriteString("elements differ") if len(extraA) > 0 { msg.WriteString("\n\nextra elements in list A:\n") msg.WriteString(spewConfig.Sdump(extraA)) } if len(extraB) > 0 { msg.WriteString("\n\nextra elements in list B:\n") msg.WriteString(spewConfig.Sdump(extraB)) } msg.WriteString("\n\nlistA:\n") msg.WriteString(spewConfig.Sdump(listA)) msg.WriteString("\n\nlistB:\n") msg.WriteString(spewConfig.Sdump(listB)) return msg.String() } // NotElementsMatch asserts that the specified listA(array, slice...) is NOT equal to specified // listB(array, slice...) ignoring the order of the elements. If there are duplicate elements, // the number of appearances of each of them in both lists should not match. // This is an inverse of ElementsMatch. // // assert.NotElementsMatch(t, [1, 1, 2, 3], [1, 1, 2, 3]) -> false // // assert.NotElementsMatch(t, [1, 1, 2, 3], [1, 2, 3]) -> true // // assert.NotElementsMatch(t, [1, 2, 3], [1, 2, 4]) -> true func NotElementsMatch(t TestingT, listA, listB interface{}, msgAndArgs ...interface{}) (ok bool) { if h, ok := t.(tHelper); ok { h.Helper() } if isEmpty(listA) && isEmpty(listB) { return Fail(t, "listA and listB contain the same elements", msgAndArgs) } if !isList(t, listA, msgAndArgs...) { return Fail(t, "listA is not a list type", msgAndArgs...) } if !isList(t, listB, msgAndArgs...) { return Fail(t, "listB is not a list type", msgAndArgs...) } extraA, extraB := diffLists(listA, listB) if len(extraA) == 0 && len(extraB) == 0 { return Fail(t, "listA and listB contain the same elements", msgAndArgs) } return true } // Condition uses a Comparison to assert a complex condition. func Condition(t TestingT, comp Comparison, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } result := comp() if !result { Fail(t, "Condition failed!", msgAndArgs...) } return result } // PanicTestFunc defines a func that should be passed to the assert.Panics and assert.NotPanics // methods, and represents a simple func that takes no arguments, and returns nothing. type PanicTestFunc func() // didPanic returns true if the function passed to it panics. Otherwise, it returns false. func didPanic(f PanicTestFunc) (didPanic bool, message interface{}, stack string) { didPanic = true defer func() { message = recover() if didPanic { stack = string(debug.Stack()) } }() // call the target function f() didPanic = false return } // Panics asserts that the code inside the specified PanicTestFunc panics. // // assert.Panics(t, func(){ GoCrazy() }) func Panics(t TestingT, f PanicTestFunc, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } if funcDidPanic, panicValue, _ := didPanic(f); !funcDidPanic { return Fail(t, fmt.Sprintf("func %#v should panic\n\tPanic value:\t%#v", f, panicValue), msgAndArgs...) } return true } // PanicsWithValue asserts that the code inside the specified PanicTestFunc panics, and that // the recovered panic value equals the expected panic value. // // assert.PanicsWithValue(t, "crazy error", func(){ GoCrazy() }) func PanicsWithValue(t TestingT, expected interface{}, f PanicTestFunc, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } funcDidPanic, panicValue, panickedStack := didPanic(f) if !funcDidPanic { return Fail(t, fmt.Sprintf("func %#v should panic\n\tPanic value:\t%#v", f, panicValue), msgAndArgs...) } if panicValue != expected { return Fail(t, fmt.Sprintf("func %#v should panic with value:\t%#v\n\tPanic value:\t%#v\n\tPanic stack:\t%s", f, expected, panicValue, panickedStack), msgAndArgs...) } return true } // PanicsWithError asserts that the code inside the specified PanicTestFunc // panics, and that the recovered panic value is an error that satisfies the // EqualError comparison. // // assert.PanicsWithError(t, "crazy error", func(){ GoCrazy() }) func PanicsWithError(t TestingT, errString string, f PanicTestFunc, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } funcDidPanic, panicValue, panickedStack := didPanic(f) if !funcDidPanic { return Fail(t, fmt.Sprintf("func %#v should panic\n\tPanic value:\t%#v", f, panicValue), msgAndArgs...) } panicErr, ok := panicValue.(error) if !ok || panicErr.Error() != errString { return Fail(t, fmt.Sprintf("func %#v should panic with error message:\t%#v\n\tPanic value:\t%#v\n\tPanic stack:\t%s", f, errString, panicValue, panickedStack), msgAndArgs...) } return true } // NotPanics asserts that the code inside the specified PanicTestFunc does NOT panic. // // assert.NotPanics(t, func(){ RemainCalm() }) func NotPanics(t TestingT, f PanicTestFunc, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } if funcDidPanic, panicValue, panickedStack := didPanic(f); funcDidPanic { return Fail(t, fmt.Sprintf("func %#v should not panic\n\tPanic value:\t%v\n\tPanic stack:\t%s", f, panicValue, panickedStack), msgAndArgs...) } return true } // WithinDuration asserts that the two times are within duration delta of each other. // // assert.WithinDuration(t, time.Now(), time.Now(), 10*time.Second) func WithinDuration(t TestingT, expected, actual time.Time, delta time.Duration, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } dt := expected.Sub(actual) if dt < -delta || dt > delta { return Fail(t, fmt.Sprintf("Max difference between %v and %v allowed is %v, but difference was %v", expected, actual, delta, dt), msgAndArgs...) } return true } // WithinRange asserts that a time is within a time range (inclusive). // // assert.WithinRange(t, time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second)) func WithinRange(t TestingT, actual, start, end time.Time, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } if end.Before(start) { return Fail(t, "Start should be before end", msgAndArgs...) } if actual.Before(start) { return Fail(t, fmt.Sprintf("Time %v expected to be in time range %v to %v, but is before the range", actual, start, end), msgAndArgs...) } else if actual.After(end) { return Fail(t, fmt.Sprintf("Time %v expected to be in time range %v to %v, but is after the range", actual, start, end), msgAndArgs...) } return true } func toFloat(x interface{}) (float64, bool) { var xf float64 xok := true switch xn := x.(type) { case uint: xf = float64(xn) case uint8: xf = float64(xn) case uint16: xf = float64(xn) case uint32: xf = float64(xn) case uint64: xf = float64(xn) case int: xf = float64(xn) case int8: xf = float64(xn) case int16: xf = float64(xn) case int32: xf = float64(xn) case int64: xf = float64(xn) case float32: xf = float64(xn) case float64: xf = xn case time.Duration: xf = float64(xn) default: xok = false } return xf, xok } // InDelta asserts that the two numerals are within delta of each other. // // assert.InDelta(t, math.Pi, 22/7.0, 0.01) func InDelta(t TestingT, expected, actual interface{}, delta float64, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } af, aok := toFloat(expected) bf, bok := toFloat(actual) if !aok || !bok { return Fail(t, "Parameters must be numerical", msgAndArgs...) } if math.IsNaN(af) && math.IsNaN(bf) { return true } if math.IsNaN(af) { return Fail(t, "Expected must not be NaN", msgAndArgs...) } if math.IsNaN(bf) { return Fail(t, fmt.Sprintf("Expected %v with delta %v, but was NaN", expected, delta), msgAndArgs...) } dt := af - bf if dt < -delta || dt > delta { return Fail(t, fmt.Sprintf("Max difference between %v and %v allowed is %v, but difference was %v", expected, actual, delta, dt), msgAndArgs...) } return true } // InDeltaSlice is the same as InDelta, except it compares two slices. func InDeltaSlice(t TestingT, expected, actual interface{}, delta float64, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } if expected == nil || actual == nil || reflect.TypeOf(actual).Kind() != reflect.Slice || reflect.TypeOf(expected).Kind() != reflect.Slice { return Fail(t, "Parameters must be slice", msgAndArgs...) } actualSlice := reflect.ValueOf(actual) expectedSlice := reflect.ValueOf(expected) for i := 0; i < actualSlice.Len(); i++ { result := InDelta(t, actualSlice.Index(i).Interface(), expectedSlice.Index(i).Interface(), delta, msgAndArgs...) if !result { return result } } return true } // InDeltaMapValues is the same as InDelta, but it compares all values between two maps. Both maps must have exactly the same keys. func InDeltaMapValues(t TestingT, expected, actual interface{}, delta float64, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } if expected == nil || actual == nil || reflect.TypeOf(actual).Kind() != reflect.Map || reflect.TypeOf(expected).Kind() != reflect.Map { return Fail(t, "Arguments must be maps", msgAndArgs...) } expectedMap := reflect.ValueOf(expected) actualMap := reflect.ValueOf(actual) if expectedMap.Len() != actualMap.Len() { return Fail(t, "Arguments must have the same number of keys", msgAndArgs...) } for _, k := range expectedMap.MapKeys() { ev := expectedMap.MapIndex(k) av := actualMap.MapIndex(k) if !ev.IsValid() { return Fail(t, fmt.Sprintf("missing key %q in expected map", k), msgAndArgs...) } if !av.IsValid() { return Fail(t, fmt.Sprintf("missing key %q in actual map", k), msgAndArgs...) } if !InDelta( t, ev.Interface(), av.Interface(), delta, msgAndArgs..., ) { return false } } return true } func calcRelativeError(expected, actual interface{}) (float64, error) { af, aok := toFloat(expected) bf, bok := toFloat(actual) if !aok || !bok { return 0, fmt.Errorf("Parameters must be numerical") } if math.IsNaN(af) && math.IsNaN(bf) { return 0, nil } if math.IsNaN(af) { return 0, errors.New("expected value must not be NaN") } if af == 0 { return 0, fmt.Errorf("expected value must have a value other than zero to calculate the relative error") } if math.IsNaN(bf) { return 0, errors.New("actual value must not be NaN") } return math.Abs(af-bf) / math.Abs(af), nil } // InEpsilon asserts that expected and actual have a relative error less than epsilon func InEpsilon(t TestingT, expected, actual interface{}, epsilon float64, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } if math.IsNaN(epsilon) { return Fail(t, "epsilon must not be NaN", msgAndArgs...) } actualEpsilon, err := calcRelativeError(expected, actual) if err != nil { return Fail(t, err.Error(), msgAndArgs...) } if math.IsNaN(actualEpsilon) { return Fail(t, "relative error is NaN", msgAndArgs...) } if actualEpsilon > epsilon { return Fail(t, fmt.Sprintf("Relative error is too high: %#v (expected)\n"+ " < %#v (actual)", epsilon, actualEpsilon), msgAndArgs...) } return true } // InEpsilonSlice is the same as InEpsilon, except it compares each value from two slices. func InEpsilonSlice(t TestingT, expected, actual interface{}, epsilon float64, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } if expected == nil || actual == nil { return Fail(t, "Parameters must be slice", msgAndArgs...) } expectedSlice := reflect.ValueOf(expected) actualSlice := reflect.ValueOf(actual) if expectedSlice.Type().Kind() != reflect.Slice { return Fail(t, "Expected value must be slice", msgAndArgs...) } expectedLen := expectedSlice.Len() if !IsType(t, expected, actual) || !Len(t, actual, expectedLen) { return false } for i := 0; i < expectedLen; i++ { if !InEpsilon(t, expectedSlice.Index(i).Interface(), actualSlice.Index(i).Interface(), epsilon, "at index %d", i) { return false } } return true } /* Errors */ // NoError asserts that a function returned no error (i.e. `nil`). // // actualObj, err := SomeFunction() // if assert.NoError(t, err) { // assert.Equal(t, expectedObj, actualObj) // } func NoError(t TestingT, err error, msgAndArgs ...interface{}) bool { if err != nil { if h, ok := t.(tHelper); ok { h.Helper() } return Fail(t, fmt.Sprintf("Received unexpected error:\n%+v", err), msgAndArgs...) } return true } // Error asserts that a function returned an error (i.e. not `nil`). // // actualObj, err := SomeFunction() // assert.Error(t, err) func Error(t TestingT, err error, msgAndArgs ...interface{}) bool { if err == nil { if h, ok := t.(tHelper); ok { h.Helper() } return Fail(t, "An error is expected but got nil.", msgAndArgs...) } return true } // EqualError asserts that a function returned an error (i.e. not `nil`) // and that it is equal to the provided error. // // actualObj, err := SomeFunction() // assert.EqualError(t, err, expectedErrorString) func EqualError(t TestingT, theError error, errString string, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } if !Error(t, theError, msgAndArgs...) { return false } expected := errString actual := theError.Error() // don't need to use deep equals here, we know they are both strings if expected != actual { return Fail(t, fmt.Sprintf("Error message not equal:\n"+ "expected: %q\n"+ "actual : %q", expected, actual), msgAndArgs...) } return true } // ErrorContains asserts that a function returned an error (i.e. not `nil`) // and that the error contains the specified substring. // // actualObj, err := SomeFunction() // assert.ErrorContains(t, err, expectedErrorSubString) func ErrorContains(t TestingT, theError error, contains string, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } if !Error(t, theError, msgAndArgs...) { return false } actual := theError.Error() if !strings.Contains(actual, contains) { return Fail(t, fmt.Sprintf("Error %#v does not contain %#v", actual, contains), msgAndArgs...) } return true } // matchRegexp return true if a specified regexp matches a string. func matchRegexp(rx interface{}, str interface{}) bool { var r *regexp.Regexp if rr, ok := rx.(*regexp.Regexp); ok { r = rr } else { r = regexp.MustCompile(fmt.Sprint(rx)) } switch v := str.(type) { case []byte: return r.Match(v) case string: return r.MatchString(v) default: return r.MatchString(fmt.Sprint(v)) } } // Regexp asserts that a specified regexp matches a string. // // assert.Regexp(t, regexp.MustCompile("start"), "it's starting") // assert.Regexp(t, "start...$", "it's not starting") func Regexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } match := matchRegexp(rx, str) if !match { Fail(t, fmt.Sprintf("Expect \"%v\" to match \"%v\"", str, rx), msgAndArgs...) } return match } // NotRegexp asserts that a specified regexp does not match a string. // // assert.NotRegexp(t, regexp.MustCompile("starts"), "it's starting") // assert.NotRegexp(t, "^start", "it's not starting") func NotRegexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } match := matchRegexp(rx, str) if match { Fail(t, fmt.Sprintf("Expect \"%v\" to NOT match \"%v\"", str, rx), msgAndArgs...) } return !match } // Zero asserts that i is the zero value for its type. func Zero(t TestingT, i interface{}, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } if i != nil && !reflect.DeepEqual(i, reflect.Zero(reflect.TypeOf(i)).Interface()) { return Fail(t, fmt.Sprintf("Should be zero, but was %v", i), msgAndArgs...) } return true } // NotZero asserts that i is not the zero value for its type. func NotZero(t TestingT, i interface{}, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } if i == nil || reflect.DeepEqual(i, reflect.Zero(reflect.TypeOf(i)).Interface()) { return Fail(t, fmt.Sprintf("Should not be zero, but was %v", i), msgAndArgs...) } return true } // FileExists checks whether a file exists in the given path. It also fails if // the path points to a directory or there is an error when trying to check the file. func FileExists(t TestingT, path string, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } info, err := os.Lstat(path) if err != nil { if os.IsNotExist(err) { return Fail(t, fmt.Sprintf("unable to find file %q", path), msgAndArgs...) } return Fail(t, fmt.Sprintf("error when running os.Lstat(%q): %s", path, err), msgAndArgs...) } if info.IsDir() { return Fail(t, fmt.Sprintf("%q is a directory", path), msgAndArgs...) } return true } // NoFileExists checks whether a file does not exist in a given path. It fails // if the path points to an existing _file_ only. func NoFileExists(t TestingT, path string, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } info, err := os.Lstat(path) if err != nil { return true } if info.IsDir() { return true } return Fail(t, fmt.Sprintf("file %q exists", path), msgAndArgs...) } // DirExists checks whether a directory exists in the given path. It also fails // if the path is a file rather a directory or there is an error checking whether it exists. func DirExists(t TestingT, path string, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } info, err := os.Lstat(path) if err != nil { if os.IsNotExist(err) { return Fail(t, fmt.Sprintf("unable to find file %q", path), msgAndArgs...) } return Fail(t, fmt.Sprintf("error when running os.Lstat(%q): %s", path, err), msgAndArgs...) } if !info.IsDir() { return Fail(t, fmt.Sprintf("%q is a file", path), msgAndArgs...) } return true } // NoDirExists checks whether a directory does not exist in the given path. // It fails if the path points to an existing _directory_ only. func NoDirExists(t TestingT, path string, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } info, err := os.Lstat(path) if err != nil { if os.IsNotExist(err) { return true } return true } if !info.IsDir() { return true } return Fail(t, fmt.Sprintf("directory %q exists", path), msgAndArgs...) } // JSONEq asserts that two JSON strings are equivalent. // // assert.JSONEq(t, `{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`) func JSONEq(t TestingT, expected string, actual string, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } var expectedJSONAsInterface, actualJSONAsInterface interface{} if err := json.Unmarshal([]byte(expected), &expectedJSONAsInterface); err != nil { return Fail(t, fmt.Sprintf("Expected value ('%s') is not valid json.\nJSON parsing error: '%s'", expected, err.Error()), msgAndArgs...) } // Shortcut if same bytes if actual == expected { return true } if err := json.Unmarshal([]byte(actual), &actualJSONAsInterface); err != nil { return Fail(t, fmt.Sprintf("Input ('%s') needs to be valid json.\nJSON parsing error: '%s'", actual, err.Error()), msgAndArgs...) } return Equal(t, expectedJSONAsInterface, actualJSONAsInterface, msgAndArgs...) } // YAMLEq asserts that two YAML strings are equivalent. func YAMLEq(t TestingT, expected string, actual string, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } var expectedYAMLAsInterface, actualYAMLAsInterface interface{} if err := yaml.Unmarshal([]byte(expected), &expectedYAMLAsInterface); err != nil { return Fail(t, fmt.Sprintf("Expected value ('%s') is not valid yaml.\nYAML parsing error: '%s'", expected, err.Error()), msgAndArgs...) } // Shortcut if same bytes if actual == expected { return true } if err := yaml.Unmarshal([]byte(actual), &actualYAMLAsInterface); err != nil { return Fail(t, fmt.Sprintf("Input ('%s') needs to be valid yaml.\nYAML error: '%s'", actual, err.Error()), msgAndArgs...) } return Equal(t, expectedYAMLAsInterface, actualYAMLAsInterface, msgAndArgs...) } func typeAndKind(v interface{}) (reflect.Type, reflect.Kind) { t := reflect.TypeOf(v) k := t.Kind() if k == reflect.Ptr { t = t.Elem() k = t.Kind() } return t, k } // diff returns a diff of both values as long as both are of the same type and // are a struct, map, slice, array or string. Otherwise it returns an empty string. func diff(expected interface{}, actual interface{}) string { if expected == nil || actual == nil { return "" } et, ek := typeAndKind(expected) at, _ := typeAndKind(actual) if et != at { return "" } if ek != reflect.Struct && ek != reflect.Map && ek != reflect.Slice && ek != reflect.Array && ek != reflect.String { return "" } var e, a string switch et { case reflect.TypeOf(""): e = reflect.ValueOf(expected).String() a = reflect.ValueOf(actual).String() case reflect.TypeOf(time.Time{}): e = spewConfigStringerEnabled.Sdump(expected) a = spewConfigStringerEnabled.Sdump(actual) default: e = spewConfig.Sdump(expected) a = spewConfig.Sdump(actual) } diff, _ := difflib.GetUnifiedDiffString(difflib.UnifiedDiff{ A: difflib.SplitLines(e), B: difflib.SplitLines(a), FromFile: "Expected", FromDate: "", ToFile: "Actual", ToDate: "", Context: 1, }) return "\n\nDiff:\n" + diff } func isFunction(arg interface{}) bool { if arg == nil { return false } return reflect.TypeOf(arg).Kind() == reflect.Func } var spewConfig = spew.ConfigState{ Indent: " ", DisablePointerAddresses: true, DisableCapacities: true, SortKeys: true, DisableMethods: true, MaxDepth: 10, } var spewConfigStringerEnabled = spew.ConfigState{ Indent: " ", DisablePointerAddresses: true, DisableCapacities: true, SortKeys: true, MaxDepth: 10, } type tHelper = interface { Helper() } // Eventually asserts that given condition will be met in waitFor time, // periodically checking target function each tick. // // assert.Eventually(t, func() bool { return true; }, time.Second, 10*time.Millisecond) func Eventually(t TestingT, condition func() bool, waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } ch := make(chan bool, 1) checkCond := func() { ch <- condition() } timer := time.NewTimer(waitFor) defer timer.Stop() ticker := time.NewTicker(tick) defer ticker.Stop() var tickC <-chan time.Time // Check the condition once first on the initial call. go checkCond() for { select { case <-timer.C: return Fail(t, "Condition never satisfied", msgAndArgs...) case <-tickC: tickC = nil go checkCond() case v := <-ch: if v { return true } tickC = ticker.C } } } // CollectT implements the TestingT interface and collects all errors. type CollectT struct { // A slice of errors. Non-nil slice denotes a failure. // If it's non-nil but len(c.errors) == 0, this is also a failure // obtained by direct c.FailNow() call. errors []error } // Helper is like [testing.T.Helper] but does nothing. func (CollectT) Helper() {} // Errorf collects the error. func (c *CollectT) Errorf(format string, args ...interface{}) { c.errors = append(c.errors, fmt.Errorf(format, args...)) } // FailNow stops execution by calling runtime.Goexit. func (c *CollectT) FailNow() { c.fail() runtime.Goexit() } // Deprecated: That was a method for internal usage that should not have been published. Now just panics. func (*CollectT) Reset() { panic("Reset() is deprecated") } // Deprecated: That was a method for internal usage that should not have been published. Now just panics. func (*CollectT) Copy(TestingT) { panic("Copy() is deprecated") } func (c *CollectT) fail() { if !c.failed() { c.errors = []error{} // Make it non-nil to mark a failure. } } func (c *CollectT) failed() bool { return c.errors != nil } // EventuallyWithT asserts that given condition will be met in waitFor time, // periodically checking target function each tick. In contrast to Eventually, // it supplies a CollectT to the condition function, so that the condition // function can use the CollectT to call other assertions. // The condition is considered "met" if no errors are raised in a tick. // The supplied CollectT collects all errors from one tick (if there are any). // If the condition is not met before waitFor, the collected errors of // the last tick are copied to t. // // externalValue := false // go func() { // time.Sleep(8*time.Second) // externalValue = true // }() // assert.EventuallyWithT(t, func(c *assert.CollectT) { // // add assertions as needed; any assertion failure will fail the current tick // assert.True(c, externalValue, "expected 'externalValue' to be true") // }, 10*time.Second, 1*time.Second, "external state has not changed to 'true'; still false") func EventuallyWithT(t TestingT, condition func(collect *CollectT), waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } var lastFinishedTickErrs []error ch := make(chan *CollectT, 1) checkCond := func() { collect := new(CollectT) defer func() { ch <- collect }() condition(collect) } timer := time.NewTimer(waitFor) defer timer.Stop() ticker := time.NewTicker(tick) defer ticker.Stop() var tickC <-chan time.Time // Check the condition once first on the initial call. go checkCond() for { select { case <-timer.C: for _, err := range lastFinishedTickErrs { t.Errorf("%v", err) } return Fail(t, "Condition never satisfied", msgAndArgs...) case <-tickC: tickC = nil go checkCond() case collect := <-ch: if !collect.failed() { return true } // Keep the errors from the last ended condition, so that they can be copied to t if timeout is reached. lastFinishedTickErrs = collect.errors tickC = ticker.C } } } // Never asserts that the given condition doesn't satisfy in waitFor time, // periodically checking the target function each tick. // // assert.Never(t, func() bool { return false; }, time.Second, 10*time.Millisecond) func Never(t TestingT, condition func() bool, waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } ch := make(chan bool, 1) checkCond := func() { ch <- condition() } timer := time.NewTimer(waitFor) defer timer.Stop() ticker := time.NewTicker(tick) defer ticker.Stop() var tickC <-chan time.Time // Check the condition once first on the initial call. go checkCond() for { select { case <-timer.C: return true case <-tickC: tickC = nil go checkCond() case v := <-ch: if v { return Fail(t, "Condition satisfied", msgAndArgs...) } tickC = ticker.C } } } // ErrorIs asserts that at least one of the errors in err's chain matches target. // This is a wrapper for errors.Is. func ErrorIs(t TestingT, err, target error, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } if errors.Is(err, target) { return true } var expectedText string if target != nil { expectedText = target.Error() if err == nil { return Fail(t, fmt.Sprintf("Expected error with %q in chain but got nil.", expectedText), msgAndArgs...) } } chain := buildErrorChainString(err, false) return Fail(t, fmt.Sprintf("Target error should be in err chain:\n"+ "expected: %q\n"+ "in chain: %s", expectedText, chain, ), msgAndArgs...) } // NotErrorIs asserts that none of the errors in err's chain matches target. // This is a wrapper for errors.Is. func NotErrorIs(t TestingT, err, target error, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } if !errors.Is(err, target) { return true } var expectedText string if target != nil { expectedText = target.Error() } chain := buildErrorChainString(err, false) return Fail(t, fmt.Sprintf("Target error should not be in err chain:\n"+ "found: %q\n"+ "in chain: %s", expectedText, chain, ), msgAndArgs...) } // ErrorAs asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. // This is a wrapper for errors.As. func ErrorAs(t TestingT, err error, target interface{}, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } if errors.As(err, target) { return true } expectedType := reflect.TypeOf(target).Elem().String() if err == nil { return Fail(t, fmt.Sprintf("An error is expected but got nil.\n"+ "expected: %s", expectedType), msgAndArgs...) } chain := buildErrorChainString(err, true) return Fail(t, fmt.Sprintf("Should be in error chain:\n"+ "expected: %s\n"+ "in chain: %s", expectedType, chain, ), msgAndArgs...) } // NotErrorAs asserts that none of the errors in err's chain matches target, // but if so, sets target to that error value. func NotErrorAs(t TestingT, err error, target interface{}, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } if !errors.As(err, target) { return true } chain := buildErrorChainString(err, true) return Fail(t, fmt.Sprintf("Target error should not be in err chain:\n"+ "found: %s\n"+ "in chain: %s", reflect.TypeOf(target).Elem().String(), chain, ), msgAndArgs...) } func unwrapAll(err error) (errs []error) { errs = append(errs, err) switch x := err.(type) { case interface{ Unwrap() error }: err = x.Unwrap() if err == nil { return } errs = append(errs, unwrapAll(err)...) case interface{ Unwrap() []error }: for _, err := range x.Unwrap() { errs = append(errs, unwrapAll(err)...) } } return } func buildErrorChainString(err error, withType bool) string { if err == nil { return "" } var chain string errs := unwrapAll(err) for i := range errs { if i != 0 { chain += "\n\t" } chain += fmt.Sprintf("%q", errs[i].Error()) if withType { chain += fmt.Sprintf(" (%T)", errs[i]) } } return chain } ================================================ FILE: vendor/github.com/stretchr/testify/assert/doc.go ================================================ // Package assert provides a set of comprehensive testing tools for use with the normal Go testing system. // // # Note // // All functions in this package return a bool value indicating whether the assertion has passed. // // # Example Usage // // The following is a complete example using assert in a standard test function: // // import ( // "testing" // "github.com/stretchr/testify/assert" // ) // // func TestSomething(t *testing.T) { // // var a string = "Hello" // var b string = "Hello" // // assert.Equal(t, a, b, "The two words should be the same.") // // } // // if you assert many times, use the format below: // // import ( // "testing" // "github.com/stretchr/testify/assert" // ) // // func TestSomething(t *testing.T) { // assert := assert.New(t) // // var a string = "Hello" // var b string = "Hello" // // assert.Equal(a, b, "The two words should be the same.") // } // // # Assertions // // Assertions allow you to easily write test code, and are global funcs in the `assert` package. // All assertion functions take, as the first argument, the `*testing.T` object provided by the // testing framework. This allows the assertion funcs to write the failings and other details to // the correct place. // // Every assertion function also takes an optional string message as the final argument, // allowing custom error messages to be appended to the message the assertion method outputs. package assert ================================================ FILE: vendor/github.com/stretchr/testify/assert/errors.go ================================================ package assert import ( "errors" ) // AnError is an error instance useful for testing. If the code does not care // about error specifics, and only needs to return the error for example, this // error should be used to make the test code more readable. var AnError = errors.New("assert.AnError general error for testing") ================================================ FILE: vendor/github.com/stretchr/testify/assert/forward_assertions.go ================================================ package assert // Assertions provides assertion methods around the // TestingT interface. type Assertions struct { t TestingT } // New makes a new Assertions object for the specified TestingT. func New(t TestingT) *Assertions { return &Assertions{ t: t, } } //go:generate sh -c "cd ../_codegen && go build && cd - && ../_codegen/_codegen -output-package=assert -template=assertion_forward.go.tmpl -include-format-funcs" ================================================ FILE: vendor/github.com/stretchr/testify/assert/http_assertions.go ================================================ package assert import ( "fmt" "net/http" "net/http/httptest" "net/url" "strings" ) // httpCode is a helper that returns HTTP code of the response. It returns -1 and // an error if building a new request fails. func httpCode(handler http.HandlerFunc, method, url string, values url.Values) (int, error) { w := httptest.NewRecorder() req, err := http.NewRequest(method, url, http.NoBody) if err != nil { return -1, err } req.URL.RawQuery = values.Encode() handler(w, req) return w.Code, nil } // HTTPSuccess asserts that a specified handler returns a success status code. // // assert.HTTPSuccess(t, myHandler, "POST", "http://www.google.com", nil) // // Returns whether the assertion was successful (true) or not (false). func HTTPSuccess(t TestingT, handler http.HandlerFunc, method, url string, values url.Values, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } code, err := httpCode(handler, method, url, values) if err != nil { Fail(t, fmt.Sprintf("Failed to build test request, got error: %s", err), msgAndArgs...) } isSuccessCode := code >= http.StatusOK && code <= http.StatusPartialContent if !isSuccessCode { Fail(t, fmt.Sprintf("Expected HTTP success status code for %q but received %d", url+"?"+values.Encode(), code), msgAndArgs...) } return isSuccessCode } // HTTPRedirect asserts that a specified handler returns a redirect status code. // // assert.HTTPRedirect(t, myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}} // // Returns whether the assertion was successful (true) or not (false). func HTTPRedirect(t TestingT, handler http.HandlerFunc, method, url string, values url.Values, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } code, err := httpCode(handler, method, url, values) if err != nil { Fail(t, fmt.Sprintf("Failed to build test request, got error: %s", err), msgAndArgs...) } isRedirectCode := code >= http.StatusMultipleChoices && code <= http.StatusTemporaryRedirect if !isRedirectCode { Fail(t, fmt.Sprintf("Expected HTTP redirect status code for %q but received %d", url+"?"+values.Encode(), code), msgAndArgs...) } return isRedirectCode } // HTTPError asserts that a specified handler returns an error status code. // // assert.HTTPError(t, myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}} // // Returns whether the assertion was successful (true) or not (false). func HTTPError(t TestingT, handler http.HandlerFunc, method, url string, values url.Values, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } code, err := httpCode(handler, method, url, values) if err != nil { Fail(t, fmt.Sprintf("Failed to build test request, got error: %s", err), msgAndArgs...) } isErrorCode := code >= http.StatusBadRequest if !isErrorCode { Fail(t, fmt.Sprintf("Expected HTTP error status code for %q but received %d", url+"?"+values.Encode(), code), msgAndArgs...) } return isErrorCode } // HTTPStatusCode asserts that a specified handler returns a specified status code. // // assert.HTTPStatusCode(t, myHandler, "GET", "/notImplemented", nil, 501) // // Returns whether the assertion was successful (true) or not (false). func HTTPStatusCode(t TestingT, handler http.HandlerFunc, method, url string, values url.Values, statuscode int, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } code, err := httpCode(handler, method, url, values) if err != nil { Fail(t, fmt.Sprintf("Failed to build test request, got error: %s", err), msgAndArgs...) } successful := code == statuscode if !successful { Fail(t, fmt.Sprintf("Expected HTTP status code %d for %q but received %d", statuscode, url+"?"+values.Encode(), code), msgAndArgs...) } return successful } // HTTPBody is a helper that returns HTTP body of the response. It returns // empty string if building a new request fails. func HTTPBody(handler http.HandlerFunc, method, url string, values url.Values) string { w := httptest.NewRecorder() if len(values) > 0 { url += "?" + values.Encode() } req, err := http.NewRequest(method, url, http.NoBody) if err != nil { return "" } handler(w, req) return w.Body.String() } // HTTPBodyContains asserts that a specified handler returns a // body that contains a string. // // assert.HTTPBodyContains(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky") // // Returns whether the assertion was successful (true) or not (false). func HTTPBodyContains(t TestingT, handler http.HandlerFunc, method, url string, values url.Values, str interface{}, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } body := HTTPBody(handler, method, url, values) contains := strings.Contains(body, fmt.Sprint(str)) if !contains { Fail(t, fmt.Sprintf("Expected response body for %q to contain %q but found %q", url+"?"+values.Encode(), str, body), msgAndArgs...) } return contains } // HTTPBodyNotContains asserts that a specified handler returns a // body that does not contain a string. // // assert.HTTPBodyNotContains(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky") // // Returns whether the assertion was successful (true) or not (false). func HTTPBodyNotContains(t TestingT, handler http.HandlerFunc, method, url string, values url.Values, str interface{}, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } body := HTTPBody(handler, method, url, values) contains := strings.Contains(body, fmt.Sprint(str)) if contains { Fail(t, fmt.Sprintf("Expected response body for %q to NOT contain %q but found %q", url+"?"+values.Encode(), str, body), msgAndArgs...) } return !contains } ================================================ FILE: vendor/github.com/stretchr/testify/assert/yaml/yaml_custom.go ================================================ //go:build testify_yaml_custom && !testify_yaml_fail && !testify_yaml_default // Package yaml is an implementation of YAML functions that calls a pluggable implementation. // // This implementation is selected with the testify_yaml_custom build tag. // // go test -tags testify_yaml_custom // // This implementation can be used at build time to replace the default implementation // to avoid linking with [gopkg.in/yaml.v3]. // // In your test package: // // import assertYaml "github.com/stretchr/testify/assert/yaml" // // func init() { // assertYaml.Unmarshal = func (in []byte, out interface{}) error { // // ... // return nil // } // } package yaml var Unmarshal func(in []byte, out interface{}) error ================================================ FILE: vendor/github.com/stretchr/testify/assert/yaml/yaml_default.go ================================================ //go:build !testify_yaml_fail && !testify_yaml_custom // Package yaml is just an indirection to handle YAML deserialization. // // This package is just an indirection that allows the builder to override the // indirection with an alternative implementation of this package that uses // another implementation of YAML deserialization. This allows to not either not // use YAML deserialization at all, or to use another implementation than // [gopkg.in/yaml.v3] (for example for license compatibility reasons, see [PR #1120]). // // Alternative implementations are selected using build tags: // // - testify_yaml_fail: [Unmarshal] always fails with an error // - testify_yaml_custom: [Unmarshal] is a variable. Caller must initialize it // before calling any of [github.com/stretchr/testify/assert.YAMLEq] or // [github.com/stretchr/testify/assert.YAMLEqf]. // // Usage: // // go test -tags testify_yaml_fail // // You can check with "go list" which implementation is linked: // // go list -f '{{.Imports}}' github.com/stretchr/testify/assert/yaml // go list -tags testify_yaml_fail -f '{{.Imports}}' github.com/stretchr/testify/assert/yaml // go list -tags testify_yaml_custom -f '{{.Imports}}' github.com/stretchr/testify/assert/yaml // // [PR #1120]: https://github.com/stretchr/testify/pull/1120 package yaml import goyaml "gopkg.in/yaml.v3" // Unmarshal is just a wrapper of [gopkg.in/yaml.v3.Unmarshal]. func Unmarshal(in []byte, out interface{}) error { return goyaml.Unmarshal(in, out) } ================================================ FILE: vendor/github.com/stretchr/testify/assert/yaml/yaml_fail.go ================================================ //go:build testify_yaml_fail && !testify_yaml_custom && !testify_yaml_default // Package yaml is an implementation of YAML functions that always fail. // // This implementation can be used at build time to replace the default implementation // to avoid linking with [gopkg.in/yaml.v3]: // // go test -tags testify_yaml_fail package yaml import "errors" var errNotImplemented = errors.New("YAML functions are not available (see https://pkg.go.dev/github.com/stretchr/testify/assert/yaml)") func Unmarshal([]byte, interface{}) error { return errNotImplemented } ================================================ FILE: vendor/github.com/stretchr/testify/require/doc.go ================================================ // Package require implements the same assertions as the `assert` package but // stops test execution when a test fails. // // # Example Usage // // The following is a complete example using require in a standard test function: // // import ( // "testing" // "github.com/stretchr/testify/require" // ) // // func TestSomething(t *testing.T) { // // var a string = "Hello" // var b string = "Hello" // // require.Equal(t, a, b, "The two words should be the same.") // // } // // # Assertions // // The `require` package have same global functions as in the `assert` package, // but instead of returning a boolean result they call `t.FailNow()`. // A consequence of this is that it must be called from the goroutine running // the test function, not from other goroutines created during the test. // // Every assertion function also takes an optional string message as the final argument, // allowing custom error messages to be appended to the message the assertion method outputs. package require ================================================ FILE: vendor/github.com/stretchr/testify/require/forward_requirements.go ================================================ package require // Assertions provides assertion methods around the // TestingT interface. type Assertions struct { t TestingT } // New makes a new Assertions object for the specified TestingT. func New(t TestingT) *Assertions { return &Assertions{ t: t, } } //go:generate sh -c "cd ../_codegen && go build && cd - && ../_codegen/_codegen -output-package=require -template=require_forward.go.tmpl -include-format-funcs" ================================================ FILE: vendor/github.com/stretchr/testify/require/require.go ================================================ // Code generated with github.com/stretchr/testify/_codegen; DO NOT EDIT. package require import ( assert "github.com/stretchr/testify/assert" http "net/http" url "net/url" time "time" ) // Condition uses a Comparison to assert a complex condition. func Condition(t TestingT, comp assert.Comparison, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.Condition(t, comp, msgAndArgs...) { return } t.FailNow() } // Conditionf uses a Comparison to assert a complex condition. func Conditionf(t TestingT, comp assert.Comparison, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.Conditionf(t, comp, msg, args...) { return } t.FailNow() } // Contains asserts that the specified string, list(array, slice...) or map contains the // specified substring or element. // // require.Contains(t, "Hello World", "World") // require.Contains(t, ["Hello", "World"], "World") // require.Contains(t, {"Hello": "World"}, "Hello") func Contains(t TestingT, s interface{}, contains interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.Contains(t, s, contains, msgAndArgs...) { return } t.FailNow() } // Containsf asserts that the specified string, list(array, slice...) or map contains the // specified substring or element. // // require.Containsf(t, "Hello World", "World", "error message %s", "formatted") // require.Containsf(t, ["Hello", "World"], "World", "error message %s", "formatted") // require.Containsf(t, {"Hello": "World"}, "Hello", "error message %s", "formatted") func Containsf(t TestingT, s interface{}, contains interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.Containsf(t, s, contains, msg, args...) { return } t.FailNow() } // DirExists checks whether a directory exists in the given path. It also fails // if the path is a file rather a directory or there is an error checking whether it exists. func DirExists(t TestingT, path string, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.DirExists(t, path, msgAndArgs...) { return } t.FailNow() } // DirExistsf checks whether a directory exists in the given path. It also fails // if the path is a file rather a directory or there is an error checking whether it exists. func DirExistsf(t TestingT, path string, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.DirExistsf(t, path, msg, args...) { return } t.FailNow() } // ElementsMatch asserts that the specified listA(array, slice...) is equal to specified // listB(array, slice...) ignoring the order of the elements. If there are duplicate elements, // the number of appearances of each of them in both lists should match. // // require.ElementsMatch(t, [1, 3, 2, 3], [1, 3, 3, 2]) func ElementsMatch(t TestingT, listA interface{}, listB interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.ElementsMatch(t, listA, listB, msgAndArgs...) { return } t.FailNow() } // ElementsMatchf asserts that the specified listA(array, slice...) is equal to specified // listB(array, slice...) ignoring the order of the elements. If there are duplicate elements, // the number of appearances of each of them in both lists should match. // // require.ElementsMatchf(t, [1, 3, 2, 3], [1, 3, 3, 2], "error message %s", "formatted") func ElementsMatchf(t TestingT, listA interface{}, listB interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.ElementsMatchf(t, listA, listB, msg, args...) { return } t.FailNow() } // Empty asserts that the given value is "empty". // // [Zero values] are "empty". // // Arrays are "empty" if every element is the zero value of the type (stricter than "empty"). // // Slices, maps and channels with zero length are "empty". // // Pointer values are "empty" if the pointer is nil or if the pointed value is "empty". // // require.Empty(t, obj) // // [Zero values]: https://go.dev/ref/spec#The_zero_value func Empty(t TestingT, object interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.Empty(t, object, msgAndArgs...) { return } t.FailNow() } // Emptyf asserts that the given value is "empty". // // [Zero values] are "empty". // // Arrays are "empty" if every element is the zero value of the type (stricter than "empty"). // // Slices, maps and channels with zero length are "empty". // // Pointer values are "empty" if the pointer is nil or if the pointed value is "empty". // // require.Emptyf(t, obj, "error message %s", "formatted") // // [Zero values]: https://go.dev/ref/spec#The_zero_value func Emptyf(t TestingT, object interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.Emptyf(t, object, msg, args...) { return } t.FailNow() } // Equal asserts that two objects are equal. // // require.Equal(t, 123, 123) // // Pointer variable equality is determined based on the equality of the // referenced values (as opposed to the memory addresses). Function equality // cannot be determined and will always fail. func Equal(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.Equal(t, expected, actual, msgAndArgs...) { return } t.FailNow() } // EqualError asserts that a function returned an error (i.e. not `nil`) // and that it is equal to the provided error. // // actualObj, err := SomeFunction() // require.EqualError(t, err, expectedErrorString) func EqualError(t TestingT, theError error, errString string, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.EqualError(t, theError, errString, msgAndArgs...) { return } t.FailNow() } // EqualErrorf asserts that a function returned an error (i.e. not `nil`) // and that it is equal to the provided error. // // actualObj, err := SomeFunction() // require.EqualErrorf(t, err, expectedErrorString, "error message %s", "formatted") func EqualErrorf(t TestingT, theError error, errString string, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.EqualErrorf(t, theError, errString, msg, args...) { return } t.FailNow() } // EqualExportedValues asserts that the types of two objects are equal and their public // fields are also equal. This is useful for comparing structs that have private fields // that could potentially differ. // // type S struct { // Exported int // notExported int // } // require.EqualExportedValues(t, S{1, 2}, S{1, 3}) => true // require.EqualExportedValues(t, S{1, 2}, S{2, 3}) => false func EqualExportedValues(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.EqualExportedValues(t, expected, actual, msgAndArgs...) { return } t.FailNow() } // EqualExportedValuesf asserts that the types of two objects are equal and their public // fields are also equal. This is useful for comparing structs that have private fields // that could potentially differ. // // type S struct { // Exported int // notExported int // } // require.EqualExportedValuesf(t, S{1, 2}, S{1, 3}, "error message %s", "formatted") => true // require.EqualExportedValuesf(t, S{1, 2}, S{2, 3}, "error message %s", "formatted") => false func EqualExportedValuesf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.EqualExportedValuesf(t, expected, actual, msg, args...) { return } t.FailNow() } // EqualValues asserts that two objects are equal or convertible to the larger // type and equal. // // require.EqualValues(t, uint32(123), int32(123)) func EqualValues(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.EqualValues(t, expected, actual, msgAndArgs...) { return } t.FailNow() } // EqualValuesf asserts that two objects are equal or convertible to the larger // type and equal. // // require.EqualValuesf(t, uint32(123), int32(123), "error message %s", "formatted") func EqualValuesf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.EqualValuesf(t, expected, actual, msg, args...) { return } t.FailNow() } // Equalf asserts that two objects are equal. // // require.Equalf(t, 123, 123, "error message %s", "formatted") // // Pointer variable equality is determined based on the equality of the // referenced values (as opposed to the memory addresses). Function equality // cannot be determined and will always fail. func Equalf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.Equalf(t, expected, actual, msg, args...) { return } t.FailNow() } // Error asserts that a function returned an error (i.e. not `nil`). // // actualObj, err := SomeFunction() // require.Error(t, err) func Error(t TestingT, err error, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.Error(t, err, msgAndArgs...) { return } t.FailNow() } // ErrorAs asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. // This is a wrapper for errors.As. func ErrorAs(t TestingT, err error, target interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.ErrorAs(t, err, target, msgAndArgs...) { return } t.FailNow() } // ErrorAsf asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. // This is a wrapper for errors.As. func ErrorAsf(t TestingT, err error, target interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.ErrorAsf(t, err, target, msg, args...) { return } t.FailNow() } // ErrorContains asserts that a function returned an error (i.e. not `nil`) // and that the error contains the specified substring. // // actualObj, err := SomeFunction() // require.ErrorContains(t, err, expectedErrorSubString) func ErrorContains(t TestingT, theError error, contains string, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.ErrorContains(t, theError, contains, msgAndArgs...) { return } t.FailNow() } // ErrorContainsf asserts that a function returned an error (i.e. not `nil`) // and that the error contains the specified substring. // // actualObj, err := SomeFunction() // require.ErrorContainsf(t, err, expectedErrorSubString, "error message %s", "formatted") func ErrorContainsf(t TestingT, theError error, contains string, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.ErrorContainsf(t, theError, contains, msg, args...) { return } t.FailNow() } // ErrorIs asserts that at least one of the errors in err's chain matches target. // This is a wrapper for errors.Is. func ErrorIs(t TestingT, err error, target error, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.ErrorIs(t, err, target, msgAndArgs...) { return } t.FailNow() } // ErrorIsf asserts that at least one of the errors in err's chain matches target. // This is a wrapper for errors.Is. func ErrorIsf(t TestingT, err error, target error, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.ErrorIsf(t, err, target, msg, args...) { return } t.FailNow() } // Errorf asserts that a function returned an error (i.e. not `nil`). // // actualObj, err := SomeFunction() // require.Errorf(t, err, "error message %s", "formatted") func Errorf(t TestingT, err error, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.Errorf(t, err, msg, args...) { return } t.FailNow() } // Eventually asserts that given condition will be met in waitFor time, // periodically checking target function each tick. // // require.Eventually(t, func() bool { return true; }, time.Second, 10*time.Millisecond) func Eventually(t TestingT, condition func() bool, waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.Eventually(t, condition, waitFor, tick, msgAndArgs...) { return } t.FailNow() } // EventuallyWithT asserts that given condition will be met in waitFor time, // periodically checking target function each tick. In contrast to Eventually, // it supplies a CollectT to the condition function, so that the condition // function can use the CollectT to call other assertions. // The condition is considered "met" if no errors are raised in a tick. // The supplied CollectT collects all errors from one tick (if there are any). // If the condition is not met before waitFor, the collected errors of // the last tick are copied to t. // // externalValue := false // go func() { // time.Sleep(8*time.Second) // externalValue = true // }() // require.EventuallyWithT(t, func(c *require.CollectT) { // // add assertions as needed; any assertion failure will fail the current tick // require.True(c, externalValue, "expected 'externalValue' to be true") // }, 10*time.Second, 1*time.Second, "external state has not changed to 'true'; still false") func EventuallyWithT(t TestingT, condition func(collect *assert.CollectT), waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.EventuallyWithT(t, condition, waitFor, tick, msgAndArgs...) { return } t.FailNow() } // EventuallyWithTf asserts that given condition will be met in waitFor time, // periodically checking target function each tick. In contrast to Eventually, // it supplies a CollectT to the condition function, so that the condition // function can use the CollectT to call other assertions. // The condition is considered "met" if no errors are raised in a tick. // The supplied CollectT collects all errors from one tick (if there are any). // If the condition is not met before waitFor, the collected errors of // the last tick are copied to t. // // externalValue := false // go func() { // time.Sleep(8*time.Second) // externalValue = true // }() // require.EventuallyWithTf(t, func(c *require.CollectT, "error message %s", "formatted") { // // add assertions as needed; any assertion failure will fail the current tick // require.True(c, externalValue, "expected 'externalValue' to be true") // }, 10*time.Second, 1*time.Second, "external state has not changed to 'true'; still false") func EventuallyWithTf(t TestingT, condition func(collect *assert.CollectT), waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.EventuallyWithTf(t, condition, waitFor, tick, msg, args...) { return } t.FailNow() } // Eventuallyf asserts that given condition will be met in waitFor time, // periodically checking target function each tick. // // require.Eventuallyf(t, func() bool { return true; }, time.Second, 10*time.Millisecond, "error message %s", "formatted") func Eventuallyf(t TestingT, condition func() bool, waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.Eventuallyf(t, condition, waitFor, tick, msg, args...) { return } t.FailNow() } // Exactly asserts that two objects are equal in value and type. // // require.Exactly(t, int32(123), int64(123)) func Exactly(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.Exactly(t, expected, actual, msgAndArgs...) { return } t.FailNow() } // Exactlyf asserts that two objects are equal in value and type. // // require.Exactlyf(t, int32(123), int64(123), "error message %s", "formatted") func Exactlyf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.Exactlyf(t, expected, actual, msg, args...) { return } t.FailNow() } // Fail reports a failure through func Fail(t TestingT, failureMessage string, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.Fail(t, failureMessage, msgAndArgs...) { return } t.FailNow() } // FailNow fails test func FailNow(t TestingT, failureMessage string, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.FailNow(t, failureMessage, msgAndArgs...) { return } t.FailNow() } // FailNowf fails test func FailNowf(t TestingT, failureMessage string, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.FailNowf(t, failureMessage, msg, args...) { return } t.FailNow() } // Failf reports a failure through func Failf(t TestingT, failureMessage string, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.Failf(t, failureMessage, msg, args...) { return } t.FailNow() } // False asserts that the specified value is false. // // require.False(t, myBool) func False(t TestingT, value bool, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.False(t, value, msgAndArgs...) { return } t.FailNow() } // Falsef asserts that the specified value is false. // // require.Falsef(t, myBool, "error message %s", "formatted") func Falsef(t TestingT, value bool, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.Falsef(t, value, msg, args...) { return } t.FailNow() } // FileExists checks whether a file exists in the given path. It also fails if // the path points to a directory or there is an error when trying to check the file. func FileExists(t TestingT, path string, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.FileExists(t, path, msgAndArgs...) { return } t.FailNow() } // FileExistsf checks whether a file exists in the given path. It also fails if // the path points to a directory or there is an error when trying to check the file. func FileExistsf(t TestingT, path string, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.FileExistsf(t, path, msg, args...) { return } t.FailNow() } // Greater asserts that the first element is greater than the second // // require.Greater(t, 2, 1) // require.Greater(t, float64(2), float64(1)) // require.Greater(t, "b", "a") func Greater(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.Greater(t, e1, e2, msgAndArgs...) { return } t.FailNow() } // GreaterOrEqual asserts that the first element is greater than or equal to the second // // require.GreaterOrEqual(t, 2, 1) // require.GreaterOrEqual(t, 2, 2) // require.GreaterOrEqual(t, "b", "a") // require.GreaterOrEqual(t, "b", "b") func GreaterOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.GreaterOrEqual(t, e1, e2, msgAndArgs...) { return } t.FailNow() } // GreaterOrEqualf asserts that the first element is greater than or equal to the second // // require.GreaterOrEqualf(t, 2, 1, "error message %s", "formatted") // require.GreaterOrEqualf(t, 2, 2, "error message %s", "formatted") // require.GreaterOrEqualf(t, "b", "a", "error message %s", "formatted") // require.GreaterOrEqualf(t, "b", "b", "error message %s", "formatted") func GreaterOrEqualf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.GreaterOrEqualf(t, e1, e2, msg, args...) { return } t.FailNow() } // Greaterf asserts that the first element is greater than the second // // require.Greaterf(t, 2, 1, "error message %s", "formatted") // require.Greaterf(t, float64(2), float64(1), "error message %s", "formatted") // require.Greaterf(t, "b", "a", "error message %s", "formatted") func Greaterf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.Greaterf(t, e1, e2, msg, args...) { return } t.FailNow() } // HTTPBodyContains asserts that a specified handler returns a // body that contains a string. // // require.HTTPBodyContains(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky") // // Returns whether the assertion was successful (true) or not (false). func HTTPBodyContains(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.HTTPBodyContains(t, handler, method, url, values, str, msgAndArgs...) { return } t.FailNow() } // HTTPBodyContainsf asserts that a specified handler returns a // body that contains a string. // // require.HTTPBodyContainsf(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted") // // Returns whether the assertion was successful (true) or not (false). func HTTPBodyContainsf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.HTTPBodyContainsf(t, handler, method, url, values, str, msg, args...) { return } t.FailNow() } // HTTPBodyNotContains asserts that a specified handler returns a // body that does not contain a string. // // require.HTTPBodyNotContains(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky") // // Returns whether the assertion was successful (true) or not (false). func HTTPBodyNotContains(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.HTTPBodyNotContains(t, handler, method, url, values, str, msgAndArgs...) { return } t.FailNow() } // HTTPBodyNotContainsf asserts that a specified handler returns a // body that does not contain a string. // // require.HTTPBodyNotContainsf(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted") // // Returns whether the assertion was successful (true) or not (false). func HTTPBodyNotContainsf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.HTTPBodyNotContainsf(t, handler, method, url, values, str, msg, args...) { return } t.FailNow() } // HTTPError asserts that a specified handler returns an error status code. // // require.HTTPError(t, myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}} // // Returns whether the assertion was successful (true) or not (false). func HTTPError(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.HTTPError(t, handler, method, url, values, msgAndArgs...) { return } t.FailNow() } // HTTPErrorf asserts that a specified handler returns an error status code. // // require.HTTPErrorf(t, myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}} // // Returns whether the assertion was successful (true) or not (false). func HTTPErrorf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.HTTPErrorf(t, handler, method, url, values, msg, args...) { return } t.FailNow() } // HTTPRedirect asserts that a specified handler returns a redirect status code. // // require.HTTPRedirect(t, myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}} // // Returns whether the assertion was successful (true) or not (false). func HTTPRedirect(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.HTTPRedirect(t, handler, method, url, values, msgAndArgs...) { return } t.FailNow() } // HTTPRedirectf asserts that a specified handler returns a redirect status code. // // require.HTTPRedirectf(t, myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}} // // Returns whether the assertion was successful (true) or not (false). func HTTPRedirectf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.HTTPRedirectf(t, handler, method, url, values, msg, args...) { return } t.FailNow() } // HTTPStatusCode asserts that a specified handler returns a specified status code. // // require.HTTPStatusCode(t, myHandler, "GET", "/notImplemented", nil, 501) // // Returns whether the assertion was successful (true) or not (false). func HTTPStatusCode(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.HTTPStatusCode(t, handler, method, url, values, statuscode, msgAndArgs...) { return } t.FailNow() } // HTTPStatusCodef asserts that a specified handler returns a specified status code. // // require.HTTPStatusCodef(t, myHandler, "GET", "/notImplemented", nil, 501, "error message %s", "formatted") // // Returns whether the assertion was successful (true) or not (false). func HTTPStatusCodef(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.HTTPStatusCodef(t, handler, method, url, values, statuscode, msg, args...) { return } t.FailNow() } // HTTPSuccess asserts that a specified handler returns a success status code. // // require.HTTPSuccess(t, myHandler, "POST", "http://www.google.com", nil) // // Returns whether the assertion was successful (true) or not (false). func HTTPSuccess(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.HTTPSuccess(t, handler, method, url, values, msgAndArgs...) { return } t.FailNow() } // HTTPSuccessf asserts that a specified handler returns a success status code. // // require.HTTPSuccessf(t, myHandler, "POST", "http://www.google.com", nil, "error message %s", "formatted") // // Returns whether the assertion was successful (true) or not (false). func HTTPSuccessf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.HTTPSuccessf(t, handler, method, url, values, msg, args...) { return } t.FailNow() } // Implements asserts that an object is implemented by the specified interface. // // require.Implements(t, (*MyInterface)(nil), new(MyObject)) func Implements(t TestingT, interfaceObject interface{}, object interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.Implements(t, interfaceObject, object, msgAndArgs...) { return } t.FailNow() } // Implementsf asserts that an object is implemented by the specified interface. // // require.Implementsf(t, (*MyInterface)(nil), new(MyObject), "error message %s", "formatted") func Implementsf(t TestingT, interfaceObject interface{}, object interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.Implementsf(t, interfaceObject, object, msg, args...) { return } t.FailNow() } // InDelta asserts that the two numerals are within delta of each other. // // require.InDelta(t, math.Pi, 22/7.0, 0.01) func InDelta(t TestingT, expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.InDelta(t, expected, actual, delta, msgAndArgs...) { return } t.FailNow() } // InDeltaMapValues is the same as InDelta, but it compares all values between two maps. Both maps must have exactly the same keys. func InDeltaMapValues(t TestingT, expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.InDeltaMapValues(t, expected, actual, delta, msgAndArgs...) { return } t.FailNow() } // InDeltaMapValuesf is the same as InDelta, but it compares all values between two maps. Both maps must have exactly the same keys. func InDeltaMapValuesf(t TestingT, expected interface{}, actual interface{}, delta float64, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.InDeltaMapValuesf(t, expected, actual, delta, msg, args...) { return } t.FailNow() } // InDeltaSlice is the same as InDelta, except it compares two slices. func InDeltaSlice(t TestingT, expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.InDeltaSlice(t, expected, actual, delta, msgAndArgs...) { return } t.FailNow() } // InDeltaSlicef is the same as InDelta, except it compares two slices. func InDeltaSlicef(t TestingT, expected interface{}, actual interface{}, delta float64, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.InDeltaSlicef(t, expected, actual, delta, msg, args...) { return } t.FailNow() } // InDeltaf asserts that the two numerals are within delta of each other. // // require.InDeltaf(t, math.Pi, 22/7.0, 0.01, "error message %s", "formatted") func InDeltaf(t TestingT, expected interface{}, actual interface{}, delta float64, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.InDeltaf(t, expected, actual, delta, msg, args...) { return } t.FailNow() } // InEpsilon asserts that expected and actual have a relative error less than epsilon func InEpsilon(t TestingT, expected interface{}, actual interface{}, epsilon float64, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.InEpsilon(t, expected, actual, epsilon, msgAndArgs...) { return } t.FailNow() } // InEpsilonSlice is the same as InEpsilon, except it compares each value from two slices. func InEpsilonSlice(t TestingT, expected interface{}, actual interface{}, epsilon float64, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.InEpsilonSlice(t, expected, actual, epsilon, msgAndArgs...) { return } t.FailNow() } // InEpsilonSlicef is the same as InEpsilon, except it compares each value from two slices. func InEpsilonSlicef(t TestingT, expected interface{}, actual interface{}, epsilon float64, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.InEpsilonSlicef(t, expected, actual, epsilon, msg, args...) { return } t.FailNow() } // InEpsilonf asserts that expected and actual have a relative error less than epsilon func InEpsilonf(t TestingT, expected interface{}, actual interface{}, epsilon float64, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.InEpsilonf(t, expected, actual, epsilon, msg, args...) { return } t.FailNow() } // IsDecreasing asserts that the collection is decreasing // // require.IsDecreasing(t, []int{2, 1, 0}) // require.IsDecreasing(t, []float{2, 1}) // require.IsDecreasing(t, []string{"b", "a"}) func IsDecreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.IsDecreasing(t, object, msgAndArgs...) { return } t.FailNow() } // IsDecreasingf asserts that the collection is decreasing // // require.IsDecreasingf(t, []int{2, 1, 0}, "error message %s", "formatted") // require.IsDecreasingf(t, []float{2, 1}, "error message %s", "formatted") // require.IsDecreasingf(t, []string{"b", "a"}, "error message %s", "formatted") func IsDecreasingf(t TestingT, object interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.IsDecreasingf(t, object, msg, args...) { return } t.FailNow() } // IsIncreasing asserts that the collection is increasing // // require.IsIncreasing(t, []int{1, 2, 3}) // require.IsIncreasing(t, []float{1, 2}) // require.IsIncreasing(t, []string{"a", "b"}) func IsIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.IsIncreasing(t, object, msgAndArgs...) { return } t.FailNow() } // IsIncreasingf asserts that the collection is increasing // // require.IsIncreasingf(t, []int{1, 2, 3}, "error message %s", "formatted") // require.IsIncreasingf(t, []float{1, 2}, "error message %s", "formatted") // require.IsIncreasingf(t, []string{"a", "b"}, "error message %s", "formatted") func IsIncreasingf(t TestingT, object interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.IsIncreasingf(t, object, msg, args...) { return } t.FailNow() } // IsNonDecreasing asserts that the collection is not decreasing // // require.IsNonDecreasing(t, []int{1, 1, 2}) // require.IsNonDecreasing(t, []float{1, 2}) // require.IsNonDecreasing(t, []string{"a", "b"}) func IsNonDecreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.IsNonDecreasing(t, object, msgAndArgs...) { return } t.FailNow() } // IsNonDecreasingf asserts that the collection is not decreasing // // require.IsNonDecreasingf(t, []int{1, 1, 2}, "error message %s", "formatted") // require.IsNonDecreasingf(t, []float{1, 2}, "error message %s", "formatted") // require.IsNonDecreasingf(t, []string{"a", "b"}, "error message %s", "formatted") func IsNonDecreasingf(t TestingT, object interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.IsNonDecreasingf(t, object, msg, args...) { return } t.FailNow() } // IsNonIncreasing asserts that the collection is not increasing // // require.IsNonIncreasing(t, []int{2, 1, 1}) // require.IsNonIncreasing(t, []float{2, 1}) // require.IsNonIncreasing(t, []string{"b", "a"}) func IsNonIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.IsNonIncreasing(t, object, msgAndArgs...) { return } t.FailNow() } // IsNonIncreasingf asserts that the collection is not increasing // // require.IsNonIncreasingf(t, []int{2, 1, 1}, "error message %s", "formatted") // require.IsNonIncreasingf(t, []float{2, 1}, "error message %s", "formatted") // require.IsNonIncreasingf(t, []string{"b", "a"}, "error message %s", "formatted") func IsNonIncreasingf(t TestingT, object interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.IsNonIncreasingf(t, object, msg, args...) { return } t.FailNow() } // IsNotType asserts that the specified objects are not of the same type. // // require.IsNotType(t, &NotMyStruct{}, &MyStruct{}) func IsNotType(t TestingT, theType interface{}, object interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.IsNotType(t, theType, object, msgAndArgs...) { return } t.FailNow() } // IsNotTypef asserts that the specified objects are not of the same type. // // require.IsNotTypef(t, &NotMyStruct{}, &MyStruct{}, "error message %s", "formatted") func IsNotTypef(t TestingT, theType interface{}, object interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.IsNotTypef(t, theType, object, msg, args...) { return } t.FailNow() } // IsType asserts that the specified objects are of the same type. // // require.IsType(t, &MyStruct{}, &MyStruct{}) func IsType(t TestingT, expectedType interface{}, object interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.IsType(t, expectedType, object, msgAndArgs...) { return } t.FailNow() } // IsTypef asserts that the specified objects are of the same type. // // require.IsTypef(t, &MyStruct{}, &MyStruct{}, "error message %s", "formatted") func IsTypef(t TestingT, expectedType interface{}, object interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.IsTypef(t, expectedType, object, msg, args...) { return } t.FailNow() } // JSONEq asserts that two JSON strings are equivalent. // // require.JSONEq(t, `{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`) func JSONEq(t TestingT, expected string, actual string, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.JSONEq(t, expected, actual, msgAndArgs...) { return } t.FailNow() } // JSONEqf asserts that two JSON strings are equivalent. // // require.JSONEqf(t, `{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`, "error message %s", "formatted") func JSONEqf(t TestingT, expected string, actual string, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.JSONEqf(t, expected, actual, msg, args...) { return } t.FailNow() } // Len asserts that the specified object has specific length. // Len also fails if the object has a type that len() not accept. // // require.Len(t, mySlice, 3) func Len(t TestingT, object interface{}, length int, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.Len(t, object, length, msgAndArgs...) { return } t.FailNow() } // Lenf asserts that the specified object has specific length. // Lenf also fails if the object has a type that len() not accept. // // require.Lenf(t, mySlice, 3, "error message %s", "formatted") func Lenf(t TestingT, object interface{}, length int, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.Lenf(t, object, length, msg, args...) { return } t.FailNow() } // Less asserts that the first element is less than the second // // require.Less(t, 1, 2) // require.Less(t, float64(1), float64(2)) // require.Less(t, "a", "b") func Less(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.Less(t, e1, e2, msgAndArgs...) { return } t.FailNow() } // LessOrEqual asserts that the first element is less than or equal to the second // // require.LessOrEqual(t, 1, 2) // require.LessOrEqual(t, 2, 2) // require.LessOrEqual(t, "a", "b") // require.LessOrEqual(t, "b", "b") func LessOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.LessOrEqual(t, e1, e2, msgAndArgs...) { return } t.FailNow() } // LessOrEqualf asserts that the first element is less than or equal to the second // // require.LessOrEqualf(t, 1, 2, "error message %s", "formatted") // require.LessOrEqualf(t, 2, 2, "error message %s", "formatted") // require.LessOrEqualf(t, "a", "b", "error message %s", "formatted") // require.LessOrEqualf(t, "b", "b", "error message %s", "formatted") func LessOrEqualf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.LessOrEqualf(t, e1, e2, msg, args...) { return } t.FailNow() } // Lessf asserts that the first element is less than the second // // require.Lessf(t, 1, 2, "error message %s", "formatted") // require.Lessf(t, float64(1), float64(2), "error message %s", "formatted") // require.Lessf(t, "a", "b", "error message %s", "formatted") func Lessf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.Lessf(t, e1, e2, msg, args...) { return } t.FailNow() } // Negative asserts that the specified element is negative // // require.Negative(t, -1) // require.Negative(t, -1.23) func Negative(t TestingT, e interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.Negative(t, e, msgAndArgs...) { return } t.FailNow() } // Negativef asserts that the specified element is negative // // require.Negativef(t, -1, "error message %s", "formatted") // require.Negativef(t, -1.23, "error message %s", "formatted") func Negativef(t TestingT, e interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.Negativef(t, e, msg, args...) { return } t.FailNow() } // Never asserts that the given condition doesn't satisfy in waitFor time, // periodically checking the target function each tick. // // require.Never(t, func() bool { return false; }, time.Second, 10*time.Millisecond) func Never(t TestingT, condition func() bool, waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.Never(t, condition, waitFor, tick, msgAndArgs...) { return } t.FailNow() } // Neverf asserts that the given condition doesn't satisfy in waitFor time, // periodically checking the target function each tick. // // require.Neverf(t, func() bool { return false; }, time.Second, 10*time.Millisecond, "error message %s", "formatted") func Neverf(t TestingT, condition func() bool, waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.Neverf(t, condition, waitFor, tick, msg, args...) { return } t.FailNow() } // Nil asserts that the specified object is nil. // // require.Nil(t, err) func Nil(t TestingT, object interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.Nil(t, object, msgAndArgs...) { return } t.FailNow() } // Nilf asserts that the specified object is nil. // // require.Nilf(t, err, "error message %s", "formatted") func Nilf(t TestingT, object interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.Nilf(t, object, msg, args...) { return } t.FailNow() } // NoDirExists checks whether a directory does not exist in the given path. // It fails if the path points to an existing _directory_ only. func NoDirExists(t TestingT, path string, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.NoDirExists(t, path, msgAndArgs...) { return } t.FailNow() } // NoDirExistsf checks whether a directory does not exist in the given path. // It fails if the path points to an existing _directory_ only. func NoDirExistsf(t TestingT, path string, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.NoDirExistsf(t, path, msg, args...) { return } t.FailNow() } // NoError asserts that a function returned no error (i.e. `nil`). // // actualObj, err := SomeFunction() // if require.NoError(t, err) { // require.Equal(t, expectedObj, actualObj) // } func NoError(t TestingT, err error, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.NoError(t, err, msgAndArgs...) { return } t.FailNow() } // NoErrorf asserts that a function returned no error (i.e. `nil`). // // actualObj, err := SomeFunction() // if require.NoErrorf(t, err, "error message %s", "formatted") { // require.Equal(t, expectedObj, actualObj) // } func NoErrorf(t TestingT, err error, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.NoErrorf(t, err, msg, args...) { return } t.FailNow() } // NoFileExists checks whether a file does not exist in a given path. It fails // if the path points to an existing _file_ only. func NoFileExists(t TestingT, path string, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.NoFileExists(t, path, msgAndArgs...) { return } t.FailNow() } // NoFileExistsf checks whether a file does not exist in a given path. It fails // if the path points to an existing _file_ only. func NoFileExistsf(t TestingT, path string, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.NoFileExistsf(t, path, msg, args...) { return } t.FailNow() } // NotContains asserts that the specified string, list(array, slice...) or map does NOT contain the // specified substring or element. // // require.NotContains(t, "Hello World", "Earth") // require.NotContains(t, ["Hello", "World"], "Earth") // require.NotContains(t, {"Hello": "World"}, "Earth") func NotContains(t TestingT, s interface{}, contains interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.NotContains(t, s, contains, msgAndArgs...) { return } t.FailNow() } // NotContainsf asserts that the specified string, list(array, slice...) or map does NOT contain the // specified substring or element. // // require.NotContainsf(t, "Hello World", "Earth", "error message %s", "formatted") // require.NotContainsf(t, ["Hello", "World"], "Earth", "error message %s", "formatted") // require.NotContainsf(t, {"Hello": "World"}, "Earth", "error message %s", "formatted") func NotContainsf(t TestingT, s interface{}, contains interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.NotContainsf(t, s, contains, msg, args...) { return } t.FailNow() } // NotElementsMatch asserts that the specified listA(array, slice...) is NOT equal to specified // listB(array, slice...) ignoring the order of the elements. If there are duplicate elements, // the number of appearances of each of them in both lists should not match. // This is an inverse of ElementsMatch. // // require.NotElementsMatch(t, [1, 1, 2, 3], [1, 1, 2, 3]) -> false // // require.NotElementsMatch(t, [1, 1, 2, 3], [1, 2, 3]) -> true // // require.NotElementsMatch(t, [1, 2, 3], [1, 2, 4]) -> true func NotElementsMatch(t TestingT, listA interface{}, listB interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.NotElementsMatch(t, listA, listB, msgAndArgs...) { return } t.FailNow() } // NotElementsMatchf asserts that the specified listA(array, slice...) is NOT equal to specified // listB(array, slice...) ignoring the order of the elements. If there are duplicate elements, // the number of appearances of each of them in both lists should not match. // This is an inverse of ElementsMatch. // // require.NotElementsMatchf(t, [1, 1, 2, 3], [1, 1, 2, 3], "error message %s", "formatted") -> false // // require.NotElementsMatchf(t, [1, 1, 2, 3], [1, 2, 3], "error message %s", "formatted") -> true // // require.NotElementsMatchf(t, [1, 2, 3], [1, 2, 4], "error message %s", "formatted") -> true func NotElementsMatchf(t TestingT, listA interface{}, listB interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.NotElementsMatchf(t, listA, listB, msg, args...) { return } t.FailNow() } // NotEmpty asserts that the specified object is NOT [Empty]. // // if require.NotEmpty(t, obj) { // require.Equal(t, "two", obj[1]) // } func NotEmpty(t TestingT, object interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.NotEmpty(t, object, msgAndArgs...) { return } t.FailNow() } // NotEmptyf asserts that the specified object is NOT [Empty]. // // if require.NotEmptyf(t, obj, "error message %s", "formatted") { // require.Equal(t, "two", obj[1]) // } func NotEmptyf(t TestingT, object interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.NotEmptyf(t, object, msg, args...) { return } t.FailNow() } // NotEqual asserts that the specified values are NOT equal. // // require.NotEqual(t, obj1, obj2) // // Pointer variable equality is determined based on the equality of the // referenced values (as opposed to the memory addresses). func NotEqual(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.NotEqual(t, expected, actual, msgAndArgs...) { return } t.FailNow() } // NotEqualValues asserts that two objects are not equal even when converted to the same type // // require.NotEqualValues(t, obj1, obj2) func NotEqualValues(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.NotEqualValues(t, expected, actual, msgAndArgs...) { return } t.FailNow() } // NotEqualValuesf asserts that two objects are not equal even when converted to the same type // // require.NotEqualValuesf(t, obj1, obj2, "error message %s", "formatted") func NotEqualValuesf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.NotEqualValuesf(t, expected, actual, msg, args...) { return } t.FailNow() } // NotEqualf asserts that the specified values are NOT equal. // // require.NotEqualf(t, obj1, obj2, "error message %s", "formatted") // // Pointer variable equality is determined based on the equality of the // referenced values (as opposed to the memory addresses). func NotEqualf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.NotEqualf(t, expected, actual, msg, args...) { return } t.FailNow() } // NotErrorAs asserts that none of the errors in err's chain matches target, // but if so, sets target to that error value. func NotErrorAs(t TestingT, err error, target interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.NotErrorAs(t, err, target, msgAndArgs...) { return } t.FailNow() } // NotErrorAsf asserts that none of the errors in err's chain matches target, // but if so, sets target to that error value. func NotErrorAsf(t TestingT, err error, target interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.NotErrorAsf(t, err, target, msg, args...) { return } t.FailNow() } // NotErrorIs asserts that none of the errors in err's chain matches target. // This is a wrapper for errors.Is. func NotErrorIs(t TestingT, err error, target error, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.NotErrorIs(t, err, target, msgAndArgs...) { return } t.FailNow() } // NotErrorIsf asserts that none of the errors in err's chain matches target. // This is a wrapper for errors.Is. func NotErrorIsf(t TestingT, err error, target error, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.NotErrorIsf(t, err, target, msg, args...) { return } t.FailNow() } // NotImplements asserts that an object does not implement the specified interface. // // require.NotImplements(t, (*MyInterface)(nil), new(MyObject)) func NotImplements(t TestingT, interfaceObject interface{}, object interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.NotImplements(t, interfaceObject, object, msgAndArgs...) { return } t.FailNow() } // NotImplementsf asserts that an object does not implement the specified interface. // // require.NotImplementsf(t, (*MyInterface)(nil), new(MyObject), "error message %s", "formatted") func NotImplementsf(t TestingT, interfaceObject interface{}, object interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.NotImplementsf(t, interfaceObject, object, msg, args...) { return } t.FailNow() } // NotNil asserts that the specified object is not nil. // // require.NotNil(t, err) func NotNil(t TestingT, object interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.NotNil(t, object, msgAndArgs...) { return } t.FailNow() } // NotNilf asserts that the specified object is not nil. // // require.NotNilf(t, err, "error message %s", "formatted") func NotNilf(t TestingT, object interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.NotNilf(t, object, msg, args...) { return } t.FailNow() } // NotPanics asserts that the code inside the specified PanicTestFunc does NOT panic. // // require.NotPanics(t, func(){ RemainCalm() }) func NotPanics(t TestingT, f assert.PanicTestFunc, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.NotPanics(t, f, msgAndArgs...) { return } t.FailNow() } // NotPanicsf asserts that the code inside the specified PanicTestFunc does NOT panic. // // require.NotPanicsf(t, func(){ RemainCalm() }, "error message %s", "formatted") func NotPanicsf(t TestingT, f assert.PanicTestFunc, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.NotPanicsf(t, f, msg, args...) { return } t.FailNow() } // NotRegexp asserts that a specified regexp does not match a string. // // require.NotRegexp(t, regexp.MustCompile("starts"), "it's starting") // require.NotRegexp(t, "^start", "it's not starting") func NotRegexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.NotRegexp(t, rx, str, msgAndArgs...) { return } t.FailNow() } // NotRegexpf asserts that a specified regexp does not match a string. // // require.NotRegexpf(t, regexp.MustCompile("starts"), "it's starting", "error message %s", "formatted") // require.NotRegexpf(t, "^start", "it's not starting", "error message %s", "formatted") func NotRegexpf(t TestingT, rx interface{}, str interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.NotRegexpf(t, rx, str, msg, args...) { return } t.FailNow() } // NotSame asserts that two pointers do not reference the same object. // // require.NotSame(t, ptr1, ptr2) // // Both arguments must be pointer variables. Pointer variable sameness is // determined based on the equality of both type and value. func NotSame(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.NotSame(t, expected, actual, msgAndArgs...) { return } t.FailNow() } // NotSamef asserts that two pointers do not reference the same object. // // require.NotSamef(t, ptr1, ptr2, "error message %s", "formatted") // // Both arguments must be pointer variables. Pointer variable sameness is // determined based on the equality of both type and value. func NotSamef(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.NotSamef(t, expected, actual, msg, args...) { return } t.FailNow() } // NotSubset asserts that the list (array, slice, or map) does NOT contain all // elements given in the subset (array, slice, or map). // Map elements are key-value pairs unless compared with an array or slice where // only the map key is evaluated. // // require.NotSubset(t, [1, 3, 4], [1, 2]) // require.NotSubset(t, {"x": 1, "y": 2}, {"z": 3}) // require.NotSubset(t, [1, 3, 4], {1: "one", 2: "two"}) // require.NotSubset(t, {"x": 1, "y": 2}, ["z"]) func NotSubset(t TestingT, list interface{}, subset interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.NotSubset(t, list, subset, msgAndArgs...) { return } t.FailNow() } // NotSubsetf asserts that the list (array, slice, or map) does NOT contain all // elements given in the subset (array, slice, or map). // Map elements are key-value pairs unless compared with an array or slice where // only the map key is evaluated. // // require.NotSubsetf(t, [1, 3, 4], [1, 2], "error message %s", "formatted") // require.NotSubsetf(t, {"x": 1, "y": 2}, {"z": 3}, "error message %s", "formatted") // require.NotSubsetf(t, [1, 3, 4], {1: "one", 2: "two"}, "error message %s", "formatted") // require.NotSubsetf(t, {"x": 1, "y": 2}, ["z"], "error message %s", "formatted") func NotSubsetf(t TestingT, list interface{}, subset interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.NotSubsetf(t, list, subset, msg, args...) { return } t.FailNow() } // NotZero asserts that i is not the zero value for its type. func NotZero(t TestingT, i interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.NotZero(t, i, msgAndArgs...) { return } t.FailNow() } // NotZerof asserts that i is not the zero value for its type. func NotZerof(t TestingT, i interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.NotZerof(t, i, msg, args...) { return } t.FailNow() } // Panics asserts that the code inside the specified PanicTestFunc panics. // // require.Panics(t, func(){ GoCrazy() }) func Panics(t TestingT, f assert.PanicTestFunc, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.Panics(t, f, msgAndArgs...) { return } t.FailNow() } // PanicsWithError asserts that the code inside the specified PanicTestFunc // panics, and that the recovered panic value is an error that satisfies the // EqualError comparison. // // require.PanicsWithError(t, "crazy error", func(){ GoCrazy() }) func PanicsWithError(t TestingT, errString string, f assert.PanicTestFunc, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.PanicsWithError(t, errString, f, msgAndArgs...) { return } t.FailNow() } // PanicsWithErrorf asserts that the code inside the specified PanicTestFunc // panics, and that the recovered panic value is an error that satisfies the // EqualError comparison. // // require.PanicsWithErrorf(t, "crazy error", func(){ GoCrazy() }, "error message %s", "formatted") func PanicsWithErrorf(t TestingT, errString string, f assert.PanicTestFunc, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.PanicsWithErrorf(t, errString, f, msg, args...) { return } t.FailNow() } // PanicsWithValue asserts that the code inside the specified PanicTestFunc panics, and that // the recovered panic value equals the expected panic value. // // require.PanicsWithValue(t, "crazy error", func(){ GoCrazy() }) func PanicsWithValue(t TestingT, expected interface{}, f assert.PanicTestFunc, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.PanicsWithValue(t, expected, f, msgAndArgs...) { return } t.FailNow() } // PanicsWithValuef asserts that the code inside the specified PanicTestFunc panics, and that // the recovered panic value equals the expected panic value. // // require.PanicsWithValuef(t, "crazy error", func(){ GoCrazy() }, "error message %s", "formatted") func PanicsWithValuef(t TestingT, expected interface{}, f assert.PanicTestFunc, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.PanicsWithValuef(t, expected, f, msg, args...) { return } t.FailNow() } // Panicsf asserts that the code inside the specified PanicTestFunc panics. // // require.Panicsf(t, func(){ GoCrazy() }, "error message %s", "formatted") func Panicsf(t TestingT, f assert.PanicTestFunc, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.Panicsf(t, f, msg, args...) { return } t.FailNow() } // Positive asserts that the specified element is positive // // require.Positive(t, 1) // require.Positive(t, 1.23) func Positive(t TestingT, e interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.Positive(t, e, msgAndArgs...) { return } t.FailNow() } // Positivef asserts that the specified element is positive // // require.Positivef(t, 1, "error message %s", "formatted") // require.Positivef(t, 1.23, "error message %s", "formatted") func Positivef(t TestingT, e interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.Positivef(t, e, msg, args...) { return } t.FailNow() } // Regexp asserts that a specified regexp matches a string. // // require.Regexp(t, regexp.MustCompile("start"), "it's starting") // require.Regexp(t, "start...$", "it's not starting") func Regexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.Regexp(t, rx, str, msgAndArgs...) { return } t.FailNow() } // Regexpf asserts that a specified regexp matches a string. // // require.Regexpf(t, regexp.MustCompile("start"), "it's starting", "error message %s", "formatted") // require.Regexpf(t, "start...$", "it's not starting", "error message %s", "formatted") func Regexpf(t TestingT, rx interface{}, str interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.Regexpf(t, rx, str, msg, args...) { return } t.FailNow() } // Same asserts that two pointers reference the same object. // // require.Same(t, ptr1, ptr2) // // Both arguments must be pointer variables. Pointer variable sameness is // determined based on the equality of both type and value. func Same(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.Same(t, expected, actual, msgAndArgs...) { return } t.FailNow() } // Samef asserts that two pointers reference the same object. // // require.Samef(t, ptr1, ptr2, "error message %s", "formatted") // // Both arguments must be pointer variables. Pointer variable sameness is // determined based on the equality of both type and value. func Samef(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.Samef(t, expected, actual, msg, args...) { return } t.FailNow() } // Subset asserts that the list (array, slice, or map) contains all elements // given in the subset (array, slice, or map). // Map elements are key-value pairs unless compared with an array or slice where // only the map key is evaluated. // // require.Subset(t, [1, 2, 3], [1, 2]) // require.Subset(t, {"x": 1, "y": 2}, {"x": 1}) // require.Subset(t, [1, 2, 3], {1: "one", 2: "two"}) // require.Subset(t, {"x": 1, "y": 2}, ["x"]) func Subset(t TestingT, list interface{}, subset interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.Subset(t, list, subset, msgAndArgs...) { return } t.FailNow() } // Subsetf asserts that the list (array, slice, or map) contains all elements // given in the subset (array, slice, or map). // Map elements are key-value pairs unless compared with an array or slice where // only the map key is evaluated. // // require.Subsetf(t, [1, 2, 3], [1, 2], "error message %s", "formatted") // require.Subsetf(t, {"x": 1, "y": 2}, {"x": 1}, "error message %s", "formatted") // require.Subsetf(t, [1, 2, 3], {1: "one", 2: "two"}, "error message %s", "formatted") // require.Subsetf(t, {"x": 1, "y": 2}, ["x"], "error message %s", "formatted") func Subsetf(t TestingT, list interface{}, subset interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.Subsetf(t, list, subset, msg, args...) { return } t.FailNow() } // True asserts that the specified value is true. // // require.True(t, myBool) func True(t TestingT, value bool, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.True(t, value, msgAndArgs...) { return } t.FailNow() } // Truef asserts that the specified value is true. // // require.Truef(t, myBool, "error message %s", "formatted") func Truef(t TestingT, value bool, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.Truef(t, value, msg, args...) { return } t.FailNow() } // WithinDuration asserts that the two times are within duration delta of each other. // // require.WithinDuration(t, time.Now(), time.Now(), 10*time.Second) func WithinDuration(t TestingT, expected time.Time, actual time.Time, delta time.Duration, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.WithinDuration(t, expected, actual, delta, msgAndArgs...) { return } t.FailNow() } // WithinDurationf asserts that the two times are within duration delta of each other. // // require.WithinDurationf(t, time.Now(), time.Now(), 10*time.Second, "error message %s", "formatted") func WithinDurationf(t TestingT, expected time.Time, actual time.Time, delta time.Duration, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.WithinDurationf(t, expected, actual, delta, msg, args...) { return } t.FailNow() } // WithinRange asserts that a time is within a time range (inclusive). // // require.WithinRange(t, time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second)) func WithinRange(t TestingT, actual time.Time, start time.Time, end time.Time, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.WithinRange(t, actual, start, end, msgAndArgs...) { return } t.FailNow() } // WithinRangef asserts that a time is within a time range (inclusive). // // require.WithinRangef(t, time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second), "error message %s", "formatted") func WithinRangef(t TestingT, actual time.Time, start time.Time, end time.Time, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.WithinRangef(t, actual, start, end, msg, args...) { return } t.FailNow() } // YAMLEq asserts that two YAML strings are equivalent. func YAMLEq(t TestingT, expected string, actual string, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.YAMLEq(t, expected, actual, msgAndArgs...) { return } t.FailNow() } // YAMLEqf asserts that two YAML strings are equivalent. func YAMLEqf(t TestingT, expected string, actual string, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.YAMLEqf(t, expected, actual, msg, args...) { return } t.FailNow() } // Zero asserts that i is the zero value for its type. func Zero(t TestingT, i interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.Zero(t, i, msgAndArgs...) { return } t.FailNow() } // Zerof asserts that i is the zero value for its type. func Zerof(t TestingT, i interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.Zerof(t, i, msg, args...) { return } t.FailNow() } ================================================ FILE: vendor/github.com/stretchr/testify/require/require.go.tmpl ================================================ {{ replace .Comment "assert." "require."}} func {{.DocInfo.Name}}(t TestingT, {{.Params}}) { if h, ok := t.(tHelper); ok { h.Helper() } if assert.{{.DocInfo.Name}}(t, {{.ForwardedParams}}) { return } t.FailNow() } ================================================ FILE: vendor/github.com/stretchr/testify/require/require_forward.go ================================================ // Code generated with github.com/stretchr/testify/_codegen; DO NOT EDIT. package require import ( assert "github.com/stretchr/testify/assert" http "net/http" url "net/url" time "time" ) // Condition uses a Comparison to assert a complex condition. func (a *Assertions) Condition(comp assert.Comparison, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } Condition(a.t, comp, msgAndArgs...) } // Conditionf uses a Comparison to assert a complex condition. func (a *Assertions) Conditionf(comp assert.Comparison, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } Conditionf(a.t, comp, msg, args...) } // Contains asserts that the specified string, list(array, slice...) or map contains the // specified substring or element. // // a.Contains("Hello World", "World") // a.Contains(["Hello", "World"], "World") // a.Contains({"Hello": "World"}, "Hello") func (a *Assertions) Contains(s interface{}, contains interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } Contains(a.t, s, contains, msgAndArgs...) } // Containsf asserts that the specified string, list(array, slice...) or map contains the // specified substring or element. // // a.Containsf("Hello World", "World", "error message %s", "formatted") // a.Containsf(["Hello", "World"], "World", "error message %s", "formatted") // a.Containsf({"Hello": "World"}, "Hello", "error message %s", "formatted") func (a *Assertions) Containsf(s interface{}, contains interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } Containsf(a.t, s, contains, msg, args...) } // DirExists checks whether a directory exists in the given path. It also fails // if the path is a file rather a directory or there is an error checking whether it exists. func (a *Assertions) DirExists(path string, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } DirExists(a.t, path, msgAndArgs...) } // DirExistsf checks whether a directory exists in the given path. It also fails // if the path is a file rather a directory or there is an error checking whether it exists. func (a *Assertions) DirExistsf(path string, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } DirExistsf(a.t, path, msg, args...) } // ElementsMatch asserts that the specified listA(array, slice...) is equal to specified // listB(array, slice...) ignoring the order of the elements. If there are duplicate elements, // the number of appearances of each of them in both lists should match. // // a.ElementsMatch([1, 3, 2, 3], [1, 3, 3, 2]) func (a *Assertions) ElementsMatch(listA interface{}, listB interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } ElementsMatch(a.t, listA, listB, msgAndArgs...) } // ElementsMatchf asserts that the specified listA(array, slice...) is equal to specified // listB(array, slice...) ignoring the order of the elements. If there are duplicate elements, // the number of appearances of each of them in both lists should match. // // a.ElementsMatchf([1, 3, 2, 3], [1, 3, 3, 2], "error message %s", "formatted") func (a *Assertions) ElementsMatchf(listA interface{}, listB interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } ElementsMatchf(a.t, listA, listB, msg, args...) } // Empty asserts that the given value is "empty". // // [Zero values] are "empty". // // Arrays are "empty" if every element is the zero value of the type (stricter than "empty"). // // Slices, maps and channels with zero length are "empty". // // Pointer values are "empty" if the pointer is nil or if the pointed value is "empty". // // a.Empty(obj) // // [Zero values]: https://go.dev/ref/spec#The_zero_value func (a *Assertions) Empty(object interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } Empty(a.t, object, msgAndArgs...) } // Emptyf asserts that the given value is "empty". // // [Zero values] are "empty". // // Arrays are "empty" if every element is the zero value of the type (stricter than "empty"). // // Slices, maps and channels with zero length are "empty". // // Pointer values are "empty" if the pointer is nil or if the pointed value is "empty". // // a.Emptyf(obj, "error message %s", "formatted") // // [Zero values]: https://go.dev/ref/spec#The_zero_value func (a *Assertions) Emptyf(object interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } Emptyf(a.t, object, msg, args...) } // Equal asserts that two objects are equal. // // a.Equal(123, 123) // // Pointer variable equality is determined based on the equality of the // referenced values (as opposed to the memory addresses). Function equality // cannot be determined and will always fail. func (a *Assertions) Equal(expected interface{}, actual interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } Equal(a.t, expected, actual, msgAndArgs...) } // EqualError asserts that a function returned an error (i.e. not `nil`) // and that it is equal to the provided error. // // actualObj, err := SomeFunction() // a.EqualError(err, expectedErrorString) func (a *Assertions) EqualError(theError error, errString string, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } EqualError(a.t, theError, errString, msgAndArgs...) } // EqualErrorf asserts that a function returned an error (i.e. not `nil`) // and that it is equal to the provided error. // // actualObj, err := SomeFunction() // a.EqualErrorf(err, expectedErrorString, "error message %s", "formatted") func (a *Assertions) EqualErrorf(theError error, errString string, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } EqualErrorf(a.t, theError, errString, msg, args...) } // EqualExportedValues asserts that the types of two objects are equal and their public // fields are also equal. This is useful for comparing structs that have private fields // that could potentially differ. // // type S struct { // Exported int // notExported int // } // a.EqualExportedValues(S{1, 2}, S{1, 3}) => true // a.EqualExportedValues(S{1, 2}, S{2, 3}) => false func (a *Assertions) EqualExportedValues(expected interface{}, actual interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } EqualExportedValues(a.t, expected, actual, msgAndArgs...) } // EqualExportedValuesf asserts that the types of two objects are equal and their public // fields are also equal. This is useful for comparing structs that have private fields // that could potentially differ. // // type S struct { // Exported int // notExported int // } // a.EqualExportedValuesf(S{1, 2}, S{1, 3}, "error message %s", "formatted") => true // a.EqualExportedValuesf(S{1, 2}, S{2, 3}, "error message %s", "formatted") => false func (a *Assertions) EqualExportedValuesf(expected interface{}, actual interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } EqualExportedValuesf(a.t, expected, actual, msg, args...) } // EqualValues asserts that two objects are equal or convertible to the larger // type and equal. // // a.EqualValues(uint32(123), int32(123)) func (a *Assertions) EqualValues(expected interface{}, actual interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } EqualValues(a.t, expected, actual, msgAndArgs...) } // EqualValuesf asserts that two objects are equal or convertible to the larger // type and equal. // // a.EqualValuesf(uint32(123), int32(123), "error message %s", "formatted") func (a *Assertions) EqualValuesf(expected interface{}, actual interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } EqualValuesf(a.t, expected, actual, msg, args...) } // Equalf asserts that two objects are equal. // // a.Equalf(123, 123, "error message %s", "formatted") // // Pointer variable equality is determined based on the equality of the // referenced values (as opposed to the memory addresses). Function equality // cannot be determined and will always fail. func (a *Assertions) Equalf(expected interface{}, actual interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } Equalf(a.t, expected, actual, msg, args...) } // Error asserts that a function returned an error (i.e. not `nil`). // // actualObj, err := SomeFunction() // a.Error(err) func (a *Assertions) Error(err error, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } Error(a.t, err, msgAndArgs...) } // ErrorAs asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. // This is a wrapper for errors.As. func (a *Assertions) ErrorAs(err error, target interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } ErrorAs(a.t, err, target, msgAndArgs...) } // ErrorAsf asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. // This is a wrapper for errors.As. func (a *Assertions) ErrorAsf(err error, target interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } ErrorAsf(a.t, err, target, msg, args...) } // ErrorContains asserts that a function returned an error (i.e. not `nil`) // and that the error contains the specified substring. // // actualObj, err := SomeFunction() // a.ErrorContains(err, expectedErrorSubString) func (a *Assertions) ErrorContains(theError error, contains string, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } ErrorContains(a.t, theError, contains, msgAndArgs...) } // ErrorContainsf asserts that a function returned an error (i.e. not `nil`) // and that the error contains the specified substring. // // actualObj, err := SomeFunction() // a.ErrorContainsf(err, expectedErrorSubString, "error message %s", "formatted") func (a *Assertions) ErrorContainsf(theError error, contains string, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } ErrorContainsf(a.t, theError, contains, msg, args...) } // ErrorIs asserts that at least one of the errors in err's chain matches target. // This is a wrapper for errors.Is. func (a *Assertions) ErrorIs(err error, target error, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } ErrorIs(a.t, err, target, msgAndArgs...) } // ErrorIsf asserts that at least one of the errors in err's chain matches target. // This is a wrapper for errors.Is. func (a *Assertions) ErrorIsf(err error, target error, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } ErrorIsf(a.t, err, target, msg, args...) } // Errorf asserts that a function returned an error (i.e. not `nil`). // // actualObj, err := SomeFunction() // a.Errorf(err, "error message %s", "formatted") func (a *Assertions) Errorf(err error, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } Errorf(a.t, err, msg, args...) } // Eventually asserts that given condition will be met in waitFor time, // periodically checking target function each tick. // // a.Eventually(func() bool { return true; }, time.Second, 10*time.Millisecond) func (a *Assertions) Eventually(condition func() bool, waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } Eventually(a.t, condition, waitFor, tick, msgAndArgs...) } // EventuallyWithT asserts that given condition will be met in waitFor time, // periodically checking target function each tick. In contrast to Eventually, // it supplies a CollectT to the condition function, so that the condition // function can use the CollectT to call other assertions. // The condition is considered "met" if no errors are raised in a tick. // The supplied CollectT collects all errors from one tick (if there are any). // If the condition is not met before waitFor, the collected errors of // the last tick are copied to t. // // externalValue := false // go func() { // time.Sleep(8*time.Second) // externalValue = true // }() // a.EventuallyWithT(func(c *assert.CollectT) { // // add assertions as needed; any assertion failure will fail the current tick // assert.True(c, externalValue, "expected 'externalValue' to be true") // }, 10*time.Second, 1*time.Second, "external state has not changed to 'true'; still false") func (a *Assertions) EventuallyWithT(condition func(collect *assert.CollectT), waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } EventuallyWithT(a.t, condition, waitFor, tick, msgAndArgs...) } // EventuallyWithTf asserts that given condition will be met in waitFor time, // periodically checking target function each tick. In contrast to Eventually, // it supplies a CollectT to the condition function, so that the condition // function can use the CollectT to call other assertions. // The condition is considered "met" if no errors are raised in a tick. // The supplied CollectT collects all errors from one tick (if there are any). // If the condition is not met before waitFor, the collected errors of // the last tick are copied to t. // // externalValue := false // go func() { // time.Sleep(8*time.Second) // externalValue = true // }() // a.EventuallyWithTf(func(c *assert.CollectT, "error message %s", "formatted") { // // add assertions as needed; any assertion failure will fail the current tick // assert.True(c, externalValue, "expected 'externalValue' to be true") // }, 10*time.Second, 1*time.Second, "external state has not changed to 'true'; still false") func (a *Assertions) EventuallyWithTf(condition func(collect *assert.CollectT), waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } EventuallyWithTf(a.t, condition, waitFor, tick, msg, args...) } // Eventuallyf asserts that given condition will be met in waitFor time, // periodically checking target function each tick. // // a.Eventuallyf(func() bool { return true; }, time.Second, 10*time.Millisecond, "error message %s", "formatted") func (a *Assertions) Eventuallyf(condition func() bool, waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } Eventuallyf(a.t, condition, waitFor, tick, msg, args...) } // Exactly asserts that two objects are equal in value and type. // // a.Exactly(int32(123), int64(123)) func (a *Assertions) Exactly(expected interface{}, actual interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } Exactly(a.t, expected, actual, msgAndArgs...) } // Exactlyf asserts that two objects are equal in value and type. // // a.Exactlyf(int32(123), int64(123), "error message %s", "formatted") func (a *Assertions) Exactlyf(expected interface{}, actual interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } Exactlyf(a.t, expected, actual, msg, args...) } // Fail reports a failure through func (a *Assertions) Fail(failureMessage string, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } Fail(a.t, failureMessage, msgAndArgs...) } // FailNow fails test func (a *Assertions) FailNow(failureMessage string, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } FailNow(a.t, failureMessage, msgAndArgs...) } // FailNowf fails test func (a *Assertions) FailNowf(failureMessage string, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } FailNowf(a.t, failureMessage, msg, args...) } // Failf reports a failure through func (a *Assertions) Failf(failureMessage string, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } Failf(a.t, failureMessage, msg, args...) } // False asserts that the specified value is false. // // a.False(myBool) func (a *Assertions) False(value bool, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } False(a.t, value, msgAndArgs...) } // Falsef asserts that the specified value is false. // // a.Falsef(myBool, "error message %s", "formatted") func (a *Assertions) Falsef(value bool, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } Falsef(a.t, value, msg, args...) } // FileExists checks whether a file exists in the given path. It also fails if // the path points to a directory or there is an error when trying to check the file. func (a *Assertions) FileExists(path string, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } FileExists(a.t, path, msgAndArgs...) } // FileExistsf checks whether a file exists in the given path. It also fails if // the path points to a directory or there is an error when trying to check the file. func (a *Assertions) FileExistsf(path string, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } FileExistsf(a.t, path, msg, args...) } // Greater asserts that the first element is greater than the second // // a.Greater(2, 1) // a.Greater(float64(2), float64(1)) // a.Greater("b", "a") func (a *Assertions) Greater(e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } Greater(a.t, e1, e2, msgAndArgs...) } // GreaterOrEqual asserts that the first element is greater than or equal to the second // // a.GreaterOrEqual(2, 1) // a.GreaterOrEqual(2, 2) // a.GreaterOrEqual("b", "a") // a.GreaterOrEqual("b", "b") func (a *Assertions) GreaterOrEqual(e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } GreaterOrEqual(a.t, e1, e2, msgAndArgs...) } // GreaterOrEqualf asserts that the first element is greater than or equal to the second // // a.GreaterOrEqualf(2, 1, "error message %s", "formatted") // a.GreaterOrEqualf(2, 2, "error message %s", "formatted") // a.GreaterOrEqualf("b", "a", "error message %s", "formatted") // a.GreaterOrEqualf("b", "b", "error message %s", "formatted") func (a *Assertions) GreaterOrEqualf(e1 interface{}, e2 interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } GreaterOrEqualf(a.t, e1, e2, msg, args...) } // Greaterf asserts that the first element is greater than the second // // a.Greaterf(2, 1, "error message %s", "formatted") // a.Greaterf(float64(2), float64(1), "error message %s", "formatted") // a.Greaterf("b", "a", "error message %s", "formatted") func (a *Assertions) Greaterf(e1 interface{}, e2 interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } Greaterf(a.t, e1, e2, msg, args...) } // HTTPBodyContains asserts that a specified handler returns a // body that contains a string. // // a.HTTPBodyContains(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky") // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPBodyContains(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } HTTPBodyContains(a.t, handler, method, url, values, str, msgAndArgs...) } // HTTPBodyContainsf asserts that a specified handler returns a // body that contains a string. // // a.HTTPBodyContainsf(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted") // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPBodyContainsf(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } HTTPBodyContainsf(a.t, handler, method, url, values, str, msg, args...) } // HTTPBodyNotContains asserts that a specified handler returns a // body that does not contain a string. // // a.HTTPBodyNotContains(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky") // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPBodyNotContains(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } HTTPBodyNotContains(a.t, handler, method, url, values, str, msgAndArgs...) } // HTTPBodyNotContainsf asserts that a specified handler returns a // body that does not contain a string. // // a.HTTPBodyNotContainsf(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted") // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPBodyNotContainsf(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } HTTPBodyNotContainsf(a.t, handler, method, url, values, str, msg, args...) } // HTTPError asserts that a specified handler returns an error status code. // // a.HTTPError(myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}} // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPError(handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } HTTPError(a.t, handler, method, url, values, msgAndArgs...) } // HTTPErrorf asserts that a specified handler returns an error status code. // // a.HTTPErrorf(myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}} // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPErrorf(handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } HTTPErrorf(a.t, handler, method, url, values, msg, args...) } // HTTPRedirect asserts that a specified handler returns a redirect status code. // // a.HTTPRedirect(myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}} // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPRedirect(handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } HTTPRedirect(a.t, handler, method, url, values, msgAndArgs...) } // HTTPRedirectf asserts that a specified handler returns a redirect status code. // // a.HTTPRedirectf(myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}} // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPRedirectf(handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } HTTPRedirectf(a.t, handler, method, url, values, msg, args...) } // HTTPStatusCode asserts that a specified handler returns a specified status code. // // a.HTTPStatusCode(myHandler, "GET", "/notImplemented", nil, 501) // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPStatusCode(handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } HTTPStatusCode(a.t, handler, method, url, values, statuscode, msgAndArgs...) } // HTTPStatusCodef asserts that a specified handler returns a specified status code. // // a.HTTPStatusCodef(myHandler, "GET", "/notImplemented", nil, 501, "error message %s", "formatted") // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPStatusCodef(handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } HTTPStatusCodef(a.t, handler, method, url, values, statuscode, msg, args...) } // HTTPSuccess asserts that a specified handler returns a success status code. // // a.HTTPSuccess(myHandler, "POST", "http://www.google.com", nil) // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPSuccess(handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } HTTPSuccess(a.t, handler, method, url, values, msgAndArgs...) } // HTTPSuccessf asserts that a specified handler returns a success status code. // // a.HTTPSuccessf(myHandler, "POST", "http://www.google.com", nil, "error message %s", "formatted") // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPSuccessf(handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } HTTPSuccessf(a.t, handler, method, url, values, msg, args...) } // Implements asserts that an object is implemented by the specified interface. // // a.Implements((*MyInterface)(nil), new(MyObject)) func (a *Assertions) Implements(interfaceObject interface{}, object interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } Implements(a.t, interfaceObject, object, msgAndArgs...) } // Implementsf asserts that an object is implemented by the specified interface. // // a.Implementsf((*MyInterface)(nil), new(MyObject), "error message %s", "formatted") func (a *Assertions) Implementsf(interfaceObject interface{}, object interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } Implementsf(a.t, interfaceObject, object, msg, args...) } // InDelta asserts that the two numerals are within delta of each other. // // a.InDelta(math.Pi, 22/7.0, 0.01) func (a *Assertions) InDelta(expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } InDelta(a.t, expected, actual, delta, msgAndArgs...) } // InDeltaMapValues is the same as InDelta, but it compares all values between two maps. Both maps must have exactly the same keys. func (a *Assertions) InDeltaMapValues(expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } InDeltaMapValues(a.t, expected, actual, delta, msgAndArgs...) } // InDeltaMapValuesf is the same as InDelta, but it compares all values between two maps. Both maps must have exactly the same keys. func (a *Assertions) InDeltaMapValuesf(expected interface{}, actual interface{}, delta float64, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } InDeltaMapValuesf(a.t, expected, actual, delta, msg, args...) } // InDeltaSlice is the same as InDelta, except it compares two slices. func (a *Assertions) InDeltaSlice(expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } InDeltaSlice(a.t, expected, actual, delta, msgAndArgs...) } // InDeltaSlicef is the same as InDelta, except it compares two slices. func (a *Assertions) InDeltaSlicef(expected interface{}, actual interface{}, delta float64, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } InDeltaSlicef(a.t, expected, actual, delta, msg, args...) } // InDeltaf asserts that the two numerals are within delta of each other. // // a.InDeltaf(math.Pi, 22/7.0, 0.01, "error message %s", "formatted") func (a *Assertions) InDeltaf(expected interface{}, actual interface{}, delta float64, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } InDeltaf(a.t, expected, actual, delta, msg, args...) } // InEpsilon asserts that expected and actual have a relative error less than epsilon func (a *Assertions) InEpsilon(expected interface{}, actual interface{}, epsilon float64, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } InEpsilon(a.t, expected, actual, epsilon, msgAndArgs...) } // InEpsilonSlice is the same as InEpsilon, except it compares each value from two slices. func (a *Assertions) InEpsilonSlice(expected interface{}, actual interface{}, epsilon float64, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } InEpsilonSlice(a.t, expected, actual, epsilon, msgAndArgs...) } // InEpsilonSlicef is the same as InEpsilon, except it compares each value from two slices. func (a *Assertions) InEpsilonSlicef(expected interface{}, actual interface{}, epsilon float64, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } InEpsilonSlicef(a.t, expected, actual, epsilon, msg, args...) } // InEpsilonf asserts that expected and actual have a relative error less than epsilon func (a *Assertions) InEpsilonf(expected interface{}, actual interface{}, epsilon float64, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } InEpsilonf(a.t, expected, actual, epsilon, msg, args...) } // IsDecreasing asserts that the collection is decreasing // // a.IsDecreasing([]int{2, 1, 0}) // a.IsDecreasing([]float{2, 1}) // a.IsDecreasing([]string{"b", "a"}) func (a *Assertions) IsDecreasing(object interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } IsDecreasing(a.t, object, msgAndArgs...) } // IsDecreasingf asserts that the collection is decreasing // // a.IsDecreasingf([]int{2, 1, 0}, "error message %s", "formatted") // a.IsDecreasingf([]float{2, 1}, "error message %s", "formatted") // a.IsDecreasingf([]string{"b", "a"}, "error message %s", "formatted") func (a *Assertions) IsDecreasingf(object interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } IsDecreasingf(a.t, object, msg, args...) } // IsIncreasing asserts that the collection is increasing // // a.IsIncreasing([]int{1, 2, 3}) // a.IsIncreasing([]float{1, 2}) // a.IsIncreasing([]string{"a", "b"}) func (a *Assertions) IsIncreasing(object interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } IsIncreasing(a.t, object, msgAndArgs...) } // IsIncreasingf asserts that the collection is increasing // // a.IsIncreasingf([]int{1, 2, 3}, "error message %s", "formatted") // a.IsIncreasingf([]float{1, 2}, "error message %s", "formatted") // a.IsIncreasingf([]string{"a", "b"}, "error message %s", "formatted") func (a *Assertions) IsIncreasingf(object interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } IsIncreasingf(a.t, object, msg, args...) } // IsNonDecreasing asserts that the collection is not decreasing // // a.IsNonDecreasing([]int{1, 1, 2}) // a.IsNonDecreasing([]float{1, 2}) // a.IsNonDecreasing([]string{"a", "b"}) func (a *Assertions) IsNonDecreasing(object interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } IsNonDecreasing(a.t, object, msgAndArgs...) } // IsNonDecreasingf asserts that the collection is not decreasing // // a.IsNonDecreasingf([]int{1, 1, 2}, "error message %s", "formatted") // a.IsNonDecreasingf([]float{1, 2}, "error message %s", "formatted") // a.IsNonDecreasingf([]string{"a", "b"}, "error message %s", "formatted") func (a *Assertions) IsNonDecreasingf(object interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } IsNonDecreasingf(a.t, object, msg, args...) } // IsNonIncreasing asserts that the collection is not increasing // // a.IsNonIncreasing([]int{2, 1, 1}) // a.IsNonIncreasing([]float{2, 1}) // a.IsNonIncreasing([]string{"b", "a"}) func (a *Assertions) IsNonIncreasing(object interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } IsNonIncreasing(a.t, object, msgAndArgs...) } // IsNonIncreasingf asserts that the collection is not increasing // // a.IsNonIncreasingf([]int{2, 1, 1}, "error message %s", "formatted") // a.IsNonIncreasingf([]float{2, 1}, "error message %s", "formatted") // a.IsNonIncreasingf([]string{"b", "a"}, "error message %s", "formatted") func (a *Assertions) IsNonIncreasingf(object interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } IsNonIncreasingf(a.t, object, msg, args...) } // IsNotType asserts that the specified objects are not of the same type. // // a.IsNotType(&NotMyStruct{}, &MyStruct{}) func (a *Assertions) IsNotType(theType interface{}, object interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } IsNotType(a.t, theType, object, msgAndArgs...) } // IsNotTypef asserts that the specified objects are not of the same type. // // a.IsNotTypef(&NotMyStruct{}, &MyStruct{}, "error message %s", "formatted") func (a *Assertions) IsNotTypef(theType interface{}, object interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } IsNotTypef(a.t, theType, object, msg, args...) } // IsType asserts that the specified objects are of the same type. // // a.IsType(&MyStruct{}, &MyStruct{}) func (a *Assertions) IsType(expectedType interface{}, object interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } IsType(a.t, expectedType, object, msgAndArgs...) } // IsTypef asserts that the specified objects are of the same type. // // a.IsTypef(&MyStruct{}, &MyStruct{}, "error message %s", "formatted") func (a *Assertions) IsTypef(expectedType interface{}, object interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } IsTypef(a.t, expectedType, object, msg, args...) } // JSONEq asserts that two JSON strings are equivalent. // // a.JSONEq(`{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`) func (a *Assertions) JSONEq(expected string, actual string, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } JSONEq(a.t, expected, actual, msgAndArgs...) } // JSONEqf asserts that two JSON strings are equivalent. // // a.JSONEqf(`{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`, "error message %s", "formatted") func (a *Assertions) JSONEqf(expected string, actual string, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } JSONEqf(a.t, expected, actual, msg, args...) } // Len asserts that the specified object has specific length. // Len also fails if the object has a type that len() not accept. // // a.Len(mySlice, 3) func (a *Assertions) Len(object interface{}, length int, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } Len(a.t, object, length, msgAndArgs...) } // Lenf asserts that the specified object has specific length. // Lenf also fails if the object has a type that len() not accept. // // a.Lenf(mySlice, 3, "error message %s", "formatted") func (a *Assertions) Lenf(object interface{}, length int, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } Lenf(a.t, object, length, msg, args...) } // Less asserts that the first element is less than the second // // a.Less(1, 2) // a.Less(float64(1), float64(2)) // a.Less("a", "b") func (a *Assertions) Less(e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } Less(a.t, e1, e2, msgAndArgs...) } // LessOrEqual asserts that the first element is less than or equal to the second // // a.LessOrEqual(1, 2) // a.LessOrEqual(2, 2) // a.LessOrEqual("a", "b") // a.LessOrEqual("b", "b") func (a *Assertions) LessOrEqual(e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } LessOrEqual(a.t, e1, e2, msgAndArgs...) } // LessOrEqualf asserts that the first element is less than or equal to the second // // a.LessOrEqualf(1, 2, "error message %s", "formatted") // a.LessOrEqualf(2, 2, "error message %s", "formatted") // a.LessOrEqualf("a", "b", "error message %s", "formatted") // a.LessOrEqualf("b", "b", "error message %s", "formatted") func (a *Assertions) LessOrEqualf(e1 interface{}, e2 interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } LessOrEqualf(a.t, e1, e2, msg, args...) } // Lessf asserts that the first element is less than the second // // a.Lessf(1, 2, "error message %s", "formatted") // a.Lessf(float64(1), float64(2), "error message %s", "formatted") // a.Lessf("a", "b", "error message %s", "formatted") func (a *Assertions) Lessf(e1 interface{}, e2 interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } Lessf(a.t, e1, e2, msg, args...) } // Negative asserts that the specified element is negative // // a.Negative(-1) // a.Negative(-1.23) func (a *Assertions) Negative(e interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } Negative(a.t, e, msgAndArgs...) } // Negativef asserts that the specified element is negative // // a.Negativef(-1, "error message %s", "formatted") // a.Negativef(-1.23, "error message %s", "formatted") func (a *Assertions) Negativef(e interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } Negativef(a.t, e, msg, args...) } // Never asserts that the given condition doesn't satisfy in waitFor time, // periodically checking the target function each tick. // // a.Never(func() bool { return false; }, time.Second, 10*time.Millisecond) func (a *Assertions) Never(condition func() bool, waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } Never(a.t, condition, waitFor, tick, msgAndArgs...) } // Neverf asserts that the given condition doesn't satisfy in waitFor time, // periodically checking the target function each tick. // // a.Neverf(func() bool { return false; }, time.Second, 10*time.Millisecond, "error message %s", "formatted") func (a *Assertions) Neverf(condition func() bool, waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } Neverf(a.t, condition, waitFor, tick, msg, args...) } // Nil asserts that the specified object is nil. // // a.Nil(err) func (a *Assertions) Nil(object interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } Nil(a.t, object, msgAndArgs...) } // Nilf asserts that the specified object is nil. // // a.Nilf(err, "error message %s", "formatted") func (a *Assertions) Nilf(object interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } Nilf(a.t, object, msg, args...) } // NoDirExists checks whether a directory does not exist in the given path. // It fails if the path points to an existing _directory_ only. func (a *Assertions) NoDirExists(path string, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } NoDirExists(a.t, path, msgAndArgs...) } // NoDirExistsf checks whether a directory does not exist in the given path. // It fails if the path points to an existing _directory_ only. func (a *Assertions) NoDirExistsf(path string, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } NoDirExistsf(a.t, path, msg, args...) } // NoError asserts that a function returned no error (i.e. `nil`). // // actualObj, err := SomeFunction() // if a.NoError(err) { // assert.Equal(t, expectedObj, actualObj) // } func (a *Assertions) NoError(err error, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } NoError(a.t, err, msgAndArgs...) } // NoErrorf asserts that a function returned no error (i.e. `nil`). // // actualObj, err := SomeFunction() // if a.NoErrorf(err, "error message %s", "formatted") { // assert.Equal(t, expectedObj, actualObj) // } func (a *Assertions) NoErrorf(err error, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } NoErrorf(a.t, err, msg, args...) } // NoFileExists checks whether a file does not exist in a given path. It fails // if the path points to an existing _file_ only. func (a *Assertions) NoFileExists(path string, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } NoFileExists(a.t, path, msgAndArgs...) } // NoFileExistsf checks whether a file does not exist in a given path. It fails // if the path points to an existing _file_ only. func (a *Assertions) NoFileExistsf(path string, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } NoFileExistsf(a.t, path, msg, args...) } // NotContains asserts that the specified string, list(array, slice...) or map does NOT contain the // specified substring or element. // // a.NotContains("Hello World", "Earth") // a.NotContains(["Hello", "World"], "Earth") // a.NotContains({"Hello": "World"}, "Earth") func (a *Assertions) NotContains(s interface{}, contains interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } NotContains(a.t, s, contains, msgAndArgs...) } // NotContainsf asserts that the specified string, list(array, slice...) or map does NOT contain the // specified substring or element. // // a.NotContainsf("Hello World", "Earth", "error message %s", "formatted") // a.NotContainsf(["Hello", "World"], "Earth", "error message %s", "formatted") // a.NotContainsf({"Hello": "World"}, "Earth", "error message %s", "formatted") func (a *Assertions) NotContainsf(s interface{}, contains interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } NotContainsf(a.t, s, contains, msg, args...) } // NotElementsMatch asserts that the specified listA(array, slice...) is NOT equal to specified // listB(array, slice...) ignoring the order of the elements. If there are duplicate elements, // the number of appearances of each of them in both lists should not match. // This is an inverse of ElementsMatch. // // a.NotElementsMatch([1, 1, 2, 3], [1, 1, 2, 3]) -> false // // a.NotElementsMatch([1, 1, 2, 3], [1, 2, 3]) -> true // // a.NotElementsMatch([1, 2, 3], [1, 2, 4]) -> true func (a *Assertions) NotElementsMatch(listA interface{}, listB interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } NotElementsMatch(a.t, listA, listB, msgAndArgs...) } // NotElementsMatchf asserts that the specified listA(array, slice...) is NOT equal to specified // listB(array, slice...) ignoring the order of the elements. If there are duplicate elements, // the number of appearances of each of them in both lists should not match. // This is an inverse of ElementsMatch. // // a.NotElementsMatchf([1, 1, 2, 3], [1, 1, 2, 3], "error message %s", "formatted") -> false // // a.NotElementsMatchf([1, 1, 2, 3], [1, 2, 3], "error message %s", "formatted") -> true // // a.NotElementsMatchf([1, 2, 3], [1, 2, 4], "error message %s", "formatted") -> true func (a *Assertions) NotElementsMatchf(listA interface{}, listB interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } NotElementsMatchf(a.t, listA, listB, msg, args...) } // NotEmpty asserts that the specified object is NOT [Empty]. // // if a.NotEmpty(obj) { // assert.Equal(t, "two", obj[1]) // } func (a *Assertions) NotEmpty(object interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } NotEmpty(a.t, object, msgAndArgs...) } // NotEmptyf asserts that the specified object is NOT [Empty]. // // if a.NotEmptyf(obj, "error message %s", "formatted") { // assert.Equal(t, "two", obj[1]) // } func (a *Assertions) NotEmptyf(object interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } NotEmptyf(a.t, object, msg, args...) } // NotEqual asserts that the specified values are NOT equal. // // a.NotEqual(obj1, obj2) // // Pointer variable equality is determined based on the equality of the // referenced values (as opposed to the memory addresses). func (a *Assertions) NotEqual(expected interface{}, actual interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } NotEqual(a.t, expected, actual, msgAndArgs...) } // NotEqualValues asserts that two objects are not equal even when converted to the same type // // a.NotEqualValues(obj1, obj2) func (a *Assertions) NotEqualValues(expected interface{}, actual interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } NotEqualValues(a.t, expected, actual, msgAndArgs...) } // NotEqualValuesf asserts that two objects are not equal even when converted to the same type // // a.NotEqualValuesf(obj1, obj2, "error message %s", "formatted") func (a *Assertions) NotEqualValuesf(expected interface{}, actual interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } NotEqualValuesf(a.t, expected, actual, msg, args...) } // NotEqualf asserts that the specified values are NOT equal. // // a.NotEqualf(obj1, obj2, "error message %s", "formatted") // // Pointer variable equality is determined based on the equality of the // referenced values (as opposed to the memory addresses). func (a *Assertions) NotEqualf(expected interface{}, actual interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } NotEqualf(a.t, expected, actual, msg, args...) } // NotErrorAs asserts that none of the errors in err's chain matches target, // but if so, sets target to that error value. func (a *Assertions) NotErrorAs(err error, target interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } NotErrorAs(a.t, err, target, msgAndArgs...) } // NotErrorAsf asserts that none of the errors in err's chain matches target, // but if so, sets target to that error value. func (a *Assertions) NotErrorAsf(err error, target interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } NotErrorAsf(a.t, err, target, msg, args...) } // NotErrorIs asserts that none of the errors in err's chain matches target. // This is a wrapper for errors.Is. func (a *Assertions) NotErrorIs(err error, target error, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } NotErrorIs(a.t, err, target, msgAndArgs...) } // NotErrorIsf asserts that none of the errors in err's chain matches target. // This is a wrapper for errors.Is. func (a *Assertions) NotErrorIsf(err error, target error, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } NotErrorIsf(a.t, err, target, msg, args...) } // NotImplements asserts that an object does not implement the specified interface. // // a.NotImplements((*MyInterface)(nil), new(MyObject)) func (a *Assertions) NotImplements(interfaceObject interface{}, object interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } NotImplements(a.t, interfaceObject, object, msgAndArgs...) } // NotImplementsf asserts that an object does not implement the specified interface. // // a.NotImplementsf((*MyInterface)(nil), new(MyObject), "error message %s", "formatted") func (a *Assertions) NotImplementsf(interfaceObject interface{}, object interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } NotImplementsf(a.t, interfaceObject, object, msg, args...) } // NotNil asserts that the specified object is not nil. // // a.NotNil(err) func (a *Assertions) NotNil(object interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } NotNil(a.t, object, msgAndArgs...) } // NotNilf asserts that the specified object is not nil. // // a.NotNilf(err, "error message %s", "formatted") func (a *Assertions) NotNilf(object interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } NotNilf(a.t, object, msg, args...) } // NotPanics asserts that the code inside the specified PanicTestFunc does NOT panic. // // a.NotPanics(func(){ RemainCalm() }) func (a *Assertions) NotPanics(f assert.PanicTestFunc, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } NotPanics(a.t, f, msgAndArgs...) } // NotPanicsf asserts that the code inside the specified PanicTestFunc does NOT panic. // // a.NotPanicsf(func(){ RemainCalm() }, "error message %s", "formatted") func (a *Assertions) NotPanicsf(f assert.PanicTestFunc, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } NotPanicsf(a.t, f, msg, args...) } // NotRegexp asserts that a specified regexp does not match a string. // // a.NotRegexp(regexp.MustCompile("starts"), "it's starting") // a.NotRegexp("^start", "it's not starting") func (a *Assertions) NotRegexp(rx interface{}, str interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } NotRegexp(a.t, rx, str, msgAndArgs...) } // NotRegexpf asserts that a specified regexp does not match a string. // // a.NotRegexpf(regexp.MustCompile("starts"), "it's starting", "error message %s", "formatted") // a.NotRegexpf("^start", "it's not starting", "error message %s", "formatted") func (a *Assertions) NotRegexpf(rx interface{}, str interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } NotRegexpf(a.t, rx, str, msg, args...) } // NotSame asserts that two pointers do not reference the same object. // // a.NotSame(ptr1, ptr2) // // Both arguments must be pointer variables. Pointer variable sameness is // determined based on the equality of both type and value. func (a *Assertions) NotSame(expected interface{}, actual interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } NotSame(a.t, expected, actual, msgAndArgs...) } // NotSamef asserts that two pointers do not reference the same object. // // a.NotSamef(ptr1, ptr2, "error message %s", "formatted") // // Both arguments must be pointer variables. Pointer variable sameness is // determined based on the equality of both type and value. func (a *Assertions) NotSamef(expected interface{}, actual interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } NotSamef(a.t, expected, actual, msg, args...) } // NotSubset asserts that the list (array, slice, or map) does NOT contain all // elements given in the subset (array, slice, or map). // Map elements are key-value pairs unless compared with an array or slice where // only the map key is evaluated. // // a.NotSubset([1, 3, 4], [1, 2]) // a.NotSubset({"x": 1, "y": 2}, {"z": 3}) // a.NotSubset([1, 3, 4], {1: "one", 2: "two"}) // a.NotSubset({"x": 1, "y": 2}, ["z"]) func (a *Assertions) NotSubset(list interface{}, subset interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } NotSubset(a.t, list, subset, msgAndArgs...) } // NotSubsetf asserts that the list (array, slice, or map) does NOT contain all // elements given in the subset (array, slice, or map). // Map elements are key-value pairs unless compared with an array or slice where // only the map key is evaluated. // // a.NotSubsetf([1, 3, 4], [1, 2], "error message %s", "formatted") // a.NotSubsetf({"x": 1, "y": 2}, {"z": 3}, "error message %s", "formatted") // a.NotSubsetf([1, 3, 4], {1: "one", 2: "two"}, "error message %s", "formatted") // a.NotSubsetf({"x": 1, "y": 2}, ["z"], "error message %s", "formatted") func (a *Assertions) NotSubsetf(list interface{}, subset interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } NotSubsetf(a.t, list, subset, msg, args...) } // NotZero asserts that i is not the zero value for its type. func (a *Assertions) NotZero(i interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } NotZero(a.t, i, msgAndArgs...) } // NotZerof asserts that i is not the zero value for its type. func (a *Assertions) NotZerof(i interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } NotZerof(a.t, i, msg, args...) } // Panics asserts that the code inside the specified PanicTestFunc panics. // // a.Panics(func(){ GoCrazy() }) func (a *Assertions) Panics(f assert.PanicTestFunc, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } Panics(a.t, f, msgAndArgs...) } // PanicsWithError asserts that the code inside the specified PanicTestFunc // panics, and that the recovered panic value is an error that satisfies the // EqualError comparison. // // a.PanicsWithError("crazy error", func(){ GoCrazy() }) func (a *Assertions) PanicsWithError(errString string, f assert.PanicTestFunc, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } PanicsWithError(a.t, errString, f, msgAndArgs...) } // PanicsWithErrorf asserts that the code inside the specified PanicTestFunc // panics, and that the recovered panic value is an error that satisfies the // EqualError comparison. // // a.PanicsWithErrorf("crazy error", func(){ GoCrazy() }, "error message %s", "formatted") func (a *Assertions) PanicsWithErrorf(errString string, f assert.PanicTestFunc, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } PanicsWithErrorf(a.t, errString, f, msg, args...) } // PanicsWithValue asserts that the code inside the specified PanicTestFunc panics, and that // the recovered panic value equals the expected panic value. // // a.PanicsWithValue("crazy error", func(){ GoCrazy() }) func (a *Assertions) PanicsWithValue(expected interface{}, f assert.PanicTestFunc, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } PanicsWithValue(a.t, expected, f, msgAndArgs...) } // PanicsWithValuef asserts that the code inside the specified PanicTestFunc panics, and that // the recovered panic value equals the expected panic value. // // a.PanicsWithValuef("crazy error", func(){ GoCrazy() }, "error message %s", "formatted") func (a *Assertions) PanicsWithValuef(expected interface{}, f assert.PanicTestFunc, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } PanicsWithValuef(a.t, expected, f, msg, args...) } // Panicsf asserts that the code inside the specified PanicTestFunc panics. // // a.Panicsf(func(){ GoCrazy() }, "error message %s", "formatted") func (a *Assertions) Panicsf(f assert.PanicTestFunc, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } Panicsf(a.t, f, msg, args...) } // Positive asserts that the specified element is positive // // a.Positive(1) // a.Positive(1.23) func (a *Assertions) Positive(e interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } Positive(a.t, e, msgAndArgs...) } // Positivef asserts that the specified element is positive // // a.Positivef(1, "error message %s", "formatted") // a.Positivef(1.23, "error message %s", "formatted") func (a *Assertions) Positivef(e interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } Positivef(a.t, e, msg, args...) } // Regexp asserts that a specified regexp matches a string. // // a.Regexp(regexp.MustCompile("start"), "it's starting") // a.Regexp("start...$", "it's not starting") func (a *Assertions) Regexp(rx interface{}, str interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } Regexp(a.t, rx, str, msgAndArgs...) } // Regexpf asserts that a specified regexp matches a string. // // a.Regexpf(regexp.MustCompile("start"), "it's starting", "error message %s", "formatted") // a.Regexpf("start...$", "it's not starting", "error message %s", "formatted") func (a *Assertions) Regexpf(rx interface{}, str interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } Regexpf(a.t, rx, str, msg, args...) } // Same asserts that two pointers reference the same object. // // a.Same(ptr1, ptr2) // // Both arguments must be pointer variables. Pointer variable sameness is // determined based on the equality of both type and value. func (a *Assertions) Same(expected interface{}, actual interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } Same(a.t, expected, actual, msgAndArgs...) } // Samef asserts that two pointers reference the same object. // // a.Samef(ptr1, ptr2, "error message %s", "formatted") // // Both arguments must be pointer variables. Pointer variable sameness is // determined based on the equality of both type and value. func (a *Assertions) Samef(expected interface{}, actual interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } Samef(a.t, expected, actual, msg, args...) } // Subset asserts that the list (array, slice, or map) contains all elements // given in the subset (array, slice, or map). // Map elements are key-value pairs unless compared with an array or slice where // only the map key is evaluated. // // a.Subset([1, 2, 3], [1, 2]) // a.Subset({"x": 1, "y": 2}, {"x": 1}) // a.Subset([1, 2, 3], {1: "one", 2: "two"}) // a.Subset({"x": 1, "y": 2}, ["x"]) func (a *Assertions) Subset(list interface{}, subset interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } Subset(a.t, list, subset, msgAndArgs...) } // Subsetf asserts that the list (array, slice, or map) contains all elements // given in the subset (array, slice, or map). // Map elements are key-value pairs unless compared with an array or slice where // only the map key is evaluated. // // a.Subsetf([1, 2, 3], [1, 2], "error message %s", "formatted") // a.Subsetf({"x": 1, "y": 2}, {"x": 1}, "error message %s", "formatted") // a.Subsetf([1, 2, 3], {1: "one", 2: "two"}, "error message %s", "formatted") // a.Subsetf({"x": 1, "y": 2}, ["x"], "error message %s", "formatted") func (a *Assertions) Subsetf(list interface{}, subset interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } Subsetf(a.t, list, subset, msg, args...) } // True asserts that the specified value is true. // // a.True(myBool) func (a *Assertions) True(value bool, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } True(a.t, value, msgAndArgs...) } // Truef asserts that the specified value is true. // // a.Truef(myBool, "error message %s", "formatted") func (a *Assertions) Truef(value bool, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } Truef(a.t, value, msg, args...) } // WithinDuration asserts that the two times are within duration delta of each other. // // a.WithinDuration(time.Now(), time.Now(), 10*time.Second) func (a *Assertions) WithinDuration(expected time.Time, actual time.Time, delta time.Duration, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } WithinDuration(a.t, expected, actual, delta, msgAndArgs...) } // WithinDurationf asserts that the two times are within duration delta of each other. // // a.WithinDurationf(time.Now(), time.Now(), 10*time.Second, "error message %s", "formatted") func (a *Assertions) WithinDurationf(expected time.Time, actual time.Time, delta time.Duration, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } WithinDurationf(a.t, expected, actual, delta, msg, args...) } // WithinRange asserts that a time is within a time range (inclusive). // // a.WithinRange(time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second)) func (a *Assertions) WithinRange(actual time.Time, start time.Time, end time.Time, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } WithinRange(a.t, actual, start, end, msgAndArgs...) } // WithinRangef asserts that a time is within a time range (inclusive). // // a.WithinRangef(time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second), "error message %s", "formatted") func (a *Assertions) WithinRangef(actual time.Time, start time.Time, end time.Time, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } WithinRangef(a.t, actual, start, end, msg, args...) } // YAMLEq asserts that two YAML strings are equivalent. func (a *Assertions) YAMLEq(expected string, actual string, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } YAMLEq(a.t, expected, actual, msgAndArgs...) } // YAMLEqf asserts that two YAML strings are equivalent. func (a *Assertions) YAMLEqf(expected string, actual string, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } YAMLEqf(a.t, expected, actual, msg, args...) } // Zero asserts that i is the zero value for its type. func (a *Assertions) Zero(i interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } Zero(a.t, i, msgAndArgs...) } // Zerof asserts that i is the zero value for its type. func (a *Assertions) Zerof(i interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() } Zerof(a.t, i, msg, args...) } ================================================ FILE: vendor/github.com/stretchr/testify/require/require_forward.go.tmpl ================================================ {{.CommentWithoutT "a"}} func (a *Assertions) {{.DocInfo.Name}}({{.Params}}) { if h, ok := a.t.(tHelper); ok { h.Helper() } {{.DocInfo.Name}}(a.t, {{.ForwardedParams}}) } ================================================ FILE: vendor/github.com/stretchr/testify/require/requirements.go ================================================ package require // TestingT is an interface wrapper around *testing.T type TestingT interface { Errorf(format string, args ...interface{}) FailNow() } type tHelper = interface { Helper() } // ComparisonAssertionFunc is a common function prototype when comparing two values. Can be useful // for table driven tests. type ComparisonAssertionFunc func(TestingT, interface{}, interface{}, ...interface{}) // ValueAssertionFunc is a common function prototype when validating a single value. Can be useful // for table driven tests. type ValueAssertionFunc func(TestingT, interface{}, ...interface{}) // BoolAssertionFunc is a common function prototype when validating a bool value. Can be useful // for table driven tests. type BoolAssertionFunc func(TestingT, bool, ...interface{}) // ErrorAssertionFunc is a common function prototype when validating an error value. Can be useful // for table driven tests. type ErrorAssertionFunc func(TestingT, error, ...interface{}) //go:generate sh -c "cd ../_codegen && go build && cd - && ../_codegen/_codegen -output-package=require -template=require.go.tmpl -include-format-funcs" ================================================ FILE: vendor/github.com/stretchr/testify/suite/doc.go ================================================ // Package suite contains logic for creating testing suite structs // and running the methods on those structs as tests. The most useful // piece of this package is that you can create setup/teardown methods // on your testing suites, which will run before/after the whole suite // or individual tests (depending on which interface(s) you // implement). // // The suite package does not support parallel tests. See [issue 934]. // // A testing suite is usually built by first extending the built-in // suite functionality from suite.Suite in testify. Alternatively, // you could reproduce that logic on your own if you wanted (you // just need to implement the TestingSuite interface from // suite/interfaces.go). // // After that, you can implement any of the interfaces in // suite/interfaces.go to add setup/teardown functionality to your // suite, and add any methods that start with "Test" to add tests. // Methods that do not match any suite interfaces and do not begin // with "Test" will not be run by testify, and can safely be used as // helper methods. // // Once you've built your testing suite, you need to run the suite // (using suite.Run from testify) inside any function that matches the // identity that "go test" is already looking for (i.e. // func(*testing.T)). // // Regular expression to select test suites specified command-line // argument "-run". Regular expression to select the methods // of test suites specified command-line argument "-m". // Suite object has assertion methods. // // A crude example: // // // Basic imports // import ( // "testing" // "github.com/stretchr/testify/assert" // "github.com/stretchr/testify/suite" // ) // // // Define the suite, and absorb the built-in basic suite // // functionality from testify - including a T() method which // // returns the current testing context // type ExampleTestSuite struct { // suite.Suite // VariableThatShouldStartAtFive int // } // // // Make sure that VariableThatShouldStartAtFive is set to five // // before each test // func (suite *ExampleTestSuite) SetupTest() { // suite.VariableThatShouldStartAtFive = 5 // } // // // All methods that begin with "Test" are run as tests within a // // suite. // func (suite *ExampleTestSuite) TestExample() { // assert.Equal(suite.T(), 5, suite.VariableThatShouldStartAtFive) // suite.Equal(5, suite.VariableThatShouldStartAtFive) // } // // // In order for 'go test' to run this suite, we need to create // // a normal test function and pass our suite to suite.Run // func TestExampleTestSuite(t *testing.T) { // suite.Run(t, new(ExampleTestSuite)) // } // // [issue 934]: https://github.com/stretchr/testify/issues/934 package suite ================================================ FILE: vendor/github.com/stretchr/testify/suite/interfaces.go ================================================ package suite import "testing" // TestingSuite can store and return the current *testing.T context // generated by 'go test'. type TestingSuite interface { T() *testing.T SetT(*testing.T) SetS(suite TestingSuite) } // SetupAllSuite has a SetupSuite method, which will run before the // tests in the suite are run. type SetupAllSuite interface { SetupSuite() } // SetupTestSuite has a SetupTest method, which will run before each // test in the suite. type SetupTestSuite interface { SetupTest() } // TearDownAllSuite has a TearDownSuite method, which will run after // all the tests in the suite have been run. type TearDownAllSuite interface { TearDownSuite() } // TearDownTestSuite has a TearDownTest method, which will run after // each test in the suite. type TearDownTestSuite interface { TearDownTest() } // BeforeTest has a function to be executed right before the test // starts and receives the suite and test names as input type BeforeTest interface { BeforeTest(suiteName, testName string) } // AfterTest has a function to be executed right after the test // finishes and receives the suite and test names as input type AfterTest interface { AfterTest(suiteName, testName string) } // WithStats implements HandleStats, a function that will be executed // when a test suite is finished. The stats contain information about // the execution of that suite and its tests. type WithStats interface { HandleStats(suiteName string, stats *SuiteInformation) } // SetupSubTest has a SetupSubTest method, which will run before each // subtest in the suite. type SetupSubTest interface { SetupSubTest() } // TearDownSubTest has a TearDownSubTest method, which will run after // each subtest in the suite have been run. type TearDownSubTest interface { TearDownSubTest() } ================================================ FILE: vendor/github.com/stretchr/testify/suite/stats.go ================================================ package suite import "time" // SuiteInformation stats stores stats for the whole suite execution. type SuiteInformation struct { Start, End time.Time TestStats map[string]*TestInformation } // TestInformation stores information about the execution of each test. type TestInformation struct { TestName string Start, End time.Time Passed bool } func newSuiteInformation() *SuiteInformation { return &SuiteInformation{ TestStats: make(map[string]*TestInformation), } } func (s *SuiteInformation) start(testName string) { if s == nil { return } s.TestStats[testName] = &TestInformation{ TestName: testName, Start: time.Now(), } } func (s *SuiteInformation) end(testName string, passed bool) { if s == nil { return } s.TestStats[testName].End = time.Now() s.TestStats[testName].Passed = passed } func (s *SuiteInformation) Passed() bool { for _, stats := range s.TestStats { if !stats.Passed { return false } } return true } ================================================ FILE: vendor/github.com/stretchr/testify/suite/suite.go ================================================ package suite import ( "flag" "fmt" "os" "reflect" "regexp" "runtime/debug" "strings" "sync" "testing" "time" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) var matchMethod = flag.String("testify.m", "", "regular expression to select tests of the testify suite to run") // Suite is a basic testing suite with methods for storing and // retrieving the current *testing.T context. type Suite struct { *assert.Assertions mu sync.RWMutex require *require.Assertions t *testing.T // Parent suite to have access to the implemented methods of parent struct s TestingSuite } // T retrieves the current *testing.T context. func (suite *Suite) T() *testing.T { suite.mu.RLock() defer suite.mu.RUnlock() return suite.t } // SetT sets the current *testing.T context. func (suite *Suite) SetT(t *testing.T) { suite.mu.Lock() defer suite.mu.Unlock() suite.t = t suite.Assertions = assert.New(t) suite.require = require.New(t) } // SetS needs to set the current test suite as parent // to get access to the parent methods func (suite *Suite) SetS(s TestingSuite) { suite.s = s } // Require returns a require context for suite. func (suite *Suite) Require() *require.Assertions { suite.mu.Lock() defer suite.mu.Unlock() if suite.require == nil { panic("'Require' must not be called before 'Run' or 'SetT'") } return suite.require } // Assert returns an assert context for suite. Normally, you can call // `suite.NoError(expected, actual)`, but for situations where the embedded // methods are overridden (for example, you might want to override // assert.Assertions with require.Assertions), this method is provided so you // can call `suite.Assert().NoError()`. func (suite *Suite) Assert() *assert.Assertions { suite.mu.Lock() defer suite.mu.Unlock() if suite.Assertions == nil { panic("'Assert' must not be called before 'Run' or 'SetT'") } return suite.Assertions } func recoverAndFailOnPanic(t *testing.T) { t.Helper() r := recover() failOnPanic(t, r) } func failOnPanic(t *testing.T, r interface{}) { t.Helper() if r != nil { t.Errorf("test panicked: %v\n%s", r, debug.Stack()) t.FailNow() } } // Run provides suite functionality around golang subtests. It should be // called in place of t.Run(name, func(t *testing.T)) in test suite code. // The passed-in func will be executed as a subtest with a fresh instance of t. // Provides compatibility with go test pkg -run TestSuite/TestName/SubTestName. func (suite *Suite) Run(name string, subtest func()) bool { oldT := suite.T() return oldT.Run(name, func(t *testing.T) { suite.SetT(t) defer suite.SetT(oldT) defer recoverAndFailOnPanic(t) if setupSubTest, ok := suite.s.(SetupSubTest); ok { setupSubTest.SetupSubTest() } if tearDownSubTest, ok := suite.s.(TearDownSubTest); ok { defer tearDownSubTest.TearDownSubTest() } subtest() }) } type test = struct { name string run func(t *testing.T) } // Run takes a testing suite and runs all of the tests attached // to it. func Run(t *testing.T, suite TestingSuite) { defer recoverAndFailOnPanic(t) suite.SetT(t) suite.SetS(suite) var stats *SuiteInformation if _, ok := suite.(WithStats); ok { stats = newSuiteInformation() } var tests []test methodFinder := reflect.TypeOf(suite) suiteName := methodFinder.Elem().Name() var matchMethodRE *regexp.Regexp if *matchMethod != "" { var err error matchMethodRE, err = regexp.Compile(*matchMethod) if err != nil { fmt.Fprintf(os.Stderr, "testify: invalid regexp for -m: %s\n", err) os.Exit(1) } } for i := 0; i < methodFinder.NumMethod(); i++ { method := methodFinder.Method(i) if !strings.HasPrefix(method.Name, "Test") { continue } // Apply -testify.m filter if matchMethodRE != nil && !matchMethodRE.MatchString(method.Name) { continue } test := test{ name: method.Name, run: func(t *testing.T) { parentT := suite.T() suite.SetT(t) defer recoverAndFailOnPanic(t) defer func() { t.Helper() r := recover() stats.end(method.Name, !t.Failed() && r == nil) if afterTestSuite, ok := suite.(AfterTest); ok { afterTestSuite.AfterTest(suiteName, method.Name) } if tearDownTestSuite, ok := suite.(TearDownTestSuite); ok { tearDownTestSuite.TearDownTest() } suite.SetT(parentT) failOnPanic(t, r) }() if setupTestSuite, ok := suite.(SetupTestSuite); ok { setupTestSuite.SetupTest() } if beforeTestSuite, ok := suite.(BeforeTest); ok { beforeTestSuite.BeforeTest(methodFinder.Elem().Name(), method.Name) } stats.start(method.Name) method.Func.Call([]reflect.Value{reflect.ValueOf(suite)}) }, } tests = append(tests, test) } if len(tests) == 0 { return } if stats != nil { stats.Start = time.Now() } if setupAllSuite, ok := suite.(SetupAllSuite); ok { setupAllSuite.SetupSuite() } defer func() { if tearDownAllSuite, ok := suite.(TearDownAllSuite); ok { tearDownAllSuite.TearDownSuite() } if suiteWithStats, measureStats := suite.(WithStats); measureStats { stats.End = time.Now() suiteWithStats.HandleStats(suiteName, stats) } }() runTests(t, tests) } func runTests(t *testing.T, tests []test) { if len(tests) == 0 { t.Log("warning: no tests to run") return } for _, test := range tests { t.Run(test.name, test.run) } } ================================================ FILE: vendor/github.com/sylabs/sif/v2/LICENSE.md ================================================ # LICENSE Copyright (c) 2018-2023, Sylabs Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: vendor/github.com/sylabs/sif/v2/pkg/sif/add.go ================================================ // Copyright (c) 2018-2023, Sylabs Inc. All rights reserved. // Copyright (c) 2017, SingularityWare, LLC. All rights reserved. // Copyright (c) 2017, Yannick Cote All rights reserved. // This software is licensed under a 3-clause BSD license. Please consult the // LICENSE file distributed with the sources of this project regarding your // rights to use or distribute this software. package sif import ( "fmt" "time" ) // addOpts accumulates object add options. type addOpts struct { t time.Time } // AddOpt are used to specify object add options. type AddOpt func(*addOpts) error // OptAddDeterministic sets header/descriptor fields to values that support deterministic // modification of images. func OptAddDeterministic() AddOpt { return func(ao *addOpts) error { ao.t = time.Time{} return nil } } // OptAddWithTime specifies t as the image modification time. func OptAddWithTime(t time.Time) AddOpt { return func(ao *addOpts) error { ao.t = t return nil } } // AddObject adds a new data object and its descriptor into the specified SIF file. // // By default, the image modification time is set to the current time for non-deterministic images, // and unset otherwise. To override this, consider using OptAddDeterministic or OptAddWithTime. func (f *FileImage) AddObject(di DescriptorInput, opts ...AddOpt) error { ao := addOpts{} if !f.isDeterministic() { ao.t = time.Now() } for _, opt := range opts { if err := opt(&ao); err != nil { return fmt.Errorf("%w", err) } } // Find an unused descriptor. i := 0 for _, rd := range f.rds { if !rd.Used { break } i++ } if err := f.writeDataObject(i, di, ao.t); err != nil { return fmt.Errorf("%w", err) } if err := f.writeDescriptors(); err != nil { return fmt.Errorf("%w", err) } f.h.ModifiedAt = ao.t.Unix() if err := f.writeHeader(); err != nil { return fmt.Errorf("%w", err) } return nil } ================================================ FILE: vendor/github.com/sylabs/sif/v2/pkg/sif/arch.go ================================================ // Copyright (c) 2021-2022, Sylabs Inc. All rights reserved. // This software is licensed under a 3-clause BSD license. Please consult the // LICENSE file distributed with the sources of this project regarding your // rights to use or distribute this software. package sif var ( hdrArchUnknown archType = [...]byte{'0', '0', '\x00'} hdrArch386 archType = [...]byte{'0', '1', '\x00'} hdrArchAMD64 archType = [...]byte{'0', '2', '\x00'} hdrArchARM archType = [...]byte{'0', '3', '\x00'} hdrArchARM64 archType = [...]byte{'0', '4', '\x00'} hdrArchPPC64 archType = [...]byte{'0', '5', '\x00'} hdrArchPPC64le archType = [...]byte{'0', '6', '\x00'} hdrArchMIPS archType = [...]byte{'0', '7', '\x00'} hdrArchMIPSle archType = [...]byte{'0', '8', '\x00'} hdrArchMIPS64 archType = [...]byte{'0', '9', '\x00'} hdrArchMIPS64le archType = [...]byte{'1', '0', '\x00'} hdrArchS390x archType = [...]byte{'1', '1', '\x00'} hdrArchRISCV64 archType = [...]byte{'1', '2', '\x00'} ) type archType [3]byte // getSIFArch returns the archType corresponding to go runtime arch. func getSIFArch(arch string) archType { archMap := map[string]archType{ "386": hdrArch386, "amd64": hdrArchAMD64, "arm": hdrArchARM, "arm64": hdrArchARM64, "ppc64": hdrArchPPC64, "ppc64le": hdrArchPPC64le, "mips": hdrArchMIPS, "mipsle": hdrArchMIPSle, "mips64": hdrArchMIPS64, "mips64le": hdrArchMIPS64le, "s390x": hdrArchS390x, "riscv64": hdrArchRISCV64, } t, ok := archMap[arch] if !ok { return hdrArchUnknown } return t } // GoArch returns the go runtime arch corresponding to t. func (t archType) GoArch() string { archMap := map[archType]string{ hdrArch386: "386", hdrArchAMD64: "amd64", hdrArchARM: "arm", hdrArchARM64: "arm64", hdrArchPPC64: "ppc64", hdrArchPPC64le: "ppc64le", hdrArchMIPS: "mips", hdrArchMIPSle: "mipsle", hdrArchMIPS64: "mips64", hdrArchMIPS64le: "mips64le", hdrArchS390x: "s390x", hdrArchRISCV64: "riscv64", } arch, ok := archMap[t] if !ok { arch = "unknown" } return arch } ================================================ FILE: vendor/github.com/sylabs/sif/v2/pkg/sif/buffer.go ================================================ // Copyright (c) 2021-2022, Sylabs Inc. All rights reserved. // This software is licensed under a 3-clause BSD license. Please consult the // LICENSE file distributed with the sources of this project regarding your // rights to use or distribute this software. package sif import ( "errors" "io" ) // A Buffer is a variable-sized buffer of bytes that implements the sif.ReadWriter interface. The // zero value for Buffer is an empty buffer ready to use. type Buffer struct { buf []byte pos int64 } // NewBuffer creates and initializes a new Buffer using buf as its initial contents. func NewBuffer(buf []byte) *Buffer { return &Buffer{buf: buf} } var errNegativeOffset = errors.New("negative offset") // ReadAt implements the io.ReaderAt interface. func (b *Buffer) ReadAt(p []byte, off int64) (int, error) { if off < 0 { return 0, errNegativeOffset } if off >= int64(len(b.buf)) { return 0, io.EOF } n := copy(p, b.buf[off:]) if n < len(p) { return n, io.EOF } return n, nil } var errNegativePosition = errors.New("negative position") // Write implements the io.Writer interface. func (b *Buffer) Write(p []byte) (int, error) { if b.pos < 0 { return 0, errNegativePosition } if have, need := int64(len(b.buf))-b.pos, int64(len(p)); have < need { b.buf = append(b.buf, make([]byte, need-have)...) } n := copy(b.buf[b.pos:], p) b.pos += int64(n) return n, nil } var errInvalidWhence = errors.New("invalid whence") // Seek implements the io.Seeker interface. func (b *Buffer) Seek(offset int64, whence int) (int64, error) { var abs int64 switch whence { case io.SeekStart: abs = offset case io.SeekCurrent: abs = b.pos + offset case io.SeekEnd: abs = int64(len(b.buf)) + offset default: return 0, errInvalidWhence } if abs < 0 { return 0, errNegativePosition } b.pos = abs return abs, nil } var errTruncateRange = errors.New("truncation out of range") // Truncate discards all but the first n bytes from the buffer. func (b *Buffer) Truncate(n int64) error { if n < 0 || n > int64(len(b.buf)) { return errTruncateRange } b.buf = b.buf[:n] return nil } // Bytes returns the contents of the buffer. The slice is valid for use only until the next buffer // modification (that is, only until the next call to a method like ReadAt, Write, or Truncate). func (b *Buffer) Bytes() []byte { return b.buf } // Len returns the number of bytes in the buffer. func (b *Buffer) Len() int64 { return int64(len(b.buf)) } ================================================ FILE: vendor/github.com/sylabs/sif/v2/pkg/sif/create.go ================================================ // Copyright (c) 2018-2024, Sylabs Inc. All rights reserved. // Copyright (c) 2017, SingularityWare, LLC. All rights reserved. // Copyright (c) 2017, Yannick Cote All rights reserved. // This software is licensed under a 3-clause BSD license. Please consult the // LICENSE file distributed with the sources of this project regarding your // rights to use or distribute this software. package sif import ( "encoding/binary" "errors" "fmt" "io" "math" "os" "time" "github.com/google/uuid" ) var errAlignmentOverflow = errors.New("integer overflow when calculating alignment") // nextAligned finds the next offset that satisfies alignment. func nextAligned(offset int64, alignment int) (int64, error) { align64 := int64(alignment) if align64 <= 0 || offset%align64 == 0 { return offset, nil } align64 -= offset % align64 if (math.MaxInt64 - offset) < align64 { return 0, errAlignmentOverflow } return offset + align64, nil } // writeDataObjectAt writes the data object described by di to ws, using time t, recording details // in d. The object is written at the first position that satisfies the alignment requirements // described by di following offsetUnaligned. func writeDataObjectAt(ws io.WriteSeeker, offsetUnaligned int64, di DescriptorInput, t time.Time, d *rawDescriptor) error { //nolint:lll offset, err := nextAligned(offsetUnaligned, di.opts.alignment) if err != nil { return err } if _, err := ws.Seek(offset, io.SeekStart); err != nil { return err } n, err := io.Copy(ws, di.r) if err != nil { return err } if err := di.fillDescriptor(t, d); err != nil { return err } d.Used = true d.Offset = offset d.Size = n d.SizeWithPadding = offset - offsetUnaligned + n return nil } // calculatedDataSize calculates the size of the data section based on the in-use descriptors. func (f *FileImage) calculatedDataSize() int64 { dataEnd := f.DataOffset() f.WithDescriptors(func(d Descriptor) bool { if objectEnd := d.Offset() + d.Size(); dataEnd < objectEnd { dataEnd = objectEnd } return false }) return dataEnd - f.DataOffset() } var ( errInsufficientCapacity = errors.New("insufficient descriptor capacity to add data object(s) to image") errPrimaryPartition = errors.New("image already contains a primary partition") errObjectIDOverflow = errors.New("object ID would overflow") ) // writeDataObject writes the data object described by di to f, using time t, recording details in // the descriptor at index i. func (f *FileImage) writeDataObject(i int, di DescriptorInput, t time.Time) error { if i >= len(f.rds) { return errInsufficientCapacity } // We derive the ID from i, so make sure the ID will not overflow. if int64(i) >= math.MaxUint32 { return errObjectIDOverflow } // If this is a primary partition, verify there isn't another primary partition, and update the // architecture in the global header. if p, ok := di.opts.md.(partition); ok && p.Parttype == PartPrimSys { if ds, err := f.GetDescriptors(WithPartitionType(PartPrimSys)); err == nil && len(ds) > 0 { return errPrimaryPartition } f.h.Arch = p.Arch } d := &f.rds[i] d.ID = uint32(i) + 1 //nolint:gosec // Overflow handled above. f.h.DataSize = f.calculatedDataSize() if err := writeDataObjectAt(f.rw, f.h.DataOffset+f.h.DataSize, di, t, d); err != nil { return err } // Update minimum object ID map. if minID, ok := f.minIDs[d.GroupID]; !ok || d.ID < minID { f.minIDs[d.GroupID] = d.ID } f.h.DescriptorsFree-- f.h.DataSize += d.SizeWithPadding return nil } // writeDescriptors writes the descriptors in f to backing storage. func (f *FileImage) writeDescriptors() error { if _, err := f.rw.Seek(f.h.DescriptorsOffset, io.SeekStart); err != nil { return err } return binary.Write(f.rw, binary.LittleEndian, f.rds) } // writeHeader writes the global header in f to backing storage. func (f *FileImage) writeHeader() error { if _, err := f.rw.Seek(0, io.SeekStart); err != nil { return err } return binary.Write(f.rw, binary.LittleEndian, f.h) } // createOpts accumulates container creation options. type createOpts struct { launchScript [hdrLaunchLen]byte id uuid.UUID descriptorsOffset int64 descriptorCapacity int64 dis []DescriptorInput t time.Time closeOnUnload bool } // CreateOpt are used to specify container creation options. type CreateOpt func(*createOpts) error var errLaunchScriptLen = errors.New("launch script too large") // OptCreateWithLaunchScript specifies s as the launch script. func OptCreateWithLaunchScript(s string) CreateOpt { return func(co *createOpts) error { b := []byte(s) if len(b) >= len(co.launchScript) { return errLaunchScriptLen } copy(co.launchScript[:], b) return nil } } // OptCreateDeterministic sets header/descriptor fields to values that support deterministic // creation of images. func OptCreateDeterministic() CreateOpt { return func(co *createOpts) error { co.id = uuid.Nil co.t = time.Time{} return nil } } // OptCreateWithID specifies id as the unique ID. func OptCreateWithID(id string) CreateOpt { return func(co *createOpts) error { id, err := uuid.Parse(id) co.id = id return err } } // OptCreateWithDescriptorCapacity specifies that the created image should have the capacity for a // maximum of n descriptors. func OptCreateWithDescriptorCapacity(n int64) CreateOpt { return func(co *createOpts) error { co.descriptorCapacity = n return nil } } // OptCreateWithDescriptors appends dis to the list of descriptors. func OptCreateWithDescriptors(dis ...DescriptorInput) CreateOpt { return func(co *createOpts) error { co.dis = append(co.dis, dis...) return nil } } // OptCreateWithTime specifies t as the image creation time. func OptCreateWithTime(t time.Time) CreateOpt { return func(co *createOpts) error { co.t = t return nil } } // OptCreateWithCloseOnUnload specifies whether the ReadWriter should be closed by UnloadContainer. // By default, the ReadWriter will be closed if it implements the io.Closer interface. func OptCreateWithCloseOnUnload(b bool) CreateOpt { return func(co *createOpts) error { co.closeOnUnload = b return nil } } var errDescriptorCapacityNotSupported = errors.New("descriptor capacity not supported") // createContainer creates a new SIF container file in rw, according to opts. func createContainer(rw ReadWriter, co createOpts) (*FileImage, error) { // The supported number of descriptors is limited by the unsigned 32-bit ID field in each // rawDescriptor. if co.descriptorCapacity >= math.MaxUint32 { return nil, errDescriptorCapacityNotSupported } rds := make([]rawDescriptor, co.descriptorCapacity) rdsSize := int64(binary.Size(rds)) h := header{ LaunchScript: co.launchScript, Magic: hdrMagic, Version: CurrentVersion.bytes(), Arch: hdrArchUnknown, ID: co.id, CreatedAt: co.t.Unix(), ModifiedAt: co.t.Unix(), DescriptorsFree: co.descriptorCapacity, DescriptorsTotal: co.descriptorCapacity, DescriptorsOffset: co.descriptorsOffset, DescriptorsSize: rdsSize, DataOffset: co.descriptorsOffset + rdsSize, } f := &FileImage{ rw: rw, h: h, rds: rds, minIDs: make(map[uint32]uint32), } for i, di := range co.dis { if err := f.writeDataObject(i, di, co.t); err != nil { return nil, err } } if err := f.writeDescriptors(); err != nil { return nil, err } if err := f.writeHeader(); err != nil { return nil, err } return f, nil } // CreateContainer creates a new SIF container in rw, according to opts. One or more data objects // can optionally be specified using OptCreateWithDescriptors. // // On success, a FileImage is returned. The caller must call UnloadContainer to ensure resources // are released. By default, UnloadContainer will close rw if it implements the io.Closer // interface. To change this behavior, consider using OptCreateWithCloseOnUnload. // // By default, the image ID is set to a randomly generated value. To override this, consider using // OptCreateDeterministic or OptCreateWithID. // // By default, the image creation time is set to the current time. To override this, consider using // OptCreateDeterministic or OptCreateWithTime. // // By default, the image will support a maximum of 48 descriptors. To change this, consider using // OptCreateWithDescriptorCapacity. // // A launch script can optionally be set using OptCreateWithLaunchScript. func CreateContainer(rw ReadWriter, opts ...CreateOpt) (*FileImage, error) { id, err := uuid.NewRandom() if err != nil { return nil, err } co := createOpts{ id: id, descriptorsOffset: 4096, descriptorCapacity: 48, t: time.Now(), closeOnUnload: true, } for _, opt := range opts { if err := opt(&co); err != nil { return nil, fmt.Errorf("%w", err) } } f, err := createContainer(rw, co) if err != nil { return nil, fmt.Errorf("%w", err) } f.closeOnUnload = co.closeOnUnload return f, nil } // CreateContainerAtPath creates a new SIF container file at path, according to opts. One or more // data objects can optionally be specified using OptCreateWithDescriptors. // // On success, a FileImage is returned. The caller must call UnloadContainer to ensure resources // are released. // // By default, the image ID is set to a randomly generated value. To override this, consider using // OptCreateDeterministic or OptCreateWithID. // // By default, the image creation time is set to the current time. To override this, consider using // OptCreateDeterministic or OptCreateWithTime. // // By default, the image will support a maximum of 48 descriptors. To change this, consider using // OptCreateWithDescriptorCapacity. // // A launch script can optionally be set using OptCreateWithLaunchScript. func CreateContainerAtPath(path string, opts ...CreateOpt) (*FileImage, error) { fp, err := os.OpenFile(path, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0o755) if err != nil { return nil, fmt.Errorf("%w", err) } f, err := CreateContainer(fp, opts...) if err != nil { fp.Close() os.Remove(fp.Name()) return nil, err } f.closeOnUnload = true return f, nil } ================================================ FILE: vendor/github.com/sylabs/sif/v2/pkg/sif/delete.go ================================================ // Copyright (c) 2018-2024, Sylabs Inc. All rights reserved. // Copyright (c) 2017, SingularityWare, LLC. All rights reserved. // Copyright (c) 2017, Yannick Cote All rights reserved. // This software is licensed under a 3-clause BSD license. Please consult the // LICENSE file distributed with the sources of this project regarding your // rights to use or distribute this software. package sif import ( "fmt" "io" "time" ) // zeroReader is an io.Reader that returns a stream of zero-bytes. type zeroReader struct{} func (zeroReader) Read(b []byte) (int, error) { clear(b) return len(b), nil } // zero overwrites the data object described by d with a stream of zero bytes. func (f *FileImage) zero(d *rawDescriptor) error { if _, err := f.rw.Seek(d.Offset, io.SeekStart); err != nil { return err } _, err := io.CopyN(f.rw, zeroReader{}, d.Size) return err } // deleteOpts accumulates object deletion options. type deleteOpts struct { zero bool compact bool t time.Time } // DeleteOpt are used to specify object deletion options. type DeleteOpt func(*deleteOpts) error // OptDeleteZero specifies whether the deleted object should be zeroed. func OptDeleteZero(b bool) DeleteOpt { return func(do *deleteOpts) error { do.zero = b return nil } } // OptDeleteCompact specifies whether the image should be compacted following object deletion. func OptDeleteCompact(b bool) DeleteOpt { return func(do *deleteOpts) error { do.compact = b return nil } } // OptDeleteDeterministic sets header/descriptor fields to values that support deterministic // modification of images. func OptDeleteDeterministic() DeleteOpt { return func(do *deleteOpts) error { do.t = time.Time{} return nil } } // OptDeleteWithTime specifies t as the image modification time. func OptDeleteWithTime(t time.Time) DeleteOpt { return func(do *deleteOpts) error { do.t = t return nil } } // DeleteObject deletes the data object with id, according to opts. If no matching descriptor is // found, an error wrapping ErrObjectNotFound is returned. // // To zero the data region of the deleted object, use OptDeleteZero. To remove unused space at the // end of the FileImage following object deletion, use OptDeleteCompact. // // By default, the image modification time is set to the current time for non-deterministic images, // and unset otherwise. To override this, consider using OptDeleteDeterministic or // OptDeleteWithTime. func (f *FileImage) DeleteObject(id uint32, opts ...DeleteOpt) error { return f.DeleteObjects(WithID(id), opts...) } // DeleteObjects deletes the data objects selected by fn, according to opts. If no descriptors are // selected by fns, an error wrapping ErrObjectNotFound is returned. // // To zero the data region of the deleted object, use OptDeleteZero. To remove unused space at the // end of the FileImage following object deletion, use OptDeleteCompact. // // By default, the image modification time is set to the current time for non-deterministic images, // and unset otherwise. To override this, consider using OptDeleteDeterministic or // OptDeleteWithTime. func (f *FileImage) DeleteObjects(fn DescriptorSelectorFunc, opts ...DeleteOpt) error { do := deleteOpts{} if !f.isDeterministic() { do.t = time.Now() } for _, opt := range opts { if err := opt(&do); err != nil { return fmt.Errorf("%w", err) } } var selected bool if err := f.withDescriptors(fn, func(d *rawDescriptor) error { selected = true if do.zero { if err := f.zero(d); err != nil { return fmt.Errorf("%w", err) } } f.h.DescriptorsFree++ // If we remove the primary partition, set the global header Arch field to HdrArchUnknown // to indicate that the SIF file doesn't include a primary partition and no dependency // on any architecture exists. if d.isPartitionOfType(PartPrimSys) { f.h.Arch = hdrArchUnknown } // Reset rawDescripter with empty struct *d = rawDescriptor{} return nil }); err != nil { return fmt.Errorf("%w", err) } if !selected { return fmt.Errorf("%w", ErrObjectNotFound) } f.h.ModifiedAt = do.t.Unix() if do.compact { f.h.DataSize = f.calculatedDataSize() if err := f.rw.Truncate(f.h.DataOffset + f.h.DataSize); err != nil { return fmt.Errorf("%w", err) } } if err := f.writeDescriptors(); err != nil { return fmt.Errorf("%w", err) } if err := f.writeHeader(); err != nil { return fmt.Errorf("%w", err) } return nil } ================================================ FILE: vendor/github.com/sylabs/sif/v2/pkg/sif/descriptor.go ================================================ // Copyright (c) 2018-2024, Sylabs Inc. All rights reserved. // Copyright (c) 2017, SingularityWare, LLC. All rights reserved. // Copyright (c) 2017, Yannick Cote All rights reserved. // This software is licensed under a 3-clause BSD license. Please consult the // LICENSE file distributed with the sources of this project regarding your // rights to use or distribute this software. package sif import ( "bytes" "crypto" "crypto/sha256" "encoding" "encoding/binary" "encoding/hex" "errors" "fmt" "hash" "io" "strings" "time" v1 "github.com/google/go-containerregistry/pkg/v1" ) // rawDescriptor represents an on-disk object descriptor. type rawDescriptor struct { DataType DataType Used bool ID uint32 GroupID uint32 LinkedID uint32 Offset int64 Size int64 SizeWithPadding int64 CreatedAt int64 ModifiedAt int64 UID int64 // Deprecated: UID exists for historical compatibility and should not be used. GID int64 // Deprecated: GID exists for historical compatibility and should not be used. Name [descrNameLen]byte Extra [descrMaxPrivLen]byte } // partition represents the SIF partition data object descriptor. type partition struct { Fstype FSType Parttype PartType Arch archType } // MarshalBinary encodes p into binary format. func (p partition) MarshalBinary() ([]byte, error) { return binaryMarshaler{p}.MarshalBinary() } // signature represents the SIF signature data object descriptor. type signature struct { Hashtype hashType Entity [descrEntityLen]byte } // cryptoMessage represents the SIF crypto message object descriptor. type cryptoMessage struct { Formattype FormatType Messagetype MessageType } // sbom represents the SIF SBOM data object descriptor. type sbom struct { Format SBOMFormat } // ociBlob represents the OCI Blob data object descriptor. type ociBlob struct { hasher hash.Hash // accumulates hash while writing blob. digest v1.Hash } // newOCIBlobDigest returns a new ociBlob, that accumulates the digest of an OCI blob as it is // read. The caller should take care to ensure that the entire contents of the blob have been // written to the returned ociBlob prior to calling MarshalBinary. func newOCIBlobDigest() *ociBlob { return &ociBlob{ hasher: sha256.New(), digest: v1.Hash{ Algorithm: "sha256", }, } } // MarshalBinary encodes ob into binary format. func (ob *ociBlob) MarshalBinary() ([]byte, error) { if ob.digest.Hex == "" { ob.digest.Hex = hex.EncodeToString(ob.hasher.Sum(nil)) } return ob.digest.MarshalText() } // UnmarshalBinary decodes b into ob. func (ob *ociBlob) UnmarshalBinary(b []byte) error { if before, _, ok := bytes.Cut(b, []byte{0x00}); ok { b = before } return ob.digest.UnmarshalText(b) } // The binaryMarshaler type is an adapter that allows a type suitable for use with the // encoding/binary package to be used as an encoding.BinaryMarshaler. type binaryMarshaler struct{ any } // MarshalBinary encodes m into binary format. func (m binaryMarshaler) MarshalBinary() ([]byte, error) { var b bytes.Buffer err := binary.Write(&b, binary.LittleEndian, m.any) return b.Bytes(), err } // The binaryUnmarshaler type is an adapter that allows a type suitable for use with the // encoding/binary package to be used as an encoding.BinaryUnmarshaler. type binaryUnmarshaler struct{ any } // UnmarshalBinary decodes b into u. func (u binaryUnmarshaler) UnmarshalBinary(b []byte) error { return binary.Read(bytes.NewReader(b), binary.LittleEndian, u.any) } var errNameTooLarge = errors.New("name value too large") // setName encodes name into the name field of d. func (d *rawDescriptor) setName(name string) error { if len(name) > len(d.Name) { return errNameTooLarge } for i := copy(d.Name[:], name); i < len(d.Name); i++ { d.Name[i] = 0 } return nil } var errExtraTooLarge = errors.New("extra value too large") // setExtra marshals metadata from md into the "extra" field of d. func (d *rawDescriptor) setExtra(md encoding.BinaryMarshaler) error { if md == nil { return nil } extra, err := md.MarshalBinary() if err != nil { return err } if len(extra) > len(d.Extra) { return errExtraTooLarge } for i := copy(d.Extra[:], extra); i < len(d.Extra); i++ { d.Extra[i] = 0 } return nil } // getExtra unmarshals metadata from the "extra" field of d into md. func (d *rawDescriptor) getExtra(md encoding.BinaryUnmarshaler) error { return md.UnmarshalBinary(d.Extra[:]) } // getPartitionMetadata gets metadata for a partition data object. func (d rawDescriptor) getPartitionMetadata() (FSType, PartType, string, error) { if got, want := d.DataType, DataPartition; got != want { return 0, 0, "", &unexpectedDataTypeError{got, []DataType{want}} } var p partition if err := d.getExtra(binaryUnmarshaler{&p}); err != nil { return 0, 0, "", err } return p.Fstype, p.Parttype, p.Arch.GoArch(), nil } // isPartitionOfType returns true if d is a partition data object of type pt. func (d rawDescriptor) isPartitionOfType(pt PartType) bool { _, t, _, err := d.getPartitionMetadata() if err != nil { return false } return t == pt } // Descriptor represents the SIF descriptor type. type Descriptor struct { r io.ReaderAt // Backing storage. raw rawDescriptor // Raw descriptor from image. relativeID uint32 // ID relative to minimum ID of object group. } // DataType returns the type of data object. func (d Descriptor) DataType() DataType { return d.raw.DataType } // ID returns the data object ID of d. func (d Descriptor) ID() uint32 { return d.raw.ID } // GroupID returns the data object group ID of d, or zero if d is not part of a data object // group. func (d Descriptor) GroupID() uint32 { return d.raw.GroupID &^ descrGroupMask } // LinkedID returns the object/group ID d is linked to, or zero if d does not contain a linked // ID. If isGroup is true, the returned id is an object group ID. Otherwise, the returned id is a // data object ID. // //nolint:nonamedreturns // Named returns effective as documentation. func (d Descriptor) LinkedID() (id uint32, isGroup bool) { return d.raw.LinkedID &^ descrGroupMask, d.raw.LinkedID&descrGroupMask == descrGroupMask } // Offset returns the offset of the data object. func (d Descriptor) Offset() int64 { return d.raw.Offset } // Size returns the data object size. func (d Descriptor) Size() int64 { return d.raw.Size } // CreatedAt returns the creation time of the data object. func (d Descriptor) CreatedAt() time.Time { return time.Unix(d.raw.CreatedAt, 0) } // ModifiedAt returns the modification time of the data object. func (d Descriptor) ModifiedAt() time.Time { return time.Unix(d.raw.ModifiedAt, 0) } // Name returns the name of the data object. func (d Descriptor) Name() string { return strings.TrimRight(string(d.raw.Name[:]), "\000") } // GetMetadata unmarshals metadata from the "extra" field of d into md. func (d Descriptor) GetMetadata(md encoding.BinaryUnmarshaler) error { if err := d.raw.getExtra(md); err != nil { return fmt.Errorf("%w", err) } return nil } // PartitionMetadata gets metadata for a partition data object. // //nolint:nonamedreturns // Named returns effective as documentation. func (d Descriptor) PartitionMetadata() (fs FSType, pt PartType, arch string, err error) { fs, pt, arch, err = d.raw.getPartitionMetadata() if err != nil { return 0, 0, "", fmt.Errorf("%w", err) } return fs, pt, arch, err } var errHashUnsupported = errors.New("hash algorithm unsupported") // getHashType converts ht into a crypto.Hash. func getHashType(ht hashType) (crypto.Hash, error) { switch ht { case hashSHA256: return crypto.SHA256, nil case hashSHA384: return crypto.SHA384, nil case hashSHA512: return crypto.SHA512, nil case hashBLAKE2S: return crypto.BLAKE2s_256, nil case hashBLAKE2B: return crypto.BLAKE2b_256, nil } return 0, errHashUnsupported } // SignatureMetadata gets metadata for a signature data object. // //nolint:nonamedreturns // Named returns effective as documentation. func (d Descriptor) SignatureMetadata() (ht crypto.Hash, fp []byte, err error) { if got, want := d.raw.DataType, DataSignature; got != want { return ht, fp, &unexpectedDataTypeError{got, []DataType{want}} } var s signature if err := d.raw.getExtra(binaryUnmarshaler{&s}); err != nil { return ht, fp, fmt.Errorf("%w", err) } if ht, err = getHashType(s.Hashtype); err != nil { return ht, fp, fmt.Errorf("%w", err) } fp = make([]byte, 20) if bytes.Equal(s.Entity[:len(fp)], fp) { return ht, nil, nil // Fingerprint not present. } copy(fp, s.Entity[:]) return ht, fp, nil } // CryptoMessageMetadata gets metadata for a crypto message data object. func (d Descriptor) CryptoMessageMetadata() (FormatType, MessageType, error) { if got, want := d.raw.DataType, DataCryptoMessage; got != want { return 0, 0, &unexpectedDataTypeError{got, []DataType{want}} } var m cryptoMessage if err := d.raw.getExtra(binaryUnmarshaler{&m}); err != nil { return 0, 0, fmt.Errorf("%w", err) } return m.Formattype, m.Messagetype, nil } // SBOMMetadata gets metadata for a SBOM data object. func (d Descriptor) SBOMMetadata() (SBOMFormat, error) { if got, want := d.raw.DataType, DataSBOM; got != want { return 0, &unexpectedDataTypeError{got, []DataType{want}} } var s sbom if err := d.raw.getExtra(binaryUnmarshaler{&s}); err != nil { return 0, fmt.Errorf("%w", err) } return s.Format, nil } // OCIBlobDigest returns the digest for a OCI blob object. func (d Descriptor) OCIBlobDigest() (v1.Hash, error) { if got := d.raw.DataType; got != DataOCIRootIndex && got != DataOCIBlob { return v1.Hash{}, &unexpectedDataTypeError{got, []DataType{DataOCIRootIndex, DataOCIBlob}} } var o ociBlob if err := d.raw.getExtra(&o); err != nil { return v1.Hash{}, fmt.Errorf("%w", err) } return o.digest, nil } // GetData returns the data object associated with descriptor d. func (d Descriptor) GetData() ([]byte, error) { b := make([]byte, d.raw.Size) if _, err := io.ReadFull(d.GetReader(), b); err != nil { return nil, err } return b, nil } // GetReader returns a io.Reader that reads the data object associated with descriptor d. func (d Descriptor) GetReader() io.Reader { return io.NewSectionReader(d.r, d.raw.Offset, d.raw.Size) } // GetIntegrityReader returns an io.Reader that reads the integrity-protected fields from d. func (d Descriptor) GetIntegrityReader() io.Reader { fields := []interface{}{ d.raw.DataType, d.raw.Used, d.relativeID, d.raw.LinkedID, d.raw.Size, d.raw.CreatedAt, d.raw.UID, d.raw.GID, } // Encode endian-sensitive fields. data := bytes.Buffer{} for _, f := range fields { if err := binary.Write(&data, binary.LittleEndian, f); err != nil { panic(err) // (*bytes.Buffer).Write() is documented as always returning a nil error. } } return io.MultiReader( &data, bytes.NewReader(d.raw.Name[:]), bytes.NewReader(d.raw.Extra[:]), ) } ================================================ FILE: vendor/github.com/sylabs/sif/v2/pkg/sif/descriptor_input.go ================================================ // Copyright (c) 2021-2024, Sylabs Inc. All rights reserved. // This software is licensed under a 3-clause BSD license. Please consult the // LICENSE file distributed with the sources of this project regarding your // rights to use or distribute this software. package sif import ( "crypto" "encoding" "errors" "fmt" "io" "time" ) // descriptorOpts accumulates data object options. type descriptorOpts struct { groupID uint32 linkID uint32 alignment int name string md encoding.BinaryMarshaler t time.Time } // DescriptorInputOpt are used to specify data object options. type DescriptorInputOpt func(DataType, *descriptorOpts) error // OptNoGroup specifies the data object is not contained within a data object group. func OptNoGroup() DescriptorInputOpt { return func(_ DataType, opts *descriptorOpts) error { opts.groupID = 0 return nil } } // OptGroupID specifies groupID as data object group ID. func OptGroupID(groupID uint32) DescriptorInputOpt { return func(_ DataType, opts *descriptorOpts) error { if groupID == 0 { return ErrInvalidGroupID } opts.groupID = groupID return nil } } // OptLinkedID specifies that the data object is linked to the data object with the specified ID. func OptLinkedID(id uint32) DescriptorInputOpt { return func(_ DataType, opts *descriptorOpts) error { if id == 0 { return ErrInvalidObjectID } opts.linkID = id return nil } } // OptLinkedGroupID specifies that the data object is linked to the data object group with the // specified groupID. func OptLinkedGroupID(groupID uint32) DescriptorInputOpt { return func(_ DataType, opts *descriptorOpts) error { if groupID == 0 { return ErrInvalidGroupID } opts.linkID = groupID | descrGroupMask return nil } } // OptObjectAlignment specifies n as the data alignment requirement. func OptObjectAlignment(n int) DescriptorInputOpt { return func(_ DataType, opts *descriptorOpts) error { opts.alignment = n return nil } } // OptObjectName specifies name as the data object name. func OptObjectName(name string) DescriptorInputOpt { return func(_ DataType, opts *descriptorOpts) error { opts.name = name return nil } } // OptObjectTime specifies t as the data object creation time. func OptObjectTime(t time.Time) DescriptorInputOpt { return func(_ DataType, opts *descriptorOpts) error { opts.t = t return nil } } // OptMetadata marshals metadata from md into the "extra" field of d. func OptMetadata(md encoding.BinaryMarshaler) DescriptorInputOpt { return func(_ DataType, opts *descriptorOpts) error { opts.md = md return nil } } type unexpectedDataTypeError struct { got DataType want []DataType } func (e *unexpectedDataTypeError) Error() string { return fmt.Sprintf("unexpected data type %v, expected one of: %v", e.got, e.want) } func (e *unexpectedDataTypeError) Is(target error) bool { t, ok := target.(*unexpectedDataTypeError) if !ok { return false } if len(t.want) > 0 { // Use a map to check that the "want" errors in e and t contain the same values, ignoring // any ordering differences. acc := make(map[DataType]int, len(t.want)) // Increment counter for each data type in e. for _, dt := range e.want { if _, ok := acc[dt]; !ok { acc[dt] = 0 } acc[dt]++ } // Decrement counter for each data type in e. for _, dt := range t.want { if _, ok := acc[dt]; !ok { return false } acc[dt]-- } // If the "want" errors in e and t are equivalent, all counters should be zero. for _, n := range acc { if n != 0 { return false } } } return (e.got == t.got || t.got == 0) } // OptCryptoMessageMetadata sets metadata for a crypto message data object. The format type is set // to ft, and the message type is set to mt. // // If this option is applied to a data object with an incompatible type, an error is returned. func OptCryptoMessageMetadata(ft FormatType, mt MessageType) DescriptorInputOpt { return func(t DataType, opts *descriptorOpts) error { if got, want := t, DataCryptoMessage; got != want { return &unexpectedDataTypeError{got, []DataType{want}} } m := cryptoMessage{ Formattype: ft, Messagetype: mt, } opts.md = binaryMarshaler{m} return nil } } var errUnknownArchitcture = errors.New("unknown architecture") // OptPartitionMetadata sets metadata for a partition data object. The filesystem type is set to // fs, the partition type is set to pt, and the CPU architecture is set to arch. The value of arch // should be the architecture as represented by the Go runtime. // // If this option is applied to a data object with an incompatible type, an error is returned. func OptPartitionMetadata(fs FSType, pt PartType, arch string) DescriptorInputOpt { return func(t DataType, opts *descriptorOpts) error { if got, want := t, DataPartition; got != want { return &unexpectedDataTypeError{got, []DataType{want}} } sifarch := getSIFArch(arch) if sifarch == hdrArchUnknown { return fmt.Errorf("%w: %v", errUnknownArchitcture, arch) } p := partition{ Fstype: fs, Parttype: pt, Arch: sifarch, } opts.md = p return nil } } // sifHashType converts h into a HashType. func sifHashType(h crypto.Hash) hashType { switch h { case crypto.SHA256: return hashSHA256 case crypto.SHA384: return hashSHA384 case crypto.SHA512: return hashSHA512 case crypto.BLAKE2s_256: return hashBLAKE2S case crypto.BLAKE2b_256: return hashBLAKE2B } return 0 } // OptSignatureMetadata sets metadata for a signature data object. The hash type is set to ht, and // the signing entity fingerprint is set to fp. // // If this option is applied to a data object with an incompatible type, an error is returned. func OptSignatureMetadata(ht crypto.Hash, fp []byte) DescriptorInputOpt { return func(t DataType, opts *descriptorOpts) error { if got, want := t, DataSignature; got != want { return &unexpectedDataTypeError{got, []DataType{want}} } s := signature{ Hashtype: sifHashType(ht), } copy(s.Entity[:], fp) opts.md = binaryMarshaler{s} return nil } } // OptSBOMMetadata sets metadata for a SBOM data object. The SBOM format is set to f. // // If this option is applied to a data object with an incompatible type, an error is returned. func OptSBOMMetadata(f SBOMFormat) DescriptorInputOpt { return func(t DataType, opts *descriptorOpts) error { if got, want := t, DataSBOM; got != want { return &unexpectedDataTypeError{got, []DataType{want}} } s := sbom{ Format: f, } opts.md = binaryMarshaler{s} return nil } } // DescriptorInput describes a new data object. type DescriptorInput struct { dt DataType r io.Reader opts descriptorOpts } // DefaultObjectGroup is the default group that data objects are placed in. const DefaultObjectGroup = 1 // NewDescriptorInput returns a DescriptorInput representing a data object of type t, with contents // read from r, configured according to opts. // // It is possible (and often necessary) to store additional metadata related to certain types of // data objects. Consider supplying options such as OptCryptoMessageMetadata, OptPartitionMetadata, // OptSignatureMetadata, and OptSBOMMetadata for this purpose. To set custom metadata, use // OptMetadata. // // By default, the data object will be placed in the default data object group (1). To override // this behavior, use OptNoGroup or OptGroupID. To link this data object, use OptLinkedID or // OptLinkedGroupID. // // By default, the data object will not be aligned unless it is of type DataPartition, in which // case it will be aligned on a 4096 byte boundary. To override this behavior, consider using // OptObjectAlignment. // // By default, no name is set for data object. To set a name, use OptObjectName. // // When creating a new image, data object creation/modification times are set to the image creation // time. When modifying an existing image, the data object creation/modification time is set to the // image modification time. To override this behavior, consider using OptObjectTime. func NewDescriptorInput(t DataType, r io.Reader, opts ...DescriptorInputOpt) (DescriptorInput, error) { dopts := descriptorOpts{ groupID: DefaultObjectGroup, } if t == DataPartition { dopts.alignment = 4096 } // Accumulate hash for OCI blobs as they are written. if t == DataOCIRootIndex || t == DataOCIBlob { md := newOCIBlobDigest() r = io.TeeReader(r, md.hasher) dopts.md = md } for _, opt := range opts { if err := opt(t, &dopts); err != nil { return DescriptorInput{}, fmt.Errorf("%w", err) } } di := DescriptorInput{ dt: t, r: r, opts: dopts, } return di, nil } // fillDescriptor fills d according to di. If di does not explicitly specify a time value, use t. func (di DescriptorInput) fillDescriptor(t time.Time, d *rawDescriptor) error { d.DataType = di.dt d.GroupID = di.opts.groupID | descrGroupMask d.LinkedID = di.opts.linkID if !di.opts.t.IsZero() { t = di.opts.t } d.CreatedAt = t.Unix() d.ModifiedAt = t.Unix() d.UID = 0 d.GID = 0 if err := d.setName(di.opts.name); err != nil { return err } return d.setExtra(di.opts.md) } ================================================ FILE: vendor/github.com/sylabs/sif/v2/pkg/sif/load.go ================================================ // Copyright (c) 2018-2021, Sylabs Inc. All rights reserved. // Copyright (c) 2017, SingularityWare, LLC. All rights reserved. // Copyright (c) 2017, Yannick Cote All rights reserved. // This software is licensed under a 3-clause BSD license. Please consult the // LICENSE file distributed with the sources of this project regarding your // rights to use or distribute this software. package sif import ( "encoding/binary" "errors" "fmt" "io" "os" ) var ( errInvalidMagic = errors.New("invalid SIF magic") errIncompatibleVersion = errors.New("incompatible SIF version") ) // isValidSif looks at key fields from the global header to assess SIF validity. func isValidSif(f *FileImage) error { if f.h.Magic != hdrMagic { return errInvalidMagic } if f.h.Version != CurrentVersion.bytes() { return errIncompatibleVersion } return nil } // populateMinIDs populates the minIDs field of f. func (f *FileImage) populateMinIDs() { f.minIDs = make(map[uint32]uint32) f.WithDescriptors(func(d Descriptor) bool { if minID, ok := f.minIDs[d.raw.GroupID]; !ok || d.ID() < minID { f.minIDs[d.raw.GroupID] = d.ID() } return false }) } // loadContainer loads a SIF image from rw. func loadContainer(rw ReadWriter) (*FileImage, error) { f := FileImage{rw: rw} // Read global header. err := binary.Read( io.NewSectionReader(rw, 0, int64(binary.Size(f.h))), binary.LittleEndian, &f.h, ) if err != nil { return nil, fmt.Errorf("reading global header: %w", err) } if err := isValidSif(&f); err != nil { return nil, err } // Read descriptors. f.rds = make([]rawDescriptor, f.h.DescriptorsTotal) err = binary.Read( io.NewSectionReader(rw, f.h.DescriptorsOffset, f.h.DescriptorsSize), binary.LittleEndian, &f.rds, ) if err != nil { return nil, fmt.Errorf("reading descriptors: %w", err) } f.populateMinIDs() return &f, nil } // loadOpts accumulates container loading options. type loadOpts struct { flag int closeOnUnload bool } // LoadOpt are used to specify container loading options. type LoadOpt func(*loadOpts) error // OptLoadWithFlag specifies flag (os.O_RDONLY etc.) to be used when opening the container file. func OptLoadWithFlag(flag int) LoadOpt { return func(lo *loadOpts) error { lo.flag = flag return nil } } // OptLoadWithCloseOnUnload specifies whether the ReadWriter should be closed by UnloadContainer. // By default, the ReadWriter will be closed if it implements the io.Closer interface. func OptLoadWithCloseOnUnload(b bool) LoadOpt { return func(lo *loadOpts) error { lo.closeOnUnload = b return nil } } // LoadContainerFromPath loads a new SIF container from path, according to opts. // // On success, a FileImage is returned. The caller must call UnloadContainer to ensure resources // are released. // // By default, the file is opened for read and write access. To change this behavior, consider // using OptLoadWithFlag. func LoadContainerFromPath(path string, opts ...LoadOpt) (*FileImage, error) { lo := loadOpts{ flag: os.O_RDWR, } for _, opt := range opts { if err := opt(&lo); err != nil { return nil, fmt.Errorf("%w", err) } } fp, err := os.OpenFile(path, lo.flag, 0) if err != nil { return nil, fmt.Errorf("%w", err) } f, err := loadContainer(fp) if err != nil { fp.Close() return nil, fmt.Errorf("%w", err) } f.closeOnUnload = true return f, nil } // LoadContainer loads a new SIF container from rw, according to opts. // // On success, a FileImage is returned. The caller must call UnloadContainer to ensure resources // are released. By default, UnloadContainer will close rw if it implements the io.Closer // interface. To change this behavior, consider using OptLoadWithCloseOnUnload. func LoadContainer(rw ReadWriter, opts ...LoadOpt) (*FileImage, error) { lo := loadOpts{ closeOnUnload: true, } for _, opt := range opts { if err := opt(&lo); err != nil { return nil, fmt.Errorf("%w", err) } } f, err := loadContainer(rw) if err != nil { return nil, fmt.Errorf("%w", err) } f.closeOnUnload = lo.closeOnUnload return f, nil } // UnloadContainer unloads f, releasing associated resources. func (f *FileImage) UnloadContainer() error { if c, ok := f.rw.(io.Closer); ok && f.closeOnUnload { if err := c.Close(); err != nil { return fmt.Errorf("%w", err) } } return nil } ================================================ FILE: vendor/github.com/sylabs/sif/v2/pkg/sif/select.go ================================================ // Copyright (c) 2021-2024, Sylabs Inc. All rights reserved. // This software is licensed under a 3-clause BSD license. Please consult the // LICENSE file distributed with the sources of this project regarding your // rights to use or distribute this software. package sif import ( "errors" "fmt" v1 "github.com/google/go-containerregistry/pkg/v1" ) // ErrNoObjects is the error returned when an image contains no data objects. var ErrNoObjects = errors.New("no objects in image") // ErrObjectNotFound is the error returned when a data object is not found. var ErrObjectNotFound = errors.New("object not found") // ErrMultipleObjectsFound is the error returned when multiple data objects are found. var ErrMultipleObjectsFound = errors.New("multiple objects found") // ErrInvalidObjectID is the error returned when an invalid object ID is supplied. var ErrInvalidObjectID = errors.New("invalid object ID") // ErrInvalidGroupID is the error returned when an invalid group ID is supplied. var ErrInvalidGroupID = errors.New("invalid group ID") // DescriptorSelectorFunc returns true if d matches, and false otherwise. type DescriptorSelectorFunc func(d Descriptor) (bool, error) // WithDataType selects descriptors that have data type dt. func WithDataType(dt DataType) DescriptorSelectorFunc { return func(d Descriptor) (bool, error) { return d.DataType() == dt, nil } } // WithID selects descriptors with a matching ID. func WithID(id uint32) DescriptorSelectorFunc { return func(d Descriptor) (bool, error) { if id == 0 { return false, ErrInvalidObjectID } return d.ID() == id, nil } } // WithNoGroup selects descriptors that are not contained within an object group. func WithNoGroup() DescriptorSelectorFunc { return func(d Descriptor) (bool, error) { return d.GroupID() == 0, nil } } // WithGroupID returns a selector func that selects descriptors with a matching groupID. func WithGroupID(groupID uint32) DescriptorSelectorFunc { return func(d Descriptor) (bool, error) { if groupID == 0 { return false, ErrInvalidGroupID } return d.GroupID() == groupID, nil } } // WithLinkedID selects descriptors that are linked to the data object with specified ID. func WithLinkedID(id uint32) DescriptorSelectorFunc { return func(d Descriptor) (bool, error) { if id == 0 { return false, ErrInvalidObjectID } linkedID, isGroup := d.LinkedID() return !isGroup && linkedID == id, nil } } // WithLinkedGroupID selects descriptors that are linked to the data object group with specified // ID. func WithLinkedGroupID(groupID uint32) DescriptorSelectorFunc { return func(d Descriptor) (bool, error) { if groupID == 0 { return false, ErrInvalidGroupID } linkedID, isGroup := d.LinkedID() return isGroup && linkedID == groupID, nil } } // WithPartitionType selects descriptors containing a partition of type pt. func WithPartitionType(pt PartType) DescriptorSelectorFunc { return func(d Descriptor) (bool, error) { return d.raw.isPartitionOfType(pt), nil } } // WithOCIBlobDigest selects descriptors that contain a OCI blob with the specified digest. func WithOCIBlobDigest(digest v1.Hash) DescriptorSelectorFunc { return func(d Descriptor) (bool, error) { if h, err := d.OCIBlobDigest(); err == nil { return h.String() == digest.String(), nil } return false, nil } } // descriptorFromRaw populates a Descriptor from rd. func (f *FileImage) descriptorFromRaw(rd *rawDescriptor) Descriptor { return Descriptor{ raw: *rd, r: f.rw, relativeID: rd.ID - f.minIDs[rd.GroupID], } } // GetDescriptors returns a slice of in-use descriptors for which all selector funcs return true. // If the image contains no data objects, an error wrapping ErrNoObjects is returned. func (f *FileImage) GetDescriptors(fns ...DescriptorSelectorFunc) ([]Descriptor, error) { if f.DescriptorsFree() == f.DescriptorsTotal() { return nil, fmt.Errorf("%w", ErrNoObjects) } var ds []Descriptor err := f.withDescriptors(multiSelectorFunc(fns...), func(d *rawDescriptor) error { ds = append(ds, f.descriptorFromRaw(d)) return nil }) if err != nil { return nil, fmt.Errorf("%w", err) } return ds, nil } // getDescriptor returns a pointer to the in-use descriptor selected by fns. If no descriptor is // selected by fns, ErrObjectNotFound is returned. If multiple descriptors are selected by fns, // ErrMultipleObjectsFound is returned. func (f *FileImage) getDescriptor(fns ...DescriptorSelectorFunc) (*rawDescriptor, error) { var d *rawDescriptor err := f.withDescriptors(multiSelectorFunc(fns...), func(found *rawDescriptor) error { if d != nil { return ErrMultipleObjectsFound } d = found return nil }) if err == nil && d == nil { err = ErrObjectNotFound } return d, err } // GetDescriptor returns the in-use descriptor selected by fns. If the image contains no data // objects, an error wrapping ErrNoObjects is returned. If no descriptor is selected by fns, an // error wrapping ErrObjectNotFound is returned. If multiple descriptors are selected by fns, an // error wrapping ErrMultipleObjectsFound is returned. func (f *FileImage) GetDescriptor(fns ...DescriptorSelectorFunc) (Descriptor, error) { if f.DescriptorsFree() == f.DescriptorsTotal() { return Descriptor{}, fmt.Errorf("%w", ErrNoObjects) } d, err := f.getDescriptor(fns...) if err != nil { return Descriptor{}, fmt.Errorf("%w", err) } return f.descriptorFromRaw(d), nil } // multiSelectorFunc returns a DescriptorSelectorFunc that selects a descriptor iff all of fns // select the descriptor. func multiSelectorFunc(fns ...DescriptorSelectorFunc) DescriptorSelectorFunc { return func(d Descriptor) (bool, error) { for _, fn := range fns { if ok, err := fn(d); !ok || err != nil { return ok, err } } return true, nil } } var errNilSelectFunc = errors.New("descriptor selector func must not be nil") // withDescriptors calls onMatchFn with each in-use descriptor in f for which selectFn returns // true. If selectFn or onMatchFn return a non-nil error, the iteration halts, and the error is // returned to the caller. func (f *FileImage) withDescriptors(selectFn DescriptorSelectorFunc, onMatchFn func(*rawDescriptor) error) error { if selectFn == nil { return errNilSelectFunc } for i, d := range f.rds { if !d.Used { continue } if ok, err := selectFn(f.descriptorFromRaw(&f.rds[i])); err != nil { return err } else if !ok { continue } if err := onMatchFn(&f.rds[i]); err != nil { return err } } return nil } var errAbort = errors.New("abort") // abortOnMatch is a semantic convenience function that always returns a non-nil error, which can // be used as a no-op matchFn. func abortOnMatch(*rawDescriptor) error { return errAbort } // WithDescriptors calls fn with each in-use descriptor in f, until fn returns true. func (f *FileImage) WithDescriptors(fn func(d Descriptor) bool) { selectFn := func(d Descriptor) (bool, error) { return fn(d), nil } _ = f.withDescriptors(selectFn, abortOnMatch) } ================================================ FILE: vendor/github.com/sylabs/sif/v2/pkg/sif/set.go ================================================ // Copyright (c) 2018-2024, Sylabs Inc. All rights reserved. // Copyright (c) 2017, SingularityWare, LLC. All rights reserved. // Copyright (c) 2017, Yannick Cote All rights reserved. // This software is licensed under a 3-clause BSD license. Please consult the // LICENSE file distributed with the sources of this project regarding your // rights to use or distribute this software. package sif import ( "encoding" "errors" "fmt" "time" v1 "github.com/google/go-containerregistry/pkg/v1" ) // setOpts accumulates object set options. type setOpts struct { t time.Time } // SetOpt are used to specify object set options. type SetOpt func(*setOpts) error // OptSetDeterministic sets header/descriptor fields to values that support deterministic // modification of images. func OptSetDeterministic() SetOpt { return func(so *setOpts) error { so.t = time.Time{} return nil } } // OptSetWithTime specifies t as the image/object modification time. func OptSetWithTime(t time.Time) SetOpt { return func(so *setOpts) error { so.t = t return nil } } var ( errNotPartition = errors.New("data object not a partition") errNotSystem = errors.New("data object not a system partition") ) // SetPrimPart sets the specified system partition to be the primary one. // // By default, the image/object modification times are set to the current time for // non-deterministic images, and unset otherwise. To override this, consider using // OptSetDeterministic or OptSetWithTime. func (f *FileImage) SetPrimPart(id uint32, opts ...SetOpt) error { so := setOpts{} if !f.isDeterministic() { so.t = time.Now() } for _, opt := range opts { if err := opt(&so); err != nil { return fmt.Errorf("%w", err) } } descr, err := f.getDescriptor(WithID(id)) if err != nil { return fmt.Errorf("%w", err) } if descr.DataType != DataPartition { return fmt.Errorf("%w", errNotPartition) } var p partition if err := descr.getExtra(binaryUnmarshaler{&p}); err != nil { return fmt.Errorf("%w", err) } // if already primary system partition, nothing to do if p.Parttype == PartPrimSys { return nil } if p.Parttype != PartSystem { return fmt.Errorf("%w", errNotSystem) } // If there is currently a primary system partition, update it. if d, err := f.getDescriptor(WithPartitionType(PartPrimSys)); err == nil { var p partition if err := d.getExtra(binaryUnmarshaler{&p}); err != nil { return fmt.Errorf("%w", err) } p.Parttype = PartSystem if err := d.setExtra(p); err != nil { return fmt.Errorf("%w", err) } d.ModifiedAt = so.t.Unix() } else if !errors.Is(err, ErrObjectNotFound) { return fmt.Errorf("%w", err) } // Update the descriptor of the new primary system partition. p.Parttype = PartPrimSys if err := descr.setExtra(p); err != nil { return fmt.Errorf("%w", err) } descr.ModifiedAt = so.t.Unix() if err := f.writeDescriptors(); err != nil { return fmt.Errorf("%w", err) } f.h.Arch = p.Arch f.h.ModifiedAt = so.t.Unix() if err := f.writeHeader(); err != nil { return fmt.Errorf("%w", err) } return nil } // SetMetadata sets the metadata of the data object with id to md, according to opts. // // By default, the image/object modification times are set to the current time for // non-deterministic images, and unset otherwise. To override this, consider using // OptSetDeterministic or OptSetWithTime. func (f *FileImage) SetMetadata(id uint32, md encoding.BinaryMarshaler, opts ...SetOpt) error { so := setOpts{} if !f.isDeterministic() { so.t = time.Now() } for _, opt := range opts { if err := opt(&so); err != nil { return fmt.Errorf("%w", err) } } rd, err := f.getDescriptor(WithID(id)) if err != nil { return fmt.Errorf("%w", err) } if err := rd.setExtra(md); err != nil { return fmt.Errorf("%w", err) } rd.ModifiedAt = so.t.Unix() if err := f.writeDescriptors(); err != nil { return fmt.Errorf("%w", err) } f.h.ModifiedAt = so.t.Unix() if err := f.writeHeader(); err != nil { return fmt.Errorf("%w", err) } return nil } // SetOCIBlobDigest updates the digest of the OCI blob object with id to h, according to opts. // // By default, the image/object modification times are set to the current time for // non-deterministic images, and unset otherwise. To override this, consider using // OptSetDeterministic or OptSetWithTime. func (f *FileImage) SetOCIBlobDigest(id uint32, h v1.Hash, opts ...SetOpt) error { rd, err := f.getDescriptor(WithID(id)) if err != nil { return fmt.Errorf("%w", err) } if got := rd.DataType; got != DataOCIRootIndex && got != DataOCIBlob { return &unexpectedDataTypeError{got, []DataType{DataOCIRootIndex, DataOCIBlob}} } so := setOpts{} if !f.isDeterministic() { so.t = time.Now() } for _, opt := range opts { if err := opt(&so); err != nil { return fmt.Errorf("%w", err) } } md := &ociBlob{ digest: h, } if err := rd.setExtra(md); err != nil { return fmt.Errorf("%w", err) } rd.ModifiedAt = so.t.Unix() if err := f.writeDescriptors(); err != nil { return fmt.Errorf("%w", err) } f.h.ModifiedAt = so.t.Unix() if err := f.writeHeader(); err != nil { return fmt.Errorf("%w", err) } return nil } ================================================ FILE: vendor/github.com/sylabs/sif/v2/pkg/sif/sif.go ================================================ // Copyright (c) 2018-2023, Sylabs Inc. All rights reserved. // Copyright (c) 2017, SingularityWare, LLC. All rights reserved. // Copyright (c) 2017, Yannick Cote All rights reserved. // This software is licensed under a 3-clause BSD license. Please consult the // LICENSE file distributed with the sources of this project regarding your // rights to use or distribute this software. // Package sif implements data structures and routines to create // and access SIF files. // // Layout of a SIF file (example): // // .================================================. // | GLOBAL HEADER: Sifheader | // | - launch: "#!/usr/bin/env..." | // | - magic: "SIF_MAGIC" | // | - version: "1" | // | - arch: "4" | // | - uuid: b2659d4e-bd50-4ea5-bd17-eec5e54f918e | // | - ctime: 1504657553 | // | - mtime: 1504657653 | // | - ndescr: 3 | // | - descroff: 120 | --. // | - descrlen: 432 | | // | - dataoff: 4096 | | // | - datalen: 619362 | | // |------------------------------------------------| <-' // | DESCR[0]: Sifdeffile | // | - Sifcommon | // | - datatype: DATA_DEFFILE | // | - id: 1 | // | - groupid: 1 | // | - link: NONE | // | - fileoff: 4096 | --. // | - filelen: 222 | | // |------------------------------------------------| <-----. // | DESCR[1]: Sifpartition | | | // | - Sifcommon | | | // | - datatype: DATA_PARTITION | | | // | - id: 2 | | | // | - groupid: 1 | | | // | - link: NONE | | | // | - fileoff: 4318 | ----. | // | - filelen: 618496 | | | | // | - fstype: Squashfs | | | | // | - parttype: System | | | | // | - content: Linux | | | | // |------------------------------------------------| | | | // | DESCR[2]: Sifsignature | | | | // | - Sifcommon | | | | // | - datatype: DATA_SIGNATURE | | | | // | - id: 3 | | | | // | - groupid: NONE | | | | // | - link: 2 | ------' // | - fileoff: 622814 | ------. // | - filelen: 644 | | | | // | - hashtype: SHA384 | | | | // | - entity: @ | | | | // |------------------------------------------------| <-' | | // | Definition file data | | | // | . | | | // | . | | | // | . | | | // |------------------------------------------------| <---' | // | File system partition image | | // | . | | // | . | | // | . | | // |------------------------------------------------| <-----' // | Signed verification data | // | . | // | . | // | . | // `================================================' package sif import ( "bytes" "fmt" "io" "time" "github.com/google/uuid" ) // SIF header constants and quantities. const ( hdrLaunchLen = 32 // len("#!/usr/bin/env... ") hdrMagicLen = 10 // len("SIF_MAGIC") hdrVersionLen = 3 // len("99") ) var hdrMagic = [...]byte{'S', 'I', 'F', '_', 'M', 'A', 'G', 'I', 'C', '\x00'} // SpecVersion specifies a SIF specification version. type SpecVersion uint8 func (v SpecVersion) String() string { return fmt.Sprintf("%02d", v) } // bytes returns the value of b, formatted for direct inclusion in a SIF header. func (v SpecVersion) bytes() [hdrVersionLen]byte { var b [3]byte copy(b[:], fmt.Sprintf("%02d", v)) return b } // SIF specification versions. const ( version01 SpecVersion = iota + 1 ) // CurrentVersion specifies the current SIF specification version. const CurrentVersion = version01 const ( descrGroupMask = 0xf0000000 // groups start at that offset descrEntityLen = 256 // len("Joe Bloe ...") descrNameLen = 128 // descriptor name (string identifier) descrMaxPrivLen = 384 // size reserved for descriptor specific data ) // DataType represents the different SIF data object types stored in the image. type DataType int32 // List of supported SIF data types. const ( DataDeffile DataType = iota + 0x4001 // definition file data object DataEnvVar // environment variables data object DataLabels // JSON labels data object DataPartition // file system data object DataSignature // signing/verification data object DataGenericJSON // generic JSON meta-data DataGeneric // generic / raw data DataCryptoMessage // cryptographic message data object DataSBOM // software bill of materials DataOCIRootIndex // root OCI index DataOCIBlob // oci blob data object ) // String returns a human-readable representation of t. func (t DataType) String() string { switch t { case DataDeffile: return "Def.FILE" case DataEnvVar: return "Env.Vars" case DataLabels: return "JSON.Labels" case DataPartition: return "FS" case DataSignature: return "Signature" case DataGenericJSON: return "JSON.Generic" case DataGeneric: return "Generic/Raw" case DataCryptoMessage: return "Cryptographic Message" case DataSBOM: return "SBOM" case DataOCIRootIndex: return "OCI.RootIndex" case DataOCIBlob: return "OCI.Blob" } return "Unknown" } // FSType represents the different SIF file system types found in partition data objects. type FSType int32 // List of supported file systems. const ( FsSquash FSType = iota + 1 // Squashfs file system, RDONLY FsExt3 // EXT3 file system, RDWR (deprecated) FsImmuObj // immutable data object archive FsRaw // raw data FsEncryptedSquashfs // Encrypted Squashfs file system, RDONLY ) // String returns a human-readable representation of t. func (t FSType) String() string { switch t { case FsSquash: return "Squashfs" case FsExt3: return "Ext3" case FsImmuObj: return "Archive" case FsRaw: return "Raw" case FsEncryptedSquashfs: return "Encrypted squashfs" } return "Unknown" } // PartType represents the different SIF container partition types (system and data). type PartType int32 // List of supported partition types. const ( PartSystem PartType = iota + 1 // partition hosts an operating system PartPrimSys // partition hosts the primary operating system PartData // partition hosts data only PartOverlay // partition hosts an overlay ) // String returns a human-readable representation of t. func (t PartType) String() string { switch t { case PartSystem: return "System" case PartPrimSys: return "*System" case PartData: return "Data" case PartOverlay: return "Overlay" } return "Unknown" } // hashType represents the different SIF hashing function types used to fingerprint data objects. type hashType int32 // List of supported hash functions. const ( hashSHA256 hashType = iota + 1 hashSHA384 hashSHA512 hashBLAKE2S hashBLAKE2B ) // FormatType represents the different formats used to store cryptographic message objects. type FormatType int32 // List of supported cryptographic message formats. const ( FormatOpenPGP FormatType = iota + 1 FormatPEM ) // String returns a human-readable representation of t. func (t FormatType) String() string { switch t { case FormatOpenPGP: return "OpenPGP" case FormatPEM: return "PEM" } return "Unknown" } // MessageType represents the different messages stored within cryptographic message objects. type MessageType int32 // List of supported cryptographic message formats. const ( // openPGP formatted messages. MessageClearSignature MessageType = 0x100 // PEM formatted messages. MessageRSAOAEP MessageType = 0x200 ) // String returns a human-readable representation of t. func (t MessageType) String() string { switch t { case MessageClearSignature: return "Clear Signature" case MessageRSAOAEP: return "RSA-OAEP" } return "Unknown" } // SBOMFormat represents the format used to store an SBOM object. type SBOMFormat int32 // List of supported SBOM formats. const ( SBOMFormatCycloneDXJSON SBOMFormat = iota + 1 // CycloneDX (JSON) SBOMFormatCycloneDXXML // CycloneDX (XML) SBOMFormatGitHubJSON // GitHub dependency snapshot (JSON) SBOMFormatSPDXJSON // SPDX (JSON) SBOMFormatSPDXRDF // SPDX (RDF/xml) SBOMFormatSPDXTagValue // SPDX (tag/value) SBOMFormatSPDXYAML // SPDX (YAML) SBOMFormatSyftJSON // Syft (JSON) ) // String returns a human-readable representation of f. func (f SBOMFormat) String() string { switch f { case SBOMFormatCycloneDXJSON: return "cyclonedx-json" case SBOMFormatCycloneDXXML: return "cyclonedx-xml" case SBOMFormatGitHubJSON: return "github-json" case SBOMFormatSPDXJSON: return "spdx-json" case SBOMFormatSPDXRDF: return "spdx-rdf" case SBOMFormatSPDXTagValue: return "spdx-tag-value" case SBOMFormatSPDXYAML: return "spdx-yaml" case SBOMFormatSyftJSON: return "syft-json" } return "unknown" } // header describes a loaded SIF file. type header struct { LaunchScript [hdrLaunchLen]byte Magic [hdrMagicLen]byte Version [hdrVersionLen]byte Arch archType ID uuid.UUID CreatedAt int64 ModifiedAt int64 DescriptorsFree int64 DescriptorsTotal int64 DescriptorsOffset int64 DescriptorsSize int64 DataOffset int64 DataSize int64 } // GetIntegrityReader returns an io.Reader that reads the integrity-protected fields from h. func (h header) GetIntegrityReader() io.Reader { return io.MultiReader( bytes.NewReader(h.LaunchScript[:]), bytes.NewReader(h.Magic[:]), bytes.NewReader(h.Version[:]), bytes.NewReader(h.ID[:]), ) } // ReadWriter describes the interface required to read and write SIF images. type ReadWriter interface { io.ReaderAt io.WriteSeeker Truncate(int64) error } // FileImage describes the representation of a SIF file in memory. type FileImage struct { rw ReadWriter // Backing storage for image. h header // Raw global header from image. rds []rawDescriptor // Raw descriptors from image. closeOnUnload bool // Close rw on Unload. minIDs map[uint32]uint32 // Minimum object IDs for each group ID. } // LaunchScript returns the image launch script. func (f *FileImage) LaunchScript() string { return string(bytes.TrimRight(f.h.LaunchScript[:], "\x00")) } // Version returns the SIF specification version of the image. func (f *FileImage) Version() string { return string(bytes.TrimRight(f.h.Version[:], "\x00")) } // PrimaryArch returns the primary CPU architecture of the image, or "unknown" if the primary CPU // architecture cannot be determined. func (f *FileImage) PrimaryArch() string { return f.h.Arch.GoArch() } // ID returns the ID of the image. func (f *FileImage) ID() string { return f.h.ID.String() } // CreatedAt returns the creation time of the image. func (f *FileImage) CreatedAt() time.Time { return time.Unix(f.h.CreatedAt, 0) } // ModifiedAt returns the last modification time of the image. func (f *FileImage) ModifiedAt() time.Time { return time.Unix(f.h.ModifiedAt, 0) } // DescriptorsFree returns the number of free descriptors in the image. func (f *FileImage) DescriptorsFree() int64 { return f.h.DescriptorsFree } // DescriptorsTotal returns the total number of descriptors in the image. func (f *FileImage) DescriptorsTotal() int64 { return f.h.DescriptorsTotal } // DescriptorsOffset returns the offset (in bytes) of the descriptors section in the image. func (f *FileImage) DescriptorsOffset() int64 { return f.h.DescriptorsOffset } // DescriptorsSize returns the size (in bytes) of the descriptors section in the image. func (f *FileImage) DescriptorsSize() int64 { return f.h.DescriptorsSize } // DataOffset returns the offset (in bytes) of the data section in the image. func (f *FileImage) DataOffset() int64 { return f.h.DataOffset } // DataSize returns the size (in bytes) of the data section in the image. func (f *FileImage) DataSize() int64 { return f.h.DataSize } // GetHeaderIntegrityReader returns an io.Reader that reads the integrity-protected fields from the // header of the image. func (f *FileImage) GetHeaderIntegrityReader() io.Reader { return f.h.GetIntegrityReader() } // isDeterministic returns true if the UUID and timestamps in the header of f are set to // deterministic values. func (f *FileImage) isDeterministic() bool { return f.h.ID == uuid.Nil && f.CreatedAt().IsZero() && f.ModifiedAt().IsZero() } ================================================ FILE: vendor/github.com/tchap/go-patricia/v2/AUTHORS ================================================ This is the complete list of go-patricia copyright holders: Ondřej Kupka ================================================ FILE: vendor/github.com/tchap/go-patricia/v2/LICENSE ================================================ The MIT License (MIT) Copyright (c) 2014 The AUTHORS Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: vendor/github.com/tchap/go-patricia/v2/patricia/children.go ================================================ // Copyright (c) 2014 The go-patricia AUTHORS // // Use of this source code is governed by The MIT License // that can be found in the LICENSE file. package patricia import ( "fmt" "io" "sort" ) type childList interface { length() int head() *Trie add(child *Trie) childList remove(b byte) replace(b byte, child *Trie) next(b byte) *Trie walk(prefix *Prefix, visitor VisitorFunc) error print(w io.Writer, indent int) clone() childList total() int } type tries []*Trie func (t tries) Len() int { return len(t) } func (t tries) Less(i, j int) bool { strings := sort.StringSlice{string(t[i].prefix), string(t[j].prefix)} return strings.Less(0, 1) } func (t tries) Swap(i, j int) { t[i], t[j] = t[j], t[i] } type sparseChildList struct { children tries } func newSparseChildList(maxChildrenPerSparseNode int) childList { return &sparseChildList{ children: make(tries, 0, maxChildrenPerSparseNode), } } func (list *sparseChildList) length() int { return len(list.children) } func (list *sparseChildList) head() *Trie { return list.children[0] } func (list *sparseChildList) add(child *Trie) childList { // Search for an empty spot and insert the child if possible. if len(list.children) != cap(list.children) { list.children = append(list.children, child) return list } // Otherwise we have to transform to the dense list type. return newDenseChildList(list, child) } func (list *sparseChildList) remove(b byte) { for i, node := range list.children { if node.prefix[0] == b { list.children[i] = list.children[len(list.children)-1] list.children[len(list.children)-1] = nil list.children = list.children[:len(list.children)-1] return } } // This is not supposed to be reached. panic("removing non-existent child") } func (list *sparseChildList) replace(b byte, child *Trie) { // Make a consistency check. if p0 := child.prefix[0]; p0 != b { panic(fmt.Errorf("child prefix mismatch: %v != %v", p0, b)) } // Seek the child and replace it. for i, node := range list.children { if node.prefix[0] == b { list.children[i] = child return } } } func (list *sparseChildList) next(b byte) *Trie { for _, child := range list.children { if child.prefix[0] == b { return child } } return nil } func (list *sparseChildList) walk(prefix *Prefix, visitor VisitorFunc) error { sort.Sort(list.children) for _, child := range list.children { *prefix = append(*prefix, child.prefix...) if child.item != nil { err := visitor(*prefix, child.item) if err != nil { if err == SkipSubtree { *prefix = (*prefix)[:len(*prefix)-len(child.prefix)] continue } *prefix = (*prefix)[:len(*prefix)-len(child.prefix)] return err } } err := child.children.walk(prefix, visitor) *prefix = (*prefix)[:len(*prefix)-len(child.prefix)] if err != nil { return err } } return nil } func (list *sparseChildList) total() int { tot := 0 for _, child := range list.children { if child != nil { tot = tot + child.total() } } return tot } func (list *sparseChildList) clone() childList { clones := make(tries, len(list.children), cap(list.children)) for i, child := range list.children { clones[i] = child.Clone() } return &sparseChildList{ children: clones, } } func (list *sparseChildList) print(w io.Writer, indent int) { for _, child := range list.children { if child != nil { child.print(w, indent) } } } type denseChildList struct { min int max int numChildren int headIndex int children []*Trie } func newDenseChildList(list *sparseChildList, child *Trie) childList { var ( min int = 255 max int = 0 ) for _, child := range list.children { b := int(child.prefix[0]) if b < min { min = b } if b > max { max = b } } b := int(child.prefix[0]) if b < min { min = b } if b > max { max = b } children := make([]*Trie, max-min+1) for _, child := range list.children { children[int(child.prefix[0])-min] = child } children[int(child.prefix[0])-min] = child return &denseChildList{ min: min, max: max, numChildren: list.length() + 1, headIndex: 0, children: children, } } func (list *denseChildList) length() int { return list.numChildren } func (list *denseChildList) head() *Trie { return list.children[list.headIndex] } func (list *denseChildList) add(child *Trie) childList { b := int(child.prefix[0]) var i int switch { case list.min <= b && b <= list.max: if list.children[b-list.min] != nil { panic("dense child list collision detected") } i = b - list.min list.children[i] = child case b < list.min: children := make([]*Trie, list.max-b+1) i = 0 children[i] = child copy(children[list.min-b:], list.children) list.children = children list.min = b default: // b > list.max children := make([]*Trie, b-list.min+1) i = b - list.min children[i] = child copy(children, list.children) list.children = children list.max = b } list.numChildren++ if i < list.headIndex { list.headIndex = i } return list } func (list *denseChildList) remove(b byte) { i := int(b) - list.min if list.children[i] == nil { // This is not supposed to be reached. panic("removing non-existent child") } list.numChildren-- list.children[i] = nil // Update head index. if i == list.headIndex { for ; i < len(list.children); i++ { if list.children[i] != nil { list.headIndex = i return } } } } func (list *denseChildList) replace(b byte, child *Trie) { // Make a consistency check. if p0 := child.prefix[0]; p0 != b { panic(fmt.Errorf("child prefix mismatch: %v != %v", p0, b)) } // Replace the child. list.children[int(b)-list.min] = child } func (list *denseChildList) next(b byte) *Trie { i := int(b) if i < list.min || list.max < i { return nil } return list.children[i-list.min] } func (list *denseChildList) walk(prefix *Prefix, visitor VisitorFunc) error { for _, child := range list.children { if child == nil { continue } *prefix = append(*prefix, child.prefix...) if child.item != nil { if err := visitor(*prefix, child.item); err != nil { if err == SkipSubtree { *prefix = (*prefix)[:len(*prefix)-len(child.prefix)] continue } *prefix = (*prefix)[:len(*prefix)-len(child.prefix)] return err } } err := child.children.walk(prefix, visitor) *prefix = (*prefix)[:len(*prefix)-len(child.prefix)] if err != nil { return err } } return nil } func (list *denseChildList) print(w io.Writer, indent int) { for _, child := range list.children { if child != nil { child.print(w, indent) } } } func (list *denseChildList) clone() childList { clones := make(tries, cap(list.children)) if list.numChildren != 0 { clonedCount := 0 for i := list.headIndex; i < len(list.children); i++ { child := list.children[i] if child != nil { clones[i] = child.Clone() clonedCount++ if clonedCount == list.numChildren { break } } } } return &denseChildList{ min: list.min, max: list.max, numChildren: list.numChildren, headIndex: list.headIndex, children: clones, } } func (list *denseChildList) total() int { tot := 0 for _, child := range list.children { if child != nil { tot = tot + child.total() } } return tot } ================================================ FILE: vendor/github.com/tchap/go-patricia/v2/patricia/patricia.go ================================================ // Copyright (c) 2014 The go-patricia AUTHORS // // Use of this source code is governed by The MIT License // that can be found in the LICENSE file. package patricia import ( "bytes" "errors" "fmt" "io" "strings" ) //------------------------------------------------------------------------------ // Trie //------------------------------------------------------------------------------ const ( DefaultMaxPrefixPerNode = 10 DefaultMaxChildrenPerSparseNode = 8 ) type ( Prefix []byte Item interface{} VisitorFunc func(prefix Prefix, item Item) error ) // Trie is a generic patricia trie that allows fast retrieval of items by prefix. // and other funky stuff. // // Trie is not thread-safe. type Trie struct { prefix Prefix item Item maxPrefixPerNode int maxChildrenPerSparseNode int children childList } // Public API ------------------------------------------------------------------ type Option func(*Trie) // Trie constructor. func NewTrie(options ...Option) *Trie { trie := &Trie{} for _, opt := range options { opt(trie) } if trie.maxPrefixPerNode <= 0 { trie.maxPrefixPerNode = DefaultMaxPrefixPerNode } if trie.maxChildrenPerSparseNode <= 0 { trie.maxChildrenPerSparseNode = DefaultMaxChildrenPerSparseNode } trie.children = newSparseChildList(trie.maxChildrenPerSparseNode) return trie } func MaxPrefixPerNode(value int) Option { return func(trie *Trie) { trie.maxPrefixPerNode = value } } func MaxChildrenPerSparseNode(value int) Option { return func(trie *Trie) { trie.maxChildrenPerSparseNode = value } } // Clone makes a copy of an existing trie. // Items stored in both tries become shared, obviously. func (trie *Trie) Clone() *Trie { return &Trie{ prefix: append(Prefix(nil), trie.prefix...), item: trie.item, maxPrefixPerNode: trie.maxPrefixPerNode, maxChildrenPerSparseNode: trie.maxChildrenPerSparseNode, children: trie.children.clone(), } } // Item returns the item stored in the root of this trie. func (trie *Trie) Item() Item { return trie.item } // Insert inserts a new item into the trie using the given prefix. Insert does // not replace existing items. It returns false if an item was already in place. func (trie *Trie) Insert(key Prefix, item Item) (inserted bool) { return trie.put(key, item, false) } // Set works much like Insert, but it always sets the item, possibly replacing // the item previously inserted. func (trie *Trie) Set(key Prefix, item Item) { trie.put(key, item, true) } // Get returns the item located at key. // // This method is a bit dangerous, because Get can as well end up in an internal // node that is not really representing any user-defined value. So when nil is // a valid value being used, it is not possible to tell if the value was inserted // into the tree by the user or not. A possible workaround for this is not to use // nil interface as a valid value, even using zero value of any type is enough // to prevent this bad behaviour. func (trie *Trie) Get(key Prefix) (item Item) { _, node, found, leftover := trie.findSubtree(key) if !found || len(leftover) != 0 { return nil } return node.item } // Match returns what Get(prefix) != nil would return. The same warning as for // Get applies here as well. func (trie *Trie) Match(prefix Prefix) (matchedExactly bool) { return trie.Get(prefix) != nil } // MatchSubtree returns true when there is a subtree representing extensions // to key, that is if there are any keys in the tree which have key as prefix. func (trie *Trie) MatchSubtree(key Prefix) (matched bool) { _, _, matched, _ = trie.findSubtree(key) return } // Visit calls visitor on every node containing a non-nil item // in alphabetical order. // // If an error is returned from visitor, the function stops visiting the tree // and returns that error, unless it is a special error - SkipSubtree. In that // case Visit skips the subtree represented by the current node and continues // elsewhere. func (trie *Trie) Visit(visitor VisitorFunc) error { return trie.walk(nil, visitor) } func (trie *Trie) size() int { n := 0 trie.walk(nil, func(prefix Prefix, item Item) error { n++ return nil }) return n } func (trie *Trie) total() int { return 1 + trie.children.total() } // VisitSubtree works much like Visit, but it only visits nodes matching prefix. func (trie *Trie) VisitSubtree(prefix Prefix, visitor VisitorFunc) error { // Nil prefix not allowed. if prefix == nil { panic(ErrNilPrefix) } // Empty trie must be handled explicitly. if trie.prefix == nil { return nil } // Locate the relevant subtree. _, root, found, leftover := trie.findSubtree(prefix) if !found { return nil } prefix = append(prefix, leftover...) // Visit it. return root.walk(prefix, visitor) } // VisitPrefixes visits only nodes that represent prefixes of key. // To say the obvious, returning SkipSubtree from visitor makes no sense here. func (trie *Trie) VisitPrefixes(key Prefix, visitor VisitorFunc) error { // Nil key not allowed. if key == nil { panic(ErrNilPrefix) } // Empty trie must be handled explicitly. if trie.prefix == nil { return nil } // Walk the path matching key prefixes. node := trie prefix := key offset := 0 for { // Compute what part of prefix matches. common := node.longestCommonPrefixLength(key) key = key[common:] offset += common // Partial match means that there is no subtree matching prefix. if common < len(node.prefix) { return nil } // Call the visitor. if item := node.item; item != nil { if err := visitor(prefix[:offset], item); err != nil { return err } } if len(key) == 0 { // This node represents key, we are finished. return nil } // There is some key suffix left, move to the children. child := node.children.next(key[0]) if child == nil { // There is nowhere to continue, return. return nil } node = child } } // Delete deletes the item represented by the given prefix. // // True is returned if the matching node was found and deleted. func (trie *Trie) Delete(key Prefix) (deleted bool) { // Nil prefix not allowed. if key == nil { panic(ErrNilPrefix) } // Empty trie must be handled explicitly. if trie.prefix == nil { return false } // Find the relevant node. path, found, _ := trie.findSubtreePath(key) if !found { return false } node := path[len(path)-1] var parent *Trie if len(path) != 1 { parent = path[len(path)-2] } // If the item is already set to nil, there is nothing to do. if node.item == nil { return false } // Delete the item. node.item = nil // Initialise i before goto. // Will be used later in a loop. i := len(path) - 1 // In case there are some child nodes, we cannot drop the whole subtree. // We can try to compact nodes, though. if node.children.length() != 0 { goto Compact } // In case we are at the root, just reset it and we are done. if parent == nil { node.reset() return true } // We can drop a subtree. // Find the first ancestor that has its value set or it has 2 or more child nodes. // That will be the node where to drop the subtree at. for ; i >= 0; i-- { if current := path[i]; current.item != nil || current.children.length() >= 2 { break } } // Handle the case when there is no such node. // In other words, we can reset the whole tree. if i == -1 { path[0].reset() return true } // We can just remove the subtree here. node = path[i] if i == 0 { parent = nil } else { parent = path[i-1] } // i+1 is always a valid index since i is never pointing to the last node. // The loop above skips at least the last node since we are sure that the item // is set to nil and it has no children, othewise we would be compacting instead. node.children.remove(path[i+1].prefix[0]) Compact: // The node is set to the first non-empty ancestor, // so try to compact since that might be possible now. if compacted := node.compact(); compacted != node { if parent == nil { *node = *compacted } else { parent.children.replace(node.prefix[0], compacted) *parent = *parent.compact() } } return true } // DeleteSubtree finds the subtree exactly matching prefix and deletes it. // // True is returned if the subtree was found and deleted. func (trie *Trie) DeleteSubtree(prefix Prefix) (deleted bool) { // Nil prefix not allowed. if prefix == nil { panic(ErrNilPrefix) } // Empty trie must be handled explicitly. if trie.prefix == nil { return false } // Locate the relevant subtree. parent, root, found, _ := trie.findSubtree(prefix) if !found { return false } // If we are in the root of the trie, reset the trie. if parent == nil { root.reset() return true } // Otherwise remove the root node from its parent. parent.children.remove(root.prefix[0]) return true } // Internal helper methods ----------------------------------------------------- func (trie *Trie) empty() bool { return trie.item == nil && trie.children.length() == 0 } func (trie *Trie) reset() { trie.prefix = nil trie.children = newSparseChildList(trie.maxPrefixPerNode) } func (trie *Trie) put(key Prefix, item Item, replace bool) (inserted bool) { // Nil prefix not allowed. if key == nil { panic(ErrNilPrefix) } var ( common int node *Trie = trie child *Trie ) if node.prefix == nil { if len(key) <= trie.maxPrefixPerNode { node.prefix = key goto InsertItem } node.prefix = key[:trie.maxPrefixPerNode] key = key[trie.maxPrefixPerNode:] goto AppendChild } for { // Compute the longest common prefix length. common = node.longestCommonPrefixLength(key) key = key[common:] // Only a part matches, split. if common < len(node.prefix) { goto SplitPrefix } // common == len(node.prefix) since never (common > len(node.prefix)) // common == len(former key) <-> 0 == len(key) // -> former key == node.prefix if len(key) == 0 { goto InsertItem } // Check children for matching prefix. child = node.children.next(key[0]) if child == nil { goto AppendChild } node = child } SplitPrefix: // Split the prefix if necessary. child = new(Trie) *child = *node *node = *NewTrie() node.prefix = child.prefix[:common] child.prefix = child.prefix[common:] child = child.compact() node.children = node.children.add(child) AppendChild: // Keep appending children until whole prefix is inserted. // This loop starts with empty node.prefix that needs to be filled. for len(key) != 0 { child := NewTrie() if len(key) <= trie.maxPrefixPerNode { child.prefix = key node.children = node.children.add(child) node = child goto InsertItem } else { child.prefix = key[:trie.maxPrefixPerNode] key = key[trie.maxPrefixPerNode:] node.children = node.children.add(child) node = child } } InsertItem: // Try to insert the item if possible. if replace || node.item == nil { node.item = item return true } return false } func (trie *Trie) compact() *Trie { // Only a node with a single child can be compacted. if trie.children.length() != 1 { return trie } child := trie.children.head() // If any item is set, we cannot compact since we want to retain // the ability to do searching by key. This makes compaction less usable, // but that simply cannot be avoided. if child == nil || trie.item != nil || child.item != nil { return trie } // Make sure the combined prefixes fit into a single node. if len(trie.prefix)+len(child.prefix) > trie.maxPrefixPerNode { return trie } // Concatenate the prefixes, move the items. child.prefix = append(trie.prefix, child.prefix...) if trie.item != nil { child.item = trie.item } return child } func (trie *Trie) findSubtree(prefix Prefix) (parent *Trie, root *Trie, found bool, leftover Prefix) { // Find the subtree matching prefix. root = trie for { // Compute what part of prefix matches. common := root.longestCommonPrefixLength(prefix) prefix = prefix[common:] // We used up the whole prefix, subtree found. if len(prefix) == 0 { found = true leftover = root.prefix[common:] return } // Partial match means that there is no subtree matching prefix. if common < len(root.prefix) { leftover = root.prefix[common:] return } // There is some prefix left, move to the children. child := root.children.next(prefix[0]) if child == nil { // There is nowhere to continue, there is no subtree matching prefix. return } parent = root root = child } } func (trie *Trie) findSubtreePath(prefix Prefix) (path []*Trie, found bool, leftover Prefix) { // Find the subtree matching prefix. root := trie var subtreePath []*Trie for { // Append the current root to the path. subtreePath = append(subtreePath, root) // Compute what part of prefix matches. common := root.longestCommonPrefixLength(prefix) prefix = prefix[common:] // We used up the whole prefix, subtree found. if len(prefix) == 0 { path = subtreePath found = true leftover = root.prefix[common:] return } // Partial match means that there is no subtree matching prefix. if common < len(root.prefix) { leftover = root.prefix[common:] return } // There is some prefix left, move to the children. child := root.children.next(prefix[0]) if child == nil { // There is nowhere to continue, there is no subtree matching prefix. return } root = child } } func (trie *Trie) walk(actualRootPrefix Prefix, visitor VisitorFunc) error { var prefix Prefix // Allocate a bit more space for prefix at the beginning. if actualRootPrefix == nil { prefix = make(Prefix, 32+len(trie.prefix)) copy(prefix, trie.prefix) prefix = prefix[:len(trie.prefix)] } else { prefix = make(Prefix, 32+len(actualRootPrefix)) copy(prefix, actualRootPrefix) prefix = prefix[:len(actualRootPrefix)] } // Visit the root first. Not that this works for empty trie as well since // in that case item == nil && len(children) == 0. if trie.item != nil { if err := visitor(prefix, trie.item); err != nil { if err == SkipSubtree { return nil } return err } } // Then continue to the children. return trie.children.walk(&prefix, visitor) } func (trie *Trie) longestCommonPrefixLength(prefix Prefix) (i int) { for ; i < len(prefix) && i < len(trie.prefix) && prefix[i] == trie.prefix[i]; i++ { } return } func (trie *Trie) dump() string { writer := &bytes.Buffer{} trie.print(writer, 0) return writer.String() } func (trie *Trie) print(writer io.Writer, indent int) { fmt.Fprintf(writer, "%s%s %v\n", strings.Repeat(" ", indent), string(trie.prefix), trie.item) trie.children.print(writer, indent+2) } // Errors ---------------------------------------------------------------------- var ( SkipSubtree = errors.New("Skip this subtree") ErrNilPrefix = errors.New("Nil prefix passed into a method call") ) ================================================ FILE: vendor/github.com/ulikunitz/xz/.gitignore ================================================ # .gitignore TODO.html README.html lzma/writer.txt lzma/reader.txt cmd/gxz/gxz cmd/xb/xb # test executables *.test # profile files *.out # vim swap file .*.swp # executables on windows *.exe # default compression test file enwik8* # file generated by example example.xz ================================================ FILE: vendor/github.com/ulikunitz/xz/LICENSE ================================================ Copyright (c) 2014-2022 Ulrich Kunitz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * My name, Ulrich Kunitz, may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: vendor/github.com/ulikunitz/xz/README.md ================================================ # Package xz This Go language package supports the reading and writing of xz compressed streams. It includes also a gxz command for compressing and decompressing data. The package is completely written in Go and doesn't have any dependency on any C code. The package is currently under development. There might be bugs and APIs are not considered stable. At this time the package cannot compete with the xz tool regarding compression speed and size. The algorithms there have been developed over a long time and are highly optimized. However there are a number of improvements planned and I'm very optimistic about parallel compression and decompression. Stay tuned! ## Using the API The following example program shows how to use the API. ```go package main import ( "bytes" "io" "log" "os" "github.com/ulikunitz/xz" ) func main() { const text = "The quick brown fox jumps over the lazy dog.\n" var buf bytes.Buffer // compress text w, err := xz.NewWriter(&buf) if err != nil { log.Fatalf("xz.NewWriter error %s", err) } if _, err := io.WriteString(w, text); err != nil { log.Fatalf("WriteString error %s", err) } if err := w.Close(); err != nil { log.Fatalf("w.Close error %s", err) } // decompress buffer and write output to stdout r, err := xz.NewReader(&buf) if err != nil { log.Fatalf("NewReader error %s", err) } if _, err = io.Copy(os.Stdout, r); err != nil { log.Fatalf("io.Copy error %s", err) } } ``` ## Documentation You can find the full documentation at [pkg.go.dev](https://pkg.go.dev/github.com/ulikunitz/xz). ## Using the gxz compression tool The package includes a gxz command line utility for compression and decompression. Use following command for installation: $ go get github.com/ulikunitz/xz/cmd/gxz To test it call the following command. $ gxz bigfile After some time a much smaller file bigfile.xz will replace bigfile. To decompress it use the following command. $ gxz -d bigfile.xz ## Security & Vulnerabilities The security policy is documented in [SECURITY.md](SECURITY.md). The software is not affected by the supply chain attack on the original xz implementation, [CVE-2024-3094](https://nvd.nist.gov/vuln/detail/CVE-2024-3094). This implementation doesn't share any files with the original xz implementation and no patches or pull requests are accepted without a review. All security advisories for this project are published under [github.com/ulikunitz/xz/security/advisories](https://github.com/ulikunitz/xz/security/advisories?state=published). ================================================ FILE: vendor/github.com/ulikunitz/xz/SECURITY.md ================================================ # Security Policy ## Supported Versions Currently the last minor version v0.5.x is supported. ## Reporting a Vulnerability You can privately report a vulnerability following this [procedure](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability). Alternatively you can create a Github issue at . In both cases expect a response in at least 7 days. ## Security Advisories All security advisories for this project are published under [github.com/ulikunitz/xz/security/advisories](https://github.com/ulikunitz/xz/security/advisories?state=published). ================================================ FILE: vendor/github.com/ulikunitz/xz/TODO.md ================================================ # TODO list ## Release v0.6 1. Review encoder and check for lzma improvements under xz. 2. Fix binary tree matcher. 3. Compare compression ratio with xz tool using comparable parameters and optimize parameters 4. rename operation action and make it a simple type of size 8 5. make maxMatches, wordSize parameters 6. stop searching after a certain length is found (parameter sweetLen) ## Release v0.7 1. Optimize code 2. Do statistical analysis to get linear presets. 3. Test sync.Pool compatability for xz and lzma Writer and Reader 4. Fuzz optimized code. ## Release v0.8 1. Support parallel go routines for writing and reading xz files. 2. Support a ReaderAt interface for xz files with small block sizes. 3. Improve compatibility between gxz and xz 4. Provide manual page for gxz ## Release v0.9 1. Improve documentation 2. Fuzz again ## Release v1.0 1. Full functioning gxz 2. Add godoc URL to README.md (godoc.org) 3. Resolve all issues. 4. Define release candidates. 5. Public announcement. ## Package lzma ### v0.6 * Rewrite Encoder into a simple greedy one-op-at-a-time encoder including * simple scan at the dictionary head for the same byte * use the killer byte (requiring matches to get longer, the first test should be the byte that would make the match longer) ## Optimizations * There may be a lot of false sharing in lzma. State; check whether this can be improved by reorganizing the internal structure of it. * Check whether batching encoding and decoding improves speed. ### DAG optimizations * Use full buffer to create minimal bit-length above range encoder. * Might be too slow (see v0.4) ### Different match finders * hashes with 2, 3 characters additional to 4 characters * binary trees with 2-7 characters (uint64 as key, use uint32 as pointers into a an array) * rb-trees with 2-7 characters (uint64 as key, use uint32 as pointers into an array with bit-steeling for the colors) ## Release Procedure * execute goch -l for all packages; probably with lower param like 0.5. * check orthography with gospell * Write release notes in doc/relnotes. * Update README.md * xb copyright . in xz directory to ensure all new files have Copyright header * `VERSION= go generate github.com/ulikunitz/xz/...` to update version files * Execute test for Linux/amd64, Linux/x86 and Windows/amd64. * Update TODO.md - write short log entry * `git checkout master && git merge dev` * `git tag -a ` * `git push` ## Log ## 2025-08-28 Release v0.5.14 addresses the security vulnerability CVE-2025-58058. If you put bytes in from of a LZMA stream, the header might not be read correctly and memory for the dictionary buffer allocated. I have implemented mitigations for the problem. ### 2025-08-20 Release v0.5.13 addressed issue #61 regarding handling of multiple WriteClosers together. So I added a new package xio with a WriteCloserStack to address the issue. ### 2024-04-03 Release v0.5.12 updates README.md and SECURITY.md to address the supply chain attack on the original xz implementation. ### 2022-12-12 Matt Dantay (@bodgit) reported an issue with the LZMA reader. The implementation returned an error if the dictionary size was less than 4096 byte, but the recommendation stated the actual used window size should be set to 4096 byte in that case. It actually was the pull request [#52](https://github.com/ulikunitz/xz/pull/52). The new patch v0.5.11 will fix it. ### 2021-02-02 Mituo Heijo has fuzzed xz and found a bug in the function readIndexBody. The function allocated a slice of records immediately after reading the value without further checks. Since the number has been too large the make function did panic. The fix is to check the number against the expected number of records before allocating the records. ### 2020-12-17 Release v0.5.9 fixes warnings, a typo and adds SECURITY.md. One fix is interesting. ```go const ( a byte = 0x1 b = 0x2 ) ``` The constants a and b don't have the same type. Correct is ```go const ( a byte = 0x1 b byte = 0x2 ) ``` ### 2020-08-19 Release v0.5.8 fixes issue [issue #35](https://github.com/ulikunitz/xz/issues/35). ### 2020-02-24 Release v0.5.7 supports the check-ID None and fixes [issue #27](https://github.com/ulikunitz/xz/issues/27). ### 2019-02-20 Release v0.5.6 supports the go.mod file. ### 2018-10-28 Release v0.5.5 fixes issues #19 observing ErrLimit outputs. ### 2017-06-05 Release v0.5.4 fixes issues #15 of another problem with the padding size check for the xz block header. I removed the check completely. ### 2017-02-15 Release v0.5.3 fixes issue #12 regarding the decompression of an empty XZ stream. Many thanks to Tomasz Kłak, who reported the issue. ### 2016-12-02 Release v0.5.2 became necessary to allow the decoding of xz files with 4-byte padding in the block header. Many thanks to Greg, who reported the issue. ### 2016-07-23 Release v0.5.1 became necessary to fix problems with 32-bit platforms. Many thanks to Bruno Brigas, who reported the issue. ### 2016-07-04 Release v0.5 provides improvements to the compressor and provides support for the decompression of xz files with multiple xz streams. ### 2016-01-31 Another compression rate increase by checking the byte at length of the best match first, before checking the whole prefix. This makes the compressor even faster. We have now a large time budget to beat the compression ratio of the xz tool. For enwik8 we have now over 40 seconds to reduce the compressed file size for another 7 MiB. ### 2016-01-30 I simplified the encoder. Speed and compression rate increased dramatically. A high compression rate affects also the decompression speed. The approach with the buffer and optimizing for operation compression rate has not been successful. Going for the maximum length appears to be the best approach. ### 2016-01-28 The release v0.4 is ready. It provides a working xz implementation, which is rather slow, but works and is interoperable with the xz tool. It is an important milestone. ### 2016-01-10 I have the first working implementation of an xz reader and writer. I'm happy about reaching this milestone. ### 2015-12-02 I'm now ready to implement xz because, I have a working LZMA2 implementation. I decided today that v0.4 will use the slow encoder using the operations buffer to be able to go back, if I intend to do so. ### 2015-10-21 I have restarted the work on the library. While trying to implement LZMA2, I discovered that I need to resimplify the encoder and decoder functions. The option approach is too complicated. Using a limited byte writer and not caring for written bytes at all and not to try to handle uncompressed data simplifies the LZMA encoder and decoder much. Processing uncompressed data and handling limits is a feature of the LZMA2 format not of LZMA. I learned an interesting method from the LZO format. If the last copy is too far away they are moving the head one 2 bytes and not 1 byte to reduce processing times. ### 2015-08-26 I have now reimplemented the lzma package. The code is reasonably fast, but can still be optimized. The next step is to implement LZMA2 and then xz. ### 2015-07-05 Created release v0.3. The version is the foundation for a full xz implementation that is the target of v0.4. ### 2015-06-11 The gflag package has been developed because I couldn't use flag and pflag for a fully compatible support of gzip's and lzma's options. It seems to work now quite nicely. ### 2015-06-05 The overflow issue was interesting to research, however Henry S. Warren Jr. Hacker's Delight book was very helpful as usual and had the issue explained perfectly. Fefe's information on his website was based on the C FAQ and quite bad, because it didn't address the issue of -MININT == MININT. ### 2015-06-04 It has been a productive day. I improved the interface of lzma. Reader and lzma. Writer and fixed the error handling. ### 2015-06-01 By computing the bit length of the LZMA operations I was able to improve the greedy algorithm implementation. By using an 8 MByte buffer the compression rate was not as good as for xz but already better then gzip default. Compression is currently slow, but this is something we will be able to improve over time. ### 2015-05-26 Checked the license of ogier/pflag. The binary lzmago binary should include the license terms for the pflag library. I added the endorsement clause as used by Google for the Go sources the LICENSE file. ### 2015-05-22 The package lzb contains now the basic implementation for creating or reading LZMA byte streams. It allows the support for the implementation of the DAG-shortest-path algorithm for the compression function. ### 2015-04-23 Completed yesterday the lzbase classes. I'm a little bit concerned that using the components may require too much code, but on the other hand there is a lot of flexibility. ### 2015-04-22 Implemented Reader and Writer during the Bayern game against Porto. The second half gave me enough time. ### 2015-04-21 While showering today morning I discovered that the design for OpEncoder and OpDecoder doesn't work, because encoding/decoding might depend on the current status of the dictionary. This is not exactly the right way to start the day. Therefore we need to keep the Reader and Writer design. This time around we simplify it by ignoring size limits. These can be added by wrappers around the Reader and Writer interfaces. The Parameters type isn't needed anymore. However I will implement a ReaderState and WriterState type to use static typing to ensure the right State object is combined with the right lzbase. Reader and lzbase. Writer. As a start I have implemented ReaderState and WriterState to ensure that the state for reading is only used by readers and WriterState only used by Writers. ### 2015-04-20 Today I implemented the OpDecoder and tested OpEncoder and OpDecoder. ### 2015-04-08 Came up with a new simplified design for lzbase. I implemented already the type State that replaces OpCodec. ### 2015-04-06 The new lzma package is now fully usable and lzmago is using it now. The old lzma package has been completely removed. ### 2015-04-05 Implemented lzma. Reader and tested it. ### 2015-04-04 Implemented baseReader by adapting code form lzma. Reader. ### 2015-04-03 The opCodec has been copied yesterday to lzma2. opCodec has a high number of dependencies on other files in lzma2. Therefore I had to copy almost all files from lzma. ### 2015-03-31 Removed only a TODO item. However in Francesco Campoy's presentation "Go for Javaneros (Javaïstes?)" is the the idea that using an embedded field E, all the methods of E will be defined on T. If E is an interface T satisfies E. I have never used this, but it seems to be a cool idea. ### 2015-03-30 Finished the type writerDict and wrote a simple test. ### 2015-03-25 I started to implement the writerDict. ### 2015-03-24 After thinking long about the LZMA2 code and several false starts, I have now a plan to create a self-sufficient lzma2 package that supports the classic LZMA format as well as LZMA2. The core idea is to support a baseReader and baseWriter type that support the basic LZMA stream without any headers. Both types must support the reuse of dictionaries and the opCodec. ### 2015-01-10 1. Implemented simple lzmago tool 2. Tested tool against large 4.4G file * compression worked correctly; tested decompression with lzma * decompression hits a full buffer condition 3. Fixed a bug in the compressor and wrote a test for it 4. Executed full cycle for 4.4 GB file; performance can be improved ;-) ### 2015-01-11 * Release v0.2 because of the working LZMA encoder and decoder ================================================ FILE: vendor/github.com/ulikunitz/xz/bits.go ================================================ // Copyright 2014-2022 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package xz import ( "errors" "io" ) // putUint32LE puts the little-endian representation of x into the first // four bytes of p. func putUint32LE(p []byte, x uint32) { p[0] = byte(x) p[1] = byte(x >> 8) p[2] = byte(x >> 16) p[3] = byte(x >> 24) } // putUint64LE puts the little-endian representation of x into the first // eight bytes of p. func putUint64LE(p []byte, x uint64) { p[0] = byte(x) p[1] = byte(x >> 8) p[2] = byte(x >> 16) p[3] = byte(x >> 24) p[4] = byte(x >> 32) p[5] = byte(x >> 40) p[6] = byte(x >> 48) p[7] = byte(x >> 56) } // uint32LE converts a little endian representation to an uint32 value. func uint32LE(p []byte) uint32 { return uint32(p[0]) | uint32(p[1])<<8 | uint32(p[2])<<16 | uint32(p[3])<<24 } // putUvarint puts a uvarint representation of x into the byte slice. func putUvarint(p []byte, x uint64) int { i := 0 for x >= 0x80 { p[i] = byte(x) | 0x80 x >>= 7 i++ } p[i] = byte(x) return i + 1 } // errOverflow indicates an overflow of the 64-bit unsigned integer. var errOverflowU64 = errors.New("xz: uvarint overflows 64-bit unsigned integer") // readUvarint reads a uvarint from the given byte reader. func readUvarint(r io.ByteReader) (x uint64, n int, err error) { const maxUvarintLen = 10 var s uint i := 0 for { b, err := r.ReadByte() if err != nil { return x, i, err } i++ if i > maxUvarintLen { return x, i, errOverflowU64 } if b < 0x80 { if i == maxUvarintLen && b > 1 { return x, i, errOverflowU64 } return x | uint64(b)< 0 { k = 4 - k } return k } /*** Header ***/ // headerMagic stores the magic bytes for the header var headerMagic = []byte{0xfd, '7', 'z', 'X', 'Z', 0x00} // HeaderLen provides the length of the xz file header. const HeaderLen = 12 // Constants for the checksum methods supported by xz. const ( None byte = 0x0 CRC32 byte = 0x1 CRC64 byte = 0x4 SHA256 byte = 0xa ) // errInvalidFlags indicates that flags are invalid. var errInvalidFlags = errors.New("xz: invalid flags") // verifyFlags returns the error errInvalidFlags if the value is // invalid. func verifyFlags(flags byte) error { switch flags { case None, CRC32, CRC64, SHA256: return nil default: return errInvalidFlags } } // flagstrings maps flag values to strings. var flagstrings = map[byte]string{ None: "None", CRC32: "CRC-32", CRC64: "CRC-64", SHA256: "SHA-256", } // flagString returns the string representation for the given flags. func flagString(flags byte) string { s, ok := flagstrings[flags] if !ok { return "invalid" } return s } // newHashFunc returns a function that creates hash instances for the // hash method encoded in flags. func newHashFunc(flags byte) (newHash func() hash.Hash, err error) { switch flags { case None: newHash = newNoneHash case CRC32: newHash = newCRC32 case CRC64: newHash = newCRC64 case SHA256: newHash = sha256.New default: err = errInvalidFlags } return } // header provides the actual content of the xz file header: the flags. type header struct { flags byte } // Errors returned by readHeader. var errHeaderMagic = errors.New("xz: invalid header magic bytes") // ValidHeader checks whether data is a correct xz file header. The // length of data must be HeaderLen. func ValidHeader(data []byte) bool { var h header err := h.UnmarshalBinary(data) return err == nil } // String returns a string representation of the flags. func (h header) String() string { return flagString(h.flags) } // UnmarshalBinary reads header from the provided data slice. func (h *header) UnmarshalBinary(data []byte) error { // header length if len(data) != HeaderLen { return errors.New("xz: wrong file header length") } // magic header if !bytes.Equal(headerMagic, data[:6]) { return errHeaderMagic } // checksum crc := crc32.NewIEEE() crc.Write(data[6:8]) if uint32LE(data[8:]) != crc.Sum32() { return errors.New("xz: invalid checksum for file header") } // stream flags if data[6] != 0 { return errInvalidFlags } flags := data[7] if err := verifyFlags(flags); err != nil { return err } h.flags = flags return nil } // MarshalBinary generates the xz file header. func (h *header) MarshalBinary() (data []byte, err error) { if err = verifyFlags(h.flags); err != nil { return nil, err } data = make([]byte, 12) copy(data, headerMagic) data[7] = h.flags crc := crc32.NewIEEE() crc.Write(data[6:8]) putUint32LE(data[8:], crc.Sum32()) return data, nil } /*** Footer ***/ // footerLen defines the length of the footer. const footerLen = 12 // footerMagic contains the footer magic bytes. var footerMagic = []byte{'Y', 'Z'} // footer represents the content of the xz file footer. type footer struct { indexSize int64 flags byte } // String prints a string representation of the footer structure. func (f footer) String() string { return fmt.Sprintf("%s index size %d", flagString(f.flags), f.indexSize) } // Minimum and maximum for the size of the index (backward size). const ( minIndexSize = 4 maxIndexSize = (1 << 32) * 4 ) // MarshalBinary converts footer values into an xz file footer. Note // that the footer value is checked for correctness. func (f *footer) MarshalBinary() (data []byte, err error) { if err = verifyFlags(f.flags); err != nil { return nil, err } if !(minIndexSize <= f.indexSize && f.indexSize <= maxIndexSize) { return nil, errors.New("xz: index size out of range") } if f.indexSize%4 != 0 { return nil, errors.New( "xz: index size not aligned to four bytes") } data = make([]byte, footerLen) // backward size (index size) s := (f.indexSize / 4) - 1 putUint32LE(data[4:], uint32(s)) // flags data[9] = f.flags // footer magic copy(data[10:], footerMagic) // CRC-32 crc := crc32.NewIEEE() crc.Write(data[4:10]) putUint32LE(data, crc.Sum32()) return data, nil } // UnmarshalBinary sets the footer value by unmarshalling an xz file // footer. func (f *footer) UnmarshalBinary(data []byte) error { if len(data) != footerLen { return errors.New("xz: wrong footer length") } // magic bytes if !bytes.Equal(data[10:], footerMagic) { return errors.New("xz: footer magic invalid") } // CRC-32 crc := crc32.NewIEEE() crc.Write(data[4:10]) if uint32LE(data) != crc.Sum32() { return errors.New("xz: footer checksum error") } var g footer // backward size (index size) g.indexSize = (int64(uint32LE(data[4:])) + 1) * 4 // flags if data[8] != 0 { return errInvalidFlags } g.flags = data[9] if err := verifyFlags(g.flags); err != nil { return err } *f = g return nil } /*** Block Header ***/ // blockHeader represents the content of an xz block header. type blockHeader struct { compressedSize int64 uncompressedSize int64 filters []filter } // String converts the block header into a string. func (h blockHeader) String() string { var buf bytes.Buffer first := true if h.compressedSize >= 0 { fmt.Fprintf(&buf, "compressed size %d", h.compressedSize) first = false } if h.uncompressedSize >= 0 { if !first { buf.WriteString(" ") } fmt.Fprintf(&buf, "uncompressed size %d", h.uncompressedSize) first = false } for _, f := range h.filters { if !first { buf.WriteString(" ") } fmt.Fprintf(&buf, "filter %s", f) first = false } return buf.String() } // Masks for the block flags. const ( filterCountMask = 0x03 compressedSizePresent = 0x40 uncompressedSizePresent = 0x80 reservedBlockFlags = 0x3C ) // errIndexIndicator signals that an index indicator (0x00) has been found // instead of an expected block header indicator. var errIndexIndicator = errors.New("xz: found index indicator") // readBlockHeader reads the block header. func readBlockHeader(r io.Reader) (h *blockHeader, n int, err error) { var buf bytes.Buffer buf.Grow(20) // block header size z, err := io.CopyN(&buf, r, 1) n = int(z) if err != nil { return nil, n, err } s := buf.Bytes()[0] if s == 0 { return nil, n, errIndexIndicator } // read complete header headerLen := (int(s) + 1) * 4 buf.Grow(headerLen - 1) z, err = io.CopyN(&buf, r, int64(headerLen-1)) n += int(z) if err != nil { return nil, n, err } // unmarshal block header h = new(blockHeader) if err = h.UnmarshalBinary(buf.Bytes()); err != nil { return nil, n, err } return h, n, nil } // readSizeInBlockHeader reads the uncompressed or compressed size // fields in the block header. The present value informs the function // whether the respective field is actually present in the header. func readSizeInBlockHeader(r io.ByteReader, present bool) (n int64, err error) { if !present { return -1, nil } x, _, err := readUvarint(r) if err != nil { return 0, err } if x >= 1<<63 { return 0, errors.New("xz: size overflow in block header") } return int64(x), nil } // UnmarshalBinary unmarshals the block header. func (h *blockHeader) UnmarshalBinary(data []byte) error { // Check header length s := data[0] if data[0] == 0 { return errIndexIndicator } headerLen := (int(s) + 1) * 4 if len(data) != headerLen { return fmt.Errorf("xz: data length %d; want %d", len(data), headerLen) } n := headerLen - 4 // Check CRC-32 crc := crc32.NewIEEE() crc.Write(data[:n]) if crc.Sum32() != uint32LE(data[n:]) { return errors.New("xz: checksum error for block header") } // Block header flags flags := data[1] if flags&reservedBlockFlags != 0 { return errors.New("xz: reserved block header flags set") } r := bytes.NewReader(data[2:n]) // Compressed size var err error h.compressedSize, err = readSizeInBlockHeader( r, flags&compressedSizePresent != 0) if err != nil { return err } // Uncompressed size h.uncompressedSize, err = readSizeInBlockHeader( r, flags&uncompressedSizePresent != 0) if err != nil { return err } h.filters, err = readFilters(r, int(flags&filterCountMask)+1) if err != nil { return err } // Check padding // Since headerLen is a multiple of 4 we don't need to check // alignment. k := r.Len() // The standard spec says that the padding should have not more // than 3 bytes. However we found paddings of 4 or 5 in the // wild. See https://github.com/ulikunitz/xz/pull/11 and // https://github.com/ulikunitz/xz/issues/15 // // The only reasonable approach seems to be to ignore the // padding size. We still check that all padding bytes are zero. if !allZeros(data[n-k : n]) { return errPadding } return nil } // MarshalBinary marshals the binary header. func (h *blockHeader) MarshalBinary() (data []byte, err error) { if !(minFilters <= len(h.filters) && len(h.filters) <= maxFilters) { return nil, errors.New("xz: filter count wrong") } for i, f := range h.filters { if i < len(h.filters)-1 { if f.id() == lzmaFilterID { return nil, errors.New( "xz: LZMA2 filter is not the last") } } else { // last filter if f.id() != lzmaFilterID { return nil, errors.New("xz: " + "last filter must be the LZMA2 filter") } } } var buf bytes.Buffer // header size must set at the end buf.WriteByte(0) // flags flags := byte(len(h.filters) - 1) if h.compressedSize >= 0 { flags |= compressedSizePresent } if h.uncompressedSize >= 0 { flags |= uncompressedSizePresent } buf.WriteByte(flags) p := make([]byte, 10) if h.compressedSize >= 0 { k := putUvarint(p, uint64(h.compressedSize)) buf.Write(p[:k]) } if h.uncompressedSize >= 0 { k := putUvarint(p, uint64(h.uncompressedSize)) buf.Write(p[:k]) } for _, f := range h.filters { fp, err := f.MarshalBinary() if err != nil { return nil, err } buf.Write(fp) } // padding for i := padLen(int64(buf.Len())); i > 0; i-- { buf.WriteByte(0) } // crc place holder buf.Write(p[:4]) data = buf.Bytes() if len(data)%4 != 0 { panic("data length not aligned") } s := len(data)/4 - 1 if !(1 < s && s <= 255) { panic("wrong block header size") } data[0] = byte(s) crc := crc32.NewIEEE() crc.Write(data[:len(data)-4]) putUint32LE(data[len(data)-4:], crc.Sum32()) return data, nil } // Constants used for marshalling and unmarshalling filters in the xz // block header. const ( minFilters = 1 maxFilters = 4 minReservedID = 1 << 62 ) // filter represents a filter in the block header. type filter interface { id() uint64 UnmarshalBinary(data []byte) error MarshalBinary() (data []byte, err error) reader(r io.Reader, c *ReaderConfig) (fr io.Reader, err error) writeCloser(w io.WriteCloser, c *WriterConfig) (fw io.WriteCloser, err error) // filter must be last filter last() bool } // readFilter reads a block filter from the block header. At this point // in time only the LZMA2 filter is supported. func readFilter(r io.Reader) (f filter, err error) { br := lzma.ByteReader(r) // index id, _, err := readUvarint(br) if err != nil { return nil, err } var data []byte switch id { case lzmaFilterID: data = make([]byte, lzmaFilterLen) data[0] = lzmaFilterID if _, err = io.ReadFull(r, data[1:]); err != nil { return nil, err } f = new(lzmaFilter) default: if id >= minReservedID { return nil, errors.New( "xz: reserved filter id in block stream header") } return nil, errors.New("xz: invalid filter id") } if err = f.UnmarshalBinary(data); err != nil { return nil, err } return f, err } // readFilters reads count filters. At this point in time only the count // 1 is supported. func readFilters(r io.Reader, count int) (filters []filter, err error) { if count != 1 { return nil, errors.New("xz: unsupported filter count") } f, err := readFilter(r) if err != nil { return nil, err } return []filter{f}, err } /*** Index ***/ // record describes a block in the xz file index. type record struct { unpaddedSize int64 uncompressedSize int64 } // readRecord reads an index record. func readRecord(r io.ByteReader) (rec record, n int, err error) { u, k, err := readUvarint(r) n += k if err != nil { return rec, n, err } rec.unpaddedSize = int64(u) if rec.unpaddedSize < 0 { return rec, n, errors.New("xz: unpadded size negative") } u, k, err = readUvarint(r) n += k if err != nil { return rec, n, err } rec.uncompressedSize = int64(u) if rec.uncompressedSize < 0 { return rec, n, errors.New("xz: uncompressed size negative") } return rec, n, nil } // MarshalBinary converts an index record in its binary encoding. func (rec *record) MarshalBinary() (data []byte, err error) { // maximum length of a uvarint is 10 p := make([]byte, 20) n := putUvarint(p, uint64(rec.unpaddedSize)) n += putUvarint(p[n:], uint64(rec.uncompressedSize)) return p[:n], nil } // writeIndex writes the index, a sequence of records. func writeIndex(w io.Writer, index []record) (n int64, err error) { crc := crc32.NewIEEE() mw := io.MultiWriter(w, crc) // index indicator k, err := mw.Write([]byte{0}) n += int64(k) if err != nil { return n, err } // number of records p := make([]byte, 10) k = putUvarint(p, uint64(len(index))) k, err = mw.Write(p[:k]) n += int64(k) if err != nil { return n, err } // list of records for _, rec := range index { p, err := rec.MarshalBinary() if err != nil { return n, err } k, err = mw.Write(p) n += int64(k) if err != nil { return n, err } } // index padding k, err = mw.Write(make([]byte, padLen(int64(n)))) n += int64(k) if err != nil { return n, err } // crc32 checksum putUint32LE(p, crc.Sum32()) k, err = w.Write(p[:4]) n += int64(k) return n, err } // readIndexBody reads the index from the reader. It assumes that the // index indicator has already been read. func readIndexBody(r io.Reader, expectedRecordLen int) (records []record, n int64, err error) { crc := crc32.NewIEEE() // index indicator crc.Write([]byte{0}) br := lzma.ByteReader(io.TeeReader(r, crc)) // number of records u, k, err := readUvarint(br) n += int64(k) if err != nil { return nil, n, err } recLen := int(u) if recLen < 0 || uint64(recLen) != u { return nil, n, errors.New("xz: record number overflow") } if recLen != expectedRecordLen { return nil, n, fmt.Errorf( "xz: index length is %d; want %d", recLen, expectedRecordLen) } // list of records records = make([]record, recLen) for i := range records { records[i], k, err = readRecord(br) n += int64(k) if err != nil { return nil, n, err } } p := make([]byte, padLen(int64(n+1)), 4) k, err = io.ReadFull(br.(io.Reader), p) n += int64(k) if err != nil { return nil, n, err } if !allZeros(p) { return nil, n, errors.New("xz: non-zero byte in index padding") } // crc32 s := crc.Sum32() p = p[:4] k, err = io.ReadFull(br.(io.Reader), p) n += int64(k) if err != nil { return records, n, err } if uint32LE(p) != s { return nil, n, errors.New("xz: wrong checksum for index") } return records, n, nil } ================================================ FILE: vendor/github.com/ulikunitz/xz/internal/hash/cyclic_poly.go ================================================ // Copyright 2014-2022 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package hash // CyclicPoly provides a cyclic polynomial rolling hash. type CyclicPoly struct { h uint64 p []uint64 i int } // ror rotates the unsigned 64-bit integer to right. The argument s must be // less than 64. func ror(x uint64, s uint) uint64 { return (x >> s) | (x << (64 - s)) } // NewCyclicPoly creates a new instance of the CyclicPoly structure. The // argument n gives the number of bytes for which a hash will be executed. // This number must be positive; the method panics if this isn't the case. func NewCyclicPoly(n int) *CyclicPoly { if n < 1 { panic("argument n must be positive") } return &CyclicPoly{p: make([]uint64, 0, n)} } // Len returns the length of the byte sequence for which a hash is generated. func (r *CyclicPoly) Len() int { return cap(r.p) } // RollByte hashes the next byte and returns a hash value. The complete becomes // available after at least Len() bytes have been hashed. func (r *CyclicPoly) RollByte(x byte) uint64 { y := hash[x] if len(r.p) < cap(r.p) { r.h = ror(r.h, 1) ^ y r.p = append(r.p, y) } else { r.h ^= ror(r.p[r.i], uint(cap(r.p)-1)) r.h = ror(r.h, 1) ^ y r.p[r.i] = y r.i = (r.i + 1) % cap(r.p) } return r.h } // Stores the hash for the individual bytes. var hash = [256]uint64{ 0x2e4fc3f904065142, 0xc790984cfbc99527, 0x879f95eb8c62f187, 0x3b61be86b5021ef2, 0x65a896a04196f0a5, 0xc5b307b80470b59e, 0xd3bff376a70df14b, 0xc332f04f0b3f1701, 0x753b5f0e9abf3e0d, 0xb41538fdfe66ef53, 0x1906a10c2c1c0208, 0xfb0c712a03421c0d, 0x38be311a65c9552b, 0xfee7ee4ca6445c7e, 0x71aadeded184f21e, 0xd73426fccda23b2d, 0x29773fb5fb9600b5, 0xce410261cd32981a, 0xfe2848b3c62dbc2d, 0x459eaaff6e43e11c, 0xc13e35fc9c73a887, 0xf30ed5c201e76dbc, 0xa5f10b3910482cea, 0x2945d59be02dfaad, 0x06ee334ff70571b5, 0xbabf9d8070f44380, 0xee3e2e9912ffd27c, 0x2a7118d1ea6b8ea7, 0x26183cb9f7b1664c, 0xea71dac7da068f21, 0xea92eca5bd1d0bb7, 0x415595862defcd75, 0x248a386023c60648, 0x9cf021ab284b3c8a, 0xfc9372df02870f6c, 0x2b92d693eeb3b3fc, 0x73e799d139dc6975, 0x7b15ae312486363c, 0xb70e5454a2239c80, 0x208e3fb31d3b2263, 0x01f563cabb930f44, 0x2ac4533d2a3240d8, 0x84231ed1064f6f7c, 0xa9f020977c2a6d19, 0x213c227271c20122, 0x09fe8a9a0a03d07a, 0x4236dc75bcaf910c, 0x460a8b2bead8f17e, 0xd9b27be1aa07055f, 0xd202d5dc4b11c33e, 0x70adb010543bea12, 0xcdae938f7ea6f579, 0x3f3d870208672f4d, 0x8e6ccbce9d349536, 0xe4c0871a389095ae, 0xf5f2a49152bca080, 0x9a43f9b97269934e, 0xc17b3753cb6f475c, 0xd56d941e8e206bd4, 0xac0a4f3e525eda00, 0xa06d5a011912a550, 0x5537ed19537ad1df, 0xa32fe713d611449d, 0x2a1d05b47c3b579f, 0x991d02dbd30a2a52, 0x39e91e7e28f93eb0, 0x40d06adb3e92c9ac, 0x9b9d3afde1c77c97, 0x9a3f3f41c02c616f, 0x22ecd4ba00f60c44, 0x0b63d5d801708420, 0x8f227ca8f37ffaec, 0x0256278670887c24, 0x107e14877dbf540b, 0x32c19f2786ac1c05, 0x1df5b12bb4bc9c61, 0xc0cac129d0d4c4e2, 0x9fdb52ee9800b001, 0x31f601d5d31c48c4, 0x72ff3c0928bcaec7, 0xd99264421147eb03, 0x535a2d6d38aefcfe, 0x6ba8b4454a916237, 0xfa39366eaae4719c, 0x10f00fd7bbb24b6f, 0x5bd23185c76c84d4, 0xb22c3d7e1b00d33f, 0x3efc20aa6bc830a8, 0xd61c2503fe639144, 0x30ce625441eb92d3, 0xe5d34cf359e93100, 0xa8e5aa13f2b9f7a5, 0x5c2b8d851ca254a6, 0x68fb6c5e8b0d5fdf, 0xc7ea4872c96b83ae, 0x6dd5d376f4392382, 0x1be88681aaa9792f, 0xfef465ee1b6c10d9, 0x1f98b65ed43fcb2e, 0x4d1ca11eb6e9a9c9, 0x7808e902b3857d0b, 0x171c9c4ea4607972, 0x58d66274850146df, 0x42b311c10d3981d1, 0x647fa8c621c41a4c, 0xf472771c66ddfedc, 0x338d27e3f847b46b, 0x6402ce3da97545ce, 0x5162db616fc38638, 0x9c83be97bc22a50e, 0x2d3d7478a78d5e72, 0xe621a9b938fd5397, 0x9454614eb0f81c45, 0x395fb6e742ed39b6, 0x77dd9179d06037bf, 0xc478d0fee4d2656d, 0x35d9d6cb772007af, 0x83a56e92c883f0f6, 0x27937453250c00a1, 0x27bd6ebc3a46a97d, 0x9f543bf784342d51, 0xd158f38c48b0ed52, 0x8dd8537c045f66b4, 0x846a57230226f6d5, 0x6b13939e0c4e7cdf, 0xfca25425d8176758, 0x92e5fc6cd52788e6, 0x9992e13d7a739170, 0x518246f7a199e8ea, 0xf104c2a71b9979c7, 0x86b3ffaabea4768f, 0x6388061cf3e351ad, 0x09d9b5295de5bbb5, 0x38bf1638c2599e92, 0x1d759846499e148d, 0x4c0ff015e5f96ef4, 0xa41a94cfa270f565, 0x42d76f9cb2326c0b, 0x0cf385dd3c9c23ba, 0x0508a6c7508d6e7a, 0x337523aabbe6cf8d, 0x646bb14001d42b12, 0xc178729d138adc74, 0xf900ef4491f24086, 0xee1a90d334bb5ac4, 0x9755c92247301a50, 0xb999bf7c4ff1b610, 0x6aeeb2f3b21e8fc9, 0x0fa8084cf91ac6ff, 0x10d226cf136e6189, 0xd302057a07d4fb21, 0x5f03800e20a0fcc3, 0x80118d4ae46bd210, 0x58ab61a522843733, 0x51edd575c5432a4b, 0x94ee6ff67f9197f7, 0x765669e0e5e8157b, 0xa5347830737132f0, 0x3ba485a69f01510c, 0x0b247d7b957a01c3, 0x1b3d63449fd807dc, 0x0fdc4721c30ad743, 0x8b535ed3829b2b14, 0xee41d0cad65d232c, 0xe6a99ed97a6a982f, 0x65ac6194c202003d, 0x692accf3a70573eb, 0xcc3c02c3e200d5af, 0x0d419e8b325914a3, 0x320f160f42c25e40, 0x00710d647a51fe7a, 0x3c947692330aed60, 0x9288aa280d355a7a, 0xa1806a9b791d1696, 0x5d60e38496763da1, 0x6c69e22e613fd0f4, 0x977fc2a5aadffb17, 0xfb7bd063fc5a94ba, 0x460c17992cbaece1, 0xf7822c5444d3297f, 0x344a9790c69b74aa, 0xb80a42e6cae09dce, 0x1b1361eaf2b1e757, 0xd84c1e758e236f01, 0x88e0b7be347627cc, 0x45246009b7a99490, 0x8011c6dd3fe50472, 0xc341d682bffb99d7, 0x2511be93808e2d15, 0xd5bc13d7fd739840, 0x2a3cd030679ae1ec, 0x8ad9898a4b9ee157, 0x3245fef0a8eaf521, 0x3d6d8dbbb427d2b0, 0x1ed146d8968b3981, 0x0c6a28bf7d45f3fc, 0x4a1fd3dbcee3c561, 0x4210ff6a476bf67e, 0xa559cce0d9199aac, 0xde39d47ef3723380, 0xe5b69d848ce42e35, 0xefa24296f8e79f52, 0x70190b59db9a5afc, 0x26f166cdb211e7bf, 0x4deaf2df3c6b8ef5, 0xf171dbdd670f1017, 0xb9059b05e9420d90, 0x2f0da855c9388754, 0x611d5e9ab77949cc, 0x2912038ac01163f4, 0x0231df50402b2fba, 0x45660fc4f3245f58, 0xb91cc97c7c8dac50, 0xb72d2aafe4953427, 0xfa6463f87e813d6b, 0x4515f7ee95d5c6a2, 0x1310e1c1a48d21c3, 0xad48a7810cdd8544, 0x4d5bdfefd5c9e631, 0xa43ed43f1fdcb7de, 0xe70cfc8fe1ee9626, 0xef4711b0d8dda442, 0xb80dd9bd4dab6c93, 0xa23be08d31ba4d93, 0x9b37db9d0335a39c, 0x494b6f870f5cfebc, 0x6d1b3c1149dda943, 0x372c943a518c1093, 0xad27af45e77c09c4, 0x3b6f92b646044604, 0xac2917909f5fcf4f, 0x2069a60e977e5557, 0x353a469e71014de5, 0x24be356281f55c15, 0x2b6d710ba8e9adea, 0x404ad1751c749c29, 0xed7311bf23d7f185, 0xba4f6976b4acc43e, 0x32d7198d2bc39000, 0xee667019014d6e01, 0x494ef3e128d14c83, 0x1f95a152baecd6be, 0x201648dff1f483a5, 0x68c28550c8384af6, 0x5fc834a6824a7f48, 0x7cd06cb7365eaf28, 0xd82bbd95e9b30909, 0x234f0d1694c53f6d, 0xd2fb7f4a96d83f4a, 0xff0d5da83acac05e, 0xf8f6b97f5585080a, 0x74236084be57b95b, 0xa25e40c03bbc36ad, 0x6b6e5c14ce88465b, 0x4378ffe93e1528c5, 0x94ca92a17118e2d2, } ================================================ FILE: vendor/github.com/ulikunitz/xz/internal/hash/doc.go ================================================ // Copyright 2014-2022 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Package hash provides rolling hashes. Rolling hashes have to be used for maintaining the positions of n-byte sequences in the dictionary buffer. The package provides currently the Rabin-Karp rolling hash and a Cyclic Polynomial hash. Both support the Hashes method to be used with an interface. */ package hash ================================================ FILE: vendor/github.com/ulikunitz/xz/internal/hash/rabin_karp.go ================================================ // Copyright 2014-2022 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package hash // A is the default constant for Robin-Karp rolling hash. This is a random // prime. const A = 0x97b548add41d5da1 // RabinKarp supports the computation of a rolling hash. type RabinKarp struct { A uint64 // a^n aOldest uint64 h uint64 p []byte i int } // NewRabinKarp creates a new RabinKarp value. The argument n defines the // length of the byte sequence to be hashed. The default constant will will be // used. func NewRabinKarp(n int) *RabinKarp { return NewRabinKarpConst(n, A) } // NewRabinKarpConst creates a new RabinKarp value. The argument n defines the // length of the byte sequence to be hashed. The argument a provides the // constant used to compute the hash. func NewRabinKarpConst(n int, a uint64) *RabinKarp { if n <= 0 { panic("number of bytes n must be positive") } aOldest := uint64(1) // There are faster methods. For the small n required by the LZMA // compressor O(n) is sufficient. for i := 0; i < n; i++ { aOldest *= a } return &RabinKarp{ A: a, aOldest: aOldest, p: make([]byte, 0, n), } } // Len returns the length of the byte sequence. func (r *RabinKarp) Len() int { return cap(r.p) } // RollByte computes the hash after x has been added. func (r *RabinKarp) RollByte(x byte) uint64 { if len(r.p) < cap(r.p) { r.h += uint64(x) r.h *= r.A r.p = append(r.p, x) } else { r.h -= uint64(r.p[r.i]) * r.aOldest r.h += uint64(x) r.h *= r.A r.p[r.i] = x r.i = (r.i + 1) % cap(r.p) } return r.h } ================================================ FILE: vendor/github.com/ulikunitz/xz/internal/hash/roller.go ================================================ // Copyright 2014-2022 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package hash // Roller provides an interface for rolling hashes. The hash value will become // valid after hash has been called Len times. type Roller interface { Len() int RollByte(x byte) uint64 } // Hashes computes all hash values for the array p. Note that the state of the // roller is changed. func Hashes(r Roller, p []byte) []uint64 { n := r.Len() if len(p) < n { return nil } h := make([]uint64, len(p)-n+1) for i := 0; i < n-1; i++ { r.RollByte(p[i]) } for i := range h { h[i] = r.RollByte(p[i+n-1]) } return h } ================================================ FILE: vendor/github.com/ulikunitz/xz/internal/xlog/xlog.go ================================================ // Copyright 2014-2022 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package xlog provides a simple logging package that allows to disable // certain message categories. It defines a type, Logger, with multiple // methods for formatting output. The package has also a predefined // 'standard' Logger accessible through helper function Print[f|ln], // Fatal[f|ln], Panic[f|ln], Warn[f|ln], Print[f|ln] and Debug[f|ln] // that are easier to use then creating a Logger manually. That logger // writes to standard error and prints the date and time of each logged // message, which can be configured using the function SetFlags. // // The Fatal functions call os.Exit(1) after the message is output // unless not suppressed by the flags. The Panic functions call panic // after the writing the log message unless suppressed. package xlog import ( "fmt" "io" "os" "runtime" "sync" "time" ) // The flags define what information is prefixed to each log entry // generated by the Logger. The Lno* versions allow the suppression of // specific output. The bits are or'ed together to control what will be // printed. There is no control over the order of the items printed and // the format. The full format is: // // 2009-01-23 01:23:23.123123 /a/b/c/d.go:23: message const ( Ldate = 1 << iota // the date: 2009-01-23 Ltime // the time: 01:23:23 Lmicroseconds // microsecond resolution: 01:23:23.123123 Llongfile // full file name and line number: /a/b/c/d.go:23 Lshortfile // final file name element and line number: d.go:23 Lnopanic // suppresses output from Panic[f|ln] but not the panic call Lnofatal // suppresses output from Fatal[f|ln] but not the exit Lnowarn // suppresses output from Warn[f|ln] Lnoprint // suppresses output from Print[f|ln] Lnodebug // suppresses output from Debug[f|ln] // initial values for the standard logger Lstdflags = Ldate | Ltime | Lnodebug ) // A Logger represents an active logging object that generates lines of // output to an io.Writer. Each logging operation if not suppressed // makes a single call to the Writer's Write method. A Logger can be // used simultaneously from multiple goroutines; it guarantees to // serialize access to the Writer. type Logger struct { mu sync.Mutex // ensures atomic writes; and protects the following // fields prefix string // prefix to write at beginning of each line flag int // properties out io.Writer // destination for output buf []byte // for accumulating text to write } // New creates a new Logger. The out argument sets the destination to // which the log output will be written. The prefix appears at the // beginning of each log line. The flag argument defines the logging // properties. func New(out io.Writer, prefix string, flag int) *Logger { return &Logger{out: out, prefix: prefix, flag: flag} } // std is the standard logger used by the package scope functions. var std = New(os.Stderr, "", Lstdflags) // itoa converts the integer to ASCII. A negative widths will avoid // zero-padding. The function supports only non-negative integers. func itoa(buf *[]byte, i int, wid int) { var u = uint(i) if u == 0 && wid <= 1 { *buf = append(*buf, '0') return } var b [32]byte bp := len(b) for ; u > 0 || wid > 0; u /= 10 { bp-- wid-- b[bp] = byte(u%10) + '0' } *buf = append(*buf, b[bp:]...) } // formatHeader puts the header into the buf field of the buffer. func (l *Logger) formatHeader(t time.Time, file string, line int) { l.buf = append(l.buf, l.prefix...) if l.flag&(Ldate|Ltime|Lmicroseconds) != 0 { if l.flag&Ldate != 0 { year, month, day := t.Date() itoa(&l.buf, year, 4) l.buf = append(l.buf, '-') itoa(&l.buf, int(month), 2) l.buf = append(l.buf, '-') itoa(&l.buf, day, 2) l.buf = append(l.buf, ' ') } if l.flag&(Ltime|Lmicroseconds) != 0 { hour, min, sec := t.Clock() itoa(&l.buf, hour, 2) l.buf = append(l.buf, ':') itoa(&l.buf, min, 2) l.buf = append(l.buf, ':') itoa(&l.buf, sec, 2) if l.flag&Lmicroseconds != 0 { l.buf = append(l.buf, '.') itoa(&l.buf, t.Nanosecond()/1e3, 6) } l.buf = append(l.buf, ' ') } } if l.flag&(Lshortfile|Llongfile) != 0 { if l.flag&Lshortfile != 0 { short := file for i := len(file) - 1; i > 0; i-- { if file[i] == '/' { short = file[i+1:] break } } file = short } l.buf = append(l.buf, file...) l.buf = append(l.buf, ':') itoa(&l.buf, line, -1) l.buf = append(l.buf, ": "...) } } func (l *Logger) output(calldepth int, now time.Time, s string) error { var file string var line int if l.flag&(Lshortfile|Llongfile) != 0 { l.mu.Unlock() var ok bool _, file, line, ok = runtime.Caller(calldepth) if !ok { file = "???" line = 0 } l.mu.Lock() } l.buf = l.buf[:0] l.formatHeader(now, file, line) l.buf = append(l.buf, s...) if len(s) == 0 || s[len(s)-1] != '\n' { l.buf = append(l.buf, '\n') } _, err := l.out.Write(l.buf) return err } // Output writes the string s with the header controlled by the flags to // the l.out writer. A newline will be appended if s doesn't end in a // newline. Calldepth is used to recover the PC, although all current // calls of Output use the call depth 2. Access to the function is serialized. func (l *Logger) Output(calldepth, noflag int, v ...interface{}) error { now := time.Now() l.mu.Lock() defer l.mu.Unlock() if l.flag&noflag != 0 { return nil } s := fmt.Sprint(v...) return l.output(calldepth+1, now, s) } // Outputf works like output but formats the output like Printf. func (l *Logger) Outputf(calldepth int, noflag int, format string, v ...interface{}) error { now := time.Now() l.mu.Lock() defer l.mu.Unlock() if l.flag&noflag != 0 { return nil } s := fmt.Sprintf(format, v...) return l.output(calldepth+1, now, s) } // Outputln works like output but formats the output like Println. func (l *Logger) Outputln(calldepth int, noflag int, v ...interface{}) error { now := time.Now() l.mu.Lock() defer l.mu.Unlock() if l.flag&noflag != 0 { return nil } s := fmt.Sprintln(v...) return l.output(calldepth+1, now, s) } // Panic prints the message like Print and calls panic. The printing // might be suppressed by the flag Lnopanic. func (l *Logger) Panic(v ...interface{}) { l.Output(2, Lnopanic, v...) s := fmt.Sprint(v...) panic(s) } // Panic prints the message like Print and calls panic. The printing // might be suppressed by the flag Lnopanic. func Panic(v ...interface{}) { std.Output(2, Lnopanic, v...) s := fmt.Sprint(v...) panic(s) } // Panicf prints the message like Printf and calls panic. The printing // might be suppressed by the flag Lnopanic. func (l *Logger) Panicf(format string, v ...interface{}) { l.Outputf(2, Lnopanic, format, v...) s := fmt.Sprintf(format, v...) panic(s) } // Panicf prints the message like Printf and calls panic. The printing // might be suppressed by the flag Lnopanic. func Panicf(format string, v ...interface{}) { std.Outputf(2, Lnopanic, format, v...) s := fmt.Sprintf(format, v...) panic(s) } // Panicln prints the message like Println and calls panic. The printing // might be suppressed by the flag Lnopanic. func (l *Logger) Panicln(v ...interface{}) { l.Outputln(2, Lnopanic, v...) s := fmt.Sprintln(v...) panic(s) } // Panicln prints the message like Println and calls panic. The printing // might be suppressed by the flag Lnopanic. func Panicln(v ...interface{}) { std.Outputln(2, Lnopanic, v...) s := fmt.Sprintln(v...) panic(s) } // Fatal prints the message like Print and calls os.Exit(1). The // printing might be suppressed by the flag Lnofatal. func (l *Logger) Fatal(v ...interface{}) { l.Output(2, Lnofatal, v...) os.Exit(1) } // Fatal prints the message like Print and calls os.Exit(1). The // printing might be suppressed by the flag Lnofatal. func Fatal(v ...interface{}) { std.Output(2, Lnofatal, v...) os.Exit(1) } // Fatalf prints the message like Printf and calls os.Exit(1). The // printing might be suppressed by the flag Lnofatal. func (l *Logger) Fatalf(format string, v ...interface{}) { l.Outputf(2, Lnofatal, format, v...) os.Exit(1) } // Fatalf prints the message like Printf and calls os.Exit(1). The // printing might be suppressed by the flag Lnofatal. func Fatalf(format string, v ...interface{}) { std.Outputf(2, Lnofatal, format, v...) os.Exit(1) } // Fatalln prints the message like Println and calls os.Exit(1). The // printing might be suppressed by the flag Lnofatal. func (l *Logger) Fatalln(format string, v ...interface{}) { l.Outputln(2, Lnofatal, v...) os.Exit(1) } // Fatalln prints the message like Println and calls os.Exit(1). The // printing might be suppressed by the flag Lnofatal. func Fatalln(format string, v ...interface{}) { std.Outputln(2, Lnofatal, v...) os.Exit(1) } // Warn prints the message like Print. The printing might be suppressed // by the flag Lnowarn. func (l *Logger) Warn(v ...interface{}) { l.Output(2, Lnowarn, v...) } // Warn prints the message like Print. The printing might be suppressed // by the flag Lnowarn. func Warn(v ...interface{}) { std.Output(2, Lnowarn, v...) } // Warnf prints the message like Printf. The printing might be suppressed // by the flag Lnowarn. func (l *Logger) Warnf(format string, v ...interface{}) { l.Outputf(2, Lnowarn, format, v...) } // Warnf prints the message like Printf. The printing might be suppressed // by the flag Lnowarn. func Warnf(format string, v ...interface{}) { std.Outputf(2, Lnowarn, format, v...) } // Warnln prints the message like Println. The printing might be suppressed // by the flag Lnowarn. func (l *Logger) Warnln(v ...interface{}) { l.Outputln(2, Lnowarn, v...) } // Warnln prints the message like Println. The printing might be suppressed // by the flag Lnowarn. func Warnln(v ...interface{}) { std.Outputln(2, Lnowarn, v...) } // Print prints the message like fmt.Print. The printing might be suppressed // by the flag Lnoprint. func (l *Logger) Print(v ...interface{}) { l.Output(2, Lnoprint, v...) } // Print prints the message like fmt.Print. The printing might be suppressed // by the flag Lnoprint. func Print(v ...interface{}) { std.Output(2, Lnoprint, v...) } // Printf prints the message like fmt.Printf. The printing might be suppressed // by the flag Lnoprint. func (l *Logger) Printf(format string, v ...interface{}) { l.Outputf(2, Lnoprint, format, v...) } // Printf prints the message like fmt.Printf. The printing might be suppressed // by the flag Lnoprint. func Printf(format string, v ...interface{}) { std.Outputf(2, Lnoprint, format, v...) } // Println prints the message like fmt.Println. The printing might be // suppressed by the flag Lnoprint. func (l *Logger) Println(v ...interface{}) { l.Outputln(2, Lnoprint, v...) } // Println prints the message like fmt.Println. The printing might be // suppressed by the flag Lnoprint. func Println(v ...interface{}) { std.Outputln(2, Lnoprint, v...) } // Debug prints the message like Print. The printing might be suppressed // by the flag Lnodebug. func (l *Logger) Debug(v ...interface{}) { l.Output(2, Lnodebug, v...) } // Debug prints the message like Print. The printing might be suppressed // by the flag Lnodebug. func Debug(v ...interface{}) { std.Output(2, Lnodebug, v...) } // Debugf prints the message like Printf. The printing might be suppressed // by the flag Lnodebug. func (l *Logger) Debugf(format string, v ...interface{}) { l.Outputf(2, Lnodebug, format, v...) } // Debugf prints the message like Printf. The printing might be suppressed // by the flag Lnodebug. func Debugf(format string, v ...interface{}) { std.Outputf(2, Lnodebug, format, v...) } // Debugln prints the message like Println. The printing might be suppressed // by the flag Lnodebug. func (l *Logger) Debugln(v ...interface{}) { l.Outputln(2, Lnodebug, v...) } // Debugln prints the message like Println. The printing might be suppressed // by the flag Lnodebug. func Debugln(v ...interface{}) { std.Outputln(2, Lnodebug, v...) } // Flags returns the current flags used by the logger. func (l *Logger) Flags() int { l.mu.Lock() defer l.mu.Unlock() return l.flag } // Flags returns the current flags used by the standard logger. func Flags() int { return std.Flags() } // SetFlags sets the flags of the logger. func (l *Logger) SetFlags(flag int) { l.mu.Lock() defer l.mu.Unlock() l.flag = flag } // SetFlags sets the flags for the standard logger. func SetFlags(flag int) { std.SetFlags(flag) } // Prefix returns the prefix used by the logger. func (l *Logger) Prefix() string { l.mu.Lock() defer l.mu.Unlock() return l.prefix } // Prefix returns the prefix used by the standard logger of the package. func Prefix() string { return std.Prefix() } // SetPrefix sets the prefix for the logger. func (l *Logger) SetPrefix(prefix string) { l.mu.Lock() defer l.mu.Unlock() l.prefix = prefix } // SetPrefix sets the prefix of the standard logger of the package. func SetPrefix(prefix string) { std.SetPrefix(prefix) } // SetOutput sets the output of the logger. func (l *Logger) SetOutput(w io.Writer) { l.mu.Lock() defer l.mu.Unlock() l.out = w } // SetOutput sets the output for the standard logger of the package. func SetOutput(w io.Writer) { std.SetOutput(w) } ================================================ FILE: vendor/github.com/ulikunitz/xz/lzma/bintree.go ================================================ // Copyright 2014-2022 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package lzma import ( "errors" "unicode" ) // node represents a node in the binary tree. type node struct { // x is the search value x uint32 // p parent node p uint32 // l left child l uint32 // r right child r uint32 } // wordLen is the number of bytes represented by the v field of a node. const wordLen = 4 // binTree supports the identification of the next operation based on a // binary tree. // // Nodes will be identified by their index into the ring buffer. type binTree struct { dict *encoderDict // ring buffer of nodes node []node // absolute offset of the entry for the next node. Position 4 // byte larger. hoff int64 // front position in the node ring buffer front uint32 // index of the root node root uint32 // current x value x uint32 // preallocated array data []byte } // null represents the nonexistent index. We can't use zero because it // would always exist or we would need to decrease the index for each // reference. const null uint32 = 1<<32 - 1 // newBinTree initializes the binTree structure. The capacity defines // the size of the buffer and defines the maximum distance for which // matches will be found. func newBinTree(capacity int) (t *binTree, err error) { if capacity < 1 { return nil, errors.New( "newBinTree: capacity must be larger than zero") } if int64(capacity) >= int64(null) { return nil, errors.New( "newBinTree: capacity must less 2^{32}-1") } t = &binTree{ node: make([]node, capacity), hoff: -int64(wordLen), root: null, data: make([]byte, maxMatchLen), } return t, nil } func (t *binTree) SetDict(d *encoderDict) { t.dict = d } // WriteByte writes a single byte into the binary tree. func (t *binTree) WriteByte(c byte) error { t.x = (t.x << 8) | uint32(c) t.hoff++ if t.hoff < 0 { return nil } v := t.front if int64(v) < t.hoff { // We are overwriting old nodes stored in the tree. t.remove(v) } t.node[v].x = t.x t.add(v) t.front++ if int64(t.front) >= int64(len(t.node)) { t.front = 0 } return nil } // Writes writes a sequence of bytes into the binTree structure. func (t *binTree) Write(p []byte) (n int, err error) { for _, c := range p { t.WriteByte(c) } return len(p), nil } // add puts the node v into the tree. The node must not be part of the // tree before. func (t *binTree) add(v uint32) { vn := &t.node[v] // Set left and right to null indices. vn.l, vn.r = null, null // If the binary tree is empty make v the root. if t.root == null { t.root = v vn.p = null return } x := vn.x p := t.root // Search for the right leave link and add the new node. for { pn := &t.node[p] if x <= pn.x { if pn.l == null { pn.l = v vn.p = p return } p = pn.l } else { if pn.r == null { pn.r = v vn.p = p return } p = pn.r } } } // parent returns the parent node index of v and the pointer to v value // in the parent. func (t *binTree) parent(v uint32) (p uint32, ptr *uint32) { if t.root == v { return null, &t.root } p = t.node[v].p if t.node[p].l == v { ptr = &t.node[p].l } else { ptr = &t.node[p].r } return } // Remove node v. func (t *binTree) remove(v uint32) { vn := &t.node[v] p, ptr := t.parent(v) l, r := vn.l, vn.r if l == null { // Move the right child up. *ptr = r if r != null { t.node[r].p = p } return } if r == null { // Move the left child up. *ptr = l t.node[l].p = p return } // Search the in-order predecessor u. un := &t.node[l] ur := un.r if ur == null { // In order predecessor is l. Move it up. un.r = r t.node[r].p = l un.p = p *ptr = l return } var u uint32 for { // Look for the max value in the tree where l is root. u = ur ur = t.node[u].r if ur == null { break } } // replace u with ul un = &t.node[u] ul := un.l up := un.p t.node[up].r = ul if ul != null { t.node[ul].p = up } // replace v by u un.l, un.r = l, r t.node[l].p = u t.node[r].p = u *ptr = u un.p = p } // search looks for the node that have the value x or for the nodes that // brace it. The node highest in the tree with the value x will be // returned. All other nodes with the same value live in left subtree of // the returned node. func (t *binTree) search(v uint32, x uint32) (a, b uint32) { a, b = null, null if v == null { return } for { vn := &t.node[v] if x <= vn.x { if x == vn.x { return v, v } b = v if vn.l == null { return } v = vn.l } else { a = v if vn.r == null { return } v = vn.r } } } // max returns the node with maximum value in the subtree with v as // root. func (t *binTree) max(v uint32) uint32 { if v == null { return null } for { r := t.node[v].r if r == null { return v } v = r } } // min returns the node with the minimum value in the subtree with v as // root. func (t *binTree) min(v uint32) uint32 { if v == null { return null } for { l := t.node[v].l if l == null { return v } v = l } } // pred returns the in-order predecessor of node v. func (t *binTree) pred(v uint32) uint32 { if v == null { return null } u := t.max(t.node[v].l) if u != null { return u } for { p := t.node[v].p if p == null { return null } if t.node[p].r == v { return p } v = p } } // succ returns the in-order successor of node v. func (t *binTree) succ(v uint32) uint32 { if v == null { return null } u := t.min(t.node[v].r) if u != null { return u } for { p := t.node[v].p if p == null { return null } if t.node[p].l == v { return p } v = p } } // xval converts the first four bytes of a into an 32-bit unsigned // integer in big-endian order. func xval(a []byte) uint32 { var x uint32 switch len(a) { default: x |= uint32(a[3]) fallthrough case 3: x |= uint32(a[2]) << 8 fallthrough case 2: x |= uint32(a[1]) << 16 fallthrough case 1: x |= uint32(a[0]) << 24 case 0: } return x } // dumpX converts value x into a four-letter string. func dumpX(x uint32) string { a := make([]byte, 4) for i := 0; i < 4; i++ { c := byte(x >> uint((3-i)*8)) if unicode.IsGraphic(rune(c)) { a[i] = c } else { a[i] = '.' } } return string(a) } /* // dumpNode writes a representation of the node v into the io.Writer. func (t *binTree) dumpNode(w io.Writer, v uint32, indent int) { if v == null { return } vn := &t.node[v] t.dumpNode(w, vn.r, indent+2) for i := 0; i < indent; i++ { fmt.Fprint(w, " ") } if vn.p == null { fmt.Fprintf(w, "node %d %q parent null\n", v, dumpX(vn.x)) } else { fmt.Fprintf(w, "node %d %q parent %d\n", v, dumpX(vn.x), vn.p) } t.dumpNode(w, vn.l, indent+2) } // dump prints a representation of the binary tree into the writer. func (t *binTree) dump(w io.Writer) error { bw := bufio.NewWriter(w) t.dumpNode(bw, t.root, 0) return bw.Flush() } */ func (t *binTree) distance(v uint32) int { dist := int(t.front) - int(v) if dist <= 0 { dist += len(t.node) } return dist } type matchParams struct { rep [4]uint32 // length when match will be accepted nAccept int // nodes to check check int // finish if length get shorter stopShorter bool } func (t *binTree) match(m match, distIter func() (int, bool), p matchParams, ) (r match, checked int, accepted bool) { buf := &t.dict.buf for { if checked >= p.check { return m, checked, true } dist, ok := distIter() if !ok { return m, checked, false } checked++ if m.n > 0 { i := buf.rear - dist + m.n - 1 if i < 0 { i += len(buf.data) } else if i >= len(buf.data) { i -= len(buf.data) } if buf.data[i] != t.data[m.n-1] { if p.stopShorter { return m, checked, false } continue } } n := buf.matchLen(dist, t.data) switch n { case 0: if p.stopShorter { return m, checked, false } continue case 1: if uint32(dist-minDistance) != p.rep[0] { continue } } if n < m.n || (n == m.n && int64(dist) >= m.distance) { continue } m = match{int64(dist), n} if n >= p.nAccept { return m, checked, true } } } func (t *binTree) NextOp(rep [4]uint32) operation { // retrieve maxMatchLen data n, _ := t.dict.buf.Peek(t.data[:maxMatchLen]) if n == 0 { panic("no data in buffer") } t.data = t.data[:n] var ( m match x, u, v uint32 iterPred, iterSucc func() (int, bool) ) p := matchParams{ rep: rep, nAccept: maxMatchLen, check: 32, } i := 4 iterSmall := func() (dist int, ok bool) { i-- if i <= 0 { return 0, false } return i, true } m, checked, accepted := t.match(m, iterSmall, p) if accepted { goto end } p.check -= checked x = xval(t.data) u, v = t.search(t.root, x) if u == v && len(t.data) == 4 { iter := func() (dist int, ok bool) { if u == null { return 0, false } dist = t.distance(u) u, v = t.search(t.node[u].l, x) if u != v { u = null } return dist, true } m, _, _ = t.match(m, iter, p) goto end } p.stopShorter = true iterSucc = func() (dist int, ok bool) { if v == null { return 0, false } dist = t.distance(v) v = t.succ(v) return dist, true } m, checked, accepted = t.match(m, iterSucc, p) if accepted { goto end } p.check -= checked iterPred = func() (dist int, ok bool) { if u == null { return 0, false } dist = t.distance(u) u = t.pred(u) return dist, true } m, _, _ = t.match(m, iterPred, p) end: if m.n == 0 { return lit{t.data[0]} } return m } ================================================ FILE: vendor/github.com/ulikunitz/xz/lzma/bitops.go ================================================ // Copyright 2014-2022 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package lzma /* Naming conventions follows the CodeReviewComments in the Go Wiki. */ // ntz32Const is used by the functions NTZ and NLZ. const ntz32Const = 0x04d7651f // ntz32Table is a helper table for de Bruijn algorithm by Danny Dubé. // See Henry S. Warren, Jr. "Hacker's Delight" section 5-1 figure 5-26. var ntz32Table = [32]int8{ 0, 1, 2, 24, 3, 19, 6, 25, 22, 4, 20, 10, 16, 7, 12, 26, 31, 23, 18, 5, 21, 9, 15, 11, 30, 17, 8, 14, 29, 13, 28, 27, } /* // ntz32 computes the number of trailing zeros for an unsigned 32-bit integer. func ntz32(x uint32) int { if x == 0 { return 32 } x = (x & -x) * ntz32Const return int(ntz32Table[x>>27]) } */ // nlz32 computes the number of leading zeros for an unsigned 32-bit integer. func nlz32(x uint32) int { // Smear left most bit to the right x |= x >> 1 x |= x >> 2 x |= x >> 4 x |= x >> 8 x |= x >> 16 // Use ntz mechanism to calculate nlz. x++ if x == 0 { return 0 } x *= ntz32Const return 32 - int(ntz32Table[x>>27]) } ================================================ FILE: vendor/github.com/ulikunitz/xz/lzma/breader.go ================================================ // Copyright 2014-2022 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package lzma import ( "errors" "io" ) // breader provides the ReadByte function for a Reader. It doesn't read // more data from the reader than absolutely necessary. type breader struct { io.Reader // helper slice to save allocations p []byte } // ByteReader converts an io.Reader into an io.ByteReader. func ByteReader(r io.Reader) io.ByteReader { br, ok := r.(io.ByteReader) if !ok { return &breader{r, make([]byte, 1)} } return br } // ReadByte read byte function. func (r *breader) ReadByte() (c byte, err error) { n, err := r.Reader.Read(r.p) if n < 1 { if err == nil { err = errors.New("breader.ReadByte: no data") } return 0, err } return r.p[0], nil } ================================================ FILE: vendor/github.com/ulikunitz/xz/lzma/buffer.go ================================================ // Copyright 2014-2022 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package lzma import ( "errors" ) // buffer provides a circular buffer of bytes. If the front index equals // the rear index the buffer is empty. As a consequence front cannot be // equal rear for a full buffer. So a full buffer has a length that is // one byte less the the length of the data slice. type buffer struct { data []byte front int rear int } // newBuffer creates a buffer with the given size. func newBuffer(size int) *buffer { return &buffer{data: make([]byte, size+1)} } // Cap returns the capacity of the buffer. func (b *buffer) Cap() int { return len(b.data) - 1 } // Resets the buffer. The front and rear index are set to zero. func (b *buffer) Reset() { b.front = 0 b.rear = 0 } // Buffered returns the number of bytes buffered. func (b *buffer) Buffered() int { delta := b.front - b.rear if delta < 0 { delta += len(b.data) } return delta } // Available returns the number of bytes available for writing. func (b *buffer) Available() int { delta := b.rear - 1 - b.front if delta < 0 { delta += len(b.data) } return delta } // addIndex adds a non-negative integer to the index i and returns the // resulting index. The function takes care of wrapping the index as // well as potential overflow situations. func (b *buffer) addIndex(i int, n int) int { // subtraction of len(b.data) prevents overflow i += n - len(b.data) if i < 0 { i += len(b.data) } return i } // Read reads bytes from the buffer into p and returns the number of // bytes read. The function never returns an error but might return less // data than requested. func (b *buffer) Read(p []byte) (n int, err error) { n, err = b.Peek(p) b.rear = b.addIndex(b.rear, n) return n, err } // Peek reads bytes from the buffer into p without changing the buffer. // Peek will never return an error but might return less data than // requested. func (b *buffer) Peek(p []byte) (n int, err error) { m := b.Buffered() n = len(p) if m < n { n = m p = p[:n] } k := copy(p, b.data[b.rear:]) if k < n { copy(p[k:], b.data) } return n, nil } // Discard skips the n next bytes to read from the buffer, returning the // bytes discarded. // // If Discards skips fewer than n bytes, it returns an error. func (b *buffer) Discard(n int) (discarded int, err error) { if n < 0 { return 0, errors.New("buffer.Discard: negative argument") } m := b.Buffered() if m < n { n = m err = errors.New( "buffer.Discard: discarded less bytes then requested") } b.rear = b.addIndex(b.rear, n) return n, err } // ErrNoSpace indicates that there is insufficient space for the Write // operation. var ErrNoSpace = errors.New("insufficient space") // Write puts data into the buffer. If less bytes are written than // requested ErrNoSpace is returned. func (b *buffer) Write(p []byte) (n int, err error) { m := b.Available() n = len(p) if m < n { n = m p = p[:m] err = ErrNoSpace } k := copy(b.data[b.front:], p) if k < n { copy(b.data, p[k:]) } b.front = b.addIndex(b.front, n) return n, err } // WriteByte writes a single byte into the buffer. The error ErrNoSpace // is returned if no single byte is available in the buffer for writing. func (b *buffer) WriteByte(c byte) error { if b.Available() < 1 { return ErrNoSpace } b.data[b.front] = c b.front = b.addIndex(b.front, 1) return nil } // prefixLen returns the length of the common prefix of a and b. func prefixLen(a, b []byte) int { if len(a) > len(b) { a, b = b, a } for i, c := range a { if b[i] != c { return i } } return len(a) } // matchLen returns the length of the common prefix for the given // distance from the rear and the byte slice p. func (b *buffer) matchLen(distance int, p []byte) int { var n int i := b.rear - distance if i < 0 { if n = prefixLen(p, b.data[len(b.data)+i:]); n < -i { return n } p = p[n:] i = 0 } n += prefixLen(p, b.data[i:]) return n } ================================================ FILE: vendor/github.com/ulikunitz/xz/lzma/bytewriter.go ================================================ // Copyright 2014-2022 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package lzma import ( "errors" "io" ) // ErrLimit indicates that the limit of the LimitedByteWriter has been // reached. var ErrLimit = errors.New("limit reached") // LimitedByteWriter provides a byte writer that can be written until a // limit is reached. The field N provides the number of remaining // bytes. type LimitedByteWriter struct { BW io.ByteWriter N int64 } // WriteByte writes a single byte to the limited byte writer. It returns // ErrLimit if the limit has been reached. If the byte is successfully // written the field N of the LimitedByteWriter will be decremented by // one. func (l *LimitedByteWriter) WriteByte(c byte) error { if l.N <= 0 { return ErrLimit } if err := l.BW.WriteByte(c); err != nil { return err } l.N-- return nil } ================================================ FILE: vendor/github.com/ulikunitz/xz/lzma/decoder.go ================================================ // Copyright 2014-2022 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package lzma import ( "errors" "fmt" "io" ) // decoder decodes a raw LZMA stream without any header. type decoder struct { // dictionary; the rear pointer of the buffer will be used for // reading the data. Dict *decoderDict // decoder state State *state // range decoder rd *rangeDecoder // start stores the head value of the dictionary for the LZMA // stream start int64 // size of uncompressed data size int64 // end-of-stream encountered eos bool // EOS marker found eosMarker bool } // newDecoder creates a new decoder instance. The parameter size provides // the expected byte size of the decompressed data. If the size is // unknown use a negative value. In that case the decoder will look for // a terminating end-of-stream marker. func newDecoder(br io.ByteReader, state *state, dict *decoderDict, size int64) (d *decoder, err error) { rd, err := newRangeDecoder(br) if err != nil { return nil, err } d = &decoder{ State: state, Dict: dict, rd: rd, size: size, start: dict.pos(), } return d, nil } // Reopen restarts the decoder with a new byte reader and a new size. Reopen // resets the Decompressed counter to zero. func (d *decoder) Reopen(br io.ByteReader, size int64) error { var err error if d.rd, err = newRangeDecoder(br); err != nil { return err } d.start = d.Dict.pos() d.size = size d.eos = false return nil } // decodeLiteral decodes a single literal from the LZMA stream. func (d *decoder) decodeLiteral() (op operation, err error) { litState := d.State.litState(d.Dict.byteAt(1), d.Dict.head) match := d.Dict.byteAt(int(d.State.rep[0]) + 1) s, err := d.State.litCodec.Decode(d.rd, d.State.state, match, litState) if err != nil { return nil, err } return lit{s}, nil } // errEOS indicates that an EOS marker has been found. var errEOS = errors.New("EOS marker found") // readOp decodes the next operation from the compressed stream. It // returns the operation. If an explicit end of stream marker is // identified the eos error is returned. func (d *decoder) readOp() (op operation, err error) { // Value of the end of stream (EOS) marker const eosDist = 1<<32 - 1 state, state2, posState := d.State.states(d.Dict.head) b, err := d.State.isMatch[state2].Decode(d.rd) if err != nil { return nil, err } if b == 0 { // literal op, err := d.decodeLiteral() if err != nil { return nil, err } d.State.updateStateLiteral() return op, nil } b, err = d.State.isRep[state].Decode(d.rd) if err != nil { return nil, err } if b == 0 { // simple match d.State.rep[3], d.State.rep[2], d.State.rep[1] = d.State.rep[2], d.State.rep[1], d.State.rep[0] d.State.updateStateMatch() // The length decoder returns the length offset. n, err := d.State.lenCodec.Decode(d.rd, posState) if err != nil { return nil, err } // The dist decoder returns the distance offset. The actual // distance is 1 higher. d.State.rep[0], err = d.State.distCodec.Decode(d.rd, n) if err != nil { return nil, err } if d.State.rep[0] == eosDist { d.eosMarker = true return nil, errEOS } op = match{n: int(n) + minMatchLen, distance: int64(d.State.rep[0]) + minDistance} return op, nil } b, err = d.State.isRepG0[state].Decode(d.rd) if err != nil { return nil, err } dist := d.State.rep[0] if b == 0 { // rep match 0 b, err = d.State.isRepG0Long[state2].Decode(d.rd) if err != nil { return nil, err } if b == 0 { d.State.updateStateShortRep() op = match{n: 1, distance: int64(dist) + minDistance} return op, nil } } else { b, err = d.State.isRepG1[state].Decode(d.rd) if err != nil { return nil, err } if b == 0 { dist = d.State.rep[1] } else { b, err = d.State.isRepG2[state].Decode(d.rd) if err != nil { return nil, err } if b == 0 { dist = d.State.rep[2] } else { dist = d.State.rep[3] d.State.rep[3] = d.State.rep[2] } d.State.rep[2] = d.State.rep[1] } d.State.rep[1] = d.State.rep[0] d.State.rep[0] = dist } n, err := d.State.repLenCodec.Decode(d.rd, posState) if err != nil { return nil, err } d.State.updateStateRep() op = match{n: int(n) + minMatchLen, distance: int64(dist) + minDistance} return op, nil } // apply takes the operation and transforms the decoder dictionary accordingly. func (d *decoder) apply(op operation) error { var err error switch x := op.(type) { case match: err = d.Dict.writeMatch(x.distance, x.n) case lit: err = d.Dict.WriteByte(x.b) default: panic("op is neither a match nor a literal") } return err } // decompress fills the dictionary unless no space for new data is // available. If the end of the LZMA stream has been reached io.EOF will // be returned. func (d *decoder) decompress() error { if d.eos { return io.EOF } for d.Dict.Available() >= maxMatchLen { op, err := d.readOp() switch err { case nil: // break case errEOS: d.eos = true if !d.rd.possiblyAtEnd() { return errDataAfterEOS } if d.size >= 0 && d.size != d.Decompressed() { return errSize } return io.EOF case io.EOF: d.eos = true return io.ErrUnexpectedEOF default: return err } if err = d.apply(op); err != nil { return err } if d.size >= 0 && d.Decompressed() >= d.size { d.eos = true if d.Decompressed() > d.size { return errSize } if !d.rd.possiblyAtEnd() { switch _, err = d.readOp(); err { case nil: return errSize case io.EOF: return io.ErrUnexpectedEOF case errEOS: break default: return err } } return io.EOF } } return nil } // Errors that may be returned while decoding data. var ( errDataAfterEOS = errors.New("lzma: data after end of stream marker") errSize = errors.New("lzma: wrong uncompressed data size") ) // Read reads data from the buffer. If no more data is available io.EOF is // returned. func (d *decoder) Read(p []byte) (n int, err error) { var k int for { // Read of decoder dict never returns an error. k, err = d.Dict.Read(p[n:]) if err != nil { panic(fmt.Errorf("dictionary read error %s", err)) } if k == 0 && d.eos { return n, io.EOF } n += k if n >= len(p) { return n, nil } if err = d.decompress(); err != nil && err != io.EOF { return n, err } } } // Decompressed returns the number of bytes decompressed by the decoder. func (d *decoder) Decompressed() int64 { return d.Dict.pos() - d.start } ================================================ FILE: vendor/github.com/ulikunitz/xz/lzma/decoderdict.go ================================================ // Copyright 2014-2022 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package lzma import ( "errors" "fmt" ) // decoderDict provides the dictionary for the decoder. The whole // dictionary is used as reader buffer. type decoderDict struct { buf buffer head int64 } // newDecoderDict creates a new decoder dictionary. The whole dictionary // will be used as reader buffer. func newDecoderDict(dictCap int) (d *decoderDict, err error) { // lower limit supports easy test cases if !(1 <= dictCap && int64(dictCap) <= MaxDictCap) { return nil, errors.New("lzma: dictCap out of range") } d = &decoderDict{buf: *newBuffer(dictCap)} return d, nil } // Reset clears the dictionary. The read buffer is not changed, so the // buffered data can still be read. func (d *decoderDict) Reset() { d.head = 0 } // WriteByte writes a single byte into the dictionary. It is used to // write literals into the dictionary. func (d *decoderDict) WriteByte(c byte) error { if err := d.buf.WriteByte(c); err != nil { return err } d.head++ return nil } // pos returns the position of the dictionary head. func (d *decoderDict) pos() int64 { return d.head } // dictLen returns the actual length of the dictionary. func (d *decoderDict) dictLen() int { capacity := d.buf.Cap() if d.head >= int64(capacity) { return capacity } return int(d.head) } // byteAt returns a byte stored in the dictionary. If the distance is // non-positive or exceeds the current length of the dictionary the zero // byte is returned. func (d *decoderDict) byteAt(dist int) byte { if !(0 < dist && dist <= d.dictLen()) { return 0 } i := d.buf.front - dist if i < 0 { i += len(d.buf.data) } return d.buf.data[i] } // writeMatch writes the match at the top of the dictionary. The given // distance must point in the current dictionary and the length must not // exceed the maximum length 273 supported in LZMA. // // The error value ErrNoSpace indicates that no space is available in // the dictionary for writing. You need to read from the dictionary // first. func (d *decoderDict) writeMatch(dist int64, length int) error { if !(0 < dist && dist <= int64(d.dictLen())) { return errors.New("writeMatch: distance out of range") } if !(0 < length && length <= maxMatchLen) { return errors.New("writeMatch: length out of range") } if length > d.buf.Available() { return ErrNoSpace } d.head += int64(length) i := d.buf.front - int(dist) if i < 0 { i += len(d.buf.data) } for length > 0 { var p []byte if i >= d.buf.front { p = d.buf.data[i:] i = 0 } else { p = d.buf.data[i:d.buf.front] i = d.buf.front } if len(p) > length { p = p[:length] } if _, err := d.buf.Write(p); err != nil { panic(fmt.Errorf("d.buf.Write returned error %s", err)) } length -= len(p) } return nil } // Write writes the given bytes into the dictionary and advances the // head. func (d *decoderDict) Write(p []byte) (n int, err error) { n, err = d.buf.Write(p) d.head += int64(n) return n, err } // Available returns the number of available bytes for writing into the // decoder dictionary. func (d *decoderDict) Available() int { return d.buf.Available() } // Read reads data from the buffer contained in the decoder dictionary. func (d *decoderDict) Read(p []byte) (n int, err error) { return d.buf.Read(p) } ================================================ FILE: vendor/github.com/ulikunitz/xz/lzma/directcodec.go ================================================ // Copyright 2014-2022 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package lzma // directCodec allows the encoding and decoding of values with a fixed number // of bits. The number of bits must be in the range [1,32]. type directCodec byte // Bits returns the number of bits supported by this codec. func (dc directCodec) Bits() int { return int(dc) } // Encode uses the range encoder to encode a value with the fixed number of // bits. The most-significant bit is encoded first. func (dc directCodec) Encode(e *rangeEncoder, v uint32) error { for i := int(dc) - 1; i >= 0; i-- { if err := e.DirectEncodeBit(v >> uint(i)); err != nil { return err } } return nil } // Decode uses the range decoder to decode a value with the given number of // given bits. The most-significant bit is decoded first. func (dc directCodec) Decode(d *rangeDecoder) (v uint32, err error) { for i := int(dc) - 1; i >= 0; i-- { x, err := d.DirectDecodeBit() if err != nil { return 0, err } v = (v << 1) | x } return v, nil } ================================================ FILE: vendor/github.com/ulikunitz/xz/lzma/distcodec.go ================================================ // Copyright 2014-2022 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package lzma // Constants used by the distance codec. const ( // minimum supported distance minDistance = 1 // maximum supported distance, value is used for the eos marker. maxDistance = 1 << 32 // number of the supported len states lenStates = 4 // start for the position models startPosModel = 4 // first index with align bits support endPosModel = 14 // bits for the position slots posSlotBits = 6 // number of align bits alignBits = 4 ) // distCodec provides encoding and decoding of distance values. type distCodec struct { posSlotCodecs [lenStates]treeCodec posModel [endPosModel - startPosModel]treeReverseCodec alignCodec treeReverseCodec } // deepcopy initializes dc as deep copy of the source. func (dc *distCodec) deepcopy(src *distCodec) { if dc == src { return } for i := range dc.posSlotCodecs { dc.posSlotCodecs[i].deepcopy(&src.posSlotCodecs[i]) } for i := range dc.posModel { dc.posModel[i].deepcopy(&src.posModel[i]) } dc.alignCodec.deepcopy(&src.alignCodec) } // newDistCodec creates a new distance codec. func (dc *distCodec) init() { for i := range dc.posSlotCodecs { dc.posSlotCodecs[i] = makeTreeCodec(posSlotBits) } for i := range dc.posModel { posSlot := startPosModel + i bits := (posSlot >> 1) - 1 dc.posModel[i] = makeTreeReverseCodec(bits) } dc.alignCodec = makeTreeReverseCodec(alignBits) } // lenState converts the value l to a supported lenState value. func lenState(l uint32) uint32 { if l >= lenStates { l = lenStates - 1 } return l } // Encode encodes the distance using the parameter l. Dist can have values from // the full range of uint32 values. To get the distance offset the actual match // distance has to be decreased by 1. A distance offset of 0xffffffff (eos) // indicates the end of the stream. func (dc *distCodec) Encode(e *rangeEncoder, dist uint32, l uint32) (err error) { // Compute the posSlot using nlz32 var posSlot uint32 var bits uint32 if dist < startPosModel { posSlot = dist } else { bits = uint32(30 - nlz32(dist)) posSlot = startPosModel - 2 + (bits << 1) posSlot += (dist >> uint(bits)) & 1 } if err = dc.posSlotCodecs[lenState(l)].Encode(e, posSlot); err != nil { return } switch { case posSlot < startPosModel: return nil case posSlot < endPosModel: tc := &dc.posModel[posSlot-startPosModel] return tc.Encode(dist, e) } dic := directCodec(bits - alignBits) if err = dic.Encode(e, dist>>alignBits); err != nil { return } return dc.alignCodec.Encode(dist, e) } // Decode decodes the distance offset using the parameter l. The dist value // 0xffffffff (eos) indicates the end of the stream. Add one to the distance // offset to get the actual match distance. func (dc *distCodec) Decode(d *rangeDecoder, l uint32) (dist uint32, err error) { posSlot, err := dc.posSlotCodecs[lenState(l)].Decode(d) if err != nil { return } // posSlot equals distance if posSlot < startPosModel { return posSlot, nil } // posSlot uses the individual models bits := (posSlot >> 1) - 1 dist = (2 | (posSlot & 1)) << bits var u uint32 if posSlot < endPosModel { tc := &dc.posModel[posSlot-startPosModel] if u, err = tc.Decode(d); err != nil { return 0, err } dist += u return dist, nil } // posSlots use direct encoding and a single model for the four align // bits. dic := directCodec(bits - alignBits) if u, err = dic.Decode(d); err != nil { return 0, err } dist += u << alignBits if u, err = dc.alignCodec.Decode(d); err != nil { return 0, err } dist += u return dist, nil } ================================================ FILE: vendor/github.com/ulikunitz/xz/lzma/encoder.go ================================================ // Copyright 2014-2022 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package lzma import ( "fmt" "io" ) // opLenMargin provides the upper limit of the number of bytes required // to encode a single operation. const opLenMargin = 16 // compressFlags control the compression process. type compressFlags uint32 // Values for compressFlags. const ( // all data should be compressed, even if compression is not // optimal. all compressFlags = 1 << iota ) // encoderFlags provide the flags for an encoder. type encoderFlags uint32 // Flags for the encoder. const ( // eosMarker requests an EOS marker to be written. eosMarker encoderFlags = 1 << iota ) // Encoder compresses data buffered in the encoder dictionary and writes // it into a byte writer. type encoder struct { dict *encoderDict state *state re *rangeEncoder start int64 // generate eos marker marker bool limit bool margin int } // newEncoder creates a new encoder. If the byte writer must be // limited use LimitedByteWriter provided by this package. The flags // argument supports the eosMarker flag, controlling whether a // terminating end-of-stream marker must be written. func newEncoder(bw io.ByteWriter, state *state, dict *encoderDict, flags encoderFlags) (e *encoder, err error) { re, err := newRangeEncoder(bw) if err != nil { return nil, err } e = &encoder{ dict: dict, state: state, re: re, marker: flags&eosMarker != 0, start: dict.Pos(), margin: opLenMargin, } if e.marker { e.margin += 5 } return e, nil } // Write writes the bytes from p into the dictionary. If not enough // space is available the data in the dictionary buffer will be // compressed to make additional space available. If the limit of the // underlying writer has been reached ErrLimit will be returned. func (e *encoder) Write(p []byte) (n int, err error) { for { k, err := e.dict.Write(p[n:]) n += k if err == ErrNoSpace { if err = e.compress(0); err != nil { return n, err } continue } return n, err } } // Reopen reopens the encoder with a new byte writer. func (e *encoder) Reopen(bw io.ByteWriter) error { var err error if e.re, err = newRangeEncoder(bw); err != nil { return err } e.start = e.dict.Pos() e.limit = false return nil } // writeLiteral writes a literal into the LZMA stream func (e *encoder) writeLiteral(l lit) error { var err error state, state2, _ := e.state.states(e.dict.Pos()) if err = e.state.isMatch[state2].Encode(e.re, 0); err != nil { return err } litState := e.state.litState(e.dict.ByteAt(1), e.dict.Pos()) match := e.dict.ByteAt(int(e.state.rep[0]) + 1) err = e.state.litCodec.Encode(e.re, l.b, state, match, litState) if err != nil { return err } e.state.updateStateLiteral() return nil } // iverson implements the Iverson operator as proposed by Donald Knuth in his // book Concrete Mathematics. func iverson(ok bool) uint32 { if ok { return 1 } return 0 } // writeMatch writes a repetition operation into the operation stream func (e *encoder) writeMatch(m match) error { var err error if !(minDistance <= m.distance && m.distance <= maxDistance) { panic(fmt.Errorf("match distance %d out of range", m.distance)) } dist := uint32(m.distance - minDistance) if !(minMatchLen <= m.n && m.n <= maxMatchLen) && !(dist == e.state.rep[0] && m.n == 1) { panic(fmt.Errorf( "match length %d out of range; dist %d rep[0] %d", m.n, dist, e.state.rep[0])) } state, state2, posState := e.state.states(e.dict.Pos()) if err = e.state.isMatch[state2].Encode(e.re, 1); err != nil { return err } g := 0 for ; g < 4; g++ { if e.state.rep[g] == dist { break } } b := iverson(g < 4) if err = e.state.isRep[state].Encode(e.re, b); err != nil { return err } n := uint32(m.n - minMatchLen) if b == 0 { // simple match e.state.rep[3], e.state.rep[2], e.state.rep[1], e.state.rep[0] = e.state.rep[2], e.state.rep[1], e.state.rep[0], dist e.state.updateStateMatch() if err = e.state.lenCodec.Encode(e.re, n, posState); err != nil { return err } return e.state.distCodec.Encode(e.re, dist, n) } b = iverson(g != 0) if err = e.state.isRepG0[state].Encode(e.re, b); err != nil { return err } if b == 0 { // g == 0 b = iverson(m.n != 1) if err = e.state.isRepG0Long[state2].Encode(e.re, b); err != nil { return err } if b == 0 { e.state.updateStateShortRep() return nil } } else { // g in {1,2,3} b = iverson(g != 1) if err = e.state.isRepG1[state].Encode(e.re, b); err != nil { return err } if b == 1 { // g in {2,3} b = iverson(g != 2) err = e.state.isRepG2[state].Encode(e.re, b) if err != nil { return err } if b == 1 { e.state.rep[3] = e.state.rep[2] } e.state.rep[2] = e.state.rep[1] } e.state.rep[1] = e.state.rep[0] e.state.rep[0] = dist } e.state.updateStateRep() return e.state.repLenCodec.Encode(e.re, n, posState) } // writeOp writes a single operation to the range encoder. The function // checks whether there is enough space available to close the LZMA // stream. func (e *encoder) writeOp(op operation) error { if e.re.Available() < int64(e.margin) { return ErrLimit } switch x := op.(type) { case lit: return e.writeLiteral(x) case match: return e.writeMatch(x) default: panic("unexpected operation") } } // compress compressed data from the dictionary buffer. If the flag all // is set, all data in the dictionary buffer will be compressed. The // function returns ErrLimit if the underlying writer has reached its // limit. func (e *encoder) compress(flags compressFlags) error { n := 0 if flags&all == 0 { n = maxMatchLen - 1 } d := e.dict m := d.m for d.Buffered() > n { op := m.NextOp(e.state.rep) if err := e.writeOp(op); err != nil { return err } d.Discard(op.Len()) } return nil } // eosMatch is a pseudo operation that indicates the end of the stream. var eosMatch = match{distance: maxDistance, n: minMatchLen} // Close terminates the LZMA stream. If requested the end-of-stream // marker will be written. If the byte writer limit has been or will be // reached during compression of the remaining data in the buffer the // LZMA stream will be closed and data will remain in the buffer. func (e *encoder) Close() error { err := e.compress(all) if err != nil && err != ErrLimit { return err } if e.marker { if err := e.writeMatch(eosMatch); err != nil { return err } } err = e.re.Close() return err } // Compressed returns the number bytes of the input data that been // compressed. func (e *encoder) Compressed() int64 { return e.dict.Pos() - e.start } ================================================ FILE: vendor/github.com/ulikunitz/xz/lzma/encoderdict.go ================================================ // Copyright 2014-2022 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package lzma import ( "errors" "fmt" "io" ) // matcher is an interface that supports the identification of the next // operation. type matcher interface { io.Writer SetDict(d *encoderDict) NextOp(rep [4]uint32) operation } // encoderDict provides the dictionary of the encoder. It includes an // additional buffer atop of the actual dictionary. type encoderDict struct { buf buffer m matcher head int64 capacity int // preallocated array data [maxMatchLen]byte } // newEncoderDict creates the encoder dictionary. The argument bufSize // defines the size of the additional buffer. func newEncoderDict(dictCap, bufSize int, m matcher) (d *encoderDict, err error) { if !(1 <= dictCap && int64(dictCap) <= MaxDictCap) { return nil, errors.New( "lzma: dictionary capacity out of range") } if bufSize < 1 { return nil, errors.New( "lzma: buffer size must be larger than zero") } d = &encoderDict{ buf: *newBuffer(dictCap + bufSize), capacity: dictCap, m: m, } m.SetDict(d) return d, nil } // Discard discards n bytes. Note that n must not be larger than // MaxMatchLen. func (d *encoderDict) Discard(n int) { p := d.data[:n] k, _ := d.buf.Read(p) if k < n { panic(fmt.Errorf("lzma: can't discard %d bytes", n)) } d.head += int64(n) d.m.Write(p) } // Len returns the data available in the encoder dictionary. func (d *encoderDict) Len() int { n := d.buf.Available() if int64(n) > d.head { return int(d.head) } return n } // DictLen returns the actual length of data in the dictionary. func (d *encoderDict) DictLen() int { if d.head < int64(d.capacity) { return int(d.head) } return d.capacity } // Available returns the number of bytes that can be written by a // following Write call. func (d *encoderDict) Available() int { return d.buf.Available() - d.DictLen() } // Write writes data into the dictionary buffer. Note that the position // of the dictionary head will not be moved. If there is not enough // space in the buffer ErrNoSpace will be returned. func (d *encoderDict) Write(p []byte) (n int, err error) { m := d.Available() if len(p) > m { p = p[:m] err = ErrNoSpace } var e error if n, e = d.buf.Write(p); e != nil { err = e } return n, err } // Pos returns the position of the head. func (d *encoderDict) Pos() int64 { return d.head } // ByteAt returns the byte at the given distance. func (d *encoderDict) ByteAt(distance int) byte { if !(0 < distance && distance <= d.Len()) { return 0 } i := d.buf.rear - distance if i < 0 { i += len(d.buf.data) } return d.buf.data[i] } // CopyN copies the last n bytes from the dictionary into the provided // writer. This is used for copying uncompressed data into an // uncompressed segment. func (d *encoderDict) CopyN(w io.Writer, n int) (written int, err error) { if n <= 0 { return 0, nil } m := d.Len() if n > m { n = m err = ErrNoSpace } i := d.buf.rear - n var e error if i < 0 { i += len(d.buf.data) if written, e = w.Write(d.buf.data[i:]); e != nil { return written, e } i = 0 } var k int k, e = w.Write(d.buf.data[i:d.buf.rear]) written += k if e != nil { err = e } return written, err } // Buffered returns the number of bytes in the buffer. func (d *encoderDict) Buffered() int { return d.buf.Buffered() } ================================================ FILE: vendor/github.com/ulikunitz/xz/lzma/hashtable.go ================================================ // Copyright 2014-2022 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package lzma import ( "errors" "fmt" "github.com/ulikunitz/xz/internal/hash" ) /* For compression we need to find byte sequences that match the byte * sequence at the dictionary head. A hash table is a simple method to * provide this capability. */ // maxMatches limits the number of matches requested from the Matches // function. This controls the speed of the overall encoding. const maxMatches = 16 // shortDists defines the number of short distances supported by the // implementation. const shortDists = 8 // The minimum is somehow arbitrary but the maximum is limited by the // memory requirements of the hash table. const ( minTableExponent = 9 maxTableExponent = 20 ) // newRoller contains the function used to create an instance of the // hash.Roller. var newRoller = func(n int) hash.Roller { return hash.NewCyclicPoly(n) } // hashTable stores the hash table including the rolling hash method. // // We implement chained hashing into a circular buffer. Each entry in // the circular buffer stores the delta distance to the next position with a // word that has the same hash value. type hashTable struct { dict *encoderDict // actual hash table t []int64 // circular list data with the offset to the next word data []uint32 front int // mask for computing the index for the hash table mask uint64 // hash offset; initial value is -int64(wordLen) hoff int64 // length of the hashed word wordLen int // hash roller for computing the hash values for the Write // method wr hash.Roller // hash roller for computing arbitrary hashes hr hash.Roller // preallocated slices p [maxMatches]int64 distances [maxMatches + shortDists]int } // hashTableExponent derives the hash table exponent from the dictionary // capacity. func hashTableExponent(n uint32) int { e := 30 - nlz32(n) switch { case e < minTableExponent: e = minTableExponent case e > maxTableExponent: e = maxTableExponent } return e } // newHashTable creates a new hash table for words of length wordLen func newHashTable(capacity int, wordLen int) (t *hashTable, err error) { if !(0 < capacity) { return nil, errors.New( "newHashTable: capacity must not be negative") } exp := hashTableExponent(uint32(capacity)) if !(1 <= wordLen && wordLen <= 4) { return nil, errors.New("newHashTable: " + "argument wordLen out of range") } n := 1 << uint(exp) if n <= 0 { panic("newHashTable: exponent is too large") } t = &hashTable{ t: make([]int64, n), data: make([]uint32, capacity), mask: (uint64(1) << uint(exp)) - 1, hoff: -int64(wordLen), wordLen: wordLen, wr: newRoller(wordLen), hr: newRoller(wordLen), } return t, nil } func (t *hashTable) SetDict(d *encoderDict) { t.dict = d } // buffered returns the number of bytes that are currently hashed. func (t *hashTable) buffered() int { n := t.hoff + 1 switch { case n <= 0: return 0 case n >= int64(len(t.data)): return len(t.data) } return int(n) } // addIndex adds n to an index ensuring that is stays inside the // circular buffer for the hash chain. func (t *hashTable) addIndex(i, n int) int { i += n - len(t.data) if i < 0 { i += len(t.data) } return i } // putDelta puts the delta instance at the current front of the circular // chain buffer. func (t *hashTable) putDelta(delta uint32) { t.data[t.front] = delta t.front = t.addIndex(t.front, 1) } // putEntry puts a new entry into the hash table. If there is already a // value stored it is moved into the circular chain buffer. func (t *hashTable) putEntry(h uint64, pos int64) { if pos < 0 { return } i := h & t.mask old := t.t[i] - 1 t.t[i] = pos + 1 var delta int64 if old >= 0 { delta = pos - old if delta > 1<<32-1 || delta > int64(t.buffered()) { delta = 0 } } t.putDelta(uint32(delta)) } // WriteByte converts a single byte into a hash and puts them into the hash // table. func (t *hashTable) WriteByte(b byte) error { h := t.wr.RollByte(b) t.hoff++ t.putEntry(h, t.hoff) return nil } // Write converts the bytes provided into hash tables and stores the // abbreviated offsets into the hash table. The method will never return an // error. func (t *hashTable) Write(p []byte) (n int, err error) { for _, b := range p { // WriteByte doesn't generate an error. t.WriteByte(b) } return len(p), nil } // getMatches the matches for a specific hash. The functions returns the // number of positions found. // // TODO: Make a getDistances because that we are actually interested in. func (t *hashTable) getMatches(h uint64, positions []int64) (n int) { if t.hoff < 0 || len(positions) == 0 { return 0 } buffered := t.buffered() tailPos := t.hoff + 1 - int64(buffered) rear := t.front - buffered if rear >= 0 { rear -= len(t.data) } // get the slot for the hash pos := t.t[h&t.mask] - 1 delta := pos - tailPos for { if delta < 0 { return n } positions[n] = tailPos + delta n++ if n >= len(positions) { return n } i := rear + int(delta) if i < 0 { i += len(t.data) } u := t.data[i] if u == 0 { return n } delta -= int64(u) } } // hash computes the rolling hash for the word stored in p. For correct // results its length must be equal to t.wordLen. func (t *hashTable) hash(p []byte) uint64 { var h uint64 for _, b := range p { h = t.hr.RollByte(b) } return h } // Matches fills the positions slice with potential matches. The // functions returns the number of positions filled into positions. The // byte slice p must have word length of the hash table. func (t *hashTable) Matches(p []byte, positions []int64) int { if len(p) != t.wordLen { panic(fmt.Errorf( "byte slice must have length %d", t.wordLen)) } h := t.hash(p) return t.getMatches(h, positions) } // NextOp identifies the next operation using the hash table. // // TODO: Use all repetitions to find matches. func (t *hashTable) NextOp(rep [4]uint32) operation { // get positions data := t.dict.data[:maxMatchLen] n, _ := t.dict.buf.Peek(data) data = data[:n] var p []int64 if n < t.wordLen { p = t.p[:0] } else { p = t.p[:maxMatches] n = t.Matches(data[:t.wordLen], p) p = p[:n] } // convert positions in potential distances head := t.dict.head dists := append(t.distances[:0], 1, 2, 3, 4, 5, 6, 7, 8) for _, pos := range p { dis := int(head - pos) if dis > shortDists { dists = append(dists, dis) } } // check distances var m match dictLen := t.dict.DictLen() for _, dist := range dists { if dist > dictLen { continue } // Here comes a trick. We are only interested in matches // that are longer than the matches we have been found // before. So before we test the whole byte sequence at // the given distance, we test the first byte that would // make the match longer. If it doesn't match the byte // to match, we don't to care any longer. i := t.dict.buf.rear - dist + m.n if i < 0 { i += len(t.dict.buf.data) } if t.dict.buf.data[i] != data[m.n] { // We can't get a longer match. Jump to the next // distance. continue } n := t.dict.buf.matchLen(dist, data) switch n { case 0: continue case 1: if uint32(dist-minDistance) != rep[0] { continue } } if n > m.n { m = match{int64(dist), n} if n == len(data) { // No better match will be found. break } } } if m.n == 0 { return lit{data[0]} } return m } ================================================ FILE: vendor/github.com/ulikunitz/xz/lzma/header.go ================================================ // Copyright 2014-2022 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package lzma import ( "errors" "fmt" ) // uint32LE reads an uint32 integer from a byte slice func uint32LE(b []byte) uint32 { x := uint32(b[3]) << 24 x |= uint32(b[2]) << 16 x |= uint32(b[1]) << 8 x |= uint32(b[0]) return x } // uint64LE converts the uint64 value stored as little endian to an uint64 // value. func uint64LE(b []byte) uint64 { x := uint64(b[7]) << 56 x |= uint64(b[6]) << 48 x |= uint64(b[5]) << 40 x |= uint64(b[4]) << 32 x |= uint64(b[3]) << 24 x |= uint64(b[2]) << 16 x |= uint64(b[1]) << 8 x |= uint64(b[0]) return x } // putUint32LE puts an uint32 integer into a byte slice that must have at least // a length of 4 bytes. func putUint32LE(b []byte, x uint32) { b[0] = byte(x) b[1] = byte(x >> 8) b[2] = byte(x >> 16) b[3] = byte(x >> 24) } // putUint64LE puts the uint64 value into the byte slice as little endian // value. The byte slice b must have at least place for 8 bytes. func putUint64LE(b []byte, x uint64) { b[0] = byte(x) b[1] = byte(x >> 8) b[2] = byte(x >> 16) b[3] = byte(x >> 24) b[4] = byte(x >> 32) b[5] = byte(x >> 40) b[6] = byte(x >> 48) b[7] = byte(x >> 56) } // noHeaderSize defines the value of the length field in the LZMA header. const noHeaderSize uint64 = 1<<64 - 1 // HeaderLen provides the length of the LZMA file header. const HeaderLen = 13 // Header represents the Header of an LZMA file. type Header struct { Properties Properties DictSize uint32 // uncompressed Size; negative value if no Size is given Size int64 } // marshalBinary marshals the header. func (h *Header) marshalBinary() (data []byte, err error) { if err = h.Properties.verify(); err != nil { return nil, err } if !(h.DictSize <= MaxDictCap) { return nil, fmt.Errorf("lzma: DictCap %d out of range", h.DictSize) } data = make([]byte, 13) // property byte data[0] = h.Properties.Code() // dictionary capacity putUint32LE(data[1:5], uint32(h.DictSize)) // uncompressed size var s uint64 if h.Size > 0 { s = uint64(h.Size) } else { s = noHeaderSize } putUint64LE(data[5:], s) return data, nil } // unmarshalBinary unmarshals the header. func (h *Header) unmarshalBinary(data []byte) error { if len(data) != HeaderLen { return errors.New("lzma.unmarshalBinary: data has wrong length") } // properties var err error if h.Properties, err = PropertiesForCode(data[0]); err != nil { return err } // dictionary capacity h.DictSize = uint32LE(data[1:]) if int(h.DictSize) < 0 { return errors.New( "LZMA header: dictionary capacity exceeds maximum " + "integer") } // uncompressed size s := uint64LE(data[5:]) if s == noHeaderSize { h.Size = -1 } else { h.Size = int64(s) if h.Size < 0 { return errors.New( "LZMA header: uncompressed size " + "out of int64 range") } } return nil } // validDictSize checks whether the dictionary capacity is correct. This // is used to weed out wrong file headers. func validDictSize(dictcap int) bool { if int64(dictcap) == MaxDictCap { return true } for n := uint(10); n < 32; n++ { if dictcap == 1<= 10 or 2^32-1. If // there is an explicit size it must not exceed 256 GiB. The length of // the data argument must be HeaderLen. // // This function should be disregarded because there is no guarantee that LZMA // files follow the constraints. func ValidHeader(data []byte) bool { var h Header if err := h.unmarshalBinary(data); err != nil { return false } if !validDictSize(int(h.DictSize)) { return false } return h.Size < 0 || h.Size <= 1<<38 } ================================================ FILE: vendor/github.com/ulikunitz/xz/lzma/header2.go ================================================ // Copyright 2014-2022 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package lzma import ( "errors" "fmt" "io" ) const ( // maximum size of compressed data in a chunk maxCompressed = 1 << 16 // maximum size of uncompressed data in a chunk maxUncompressed = 1 << 21 ) // chunkType represents the type of an LZMA2 chunk. Note that this // value is an internal representation and no actual encoding of a LZMA2 // chunk header. type chunkType byte // Possible values for the chunk type. const ( // end of stream cEOS chunkType = iota // uncompressed; reset dictionary cUD // uncompressed; no reset of dictionary cU // LZMA compressed; no reset cL // LZMA compressed; reset state cLR // LZMA compressed; reset state; new property value cLRN // LZMA compressed; reset state; new property value; reset dictionary cLRND ) // chunkTypeStrings provide a string representation for the chunk types. var chunkTypeStrings = [...]string{ cEOS: "EOS", cU: "U", cUD: "UD", cL: "L", cLR: "LR", cLRN: "LRN", cLRND: "LRND", } // String returns a string representation of the chunk type. func (c chunkType) String() string { if !(cEOS <= c && c <= cLRND) { return "unknown" } return chunkTypeStrings[c] } // Actual encodings for the chunk types in the value. Note that the high // uncompressed size bits are stored in the header byte additionally. const ( hEOS = 0 hUD = 1 hU = 2 hL = 1 << 7 hLR = 1<<7 | 1<<5 hLRN = 1<<7 | 1<<6 hLRND = 1<<7 | 1<<6 | 1<<5 ) // errHeaderByte indicates an unsupported value for the chunk header // byte. These bytes starts the variable-length chunk header. var errHeaderByte = errors.New("lzma: unsupported chunk header byte") // headerChunkType converts the header byte into a chunk type. It // ignores the uncompressed size bits in the chunk header byte. func headerChunkType(h byte) (c chunkType, err error) { if h&hL == 0 { // no compression switch h { case hEOS: c = cEOS case hUD: c = cUD case hU: c = cU default: return 0, errHeaderByte } return } switch h & hLRND { case hL: c = cL case hLR: c = cLR case hLRN: c = cLRN case hLRND: c = cLRND default: return 0, errHeaderByte } return } // uncompressedHeaderLen provides the length of an uncompressed header const uncompressedHeaderLen = 3 // headerLen returns the length of the LZMA2 header for a given chunk // type. func headerLen(c chunkType) int { switch c { case cEOS: return 1 case cU, cUD: return uncompressedHeaderLen case cL, cLR: return 5 case cLRN, cLRND: return 6 } panic(fmt.Errorf("unsupported chunk type %d", c)) } // chunkHeader represents the contents of a chunk header. type chunkHeader struct { ctype chunkType uncompressed uint32 compressed uint16 props Properties } // String returns a string representation of the chunk header. func (h *chunkHeader) String() string { return fmt.Sprintf("%s %d %d %s", h.ctype, h.uncompressed, h.compressed, &h.props) } // UnmarshalBinary reads the content of the chunk header from the data // slice. The slice must have the correct length. func (h *chunkHeader) UnmarshalBinary(data []byte) error { if len(data) == 0 { return errors.New("no data") } c, err := headerChunkType(data[0]) if err != nil { return err } n := headerLen(c) if len(data) < n { return errors.New("incomplete data") } if len(data) > n { return errors.New("invalid data length") } *h = chunkHeader{ctype: c} if c == cEOS { return nil } h.uncompressed = uint32(uint16BE(data[1:3])) if c <= cU { return nil } h.uncompressed |= uint32(data[0]&^hLRND) << 16 h.compressed = uint16BE(data[3:5]) if c <= cLR { return nil } h.props, err = PropertiesForCode(data[5]) return err } // MarshalBinary encodes the chunk header value. The function checks // whether the content of the chunk header is correct. func (h *chunkHeader) MarshalBinary() (data []byte, err error) { if h.ctype > cLRND { return nil, errors.New("invalid chunk type") } if err = h.props.verify(); err != nil { return nil, err } data = make([]byte, headerLen(h.ctype)) switch h.ctype { case cEOS: return data, nil case cUD: data[0] = hUD case cU: data[0] = hU case cL: data[0] = hL case cLR: data[0] = hLR case cLRN: data[0] = hLRN case cLRND: data[0] = hLRND } putUint16BE(data[1:3], uint16(h.uncompressed)) if h.ctype <= cU { return data, nil } data[0] |= byte(h.uncompressed>>16) &^ hLRND putUint16BE(data[3:5], h.compressed) if h.ctype <= cLR { return data, nil } data[5] = h.props.Code() return data, nil } // readChunkHeader reads the chunk header from the IO reader. func readChunkHeader(r io.Reader) (h *chunkHeader, err error) { p := make([]byte, 1, 6) if _, err = io.ReadFull(r, p); err != nil { return } c, err := headerChunkType(p[0]) if err != nil { return } p = p[:headerLen(c)] if _, err = io.ReadFull(r, p[1:]); err != nil { return } h = new(chunkHeader) if err = h.UnmarshalBinary(p); err != nil { return nil, err } return h, nil } // uint16BE converts a big-endian uint16 representation to an uint16 // value. func uint16BE(p []byte) uint16 { return uint16(p[0])<<8 | uint16(p[1]) } // putUint16BE puts the big-endian uint16 presentation into the given // slice. func putUint16BE(p []byte, x uint16) { p[0] = byte(x >> 8) p[1] = byte(x) } // chunkState is used to manage the state of the chunks type chunkState byte // start and stop define the initial and terminating state of the chunk // state const ( start chunkState = 'S' stop chunkState = 'T' ) // errors for the chunk state handling var ( errChunkType = errors.New("lzma: unexpected chunk type") errState = errors.New("lzma: wrong chunk state") ) // next transitions state based on chunk type input func (c *chunkState) next(ctype chunkType) error { switch *c { // start state case 'S': switch ctype { case cEOS: *c = 'T' case cUD: *c = 'R' case cLRND: *c = 'L' default: return errChunkType } // normal LZMA mode case 'L': switch ctype { case cEOS: *c = 'T' case cUD: *c = 'R' case cU: *c = 'U' case cL, cLR, cLRN, cLRND: break default: return errChunkType } // reset required case 'R': switch ctype { case cEOS: *c = 'T' case cUD, cU: break case cLRN, cLRND: *c = 'L' default: return errChunkType } // uncompressed case 'U': switch ctype { case cEOS: *c = 'T' case cUD: *c = 'R' case cU: break case cL, cLR, cLRN, cLRND: *c = 'L' default: return errChunkType } // terminal state case 'T': return errChunkType default: return errState } return nil } // defaultChunkType returns the default chunk type for each chunk state. func (c chunkState) defaultChunkType() chunkType { switch c { case 'S': return cLRND case 'L', 'U': return cL case 'R': return cLRN default: // no error return cEOS } } // maxDictCap defines the maximum dictionary capacity supported by the // LZMA2 dictionary capacity encoding. const maxDictCap = 1<<32 - 1 // maxDictCapCode defines the maximum dictionary capacity code. const maxDictCapCode = 40 // The function decodes the dictionary capacity byte, but doesn't change // for the correct range of the given byte. func decodeDictCap(c byte) int64 { return (2 | int64(c)&1) << (11 + (c>>1)&0x1f) } // DecodeDictCap decodes the encoded dictionary capacity. The function // returns an error if the code is out of range. func DecodeDictCap(c byte) (n int64, err error) { if c >= maxDictCapCode { if c == maxDictCapCode { return maxDictCap, nil } return 0, errors.New("lzma: invalid dictionary size code") } return decodeDictCap(c), nil } // EncodeDictCap encodes a dictionary capacity. The function returns the // code for the capacity that is greater or equal n. If n exceeds the // maximum support dictionary capacity, the maximum value is returned. func EncodeDictCap(n int64) byte { a, b := byte(0), byte(40) for a < b { c := a + (b-a)>>1 m := decodeDictCap(c) if n <= m { if n == m { return c } b = c } else { a = c + 1 } } return a } ================================================ FILE: vendor/github.com/ulikunitz/xz/lzma/lengthcodec.go ================================================ // Copyright 2014-2022 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package lzma import "errors" // maxPosBits defines the number of bits of the position value that are used to // to compute the posState value. The value is used to select the tree codec // for length encoding and decoding. const maxPosBits = 4 // minMatchLen and maxMatchLen give the minimum and maximum values for // encoding and decoding length values. minMatchLen is also used as base // for the encoded length values. const ( minMatchLen = 2 maxMatchLen = minMatchLen + 16 + 256 - 1 ) // lengthCodec support the encoding of the length value. type lengthCodec struct { choice [2]prob low [1 << maxPosBits]treeCodec mid [1 << maxPosBits]treeCodec high treeCodec } // deepcopy initializes the lc value as deep copy of the source value. func (lc *lengthCodec) deepcopy(src *lengthCodec) { if lc == src { return } lc.choice = src.choice for i := range lc.low { lc.low[i].deepcopy(&src.low[i]) } for i := range lc.mid { lc.mid[i].deepcopy(&src.mid[i]) } lc.high.deepcopy(&src.high) } // init initializes a new length codec. func (lc *lengthCodec) init() { for i := range lc.choice { lc.choice[i] = probInit } for i := range lc.low { lc.low[i] = makeTreeCodec(3) } for i := range lc.mid { lc.mid[i] = makeTreeCodec(3) } lc.high = makeTreeCodec(8) } // Encode encodes the length offset. The length offset l can be compute by // subtracting minMatchLen (2) from the actual length. // // l = length - minMatchLen func (lc *lengthCodec) Encode(e *rangeEncoder, l uint32, posState uint32, ) (err error) { if l > maxMatchLen-minMatchLen { return errors.New("lengthCodec.Encode: l out of range") } if l < 8 { if err = lc.choice[0].Encode(e, 0); err != nil { return } return lc.low[posState].Encode(e, l) } if err = lc.choice[0].Encode(e, 1); err != nil { return } if l < 16 { if err = lc.choice[1].Encode(e, 0); err != nil { return } return lc.mid[posState].Encode(e, l-8) } if err = lc.choice[1].Encode(e, 1); err != nil { return } if err = lc.high.Encode(e, l-16); err != nil { return } return nil } // Decode reads the length offset. Add minMatchLen to compute the actual length // to the length offset l. func (lc *lengthCodec) Decode(d *rangeDecoder, posState uint32, ) (l uint32, err error) { var b uint32 if b, err = lc.choice[0].Decode(d); err != nil { return } if b == 0 { l, err = lc.low[posState].Decode(d) return } if b, err = lc.choice[1].Decode(d); err != nil { return } if b == 0 { l, err = lc.mid[posState].Decode(d) l += 8 return } l, err = lc.high.Decode(d) l += 16 return } ================================================ FILE: vendor/github.com/ulikunitz/xz/lzma/literalcodec.go ================================================ // Copyright 2014-2022 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package lzma // literalCodec supports the encoding of literal. It provides 768 probability // values per literal state. The upper 512 probabilities are used with the // context of a match bit. type literalCodec struct { probs []prob } // deepcopy initializes literal codec c as a deep copy of the source. func (c *literalCodec) deepcopy(src *literalCodec) { if c == src { return } c.probs = make([]prob, len(src.probs)) copy(c.probs, src.probs) } // init initializes the literal codec. func (c *literalCodec) init(lc, lp int) { switch { case !(minLC <= lc && lc <= maxLC): panic("lc out of range") case !(minLP <= lp && lp <= maxLP): panic("lp out of range") } c.probs = make([]prob, 0x300<= 7 { m := uint32(match) for { matchBit := (m >> 7) & 1 m <<= 1 bit := (r >> 7) & 1 r <<= 1 i := ((1 + matchBit) << 8) | symbol if err = probs[i].Encode(e, bit); err != nil { return } symbol = (symbol << 1) | bit if matchBit != bit { break } if symbol >= 0x100 { break } } } for symbol < 0x100 { bit := (r >> 7) & 1 r <<= 1 if err = probs[symbol].Encode(e, bit); err != nil { return } symbol = (symbol << 1) | bit } return nil } // Decode decodes a literal byte using the range decoder as well as the LZMA // state, a match byte, and the literal state. func (c *literalCodec) Decode(d *rangeDecoder, state uint32, match byte, litState uint32, ) (s byte, err error) { k := litState * 0x300 probs := c.probs[k : k+0x300] symbol := uint32(1) if state >= 7 { m := uint32(match) for { matchBit := (m >> 7) & 1 m <<= 1 i := ((1 + matchBit) << 8) | symbol bit, err := d.DecodeBit(&probs[i]) if err != nil { return 0, err } symbol = (symbol << 1) | bit if matchBit != bit { break } if symbol >= 0x100 { break } } } for symbol < 0x100 { bit, err := d.DecodeBit(&probs[symbol]) if err != nil { return 0, err } symbol = (symbol << 1) | bit } s = byte(symbol - 0x100) return s, nil } // minLC and maxLC define the range for LC values. const ( minLC = 0 maxLC = 8 ) // minLC and maxLC define the range for LP values. const ( minLP = 0 maxLP = 4 ) ================================================ FILE: vendor/github.com/ulikunitz/xz/lzma/matchalgorithm.go ================================================ // Copyright 2014-2022 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package lzma import "errors" // MatchAlgorithm identifies an algorithm to find matches in the // dictionary. type MatchAlgorithm byte // Supported matcher algorithms. const ( HashTable4 MatchAlgorithm = iota BinaryTree ) // maStrings are used by the String method. var maStrings = map[MatchAlgorithm]string{ HashTable4: "HashTable4", BinaryTree: "BinaryTree", } // String returns a string representation of the Matcher. func (a MatchAlgorithm) String() string { if s, ok := maStrings[a]; ok { return s } return "unknown" } var errUnsupportedMatchAlgorithm = errors.New( "lzma: unsupported match algorithm value") // verify checks whether the matcher value is supported. func (a MatchAlgorithm) verify() error { if _, ok := maStrings[a]; !ok { return errUnsupportedMatchAlgorithm } return nil } func (a MatchAlgorithm) new(dictCap int) (m matcher, err error) { switch a { case HashTable4: return newHashTable(dictCap, 4) case BinaryTree: return newBinTree(dictCap) } return nil, errUnsupportedMatchAlgorithm } ================================================ FILE: vendor/github.com/ulikunitz/xz/lzma/operation.go ================================================ // Copyright 2014-2022 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package lzma import ( "fmt" "unicode" ) // operation represents an operation on the dictionary during encoding or // decoding. type operation interface { Len() int } // rep represents a repetition at the given distance and the given length type match struct { // supports all possible distance values, including the eos marker distance int64 // length n int } // Len returns the number of bytes matched. func (m match) Len() int { return m.n } // String returns a string representation for the repetition. func (m match) String() string { return fmt.Sprintf("M{%d,%d}", m.distance, m.n) } // lit represents a single byte literal. type lit struct { b byte } // Len returns 1 for the single byte literal. func (l lit) Len() int { return 1 } // String returns a string representation for the literal. func (l lit) String() string { var c byte if unicode.IsPrint(rune(l.b)) { c = l.b } else { c = '.' } return fmt.Sprintf("L{%c/%02x}", c, l.b) } ================================================ FILE: vendor/github.com/ulikunitz/xz/lzma/prob.go ================================================ // Copyright 2014-2022 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package lzma // movebits defines the number of bits used for the updates of probability // values. const movebits = 5 // probbits defines the number of bits of a probability value. const probbits = 11 // probInit defines 0.5 as initial value for prob values. const probInit prob = 1 << (probbits - 1) // Type prob represents probabilities. The type can also be used to encode and // decode single bits. type prob uint16 // Dec decreases the probability. The decrease is proportional to the // probability value. func (p *prob) dec() { *p -= *p >> movebits } // Inc increases the probability. The Increase is proportional to the // difference of 1 and the probability value. func (p *prob) inc() { *p += ((1 << probbits) - *p) >> movebits } // Computes the new bound for a given range using the probability value. func (p prob) bound(r uint32) uint32 { return (r >> probbits) * uint32(p) } // Bits returns 1. One is the number of bits that can be encoded or decoded // with a single prob value. func (p prob) Bits() int { return 1 } // Encode encodes the least-significant bit of v. Note that the p value will be // changed. func (p *prob) Encode(e *rangeEncoder, v uint32) error { return e.EncodeBit(v, p) } // Decode decodes a single bit. Note that the p value will change. func (p *prob) Decode(d *rangeDecoder) (v uint32, err error) { return d.DecodeBit(p) } ================================================ FILE: vendor/github.com/ulikunitz/xz/lzma/properties.go ================================================ // Copyright 2014-2022 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package lzma import ( "errors" "fmt" ) // maximum and minimum values for the LZMA properties. const ( minPB = 0 maxPB = 4 ) // maxPropertyCode is the possible maximum of a properties code byte. const maxPropertyCode = (maxPB+1)*(maxLP+1)*(maxLC+1) - 1 // Properties contains the parameters LC, LP and PB. The parameter LC // defines the number of literal context bits; parameter LP the number // of literal position bits and PB the number of position bits. type Properties struct { LC int LP int PB int } // String returns the properties in a string representation. func (p *Properties) String() string { return fmt.Sprintf("LC %d LP %d PB %d", p.LC, p.LP, p.PB) } // PropertiesForCode converts a properties code byte into a Properties value. func PropertiesForCode(code byte) (p Properties, err error) { if code > maxPropertyCode { return p, errors.New("lzma: invalid properties code") } p.LC = int(code % 9) code /= 9 p.LP = int(code % 5) code /= 5 p.PB = int(code % 5) return p, err } // verify checks the properties for correctness. func (p *Properties) verify() error { if p == nil { return errors.New("lzma: properties are nil") } if !(minLC <= p.LC && p.LC <= maxLC) { return errors.New("lzma: lc out of range") } if !(minLP <= p.LP && p.LP <= maxLP) { return errors.New("lzma: lp out of range") } if !(minPB <= p.PB && p.PB <= maxPB) { return errors.New("lzma: pb out of range") } return nil } // Code converts the properties to a byte. The function assumes that // the properties components are all in range. func (p Properties) Code() byte { return byte((p.PB*5+p.LP)*9 + p.LC) } ================================================ FILE: vendor/github.com/ulikunitz/xz/lzma/rangecodec.go ================================================ // Copyright 2014-2022 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package lzma import ( "errors" "io" ) // rangeEncoder implements range encoding of single bits. The low value can // overflow therefore we need uint64. The cache value is used to handle // overflows. type rangeEncoder struct { lbw *LimitedByteWriter nrange uint32 low uint64 cacheLen int64 cache byte } // maxInt64 provides the maximal value of the int64 type const maxInt64 = 1<<63 - 1 // newRangeEncoder creates a new range encoder. func newRangeEncoder(bw io.ByteWriter) (re *rangeEncoder, err error) { lbw, ok := bw.(*LimitedByteWriter) if !ok { lbw = &LimitedByteWriter{BW: bw, N: maxInt64} } return &rangeEncoder{ lbw: lbw, nrange: 0xffffffff, cacheLen: 1}, nil } // Available returns the number of bytes that still can be written. The // method takes the bytes that will be currently written by Close into // account. func (e *rangeEncoder) Available() int64 { return e.lbw.N - (e.cacheLen + 4) } // writeByte writes a single byte to the underlying writer. An error is // returned if the limit is reached. The written byte will be counted if // the underlying writer doesn't return an error. func (e *rangeEncoder) writeByte(c byte) error { if e.Available() < 1 { return ErrLimit } return e.lbw.WriteByte(c) } // DirectEncodeBit encodes the least-significant bit of b with probability 1/2. func (e *rangeEncoder) DirectEncodeBit(b uint32) error { e.nrange >>= 1 e.low += uint64(e.nrange) & (0 - (uint64(b) & 1)) // normalize const top = 1 << 24 if e.nrange >= top { return nil } e.nrange <<= 8 return e.shiftLow() } // EncodeBit encodes the least significant bit of b. The p value will be // updated by the function depending on the bit encoded. func (e *rangeEncoder) EncodeBit(b uint32, p *prob) error { bound := p.bound(e.nrange) if b&1 == 0 { e.nrange = bound p.inc() } else { e.low += uint64(bound) e.nrange -= bound p.dec() } // normalize const top = 1 << 24 if e.nrange >= top { return nil } e.nrange <<= 8 return e.shiftLow() } // Close writes a complete copy of the low value. func (e *rangeEncoder) Close() error { for i := 0; i < 5; i++ { if err := e.shiftLow(); err != nil { return err } } return nil } // shiftLow shifts the low value for 8 bit. The shifted byte is written into // the byte writer. The cache value is used to handle overflows. func (e *rangeEncoder) shiftLow() error { if uint32(e.low) < 0xff000000 || (e.low>>32) != 0 { tmp := e.cache for { err := e.writeByte(tmp + byte(e.low>>32)) if err != nil { return err } tmp = 0xff e.cacheLen-- if e.cacheLen <= 0 { if e.cacheLen < 0 { panic("negative cacheLen") } break } } e.cache = byte(uint32(e.low) >> 24) } e.cacheLen++ e.low = uint64(uint32(e.low) << 8) return nil } // rangeDecoder decodes single bits of the range encoding stream. type rangeDecoder struct { br io.ByteReader nrange uint32 code uint32 } // newRangeDecoder initializes a range decoder. It reads five bytes from the // reader and therefore may return an error. func newRangeDecoder(br io.ByteReader) (d *rangeDecoder, err error) { d = &rangeDecoder{br: br, nrange: 0xffffffff} b, err := d.br.ReadByte() if err != nil { return nil, err } if b != 0 { return nil, errors.New("newRangeDecoder: first byte not zero") } for i := 0; i < 4; i++ { if err = d.updateCode(); err != nil { return nil, err } } if d.code >= d.nrange { return nil, errors.New("newRangeDecoder: d.code >= d.nrange") } return d, nil } // possiblyAtEnd checks whether the decoder may be at the end of the stream. func (d *rangeDecoder) possiblyAtEnd() bool { return d.code == 0 } // DirectDecodeBit decodes a bit with probability 1/2. The return value b will // contain the bit at the least-significant position. All other bits will be // zero. func (d *rangeDecoder) DirectDecodeBit() (b uint32, err error) { d.nrange >>= 1 d.code -= d.nrange t := 0 - (d.code >> 31) d.code += d.nrange & t b = (t + 1) & 1 // d.code will stay less then d.nrange // normalize // assume d.code < d.nrange const top = 1 << 24 if d.nrange >= top { return b, nil } d.nrange <<= 8 // d.code < d.nrange will be maintained return b, d.updateCode() } // decodeBit decodes a single bit. The bit will be returned at the // least-significant position. All other bits will be zero. The probability // value will be updated. func (d *rangeDecoder) DecodeBit(p *prob) (b uint32, err error) { bound := p.bound(d.nrange) if d.code < bound { d.nrange = bound p.inc() b = 0 } else { d.code -= bound d.nrange -= bound p.dec() b = 1 } // normalize // assume d.code < d.nrange const top = 1 << 24 if d.nrange >= top { return b, nil } d.nrange <<= 8 // d.code < d.nrange will be maintained return b, d.updateCode() } // updateCode reads a new byte into the code. func (d *rangeDecoder) updateCode() error { b, err := d.br.ReadByte() if err != nil { return err } d.code = (d.code << 8) | uint32(b) return nil } ================================================ FILE: vendor/github.com/ulikunitz/xz/lzma/reader.go ================================================ // Copyright 2014-2022 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package lzma supports the decoding and encoding of LZMA streams. // Reader and Writer support the classic LZMA format. Reader2 and // Writer2 support the decoding and encoding of LZMA2 streams. // // The package is written completely in Go and does not rely on any external // library. package lzma import ( "errors" "fmt" "io" ) // ReaderConfig stores the parameters for the reader of the classic LZMA // format. type ReaderConfig struct { // Since v0.5.14 this parameter sets an upper limit for a .lzma file's // dictionary size. This helps to mitigate problems with mangled // headers. DictCap int } // fill converts the zero values of the configuration to the default values. func (c *ReaderConfig) fill() { if c.DictCap == 0 { // set an upper limit of 2 GiB-1 for dictionary capacity // to address the zero prefix security issue. c.DictCap = (1 << 31) - 1 // original: c.DictCap = 8 * 1024 * 1024 } } // Verify checks the reader configuration for errors. Zero values will // be replaced by default values. func (c *ReaderConfig) Verify() error { c.fill() if !(MinDictCap <= c.DictCap && int64(c.DictCap) <= MaxDictCap) { return errors.New("lzma: dictionary capacity is out of range") } return nil } // Reader provides a reader for LZMA files or streams. // // # Security concerns // // Note that LZMA format doesn't support a magic marker in the header. So // [NewReader] cannot determine whether it reads the actual header. For instance // the LZMA stream might have a zero byte in front of the reader, leading to // larger dictionary sizes and file sizes. The code will detect later that there // are problems with the stream, but the dictionary has already been allocated // and this might consume a lot of memory. // // Version 0.5.14 introduces built-in mitigations: // // - The [ReaderConfig] DictCap field is now interpreted as a limit for the // dictionary size. // - The default is 2 Gigabytes minus 1 byte (2^31-1 bytes). // - Users can check with the [Reader.Header] method what the actual values are in // their LZMA files and set a smaller limit using [ReaderConfig]. // - The dictionary size doesn't exceed the larger of the file size and // the minimum dictionary size. This is another measure to prevent huge // memory allocations for the dictionary. // - The code supports stream sizes only up to a pebibyte (1024^5). type Reader struct { lzma io.Reader header Header // headerOrig stores the original header read from the stream. headerOrig Header d *decoder } // NewReader creates a new reader for an LZMA stream using the classic // format. NewReader reads and checks the header of the LZMA stream. func NewReader(lzma io.Reader) (r *Reader, err error) { return ReaderConfig{}.NewReader(lzma) } // ErrDictSize reports about an error of the dictionary size. type ErrDictSize struct { ConfigDictCap int HeaderDictSize uint32 Message string } // Error returns the error message. func (e *ErrDictSize) Error() string { return e.Message } func newErrDictSize(messageformat string, configDictCap int, headerDictSize uint32, args ...interface{}) *ErrDictSize { newArgs := make([]interface{}, len(args)+2) newArgs[0] = configDictCap newArgs[1] = headerDictSize copy(newArgs[2:], args) return &ErrDictSize{ ConfigDictCap: configDictCap, HeaderDictSize: headerDictSize, Message: fmt.Sprintf(messageformat, newArgs...), } } // We support only files not larger than 1 << 50 bytes (a pebibyte, 1024^5). const maxStreamSize = 1 << 50 // NewReader creates a new reader for an LZMA stream in the classic // format. The function reads and verifies the header of the LZMA // stream. func (c ReaderConfig) NewReader(lzma io.Reader) (r *Reader, err error) { if err = c.Verify(); err != nil { return nil, err } data := make([]byte, HeaderLen) if _, err := io.ReadFull(lzma, data); err != nil { if err == io.EOF { return nil, errors.New("lzma: unexpected EOF") } return nil, err } r = &Reader{lzma: lzma} if err = r.header.unmarshalBinary(data); err != nil { return nil, err } r.headerOrig = r.header dictSize := int64(r.header.DictSize) if int64(c.DictCap) < dictSize { return nil, newErrDictSize( "lzma: header dictionary size %[2]d exceeds configured dictionary capacity %[1]d", c.DictCap, uint32(dictSize), ) } if dictSize < MinDictCap { dictSize = MinDictCap } // original code: disabled this because there is no point in increasing // the dictionary above what is stated in the file. /* if int64(c.DictCap) > int64(dictSize) { dictSize = int64(c.DictCap) } */ size := r.header.Size if size >= 0 && size < dictSize { dictSize = size } // Protect against modified or malicious headers. if size > maxStreamSize { return nil, fmt.Errorf( "lzma: stream size %d exceeds a pebibyte (1024^5)", size) } if dictSize < MinDictCap { dictSize = MinDictCap } r.header.DictSize = uint32(dictSize) state := newState(r.header.Properties) dict, err := newDecoderDict(int(dictSize)) if err != nil { return nil, err } r.d, err = newDecoder(ByteReader(lzma), state, dict, r.header.Size) if err != nil { return nil, err } return r, nil } // Header returns the header as read from the LZMA stream. It is intended to // allow the user to understand what parameters are typically provided in the // headers of the LZMA files and set the DictCap field in [ReaderConfig] // accordingly. func (r *Reader) Header() (h Header, ok bool) { return r.headerOrig, r.d != nil } // EOSMarker indicates that an EOS marker has been encountered. func (r *Reader) EOSMarker() bool { return r.d.eosMarker } // Read returns uncompressed data. func (r *Reader) Read(p []byte) (n int, err error) { return r.d.Read(p) } ================================================ FILE: vendor/github.com/ulikunitz/xz/lzma/reader2.go ================================================ // Copyright 2014-2022 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package lzma import ( "errors" "io" "github.com/ulikunitz/xz/internal/xlog" ) // Reader2Config stores the parameters for the LZMA2 reader. // format. type Reader2Config struct { DictCap int } // fill converts the zero values of the configuration to the default values. func (c *Reader2Config) fill() { if c.DictCap == 0 { c.DictCap = 8 * 1024 * 1024 } } // Verify checks the reader configuration for errors. Zero configuration values // will be replaced by default values. func (c *Reader2Config) Verify() error { c.fill() if !(MinDictCap <= c.DictCap && int64(c.DictCap) <= MaxDictCap) { return errors.New("lzma: dictionary capacity is out of range") } return nil } // Reader2 supports the reading of LZMA2 chunk sequences. Note that the // first chunk should have a dictionary reset and the first compressed // chunk a properties reset. The chunk sequence may not be terminated by // an end-of-stream chunk. type Reader2 struct { r io.Reader err error dict *decoderDict ur *uncompressedReader decoder *decoder chunkReader io.Reader cstate chunkState } // NewReader2 creates a reader for an LZMA2 chunk sequence. func NewReader2(lzma2 io.Reader) (r *Reader2, err error) { return Reader2Config{}.NewReader2(lzma2) } // NewReader2 creates an LZMA2 reader using the given configuration. func (c Reader2Config) NewReader2(lzma2 io.Reader) (r *Reader2, err error) { if err = c.Verify(); err != nil { return nil, err } r = &Reader2{r: lzma2, cstate: start} r.dict, err = newDecoderDict(c.DictCap) if err != nil { return nil, err } if err = r.startChunk(); err != nil { r.err = err } return r, nil } // uncompressed tests whether the chunk type specifies an uncompressed // chunk. func uncompressed(ctype chunkType) bool { return ctype == cU || ctype == cUD } // startChunk parses a new chunk. func (r *Reader2) startChunk() error { r.chunkReader = nil header, err := readChunkHeader(r.r) if err != nil { if err == io.EOF { err = io.ErrUnexpectedEOF } return err } xlog.Debugf("chunk header %v", header) if err = r.cstate.next(header.ctype); err != nil { return err } if r.cstate == stop { return io.EOF } if header.ctype == cUD || header.ctype == cLRND { r.dict.Reset() } size := int64(header.uncompressed) + 1 if uncompressed(header.ctype) { if r.ur != nil { r.ur.Reopen(r.r, size) } else { r.ur = newUncompressedReader(r.r, r.dict, size) } r.chunkReader = r.ur return nil } br := ByteReader(io.LimitReader(r.r, int64(header.compressed)+1)) if r.decoder == nil { state := newState(header.props) r.decoder, err = newDecoder(br, state, r.dict, size) if err != nil { return err } r.chunkReader = r.decoder return nil } switch header.ctype { case cLR: r.decoder.State.Reset() case cLRN, cLRND: r.decoder.State = newState(header.props) } err = r.decoder.Reopen(br, size) if err != nil { return err } r.chunkReader = r.decoder return nil } // Read reads data from the LZMA2 chunk sequence. func (r *Reader2) Read(p []byte) (n int, err error) { if r.err != nil { return 0, r.err } for n < len(p) { var k int k, err = r.chunkReader.Read(p[n:]) n += k if err != nil { if err == io.EOF { err = r.startChunk() if err == nil { continue } } r.err = err return n, err } if k == 0 { r.err = errors.New("lzma: Reader2 doesn't get data") return n, r.err } } return n, nil } // EOS returns whether the LZMA2 stream has been terminated by an // end-of-stream chunk. func (r *Reader2) EOS() bool { return r.cstate == stop } // uncompressedReader is used to read uncompressed chunks. type uncompressedReader struct { lr io.LimitedReader Dict *decoderDict eof bool err error } // newUncompressedReader initializes a new uncompressedReader. func newUncompressedReader(r io.Reader, dict *decoderDict, size int64) *uncompressedReader { ur := &uncompressedReader{ lr: io.LimitedReader{R: r, N: size}, Dict: dict, } return ur } // Reopen reinitializes an uncompressed reader. func (ur *uncompressedReader) Reopen(r io.Reader, size int64) { ur.err = nil ur.eof = false ur.lr = io.LimitedReader{R: r, N: size} } // fill reads uncompressed data into the dictionary. func (ur *uncompressedReader) fill() error { if !ur.eof { n, err := io.CopyN(ur.Dict, &ur.lr, int64(ur.Dict.Available())) if err != io.EOF { return err } ur.eof = true if n > 0 { return nil } } if ur.lr.N != 0 { return io.ErrUnexpectedEOF } return io.EOF } // Read reads uncompressed data from the limited reader. func (ur *uncompressedReader) Read(p []byte) (n int, err error) { if ur.err != nil { return 0, ur.err } for { var k int k, err = ur.Dict.Read(p[n:]) n += k if n >= len(p) { return n, nil } if err != nil { break } err = ur.fill() if err != nil { break } } ur.err = err return n, err } ================================================ FILE: vendor/github.com/ulikunitz/xz/lzma/state.go ================================================ // Copyright 2014-2022 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package lzma // states defines the overall state count const states = 12 // State maintains the full state of the operation encoding or decoding // process. type state struct { rep [4]uint32 isMatch [states << maxPosBits]prob isRepG0Long [states << maxPosBits]prob isRep [states]prob isRepG0 [states]prob isRepG1 [states]prob isRepG2 [states]prob litCodec literalCodec lenCodec lengthCodec repLenCodec lengthCodec distCodec distCodec state uint32 posBitMask uint32 Properties Properties } // initProbSlice initializes a slice of probabilities. func initProbSlice(p []prob) { for i := range p { p[i] = probInit } } // Reset sets all state information to the original values. func (s *state) Reset() { p := s.Properties *s = state{ Properties: p, // dict: s.dict, posBitMask: (uint32(1) << uint(p.PB)) - 1, } initProbSlice(s.isMatch[:]) initProbSlice(s.isRep[:]) initProbSlice(s.isRepG0[:]) initProbSlice(s.isRepG1[:]) initProbSlice(s.isRepG2[:]) initProbSlice(s.isRepG0Long[:]) s.litCodec.init(p.LC, p.LP) s.lenCodec.init() s.repLenCodec.init() s.distCodec.init() } // newState creates a new state from the give Properties. func newState(p Properties) *state { s := &state{Properties: p} s.Reset() return s } // deepcopy initializes s as a deep copy of the source. func (s *state) deepcopy(src *state) { if s == src { return } s.rep = src.rep s.isMatch = src.isMatch s.isRepG0Long = src.isRepG0Long s.isRep = src.isRep s.isRepG0 = src.isRepG0 s.isRepG1 = src.isRepG1 s.isRepG2 = src.isRepG2 s.litCodec.deepcopy(&src.litCodec) s.lenCodec.deepcopy(&src.lenCodec) s.repLenCodec.deepcopy(&src.repLenCodec) s.distCodec.deepcopy(&src.distCodec) s.state = src.state s.posBitMask = src.posBitMask s.Properties = src.Properties } // cloneState creates a new clone of the give state. func cloneState(src *state) *state { s := new(state) s.deepcopy(src) return s } // updateStateLiteral updates the state for a literal. func (s *state) updateStateLiteral() { switch { case s.state < 4: s.state = 0 return case s.state < 10: s.state -= 3 return } s.state -= 6 } // updateStateMatch updates the state for a match. func (s *state) updateStateMatch() { if s.state < 7 { s.state = 7 } else { s.state = 10 } } // updateStateRep updates the state for a repetition. func (s *state) updateStateRep() { if s.state < 7 { s.state = 8 } else { s.state = 11 } } // updateStateShortRep updates the state for a short repetition. func (s *state) updateStateShortRep() { if s.state < 7 { s.state = 9 } else { s.state = 11 } } // states computes the states of the operation codec. func (s *state) states(dictHead int64) (state1, state2, posState uint32) { state1 = s.state posState = uint32(dictHead) & s.posBitMask state2 = (s.state << maxPosBits) | posState return } // litState computes the literal state. func (s *state) litState(prev byte, dictHead int64) uint32 { lp, lc := uint(s.Properties.LP), uint(s.Properties.LC) litState := ((uint32(dictHead) & ((1 << lp) - 1)) << lc) | (uint32(prev) >> (8 - lc)) return litState } ================================================ FILE: vendor/github.com/ulikunitz/xz/lzma/treecodecs.go ================================================ // Copyright 2014-2022 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package lzma // treeCodec encodes or decodes values with a fixed bit size. It is using a // tree of probability value. The root of the tree is the most-significant bit. type treeCodec struct { probTree } // makeTreeCodec makes a tree codec. The bits value must be inside the range // [1,32]. func makeTreeCodec(bits int) treeCodec { return treeCodec{makeProbTree(bits)} } // deepcopy initializes tc as a deep copy of the source. func (tc *treeCodec) deepcopy(src *treeCodec) { tc.probTree.deepcopy(&src.probTree) } // Encode uses the range encoder to encode a fixed-bit-size value. func (tc *treeCodec) Encode(e *rangeEncoder, v uint32) (err error) { m := uint32(1) for i := int(tc.bits) - 1; i >= 0; i-- { b := (v >> uint(i)) & 1 if err := e.EncodeBit(b, &tc.probs[m]); err != nil { return err } m = (m << 1) | b } return nil } // Decodes uses the range decoder to decode a fixed-bit-size value. Errors may // be caused by the range decoder. func (tc *treeCodec) Decode(d *rangeDecoder) (v uint32, err error) { m := uint32(1) for j := 0; j < int(tc.bits); j++ { b, err := d.DecodeBit(&tc.probs[m]) if err != nil { return 0, err } m = (m << 1) | b } return m - (1 << uint(tc.bits)), nil } // treeReverseCodec is another tree codec, where the least-significant bit is // the start of the probability tree. type treeReverseCodec struct { probTree } // deepcopy initializes the treeReverseCodec as a deep copy of the // source. func (tc *treeReverseCodec) deepcopy(src *treeReverseCodec) { tc.probTree.deepcopy(&src.probTree) } // makeTreeReverseCodec creates treeReverseCodec value. The bits argument must // be in the range [1,32]. func makeTreeReverseCodec(bits int) treeReverseCodec { return treeReverseCodec{makeProbTree(bits)} } // Encode uses range encoder to encode a fixed-bit-size value. The range // encoder may cause errors. func (tc *treeReverseCodec) Encode(v uint32, e *rangeEncoder) (err error) { m := uint32(1) for i := uint(0); i < uint(tc.bits); i++ { b := (v >> i) & 1 if err := e.EncodeBit(b, &tc.probs[m]); err != nil { return err } m = (m << 1) | b } return nil } // Decodes uses the range decoder to decode a fixed-bit-size value. Errors // returned by the range decoder will be returned. func (tc *treeReverseCodec) Decode(d *rangeDecoder) (v uint32, err error) { m := uint32(1) for j := uint(0); j < uint(tc.bits); j++ { b, err := d.DecodeBit(&tc.probs[m]) if err != nil { return 0, err } m = (m << 1) | b v |= b << j } return v, nil } // probTree stores enough probability values to be used by the treeEncode and // treeDecode methods of the range coder types. type probTree struct { probs []prob bits byte } // deepcopy initializes the probTree value as a deep copy of the source. func (t *probTree) deepcopy(src *probTree) { if t == src { return } t.probs = make([]prob, len(src.probs)) copy(t.probs, src.probs) t.bits = src.bits } // makeProbTree initializes a probTree structure. func makeProbTree(bits int) probTree { if !(1 <= bits && bits <= 32) { panic("bits outside of range [1,32]") } t := probTree{ bits: byte(bits), probs: make([]prob, 1< 0 { c.SizeInHeader = true } if !c.SizeInHeader { c.EOSMarker = true } } // Verify checks WriterConfig for errors. Verify will replace zero // values with default values. func (c *WriterConfig) Verify() error { c.fill() var err error if c == nil { return errors.New("lzma: WriterConfig is nil") } if c.Properties == nil { return errors.New("lzma: WriterConfig has no Properties set") } if err = c.Properties.verify(); err != nil { return err } if !(MinDictCap <= c.DictCap && int64(c.DictCap) <= MaxDictCap) { return errors.New("lzma: dictionary capacity is out of range") } if !(maxMatchLen <= c.BufSize) { return errors.New("lzma: lookahead buffer size too small") } if c.SizeInHeader { if c.Size < 0 { return errors.New("lzma: negative size not supported") } } else if !c.EOSMarker { return errors.New("lzma: EOS marker is required") } if err = c.Matcher.verify(); err != nil { return err } return nil } // header returns the header structure for this configuration. func (c *WriterConfig) header() Header { h := Header{ Properties: *c.Properties, DictSize: uint32(c.DictCap), Size: -1, } if c.SizeInHeader { h.Size = c.Size } return h } // Writer writes an LZMA stream in the classic format. type Writer struct { h Header bw io.ByteWriter buf *bufio.Writer e *encoder } // NewWriter creates a new LZMA writer for the classic format. The // method will write the header to the underlying stream. func (c WriterConfig) NewWriter(lzma io.Writer) (w *Writer, err error) { if err = c.Verify(); err != nil { return nil, err } w = &Writer{h: c.header()} var ok bool w.bw, ok = lzma.(io.ByteWriter) if !ok { w.buf = bufio.NewWriter(lzma) w.bw = w.buf } state := newState(w.h.Properties) m, err := c.Matcher.new(int(w.h.DictSize)) if err != nil { return nil, err } dict, err := newEncoderDict(int(w.h.DictSize), c.BufSize, m) if err != nil { return nil, err } var flags encoderFlags if c.EOSMarker { flags = eosMarker } if w.e, err = newEncoder(w.bw, state, dict, flags); err != nil { return nil, err } if err = w.writeHeader(); err != nil { return nil, err } return w, nil } // NewWriter creates a new LZMA writer using the classic format. The // function writes the header to the underlying stream. func NewWriter(lzma io.Writer) (w *Writer, err error) { return WriterConfig{}.NewWriter(lzma) } // writeHeader writes the LZMA header into the stream. func (w *Writer) writeHeader() error { data, err := w.h.marshalBinary() if err != nil { return err } _, err = w.bw.(io.Writer).Write(data) return err } // Write puts data into the Writer. func (w *Writer) Write(p []byte) (n int, err error) { if w.h.Size >= 0 { m := w.h.Size m -= w.e.Compressed() + int64(w.e.dict.Buffered()) if m < 0 { m = 0 } if m < int64(len(p)) { p = p[:m] err = ErrNoSpace } } var werr error if n, werr = w.e.Write(p); werr != nil { err = werr } return n, err } // Close closes the writer stream. It ensures that all data from the // buffer will be compressed and the LZMA stream will be finished. func (w *Writer) Close() error { if w.h.Size >= 0 { n := w.e.Compressed() + int64(w.e.dict.Buffered()) if n != w.h.Size { return errSize } } err := w.e.Close() if w.buf != nil { ferr := w.buf.Flush() if err == nil { err = ferr } } return err } ================================================ FILE: vendor/github.com/ulikunitz/xz/lzma/writer2.go ================================================ // Copyright 2014-2022 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package lzma import ( "bytes" "errors" "io" ) // Writer2Config is used to create a Writer2 using parameters. type Writer2Config struct { // The properties for the encoding. If the it is nil the value // {LC: 3, LP: 0, PB: 2} will be chosen. Properties *Properties // The capacity of the dictionary. If DictCap is zero, the value // 8 MiB will be chosen. DictCap int // Size of the lookahead buffer; value 0 indicates default size // 4096 BufSize int // Match algorithm Matcher MatchAlgorithm } // fill replaces zero values with default values. func (c *Writer2Config) fill() { if c.Properties == nil { c.Properties = &Properties{LC: 3, LP: 0, PB: 2} } if c.DictCap == 0 { c.DictCap = 8 * 1024 * 1024 } if c.BufSize == 0 { c.BufSize = 4096 } } // Verify checks the Writer2Config for correctness. Zero values will be // replaced by default values. func (c *Writer2Config) Verify() error { c.fill() var err error if c == nil { return errors.New("lzma: WriterConfig is nil") } if c.Properties == nil { return errors.New("lzma: WriterConfig has no Properties set") } if err = c.Properties.verify(); err != nil { return err } if !(MinDictCap <= c.DictCap && int64(c.DictCap) <= MaxDictCap) { return errors.New("lzma: dictionary capacity is out of range") } if !(maxMatchLen <= c.BufSize) { return errors.New("lzma: lookahead buffer size too small") } if c.Properties.LC+c.Properties.LP > 4 { return errors.New("lzma: sum of lc and lp exceeds 4") } if err = c.Matcher.verify(); err != nil { return err } return nil } // Writer2 supports the creation of an LZMA2 stream. But note that // written data is buffered, so call Flush or Close to write data to the // underlying writer. The Close method writes the end-of-stream marker // to the stream. So you may be able to concatenate the output of two // writers as long the output of the first writer has only been flushed // but not closed. // // Any change to the fields Properties, DictCap must be done before the // first call to Write, Flush or Close. type Writer2 struct { w io.Writer start *state encoder *encoder cstate chunkState ctype chunkType buf bytes.Buffer lbw LimitedByteWriter } // NewWriter2 creates an LZMA2 chunk sequence writer with the default // parameters and options. func NewWriter2(lzma2 io.Writer) (w *Writer2, err error) { return Writer2Config{}.NewWriter2(lzma2) } // NewWriter2 creates a new LZMA2 writer using the given configuration. func (c Writer2Config) NewWriter2(lzma2 io.Writer) (w *Writer2, err error) { if err = c.Verify(); err != nil { return nil, err } w = &Writer2{ w: lzma2, start: newState(*c.Properties), cstate: start, ctype: start.defaultChunkType(), } w.buf.Grow(maxCompressed) w.lbw = LimitedByteWriter{BW: &w.buf, N: maxCompressed} m, err := c.Matcher.new(c.DictCap) if err != nil { return nil, err } d, err := newEncoderDict(c.DictCap, c.BufSize, m) if err != nil { return nil, err } w.encoder, err = newEncoder(&w.lbw, cloneState(w.start), d, 0) if err != nil { return nil, err } return w, nil } // written returns the number of bytes written to the current chunk func (w *Writer2) written() int { if w.encoder == nil { return 0 } return int(w.encoder.Compressed()) + w.encoder.dict.Buffered() } // errClosed indicates that the writer is closed. var errClosed = errors.New("lzma: writer closed") // Writes data to LZMA2 stream. Note that written data will be buffered. // Use Flush or Close to ensure that data is written to the underlying // writer. func (w *Writer2) Write(p []byte) (n int, err error) { if w.cstate == stop { return 0, errClosed } for n < len(p) { m := maxUncompressed - w.written() if m <= 0 { panic("lzma: maxUncompressed reached") } var q []byte if n+m < len(p) { q = p[n : n+m] } else { q = p[n:] } k, err := w.encoder.Write(q) n += k if err != nil && err != ErrLimit { return n, err } if err == ErrLimit || k == m { if err = w.flushChunk(); err != nil { return n, err } } } return n, nil } // writeUncompressedChunk writes an uncompressed chunk to the LZMA2 // stream. func (w *Writer2) writeUncompressedChunk() error { u := w.encoder.Compressed() if u <= 0 { return errors.New("lzma: can't write empty uncompressed chunk") } if u > maxUncompressed { panic("overrun of uncompressed data limit") } switch w.ctype { case cLRND: w.ctype = cUD default: w.ctype = cU } w.encoder.state = w.start header := chunkHeader{ ctype: w.ctype, uncompressed: uint32(u - 1), } hdata, err := header.MarshalBinary() if err != nil { return err } if _, err = w.w.Write(hdata); err != nil { return err } _, err = w.encoder.dict.CopyN(w.w, int(u)) return err } // writeCompressedChunk writes a compressed chunk to the underlying // writer. func (w *Writer2) writeCompressedChunk() error { if w.ctype == cU || w.ctype == cUD { panic("chunk type uncompressed") } u := w.encoder.Compressed() if u <= 0 { return errors.New("writeCompressedChunk: empty chunk") } if u > maxUncompressed { panic("overrun of uncompressed data limit") } c := w.buf.Len() if c <= 0 { panic("no compressed data") } if c > maxCompressed { panic("overrun of compressed data limit") } header := chunkHeader{ ctype: w.ctype, uncompressed: uint32(u - 1), compressed: uint16(c - 1), props: w.encoder.state.Properties, } hdata, err := header.MarshalBinary() if err != nil { return err } if _, err = w.w.Write(hdata); err != nil { return err } _, err = io.Copy(w.w, &w.buf) return err } // writes a single chunk to the underlying writer. func (w *Writer2) writeChunk() error { u := int(uncompressedHeaderLen + w.encoder.Compressed()) c := headerLen(w.ctype) + w.buf.Len() if u < c { return w.writeUncompressedChunk() } return w.writeCompressedChunk() } // flushChunk terminates the current chunk. The encoder will be reset // to support the next chunk. func (w *Writer2) flushChunk() error { if w.written() == 0 { return nil } var err error if err = w.encoder.Close(); err != nil { return err } if err = w.writeChunk(); err != nil { return err } w.buf.Reset() w.lbw.N = maxCompressed if err = w.encoder.Reopen(&w.lbw); err != nil { return err } if err = w.cstate.next(w.ctype); err != nil { return err } w.ctype = w.cstate.defaultChunkType() w.start = cloneState(w.encoder.state) return nil } // Flush writes all buffered data out to the underlying stream. This // could result in multiple chunks to be created. func (w *Writer2) Flush() error { if w.cstate == stop { return errClosed } for w.written() > 0 { if err := w.flushChunk(); err != nil { return err } } return nil } // Close terminates the LZMA2 stream with an EOS chunk. func (w *Writer2) Close() error { if w.cstate == stop { return errClosed } if err := w.Flush(); err != nil { return nil } // write zero byte EOS chunk _, err := w.w.Write([]byte{0}) if err != nil { return err } w.cstate = stop return nil } ================================================ FILE: vendor/github.com/ulikunitz/xz/lzmafilter.go ================================================ // Copyright 2014-2022 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package xz import ( "errors" "fmt" "io" "github.com/ulikunitz/xz/lzma" ) // LZMA filter constants. const ( lzmaFilterID = 0x21 lzmaFilterLen = 3 ) // lzmaFilter declares the LZMA2 filter information stored in an xz // block header. type lzmaFilter struct { dictCap int64 } // String returns a representation of the LZMA filter. func (f lzmaFilter) String() string { return fmt.Sprintf("LZMA dict cap %#x", f.dictCap) } // id returns the ID for the LZMA2 filter. func (f lzmaFilter) id() uint64 { return lzmaFilterID } // MarshalBinary converts the lzmaFilter in its encoded representation. func (f lzmaFilter) MarshalBinary() (data []byte, err error) { c := lzma.EncodeDictCap(f.dictCap) return []byte{lzmaFilterID, 1, c}, nil } // UnmarshalBinary unmarshals the given data representation of the LZMA2 // filter. func (f *lzmaFilter) UnmarshalBinary(data []byte) error { if len(data) != lzmaFilterLen { return errors.New("xz: data for LZMA2 filter has wrong length") } if data[0] != lzmaFilterID { return errors.New("xz: wrong LZMA2 filter id") } if data[1] != 1 { return errors.New("xz: wrong LZMA2 filter size") } dc, err := lzma.DecodeDictCap(data[2]) if err != nil { return errors.New("xz: wrong LZMA2 dictionary size property") } f.dictCap = dc return nil } // reader creates a new reader for the LZMA2 filter. func (f lzmaFilter) reader(r io.Reader, c *ReaderConfig) (fr io.Reader, err error) { config := new(lzma.Reader2Config) if c != nil { config.DictCap = c.DictCap } dc := int(f.dictCap) if dc < 1 { return nil, errors.New("xz: LZMA2 filter parameter " + "dictionary capacity overflow") } if dc > config.DictCap { config.DictCap = dc } fr, err = config.NewReader2(r) if err != nil { return nil, err } return fr, nil } // writeCloser creates a io.WriteCloser for the LZMA2 filter. func (f lzmaFilter) writeCloser(w io.WriteCloser, c *WriterConfig, ) (fw io.WriteCloser, err error) { config := new(lzma.Writer2Config) if c != nil { *config = lzma.Writer2Config{ Properties: c.Properties, DictCap: c.DictCap, BufSize: c.BufSize, Matcher: c.Matcher, } } dc := int(f.dictCap) if dc < 1 { return nil, errors.New("xz: LZMA2 filter parameter " + "dictionary capacity overflow") } if dc > config.DictCap { config.DictCap = dc } fw, err = config.NewWriter2(w) if err != nil { return nil, err } return fw, nil } // last returns true, because an LZMA2 filter must be the last filter in // the filter list. func (f lzmaFilter) last() bool { return true } ================================================ FILE: vendor/github.com/ulikunitz/xz/make-docs ================================================ #!/bin/sh set -x pandoc -t html5 -f markdown -s --css=doc/md.css -o README.html README.md pandoc -t html5 -f markdown -s --css=doc/md.css -o TODO.html TODO.md ================================================ FILE: vendor/github.com/ulikunitz/xz/none-check.go ================================================ // Copyright 2014-2022 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package xz import "hash" type noneHash struct{} func (h noneHash) Write(p []byte) (n int, err error) { return len(p), nil } func (h noneHash) Sum(b []byte) []byte { return b } func (h noneHash) Reset() {} func (h noneHash) Size() int { return 0 } func (h noneHash) BlockSize() int { return 0 } func newNoneHash() hash.Hash { return &noneHash{} } ================================================ FILE: vendor/github.com/ulikunitz/xz/reader.go ================================================ // Copyright 2014-2022 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package xz supports the compression and decompression of xz files. It // supports version 1.0.4 of the specification without the non-LZMA2 // filters. See http://tukaani.org/xz/xz-file-format-1.0.4.txt package xz import ( "bytes" "errors" "fmt" "hash" "io" "github.com/ulikunitz/xz/internal/xlog" "github.com/ulikunitz/xz/lzma" ) // ReaderConfig defines the parameters for the xz reader. The // SingleStream parameter requests the reader to assume that the // underlying stream contains only a single stream. type ReaderConfig struct { DictCap int SingleStream bool } // Verify checks the reader parameters for Validity. Zero values will be // replaced by default values. func (c *ReaderConfig) Verify() error { if c == nil { return errors.New("xz: reader parameters are nil") } lc := lzma.Reader2Config{DictCap: c.DictCap} if err := lc.Verify(); err != nil { return err } return nil } // Reader supports the reading of one or multiple xz streams. type Reader struct { ReaderConfig xz io.Reader sr *streamReader } // streamReader decodes a single xz stream type streamReader struct { ReaderConfig xz io.Reader br *blockReader newHash func() hash.Hash h header index []record } // NewReader creates a new xz reader using the default parameters. // The function reads and checks the header of the first XZ stream. The // reader will process multiple streams including padding. func NewReader(xz io.Reader) (r *Reader, err error) { return ReaderConfig{}.NewReader(xz) } // NewReader creates an xz stream reader. The created reader will be // able to process multiple streams and padding unless a SingleStream // has been set in the reader configuration c. func (c ReaderConfig) NewReader(xz io.Reader) (r *Reader, err error) { if err = c.Verify(); err != nil { return nil, err } r = &Reader{ ReaderConfig: c, xz: xz, } if r.sr, err = c.newStreamReader(xz); err != nil { if err == io.EOF { err = io.ErrUnexpectedEOF } return nil, err } return r, nil } var errUnexpectedData = errors.New("xz: unexpected data after stream") // Read reads uncompressed data from the stream. func (r *Reader) Read(p []byte) (n int, err error) { for n < len(p) { if r.sr == nil { if r.SingleStream { data := make([]byte, 1) _, err = io.ReadFull(r.xz, data) if err != io.EOF { return n, errUnexpectedData } return n, io.EOF } for { r.sr, err = r.ReaderConfig.newStreamReader(r.xz) if err != errPadding { break } } if err != nil { return n, err } } k, err := r.sr.Read(p[n:]) n += k if err != nil { if err == io.EOF { r.sr = nil continue } return n, err } } return n, nil } var errPadding = errors.New("xz: padding (4 zero bytes) encountered") // newStreamReader creates a new xz stream reader using the given configuration // parameters. NewReader reads and checks the header of the xz stream. func (c ReaderConfig) newStreamReader(xz io.Reader) (r *streamReader, err error) { if err = c.Verify(); err != nil { return nil, err } data := make([]byte, HeaderLen) if _, err := io.ReadFull(xz, data[:4]); err != nil { return nil, err } if bytes.Equal(data[:4], []byte{0, 0, 0, 0}) { return nil, errPadding } if _, err = io.ReadFull(xz, data[4:]); err != nil { if err == io.EOF { err = io.ErrUnexpectedEOF } return nil, err } r = &streamReader{ ReaderConfig: c, xz: xz, index: make([]record, 0, 4), } if err = r.h.UnmarshalBinary(data); err != nil { return nil, err } xlog.Debugf("xz header %s", r.h) if r.newHash, err = newHashFunc(r.h.flags); err != nil { return nil, err } return r, nil } // readTail reads the index body and the xz footer. func (r *streamReader) readTail() error { index, n, err := readIndexBody(r.xz, len(r.index)) if err != nil { if err == io.EOF { err = io.ErrUnexpectedEOF } return err } for i, rec := range r.index { if rec != index[i] { return fmt.Errorf("xz: record %d is %v; want %v", i, rec, index[i]) } } p := make([]byte, footerLen) if _, err = io.ReadFull(r.xz, p); err != nil { if err == io.EOF { err = io.ErrUnexpectedEOF } return err } var f footer if err = f.UnmarshalBinary(p); err != nil { return err } xlog.Debugf("xz footer %s", f) if f.flags != r.h.flags { return errors.New("xz: footer flags incorrect") } if f.indexSize != int64(n)+1 { return errors.New("xz: index size in footer wrong") } return nil } // Read reads actual data from the xz stream. func (r *streamReader) Read(p []byte) (n int, err error) { for n < len(p) { if r.br == nil { bh, hlen, err := readBlockHeader(r.xz) if err != nil { if err == errIndexIndicator { if err = r.readTail(); err != nil { return n, err } return n, io.EOF } return n, err } xlog.Debugf("block %v", *bh) r.br, err = r.ReaderConfig.newBlockReader(r.xz, bh, hlen, r.newHash()) if err != nil { return n, err } } k, err := r.br.Read(p[n:]) n += k if err != nil { if err == io.EOF { r.index = append(r.index, r.br.record()) r.br = nil } else { return n, err } } } return n, nil } // countingReader is a reader that counts the bytes read. type countingReader struct { r io.Reader n int64 } // Read reads data from the wrapped reader and adds it to the n field. func (lr *countingReader) Read(p []byte) (n int, err error) { n, err = lr.r.Read(p) lr.n += int64(n) return n, err } // blockReader supports the reading of a block. type blockReader struct { lxz countingReader header *blockHeader headerLen int n int64 hash hash.Hash r io.Reader } // newBlockReader creates a new block reader. func (c *ReaderConfig) newBlockReader(xz io.Reader, h *blockHeader, hlen int, hash hash.Hash) (br *blockReader, err error) { br = &blockReader{ lxz: countingReader{r: xz}, header: h, headerLen: hlen, hash: hash, } fr, err := c.newFilterReader(&br.lxz, h.filters) if err != nil { return nil, err } if br.hash.Size() != 0 { br.r = io.TeeReader(fr, br.hash) } else { br.r = fr } return br, nil } // uncompressedSize returns the uncompressed size of the block. func (br *blockReader) uncompressedSize() int64 { return br.n } // compressedSize returns the compressed size of the block. func (br *blockReader) compressedSize() int64 { return br.lxz.n } // unpaddedSize computes the unpadded size for the block. func (br *blockReader) unpaddedSize() int64 { n := int64(br.headerLen) n += br.compressedSize() n += int64(br.hash.Size()) return n } // record returns the index record for the current block. func (br *blockReader) record() record { return record{br.unpaddedSize(), br.uncompressedSize()} } // Read reads data from the block. func (br *blockReader) Read(p []byte) (n int, err error) { n, err = br.r.Read(p) br.n += int64(n) u := br.header.uncompressedSize if u >= 0 && br.uncompressedSize() > u { return n, errors.New("xz: wrong uncompressed size for block") } c := br.header.compressedSize if c >= 0 && br.compressedSize() > c { return n, errors.New("xz: wrong compressed size for block") } if err != io.EOF { return n, err } if br.uncompressedSize() < u || br.compressedSize() < c { return n, io.ErrUnexpectedEOF } s := br.hash.Size() k := padLen(br.lxz.n) q := make([]byte, k+s, k+2*s) if _, err = io.ReadFull(br.lxz.r, q); err != nil { if err == io.EOF { err = io.ErrUnexpectedEOF } return n, err } if !allZeros(q[:k]) { return n, errors.New("xz: non-zero block padding") } checkSum := q[k:] computedSum := br.hash.Sum(checkSum[s:]) if !bytes.Equal(checkSum, computedSum) { return n, errors.New("xz: checksum error for block") } return n, io.EOF } func (c *ReaderConfig) newFilterReader(r io.Reader, f []filter) (fr io.Reader, err error) { if err = verifyFilters(f); err != nil { return nil, err } fr = r for i := len(f) - 1; i >= 0; i-- { fr, err = f[i].reader(fr, c) if err != nil { return nil, err } } return fr, nil } ================================================ FILE: vendor/github.com/ulikunitz/xz/writer.go ================================================ // Copyright 2014-2022 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package xz import ( "errors" "fmt" "hash" "io" "github.com/ulikunitz/xz/lzma" ) // WriterConfig describe the parameters for an xz writer. type WriterConfig struct { Properties *lzma.Properties DictCap int BufSize int BlockSize int64 // checksum method: CRC32, CRC64 or SHA256 (default: CRC64) CheckSum byte // Forces NoChecksum (default: false) NoCheckSum bool // match algorithm Matcher lzma.MatchAlgorithm } // fill replaces zero values with default values. func (c *WriterConfig) fill() { if c.Properties == nil { c.Properties = &lzma.Properties{LC: 3, LP: 0, PB: 2} } if c.DictCap == 0 { c.DictCap = 8 * 1024 * 1024 } if c.BufSize == 0 { c.BufSize = 4096 } if c.BlockSize == 0 { c.BlockSize = maxInt64 } if c.CheckSum == 0 { c.CheckSum = CRC64 } if c.NoCheckSum { c.CheckSum = None } } // Verify checks the configuration for errors. Zero values will be // replaced by default values. func (c *WriterConfig) Verify() error { if c == nil { return errors.New("xz: writer configuration is nil") } c.fill() lc := lzma.Writer2Config{ Properties: c.Properties, DictCap: c.DictCap, BufSize: c.BufSize, Matcher: c.Matcher, } if err := lc.Verify(); err != nil { return err } if c.BlockSize <= 0 { return errors.New("xz: block size out of range") } if err := verifyFlags(c.CheckSum); err != nil { return err } return nil } // filters creates the filter list for the given parameters. func (c *WriterConfig) filters() []filter { return []filter{&lzmaFilter{int64(c.DictCap)}} } // maxInt64 defines the maximum 64-bit signed integer. const maxInt64 = 1<<63 - 1 // verifyFilters checks the filter list for the length and the right // sequence of filters. func verifyFilters(f []filter) error { if len(f) == 0 { return errors.New("xz: no filters") } if len(f) > 4 { return errors.New("xz: more than four filters") } for _, g := range f[:len(f)-1] { if g.last() { return errors.New("xz: last filter is not last") } } if !f[len(f)-1].last() { return errors.New("xz: wrong last filter") } return nil } // newFilterWriteCloser converts a filter list into a WriteCloser that // can be used by a blockWriter. func (c *WriterConfig) newFilterWriteCloser(w io.Writer, f []filter) (fw io.WriteCloser, err error) { if err = verifyFilters(f); err != nil { return nil, err } fw = nopWriteCloser(w) for i := len(f) - 1; i >= 0; i-- { fw, err = f[i].writeCloser(fw, c) if err != nil { return nil, err } } return fw, nil } // nopWCloser implements a WriteCloser with a Close method not doing // anything. type nopWCloser struct { io.Writer } // Close returns nil and doesn't do anything else. func (c nopWCloser) Close() error { return nil } // nopWriteCloser converts the Writer into a WriteCloser with a Close // function that does nothing beside returning nil. func nopWriteCloser(w io.Writer) io.WriteCloser { return nopWCloser{w} } // Writer compresses data written to it. It is an io.WriteCloser. type Writer struct { WriterConfig xz io.Writer bw *blockWriter newHash func() hash.Hash h header index []record closed bool } // newBlockWriter creates a new block writer writes the header out. func (w *Writer) newBlockWriter() error { var err error w.bw, err = w.WriterConfig.newBlockWriter(w.xz, w.newHash()) if err != nil { return err } if err = w.bw.writeHeader(w.xz); err != nil { return err } return nil } // closeBlockWriter closes a block writer and records the sizes in the // index. func (w *Writer) closeBlockWriter() error { var err error if err = w.bw.Close(); err != nil { return err } w.index = append(w.index, w.bw.record()) return nil } // NewWriter creates a new xz writer using default parameters. func NewWriter(xz io.Writer) (w *Writer, err error) { return WriterConfig{}.NewWriter(xz) } // NewWriter creates a new Writer using the given configuration parameters. func (c WriterConfig) NewWriter(xz io.Writer) (w *Writer, err error) { if err = c.Verify(); err != nil { return nil, err } w = &Writer{ WriterConfig: c, xz: xz, h: header{c.CheckSum}, index: make([]record, 0, 4), } if w.newHash, err = newHashFunc(c.CheckSum); err != nil { return nil, err } data, err := w.h.MarshalBinary() if err != nil { return nil, fmt.Errorf("w.h.MarshalBinary(): error %w", err) } if _, err = xz.Write(data); err != nil { return nil, err } if err = w.newBlockWriter(); err != nil { return nil, err } return w, nil } // Write compresses the uncompressed data provided. func (w *Writer) Write(p []byte) (n int, err error) { if w.closed { return 0, errClosed } for { k, err := w.bw.Write(p[n:]) n += k if err != errNoSpace { return n, err } if err = w.closeBlockWriter(); err != nil { return n, err } if err = w.newBlockWriter(); err != nil { return n, err } } } // Close closes the writer and adds the footer to the Writer. Close // doesn't close the underlying writer. func (w *Writer) Close() error { if w.closed { return errClosed } w.closed = true var err error if err = w.closeBlockWriter(); err != nil { return err } f := footer{flags: w.h.flags} if f.indexSize, err = writeIndex(w.xz, w.index); err != nil { return err } data, err := f.MarshalBinary() if err != nil { return err } if _, err = w.xz.Write(data); err != nil { return err } return nil } // countingWriter is a writer that counts all data written to it. type countingWriter struct { w io.Writer n int64 } // Write writes data to the countingWriter. func (cw *countingWriter) Write(p []byte) (n int, err error) { n, err = cw.w.Write(p) cw.n += int64(n) if err == nil && cw.n < 0 { return n, errors.New("xz: counter overflow") } return } // blockWriter is writes a single block. type blockWriter struct { cxz countingWriter // mw combines io.WriteCloser w and the hash. mw io.Writer w io.WriteCloser n int64 blockSize int64 closed bool headerLen int filters []filter hash hash.Hash } // newBlockWriter creates a new block writer. func (c *WriterConfig) newBlockWriter(xz io.Writer, hash hash.Hash) (bw *blockWriter, err error) { bw = &blockWriter{ cxz: countingWriter{w: xz}, blockSize: c.BlockSize, filters: c.filters(), hash: hash, } bw.w, err = c.newFilterWriteCloser(&bw.cxz, bw.filters) if err != nil { return nil, err } if bw.hash.Size() != 0 { bw.mw = io.MultiWriter(bw.w, bw.hash) } else { bw.mw = bw.w } return bw, nil } // writeHeader writes the header. If the function is called after Close // the commpressedSize and uncompressedSize fields will be filled. func (bw *blockWriter) writeHeader(w io.Writer) error { h := blockHeader{ compressedSize: -1, uncompressedSize: -1, filters: bw.filters, } if bw.closed { h.compressedSize = bw.compressedSize() h.uncompressedSize = bw.uncompressedSize() } data, err := h.MarshalBinary() if err != nil { return err } if _, err = w.Write(data); err != nil { return err } bw.headerLen = len(data) return nil } // compressed size returns the amount of data written to the underlying // stream. func (bw *blockWriter) compressedSize() int64 { return bw.cxz.n } // uncompressedSize returns the number of data written to the // blockWriter func (bw *blockWriter) uncompressedSize() int64 { return bw.n } // unpaddedSize returns the sum of the header length, the uncompressed // size of the block and the hash size. func (bw *blockWriter) unpaddedSize() int64 { if bw.headerLen <= 0 { panic("xz: block header not written") } n := int64(bw.headerLen) n += bw.compressedSize() n += int64(bw.hash.Size()) return n } // record returns the record for the current stream. Call Close before // calling this method. func (bw *blockWriter) record() record { return record{bw.unpaddedSize(), bw.uncompressedSize()} } var errClosed = errors.New("xz: writer already closed") var errNoSpace = errors.New("xz: no space") // Write writes uncompressed data to the block writer. func (bw *blockWriter) Write(p []byte) (n int, err error) { if bw.closed { return 0, errClosed } t := bw.blockSize - bw.n if int64(len(p)) > t { err = errNoSpace p = p[:t] } var werr error n, werr = bw.mw.Write(p) bw.n += int64(n) if werr != nil { return n, werr } return n, err } // Close closes the writer. func (bw *blockWriter) Close() error { if bw.closed { return errClosed } bw.closed = true if err := bw.w.Close(); err != nil { return err } s := bw.hash.Size() k := padLen(bw.cxz.n) p := make([]byte, k+s) bw.hash.Sum(p[k:k]) if _, err := bw.cxz.w.Write(p); err != nil { return err } return nil } ================================================ FILE: vendor/github.com/vbatts/tar-split/LICENSE ================================================ Copyright (c) 2015 Vincent Batts, Raleigh, NC, USA All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: vendor/github.com/vbatts/tar-split/archive/tar/common.go ================================================ // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package tar implements access to tar archives. // // Tape archives (tar) are a file format for storing a sequence of files that // can be read and written in a streaming manner. // This package aims to cover most variations of the format, // including those produced by GNU and BSD tar tools. package tar import ( "errors" "fmt" "math" "os" "path" "reflect" "strconv" "strings" "time" ) // BUG: Use of the Uid and Gid fields in Header could overflow on 32-bit // architectures. If a large value is encountered when decoding, the result // stored in Header will be the truncated version. var ( ErrHeader = errors.New("archive/tar: invalid tar header") ErrWriteTooLong = errors.New("archive/tar: write too long") ErrFieldTooLong = errors.New("archive/tar: header field too long") ErrWriteAfterClose = errors.New("archive/tar: write after close") errMissData = errors.New("archive/tar: sparse file references non-existent data") errUnrefData = errors.New("archive/tar: sparse file contains unreferenced data") errWriteHole = errors.New("archive/tar: write non-NUL byte in sparse hole") errSparseTooLong = errors.New("archive/tar: sparse map too long") ) type headerError []string func (he headerError) Error() string { const prefix = "archive/tar: cannot encode header" var ss []string for _, s := range he { if s != "" { ss = append(ss, s) } } if len(ss) == 0 { return prefix } return fmt.Sprintf("%s: %v", prefix, strings.Join(ss, "; and ")) } // Type flags for Header.Typeflag. const ( // Type '0' indicates a regular file. TypeReg = '0' TypeRegA = '\x00' // Deprecated: Use TypeReg instead. // Type '1' to '6' are header-only flags and may not have a data body. TypeLink = '1' // Hard link TypeSymlink = '2' // Symbolic link TypeChar = '3' // Character device node TypeBlock = '4' // Block device node TypeDir = '5' // Directory TypeFifo = '6' // FIFO node // Type '7' is reserved. TypeCont = '7' // Type 'x' is used by the PAX format to store key-value records that // are only relevant to the next file. // This package transparently handles these types. TypeXHeader = 'x' // Type 'g' is used by the PAX format to store key-value records that // are relevant to all subsequent files. // This package only supports parsing and composing such headers, // but does not currently support persisting the global state across files. TypeXGlobalHeader = 'g' // Type 'S' indicates a sparse file in the GNU format. TypeGNUSparse = 'S' // Types 'L' and 'K' are used by the GNU format for a meta file // used to store the path or link name for the next file. // This package transparently handles these types. TypeGNULongName = 'L' TypeGNULongLink = 'K' ) // Keywords for PAX extended header records. const ( paxNone = "" // Indicates that no PAX key is suitable paxPath = "path" paxLinkpath = "linkpath" paxSize = "size" paxUid = "uid" paxGid = "gid" paxUname = "uname" paxGname = "gname" paxMtime = "mtime" paxAtime = "atime" paxCtime = "ctime" // Removed from later revision of PAX spec, but was valid paxCharset = "charset" // Currently unused paxComment = "comment" // Currently unused paxSchilyXattr = "SCHILY.xattr." // Keywords for GNU sparse files in a PAX extended header. paxGNUSparse = "GNU.sparse." paxGNUSparseNumBlocks = "GNU.sparse.numblocks" paxGNUSparseOffset = "GNU.sparse.offset" paxGNUSparseNumBytes = "GNU.sparse.numbytes" paxGNUSparseMap = "GNU.sparse.map" paxGNUSparseName = "GNU.sparse.name" paxGNUSparseMajor = "GNU.sparse.major" paxGNUSparseMinor = "GNU.sparse.minor" paxGNUSparseSize = "GNU.sparse.size" paxGNUSparseRealSize = "GNU.sparse.realsize" ) // basicKeys is a set of the PAX keys for which we have built-in support. // This does not contain "charset" or "comment", which are both PAX-specific, // so adding them as first-class features of Header is unlikely. // Users can use the PAXRecords field to set it themselves. var basicKeys = map[string]bool{ paxPath: true, paxLinkpath: true, paxSize: true, paxUid: true, paxGid: true, paxUname: true, paxGname: true, paxMtime: true, paxAtime: true, paxCtime: true, } // A Header represents a single header in a tar archive. // Some fields may not be populated. // // For forward compatibility, users that retrieve a Header from Reader.Next, // mutate it in some ways, and then pass it back to Writer.WriteHeader // should do so by creating a new Header and copying the fields // that they are interested in preserving. type Header struct { // Typeflag is the type of header entry. // The zero value is automatically promoted to either TypeReg or TypeDir // depending on the presence of a trailing slash in Name. Typeflag byte Name string // Name of file entry Linkname string // Target name of link (valid for TypeLink or TypeSymlink) Size int64 // Logical file size in bytes Mode int64 // Permission and mode bits Uid int // User ID of owner Gid int // Group ID of owner Uname string // User name of owner Gname string // Group name of owner // If the Format is unspecified, then Writer.WriteHeader rounds ModTime // to the nearest second and ignores the AccessTime and ChangeTime fields. // // To use AccessTime or ChangeTime, specify the Format as PAX or GNU. // To use sub-second resolution, specify the Format as PAX. ModTime time.Time // Modification time AccessTime time.Time // Access time (requires either PAX or GNU support) ChangeTime time.Time // Change time (requires either PAX or GNU support) Devmajor int64 // Major device number (valid for TypeChar or TypeBlock) Devminor int64 // Minor device number (valid for TypeChar or TypeBlock) // Xattrs stores extended attributes as PAX records under the // "SCHILY.xattr." namespace. // // The following are semantically equivalent: // h.Xattrs[key] = value // h.PAXRecords["SCHILY.xattr."+key] = value // // When Writer.WriteHeader is called, the contents of Xattrs will take // precedence over those in PAXRecords. // // Deprecated: Use PAXRecords instead. Xattrs map[string]string // PAXRecords is a map of PAX extended header records. // // User-defined records should have keys of the following form: // VENDOR.keyword // Where VENDOR is some namespace in all uppercase, and keyword may // not contain the '=' character (e.g., "GOLANG.pkg.version"). // The key and value should be non-empty UTF-8 strings. // // When Writer.WriteHeader is called, PAX records derived from the // other fields in Header take precedence over PAXRecords. PAXRecords map[string]string // Format specifies the format of the tar header. // // This is set by Reader.Next as a best-effort guess at the format. // Since the Reader liberally reads some non-compliant files, // it is possible for this to be FormatUnknown. // // If the format is unspecified when Writer.WriteHeader is called, // then it uses the first format (in the order of USTAR, PAX, GNU) // capable of encoding this Header (see Format). Format Format } // sparseEntry represents a Length-sized fragment at Offset in the file. type sparseEntry struct{ Offset, Length int64 } func (s sparseEntry) endOffset() int64 { return s.Offset + s.Length } // A sparse file can be represented as either a sparseDatas or a sparseHoles. // As long as the total size is known, they are equivalent and one can be // converted to the other form and back. The various tar formats with sparse // file support represent sparse files in the sparseDatas form. That is, they // specify the fragments in the file that has data, and treat everything else as // having zero bytes. As such, the encoding and decoding logic in this package // deals with sparseDatas. // // However, the external API uses sparseHoles instead of sparseDatas because the // zero value of sparseHoles logically represents a normal file (i.e., there are // no holes in it). On the other hand, the zero value of sparseDatas implies // that the file has no data in it, which is rather odd. // // As an example, if the underlying raw file contains the 10-byte data: // var compactFile = "abcdefgh" // // And the sparse map has the following entries: // var spd sparseDatas = []sparseEntry{ // {Offset: 2, Length: 5}, // Data fragment for 2..6 // {Offset: 18, Length: 3}, // Data fragment for 18..20 // } // var sph sparseHoles = []sparseEntry{ // {Offset: 0, Length: 2}, // Hole fragment for 0..1 // {Offset: 7, Length: 11}, // Hole fragment for 7..17 // {Offset: 21, Length: 4}, // Hole fragment for 21..24 // } // // Then the content of the resulting sparse file with a Header.Size of 25 is: // var sparseFile = "\x00"*2 + "abcde" + "\x00"*11 + "fgh" + "\x00"*4 type ( sparseDatas []sparseEntry sparseHoles []sparseEntry ) // validateSparseEntries reports whether sp is a valid sparse map. // It does not matter whether sp represents data fragments or hole fragments. func validateSparseEntries(sp []sparseEntry, size int64) bool { // Validate all sparse entries. These are the same checks as performed by // the BSD tar utility. if size < 0 { return false } var pre sparseEntry for _, cur := range sp { switch { case cur.Offset < 0 || cur.Length < 0: return false // Negative values are never okay case cur.Offset > math.MaxInt64-cur.Length: return false // Integer overflow with large length case cur.endOffset() > size: return false // Region extends beyond the actual size case pre.endOffset() > cur.Offset: return false // Regions cannot overlap and must be in order } pre = cur } return true } // alignSparseEntries mutates src and returns dst where each fragment's // starting offset is aligned up to the nearest block edge, and each // ending offset is aligned down to the nearest block edge. // // Even though the Go tar Reader and the BSD tar utility can handle entries // with arbitrary offsets and lengths, the GNU tar utility can only handle // offsets and lengths that are multiples of blockSize. func alignSparseEntries(src []sparseEntry, size int64) []sparseEntry { dst := src[:0] for _, s := range src { pos, end := s.Offset, s.endOffset() pos += blockPadding(+pos) // Round-up to nearest blockSize if end != size { end -= blockPadding(-end) // Round-down to nearest blockSize } if pos < end { dst = append(dst, sparseEntry{Offset: pos, Length: end - pos}) } } return dst } // invertSparseEntries converts a sparse map from one form to the other. // If the input is sparseHoles, then it will output sparseDatas and vice-versa. // The input must have been already validated. // // This function mutates src and returns a normalized map where: // * adjacent fragments are coalesced together // * only the last fragment may be empty // * the endOffset of the last fragment is the total size func invertSparseEntries(src []sparseEntry, size int64) []sparseEntry { dst := src[:0] var pre sparseEntry for _, cur := range src { if cur.Length == 0 { continue // Skip empty fragments } pre.Length = cur.Offset - pre.Offset if pre.Length > 0 { dst = append(dst, pre) // Only add non-empty fragments } pre.Offset = cur.endOffset() } pre.Length = size - pre.Offset // Possibly the only empty fragment return append(dst, pre) } // fileState tracks the number of logical (includes sparse holes) and physical // (actual in tar archive) bytes remaining for the current file. // // Invariant: LogicalRemaining >= PhysicalRemaining type fileState interface { LogicalRemaining() int64 PhysicalRemaining() int64 } // allowedFormats determines which formats can be used. // The value returned is the logical OR of multiple possible formats. // If the value is FormatUnknown, then the input Header cannot be encoded // and an error is returned explaining why. // // As a by-product of checking the fields, this function returns paxHdrs, which // contain all fields that could not be directly encoded. // A value receiver ensures that this method does not mutate the source Header. func (h Header) allowedFormats() (format Format, paxHdrs map[string]string, err error) { format = FormatUSTAR | FormatPAX | FormatGNU paxHdrs = make(map[string]string) var whyNoUSTAR, whyNoPAX, whyNoGNU string var preferPAX bool // Prefer PAX over USTAR verifyString := func(s string, size int, name, paxKey string) { // NUL-terminator is optional for path and linkpath. // Technically, it is required for uname and gname, // but neither GNU nor BSD tar checks for it. tooLong := len(s) > size allowLongGNU := paxKey == paxPath || paxKey == paxLinkpath if hasNUL(s) || (tooLong && !allowLongGNU) { whyNoGNU = fmt.Sprintf("GNU cannot encode %s=%q", name, s) format.mustNotBe(FormatGNU) } if !isASCII(s) || tooLong { canSplitUSTAR := paxKey == paxPath if _, _, ok := splitUSTARPath(s); !canSplitUSTAR || !ok { whyNoUSTAR = fmt.Sprintf("USTAR cannot encode %s=%q", name, s) format.mustNotBe(FormatUSTAR) } if paxKey == paxNone { whyNoPAX = fmt.Sprintf("PAX cannot encode %s=%q", name, s) format.mustNotBe(FormatPAX) } else { paxHdrs[paxKey] = s } } if v, ok := h.PAXRecords[paxKey]; ok && v == s { paxHdrs[paxKey] = v } } verifyNumeric := func(n int64, size int, name, paxKey string) { if !fitsInBase256(size, n) { whyNoGNU = fmt.Sprintf("GNU cannot encode %s=%d", name, n) format.mustNotBe(FormatGNU) } if !fitsInOctal(size, n) { whyNoUSTAR = fmt.Sprintf("USTAR cannot encode %s=%d", name, n) format.mustNotBe(FormatUSTAR) if paxKey == paxNone { whyNoPAX = fmt.Sprintf("PAX cannot encode %s=%d", name, n) format.mustNotBe(FormatPAX) } else { paxHdrs[paxKey] = strconv.FormatInt(n, 10) } } if v, ok := h.PAXRecords[paxKey]; ok && v == strconv.FormatInt(n, 10) { paxHdrs[paxKey] = v } } verifyTime := func(ts time.Time, size int, name, paxKey string) { if ts.IsZero() { return // Always okay } if !fitsInBase256(size, ts.Unix()) { whyNoGNU = fmt.Sprintf("GNU cannot encode %s=%v", name, ts) format.mustNotBe(FormatGNU) } isMtime := paxKey == paxMtime fitsOctal := fitsInOctal(size, ts.Unix()) if (isMtime && !fitsOctal) || !isMtime { whyNoUSTAR = fmt.Sprintf("USTAR cannot encode %s=%v", name, ts) format.mustNotBe(FormatUSTAR) } needsNano := ts.Nanosecond() != 0 if !isMtime || !fitsOctal || needsNano { preferPAX = true // USTAR may truncate sub-second measurements if paxKey == paxNone { whyNoPAX = fmt.Sprintf("PAX cannot encode %s=%v", name, ts) format.mustNotBe(FormatPAX) } else { paxHdrs[paxKey] = formatPAXTime(ts) } } if v, ok := h.PAXRecords[paxKey]; ok && v == formatPAXTime(ts) { paxHdrs[paxKey] = v } } // Check basic fields. var blk block v7 := blk.V7() ustar := blk.USTAR() gnu := blk.GNU() verifyString(h.Name, len(v7.Name()), "Name", paxPath) verifyString(h.Linkname, len(v7.LinkName()), "Linkname", paxLinkpath) verifyString(h.Uname, len(ustar.UserName()), "Uname", paxUname) verifyString(h.Gname, len(ustar.GroupName()), "Gname", paxGname) verifyNumeric(h.Mode, len(v7.Mode()), "Mode", paxNone) verifyNumeric(int64(h.Uid), len(v7.UID()), "Uid", paxUid) verifyNumeric(int64(h.Gid), len(v7.GID()), "Gid", paxGid) verifyNumeric(h.Size, len(v7.Size()), "Size", paxSize) verifyNumeric(h.Devmajor, len(ustar.DevMajor()), "Devmajor", paxNone) verifyNumeric(h.Devminor, len(ustar.DevMinor()), "Devminor", paxNone) verifyTime(h.ModTime, len(v7.ModTime()), "ModTime", paxMtime) verifyTime(h.AccessTime, len(gnu.AccessTime()), "AccessTime", paxAtime) verifyTime(h.ChangeTime, len(gnu.ChangeTime()), "ChangeTime", paxCtime) // Check for header-only types. var whyOnlyPAX, whyOnlyGNU string switch h.Typeflag { case TypeReg, TypeChar, TypeBlock, TypeFifo, TypeGNUSparse: // Exclude TypeLink and TypeSymlink, since they may reference directories. if strings.HasSuffix(h.Name, "/") { return FormatUnknown, nil, headerError{"filename may not have trailing slash"} } case TypeXHeader, TypeGNULongName, TypeGNULongLink: return FormatUnknown, nil, headerError{"cannot manually encode TypeXHeader, TypeGNULongName, or TypeGNULongLink headers"} case TypeXGlobalHeader: h2 := Header{Name: h.Name, Typeflag: h.Typeflag, Xattrs: h.Xattrs, PAXRecords: h.PAXRecords, Format: h.Format} if !reflect.DeepEqual(h, h2) { return FormatUnknown, nil, headerError{"only PAXRecords should be set for TypeXGlobalHeader"} } whyOnlyPAX = "only PAX supports TypeXGlobalHeader" format.mayOnlyBe(FormatPAX) } if !isHeaderOnlyType(h.Typeflag) && h.Size < 0 { return FormatUnknown, nil, headerError{"negative size on header-only type"} } // Check PAX records. if len(h.Xattrs) > 0 { for k, v := range h.Xattrs { paxHdrs[paxSchilyXattr+k] = v } whyOnlyPAX = "only PAX supports Xattrs" format.mayOnlyBe(FormatPAX) } if len(h.PAXRecords) > 0 { for k, v := range h.PAXRecords { switch _, exists := paxHdrs[k]; { case exists: continue // Do not overwrite existing records case h.Typeflag == TypeXGlobalHeader: paxHdrs[k] = v // Copy all records case !basicKeys[k] && !strings.HasPrefix(k, paxGNUSparse): paxHdrs[k] = v // Ignore local records that may conflict } } whyOnlyPAX = "only PAX supports PAXRecords" format.mayOnlyBe(FormatPAX) } for k, v := range paxHdrs { if !validPAXRecord(k, v) { return FormatUnknown, nil, headerError{fmt.Sprintf("invalid PAX record: %q", k+" = "+v)} } } // TODO(dsnet): Re-enable this when adding sparse support. // See https://golang.org/issue/22735 /* // Check sparse files. if len(h.SparseHoles) > 0 || h.Typeflag == TypeGNUSparse { if isHeaderOnlyType(h.Typeflag) { return FormatUnknown, nil, headerError{"header-only type cannot be sparse"} } if !validateSparseEntries(h.SparseHoles, h.Size) { return FormatUnknown, nil, headerError{"invalid sparse holes"} } if h.Typeflag == TypeGNUSparse { whyOnlyGNU = "only GNU supports TypeGNUSparse" format.mayOnlyBe(FormatGNU) } else { whyNoGNU = "GNU supports sparse files only with TypeGNUSparse" format.mustNotBe(FormatGNU) } whyNoUSTAR = "USTAR does not support sparse files" format.mustNotBe(FormatUSTAR) } */ // Check desired format. if wantFormat := h.Format; wantFormat != FormatUnknown { if wantFormat.has(FormatPAX) && !preferPAX { wantFormat.mayBe(FormatUSTAR) // PAX implies USTAR allowed too } format.mayOnlyBe(wantFormat) // Set union of formats allowed and format wanted } if format == FormatUnknown { switch h.Format { case FormatUSTAR: err = headerError{"Format specifies USTAR", whyNoUSTAR, whyOnlyPAX, whyOnlyGNU} case FormatPAX: err = headerError{"Format specifies PAX", whyNoPAX, whyOnlyGNU} case FormatGNU: err = headerError{"Format specifies GNU", whyNoGNU, whyOnlyPAX} default: err = headerError{whyNoUSTAR, whyNoPAX, whyNoGNU, whyOnlyPAX, whyOnlyGNU} } } return format, paxHdrs, err } // FileInfo returns an os.FileInfo for the Header. func (h *Header) FileInfo() os.FileInfo { return headerFileInfo{h} } // headerFileInfo implements os.FileInfo. type headerFileInfo struct { h *Header } func (fi headerFileInfo) Size() int64 { return fi.h.Size } func (fi headerFileInfo) IsDir() bool { return fi.Mode().IsDir() } func (fi headerFileInfo) ModTime() time.Time { return fi.h.ModTime } func (fi headerFileInfo) Sys() interface{} { return fi.h } // Name returns the base name of the file. func (fi headerFileInfo) Name() string { if fi.IsDir() { return path.Base(path.Clean(fi.h.Name)) } return path.Base(fi.h.Name) } // Mode returns the permission and mode bits for the headerFileInfo. func (fi headerFileInfo) Mode() (mode os.FileMode) { // Set file permission bits. mode = os.FileMode(fi.h.Mode).Perm() // Set setuid, setgid and sticky bits. if fi.h.Mode&c_ISUID != 0 { mode |= os.ModeSetuid } if fi.h.Mode&c_ISGID != 0 { mode |= os.ModeSetgid } if fi.h.Mode&c_ISVTX != 0 { mode |= os.ModeSticky } // Set file mode bits; clear perm, setuid, setgid, and sticky bits. switch m := os.FileMode(fi.h.Mode) &^ 07777; m { case c_ISDIR: mode |= os.ModeDir case c_ISFIFO: mode |= os.ModeNamedPipe case c_ISLNK: mode |= os.ModeSymlink case c_ISBLK: mode |= os.ModeDevice case c_ISCHR: mode |= os.ModeDevice mode |= os.ModeCharDevice case c_ISSOCK: mode |= os.ModeSocket } switch fi.h.Typeflag { case TypeSymlink: mode |= os.ModeSymlink case TypeChar: mode |= os.ModeDevice mode |= os.ModeCharDevice case TypeBlock: mode |= os.ModeDevice case TypeDir: mode |= os.ModeDir case TypeFifo: mode |= os.ModeNamedPipe } return mode } // sysStat, if non-nil, populates h from system-dependent fields of fi. var sysStat func(fi os.FileInfo, h *Header) error const ( // Mode constants from the USTAR spec: // See http://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html#tag_20_92_13_06 c_ISUID = 04000 // Set uid c_ISGID = 02000 // Set gid c_ISVTX = 01000 // Save text (sticky bit) // Common Unix mode constants; these are not defined in any common tar standard. // Header.FileInfo understands these, but FileInfoHeader will never produce these. c_ISDIR = 040000 // Directory c_ISFIFO = 010000 // FIFO c_ISREG = 0100000 // Regular file c_ISLNK = 0120000 // Symbolic link c_ISBLK = 060000 // Block special file c_ISCHR = 020000 // Character special file c_ISSOCK = 0140000 // Socket ) // FileInfoHeader creates a partially-populated Header from fi. // If fi describes a symlink, FileInfoHeader records link as the link target. // If fi describes a directory, a slash is appended to the name. // // Since os.FileInfo's Name method only returns the base name of // the file it describes, it may be necessary to modify Header.Name // to provide the full path name of the file. func FileInfoHeader(fi os.FileInfo, link string) (*Header, error) { if fi == nil { return nil, errors.New("archive/tar: FileInfo is nil") } fm := fi.Mode() h := &Header{ Name: fi.Name(), ModTime: fi.ModTime(), Mode: int64(fm.Perm()), // or'd with c_IS* constants later } switch { case fm.IsRegular(): h.Typeflag = TypeReg h.Size = fi.Size() case fi.IsDir(): h.Typeflag = TypeDir h.Name += "/" case fm&os.ModeSymlink != 0: h.Typeflag = TypeSymlink h.Linkname = link case fm&os.ModeDevice != 0: if fm&os.ModeCharDevice != 0 { h.Typeflag = TypeChar } else { h.Typeflag = TypeBlock } case fm&os.ModeNamedPipe != 0: h.Typeflag = TypeFifo case fm&os.ModeSocket != 0: return nil, fmt.Errorf("archive/tar: sockets not supported") default: return nil, fmt.Errorf("archive/tar: unknown file mode %v", fm) } if fm&os.ModeSetuid != 0 { h.Mode |= c_ISUID } if fm&os.ModeSetgid != 0 { h.Mode |= c_ISGID } if fm&os.ModeSticky != 0 { h.Mode |= c_ISVTX } // If possible, populate additional fields from OS-specific // FileInfo fields. if sys, ok := fi.Sys().(*Header); ok { // This FileInfo came from a Header (not the OS). Use the // original Header to populate all remaining fields. h.Uid = sys.Uid h.Gid = sys.Gid h.Uname = sys.Uname h.Gname = sys.Gname h.AccessTime = sys.AccessTime h.ChangeTime = sys.ChangeTime if sys.Xattrs != nil { h.Xattrs = make(map[string]string) for k, v := range sys.Xattrs { h.Xattrs[k] = v } } if sys.Typeflag == TypeLink { // hard link h.Typeflag = TypeLink h.Size = 0 h.Linkname = sys.Linkname } if sys.PAXRecords != nil { h.PAXRecords = make(map[string]string) for k, v := range sys.PAXRecords { h.PAXRecords[k] = v } } } if sysStat != nil { return h, sysStat(fi, h) } return h, nil } // isHeaderOnlyType checks if the given type flag is of the type that has no // data section even if a size is specified. func isHeaderOnlyType(flag byte) bool { switch flag { case TypeLink, TypeSymlink, TypeChar, TypeBlock, TypeDir, TypeFifo: return true default: return false } } func min(a, b int64) int64 { if a < b { return a } return b } ================================================ FILE: vendor/github.com/vbatts/tar-split/archive/tar/format.go ================================================ // Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package tar import "strings" // Format represents the tar archive format. // // The original tar format was introduced in Unix V7. // Since then, there have been multiple competing formats attempting to // standardize or extend the V7 format to overcome its limitations. // The most common formats are the USTAR, PAX, and GNU formats, // each with their own advantages and limitations. // // The following table captures the capabilities of each format: // // | USTAR | PAX | GNU // ------------------+--------+-----------+---------- // Name | 256B | unlimited | unlimited // Linkname | 100B | unlimited | unlimited // Size | uint33 | unlimited | uint89 // Mode | uint21 | uint21 | uint57 // Uid/Gid | uint21 | unlimited | uint57 // Uname/Gname | 32B | unlimited | 32B // ModTime | uint33 | unlimited | int89 // AccessTime | n/a | unlimited | int89 // ChangeTime | n/a | unlimited | int89 // Devmajor/Devminor | uint21 | uint21 | uint57 // ------------------+--------+-----------+---------- // string encoding | ASCII | UTF-8 | binary // sub-second times | no | yes | no // sparse files | no | yes | yes // // The table's upper portion shows the Header fields, where each format reports // the maximum number of bytes allowed for each string field and // the integer type used to store each numeric field // (where timestamps are stored as the number of seconds since the Unix epoch). // // The table's lower portion shows specialized features of each format, // such as supported string encodings, support for sub-second timestamps, // or support for sparse files. // // The Writer currently provides no support for sparse files. type Format int // Constants to identify various tar formats. const ( // Deliberately hide the meaning of constants from public API. _ Format = (1 << iota) / 4 // Sequence of 0, 0, 1, 2, 4, 8, etc... // FormatUnknown indicates that the format is unknown. FormatUnknown // The format of the original Unix V7 tar tool prior to standardization. formatV7 // FormatUSTAR represents the USTAR header format defined in POSIX.1-1988. // // While this format is compatible with most tar readers, // the format has several limitations making it unsuitable for some usages. // Most notably, it cannot support sparse files, files larger than 8GiB, // filenames larger than 256 characters, and non-ASCII filenames. // // Reference: // http://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html#tag_20_92_13_06 FormatUSTAR // FormatPAX represents the PAX header format defined in POSIX.1-2001. // // PAX extends USTAR by writing a special file with Typeflag TypeXHeader // preceding the original header. This file contains a set of key-value // records, which are used to overcome USTAR's shortcomings, in addition to // providing the ability to have sub-second resolution for timestamps. // // Some newer formats add their own extensions to PAX by defining their // own keys and assigning certain semantic meaning to the associated values. // For example, sparse file support in PAX is implemented using keys // defined by the GNU manual (e.g., "GNU.sparse.map"). // // Reference: // http://pubs.opengroup.org/onlinepubs/009695399/utilities/pax.html FormatPAX // FormatGNU represents the GNU header format. // // The GNU header format is older than the USTAR and PAX standards and // is not compatible with them. The GNU format supports // arbitrary file sizes, filenames of arbitrary encoding and length, // sparse files, and other features. // // It is recommended that PAX be chosen over GNU unless the target // application can only parse GNU formatted archives. // // Reference: // https://www.gnu.org/software/tar/manual/html_node/Standard.html FormatGNU // Schily's tar format, which is incompatible with USTAR. // This does not cover STAR extensions to the PAX format; these fall under // the PAX format. formatSTAR formatMax ) func (f Format) has(f2 Format) bool { return f&f2 != 0 } func (f *Format) mayBe(f2 Format) { *f |= f2 } func (f *Format) mayOnlyBe(f2 Format) { *f &= f2 } func (f *Format) mustNotBe(f2 Format) { *f &^= f2 } var formatNames = map[Format]string{ formatV7: "V7", FormatUSTAR: "USTAR", FormatPAX: "PAX", FormatGNU: "GNU", formatSTAR: "STAR", } func (f Format) String() string { var ss []string for f2 := Format(1); f2 < formatMax; f2 <<= 1 { if f.has(f2) { ss = append(ss, formatNames[f2]) } } switch len(ss) { case 0: return "" case 1: return ss[0] default: return "(" + strings.Join(ss, " | ") + ")" } } // Magics used to identify various formats. const ( magicGNU, versionGNU = "ustar ", " \x00" magicUSTAR, versionUSTAR = "ustar\x00", "00" trailerSTAR = "tar\x00" ) // Size constants from various tar specifications. const ( blockSize = 512 // Size of each block in a tar stream nameSize = 100 // Max length of the name field in USTAR format prefixSize = 155 // Max length of the prefix field in USTAR format // Max length of a special file (PAX header, GNU long name or link). // This matches the limit used by libarchive. maxSpecialFileSize = 1 << 20 ) // blockPadding computes the number of bytes needed to pad offset up to the // nearest block edge where 0 <= n < blockSize. func blockPadding(offset int64) (n int64) { return -offset & (blockSize - 1) } var zeroBlock block type block [blockSize]byte // Convert block to any number of formats. func (b *block) V7() *headerV7 { return (*headerV7)(b) } func (b *block) GNU() *headerGNU { return (*headerGNU)(b) } func (b *block) STAR() *headerSTAR { return (*headerSTAR)(b) } func (b *block) USTAR() *headerUSTAR { return (*headerUSTAR)(b) } func (b *block) Sparse() sparseArray { return (sparseArray)(b[:]) } // GetFormat checks that the block is a valid tar header based on the checksum. // It then attempts to guess the specific format based on magic values. // If the checksum fails, then FormatUnknown is returned. func (b *block) GetFormat() Format { // Verify checksum. var p parser value := p.parseOctal(b.V7().Chksum()) chksum1, chksum2 := b.ComputeChecksum() if p.err != nil || (value != chksum1 && value != chksum2) { return FormatUnknown } // Guess the magic values. magic := string(b.USTAR().Magic()) version := string(b.USTAR().Version()) trailer := string(b.STAR().Trailer()) switch { case magic == magicUSTAR && trailer == trailerSTAR: return formatSTAR case magic == magicUSTAR: return FormatUSTAR | FormatPAX case magic == magicGNU && version == versionGNU: return FormatGNU default: return formatV7 } } // SetFormat writes the magic values necessary for specified format // and then updates the checksum accordingly. func (b *block) SetFormat(format Format) { // Set the magic values. switch { case format.has(formatV7): // Do nothing. case format.has(FormatGNU): copy(b.GNU().Magic(), magicGNU) copy(b.GNU().Version(), versionGNU) case format.has(formatSTAR): copy(b.STAR().Magic(), magicUSTAR) copy(b.STAR().Version(), versionUSTAR) copy(b.STAR().Trailer(), trailerSTAR) case format.has(FormatUSTAR | FormatPAX): copy(b.USTAR().Magic(), magicUSTAR) copy(b.USTAR().Version(), versionUSTAR) default: panic("invalid format") } // Update checksum. // This field is special in that it is terminated by a NULL then space. var f formatter field := b.V7().Chksum() chksum, _ := b.ComputeChecksum() // Possible values are 256..128776 f.formatOctal(field[:7], chksum) // Never fails since 128776 < 262143 field[7] = ' ' } // ComputeChecksum computes the checksum for the header block. // POSIX specifies a sum of the unsigned byte values, but the Sun tar used // signed byte values. // We compute and return both. func (b *block) ComputeChecksum() (unsigned, signed int64) { for i, c := range b { if 148 <= i && i < 156 { c = ' ' // Treat the checksum field itself as all spaces. } unsigned += int64(c) signed += int64(int8(c)) } return unsigned, signed } // Reset clears the block with all zeros. func (b *block) Reset() { *b = block{} } type headerV7 [blockSize]byte func (h *headerV7) Name() []byte { return h[000:][:100] } func (h *headerV7) Mode() []byte { return h[100:][:8] } func (h *headerV7) UID() []byte { return h[108:][:8] } func (h *headerV7) GID() []byte { return h[116:][:8] } func (h *headerV7) Size() []byte { return h[124:][:12] } func (h *headerV7) ModTime() []byte { return h[136:][:12] } func (h *headerV7) Chksum() []byte { return h[148:][:8] } func (h *headerV7) TypeFlag() []byte { return h[156:][:1] } func (h *headerV7) LinkName() []byte { return h[157:][:100] } type headerGNU [blockSize]byte func (h *headerGNU) V7() *headerV7 { return (*headerV7)(h) } func (h *headerGNU) Magic() []byte { return h[257:][:6] } func (h *headerGNU) Version() []byte { return h[263:][:2] } func (h *headerGNU) UserName() []byte { return h[265:][:32] } func (h *headerGNU) GroupName() []byte { return h[297:][:32] } func (h *headerGNU) DevMajor() []byte { return h[329:][:8] } func (h *headerGNU) DevMinor() []byte { return h[337:][:8] } func (h *headerGNU) AccessTime() []byte { return h[345:][:12] } func (h *headerGNU) ChangeTime() []byte { return h[357:][:12] } func (h *headerGNU) Sparse() sparseArray { return (sparseArray)(h[386:][:24*4+1]) } func (h *headerGNU) RealSize() []byte { return h[483:][:12] } type headerSTAR [blockSize]byte func (h *headerSTAR) V7() *headerV7 { return (*headerV7)(h) } func (h *headerSTAR) Magic() []byte { return h[257:][:6] } func (h *headerSTAR) Version() []byte { return h[263:][:2] } func (h *headerSTAR) UserName() []byte { return h[265:][:32] } func (h *headerSTAR) GroupName() []byte { return h[297:][:32] } func (h *headerSTAR) DevMajor() []byte { return h[329:][:8] } func (h *headerSTAR) DevMinor() []byte { return h[337:][:8] } func (h *headerSTAR) Prefix() []byte { return h[345:][:131] } func (h *headerSTAR) AccessTime() []byte { return h[476:][:12] } func (h *headerSTAR) ChangeTime() []byte { return h[488:][:12] } func (h *headerSTAR) Trailer() []byte { return h[508:][:4] } type headerUSTAR [blockSize]byte func (h *headerUSTAR) V7() *headerV7 { return (*headerV7)(h) } func (h *headerUSTAR) Magic() []byte { return h[257:][:6] } func (h *headerUSTAR) Version() []byte { return h[263:][:2] } func (h *headerUSTAR) UserName() []byte { return h[265:][:32] } func (h *headerUSTAR) GroupName() []byte { return h[297:][:32] } func (h *headerUSTAR) DevMajor() []byte { return h[329:][:8] } func (h *headerUSTAR) DevMinor() []byte { return h[337:][:8] } func (h *headerUSTAR) Prefix() []byte { return h[345:][:155] } type sparseArray []byte func (s sparseArray) Entry(i int) sparseElem { return (sparseElem)(s[i*24:]) } func (s sparseArray) IsExtended() []byte { return s[24*s.MaxEntries():][:1] } func (s sparseArray) MaxEntries() int { return len(s) / 24 } type sparseElem []byte func (s sparseElem) Offset() []byte { return s[00:][:12] } func (s sparseElem) Length() []byte { return s[12:][:12] } ================================================ FILE: vendor/github.com/vbatts/tar-split/archive/tar/reader.go ================================================ // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package tar import ( "bytes" "io" "strconv" "strings" "time" ) // Reader provides sequential access to the contents of a tar archive. // Reader.Next advances to the next file in the archive (including the first), // and then Reader can be treated as an io.Reader to access the file's data. type Reader struct { r io.Reader pad int64 // Amount of padding (ignored) after current file entry curr fileReader // Reader for current file entry blk block // Buffer to use as temporary local storage // err is a persistent error. // It is only the responsibility of every exported method of Reader to // ensure that this error is sticky. err error RawAccounting bool // Whether to enable the access needed to reassemble the tar from raw bytes. Some performance/memory hit for this. rawBytes *bytes.Buffer // last raw bits } type fileReader interface { io.Reader fileState WriteTo(io.Writer) (int64, error) } // RawBytes accesses the raw bytes of the archive, apart from the file payload itself. // This includes the header and padding. // // # This call resets the current rawbytes buffer // // Only when RawAccounting is enabled, otherwise this returns nil func (tr *Reader) RawBytes() []byte { if !tr.RawAccounting { return nil } if tr.rawBytes == nil { tr.rawBytes = bytes.NewBuffer(nil) } defer tr.rawBytes.Reset() // if we've read them, then flush them. return tr.rawBytes.Bytes() } // ExpectedPadding returns the number of bytes of padding expected after the last header returned by Next() func (tr *Reader) ExpectedPadding() int64 { return tr.pad } // NewReader creates a new Reader reading from r. func NewReader(r io.Reader) *Reader { return &Reader{r: r, curr: ®FileReader{r, 0}} } // Next advances to the next entry in the tar archive. // The Header.Size determines how many bytes can be read for the next file. // Any remaining data in the current file is automatically discarded. // // io.EOF is returned at the end of the input. func (tr *Reader) Next() (*Header, error) { if tr.err != nil { return nil, tr.err } hdr, err := tr.next() tr.err = err return hdr, err } func (tr *Reader) next() (*Header, error) { var paxHdrs map[string]string var gnuLongName, gnuLongLink string if tr.RawAccounting { if tr.rawBytes == nil { tr.rawBytes = bytes.NewBuffer(nil) } else { tr.rawBytes.Reset() } } // Externally, Next iterates through the tar archive as if it is a series of // files. Internally, the tar format often uses fake "files" to add meta // data that describes the next file. These meta data "files" should not // normally be visible to the outside. As such, this loop iterates through // one or more "header files" until it finds a "normal file". format := FormatUSTAR | FormatPAX | FormatGNU for { // Discard the remainder of the file and any padding. if err := discard(tr, tr.curr.PhysicalRemaining()); err != nil { return nil, err } n, err := tryReadFull(tr.r, tr.blk[:tr.pad]) if err != nil { return nil, err } if tr.RawAccounting { tr.rawBytes.Write(tr.blk[:n]) } tr.pad = 0 hdr, rawHdr, err := tr.readHeader() if err != nil { return nil, err } if err := tr.handleRegularFile(hdr); err != nil { return nil, err } format.mayOnlyBe(hdr.Format) // Check for PAX/GNU special headers and files. switch hdr.Typeflag { case TypeXHeader, TypeXGlobalHeader: format.mayOnlyBe(FormatPAX) paxHdrs, err = parsePAX(tr) if err != nil { return nil, err } if hdr.Typeflag == TypeXGlobalHeader { if err = mergePAX(hdr, paxHdrs); err != nil { return nil, err } return &Header{ Name: hdr.Name, Typeflag: hdr.Typeflag, Xattrs: hdr.Xattrs, PAXRecords: hdr.PAXRecords, Format: format, }, nil } continue // This is a meta header affecting the next header case TypeGNULongName, TypeGNULongLink: format.mayOnlyBe(FormatGNU) realname, err := readSpecialFile(tr) if err != nil { return nil, err } if tr.RawAccounting { tr.rawBytes.Write(realname) } var p parser switch hdr.Typeflag { case TypeGNULongName: gnuLongName = p.parseString(realname) case TypeGNULongLink: gnuLongLink = p.parseString(realname) } continue // This is a meta header affecting the next header default: // The old GNU sparse format is handled here since it is technically // just a regular file with additional attributes. if err := mergePAX(hdr, paxHdrs); err != nil { return nil, err } if gnuLongName != "" { hdr.Name = gnuLongName } if gnuLongLink != "" { hdr.Linkname = gnuLongLink } if hdr.Typeflag == TypeRegA { if strings.HasSuffix(hdr.Name, "/") { hdr.Typeflag = TypeDir // Legacy archives use trailing slash for directories } else { hdr.Typeflag = TypeReg } } // The extended headers may have updated the size. // Thus, setup the regFileReader again after merging PAX headers. if err := tr.handleRegularFile(hdr); err != nil { return nil, err } // Sparse formats rely on being able to read from the logical data // section; there must be a preceding call to handleRegularFile. if err := tr.handleSparseFile(hdr, rawHdr); err != nil { return nil, err } // Set the final guess at the format. if format.has(FormatUSTAR) && format.has(FormatPAX) { format.mayOnlyBe(FormatUSTAR) } hdr.Format = format return hdr, nil // This is a file, so stop } } } // handleRegularFile sets up the current file reader and padding such that it // can only read the following logical data section. It will properly handle // special headers that contain no data section. func (tr *Reader) handleRegularFile(hdr *Header) error { nb := hdr.Size if isHeaderOnlyType(hdr.Typeflag) { nb = 0 } if nb < 0 { return ErrHeader } tr.pad = blockPadding(nb) tr.curr = ®FileReader{r: tr.r, nb: nb} return nil } // handleSparseFile checks if the current file is a sparse format of any type // and sets the curr reader appropriately. func (tr *Reader) handleSparseFile(hdr *Header, rawHdr *block) error { var spd sparseDatas var err error if hdr.Typeflag == TypeGNUSparse { spd, err = tr.readOldGNUSparseMap(hdr, rawHdr) } else { spd, err = tr.readGNUSparsePAXHeaders(hdr) } // If sp is non-nil, then this is a sparse file. // Note that it is possible for len(sp) == 0. if err == nil && spd != nil { if isHeaderOnlyType(hdr.Typeflag) || !validateSparseEntries(spd, hdr.Size) { return ErrHeader } sph := invertSparseEntries(spd, hdr.Size) tr.curr = &sparseFileReader{tr.curr, sph, 0} } return err } // readGNUSparsePAXHeaders checks the PAX headers for GNU sparse headers. // If they are found, then this function reads the sparse map and returns it. // This assumes that 0.0 headers have already been converted to 0.1 headers // by the PAX header parsing logic. func (tr *Reader) readGNUSparsePAXHeaders(hdr *Header) (sparseDatas, error) { // Identify the version of GNU headers. var is1x0 bool major, minor := hdr.PAXRecords[paxGNUSparseMajor], hdr.PAXRecords[paxGNUSparseMinor] switch { case major == "0" && (minor == "0" || minor == "1"): is1x0 = false case major == "1" && minor == "0": is1x0 = true case major != "" || minor != "": return nil, nil // Unknown GNU sparse PAX version case hdr.PAXRecords[paxGNUSparseMap] != "": is1x0 = false // 0.0 and 0.1 did not have explicit version records, so guess default: return nil, nil // Not a PAX format GNU sparse file. } hdr.Format.mayOnlyBe(FormatPAX) // Update hdr from GNU sparse PAX headers. if name := hdr.PAXRecords[paxGNUSparseName]; name != "" { hdr.Name = name } size := hdr.PAXRecords[paxGNUSparseSize] if size == "" { size = hdr.PAXRecords[paxGNUSparseRealSize] } if size != "" { n, err := strconv.ParseInt(size, 10, 64) if err != nil { return nil, ErrHeader } hdr.Size = n } // Read the sparse map according to the appropriate format. if is1x0 { return readGNUSparseMap1x0(tr.curr) } return readGNUSparseMap0x1(hdr.PAXRecords) } // mergePAX merges paxHdrs into hdr for all relevant fields of Header. func mergePAX(hdr *Header, paxHdrs map[string]string) (err error) { for k, v := range paxHdrs { if v == "" { continue // Keep the original USTAR value } var id64 int64 switch k { case paxPath: hdr.Name = v case paxLinkpath: hdr.Linkname = v case paxUname: hdr.Uname = v case paxGname: hdr.Gname = v case paxUid: id64, err = strconv.ParseInt(v, 10, 64) hdr.Uid = int(id64) // Integer overflow possible case paxGid: id64, err = strconv.ParseInt(v, 10, 64) hdr.Gid = int(id64) // Integer overflow possible case paxAtime: hdr.AccessTime, err = parsePAXTime(v) case paxMtime: hdr.ModTime, err = parsePAXTime(v) case paxCtime: hdr.ChangeTime, err = parsePAXTime(v) case paxSize: hdr.Size, err = strconv.ParseInt(v, 10, 64) default: if strings.HasPrefix(k, paxSchilyXattr) { if hdr.Xattrs == nil { hdr.Xattrs = make(map[string]string) } hdr.Xattrs[k[len(paxSchilyXattr):]] = v } } if err != nil { return ErrHeader } } hdr.PAXRecords = paxHdrs return nil } // parsePAX parses PAX headers. // If an extended header (type 'x') is invalid, ErrHeader is returned func parsePAX(r io.Reader) (map[string]string, error) { buf, err := readSpecialFile(r) if err != nil { return nil, err } // leaving this function for io.Reader makes it more testable if tr, ok := r.(*Reader); ok && tr.RawAccounting { if _, err = tr.rawBytes.Write(buf); err != nil { return nil, err } } sbuf := string(buf) // For GNU PAX sparse format 0.0 support. // This function transforms the sparse format 0.0 headers into format 0.1 // headers since 0.0 headers were not PAX compliant. var sparseMap []string paxHdrs := make(map[string]string) for len(sbuf) > 0 { key, value, residual, err := parsePAXRecord(sbuf) if err != nil { return nil, ErrHeader } sbuf = residual switch key { case paxGNUSparseOffset, paxGNUSparseNumBytes: // Validate sparse header order and value. if (len(sparseMap)%2 == 0 && key != paxGNUSparseOffset) || (len(sparseMap)%2 == 1 && key != paxGNUSparseNumBytes) || strings.Contains(value, ",") { return nil, ErrHeader } sparseMap = append(sparseMap, value) default: paxHdrs[key] = value } } if len(sparseMap) > 0 { paxHdrs[paxGNUSparseMap] = strings.Join(sparseMap, ",") } return paxHdrs, nil } // readHeader reads the next block header and assumes that the underlying reader // is already aligned to a block boundary. It returns the raw block of the // header in case further processing is required. // // The err will be set to io.EOF only when one of the following occurs: // - Exactly 0 bytes are read and EOF is hit. // - Exactly 1 block of zeros is read and EOF is hit. // - At least 2 blocks of zeros are read. func (tr *Reader) readHeader() (*Header, *block, error) { // Two blocks of zero bytes marks the end of the archive. n, err := io.ReadFull(tr.r, tr.blk[:]) if tr.RawAccounting && (err == nil || err == io.EOF) { tr.rawBytes.Write(tr.blk[:n]) } if err != nil { return nil, nil, err // EOF is okay here; exactly 0 bytes read } if bytes.Equal(tr.blk[:], zeroBlock[:]) { n, err = io.ReadFull(tr.r, tr.blk[:]) if tr.RawAccounting && (err == nil || err == io.EOF) { tr.rawBytes.Write(tr.blk[:n]) } if err != nil { return nil, nil, err // EOF is okay here; exactly 1 block of zeros read } if bytes.Equal(tr.blk[:], zeroBlock[:]) { return nil, nil, io.EOF // normal EOF; exactly 2 block of zeros read } return nil, nil, ErrHeader // Zero block and then non-zero block } // Verify the header matches a known format. format := tr.blk.GetFormat() if format == FormatUnknown { return nil, nil, ErrHeader } var p parser hdr := new(Header) // Unpack the V7 header. v7 := tr.blk.V7() hdr.Typeflag = v7.TypeFlag()[0] hdr.Name = p.parseString(v7.Name()) hdr.Linkname = p.parseString(v7.LinkName()) hdr.Size = p.parseNumeric(v7.Size()) hdr.Mode = p.parseNumeric(v7.Mode()) hdr.Uid = int(p.parseNumeric(v7.UID())) hdr.Gid = int(p.parseNumeric(v7.GID())) hdr.ModTime = time.Unix(p.parseNumeric(v7.ModTime()), 0) // Unpack format specific fields. if format > formatV7 { ustar := tr.blk.USTAR() hdr.Uname = p.parseString(ustar.UserName()) hdr.Gname = p.parseString(ustar.GroupName()) hdr.Devmajor = p.parseNumeric(ustar.DevMajor()) hdr.Devminor = p.parseNumeric(ustar.DevMinor()) var prefix string switch { case format.has(FormatUSTAR | FormatPAX): hdr.Format = format ustar := tr.blk.USTAR() prefix = p.parseString(ustar.Prefix()) // For Format detection, check if block is properly formatted since // the parser is more liberal than what USTAR actually permits. notASCII := func(r rune) bool { return r >= 0x80 } if bytes.IndexFunc(tr.blk[:], notASCII) >= 0 { hdr.Format = FormatUnknown // Non-ASCII characters in block. } nul := func(b []byte) bool { return int(b[len(b)-1]) == 0 } if !(nul(v7.Size()) && nul(v7.Mode()) && nul(v7.UID()) && nul(v7.GID()) && nul(v7.ModTime()) && nul(ustar.DevMajor()) && nul(ustar.DevMinor())) { hdr.Format = FormatUnknown // Numeric fields must end in NUL } case format.has(formatSTAR): star := tr.blk.STAR() prefix = p.parseString(star.Prefix()) hdr.AccessTime = time.Unix(p.parseNumeric(star.AccessTime()), 0) hdr.ChangeTime = time.Unix(p.parseNumeric(star.ChangeTime()), 0) case format.has(FormatGNU): hdr.Format = format var p2 parser gnu := tr.blk.GNU() if b := gnu.AccessTime(); b[0] != 0 { hdr.AccessTime = time.Unix(p2.parseNumeric(b), 0) } if b := gnu.ChangeTime(); b[0] != 0 { hdr.ChangeTime = time.Unix(p2.parseNumeric(b), 0) } // Prior to Go1.8, the Writer had a bug where it would output // an invalid tar file in certain rare situations because the logic // incorrectly believed that the old GNU format had a prefix field. // This is wrong and leads to an output file that mangles the // atime and ctime fields, which are often left unused. // // In order to continue reading tar files created by former, buggy // versions of Go, we skeptically parse the atime and ctime fields. // If we are unable to parse them and the prefix field looks like // an ASCII string, then we fallback on the pre-Go1.8 behavior // of treating these fields as the USTAR prefix field. // // Note that this will not use the fallback logic for all possible // files generated by a pre-Go1.8 toolchain. If the generated file // happened to have a prefix field that parses as valid // atime and ctime fields (e.g., when they are valid octal strings), // then it is impossible to distinguish between an valid GNU file // and an invalid pre-Go1.8 file. // // See https://golang.org/issues/12594 // See https://golang.org/issues/21005 if p2.err != nil { hdr.AccessTime, hdr.ChangeTime = time.Time{}, time.Time{} ustar := tr.blk.USTAR() if s := p.parseString(ustar.Prefix()); isASCII(s) { prefix = s } hdr.Format = FormatUnknown // Buggy file is not GNU } } if len(prefix) > 0 { hdr.Name = prefix + "/" + hdr.Name } } return hdr, &tr.blk, p.err } // readOldGNUSparseMap reads the sparse map from the old GNU sparse format. // The sparse map is stored in the tar header if it's small enough. // If it's larger than four entries, then one or more extension headers are used // to store the rest of the sparse map. // // The Header.Size does not reflect the size of any extended headers used. // Thus, this function will read from the raw io.Reader to fetch extra headers. // This method mutates blk in the process. func (tr *Reader) readOldGNUSparseMap(hdr *Header, blk *block) (sparseDatas, error) { // Make sure that the input format is GNU. // Unfortunately, the STAR format also has a sparse header format that uses // the same type flag but has a completely different layout. if blk.GetFormat() != FormatGNU { return nil, ErrHeader } hdr.Format.mayOnlyBe(FormatGNU) var p parser hdr.Size = p.parseNumeric(blk.GNU().RealSize()) if p.err != nil { return nil, p.err } s := blk.GNU().Sparse() spd := make(sparseDatas, 0, s.MaxEntries()) for { for i := 0; i < s.MaxEntries(); i++ { // This termination condition is identical to GNU and BSD tar. if s.Entry(i).Offset()[0] == 0x00 { break // Don't return, need to process extended headers (even if empty) } offset := p.parseNumeric(s.Entry(i).Offset()) length := p.parseNumeric(s.Entry(i).Length()) if p.err != nil { return nil, p.err } spd = append(spd, sparseEntry{Offset: offset, Length: length}) } if s.IsExtended()[0] > 0 { // There are more entries. Read an extension header and parse its entries. if _, err := mustReadFull(tr.r, blk[:]); err != nil { return nil, err } if tr.RawAccounting { tr.rawBytes.Write(blk[:]) } s = blk.Sparse() continue } return spd, nil // Done } } // readGNUSparseMap1x0 reads the sparse map as stored in GNU's PAX sparse format // version 1.0. The format of the sparse map consists of a series of // newline-terminated numeric fields. The first field is the number of entries // and is always present. Following this are the entries, consisting of two // fields (offset, length). This function must stop reading at the end // boundary of the block containing the last newline. // // Note that the GNU manual says that numeric values should be encoded in octal // format. However, the GNU tar utility itself outputs these values in decimal. // As such, this library treats values as being encoded in decimal. func readGNUSparseMap1x0(r io.Reader) (sparseDatas, error) { var ( cntNewline int64 buf bytes.Buffer blk block totalSize int ) // feedTokens copies data in blocks from r into buf until there are // at least cnt newlines in buf. It will not read more blocks than needed. feedTokens := func(n int64) error { for cntNewline < n { totalSize += len(blk) if totalSize > maxSpecialFileSize { return errSparseTooLong } if _, err := mustReadFull(r, blk[:]); err != nil { return err } buf.Write(blk[:]) for _, c := range blk { if c == '\n' { cntNewline++ } } } return nil } // nextToken gets the next token delimited by a newline. This assumes that // at least one newline exists in the buffer. nextToken := func() string { cntNewline-- tok, _ := buf.ReadString('\n') return strings.TrimRight(tok, "\n") } // Parse for the number of entries. // Use integer overflow resistant math to check this. if err := feedTokens(1); err != nil { return nil, err } numEntries, err := strconv.ParseInt(nextToken(), 10, 0) // Intentionally parse as native int if err != nil || numEntries < 0 || int(2*numEntries) < int(numEntries) { return nil, ErrHeader } // Parse for all member entries. // numEntries is trusted after this since feedTokens limits the number of // tokens based on maxSpecialFileSize. if err := feedTokens(2 * numEntries); err != nil { return nil, err } spd := make(sparseDatas, 0, numEntries) for i := int64(0); i < numEntries; i++ { offset, err1 := strconv.ParseInt(nextToken(), 10, 64) length, err2 := strconv.ParseInt(nextToken(), 10, 64) if err1 != nil || err2 != nil { return nil, ErrHeader } spd = append(spd, sparseEntry{Offset: offset, Length: length}) } return spd, nil } // readGNUSparseMap0x1 reads the sparse map as stored in GNU's PAX sparse format // version 0.1. The sparse map is stored in the PAX headers. func readGNUSparseMap0x1(paxHdrs map[string]string) (sparseDatas, error) { // Get number of entries. // Use integer overflow resistant math to check this. numEntriesStr := paxHdrs[paxGNUSparseNumBlocks] numEntries, err := strconv.ParseInt(numEntriesStr, 10, 0) // Intentionally parse as native int if err != nil || numEntries < 0 || int(2*numEntries) < int(numEntries) { return nil, ErrHeader } // There should be two numbers in sparseMap for each entry. sparseMap := strings.Split(paxHdrs[paxGNUSparseMap], ",") if len(sparseMap) == 1 && sparseMap[0] == "" { sparseMap = sparseMap[:0] } if int64(len(sparseMap)) != 2*numEntries { return nil, ErrHeader } // Loop through the entries in the sparse map. // numEntries is trusted now. spd := make(sparseDatas, 0, numEntries) for len(sparseMap) >= 2 { offset, err1 := strconv.ParseInt(sparseMap[0], 10, 64) length, err2 := strconv.ParseInt(sparseMap[1], 10, 64) if err1 != nil || err2 != nil { return nil, ErrHeader } spd = append(spd, sparseEntry{Offset: offset, Length: length}) sparseMap = sparseMap[2:] } return spd, nil } // Read reads from the current file in the tar archive. // It returns (0, io.EOF) when it reaches the end of that file, // until Next is called to advance to the next file. // // If the current file is sparse, then the regions marked as a hole // are read back as NUL-bytes. // // Calling Read on special types like TypeLink, TypeSymlink, TypeChar, // TypeBlock, TypeDir, and TypeFifo returns (0, io.EOF) regardless of what // the Header.Size claims. func (tr *Reader) Read(b []byte) (int, error) { if tr.err != nil { return 0, tr.err } n, err := tr.curr.Read(b) if err != nil && err != io.EOF { tr.err = err } return n, err } // writeTo writes the content of the current file to w. // The bytes written matches the number of remaining bytes in the current file. // // If the current file is sparse and w is an io.WriteSeeker, // then writeTo uses Seek to skip past holes defined in Header.SparseHoles, // assuming that skipped regions are filled with NULs. // This always writes the last byte to ensure w is the right size. // // TODO(dsnet): Re-export this when adding sparse file support. // See https://golang.org/issue/22735 func (tr *Reader) writeTo(w io.Writer) (int64, error) { if tr.err != nil { return 0, tr.err } n, err := tr.curr.WriteTo(w) if err != nil { tr.err = err } return n, err } // regFileReader is a fileReader for reading data from a regular file entry. type regFileReader struct { r io.Reader // Underlying Reader nb int64 // Number of remaining bytes to read } func (fr *regFileReader) Read(b []byte) (n int, err error) { if int64(len(b)) > fr.nb { b = b[:fr.nb] } if len(b) > 0 { n, err = fr.r.Read(b) fr.nb -= int64(n) } switch { case err == io.EOF && fr.nb > 0: return n, io.ErrUnexpectedEOF case err == nil && fr.nb == 0: return n, io.EOF default: return n, err } } func (fr *regFileReader) WriteTo(w io.Writer) (int64, error) { return io.Copy(w, struct{ io.Reader }{fr}) } func (fr regFileReader) LogicalRemaining() int64 { return fr.nb } func (fr regFileReader) PhysicalRemaining() int64 { return fr.nb } // sparseFileReader is a fileReader for reading data from a sparse file entry. type sparseFileReader struct { fr fileReader // Underlying fileReader sp sparseHoles // Normalized list of sparse holes pos int64 // Current position in sparse file } func (sr *sparseFileReader) Read(b []byte) (n int, err error) { finished := int64(len(b)) >= sr.LogicalRemaining() if finished { b = b[:sr.LogicalRemaining()] } b0 := b endPos := sr.pos + int64(len(b)) for endPos > sr.pos && err == nil { var nf int // Bytes read in fragment holeStart, holeEnd := sr.sp[0].Offset, sr.sp[0].endOffset() if sr.pos < holeStart { // In a data fragment bf := b[:min(int64(len(b)), holeStart-sr.pos)] nf, err = tryReadFull(sr.fr, bf) } else { // In a hole fragment bf := b[:min(int64(len(b)), holeEnd-sr.pos)] nf, err = tryReadFull(zeroReader{}, bf) } b = b[nf:] sr.pos += int64(nf) if sr.pos >= holeEnd && len(sr.sp) > 1 { sr.sp = sr.sp[1:] // Ensure last fragment always remains } } n = len(b0) - len(b) switch { case err == io.EOF: return n, errMissData // Less data in dense file than sparse file case err != nil: return n, err case sr.LogicalRemaining() == 0 && sr.PhysicalRemaining() > 0: return n, errUnrefData // More data in dense file than sparse file case finished: return n, io.EOF default: return n, nil } } func (sr *sparseFileReader) WriteTo(w io.Writer) (n int64, err error) { ws, ok := w.(io.WriteSeeker) if ok { if _, err := ws.Seek(0, io.SeekCurrent); err != nil { ok = false // Not all io.Seeker can really seek } } if !ok { return io.Copy(w, struct{ io.Reader }{sr}) } var writeLastByte bool pos0 := sr.pos for sr.LogicalRemaining() > 0 && !writeLastByte && err == nil { var nf int64 // Size of fragment holeStart, holeEnd := sr.sp[0].Offset, sr.sp[0].endOffset() if sr.pos < holeStart { // In a data fragment nf = holeStart - sr.pos nf, err = io.CopyN(ws, sr.fr, nf) } else { // In a hole fragment nf = holeEnd - sr.pos if sr.PhysicalRemaining() == 0 { writeLastByte = true nf-- } _, err = ws.Seek(nf, io.SeekCurrent) } sr.pos += nf if sr.pos >= holeEnd && len(sr.sp) > 1 { sr.sp = sr.sp[1:] // Ensure last fragment always remains } } // If the last fragment is a hole, then seek to 1-byte before EOF, and // write a single byte to ensure the file is the right size. if writeLastByte && err == nil { _, err = ws.Write([]byte{0}) sr.pos++ } n = sr.pos - pos0 switch { case err == io.EOF: return n, errMissData // Less data in dense file than sparse file case err != nil: return n, err case sr.LogicalRemaining() == 0 && sr.PhysicalRemaining() > 0: return n, errUnrefData // More data in dense file than sparse file default: return n, nil } } func (sr sparseFileReader) LogicalRemaining() int64 { return sr.sp[len(sr.sp)-1].endOffset() - sr.pos } func (sr sparseFileReader) PhysicalRemaining() int64 { return sr.fr.PhysicalRemaining() } type zeroReader struct{} func (zeroReader) Read(b []byte) (int, error) { for i := range b { b[i] = 0 } return len(b), nil } // mustReadFull is like io.ReadFull except it returns // io.ErrUnexpectedEOF when io.EOF is hit before len(b) bytes are read. func mustReadFull(r io.Reader, b []byte) (int, error) { n, err := tryReadFull(r, b) if err == io.EOF { err = io.ErrUnexpectedEOF } return n, err } // tryReadFull is like io.ReadFull except it returns // io.EOF when it is hit before len(b) bytes are read. func tryReadFull(r io.Reader, b []byte) (n int, err error) { for len(b) > n && err == nil { var nn int nn, err = r.Read(b[n:]) n += nn } if len(b) == n && err == io.EOF { err = nil } return n, err } // readSpecialFile is like io.ReadAll except it returns // ErrFieldTooLong if more than maxSpecialFileSize is read. func readSpecialFile(r io.Reader) ([]byte, error) { buf, err := io.ReadAll(io.LimitReader(r, maxSpecialFileSize+1)) if len(buf) > maxSpecialFileSize { return nil, ErrFieldTooLong } return buf, err } // discard skips n bytes in r, reporting an error if unable to do so. func discard(tr *Reader, n int64) error { var seekSkipped, copySkipped int64 var err error r := tr.r if tr.RawAccounting { copySkipped, err = io.CopyN(tr.rawBytes, tr.r, n) goto out } // If possible, Seek to the last byte before the end of the data section. // Do this because Seek is often lazy about reporting errors; this will mask // the fact that the stream may be truncated. We can rely on the // io.CopyN done shortly afterwards to trigger any IO errors. if sr, ok := r.(io.Seeker); ok && n > 1 { // Not all io.Seeker can actually Seek. For example, os.Stdin implements // io.Seeker, but calling Seek always returns an error and performs // no action. Thus, we try an innocent seek to the current position // to see if Seek is really supported. pos1, err := sr.Seek(0, io.SeekCurrent) if pos1 >= 0 && err == nil { // Seek seems supported, so perform the real Seek. pos2, err := sr.Seek(n-1, io.SeekCurrent) if pos2 < 0 || err != nil { return err } seekSkipped = pos2 - pos1 } } copySkipped, err = io.CopyN(io.Discard, r, n-seekSkipped) out: if err == io.EOF && seekSkipped+copySkipped < n { err = io.ErrUnexpectedEOF } return err } ================================================ FILE: vendor/github.com/vbatts/tar-split/archive/tar/stat_actime1.go ================================================ // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build linux dragonfly openbsd solaris package tar import ( "syscall" "time" ) func statAtime(st *syscall.Stat_t) time.Time { return time.Unix(st.Atim.Unix()) } func statCtime(st *syscall.Stat_t) time.Time { return time.Unix(st.Ctim.Unix()) } ================================================ FILE: vendor/github.com/vbatts/tar-split/archive/tar/stat_actime2.go ================================================ // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin freebsd netbsd package tar import ( "syscall" "time" ) func statAtime(st *syscall.Stat_t) time.Time { return time.Unix(st.Atimespec.Unix()) } func statCtime(st *syscall.Stat_t) time.Time { return time.Unix(st.Ctimespec.Unix()) } ================================================ FILE: vendor/github.com/vbatts/tar-split/archive/tar/stat_unix.go ================================================ // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build linux darwin dragonfly freebsd openbsd netbsd solaris package tar import ( "os" "os/user" "runtime" "strconv" "sync" "syscall" ) func init() { sysStat = statUnix } // userMap and groupMap caches UID and GID lookups for performance reasons. // The downside is that renaming uname or gname by the OS never takes effect. var userMap, groupMap sync.Map // map[int]string func statUnix(fi os.FileInfo, h *Header) error { sys, ok := fi.Sys().(*syscall.Stat_t) if !ok { return nil } h.Uid = int(sys.Uid) h.Gid = int(sys.Gid) // Best effort at populating Uname and Gname. // The os/user functions may fail for any number of reasons // (not implemented on that platform, cgo not enabled, etc). if u, ok := userMap.Load(h.Uid); ok { h.Uname = u.(string) } else if u, err := user.LookupId(strconv.Itoa(h.Uid)); err == nil { h.Uname = u.Username userMap.Store(h.Uid, h.Uname) } if g, ok := groupMap.Load(h.Gid); ok { h.Gname = g.(string) } else if g, err := user.LookupGroupId(strconv.Itoa(h.Gid)); err == nil { h.Gname = g.Name groupMap.Store(h.Gid, h.Gname) } h.AccessTime = statAtime(sys) h.ChangeTime = statCtime(sys) // Best effort at populating Devmajor and Devminor. if h.Typeflag == TypeChar || h.Typeflag == TypeBlock { dev := uint64(sys.Rdev) // May be int32 or uint32 switch runtime.GOOS { case "linux": // Copied from golang.org/x/sys/unix/dev_linux.go. major := uint32((dev & 0x00000000000fff00) >> 8) major |= uint32((dev & 0xfffff00000000000) >> 32) minor := uint32((dev & 0x00000000000000ff) >> 0) minor |= uint32((dev & 0x00000ffffff00000) >> 12) h.Devmajor, h.Devminor = int64(major), int64(minor) case "darwin": // Copied from golang.org/x/sys/unix/dev_darwin.go. major := uint32((dev >> 24) & 0xff) minor := uint32(dev & 0xffffff) h.Devmajor, h.Devminor = int64(major), int64(minor) case "dragonfly": // Copied from golang.org/x/sys/unix/dev_dragonfly.go. major := uint32((dev >> 8) & 0xff) minor := uint32(dev & 0xffff00ff) h.Devmajor, h.Devminor = int64(major), int64(minor) case "freebsd": // Copied from golang.org/x/sys/unix/dev_freebsd.go. major := uint32((dev >> 8) & 0xff) minor := uint32(dev & 0xffff00ff) h.Devmajor, h.Devminor = int64(major), int64(minor) case "netbsd": // Copied from golang.org/x/sys/unix/dev_netbsd.go. major := uint32((dev & 0x000fff00) >> 8) minor := uint32((dev & 0x000000ff) >> 0) minor |= uint32((dev & 0xfff00000) >> 12) h.Devmajor, h.Devminor = int64(major), int64(minor) case "openbsd": // Copied from golang.org/x/sys/unix/dev_openbsd.go. major := uint32((dev & 0x0000ff00) >> 8) minor := uint32((dev & 0x000000ff) >> 0) minor |= uint32((dev & 0xffff0000) >> 8) h.Devmajor, h.Devminor = int64(major), int64(minor) default: // TODO: Implement solaris (see https://golang.org/issue/8106) } } return nil } ================================================ FILE: vendor/github.com/vbatts/tar-split/archive/tar/strconv.go ================================================ // Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package tar import ( "bytes" "fmt" "strconv" "strings" "time" ) // hasNUL reports whether the NUL character exists within s. func hasNUL(s string) bool { return strings.IndexByte(s, 0) >= 0 } // isASCII reports whether the input is an ASCII C-style string. func isASCII(s string) bool { for _, c := range s { if c >= 0x80 || c == 0x00 { return false } } return true } // toASCII converts the input to an ASCII C-style string. // This a best effort conversion, so invalid characters are dropped. func toASCII(s string) string { if isASCII(s) { return s } b := make([]byte, 0, len(s)) for _, c := range s { if c < 0x80 && c != 0x00 { b = append(b, byte(c)) } } return string(b) } type parser struct { err error // Last error seen } type formatter struct { err error // Last error seen } // parseString parses bytes as a NUL-terminated C-style string. // If a NUL byte is not found then the whole slice is returned as a string. func (*parser) parseString(b []byte) string { if i := bytes.IndexByte(b, 0); i >= 0 { return string(b[:i]) } return string(b) } // formatString copies s into b, NUL-terminating if possible. func (f *formatter) formatString(b []byte, s string) { if len(s) > len(b) { f.err = ErrFieldTooLong } copy(b, s) if len(s) < len(b) { b[len(s)] = 0 } // Some buggy readers treat regular files with a trailing slash // in the V7 path field as a directory even though the full path // recorded elsewhere (e.g., via PAX record) contains no trailing slash. if len(s) > len(b) && b[len(b)-1] == '/' { n := len(strings.TrimRight(s[:len(b)], "/")) b[n] = 0 // Replace trailing slash with NUL terminator } } // fitsInBase256 reports whether x can be encoded into n bytes using base-256 // encoding. Unlike octal encoding, base-256 encoding does not require that the // string ends with a NUL character. Thus, all n bytes are available for output. // // If operating in binary mode, this assumes strict GNU binary mode; which means // that the first byte can only be either 0x80 or 0xff. Thus, the first byte is // equivalent to the sign bit in two's complement form. func fitsInBase256(n int, x int64) bool { binBits := uint(n-1) * 8 return n >= 9 || (x >= -1< 0 && b[0]&0x80 != 0 { // Handling negative numbers relies on the following identity: // -a-1 == ^a // // If the number is negative, we use an inversion mask to invert the // data bytes and treat the value as an unsigned number. var inv byte // 0x00 if positive or zero, 0xff if negative if b[0]&0x40 != 0 { inv = 0xff } var x uint64 for i, c := range b { c ^= inv // Inverts c only if inv is 0xff, otherwise does nothing if i == 0 { c &= 0x7f // Ignore signal bit in first byte } if (x >> 56) > 0 { p.err = ErrHeader // Integer overflow return 0 } x = x<<8 | uint64(c) } if (x >> 63) > 0 { p.err = ErrHeader // Integer overflow return 0 } if inv == 0xff { return ^int64(x) } return int64(x) } // Normal case is base-8 (octal) format. return p.parseOctal(b) } // formatNumeric encodes x into b using base-8 (octal) encoding if possible. // Otherwise it will attempt to use base-256 (binary) encoding. func (f *formatter) formatNumeric(b []byte, x int64) { if fitsInOctal(len(b), x) { f.formatOctal(b, x) return } if fitsInBase256(len(b), x) { for i := len(b) - 1; i >= 0; i-- { b[i] = byte(x) x >>= 8 } b[0] |= 0x80 // Highest bit indicates binary format return } f.formatOctal(b, 0) // Last resort, just write zero f.err = ErrFieldTooLong } func (p *parser) parseOctal(b []byte) int64 { // Because unused fields are filled with NULs, we need // to skip leading NULs. Fields may also be padded with // spaces or NULs. // So we remove leading and trailing NULs and spaces to // be sure. b = bytes.Trim(b, " \x00") if len(b) == 0 { return 0 } x, perr := strconv.ParseUint(p.parseString(b), 8, 64) if perr != nil { p.err = ErrHeader } return int64(x) } func (f *formatter) formatOctal(b []byte, x int64) { if !fitsInOctal(len(b), x) { x = 0 // Last resort, just write zero f.err = ErrFieldTooLong } s := strconv.FormatInt(x, 8) // Add leading zeros, but leave room for a NUL. if n := len(b) - len(s) - 1; n > 0 { s = strings.Repeat("0", n) + s } f.formatString(b, s) } // fitsInOctal reports whether the integer x fits in a field n-bytes long // using octal encoding with the appropriate NUL terminator. func fitsInOctal(n int, x int64) bool { octBits := uint(n-1) * 3 return x >= 0 && (n >= 22 || x < 1<= 0 { ss, sn = s[:pos], s[pos+1:] } // Parse the seconds. secs, err := strconv.ParseInt(ss, 10, 64) if err != nil { return time.Time{}, ErrHeader } if len(sn) == 0 { return time.Unix(secs, 0), nil // No sub-second values } // Parse the nanoseconds. if strings.Trim(sn, "0123456789") != "" { return time.Time{}, ErrHeader } if len(sn) < maxNanoSecondDigits { sn += strings.Repeat("0", maxNanoSecondDigits-len(sn)) // Right pad } else { sn = sn[:maxNanoSecondDigits] // Right truncate } nsecs, _ := strconv.ParseInt(sn, 10, 64) // Must succeed if len(ss) > 0 && ss[0] == '-' { return time.Unix(secs, -1*nsecs), nil // Negative correction } return time.Unix(secs, nsecs), nil } // formatPAXTime converts ts into a time of the form %d.%d as described in the // PAX specification. This function is capable of negative timestamps. func formatPAXTime(ts time.Time) (s string) { secs, nsecs := ts.Unix(), ts.Nanosecond() if nsecs == 0 { return strconv.FormatInt(secs, 10) } // If seconds is negative, then perform correction. sign := "" if secs < 0 { sign = "-" // Remember sign secs = -(secs + 1) // Add a second to secs nsecs = -(nsecs - 1E9) // Take that second away from nsecs } return strings.TrimRight(fmt.Sprintf("%s%d.%09d", sign, secs, nsecs), "0") } // parsePAXRecord parses the input PAX record string into a key-value pair. // If parsing is successful, it will slice off the currently read record and // return the remainder as r. func parsePAXRecord(s string) (k, v, r string, err error) { // The size field ends at the first space. sp := strings.IndexByte(s, ' ') if sp == -1 { return "", "", s, ErrHeader } // Parse the first token as a decimal integer. n, perr := strconv.ParseInt(s[:sp], 10, 0) // Intentionally parse as native int if perr != nil || n < 5 || int64(len(s)) < n { return "", "", s, ErrHeader } // Extract everything between the space and the final newline. rec, nl, rem := s[sp+1:n-1], s[n-1:n], s[n:] if nl != "\n" { return "", "", s, ErrHeader } // The first equals separates the key from the value. eq := strings.IndexByte(rec, '=') if eq == -1 { return "", "", s, ErrHeader } k, v = rec[:eq], rec[eq+1:] if !validPAXRecord(k, v) { return "", "", s, ErrHeader } return k, v, rem, nil } // formatPAXRecord formats a single PAX record, prefixing it with the // appropriate length. func formatPAXRecord(k, v string) (string, error) { if !validPAXRecord(k, v) { return "", ErrHeader } const padding = 3 // Extra padding for ' ', '=', and '\n' size := len(k) + len(v) + padding size += len(strconv.Itoa(size)) record := strconv.Itoa(size) + " " + k + "=" + v + "\n" // Final adjustment if adding size field increased the record size. if len(record) != size { size = len(record) record = strconv.Itoa(size) + " " + k + "=" + v + "\n" } return record, nil } // validPAXRecord reports whether the key-value pair is valid where each // record is formatted as: // "%d %s=%s\n" % (size, key, value) // // Keys and values should be UTF-8, but the number of bad writers out there // forces us to be a more liberal. // Thus, we only reject all keys with NUL, and only reject NULs in values // for the PAX version of the USTAR string fields. // The key must not contain an '=' character. func validPAXRecord(k, v string) bool { if k == "" || strings.IndexByte(k, '=') >= 0 { return false } switch k { case paxPath, paxLinkpath, paxUname, paxGname: return !hasNUL(v) default: return !hasNUL(k) } } ================================================ FILE: vendor/github.com/vbatts/tar-split/archive/tar/writer.go ================================================ // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package tar import ( "fmt" "io" "path" "sort" "strings" "time" ) // Writer provides sequential writing of a tar archive. // Write.WriteHeader begins a new file with the provided Header, // and then Writer can be treated as an io.Writer to supply that file's data. type Writer struct { w io.Writer pad int64 // Amount of padding to write after current file entry curr fileWriter // Writer for current file entry hdr Header // Shallow copy of Header that is safe for mutations blk block // Buffer to use as temporary local storage // err is a persistent error. // It is only the responsibility of every exported method of Writer to // ensure that this error is sticky. err error } // NewWriter creates a new Writer writing to w. func NewWriter(w io.Writer) *Writer { return &Writer{w: w, curr: ®FileWriter{w, 0}} } type fileWriter interface { io.Writer fileState ReadFrom(io.Reader) (int64, error) } // Flush finishes writing the current file's block padding. // The current file must be fully written before Flush can be called. // // This is unnecessary as the next call to WriteHeader or Close // will implicitly flush out the file's padding. func (tw *Writer) Flush() error { if tw.err != nil { return tw.err } if nb := tw.curr.LogicalRemaining(); nb > 0 { return fmt.Errorf("archive/tar: missed writing %d bytes", nb) } if _, tw.err = tw.w.Write(zeroBlock[:tw.pad]); tw.err != nil { return tw.err } tw.pad = 0 return nil } // WriteHeader writes hdr and prepares to accept the file's contents. // The Header.Size determines how many bytes can be written for the next file. // If the current file is not fully written, then this returns an error. // This implicitly flushes any padding necessary before writing the header. func (tw *Writer) WriteHeader(hdr *Header) error { if err := tw.Flush(); err != nil { return err } tw.hdr = *hdr // Shallow copy of Header // Avoid usage of the legacy TypeRegA flag, and automatically promote // it to use TypeReg or TypeDir. if tw.hdr.Typeflag == TypeRegA { if strings.HasSuffix(tw.hdr.Name, "/") { tw.hdr.Typeflag = TypeDir } else { tw.hdr.Typeflag = TypeReg } } // Round ModTime and ignore AccessTime and ChangeTime unless // the format is explicitly chosen. // This ensures nominal usage of WriteHeader (without specifying the format) // does not always result in the PAX format being chosen, which // causes a 1KiB increase to every header. if tw.hdr.Format == FormatUnknown { tw.hdr.ModTime = tw.hdr.ModTime.Round(time.Second) tw.hdr.AccessTime = time.Time{} tw.hdr.ChangeTime = time.Time{} } allowedFormats, paxHdrs, err := tw.hdr.allowedFormats() switch { case allowedFormats.has(FormatUSTAR): tw.err = tw.writeUSTARHeader(&tw.hdr) return tw.err case allowedFormats.has(FormatPAX): tw.err = tw.writePAXHeader(&tw.hdr, paxHdrs) return tw.err case allowedFormats.has(FormatGNU): tw.err = tw.writeGNUHeader(&tw.hdr) return tw.err default: return err // Non-fatal error } } func (tw *Writer) writeUSTARHeader(hdr *Header) error { // Check if we can use USTAR prefix/suffix splitting. var namePrefix string if prefix, suffix, ok := splitUSTARPath(hdr.Name); ok { namePrefix, hdr.Name = prefix, suffix } // Pack the main header. var f formatter blk := tw.templateV7Plus(hdr, f.formatString, f.formatOctal) f.formatString(blk.USTAR().Prefix(), namePrefix) blk.SetFormat(FormatUSTAR) if f.err != nil { return f.err // Should never happen since header is validated } return tw.writeRawHeader(blk, hdr.Size, hdr.Typeflag) } func (tw *Writer) writePAXHeader(hdr *Header, paxHdrs map[string]string) error { realName, realSize := hdr.Name, hdr.Size // TODO(dsnet): Re-enable this when adding sparse support. // See https://golang.org/issue/22735 /* // Handle sparse files. var spd sparseDatas var spb []byte if len(hdr.SparseHoles) > 0 { sph := append([]sparseEntry{}, hdr.SparseHoles...) // Copy sparse map sph = alignSparseEntries(sph, hdr.Size) spd = invertSparseEntries(sph, hdr.Size) // Format the sparse map. hdr.Size = 0 // Replace with encoded size spb = append(strconv.AppendInt(spb, int64(len(spd)), 10), '\n') for _, s := range spd { hdr.Size += s.Length spb = append(strconv.AppendInt(spb, s.Offset, 10), '\n') spb = append(strconv.AppendInt(spb, s.Length, 10), '\n') } pad := blockPadding(int64(len(spb))) spb = append(spb, zeroBlock[:pad]...) hdr.Size += int64(len(spb)) // Accounts for encoded sparse map // Add and modify appropriate PAX records. dir, file := path.Split(realName) hdr.Name = path.Join(dir, "GNUSparseFile.0", file) paxHdrs[paxGNUSparseMajor] = "1" paxHdrs[paxGNUSparseMinor] = "0" paxHdrs[paxGNUSparseName] = realName paxHdrs[paxGNUSparseRealSize] = strconv.FormatInt(realSize, 10) paxHdrs[paxSize] = strconv.FormatInt(hdr.Size, 10) delete(paxHdrs, paxPath) // Recorded by paxGNUSparseName } */ _ = realSize // Write PAX records to the output. isGlobal := hdr.Typeflag == TypeXGlobalHeader if len(paxHdrs) > 0 || isGlobal { // Sort keys for deterministic ordering. var keys []string for k := range paxHdrs { keys = append(keys, k) } sort.Strings(keys) // Write each record to a buffer. var buf strings.Builder for _, k := range keys { rec, err := formatPAXRecord(k, paxHdrs[k]) if err != nil { return err } buf.WriteString(rec) } // Write the extended header file. var name string var flag byte if isGlobal { name = realName if name == "" { name = "GlobalHead.0.0" } flag = TypeXGlobalHeader } else { dir, file := path.Split(realName) name = path.Join(dir, "PaxHeaders.0", file) flag = TypeXHeader } data := buf.String() if len(data) > maxSpecialFileSize { return ErrFieldTooLong } if err := tw.writeRawFile(name, data, flag, FormatPAX); err != nil || isGlobal { return err // Global headers return here } } // Pack the main header. var f formatter // Ignore errors since they are expected fmtStr := func(b []byte, s string) { f.formatString(b, toASCII(s)) } blk := tw.templateV7Plus(hdr, fmtStr, f.formatOctal) blk.SetFormat(FormatPAX) if err := tw.writeRawHeader(blk, hdr.Size, hdr.Typeflag); err != nil { return err } // TODO(dsnet): Re-enable this when adding sparse support. // See https://golang.org/issue/22735 /* // Write the sparse map and setup the sparse writer if necessary. if len(spd) > 0 { // Use tw.curr since the sparse map is accounted for in hdr.Size. if _, err := tw.curr.Write(spb); err != nil { return err } tw.curr = &sparseFileWriter{tw.curr, spd, 0} } */ return nil } func (tw *Writer) writeGNUHeader(hdr *Header) error { // Use long-link files if Name or Linkname exceeds the field size. const longName = "././@LongLink" if len(hdr.Name) > nameSize { data := hdr.Name + "\x00" if err := tw.writeRawFile(longName, data, TypeGNULongName, FormatGNU); err != nil { return err } } if len(hdr.Linkname) > nameSize { data := hdr.Linkname + "\x00" if err := tw.writeRawFile(longName, data, TypeGNULongLink, FormatGNU); err != nil { return err } } // Pack the main header. var f formatter // Ignore errors since they are expected var spd sparseDatas var spb []byte blk := tw.templateV7Plus(hdr, f.formatString, f.formatNumeric) if !hdr.AccessTime.IsZero() { f.formatNumeric(blk.GNU().AccessTime(), hdr.AccessTime.Unix()) } if !hdr.ChangeTime.IsZero() { f.formatNumeric(blk.GNU().ChangeTime(), hdr.ChangeTime.Unix()) } // TODO(dsnet): Re-enable this when adding sparse support. // See https://golang.org/issue/22735 /* if hdr.Typeflag == TypeGNUSparse { sph := append([]sparseEntry{}, hdr.SparseHoles...) // Copy sparse map sph = alignSparseEntries(sph, hdr.Size) spd = invertSparseEntries(sph, hdr.Size) // Format the sparse map. formatSPD := func(sp sparseDatas, sa sparseArray) sparseDatas { for i := 0; len(sp) > 0 && i < sa.MaxEntries(); i++ { f.formatNumeric(sa.Entry(i).Offset(), sp[0].Offset) f.formatNumeric(sa.Entry(i).Length(), sp[0].Length) sp = sp[1:] } if len(sp) > 0 { sa.IsExtended()[0] = 1 } return sp } sp2 := formatSPD(spd, blk.GNU().Sparse()) for len(sp2) > 0 { var spHdr block sp2 = formatSPD(sp2, spHdr.Sparse()) spb = append(spb, spHdr[:]...) } // Update size fields in the header block. realSize := hdr.Size hdr.Size = 0 // Encoded size; does not account for encoded sparse map for _, s := range spd { hdr.Size += s.Length } copy(blk.V7().Size(), zeroBlock[:]) // Reset field f.formatNumeric(blk.V7().Size(), hdr.Size) f.formatNumeric(blk.GNU().RealSize(), realSize) } */ blk.SetFormat(FormatGNU) if err := tw.writeRawHeader(blk, hdr.Size, hdr.Typeflag); err != nil { return err } // Write the extended sparse map and setup the sparse writer if necessary. if len(spd) > 0 { // Use tw.w since the sparse map is not accounted for in hdr.Size. if _, err := tw.w.Write(spb); err != nil { return err } tw.curr = &sparseFileWriter{tw.curr, spd, 0} } return nil } type ( stringFormatter func([]byte, string) numberFormatter func([]byte, int64) ) // templateV7Plus fills out the V7 fields of a block using values from hdr. // It also fills out fields (uname, gname, devmajor, devminor) that are // shared in the USTAR, PAX, and GNU formats using the provided formatters. // // The block returned is only valid until the next call to // templateV7Plus or writeRawFile. func (tw *Writer) templateV7Plus(hdr *Header, fmtStr stringFormatter, fmtNum numberFormatter) *block { tw.blk.Reset() modTime := hdr.ModTime if modTime.IsZero() { modTime = time.Unix(0, 0) } v7 := tw.blk.V7() v7.TypeFlag()[0] = hdr.Typeflag fmtStr(v7.Name(), hdr.Name) fmtStr(v7.LinkName(), hdr.Linkname) fmtNum(v7.Mode(), hdr.Mode) fmtNum(v7.UID(), int64(hdr.Uid)) fmtNum(v7.GID(), int64(hdr.Gid)) fmtNum(v7.Size(), hdr.Size) fmtNum(v7.ModTime(), modTime.Unix()) ustar := tw.blk.USTAR() fmtStr(ustar.UserName(), hdr.Uname) fmtStr(ustar.GroupName(), hdr.Gname) fmtNum(ustar.DevMajor(), hdr.Devmajor) fmtNum(ustar.DevMinor(), hdr.Devminor) return &tw.blk } // writeRawFile writes a minimal file with the given name and flag type. // It uses format to encode the header format and will write data as the body. // It uses default values for all of the other fields (as BSD and GNU tar does). func (tw *Writer) writeRawFile(name, data string, flag byte, format Format) error { tw.blk.Reset() // Best effort for the filename. name = toASCII(name) if len(name) > nameSize { name = name[:nameSize] } name = strings.TrimRight(name, "/") var f formatter v7 := tw.blk.V7() v7.TypeFlag()[0] = flag f.formatString(v7.Name(), name) f.formatOctal(v7.Mode(), 0) f.formatOctal(v7.UID(), 0) f.formatOctal(v7.GID(), 0) f.formatOctal(v7.Size(), int64(len(data))) // Must be < 8GiB f.formatOctal(v7.ModTime(), 0) tw.blk.SetFormat(format) if f.err != nil { return f.err // Only occurs if size condition is violated } // Write the header and data. if err := tw.writeRawHeader(&tw.blk, int64(len(data)), flag); err != nil { return err } _, err := io.WriteString(tw, data) return err } // writeRawHeader writes the value of blk, regardless of its value. // It sets up the Writer such that it can accept a file of the given size. // If the flag is a special header-only flag, then the size is treated as zero. func (tw *Writer) writeRawHeader(blk *block, size int64, flag byte) error { if err := tw.Flush(); err != nil { return err } if _, err := tw.w.Write(blk[:]); err != nil { return err } if isHeaderOnlyType(flag) { size = 0 } tw.curr = ®FileWriter{tw.w, size} tw.pad = blockPadding(size) return nil } // splitUSTARPath splits a path according to USTAR prefix and suffix rules. // If the path is not splittable, then it will return ("", "", false). func splitUSTARPath(name string) (prefix, suffix string, ok bool) { length := len(name) if length <= nameSize || !isASCII(name) { return "", "", false } else if length > prefixSize+1 { length = prefixSize + 1 } else if name[length-1] == '/' { length-- } i := strings.LastIndex(name[:length], "/") nlen := len(name) - i - 1 // nlen is length of suffix plen := i // plen is length of prefix if i <= 0 || nlen > nameSize || nlen == 0 || plen > prefixSize { return "", "", false } return name[:i], name[i+1:], true } // Write writes to the current file in the tar archive. // Write returns the error ErrWriteTooLong if more than // Header.Size bytes are written after WriteHeader. // // Calling Write on special types like TypeLink, TypeSymlink, TypeChar, // TypeBlock, TypeDir, and TypeFifo returns (0, ErrWriteTooLong) regardless // of what the Header.Size claims. func (tw *Writer) Write(b []byte) (int, error) { if tw.err != nil { return 0, tw.err } n, err := tw.curr.Write(b) if err != nil && err != ErrWriteTooLong { tw.err = err } return n, err } // readFrom populates the content of the current file by reading from r. // The bytes read must match the number of remaining bytes in the current file. // // If the current file is sparse and r is an io.ReadSeeker, // then readFrom uses Seek to skip past holes defined in Header.SparseHoles, // assuming that skipped regions are all NULs. // This always reads the last byte to ensure r is the right size. // // TODO(dsnet): Re-export this when adding sparse file support. // See https://golang.org/issue/22735 func (tw *Writer) readFrom(r io.Reader) (int64, error) { if tw.err != nil { return 0, tw.err } n, err := tw.curr.ReadFrom(r) if err != nil && err != ErrWriteTooLong { tw.err = err } return n, err } // Close closes the tar archive by flushing the padding, and writing the footer. // If the current file (from a prior call to WriteHeader) is not fully written, // then this returns an error. func (tw *Writer) Close() error { if tw.err == ErrWriteAfterClose { return nil } if tw.err != nil { return tw.err } // Trailer: two zero blocks. err := tw.Flush() for i := 0; i < 2 && err == nil; i++ { _, err = tw.w.Write(zeroBlock[:]) } // Ensure all future actions are invalid. tw.err = ErrWriteAfterClose return err // Report IO errors } // regFileWriter is a fileWriter for writing data to a regular file entry. type regFileWriter struct { w io.Writer // Underlying Writer nb int64 // Number of remaining bytes to write } func (fw *regFileWriter) Write(b []byte) (n int, err error) { overwrite := int64(len(b)) > fw.nb if overwrite { b = b[:fw.nb] } if len(b) > 0 { n, err = fw.w.Write(b) fw.nb -= int64(n) } switch { case err != nil: return n, err case overwrite: return n, ErrWriteTooLong default: return n, nil } } func (fw *regFileWriter) ReadFrom(r io.Reader) (int64, error) { return io.Copy(struct{ io.Writer }{fw}, r) } func (fw regFileWriter) LogicalRemaining() int64 { return fw.nb } func (fw regFileWriter) PhysicalRemaining() int64 { return fw.nb } // sparseFileWriter is a fileWriter for writing data to a sparse file entry. type sparseFileWriter struct { fw fileWriter // Underlying fileWriter sp sparseDatas // Normalized list of data fragments pos int64 // Current position in sparse file } func (sw *sparseFileWriter) Write(b []byte) (n int, err error) { overwrite := int64(len(b)) > sw.LogicalRemaining() if overwrite { b = b[:sw.LogicalRemaining()] } b0 := b endPos := sw.pos + int64(len(b)) for endPos > sw.pos && err == nil { var nf int // Bytes written in fragment dataStart, dataEnd := sw.sp[0].Offset, sw.sp[0].endOffset() if sw.pos < dataStart { // In a hole fragment bf := b[:min(int64(len(b)), dataStart-sw.pos)] nf, err = zeroWriter{}.Write(bf) } else { // In a data fragment bf := b[:min(int64(len(b)), dataEnd-sw.pos)] nf, err = sw.fw.Write(bf) } b = b[nf:] sw.pos += int64(nf) if sw.pos >= dataEnd && len(sw.sp) > 1 { sw.sp = sw.sp[1:] // Ensure last fragment always remains } } n = len(b0) - len(b) switch { case err == ErrWriteTooLong: return n, errMissData // Not possible; implies bug in validation logic case err != nil: return n, err case sw.LogicalRemaining() == 0 && sw.PhysicalRemaining() > 0: return n, errUnrefData // Not possible; implies bug in validation logic case overwrite: return n, ErrWriteTooLong default: return n, nil } } func (sw *sparseFileWriter) ReadFrom(r io.Reader) (n int64, err error) { rs, ok := r.(io.ReadSeeker) if ok { if _, err := rs.Seek(0, io.SeekCurrent); err != nil { ok = false // Not all io.Seeker can really seek } } if !ok { return io.Copy(struct{ io.Writer }{sw}, r) } var readLastByte bool pos0 := sw.pos for sw.LogicalRemaining() > 0 && !readLastByte && err == nil { var nf int64 // Size of fragment dataStart, dataEnd := sw.sp[0].Offset, sw.sp[0].endOffset() if sw.pos < dataStart { // In a hole fragment nf = dataStart - sw.pos if sw.PhysicalRemaining() == 0 { readLastByte = true nf-- } _, err = rs.Seek(nf, io.SeekCurrent) } else { // In a data fragment nf = dataEnd - sw.pos nf, err = io.CopyN(sw.fw, rs, nf) } sw.pos += nf if sw.pos >= dataEnd && len(sw.sp) > 1 { sw.sp = sw.sp[1:] // Ensure last fragment always remains } } // If the last fragment is a hole, then seek to 1-byte before EOF, and // read a single byte to ensure the file is the right size. if readLastByte && err == nil { _, err = mustReadFull(rs, []byte{0}) sw.pos++ } n = sw.pos - pos0 switch { case err == io.EOF: return n, io.ErrUnexpectedEOF case err == ErrWriteTooLong: return n, errMissData // Not possible; implies bug in validation logic case err != nil: return n, err case sw.LogicalRemaining() == 0 && sw.PhysicalRemaining() > 0: return n, errUnrefData // Not possible; implies bug in validation logic default: return n, ensureEOF(rs) } } func (sw sparseFileWriter) LogicalRemaining() int64 { return sw.sp[len(sw.sp)-1].endOffset() - sw.pos } func (sw sparseFileWriter) PhysicalRemaining() int64 { return sw.fw.PhysicalRemaining() } // zeroWriter may only be written with NULs, otherwise it returns errWriteHole. type zeroWriter struct{} func (zeroWriter) Write(b []byte) (int, error) { for i, c := range b { if c != 0 { return i, errWriteHole } } return len(b), nil } // ensureEOF checks whether r is at EOF, reporting ErrWriteTooLong if not so. func ensureEOF(r io.Reader) error { n, err := tryReadFull(r, []byte{0}) switch { case n > 0: return ErrWriteTooLong case err == io.EOF: return nil default: return err } } ================================================ FILE: vendor/github.com/vbatts/tar-split/tar/asm/README.md ================================================ asm === This library for assembly and disassembly of tar archives, facilitated by `github.com/vbatts/tar-split/tar/storage`. Concerns -------- For completely safe assembly/disassembly, there will need to be a Content Addressable Storage (CAS) directory, that maps to a checksum in the `storage.Entity` of `storage.FileType`. This is due to the fact that tar archives _can_ allow multiple records for the same path, but the last one effectively wins. Even if the prior records had a different payload. In this way, when assembling an archive from relative paths, if the archive has multiple entries for the same path, then all payloads read in from a relative path would be identical. Thoughts -------- Have a look-aside directory or storage. This way when a clobbering record is encountered from the tar stream, then the payload of the prior/existing file is stored to the CAS. This way the clobbering record's file payload can be extracted, but we'll have preserved the payload needed to reassemble a precise tar archive. clobbered/path/to/file.[0-N] *alternatively* We could just _not_ support tar streams that have clobbering file paths. Appending records to the archive is not incredibly common, and doesn't happen by default for most implementations. Not supporting them wouldn't be a security concern either, as if it did occur, we would reassemble an archive that doesn't validate signature/checksum, so it shouldn't be trusted anyway. Otherwise, this will allow us to defer support for appended files as a FUTURE FEATURE. ================================================ FILE: vendor/github.com/vbatts/tar-split/tar/asm/assemble.go ================================================ package asm import ( "bytes" "fmt" "hash" "hash/crc64" "io" "sync" "github.com/vbatts/tar-split/tar/storage" ) // NewOutputTarStream returns an io.ReadCloser that is an assembled tar archive // stream. // // It takes a storage.FileGetter, for mapping the file payloads that are to be read in, // and a storage.Unpacker, which has access to the rawbytes and file order // metadata. With the combination of these two items, a precise assembled Tar // archive is possible. func NewOutputTarStream(fg storage.FileGetter, up storage.Unpacker) io.ReadCloser { // ... Since these are interfaces, this is possible, so let's not have a nil pointer if fg == nil || up == nil { return nil } pr, pw := io.Pipe() go func() { err := WriteOutputTarStream(fg, up, pw) if err != nil { pw.CloseWithError(err) } else { pw.Close() } }() return pr } // WriteOutputTarStream writes assembled tar archive to a writer. func WriteOutputTarStream(fg storage.FileGetter, up storage.Unpacker, w io.Writer) error { // ... Since these are interfaces, this is possible, so let's not have a nil pointer if fg == nil || up == nil { return nil } var copyBuffer []byte var crcHash hash.Hash var crcSum []byte var multiWriter io.Writer for { entry, err := up.Next() if err != nil { if err == io.EOF { return nil } return err } switch entry.Type { case storage.SegmentType: if _, err := w.Write(entry.Payload); err != nil { return err } case storage.FileType: if entry.Size == 0 { continue } fh, err := fg.Get(entry.GetName()) if err != nil { return err } if crcHash == nil { crcHash = crc64.New(storage.CRCTable) crcSum = make([]byte, 8) multiWriter = io.MultiWriter(w, crcHash) copyBuffer = byteBufferPool.Get().([]byte) // TODO once we have some benchmark or memory profile then we can experiment with using *bytes.Buffer //nolint:staticcheck // SA6002 not going to do a pointer here defer byteBufferPool.Put(copyBuffer) } else { crcHash.Reset() } if _, err := copyWithBuffer(multiWriter, fh, copyBuffer); err != nil { fh.Close() return err } if !bytes.Equal(crcHash.Sum(crcSum[:0]), entry.Payload) { // I would rather this be a comparable ErrInvalidChecksum or such, // but since it's coming through the PipeReader, the context of // _which_ file would be lost... fh.Close() return fmt.Errorf("file integrity checksum failed for %q", entry.GetName()) } fh.Close() } } } var byteBufferPool = &sync.Pool{ New: func() interface{} { return make([]byte, 32*1024) }, } // copyWithBuffer is taken from stdlib io.Copy implementation // https://github.com/golang/go/blob/go1.5.1/src/io/io.go#L367 func copyWithBuffer(dst io.Writer, src io.Reader, buf []byte) (written int64, err error) { for { nr, er := src.Read(buf) if nr > 0 { nw, ew := dst.Write(buf[0:nr]) if nw > 0 { written += int64(nw) } if ew != nil { err = ew break } if nr != nw { err = io.ErrShortWrite break } } if er == io.EOF { break } if er != nil { err = er break } } return written, err } ================================================ FILE: vendor/github.com/vbatts/tar-split/tar/asm/disassemble.go ================================================ package asm import ( "io" "github.com/vbatts/tar-split/archive/tar" "github.com/vbatts/tar-split/tar/storage" ) // NewInputTarStream wraps the Reader stream of a tar archive and provides a // Reader stream of the same. // // In the middle it will pack the segments and file metadata to storage.Packer // `p`. // // The the storage.FilePutter is where payload of files in the stream are // stashed. If this stashing is not needed, you can provide a nil // storage.FilePutter. Since the checksumming is still needed, then a default // of NewDiscardFilePutter will be used internally func NewInputTarStream(r io.Reader, p storage.Packer, fp storage.FilePutter) (io.Reader, error) { // What to do here... folks will want their own access to the Reader that is // their tar archive stream, but we'll need that same stream to use our // forked 'archive/tar'. // Perhaps do an io.TeeReader that hands back an io.Reader for them to read // from, and we'll MITM the stream to store metadata. // We'll need a storage.FilePutter too ... // Another concern, whether to do any storage.FilePutter operations, such that we // don't extract any amount of the archive. But then again, we're not making // files/directories, hardlinks, etc. Just writing the io to the storage.FilePutter. // Perhaps we have a DiscardFilePutter that is a bit bucket. // we'll return the pipe reader, since TeeReader does not buffer and will // only read what the outputRdr Read's. Since Tar archives have padding on // the end, we want to be the one reading the padding, even if the user's // `archive/tar` doesn't care. pR, pW := io.Pipe() outputRdr := io.TeeReader(r, pW) // we need a putter that will generate the crc64 sums of file payloads if fp == nil { fp = storage.NewDiscardFilePutter() } go func() { tr := tar.NewReader(outputRdr) tr.RawAccounting = true for { hdr, err := tr.Next() if err != nil { if err != io.EOF { pW.CloseWithError(err) return } // even when an EOF is reached, there is often 1024 null bytes on // the end of an archive. Collect them too. if b := tr.RawBytes(); len(b) > 0 { _, err := p.AddEntry(storage.Entry{ Type: storage.SegmentType, Payload: b, }) if err != nil { pW.CloseWithError(err) return } } break // not return. We need the end of the reader. } if hdr == nil { break // not return. We need the end of the reader. } if b := tr.RawBytes(); len(b) > 0 { _, err := p.AddEntry(storage.Entry{ Type: storage.SegmentType, Payload: b, }) if err != nil { pW.CloseWithError(err) return } } var csum []byte if hdr.Size > 0 { var err error _, csum, err = fp.Put(hdr.Name, tr) if err != nil { pW.CloseWithError(err) return } } entry := storage.Entry{ Type: storage.FileType, Size: hdr.Size, Payload: csum, } // For proper marshalling of non-utf8 characters entry.SetName(hdr.Name) // File entries added, regardless of size _, err = p.AddEntry(entry) if err != nil { pW.CloseWithError(err) return } if b := tr.RawBytes(); len(b) > 0 { _, err = p.AddEntry(storage.Entry{ Type: storage.SegmentType, Payload: b, }) if err != nil { pW.CloseWithError(err) return } } } // It is allowable, and not uncommon that there is further padding on // the end of an archive, apart from the expected 1024 null bytes. We // do this in chunks rather than in one go to avoid cases where a // maliciously crafted tar file tries to trick us into reading many GBs // into memory. const paddingChunkSize = 1024 * 1024 var paddingChunk [paddingChunkSize]byte for { var isEOF bool n, err := outputRdr.Read(paddingChunk[:]) if err != nil { if err != io.EOF { pW.CloseWithError(err) return } isEOF = true } if n != 0 { _, err = p.AddEntry(storage.Entry{ Type: storage.SegmentType, Payload: paddingChunk[:n], }) if err != nil { pW.CloseWithError(err) return } } if isEOF { break } } pW.Close() }() return pR, nil } ================================================ FILE: vendor/github.com/vbatts/tar-split/tar/asm/doc.go ================================================ /* Package asm provides the API for streaming assembly and disassembly of tar archives. Using the `github.com/vbatts/tar-split/tar/storage` for Packing/Unpacking the metadata for a stream, as well as an implementation of Getting/Putting the file entries' payload. */ package asm ================================================ FILE: vendor/github.com/vbatts/tar-split/tar/asm/iterate.go ================================================ package asm import ( "bytes" "fmt" "io" "github.com/vbatts/tar-split/archive/tar" "github.com/vbatts/tar-split/tar/storage" ) // IterateHeaders calls handler for each tar header provided by Unpacker func IterateHeaders(unpacker storage.Unpacker, handler func(hdr *tar.Header) error) error { // We assume about NewInputTarStream: // - There is a separate SegmentType entry for every tar header, but only one SegmentType entry for the full header incl. any extensions // - (There is a FileType entry for every tar header, we ignore it) // - Trailing padding of a file, if any, is included in the next SegmentType entry // - At the end, there may be SegmentType entries just for the terminating zero blocks. var pendingPadding int64 = 0 for { tsEntry, err := unpacker.Next() if err != nil { if err == io.EOF { return nil } return fmt.Errorf("reading tar-split entries: %w", err) } switch tsEntry.Type { case storage.SegmentType: payload := tsEntry.Payload if int64(len(payload)) < pendingPadding { return fmt.Errorf("expected %d bytes of padding after previous file, but next SegmentType only has %d bytes", pendingPadding, len(payload)) } payload = payload[pendingPadding:] pendingPadding = 0 tr := tar.NewReader(bytes.NewReader(payload)) hdr, err := tr.Next() if err != nil { if err == io.EOF { // Probably the last entry, but let’s let the unpacker drive that. break } return fmt.Errorf("decoding a tar header from a tar-split entry: %w", err) } if err := handler(hdr); err != nil { return err } pendingPadding = tr.ExpectedPadding() case storage.FileType: // Nothing default: return fmt.Errorf("unexpected tar-split entry type %q", tsEntry.Type) } } } ================================================ FILE: vendor/github.com/vbatts/tar-split/tar/storage/doc.go ================================================ /* Package storage is for metadata of a tar archive. Packing and unpacking the Entries of the stream. The types of streams are either segments of raw bytes (for the raw headers and various padding) and for an entry marking a file payload. The raw bytes are stored precisely in the packed (marshalled) Entry, whereas the file payload marker include the name of the file, size, and crc64 checksum (for basic file integrity). */ package storage ================================================ FILE: vendor/github.com/vbatts/tar-split/tar/storage/entry.go ================================================ package storage import "unicode/utf8" // Entries is for sorting by Position type Entries []Entry func (e Entries) Len() int { return len(e) } func (e Entries) Swap(i, j int) { e[i], e[j] = e[j], e[i] } func (e Entries) Less(i, j int) bool { return e[i].Position < e[j].Position } // Type of Entry type Type int const ( // FileType represents a file payload from the tar stream. // // This will be used to map to relative paths on disk. Only Size > 0 will get // read into a resulting output stream (due to hardlinks). FileType Type = 1 + iota // SegmentType represents a raw bytes segment from the archive stream. These raw // byte segments consist of the raw headers and various padding. // // Its payload is to be marshalled base64 encoded. SegmentType ) // Entry is the structure for packing and unpacking the information read from // the Tar archive. // // FileType Payload checksum is using `hash/crc64` for basic file integrity, // _not_ for cryptography. // From http://www.backplane.com/matt/crc64.html, CRC32 has almost 40,000 // collisions in a sample of 18.2 million, CRC64 had none. type Entry struct { Type Type `json:"type"` Name string `json:"name,omitempty"` NameRaw []byte `json:"name_raw,omitempty"` Size int64 `json:"size,omitempty"` Payload []byte `json:"payload"` // SegmentType stores payload here; FileType stores crc64 checksum here; Position int `json:"position"` } // SetName will check name for valid UTF-8 string, and set the appropriate // field. See https://github.com/vbatts/tar-split/issues/17 func (e *Entry) SetName(name string) { if utf8.ValidString(name) { e.Name = name } else { e.NameRaw = []byte(name) } } // SetNameBytes will check name for valid UTF-8 string, and set the appropriate // field func (e *Entry) SetNameBytes(name []byte) { if utf8.Valid(name) { e.Name = string(name) } else { e.NameRaw = name } } // GetName returns the string for the entry's name, regardless of the field stored in func (e *Entry) GetName() string { if len(e.NameRaw) > 0 { return string(e.NameRaw) } return e.Name } // GetNameBytes returns the bytes for the entry's name, regardless of the field stored in func (e *Entry) GetNameBytes() []byte { if len(e.NameRaw) > 0 { return e.NameRaw } return []byte(e.Name) } ================================================ FILE: vendor/github.com/vbatts/tar-split/tar/storage/getter.go ================================================ package storage import ( "bytes" "errors" "hash/crc64" "io" "os" "path/filepath" ) // FileGetter is the interface for getting a stream of a file payload, // addressed by name/filename. Presumably, the names will be scoped to relative // file paths. type FileGetter interface { // Get returns a stream for the provided file path Get(filename string) (output io.ReadCloser, err error) } // FilePutter is the interface for storing a stream of a file payload, // addressed by name/filename. type FilePutter interface { // Put returns the size of the stream received, and the crc64 checksum for // the provided stream Put(filename string, input io.Reader) (size int64, checksum []byte, err error) } // FileGetPutter is the interface that groups both Getting and Putting file // payloads. type FileGetPutter interface { FileGetter FilePutter } // NewPathFileGetter returns a FileGetter that is for files relative to path // relpath. func NewPathFileGetter(relpath string) FileGetter { return &pathFileGetter{root: relpath} } type pathFileGetter struct { root string } func (pfg pathFileGetter) Get(filename string) (io.ReadCloser, error) { return os.Open(filepath.Join(pfg.root, filename)) } type bufferFileGetPutter struct { files map[string][]byte } func (bfgp bufferFileGetPutter) Get(name string) (io.ReadCloser, error) { if _, ok := bfgp.files[name]; !ok { return nil, errors.New("no such file") } b := bytes.NewBuffer(bfgp.files[name]) return &readCloserWrapper{b}, nil } func (bfgp *bufferFileGetPutter) Put(name string, r io.Reader) (int64, []byte, error) { crc := crc64.New(CRCTable) buf := bytes.NewBuffer(nil) cw := io.MultiWriter(crc, buf) i, err := io.Copy(cw, r) if err != nil { return 0, nil, err } bfgp.files[name] = buf.Bytes() return i, crc.Sum(nil), nil } type readCloserWrapper struct { io.Reader } func (w *readCloserWrapper) Close() error { return nil } // NewBufferFileGetPutter is a simple in-memory FileGetPutter // // Implication is this is memory intensive... // Probably best for testing or light weight cases. func NewBufferFileGetPutter() FileGetPutter { return &bufferFileGetPutter{ files: map[string][]byte{}, } } // NewDiscardFilePutter is a bit bucket FilePutter func NewDiscardFilePutter() FilePutter { return &bitBucketFilePutter{} } type bitBucketFilePutter struct { buffer [32 * 1024]byte // 32 kB is the buffer size currently used by io.Copy, as of August 2021. } func (bbfp *bitBucketFilePutter) Put(name string, r io.Reader) (int64, []byte, error) { c := crc64.New(CRCTable) i, err := io.CopyBuffer(c, r, bbfp.buffer[:]) return i, c.Sum(nil), err } // CRCTable is the default table used for crc64 sum calculations var CRCTable = crc64.MakeTable(crc64.ISO) ================================================ FILE: vendor/github.com/vbatts/tar-split/tar/storage/packer.go ================================================ package storage import ( "encoding/json" "errors" "io" "path/filepath" "unicode/utf8" ) // ErrDuplicatePath occurs when a tar archive has more than one entry for the // same file path var ErrDuplicatePath = errors.New("duplicates of file paths not supported") // Packer describes the methods to pack Entries to a storage destination type Packer interface { // AddEntry packs the Entry and returns its position AddEntry(e Entry) (int, error) } // Unpacker describes the methods to read Entries from a source type Unpacker interface { // Next returns the next Entry being unpacked, or error, until io.EOF Next() (*Entry, error) } type jsonUnpacker struct { seen seenNames dec *json.Decoder } func (jup *jsonUnpacker) Next() (*Entry, error) { var e Entry err := jup.dec.Decode(&e) if err != nil { return nil, err } // check for dup name if e.Type == FileType { cName := filepath.Clean(e.GetName()) if _, ok := jup.seen[cName]; ok { return nil, ErrDuplicatePath } jup.seen[cName] = struct{}{} } return &e, err } // NewJSONUnpacker provides an Unpacker that reads Entries (SegmentType and // FileType) as a json document. // // Each Entry read are expected to be delimited by new line. func NewJSONUnpacker(r io.Reader) Unpacker { return &jsonUnpacker{ dec: json.NewDecoder(r), seen: seenNames{}, } } type jsonPacker struct { w io.Writer e *json.Encoder pos int seen seenNames } type seenNames map[string]struct{} func (jp *jsonPacker) AddEntry(e Entry) (int, error) { // if Name is not valid utf8, switch it to raw first. if e.Name != "" { if !utf8.ValidString(e.Name) { e.NameRaw = []byte(e.Name) e.Name = "" } } // check early for dup name if e.Type == FileType { cName := filepath.Clean(e.GetName()) if _, ok := jp.seen[cName]; ok { return -1, ErrDuplicatePath } jp.seen[cName] = struct{}{} } e.Position = jp.pos err := jp.e.Encode(e) if err != nil { return -1, err } // made it this far, increment now jp.pos++ return e.Position, nil } // NewJSONPacker provides a Packer that writes each Entry (SegmentType and // FileType) as a json document. // // The Entries are delimited by new line. func NewJSONPacker(w io.Writer) Packer { return &jsonPacker{ w: w, e: json.NewEncoder(w), seen: seenNames{}, } } ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/.gitignore ================================================ # Test binary, build with `go test -c` *.test # Output of the go coverage tool, specifically when used with LiteIDE *.out ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/CONTRIBUTING ================================================ When contributing your first changes, please include an empty commit for copyright waiver using the following message (replace 'John Doe' with your name or nickname): John Doe Copyright Waiver I dedicate any and all copyright interest in this software to the public domain. I make this dedication for the benefit of the public at large and to the detriment of my heirs and successors. I intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. The command to create an empty commit from the command-line is: git commit --allow-empty ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/README.md ================================================ # Multi Progress Bar [![GoDoc](https://pkg.go.dev/badge/github.com/vbauerster/mpb)](https://pkg.go.dev/github.com/vbauerster/mpb/v8) [![Test status](https://github.com/vbauerster/mpb/actions/workflows/test.yml/badge.svg)](https://github.com/vbauerster/mpb/actions/workflows/test.yml) [![Lint status](https://github.com/vbauerster/mpb/actions/workflows/golangci-lint.yml/badge.svg)](https://github.com/vbauerster/mpb/actions/workflows/golangci-lint.yml) **mpb** is a Go lib for rendering progress bars in terminal applications. ## Features - **Multiple Bars**: Multiple progress bars are supported - **Dynamic Total**: Set total while bar is running - **Dynamic Add/Remove**: Dynamically add or remove bars - **Cancellation**: Cancel whole rendering process - **Predefined Decorators**: Elapsed time, [ewma](https://github.com/VividCortex/ewma) based ETA, Percentage, Bytes counter - **Decorator's width sync**: Synchronized decorator's width among multiple bars ## Usage #### [Rendering single bar](_examples/singleBar/main.go) ```go package main import ( "math/rand" "time" "github.com/vbauerster/mpb/v8" "github.com/vbauerster/mpb/v8/decor" ) func main() { // initialize progress container, with custom width p := mpb.New(mpb.WithWidth(64)) total := 100 name := "Single Bar:" // create a single bar, which will inherit container's width bar := p.New(int64(total), // BarFillerBuilder with custom style mpb.BarStyle().Lbound("╢").Filler("▌").Tip("▌").Padding("░").Rbound("╟"), mpb.PrependDecorators( // display our name with one space on the right decor.Name(name, decor.WC{C: decor.DindentRight | decor.DextraSpace}), // replace ETA decorator with "done" message, OnComplete event decor.OnComplete(decor.AverageETA(decor.ET_STYLE_GO), "done"), ), mpb.AppendDecorators(decor.Percentage()), ) // simulating some work max := 100 * time.Millisecond for i := 0; i < total; i++ { time.Sleep(time.Duration(rand.Intn(10)+1) * max / 10) bar.Increment() } // wait for our bar to complete and flush p.Wait() } ``` #### [Rendering multiple bars](_examples/multiBars/main.go) ```go var wg sync.WaitGroup // passed wg will be accounted at p.Wait() call p := mpb.New(mpb.WithWaitGroup(&wg)) total, numBars := 100, 3 wg.Add(numBars) for i := 0; i < numBars; i++ { name := fmt.Sprintf("Bar#%d:", i) bar := p.AddBar(int64(total), mpb.PrependDecorators( // simple name decorator decor.Name(name), // decor.DSyncWidth bit enables column width synchronization decor.Percentage(decor.WCSyncSpace), ), mpb.AppendDecorators( // replace ETA decorator with "done" message, OnComplete event decor.OnComplete( // ETA decorator with ewma age of 30 decor.EwmaETA(decor.ET_STYLE_GO, 30, decor.WCSyncWidth), "done", ), ), ) // simulating some work go func() { defer wg.Done() rng := rand.New(rand.NewSource(time.Now().UnixNano())) max := 100 * time.Millisecond for i := 0; i < total; i++ { // start variable is solely for EWMA calculation // EWMA's unit of measure is an iteration's duration start := time.Now() time.Sleep(time.Duration(rng.Intn(10)+1) * max / 10) // we need to call EwmaIncrement to fulfill ewma decorator's contract bar.EwmaIncrement(time.Since(start)) } }() } // wait for passed wg and for all bars to complete and flush p.Wait() ``` #### [dynTotal example](_examples/dynTotal/main.go) ![dynTotal](_svg/godEMrCZmJkHYH1X9dN4Nm0U7.svg) #### [queueBar example](_examples/queueBar/main.go) ![queueBar](_svg/wHzf1M7sd7B3zVa2scBMnjqRf.svg) #### [io example](_examples/io/main.go) ![io](_svg/hIpTa3A5rQz65ssiVuRJu87X6.svg) ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/UNLICENSE ================================================ This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS 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. For more information, please refer to ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/bar.go ================================================ package mpb import ( "bytes" "context" "io" "math" "strings" "time" "github.com/acarl005/stripansi" "github.com/mattn/go-runewidth" "github.com/vbauerster/mpb/v8/decor" ) // Bar represents a progress bar. type Bar struct { index int // used by heap priority int // used by heap frameCh chan *renderFrame operateState chan func(*bState) container *Progress bs *bState bsOk chan struct{} ctx context.Context cancel func() } type decorSyncTable [2][]*decor.Sync type extenderFunc func(decor.Statistics, ...io.Reader) ([]io.Reader, error) // bState is actual bar's state. type bState struct { id int priority int reqWidth int shutdown int total int64 current int64 refill int64 buffers [3]*bytes.Buffer decorGroups [2][]decor.Decorator ewmaDecorators []decor.EwmaDecorator filler BarFiller extender extenderFunc renderReq chan<- time.Time waitBar *Bar // key for (*pState).queueBars trimSpace bool aborted bool triggerComplete bool rmOnComplete bool noPop bool autoRefresh bool } type renderFrame struct { rows []io.Reader shutdown int rmOnComplete bool noPop bool err error } // ProxyReader wraps io.Reader with metrics required for progress // tracking. If `r` is 'unknown total/size' reader it's mandatory // to call `(*Bar).SetTotal(-1, true)` after the wrapper returns // `io.EOF`. If bar is already completed or aborted, returns nil. // Panics if `r` is nil. func (b *Bar) ProxyReader(r io.Reader) io.ReadCloser { if r == nil { panic("expected non nil io.Reader") } result := make(chan io.ReadCloser, 1) select { case b.operateState <- func(s *bState) { result <- newProxyReader(r, b, len(s.ewmaDecorators) != 0) }: return <-result case <-b.ctx.Done(): return nil } } // ProxyWriter wraps io.Writer with metrics required for progress tracking. // If bar is already completed or aborted, returns nil. // Panics if `w` is nil. func (b *Bar) ProxyWriter(w io.Writer) io.WriteCloser { if w == nil { panic("expected non nil io.Writer") } result := make(chan io.WriteCloser, 1) select { case b.operateState <- func(s *bState) { result <- newProxyWriter(w, b, len(s.ewmaDecorators) != 0) }: return <-result case <-b.ctx.Done(): return nil } } // ID returns id of the bar. func (b *Bar) ID() int { result := make(chan int, 1) select { case b.operateState <- func(s *bState) { result <- s.id }: return <-result case <-b.bsOk: return b.bs.id } } // Current returns bar's current value, in other words sum of all increments. func (b *Bar) Current() int64 { result := make(chan int64, 1) select { case b.operateState <- func(s *bState) { result <- s.current }: return <-result case <-b.bsOk: return b.bs.current } } // SetRefill sets refill flag with specified amount. // The underlying BarFiller will change its visual representation, to // indicate refill event. Refill event may be referred to some retry // operation for example. func (b *Bar) SetRefill(amount int64) { select { case b.operateState <- func(s *bState) { s.refill = min(amount, s.current) }: case <-b.ctx.Done(): } } // SetRefillCurrent sets refill to the current amount. func (b *Bar) SetRefillCurrent() { b.SetRefill(math.MaxInt64) } // TraverseDecorators traverses available decorators and calls `cb` // on each unwrapped one. func (b *Bar) TraverseDecorators(cb func(decor.Decorator)) (ok bool) { select { case b.operateState <- func(s *bState) { for _, group := range s.decorGroups { for _, d := range group { cb(unwrap(d)) } } }: return true case <-b.ctx.Done(): return false } } // EnableTriggerComplete enables triggering complete event. It's effective // only for bars which were constructed with `total <= 0`. If `current >= total` // at the moment of call, complete event is triggered right away. func (b *Bar) EnableTriggerComplete() { select { case b.operateState <- func(s *bState) { if s.triggerComplete { return } s.triggerComplete = true if s.current >= s.total { s.current = s.total b.done(s.renderReq, s.autoRefresh) } }: case <-b.ctx.Done(): } } // SetTotal sets total to an arbitrary value. It's effective only for bar // which was constructed with `total <= 0`. Setting total to negative value // is equivalent to `(*Bar).SetTotal((*Bar).Current(), bool)` but faster. // If `complete` is true complete event is triggered right away. // Calling `(*Bar).EnableTriggerComplete` makes this one no operational. func (b *Bar) SetTotal(total int64, complete bool) { select { case b.operateState <- func(s *bState) { if s.triggerComplete { return } if total < 0 { s.total = s.current } else { s.total = total } if complete { s.current = s.total s.triggerComplete = true b.done(s.renderReq, s.autoRefresh) } }: case <-b.ctx.Done(): } } // SetCurrent sets progress' current to an arbitrary value. func (b *Bar) SetCurrent(current int64) { if current < 0 { return } select { case b.operateState <- func(s *bState) { s.current = current if s.triggerComplete && s.current >= s.total { s.current = s.total b.done(s.renderReq, s.autoRefresh) } }: case <-b.ctx.Done(): } } // Increment is a shorthand for b.IncrInt64(1). func (b *Bar) Increment() { b.IncrInt64(1) } // IncrBy is a shorthand for b.IncrInt64(int64(n)). func (b *Bar) IncrBy(n int) { b.IncrInt64(int64(n)) } // IncrInt64 increments progress by amount of n. func (b *Bar) IncrInt64(n int64) { select { case b.operateState <- func(s *bState) { s.current += n if s.triggerComplete && s.current >= s.total { s.current = s.total b.done(s.renderReq, s.autoRefresh) } }: case <-b.ctx.Done(): } } // EwmaIncrement is a shorthand for b.EwmaIncrInt64(1, iterDur). func (b *Bar) EwmaIncrement(iterDur time.Duration) { b.EwmaIncrInt64(1, iterDur) } // EwmaIncrBy is a shorthand for b.EwmaIncrInt64(int64(n), iterDur). func (b *Bar) EwmaIncrBy(n int, iterDur time.Duration) { b.EwmaIncrInt64(int64(n), iterDur) } // EwmaIncrInt64 increments progress by amount of n and updates EWMA based // decorators by dur of a single iteration. func (b *Bar) EwmaIncrInt64(n int64, iterDur time.Duration) { select { case b.operateState <- func(s *bState) { for _, d := range s.ewmaDecorators { d.EwmaUpdate(n, iterDur) } s.current += n if s.triggerComplete && s.current >= s.total { s.current = s.total b.done(s.renderReq, s.autoRefresh) } }: case <-b.ctx.Done(): } } // EwmaSetCurrent sets progress' current to an arbitrary value and updates // EWMA based decorators by dur of a single iteration. func (b *Bar) EwmaSetCurrent(current int64, iterDur time.Duration) { if current < 0 { return } select { case b.operateState <- func(s *bState) { n := current - s.current for _, d := range s.ewmaDecorators { d.EwmaUpdate(n, iterDur) } s.current = current if s.triggerComplete && s.current >= s.total { s.current = s.total b.done(s.renderReq, s.autoRefresh) } }: case <-b.ctx.Done(): } } // DecoratorAverageAdjust adjusts decorators implementing decor.AverageDecorator interface. // Call if there is need to set start time after decorators have been constructed. func (b *Bar) DecoratorAverageAdjust(start time.Time) { b.TraverseDecorators(func(d decor.Decorator) { if d, ok := d.(decor.AverageDecorator); ok { d.AverageAdjust(start) } }) } // SetPriority changes bar's order among multiple bars. Zero is highest // priority, i.e. bar will be on top. If you don't need to set priority // dynamically, better use BarPriority option. func (b *Bar) SetPriority(priority int) { b.container.UpdateBarPriority(b, priority, false) } // Abort interrupts bar's running goroutine. Abort won't be engaged // if bar is already in complete state. If drop is true bar will be // removed as well. To make sure that bar has been removed call // `(*Bar).Wait()` method. func (b *Bar) Abort(drop bool) { select { case b.operateState <- func(s *bState) { if s.aborted || s.completed() { return } s.aborted = true s.rmOnComplete = drop s.triggerComplete = true b.done(s.renderReq, s.autoRefresh) }: case <-b.ctx.Done(): } } // Aborted reports whether the bar is in aborted state. func (b *Bar) Aborted() bool { result := make(chan bool, 1) select { case b.operateState <- func(s *bState) { result <- s.aborted }: return <-result case <-b.bsOk: return b.bs.aborted } } // Completed reports whether the bar is in completed state. func (b *Bar) Completed() bool { result := make(chan bool, 1) select { case b.operateState <- func(s *bState) { result <- s.completed() }: return <-result case <-b.bsOk: return b.bs.completed() } } // AbortedOrCompleted reports whether a bar is in aborted or completed state. // Faster and atomic version of `(*Bar).Aborted() || (*Bar).Completed()`. func (b *Bar) AbortedOrCompleted() bool { result := make(chan bool, 1) select { case b.operateState <- func(s *bState) { result <- s.aborted || s.completed() }: return <-result case <-b.bsOk: return b.bs.aborted || b.bs.completed() } } // Wait blocks until bar is completed or aborted. func (b *Bar) Wait() { <-b.bsOk } func (b *Bar) serve(bs *bState) { decoratorsOnShutdown := func(group []decor.Decorator) { for _, d := range group { if d, ok := unwrap(d).(decor.ShutdownListener); ok { d.OnShutdown() } } } defer func() { decoratorsOnShutdown(bs.decorGroups[0]) decoratorsOnShutdown(bs.decorGroups[1]) b.bs = bs close(b.bsOk) b.container.bwg.Done() }() for { select { case op := <-b.operateState: op(bs) case <-b.ctx.Done(): // bar can be aborted by canceling parent ctx without calling b.Abort bs.aborted = bs.aborted || !bs.completed() return } } } func (b *Bar) render(tw int) { fn := func(s *bState) { frame := new(renderFrame) stat := s.newStatistics(tw) r, err := s.draw(stat) if err != nil { for _, buf := range s.buffers { buf.Reset() } frame.err = err b.frameCh <- frame return } frame.rows, frame.err = s.extender(stat, r) if s.aborted || s.completed() { frame.shutdown = s.shutdown frame.rmOnComplete = s.rmOnComplete frame.noPop = s.noPop // post increment makes sure OnComplete decorators are rendered s.shutdown++ } b.frameCh <- frame } select { case b.operateState <- fn: case <-b.bsOk: fn(b.bs) } } func (b *Bar) wSyncTable() decorSyncTable { result := make(chan decorSyncTable, 1) select { case b.operateState <- func(s *bState) { result <- s.wSyncTable() }: return <-result case <-b.bsOk: return b.bs.wSyncTable() } } func (s *bState) draw(stat decor.Statistics) (io.Reader, error) { decorFiller := func(buf *bytes.Buffer, group []decor.Decorator) (err error) { for i, d := range group { // need to call Decor in any case because of width synchronization str, width := d.Decor(stat) if i != 0 && err != nil { continue } if w := stat.AvailableWidth - width; w >= 0 { _, err = buf.WriteString(str) stat.AvailableWidth = w } else if stat.AvailableWidth > 0 { trunc := runewidth.Truncate(stripansi.Strip(str), stat.AvailableWidth, "…") _, err = buf.WriteString(trunc) stat.AvailableWidth = 0 } } return err } for i, buf := range s.buffers[1:] { err := decorFiller(buf, s.decorGroups[i]) if err != nil { return nil, err } } if s.trimSpace || stat.AvailableWidth < 2 { err := s.filler.Fill(s.buffers[0], stat) return io.MultiReader( s.buffers[1], s.buffers[0], s.buffers[2], strings.NewReader("\n"), ), err } stat.AvailableWidth -= 2 err := s.filler.Fill(s.buffers[0], stat) return io.MultiReader( s.buffers[1], strings.NewReader(" "), s.buffers[0], strings.NewReader(" "), s.buffers[2], strings.NewReader("\n"), ), err } func (s *bState) wSyncTable() (table decorSyncTable) { var start int var row []*decor.Sync for i, group := range s.decorGroups { for _, d := range group { if s, ok := d.Sync(); ok { row = append(row, s) } } table[i], start = row[start:], len(row) } return table } func (b *Bar) done(renderReq chan<- time.Time, autoRefresh bool) { if autoRefresh { // Technically this call isn't required, but if refresh rate is set to // one hour for example and bar completes within a few minutes p.Wait() // will wait for one hour. This call helps to avoid unnecessary waiting. go b.tryEarlyRefresh(renderReq) } else { b.cancel() } } func (b *Bar) tryEarlyRefresh(renderReq chan<- time.Time) { otherRunning := make(chan struct{}) ok := b.container.iterateBars(func(bar *Bar) bool { if b != bar && bar.isRunning() { close(otherRunning) return false // stop traverse } return true // continue traverse }) if ok { select { case <-otherRunning: default: for { select { case renderReq <- time.Now(): case <-b.ctx.Done(): return } } } } } func (b *Bar) isRunning() bool { select { case <-b.ctx.Done(): return false default: return true } } func (s *bState) completed() bool { return s.triggerComplete && s.current == s.total } func (s *bState) newStatistics(tw int) decor.Statistics { return decor.Statistics{ AvailableWidth: tw, RequestedWidth: s.reqWidth, ID: s.id, Total: s.total, Current: s.current, Refill: s.refill, Completed: s.completed(), Aborted: s.aborted, } } func unwrap(d decor.Decorator) decor.Decorator { if d, ok := d.(decor.Wrapper); ok { return unwrap(d.Unwrap()) } return d } ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/bar_filler.go ================================================ package mpb import ( "io" "github.com/vbauerster/mpb/v8/decor" ) // BarFiller interface. // Bar (without decorators) renders itself by calling BarFiller's Fill method. type BarFiller interface { Fill(io.Writer, decor.Statistics) error } // BarFillerBuilder interface. // Default implementations are: // // BarStyle() // SpinnerStyle() // NopStyle() type BarFillerBuilder interface { Build() BarFiller } // BarFillerFunc is function type adapter to convert compatible function // into BarFiller interface. type BarFillerFunc func(io.Writer, decor.Statistics) error func (f BarFillerFunc) Fill(w io.Writer, stat decor.Statistics) error { return f(w, stat) } ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/bar_filler_bar.go ================================================ package mpb import ( "io" "github.com/mattn/go-runewidth" "github.com/vbauerster/mpb/v8/decor" "github.com/vbauerster/mpb/v8/internal" ) const ( iLbound = iota iRefiller iFiller iTip iPadding iRbound iLen ) var defaultBarStyle = [iLen]string{"[", "+", "=", ">", "-", "]"} // BarStyleComposer interface. type BarStyleComposer interface { BarFillerBuilder Lbound(string) BarStyleComposer LboundMeta(func(string) string) BarStyleComposer Rbound(string) BarStyleComposer RboundMeta(func(string) string) BarStyleComposer Filler(string) BarStyleComposer FillerMeta(func(string) string) BarStyleComposer Refiller(string) BarStyleComposer RefillerMeta(func(string) string) BarStyleComposer Padding(string) BarStyleComposer PaddingMeta(func(string) string) BarStyleComposer Tip(frames ...string) BarStyleComposer TipMeta(func(string) string) BarStyleComposer TipOnComplete() BarStyleComposer Reverse() BarStyleComposer } type component struct { width int bytes []byte } type barSection struct { meta func(string) string bytes []byte } type barSections [iLen]barSection type barFiller struct { components [iLen]component metas [iLen]func(string) string flushOp func(barSections, io.Writer) error tip struct { onComplete bool count uint frames []component } } type barStyle struct { style [iLen]string metas [iLen]func(string) string tipFrames []string tipOnComplete bool rev bool } // BarStyle constructs default bar style which can be altered via // BarStyleComposer interface. func BarStyle() BarStyleComposer { bs := barStyle{ style: defaultBarStyle, tipFrames: []string{defaultBarStyle[iTip]}, } return bs } func (s barStyle) Lbound(bound string) BarStyleComposer { s.style[iLbound] = bound return s } func (s barStyle) LboundMeta(fn func(string) string) BarStyleComposer { s.metas[iLbound] = fn return s } func (s barStyle) Rbound(bound string) BarStyleComposer { s.style[iRbound] = bound return s } func (s barStyle) RboundMeta(fn func(string) string) BarStyleComposer { s.metas[iRbound] = fn return s } func (s barStyle) Filler(filler string) BarStyleComposer { s.style[iFiller] = filler return s } func (s barStyle) FillerMeta(fn func(string) string) BarStyleComposer { s.metas[iFiller] = fn return s } func (s barStyle) Refiller(refiller string) BarStyleComposer { s.style[iRefiller] = refiller return s } func (s barStyle) RefillerMeta(fn func(string) string) BarStyleComposer { s.metas[iRefiller] = fn return s } func (s barStyle) Padding(padding string) BarStyleComposer { s.style[iPadding] = padding return s } func (s barStyle) PaddingMeta(fn func(string) string) BarStyleComposer { s.metas[iPadding] = fn return s } func (s barStyle) Tip(frames ...string) BarStyleComposer { if len(frames) != 0 { s.tipFrames = frames } return s } func (s barStyle) TipMeta(fn func(string) string) BarStyleComposer { s.metas[iTip] = fn return s } func (s barStyle) TipOnComplete() BarStyleComposer { s.tipOnComplete = true return s } func (s barStyle) Reverse() BarStyleComposer { s.rev = true return s } func (s barStyle) Build() BarFiller { bf := &barFiller{metas: s.metas} bf.components[iLbound] = component{ width: runewidth.StringWidth(s.style[iLbound]), bytes: []byte(s.style[iLbound]), } bf.components[iRbound] = component{ width: runewidth.StringWidth(s.style[iRbound]), bytes: []byte(s.style[iRbound]), } bf.components[iFiller] = component{ width: runewidth.StringWidth(s.style[iFiller]), bytes: []byte(s.style[iFiller]), } bf.components[iRefiller] = component{ width: runewidth.StringWidth(s.style[iRefiller]), bytes: []byte(s.style[iRefiller]), } bf.components[iPadding] = component{ width: runewidth.StringWidth(s.style[iPadding]), bytes: []byte(s.style[iPadding]), } bf.tip.onComplete = s.tipOnComplete bf.tip.frames = make([]component, 0, len(s.tipFrames)) for _, t := range s.tipFrames { bf.tip.frames = append(bf.tip.frames, component{ width: runewidth.StringWidth(t), bytes: []byte(t), }) } if s.rev { bf.flushOp = barSections.flushRev } else { bf.flushOp = barSections.flush } return bf } func (s *barFiller) Fill(w io.Writer, stat decor.Statistics) error { width := internal.CheckRequestedWidth(stat.RequestedWidth, stat.AvailableWidth) // don't count brackets as progress width -= (s.components[iLbound].width + s.components[iRbound].width) if width < 0 { return nil } var tip component var refilling, filling, padding []byte var fillCount int curWidth := int(internal.PercentageRound(stat.Total, stat.Current, int64(width))) if curWidth != 0 { if !stat.Completed || s.tip.onComplete { tip = s.tip.frames[s.tip.count%uint(len(s.tip.frames))] s.tip.count++ fillCount += tip.width } switch refWidth := 0; { case stat.Refill != 0: refWidth = int(internal.PercentageRound(stat.Total, stat.Refill, int64(width))) curWidth -= refWidth refWidth += curWidth fallthrough default: for w := s.components[iFiller].width; curWidth-fillCount >= w; fillCount += w { filling = append(filling, s.components[iFiller].bytes...) } for w := s.components[iRefiller].width; refWidth-fillCount >= w; fillCount += w { refilling = append(refilling, s.components[iRefiller].bytes...) } } } for w := s.components[iPadding].width; width-fillCount >= w; fillCount += w { padding = append(padding, s.components[iPadding].bytes...) } for w := 1; width-fillCount >= w; fillCount += w { padding = append(padding, "…"...) } return s.flushOp(barSections{ {s.metas[iLbound], s.components[iLbound].bytes}, {s.metas[iRefiller], refilling}, {s.metas[iFiller], filling}, {s.metas[iTip], tip.bytes}, {s.metas[iPadding], padding}, {s.metas[iRbound], s.components[iRbound].bytes}, }, w) } func (s barSection) flush(w io.Writer) (err error) { if s.meta != nil { _, err = io.WriteString(w, s.meta(string(s.bytes))) } else { _, err = w.Write(s.bytes) } return err } func (bb barSections) flush(w io.Writer) error { for _, s := range bb { err := s.flush(w) if err != nil { return err } } return nil } func (bb barSections) flushRev(w io.Writer) error { bb[0], bb[len(bb)-1] = bb[len(bb)-1], bb[0] for i := len(bb) - 1; i >= 0; i-- { err := bb[i].flush(w) if err != nil { return err } } return nil } ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/bar_filler_nop.go ================================================ package mpb import ( "io" "github.com/vbauerster/mpb/v8/decor" ) // barFillerBuilderFunc is function type adapter to convert compatible // function into BarFillerBuilder interface. type barFillerBuilderFunc func() BarFiller func (f barFillerBuilderFunc) Build() BarFiller { return f() } // NopStyle provides BarFillerBuilder which builds NOP BarFiller. func NopStyle() BarFillerBuilder { return barFillerBuilderFunc(func() BarFiller { return BarFillerFunc(func(io.Writer, decor.Statistics) error { return nil }) }) } ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/bar_filler_spinner.go ================================================ package mpb import ( "io" "strings" "github.com/mattn/go-runewidth" "github.com/vbauerster/mpb/v8/decor" "github.com/vbauerster/mpb/v8/internal" ) const ( positionLeft = 1 + iota positionRight ) var defaultSpinnerStyle = [...]string{"⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"} // SpinnerStyleComposer interface. type SpinnerStyleComposer interface { BarFillerBuilder PositionLeft() SpinnerStyleComposer PositionRight() SpinnerStyleComposer Meta(func(string) string) SpinnerStyleComposer } type spinnerFiller struct { frames []string count uint meta func(string) string position func(string, int) string } type spinnerStyle struct { position uint frames []string meta func(string) string } // SpinnerStyle constructs default spinner style which can be altered via // SpinnerStyleComposer interface. func SpinnerStyle(frames ...string) SpinnerStyleComposer { var ss spinnerStyle if len(frames) != 0 { ss.frames = frames } else { ss.frames = defaultSpinnerStyle[:] } return ss } func (s spinnerStyle) PositionLeft() SpinnerStyleComposer { s.position = positionLeft return s } func (s spinnerStyle) PositionRight() SpinnerStyleComposer { s.position = positionRight return s } func (s spinnerStyle) Meta(fn func(string) string) SpinnerStyleComposer { s.meta = fn return s } func (s spinnerStyle) Build() BarFiller { sf := &spinnerFiller{frames: s.frames} switch s.position { case positionLeft: sf.position = func(frame string, padWidth int) string { return frame + strings.Repeat(" ", padWidth) } case positionRight: sf.position = func(frame string, padWidth int) string { return strings.Repeat(" ", padWidth) + frame } default: sf.position = func(frame string, padWidth int) string { return strings.Repeat(" ", padWidth/2) + frame + strings.Repeat(" ", padWidth/2+padWidth%2) } } if s.meta != nil { sf.meta = s.meta } else { sf.meta = func(s string) string { return s } } return sf } func (s *spinnerFiller) Fill(w io.Writer, stat decor.Statistics) error { width := internal.CheckRequestedWidth(stat.RequestedWidth, stat.AvailableWidth) frame := s.frames[s.count%uint(len(s.frames))] frameWidth := runewidth.StringWidth(frame) s.count++ if width < frameWidth { return nil } _, err := io.WriteString(w, s.position(s.meta(frame), width-frameWidth)) return err } ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/bar_heap.go ================================================ package mpb import "container/heap" var _ heap.Interface = (*barHeap)(nil) type barHeap []*Bar func (s barHeap) Len() int { return len(s) } // it's a reversed Less same as sort.Reverse(sort.Interface) would do // becasuse we need greater priority item to pop first func (s barHeap) Less(i, j int) bool { return s[j].priority < s[i].priority } func (s barHeap) Swap(i, j int) { s[i], s[j] = s[j], s[i] s[i].index = i s[j].index = j } func (h *barHeap) Push(x interface{}) { b := x.(*Bar) b.index = h.Len() *h = append(*h, b) } func (h *barHeap) Pop() interface{} { s := *h i := s.Len() - 1 b := s[i] b.index = -1 // for safety s[i] = nil // nil to avoid memory leak *h = s[:i] return b } ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/bar_option.go ================================================ package mpb import ( "bytes" "io" "github.com/vbauerster/mpb/v8/decor" ) // BarOption is a func option to alter default behavior of a bar. type BarOption func(*bState) // PrependDecorators let you inject decorators to the bar's left side. func PrependDecorators(decorators ...decor.Decorator) BarOption { var group []decor.Decorator for _, decorator := range decorators { if decorator != nil { group = append(group, decorator) } } return func(s *bState) { s.decorGroups[0] = group } } // AppendDecorators let you inject decorators to the bar's right side. func AppendDecorators(decorators ...decor.Decorator) BarOption { var group []decor.Decorator for _, decorator := range decorators { if decorator != nil { group = append(group, decorator) } } return func(s *bState) { s.decorGroups[1] = group } } // BarID sets bar id. func BarID(id int) BarOption { return func(s *bState) { s.id = id } } // BarWidth sets bar width independent of the container. func BarWidth(width int) BarOption { return func(s *bState) { s.reqWidth = width } } // BarQueueAfter puts this (being constructed) bar into the queue. // BarPriority will be inherited from the argument bar. // When argument bar completes or aborts queued bar replaces its place. func BarQueueAfter(bar *Bar) BarOption { return func(s *bState) { s.waitBar = bar } } // BarRemoveOnComplete removes both bar's filler and its decorators // on complete event. func BarRemoveOnComplete() BarOption { return func(s *bState) { s.rmOnComplete = true } } // BarFillerClearOnComplete clears bar's filler on complete event. // It's shortcut for BarFillerOnComplete(""). func BarFillerClearOnComplete() BarOption { return BarFillerOnComplete("") } // BarFillerOnComplete replaces bar's filler with message, on complete event. func BarFillerOnComplete(message string) BarOption { return BarFillerMiddleware(func(base BarFiller) BarFiller { return BarFillerFunc(func(w io.Writer, st decor.Statistics) error { if st.Completed { _, err := io.WriteString(w, message) return err } return base.Fill(w, st) }) }) } // BarFillerClearOnAbort clears bar's filler on abort event. // It's shortcut for BarFillerOnAbort(""). func BarFillerClearOnAbort() BarOption { return BarFillerOnAbort("") } // BarFillerOnAbort replaces bar's filler with message, on abort event. func BarFillerOnAbort(message string) BarOption { return BarFillerMiddleware(func(base BarFiller) BarFiller { return BarFillerFunc(func(w io.Writer, st decor.Statistics) error { if st.Aborted { _, err := io.WriteString(w, message) return err } return base.Fill(w, st) }) }) } // BarFillerMiddleware provides a way to augment the underlying BarFiller. func BarFillerMiddleware(middle func(BarFiller) BarFiller) BarOption { if middle == nil { return nil } return func(s *bState) { s.filler = middle(s.filler) } } // BarPriority sets bar's priority. Zero is highest priority, i.e. bar // will be on top. This option isn't effective with `BarQueueAfter` option. func BarPriority(priority int) BarOption { return func(s *bState) { s.priority = priority } } // BarExtender extends bar with arbitrary lines. Provided BarFiller will be // called at each render/flush cycle. Any lines written to the underlying // io.Writer will extend the bar either in above (rev = true) or below // (rev = false) direction. func BarExtender(filler BarFiller, rev bool) BarOption { if filler == nil { return nil } if f, ok := filler.(BarFillerFunc); ok && f == nil { return nil } fn := makeExtenderFunc(filler, rev) return func(s *bState) { s.extender = fn } } func makeExtenderFunc(filler BarFiller, rev bool) extenderFunc { buf := new(bytes.Buffer) base := func(stat decor.Statistics, rows ...io.Reader) ([]io.Reader, error) { err := filler.Fill(buf, stat) if err != nil { buf.Reset() return rows, err } for { line, err := buf.ReadBytes('\n') if err != nil { buf.Reset() break } rows = append(rows, bytes.NewReader(line)) } return rows, err } if !rev { return base } return func(stat decor.Statistics, rows ...io.Reader) ([]io.Reader, error) { rows, err := base(stat, rows...) if err != nil { return rows, err } for left, right := 0, len(rows)-1; left < right; left, right = left+1, right-1 { rows[left], rows[right] = rows[right], rows[left] } return rows, err } } // BarFillerTrim removes leading and trailing space around the underlying BarFiller. func BarFillerTrim() BarOption { return func(s *bState) { s.trimSpace = true } } // BarNoPop disables bar pop out of container. Effective when // PopCompletedMode of container is enabled. func BarNoPop() BarOption { return func(s *bState) { s.noPop = true } } // BarOptional will return provided option only when cond is true. func BarOptional(option BarOption, cond bool) BarOption { if cond { return option } return nil } // BarOptOn will return provided option only when predicate evaluates to true. func BarOptOn(option BarOption, predicate func() bool) BarOption { if predicate() { return option } return nil } // BarFuncOptional will call option and return its value only when cond is true. func BarFuncOptional(option func() BarOption, cond bool) BarOption { if cond { return option() } return nil } // BarFuncOptOn will call option and return its value only when predicate evaluates to true. func BarFuncOptOn(option func() BarOption, predicate func() bool) BarOption { if predicate() { return option() } return nil } ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/container_option.go ================================================ package mpb import ( "cmp" "io" "sync" "time" ) // ContainerOption is a func option to alter default behavior of a bar // container. Container term refers to a Progress struct which can // hold one or more Bars. type ContainerOption func(*pState) // WithWaitGroup provides means to have a single joint point. If // *sync.WaitGroup is provided, you can safely call just p.Wait() // without calling Wait() on provided *sync.WaitGroup. Makes sense // when there are more than one bar to render. func WithWaitGroup(wg *sync.WaitGroup) ContainerOption { return func(s *pState) { s.uwg = wg } } // WithWidth sets container width. If not set it defaults to terminal // width. A bar added to the container will inherit its width, unless // overridden by `func BarWidth(int) BarOption`. func WithWidth(width int) ContainerOption { return func(s *pState) { s.reqWidth = width } } // WithQueueLen sets buffer size of heap manager channel. Ideally it must be // kept at MAX value, where MAX is number of bars to be rendered at the same // time. Default queue len is 64. func WithQueueLen(len int) ContainerOption { return func(s *pState) { s.hmQueueLen = len } } // WithRefreshRate overrides default 150ms refresh rate. func WithRefreshRate(d time.Duration) ContainerOption { return func(s *pState) { s.refreshRate = d } } // WithManualRefresh disables internal auto refresh time.Ticker. // Refresh will occur upon receive value from provided ch. func WithManualRefresh(ch <-chan interface{}) ContainerOption { return func(s *pState) { s.manualRC = ch } } // WithRenderDelay delays rendering. By default rendering starts as // soon as bar is added, with this option it's possible to delay // rendering process by keeping provided chan unclosed. In other words // rendering will start as soon as provided chan is closed. func WithRenderDelay(ch <-chan struct{}) ContainerOption { return func(s *pState) { s.delayRC = ch } } // WithShutdownNotifier closes provided channel on shutdown event, // i.e. after `(*Progress) Wait()` or `(*Progress) Shutdown()` call. func WithShutdownNotifier(ch chan interface{}) ContainerOption { return func(s *pState) { s.shutdownNotifier = ch } } // WithOutput overrides default os.Stdout output. If underlying io.Writer // is not a terminal then auto refresh is disabled unless WithAutoRefresh // option is set. func WithOutput(w io.Writer) ContainerOption { return func(s *pState) { s.output = cmp.Or(w, io.Discard) } } // WithDebugOutput sets debug output. func WithDebugOutput(w io.Writer) ContainerOption { return func(s *pState) { s.debugOut = cmp.Or(w, io.Discard) } } // WithAutoRefresh force auto refresh regardless of what output is set to. // Applicable only if not WithManualRefresh set. func WithAutoRefresh() ContainerOption { return func(s *pState) { s.autoRefresh = true } } // PopCompletedMode pop completed bars out of progress container. // In this mode completed bars get moved to the top and stop // participating in rendering cycle. func PopCompletedMode() ContainerOption { return func(s *pState) { s.popCompleted = true } } // ContainerOptional will return provided option only when cond is true. func ContainerOptional(option ContainerOption, cond bool) ContainerOption { if cond { return option } return nil } // ContainerOptOn will return provided option only when predicate evaluates to true. func ContainerOptOn(option ContainerOption, predicate func() bool) ContainerOption { if predicate() { return option } return nil } // ContainerFuncOptional will call option and return its value only when cond is true. func ContainerFuncOptional(option func() ContainerOption, cond bool) ContainerOption { if cond { return option() } return nil } // ContainerFuncOptOn will call option and return its value only when predicate evaluates to true. func ContainerFuncOptOn(option func() ContainerOption, predicate func() bool) ContainerOption { if predicate() { return option() } return nil } // withHandOverBarHeap for test purposes only func withHandOverBarHeap(ch chan<- []*Bar) ContainerOption { return func(s *pState) { s.handOverBarHeap = ch } } ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/cwriter/doc.go ================================================ // Package cwriter is a console writer abstraction for the underlying OS. package cwriter ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/cwriter/util_bsd.go ================================================ //go:build darwin || dragonfly || freebsd || netbsd || openbsd package cwriter import "golang.org/x/sys/unix" const ioctlReadTermios = unix.TIOCGETA ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/cwriter/util_linux.go ================================================ //go:build aix || linux package cwriter import "golang.org/x/sys/unix" const ioctlReadTermios = unix.TCGETS ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/cwriter/util_solaris.go ================================================ //go:build solaris package cwriter import "golang.org/x/sys/unix" const ioctlReadTermios = unix.TCGETA ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/cwriter/util_zos.go ================================================ //go:build zos package cwriter import "golang.org/x/sys/unix" const ioctlReadTermios = unix.TCGETS ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/cwriter/writer.go ================================================ package cwriter import ( "bytes" "errors" "io" "os" "strconv" ) // https://github.com/dylanaraps/pure-sh-bible#cursor-movement const ( escOpen = "\x1b[" cuuAndEd = "A\x1b[J" ) // ErrNotTTY not a TeleTYpewriter error. var ErrNotTTY = errors.New("not a terminal") // New returns a new Writer with defaults. func New(out io.Writer) *Writer { w := &Writer{ Buffer: new(bytes.Buffer), out: out, termSize: func(_ int) (int, int, error) { return -1, -1, ErrNotTTY }, } if f, ok := out.(*os.File); ok { w.fd = int(f.Fd()) if IsTerminal(w.fd) { w.terminal = true w.termSize = GetSize } } bb := make([]byte, 16) w.ew = escWriter(bb[:copy(bb, []byte(escOpen))]) return w } // IsTerminal tells whether underlying io.Writer is terminal. func (w *Writer) IsTerminal() bool { return w.terminal } // GetTermSize returns WxH of underlying terminal. func (w *Writer) GetTermSize() (width, height int, err error) { return w.termSize(w.fd) } type escWriter []byte func (b escWriter) ansiCuuAndEd(out io.Writer, n int) error { b = strconv.AppendInt(b, int64(n), 10) _, err := out.Write(append(b, []byte(cuuAndEd)...)) return err } ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/cwriter/writer_posix.go ================================================ //go:build !windows package cwriter import ( "bytes" "io" "golang.org/x/sys/unix" ) // Writer is a buffered terminal writer, which moves cursor N lines up // on each flush except the first one, where N is a number of lines of // a previous flush. type Writer struct { *bytes.Buffer out io.Writer ew escWriter fd int terminal bool termSize func(int) (int, int, error) } // Flush flushes the underlying buffer. // It's caller's responsibility to pass correct number of lines. func (w *Writer) Flush(lines int) error { _, err := w.WriteTo(w.out) // some terminals interpret 'cursor up 0' as 'cursor up 1' if err == nil && lines > 0 { err = w.ew.ansiCuuAndEd(w, lines) } return err } // GetSize returns the dimensions of the given terminal. func GetSize(fd int) (width, height int, err error) { ws, err := unix.IoctlGetWinsize(fd, unix.TIOCGWINSZ) if err != nil { return -1, -1, err } return int(ws.Col), int(ws.Row), nil } // IsTerminal returns whether the given file descriptor is a terminal. func IsTerminal(fd int) bool { _, err := unix.IoctlGetTermios(fd, ioctlReadTermios) return err == nil } ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/cwriter/writer_windows.go ================================================ //go:build windows package cwriter import ( "bytes" "io" "unsafe" "golang.org/x/sys/windows" ) var kernel32 = windows.NewLazySystemDLL("kernel32.dll") var ( procSetConsoleCursorPosition = kernel32.NewProc("SetConsoleCursorPosition") procFillConsoleOutputCharacter = kernel32.NewProc("FillConsoleOutputCharacterW") ) // Writer is a buffered terminal writer, which moves cursor N lines up // on each flush except the first one, where N is a number of lines of // a previous flush. type Writer struct { *bytes.Buffer out io.Writer ew escWriter lines int fd int terminal bool termSize func(int) (int, int, error) } // Flush flushes the underlying buffer. // It's caller's responsibility to pass correct number of lines. func (w *Writer) Flush(lines int) error { if w.lines > 0 { err := w.clearLines(w.lines) if err != nil { return err } } w.lines = lines _, err := w.WriteTo(w.out) return err } func (w *Writer) clearLines(n int) error { if !w.terminal { // hope it's cygwin or similar return w.ew.ansiCuuAndEd(w.out, n) } var info windows.ConsoleScreenBufferInfo if err := windows.GetConsoleScreenBufferInfo(windows.Handle(w.fd), &info); err != nil { return err } info.CursorPosition.Y -= int16(n) if info.CursorPosition.Y < 0 { info.CursorPosition.Y = 0 } _, _, _ = procSetConsoleCursorPosition.Call( uintptr(w.fd), uintptr(uint32(uint16(info.CursorPosition.Y))<<16|uint32(uint16(info.CursorPosition.X))), ) // clear the lines cursor := &windows.Coord{ X: info.Window.Left, Y: info.CursorPosition.Y, } count := uint32(info.Size.X) * uint32(n) _, _, _ = procFillConsoleOutputCharacter.Call( uintptr(w.fd), uintptr(' '), uintptr(count), *(*uintptr)(unsafe.Pointer(cursor)), uintptr(unsafe.Pointer(new(uint32))), ) return nil } // GetSize returns the visible dimensions of the given terminal. // These dimensions don't include any scrollback buffer height. func GetSize(fd int) (width, height int, err error) { var info windows.ConsoleScreenBufferInfo if err := windows.GetConsoleScreenBufferInfo(windows.Handle(fd), &info); err != nil { return 0, 0, err } // terminal.GetSize from crypto/ssh adds "+ 1" to both width and height: // https://go.googlesource.com/crypto/+/refs/heads/release-branch.go1.14/ssh/terminal/util_windows.go#75 // but looks like this is a root cause of issue #66, so removing both "+ 1" have fixed it. return int(info.Window.Right - info.Window.Left), int(info.Window.Bottom - info.Window.Top), nil } // IsTerminal returns whether the given file descriptor is a terminal. func IsTerminal(fd int) bool { var st uint32 err := windows.GetConsoleMode(windows.Handle(fd), &st) return err == nil } ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/decor/any.go ================================================ package decor var _ Decorator = any{} // Any decorator. // Converts DecorFunc into Decorator. // // `fn` DecorFunc callback // `wcc` optional WC config func Any(fn DecorFunc, wcc ...WC) Decorator { return any{initWC(wcc...), fn} } type any struct { WC fn DecorFunc } func (d any) Decor(s Statistics) (string, int) { return d.Format(d.fn(s)) } ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/decor/counters.go ================================================ package decor import ( "fmt" ) // CountersNoUnit is a wrapper around Counters with no unit param. func CountersNoUnit(pairFmt string, wcc ...WC) Decorator { return Counters(0, pairFmt, wcc...) } // CountersKibiByte is a wrapper around Counters with predefined unit // as SizeB1024(0). func CountersKibiByte(pairFmt string, wcc ...WC) Decorator { return Counters(SizeB1024(0), pairFmt, wcc...) } // CountersKiloByte is a wrapper around Counters with predefined unit // as SizeB1000(0). func CountersKiloByte(pairFmt string, wcc ...WC) Decorator { return Counters(SizeB1000(0), pairFmt, wcc...) } // Counters decorator with dynamic unit measure adjustment. // // `unit` one of [0|SizeB1024(0)|SizeB1000(0)] // // `pairFmt` printf compatible verbs for current and total // // `wcc` optional WC config // // pairFmt example if unit=SizeB1000(0): // // pairFmt="%d / %d" output: "1MB / 12MB" // pairFmt="% d / % d" output: "1 MB / 12 MB" // pairFmt="%.1f / %.1f" output: "1.0MB / 12.0MB" // pairFmt="% .1f / % .1f" output: "1.0 MB / 12.0 MB" // pairFmt="%f / %f" output: "1.000000MB / 12.000000MB" // pairFmt="% f / % f" output: "1.000000 MB / 12.000000 MB" func Counters(unit interface{}, pairFmt string, wcc ...WC) Decorator { producer := func() DecorFunc { switch unit.(type) { case SizeB1024: if pairFmt == "" { pairFmt = "% d / % d" } return func(s Statistics) string { return fmt.Sprintf(pairFmt, SizeB1024(s.Current), SizeB1024(s.Total)) } case SizeB1000: if pairFmt == "" { pairFmt = "% d / % d" } return func(s Statistics) string { return fmt.Sprintf(pairFmt, SizeB1000(s.Current), SizeB1000(s.Total)) } default: if pairFmt == "" { pairFmt = "%d / %d" } return func(s Statistics) string { return fmt.Sprintf(pairFmt, s.Current, s.Total) } } } return Any(producer(), wcc...) } // TotalNoUnit is a wrapper around Total with no unit param. func TotalNoUnit(format string, wcc ...WC) Decorator { return Total(0, format, wcc...) } // TotalKibiByte is a wrapper around Total with predefined unit // as SizeB1024(0). func TotalKibiByte(format string, wcc ...WC) Decorator { return Total(SizeB1024(0), format, wcc...) } // TotalKiloByte is a wrapper around Total with predefined unit // as SizeB1000(0). func TotalKiloByte(format string, wcc ...WC) Decorator { return Total(SizeB1000(0), format, wcc...) } // Total decorator with dynamic unit measure adjustment. // // `unit` one of [0|SizeB1024(0)|SizeB1000(0)] // // `format` printf compatible verb for Total // // `wcc` optional WC config // // format example if unit=SizeB1024(0): // // format="%d" output: "12MiB" // format="% d" output: "12 MiB" // format="%.1f" output: "12.0MiB" // format="% .1f" output: "12.0 MiB" // format="%f" output: "12.000000MiB" // format="% f" output: "12.000000 MiB" func Total(unit interface{}, format string, wcc ...WC) Decorator { producer := func() DecorFunc { switch unit.(type) { case SizeB1024: if format == "" { format = "% d" } return func(s Statistics) string { return fmt.Sprintf(format, SizeB1024(s.Total)) } case SizeB1000: if format == "" { format = "% d" } return func(s Statistics) string { return fmt.Sprintf(format, SizeB1000(s.Total)) } default: if format == "" { format = "%d" } return func(s Statistics) string { return fmt.Sprintf(format, s.Total) } } } return Any(producer(), wcc...) } // CurrentNoUnit is a wrapper around Current with no unit param. func CurrentNoUnit(format string, wcc ...WC) Decorator { return Current(0, format, wcc...) } // CurrentKibiByte is a wrapper around Current with predefined unit // as SizeB1024(0). func CurrentKibiByte(format string, wcc ...WC) Decorator { return Current(SizeB1024(0), format, wcc...) } // CurrentKiloByte is a wrapper around Current with predefined unit // as SizeB1000(0). func CurrentKiloByte(format string, wcc ...WC) Decorator { return Current(SizeB1000(0), format, wcc...) } // Current decorator with dynamic unit measure adjustment. // // `unit` one of [0|SizeB1024(0)|SizeB1000(0)] // // `format` printf compatible verb for Current // // `wcc` optional WC config // // format example if unit=SizeB1024(0): // // format="%d" output: "12MiB" // format="% d" output: "12 MiB" // format="%.1f" output: "12.0MiB" // format="% .1f" output: "12.0 MiB" // format="%f" output: "12.000000MiB" // format="% f" output: "12.000000 MiB" func Current(unit interface{}, format string, wcc ...WC) Decorator { producer := func() DecorFunc { switch unit.(type) { case SizeB1024: if format == "" { format = "% d" } return func(s Statistics) string { return fmt.Sprintf(format, SizeB1024(s.Current)) } case SizeB1000: if format == "" { format = "% d" } return func(s Statistics) string { return fmt.Sprintf(format, SizeB1000(s.Current)) } default: if format == "" { format = "%d" } return func(s Statistics) string { return fmt.Sprintf(format, s.Current) } } } return Any(producer(), wcc...) } // InvertedCurrentNoUnit is a wrapper around InvertedCurrent with no unit param. func InvertedCurrentNoUnit(format string, wcc ...WC) Decorator { return InvertedCurrent(0, format, wcc...) } // InvertedCurrentKibiByte is a wrapper around InvertedCurrent with predefined unit // as SizeB1024(0). func InvertedCurrentKibiByte(format string, wcc ...WC) Decorator { return InvertedCurrent(SizeB1024(0), format, wcc...) } // InvertedCurrentKiloByte is a wrapper around InvertedCurrent with predefined unit // as SizeB1000(0). func InvertedCurrentKiloByte(format string, wcc ...WC) Decorator { return InvertedCurrent(SizeB1000(0), format, wcc...) } // InvertedCurrent decorator with dynamic unit measure adjustment. // // `unit` one of [0|SizeB1024(0)|SizeB1000(0)] // // `format` printf compatible verb for InvertedCurrent // // `wcc` optional WC config // // format example if unit=SizeB1024(0): // // format="%d" output: "12MiB" // format="% d" output: "12 MiB" // format="%.1f" output: "12.0MiB" // format="% .1f" output: "12.0 MiB" // format="%f" output: "12.000000MiB" // format="% f" output: "12.000000 MiB" func InvertedCurrent(unit interface{}, format string, wcc ...WC) Decorator { producer := func() DecorFunc { switch unit.(type) { case SizeB1024: if format == "" { format = "% d" } return func(s Statistics) string { return fmt.Sprintf(format, SizeB1024(s.Total-s.Current)) } case SizeB1000: if format == "" { format = "% d" } return func(s Statistics) string { return fmt.Sprintf(format, SizeB1000(s.Total-s.Current)) } default: if format == "" { format = "%d" } return func(s Statistics) string { return fmt.Sprintf(format, s.Total-s.Current) } } } return Any(producer(), wcc...) } ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/decor/decorator.go ================================================ package decor import ( "fmt" "time" "github.com/mattn/go-runewidth" ) const ( // DindentRight sets indentation from right to left. // // |foo |b | DindentRight is set // | foo| b| DindentRight is not set DindentRight = 1 << iota // DextraSpace bit adds extra indentation space. DextraSpace // DSyncWidth bit enables same column width synchronization. // Effective with multiple bars only. DSyncWidth // DSyncWidthR is shortcut for DSyncWidth|DindentRight DSyncWidthR = DSyncWidth | DindentRight // DSyncSpace is shortcut for DSyncWidth|DextraSpace DSyncSpace = DSyncWidth | DextraSpace // DSyncSpaceR is shortcut for DSyncWidth|DextraSpace|DindentRight DSyncSpaceR = DSyncWidth | DextraSpace | DindentRight ) // TimeStyle enum. type TimeStyle int // TimeStyle kinds. const ( ET_STYLE_GO TimeStyle = iota ET_STYLE_HHMMSS ET_STYLE_HHMM ET_STYLE_MMSS ) // Statistics contains fields which are necessary for implementing // `decor.Decorator` and `mpb.BarFiller` interfaces. type Statistics struct { AvailableWidth int // calculated width initially equal to terminal width RequestedWidth int // width set by `mpb.WithWidth` ID int Total int64 Current int64 Refill int64 Completed bool Aborted bool } // Decorator interface. // Most of the time there is no need to implement this interface // manually, as decor package already provides a wide range of decorators // which implement this interface. If however built-in decorators don't // meet your needs, you're free to implement your own one by implementing // this particular interface. The easy way to go is to convert a // `DecorFunc` into a `Decorator` interface by using provided // `func Any(DecorFunc, ...WC) Decorator`. type Decorator interface { Synchronizer Formatter Decor(Statistics) (str string, viewWidth int) } // DecorFunc func type. // To be used with `func Any(DecorFunc, ...WC) Decorator`. type DecorFunc func(Statistics) string // Sync type used by Synchronizer. type Sync struct { Tx chan int Rx chan int } // Synchronizer interface. // All decorators implement this interface implicitly. Its Sync // method exposes width sync channel, if DSyncWidth bit is set. type Synchronizer interface { Sync() (*Sync, bool) } // Formatter interface. // Format method needs to be called from within Decorator.Decor method // in order to format string according to decor.WC settings. // No need to implement manually as long as decor.WC is embedded. type Formatter interface { Format(string) (_ string, width int) } // Wrapper interface. // If you're implementing custom Decorator by wrapping a built-in one, // it is necessary to implement this interface to retain functionality // of built-in Decorator. type Wrapper interface { Unwrap() Decorator } // EwmaDecorator interface. // EWMA based decorators should implement this one. type EwmaDecorator interface { EwmaUpdate(int64, time.Duration) } // AverageDecorator interface. // Average decorators should implement this interface to provide start // time adjustment facility, for resume-able tasks. type AverageDecorator interface { AverageAdjust(time.Time) } // ShutdownListener interface. // If decorator needs to be notified once upon bar shutdown event, so // this is the right interface to implement. type ShutdownListener interface { OnShutdown() } // Global convenience instances of WC with sync width bit set. // To be used with multiple bars only, i.e. not effective for single bar usage. var ( WCSyncWidth = WC{C: DSyncWidth} WCSyncWidthR = WC{C: DSyncWidthR} WCSyncSpace = WC{C: DSyncSpace} WCSyncSpaceR = WC{C: DSyncSpaceR} ) // WC is a struct with two public fields W and C, both of int type. // W represents width and C represents bit set of width related config. // A decorator should embed WC, to enable width synchronization. type WC struct { W int C int sync *Sync fill func(s string, w int) string } // Format should be called by any Decorator implementation. // Returns formatted string and its view (visual) width. func (wc WC) Format(str string) (string, int) { width := runewidth.StringWidth(str) if wc.W > width { width = wc.W } else if (wc.C & DextraSpace) != 0 { width++ } if (wc.C & DSyncWidth) != 0 { wc.sync.Tx <- width width = <-wc.sync.Rx } return wc.fill(str, width), width } // Init initializes width related config. func (wc *WC) Init() WC { if (wc.C & DindentRight) != 0 { wc.fill = runewidth.FillRight } else { wc.fill = runewidth.FillLeft } if (wc.C & DSyncWidth) != 0 { // it's deliberate choice to override wc.sync on each Init() call, // this way globals like WCSyncSpace can be reused wc.sync = &Sync{make(chan int, 1), make(chan int, 1)} } return *wc } // Sync is implementation of Synchronizer interface. func (wc WC) Sync() (*Sync, bool) { if (wc.C&DSyncWidth) != 0 && wc.sync == nil { panic(fmt.Sprintf("%T is not initialized", wc)) } return wc.sync, (wc.C & DSyncWidth) != 0 } func initWC(wcc ...WC) WC { var wc WC for _, nwc := range wcc { wc = nwc } return wc.Init() } ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/decor/doc.go ================================================ // Package decor provides common decorators for "github.com/vbauerster/mpb/v8" module. // // Some decorators returned by this package might have a closure state. It is ok to use // decorators concurrently, unless you share the same decorator among multiple // *mpb.Bar instances. To avoid data races, create new decorator per *mpb.Bar instance. // // Don't: // // p := mpb.New() // name := decor.Name("bar") // p.AddBar(100, mpb.AppendDecorators(name)) // p.AddBar(100, mpb.AppendDecorators(name)) // // Do: // // p := mpb.New() // p.AddBar(100, mpb.AppendDecorators(decor.Name("bar1"))) // p.AddBar(100, mpb.AppendDecorators(decor.Name("bar2"))) package decor ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/decor/elapsed.go ================================================ package decor import ( "time" ) // Elapsed decorator. It's wrapper of NewElapsed. // // `style` one of [ET_STYLE_GO|ET_STYLE_HHMMSS|ET_STYLE_HHMM|ET_STYLE_MMSS] // // `wcc` optional WC config func Elapsed(style TimeStyle, wcc ...WC) Decorator { return NewElapsed(style, time.Now(), wcc...) } // NewElapsed returns elapsed time decorator. // // `style` one of [ET_STYLE_GO|ET_STYLE_HHMMSS|ET_STYLE_HHMM|ET_STYLE_MMSS] // // `start` start time // // `wcc` optional WC config func NewElapsed(style TimeStyle, start time.Time, wcc ...WC) Decorator { var msg string producer := chooseTimeProducer(style) fn := func(s Statistics) string { if !s.Completed && !s.Aborted { msg = producer(time.Since(start)) } return msg } return Any(fn, wcc...) } ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/decor/eta.go ================================================ package decor import ( "fmt" "math" "time" "github.com/VividCortex/ewma" ) var ( _ Decorator = (*movingAverageETA)(nil) _ EwmaDecorator = (*movingAverageETA)(nil) _ Decorator = (*averageETA)(nil) _ AverageDecorator = (*averageETA)(nil) ) // TimeNormalizer interface. Implementers could be passed into // MovingAverageETA, in order to affect i.e. normalize its output. type TimeNormalizer interface { Normalize(time.Duration) time.Duration } // TimeNormalizerFunc is function type adapter to convert function // into TimeNormalizer. type TimeNormalizerFunc func(time.Duration) time.Duration func (f TimeNormalizerFunc) Normalize(src time.Duration) time.Duration { return f(src) } // EwmaETA exponential-weighted-moving-average based ETA decorator. For this // decorator to work correctly you have to measure each iteration's duration // and pass it to one of the (*Bar).EwmaIncr... family methods. func EwmaETA(style TimeStyle, age float64, wcc ...WC) Decorator { return EwmaNormalizedETA(style, age, nil, wcc...) } // EwmaNormalizedETA same as EwmaETA but with TimeNormalizer option. func EwmaNormalizedETA(style TimeStyle, age float64, normalizer TimeNormalizer, wcc ...WC) Decorator { var average ewma.MovingAverage if age == 0 { average = ewma.NewMovingAverage() } else { average = ewma.NewMovingAverage(age) } return MovingAverageETA(style, average, normalizer, wcc...) } // MovingAverageETA decorator relies on MovingAverage implementation to calculate its average. // // `style` one of [ET_STYLE_GO|ET_STYLE_HHMMSS|ET_STYLE_HHMM|ET_STYLE_MMSS] // // `average` implementation of MovingAverage interface // // `normalizer` available implementations are [FixedIntervalTimeNormalizer|MaxTolerateTimeNormalizer] // // `wcc` optional WC config func MovingAverageETA(style TimeStyle, average ewma.MovingAverage, normalizer TimeNormalizer, wcc ...WC) Decorator { if average == nil { average = NewMedian() } d := &movingAverageETA{ WC: initWC(wcc...), producer: chooseTimeProducer(style), average: average, normalizer: normalizer, } return d } type movingAverageETA struct { WC producer func(time.Duration) string average ewma.MovingAverage normalizer TimeNormalizer zDur time.Duration } func (d *movingAverageETA) Decor(s Statistics) (string, int) { v := math.Round(d.average.Value()) remaining := time.Duration((s.Total - s.Current) * int64(v)) if d.normalizer != nil { remaining = d.normalizer.Normalize(remaining) } return d.Format(d.producer(remaining)) } func (d *movingAverageETA) EwmaUpdate(n int64, dur time.Duration) { if n <= 0 { d.zDur += dur return } durPerItem := float64(d.zDur+dur) / float64(n) if math.IsInf(durPerItem, 0) || math.IsNaN(durPerItem) { d.zDur += dur return } d.zDur = 0 d.average.Add(durPerItem) } // AverageETA decorator. It's wrapper of NewAverageETA. // // `style` one of [ET_STYLE_GO|ET_STYLE_HHMMSS|ET_STYLE_HHMM|ET_STYLE_MMSS] // // `wcc` optional WC config func AverageETA(style TimeStyle, wcc ...WC) Decorator { return NewAverageETA(style, time.Now(), nil, wcc...) } // NewAverageETA decorator with user provided start time. // // `style` one of [ET_STYLE_GO|ET_STYLE_HHMMSS|ET_STYLE_HHMM|ET_STYLE_MMSS] // // `start` start time // // `normalizer` available implementations are [FixedIntervalTimeNormalizer|MaxTolerateTimeNormalizer] // // `wcc` optional WC config func NewAverageETA(style TimeStyle, start time.Time, normalizer TimeNormalizer, wcc ...WC) Decorator { d := &averageETA{ WC: initWC(wcc...), start: start, normalizer: normalizer, producer: chooseTimeProducer(style), } return d } type averageETA struct { WC start time.Time normalizer TimeNormalizer producer func(time.Duration) string } func (d *averageETA) Decor(s Statistics) (string, int) { var remaining time.Duration if s.Current != 0 { durPerItem := float64(time.Since(d.start)) / float64(s.Current) durPerItem = math.Round(durPerItem) remaining = time.Duration((s.Total - s.Current) * int64(durPerItem)) if d.normalizer != nil { remaining = d.normalizer.Normalize(remaining) } } return d.Format(d.producer(remaining)) } func (d *averageETA) AverageAdjust(start time.Time) { d.start = start } // MaxTolerateTimeNormalizer returns implementation of TimeNormalizer. func MaxTolerateTimeNormalizer(maxTolerate time.Duration) TimeNormalizer { var normalized time.Duration var lastCall time.Time return TimeNormalizerFunc(func(remaining time.Duration) time.Duration { if diff := normalized - remaining; diff <= 0 || diff > maxTolerate || remaining < time.Minute { normalized = remaining lastCall = time.Now() return remaining } normalized -= time.Since(lastCall) lastCall = time.Now() if normalized > 0 { return normalized } return remaining }) } // FixedIntervalTimeNormalizer returns implementation of TimeNormalizer. func FixedIntervalTimeNormalizer(updInterval int) TimeNormalizer { var normalized time.Duration var lastCall time.Time var count int return TimeNormalizerFunc(func(remaining time.Duration) time.Duration { if count == 0 || remaining < time.Minute { count = updInterval normalized = remaining lastCall = time.Now() return remaining } count-- normalized -= time.Since(lastCall) lastCall = time.Now() if normalized > 0 { return normalized } return remaining }) } func chooseTimeProducer(style TimeStyle) func(time.Duration) string { switch style { case ET_STYLE_HHMMSS: return func(remaining time.Duration) string { hours := int64(remaining/time.Hour) % 60 minutes := int64(remaining/time.Minute) % 60 seconds := int64(remaining/time.Second) % 60 return fmt.Sprintf("%02d:%02d:%02d", hours, minutes, seconds) } case ET_STYLE_HHMM: return func(remaining time.Duration) string { hours := int64(remaining/time.Hour) % 60 minutes := int64(remaining/time.Minute) % 60 return fmt.Sprintf("%02d:%02d", hours, minutes) } case ET_STYLE_MMSS: return func(remaining time.Duration) string { hours := int64(remaining/time.Hour) % 60 minutes := int64(remaining/time.Minute) % 60 seconds := int64(remaining/time.Second) % 60 if hours > 0 { return fmt.Sprintf("%02d:%02d:%02d", hours, minutes, seconds) } return fmt.Sprintf("%02d:%02d", minutes, seconds) } default: return func(remaining time.Duration) string { return remaining.Truncate(time.Second).String() } } } ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/decor/meta.go ================================================ package decor var ( _ Decorator = metaWrapper{} _ Wrapper = metaWrapper{} ) // Meta wrap decorator. // Provided fn is supposed to wrap output of given decorator // with meta information like ANSI escape codes for example. // Primary usage intention is to set SGR display attributes. // // `decorator` Decorator to wrap // `fn` func to apply meta information func Meta(decorator Decorator, fn func(string) string) Decorator { if decorator == nil { return nil } return metaWrapper{decorator, fn} } type metaWrapper struct { Decorator fn func(string) string } func (d metaWrapper) Decor(s Statistics) (string, int) { str, width := d.Decorator.Decor(s) return d.fn(str), width } func (d metaWrapper) Unwrap() Decorator { return d.Decorator } ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/decor/moving_average.go ================================================ package decor import ( "sort" "sync" "github.com/VividCortex/ewma" ) var ( _ ewma.MovingAverage = (*threadSafeMovingAverage)(nil) _ ewma.MovingAverage = (*medianWindow)(nil) _ sort.Interface = (*medianWindow)(nil) ) type threadSafeMovingAverage struct { ewma.MovingAverage mu sync.Mutex } func (s *threadSafeMovingAverage) Add(value float64) { s.mu.Lock() s.MovingAverage.Add(value) s.mu.Unlock() } func (s *threadSafeMovingAverage) Value() float64 { s.mu.Lock() defer s.mu.Unlock() return s.MovingAverage.Value() } func (s *threadSafeMovingAverage) Set(value float64) { s.mu.Lock() s.MovingAverage.Set(value) s.mu.Unlock() } // NewThreadSafeMovingAverage converts provided ewma.MovingAverage // into thread safe ewma.MovingAverage. func NewThreadSafeMovingAverage(average ewma.MovingAverage) ewma.MovingAverage { if tsma, ok := average.(*threadSafeMovingAverage); ok { return tsma } return &threadSafeMovingAverage{MovingAverage: average} } type medianWindow [3]float64 func (s *medianWindow) Len() int { return len(s) } func (s *medianWindow) Swap(i, j int) { s[i], s[j] = s[j], s[i] } func (s *medianWindow) Less(i, j int) bool { return s[i] < s[j] } func (s *medianWindow) Add(value float64) { s[0], s[1] = s[1], s[2] s[2] = value } func (s *medianWindow) Value() float64 { tmp := *s sort.Sort(&tmp) return tmp[1] } func (s *medianWindow) Set(value float64) { for i := 0; i < len(s); i++ { s[i] = value } } // NewMedian is fixed last 3 samples median MovingAverage. func NewMedian() ewma.MovingAverage { return new(medianWindow) } ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/decor/name.go ================================================ package decor // Name decorator displays text that is set once and can't be changed // during decorator's lifetime. // // `str` string to display // // `wcc` optional WC config func Name(str string, wcc ...WC) Decorator { return Any(func(Statistics) string { return str }, wcc...) } ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/decor/on_abort.go ================================================ package decor var ( _ Decorator = onAbortWrapper{} _ Wrapper = onAbortWrapper{} _ Decorator = onAbortMetaWrapper{} _ Wrapper = onAbortMetaWrapper{} ) // OnAbort wrap decorator. // Displays provided message on abort event. // Has no effect if bar.Abort(true) is called. // // `decorator` Decorator to wrap // `message` message to display func OnAbort(decorator Decorator, message string) Decorator { if decorator == nil { return nil } return onAbortWrapper{decorator, message} } type onAbortWrapper struct { Decorator msg string } func (d onAbortWrapper) Decor(s Statistics) (string, int) { if s.Aborted { return d.Format(d.msg) } return d.Decorator.Decor(s) } func (d onAbortWrapper) Unwrap() Decorator { return d.Decorator } // OnAbortMeta wrap decorator. // Provided fn is supposed to wrap output of given decorator // with meta information like ANSI escape codes for example. // Primary usage intention is to set SGR display attributes. // // `decorator` Decorator to wrap // `fn` func to apply meta information func OnAbortMeta(decorator Decorator, fn func(string) string) Decorator { if decorator == nil { return nil } return onAbortMetaWrapper{decorator, fn} } type onAbortMetaWrapper struct { Decorator fn func(string) string } func (d onAbortMetaWrapper) Decor(s Statistics) (string, int) { if s.Aborted { str, width := d.Decorator.Decor(s) return d.fn(str), width } return d.Decorator.Decor(s) } func (d onAbortMetaWrapper) Unwrap() Decorator { return d.Decorator } ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/decor/on_abort_or_on_complete.go ================================================ package decor // OnAbortOrOnComplete wrap decorator. // Displays provided message on abort or on complete event. // // `decorator` Decorator to wrap // `message` message to display func OnAbortOrOnComplete(decorator Decorator, message string) Decorator { return OnAbort(OnComplete(decorator, message), message) } // OnAbortMetaOrOnCompleteMeta wrap decorator. // Provided fn is supposed to wrap output of given decorator // with meta information like ANSI escape codes for example. // Primary usage intention is to set SGR display attributes. // // `decorator` Decorator to wrap // `fn` func to apply meta information func OnAbortMetaOrOnCompleteMeta(decorator Decorator, fn func(string) string) Decorator { return OnAbortMeta(OnCompleteMeta(decorator, fn), fn) } ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/decor/on_complete.go ================================================ package decor var ( _ Decorator = onCompleteWrapper{} _ Wrapper = onCompleteWrapper{} _ Decorator = onCompleteMetaWrapper{} _ Wrapper = onCompleteMetaWrapper{} ) // OnComplete wrap decorator. // Displays provided message on complete event. // // `decorator` Decorator to wrap // `message` message to display func OnComplete(decorator Decorator, message string) Decorator { if decorator == nil { return nil } return onCompleteWrapper{decorator, message} } type onCompleteWrapper struct { Decorator msg string } func (d onCompleteWrapper) Decor(s Statistics) (string, int) { if s.Completed { return d.Format(d.msg) } return d.Decorator.Decor(s) } func (d onCompleteWrapper) Unwrap() Decorator { return d.Decorator } // OnCompleteMeta wrap decorator. // Provided fn is supposed to wrap output of given decorator // with meta information like ANSI escape codes for example. // Primary usage intention is to set SGR display attributes. // // `decorator` Decorator to wrap // `fn` func to apply meta information func OnCompleteMeta(decorator Decorator, fn func(string) string) Decorator { if decorator == nil { return nil } return onCompleteMetaWrapper{decorator, fn} } type onCompleteMetaWrapper struct { Decorator fn func(string) string } func (d onCompleteMetaWrapper) Decor(s Statistics) (string, int) { if s.Completed { str, width := d.Decorator.Decor(s) return d.fn(str), width } return d.Decorator.Decor(s) } func (d onCompleteMetaWrapper) Unwrap() Decorator { return d.Decorator } ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/decor/on_complete_or_on_abort.go ================================================ package decor // OnCompleteOrOnAbort wrap decorator. // Displays provided message on complete or on abort event. // // `decorator` Decorator to wrap // `message` message to display func OnCompleteOrOnAbort(decorator Decorator, message string) Decorator { return OnComplete(OnAbort(decorator, message), message) } // OnCompleteMetaOrOnAbortMeta wrap decorator. // Provided fn is supposed to wrap output of given decorator // with meta information like ANSI escape codes for example. // Primary usage intention is to set SGR display attributes. // // `decorator` Decorator to wrap // `fn` func to apply meta information func OnCompleteMetaOrOnAbortMeta(decorator Decorator, fn func(string) string) Decorator { return OnCompleteMeta(OnAbortMeta(decorator, fn), fn) } ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/decor/on_condition.go ================================================ package decor // OnCondition applies decorator only if a condition is true. // // `decorator` Decorator // // `cond` bool func OnCondition(decorator Decorator, cond bool) Decorator { return Conditional(cond, decorator, nil) } // OnPredicate applies decorator only if a predicate evaluates to true. // // `decorator` Decorator // // `predicate` func() bool func OnPredicate(decorator Decorator, predicate func() bool) Decorator { return Predicative(predicate, decorator, nil) } // Conditional returns decorator `a` if condition is true, otherwise // decorator `b`. // // `cond` bool // // `a` Decorator // // `b` Decorator func Conditional(cond bool, a, b Decorator) Decorator { if cond { return a } else { return b } } // Predicative returns decorator `a` if predicate evaluates to true, // otherwise decorator `b`. // // `predicate` func() bool // // `a` Decorator // // `b` Decorator func Predicative(predicate func() bool, a, b Decorator) Decorator { if predicate() { return a } else { return b } } ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/decor/percentage.go ================================================ package decor import ( "fmt" "strconv" "github.com/vbauerster/mpb/v8/internal" ) var _ fmt.Formatter = percentageType(0) type percentageType float64 func (s percentageType) Format(st fmt.State, verb rune) { prec := -1 switch verb { case 'f', 'e', 'E': prec = 6 // default prec of fmt.Printf("%f|%e|%E") fallthrough case 'b', 'g', 'G', 'x', 'X': if p, ok := st.Precision(); ok { prec = p } default: verb, prec = 'f', 0 } b := strconv.AppendFloat(make([]byte, 0, 16), float64(s), byte(verb), prec, 64) if st.Flag(' ') { b = append(b, ' ', '%') } else { b = append(b, '%') } _, err := st.Write(b) if err != nil { panic(err) } } // Percentage returns percentage decorator. It's a wrapper of NewPercentage. func Percentage(wcc ...WC) Decorator { return NewPercentage("% d", wcc...) } // NewPercentage percentage decorator with custom format string. // // `format` printf compatible verb // // `wcc` optional WC config // // format examples: // // format="%d" output: "1%" // format="% d" output: "1 %" // format="%.1f" output: "1.0%" // format="% .1f" output: "1.0 %" // format="%f" output: "1.000000%" // format="% f" output: "1.000000 %" func NewPercentage(format string, wcc ...WC) Decorator { if format == "" { format = "% d" } f := func(s Statistics) string { p := internal.Percentage(s.Total, s.Current, 100) return fmt.Sprintf(format, percentageType(p)) } return Any(f, wcc...) } ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/decor/size_type.go ================================================ //go:generate go tool stringer -type=SizeB1024 -trimprefix=_i //go:generate go tool stringer -type=SizeB1000 -trimprefix=_ package decor import ( "fmt" "strconv" ) var ( _ fmt.Formatter = SizeB1024(0) _ fmt.Stringer = SizeB1024(0) _ fmt.Formatter = SizeB1000(0) _ fmt.Stringer = SizeB1000(0) ) const ( _ib SizeB1024 = iota + 1 _iKiB SizeB1024 = 1 << (iota * 10) _iMiB _iGiB _iTiB ) // SizeB1024 named type, which implements fmt.Formatter interface. It // adjusts its value according to byte size multiple by 1024 and appends // appropriate size marker (KiB, MiB, GiB, TiB). type SizeB1024 int64 func (s SizeB1024) Format(f fmt.State, verb rune) { prec := -1 switch verb { case 'f', 'e', 'E': prec = 6 // default prec of fmt.Printf("%f|%e|%E") fallthrough case 'b', 'g', 'G', 'x', 'X': if p, ok := f.Precision(); ok { prec = p } default: verb, prec = 'f', 0 } var unit SizeB1024 switch { case s < _iKiB: unit = _ib case s < _iMiB: unit = _iKiB case s < _iGiB: unit = _iMiB case s < _iTiB: unit = _iGiB default: unit = _iTiB } b := strconv.AppendFloat(make([]byte, 0, 24), float64(s)/float64(unit), byte(verb), prec, 64) if f.Flag(' ') { b = append(b, ' ') } b = append(b, []byte(unit.String())...) _, err := f.Write(b) if err != nil { panic(err) } } const ( _b SizeB1000 = 1 _KB SizeB1000 = _b * 1000 _MB SizeB1000 = _KB * 1000 _GB SizeB1000 = _MB * 1000 _TB SizeB1000 = _GB * 1000 ) // SizeB1000 named type, which implements fmt.Formatter interface. It // adjusts its value according to byte size multiple by 1000 and appends // appropriate size marker (KB, MB, GB, TB). type SizeB1000 int64 func (s SizeB1000) Format(f fmt.State, verb rune) { prec := -1 switch verb { case 'f', 'e', 'E': prec = 6 // default prec of fmt.Printf("%f|%e|%E") fallthrough case 'b', 'g', 'G', 'x', 'X': if p, ok := f.Precision(); ok { prec = p } default: verb, prec = 'f', 0 } var unit SizeB1000 switch { case s < _KB: unit = _b case s < _MB: unit = _KB case s < _GB: unit = _MB case s < _TB: unit = _GB default: unit = _TB } b := strconv.AppendFloat(make([]byte, 0, 24), float64(s)/float64(unit), byte(verb), prec, 64) if f.Flag(' ') { b = append(b, ' ') } b = append(b, []byte(unit.String())...) _, err := f.Write(b) if err != nil { panic(err) } } ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/decor/sizeb1000_string.go ================================================ // Code generated by "stringer -type=SizeB1000 -trimprefix=_"; DO NOT EDIT. package decor import "strconv" func _() { // An "invalid array index" compiler error signifies that the constant values have changed. // Re-run the stringer command to generate them again. var x [1]struct{} _ = x[_b-1] _ = x[_KB-1000] _ = x[_MB-1000000] _ = x[_GB-1000000000] _ = x[_TB-1000000000000] } const ( _SizeB1000_name_0 = "b" _SizeB1000_name_1 = "KB" _SizeB1000_name_2 = "MB" _SizeB1000_name_3 = "GB" _SizeB1000_name_4 = "TB" ) func (i SizeB1000) String() string { switch { case i == 1: return _SizeB1000_name_0 case i == 1000: return _SizeB1000_name_1 case i == 1000000: return _SizeB1000_name_2 case i == 1000000000: return _SizeB1000_name_3 case i == 1000000000000: return _SizeB1000_name_4 default: return "SizeB1000(" + strconv.FormatInt(int64(i), 10) + ")" } } ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/decor/sizeb1024_string.go ================================================ // Code generated by "stringer -type=SizeB1024 -trimprefix=_i"; DO NOT EDIT. package decor import "strconv" func _() { // An "invalid array index" compiler error signifies that the constant values have changed. // Re-run the stringer command to generate them again. var x [1]struct{} _ = x[_ib-1] _ = x[_iKiB-1024] _ = x[_iMiB-1048576] _ = x[_iGiB-1073741824] _ = x[_iTiB-1099511627776] } const ( _SizeB1024_name_0 = "b" _SizeB1024_name_1 = "KiB" _SizeB1024_name_2 = "MiB" _SizeB1024_name_3 = "GiB" _SizeB1024_name_4 = "TiB" ) func (i SizeB1024) String() string { switch { case i == 1: return _SizeB1024_name_0 case i == 1024: return _SizeB1024_name_1 case i == 1048576: return _SizeB1024_name_2 case i == 1073741824: return _SizeB1024_name_3 case i == 1099511627776: return _SizeB1024_name_4 default: return "SizeB1024(" + strconv.FormatInt(int64(i), 10) + ")" } } ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/decor/speed.go ================================================ package decor import ( "fmt" "io" "math" "time" "github.com/VividCortex/ewma" ) var ( _ Decorator = (*movingAverageSpeed)(nil) _ EwmaDecorator = (*movingAverageSpeed)(nil) _ Decorator = (*averageSpeed)(nil) _ AverageDecorator = (*averageSpeed)(nil) ) // FmtAsSpeed adds "/s" to the end of the input formatter. To be // used with SizeB1000 or SizeB1024 types, for example: // // fmt.Printf("%.1f", FmtAsSpeed(SizeB1024(2048))) func FmtAsSpeed(input fmt.Formatter) fmt.Formatter { return &speedFormatter{input} } type speedFormatter struct { fmt.Formatter } func (s *speedFormatter) Format(st fmt.State, verb rune) { s.Formatter.Format(st, verb) _, err := io.WriteString(st, "/s") if err != nil { panic(err) } } // EwmaSpeed exponential-weighted-moving-average based speed decorator. // For this decorator to work correctly you have to measure each iteration's // duration and pass it to one of the (*Bar).EwmaIncr... family methods. func EwmaSpeed(unit interface{}, format string, age float64, wcc ...WC) Decorator { var average ewma.MovingAverage if age == 0 { average = ewma.NewMovingAverage() } else { average = ewma.NewMovingAverage(age) } return MovingAverageSpeed(unit, format, average, wcc...) } // MovingAverageSpeed decorator relies on MovingAverage implementation // to calculate its average. // // `unit` one of [0|SizeB1024(0)|SizeB1000(0)] // // `format` printf compatible verb for value, like "%f" or "%d" // // `average` MovingAverage implementation // // `wcc` optional WC config // // format examples: // // unit=SizeB1024(0), format="%.1f" output: "1.0MiB/s" // unit=SizeB1024(0), format="% .1f" output: "1.0 MiB/s" // unit=SizeB1000(0), format="%.1f" output: "1.0MB/s" // unit=SizeB1000(0), format="% .1f" output: "1.0 MB/s" func MovingAverageSpeed(unit interface{}, format string, average ewma.MovingAverage, wcc ...WC) Decorator { d := &movingAverageSpeed{ WC: initWC(wcc...), producer: chooseSpeedProducer(unit, format), average: average, } return d } type movingAverageSpeed struct { WC producer func(float64) string average ewma.MovingAverage zDur time.Duration } func (d *movingAverageSpeed) Decor(_ Statistics) (string, int) { var str string // ewma implementation may return 0 before accumulating certain number of samples if v := d.average.Value(); v != 0 { str = d.producer(1e9 / v) } else { str = d.producer(0) } return d.Format(str) } func (d *movingAverageSpeed) EwmaUpdate(n int64, dur time.Duration) { if n <= 0 { d.zDur += dur return } durPerByte := float64(d.zDur+dur) / float64(n) if math.IsInf(durPerByte, 0) || math.IsNaN(durPerByte) { d.zDur += dur return } d.zDur = 0 d.average.Add(durPerByte) } // AverageSpeed decorator with dynamic unit measure adjustment. It's // a wrapper of NewAverageSpeed. func AverageSpeed(unit interface{}, format string, wcc ...WC) Decorator { return NewAverageSpeed(unit, format, time.Now(), wcc...) } // NewAverageSpeed decorator with dynamic unit measure adjustment and // user provided start time. // // `unit` one of [0|SizeB1024(0)|SizeB1000(0)] // // `format` printf compatible verb for value, like "%f" or "%d" // // `start` start time // // `wcc` optional WC config // // format examples: // // unit=SizeB1024(0), format="%.1f" output: "1.0MiB/s" // unit=SizeB1024(0), format="% .1f" output: "1.0 MiB/s" // unit=SizeB1000(0), format="%.1f" output: "1.0MB/s" // unit=SizeB1000(0), format="% .1f" output: "1.0 MB/s" func NewAverageSpeed(unit interface{}, format string, start time.Time, wcc ...WC) Decorator { d := &averageSpeed{ WC: initWC(wcc...), start: start, producer: chooseSpeedProducer(unit, format), } return d } type averageSpeed struct { WC start time.Time producer func(float64) string msg string } func (d *averageSpeed) Decor(s Statistics) (string, int) { if !s.Completed { speed := float64(s.Current) / float64(time.Since(d.start)) d.msg = d.producer(speed * 1e9) } return d.Format(d.msg) } func (d *averageSpeed) AverageAdjust(start time.Time) { d.start = start } func chooseSpeedProducer(unit interface{}, format string) func(float64) string { switch unit.(type) { case SizeB1024: if format == "" { format = "% d" } return func(speed float64) string { return fmt.Sprintf(format, FmtAsSpeed(SizeB1024(math.Round(speed)))) } case SizeB1000: if format == "" { format = "% d" } return func(speed float64) string { return fmt.Sprintf(format, FmtAsSpeed(SizeB1000(math.Round(speed)))) } default: if format == "" { format = "%f" } return func(speed float64) string { return fmt.Sprintf(format, speed) } } } ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/decor/spinner.go ================================================ package decor var defaultSpinnerStyle = [...]string{"⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"} // Spinner returns spinner decorator. // // `frames` spinner frames, if nil or len==0, default is used // // `wcc` optional WC config func Spinner(frames []string, wcc ...WC) Decorator { if len(frames) == 0 { frames = defaultSpinnerStyle[:] } var count uint f := func(s Statistics) string { frame := frames[count%uint(len(frames))] count++ return frame } return Any(f, wcc...) } ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/doc.go ================================================ // Package mpb is a library for rendering progress bars in terminal applications. package mpb ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/heap_manager.go ================================================ package mpb import ( "container/heap" "iter" "slices" "sync" "github.com/vbauerster/mpb/v8/decor" ) type heapManager chan heapRequest type heapCmd int const ( h_sync heapCmd = iota h_push h_render h_iter h_fix ) type heapRequest struct { cmd heapCmd data interface{} } type pushData struct { bar *Bar sync bool } type renderData struct { width int seqCh chan<- iter.Seq[*Bar] } type fixData struct { bar *Bar priority int lazy bool } func (m heapManager) run(pwg *sync.WaitGroup, shutdown <-chan interface{}, handOverBarHeap chan<- []*Bar) { var bHeap barHeap var sync bool var prevLen int var pMatrix map[int][]*decor.Sync var aMatrix map[int][]*decor.Sync defer func() { if handOverBarHeap != nil { ordered := make([]*Bar, 0, bHeap.Len()) for bHeap.Len() != 0 { ordered = append(ordered, heap.Pop(&bHeap).(*Bar)) } handOverBarHeap <- ordered } pwg.Done() }() for req := range m { switch req.cmd { case h_sync: if sync || prevLen != bHeap.Len() { pMatrix = make(map[int][]*decor.Sync) aMatrix = make(map[int][]*decor.Sync) for _, b := range bHeap { table := b.wSyncTable() for i, s := range table[0] { pMatrix[i] = append(pMatrix[i], s) } for i, s := range table[1] { aMatrix[i] = append(aMatrix[i], s) } } sync, prevLen = false, bHeap.Len() } syncWidth(pMatrix, shutdown) syncWidth(aMatrix, shutdown) case h_push: data := req.data.(pushData) heap.Push(&bHeap, data.bar) sync = sync || data.sync case h_render: data := req.data.(renderData) for _, b := range bHeap { go b.render(data.width) } ordered := make([]*Bar, 0, bHeap.Len()) for bHeap.Len() != 0 { ordered = append(ordered, heap.Pop(&bHeap).(*Bar)) } data.seqCh <- slices.Values(ordered) case h_iter: seqCh := req.data.(chan<- iter.Seq[*Bar]) done := make(chan struct{}) seqCh <- func(yield func(*Bar) bool) { defer close(done) for _, b := range bHeap { if !yield(b) { break } } } <-done case h_fix: data := req.data.(fixData) if data.bar.index < 0 { break } data.bar.priority = data.priority if !data.lazy { heap.Fix(&bHeap, data.bar.index) } } } } func (m heapManager) sync() { m <- heapRequest{cmd: h_sync} } func (m heapManager) push(b *Bar, sync bool) { data := pushData{b, sync} m <- heapRequest{cmd: h_push, data: data} } func (m heapManager) render(width int) iter.Seq[*Bar] { seqCh := make(chan iter.Seq[*Bar], 1) m <- heapRequest{cmd: h_render, data: renderData{ width: width, seqCh: seqCh, }} return <-seqCh } func (m heapManager) iter(seqCh chan<- iter.Seq[*Bar]) { m <- heapRequest{cmd: h_iter, data: seqCh} } func (m heapManager) fix(b *Bar, priority int, lazy bool) { data := fixData{b, priority, lazy} m <- heapRequest{cmd: h_fix, data: data} } func syncWidth(matrix map[int][]*decor.Sync, done <-chan interface{}) { for _, column := range matrix { go maxWidthDistributor(column, done) } } func maxWidthDistributor(column []*decor.Sync, done <-chan interface{}) { var maxWidth int for _, s := range column { select { case w := <-s.Tx: if w > maxWidth { maxWidth = w } case <-done: return } } for _, s := range column { s.Rx <- maxWidth } } ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/internal/percentage.go ================================================ package internal import "math" // Percentage is a helper function, to calculate percentage. func Percentage(total, current, width int64) float64 { if total == 0 { return 0 } if current >= total { return float64(width) } return float64(width*current) / float64(total) } // PercentageRound same as Percentage but with math.Round. func PercentageRound(total, current, width int64) float64 { if total < 0 || current < 0 { return 0 } return math.Round(Percentage(total, current, width)) } ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/internal/width.go ================================================ package internal // CheckRequestedWidth checks that requested width doesn't overflow // available width func CheckRequestedWidth(requested, available int) int { if requested < 1 || requested > available { return available } return requested } ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/progress.go ================================================ package mpb import ( "bytes" "cmp" "context" "fmt" "io" "iter" "math" "os" "sync" "time" "github.com/vbauerster/mpb/v8/cwriter" "github.com/vbauerster/mpb/v8/decor" ) const defaultRefreshRate = 150 * time.Millisecond const defaultHmQueueLength = 64 // ErrDone represents use after `(*Progress).Wait()` error. var ErrDone = fmt.Errorf("%T instance can't be reused after %[1]T.Wait()", (*Progress)(nil)) // Progress represents a container that renders one or more progress bars. type Progress struct { pwg, bwg *sync.WaitGroup operateState chan func(*pState) interceptIO chan func(io.Writer) done <-chan struct{} ctx context.Context cancel func() } type queueBar struct { state *bState bar *Bar } // pState holds bars in its priorityQueue, it gets passed to (*Progress).serve monitor goroutine. type pState struct { hm heapManager renderReq chan time.Time idCount int popPriority int // following are provided/overrode by user hmQueueLen int reqWidth int refreshRate time.Duration delayRC <-chan struct{} manualRC <-chan interface{} shutdownNotifier chan interface{} handOverBarHeap chan<- []*Bar queueBars map[*Bar]*queueBar output io.Writer debugOut io.Writer uwg *sync.WaitGroup popCompleted bool autoRefresh bool rmOnComplete bool } // New creates new Progress container instance. It's not possible to // reuse instance after `(*Progress).Wait` method has been called. func New(options ...ContainerOption) *Progress { return NewWithContext(context.Background(), options...) } // NewWithContext creates new Progress container instance with provided // context. It's not possible to reuse instance after `(*Progress).Wait` // method has been called. func NewWithContext(ctx context.Context, options ...ContainerOption) *Progress { if ctx == nil { ctx = context.Background() } ctx, cancel := context.WithCancel(ctx) s := &pState{ hmQueueLen: defaultHmQueueLength, renderReq: make(chan time.Time), popPriority: math.MinInt32, refreshRate: defaultRefreshRate, queueBars: make(map[*Bar]*queueBar), output: os.Stdout, debugOut: io.Discard, } for _, opt := range options { if opt != nil { opt(s) } } if s.shutdownNotifier == nil { s.shutdownNotifier = make(chan interface{}) } s.hm = make(heapManager, s.hmQueueLen) p := &Progress{ pwg: new(sync.WaitGroup), bwg: new(sync.WaitGroup), operateState: make(chan func(*pState)), interceptIO: make(chan func(io.Writer)), ctx: ctx, cancel: cancel, } cw := cwriter.New(s.output) switch { case s.manualRC != nil: done := make(chan struct{}) p.done = done s.autoRefresh = false go s.manualRefreshListener(ctx, done) case s.autoRefresh || cw.IsTerminal(): done := make(chan struct{}) p.done = done s.autoRefresh = true go s.autoRefreshListener(ctx, done) default: p.done = ctx.Done() s.autoRefresh = false } p.pwg.Add(2) go s.hm.run(p.pwg, s.shutdownNotifier, s.handOverBarHeap) go p.serve(s, cw) return p } // AddBar creates a bar with default bar filler. func (p *Progress) AddBar(total int64, options ...BarOption) *Bar { return p.New(total, BarStyle(), options...) } // AddSpinner creates a bar with default spinner filler. func (p *Progress) AddSpinner(total int64, options ...BarOption) *Bar { return p.New(total, SpinnerStyle(), options...) } // New creates a bar by calling `Build` method on provided `BarFillerBuilder`. func (p *Progress) New(total int64, builder BarFillerBuilder, options ...BarOption) *Bar { if builder == nil { return p.MustAdd(total, nil, options...) } return p.MustAdd(total, builder.Build(), options...) } // MustAdd creates a bar which renders itself by provided BarFiller. // If `total <= 0` triggering complete event by increment methods is // disabled. Panics if called after `(*Progress).Wait()`. func (p *Progress) MustAdd(total int64, filler BarFiller, options ...BarOption) *Bar { bar, err := p.Add(total, filler, options...) if err != nil { panic(err) } return bar } // Add creates a bar which renders itself by provided BarFiller. // If `total <= 0` triggering complete event by increment methods // is disabled. If called after `(*Progress).Wait()` then // `(nil, ErrDone)` is returned. func (p *Progress) Add(total int64, filler BarFiller, options ...BarOption) (*Bar, error) { if filler == nil { filler = NopStyle().Build() } else if f, ok := filler.(BarFillerFunc); ok && f == nil { filler = NopStyle().Build() } ch := make(chan *Bar, 1) select { case p.operateState <- func(ps *pState) { p.bwg.Add(1) bs := ps.makeBarState(total, filler, options...) bar := p.makeBar(bs.priority) if bs.waitBar != nil { ps.queueBars[bs.waitBar] = &queueBar{bs, bar} } else { go bar.serve(bs) ps.hm.push(bar, true) } ch <- bar }: return <-ch, nil case <-p.done: return nil, ErrDone } } func (p *Progress) makeBar(priority int) *Bar { ctx, cancel := context.WithCancel(p.ctx) bar := &Bar{ priority: priority, frameCh: make(chan *renderFrame, 1), operateState: make(chan func(*bState)), bsOk: make(chan struct{}), container: p, ctx: ctx, cancel: cancel, } return bar } // blocks until iteration is done func (p *Progress) iterateBars(yield func(*Bar) bool) (ok bool) { seqCh := make(chan iter.Seq[*Bar], 1) select { case p.operateState <- func(s *pState) { s.hm.iter(seqCh) }: for b := range <-seqCh { if !yield(b) { break } } return true case <-p.done: return false } } // UpdateBarPriority either immediately or lazy. // With lazy flag order is updated after the next refresh cycle. // If you don't care about laziness just use `(*Bar).SetPriority(int)`. func (p *Progress) UpdateBarPriority(b *Bar, priority int, lazy bool) { if b == nil { return } select { case p.operateState <- func(s *pState) { s.hm.fix(b, priority, lazy) }: case <-p.done: } } // Write is implementation of io.Writer. // Writing to `*Progress` will print lines above a running bar. // Writes aren't flushed immediately, but at next refresh cycle. // If called after `(*Progress).Wait()` then `(0, ErrDone)` is returned. func (p *Progress) Write(b []byte) (int, error) { type result struct { n int err error } ch := make(chan result, 1) select { case p.interceptIO <- func(w io.Writer) { n, err := w.Write(b) ch <- result{n, err} }: res := <-ch return res.n, res.err case <-p.done: return 0, ErrDone } } // Wait waits for all bars to complete and finally shutdowns container. After // this method has been called, there is no way to reuse `*Progress` instance. func (p *Progress) Wait() { p.bwg.Wait() p.Shutdown() } // Shutdown cancels any running bar immediately and then shutdowns `*Progress` // instance. Normally this method shouldn't be called unless you know what you // are doing. Proper way to shutdown is to call `(*Progress).Wait()` instead. func (p *Progress) Shutdown() { p.cancel() p.pwg.Wait() } func (p *Progress) serve(s *pState, cw *cwriter.Writer) { defer func() { if s.uwg != nil { s.uwg.Wait() // wait for user wg } p.bwg.Wait() close(s.hm) close(s.shutdownNotifier) p.pwg.Done() }() var dw *cwriter.Writer if s.delayRC != nil { dw = cwriter.New(io.Discard) } else { dw = cw } for { select { case <-s.delayRC: dw = cw s.delayRC = nil case op := <-p.operateState: op(s) case fn := <-p.interceptIO: fn(cw) case <-s.renderReq: err := s.render(dw) if err != nil { p.cancel() // (*pState).(autoRefreshListener|manualRefreshListener) may block // if not depleting s.renderReq for { select { case <-s.renderReq: case <-p.done: _, _ = fmt.Fprintln(s.debugOut, err.Error()) return } } } case <-p.done: if s.autoRefresh && s.rmOnComplete { if err := s.render(cw); err != nil { _, _ = fmt.Fprintln(s.debugOut, err.Error()) return } } return } } } func (s *pState) autoRefreshListener(ctx context.Context, done chan struct{}) { ticker := time.NewTicker(s.refreshRate) defer ticker.Stop() for { select { case t := <-ticker.C: s.renderReq <- t case <-ctx.Done(): close(done) return } } } func (s *pState) manualRefreshListener(ctx context.Context, done chan struct{}) { for { select { case x := <-s.manualRC: if t, ok := x.(time.Time); ok { s.renderReq <- t } else { s.renderReq <- time.Now() } case <-ctx.Done(): close(done) return } } } func (s *pState) render(cw *cwriter.Writer) (err error) { s.hm.sync() var width, height int if cw.IsTerminal() { width, height, err = cw.GetTermSize() if err != nil { return err } } else { width = cmp.Or(s.reqWidth, 80) height = width } return s.flush(cw, height, s.hm.render(width)) } func (s *pState) flush(cw *cwriter.Writer, height int, seq iter.Seq[*Bar]) error { var total, popCount int var rows [][]io.Reader s.rmOnComplete = false for b := range seq { frame := <-b.frameCh if frame.err != nil { b.cancel() s.hm.push(b, false) return frame.err // b.frameCh is buffered it's ok to return here } var discarded int for i := len(frame.rows) - 1; i >= 0; i-- { if total < height { total++ } else { _, _ = io.Copy(io.Discard, frame.rows[i]) // Found IsInBounds discarded++ } } rows = append(rows, frame.rows) switch frame.shutdown { case 1: if qb, ok := s.queueBars[b]; ok { delete(s.queueBars, b) qb.bar.priority = b.priority go qb.bar.serve(qb.state) s.hm.push(qb.bar, true) } else { switch { case s.popCompleted && !frame.noPop: b.priority = s.popPriority s.popPriority++ fallthrough case !frame.rmOnComplete: s.hm.push(b, false) } s.rmOnComplete = s.rmOnComplete || frame.rmOnComplete } b.cancel() case 2: if s.popCompleted && !frame.noPop { popCount += len(frame.rows) - discarded continue } fallthrough default: s.hm.push(b, false) } } for i := len(rows) - 1; i >= 0; i-- { for _, r := range rows[i] { _, err := cw.ReadFrom(r) if err != nil { return err } } } return cw.Flush(total - popCount) } func (s *pState) makeBarState(total int64, filler BarFiller, options ...BarOption) *bState { bs := &bState{ id: s.idCount, priority: s.idCount, reqWidth: s.reqWidth, total: total, filler: filler, renderReq: s.renderReq, triggerComplete: total > 0, autoRefresh: s.autoRefresh, } bs.extender = func(_ decor.Statistics, rows ...io.Reader) ([]io.Reader, error) { return rows, nil } for _, opt := range options { if opt != nil { opt(bs) } } for _, group := range bs.decorGroups { for _, d := range group { if d, ok := unwrap(d).(decor.EwmaDecorator); ok { bs.ewmaDecorators = append(bs.ewmaDecorators, d) } } } bs.buffers[0] = bytes.NewBuffer(make([]byte, 0, 256)) // filler bs.buffers[1] = bytes.NewBuffer(make([]byte, 0, 128)) // prepend bs.buffers[2] = bytes.NewBuffer(make([]byte, 0, 128)) // append s.idCount++ return bs } ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/proxyreader.go ================================================ package mpb import ( "io" "time" ) type proxyReader struct { io.ReadCloser bar *Bar } func (x proxyReader) Read(p []byte) (int, error) { n, err := x.ReadCloser.Read(p) x.bar.IncrBy(n) return n, err } type proxyWriterTo struct { proxyReader } func (x proxyWriterTo) WriteTo(w io.Writer) (int64, error) { n, err := x.ReadCloser.(io.WriterTo).WriteTo(w) x.bar.IncrInt64(n) return n, err } type ewmaProxyReader struct { io.ReadCloser bar *Bar } func (x ewmaProxyReader) Read(p []byte) (int, error) { start := time.Now() n, err := x.ReadCloser.Read(p) x.bar.EwmaIncrBy(n, time.Since(start)) return n, err } type ewmaProxyWriterTo struct { ewmaProxyReader } func (x ewmaProxyWriterTo) WriteTo(w io.Writer) (int64, error) { start := time.Now() n, err := x.ReadCloser.(io.WriterTo).WriteTo(w) x.bar.EwmaIncrInt64(n, time.Since(start)) return n, err } func newProxyReader(r io.Reader, b *Bar, hasEwma bool) io.ReadCloser { rc := toReadCloser(r) if hasEwma { epr := ewmaProxyReader{rc, b} if _, ok := r.(io.WriterTo); ok { return ewmaProxyWriterTo{epr} } return epr } pr := proxyReader{rc, b} if _, ok := r.(io.WriterTo); ok { return proxyWriterTo{pr} } return pr } func toReadCloser(r io.Reader) io.ReadCloser { if rc, ok := r.(io.ReadCloser); ok { return rc } return io.NopCloser(r) } ================================================ FILE: vendor/github.com/vbauerster/mpb/v8/proxywriter.go ================================================ package mpb import ( "io" "time" ) type proxyWriter struct { io.WriteCloser bar *Bar } func (x proxyWriter) Write(p []byte) (int, error) { n, err := x.WriteCloser.Write(p) x.bar.IncrBy(n) return n, err } type proxyReaderFrom struct { proxyWriter } func (x proxyReaderFrom) ReadFrom(r io.Reader) (int64, error) { n, err := x.WriteCloser.(io.ReaderFrom).ReadFrom(r) x.bar.IncrInt64(n) return n, err } type ewmaProxyWriter struct { io.WriteCloser bar *Bar } func (x ewmaProxyWriter) Write(p []byte) (int, error) { start := time.Now() n, err := x.WriteCloser.Write(p) x.bar.EwmaIncrBy(n, time.Since(start)) return n, err } type ewmaProxyReaderFrom struct { ewmaProxyWriter } func (x ewmaProxyReaderFrom) ReadFrom(r io.Reader) (int64, error) { start := time.Now() n, err := x.WriteCloser.(io.ReaderFrom).ReadFrom(r) x.bar.EwmaIncrInt64(n, time.Since(start)) return n, err } func newProxyWriter(w io.Writer, b *Bar, hasEwma bool) io.WriteCloser { wc := toWriteCloser(w) if hasEwma { epw := ewmaProxyWriter{wc, b} if _, ok := w.(io.ReaderFrom); ok { return ewmaProxyReaderFrom{epw} } return epw } pw := proxyWriter{wc, b} if _, ok := w.(io.ReaderFrom); ok { return proxyReaderFrom{pw} } return pw } func toWriteCloser(w io.Writer) io.WriteCloser { if wc, ok := w.(io.WriteCloser); ok { return wc } return toNopWriteCloser(w) } func toNopWriteCloser(w io.Writer) io.WriteCloser { if _, ok := w.(io.ReaderFrom); ok { return nopWriteCloserReaderFrom{w} } return nopWriteCloser{w} } type nopWriteCloser struct { io.Writer } func (nopWriteCloser) Close() error { return nil } type nopWriteCloserReaderFrom struct { io.Writer } func (nopWriteCloserReaderFrom) Close() error { return nil } func (c nopWriteCloserReaderFrom) ReadFrom(r io.Reader) (int64, error) { return c.Writer.(io.ReaderFrom).ReadFrom(r) } ================================================ FILE: vendor/go.opentelemetry.io/auto/sdk/CONTRIBUTING.md ================================================ # Contributing to go.opentelemetry.io/auto/sdk The `go.opentelemetry.io/auto/sdk` module is a purpose built OpenTelemetry SDK. It is designed to be: 0. An OpenTelemetry compliant SDK 1. Instrumented by auto-instrumentation (serializable into OTLP JSON) 2. Lightweight 3. User-friendly These design choices are listed in the order of their importance. The primary design goal of this module is to be an OpenTelemetry SDK. This means that it needs to implement the Go APIs found in `go.opentelemetry.io/otel`. Having met the requirement of SDK compliance, this module needs to provide code that the `go.opentelemetry.io/auto` module can instrument. The chosen approach to meet this goal is to ensure the telemetry from the SDK is serializable into JSON encoded OTLP. This ensures then that the serialized form is compatible with other OpenTelemetry systems, and the auto-instrumentation can use these systems to deserialize any telemetry it is sent. Outside of these first two goals, the intended use becomes relevant. This package is intended to be used in the `go.opentelemetry.io/otel` global API as a default when the auto-instrumentation is running. Because of this, this package needs to not add unnecessary dependencies to that API. Ideally, it adds none. It also needs to operate efficiently. Finally, this module is designed to be user-friendly to Go development. It hides complexity in order to provide simpler APIs when the previous goals can all still be met. ================================================ FILE: vendor/go.opentelemetry.io/auto/sdk/LICENSE ================================================ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: vendor/go.opentelemetry.io/auto/sdk/VERSIONING.md ================================================ # Versioning This document describes the versioning policy for this module. This policy is designed so the following goals can be achieved. **Users are provided a codebase of value that is stable and secure.** ## Policy * Versioning of this module will be idiomatic of a Go project using [Go modules](https://github.com/golang/go/wiki/Modules). * [Semantic import versioning](https://github.com/golang/go/wiki/Modules#semantic-import-versioning) will be used. * Versions will comply with [semver 2.0](https://semver.org/spec/v2.0.0.html). * Any `v2` or higher version of this module will be included as a `/vN` at the end of the module path used in `go.mod` files and in the package import path. * GitHub releases will be made for all releases. ================================================ FILE: vendor/go.opentelemetry.io/auto/sdk/doc.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 /* Package sdk provides an auto-instrumentable OpenTelemetry SDK. An [go.opentelemetry.io/auto.Instrumentation] can be configured to target the process running this SDK. In that case, all telemetry the SDK produces will be processed and handled by that [go.opentelemetry.io/auto.Instrumentation]. By default, if there is no [go.opentelemetry.io/auto.Instrumentation] set to auto-instrument the SDK, the SDK will not generate any telemetry. */ package sdk ================================================ FILE: vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/attr.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package telemetry // Attr is a key-value pair. type Attr struct { Key string `json:"key,omitempty"` Value Value `json:"value,omitempty"` } // String returns an Attr for a string value. func String(key, value string) Attr { return Attr{key, StringValue(value)} } // Int64 returns an Attr for an int64 value. func Int64(key string, value int64) Attr { return Attr{key, Int64Value(value)} } // Int returns an Attr for an int value. func Int(key string, value int) Attr { return Int64(key, int64(value)) } // Float64 returns an Attr for a float64 value. func Float64(key string, value float64) Attr { return Attr{key, Float64Value(value)} } // Bool returns an Attr for a bool value. func Bool(key string, value bool) Attr { return Attr{key, BoolValue(value)} } // Bytes returns an Attr for a []byte value. // The passed slice must not be changed after it is passed. func Bytes(key string, value []byte) Attr { return Attr{key, BytesValue(value)} } // Slice returns an Attr for a []Value value. // The passed slice must not be changed after it is passed. func Slice(key string, value ...Value) Attr { return Attr{key, SliceValue(value...)} } // Map returns an Attr for a map value. // The passed slice must not be changed after it is passed. func Map(key string, value ...Attr) Attr { return Attr{key, MapValue(value...)} } // Equal returns if a is equal to b. func (a Attr) Equal(b Attr) bool { return a.Key == b.Key && a.Value.Equal(b.Value) } ================================================ FILE: vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/doc.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 /* Package telemetry provides a lightweight representations of OpenTelemetry telemetry that is compatible with the OTLP JSON protobuf encoding. */ package telemetry ================================================ FILE: vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/id.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package telemetry import ( "encoding/hex" "errors" "fmt" ) const ( traceIDSize = 16 spanIDSize = 8 ) // TraceID is a custom data type that is used for all trace IDs. type TraceID [traceIDSize]byte // String returns the hex string representation form of a TraceID. func (tid TraceID) String() string { return hex.EncodeToString(tid[:]) } // IsEmpty returns false if id contains at least one non-zero byte. func (tid TraceID) IsEmpty() bool { return tid == [traceIDSize]byte{} } // MarshalJSON converts the trace ID into a hex string enclosed in quotes. func (tid TraceID) MarshalJSON() ([]byte, error) { if tid.IsEmpty() { return []byte(`""`), nil } return marshalJSON(tid[:]) } // UnmarshalJSON inflates the trace ID from hex string, possibly enclosed in // quotes. func (tid *TraceID) UnmarshalJSON(data []byte) error { *tid = [traceIDSize]byte{} return unmarshalJSON(tid[:], data) } // SpanID is a custom data type that is used for all span IDs. type SpanID [spanIDSize]byte // String returns the hex string representation form of a SpanID. func (sid SpanID) String() string { return hex.EncodeToString(sid[:]) } // IsEmpty returns true if the span ID contains at least one non-zero byte. func (sid SpanID) IsEmpty() bool { return sid == [spanIDSize]byte{} } // MarshalJSON converts span ID into a hex string enclosed in quotes. func (sid SpanID) MarshalJSON() ([]byte, error) { if sid.IsEmpty() { return []byte(`""`), nil } return marshalJSON(sid[:]) } // UnmarshalJSON decodes span ID from hex string, possibly enclosed in quotes. func (sid *SpanID) UnmarshalJSON(data []byte) error { *sid = [spanIDSize]byte{} return unmarshalJSON(sid[:], data) } // marshalJSON converts id into a hex string enclosed in quotes. func marshalJSON(id []byte) ([]byte, error) { // Plus 2 quote chars at the start and end. hexLen := hex.EncodedLen(len(id)) + 2 b := make([]byte, hexLen) hex.Encode(b[1:hexLen-1], id) b[0], b[hexLen-1] = '"', '"' return b, nil } // unmarshalJSON inflates trace id from hex string, possibly enclosed in quotes. func unmarshalJSON(dst, src []byte) error { if l := len(src); l >= 2 && src[0] == '"' && src[l-1] == '"' { src = src[1 : l-1] } nLen := len(src) if nLen == 0 { return nil } if len(dst) != hex.DecodedLen(nLen) { return errors.New("invalid length for ID") } _, err := hex.Decode(dst, src) if err != nil { return fmt.Errorf("cannot unmarshal ID from string '%s': %w", string(src), err) } return nil } ================================================ FILE: vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/number.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package telemetry import ( "encoding/json" "strconv" ) // protoInt64 represents the protobuf encoding of integers which can be either // strings or integers. type protoInt64 int64 // Int64 returns the protoInt64 as an int64. func (i *protoInt64) Int64() int64 { return int64(*i) } // UnmarshalJSON decodes both strings and integers. func (i *protoInt64) UnmarshalJSON(data []byte) error { if data[0] == '"' { var str string if err := json.Unmarshal(data, &str); err != nil { return err } parsedInt, err := strconv.ParseInt(str, 10, 64) if err != nil { return err } *i = protoInt64(parsedInt) } else { var parsedInt int64 if err := json.Unmarshal(data, &parsedInt); err != nil { return err } *i = protoInt64(parsedInt) } return nil } // protoUint64 represents the protobuf encoding of integers which can be either // strings or integers. type protoUint64 uint64 // Uint64 returns the protoUint64 as a uint64. func (i *protoUint64) Uint64() uint64 { return uint64(*i) } // UnmarshalJSON decodes both strings and integers. func (i *protoUint64) UnmarshalJSON(data []byte) error { if data[0] == '"' { var str string if err := json.Unmarshal(data, &str); err != nil { return err } parsedUint, err := strconv.ParseUint(str, 10, 64) if err != nil { return err } *i = protoUint64(parsedUint) } else { var parsedUint uint64 if err := json.Unmarshal(data, &parsedUint); err != nil { return err } *i = protoUint64(parsedUint) } return nil } ================================================ FILE: vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/resource.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package telemetry import ( "bytes" "encoding/json" "errors" "fmt" "io" ) // Resource information. type Resource struct { // Attrs are the set of attributes that describe the resource. Attribute // keys MUST be unique (it is not allowed to have more than one attribute // with the same key). Attrs []Attr `json:"attributes,omitempty"` // DroppedAttrs is the number of dropped attributes. If the value // is 0, then no attributes were dropped. DroppedAttrs uint32 `json:"droppedAttributesCount,omitempty"` } // UnmarshalJSON decodes the OTLP formatted JSON contained in data into r. func (r *Resource) UnmarshalJSON(data []byte) error { decoder := json.NewDecoder(bytes.NewReader(data)) t, err := decoder.Token() if err != nil { return err } if t != json.Delim('{') { return errors.New("invalid Resource type") } for decoder.More() { keyIface, err := decoder.Token() if err != nil { if errors.Is(err, io.EOF) { // Empty. return nil } return err } key, ok := keyIface.(string) if !ok { return fmt.Errorf("invalid Resource field: %#v", keyIface) } switch key { case "attributes": err = decoder.Decode(&r.Attrs) case "droppedAttributesCount", "dropped_attributes_count": err = decoder.Decode(&r.DroppedAttrs) default: // Skip unknown. } if err != nil { return err } } return nil } ================================================ FILE: vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/scope.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package telemetry import ( "bytes" "encoding/json" "errors" "fmt" "io" ) // Scope is the identifying values of the instrumentation scope. type Scope struct { Name string `json:"name,omitempty"` Version string `json:"version,omitempty"` Attrs []Attr `json:"attributes,omitempty"` DroppedAttrs uint32 `json:"droppedAttributesCount,omitempty"` } // UnmarshalJSON decodes the OTLP formatted JSON contained in data into r. func (s *Scope) UnmarshalJSON(data []byte) error { decoder := json.NewDecoder(bytes.NewReader(data)) t, err := decoder.Token() if err != nil { return err } if t != json.Delim('{') { return errors.New("invalid Scope type") } for decoder.More() { keyIface, err := decoder.Token() if err != nil { if errors.Is(err, io.EOF) { // Empty. return nil } return err } key, ok := keyIface.(string) if !ok { return fmt.Errorf("invalid Scope field: %#v", keyIface) } switch key { case "name": err = decoder.Decode(&s.Name) case "version": err = decoder.Decode(&s.Version) case "attributes": err = decoder.Decode(&s.Attrs) case "droppedAttributesCount", "dropped_attributes_count": err = decoder.Decode(&s.DroppedAttrs) default: // Skip unknown. } if err != nil { return err } } return nil } ================================================ FILE: vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/span.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package telemetry import ( "bytes" "encoding/hex" "encoding/json" "errors" "fmt" "io" "math" "time" ) // A Span represents a single operation performed by a single component of the // system. type Span struct { // A unique identifier for a trace. All spans from the same trace share // the same `trace_id`. The ID is a 16-byte array. An ID with all zeroes OR // of length other than 16 bytes is considered invalid (empty string in OTLP/JSON // is zero-length and thus is also invalid). // // This field is required. TraceID TraceID `json:"traceId,omitempty"` // A unique identifier for a span within a trace, assigned when the span // is created. The ID is an 8-byte array. An ID with all zeroes OR of length // other than 8 bytes is considered invalid (empty string in OTLP/JSON // is zero-length and thus is also invalid). // // This field is required. SpanID SpanID `json:"spanId,omitempty"` // trace_state conveys information about request position in multiple distributed tracing graphs. // It is a trace_state in w3c-trace-context format: https://www.w3.org/TR/trace-context/#tracestate-header // See also https://github.com/w3c/distributed-tracing for more details about this field. TraceState string `json:"traceState,omitempty"` // The `span_id` of this span's parent span. If this is a root span, then this // field must be empty. The ID is an 8-byte array. ParentSpanID SpanID `json:"parentSpanId,omitempty"` // Flags, a bit field. // // Bits 0-7 (8 least significant bits) are the trace flags as defined in W3C Trace // Context specification. To read the 8-bit W3C trace flag, use // `flags & SPAN_FLAGS_TRACE_FLAGS_MASK`. // // See https://www.w3.org/TR/trace-context-2/#trace-flags for the flag definitions. // // Bits 8 and 9 represent the 3 states of whether a span's parent // is remote. The states are (unknown, is not remote, is remote). // To read whether the value is known, use `(flags & SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK) != 0`. // To read whether the span is remote, use `(flags & SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK) != 0`. // // When creating span messages, if the message is logically forwarded from another source // with an equivalent flags fields (i.e., usually another OTLP span message), the field SHOULD // be copied as-is. If creating from a source that does not have an equivalent flags field // (such as a runtime representation of an OpenTelemetry span), the high 22 bits MUST // be set to zero. // Readers MUST NOT assume that bits 10-31 (22 most significant bits) will be zero. // // [Optional]. Flags uint32 `json:"flags,omitempty"` // A description of the span's operation. // // For example, the name can be a qualified method name or a file name // and a line number where the operation is called. A best practice is to use // the same display name at the same call point in an application. // This makes it easier to correlate spans in different traces. // // This field is semantically required to be set to non-empty string. // Empty value is equivalent to an unknown span name. // // This field is required. Name string `json:"name"` // Distinguishes between spans generated in a particular context. For example, // two spans with the same name may be distinguished using `CLIENT` (caller) // and `SERVER` (callee) to identify queueing latency associated with the span. Kind SpanKind `json:"kind,omitempty"` // start_time_unix_nano is the start time of the span. On the client side, this is the time // kept by the local machine where the span execution starts. On the server side, this // is the time when the server's application handler starts running. // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. // // This field is semantically required and it is expected that end_time >= start_time. StartTime time.Time `json:"startTimeUnixNano,omitempty"` // end_time_unix_nano is the end time of the span. On the client side, this is the time // kept by the local machine where the span execution ends. On the server side, this // is the time when the server application handler stops running. // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. // // This field is semantically required and it is expected that end_time >= start_time. EndTime time.Time `json:"endTimeUnixNano,omitempty"` // attributes is a collection of key/value pairs. Note, global attributes // like server name can be set using the resource API. Examples of attributes: // // "/http/user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36" // "/http/server_latency": 300 // "example.com/myattribute": true // "example.com/score": 10.239 // // The OpenTelemetry API specification further restricts the allowed value types: // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/README.md#attribute // Attribute keys MUST be unique (it is not allowed to have more than one // attribute with the same key). Attrs []Attr `json:"attributes,omitempty"` // dropped_attributes_count is the number of attributes that were discarded. Attributes // can be discarded because their keys are too long or because there are too many // attributes. If this value is 0, then no attributes were dropped. DroppedAttrs uint32 `json:"droppedAttributesCount,omitempty"` // events is a collection of Event items. Events []*SpanEvent `json:"events,omitempty"` // dropped_events_count is the number of dropped events. If the value is 0, then no // events were dropped. DroppedEvents uint32 `json:"droppedEventsCount,omitempty"` // links is a collection of Links, which are references from this span to a span // in the same or different trace. Links []*SpanLink `json:"links,omitempty"` // dropped_links_count is the number of dropped links after the maximum size was // enforced. If this value is 0, then no links were dropped. DroppedLinks uint32 `json:"droppedLinksCount,omitempty"` // An optional final status for this span. Semantically when Status isn't set, it means // span's status code is unset, i.e. assume STATUS_CODE_UNSET (code = 0). Status *Status `json:"status,omitempty"` } // MarshalJSON encodes s into OTLP formatted JSON. func (s Span) MarshalJSON() ([]byte, error) { startT := s.StartTime.UnixNano() if s.StartTime.IsZero() || startT < 0 { startT = 0 } endT := s.EndTime.UnixNano() if s.EndTime.IsZero() || endT < 0 { endT = 0 } // Override non-empty default SpanID marshal and omitempty. var parentSpanId string if !s.ParentSpanID.IsEmpty() { b := make([]byte, hex.EncodedLen(spanIDSize)) hex.Encode(b, s.ParentSpanID[:]) parentSpanId = string(b) } type Alias Span return json.Marshal(struct { Alias ParentSpanID string `json:"parentSpanId,omitempty"` StartTime uint64 `json:"startTimeUnixNano,omitempty"` EndTime uint64 `json:"endTimeUnixNano,omitempty"` }{ Alias: Alias(s), ParentSpanID: parentSpanId, StartTime: uint64(startT), // nolint:gosec // >0 checked above. EndTime: uint64(endT), // nolint:gosec // >0 checked above. }) } // UnmarshalJSON decodes the OTLP formatted JSON contained in data into s. func (s *Span) UnmarshalJSON(data []byte) error { decoder := json.NewDecoder(bytes.NewReader(data)) t, err := decoder.Token() if err != nil { return err } if t != json.Delim('{') { return errors.New("invalid Span type") } for decoder.More() { keyIface, err := decoder.Token() if err != nil { if errors.Is(err, io.EOF) { // Empty. return nil } return err } key, ok := keyIface.(string) if !ok { return fmt.Errorf("invalid Span field: %#v", keyIface) } switch key { case "traceId", "trace_id": err = decoder.Decode(&s.TraceID) case "spanId", "span_id": err = decoder.Decode(&s.SpanID) case "traceState", "trace_state": err = decoder.Decode(&s.TraceState) case "parentSpanId", "parent_span_id": err = decoder.Decode(&s.ParentSpanID) case "flags": err = decoder.Decode(&s.Flags) case "name": err = decoder.Decode(&s.Name) case "kind": err = decoder.Decode(&s.Kind) case "startTimeUnixNano", "start_time_unix_nano": var val protoUint64 err = decoder.Decode(&val) v := int64(min(val.Uint64(), math.MaxInt64)) //nolint:gosec // Overflow checked. s.StartTime = time.Unix(0, v) case "endTimeUnixNano", "end_time_unix_nano": var val protoUint64 err = decoder.Decode(&val) v := int64(min(val.Uint64(), math.MaxInt64)) //nolint:gosec // Overflow checked. s.EndTime = time.Unix(0, v) case "attributes": err = decoder.Decode(&s.Attrs) case "droppedAttributesCount", "dropped_attributes_count": err = decoder.Decode(&s.DroppedAttrs) case "events": err = decoder.Decode(&s.Events) case "droppedEventsCount", "dropped_events_count": err = decoder.Decode(&s.DroppedEvents) case "links": err = decoder.Decode(&s.Links) case "droppedLinksCount", "dropped_links_count": err = decoder.Decode(&s.DroppedLinks) case "status": err = decoder.Decode(&s.Status) default: // Skip unknown. } if err != nil { return err } } return nil } // SpanFlags represents constants used to interpret the // Span.flags field, which is protobuf 'fixed32' type and is to // be used as bit-fields. Each non-zero value defined in this enum is // a bit-mask. To extract the bit-field, for example, use an // expression like: // // (span.flags & SPAN_FLAGS_TRACE_FLAGS_MASK) // // See https://www.w3.org/TR/trace-context-2/#trace-flags for the flag definitions. // // Note that Span flags were introduced in version 1.1 of the // OpenTelemetry protocol. Older Span producers do not set this // field, consequently consumers should not rely on the absence of a // particular flag bit to indicate the presence of a particular feature. type SpanFlags int32 const ( // SpanFlagsTraceFlagsMask is a mask for trace-flags. // // Bits 0-7 are used for trace flags. SpanFlagsTraceFlagsMask SpanFlags = 255 // SpanFlagsContextHasIsRemoteMask is a mask for HAS_IS_REMOTE status. // // Bits 8 and 9 are used to indicate that the parent span or link span is // remote. Bit 8 (`HAS_IS_REMOTE`) indicates whether the value is known. SpanFlagsContextHasIsRemoteMask SpanFlags = 256 // SpanFlagsContextIsRemoteMask is a mask for IS_REMOTE status. // // Bits 8 and 9 are used to indicate that the parent span or link span is // remote. Bit 9 (`IS_REMOTE`) indicates whether the span or link is // remote. SpanFlagsContextIsRemoteMask SpanFlags = 512 ) // SpanKind is the type of span. Can be used to specify additional relationships between spans // in addition to a parent/child relationship. type SpanKind int32 const ( // SpanKindInternal indicates that the span represents an internal // operation within an application, as opposed to an operation happening at // the boundaries. SpanKindInternal SpanKind = 1 // SpanKindServer indicates that the span covers server-side handling of an // RPC or other remote network request. SpanKindServer SpanKind = 2 // SpanKindClient indicates that the span describes a request to some // remote service. SpanKindClient SpanKind = 3 // SpanKindProducer indicates that the span describes a producer sending a // message to a broker. Unlike SpanKindClient and SpanKindServer, there is // often no direct critical path latency relationship between producer and // consumer spans. A SpanKindProducer span ends when the message was // accepted by the broker while the logical processing of the message might // span a much longer time. SpanKindProducer SpanKind = 4 // SpanKindConsumer indicates that the span describes a consumer receiving // a message from a broker. Like SpanKindProducer, there is often no direct // critical path latency relationship between producer and consumer spans. SpanKindConsumer SpanKind = 5 ) // SpanEvent is a time-stamped annotation of the span, consisting of user-supplied // text description and key-value pairs. type SpanEvent struct { // time_unix_nano is the time the event occurred. Time time.Time `json:"timeUnixNano,omitempty"` // name of the event. // This field is semantically required to be set to non-empty string. Name string `json:"name,omitempty"` // attributes is a collection of attribute key/value pairs on the event. // Attribute keys MUST be unique (it is not allowed to have more than one // attribute with the same key). Attrs []Attr `json:"attributes,omitempty"` // dropped_attributes_count is the number of dropped attributes. If the value is 0, // then no attributes were dropped. DroppedAttrs uint32 `json:"droppedAttributesCount,omitempty"` } // MarshalJSON encodes e into OTLP formatted JSON. func (e SpanEvent) MarshalJSON() ([]byte, error) { t := e.Time.UnixNano() if e.Time.IsZero() || t < 0 { t = 0 } type Alias SpanEvent return json.Marshal(struct { Alias Time uint64 `json:"timeUnixNano,omitempty"` }{ Alias: Alias(e), Time: uint64(t), //nolint:gosec // >0 checked above }) } // UnmarshalJSON decodes the OTLP formatted JSON contained in data into se. func (se *SpanEvent) UnmarshalJSON(data []byte) error { decoder := json.NewDecoder(bytes.NewReader(data)) t, err := decoder.Token() if err != nil { return err } if t != json.Delim('{') { return errors.New("invalid SpanEvent type") } for decoder.More() { keyIface, err := decoder.Token() if err != nil { if errors.Is(err, io.EOF) { // Empty. return nil } return err } key, ok := keyIface.(string) if !ok { return fmt.Errorf("invalid SpanEvent field: %#v", keyIface) } switch key { case "timeUnixNano", "time_unix_nano": var val protoUint64 err = decoder.Decode(&val) v := int64(min(val.Uint64(), math.MaxInt64)) //nolint:gosec // Overflow checked. se.Time = time.Unix(0, v) case "name": err = decoder.Decode(&se.Name) case "attributes": err = decoder.Decode(&se.Attrs) case "droppedAttributesCount", "dropped_attributes_count": err = decoder.Decode(&se.DroppedAttrs) default: // Skip unknown. } if err != nil { return err } } return nil } // SpanLink is a reference from the current span to another span in the same // trace or in a different trace. For example, this can be used in batching // operations, where a single batch handler processes multiple requests from // different traces or when the handler receives a request from a different // project. type SpanLink struct { // A unique identifier of a trace that this linked span is part of. The ID is a // 16-byte array. TraceID TraceID `json:"traceId,omitempty"` // A unique identifier for the linked span. The ID is an 8-byte array. SpanID SpanID `json:"spanId,omitempty"` // The trace_state associated with the link. TraceState string `json:"traceState,omitempty"` // attributes is a collection of attribute key/value pairs on the link. // Attribute keys MUST be unique (it is not allowed to have more than one // attribute with the same key). Attrs []Attr `json:"attributes,omitempty"` // dropped_attributes_count is the number of dropped attributes. If the value is 0, // then no attributes were dropped. DroppedAttrs uint32 `json:"droppedAttributesCount,omitempty"` // Flags, a bit field. // // Bits 0-7 (8 least significant bits) are the trace flags as defined in W3C Trace // Context specification. To read the 8-bit W3C trace flag, use // `flags & SPAN_FLAGS_TRACE_FLAGS_MASK`. // // See https://www.w3.org/TR/trace-context-2/#trace-flags for the flag definitions. // // Bits 8 and 9 represent the 3 states of whether the link is remote. // The states are (unknown, is not remote, is remote). // To read whether the value is known, use `(flags & SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK) != 0`. // To read whether the link is remote, use `(flags & SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK) != 0`. // // Readers MUST NOT assume that bits 10-31 (22 most significant bits) will be zero. // When creating new spans, bits 10-31 (most-significant 22-bits) MUST be zero. // // [Optional]. Flags uint32 `json:"flags,omitempty"` } // UnmarshalJSON decodes the OTLP formatted JSON contained in data into sl. func (sl *SpanLink) UnmarshalJSON(data []byte) error { decoder := json.NewDecoder(bytes.NewReader(data)) t, err := decoder.Token() if err != nil { return err } if t != json.Delim('{') { return errors.New("invalid SpanLink type") } for decoder.More() { keyIface, err := decoder.Token() if err != nil { if errors.Is(err, io.EOF) { // Empty. return nil } return err } key, ok := keyIface.(string) if !ok { return fmt.Errorf("invalid SpanLink field: %#v", keyIface) } switch key { case "traceId", "trace_id": err = decoder.Decode(&sl.TraceID) case "spanId", "span_id": err = decoder.Decode(&sl.SpanID) case "traceState", "trace_state": err = decoder.Decode(&sl.TraceState) case "attributes": err = decoder.Decode(&sl.Attrs) case "droppedAttributesCount", "dropped_attributes_count": err = decoder.Decode(&sl.DroppedAttrs) case "flags": err = decoder.Decode(&sl.Flags) default: // Skip unknown. } if err != nil { return err } } return nil } ================================================ FILE: vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/status.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package telemetry // StatusCode is the status of a Span. // // For the semantics of status codes see // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#set-status type StatusCode int32 const ( // StatusCodeUnset is the default status. StatusCodeUnset StatusCode = 0 // StatusCodeOK is used when the Span has been validated by an Application // developer or Operator to have completed successfully. StatusCodeOK StatusCode = 1 // StatusCodeError is used when the Span contains an error. StatusCodeError StatusCode = 2 ) var statusCodeStrings = []string{ "Unset", "OK", "Error", } func (s StatusCode) String() string { if s >= 0 && int(s) < len(statusCodeStrings) { return statusCodeStrings[s] } return "" } // The Status type defines a logical error model that is suitable for different // programming environments, including REST APIs and RPC APIs. type Status struct { // A developer-facing human readable error message. Message string `json:"message,omitempty"` // The status code. Code StatusCode `json:"code,omitempty"` } ================================================ FILE: vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/traces.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package telemetry import ( "bytes" "encoding/json" "errors" "fmt" "io" ) // Traces represents the traces data that can be stored in a persistent storage, // OR can be embedded by other protocols that transfer OTLP traces data but do // not implement the OTLP protocol. // // The main difference between this message and collector protocol is that // in this message there will not be any "control" or "metadata" specific to // OTLP protocol. // // When new fields are added into this message, the OTLP request MUST be updated // as well. type Traces struct { // An array of ResourceSpans. // For data coming from a single resource this array will typically contain // one element. Intermediary nodes that receive data from multiple origins // typically batch the data before forwarding further and in that case this // array will contain multiple elements. ResourceSpans []*ResourceSpans `json:"resourceSpans,omitempty"` } // UnmarshalJSON decodes the OTLP formatted JSON contained in data into td. func (td *Traces) UnmarshalJSON(data []byte) error { decoder := json.NewDecoder(bytes.NewReader(data)) t, err := decoder.Token() if err != nil { return err } if t != json.Delim('{') { return errors.New("invalid TracesData type") } for decoder.More() { keyIface, err := decoder.Token() if err != nil { if errors.Is(err, io.EOF) { // Empty. return nil } return err } key, ok := keyIface.(string) if !ok { return fmt.Errorf("invalid TracesData field: %#v", keyIface) } switch key { case "resourceSpans", "resource_spans": err = decoder.Decode(&td.ResourceSpans) default: // Skip unknown. } if err != nil { return err } } return nil } // ResourceSpans is a collection of ScopeSpans from a Resource. type ResourceSpans struct { // The resource for the spans in this message. // If this field is not set then no resource info is known. Resource Resource `json:"resource"` // A list of ScopeSpans that originate from a resource. ScopeSpans []*ScopeSpans `json:"scopeSpans,omitempty"` // This schema_url applies to the data in the "resource" field. It does not apply // to the data in the "scope_spans" field which have their own schema_url field. SchemaURL string `json:"schemaUrl,omitempty"` } // UnmarshalJSON decodes the OTLP formatted JSON contained in data into rs. func (rs *ResourceSpans) UnmarshalJSON(data []byte) error { decoder := json.NewDecoder(bytes.NewReader(data)) t, err := decoder.Token() if err != nil { return err } if t != json.Delim('{') { return errors.New("invalid ResourceSpans type") } for decoder.More() { keyIface, err := decoder.Token() if err != nil { if errors.Is(err, io.EOF) { // Empty. return nil } return err } key, ok := keyIface.(string) if !ok { return fmt.Errorf("invalid ResourceSpans field: %#v", keyIface) } switch key { case "resource": err = decoder.Decode(&rs.Resource) case "scopeSpans", "scope_spans": err = decoder.Decode(&rs.ScopeSpans) case "schemaUrl", "schema_url": err = decoder.Decode(&rs.SchemaURL) default: // Skip unknown. } if err != nil { return err } } return nil } // ScopeSpans is a collection of Spans produced by an InstrumentationScope. type ScopeSpans struct { // The instrumentation scope information for the spans in this message. // Semantically when InstrumentationScope isn't set, it is equivalent with // an empty instrumentation scope name (unknown). Scope *Scope `json:"scope"` // A list of Spans that originate from an instrumentation scope. Spans []*Span `json:"spans,omitempty"` // The Schema URL, if known. This is the identifier of the Schema that the span data // is recorded in. To learn more about Schema URL see // https://opentelemetry.io/docs/specs/otel/schemas/#schema-url // This schema_url applies to all spans and span events in the "spans" field. SchemaURL string `json:"schemaUrl,omitempty"` } // UnmarshalJSON decodes the OTLP formatted JSON contained in data into ss. func (ss *ScopeSpans) UnmarshalJSON(data []byte) error { decoder := json.NewDecoder(bytes.NewReader(data)) t, err := decoder.Token() if err != nil { return err } if t != json.Delim('{') { return errors.New("invalid ScopeSpans type") } for decoder.More() { keyIface, err := decoder.Token() if err != nil { if errors.Is(err, io.EOF) { // Empty. return nil } return err } key, ok := keyIface.(string) if !ok { return fmt.Errorf("invalid ScopeSpans field: %#v", keyIface) } switch key { case "scope": err = decoder.Decode(&ss.Scope) case "spans": err = decoder.Decode(&ss.Spans) case "schemaUrl", "schema_url": err = decoder.Decode(&ss.SchemaURL) default: // Skip unknown. } if err != nil { return err } } return nil } ================================================ FILE: vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/value.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package telemetry import ( "bytes" "cmp" "encoding/base64" "encoding/json" "errors" "fmt" "io" "math" "slices" "strconv" "unsafe" ) // A Value represents a structured value. // A zero value is valid and represents an empty value. type Value struct { // Ensure forward compatibility by explicitly making this not comparable. noCmp [0]func() //nolint:unused // This is indeed used. // num holds the value for Int64, Float64, and Bool. It holds the length // for String, Bytes, Slice, Map. num uint64 // any holds either the KindBool, KindInt64, KindFloat64, stringptr, // bytesptr, sliceptr, or mapptr. If KindBool, KindInt64, or KindFloat64 // then the value of Value is in num as described above. Otherwise, it // contains the value wrapped in the appropriate type. any any } type ( // sliceptr represents a value in Value.any for KindString Values. stringptr *byte // bytesptr represents a value in Value.any for KindBytes Values. bytesptr *byte // sliceptr represents a value in Value.any for KindSlice Values. sliceptr *Value // mapptr represents a value in Value.any for KindMap Values. mapptr *Attr ) // ValueKind is the kind of a [Value]. type ValueKind int // ValueKind values. const ( ValueKindEmpty ValueKind = iota ValueKindBool ValueKindFloat64 ValueKindInt64 ValueKindString ValueKindBytes ValueKindSlice ValueKindMap ) var valueKindStrings = []string{ "Empty", "Bool", "Float64", "Int64", "String", "Bytes", "Slice", "Map", } func (k ValueKind) String() string { if k >= 0 && int(k) < len(valueKindStrings) { return valueKindStrings[k] } return "" } // StringValue returns a new [Value] for a string. func StringValue(v string) Value { return Value{ num: uint64(len(v)), any: stringptr(unsafe.StringData(v)), } } // IntValue returns a [Value] for an int. func IntValue(v int) Value { return Int64Value(int64(v)) } // Int64Value returns a [Value] for an int64. func Int64Value(v int64) Value { return Value{num: uint64(v), any: ValueKindInt64} //nolint:gosec // Raw value conv. } // Float64Value returns a [Value] for a float64. func Float64Value(v float64) Value { return Value{num: math.Float64bits(v), any: ValueKindFloat64} } // BoolValue returns a [Value] for a bool. func BoolValue(v bool) Value { //nolint:revive // Not a control flag. var n uint64 if v { n = 1 } return Value{num: n, any: ValueKindBool} } // BytesValue returns a [Value] for a byte slice. The passed slice must not be // changed after it is passed. func BytesValue(v []byte) Value { return Value{ num: uint64(len(v)), any: bytesptr(unsafe.SliceData(v)), } } // SliceValue returns a [Value] for a slice of [Value]. The passed slice must // not be changed after it is passed. func SliceValue(vs ...Value) Value { return Value{ num: uint64(len(vs)), any: sliceptr(unsafe.SliceData(vs)), } } // MapValue returns a new [Value] for a slice of key-value pairs. The passed // slice must not be changed after it is passed. func MapValue(kvs ...Attr) Value { return Value{ num: uint64(len(kvs)), any: mapptr(unsafe.SliceData(kvs)), } } // AsString returns the value held by v as a string. func (v Value) AsString() string { if sp, ok := v.any.(stringptr); ok { return unsafe.String(sp, v.num) } // TODO: error handle return "" } // asString returns the value held by v as a string. It will panic if the Value // is not KindString. func (v Value) asString() string { return unsafe.String(v.any.(stringptr), v.num) } // AsInt64 returns the value held by v as an int64. func (v Value) AsInt64() int64 { if v.Kind() != ValueKindInt64 { // TODO: error handle return 0 } return v.asInt64() } // asInt64 returns the value held by v as an int64. If v is not of KindInt64, // this will return garbage. func (v Value) asInt64() int64 { // Assumes v.num was a valid int64 (overflow not checked). return int64(v.num) //nolint:gosec // Bounded. } // AsBool returns the value held by v as a bool. func (v Value) AsBool() bool { if v.Kind() != ValueKindBool { // TODO: error handle return false } return v.asBool() } // asBool returns the value held by v as a bool. If v is not of KindBool, this // will return garbage. func (v Value) asBool() bool { return v.num == 1 } // AsFloat64 returns the value held by v as a float64. func (v Value) AsFloat64() float64 { if v.Kind() != ValueKindFloat64 { // TODO: error handle return 0 } return v.asFloat64() } // asFloat64 returns the value held by v as a float64. If v is not of // KindFloat64, this will return garbage. func (v Value) asFloat64() float64 { return math.Float64frombits(v.num) } // AsBytes returns the value held by v as a []byte. func (v Value) AsBytes() []byte { if sp, ok := v.any.(bytesptr); ok { return unsafe.Slice((*byte)(sp), v.num) } // TODO: error handle return nil } // asBytes returns the value held by v as a []byte. It will panic if the Value // is not KindBytes. func (v Value) asBytes() []byte { return unsafe.Slice((*byte)(v.any.(bytesptr)), v.num) } // AsSlice returns the value held by v as a []Value. func (v Value) AsSlice() []Value { if sp, ok := v.any.(sliceptr); ok { return unsafe.Slice((*Value)(sp), v.num) } // TODO: error handle return nil } // asSlice returns the value held by v as a []Value. It will panic if the Value // is not KindSlice. func (v Value) asSlice() []Value { return unsafe.Slice((*Value)(v.any.(sliceptr)), v.num) } // AsMap returns the value held by v as a []Attr. func (v Value) AsMap() []Attr { if sp, ok := v.any.(mapptr); ok { return unsafe.Slice((*Attr)(sp), v.num) } // TODO: error handle return nil } // asMap returns the value held by v as a []Attr. It will panic if the // Value is not KindMap. func (v Value) asMap() []Attr { return unsafe.Slice((*Attr)(v.any.(mapptr)), v.num) } // Kind returns the Kind of v. func (v Value) Kind() ValueKind { switch x := v.any.(type) { case ValueKind: return x case stringptr: return ValueKindString case bytesptr: return ValueKindBytes case sliceptr: return ValueKindSlice case mapptr: return ValueKindMap default: return ValueKindEmpty } } // Empty returns if v does not hold any value. func (v Value) Empty() bool { return v.Kind() == ValueKindEmpty } // Equal returns if v is equal to w. func (v Value) Equal(w Value) bool { k1 := v.Kind() k2 := w.Kind() if k1 != k2 { return false } switch k1 { case ValueKindInt64, ValueKindBool: return v.num == w.num case ValueKindString: return v.asString() == w.asString() case ValueKindFloat64: return v.asFloat64() == w.asFloat64() case ValueKindSlice: return slices.EqualFunc(v.asSlice(), w.asSlice(), Value.Equal) case ValueKindMap: sv := sortMap(v.asMap()) sw := sortMap(w.asMap()) return slices.EqualFunc(sv, sw, Attr.Equal) case ValueKindBytes: return bytes.Equal(v.asBytes(), w.asBytes()) case ValueKindEmpty: return true default: // TODO: error handle return false } } func sortMap(m []Attr) []Attr { sm := make([]Attr, len(m)) copy(sm, m) slices.SortFunc(sm, func(a, b Attr) int { return cmp.Compare(a.Key, b.Key) }) return sm } // String returns Value's value as a string, formatted like [fmt.Sprint]. // // The returned string is meant for debugging; // the string representation is not stable. func (v Value) String() string { switch v.Kind() { case ValueKindString: return v.asString() case ValueKindInt64: // Assumes v.num was a valid int64 (overflow not checked). return strconv.FormatInt(int64(v.num), 10) //nolint:gosec // Bounded. case ValueKindFloat64: return strconv.FormatFloat(v.asFloat64(), 'g', -1, 64) case ValueKindBool: return strconv.FormatBool(v.asBool()) case ValueKindBytes: return string(v.asBytes()) case ValueKindMap: return fmt.Sprint(v.asMap()) case ValueKindSlice: return fmt.Sprint(v.asSlice()) case ValueKindEmpty: return "" default: // Try to handle this as gracefully as possible. // // Don't panic here. The goal here is to have developers find this // first if a slog.Kind is is not handled. It is // preferable to have user's open issue asking why their attributes // have a "unhandled: " prefix than say that their code is panicking. return fmt.Sprintf("", v.Kind()) } } // MarshalJSON encodes v into OTLP formatted JSON. func (v *Value) MarshalJSON() ([]byte, error) { switch v.Kind() { case ValueKindString: return json.Marshal(struct { Value string `json:"stringValue"` }{v.asString()}) case ValueKindInt64: return json.Marshal(struct { Value string `json:"intValue"` }{strconv.FormatInt(int64(v.num), 10)}) //nolint:gosec // Raw value conv. case ValueKindFloat64: return json.Marshal(struct { Value float64 `json:"doubleValue"` }{v.asFloat64()}) case ValueKindBool: return json.Marshal(struct { Value bool `json:"boolValue"` }{v.asBool()}) case ValueKindBytes: return json.Marshal(struct { Value []byte `json:"bytesValue"` }{v.asBytes()}) case ValueKindMap: return json.Marshal(struct { Value struct { Values []Attr `json:"values"` } `json:"kvlistValue"` }{struct { Values []Attr `json:"values"` }{v.asMap()}}) case ValueKindSlice: return json.Marshal(struct { Value struct { Values []Value `json:"values"` } `json:"arrayValue"` }{struct { Values []Value `json:"values"` }{v.asSlice()}}) case ValueKindEmpty: return nil, nil default: return nil, fmt.Errorf("unknown Value kind: %s", v.Kind().String()) } } // UnmarshalJSON decodes the OTLP formatted JSON contained in data into v. func (v *Value) UnmarshalJSON(data []byte) error { decoder := json.NewDecoder(bytes.NewReader(data)) t, err := decoder.Token() if err != nil { return err } if t != json.Delim('{') { return errors.New("invalid Value type") } for decoder.More() { keyIface, err := decoder.Token() if err != nil { if errors.Is(err, io.EOF) { // Empty. return nil } return err } key, ok := keyIface.(string) if !ok { return fmt.Errorf("invalid Value key: %#v", keyIface) } switch key { case "stringValue", "string_value": var val string err = decoder.Decode(&val) *v = StringValue(val) case "boolValue", "bool_value": var val bool err = decoder.Decode(&val) *v = BoolValue(val) case "intValue", "int_value": var val protoInt64 err = decoder.Decode(&val) *v = Int64Value(val.Int64()) case "doubleValue", "double_value": var val float64 err = decoder.Decode(&val) *v = Float64Value(val) case "bytesValue", "bytes_value": var val64 string if err := decoder.Decode(&val64); err != nil { return err } var val []byte val, err = base64.StdEncoding.DecodeString(val64) *v = BytesValue(val) case "arrayValue", "array_value": var val struct{ Values []Value } err = decoder.Decode(&val) *v = SliceValue(val.Values...) case "kvlistValue", "kvlist_value": var val struct{ Values []Attr } err = decoder.Decode(&val) *v = MapValue(val.Values...) default: // Skip unknown. continue } // Use first valid. Ignore the rest. return err } // Only unknown fields. Return nil without unmarshaling any value. return nil } ================================================ FILE: vendor/go.opentelemetry.io/auto/sdk/limit.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package sdk import ( "log/slog" "os" "strconv" ) // maxSpan are the span limits resolved during startup. var maxSpan = newSpanLimits() type spanLimits struct { // Attrs is the number of allowed attributes for a span. // // This is resolved from the environment variable value for the // OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT key if it exists. Otherwise, the // environment variable value for OTEL_ATTRIBUTE_COUNT_LIMIT, or 128 if // that is not set, is used. Attrs int // AttrValueLen is the maximum attribute value length allowed for a span. // // This is resolved from the environment variable value for the // OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT key if it exists. Otherwise, the // environment variable value for OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT, or -1 // if that is not set, is used. AttrValueLen int // Events is the number of allowed events for a span. // // This is resolved from the environment variable value for the // OTEL_SPAN_EVENT_COUNT_LIMIT key, or 128 is used if that is not set. Events int // EventAttrs is the number of allowed attributes for a span event. // // The is resolved from the environment variable value for the // OTEL_EVENT_ATTRIBUTE_COUNT_LIMIT key, or 128 is used if that is not set. EventAttrs int // Links is the number of allowed Links for a span. // // This is resolved from the environment variable value for the // OTEL_SPAN_LINK_COUNT_LIMIT, or 128 is used if that is not set. Links int // LinkAttrs is the number of allowed attributes for a span link. // // This is resolved from the environment variable value for the // OTEL_LINK_ATTRIBUTE_COUNT_LIMIT, or 128 is used if that is not set. LinkAttrs int } func newSpanLimits() spanLimits { return spanLimits{ Attrs: firstEnv( 128, "OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT", "OTEL_ATTRIBUTE_COUNT_LIMIT", ), AttrValueLen: firstEnv( -1, // Unlimited. "OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT", "OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT", ), Events: firstEnv(128, "OTEL_SPAN_EVENT_COUNT_LIMIT"), EventAttrs: firstEnv(128, "OTEL_EVENT_ATTRIBUTE_COUNT_LIMIT"), Links: firstEnv(128, "OTEL_SPAN_LINK_COUNT_LIMIT"), LinkAttrs: firstEnv(128, "OTEL_LINK_ATTRIBUTE_COUNT_LIMIT"), } } // firstEnv returns the parsed integer value of the first matching environment // variable from keys. The defaultVal is returned if the value is not an // integer or no match is found. func firstEnv(defaultVal int, keys ...string) int { for _, key := range keys { strV := os.Getenv(key) if strV == "" { continue } v, err := strconv.Atoi(strV) if err == nil { return v } slog.Warn( "invalid limit environment variable", "error", err, "key", key, "value", strV, ) } return defaultVal } ================================================ FILE: vendor/go.opentelemetry.io/auto/sdk/span.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package sdk import ( "encoding/json" "fmt" "math" "reflect" "runtime" "strings" "sync" "sync/atomic" "time" "unicode/utf8" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" semconv "go.opentelemetry.io/otel/semconv/v1.37.0" "go.opentelemetry.io/otel/trace" "go.opentelemetry.io/otel/trace/noop" "go.opentelemetry.io/auto/sdk/internal/telemetry" ) type span struct { noop.Span spanContext trace.SpanContext sampled atomic.Bool mu sync.Mutex traces *telemetry.Traces span *telemetry.Span } func (s *span) SpanContext() trace.SpanContext { if s == nil { return trace.SpanContext{} } // s.spanContext is immutable, do not acquire lock s.mu. return s.spanContext } func (s *span) IsRecording() bool { if s == nil { return false } return s.sampled.Load() } func (s *span) SetStatus(c codes.Code, msg string) { if s == nil || !s.sampled.Load() { return } s.mu.Lock() defer s.mu.Unlock() if s.span.Status == nil { s.span.Status = new(telemetry.Status) } s.span.Status.Message = msg switch c { case codes.Unset: s.span.Status.Code = telemetry.StatusCodeUnset case codes.Error: s.span.Status.Code = telemetry.StatusCodeError case codes.Ok: s.span.Status.Code = telemetry.StatusCodeOK } } func (s *span) SetAttributes(attrs ...attribute.KeyValue) { if s == nil || !s.sampled.Load() { return } s.mu.Lock() defer s.mu.Unlock() limit := maxSpan.Attrs if limit == 0 { // No attributes allowed. n := int64(len(attrs)) if n > 0 { s.span.DroppedAttrs += uint32( //nolint:gosec // Bounds checked. min(n, math.MaxUint32), ) } return } m := make(map[string]int) for i, a := range s.span.Attrs { m[a.Key] = i } for _, a := range attrs { val := convAttrValue(a.Value) if val.Empty() { s.span.DroppedAttrs++ continue } if idx, ok := m[string(a.Key)]; ok { s.span.Attrs[idx] = telemetry.Attr{ Key: string(a.Key), Value: val, } } else if limit < 0 || len(s.span.Attrs) < limit { s.span.Attrs = append(s.span.Attrs, telemetry.Attr{ Key: string(a.Key), Value: val, }) m[string(a.Key)] = len(s.span.Attrs) - 1 } else { s.span.DroppedAttrs++ } } } // convCappedAttrs converts up to limit attrs into a []telemetry.Attr. The // number of dropped attributes is also returned. func convCappedAttrs(limit int, attrs []attribute.KeyValue) ([]telemetry.Attr, uint32) { n := len(attrs) if limit == 0 { var out uint32 if n > 0 { out = uint32(min(int64(n), math.MaxUint32)) //nolint:gosec // Bounds checked. } return nil, out } if limit < 0 { // Unlimited. return convAttrs(attrs), 0 } if n < 0 { n = 0 } limit = min(n, limit) return convAttrs(attrs[:limit]), uint32(n - limit) //nolint:gosec // Bounds checked. } func convAttrs(attrs []attribute.KeyValue) []telemetry.Attr { if len(attrs) == 0 { // Avoid allocations if not necessary. return nil } out := make([]telemetry.Attr, 0, len(attrs)) for _, attr := range attrs { key := string(attr.Key) val := convAttrValue(attr.Value) if val.Empty() { continue } out = append(out, telemetry.Attr{Key: key, Value: val}) } return out } func convAttrValue(value attribute.Value) telemetry.Value { switch value.Type() { case attribute.BOOL: return telemetry.BoolValue(value.AsBool()) case attribute.INT64: return telemetry.Int64Value(value.AsInt64()) case attribute.FLOAT64: return telemetry.Float64Value(value.AsFloat64()) case attribute.STRING: v := truncate(maxSpan.AttrValueLen, value.AsString()) return telemetry.StringValue(v) case attribute.BOOLSLICE: slice := value.AsBoolSlice() out := make([]telemetry.Value, 0, len(slice)) for _, v := range slice { out = append(out, telemetry.BoolValue(v)) } return telemetry.SliceValue(out...) case attribute.INT64SLICE: slice := value.AsInt64Slice() out := make([]telemetry.Value, 0, len(slice)) for _, v := range slice { out = append(out, telemetry.Int64Value(v)) } return telemetry.SliceValue(out...) case attribute.FLOAT64SLICE: slice := value.AsFloat64Slice() out := make([]telemetry.Value, 0, len(slice)) for _, v := range slice { out = append(out, telemetry.Float64Value(v)) } return telemetry.SliceValue(out...) case attribute.STRINGSLICE: slice := value.AsStringSlice() out := make([]telemetry.Value, 0, len(slice)) for _, v := range slice { v = truncate(maxSpan.AttrValueLen, v) out = append(out, telemetry.StringValue(v)) } return telemetry.SliceValue(out...) } return telemetry.Value{} } // truncate returns a truncated version of s such that it contains less than // the limit number of characters. Truncation is applied by returning the limit // number of valid characters contained in s. // // If limit is negative, it returns the original string. // // UTF-8 is supported. When truncating, all invalid characters are dropped // before applying truncation. // // If s already contains less than the limit number of bytes, it is returned // unchanged. No invalid characters are removed. func truncate(limit int, s string) string { // This prioritize performance in the following order based on the most // common expected use-cases. // // - Short values less than the default limit (128). // - Strings with valid encodings that exceed the limit. // - No limit. // - Strings with invalid encodings that exceed the limit. if limit < 0 || len(s) <= limit { return s } // Optimistically, assume all valid UTF-8. var b strings.Builder count := 0 for i, c := range s { if c != utf8.RuneError { count++ if count > limit { return s[:i] } continue } _, size := utf8.DecodeRuneInString(s[i:]) if size == 1 { // Invalid encoding. b.Grow(len(s) - 1) _, _ = b.WriteString(s[:i]) s = s[i:] break } } // Fast-path, no invalid input. if b.Cap() == 0 { return s } // Truncate while validating UTF-8. for i := 0; i < len(s) && count < limit; { c := s[i] if c < utf8.RuneSelf { // Optimization for single byte runes (common case). _ = b.WriteByte(c) i++ count++ continue } _, size := utf8.DecodeRuneInString(s[i:]) if size == 1 { // We checked for all 1-byte runes above, this is a RuneError. i++ continue } _, _ = b.WriteString(s[i : i+size]) i += size count++ } return b.String() } func (s *span) End(opts ...trace.SpanEndOption) { if s == nil || !s.sampled.Swap(false) { return } // s.end exists so the lock (s.mu) is not held while s.ended is called. s.ended(s.end(opts)) } func (s *span) end(opts []trace.SpanEndOption) []byte { s.mu.Lock() defer s.mu.Unlock() cfg := trace.NewSpanEndConfig(opts...) if t := cfg.Timestamp(); !t.IsZero() { s.span.EndTime = cfg.Timestamp() } else { s.span.EndTime = time.Now() } b, _ := json.Marshal(s.traces) // TODO: do not ignore this error. return b } // Expected to be implemented in eBPF. // //go:noinline func (*span) ended(buf []byte) { ended(buf) } // ended is used for testing. var ended = func([]byte) {} func (s *span) RecordError(err error, opts ...trace.EventOption) { if s == nil || err == nil || !s.sampled.Load() { return } cfg := trace.NewEventConfig(opts...) attrs := cfg.Attributes() attrs = append(attrs, semconv.ExceptionType(typeStr(err)), semconv.ExceptionMessage(err.Error()), ) if cfg.StackTrace() { buf := make([]byte, 2048) n := runtime.Stack(buf, false) attrs = append(attrs, semconv.ExceptionStacktrace(string(buf[0:n]))) } s.mu.Lock() defer s.mu.Unlock() s.addEvent(semconv.ExceptionEventName, cfg.Timestamp(), attrs) } func typeStr(i any) string { t := reflect.TypeOf(i) if t.PkgPath() == "" && t.Name() == "" { // Likely a builtin type. return t.String() } return fmt.Sprintf("%s.%s", t.PkgPath(), t.Name()) } func (s *span) AddEvent(name string, opts ...trace.EventOption) { if s == nil || !s.sampled.Load() { return } cfg := trace.NewEventConfig(opts...) s.mu.Lock() defer s.mu.Unlock() s.addEvent(name, cfg.Timestamp(), cfg.Attributes()) } // addEvent adds an event with name and attrs at tStamp to the span. The span // lock (s.mu) needs to be held by the caller. func (s *span) addEvent(name string, tStamp time.Time, attrs []attribute.KeyValue) { limit := maxSpan.Events if limit == 0 { s.span.DroppedEvents++ return } if limit > 0 && len(s.span.Events) == limit { // Drop head while avoiding allocation of more capacity. copy(s.span.Events[:limit-1], s.span.Events[1:]) s.span.Events = s.span.Events[:limit-1] s.span.DroppedEvents++ } e := &telemetry.SpanEvent{Time: tStamp, Name: name} e.Attrs, e.DroppedAttrs = convCappedAttrs(maxSpan.EventAttrs, attrs) s.span.Events = append(s.span.Events, e) } func (s *span) AddLink(link trace.Link) { if s == nil || !s.sampled.Load() { return } l := maxSpan.Links s.mu.Lock() defer s.mu.Unlock() if l == 0 { s.span.DroppedLinks++ return } if l > 0 && len(s.span.Links) == l { // Drop head while avoiding allocation of more capacity. copy(s.span.Links[:l-1], s.span.Links[1:]) s.span.Links = s.span.Links[:l-1] s.span.DroppedLinks++ } s.span.Links = append(s.span.Links, convLink(link)) } func convLinks(links []trace.Link) []*telemetry.SpanLink { out := make([]*telemetry.SpanLink, 0, len(links)) for _, link := range links { out = append(out, convLink(link)) } return out } func convLink(link trace.Link) *telemetry.SpanLink { l := &telemetry.SpanLink{ TraceID: telemetry.TraceID(link.SpanContext.TraceID()), SpanID: telemetry.SpanID(link.SpanContext.SpanID()), TraceState: link.SpanContext.TraceState().String(), Flags: uint32(link.SpanContext.TraceFlags()), } l.Attrs, l.DroppedAttrs = convCappedAttrs(maxSpan.LinkAttrs, link.Attributes) return l } func (s *span) SetName(name string) { if s == nil || !s.sampled.Load() { return } s.mu.Lock() defer s.mu.Unlock() s.span.Name = name } func (*span) TracerProvider() trace.TracerProvider { return TracerProvider() } ================================================ FILE: vendor/go.opentelemetry.io/auto/sdk/tracer.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package sdk import ( "context" "math" "time" "go.opentelemetry.io/otel/trace" "go.opentelemetry.io/otel/trace/noop" "go.opentelemetry.io/auto/sdk/internal/telemetry" ) type tracer struct { noop.Tracer name, schemaURL, version string } var _ trace.Tracer = tracer{} func (t tracer) Start( ctx context.Context, name string, opts ...trace.SpanStartOption, ) (context.Context, trace.Span) { var psc, sc trace.SpanContext sampled := true span := new(span) // Ask eBPF for sampling decision and span context info. t.start(ctx, span, &psc, &sampled, &sc) span.sampled.Store(sampled) span.spanContext = sc ctx = trace.ContextWithSpan(ctx, span) if sampled { // Only build traces if sampled. cfg := trace.NewSpanStartConfig(opts...) span.traces, span.span = t.traces(name, cfg, span.spanContext, psc) } return ctx, span } // Expected to be implemented in eBPF. // //go:noinline func (t *tracer) start( ctx context.Context, spanPtr *span, psc *trace.SpanContext, sampled *bool, sc *trace.SpanContext, ) { start(ctx, spanPtr, psc, sampled, sc) } // start is used for testing. var start = func(context.Context, *span, *trace.SpanContext, *bool, *trace.SpanContext) {} var intToUint32Bound = min(math.MaxInt, math.MaxUint32) func (t tracer) traces( name string, cfg trace.SpanConfig, sc, psc trace.SpanContext, ) (*telemetry.Traces, *telemetry.Span) { span := &telemetry.Span{ TraceID: telemetry.TraceID(sc.TraceID()), SpanID: telemetry.SpanID(sc.SpanID()), Flags: uint32(sc.TraceFlags()), TraceState: sc.TraceState().String(), ParentSpanID: telemetry.SpanID(psc.SpanID()), Name: name, Kind: spanKind(cfg.SpanKind()), } span.Attrs, span.DroppedAttrs = convCappedAttrs(maxSpan.Attrs, cfg.Attributes()) links := cfg.Links() if limit := maxSpan.Links; limit == 0 { n := len(links) if n > 0 { bounded := max(min(n, intToUint32Bound), 0) span.DroppedLinks = uint32(bounded) //nolint:gosec // Bounds checked. } } else { if limit > 0 { n := max(len(links)-limit, 0) bounded := min(n, intToUint32Bound) span.DroppedLinks = uint32(bounded) //nolint:gosec // Bounds checked. links = links[n:] } span.Links = convLinks(links) } if t := cfg.Timestamp(); !t.IsZero() { span.StartTime = cfg.Timestamp() } else { span.StartTime = time.Now() } return &telemetry.Traces{ ResourceSpans: []*telemetry.ResourceSpans{ { ScopeSpans: []*telemetry.ScopeSpans{ { Scope: &telemetry.Scope{ Name: t.name, Version: t.version, }, Spans: []*telemetry.Span{span}, SchemaURL: t.schemaURL, }, }, }, }, }, span } func spanKind(kind trace.SpanKind) telemetry.SpanKind { switch kind { case trace.SpanKindInternal: return telemetry.SpanKindInternal case trace.SpanKindServer: return telemetry.SpanKindServer case trace.SpanKindClient: return telemetry.SpanKindClient case trace.SpanKindProducer: return telemetry.SpanKindProducer case trace.SpanKindConsumer: return telemetry.SpanKindConsumer } return telemetry.SpanKind(0) // undefined. } ================================================ FILE: vendor/go.opentelemetry.io/auto/sdk/tracer_provider.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package sdk import ( "go.opentelemetry.io/otel/trace" "go.opentelemetry.io/otel/trace/noop" ) // TracerProvider returns an auto-instrumentable [trace.TracerProvider]. // // If an [go.opentelemetry.io/auto.Instrumentation] is configured to instrument // the process using the returned TracerProvider, all of the telemetry it // produces will be processed and handled by that Instrumentation. By default, // if no Instrumentation instruments the TracerProvider it will not generate // any trace telemetry. func TracerProvider() trace.TracerProvider { return tracerProviderInstance } var tracerProviderInstance = new(tracerProvider) type tracerProvider struct{ noop.TracerProvider } var _ trace.TracerProvider = tracerProvider{} func (p tracerProvider) Tracer(name string, opts ...trace.TracerOption) trace.Tracer { cfg := trace.NewTracerConfig(opts...) return tracer{ name: name, version: cfg.InstrumentationVersion(), schemaURL: cfg.SchemaURL(), } } ================================================ FILE: vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/LICENSE ================================================ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -------------------------------------------------------------------------------- Copyright 2009 The Go Authors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/common.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" import ( "net/http" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/trace" ) // Attribute keys that can be added to a span. const ( ReadBytesKey = attribute.Key("http.read_bytes") // if anything was read from the request body, the total number of bytes read ReadErrorKey = attribute.Key("http.read_error") // If an error occurred while reading a request, the string of the error (io.EOF is not recorded) WroteBytesKey = attribute.Key("http.wrote_bytes") // if anything was written to the response writer, the total number of bytes written WriteErrorKey = attribute.Key("http.write_error") // if an error occurred while writing a reply, the string of the error (io.EOF is not recorded) ) // Filter is a predicate used to determine whether a given http.request should // be traced. A Filter must return true if the request should be traced. type Filter func(*http.Request) bool func newTracer(tp trace.TracerProvider) trace.Tracer { return tp.Tracer(ScopeName, trace.WithInstrumentationVersion(Version)) } ================================================ FILE: vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/config.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" import ( "context" "net/http" "net/http/httptrace" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/metric" "go.opentelemetry.io/otel/propagation" "go.opentelemetry.io/otel/trace" ) // ScopeName is the instrumentation scope name. const ScopeName = "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" // config represents the configuration options available for the http.Handler // and http.Transport types. type config struct { ServerName string Tracer trace.Tracer Meter metric.Meter Propagators propagation.TextMapPropagator SpanStartOptions []trace.SpanStartOption PublicEndpointFn func(*http.Request) bool ReadEvent bool WriteEvent bool Filters []Filter SpanNameFormatter func(string, *http.Request) string ClientTrace func(context.Context) *httptrace.ClientTrace TracerProvider trace.TracerProvider MeterProvider metric.MeterProvider MetricAttributesFn func(*http.Request) []attribute.KeyValue } // Option interface used for setting optional config properties. type Option interface { apply(*config) } type optionFunc func(*config) func (o optionFunc) apply(c *config) { o(c) } // newConfig creates a new config struct and applies opts to it. func newConfig(opts ...Option) *config { c := &config{ Propagators: otel.GetTextMapPropagator(), MeterProvider: otel.GetMeterProvider(), } for _, opt := range opts { opt.apply(c) } // Tracer is only initialized if manually specified. Otherwise, can be passed with the tracing context. if c.TracerProvider != nil { c.Tracer = newTracer(c.TracerProvider) } c.Meter = c.MeterProvider.Meter( ScopeName, metric.WithInstrumentationVersion(Version), ) return c } // WithTracerProvider specifies a tracer provider to use for creating a tracer. // If none is specified, the global provider is used. func WithTracerProvider(provider trace.TracerProvider) Option { return optionFunc(func(cfg *config) { if provider != nil { cfg.TracerProvider = provider } }) } // WithMeterProvider specifies a meter provider to use for creating a meter. // If none is specified, the global provider is used. func WithMeterProvider(provider metric.MeterProvider) Option { return optionFunc(func(cfg *config) { if provider != nil { cfg.MeterProvider = provider } }) } // WithPublicEndpointFn runs with every request, and allows conditionally // configuring the Handler to link the span with an incoming span context. If // this option is not provided or returns false, then the association is a // child association instead of a link. func WithPublicEndpointFn(fn func(*http.Request) bool) Option { return optionFunc(func(c *config) { c.PublicEndpointFn = fn }) } // WithPropagators configures specific propagators. If this // option isn't specified, then the global TextMapPropagator is used. func WithPropagators(ps propagation.TextMapPropagator) Option { return optionFunc(func(c *config) { if ps != nil { c.Propagators = ps } }) } // WithSpanOptions configures an additional set of // trace.SpanOptions, which are applied to each new span. func WithSpanOptions(opts ...trace.SpanStartOption) Option { return optionFunc(func(c *config) { c.SpanStartOptions = append(c.SpanStartOptions, opts...) }) } // WithFilter adds a filter to the list of filters used by the handler. // If any filter indicates to exclude a request then the request will not be // traced. All filters must allow a request to be traced for a Span to be created. // If no filters are provided then all requests are traced. // Filters will be invoked for each processed request, it is advised to make them // simple and fast. func WithFilter(f Filter) Option { return optionFunc(func(c *config) { c.Filters = append(c.Filters, f) }) } // Event represents message event types for [WithMessageEvents]. type Event int // Different types of events that can be recorded, see WithMessageEvents. const ( unspecifiedEvents Event = iota ReadEvents WriteEvents ) // WithMessageEvents configures the Handler to record the specified events // (span.AddEvent) on spans. By default only summary attributes are added at the // end of the request. // // Valid events are: // - ReadEvents: Record the number of bytes read after every http.Request.Body.Read // using the ReadBytesKey // - WriteEvents: Record the number of bytes written after every http.ResponeWriter.Write // using the WriteBytesKey func WithMessageEvents(events ...Event) Option { return optionFunc(func(c *config) { for _, e := range events { switch e { case ReadEvents: c.ReadEvent = true case WriteEvents: c.WriteEvent = true } } }) } // WithSpanNameFormatter takes a function that will be called on every // request and the returned string will become the Span Name. // // When using [http.ServeMux] (or any middleware that sets the Pattern of [http.Request]), // the span name formatter will run twice. Once when the span is created, and // second time after the middleware, so the pattern can be used. func WithSpanNameFormatter(f func(operation string, r *http.Request) string) Option { return optionFunc(func(c *config) { c.SpanNameFormatter = f }) } // WithClientTrace takes a function that returns client trace instance that will be // applied to the requests sent through the otelhttp Transport. func WithClientTrace(f func(context.Context) *httptrace.ClientTrace) Option { return optionFunc(func(c *config) { c.ClientTrace = f }) } // WithServerName returns an Option that sets the name of the (virtual) server // handling requests. func WithServerName(server string) Option { return optionFunc(func(c *config) { c.ServerName = server }) } // WithMetricAttributesFn returns an Option to set a function that maps an HTTP request to a slice of attribute.KeyValue. // These attributes will be included in metrics for every request. func WithMetricAttributesFn(metricAttributesFn func(r *http.Request) []attribute.KeyValue) Option { return optionFunc(func(c *config) { c.MetricAttributesFn = metricAttributesFn }) } ================================================ FILE: vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/doc.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 // Package otelhttp provides an http.Handler and functions that are intended // to be used to add tracing by wrapping existing handlers. package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" ================================================ FILE: vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" import ( "net/http" "time" "github.com/felixge/httpsnoop" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/propagation" "go.opentelemetry.io/otel/trace" "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request" "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv" ) // middleware is an http middleware which wraps the next handler in a span. type middleware struct { operation string server string tracer trace.Tracer propagators propagation.TextMapPropagator spanStartOptions []trace.SpanStartOption readEvent bool writeEvent bool filters []Filter spanNameFormatter func(string, *http.Request) string publicEndpointFn func(*http.Request) bool metricAttributesFn func(*http.Request) []attribute.KeyValue semconv semconv.HTTPServer } func defaultHandlerFormatter(operation string, _ *http.Request) string { return operation } // NewHandler wraps the passed handler in a span named after the operation and // enriches it with metrics. func NewHandler(handler http.Handler, operation string, opts ...Option) http.Handler { return NewMiddleware(operation, opts...)(handler) } // NewMiddleware returns a tracing and metrics instrumentation middleware. // The handler returned by the middleware wraps a handler // in a span named after the operation and enriches it with metrics. func NewMiddleware(operation string, opts ...Option) func(http.Handler) http.Handler { h := middleware{ operation: operation, } defaultOpts := []Option{ WithSpanOptions(trace.WithSpanKind(trace.SpanKindServer)), WithSpanNameFormatter(defaultHandlerFormatter), } c := newConfig(append(defaultOpts, opts...)...) h.configure(c) return func(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { h.serveHTTP(w, r, next) }) } } func (h *middleware) configure(c *config) { h.tracer = c.Tracer h.propagators = c.Propagators h.spanStartOptions = c.SpanStartOptions h.readEvent = c.ReadEvent h.writeEvent = c.WriteEvent h.filters = c.Filters h.spanNameFormatter = c.SpanNameFormatter h.publicEndpointFn = c.PublicEndpointFn h.server = c.ServerName h.semconv = semconv.NewHTTPServer(c.Meter) h.metricAttributesFn = c.MetricAttributesFn } // serveHTTP sets up tracing and calls the given next http.Handler with the span // context injected into the request context. func (h *middleware) serveHTTP(w http.ResponseWriter, r *http.Request, next http.Handler) { requestStartTime := time.Now() for _, f := range h.filters { if !f(r) { // Simply pass through to the handler if a filter rejects the request next.ServeHTTP(w, r) return } } ctx := h.propagators.Extract(r.Context(), propagation.HeaderCarrier(r.Header)) opts := []trace.SpanStartOption{ trace.WithAttributes(h.semconv.RequestTraceAttrs(h.server, r, semconv.RequestTraceAttrsOpts{})...), } opts = append(opts, h.spanStartOptions...) if h.publicEndpointFn != nil && h.publicEndpointFn(r.WithContext(ctx)) { opts = append(opts, trace.WithNewRoot()) // Linking incoming span context if any for public endpoint. if s := trace.SpanContextFromContext(ctx); s.IsValid() && s.IsRemote() { opts = append(opts, trace.WithLinks(trace.Link{SpanContext: s})) } } tracer := h.tracer if tracer == nil { if span := trace.SpanFromContext(r.Context()); span.SpanContext().IsValid() { tracer = newTracer(span.TracerProvider()) } else { tracer = newTracer(otel.GetTracerProvider()) } } if startTime := StartTimeFromContext(ctx); !startTime.IsZero() { opts = append(opts, trace.WithTimestamp(startTime)) requestStartTime = startTime } ctx, span := tracer.Start(ctx, h.spanNameFormatter(h.operation, r), opts...) defer span.End() readRecordFunc := func(int64) {} if h.readEvent { readRecordFunc = func(n int64) { span.AddEvent("read", trace.WithAttributes(ReadBytesKey.Int64(n))) } } // if request body is nil or NoBody, we don't want to mutate the body as it // will affect the identity of it in an unforeseeable way because we assert // ReadCloser fulfills a certain interface and it is indeed nil or NoBody. bw := request.NewBodyWrapper(r.Body, readRecordFunc) if r.Body != nil && r.Body != http.NoBody { r.Body = bw } writeRecordFunc := func(int64) {} if h.writeEvent { writeRecordFunc = func(n int64) { span.AddEvent("write", trace.WithAttributes(WroteBytesKey.Int64(n))) } } rww := request.NewRespWriterWrapper(w, writeRecordFunc) // Wrap w to use our ResponseWriter methods while also exposing // other interfaces that w may implement (http.CloseNotifier, // http.Flusher, http.Hijacker, http.Pusher, io.ReaderFrom). w = httpsnoop.Wrap(w, httpsnoop.Hooks{ Header: func(httpsnoop.HeaderFunc) httpsnoop.HeaderFunc { return rww.Header }, Write: func(httpsnoop.WriteFunc) httpsnoop.WriteFunc { return rww.Write }, WriteHeader: func(httpsnoop.WriteHeaderFunc) httpsnoop.WriteHeaderFunc { return rww.WriteHeader }, Flush: func(httpsnoop.FlushFunc) httpsnoop.FlushFunc { return rww.Flush }, }) labeler, found := LabelerFromContext(ctx) if !found { ctx = ContextWithLabeler(ctx, labeler) } r = r.WithContext(ctx) next.ServeHTTP(w, r) if r.Pattern != "" { span.SetName(h.spanNameFormatter(h.operation, r)) } statusCode := rww.StatusCode() bytesWritten := rww.BytesWritten() span.SetStatus(h.semconv.Status(statusCode)) span.SetAttributes(h.semconv.ResponseTraceAttrs(semconv.ResponseTelemetry{ StatusCode: statusCode, ReadBytes: bw.BytesRead(), ReadError: bw.Error(), WriteBytes: bytesWritten, WriteError: rww.Error(), })...) // Use floating point division here for higher precision (instead of Millisecond method). elapsedTime := float64(time.Since(requestStartTime)) / float64(time.Millisecond) metricAttributes := semconv.MetricAttributes{ Req: r, StatusCode: statusCode, AdditionalAttributes: append(labeler.Get(), h.metricAttributesFromRequest(r)...), } h.semconv.RecordMetrics(ctx, semconv.ServerMetricData{ ServerName: h.server, ResponseSize: bytesWritten, MetricAttributes: metricAttributes, MetricData: semconv.MetricData{ RequestSize: bw.BytesRead(), ElapsedTime: elapsedTime, }, }) } func (h *middleware) metricAttributesFromRequest(r *http.Request) []attribute.KeyValue { var attributeForRequest []attribute.KeyValue if h.metricAttributesFn != nil { attributeForRequest = h.metricAttributesFn(r) } return attributeForRequest } ================================================ FILE: vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request/body_wrapper.go ================================================ // Code generated by gotmpl. DO NOT MODIFY. // source: internal/shared/request/body_wrapper.go.tmpl // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 // Package request provides types and functionality to handle HTTP request // handling. package request // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request" import ( "io" "sync" ) var _ io.ReadCloser = &BodyWrapper{} // BodyWrapper wraps a http.Request.Body (an io.ReadCloser) to track the number // of bytes read and the last error. type BodyWrapper struct { io.ReadCloser OnRead func(n int64) // must not be nil mu sync.Mutex read int64 err error } // NewBodyWrapper creates a new BodyWrapper. // // The onRead attribute is a callback that will be called every time the data // is read, with the number of bytes being read. func NewBodyWrapper(body io.ReadCloser, onRead func(int64)) *BodyWrapper { return &BodyWrapper{ ReadCloser: body, OnRead: onRead, } } // Read reads the data from the io.ReadCloser, and stores the number of bytes // read and the error. func (w *BodyWrapper) Read(b []byte) (int, error) { n, err := w.ReadCloser.Read(b) n1 := int64(n) w.updateReadData(n1, err) w.OnRead(n1) return n, err } func (w *BodyWrapper) updateReadData(n int64, err error) { w.mu.Lock() defer w.mu.Unlock() w.read += n if err != nil { w.err = err } } // Close closes the io.ReadCloser. func (w *BodyWrapper) Close() error { return w.ReadCloser.Close() } // BytesRead returns the number of bytes read up to this point. func (w *BodyWrapper) BytesRead() int64 { w.mu.Lock() defer w.mu.Unlock() return w.read } // Error returns the last error. func (w *BodyWrapper) Error() error { w.mu.Lock() defer w.mu.Unlock() return w.err } ================================================ FILE: vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request/gen.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package request // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request" // Generate request package: //go:generate gotmpl --body=../../../../../../internal/shared/request/body_wrapper.go.tmpl "--data={}" --out=body_wrapper.go //go:generate gotmpl --body=../../../../../../internal/shared/request/body_wrapper_test.go.tmpl "--data={}" --out=body_wrapper_test.go //go:generate gotmpl --body=../../../../../../internal/shared/request/resp_writer_wrapper.go.tmpl "--data={}" --out=resp_writer_wrapper.go //go:generate gotmpl --body=../../../../../../internal/shared/request/resp_writer_wrapper_test.go.tmpl "--data={}" --out=resp_writer_wrapper_test.go ================================================ FILE: vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request/resp_writer_wrapper.go ================================================ // Code generated by gotmpl. DO NOT MODIFY. // source: internal/shared/request/resp_writer_wrapper.go.tmpl // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package request // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request" import ( "net/http" "sync" ) var _ http.ResponseWriter = &RespWriterWrapper{} // RespWriterWrapper wraps a http.ResponseWriter in order to track the number of // bytes written, the last error, and to catch the first written statusCode. // TODO: The wrapped http.ResponseWriter doesn't implement any of the optional // types (http.Hijacker, http.Pusher, http.CloseNotifier, etc) // that may be useful when using it in real life situations. type RespWriterWrapper struct { http.ResponseWriter OnWrite func(n int64) // must not be nil mu sync.RWMutex written int64 statusCode int err error wroteHeader bool } // NewRespWriterWrapper creates a new RespWriterWrapper. // // The onWrite attribute is a callback that will be called every time the data // is written, with the number of bytes that were written. func NewRespWriterWrapper(w http.ResponseWriter, onWrite func(int64)) *RespWriterWrapper { return &RespWriterWrapper{ ResponseWriter: w, OnWrite: onWrite, statusCode: http.StatusOK, // default status code in case the Handler doesn't write anything } } // Write writes the bytes array into the [ResponseWriter], and tracks the // number of bytes written and last error. func (w *RespWriterWrapper) Write(p []byte) (int, error) { w.mu.Lock() defer w.mu.Unlock() if !w.wroteHeader { w.writeHeader(http.StatusOK) } n, err := w.ResponseWriter.Write(p) n1 := int64(n) w.OnWrite(n1) w.written += n1 w.err = err return n, err } // WriteHeader persists initial statusCode for span attribution. // All calls to WriteHeader will be propagated to the underlying ResponseWriter // and will persist the statusCode from the first call. // Blocking consecutive calls to WriteHeader alters expected behavior and will // remove warning logs from net/http where developers will notice incorrect handler implementations. func (w *RespWriterWrapper) WriteHeader(statusCode int) { w.mu.Lock() defer w.mu.Unlock() w.writeHeader(statusCode) } // writeHeader persists the status code for span attribution, and propagates // the call to the underlying ResponseWriter. // It does not acquire a lock, and therefore assumes that is being handled by a // parent method. func (w *RespWriterWrapper) writeHeader(statusCode int) { if !w.wroteHeader { w.wroteHeader = true w.statusCode = statusCode } w.ResponseWriter.WriteHeader(statusCode) } // Flush implements [http.Flusher]. func (w *RespWriterWrapper) Flush() { w.mu.Lock() defer w.mu.Unlock() if !w.wroteHeader { w.writeHeader(http.StatusOK) } if f, ok := w.ResponseWriter.(http.Flusher); ok { f.Flush() } } // BytesWritten returns the number of bytes written. func (w *RespWriterWrapper) BytesWritten() int64 { w.mu.RLock() defer w.mu.RUnlock() return w.written } // StatusCode returns the HTTP status code that was sent. func (w *RespWriterWrapper) StatusCode() int { w.mu.RLock() defer w.mu.RUnlock() return w.statusCode } // Error returns the last error. func (w *RespWriterWrapper) Error() error { w.mu.RLock() defer w.mu.RUnlock() return w.err } ================================================ FILE: vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/client.go ================================================ // Code generated by gotmpl. DO NOT MODIFY. // source: internal/shared/semconv/client.go.tmpl // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 // Package semconv provides OpenTelemetry semantic convention types and // functionality. package semconv // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv" import ( "context" "fmt" "net/http" "slices" "strconv" "strings" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" "go.opentelemetry.io/otel/metric" "go.opentelemetry.io/otel/semconv/v1.39.0" "go.opentelemetry.io/otel/semconv/v1.39.0/httpconv" ) type HTTPClient struct{ requestBodySize httpconv.ClientRequestBodySize requestDuration httpconv.ClientRequestDuration } func NewHTTPClient(meter metric.Meter) HTTPClient { client := HTTPClient{} var err error client.requestBodySize, err = httpconv.NewClientRequestBodySize(meter) handleErr(err) client.requestDuration, err = httpconv.NewClientRequestDuration( meter, metric.WithExplicitBucketBoundaries(0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10), ) handleErr(err) return client } func (n HTTPClient) Status(code int) (codes.Code, string) { if code < 100 || code >= 600 { return codes.Error, fmt.Sprintf("Invalid HTTP status code %d", code) } if code >= 400 { return codes.Error, "" } return codes.Unset, "" } // RequestTraceAttrs returns trace attributes for an HTTP request made by a client. func (n HTTPClient) RequestTraceAttrs(req *http.Request) []attribute.KeyValue { /* below attributes are returned: - http.request.method - http.request.method.original - url.full - server.address - server.port - network.protocol.name - network.protocol.version */ numOfAttributes := 3 // URL, server address, proto, and method. var urlHost string if req.URL != nil { urlHost = req.URL.Host } var requestHost string var requestPort int for _, hostport := range []string{urlHost, req.Header.Get("Host")} { requestHost, requestPort = SplitHostPort(hostport) if requestHost != "" || requestPort > 0 { break } } eligiblePort := requiredHTTPPort(req.URL != nil && req.URL.Scheme == "https", requestPort) if eligiblePort > 0 { numOfAttributes++ } useragent := req.UserAgent() if useragent != "" { numOfAttributes++ } protoName, protoVersion := netProtocol(req.Proto) if protoName != "" && protoName != "http" { numOfAttributes++ } if protoVersion != "" { numOfAttributes++ } method, originalMethod := n.method(req.Method) if originalMethod != (attribute.KeyValue{}) { numOfAttributes++ } attrs := make([]attribute.KeyValue, 0, numOfAttributes) attrs = append(attrs, method) if originalMethod != (attribute.KeyValue{}) { attrs = append(attrs, originalMethod) } var u string if req.URL != nil { // Remove any username/password info that may be in the URL. userinfo := req.URL.User req.URL.User = nil u = req.URL.String() // Restore any username/password info that was removed. req.URL.User = userinfo } attrs = append(attrs, semconv.URLFull(u)) attrs = append(attrs, semconv.ServerAddress(requestHost)) if eligiblePort > 0 { attrs = append(attrs, semconv.ServerPort(eligiblePort)) } if protoName != "" && protoName != "http" { attrs = append(attrs, semconv.NetworkProtocolName(protoName)) } if protoVersion != "" { attrs = append(attrs, semconv.NetworkProtocolVersion(protoVersion)) } return attrs } // ResponseTraceAttrs returns trace attributes for an HTTP response made by a client. func (n HTTPClient) ResponseTraceAttrs(resp *http.Response) []attribute.KeyValue { /* below attributes are returned: - http.response.status_code - error.type */ var count int if resp.StatusCode > 0 { count++ } if isErrorStatusCode(resp.StatusCode) { count++ } attrs := make([]attribute.KeyValue, 0, count) if resp.StatusCode > 0 { attrs = append(attrs, semconv.HTTPResponseStatusCode(resp.StatusCode)) } if isErrorStatusCode(resp.StatusCode) { errorType := strconv.Itoa(resp.StatusCode) attrs = append(attrs, semconv.ErrorTypeKey.String(errorType)) } return attrs } func (n HTTPClient) method(method string) (attribute.KeyValue, attribute.KeyValue) { if method == "" { return semconv.HTTPRequestMethodGet, attribute.KeyValue{} } if attr, ok := methodLookup[method]; ok { return attr, attribute.KeyValue{} } orig := semconv.HTTPRequestMethodOriginal(method) if attr, ok := methodLookup[strings.ToUpper(method)]; ok { return attr, orig } return semconv.HTTPRequestMethodGet, orig } func (n HTTPClient) MetricAttributes(req *http.Request, statusCode int, additionalAttributes []attribute.KeyValue) []attribute.KeyValue { num := len(additionalAttributes) + 2 var h string if req.URL != nil { h = req.URL.Host } var requestHost string var requestPort int for _, hostport := range []string{h, req.Header.Get("Host")} { requestHost, requestPort = SplitHostPort(hostport) if requestHost != "" || requestPort > 0 { break } } port := requiredHTTPPort(req.URL != nil && req.URL.Scheme == "https", requestPort) if port > 0 { num++ } protoName, protoVersion := netProtocol(req.Proto) if protoName != "" { num++ } if protoVersion != "" { num++ } if statusCode > 0 { num++ } attributes := slices.Grow(additionalAttributes, num) attributes = append(attributes, semconv.HTTPRequestMethodKey.String(standardizeHTTPMethod(req.Method)), semconv.ServerAddress(requestHost), n.scheme(req), ) if port > 0 { attributes = append(attributes, semconv.ServerPort(port)) } if protoName != "" { attributes = append(attributes, semconv.NetworkProtocolName(protoName)) } if protoVersion != "" { attributes = append(attributes, semconv.NetworkProtocolVersion(protoVersion)) } if statusCode > 0 { attributes = append(attributes, semconv.HTTPResponseStatusCode(statusCode)) } return attributes } type MetricOpts struct { measurement metric.MeasurementOption addOptions metric.AddOption } func (o MetricOpts) MeasurementOption() metric.MeasurementOption { return o.measurement } func (o MetricOpts) AddOptions() metric.AddOption { return o.addOptions } func (n HTTPClient) MetricOptions(ma MetricAttributes) map[string]MetricOpts { opts := map[string]MetricOpts{} attributes := n.MetricAttributes(ma.Req, ma.StatusCode, ma.AdditionalAttributes) set := metric.WithAttributeSet(attribute.NewSet(attributes...)) opts["new"] = MetricOpts{ measurement: set, addOptions: set, } return opts } func (n HTTPClient) RecordMetrics(ctx context.Context, md MetricData, opts map[string]MetricOpts) { n.requestBodySize.Inst().Record(ctx, md.RequestSize, opts["new"].MeasurementOption()) n.requestDuration.Inst().Record(ctx, md.ElapsedTime/1000, opts["new"].MeasurementOption()) } // TraceAttributes returns attributes for httptrace. func (n HTTPClient) TraceAttributes(host string) []attribute.KeyValue { return []attribute.KeyValue{ semconv.ServerAddress(host), } } func (n HTTPClient) scheme(req *http.Request) attribute.KeyValue { if req.URL != nil && req.URL.Scheme != "" { return semconv.URLScheme(req.URL.Scheme) } if req.TLS != nil { return semconv.URLScheme("https") } return semconv.URLScheme("http") } func isErrorStatusCode(code int) bool { return code >= 400 || code < 100 } ================================================ FILE: vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/gen.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package semconv // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv" // Generate semconv package: //go:generate gotmpl --body=../../../../../../internal/shared/semconv/bench_test.go.tmpl "--data={ \"pkg\": \"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp\" }" --out=bench_test.go //go:generate gotmpl --body=../../../../../../internal/shared/semconv/common_test.go.tmpl "--data={ \"pkg\": \"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp\" }" --out=common_test.go //go:generate gotmpl --body=../../../../../../internal/shared/semconv/server.go.tmpl "--data={ \"pkg\": \"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp\" }" --out=server.go //go:generate gotmpl --body=../../../../../../internal/shared/semconv/server_test.go.tmpl "--data={ \"pkg\": \"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp\" }" --out=server_test.go //go:generate gotmpl --body=../../../../../../internal/shared/semconv/client.go.tmpl "--data={ \"pkg\": \"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp\" }" --out=client.go //go:generate gotmpl --body=../../../../../../internal/shared/semconv/client_test.go.tmpl "--data={ \"pkg\": \"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp\" }" --out=client_test.go //go:generate gotmpl --body=../../../../../../internal/shared/semconv/httpconvtest_test.go.tmpl "--data={ \"pkg\": \"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp\" }" --out=httpconvtest_test.go //go:generate gotmpl --body=../../../../../../internal/shared/semconv/util.go.tmpl "--data={ \"pkg\": \"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp\" }" --out=util.go //go:generate gotmpl --body=../../../../../../internal/shared/semconv/util_test.go.tmpl "--data={ \"pkg\": \"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp\" }" --out=util_test.go ================================================ FILE: vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/server.go ================================================ // Code generated by gotmpl. DO NOT MODIFY. // source: internal/shared/semconv/server.go.tmpl // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 // Package semconv provides OpenTelemetry semantic convention types and // functionality. package semconv // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv" import ( "context" "fmt" "net/http" "slices" "strings" "sync" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" "go.opentelemetry.io/otel/metric" "go.opentelemetry.io/otel/semconv/v1.39.0" "go.opentelemetry.io/otel/semconv/v1.39.0/httpconv" ) type RequestTraceAttrsOpts struct { // If set, this is used as value for the "http.client_ip" attribute. HTTPClientIP string } type ResponseTelemetry struct { StatusCode int ReadBytes int64 ReadError error WriteBytes int64 WriteError error } type HTTPServer struct{ requestBodySizeHistogram httpconv.ServerRequestBodySize responseBodySizeHistogram httpconv.ServerResponseBodySize requestDurationHistogram httpconv.ServerRequestDuration } func NewHTTPServer(meter metric.Meter) HTTPServer { server := HTTPServer{} var err error server.requestBodySizeHistogram, err = httpconv.NewServerRequestBodySize(meter) handleErr(err) server.responseBodySizeHistogram, err = httpconv.NewServerResponseBodySize(meter) handleErr(err) server.requestDurationHistogram, err = httpconv.NewServerRequestDuration( meter, metric.WithExplicitBucketBoundaries( 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10, ), ) handleErr(err) return server } // Status returns a span status code and message for an HTTP status code // value returned by a server. Status codes in the 400-499 range are not // returned as errors. func (n HTTPServer) Status(code int) (codes.Code, string) { if code < 100 || code >= 600 { return codes.Error, fmt.Sprintf("Invalid HTTP status code %d", code) } if code >= 500 { return codes.Error, "" } return codes.Unset, "" } // RequestTraceAttrs returns trace attributes for an HTTP request received by a // server. // // The server must be the primary server name if it is known. For example this // would be the ServerName directive // (https://httpd.apache.org/docs/2.4/mod/core.html#servername) for an Apache // server, and the server_name directive // (http://nginx.org/en/docs/http/ngx_http_core_module.html#server_name) for an // nginx server. More generically, the primary server name would be the host // header value that matches the default virtual host of an HTTP server. It // should include the host identifier and if a port is used to route to the // server that port identifier should be included as an appropriate port // suffix. // // If the primary server name is not known, server should be an empty string. // The req Host will be used to determine the server instead. func (n HTTPServer) RequestTraceAttrs(server string, req *http.Request, opts RequestTraceAttrsOpts) []attribute.KeyValue { count := 3 // ServerAddress, Method, Scheme var host string var p int if server == "" { host, p = SplitHostPort(req.Host) } else { // Prioritize the primary server name. host, p = SplitHostPort(server) if p < 0 { _, p = SplitHostPort(req.Host) } } hostPort := requiredHTTPPort(req.TLS != nil, p) if hostPort > 0 { count++ } method, methodOriginal := n.method(req.Method) if methodOriginal != (attribute.KeyValue{}) { count++ } scheme := n.scheme(req.TLS != nil) peer, peerPort := SplitHostPort(req.RemoteAddr) if peer != "" { // The Go HTTP server sets RemoteAddr to "IP:port", this will not be a // file-path that would be interpreted with a sock family. count++ if peerPort > 0 { count++ } } useragent := req.UserAgent() if useragent != "" { count++ } // For client IP, use, in order: // 1. The value passed in the options // 2. The value in the X-Forwarded-For header // 3. The peer address clientIP := opts.HTTPClientIP if clientIP == "" { clientIP = serverClientIP(req.Header.Get("X-Forwarded-For")) if clientIP == "" { clientIP = peer } } if clientIP != "" { count++ } if req.URL != nil && req.URL.Path != "" { count++ } protoName, protoVersion := netProtocol(req.Proto) if protoName != "" && protoName != "http" { count++ } if protoVersion != "" { count++ } route := httpRoute(req.Pattern) if route != "" { count++ } attrs := make([]attribute.KeyValue, 0, count) attrs = append(attrs, semconv.ServerAddress(host), method, scheme, ) if hostPort > 0 { attrs = append(attrs, semconv.ServerPort(hostPort)) } if methodOriginal != (attribute.KeyValue{}) { attrs = append(attrs, methodOriginal) } if peer, peerPort := SplitHostPort(req.RemoteAddr); peer != "" { // The Go HTTP server sets RemoteAddr to "IP:port", this will not be a // file-path that would be interpreted with a sock family. attrs = append(attrs, semconv.NetworkPeerAddress(peer)) if peerPort > 0 { attrs = append(attrs, semconv.NetworkPeerPort(peerPort)) } } if useragent != "" { attrs = append(attrs, semconv.UserAgentOriginal(useragent)) } if clientIP != "" { attrs = append(attrs, semconv.ClientAddress(clientIP)) } if req.URL != nil && req.URL.Path != "" { attrs = append(attrs, semconv.URLPath(req.URL.Path)) } if protoName != "" && protoName != "http" { attrs = append(attrs, semconv.NetworkProtocolName(protoName)) } if protoVersion != "" { attrs = append(attrs, semconv.NetworkProtocolVersion(protoVersion)) } if route != "" { attrs = append(attrs, n.Route(route)) } return attrs } func (s HTTPServer) NetworkTransportAttr(network string) []attribute.KeyValue { attr := semconv.NetworkTransportPipe switch network { case "tcp", "tcp4", "tcp6": attr = semconv.NetworkTransportTCP case "udp", "udp4", "udp6": attr = semconv.NetworkTransportUDP case "unix", "unixgram", "unixpacket": attr = semconv.NetworkTransportUnix } return []attribute.KeyValue{attr} } type ServerMetricData struct { ServerName string ResponseSize int64 MetricData MetricAttributes } type MetricAttributes struct { Req *http.Request StatusCode int Route string AdditionalAttributes []attribute.KeyValue } type MetricData struct { RequestSize int64 // The request duration, in milliseconds ElapsedTime float64 } var ( metricAddOptionPool = &sync.Pool{ New: func() any { return &[]metric.AddOption{} }, } metricRecordOptionPool = &sync.Pool{ New: func() any { return &[]metric.RecordOption{} }, } ) func (n HTTPServer) RecordMetrics(ctx context.Context, md ServerMetricData) { attributes := n.MetricAttributes(md.ServerName, md.Req, md.StatusCode, md.Route, md.AdditionalAttributes) o := metric.WithAttributeSet(attribute.NewSet(attributes...)) recordOpts := metricRecordOptionPool.Get().(*[]metric.RecordOption) *recordOpts = append(*recordOpts, o) n.requestBodySizeHistogram.Inst().Record(ctx, md.RequestSize, *recordOpts...) n.responseBodySizeHistogram.Inst().Record(ctx, md.ResponseSize, *recordOpts...) n.requestDurationHistogram.Inst().Record(ctx, md.ElapsedTime/1000.0, o) *recordOpts = (*recordOpts)[:0] metricRecordOptionPool.Put(recordOpts) } func (n HTTPServer) method(method string) (attribute.KeyValue, attribute.KeyValue) { if method == "" { return semconv.HTTPRequestMethodGet, attribute.KeyValue{} } if attr, ok := methodLookup[method]; ok { return attr, attribute.KeyValue{} } orig := semconv.HTTPRequestMethodOriginal(method) if attr, ok := methodLookup[strings.ToUpper(method)]; ok { return attr, orig } return semconv.HTTPRequestMethodGet, orig } func (n HTTPServer) scheme(https bool) attribute.KeyValue { //nolint:revive // ignore linter if https { return semconv.URLScheme("https") } return semconv.URLScheme("http") } // ResponseTraceAttrs returns trace attributes for telemetry from an HTTP // response. // // If any of the fields in the ResponseTelemetry are not set the attribute will // be omitted. func (n HTTPServer) ResponseTraceAttrs(resp ResponseTelemetry) []attribute.KeyValue { var count int if resp.ReadBytes > 0 { count++ } if resp.WriteBytes > 0 { count++ } if resp.StatusCode > 0 { count++ } attributes := make([]attribute.KeyValue, 0, count) if resp.ReadBytes > 0 { attributes = append(attributes, semconv.HTTPRequestBodySize(int(resp.ReadBytes)), ) } if resp.WriteBytes > 0 { attributes = append(attributes, semconv.HTTPResponseBodySize(int(resp.WriteBytes)), ) } if resp.StatusCode > 0 { attributes = append(attributes, semconv.HTTPResponseStatusCode(resp.StatusCode), ) } return attributes } // Route returns the attribute for the route. func (n HTTPServer) Route(route string) attribute.KeyValue { return semconv.HTTPRoute(route) } func (n HTTPServer) MetricAttributes(server string, req *http.Request, statusCode int, route string, additionalAttributes []attribute.KeyValue) []attribute.KeyValue { num := len(additionalAttributes) + 3 var host string var p int if server == "" { host, p = SplitHostPort(req.Host) } else { // Prioritize the primary server name. host, p = SplitHostPort(server) if p < 0 { _, p = SplitHostPort(req.Host) } } hostPort := requiredHTTPPort(req.TLS != nil, p) if hostPort > 0 { num++ } protoName, protoVersion := netProtocol(req.Proto) if protoName != "" { num++ } if protoVersion != "" { num++ } if statusCode > 0 { num++ } if route != "" { num++ } attributes := slices.Grow(additionalAttributes, num) attributes = append(attributes, semconv.HTTPRequestMethodKey.String(standardizeHTTPMethod(req.Method)), n.scheme(req.TLS != nil), semconv.ServerAddress(host)) if hostPort > 0 { attributes = append(attributes, semconv.ServerPort(hostPort)) } if protoName != "" { attributes = append(attributes, semconv.NetworkProtocolName(protoName)) } if protoVersion != "" { attributes = append(attributes, semconv.NetworkProtocolVersion(protoVersion)) } if statusCode > 0 { attributes = append(attributes, semconv.HTTPResponseStatusCode(statusCode)) } if route != "" { attributes = append(attributes, semconv.HTTPRoute(route)) } return attributes } ================================================ FILE: vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/util.go ================================================ // Code generated by gotmpl. DO NOT MODIFY. // source: internal/shared/semconv/util.go.tmpl // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package semconv // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv" import ( "net" "net/http" "strconv" "strings" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" semconvNew "go.opentelemetry.io/otel/semconv/v1.39.0" ) // SplitHostPort splits a network address hostport of the form "host", // "host%zone", "[host]", "[host%zone], "host:port", "host%zone:port", // "[host]:port", "[host%zone]:port", or ":port" into host or host%zone and // port. // // An empty host is returned if it is not provided or unparsable. A negative // port is returned if it is not provided or unparsable. func SplitHostPort(hostport string) (host string, port int) { port = -1 if strings.HasPrefix(hostport, "[") { addrEnd := strings.LastIndexByte(hostport, ']') if addrEnd < 0 { // Invalid hostport. return } if i := strings.LastIndexByte(hostport[addrEnd:], ':'); i < 0 { host = hostport[1:addrEnd] return } } else { if i := strings.LastIndexByte(hostport, ':'); i < 0 { host = hostport return } } host, pStr, err := net.SplitHostPort(hostport) if err != nil { return } p, err := strconv.ParseUint(pStr, 10, 16) if err != nil { return } return host, int(p) //nolint:gosec // Byte size checked 16 above. } func requiredHTTPPort(https bool, port int) int { //nolint:revive // ignore linter if https { if port > 0 && port != 443 { return port } } else { if port > 0 && port != 80 { return port } } return -1 } func serverClientIP(xForwardedFor string) string { if idx := strings.IndexByte(xForwardedFor, ','); idx >= 0 { xForwardedFor = xForwardedFor[:idx] } return xForwardedFor } func httpRoute(pattern string) string { if idx := strings.IndexByte(pattern, '/'); idx >= 0 { return pattern[idx:] } return "" } func netProtocol(proto string) (name string, version string) { name, version, _ = strings.Cut(proto, "/") switch name { case "HTTP": name = "http" case "QUIC": name = "quic" case "SPDY": name = "spdy" default: name = strings.ToLower(name) } return name, version } var methodLookup = map[string]attribute.KeyValue{ http.MethodConnect: semconvNew.HTTPRequestMethodConnect, http.MethodDelete: semconvNew.HTTPRequestMethodDelete, http.MethodGet: semconvNew.HTTPRequestMethodGet, http.MethodHead: semconvNew.HTTPRequestMethodHead, http.MethodOptions: semconvNew.HTTPRequestMethodOptions, http.MethodPatch: semconvNew.HTTPRequestMethodPatch, http.MethodPost: semconvNew.HTTPRequestMethodPost, http.MethodPut: semconvNew.HTTPRequestMethodPut, http.MethodTrace: semconvNew.HTTPRequestMethodTrace, } func handleErr(err error) { if err != nil { otel.Handle(err) } } func standardizeHTTPMethod(method string) string { method = strings.ToUpper(method) switch method { case http.MethodConnect, http.MethodDelete, http.MethodGet, http.MethodHead, http.MethodOptions, http.MethodPatch, http.MethodPost, http.MethodPut, http.MethodTrace: default: method = "_OTHER" } return method } ================================================ FILE: vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/labeler.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" import ( "context" "sync" "go.opentelemetry.io/otel/attribute" ) // Labeler is used to allow instrumented HTTP handlers to add custom attributes to // the metrics recorded by the net/http instrumentation. type Labeler struct { mu sync.Mutex attributes []attribute.KeyValue } // Add attributes to a Labeler. func (l *Labeler) Add(ls ...attribute.KeyValue) { l.mu.Lock() defer l.mu.Unlock() l.attributes = append(l.attributes, ls...) } // Get returns a copy of the attributes added to the Labeler. func (l *Labeler) Get() []attribute.KeyValue { l.mu.Lock() defer l.mu.Unlock() ret := make([]attribute.KeyValue, len(l.attributes)) copy(ret, l.attributes) return ret } type labelerContextKeyType int const labelerContextKey labelerContextKeyType = 0 // ContextWithLabeler returns a new context with the provided Labeler instance. // Attributes added to the specified labeler will be injected into metrics // emitted by the instrumentation. Only one labeller can be injected into the // context. Injecting it multiple times will override the previous calls. func ContextWithLabeler(parent context.Context, l *Labeler) context.Context { return context.WithValue(parent, labelerContextKey, l) } // LabelerFromContext retrieves a Labeler instance from the provided context if // one is available. If no Labeler was found in the provided context a new, empty // Labeler is returned and the second return value is false. In this case it is // safe to use the Labeler but any attributes added to it will not be used. func LabelerFromContext(ctx context.Context) (*Labeler, bool) { l, ok := ctx.Value(labelerContextKey).(*Labeler) if !ok { l = &Labeler{} } return l, ok } ================================================ FILE: vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/start_time_context.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" import ( "context" "time" ) type startTimeContextKeyType int const startTimeContextKey startTimeContextKeyType = 0 // ContextWithStartTime returns a new context with the provided start time. The // start time will be used for metrics and traces emitted by the // instrumentation. Only one labeller can be injected into the context. // Injecting it multiple times will override the previous calls. func ContextWithStartTime(parent context.Context, start time.Time) context.Context { return context.WithValue(parent, startTimeContextKey, start) } // StartTimeFromContext retrieves a time.Time from the provided context if one // is available. If no start time was found in the provided context, a new, // zero start time is returned and the second return value is false. func StartTimeFromContext(ctx context.Context) time.Time { t, _ := ctx.Value(startTimeContextKey).(time.Time) return t } ================================================ FILE: vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/transport.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" import ( "context" "fmt" "io" "net/http" "net/http/httptrace" "sync/atomic" "time" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" "go.opentelemetry.io/otel/propagation" otelsemconv "go.opentelemetry.io/otel/semconv/v1.39.0" "go.opentelemetry.io/otel/trace" "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request" "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv" ) // Transport implements the http.RoundTripper interface and wraps // outbound HTTP(S) requests with a span and enriches it with metrics. type Transport struct { rt http.RoundTripper tracer trace.Tracer propagators propagation.TextMapPropagator spanStartOptions []trace.SpanStartOption filters []Filter spanNameFormatter func(string, *http.Request) string clientTrace func(context.Context) *httptrace.ClientTrace metricAttributesFn func(*http.Request) []attribute.KeyValue semconv semconv.HTTPClient } var _ http.RoundTripper = &Transport{} // NewTransport wraps the provided http.RoundTripper with one that // starts a span, injects the span context into the outbound request headers, // and enriches it with metrics. // // If the provided http.RoundTripper is nil, http.DefaultTransport will be used // as the base http.RoundTripper. func NewTransport(base http.RoundTripper, opts ...Option) *Transport { if base == nil { base = http.DefaultTransport } t := Transport{ rt: base, } defaultOpts := []Option{ WithSpanOptions(trace.WithSpanKind(trace.SpanKindClient)), WithSpanNameFormatter(defaultTransportFormatter), } c := newConfig(append(defaultOpts, opts...)...) t.applyConfig(c) return &t } func (t *Transport) applyConfig(c *config) { t.tracer = c.Tracer t.propagators = c.Propagators t.spanStartOptions = c.SpanStartOptions t.filters = c.Filters t.spanNameFormatter = c.SpanNameFormatter t.clientTrace = c.ClientTrace t.semconv = semconv.NewHTTPClient(c.Meter) t.metricAttributesFn = c.MetricAttributesFn } func defaultTransportFormatter(_ string, r *http.Request) string { return "HTTP " + r.Method } // RoundTrip creates a Span and propagates its context via the provided request's headers // before handing the request to the configured base RoundTripper. The created span will // end when the response body is closed or when a read from the body returns io.EOF. // If GetBody returns an error, the error is reported via otel.Handle and the request // continues with the original Body. func (t *Transport) RoundTrip(r *http.Request) (*http.Response, error) { requestStartTime := time.Now() for _, f := range t.filters { if !f(r) { // Simply pass through to the base RoundTripper if a filter rejects the request return t.rt.RoundTrip(r) } } tracer := t.tracer if tracer == nil { if span := trace.SpanFromContext(r.Context()); span.SpanContext().IsValid() { tracer = newTracer(span.TracerProvider()) } else { tracer = newTracer(otel.GetTracerProvider()) } } opts := append([]trace.SpanStartOption{}, t.spanStartOptions...) // start with the configured options ctx, span := tracer.Start(r.Context(), t.spanNameFormatter("", r), opts...) if t.clientTrace != nil { ctx = httptrace.WithClientTrace(ctx, t.clientTrace(ctx)) } labeler, found := LabelerFromContext(ctx) if !found { ctx = ContextWithLabeler(ctx, labeler) } r = r.Clone(ctx) // According to RoundTripper spec, we shouldn't modify the origin request. // GetBody is preferred over direct access to Body if the function is set. // If the resulting body is nil or is NoBody, we don't want to mutate the body as it // will affect the identity of it in an unforeseeable way because we assert // ReadCloser fulfills a certain interface and it is indeed nil or NoBody. body := r.Body if r.GetBody != nil { b, err := r.GetBody() if err != nil { otel.Handle(fmt.Errorf("http.Request GetBody returned an error: %w", err)) } else { body = b } } bw := request.NewBodyWrapper(body, func(int64) {}) if body != nil && body != http.NoBody { r.Body = bw } span.SetAttributes(t.semconv.RequestTraceAttrs(r)...) t.propagators.Inject(ctx, propagation.HeaderCarrier(r.Header)) res, err := t.rt.RoundTrip(r) // Defer metrics recording function to record the metrics on error or no error. defer func() { metricAttributes := semconv.MetricAttributes{ Req: r, AdditionalAttributes: append(labeler.Get(), t.metricAttributesFromRequest(r)...), } if err == nil { metricAttributes.StatusCode = res.StatusCode } metricOpts := t.semconv.MetricOptions(metricAttributes) metricData := semconv.MetricData{ RequestSize: bw.BytesRead(), } if err == nil { readRecordFunc := func(int64) {} res.Body = newWrappedBody(span, readRecordFunc, res.Body) } // Use floating point division here for higher precision (instead of Millisecond method). elapsedTime := float64(time.Since(requestStartTime)) / float64(time.Millisecond) metricData.ElapsedTime = elapsedTime t.semconv.RecordMetrics(ctx, metricData, metricOpts) }() if err != nil { span.SetAttributes(otelsemconv.ErrorType(err)) span.SetStatus(codes.Error, err.Error()) span.End() return res, err } // traces span.SetAttributes(t.semconv.ResponseTraceAttrs(res)...) span.SetStatus(t.semconv.Status(res.StatusCode)) return res, nil } func (t *Transport) metricAttributesFromRequest(r *http.Request) []attribute.KeyValue { var attributeForRequest []attribute.KeyValue if t.metricAttributesFn != nil { attributeForRequest = t.metricAttributesFn(r) } return attributeForRequest } // newWrappedBody returns a new and appropriately scoped *wrappedBody as an // io.ReadCloser. If the passed body implements io.Writer, the returned value // will implement io.ReadWriteCloser. func newWrappedBody(span trace.Span, record func(n int64), body io.ReadCloser) io.ReadCloser { // The successful protocol switch responses will have a body that // implement an io.ReadWriteCloser. Ensure this interface type continues // to be satisfied if that is the case. if _, ok := body.(io.ReadWriteCloser); ok { return &wrappedBody{span: span, record: record, body: body} } // Remove the implementation of the io.ReadWriteCloser and only implement // the io.ReadCloser. return struct{ io.ReadCloser }{&wrappedBody{span: span, record: record, body: body}} } // wrappedBody is the response body type returned by the transport // instrumentation to complete a span. Errors encountered when using the // response body are recorded in span tracking the response. // // The span tracking the response is ended when this body is closed. // // If the response body implements the io.Writer interface (i.e. for // successful protocol switches), the wrapped body also will. type wrappedBody struct { span trace.Span recorded atomic.Bool record func(n int64) body io.ReadCloser read atomic.Int64 } var _ io.ReadWriteCloser = &wrappedBody{} func (wb *wrappedBody) Write(p []byte) (int, error) { // This will not panic given the guard in newWrappedBody. n, err := wb.body.(io.Writer).Write(p) if err != nil { wb.span.SetAttributes(otelsemconv.ErrorType(err)) wb.span.SetStatus(codes.Error, err.Error()) } return n, err } func (wb *wrappedBody) Read(b []byte) (int, error) { n, err := wb.body.Read(b) // Record the number of bytes read wb.read.Add(int64(n)) switch err { case nil: // nothing to do here but fall through to the return case io.EOF: wb.recordBytesRead() wb.span.End() default: wb.span.SetAttributes(otelsemconv.ErrorType(err)) wb.span.SetStatus(codes.Error, err.Error()) } return n, err } // recordBytesRead is a function that ensures the number of bytes read is recorded once and only once. func (wb *wrappedBody) recordBytesRead() { // note: it is more performant (and equally correct) to use atomic.Bool over sync.Once here. In the event that // two goroutines are racing to call this method, the number of bytes read will no longer increase. Using // CompareAndSwap allows later goroutines to return quickly and not block waiting for the race winner to finish // calling wb.record(wb.read.Load()). if wb.recorded.CompareAndSwap(false, true) { // Record the total number of bytes read wb.record(wb.read.Load()) } } func (wb *wrappedBody) Close() error { wb.recordBytesRead() wb.span.End() if wb.body != nil { return wb.body.Close() } return nil } ================================================ FILE: vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/version.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" // Version is the current release version of the otelhttp instrumentation. const Version = "0.65.0" ================================================ FILE: vendor/go.opentelemetry.io/otel/.clomonitor.yml ================================================ exemptions: - check: artifacthub_badge reason: "Artifact Hub doesn't support Go packages" ================================================ FILE: vendor/go.opentelemetry.io/otel/.codespellignore ================================================ ot fo te collison consequentially ans nam valu thirdparty addOpt observ ================================================ FILE: vendor/go.opentelemetry.io/otel/.codespellrc ================================================ # https://github.com/codespell-project/codespell [codespell] builtin = clear,rare,informal check-filenames = check-hidden = ignore-words = .codespellignore interactive = 1 skip = .git,go.mod,go.sum,go.work,go.work.sum,semconv,venv,.tools uri-ignore-words-list = * write = ================================================ FILE: vendor/go.opentelemetry.io/otel/.gitattributes ================================================ * text=auto eol=lf *.{cmd,[cC][mM][dD]} text eol=crlf *.{bat,[bB][aA][tT]} text eol=crlf ================================================ FILE: vendor/go.opentelemetry.io/otel/.gitignore ================================================ .DS_Store Thumbs.db .cache/ .tools/ venv/ .idea/ .vscode/ *.iml *.so coverage.* go.work go.work.sum gen/ ================================================ FILE: vendor/go.opentelemetry.io/otel/.golangci.yml ================================================ version: "2" run: issues-exit-code: 1 tests: true linters: default: none enable: - asasalint - bodyclose - depguard - errcheck - errorlint - gocritic - godot - gosec - govet - ineffassign - misspell - modernize - perfsprint - revive - staticcheck - testifylint - unconvert - unparam - unused - usestdlibvars - usetesting settings: depguard: rules: auto/sdk: files: - '!internal/global/trace.go' - ~internal/global/trace_test.go deny: - pkg: go.opentelemetry.io/auto/sdk desc: Do not use SDK from automatic instrumentation. non-tests: files: - '!$test' - '!**/*test/*.go' - '!**/internal/matchers/*.go' deny: - pkg: testing - pkg: github.com/stretchr/testify - pkg: crypto/md5 - pkg: crypto/sha1 - pkg: crypto/**/pkix otel-internal: files: - '**/sdk/*.go' - '**/sdk/**/*.go' - '**/exporters/*.go' - '**/exporters/**/*.go' - '**/schema/*.go' - '**/schema/**/*.go' - '**/metric/*.go' - '**/metric/**/*.go' - '**/bridge/*.go' - '**/bridge/**/*.go' - '**/trace/*.go' - '**/trace/**/*.go' - '**/log/*.go' - '**/log/**/*.go' deny: - pkg: go.opentelemetry.io/otel/internal$ desc: Do not use cross-module internal packages. - pkg: go.opentelemetry.io/otel/internal/internaltest desc: Do not use cross-module internal packages. otlp-internal: files: - '!**/exporters/otlp/internal/**/*.go' deny: - pkg: go.opentelemetry.io/otel/exporters/otlp/internal desc: Do not use cross-module internal packages. otlpmetric-internal: files: - '!**/exporters/otlp/otlpmetric/internal/*.go' - '!**/exporters/otlp/otlpmetric/internal/**/*.go' deny: - pkg: go.opentelemetry.io/otel/exporters/otlp/otlpmetric/internal desc: Do not use cross-module internal packages. otlptrace-internal: files: - '!**/exporters/otlp/otlptrace/*.go' - '!**/exporters/otlp/otlptrace/internal/**.go' deny: - pkg: go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal desc: Do not use cross-module internal packages. gocritic: disabled-checks: - appendAssign - commentedOutCode - dupArg - hugeParam - importShadow - preferDecodeRune - rangeValCopy - unnamedResult - whyNoLint enable-all: true godot: exclude: # Exclude links. - '^ *\[[^]]+\]:' # Exclude sentence fragments for lists. - ^[ ]*[-•] # Exclude sentences prefixing a list. - :$ misspell: locale: US ignore-rules: - cancelled modernize: disable: - omitzero perfsprint: int-conversion: true err-error: true errorf: true sprintf1: true strconcat: true revive: confidence: 0.01 rules: - name: blank-imports - name: bool-literal-in-expr - name: constant-logical-expr - name: context-as-argument arguments: - allowTypesBefore: '*testing.T' disabled: true - name: context-keys-type - name: deep-exit - name: defer arguments: - - call-chain - loop - name: dot-imports - name: duplicated-imports - name: early-return arguments: - preserveScope - name: empty-block - name: empty-lines - name: error-naming - name: error-return - name: error-strings - name: errorf - name: exported arguments: - sayRepetitiveInsteadOfStutters - name: flag-parameter - name: identical-branches - name: if-return - name: import-shadowing - name: increment-decrement - name: indent-error-flow arguments: - preserveScope - name: package-comments - name: range - name: range-val-in-closure - name: range-val-address - name: redefines-builtin-id - name: string-format arguments: - - panic - /^[^\n]*$/ - must not contain line breaks - name: struct-tag - name: superfluous-else arguments: - preserveScope - name: time-equal - name: unconditional-recursion - name: unexported-return - name: unhandled-error arguments: - fmt.Fprint - fmt.Fprintf - fmt.Fprintln - fmt.Print - fmt.Printf - fmt.Println - name: unused-parameter - name: unused-receiver - name: unnecessary-stmt - name: use-any - name: useless-break - name: var-declaration - name: var-naming arguments: - ["ID"] # AllowList - ["Otel", "Aws", "Gcp"] # DenyList - name: waitgroup-by-value testifylint: enable-all: true disable: - float-compare - go-require - require-error usetesting: context-background: true context-todo: true exclusions: generated: lax presets: - common-false-positives - legacy - std-error-handling rules: - linters: - revive path: schema/v.*/types/.* text: avoid meaningless package names # TODO: Having appropriate comments for exported objects helps development, # even for objects in internal packages. Appropriate comments for all # exported objects should be added and this exclusion removed. - linters: - revive path: .*internal/.* text: exported (method|function|type|const) (.+) should have comment or be unexported # Yes, they are, but it's okay in a test. - linters: - revive path: _test\.go text: exported func.*returns unexported type.*which can be annoying to use # Example test functions should be treated like main. - linters: - revive path: example.*_test\.go text: calls to (.+) only in main[(][)] or init[(][)] functions # It's okay to not run gosec and perfsprint in a test. - linters: - gosec - perfsprint path: _test\.go # Ignoring gosec G404: Use of weak random number generator (math/rand instead of crypto/rand) # as we commonly use it in tests and examples. - linters: - gosec text: 'G404:' # Ignoring gosec G402: TLS MinVersion too low # as the https://pkg.go.dev/crypto/tls#Config handles MinVersion default well. - linters: - gosec text: 'G402: TLS MinVersion too low.' issues: max-issues-per-linter: 0 max-same-issues: 0 formatters: enable: - gofumpt - goimports - golines settings: gofumpt: extra-rules: true goimports: local-prefixes: - go.opentelemetry.io/otel golines: max-len: 120 exclusions: generated: lax ================================================ FILE: vendor/go.opentelemetry.io/otel/.lycheeignore ================================================ http://localhost https://localhost http://jaeger-collector https://github.com/open-telemetry/opentelemetry-go/milestone/ https://github.com/open-telemetry/opentelemetry-go/projects # Weaver model URL for semantic-conventions repository. https?:\/\/github\.com\/open-telemetry\/semantic-conventions\/archive\/refs\/tags\/[^.]+\.zip\[[^]]+] file:///home/runner/work/opentelemetry-go/opentelemetry-go/libraries file:///home/runner/work/opentelemetry-go/opentelemetry-go/manual http://4.3.2.1:78/user/123 file:///home/runner/work/opentelemetry-go/opentelemetry-go/exporters/otlp/otlptrace/otlptracegrpc/internal/observ/dns:/:4317 # URL works, but it has blocked link checkers. https://dl.acm.org/doi/10.1145/198429.198435 ================================================ FILE: vendor/go.opentelemetry.io/otel/.markdownlint.yaml ================================================ # Default state for all rules default: true # ul-style MD004: false # hard-tabs MD010: false # line-length MD013: false # no-duplicate-header MD024: siblings_only: true #single-title MD025: false # ol-prefix MD029: style: ordered # no-inline-html MD033: false # fenced-code-language MD040: false ================================================ FILE: vendor/go.opentelemetry.io/otel/CHANGELOG.md ================================================ # Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] ## [1.40.0/0.62.0/0.16.0] 2026-02-02 ### Added - Add `AlwaysRecord` sampler in `go.opentelemetry.io/otel/sdk/trace`. (#7724) - Add `Enabled` method to all synchronous instrument interfaces (`Float64Counter`, `Float64UpDownCounter`, `Float64Histogram`, `Float64Gauge`, `Int64Counter`, `Int64UpDownCounter`, `Int64Histogram`, `Int64Gauge`,) in `go.opentelemetry.io/otel/metric`. This stabilizes the synchronous instrument enabled feature, allowing users to check if an instrument will process measurements before performing computationally expensive operations. (#7763) - Add `go.opentelemetry.io/otel/semconv/v1.39.0` package. The package contains semantic conventions from the `v1.39.0` version of the OpenTelemetry Semantic Conventions. See the [migration documentation](./semconv/v1.39.0/MIGRATION.md) for information on how to upgrade from `go.opentelemetry.io/otel/semconv/v1.38.0.` (#7783, #7789) ### Changed - Improve the concurrent performance of `HistogramReservoir` in `go.opentelemetry.io/otel/sdk/metric/exemplar` by 4x. (#7443) - Improve the concurrent performance of `FixedSizeReservoir` in `go.opentelemetry.io/otel/sdk/metric/exemplar`. (#7447) - Improve performance of concurrent histogram measurements in `go.opentelemetry.io/otel/sdk/metric`. (#7474) - Improve performance of concurrent synchronous gauge measurements in `go.opentelemetry.io/otel/sdk/metric`. (#7478) - Add experimental observability metrics in `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric`. (#7492) - `Exporter` in `go.opentelemetry.io/otel/exporters/prometheus` ignores metrics with the scope `go.opentelemetry.io/contrib/bridges/prometheus`. This prevents scrape failures when the Prometheus exporter is misconfigured to get data from the Prometheus bridge. (#7688) - Improve performance of concurrent exponential histogram measurements in `go.opentelemetry.io/otel/sdk/metric`. (#7702) - The `rpc.grpc.status_code` attribute in the experimental metrics emitted from `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc` is replaced with the `rpc.response.status_code` attribute to align with the semantic conventions. (#7854) - The `rpc.grpc.status_code` attribute in the experimental metrics emitted from `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc` is replaced with the `rpc.response.status_code` attribute to align with the semantic conventions. (#7854) ### Fixed - Fix bad log message when key-value pairs are dropped because of key duplication in `go.opentelemetry.io/otel/sdk/log`. (#7662) - Fix `DroppedAttributes` on `Record` in `go.opentelemetry.io/otel/sdk/log` to not count the non-attribute key-value pairs dropped because of key duplication. (#7662) - Fix `SetAttributes` on `Record` in `go.opentelemetry.io/otel/sdk/log` to not log that attributes are dropped when they are actually not dropped. (#7662) - Fix missing `request.GetBody` in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp` to correctly handle HTTP/2 `GOAWAY` frame. (#7794) - `WithHostID` detector in `go.opentelemetry.io/otel/sdk/resource` to use full path for `ioreg` command on Darwin (macOS). (#7818) ### Deprecated - Deprecate `go.opentelemetry.io/otel/exporters/zipkin`. For more information, see the [OTel blog post deprecating the Zipkin exporter](https://opentelemetry.io/blog/2025/deprecating-zipkin-exporters/). (#7670) ## [1.39.0/0.61.0/0.15.0/0.0.14] 2025-12-05 ### Added - Greatly reduce the cost of recording metrics in `go.opentelemetry.io/otel/sdk/metric` using hashing for map keys. (#7175) - Add `WithInstrumentationAttributeSet` option to `go.opentelemetry.io/otel/log`, `go.opentelemetry.io/otel/metric`, and `go.opentelemetry.io/otel/trace` packages. This provides a concurrent-safe and performant alternative to `WithInstrumentationAttributes` by accepting a pre-constructed `attribute.Set`. (#7287) - Add experimental observability for the Prometheus exporter in `go.opentelemetry.io/otel/exporters/prometheus`. Check the `go.opentelemetry.io/otel/exporters/prometheus/internal/x` package documentation for more information. (#7345) - Add experimental observability metrics in `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc`. (#7353) - Add temporality selector functions `DeltaTemporalitySelector`, `CumulativeTemporalitySelector`, `LowMemoryTemporalitySelector` to `go.opentelemetry.io/otel/sdk/metric`. (#7434) - Add experimental observability metrics for simple log processor in `go.opentelemetry.io/otel/sdk/log`. (#7548) - Add experimental observability metrics in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc`. (#7459) - Add experimental observability metrics in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`. (#7486) - Add experimental observability metrics for simple span processor in `go.opentelemetry.io/otel/sdk/trace`. (#7374) - Add experimental observability metrics in `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp`. (#7512) - Add experimental observability metrics for manual reader in `go.opentelemetry.io/otel/sdk/metric`. (#7524) - Add experimental observability metrics for periodic reader in `go.opentelemetry.io/otel/sdk/metric`. (#7571) - Support `OTEL_EXPORTER_OTLP_LOGS_INSECURE` and `OTEL_EXPORTER_OTLP_INSECURE` environmental variables in `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp`. (#7608) - Add `Enabled` method to the `Processor` interface in `go.opentelemetry.io/otel/sdk/log`. All `Processor` implementations now include an `Enabled` method. (#7639) - The `go.opentelemetry.io/otel/semconv/v1.38.0` package. The package contains semantic conventions from the `v1.38.0` version of the OpenTelemetry Semantic Conventions. See the [migration documentation](./semconv/v1.38.0/MIGRATION.md) for information on how to upgrade from `go.opentelemetry.io/otel/semconv/v1.37.0.`(#7648) ### Changed - `Distinct` in `go.opentelemetry.io/otel/attribute` is no longer guaranteed to uniquely identify an attribute set. Collisions between `Distinct` values for different Sets are possible with extremely high cardinality (billions of series per instrument), but are highly unlikely. (#7175) - `WithInstrumentationAttributes` in `go.opentelemetry.io/otel/trace` synchronously de-duplicates the passed attributes instead of delegating it to the returned `TracerOption`. (#7266) - `WithInstrumentationAttributes` in `go.opentelemetry.io/otel/meter` synchronously de-duplicates the passed attributes instead of delegating it to the returned `MeterOption`. (#7266) - `WithInstrumentationAttributes` in `go.opentelemetry.io/otel/log` synchronously de-duplicates the passed attributes instead of delegating it to the returned `LoggerOption`. (#7266) - Rename the `OTEL_GO_X_SELF_OBSERVABILITY` environment variable to `OTEL_GO_X_OBSERVABILITY` in `go.opentelemetry.io/otel/sdk/trace`, `go.opentelemetry.io/otel/sdk/log`, and `go.opentelemetry.io/otel/exporters/stdout/stdouttrace`. (#7302) - Improve performance of histogram `Record` in `go.opentelemetry.io/otel/sdk/metric` when min and max are disabled using `NoMinMax`. (#7306) - Improve error handling for dropped data during translation by using `prometheus.NewInvalidMetric` in `go.opentelemetry.io/otel/exporters/prometheus`. ⚠️ **Breaking Change:** Previously, these cases were only logged and scrapes succeeded. Now, when translation would drop data (e.g., invalid label/value), the exporter emits a `NewInvalidMetric`, and Prometheus scrapes **fail with HTTP 500** by default. To preserve the prior behavior (scrapes succeed while errors are logged), configure your Prometheus HTTP handler with: `promhttp.HandlerOpts{ ErrorHandling: promhttp.ContinueOnError }`. (#7363) - Replace fnv hash with xxhash in `go.opentelemetry.io/otel/attribute` for better performance. (#7371) - The default `TranslationStrategy` in `go.opentelemetry.io/exporters/prometheus` is changed from `otlptranslator.NoUTF8EscapingWithSuffixes` to `otlptranslator.UnderscoreEscapingWithSuffixes`. (#7421) - Improve performance of concurrent measurements in `go.opentelemetry.io/otel/sdk/metric`. (#7427) - Include W3C TraceFlags (bits 0–7) in the OTLP `Span.Flags` field in `go.opentelemetry.io/exporters/otlp/otlptrace/otlptracehttp` and `go.opentelemetry.io/exporters/otlp/otlptrace/otlptracegrpc`. (#7438) - The `ErrorType` function in `go.opentelemetry.io/otel/semconv/v1.37.0` now handles custom error types. If an error implements an `ErrorType() string` method, the return value of that method will be used as the error type. (#7442) ### Fixed - Fix `WithInstrumentationAttributes` options in `go.opentelemetry.io/otel/trace`, `go.opentelemetry.io/otel/metric`, and `go.opentelemetry.io/otel/log` to properly merge attributes when passed multiple times instead of replacing them. Attributes with duplicate keys will use the last value passed. (#7300) - The equality of `attribute.Set` when using the `Equal` method is not affected by the user overriding the empty set pointed to by `attribute.EmptySet` in `go.opentelemetry.io/otel/attribute`. (#7357) - Return partial OTLP export errors to the caller in `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc`. (#7372) - Return partial OTLP export errors to the caller in `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp`. (#7372) - Return partial OTLP export errors to the caller in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc`. (#7372) - Return partial OTLP export errors to the caller in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#7372) - Return partial OTLP export errors to the caller in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc`. (#7372) - Return partial OTLP export errors to the caller in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`. (#7372) - Fix `AddAttributes`, `SetAttributes`, `SetBody` on `Record` in `go.opentelemetry.io/otel/sdk/log` to not mutate input. (#7403) - Do not double record measurements of `RecordSet` methods in `go.opentelemetry.io/otel/semconv/v1.37.0`. (#7655) - Do not double record measurements of `RecordSet` methods in `go.opentelemetry.io/otel/semconv/v1.36.0`. (#7656) ### Removed - Drop support for [Go 1.23]. (#7274) - Remove the `FilterProcessor` interface in `go.opentelemetry.io/otel/sdk/log`. The `Enabled` method has been added to the `Processor` interface instead. All `Processor` implementations must now implement the `Enabled` method. Custom processors that do not filter records can implement `Enabled` to return `true`. (#7639) ## [1.38.0/0.60.0/0.14.0/0.0.13] 2025-08-29 This release is the last to support [Go 1.23]. The next release will require at least [Go 1.24]. ### Added - Add native histogram exemplar support in `go.opentelemetry.io/otel/exporters/prometheus`. (#6772) - Add template attribute functions to the `go.opentelmetry.io/otel/semconv/v1.34.0` package. (#6939) - `ContainerLabel` - `DBOperationParameter` - `DBSystemParameter` - `HTTPRequestHeader` - `HTTPResponseHeader` - `K8SCronJobAnnotation` - `K8SCronJobLabel` - `K8SDaemonSetAnnotation` - `K8SDaemonSetLabel` - `K8SDeploymentAnnotation` - `K8SDeploymentLabel` - `K8SJobAnnotation` - `K8SJobLabel` - `K8SNamespaceAnnotation` - `K8SNamespaceLabel` - `K8SNodeAnnotation` - `K8SNodeLabel` - `K8SPodAnnotation` - `K8SPodLabel` - `K8SReplicaSetAnnotation` - `K8SReplicaSetLabel` - `K8SStatefulSetAnnotation` - `K8SStatefulSetLabel` - `ProcessEnvironmentVariable` - `RPCConnectRPCRequestMetadata` - `RPCConnectRPCResponseMetadata` - `RPCGRPCRequestMetadata` - `RPCGRPCResponseMetadata` - Add `ErrorType` attribute helper function to the `go.opentelmetry.io/otel/semconv/v1.34.0` package. (#6962) - Add `WithAllowKeyDuplication` in `go.opentelemetry.io/otel/sdk/log` which can be used to disable deduplication for log records. (#6968) - Add `WithCardinalityLimit` option to configure the cardinality limit in `go.opentelemetry.io/otel/sdk/metric`. (#6996, #7065, #7081, #7164, #7165, #7179) - Add `Clone` method to `Record` in `go.opentelemetry.io/otel/log` that returns a copy of the record with no shared state. (#7001) - Add experimental self-observability span and batch span processor metrics in `go.opentelemetry.io/otel/sdk/trace`. Check the `go.opentelemetry.io/otel/sdk/trace/internal/x` package documentation for more information. (#7027, #6393, #7209) - The `go.opentelemetry.io/otel/semconv/v1.36.0` package. The package contains semantic conventions from the `v1.36.0` version of the OpenTelemetry Semantic Conventions. See the [migration documentation](./semconv/v1.36.0/MIGRATION.md) for information on how to upgrade from `go.opentelemetry.io/otel/semconv/v1.34.0.`(#7032, #7041) - Add support for configuring Prometheus name translation using `WithTranslationStrategy` option in `go.opentelemetry.io/otel/exporters/prometheus`. The current default translation strategy when UTF-8 mode is enabled is `NoUTF8EscapingWithSuffixes`, but a future release will change the default strategy to `UnderscoreEscapingWithSuffixes` for compliance with the specification. (#7111) - Add experimental self-observability log metrics in `go.opentelemetry.io/otel/sdk/log`. Check the `go.opentelemetry.io/otel/sdk/log/internal/x` package documentation for more information. (#7121) - Add experimental self-observability trace exporter metrics in `go.opentelemetry.io/otel/exporters/stdout/stdouttrace`. Check the `go.opentelemetry.io/otel/exporters/stdout/stdouttrace/internal/x` package documentation for more information. (#7133) - Support testing of [Go 1.25]. (#7187) - The `go.opentelemetry.io/otel/semconv/v1.37.0` package. The package contains semantic conventions from the `v1.37.0` version of the OpenTelemetry Semantic Conventions. See the [migration documentation](./semconv/v1.37.0/MIGRATION.md) for information on how to upgrade from `go.opentelemetry.io/otel/semconv/v1.36.0.`(#7254) ### Changed - Optimize `TraceIDFromHex` and `SpanIDFromHex` in `go.opentelemetry.io/otel/sdk/trace`. (#6791) - Change `AssertEqual` in `go.opentelemetry.io/otel/log/logtest` to accept `TestingT` in order to support benchmarks and fuzz tests. (#6908) - Change `DefaultExemplarReservoirProviderSelector` in `go.opentelemetry.io/otel/sdk/metric` to use `runtime.GOMAXPROCS(0)` instead of `runtime.NumCPU()` for the `FixedSizeReservoirProvider` default size. (#7094) ### Fixed - `SetBody` method of `Record` in `go.opentelemetry.io/otel/sdk/log` now deduplicates key-value collections (`log.Value` of `log.KindMap` from `go.opentelemetry.io/otel/log`). (#7002) - Fix `go.opentelemetry.io/otel/exporters/prometheus` to not append a suffix if it's already present in metric name. (#7088) - Fix the `go.opentelemetry.io/otel/exporters/stdout/stdouttrace` self-observability component type and name. (#7195) - Fix partial export count metric in `go.opentelemetry.io/otel/exporters/stdout/stdouttrace`. (#7199) ### Deprecated - Deprecate `WithoutUnits` and `WithoutCounterSuffixes` options, preferring `WithTranslationStrategy` instead. (#7111) - Deprecate support for `OTEL_GO_X_CARDINALITY_LIMIT` environment variable in `go.opentelemetry.io/otel/sdk/metric`. Use `WithCardinalityLimit` option instead. (#7166) ## [0.59.1] 2025-07-21 ### Changed - Retract `v0.59.0` release of `go.opentelemetry.io/otel/exporters/prometheus` module which appends incorrect unit suffixes. (#7046) - Change `go.opentelemetry.io/otel/exporters/prometheus` to no longer deduplicate suffixes when UTF8 is enabled. It is recommended to disable unit and counter suffixes in the exporter, and manually add suffixes if you rely on the existing behavior. (#7044) ### Fixed - Fix `go.opentelemetry.io/otel/exporters/prometheus` to properly handle unit suffixes when the unit is in brackets. E.g. `{spans}`. (#7044) ## [1.37.0/0.59.0/0.13.0] 2025-06-25 ### Added - The `go.opentelemetry.io/otel/semconv/v1.33.0` package. The package contains semantic conventions from the `v1.33.0` version of the OpenTelemetry Semantic Conventions. See the [migration documentation](./semconv/v1.33.0/MIGRATION.md) for information on how to upgrade from `go.opentelemetry.io/otel/semconv/v1.32.0.`(#6799) - The `go.opentelemetry.io/otel/semconv/v1.34.0` package. The package contains semantic conventions from the `v1.34.0` version of the OpenTelemetry Semantic Conventions. (#6812) - Add metric's schema URL as `otel_scope_schema_url` label in `go.opentelemetry.io/otel/exporters/prometheus`. (#5947) - Add metric's scope attributes as `otel_scope_[attribute]` labels in `go.opentelemetry.io/otel/exporters/prometheus`. (#5947) - Add `EventName` to `EnabledParameters` in `go.opentelemetry.io/otel/log`. (#6825) - Add `EventName` to `EnabledParameters` in `go.opentelemetry.io/otel/sdk/log`. (#6825) - Changed handling of `go.opentelemetry.io/otel/exporters/prometheus` metric renaming to add unit suffixes when it doesn't match one of the pre-defined values in the unit suffix map. (#6839) ### Changed - The semantic conventions have been upgraded from `v1.26.0` to `v1.34.0` in `go.opentelemetry.io/otel/bridge/opentracing`. (#6827) - The semantic conventions have been upgraded from `v1.26.0` to `v1.34.0` in `go.opentelemetry.io/otel/exporters/zipkin`. (#6829) - The semantic conventions have been upgraded from `v1.26.0` to `v1.34.0` in `go.opentelemetry.io/otel/metric`. (#6832) - The semantic conventions have been upgraded from `v1.26.0` to `v1.34.0` in `go.opentelemetry.io/otel/sdk/resource`. (#6834) - The semantic conventions have been upgraded from `v1.26.0` to `v1.34.0` in `go.opentelemetry.io/otel/sdk/trace`. (#6835) - The semantic conventions have been upgraded from `v1.26.0` to `v1.34.0` in `go.opentelemetry.io/otel/trace`. (#6836) - `Record.Resource` now returns `*resource.Resource` instead of `resource.Resource` in `go.opentelemetry.io/otel/sdk/log`. (#6864) - Retry now shows error cause for context timeout in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc`, `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc`, `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc`, `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`, `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`, `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp`. (#6898) ### Fixed - Stop stripping trailing slashes from configured endpoint URL in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc`. (#6710) - Stop stripping trailing slashes from configured endpoint URL in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`. (#6710) - Stop stripping trailing slashes from configured endpoint URL in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc`. (#6710) - Stop stripping trailing slashes from configured endpoint URL in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#6710) - Validate exponential histogram scale range for Prometheus compatibility in `go.opentelemetry.io/otel/exporters/prometheus`. (#6822) - Context cancellation during metric pipeline produce does not corrupt data in `go.opentelemetry.io/otel/sdk/metric`. (#6914) ### Removed - `go.opentelemetry.io/otel/exporters/prometheus` no longer exports `otel_scope_info` metric. (#6770) ## [0.12.2] 2025-05-22 ### Fixed - Retract `v0.12.0` release of `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc` module that contains invalid dependencies. (#6804) - Retract `v0.12.0` release of `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp` module that contains invalid dependencies. (#6804) - Retract `v0.12.0` release of `go.opentelemetry.io/otel/exporters/stdout/stdoutlog` module that contains invalid dependencies. (#6804) ## [0.12.1] 2025-05-21 ### Fixes - Use the proper dependency version of `go.opentelemetry.io/otel/sdk/log/logtest` in `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc`. (#6800) - Use the proper dependency version of `go.opentelemetry.io/otel/sdk/log/logtest` in `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp`. (#6800) - Use the proper dependency version of `go.opentelemetry.io/otel/sdk/log/logtest` in `go.opentelemetry.io/otel/exporters/stdout/stdoutlog`. (#6800) ## [1.36.0/0.58.0/0.12.0] 2025-05-20 ### Added - Add exponential histogram support in `go.opentelemetry.io/otel/exporters/prometheus`. (#6421) - The `go.opentelemetry.io/otel/semconv/v1.31.0` package. The package contains semantic conventions from the `v1.31.0` version of the OpenTelemetry Semantic Conventions. See the [migration documentation](./semconv/v1.31.0/MIGRATION.md) for information on how to upgrade from `go.opentelemetry.io/otel/semconv/v1.30.0`. (#6479) - Add `Recording`, `Scope`, and `Record` types in `go.opentelemetry.io/otel/log/logtest`. (#6507) - Add `WithHTTPClient` option to configure the `http.Client` used by `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`. (#6751) - Add `WithHTTPClient` option to configure the `http.Client` used by `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#6752) - Add `WithHTTPClient` option to configure the `http.Client` used by `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp`. (#6688) - Add `ValuesGetter` in `go.opentelemetry.io/otel/propagation`, a `TextMapCarrier` that supports retrieving multiple values for a single key. (#5973) - Add `Values` method to `HeaderCarrier` to implement the new `ValuesGetter` interface in `go.opentelemetry.io/otel/propagation`. (#5973) - Update `Baggage` in `go.opentelemetry.io/otel/propagation` to retrieve multiple values for a key when the carrier implements `ValuesGetter`. (#5973) - Add `AssertEqual` function in `go.opentelemetry.io/otel/log/logtest`. (#6662) - The `go.opentelemetry.io/otel/semconv/v1.32.0` package. The package contains semantic conventions from the `v1.32.0` version of the OpenTelemetry Semantic Conventions. See the [migration documentation](./semconv/v1.32.0/MIGRATION.md) for information on how to upgrade from `go.opentelemetry.io/otel/semconv/v1.31.0`(#6782) - Add `Transform` option in `go.opentelemetry.io/otel/log/logtest`. (#6794) - Add `Desc` option in `go.opentelemetry.io/otel/log/logtest`. (#6796) ### Removed - Drop support for [Go 1.22]. (#6381, #6418) - Remove `Resource` field from `EnabledParameters` in `go.opentelemetry.io/otel/sdk/log`. (#6494) - Remove `RecordFactory` type from `go.opentelemetry.io/otel/log/logtest`. (#6492) - Remove `ScopeRecords`, `EmittedRecord`, and `RecordFactory` types from `go.opentelemetry.io/otel/log/logtest`. (#6507) - Remove `AssertRecordEqual` function in `go.opentelemetry.io/otel/log/logtest`, use `AssertEqual` instead. (#6662) ### Changed - ⚠️ Update `github.com/prometheus/client_golang` to `v1.21.1`, which changes the `NameValidationScheme` to `UTF8Validation`. This allows metrics names to keep original delimiters (e.g. `.`), rather than replacing with underscores. This can be reverted by setting `github.com/prometheus/common/model.NameValidationScheme` to `LegacyValidation` in `github.com/prometheus/common/model`. (#6433) - Initialize map with `len(keys)` in `NewAllowKeysFilter` and `NewDenyKeysFilter` to avoid unnecessary allocations in `go.opentelemetry.io/otel/attribute`. (#6455) - `go.opentelemetry.io/otel/log/logtest` is now a separate Go module. (#6465) - `go.opentelemetry.io/otel/sdk/log/logtest` is now a separate Go module. (#6466) - `Recorder` in `go.opentelemetry.io/otel/log/logtest` no longer separately stores records emitted by loggers with the same instrumentation scope. (#6507) - Improve performance of `BatchProcessor` in `go.opentelemetry.io/otel/sdk/log` by not exporting when exporter cannot accept more. (#6569, #6641) ### Deprecated - Deprecate support for `model.LegacyValidation` for `go.opentelemetry.io/otel/exporters/prometheus`. (#6449) ### Fixes - Stop percent encoding header environment variables in `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc` and `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp`. (#6392) - Ensure the `noopSpan.tracerProvider` method is not inlined in `go.opentelemetry.io/otel/trace` so the `go.opentelemetry.io/auto` instrumentation can instrument non-recording spans. (#6456) - Use a `sync.Pool` instead of allocating `metricdata.ResourceMetrics` in `go.opentelemetry.io/otel/exporters/prometheus`. (#6472) ## [1.35.0/0.57.0/0.11.0] 2025-03-05 This release is the last to support [Go 1.22]. The next release will require at least [Go 1.23]. ### Added - Add `ValueFromAttribute` and `KeyValueFromAttribute` in `go.opentelemetry.io/otel/log`. (#6180) - Add `EventName` and `SetEventName` to `Record` in `go.opentelemetry.io/otel/log`. (#6187) - Add `EventName` to `RecordFactory` in `go.opentelemetry.io/otel/log/logtest`. (#6187) - `AssertRecordEqual` in `go.opentelemetry.io/otel/log/logtest` checks `Record.EventName`. (#6187) - Add `EventName` and `SetEventName` to `Record` in `go.opentelemetry.io/otel/sdk/log`. (#6193) - Add `EventName` to `RecordFactory` in `go.opentelemetry.io/otel/sdk/log/logtest`. (#6193) - Emit `Record.EventName` field in `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc`. (#6211) - Emit `Record.EventName` field in `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp`. (#6211) - Emit `Record.EventName` field in `go.opentelemetry.io/otel/exporters/stdout/stdoutlog` (#6210) - The `go.opentelemetry.io/otel/semconv/v1.28.0` package. The package contains semantic conventions from the `v1.28.0` version of the OpenTelemetry Semantic Conventions. See the [migration documentation](./semconv/v1.28.0/MIGRATION.md) for information on how to upgrade from `go.opentelemetry.io/otel/semconv/v1.27.0`(#6236) - The `go.opentelemetry.io/otel/semconv/v1.30.0` package. The package contains semantic conventions from the `v1.30.0` version of the OpenTelemetry Semantic Conventions. See the [migration documentation](./semconv/v1.30.0/MIGRATION.md) for information on how to upgrade from `go.opentelemetry.io/otel/semconv/v1.28.0`(#6240) - Document the pitfalls of using `Resource` as a comparable type. `Resource.Equal` and `Resource.Equivalent` should be used instead. (#6272) - Support [Go 1.24]. (#6304) - Add `FilterProcessor` and `EnabledParameters` in `go.opentelemetry.io/otel/sdk/log`. It replaces `go.opentelemetry.io/otel/sdk/log/internal/x.FilterProcessor`. Compared to previous version it additionally gives the possibility to filter by resource and instrumentation scope. (#6317) ### Changed - Update `github.com/prometheus/common` to `v0.62.0`, which changes the `NameValidationScheme` to `NoEscaping`. This allows metrics names to keep original delimiters (e.g. `.`), rather than replacing with underscores. This is controlled by the `Content-Type` header, or can be reverted by setting `NameValidationScheme` to `LegacyValidation` in `github.com/prometheus/common/model`. (#6198) ### Fixes - Eliminate goroutine leak for the processor returned by `NewSimpleSpanProcessor` in `go.opentelemetry.io/otel/sdk/trace` when `Shutdown` is called and the passed `ctx` is canceled and `SpanExporter.Shutdown` has not returned. (#6368) - Eliminate goroutine leak for the processor returned by `NewBatchSpanProcessor` in `go.opentelemetry.io/otel/sdk/trace` when `ForceFlush` is called and the passed `ctx` is canceled and `SpanExporter.Export` has not returned. (#6369) ## [1.34.0/0.56.0/0.10.0] 2025-01-17 ### Changed - Remove the notices from `Logger` to make the whole Logs API user-facing in `go.opentelemetry.io/otel/log`. (#6167) ### Fixed - Relax minimum Go version to 1.22.0 in various modules. (#6073) - The `Type` name logged for the `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc` client is corrected from `otlphttpgrpc` to `otlptracegrpc`. (#6143) - The `Type` name logged for the `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlphttpgrpc` client is corrected from `otlphttphttp` to `otlptracehttp`. (#6143) ## [1.33.0/0.55.0/0.9.0/0.0.12] 2024-12-12 ### Added - Add `Reset` method to `SpanRecorder` in `go.opentelemetry.io/otel/sdk/trace/tracetest`. (#5994) - Add `EnabledInstrument` interface in `go.opentelemetry.io/otel/sdk/metric/internal/x`. This is an experimental interface that is implemented by synchronous instruments provided by `go.opentelemetry.io/otel/sdk/metric`. Users can use it to avoid performing computationally expensive operations when recording measurements. It does not fall within the scope of the OpenTelemetry Go versioning and stability [policy](./VERSIONING.md) and it may be changed in backwards incompatible ways or removed in feature releases. (#6016) ### Changed - The default global API now supports full auto-instrumentation from the `go.opentelemetry.io/auto` package. See that package for more information. (#5920) - Propagate non-retryable error messages to client in `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp`. (#5929) - Propagate non-retryable error messages to client in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`. (#5929) - Propagate non-retryable error messages to client in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#5929) - Performance improvements for attribute value `AsStringSlice`, `AsFloat64Slice`, `AsInt64Slice`, `AsBoolSlice`. (#6011) - Change `EnabledParameters` to have a `Severity` field instead of a getter and setter in `go.opentelemetry.io/otel/log`. (#6009) ### Fixed - Fix inconsistent request body closing in `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp`. (#5954) - Fix inconsistent request body closing in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`. (#5954) - Fix inconsistent request body closing in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#5954) - Fix invalid exemplar keys in `go.opentelemetry.io/otel/exporters/prometheus`. (#5995) - Fix attribute value truncation in `go.opentelemetry.io/otel/sdk/trace`. (#5997) - Fix attribute value truncation in `go.opentelemetry.io/otel/sdk/log`. (#6032) ## [1.32.0/0.54.0/0.8.0/0.0.11] 2024-11-08 ### Added - Add `go.opentelemetry.io/otel/sdk/metric/exemplar.AlwaysOffFilter`, which can be used to disable exemplar recording. (#5850) - Add `go.opentelemetry.io/otel/sdk/metric.WithExemplarFilter`, which can be used to configure the exemplar filter used by the metrics SDK. (#5850) - Add `ExemplarReservoirProviderSelector` and `DefaultExemplarReservoirProviderSelector` to `go.opentelemetry.io/otel/sdk/metric`, which defines the exemplar reservoir to use based on the aggregation of the metric. (#5861) - Add `ExemplarReservoirProviderSelector` to `go.opentelemetry.io/otel/sdk/metric.Stream` to allow using views to configure the exemplar reservoir to use for a metric. (#5861) - Add `ReservoirProvider`, `HistogramReservoirProvider` and `FixedSizeReservoirProvider` to `go.opentelemetry.io/otel/sdk/metric/exemplar` to make it convenient to use providers of Reservoirs. (#5861) - The `go.opentelemetry.io/otel/semconv/v1.27.0` package. The package contains semantic conventions from the `v1.27.0` version of the OpenTelemetry Semantic Conventions. (#5894) - Add `Attributes attribute.Set` field to `Scope` in `go.opentelemetry.io/otel/sdk/instrumentation`. (#5903) - Add `Attributes attribute.Set` field to `ScopeRecords` in `go.opentelemetry.io/otel/log/logtest`. (#5927) - `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc` adds instrumentation scope attributes. (#5934) - `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp` adds instrumentation scope attributes. (#5934) - `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` adds instrumentation scope attributes. (#5935) - `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` adds instrumentation scope attributes. (#5935) - `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc` adds instrumentation scope attributes. (#5933) - `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp` adds instrumentation scope attributes. (#5933) - `go.opentelemetry.io/otel/exporters/prometheus` adds instrumentation scope attributes in `otel_scope_info` metric as labels. (#5932) ### Changed - Support scope attributes and make them as identifying for `Tracer` in `go.opentelemetry.io/otel` and `go.opentelemetry.io/otel/sdk/trace`. (#5924) - Support scope attributes and make them as identifying for `Meter` in `go.opentelemetry.io/otel` and `go.opentelemetry.io/otel/sdk/metric`. (#5926) - Support scope attributes and make them as identifying for `Logger` in `go.opentelemetry.io/otel` and `go.opentelemetry.io/otel/sdk/log`. (#5925) - Make schema URL and scope attributes as identifying for `Tracer` in `go.opentelemetry.io/otel/bridge/opentracing`. (#5931) - Clear unneeded slice elements to allow GC to collect the objects in `go.opentelemetry.io/otel/sdk/metric` and `go.opentelemetry.io/otel/sdk/trace`. (#5804) ### Fixed - Global MeterProvider registration unwraps global instrument Observers, the undocumented Unwrap() methods are now private. (#5881) - `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` now keeps the metadata already present in the context when `WithHeaders` is used. (#5892) - `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc` now keeps the metadata already present in the context when `WithHeaders` is used. (#5911) - `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc` now keeps the metadata already present in the context when `WithHeaders` is used. (#5915) - Fix `go.opentelemetry.io/otel/exporters/prometheus` trying to add exemplars to Gauge metrics, which is unsupported. (#5912) - Fix `WithEndpointURL` to always use a secure connection when an https URL is passed in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc`. (#5944) - Fix `WithEndpointURL` to always use a secure connection when an https URL is passed in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#5944) - Fix `WithEndpointURL` to always use a secure connection when an https URL is passed in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc`. (#5944) - Fix `WithEndpointURL` to always use a secure connection when an https URL is passed in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`. (#5944) - Fix incorrect metrics generated from callbacks when multiple readers are used in `go.opentelemetry.io/otel/sdk/metric`. (#5900) ### Removed - Remove all examples under `go.opentelemetry.io/otel/example` as they are moved to [Contrib repository](https://github.com/open-telemetry/opentelemetry-go-contrib/tree/main/examples). (#5930) ## [1.31.0/0.53.0/0.7.0/0.0.10] 2024-10-11 ### Added - Add `go.opentelemetry.io/otel/sdk/metric/exemplar` package which includes `Exemplar`, `Filter`, `TraceBasedFilter`, `AlwaysOnFilter`, `HistogramReservoir`, `FixedSizeReservoir`, `Reservoir`, `Value` and `ValueType` types. These will be used for configuring the exemplar reservoir for the metrics sdk. (#5747, #5862) - Add `WithExportBufferSize` option to log batch processor.(#5877) ### Changed - Enable exemplars by default in `go.opentelemetry.io/otel/sdk/metric`. Exemplars can be disabled by setting `OTEL_METRICS_EXEMPLAR_FILTER=always_off` (#5778) - `Logger.Enabled` in `go.opentelemetry.io/otel/log` now accepts a newly introduced `EnabledParameters` type instead of `Record`. (#5791) - `FilterProcessor.Enabled` in `go.opentelemetry.io/otel/sdk/log/internal/x` now accepts `EnabledParameters` instead of `Record`. (#5791) - The `Record` type in `go.opentelemetry.io/otel/log` is no longer comparable. (#5847) - Performance improvements for the trace SDK `SetAttributes` method in `Span`. (#5864) - Reduce memory allocations for the `Event` and `Link` lists in `Span`. (#5858) - Performance improvements for the trace SDK `AddEvent`, `AddLink`, `RecordError` and `End` methods in `Span`. (#5874) ### Deprecated - Deprecate all examples under `go.opentelemetry.io/otel/example` as they are moved to [Contrib repository](https://github.com/open-telemetry/opentelemetry-go-contrib/tree/main/examples). (#5854) ### Fixed - The race condition for multiple `FixedSize` exemplar reservoirs identified in #5814 is resolved. (#5819) - Fix log records duplication in case of heterogeneous resource attributes by correctly mapping each log record to it's resource and scope. (#5803) - Fix timer channel drain to avoid hanging on Go 1.23. (#5868) - Fix delegation for global meter providers, and panic when calling otel.SetMeterProvider. (#5827) - Change the `reflect.TypeOf` to use a nil pointer to not allocate on the heap unless necessary. (#5827) ## [1.30.0/0.52.0/0.6.0/0.0.9] 2024-09-09 ### Added - Support `OTEL_EXPORTER_OTLP_LOGS_INSECURE` and `OTEL_EXPORTER_OTLP_INSECURE` environments in `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc`. (#5739) - The `WithResource` option for `NewMeterProvider` now merges the provided resources with the ones from environment variables. (#5773) - The `WithResource` option for `NewLoggerProvider` now merges the provided resources with the ones from environment variables. (#5773) - Add UTF-8 support to `go.opentelemetry.io/otel/exporters/prometheus`. (#5755) ### Fixed - Fix memory leak in the global `MeterProvider` when identical instruments are repeatedly created. (#5754) - Fix panic on instruments creation when setting meter provider. (#5758) - Fix an issue where `SetMeterProvider` in `go.opentelemetry.io/otel` might miss the delegation for instruments and registries. (#5780) ### Removed - Drop support for [Go 1.21]. (#5736, #5740, #5800) ## [1.29.0/0.51.0/0.5.0] 2024-08-23 This release is the last to support [Go 1.21]. The next release will require at least [Go 1.22]. ### Added - Add MacOS ARM64 platform to the compatibility testing suite. (#5577) - Add `InstrumentationScope` field to `SpanStub` in `go.opentelemetry.io/otel/sdk/trace/tracetest`, as a replacement for the deprecated `InstrumentationLibrary`. (#5627) - Make the initial release of `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc`. This new module contains an OTLP exporter that transmits log telemetry using gRPC. This module is unstable and breaking changes may be introduced. See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. (#5629) - Add `Walk` function to `TraceState` in `go.opentelemetry.io/otel/trace` to iterate all the key-value pairs. (#5651) - Bridge the trace state in `go.opentelemetry.io/otel/bridge/opencensus`. (#5651) - Zero value of `SimpleProcessor` in `go.opentelemetry.io/otel/sdk/log` no longer panics. (#5665) - The `FilterProcessor` interface type is added in `go.opentelemetry.io/otel/sdk/log/internal/x`. This is an optional and experimental interface that log `Processor`s can implement to instruct the `Logger` if a `Record` will be processed or not. It replaces the existing `Enabled` method that is removed from the `Processor` interface itself. It does not fall within the scope of the OpenTelemetry Go versioning and stability [policy](./VERSIONING.md) and it may be changed in backwards incompatible ways or removed in feature releases. (#5692) - Support [Go 1.23]. (#5720) ### Changed - `NewMemberRaw`, `NewKeyProperty` and `NewKeyValuePropertyRaw` in `go.opentelemetry.io/otel/baggage` allow UTF-8 string in key. (#5132) - `Processor.OnEmit` in `go.opentelemetry.io/otel/sdk/log` now accepts a pointer to `Record` instead of a value so that the record modifications done in a processor are propagated to subsequent registered processors. (#5636) - `SimpleProcessor.Enabled` in `go.opentelemetry.io/otel/sdk/log` now returns `false` if the exporter is `nil`. (#5665) - Update the concurrency requirements of `Exporter` in `go.opentelemetry.io/otel/sdk/log`. (#5666) - `SimpleProcessor` in `go.opentelemetry.io/otel/sdk/log` synchronizes `OnEmit` calls. (#5666) - The `Processor` interface in `go.opentelemetry.io/otel/sdk/log` no longer includes the `Enabled` method. See the `FilterProcessor` interface type added in `go.opentelemetry.io/otel/sdk/log/internal/x` to continue providing this functionality. (#5692) - The `SimpleProcessor` type in `go.opentelemetry.io/otel/sdk/log` is no longer comparable. (#5693) - The `BatchProcessor` type in `go.opentelemetry.io/otel/sdk/log` is no longer comparable. (#5693) ### Fixed - Correct comments for the priority of the `WithEndpoint` and `WithEndpointURL` options and their corresponding environment variables in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`. (#5584) - Pass the underlying error rather than a generic retry-able failure in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`, `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp` and `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`. (#5541) - Correct the `Tracer`, `Meter`, and `Logger` names used in `go.opentelemetry.io/otel/example/dice`. (#5612) - Correct the `Tracer` names used in `go.opentelemetry.io/otel/example/namedtracer`. (#5612) - Correct the `Tracer` name used in `go.opentelemetry.io/otel/example/opencensus`. (#5612) - Correct the `Tracer` and `Meter` names used in `go.opentelemetry.io/otel/example/otel-collector`. (#5612) - Correct the `Tracer` names used in `go.opentelemetry.io/otel/example/passthrough`. (#5612) - Correct the `Meter` name used in `go.opentelemetry.io/otel/example/prometheus`. (#5612) - Correct the `Tracer` names used in `go.opentelemetry.io/otel/example/zipkin`. (#5612) - Correct comments for the priority of the `WithEndpoint` and `WithEndpointURL` options and their corresponding environment variables in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` and `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#5641) - Correct comments for the priority of the `WithEndpoint` and `WithEndpointURL` options and their corresponding environment variables in `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp`. (#5650) - Stop percent encoding header environment variables in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc`, `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`, `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` and `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` (#5705) - Remove invalid environment variable header keys in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc`, `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`, `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` and `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` (#5705) ### Removed - The `Enabled` method of the `SimpleProcessor` in `go.opentelemetry.io/otel/sdk/log` is removed. (#5692) - The `Enabled` method of the `BatchProcessor` in `go.opentelemetry.io/otel/sdk/log` is removed. (#5692) ## [1.28.0/0.50.0/0.4.0] 2024-07-02 ### Added - The `IsEmpty` method is added to the `Instrument` type in `go.opentelemetry.io/otel/sdk/metric`. This method is used to check if an `Instrument` instance is a zero-value. (#5431) - Store and provide the emitted `context.Context` in `ScopeRecords` of `go.opentelemetry.io/otel/sdk/log/logtest`. (#5468) - The `go.opentelemetry.io/otel/semconv/v1.26.0` package. The package contains semantic conventions from the `v1.26.0` version of the OpenTelemetry Semantic Conventions. (#5476) - The `AssertRecordEqual` method to `go.opentelemetry.io/otel/log/logtest` to allow comparison of two log records in tests. (#5499) - The `WithHeaders` option to `go.opentelemetry.io/otel/exporters/zipkin` to allow configuring custom http headers while exporting spans. (#5530) ### Changed - `Tracer.Start` in `go.opentelemetry.io/otel/trace/noop` no longer allocates a span for empty span context. (#5457) - Upgrade `go.opentelemetry.io/otel/semconv/v1.25.0` to `go.opentelemetry.io/otel/semconv/v1.26.0` in `go.opentelemetry.io/otel/example/otel-collector`. (#5490) - Upgrade `go.opentelemetry.io/otel/semconv/v1.25.0` to `go.opentelemetry.io/otel/semconv/v1.26.0` in `go.opentelemetry.io/otel/example/zipkin`. (#5490) - Upgrade `go.opentelemetry.io/otel/semconv/v1.25.0` to `go.opentelemetry.io/otel/semconv/v1.26.0` in `go.opentelemetry.io/otel/exporters/zipkin`. (#5490) - The exporter no longer exports the deprecated "otel.library.name" or "otel.library.version" attributes. - Upgrade `go.opentelemetry.io/otel/semconv/v1.25.0` to `go.opentelemetry.io/otel/semconv/v1.26.0` in `go.opentelemetry.io/otel/sdk/resource`. (#5490) - Upgrade `go.opentelemetry.io/otel/semconv/v1.25.0` to `go.opentelemetry.io/otel/semconv/v1.26.0` in `go.opentelemetry.io/otel/sdk/trace`. (#5490) - `SimpleProcessor.OnEmit` in `go.opentelemetry.io/otel/sdk/log` no longer allocates a slice which makes it possible to have a zero-allocation log processing using `SimpleProcessor`. (#5493) - Use non-generic functions in the `Start` method of `"go.opentelemetry.io/otel/sdk/trace".Trace` to reduce memory allocation. (#5497) - `service.instance.id` is populated for a `Resource` created with `"go.opentelemetry.io/otel/sdk/resource".Default` with a default value when `OTEL_GO_X_RESOURCE` is set. (#5520) - Improve performance of metric instruments in `go.opentelemetry.io/otel/sdk/metric` by removing unnecessary calls to `time.Now`. (#5545) ### Fixed - Log a warning to the OpenTelemetry internal logger when a `Record` in `go.opentelemetry.io/otel/sdk/log` drops an attribute due to a limit being reached. (#5376) - Identify the `Tracer` returned from the global `TracerProvider` in `go.opentelemetry.io/otel/global` with its schema URL. (#5426) - Identify the `Meter` returned from the global `MeterProvider` in `go.opentelemetry.io/otel/global` with its schema URL. (#5426) - Log a warning to the OpenTelemetry internal logger when a `Span` in `go.opentelemetry.io/otel/sdk/trace` drops an attribute, event, or link due to a limit being reached. (#5434) - Document instrument name requirements in `go.opentelemetry.io/otel/metric`. (#5435) - Prevent random number generation data-race for experimental rand exemplars in `go.opentelemetry.io/otel/sdk/metric`. (#5456) - Fix counting number of dropped attributes of `Record` in `go.opentelemetry.io/otel/sdk/log`. (#5464) - Fix panic in baggage creation when a member contains `0x80` char in key or value. (#5494) - Correct comments for the priority of the `WithEndpoint` and `WithEndpointURL` options and their corresponding environment variables in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc`. (#5508) - Retry trace and span ID generation if it generated an invalid one in `go.opentelemetry.io/otel/sdk/trace`. (#5514) - Fix stale timestamps reported by the last-value aggregation. (#5517) - Indicate the `Exporter` in `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp` must be created by the `New` method. (#5521) - Improved performance in all `{Bool,Int64,Float64,String}SliceValue` functions of `go.opentelemetry.io/attributes` by reducing the number of allocations. (#5549) - Replace invalid percent-encoded octet sequences with replacement char in `go.opentelemetry.io/otel/baggage`. (#5528) ## [1.27.0/0.49.0/0.3.0] 2024-05-21 ### Added - Add example for `go.opentelemetry.io/otel/exporters/stdout/stdoutlog`. (#5242) - Add `RecordFactory` in `go.opentelemetry.io/otel/sdk/log/logtest` to facilitate testing exporter and processor implementations. (#5258) - Add `RecordFactory` in `go.opentelemetry.io/otel/log/logtest` to facilitate testing bridge implementations. (#5263) - The count of dropped records from the `BatchProcessor` in `go.opentelemetry.io/otel/sdk/log` is logged. (#5276) - Add metrics in the `otel-collector` example. (#5283) - Add the synchronous gauge instrument to `go.opentelemetry.io/otel/metric`. (#5304) - An `int64` or `float64` synchronous gauge instrument can now be created from a `Meter`. - All implementations of the API (`go.opentelemetry.io/otel/metric/noop`, `go.opentelemetry.io/otel/sdk/metric`) are updated to support this instrument. - Add logs to `go.opentelemetry.io/otel/example/dice`. (#5349) ### Changed - The `Shutdown` method of `Exporter` in `go.opentelemetry.io/otel/exporters/stdout/stdouttrace` ignores the context cancellation and always returns `nil`. (#5189) - The `ForceFlush` and `Shutdown` methods of the exporter returned by `New` in `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric` ignore the context cancellation and always return `nil`. (#5189) - Apply the value length limits to `Record` attributes in `go.opentelemetry.io/otel/sdk/log`. (#5230) - De-duplicate map attributes added to a `Record` in `go.opentelemetry.io/otel/sdk/log`. (#5230) - `go.opentelemetry.io/otel/exporters/stdout/stdoutlog` won't print timestamps when `WithoutTimestamps` option is set. (#5241) - The `go.opentelemetry.io/otel/exporters/stdout/stdoutlog` exporter won't print `AttributeValueLengthLimit` and `AttributeCountLimit` fields now, instead it prints the `DroppedAttributes` field. (#5272) - Improved performance in the `Stringer` implementation of `go.opentelemetry.io/otel/baggage.Member` by reducing the number of allocations. (#5286) - Set the start time for last-value aggregates in `go.opentelemetry.io/otel/sdk/metric`. (#5305) - The `Span` in `go.opentelemetry.io/otel/sdk/trace` will record links without span context if either non-empty `TraceState` or attributes are provided. (#5315) - Upgrade all dependencies of `go.opentelemetry.io/otel/semconv/v1.24.0` to `go.opentelemetry.io/otel/semconv/v1.25.0`. (#5374) ### Fixed - Comparison of unordered maps for `go.opentelemetry.io/otel/log.KeyValue` and `go.opentelemetry.io/otel/log.Value`. (#5306) - Fix the empty output of `go.opentelemetry.io/otel/log.Value` in `go.opentelemetry.io/otel/exporters/stdout/stdoutlog`. (#5311) - Split the behavior of `Recorder` in `go.opentelemetry.io/otel/log/logtest` so it behaves as a `LoggerProvider` only. (#5365) - Fix wrong package name of the error message when parsing endpoint URL in `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp`. (#5371) - Identify the `Logger` returned from the global `LoggerProvider` in `go.opentelemetry.io/otel/log/global` with its schema URL. (#5375) ## [1.26.0/0.48.0/0.2.0-alpha] 2024-04-24 ### Added - Add `Recorder` in `go.opentelemetry.io/otel/log/logtest` to facilitate testing the log bridge implementations. (#5134) - Add span flags to OTLP spans and links exported by `go.opentelemetry.io/otel/exporters/otlp/otlptrace`. (#5194) - Make the initial alpha release of `go.opentelemetry.io/otel/sdk/log`. This new module contains the Go implementation of the OpenTelemetry Logs SDK. This module is unstable and breaking changes may be introduced. See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. (#5240) - Make the initial alpha release of `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp`. This new module contains an OTLP exporter that transmits log telemetry using HTTP. This module is unstable and breaking changes may be introduced. See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. (#5240) - Make the initial alpha release of `go.opentelemetry.io/otel/exporters/stdout/stdoutlog`. This new module contains an exporter prints log records to STDOUT. This module is unstable and breaking changes may be introduced. See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. (#5240) - The `go.opentelemetry.io/otel/semconv/v1.25.0` package. The package contains semantic conventions from the `v1.25.0` version of the OpenTelemetry Semantic Conventions. (#5254) ### Changed - Update `go.opentelemetry.io/proto/otlp` from v1.1.0 to v1.2.0. (#5177) - Improve performance of baggage member character validation in `go.opentelemetry.io/otel/baggage`. (#5214) - The `otel-collector` example now uses docker compose to bring up services instead of kubernetes. (#5244) ### Fixed - Slice attribute values in `go.opentelemetry.io/otel/attribute` are now emitted as their JSON representation. (#5159) ## [1.25.0/0.47.0/0.0.8/0.1.0-alpha] 2024-04-05 ### Added - Add `WithProxy` option in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#4906) - Add `WithProxy` option in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlptracehttp`. (#4906) - Add `AddLink` method to the `Span` interface in `go.opentelemetry.io/otel/trace`. (#5032) - The `Enabled` method is added to the `Logger` interface in `go.opentelemetry.io/otel/log`. This method is used to notify users if a log record will be emitted or not. (#5071) - Add `SeverityUndefined` `const` to `go.opentelemetry.io/otel/log`. This value represents an unset severity level. (#5072) - Add `Empty` function in `go.opentelemetry.io/otel/log` to return a `KeyValue` for an empty value. (#5076) - Add `go.opentelemetry.io/otel/log/global` to manage the global `LoggerProvider`. This package is provided with the anticipation that all functionality will be migrate to `go.opentelemetry.io/otel` when `go.opentelemetry.io/otel/log` stabilizes. At which point, users will be required to migrage their code, and this package will be deprecated then removed. (#5085) - Add support for `Summary` metrics in the `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` and `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` exporters. (#5100) - Add `otel.scope.name` and `otel.scope.version` tags to spans exported by `go.opentelemetry.io/otel/exporters/zipkin`. (#5108) - Add support for `AddLink` to `go.opentelemetry.io/otel/bridge/opencensus`. (#5116) - Add `String` method to `Value` and `KeyValue` in `go.opentelemetry.io/otel/log`. (#5117) - Add Exemplar support to `go.opentelemetry.io/otel/exporters/prometheus`. (#5111) - Add metric semantic conventions to `go.opentelemetry.io/otel/semconv/v1.24.0`. Future `semconv` packages will include metric semantic conventions as well. (#4528) ### Changed - `SpanFromContext` and `SpanContextFromContext` in `go.opentelemetry.io/otel/trace` no longer make a heap allocation when the passed context has no span. (#5049) - `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc` and `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` now create a gRPC client in idle mode and with "dns" as the default resolver using [`grpc.NewClient`](https://pkg.go.dev/google.golang.org/grpc#NewClient). (#5151) Because of that `WithDialOption` ignores [`grpc.WithBlock`](https://pkg.go.dev/google.golang.org/grpc#WithBlock), [`grpc.WithTimeout`](https://pkg.go.dev/google.golang.org/grpc#WithTimeout), and [`grpc.WithReturnConnectionError`](https://pkg.go.dev/google.golang.org/grpc#WithReturnConnectionError). Notice that [`grpc.DialContext`](https://pkg.go.dev/google.golang.org/grpc#DialContext) which was used before is now deprecated. ### Fixed - Clarify the documentation about equivalence guarantees for the `Set` and `Distinct` types in `go.opentelemetry.io/otel/attribute`. (#5027) - Prevent default `ErrorHandler` self-delegation. (#5137) - Update all dependencies to address [GO-2024-2687]. (#5139) ### Removed - Drop support for [Go 1.20]. (#4967) ### Deprecated - Deprecate `go.opentelemetry.io/otel/attribute.Sortable` type. (#4734) - Deprecate `go.opentelemetry.io/otel/attribute.NewSetWithSortable` function. (#4734) - Deprecate `go.opentelemetry.io/otel/attribute.NewSetWithSortableFiltered` function. (#4734) ## [1.24.0/0.46.0/0.0.1-alpha] 2024-02-23 This release is the last to support [Go 1.20]. The next release will require at least [Go 1.21]. ### Added - Support [Go 1.22]. (#4890) - Add exemplar support to `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc`. (#4900) - Add exemplar support to `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#4900) - The `go.opentelemetry.io/otel/log` module is added. This module includes OpenTelemetry Go's implementation of the Logs Bridge API. This module is in an alpha state, it is subject to breaking changes. See our [versioning policy](./VERSIONING.md) for more info. (#4961) - Add ARM64 platform to the compatibility testing suite. (#4994) ### Fixed - Fix registration of multiple callbacks when using the global meter provider from `go.opentelemetry.io/otel`. (#4945) - Fix negative buckets in output of exponential histograms. (#4956) ## [1.23.1] 2024-02-07 ### Fixed - Register all callbacks passed during observable instrument creation instead of just the last one multiple times in `go.opentelemetry.io/otel/sdk/metric`. (#4888) ## [1.23.0] 2024-02-06 This release contains the first stable, `v1`, release of the following modules: - `go.opentelemetry.io/otel/bridge/opencensus` - `go.opentelemetry.io/otel/bridge/opencensus/test` - `go.opentelemetry.io/otel/example/opencensus` - `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` - `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` - `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric` See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. ### Added - Add `WithEndpointURL` option to the `exporters/otlp/otlpmetric/otlpmetricgrpc`, `exporters/otlp/otlpmetric/otlpmetrichttp`, `exporters/otlp/otlptrace/otlptracegrpc` and `exporters/otlp/otlptrace/otlptracehttp` packages. (#4808) - Experimental exemplar exporting is added to the metric SDK. See [metric documentation](./sdk/metric/internal/x/README.md#exemplars) for more information about this feature and how to enable it. (#4871) - `ErrSchemaURLConflict` is added to `go.opentelemetry.io/otel/sdk/resource`. This error is returned when a merge of two `Resource`s with different (non-empty) schema URL is attempted. (#4876) ### Changed - The `Merge` and `New` functions in `go.opentelemetry.io/otel/sdk/resource` now returns a partial result if there is a schema URL merge conflict. Instead of returning `nil` when two `Resource`s with different (non-empty) schema URLs are merged the merged `Resource`, along with the new `ErrSchemaURLConflict` error, is returned. It is up to the user to decide if they want to use the returned `Resource` or not. It may have desired attributes overwritten or include stale semantic conventions. (#4876) ### Fixed - Fix `ContainerID` resource detection on systemd when cgroup path has a colon. (#4449) - Fix `go.opentelemetry.io/otel/sdk/metric` to cache instruments to avoid leaking memory when the same instrument is created multiple times. (#4820) - Fix missing `Mix` and `Max` values for `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric` by introducing `MarshalText` and `MarshalJSON` for the `Extrema` type in `go.opentelemetry.io/sdk/metric/metricdata`. (#4827) ## [1.23.0-rc.1] 2024-01-18 This is a release candidate for the v1.23.0 release. That release is expected to include the `v1` release of the following modules: - `go.opentelemetry.io/otel/bridge/opencensus` - `go.opentelemetry.io/otel/bridge/opencensus/test` - `go.opentelemetry.io/otel/example/opencensus` - `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` - `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` - `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric` See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. ## [1.22.0/0.45.0] 2024-01-17 ### Added - The `go.opentelemetry.io/otel/semconv/v1.22.0` package. The package contains semantic conventions from the `v1.22.0` version of the OpenTelemetry Semantic Conventions. (#4735) - The `go.opentelemetry.io/otel/semconv/v1.23.0` package. The package contains semantic conventions from the `v1.23.0` version of the OpenTelemetry Semantic Conventions. (#4746) - The `go.opentelemetry.io/otel/semconv/v1.23.1` package. The package contains semantic conventions from the `v1.23.1` version of the OpenTelemetry Semantic Conventions. (#4749) - The `go.opentelemetry.io/otel/semconv/v1.24.0` package. The package contains semantic conventions from the `v1.24.0` version of the OpenTelemetry Semantic Conventions. (#4770) - Add `WithResourceAsConstantLabels` option to apply resource attributes for every metric emitted by the Prometheus exporter. (#4733) - Experimental cardinality limiting is added to the metric SDK. See [metric documentation](./sdk/metric/internal/x/README.md#cardinality-limit) for more information about this feature and how to enable it. (#4457) - Add `NewMemberRaw` and `NewKeyValuePropertyRaw` in `go.opentelemetry.io/otel/baggage`. (#4804) ### Changed - Upgrade all use of `go.opentelemetry.io/otel/semconv` to use `v1.24.0`. (#4754) - Update transformations in `go.opentelemetry.io/otel/exporters/zipkin` to follow `v1.24.0` version of the OpenTelemetry specification. (#4754) - Record synchronous measurements when the passed context is canceled instead of dropping in `go.opentelemetry.io/otel/sdk/metric`. If you do not want to make a measurement when the context is cancelled, you need to handle it yourself (e.g `if ctx.Err() != nil`). (#4671) - Improve `go.opentelemetry.io/otel/trace.TraceState`'s performance. (#4722) - Improve `go.opentelemetry.io/otel/propagation.TraceContext`'s performance. (#4721) - Improve `go.opentelemetry.io/otel/baggage` performance. (#4743) - Improve performance of the `(*Set).Filter` method in `go.opentelemetry.io/otel/attribute` when the passed filter does not filter out any attributes from the set. (#4774) - `Member.String` in `go.opentelemetry.io/otel/baggage` percent-encodes only when necessary. (#4775) - Improve `go.opentelemetry.io/otel/trace.Span`'s performance when adding multiple attributes. (#4818) - `Property.Value` in `go.opentelemetry.io/otel/baggage` now returns a raw string instead of a percent-encoded value. (#4804) ### Fixed - Fix `Parse` in `go.opentelemetry.io/otel/baggage` to validate member value before percent-decoding. (#4755) - Fix whitespace encoding of `Member.String` in `go.opentelemetry.io/otel/baggage`. (#4756) - Fix observable not registered error when the asynchronous instrument has a drop aggregation in `go.opentelemetry.io/otel/sdk/metric`. (#4772) - Fix baggage item key so that it is not canonicalized in `go.opentelemetry.io/otel/bridge/opentracing`. (#4776) - Fix `go.opentelemetry.io/otel/bridge/opentracing` to properly handle baggage values that requires escaping during propagation. (#4804) - Fix a bug where using multiple readers resulted in incorrect asynchronous counter values in `go.opentelemetry.io/otel/sdk/metric`. (#4742) ## [1.21.0/0.44.0] 2023-11-16 ### Removed - Remove the deprecated `go.opentelemetry.io/otel/bridge/opencensus.NewTracer`. (#4706) - Remove the deprecated `go.opentelemetry.io/otel/exporters/otlp/otlpmetric` module. (#4707) - Remove the deprecated `go.opentelemetry.io/otel/example/view` module. (#4708) - Remove the deprecated `go.opentelemetry.io/otel/example/fib` module. (#4723) ### Fixed - Do not parse non-protobuf responses in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#4719) - Do not parse non-protobuf responses in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`. (#4719) ## [1.20.0/0.43.0] 2023-11-10 This release brings a breaking change for custom trace API implementations. Some interfaces (`TracerProvider`, `Tracer`, `Span`) now embed the `go.opentelemetry.io/otel/trace/embedded` types. Implementers need to update their implementations based on what they want the default behavior to be. See the "API Implementations" section of the [trace API] package documentation for more information about how to accomplish this. ### Added - Add `go.opentelemetry.io/otel/bridge/opencensus.InstallTraceBridge`, which installs the OpenCensus trace bridge, and replaces `opencensus.NewTracer`. (#4567) - Add scope version to trace and metric bridges in `go.opentelemetry.io/otel/bridge/opencensus`. (#4584) - Add the `go.opentelemetry.io/otel/trace/embedded` package to be embedded in the exported trace API interfaces. (#4620) - Add the `go.opentelemetry.io/otel/trace/noop` package as a default no-op implementation of the trace API. (#4620) - Add context propagation in `go.opentelemetry.io/otel/example/dice`. (#4644) - Add view configuration to `go.opentelemetry.io/otel/example/prometheus`. (#4649) - Add `go.opentelemetry.io/otel/metric.WithExplicitBucketBoundaries`, which allows defining default explicit bucket boundaries when creating histogram instruments. (#4603) - Add `Version` function in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc`. (#4660) - Add `Version` function in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#4660) - Add Summary, SummaryDataPoint, and QuantileValue to `go.opentelemetry.io/sdk/metric/metricdata`. (#4622) - `go.opentelemetry.io/otel/bridge/opencensus.NewMetricProducer` now supports exemplars from OpenCensus. (#4585) - Add support for `WithExplicitBucketBoundaries` in `go.opentelemetry.io/otel/sdk/metric`. (#4605) - Add support for Summary metrics in `go.opentelemetry.io/otel/bridge/opencensus`. (#4668) ### Deprecated - Deprecate `go.opentelemetry.io/otel/bridge/opencensus.NewTracer` in favor of `opencensus.InstallTraceBridge`. (#4567) - Deprecate `go.opentelemetry.io/otel/example/fib` package is in favor of `go.opentelemetry.io/otel/example/dice`. (#4618) - Deprecate `go.opentelemetry.io/otel/trace.NewNoopTracerProvider`. Use the added `NewTracerProvider` function in `go.opentelemetry.io/otel/trace/noop` instead. (#4620) - Deprecate `go.opentelemetry.io/otel/example/view` package in favor of `go.opentelemetry.io/otel/example/prometheus`. (#4649) - Deprecate `go.opentelemetry.io/otel/exporters/otlp/otlpmetric`. (#4693) ### Changed - `go.opentelemetry.io/otel/bridge/opencensus.NewMetricProducer` returns a `*MetricProducer` struct instead of the metric.Producer interface. (#4583) - The `TracerProvider` in `go.opentelemetry.io/otel/trace` now embeds the `go.opentelemetry.io/otel/trace/embedded.TracerProvider` type. This extends the `TracerProvider` interface and is is a breaking change for any existing implementation. Implementers need to update their implementations based on what they want the default behavior of the interface to be. See the "API Implementations" section of the `go.opentelemetry.io/otel/trace` package documentation for more information about how to accomplish this. (#4620) - The `Tracer` in `go.opentelemetry.io/otel/trace` now embeds the `go.opentelemetry.io/otel/trace/embedded.Tracer` type. This extends the `Tracer` interface and is is a breaking change for any existing implementation. Implementers need to update their implementations based on what they want the default behavior of the interface to be. See the "API Implementations" section of the `go.opentelemetry.io/otel/trace` package documentation for more information about how to accomplish this. (#4620) - The `Span` in `go.opentelemetry.io/otel/trace` now embeds the `go.opentelemetry.io/otel/trace/embedded.Span` type. This extends the `Span` interface and is is a breaking change for any existing implementation. Implementers need to update their implementations based on what they want the default behavior of the interface to be. See the "API Implementations" section of the `go.opentelemetry.io/otel/trace` package documentation for more information about how to accomplish this. (#4620) - `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` does no longer depend on `go.opentelemetry.io/otel/exporters/otlp/otlpmetric`. (#4660) - `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` does no longer depend on `go.opentelemetry.io/otel/exporters/otlp/otlpmetric`. (#4660) - Retry for `502 Bad Gateway` and `504 Gateway Timeout` HTTP statuses in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#4670) - Retry for `502 Bad Gateway` and `504 Gateway Timeout` HTTP statuses in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`. (#4670) - Retry for `RESOURCE_EXHAUSTED` only if RetryInfo is returned in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc`. (#4669) - Retry for `RESOURCE_EXHAUSTED` only if RetryInfo is returned in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc`. (#4669) - Retry temporary HTTP request failures in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#4679) - Retry temporary HTTP request failures in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`. (#4679) ### Fixed - Fix improper parsing of characters such us `+`, `/` by `Parse` in `go.opentelemetry.io/otel/baggage` as they were rendered as a whitespace. (#4667) - Fix improper parsing of characters such us `+`, `/` passed via `OTEL_RESOURCE_ATTRIBUTES` in `go.opentelemetry.io/otel/sdk/resource` as they were rendered as a whitespace. (#4699) - Fix improper parsing of characters such us `+`, `/` passed via `OTEL_EXPORTER_OTLP_HEADERS` and `OTEL_EXPORTER_OTLP_METRICS_HEADERS` in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` as they were rendered as a whitespace. (#4699) - Fix improper parsing of characters such us `+`, `/` passed via `OTEL_EXPORTER_OTLP_HEADERS` and `OTEL_EXPORTER_OTLP_METRICS_HEADERS` in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` as they were rendered as a whitespace. (#4699) - Fix improper parsing of characters such us `+`, `/` passed via `OTEL_EXPORTER_OTLP_HEADERS` and `OTEL_EXPORTER_OTLP_TRACES_HEADERS` in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlptracegrpc` as they were rendered as a whitespace. (#4699) - Fix improper parsing of characters such us `+`, `/` passed via `OTEL_EXPORTER_OTLP_HEADERS` and `OTEL_EXPORTER_OTLP_TRACES_HEADERS` in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlptracehttp` as they were rendered as a whitespace. (#4699) - In `go.opentelemetry.op/otel/exporters/prometheus`, the exporter no longer `Collect`s metrics after `Shutdown` is invoked. (#4648) - Fix documentation for `WithCompressor` in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc`. (#4695) - Fix documentation for `WithCompressor` in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc`. (#4695) ## [1.19.0/0.42.0/0.0.7] 2023-09-28 This release contains the first stable release of the OpenTelemetry Go [metric SDK]. Our project stability guarantees now apply to the `go.opentelemetry.io/otel/sdk/metric` package. See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. ### Added - Add the "Roll the dice" getting started application example in `go.opentelemetry.io/otel/example/dice`. (#4539) - The `WithWriter` and `WithPrettyPrint` options to `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric` to set a custom `io.Writer`, and allow displaying the output in human-readable JSON. (#4507) ### Changed - Allow '/' characters in metric instrument names. (#4501) - The exporter in `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric` does not prettify its output by default anymore. (#4507) - Upgrade `gopkg.io/yaml` from `v2` to `v3` in `go.opentelemetry.io/otel/schema`. (#4535) ### Fixed - In `go.opentelemetry.op/otel/exporters/prometheus`, don't try to create the Prometheus metric on every `Collect` if we know the scope is invalid. (#4499) ### Removed - Remove `"go.opentelemetry.io/otel/bridge/opencensus".NewMetricExporter`, which is replaced by `NewMetricProducer`. (#4566) ## [1.19.0-rc.1/0.42.0-rc.1] 2023-09-14 This is a release candidate for the v1.19.0/v0.42.0 release. That release is expected to include the `v1` release of the OpenTelemetry Go metric SDK and will provide stability guarantees of that SDK. See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. ### Changed - Allow '/' characters in metric instrument names. (#4501) ### Fixed - In `go.opentelemetry.op/otel/exporters/prometheus`, don't try to create the prometheus metric on every `Collect` if we know the scope is invalid. (#4499) ## [1.18.0/0.41.0/0.0.6] 2023-09-12 This release drops the compatibility guarantee of [Go 1.19]. ### Added - Add `WithProducer` option in `go.opentelemetry.op/otel/exporters/prometheus` to restore the ability to register producers on the prometheus exporter's manual reader. (#4473) - Add `IgnoreValue` option in `go.opentelemetry.io/otel/sdk/metric/metricdata/metricdatatest` to allow ignoring values when comparing metrics. (#4447) ### Changed - Use a `TestingT` interface instead of `*testing.T` struct in `go.opentelemetry.io/otel/sdk/metric/metricdata/metricdatatest`. (#4483) ### Deprecated - The `NewMetricExporter` in `go.opentelemetry.io/otel/bridge/opencensus` was deprecated in `v0.35.0` (#3541). The deprecation notice format for the function has been corrected to trigger Go documentation and build tooling. (#4470) ### Removed - Removed the deprecated `go.opentelemetry.io/otel/exporters/jaeger` package. (#4467) - Removed the deprecated `go.opentelemetry.io/otel/example/jaeger` package. (#4467) - Removed the deprecated `go.opentelemetry.io/otel/sdk/metric/aggregation` package. (#4468) - Removed the deprecated internal packages in `go.opentelemetry.io/otel/exporters/otlp` and its sub-packages. (#4469) - Dropped guaranteed support for versions of Go less than 1.20. (#4481) ## [1.17.0/0.40.0/0.0.5] 2023-08-28 ### Added - Export the `ManualReader` struct in `go.opentelemetry.io/otel/sdk/metric`. (#4244) - Export the `PeriodicReader` struct in `go.opentelemetry.io/otel/sdk/metric`. (#4244) - Add support for exponential histogram aggregations. A histogram can be configured as an exponential histogram using a view with `"go.opentelemetry.io/otel/sdk/metric".ExponentialHistogram` as the aggregation. (#4245) - Export the `Exporter` struct in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc`. (#4272) - Export the `Exporter` struct in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#4272) - The exporters in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric` now support the `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE` environment variable. (#4287) - Add `WithoutCounterSuffixes` option in `go.opentelemetry.io/otel/exporters/prometheus` to disable addition of `_total` suffixes. (#4306) - Add info and debug logging to the metric SDK in `go.opentelemetry.io/otel/sdk/metric`. (#4315) - The `go.opentelemetry.io/otel/semconv/v1.21.0` package. The package contains semantic conventions from the `v1.21.0` version of the OpenTelemetry Semantic Conventions. (#4362) - Accept 201 to 299 HTTP status as success in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` and `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`. (#4365) - Document the `Temporality` and `Aggregation` methods of the `"go.opentelemetry.io/otel/sdk/metric".Exporter"` need to be concurrent safe. (#4381) - Expand the set of units supported by the Prometheus exporter, and don't add unit suffixes if they are already present in `go.opentelemetry.op/otel/exporters/prometheus` (#4374) - Move the `Aggregation` interface and its implementations from `go.opentelemetry.io/otel/sdk/metric/aggregation` to `go.opentelemetry.io/otel/sdk/metric`. (#4435) - The exporters in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric` now support the `OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION` environment variable. (#4437) - Add the `NewAllowKeysFilter` and `NewDenyKeysFilter` functions to `go.opentelemetry.io/otel/attribute` to allow convenient creation of allow-keys and deny-keys filters. (#4444) - Support Go 1.21. (#4463) ### Changed - Starting from `v1.21.0` of semantic conventions, `go.opentelemetry.io/otel/semconv/{version}/httpconv` and `go.opentelemetry.io/otel/semconv/{version}/netconv` packages will no longer be published. (#4145) - Log duplicate instrument conflict at a warning level instead of info in `go.opentelemetry.io/otel/sdk/metric`. (#4202) - Return an error on the creation of new instruments in `go.opentelemetry.io/otel/sdk/metric` if their name doesn't pass regexp validation. (#4210) - `NewManualReader` in `go.opentelemetry.io/otel/sdk/metric` returns `*ManualReader` instead of `Reader`. (#4244) - `NewPeriodicReader` in `go.opentelemetry.io/otel/sdk/metric` returns `*PeriodicReader` instead of `Reader`. (#4244) - Count the Collect time in the `PeriodicReader` timeout in `go.opentelemetry.io/otel/sdk/metric`. (#4221) - The function `New` in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` returns `*Exporter` instead of `"go.opentelemetry.io/otel/sdk/metric".Exporter`. (#4272) - The function `New` in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` returns `*Exporter` instead of `"go.opentelemetry.io/otel/sdk/metric".Exporter`. (#4272) - If an attribute set is omitted from an async callback, the previous value will no longer be exported in `go.opentelemetry.io/otel/sdk/metric`. (#4290) - If an attribute set is observed multiple times in an async callback in `go.opentelemetry.io/otel/sdk/metric`, the values will be summed instead of the last observation winning. (#4289) - Allow the explicit bucket histogram aggregation to be used for the up-down counter, observable counter, observable up-down counter, and observable gauge in the `go.opentelemetry.io/otel/sdk/metric` package. (#4332) - Restrict `Meter`s in `go.opentelemetry.io/otel/sdk/metric` to only register and collect instruments it created. (#4333) - `PeriodicReader.Shutdown` and `PeriodicReader.ForceFlush` in `go.opentelemetry.io/otel/sdk/metric` now apply the periodic reader's timeout to the operation if the user provided context does not contain a deadline. (#4356, #4377) - Upgrade all use of `go.opentelemetry.io/otel/semconv` to use `v1.21.0`. (#4408) - Increase instrument name maximum length from 63 to 255 characters in `go.opentelemetry.io/otel/sdk/metric`. (#4434) - Add `go.opentelemetry.op/otel/sdk/metric.WithProducer` as an `Option` for `"go.opentelemetry.io/otel/sdk/metric".NewManualReader` and `"go.opentelemetry.io/otel/sdk/metric".NewPeriodicReader`. (#4346) ### Removed - Remove `Reader.RegisterProducer` in `go.opentelemetry.io/otel/metric`. Use the added `WithProducer` option instead. (#4346) - Remove `Reader.ForceFlush` in `go.opentelemetry.io/otel/metric`. Notice that `PeriodicReader.ForceFlush` is still available. (#4375) ### Fixed - Correctly format log messages from the `go.opentelemetry.io/otel/exporters/zipkin` exporter. (#4143) - Log an error for calls to `NewView` in `go.opentelemetry.io/otel/sdk/metric` that have empty criteria. (#4307) - Fix `"go.opentelemetry.io/otel/sdk/resource".WithHostID()` to not set an empty `host.id`. (#4317) - Use the instrument identifying fields to cache aggregators and determine duplicate instrument registrations in `go.opentelemetry.io/otel/sdk/metric`. (#4337) - Detect duplicate instruments for case-insensitive names in `go.opentelemetry.io/otel/sdk/metric`. (#4338) - The `ManualReader` will not panic if `AggregationSelector` returns `nil` in `go.opentelemetry.io/otel/sdk/metric`. (#4350) - If a `Reader`'s `AggregationSelector` returns `nil` or `DefaultAggregation` the pipeline will use the default aggregation. (#4350) - Log a suggested view that fixes instrument conflicts in `go.opentelemetry.io/otel/sdk/metric`. (#4349) - Fix possible panic, deadlock and race condition in batch span processor in `go.opentelemetry.io/otel/sdk/trace`. (#4353) - Improve context cancellation handling in batch span processor's `ForceFlush` in `go.opentelemetry.io/otel/sdk/trace`. (#4369) - Decouple `go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal` from `go.opentelemetry.io/otel/exporters/otlp/internal` using gotmpl. (#4397, #3846) - Decouple `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc/internal` from `go.opentelemetry.io/otel/exporters/otlp/internal` and `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/internal` using gotmpl. (#4404, #3846) - Decouple `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp/internal` from `go.opentelemetry.io/otel/exporters/otlp/internal` and `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/internal` using gotmpl. (#4407, #3846) - Decouple `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal` from `go.opentelemetry.io/otel/exporters/otlp/internal` and `go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal` using gotmpl. (#4400, #3846) - Decouple `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal` from `go.opentelemetry.io/otel/exporters/otlp/internal` and `go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal` using gotmpl. (#4401, #3846) - Do not block the metric SDK when OTLP metric exports are blocked in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` and `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#3925, #4395) - Do not append `_total` if the counter already has that suffix for the Prometheus exproter in `go.opentelemetry.io/otel/exporter/prometheus`. (#4373) - Fix resource detection data race in `go.opentelemetry.io/otel/sdk/resource`. (#4409) - Use the first-seen instrument name during instrument name conflicts in `go.opentelemetry.io/otel/sdk/metric`. (#4428) ### Deprecated - The `go.opentelemetry.io/otel/exporters/jaeger` package is deprecated. OpenTelemetry dropped support for Jaeger exporter in July 2023. Use `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp` or `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc` instead. (#4423) - The `go.opentelemetry.io/otel/example/jaeger` package is deprecated. (#4423) - The `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/internal` package is deprecated. (#4420) - The `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/internal/oconf` package is deprecated. (#4420) - The `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/internal/otest` package is deprecated. (#4420) - The `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/internal/transform` package is deprecated. (#4420) - The `go.opentelemetry.io/otel/exporters/otlp/internal` package is deprecated. (#4421) - The `go.opentelemetry.io/otel/exporters/otlp/internal/envconfig` package is deprecated. (#4421) - The `go.opentelemetry.io/otel/exporters/otlp/internal/retry` package is deprecated. (#4421) - The `go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal` package is deprecated. (#4425) - The `go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/envconfig` package is deprecated. (#4425) - The `go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/otlpconfig` package is deprecated. (#4425) - The `go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/otlptracetest` package is deprecated. (#4425) - The `go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/retry` package is deprecated. (#4425) - The `go.opentelemetry.io/otel/sdk/metric/aggregation` package is deprecated. Use the aggregation types added to `go.opentelemetry.io/otel/sdk/metric` instead. (#4435) ## [1.16.0/0.39.0] 2023-05-18 This release contains the first stable release of the OpenTelemetry Go [metric API]. Our project stability guarantees now apply to the `go.opentelemetry.io/otel/metric` package. See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. ### Added - The `go.opentelemetry.io/otel/semconv/v1.19.0` package. The package contains semantic conventions from the `v1.19.0` version of the OpenTelemetry specification. (#3848) - The `go.opentelemetry.io/otel/semconv/v1.20.0` package. The package contains semantic conventions from the `v1.20.0` version of the OpenTelemetry specification. (#4078) - The Exponential Histogram data types in `go.opentelemetry.io/otel/sdk/metric/metricdata`. (#4165) - OTLP metrics exporter now supports the Exponential Histogram Data Type. (#4222) - Fix serialization of `time.Time` zero values in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` and `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` packages. (#4271) ### Changed - Use `strings.Cut()` instead of `string.SplitN()` for better readability and memory use. (#4049) - `MeterProvider` returns noop meters once it has been shutdown. (#4154) ### Removed - The deprecated `go.opentelemetry.io/otel/metric/instrument` package is removed. Use `go.opentelemetry.io/otel/metric` instead. (#4055) ### Fixed - Fix build for BSD based systems in `go.opentelemetry.io/otel/sdk/resource`. (#4077) ## [1.16.0-rc.1/0.39.0-rc.1] 2023-05-03 This is a release candidate for the v1.16.0/v0.39.0 release. That release is expected to include the `v1` release of the OpenTelemetry Go metric API and will provide stability guarantees of that API. See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. ### Added - Support global `MeterProvider` in `go.opentelemetry.io/otel`. (#4039) - Use `Meter` for a `metric.Meter` from the global `metric.MeterProvider`. - Use `GetMeterProivder` for a global `metric.MeterProvider`. - Use `SetMeterProivder` to set the global `metric.MeterProvider`. ### Changed - Move the `go.opentelemetry.io/otel/metric` module to the `stable-v1` module set. This stages the metric API to be released as a stable module. (#4038) ### Removed - The `go.opentelemetry.io/otel/metric/global` package is removed. Use `go.opentelemetry.io/otel` instead. (#4039) ## [1.15.1/0.38.1] 2023-05-02 ### Fixed - Remove unused imports from `sdk/resource/host_id_bsd.go` which caused build failures. (#4040, #4041) ## [1.15.0/0.38.0] 2023-04-27 ### Added - The `go.opentelemetry.io/otel/metric/embedded` package. (#3916) - The `Version` function to `go.opentelemetry.io/otel/sdk` to return the SDK version. (#3949) - Add a `WithNamespace` option to `go.opentelemetry.io/otel/exporters/prometheus` to allow users to prefix metrics with a namespace. (#3970) - The following configuration types were added to `go.opentelemetry.io/otel/metric/instrument` to be used in the configuration of measurement methods. (#3971) - The `AddConfig` used to hold configuration for addition measurements - `NewAddConfig` used to create a new `AddConfig` - `AddOption` used to configure an `AddConfig` - The `RecordConfig` used to hold configuration for recorded measurements - `NewRecordConfig` used to create a new `RecordConfig` - `RecordOption` used to configure a `RecordConfig` - The `ObserveConfig` used to hold configuration for observed measurements - `NewObserveConfig` used to create a new `ObserveConfig` - `ObserveOption` used to configure an `ObserveConfig` - `WithAttributeSet` and `WithAttributes` are added to `go.opentelemetry.io/otel/metric/instrument`. They return an option used during a measurement that defines the attribute Set associated with the measurement. (#3971) - The `Version` function to `go.opentelemetry.io/otel/exporters/otlp/otlpmetric` to return the OTLP metrics client version. (#3956) - The `Version` function to `go.opentelemetry.io/otel/exporters/otlp/otlptrace` to return the OTLP trace client version. (#3956) ### Changed - The `Extrema` in `go.opentelemetry.io/otel/sdk/metric/metricdata` is redefined with a generic argument of `[N int64 | float64]`. (#3870) - Update all exported interfaces from `go.opentelemetry.io/otel/metric` to embed their corresponding interface from `go.opentelemetry.io/otel/metric/embedded`. This adds an implementation requirement to set the interface default behavior for unimplemented methods. (#3916) - Move No-Op implementation from `go.opentelemetry.io/otel/metric` into its own package `go.opentelemetry.io/otel/metric/noop`. (#3941) - `metric.NewNoopMeterProvider` is replaced with `noop.NewMeterProvider` - Add all the methods from `"go.opentelemetry.io/otel/trace".SpanContext` to `bridgeSpanContext` by embedding `otel.SpanContext` in `bridgeSpanContext`. (#3966) - Wrap `UploadMetrics` error in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/` to improve error message when encountering generic grpc errors. (#3974) - The measurement methods for all instruments in `go.opentelemetry.io/otel/metric/instrument` accept an option instead of the variadic `"go.opentelemetry.io/otel/attribute".KeyValue`. (#3971) - The `Int64Counter.Add` method now accepts `...AddOption` - The `Float64Counter.Add` method now accepts `...AddOption` - The `Int64UpDownCounter.Add` method now accepts `...AddOption` - The `Float64UpDownCounter.Add` method now accepts `...AddOption` - The `Int64Histogram.Record` method now accepts `...RecordOption` - The `Float64Histogram.Record` method now accepts `...RecordOption` - The `Int64Observer.Observe` method now accepts `...ObserveOption` - The `Float64Observer.Observe` method now accepts `...ObserveOption` - The `Observer` methods in `go.opentelemetry.io/otel/metric` accept an option instead of the variadic `"go.opentelemetry.io/otel/attribute".KeyValue`. (#3971) - The `Observer.ObserveInt64` method now accepts `...ObserveOption` - The `Observer.ObserveFloat64` method now accepts `...ObserveOption` - Move global metric back to `go.opentelemetry.io/otel/metric/global` from `go.opentelemetry.io/otel`. (#3986) ### Fixed - `TracerProvider` allows calling `Tracer()` while it's shutting down. It used to deadlock. (#3924) - Use the SDK version for the Telemetry SDK resource detector in `go.opentelemetry.io/otel/sdk/resource`. (#3949) - Fix a data race in `SpanProcessor` returned by `NewSimpleSpanProcessor` in `go.opentelemetry.io/otel/sdk/trace`. (#3951) - Automatically figure out the default aggregation with `aggregation.Default`. (#3967) ### Deprecated - The `go.opentelemetry.io/otel/metric/instrument` package is deprecated. Use the equivalent types added to `go.opentelemetry.io/otel/metric` instead. (#4018) ## [1.15.0-rc.2/0.38.0-rc.2] 2023-03-23 This is a release candidate for the v1.15.0/v0.38.0 release. That release will include the `v1` release of the OpenTelemetry Go metric API and will provide stability guarantees of that API. See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. ### Added - The `WithHostID` option to `go.opentelemetry.io/otel/sdk/resource`. (#3812) - The `WithoutTimestamps` option to `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric` to sets all timestamps to zero. (#3828) - The new `Exemplar` type is added to `go.opentelemetry.io/otel/sdk/metric/metricdata`. Both the `DataPoint` and `HistogramDataPoint` types from that package have a new field of `Exemplars` containing the sampled exemplars for their timeseries. (#3849) - Configuration for each metric instrument in `go.opentelemetry.io/otel/sdk/metric/instrument`. (#3895) - The internal logging introduces a warning level verbosity equal to `V(1)`. (#3900) - Added a log message warning about usage of `SimpleSpanProcessor` in production environments. (#3854) ### Changed - Optimize memory allocation when creation a new `Set` using `NewSet` or `NewSetWithFiltered` in `go.opentelemetry.io/otel/attribute`. (#3832) - Optimize memory allocation when creation new metric instruments in `go.opentelemetry.io/otel/sdk/metric`. (#3832) - Avoid creating new objects on all calls to `WithDeferredSetup` and `SkipContextSetup` in OpenTracing bridge. (#3833) - The `New` and `Detect` functions from `go.opentelemetry.io/otel/sdk/resource` return errors that wrap underlying errors instead of just containing the underlying error strings. (#3844) - Both the `Histogram` and `HistogramDataPoint` are redefined with a generic argument of `[N int64 | float64]` in `go.opentelemetry.io/otel/sdk/metric/metricdata`. (#3849) - The metric `Export` interface from `go.opentelemetry.io/otel/sdk/metric` accepts a `*ResourceMetrics` instead of `ResourceMetrics`. (#3853) - Rename `Asynchronous` to `Observable` in `go.opentelemetry.io/otel/metric/instrument`. (#3892) - Rename `Int64ObserverOption` to `Int64ObservableOption` in `go.opentelemetry.io/otel/metric/instrument`. (#3895) - Rename `Float64ObserverOption` to `Float64ObservableOption` in `go.opentelemetry.io/otel/metric/instrument`. (#3895) - The internal logging changes the verbosity level of info to `V(4)`, the verbosity level of debug to `V(8)`. (#3900) ### Fixed - `TracerProvider` consistently doesn't allow to register a `SpanProcessor` after shutdown. (#3845) ### Removed - The deprecated `go.opentelemetry.io/otel/metric/global` package is removed. (#3829) - The unneeded `Synchronous` interface in `go.opentelemetry.io/otel/metric/instrument` was removed. (#3892) - The `Float64ObserverConfig` and `NewFloat64ObserverConfig` in `go.opentelemetry.io/otel/sdk/metric/instrument`. Use the added `float64` instrument configuration instead. (#3895) - The `Int64ObserverConfig` and `NewInt64ObserverConfig` in `go.opentelemetry.io/otel/sdk/metric/instrument`. Use the added `int64` instrument configuration instead. (#3895) - The `NewNoopMeter` function in `go.opentelemetry.io/otel/metric`, use `NewMeterProvider().Meter("")` instead. (#3893) ## [1.15.0-rc.1/0.38.0-rc.1] 2023-03-01 This is a release candidate for the v1.15.0/v0.38.0 release. That release will include the `v1` release of the OpenTelemetry Go metric API and will provide stability guarantees of that API. See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. This release drops the compatibility guarantee of [Go 1.18]. ### Added - Support global `MeterProvider` in `go.opentelemetry.io/otel`. (#3818) - Use `Meter` for a `metric.Meter` from the global `metric.MeterProvider`. - Use `GetMeterProivder` for a global `metric.MeterProvider`. - Use `SetMeterProivder` to set the global `metric.MeterProvider`. ### Changed - Dropped compatibility testing for [Go 1.18]. The project no longer guarantees support for this version of Go. (#3813) ### Fixed - Handle empty environment variable as it they were not set. (#3764) - Clarify the `httpconv` and `netconv` packages in `go.opentelemetry.io/otel/semconv/*` provide tracing semantic conventions. (#3823) - Fix race conditions in `go.opentelemetry.io/otel/exporters/metric/prometheus` that could cause a panic. (#3899) - Fix sending nil `scopeInfo` to metrics channel in `go.opentelemetry.io/otel/exporters/metric/prometheus` that could cause a panic in `github.com/prometheus/client_golang/prometheus`. (#3899) ### Deprecated - The `go.opentelemetry.io/otel/metric/global` package is deprecated. Use `go.opentelemetry.io/otel` instead. (#3818) ### Removed - The deprecated `go.opentelemetry.io/otel/metric/unit` package is removed. (#3814) ## [1.14.0/0.37.0/0.0.4] 2023-02-27 This release is the last to support [Go 1.18]. The next release will require at least [Go 1.19]. ### Added - The `event` type semantic conventions are added to `go.opentelemetry.io/otel/semconv/v1.17.0`. (#3697) - Support [Go 1.20]. (#3693) - The `go.opentelemetry.io/otel/semconv/v1.18.0` package. The package contains semantic conventions from the `v1.18.0` version of the OpenTelemetry specification. (#3719) - The following `const` renames from `go.opentelemetry.io/otel/semconv/v1.17.0` are included: - `OtelScopeNameKey` -> `OTelScopeNameKey` - `OtelScopeVersionKey` -> `OTelScopeVersionKey` - `OtelLibraryNameKey` -> `OTelLibraryNameKey` - `OtelLibraryVersionKey` -> `OTelLibraryVersionKey` - `OtelStatusCodeKey` -> `OTelStatusCodeKey` - `OtelStatusDescriptionKey` -> `OTelStatusDescriptionKey` - `OtelStatusCodeOk` -> `OTelStatusCodeOk` - `OtelStatusCodeError` -> `OTelStatusCodeError` - The following `func` renames from `go.opentelemetry.io/otel/semconv/v1.17.0` are included: - `OtelScopeName` -> `OTelScopeName` - `OtelScopeVersion` -> `OTelScopeVersion` - `OtelLibraryName` -> `OTelLibraryName` - `OtelLibraryVersion` -> `OTelLibraryVersion` - `OtelStatusDescription` -> `OTelStatusDescription` - A `IsSampled` method is added to the `SpanContext` implementation in `go.opentelemetry.io/otel/bridge/opentracing` to expose the span sampled state. See the [README](./bridge/opentracing/README.md) for more information. (#3570) - The `WithInstrumentationAttributes` option to `go.opentelemetry.io/otel/metric`. (#3738) - The `WithInstrumentationAttributes` option to `go.opentelemetry.io/otel/trace`. (#3739) - The following environment variables are supported by the periodic `Reader` in `go.opentelemetry.io/otel/sdk/metric`. (#3763) - `OTEL_METRIC_EXPORT_INTERVAL` sets the time between collections and exports. - `OTEL_METRIC_EXPORT_TIMEOUT` sets the timeout an export is attempted. ### Changed - Fall-back to `TextMapCarrier` when it's not `HttpHeader`s in `go.opentelemetry.io/otel/bridge/opentracing`. (#3679) - The `Collect` method of the `"go.opentelemetry.io/otel/sdk/metric".Reader` interface is updated to accept the `metricdata.ResourceMetrics` value the collection will be made into. This change is made to enable memory reuse by SDK users. (#3732) - The `WithUnit` option in `go.opentelemetry.io/otel/sdk/metric/instrument` is updated to accept a `string` for the unit value. (#3776) ### Fixed - Ensure `go.opentelemetry.io/otel` does not use generics. (#3723, #3725) - Multi-reader `MeterProvider`s now export metrics for all readers, instead of just the first reader. (#3720, #3724) - Remove use of deprecated `"math/rand".Seed` in `go.opentelemetry.io/otel/example/prometheus`. (#3733) - Do not silently drop unknown schema data with `Parse` in `go.opentelemetry.io/otel/schema/v1.1`. (#3743) - Data race issue in OTLP exporter retry mechanism. (#3755, #3756) - Wrapping empty errors when exporting in `go.opentelemetry.io/otel/sdk/metric`. (#3698, #3772) - Incorrect "all" and "resource" definition for schema files in `go.opentelemetry.io/otel/schema/v1.1`. (#3777) ### Deprecated - The `go.opentelemetry.io/otel/metric/unit` package is deprecated. Use the equivalent unit string instead. (#3776) - Use `"1"` instead of `unit.Dimensionless` - Use `"By"` instead of `unit.Bytes` - Use `"ms"` instead of `unit.Milliseconds` ## [1.13.0/0.36.0] 2023-02-07 ### Added - Attribute `KeyValue` creations functions to `go.opentelemetry.io/otel/semconv/v1.17.0` for all non-enum semantic conventions. These functions ensure semantic convention type correctness. (#3675) ### Fixed - Removed the `http.target` attribute from being added by `ServerRequest` in the following packages. (#3687) - `go.opentelemetry.io/otel/semconv/v1.13.0/httpconv` - `go.opentelemetry.io/otel/semconv/v1.14.0/httpconv` - `go.opentelemetry.io/otel/semconv/v1.15.0/httpconv` - `go.opentelemetry.io/otel/semconv/v1.16.0/httpconv` - `go.opentelemetry.io/otel/semconv/v1.17.0/httpconv` ### Removed - The deprecated `go.opentelemetry.io/otel/metric/instrument/asyncfloat64` package is removed. (#3631) - The deprecated `go.opentelemetry.io/otel/metric/instrument/asyncint64` package is removed. (#3631) - The deprecated `go.opentelemetry.io/otel/metric/instrument/syncfloat64` package is removed. (#3631) - The deprecated `go.opentelemetry.io/otel/metric/instrument/syncint64` package is removed. (#3631) ## [1.12.0/0.35.0] 2023-01-28 ### Added - The `WithInt64Callback` option to `go.opentelemetry.io/otel/metric/instrument`. This options is used to configure `int64` Observer callbacks during their creation. (#3507) - The `WithFloat64Callback` option to `go.opentelemetry.io/otel/metric/instrument`. This options is used to configure `float64` Observer callbacks during their creation. (#3507) - The `Producer` interface and `Reader.RegisterProducer(Producer)` to `go.opentelemetry.io/otel/sdk/metric`. These additions are used to enable external metric Producers. (#3524) - The `Callback` function type to `go.opentelemetry.io/otel/metric`. This new named function type is registered with a `Meter`. (#3564) - The `go.opentelemetry.io/otel/semconv/v1.13.0` package. The package contains semantic conventions from the `v1.13.0` version of the OpenTelemetry specification. (#3499) - The `EndUserAttributesFromHTTPRequest` function in `go.opentelemetry.io/otel/semconv/v1.12.0` is merged into `ClientRequest` and `ServerRequest` in `go.opentelemetry.io/otel/semconv/v1.13.0/httpconv`. - The `HTTPAttributesFromHTTPStatusCode` function in `go.opentelemetry.io/otel/semconv/v1.12.0` is merged into `ClientResponse` in `go.opentelemetry.io/otel/semconv/v1.13.0/httpconv`. - The `HTTPClientAttributesFromHTTPRequest` function in `go.opentelemetry.io/otel/semconv/v1.12.0` is replaced by `ClientRequest` in `go.opentelemetry.io/otel/semconv/v1.13.0/httpconv`. - The `HTTPServerAttributesFromHTTPRequest` function in `go.opentelemetry.io/otel/semconv/v1.12.0` is replaced by `ServerRequest` in `go.opentelemetry.io/otel/semconv/v1.13.0/httpconv`. - The `HTTPServerMetricAttributesFromHTTPRequest` function in `go.opentelemetry.io/otel/semconv/v1.12.0` is replaced by `ServerRequest` in `go.opentelemetry.io/otel/semconv/v1.13.0/httpconv`. - The `NetAttributesFromHTTPRequest` function in `go.opentelemetry.io/otel/semconv/v1.12.0` is split into `Transport` in `go.opentelemetry.io/otel/semconv/v1.13.0/netconv` and `ClientRequest` or `ServerRequest` in `go.opentelemetry.io/otel/semconv/v1.13.0/httpconv`. - The `SpanStatusFromHTTPStatusCode` function in `go.opentelemetry.io/otel/semconv/v1.12.0` is replaced by `ClientStatus` in `go.opentelemetry.io/otel/semconv/v1.13.0/httpconv`. - The `SpanStatusFromHTTPStatusCodeAndSpanKind` function in `go.opentelemetry.io/otel/semconv/v1.12.0` is split into `ClientStatus` and `ServerStatus` in `go.opentelemetry.io/otel/semconv/v1.13.0/httpconv`. - The `Client` function is included in `go.opentelemetry.io/otel/semconv/v1.13.0/netconv` to generate attributes for a `net.Conn`. - The `Server` function is included in `go.opentelemetry.io/otel/semconv/v1.13.0/netconv` to generate attributes for a `net.Listener`. - The `go.opentelemetry.io/otel/semconv/v1.14.0` package. The package contains semantic conventions from the `v1.14.0` version of the OpenTelemetry specification. (#3566) - The `go.opentelemetry.io/otel/semconv/v1.15.0` package. The package contains semantic conventions from the `v1.15.0` version of the OpenTelemetry specification. (#3578) - The `go.opentelemetry.io/otel/semconv/v1.16.0` package. The package contains semantic conventions from the `v1.16.0` version of the OpenTelemetry specification. (#3579) - Metric instruments to `go.opentelemetry.io/otel/metric/instrument`. These instruments are use as replacements of the deprecated `go.opentelemetry.io/otel/metric/instrument/{asyncfloat64,asyncint64,syncfloat64,syncint64}` packages.(#3575, #3586) - `Float64ObservableCounter` replaces the `asyncfloat64.Counter` - `Float64ObservableUpDownCounter` replaces the `asyncfloat64.UpDownCounter` - `Float64ObservableGauge` replaces the `asyncfloat64.Gauge` - `Int64ObservableCounter` replaces the `asyncint64.Counter` - `Int64ObservableUpDownCounter` replaces the `asyncint64.UpDownCounter` - `Int64ObservableGauge` replaces the `asyncint64.Gauge` - `Float64Counter` replaces the `syncfloat64.Counter` - `Float64UpDownCounter` replaces the `syncfloat64.UpDownCounter` - `Float64Histogram` replaces the `syncfloat64.Histogram` - `Int64Counter` replaces the `syncint64.Counter` - `Int64UpDownCounter` replaces the `syncint64.UpDownCounter` - `Int64Histogram` replaces the `syncint64.Histogram` - `NewTracerProvider` to `go.opentelemetry.io/otel/bridge/opentracing`. This is used to create `WrapperTracer` instances from a `TracerProvider`. (#3116) - The `Extrema` type to `go.opentelemetry.io/otel/sdk/metric/metricdata`. This type is used to represent min/max values and still be able to distinguish unset and zero values. (#3487) - The `go.opentelemetry.io/otel/semconv/v1.17.0` package. The package contains semantic conventions from the `v1.17.0` version of the OpenTelemetry specification. (#3599) ### Changed - Jaeger and Zipkin exporter use `github.com/go-logr/logr` as the logging interface, and add the `WithLogr` option. (#3497, #3500) - Instrument configuration in `go.opentelemetry.io/otel/metric/instrument` is split into specific options and configuration based on the instrument type. (#3507) - Use the added `Int64Option` type to configure instruments from `go.opentelemetry.io/otel/metric/instrument/syncint64`. - Use the added `Float64Option` type to configure instruments from `go.opentelemetry.io/otel/metric/instrument/syncfloat64`. - Use the added `Int64ObserverOption` type to configure instruments from `go.opentelemetry.io/otel/metric/instrument/asyncint64`. - Use the added `Float64ObserverOption` type to configure instruments from `go.opentelemetry.io/otel/metric/instrument/asyncfloat64`. - Return a `Registration` from the `RegisterCallback` method of a `Meter` in the `go.opentelemetry.io/otel/metric` package. This `Registration` can be used to unregister callbacks. (#3522) - Global error handler uses an atomic value instead of a mutex. (#3543) - Add `NewMetricProducer` to `go.opentelemetry.io/otel/bridge/opencensus`, which can be used to pass OpenCensus metrics to an OpenTelemetry Reader. (#3541) - Global logger uses an atomic value instead of a mutex. (#3545) - The `Shutdown` method of the `"go.opentelemetry.io/otel/sdk/trace".TracerProvider` releases all computational resources when called the first time. (#3551) - The `Sampler` returned from `TraceIDRatioBased` `go.opentelemetry.io/otel/sdk/trace` now uses the rightmost bits for sampling decisions. This fixes random sampling when using ID generators like `xray.IDGenerator` and increasing parity with other language implementations. (#3557) - Errors from `go.opentelemetry.io/otel/exporters/otlp/otlptrace` exporters are wrapped in errors identifying their signal name. Existing users of the exporters attempting to identify specific errors will need to use `errors.Unwrap()` to get the underlying error. (#3516) - Exporters from `go.opentelemetry.io/otel/exporters/otlp` will print the final retryable error message when attempts to retry time out. (#3514) - The instrument kind names in `go.opentelemetry.io/otel/sdk/metric` are updated to match the API. (#3562) - `InstrumentKindSyncCounter` is renamed to `InstrumentKindCounter` - `InstrumentKindSyncUpDownCounter` is renamed to `InstrumentKindUpDownCounter` - `InstrumentKindSyncHistogram` is renamed to `InstrumentKindHistogram` - `InstrumentKindAsyncCounter` is renamed to `InstrumentKindObservableCounter` - `InstrumentKindAsyncUpDownCounter` is renamed to `InstrumentKindObservableUpDownCounter` - `InstrumentKindAsyncGauge` is renamed to `InstrumentKindObservableGauge` - The `RegisterCallback` method of the `Meter` in `go.opentelemetry.io/otel/metric` changed. - The named `Callback` replaces the inline function parameter. (#3564) - `Callback` is required to return an error. (#3576) - `Callback` accepts the added `Observer` parameter added. This new parameter is used by `Callback` implementations to observe values for asynchronous instruments instead of calling the `Observe` method of the instrument directly. (#3584) - The slice of `instrument.Asynchronous` is now passed as a variadic argument. (#3587) - The exporter from `go.opentelemetry.io/otel/exporters/zipkin` is updated to use the `v1.16.0` version of semantic conventions. This means it no longer uses the removed `net.peer.ip` or `http.host` attributes to determine the remote endpoint. Instead it uses the `net.sock.peer` attributes. (#3581) - The `Min` and `Max` fields of the `HistogramDataPoint` in `go.opentelemetry.io/otel/sdk/metric/metricdata` are now defined with the added `Extrema` type instead of a `*float64`. (#3487) ### Fixed - Asynchronous instruments that use sum aggregators and attribute filters correctly add values from equivalent attribute sets that have been filtered. (#3439, #3549) - The `RegisterCallback` method of the `Meter` from `go.opentelemetry.io/otel/sdk/metric` only registers a callback for instruments created by that meter. Trying to register a callback with instruments from a different meter will result in an error being returned. (#3584) ### Deprecated - The `NewMetricExporter` in `go.opentelemetry.io/otel/bridge/opencensus` is deprecated. Use `NewMetricProducer` instead. (#3541) - The `go.opentelemetry.io/otel/metric/instrument/asyncfloat64` package is deprecated. Use the instruments from `go.opentelemetry.io/otel/metric/instrument` instead. (#3575) - The `go.opentelemetry.io/otel/metric/instrument/asyncint64` package is deprecated. Use the instruments from `go.opentelemetry.io/otel/metric/instrument` instead. (#3575) - The `go.opentelemetry.io/otel/metric/instrument/syncfloat64` package is deprecated. Use the instruments from `go.opentelemetry.io/otel/metric/instrument` instead. (#3575) - The `go.opentelemetry.io/otel/metric/instrument/syncint64` package is deprecated. Use the instruments from `go.opentelemetry.io/otel/metric/instrument` instead. (#3575) - The `NewWrappedTracerProvider` in `go.opentelemetry.io/otel/bridge/opentracing` is now deprecated. Use `NewTracerProvider` instead. (#3116) ### Removed - The deprecated `go.opentelemetry.io/otel/sdk/metric/view` package is removed. (#3520) - The `InstrumentProvider` from `go.opentelemetry.io/otel/sdk/metric/asyncint64` is removed. Use the new creation methods of the `Meter` in `go.opentelemetry.io/otel/sdk/metric` instead. (#3530) - The `Counter` method is replaced by `Meter.Int64ObservableCounter` - The `UpDownCounter` method is replaced by `Meter.Int64ObservableUpDownCounter` - The `Gauge` method is replaced by `Meter.Int64ObservableGauge` - The `InstrumentProvider` from `go.opentelemetry.io/otel/sdk/metric/asyncfloat64` is removed. Use the new creation methods of the `Meter` in `go.opentelemetry.io/otel/sdk/metric` instead. (#3530) - The `Counter` method is replaced by `Meter.Float64ObservableCounter` - The `UpDownCounter` method is replaced by `Meter.Float64ObservableUpDownCounter` - The `Gauge` method is replaced by `Meter.Float64ObservableGauge` - The `InstrumentProvider` from `go.opentelemetry.io/otel/sdk/metric/syncint64` is removed. Use the new creation methods of the `Meter` in `go.opentelemetry.io/otel/sdk/metric` instead. (#3530) - The `Counter` method is replaced by `Meter.Int64Counter` - The `UpDownCounter` method is replaced by `Meter.Int64UpDownCounter` - The `Histogram` method is replaced by `Meter.Int64Histogram` - The `InstrumentProvider` from `go.opentelemetry.io/otel/sdk/metric/syncfloat64` is removed. Use the new creation methods of the `Meter` in `go.opentelemetry.io/otel/sdk/metric` instead. (#3530) - The `Counter` method is replaced by `Meter.Float64Counter` - The `UpDownCounter` method is replaced by `Meter.Float64UpDownCounter` - The `Histogram` method is replaced by `Meter.Float64Histogram` ## [1.11.2/0.34.0] 2022-12-05 ### Added - The `WithView` `Option` is added to the `go.opentelemetry.io/otel/sdk/metric` package. This option is used to configure the view(s) a `MeterProvider` will use for all `Reader`s that are registered with it. (#3387) - Add Instrumentation Scope and Version as info metric and label in Prometheus exporter. This can be disabled using the `WithoutScopeInfo()` option added to that package.(#3273, #3357) - OTLP exporters now recognize: (#3363) - `OTEL_EXPORTER_OTLP_INSECURE` - `OTEL_EXPORTER_OTLP_TRACES_INSECURE` - `OTEL_EXPORTER_OTLP_METRICS_INSECURE` - `OTEL_EXPORTER_OTLP_CLIENT_KEY` - `OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY` - `OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY` - `OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE` - `OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE` - `OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE` - The `View` type and related `NewView` function to create a view according to the OpenTelemetry specification are added to `go.opentelemetry.io/otel/sdk/metric`. These additions are replacements for the `View` type and `New` function from `go.opentelemetry.io/otel/sdk/metric/view`. (#3459) - The `Instrument` and `InstrumentKind` type are added to `go.opentelemetry.io/otel/sdk/metric`. These additions are replacements for the `Instrument` and `InstrumentKind` types from `go.opentelemetry.io/otel/sdk/metric/view`. (#3459) - The `Stream` type is added to `go.opentelemetry.io/otel/sdk/metric` to define a metric data stream a view will produce. (#3459) - The `AssertHasAttributes` allows instrument authors to test that datapoints returned have appropriate attributes. (#3487) ### Changed - The `"go.opentelemetry.io/otel/sdk/metric".WithReader` option no longer accepts views to associate with the `Reader`. Instead, views are now registered directly with the `MeterProvider` via the new `WithView` option. The views registered with the `MeterProvider` apply to all `Reader`s. (#3387) - The `Temporality(view.InstrumentKind) metricdata.Temporality` and `Aggregation(view.InstrumentKind) aggregation.Aggregation` methods are added to the `"go.opentelemetry.io/otel/sdk/metric".Exporter` interface. (#3260) - The `Temporality(view.InstrumentKind) metricdata.Temporality` and `Aggregation(view.InstrumentKind) aggregation.Aggregation` methods are added to the `"go.opentelemetry.io/otel/exporters/otlp/otlpmetric".Client` interface. (#3260) - The `WithTemporalitySelector` and `WithAggregationSelector` `ReaderOption`s have been changed to `ManualReaderOption`s in the `go.opentelemetry.io/otel/sdk/metric` package. (#3260) - The periodic reader in the `go.opentelemetry.io/otel/sdk/metric` package now uses the temporality and aggregation selectors from its configured exporter instead of accepting them as options. (#3260) ### Fixed - The `go.opentelemetry.io/otel/exporters/prometheus` exporter fixes duplicated `_total` suffixes. (#3369) - Remove comparable requirement for `Reader`s. (#3387) - Cumulative metrics from the OpenCensus bridge (`go.opentelemetry.io/otel/bridge/opencensus`) are defined as monotonic sums, instead of non-monotonic. (#3389) - Asynchronous counters (`Counter` and `UpDownCounter`) from the metric SDK now produce delta sums when configured with delta temporality. (#3398) - Exported `Status` codes in the `go.opentelemetry.io/otel/exporters/zipkin` exporter are now exported as all upper case values. (#3340) - `Aggregation`s from `go.opentelemetry.io/otel/sdk/metric` with no data are not exported. (#3394, #3436) - Re-enabled Attribute Filters in the Metric SDK. (#3396) - Asynchronous callbacks are only called if they are registered with at least one instrument that does not use drop aggregation. (#3408) - Do not report empty partial-success responses in the `go.opentelemetry.io/otel/exporters/otlp` exporters. (#3438, #3432) - Handle partial success responses in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric` exporters. (#3162, #3440) - Prevent duplicate Prometheus description, unit, and type. (#3469) - Prevents panic when using incorrect `attribute.Value.As[Type]Slice()`. (#3489) ### Removed - The `go.opentelemetry.io/otel/exporters/otlp/otlpmetric.Client` interface is removed. (#3486) - The `go.opentelemetry.io/otel/exporters/otlp/otlpmetric.New` function is removed. Use the `otlpmetric[http|grpc].New` directly. (#3486) ### Deprecated - The `go.opentelemetry.io/otel/sdk/metric/view` package is deprecated. Use `Instrument`, `InstrumentKind`, `View`, and `NewView` in `go.opentelemetry.io/otel/sdk/metric` instead. (#3476) ## [1.11.1/0.33.0] 2022-10-19 ### Added - The Prometheus exporter in `go.opentelemetry.io/otel/exporters/prometheus` registers with a Prometheus registerer on creation. By default, it will register with the default Prometheus registerer. A non-default registerer can be used by passing the `WithRegisterer` option. (#3239) - Added the `WithAggregationSelector` option to the `go.opentelemetry.io/otel/exporters/prometheus` package to change the default `AggregationSelector` used. (#3341) - The Prometheus exporter in `go.opentelemetry.io/otel/exporters/prometheus` converts the `Resource` associated with metric exports into a `target_info` metric. (#3285) ### Changed - The `"go.opentelemetry.io/otel/exporters/prometheus".New` function is updated to return an error. It will return an error if the exporter fails to register with Prometheus. (#3239) ### Fixed - The URL-encoded values from the `OTEL_RESOURCE_ATTRIBUTES` environment variable are decoded. (#2963) - The `baggage.NewMember` function decodes the `value` parameter instead of directly using it. This fixes the implementation to be compliant with the W3C specification. (#3226) - Slice attributes of the `attribute` package are now comparable based on their value, not instance. (#3108 #3252) - The `Shutdown` and `ForceFlush` methods of the `"go.opentelemetry.io/otel/sdk/trace".TraceProvider` no longer return an error when no processor is registered. (#3268) - The Prometheus exporter in `go.opentelemetry.io/otel/exporters/prometheus` cumulatively sums histogram buckets. (#3281) - The sum of each histogram data point is now uniquely exported by the `go.opentelemetry.io/otel/exporters/otlpmetric` exporters. (#3284, #3293) - Recorded values for asynchronous counters (`Counter` and `UpDownCounter`) are interpreted as exact, not incremental, sum values by the metric SDK. (#3350, #3278) - `UpDownCounters` are now correctly output as Prometheus gauges in the `go.opentelemetry.io/otel/exporters/prometheus` exporter. (#3358) - The Prometheus exporter in `go.opentelemetry.io/otel/exporters/prometheus` no longer describes the metrics it will send to Prometheus on startup. Instead the exporter is defined as an "unchecked" collector for Prometheus. This fixes the `reader is not registered` warning currently emitted on startup. (#3291 #3342) - The `go.opentelemetry.io/otel/exporters/prometheus` exporter now correctly adds `_total` suffixes to counter metrics. (#3360) - The `go.opentelemetry.io/otel/exporters/prometheus` exporter now adds a unit suffix to metric names. This can be disabled using the `WithoutUnits()` option added to that package. (#3352) ## [1.11.0/0.32.3] 2022-10-12 ### Added - Add default User-Agent header to OTLP exporter requests (`go.opentelemetry.io/otel/exporters/otlptrace/otlptracegrpc` and `go.opentelemetry.io/otel/exporters/otlptrace/otlptracehttp`). (#3261) ### Changed - `span.SetStatus` has been updated such that calls that lower the status are now no-ops. (#3214) - Upgrade `golang.org/x/sys/unix` from `v0.0.0-20210423185535-09eb48e85fd7` to `v0.0.0-20220919091848-fb04ddd9f9c8`. This addresses [GO-2022-0493](https://pkg.go.dev/vuln/GO-2022-0493). (#3235) ## [0.32.2] Metric SDK (Alpha) - 2022-10-11 ### Added - Added an example of using metric views to customize instruments. (#3177) - Add default User-Agent header to OTLP exporter requests (`go.opentelemetry.io/otel/exporters/otlpmetric/otlpmetricgrpc` and `go.opentelemetry.io/otel/exporters/otlpmetric/otlpmetrichttp`). (#3261) ### Changed - Flush pending measurements with the `PeriodicReader` in the `go.opentelemetry.io/otel/sdk/metric` when `ForceFlush` or `Shutdown` are called. (#3220) - Update histogram default bounds to match the requirements of the latest specification. (#3222) - Encode the HTTP status code in the OpenTracing bridge (`go.opentelemetry.io/otel/bridge/opentracing`) as an integer. (#3265) ### Fixed - Use default view if instrument does not match any registered view of a reader. (#3224, #3237) - Return the same instrument every time a user makes the exact same instrument creation call. (#3229, #3251) - Return the existing instrument when a view transforms a creation call to match an existing instrument. (#3240, #3251) - Log a warning when a conflicting instrument (e.g. description, unit, data-type) is created instead of returning an error. (#3251) - The OpenCensus bridge no longer sends empty batches of metrics. (#3263) ## [0.32.1] Metric SDK (Alpha) - 2022-09-22 ### Changed - The Prometheus exporter sanitizes OpenTelemetry instrument names when exporting. Invalid characters are replaced with `_`. (#3212) ### Added - The metric portion of the OpenCensus bridge (`go.opentelemetry.io/otel/bridge/opencensus`) has been reintroduced. (#3192) - The OpenCensus bridge example (`go.opentelemetry.io/otel/example/opencensus`) has been reintroduced. (#3206) ### Fixed - Updated go.mods to point to valid versions of the sdk. (#3216) - Set the `MeterProvider` resource on all exported metric data. (#3218) ## [0.32.0] Revised Metric SDK (Alpha) - 2022-09-18 ### Changed - The metric SDK in `go.opentelemetry.io/otel/sdk/metric` is completely refactored to comply with the OpenTelemetry specification. Please see the package documentation for how the new SDK is initialized and configured. (#3175) - Update the minimum supported go version to go1.18. Removes support for go1.17 (#3179) ### Removed - The metric portion of the OpenCensus bridge (`go.opentelemetry.io/otel/bridge/opencensus`) has been removed. A new bridge compliant with the revised metric SDK will be added back in a future release. (#3175) - The `go.opentelemetry.io/otel/sdk/metric/aggregator/aggregatortest` package is removed, see the new metric SDK. (#3175) - The `go.opentelemetry.io/otel/sdk/metric/aggregator/histogram` package is removed, see the new metric SDK. (#3175) - The `go.opentelemetry.io/otel/sdk/metric/aggregator/lastvalue` package is removed, see the new metric SDK. (#3175) - The `go.opentelemetry.io/otel/sdk/metric/aggregator/sum` package is removed, see the new metric SDK. (#3175) - The `go.opentelemetry.io/otel/sdk/metric/aggregator` package is removed, see the new metric SDK. (#3175) - The `go.opentelemetry.io/otel/sdk/metric/controller/basic` package is removed, see the new metric SDK. (#3175) - The `go.opentelemetry.io/otel/sdk/metric/controller/controllertest` package is removed, see the new metric SDK. (#3175) - The `go.opentelemetry.io/otel/sdk/metric/controller/time` package is removed, see the new metric SDK. (#3175) - The `go.opentelemetry.io/otel/sdk/metric/export/aggregation` package is removed, see the new metric SDK. (#3175) - The `go.opentelemetry.io/otel/sdk/metric/export` package is removed, see the new metric SDK. (#3175) - The `go.opentelemetry.io/otel/sdk/metric/metrictest` package is removed. A replacement package that supports the new metric SDK will be added back in a future release. (#3175) - The `go.opentelemetry.io/otel/sdk/metric/number` package is removed, see the new metric SDK. (#3175) - The `go.opentelemetry.io/otel/sdk/metric/processor/basic` package is removed, see the new metric SDK. (#3175) - The `go.opentelemetry.io/otel/sdk/metric/processor/processortest` package is removed, see the new metric SDK. (#3175) - The `go.opentelemetry.io/otel/sdk/metric/processor/reducer` package is removed, see the new metric SDK. (#3175) - The `go.opentelemetry.io/otel/sdk/metric/registry` package is removed, see the new metric SDK. (#3175) - The `go.opentelemetry.io/otel/sdk/metric/sdkapi` package is removed, see the new metric SDK. (#3175) - The `go.opentelemetry.io/otel/sdk/metric/selector/simple` package is removed, see the new metric SDK. (#3175) - The `"go.opentelemetry.io/otel/sdk/metric".ErrUninitializedInstrument` variable was removed. (#3175) - The `"go.opentelemetry.io/otel/sdk/metric".ErrBadInstrument` variable was removed. (#3175) - The `"go.opentelemetry.io/otel/sdk/metric".Accumulator` type was removed, see the `MeterProvider`in the new metric SDK. (#3175) - The `"go.opentelemetry.io/otel/sdk/metric".NewAccumulator` function was removed, see `NewMeterProvider`in the new metric SDK. (#3175) - The deprecated `"go.opentelemetry.io/otel/sdk/metric".AtomicFieldOffsets` function was removed. (#3175) ## [1.10.0] - 2022-09-09 ### Added - Support Go 1.19. (#3077) Include compatibility testing and document support. (#3077) - Support the OTLP ExportTracePartialSuccess response; these are passed to the registered error handler. (#3106) - Upgrade go.opentelemetry.io/proto/otlp from v0.18.0 to v0.19.0 (#3107) ### Changed - Fix misidentification of OpenTelemetry `SpanKind` in OpenTracing bridge (`go.opentelemetry.io/otel/bridge/opentracing`). (#3096) - Attempting to start a span with a nil `context` will no longer cause a panic. (#3110) - All exporters will be shutdown even if one reports an error (#3091) - Ensure valid UTF-8 when truncating over-length attribute values. (#3156) ## [1.9.0/0.0.3] - 2022-08-01 ### Added - Add support for Schema Files format 1.1.x (metric "split" transform) with the new `go.opentelemetry.io/otel/schema/v1.1` package. (#2999) - Add the `go.opentelemetry.io/otel/semconv/v1.11.0` package. The package contains semantic conventions from the `v1.11.0` version of the OpenTelemetry specification. (#3009) - Add the `go.opentelemetry.io/otel/semconv/v1.12.0` package. The package contains semantic conventions from the `v1.12.0` version of the OpenTelemetry specification. (#3010) - Add the `http.method` attribute to HTTP server metric from all `go.opentelemetry.io/otel/semconv/*` packages. (#3018) ### Fixed - Invalid warning for context setup being deferred in `go.opentelemetry.io/otel/bridge/opentracing` package. (#3029) ## [1.8.0/0.31.0] - 2022-07-08 ### Added - Add support for `opentracing.TextMap` format in the `Inject` and `Extract` methods of the `"go.opentelemetry.io/otel/bridge/opentracing".BridgeTracer` type. (#2911) ### Changed - The `crosslink` make target has been updated to use the `go.opentelemetry.io/build-tools/crosslink` package. (#2886) - In the `go.opentelemetry.io/otel/sdk/instrumentation` package rename `Library` to `Scope` and alias `Library` as `Scope` (#2976) - Move metric no-op implementation form `nonrecording` to `metric` package. (#2866) ### Removed - Support for go1.16. Support is now only for go1.17 and go1.18 (#2917) ### Deprecated - The `Library` struct in the `go.opentelemetry.io/otel/sdk/instrumentation` package is deprecated. Use the equivalent `Scope` struct instead. (#2977) - The `ReadOnlySpan.InstrumentationLibrary` method from the `go.opentelemetry.io/otel/sdk/trace` package is deprecated. Use the equivalent `ReadOnlySpan.InstrumentationScope` method instead. (#2977) ## [1.7.0/0.30.0] - 2022-04-28 ### Added - Add the `go.opentelemetry.io/otel/semconv/v1.8.0` package. The package contains semantic conventions from the `v1.8.0` version of the OpenTelemetry specification. (#2763) - Add the `go.opentelemetry.io/otel/semconv/v1.9.0` package. The package contains semantic conventions from the `v1.9.0` version of the OpenTelemetry specification. (#2792) - Add the `go.opentelemetry.io/otel/semconv/v1.10.0` package. The package contains semantic conventions from the `v1.10.0` version of the OpenTelemetry specification. (#2842) - Added an in-memory exporter to metrictest to aid testing with a full SDK. (#2776) ### Fixed - Globally delegated instruments are unwrapped before delegating asynchronous callbacks. (#2784) - Remove import of `testing` package in non-tests builds of the `go.opentelemetry.io/otel` package. (#2786) ### Changed - The `WithLabelEncoder` option from the `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric` package is renamed to `WithAttributeEncoder`. (#2790) - The `LabelFilterSelector` interface from `go.opentelemetry.io/otel/sdk/metric/processor/reducer` is renamed to `AttributeFilterSelector`. The method included in the renamed interface also changed from `LabelFilterFor` to `AttributeFilterFor`. (#2790) - The `Metadata.Labels` method from the `go.opentelemetry.io/otel/sdk/metric/export` package is renamed to `Metadata.Attributes`. Consequentially, the `Record` type from the same package also has had the embedded method renamed. (#2790) ### Deprecated - The `Iterator.Label` method in the `go.opentelemetry.io/otel/attribute` package is deprecated. Use the equivalent `Iterator.Attribute` method instead. (#2790) - The `Iterator.IndexedLabel` method in the `go.opentelemetry.io/otel/attribute` package is deprecated. Use the equivalent `Iterator.IndexedAttribute` method instead. (#2790) - The `MergeIterator.Label` method in the `go.opentelemetry.io/otel/attribute` package is deprecated. Use the equivalent `MergeIterator.Attribute` method instead. (#2790) ### Removed - Removed the `Batch` type from the `go.opentelemetry.io/otel/sdk/metric/metrictest` package. (#2864) - Removed the `Measurement` type from the `go.opentelemetry.io/otel/sdk/metric/metrictest` package. (#2864) ## [0.29.0] - 2022-04-11 ### Added - The metrics global package was added back into several test files. (#2764) - The `Meter` function is added back to the `go.opentelemetry.io/otel/metric/global` package. This function is a convenience function equivalent to calling `global.MeterProvider().Meter(...)`. (#2750) ### Removed - Removed module the `go.opentelemetry.io/otel/sdk/export/metric`. Use the `go.opentelemetry.io/otel/sdk/metric` module instead. (#2720) ### Changed - Don't panic anymore when setting a global MeterProvider to itself. (#2749) - Upgrade `go.opentelemetry.io/proto/otlp` in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric` from `v0.12.1` to `v0.15.0`. This replaces the use of the now deprecated `InstrumentationLibrary` and `InstrumentationLibraryMetrics` types and fields in the proto library with the equivalent `InstrumentationScope` and `ScopeMetrics`. (#2748) ## [1.6.3] - 2022-04-07 ### Fixed - Allow non-comparable global `MeterProvider`, `TracerProvider`, and `TextMapPropagator` types to be set. (#2772, #2773) ## [1.6.2] - 2022-04-06 ### Changed - Don't panic anymore when setting a global TracerProvider or TextMapPropagator to itself. (#2749) - Upgrade `go.opentelemetry.io/proto/otlp` in `go.opentelemetry.io/otel/exporters/otlp/otlptrace` from `v0.12.1` to `v0.15.0`. This replaces the use of the now deprecated `InstrumentationLibrary` and `InstrumentationLibrarySpans` types and fields in the proto library with the equivalent `InstrumentationScope` and `ScopeSpans`. (#2748) ## [1.6.1] - 2022-03-28 ### Fixed - The `go.opentelemetry.io/otel/schema/*` packages now use the correct schema URL for their `SchemaURL` constant. Instead of using `"https://opentelemetry.io/schemas/v"` they now use the correct URL without a `v` prefix, `"https://opentelemetry.io/schemas/"`. (#2743, #2744) ### Security - Upgrade `go.opentelemetry.io/proto/otlp` from `v0.12.0` to `v0.12.1`. This includes an indirect upgrade of `github.com/grpc-ecosystem/grpc-gateway` which resolves [a vulnerability](https://nvd.nist.gov/vuln/detail/CVE-2019-11254) from `gopkg.in/yaml.v2` in version `v2.2.3`. (#2724, #2728) ## [1.6.0/0.28.0] - 2022-03-23 ### ⚠️ Notice ⚠️ This update is a breaking change of the unstable Metrics API. Code instrumented with the `go.opentelemetry.io/otel/metric` will need to be modified. ### Added - Add metrics exponential histogram support. New mapping functions have been made available in `sdk/metric/aggregator/exponential/mapping` for other OpenTelemetry projects to take dependencies on. (#2502) - Add Go 1.18 to our compatibility tests. (#2679) - Allow configuring the Sampler with the `OTEL_TRACES_SAMPLER` and `OTEL_TRACES_SAMPLER_ARG` environment variables. (#2305, #2517) - Add the `metric/global` for obtaining and setting the global `MeterProvider`. (#2660) ### Changed - The metrics API has been significantly changed to match the revised OpenTelemetry specification. High-level changes include: - Synchronous and asynchronous instruments are now handled by independent `InstrumentProvider`s. These `InstrumentProvider`s are managed with a `Meter`. - Synchronous and asynchronous instruments are grouped into their own packages based on value types. - Asynchronous callbacks can now be registered with a `Meter`. Be sure to check out the metric module documentation for more information on how to use the revised API. (#2587, #2660) ### Fixed - Fallback to general attribute limits when span specific ones are not set in the environment. (#2675, #2677) ## [1.5.0] - 2022-03-16 ### Added - Log the Exporters configuration in the TracerProviders message. (#2578) - Added support to configure the span limits with environment variables. The following environment variables are supported. (#2606, #2637) - `OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT` - `OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT` - `OTEL_SPAN_EVENT_COUNT_LIMIT` - `OTEL_EVENT_ATTRIBUTE_COUNT_LIMIT` - `OTEL_SPAN_LINK_COUNT_LIMIT` - `OTEL_LINK_ATTRIBUTE_COUNT_LIMIT` If the provided environment variables are invalid (negative), the default values would be used. - Rename the `gc` runtime name to `go` (#2560) - Add resource container ID detection. (#2418) - Add span attribute value length limit. The new `AttributeValueLengthLimit` field is added to the `"go.opentelemetry.io/otel/sdk/trace".SpanLimits` type to configure this limit for a `TracerProvider`. The default limit for this resource is "unlimited". (#2637) - Add the `WithRawSpanLimits` option to `go.opentelemetry.io/otel/sdk/trace`. This option replaces the `WithSpanLimits` option. Zero or negative values will not be changed to the default value like `WithSpanLimits` does. Setting a limit to zero will effectively disable the related resource it limits and setting to a negative value will mean that resource is unlimited. Consequentially, limits should be constructed using `NewSpanLimits` and updated accordingly. (#2637) ### Changed - Drop oldest tracestate `Member` when capacity is reached. (#2592) - Add event and link drop counts to the exported data from the `oltptrace` exporter. (#2601) - Unify path cleaning functionally in the `otlpmetric` and `otlptrace` configuration. (#2639) - Change the debug message from the `sdk/trace.BatchSpanProcessor` to reflect the count is cumulative. (#2640) - Introduce new internal `envconfig` package for OTLP exporters. (#2608) - If `http.Request.Host` is empty, fall back to use `URL.Host` when populating `http.host` in the `semconv` packages. (#2661) ### Fixed - Remove the OTLP trace exporter limit of SpanEvents when exporting. (#2616) - Default to port `4318` instead of `4317` for the `otlpmetrichttp` and `otlptracehttp` client. (#2614, #2625) - Unlimited span limits are now supported (negative values). (#2636, #2637) ### Deprecated - Deprecated `"go.opentelemetry.io/otel/sdk/trace".WithSpanLimits`. Use `WithRawSpanLimits` instead. That option allows setting unlimited and zero limits, this option does not. This option will be kept until the next major version incremented release. (#2637) ## [1.4.1] - 2022-02-16 ### Fixed - Fix race condition in reading the dropped spans number for the `BatchSpanProcessor`. (#2615) ## [1.4.0] - 2022-02-11 ### Added - Use `OTEL_EXPORTER_ZIPKIN_ENDPOINT` environment variable to specify zipkin collector endpoint. (#2490) - Log the configuration of `TracerProvider`s, and `Tracer`s for debugging. To enable use a logger with Verbosity (V level) `>=1`. (#2500) - Added support to configure the batch span-processor with environment variables. The following environment variables are used. (#2515) - `OTEL_BSP_SCHEDULE_DELAY` - `OTEL_BSP_EXPORT_TIMEOUT` - `OTEL_BSP_MAX_QUEUE_SIZE`. - `OTEL_BSP_MAX_EXPORT_BATCH_SIZE` ### Changed - Zipkin exporter exports `Resource` attributes in the `Tags` field. (#2589) ### Deprecated - Deprecate module the `go.opentelemetry.io/otel/sdk/export/metric`. Use the `go.opentelemetry.io/otel/sdk/metric` module instead. (#2382) - Deprecate `"go.opentelemetry.io/otel/sdk/metric".AtomicFieldOffsets`. (#2445) ### Fixed - Fixed the instrument kind for noop async instruments to correctly report an implementation. (#2461) - Fix UDP packets overflowing with Jaeger payloads. (#2489, #2512) - Change the `otlpmetric.Client` interface's `UploadMetrics` method to accept a single `ResourceMetrics` instead of a slice of them. (#2491) - Specify explicit buckets in Prometheus example, fixing issue where example only has `+inf` bucket. (#2419, #2493) - W3C baggage will now decode urlescaped values. (#2529) - Baggage members are now only validated once, when calling `NewMember` and not also when adding it to the baggage itself. (#2522) - The order attributes are dropped from spans in the `go.opentelemetry.io/otel/sdk/trace` package when capacity is reached is fixed to be in compliance with the OpenTelemetry specification. Instead of dropping the least-recently-used attribute, the last added attribute is dropped. This drop order still only applies to attributes with unique keys not already contained in the span. If an attribute is added with a key already contained in the span, that attribute is updated to the new value being added. (#2576) ### Removed - Updated `go.opentelemetry.io/proto/otlp` from `v0.11.0` to `v0.12.0`. This version removes a number of deprecated methods. (#2546) - [`Metric.GetIntGauge()`](https://pkg.go.dev/go.opentelemetry.io/proto/otlp@v0.11.0/metrics/v1#Metric.GetIntGauge) - [`Metric.GetIntHistogram()`](https://pkg.go.dev/go.opentelemetry.io/proto/otlp@v0.11.0/metrics/v1#Metric.GetIntHistogram) - [`Metric.GetIntSum()`](https://pkg.go.dev/go.opentelemetry.io/proto/otlp@v0.11.0/metrics/v1#Metric.GetIntSum) ## [1.3.0] - 2021-12-10 ### ⚠️ Notice ⚠️ We have updated the project minimum supported Go version to 1.16 ### Added - Added an internal Logger. This can be used by the SDK and API to provide users with feedback of the internal state. To enable verbose logs configure the logger which will print V(1) logs. For debugging information configure to print V(5) logs. (#2343) - Add the `WithRetry` `Option` and the `RetryConfig` type to the `go.opentelemetry.io/otel/exporter/otel/otlpmetric/otlpmetrichttp` package to specify retry behavior consistently. (#2425) - Add `SpanStatusFromHTTPStatusCodeAndSpanKind` to all `semconv` packages to return a span status code similar to `SpanStatusFromHTTPStatusCode`, but exclude `4XX` HTTP errors as span errors if the span is of server kind. (#2296) ### Changed - The `"go.opentelemetry.io/otel/exporter/otel/otlptrace/otlptracegrpc".Client` now uses the underlying gRPC `ClientConn` to handle name resolution, TCP connection establishment (with retries and backoff) and TLS handshakes, and handling errors on established connections by re-resolving the name and reconnecting. (#2329) - The `"go.opentelemetry.io/otel/exporter/otel/otlpmetric/otlpmetricgrpc".Client` now uses the underlying gRPC `ClientConn` to handle name resolution, TCP connection establishment (with retries and backoff) and TLS handshakes, and handling errors on established connections by re-resolving the name and reconnecting. (#2425) - The `"go.opentelemetry.io/otel/exporter/otel/otlpmetric/otlpmetricgrpc".RetrySettings` type is renamed to `RetryConfig`. (#2425) - The `go.opentelemetry.io/otel/exporter/otel/*` gRPC exporters now default to using the host's root CA set if none are provided by the user and `WithInsecure` is not specified. (#2432) - Change `resource.Default` to be evaluated the first time it is called, rather than on import. This allows the caller the option to update `OTEL_RESOURCE_ATTRIBUTES` first, such as with `os.Setenv`. (#2371) ### Fixed - The `go.opentelemetry.io/otel/exporter/otel/*` exporters are updated to handle per-signal and universal endpoints according to the OpenTelemetry specification. Any per-signal endpoint set via an `OTEL_EXPORTER_OTLP__ENDPOINT` environment variable is now used without modification of the path. When `OTEL_EXPORTER_OTLP_ENDPOINT` is set, if it contains a path, that path is used as a base path which per-signal paths are appended to. (#2433) - Basic metric controller updated to use sync.Map to avoid blocking calls (#2381) - The `go.opentelemetry.io/otel/exporter/jaeger` correctly sets the `otel.status_code` value to be a string of `ERROR` or `OK` instead of an integer code. (#2439, #2440) ### Deprecated - Deprecated the `"go.opentelemetry.io/otel/exporter/otel/otlpmetric/otlpmetrichttp".WithMaxAttempts` `Option`, use the new `WithRetry` `Option` instead. (#2425) - Deprecated the `"go.opentelemetry.io/otel/exporter/otel/otlpmetric/otlpmetrichttp".WithBackoff` `Option`, use the new `WithRetry` `Option` instead. (#2425) ### Removed - Remove the metric Processor's ability to convert cumulative to delta aggregation temporality. (#2350) - Remove the metric Bound Instruments interface and implementations. (#2399) - Remove the metric MinMaxSumCount kind aggregation and the corresponding OTLP export path. (#2423) - Metric SDK removes the "exact" aggregator for histogram instruments, as it performed a non-standard aggregation for OTLP export (creating repeated Gauge points) and worked its way into a number of confusing examples. (#2348) ## [1.2.0] - 2021-11-12 ### Changed - Metric SDK `export.ExportKind`, `export.ExportKindSelector` types have been renamed to `aggregation.Temporality` and `aggregation.TemporalitySelector` respectively to keep in line with current specification and protocol along with built-in selectors (e.g., `aggregation.CumulativeTemporalitySelector`, ...). (#2274) - The Metric `Exporter` interface now requires a `TemporalitySelector` method instead of an `ExportKindSelector`. (#2274) - Metrics API cleanup. The `metric/sdkapi` package has been created to relocate the API-to-SDK interface: - The following interface types simply moved from `metric` to `metric/sdkapi`: `Descriptor`, `MeterImpl`, `InstrumentImpl`, `SyncImpl`, `BoundSyncImpl`, `AsyncImpl`, `AsyncRunner`, `AsyncSingleRunner`, and `AsyncBatchRunner` - The following struct types moved and are replaced with type aliases, since they are exposed to the user: `Observation`, `Measurement`. - The No-op implementations of sync and async instruments are no longer exported, new functions `sdkapi.NewNoopAsyncInstrument()` and `sdkapi.NewNoopSyncInstrument()` are provided instead. (#2271) - Update the SDK `BatchSpanProcessor` to export all queued spans when `ForceFlush` is called. (#2080, #2335) ### Added - Add the `"go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc".WithGRPCConn` option so the exporter can reuse an existing gRPC connection. (#2002) - Added a new `schema` module to help parse Schema Files in OTEP 0152 format. (#2267) - Added a new `MapCarrier` to the `go.opentelemetry.io/otel/propagation` package to hold propagated cross-cutting concerns as a `map[string]string` held in memory. (#2334) ## [1.1.0] - 2021-10-27 ### Added - Add the `"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc".WithGRPCConn` option so the exporter can reuse an existing gRPC connection. (#2002) - Add the `go.opentelemetry.io/otel/semconv/v1.7.0` package. The package contains semantic conventions from the `v1.7.0` version of the OpenTelemetry specification. (#2320) - Add the `go.opentelemetry.io/otel/semconv/v1.6.1` package. The package contains semantic conventions from the `v1.6.1` version of the OpenTelemetry specification. (#2321) - Add the `go.opentelemetry.io/otel/semconv/v1.5.0` package. The package contains semantic conventions from the `v1.5.0` version of the OpenTelemetry specification. (#2322) - When upgrading from the `semconv/v1.4.0` package note the following name changes: - `K8SReplicasetUIDKey` -> `K8SReplicaSetUIDKey` - `K8SReplicasetNameKey` -> `K8SReplicaSetNameKey` - `K8SStatefulsetUIDKey` -> `K8SStatefulSetUIDKey` - `k8SStatefulsetNameKey` -> `K8SStatefulSetNameKey` - `K8SDaemonsetUIDKey` -> `K8SDaemonSetUIDKey` - `K8SDaemonsetNameKey` -> `K8SDaemonSetNameKey` ### Changed - Links added to a span will be dropped by the SDK if they contain an invalid span context (#2275). ### Fixed - The `"go.opentelemetry.io/otel/semconv/v1.4.0".HTTPServerAttributesFromHTTPRequest` now correctly only sets the HTTP client IP attribute even if the connection was routed with proxies and there are multiple addresses in the `X-Forwarded-For` header. (#2282, #2284) - The `"go.opentelemetry.io/otel/semconv/v1.4.0".NetAttributesFromHTTPRequest` function correctly handles IPv6 addresses as IP addresses and sets the correct net peer IP instead of the net peer hostname attribute. (#2283, #2285) - The simple span processor shutdown method deterministically returns the exporter error status if it simultaneously finishes when the deadline is reached. (#2290, #2289) ## [1.0.1] - 2021-10-01 ### Fixed - json stdout exporter no longer crashes due to concurrency bug. (#2265) ## [Metrics 0.24.0] - 2021-10-01 ### Changed - NoopMeterProvider is now private and NewNoopMeterProvider must be used to obtain a noopMeterProvider. (#2237) - The Metric SDK `Export()` function takes a new two-level reader interface for iterating over results one instrumentation library at a time. (#2197) - The former `"go.opentelemetry.io/otel/sdk/export/metric".CheckpointSet` is renamed `Reader`. - The new interface is named `"go.opentelemetry.io/otel/sdk/export/metric".InstrumentationLibraryReader`. ## [1.0.0] - 2021-09-20 This is the first stable release for the project. This release includes an API and SDK for the tracing signal that will comply with the stability guarantees defined by the projects [versioning policy](./VERSIONING.md). ### Added - OTLP trace exporter now sets the `SchemaURL` field in the exported telemetry if the Tracer has `WithSchemaURL` option. (#2242) ### Fixed - Slice-valued attributes can correctly be used as map keys. (#2223) ### Removed - Removed the `"go.opentelemetry.io/otel/exporters/zipkin".WithSDKOptions` function. (#2248) - Removed the deprecated package `go.opentelemetry.io/otel/oteltest`. (#2234) - Removed the deprecated package `go.opentelemetry.io/otel/bridge/opencensus/utils`. (#2233) - Removed deprecated functions, types, and methods from `go.opentelemetry.io/otel/attribute` package. Use the typed functions and methods added to the package instead. (#2235) - The `Key.Array` method is removed. - The `Array` function is removed. - The `Any` function is removed. - The `ArrayValue` function is removed. - The `AsArray` function is removed. ## [1.0.0-RC3] - 2021-09-02 ### Added - Added `ErrorHandlerFunc` to use a function as an `"go.opentelemetry.io/otel".ErrorHandler`. (#2149) - Added `"go.opentelemetry.io/otel/trace".WithStackTrace` option to add a stack trace when using `span.RecordError` or when panic is handled in `span.End`. (#2163) - Added typed slice attribute types and functionality to the `go.opentelemetry.io/otel/attribute` package to replace the existing array type and functions. (#2162) - `BoolSlice`, `IntSlice`, `Int64Slice`, `Float64Slice`, and `StringSlice` replace the use of the `Array` function in the package. - Added the `go.opentelemetry.io/otel/example/fib` example package. Included is an example application that computes Fibonacci numbers. (#2203) ### Changed - Metric instruments have been renamed to match the (feature-frozen) metric API specification: - ValueRecorder becomes Histogram - ValueObserver becomes Gauge - SumObserver becomes CounterObserver - UpDownSumObserver becomes UpDownCounterObserver The API exported from this project is still considered experimental. (#2202) - Metric SDK/API implementation type `InstrumentKind` moves into `sdkapi` sub-package. (#2091) - The Metrics SDK export record no longer contains a Resource pointer, the SDK `"go.opentelemetry.io/otel/sdk/trace/export/metric".Exporter.Export()` function for push-based exporters now takes a single Resource argument, pull-based exporters use `"go.opentelemetry.io/otel/sdk/metric/controller/basic".Controller.Resource()`. (#2120) - The JSON output of the `go.opentelemetry.io/otel/exporters/stdout/stdouttrace` is harmonized now such that the output is "plain" JSON objects after each other of the form `{ ... } { ... } { ... }`. Earlier the JSON objects describing a span were wrapped in a slice for each `Exporter.ExportSpans` call, like `[ { ... } ][ { ... } { ... } ]`. Outputting JSON object directly after each other is consistent with JSON loggers, and a bit easier to parse and read. (#2196) - Update the `NewTracerConfig`, `NewSpanStartConfig`, `NewSpanEndConfig`, and `NewEventConfig` function in the `go.opentelemetry.io/otel/trace` package to return their respective configurations as structs instead of pointers to the struct. (#2212) ### Deprecated - The `go.opentelemetry.io/otel/bridge/opencensus/utils` package is deprecated. All functionality from this package now exists in the `go.opentelemetry.io/otel/bridge/opencensus` package. The functions from that package should be used instead. (#2166) - The `"go.opentelemetry.io/otel/attribute".Array` function and the related `ARRAY` value type is deprecated. Use the typed `*Slice` functions and types added to the package instead. (#2162) - The `"go.opentelemetry.io/otel/attribute".Any` function is deprecated. Use the typed functions instead. (#2181) - The `go.opentelemetry.io/otel/oteltest` package is deprecated. The `"go.opentelemetry.io/otel/sdk/trace/tracetest".SpanRecorder` can be registered with the default SDK (`go.opentelemetry.io/otel/sdk/trace`) as a `SpanProcessor` and used as a replacement for this deprecated package. (#2188) ### Removed - Removed metrics test package `go.opentelemetry.io/otel/sdk/export/metric/metrictest`. (#2105) ### Fixed - The `fromEnv` detector no longer throws an error when `OTEL_RESOURCE_ATTRIBUTES` environment variable is not set or empty. (#2138) - Setting the global `ErrorHandler` with `"go.opentelemetry.io/otel".SetErrorHandler` multiple times is now supported. (#2160, #2140) - The `"go.opentelemetry.io/otel/attribute".Any` function now supports `int32` values. (#2169) - Multiple calls to `"go.opentelemetry.io/otel/sdk/metric/controller/basic".WithResource()` are handled correctly, and when no resources are provided `"go.opentelemetry.io/otel/sdk/resource".Default()` is used. (#2120) - The `WithoutTimestamps` option for the `go.opentelemetry.io/otel/exporters/stdout/stdouttrace` exporter causes the exporter to correctly omit timestamps. (#2195) - Fixed typos in resources.go. (#2201) ## [1.0.0-RC2] - 2021-07-26 ### Added - Added `WithOSDescription` resource configuration option to set OS (Operating System) description resource attribute (`os.description`). (#1840) - Added `WithOS` resource configuration option to set all OS (Operating System) resource attributes at once. (#1840) - Added the `WithRetry` option to the `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp` package. This option is a replacement for the removed `WithMaxAttempts` and `WithBackoff` options. (#2095) - Added API `LinkFromContext` to return Link which encapsulates SpanContext from provided context and also encapsulates attributes. (#2115) - Added a new `Link` type under the SDK `otel/sdk/trace` package that counts the number of attributes that were dropped for surpassing the `AttributePerLinkCountLimit` configured in the Span's `SpanLimits`. This new type replaces the equal-named API `Link` type found in the `otel/trace` package for most usages within the SDK. For example, instances of this type are now returned by the `Links()` function of `ReadOnlySpan`s provided in places like the `OnEnd` function of `SpanProcessor` implementations. (#2118) - Added the `SpanRecorder` type to the `go.opentelemetry.io/otel/skd/trace/tracetest` package. This type can be used with the default SDK as a `SpanProcessor` during testing. (#2132) ### Changed - The `SpanModels` function is now exported from the `go.opentelemetry.io/otel/exporters/zipkin` package to convert OpenTelemetry spans into Zipkin model spans. (#2027) - Rename the `"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc".RetrySettings` to `RetryConfig`. (#2095) ### Deprecated - The `TextMapCarrier` and `TextMapPropagator` from the `go.opentelemetry.io/otel/oteltest` package and their associated creation functions (`TextMapCarrier`, `NewTextMapPropagator`) are deprecated. (#2114) - The `Harness` type from the `go.opentelemetry.io/otel/oteltest` package and its associated creation function, `NewHarness` are deprecated and will be removed in the next release. (#2123) - The `TraceStateFromKeyValues` function from the `go.opentelemetry.io/otel/oteltest` package is deprecated. Use the `trace.ParseTraceState` function instead. (#2122) ### Removed - Removed the deprecated package `go.opentelemetry.io/otel/exporters/trace/jaeger`. (#2020) - Removed the deprecated package `go.opentelemetry.io/otel/exporters/trace/zipkin`. (#2020) - Removed the `"go.opentelemetry.io/otel/sdk/resource".WithBuiltinDetectors` function. The explicit `With*` options for every built-in detector should be used instead. (#2026 #2097) - Removed the `WithMaxAttempts` and `WithBackoff` options from the `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp` package. The retry logic of the package has been updated to match the `otlptracegrpc` package and accordingly a `WithRetry` option is added that should be used instead. (#2095) - Removed `DroppedAttributeCount` field from `otel/trace.Link` struct. (#2118) ### Fixed - When using WithNewRoot, don't use the parent context for making sampling decisions. (#2032) - `oteltest.Tracer` now creates a valid `SpanContext` when using `WithNewRoot`. (#2073) - OS type detector now sets the correct `dragonflybsd` value for DragonFly BSD. (#2092) - The OTel span status is correctly transformed into the OTLP status in the `go.opentelemetry.io/otel/exporters/otlp/otlptrace` package. This fix will by default set the status to `Unset` if it is not explicitly set to `Ok` or `Error`. (#2099 #2102) - The `Inject` method for the `"go.opentelemetry.io/otel/propagation".TraceContext` type no longer injects empty `tracestate` values. (#2108) - Use `6831` as default Jaeger agent port instead of `6832`. (#2131) ## [Experimental Metrics v0.22.0] - 2021-07-19 ### Added - Adds HTTP support for OTLP metrics exporter. (#2022) ### Removed - Removed the deprecated package `go.opentelemetry.io/otel/exporters/metric/prometheus`. (#2020) ## [1.0.0-RC1] / 0.21.0 - 2021-06-18 With this release we are introducing a split in module versions. The tracing API and SDK are entering the `v1.0.0` Release Candidate phase with `v1.0.0-RC1` while the experimental metrics API and SDK continue with `v0.x` releases at `v0.21.0`. Modules at major version 1 or greater will not depend on modules with major version 0. ### Added - Adds `otlpgrpc.WithRetry`option for configuring the retry policy for transient errors on the otlp/gRPC exporter. (#1832) - The following status codes are defined as transient errors: | gRPC Status Code | Description | | ---------------- | ----------- | | 1 | Cancelled | | 4 | Deadline Exceeded | | 8 | Resource Exhausted | | 10 | Aborted | | 10 | Out of Range | | 14 | Unavailable | | 15 | Data Loss | - Added `Status` type to the `go.opentelemetry.io/otel/sdk/trace` package to represent the status of a span. (#1874) - Added `SpanStub` type and its associated functions to the `go.opentelemetry.io/otel/sdk/trace/tracetest` package. This type can be used as a testing replacement for the `SpanSnapshot` that was removed from the `go.opentelemetry.io/otel/sdk/trace` package. (#1873) - Adds support for scheme in `OTEL_EXPORTER_OTLP_ENDPOINT` according to the spec. (#1886) - Adds `trace.WithSchemaURL` option for configuring the tracer with a Schema URL. (#1889) - Added an example of using OpenTelemetry Go as a trace context forwarder. (#1912) - `ParseTraceState` is added to the `go.opentelemetry.io/otel/trace` package. It can be used to decode a `TraceState` from a `tracestate` header string value. (#1937) - Added `Len` method to the `TraceState` type in the `go.opentelemetry.io/otel/trace` package. This method returns the number of list-members the `TraceState` holds. (#1937) - Creates package `go.opentelemetry.io/otel/exporters/otlp/otlptrace` that defines a trace exporter that uses a `otlptrace.Client` to send data. Creates package `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc` implementing a gRPC `otlptrace.Client` and offers convenience functions, `NewExportPipeline` and `InstallNewPipeline`, to setup and install a `otlptrace.Exporter` in tracing .(#1922) - Added `Baggage`, `Member`, and `Property` types to the `go.opentelemetry.io/otel/baggage` package along with their related functions. (#1967) - Added `ContextWithBaggage`, `ContextWithoutBaggage`, and `FromContext` functions to the `go.opentelemetry.io/otel/baggage` package. These functions replace the `Set`, `Value`, `ContextWithValue`, `ContextWithoutValue`, and `ContextWithEmpty` functions from that package and directly work with the new `Baggage` type. (#1967) - The `OTEL_SERVICE_NAME` environment variable is the preferred source for `service.name`, used by the environment resource detector if a service name is present both there and in `OTEL_RESOURCE_ATTRIBUTES`. (#1969) - Creates package `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp` implementing an HTTP `otlptrace.Client` and offers convenience functions, `NewExportPipeline` and `InstallNewPipeline`, to setup and install a `otlptrace.Exporter` in tracing. (#1963) - Changes `go.opentelemetry.io/otel/sdk/resource.NewWithAttributes` to require a schema URL. The old function is still available as `resource.NewSchemaless`. This is a breaking change. (#1938) - Several builtin resource detectors now correctly populate the schema URL. (#1938) - Creates package `go.opentelemetry.io/otel/exporters/otlp/otlpmetric` that defines a metrics exporter that uses a `otlpmetric.Client` to send data. - Creates package `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` implementing a gRPC `otlpmetric.Client` and offers convenience functions, `New` and `NewUnstarted`, to create an `otlpmetric.Exporter`.(#1991) - Added `go.opentelemetry.io/otel/exporters/stdout/stdouttrace` exporter. (#2005) - Added `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric` exporter. (#2005) - Added a `TracerProvider()` method to the `"go.opentelemetry.io/otel/trace".Span` interface. This can be used to obtain a `TracerProvider` from a given span that utilizes the same trace processing pipeline. (#2009) ### Changed - Make `NewSplitDriver` from `go.opentelemetry.io/otel/exporters/otlp` take variadic arguments instead of a `SplitConfig` item. `NewSplitDriver` now automatically implements an internal `noopDriver` for `SplitConfig` fields that are not initialized. (#1798) - `resource.New()` now creates a Resource without builtin detectors. Previous behavior is now achieved by using `WithBuiltinDetectors` Option. (#1810) - Move the `Event` type from the `go.opentelemetry.io/otel` package to the `go.opentelemetry.io/otel/sdk/trace` package. (#1846) - CI builds validate against last two versions of Go, dropping 1.14 and adding 1.16. (#1865) - BatchSpanProcessor now report export failures when calling `ForceFlush()` method. (#1860) - `Set.Encoded(Encoder)` no longer caches the result of an encoding. (#1855) - Renamed `CloudZoneKey` to `CloudAvailabilityZoneKey` in Resource semantic conventions according to spec. (#1871) - The `StatusCode` and `StatusMessage` methods of the `ReadOnlySpan` interface and the `Span` produced by the `go.opentelemetry.io/otel/sdk/trace` package have been replaced with a single `Status` method. This method returns the status of a span using the new `Status` type. (#1874) - Updated `ExportSpans` method of the`SpanExporter` interface type to accept `ReadOnlySpan`s instead of the removed `SpanSnapshot`. This brings the export interface into compliance with the specification in that it now accepts an explicitly immutable type instead of just an implied one. (#1873) - Unembed `SpanContext` in `Link`. (#1877) - Generate Semantic conventions from the specification YAML. (#1891) - Spans created by the global `Tracer` obtained from `go.opentelemetry.io/otel`, prior to a functioning `TracerProvider` being set, now propagate the span context from their parent if one exists. (#1901) - The `"go.opentelemetry.io/otel".Tracer` function now accepts tracer options. (#1902) - Move the `go.opentelemetry.io/otel/unit` package to `go.opentelemetry.io/otel/metric/unit`. (#1903) - Changed `go.opentelemetry.io/otel/trace.TracerConfig` to conform to the [Contributing guidelines](CONTRIBUTING.md#config.) (#1921) - Changed `go.opentelemetry.io/otel/trace.SpanConfig` to conform to the [Contributing guidelines](CONTRIBUTING.md#config). (#1921) - Changed `span.End()` now only accepts Options that are allowed at `End()`. (#1921) - Changed `go.opentelemetry.io/otel/metric.InstrumentConfig` to conform to the [Contributing guidelines](CONTRIBUTING.md#config). (#1921) - Changed `go.opentelemetry.io/otel/metric.MeterConfig` to conform to the [Contributing guidelines](CONTRIBUTING.md#config). (#1921) - Refactored option types according to the contribution style guide. (#1882) - Move the `go.opentelemetry.io/otel/trace.TraceStateFromKeyValues` function to the `go.opentelemetry.io/otel/oteltest` package. This function is preserved for testing purposes where it may be useful to create a `TraceState` from `attribute.KeyValue`s, but it is not intended for production use. The new `ParseTraceState` function should be used to create a `TraceState`. (#1931) - Updated `MarshalJSON` method of the `go.opentelemetry.io/otel/trace.TraceState` type to marshal the type into the string representation of the `TraceState`. (#1931) - The `TraceState.Delete` method from the `go.opentelemetry.io/otel/trace` package no longer returns an error in addition to a `TraceState`. (#1931) - Updated `Get` method of the `TraceState` type from the `go.opentelemetry.io/otel/trace` package to accept a `string` instead of an `attribute.Key` type. (#1931) - Updated `Insert` method of the `TraceState` type from the `go.opentelemetry.io/otel/trace` package to accept a pair of `string`s instead of an `attribute.KeyValue` type. (#1931) - Updated `Delete` method of the `TraceState` type from the `go.opentelemetry.io/otel/trace` package to accept a `string` instead of an `attribute.Key` type. (#1931) - Renamed `NewExporter` to `New` in the `go.opentelemetry.io/otel/exporters/stdout` package. (#1985) - Renamed `NewExporter` to `New` in the `go.opentelemetry.io/otel/exporters/metric/prometheus` package. (#1985) - Renamed `NewExporter` to `New` in the `go.opentelemetry.io/otel/exporters/trace/jaeger` package. (#1985) - Renamed `NewExporter` to `New` in the `go.opentelemetry.io/otel/exporters/trace/zipkin` package. (#1985) - Renamed `NewExporter` to `New` in the `go.opentelemetry.io/otel/exporters/otlp` package. (#1985) - Renamed `NewUnstartedExporter` to `NewUnstarted` in the `go.opentelemetry.io/otel/exporters/otlp` package. (#1985) - The `go.opentelemetry.io/otel/semconv` package has been moved to `go.opentelemetry.io/otel/semconv/v1.4.0` to allow for multiple [telemetry schema](https://github.com/open-telemetry/oteps/blob/main/text/0152-telemetry-schemas.md) versions to be used concurrently. (#1987) - Metrics test helpers in `go.opentelemetry.io/otel/oteltest` have been moved to `go.opentelemetry.io/otel/metric/metrictest`. (#1988) ### Deprecated - The `go.opentelemetry.io/otel/exporters/metric/prometheus` is deprecated, use `go.opentelemetry.io/otel/exporters/prometheus` instead. (#1993) - The `go.opentelemetry.io/otel/exporters/trace/jaeger` is deprecated, use `go.opentelemetry.io/otel/exporters/jaeger` instead. (#1993) - The `go.opentelemetry.io/otel/exporters/trace/zipkin` is deprecated, use `go.opentelemetry.io/otel/exporters/zipkin` instead. (#1993) ### Removed - Removed `resource.WithoutBuiltin()`. Use `resource.New()`. (#1810) - Unexported types `resource.FromEnv`, `resource.Host`, and `resource.TelemetrySDK`, Use the corresponding `With*()` to use individually. (#1810) - Removed the `Tracer` and `IsRecording` method from the `ReadOnlySpan` in the `go.opentelemetry.io/otel/sdk/trace`. The `Tracer` method is not a required to be included in this interface and given the mutable nature of the tracer that is associated with a span, this method is not appropriate. The `IsRecording` method returns if the span is recording or not. A read-only span value does not need to know if updates to it will be recorded or not. By definition, it cannot be updated so there is no point in communicating if an update is recorded. (#1873) - Removed the `SpanSnapshot` type from the `go.opentelemetry.io/otel/sdk/trace` package. The use of this type has been replaced with the use of the explicitly immutable `ReadOnlySpan` type. When a concrete representation of a read-only span is needed for testing, the newly added `SpanStub` in the `go.opentelemetry.io/otel/sdk/trace/tracetest` package should be used. (#1873) - Removed the `Tracer` method from the `Span` interface in the `go.opentelemetry.io/otel/trace` package. Using the same tracer that created a span introduces the error where an instrumentation library's `Tracer` is used by other code instead of their own. The `"go.opentelemetry.io/otel".Tracer` function or a `TracerProvider` should be used to acquire a library specific `Tracer` instead. (#1900) - The `TracerProvider()` method on the `Span` interface may also be used to obtain a `TracerProvider` using the same trace processing pipeline. (#2009) - The `http.url` attribute generated by `HTTPClientAttributesFromHTTPRequest` will no longer include username or password information. (#1919) - Removed `IsEmpty` method of the `TraceState` type in the `go.opentelemetry.io/otel/trace` package in favor of using the added `TraceState.Len` method. (#1931) - Removed `Set`, `Value`, `ContextWithValue`, `ContextWithoutValue`, and `ContextWithEmpty` functions in the `go.opentelemetry.io/otel/baggage` package. Handling of baggage is now done using the added `Baggage` type and related context functions (`ContextWithBaggage`, `ContextWithoutBaggage`, and `FromContext`) in that package. (#1967) - The `InstallNewPipeline` and `NewExportPipeline` creation functions in all the exporters (prometheus, otlp, stdout, jaeger, and zipkin) have been removed. These functions were deemed premature attempts to provide convenience that did not achieve this aim. (#1985) - The `go.opentelemetry.io/otel/exporters/otlp` exporter has been removed. Use `go.opentelemetry.io/otel/exporters/otlp/otlptrace` instead. (#1990) - The `go.opentelemetry.io/otel/exporters/stdout` exporter has been removed. Use `go.opentelemetry.io/otel/exporters/stdout/stdouttrace` or `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric` instead. (#2005) ### Fixed - Only report errors from the `"go.opentelemetry.io/otel/sdk/resource".Environment` function when they are not `nil`. (#1850, #1851) - The `Shutdown` method of the simple `SpanProcessor` in the `go.opentelemetry.io/otel/sdk/trace` package now honors the context deadline or cancellation. (#1616, #1856) - BatchSpanProcessor now drops span batches that failed to be exported. (#1860) - Use `http://localhost:14268/api/traces` as default Jaeger collector endpoint instead of `http://localhost:14250`. (#1898) - Allow trailing and leading whitespace in the parsing of a `tracestate` header. (#1931) - Add logic to determine if the channel is closed to fix Jaeger exporter test panic with close closed channel. (#1870, #1973) - Avoid transport security when OTLP endpoint is a Unix socket. (#2001) ### Security ## [0.20.0] - 2021-04-23 ### Added - The OTLP exporter now has two new convenience functions, `NewExportPipeline` and `InstallNewPipeline`, setup and install the exporter in tracing and metrics pipelines. (#1373) - Adds semantic conventions for exceptions. (#1492) - Added Jaeger Environment variables: `OTEL_EXPORTER_JAEGER_AGENT_HOST`, `OTEL_EXPORTER_JAEGER_AGENT_PORT` These environment variables can be used to override Jaeger agent hostname and port (#1752) - Option `ExportTimeout` was added to batch span processor. (#1755) - `trace.TraceFlags` is now a defined type over `byte` and `WithSampled(bool) TraceFlags` and `IsSampled() bool` methods have been added to it. (#1770) - The `Event` and `Link` struct types from the `go.opentelemetry.io/otel` package now include a `DroppedAttributeCount` field to record the number of attributes that were not recorded due to configured limits being reached. (#1771) - The Jaeger exporter now reports dropped attributes for a Span event in the exported log. (#1771) - Adds test to check BatchSpanProcessor ignores `OnEnd` and `ForceFlush` post `Shutdown`. (#1772) - Extract resource attributes from the `OTEL_RESOURCE_ATTRIBUTES` environment variable and merge them with the `resource.Default` resource as well as resources provided to the `TracerProvider` and metric `Controller`. (#1785) - Added `WithOSType` resource configuration option to set OS (Operating System) type resource attribute (`os.type`). (#1788) - Added `WithProcess*` resource configuration options to set Process resource attributes. (#1788) - `process.pid` - `process.executable.name` - `process.executable.path` - `process.command_args` - `process.owner` - `process.runtime.name` - `process.runtime.version` - `process.runtime.description` - Adds `k8s.node.name` and `k8s.node.uid` attribute keys to the `semconv` package. (#1789) - Added support for configuring OTLP/HTTP and OTLP/gRPC Endpoints, TLS Certificates, Headers, Compression and Timeout via Environment Variables. (#1758, #1769 and #1811) - `OTEL_EXPORTER_OTLP_ENDPOINT` - `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` - `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` - `OTEL_EXPORTER_OTLP_HEADERS` - `OTEL_EXPORTER_OTLP_TRACES_HEADERS` - `OTEL_EXPORTER_OTLP_METRICS_HEADERS` - `OTEL_EXPORTER_OTLP_COMPRESSION` - `OTEL_EXPORTER_OTLP_TRACES_COMPRESSION` - `OTEL_EXPORTER_OTLP_METRICS_COMPRESSION` - `OTEL_EXPORTER_OTLP_TIMEOUT` - `OTEL_EXPORTER_OTLP_TRACES_TIMEOUT` - `OTEL_EXPORTER_OTLP_METRICS_TIMEOUT` - `OTEL_EXPORTER_OTLP_CERTIFICATE` - `OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE` - `OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE` - Adds `otlpgrpc.WithTimeout` option for configuring timeout to the otlp/gRPC exporter. (#1821) - Adds `jaeger.WithMaxPacketSize` option for configuring maximum UDP packet size used when connecting to the Jaeger agent. (#1853) ### Fixed - The `Span.IsRecording` implementation from `go.opentelemetry.io/otel/sdk/trace` always returns false when not being sampled. (#1750) - The Jaeger exporter now correctly sets tags for the Span status code and message. This means it uses the correct tag keys (`"otel.status_code"`, `"otel.status_description"`) and does not set the status message as a tag unless it is set on the span. (#1761) - The Jaeger exporter now correctly records Span event's names using the `"event"` key for a tag. Additionally, this tag is overridden, as specified in the OTel specification, if the event contains an attribute with that key. (#1768) - Zipkin Exporter: Ensure mapping between OTel and Zipkin span data complies with the specification. (#1688) - Fixed typo for default service name in Jaeger Exporter. (#1797) - Fix flaky OTLP for the reconnnection of the client connection. (#1527, #1814) - Fix Jaeger exporter dropping of span batches that exceed the UDP packet size limit. Instead, the exporter now splits the batch into smaller sendable batches. (#1828) ### Changed - Span `RecordError` now records an `exception` event to comply with the semantic convention specification. (#1492) - Jaeger exporter was updated to use thrift v0.14.1. (#1712) - Migrate from using internally built and maintained version of the OTLP to the one hosted at `go.opentelemetry.io/proto/otlp`. (#1713) - Migrate from using `github.com/gogo/protobuf` to `google.golang.org/protobuf` to match `go.opentelemetry.io/proto/otlp`. (#1713) - The storage of a local or remote Span in a `context.Context` using its SpanContext is unified to store just the current Span. The Span's SpanContext can now self-identify as being remote or not. This means that `"go.opentelemetry.io/otel/trace".ContextWithRemoteSpanContext` will now overwrite any existing current Span, not just existing remote Spans, and make it the current Span in a `context.Context`. (#1731) - Improve OTLP/gRPC exporter connection errors. (#1737) - Information about a parent span context in a `"go.opentelemetry.io/otel/export/trace".SpanSnapshot` is unified in a new `Parent` field. The existing `ParentSpanID` and `HasRemoteParent` fields are removed in favor of this. (#1748) - The `ParentContext` field of the `"go.opentelemetry.io/otel/sdk/trace".SamplingParameters` is updated to hold a `context.Context` containing the parent span. This changes it to make `SamplingParameters` conform with the OpenTelemetry specification. (#1749) - Updated Jaeger Environment Variables: `JAEGER_ENDPOINT`, `JAEGER_USER`, `JAEGER_PASSWORD` to `OTEL_EXPORTER_JAEGER_ENDPOINT`, `OTEL_EXPORTER_JAEGER_USER`, `OTEL_EXPORTER_JAEGER_PASSWORD` in compliance with OTel specification. (#1752) - Modify `BatchSpanProcessor.ForceFlush` to abort after timeout/cancellation. (#1757) - The `DroppedAttributeCount` field of the `Span` in the `go.opentelemetry.io/otel` package now only represents the number of attributes dropped for the span itself. It no longer is a conglomerate of itself, events, and link attributes that have been dropped. (#1771) - Make `ExportSpans` in Jaeger Exporter honor context deadline. (#1773) - Modify Zipkin Exporter default service name, use default resource's serviceName instead of empty. (#1777) - The `go.opentelemetry.io/otel/sdk/export/trace` package is merged into the `go.opentelemetry.io/otel/sdk/trace` package. (#1778) - The prometheus.InstallNewPipeline example is moved from comment to example test (#1796) - The convenience functions for the stdout exporter have been updated to return the `TracerProvider` implementation and enable the shutdown of the exporter. (#1800) - Replace the flush function returned from the Jaeger exporter's convenience creation functions (`InstallNewPipeline` and `NewExportPipeline`) with the `TracerProvider` implementation they create. This enables the caller to shutdown and flush using the related `TracerProvider` methods. (#1822) - Updated the Jaeger exporter to have a default endpoint, `http://localhost:14250`, for the collector. (#1824) - Changed the function `WithCollectorEndpoint` in the Jaeger exporter to no longer accept an endpoint as an argument. The endpoint can be passed with the `CollectorEndpointOption` using the `WithEndpoint` function or by setting the `OTEL_EXPORTER_JAEGER_ENDPOINT` environment variable value appropriately. (#1824) - The Jaeger exporter no longer batches exported spans itself, instead it relies on the SDK's `BatchSpanProcessor` for this functionality. (#1830) - The Jaeger exporter creation functions (`NewRawExporter`, `NewExportPipeline`, and `InstallNewPipeline`) no longer accept the removed `Option` type as a variadic argument. (#1830) ### Removed - Removed Jaeger Environment variables: `JAEGER_SERVICE_NAME`, `JAEGER_DISABLED`, `JAEGER_TAGS` These environment variables will no longer be used to override values of the Jaeger exporter (#1752) - No longer set the links for a `Span` in `go.opentelemetry.io/otel/sdk/trace` that is configured to be a new root. This is unspecified behavior that the OpenTelemetry community plans to standardize in the future. To prevent backwards incompatible changes when it is specified, these links are removed. (#1726) - Setting error status while recording error with Span from oteltest package. (#1729) - The concept of a remote and local Span stored in a context is unified to just the current Span. Because of this `"go.opentelemetry.io/otel/trace".RemoteSpanContextFromContext` is removed as it is no longer needed. Instead, `"go.opentelemetry.io/otel/trace".SpanContextFromContext` can be used to return the current Span. If needed, that Span's `SpanContext.IsRemote()` can then be used to determine if it is remote or not. (#1731) - The `HasRemoteParent` field of the `"go.opentelemetry.io/otel/sdk/trace".SamplingParameters` is removed. This field is redundant to the information returned from the `Remote` method of the `SpanContext` held in the `ParentContext` field. (#1749) - The `trace.FlagsDebug` and `trace.FlagsDeferred` constants have been removed and will be localized to the B3 propagator. (#1770) - Remove `Process` configuration, `WithProcessFromEnv` and `ProcessFromEnv`, and type from the Jaeger exporter package. The information that could be configured in the `Process` struct should be configured in a `Resource` instead. (#1776, #1804) - Remove the `WithDisabled` option from the Jaeger exporter. To disable the exporter unregister it from the `TracerProvider` or use a no-operation `TracerProvider`. (#1806) - Removed the functions `CollectorEndpointFromEnv` and `WithCollectorEndpointOptionFromEnv` from the Jaeger exporter. These functions for retrieving specific environment variable values are redundant of other internal functions and are not intended for end user use. (#1824) - Removed the Jaeger exporter `WithSDKOptions` `Option`. This option was used to set SDK options for the exporter creation convenience functions. These functions are provided as a way to easily setup or install the exporter with what are deemed reasonable SDK settings for common use cases. If the SDK needs to be configured differently, the `NewRawExporter` function and direct setup of the SDK with the desired settings should be used. (#1825) - The `WithBufferMaxCount` and `WithBatchMaxCount` `Option`s from the Jaeger exporter are removed. The exporter no longer batches exports, instead relying on the SDK's `BatchSpanProcessor` for this functionality. (#1830) - The Jaeger exporter `Option` type is removed. The type is no longer used by the exporter to configure anything. All the previous configurations these options provided were duplicates of SDK configuration. They have been removed in favor of using the SDK configuration and focuses the exporter configuration to be only about the endpoints it will send telemetry to. (#1830) ## [0.19.0] - 2021-03-18 ### Added - Added `Marshaler` config option to `otlphttp` to enable otlp over json or protobufs. (#1586) - A `ForceFlush` method to the `"go.opentelemetry.io/otel/sdk/trace".TracerProvider` to flush all registered `SpanProcessor`s. (#1608) - Added `WithSampler` and `WithSpanLimits` to tracer provider. (#1633, #1702) - `"go.opentelemetry.io/otel/trace".SpanContext` now has a `remote` property, and `IsRemote()` predicate, that is true when the `SpanContext` has been extracted from remote context data. (#1701) - A `Valid` method to the `"go.opentelemetry.io/otel/attribute".KeyValue` type. (#1703) ### Changed - `trace.SpanContext` is now immutable and has no exported fields. (#1573) - `trace.NewSpanContext()` can be used in conjunction with the `trace.SpanContextConfig` struct to initialize a new `SpanContext` where all values are known. - Update the `ForceFlush` method signature to the `"go.opentelemetry.io/otel/sdk/trace".SpanProcessor` to accept a `context.Context` and return an error. (#1608) - Update the `Shutdown` method to the `"go.opentelemetry.io/otel/sdk/trace".TracerProvider` return an error on shutdown failure. (#1608) - The SimpleSpanProcessor will now shut down the enclosed `SpanExporter` and gracefully ignore subsequent calls to `OnEnd` after `Shutdown` is called. (#1612) - `"go.opentelemetry.io/sdk/metric/controller.basic".WithPusher` is replaced with `WithExporter` to provide consistent naming across project. (#1656) - Added non-empty string check for trace `Attribute` keys. (#1659) - Add `description` to SpanStatus only when `StatusCode` is set to error. (#1662) - Jaeger exporter falls back to `resource.Default`'s `service.name` if the exported Span does not have one. (#1673) - Jaeger exporter populates Jaeger's Span Process from Resource. (#1673) - Renamed the `LabelSet` method of `"go.opentelemetry.io/otel/sdk/resource".Resource` to `Set`. (#1692) - Changed `WithSDK` to `WithSDKOptions` to accept variadic arguments of `TracerProviderOption` type in `go.opentelemetry.io/otel/exporters/trace/jaeger` package. (#1693) - Changed `WithSDK` to `WithSDKOptions` to accept variadic arguments of `TracerProviderOption` type in `go.opentelemetry.io/otel/exporters/trace/zipkin` package. (#1693) ### Removed - Removed `serviceName` parameter from Zipkin exporter and uses resource instead. (#1549) - Removed `WithConfig` from tracer provider to avoid overriding configuration. (#1633) - Removed the exported `SimpleSpanProcessor` and `BatchSpanProcessor` structs. These are now returned as a SpanProcessor interface from their respective constructors. (#1638) - Removed `WithRecord()` from `trace.SpanOption` when creating a span. (#1660) - Removed setting status to `Error` while recording an error as a span event in `RecordError`. (#1663) - Removed `jaeger.WithProcess` configuration option. (#1673) - Removed `ApplyConfig` method from `"go.opentelemetry.io/otel/sdk/trace".TracerProvider` and the now unneeded `Config` struct. (#1693) ### Fixed - Jaeger Exporter: Ensure mapping between OTEL and Jaeger span data complies with the specification. (#1626) - `SamplingResult.TraceState` is correctly propagated to a newly created span's `SpanContext`. (#1655) - The `otel-collector` example now correctly flushes metric events prior to shutting down the exporter. (#1678) - Do not set span status message in `SpanStatusFromHTTPStatusCode` if it can be inferred from `http.status_code`. (#1681) - Synchronization issues in global trace delegate implementation. (#1686) - Reduced excess memory usage by global `TracerProvider`. (#1687) ## [0.18.0] - 2021-03-03 ### Added - Added `resource.Default()` for use with meter and tracer providers. (#1507) - `AttributePerEventCountLimit` and `AttributePerLinkCountLimit` for `SpanLimits`. (#1535) - Added `Keys()` method to `propagation.TextMapCarrier` and `propagation.HeaderCarrier` to adapt `http.Header` to this interface. (#1544) - Added `code` attributes to `go.opentelemetry.io/otel/semconv` package. (#1558) - Compatibility testing suite in the CI system for the following systems. (#1567) | OS | Go Version | Architecture | | ------- | ---------- | ------------ | | Ubuntu | 1.15 | amd64 | | Ubuntu | 1.14 | amd64 | | Ubuntu | 1.15 | 386 | | Ubuntu | 1.14 | 386 | | MacOS | 1.15 | amd64 | | MacOS | 1.14 | amd64 | | Windows | 1.15 | amd64 | | Windows | 1.14 | amd64 | | Windows | 1.15 | 386 | | Windows | 1.14 | 386 | ### Changed - Replaced interface `oteltest.SpanRecorder` with its existing implementation `StandardSpanRecorder`. (#1542) - Default span limit values to 128. (#1535) - Rename `MaxEventsPerSpan`, `MaxAttributesPerSpan` and `MaxLinksPerSpan` to `EventCountLimit`, `AttributeCountLimit` and `LinkCountLimit`, and move these fields into `SpanLimits`. (#1535) - Renamed the `otel/label` package to `otel/attribute`. (#1541) - Vendor the Jaeger exporter's dependency on Apache Thrift. (#1551) - Parallelize the CI linting and testing. (#1567) - Stagger timestamps in exact aggregator tests. (#1569) - Changed all examples to use `WithBatchTimeout(5 * time.Second)` rather than `WithBatchTimeout(5)`. (#1621) - Prevent end-users from implementing some interfaces (#1575) ``` "otel/exporters/otlp/otlphttp".Option "otel/exporters/stdout".Option "otel/oteltest".Option "otel/trace".TracerOption "otel/trace".SpanOption "otel/trace".EventOption "otel/trace".LifeCycleOption "otel/trace".InstrumentationOption "otel/sdk/resource".Option "otel/sdk/trace".ParentBasedSamplerOption "otel/sdk/trace".ReadOnlySpan "otel/sdk/trace".ReadWriteSpan ``` ### Removed - Removed attempt to resample spans upon changing the span name with `span.SetName()`. (#1545) - The `test-benchmark` is no longer a dependency of the `precommit` make target. (#1567) - Removed the `test-386` make target. This was replaced with a full compatibility testing suite (i.e. multi OS/arch) in the CI system. (#1567) ### Fixed - The sequential timing check of timestamps in the stdout exporter are now setup explicitly to be sequential (#1571). (#1572) - Windows build of Jaeger tests now compiles with OS specific functions (#1576). (#1577) - The sequential timing check of timestamps of go.opentelemetry.io/otel/sdk/metric/aggregator/lastvalue are now setup explicitly to be sequential (#1578). (#1579) - Validate tracestate header keys with vendors according to the W3C TraceContext specification (#1475). (#1581) - The OTLP exporter includes related labels for translations of a GaugeArray (#1563). (#1570) ## [0.17.0] - 2021-02-12 ### Changed - Rename project default branch from `master` to `main`. (#1505) - Reverse order in which `Resource` attributes are merged, per change in spec. (#1501) - Add tooling to maintain "replace" directives in go.mod files automatically. (#1528) - Create new modules: otel/metric, otel/trace, otel/oteltest, otel/sdk/export/metric, otel/sdk/metric (#1528) - Move metric-related public global APIs from otel to otel/metric/global. (#1528) ## Fixed - Fixed otlpgrpc reconnection issue. - The example code in the README.md of `go.opentelemetry.io/otel/exporters/otlp` is moved to a compiled example test and used the new `WithAddress` instead of `WithEndpoint`. (#1513) - The otel-collector example now uses the default OTLP receiver port of the collector. ## [0.16.0] - 2021-01-13 ### Added - Add the `ReadOnlySpan` and `ReadWriteSpan` interfaces to provide better control for accessing span data. (#1360) - `NewGRPCDriver` function returns a `ProtocolDriver` that maintains a single gRPC connection to the collector. (#1369) - Added documentation about the project's versioning policy. (#1388) - Added `NewSplitDriver` for OTLP exporter that allows sending traces and metrics to different endpoints. (#1418) - Added codeql workflow to GitHub Actions (#1428) - Added Gosec workflow to GitHub Actions (#1429) - Add new HTTP driver for OTLP exporter in `exporters/otlp/otlphttp`. Currently it only supports the binary protobuf payloads. (#1420) - Add an OpenCensus exporter bridge. (#1444) ### Changed - Rename `internal/testing` to `internal/internaltest`. (#1449) - Rename `export.SpanData` to `export.SpanSnapshot` and use it only for exporting spans. (#1360) - Store the parent's full `SpanContext` rather than just its span ID in the `span` struct. (#1360) - Improve span duration accuracy. (#1360) - Migrated CI/CD from CircleCI to GitHub Actions (#1382) - Remove duplicate checkout from GitHub Actions workflow (#1407) - Metric `array` aggregator renamed `exact` to match its `aggregation.Kind` (#1412) - Metric `exact` aggregator includes per-point timestamps (#1412) - Metric stdout exporter uses MinMaxSumCount aggregator for ValueRecorder instruments (#1412) - `NewExporter` from `exporters/otlp` now takes a `ProtocolDriver` as a parameter. (#1369) - Many OTLP Exporter options became gRPC ProtocolDriver options. (#1369) - Unify endpoint API that related to OTel exporter. (#1401) - Optimize metric histogram aggregator to reuse its slice of buckets. (#1435) - Metric aggregator Count() and histogram Bucket.Counts are consistently `uint64`. (1430) - Histogram aggregator accepts functional options, uses default boundaries if none given. (#1434) - `SamplingResult` now passed a `Tracestate` from the parent `SpanContext` (#1432) - Moved gRPC driver for OTLP exporter to `exporters/otlp/otlpgrpc`. (#1420) - The `TraceContext` propagator now correctly propagates `TraceState` through the `SpanContext`. (#1447) - Metric Push and Pull Controller components are combined into a single "basic" Controller: - `WithExporter()` and `Start()` to configure Push behavior - `Start()` is optional; use `Collect()` and `ForEach()` for Pull behavior - `Start()` and `Stop()` accept Context. (#1378) - The `Event` type is moved from the `otel/sdk/export/trace` package to the `otel/trace` API package. (#1452) ### Removed - Remove `errUninitializedSpan` as its only usage is now obsolete. (#1360) - Remove Metric export functionality related to quantiles and summary data points: this is not specified (#1412) - Remove DDSketch metric aggregator; our intention is to re-introduce this as an option of the histogram aggregator after [new OTLP histogram data types](https://github.com/open-telemetry/opentelemetry-proto/pull/226) are released (#1412) ### Fixed - `BatchSpanProcessor.Shutdown()` will now shutdown underlying `export.SpanExporter`. (#1443) ## [0.15.0] - 2020-12-10 ### Added - The `WithIDGenerator` `TracerProviderOption` is added to the `go.opentelemetry.io/otel/trace` package to configure an `IDGenerator` for the `TracerProvider`. (#1363) ### Changed - The Zipkin exporter now uses the Span status code to determine. (#1328) - `NewExporter` and `Start` functions in `go.opentelemetry.io/otel/exporters/otlp` now receive `context.Context` as a first parameter. (#1357) - Move the OpenCensus example into `example` directory. (#1359) - Moved the SDK's `internal.IDGenerator` interface in to the `sdk/trace` package to enable support for externally-defined ID generators. (#1363) - Bump `github.com/google/go-cmp` from 0.5.3 to 0.5.4 (#1374) - Bump `github.com/golangci/golangci-lint` in `/internal/tools` (#1375) ### Fixed - Metric SDK `SumObserver` and `UpDownSumObserver` instruments correctness fixes. (#1381) ## [0.14.0] - 2020-11-19 ### Added - An `EventOption` and the related `NewEventConfig` function are added to the `go.opentelemetry.io/otel` package to configure Span events. (#1254) - A `TextMapPropagator` and associated `TextMapCarrier` are added to the `go.opentelemetry.io/otel/oteltest` package to test `TextMap` type propagators and their use. (#1259) - `SpanContextFromContext` returns `SpanContext` from context. (#1255) - `TraceState` has been added to `SpanContext`. (#1340) - `DeploymentEnvironmentKey` added to `go.opentelemetry.io/otel/semconv` package. (#1323) - Add an OpenCensus to OpenTelemetry tracing bridge. (#1305) - Add a parent context argument to `SpanProcessor.OnStart` to follow the specification. (#1333) - Add missing tests for `sdk/trace/attributes_map.go`. (#1337) ### Changed - Move the `go.opentelemetry.io/otel/api/trace` package into `go.opentelemetry.io/otel/trace` with the following changes. (#1229) (#1307) - `ID` has been renamed to `TraceID`. - `IDFromHex` has been renamed to `TraceIDFromHex`. - `EmptySpanContext` is removed. - Move the `go.opentelemetry.io/otel/api/trace/tracetest` package into `go.opentelemetry.io/otel/oteltest`. (#1229) - OTLP Exporter updates: - supports OTLP v0.6.0 (#1230, #1354) - supports configurable aggregation temporality (default: Cumulative, optional: Stateless). (#1296) - The Sampler is now called on local child spans. (#1233) - The `Kind` type from the `go.opentelemetry.io/otel/api/metric` package was renamed to `InstrumentKind` to more specifically describe what it is and avoid semantic ambiguity. (#1240) - The `MetricKind` method of the `Descriptor` type in the `go.opentelemetry.io/otel/api/metric` package was renamed to `Descriptor.InstrumentKind`. This matches the returned type and fixes misuse of the term metric. (#1240) - Move test harness from the `go.opentelemetry.io/otel/api/apitest` package into `go.opentelemetry.io/otel/oteltest`. (#1241) - Move the `go.opentelemetry.io/otel/api/metric/metrictest` package into `go.opentelemetry.io/oteltest` as part of #964. (#1252) - Move the `go.opentelemetry.io/otel/api/metric` package into `go.opentelemetry.io/otel/metric` as part of #1303. (#1321) - Move the `go.opentelemetry.io/otel/api/metric/registry` package into `go.opentelemetry.io/otel/metric/registry` as a part of #1303. (#1316) - Move the `Number` type (together with related functions) from `go.opentelemetry.io/otel/api/metric` package into `go.opentelemetry.io/otel/metric/number` as a part of #1303. (#1316) - The function signature of the Span `AddEvent` method in `go.opentelemetry.io/otel` is updated to no longer take an unused context and instead take a required name and a variable number of `EventOption`s. (#1254) - The function signature of the Span `RecordError` method in `go.opentelemetry.io/otel` is updated to no longer take an unused context and instead take a required error value and a variable number of `EventOption`s. (#1254) - Move the `go.opentelemetry.io/otel/api/global` package to `go.opentelemetry.io/otel`. (#1262) (#1330) - Move the `Version` function from `go.opentelemetry.io/otel/sdk` to `go.opentelemetry.io/otel`. (#1330) - Rename correlation context header from `"otcorrelations"` to `"baggage"` to match the OpenTelemetry specification. (#1267) - Fix `Code.UnmarshalJSON` to work with valid JSON only. (#1276) - The `resource.New()` method changes signature to support builtin attributes and functional options, including `telemetry.sdk.*` and `host.name` semantic conventions; the former method is renamed `resource.NewWithAttributes`. (#1235) - The Prometheus exporter now exports non-monotonic counters (i.e. `UpDownCounter`s) as gauges. (#1210) - Correct the `Span.End` method documentation in the `otel` API to state updates are not allowed on a span after it has ended. (#1310) - Updated span collection limits for attribute, event and link counts to 1000 (#1318) - Renamed `semconv.HTTPUrlKey` to `semconv.HTTPURLKey`. (#1338) ### Removed - The `ErrInvalidHexID`, `ErrInvalidTraceIDLength`, `ErrInvalidSpanIDLength`, `ErrInvalidSpanIDLength`, or `ErrNilSpanID` from the `go.opentelemetry.io/otel` package are unexported now. (#1243) - The `AddEventWithTimestamp` method on the `Span` interface in `go.opentelemetry.io/otel` is removed due to its redundancy. It is replaced by using the `AddEvent` method with a `WithTimestamp` option. (#1254) - The `MockSpan` and `MockTracer` types are removed from `go.opentelemetry.io/otel/oteltest`. `Tracer` and `Span` from the same module should be used in their place instead. (#1306) - `WorkerCount` option is removed from `go.opentelemetry.io/otel/exporters/otlp`. (#1350) - Remove the following labels types: INT32, UINT32, UINT64 and FLOAT32. (#1314) ### Fixed - Rename `MergeItererator` to `MergeIterator` in the `go.opentelemetry.io/otel/label` package. (#1244) - The `go.opentelemetry.io/otel/api/global` packages global TextMapPropagator now delegates functionality to a globally set delegate for all previously returned propagators. (#1258) - Fix condition in `label.Any`. (#1299) - Fix global `TracerProvider` to pass options to its configured provider. (#1329) - Fix missing handler for `ExactKind` aggregator in OTLP metrics transformer (#1309) ## [0.13.0] - 2020-10-08 ### Added - OTLP Metric exporter supports Histogram aggregation. (#1209) - The `Code` struct from the `go.opentelemetry.io/otel/codes` package now supports JSON marshaling and unmarshaling as well as implements the `Stringer` interface. (#1214) - A Baggage API to implement the OpenTelemetry specification. (#1217) - Add Shutdown method to sdk/trace/provider, shutdown processors in the order they were registered. (#1227) ### Changed - Set default propagator to no-op propagator. (#1184) - The `HTTPSupplier`, `HTTPExtractor`, `HTTPInjector`, and `HTTPPropagator` from the `go.opentelemetry.io/otel/api/propagation` package were replaced with unified `TextMapCarrier` and `TextMapPropagator` in the `go.opentelemetry.io/otel/propagation` package. (#1212) (#1325) - The `New` function from the `go.opentelemetry.io/otel/api/propagation` package was replaced with `NewCompositeTextMapPropagator` in the `go.opentelemetry.io/otel` package. (#1212) - The status codes of the `go.opentelemetry.io/otel/codes` package have been updated to match the latest OpenTelemetry specification. They now are `Unset`, `Error`, and `Ok`. They no longer track the gRPC codes. (#1214) - The `StatusCode` field of the `SpanData` struct in the `go.opentelemetry.io/otel/sdk/export/trace` package now uses the codes package from this package instead of the gRPC project. (#1214) - Move the `go.opentelemetry.io/otel/api/baggage` package into `go.opentelemetry.io/otel/baggage`. (#1217) (#1325) - A `Shutdown` method of `SpanProcessor` and all its implementations receives a context and returns an error. (#1264) ### Fixed - Copies of data from arrays and slices passed to `go.opentelemetry.io/otel/label.ArrayValue()` are now used in the returned `Value` instead of using the mutable data itself. (#1226) ### Removed - The `ExtractHTTP` and `InjectHTTP` functions from the `go.opentelemetry.io/otel/api/propagation` package were removed. (#1212) - The `Propagators` interface from the `go.opentelemetry.io/otel/api/propagation` package was removed to conform to the OpenTelemetry specification. The explicit `TextMapPropagator` type can be used in its place as this is the `Propagator` type the specification defines. (#1212) - The `SetAttribute` method of the `Span` from the `go.opentelemetry.io/otel/api/trace` package was removed given its redundancy with the `SetAttributes` method. (#1216) - The internal implementation of Baggage storage is removed in favor of using the new Baggage API functionality. (#1217) - Remove duplicate hostname key `HostHostNameKey` in Resource semantic conventions. (#1219) - Nested array/slice support has been removed. (#1226) ## [0.12.0] - 2020-09-24 ### Added - A `SpanConfigure` function in `go.opentelemetry.io/otel/api/trace` to create a new `SpanConfig` from `SpanOption`s. (#1108) - In the `go.opentelemetry.io/otel/api/trace` package, `NewTracerConfig` was added to construct new `TracerConfig`s. This addition was made to conform with our project option conventions. (#1155) - Instrumentation library information was added to the Zipkin exporter. (#1119) - The `SpanProcessor` interface now has a `ForceFlush()` method. (#1166) - More semantic conventions for k8s as resource attributes. (#1167) ### Changed - Add reconnecting udp connection type to Jaeger exporter. This change adds a new optional implementation of the udp conn interface used to detect changes to an agent's host dns record. It then adopts the new destination address to ensure the exporter doesn't get stuck. This change was ported from jaegertracing/jaeger-client-go#520. (#1063) - Replace `StartOption` and `EndOption` in `go.opentelemetry.io/otel/api/trace` with `SpanOption`. This change is matched by replacing the `StartConfig` and `EndConfig` with a unified `SpanConfig`. (#1108) - Replace the `LinkedTo` span option in `go.opentelemetry.io/otel/api/trace` with `WithLinks`. This is be more consistent with our other option patterns, i.e. passing the item to be configured directly instead of its component parts, and provides a cleaner function signature. (#1108) - The `go.opentelemetry.io/otel/api/trace` `TracerOption` was changed to an interface to conform to project option conventions. (#1109) - Move the `B3` and `TraceContext` from within the `go.opentelemetry.io/otel/api/trace` package to their own `go.opentelemetry.io/otel/propagators` package. This removal of the propagators is reflective of the OpenTelemetry specification for these propagators as well as cleans up the `go.opentelemetry.io/otel/api/trace` API. (#1118) - Rename Jaeger tags used for instrumentation library information to reflect changes in OpenTelemetry specification. (#1119) - Rename `ProbabilitySampler` to `TraceIDRatioBased` and change semantics to ignore parent span sampling status. (#1115) - Move `tools` package under `internal`. (#1141) - Move `go.opentelemetry.io/otel/api/correlation` package to `go.opentelemetry.io/otel/api/baggage`. (#1142) The `correlation.CorrelationContext` propagator has been renamed `baggage.Baggage`. Other exported functions and types are unchanged. - Rename `ParentOrElse` sampler to `ParentBased` and allow setting samplers depending on parent span. (#1153) - In the `go.opentelemetry.io/otel/api/trace` package, `SpanConfigure` was renamed to `NewSpanConfig`. (#1155) - Change `dependabot.yml` to add a `Skip Changelog` label to dependabot-sourced PRs. (#1161) - The [configuration style guide](https://github.com/open-telemetry/opentelemetry-go/blob/master/CONTRIBUTING.md#config) has been updated to recommend the use of `newConfig()` instead of `configure()`. (#1163) - The `otlp.Config` type has been unexported and changed to `otlp.config`, along with its initializer. (#1163) - Ensure exported interface types include parameter names and update the Style Guide to reflect this styling rule. (#1172) - Don't consider unset environment variable for resource detection to be an error. (#1170) - Rename `go.opentelemetry.io/otel/api/metric.ConfigureInstrument` to `NewInstrumentConfig` and `go.opentelemetry.io/otel/api/metric.ConfigureMeter` to `NewMeterConfig`. - ValueObserver instruments use LastValue aggregator by default. (#1165) - OTLP Metric exporter supports LastValue aggregation. (#1165) - Move the `go.opentelemetry.io/otel/api/unit` package to `go.opentelemetry.io/otel/unit`. (#1185) - Rename `Provider` to `MeterProvider` in the `go.opentelemetry.io/otel/api/metric` package. (#1190) - Rename `NoopProvider` to `NoopMeterProvider` in the `go.opentelemetry.io/otel/api/metric` package. (#1190) - Rename `NewProvider` to `NewMeterProvider` in the `go.opentelemetry.io/otel/api/metric/metrictest` package. (#1190) - Rename `Provider` to `MeterProvider` in the `go.opentelemetry.io/otel/api/metric/registry` package. (#1190) - Rename `NewProvider` to `NewMeterProvider` in the `go.opentelemetry.io/otel/api/metri/registryc` package. (#1190) - Rename `Provider` to `TracerProvider` in the `go.opentelemetry.io/otel/api/trace` package. (#1190) - Rename `NoopProvider` to `NoopTracerProvider` in the `go.opentelemetry.io/otel/api/trace` package. (#1190) - Rename `Provider` to `TracerProvider` in the `go.opentelemetry.io/otel/api/trace/tracetest` package. (#1190) - Rename `NewProvider` to `NewTracerProvider` in the `go.opentelemetry.io/otel/api/trace/tracetest` package. (#1190) - Rename `WrapperProvider` to `WrapperTracerProvider` in the `go.opentelemetry.io/otel/bridge/opentracing` package. (#1190) - Rename `NewWrapperProvider` to `NewWrapperTracerProvider` in the `go.opentelemetry.io/otel/bridge/opentracing` package. (#1190) - Rename `Provider` method of the pull controller to `MeterProvider` in the `go.opentelemetry.io/otel/sdk/metric/controller/pull` package. (#1190) - Rename `Provider` method of the push controller to `MeterProvider` in the `go.opentelemetry.io/otel/sdk/metric/controller/push` package. (#1190) - Rename `ProviderOptions` to `TracerProviderConfig` in the `go.opentelemetry.io/otel/sdk/trace` package. (#1190) - Rename `ProviderOption` to `TracerProviderOption` in the `go.opentelemetry.io/otel/sdk/trace` package. (#1190) - Rename `Provider` to `TracerProvider` in the `go.opentelemetry.io/otel/sdk/trace` package. (#1190) - Rename `NewProvider` to `NewTracerProvider` in the `go.opentelemetry.io/otel/sdk/trace` package. (#1190) - Renamed `SamplingDecision` values to comply with OpenTelemetry specification change. (#1192) - Renamed Zipkin attribute names from `ot.status_code & ot.status_description` to `otel.status_code & otel.status_description`. (#1201) - The default SDK now invokes registered `SpanProcessor`s in the order they were registered with the `TracerProvider`. (#1195) - Add test of spans being processed by the `SpanProcessor`s in the order they were registered. (#1203) ### Removed - Remove the B3 propagator from `go.opentelemetry.io/otel/propagators`. It is now located in the `go.opentelemetry.io/contrib/propagators/` module. (#1191) - Remove the semantic convention for HTTP status text, `HTTPStatusTextKey` from package `go.opentelemetry.io/otel/semconv`. (#1194) ### Fixed - Zipkin example no longer mentions `ParentSampler`, corrected to `ParentBased`. (#1171) - Fix missing shutdown processor in otel-collector example. (#1186) - Fix missing shutdown processor in basic and namedtracer examples. (#1197) ## [0.11.0] - 2020-08-24 ### Added - Support for exporting array-valued attributes via OTLP. (#992) - `Noop` and `InMemory` `SpanBatcher` implementations to help with testing integrations. (#994) - Support for filtering metric label sets. (#1047) - A dimensionality-reducing metric Processor. (#1057) - Integration tests for more OTel Collector Attribute types. (#1062) - A new `WithSpanProcessor` `ProviderOption` is added to the `go.opentelemetry.io/otel/sdk/trace` package to create a `Provider` and automatically register the `SpanProcessor`. (#1078) ### Changed - Rename `sdk/metric/processor/test` to `sdk/metric/processor/processortest`. (#1049) - Rename `sdk/metric/controller/test` to `sdk/metric/controller/controllertest`. (#1049) - Rename `api/testharness` to `api/apitest`. (#1049) - Rename `api/trace/testtrace` to `api/trace/tracetest`. (#1049) - Change Metric Processor to merge multiple observations. (#1024) - The `go.opentelemetry.io/otel/bridge/opentracing` bridge package has been made into its own module. This removes the package dependencies of this bridge from the rest of the OpenTelemetry based project. (#1038) - Renamed `go.opentelemetry.io/otel/api/standard` package to `go.opentelemetry.io/otel/semconv` to avoid the ambiguous and generic name `standard` and better describe the package as containing OpenTelemetry semantic conventions. (#1016) - The environment variable used for resource detection has been changed from `OTEL_RESOURCE_LABELS` to `OTEL_RESOURCE_ATTRIBUTES` (#1042) - Replace `WithSyncer` with `WithBatcher` in examples. (#1044) - Replace the `google.golang.org/grpc/codes` dependency in the API with an equivalent `go.opentelemetry.io/otel/codes` package. (#1046) - Merge the `go.opentelemetry.io/otel/api/label` and `go.opentelemetry.io/otel/api/kv` into the new `go.opentelemetry.io/otel/label` package. (#1060) - Unify Callback Function Naming. Rename `*Callback` with `*Func`. (#1061) - CI builds validate against last two versions of Go, dropping 1.13 and adding 1.15. (#1064) - The `go.opentelemetry.io/otel/sdk/export/trace` interfaces `SpanSyncer` and `SpanBatcher` have been replaced with a specification compliant `Exporter` interface. This interface still supports the export of `SpanData`, but only as a slice. Implementation are also required now to return any error from `ExportSpans` if one occurs as well as implement a `Shutdown` method for exporter clean-up. (#1078) - The `go.opentelemetry.io/otel/sdk/trace` `NewBatchSpanProcessor` function no longer returns an error. If a `nil` exporter is passed as an argument to this function, instead of it returning an error, it now returns a `BatchSpanProcessor` that handles the export of `SpanData` by not taking any action. (#1078) - The `go.opentelemetry.io/otel/sdk/trace` `NewProvider` function to create a `Provider` no longer returns an error, instead only a `*Provider`. This change is related to `NewBatchSpanProcessor` not returning an error which was the only error this function would return. (#1078) ### Removed - Duplicate, unused API sampler interface. (#999) Use the [`Sampler` interface](https://github.com/open-telemetry/opentelemetry-go/blob/v0.11.0/sdk/trace/sampling.go) provided by the SDK instead. - The `grpctrace` instrumentation was moved to the `go.opentelemetry.io/contrib` repository and out of this repository. This move includes moving the `grpc` example to the `go.opentelemetry.io/contrib` as well. (#1027) - The `WithSpan` method of the `Tracer` interface. The functionality this method provided was limited compared to what a user can provide themselves. It was removed with the understanding that if there is sufficient user need it can be added back based on actual user usage. (#1043) - The `RegisterSpanProcessor` and `UnregisterSpanProcessor` functions. These were holdovers from an approach prior to the TracerProvider design. They were not used anymore. (#1077) - The `oterror` package. (#1026) - The `othttp` and `httptrace` instrumentations were moved to `go.opentelemetry.io/contrib`. (#1032) ### Fixed - The `semconv.HTTPServerMetricAttributesFromHTTPRequest()` function no longer generates the high-cardinality `http.request.content.length` label. (#1031) - Correct instrumentation version tag in Jaeger exporter. (#1037) - The SDK span will now set an error event if the `End` method is called during a panic (i.e. it was deferred). (#1043) - Move internally generated protobuf code from the `go.opentelemetry.io/otel` to the OTLP exporter to reduce dependency overhead. (#1050) - The `otel-collector` example referenced outdated collector processors. (#1006) ## [0.10.0] - 2020-07-29 This release migrates the default OpenTelemetry SDK into its own Go module, decoupling the SDK from the API and reducing dependencies for instrumentation packages. ### Added - The Zipkin exporter now has `NewExportPipeline` and `InstallNewPipeline` constructor functions to match the common pattern. These function build a new exporter with default SDK options and register the exporter with the `global` package respectively. (#944) - Add propagator option for gRPC instrumentation. (#986) - The `testtrace` package now tracks the `trace.SpanKind` for each span. (#987) ### Changed - Replace the `RegisterGlobal` `Option` in the Jaeger exporter with an `InstallNewPipeline` constructor function. This matches the other exporter constructor patterns and will register a new exporter after building it with default configuration. (#944) - The trace (`go.opentelemetry.io/otel/exporters/trace/stdout`) and metric (`go.opentelemetry.io/otel/exporters/metric/stdout`) `stdout` exporters are now merged into a single exporter at `go.opentelemetry.io/otel/exporters/stdout`. This new exporter was made into its own Go module to follow the pattern of all exporters and decouple it from the `go.opentelemetry.io/otel` module. (#956, #963) - Move the `go.opentelemetry.io/otel/exporters/test` test package to `go.opentelemetry.io/otel/sdk/export/metric/metrictest`. (#962) - The `go.opentelemetry.io/otel/api/kv/value` package was merged into the parent `go.opentelemetry.io/otel/api/kv` package. (#968) - `value.Bool` was replaced with `kv.BoolValue`. - `value.Int64` was replaced with `kv.Int64Value`. - `value.Uint64` was replaced with `kv.Uint64Value`. - `value.Float64` was replaced with `kv.Float64Value`. - `value.Int32` was replaced with `kv.Int32Value`. - `value.Uint32` was replaced with `kv.Uint32Value`. - `value.Float32` was replaced with `kv.Float32Value`. - `value.String` was replaced with `kv.StringValue`. - `value.Int` was replaced with `kv.IntValue`. - `value.Uint` was replaced with `kv.UintValue`. - `value.Array` was replaced with `kv.ArrayValue`. - Rename `Infer` to `Any` in the `go.opentelemetry.io/otel/api/kv` package. (#972) - Change `othttp` to use the `httpsnoop` package to wrap the `ResponseWriter` so that optional interfaces (`http.Hijacker`, `http.Flusher`, etc.) that are implemented by the original `ResponseWriter`are also implemented by the wrapped `ResponseWriter`. (#979) - Rename `go.opentelemetry.io/otel/sdk/metric/aggregator/test` package to `go.opentelemetry.io/otel/sdk/metric/aggregator/aggregatortest`. (#980) - Make the SDK into its own Go module called `go.opentelemetry.io/otel/sdk`. (#985) - Changed the default trace `Sampler` from `AlwaysOn` to `ParentOrElse(AlwaysOn)`. (#989) ### Removed - The `IndexedAttribute` function from the `go.opentelemetry.io/otel/api/label` package was removed in favor of `IndexedLabel` which it was synonymous with. (#970) ### Fixed - Bump github.com/golangci/golangci-lint from 1.28.3 to 1.29.0 in /tools. (#953) - Bump github.com/google/go-cmp from 0.5.0 to 0.5.1. (#957) - Use `global.Handle` for span export errors in the OTLP exporter. (#946) - Correct Go language formatting in the README documentation. (#961) - Remove default SDK dependencies from the `go.opentelemetry.io/otel/api` package. (#977) - Remove default SDK dependencies from the `go.opentelemetry.io/otel/instrumentation` package. (#983) - Move documented examples for `go.opentelemetry.io/otel/instrumentation/grpctrace` interceptors into Go example tests. (#984) ## [0.9.0] - 2020-07-20 ### Added - A new Resource Detector interface is included to allow resources to be automatically detected and included. (#939) - A Detector to automatically detect resources from an environment variable. (#939) - Github action to generate protobuf Go bindings locally in `internal/opentelemetry-proto-gen`. (#938) - OTLP .proto files from `open-telemetry/opentelemetry-proto` imported as a git submodule under `internal/opentelemetry-proto`. References to `github.com/open-telemetry/opentelemetry-proto` changed to `go.opentelemetry.io/otel/internal/opentelemetry-proto-gen`. (#942) ### Changed - Non-nil value `struct`s for key-value pairs will be marshalled using JSON rather than `Sprintf`. (#948) ### Removed - Removed dependency on `github.com/open-telemetry/opentelemetry-collector`. (#943) ## [0.8.0] - 2020-07-09 ### Added - The `B3Encoding` type to represent the B3 encoding(s) the B3 propagator can inject. A value for HTTP supported encodings (Multiple Header: `MultipleHeader`, Single Header: `SingleHeader`) are included. (#882) - The `FlagsDeferred` trace flag to indicate if the trace sampling decision has been deferred. (#882) - The `FlagsDebug` trace flag to indicate if the trace is a debug trace. (#882) - Add `peer.service` semantic attribute. (#898) - Add database-specific semantic attributes. (#899) - Add semantic convention for `faas.coldstart` and `container.id`. (#909) - Add http content size semantic conventions. (#905) - Include `http.request_content_length` in HTTP request basic attributes. (#905) - Add semantic conventions for operating system process resource attribute keys. (#919) - The Jaeger exporter now has a `WithBatchMaxCount` option to specify the maximum number of spans sent in a batch. (#931) ### Changed - Update `CONTRIBUTING.md` to ask for updates to `CHANGELOG.md` with each pull request. (#879) - Use lowercase header names for B3 Multiple Headers. (#881) - The B3 propagator `SingleHeader` field has been replaced with `InjectEncoding`. This new field can be set to combinations of the `B3Encoding` bitmasks and will inject trace information in these encodings. If no encoding is set, the propagator will default to `MultipleHeader` encoding. (#882) - The B3 propagator now extracts from either HTTP encoding of B3 (Single Header or Multiple Header) based on what is contained in the header. Preference is given to Single Header encoding with Multiple Header being the fallback if Single Header is not found or is invalid. This behavior change is made to dynamically support all correctly encoded traces received instead of having to guess the expected encoding prior to receiving. (#882) - Extend semantic conventions for RPC. (#900) - To match constant naming conventions in the `api/standard` package, the `FaaS*` key names are appended with a suffix of `Key`. (#920) - `"api/standard".FaaSName` -> `FaaSNameKey` - `"api/standard".FaaSID` -> `FaaSIDKey` - `"api/standard".FaaSVersion` -> `FaaSVersionKey` - `"api/standard".FaaSInstance` -> `FaaSInstanceKey` ### Removed - The `FlagsUnused` trace flag is removed. The purpose of this flag was to act as the inverse of `FlagsSampled`, the inverse of `FlagsSampled` is used instead. (#882) - The B3 header constants (`B3SingleHeader`, `B3DebugFlagHeader`, `B3TraceIDHeader`, `B3SpanIDHeader`, `B3SampledHeader`, `B3ParentSpanIDHeader`) are removed. If B3 header keys are needed [the authoritative OpenZipkin package constants](https://pkg.go.dev/github.com/openzipkin/zipkin-go@v0.2.2/propagation/b3?tab=doc#pkg-constants) should be used instead. (#882) ### Fixed - The B3 Single Header name is now correctly `b3` instead of the previous `X-B3`. (#881) - The B3 propagator now correctly supports sampling only values (`b3: 0`, `b3: 1`, or `b3: d`) for a Single B3 Header. (#882) - The B3 propagator now propagates the debug flag. This removes the behavior of changing the debug flag into a set sampling bit. Instead, this now follow the B3 specification and omits the `X-B3-Sampling` header. (#882) - The B3 propagator now tracks "unset" sampling state (meaning "defer the decision") and does not set the `X-B3-Sampling` header when injecting. (#882) - Bump github.com/itchyny/gojq from 0.10.3 to 0.10.4 in /tools. (#883) - Bump github.com/opentracing/opentracing-go from v1.1.1-0.20190913142402-a7454ce5950e to v1.2.0. (#885) - The tracing time conversion for OTLP spans is now correctly set to `UnixNano`. (#896) - Ensure span status is not set to `Unknown` when no HTTP status code is provided as it is assumed to be `200 OK`. (#908) - Ensure `httptrace.clientTracer` closes `http.headers` span. (#912) - Prometheus exporter will not apply stale updates or forget inactive metrics. (#903) - Add test for api.standard `HTTPClientAttributesFromHTTPRequest`. (#905) - Bump github.com/golangci/golangci-lint from 1.27.0 to 1.28.1 in /tools. (#901, #913) - Update otel-collector example to use the v0.5.0 collector. (#915) - The `grpctrace` instrumentation uses a span name conforming to the OpenTelemetry semantic conventions (does not contain a leading slash (`/`)). (#922) - The `grpctrace` instrumentation includes an `rpc.method` attribute now set to the gRPC method name. (#900, #922) - The `grpctrace` instrumentation `rpc.service` attribute now contains the package name if one exists. This is in accordance with OpenTelemetry semantic conventions. (#922) - Correlation Context extractor will no longer insert an empty map into the returned context when no valid values are extracted. (#923) - Bump google.golang.org/api from 0.28.0 to 0.29.0 in /exporters/trace/jaeger. (#925) - Bump github.com/itchyny/gojq from 0.10.4 to 0.11.0 in /tools. (#926) - Bump github.com/golangci/golangci-lint from 1.28.1 to 1.28.2 in /tools. (#930) ## [0.7.0] - 2020-06-26 This release implements the v0.5.0 version of the OpenTelemetry specification. ### Added - The othttp instrumentation now includes default metrics. (#861) - This CHANGELOG file to track all changes in the project going forward. - Support for array type attributes. (#798) - Apply transitive dependabot go.mod dependency updates as part of a new automatic Github workflow. (#844) - Timestamps are now passed to exporters for each export. (#835) - Add new `Accumulation` type to metric SDK to transport telemetry from `Accumulator`s to `Processor`s. This replaces the prior `Record` `struct` use for this purpose. (#835) - New dependabot integration to automate package upgrades. (#814) - `Meter` and `Tracer` implementations accept instrumentation version version as an optional argument. This instrumentation version is passed on to exporters. (#811) (#805) (#802) - The OTLP exporter includes the instrumentation version in telemetry it exports. (#811) - Environment variables for Jaeger exporter are supported. (#796) - New `aggregation.Kind` in the export metric API. (#808) - New example that uses OTLP and the collector. (#790) - Handle errors in the span `SetName` during span initialization. (#791) - Default service config to enable retries for retry-able failed requests in the OTLP exporter and an option to override this default. (#777) - New `go.opentelemetry.io/otel/api/oterror` package to uniformly support error handling and definitions for the project. (#778) - New `global` default implementation of the `go.opentelemetry.io/otel/api/oterror.Handler` interface to be used to handle errors prior to an user defined `Handler`. There is also functionality for the user to register their `Handler` as well as a convenience function `Handle` to handle an error with this global `Handler`(#778) - Options to specify propagators for httptrace and grpctrace instrumentation. (#784) - The required `application/json` header for the Zipkin exporter is included in all exports. (#774) - Integrate HTTP semantics helpers from the contrib repository into the `api/standard` package. #769 ### Changed - Rename `Integrator` to `Processor` in the metric SDK. (#863) - Rename `AggregationSelector` to `AggregatorSelector`. (#859) - Rename `SynchronizedCopy` to `SynchronizedMove`. (#858) - Rename `simple` integrator to `basic` integrator. (#857) - Merge otlp collector examples. (#841) - Change the metric SDK to support cumulative, delta, and pass-through exporters directly. With these changes, cumulative and delta specific exporters are able to request the correct kind of aggregation from the SDK. (#840) - The `Aggregator.Checkpoint` API is renamed to `SynchronizedCopy` and adds an argument, a different `Aggregator` into which the copy is stored. (#812) - The `export.Aggregator` contract is that `Update()` and `SynchronizedCopy()` are synchronized with each other. All the aggregation interfaces (`Sum`, `LastValue`, ...) are not meant to be synchronized, as the caller is expected to synchronize aggregators at a higher level after the `Accumulator`. Some of the `Aggregators` used unnecessary locking and that has been cleaned up. (#812) - Use of `metric.Number` was replaced by `int64` now that we use `sync.Mutex` in the `MinMaxSumCount` and `Histogram` `Aggregators`. (#812) - Replace `AlwaysParentSample` with `ParentSample(fallback)` to match the OpenTelemetry v0.5.0 specification. (#810) - Rename `sdk/export/metric/aggregator` to `sdk/export/metric/aggregation`. #808 - Send configured headers with every request in the OTLP exporter, instead of just on connection creation. (#806) - Update error handling for any one off error handlers, replacing, instead, with the `global.Handle` function. (#791) - Rename `plugin` directory to `instrumentation` to match the OpenTelemetry specification. (#779) - Makes the argument order to Histogram and DDSketch `New()` consistent. (#781) ### Removed - `Uint64NumberKind` and related functions from the API. (#864) - Context arguments from `Aggregator.Checkpoint` and `Integrator.Process` as they were unused. (#803) - `SpanID` is no longer included in parameters for sampling decision to match the OpenTelemetry specification. (#775) ### Fixed - Upgrade OTLP exporter to opentelemetry-proto matching the opentelemetry-collector v0.4.0 release. (#866) - Allow changes to `go.sum` and `go.mod` when running dependabot tidy-up. (#871) - Bump github.com/stretchr/testify from 1.4.0 to 1.6.1. (#824) - Bump github.com/prometheus/client_golang from 1.7.0 to 1.7.1 in /exporters/metric/prometheus. (#867) - Bump google.golang.org/grpc from 1.29.1 to 1.30.0 in /exporters/trace/jaeger. (#853) - Bump google.golang.org/grpc from 1.29.1 to 1.30.0 in /exporters/trace/zipkin. (#854) - Bumps github.com/golang/protobuf from 1.3.2 to 1.4.2 (#848) - Bump github.com/stretchr/testify from 1.4.0 to 1.6.1 in /exporters/otlp (#817) - Bump github.com/golangci/golangci-lint from 1.25.1 to 1.27.0 in /tools (#828) - Bump github.com/prometheus/client_golang from 1.5.0 to 1.7.0 in /exporters/metric/prometheus (#838) - Bump github.com/stretchr/testify from 1.4.0 to 1.6.1 in /exporters/trace/jaeger (#829) - Bump github.com/benbjohnson/clock from 1.0.0 to 1.0.3 (#815) - Bump github.com/stretchr/testify from 1.4.0 to 1.6.1 in /exporters/trace/zipkin (#823) - Bump github.com/itchyny/gojq from 0.10.1 to 0.10.3 in /tools (#830) - Bump github.com/stretchr/testify from 1.4.0 to 1.6.1 in /exporters/metric/prometheus (#822) - Bump google.golang.org/grpc from 1.27.1 to 1.29.1 in /exporters/trace/zipkin (#820) - Bump google.golang.org/grpc from 1.27.1 to 1.29.1 in /exporters/trace/jaeger (#831) - Bump github.com/google/go-cmp from 0.4.0 to 0.5.0 (#836) - Bump github.com/google/go-cmp from 0.4.0 to 0.5.0 in /exporters/trace/jaeger (#837) - Bump github.com/google/go-cmp from 0.4.0 to 0.5.0 in /exporters/otlp (#839) - Bump google.golang.org/api from 0.20.0 to 0.28.0 in /exporters/trace/jaeger (#843) - Set span status from HTTP status code in the othttp instrumentation. (#832) - Fixed typo in push controller comment. (#834) - The `Aggregator` testing has been updated and cleaned. (#812) - `metric.Number(0)` expressions are replaced by `0` where possible. (#812) - Fixed `global` `handler_test.go` test failure. #804 - Fixed `BatchSpanProcessor.Shutdown` to wait until all spans are processed. (#766) - Fixed OTLP example's accidental early close of exporter. (#807) - Ensure zipkin exporter reads and closes response body. (#788) - Update instrumentation to use `api/standard` keys instead of custom keys. (#782) - Clean up tools and RELEASING documentation. (#762) ## [0.6.0] - 2020-05-21 ### Added - Support for `Resource`s in the prometheus exporter. (#757) - New pull controller. (#751) - New `UpDownSumObserver` instrument. (#750) - OpenTelemetry collector demo. (#711) - New `SumObserver` instrument. (#747) - New `UpDownCounter` instrument. (#745) - New timeout `Option` and configuration function `WithTimeout` to the push controller. (#742) - New `api/standards` package to implement semantic conventions and standard key-value generation. (#731) ### Changed - Rename `Register*` functions in the metric API to `New*` for all `Observer` instruments. (#761) - Use `[]float64` for histogram boundaries, not `[]metric.Number`. (#758) - Change OTLP example to use exporter as a trace `Syncer` instead of as an unneeded `Batcher`. (#756) - Replace `WithResourceAttributes()` with `WithResource()` in the trace SDK. (#754) - The prometheus exporter now uses the new pull controller. (#751) - Rename `ScheduleDelayMillis` to `BatchTimeout` in the trace `BatchSpanProcessor`.(#752) - Support use of synchronous instruments in asynchronous callbacks (#725) - Move `Resource` from the `Export` method parameter into the metric export `Record`. (#739) - Rename `Observer` instrument to `ValueObserver`. (#734) - The push controller now has a method (`Provider()`) to return a `metric.Provider` instead of the old `Meter` method that acted as a `metric.Provider`. (#738) - Replace `Measure` instrument by `ValueRecorder` instrument. (#732) - Rename correlation context header from `"Correlation-Context"` to `"otcorrelations"` to match the OpenTelemetry specification. (#727) ### Fixed - Ensure gRPC `ClientStream` override methods do not panic in grpctrace package. (#755) - Disable parts of `BatchSpanProcessor` test until a fix is found. (#743) - Fix `string` case in `kv` `Infer` function. (#746) - Fix panic in grpctrace client interceptors. (#740) - Refactor the `api/metrics` push controller and add `CheckpointSet` synchronization. (#737) - Rewrite span batch process queue batching logic. (#719) - Remove the push controller named Meter map. (#738) - Fix Histogram aggregator initial state (fix #735). (#736) - Ensure golang alpine image is running `golang-1.14` for examples. (#733) - Added test for grpctrace `UnaryInterceptorClient`. (#695) - Rearrange `api/metric` code layout. (#724) ## [0.5.0] - 2020-05-13 ### Added - Batch `Observer` callback support. (#717) - Alias `api` types to root package of project. (#696) - Create basic `othttp.Transport` for simple client instrumentation. (#678) - `SetAttribute(string, interface{})` to the trace API. (#674) - Jaeger exporter option that allows user to specify custom http client. (#671) - `Stringer` and `Infer` methods to `key`s. (#662) ### Changed - Rename `NewKey` in the `kv` package to just `Key`. (#721) - Move `core` and `key` to `kv` package. (#720) - Make the metric API `Meter` a `struct` so the abstract `MeterImpl` can be passed and simplify implementation. (#709) - Rename SDK `Batcher` to `Integrator` to match draft OpenTelemetry SDK specification. (#710) - Rename SDK `Ungrouped` integrator to `simple.Integrator` to match draft OpenTelemetry SDK specification. (#710) - Rename SDK `SDK` `struct` to `Accumulator` to match draft OpenTelemetry SDK specification. (#710) - Move `Number` from `core` to `api/metric` package. (#706) - Move `SpanContext` from `core` to `trace` package. (#692) - Change traceparent header from `Traceparent` to `traceparent` to implement the W3C specification. (#681) ### Fixed - Update tooling to run generators in all submodules. (#705) - gRPC interceptor regexp to match methods without a service name. (#683) - Use a `const` for padding 64-bit B3 trace IDs. (#701) - Update `mockZipkin` listen address from `:0` to `127.0.0.1:0`. (#700) - Left-pad 64-bit B3 trace IDs with zero. (#698) - Propagate at least the first W3C tracestate header. (#694) - Remove internal `StateLocker` implementation. (#688) - Increase instance size CI system uses. (#690) - Add a `key` benchmark and use reflection in `key.Infer()`. (#679) - Fix internal `global` test by using `global.Meter` with `RecordBatch()`. (#680) - Reimplement histogram using mutex instead of `StateLocker`. (#669) - Switch `MinMaxSumCount` to a mutex lock implementation instead of `StateLocker`. (#667) - Update documentation to not include any references to `WithKeys`. (#672) - Correct misspelling. (#668) - Fix clobbering of the span context if extraction fails. (#656) - Bump `golangci-lint` and work around the corrupting bug. (#666) (#670) ## [0.4.3] - 2020-04-24 ### Added - `Dockerfile` and `docker-compose.yml` to run example code. (#635) - New `grpctrace` package that provides gRPC client and server interceptors for both unary and stream connections. (#621) - New `api/label` package, providing common label set implementation. (#651) - Support for JSON marshaling of `Resources`. (#654) - `TraceID` and `SpanID` implementations for `Stringer` interface. (#642) - `RemoteAddrKey` in the othttp plugin to include the HTTP client address in top-level spans. (#627) - `WithSpanFormatter` option to the othttp plugin. (#617) - Updated README to include section for compatible libraries and include reference to the contrib repository. (#612) - The prometheus exporter now supports exporting histograms. (#601) - A `String` method to the `Resource` to return a hashable identifier for a now unique resource. (#613) - An `Iter` method to the `Resource` to return an array `AttributeIterator`. (#613) - An `Equal` method to the `Resource` test the equivalence of resources. (#613) - An iterable structure (`AttributeIterator`) for `Resource` attributes. ### Changed - zipkin export's `NewExporter` now requires a `serviceName` argument to ensure this needed values is provided. (#644) - Pass `Resources` through the metrics export pipeline. (#659) ### Removed - `WithKeys` option from the metric API. (#639) ### Fixed - Use the `label.Set.Equivalent` value instead of an encoding in the batcher. (#658) - Correct typo `trace.Exporter` to `trace.SpanSyncer` in comments. (#653) - Use type names for return values in jaeger exporter. (#648) - Increase the visibility of the `api/key` package by updating comments and fixing usages locally. (#650) - `Checkpoint` only after `Update`; Keep records in the `sync.Map` longer. (#647) - Do not cache `reflect.ValueOf()` in metric Labels. (#649) - Batch metrics exported from the OTLP exporter based on `Resource` and labels. (#626) - Add error wrapping to the prometheus exporter. (#631) - Update the OTLP exporter batching of traces to use a unique `string` representation of an associated `Resource` as the batching key. (#623) - Update OTLP `SpanData` transform to only include the `ParentSpanID` if one exists. (#614) - Update `Resource` internal representation to uniquely and reliably identify resources. (#613) - Check return value from `CheckpointSet.ForEach` in prometheus exporter. (#622) - Ensure spans created by httptrace client tracer reflect operation structure. (#618) - Create a new recorder rather than reuse when multiple observations in same epoch for asynchronous instruments. #610 - The default port the OTLP exporter uses to connect to the OpenTelemetry collector is updated to match the one the collector listens on by default. (#611) ## [0.4.2] - 2020-03-31 ### Fixed - Fix `pre_release.sh` to update version in `sdk/opentelemetry.go`. (#607) - Fix time conversion from internal to OTLP in OTLP exporter. (#606) ## [0.4.1] - 2020-03-31 ### Fixed - Update `tag.sh` to create signed tags. (#604) ## [0.4.0] - 2020-03-30 ### Added - New API package `api/metric/registry` that exposes a `MeterImpl` wrapper for use by SDKs to generate unique instruments. (#580) - Script to verify examples after a new release. (#579) ### Removed - The dogstatsd exporter due to lack of support. This additionally removes support for statsd. (#591) - `LabelSet` from the metric API. This is replaced by a `[]core.KeyValue` slice. (#595) - `Labels` from the metric API's `Meter` interface. (#595) ### Changed - The metric `export.Labels` became an interface which the SDK implements and the `export` package provides a simple, immutable implementation of this interface intended for testing purposes. (#574) - Renamed `internal/metric.Meter` to `MeterImpl`. (#580) - Renamed `api/global/internal.obsImpl` to `asyncImpl`. (#580) ### Fixed - Corrected missing return in mock span. (#582) - Update License header for all source files to match CNCF guidelines and include a test to ensure it is present. (#586) (#596) - Update to v0.3.0 of the OTLP in the OTLP exporter. (#588) - Update pre-release script to be compatible between GNU and BSD based systems. (#592) - Add a `RecordBatch` benchmark. (#594) - Moved span transforms of the OTLP exporter to the internal package. (#593) - Build both go-1.13 and go-1.14 in circleci to test for all supported versions of Go. (#569) - Removed unneeded allocation on empty labels in OLTP exporter. (#597) - Update `BatchedSpanProcessor` to process the queue until no data but respect max batch size. (#599) - Update project documentation godoc.org links to pkg.go.dev. (#602) ## [0.3.0] - 2020-03-21 This is a first official beta release, which provides almost fully complete metrics, tracing, and context propagation functionality. There is still a possibility of breaking changes. ### Added - Add `Observer` metric instrument. (#474) - Add global `Propagators` functionality to enable deferred initialization for propagators registered before the first Meter SDK is installed. (#494) - Simplified export setup pipeline for the jaeger exporter to match other exporters. (#459) - The zipkin trace exporter. (#495) - The OTLP exporter to export metric and trace telemetry to the OpenTelemetry collector. (#497) (#544) (#545) - Add `StatusMessage` field to the trace `Span`. (#524) - Context propagation in OpenTracing bridge in terms of OpenTelemetry context propagation. (#525) - The `Resource` type was added to the SDK. (#528) - The global API now supports a `Tracer` and `Meter` function as shortcuts to getting a global `*Provider` and calling these methods directly. (#538) - The metric API now defines a generic `MeterImpl` interface to support general purpose `Meter` construction. Additionally, `SyncImpl` and `AsyncImpl` are added to support general purpose instrument construction. (#560) - A metric `Kind` is added to represent the `MeasureKind`, `ObserverKind`, and `CounterKind`. (#560) - Scripts to better automate the release process. (#576) ### Changed - Default to to use `AlwaysSampler` instead of `ProbabilitySampler` to match OpenTelemetry specification. (#506) - Renamed `AlwaysSampleSampler` to `AlwaysOnSampler` in the trace API. (#511) - Renamed `NeverSampleSampler` to `AlwaysOffSampler` in the trace API. (#511) - The `Status` field of the `Span` was changed to `StatusCode` to disambiguate with the added `StatusMessage`. (#524) - Updated the trace `Sampler` interface conform to the OpenTelemetry specification. (#531) - Rename metric API `Options` to `Config`. (#541) - Rename metric `Counter` aggregator to be `Sum`. (#541) - Unify metric options into `Option` from instrument specific options. (#541) - The trace API's `TraceProvider` now support `Resource`s. (#545) - Correct error in zipkin module name. (#548) - The jaeger trace exporter now supports `Resource`s. (#551) - Metric SDK now supports `Resource`s. The `WithResource` option was added to configure a `Resource` on creation and the `Resource` method was added to the metric `Descriptor` to return the associated `Resource`. (#552) - Replace `ErrNoLastValue` and `ErrEmptyDataSet` by `ErrNoData` in the metric SDK. (#557) - The stdout trace exporter now supports `Resource`s. (#558) - The metric `Descriptor` is now included at the API instead of the SDK. (#560) - Replace `Ordered` with an iterator in `export.Labels`. (#567) ### Removed - The vendor specific Stackdriver. It is now hosted on 3rd party vendor infrastructure. (#452) - The `Unregister` method for metric observers as it is not in the OpenTelemetry specification. (#560) - `GetDescriptor` from the metric SDK. (#575) - The `Gauge` instrument from the metric API. (#537) ### Fixed - Make histogram aggregator checkpoint consistent. (#438) - Update README with import instructions and how to build and test. (#505) - The default label encoding was updated to be unique. (#508) - Use `NewRoot` in the othttp plugin for public endpoints. (#513) - Fix data race in `BatchedSpanProcessor`. (#518) - Skip test-386 for Mac OS 10.15.x (Catalina and upwards). #521 - Use a variable-size array to represent ordered labels in maps. (#523) - Update the OTLP protobuf and update changed import path. (#532) - Use `StateLocker` implementation in `MinMaxSumCount`. (#546) - Eliminate goroutine leak in histogram stress test. (#547) - Update OTLP exporter with latest protobuf. (#550) - Add filters to the othttp plugin. (#556) - Provide an implementation of the `Header*` filters that do not depend on Go 1.14. (#565) - Encode labels once during checkpoint. The checkpoint function is executed in a single thread so we can do the encoding lazily before passing the encoded version of labels to the exporter. This is a cheap and quick way to avoid encoding the labels on every collection interval. (#572) - Run coverage over all packages in `COVERAGE_MOD_DIR`. (#573) ## [0.2.3] - 2020-03-04 ### Added - `RecordError` method on `Span`s in the trace API to Simplify adding error events to spans. (#473) - Configurable push frequency for exporters setup pipeline. (#504) ### Changed - Rename the `exporter` directory to `exporters`. The `go.opentelemetry.io/otel/exporter/trace/jaeger` package was mistakenly released with a `v1.0.0` tag instead of `v0.1.0`. This resulted in all subsequent releases not becoming the default latest. A consequence of this was that all `go get`s pulled in the incompatible `v0.1.0` release of that package when pulling in more recent packages from other otel packages. Renaming the `exporter` directory to `exporters` fixes this issue by renaming the package and therefore clearing any existing dependency tags. Consequentially, this action also renames *all* exporter packages. (#502) ### Removed - The `CorrelationContextHeader` constant in the `correlation` package is no longer exported. (#503) ## [0.2.2] - 2020-02-27 ### Added - `HTTPSupplier` interface in the propagation API to specify methods to retrieve and store a single value for a key to be associated with a carrier. (#467) - `HTTPExtractor` interface in the propagation API to extract information from an `HTTPSupplier` into a context. (#467) - `HTTPInjector` interface in the propagation API to inject information into an `HTTPSupplier.` (#467) - `Config` and configuring `Option` to the propagator API. (#467) - `Propagators` interface in the propagation API to contain the set of injectors and extractors for all supported carrier formats. (#467) - `HTTPPropagator` interface in the propagation API to inject and extract from an `HTTPSupplier.` (#467) - `WithInjectors` and `WithExtractors` functions to the propagator API to configure injectors and extractors to use. (#467) - `ExtractHTTP` and `InjectHTTP` functions to apply configured HTTP extractors and injectors to a passed context. (#467) - Histogram aggregator. (#433) - `DefaultPropagator` function and have it return `trace.TraceContext` as the default context propagator. (#456) - `AlwaysParentSample` sampler to the trace API. (#455) - `WithNewRoot` option function to the trace API to specify the created span should be considered a root span. (#451) ### Changed - Renamed `WithMap` to `ContextWithMap` in the correlation package. (#481) - Renamed `FromContext` to `MapFromContext` in the correlation package. (#481) - Move correlation context propagation to correlation package. (#479) - Do not default to putting remote span context into links. (#480) - `Tracer.WithSpan` updated to accept `StartOptions`. (#472) - Renamed `MetricKind` to `Kind` to not stutter in the type usage. (#432) - Renamed the `export` package to `metric` to match directory structure. (#432) - Rename the `api/distributedcontext` package to `api/correlation`. (#444) - Rename the `api/propagators` package to `api/propagation`. (#444) - Move the propagators from the `propagators` package into the `trace` API package. (#444) - Update `Float64Gauge`, `Int64Gauge`, `Float64Counter`, `Int64Counter`, `Float64Measure`, and `Int64Measure` metric methods to use value receivers instead of pointers. (#462) - Moved all dependencies of tools package to a tools directory. (#466) ### Removed - Binary propagators. (#467) - NOOP propagator. (#467) ### Fixed - Upgraded `github.com/golangci/golangci-lint` from `v1.21.0` to `v1.23.6` in `tools/`. (#492) - Fix a possible nil-dereference crash (#478) - Correct comments for `InstallNewPipeline` in the stdout exporter. (#483) - Correct comments for `InstallNewPipeline` in the dogstatsd exporter. (#484) - Correct comments for `InstallNewPipeline` in the prometheus exporter. (#482) - Initialize `onError` based on `Config` in prometheus exporter. (#486) - Correct module name in prometheus exporter README. (#475) - Removed tracer name prefix from span names. (#430) - Fix `aggregator_test.go` import package comment. (#431) - Improved detail in stdout exporter. (#436) - Fix a dependency issue (generate target should depend on stringer, not lint target) in Makefile. (#442) - Reorders the Makefile targets within `precommit` target so we generate files and build the code before doing linting, so we can get much nicer errors about syntax errors from the compiler. (#442) - Reword function documentation in gRPC plugin. (#446) - Send the `span.kind` tag to Jaeger from the jaeger exporter. (#441) - Fix `metadataSupplier` in the jaeger exporter to overwrite the header if existing instead of appending to it. (#441) - Upgraded to Go 1.13 in CI. (#465) - Correct opentelemetry.io URL in trace SDK documentation. (#464) - Refactored reference counting logic in SDK determination of stale records. (#468) - Add call to `runtime.Gosched` in instrument `acquireHandle` logic to not block the collector. (#469) ## [0.2.1.1] - 2020-01-13 ### Fixed - Use stateful batcher on Prometheus exporter fixing regression introduced in #395. (#428) ## [0.2.1] - 2020-01-08 ### Added - Global meter forwarding implementation. This enables deferred initialization for metric instruments registered before the first Meter SDK is installed. (#392) - Global trace forwarding implementation. This enables deferred initialization for tracers registered before the first Trace SDK is installed. (#406) - Standardize export pipeline creation in all exporters. (#395) - A testing, organization, and comments for 64-bit field alignment. (#418) - Script to tag all modules in the project. (#414) ### Changed - Renamed `propagation` package to `propagators`. (#362) - Renamed `B3Propagator` propagator to `B3`. (#362) - Renamed `TextFormatPropagator` propagator to `TextFormat`. (#362) - Renamed `BinaryPropagator` propagator to `Binary`. (#362) - Renamed `BinaryFormatPropagator` propagator to `BinaryFormat`. (#362) - Renamed `NoopTextFormatPropagator` propagator to `NoopTextFormat`. (#362) - Renamed `TraceContextPropagator` propagator to `TraceContext`. (#362) - Renamed `SpanOption` to `StartOption` in the trace API. (#369) - Renamed `StartOptions` to `StartConfig` in the trace API. (#369) - Renamed `EndOptions` to `EndConfig` in the trace API. (#369) - `Number` now has a pointer receiver for its methods. (#375) - Renamed `CurrentSpan` to `SpanFromContext` in the trace API. (#379) - Renamed `SetCurrentSpan` to `ContextWithSpan` in the trace API. (#379) - Renamed `Message` in Event to `Name` in the trace API. (#389) - Prometheus exporter no longer aggregates metrics, instead it only exports them. (#385) - Renamed `HandleImpl` to `BoundInstrumentImpl` in the metric API. (#400) - Renamed `Float64CounterHandle` to `Float64CounterBoundInstrument` in the metric API. (#400) - Renamed `Int64CounterHandle` to `Int64CounterBoundInstrument` in the metric API. (#400) - Renamed `Float64GaugeHandle` to `Float64GaugeBoundInstrument` in the metric API. (#400) - Renamed `Int64GaugeHandle` to `Int64GaugeBoundInstrument` in the metric API. (#400) - Renamed `Float64MeasureHandle` to `Float64MeasureBoundInstrument` in the metric API. (#400) - Renamed `Int64MeasureHandle` to `Int64MeasureBoundInstrument` in the metric API. (#400) - Renamed `Release` method for bound instruments in the metric API to `Unbind`. (#400) - Renamed `AcquireHandle` method for bound instruments in the metric API to `Bind`. (#400) - Renamed the `File` option in the stdout exporter to `Writer`. (#404) - Renamed all `Options` to `Config` for all metric exports where this wasn't already the case. ### Fixed - Aggregator import path corrected. (#421) - Correct links in README. (#368) - The README was updated to match latest code changes in its examples. (#374) - Don't capitalize error statements. (#375) - Fix ignored errors. (#375) - Fix ambiguous variable naming. (#375) - Removed unnecessary type casting. (#375) - Use named parameters. (#375) - Updated release schedule. (#378) - Correct http-stackdriver example module name. (#394) - Removed the `http.request` span in `httptrace` package. (#397) - Add comments in the metrics SDK (#399) - Initialize checkpoint when creating ddsketch aggregator to prevent panic when merging into a empty one. (#402) (#403) - Add documentation of compatible exporters in the README. (#405) - Typo fix. (#408) - Simplify span check logic in SDK tracer implementation. (#419) ## [0.2.0] - 2019-12-03 ### Added - Unary gRPC tracing example. (#351) - Prometheus exporter. (#334) - Dogstatsd metrics exporter. (#326) ### Changed - Rename `MaxSumCount` aggregation to `MinMaxSumCount` and add the `Min` interface for this aggregation. (#352) - Rename `GetMeter` to `Meter`. (#357) - Rename `HTTPTraceContextPropagator` to `TraceContextPropagator`. (#355) - Rename `HTTPB3Propagator` to `B3Propagator`. (#355) - Rename `HTTPTraceContextPropagator` to `TraceContextPropagator`. (#355) - Move `/global` package to `/api/global`. (#356) - Rename `GetTracer` to `Tracer`. (#347) ### Removed - `SetAttribute` from the `Span` interface in the trace API. (#361) - `AddLink` from the `Span` interface in the trace API. (#349) - `Link` from the `Span` interface in the trace API. (#349) ### Fixed - Exclude example directories from coverage report. (#365) - Lint make target now implements automatic fixes with `golangci-lint` before a second run to report the remaining issues. (#360) - Drop `GO111MODULE` environment variable in Makefile as Go 1.13 is the project specified minimum version and this is environment variable is not needed for that version of Go. (#359) - Run the race checker for all test. (#354) - Redundant commands in the Makefile are removed. (#354) - Split the `generate` and `lint` targets of the Makefile. (#354) - Renames `circle-ci` target to more generic `ci` in Makefile. (#354) - Add example Prometheus binary to gitignore. (#358) - Support negative numbers with the `MaxSumCount`. (#335) - Resolve race conditions in `push_test.go` identified in #339. (#340) - Use `/usr/bin/env bash` as a shebang in scripts rather than `/bin/bash`. (#336) - Trace benchmark now tests both `AlwaysSample` and `NeverSample`. Previously it was testing `AlwaysSample` twice. (#325) - Trace benchmark now uses a `[]byte` for `TraceID` to fix failing test. (#325) - Added a trace benchmark to test variadic functions in `setAttribute` vs `setAttributes` (#325) - The `defaultkeys` batcher was only using the encoded label set as its map key while building a checkpoint. This allowed distinct label sets through, but any metrics sharing a label set could be overwritten or merged incorrectly. This was corrected. (#333) ## [0.1.2] - 2019-11-18 ### Fixed - Optimized the `simplelru` map for attributes to reduce the number of allocations. (#328) - Removed unnecessary unslicing of parameters that are already a slice. (#324) ## [0.1.1] - 2019-11-18 This release contains a Metrics SDK with stdout exporter and supports basic aggregations such as counter, gauges, array, maxsumcount, and ddsketch. ### Added - Metrics stdout export pipeline. (#265) - Array aggregation for raw measure metrics. (#282) - The core.Value now have a `MarshalJSON` method. (#281) ### Removed - `WithService`, `WithResources`, and `WithComponent` methods of tracers. (#314) - Prefix slash in `Tracer.Start()` for the Jaeger example. (#292) ### Changed - Allocation in LabelSet construction to reduce GC overhead. (#318) - `trace.WithAttributes` to append values instead of replacing (#315) - Use a formula for tolerance in sampling tests. (#298) - Move export types into trace and metric-specific sub-directories. (#289) - `SpanKind` back to being based on an `int` type. (#288) ### Fixed - URL to OpenTelemetry website in README. (#323) - Name of othttp default tracer. (#321) - `ExportSpans` for the stackdriver exporter now handles `nil` context. (#294) - CI modules cache to correctly restore/save from/to the cache. (#316) - Fix metric SDK race condition between `LoadOrStore` and the assignment `rec.recorder = i.meter.exporter.AggregatorFor(rec)`. (#293) - README now reflects the new code structure introduced with these changes. (#291) - Make the basic example work. (#279) ## [0.1.0] - 2019-11-04 This is the first release of open-telemetry go library. It contains api and sdk for trace and meter. ### Added - Initial OpenTelemetry trace and metric API prototypes. - Initial OpenTelemetry trace, metric, and export SDK packages. - A wireframe bridge to support compatibility with OpenTracing. - Example code for a basic, http-stackdriver, http, jaeger, and named tracer setup. - Exporters for Jaeger, Stackdriver, and stdout. - Propagators for binary, B3, and trace-context protocols. - Project information and guidelines in the form of a README and CONTRIBUTING. - Tools to build the project and a Makefile to automate the process. - Apache-2.0 license. - CircleCI build CI manifest files. - CODEOWNERS file to track owners of this project. [Unreleased]: https://github.com/open-telemetry/opentelemetry-go/compare/v1.40.0...HEAD [1.40.0/0.62.0/0.16.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.40.0 [1.39.0/0.61.0/0.15.0/0.0.14]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.39.0 [1.38.0/0.60.0/0.14.0/0.0.13]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.38.0 [0.59.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/exporters/prometheus/v0.59.1 [1.37.0/0.59.0/0.13.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.37.0 [0.12.2]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/log/v0.12.2 [0.12.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/log/v0.12.1 [1.36.0/0.58.0/0.12.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.36.0 [1.35.0/0.57.0/0.11.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.35.0 [1.34.0/0.56.0/0.10.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.34.0 [1.33.0/0.55.0/0.9.0/0.0.12]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.33.0 [1.32.0/0.54.0/0.8.0/0.0.11]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.32.0 [1.31.0/0.53.0/0.7.0/0.0.10]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.31.0 [1.30.0/0.52.0/0.6.0/0.0.9]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.30.0 [1.29.0/0.51.0/0.5.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.29.0 [1.28.0/0.50.0/0.4.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.28.0 [1.27.0/0.49.0/0.3.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.27.0 [1.26.0/0.48.0/0.2.0-alpha]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.26.0 [1.25.0/0.47.0/0.0.8/0.1.0-alpha]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.25.0 [1.24.0/0.46.0/0.0.1-alpha]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.24.0 [1.23.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.23.1 [1.23.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.23.0 [1.23.0-rc.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.23.0-rc.1 [1.22.0/0.45.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.22.0 [1.21.0/0.44.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.21.0 [1.20.0/0.43.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.20.0 [1.19.0/0.42.0/0.0.7]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.19.0 [1.19.0-rc.1/0.42.0-rc.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.19.0-rc.1 [1.18.0/0.41.0/0.0.6]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.18.0 [1.17.0/0.40.0/0.0.5]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.17.0 [1.16.0/0.39.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.16.0 [1.16.0-rc.1/0.39.0-rc.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.16.0-rc.1 [1.15.1/0.38.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.15.1 [1.15.0/0.38.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.15.0 [1.15.0-rc.2/0.38.0-rc.2]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.15.0-rc.2 [1.15.0-rc.1/0.38.0-rc.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.15.0-rc.1 [1.14.0/0.37.0/0.0.4]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.14.0 [1.13.0/0.36.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.13.0 [1.12.0/0.35.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.12.0 [1.11.2/0.34.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.11.2 [1.11.1/0.33.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.11.1 [1.11.0/0.32.3]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.11.0 [0.32.2]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/sdk/metric/v0.32.2 [0.32.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/sdk/metric/v0.32.1 [0.32.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/sdk/metric/v0.32.0 [1.10.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.10.0 [1.9.0/0.0.3]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.9.0 [1.8.0/0.31.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.8.0 [1.7.0/0.30.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.7.0 [0.29.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/metric/v0.29.0 [1.6.3]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.6.3 [1.6.2]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.6.2 [1.6.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.6.1 [1.6.0/0.28.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.6.0 [1.5.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.5.0 [1.4.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.4.1 [1.4.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.4.0 [1.3.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.3.0 [1.2.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.2.0 [1.1.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.1.0 [1.0.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.0.1 [Metrics 0.24.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/metric/v0.24.0 [1.0.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.0.0 [1.0.0-RC3]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.0.0-RC3 [1.0.0-RC2]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.0.0-RC2 [Experimental Metrics v0.22.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/metric/v0.22.0 [1.0.0-RC1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.0.0-RC1 [0.20.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.20.0 [0.19.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.19.0 [0.18.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.18.0 [0.17.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.17.0 [0.16.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.16.0 [0.15.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.15.0 [0.14.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.14.0 [0.13.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.13.0 [0.12.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.12.0 [0.11.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.11.0 [0.10.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.10.0 [0.9.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.9.0 [0.8.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.8.0 [0.7.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.7.0 [0.6.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.6.0 [0.5.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.5.0 [0.4.3]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.4.3 [0.4.2]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.4.2 [0.4.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.4.1 [0.4.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.4.0 [0.3.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.3.0 [0.2.3]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.2.3 [0.2.2]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.2.2 [0.2.1.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.2.1.1 [0.2.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.2.1 [0.2.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.2.0 [0.1.2]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.1.2 [0.1.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.1.1 [0.1.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.1.0 [Go 1.25]: https://go.dev/doc/go1.25 [Go 1.24]: https://go.dev/doc/go1.24 [Go 1.23]: https://go.dev/doc/go1.23 [Go 1.22]: https://go.dev/doc/go1.22 [Go 1.21]: https://go.dev/doc/go1.21 [Go 1.20]: https://go.dev/doc/go1.20 [Go 1.19]: https://go.dev/doc/go1.19 [Go 1.18]: https://go.dev/doc/go1.18 [metric API]:https://pkg.go.dev/go.opentelemetry.io/otel/metric [metric SDK]:https://pkg.go.dev/go.opentelemetry.io/otel/sdk/metric [trace API]:https://pkg.go.dev/go.opentelemetry.io/otel/trace [GO-2024-2687]: https://pkg.go.dev/vuln/GO-2024-2687 ================================================ FILE: vendor/go.opentelemetry.io/otel/CODEOWNERS ================================================ ##################################################### # # List of approvers for this repository # ##################################################### # # Learn about membership in OpenTelemetry community: # https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md # # # Learn about CODEOWNERS file format: # https://help.github.com/en/articles/about-code-owners # * @MrAlias @XSAM @dashpole @pellared @dmathieu @flc1125 CODEOWNERS @MrAlias @pellared @dashpole @XSAM @dmathieu ================================================ FILE: vendor/go.opentelemetry.io/otel/CONTRIBUTING.md ================================================ # Contributing to opentelemetry-go The Go special interest group (SIG) meets regularly. See the OpenTelemetry [community](https://github.com/open-telemetry/community#golang-sdk) repo for information on this and other language SIGs. See the [public meeting notes](https://docs.google.com/document/d/1E5e7Ld0NuU1iVvf-42tOBpu2VBBLYnh73GJuITGJTTU/edit) for a summary description of past meetings. To request edit access, join the meeting or get in touch on [Slack](https://cloud-native.slack.com/archives/C01NPAXACKT). ## Development You can view and edit the source code by cloning this repository: ```sh git clone https://github.com/open-telemetry/opentelemetry-go.git ``` Run `make test` to run the tests instead of `go test`. There are some generated files checked into the repo. To make sure that the generated files are up-to-date, run `make` (or `make precommit` - the `precommit` target is the default). The `precommit` target also fixes the formatting of the code and checks the status of the go module files. Additionally, there is a `codespell` target that checks for common typos in the code. It is not run by default, but you can run it manually with `make codespell`. It will set up a virtual environment in `venv` and install `codespell` there. If after running `make precommit` the output of `git status` contains `nothing to commit, working tree clean` then it means that everything is up-to-date and properly formatted. ## Pull Requests ### How to Send Pull Requests Everyone is welcome to contribute code to `opentelemetry-go` via GitHub pull requests (PRs). To create a new PR, fork the project in GitHub and clone the upstream repo: ```sh go get -d go.opentelemetry.io/otel ``` (This may print some warning about "build constraints exclude all Go files", just ignore it.) This will put the project in `${GOPATH}/src/go.opentelemetry.io/otel`. Alternatively, you can use `git` directly with: ```sh git clone https://github.com/open-telemetry/opentelemetry-go ``` (Note that `git clone` is *not* using the `go.opentelemetry.io/otel` name - that name is a kind of a redirector to GitHub that `go get` can understand, but `git` does not.) This will add the project as `opentelemetry-go` within the current directory. Enter the newly created directory and add your fork as a new remote: ```sh git remote add git@github.com:/opentelemetry-go ``` Check out a new branch, make modifications, run linters and tests, update `CHANGELOG.md`, and push the branch to your fork: ```sh git checkout -b # edit files # update changelog make precommit git add -p git commit git push ``` Open a pull request against the main `opentelemetry-go` repo. Be sure to add the pull request ID to the entry you added to `CHANGELOG.md`. Avoid rebasing and force-pushing to your branch to facilitate reviewing the pull request. Rewriting Git history makes it difficult to keep track of iterations during code review. All pull requests are squashed to a single commit upon merge to `main`. ### How to Receive Comments * If the PR is not ready for review, please put `[WIP]` in the title, tag it as `work-in-progress`, or mark it as [`draft`](https://github.blog/2019-02-14-introducing-draft-pull-requests/). * Make sure CLA is signed and CI is clear. ### How to Get PRs Merged A PR is considered **ready to merge** when: * It has received two qualified approvals[^1]. This is not enforced through automation, but needs to be validated by the maintainer merging. * At least one of the qualified approvals needs to be from an [Approver]/[Maintainer] affiliated with a different company than the author of the PR. * PRs introducing changes that have already been discussed and consensus reached only need one qualified approval. The discussion and resolution needs to be linked to the PR. * Trivial changes[^2] only need one qualified approval. * All feedback has been addressed. * All PR comments and suggestions are resolved. * All GitHub Pull Request reviews with a status of "Request changes" have been addressed. Another review by the objecting reviewer with a different status can be submitted to clear the original review, or the review can be dismissed by a [Maintainer] when the issues from the original review have been addressed. * Any comments or reviews that cannot be resolved between the PR author and reviewers can be submitted to the community [Approver]s and [Maintainer]s during the weekly SIG meeting. If consensus is reached among the [Approver]s and [Maintainer]s during the SIG meeting the objections to the PR may be dismissed or resolved or the PR closed by a [Maintainer]. * Any substantive changes to the PR require existing Approval reviews be cleared unless the approver explicitly states that their approval persists across changes. This includes changes resulting from other feedback. [Approver]s and [Maintainer]s can help in clearing reviews and they should be consulted if there are any questions. * The PR branch is up to date with the base branch it is merging into. * To ensure this does not block the PR, it should be configured to allow maintainers to update it. * It has been open for review for at least one working day. This gives people reasonable time to review. * Trivial changes[^2] do not have to wait for one day and may be merged with a single [Maintainer]'s approval. * All required GitHub workflows have succeeded. * Urgent fix can take exception as long as it has been actively communicated among [Maintainer]s. Any [Maintainer] can merge the PR once the above criteria have been met. [^1]: A qualified approval is a GitHub Pull Request review with "Approve" status from an OpenTelemetry Go [Approver] or [Maintainer]. [^2]: Trivial changes include: typo corrections, cosmetic non-substantive changes, documentation corrections or updates, dependency updates, etc. ## Design Choices As with other OpenTelemetry clients, opentelemetry-go follows the [OpenTelemetry Specification](https://opentelemetry.io/docs/specs/otel). It's especially valuable to read through the [library guidelines](https://opentelemetry.io/docs/specs/otel/library-guidelines). ### Focus on Capabilities, Not Structure Compliance OpenTelemetry is an evolving specification, one where the desires and use cases are clear, but the methods to satisfy those use cases are not. As such, Contributions should provide functionality and behavior that conforms to the specification, but the interface and structure are flexible. It is preferable to have contributions follow the idioms of the language rather than conform to specific API names or argument patterns in the spec. For a deeper discussion, see [this](https://github.com/open-telemetry/opentelemetry-specification/issues/165). ## Tests Each functionality should be covered by tests. Performance-critical functionality should also be covered by benchmarks. - Pull requests adding a performance-critical functionality should have `go test -bench` output in their description. - Pull requests changing a performance-critical functionality should have [`benchstat`](https://pkg.go.dev/golang.org/x/perf/cmd/benchstat) output in their description. ## Dependencies This project uses [Go Modules] for dependency management. All modules will use `go.mod` to explicitly list all direct and indirect dependencies, ensuring a clear dependency graph. The `go.sum` file for each module will be committed to the repository and used to verify the integrity of downloaded modules, preventing malicious tampering. This project uses automated dependency update tools (i.e. dependabot, renovatebot) to manage updates to dependencies. This ensures that dependencies are kept up-to-date with the latest security patches and features and are reviewed before being merged. If you would like to propose a change to a dependency it should be done through a pull request that updates the `go.mod` file and includes a description of the change. See the [versioning and compatibility](./VERSIONING.md) policy for more details about dependency compatibility. [Go Modules]: https://pkg.go.dev/cmd/go#hdr-Modules__module_versions__and_more ### Environment Dependencies This project does not partition dependencies based on the environment (i.e. `development`, `staging`, `production`). Only the dependencies explicitly included in the released modules have been tested and verified to work with the released code. No other guarantee is made about the compatibility of other dependencies. ## Documentation Each (non-internal, non-test) package must be documented using [Go Doc Comments](https://go.dev/doc/comment), preferably in a `doc.go` file. Prefer using [Examples](https://pkg.go.dev/testing#hdr-Examples) instead of putting code snippets in Go doc comments. In some cases, you can even create [Testable Examples](https://go.dev/blog/examples). You can install and run a "local Go Doc site" in the following way: ```sh go install golang.org/x/pkgsite/cmd/pkgsite@latest pkgsite ``` [`go.opentelemetry.io/otel/metric`](https://pkg.go.dev/go.opentelemetry.io/otel/metric) is an example of a very well-documented package. ### README files Each (non-internal, non-test, non-documentation) package must contain a `README.md` file containing at least a title, and a `pkg.go.dev` badge. The README should not be a repetition of Go doc comments. You can verify the presence of all README files with the `make verify-readmes` command. ## Style Guide One of the primary goals of this project is that it is actually used by developers. With this goal in mind the project strives to build user-friendly and idiomatic Go code adhering to the Go community's best practices. For a non-comprehensive but foundational overview of these best practices the [Effective Go](https://golang.org/doc/effective_go.html) documentation is an excellent starting place. We also recommend following the [Go Code Review Comments](https://go.dev/wiki/CodeReviewComments) that collects common comments made during reviews of Go code. As a convenience for developers building this project the `make precommit` will format, lint, validate, and in some cases fix the changes you plan to submit. This check will need to pass for your changes to be able to be merged. In addition to idiomatic Go, the project has adopted certain standards for implementations of common patterns. These standards should be followed as a default, and if they are not followed documentation needs to be included as to the reasons why. ### Configuration When creating an instantiation function for a complex `type T struct`, it is useful to allow variable number of options to be applied. However, the strong type system of Go restricts the function design options. There are a few ways to solve this problem, but we have landed on the following design. #### `config` Configuration should be held in a `struct` named `config`, or prefixed with specific type name this Configuration applies to if there are multiple `config` in the package. This type must contain configuration options. ```go // config contains configuration options for a thing. type config struct { // options ... } ``` In general the `config` type will not need to be used externally to the package and should be unexported. If, however, it is expected that the user will likely want to build custom options for the configuration, the `config` should be exported. Please, include in the documentation for the `config` how the user can extend the configuration. It is important that internal `config` are not shared across package boundaries. Meaning a `config` from one package should not be directly used by another. The one exception is the API packages. The configs from the base API, eg. `go.opentelemetry.io/otel/trace.TracerConfig` and `go.opentelemetry.io/otel/metric.InstrumentConfig`, are intended to be consumed by the SDK therefore it is expected that these are exported. When a config is exported we want to maintain forward and backward compatibility, to achieve this no fields should be exported but should instead be accessed by methods. Optionally, it is common to include a `newConfig` function (with the same naming scheme). This function wraps any defaults setting and looping over all options to create a configured `config`. ```go // newConfig returns an appropriately configured config. func newConfig(options ...Option) config { // Set default values for config. config := config{/* […] */} for _, option := range options { config = option.apply(config) } // Perform any validation here. return config } ``` If validation of the `config` options is also performed this can return an error as well that is expected to be handled by the instantiation function or propagated to the user. Given the design goal of not having the user need to work with the `config`, the `newConfig` function should also be unexported. #### `Option` To set the value of the options a `config` contains, a corresponding `Option` interface type should be used. ```go type Option interface { apply(config) config } ``` Having `apply` unexported makes sure that it will not be used externally. Moreover, the interface becomes sealed so the user cannot easily implement the interface on its own. The `apply` method should return a modified version of the passed config. This approach, instead of passing a pointer, is used to prevent the config from being allocated to the heap. The name of the interface should be prefixed in the same way the corresponding `config` is (if at all). #### Options All user configurable options for a `config` must have a related unexported implementation of the `Option` interface and an exported configuration function that wraps this implementation. The wrapping function name should be prefixed with `With*` (or in the special case of a boolean options `Without*`) and should have the following function signature. ```go func With*(…) Option { … } ``` ##### `bool` Options ```go type defaultFalseOption bool func (o defaultFalseOption) apply(c config) config { c.Bool = bool(o) return c } // WithOption sets a T to have an option included. func WithOption() Option { return defaultFalseOption(true) } ``` ```go type defaultTrueOption bool func (o defaultTrueOption) apply(c config) config { c.Bool = bool(o) return c } // WithoutOption sets a T to have Bool option excluded. func WithoutOption() Option { return defaultTrueOption(false) } ``` ##### Declared Type Options ```go type myTypeOption struct { MyType MyType } func (o myTypeOption) apply(c config) config { c.MyType = o.MyType return c } // WithMyType sets T to have include MyType. func WithMyType(t MyType) Option { return myTypeOption{t} } ``` ##### Functional Options ```go type optionFunc func(config) config func (fn optionFunc) apply(c config) config { return fn(c) } // WithMyType sets t as MyType. func WithMyType(t MyType) Option { return optionFunc(func(c config) config { c.MyType = t return c }) } ``` #### Instantiation Using this configuration pattern to configure instantiation with a `NewT` function. ```go func NewT(options ...Option) T {…} ``` Any required parameters can be declared before the variadic `options`. #### Dealing with Overlap Sometimes there are multiple complex `struct` that share common configuration and also have distinct configuration. To avoid repeated portions of `config`s, a common `config` can be used with the union of options being handled with the `Option` interface. For example. ```go // config holds options for all animals. type config struct { Weight float64 Color string MaxAltitude float64 } // DogOption apply Dog specific options. type DogOption interface { applyDog(config) config } // BirdOption apply Bird specific options. type BirdOption interface { applyBird(config) config } // Option apply options for all animals. type Option interface { BirdOption DogOption } type weightOption float64 func (o weightOption) applyDog(c config) config { c.Weight = float64(o) return c } func (o weightOption) applyBird(c config) config { c.Weight = float64(o) return c } func WithWeight(w float64) Option { return weightOption(w) } type furColorOption string func (o furColorOption) applyDog(c config) config { c.Color = string(o) return c } func WithFurColor(c string) DogOption { return furColorOption(c) } type maxAltitudeOption float64 func (o maxAltitudeOption) applyBird(c config) config { c.MaxAltitude = float64(o) return c } func WithMaxAltitude(a float64) BirdOption { return maxAltitudeOption(a) } func NewDog(name string, o ...DogOption) Dog {…} func NewBird(name string, o ...BirdOption) Bird {…} ``` ### Interfaces To allow other developers to better comprehend the code, it is important to ensure it is sufficiently documented. One simple measure that contributes to this aim is self-documenting by naming method parameters. Therefore, where appropriate, methods of every exported interface type should have their parameters appropriately named. #### Interface Stability All exported stable interfaces that include the following warning in their documentation are allowed to be extended with additional methods. > Warning: methods may be added to this interface in minor releases. These interfaces are defined by the OpenTelemetry specification and will be updated as the specification evolves. Otherwise, stable interfaces MUST NOT be modified. #### How to Change Specification Interfaces When an API change must be made, we will update the SDK with the new method one release before the API change. This will allow the SDK one version before the API change to work seamlessly with the new API. If an incompatible version of the SDK is used with the new API the application will fail to compile. #### How Not to Change Specification Interfaces We have explored using a v2 of the API to change interfaces and found that there was no way to introduce a v2 and have it work seamlessly with the v1 of the API. Problems happened with libraries that upgraded to v2 when an application did not, and would not produce any telemetry. More detail of the approaches considered and their limitations can be found in the [Use a V2 API to evolve interfaces](https://github.com/open-telemetry/opentelemetry-go/issues/3920) issue. #### How to Change Other Interfaces If new functionality is needed for an interface that cannot be changed it MUST be added by including an additional interface. That added interface can be a simple interface for the specific functionality that you want to add or it can be a super-set of the original interface. For example, if you wanted to a `Close` method to the `Exporter` interface: ```go type Exporter interface { Export() } ``` A new interface, `Closer`, can be added: ```go type Closer interface { Close() } ``` Code that is passed the `Exporter` interface can now check to see if the passed value also satisfies the new interface. E.g. ```go func caller(e Exporter) { /* ... */ if c, ok := e.(Closer); ok { c.Close() } /* ... */ } ``` Alternatively, a new type that is the super-set of an `Exporter` can be created. ```go type ClosingExporter struct { Exporter Close() } ``` This new type can be used similar to the simple interface above in that a passed `Exporter` type can be asserted to satisfy the `ClosingExporter` type and the `Close` method called. This super-set approach can be useful if there is explicit behavior that needs to be coupled with the original type and passed as a unified type to a new function, but, because of this coupling, it also limits the applicability of the added functionality. If there exist other interfaces where this functionality should be added, each one will need their own super-set interfaces and will duplicate the pattern. For this reason, the simple targeted interface that defines the specific functionality should be preferred. See also: [Keeping Your Modules Compatible: Working with interfaces](https://go.dev/blog/module-compatibility#working-with-interfaces). ### Testing We allow using [`testify`](https://github.com/stretchr/testify) even though it is seen as non-idiomatic according to the [Go Test Comments](https://go.dev/wiki/TestComments#assert-libraries) page. The tests should never leak goroutines. Use the term `ConcurrentSafe` in the test name when it aims to verify the absence of race conditions. The top-level tests with this term will be run many times in the `test-concurrent-safe` CI job to increase the chance of catching concurrency issues. This does not apply to subtests when this term is not in their root name. ### Internal packages The use of internal packages should be scoped to a single module. A sub-module should never import from a parent internal package. This creates a coupling between the two modules where a user can upgrade the parent without the child, and if the internal package API has changed, it will fail to upgrade[^3]. There are two known exceptions to this rule: - `go.opentelemetry.io/otel/internal/global` - This package manages global state for all of opentelemetry-go. It needs to be a single package in order to ensure the uniqueness of the global state. - `go.opentelemetry.io/otel/internal/baggage` - This package provides values in a `context.Context` that need to be recognized by `go.opentelemetry.io/otel/baggage` and `go.opentelemetry.io/otel/bridge/opentracing` but remain private. If you have duplicate code in multiple modules, make that code into a Go template stored in `go.opentelemetry.io/otel/internal/shared` and use [gotmpl] to render the templates in the desired locations. See [#4404] for an example of this. [^3]: https://github.com/open-telemetry/opentelemetry-go/issues/3548 ### Ignoring context cancellation OpenTelemetry API implementations need to ignore the cancellation of the context that is passed when recording a value (e.g. starting a span, recording a measurement, emitting a log). Recording methods should not return an error describing the cancellation state of the context when they complete, nor should they abort any work. This rule may not apply if the OpenTelemetry specification defines a timeout mechanism for the method. In that case the context cancellation can be used for the timeout with the restriction that this behavior is documented for the method. Otherwise, timeouts are expected to be handled by the user calling the API, not the implementation. Stoppage of the telemetry pipeline is handled by calling the appropriate `Shutdown` method of a provider. It is assumed the context passed from a user is not used for this purpose. Outside of the direct recording of telemetry from the API (e.g. exporting telemetry, force flushing telemetry, shutting down a signal provider) the context cancellation should be honored. This means all work done on behalf of the user provided context should be canceled. ### Observability OpenTelemetry Go SDK components should be instrumented to enable users observability for the health and performance of the telemetry pipeline itself. This allows operators to understand how well their observability infrastructure is functioning and to identify potential issues before they impact their applications. This section outlines the best practices for building instrumentation in OpenTelemetry Go SDK components. #### Environment Variable Activation Observability features are currently experimental. They should be disabled by default and activated through the `OTEL_GO_X_OBSERVABILITY` environment variable. This follows the established experimental feature pattern used throughout the SDK. Components should check for this environment variable using a consistent pattern: ```go import "go.opentelemetry.io/otel/*/internal/x" if x.Observability.Enabled() { // Initialize observability metrics } ``` **References**: - [stdouttrace exporter](./exporters/stdout/stdouttrace/internal/x/x.go) - [sdk](./sdk/internal/x/x.go) #### Encapsulation Instrumentation should be encapsulated within a dedicated `struct` (e.g. `instrumentation`). It should not be mixed into the instrumented component. Prefer this: ```go type SDKComponent struct { inst *instrumentation } type instrumentation struct { inflight otelconv.SDKComponentInflight exported otelconv.SDKComponentExported } ``` To this: ```go // ❌ Avoid this pattern. type SDKComponent struct { /* other SDKComponent fields... */ inflight otelconv.SDKComponentInflight exported otelconv.SDKComponentExported } ``` The instrumentation code should not bloat the code being instrumented. Likely, this means its own file, or its own package if it is complex or reused. #### Initialization Instrumentation setup should be explicit, side-effect free, and local to the relevant component. Avoid relying on global or implicit [side effects][side-effect] for initialization. Encapsulate setup in constructor functions, ensuring clear ownership and scope: ```go import ( "errors" semconv "go.opentelemetry.io/otel/semconv/v1.39.0" "go.opentelemetry.io/otel/semconv/v1.39.0/otelconv" ) type SDKComponent struct { inst *instrumentation } func NewSDKComponent(config Config) (*SDKComponent, error) { inst, err := newInstrumentation() if err != nil { return nil, err } return &SDKComponent{inst: inst}, nil } type instrumentation struct { inflight otelconv.SDKComponentInflight exported otelconv.SDKComponentExported } func newInstrumentation() (*instrumentation, error) { if !x.Observability.Enabled() { return nil, nil } meter := otel.GetMeterProvider().Meter( "", metric.WithInstrumentationVersion(sdk.Version()), metric.WithSchemaURL(semconv.SchemaURL), ) inst := &instrumentation{} var err, e error inst.inflight, e = otelconv.NewSDKComponentInflight(meter) err = errors.Join(err, e) inst.exported, e = otelconv.NewSDKComponentExported(meter) err = errors.Join(err, e) return inst, err } ``` ```go // ❌ Avoid this pattern. func (c *Component) initObservability() { // Initialize observability metrics if !x.Observability.Enabled() { return } // Initialize observability metrics c.inst = &instrumentation{/* ... */} } ``` [side-effect]: https://en.wikipedia.org/wiki/Side_effect_(computer_science) #### Performance When observability is disabled there should be little to no overhead. ```go func (e *Exporter) ExportSpans(ctx context.Context, spans []trace.ReadOnlySpan) error { if e.inst != nil { attrs := expensiveOperation() e.inst.recordSpanInflight(ctx, int64(len(spans)), attrs...) } // Export spans... } ``` ```go // ❌ Avoid this pattern. func (e *Exporter) ExportSpans(ctx context.Context, spans []trace.ReadOnlySpan) error { attrs := expensiveOperation() e.inst.recordSpanInflight(ctx, int64(len(spans)), attrs...) // Export spans... } func (i *instrumentation) recordSpanInflight(ctx context.Context, count int64, attrs ...attribute.KeyValue) { if i == nil || i.inflight == nil { return } i.inflight.Add(ctx, count, metric.WithAttributes(attrs...)) } ``` When observability is enabled, the instrumentation code paths should be optimized to reduce allocation and computation overhead. ##### Attribute and Option Allocation Management Pool attribute slices and options with [`sync.Pool`] to minimize allocations in measurement calls with dynamic attributes. ```go var ( attrPool = sync.Pool{ New: func() any { // Pre-allocate common capacity knownCap := 8 // Adjust based on expected usage s := make([]attribute.KeyValue, 0, knownCap) // Return a pointer to avoid extra allocation on Put(). return &s }, } addOptPool = &sync.Pool{ New: func() any { const n = 1 // WithAttributeSet o := make([]metric.AddOption, 0, n) // Return a pointer to avoid extra allocation on Put(). return &o }, } ) func (i *instrumentation) record(ctx context.Context, value int64, baseAttrs ...attribute.KeyValue) { attrs := attrPool.Get().(*[]attribute.KeyValue) defer func() { *attrs = (*attrs)[:0] // Reset. attrPool.Put(attrs) }() *attrs = append(*attrs, baseAttrs...) // Add any dynamic attributes. *attrs = append(*attrs, semconv.OTelComponentName("exporter-1")) addOpt := addOptPool.Get().(*[]metric.AddOption) defer func() { *addOpt = (*addOpt)[:0] addOptPool.Put(addOpt) }() set := attribute.NewSet(*attrs...) *addOpt = append(*addOpt, metric.WithAttributeSet(set)) i.counter.Add(ctx, value, *addOpt...) } ``` Pools are most effective when there are many pooled objects of the same sufficiently large size, and the objects are repeatedly used. This amortizes the cost of allocation and synchronization. Ideally, the pools should be scoped to be used as widely as possible within the component to maximize this efficiency while still ensuring correctness. [`sync.Pool`]: https://pkg.go.dev/sync#Pool ##### Cache common attribute sets for repeated measurements If a static set of attributes are used for measurements and they are known at compile time, pre-compute and cache these attributes. ```go type spanLiveSetKey struct { sampled bool } var spanLiveSetCache = map[spanLiveSetKey]attribute.Set{ {true}: attribute.NewSet( otelconv.SDKSpanLive{}.AttrSpanSamplingResult( otelconv.SpanSamplingResultRecordAndSample, ), ), {false}: attribute.NewSet( otelconv.SDKSpanLive{}.AttrSpanSamplingResult( otelconv.SpanSamplingResultRecordOnly, ), ), } func spanLiveSet(sampled bool) attribute.Set { key := spanLiveSetKey{sampled: sampled} return spanLiveSetCache[key] } ``` ##### Benchmarking Always provide benchmarks when introducing or refactoring instrumentation. Demonstrate the impact (allocs/op, B/op, ns/op) in enabled/disabled scenarios: ```go func BenchmarkExportSpans(b *testing.B) { scenarios := []struct { name string obsEnabled bool }{ {"ObsDisabled", false}, {"ObsEnabled", true}, } for _, scenario := range scenarios { b.Run(scenario.name, func(b *testing.B) { b.Setenv( "OTEL_GO_X_OBSERVABILITY", strconv.FormatBool(scenario.obsEnabled), ) exporter := NewExporter() spans := generateTestSpans(100) b.ResetTimer() b.ReportAllocs() for i := 0; i < b.N; i++ { _ = exporter.ExportSpans(context.Background(), spans) } }) } } ``` #### Error Handling and Robustness Errors should be reported back to the caller if possible, and partial failures should be handled as gracefully as possible. ```go func newInstrumentation() (*instrumentation, error) { if !x.Observability.Enabled() { return nil, nil } m := otel.GetMeterProvider().Meter(/* initialize meter */) counter, err := otelconv.NewSDKComponentCounter(m) // Use the partially initialized counter if available. i := &instrumentation{counter: counter} // Return any error to the caller. return i, err } ``` ```go // ❌ Avoid this pattern. func newInstrumentation() *instrumentation { if !x.Observability.Enabled() { return nil, nil } m := otel.GetMeterProvider().Meter(/* initialize meter */) counter, err := otelconv.NewSDKComponentCounter(m) if err != nil { // ❌ Do not dump the error to the OTel Handler. Return it to the // caller. otel.Handle(err) // ❌ Do not return nil if we can still use the partially initialized // counter. return nil } return &instrumentation{counter: counter} } ``` If the instrumented component cannot report the error to the user, let it report the error to `otel.Handle`. #### Context Propagation Ensure observability measurements receive the correct context, especially for trace exemplars and distributed context: ```go func (e *Exporter) ExportSpans(ctx context.Context, spans []trace.ReadOnlySpan) error { // Use the provided context for observability measurements e.inst.recordSpanExportStarted(ctx, len(spans)) err := e.doExport(ctx, spans) if err != nil { e.inst.recordSpanExportFailed(ctx, len(spans), err) } else { e.inst.recordSpanExportSucceeded(ctx, len(spans)) } return err } ``` ```go // ❌ Avoid this pattern. func (e *Exporter) ExportSpans(ctx context.Context, spans []trace.ReadOnlySpan) error { // ❌ Do not break the context propagation. e.inst.recordSpanExportStarted(context.Background(), len(spans)) err := e.doExport(ctx, spans) /* ... */ return err } ``` #### Semantic Conventions Compliance All observability metrics should follow the [OpenTelemetry Semantic Conventions for SDK metrics](https://github.com/open-telemetry/semantic-conventions/blob/1cf2476ae5e518225a766990a28a6d5602bd5a30/docs/otel/sdk-metrics.md). Use the metric semantic conventions convenience package [otelconv](./semconv/v1.39.0/otelconv/metric.go). ##### Component Identification Component names and types should follow [semantic convention](https://github.com/open-telemetry/semantic-conventions/blob/1cf2476ae5e518225a766990a28a6d5602bd5a30/docs/registry/attributes/otel.md#otel-component-attributes). If a component is not a well-known type specified in the semantic conventions, use the package path scope type as a stable identifier. ```go componentType := "go.opentelemetry.io/otel/sdk/trace.Span" ``` ```go // ❌ Do not do this. componentType := "trace-span" ``` The component name should be a stable unique identifier for the specific instance of the component. Use a global counter to ensure uniqueness if necessary. ```go // Unique 0-based ID counter for component instances. var componentIDCounter atomic.Int64 // nextID returns the next unique ID for a component. func nextID() int64 { return componentIDCounter.Add(1) - 1 } // componentName returns a unique name for the component instance. func componentName() attribute.KeyValue { id := nextID() name := fmt.Sprintf("%s/%d", componentType, id) return semconv.OTelComponentName(name) } ``` The component ID will need to be resettable for deterministic testing. If tests are in a different package than the component being tested (i.e. a `_test` package name), use a generated `counter` internal package to manage the counter. See [stdouttrace exporter example](./exporters/stdout/stdouttrace/internal/gen.go) for reference. #### Testing Use deterministic testing with isolated state: ```go func TestObservability(t *testing.T) { // Restore state after test to ensure this does not affect other tests. prev := otel.GetMeterProvider() t.Cleanup(func() { otel.SetMeterProvider(prev) }) // Isolate the meter provider for deterministic testing reader := metric.NewManualReader() meterProvider := metric.NewMeterProvider(metric.WithReader(reader)) otel.SetMeterProvider(meterProvider) // Use t.Setenv to ensure environment variable is restored after test. t.Setenv("OTEL_GO_X_OBSERVABILITY", "true") // Reset component ID counter to ensure deterministic component names. componentIDCounter.Store(0) /* ... test code ... */ } ``` Test order should not affect results. Ensure that any global state (e.g. component ID counters) is reset between tests. ## Approvers and Maintainers ### Maintainers - [Damien Mathieu](https://github.com/dmathieu), Elastic ([GPG](https://keys.openpgp.org/search?q=5A126B972A81A6CE443E5E1B408B8E44F0873832)) - [David Ashpole](https://github.com/dashpole), Google ([GPG](https://keys.openpgp.org/search?q=C0D1BDDCAAEAE573673085F176327DA4D864DC70)) - [Robert Pająk](https://github.com/pellared), Splunk ([GPG](https://keys.openpgp.org/search?q=CDAD3A60476A3DE599AA5092E5F7C35A4DBE90C2)) - [Sam Xie](https://github.com/XSAM), Splunk ([GPG](https://keys.openpgp.org/search?q=AEA033782371ABB18EE39188B8044925D6FEEBEA)) - [Tyler Yahn](https://github.com/MrAlias), Splunk ([GPG](https://keys.openpgp.org/search?q=0x46B0F3E1A8B1BA5A)) For more information about the maintainer role, see the [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#maintainer). ### Approvers - [Flc](https://github.com/flc1125), Independent For more information about the approver role, see the [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#approver). ### Triagers - [Alex Kats](https://github.com/akats7), Capital One For more information about the triager role, see the [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#triager). ### Emeritus - [Aaron Clawson](https://github.com/MadVikingGod) - [Anthony Mirabella](https://github.com/Aneurysm9) - [Cheng-Zhen Yang](https://github.com/scorpionknifes) - [Chester Cheung](https://github.com/hanyuancheung) - [Evan Torrie](https://github.com/evantorrie) - [Gustavo Silva Paiva](https://github.com/paivagustavo) - [Josh MacDonald](https://github.com/jmacd) - [Liz Fong-Jones](https://github.com/lizthegrey) For more information about the emeritus role, see the [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#emeritus-maintainerapprovertriager). ### Become an Approver or a Maintainer See the [community membership document in OpenTelemetry community repo](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md). [Approver]: #approvers [Maintainer]: #maintainers [gotmpl]: https://pkg.go.dev/go.opentelemetry.io/build-tools/gotmpl [#4404]: https://github.com/open-telemetry/opentelemetry-go/pull/4404 ================================================ FILE: vendor/go.opentelemetry.io/otel/LICENSE ================================================ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -------------------------------------------------------------------------------- Copyright 2009 The Go Authors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: vendor/go.opentelemetry.io/otel/Makefile ================================================ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 TOOLS_MOD_DIR := ./internal/tools ALL_DOCS := $(shell find . -name '*.md' -type f | sort) ALL_GO_MOD_DIRS := $(shell find . -type f -name 'go.mod' -exec dirname {} \; | sort) OTEL_GO_MOD_DIRS := $(filter-out $(TOOLS_MOD_DIR), $(ALL_GO_MOD_DIRS)) ALL_COVERAGE_MOD_DIRS := $(shell find . -type f -name 'go.mod' -exec dirname {} \; | grep -E -v '^./example|^$(TOOLS_MOD_DIR)' | sort) GO = go TIMEOUT = 60 # User to run as in docker images. DOCKER_USER=$(shell id -u):$(shell id -g) DEPENDENCIES_DOCKERFILE=./dependencies.Dockerfile .DEFAULT_GOAL := precommit .PHONY: precommit ci precommit: generate toolchain-check license-check misspell go-mod-tidy golangci-lint-fix verify-readmes verify-mods test-default ci: generate toolchain-check license-check lint vanity-import-check verify-readmes verify-mods build test-default check-clean-work-tree test-coverage # Tools TOOLS = $(CURDIR)/.tools $(TOOLS): @mkdir -p $@ $(TOOLS)/%: $(TOOLS_MOD_DIR)/go.mod | $(TOOLS) cd $(TOOLS_MOD_DIR) && \ $(GO) build -o $@ $(PACKAGE) MULTIMOD = $(TOOLS)/multimod $(TOOLS)/multimod: PACKAGE=go.opentelemetry.io/build-tools/multimod CROSSLINK = $(TOOLS)/crosslink $(TOOLS)/crosslink: PACKAGE=go.opentelemetry.io/build-tools/crosslink SEMCONVKIT = $(TOOLS)/semconvkit $(TOOLS)/semconvkit: PACKAGE=go.opentelemetry.io/otel/$(TOOLS_MOD_DIR)/semconvkit VERIFYREADMES = $(TOOLS)/verifyreadmes $(TOOLS)/verifyreadmes: PACKAGE=go.opentelemetry.io/otel/$(TOOLS_MOD_DIR)/verifyreadmes GOLANGCI_LINT = $(TOOLS)/golangci-lint $(TOOLS)/golangci-lint: PACKAGE=github.com/golangci/golangci-lint/v2/cmd/golangci-lint MISSPELL = $(TOOLS)/misspell $(TOOLS)/misspell: PACKAGE=github.com/client9/misspell/cmd/misspell GOCOVMERGE = $(TOOLS)/gocovmerge $(TOOLS)/gocovmerge: PACKAGE=github.com/wadey/gocovmerge STRINGER = $(TOOLS)/stringer $(TOOLS)/stringer: PACKAGE=golang.org/x/tools/cmd/stringer PORTO = $(TOOLS)/porto $(TOOLS)/porto: PACKAGE=github.com/jcchavezs/porto/cmd/porto GOTMPL = $(TOOLS)/gotmpl $(GOTMPL): PACKAGE=go.opentelemetry.io/build-tools/gotmpl GORELEASE = $(TOOLS)/gorelease $(GORELEASE): PACKAGE=golang.org/x/exp/cmd/gorelease GOVULNCHECK = $(TOOLS)/govulncheck $(TOOLS)/govulncheck: PACKAGE=golang.org/x/vuln/cmd/govulncheck .PHONY: tools tools: $(CROSSLINK) $(GOLANGCI_LINT) $(MISSPELL) $(GOCOVMERGE) $(STRINGER) $(PORTO) $(VERIFYREADMES) $(MULTIMOD) $(SEMCONVKIT) $(GOTMPL) $(GORELEASE) # Virtualized python tools via docker # The directory where the virtual environment is created. VENVDIR := venv # The directory where the python tools are installed. PYTOOLS := $(VENVDIR)/bin # The pip executable in the virtual environment. PIP := $(PYTOOLS)/pip # The directory in the docker image where the current directory is mounted. WORKDIR := /workdir # The python image to use for the virtual environment. PYTHONIMAGE := $(shell awk '$$4=="python" {print $$2}' $(DEPENDENCIES_DOCKERFILE)) # Run the python image with the current directory mounted. DOCKERPY := docker run --rm -u $(DOCKER_USER) -v "$(CURDIR):$(WORKDIR)" -w $(WORKDIR) $(PYTHONIMAGE) # Create a virtual environment for Python tools. $(PYTOOLS): # The `--upgrade` flag is needed to ensure that the virtual environment is # created with the latest pip version. @$(DOCKERPY) bash -c "python3 -m venv $(VENVDIR) && $(PIP) install --upgrade --cache-dir=$(WORKDIR)/.cache/pip pip" # Install python packages into the virtual environment. $(PYTOOLS)/%: $(PYTOOLS) @$(DOCKERPY) $(PIP) install --cache-dir=$(WORKDIR)/.cache/pip -r requirements.txt CODESPELL = $(PYTOOLS)/codespell $(CODESPELL): PACKAGE=codespell # Generate .PHONY: generate generate: go-generate vanity-import-fix .PHONY: go-generate go-generate: $(OTEL_GO_MOD_DIRS:%=go-generate/%) go-generate/%: DIR=$* go-generate/%: $(STRINGER) $(GOTMPL) @echo "$(GO) generate $(DIR)/..." \ && cd $(DIR) \ && PATH="$(TOOLS):$${PATH}" $(GO) generate ./... .PHONY: vanity-import-fix vanity-import-fix: $(PORTO) @$(PORTO) --include-internal -w . # Generate go.work file for local development. .PHONY: go-work go-work: $(CROSSLINK) $(CROSSLINK) work --root=$(shell pwd) --go=1.22.7 # Build .PHONY: build build: $(OTEL_GO_MOD_DIRS:%=build/%) $(OTEL_GO_MOD_DIRS:%=build-tests/%) build/%: DIR=$* build/%: @echo "$(GO) build $(DIR)/..." \ && cd $(DIR) \ && $(GO) build ./... build-tests/%: DIR=$* build-tests/%: @echo "$(GO) build tests $(DIR)/..." \ && cd $(DIR) \ && $(GO) list ./... \ | grep -v third_party \ | xargs $(GO) test -vet=off -run xxxxxMatchNothingxxxxx >/dev/null # Tests TEST_TARGETS := test-default test-bench test-short test-verbose test-race test-concurrent-safe test-fuzz .PHONY: $(TEST_TARGETS) test test-default test-race: ARGS=-race test-bench: ARGS=-run=xxxxxMatchNothingxxxxx -test.benchtime=1ms -bench=. test-short: ARGS=-short test-fuzz: ARGS=-fuzztime=10s -fuzz test-verbose: ARGS=-v -race test-concurrent-safe: ARGS=-run=ConcurrentSafe -count=100 -race test-concurrent-safe: TIMEOUT=120 $(TEST_TARGETS): test test: $(OTEL_GO_MOD_DIRS:%=test/%) test/%: DIR=$* test/%: @echo "$(GO) test -timeout $(TIMEOUT)s $(ARGS) $(DIR)/..." \ && cd $(DIR) \ && $(GO) list ./... \ | grep -v third_party \ | xargs $(GO) test -timeout $(TIMEOUT)s $(ARGS) COVERAGE_MODE = atomic COVERAGE_PROFILE = coverage.out .PHONY: test-coverage test-coverage: $(GOCOVMERGE) @set -e; \ printf "" > coverage.txt; \ for dir in $(ALL_COVERAGE_MOD_DIRS); do \ echo "$(GO) test -coverpkg=go.opentelemetry.io/otel/... -covermode=$(COVERAGE_MODE) -coverprofile="$(COVERAGE_PROFILE)" $${dir}/..."; \ (cd "$${dir}" && \ $(GO) list ./... \ | grep -v third_party \ | grep -v 'semconv/v.*' \ | xargs $(GO) test -coverpkg=./... -covermode=$(COVERAGE_MODE) -coverprofile="$(COVERAGE_PROFILE)" && \ $(GO) tool cover -html=coverage.out -o coverage.html); \ done; \ $(GOCOVMERGE) $$(find . -name coverage.out) > coverage.txt .PHONY: benchmark benchmark: $(OTEL_GO_MOD_DIRS:%=benchmark/%) benchmark/%: @echo "$(GO) test -run=xxxxxMatchNothingxxxxx -bench=. $*..." \ && cd $* \ && $(GO) list ./... \ | grep -v third_party \ | xargs $(GO) test -run=xxxxxMatchNothingxxxxx -bench=. .PHONY: golangci-lint golangci-lint-fix golangci-lint-fix: ARGS=--fix golangci-lint-fix: golangci-lint golangci-lint: $(OTEL_GO_MOD_DIRS:%=golangci-lint/%) golangci-lint/%: DIR=$* golangci-lint/%: $(GOLANGCI_LINT) @echo 'golangci-lint $(if $(ARGS),$(ARGS) ,)$(DIR)' \ && cd $(DIR) \ && $(GOLANGCI_LINT) run --allow-serial-runners $(ARGS) .PHONY: crosslink crosslink: $(CROSSLINK) @echo "Updating intra-repository dependencies in all go modules" \ && $(CROSSLINK) --root=$(shell pwd) --prune .PHONY: go-mod-tidy go-mod-tidy: $(ALL_GO_MOD_DIRS:%=go-mod-tidy/%) go-mod-tidy/%: DIR=$* go-mod-tidy/%: crosslink @echo "$(GO) mod tidy in $(DIR)" \ && cd $(DIR) \ && $(GO) mod tidy -compat=1.21 .PHONY: lint lint: misspell go-mod-tidy golangci-lint govulncheck .PHONY: vanity-import-check vanity-import-check: $(PORTO) @$(PORTO) --include-internal -l . || ( echo "(run: make vanity-import-fix)"; exit 1 ) .PHONY: misspell misspell: $(MISSPELL) @$(MISSPELL) -w $(ALL_DOCS) .PHONY: govulncheck govulncheck: $(OTEL_GO_MOD_DIRS:%=govulncheck/%) govulncheck/%: DIR=$* govulncheck/%: $(GOVULNCHECK) @echo "govulncheck ./... in $(DIR)" \ && cd $(DIR) \ && $(GOVULNCHECK) ./... .PHONY: codespell codespell: $(CODESPELL) @$(DOCKERPY) $(CODESPELL) .PHONY: toolchain-check toolchain-check: @toolchainRes=$$(for f in $(ALL_GO_MOD_DIRS); do \ awk '/^toolchain/ { found=1; next } END { if (found) print FILENAME }' $$f/go.mod; \ done); \ if [ -n "$${toolchainRes}" ]; then \ echo "toolchain checking failed:"; echo "$${toolchainRes}"; \ exit 1; \ fi .PHONY: license-check license-check: @licRes=$$(for f in $$(find . -type f \( -iname '*.go' -o -iname '*.sh' \) ! -path '**/third_party/*' ! -path './.git/*' ) ; do \ awk '/Copyright The OpenTelemetry Authors|generated|GENERATED/ && NR<=4 { found=1; next } END { if (!found) print FILENAME }' $$f; \ done); \ if [ -n "$${licRes}" ]; then \ echo "license header checking failed:"; echo "$${licRes}"; \ exit 1; \ fi .PHONY: check-clean-work-tree check-clean-work-tree: @if ! git diff --quiet; then \ echo; \ echo 'Working tree is not clean, did you forget to run "make precommit"?'; \ echo; \ git status; \ exit 1; \ fi # The weaver docker image to use for semconv-generate. WEAVER_IMAGE := $(shell awk '$$4=="weaver" {print $$2}' $(DEPENDENCIES_DOCKERFILE)) SEMCONVPKG ?= "semconv/" .PHONY: semconv-generate semconv-generate: $(SEMCONVKIT) [ "$(TAG)" ] || ( echo "TAG unset: missing opentelemetry semantic-conventions tag"; exit 1 ) # Ensure the target directory for source code is available. mkdir -p $(PWD)/$(SEMCONVPKG)/${TAG} # Note: We mount a home directory for downloading/storing the semconv repository. # Weaver will automatically clean the cache when finished, but the directories will remain. mkdir -p ~/.weaver docker run --rm \ -u $(DOCKER_USER) \ --env HOME=/tmp/weaver \ --mount 'type=bind,source=$(PWD)/semconv/templates,target=/home/weaver/templates,readonly' \ --mount 'type=bind,source=$(PWD)/semconv/${TAG},target=/home/weaver/target' \ --mount 'type=bind,source=$(HOME)/.weaver,target=/tmp/weaver/.weaver' \ $(WEAVER_IMAGE) registry generate \ --registry=https://github.com/open-telemetry/semantic-conventions/archive/refs/tags/$(TAG).zip[model] \ --templates=/home/weaver/templates \ --param tag=$(TAG) \ go \ /home/weaver/target $(SEMCONVKIT) -semconv "$(SEMCONVPKG)" -tag "$(TAG)" .PHONY: gorelease gorelease: $(OTEL_GO_MOD_DIRS:%=gorelease/%) gorelease/%: DIR=$* gorelease/%:| $(GORELEASE) @echo "gorelease in $(DIR):" \ && cd $(DIR) \ && $(GORELEASE) \ || echo "" .PHONY: verify-mods verify-mods: $(MULTIMOD) $(MULTIMOD) verify .PHONY: prerelease prerelease: verify-mods @[ "${MODSET}" ] || ( echo ">> env var MODSET is not set"; exit 1 ) $(MULTIMOD) prerelease -m ${MODSET} COMMIT ?= "HEAD" .PHONY: add-tags add-tags: verify-mods @[ "${MODSET}" ] || ( echo ">> env var MODSET is not set"; exit 1 ) $(MULTIMOD) tag -m ${MODSET} -c ${COMMIT} MARKDOWNIMAGE := $(shell awk '$$4=="markdown" {print $$2}' $(DEPENDENCIES_DOCKERFILE)) .PHONY: lint-markdown lint-markdown: docker run --rm -u $(DOCKER_USER) -v "$(CURDIR):$(WORKDIR)" $(MARKDOWNIMAGE) -c $(WORKDIR)/.markdownlint.yaml $(WORKDIR)/**/*.md .PHONY: verify-readmes verify-readmes: $(VERIFYREADMES) $(VERIFYREADMES) ================================================ FILE: vendor/go.opentelemetry.io/otel/README.md ================================================ # OpenTelemetry-Go [![ci](https://github.com/open-telemetry/opentelemetry-go/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/open-telemetry/opentelemetry-go/actions/workflows/ci.yml) [![codecov.io](https://codecov.io/gh/open-telemetry/opentelemetry-go/coverage.svg?branch=main)](https://app.codecov.io/gh/open-telemetry/opentelemetry-go?branch=main) [![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel)](https://pkg.go.dev/go.opentelemetry.io/otel) [![Go Report Card](https://goreportcard.com/badge/go.opentelemetry.io/otel)](https://goreportcard.com/report/go.opentelemetry.io/otel) [![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/open-telemetry/opentelemetry-go/badge)](https://scorecard.dev/viewer/?uri=github.com/open-telemetry/opentelemetry-go) [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/9996/badge)](https://www.bestpractices.dev/projects/9996) [![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/opentelemetry-go.svg)](https://issues.oss-fuzz.com/issues?q=project:opentelemetry-go) [![FOSSA Status](https://app.fossa.com/api/projects/custom%2B162%2Fgithub.com%2Fopen-telemetry%2Fopentelemetry-go.svg?type=shield&issueType=license)](https://app.fossa.com/projects/custom%2B162%2Fgithub.com%2Fopen-telemetry%2Fopentelemetry-go?ref=badge_shield&issueType=license) [![Slack](https://img.shields.io/badge/slack-@cncf/otel--go-brightgreen.svg?logo=slack)](https://cloud-native.slack.com/archives/C01NPAXACKT) OpenTelemetry-Go is the [Go](https://golang.org/) implementation of [OpenTelemetry](https://opentelemetry.io/). It provides a set of APIs to directly measure performance and behavior of your software and send this data to observability platforms. ## Project Status | Signal | Status | |---------|--------------------| | Traces | Stable | | Metrics | Stable | | Logs | Beta[^1] | Progress and status specific to this repository is tracked in our [project boards](https://github.com/open-telemetry/opentelemetry-go/projects) and [milestones](https://github.com/open-telemetry/opentelemetry-go/milestones). Project versioning information and stability guarantees can be found in the [versioning documentation](VERSIONING.md). [^1]: https://github.com/orgs/open-telemetry/projects/43 ### Compatibility OpenTelemetry-Go ensures compatibility with the current supported versions of the [Go language](https://golang.org/doc/devel/release#policy): > Each major Go release is supported until there are two newer major releases. > For example, Go 1.5 was supported until the Go 1.7 release, and Go 1.6 was supported until the Go 1.8 release. For versions of Go that are no longer supported upstream, opentelemetry-go will stop ensuring compatibility with these versions in the following manner: - A minor release of opentelemetry-go will be made to add support for the new supported release of Go. - The following minor release of opentelemetry-go will remove compatibility testing for the oldest (now archived upstream) version of Go. This, and future, releases of opentelemetry-go may include features only supported by the currently supported versions of Go. Currently, this project supports the following environments. | OS | Go Version | Architecture | |----------|------------|--------------| | Ubuntu | 1.25 | amd64 | | Ubuntu | 1.24 | amd64 | | Ubuntu | 1.25 | 386 | | Ubuntu | 1.24 | 386 | | Ubuntu | 1.25 | arm64 | | Ubuntu | 1.24 | arm64 | | macOS | 1.25 | amd64 | | macOS | 1.24 | amd64 | | macOS | 1.25 | arm64 | | macOS | 1.24 | arm64 | | Windows | 1.25 | amd64 | | Windows | 1.24 | amd64 | | Windows | 1.25 | 386 | | Windows | 1.24 | 386 | While this project should work for other systems, no compatibility guarantees are made for those systems currently. ## Getting Started You can find a getting started guide on [opentelemetry.io](https://opentelemetry.io/docs/languages/go/getting-started/). OpenTelemetry's goal is to provide a single set of APIs to capture distributed traces and metrics from your application and send them to an observability platform. This project allows you to do just that for applications written in Go. There are two steps to this process: instrument your application, and configure an exporter. ### Instrumentation To start capturing distributed traces and metric events from your application it first needs to be instrumented. The easiest way to do this is by using an instrumentation library for your code. Be sure to check out [the officially supported instrumentation libraries](https://github.com/open-telemetry/opentelemetry-go-contrib/tree/main/instrumentation). If you need to extend the telemetry an instrumentation library provides or want to build your own instrumentation for your application directly you will need to use the [Go otel](https://pkg.go.dev/go.opentelemetry.io/otel) package. The [examples](https://github.com/open-telemetry/opentelemetry-go-contrib/tree/main/examples) are a good way to see some practical uses of this process. ### Export Now that your application is instrumented to collect telemetry, it needs an export pipeline to send that telemetry to an observability platform. All officially supported exporters for the OpenTelemetry project are contained in the [exporters directory](./exporters). | Exporter | Logs | Metrics | Traces | |---------------------------------------|:----:|:-------:|:------:| | [OTLP](./exporters/otlp/) | ✓ | ✓ | ✓ | | [Prometheus](./exporters/prometheus/) | | ✓ | | | [stdout](./exporters/stdout/) | ✓ | ✓ | ✓ | | [Zipkin](./exporters/zipkin/) | | | ✓ | ## Contributing See the [contributing documentation](CONTRIBUTING.md). ================================================ FILE: vendor/go.opentelemetry.io/otel/RELEASING.md ================================================ # Release Process ## Create a `Version Release` issue Create a `Version Release` issue to track the release process. ## Semantic Convention Generation New versions of the [OpenTelemetry Semantic Conventions] mean new versions of the `semconv` package need to be generated. The `semconv-generate` make target is used for this. 1. Set the `TAG` environment variable to the semantic convention tag you want to generate. 2. Run the `make semconv-generate ...` target from this repository. For example, ```sh export TAG="v1.30.0" # Change to the release version you are generating. make semconv-generate # Uses the exported TAG. ``` This should create a new sub-package of [`semconv`](./semconv). Ensure things look correct before submitting a pull request to include the addition. ## Breaking changes validation You can run `make gorelease` which runs [gorelease](https://pkg.go.dev/golang.org/x/exp/cmd/gorelease) to ensure that there are no unwanted changes made in the public API. You can check/report problems with `gorelease` [here](https://golang.org/issues/26420). ## Verify changes for contrib repository If the changes in the main repository are going to affect the contrib repository, it is important to verify that the changes are compatible with the contrib repository. Follow [the steps](https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/RELEASING.md#verify-otel-changes) in the contrib repository to verify OTel changes. ## Pre-Release First, decide which module sets will be released and update their versions in `versions.yaml`. Commit this change to a new branch. Update go.mod for submodules to depend on the new release which will happen in the next step. 1. Run the `prerelease` make target. It creates a branch `prerelease__` that will contain all release changes. ``` make prerelease MODSET= ``` 2. Verify the changes. ``` git diff ...prerelease__ ``` This should have changed the version for all modules to be ``. If these changes look correct, merge them into your pre-release branch: ```go git merge prerelease__ ``` 3. Update the [Changelog](./CHANGELOG.md). - Make sure all relevant changes for this release are included and are written in language that non-contributors to the project can understand. To verify this, you can look directly at the commits since the ``. ``` git --no-pager log --pretty=oneline "..HEAD" ``` - Move all the `Unreleased` changes into a new section following the title scheme (`[] - `). - Make sure the new section is under the comment for released section, like ``, so it is protected from being overwritten in the future. - Update all the appropriate links at the bottom. 4. Push the changes to upstream and create a Pull Request on GitHub. Be sure to include the curated changes from the [Changelog](./CHANGELOG.md) in the description. ## Tag Once the Pull Request with all the version changes has been approved and merged it is time to tag the merged commit. ***IMPORTANT***: It is critical you use the same tag that you used in the Pre-Release step! Failure to do so will leave things in a broken state. As long as you do not change `versions.yaml` between pre-release and this step, things should be fine. ***IMPORTANT***: [There is currently no way to remove an incorrectly tagged version of a Go module](https://github.com/golang/go/issues/34189). It is critical you make sure the version you push upstream is correct. [Failure to do so will lead to minor emergencies and tough to work around](https://github.com/open-telemetry/opentelemetry-go/issues/331). 1. For each module set that will be released, run the `add-tags` make target using the `` of the commit on the main branch for the merged Pull Request. ``` make add-tags MODSET= COMMIT= ``` It should only be necessary to provide an explicit `COMMIT` value if the current `HEAD` of your working directory is not the correct commit. 2. Push tags to the upstream remote (not your fork: `github.com/open-telemetry/opentelemetry-go.git`). Make sure you push all sub-modules as well. ``` git push upstream git push upstream ... ``` ## Sign artifacts To ensure we comply with CNCF best practices, we need to sign the release artifacts. Download the `.tar.gz` and `.zip` archives from the [tags page](https://github.com/open-telemetry/opentelemetry-go/tags) for the new release tag. Both archives need to be signed with your GPG key. You can use [this script] to verify the contents of the archives before signing them. To find your GPG key ID, run: ```terminal gpg --list-secret-keys --keyid-format=long ``` The key ID is the 16-character string after `sec rsa4096/` (or similar). Set environment variables and sign both artifacts: ```terminal export VERSION="" # e.g., v1.32.0 export KEY_ID="" gpg --local-user $KEY_ID --armor --detach-sign opentelemetry-go-$VERSION.tar.gz gpg --local-user $KEY_ID --armor --detach-sign opentelemetry-go-$VERSION.zip ``` You can verify the signatures with: ```terminal gpg --verify opentelemetry-go-$VERSION.tar.gz.asc opentelemetry-go-$VERSION.tar.gz gpg --verify opentelemetry-go-$VERSION.zip.asc opentelemetry-go-$VERSION.zip ``` [this script]: https://github.com/MrAlias/attest-sh ## Release Finally create a Release for the new `` on GitHub. The release body should include all the release notes from the Changelog for this release. ***IMPORTANT***: GitHub Releases are immutable once created. You must upload the signed artifacts (`.tar.gz`, `.tar.gz.asc`, `.zip`, and `.zip.asc`) when creating the release, as they cannot be added or modified later. ## Post-Release ### Contrib Repository Once verified be sure to [make a release for the `contrib` repository](https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/RELEASING.md) that uses this release. ### Website Documentation Update the [Go instrumentation documentation] in the OpenTelemetry website under [content/en/docs/languages/go]. Importantly, bump any package versions referenced to be the latest one you just released and ensure all code examples still compile and are accurate. [OpenTelemetry Semantic Conventions]: https://github.com/open-telemetry/semantic-conventions [Go instrumentation documentation]: https://opentelemetry.io/docs/languages/go/ [content/en/docs/languages/go]: https://github.com/open-telemetry/opentelemetry.io/tree/main/content/en/docs/languages/go ### Close the milestone Once a release is made, ensure all issues that were fixed and PRs that were merged as part of this release are added to the corresponding milestone. This helps track what changes were included in each release. - To find issues that haven't been included in a milestone, use this [GitHub search query](https://github.com/open-telemetry/opentelemetry-go/issues?q=is%3Aissue%20no%3Amilestone%20is%3Aclosed%20sort%3Aupdated-desc%20reason%3Acompleted%20-label%3AStale%20linked%3Apr) - To find merged PRs that haven't been included in a milestone, use this [GitHub search query](https://github.com/open-telemetry/opentelemetry-go/pulls?q=is%3Apr+no%3Amilestone+is%3Amerged). Once all related issues and PRs have been added to the milestone, close the milestone. ### Close the `Version Release` issue Once the todo list in the `Version Release` issue is complete, close the issue. ================================================ FILE: vendor/go.opentelemetry.io/otel/SECURITY-INSIGHTS.yml ================================================ header: schema-version: "1.0.0" expiration-date: "2026-08-04T00:00:00.000Z" last-updated: "2025-08-04" last-reviewed: "2025-08-04" commit-hash: 69e81088ad40f45a0764597326722dea8f3f00a8 project-url: https://github.com/open-telemetry/opentelemetry-go project-release: "v1.37.0" changelog: https://github.com/open-telemetry/opentelemetry-go/blob/69e81088ad40f45a0764597326722dea8f3f00a8/CHANGELOG.md license: https://github.com/open-telemetry/opentelemetry-go/blob/69e81088ad40f45a0764597326722dea8f3f00a8/LICENSE project-lifecycle: status: active bug-fixes-only: false core-maintainers: - https://github.com/dmathieu - https://github.com/dashpole - https://github.com/pellared - https://github.com/XSAM - https://github.com/MrAlias release-process: | See https://github.com/open-telemetry/opentelemetry-go/blob/69e81088ad40f45a0764597326722dea8f3f00a8/RELEASING.md contribution-policy: accepts-pull-requests: true accepts-automated-pull-requests: true automated-tools-list: - automated-tool: dependabot action: allowed comment: Automated dependency updates are accepted. - automated-tool: renovatebot action: allowed comment: Automated dependency updates are accepted. - automated-tool: opentelemetrybot action: allowed comment: Automated OpenTelemetry actions are accepted. contributing-policy: https://github.com/open-telemetry/opentelemetry-go/blob/69e81088ad40f45a0764597326722dea8f3f00a8/CONTRIBUTING.md code-of-conduct: https://github.com/open-telemetry/.github/blob/ffa15f76b65ec7bcc41f6a0b277edbb74f832206/CODE_OF_CONDUCT.md documentation: - https://pkg.go.dev/go.opentelemetry.io/otel - https://opentelemetry.io/docs/instrumentation/go/ distribution-points: - pkg:golang/go.opentelemetry.io/otel - pkg:golang/go.opentelemetry.io/otel/bridge/opencensus - pkg:golang/go.opentelemetry.io/otel/bridge/opencensus/test - pkg:golang/go.opentelemetry.io/otel/bridge/opentracing - pkg:golang/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc - pkg:golang/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp - pkg:golang/go.opentelemetry.io/otel/exporters/otlp/otlptrace - pkg:golang/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc - pkg:golang/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp - pkg:golang/go.opentelemetry.io/otel/exporters/stdout/stdoutmetric - pkg:golang/go.opentelemetry.io/otel/exporters/stdout/stdouttrace - pkg:golang/go.opentelemetry.io/otel/exporters/zipkin - pkg:golang/go.opentelemetry.io/otel/metric - pkg:golang/go.opentelemetry.io/otel/sdk - pkg:golang/go.opentelemetry.io/otel/sdk/metric - pkg:golang/go.opentelemetry.io/otel/trace - pkg:golang/go.opentelemetry.io/otel/exporters/prometheus - pkg:golang/go.opentelemetry.io/otel/log - pkg:golang/go.opentelemetry.io/otel/log/logtest - pkg:golang/go.opentelemetry.io/otel/sdk/log - pkg:golang/go.opentelemetry.io/otel/sdk/log/logtest - pkg:golang/go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc - pkg:golang/go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp - pkg:golang/go.opentelemetry.io/otel/exporters/stdout/stdoutlog - pkg:golang/go.opentelemetry.io/otel/schema security-artifacts: threat-model: threat-model-created: false comment: | No formal threat model created yet. self-assessment: self-assessment-created: false comment: | No formal self-assessment yet. security-testing: - tool-type: sca tool-name: Dependabot tool-version: latest tool-url: https://github.com/dependabot tool-rulesets: - built-in integration: ad-hoc: false ci: true before-release: true comment: | Automated dependency updates. - tool-type: sast tool-name: golangci-lint tool-version: latest tool-url: https://github.com/golangci/golangci-lint tool-rulesets: - built-in integration: ad-hoc: false ci: true before-release: true comment: | Static analysis in CI. - tool-type: fuzzing tool-name: OSS-Fuzz tool-version: latest tool-url: https://github.com/google/oss-fuzz tool-rulesets: - default integration: ad-hoc: false ci: false before-release: false comment: | OpenTelemetry Go is integrated with OSS-Fuzz for continuous fuzz testing. See https://github.com/google/oss-fuzz/tree/f0f9b221190c6063a773bea606d192ebfc3d00cf/projects/opentelemetry-go for more details. - tool-type: sast tool-name: CodeQL tool-version: latest tool-url: https://github.com/github/codeql tool-rulesets: - default integration: ad-hoc: false ci: true before-release: true comment: | CodeQL static analysis is run in CI for all commits and pull requests to detect security vulnerabilities in the Go source code. See https://github.com/open-telemetry/opentelemetry-go/blob/d5b5b059849720144a03ca5c87561bfbdb940119/.github/workflows/codeql-analysis.yml for workflow details. - tool-type: sca tool-name: govulncheck tool-version: latest tool-url: https://pkg.go.dev/golang.org/x/vuln/cmd/govulncheck tool-rulesets: - default integration: ad-hoc: false ci: true before-release: true comment: | govulncheck is run in CI to detect known vulnerabilities in Go modules and code paths. See https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/.github/workflows/ci.yml for workflow configuration. security-assessments: - auditor-name: 7ASecurity auditor-url: https://7asecurity.com auditor-report: https://7asecurity.com/reports/pentest-report-opentelemetry.pdf report-year: 2023 comment: | This independent penetration test by 7ASecurity covered OpenTelemetry repositories including opentelemetry-go. The assessment focused on codebase review, threat modeling, and vulnerability identification. See the report for details of findings and recommendations applicable to opentelemetry-go. No critical vulnerabilities were found for this repository. security-contacts: - type: email value: cncf-opentelemetry-security@lists.cncf.io primary: true - type: website value: https://github.com/open-telemetry/opentelemetry-go/security/policy primary: false vulnerability-reporting: accepts-vulnerability-reports: true email-contact: cncf-opentelemetry-security@lists.cncf.io security-policy: https://github.com/open-telemetry/opentelemetry-go/security/policy comment: | Security issues should be reported via email or GitHub security policy page. dependencies: third-party-packages: true dependencies-lists: - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/go.mod - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/bridge/opencensus/go.mod - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/bridge/opencensus/test/go.mod - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/bridge/opentracing/go.mod - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/exporters/otlp/otlplog/otlploggrpc/go.mod - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/exporters/otlp/otlplog/otlploghttp/go.mod - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/exporters/otlp/otlpmetric/otlpmetricgrpc/go.mod - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/exporters/otlp/otlpmetric/otlpmetrichttp/go.mod - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/exporters/otlp/otlptrace/go.mod - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/exporters/otlp/otlptrace/otlptracegrpc/go.mod - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/exporters/otlp/otlptrace/otlptracehttp/go.mod - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/exporters/prometheus/go.mod - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/exporters/stdout/stdoutlog/go.mod - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/exporters/stdout/stdoutmetric/go.mod - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/exporters/stdout/stdouttrace/go.mod - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/exporters/zipkin/go.mod - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/internal/tools/go.mod - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/log/go.mod - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/log/logtest/go.mod - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/metric/go.mod - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/schema/go.mod - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/sdk/go.mod - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/sdk/log/go.mod - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/sdk/log/logtest/go.mod - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/sdk/metric/go.mod - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/trace/go.mod - https://github.com/open-telemetry/opentelemetry-go/blob/v1.37.0/trace/internal/telemetry/test/go.mod dependencies-lifecycle: policy-url: https://github.com/open-telemetry/opentelemetry-go/blob/69e81088ad40f45a0764597326722dea8f3f00a8/CONTRIBUTING.md comment: | Dependency lifecycle managed via go.mod and renovatebot. env-dependencies-policy: policy-url: https://github.com/open-telemetry/opentelemetry-go/blob/69e81088ad40f45a0764597326722dea8f3f00a8/CONTRIBUTING.md comment: | See contributing policy for environment usage. ================================================ FILE: vendor/go.opentelemetry.io/otel/VERSIONING.md ================================================ # Versioning This document describes the versioning policy for this repository. This policy is designed so the following goals can be achieved. **Users are provided a codebase of value that is stable and secure.** ## Policy * Versioning of this project will be idiomatic of a Go project using [Go modules](https://github.com/golang/go/wiki/Modules). * [Semantic import versioning](https://github.com/golang/go/wiki/Modules#semantic-import-versioning) will be used. * Versions will comply with [semver 2.0](https://semver.org/spec/v2.0.0.html) with the following exceptions. * New methods may be added to exported API interfaces. All exported interfaces that fall within this exception will include the following paragraph in their public documentation. > Warning: methods may be added to this interface in minor releases. * If a module is version `v2` or higher, the major version of the module must be included as a `/vN` at the end of the module paths used in `go.mod` files (e.g., `module go.opentelemetry.io/otel/v2`, `require go.opentelemetry.io/otel/v2 v2.0.1`) and in the package import path (e.g., `import "go.opentelemetry.io/otel/v2/trace"`). This includes the paths used in `go get` commands (e.g., `go get go.opentelemetry.io/otel/v2@v2.0.1`). Note there is both a `/v2` and a `@v2.0.1` in that example. One way to think about it is that the module name now includes the `/v2`, so include `/v2` whenever you are using the module name). * If a module is version `v0` or `v1`, do not include the major version in either the module path or the import path. * Modules will be used to encapsulate signals and components. * Experimental modules still under active development will be versioned at `v0` to imply the stability guarantee defined by [semver](https://semver.org/spec/v2.0.0.html#spec-item-4). > Major version zero (0.y.z) is for initial development. Anything MAY > change at any time. The public API SHOULD NOT be considered stable. * Mature modules for which we guarantee a stable public API will be versioned with a major version greater than `v0`. * The decision to make a module stable will be made on a case-by-case basis by the maintainers of this project. * Experimental modules will start their versioning at `v0.0.0` and will increment their minor version when backwards incompatible changes are released and increment their patch version when backwards compatible changes are released. * All stable modules that use the same major version number will use the same entire version number. * Stable modules may be released with an incremented minor or patch version even though that module has not been changed, but rather so that it will remain at the same version as other stable modules that did undergo change. * When an experimental module becomes stable a new stable module version will be released and will include this now stable module. The new stable module version will be an increment of the minor version number and will be applied to all existing stable modules as well as the newly stable module being released. * Versioning of the associated [contrib repository](https://github.com/open-telemetry/opentelemetry-go-contrib) of this project will be idiomatic of a Go project using [Go modules](https://github.com/golang/go/wiki/Modules). * [Semantic import versioning](https://github.com/golang/go/wiki/Modules#semantic-import-versioning) will be used. * Versions will comply with [semver 2.0](https://semver.org/spec/v2.0.0.html). * If a module is version `v2` or higher, the major version of the module must be included as a `/vN` at the end of the module paths used in `go.mod` files (e.g., `module go.opentelemetry.io/contrib/instrumentation/host/v2`, `require go.opentelemetry.io/contrib/instrumentation/host/v2 v2.0.1`) and in the package import path (e.g., `import "go.opentelemetry.io/contrib/instrumentation/host/v2"`). This includes the paths used in `go get` commands (e.g., `go get go.opentelemetry.io/contrib/instrumentation/host/v2@v2.0.1`. Note there is both a `/v2` and a `@v2.0.1` in that example. One way to think about it is that the module name now includes the `/v2`, so include `/v2` whenever you are using the module name). * If a module is version `v0` or `v1`, do not include the major version in either the module path or the import path. * In addition to public APIs, telemetry produced by stable instrumentation will remain stable and backwards compatible. This is to avoid breaking alerts and dashboards. * Modules will be used to encapsulate instrumentation, detectors, exporters, propagators, and any other independent sets of related components. * Experimental modules still under active development will be versioned at `v0` to imply the stability guarantee defined by [semver](https://semver.org/spec/v2.0.0.html#spec-item-4). > Major version zero (0.y.z) is for initial development. Anything MAY > change at any time. The public API SHOULD NOT be considered stable. * Mature modules for which we guarantee a stable public API and telemetry will be versioned with a major version greater than `v0`. * Experimental modules will start their versioning at `v0.0.0` and will increment their minor version when backwards incompatible changes are released and increment their patch version when backwards compatible changes are released. * Stable contrib modules cannot depend on experimental modules from this project. * All stable contrib modules of the same major version with this project will use the same entire version as this project. * Stable modules may be released with an incremented minor or patch version even though that module's code has not been changed. Instead the only change that will have been included is to have updated that modules dependency on this project's stable APIs. * When an experimental module in contrib becomes stable a new stable module version will be released and will include this now stable module. The new stable module version will be an increment of the minor version number and will be applied to all existing stable contrib modules, this project's modules, and the newly stable module being released. * Contrib modules will be kept up to date with this project's releases. * Due to the dependency contrib modules will implicitly have on this project's modules the release of stable contrib modules to match the released version number will be staggered after this project's release. There is no explicit time guarantee for how long after this projects release the contrib release will be. Effort should be made to keep them as close in time as possible. * No additional stable release in this project can be made until the contrib repository has a matching stable release. * No release can be made in the contrib repository after this project's stable release except for a stable release of the contrib repository. * GitHub releases will be made for all releases. * Go modules will be made available at Go package mirrors. ## Example Versioning Lifecycle To better understand the implementation of the above policy the following example is provided. This project is simplified to include only the following modules and their versions: * `otel`: `v0.14.0` * `otel/trace`: `v0.14.0` * `otel/metric`: `v0.14.0` * `otel/baggage`: `v0.14.0` * `otel/sdk/trace`: `v0.14.0` * `otel/sdk/metric`: `v0.14.0` These modules have been developed to a point where the `otel/trace`, `otel/baggage`, and `otel/sdk/trace` modules have reached a point that they should be considered for a stable release. The `otel/metric` and `otel/sdk/metric` are still under active development and the `otel` module depends on both `otel/trace` and `otel/metric`. The `otel` package is refactored to remove its dependencies on `otel/metric` so it can be released as stable as well. With that done the following release candidates are made: * `otel`: `v1.0.0-RC1` * `otel/trace`: `v1.0.0-RC1` * `otel/baggage`: `v1.0.0-RC1` * `otel/sdk/trace`: `v1.0.0-RC1` The `otel/metric` and `otel/sdk/metric` modules remain at `v0.14.0`. A few minor issues are discovered in the `otel/trace` package. These issues are resolved with some minor, but backwards incompatible, changes and are released as a second release candidate: * `otel`: `v1.0.0-RC2` * `otel/trace`: `v1.0.0-RC2` * `otel/baggage`: `v1.0.0-RC2` * `otel/sdk/trace`: `v1.0.0-RC2` Notice that all module version numbers are incremented to adhere to our versioning policy. After these release candidates have been evaluated to satisfaction, they are released as version `v1.0.0`. * `otel`: `v1.0.0` * `otel/trace`: `v1.0.0` * `otel/baggage`: `v1.0.0` * `otel/sdk/trace`: `v1.0.0` Since both the `go` utility and the Go module system support [the semantic versioning definition of precedence](https://semver.org/spec/v2.0.0.html#spec-item-11), this release will correctly be interpreted as the successor to the previous release candidates. Active development of this project continues. The `otel/metric` module now has backwards incompatible changes to its API that need to be released and the `otel/baggage` module has a minor bug fix that needs to be released. The following release is made: * `otel`: `v1.0.1` * `otel/trace`: `v1.0.1` * `otel/metric`: `v0.15.0` * `otel/baggage`: `v1.0.1` * `otel/sdk/trace`: `v1.0.1` * `otel/sdk/metric`: `v0.15.0` Notice that, again, all stable module versions are incremented in unison and the `otel/sdk/metric` package, which depends on the `otel/metric` package, also bumped its version. This bump of the `otel/sdk/metric` package makes sense given their coupling, though it is not explicitly required by our versioning policy. As we progress, the `otel/metric` and `otel/sdk/metric` packages have reached a point where they should be evaluated for stability. The `otel` module is reintegrated with the `otel/metric` package and the following release is made: * `otel`: `v1.1.0-RC1` * `otel/trace`: `v1.1.0-RC1` * `otel/metric`: `v1.1.0-RC1` * `otel/baggage`: `v1.1.0-RC1` * `otel/sdk/trace`: `v1.1.0-RC1` * `otel/sdk/metric`: `v1.1.0-RC1` All the modules are evaluated and determined to a viable stable release. They are then released as version `v1.1.0` (the minor version is incremented to indicate the addition of new signal). * `otel`: `v1.1.0` * `otel/trace`: `v1.1.0` * `otel/metric`: `v1.1.0` * `otel/baggage`: `v1.1.0` * `otel/sdk/trace`: `v1.1.0` * `otel/sdk/metric`: `v1.1.0` ================================================ FILE: vendor/go.opentelemetry.io/otel/attribute/README.md ================================================ # Attribute [![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/attribute)](https://pkg.go.dev/go.opentelemetry.io/otel/attribute) ================================================ FILE: vendor/go.opentelemetry.io/otel/attribute/doc.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 // Package attribute provides key and value attributes. package attribute // import "go.opentelemetry.io/otel/attribute" ================================================ FILE: vendor/go.opentelemetry.io/otel/attribute/encoder.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package attribute // import "go.opentelemetry.io/otel/attribute" import ( "bytes" "sync" "sync/atomic" ) type ( // Encoder is a mechanism for serializing an attribute set into a specific // string representation that supports caching, to avoid repeated // serialization. An example could be an exporter encoding the attribute // set into a wire representation. Encoder interface { // Encode returns the serialized encoding of the attribute set using // its Iterator. This result may be cached by an attribute.Set. Encode(iterator Iterator) string // ID returns a value that is unique for each class of attribute // encoder. Attribute encoders allocate these using `NewEncoderID`. ID() EncoderID } // EncoderID is used to identify distinct Encoder // implementations, for caching encoded results. EncoderID struct { value uint64 } // defaultAttrEncoder uses a sync.Pool of buffers to reduce the number of // allocations used in encoding attributes. This implementation encodes a // comma-separated list of key=value, with '/'-escaping of '=', ',', and // '\'. defaultAttrEncoder struct { // pool is a pool of attribute set builders. The buffers in this pool // grow to a size that most attribute encodings will not allocate new // memory. pool sync.Pool // *bytes.Buffer } ) // escapeChar is used to ensure uniqueness of the attribute encoding where // keys or values contain either '=' or ','. Since there is no parser needed // for this encoding and its only requirement is to be unique, this choice is // arbitrary. Users will see these in some exporters (e.g., stdout), so the // backslash ('\') is used as a conventional choice. const escapeChar = '\\' var ( _ Encoder = &defaultAttrEncoder{} // encoderIDCounter is for generating IDs for other attribute encoders. encoderIDCounter uint64 defaultEncoderOnce sync.Once defaultEncoderID = NewEncoderID() defaultEncoderInstance *defaultAttrEncoder ) // NewEncoderID returns a unique attribute encoder ID. It should be called // once per each type of attribute encoder. Preferably in init() or in var // definition. func NewEncoderID() EncoderID { return EncoderID{value: atomic.AddUint64(&encoderIDCounter, 1)} } // DefaultEncoder returns an attribute encoder that encodes attributes in such // a way that each escaped attribute's key is followed by an equal sign and // then by an escaped attribute's value. All key-value pairs are separated by // a comma. // // Escaping is done by prepending a backslash before either a backslash, equal // sign or a comma. func DefaultEncoder() Encoder { defaultEncoderOnce.Do(func() { defaultEncoderInstance = &defaultAttrEncoder{ pool: sync.Pool{ New: func() any { return &bytes.Buffer{} }, }, } }) return defaultEncoderInstance } // Encode is a part of an implementation of the AttributeEncoder interface. func (d *defaultAttrEncoder) Encode(iter Iterator) string { buf := d.pool.Get().(*bytes.Buffer) defer d.pool.Put(buf) buf.Reset() for iter.Next() { i, keyValue := iter.IndexedAttribute() if i > 0 { _ = buf.WriteByte(',') } copyAndEscape(buf, string(keyValue.Key)) _ = buf.WriteByte('=') if keyValue.Value.Type() == STRING { copyAndEscape(buf, keyValue.Value.AsString()) } else { _, _ = buf.WriteString(keyValue.Value.Emit()) } } return buf.String() } // ID is a part of an implementation of the AttributeEncoder interface. func (*defaultAttrEncoder) ID() EncoderID { return defaultEncoderID } // copyAndEscape escapes `=`, `,` and its own escape character (`\`), // making the default encoding unique. func copyAndEscape(buf *bytes.Buffer, val string) { for _, ch := range val { switch ch { case '=', ',', escapeChar: _ = buf.WriteByte(escapeChar) } _, _ = buf.WriteRune(ch) } } // Valid reports whether this encoder ID was allocated by // [NewEncoderID]. Invalid encoder IDs will not be cached. func (id EncoderID) Valid() bool { return id.value != 0 } ================================================ FILE: vendor/go.opentelemetry.io/otel/attribute/filter.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package attribute // import "go.opentelemetry.io/otel/attribute" // Filter supports removing certain attributes from attribute sets. When // the filter returns true, the attribute will be kept in the filtered // attribute set. When the filter returns false, the attribute is excluded // from the filtered attribute set, and the attribute instead appears in // the removed list of excluded attributes. type Filter func(KeyValue) bool // NewAllowKeysFilter returns a Filter that only allows attributes with one of // the provided keys. // // If keys is empty a deny-all filter is returned. func NewAllowKeysFilter(keys ...Key) Filter { if len(keys) == 0 { return func(KeyValue) bool { return false } } allowed := make(map[Key]struct{}, len(keys)) for _, k := range keys { allowed[k] = struct{}{} } return func(kv KeyValue) bool { _, ok := allowed[kv.Key] return ok } } // NewDenyKeysFilter returns a Filter that only allows attributes // that do not have one of the provided keys. // // If keys is empty an allow-all filter is returned. func NewDenyKeysFilter(keys ...Key) Filter { if len(keys) == 0 { return func(KeyValue) bool { return true } } forbid := make(map[Key]struct{}, len(keys)) for _, k := range keys { forbid[k] = struct{}{} } return func(kv KeyValue) bool { _, ok := forbid[kv.Key] return !ok } } ================================================ FILE: vendor/go.opentelemetry.io/otel/attribute/hash.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package attribute // import "go.opentelemetry.io/otel/attribute" import ( "fmt" "reflect" "go.opentelemetry.io/otel/attribute/internal/xxhash" ) // Type identifiers. These identifiers are hashed before the value of the // corresponding type. This is done to distinguish values that are hashed with // the same value representation (e.g. `int64(1)` and `true`, []int64{0} and // int64(0)). // // These are all 8 byte length strings converted to a uint64 representation. A // uint64 is used instead of the string directly as an optimization, it avoids // the for loop in [xxhash] which adds minor overhead. const ( boolID uint64 = 7953749933313450591 // "_boolean" (little endian) int64ID uint64 = 7592915492740740150 // "64_bit_i" (little endian) float64ID uint64 = 7376742710626956342 // "64_bit_f" (little endian) stringID uint64 = 6874584755375207263 // "_string_" (little endian) boolSliceID uint64 = 6875993255270243167 // "_[]bool_" (little endian) int64SliceID uint64 = 3762322556277578591 // "_[]int64" (little endian) float64SliceID uint64 = 7308324551835016539 // "[]double" (little endian) stringSliceID uint64 = 7453010373645655387 // "[]string" (little endian) ) // hashKVs returns a new xxHash64 hash of kvs. func hashKVs(kvs []KeyValue) uint64 { h := xxhash.New() for _, kv := range kvs { h = hashKV(h, kv) } return h.Sum64() } // hashKV returns the xxHash64 hash of kv with h as the base. func hashKV(h xxhash.Hash, kv KeyValue) xxhash.Hash { h = h.String(string(kv.Key)) switch kv.Value.Type() { case BOOL: h = h.Uint64(boolID) h = h.Uint64(kv.Value.numeric) case INT64: h = h.Uint64(int64ID) h = h.Uint64(kv.Value.numeric) case FLOAT64: h = h.Uint64(float64ID) // Assumes numeric stored with math.Float64bits. h = h.Uint64(kv.Value.numeric) case STRING: h = h.Uint64(stringID) h = h.String(kv.Value.stringly) case BOOLSLICE: h = h.Uint64(boolSliceID) rv := reflect.ValueOf(kv.Value.slice) for i := 0; i < rv.Len(); i++ { h = h.Bool(rv.Index(i).Bool()) } case INT64SLICE: h = h.Uint64(int64SliceID) rv := reflect.ValueOf(kv.Value.slice) for i := 0; i < rv.Len(); i++ { h = h.Int64(rv.Index(i).Int()) } case FLOAT64SLICE: h = h.Uint64(float64SliceID) rv := reflect.ValueOf(kv.Value.slice) for i := 0; i < rv.Len(); i++ { h = h.Float64(rv.Index(i).Float()) } case STRINGSLICE: h = h.Uint64(stringSliceID) rv := reflect.ValueOf(kv.Value.slice) for i := 0; i < rv.Len(); i++ { h = h.String(rv.Index(i).String()) } case INVALID: default: // Logging is an alternative, but using the internal logger here // causes an import cycle so it is not done. v := kv.Value.AsInterface() msg := fmt.Sprintf("unknown value type: %[1]v (%[1]T)", v) panic(msg) } return h } ================================================ FILE: vendor/go.opentelemetry.io/otel/attribute/internal/attribute.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 /* Package attribute provide several helper functions for some commonly used logic of processing attributes. */ package attribute // import "go.opentelemetry.io/otel/attribute/internal" import ( "reflect" ) // BoolSliceValue converts a bool slice into an array with same elements as slice. func BoolSliceValue(v []bool) any { cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeFor[bool]())).Elem() reflect.Copy(cp, reflect.ValueOf(v)) return cp.Interface() } // Int64SliceValue converts an int64 slice into an array with same elements as slice. func Int64SliceValue(v []int64) any { cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeFor[int64]())).Elem() reflect.Copy(cp, reflect.ValueOf(v)) return cp.Interface() } // Float64SliceValue converts a float64 slice into an array with same elements as slice. func Float64SliceValue(v []float64) any { cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeFor[float64]())).Elem() reflect.Copy(cp, reflect.ValueOf(v)) return cp.Interface() } // StringSliceValue converts a string slice into an array with same elements as slice. func StringSliceValue(v []string) any { cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeFor[string]())).Elem() reflect.Copy(cp, reflect.ValueOf(v)) return cp.Interface() } // AsBoolSlice converts a bool array into a slice into with same elements as array. func AsBoolSlice(v any) []bool { rv := reflect.ValueOf(v) if rv.Type().Kind() != reflect.Array { return nil } cpy := make([]bool, rv.Len()) if len(cpy) > 0 { _ = reflect.Copy(reflect.ValueOf(cpy), rv) } return cpy } // AsInt64Slice converts an int64 array into a slice into with same elements as array. func AsInt64Slice(v any) []int64 { rv := reflect.ValueOf(v) if rv.Type().Kind() != reflect.Array { return nil } cpy := make([]int64, rv.Len()) if len(cpy) > 0 { _ = reflect.Copy(reflect.ValueOf(cpy), rv) } return cpy } // AsFloat64Slice converts a float64 array into a slice into with same elements as array. func AsFloat64Slice(v any) []float64 { rv := reflect.ValueOf(v) if rv.Type().Kind() != reflect.Array { return nil } cpy := make([]float64, rv.Len()) if len(cpy) > 0 { _ = reflect.Copy(reflect.ValueOf(cpy), rv) } return cpy } // AsStringSlice converts a string array into a slice into with same elements as array. func AsStringSlice(v any) []string { rv := reflect.ValueOf(v) if rv.Type().Kind() != reflect.Array { return nil } cpy := make([]string, rv.Len()) if len(cpy) > 0 { _ = reflect.Copy(reflect.ValueOf(cpy), rv) } return cpy } ================================================ FILE: vendor/go.opentelemetry.io/otel/attribute/internal/xxhash/xxhash.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 // Package xxhash provides a wrapper around the xxhash library for attribute hashing. package xxhash // import "go.opentelemetry.io/otel/attribute/internal/xxhash" import ( "encoding/binary" "math" "github.com/cespare/xxhash/v2" ) // Hash wraps xxhash.Digest to provide an API friendly for hashing attribute values. type Hash struct { d *xxhash.Digest } // New returns a new initialized xxHash64 hasher. func New() Hash { return Hash{d: xxhash.New()} } func (h Hash) Uint64(val uint64) Hash { var buf [8]byte binary.LittleEndian.PutUint64(buf[:], val) // errors from Write are always nil for xxhash // if it returns an err then panic _, err := h.d.Write(buf[:]) if err != nil { panic("xxhash write of uint64 failed: " + err.Error()) } return h } func (h Hash) Bool(val bool) Hash { // nolint:revive // This is a hashing function. if val { return h.Uint64(1) } return h.Uint64(0) } func (h Hash) Float64(val float64) Hash { return h.Uint64(math.Float64bits(val)) } func (h Hash) Int64(val int64) Hash { return h.Uint64(uint64(val)) // nolint:gosec // Overflow doesn't matter since we are hashing. } func (h Hash) String(val string) Hash { // errors from WriteString are always nil for xxhash // if it returns an err then panic _, err := h.d.WriteString(val) if err != nil { panic("xxhash write of string failed: " + err.Error()) } return h } // Sum64 returns the current hash value. func (h Hash) Sum64() uint64 { return h.d.Sum64() } ================================================ FILE: vendor/go.opentelemetry.io/otel/attribute/iterator.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package attribute // import "go.opentelemetry.io/otel/attribute" // Iterator allows iterating over the set of attributes in order, sorted by // key. type Iterator struct { storage *Set idx int } // MergeIterator supports iterating over two sets of attributes while // eliminating duplicate values from the combined set. The first iterator // value takes precedence. type MergeIterator struct { one oneIterator two oneIterator current KeyValue } type oneIterator struct { iter Iterator done bool attr KeyValue } // Next moves the iterator to the next position. // Next reports whether there are more attributes. func (i *Iterator) Next() bool { i.idx++ return i.idx < i.Len() } // Label returns current KeyValue. Must be called only after Next returns // true. // // Deprecated: Use Attribute instead. func (i *Iterator) Label() KeyValue { return i.Attribute() } // Attribute returns the current KeyValue of the Iterator. It must be called // only after Next returns true. func (i *Iterator) Attribute() KeyValue { kv, _ := i.storage.Get(i.idx) return kv } // IndexedLabel returns current index and attribute. Must be called only // after Next returns true. // // Deprecated: Use IndexedAttribute instead. func (i *Iterator) IndexedLabel() (int, KeyValue) { return i.idx, i.Attribute() } // IndexedAttribute returns current index and attribute. Must be called only // after Next returns true. func (i *Iterator) IndexedAttribute() (int, KeyValue) { return i.idx, i.Attribute() } // Len returns a number of attributes in the iterated set. func (i *Iterator) Len() int { return i.storage.Len() } // ToSlice is a convenience function that creates a slice of attributes from // the passed iterator. The iterator is set up to start from the beginning // before creating the slice. func (i *Iterator) ToSlice() []KeyValue { l := i.Len() if l == 0 { return nil } i.idx = -1 slice := make([]KeyValue, 0, l) for i.Next() { slice = append(slice, i.Attribute()) } return slice } // NewMergeIterator returns a MergeIterator for merging two attribute sets. // Duplicates are resolved by taking the value from the first set. func NewMergeIterator(s1, s2 *Set) MergeIterator { mi := MergeIterator{ one: makeOne(s1.Iter()), two: makeOne(s2.Iter()), } return mi } func makeOne(iter Iterator) oneIterator { oi := oneIterator{ iter: iter, } oi.advance() return oi } func (oi *oneIterator) advance() { if oi.done = !oi.iter.Next(); !oi.done { oi.attr = oi.iter.Attribute() } } // Next moves the iterator to the next position. // Next reports whether there is another attribute available. func (m *MergeIterator) Next() bool { if m.one.done && m.two.done { return false } if m.one.done { m.current = m.two.attr m.two.advance() return true } if m.two.done { m.current = m.one.attr m.one.advance() return true } if m.one.attr.Key == m.two.attr.Key { m.current = m.one.attr // first iterator attribute value wins m.one.advance() m.two.advance() return true } if m.one.attr.Key < m.two.attr.Key { m.current = m.one.attr m.one.advance() return true } m.current = m.two.attr m.two.advance() return true } // Label returns the current value after Next() returns true. // // Deprecated: Use Attribute instead. func (m *MergeIterator) Label() KeyValue { return m.current } // Attribute returns the current value after Next() returns true. func (m *MergeIterator) Attribute() KeyValue { return m.current } ================================================ FILE: vendor/go.opentelemetry.io/otel/attribute/key.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package attribute // import "go.opentelemetry.io/otel/attribute" // Key represents the key part in key-value pairs. It's a string. The // allowed character set in the key depends on the use of the key. type Key string // Bool creates a KeyValue instance with a BOOL Value. // // If creating both a key and value at the same time, use the provided // convenience function instead -- Bool(name, value). func (k Key) Bool(v bool) KeyValue { return KeyValue{ Key: k, Value: BoolValue(v), } } // BoolSlice creates a KeyValue instance with a BOOLSLICE Value. // // If creating both a key and value at the same time, use the provided // convenience function instead -- BoolSlice(name, value). func (k Key) BoolSlice(v []bool) KeyValue { return KeyValue{ Key: k, Value: BoolSliceValue(v), } } // Int creates a KeyValue instance with an INT64 Value. // // If creating both a key and value at the same time, use the provided // convenience function instead -- Int(name, value). func (k Key) Int(v int) KeyValue { return KeyValue{ Key: k, Value: IntValue(v), } } // IntSlice creates a KeyValue instance with an INT64SLICE Value. // // If creating both a key and value at the same time, use the provided // convenience function instead -- IntSlice(name, value). func (k Key) IntSlice(v []int) KeyValue { return KeyValue{ Key: k, Value: IntSliceValue(v), } } // Int64 creates a KeyValue instance with an INT64 Value. // // If creating both a key and value at the same time, use the provided // convenience function instead -- Int64(name, value). func (k Key) Int64(v int64) KeyValue { return KeyValue{ Key: k, Value: Int64Value(v), } } // Int64Slice creates a KeyValue instance with an INT64SLICE Value. // // If creating both a key and value at the same time, use the provided // convenience function instead -- Int64Slice(name, value). func (k Key) Int64Slice(v []int64) KeyValue { return KeyValue{ Key: k, Value: Int64SliceValue(v), } } // Float64 creates a KeyValue instance with a FLOAT64 Value. // // If creating both a key and value at the same time, use the provided // convenience function instead -- Float64(name, value). func (k Key) Float64(v float64) KeyValue { return KeyValue{ Key: k, Value: Float64Value(v), } } // Float64Slice creates a KeyValue instance with a FLOAT64SLICE Value. // // If creating both a key and value at the same time, use the provided // convenience function instead -- Float64(name, value). func (k Key) Float64Slice(v []float64) KeyValue { return KeyValue{ Key: k, Value: Float64SliceValue(v), } } // String creates a KeyValue instance with a STRING Value. // // If creating both a key and value at the same time, use the provided // convenience function instead -- String(name, value). func (k Key) String(v string) KeyValue { return KeyValue{ Key: k, Value: StringValue(v), } } // StringSlice creates a KeyValue instance with a STRINGSLICE Value. // // If creating both a key and value at the same time, use the provided // convenience function instead -- StringSlice(name, value). func (k Key) StringSlice(v []string) KeyValue { return KeyValue{ Key: k, Value: StringSliceValue(v), } } // Defined reports whether the key is not empty. func (k Key) Defined() bool { return len(k) != 0 } ================================================ FILE: vendor/go.opentelemetry.io/otel/attribute/kv.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package attribute // import "go.opentelemetry.io/otel/attribute" import ( "fmt" ) // KeyValue holds a key and value pair. type KeyValue struct { Key Key Value Value } // Valid reports whether kv is a valid OpenTelemetry attribute. func (kv KeyValue) Valid() bool { return kv.Key.Defined() && kv.Value.Type() != INVALID } // Bool creates a KeyValue with a BOOL Value type. func Bool(k string, v bool) KeyValue { return Key(k).Bool(v) } // BoolSlice creates a KeyValue with a BOOLSLICE Value type. func BoolSlice(k string, v []bool) KeyValue { return Key(k).BoolSlice(v) } // Int creates a KeyValue with an INT64 Value type. func Int(k string, v int) KeyValue { return Key(k).Int(v) } // IntSlice creates a KeyValue with an INT64SLICE Value type. func IntSlice(k string, v []int) KeyValue { return Key(k).IntSlice(v) } // Int64 creates a KeyValue with an INT64 Value type. func Int64(k string, v int64) KeyValue { return Key(k).Int64(v) } // Int64Slice creates a KeyValue with an INT64SLICE Value type. func Int64Slice(k string, v []int64) KeyValue { return Key(k).Int64Slice(v) } // Float64 creates a KeyValue with a FLOAT64 Value type. func Float64(k string, v float64) KeyValue { return Key(k).Float64(v) } // Float64Slice creates a KeyValue with a FLOAT64SLICE Value type. func Float64Slice(k string, v []float64) KeyValue { return Key(k).Float64Slice(v) } // String creates a KeyValue with a STRING Value type. func String(k, v string) KeyValue { return Key(k).String(v) } // StringSlice creates a KeyValue with a STRINGSLICE Value type. func StringSlice(k string, v []string) KeyValue { return Key(k).StringSlice(v) } // Stringer creates a new key-value pair with a passed name and a string // value generated by the passed Stringer interface. func Stringer(k string, v fmt.Stringer) KeyValue { return Key(k).String(v.String()) } ================================================ FILE: vendor/go.opentelemetry.io/otel/attribute/rawhelpers.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package attribute // import "go.opentelemetry.io/otel/attribute" import ( "math" ) func boolToRaw(b bool) uint64 { // nolint:revive // b is not a control flag. if b { return 1 } return 0 } func rawToBool(r uint64) bool { return r != 0 } func int64ToRaw(i int64) uint64 { // Assumes original was a valid int64 (overflow not checked). return uint64(i) // nolint: gosec } func rawToInt64(r uint64) int64 { // Assumes original was a valid int64 (overflow not checked). return int64(r) // nolint: gosec } func float64ToRaw(f float64) uint64 { return math.Float64bits(f) } func rawToFloat64(r uint64) float64 { return math.Float64frombits(r) } ================================================ FILE: vendor/go.opentelemetry.io/otel/attribute/set.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package attribute // import "go.opentelemetry.io/otel/attribute" import ( "cmp" "encoding/json" "reflect" "slices" "sort" "go.opentelemetry.io/otel/attribute/internal/xxhash" ) type ( // Set is the representation for a distinct attribute set. It manages an // immutable set of attributes, with an internal cache for storing // attribute encodings. // // This type will remain comparable for backwards compatibility. The // equivalence of Sets across versions is not guaranteed to be stable. // Prior versions may find two Sets to be equal or not when compared // directly (i.e. ==), but subsequent versions may not. Users should use // the Equals method to ensure stable equivalence checking. // // Users should also use the Distinct returned from Equivalent as a map key // instead of a Set directly. Set has relatively poor performance when used // as a map key compared to Distinct. Set struct { hash uint64 data any } // Distinct is an identifier of a Set which is very likely to be unique. // // Distinct should be used as a map key instead of a Set for to provide better // performance for map operations. Distinct struct { hash uint64 } // Sortable implements sort.Interface, used for sorting KeyValue. // // Deprecated: This type is no longer used. It was added as a performance // optimization for Go < 1.21 that is no longer needed (Go < 1.21 is no // longer supported by the module). Sortable []KeyValue ) // Compile time check these types remain comparable. var ( _ = isComparable(Set{}) _ = isComparable(Distinct{}) ) func isComparable[T comparable](t T) T { return t } var ( // keyValueType is used in computeDistinctReflect. keyValueType = reflect.TypeFor[KeyValue]() // emptyHash is the hash of an empty set. emptyHash = xxhash.New().Sum64() // userDefinedEmptySet is an empty set. It was mistakenly exposed to users // as something they can assign to, so it must remain addressable and // mutable. // // This is kept for backwards compatibility, but should not be used in new code. userDefinedEmptySet = &Set{ hash: emptyHash, data: [0]KeyValue{}, } emptySet = Set{ hash: emptyHash, data: [0]KeyValue{}, } ) // EmptySet returns a reference to a Set with no elements. // // This is a convenience provided for optimized calling utility. func EmptySet() *Set { // Continue to return the pointer to the user-defined empty set for // backwards-compatibility. // // New code should not use this, instead use emptySet. return userDefinedEmptySet } // Valid reports whether this value refers to a valid Set. func (d Distinct) Valid() bool { return d.hash != 0 } // reflectValue abbreviates reflect.ValueOf(d). func (l Set) reflectValue() reflect.Value { return reflect.ValueOf(l.data) } // Len returns the number of attributes in this set. func (l *Set) Len() int { if l == nil || l.hash == 0 { return 0 } return l.reflectValue().Len() } // Get returns the KeyValue at ordered position idx in this set. func (l *Set) Get(idx int) (KeyValue, bool) { if l == nil || l.hash == 0 { return KeyValue{}, false } value := l.reflectValue() if idx >= 0 && idx < value.Len() { // Note: The Go compiler successfully avoids an allocation for // the interface{} conversion here: return value.Index(idx).Interface().(KeyValue), true } return KeyValue{}, false } // Value returns the value of a specified key in this set. func (l *Set) Value(k Key) (Value, bool) { if l == nil || l.hash == 0 { return Value{}, false } rValue := l.reflectValue() vlen := rValue.Len() idx := sort.Search(vlen, func(idx int) bool { return rValue.Index(idx).Interface().(KeyValue).Key >= k }) if idx >= vlen { return Value{}, false } keyValue := rValue.Index(idx).Interface().(KeyValue) if k == keyValue.Key { return keyValue.Value, true } return Value{}, false } // HasValue reports whether a key is defined in this set. func (l *Set) HasValue(k Key) bool { if l == nil { return false } _, ok := l.Value(k) return ok } // Iter returns an iterator for visiting the attributes in this set. func (l *Set) Iter() Iterator { return Iterator{ storage: l, idx: -1, } } // ToSlice returns the set of attributes belonging to this set, sorted, where // keys appear no more than once. func (l *Set) ToSlice() []KeyValue { iter := l.Iter() return iter.ToSlice() } // Equivalent returns a value that may be used as a map key. Equal Distinct // values are very likely to be equivalent attribute Sets. Distinct value of any // attribute set with the same elements as this, where sets are made unique by // choosing the last value in the input for any given key. func (l *Set) Equivalent() Distinct { if l == nil || l.hash == 0 { return Distinct{hash: emptySet.hash} } return Distinct{hash: l.hash} } // Equals reports whether the argument set is equivalent to this set. func (l *Set) Equals(o *Set) bool { if l.Equivalent() != o.Equivalent() { return false } if l == nil || l.hash == 0 { l = &emptySet } if o == nil || o.hash == 0 { o = &emptySet } return l.data == o.data } // Encoded returns the encoded form of this set, according to encoder. func (l *Set) Encoded(encoder Encoder) string { if l == nil || encoder == nil { return "" } return encoder.Encode(l.Iter()) } // NewSet returns a new Set. See the documentation for // NewSetWithSortableFiltered for more details. // // Except for empty sets, this method adds an additional allocation compared // with calls that include a Sortable. func NewSet(kvs ...KeyValue) Set { s, _ := NewSetWithFiltered(kvs, nil) return s } // NewSetWithSortable returns a new Set. See the documentation for // NewSetWithSortableFiltered for more details. // // This call includes a Sortable option as a memory optimization. // // Deprecated: Use [NewSet] instead. func NewSetWithSortable(kvs []KeyValue, _ *Sortable) Set { s, _ := NewSetWithFiltered(kvs, nil) return s } // NewSetWithFiltered returns a new Set. See the documentation for // NewSetWithSortableFiltered for more details. // // This call includes a Filter to include/exclude attribute keys from the // return value. Excluded keys are returned as a slice of attribute values. func NewSetWithFiltered(kvs []KeyValue, filter Filter) (Set, []KeyValue) { // Check for empty set. if len(kvs) == 0 { return emptySet, nil } // Stable sort so the following de-duplication can implement // last-value-wins semantics. slices.SortStableFunc(kvs, func(a, b KeyValue) int { return cmp.Compare(a.Key, b.Key) }) position := len(kvs) - 1 offset := position - 1 // The requirements stated above require that the stable // result be placed in the end of the input slice, while // overwritten values are swapped to the beginning. // // De-duplicate with last-value-wins semantics. Preserve // duplicate values at the beginning of the input slice. for ; offset >= 0; offset-- { if kvs[offset].Key == kvs[position].Key { continue } position-- kvs[offset], kvs[position] = kvs[position], kvs[offset] } kvs = kvs[position:] if filter != nil { if div := filteredToFront(kvs, filter); div != 0 { return newSet(kvs[div:]), kvs[:div] } } return newSet(kvs), nil } // NewSetWithSortableFiltered returns a new Set. // // Duplicate keys are eliminated by taking the last value. This // re-orders the input slice so that unique last-values are contiguous // at the end of the slice. // // This ensures the following: // // - Last-value-wins semantics // - Caller sees the reordering, but doesn't lose values // - Repeated call preserve last-value wins. // // Note that methods are defined on Set, although this returns Set. Callers // can avoid memory allocations by: // // - allocating a Sortable for use as a temporary in this method // - allocating a Set for storing the return value of this constructor. // // The result maintains a cache of encoded attributes, by attribute.EncoderID. // This value should not be copied after its first use. // // The second []KeyValue return value is a list of attributes that were // excluded by the Filter (if non-nil). // // Deprecated: Use [NewSetWithFiltered] instead. func NewSetWithSortableFiltered(kvs []KeyValue, _ *Sortable, filter Filter) (Set, []KeyValue) { return NewSetWithFiltered(kvs, filter) } // filteredToFront filters slice in-place using keep function. All KeyValues that need to // be removed are moved to the front. All KeyValues that need to be kept are // moved (in-order) to the back. The index for the first KeyValue to be kept is // returned. func filteredToFront(slice []KeyValue, keep Filter) int { n := len(slice) j := n for i := n - 1; i >= 0; i-- { if keep(slice[i]) { j-- slice[i], slice[j] = slice[j], slice[i] } } return j } // Filter returns a filtered copy of this Set. See the documentation for // NewSetWithSortableFiltered for more details. func (l *Set) Filter(re Filter) (Set, []KeyValue) { if re == nil { return *l, nil } // Iterate in reverse to the first attribute that will be filtered out. n := l.Len() first := n - 1 for ; first >= 0; first-- { kv, _ := l.Get(first) if !re(kv) { break } } // No attributes will be dropped, return the immutable Set l and nil. if first < 0 { return *l, nil } // Copy now that we know we need to return a modified set. // // Do not do this in-place on the underlying storage of *Set l. Sets are // immutable and filtering should not change this. slice := l.ToSlice() // Don't re-iterate the slice if only slice[0] is filtered. if first == 0 { // It is safe to assume len(slice) >= 1 given we found at least one // attribute above that needs to be filtered out. return newSet(slice[1:]), slice[:1] } // Move the filtered slice[first] to the front (preserving order). kv := slice[first] copy(slice[1:first+1], slice[:first]) slice[0] = kv // Do not re-evaluate re(slice[first+1:]). div := filteredToFront(slice[1:first+1], re) + 1 return newSet(slice[div:]), slice[:div] } // newSet returns a new set based on the sorted and uniqued kvs. func newSet(kvs []KeyValue) Set { s := Set{ hash: hashKVs(kvs), data: computeDataFixed(kvs), } if s.data == nil { s.data = computeDataReflect(kvs) } return s } // computeDataFixed computes a Set data for small slices. It returns nil if the // input is too large for this code path. func computeDataFixed(kvs []KeyValue) any { switch len(kvs) { case 1: return [1]KeyValue(kvs) case 2: return [2]KeyValue(kvs) case 3: return [3]KeyValue(kvs) case 4: return [4]KeyValue(kvs) case 5: return [5]KeyValue(kvs) case 6: return [6]KeyValue(kvs) case 7: return [7]KeyValue(kvs) case 8: return [8]KeyValue(kvs) case 9: return [9]KeyValue(kvs) case 10: return [10]KeyValue(kvs) default: return nil } } // computeDataReflect computes a Set data using reflection, works for any size // input. func computeDataReflect(kvs []KeyValue) any { at := reflect.New(reflect.ArrayOf(len(kvs), keyValueType)).Elem() for i, keyValue := range kvs { *(at.Index(i).Addr().Interface().(*KeyValue)) = keyValue } return at.Interface() } // MarshalJSON returns the JSON encoding of the Set. func (l *Set) MarshalJSON() ([]byte, error) { return json.Marshal(l.data) } // MarshalLog is the marshaling function used by the logging system to represent this Set. func (l Set) MarshalLog() any { kvs := make(map[string]string) for _, kv := range l.ToSlice() { kvs[string(kv.Key)] = kv.Value.Emit() } return kvs } // Len implements sort.Interface. func (l *Sortable) Len() int { return len(*l) } // Swap implements sort.Interface. func (l *Sortable) Swap(i, j int) { (*l)[i], (*l)[j] = (*l)[j], (*l)[i] } // Less implements sort.Interface. func (l *Sortable) Less(i, j int) bool { return (*l)[i].Key < (*l)[j].Key } ================================================ FILE: vendor/go.opentelemetry.io/otel/attribute/type_string.go ================================================ // Code generated by "stringer -type=Type"; DO NOT EDIT. package attribute import "strconv" func _() { // An "invalid array index" compiler error signifies that the constant values have changed. // Re-run the stringer command to generate them again. var x [1]struct{} _ = x[INVALID-0] _ = x[BOOL-1] _ = x[INT64-2] _ = x[FLOAT64-3] _ = x[STRING-4] _ = x[BOOLSLICE-5] _ = x[INT64SLICE-6] _ = x[FLOAT64SLICE-7] _ = x[STRINGSLICE-8] } const _Type_name = "INVALIDBOOLINT64FLOAT64STRINGBOOLSLICEINT64SLICEFLOAT64SLICESTRINGSLICE" var _Type_index = [...]uint8{0, 7, 11, 16, 23, 29, 38, 48, 60, 71} func (i Type) String() string { idx := int(i) - 0 if i < 0 || idx >= len(_Type_index)-1 { return "Type(" + strconv.FormatInt(int64(i), 10) + ")" } return _Type_name[_Type_index[idx]:_Type_index[idx+1]] } ================================================ FILE: vendor/go.opentelemetry.io/otel/attribute/value.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package attribute // import "go.opentelemetry.io/otel/attribute" import ( "encoding/json" "fmt" "reflect" "strconv" attribute "go.opentelemetry.io/otel/attribute/internal" ) //go:generate stringer -type=Type // Type describes the type of the data Value holds. type Type int // nolint: revive // redefines builtin Type. // Value represents the value part in key-value pairs. type Value struct { vtype Type numeric uint64 stringly string slice any } const ( // INVALID is used for a Value with no value set. INVALID Type = iota // BOOL is a boolean Type Value. BOOL // INT64 is a 64-bit signed integral Type Value. INT64 // FLOAT64 is a 64-bit floating point Type Value. FLOAT64 // STRING is a string Type Value. STRING // BOOLSLICE is a slice of booleans Type Value. BOOLSLICE // INT64SLICE is a slice of 64-bit signed integral numbers Type Value. INT64SLICE // FLOAT64SLICE is a slice of 64-bit floating point numbers Type Value. FLOAT64SLICE // STRINGSLICE is a slice of strings Type Value. STRINGSLICE ) // BoolValue creates a BOOL Value. func BoolValue(v bool) Value { return Value{ vtype: BOOL, numeric: boolToRaw(v), } } // BoolSliceValue creates a BOOLSLICE Value. func BoolSliceValue(v []bool) Value { return Value{vtype: BOOLSLICE, slice: attribute.BoolSliceValue(v)} } // IntValue creates an INT64 Value. func IntValue(v int) Value { return Int64Value(int64(v)) } // IntSliceValue creates an INTSLICE Value. func IntSliceValue(v []int) Value { cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeFor[int64]())) for i, val := range v { cp.Elem().Index(i).SetInt(int64(val)) } return Value{ vtype: INT64SLICE, slice: cp.Elem().Interface(), } } // Int64Value creates an INT64 Value. func Int64Value(v int64) Value { return Value{ vtype: INT64, numeric: int64ToRaw(v), } } // Int64SliceValue creates an INT64SLICE Value. func Int64SliceValue(v []int64) Value { return Value{vtype: INT64SLICE, slice: attribute.Int64SliceValue(v)} } // Float64Value creates a FLOAT64 Value. func Float64Value(v float64) Value { return Value{ vtype: FLOAT64, numeric: float64ToRaw(v), } } // Float64SliceValue creates a FLOAT64SLICE Value. func Float64SliceValue(v []float64) Value { return Value{vtype: FLOAT64SLICE, slice: attribute.Float64SliceValue(v)} } // StringValue creates a STRING Value. func StringValue(v string) Value { return Value{ vtype: STRING, stringly: v, } } // StringSliceValue creates a STRINGSLICE Value. func StringSliceValue(v []string) Value { return Value{vtype: STRINGSLICE, slice: attribute.StringSliceValue(v)} } // Type returns a type of the Value. func (v Value) Type() Type { return v.vtype } // AsBool returns the bool value. Make sure that the Value's type is // BOOL. func (v Value) AsBool() bool { return rawToBool(v.numeric) } // AsBoolSlice returns the []bool value. Make sure that the Value's type is // BOOLSLICE. func (v Value) AsBoolSlice() []bool { if v.vtype != BOOLSLICE { return nil } return v.asBoolSlice() } func (v Value) asBoolSlice() []bool { return attribute.AsBoolSlice(v.slice) } // AsInt64 returns the int64 value. Make sure that the Value's type is // INT64. func (v Value) AsInt64() int64 { return rawToInt64(v.numeric) } // AsInt64Slice returns the []int64 value. Make sure that the Value's type is // INT64SLICE. func (v Value) AsInt64Slice() []int64 { if v.vtype != INT64SLICE { return nil } return v.asInt64Slice() } func (v Value) asInt64Slice() []int64 { return attribute.AsInt64Slice(v.slice) } // AsFloat64 returns the float64 value. Make sure that the Value's // type is FLOAT64. func (v Value) AsFloat64() float64 { return rawToFloat64(v.numeric) } // AsFloat64Slice returns the []float64 value. Make sure that the Value's type is // FLOAT64SLICE. func (v Value) AsFloat64Slice() []float64 { if v.vtype != FLOAT64SLICE { return nil } return v.asFloat64Slice() } func (v Value) asFloat64Slice() []float64 { return attribute.AsFloat64Slice(v.slice) } // AsString returns the string value. Make sure that the Value's type // is STRING. func (v Value) AsString() string { return v.stringly } // AsStringSlice returns the []string value. Make sure that the Value's type is // STRINGSLICE. func (v Value) AsStringSlice() []string { if v.vtype != STRINGSLICE { return nil } return v.asStringSlice() } func (v Value) asStringSlice() []string { return attribute.AsStringSlice(v.slice) } type unknownValueType struct{} // AsInterface returns Value's data as any. func (v Value) AsInterface() any { switch v.Type() { case BOOL: return v.AsBool() case BOOLSLICE: return v.asBoolSlice() case INT64: return v.AsInt64() case INT64SLICE: return v.asInt64Slice() case FLOAT64: return v.AsFloat64() case FLOAT64SLICE: return v.asFloat64Slice() case STRING: return v.stringly case STRINGSLICE: return v.asStringSlice() } return unknownValueType{} } // Emit returns a string representation of Value's data. func (v Value) Emit() string { switch v.Type() { case BOOLSLICE: return fmt.Sprint(v.asBoolSlice()) case BOOL: return strconv.FormatBool(v.AsBool()) case INT64SLICE: j, err := json.Marshal(v.asInt64Slice()) if err != nil { return fmt.Sprintf("invalid: %v", v.asInt64Slice()) } return string(j) case INT64: return strconv.FormatInt(v.AsInt64(), 10) case FLOAT64SLICE: j, err := json.Marshal(v.asFloat64Slice()) if err != nil { return fmt.Sprintf("invalid: %v", v.asFloat64Slice()) } return string(j) case FLOAT64: return fmt.Sprint(v.AsFloat64()) case STRINGSLICE: j, err := json.Marshal(v.asStringSlice()) if err != nil { return fmt.Sprintf("invalid: %v", v.asStringSlice()) } return string(j) case STRING: return v.stringly default: return "unknown" } } // MarshalJSON returns the JSON encoding of the Value. func (v Value) MarshalJSON() ([]byte, error) { var jsonVal struct { Type string Value any } jsonVal.Type = v.Type().String() jsonVal.Value = v.AsInterface() return json.Marshal(jsonVal) } ================================================ FILE: vendor/go.opentelemetry.io/otel/baggage/README.md ================================================ # Baggage [![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/baggage)](https://pkg.go.dev/go.opentelemetry.io/otel/baggage) ================================================ FILE: vendor/go.opentelemetry.io/otel/baggage/baggage.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package baggage // import "go.opentelemetry.io/otel/baggage" import ( "errors" "fmt" "net/url" "strings" "unicode/utf8" "go.opentelemetry.io/otel/internal/baggage" ) const ( maxMembers = 180 maxBytesPerMembers = 4096 maxBytesPerBaggageString = 8192 listDelimiter = "," keyValueDelimiter = "=" propertyDelimiter = ";" ) var ( errInvalidKey = errors.New("invalid key") errInvalidValue = errors.New("invalid value") errInvalidProperty = errors.New("invalid baggage list-member property") errInvalidMember = errors.New("invalid baggage list-member") errMemberNumber = errors.New("too many list-members in baggage-string") errMemberBytes = errors.New("list-member too large") errBaggageBytes = errors.New("baggage-string too large") ) // Property is an additional metadata entry for a baggage list-member. type Property struct { key, value string // hasValue indicates if a zero-value value means the property does not // have a value or if it was the zero-value. hasValue bool } // NewKeyProperty returns a new Property for key. // // The passed key must be valid, non-empty UTF-8 string. // If key is invalid, an error will be returned. // However, the specific Propagators that are used to transmit baggage entries across // component boundaries may impose their own restrictions on Property key. // For example, the W3C Baggage specification restricts the Property keys to strings that // satisfy the token definition from RFC7230, Section 3.2.6. // For maximum compatibility, alphanumeric value are strongly recommended to be used as Property key. func NewKeyProperty(key string) (Property, error) { if !validateBaggageName(key) { return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidKey, key) } p := Property{key: key} return p, nil } // NewKeyValueProperty returns a new Property for key with value. // // The passed key must be compliant with W3C Baggage specification. // The passed value must be percent-encoded as defined in W3C Baggage specification. // // Notice: Consider using [NewKeyValuePropertyRaw] instead // that does not require percent-encoding of the value. func NewKeyValueProperty(key, value string) (Property, error) { if !validateKey(key) { return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidKey, key) } if !validateValue(value) { return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidValue, value) } decodedValue, err := url.PathUnescape(value) if err != nil { return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidValue, value) } return NewKeyValuePropertyRaw(key, decodedValue) } // NewKeyValuePropertyRaw returns a new Property for key with value. // // The passed key must be valid, non-empty UTF-8 string. // The passed value must be valid UTF-8 string. // However, the specific Propagators that are used to transmit baggage entries across // component boundaries may impose their own restrictions on Property key. // For example, the W3C Baggage specification restricts the Property keys to strings that // satisfy the token definition from RFC7230, Section 3.2.6. // For maximum compatibility, alphanumeric value are strongly recommended to be used as Property key. func NewKeyValuePropertyRaw(key, value string) (Property, error) { if !validateBaggageName(key) { return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidKey, key) } if !validateBaggageValue(value) { return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidValue, value) } p := Property{ key: key, value: value, hasValue: true, } return p, nil } func newInvalidProperty() Property { return Property{} } // parseProperty attempts to decode a Property from the passed string. It // returns an error if the input is invalid according to the W3C Baggage // specification. func parseProperty(property string) (Property, error) { if property == "" { return newInvalidProperty(), nil } p, ok := parsePropertyInternal(property) if !ok { return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidProperty, property) } return p, nil } // validate ensures p conforms to the W3C Baggage specification, returning an // error otherwise. func (p Property) validate() error { errFunc := func(err error) error { return fmt.Errorf("invalid property: %w", err) } if !validateBaggageName(p.key) { return errFunc(fmt.Errorf("%w: %q", errInvalidKey, p.key)) } if !p.hasValue && p.value != "" { return errFunc(errors.New("inconsistent value")) } if p.hasValue && !validateBaggageValue(p.value) { return errFunc(fmt.Errorf("%w: %q", errInvalidValue, p.value)) } return nil } // Key returns the Property key. func (p Property) Key() string { return p.key } // Value returns the Property value. Additionally, a boolean value is returned // indicating if the returned value is the empty if the Property has a value // that is empty or if the value is not set. func (p Property) Value() (string, bool) { return p.value, p.hasValue } // String encodes Property into a header string compliant with the W3C Baggage // specification. // It would return empty string if the key is invalid with the W3C Baggage // specification. This could happen for a UTF-8 key, as it may contain // invalid characters. func (p Property) String() string { // W3C Baggage specification does not allow percent-encoded keys. if !validateKey(p.key) { return "" } if p.hasValue { return fmt.Sprintf("%s%s%v", p.key, keyValueDelimiter, valueEscape(p.value)) } return p.key } type properties []Property func fromInternalProperties(iProps []baggage.Property) properties { if len(iProps) == 0 { return nil } props := make(properties, len(iProps)) for i, p := range iProps { props[i] = Property{ key: p.Key, value: p.Value, hasValue: p.HasValue, } } return props } func (p properties) asInternal() []baggage.Property { if len(p) == 0 { return nil } iProps := make([]baggage.Property, len(p)) for i, prop := range p { iProps[i] = baggage.Property{ Key: prop.key, Value: prop.value, HasValue: prop.hasValue, } } return iProps } func (p properties) Copy() properties { if len(p) == 0 { return nil } props := make(properties, len(p)) copy(props, p) return props } // validate ensures each Property in p conforms to the W3C Baggage // specification, returning an error otherwise. func (p properties) validate() error { for _, prop := range p { if err := prop.validate(); err != nil { return err } } return nil } // String encodes properties into a header string compliant with the W3C Baggage // specification. func (p properties) String() string { props := make([]string, 0, len(p)) for _, prop := range p { s := prop.String() // Ignored empty properties. if s != "" { props = append(props, s) } } return strings.Join(props, propertyDelimiter) } // Member is a list-member of a baggage-string as defined by the W3C Baggage // specification. type Member struct { key, value string properties properties // hasData indicates whether the created property contains data or not. // Properties that do not contain data are invalid with no other check // required. hasData bool } // NewMember returns a new Member from the passed arguments. // // The passed key must be compliant with W3C Baggage specification. // The passed value must be percent-encoded as defined in W3C Baggage specification. // // Notice: Consider using [NewMemberRaw] instead // that does not require percent-encoding of the value. func NewMember(key, value string, props ...Property) (Member, error) { if !validateKey(key) { return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidKey, key) } if !validateValue(value) { return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidValue, value) } decodedValue, err := url.PathUnescape(value) if err != nil { return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidValue, value) } return NewMemberRaw(key, decodedValue, props...) } // NewMemberRaw returns a new Member from the passed arguments. // // The passed key must be valid, non-empty UTF-8 string. // The passed value must be valid UTF-8 string. // However, the specific Propagators that are used to transmit baggage entries across // component boundaries may impose their own restrictions on baggage key. // For example, the W3C Baggage specification restricts the baggage keys to strings that // satisfy the token definition from RFC7230, Section 3.2.6. // For maximum compatibility, alphanumeric value are strongly recommended to be used as baggage key. func NewMemberRaw(key, value string, props ...Property) (Member, error) { m := Member{ key: key, value: value, properties: properties(props).Copy(), hasData: true, } if err := m.validate(); err != nil { return newInvalidMember(), err } return m, nil } func newInvalidMember() Member { return Member{} } // parseMember attempts to decode a Member from the passed string. It returns // an error if the input is invalid according to the W3C Baggage // specification. func parseMember(member string) (Member, error) { if n := len(member); n > maxBytesPerMembers { return newInvalidMember(), fmt.Errorf("%w: %d", errMemberBytes, n) } var props properties keyValue, properties, found := strings.Cut(member, propertyDelimiter) if found { // Parse the member properties. for pStr := range strings.SplitSeq(properties, propertyDelimiter) { p, err := parseProperty(pStr) if err != nil { return newInvalidMember(), err } props = append(props, p) } } // Parse the member key/value pair. // Take into account a value can contain equal signs (=). k, v, found := strings.Cut(keyValue, keyValueDelimiter) if !found { return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidMember, member) } // "Leading and trailing whitespaces are allowed but MUST be trimmed // when converting the header into a data structure." key := strings.TrimSpace(k) if !validateKey(key) { return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidKey, key) } rawVal := strings.TrimSpace(v) if !validateValue(rawVal) { return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidValue, v) } // Decode a percent-encoded value. unescapeVal, err := url.PathUnescape(rawVal) if err != nil { return newInvalidMember(), fmt.Errorf("%w: %w", errInvalidValue, err) } value := replaceInvalidUTF8Sequences(len(rawVal), unescapeVal) return Member{key: key, value: value, properties: props, hasData: true}, nil } // replaceInvalidUTF8Sequences replaces invalid UTF-8 sequences with '�'. func replaceInvalidUTF8Sequences(c int, unescapeVal string) string { if utf8.ValidString(unescapeVal) { return unescapeVal } // W3C baggage spec: // https://github.com/w3c/baggage/blob/8c215efbeebd3fa4b1aceb937a747e56444f22f3/baggage/HTTP_HEADER_FORMAT.md?plain=1#L69 var b strings.Builder b.Grow(c) for i := 0; i < len(unescapeVal); { r, size := utf8.DecodeRuneInString(unescapeVal[i:]) if r == utf8.RuneError && size == 1 { // Invalid UTF-8 sequence found, replace it with '�' _, _ = b.WriteString("�") } else { _, _ = b.WriteRune(r) } i += size } return b.String() } // validate ensures m conforms to the W3C Baggage specification. // A key must be an ASCII string, returning an error otherwise. func (m Member) validate() error { if !m.hasData { return fmt.Errorf("%w: %q", errInvalidMember, m) } if !validateBaggageName(m.key) { return fmt.Errorf("%w: %q", errInvalidKey, m.key) } if !validateBaggageValue(m.value) { return fmt.Errorf("%w: %q", errInvalidValue, m.value) } return m.properties.validate() } // Key returns the Member key. func (m Member) Key() string { return m.key } // Value returns the Member value. func (m Member) Value() string { return m.value } // Properties returns a copy of the Member properties. func (m Member) Properties() []Property { return m.properties.Copy() } // String encodes Member into a header string compliant with the W3C Baggage // specification. // It would return empty string if the key is invalid with the W3C Baggage // specification. This could happen for a UTF-8 key, as it may contain // invalid characters. func (m Member) String() string { // W3C Baggage specification does not allow percent-encoded keys. if !validateKey(m.key) { return "" } s := m.key + keyValueDelimiter + valueEscape(m.value) if len(m.properties) > 0 { s += propertyDelimiter + m.properties.String() } return s } // Baggage is a list of baggage members representing the baggage-string as // defined by the W3C Baggage specification. type Baggage struct { //nolint:golint list baggage.List } // New returns a new valid Baggage. It returns an error if it results in a // Baggage exceeding limits set in that specification. // // It expects all the provided members to have already been validated. func New(members ...Member) (Baggage, error) { if len(members) == 0 { return Baggage{}, nil } b := make(baggage.List) for _, m := range members { if !m.hasData { return Baggage{}, errInvalidMember } // OpenTelemetry resolves duplicates by last-one-wins. b[m.key] = baggage.Item{ Value: m.value, Properties: m.properties.asInternal(), } } // Check member numbers after deduplication. if len(b) > maxMembers { return Baggage{}, errMemberNumber } bag := Baggage{b} if n := len(bag.String()); n > maxBytesPerBaggageString { return Baggage{}, fmt.Errorf("%w: %d", errBaggageBytes, n) } return bag, nil } // Parse attempts to decode a baggage-string from the passed string. It // returns an error if the input is invalid according to the W3C Baggage // specification. // // If there are duplicate list-members contained in baggage, the last one // defined (reading left-to-right) will be the only one kept. This diverges // from the W3C Baggage specification which allows duplicate list-members, but // conforms to the OpenTelemetry Baggage specification. func Parse(bStr string) (Baggage, error) { if bStr == "" { return Baggage{}, nil } if n := len(bStr); n > maxBytesPerBaggageString { return Baggage{}, fmt.Errorf("%w: %d", errBaggageBytes, n) } b := make(baggage.List) for memberStr := range strings.SplitSeq(bStr, listDelimiter) { m, err := parseMember(memberStr) if err != nil { return Baggage{}, err } // OpenTelemetry resolves duplicates by last-one-wins. b[m.key] = baggage.Item{ Value: m.value, Properties: m.properties.asInternal(), } } // OpenTelemetry does not allow for duplicate list-members, but the W3C // specification does. Now that we have deduplicated, ensure the baggage // does not exceed list-member limits. if len(b) > maxMembers { return Baggage{}, errMemberNumber } return Baggage{b}, nil } // Member returns the baggage list-member identified by key. // // If there is no list-member matching the passed key the returned Member will // be a zero-value Member. // The returned member is not validated, as we assume the validation happened // when it was added to the Baggage. func (b Baggage) Member(key string) Member { v, ok := b.list[key] if !ok { // We do not need to worry about distinguishing between the situation // where a zero-valued Member is included in the Baggage because a // zero-valued Member is invalid according to the W3C Baggage // specification (it has an empty key). return newInvalidMember() } return Member{ key: key, value: v.Value, properties: fromInternalProperties(v.Properties), hasData: true, } } // Members returns all the baggage list-members. // The order of the returned list-members is not significant. // // The returned members are not validated, as we assume the validation happened // when they were added to the Baggage. func (b Baggage) Members() []Member { if len(b.list) == 0 { return nil } members := make([]Member, 0, len(b.list)) for k, v := range b.list { members = append(members, Member{ key: k, value: v.Value, properties: fromInternalProperties(v.Properties), hasData: true, }) } return members } // SetMember returns a copy of the Baggage with the member included. If the // baggage contains a Member with the same key, the existing Member is // replaced. // // If member is invalid according to the W3C Baggage specification, an error // is returned with the original Baggage. func (b Baggage) SetMember(member Member) (Baggage, error) { if !member.hasData { return b, errInvalidMember } n := len(b.list) if _, ok := b.list[member.key]; !ok { n++ } list := make(baggage.List, n) for k, v := range b.list { // Do not copy if we are just going to overwrite. if k == member.key { continue } list[k] = v } list[member.key] = baggage.Item{ Value: member.value, Properties: member.properties.asInternal(), } return Baggage{list: list}, nil } // DeleteMember returns a copy of the Baggage with the list-member identified // by key removed. func (b Baggage) DeleteMember(key string) Baggage { n := len(b.list) if _, ok := b.list[key]; ok { n-- } list := make(baggage.List, n) for k, v := range b.list { if k == key { continue } list[k] = v } return Baggage{list: list} } // Len returns the number of list-members in the Baggage. func (b Baggage) Len() int { return len(b.list) } // String encodes Baggage into a header string compliant with the W3C Baggage // specification. // It would ignore members where the member key is invalid with the W3C Baggage // specification. This could happen for a UTF-8 key, as it may contain // invalid characters. func (b Baggage) String() string { members := make([]string, 0, len(b.list)) for k, v := range b.list { s := Member{ key: k, value: v.Value, properties: fromInternalProperties(v.Properties), }.String() // Ignored empty members. if s != "" { members = append(members, s) } } return strings.Join(members, listDelimiter) } // parsePropertyInternal attempts to decode a Property from the passed string. // It follows the spec at https://www.w3.org/TR/baggage/#definition. func parsePropertyInternal(s string) (p Property, ok bool) { // For the entire function we will use " key = value " as an example. // Attempting to parse the key. // First skip spaces at the beginning "< >key = value " (they could be empty). index := skipSpace(s, 0) // Parse the key: " = value ". keyStart := index keyEnd := index for _, c := range s[keyStart:] { if !validateKeyChar(c) { break } keyEnd++ } // If we couldn't find any valid key character, // it means the key is either empty or invalid. if keyStart == keyEnd { return p, ok } // Skip spaces after the key: " key< >= value ". index = skipSpace(s, keyEnd) if index == len(s) { // A key can have no value, like: " key ". ok = true p.key = s[keyStart:keyEnd] return p, ok } // If we have not reached the end and we can't find the '=' delimiter, // it means the property is invalid. if s[index] != keyValueDelimiter[0] { return p, ok } // Attempting to parse the value. // Match: " key =< >value ". index = skipSpace(s, index+1) // Match the value string: " key = ". // A valid property can be: " key =". // Therefore, we don't have to check if the value is empty. valueStart := index valueEnd := index for _, c := range s[valueStart:] { if !validateValueChar(c) { break } valueEnd++ } // Skip all trailing whitespaces: " key = value< >". index = skipSpace(s, valueEnd) // If after looking for the value and skipping whitespaces // we have not reached the end, it means the property is // invalid, something like: " key = value value1". if index != len(s) { return p, ok } // Decode a percent-encoded value. rawVal := s[valueStart:valueEnd] unescapeVal, err := url.PathUnescape(rawVal) if err != nil { return p, ok } value := replaceInvalidUTF8Sequences(len(rawVal), unescapeVal) ok = true p.key = s[keyStart:keyEnd] p.hasValue = true p.value = value return p, ok } func skipSpace(s string, offset int) int { i := offset for ; i < len(s); i++ { c := s[i] if c != ' ' && c != '\t' { break } } return i } var safeKeyCharset = [utf8.RuneSelf]bool{ // 0x23 to 0x27 '#': true, '$': true, '%': true, '&': true, '\'': true, // 0x30 to 0x39 '0': true, '1': true, '2': true, '3': true, '4': true, '5': true, '6': true, '7': true, '8': true, '9': true, // 0x41 to 0x5a 'A': true, 'B': true, 'C': true, 'D': true, 'E': true, 'F': true, 'G': true, 'H': true, 'I': true, 'J': true, 'K': true, 'L': true, 'M': true, 'N': true, 'O': true, 'P': true, 'Q': true, 'R': true, 'S': true, 'T': true, 'U': true, 'V': true, 'W': true, 'X': true, 'Y': true, 'Z': true, // 0x5e to 0x7a '^': true, '_': true, '`': true, 'a': true, 'b': true, 'c': true, 'd': true, 'e': true, 'f': true, 'g': true, 'h': true, 'i': true, 'j': true, 'k': true, 'l': true, 'm': true, 'n': true, 'o': true, 'p': true, 'q': true, 'r': true, 's': true, 't': true, 'u': true, 'v': true, 'w': true, 'x': true, 'y': true, 'z': true, // remainder '!': true, '*': true, '+': true, '-': true, '.': true, '|': true, '~': true, } // validateBaggageName checks if the string is a valid OpenTelemetry Baggage name. // Baggage name is a valid, non-empty UTF-8 string. func validateBaggageName(s string) bool { if s == "" { return false } return utf8.ValidString(s) } // validateBaggageValue checks if the string is a valid OpenTelemetry Baggage value. // Baggage value is a valid UTF-8 strings. // Empty string is also a valid UTF-8 string. func validateBaggageValue(s string) bool { return utf8.ValidString(s) } // validateKey checks if the string is a valid W3C Baggage key. func validateKey(s string) bool { if s == "" { return false } for _, c := range s { if !validateKeyChar(c) { return false } } return true } func validateKeyChar(c int32) bool { return c >= 0 && c < int32(utf8.RuneSelf) && safeKeyCharset[c] } // validateValue checks if the string is a valid W3C Baggage value. func validateValue(s string) bool { for _, c := range s { if !validateValueChar(c) { return false } } return true } var safeValueCharset = [utf8.RuneSelf]bool{ '!': true, // 0x21 // 0x23 to 0x2b '#': true, '$': true, '%': true, '&': true, '\'': true, '(': true, ')': true, '*': true, '+': true, // 0x2d to 0x3a '-': true, '.': true, '/': true, '0': true, '1': true, '2': true, '3': true, '4': true, '5': true, '6': true, '7': true, '8': true, '9': true, ':': true, // 0x3c to 0x5b '<': true, // 0x3C '=': true, // 0x3D '>': true, // 0x3E '?': true, // 0x3F '@': true, // 0x40 'A': true, // 0x41 'B': true, // 0x42 'C': true, // 0x43 'D': true, // 0x44 'E': true, // 0x45 'F': true, // 0x46 'G': true, // 0x47 'H': true, // 0x48 'I': true, // 0x49 'J': true, // 0x4A 'K': true, // 0x4B 'L': true, // 0x4C 'M': true, // 0x4D 'N': true, // 0x4E 'O': true, // 0x4F 'P': true, // 0x50 'Q': true, // 0x51 'R': true, // 0x52 'S': true, // 0x53 'T': true, // 0x54 'U': true, // 0x55 'V': true, // 0x56 'W': true, // 0x57 'X': true, // 0x58 'Y': true, // 0x59 'Z': true, // 0x5A '[': true, // 0x5B // 0x5d to 0x7e ']': true, // 0x5D '^': true, // 0x5E '_': true, // 0x5F '`': true, // 0x60 'a': true, // 0x61 'b': true, // 0x62 'c': true, // 0x63 'd': true, // 0x64 'e': true, // 0x65 'f': true, // 0x66 'g': true, // 0x67 'h': true, // 0x68 'i': true, // 0x69 'j': true, // 0x6A 'k': true, // 0x6B 'l': true, // 0x6C 'm': true, // 0x6D 'n': true, // 0x6E 'o': true, // 0x6F 'p': true, // 0x70 'q': true, // 0x71 'r': true, // 0x72 's': true, // 0x73 't': true, // 0x74 'u': true, // 0x75 'v': true, // 0x76 'w': true, // 0x77 'x': true, // 0x78 'y': true, // 0x79 'z': true, // 0x7A '{': true, // 0x7B '|': true, // 0x7C '}': true, // 0x7D '~': true, // 0x7E } func validateValueChar(c int32) bool { return c >= 0 && c < int32(utf8.RuneSelf) && safeValueCharset[c] } // valueEscape escapes the string so it can be safely placed inside a baggage value, // replacing special characters with %XX sequences as needed. // // The implementation is based on: // https://github.com/golang/go/blob/f6509cf5cdbb5787061b784973782933c47f1782/src/net/url/url.go#L285. func valueEscape(s string) string { hexCount := 0 for i := 0; i < len(s); i++ { c := s[i] if shouldEscape(c) { hexCount++ } } if hexCount == 0 { return s } var buf [64]byte var t []byte required := len(s) + 2*hexCount if required <= len(buf) { t = buf[:required] } else { t = make([]byte, required) } j := 0 for i := 0; i < len(s); i++ { c := s[i] if shouldEscape(s[i]) { const upperhex = "0123456789ABCDEF" t[j] = '%' t[j+1] = upperhex[c>>4] t[j+2] = upperhex[c&15] j += 3 } else { t[j] = c j++ } } return string(t) } // shouldEscape returns true if the specified byte should be escaped when // appearing in a baggage value string. func shouldEscape(c byte) bool { if c == '%' { // The percent character must be encoded so that percent-encoding can work. return true } return !validateValueChar(int32(c)) } ================================================ FILE: vendor/go.opentelemetry.io/otel/baggage/context.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package baggage // import "go.opentelemetry.io/otel/baggage" import ( "context" "go.opentelemetry.io/otel/internal/baggage" ) // ContextWithBaggage returns a copy of parent with baggage. func ContextWithBaggage(parent context.Context, b Baggage) context.Context { // Delegate so any hooks for the OpenTracing bridge are handled. return baggage.ContextWithList(parent, b.list) } // ContextWithoutBaggage returns a copy of parent with no baggage. func ContextWithoutBaggage(parent context.Context) context.Context { // Delegate so any hooks for the OpenTracing bridge are handled. return baggage.ContextWithList(parent, nil) } // FromContext returns the baggage contained in ctx. func FromContext(ctx context.Context) Baggage { // Delegate so any hooks for the OpenTracing bridge are handled. return Baggage{list: baggage.ListFromContext(ctx)} } ================================================ FILE: vendor/go.opentelemetry.io/otel/baggage/doc.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 /* Package baggage provides functionality for storing and retrieving baggage items in Go context. For propagating the baggage, see the go.opentelemetry.io/otel/propagation package. */ package baggage // import "go.opentelemetry.io/otel/baggage" ================================================ FILE: vendor/go.opentelemetry.io/otel/codes/README.md ================================================ # Codes [![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/codes)](https://pkg.go.dev/go.opentelemetry.io/otel/codes) ================================================ FILE: vendor/go.opentelemetry.io/otel/codes/codes.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package codes // import "go.opentelemetry.io/otel/codes" import ( "encoding/json" "errors" "fmt" "strconv" ) const ( // Unset is the default status code. Unset Code = 0 // Error indicates the operation contains an error. // // NOTE: The error code in OTLP is 2. // The value of this enum is only relevant to the internals // of the Go SDK. Error Code = 1 // Ok indicates operation has been validated by an Application developers // or Operator to have completed successfully, or contain no error. // // NOTE: The Ok code in OTLP is 1. // The value of this enum is only relevant to the internals // of the Go SDK. Ok Code = 2 maxCode = 3 ) // Code is an 32-bit representation of a status state. type Code uint32 var codeToStr = map[Code]string{ Unset: "Unset", Error: "Error", Ok: "Ok", } var strToCode = map[string]Code{ `"Unset"`: Unset, `"Error"`: Error, `"Ok"`: Ok, } // String returns the Code as a string. func (c Code) String() string { return codeToStr[c] } // UnmarshalJSON unmarshals b into the Code. // // This is based on the functionality in the gRPC codes package: // https://github.com/grpc/grpc-go/blob/bb64fee312b46ebee26be43364a7a966033521b1/codes/codes.go#L218-L244 func (c *Code) UnmarshalJSON(b []byte) error { // From json.Unmarshaler: By convention, to approximate the behavior of // Unmarshal itself, Unmarshalers implement UnmarshalJSON([]byte("null")) as // a no-op. if string(b) == "null" { return nil } if c == nil { return errors.New("nil receiver passed to UnmarshalJSON") } var x any if err := json.Unmarshal(b, &x); err != nil { return err } switch x.(type) { case string: if jc, ok := strToCode[string(b)]; ok { *c = jc return nil } return fmt.Errorf("invalid code: %q", string(b)) case float64: if ci, err := strconv.ParseUint(string(b), 10, 32); err == nil { if ci >= maxCode { return fmt.Errorf("invalid code: %q", ci) } *c = Code(ci) // nolint: gosec // Bit size of 32 check above. return nil } return fmt.Errorf("invalid code: %q", string(b)) default: return fmt.Errorf("invalid code: %q", string(b)) } } // MarshalJSON returns c as the JSON encoding of c. func (c *Code) MarshalJSON() ([]byte, error) { if c == nil { return []byte("null"), nil } str, ok := codeToStr[*c] if !ok { return nil, fmt.Errorf("invalid code: %d", *c) } return fmt.Appendf(nil, "%q", str), nil } ================================================ FILE: vendor/go.opentelemetry.io/otel/codes/doc.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 /* Package codes defines the canonical error codes used by OpenTelemetry. It conforms to [the OpenTelemetry specification](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.20.0/specification/trace/api.md#set-status). */ package codes // import "go.opentelemetry.io/otel/codes" ================================================ FILE: vendor/go.opentelemetry.io/otel/dependencies.Dockerfile ================================================ # This is a renovate-friendly source of Docker images. FROM python:3.13.6-slim-bullseye@sha256:e98b521460ee75bca92175c16247bdf7275637a8faaeb2bcfa19d879ae5c4b9a AS python FROM otel/weaver:v0.20.0@sha256:fa4f1c6954ecea78ab1a4e865bd6f5b4aaba80c1896f9f4a11e2c361d04e197e AS weaver FROM avtodev/markdown-lint:v1@sha256:6aeedc2f49138ce7a1cd0adffc1b1c0321b841dc2102408967d9301c031949ee AS markdown ================================================ FILE: vendor/go.opentelemetry.io/otel/doc.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 /* Package otel provides global access to the OpenTelemetry API. The subpackages of the otel package provide an implementation of the OpenTelemetry API. The provided API is used to instrument code and measure data about that code's performance and operation. The measured data, by default, is not processed or transmitted anywhere. An implementation of the OpenTelemetry SDK, like the default SDK implementation (go.opentelemetry.io/otel/sdk), and associated exporters are used to process and transport this data. To read the getting started guide, see https://opentelemetry.io/docs/languages/go/getting-started/. To read more about tracing, see go.opentelemetry.io/otel/trace. To read more about metrics, see go.opentelemetry.io/otel/metric. To read more about logs, see go.opentelemetry.io/otel/log. To read more about propagation, see go.opentelemetry.io/otel/propagation and go.opentelemetry.io/otel/baggage. */ package otel // import "go.opentelemetry.io/otel" ================================================ FILE: vendor/go.opentelemetry.io/otel/error_handler.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package otel // import "go.opentelemetry.io/otel" // ErrorHandler handles irremediable events. type ErrorHandler interface { // DO NOT CHANGE: any modification will not be backwards compatible and // must never be done outside of a new major release. // Handle handles any error deemed irremediable by an OpenTelemetry // component. Handle(error) // DO NOT CHANGE: any modification will not be backwards compatible and // must never be done outside of a new major release. } // ErrorHandlerFunc is a convenience adapter to allow the use of a function // as an ErrorHandler. type ErrorHandlerFunc func(error) var _ ErrorHandler = ErrorHandlerFunc(nil) // Handle handles the irremediable error by calling the ErrorHandlerFunc itself. func (f ErrorHandlerFunc) Handle(err error) { f(err) } ================================================ FILE: vendor/go.opentelemetry.io/otel/handler.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package otel // import "go.opentelemetry.io/otel" import ( "go.opentelemetry.io/otel/internal/global" ) // Compile-time check global.ErrDelegator implements ErrorHandler. var _ ErrorHandler = (*global.ErrDelegator)(nil) // GetErrorHandler returns the global ErrorHandler instance. // // The default ErrorHandler instance returned will log all errors to STDERR // until an override ErrorHandler is set with SetErrorHandler. All // ErrorHandler returned prior to this will automatically forward errors to // the set instance instead of logging. // // Subsequent calls to SetErrorHandler after the first will not forward errors // to the new ErrorHandler for prior returned instances. func GetErrorHandler() ErrorHandler { return global.GetErrorHandler() } // SetErrorHandler sets the global ErrorHandler to h. // // The first time this is called all ErrorHandler previously returned from // GetErrorHandler will send errors to h instead of the default logging // ErrorHandler. Subsequent calls will set the global ErrorHandler, but not // delegate errors to h. func SetErrorHandler(h ErrorHandler) { global.SetErrorHandler(h) } // Handle is a convenience function for GetErrorHandler().Handle(err). func Handle(err error) { global.GetErrorHandler().Handle(err) } ================================================ FILE: vendor/go.opentelemetry.io/otel/internal/baggage/baggage.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 /* Package baggage provides base types and functionality to store and retrieve baggage in Go context. This package exists because the OpenTracing bridge to OpenTelemetry needs to synchronize state whenever baggage for a context is modified and that context contains an OpenTracing span. If it were not for this need this package would not need to exist and the `go.opentelemetry.io/otel/baggage` package would be the singular place where W3C baggage is handled. */ package baggage // import "go.opentelemetry.io/otel/internal/baggage" // List is the collection of baggage members. The W3C allows for duplicates, // but OpenTelemetry does not, therefore, this is represented as a map. type List map[string]Item // Item is the value and metadata properties part of a list-member. type Item struct { Value string Properties []Property } // Property is a metadata entry for a list-member. type Property struct { Key, Value string // HasValue indicates if a zero-value value means the property does not // have a value or if it was the zero-value. HasValue bool } ================================================ FILE: vendor/go.opentelemetry.io/otel/internal/baggage/context.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package baggage // import "go.opentelemetry.io/otel/internal/baggage" import "context" type baggageContextKeyType int const baggageKey baggageContextKeyType = iota // SetHookFunc is a callback called when storing baggage in the context. type SetHookFunc func(context.Context, List) context.Context // GetHookFunc is a callback called when getting baggage from the context. type GetHookFunc func(context.Context, List) List type baggageState struct { list List setHook SetHookFunc getHook GetHookFunc } // ContextWithSetHook returns a copy of parent with hook configured to be // invoked every time ContextWithBaggage is called. // // Passing nil SetHookFunc creates a context with no set hook to call. func ContextWithSetHook(parent context.Context, hook SetHookFunc) context.Context { var s baggageState if v, ok := parent.Value(baggageKey).(baggageState); ok { s = v } s.setHook = hook return context.WithValue(parent, baggageKey, s) } // ContextWithGetHook returns a copy of parent with hook configured to be // invoked every time FromContext is called. // // Passing nil GetHookFunc creates a context with no get hook to call. func ContextWithGetHook(parent context.Context, hook GetHookFunc) context.Context { var s baggageState if v, ok := parent.Value(baggageKey).(baggageState); ok { s = v } s.getHook = hook return context.WithValue(parent, baggageKey, s) } // ContextWithList returns a copy of parent with baggage. Passing nil list // returns a context without any baggage. func ContextWithList(parent context.Context, list List) context.Context { var s baggageState if v, ok := parent.Value(baggageKey).(baggageState); ok { s = v } s.list = list ctx := context.WithValue(parent, baggageKey, s) if s.setHook != nil { ctx = s.setHook(ctx, list) } return ctx } // ListFromContext returns the baggage contained in ctx. func ListFromContext(ctx context.Context) List { switch v := ctx.Value(baggageKey).(type) { case baggageState: if v.getHook != nil { return v.getHook(ctx, v.list) } return v.list default: return nil } } ================================================ FILE: vendor/go.opentelemetry.io/otel/internal/global/handler.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 // Package global provides the OpenTelemetry global API. package global // import "go.opentelemetry.io/otel/internal/global" import ( "log" "sync/atomic" ) // ErrorHandler handles irremediable events. type ErrorHandler interface { // Handle handles any error deemed irremediable by an OpenTelemetry // component. Handle(error) } type ErrDelegator struct { delegate atomic.Pointer[ErrorHandler] } // Compile-time check that delegator implements ErrorHandler. var _ ErrorHandler = (*ErrDelegator)(nil) func (d *ErrDelegator) Handle(err error) { if eh := d.delegate.Load(); eh != nil { (*eh).Handle(err) return } log.Print(err) } // setDelegate sets the ErrorHandler delegate. func (d *ErrDelegator) setDelegate(eh ErrorHandler) { d.delegate.Store(&eh) } ================================================ FILE: vendor/go.opentelemetry.io/otel/internal/global/instruments.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package global // import "go.opentelemetry.io/otel/internal/global" import ( "context" "sync/atomic" "go.opentelemetry.io/otel/metric" "go.opentelemetry.io/otel/metric/embedded" ) // unwrapper unwraps to return the underlying instrument implementation. type unwrapper interface { unwrap() metric.Observable } type afCounter struct { embedded.Float64ObservableCounter metric.Float64Observable name string opts []metric.Float64ObservableCounterOption delegate atomic.Value // metric.Float64ObservableCounter } var ( _ unwrapper = (*afCounter)(nil) _ metric.Float64ObservableCounter = (*afCounter)(nil) ) func (i *afCounter) setDelegate(m metric.Meter) { ctr, err := m.Float64ObservableCounter(i.name, i.opts...) if err != nil { GetErrorHandler().Handle(err) return } i.delegate.Store(ctr) } func (i *afCounter) unwrap() metric.Observable { if ctr := i.delegate.Load(); ctr != nil { return ctr.(metric.Float64ObservableCounter) } return nil } type afUpDownCounter struct { embedded.Float64ObservableUpDownCounter metric.Float64Observable name string opts []metric.Float64ObservableUpDownCounterOption delegate atomic.Value // metric.Float64ObservableUpDownCounter } var ( _ unwrapper = (*afUpDownCounter)(nil) _ metric.Float64ObservableUpDownCounter = (*afUpDownCounter)(nil) ) func (i *afUpDownCounter) setDelegate(m metric.Meter) { ctr, err := m.Float64ObservableUpDownCounter(i.name, i.opts...) if err != nil { GetErrorHandler().Handle(err) return } i.delegate.Store(ctr) } func (i *afUpDownCounter) unwrap() metric.Observable { if ctr := i.delegate.Load(); ctr != nil { return ctr.(metric.Float64ObservableUpDownCounter) } return nil } type afGauge struct { embedded.Float64ObservableGauge metric.Float64Observable name string opts []metric.Float64ObservableGaugeOption delegate atomic.Value // metric.Float64ObservableGauge } var ( _ unwrapper = (*afGauge)(nil) _ metric.Float64ObservableGauge = (*afGauge)(nil) ) func (i *afGauge) setDelegate(m metric.Meter) { ctr, err := m.Float64ObservableGauge(i.name, i.opts...) if err != nil { GetErrorHandler().Handle(err) return } i.delegate.Store(ctr) } func (i *afGauge) unwrap() metric.Observable { if ctr := i.delegate.Load(); ctr != nil { return ctr.(metric.Float64ObservableGauge) } return nil } type aiCounter struct { embedded.Int64ObservableCounter metric.Int64Observable name string opts []metric.Int64ObservableCounterOption delegate atomic.Value // metric.Int64ObservableCounter } var ( _ unwrapper = (*aiCounter)(nil) _ metric.Int64ObservableCounter = (*aiCounter)(nil) ) func (i *aiCounter) setDelegate(m metric.Meter) { ctr, err := m.Int64ObservableCounter(i.name, i.opts...) if err != nil { GetErrorHandler().Handle(err) return } i.delegate.Store(ctr) } func (i *aiCounter) unwrap() metric.Observable { if ctr := i.delegate.Load(); ctr != nil { return ctr.(metric.Int64ObservableCounter) } return nil } type aiUpDownCounter struct { embedded.Int64ObservableUpDownCounter metric.Int64Observable name string opts []metric.Int64ObservableUpDownCounterOption delegate atomic.Value // metric.Int64ObservableUpDownCounter } var ( _ unwrapper = (*aiUpDownCounter)(nil) _ metric.Int64ObservableUpDownCounter = (*aiUpDownCounter)(nil) ) func (i *aiUpDownCounter) setDelegate(m metric.Meter) { ctr, err := m.Int64ObservableUpDownCounter(i.name, i.opts...) if err != nil { GetErrorHandler().Handle(err) return } i.delegate.Store(ctr) } func (i *aiUpDownCounter) unwrap() metric.Observable { if ctr := i.delegate.Load(); ctr != nil { return ctr.(metric.Int64ObservableUpDownCounter) } return nil } type aiGauge struct { embedded.Int64ObservableGauge metric.Int64Observable name string opts []metric.Int64ObservableGaugeOption delegate atomic.Value // metric.Int64ObservableGauge } var ( _ unwrapper = (*aiGauge)(nil) _ metric.Int64ObservableGauge = (*aiGauge)(nil) ) func (i *aiGauge) setDelegate(m metric.Meter) { ctr, err := m.Int64ObservableGauge(i.name, i.opts...) if err != nil { GetErrorHandler().Handle(err) return } i.delegate.Store(ctr) } func (i *aiGauge) unwrap() metric.Observable { if ctr := i.delegate.Load(); ctr != nil { return ctr.(metric.Int64ObservableGauge) } return nil } // Sync Instruments. type sfCounter struct { embedded.Float64Counter name string opts []metric.Float64CounterOption delegate atomic.Value // metric.Float64Counter } var _ metric.Float64Counter = (*sfCounter)(nil) func (i *sfCounter) setDelegate(m metric.Meter) { ctr, err := m.Float64Counter(i.name, i.opts...) if err != nil { GetErrorHandler().Handle(err) return } i.delegate.Store(ctr) } func (i *sfCounter) Add(ctx context.Context, incr float64, opts ...metric.AddOption) { if ctr := i.delegate.Load(); ctr != nil { ctr.(metric.Float64Counter).Add(ctx, incr, opts...) } } func (i *sfCounter) Enabled(ctx context.Context) bool { if ctr := i.delegate.Load(); ctr != nil { return ctr.(metric.Float64Counter).Enabled(ctx) } return false } type sfUpDownCounter struct { embedded.Float64UpDownCounter name string opts []metric.Float64UpDownCounterOption delegate atomic.Value // metric.Float64UpDownCounter } var _ metric.Float64UpDownCounter = (*sfUpDownCounter)(nil) func (i *sfUpDownCounter) setDelegate(m metric.Meter) { ctr, err := m.Float64UpDownCounter(i.name, i.opts...) if err != nil { GetErrorHandler().Handle(err) return } i.delegate.Store(ctr) } func (i *sfUpDownCounter) Add(ctx context.Context, incr float64, opts ...metric.AddOption) { if ctr := i.delegate.Load(); ctr != nil { ctr.(metric.Float64UpDownCounter).Add(ctx, incr, opts...) } } func (i *sfUpDownCounter) Enabled(ctx context.Context) bool { if ctr := i.delegate.Load(); ctr != nil { return ctr.(metric.Float64UpDownCounter).Enabled(ctx) } return false } type sfHistogram struct { embedded.Float64Histogram name string opts []metric.Float64HistogramOption delegate atomic.Value // metric.Float64Histogram } var _ metric.Float64Histogram = (*sfHistogram)(nil) func (i *sfHistogram) setDelegate(m metric.Meter) { ctr, err := m.Float64Histogram(i.name, i.opts...) if err != nil { GetErrorHandler().Handle(err) return } i.delegate.Store(ctr) } func (i *sfHistogram) Record(ctx context.Context, x float64, opts ...metric.RecordOption) { if ctr := i.delegate.Load(); ctr != nil { ctr.(metric.Float64Histogram).Record(ctx, x, opts...) } } func (i *sfHistogram) Enabled(ctx context.Context) bool { if ctr := i.delegate.Load(); ctr != nil { return ctr.(metric.Float64Histogram).Enabled(ctx) } return false } type sfGauge struct { embedded.Float64Gauge name string opts []metric.Float64GaugeOption delegate atomic.Value // metric.Float64Gauge } var _ metric.Float64Gauge = (*sfGauge)(nil) func (i *sfGauge) setDelegate(m metric.Meter) { ctr, err := m.Float64Gauge(i.name, i.opts...) if err != nil { GetErrorHandler().Handle(err) return } i.delegate.Store(ctr) } func (i *sfGauge) Record(ctx context.Context, x float64, opts ...metric.RecordOption) { if ctr := i.delegate.Load(); ctr != nil { ctr.(metric.Float64Gauge).Record(ctx, x, opts...) } } func (i *sfGauge) Enabled(ctx context.Context) bool { if ctr := i.delegate.Load(); ctr != nil { return ctr.(metric.Float64Gauge).Enabled(ctx) } return false } type siCounter struct { embedded.Int64Counter name string opts []metric.Int64CounterOption delegate atomic.Value // metric.Int64Counter } var _ metric.Int64Counter = (*siCounter)(nil) func (i *siCounter) setDelegate(m metric.Meter) { ctr, err := m.Int64Counter(i.name, i.opts...) if err != nil { GetErrorHandler().Handle(err) return } i.delegate.Store(ctr) } func (i *siCounter) Add(ctx context.Context, x int64, opts ...metric.AddOption) { if ctr := i.delegate.Load(); ctr != nil { ctr.(metric.Int64Counter).Add(ctx, x, opts...) } } func (i *siCounter) Enabled(ctx context.Context) bool { if ctr := i.delegate.Load(); ctr != nil { return ctr.(metric.Int64Counter).Enabled(ctx) } return false } type siUpDownCounter struct { embedded.Int64UpDownCounter name string opts []metric.Int64UpDownCounterOption delegate atomic.Value // metric.Int64UpDownCounter } var _ metric.Int64UpDownCounter = (*siUpDownCounter)(nil) func (i *siUpDownCounter) setDelegate(m metric.Meter) { ctr, err := m.Int64UpDownCounter(i.name, i.opts...) if err != nil { GetErrorHandler().Handle(err) return } i.delegate.Store(ctr) } func (i *siUpDownCounter) Add(ctx context.Context, x int64, opts ...metric.AddOption) { if ctr := i.delegate.Load(); ctr != nil { ctr.(metric.Int64UpDownCounter).Add(ctx, x, opts...) } } func (i *siUpDownCounter) Enabled(ctx context.Context) bool { if ctr := i.delegate.Load(); ctr != nil { return ctr.(metric.Int64UpDownCounter).Enabled(ctx) } return false } type siHistogram struct { embedded.Int64Histogram name string opts []metric.Int64HistogramOption delegate atomic.Value // metric.Int64Histogram } var _ metric.Int64Histogram = (*siHistogram)(nil) func (i *siHistogram) setDelegate(m metric.Meter) { ctr, err := m.Int64Histogram(i.name, i.opts...) if err != nil { GetErrorHandler().Handle(err) return } i.delegate.Store(ctr) } func (i *siHistogram) Record(ctx context.Context, x int64, opts ...metric.RecordOption) { if ctr := i.delegate.Load(); ctr != nil { ctr.(metric.Int64Histogram).Record(ctx, x, opts...) } } func (i *siHistogram) Enabled(ctx context.Context) bool { if ctr := i.delegate.Load(); ctr != nil { return ctr.(metric.Int64Histogram).Enabled(ctx) } return false } type siGauge struct { embedded.Int64Gauge name string opts []metric.Int64GaugeOption delegate atomic.Value // metric.Int64Gauge } var _ metric.Int64Gauge = (*siGauge)(nil) func (i *siGauge) setDelegate(m metric.Meter) { ctr, err := m.Int64Gauge(i.name, i.opts...) if err != nil { GetErrorHandler().Handle(err) return } i.delegate.Store(ctr) } func (i *siGauge) Record(ctx context.Context, x int64, opts ...metric.RecordOption) { if ctr := i.delegate.Load(); ctr != nil { ctr.(metric.Int64Gauge).Record(ctx, x, opts...) } } func (i *siGauge) Enabled(ctx context.Context) bool { if ctr := i.delegate.Load(); ctr != nil { return ctr.(metric.Int64Gauge).Enabled(ctx) } return false } ================================================ FILE: vendor/go.opentelemetry.io/otel/internal/global/internal_logging.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package global // import "go.opentelemetry.io/otel/internal/global" import ( "log" "os" "sync/atomic" "github.com/go-logr/logr" "github.com/go-logr/stdr" ) // globalLogger holds a reference to the [logr.Logger] used within // go.opentelemetry.io/otel. // // The default logger uses stdr which is backed by the standard `log.Logger` // interface. This logger will only show messages at the Error Level. var globalLogger = func() *atomic.Pointer[logr.Logger] { l := stdr.New(log.New(os.Stderr, "", log.LstdFlags|log.Lshortfile)) p := new(atomic.Pointer[logr.Logger]) p.Store(&l) return p }() // SetLogger sets the global Logger to l. // // To see Warn messages use a logger with `l.V(1).Enabled() == true` // To see Info messages use a logger with `l.V(4).Enabled() == true` // To see Debug messages use a logger with `l.V(8).Enabled() == true`. func SetLogger(l logr.Logger) { globalLogger.Store(&l) } // GetLogger returns the global logger. func GetLogger() logr.Logger { return *globalLogger.Load() } // Info prints messages about the general state of the API or SDK. // This should usually be less than 5 messages a minute. func Info(msg string, keysAndValues ...any) { GetLogger().V(4).Info(msg, keysAndValues...) } // Error prints messages about exceptional states of the API or SDK. func Error(err error, msg string, keysAndValues ...any) { GetLogger().Error(err, msg, keysAndValues...) } // Debug prints messages about all internal changes in the API or SDK. func Debug(msg string, keysAndValues ...any) { GetLogger().V(8).Info(msg, keysAndValues...) } // Warn prints messages about warnings in the API or SDK. // Not an error but is likely more important than an informational event. func Warn(msg string, keysAndValues ...any) { GetLogger().V(1).Info(msg, keysAndValues...) } ================================================ FILE: vendor/go.opentelemetry.io/otel/internal/global/meter.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package global // import "go.opentelemetry.io/otel/internal/global" import ( "container/list" "context" "reflect" "sync" "go.opentelemetry.io/otel/metric" "go.opentelemetry.io/otel/metric/embedded" ) // meterProvider is a placeholder for a configured SDK MeterProvider. // // All MeterProvider functionality is forwarded to a delegate once // configured. type meterProvider struct { embedded.MeterProvider mtx sync.Mutex meters map[il]*meter delegate metric.MeterProvider } // setDelegate configures p to delegate all MeterProvider functionality to // provider. // // All Meters provided prior to this function call are switched out to be // Meters provided by provider. All instruments and callbacks are recreated and // delegated. // // It is guaranteed by the caller that this happens only once. func (p *meterProvider) setDelegate(provider metric.MeterProvider) { p.mtx.Lock() defer p.mtx.Unlock() p.delegate = provider if len(p.meters) == 0 { return } for _, meter := range p.meters { meter.setDelegate(provider) } p.meters = nil } // Meter implements MeterProvider. func (p *meterProvider) Meter(name string, opts ...metric.MeterOption) metric.Meter { p.mtx.Lock() defer p.mtx.Unlock() if p.delegate != nil { return p.delegate.Meter(name, opts...) } // At this moment it is guaranteed that no sdk is installed, save the meter in the meters map. c := metric.NewMeterConfig(opts...) key := il{ name: name, version: c.InstrumentationVersion(), schema: c.SchemaURL(), attrs: c.InstrumentationAttributes(), } if p.meters == nil { p.meters = make(map[il]*meter) } if val, ok := p.meters[key]; ok { return val } t := &meter{name: name, opts: opts, instruments: make(map[instID]delegatedInstrument)} p.meters[key] = t return t } // meter is a placeholder for a metric.Meter. // // All Meter functionality is forwarded to a delegate once configured. // Otherwise, all functionality is forwarded to a NoopMeter. type meter struct { embedded.Meter name string opts []metric.MeterOption mtx sync.Mutex instruments map[instID]delegatedInstrument registry list.List delegate metric.Meter } type delegatedInstrument interface { setDelegate(metric.Meter) } // instID are the identifying properties of an instrument. type instID struct { // name is the name of the stream. name string // description is the description of the stream. description string // kind defines the functional group of the instrument. kind reflect.Type // unit is the unit of the stream. unit string } // setDelegate configures m to delegate all Meter functionality to Meters // created by provider. // // All subsequent calls to the Meter methods will be passed to the delegate. // // It is guaranteed by the caller that this happens only once. func (m *meter) setDelegate(provider metric.MeterProvider) { m.mtx.Lock() defer m.mtx.Unlock() meter := provider.Meter(m.name, m.opts...) m.delegate = meter for _, inst := range m.instruments { inst.setDelegate(meter) } var n *list.Element for e := m.registry.Front(); e != nil; e = n { r := e.Value.(*registration) r.setDelegate(meter) n = e.Next() m.registry.Remove(e) } m.instruments = nil m.registry.Init() } func (m *meter) Int64Counter(name string, options ...metric.Int64CounterOption) (metric.Int64Counter, error) { m.mtx.Lock() defer m.mtx.Unlock() if m.delegate != nil { return m.delegate.Int64Counter(name, options...) } cfg := metric.NewInt64CounterConfig(options...) id := instID{ name: name, kind: reflect.TypeFor[*siCounter](), description: cfg.Description(), unit: cfg.Unit(), } if f, ok := m.instruments[id]; ok { return f.(metric.Int64Counter), nil } i := &siCounter{name: name, opts: options} m.instruments[id] = i return i, nil } func (m *meter) Int64UpDownCounter( name string, options ...metric.Int64UpDownCounterOption, ) (metric.Int64UpDownCounter, error) { m.mtx.Lock() defer m.mtx.Unlock() if m.delegate != nil { return m.delegate.Int64UpDownCounter(name, options...) } cfg := metric.NewInt64UpDownCounterConfig(options...) id := instID{ name: name, kind: reflect.TypeFor[*siUpDownCounter](), description: cfg.Description(), unit: cfg.Unit(), } if f, ok := m.instruments[id]; ok { return f.(metric.Int64UpDownCounter), nil } i := &siUpDownCounter{name: name, opts: options} m.instruments[id] = i return i, nil } func (m *meter) Int64Histogram(name string, options ...metric.Int64HistogramOption) (metric.Int64Histogram, error) { m.mtx.Lock() defer m.mtx.Unlock() if m.delegate != nil { return m.delegate.Int64Histogram(name, options...) } cfg := metric.NewInt64HistogramConfig(options...) id := instID{ name: name, kind: reflect.TypeFor[*siHistogram](), description: cfg.Description(), unit: cfg.Unit(), } if f, ok := m.instruments[id]; ok { return f.(metric.Int64Histogram), nil } i := &siHistogram{name: name, opts: options} m.instruments[id] = i return i, nil } func (m *meter) Int64Gauge(name string, options ...metric.Int64GaugeOption) (metric.Int64Gauge, error) { m.mtx.Lock() defer m.mtx.Unlock() if m.delegate != nil { return m.delegate.Int64Gauge(name, options...) } cfg := metric.NewInt64GaugeConfig(options...) id := instID{ name: name, kind: reflect.TypeFor[*siGauge](), description: cfg.Description(), unit: cfg.Unit(), } if f, ok := m.instruments[id]; ok { return f.(metric.Int64Gauge), nil } i := &siGauge{name: name, opts: options} m.instruments[id] = i return i, nil } func (m *meter) Int64ObservableCounter( name string, options ...metric.Int64ObservableCounterOption, ) (metric.Int64ObservableCounter, error) { m.mtx.Lock() defer m.mtx.Unlock() if m.delegate != nil { return m.delegate.Int64ObservableCounter(name, options...) } cfg := metric.NewInt64ObservableCounterConfig(options...) id := instID{ name: name, kind: reflect.TypeFor[*aiCounter](), description: cfg.Description(), unit: cfg.Unit(), } if f, ok := m.instruments[id]; ok { return f.(metric.Int64ObservableCounter), nil } i := &aiCounter{name: name, opts: options} m.instruments[id] = i return i, nil } func (m *meter) Int64ObservableUpDownCounter( name string, options ...metric.Int64ObservableUpDownCounterOption, ) (metric.Int64ObservableUpDownCounter, error) { m.mtx.Lock() defer m.mtx.Unlock() if m.delegate != nil { return m.delegate.Int64ObservableUpDownCounter(name, options...) } cfg := metric.NewInt64ObservableUpDownCounterConfig(options...) id := instID{ name: name, kind: reflect.TypeFor[*aiUpDownCounter](), description: cfg.Description(), unit: cfg.Unit(), } if f, ok := m.instruments[id]; ok { return f.(metric.Int64ObservableUpDownCounter), nil } i := &aiUpDownCounter{name: name, opts: options} m.instruments[id] = i return i, nil } func (m *meter) Int64ObservableGauge( name string, options ...metric.Int64ObservableGaugeOption, ) (metric.Int64ObservableGauge, error) { m.mtx.Lock() defer m.mtx.Unlock() if m.delegate != nil { return m.delegate.Int64ObservableGauge(name, options...) } cfg := metric.NewInt64ObservableGaugeConfig(options...) id := instID{ name: name, kind: reflect.TypeFor[*aiGauge](), description: cfg.Description(), unit: cfg.Unit(), } if f, ok := m.instruments[id]; ok { return f.(metric.Int64ObservableGauge), nil } i := &aiGauge{name: name, opts: options} m.instruments[id] = i return i, nil } func (m *meter) Float64Counter(name string, options ...metric.Float64CounterOption) (metric.Float64Counter, error) { m.mtx.Lock() defer m.mtx.Unlock() if m.delegate != nil { return m.delegate.Float64Counter(name, options...) } cfg := metric.NewFloat64CounterConfig(options...) id := instID{ name: name, kind: reflect.TypeFor[*sfCounter](), description: cfg.Description(), unit: cfg.Unit(), } if f, ok := m.instruments[id]; ok { return f.(metric.Float64Counter), nil } i := &sfCounter{name: name, opts: options} m.instruments[id] = i return i, nil } func (m *meter) Float64UpDownCounter( name string, options ...metric.Float64UpDownCounterOption, ) (metric.Float64UpDownCounter, error) { m.mtx.Lock() defer m.mtx.Unlock() if m.delegate != nil { return m.delegate.Float64UpDownCounter(name, options...) } cfg := metric.NewFloat64UpDownCounterConfig(options...) id := instID{ name: name, kind: reflect.TypeFor[*sfUpDownCounter](), description: cfg.Description(), unit: cfg.Unit(), } if f, ok := m.instruments[id]; ok { return f.(metric.Float64UpDownCounter), nil } i := &sfUpDownCounter{name: name, opts: options} m.instruments[id] = i return i, nil } func (m *meter) Float64Histogram( name string, options ...metric.Float64HistogramOption, ) (metric.Float64Histogram, error) { m.mtx.Lock() defer m.mtx.Unlock() if m.delegate != nil { return m.delegate.Float64Histogram(name, options...) } cfg := metric.NewFloat64HistogramConfig(options...) id := instID{ name: name, kind: reflect.TypeFor[*sfHistogram](), description: cfg.Description(), unit: cfg.Unit(), } if f, ok := m.instruments[id]; ok { return f.(metric.Float64Histogram), nil } i := &sfHistogram{name: name, opts: options} m.instruments[id] = i return i, nil } func (m *meter) Float64Gauge(name string, options ...metric.Float64GaugeOption) (metric.Float64Gauge, error) { m.mtx.Lock() defer m.mtx.Unlock() if m.delegate != nil { return m.delegate.Float64Gauge(name, options...) } cfg := metric.NewFloat64GaugeConfig(options...) id := instID{ name: name, kind: reflect.TypeFor[*sfGauge](), description: cfg.Description(), unit: cfg.Unit(), } if f, ok := m.instruments[id]; ok { return f.(metric.Float64Gauge), nil } i := &sfGauge{name: name, opts: options} m.instruments[id] = i return i, nil } func (m *meter) Float64ObservableCounter( name string, options ...metric.Float64ObservableCounterOption, ) (metric.Float64ObservableCounter, error) { m.mtx.Lock() defer m.mtx.Unlock() if m.delegate != nil { return m.delegate.Float64ObservableCounter(name, options...) } cfg := metric.NewFloat64ObservableCounterConfig(options...) id := instID{ name: name, kind: reflect.TypeFor[*afCounter](), description: cfg.Description(), unit: cfg.Unit(), } if f, ok := m.instruments[id]; ok { return f.(metric.Float64ObservableCounter), nil } i := &afCounter{name: name, opts: options} m.instruments[id] = i return i, nil } func (m *meter) Float64ObservableUpDownCounter( name string, options ...metric.Float64ObservableUpDownCounterOption, ) (metric.Float64ObservableUpDownCounter, error) { m.mtx.Lock() defer m.mtx.Unlock() if m.delegate != nil { return m.delegate.Float64ObservableUpDownCounter(name, options...) } cfg := metric.NewFloat64ObservableUpDownCounterConfig(options...) id := instID{ name: name, kind: reflect.TypeFor[*afUpDownCounter](), description: cfg.Description(), unit: cfg.Unit(), } if f, ok := m.instruments[id]; ok { return f.(metric.Float64ObservableUpDownCounter), nil } i := &afUpDownCounter{name: name, opts: options} m.instruments[id] = i return i, nil } func (m *meter) Float64ObservableGauge( name string, options ...metric.Float64ObservableGaugeOption, ) (metric.Float64ObservableGauge, error) { m.mtx.Lock() defer m.mtx.Unlock() if m.delegate != nil { return m.delegate.Float64ObservableGauge(name, options...) } cfg := metric.NewFloat64ObservableGaugeConfig(options...) id := instID{ name: name, kind: reflect.TypeFor[*afGauge](), description: cfg.Description(), unit: cfg.Unit(), } if f, ok := m.instruments[id]; ok { return f.(metric.Float64ObservableGauge), nil } i := &afGauge{name: name, opts: options} m.instruments[id] = i return i, nil } // RegisterCallback captures the function that will be called during Collect. func (m *meter) RegisterCallback(f metric.Callback, insts ...metric.Observable) (metric.Registration, error) { m.mtx.Lock() defer m.mtx.Unlock() if m.delegate != nil { return m.delegate.RegisterCallback(unwrapCallback(f), unwrapInstruments(insts)...) } reg := ®istration{instruments: insts, function: f} e := m.registry.PushBack(reg) reg.unreg = func() error { m.mtx.Lock() _ = m.registry.Remove(e) m.mtx.Unlock() return nil } return reg, nil } func unwrapInstruments(instruments []metric.Observable) []metric.Observable { out := make([]metric.Observable, 0, len(instruments)) for _, inst := range instruments { if in, ok := inst.(unwrapper); ok { out = append(out, in.unwrap()) } else { out = append(out, inst) } } return out } type registration struct { embedded.Registration instruments []metric.Observable function metric.Callback unreg func() error unregMu sync.Mutex } type unwrapObs struct { embedded.Observer obs metric.Observer } // unwrapFloat64Observable returns an expected metric.Float64Observable after // unwrapping the global object. func unwrapFloat64Observable(inst metric.Float64Observable) metric.Float64Observable { if unwrapped, ok := inst.(unwrapper); ok { if floatObs, ok := unwrapped.unwrap().(metric.Float64Observable); ok { // Note: if the unwrapped object does not // unwrap as an observable for either of the // predicates here, it means an internal bug in // this package. We avoid logging an error in // this case, because the SDK has to try its // own type conversion on the object. The SDK // will see this and be forced to respond with // its own error. // // This code uses a double-nested if statement // to avoid creating a branch that is // impossible to cover. inst = floatObs } } return inst } // unwrapInt64Observable returns an expected metric.Int64Observable after // unwrapping the global object. func unwrapInt64Observable(inst metric.Int64Observable) metric.Int64Observable { if unwrapped, ok := inst.(unwrapper); ok { if unint, ok := unwrapped.unwrap().(metric.Int64Observable); ok { // See the comment in unwrapFloat64Observable(). inst = unint } } return inst } func (uo *unwrapObs) ObserveFloat64(inst metric.Float64Observable, value float64, opts ...metric.ObserveOption) { uo.obs.ObserveFloat64(unwrapFloat64Observable(inst), value, opts...) } func (uo *unwrapObs) ObserveInt64(inst metric.Int64Observable, value int64, opts ...metric.ObserveOption) { uo.obs.ObserveInt64(unwrapInt64Observable(inst), value, opts...) } func unwrapCallback(f metric.Callback) metric.Callback { return func(ctx context.Context, obs metric.Observer) error { return f(ctx, &unwrapObs{obs: obs}) } } func (c *registration) setDelegate(m metric.Meter) { c.unregMu.Lock() defer c.unregMu.Unlock() if c.unreg == nil { // Unregister already called. return } reg, err := m.RegisterCallback(unwrapCallback(c.function), unwrapInstruments(c.instruments)...) if err != nil { GetErrorHandler().Handle(err) return } c.unreg = reg.Unregister } func (c *registration) Unregister() error { c.unregMu.Lock() defer c.unregMu.Unlock() if c.unreg == nil { // Unregister already called. return nil } var err error err, c.unreg = c.unreg(), nil return err } ================================================ FILE: vendor/go.opentelemetry.io/otel/internal/global/propagator.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package global // import "go.opentelemetry.io/otel/internal/global" import ( "context" "sync" "go.opentelemetry.io/otel/propagation" ) // textMapPropagator is a default TextMapPropagator that delegates calls to a // registered delegate if one is set, otherwise it defaults to delegating the // calls to a the default no-op propagation.TextMapPropagator. type textMapPropagator struct { mtx sync.Mutex once sync.Once delegate propagation.TextMapPropagator noop propagation.TextMapPropagator } // Compile-time guarantee that textMapPropagator implements the // propagation.TextMapPropagator interface. var _ propagation.TextMapPropagator = (*textMapPropagator)(nil) func newTextMapPropagator() *textMapPropagator { return &textMapPropagator{ noop: propagation.NewCompositeTextMapPropagator(), } } // SetDelegate sets a delegate propagation.TextMapPropagator that all calls are // forwarded to. Delegation can only be performed once, all subsequent calls // perform no delegation. func (p *textMapPropagator) SetDelegate(delegate propagation.TextMapPropagator) { if delegate == nil { return } p.mtx.Lock() p.once.Do(func() { p.delegate = delegate }) p.mtx.Unlock() } // effectiveDelegate returns the current delegate of p if one is set, // otherwise the default noop TextMapPropagator is returned. This method // can be called concurrently. func (p *textMapPropagator) effectiveDelegate() propagation.TextMapPropagator { p.mtx.Lock() defer p.mtx.Unlock() if p.delegate != nil { return p.delegate } return p.noop } // Inject set cross-cutting concerns from the Context into the carrier. func (p *textMapPropagator) Inject(ctx context.Context, carrier propagation.TextMapCarrier) { p.effectiveDelegate().Inject(ctx, carrier) } // Extract reads cross-cutting concerns from the carrier into a Context. func (p *textMapPropagator) Extract(ctx context.Context, carrier propagation.TextMapCarrier) context.Context { return p.effectiveDelegate().Extract(ctx, carrier) } // Fields returns the keys whose values are set with Inject. func (p *textMapPropagator) Fields() []string { return p.effectiveDelegate().Fields() } ================================================ FILE: vendor/go.opentelemetry.io/otel/internal/global/state.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package global // import "go.opentelemetry.io/otel/internal/global" import ( "errors" "sync" "sync/atomic" "go.opentelemetry.io/otel/metric" "go.opentelemetry.io/otel/propagation" "go.opentelemetry.io/otel/trace" ) type ( errorHandlerHolder struct { eh ErrorHandler } tracerProviderHolder struct { tp trace.TracerProvider } propagatorsHolder struct { tm propagation.TextMapPropagator } meterProviderHolder struct { mp metric.MeterProvider } ) var ( globalErrorHandler = defaultErrorHandler() globalTracer = defaultTracerValue() globalPropagators = defaultPropagatorsValue() globalMeterProvider = defaultMeterProvider() delegateErrorHandlerOnce sync.Once delegateTraceOnce sync.Once delegateTextMapPropagatorOnce sync.Once delegateMeterOnce sync.Once ) // GetErrorHandler returns the global ErrorHandler instance. // // The default ErrorHandler instance returned will log all errors to STDERR // until an override ErrorHandler is set with SetErrorHandler. All // ErrorHandler returned prior to this will automatically forward errors to // the set instance instead of logging. // // Subsequent calls to SetErrorHandler after the first will not forward errors // to the new ErrorHandler for prior returned instances. func GetErrorHandler() ErrorHandler { return globalErrorHandler.Load().(errorHandlerHolder).eh } // SetErrorHandler sets the global ErrorHandler to h. // // The first time this is called all ErrorHandler previously returned from // GetErrorHandler will send errors to h instead of the default logging // ErrorHandler. Subsequent calls will set the global ErrorHandler, but not // delegate errors to h. func SetErrorHandler(h ErrorHandler) { current := GetErrorHandler() if _, cOk := current.(*ErrDelegator); cOk { if _, ehOk := h.(*ErrDelegator); ehOk && current == h { // Do not assign to the delegate of the default ErrDelegator to be // itself. Error( errors.New("no ErrorHandler delegate configured"), "ErrorHandler remains its current value.", ) return } } delegateErrorHandlerOnce.Do(func() { if def, ok := current.(*ErrDelegator); ok { def.setDelegate(h) } }) globalErrorHandler.Store(errorHandlerHolder{eh: h}) } // TracerProvider is the internal implementation for global.TracerProvider. func TracerProvider() trace.TracerProvider { return globalTracer.Load().(tracerProviderHolder).tp } // SetTracerProvider is the internal implementation for global.SetTracerProvider. func SetTracerProvider(tp trace.TracerProvider) { current := TracerProvider() if _, cOk := current.(*tracerProvider); cOk { if _, tpOk := tp.(*tracerProvider); tpOk && current == tp { // Do not assign the default delegating TracerProvider to delegate // to itself. Error( errors.New("no delegate configured in tracer provider"), "Setting tracer provider to its current value. No delegate will be configured", ) return } } delegateTraceOnce.Do(func() { if def, ok := current.(*tracerProvider); ok { def.setDelegate(tp) } }) globalTracer.Store(tracerProviderHolder{tp: tp}) } // TextMapPropagator is the internal implementation for global.TextMapPropagator. func TextMapPropagator() propagation.TextMapPropagator { return globalPropagators.Load().(propagatorsHolder).tm } // SetTextMapPropagator is the internal implementation for global.SetTextMapPropagator. func SetTextMapPropagator(p propagation.TextMapPropagator) { current := TextMapPropagator() if _, cOk := current.(*textMapPropagator); cOk { if _, pOk := p.(*textMapPropagator); pOk && current == p { // Do not assign the default delegating TextMapPropagator to // delegate to itself. Error( errors.New("no delegate configured in text map propagator"), "Setting text map propagator to its current value. No delegate will be configured", ) return } } // For the textMapPropagator already returned by TextMapPropagator // delegate to p. delegateTextMapPropagatorOnce.Do(func() { if def, ok := current.(*textMapPropagator); ok { def.SetDelegate(p) } }) // Return p when subsequent calls to TextMapPropagator are made. globalPropagators.Store(propagatorsHolder{tm: p}) } // MeterProvider is the internal implementation for global.MeterProvider. func MeterProvider() metric.MeterProvider { return globalMeterProvider.Load().(meterProviderHolder).mp } // SetMeterProvider is the internal implementation for global.SetMeterProvider. func SetMeterProvider(mp metric.MeterProvider) { current := MeterProvider() if _, cOk := current.(*meterProvider); cOk { if _, mpOk := mp.(*meterProvider); mpOk && current == mp { // Do not assign the default delegating MeterProvider to delegate // to itself. Error( errors.New("no delegate configured in meter provider"), "Setting meter provider to its current value. No delegate will be configured", ) return } } delegateMeterOnce.Do(func() { if def, ok := current.(*meterProvider); ok { def.setDelegate(mp) } }) globalMeterProvider.Store(meterProviderHolder{mp: mp}) } func defaultErrorHandler() *atomic.Value { v := &atomic.Value{} v.Store(errorHandlerHolder{eh: &ErrDelegator{}}) return v } func defaultTracerValue() *atomic.Value { v := &atomic.Value{} v.Store(tracerProviderHolder{tp: &tracerProvider{}}) return v } func defaultPropagatorsValue() *atomic.Value { v := &atomic.Value{} v.Store(propagatorsHolder{tm: newTextMapPropagator()}) return v } func defaultMeterProvider() *atomic.Value { v := &atomic.Value{} v.Store(meterProviderHolder{mp: &meterProvider{}}) return v } ================================================ FILE: vendor/go.opentelemetry.io/otel/internal/global/trace.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package global // import "go.opentelemetry.io/otel/internal/global" /* This file contains the forwarding implementation of the TracerProvider used as the default global instance. Prior to initialization of an SDK, Tracers returned by the global TracerProvider will provide no-op functionality. This means that all Span created prior to initialization are no-op Spans. Once an SDK has been initialized, all provided no-op Tracers are swapped for Tracers provided by the SDK defined TracerProvider. However, any Span started prior to this initialization does not change its behavior. Meaning, the Span remains a no-op Span. The implementation to track and swap Tracers locks all new Tracer creation until the swap is complete. This assumes that this operation is not performance-critical. If that assumption is incorrect, be sure to configure an SDK prior to any Tracer creation. */ import ( "context" "sync" "sync/atomic" "go.opentelemetry.io/auto/sdk" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" "go.opentelemetry.io/otel/trace" "go.opentelemetry.io/otel/trace/embedded" ) // tracerProvider is a placeholder for a configured SDK TracerProvider. // // All TracerProvider functionality is forwarded to a delegate once // configured. type tracerProvider struct { embedded.TracerProvider mtx sync.Mutex tracers map[il]*tracer delegate trace.TracerProvider } // Compile-time guarantee that tracerProvider implements the TracerProvider // interface. var _ trace.TracerProvider = &tracerProvider{} // setDelegate configures p to delegate all TracerProvider functionality to // provider. // // All Tracers provided prior to this function call are switched out to be // Tracers provided by provider. // // It is guaranteed by the caller that this happens only once. func (p *tracerProvider) setDelegate(provider trace.TracerProvider) { p.mtx.Lock() defer p.mtx.Unlock() p.delegate = provider if len(p.tracers) == 0 { return } for _, t := range p.tracers { t.setDelegate(provider) } p.tracers = nil } // Tracer implements TracerProvider. func (p *tracerProvider) Tracer(name string, opts ...trace.TracerOption) trace.Tracer { p.mtx.Lock() defer p.mtx.Unlock() if p.delegate != nil { return p.delegate.Tracer(name, opts...) } // At this moment it is guaranteed that no sdk is installed, save the tracer in the tracers map. c := trace.NewTracerConfig(opts...) key := il{ name: name, version: c.InstrumentationVersion(), schema: c.SchemaURL(), attrs: c.InstrumentationAttributes(), } if p.tracers == nil { p.tracers = make(map[il]*tracer) } if val, ok := p.tracers[key]; ok { return val } t := &tracer{name: name, opts: opts, provider: p} p.tracers[key] = t return t } type il struct { name string version string schema string attrs attribute.Set } // tracer is a placeholder for a trace.Tracer. // // All Tracer functionality is forwarded to a delegate once configured. // Otherwise, all functionality is forwarded to a NoopTracer. type tracer struct { embedded.Tracer name string opts []trace.TracerOption provider *tracerProvider delegate atomic.Value } // Compile-time guarantee that tracer implements the trace.Tracer interface. var _ trace.Tracer = &tracer{} // setDelegate configures t to delegate all Tracer functionality to Tracers // created by provider. // // All subsequent calls to the Tracer methods will be passed to the delegate. // // It is guaranteed by the caller that this happens only once. func (t *tracer) setDelegate(provider trace.TracerProvider) { t.delegate.Store(provider.Tracer(t.name, t.opts...)) } // Start implements trace.Tracer by forwarding the call to t.delegate if // set, otherwise it forwards the call to a NoopTracer. func (t *tracer) Start(ctx context.Context, name string, opts ...trace.SpanStartOption) (context.Context, trace.Span) { delegate := t.delegate.Load() if delegate != nil { return delegate.(trace.Tracer).Start(ctx, name, opts...) } return t.newSpan(ctx, autoInstEnabled, name, opts) } // autoInstEnabled determines if the auto-instrumentation SDK span is returned // from the tracer when not backed by a delegate and auto-instrumentation has // attached to this process. // // The auto-instrumentation is expected to overwrite this value to true when it // attaches. By default, this will point to false and mean a tracer will return // a nonRecordingSpan by default. var autoInstEnabled = new(bool) // newSpan is called by tracer.Start so auto-instrumentation can attach an eBPF // uprobe to this code. // // "noinline" pragma prevents the method from ever being inlined. // //go:noinline func (t *tracer) newSpan( ctx context.Context, autoSpan *bool, name string, opts []trace.SpanStartOption, ) (context.Context, trace.Span) { // autoInstEnabled is passed to newSpan via the autoSpan parameter. This is // so the auto-instrumentation can define a uprobe for (*t).newSpan and be // provided with the address of the bool autoInstEnabled points to. It // needs to be a parameter so that pointer can be reliably determined, it // should not be read from the global. if *autoSpan { tracer := sdk.TracerProvider().Tracer(t.name, t.opts...) return tracer.Start(ctx, name, opts...) } s := nonRecordingSpan{sc: trace.SpanContextFromContext(ctx), tracer: t} ctx = trace.ContextWithSpan(ctx, s) return ctx, s } // nonRecordingSpan is a minimal implementation of a Span that wraps a // SpanContext. It performs no operations other than to return the wrapped // SpanContext. type nonRecordingSpan struct { embedded.Span sc trace.SpanContext tracer *tracer } var _ trace.Span = nonRecordingSpan{} // SpanContext returns the wrapped SpanContext. func (s nonRecordingSpan) SpanContext() trace.SpanContext { return s.sc } // IsRecording always returns false. func (nonRecordingSpan) IsRecording() bool { return false } // SetStatus does nothing. func (nonRecordingSpan) SetStatus(codes.Code, string) {} // SetError does nothing. func (nonRecordingSpan) SetError(bool) {} // SetAttributes does nothing. func (nonRecordingSpan) SetAttributes(...attribute.KeyValue) {} // End does nothing. func (nonRecordingSpan) End(...trace.SpanEndOption) {} // RecordError does nothing. func (nonRecordingSpan) RecordError(error, ...trace.EventOption) {} // AddEvent does nothing. func (nonRecordingSpan) AddEvent(string, ...trace.EventOption) {} // AddLink does nothing. func (nonRecordingSpan) AddLink(trace.Link) {} // SetName does nothing. func (nonRecordingSpan) SetName(string) {} func (s nonRecordingSpan) TracerProvider() trace.TracerProvider { return s.tracer.provider } ================================================ FILE: vendor/go.opentelemetry.io/otel/internal_logging.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package otel // import "go.opentelemetry.io/otel" import ( "github.com/go-logr/logr" "go.opentelemetry.io/otel/internal/global" ) // SetLogger configures the logger used internally to opentelemetry. func SetLogger(logger logr.Logger) { global.SetLogger(logger) } ================================================ FILE: vendor/go.opentelemetry.io/otel/metric/LICENSE ================================================ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -------------------------------------------------------------------------------- Copyright 2009 The Go Authors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: vendor/go.opentelemetry.io/otel/metric/README.md ================================================ # Metric API [![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/metric)](https://pkg.go.dev/go.opentelemetry.io/otel/metric) ================================================ FILE: vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package metric // import "go.opentelemetry.io/otel/metric" import ( "context" "go.opentelemetry.io/otel/metric/embedded" ) // Float64Observable describes a set of instruments used asynchronously to // record float64 measurements once per collection cycle. Observations of // these instruments are only made within a callback. // // Warning: Methods may be added to this interface in minor releases. type Float64Observable interface { Observable float64Observable() } // Float64ObservableCounter is an instrument used to asynchronously record // increasing float64 measurements once per collection cycle. Observations are // only made within a callback for this instrument. The value observed is // assumed the to be the cumulative sum of the count. // // Warning: Methods may be added to this interface in minor releases. See // package documentation on API implementation for information on how to set // default behavior for // unimplemented methods. type Float64ObservableCounter interface { // Users of the interface can ignore this. This embedded type is only used // by implementations of this interface. See the "API Implementations" // section of the package documentation for more information. embedded.Float64ObservableCounter Float64Observable } // Float64ObservableCounterConfig contains options for asynchronous counter // instruments that record float64 values. type Float64ObservableCounterConfig struct { description string unit string callbacks []Float64Callback } // NewFloat64ObservableCounterConfig returns a new // [Float64ObservableCounterConfig] with all opts applied. func NewFloat64ObservableCounterConfig(opts ...Float64ObservableCounterOption) Float64ObservableCounterConfig { var config Float64ObservableCounterConfig for _, o := range opts { config = o.applyFloat64ObservableCounter(config) } return config } // Description returns the configured description. func (c Float64ObservableCounterConfig) Description() string { return c.description } // Unit returns the configured unit. func (c Float64ObservableCounterConfig) Unit() string { return c.unit } // Callbacks returns the configured callbacks. func (c Float64ObservableCounterConfig) Callbacks() []Float64Callback { return c.callbacks } // Float64ObservableCounterOption applies options to a // [Float64ObservableCounterConfig]. See [Float64ObservableOption] and // [InstrumentOption] for other options that can be used as a // Float64ObservableCounterOption. type Float64ObservableCounterOption interface { applyFloat64ObservableCounter(Float64ObservableCounterConfig) Float64ObservableCounterConfig } // Float64ObservableUpDownCounter is an instrument used to asynchronously // record float64 measurements once per collection cycle. Observations are only // made within a callback for this instrument. The value observed is assumed // the to be the cumulative sum of the count. // // Warning: Methods may be added to this interface in minor releases. See // package documentation on API implementation for information on how to set // default behavior for unimplemented methods. type Float64ObservableUpDownCounter interface { // Users of the interface can ignore this. This embedded type is only used // by implementations of this interface. See the "API Implementations" // section of the package documentation for more information. embedded.Float64ObservableUpDownCounter Float64Observable } // Float64ObservableUpDownCounterConfig contains options for asynchronous // counter instruments that record float64 values. type Float64ObservableUpDownCounterConfig struct { description string unit string callbacks []Float64Callback } // NewFloat64ObservableUpDownCounterConfig returns a new // [Float64ObservableUpDownCounterConfig] with all opts applied. func NewFloat64ObservableUpDownCounterConfig( opts ...Float64ObservableUpDownCounterOption, ) Float64ObservableUpDownCounterConfig { var config Float64ObservableUpDownCounterConfig for _, o := range opts { config = o.applyFloat64ObservableUpDownCounter(config) } return config } // Description returns the configured description. func (c Float64ObservableUpDownCounterConfig) Description() string { return c.description } // Unit returns the configured unit. func (c Float64ObservableUpDownCounterConfig) Unit() string { return c.unit } // Callbacks returns the configured callbacks. func (c Float64ObservableUpDownCounterConfig) Callbacks() []Float64Callback { return c.callbacks } // Float64ObservableUpDownCounterOption applies options to a // [Float64ObservableUpDownCounterConfig]. See [Float64ObservableOption] and // [InstrumentOption] for other options that can be used as a // Float64ObservableUpDownCounterOption. type Float64ObservableUpDownCounterOption interface { applyFloat64ObservableUpDownCounter(Float64ObservableUpDownCounterConfig) Float64ObservableUpDownCounterConfig } // Float64ObservableGauge is an instrument used to asynchronously record // instantaneous float64 measurements once per collection cycle. Observations // are only made within a callback for this instrument. // // Warning: Methods may be added to this interface in minor releases. See // package documentation on API implementation for information on how to set // default behavior for unimplemented methods. type Float64ObservableGauge interface { // Users of the interface can ignore this. This embedded type is only used // by implementations of this interface. See the "API Implementations" // section of the package documentation for more information. embedded.Float64ObservableGauge Float64Observable } // Float64ObservableGaugeConfig contains options for asynchronous counter // instruments that record float64 values. type Float64ObservableGaugeConfig struct { description string unit string callbacks []Float64Callback } // NewFloat64ObservableGaugeConfig returns a new [Float64ObservableGaugeConfig] // with all opts applied. func NewFloat64ObservableGaugeConfig(opts ...Float64ObservableGaugeOption) Float64ObservableGaugeConfig { var config Float64ObservableGaugeConfig for _, o := range opts { config = o.applyFloat64ObservableGauge(config) } return config } // Description returns the configured description. func (c Float64ObservableGaugeConfig) Description() string { return c.description } // Unit returns the configured unit. func (c Float64ObservableGaugeConfig) Unit() string { return c.unit } // Callbacks returns the configured callbacks. func (c Float64ObservableGaugeConfig) Callbacks() []Float64Callback { return c.callbacks } // Float64ObservableGaugeOption applies options to a // [Float64ObservableGaugeConfig]. See [Float64ObservableOption] and // [InstrumentOption] for other options that can be used as a // Float64ObservableGaugeOption. type Float64ObservableGaugeOption interface { applyFloat64ObservableGauge(Float64ObservableGaugeConfig) Float64ObservableGaugeConfig } // Float64Observer is a recorder of float64 measurements. // // Warning: Methods may be added to this interface in minor releases. See // package documentation on API implementation for information on how to set // default behavior for unimplemented methods. type Float64Observer interface { // Users of the interface can ignore this. This embedded type is only used // by implementations of this interface. See the "API Implementations" // section of the package documentation for more information. embedded.Float64Observer // Observe records the float64 value. // // Use the WithAttributeSet (or, if performance is not a concern, // the WithAttributes) option to include measurement attributes. Observe(value float64, options ...ObserveOption) } // Float64Callback is a function registered with a Meter that makes // observations for a Float64Observable instrument it is registered with. // Calls to the Float64Observer record measurement values for the // Float64Observable. // // The function needs to complete in a finite amount of time and the deadline // of the passed context is expected to be honored. // // The function needs to make unique observations across all registered // Float64Callbacks. Meaning, it should not report measurements with the same // attributes as another Float64Callbacks also registered for the same // instrument. // // The function needs to be reentrant and concurrent safe. // // Note that Go's mutexes are not reentrant, and locking a mutex takes // an indefinite amount of time. It is therefore advised to avoid // using mutexes inside callbacks. type Float64Callback func(context.Context, Float64Observer) error // Float64ObservableOption applies options to float64 Observer instruments. type Float64ObservableOption interface { Float64ObservableCounterOption Float64ObservableUpDownCounterOption Float64ObservableGaugeOption } type float64CallbackOpt struct { cback Float64Callback } func (o float64CallbackOpt) applyFloat64ObservableCounter( cfg Float64ObservableCounterConfig, ) Float64ObservableCounterConfig { cfg.callbacks = append(cfg.callbacks, o.cback) return cfg } func (o float64CallbackOpt) applyFloat64ObservableUpDownCounter( cfg Float64ObservableUpDownCounterConfig, ) Float64ObservableUpDownCounterConfig { cfg.callbacks = append(cfg.callbacks, o.cback) return cfg } func (o float64CallbackOpt) applyFloat64ObservableGauge(cfg Float64ObservableGaugeConfig) Float64ObservableGaugeConfig { cfg.callbacks = append(cfg.callbacks, o.cback) return cfg } // WithFloat64Callback adds callback to be called for an instrument. func WithFloat64Callback(callback Float64Callback) Float64ObservableOption { return float64CallbackOpt{callback} } ================================================ FILE: vendor/go.opentelemetry.io/otel/metric/asyncint64.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package metric // import "go.opentelemetry.io/otel/metric" import ( "context" "go.opentelemetry.io/otel/metric/embedded" ) // Int64Observable describes a set of instruments used asynchronously to record // int64 measurements once per collection cycle. Observations of these // instruments are only made within a callback. // // Warning: Methods may be added to this interface in minor releases. type Int64Observable interface { Observable int64Observable() } // Int64ObservableCounter is an instrument used to asynchronously record // increasing int64 measurements once per collection cycle. Observations are // only made within a callback for this instrument. The value observed is // assumed the to be the cumulative sum of the count. // // Warning: Methods may be added to this interface in minor releases. See // package documentation on API implementation for information on how to set // default behavior for unimplemented methods. type Int64ObservableCounter interface { // Users of the interface can ignore this. This embedded type is only used // by implementations of this interface. See the "API Implementations" // section of the package documentation for more information. embedded.Int64ObservableCounter Int64Observable } // Int64ObservableCounterConfig contains options for asynchronous counter // instruments that record int64 values. type Int64ObservableCounterConfig struct { description string unit string callbacks []Int64Callback } // NewInt64ObservableCounterConfig returns a new [Int64ObservableCounterConfig] // with all opts applied. func NewInt64ObservableCounterConfig(opts ...Int64ObservableCounterOption) Int64ObservableCounterConfig { var config Int64ObservableCounterConfig for _, o := range opts { config = o.applyInt64ObservableCounter(config) } return config } // Description returns the configured description. func (c Int64ObservableCounterConfig) Description() string { return c.description } // Unit returns the configured unit. func (c Int64ObservableCounterConfig) Unit() string { return c.unit } // Callbacks returns the configured callbacks. func (c Int64ObservableCounterConfig) Callbacks() []Int64Callback { return c.callbacks } // Int64ObservableCounterOption applies options to a // [Int64ObservableCounterConfig]. See [Int64ObservableOption] and // [InstrumentOption] for other options that can be used as an // Int64ObservableCounterOption. type Int64ObservableCounterOption interface { applyInt64ObservableCounter(Int64ObservableCounterConfig) Int64ObservableCounterConfig } // Int64ObservableUpDownCounter is an instrument used to asynchronously record // int64 measurements once per collection cycle. Observations are only made // within a callback for this instrument. The value observed is assumed the to // be the cumulative sum of the count. // // Warning: Methods may be added to this interface in minor releases. See // package documentation on API implementation for information on how to set // default behavior for unimplemented methods. type Int64ObservableUpDownCounter interface { // Users of the interface can ignore this. This embedded type is only used // by implementations of this interface. See the "API Implementations" // section of the package documentation for more information. embedded.Int64ObservableUpDownCounter Int64Observable } // Int64ObservableUpDownCounterConfig contains options for asynchronous counter // instruments that record int64 values. type Int64ObservableUpDownCounterConfig struct { description string unit string callbacks []Int64Callback } // NewInt64ObservableUpDownCounterConfig returns a new // [Int64ObservableUpDownCounterConfig] with all opts applied. func NewInt64ObservableUpDownCounterConfig( opts ...Int64ObservableUpDownCounterOption, ) Int64ObservableUpDownCounterConfig { var config Int64ObservableUpDownCounterConfig for _, o := range opts { config = o.applyInt64ObservableUpDownCounter(config) } return config } // Description returns the configured description. func (c Int64ObservableUpDownCounterConfig) Description() string { return c.description } // Unit returns the configured unit. func (c Int64ObservableUpDownCounterConfig) Unit() string { return c.unit } // Callbacks returns the configured callbacks. func (c Int64ObservableUpDownCounterConfig) Callbacks() []Int64Callback { return c.callbacks } // Int64ObservableUpDownCounterOption applies options to a // [Int64ObservableUpDownCounterConfig]. See [Int64ObservableOption] and // [InstrumentOption] for other options that can be used as an // Int64ObservableUpDownCounterOption. type Int64ObservableUpDownCounterOption interface { applyInt64ObservableUpDownCounter(Int64ObservableUpDownCounterConfig) Int64ObservableUpDownCounterConfig } // Int64ObservableGauge is an instrument used to asynchronously record // instantaneous int64 measurements once per collection cycle. Observations are // only made within a callback for this instrument. // // Warning: Methods may be added to this interface in minor releases. See // package documentation on API implementation for information on how to set // default behavior for unimplemented methods. type Int64ObservableGauge interface { // Users of the interface can ignore this. This embedded type is only used // by implementations of this interface. See the "API Implementations" // section of the package documentation for more information. embedded.Int64ObservableGauge Int64Observable } // Int64ObservableGaugeConfig contains options for asynchronous counter // instruments that record int64 values. type Int64ObservableGaugeConfig struct { description string unit string callbacks []Int64Callback } // NewInt64ObservableGaugeConfig returns a new [Int64ObservableGaugeConfig] // with all opts applied. func NewInt64ObservableGaugeConfig(opts ...Int64ObservableGaugeOption) Int64ObservableGaugeConfig { var config Int64ObservableGaugeConfig for _, o := range opts { config = o.applyInt64ObservableGauge(config) } return config } // Description returns the configured description. func (c Int64ObservableGaugeConfig) Description() string { return c.description } // Unit returns the configured unit. func (c Int64ObservableGaugeConfig) Unit() string { return c.unit } // Callbacks returns the configured callbacks. func (c Int64ObservableGaugeConfig) Callbacks() []Int64Callback { return c.callbacks } // Int64ObservableGaugeOption applies options to a // [Int64ObservableGaugeConfig]. See [Int64ObservableOption] and // [InstrumentOption] for other options that can be used as an // Int64ObservableGaugeOption. type Int64ObservableGaugeOption interface { applyInt64ObservableGauge(Int64ObservableGaugeConfig) Int64ObservableGaugeConfig } // Int64Observer is a recorder of int64 measurements. // // Warning: Methods may be added to this interface in minor releases. See // package documentation on API implementation for information on how to set // default behavior for unimplemented methods. type Int64Observer interface { // Users of the interface can ignore this. This embedded type is only used // by implementations of this interface. See the "API Implementations" // section of the package documentation for more information. embedded.Int64Observer // Observe records the int64 value. // // Use the WithAttributeSet (or, if performance is not a concern, // the WithAttributes) option to include measurement attributes. Observe(value int64, options ...ObserveOption) } // Int64Callback is a function registered with a Meter that makes observations // for an Int64Observable instrument it is registered with. Calls to the // Int64Observer record measurement values for the Int64Observable. // // The function needs to complete in a finite amount of time and the deadline // of the passed context is expected to be honored. // // The function needs to make unique observations across all registered // Int64Callbacks. Meaning, it should not report measurements with the same // attributes as another Int64Callbacks also registered for the same // instrument. // // The function needs to be reentrant and concurrent safe. // // Note that Go's mutexes are not reentrant, and locking a mutex takes // an indefinite amount of time. It is therefore advised to avoid // using mutexes inside callbacks. type Int64Callback func(context.Context, Int64Observer) error // Int64ObservableOption applies options to int64 Observer instruments. type Int64ObservableOption interface { Int64ObservableCounterOption Int64ObservableUpDownCounterOption Int64ObservableGaugeOption } type int64CallbackOpt struct { cback Int64Callback } func (o int64CallbackOpt) applyInt64ObservableCounter(cfg Int64ObservableCounterConfig) Int64ObservableCounterConfig { cfg.callbacks = append(cfg.callbacks, o.cback) return cfg } func (o int64CallbackOpt) applyInt64ObservableUpDownCounter( cfg Int64ObservableUpDownCounterConfig, ) Int64ObservableUpDownCounterConfig { cfg.callbacks = append(cfg.callbacks, o.cback) return cfg } func (o int64CallbackOpt) applyInt64ObservableGauge(cfg Int64ObservableGaugeConfig) Int64ObservableGaugeConfig { cfg.callbacks = append(cfg.callbacks, o.cback) return cfg } // WithInt64Callback adds callback to be called for an instrument. func WithInt64Callback(callback Int64Callback) Int64ObservableOption { return int64CallbackOpt{callback} } ================================================ FILE: vendor/go.opentelemetry.io/otel/metric/config.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package metric // import "go.opentelemetry.io/otel/metric" import ( "slices" "go.opentelemetry.io/otel/attribute" ) // MeterConfig contains options for Meters. type MeterConfig struct { instrumentationVersion string schemaURL string attrs attribute.Set // Ensure forward compatibility by explicitly making this not comparable. noCmp [0]func() //nolint: unused // This is indeed used. } // InstrumentationVersion returns the version of the library providing // instrumentation. func (cfg MeterConfig) InstrumentationVersion() string { return cfg.instrumentationVersion } // InstrumentationAttributes returns the attributes associated with the library // providing instrumentation. func (cfg MeterConfig) InstrumentationAttributes() attribute.Set { return cfg.attrs } // SchemaURL is the schema_url of the library providing instrumentation. func (cfg MeterConfig) SchemaURL() string { return cfg.schemaURL } // MeterOption is an interface for applying Meter options. type MeterOption interface { // applyMeter is used to set a MeterOption value of a MeterConfig. applyMeter(MeterConfig) MeterConfig } // NewMeterConfig creates a new MeterConfig and applies // all the given options. func NewMeterConfig(opts ...MeterOption) MeterConfig { var config MeterConfig for _, o := range opts { config = o.applyMeter(config) } return config } type meterOptionFunc func(MeterConfig) MeterConfig func (fn meterOptionFunc) applyMeter(cfg MeterConfig) MeterConfig { return fn(cfg) } // WithInstrumentationVersion sets the instrumentation version. func WithInstrumentationVersion(version string) MeterOption { return meterOptionFunc(func(config MeterConfig) MeterConfig { config.instrumentationVersion = version return config }) } // WithInstrumentationAttributes adds the instrumentation attributes. // // This is equivalent to calling [WithInstrumentationAttributeSet] with an // [attribute.Set] created from a clone of the passed attributes. // [WithInstrumentationAttributeSet] is recommended for more control. // // If multiple [WithInstrumentationAttributes] or [WithInstrumentationAttributeSet] // options are passed, the attributes will be merged together in the order // they are passed. Attributes with duplicate keys will use the last value passed. func WithInstrumentationAttributes(attr ...attribute.KeyValue) MeterOption { set := attribute.NewSet(slices.Clone(attr)...) return WithInstrumentationAttributeSet(set) } // WithInstrumentationAttributeSet adds the instrumentation attributes. // // If multiple [WithInstrumentationAttributes] or [WithInstrumentationAttributeSet] // options are passed, the attributes will be merged together in the order // they are passed. Attributes with duplicate keys will use the last value passed. func WithInstrumentationAttributeSet(set attribute.Set) MeterOption { if set.Len() == 0 { return meterOptionFunc(func(config MeterConfig) MeterConfig { return config }) } return meterOptionFunc(func(config MeterConfig) MeterConfig { if config.attrs.Len() == 0 { config.attrs = set } else { config.attrs = mergeSets(config.attrs, set) } return config }) } // WithSchemaURL sets the schema URL. func WithSchemaURL(schemaURL string) MeterOption { return meterOptionFunc(func(config MeterConfig) MeterConfig { config.schemaURL = schemaURL return config }) } ================================================ FILE: vendor/go.opentelemetry.io/otel/metric/doc.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 /* Package metric provides the OpenTelemetry API used to measure metrics about source code operation. This API is separate from its implementation so the instrumentation built from it is reusable. See [go.opentelemetry.io/otel/sdk/metric] for the official OpenTelemetry implementation of this API. All measurements made with this package are made via instruments. These instruments are created by a [Meter] which itself is created by a [MeterProvider]. Applications need to accept a [MeterProvider] implementation as a starting point when instrumenting. This can be done directly, or by using the OpenTelemetry global MeterProvider via [GetMeterProvider]. Using an appropriately named [Meter] from the accepted [MeterProvider], instrumentation can then be built from the [Meter]'s instruments. # Instruments Each instrument is designed to make measurements of a particular type. Broadly, all instruments fall into two overlapping logical categories: asynchronous or synchronous, and int64 or float64. All synchronous instruments ([Int64Counter], [Int64UpDownCounter], [Int64Histogram], [Float64Counter], [Float64UpDownCounter], and [Float64Histogram]) are used to measure the operation and performance of source code during the source code execution. These instruments only make measurements when the source code they instrument is run. All asynchronous instruments ([Int64ObservableCounter], [Int64ObservableUpDownCounter], [Int64ObservableGauge], [Float64ObservableCounter], [Float64ObservableUpDownCounter], and [Float64ObservableGauge]) are used to measure metrics outside of the execution of source code. They are said to make "observations" via a callback function called once every measurement collection cycle. Each instrument is also grouped by the value type it measures. Either int64 or float64. The value being measured will dictate which instrument in these categories to use. Outside of these two broad categories, instruments are described by the function they are designed to serve. All Counters ([Int64Counter], [Float64Counter], [Int64ObservableCounter], and [Float64ObservableCounter]) are designed to measure values that never decrease in value, but instead only incrementally increase in value. UpDownCounters ([Int64UpDownCounter], [Float64UpDownCounter], [Int64ObservableUpDownCounter], and [Float64ObservableUpDownCounter]) on the other hand, are designed to measure values that can increase and decrease. When more information needs to be conveyed about all the synchronous measurements made during a collection cycle, a Histogram ([Int64Histogram] and [Float64Histogram]) should be used. Finally, when just the most recent measurement needs to be conveyed about an asynchronous measurement, a Gauge ([Int64ObservableGauge] and [Float64ObservableGauge]) should be used. See the [OpenTelemetry documentation] for more information about instruments and their intended use. # Instrument Name OpenTelemetry defines an [instrument name syntax] that restricts what instrument names are allowed. Instrument names should ... - Not be empty. - Have an alphabetic character as their first letter. - Have any letter after the first be an alphanumeric character, ‘_’, ‘.’, ‘-’, or ‘/’. - Have a maximum length of 255 letters. To ensure compatibility with observability platforms, all instruments created need to conform to this syntax. Not all implementations of the API will validate these names, it is the callers responsibility to ensure compliance. # Measurements Measurements are made by recording values and information about the values with an instrument. How these measurements are recorded depends on the instrument. Measurements for synchronous instruments ([Int64Counter], [Int64UpDownCounter], [Int64Histogram], [Float64Counter], [Float64UpDownCounter], and [Float64Histogram]) are recorded using the instrument methods directly. All counter instruments have an Add method that is used to measure an increment value, and all histogram instruments have a Record method to measure a data point. Asynchronous instruments ([Int64ObservableCounter], [Int64ObservableUpDownCounter], [Int64ObservableGauge], [Float64ObservableCounter], [Float64ObservableUpDownCounter], and [Float64ObservableGauge]) record measurements within a callback function. The callback is registered with the Meter which ensures the callback is called once per collection cycle. A callback can be registered two ways: during the instrument's creation using an option, or later using the RegisterCallback method of the [Meter] that created the instrument. If the following criteria are met, an option ([WithInt64Callback] or [WithFloat64Callback]) can be used during the asynchronous instrument's creation to register a callback ([Int64Callback] or [Float64Callback], respectively): - The measurement process is known when the instrument is created - Only that instrument will make a measurement within the callback - The callback never needs to be unregistered If the criteria are not met, use the RegisterCallback method of the [Meter] that created the instrument to register a [Callback]. # API Implementations This package does not conform to the standard Go versioning policy, all of its interfaces may have methods added to them without a package major version bump. This non-standard API evolution could surprise an uninformed implementation author. They could unknowingly build their implementation in a way that would result in a runtime panic for their users that update to the new API. The API is designed to help inform an instrumentation author about this non-standard API evolution. It requires them to choose a default behavior for unimplemented interface methods. There are three behavior choices they can make: - Compilation failure - Panic - Default to another implementation All interfaces in this API embed a corresponding interface from [go.opentelemetry.io/otel/metric/embedded]. If an author wants the default behavior of their implementations to be a compilation failure, signaling to their users they need to update to the latest version of that implementation, they need to embed the corresponding interface from [go.opentelemetry.io/otel/metric/embedded] in their implementation. For example, import "go.opentelemetry.io/otel/metric/embedded" type MeterProvider struct { embedded.MeterProvider // ... } If an author wants the default behavior of their implementations to a panic, they need to embed the API interface directly. import "go.opentelemetry.io/otel/metric" type MeterProvider struct { metric.MeterProvider // ... } This is not a recommended behavior as it could lead to publishing packages that contain runtime panics when users update other package that use newer versions of [go.opentelemetry.io/otel/metric]. Finally, an author can embed another implementation in theirs. The embedded implementation will be used for methods not defined by the author. For example, an author who wants to default to silently dropping the call can use [go.opentelemetry.io/otel/metric/noop]: import "go.opentelemetry.io/otel/metric/noop" type MeterProvider struct { noop.MeterProvider // ... } It is strongly recommended that authors only embed [go.opentelemetry.io/otel/metric/noop] if they choose this default behavior. That implementation is the only one OpenTelemetry authors can guarantee will fully implement all the API interfaces when a user updates their API. [instrument name syntax]: https://opentelemetry.io/docs/specs/otel/metrics/api/#instrument-name-syntax [OpenTelemetry documentation]: https://opentelemetry.io/docs/concepts/signals/metrics/ [GetMeterProvider]: https://pkg.go.dev/go.opentelemetry.io/otel#GetMeterProvider */ package metric // import "go.opentelemetry.io/otel/metric" ================================================ FILE: vendor/go.opentelemetry.io/otel/metric/embedded/README.md ================================================ # Metric Embedded [![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/metric/embedded)](https://pkg.go.dev/go.opentelemetry.io/otel/metric/embedded) ================================================ FILE: vendor/go.opentelemetry.io/otel/metric/embedded/embedded.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 // Package embedded provides interfaces embedded within the [OpenTelemetry // metric API]. // // Implementers of the [OpenTelemetry metric API] can embed the relevant type // from this package into their implementation directly. Doing so will result // in a compilation error for users when the [OpenTelemetry metric API] is // extended (which is something that can happen without a major version bump of // the API package). // // [OpenTelemetry metric API]: https://pkg.go.dev/go.opentelemetry.io/otel/metric package embedded // import "go.opentelemetry.io/otel/metric/embedded" // MeterProvider is embedded in // [go.opentelemetry.io/otel/metric.MeterProvider]. // // Embed this interface in your implementation of the // [go.opentelemetry.io/otel/metric.MeterProvider] if you want users to // experience a compilation error, signaling they need to update to your latest // implementation, when the [go.opentelemetry.io/otel/metric.MeterProvider] // interface is extended (which is something that can happen without a major // version bump of the API package). type MeterProvider interface{ meterProvider() } // Meter is embedded in [go.opentelemetry.io/otel/metric.Meter]. // // Embed this interface in your implementation of the // [go.opentelemetry.io/otel/metric.Meter] if you want users to experience a // compilation error, signaling they need to update to your latest // implementation, when the [go.opentelemetry.io/otel/metric.Meter] interface // is extended (which is something that can happen without a major version bump // of the API package). type Meter interface{ meter() } // Float64Observer is embedded in // [go.opentelemetry.io/otel/metric.Float64Observer]. // // Embed this interface in your implementation of the // [go.opentelemetry.io/otel/metric.Float64Observer] if you want // users to experience a compilation error, signaling they need to update to // your latest implementation, when the // [go.opentelemetry.io/otel/metric.Float64Observer] interface is // extended (which is something that can happen without a major version bump of // the API package). type Float64Observer interface{ float64Observer() } // Int64Observer is embedded in // [go.opentelemetry.io/otel/metric.Int64Observer]. // // Embed this interface in your implementation of the // [go.opentelemetry.io/otel/metric.Int64Observer] if you want users // to experience a compilation error, signaling they need to update to your // latest implementation, when the // [go.opentelemetry.io/otel/metric.Int64Observer] interface is // extended (which is something that can happen without a major version bump of // the API package). type Int64Observer interface{ int64Observer() } // Observer is embedded in [go.opentelemetry.io/otel/metric.Observer]. // // Embed this interface in your implementation of the // [go.opentelemetry.io/otel/metric.Observer] if you want users to experience a // compilation error, signaling they need to update to your latest // implementation, when the [go.opentelemetry.io/otel/metric.Observer] // interface is extended (which is something that can happen without a major // version bump of the API package). type Observer interface{ observer() } // Registration is embedded in [go.opentelemetry.io/otel/metric.Registration]. // // Embed this interface in your implementation of the // [go.opentelemetry.io/otel/metric.Registration] if you want users to // experience a compilation error, signaling they need to update to your latest // implementation, when the [go.opentelemetry.io/otel/metric.Registration] // interface is extended (which is something that can happen without a major // version bump of the API package). type Registration interface{ registration() } // Float64Counter is embedded in // [go.opentelemetry.io/otel/metric.Float64Counter]. // // Embed this interface in your implementation of the // [go.opentelemetry.io/otel/metric.Float64Counter] if you want // users to experience a compilation error, signaling they need to update to // your latest implementation, when the // [go.opentelemetry.io/otel/metric.Float64Counter] interface is // extended (which is something that can happen without a major version bump of // the API package). type Float64Counter interface{ float64Counter() } // Float64Histogram is embedded in // [go.opentelemetry.io/otel/metric.Float64Histogram]. // // Embed this interface in your implementation of the // [go.opentelemetry.io/otel/metric.Float64Histogram] if you want // users to experience a compilation error, signaling they need to update to // your latest implementation, when the // [go.opentelemetry.io/otel/metric.Float64Histogram] interface is // extended (which is something that can happen without a major version bump of // the API package). type Float64Histogram interface{ float64Histogram() } // Float64Gauge is embedded in [go.opentelemetry.io/otel/metric.Float64Gauge]. // // Embed this interface in your implementation of the // [go.opentelemetry.io/otel/metric.Float64Gauge] if you want users to // experience a compilation error, signaling they need to update to your latest // implementation, when the [go.opentelemetry.io/otel/metric.Float64Gauge] // interface is extended (which is something that can happen without a major // version bump of the API package). type Float64Gauge interface{ float64Gauge() } // Float64ObservableCounter is embedded in // [go.opentelemetry.io/otel/metric.Float64ObservableCounter]. // // Embed this interface in your implementation of the // [go.opentelemetry.io/otel/metric.Float64ObservableCounter] if you // want users to experience a compilation error, signaling they need to update // to your latest implementation, when the // [go.opentelemetry.io/otel/metric.Float64ObservableCounter] // interface is extended (which is something that can happen without a major // version bump of the API package). type Float64ObservableCounter interface{ float64ObservableCounter() } // Float64ObservableGauge is embedded in // [go.opentelemetry.io/otel/metric.Float64ObservableGauge]. // // Embed this interface in your implementation of the // [go.opentelemetry.io/otel/metric.Float64ObservableGauge] if you // want users to experience a compilation error, signaling they need to update // to your latest implementation, when the // [go.opentelemetry.io/otel/metric.Float64ObservableGauge] // interface is extended (which is something that can happen without a major // version bump of the API package). type Float64ObservableGauge interface{ float64ObservableGauge() } // Float64ObservableUpDownCounter is embedded in // [go.opentelemetry.io/otel/metric.Float64ObservableUpDownCounter]. // // Embed this interface in your implementation of the // [go.opentelemetry.io/otel/metric.Float64ObservableUpDownCounter] // if you want users to experience a compilation error, signaling they need to // update to your latest implementation, when the // [go.opentelemetry.io/otel/metric.Float64ObservableUpDownCounter] // interface is extended (which is something that can happen without a major // version bump of the API package). type Float64ObservableUpDownCounter interface{ float64ObservableUpDownCounter() } // Float64UpDownCounter is embedded in // [go.opentelemetry.io/otel/metric.Float64UpDownCounter]. // // Embed this interface in your implementation of the // [go.opentelemetry.io/otel/metric.Float64UpDownCounter] if you // want users to experience a compilation error, signaling they need to update // to your latest implementation, when the // [go.opentelemetry.io/otel/metric.Float64UpDownCounter] interface // is extended (which is something that can happen without a major version bump // of the API package). type Float64UpDownCounter interface{ float64UpDownCounter() } // Int64Counter is embedded in // [go.opentelemetry.io/otel/metric.Int64Counter]. // // Embed this interface in your implementation of the // [go.opentelemetry.io/otel/metric.Int64Counter] if you want users // to experience a compilation error, signaling they need to update to your // latest implementation, when the // [go.opentelemetry.io/otel/metric.Int64Counter] interface is // extended (which is something that can happen without a major version bump of // the API package). type Int64Counter interface{ int64Counter() } // Int64Histogram is embedded in // [go.opentelemetry.io/otel/metric.Int64Histogram]. // // Embed this interface in your implementation of the // [go.opentelemetry.io/otel/metric.Int64Histogram] if you want // users to experience a compilation error, signaling they need to update to // your latest implementation, when the // [go.opentelemetry.io/otel/metric.Int64Histogram] interface is // extended (which is something that can happen without a major version bump of // the API package). type Int64Histogram interface{ int64Histogram() } // Int64Gauge is embedded in [go.opentelemetry.io/otel/metric.Int64Gauge]. // // Embed this interface in your implementation of the // [go.opentelemetry.io/otel/metric.Int64Gauge] if you want users to experience // a compilation error, signaling they need to update to your latest // implementation, when the [go.opentelemetry.io/otel/metric.Int64Gauge] // interface is extended (which is something that can happen without a major // version bump of the API package). type Int64Gauge interface{ int64Gauge() } // Int64ObservableCounter is embedded in // [go.opentelemetry.io/otel/metric.Int64ObservableCounter]. // // Embed this interface in your implementation of the // [go.opentelemetry.io/otel/metric.Int64ObservableCounter] if you // want users to experience a compilation error, signaling they need to update // to your latest implementation, when the // [go.opentelemetry.io/otel/metric.Int64ObservableCounter] // interface is extended (which is something that can happen without a major // version bump of the API package). type Int64ObservableCounter interface{ int64ObservableCounter() } // Int64ObservableGauge is embedded in // [go.opentelemetry.io/otel/metric.Int64ObservableGauge]. // // Embed this interface in your implementation of the // [go.opentelemetry.io/otel/metric.Int64ObservableGauge] if you // want users to experience a compilation error, signaling they need to update // to your latest implementation, when the // [go.opentelemetry.io/otel/metric.Int64ObservableGauge] interface // is extended (which is something that can happen without a major version bump // of the API package). type Int64ObservableGauge interface{ int64ObservableGauge() } // Int64ObservableUpDownCounter is embedded in // [go.opentelemetry.io/otel/metric.Int64ObservableUpDownCounter]. // // Embed this interface in your implementation of the // [go.opentelemetry.io/otel/metric.Int64ObservableUpDownCounter] if // you want users to experience a compilation error, signaling they need to // update to your latest implementation, when the // [go.opentelemetry.io/otel/metric.Int64ObservableUpDownCounter] // interface is extended (which is something that can happen without a major // version bump of the API package). type Int64ObservableUpDownCounter interface{ int64ObservableUpDownCounter() } // Int64UpDownCounter is embedded in // [go.opentelemetry.io/otel/metric.Int64UpDownCounter]. // // Embed this interface in your implementation of the // [go.opentelemetry.io/otel/metric.Int64UpDownCounter] if you want // users to experience a compilation error, signaling they need to update to // your latest implementation, when the // [go.opentelemetry.io/otel/metric.Int64UpDownCounter] interface is // extended (which is something that can happen without a major version bump of // the API package). type Int64UpDownCounter interface{ int64UpDownCounter() } ================================================ FILE: vendor/go.opentelemetry.io/otel/metric/instrument.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package metric // import "go.opentelemetry.io/otel/metric" import "go.opentelemetry.io/otel/attribute" // Observable is used as a grouping mechanism for all instruments that are // updated within a Callback. type Observable interface { observable() } // InstrumentOption applies options to all instruments. type InstrumentOption interface { Int64CounterOption Int64UpDownCounterOption Int64HistogramOption Int64GaugeOption Int64ObservableCounterOption Int64ObservableUpDownCounterOption Int64ObservableGaugeOption Float64CounterOption Float64UpDownCounterOption Float64HistogramOption Float64GaugeOption Float64ObservableCounterOption Float64ObservableUpDownCounterOption Float64ObservableGaugeOption } // HistogramOption applies options to histogram instruments. type HistogramOption interface { Int64HistogramOption Float64HistogramOption } type descOpt string func (o descOpt) applyFloat64Counter(c Float64CounterConfig) Float64CounterConfig { c.description = string(o) return c } func (o descOpt) applyFloat64UpDownCounter(c Float64UpDownCounterConfig) Float64UpDownCounterConfig { c.description = string(o) return c } func (o descOpt) applyFloat64Histogram(c Float64HistogramConfig) Float64HistogramConfig { c.description = string(o) return c } func (o descOpt) applyFloat64Gauge(c Float64GaugeConfig) Float64GaugeConfig { c.description = string(o) return c } func (o descOpt) applyFloat64ObservableCounter(c Float64ObservableCounterConfig) Float64ObservableCounterConfig { c.description = string(o) return c } func (o descOpt) applyFloat64ObservableUpDownCounter( c Float64ObservableUpDownCounterConfig, ) Float64ObservableUpDownCounterConfig { c.description = string(o) return c } func (o descOpt) applyFloat64ObservableGauge(c Float64ObservableGaugeConfig) Float64ObservableGaugeConfig { c.description = string(o) return c } func (o descOpt) applyInt64Counter(c Int64CounterConfig) Int64CounterConfig { c.description = string(o) return c } func (o descOpt) applyInt64UpDownCounter(c Int64UpDownCounterConfig) Int64UpDownCounterConfig { c.description = string(o) return c } func (o descOpt) applyInt64Histogram(c Int64HistogramConfig) Int64HistogramConfig { c.description = string(o) return c } func (o descOpt) applyInt64Gauge(c Int64GaugeConfig) Int64GaugeConfig { c.description = string(o) return c } func (o descOpt) applyInt64ObservableCounter(c Int64ObservableCounterConfig) Int64ObservableCounterConfig { c.description = string(o) return c } func (o descOpt) applyInt64ObservableUpDownCounter( c Int64ObservableUpDownCounterConfig, ) Int64ObservableUpDownCounterConfig { c.description = string(o) return c } func (o descOpt) applyInt64ObservableGauge(c Int64ObservableGaugeConfig) Int64ObservableGaugeConfig { c.description = string(o) return c } // WithDescription sets the instrument description. func WithDescription(desc string) InstrumentOption { return descOpt(desc) } type unitOpt string func (o unitOpt) applyFloat64Counter(c Float64CounterConfig) Float64CounterConfig { c.unit = string(o) return c } func (o unitOpt) applyFloat64UpDownCounter(c Float64UpDownCounterConfig) Float64UpDownCounterConfig { c.unit = string(o) return c } func (o unitOpt) applyFloat64Histogram(c Float64HistogramConfig) Float64HistogramConfig { c.unit = string(o) return c } func (o unitOpt) applyFloat64Gauge(c Float64GaugeConfig) Float64GaugeConfig { c.unit = string(o) return c } func (o unitOpt) applyFloat64ObservableCounter(c Float64ObservableCounterConfig) Float64ObservableCounterConfig { c.unit = string(o) return c } func (o unitOpt) applyFloat64ObservableUpDownCounter( c Float64ObservableUpDownCounterConfig, ) Float64ObservableUpDownCounterConfig { c.unit = string(o) return c } func (o unitOpt) applyFloat64ObservableGauge(c Float64ObservableGaugeConfig) Float64ObservableGaugeConfig { c.unit = string(o) return c } func (o unitOpt) applyInt64Counter(c Int64CounterConfig) Int64CounterConfig { c.unit = string(o) return c } func (o unitOpt) applyInt64UpDownCounter(c Int64UpDownCounterConfig) Int64UpDownCounterConfig { c.unit = string(o) return c } func (o unitOpt) applyInt64Histogram(c Int64HistogramConfig) Int64HistogramConfig { c.unit = string(o) return c } func (o unitOpt) applyInt64Gauge(c Int64GaugeConfig) Int64GaugeConfig { c.unit = string(o) return c } func (o unitOpt) applyInt64ObservableCounter(c Int64ObservableCounterConfig) Int64ObservableCounterConfig { c.unit = string(o) return c } func (o unitOpt) applyInt64ObservableUpDownCounter( c Int64ObservableUpDownCounterConfig, ) Int64ObservableUpDownCounterConfig { c.unit = string(o) return c } func (o unitOpt) applyInt64ObservableGauge(c Int64ObservableGaugeConfig) Int64ObservableGaugeConfig { c.unit = string(o) return c } // WithUnit sets the instrument unit. // // The unit u should be defined using the appropriate [UCUM](https://ucum.org) case-sensitive code. func WithUnit(u string) InstrumentOption { return unitOpt(u) } // WithExplicitBucketBoundaries sets the instrument explicit bucket boundaries. // // This option is considered "advisory", and may be ignored by API implementations. func WithExplicitBucketBoundaries(bounds ...float64) HistogramOption { return bucketOpt(bounds) } type bucketOpt []float64 func (o bucketOpt) applyFloat64Histogram(c Float64HistogramConfig) Float64HistogramConfig { c.explicitBucketBoundaries = o return c } func (o bucketOpt) applyInt64Histogram(c Int64HistogramConfig) Int64HistogramConfig { c.explicitBucketBoundaries = o return c } // AddOption applies options to an addition measurement. See // [MeasurementOption] for other options that can be used as an AddOption. type AddOption interface { applyAdd(AddConfig) AddConfig } // AddConfig contains options for an addition measurement. type AddConfig struct { attrs attribute.Set } // NewAddConfig returns a new [AddConfig] with all opts applied. func NewAddConfig(opts []AddOption) AddConfig { config := AddConfig{attrs: *attribute.EmptySet()} for _, o := range opts { config = o.applyAdd(config) } return config } // Attributes returns the configured attribute set. func (c AddConfig) Attributes() attribute.Set { return c.attrs } // RecordOption applies options to an addition measurement. See // [MeasurementOption] for other options that can be used as a RecordOption. type RecordOption interface { applyRecord(RecordConfig) RecordConfig } // RecordConfig contains options for a recorded measurement. type RecordConfig struct { attrs attribute.Set } // NewRecordConfig returns a new [RecordConfig] with all opts applied. func NewRecordConfig(opts []RecordOption) RecordConfig { config := RecordConfig{attrs: *attribute.EmptySet()} for _, o := range opts { config = o.applyRecord(config) } return config } // Attributes returns the configured attribute set. func (c RecordConfig) Attributes() attribute.Set { return c.attrs } // ObserveOption applies options to an addition measurement. See // [MeasurementOption] for other options that can be used as a ObserveOption. type ObserveOption interface { applyObserve(ObserveConfig) ObserveConfig } // ObserveConfig contains options for an observed measurement. type ObserveConfig struct { attrs attribute.Set } // NewObserveConfig returns a new [ObserveConfig] with all opts applied. func NewObserveConfig(opts []ObserveOption) ObserveConfig { config := ObserveConfig{attrs: *attribute.EmptySet()} for _, o := range opts { config = o.applyObserve(config) } return config } // Attributes returns the configured attribute set. func (c ObserveConfig) Attributes() attribute.Set { return c.attrs } // MeasurementOption applies options to all instrument measurement. type MeasurementOption interface { AddOption RecordOption ObserveOption } type attrOpt struct { set attribute.Set } // mergeSets returns the union of keys between a and b. Any duplicate keys will // use the value associated with b. func mergeSets(a, b attribute.Set) attribute.Set { // NewMergeIterator uses the first value for any duplicates. iter := attribute.NewMergeIterator(&b, &a) merged := make([]attribute.KeyValue, 0, a.Len()+b.Len()) for iter.Next() { merged = append(merged, iter.Attribute()) } return attribute.NewSet(merged...) } func (o attrOpt) applyAdd(c AddConfig) AddConfig { switch { case o.set.Len() == 0: case c.attrs.Len() == 0: c.attrs = o.set default: c.attrs = mergeSets(c.attrs, o.set) } return c } func (o attrOpt) applyRecord(c RecordConfig) RecordConfig { switch { case o.set.Len() == 0: case c.attrs.Len() == 0: c.attrs = o.set default: c.attrs = mergeSets(c.attrs, o.set) } return c } func (o attrOpt) applyObserve(c ObserveConfig) ObserveConfig { switch { case o.set.Len() == 0: case c.attrs.Len() == 0: c.attrs = o.set default: c.attrs = mergeSets(c.attrs, o.set) } return c } // WithAttributeSet sets the attribute Set associated with a measurement is // made with. // // If multiple WithAttributeSet or WithAttributes options are passed the // attributes will be merged together in the order they are passed. Attributes // with duplicate keys will use the last value passed. func WithAttributeSet(attributes attribute.Set) MeasurementOption { return attrOpt{set: attributes} } // WithAttributes converts attributes into an attribute Set and sets the Set to // be associated with a measurement. This is shorthand for: // // cp := make([]attribute.KeyValue, len(attributes)) // copy(cp, attributes) // WithAttributeSet(attribute.NewSet(cp...)) // // [attribute.NewSet] may modify the passed attributes so this will make a copy // of attributes before creating a set in order to ensure this function is // concurrent safe. This makes this option function less optimized in // comparison to [WithAttributeSet]. Therefore, [WithAttributeSet] should be // preferred for performance sensitive code. // // See [WithAttributeSet] for information about how multiple WithAttributes are // merged. func WithAttributes(attributes ...attribute.KeyValue) MeasurementOption { cp := make([]attribute.KeyValue, len(attributes)) copy(cp, attributes) return attrOpt{set: attribute.NewSet(cp...)} } ================================================ FILE: vendor/go.opentelemetry.io/otel/metric/meter.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package metric // import "go.opentelemetry.io/otel/metric" import ( "context" "go.opentelemetry.io/otel/metric/embedded" ) // MeterProvider provides access to named Meter instances, for instrumenting // an application or package. // // Warning: Methods may be added to this interface in minor releases. See // package documentation on API implementation for information on how to set // default behavior for unimplemented methods. type MeterProvider interface { // Users of the interface can ignore this. This embedded type is only used // by implementations of this interface. See the "API Implementations" // section of the package documentation for more information. embedded.MeterProvider // Meter returns a new Meter with the provided name and configuration. // // A Meter should be scoped at most to a single package. The name needs to // be unique so it does not collide with other names used by // an application, nor other applications. To achieve this, the import path // of the instrumentation package is recommended to be used as name. // // If the name is empty, then an implementation defined default name will // be used instead. Meter(name string, opts ...MeterOption) Meter } // Meter provides access to instrument instances for recording metrics. // // Warning: Methods may be added to this interface in minor releases. See // package documentation on API implementation for information on how to set // default behavior for unimplemented methods. type Meter interface { // Users of the interface can ignore this. This embedded type is only used // by implementations of this interface. See the "API Implementations" // section of the package documentation for more information. embedded.Meter // Int64Counter returns a new Int64Counter instrument identified by name // and configured with options. The instrument is used to synchronously // record increasing int64 measurements during a computational operation. // // The name needs to conform to the OpenTelemetry instrument name syntax. // See the Instrument Name section of the package documentation for more // information. Int64Counter(name string, options ...Int64CounterOption) (Int64Counter, error) // Int64UpDownCounter returns a new Int64UpDownCounter instrument // identified by name and configured with options. The instrument is used // to synchronously record int64 measurements during a computational // operation. // // The name needs to conform to the OpenTelemetry instrument name syntax. // See the Instrument Name section of the package documentation for more // information. Int64UpDownCounter(name string, options ...Int64UpDownCounterOption) (Int64UpDownCounter, error) // Int64Histogram returns a new Int64Histogram instrument identified by // name and configured with options. The instrument is used to // synchronously record the distribution of int64 measurements during a // computational operation. // // The name needs to conform to the OpenTelemetry instrument name syntax. // See the Instrument Name section of the package documentation for more // information. Int64Histogram(name string, options ...Int64HistogramOption) (Int64Histogram, error) // Int64Gauge returns a new Int64Gauge instrument identified by name and // configured with options. The instrument is used to synchronously record // instantaneous int64 measurements during a computational operation. // // The name needs to conform to the OpenTelemetry instrument name syntax. // See the Instrument Name section of the package documentation for more // information. Int64Gauge(name string, options ...Int64GaugeOption) (Int64Gauge, error) // Int64ObservableCounter returns a new Int64ObservableCounter identified // by name and configured with options. The instrument is used to // asynchronously record increasing int64 measurements once per a // measurement collection cycle. // // Measurements for the returned instrument are made via a callback. Use // the WithInt64Callback option to register the callback here, or use the // RegisterCallback method of this Meter to register one later. See the // Measurements section of the package documentation for more information. // // The name needs to conform to the OpenTelemetry instrument name syntax. // See the Instrument Name section of the package documentation for more // information. Int64ObservableCounter(name string, options ...Int64ObservableCounterOption) (Int64ObservableCounter, error) // Int64ObservableUpDownCounter returns a new Int64ObservableUpDownCounter // instrument identified by name and configured with options. The // instrument is used to asynchronously record int64 measurements once per // a measurement collection cycle. // // Measurements for the returned instrument are made via a callback. Use // the WithInt64Callback option to register the callback here, or use the // RegisterCallback method of this Meter to register one later. See the // Measurements section of the package documentation for more information. // // The name needs to conform to the OpenTelemetry instrument name syntax. // See the Instrument Name section of the package documentation for more // information. Int64ObservableUpDownCounter( name string, options ...Int64ObservableUpDownCounterOption, ) (Int64ObservableUpDownCounter, error) // Int64ObservableGauge returns a new Int64ObservableGauge instrument // identified by name and configured with options. The instrument is used // to asynchronously record instantaneous int64 measurements once per a // measurement collection cycle. // // Measurements for the returned instrument are made via a callback. Use // the WithInt64Callback option to register the callback here, or use the // RegisterCallback method of this Meter to register one later. See the // Measurements section of the package documentation for more information. // // The name needs to conform to the OpenTelemetry instrument name syntax. // See the Instrument Name section of the package documentation for more // information. Int64ObservableGauge(name string, options ...Int64ObservableGaugeOption) (Int64ObservableGauge, error) // Float64Counter returns a new Float64Counter instrument identified by // name and configured with options. The instrument is used to // synchronously record increasing float64 measurements during a // computational operation. // // The name needs to conform to the OpenTelemetry instrument name syntax. // See the Instrument Name section of the package documentation for more // information. Float64Counter(name string, options ...Float64CounterOption) (Float64Counter, error) // Float64UpDownCounter returns a new Float64UpDownCounter instrument // identified by name and configured with options. The instrument is used // to synchronously record float64 measurements during a computational // operation. // // The name needs to conform to the OpenTelemetry instrument name syntax. // See the Instrument Name section of the package documentation for more // information. Float64UpDownCounter(name string, options ...Float64UpDownCounterOption) (Float64UpDownCounter, error) // Float64Histogram returns a new Float64Histogram instrument identified by // name and configured with options. The instrument is used to // synchronously record the distribution of float64 measurements during a // computational operation. // // The name needs to conform to the OpenTelemetry instrument name syntax. // See the Instrument Name section of the package documentation for more // information. Float64Histogram(name string, options ...Float64HistogramOption) (Float64Histogram, error) // Float64Gauge returns a new Float64Gauge instrument identified by name and // configured with options. The instrument is used to synchronously record // instantaneous float64 measurements during a computational operation. // // The name needs to conform to the OpenTelemetry instrument name syntax. // See the Instrument Name section of the package documentation for more // information. Float64Gauge(name string, options ...Float64GaugeOption) (Float64Gauge, error) // Float64ObservableCounter returns a new Float64ObservableCounter // instrument identified by name and configured with options. The // instrument is used to asynchronously record increasing float64 // measurements once per a measurement collection cycle. // // Measurements for the returned instrument are made via a callback. Use // the WithFloat64Callback option to register the callback here, or use the // RegisterCallback method of this Meter to register one later. See the // Measurements section of the package documentation for more information. // // The name needs to conform to the OpenTelemetry instrument name syntax. // See the Instrument Name section of the package documentation for more // information. Float64ObservableCounter(name string, options ...Float64ObservableCounterOption) (Float64ObservableCounter, error) // Float64ObservableUpDownCounter returns a new // Float64ObservableUpDownCounter instrument identified by name and // configured with options. The instrument is used to asynchronously record // float64 measurements once per a measurement collection cycle. // // Measurements for the returned instrument are made via a callback. Use // the WithFloat64Callback option to register the callback here, or use the // RegisterCallback method of this Meter to register one later. See the // Measurements section of the package documentation for more information. // // The name needs to conform to the OpenTelemetry instrument name syntax. // See the Instrument Name section of the package documentation for more // information. Float64ObservableUpDownCounter( name string, options ...Float64ObservableUpDownCounterOption, ) (Float64ObservableUpDownCounter, error) // Float64ObservableGauge returns a new Float64ObservableGauge instrument // identified by name and configured with options. The instrument is used // to asynchronously record instantaneous float64 measurements once per a // measurement collection cycle. // // Measurements for the returned instrument are made via a callback. Use // the WithFloat64Callback option to register the callback here, or use the // RegisterCallback method of this Meter to register one later. See the // Measurements section of the package documentation for more information. // // The name needs to conform to the OpenTelemetry instrument name syntax. // See the Instrument Name section of the package documentation for more // information. Float64ObservableGauge(name string, options ...Float64ObservableGaugeOption) (Float64ObservableGauge, error) // RegisterCallback registers f to be called during the collection of a // measurement cycle. // // If Unregister of the returned Registration is called, f needs to be // unregistered and not called during collection. // // The instruments f is registered with are the only instruments that f may // observe values for. // // If no instruments are passed, f should not be registered nor called // during collection. // // The function f needs to be concurrent safe. RegisterCallback(f Callback, instruments ...Observable) (Registration, error) } // Callback is a function registered with a Meter that makes observations for // the set of instruments it is registered with. The Observer parameter is used // to record measurement observations for these instruments. // // The function needs to complete in a finite amount of time and the deadline // of the passed context is expected to be honored. // // The function needs to make unique observations across all registered // Callbacks. Meaning, it should not report measurements for an instrument with // the same attributes as another Callback will report. // // The function needs to be reentrant and concurrent safe. // // Note that Go's mutexes are not reentrant, and locking a mutex takes // an indefinite amount of time. It is therefore advised to avoid // using mutexes inside callbacks. type Callback func(context.Context, Observer) error // Observer records measurements for multiple instruments in a Callback. // // Warning: Methods may be added to this interface in minor releases. See // package documentation on API implementation for information on how to set // default behavior for unimplemented methods. type Observer interface { // Users of the interface can ignore this. This embedded type is only used // by implementations of this interface. See the "API Implementations" // section of the package documentation for more information. embedded.Observer // ObserveFloat64 records the float64 value for obsrv. ObserveFloat64(obsrv Float64Observable, value float64, opts ...ObserveOption) // ObserveInt64 records the int64 value for obsrv. ObserveInt64(obsrv Int64Observable, value int64, opts ...ObserveOption) } // Registration is an token representing the unique registration of a callback // for a set of instruments with a Meter. // // Warning: Methods may be added to this interface in minor releases. See // package documentation on API implementation for information on how to set // default behavior for unimplemented methods. type Registration interface { // Users of the interface can ignore this. This embedded type is only used // by implementations of this interface. See the "API Implementations" // section of the package documentation for more information. embedded.Registration // Unregister removes the callback registration from a Meter. // // This method needs to be idempotent and concurrent safe. Unregister() error } ================================================ FILE: vendor/go.opentelemetry.io/otel/metric/noop/README.md ================================================ # Metric Noop [![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/metric/noop)](https://pkg.go.dev/go.opentelemetry.io/otel/metric/noop) ================================================ FILE: vendor/go.opentelemetry.io/otel/metric/noop/noop.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 // Package noop provides an implementation of the OpenTelemetry metric API that // produces no telemetry and minimizes used computation resources. // // Using this package to implement the OpenTelemetry metric API will // effectively disable OpenTelemetry. // // This implementation can be embedded in other implementations of the // OpenTelemetry metric API. Doing so will mean the implementation defaults to // no operation for methods it does not implement. package noop // import "go.opentelemetry.io/otel/metric/noop" import ( "context" "go.opentelemetry.io/otel/metric" "go.opentelemetry.io/otel/metric/embedded" ) var ( // Compile-time check this implements the OpenTelemetry API. _ metric.MeterProvider = MeterProvider{} _ metric.Meter = Meter{} _ metric.Observer = Observer{} _ metric.Registration = Registration{} _ metric.Int64Counter = Int64Counter{} _ metric.Float64Counter = Float64Counter{} _ metric.Int64UpDownCounter = Int64UpDownCounter{} _ metric.Float64UpDownCounter = Float64UpDownCounter{} _ metric.Int64Histogram = Int64Histogram{} _ metric.Float64Histogram = Float64Histogram{} _ metric.Int64Gauge = Int64Gauge{} _ metric.Float64Gauge = Float64Gauge{} _ metric.Int64ObservableCounter = Int64ObservableCounter{} _ metric.Float64ObservableCounter = Float64ObservableCounter{} _ metric.Int64ObservableGauge = Int64ObservableGauge{} _ metric.Float64ObservableGauge = Float64ObservableGauge{} _ metric.Int64ObservableUpDownCounter = Int64ObservableUpDownCounter{} _ metric.Float64ObservableUpDownCounter = Float64ObservableUpDownCounter{} _ metric.Int64Observer = Int64Observer{} _ metric.Float64Observer = Float64Observer{} ) // MeterProvider is an OpenTelemetry No-Op MeterProvider. type MeterProvider struct{ embedded.MeterProvider } // NewMeterProvider returns a MeterProvider that does not record any telemetry. func NewMeterProvider() MeterProvider { return MeterProvider{} } // Meter returns an OpenTelemetry Meter that does not record any telemetry. func (MeterProvider) Meter(string, ...metric.MeterOption) metric.Meter { return Meter{} } // Meter is an OpenTelemetry No-Op Meter. type Meter struct{ embedded.Meter } // Int64Counter returns a Counter used to record int64 measurements that // produces no telemetry. func (Meter) Int64Counter(string, ...metric.Int64CounterOption) (metric.Int64Counter, error) { return Int64Counter{}, nil } // Int64UpDownCounter returns an UpDownCounter used to record int64 // measurements that produces no telemetry. func (Meter) Int64UpDownCounter(string, ...metric.Int64UpDownCounterOption) (metric.Int64UpDownCounter, error) { return Int64UpDownCounter{}, nil } // Int64Histogram returns a Histogram used to record int64 measurements that // produces no telemetry. func (Meter) Int64Histogram(string, ...metric.Int64HistogramOption) (metric.Int64Histogram, error) { return Int64Histogram{}, nil } // Int64Gauge returns a Gauge used to record int64 measurements that // produces no telemetry. func (Meter) Int64Gauge(string, ...metric.Int64GaugeOption) (metric.Int64Gauge, error) { return Int64Gauge{}, nil } // Int64ObservableCounter returns an ObservableCounter used to record int64 // measurements that produces no telemetry. func (Meter) Int64ObservableCounter( string, ...metric.Int64ObservableCounterOption, ) (metric.Int64ObservableCounter, error) { return Int64ObservableCounter{}, nil } // Int64ObservableUpDownCounter returns an ObservableUpDownCounter used to // record int64 measurements that produces no telemetry. func (Meter) Int64ObservableUpDownCounter( string, ...metric.Int64ObservableUpDownCounterOption, ) (metric.Int64ObservableUpDownCounter, error) { return Int64ObservableUpDownCounter{}, nil } // Int64ObservableGauge returns an ObservableGauge used to record int64 // measurements that produces no telemetry. func (Meter) Int64ObservableGauge(string, ...metric.Int64ObservableGaugeOption) (metric.Int64ObservableGauge, error) { return Int64ObservableGauge{}, nil } // Float64Counter returns a Counter used to record int64 measurements that // produces no telemetry. func (Meter) Float64Counter(string, ...metric.Float64CounterOption) (metric.Float64Counter, error) { return Float64Counter{}, nil } // Float64UpDownCounter returns an UpDownCounter used to record int64 // measurements that produces no telemetry. func (Meter) Float64UpDownCounter(string, ...metric.Float64UpDownCounterOption) (metric.Float64UpDownCounter, error) { return Float64UpDownCounter{}, nil } // Float64Histogram returns a Histogram used to record int64 measurements that // produces no telemetry. func (Meter) Float64Histogram(string, ...metric.Float64HistogramOption) (metric.Float64Histogram, error) { return Float64Histogram{}, nil } // Float64Gauge returns a Gauge used to record float64 measurements that // produces no telemetry. func (Meter) Float64Gauge(string, ...metric.Float64GaugeOption) (metric.Float64Gauge, error) { return Float64Gauge{}, nil } // Float64ObservableCounter returns an ObservableCounter used to record int64 // measurements that produces no telemetry. func (Meter) Float64ObservableCounter( string, ...metric.Float64ObservableCounterOption, ) (metric.Float64ObservableCounter, error) { return Float64ObservableCounter{}, nil } // Float64ObservableUpDownCounter returns an ObservableUpDownCounter used to // record int64 measurements that produces no telemetry. func (Meter) Float64ObservableUpDownCounter( string, ...metric.Float64ObservableUpDownCounterOption, ) (metric.Float64ObservableUpDownCounter, error) { return Float64ObservableUpDownCounter{}, nil } // Float64ObservableGauge returns an ObservableGauge used to record int64 // measurements that produces no telemetry. func (Meter) Float64ObservableGauge( string, ...metric.Float64ObservableGaugeOption, ) (metric.Float64ObservableGauge, error) { return Float64ObservableGauge{}, nil } // RegisterCallback performs no operation. func (Meter) RegisterCallback(metric.Callback, ...metric.Observable) (metric.Registration, error) { return Registration{}, nil } // Observer acts as a recorder of measurements for multiple instruments in a // Callback, it performing no operation. type Observer struct{ embedded.Observer } // ObserveFloat64 performs no operation. func (Observer) ObserveFloat64(metric.Float64Observable, float64, ...metric.ObserveOption) { } // ObserveInt64 performs no operation. func (Observer) ObserveInt64(metric.Int64Observable, int64, ...metric.ObserveOption) { } // Registration is the registration of a Callback with a No-Op Meter. type Registration struct{ embedded.Registration } // Unregister unregisters the Callback the Registration represents with the // No-Op Meter. This will always return nil because the No-Op Meter performs no // operation, including hold any record of registrations. func (Registration) Unregister() error { return nil } // Int64Counter is an OpenTelemetry Counter used to record int64 measurements. // It produces no telemetry. type Int64Counter struct{ embedded.Int64Counter } // Add performs no operation. func (Int64Counter) Add(context.Context, int64, ...metric.AddOption) {} // Enabled performs no operation. func (Int64Counter) Enabled(context.Context) bool { return false } // Float64Counter is an OpenTelemetry Counter used to record float64 // measurements. It produces no telemetry. type Float64Counter struct{ embedded.Float64Counter } // Add performs no operation. func (Float64Counter) Add(context.Context, float64, ...metric.AddOption) {} // Enabled performs no operation. func (Float64Counter) Enabled(context.Context) bool { return false } // Int64UpDownCounter is an OpenTelemetry UpDownCounter used to record int64 // measurements. It produces no telemetry. type Int64UpDownCounter struct{ embedded.Int64UpDownCounter } // Add performs no operation. func (Int64UpDownCounter) Add(context.Context, int64, ...metric.AddOption) {} // Enabled performs no operation. func (Int64UpDownCounter) Enabled(context.Context) bool { return false } // Float64UpDownCounter is an OpenTelemetry UpDownCounter used to record // float64 measurements. It produces no telemetry. type Float64UpDownCounter struct{ embedded.Float64UpDownCounter } // Add performs no operation. func (Float64UpDownCounter) Add(context.Context, float64, ...metric.AddOption) {} // Enabled performs no operation. func (Float64UpDownCounter) Enabled(context.Context) bool { return false } // Int64Histogram is an OpenTelemetry Histogram used to record int64 // measurements. It produces no telemetry. type Int64Histogram struct{ embedded.Int64Histogram } // Record performs no operation. func (Int64Histogram) Record(context.Context, int64, ...metric.RecordOption) {} // Enabled performs no operation. func (Int64Histogram) Enabled(context.Context) bool { return false } // Float64Histogram is an OpenTelemetry Histogram used to record float64 // measurements. It produces no telemetry. type Float64Histogram struct{ embedded.Float64Histogram } // Record performs no operation. func (Float64Histogram) Record(context.Context, float64, ...metric.RecordOption) {} // Enabled performs no operation. func (Float64Histogram) Enabled(context.Context) bool { return false } // Int64Gauge is an OpenTelemetry Gauge used to record instantaneous int64 // measurements. It produces no telemetry. type Int64Gauge struct{ embedded.Int64Gauge } // Record performs no operation. func (Int64Gauge) Record(context.Context, int64, ...metric.RecordOption) {} // Enabled performs no operation. func (Int64Gauge) Enabled(context.Context) bool { return false } // Float64Gauge is an OpenTelemetry Gauge used to record instantaneous float64 // measurements. It produces no telemetry. type Float64Gauge struct{ embedded.Float64Gauge } // Record performs no operation. func (Float64Gauge) Record(context.Context, float64, ...metric.RecordOption) {} // Enabled performs no operation. func (Float64Gauge) Enabled(context.Context) bool { return false } // Int64ObservableCounter is an OpenTelemetry ObservableCounter used to record // int64 measurements. It produces no telemetry. type Int64ObservableCounter struct { metric.Int64Observable embedded.Int64ObservableCounter } // Float64ObservableCounter is an OpenTelemetry ObservableCounter used to record // float64 measurements. It produces no telemetry. type Float64ObservableCounter struct { metric.Float64Observable embedded.Float64ObservableCounter } // Int64ObservableGauge is an OpenTelemetry ObservableGauge used to record // int64 measurements. It produces no telemetry. type Int64ObservableGauge struct { metric.Int64Observable embedded.Int64ObservableGauge } // Float64ObservableGauge is an OpenTelemetry ObservableGauge used to record // float64 measurements. It produces no telemetry. type Float64ObservableGauge struct { metric.Float64Observable embedded.Float64ObservableGauge } // Int64ObservableUpDownCounter is an OpenTelemetry ObservableUpDownCounter // used to record int64 measurements. It produces no telemetry. type Int64ObservableUpDownCounter struct { metric.Int64Observable embedded.Int64ObservableUpDownCounter } // Float64ObservableUpDownCounter is an OpenTelemetry ObservableUpDownCounter // used to record float64 measurements. It produces no telemetry. type Float64ObservableUpDownCounter struct { metric.Float64Observable embedded.Float64ObservableUpDownCounter } // Int64Observer is a recorder of int64 measurements that performs no operation. type Int64Observer struct{ embedded.Int64Observer } // Observe performs no operation. func (Int64Observer) Observe(int64, ...metric.ObserveOption) {} // Float64Observer is a recorder of float64 measurements that performs no // operation. type Float64Observer struct{ embedded.Float64Observer } // Observe performs no operation. func (Float64Observer) Observe(float64, ...metric.ObserveOption) {} ================================================ FILE: vendor/go.opentelemetry.io/otel/metric/syncfloat64.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package metric // import "go.opentelemetry.io/otel/metric" import ( "context" "go.opentelemetry.io/otel/metric/embedded" ) // Float64Counter is an instrument that records increasing float64 values. // // Warning: Methods may be added to this interface in minor releases. See // package documentation on API implementation for information on how to set // default behavior for unimplemented methods. type Float64Counter interface { // Users of the interface can ignore this. This embedded type is only used // by implementations of this interface. See the "API Implementations" // section of the package documentation for more information. embedded.Float64Counter // Add records a change to the counter. // // Use the WithAttributeSet (or, if performance is not a concern, // the WithAttributes) option to include measurement attributes. Add(ctx context.Context, incr float64, options ...AddOption) // Enabled reports whether the instrument will process measurements for the given context. // // This function can be used in places where measuring an instrument // would result in computationally expensive operations. Enabled(context.Context) bool } // Float64CounterConfig contains options for synchronous counter instruments that // record float64 values. type Float64CounterConfig struct { description string unit string } // NewFloat64CounterConfig returns a new [Float64CounterConfig] with all opts // applied. func NewFloat64CounterConfig(opts ...Float64CounterOption) Float64CounterConfig { var config Float64CounterConfig for _, o := range opts { config = o.applyFloat64Counter(config) } return config } // Description returns the configured description. func (c Float64CounterConfig) Description() string { return c.description } // Unit returns the configured unit. func (c Float64CounterConfig) Unit() string { return c.unit } // Float64CounterOption applies options to a [Float64CounterConfig]. See // [InstrumentOption] for other options that can be used as a // Float64CounterOption. type Float64CounterOption interface { applyFloat64Counter(Float64CounterConfig) Float64CounterConfig } // Float64UpDownCounter is an instrument that records increasing or decreasing // float64 values. // // Warning: Methods may be added to this interface in minor releases. See // package documentation on API implementation for information on how to set // default behavior for unimplemented methods. type Float64UpDownCounter interface { // Users of the interface can ignore this. This embedded type is only used // by implementations of this interface. See the "API Implementations" // section of the package documentation for more information. embedded.Float64UpDownCounter // Add records a change to the counter. // // Use the WithAttributeSet (or, if performance is not a concern, // the WithAttributes) option to include measurement attributes. Add(ctx context.Context, incr float64, options ...AddOption) // Enabled reports whether the instrument will process measurements for the given context. // // This function can be used in places where measuring an instrument // would result in computationally expensive operations. Enabled(context.Context) bool } // Float64UpDownCounterConfig contains options for synchronous counter // instruments that record float64 values. type Float64UpDownCounterConfig struct { description string unit string } // NewFloat64UpDownCounterConfig returns a new [Float64UpDownCounterConfig] // with all opts applied. func NewFloat64UpDownCounterConfig(opts ...Float64UpDownCounterOption) Float64UpDownCounterConfig { var config Float64UpDownCounterConfig for _, o := range opts { config = o.applyFloat64UpDownCounter(config) } return config } // Description returns the configured description. func (c Float64UpDownCounterConfig) Description() string { return c.description } // Unit returns the configured unit. func (c Float64UpDownCounterConfig) Unit() string { return c.unit } // Float64UpDownCounterOption applies options to a // [Float64UpDownCounterConfig]. See [InstrumentOption] for other options that // can be used as a Float64UpDownCounterOption. type Float64UpDownCounterOption interface { applyFloat64UpDownCounter(Float64UpDownCounterConfig) Float64UpDownCounterConfig } // Float64Histogram is an instrument that records a distribution of float64 // values. // // Warning: Methods may be added to this interface in minor releases. See // package documentation on API implementation for information on how to set // default behavior for unimplemented methods. type Float64Histogram interface { // Users of the interface can ignore this. This embedded type is only used // by implementations of this interface. See the "API Implementations" // section of the package documentation for more information. embedded.Float64Histogram // Record adds an additional value to the distribution. // // Use the WithAttributeSet (or, if performance is not a concern, // the WithAttributes) option to include measurement attributes. Record(ctx context.Context, incr float64, options ...RecordOption) // Enabled reports whether the instrument will process measurements for the given context. // // This function can be used in places where measuring an instrument // would result in computationally expensive operations. Enabled(context.Context) bool } // Float64HistogramConfig contains options for synchronous histogram // instruments that record float64 values. type Float64HistogramConfig struct { description string unit string explicitBucketBoundaries []float64 } // NewFloat64HistogramConfig returns a new [Float64HistogramConfig] with all // opts applied. func NewFloat64HistogramConfig(opts ...Float64HistogramOption) Float64HistogramConfig { var config Float64HistogramConfig for _, o := range opts { config = o.applyFloat64Histogram(config) } return config } // Description returns the configured description. func (c Float64HistogramConfig) Description() string { return c.description } // Unit returns the configured unit. func (c Float64HistogramConfig) Unit() string { return c.unit } // ExplicitBucketBoundaries returns the configured explicit bucket boundaries. func (c Float64HistogramConfig) ExplicitBucketBoundaries() []float64 { return c.explicitBucketBoundaries } // Float64HistogramOption applies options to a [Float64HistogramConfig]. See // [InstrumentOption] for other options that can be used as a // Float64HistogramOption. type Float64HistogramOption interface { applyFloat64Histogram(Float64HistogramConfig) Float64HistogramConfig } // Float64Gauge is an instrument that records instantaneous float64 values. // // Warning: Methods may be added to this interface in minor releases. See // package documentation on API implementation for information on how to set // default behavior for unimplemented methods. type Float64Gauge interface { // Users of the interface can ignore this. This embedded type is only used // by implementations of this interface. See the "API Implementations" // section of the package documentation for more information. embedded.Float64Gauge // Record records the instantaneous value. // // Use the WithAttributeSet (or, if performance is not a concern, // the WithAttributes) option to include measurement attributes. Record(ctx context.Context, value float64, options ...RecordOption) // Enabled reports whether the instrument will process measurements for the given context. // // This function can be used in places where measuring an instrument // would result in computationally expensive operations. Enabled(context.Context) bool } // Float64GaugeConfig contains options for synchronous gauge instruments that // record float64 values. type Float64GaugeConfig struct { description string unit string } // NewFloat64GaugeConfig returns a new [Float64GaugeConfig] with all opts // applied. func NewFloat64GaugeConfig(opts ...Float64GaugeOption) Float64GaugeConfig { var config Float64GaugeConfig for _, o := range opts { config = o.applyFloat64Gauge(config) } return config } // Description returns the configured description. func (c Float64GaugeConfig) Description() string { return c.description } // Unit returns the configured unit. func (c Float64GaugeConfig) Unit() string { return c.unit } // Float64GaugeOption applies options to a [Float64GaugeConfig]. See // [InstrumentOption] for other options that can be used as a // Float64GaugeOption. type Float64GaugeOption interface { applyFloat64Gauge(Float64GaugeConfig) Float64GaugeConfig } ================================================ FILE: vendor/go.opentelemetry.io/otel/metric/syncint64.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package metric // import "go.opentelemetry.io/otel/metric" import ( "context" "go.opentelemetry.io/otel/metric/embedded" ) // Int64Counter is an instrument that records increasing int64 values. // // Warning: Methods may be added to this interface in minor releases. See // package documentation on API implementation for information on how to set // default behavior for unimplemented methods. type Int64Counter interface { // Users of the interface can ignore this. This embedded type is only used // by implementations of this interface. See the "API Implementations" // section of the package documentation for more information. embedded.Int64Counter // Add records a change to the counter. // // Use the WithAttributeSet (or, if performance is not a concern, // the WithAttributes) option to include measurement attributes. Add(ctx context.Context, incr int64, options ...AddOption) // Enabled reports whether the instrument will process measurements for the given context. // // This function can be used in places where measuring an instrument // would result in computationally expensive operations. Enabled(context.Context) bool } // Int64CounterConfig contains options for synchronous counter instruments that // record int64 values. type Int64CounterConfig struct { description string unit string } // NewInt64CounterConfig returns a new [Int64CounterConfig] with all opts // applied. func NewInt64CounterConfig(opts ...Int64CounterOption) Int64CounterConfig { var config Int64CounterConfig for _, o := range opts { config = o.applyInt64Counter(config) } return config } // Description returns the configured description. func (c Int64CounterConfig) Description() string { return c.description } // Unit returns the configured unit. func (c Int64CounterConfig) Unit() string { return c.unit } // Int64CounterOption applies options to a [Int64CounterConfig]. See // [InstrumentOption] for other options that can be used as an // Int64CounterOption. type Int64CounterOption interface { applyInt64Counter(Int64CounterConfig) Int64CounterConfig } // Int64UpDownCounter is an instrument that records increasing or decreasing // int64 values. // // Warning: Methods may be added to this interface in minor releases. See // package documentation on API implementation for information on how to set // default behavior for unimplemented methods. type Int64UpDownCounter interface { // Users of the interface can ignore this. This embedded type is only used // by implementations of this interface. See the "API Implementations" // section of the package documentation for more information. embedded.Int64UpDownCounter // Add records a change to the counter. // // Use the WithAttributeSet (or, if performance is not a concern, // the WithAttributes) option to include measurement attributes. Add(ctx context.Context, incr int64, options ...AddOption) // Enabled reports whether the instrument will process measurements for the given context. // // This function can be used in places where measuring an instrument // would result in computationally expensive operations. Enabled(context.Context) bool } // Int64UpDownCounterConfig contains options for synchronous counter // instruments that record int64 values. type Int64UpDownCounterConfig struct { description string unit string } // NewInt64UpDownCounterConfig returns a new [Int64UpDownCounterConfig] with // all opts applied. func NewInt64UpDownCounterConfig(opts ...Int64UpDownCounterOption) Int64UpDownCounterConfig { var config Int64UpDownCounterConfig for _, o := range opts { config = o.applyInt64UpDownCounter(config) } return config } // Description returns the configured description. func (c Int64UpDownCounterConfig) Description() string { return c.description } // Unit returns the configured unit. func (c Int64UpDownCounterConfig) Unit() string { return c.unit } // Int64UpDownCounterOption applies options to a [Int64UpDownCounterConfig]. // See [InstrumentOption] for other options that can be used as an // Int64UpDownCounterOption. type Int64UpDownCounterOption interface { applyInt64UpDownCounter(Int64UpDownCounterConfig) Int64UpDownCounterConfig } // Int64Histogram is an instrument that records a distribution of int64 // values. // // Warning: Methods may be added to this interface in minor releases. See // package documentation on API implementation for information on how to set // default behavior for unimplemented methods. type Int64Histogram interface { // Users of the interface can ignore this. This embedded type is only used // by implementations of this interface. See the "API Implementations" // section of the package documentation for more information. embedded.Int64Histogram // Record adds an additional value to the distribution. // // Use the WithAttributeSet (or, if performance is not a concern, // the WithAttributes) option to include measurement attributes. Record(ctx context.Context, incr int64, options ...RecordOption) // Enabled reports whether the instrument will process measurements for the given context. // // This function can be used in places where measuring an instrument // would result in computationally expensive operations. Enabled(context.Context) bool } // Int64HistogramConfig contains options for synchronous histogram instruments // that record int64 values. type Int64HistogramConfig struct { description string unit string explicitBucketBoundaries []float64 } // NewInt64HistogramConfig returns a new [Int64HistogramConfig] with all opts // applied. func NewInt64HistogramConfig(opts ...Int64HistogramOption) Int64HistogramConfig { var config Int64HistogramConfig for _, o := range opts { config = o.applyInt64Histogram(config) } return config } // Description returns the configured description. func (c Int64HistogramConfig) Description() string { return c.description } // Unit returns the configured unit. func (c Int64HistogramConfig) Unit() string { return c.unit } // ExplicitBucketBoundaries returns the configured explicit bucket boundaries. func (c Int64HistogramConfig) ExplicitBucketBoundaries() []float64 { return c.explicitBucketBoundaries } // Int64HistogramOption applies options to a [Int64HistogramConfig]. See // [InstrumentOption] for other options that can be used as an // Int64HistogramOption. type Int64HistogramOption interface { applyInt64Histogram(Int64HistogramConfig) Int64HistogramConfig } // Int64Gauge is an instrument that records instantaneous int64 values. // // Warning: Methods may be added to this interface in minor releases. See // package documentation on API implementation for information on how to set // default behavior for unimplemented methods. type Int64Gauge interface { // Users of the interface can ignore this. This embedded type is only used // by implementations of this interface. See the "API Implementations" // section of the package documentation for more information. embedded.Int64Gauge // Record records the instantaneous value. // // Use the WithAttributeSet (or, if performance is not a concern, // the WithAttributes) option to include measurement attributes. Record(ctx context.Context, value int64, options ...RecordOption) // Enabled reports whether the instrument will process measurements for the given context. // // This function can be used in places where measuring an instrument // would result in computationally expensive operations. Enabled(context.Context) bool } // Int64GaugeConfig contains options for synchronous gauge instruments that // record int64 values. type Int64GaugeConfig struct { description string unit string } // NewInt64GaugeConfig returns a new [Int64GaugeConfig] with all opts // applied. func NewInt64GaugeConfig(opts ...Int64GaugeOption) Int64GaugeConfig { var config Int64GaugeConfig for _, o := range opts { config = o.applyInt64Gauge(config) } return config } // Description returns the configured description. func (c Int64GaugeConfig) Description() string { return c.description } // Unit returns the configured unit. func (c Int64GaugeConfig) Unit() string { return c.unit } // Int64GaugeOption applies options to a [Int64GaugeConfig]. See // [InstrumentOption] for other options that can be used as a // Int64GaugeOption. type Int64GaugeOption interface { applyInt64Gauge(Int64GaugeConfig) Int64GaugeConfig } ================================================ FILE: vendor/go.opentelemetry.io/otel/metric.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package otel // import "go.opentelemetry.io/otel" import ( "go.opentelemetry.io/otel/internal/global" "go.opentelemetry.io/otel/metric" ) // Meter returns a Meter from the global MeterProvider. The name must be the // name of the library providing instrumentation. This name may be the same as // the instrumented code only if that code provides built-in instrumentation. // If the name is empty, then an implementation defined default name will be // used instead. // // If this is called before a global MeterProvider is registered the returned // Meter will be a No-op implementation of a Meter. When a global MeterProvider // is registered for the first time, the returned Meter, and all the // instruments it has created or will create, are recreated automatically from // the new MeterProvider. // // This is short for GetMeterProvider().Meter(name). func Meter(name string, opts ...metric.MeterOption) metric.Meter { return GetMeterProvider().Meter(name, opts...) } // GetMeterProvider returns the registered global meter provider. // // If no global GetMeterProvider has been registered, a No-op GetMeterProvider // implementation is returned. When a global GetMeterProvider is registered for // the first time, the returned GetMeterProvider, and all the Meters it has // created or will create, are recreated automatically from the new // GetMeterProvider. func GetMeterProvider() metric.MeterProvider { return global.MeterProvider() } // SetMeterProvider registers mp as the global MeterProvider. func SetMeterProvider(mp metric.MeterProvider) { global.SetMeterProvider(mp) } ================================================ FILE: vendor/go.opentelemetry.io/otel/propagation/README.md ================================================ # Propagation [![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/propagation)](https://pkg.go.dev/go.opentelemetry.io/otel/propagation) ================================================ FILE: vendor/go.opentelemetry.io/otel/propagation/baggage.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package propagation // import "go.opentelemetry.io/otel/propagation" import ( "context" "go.opentelemetry.io/otel/baggage" ) const baggageHeader = "baggage" // Baggage is a propagator that supports the W3C Baggage format. // // This propagates user-defined baggage associated with a trace. The complete // specification is defined at https://www.w3.org/TR/baggage/. type Baggage struct{} var _ TextMapPropagator = Baggage{} // Inject sets baggage key-values from ctx into the carrier. func (Baggage) Inject(ctx context.Context, carrier TextMapCarrier) { bStr := baggage.FromContext(ctx).String() if bStr != "" { carrier.Set(baggageHeader, bStr) } } // Extract returns a copy of parent with the baggage from the carrier added. // If carrier implements [ValuesGetter] (e.g. [HeaderCarrier]), Values is invoked // for multiple values extraction. Otherwise, Get is called. func (Baggage) Extract(parent context.Context, carrier TextMapCarrier) context.Context { if multiCarrier, ok := carrier.(ValuesGetter); ok { return extractMultiBaggage(parent, multiCarrier) } return extractSingleBaggage(parent, carrier) } // Fields returns the keys who's values are set with Inject. func (Baggage) Fields() []string { return []string{baggageHeader} } func extractSingleBaggage(parent context.Context, carrier TextMapCarrier) context.Context { bStr := carrier.Get(baggageHeader) if bStr == "" { return parent } bag, err := baggage.Parse(bStr) if err != nil { return parent } return baggage.ContextWithBaggage(parent, bag) } func extractMultiBaggage(parent context.Context, carrier ValuesGetter) context.Context { bVals := carrier.Values(baggageHeader) if len(bVals) == 0 { return parent } var members []baggage.Member for _, bStr := range bVals { currBag, err := baggage.Parse(bStr) if err != nil { continue } members = append(members, currBag.Members()...) } b, err := baggage.New(members...) if err != nil || b.Len() == 0 { return parent } return baggage.ContextWithBaggage(parent, b) } ================================================ FILE: vendor/go.opentelemetry.io/otel/propagation/doc.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 /* Package propagation contains OpenTelemetry context propagators. OpenTelemetry propagators are used to extract and inject context data from and into messages exchanged by applications. The propagator supported by this package is the W3C Trace Context encoding (https://www.w3.org/TR/trace-context/), and W3C Baggage (https://www.w3.org/TR/baggage/). */ package propagation // import "go.opentelemetry.io/otel/propagation" ================================================ FILE: vendor/go.opentelemetry.io/otel/propagation/propagation.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package propagation // import "go.opentelemetry.io/otel/propagation" import ( "context" "net/http" ) // TextMapCarrier is the storage medium used by a TextMapPropagator. // See ValuesGetter for how a TextMapCarrier can get multiple values for a key. type TextMapCarrier interface { // DO NOT CHANGE: any modification will not be backwards compatible and // must never be done outside of a new major release. // Get returns the value associated with the passed key. Get(key string) string // DO NOT CHANGE: any modification will not be backwards compatible and // must never be done outside of a new major release. // Set stores the key-value pair. Set(key, value string) // DO NOT CHANGE: any modification will not be backwards compatible and // must never be done outside of a new major release. // Keys lists the keys stored in this carrier. Keys() []string // DO NOT CHANGE: any modification will not be backwards compatible and // must never be done outside of a new major release. } // ValuesGetter can return multiple values for a single key, // with contrast to TextMapCarrier.Get which returns a single value. type ValuesGetter interface { // DO NOT CHANGE: any modification will not be backwards compatible and // must never be done outside of a new major release. // Values returns all values associated with the passed key. Values(key string) []string // DO NOT CHANGE: any modification will not be backwards compatible and // must never be done outside of a new major release. } // MapCarrier is a TextMapCarrier that uses a map held in memory as a storage // medium for propagated key-value pairs. type MapCarrier map[string]string // Compile time check that MapCarrier implements the TextMapCarrier. var _ TextMapCarrier = MapCarrier{} // Get returns the value associated with the passed key. func (c MapCarrier) Get(key string) string { return c[key] } // Set stores the key-value pair. func (c MapCarrier) Set(key, value string) { c[key] = value } // Keys lists the keys stored in this carrier. func (c MapCarrier) Keys() []string { keys := make([]string, 0, len(c)) for k := range c { keys = append(keys, k) } return keys } // HeaderCarrier adapts http.Header to satisfy the TextMapCarrier and ValuesGetter interfaces. type HeaderCarrier http.Header // Compile time check that HeaderCarrier implements ValuesGetter. var _ TextMapCarrier = HeaderCarrier{} // Compile time check that HeaderCarrier implements TextMapCarrier. var _ ValuesGetter = HeaderCarrier{} // Get returns the first value associated with the passed key. func (hc HeaderCarrier) Get(key string) string { return http.Header(hc).Get(key) } // Values returns all values associated with the passed key. func (hc HeaderCarrier) Values(key string) []string { return http.Header(hc).Values(key) } // Set stores the key-value pair. func (hc HeaderCarrier) Set(key, value string) { http.Header(hc).Set(key, value) } // Keys lists the keys stored in this carrier. func (hc HeaderCarrier) Keys() []string { keys := make([]string, 0, len(hc)) for k := range hc { keys = append(keys, k) } return keys } // TextMapPropagator propagates cross-cutting concerns as key-value text // pairs within a carrier that travels in-band across process boundaries. type TextMapPropagator interface { // DO NOT CHANGE: any modification will not be backwards compatible and // must never be done outside of a new major release. // Inject set cross-cutting concerns from the Context into the carrier. Inject(ctx context.Context, carrier TextMapCarrier) // DO NOT CHANGE: any modification will not be backwards compatible and // must never be done outside of a new major release. // Extract reads cross-cutting concerns from the carrier into a Context. // Implementations may check if the carrier implements ValuesGetter, // to support extraction of multiple values per key. Extract(ctx context.Context, carrier TextMapCarrier) context.Context // DO NOT CHANGE: any modification will not be backwards compatible and // must never be done outside of a new major release. // Fields returns the keys whose values are set with Inject. Fields() []string // DO NOT CHANGE: any modification will not be backwards compatible and // must never be done outside of a new major release. } type compositeTextMapPropagator []TextMapPropagator func (p compositeTextMapPropagator) Inject(ctx context.Context, carrier TextMapCarrier) { for _, i := range p { i.Inject(ctx, carrier) } } func (p compositeTextMapPropagator) Extract(ctx context.Context, carrier TextMapCarrier) context.Context { for _, i := range p { ctx = i.Extract(ctx, carrier) } return ctx } func (p compositeTextMapPropagator) Fields() []string { unique := make(map[string]struct{}) for _, i := range p { for _, k := range i.Fields() { unique[k] = struct{}{} } } fields := make([]string, 0, len(unique)) for k := range unique { fields = append(fields, k) } return fields } // NewCompositeTextMapPropagator returns a unified TextMapPropagator from the // group of passed TextMapPropagator. This allows different cross-cutting // concerns to be propagates in a unified manner. // // The returned TextMapPropagator will inject and extract cross-cutting // concerns in the order the TextMapPropagators were provided. Additionally, // the Fields method will return a de-duplicated slice of the keys that are // set with the Inject method. func NewCompositeTextMapPropagator(p ...TextMapPropagator) TextMapPropagator { return compositeTextMapPropagator(p) } ================================================ FILE: vendor/go.opentelemetry.io/otel/propagation/trace_context.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package propagation // import "go.opentelemetry.io/otel/propagation" import ( "context" "encoding/hex" "fmt" "strings" "go.opentelemetry.io/otel/trace" ) const ( supportedVersion = 0 maxVersion = 254 traceparentHeader = "traceparent" tracestateHeader = "tracestate" delimiter = "-" ) // TraceContext is a propagator that supports the W3C Trace Context format // (https://www.w3.org/TR/trace-context/) // // This propagator will propagate the traceparent and tracestate headers to // guarantee traces are not broken. It is up to the users of this propagator // to choose if they want to participate in a trace by modifying the // traceparent header and relevant parts of the tracestate header containing // their proprietary information. type TraceContext struct{} var ( _ TextMapPropagator = TraceContext{} versionPart = fmt.Sprintf("%.2X", supportedVersion) ) // Inject injects the trace context from ctx into carrier. func (TraceContext) Inject(ctx context.Context, carrier TextMapCarrier) { sc := trace.SpanContextFromContext(ctx) if !sc.IsValid() { return } if ts := sc.TraceState().String(); ts != "" { carrier.Set(tracestateHeader, ts) } // Clear all flags other than the trace-context supported sampling bit. flags := sc.TraceFlags() & trace.FlagsSampled var sb strings.Builder sb.Grow(2 + 32 + 16 + 2 + 3) _, _ = sb.WriteString(versionPart) traceID := sc.TraceID() spanID := sc.SpanID() flagByte := [1]byte{byte(flags)} var buf [32]byte for _, src := range [][]byte{traceID[:], spanID[:], flagByte[:]} { _ = sb.WriteByte(delimiter[0]) n := hex.Encode(buf[:], src) _, _ = sb.Write(buf[:n]) } carrier.Set(traceparentHeader, sb.String()) } // Extract reads tracecontext from the carrier into a returned Context. // // The returned Context will be a copy of ctx and contain the extracted // tracecontext as the remote SpanContext. If the extracted tracecontext is // invalid, the passed ctx will be returned directly instead. func (tc TraceContext) Extract(ctx context.Context, carrier TextMapCarrier) context.Context { sc := tc.extract(carrier) if !sc.IsValid() { return ctx } return trace.ContextWithRemoteSpanContext(ctx, sc) } func (TraceContext) extract(carrier TextMapCarrier) trace.SpanContext { h := carrier.Get(traceparentHeader) if h == "" { return trace.SpanContext{} } var ver [1]byte if !extractPart(ver[:], &h, 2) { return trace.SpanContext{} } version := int(ver[0]) if version > maxVersion { return trace.SpanContext{} } var scc trace.SpanContextConfig if !extractPart(scc.TraceID[:], &h, 32) { return trace.SpanContext{} } if !extractPart(scc.SpanID[:], &h, 16) { return trace.SpanContext{} } var opts [1]byte if !extractPart(opts[:], &h, 2) { return trace.SpanContext{} } if version == 0 && (h != "" || opts[0] > 2) { // version 0 not allow extra // version 0 not allow other flag return trace.SpanContext{} } // Clear all flags other than the trace-context supported sampling bit. scc.TraceFlags = trace.TraceFlags(opts[0]) & trace.FlagsSampled // nolint:gosec // slice size already checked. // Ignore the error returned here. Failure to parse tracestate MUST NOT // affect the parsing of traceparent according to the W3C tracecontext // specification. scc.TraceState, _ = trace.ParseTraceState(carrier.Get(tracestateHeader)) scc.Remote = true sc := trace.NewSpanContext(scc) if !sc.IsValid() { return trace.SpanContext{} } return sc } // upperHex detect hex is upper case Unicode characters. func upperHex(v string) bool { for _, c := range v { if c >= 'A' && c <= 'F' { return true } } return false } func extractPart(dst []byte, h *string, n int) bool { part, left, _ := strings.Cut(*h, delimiter) *h = left // hex.Decode decodes unsupported upper-case characters, so exclude explicitly. if len(part) != n || upperHex(part) { return false } if p, err := hex.Decode(dst, []byte(part)); err != nil || p != n/2 { return false } return true } // Fields returns the keys who's values are set with Inject. func (TraceContext) Fields() []string { return []string{traceparentHeader, tracestateHeader} } ================================================ FILE: vendor/go.opentelemetry.io/otel/propagation.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package otel // import "go.opentelemetry.io/otel" import ( "go.opentelemetry.io/otel/internal/global" "go.opentelemetry.io/otel/propagation" ) // GetTextMapPropagator returns the global TextMapPropagator. If none has been // set, a No-Op TextMapPropagator is returned. func GetTextMapPropagator() propagation.TextMapPropagator { return global.TextMapPropagator() } // SetTextMapPropagator sets propagator as the global TextMapPropagator. func SetTextMapPropagator(propagator propagation.TextMapPropagator) { global.SetTextMapPropagator(propagator) } ================================================ FILE: vendor/go.opentelemetry.io/otel/renovate.json ================================================ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": [ "config:best-practices", "helpers:pinGitHubActionDigestsToSemver" ], "ignorePaths": [], "labels": ["Skip Changelog", "dependencies"], "postUpdateOptions" : [ "gomodTidy" ], "packageRules": [ { "matchManagers": ["gomod"], "matchDepTypes": ["indirect"], "enabled": true }, { "matchPackageNames": ["go.opentelemetry.io/build-tools/**"], "groupName": "build-tools" }, { "matchPackageNames": ["google.golang.org/genproto/googleapis/**"], "groupName": "googleapis" }, { "matchPackageNames": ["golang.org/x/**"], "groupName": "golang.org/x" }, { "matchPackageNames": ["go.opentelemetry.io/otel/sdk/log/logtest"], "enabled": false } ] } ================================================ FILE: vendor/go.opentelemetry.io/otel/requirements.txt ================================================ codespell==2.4.1 ================================================ FILE: vendor/go.opentelemetry.io/otel/semconv/v1.37.0/MIGRATION.md ================================================ # Migration from v1.36.0 to v1.37.0 The `go.opentelemetry.io/otel/semconv/v1.37.0` package should be a drop-in replacement for `go.opentelemetry.io/otel/semconv/v1.36.0` with the following exceptions. ## Removed The following declarations have been removed. Refer to the [OpenTelemetry Semantic Conventions documentation] for deprecation instructions. If the type is not listed in the documentation as deprecated, it has been removed in this version due to lack of applicability or use. If you use any of these non-deprecated declarations in your Go application, please [open an issue] describing your use-case. - `ContainerRuntime` - `ContainerRuntimeKey` - `GenAIOpenAIRequestServiceTierAuto` - `GenAIOpenAIRequestServiceTierDefault` - `GenAIOpenAIRequestServiceTierKey` - `GenAIOpenAIResponseServiceTier` - `GenAIOpenAIResponseServiceTierKey` - `GenAIOpenAIResponseSystemFingerprint` - `GenAIOpenAIResponseSystemFingerprintKey` - `GenAISystemAWSBedrock` - `GenAISystemAnthropic` - `GenAISystemAzureAIInference` - `GenAISystemAzureAIOpenAI` - `GenAISystemCohere` - `GenAISystemDeepseek` - `GenAISystemGCPGemini` - `GenAISystemGCPGenAI` - `GenAISystemGCPVertexAI` - `GenAISystemGroq` - `GenAISystemIBMWatsonxAI` - `GenAISystemKey` - `GenAISystemMistralAI` - `GenAISystemOpenAI` - `GenAISystemPerplexity` - `GenAISystemXai` [OpenTelemetry Semantic Conventions documentation]: https://github.com/open-telemetry/semantic-conventions [open an issue]: https://github.com/open-telemetry/opentelemetry-go/issues/new?template=Blank+issue ================================================ FILE: vendor/go.opentelemetry.io/otel/semconv/v1.37.0/README.md ================================================ # Semconv v1.37.0 [![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/semconv/v1.37.0)](https://pkg.go.dev/go.opentelemetry.io/otel/semconv/v1.37.0) ================================================ FILE: vendor/go.opentelemetry.io/otel/semconv/v1.37.0/attribute_group.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 // Code generated from semantic convention specification. DO NOT EDIT. package semconv // import "go.opentelemetry.io/otel/semconv/v1.37.0" import "go.opentelemetry.io/otel/attribute" // Namespace: android const ( // AndroidAppStateKey is the attribute Key conforming to the "android.app.state" // semantic conventions. It represents the this attribute represents the state // of the application. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "created" // Note: The Android lifecycle states are defined in // [Activity lifecycle callbacks], and from which the `OS identifiers` are // derived. // // [Activity lifecycle callbacks]: https://developer.android.com/guide/components/activities/activity-lifecycle#lc AndroidAppStateKey = attribute.Key("android.app.state") // AndroidOSAPILevelKey is the attribute Key conforming to the // "android.os.api_level" semantic conventions. It represents the uniquely // identifies the framework API revision offered by a version (`os.version`) of // the android operating system. More information can be found in the // [Android API levels documentation]. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "33", "32" // // [Android API levels documentation]: https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels AndroidOSAPILevelKey = attribute.Key("android.os.api_level") ) // AndroidOSAPILevel returns an attribute KeyValue conforming to the // "android.os.api_level" semantic conventions. It represents the uniquely // identifies the framework API revision offered by a version (`os.version`) of // the android operating system. More information can be found in the // [Android API levels documentation]. // // [Android API levels documentation]: https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels func AndroidOSAPILevel(val string) attribute.KeyValue { return AndroidOSAPILevelKey.String(val) } // Enum values for android.app.state var ( // Any time before Activity.onResume() or, if the app has no Activity, // Context.startService() has been called in the app for the first time. // // Stability: development AndroidAppStateCreated = AndroidAppStateKey.String("created") // Any time after Activity.onPause() or, if the app has no Activity, // Context.stopService() has been called when the app was in the foreground // state. // // Stability: development AndroidAppStateBackground = AndroidAppStateKey.String("background") // Any time after Activity.onResume() or, if the app has no Activity, // Context.startService() has been called when the app was in either the created // or background states. // // Stability: development AndroidAppStateForeground = AndroidAppStateKey.String("foreground") ) // Namespace: app const ( // AppBuildIDKey is the attribute Key conforming to the "app.build_id" semantic // conventions. It represents the unique identifier for a particular build or // compilation of the application. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "6cff0a7e-cefc-4668-96f5-1273d8b334d0", // "9f2b833506aa6973a92fde9733e6271f", "my-app-1.0.0-code-123" AppBuildIDKey = attribute.Key("app.build_id") // AppInstallationIDKey is the attribute Key conforming to the // "app.installation.id" semantic conventions. It represents a unique identifier // representing the installation of an application on a specific device. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "2ab2916d-a51f-4ac8-80ee-45ac31a28092" // Note: Its value SHOULD persist across launches of the same application // installation, including through application upgrades. // It SHOULD change if the application is uninstalled or if all applications of // the vendor are uninstalled. // Additionally, users might be able to reset this value (e.g. by clearing // application data). // If an app is installed multiple times on the same device (e.g. in different // accounts on Android), each `app.installation.id` SHOULD have a different // value. // If multiple OpenTelemetry SDKs are used within the same application, they // SHOULD use the same value for `app.installation.id`. // Hardware IDs (e.g. serial number, IMEI, MAC address) MUST NOT be used as the // `app.installation.id`. // // For iOS, this value SHOULD be equal to the [vendor identifier]. // // For Android, examples of `app.installation.id` implementations include: // // - [Firebase Installation ID]. // - A globally unique UUID which is persisted across sessions in your // application. // - [App set ID]. // - [`Settings.getString(Settings.Secure.ANDROID_ID)`]. // // More information about Android identifier best practices can be found in the // [Android user data IDs guide]. // // [vendor identifier]: https://developer.apple.com/documentation/uikit/uidevice/identifierforvendor // [Firebase Installation ID]: https://firebase.google.com/docs/projects/manage-installations // [App set ID]: https://developer.android.com/identity/app-set-id // [`Settings.getString(Settings.Secure.ANDROID_ID)`]: https://developer.android.com/reference/android/provider/Settings.Secure#ANDROID_ID // [Android user data IDs guide]: https://developer.android.com/training/articles/user-data-ids AppInstallationIDKey = attribute.Key("app.installation.id") // AppJankFrameCountKey is the attribute Key conforming to the // "app.jank.frame_count" semantic conventions. It represents a number of frame // renders that experienced jank. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 9, 42 // Note: Depending on platform limitations, the value provided MAY be // approximation. AppJankFrameCountKey = attribute.Key("app.jank.frame_count") // AppJankPeriodKey is the attribute Key conforming to the "app.jank.period" // semantic conventions. It represents the time period, in seconds, for which // this jank is being reported. // // Type: double // RequirementLevel: Recommended // Stability: Development // // Examples: 1.0, 5.0, 10.24 AppJankPeriodKey = attribute.Key("app.jank.period") // AppJankThresholdKey is the attribute Key conforming to the // "app.jank.threshold" semantic conventions. It represents the minimum // rendering threshold for this jank, in seconds. // // Type: double // RequirementLevel: Recommended // Stability: Development // // Examples: 0.016, 0.7, 1.024 AppJankThresholdKey = attribute.Key("app.jank.threshold") // AppScreenCoordinateXKey is the attribute Key conforming to the // "app.screen.coordinate.x" semantic conventions. It represents the x // (horizontal) coordinate of a screen coordinate, in screen pixels. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 0, 131 AppScreenCoordinateXKey = attribute.Key("app.screen.coordinate.x") // AppScreenCoordinateYKey is the attribute Key conforming to the // "app.screen.coordinate.y" semantic conventions. It represents the y // (vertical) component of a screen coordinate, in screen pixels. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 12, 99 AppScreenCoordinateYKey = attribute.Key("app.screen.coordinate.y") // AppWidgetIDKey is the attribute Key conforming to the "app.widget.id" // semantic conventions. It represents an identifier that uniquely // differentiates this widget from other widgets in the same application. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "f9bc787d-ff05-48ad-90e1-fca1d46130b3", "submit_order_1829" // Note: A widget is an application component, typically an on-screen visual GUI // element. AppWidgetIDKey = attribute.Key("app.widget.id") // AppWidgetNameKey is the attribute Key conforming to the "app.widget.name" // semantic conventions. It represents the name of an application widget. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "submit", "attack", "Clear Cart" // Note: A widget is an application component, typically an on-screen visual GUI // element. AppWidgetNameKey = attribute.Key("app.widget.name") ) // AppBuildID returns an attribute KeyValue conforming to the "app.build_id" // semantic conventions. It represents the unique identifier for a particular // build or compilation of the application. func AppBuildID(val string) attribute.KeyValue { return AppBuildIDKey.String(val) } // AppInstallationID returns an attribute KeyValue conforming to the // "app.installation.id" semantic conventions. It represents a unique identifier // representing the installation of an application on a specific device. func AppInstallationID(val string) attribute.KeyValue { return AppInstallationIDKey.String(val) } // AppJankFrameCount returns an attribute KeyValue conforming to the // "app.jank.frame_count" semantic conventions. It represents a number of frame // renders that experienced jank. func AppJankFrameCount(val int) attribute.KeyValue { return AppJankFrameCountKey.Int(val) } // AppJankPeriod returns an attribute KeyValue conforming to the // "app.jank.period" semantic conventions. It represents the time period, in // seconds, for which this jank is being reported. func AppJankPeriod(val float64) attribute.KeyValue { return AppJankPeriodKey.Float64(val) } // AppJankThreshold returns an attribute KeyValue conforming to the // "app.jank.threshold" semantic conventions. It represents the minimum rendering // threshold for this jank, in seconds. func AppJankThreshold(val float64) attribute.KeyValue { return AppJankThresholdKey.Float64(val) } // AppScreenCoordinateX returns an attribute KeyValue conforming to the // "app.screen.coordinate.x" semantic conventions. It represents the x // (horizontal) coordinate of a screen coordinate, in screen pixels. func AppScreenCoordinateX(val int) attribute.KeyValue { return AppScreenCoordinateXKey.Int(val) } // AppScreenCoordinateY returns an attribute KeyValue conforming to the // "app.screen.coordinate.y" semantic conventions. It represents the y (vertical) // component of a screen coordinate, in screen pixels. func AppScreenCoordinateY(val int) attribute.KeyValue { return AppScreenCoordinateYKey.Int(val) } // AppWidgetID returns an attribute KeyValue conforming to the "app.widget.id" // semantic conventions. It represents an identifier that uniquely differentiates // this widget from other widgets in the same application. func AppWidgetID(val string) attribute.KeyValue { return AppWidgetIDKey.String(val) } // AppWidgetName returns an attribute KeyValue conforming to the // "app.widget.name" semantic conventions. It represents the name of an // application widget. func AppWidgetName(val string) attribute.KeyValue { return AppWidgetNameKey.String(val) } // Namespace: artifact const ( // ArtifactAttestationFilenameKey is the attribute Key conforming to the // "artifact.attestation.filename" semantic conventions. It represents the // provenance filename of the built attestation which directly relates to the // build artifact filename. This filename SHOULD accompany the artifact at // publish time. See the [SLSA Relationship] specification for more information. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "golang-binary-amd64-v0.1.0.attestation", // "docker-image-amd64-v0.1.0.intoto.json1", "release-1.tar.gz.attestation", // "file-name-package.tar.gz.intoto.json1" // // [SLSA Relationship]: https://slsa.dev/spec/v1.0/distributing-provenance#relationship-between-artifacts-and-attestations ArtifactAttestationFilenameKey = attribute.Key("artifact.attestation.filename") // ArtifactAttestationHashKey is the attribute Key conforming to the // "artifact.attestation.hash" semantic conventions. It represents the full // [hash value (see glossary)], of the built attestation. Some envelopes in the // [software attestation space] also refer to this as the **digest**. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "1b31dfcd5b7f9267bf2ff47651df1cfb9147b9e4df1f335accf65b4cda498408" // // [hash value (see glossary)]: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf // [software attestation space]: https://github.com/in-toto/attestation/tree/main/spec ArtifactAttestationHashKey = attribute.Key("artifact.attestation.hash") // ArtifactAttestationIDKey is the attribute Key conforming to the // "artifact.attestation.id" semantic conventions. It represents the id of the // build [software attestation]. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "123" // // [software attestation]: https://slsa.dev/attestation-model ArtifactAttestationIDKey = attribute.Key("artifact.attestation.id") // ArtifactFilenameKey is the attribute Key conforming to the // "artifact.filename" semantic conventions. It represents the human readable // file name of the artifact, typically generated during build and release // processes. Often includes the package name and version in the file name. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "golang-binary-amd64-v0.1.0", "docker-image-amd64-v0.1.0", // "release-1.tar.gz", "file-name-package.tar.gz" // Note: This file name can also act as the [Package Name] // in cases where the package ecosystem maps accordingly. // Additionally, the artifact [can be published] // for others, but that is not a guarantee. // // [Package Name]: https://slsa.dev/spec/v1.0/terminology#package-model // [can be published]: https://slsa.dev/spec/v1.0/terminology#software-supply-chain ArtifactFilenameKey = attribute.Key("artifact.filename") // ArtifactHashKey is the attribute Key conforming to the "artifact.hash" // semantic conventions. It represents the full [hash value (see glossary)], // often found in checksum.txt on a release of the artifact and used to verify // package integrity. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "9ff4c52759e2c4ac70b7d517bc7fcdc1cda631ca0045271ddd1b192544f8a3e9" // Note: The specific algorithm used to create the cryptographic hash value is // not defined. In situations where an artifact has multiple // cryptographic hashes, it is up to the implementer to choose which // hash value to set here; this should be the most secure hash algorithm // that is suitable for the situation and consistent with the // corresponding attestation. The implementer can then provide the other // hash values through an additional set of attribute extensions as they // deem necessary. // // [hash value (see glossary)]: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf ArtifactHashKey = attribute.Key("artifact.hash") // ArtifactPurlKey is the attribute Key conforming to the "artifact.purl" // semantic conventions. It represents the [Package URL] of the // [package artifact] provides a standard way to identify and locate the // packaged artifact. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "pkg:github/package-url/purl-spec@1209109710924", // "pkg:npm/foo@12.12.3" // // [Package URL]: https://github.com/package-url/purl-spec // [package artifact]: https://slsa.dev/spec/v1.0/terminology#package-model ArtifactPurlKey = attribute.Key("artifact.purl") // ArtifactVersionKey is the attribute Key conforming to the "artifact.version" // semantic conventions. It represents the version of the artifact. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "v0.1.0", "1.2.1", "122691-build" ArtifactVersionKey = attribute.Key("artifact.version") ) // ArtifactAttestationFilename returns an attribute KeyValue conforming to the // "artifact.attestation.filename" semantic conventions. It represents the // provenance filename of the built attestation which directly relates to the // build artifact filename. This filename SHOULD accompany the artifact at // publish time. See the [SLSA Relationship] specification for more information. // // [SLSA Relationship]: https://slsa.dev/spec/v1.0/distributing-provenance#relationship-between-artifacts-and-attestations func ArtifactAttestationFilename(val string) attribute.KeyValue { return ArtifactAttestationFilenameKey.String(val) } // ArtifactAttestationHash returns an attribute KeyValue conforming to the // "artifact.attestation.hash" semantic conventions. It represents the full // [hash value (see glossary)], of the built attestation. Some envelopes in the // [software attestation space] also refer to this as the **digest**. // // [hash value (see glossary)]: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf // [software attestation space]: https://github.com/in-toto/attestation/tree/main/spec func ArtifactAttestationHash(val string) attribute.KeyValue { return ArtifactAttestationHashKey.String(val) } // ArtifactAttestationID returns an attribute KeyValue conforming to the // "artifact.attestation.id" semantic conventions. It represents the id of the // build [software attestation]. // // [software attestation]: https://slsa.dev/attestation-model func ArtifactAttestationID(val string) attribute.KeyValue { return ArtifactAttestationIDKey.String(val) } // ArtifactFilename returns an attribute KeyValue conforming to the // "artifact.filename" semantic conventions. It represents the human readable // file name of the artifact, typically generated during build and release // processes. Often includes the package name and version in the file name. func ArtifactFilename(val string) attribute.KeyValue { return ArtifactFilenameKey.String(val) } // ArtifactHash returns an attribute KeyValue conforming to the "artifact.hash" // semantic conventions. It represents the full [hash value (see glossary)], // often found in checksum.txt on a release of the artifact and used to verify // package integrity. // // [hash value (see glossary)]: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf func ArtifactHash(val string) attribute.KeyValue { return ArtifactHashKey.String(val) } // ArtifactPurl returns an attribute KeyValue conforming to the "artifact.purl" // semantic conventions. It represents the [Package URL] of the // [package artifact] provides a standard way to identify and locate the packaged // artifact. // // [Package URL]: https://github.com/package-url/purl-spec // [package artifact]: https://slsa.dev/spec/v1.0/terminology#package-model func ArtifactPurl(val string) attribute.KeyValue { return ArtifactPurlKey.String(val) } // ArtifactVersion returns an attribute KeyValue conforming to the // "artifact.version" semantic conventions. It represents the version of the // artifact. func ArtifactVersion(val string) attribute.KeyValue { return ArtifactVersionKey.String(val) } // Namespace: aws const ( // AWSBedrockGuardrailIDKey is the attribute Key conforming to the // "aws.bedrock.guardrail.id" semantic conventions. It represents the unique // identifier of the AWS Bedrock Guardrail. A [guardrail] helps safeguard and // prevent unwanted behavior from model responses or user messages. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "sgi5gkybzqak" // // [guardrail]: https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails.html AWSBedrockGuardrailIDKey = attribute.Key("aws.bedrock.guardrail.id") // AWSBedrockKnowledgeBaseIDKey is the attribute Key conforming to the // "aws.bedrock.knowledge_base.id" semantic conventions. It represents the // unique identifier of the AWS Bedrock Knowledge base. A [knowledge base] is a // bank of information that can be queried by models to generate more relevant // responses and augment prompts. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "XFWUPB9PAW" // // [knowledge base]: https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base.html AWSBedrockKnowledgeBaseIDKey = attribute.Key("aws.bedrock.knowledge_base.id") // AWSDynamoDBAttributeDefinitionsKey is the attribute Key conforming to the // "aws.dynamodb.attribute_definitions" semantic conventions. It represents the // JSON-serialized value of each item in the `AttributeDefinitions` request // field. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "{ "AttributeName": "string", "AttributeType": "string" }" AWSDynamoDBAttributeDefinitionsKey = attribute.Key("aws.dynamodb.attribute_definitions") // AWSDynamoDBAttributesToGetKey is the attribute Key conforming to the // "aws.dynamodb.attributes_to_get" semantic conventions. It represents the // value of the `AttributesToGet` request parameter. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "lives", "id" AWSDynamoDBAttributesToGetKey = attribute.Key("aws.dynamodb.attributes_to_get") // AWSDynamoDBConsistentReadKey is the attribute Key conforming to the // "aws.dynamodb.consistent_read" semantic conventions. It represents the value // of the `ConsistentRead` request parameter. // // Type: boolean // RequirementLevel: Recommended // Stability: Development // // Examples: AWSDynamoDBConsistentReadKey = attribute.Key("aws.dynamodb.consistent_read") // AWSDynamoDBConsumedCapacityKey is the attribute Key conforming to the // "aws.dynamodb.consumed_capacity" semantic conventions. It represents the // JSON-serialized value of each item in the `ConsumedCapacity` response field. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "{ "CapacityUnits": number, "GlobalSecondaryIndexes": { "string" : // { "CapacityUnits": number, "ReadCapacityUnits": number, "WriteCapacityUnits": // number } }, "LocalSecondaryIndexes": { "string" : { "CapacityUnits": number, // "ReadCapacityUnits": number, "WriteCapacityUnits": number } }, // "ReadCapacityUnits": number, "Table": { "CapacityUnits": number, // "ReadCapacityUnits": number, "WriteCapacityUnits": number }, "TableName": // "string", "WriteCapacityUnits": number }" AWSDynamoDBConsumedCapacityKey = attribute.Key("aws.dynamodb.consumed_capacity") // AWSDynamoDBCountKey is the attribute Key conforming to the // "aws.dynamodb.count" semantic conventions. It represents the value of the // `Count` response parameter. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 10 AWSDynamoDBCountKey = attribute.Key("aws.dynamodb.count") // AWSDynamoDBExclusiveStartTableKey is the attribute Key conforming to the // "aws.dynamodb.exclusive_start_table" semantic conventions. It represents the // value of the `ExclusiveStartTableName` request parameter. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Users", "CatsTable" AWSDynamoDBExclusiveStartTableKey = attribute.Key("aws.dynamodb.exclusive_start_table") // AWSDynamoDBGlobalSecondaryIndexUpdatesKey is the attribute Key conforming to // the "aws.dynamodb.global_secondary_index_updates" semantic conventions. It // represents the JSON-serialized value of each item in the // `GlobalSecondaryIndexUpdates` request field. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "{ "Create": { "IndexName": "string", "KeySchema": [ { // "AttributeName": "string", "KeyType": "string" } ], "Projection": { // "NonKeyAttributes": [ "string" ], "ProjectionType": "string" }, // "ProvisionedThroughput": { "ReadCapacityUnits": number, "WriteCapacityUnits": // number } }" AWSDynamoDBGlobalSecondaryIndexUpdatesKey = attribute.Key("aws.dynamodb.global_secondary_index_updates") // AWSDynamoDBGlobalSecondaryIndexesKey is the attribute Key conforming to the // "aws.dynamodb.global_secondary_indexes" semantic conventions. It represents // the JSON-serialized value of each item of the `GlobalSecondaryIndexes` // request field. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "{ "IndexName": "string", "KeySchema": [ { "AttributeName": // "string", "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [ // "string" ], "ProjectionType": "string" }, "ProvisionedThroughput": { // "ReadCapacityUnits": number, "WriteCapacityUnits": number } }" AWSDynamoDBGlobalSecondaryIndexesKey = attribute.Key("aws.dynamodb.global_secondary_indexes") // AWSDynamoDBIndexNameKey is the attribute Key conforming to the // "aws.dynamodb.index_name" semantic conventions. It represents the value of // the `IndexName` request parameter. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "name_to_group" AWSDynamoDBIndexNameKey = attribute.Key("aws.dynamodb.index_name") // AWSDynamoDBItemCollectionMetricsKey is the attribute Key conforming to the // "aws.dynamodb.item_collection_metrics" semantic conventions. It represents // the JSON-serialized value of the `ItemCollectionMetrics` response field. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "{ "string" : [ { "ItemCollectionKey": { "string" : { "B": blob, // "BOOL": boolean, "BS": [ blob ], "L": [ "AttributeValue" ], "M": { "string" : // "AttributeValue" }, "N": "string", "NS": [ "string" ], "NULL": boolean, "S": // "string", "SS": [ "string" ] } }, "SizeEstimateRangeGB": [ number ] } ] }" AWSDynamoDBItemCollectionMetricsKey = attribute.Key("aws.dynamodb.item_collection_metrics") // AWSDynamoDBLimitKey is the attribute Key conforming to the // "aws.dynamodb.limit" semantic conventions. It represents the value of the // `Limit` request parameter. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 10 AWSDynamoDBLimitKey = attribute.Key("aws.dynamodb.limit") // AWSDynamoDBLocalSecondaryIndexesKey is the attribute Key conforming to the // "aws.dynamodb.local_secondary_indexes" semantic conventions. It represents // the JSON-serialized value of each item of the `LocalSecondaryIndexes` request // field. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "{ "IndexArn": "string", "IndexName": "string", "IndexSizeBytes": // number, "ItemCount": number, "KeySchema": [ { "AttributeName": "string", // "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [ "string" ], // "ProjectionType": "string" } }" AWSDynamoDBLocalSecondaryIndexesKey = attribute.Key("aws.dynamodb.local_secondary_indexes") // AWSDynamoDBProjectionKey is the attribute Key conforming to the // "aws.dynamodb.projection" semantic conventions. It represents the value of // the `ProjectionExpression` request parameter. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Title", "Title, Price, Color", "Title, Description, RelatedItems, // ProductReviews" AWSDynamoDBProjectionKey = attribute.Key("aws.dynamodb.projection") // AWSDynamoDBProvisionedReadCapacityKey is the attribute Key conforming to the // "aws.dynamodb.provisioned_read_capacity" semantic conventions. It represents // the value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. // // Type: double // RequirementLevel: Recommended // Stability: Development // // Examples: 1.0, 2.0 AWSDynamoDBProvisionedReadCapacityKey = attribute.Key("aws.dynamodb.provisioned_read_capacity") // AWSDynamoDBProvisionedWriteCapacityKey is the attribute Key conforming to the // "aws.dynamodb.provisioned_write_capacity" semantic conventions. It represents // the value of the `ProvisionedThroughput.WriteCapacityUnits` request // parameter. // // Type: double // RequirementLevel: Recommended // Stability: Development // // Examples: 1.0, 2.0 AWSDynamoDBProvisionedWriteCapacityKey = attribute.Key("aws.dynamodb.provisioned_write_capacity") // AWSDynamoDBScanForwardKey is the attribute Key conforming to the // "aws.dynamodb.scan_forward" semantic conventions. It represents the value of // the `ScanIndexForward` request parameter. // // Type: boolean // RequirementLevel: Recommended // Stability: Development // // Examples: AWSDynamoDBScanForwardKey = attribute.Key("aws.dynamodb.scan_forward") // AWSDynamoDBScannedCountKey is the attribute Key conforming to the // "aws.dynamodb.scanned_count" semantic conventions. It represents the value of // the `ScannedCount` response parameter. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 50 AWSDynamoDBScannedCountKey = attribute.Key("aws.dynamodb.scanned_count") // AWSDynamoDBSegmentKey is the attribute Key conforming to the // "aws.dynamodb.segment" semantic conventions. It represents the value of the // `Segment` request parameter. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 10 AWSDynamoDBSegmentKey = attribute.Key("aws.dynamodb.segment") // AWSDynamoDBSelectKey is the attribute Key conforming to the // "aws.dynamodb.select" semantic conventions. It represents the value of the // `Select` request parameter. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "ALL_ATTRIBUTES", "COUNT" AWSDynamoDBSelectKey = attribute.Key("aws.dynamodb.select") // AWSDynamoDBTableCountKey is the attribute Key conforming to the // "aws.dynamodb.table_count" semantic conventions. It represents the number of // items in the `TableNames` response parameter. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 20 AWSDynamoDBTableCountKey = attribute.Key("aws.dynamodb.table_count") // AWSDynamoDBTableNamesKey is the attribute Key conforming to the // "aws.dynamodb.table_names" semantic conventions. It represents the keys in // the `RequestItems` object field. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "Users", "Cats" AWSDynamoDBTableNamesKey = attribute.Key("aws.dynamodb.table_names") // AWSDynamoDBTotalSegmentsKey is the attribute Key conforming to the // "aws.dynamodb.total_segments" semantic conventions. It represents the value // of the `TotalSegments` request parameter. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 100 AWSDynamoDBTotalSegmentsKey = attribute.Key("aws.dynamodb.total_segments") // AWSECSClusterARNKey is the attribute Key conforming to the // "aws.ecs.cluster.arn" semantic conventions. It represents the ARN of an // [ECS cluster]. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster" // // [ECS cluster]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html AWSECSClusterARNKey = attribute.Key("aws.ecs.cluster.arn") // AWSECSContainerARNKey is the attribute Key conforming to the // "aws.ecs.container.arn" semantic conventions. It represents the Amazon // Resource Name (ARN) of an [ECS container instance]. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: // "arn:aws:ecs:us-west-1:123456789123:container/32624152-9086-4f0e-acae-1a75b14fe4d9" // // [ECS container instance]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html AWSECSContainerARNKey = attribute.Key("aws.ecs.container.arn") // AWSECSLaunchtypeKey is the attribute Key conforming to the // "aws.ecs.launchtype" semantic conventions. It represents the [launch type] // for an ECS task. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // // [launch type]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html AWSECSLaunchtypeKey = attribute.Key("aws.ecs.launchtype") // AWSECSTaskARNKey is the attribute Key conforming to the "aws.ecs.task.arn" // semantic conventions. It represents the ARN of a running [ECS task]. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: // "arn:aws:ecs:us-west-1:123456789123:task/10838bed-421f-43ef-870a-f43feacbbb5b", // "arn:aws:ecs:us-west-1:123456789123:task/my-cluster/task-id/23ebb8ac-c18f-46c6-8bbe-d55d0e37cfbd" // // [ECS task]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#ecs-resource-ids AWSECSTaskARNKey = attribute.Key("aws.ecs.task.arn") // AWSECSTaskFamilyKey is the attribute Key conforming to the // "aws.ecs.task.family" semantic conventions. It represents the family name of // the [ECS task definition] used to create the ECS task. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "opentelemetry-family" // // [ECS task definition]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html AWSECSTaskFamilyKey = attribute.Key("aws.ecs.task.family") // AWSECSTaskIDKey is the attribute Key conforming to the "aws.ecs.task.id" // semantic conventions. It represents the ID of a running ECS task. The ID MUST // be extracted from `task.arn`. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "10838bed-421f-43ef-870a-f43feacbbb5b", // "23ebb8ac-c18f-46c6-8bbe-d55d0e37cfbd" AWSECSTaskIDKey = attribute.Key("aws.ecs.task.id") // AWSECSTaskRevisionKey is the attribute Key conforming to the // "aws.ecs.task.revision" semantic conventions. It represents the revision for // the task definition used to create the ECS task. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "8", "26" AWSECSTaskRevisionKey = attribute.Key("aws.ecs.task.revision") // AWSEKSClusterARNKey is the attribute Key conforming to the // "aws.eks.cluster.arn" semantic conventions. It represents the ARN of an EKS // cluster. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster" AWSEKSClusterARNKey = attribute.Key("aws.eks.cluster.arn") // AWSExtendedRequestIDKey is the attribute Key conforming to the // "aws.extended_request_id" semantic conventions. It represents the AWS // extended request ID as returned in the response header `x-amz-id-2`. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: // "wzHcyEWfmOGDIE5QOhTAqFDoDWP3y8IUvpNINCwL9N4TEHbUw0/gZJ+VZTmCNCWR7fezEN3eCiQ=" AWSExtendedRequestIDKey = attribute.Key("aws.extended_request_id") // AWSKinesisStreamNameKey is the attribute Key conforming to the // "aws.kinesis.stream_name" semantic conventions. It represents the name of the // AWS Kinesis [stream] the request refers to. Corresponds to the // `--stream-name` parameter of the Kinesis [describe-stream] operation. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "some-stream-name" // // [stream]: https://docs.aws.amazon.com/streams/latest/dev/introduction.html // [describe-stream]: https://docs.aws.amazon.com/cli/latest/reference/kinesis/describe-stream.html AWSKinesisStreamNameKey = attribute.Key("aws.kinesis.stream_name") // AWSLambdaInvokedARNKey is the attribute Key conforming to the // "aws.lambda.invoked_arn" semantic conventions. It represents the full invoked // ARN as provided on the `Context` passed to the function ( // `Lambda-Runtime-Invoked-Function-Arn` header on the // `/runtime/invocation/next` applicable). // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "arn:aws:lambda:us-east-1:123456:function:myfunction:myalias" // Note: This may be different from `cloud.resource_id` if an alias is involved. AWSLambdaInvokedARNKey = attribute.Key("aws.lambda.invoked_arn") // AWSLambdaResourceMappingIDKey is the attribute Key conforming to the // "aws.lambda.resource_mapping.id" semantic conventions. It represents the UUID // of the [AWS Lambda EvenSource Mapping]. An event source is mapped to a lambda // function. It's contents are read by Lambda and used to trigger a function. // This isn't available in the lambda execution context or the lambda runtime // environtment. This is going to be populated by the AWS SDK for each language // when that UUID is present. Some of these operations are // Create/Delete/Get/List/Update EventSourceMapping. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "587ad24b-03b9-4413-8202-bbd56b36e5b7" // // [AWS Lambda EvenSource Mapping]: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html AWSLambdaResourceMappingIDKey = attribute.Key("aws.lambda.resource_mapping.id") // AWSLogGroupARNsKey is the attribute Key conforming to the // "aws.log.group.arns" semantic conventions. It represents the Amazon Resource // Name(s) (ARN) of the AWS log group(s). // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:*" // Note: See the [log group ARN format documentation]. // // [log group ARN format documentation]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format AWSLogGroupARNsKey = attribute.Key("aws.log.group.arns") // AWSLogGroupNamesKey is the attribute Key conforming to the // "aws.log.group.names" semantic conventions. It represents the name(s) of the // AWS log group(s) an application is writing to. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "/aws/lambda/my-function", "opentelemetry-service" // Note: Multiple log groups must be supported for cases like multi-container // applications, where a single application has sidecar containers, and each // write to their own log group. AWSLogGroupNamesKey = attribute.Key("aws.log.group.names") // AWSLogStreamARNsKey is the attribute Key conforming to the // "aws.log.stream.arns" semantic conventions. It represents the ARN(s) of the // AWS log stream(s). // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: // "arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:log-stream:logs/main/10838bed-421f-43ef-870a-f43feacbbb5b" // Note: See the [log stream ARN format documentation]. One log group can // contain several log streams, so these ARNs necessarily identify both a log // group and a log stream. // // [log stream ARN format documentation]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format AWSLogStreamARNsKey = attribute.Key("aws.log.stream.arns") // AWSLogStreamNamesKey is the attribute Key conforming to the // "aws.log.stream.names" semantic conventions. It represents the name(s) of the // AWS log stream(s) an application is writing to. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "logs/main/10838bed-421f-43ef-870a-f43feacbbb5b" AWSLogStreamNamesKey = attribute.Key("aws.log.stream.names") // AWSRequestIDKey is the attribute Key conforming to the "aws.request_id" // semantic conventions. It represents the AWS request ID as returned in the // response headers `x-amzn-requestid`, `x-amzn-request-id` or // `x-amz-request-id`. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "79b9da39-b7ae-508a-a6bc-864b2829c622", "C9ER4AJX75574TDJ" AWSRequestIDKey = attribute.Key("aws.request_id") // AWSS3BucketKey is the attribute Key conforming to the "aws.s3.bucket" // semantic conventions. It represents the S3 bucket name the request refers to. // Corresponds to the `--bucket` parameter of the [S3 API] operations. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "some-bucket-name" // Note: The `bucket` attribute is applicable to all S3 operations that // reference a bucket, i.e. that require the bucket name as a mandatory // parameter. // This applies to almost all S3 operations except `list-buckets`. // // [S3 API]: https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html AWSS3BucketKey = attribute.Key("aws.s3.bucket") // AWSS3CopySourceKey is the attribute Key conforming to the // "aws.s3.copy_source" semantic conventions. It represents the source object // (in the form `bucket`/`key`) for the copy operation. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "someFile.yml" // Note: The `copy_source` attribute applies to S3 copy operations and // corresponds to the `--copy-source` parameter // of the [copy-object operation within the S3 API]. // This applies in particular to the following operations: // // - [copy-object] // - [upload-part-copy] // // // [copy-object operation within the S3 API]: https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html // [copy-object]: https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html // [upload-part-copy]: https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html AWSS3CopySourceKey = attribute.Key("aws.s3.copy_source") // AWSS3DeleteKey is the attribute Key conforming to the "aws.s3.delete" // semantic conventions. It represents the delete request container that // specifies the objects to be deleted. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: // "Objects=[{Key=string,VersionId=string},{Key=string,VersionId=string}],Quiet=boolean" // Note: The `delete` attribute is only applicable to the [delete-object] // operation. // The `delete` attribute corresponds to the `--delete` parameter of the // [delete-objects operation within the S3 API]. // // [delete-object]: https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html // [delete-objects operation within the S3 API]: https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-objects.html AWSS3DeleteKey = attribute.Key("aws.s3.delete") // AWSS3KeyKey is the attribute Key conforming to the "aws.s3.key" semantic // conventions. It represents the S3 object key the request refers to. // Corresponds to the `--key` parameter of the [S3 API] operations. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "someFile.yml" // Note: The `key` attribute is applicable to all object-related S3 operations, // i.e. that require the object key as a mandatory parameter. // This applies in particular to the following operations: // // - [copy-object] // - [delete-object] // - [get-object] // - [head-object] // - [put-object] // - [restore-object] // - [select-object-content] // - [abort-multipart-upload] // - [complete-multipart-upload] // - [create-multipart-upload] // - [list-parts] // - [upload-part] // - [upload-part-copy] // // // [S3 API]: https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html // [copy-object]: https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html // [delete-object]: https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html // [get-object]: https://docs.aws.amazon.com/cli/latest/reference/s3api/get-object.html // [head-object]: https://docs.aws.amazon.com/cli/latest/reference/s3api/head-object.html // [put-object]: https://docs.aws.amazon.com/cli/latest/reference/s3api/put-object.html // [restore-object]: https://docs.aws.amazon.com/cli/latest/reference/s3api/restore-object.html // [select-object-content]: https://docs.aws.amazon.com/cli/latest/reference/s3api/select-object-content.html // [abort-multipart-upload]: https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html // [complete-multipart-upload]: https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html // [create-multipart-upload]: https://docs.aws.amazon.com/cli/latest/reference/s3api/create-multipart-upload.html // [list-parts]: https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html // [upload-part]: https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html // [upload-part-copy]: https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html AWSS3KeyKey = attribute.Key("aws.s3.key") // AWSS3PartNumberKey is the attribute Key conforming to the // "aws.s3.part_number" semantic conventions. It represents the part number of // the part being uploaded in a multipart-upload operation. This is a positive // integer between 1 and 10,000. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 3456 // Note: The `part_number` attribute is only applicable to the [upload-part] // and [upload-part-copy] operations. // The `part_number` attribute corresponds to the `--part-number` parameter of // the // [upload-part operation within the S3 API]. // // [upload-part]: https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html // [upload-part-copy]: https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html // [upload-part operation within the S3 API]: https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html AWSS3PartNumberKey = attribute.Key("aws.s3.part_number") // AWSS3UploadIDKey is the attribute Key conforming to the "aws.s3.upload_id" // semantic conventions. It represents the upload ID that identifies the // multipart upload. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "dfRtDYWFbkRONycy.Yxwh66Yjlx.cph0gtNBtJ" // Note: The `upload_id` attribute applies to S3 multipart-upload operations and // corresponds to the `--upload-id` parameter // of the [S3 API] multipart operations. // This applies in particular to the following operations: // // - [abort-multipart-upload] // - [complete-multipart-upload] // - [list-parts] // - [upload-part] // - [upload-part-copy] // // // [S3 API]: https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html // [abort-multipart-upload]: https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html // [complete-multipart-upload]: https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html // [list-parts]: https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html // [upload-part]: https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html // [upload-part-copy]: https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html AWSS3UploadIDKey = attribute.Key("aws.s3.upload_id") // AWSSecretsmanagerSecretARNKey is the attribute Key conforming to the // "aws.secretsmanager.secret.arn" semantic conventions. It represents the ARN // of the Secret stored in the Secrets Mangger. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: // "arn:aws:secretsmanager:us-east-1:123456789012:secret:SecretName-6RandomCharacters" AWSSecretsmanagerSecretARNKey = attribute.Key("aws.secretsmanager.secret.arn") // AWSSNSTopicARNKey is the attribute Key conforming to the "aws.sns.topic.arn" // semantic conventions. It represents the ARN of the AWS SNS Topic. An Amazon // SNS [topic] is a logical access point that acts as a communication channel. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "arn:aws:sns:us-east-1:123456789012:mystack-mytopic-NZJ5JSMVGFIE" // // [topic]: https://docs.aws.amazon.com/sns/latest/dg/sns-create-topic.html AWSSNSTopicARNKey = attribute.Key("aws.sns.topic.arn") // AWSSQSQueueURLKey is the attribute Key conforming to the "aws.sqs.queue.url" // semantic conventions. It represents the URL of the AWS SQS Queue. It's a // unique identifier for a queue in Amazon Simple Queue Service (SQS) and is // used to access the queue and perform actions on it. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "https://sqs.us-east-1.amazonaws.com/123456789012/MyQueue" AWSSQSQueueURLKey = attribute.Key("aws.sqs.queue.url") // AWSStepFunctionsActivityARNKey is the attribute Key conforming to the // "aws.step_functions.activity.arn" semantic conventions. It represents the ARN // of the AWS Step Functions Activity. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "arn:aws:states:us-east-1:123456789012:activity:get-greeting" AWSStepFunctionsActivityARNKey = attribute.Key("aws.step_functions.activity.arn") // AWSStepFunctionsStateMachineARNKey is the attribute Key conforming to the // "aws.step_functions.state_machine.arn" semantic conventions. It represents // the ARN of the AWS Step Functions State Machine. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: // "arn:aws:states:us-east-1:123456789012:stateMachine:myStateMachine:1" AWSStepFunctionsStateMachineARNKey = attribute.Key("aws.step_functions.state_machine.arn") ) // AWSBedrockGuardrailID returns an attribute KeyValue conforming to the // "aws.bedrock.guardrail.id" semantic conventions. It represents the unique // identifier of the AWS Bedrock Guardrail. A [guardrail] helps safeguard and // prevent unwanted behavior from model responses or user messages. // // [guardrail]: https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails.html func AWSBedrockGuardrailID(val string) attribute.KeyValue { return AWSBedrockGuardrailIDKey.String(val) } // AWSBedrockKnowledgeBaseID returns an attribute KeyValue conforming to the // "aws.bedrock.knowledge_base.id" semantic conventions. It represents the unique // identifier of the AWS Bedrock Knowledge base. A [knowledge base] is a bank of // information that can be queried by models to generate more relevant responses // and augment prompts. // // [knowledge base]: https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base.html func AWSBedrockKnowledgeBaseID(val string) attribute.KeyValue { return AWSBedrockKnowledgeBaseIDKey.String(val) } // AWSDynamoDBAttributeDefinitions returns an attribute KeyValue conforming to // the "aws.dynamodb.attribute_definitions" semantic conventions. It represents // the JSON-serialized value of each item in the `AttributeDefinitions` request // field. func AWSDynamoDBAttributeDefinitions(val ...string) attribute.KeyValue { return AWSDynamoDBAttributeDefinitionsKey.StringSlice(val) } // AWSDynamoDBAttributesToGet returns an attribute KeyValue conforming to the // "aws.dynamodb.attributes_to_get" semantic conventions. It represents the value // of the `AttributesToGet` request parameter. func AWSDynamoDBAttributesToGet(val ...string) attribute.KeyValue { return AWSDynamoDBAttributesToGetKey.StringSlice(val) } // AWSDynamoDBConsistentRead returns an attribute KeyValue conforming to the // "aws.dynamodb.consistent_read" semantic conventions. It represents the value // of the `ConsistentRead` request parameter. func AWSDynamoDBConsistentRead(val bool) attribute.KeyValue { return AWSDynamoDBConsistentReadKey.Bool(val) } // AWSDynamoDBConsumedCapacity returns an attribute KeyValue conforming to the // "aws.dynamodb.consumed_capacity" semantic conventions. It represents the // JSON-serialized value of each item in the `ConsumedCapacity` response field. func AWSDynamoDBConsumedCapacity(val ...string) attribute.KeyValue { return AWSDynamoDBConsumedCapacityKey.StringSlice(val) } // AWSDynamoDBCount returns an attribute KeyValue conforming to the // "aws.dynamodb.count" semantic conventions. It represents the value of the // `Count` response parameter. func AWSDynamoDBCount(val int) attribute.KeyValue { return AWSDynamoDBCountKey.Int(val) } // AWSDynamoDBExclusiveStartTable returns an attribute KeyValue conforming to the // "aws.dynamodb.exclusive_start_table" semantic conventions. It represents the // value of the `ExclusiveStartTableName` request parameter. func AWSDynamoDBExclusiveStartTable(val string) attribute.KeyValue { return AWSDynamoDBExclusiveStartTableKey.String(val) } // AWSDynamoDBGlobalSecondaryIndexUpdates returns an attribute KeyValue // conforming to the "aws.dynamodb.global_secondary_index_updates" semantic // conventions. It represents the JSON-serialized value of each item in the // `GlobalSecondaryIndexUpdates` request field. func AWSDynamoDBGlobalSecondaryIndexUpdates(val ...string) attribute.KeyValue { return AWSDynamoDBGlobalSecondaryIndexUpdatesKey.StringSlice(val) } // AWSDynamoDBGlobalSecondaryIndexes returns an attribute KeyValue conforming to // the "aws.dynamodb.global_secondary_indexes" semantic conventions. It // represents the JSON-serialized value of each item of the // `GlobalSecondaryIndexes` request field. func AWSDynamoDBGlobalSecondaryIndexes(val ...string) attribute.KeyValue { return AWSDynamoDBGlobalSecondaryIndexesKey.StringSlice(val) } // AWSDynamoDBIndexName returns an attribute KeyValue conforming to the // "aws.dynamodb.index_name" semantic conventions. It represents the value of the // `IndexName` request parameter. func AWSDynamoDBIndexName(val string) attribute.KeyValue { return AWSDynamoDBIndexNameKey.String(val) } // AWSDynamoDBItemCollectionMetrics returns an attribute KeyValue conforming to // the "aws.dynamodb.item_collection_metrics" semantic conventions. It represents // the JSON-serialized value of the `ItemCollectionMetrics` response field. func AWSDynamoDBItemCollectionMetrics(val string) attribute.KeyValue { return AWSDynamoDBItemCollectionMetricsKey.String(val) } // AWSDynamoDBLimit returns an attribute KeyValue conforming to the // "aws.dynamodb.limit" semantic conventions. It represents the value of the // `Limit` request parameter. func AWSDynamoDBLimit(val int) attribute.KeyValue { return AWSDynamoDBLimitKey.Int(val) } // AWSDynamoDBLocalSecondaryIndexes returns an attribute KeyValue conforming to // the "aws.dynamodb.local_secondary_indexes" semantic conventions. It represents // the JSON-serialized value of each item of the `LocalSecondaryIndexes` request // field. func AWSDynamoDBLocalSecondaryIndexes(val ...string) attribute.KeyValue { return AWSDynamoDBLocalSecondaryIndexesKey.StringSlice(val) } // AWSDynamoDBProjection returns an attribute KeyValue conforming to the // "aws.dynamodb.projection" semantic conventions. It represents the value of the // `ProjectionExpression` request parameter. func AWSDynamoDBProjection(val string) attribute.KeyValue { return AWSDynamoDBProjectionKey.String(val) } // AWSDynamoDBProvisionedReadCapacity returns an attribute KeyValue conforming to // the "aws.dynamodb.provisioned_read_capacity" semantic conventions. It // represents the value of the `ProvisionedThroughput.ReadCapacityUnits` request // parameter. func AWSDynamoDBProvisionedReadCapacity(val float64) attribute.KeyValue { return AWSDynamoDBProvisionedReadCapacityKey.Float64(val) } // AWSDynamoDBProvisionedWriteCapacity returns an attribute KeyValue conforming // to the "aws.dynamodb.provisioned_write_capacity" semantic conventions. It // represents the value of the `ProvisionedThroughput.WriteCapacityUnits` request // parameter. func AWSDynamoDBProvisionedWriteCapacity(val float64) attribute.KeyValue { return AWSDynamoDBProvisionedWriteCapacityKey.Float64(val) } // AWSDynamoDBScanForward returns an attribute KeyValue conforming to the // "aws.dynamodb.scan_forward" semantic conventions. It represents the value of // the `ScanIndexForward` request parameter. func AWSDynamoDBScanForward(val bool) attribute.KeyValue { return AWSDynamoDBScanForwardKey.Bool(val) } // AWSDynamoDBScannedCount returns an attribute KeyValue conforming to the // "aws.dynamodb.scanned_count" semantic conventions. It represents the value of // the `ScannedCount` response parameter. func AWSDynamoDBScannedCount(val int) attribute.KeyValue { return AWSDynamoDBScannedCountKey.Int(val) } // AWSDynamoDBSegment returns an attribute KeyValue conforming to the // "aws.dynamodb.segment" semantic conventions. It represents the value of the // `Segment` request parameter. func AWSDynamoDBSegment(val int) attribute.KeyValue { return AWSDynamoDBSegmentKey.Int(val) } // AWSDynamoDBSelect returns an attribute KeyValue conforming to the // "aws.dynamodb.select" semantic conventions. It represents the value of the // `Select` request parameter. func AWSDynamoDBSelect(val string) attribute.KeyValue { return AWSDynamoDBSelectKey.String(val) } // AWSDynamoDBTableCount returns an attribute KeyValue conforming to the // "aws.dynamodb.table_count" semantic conventions. It represents the number of // items in the `TableNames` response parameter. func AWSDynamoDBTableCount(val int) attribute.KeyValue { return AWSDynamoDBTableCountKey.Int(val) } // AWSDynamoDBTableNames returns an attribute KeyValue conforming to the // "aws.dynamodb.table_names" semantic conventions. It represents the keys in the // `RequestItems` object field. func AWSDynamoDBTableNames(val ...string) attribute.KeyValue { return AWSDynamoDBTableNamesKey.StringSlice(val) } // AWSDynamoDBTotalSegments returns an attribute KeyValue conforming to the // "aws.dynamodb.total_segments" semantic conventions. It represents the value of // the `TotalSegments` request parameter. func AWSDynamoDBTotalSegments(val int) attribute.KeyValue { return AWSDynamoDBTotalSegmentsKey.Int(val) } // AWSECSClusterARN returns an attribute KeyValue conforming to the // "aws.ecs.cluster.arn" semantic conventions. It represents the ARN of an // [ECS cluster]. // // [ECS cluster]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html func AWSECSClusterARN(val string) attribute.KeyValue { return AWSECSClusterARNKey.String(val) } // AWSECSContainerARN returns an attribute KeyValue conforming to the // "aws.ecs.container.arn" semantic conventions. It represents the Amazon // Resource Name (ARN) of an [ECS container instance]. // // [ECS container instance]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html func AWSECSContainerARN(val string) attribute.KeyValue { return AWSECSContainerARNKey.String(val) } // AWSECSTaskARN returns an attribute KeyValue conforming to the // "aws.ecs.task.arn" semantic conventions. It represents the ARN of a running // [ECS task]. // // [ECS task]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#ecs-resource-ids func AWSECSTaskARN(val string) attribute.KeyValue { return AWSECSTaskARNKey.String(val) } // AWSECSTaskFamily returns an attribute KeyValue conforming to the // "aws.ecs.task.family" semantic conventions. It represents the family name of // the [ECS task definition] used to create the ECS task. // // [ECS task definition]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html func AWSECSTaskFamily(val string) attribute.KeyValue { return AWSECSTaskFamilyKey.String(val) } // AWSECSTaskID returns an attribute KeyValue conforming to the "aws.ecs.task.id" // semantic conventions. It represents the ID of a running ECS task. The ID MUST // be extracted from `task.arn`. func AWSECSTaskID(val string) attribute.KeyValue { return AWSECSTaskIDKey.String(val) } // AWSECSTaskRevision returns an attribute KeyValue conforming to the // "aws.ecs.task.revision" semantic conventions. It represents the revision for // the task definition used to create the ECS task. func AWSECSTaskRevision(val string) attribute.KeyValue { return AWSECSTaskRevisionKey.String(val) } // AWSEKSClusterARN returns an attribute KeyValue conforming to the // "aws.eks.cluster.arn" semantic conventions. It represents the ARN of an EKS // cluster. func AWSEKSClusterARN(val string) attribute.KeyValue { return AWSEKSClusterARNKey.String(val) } // AWSExtendedRequestID returns an attribute KeyValue conforming to the // "aws.extended_request_id" semantic conventions. It represents the AWS extended // request ID as returned in the response header `x-amz-id-2`. func AWSExtendedRequestID(val string) attribute.KeyValue { return AWSExtendedRequestIDKey.String(val) } // AWSKinesisStreamName returns an attribute KeyValue conforming to the // "aws.kinesis.stream_name" semantic conventions. It represents the name of the // AWS Kinesis [stream] the request refers to. Corresponds to the `--stream-name` // parameter of the Kinesis [describe-stream] operation. // // [stream]: https://docs.aws.amazon.com/streams/latest/dev/introduction.html // [describe-stream]: https://docs.aws.amazon.com/cli/latest/reference/kinesis/describe-stream.html func AWSKinesisStreamName(val string) attribute.KeyValue { return AWSKinesisStreamNameKey.String(val) } // AWSLambdaInvokedARN returns an attribute KeyValue conforming to the // "aws.lambda.invoked_arn" semantic conventions. It represents the full invoked // ARN as provided on the `Context` passed to the function ( // `Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` // applicable). func AWSLambdaInvokedARN(val string) attribute.KeyValue { return AWSLambdaInvokedARNKey.String(val) } // AWSLambdaResourceMappingID returns an attribute KeyValue conforming to the // "aws.lambda.resource_mapping.id" semantic conventions. It represents the UUID // of the [AWS Lambda EvenSource Mapping]. An event source is mapped to a lambda // function. It's contents are read by Lambda and used to trigger a function. // This isn't available in the lambda execution context or the lambda runtime // environtment. This is going to be populated by the AWS SDK for each language // when that UUID is present. Some of these operations are // Create/Delete/Get/List/Update EventSourceMapping. // // [AWS Lambda EvenSource Mapping]: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html func AWSLambdaResourceMappingID(val string) attribute.KeyValue { return AWSLambdaResourceMappingIDKey.String(val) } // AWSLogGroupARNs returns an attribute KeyValue conforming to the // "aws.log.group.arns" semantic conventions. It represents the Amazon Resource // Name(s) (ARN) of the AWS log group(s). func AWSLogGroupARNs(val ...string) attribute.KeyValue { return AWSLogGroupARNsKey.StringSlice(val) } // AWSLogGroupNames returns an attribute KeyValue conforming to the // "aws.log.group.names" semantic conventions. It represents the name(s) of the // AWS log group(s) an application is writing to. func AWSLogGroupNames(val ...string) attribute.KeyValue { return AWSLogGroupNamesKey.StringSlice(val) } // AWSLogStreamARNs returns an attribute KeyValue conforming to the // "aws.log.stream.arns" semantic conventions. It represents the ARN(s) of the // AWS log stream(s). func AWSLogStreamARNs(val ...string) attribute.KeyValue { return AWSLogStreamARNsKey.StringSlice(val) } // AWSLogStreamNames returns an attribute KeyValue conforming to the // "aws.log.stream.names" semantic conventions. It represents the name(s) of the // AWS log stream(s) an application is writing to. func AWSLogStreamNames(val ...string) attribute.KeyValue { return AWSLogStreamNamesKey.StringSlice(val) } // AWSRequestID returns an attribute KeyValue conforming to the "aws.request_id" // semantic conventions. It represents the AWS request ID as returned in the // response headers `x-amzn-requestid`, `x-amzn-request-id` or `x-amz-request-id` // . func AWSRequestID(val string) attribute.KeyValue { return AWSRequestIDKey.String(val) } // AWSS3Bucket returns an attribute KeyValue conforming to the "aws.s3.bucket" // semantic conventions. It represents the S3 bucket name the request refers to. // Corresponds to the `--bucket` parameter of the [S3 API] operations. // // [S3 API]: https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html func AWSS3Bucket(val string) attribute.KeyValue { return AWSS3BucketKey.String(val) } // AWSS3CopySource returns an attribute KeyValue conforming to the // "aws.s3.copy_source" semantic conventions. It represents the source object (in // the form `bucket`/`key`) for the copy operation. func AWSS3CopySource(val string) attribute.KeyValue { return AWSS3CopySourceKey.String(val) } // AWSS3Delete returns an attribute KeyValue conforming to the "aws.s3.delete" // semantic conventions. It represents the delete request container that // specifies the objects to be deleted. func AWSS3Delete(val string) attribute.KeyValue { return AWSS3DeleteKey.String(val) } // AWSS3Key returns an attribute KeyValue conforming to the "aws.s3.key" semantic // conventions. It represents the S3 object key the request refers to. // Corresponds to the `--key` parameter of the [S3 API] operations. // // [S3 API]: https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html func AWSS3Key(val string) attribute.KeyValue { return AWSS3KeyKey.String(val) } // AWSS3PartNumber returns an attribute KeyValue conforming to the // "aws.s3.part_number" semantic conventions. It represents the part number of // the part being uploaded in a multipart-upload operation. This is a positive // integer between 1 and 10,000. func AWSS3PartNumber(val int) attribute.KeyValue { return AWSS3PartNumberKey.Int(val) } // AWSS3UploadID returns an attribute KeyValue conforming to the // "aws.s3.upload_id" semantic conventions. It represents the upload ID that // identifies the multipart upload. func AWSS3UploadID(val string) attribute.KeyValue { return AWSS3UploadIDKey.String(val) } // AWSSecretsmanagerSecretARN returns an attribute KeyValue conforming to the // "aws.secretsmanager.secret.arn" semantic conventions. It represents the ARN of // the Secret stored in the Secrets Mangger. func AWSSecretsmanagerSecretARN(val string) attribute.KeyValue { return AWSSecretsmanagerSecretARNKey.String(val) } // AWSSNSTopicARN returns an attribute KeyValue conforming to the // "aws.sns.topic.arn" semantic conventions. It represents the ARN of the AWS SNS // Topic. An Amazon SNS [topic] is a logical access point that acts as a // communication channel. // // [topic]: https://docs.aws.amazon.com/sns/latest/dg/sns-create-topic.html func AWSSNSTopicARN(val string) attribute.KeyValue { return AWSSNSTopicARNKey.String(val) } // AWSSQSQueueURL returns an attribute KeyValue conforming to the // "aws.sqs.queue.url" semantic conventions. It represents the URL of the AWS SQS // Queue. It's a unique identifier for a queue in Amazon Simple Queue Service // (SQS) and is used to access the queue and perform actions on it. func AWSSQSQueueURL(val string) attribute.KeyValue { return AWSSQSQueueURLKey.String(val) } // AWSStepFunctionsActivityARN returns an attribute KeyValue conforming to the // "aws.step_functions.activity.arn" semantic conventions. It represents the ARN // of the AWS Step Functions Activity. func AWSStepFunctionsActivityARN(val string) attribute.KeyValue { return AWSStepFunctionsActivityARNKey.String(val) } // AWSStepFunctionsStateMachineARN returns an attribute KeyValue conforming to // the "aws.step_functions.state_machine.arn" semantic conventions. It represents // the ARN of the AWS Step Functions State Machine. func AWSStepFunctionsStateMachineARN(val string) attribute.KeyValue { return AWSStepFunctionsStateMachineARNKey.String(val) } // Enum values for aws.ecs.launchtype var ( // Amazon EC2 // Stability: development AWSECSLaunchtypeEC2 = AWSECSLaunchtypeKey.String("ec2") // Amazon Fargate // Stability: development AWSECSLaunchtypeFargate = AWSECSLaunchtypeKey.String("fargate") ) // Namespace: azure const ( // AzureClientIDKey is the attribute Key conforming to the "azure.client.id" // semantic conventions. It represents the unique identifier of the client // instance. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "3ba4827d-4422-483f-b59f-85b74211c11d", "storage-client-1" AzureClientIDKey = attribute.Key("azure.client.id") // AzureCosmosDBConnectionModeKey is the attribute Key conforming to the // "azure.cosmosdb.connection.mode" semantic conventions. It represents the // cosmos client connection mode. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: AzureCosmosDBConnectionModeKey = attribute.Key("azure.cosmosdb.connection.mode") // AzureCosmosDBConsistencyLevelKey is the attribute Key conforming to the // "azure.cosmosdb.consistency.level" semantic conventions. It represents the // account or request [consistency level]. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "Eventual", "ConsistentPrefix", "BoundedStaleness", "Strong", // "Session" // // [consistency level]: https://learn.microsoft.com/azure/cosmos-db/consistency-levels AzureCosmosDBConsistencyLevelKey = attribute.Key("azure.cosmosdb.consistency.level") // AzureCosmosDBOperationContactedRegionsKey is the attribute Key conforming to // the "azure.cosmosdb.operation.contacted_regions" semantic conventions. It // represents the list of regions contacted during operation in the order that // they were contacted. If there is more than one region listed, it indicates // that the operation was performed on multiple regions i.e. cross-regional // call. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "North Central US", "Australia East", "Australia Southeast" // Note: Region name matches the format of `displayName` in [Azure Location API] // // [Azure Location API]: https://learn.microsoft.com/rest/api/subscription/subscriptions/list-locations?view=rest-subscription-2021-10-01&tabs=HTTP#location AzureCosmosDBOperationContactedRegionsKey = attribute.Key("azure.cosmosdb.operation.contacted_regions") // AzureCosmosDBOperationRequestChargeKey is the attribute Key conforming to the // "azure.cosmosdb.operation.request_charge" semantic conventions. It represents // the number of request units consumed by the operation. // // Type: double // RequirementLevel: Recommended // Stability: Development // // Examples: 46.18, 1.0 AzureCosmosDBOperationRequestChargeKey = attribute.Key("azure.cosmosdb.operation.request_charge") // AzureCosmosDBRequestBodySizeKey is the attribute Key conforming to the // "azure.cosmosdb.request.body.size" semantic conventions. It represents the // request payload size in bytes. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: AzureCosmosDBRequestBodySizeKey = attribute.Key("azure.cosmosdb.request.body.size") // AzureCosmosDBResponseSubStatusCodeKey is the attribute Key conforming to the // "azure.cosmosdb.response.sub_status_code" semantic conventions. It represents // the cosmos DB sub status code. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 1000, 1002 AzureCosmosDBResponseSubStatusCodeKey = attribute.Key("azure.cosmosdb.response.sub_status_code") // AzureResourceProviderNamespaceKey is the attribute Key conforming to the // "azure.resource_provider.namespace" semantic conventions. It represents the // [Azure Resource Provider Namespace] as recognized by the client. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Microsoft.Storage", "Microsoft.KeyVault", "Microsoft.ServiceBus" // // [Azure Resource Provider Namespace]: https://learn.microsoft.com/azure/azure-resource-manager/management/azure-services-resource-providers AzureResourceProviderNamespaceKey = attribute.Key("azure.resource_provider.namespace") // AzureServiceRequestIDKey is the attribute Key conforming to the // "azure.service.request.id" semantic conventions. It represents the unique // identifier of the service request. It's generated by the Azure service and // returned with the response. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "00000000-0000-0000-0000-000000000000" AzureServiceRequestIDKey = attribute.Key("azure.service.request.id") ) // AzureClientID returns an attribute KeyValue conforming to the // "azure.client.id" semantic conventions. It represents the unique identifier of // the client instance. func AzureClientID(val string) attribute.KeyValue { return AzureClientIDKey.String(val) } // AzureCosmosDBOperationContactedRegions returns an attribute KeyValue // conforming to the "azure.cosmosdb.operation.contacted_regions" semantic // conventions. It represents the list of regions contacted during operation in // the order that they were contacted. If there is more than one region listed, // it indicates that the operation was performed on multiple regions i.e. // cross-regional call. func AzureCosmosDBOperationContactedRegions(val ...string) attribute.KeyValue { return AzureCosmosDBOperationContactedRegionsKey.StringSlice(val) } // AzureCosmosDBOperationRequestCharge returns an attribute KeyValue conforming // to the "azure.cosmosdb.operation.request_charge" semantic conventions. It // represents the number of request units consumed by the operation. func AzureCosmosDBOperationRequestCharge(val float64) attribute.KeyValue { return AzureCosmosDBOperationRequestChargeKey.Float64(val) } // AzureCosmosDBRequestBodySize returns an attribute KeyValue conforming to the // "azure.cosmosdb.request.body.size" semantic conventions. It represents the // request payload size in bytes. func AzureCosmosDBRequestBodySize(val int) attribute.KeyValue { return AzureCosmosDBRequestBodySizeKey.Int(val) } // AzureCosmosDBResponseSubStatusCode returns an attribute KeyValue conforming to // the "azure.cosmosdb.response.sub_status_code" semantic conventions. It // represents the cosmos DB sub status code. func AzureCosmosDBResponseSubStatusCode(val int) attribute.KeyValue { return AzureCosmosDBResponseSubStatusCodeKey.Int(val) } // AzureResourceProviderNamespace returns an attribute KeyValue conforming to the // "azure.resource_provider.namespace" semantic conventions. It represents the // [Azure Resource Provider Namespace] as recognized by the client. // // [Azure Resource Provider Namespace]: https://learn.microsoft.com/azure/azure-resource-manager/management/azure-services-resource-providers func AzureResourceProviderNamespace(val string) attribute.KeyValue { return AzureResourceProviderNamespaceKey.String(val) } // AzureServiceRequestID returns an attribute KeyValue conforming to the // "azure.service.request.id" semantic conventions. It represents the unique // identifier of the service request. It's generated by the Azure service and // returned with the response. func AzureServiceRequestID(val string) attribute.KeyValue { return AzureServiceRequestIDKey.String(val) } // Enum values for azure.cosmosdb.connection.mode var ( // Gateway (HTTP) connection. // Stability: development AzureCosmosDBConnectionModeGateway = AzureCosmosDBConnectionModeKey.String("gateway") // Direct connection. // Stability: development AzureCosmosDBConnectionModeDirect = AzureCosmosDBConnectionModeKey.String("direct") ) // Enum values for azure.cosmosdb.consistency.level var ( // Strong // Stability: development AzureCosmosDBConsistencyLevelStrong = AzureCosmosDBConsistencyLevelKey.String("Strong") // Bounded Staleness // Stability: development AzureCosmosDBConsistencyLevelBoundedStaleness = AzureCosmosDBConsistencyLevelKey.String("BoundedStaleness") // Session // Stability: development AzureCosmosDBConsistencyLevelSession = AzureCosmosDBConsistencyLevelKey.String("Session") // Eventual // Stability: development AzureCosmosDBConsistencyLevelEventual = AzureCosmosDBConsistencyLevelKey.String("Eventual") // Consistent Prefix // Stability: development AzureCosmosDBConsistencyLevelConsistentPrefix = AzureCosmosDBConsistencyLevelKey.String("ConsistentPrefix") ) // Namespace: browser const ( // BrowserBrandsKey is the attribute Key conforming to the "browser.brands" // semantic conventions. It represents the array of brand name and version // separated by a space. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: " Not A;Brand 99", "Chromium 99", "Chrome 99" // Note: This value is intended to be taken from the [UA client hints API] ( // `navigator.userAgentData.brands`). // // [UA client hints API]: https://wicg.github.io/ua-client-hints/#interface BrowserBrandsKey = attribute.Key("browser.brands") // BrowserLanguageKey is the attribute Key conforming to the "browser.language" // semantic conventions. It represents the preferred language of the user using // the browser. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "en", "en-US", "fr", "fr-FR" // Note: This value is intended to be taken from the Navigator API // `navigator.language`. BrowserLanguageKey = attribute.Key("browser.language") // BrowserMobileKey is the attribute Key conforming to the "browser.mobile" // semantic conventions. It represents a boolean that is true if the browser is // running on a mobile device. // // Type: boolean // RequirementLevel: Recommended // Stability: Development // // Examples: // Note: This value is intended to be taken from the [UA client hints API] ( // `navigator.userAgentData.mobile`). If unavailable, this attribute SHOULD be // left unset. // // [UA client hints API]: https://wicg.github.io/ua-client-hints/#interface BrowserMobileKey = attribute.Key("browser.mobile") // BrowserPlatformKey is the attribute Key conforming to the "browser.platform" // semantic conventions. It represents the platform on which the browser is // running. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Windows", "macOS", "Android" // Note: This value is intended to be taken from the [UA client hints API] ( // `navigator.userAgentData.platform`). If unavailable, the legacy // `navigator.platform` API SHOULD NOT be used instead and this attribute SHOULD // be left unset in order for the values to be consistent. // The list of possible values is defined in the // [W3C User-Agent Client Hints specification]. Note that some (but not all) of // these values can overlap with values in the // [`os.type` and `os.name` attributes]. However, for consistency, the values in // the `browser.platform` attribute should capture the exact value that the user // agent provides. // // [UA client hints API]: https://wicg.github.io/ua-client-hints/#interface // [W3C User-Agent Client Hints specification]: https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform // [`os.type` and `os.name` attributes]: ./os.md BrowserPlatformKey = attribute.Key("browser.platform") ) // BrowserBrands returns an attribute KeyValue conforming to the "browser.brands" // semantic conventions. It represents the array of brand name and version // separated by a space. func BrowserBrands(val ...string) attribute.KeyValue { return BrowserBrandsKey.StringSlice(val) } // BrowserLanguage returns an attribute KeyValue conforming to the // "browser.language" semantic conventions. It represents the preferred language // of the user using the browser. func BrowserLanguage(val string) attribute.KeyValue { return BrowserLanguageKey.String(val) } // BrowserMobile returns an attribute KeyValue conforming to the "browser.mobile" // semantic conventions. It represents a boolean that is true if the browser is // running on a mobile device. func BrowserMobile(val bool) attribute.KeyValue { return BrowserMobileKey.Bool(val) } // BrowserPlatform returns an attribute KeyValue conforming to the // "browser.platform" semantic conventions. It represents the platform on which // the browser is running. func BrowserPlatform(val string) attribute.KeyValue { return BrowserPlatformKey.String(val) } // Namespace: cassandra const ( // CassandraConsistencyLevelKey is the attribute Key conforming to the // "cassandra.consistency.level" semantic conventions. It represents the // consistency level of the query. Based on consistency values from [CQL]. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // // [CQL]: https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html CassandraConsistencyLevelKey = attribute.Key("cassandra.consistency.level") // CassandraCoordinatorDCKey is the attribute Key conforming to the // "cassandra.coordinator.dc" semantic conventions. It represents the data // center of the coordinating node for a query. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: us-west-2 CassandraCoordinatorDCKey = attribute.Key("cassandra.coordinator.dc") // CassandraCoordinatorIDKey is the attribute Key conforming to the // "cassandra.coordinator.id" semantic conventions. It represents the ID of the // coordinating node for a query. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: be13faa2-8574-4d71-926d-27f16cf8a7af CassandraCoordinatorIDKey = attribute.Key("cassandra.coordinator.id") // CassandraPageSizeKey is the attribute Key conforming to the // "cassandra.page.size" semantic conventions. It represents the fetch size used // for paging, i.e. how many rows will be returned at once. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 5000 CassandraPageSizeKey = attribute.Key("cassandra.page.size") // CassandraQueryIdempotentKey is the attribute Key conforming to the // "cassandra.query.idempotent" semantic conventions. It represents the whether // or not the query is idempotent. // // Type: boolean // RequirementLevel: Recommended // Stability: Development // // Examples: CassandraQueryIdempotentKey = attribute.Key("cassandra.query.idempotent") // CassandraSpeculativeExecutionCountKey is the attribute Key conforming to the // "cassandra.speculative_execution.count" semantic conventions. It represents // the number of times a query was speculatively executed. Not set or `0` if the // query was not executed speculatively. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 0, 2 CassandraSpeculativeExecutionCountKey = attribute.Key("cassandra.speculative_execution.count") ) // CassandraCoordinatorDC returns an attribute KeyValue conforming to the // "cassandra.coordinator.dc" semantic conventions. It represents the data center // of the coordinating node for a query. func CassandraCoordinatorDC(val string) attribute.KeyValue { return CassandraCoordinatorDCKey.String(val) } // CassandraCoordinatorID returns an attribute KeyValue conforming to the // "cassandra.coordinator.id" semantic conventions. It represents the ID of the // coordinating node for a query. func CassandraCoordinatorID(val string) attribute.KeyValue { return CassandraCoordinatorIDKey.String(val) } // CassandraPageSize returns an attribute KeyValue conforming to the // "cassandra.page.size" semantic conventions. It represents the fetch size used // for paging, i.e. how many rows will be returned at once. func CassandraPageSize(val int) attribute.KeyValue { return CassandraPageSizeKey.Int(val) } // CassandraQueryIdempotent returns an attribute KeyValue conforming to the // "cassandra.query.idempotent" semantic conventions. It represents the whether // or not the query is idempotent. func CassandraQueryIdempotent(val bool) attribute.KeyValue { return CassandraQueryIdempotentKey.Bool(val) } // CassandraSpeculativeExecutionCount returns an attribute KeyValue conforming to // the "cassandra.speculative_execution.count" semantic conventions. It // represents the number of times a query was speculatively executed. Not set or // `0` if the query was not executed speculatively. func CassandraSpeculativeExecutionCount(val int) attribute.KeyValue { return CassandraSpeculativeExecutionCountKey.Int(val) } // Enum values for cassandra.consistency.level var ( // All // Stability: development CassandraConsistencyLevelAll = CassandraConsistencyLevelKey.String("all") // Each Quorum // Stability: development CassandraConsistencyLevelEachQuorum = CassandraConsistencyLevelKey.String("each_quorum") // Quorum // Stability: development CassandraConsistencyLevelQuorum = CassandraConsistencyLevelKey.String("quorum") // Local Quorum // Stability: development CassandraConsistencyLevelLocalQuorum = CassandraConsistencyLevelKey.String("local_quorum") // One // Stability: development CassandraConsistencyLevelOne = CassandraConsistencyLevelKey.String("one") // Two // Stability: development CassandraConsistencyLevelTwo = CassandraConsistencyLevelKey.String("two") // Three // Stability: development CassandraConsistencyLevelThree = CassandraConsistencyLevelKey.String("three") // Local One // Stability: development CassandraConsistencyLevelLocalOne = CassandraConsistencyLevelKey.String("local_one") // Any // Stability: development CassandraConsistencyLevelAny = CassandraConsistencyLevelKey.String("any") // Serial // Stability: development CassandraConsistencyLevelSerial = CassandraConsistencyLevelKey.String("serial") // Local Serial // Stability: development CassandraConsistencyLevelLocalSerial = CassandraConsistencyLevelKey.String("local_serial") ) // Namespace: cicd const ( // CICDPipelineActionNameKey is the attribute Key conforming to the // "cicd.pipeline.action.name" semantic conventions. It represents the kind of // action a pipeline run is performing. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "BUILD", "RUN", "SYNC" CICDPipelineActionNameKey = attribute.Key("cicd.pipeline.action.name") // CICDPipelineNameKey is the attribute Key conforming to the // "cicd.pipeline.name" semantic conventions. It represents the human readable // name of the pipeline within a CI/CD system. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Build and Test", "Lint", "Deploy Go Project", // "deploy_to_environment" CICDPipelineNameKey = attribute.Key("cicd.pipeline.name") // CICDPipelineResultKey is the attribute Key conforming to the // "cicd.pipeline.result" semantic conventions. It represents the result of a // pipeline run. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "success", "failure", "timeout", "skipped" CICDPipelineResultKey = attribute.Key("cicd.pipeline.result") // CICDPipelineRunIDKey is the attribute Key conforming to the // "cicd.pipeline.run.id" semantic conventions. It represents the unique // identifier of a pipeline run within a CI/CD system. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "120912" CICDPipelineRunIDKey = attribute.Key("cicd.pipeline.run.id") // CICDPipelineRunStateKey is the attribute Key conforming to the // "cicd.pipeline.run.state" semantic conventions. It represents the pipeline // run goes through these states during its lifecycle. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "pending", "executing", "finalizing" CICDPipelineRunStateKey = attribute.Key("cicd.pipeline.run.state") // CICDPipelineRunURLFullKey is the attribute Key conforming to the // "cicd.pipeline.run.url.full" semantic conventions. It represents the [URL] of // the pipeline run, providing the complete address in order to locate and // identify the pipeline run. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: // "https://github.com/open-telemetry/semantic-conventions/actions/runs/9753949763?pr=1075" // // [URL]: https://wikipedia.org/wiki/URL CICDPipelineRunURLFullKey = attribute.Key("cicd.pipeline.run.url.full") // CICDPipelineTaskNameKey is the attribute Key conforming to the // "cicd.pipeline.task.name" semantic conventions. It represents the human // readable name of a task within a pipeline. Task here most closely aligns with // a [computing process] in a pipeline. Other terms for tasks include commands, // steps, and procedures. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Run GoLang Linter", "Go Build", "go-test", "deploy_binary" // // [computing process]: https://wikipedia.org/wiki/Pipeline_(computing) CICDPipelineTaskNameKey = attribute.Key("cicd.pipeline.task.name") // CICDPipelineTaskRunIDKey is the attribute Key conforming to the // "cicd.pipeline.task.run.id" semantic conventions. It represents the unique // identifier of a task run within a pipeline. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "12097" CICDPipelineTaskRunIDKey = attribute.Key("cicd.pipeline.task.run.id") // CICDPipelineTaskRunResultKey is the attribute Key conforming to the // "cicd.pipeline.task.run.result" semantic conventions. It represents the // result of a task run. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "success", "failure", "timeout", "skipped" CICDPipelineTaskRunResultKey = attribute.Key("cicd.pipeline.task.run.result") // CICDPipelineTaskRunURLFullKey is the attribute Key conforming to the // "cicd.pipeline.task.run.url.full" semantic conventions. It represents the // [URL] of the pipeline task run, providing the complete address in order to // locate and identify the pipeline task run. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: // "https://github.com/open-telemetry/semantic-conventions/actions/runs/9753949763/job/26920038674?pr=1075" // // [URL]: https://wikipedia.org/wiki/URL CICDPipelineTaskRunURLFullKey = attribute.Key("cicd.pipeline.task.run.url.full") // CICDPipelineTaskTypeKey is the attribute Key conforming to the // "cicd.pipeline.task.type" semantic conventions. It represents the type of the // task within a pipeline. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "build", "test", "deploy" CICDPipelineTaskTypeKey = attribute.Key("cicd.pipeline.task.type") // CICDSystemComponentKey is the attribute Key conforming to the // "cicd.system.component" semantic conventions. It represents the name of a // component of the CICD system. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "controller", "scheduler", "agent" CICDSystemComponentKey = attribute.Key("cicd.system.component") // CICDWorkerIDKey is the attribute Key conforming to the "cicd.worker.id" // semantic conventions. It represents the unique identifier of a worker within // a CICD system. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "abc123", "10.0.1.2", "controller" CICDWorkerIDKey = attribute.Key("cicd.worker.id") // CICDWorkerNameKey is the attribute Key conforming to the "cicd.worker.name" // semantic conventions. It represents the name of a worker within a CICD // system. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "agent-abc", "controller", "Ubuntu LTS" CICDWorkerNameKey = attribute.Key("cicd.worker.name") // CICDWorkerStateKey is the attribute Key conforming to the "cicd.worker.state" // semantic conventions. It represents the state of a CICD worker / agent. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "idle", "busy", "down" CICDWorkerStateKey = attribute.Key("cicd.worker.state") // CICDWorkerURLFullKey is the attribute Key conforming to the // "cicd.worker.url.full" semantic conventions. It represents the [URL] of the // worker, providing the complete address in order to locate and identify the // worker. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "https://cicd.example.org/worker/abc123" // // [URL]: https://wikipedia.org/wiki/URL CICDWorkerURLFullKey = attribute.Key("cicd.worker.url.full") ) // CICDPipelineName returns an attribute KeyValue conforming to the // "cicd.pipeline.name" semantic conventions. It represents the human readable // name of the pipeline within a CI/CD system. func CICDPipelineName(val string) attribute.KeyValue { return CICDPipelineNameKey.String(val) } // CICDPipelineRunID returns an attribute KeyValue conforming to the // "cicd.pipeline.run.id" semantic conventions. It represents the unique // identifier of a pipeline run within a CI/CD system. func CICDPipelineRunID(val string) attribute.KeyValue { return CICDPipelineRunIDKey.String(val) } // CICDPipelineRunURLFull returns an attribute KeyValue conforming to the // "cicd.pipeline.run.url.full" semantic conventions. It represents the [URL] of // the pipeline run, providing the complete address in order to locate and // identify the pipeline run. // // [URL]: https://wikipedia.org/wiki/URL func CICDPipelineRunURLFull(val string) attribute.KeyValue { return CICDPipelineRunURLFullKey.String(val) } // CICDPipelineTaskName returns an attribute KeyValue conforming to the // "cicd.pipeline.task.name" semantic conventions. It represents the human // readable name of a task within a pipeline. Task here most closely aligns with // a [computing process] in a pipeline. Other terms for tasks include commands, // steps, and procedures. // // [computing process]: https://wikipedia.org/wiki/Pipeline_(computing) func CICDPipelineTaskName(val string) attribute.KeyValue { return CICDPipelineTaskNameKey.String(val) } // CICDPipelineTaskRunID returns an attribute KeyValue conforming to the // "cicd.pipeline.task.run.id" semantic conventions. It represents the unique // identifier of a task run within a pipeline. func CICDPipelineTaskRunID(val string) attribute.KeyValue { return CICDPipelineTaskRunIDKey.String(val) } // CICDPipelineTaskRunURLFull returns an attribute KeyValue conforming to the // "cicd.pipeline.task.run.url.full" semantic conventions. It represents the // [URL] of the pipeline task run, providing the complete address in order to // locate and identify the pipeline task run. // // [URL]: https://wikipedia.org/wiki/URL func CICDPipelineTaskRunURLFull(val string) attribute.KeyValue { return CICDPipelineTaskRunURLFullKey.String(val) } // CICDSystemComponent returns an attribute KeyValue conforming to the // "cicd.system.component" semantic conventions. It represents the name of a // component of the CICD system. func CICDSystemComponent(val string) attribute.KeyValue { return CICDSystemComponentKey.String(val) } // CICDWorkerID returns an attribute KeyValue conforming to the "cicd.worker.id" // semantic conventions. It represents the unique identifier of a worker within a // CICD system. func CICDWorkerID(val string) attribute.KeyValue { return CICDWorkerIDKey.String(val) } // CICDWorkerName returns an attribute KeyValue conforming to the // "cicd.worker.name" semantic conventions. It represents the name of a worker // within a CICD system. func CICDWorkerName(val string) attribute.KeyValue { return CICDWorkerNameKey.String(val) } // CICDWorkerURLFull returns an attribute KeyValue conforming to the // "cicd.worker.url.full" semantic conventions. It represents the [URL] of the // worker, providing the complete address in order to locate and identify the // worker. // // [URL]: https://wikipedia.org/wiki/URL func CICDWorkerURLFull(val string) attribute.KeyValue { return CICDWorkerURLFullKey.String(val) } // Enum values for cicd.pipeline.action.name var ( // The pipeline run is executing a build. // Stability: development CICDPipelineActionNameBuild = CICDPipelineActionNameKey.String("BUILD") // The pipeline run is executing. // Stability: development CICDPipelineActionNameRun = CICDPipelineActionNameKey.String("RUN") // The pipeline run is executing a sync. // Stability: development CICDPipelineActionNameSync = CICDPipelineActionNameKey.String("SYNC") ) // Enum values for cicd.pipeline.result var ( // The pipeline run finished successfully. // Stability: development CICDPipelineResultSuccess = CICDPipelineResultKey.String("success") // The pipeline run did not finish successfully, eg. due to a compile error or a // failing test. Such failures are usually detected by non-zero exit codes of // the tools executed in the pipeline run. // Stability: development CICDPipelineResultFailure = CICDPipelineResultKey.String("failure") // The pipeline run failed due to an error in the CICD system, eg. due to the // worker being killed. // Stability: development CICDPipelineResultError = CICDPipelineResultKey.String("error") // A timeout caused the pipeline run to be interrupted. // Stability: development CICDPipelineResultTimeout = CICDPipelineResultKey.String("timeout") // The pipeline run was cancelled, eg. by a user manually cancelling the // pipeline run. // Stability: development CICDPipelineResultCancellation = CICDPipelineResultKey.String("cancellation") // The pipeline run was skipped, eg. due to a precondition not being met. // Stability: development CICDPipelineResultSkip = CICDPipelineResultKey.String("skip") ) // Enum values for cicd.pipeline.run.state var ( // The run pending state spans from the event triggering the pipeline run until // the execution of the run starts (eg. time spent in a queue, provisioning // agents, creating run resources). // // Stability: development CICDPipelineRunStatePending = CICDPipelineRunStateKey.String("pending") // The executing state spans the execution of any run tasks (eg. build, test). // Stability: development CICDPipelineRunStateExecuting = CICDPipelineRunStateKey.String("executing") // The finalizing state spans from when the run has finished executing (eg. // cleanup of run resources). // Stability: development CICDPipelineRunStateFinalizing = CICDPipelineRunStateKey.String("finalizing") ) // Enum values for cicd.pipeline.task.run.result var ( // The task run finished successfully. // Stability: development CICDPipelineTaskRunResultSuccess = CICDPipelineTaskRunResultKey.String("success") // The task run did not finish successfully, eg. due to a compile error or a // failing test. Such failures are usually detected by non-zero exit codes of // the tools executed in the task run. // Stability: development CICDPipelineTaskRunResultFailure = CICDPipelineTaskRunResultKey.String("failure") // The task run failed due to an error in the CICD system, eg. due to the worker // being killed. // Stability: development CICDPipelineTaskRunResultError = CICDPipelineTaskRunResultKey.String("error") // A timeout caused the task run to be interrupted. // Stability: development CICDPipelineTaskRunResultTimeout = CICDPipelineTaskRunResultKey.String("timeout") // The task run was cancelled, eg. by a user manually cancelling the task run. // Stability: development CICDPipelineTaskRunResultCancellation = CICDPipelineTaskRunResultKey.String("cancellation") // The task run was skipped, eg. due to a precondition not being met. // Stability: development CICDPipelineTaskRunResultSkip = CICDPipelineTaskRunResultKey.String("skip") ) // Enum values for cicd.pipeline.task.type var ( // build // Stability: development CICDPipelineTaskTypeBuild = CICDPipelineTaskTypeKey.String("build") // test // Stability: development CICDPipelineTaskTypeTest = CICDPipelineTaskTypeKey.String("test") // deploy // Stability: development CICDPipelineTaskTypeDeploy = CICDPipelineTaskTypeKey.String("deploy") ) // Enum values for cicd.worker.state var ( // The worker is not performing work for the CICD system. It is available to the // CICD system to perform work on (online / idle). // Stability: development CICDWorkerStateAvailable = CICDWorkerStateKey.String("available") // The worker is performing work for the CICD system. // Stability: development CICDWorkerStateBusy = CICDWorkerStateKey.String("busy") // The worker is not available to the CICD system (disconnected / down). // Stability: development CICDWorkerStateOffline = CICDWorkerStateKey.String("offline") ) // Namespace: client const ( // ClientAddressKey is the attribute Key conforming to the "client.address" // semantic conventions. It represents the client address - domain name if // available without reverse DNS lookup; otherwise, IP address or Unix domain // socket name. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "client.example.com", "10.1.2.80", "/tmp/my.sock" // Note: When observed from the server side, and when communicating through an // intermediary, `client.address` SHOULD represent the client address behind any // intermediaries, for example proxies, if it's available. ClientAddressKey = attribute.Key("client.address") // ClientPortKey is the attribute Key conforming to the "client.port" semantic // conventions. It represents the client port number. // // Type: int // RequirementLevel: Recommended // Stability: Stable // // Examples: 65123 // Note: When observed from the server side, and when communicating through an // intermediary, `client.port` SHOULD represent the client port behind any // intermediaries, for example proxies, if it's available. ClientPortKey = attribute.Key("client.port") ) // ClientAddress returns an attribute KeyValue conforming to the "client.address" // semantic conventions. It represents the client address - domain name if // available without reverse DNS lookup; otherwise, IP address or Unix domain // socket name. func ClientAddress(val string) attribute.KeyValue { return ClientAddressKey.String(val) } // ClientPort returns an attribute KeyValue conforming to the "client.port" // semantic conventions. It represents the client port number. func ClientPort(val int) attribute.KeyValue { return ClientPortKey.Int(val) } // Namespace: cloud const ( // CloudAccountIDKey is the attribute Key conforming to the "cloud.account.id" // semantic conventions. It represents the cloud account ID the resource is // assigned to. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "111111111111", "opentelemetry" CloudAccountIDKey = attribute.Key("cloud.account.id") // CloudAvailabilityZoneKey is the attribute Key conforming to the // "cloud.availability_zone" semantic conventions. It represents the cloud // regions often have multiple, isolated locations known as zones to increase // availability. Availability zone represents the zone where the resource is // running. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "us-east-1c" // Note: Availability zones are called "zones" on Alibaba Cloud and Google // Cloud. CloudAvailabilityZoneKey = attribute.Key("cloud.availability_zone") // CloudPlatformKey is the attribute Key conforming to the "cloud.platform" // semantic conventions. It represents the cloud platform in use. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // Note: The prefix of the service SHOULD match the one specified in // `cloud.provider`. CloudPlatformKey = attribute.Key("cloud.platform") // CloudProviderKey is the attribute Key conforming to the "cloud.provider" // semantic conventions. It represents the name of the cloud provider. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: CloudProviderKey = attribute.Key("cloud.provider") // CloudRegionKey is the attribute Key conforming to the "cloud.region" semantic // conventions. It represents the geographical region within a cloud provider. // When associated with a resource, this attribute specifies the region where // the resource operates. When calling services or APIs deployed on a cloud, // this attribute identifies the region where the called destination is // deployed. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "us-central1", "us-east-1" // Note: Refer to your provider's docs to see the available regions, for example // [Alibaba Cloud regions], [AWS regions], [Azure regions], // [Google Cloud regions], or [Tencent Cloud regions]. // // [Alibaba Cloud regions]: https://www.alibabacloud.com/help/doc-detail/40654.htm // [AWS regions]: https://aws.amazon.com/about-aws/global-infrastructure/regions_az/ // [Azure regions]: https://azure.microsoft.com/global-infrastructure/geographies/ // [Google Cloud regions]: https://cloud.google.com/about/locations // [Tencent Cloud regions]: https://www.tencentcloud.com/document/product/213/6091 CloudRegionKey = attribute.Key("cloud.region") // CloudResourceIDKey is the attribute Key conforming to the "cloud.resource_id" // semantic conventions. It represents the cloud provider-specific native // identifier of the monitored cloud resource (e.g. an [ARN] on AWS, a // [fully qualified resource ID] on Azure, a [full resource name] on GCP). // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "arn:aws:lambda:REGION:ACCOUNT_ID:function:my-function", // "//run.googleapis.com/projects/PROJECT_ID/locations/LOCATION_ID/services/SERVICE_ID", // "/subscriptions//resourceGroups/ // /providers/Microsoft.Web/sites//functions/" // Note: On some cloud providers, it may not be possible to determine the full // ID at startup, // so it may be necessary to set `cloud.resource_id` as a span attribute // instead. // // The exact value to use for `cloud.resource_id` depends on the cloud provider. // The following well-known definitions MUST be used if you set this attribute // and they apply: // // - **AWS Lambda:** The function [ARN]. // Take care not to use the "invoked ARN" directly but replace any // [alias suffix] // with the resolved function version, as the same runtime instance may be // invocable with // multiple different aliases. // - **GCP:** The [URI of the resource] // - **Azure:** The [Fully Qualified Resource ID] of the invoked function, // *not* the function app, having the form // // `/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/` // . // This means that a span attribute MUST be used, as an Azure function app // can host multiple functions that would usually share // a TracerProvider. // // // [ARN]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html // [fully qualified resource ID]: https://learn.microsoft.com/rest/api/resources/resources/get-by-id // [full resource name]: https://google.aip.dev/122#full-resource-names // [ARN]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html // [alias suffix]: https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html // [URI of the resource]: https://cloud.google.com/iam/docs/full-resource-names // [Fully Qualified Resource ID]: https://learn.microsoft.com/rest/api/resources/resources/get-by-id CloudResourceIDKey = attribute.Key("cloud.resource_id") ) // CloudAccountID returns an attribute KeyValue conforming to the // "cloud.account.id" semantic conventions. It represents the cloud account ID // the resource is assigned to. func CloudAccountID(val string) attribute.KeyValue { return CloudAccountIDKey.String(val) } // CloudAvailabilityZone returns an attribute KeyValue conforming to the // "cloud.availability_zone" semantic conventions. It represents the cloud // regions often have multiple, isolated locations known as zones to increase // availability. Availability zone represents the zone where the resource is // running. func CloudAvailabilityZone(val string) attribute.KeyValue { return CloudAvailabilityZoneKey.String(val) } // CloudRegion returns an attribute KeyValue conforming to the "cloud.region" // semantic conventions. It represents the geographical region within a cloud // provider. When associated with a resource, this attribute specifies the region // where the resource operates. When calling services or APIs deployed on a // cloud, this attribute identifies the region where the called destination is // deployed. func CloudRegion(val string) attribute.KeyValue { return CloudRegionKey.String(val) } // CloudResourceID returns an attribute KeyValue conforming to the // "cloud.resource_id" semantic conventions. It represents the cloud // provider-specific native identifier of the monitored cloud resource (e.g. an // [ARN] on AWS, a [fully qualified resource ID] on Azure, a [full resource name] // on GCP). // // [ARN]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html // [fully qualified resource ID]: https://learn.microsoft.com/rest/api/resources/resources/get-by-id // [full resource name]: https://google.aip.dev/122#full-resource-names func CloudResourceID(val string) attribute.KeyValue { return CloudResourceIDKey.String(val) } // Enum values for cloud.platform var ( // Alibaba Cloud Elastic Compute Service // Stability: development CloudPlatformAlibabaCloudECS = CloudPlatformKey.String("alibaba_cloud_ecs") // Alibaba Cloud Function Compute // Stability: development CloudPlatformAlibabaCloudFC = CloudPlatformKey.String("alibaba_cloud_fc") // Red Hat OpenShift on Alibaba Cloud // Stability: development CloudPlatformAlibabaCloudOpenShift = CloudPlatformKey.String("alibaba_cloud_openshift") // AWS Elastic Compute Cloud // Stability: development CloudPlatformAWSEC2 = CloudPlatformKey.String("aws_ec2") // AWS Elastic Container Service // Stability: development CloudPlatformAWSECS = CloudPlatformKey.String("aws_ecs") // AWS Elastic Kubernetes Service // Stability: development CloudPlatformAWSEKS = CloudPlatformKey.String("aws_eks") // AWS Lambda // Stability: development CloudPlatformAWSLambda = CloudPlatformKey.String("aws_lambda") // AWS Elastic Beanstalk // Stability: development CloudPlatformAWSElasticBeanstalk = CloudPlatformKey.String("aws_elastic_beanstalk") // AWS App Runner // Stability: development CloudPlatformAWSAppRunner = CloudPlatformKey.String("aws_app_runner") // Red Hat OpenShift on AWS (ROSA) // Stability: development CloudPlatformAWSOpenShift = CloudPlatformKey.String("aws_openshift") // Azure Virtual Machines // Stability: development CloudPlatformAzureVM = CloudPlatformKey.String("azure.vm") // Azure Container Apps // Stability: development CloudPlatformAzureContainerApps = CloudPlatformKey.String("azure.container_apps") // Azure Container Instances // Stability: development CloudPlatformAzureContainerInstances = CloudPlatformKey.String("azure.container_instances") // Azure Kubernetes Service // Stability: development CloudPlatformAzureAKS = CloudPlatformKey.String("azure.aks") // Azure Functions // Stability: development CloudPlatformAzureFunctions = CloudPlatformKey.String("azure.functions") // Azure App Service // Stability: development CloudPlatformAzureAppService = CloudPlatformKey.String("azure.app_service") // Azure Red Hat OpenShift // Stability: development CloudPlatformAzureOpenShift = CloudPlatformKey.String("azure.openshift") // Google Bare Metal Solution (BMS) // Stability: development CloudPlatformGCPBareMetalSolution = CloudPlatformKey.String("gcp_bare_metal_solution") // Google Cloud Compute Engine (GCE) // Stability: development CloudPlatformGCPComputeEngine = CloudPlatformKey.String("gcp_compute_engine") // Google Cloud Run // Stability: development CloudPlatformGCPCloudRun = CloudPlatformKey.String("gcp_cloud_run") // Google Cloud Kubernetes Engine (GKE) // Stability: development CloudPlatformGCPKubernetesEngine = CloudPlatformKey.String("gcp_kubernetes_engine") // Google Cloud Functions (GCF) // Stability: development CloudPlatformGCPCloudFunctions = CloudPlatformKey.String("gcp_cloud_functions") // Google Cloud App Engine (GAE) // Stability: development CloudPlatformGCPAppEngine = CloudPlatformKey.String("gcp_app_engine") // Red Hat OpenShift on Google Cloud // Stability: development CloudPlatformGCPOpenShift = CloudPlatformKey.String("gcp_openshift") // Red Hat OpenShift on IBM Cloud // Stability: development CloudPlatformIBMCloudOpenShift = CloudPlatformKey.String("ibm_cloud_openshift") // Compute on Oracle Cloud Infrastructure (OCI) // Stability: development CloudPlatformOracleCloudCompute = CloudPlatformKey.String("oracle_cloud_compute") // Kubernetes Engine (OKE) on Oracle Cloud Infrastructure (OCI) // Stability: development CloudPlatformOracleCloudOKE = CloudPlatformKey.String("oracle_cloud_oke") // Tencent Cloud Cloud Virtual Machine (CVM) // Stability: development CloudPlatformTencentCloudCVM = CloudPlatformKey.String("tencent_cloud_cvm") // Tencent Cloud Elastic Kubernetes Service (EKS) // Stability: development CloudPlatformTencentCloudEKS = CloudPlatformKey.String("tencent_cloud_eks") // Tencent Cloud Serverless Cloud Function (SCF) // Stability: development CloudPlatformTencentCloudSCF = CloudPlatformKey.String("tencent_cloud_scf") ) // Enum values for cloud.provider var ( // Alibaba Cloud // Stability: development CloudProviderAlibabaCloud = CloudProviderKey.String("alibaba_cloud") // Amazon Web Services // Stability: development CloudProviderAWS = CloudProviderKey.String("aws") // Microsoft Azure // Stability: development CloudProviderAzure = CloudProviderKey.String("azure") // Google Cloud Platform // Stability: development CloudProviderGCP = CloudProviderKey.String("gcp") // Heroku Platform as a Service // Stability: development CloudProviderHeroku = CloudProviderKey.String("heroku") // IBM Cloud // Stability: development CloudProviderIBMCloud = CloudProviderKey.String("ibm_cloud") // Oracle Cloud Infrastructure (OCI) // Stability: development CloudProviderOracleCloud = CloudProviderKey.String("oracle_cloud") // Tencent Cloud // Stability: development CloudProviderTencentCloud = CloudProviderKey.String("tencent_cloud") ) // Namespace: cloudevents const ( // CloudEventsEventIDKey is the attribute Key conforming to the // "cloudevents.event_id" semantic conventions. It represents the [event_id] // uniquely identifies the event. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "123e4567-e89b-12d3-a456-426614174000", "0001" // // [event_id]: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id CloudEventsEventIDKey = attribute.Key("cloudevents.event_id") // CloudEventsEventSourceKey is the attribute Key conforming to the // "cloudevents.event_source" semantic conventions. It represents the [source] // identifies the context in which an event happened. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "https://github.com/cloudevents", "/cloudevents/spec/pull/123", // "my-service" // // [source]: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1 CloudEventsEventSourceKey = attribute.Key("cloudevents.event_source") // CloudEventsEventSpecVersionKey is the attribute Key conforming to the // "cloudevents.event_spec_version" semantic conventions. It represents the // [version of the CloudEvents specification] which the event uses. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: 1.0 // // [version of the CloudEvents specification]: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion CloudEventsEventSpecVersionKey = attribute.Key("cloudevents.event_spec_version") // CloudEventsEventSubjectKey is the attribute Key conforming to the // "cloudevents.event_subject" semantic conventions. It represents the [subject] // of the event in the context of the event producer (identified by source). // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: mynewfile.jpg // // [subject]: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject CloudEventsEventSubjectKey = attribute.Key("cloudevents.event_subject") // CloudEventsEventTypeKey is the attribute Key conforming to the // "cloudevents.event_type" semantic conventions. It represents the [event_type] // contains a value describing the type of event related to the originating // occurrence. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "com.github.pull_request.opened", "com.example.object.deleted.v2" // // [event_type]: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type CloudEventsEventTypeKey = attribute.Key("cloudevents.event_type") ) // CloudEventsEventID returns an attribute KeyValue conforming to the // "cloudevents.event_id" semantic conventions. It represents the [event_id] // uniquely identifies the event. // // [event_id]: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id func CloudEventsEventID(val string) attribute.KeyValue { return CloudEventsEventIDKey.String(val) } // CloudEventsEventSource returns an attribute KeyValue conforming to the // "cloudevents.event_source" semantic conventions. It represents the [source] // identifies the context in which an event happened. // // [source]: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1 func CloudEventsEventSource(val string) attribute.KeyValue { return CloudEventsEventSourceKey.String(val) } // CloudEventsEventSpecVersion returns an attribute KeyValue conforming to the // "cloudevents.event_spec_version" semantic conventions. It represents the // [version of the CloudEvents specification] which the event uses. // // [version of the CloudEvents specification]: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion func CloudEventsEventSpecVersion(val string) attribute.KeyValue { return CloudEventsEventSpecVersionKey.String(val) } // CloudEventsEventSubject returns an attribute KeyValue conforming to the // "cloudevents.event_subject" semantic conventions. It represents the [subject] // of the event in the context of the event producer (identified by source). // // [subject]: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject func CloudEventsEventSubject(val string) attribute.KeyValue { return CloudEventsEventSubjectKey.String(val) } // CloudEventsEventType returns an attribute KeyValue conforming to the // "cloudevents.event_type" semantic conventions. It represents the [event_type] // contains a value describing the type of event related to the originating // occurrence. // // [event_type]: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type func CloudEventsEventType(val string) attribute.KeyValue { return CloudEventsEventTypeKey.String(val) } // Namespace: cloudfoundry const ( // CloudFoundryAppIDKey is the attribute Key conforming to the // "cloudfoundry.app.id" semantic conventions. It represents the guid of the // application. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "218fc5a9-a5f1-4b54-aa05-46717d0ab26d" // Note: Application instrumentation should use the value from environment // variable `VCAP_APPLICATION.application_id`. This is the same value as // reported by `cf app --guid`. CloudFoundryAppIDKey = attribute.Key("cloudfoundry.app.id") // CloudFoundryAppInstanceIDKey is the attribute Key conforming to the // "cloudfoundry.app.instance.id" semantic conventions. It represents the index // of the application instance. 0 when just one instance is active. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "0", "1" // Note: CloudFoundry defines the `instance_id` in the [Loggregator v2 envelope] // . // It is used for logs and metrics emitted by CloudFoundry. It is // supposed to contain the application instance index for applications // deployed on the runtime. // // Application instrumentation should use the value from environment // variable `CF_INSTANCE_INDEX`. // // [Loggregator v2 envelope]: https://github.com/cloudfoundry/loggregator-api#v2-envelope CloudFoundryAppInstanceIDKey = attribute.Key("cloudfoundry.app.instance.id") // CloudFoundryAppNameKey is the attribute Key conforming to the // "cloudfoundry.app.name" semantic conventions. It represents the name of the // application. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "my-app-name" // Note: Application instrumentation should use the value from environment // variable `VCAP_APPLICATION.application_name`. This is the same value // as reported by `cf apps`. CloudFoundryAppNameKey = attribute.Key("cloudfoundry.app.name") // CloudFoundryOrgIDKey is the attribute Key conforming to the // "cloudfoundry.org.id" semantic conventions. It represents the guid of the // CloudFoundry org the application is running in. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "218fc5a9-a5f1-4b54-aa05-46717d0ab26d" // Note: Application instrumentation should use the value from environment // variable `VCAP_APPLICATION.org_id`. This is the same value as // reported by `cf org --guid`. CloudFoundryOrgIDKey = attribute.Key("cloudfoundry.org.id") // CloudFoundryOrgNameKey is the attribute Key conforming to the // "cloudfoundry.org.name" semantic conventions. It represents the name of the // CloudFoundry organization the app is running in. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "my-org-name" // Note: Application instrumentation should use the value from environment // variable `VCAP_APPLICATION.org_name`. This is the same value as // reported by `cf orgs`. CloudFoundryOrgNameKey = attribute.Key("cloudfoundry.org.name") // CloudFoundryProcessIDKey is the attribute Key conforming to the // "cloudfoundry.process.id" semantic conventions. It represents the UID // identifying the process. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "218fc5a9-a5f1-4b54-aa05-46717d0ab26d" // Note: Application instrumentation should use the value from environment // variable `VCAP_APPLICATION.process_id`. It is supposed to be equal to // `VCAP_APPLICATION.app_id` for applications deployed to the runtime. // For system components, this could be the actual PID. CloudFoundryProcessIDKey = attribute.Key("cloudfoundry.process.id") // CloudFoundryProcessTypeKey is the attribute Key conforming to the // "cloudfoundry.process.type" semantic conventions. It represents the type of // process. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "web" // Note: CloudFoundry applications can consist of multiple jobs. Usually the // main process will be of type `web`. There can be additional background // tasks or side-cars with different process types. CloudFoundryProcessTypeKey = attribute.Key("cloudfoundry.process.type") // CloudFoundrySpaceIDKey is the attribute Key conforming to the // "cloudfoundry.space.id" semantic conventions. It represents the guid of the // CloudFoundry space the application is running in. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "218fc5a9-a5f1-4b54-aa05-46717d0ab26d" // Note: Application instrumentation should use the value from environment // variable `VCAP_APPLICATION.space_id`. This is the same value as // reported by `cf space --guid`. CloudFoundrySpaceIDKey = attribute.Key("cloudfoundry.space.id") // CloudFoundrySpaceNameKey is the attribute Key conforming to the // "cloudfoundry.space.name" semantic conventions. It represents the name of the // CloudFoundry space the application is running in. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "my-space-name" // Note: Application instrumentation should use the value from environment // variable `VCAP_APPLICATION.space_name`. This is the same value as // reported by `cf spaces`. CloudFoundrySpaceNameKey = attribute.Key("cloudfoundry.space.name") // CloudFoundrySystemIDKey is the attribute Key conforming to the // "cloudfoundry.system.id" semantic conventions. It represents a guid or // another name describing the event source. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "cf/gorouter" // Note: CloudFoundry defines the `source_id` in the [Loggregator v2 envelope]. // It is used for logs and metrics emitted by CloudFoundry. It is // supposed to contain the component name, e.g. "gorouter", for // CloudFoundry components. // // When system components are instrumented, values from the // [Bosh spec] // should be used. The `system.id` should be set to // `spec.deployment/spec.name`. // // [Loggregator v2 envelope]: https://github.com/cloudfoundry/loggregator-api#v2-envelope // [Bosh spec]: https://bosh.io/docs/jobs/#properties-spec CloudFoundrySystemIDKey = attribute.Key("cloudfoundry.system.id") // CloudFoundrySystemInstanceIDKey is the attribute Key conforming to the // "cloudfoundry.system.instance.id" semantic conventions. It represents a guid // describing the concrete instance of the event source. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "218fc5a9-a5f1-4b54-aa05-46717d0ab26d" // Note: CloudFoundry defines the `instance_id` in the [Loggregator v2 envelope] // . // It is used for logs and metrics emitted by CloudFoundry. It is // supposed to contain the vm id for CloudFoundry components. // // When system components are instrumented, values from the // [Bosh spec] // should be used. The `system.instance.id` should be set to `spec.id`. // // [Loggregator v2 envelope]: https://github.com/cloudfoundry/loggregator-api#v2-envelope // [Bosh spec]: https://bosh.io/docs/jobs/#properties-spec CloudFoundrySystemInstanceIDKey = attribute.Key("cloudfoundry.system.instance.id") ) // CloudFoundryAppID returns an attribute KeyValue conforming to the // "cloudfoundry.app.id" semantic conventions. It represents the guid of the // application. func CloudFoundryAppID(val string) attribute.KeyValue { return CloudFoundryAppIDKey.String(val) } // CloudFoundryAppInstanceID returns an attribute KeyValue conforming to the // "cloudfoundry.app.instance.id" semantic conventions. It represents the index // of the application instance. 0 when just one instance is active. func CloudFoundryAppInstanceID(val string) attribute.KeyValue { return CloudFoundryAppInstanceIDKey.String(val) } // CloudFoundryAppName returns an attribute KeyValue conforming to the // "cloudfoundry.app.name" semantic conventions. It represents the name of the // application. func CloudFoundryAppName(val string) attribute.KeyValue { return CloudFoundryAppNameKey.String(val) } // CloudFoundryOrgID returns an attribute KeyValue conforming to the // "cloudfoundry.org.id" semantic conventions. It represents the guid of the // CloudFoundry org the application is running in. func CloudFoundryOrgID(val string) attribute.KeyValue { return CloudFoundryOrgIDKey.String(val) } // CloudFoundryOrgName returns an attribute KeyValue conforming to the // "cloudfoundry.org.name" semantic conventions. It represents the name of the // CloudFoundry organization the app is running in. func CloudFoundryOrgName(val string) attribute.KeyValue { return CloudFoundryOrgNameKey.String(val) } // CloudFoundryProcessID returns an attribute KeyValue conforming to the // "cloudfoundry.process.id" semantic conventions. It represents the UID // identifying the process. func CloudFoundryProcessID(val string) attribute.KeyValue { return CloudFoundryProcessIDKey.String(val) } // CloudFoundryProcessType returns an attribute KeyValue conforming to the // "cloudfoundry.process.type" semantic conventions. It represents the type of // process. func CloudFoundryProcessType(val string) attribute.KeyValue { return CloudFoundryProcessTypeKey.String(val) } // CloudFoundrySpaceID returns an attribute KeyValue conforming to the // "cloudfoundry.space.id" semantic conventions. It represents the guid of the // CloudFoundry space the application is running in. func CloudFoundrySpaceID(val string) attribute.KeyValue { return CloudFoundrySpaceIDKey.String(val) } // CloudFoundrySpaceName returns an attribute KeyValue conforming to the // "cloudfoundry.space.name" semantic conventions. It represents the name of the // CloudFoundry space the application is running in. func CloudFoundrySpaceName(val string) attribute.KeyValue { return CloudFoundrySpaceNameKey.String(val) } // CloudFoundrySystemID returns an attribute KeyValue conforming to the // "cloudfoundry.system.id" semantic conventions. It represents a guid or another // name describing the event source. func CloudFoundrySystemID(val string) attribute.KeyValue { return CloudFoundrySystemIDKey.String(val) } // CloudFoundrySystemInstanceID returns an attribute KeyValue conforming to the // "cloudfoundry.system.instance.id" semantic conventions. It represents a guid // describing the concrete instance of the event source. func CloudFoundrySystemInstanceID(val string) attribute.KeyValue { return CloudFoundrySystemInstanceIDKey.String(val) } // Namespace: code const ( // CodeColumnNumberKey is the attribute Key conforming to the // "code.column.number" semantic conventions. It represents the column number in // `code.file.path` best representing the operation. It SHOULD point within the // code unit named in `code.function.name`. This attribute MUST NOT be used on // the Profile signal since the data is already captured in 'message Line'. This // constraint is imposed to prevent redundancy and maintain data integrity. // // Type: int // RequirementLevel: Recommended // Stability: Stable CodeColumnNumberKey = attribute.Key("code.column.number") // CodeFilePathKey is the attribute Key conforming to the "code.file.path" // semantic conventions. It represents the source code file name that identifies // the code unit as uniquely as possible (preferably an absolute file path). // This attribute MUST NOT be used on the Profile signal since the data is // already captured in 'message Function'. This constraint is imposed to prevent // redundancy and maintain data integrity. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: /usr/local/MyApplication/content_root/app/index.php CodeFilePathKey = attribute.Key("code.file.path") // CodeFunctionNameKey is the attribute Key conforming to the // "code.function.name" semantic conventions. It represents the method or // function fully-qualified name without arguments. The value should fit the // natural representation of the language runtime, which is also likely the same // used within `code.stacktrace` attribute value. This attribute MUST NOT be // used on the Profile signal since the data is already captured in 'message // Function'. This constraint is imposed to prevent redundancy and maintain data // integrity. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "com.example.MyHttpService.serveRequest", // "GuzzleHttp\Client::transfer", "fopen" // Note: Values and format depends on each language runtime, thus it is // impossible to provide an exhaustive list of examples. // The values are usually the same (or prefixes of) the ones found in native // stack trace representation stored in // `code.stacktrace` without information on arguments. // // Examples: // // - Java method: `com.example.MyHttpService.serveRequest` // - Java anonymous class method: `com.mycompany.Main$1.myMethod` // - Java lambda method: // `com.mycompany.Main$$Lambda/0x0000748ae4149c00.myMethod` // - PHP function: `GuzzleHttp\Client::transfer` // - Go function: `github.com/my/repo/pkg.foo.func5` // - Elixir: `OpenTelemetry.Ctx.new` // - Erlang: `opentelemetry_ctx:new` // - Rust: `playground::my_module::my_cool_func` // - C function: `fopen` CodeFunctionNameKey = attribute.Key("code.function.name") // CodeLineNumberKey is the attribute Key conforming to the "code.line.number" // semantic conventions. It represents the line number in `code.file.path` best // representing the operation. It SHOULD point within the code unit named in // `code.function.name`. This attribute MUST NOT be used on the Profile signal // since the data is already captured in 'message Line'. This constraint is // imposed to prevent redundancy and maintain data integrity. // // Type: int // RequirementLevel: Recommended // Stability: Stable CodeLineNumberKey = attribute.Key("code.line.number") // CodeStacktraceKey is the attribute Key conforming to the "code.stacktrace" // semantic conventions. It represents a stacktrace as a string in the natural // representation for the language runtime. The representation is identical to // [`exception.stacktrace`]. This attribute MUST NOT be used on the Profile // signal since the data is already captured in 'message Location'. This // constraint is imposed to prevent redundancy and maintain data integrity. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\n at // com.example.GenerateTrace.methodA(GenerateTrace.java:9)\n at // com.example.GenerateTrace.main(GenerateTrace.java:5) // // [`exception.stacktrace`]: /docs/exceptions/exceptions-spans.md#stacktrace-representation CodeStacktraceKey = attribute.Key("code.stacktrace") ) // CodeColumnNumber returns an attribute KeyValue conforming to the // "code.column.number" semantic conventions. It represents the column number in // `code.file.path` best representing the operation. It SHOULD point within the // code unit named in `code.function.name`. This attribute MUST NOT be used on // the Profile signal since the data is already captured in 'message Line'. This // constraint is imposed to prevent redundancy and maintain data integrity. func CodeColumnNumber(val int) attribute.KeyValue { return CodeColumnNumberKey.Int(val) } // CodeFilePath returns an attribute KeyValue conforming to the "code.file.path" // semantic conventions. It represents the source code file name that identifies // the code unit as uniquely as possible (preferably an absolute file path). This // attribute MUST NOT be used on the Profile signal since the data is already // captured in 'message Function'. This constraint is imposed to prevent // redundancy and maintain data integrity. func CodeFilePath(val string) attribute.KeyValue { return CodeFilePathKey.String(val) } // CodeFunctionName returns an attribute KeyValue conforming to the // "code.function.name" semantic conventions. It represents the method or // function fully-qualified name without arguments. The value should fit the // natural representation of the language runtime, which is also likely the same // used within `code.stacktrace` attribute value. This attribute MUST NOT be used // on the Profile signal since the data is already captured in 'message // Function'. This constraint is imposed to prevent redundancy and maintain data // integrity. func CodeFunctionName(val string) attribute.KeyValue { return CodeFunctionNameKey.String(val) } // CodeLineNumber returns an attribute KeyValue conforming to the // "code.line.number" semantic conventions. It represents the line number in // `code.file.path` best representing the operation. It SHOULD point within the // code unit named in `code.function.name`. This attribute MUST NOT be used on // the Profile signal since the data is already captured in 'message Line'. This // constraint is imposed to prevent redundancy and maintain data integrity. func CodeLineNumber(val int) attribute.KeyValue { return CodeLineNumberKey.Int(val) } // CodeStacktrace returns an attribute KeyValue conforming to the // "code.stacktrace" semantic conventions. It represents a stacktrace as a string // in the natural representation for the language runtime. The representation is // identical to [`exception.stacktrace`]. This attribute MUST NOT be used on the // Profile signal since the data is already captured in 'message Location'. This // constraint is imposed to prevent redundancy and maintain data integrity. // // [`exception.stacktrace`]: /docs/exceptions/exceptions-spans.md#stacktrace-representation func CodeStacktrace(val string) attribute.KeyValue { return CodeStacktraceKey.String(val) } // Namespace: container const ( // ContainerCommandKey is the attribute Key conforming to the // "container.command" semantic conventions. It represents the command used to // run the container (i.e. the command name). // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "otelcontribcol" // Note: If using embedded credentials or sensitive data, it is recommended to // remove them to prevent potential leakage. ContainerCommandKey = attribute.Key("container.command") // ContainerCommandArgsKey is the attribute Key conforming to the // "container.command_args" semantic conventions. It represents the all the // command arguments (including the command/executable itself) run by the // container. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "otelcontribcol", "--config", "config.yaml" ContainerCommandArgsKey = attribute.Key("container.command_args") // ContainerCommandLineKey is the attribute Key conforming to the // "container.command_line" semantic conventions. It represents the full command // run by the container as a single string representing the full command. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "otelcontribcol --config config.yaml" ContainerCommandLineKey = attribute.Key("container.command_line") // ContainerCSIPluginNameKey is the attribute Key conforming to the // "container.csi.plugin.name" semantic conventions. It represents the name of // the CSI ([Container Storage Interface]) plugin used by the volume. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "pd.csi.storage.gke.io" // Note: This can sometimes be referred to as a "driver" in CSI implementations. // This should represent the `name` field of the GetPluginInfo RPC. // // [Container Storage Interface]: https://github.com/container-storage-interface/spec ContainerCSIPluginNameKey = attribute.Key("container.csi.plugin.name") // ContainerCSIVolumeIDKey is the attribute Key conforming to the // "container.csi.volume.id" semantic conventions. It represents the unique // volume ID returned by the CSI ([Container Storage Interface]) plugin. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "projects/my-gcp-project/zones/my-gcp-zone/disks/my-gcp-disk" // Note: This can sometimes be referred to as a "volume handle" in CSI // implementations. This should represent the `Volume.volume_id` field in CSI // spec. // // [Container Storage Interface]: https://github.com/container-storage-interface/spec ContainerCSIVolumeIDKey = attribute.Key("container.csi.volume.id") // ContainerIDKey is the attribute Key conforming to the "container.id" semantic // conventions. It represents the container ID. Usually a UUID, as for example // used to [identify Docker containers]. The UUID might be abbreviated. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "a3bf90e006b2" // // [identify Docker containers]: https://docs.docker.com/engine/containers/run/#container-identification ContainerIDKey = attribute.Key("container.id") // ContainerImageIDKey is the attribute Key conforming to the // "container.image.id" semantic conventions. It represents the runtime specific // image identifier. Usually a hash algorithm followed by a UUID. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: // "sha256:19c92d0a00d1b66d897bceaa7319bee0dd38a10a851c60bcec9474aa3f01e50f" // Note: Docker defines a sha256 of the image id; `container.image.id` // corresponds to the `Image` field from the Docker container inspect [API] // endpoint. // K8s defines a link to the container registry repository with digest // `"imageID": "registry.azurecr.io /namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625"` // . // The ID is assigned by the container runtime and can vary in different // environments. Consider using `oci.manifest.digest` if it is important to // identify the same image in different environments/runtimes. // // [API]: https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerInspect ContainerImageIDKey = attribute.Key("container.image.id") // ContainerImageNameKey is the attribute Key conforming to the // "container.image.name" semantic conventions. It represents the name of the // image the container was built on. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "gcr.io/opentelemetry/operator" ContainerImageNameKey = attribute.Key("container.image.name") // ContainerImageRepoDigestsKey is the attribute Key conforming to the // "container.image.repo_digests" semantic conventions. It represents the repo // digests of the container image as provided by the container runtime. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: // "example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb", // "internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578" // Note: [Docker] and [CRI] report those under the `RepoDigests` field. // // [Docker]: https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect // [CRI]: https://github.com/kubernetes/cri-api/blob/c75ef5b473bbe2d0a4fc92f82235efd665ea8e9f/pkg/apis/runtime/v1/api.proto#L1237-L1238 ContainerImageRepoDigestsKey = attribute.Key("container.image.repo_digests") // ContainerImageTagsKey is the attribute Key conforming to the // "container.image.tags" semantic conventions. It represents the container // image tags. An example can be found in [Docker Image Inspect]. Should be only // the `` section of the full name for example from // `registry.example.com/my-org/my-image:`. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "v1.27.1", "3.5.7-0" // // [Docker Image Inspect]: https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect ContainerImageTagsKey = attribute.Key("container.image.tags") // ContainerNameKey is the attribute Key conforming to the "container.name" // semantic conventions. It represents the container name used by container // runtime. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "opentelemetry-autoconf" ContainerNameKey = attribute.Key("container.name") // ContainerRuntimeDescriptionKey is the attribute Key conforming to the // "container.runtime.description" semantic conventions. It represents a // description about the runtime which could include, for example details about // the CRI/API version being used or other customisations. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "docker://19.3.1 - CRI: 1.22.0" ContainerRuntimeDescriptionKey = attribute.Key("container.runtime.description") // ContainerRuntimeNameKey is the attribute Key conforming to the // "container.runtime.name" semantic conventions. It represents the container // runtime managing this container. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "docker", "containerd", "rkt" ContainerRuntimeNameKey = attribute.Key("container.runtime.name") // ContainerRuntimeVersionKey is the attribute Key conforming to the // "container.runtime.version" semantic conventions. It represents the version // of the runtime of this process, as returned by the runtime without // modification. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: 1.0.0 ContainerRuntimeVersionKey = attribute.Key("container.runtime.version") ) // ContainerCommand returns an attribute KeyValue conforming to the // "container.command" semantic conventions. It represents the command used to // run the container (i.e. the command name). func ContainerCommand(val string) attribute.KeyValue { return ContainerCommandKey.String(val) } // ContainerCommandArgs returns an attribute KeyValue conforming to the // "container.command_args" semantic conventions. It represents the all the // command arguments (including the command/executable itself) run by the // container. func ContainerCommandArgs(val ...string) attribute.KeyValue { return ContainerCommandArgsKey.StringSlice(val) } // ContainerCommandLine returns an attribute KeyValue conforming to the // "container.command_line" semantic conventions. It represents the full command // run by the container as a single string representing the full command. func ContainerCommandLine(val string) attribute.KeyValue { return ContainerCommandLineKey.String(val) } // ContainerCSIPluginName returns an attribute KeyValue conforming to the // "container.csi.plugin.name" semantic conventions. It represents the name of // the CSI ([Container Storage Interface]) plugin used by the volume. // // [Container Storage Interface]: https://github.com/container-storage-interface/spec func ContainerCSIPluginName(val string) attribute.KeyValue { return ContainerCSIPluginNameKey.String(val) } // ContainerCSIVolumeID returns an attribute KeyValue conforming to the // "container.csi.volume.id" semantic conventions. It represents the unique // volume ID returned by the CSI ([Container Storage Interface]) plugin. // // [Container Storage Interface]: https://github.com/container-storage-interface/spec func ContainerCSIVolumeID(val string) attribute.KeyValue { return ContainerCSIVolumeIDKey.String(val) } // ContainerID returns an attribute KeyValue conforming to the "container.id" // semantic conventions. It represents the container ID. Usually a UUID, as for // example used to [identify Docker containers]. The UUID might be abbreviated. // // [identify Docker containers]: https://docs.docker.com/engine/containers/run/#container-identification func ContainerID(val string) attribute.KeyValue { return ContainerIDKey.String(val) } // ContainerImageID returns an attribute KeyValue conforming to the // "container.image.id" semantic conventions. It represents the runtime specific // image identifier. Usually a hash algorithm followed by a UUID. func ContainerImageID(val string) attribute.KeyValue { return ContainerImageIDKey.String(val) } // ContainerImageName returns an attribute KeyValue conforming to the // "container.image.name" semantic conventions. It represents the name of the // image the container was built on. func ContainerImageName(val string) attribute.KeyValue { return ContainerImageNameKey.String(val) } // ContainerImageRepoDigests returns an attribute KeyValue conforming to the // "container.image.repo_digests" semantic conventions. It represents the repo // digests of the container image as provided by the container runtime. func ContainerImageRepoDigests(val ...string) attribute.KeyValue { return ContainerImageRepoDigestsKey.StringSlice(val) } // ContainerImageTags returns an attribute KeyValue conforming to the // "container.image.tags" semantic conventions. It represents the container image // tags. An example can be found in [Docker Image Inspect]. Should be only the // `` section of the full name for example from // `registry.example.com/my-org/my-image:`. // // [Docker Image Inspect]: https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect func ContainerImageTags(val ...string) attribute.KeyValue { return ContainerImageTagsKey.StringSlice(val) } // ContainerLabel returns an attribute KeyValue conforming to the // "container.label" semantic conventions. It represents the container labels, // `` being the label name, the value being the label value. func ContainerLabel(key string, val string) attribute.KeyValue { return attribute.String("container.label."+key, val) } // ContainerName returns an attribute KeyValue conforming to the "container.name" // semantic conventions. It represents the container name used by container // runtime. func ContainerName(val string) attribute.KeyValue { return ContainerNameKey.String(val) } // ContainerRuntimeDescription returns an attribute KeyValue conforming to the // "container.runtime.description" semantic conventions. It represents a // description about the runtime which could include, for example details about // the CRI/API version being used or other customisations. func ContainerRuntimeDescription(val string) attribute.KeyValue { return ContainerRuntimeDescriptionKey.String(val) } // ContainerRuntimeName returns an attribute KeyValue conforming to the // "container.runtime.name" semantic conventions. It represents the container // runtime managing this container. func ContainerRuntimeName(val string) attribute.KeyValue { return ContainerRuntimeNameKey.String(val) } // ContainerRuntimeVersion returns an attribute KeyValue conforming to the // "container.runtime.version" semantic conventions. It represents the version of // the runtime of this process, as returned by the runtime without modification. func ContainerRuntimeVersion(val string) attribute.KeyValue { return ContainerRuntimeVersionKey.String(val) } // Namespace: cpu const ( // CPULogicalNumberKey is the attribute Key conforming to the // "cpu.logical_number" semantic conventions. It represents the logical CPU // number [0..n-1]. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 1 CPULogicalNumberKey = attribute.Key("cpu.logical_number") // CPUModeKey is the attribute Key conforming to the "cpu.mode" semantic // conventions. It represents the mode of the CPU. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "user", "system" CPUModeKey = attribute.Key("cpu.mode") ) // CPULogicalNumber returns an attribute KeyValue conforming to the // "cpu.logical_number" semantic conventions. It represents the logical CPU // number [0..n-1]. func CPULogicalNumber(val int) attribute.KeyValue { return CPULogicalNumberKey.Int(val) } // Enum values for cpu.mode var ( // User // Stability: development CPUModeUser = CPUModeKey.String("user") // System // Stability: development CPUModeSystem = CPUModeKey.String("system") // Nice // Stability: development CPUModeNice = CPUModeKey.String("nice") // Idle // Stability: development CPUModeIdle = CPUModeKey.String("idle") // IO Wait // Stability: development CPUModeIOWait = CPUModeKey.String("iowait") // Interrupt // Stability: development CPUModeInterrupt = CPUModeKey.String("interrupt") // Steal // Stability: development CPUModeSteal = CPUModeKey.String("steal") // Kernel // Stability: development CPUModeKernel = CPUModeKey.String("kernel") ) // Namespace: db const ( // DBClientConnectionPoolNameKey is the attribute Key conforming to the // "db.client.connection.pool.name" semantic conventions. It represents the name // of the connection pool; unique within the instrumented application. In case // the connection pool implementation doesn't provide a name, instrumentation // SHOULD use a combination of parameters that would make the name unique, for // example, combining attributes `server.address`, `server.port`, and // `db.namespace`, formatted as `server.address:server.port/db.namespace`. // Instrumentations that generate connection pool name following different // patterns SHOULD document it. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "myDataSource" DBClientConnectionPoolNameKey = attribute.Key("db.client.connection.pool.name") // DBClientConnectionStateKey is the attribute Key conforming to the // "db.client.connection.state" semantic conventions. It represents the state of // a connection in the pool. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "idle" DBClientConnectionStateKey = attribute.Key("db.client.connection.state") // DBCollectionNameKey is the attribute Key conforming to the // "db.collection.name" semantic conventions. It represents the name of a // collection (table, container) within the database. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "public.users", "customers" // Note: It is RECOMMENDED to capture the value as provided by the application // without attempting to do any case normalization. // // The collection name SHOULD NOT be extracted from `db.query.text`, // when the database system supports query text with multiple collections // in non-batch operations. // // For batch operations, if the individual operations are known to have the same // collection name then that collection name SHOULD be used. DBCollectionNameKey = attribute.Key("db.collection.name") // DBNamespaceKey is the attribute Key conforming to the "db.namespace" semantic // conventions. It represents the name of the database, fully qualified within // the server address and port. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "customers", "test.users" // Note: If a database system has multiple namespace components, they SHOULD be // concatenated from the most general to the most specific namespace component, // using `|` as a separator between the components. Any missing components (and // their associated separators) SHOULD be omitted. // Semantic conventions for individual database systems SHOULD document what // `db.namespace` means in the context of that system. // It is RECOMMENDED to capture the value as provided by the application without // attempting to do any case normalization. DBNamespaceKey = attribute.Key("db.namespace") // DBOperationBatchSizeKey is the attribute Key conforming to the // "db.operation.batch.size" semantic conventions. It represents the number of // queries included in a batch operation. // // Type: int // RequirementLevel: Recommended // Stability: Stable // // Examples: 2, 3, 4 // Note: Operations are only considered batches when they contain two or more // operations, and so `db.operation.batch.size` SHOULD never be `1`. DBOperationBatchSizeKey = attribute.Key("db.operation.batch.size") // DBOperationNameKey is the attribute Key conforming to the "db.operation.name" // semantic conventions. It represents the name of the operation or command // being executed. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "findAndModify", "HMSET", "SELECT" // Note: It is RECOMMENDED to capture the value as provided by the application // without attempting to do any case normalization. // // The operation name SHOULD NOT be extracted from `db.query.text`, // when the database system supports query text with multiple operations // in non-batch operations. // // If spaces can occur in the operation name, multiple consecutive spaces // SHOULD be normalized to a single space. // // For batch operations, if the individual operations are known to have the same // operation name // then that operation name SHOULD be used prepended by `BATCH `, // otherwise `db.operation.name` SHOULD be `BATCH` or some other database // system specific term if more applicable. DBOperationNameKey = attribute.Key("db.operation.name") // DBQuerySummaryKey is the attribute Key conforming to the "db.query.summary" // semantic conventions. It represents the low cardinality summary of a database // query. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "SELECT wuser_table", "INSERT shipping_details SELECT orders", "get // user by id" // Note: The query summary describes a class of database queries and is useful // as a grouping key, especially when analyzing telemetry for database // calls involving complex queries. // // Summary may be available to the instrumentation through // instrumentation hooks or other means. If it is not available, // instrumentations // that support query parsing SHOULD generate a summary following // [Generating query summary] // section. // // [Generating query summary]: /docs/database/database-spans.md#generating-a-summary-of-the-query DBQuerySummaryKey = attribute.Key("db.query.summary") // DBQueryTextKey is the attribute Key conforming to the "db.query.text" // semantic conventions. It represents the database query being executed. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "SELECT * FROM wuser_table where username = ?", "SET mykey ?" // Note: For sanitization see [Sanitization of `db.query.text`]. // For batch operations, if the individual operations are known to have the same // query text then that query text SHOULD be used, otherwise all of the // individual query texts SHOULD be concatenated with separator `; ` or some // other database system specific separator if more applicable. // Parameterized query text SHOULD NOT be sanitized. Even though parameterized // query text can potentially have sensitive data, by using a parameterized // query the user is giving a strong signal that any sensitive data will be // passed as parameter values, and the benefit to observability of capturing the // static part of the query text by default outweighs the risk. // // [Sanitization of `db.query.text`]: /docs/database/database-spans.md#sanitization-of-dbquerytext DBQueryTextKey = attribute.Key("db.query.text") // DBResponseReturnedRowsKey is the attribute Key conforming to the // "db.response.returned_rows" semantic conventions. It represents the number of // rows returned by the operation. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 10, 30, 1000 DBResponseReturnedRowsKey = attribute.Key("db.response.returned_rows") // DBResponseStatusCodeKey is the attribute Key conforming to the // "db.response.status_code" semantic conventions. It represents the database // response status code. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "102", "ORA-17002", "08P01", "404" // Note: The status code returned by the database. Usually it represents an // error code, but may also represent partial success, warning, or differentiate // between various types of successful outcomes. // Semantic conventions for individual database systems SHOULD document what // `db.response.status_code` means in the context of that system. DBResponseStatusCodeKey = attribute.Key("db.response.status_code") // DBStoredProcedureNameKey is the attribute Key conforming to the // "db.stored_procedure.name" semantic conventions. It represents the name of a // stored procedure within the database. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "GetCustomer" // Note: It is RECOMMENDED to capture the value as provided by the application // without attempting to do any case normalization. // // For batch operations, if the individual operations are known to have the same // stored procedure name then that stored procedure name SHOULD be used. DBStoredProcedureNameKey = attribute.Key("db.stored_procedure.name") // DBSystemNameKey is the attribute Key conforming to the "db.system.name" // semantic conventions. It represents the database management system (DBMS) // product as identified by the client instrumentation. // // Type: Enum // RequirementLevel: Recommended // Stability: Stable // // Examples: // Note: The actual DBMS may differ from the one identified by the client. For // example, when using PostgreSQL client libraries to connect to a CockroachDB, // the `db.system.name` is set to `postgresql` based on the instrumentation's // best knowledge. DBSystemNameKey = attribute.Key("db.system.name") ) // DBClientConnectionPoolName returns an attribute KeyValue conforming to the // "db.client.connection.pool.name" semantic conventions. It represents the name // of the connection pool; unique within the instrumented application. In case // the connection pool implementation doesn't provide a name, instrumentation // SHOULD use a combination of parameters that would make the name unique, for // example, combining attributes `server.address`, `server.port`, and // `db.namespace`, formatted as `server.address:server.port/db.namespace`. // Instrumentations that generate connection pool name following different // patterns SHOULD document it. func DBClientConnectionPoolName(val string) attribute.KeyValue { return DBClientConnectionPoolNameKey.String(val) } // DBCollectionName returns an attribute KeyValue conforming to the // "db.collection.name" semantic conventions. It represents the name of a // collection (table, container) within the database. func DBCollectionName(val string) attribute.KeyValue { return DBCollectionNameKey.String(val) } // DBNamespace returns an attribute KeyValue conforming to the "db.namespace" // semantic conventions. It represents the name of the database, fully qualified // within the server address and port. func DBNamespace(val string) attribute.KeyValue { return DBNamespaceKey.String(val) } // DBOperationBatchSize returns an attribute KeyValue conforming to the // "db.operation.batch.size" semantic conventions. It represents the number of // queries included in a batch operation. func DBOperationBatchSize(val int) attribute.KeyValue { return DBOperationBatchSizeKey.Int(val) } // DBOperationName returns an attribute KeyValue conforming to the // "db.operation.name" semantic conventions. It represents the name of the // operation or command being executed. func DBOperationName(val string) attribute.KeyValue { return DBOperationNameKey.String(val) } // DBOperationParameter returns an attribute KeyValue conforming to the // "db.operation.parameter" semantic conventions. It represents a database // operation parameter, with `` being the parameter name, and the attribute // value being a string representation of the parameter value. func DBOperationParameter(key string, val string) attribute.KeyValue { return attribute.String("db.operation.parameter."+key, val) } // DBQueryParameter returns an attribute KeyValue conforming to the // "db.query.parameter" semantic conventions. It represents a database query // parameter, with `` being the parameter name, and the attribute value // being a string representation of the parameter value. func DBQueryParameter(key string, val string) attribute.KeyValue { return attribute.String("db.query.parameter."+key, val) } // DBQuerySummary returns an attribute KeyValue conforming to the // "db.query.summary" semantic conventions. It represents the low cardinality // summary of a database query. func DBQuerySummary(val string) attribute.KeyValue { return DBQuerySummaryKey.String(val) } // DBQueryText returns an attribute KeyValue conforming to the "db.query.text" // semantic conventions. It represents the database query being executed. func DBQueryText(val string) attribute.KeyValue { return DBQueryTextKey.String(val) } // DBResponseReturnedRows returns an attribute KeyValue conforming to the // "db.response.returned_rows" semantic conventions. It represents the number of // rows returned by the operation. func DBResponseReturnedRows(val int) attribute.KeyValue { return DBResponseReturnedRowsKey.Int(val) } // DBResponseStatusCode returns an attribute KeyValue conforming to the // "db.response.status_code" semantic conventions. It represents the database // response status code. func DBResponseStatusCode(val string) attribute.KeyValue { return DBResponseStatusCodeKey.String(val) } // DBStoredProcedureName returns an attribute KeyValue conforming to the // "db.stored_procedure.name" semantic conventions. It represents the name of a // stored procedure within the database. func DBStoredProcedureName(val string) attribute.KeyValue { return DBStoredProcedureNameKey.String(val) } // Enum values for db.client.connection.state var ( // idle // Stability: development DBClientConnectionStateIdle = DBClientConnectionStateKey.String("idle") // used // Stability: development DBClientConnectionStateUsed = DBClientConnectionStateKey.String("used") ) // Enum values for db.system.name var ( // Some other SQL database. Fallback only. // Stability: development DBSystemNameOtherSQL = DBSystemNameKey.String("other_sql") // [Adabas (Adaptable Database System)] // Stability: development // // [Adabas (Adaptable Database System)]: https://documentation.softwareag.com/?pf=adabas DBSystemNameSoftwareagAdabas = DBSystemNameKey.String("softwareag.adabas") // [Actian Ingres] // Stability: development // // [Actian Ingres]: https://www.actian.com/databases/ingres/ DBSystemNameActianIngres = DBSystemNameKey.String("actian.ingres") // [Amazon DynamoDB] // Stability: development // // [Amazon DynamoDB]: https://aws.amazon.com/pm/dynamodb/ DBSystemNameAWSDynamoDB = DBSystemNameKey.String("aws.dynamodb") // [Amazon Redshift] // Stability: development // // [Amazon Redshift]: https://aws.amazon.com/redshift/ DBSystemNameAWSRedshift = DBSystemNameKey.String("aws.redshift") // [Azure Cosmos DB] // Stability: development // // [Azure Cosmos DB]: https://learn.microsoft.com/azure/cosmos-db DBSystemNameAzureCosmosDB = DBSystemNameKey.String("azure.cosmosdb") // [InterSystems Caché] // Stability: development // // [InterSystems Caché]: https://www.intersystems.com/products/cache/ DBSystemNameIntersystemsCache = DBSystemNameKey.String("intersystems.cache") // [Apache Cassandra] // Stability: development // // [Apache Cassandra]: https://cassandra.apache.org/ DBSystemNameCassandra = DBSystemNameKey.String("cassandra") // [ClickHouse] // Stability: development // // [ClickHouse]: https://clickhouse.com/ DBSystemNameClickHouse = DBSystemNameKey.String("clickhouse") // [CockroachDB] // Stability: development // // [CockroachDB]: https://www.cockroachlabs.com/ DBSystemNameCockroachDB = DBSystemNameKey.String("cockroachdb") // [Couchbase] // Stability: development // // [Couchbase]: https://www.couchbase.com/ DBSystemNameCouchbase = DBSystemNameKey.String("couchbase") // [Apache CouchDB] // Stability: development // // [Apache CouchDB]: https://couchdb.apache.org/ DBSystemNameCouchDB = DBSystemNameKey.String("couchdb") // [Apache Derby] // Stability: development // // [Apache Derby]: https://db.apache.org/derby/ DBSystemNameDerby = DBSystemNameKey.String("derby") // [Elasticsearch] // Stability: development // // [Elasticsearch]: https://www.elastic.co/elasticsearch DBSystemNameElasticsearch = DBSystemNameKey.String("elasticsearch") // [Firebird] // Stability: development // // [Firebird]: https://www.firebirdsql.org/ DBSystemNameFirebirdSQL = DBSystemNameKey.String("firebirdsql") // [Google Cloud Spanner] // Stability: development // // [Google Cloud Spanner]: https://cloud.google.com/spanner DBSystemNameGCPSpanner = DBSystemNameKey.String("gcp.spanner") // [Apache Geode] // Stability: development // // [Apache Geode]: https://geode.apache.org/ DBSystemNameGeode = DBSystemNameKey.String("geode") // [H2 Database] // Stability: development // // [H2 Database]: https://h2database.com/ DBSystemNameH2database = DBSystemNameKey.String("h2database") // [Apache HBase] // Stability: development // // [Apache HBase]: https://hbase.apache.org/ DBSystemNameHBase = DBSystemNameKey.String("hbase") // [Apache Hive] // Stability: development // // [Apache Hive]: https://hive.apache.org/ DBSystemNameHive = DBSystemNameKey.String("hive") // [HyperSQL Database] // Stability: development // // [HyperSQL Database]: https://hsqldb.org/ DBSystemNameHSQLDB = DBSystemNameKey.String("hsqldb") // [IBM Db2] // Stability: development // // [IBM Db2]: https://www.ibm.com/db2 DBSystemNameIBMDB2 = DBSystemNameKey.String("ibm.db2") // [IBM Informix] // Stability: development // // [IBM Informix]: https://www.ibm.com/products/informix DBSystemNameIBMInformix = DBSystemNameKey.String("ibm.informix") // [IBM Netezza] // Stability: development // // [IBM Netezza]: https://www.ibm.com/products/netezza DBSystemNameIBMNetezza = DBSystemNameKey.String("ibm.netezza") // [InfluxDB] // Stability: development // // [InfluxDB]: https://www.influxdata.com/ DBSystemNameInfluxDB = DBSystemNameKey.String("influxdb") // [Instant] // Stability: development // // [Instant]: https://www.instantdb.com/ DBSystemNameInstantDB = DBSystemNameKey.String("instantdb") // [MariaDB] // Stability: stable // // [MariaDB]: https://mariadb.org/ DBSystemNameMariaDB = DBSystemNameKey.String("mariadb") // [Memcached] // Stability: development // // [Memcached]: https://memcached.org/ DBSystemNameMemcached = DBSystemNameKey.String("memcached") // [MongoDB] // Stability: development // // [MongoDB]: https://www.mongodb.com/ DBSystemNameMongoDB = DBSystemNameKey.String("mongodb") // [Microsoft SQL Server] // Stability: stable // // [Microsoft SQL Server]: https://www.microsoft.com/sql-server DBSystemNameMicrosoftSQLServer = DBSystemNameKey.String("microsoft.sql_server") // [MySQL] // Stability: stable // // [MySQL]: https://www.mysql.com/ DBSystemNameMySQL = DBSystemNameKey.String("mysql") // [Neo4j] // Stability: development // // [Neo4j]: https://neo4j.com/ DBSystemNameNeo4j = DBSystemNameKey.String("neo4j") // [OpenSearch] // Stability: development // // [OpenSearch]: https://opensearch.org/ DBSystemNameOpenSearch = DBSystemNameKey.String("opensearch") // [Oracle Database] // Stability: development // // [Oracle Database]: https://www.oracle.com/database/ DBSystemNameOracleDB = DBSystemNameKey.String("oracle.db") // [PostgreSQL] // Stability: stable // // [PostgreSQL]: https://www.postgresql.org/ DBSystemNamePostgreSQL = DBSystemNameKey.String("postgresql") // [Redis] // Stability: development // // [Redis]: https://redis.io/ DBSystemNameRedis = DBSystemNameKey.String("redis") // [SAP HANA] // Stability: development // // [SAP HANA]: https://www.sap.com/products/technology-platform/hana/what-is-sap-hana.html DBSystemNameSAPHANA = DBSystemNameKey.String("sap.hana") // [SAP MaxDB] // Stability: development // // [SAP MaxDB]: https://maxdb.sap.com/ DBSystemNameSAPMaxDB = DBSystemNameKey.String("sap.maxdb") // [SQLite] // Stability: development // // [SQLite]: https://www.sqlite.org/ DBSystemNameSQLite = DBSystemNameKey.String("sqlite") // [Teradata] // Stability: development // // [Teradata]: https://www.teradata.com/ DBSystemNameTeradata = DBSystemNameKey.String("teradata") // [Trino] // Stability: development // // [Trino]: https://trino.io/ DBSystemNameTrino = DBSystemNameKey.String("trino") ) // Namespace: deployment const ( // DeploymentEnvironmentNameKey is the attribute Key conforming to the // "deployment.environment.name" semantic conventions. It represents the name of // the [deployment environment] (aka deployment tier). // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "staging", "production" // Note: `deployment.environment.name` does not affect the uniqueness // constraints defined through // the `service.namespace`, `service.name` and `service.instance.id` resource // attributes. // This implies that resources carrying the following attribute combinations // MUST be // considered to be identifying the same service: // // - `service.name=frontend`, `deployment.environment.name=production` // - `service.name=frontend`, `deployment.environment.name=staging`. // // // [deployment environment]: https://wikipedia.org/wiki/Deployment_environment DeploymentEnvironmentNameKey = attribute.Key("deployment.environment.name") // DeploymentIDKey is the attribute Key conforming to the "deployment.id" // semantic conventions. It represents the id of the deployment. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "1208" DeploymentIDKey = attribute.Key("deployment.id") // DeploymentNameKey is the attribute Key conforming to the "deployment.name" // semantic conventions. It represents the name of the deployment. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "deploy my app", "deploy-frontend" DeploymentNameKey = attribute.Key("deployment.name") // DeploymentStatusKey is the attribute Key conforming to the // "deployment.status" semantic conventions. It represents the status of the // deployment. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: DeploymentStatusKey = attribute.Key("deployment.status") ) // DeploymentEnvironmentName returns an attribute KeyValue conforming to the // "deployment.environment.name" semantic conventions. It represents the name of // the [deployment environment] (aka deployment tier). // // [deployment environment]: https://wikipedia.org/wiki/Deployment_environment func DeploymentEnvironmentName(val string) attribute.KeyValue { return DeploymentEnvironmentNameKey.String(val) } // DeploymentID returns an attribute KeyValue conforming to the "deployment.id" // semantic conventions. It represents the id of the deployment. func DeploymentID(val string) attribute.KeyValue { return DeploymentIDKey.String(val) } // DeploymentName returns an attribute KeyValue conforming to the // "deployment.name" semantic conventions. It represents the name of the // deployment. func DeploymentName(val string) attribute.KeyValue { return DeploymentNameKey.String(val) } // Enum values for deployment.status var ( // failed // Stability: development DeploymentStatusFailed = DeploymentStatusKey.String("failed") // succeeded // Stability: development DeploymentStatusSucceeded = DeploymentStatusKey.String("succeeded") ) // Namespace: destination const ( // DestinationAddressKey is the attribute Key conforming to the // "destination.address" semantic conventions. It represents the destination // address - domain name if available without reverse DNS lookup; otherwise, IP // address or Unix domain socket name. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "destination.example.com", "10.1.2.80", "/tmp/my.sock" // Note: When observed from the source side, and when communicating through an // intermediary, `destination.address` SHOULD represent the destination address // behind any intermediaries, for example proxies, if it's available. DestinationAddressKey = attribute.Key("destination.address") // DestinationPortKey is the attribute Key conforming to the "destination.port" // semantic conventions. It represents the destination port number. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 3389, 2888 DestinationPortKey = attribute.Key("destination.port") ) // DestinationAddress returns an attribute KeyValue conforming to the // "destination.address" semantic conventions. It represents the destination // address - domain name if available without reverse DNS lookup; otherwise, IP // address or Unix domain socket name. func DestinationAddress(val string) attribute.KeyValue { return DestinationAddressKey.String(val) } // DestinationPort returns an attribute KeyValue conforming to the // "destination.port" semantic conventions. It represents the destination port // number. func DestinationPort(val int) attribute.KeyValue { return DestinationPortKey.Int(val) } // Namespace: device const ( // DeviceIDKey is the attribute Key conforming to the "device.id" semantic // conventions. It represents a unique identifier representing the device. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "123456789012345", "01:23:45:67:89:AB" // Note: Its value SHOULD be identical for all apps on a device and it SHOULD // NOT change if an app is uninstalled and re-installed. // However, it might be resettable by the user for all apps on a device. // Hardware IDs (e.g. vendor-specific serial number, IMEI or MAC address) MAY be // used as values. // // More information about Android identifier best practices can be found in the // [Android user data IDs guide]. // // > [!WARNING]> This attribute may contain sensitive (PII) information. Caution // > should be taken when storing personal data or anything which can identify a // > user. GDPR and data protection laws may apply, // > ensure you do your own due diligence.> Due to these reasons, this // > identifier is not recommended for consumer applications and will likely // > result in rejection from both Google Play and App Store. // > However, it may be appropriate for specific enterprise scenarios, such as // > kiosk devices or enterprise-managed devices, with appropriate compliance // > clearance. // > Any instrumentation providing this identifier MUST implement it as an // > opt-in feature.> See [`app.installation.id`]> for a more // > privacy-preserving alternative. // // [Android user data IDs guide]: https://developer.android.com/training/articles/user-data-ids // [`app.installation.id`]: /docs/registry/attributes/app.md#app-installation-id DeviceIDKey = attribute.Key("device.id") // DeviceManufacturerKey is the attribute Key conforming to the // "device.manufacturer" semantic conventions. It represents the name of the // device manufacturer. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Apple", "Samsung" // Note: The Android OS provides this field via [Build]. iOS apps SHOULD // hardcode the value `Apple`. // // [Build]: https://developer.android.com/reference/android/os/Build#MANUFACTURER DeviceManufacturerKey = attribute.Key("device.manufacturer") // DeviceModelIdentifierKey is the attribute Key conforming to the // "device.model.identifier" semantic conventions. It represents the model // identifier for the device. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "iPhone3,4", "SM-G920F" // Note: It's recommended this value represents a machine-readable version of // the model identifier rather than the market or consumer-friendly name of the // device. DeviceModelIdentifierKey = attribute.Key("device.model.identifier") // DeviceModelNameKey is the attribute Key conforming to the "device.model.name" // semantic conventions. It represents the marketing name for the device model. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "iPhone 6s Plus", "Samsung Galaxy S6" // Note: It's recommended this value represents a human-readable version of the // device model rather than a machine-readable alternative. DeviceModelNameKey = attribute.Key("device.model.name") ) // DeviceID returns an attribute KeyValue conforming to the "device.id" semantic // conventions. It represents a unique identifier representing the device. func DeviceID(val string) attribute.KeyValue { return DeviceIDKey.String(val) } // DeviceManufacturer returns an attribute KeyValue conforming to the // "device.manufacturer" semantic conventions. It represents the name of the // device manufacturer. func DeviceManufacturer(val string) attribute.KeyValue { return DeviceManufacturerKey.String(val) } // DeviceModelIdentifier returns an attribute KeyValue conforming to the // "device.model.identifier" semantic conventions. It represents the model // identifier for the device. func DeviceModelIdentifier(val string) attribute.KeyValue { return DeviceModelIdentifierKey.String(val) } // DeviceModelName returns an attribute KeyValue conforming to the // "device.model.name" semantic conventions. It represents the marketing name for // the device model. func DeviceModelName(val string) attribute.KeyValue { return DeviceModelNameKey.String(val) } // Namespace: disk const ( // DiskIODirectionKey is the attribute Key conforming to the "disk.io.direction" // semantic conventions. It represents the disk IO operation direction. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "read" DiskIODirectionKey = attribute.Key("disk.io.direction") ) // Enum values for disk.io.direction var ( // read // Stability: development DiskIODirectionRead = DiskIODirectionKey.String("read") // write // Stability: development DiskIODirectionWrite = DiskIODirectionKey.String("write") ) // Namespace: dns const ( // DNSAnswersKey is the attribute Key conforming to the "dns.answers" semantic // conventions. It represents the list of IPv4 or IPv6 addresses resolved during // DNS lookup. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "10.0.0.1", "2001:0db8:85a3:0000:0000:8a2e:0370:7334" DNSAnswersKey = attribute.Key("dns.answers") // DNSQuestionNameKey is the attribute Key conforming to the "dns.question.name" // semantic conventions. It represents the name being queried. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "www.example.com", "opentelemetry.io" // Note: If the name field contains non-printable characters (below 32 or above // 126), those characters should be represented as escaped base 10 integers // (\DDD). Back slashes and quotes should be escaped. Tabs, carriage returns, // and line feeds should be converted to \t, \r, and \n respectively. DNSQuestionNameKey = attribute.Key("dns.question.name") ) // DNSAnswers returns an attribute KeyValue conforming to the "dns.answers" // semantic conventions. It represents the list of IPv4 or IPv6 addresses // resolved during DNS lookup. func DNSAnswers(val ...string) attribute.KeyValue { return DNSAnswersKey.StringSlice(val) } // DNSQuestionName returns an attribute KeyValue conforming to the // "dns.question.name" semantic conventions. It represents the name being // queried. func DNSQuestionName(val string) attribute.KeyValue { return DNSQuestionNameKey.String(val) } // Namespace: elasticsearch const ( // ElasticsearchNodeNameKey is the attribute Key conforming to the // "elasticsearch.node.name" semantic conventions. It represents the represents // the human-readable identifier of the node/instance to which a request was // routed. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "instance-0000000001" ElasticsearchNodeNameKey = attribute.Key("elasticsearch.node.name") ) // ElasticsearchNodeName returns an attribute KeyValue conforming to the // "elasticsearch.node.name" semantic conventions. It represents the represents // the human-readable identifier of the node/instance to which a request was // routed. func ElasticsearchNodeName(val string) attribute.KeyValue { return ElasticsearchNodeNameKey.String(val) } // Namespace: enduser const ( // EnduserIDKey is the attribute Key conforming to the "enduser.id" semantic // conventions. It represents the unique identifier of an end user in the // system. It maybe a username, email address, or other identifier. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "username" // Note: Unique identifier of an end user in the system. // // > [!Warning] // > This field contains sensitive (PII) information. EnduserIDKey = attribute.Key("enduser.id") // EnduserPseudoIDKey is the attribute Key conforming to the "enduser.pseudo.id" // semantic conventions. It represents the pseudonymous identifier of an end // user. This identifier should be a random value that is not directly linked or // associated with the end user's actual identity. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "QdH5CAWJgqVT4rOr0qtumf" // Note: Pseudonymous identifier of an end user. // // > [!Warning] // > This field contains sensitive (linkable PII) information. EnduserPseudoIDKey = attribute.Key("enduser.pseudo.id") ) // EnduserID returns an attribute KeyValue conforming to the "enduser.id" // semantic conventions. It represents the unique identifier of an end user in // the system. It maybe a username, email address, or other identifier. func EnduserID(val string) attribute.KeyValue { return EnduserIDKey.String(val) } // EnduserPseudoID returns an attribute KeyValue conforming to the // "enduser.pseudo.id" semantic conventions. It represents the pseudonymous // identifier of an end user. This identifier should be a random value that is // not directly linked or associated with the end user's actual identity. func EnduserPseudoID(val string) attribute.KeyValue { return EnduserPseudoIDKey.String(val) } // Namespace: error const ( // ErrorMessageKey is the attribute Key conforming to the "error.message" // semantic conventions. It represents a message providing more detail about an // error in human-readable form. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Unexpected input type: string", "The user has exceeded their // storage quota" // Note: `error.message` should provide additional context and detail about an // error. // It is NOT RECOMMENDED to duplicate the value of `error.type` in // `error.message`. // It is also NOT RECOMMENDED to duplicate the value of `exception.message` in // `error.message`. // // `error.message` is NOT RECOMMENDED for metrics or spans due to its unbounded // cardinality and overlap with span status. ErrorMessageKey = attribute.Key("error.message") // ErrorTypeKey is the attribute Key conforming to the "error.type" semantic // conventions. It represents the describes a class of error the operation ended // with. // // Type: Enum // RequirementLevel: Recommended // Stability: Stable // // Examples: "timeout", "java.net.UnknownHostException", // "server_certificate_invalid", "500" // Note: The `error.type` SHOULD be predictable, and SHOULD have low // cardinality. // // When `error.type` is set to a type (e.g., an exception type), its // canonical class name identifying the type within the artifact SHOULD be used. // // Instrumentations SHOULD document the list of errors they report. // // The cardinality of `error.type` within one instrumentation library SHOULD be // low. // Telemetry consumers that aggregate data from multiple instrumentation // libraries and applications // should be prepared for `error.type` to have high cardinality at query time // when no // additional filters are applied. // // If the operation has completed successfully, instrumentations SHOULD NOT set // `error.type`. // // If a specific domain defines its own set of error identifiers (such as HTTP // or gRPC status codes), // it's RECOMMENDED to: // // - Use a domain-specific attribute // - Set `error.type` to capture all errors, regardless of whether they are // defined within the domain-specific set or not. ErrorTypeKey = attribute.Key("error.type") ) // ErrorMessage returns an attribute KeyValue conforming to the "error.message" // semantic conventions. It represents a message providing more detail about an // error in human-readable form. func ErrorMessage(val string) attribute.KeyValue { return ErrorMessageKey.String(val) } // Enum values for error.type var ( // A fallback error value to be used when the instrumentation doesn't define a // custom value. // // Stability: stable ErrorTypeOther = ErrorTypeKey.String("_OTHER") ) // Namespace: exception const ( // ExceptionMessageKey is the attribute Key conforming to the // "exception.message" semantic conventions. It represents the exception // message. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "Division by zero", "Can't convert 'int' object to str implicitly" ExceptionMessageKey = attribute.Key("exception.message") // ExceptionStacktraceKey is the attribute Key conforming to the // "exception.stacktrace" semantic conventions. It represents a stacktrace as a // string in the natural representation for the language runtime. The // representation is to be determined and documented by each language SIG. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: Exception in thread "main" java.lang.RuntimeException: Test // exception\n at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\n at // com.example.GenerateTrace.methodA(GenerateTrace.java:9)\n at // com.example.GenerateTrace.main(GenerateTrace.java:5) ExceptionStacktraceKey = attribute.Key("exception.stacktrace") // ExceptionTypeKey is the attribute Key conforming to the "exception.type" // semantic conventions. It represents the type of the exception (its // fully-qualified class name, if applicable). The dynamic type of the exception // should be preferred over the static type in languages that support it. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "java.net.ConnectException", "OSError" ExceptionTypeKey = attribute.Key("exception.type") ) // ExceptionMessage returns an attribute KeyValue conforming to the // "exception.message" semantic conventions. It represents the exception message. func ExceptionMessage(val string) attribute.KeyValue { return ExceptionMessageKey.String(val) } // ExceptionStacktrace returns an attribute KeyValue conforming to the // "exception.stacktrace" semantic conventions. It represents a stacktrace as a // string in the natural representation for the language runtime. The // representation is to be determined and documented by each language SIG. func ExceptionStacktrace(val string) attribute.KeyValue { return ExceptionStacktraceKey.String(val) } // ExceptionType returns an attribute KeyValue conforming to the "exception.type" // semantic conventions. It represents the type of the exception (its // fully-qualified class name, if applicable). The dynamic type of the exception // should be preferred over the static type in languages that support it. func ExceptionType(val string) attribute.KeyValue { return ExceptionTypeKey.String(val) } // Namespace: faas const ( // FaaSColdstartKey is the attribute Key conforming to the "faas.coldstart" // semantic conventions. It represents a boolean that is true if the serverless // function is executed for the first time (aka cold-start). // // Type: boolean // RequirementLevel: Recommended // Stability: Development // // Examples: FaaSColdstartKey = attribute.Key("faas.coldstart") // FaaSCronKey is the attribute Key conforming to the "faas.cron" semantic // conventions. It represents a string containing the schedule period as // [Cron Expression]. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: 0/5 * * * ? * // // [Cron Expression]: https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm FaaSCronKey = attribute.Key("faas.cron") // FaaSDocumentCollectionKey is the attribute Key conforming to the // "faas.document.collection" semantic conventions. It represents the name of // the source on which the triggering operation was performed. For example, in // Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the // database name. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "myBucketName", "myDbName" FaaSDocumentCollectionKey = attribute.Key("faas.document.collection") // FaaSDocumentNameKey is the attribute Key conforming to the // "faas.document.name" semantic conventions. It represents the document // name/table subjected to the operation. For example, in Cloud Storage or S3 is // the name of the file, and in Cosmos DB the table name. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "myFile.txt", "myTableName" FaaSDocumentNameKey = attribute.Key("faas.document.name") // FaaSDocumentOperationKey is the attribute Key conforming to the // "faas.document.operation" semantic conventions. It represents the describes // the type of the operation that was performed on the data. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: FaaSDocumentOperationKey = attribute.Key("faas.document.operation") // FaaSDocumentTimeKey is the attribute Key conforming to the // "faas.document.time" semantic conventions. It represents a string containing // the time when the data was accessed in the [ISO 8601] format expressed in // [UTC]. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: 2020-01-23T13:47:06Z // // [ISO 8601]: https://www.iso.org/iso-8601-date-and-time-format.html // [UTC]: https://www.w3.org/TR/NOTE-datetime FaaSDocumentTimeKey = attribute.Key("faas.document.time") // FaaSInstanceKey is the attribute Key conforming to the "faas.instance" // semantic conventions. It represents the execution environment ID as a string, // that will be potentially reused for other invocations to the same // function/function version. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "2021/06/28/[$LATEST]2f399eb14537447da05ab2a2e39309de" // Note: - **AWS Lambda:** Use the (full) log stream name. FaaSInstanceKey = attribute.Key("faas.instance") // FaaSInvocationIDKey is the attribute Key conforming to the // "faas.invocation_id" semantic conventions. It represents the invocation ID of // the current function invocation. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: af9d5aa4-a685-4c5f-a22b-444f80b3cc28 FaaSInvocationIDKey = attribute.Key("faas.invocation_id") // FaaSInvokedNameKey is the attribute Key conforming to the "faas.invoked_name" // semantic conventions. It represents the name of the invoked function. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: my-function // Note: SHOULD be equal to the `faas.name` resource attribute of the invoked // function. FaaSInvokedNameKey = attribute.Key("faas.invoked_name") // FaaSInvokedProviderKey is the attribute Key conforming to the // "faas.invoked_provider" semantic conventions. It represents the cloud // provider of the invoked function. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // Note: SHOULD be equal to the `cloud.provider` resource attribute of the // invoked function. FaaSInvokedProviderKey = attribute.Key("faas.invoked_provider") // FaaSInvokedRegionKey is the attribute Key conforming to the // "faas.invoked_region" semantic conventions. It represents the cloud region of // the invoked function. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: eu-central-1 // Note: SHOULD be equal to the `cloud.region` resource attribute of the invoked // function. FaaSInvokedRegionKey = attribute.Key("faas.invoked_region") // FaaSMaxMemoryKey is the attribute Key conforming to the "faas.max_memory" // semantic conventions. It represents the amount of memory available to the // serverless function converted to Bytes. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Note: It's recommended to set this attribute since e.g. too little memory can // easily stop a Java AWS Lambda function from working correctly. On AWS Lambda, // the environment variable `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this // information (which must be multiplied by 1,048,576). FaaSMaxMemoryKey = attribute.Key("faas.max_memory") // FaaSNameKey is the attribute Key conforming to the "faas.name" semantic // conventions. It represents the name of the single function that this runtime // instance executes. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "my-function", "myazurefunctionapp/some-function-name" // Note: This is the name of the function as configured/deployed on the FaaS // platform and is usually different from the name of the callback // function (which may be stored in the // [`code.namespace`/`code.function.name`] // span attributes). // // For some cloud providers, the above definition is ambiguous. The following // definition of function name MUST be used for this attribute // (and consequently the span name) for the listed cloud providers/products: // // - **Azure:** The full name `/`, i.e., function app name // followed by a forward slash followed by the function name (this form // can also be seen in the resource JSON for the function). // This means that a span attribute MUST be used, as an Azure function // app can host multiple functions that would usually share // a TracerProvider (see also the `cloud.resource_id` attribute). // // // [`code.namespace`/`code.function.name`]: /docs/general/attributes.md#source-code-attributes FaaSNameKey = attribute.Key("faas.name") // FaaSTimeKey is the attribute Key conforming to the "faas.time" semantic // conventions. It represents a string containing the function invocation time // in the [ISO 8601] format expressed in [UTC]. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: 2020-01-23T13:47:06Z // // [ISO 8601]: https://www.iso.org/iso-8601-date-and-time-format.html // [UTC]: https://www.w3.org/TR/NOTE-datetime FaaSTimeKey = attribute.Key("faas.time") // FaaSTriggerKey is the attribute Key conforming to the "faas.trigger" semantic // conventions. It represents the type of the trigger which caused this function // invocation. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: FaaSTriggerKey = attribute.Key("faas.trigger") // FaaSVersionKey is the attribute Key conforming to the "faas.version" semantic // conventions. It represents the immutable version of the function being // executed. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "26", "pinkfroid-00002" // Note: Depending on the cloud provider and platform, use: // // - **AWS Lambda:** The [function version] // (an integer represented as a decimal string). // - **Google Cloud Run (Services):** The [revision] // (i.e., the function name plus the revision suffix). // - **Google Cloud Functions:** The value of the // [`K_REVISION` environment variable]. // - **Azure Functions:** Not applicable. Do not set this attribute. // // // [function version]: https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html // [revision]: https://cloud.google.com/run/docs/managing/revisions // [`K_REVISION` environment variable]: https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically FaaSVersionKey = attribute.Key("faas.version") ) // FaaSColdstart returns an attribute KeyValue conforming to the "faas.coldstart" // semantic conventions. It represents a boolean that is true if the serverless // function is executed for the first time (aka cold-start). func FaaSColdstart(val bool) attribute.KeyValue { return FaaSColdstartKey.Bool(val) } // FaaSCron returns an attribute KeyValue conforming to the "faas.cron" semantic // conventions. It represents a string containing the schedule period as // [Cron Expression]. // // [Cron Expression]: https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm func FaaSCron(val string) attribute.KeyValue { return FaaSCronKey.String(val) } // FaaSDocumentCollection returns an attribute KeyValue conforming to the // "faas.document.collection" semantic conventions. It represents the name of the // source on which the triggering operation was performed. For example, in Cloud // Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database // name. func FaaSDocumentCollection(val string) attribute.KeyValue { return FaaSDocumentCollectionKey.String(val) } // FaaSDocumentName returns an attribute KeyValue conforming to the // "faas.document.name" semantic conventions. It represents the document // name/table subjected to the operation. For example, in Cloud Storage or S3 is // the name of the file, and in Cosmos DB the table name. func FaaSDocumentName(val string) attribute.KeyValue { return FaaSDocumentNameKey.String(val) } // FaaSDocumentTime returns an attribute KeyValue conforming to the // "faas.document.time" semantic conventions. It represents a string containing // the time when the data was accessed in the [ISO 8601] format expressed in // [UTC]. // // [ISO 8601]: https://www.iso.org/iso-8601-date-and-time-format.html // [UTC]: https://www.w3.org/TR/NOTE-datetime func FaaSDocumentTime(val string) attribute.KeyValue { return FaaSDocumentTimeKey.String(val) } // FaaSInstance returns an attribute KeyValue conforming to the "faas.instance" // semantic conventions. It represents the execution environment ID as a string, // that will be potentially reused for other invocations to the same // function/function version. func FaaSInstance(val string) attribute.KeyValue { return FaaSInstanceKey.String(val) } // FaaSInvocationID returns an attribute KeyValue conforming to the // "faas.invocation_id" semantic conventions. It represents the invocation ID of // the current function invocation. func FaaSInvocationID(val string) attribute.KeyValue { return FaaSInvocationIDKey.String(val) } // FaaSInvokedName returns an attribute KeyValue conforming to the // "faas.invoked_name" semantic conventions. It represents the name of the // invoked function. func FaaSInvokedName(val string) attribute.KeyValue { return FaaSInvokedNameKey.String(val) } // FaaSInvokedRegion returns an attribute KeyValue conforming to the // "faas.invoked_region" semantic conventions. It represents the cloud region of // the invoked function. func FaaSInvokedRegion(val string) attribute.KeyValue { return FaaSInvokedRegionKey.String(val) } // FaaSMaxMemory returns an attribute KeyValue conforming to the // "faas.max_memory" semantic conventions. It represents the amount of memory // available to the serverless function converted to Bytes. func FaaSMaxMemory(val int) attribute.KeyValue { return FaaSMaxMemoryKey.Int(val) } // FaaSName returns an attribute KeyValue conforming to the "faas.name" semantic // conventions. It represents the name of the single function that this runtime // instance executes. func FaaSName(val string) attribute.KeyValue { return FaaSNameKey.String(val) } // FaaSTime returns an attribute KeyValue conforming to the "faas.time" semantic // conventions. It represents a string containing the function invocation time in // the [ISO 8601] format expressed in [UTC]. // // [ISO 8601]: https://www.iso.org/iso-8601-date-and-time-format.html // [UTC]: https://www.w3.org/TR/NOTE-datetime func FaaSTime(val string) attribute.KeyValue { return FaaSTimeKey.String(val) } // FaaSVersion returns an attribute KeyValue conforming to the "faas.version" // semantic conventions. It represents the immutable version of the function // being executed. func FaaSVersion(val string) attribute.KeyValue { return FaaSVersionKey.String(val) } // Enum values for faas.document.operation var ( // When a new object is created. // Stability: development FaaSDocumentOperationInsert = FaaSDocumentOperationKey.String("insert") // When an object is modified. // Stability: development FaaSDocumentOperationEdit = FaaSDocumentOperationKey.String("edit") // When an object is deleted. // Stability: development FaaSDocumentOperationDelete = FaaSDocumentOperationKey.String("delete") ) // Enum values for faas.invoked_provider var ( // Alibaba Cloud // Stability: development FaaSInvokedProviderAlibabaCloud = FaaSInvokedProviderKey.String("alibaba_cloud") // Amazon Web Services // Stability: development FaaSInvokedProviderAWS = FaaSInvokedProviderKey.String("aws") // Microsoft Azure // Stability: development FaaSInvokedProviderAzure = FaaSInvokedProviderKey.String("azure") // Google Cloud Platform // Stability: development FaaSInvokedProviderGCP = FaaSInvokedProviderKey.String("gcp") // Tencent Cloud // Stability: development FaaSInvokedProviderTencentCloud = FaaSInvokedProviderKey.String("tencent_cloud") ) // Enum values for faas.trigger var ( // A response to some data source operation such as a database or filesystem // read/write // Stability: development FaaSTriggerDatasource = FaaSTriggerKey.String("datasource") // To provide an answer to an inbound HTTP request // Stability: development FaaSTriggerHTTP = FaaSTriggerKey.String("http") // A function is set to be executed when messages are sent to a messaging system // Stability: development FaaSTriggerPubSub = FaaSTriggerKey.String("pubsub") // A function is scheduled to be executed regularly // Stability: development FaaSTriggerTimer = FaaSTriggerKey.String("timer") // If none of the others apply // Stability: development FaaSTriggerOther = FaaSTriggerKey.String("other") ) // Namespace: feature_flag const ( // FeatureFlagContextIDKey is the attribute Key conforming to the // "feature_flag.context.id" semantic conventions. It represents the unique // identifier for the flag evaluation context. For example, the targeting key. // // Type: string // RequirementLevel: Recommended // Stability: Release_Candidate // // Examples: "5157782b-2203-4c80-a857-dbbd5e7761db" FeatureFlagContextIDKey = attribute.Key("feature_flag.context.id") // FeatureFlagKeyKey is the attribute Key conforming to the "feature_flag.key" // semantic conventions. It represents the lookup key of the feature flag. // // Type: string // RequirementLevel: Recommended // Stability: Release_Candidate // // Examples: "logo-color" FeatureFlagKeyKey = attribute.Key("feature_flag.key") // FeatureFlagProviderNameKey is the attribute Key conforming to the // "feature_flag.provider.name" semantic conventions. It represents the // identifies the feature flag provider. // // Type: string // RequirementLevel: Recommended // Stability: Release_Candidate // // Examples: "Flag Manager" FeatureFlagProviderNameKey = attribute.Key("feature_flag.provider.name") // FeatureFlagResultReasonKey is the attribute Key conforming to the // "feature_flag.result.reason" semantic conventions. It represents the reason // code which shows how a feature flag value was determined. // // Type: Enum // RequirementLevel: Recommended // Stability: Release_Candidate // // Examples: "static", "targeting_match", "error", "default" FeatureFlagResultReasonKey = attribute.Key("feature_flag.result.reason") // FeatureFlagResultValueKey is the attribute Key conforming to the // "feature_flag.result.value" semantic conventions. It represents the evaluated // value of the feature flag. // // Type: any // RequirementLevel: Recommended // Stability: Release_Candidate // // Examples: "#ff0000", true, 3 // Note: With some feature flag providers, feature flag results can be quite // large or contain private or sensitive details. // Because of this, `feature_flag.result.variant` is often the preferred // attribute if it is available. // // It may be desirable to redact or otherwise limit the size and scope of // `feature_flag.result.value` if possible. // Because the evaluated flag value is unstructured and may be any type, it is // left to the instrumentation author to determine how best to achieve this. FeatureFlagResultValueKey = attribute.Key("feature_flag.result.value") // FeatureFlagResultVariantKey is the attribute Key conforming to the // "feature_flag.result.variant" semantic conventions. It represents a semantic // identifier for an evaluated flag value. // // Type: string // RequirementLevel: Recommended // Stability: Release_Candidate // // Examples: "red", "true", "on" // Note: A semantic identifier, commonly referred to as a variant, provides a // means // for referring to a value without including the value itself. This can // provide additional context for understanding the meaning behind a value. // For example, the variant `red` maybe be used for the value `#c05543`. FeatureFlagResultVariantKey = attribute.Key("feature_flag.result.variant") // FeatureFlagSetIDKey is the attribute Key conforming to the // "feature_flag.set.id" semantic conventions. It represents the identifier of // the [flag set] to which the feature flag belongs. // // Type: string // RequirementLevel: Recommended // Stability: Release_Candidate // // Examples: "proj-1", "ab98sgs", "service1/dev" // // [flag set]: https://openfeature.dev/specification/glossary/#flag-set FeatureFlagSetIDKey = attribute.Key("feature_flag.set.id") // FeatureFlagVersionKey is the attribute Key conforming to the // "feature_flag.version" semantic conventions. It represents the version of the // ruleset used during the evaluation. This may be any stable value which // uniquely identifies the ruleset. // // Type: string // RequirementLevel: Recommended // Stability: Release_Candidate // // Examples: "1", "01ABCDEF" FeatureFlagVersionKey = attribute.Key("feature_flag.version") ) // FeatureFlagContextID returns an attribute KeyValue conforming to the // "feature_flag.context.id" semantic conventions. It represents the unique // identifier for the flag evaluation context. For example, the targeting key. func FeatureFlagContextID(val string) attribute.KeyValue { return FeatureFlagContextIDKey.String(val) } // FeatureFlagKey returns an attribute KeyValue conforming to the // "feature_flag.key" semantic conventions. It represents the lookup key of the // feature flag. func FeatureFlagKey(val string) attribute.KeyValue { return FeatureFlagKeyKey.String(val) } // FeatureFlagProviderName returns an attribute KeyValue conforming to the // "feature_flag.provider.name" semantic conventions. It represents the // identifies the feature flag provider. func FeatureFlagProviderName(val string) attribute.KeyValue { return FeatureFlagProviderNameKey.String(val) } // FeatureFlagResultVariant returns an attribute KeyValue conforming to the // "feature_flag.result.variant" semantic conventions. It represents a semantic // identifier for an evaluated flag value. func FeatureFlagResultVariant(val string) attribute.KeyValue { return FeatureFlagResultVariantKey.String(val) } // FeatureFlagSetID returns an attribute KeyValue conforming to the // "feature_flag.set.id" semantic conventions. It represents the identifier of // the [flag set] to which the feature flag belongs. // // [flag set]: https://openfeature.dev/specification/glossary/#flag-set func FeatureFlagSetID(val string) attribute.KeyValue { return FeatureFlagSetIDKey.String(val) } // FeatureFlagVersion returns an attribute KeyValue conforming to the // "feature_flag.version" semantic conventions. It represents the version of the // ruleset used during the evaluation. This may be any stable value which // uniquely identifies the ruleset. func FeatureFlagVersion(val string) attribute.KeyValue { return FeatureFlagVersionKey.String(val) } // Enum values for feature_flag.result.reason var ( // The resolved value is static (no dynamic evaluation). // Stability: release_candidate FeatureFlagResultReasonStatic = FeatureFlagResultReasonKey.String("static") // The resolved value fell back to a pre-configured value (no dynamic evaluation // occurred or dynamic evaluation yielded no result). // Stability: release_candidate FeatureFlagResultReasonDefault = FeatureFlagResultReasonKey.String("default") // The resolved value was the result of a dynamic evaluation, such as a rule or // specific user-targeting. // Stability: release_candidate FeatureFlagResultReasonTargetingMatch = FeatureFlagResultReasonKey.String("targeting_match") // The resolved value was the result of pseudorandom assignment. // Stability: release_candidate FeatureFlagResultReasonSplit = FeatureFlagResultReasonKey.String("split") // The resolved value was retrieved from cache. // Stability: release_candidate FeatureFlagResultReasonCached = FeatureFlagResultReasonKey.String("cached") // The resolved value was the result of the flag being disabled in the // management system. // Stability: release_candidate FeatureFlagResultReasonDisabled = FeatureFlagResultReasonKey.String("disabled") // The reason for the resolved value could not be determined. // Stability: release_candidate FeatureFlagResultReasonUnknown = FeatureFlagResultReasonKey.String("unknown") // The resolved value is non-authoritative or possibly out of date // Stability: release_candidate FeatureFlagResultReasonStale = FeatureFlagResultReasonKey.String("stale") // The resolved value was the result of an error. // Stability: release_candidate FeatureFlagResultReasonError = FeatureFlagResultReasonKey.String("error") ) // Namespace: file const ( // FileAccessedKey is the attribute Key conforming to the "file.accessed" // semantic conventions. It represents the time when the file was last accessed, // in ISO 8601 format. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "2021-01-01T12:00:00Z" // Note: This attribute might not be supported by some file systems — NFS, // FAT32, in embedded OS, etc. FileAccessedKey = attribute.Key("file.accessed") // FileAttributesKey is the attribute Key conforming to the "file.attributes" // semantic conventions. It represents the array of file attributes. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "readonly", "hidden" // Note: Attributes names depend on the OS or file system. Here’s a // non-exhaustive list of values expected for this attribute: `archive`, // `compressed`, `directory`, `encrypted`, `execute`, `hidden`, `immutable`, // `journaled`, `read`, `readonly`, `symbolic link`, `system`, `temporary`, // `write`. FileAttributesKey = attribute.Key("file.attributes") // FileChangedKey is the attribute Key conforming to the "file.changed" semantic // conventions. It represents the time when the file attributes or metadata was // last changed, in ISO 8601 format. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "2021-01-01T12:00:00Z" // Note: `file.changed` captures the time when any of the file's properties or // attributes (including the content) are changed, while `file.modified` // captures the timestamp when the file content is modified. FileChangedKey = attribute.Key("file.changed") // FileCreatedKey is the attribute Key conforming to the "file.created" semantic // conventions. It represents the time when the file was created, in ISO 8601 // format. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "2021-01-01T12:00:00Z" // Note: This attribute might not be supported by some file systems — NFS, // FAT32, in embedded OS, etc. FileCreatedKey = attribute.Key("file.created") // FileDirectoryKey is the attribute Key conforming to the "file.directory" // semantic conventions. It represents the directory where the file is located. // It should include the drive letter, when appropriate. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "/home/user", "C:\Program Files\MyApp" FileDirectoryKey = attribute.Key("file.directory") // FileExtensionKey is the attribute Key conforming to the "file.extension" // semantic conventions. It represents the file extension, excluding the leading // dot. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "png", "gz" // Note: When the file name has multiple extensions (example.tar.gz), only the // last one should be captured ("gz", not "tar.gz"). FileExtensionKey = attribute.Key("file.extension") // FileForkNameKey is the attribute Key conforming to the "file.fork_name" // semantic conventions. It represents the name of the fork. A fork is // additional data associated with a filesystem object. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Zone.Identifier" // Note: On Linux, a resource fork is used to store additional data with a // filesystem object. A file always has at least one fork for the data portion, // and additional forks may exist. // On NTFS, this is analogous to an Alternate Data Stream (ADS), and the default // data stream for a file is just called $DATA. Zone.Identifier is commonly used // by Windows to track contents downloaded from the Internet. An ADS is // typically of the form: C:\path\to\filename.extension:some_fork_name, and // some_fork_name is the value that should populate `fork_name`. // `filename.extension` should populate `file.name`, and `extension` should // populate `file.extension`. The full path, `file.path`, will include the fork // name. FileForkNameKey = attribute.Key("file.fork_name") // FileGroupIDKey is the attribute Key conforming to the "file.group.id" // semantic conventions. It represents the primary Group ID (GID) of the file. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "1000" FileGroupIDKey = attribute.Key("file.group.id") // FileGroupNameKey is the attribute Key conforming to the "file.group.name" // semantic conventions. It represents the primary group name of the file. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "users" FileGroupNameKey = attribute.Key("file.group.name") // FileInodeKey is the attribute Key conforming to the "file.inode" semantic // conventions. It represents the inode representing the file in the filesystem. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "256383" FileInodeKey = attribute.Key("file.inode") // FileModeKey is the attribute Key conforming to the "file.mode" semantic // conventions. It represents the mode of the file in octal representation. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "0640" FileModeKey = attribute.Key("file.mode") // FileModifiedKey is the attribute Key conforming to the "file.modified" // semantic conventions. It represents the time when the file content was last // modified, in ISO 8601 format. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "2021-01-01T12:00:00Z" FileModifiedKey = attribute.Key("file.modified") // FileNameKey is the attribute Key conforming to the "file.name" semantic // conventions. It represents the name of the file including the extension, // without the directory. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "example.png" FileNameKey = attribute.Key("file.name") // FileOwnerIDKey is the attribute Key conforming to the "file.owner.id" // semantic conventions. It represents the user ID (UID) or security identifier // (SID) of the file owner. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "1000" FileOwnerIDKey = attribute.Key("file.owner.id") // FileOwnerNameKey is the attribute Key conforming to the "file.owner.name" // semantic conventions. It represents the username of the file owner. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "root" FileOwnerNameKey = attribute.Key("file.owner.name") // FilePathKey is the attribute Key conforming to the "file.path" semantic // conventions. It represents the full path to the file, including the file // name. It should include the drive letter, when appropriate. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "/home/alice/example.png", "C:\Program Files\MyApp\myapp.exe" FilePathKey = attribute.Key("file.path") // FileSizeKey is the attribute Key conforming to the "file.size" semantic // conventions. It represents the file size in bytes. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: FileSizeKey = attribute.Key("file.size") // FileSymbolicLinkTargetPathKey is the attribute Key conforming to the // "file.symbolic_link.target_path" semantic conventions. It represents the path // to the target of a symbolic link. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "/usr/bin/python3" // Note: This attribute is only applicable to symbolic links. FileSymbolicLinkTargetPathKey = attribute.Key("file.symbolic_link.target_path") ) // FileAccessed returns an attribute KeyValue conforming to the "file.accessed" // semantic conventions. It represents the time when the file was last accessed, // in ISO 8601 format. func FileAccessed(val string) attribute.KeyValue { return FileAccessedKey.String(val) } // FileAttributes returns an attribute KeyValue conforming to the // "file.attributes" semantic conventions. It represents the array of file // attributes. func FileAttributes(val ...string) attribute.KeyValue { return FileAttributesKey.StringSlice(val) } // FileChanged returns an attribute KeyValue conforming to the "file.changed" // semantic conventions. It represents the time when the file attributes or // metadata was last changed, in ISO 8601 format. func FileChanged(val string) attribute.KeyValue { return FileChangedKey.String(val) } // FileCreated returns an attribute KeyValue conforming to the "file.created" // semantic conventions. It represents the time when the file was created, in ISO // 8601 format. func FileCreated(val string) attribute.KeyValue { return FileCreatedKey.String(val) } // FileDirectory returns an attribute KeyValue conforming to the "file.directory" // semantic conventions. It represents the directory where the file is located. // It should include the drive letter, when appropriate. func FileDirectory(val string) attribute.KeyValue { return FileDirectoryKey.String(val) } // FileExtension returns an attribute KeyValue conforming to the "file.extension" // semantic conventions. It represents the file extension, excluding the leading // dot. func FileExtension(val string) attribute.KeyValue { return FileExtensionKey.String(val) } // FileForkName returns an attribute KeyValue conforming to the "file.fork_name" // semantic conventions. It represents the name of the fork. A fork is additional // data associated with a filesystem object. func FileForkName(val string) attribute.KeyValue { return FileForkNameKey.String(val) } // FileGroupID returns an attribute KeyValue conforming to the "file.group.id" // semantic conventions. It represents the primary Group ID (GID) of the file. func FileGroupID(val string) attribute.KeyValue { return FileGroupIDKey.String(val) } // FileGroupName returns an attribute KeyValue conforming to the // "file.group.name" semantic conventions. It represents the primary group name // of the file. func FileGroupName(val string) attribute.KeyValue { return FileGroupNameKey.String(val) } // FileInode returns an attribute KeyValue conforming to the "file.inode" // semantic conventions. It represents the inode representing the file in the // filesystem. func FileInode(val string) attribute.KeyValue { return FileInodeKey.String(val) } // FileMode returns an attribute KeyValue conforming to the "file.mode" semantic // conventions. It represents the mode of the file in octal representation. func FileMode(val string) attribute.KeyValue { return FileModeKey.String(val) } // FileModified returns an attribute KeyValue conforming to the "file.modified" // semantic conventions. It represents the time when the file content was last // modified, in ISO 8601 format. func FileModified(val string) attribute.KeyValue { return FileModifiedKey.String(val) } // FileName returns an attribute KeyValue conforming to the "file.name" semantic // conventions. It represents the name of the file including the extension, // without the directory. func FileName(val string) attribute.KeyValue { return FileNameKey.String(val) } // FileOwnerID returns an attribute KeyValue conforming to the "file.owner.id" // semantic conventions. It represents the user ID (UID) or security identifier // (SID) of the file owner. func FileOwnerID(val string) attribute.KeyValue { return FileOwnerIDKey.String(val) } // FileOwnerName returns an attribute KeyValue conforming to the // "file.owner.name" semantic conventions. It represents the username of the file // owner. func FileOwnerName(val string) attribute.KeyValue { return FileOwnerNameKey.String(val) } // FilePath returns an attribute KeyValue conforming to the "file.path" semantic // conventions. It represents the full path to the file, including the file name. // It should include the drive letter, when appropriate. func FilePath(val string) attribute.KeyValue { return FilePathKey.String(val) } // FileSize returns an attribute KeyValue conforming to the "file.size" semantic // conventions. It represents the file size in bytes. func FileSize(val int) attribute.KeyValue { return FileSizeKey.Int(val) } // FileSymbolicLinkTargetPath returns an attribute KeyValue conforming to the // "file.symbolic_link.target_path" semantic conventions. It represents the path // to the target of a symbolic link. func FileSymbolicLinkTargetPath(val string) attribute.KeyValue { return FileSymbolicLinkTargetPathKey.String(val) } // Namespace: gcp const ( // GCPAppHubApplicationContainerKey is the attribute Key conforming to the // "gcp.apphub.application.container" semantic conventions. It represents the // container within GCP where the AppHub application is defined. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "projects/my-container-project" GCPAppHubApplicationContainerKey = attribute.Key("gcp.apphub.application.container") // GCPAppHubApplicationIDKey is the attribute Key conforming to the // "gcp.apphub.application.id" semantic conventions. It represents the name of // the application as configured in AppHub. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "my-application" GCPAppHubApplicationIDKey = attribute.Key("gcp.apphub.application.id") // GCPAppHubApplicationLocationKey is the attribute Key conforming to the // "gcp.apphub.application.location" semantic conventions. It represents the GCP // zone or region where the application is defined. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "us-central1" GCPAppHubApplicationLocationKey = attribute.Key("gcp.apphub.application.location") // GCPAppHubServiceCriticalityTypeKey is the attribute Key conforming to the // "gcp.apphub.service.criticality_type" semantic conventions. It represents the // criticality of a service indicates its importance to the business. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // Note: [See AppHub type enum] // // [See AppHub type enum]: https://cloud.google.com/app-hub/docs/reference/rest/v1/Attributes#type GCPAppHubServiceCriticalityTypeKey = attribute.Key("gcp.apphub.service.criticality_type") // GCPAppHubServiceEnvironmentTypeKey is the attribute Key conforming to the // "gcp.apphub.service.environment_type" semantic conventions. It represents the // environment of a service is the stage of a software lifecycle. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // Note: [See AppHub environment type] // // [See AppHub environment type]: https://cloud.google.com/app-hub/docs/reference/rest/v1/Attributes#type_1 GCPAppHubServiceEnvironmentTypeKey = attribute.Key("gcp.apphub.service.environment_type") // GCPAppHubServiceIDKey is the attribute Key conforming to the // "gcp.apphub.service.id" semantic conventions. It represents the name of the // service as configured in AppHub. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "my-service" GCPAppHubServiceIDKey = attribute.Key("gcp.apphub.service.id") // GCPAppHubWorkloadCriticalityTypeKey is the attribute Key conforming to the // "gcp.apphub.workload.criticality_type" semantic conventions. It represents // the criticality of a workload indicates its importance to the business. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // Note: [See AppHub type enum] // // [See AppHub type enum]: https://cloud.google.com/app-hub/docs/reference/rest/v1/Attributes#type GCPAppHubWorkloadCriticalityTypeKey = attribute.Key("gcp.apphub.workload.criticality_type") // GCPAppHubWorkloadEnvironmentTypeKey is the attribute Key conforming to the // "gcp.apphub.workload.environment_type" semantic conventions. It represents // the environment of a workload is the stage of a software lifecycle. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // Note: [See AppHub environment type] // // [See AppHub environment type]: https://cloud.google.com/app-hub/docs/reference/rest/v1/Attributes#type_1 GCPAppHubWorkloadEnvironmentTypeKey = attribute.Key("gcp.apphub.workload.environment_type") // GCPAppHubWorkloadIDKey is the attribute Key conforming to the // "gcp.apphub.workload.id" semantic conventions. It represents the name of the // workload as configured in AppHub. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "my-workload" GCPAppHubWorkloadIDKey = attribute.Key("gcp.apphub.workload.id") // GCPClientServiceKey is the attribute Key conforming to the // "gcp.client.service" semantic conventions. It represents the identifies the // Google Cloud service for which the official client library is intended. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "appengine", "run", "firestore", "alloydb", "spanner" // Note: Intended to be a stable identifier for Google Cloud client libraries // that is uniform across implementation languages. The value should be derived // from the canonical service domain for the service; for example, // 'foo.googleapis.com' should result in a value of 'foo'. GCPClientServiceKey = attribute.Key("gcp.client.service") // GCPCloudRunJobExecutionKey is the attribute Key conforming to the // "gcp.cloud_run.job.execution" semantic conventions. It represents the name of // the Cloud Run [execution] being run for the Job, as set by the // [`CLOUD_RUN_EXECUTION`] environment variable. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "job-name-xxxx", "sample-job-mdw84" // // [execution]: https://cloud.google.com/run/docs/managing/job-executions // [`CLOUD_RUN_EXECUTION`]: https://cloud.google.com/run/docs/container-contract#jobs-env-vars GCPCloudRunJobExecutionKey = attribute.Key("gcp.cloud_run.job.execution") // GCPCloudRunJobTaskIndexKey is the attribute Key conforming to the // "gcp.cloud_run.job.task_index" semantic conventions. It represents the index // for a task within an execution as provided by the [`CLOUD_RUN_TASK_INDEX`] // environment variable. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 0, 1 // // [`CLOUD_RUN_TASK_INDEX`]: https://cloud.google.com/run/docs/container-contract#jobs-env-vars GCPCloudRunJobTaskIndexKey = attribute.Key("gcp.cloud_run.job.task_index") // GCPGCEInstanceHostnameKey is the attribute Key conforming to the // "gcp.gce.instance.hostname" semantic conventions. It represents the hostname // of a GCE instance. This is the full value of the default or [custom hostname] // . // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "my-host1234.example.com", // "sample-vm.us-west1-b.c.my-project.internal" // // [custom hostname]: https://cloud.google.com/compute/docs/instances/custom-hostname-vm GCPGCEInstanceHostnameKey = attribute.Key("gcp.gce.instance.hostname") // GCPGCEInstanceNameKey is the attribute Key conforming to the // "gcp.gce.instance.name" semantic conventions. It represents the instance name // of a GCE instance. This is the value provided by `host.name`, the visible // name of the instance in the Cloud Console UI, and the prefix for the default // hostname of the instance as defined by the [default internal DNS name]. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "instance-1", "my-vm-name" // // [default internal DNS name]: https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names GCPGCEInstanceNameKey = attribute.Key("gcp.gce.instance.name") ) // GCPAppHubApplicationContainer returns an attribute KeyValue conforming to the // "gcp.apphub.application.container" semantic conventions. It represents the // container within GCP where the AppHub application is defined. func GCPAppHubApplicationContainer(val string) attribute.KeyValue { return GCPAppHubApplicationContainerKey.String(val) } // GCPAppHubApplicationID returns an attribute KeyValue conforming to the // "gcp.apphub.application.id" semantic conventions. It represents the name of // the application as configured in AppHub. func GCPAppHubApplicationID(val string) attribute.KeyValue { return GCPAppHubApplicationIDKey.String(val) } // GCPAppHubApplicationLocation returns an attribute KeyValue conforming to the // "gcp.apphub.application.location" semantic conventions. It represents the GCP // zone or region where the application is defined. func GCPAppHubApplicationLocation(val string) attribute.KeyValue { return GCPAppHubApplicationLocationKey.String(val) } // GCPAppHubServiceID returns an attribute KeyValue conforming to the // "gcp.apphub.service.id" semantic conventions. It represents the name of the // service as configured in AppHub. func GCPAppHubServiceID(val string) attribute.KeyValue { return GCPAppHubServiceIDKey.String(val) } // GCPAppHubWorkloadID returns an attribute KeyValue conforming to the // "gcp.apphub.workload.id" semantic conventions. It represents the name of the // workload as configured in AppHub. func GCPAppHubWorkloadID(val string) attribute.KeyValue { return GCPAppHubWorkloadIDKey.String(val) } // GCPClientService returns an attribute KeyValue conforming to the // "gcp.client.service" semantic conventions. It represents the identifies the // Google Cloud service for which the official client library is intended. func GCPClientService(val string) attribute.KeyValue { return GCPClientServiceKey.String(val) } // GCPCloudRunJobExecution returns an attribute KeyValue conforming to the // "gcp.cloud_run.job.execution" semantic conventions. It represents the name of // the Cloud Run [execution] being run for the Job, as set by the // [`CLOUD_RUN_EXECUTION`] environment variable. // // [execution]: https://cloud.google.com/run/docs/managing/job-executions // [`CLOUD_RUN_EXECUTION`]: https://cloud.google.com/run/docs/container-contract#jobs-env-vars func GCPCloudRunJobExecution(val string) attribute.KeyValue { return GCPCloudRunJobExecutionKey.String(val) } // GCPCloudRunJobTaskIndex returns an attribute KeyValue conforming to the // "gcp.cloud_run.job.task_index" semantic conventions. It represents the index // for a task within an execution as provided by the [`CLOUD_RUN_TASK_INDEX`] // environment variable. // // [`CLOUD_RUN_TASK_INDEX`]: https://cloud.google.com/run/docs/container-contract#jobs-env-vars func GCPCloudRunJobTaskIndex(val int) attribute.KeyValue { return GCPCloudRunJobTaskIndexKey.Int(val) } // GCPGCEInstanceHostname returns an attribute KeyValue conforming to the // "gcp.gce.instance.hostname" semantic conventions. It represents the hostname // of a GCE instance. This is the full value of the default or [custom hostname] // . // // [custom hostname]: https://cloud.google.com/compute/docs/instances/custom-hostname-vm func GCPGCEInstanceHostname(val string) attribute.KeyValue { return GCPGCEInstanceHostnameKey.String(val) } // GCPGCEInstanceName returns an attribute KeyValue conforming to the // "gcp.gce.instance.name" semantic conventions. It represents the instance name // of a GCE instance. This is the value provided by `host.name`, the visible name // of the instance in the Cloud Console UI, and the prefix for the default // hostname of the instance as defined by the [default internal DNS name]. // // [default internal DNS name]: https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names func GCPGCEInstanceName(val string) attribute.KeyValue { return GCPGCEInstanceNameKey.String(val) } // Enum values for gcp.apphub.service.criticality_type var ( // Mission critical service. // Stability: development GCPAppHubServiceCriticalityTypeMissionCritical = GCPAppHubServiceCriticalityTypeKey.String("MISSION_CRITICAL") // High impact. // Stability: development GCPAppHubServiceCriticalityTypeHigh = GCPAppHubServiceCriticalityTypeKey.String("HIGH") // Medium impact. // Stability: development GCPAppHubServiceCriticalityTypeMedium = GCPAppHubServiceCriticalityTypeKey.String("MEDIUM") // Low impact. // Stability: development GCPAppHubServiceCriticalityTypeLow = GCPAppHubServiceCriticalityTypeKey.String("LOW") ) // Enum values for gcp.apphub.service.environment_type var ( // Production environment. // Stability: development GCPAppHubServiceEnvironmentTypeProduction = GCPAppHubServiceEnvironmentTypeKey.String("PRODUCTION") // Staging environment. // Stability: development GCPAppHubServiceEnvironmentTypeStaging = GCPAppHubServiceEnvironmentTypeKey.String("STAGING") // Test environment. // Stability: development GCPAppHubServiceEnvironmentTypeTest = GCPAppHubServiceEnvironmentTypeKey.String("TEST") // Development environment. // Stability: development GCPAppHubServiceEnvironmentTypeDevelopment = GCPAppHubServiceEnvironmentTypeKey.String("DEVELOPMENT") ) // Enum values for gcp.apphub.workload.criticality_type var ( // Mission critical service. // Stability: development GCPAppHubWorkloadCriticalityTypeMissionCritical = GCPAppHubWorkloadCriticalityTypeKey.String("MISSION_CRITICAL") // High impact. // Stability: development GCPAppHubWorkloadCriticalityTypeHigh = GCPAppHubWorkloadCriticalityTypeKey.String("HIGH") // Medium impact. // Stability: development GCPAppHubWorkloadCriticalityTypeMedium = GCPAppHubWorkloadCriticalityTypeKey.String("MEDIUM") // Low impact. // Stability: development GCPAppHubWorkloadCriticalityTypeLow = GCPAppHubWorkloadCriticalityTypeKey.String("LOW") ) // Enum values for gcp.apphub.workload.environment_type var ( // Production environment. // Stability: development GCPAppHubWorkloadEnvironmentTypeProduction = GCPAppHubWorkloadEnvironmentTypeKey.String("PRODUCTION") // Staging environment. // Stability: development GCPAppHubWorkloadEnvironmentTypeStaging = GCPAppHubWorkloadEnvironmentTypeKey.String("STAGING") // Test environment. // Stability: development GCPAppHubWorkloadEnvironmentTypeTest = GCPAppHubWorkloadEnvironmentTypeKey.String("TEST") // Development environment. // Stability: development GCPAppHubWorkloadEnvironmentTypeDevelopment = GCPAppHubWorkloadEnvironmentTypeKey.String("DEVELOPMENT") ) // Namespace: gen_ai const ( // GenAIAgentDescriptionKey is the attribute Key conforming to the // "gen_ai.agent.description" semantic conventions. It represents the free-form // description of the GenAI agent provided by the application. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Helps with math problems", "Generates fiction stories" GenAIAgentDescriptionKey = attribute.Key("gen_ai.agent.description") // GenAIAgentIDKey is the attribute Key conforming to the "gen_ai.agent.id" // semantic conventions. It represents the unique identifier of the GenAI agent. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "asst_5j66UpCpwteGg4YSxUnt7lPY" GenAIAgentIDKey = attribute.Key("gen_ai.agent.id") // GenAIAgentNameKey is the attribute Key conforming to the "gen_ai.agent.name" // semantic conventions. It represents the human-readable name of the GenAI // agent provided by the application. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Math Tutor", "Fiction Writer" GenAIAgentNameKey = attribute.Key("gen_ai.agent.name") // GenAIConversationIDKey is the attribute Key conforming to the // "gen_ai.conversation.id" semantic conventions. It represents the unique // identifier for a conversation (session, thread), used to store and correlate // messages within this conversation. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "conv_5j66UpCpwteGg4YSxUnt7lPY" GenAIConversationIDKey = attribute.Key("gen_ai.conversation.id") // GenAIDataSourceIDKey is the attribute Key conforming to the // "gen_ai.data_source.id" semantic conventions. It represents the data source // identifier. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "H7STPQYOND" // Note: Data sources are used by AI agents and RAG applications to store // grounding data. A data source may be an external database, object store, // document collection, website, or any other storage system used by the GenAI // agent or application. The `gen_ai.data_source.id` SHOULD match the identifier // used by the GenAI system rather than a name specific to the external storage, // such as a database or object store. Semantic conventions referencing // `gen_ai.data_source.id` MAY also leverage additional attributes, such as // `db.*`, to further identify and describe the data source. GenAIDataSourceIDKey = attribute.Key("gen_ai.data_source.id") // GenAIInputMessagesKey is the attribute Key conforming to the // "gen_ai.input.messages" semantic conventions. It represents the chat history // provided to the model as an input. // // Type: any // RequirementLevel: Recommended // Stability: Development // // Examples: "[\n {\n "role": "user",\n "parts": [\n {\n "type": "text",\n // "content": "Weather in Paris?"\n }\n ]\n },\n {\n "role": "assistant",\n // "parts": [\n {\n "type": "tool_call",\n "id": // "call_VSPygqKTWdrhaFErNvMV18Yl",\n "name": "get_weather",\n "arguments": {\n // "location": "Paris"\n }\n }\n ]\n },\n {\n "role": "tool",\n "parts": [\n {\n // "type": "tool_call_response",\n "id": " call_VSPygqKTWdrhaFErNvMV18Yl",\n // "result": "rainy, 57°F"\n }\n ]\n }\n]\n" // Note: Instrumentations MUST follow [Input messages JSON schema]. // When the attribute is recorded on events, it MUST be recorded in structured // form. When recorded on spans, it MAY be recorded as a JSON string if // structured // format is not supported and SHOULD be recorded in structured form otherwise. // // Messages MUST be provided in the order they were sent to the model. // Instrumentations MAY provide a way for users to filter or truncate // input messages. // // > [!Warning] // > This attribute is likely to contain sensitive information including // > user/PII data. // // See [Recording content on attributes] // section for more details. // // [Input messages JSON schema]: /docs/gen-ai/gen-ai-input-messages.json // [Recording content on attributes]: /docs/gen-ai/gen-ai-spans.md#recording-content-on-attributes GenAIInputMessagesKey = attribute.Key("gen_ai.input.messages") // GenAIOperationNameKey is the attribute Key conforming to the // "gen_ai.operation.name" semantic conventions. It represents the name of the // operation being performed. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // Note: If one of the predefined values applies, but specific system uses a // different name it's RECOMMENDED to document it in the semantic conventions // for specific GenAI system and use system-specific name in the // instrumentation. If a different name is not documented, instrumentation // libraries SHOULD use applicable predefined value. GenAIOperationNameKey = attribute.Key("gen_ai.operation.name") // GenAIOutputMessagesKey is the attribute Key conforming to the // "gen_ai.output.messages" semantic conventions. It represents the messages // returned by the model where each message represents a specific model response // (choice, candidate). // // Type: any // RequirementLevel: Recommended // Stability: Development // // Examples: "[\n {\n "role": "assistant",\n "parts": [\n {\n "type": "text",\n // "content": "The weather in Paris is currently rainy with a temperature of // 57°F."\n }\n ],\n "finish_reason": "stop"\n }\n]\n" // Note: Instrumentations MUST follow [Output messages JSON schema] // // Each message represents a single output choice/candidate generated by // the model. Each message corresponds to exactly one generation // (choice/candidate) and vice versa - one choice cannot be split across // multiple messages or one message cannot contain parts from multiple choices. // // When the attribute is recorded on events, it MUST be recorded in structured // form. When recorded on spans, it MAY be recorded as a JSON string if // structured // format is not supported and SHOULD be recorded in structured form otherwise. // // Instrumentations MAY provide a way for users to filter or truncate // output messages. // // > [!Warning] // > This attribute is likely to contain sensitive information including // > user/PII data. // // See [Recording content on attributes] // section for more details. // // [Output messages JSON schema]: /docs/gen-ai/gen-ai-output-messages.json // [Recording content on attributes]: /docs/gen-ai/gen-ai-spans.md#recording-content-on-attributes GenAIOutputMessagesKey = attribute.Key("gen_ai.output.messages") // GenAIOutputTypeKey is the attribute Key conforming to the // "gen_ai.output.type" semantic conventions. It represents the represents the // content type requested by the client. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // Note: This attribute SHOULD be used when the client requests output of a // specific type. The model may return zero or more outputs of this type. // This attribute specifies the output modality and not the actual output // format. For example, if an image is requested, the actual output could be a // URL pointing to an image file. // Additional output format details may be recorded in the future in the // `gen_ai.output.{type}.*` attributes. GenAIOutputTypeKey = attribute.Key("gen_ai.output.type") // GenAIProviderNameKey is the attribute Key conforming to the // "gen_ai.provider.name" semantic conventions. It represents the Generative AI // provider as identified by the client or server instrumentation. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // Note: The attribute SHOULD be set based on the instrumentation's best // knowledge and may differ from the actual model provider. // // Multiple providers, including Azure OpenAI, Gemini, and AI hosting platforms // are accessible using the OpenAI REST API and corresponding client libraries, // but may proxy or host models from different providers. // // The `gen_ai.request.model`, `gen_ai.response.model`, and `server.address` // attributes may help identify the actual system in use. // // The `gen_ai.provider.name` attribute acts as a discriminator that // identifies the GenAI telemetry format flavor specific to that provider // within GenAI semantic conventions. // It SHOULD be set consistently with provider-specific attributes and signals. // For example, GenAI spans, metrics, and events related to AWS Bedrock // should have the `gen_ai.provider.name` set to `aws.bedrock` and include // applicable `aws.bedrock.*` attributes and are not expected to include // `openai.*` attributes. GenAIProviderNameKey = attribute.Key("gen_ai.provider.name") // GenAIRequestChoiceCountKey is the attribute Key conforming to the // "gen_ai.request.choice.count" semantic conventions. It represents the target // number of candidate completions to return. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 3 GenAIRequestChoiceCountKey = attribute.Key("gen_ai.request.choice.count") // GenAIRequestEncodingFormatsKey is the attribute Key conforming to the // "gen_ai.request.encoding_formats" semantic conventions. It represents the // encoding formats requested in an embeddings operation, if specified. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "base64"], ["float", "binary" // Note: In some GenAI systems the encoding formats are called embedding types. // Also, some GenAI systems only accept a single format per request. GenAIRequestEncodingFormatsKey = attribute.Key("gen_ai.request.encoding_formats") // GenAIRequestFrequencyPenaltyKey is the attribute Key conforming to the // "gen_ai.request.frequency_penalty" semantic conventions. It represents the // frequency penalty setting for the GenAI request. // // Type: double // RequirementLevel: Recommended // Stability: Development // // Examples: 0.1 GenAIRequestFrequencyPenaltyKey = attribute.Key("gen_ai.request.frequency_penalty") // GenAIRequestMaxTokensKey is the attribute Key conforming to the // "gen_ai.request.max_tokens" semantic conventions. It represents the maximum // number of tokens the model generates for a request. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 100 GenAIRequestMaxTokensKey = attribute.Key("gen_ai.request.max_tokens") // GenAIRequestModelKey is the attribute Key conforming to the // "gen_ai.request.model" semantic conventions. It represents the name of the // GenAI model a request is being made to. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: gpt-4 GenAIRequestModelKey = attribute.Key("gen_ai.request.model") // GenAIRequestPresencePenaltyKey is the attribute Key conforming to the // "gen_ai.request.presence_penalty" semantic conventions. It represents the // presence penalty setting for the GenAI request. // // Type: double // RequirementLevel: Recommended // Stability: Development // // Examples: 0.1 GenAIRequestPresencePenaltyKey = attribute.Key("gen_ai.request.presence_penalty") // GenAIRequestSeedKey is the attribute Key conforming to the // "gen_ai.request.seed" semantic conventions. It represents the requests with // same seed value more likely to return same result. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 100 GenAIRequestSeedKey = attribute.Key("gen_ai.request.seed") // GenAIRequestStopSequencesKey is the attribute Key conforming to the // "gen_ai.request.stop_sequences" semantic conventions. It represents the list // of sequences that the model will use to stop generating further tokens. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "forest", "lived" GenAIRequestStopSequencesKey = attribute.Key("gen_ai.request.stop_sequences") // GenAIRequestTemperatureKey is the attribute Key conforming to the // "gen_ai.request.temperature" semantic conventions. It represents the // temperature setting for the GenAI request. // // Type: double // RequirementLevel: Recommended // Stability: Development // // Examples: 0.0 GenAIRequestTemperatureKey = attribute.Key("gen_ai.request.temperature") // GenAIRequestTopKKey is the attribute Key conforming to the // "gen_ai.request.top_k" semantic conventions. It represents the top_k sampling // setting for the GenAI request. // // Type: double // RequirementLevel: Recommended // Stability: Development // // Examples: 1.0 GenAIRequestTopKKey = attribute.Key("gen_ai.request.top_k") // GenAIRequestTopPKey is the attribute Key conforming to the // "gen_ai.request.top_p" semantic conventions. It represents the top_p sampling // setting for the GenAI request. // // Type: double // RequirementLevel: Recommended // Stability: Development // // Examples: 1.0 GenAIRequestTopPKey = attribute.Key("gen_ai.request.top_p") // GenAIResponseFinishReasonsKey is the attribute Key conforming to the // "gen_ai.response.finish_reasons" semantic conventions. It represents the // array of reasons the model stopped generating tokens, corresponding to each // generation received. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "stop"], ["stop", "length" GenAIResponseFinishReasonsKey = attribute.Key("gen_ai.response.finish_reasons") // GenAIResponseIDKey is the attribute Key conforming to the // "gen_ai.response.id" semantic conventions. It represents the unique // identifier for the completion. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "chatcmpl-123" GenAIResponseIDKey = attribute.Key("gen_ai.response.id") // GenAIResponseModelKey is the attribute Key conforming to the // "gen_ai.response.model" semantic conventions. It represents the name of the // model that generated the response. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "gpt-4-0613" GenAIResponseModelKey = attribute.Key("gen_ai.response.model") // GenAISystemInstructionsKey is the attribute Key conforming to the // "gen_ai.system_instructions" semantic conventions. It represents the system // message or instructions provided to the GenAI model separately from the chat // history. // // Type: any // RequirementLevel: Recommended // Stability: Development // // Examples: "[\n {\n "type": "text",\n "content": "You are an Agent that greet // users, always use greetings tool to respond"\n }\n]\n", "[\n {\n "type": // "text",\n "content": "You are a language translator."\n },\n {\n "type": // "text",\n "content": "Your mission is to translate text in English to // French."\n }\n]\n" // Note: This attribute SHOULD be used when the corresponding provider or API // allows to provide system instructions or messages separately from the // chat history. // // Instructions that are part of the chat history SHOULD be recorded in // `gen_ai.input.messages` attribute instead. // // Instrumentations MUST follow [System instructions JSON schema]. // // When recorded on spans, it MAY be recorded as a JSON string if structured // format is not supported and SHOULD be recorded in structured form otherwise. // // Instrumentations MAY provide a way for users to filter or truncate // system instructions. // // > [!Warning] // > This attribute may contain sensitive information. // // See [Recording content on attributes] // section for more details. // // [System instructions JSON schema]: /docs/gen-ai/gen-ai-system-instructions.json // [Recording content on attributes]: /docs/gen-ai/gen-ai-spans.md#recording-content-on-attributes GenAISystemInstructionsKey = attribute.Key("gen_ai.system_instructions") // GenAITokenTypeKey is the attribute Key conforming to the "gen_ai.token.type" // semantic conventions. It represents the type of token being counted. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "input", "output" GenAITokenTypeKey = attribute.Key("gen_ai.token.type") // GenAIToolCallIDKey is the attribute Key conforming to the // "gen_ai.tool.call.id" semantic conventions. It represents the tool call // identifier. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "call_mszuSIzqtI65i1wAUOE8w5H4" GenAIToolCallIDKey = attribute.Key("gen_ai.tool.call.id") // GenAIToolDescriptionKey is the attribute Key conforming to the // "gen_ai.tool.description" semantic conventions. It represents the tool // description. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Multiply two numbers" GenAIToolDescriptionKey = attribute.Key("gen_ai.tool.description") // GenAIToolNameKey is the attribute Key conforming to the "gen_ai.tool.name" // semantic conventions. It represents the name of the tool utilized by the // agent. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Flights" GenAIToolNameKey = attribute.Key("gen_ai.tool.name") // GenAIToolTypeKey is the attribute Key conforming to the "gen_ai.tool.type" // semantic conventions. It represents the type of the tool utilized by the // agent. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "function", "extension", "datastore" // Note: Extension: A tool executed on the agent-side to directly call external // APIs, bridging the gap between the agent and real-world systems. // Agent-side operations involve actions that are performed by the agent on the // server or within the agent's controlled environment. // Function: A tool executed on the client-side, where the agent generates // parameters for a predefined function, and the client executes the logic. // Client-side operations are actions taken on the user's end or within the // client application. // Datastore: A tool used by the agent to access and query structured or // unstructured external data for retrieval-augmented tasks or knowledge // updates. GenAIToolTypeKey = attribute.Key("gen_ai.tool.type") // GenAIUsageInputTokensKey is the attribute Key conforming to the // "gen_ai.usage.input_tokens" semantic conventions. It represents the number of // tokens used in the GenAI input (prompt). // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 100 GenAIUsageInputTokensKey = attribute.Key("gen_ai.usage.input_tokens") // GenAIUsageOutputTokensKey is the attribute Key conforming to the // "gen_ai.usage.output_tokens" semantic conventions. It represents the number // of tokens used in the GenAI response (completion). // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 180 GenAIUsageOutputTokensKey = attribute.Key("gen_ai.usage.output_tokens") ) // GenAIAgentDescription returns an attribute KeyValue conforming to the // "gen_ai.agent.description" semantic conventions. It represents the free-form // description of the GenAI agent provided by the application. func GenAIAgentDescription(val string) attribute.KeyValue { return GenAIAgentDescriptionKey.String(val) } // GenAIAgentID returns an attribute KeyValue conforming to the "gen_ai.agent.id" // semantic conventions. It represents the unique identifier of the GenAI agent. func GenAIAgentID(val string) attribute.KeyValue { return GenAIAgentIDKey.String(val) } // GenAIAgentName returns an attribute KeyValue conforming to the // "gen_ai.agent.name" semantic conventions. It represents the human-readable // name of the GenAI agent provided by the application. func GenAIAgentName(val string) attribute.KeyValue { return GenAIAgentNameKey.String(val) } // GenAIConversationID returns an attribute KeyValue conforming to the // "gen_ai.conversation.id" semantic conventions. It represents the unique // identifier for a conversation (session, thread), used to store and correlate // messages within this conversation. func GenAIConversationID(val string) attribute.KeyValue { return GenAIConversationIDKey.String(val) } // GenAIDataSourceID returns an attribute KeyValue conforming to the // "gen_ai.data_source.id" semantic conventions. It represents the data source // identifier. func GenAIDataSourceID(val string) attribute.KeyValue { return GenAIDataSourceIDKey.String(val) } // GenAIRequestChoiceCount returns an attribute KeyValue conforming to the // "gen_ai.request.choice.count" semantic conventions. It represents the target // number of candidate completions to return. func GenAIRequestChoiceCount(val int) attribute.KeyValue { return GenAIRequestChoiceCountKey.Int(val) } // GenAIRequestEncodingFormats returns an attribute KeyValue conforming to the // "gen_ai.request.encoding_formats" semantic conventions. It represents the // encoding formats requested in an embeddings operation, if specified. func GenAIRequestEncodingFormats(val ...string) attribute.KeyValue { return GenAIRequestEncodingFormatsKey.StringSlice(val) } // GenAIRequestFrequencyPenalty returns an attribute KeyValue conforming to the // "gen_ai.request.frequency_penalty" semantic conventions. It represents the // frequency penalty setting for the GenAI request. func GenAIRequestFrequencyPenalty(val float64) attribute.KeyValue { return GenAIRequestFrequencyPenaltyKey.Float64(val) } // GenAIRequestMaxTokens returns an attribute KeyValue conforming to the // "gen_ai.request.max_tokens" semantic conventions. It represents the maximum // number of tokens the model generates for a request. func GenAIRequestMaxTokens(val int) attribute.KeyValue { return GenAIRequestMaxTokensKey.Int(val) } // GenAIRequestModel returns an attribute KeyValue conforming to the // "gen_ai.request.model" semantic conventions. It represents the name of the // GenAI model a request is being made to. func GenAIRequestModel(val string) attribute.KeyValue { return GenAIRequestModelKey.String(val) } // GenAIRequestPresencePenalty returns an attribute KeyValue conforming to the // "gen_ai.request.presence_penalty" semantic conventions. It represents the // presence penalty setting for the GenAI request. func GenAIRequestPresencePenalty(val float64) attribute.KeyValue { return GenAIRequestPresencePenaltyKey.Float64(val) } // GenAIRequestSeed returns an attribute KeyValue conforming to the // "gen_ai.request.seed" semantic conventions. It represents the requests with // same seed value more likely to return same result. func GenAIRequestSeed(val int) attribute.KeyValue { return GenAIRequestSeedKey.Int(val) } // GenAIRequestStopSequences returns an attribute KeyValue conforming to the // "gen_ai.request.stop_sequences" semantic conventions. It represents the list // of sequences that the model will use to stop generating further tokens. func GenAIRequestStopSequences(val ...string) attribute.KeyValue { return GenAIRequestStopSequencesKey.StringSlice(val) } // GenAIRequestTemperature returns an attribute KeyValue conforming to the // "gen_ai.request.temperature" semantic conventions. It represents the // temperature setting for the GenAI request. func GenAIRequestTemperature(val float64) attribute.KeyValue { return GenAIRequestTemperatureKey.Float64(val) } // GenAIRequestTopK returns an attribute KeyValue conforming to the // "gen_ai.request.top_k" semantic conventions. It represents the top_k sampling // setting for the GenAI request. func GenAIRequestTopK(val float64) attribute.KeyValue { return GenAIRequestTopKKey.Float64(val) } // GenAIRequestTopP returns an attribute KeyValue conforming to the // "gen_ai.request.top_p" semantic conventions. It represents the top_p sampling // setting for the GenAI request. func GenAIRequestTopP(val float64) attribute.KeyValue { return GenAIRequestTopPKey.Float64(val) } // GenAIResponseFinishReasons returns an attribute KeyValue conforming to the // "gen_ai.response.finish_reasons" semantic conventions. It represents the array // of reasons the model stopped generating tokens, corresponding to each // generation received. func GenAIResponseFinishReasons(val ...string) attribute.KeyValue { return GenAIResponseFinishReasonsKey.StringSlice(val) } // GenAIResponseID returns an attribute KeyValue conforming to the // "gen_ai.response.id" semantic conventions. It represents the unique identifier // for the completion. func GenAIResponseID(val string) attribute.KeyValue { return GenAIResponseIDKey.String(val) } // GenAIResponseModel returns an attribute KeyValue conforming to the // "gen_ai.response.model" semantic conventions. It represents the name of the // model that generated the response. func GenAIResponseModel(val string) attribute.KeyValue { return GenAIResponseModelKey.String(val) } // GenAIToolCallID returns an attribute KeyValue conforming to the // "gen_ai.tool.call.id" semantic conventions. It represents the tool call // identifier. func GenAIToolCallID(val string) attribute.KeyValue { return GenAIToolCallIDKey.String(val) } // GenAIToolDescription returns an attribute KeyValue conforming to the // "gen_ai.tool.description" semantic conventions. It represents the tool // description. func GenAIToolDescription(val string) attribute.KeyValue { return GenAIToolDescriptionKey.String(val) } // GenAIToolName returns an attribute KeyValue conforming to the // "gen_ai.tool.name" semantic conventions. It represents the name of the tool // utilized by the agent. func GenAIToolName(val string) attribute.KeyValue { return GenAIToolNameKey.String(val) } // GenAIToolType returns an attribute KeyValue conforming to the // "gen_ai.tool.type" semantic conventions. It represents the type of the tool // utilized by the agent. func GenAIToolType(val string) attribute.KeyValue { return GenAIToolTypeKey.String(val) } // GenAIUsageInputTokens returns an attribute KeyValue conforming to the // "gen_ai.usage.input_tokens" semantic conventions. It represents the number of // tokens used in the GenAI input (prompt). func GenAIUsageInputTokens(val int) attribute.KeyValue { return GenAIUsageInputTokensKey.Int(val) } // GenAIUsageOutputTokens returns an attribute KeyValue conforming to the // "gen_ai.usage.output_tokens" semantic conventions. It represents the number of // tokens used in the GenAI response (completion). func GenAIUsageOutputTokens(val int) attribute.KeyValue { return GenAIUsageOutputTokensKey.Int(val) } // Enum values for gen_ai.operation.name var ( // Chat completion operation such as [OpenAI Chat API] // Stability: development // // [OpenAI Chat API]: https://platform.openai.com/docs/api-reference/chat GenAIOperationNameChat = GenAIOperationNameKey.String("chat") // Multimodal content generation operation such as [Gemini Generate Content] // Stability: development // // [Gemini Generate Content]: https://ai.google.dev/api/generate-content GenAIOperationNameGenerateContent = GenAIOperationNameKey.String("generate_content") // Text completions operation such as [OpenAI Completions API (Legacy)] // Stability: development // // [OpenAI Completions API (Legacy)]: https://platform.openai.com/docs/api-reference/completions GenAIOperationNameTextCompletion = GenAIOperationNameKey.String("text_completion") // Embeddings operation such as [OpenAI Create embeddings API] // Stability: development // // [OpenAI Create embeddings API]: https://platform.openai.com/docs/api-reference/embeddings/create GenAIOperationNameEmbeddings = GenAIOperationNameKey.String("embeddings") // Create GenAI agent // Stability: development GenAIOperationNameCreateAgent = GenAIOperationNameKey.String("create_agent") // Invoke GenAI agent // Stability: development GenAIOperationNameInvokeAgent = GenAIOperationNameKey.String("invoke_agent") // Execute a tool // Stability: development GenAIOperationNameExecuteTool = GenAIOperationNameKey.String("execute_tool") ) // Enum values for gen_ai.output.type var ( // Plain text // Stability: development GenAIOutputTypeText = GenAIOutputTypeKey.String("text") // JSON object with known or unknown schema // Stability: development GenAIOutputTypeJSON = GenAIOutputTypeKey.String("json") // Image // Stability: development GenAIOutputTypeImage = GenAIOutputTypeKey.String("image") // Speech // Stability: development GenAIOutputTypeSpeech = GenAIOutputTypeKey.String("speech") ) // Enum values for gen_ai.provider.name var ( // [OpenAI] // Stability: development // // [OpenAI]: https://openai.com/ GenAIProviderNameOpenAI = GenAIProviderNameKey.String("openai") // Any Google generative AI endpoint // Stability: development GenAIProviderNameGCPGenAI = GenAIProviderNameKey.String("gcp.gen_ai") // [Vertex AI] // Stability: development // // [Vertex AI]: https://cloud.google.com/vertex-ai GenAIProviderNameGCPVertexAI = GenAIProviderNameKey.String("gcp.vertex_ai") // [Gemini] // Stability: development // // [Gemini]: https://cloud.google.com/products/gemini GenAIProviderNameGCPGemini = GenAIProviderNameKey.String("gcp.gemini") // [Anthropic] // Stability: development // // [Anthropic]: https://www.anthropic.com/ GenAIProviderNameAnthropic = GenAIProviderNameKey.String("anthropic") // [Cohere] // Stability: development // // [Cohere]: https://cohere.com/ GenAIProviderNameCohere = GenAIProviderNameKey.String("cohere") // Azure AI Inference // Stability: development GenAIProviderNameAzureAIInference = GenAIProviderNameKey.String("azure.ai.inference") // [Azure OpenAI] // Stability: development // // [Azure OpenAI]: https://azure.microsoft.com/products/ai-services/openai-service/ GenAIProviderNameAzureAIOpenAI = GenAIProviderNameKey.String("azure.ai.openai") // [IBM Watsonx AI] // Stability: development // // [IBM Watsonx AI]: https://www.ibm.com/products/watsonx-ai GenAIProviderNameIBMWatsonxAI = GenAIProviderNameKey.String("ibm.watsonx.ai") // [AWS Bedrock] // Stability: development // // [AWS Bedrock]: https://aws.amazon.com/bedrock GenAIProviderNameAWSBedrock = GenAIProviderNameKey.String("aws.bedrock") // [Perplexity] // Stability: development // // [Perplexity]: https://www.perplexity.ai/ GenAIProviderNamePerplexity = GenAIProviderNameKey.String("perplexity") // [xAI] // Stability: development // // [xAI]: https://x.ai/ GenAIProviderNameXAI = GenAIProviderNameKey.String("x_ai") // [DeepSeek] // Stability: development // // [DeepSeek]: https://www.deepseek.com/ GenAIProviderNameDeepseek = GenAIProviderNameKey.String("deepseek") // [Groq] // Stability: development // // [Groq]: https://groq.com/ GenAIProviderNameGroq = GenAIProviderNameKey.String("groq") // [Mistral AI] // Stability: development // // [Mistral AI]: https://mistral.ai/ GenAIProviderNameMistralAI = GenAIProviderNameKey.String("mistral_ai") ) // Enum values for gen_ai.token.type var ( // Input tokens (prompt, input, etc.) // Stability: development GenAITokenTypeInput = GenAITokenTypeKey.String("input") // Output tokens (completion, response, etc.) // Stability: development GenAITokenTypeOutput = GenAITokenTypeKey.String("output") ) // Namespace: geo const ( // GeoContinentCodeKey is the attribute Key conforming to the // "geo.continent.code" semantic conventions. It represents the two-letter code // representing continent’s name. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: GeoContinentCodeKey = attribute.Key("geo.continent.code") // GeoCountryISOCodeKey is the attribute Key conforming to the // "geo.country.iso_code" semantic conventions. It represents the two-letter ISO // Country Code ([ISO 3166-1 alpha2]). // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "CA" // // [ISO 3166-1 alpha2]: https://wikipedia.org/wiki/ISO_3166-1#Codes GeoCountryISOCodeKey = attribute.Key("geo.country.iso_code") // GeoLocalityNameKey is the attribute Key conforming to the "geo.locality.name" // semantic conventions. It represents the locality name. Represents the name of // a city, town, village, or similar populated place. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Montreal", "Berlin" GeoLocalityNameKey = attribute.Key("geo.locality.name") // GeoLocationLatKey is the attribute Key conforming to the "geo.location.lat" // semantic conventions. It represents the latitude of the geo location in // [WGS84]. // // Type: double // RequirementLevel: Recommended // Stability: Development // // Examples: 45.505918 // // [WGS84]: https://wikipedia.org/wiki/World_Geodetic_System#WGS84 GeoLocationLatKey = attribute.Key("geo.location.lat") // GeoLocationLonKey is the attribute Key conforming to the "geo.location.lon" // semantic conventions. It represents the longitude of the geo location in // [WGS84]. // // Type: double // RequirementLevel: Recommended // Stability: Development // // Examples: -73.61483 // // [WGS84]: https://wikipedia.org/wiki/World_Geodetic_System#WGS84 GeoLocationLonKey = attribute.Key("geo.location.lon") // GeoPostalCodeKey is the attribute Key conforming to the "geo.postal_code" // semantic conventions. It represents the postal code associated with the // location. Values appropriate for this field may also be known as a postcode // or ZIP code and will vary widely from country to country. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "94040" GeoPostalCodeKey = attribute.Key("geo.postal_code") // GeoRegionISOCodeKey is the attribute Key conforming to the // "geo.region.iso_code" semantic conventions. It represents the region ISO code // ([ISO 3166-2]). // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "CA-QC" // // [ISO 3166-2]: https://wikipedia.org/wiki/ISO_3166-2 GeoRegionISOCodeKey = attribute.Key("geo.region.iso_code") ) // GeoCountryISOCode returns an attribute KeyValue conforming to the // "geo.country.iso_code" semantic conventions. It represents the two-letter ISO // Country Code ([ISO 3166-1 alpha2]). // // [ISO 3166-1 alpha2]: https://wikipedia.org/wiki/ISO_3166-1#Codes func GeoCountryISOCode(val string) attribute.KeyValue { return GeoCountryISOCodeKey.String(val) } // GeoLocalityName returns an attribute KeyValue conforming to the // "geo.locality.name" semantic conventions. It represents the locality name. // Represents the name of a city, town, village, or similar populated place. func GeoLocalityName(val string) attribute.KeyValue { return GeoLocalityNameKey.String(val) } // GeoLocationLat returns an attribute KeyValue conforming to the // "geo.location.lat" semantic conventions. It represents the latitude of the geo // location in [WGS84]. // // [WGS84]: https://wikipedia.org/wiki/World_Geodetic_System#WGS84 func GeoLocationLat(val float64) attribute.KeyValue { return GeoLocationLatKey.Float64(val) } // GeoLocationLon returns an attribute KeyValue conforming to the // "geo.location.lon" semantic conventions. It represents the longitude of the // geo location in [WGS84]. // // [WGS84]: https://wikipedia.org/wiki/World_Geodetic_System#WGS84 func GeoLocationLon(val float64) attribute.KeyValue { return GeoLocationLonKey.Float64(val) } // GeoPostalCode returns an attribute KeyValue conforming to the // "geo.postal_code" semantic conventions. It represents the postal code // associated with the location. Values appropriate for this field may also be // known as a postcode or ZIP code and will vary widely from country to country. func GeoPostalCode(val string) attribute.KeyValue { return GeoPostalCodeKey.String(val) } // GeoRegionISOCode returns an attribute KeyValue conforming to the // "geo.region.iso_code" semantic conventions. It represents the region ISO code // ([ISO 3166-2]). // // [ISO 3166-2]: https://wikipedia.org/wiki/ISO_3166-2 func GeoRegionISOCode(val string) attribute.KeyValue { return GeoRegionISOCodeKey.String(val) } // Enum values for geo.continent.code var ( // Africa // Stability: development GeoContinentCodeAf = GeoContinentCodeKey.String("AF") // Antarctica // Stability: development GeoContinentCodeAn = GeoContinentCodeKey.String("AN") // Asia // Stability: development GeoContinentCodeAs = GeoContinentCodeKey.String("AS") // Europe // Stability: development GeoContinentCodeEu = GeoContinentCodeKey.String("EU") // North America // Stability: development GeoContinentCodeNa = GeoContinentCodeKey.String("NA") // Oceania // Stability: development GeoContinentCodeOc = GeoContinentCodeKey.String("OC") // South America // Stability: development GeoContinentCodeSa = GeoContinentCodeKey.String("SA") ) // Namespace: go const ( // GoMemoryTypeKey is the attribute Key conforming to the "go.memory.type" // semantic conventions. It represents the type of memory. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "other", "stack" GoMemoryTypeKey = attribute.Key("go.memory.type") ) // Enum values for go.memory.type var ( // Memory allocated from the heap that is reserved for stack space, whether or // not it is currently in-use. // Stability: development GoMemoryTypeStack = GoMemoryTypeKey.String("stack") // Memory used by the Go runtime, excluding other categories of memory usage // described in this enumeration. // Stability: development GoMemoryTypeOther = GoMemoryTypeKey.String("other") ) // Namespace: graphql const ( // GraphQLDocumentKey is the attribute Key conforming to the "graphql.document" // semantic conventions. It represents the GraphQL document being executed. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: query findBookById { bookById(id: ?) { name } } // Note: The value may be sanitized to exclude sensitive information. GraphQLDocumentKey = attribute.Key("graphql.document") // GraphQLOperationNameKey is the attribute Key conforming to the // "graphql.operation.name" semantic conventions. It represents the name of the // operation being executed. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: findBookById GraphQLOperationNameKey = attribute.Key("graphql.operation.name") // GraphQLOperationTypeKey is the attribute Key conforming to the // "graphql.operation.type" semantic conventions. It represents the type of the // operation being executed. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "query", "mutation", "subscription" GraphQLOperationTypeKey = attribute.Key("graphql.operation.type") ) // GraphQLDocument returns an attribute KeyValue conforming to the // "graphql.document" semantic conventions. It represents the GraphQL document // being executed. func GraphQLDocument(val string) attribute.KeyValue { return GraphQLDocumentKey.String(val) } // GraphQLOperationName returns an attribute KeyValue conforming to the // "graphql.operation.name" semantic conventions. It represents the name of the // operation being executed. func GraphQLOperationName(val string) attribute.KeyValue { return GraphQLOperationNameKey.String(val) } // Enum values for graphql.operation.type var ( // GraphQL query // Stability: development GraphQLOperationTypeQuery = GraphQLOperationTypeKey.String("query") // GraphQL mutation // Stability: development GraphQLOperationTypeMutation = GraphQLOperationTypeKey.String("mutation") // GraphQL subscription // Stability: development GraphQLOperationTypeSubscription = GraphQLOperationTypeKey.String("subscription") ) // Namespace: heroku const ( // HerokuAppIDKey is the attribute Key conforming to the "heroku.app.id" // semantic conventions. It represents the unique identifier for the // application. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "2daa2797-e42b-4624-9322-ec3f968df4da" HerokuAppIDKey = attribute.Key("heroku.app.id") // HerokuReleaseCommitKey is the attribute Key conforming to the // "heroku.release.commit" semantic conventions. It represents the commit hash // for the current release. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "e6134959463efd8966b20e75b913cafe3f5ec" HerokuReleaseCommitKey = attribute.Key("heroku.release.commit") // HerokuReleaseCreationTimestampKey is the attribute Key conforming to the // "heroku.release.creation_timestamp" semantic conventions. It represents the // time and date the release was created. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "2022-10-23T18:00:42Z" HerokuReleaseCreationTimestampKey = attribute.Key("heroku.release.creation_timestamp") ) // HerokuAppID returns an attribute KeyValue conforming to the "heroku.app.id" // semantic conventions. It represents the unique identifier for the application. func HerokuAppID(val string) attribute.KeyValue { return HerokuAppIDKey.String(val) } // HerokuReleaseCommit returns an attribute KeyValue conforming to the // "heroku.release.commit" semantic conventions. It represents the commit hash // for the current release. func HerokuReleaseCommit(val string) attribute.KeyValue { return HerokuReleaseCommitKey.String(val) } // HerokuReleaseCreationTimestamp returns an attribute KeyValue conforming to the // "heroku.release.creation_timestamp" semantic conventions. It represents the // time and date the release was created. func HerokuReleaseCreationTimestamp(val string) attribute.KeyValue { return HerokuReleaseCreationTimestampKey.String(val) } // Namespace: host const ( // HostArchKey is the attribute Key conforming to the "host.arch" semantic // conventions. It represents the CPU architecture the host system is running // on. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: HostArchKey = attribute.Key("host.arch") // HostCPUCacheL2SizeKey is the attribute Key conforming to the // "host.cpu.cache.l2.size" semantic conventions. It represents the amount of // level 2 memory cache available to the processor (in Bytes). // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 12288000 HostCPUCacheL2SizeKey = attribute.Key("host.cpu.cache.l2.size") // HostCPUFamilyKey is the attribute Key conforming to the "host.cpu.family" // semantic conventions. It represents the family or generation of the CPU. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "6", "PA-RISC 1.1e" HostCPUFamilyKey = attribute.Key("host.cpu.family") // HostCPUModelIDKey is the attribute Key conforming to the "host.cpu.model.id" // semantic conventions. It represents the model identifier. It provides more // granular information about the CPU, distinguishing it from other CPUs within // the same family. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "6", "9000/778/B180L" HostCPUModelIDKey = attribute.Key("host.cpu.model.id") // HostCPUModelNameKey is the attribute Key conforming to the // "host.cpu.model.name" semantic conventions. It represents the model // designation of the processor. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz" HostCPUModelNameKey = attribute.Key("host.cpu.model.name") // HostCPUSteppingKey is the attribute Key conforming to the "host.cpu.stepping" // semantic conventions. It represents the stepping or core revisions. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "1", "r1p1" HostCPUSteppingKey = attribute.Key("host.cpu.stepping") // HostCPUVendorIDKey is the attribute Key conforming to the // "host.cpu.vendor.id" semantic conventions. It represents the processor // manufacturer identifier. A maximum 12-character string. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "GenuineIntel" // Note: [CPUID] command returns the vendor ID string in EBX, EDX and ECX // registers. Writing these to memory in this order results in a 12-character // string. // // [CPUID]: https://wiki.osdev.org/CPUID HostCPUVendorIDKey = attribute.Key("host.cpu.vendor.id") // HostIDKey is the attribute Key conforming to the "host.id" semantic // conventions. It represents the unique host ID. For Cloud, this must be the // instance_id assigned by the cloud provider. For non-containerized systems, // this should be the `machine-id`. See the table below for the sources to use // to determine the `machine-id` based on operating system. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "fdbf79e8af94cb7f9e8df36789187052" HostIDKey = attribute.Key("host.id") // HostImageIDKey is the attribute Key conforming to the "host.image.id" // semantic conventions. It represents the VM image ID or host OS image ID. For // Cloud, this value is from the provider. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "ami-07b06b442921831e5" HostImageIDKey = attribute.Key("host.image.id") // HostImageNameKey is the attribute Key conforming to the "host.image.name" // semantic conventions. It represents the name of the VM image or OS install // the host was instantiated from. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "infra-ami-eks-worker-node-7d4ec78312", "CentOS-8-x86_64-1905" HostImageNameKey = attribute.Key("host.image.name") // HostImageVersionKey is the attribute Key conforming to the // "host.image.version" semantic conventions. It represents the version string // of the VM image or host OS as defined in [Version Attributes]. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "0.1" // // [Version Attributes]: /docs/resource/README.md#version-attributes HostImageVersionKey = attribute.Key("host.image.version") // HostIPKey is the attribute Key conforming to the "host.ip" semantic // conventions. It represents the available IP addresses of the host, excluding // loopback interfaces. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "192.168.1.140", "fe80::abc2:4a28:737a:609e" // Note: IPv4 Addresses MUST be specified in dotted-quad notation. IPv6 // addresses MUST be specified in the [RFC 5952] format. // // [RFC 5952]: https://www.rfc-editor.org/rfc/rfc5952.html HostIPKey = attribute.Key("host.ip") // HostMacKey is the attribute Key conforming to the "host.mac" semantic // conventions. It represents the available MAC addresses of the host, excluding // loopback interfaces. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "AC-DE-48-23-45-67", "AC-DE-48-23-45-67-01-9F" // Note: MAC Addresses MUST be represented in [IEEE RA hexadecimal form]: as // hyphen-separated octets in uppercase hexadecimal form from most to least // significant. // // [IEEE RA hexadecimal form]: https://standards.ieee.org/wp-content/uploads/import/documents/tutorials/eui.pdf HostMacKey = attribute.Key("host.mac") // HostNameKey is the attribute Key conforming to the "host.name" semantic // conventions. It represents the name of the host. On Unix systems, it may // contain what the hostname command returns, or the fully qualified hostname, // or another name specified by the user. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "opentelemetry-test" HostNameKey = attribute.Key("host.name") // HostTypeKey is the attribute Key conforming to the "host.type" semantic // conventions. It represents the type of host. For Cloud, this must be the // machine type. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "n1-standard-1" HostTypeKey = attribute.Key("host.type") ) // HostCPUCacheL2Size returns an attribute KeyValue conforming to the // "host.cpu.cache.l2.size" semantic conventions. It represents the amount of // level 2 memory cache available to the processor (in Bytes). func HostCPUCacheL2Size(val int) attribute.KeyValue { return HostCPUCacheL2SizeKey.Int(val) } // HostCPUFamily returns an attribute KeyValue conforming to the // "host.cpu.family" semantic conventions. It represents the family or generation // of the CPU. func HostCPUFamily(val string) attribute.KeyValue { return HostCPUFamilyKey.String(val) } // HostCPUModelID returns an attribute KeyValue conforming to the // "host.cpu.model.id" semantic conventions. It represents the model identifier. // It provides more granular information about the CPU, distinguishing it from // other CPUs within the same family. func HostCPUModelID(val string) attribute.KeyValue { return HostCPUModelIDKey.String(val) } // HostCPUModelName returns an attribute KeyValue conforming to the // "host.cpu.model.name" semantic conventions. It represents the model // designation of the processor. func HostCPUModelName(val string) attribute.KeyValue { return HostCPUModelNameKey.String(val) } // HostCPUStepping returns an attribute KeyValue conforming to the // "host.cpu.stepping" semantic conventions. It represents the stepping or core // revisions. func HostCPUStepping(val string) attribute.KeyValue { return HostCPUSteppingKey.String(val) } // HostCPUVendorID returns an attribute KeyValue conforming to the // "host.cpu.vendor.id" semantic conventions. It represents the processor // manufacturer identifier. A maximum 12-character string. func HostCPUVendorID(val string) attribute.KeyValue { return HostCPUVendorIDKey.String(val) } // HostID returns an attribute KeyValue conforming to the "host.id" semantic // conventions. It represents the unique host ID. For Cloud, this must be the // instance_id assigned by the cloud provider. For non-containerized systems, // this should be the `machine-id`. See the table below for the sources to use to // determine the `machine-id` based on operating system. func HostID(val string) attribute.KeyValue { return HostIDKey.String(val) } // HostImageID returns an attribute KeyValue conforming to the "host.image.id" // semantic conventions. It represents the VM image ID or host OS image ID. For // Cloud, this value is from the provider. func HostImageID(val string) attribute.KeyValue { return HostImageIDKey.String(val) } // HostImageName returns an attribute KeyValue conforming to the // "host.image.name" semantic conventions. It represents the name of the VM image // or OS install the host was instantiated from. func HostImageName(val string) attribute.KeyValue { return HostImageNameKey.String(val) } // HostImageVersion returns an attribute KeyValue conforming to the // "host.image.version" semantic conventions. It represents the version string of // the VM image or host OS as defined in [Version Attributes]. // // [Version Attributes]: /docs/resource/README.md#version-attributes func HostImageVersion(val string) attribute.KeyValue { return HostImageVersionKey.String(val) } // HostIP returns an attribute KeyValue conforming to the "host.ip" semantic // conventions. It represents the available IP addresses of the host, excluding // loopback interfaces. func HostIP(val ...string) attribute.KeyValue { return HostIPKey.StringSlice(val) } // HostMac returns an attribute KeyValue conforming to the "host.mac" semantic // conventions. It represents the available MAC addresses of the host, excluding // loopback interfaces. func HostMac(val ...string) attribute.KeyValue { return HostMacKey.StringSlice(val) } // HostName returns an attribute KeyValue conforming to the "host.name" semantic // conventions. It represents the name of the host. On Unix systems, it may // contain what the hostname command returns, or the fully qualified hostname, or // another name specified by the user. func HostName(val string) attribute.KeyValue { return HostNameKey.String(val) } // HostType returns an attribute KeyValue conforming to the "host.type" semantic // conventions. It represents the type of host. For Cloud, this must be the // machine type. func HostType(val string) attribute.KeyValue { return HostTypeKey.String(val) } // Enum values for host.arch var ( // AMD64 // Stability: development HostArchAMD64 = HostArchKey.String("amd64") // ARM32 // Stability: development HostArchARM32 = HostArchKey.String("arm32") // ARM64 // Stability: development HostArchARM64 = HostArchKey.String("arm64") // Itanium // Stability: development HostArchIA64 = HostArchKey.String("ia64") // 32-bit PowerPC // Stability: development HostArchPPC32 = HostArchKey.String("ppc32") // 64-bit PowerPC // Stability: development HostArchPPC64 = HostArchKey.String("ppc64") // IBM z/Architecture // Stability: development HostArchS390x = HostArchKey.String("s390x") // 32-bit x86 // Stability: development HostArchX86 = HostArchKey.String("x86") ) // Namespace: http const ( // HTTPConnectionStateKey is the attribute Key conforming to the // "http.connection.state" semantic conventions. It represents the state of the // HTTP connection in the HTTP connection pool. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "active", "idle" HTTPConnectionStateKey = attribute.Key("http.connection.state") // HTTPRequestBodySizeKey is the attribute Key conforming to the // "http.request.body.size" semantic conventions. It represents the size of the // request payload body in bytes. This is the number of bytes transferred // excluding headers and is often, but not always, present as the // [Content-Length] header. For requests using transport encoding, this should // be the compressed size. // // Type: int // RequirementLevel: Recommended // Stability: Development // // [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length HTTPRequestBodySizeKey = attribute.Key("http.request.body.size") // HTTPRequestMethodKey is the attribute Key conforming to the // "http.request.method" semantic conventions. It represents the HTTP request // method. // // Type: Enum // RequirementLevel: Recommended // Stability: Stable // // Examples: "GET", "POST", "HEAD" // Note: HTTP request method value SHOULD be "known" to the instrumentation. // By default, this convention defines "known" methods as the ones listed in // [RFC9110] // and the PATCH method defined in [RFC5789]. // // If the HTTP request method is not known to instrumentation, it MUST set the // `http.request.method` attribute to `_OTHER`. // // If the HTTP instrumentation could end up converting valid HTTP request // methods to `_OTHER`, then it MUST provide a way to override // the list of known HTTP methods. If this override is done via environment // variable, then the environment variable MUST be named // OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of // case-sensitive known HTTP methods // (this list MUST be a full override of the default known method, it is not a // list of known methods in addition to the defaults). // // HTTP method names are case-sensitive and `http.request.method` attribute // value MUST match a known HTTP method name exactly. // Instrumentations for specific web frameworks that consider HTTP methods to be // case insensitive, SHOULD populate a canonical equivalent. // Tracing instrumentations that do so, MUST also set // `http.request.method_original` to the original value. // // [RFC9110]: https://www.rfc-editor.org/rfc/rfc9110.html#name-methods // [RFC5789]: https://www.rfc-editor.org/rfc/rfc5789.html HTTPRequestMethodKey = attribute.Key("http.request.method") // HTTPRequestMethodOriginalKey is the attribute Key conforming to the // "http.request.method_original" semantic conventions. It represents the // original HTTP method sent by the client in the request line. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "GeT", "ACL", "foo" HTTPRequestMethodOriginalKey = attribute.Key("http.request.method_original") // HTTPRequestResendCountKey is the attribute Key conforming to the // "http.request.resend_count" semantic conventions. It represents the ordinal // number of request resending attempt (for any reason, including redirects). // // Type: int // RequirementLevel: Recommended // Stability: Stable // // Note: The resend count SHOULD be updated each time an HTTP request gets // resent by the client, regardless of what was the cause of the resending (e.g. // redirection, authorization failure, 503 Server Unavailable, network issues, // or any other). HTTPRequestResendCountKey = attribute.Key("http.request.resend_count") // HTTPRequestSizeKey is the attribute Key conforming to the "http.request.size" // semantic conventions. It represents the total size of the request in bytes. // This should be the total number of bytes sent over the wire, including the // request line (HTTP/1.1), framing (HTTP/2 and HTTP/3), headers, and request // body if any. // // Type: int // RequirementLevel: Recommended // Stability: Development HTTPRequestSizeKey = attribute.Key("http.request.size") // HTTPResponseBodySizeKey is the attribute Key conforming to the // "http.response.body.size" semantic conventions. It represents the size of the // response payload body in bytes. This is the number of bytes transferred // excluding headers and is often, but not always, present as the // [Content-Length] header. For requests using transport encoding, this should // be the compressed size. // // Type: int // RequirementLevel: Recommended // Stability: Development // // [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length HTTPResponseBodySizeKey = attribute.Key("http.response.body.size") // HTTPResponseSizeKey is the attribute Key conforming to the // "http.response.size" semantic conventions. It represents the total size of // the response in bytes. This should be the total number of bytes sent over the // wire, including the status line (HTTP/1.1), framing (HTTP/2 and HTTP/3), // headers, and response body and trailers if any. // // Type: int // RequirementLevel: Recommended // Stability: Development HTTPResponseSizeKey = attribute.Key("http.response.size") // HTTPResponseStatusCodeKey is the attribute Key conforming to the // "http.response.status_code" semantic conventions. It represents the // [HTTP response status code]. // // Type: int // RequirementLevel: Recommended // Stability: Stable // // Examples: 200 // // [HTTP response status code]: https://tools.ietf.org/html/rfc7231#section-6 HTTPResponseStatusCodeKey = attribute.Key("http.response.status_code") // HTTPRouteKey is the attribute Key conforming to the "http.route" semantic // conventions. It represents the matched route, that is, the path template in // the format used by the respective server framework. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "/users/:userID?", "{controller}/{action}/{id?}" // Note: MUST NOT be populated when this is not supported by the HTTP server // framework as the route attribute should have low-cardinality and the URI path // can NOT substitute it. // SHOULD include the [application root] if there is one. // // [application root]: /docs/http/http-spans.md#http-server-definitions HTTPRouteKey = attribute.Key("http.route") ) // HTTPRequestBodySize returns an attribute KeyValue conforming to the // "http.request.body.size" semantic conventions. It represents the size of the // request payload body in bytes. This is the number of bytes transferred // excluding headers and is often, but not always, present as the // [Content-Length] header. For requests using transport encoding, this should be // the compressed size. // // [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length func HTTPRequestBodySize(val int) attribute.KeyValue { return HTTPRequestBodySizeKey.Int(val) } // HTTPRequestHeader returns an attribute KeyValue conforming to the // "http.request.header" semantic conventions. It represents the HTTP request // headers, `` being the normalized HTTP Header name (lowercase), the value // being the header values. func HTTPRequestHeader(key string, val ...string) attribute.KeyValue { return attribute.StringSlice("http.request.header."+key, val) } // HTTPRequestMethodOriginal returns an attribute KeyValue conforming to the // "http.request.method_original" semantic conventions. It represents the // original HTTP method sent by the client in the request line. func HTTPRequestMethodOriginal(val string) attribute.KeyValue { return HTTPRequestMethodOriginalKey.String(val) } // HTTPRequestResendCount returns an attribute KeyValue conforming to the // "http.request.resend_count" semantic conventions. It represents the ordinal // number of request resending attempt (for any reason, including redirects). func HTTPRequestResendCount(val int) attribute.KeyValue { return HTTPRequestResendCountKey.Int(val) } // HTTPRequestSize returns an attribute KeyValue conforming to the // "http.request.size" semantic conventions. It represents the total size of the // request in bytes. This should be the total number of bytes sent over the wire, // including the request line (HTTP/1.1), framing (HTTP/2 and HTTP/3), headers, // and request body if any. func HTTPRequestSize(val int) attribute.KeyValue { return HTTPRequestSizeKey.Int(val) } // HTTPResponseBodySize returns an attribute KeyValue conforming to the // "http.response.body.size" semantic conventions. It represents the size of the // response payload body in bytes. This is the number of bytes transferred // excluding headers and is often, but not always, present as the // [Content-Length] header. For requests using transport encoding, this should be // the compressed size. // // [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length func HTTPResponseBodySize(val int) attribute.KeyValue { return HTTPResponseBodySizeKey.Int(val) } // HTTPResponseHeader returns an attribute KeyValue conforming to the // "http.response.header" semantic conventions. It represents the HTTP response // headers, `` being the normalized HTTP Header name (lowercase), the value // being the header values. func HTTPResponseHeader(key string, val ...string) attribute.KeyValue { return attribute.StringSlice("http.response.header."+key, val) } // HTTPResponseSize returns an attribute KeyValue conforming to the // "http.response.size" semantic conventions. It represents the total size of the // response in bytes. This should be the total number of bytes sent over the // wire, including the status line (HTTP/1.1), framing (HTTP/2 and HTTP/3), // headers, and response body and trailers if any. func HTTPResponseSize(val int) attribute.KeyValue { return HTTPResponseSizeKey.Int(val) } // HTTPResponseStatusCode returns an attribute KeyValue conforming to the // "http.response.status_code" semantic conventions. It represents the // [HTTP response status code]. // // [HTTP response status code]: https://tools.ietf.org/html/rfc7231#section-6 func HTTPResponseStatusCode(val int) attribute.KeyValue { return HTTPResponseStatusCodeKey.Int(val) } // HTTPRoute returns an attribute KeyValue conforming to the "http.route" // semantic conventions. It represents the matched route, that is, the path // template in the format used by the respective server framework. func HTTPRoute(val string) attribute.KeyValue { return HTTPRouteKey.String(val) } // Enum values for http.connection.state var ( // active state. // Stability: development HTTPConnectionStateActive = HTTPConnectionStateKey.String("active") // idle state. // Stability: development HTTPConnectionStateIdle = HTTPConnectionStateKey.String("idle") ) // Enum values for http.request.method var ( // CONNECT method. // Stability: stable HTTPRequestMethodConnect = HTTPRequestMethodKey.String("CONNECT") // DELETE method. // Stability: stable HTTPRequestMethodDelete = HTTPRequestMethodKey.String("DELETE") // GET method. // Stability: stable HTTPRequestMethodGet = HTTPRequestMethodKey.String("GET") // HEAD method. // Stability: stable HTTPRequestMethodHead = HTTPRequestMethodKey.String("HEAD") // OPTIONS method. // Stability: stable HTTPRequestMethodOptions = HTTPRequestMethodKey.String("OPTIONS") // PATCH method. // Stability: stable HTTPRequestMethodPatch = HTTPRequestMethodKey.String("PATCH") // POST method. // Stability: stable HTTPRequestMethodPost = HTTPRequestMethodKey.String("POST") // PUT method. // Stability: stable HTTPRequestMethodPut = HTTPRequestMethodKey.String("PUT") // TRACE method. // Stability: stable HTTPRequestMethodTrace = HTTPRequestMethodKey.String("TRACE") // Any HTTP method that the instrumentation has no prior knowledge of. // Stability: stable HTTPRequestMethodOther = HTTPRequestMethodKey.String("_OTHER") ) // Namespace: hw const ( // HwBatteryCapacityKey is the attribute Key conforming to the // "hw.battery.capacity" semantic conventions. It represents the design capacity // in Watts-hours or Amper-hours. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "9.3Ah", "50Wh" HwBatteryCapacityKey = attribute.Key("hw.battery.capacity") // HwBatteryChemistryKey is the attribute Key conforming to the // "hw.battery.chemistry" semantic conventions. It represents the battery // [chemistry], e.g. Lithium-Ion, Nickel-Cadmium, etc. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Li-ion", "NiMH" // // [chemistry]: https://schemas.dmtf.org/wbem/cim-html/2.31.0/CIM_Battery.html HwBatteryChemistryKey = attribute.Key("hw.battery.chemistry") // HwBatteryStateKey is the attribute Key conforming to the "hw.battery.state" // semantic conventions. It represents the current state of the battery. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: HwBatteryStateKey = attribute.Key("hw.battery.state") // HwBiosVersionKey is the attribute Key conforming to the "hw.bios_version" // semantic conventions. It represents the BIOS version of the hardware // component. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "1.2.3" HwBiosVersionKey = attribute.Key("hw.bios_version") // HwDriverVersionKey is the attribute Key conforming to the "hw.driver_version" // semantic conventions. It represents the driver version for the hardware // component. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "10.2.1-3" HwDriverVersionKey = attribute.Key("hw.driver_version") // HwEnclosureTypeKey is the attribute Key conforming to the "hw.enclosure.type" // semantic conventions. It represents the type of the enclosure (useful for // modular systems). // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Computer", "Storage", "Switch" HwEnclosureTypeKey = attribute.Key("hw.enclosure.type") // HwFirmwareVersionKey is the attribute Key conforming to the // "hw.firmware_version" semantic conventions. It represents the firmware // version of the hardware component. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "2.0.1" HwFirmwareVersionKey = attribute.Key("hw.firmware_version") // HwGpuTaskKey is the attribute Key conforming to the "hw.gpu.task" semantic // conventions. It represents the type of task the GPU is performing. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: HwGpuTaskKey = attribute.Key("hw.gpu.task") // HwIDKey is the attribute Key conforming to the "hw.id" semantic conventions. // It represents an identifier for the hardware component, unique within the // monitored host. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "win32battery_battery_testsysa33_1" HwIDKey = attribute.Key("hw.id") // HwLimitTypeKey is the attribute Key conforming to the "hw.limit_type" // semantic conventions. It represents the type of limit for hardware // components. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: HwLimitTypeKey = attribute.Key("hw.limit_type") // HwLogicalDiskRaidLevelKey is the attribute Key conforming to the // "hw.logical_disk.raid_level" semantic conventions. It represents the RAID // Level of the logical disk. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "RAID0+1", "RAID5", "RAID10" HwLogicalDiskRaidLevelKey = attribute.Key("hw.logical_disk.raid_level") // HwLogicalDiskStateKey is the attribute Key conforming to the // "hw.logical_disk.state" semantic conventions. It represents the state of the // logical disk space usage. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: HwLogicalDiskStateKey = attribute.Key("hw.logical_disk.state") // HwMemoryTypeKey is the attribute Key conforming to the "hw.memory.type" // semantic conventions. It represents the type of the memory module. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "DDR4", "DDR5", "LPDDR5" HwMemoryTypeKey = attribute.Key("hw.memory.type") // HwModelKey is the attribute Key conforming to the "hw.model" semantic // conventions. It represents the descriptive model name of the hardware // component. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "PERC H740P", "Intel(R) Core(TM) i7-10700K", "Dell XPS 15 Battery" HwModelKey = attribute.Key("hw.model") // HwNameKey is the attribute Key conforming to the "hw.name" semantic // conventions. It represents an easily-recognizable name for the hardware // component. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "eth0" HwNameKey = attribute.Key("hw.name") // HwNetworkLogicalAddressesKey is the attribute Key conforming to the // "hw.network.logical_addresses" semantic conventions. It represents the // logical addresses of the adapter (e.g. IP address, or WWPN). // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "172.16.8.21", "57.11.193.42" HwNetworkLogicalAddressesKey = attribute.Key("hw.network.logical_addresses") // HwNetworkPhysicalAddressKey is the attribute Key conforming to the // "hw.network.physical_address" semantic conventions. It represents the // physical address of the adapter (e.g. MAC address, or WWNN). // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "00-90-F5-E9-7B-36" HwNetworkPhysicalAddressKey = attribute.Key("hw.network.physical_address") // HwParentKey is the attribute Key conforming to the "hw.parent" semantic // conventions. It represents the unique identifier of the parent component // (typically the `hw.id` attribute of the enclosure, or disk controller). // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "dellStorage_perc_0" HwParentKey = attribute.Key("hw.parent") // HwPhysicalDiskSmartAttributeKey is the attribute Key conforming to the // "hw.physical_disk.smart_attribute" semantic conventions. It represents the // [S.M.A.R.T.] (Self-Monitoring, Analysis, and Reporting Technology) attribute // of the physical disk. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Spin Retry Count", "Seek Error Rate", "Raw Read Error Rate" // // [S.M.A.R.T.]: https://wikipedia.org/wiki/S.M.A.R.T. HwPhysicalDiskSmartAttributeKey = attribute.Key("hw.physical_disk.smart_attribute") // HwPhysicalDiskStateKey is the attribute Key conforming to the // "hw.physical_disk.state" semantic conventions. It represents the state of the // physical disk endurance utilization. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: HwPhysicalDiskStateKey = attribute.Key("hw.physical_disk.state") // HwPhysicalDiskTypeKey is the attribute Key conforming to the // "hw.physical_disk.type" semantic conventions. It represents the type of the // physical disk. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "HDD", "SSD", "10K" HwPhysicalDiskTypeKey = attribute.Key("hw.physical_disk.type") // HwSensorLocationKey is the attribute Key conforming to the // "hw.sensor_location" semantic conventions. It represents the location of the // sensor. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "cpu0", "ps1", "INLET", "CPU0_DIE", "AMBIENT", "MOTHERBOARD", "PS0 // V3_3", "MAIN_12V", "CPU_VCORE" HwSensorLocationKey = attribute.Key("hw.sensor_location") // HwSerialNumberKey is the attribute Key conforming to the "hw.serial_number" // semantic conventions. It represents the serial number of the hardware // component. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "CNFCP0123456789" HwSerialNumberKey = attribute.Key("hw.serial_number") // HwStateKey is the attribute Key conforming to the "hw.state" semantic // conventions. It represents the current state of the component. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: HwStateKey = attribute.Key("hw.state") // HwTapeDriveOperationTypeKey is the attribute Key conforming to the // "hw.tape_drive.operation_type" semantic conventions. It represents the type // of tape drive operation. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: HwTapeDriveOperationTypeKey = attribute.Key("hw.tape_drive.operation_type") // HwTypeKey is the attribute Key conforming to the "hw.type" semantic // conventions. It represents the type of the component. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // Note: Describes the category of the hardware component for which `hw.state` // is being reported. For example, `hw.type=temperature` along with // `hw.state=degraded` would indicate that the temperature of the hardware // component has been reported as `degraded`. HwTypeKey = attribute.Key("hw.type") // HwVendorKey is the attribute Key conforming to the "hw.vendor" semantic // conventions. It represents the vendor name of the hardware component. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Dell", "HP", "Intel", "AMD", "LSI", "Lenovo" HwVendorKey = attribute.Key("hw.vendor") ) // HwBatteryCapacity returns an attribute KeyValue conforming to the // "hw.battery.capacity" semantic conventions. It represents the design capacity // in Watts-hours or Amper-hours. func HwBatteryCapacity(val string) attribute.KeyValue { return HwBatteryCapacityKey.String(val) } // HwBatteryChemistry returns an attribute KeyValue conforming to the // "hw.battery.chemistry" semantic conventions. It represents the battery // [chemistry], e.g. Lithium-Ion, Nickel-Cadmium, etc. // // [chemistry]: https://schemas.dmtf.org/wbem/cim-html/2.31.0/CIM_Battery.html func HwBatteryChemistry(val string) attribute.KeyValue { return HwBatteryChemistryKey.String(val) } // HwBiosVersion returns an attribute KeyValue conforming to the // "hw.bios_version" semantic conventions. It represents the BIOS version of the // hardware component. func HwBiosVersion(val string) attribute.KeyValue { return HwBiosVersionKey.String(val) } // HwDriverVersion returns an attribute KeyValue conforming to the // "hw.driver_version" semantic conventions. It represents the driver version for // the hardware component. func HwDriverVersion(val string) attribute.KeyValue { return HwDriverVersionKey.String(val) } // HwEnclosureType returns an attribute KeyValue conforming to the // "hw.enclosure.type" semantic conventions. It represents the type of the // enclosure (useful for modular systems). func HwEnclosureType(val string) attribute.KeyValue { return HwEnclosureTypeKey.String(val) } // HwFirmwareVersion returns an attribute KeyValue conforming to the // "hw.firmware_version" semantic conventions. It represents the firmware version // of the hardware component. func HwFirmwareVersion(val string) attribute.KeyValue { return HwFirmwareVersionKey.String(val) } // HwID returns an attribute KeyValue conforming to the "hw.id" semantic // conventions. It represents an identifier for the hardware component, unique // within the monitored host. func HwID(val string) attribute.KeyValue { return HwIDKey.String(val) } // HwLogicalDiskRaidLevel returns an attribute KeyValue conforming to the // "hw.logical_disk.raid_level" semantic conventions. It represents the RAID // Level of the logical disk. func HwLogicalDiskRaidLevel(val string) attribute.KeyValue { return HwLogicalDiskRaidLevelKey.String(val) } // HwMemoryType returns an attribute KeyValue conforming to the "hw.memory.type" // semantic conventions. It represents the type of the memory module. func HwMemoryType(val string) attribute.KeyValue { return HwMemoryTypeKey.String(val) } // HwModel returns an attribute KeyValue conforming to the "hw.model" semantic // conventions. It represents the descriptive model name of the hardware // component. func HwModel(val string) attribute.KeyValue { return HwModelKey.String(val) } // HwName returns an attribute KeyValue conforming to the "hw.name" semantic // conventions. It represents an easily-recognizable name for the hardware // component. func HwName(val string) attribute.KeyValue { return HwNameKey.String(val) } // HwNetworkLogicalAddresses returns an attribute KeyValue conforming to the // "hw.network.logical_addresses" semantic conventions. It represents the logical // addresses of the adapter (e.g. IP address, or WWPN). func HwNetworkLogicalAddresses(val ...string) attribute.KeyValue { return HwNetworkLogicalAddressesKey.StringSlice(val) } // HwNetworkPhysicalAddress returns an attribute KeyValue conforming to the // "hw.network.physical_address" semantic conventions. It represents the physical // address of the adapter (e.g. MAC address, or WWNN). func HwNetworkPhysicalAddress(val string) attribute.KeyValue { return HwNetworkPhysicalAddressKey.String(val) } // HwParent returns an attribute KeyValue conforming to the "hw.parent" semantic // conventions. It represents the unique identifier of the parent component // (typically the `hw.id` attribute of the enclosure, or disk controller). func HwParent(val string) attribute.KeyValue { return HwParentKey.String(val) } // HwPhysicalDiskSmartAttribute returns an attribute KeyValue conforming to the // "hw.physical_disk.smart_attribute" semantic conventions. It represents the // [S.M.A.R.T.] (Self-Monitoring, Analysis, and Reporting Technology) attribute // of the physical disk. // // [S.M.A.R.T.]: https://wikipedia.org/wiki/S.M.A.R.T. func HwPhysicalDiskSmartAttribute(val string) attribute.KeyValue { return HwPhysicalDiskSmartAttributeKey.String(val) } // HwPhysicalDiskType returns an attribute KeyValue conforming to the // "hw.physical_disk.type" semantic conventions. It represents the type of the // physical disk. func HwPhysicalDiskType(val string) attribute.KeyValue { return HwPhysicalDiskTypeKey.String(val) } // HwSensorLocation returns an attribute KeyValue conforming to the // "hw.sensor_location" semantic conventions. It represents the location of the // sensor. func HwSensorLocation(val string) attribute.KeyValue { return HwSensorLocationKey.String(val) } // HwSerialNumber returns an attribute KeyValue conforming to the // "hw.serial_number" semantic conventions. It represents the serial number of // the hardware component. func HwSerialNumber(val string) attribute.KeyValue { return HwSerialNumberKey.String(val) } // HwVendor returns an attribute KeyValue conforming to the "hw.vendor" semantic // conventions. It represents the vendor name of the hardware component. func HwVendor(val string) attribute.KeyValue { return HwVendorKey.String(val) } // Enum values for hw.battery.state var ( // Charging // Stability: development HwBatteryStateCharging = HwBatteryStateKey.String("charging") // Discharging // Stability: development HwBatteryStateDischarging = HwBatteryStateKey.String("discharging") ) // Enum values for hw.gpu.task var ( // Decoder // Stability: development HwGpuTaskDecoder = HwGpuTaskKey.String("decoder") // Encoder // Stability: development HwGpuTaskEncoder = HwGpuTaskKey.String("encoder") // General // Stability: development HwGpuTaskGeneral = HwGpuTaskKey.String("general") ) // Enum values for hw.limit_type var ( // Critical // Stability: development HwLimitTypeCritical = HwLimitTypeKey.String("critical") // Degraded // Stability: development HwLimitTypeDegraded = HwLimitTypeKey.String("degraded") // High Critical // Stability: development HwLimitTypeHighCritical = HwLimitTypeKey.String("high.critical") // High Degraded // Stability: development HwLimitTypeHighDegraded = HwLimitTypeKey.String("high.degraded") // Low Critical // Stability: development HwLimitTypeLowCritical = HwLimitTypeKey.String("low.critical") // Low Degraded // Stability: development HwLimitTypeLowDegraded = HwLimitTypeKey.String("low.degraded") // Maximum // Stability: development HwLimitTypeMax = HwLimitTypeKey.String("max") // Throttled // Stability: development HwLimitTypeThrottled = HwLimitTypeKey.String("throttled") // Turbo // Stability: development HwLimitTypeTurbo = HwLimitTypeKey.String("turbo") ) // Enum values for hw.logical_disk.state var ( // Used // Stability: development HwLogicalDiskStateUsed = HwLogicalDiskStateKey.String("used") // Free // Stability: development HwLogicalDiskStateFree = HwLogicalDiskStateKey.String("free") ) // Enum values for hw.physical_disk.state var ( // Remaining // Stability: development HwPhysicalDiskStateRemaining = HwPhysicalDiskStateKey.String("remaining") ) // Enum values for hw.state var ( // Degraded // Stability: development HwStateDegraded = HwStateKey.String("degraded") // Failed // Stability: development HwStateFailed = HwStateKey.String("failed") // Needs Cleaning // Stability: development HwStateNeedsCleaning = HwStateKey.String("needs_cleaning") // OK // Stability: development HwStateOk = HwStateKey.String("ok") // Predicted Failure // Stability: development HwStatePredictedFailure = HwStateKey.String("predicted_failure") ) // Enum values for hw.tape_drive.operation_type var ( // Mount // Stability: development HwTapeDriveOperationTypeMount = HwTapeDriveOperationTypeKey.String("mount") // Unmount // Stability: development HwTapeDriveOperationTypeUnmount = HwTapeDriveOperationTypeKey.String("unmount") // Clean // Stability: development HwTapeDriveOperationTypeClean = HwTapeDriveOperationTypeKey.String("clean") ) // Enum values for hw.type var ( // Battery // Stability: development HwTypeBattery = HwTypeKey.String("battery") // CPU // Stability: development HwTypeCPU = HwTypeKey.String("cpu") // Disk controller // Stability: development HwTypeDiskController = HwTypeKey.String("disk_controller") // Enclosure // Stability: development HwTypeEnclosure = HwTypeKey.String("enclosure") // Fan // Stability: development HwTypeFan = HwTypeKey.String("fan") // GPU // Stability: development HwTypeGpu = HwTypeKey.String("gpu") // Logical disk // Stability: development HwTypeLogicalDisk = HwTypeKey.String("logical_disk") // Memory // Stability: development HwTypeMemory = HwTypeKey.String("memory") // Network // Stability: development HwTypeNetwork = HwTypeKey.String("network") // Physical disk // Stability: development HwTypePhysicalDisk = HwTypeKey.String("physical_disk") // Power supply // Stability: development HwTypePowerSupply = HwTypeKey.String("power_supply") // Tape drive // Stability: development HwTypeTapeDrive = HwTypeKey.String("tape_drive") // Temperature // Stability: development HwTypeTemperature = HwTypeKey.String("temperature") // Voltage // Stability: development HwTypeVoltage = HwTypeKey.String("voltage") ) // Namespace: ios const ( // IOSAppStateKey is the attribute Key conforming to the "ios.app.state" // semantic conventions. It represents the this attribute represents the state // of the application. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // Note: The iOS lifecycle states are defined in the // [UIApplicationDelegate documentation], and from which the `OS terminology` // column values are derived. // // [UIApplicationDelegate documentation]: https://developer.apple.com/documentation/uikit/uiapplicationdelegate IOSAppStateKey = attribute.Key("ios.app.state") ) // Enum values for ios.app.state var ( // The app has become `active`. Associated with UIKit notification // `applicationDidBecomeActive`. // // Stability: development IOSAppStateActive = IOSAppStateKey.String("active") // The app is now `inactive`. Associated with UIKit notification // `applicationWillResignActive`. // // Stability: development IOSAppStateInactive = IOSAppStateKey.String("inactive") // The app is now in the background. This value is associated with UIKit // notification `applicationDidEnterBackground`. // // Stability: development IOSAppStateBackground = IOSAppStateKey.String("background") // The app is now in the foreground. This value is associated with UIKit // notification `applicationWillEnterForeground`. // // Stability: development IOSAppStateForeground = IOSAppStateKey.String("foreground") // The app is about to terminate. Associated with UIKit notification // `applicationWillTerminate`. // // Stability: development IOSAppStateTerminate = IOSAppStateKey.String("terminate") ) // Namespace: k8s const ( // K8SClusterNameKey is the attribute Key conforming to the "k8s.cluster.name" // semantic conventions. It represents the name of the cluster. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "opentelemetry-cluster" K8SClusterNameKey = attribute.Key("k8s.cluster.name") // K8SClusterUIDKey is the attribute Key conforming to the "k8s.cluster.uid" // semantic conventions. It represents a pseudo-ID for the cluster, set to the // UID of the `kube-system` namespace. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "218fc5a9-a5f1-4b54-aa05-46717d0ab26d" // Note: K8s doesn't have support for obtaining a cluster ID. If this is ever // added, we will recommend collecting the `k8s.cluster.uid` through the // official APIs. In the meantime, we are able to use the `uid` of the // `kube-system` namespace as a proxy for cluster ID. Read on for the // rationale. // // Every object created in a K8s cluster is assigned a distinct UID. The // `kube-system` namespace is used by Kubernetes itself and will exist // for the lifetime of the cluster. Using the `uid` of the `kube-system` // namespace is a reasonable proxy for the K8s ClusterID as it will only // change if the cluster is rebuilt. Furthermore, Kubernetes UIDs are // UUIDs as standardized by // [ISO/IEC 9834-8 and ITU-T X.667]. // Which states: // // > If generated according to one of the mechanisms defined in Rec. // > ITU-T X.667 | ISO/IEC 9834-8, a UUID is either guaranteed to be // > different from all other UUIDs generated before 3603 A.D., or is // > extremely likely to be different (depending on the mechanism chosen). // // Therefore, UIDs between clusters should be extremely unlikely to // conflict. // // [ISO/IEC 9834-8 and ITU-T X.667]: https://www.itu.int/ITU-T/studygroups/com17/oid.html K8SClusterUIDKey = attribute.Key("k8s.cluster.uid") // K8SContainerNameKey is the attribute Key conforming to the // "k8s.container.name" semantic conventions. It represents the name of the // Container from Pod specification, must be unique within a Pod. Container // runtime usually uses different globally unique name (`container.name`). // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "redis" K8SContainerNameKey = attribute.Key("k8s.container.name") // K8SContainerRestartCountKey is the attribute Key conforming to the // "k8s.container.restart_count" semantic conventions. It represents the number // of times the container was restarted. This attribute can be used to identify // a particular container (running or stopped) within a container spec. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: K8SContainerRestartCountKey = attribute.Key("k8s.container.restart_count") // K8SContainerStatusLastTerminatedReasonKey is the attribute Key conforming to // the "k8s.container.status.last_terminated_reason" semantic conventions. It // represents the last terminated reason of the Container. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Evicted", "Error" K8SContainerStatusLastTerminatedReasonKey = attribute.Key("k8s.container.status.last_terminated_reason") // K8SContainerStatusReasonKey is the attribute Key conforming to the // "k8s.container.status.reason" semantic conventions. It represents the reason // for the container state. Corresponds to the `reason` field of the: // [K8s ContainerStateWaiting] or [K8s ContainerStateTerminated]. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "ContainerCreating", "CrashLoopBackOff", // "CreateContainerConfigError", "ErrImagePull", "ImagePullBackOff", // "OOMKilled", "Completed", "Error", "ContainerCannotRun" // // [K8s ContainerStateWaiting]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#containerstatewaiting-v1-core // [K8s ContainerStateTerminated]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#containerstateterminated-v1-core K8SContainerStatusReasonKey = attribute.Key("k8s.container.status.reason") // K8SContainerStatusStateKey is the attribute Key conforming to the // "k8s.container.status.state" semantic conventions. It represents the state of // the container. [K8s ContainerState]. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "terminated", "running", "waiting" // // [K8s ContainerState]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#containerstate-v1-core K8SContainerStatusStateKey = attribute.Key("k8s.container.status.state") // K8SCronJobNameKey is the attribute Key conforming to the "k8s.cronjob.name" // semantic conventions. It represents the name of the CronJob. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "opentelemetry" K8SCronJobNameKey = attribute.Key("k8s.cronjob.name") // K8SCronJobUIDKey is the attribute Key conforming to the "k8s.cronjob.uid" // semantic conventions. It represents the UID of the CronJob. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff" K8SCronJobUIDKey = attribute.Key("k8s.cronjob.uid") // K8SDaemonSetNameKey is the attribute Key conforming to the // "k8s.daemonset.name" semantic conventions. It represents the name of the // DaemonSet. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "opentelemetry" K8SDaemonSetNameKey = attribute.Key("k8s.daemonset.name") // K8SDaemonSetUIDKey is the attribute Key conforming to the "k8s.daemonset.uid" // semantic conventions. It represents the UID of the DaemonSet. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff" K8SDaemonSetUIDKey = attribute.Key("k8s.daemonset.uid") // K8SDeploymentNameKey is the attribute Key conforming to the // "k8s.deployment.name" semantic conventions. It represents the name of the // Deployment. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "opentelemetry" K8SDeploymentNameKey = attribute.Key("k8s.deployment.name") // K8SDeploymentUIDKey is the attribute Key conforming to the // "k8s.deployment.uid" semantic conventions. It represents the UID of the // Deployment. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff" K8SDeploymentUIDKey = attribute.Key("k8s.deployment.uid") // K8SHPAMetricTypeKey is the attribute Key conforming to the // "k8s.hpa.metric.type" semantic conventions. It represents the type of metric // source for the horizontal pod autoscaler. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Resource", "ContainerResource" // Note: This attribute reflects the `type` field of spec.metrics[] in the HPA. K8SHPAMetricTypeKey = attribute.Key("k8s.hpa.metric.type") // K8SHPANameKey is the attribute Key conforming to the "k8s.hpa.name" semantic // conventions. It represents the name of the horizontal pod autoscaler. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "opentelemetry" K8SHPANameKey = attribute.Key("k8s.hpa.name") // K8SHPAScaletargetrefAPIVersionKey is the attribute Key conforming to the // "k8s.hpa.scaletargetref.api_version" semantic conventions. It represents the // API version of the target resource to scale for the HorizontalPodAutoscaler. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "apps/v1", "autoscaling/v2" // Note: This maps to the `apiVersion` field in the `scaleTargetRef` of the HPA // spec. K8SHPAScaletargetrefAPIVersionKey = attribute.Key("k8s.hpa.scaletargetref.api_version") // K8SHPAScaletargetrefKindKey is the attribute Key conforming to the // "k8s.hpa.scaletargetref.kind" semantic conventions. It represents the kind of // the target resource to scale for the HorizontalPodAutoscaler. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Deployment", "StatefulSet" // Note: This maps to the `kind` field in the `scaleTargetRef` of the HPA spec. K8SHPAScaletargetrefKindKey = attribute.Key("k8s.hpa.scaletargetref.kind") // K8SHPAScaletargetrefNameKey is the attribute Key conforming to the // "k8s.hpa.scaletargetref.name" semantic conventions. It represents the name of // the target resource to scale for the HorizontalPodAutoscaler. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "my-deployment", "my-statefulset" // Note: This maps to the `name` field in the `scaleTargetRef` of the HPA spec. K8SHPAScaletargetrefNameKey = attribute.Key("k8s.hpa.scaletargetref.name") // K8SHPAUIDKey is the attribute Key conforming to the "k8s.hpa.uid" semantic // conventions. It represents the UID of the horizontal pod autoscaler. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff" K8SHPAUIDKey = attribute.Key("k8s.hpa.uid") // K8SHugepageSizeKey is the attribute Key conforming to the "k8s.hugepage.size" // semantic conventions. It represents the size (identifier) of the K8s huge // page. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "2Mi" K8SHugepageSizeKey = attribute.Key("k8s.hugepage.size") // K8SJobNameKey is the attribute Key conforming to the "k8s.job.name" semantic // conventions. It represents the name of the Job. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "opentelemetry" K8SJobNameKey = attribute.Key("k8s.job.name") // K8SJobUIDKey is the attribute Key conforming to the "k8s.job.uid" semantic // conventions. It represents the UID of the Job. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff" K8SJobUIDKey = attribute.Key("k8s.job.uid") // K8SNamespaceNameKey is the attribute Key conforming to the // "k8s.namespace.name" semantic conventions. It represents the name of the // namespace that the pod is running in. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "default" K8SNamespaceNameKey = attribute.Key("k8s.namespace.name") // K8SNamespacePhaseKey is the attribute Key conforming to the // "k8s.namespace.phase" semantic conventions. It represents the phase of the // K8s namespace. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "active", "terminating" // Note: This attribute aligns with the `phase` field of the // [K8s NamespaceStatus] // // [K8s NamespaceStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#namespacestatus-v1-core K8SNamespacePhaseKey = attribute.Key("k8s.namespace.phase") // K8SNodeConditionStatusKey is the attribute Key conforming to the // "k8s.node.condition.status" semantic conventions. It represents the status of // the condition, one of True, False, Unknown. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "true", "false", "unknown" // Note: This attribute aligns with the `status` field of the // [NodeCondition] // // [NodeCondition]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#nodecondition-v1-core K8SNodeConditionStatusKey = attribute.Key("k8s.node.condition.status") // K8SNodeConditionTypeKey is the attribute Key conforming to the // "k8s.node.condition.type" semantic conventions. It represents the condition // type of a K8s Node. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "Ready", "DiskPressure" // Note: K8s Node conditions as described // by [K8s documentation]. // // This attribute aligns with the `type` field of the // [NodeCondition] // // The set of possible values is not limited to those listed here. Managed // Kubernetes environments, // or custom controllers MAY introduce additional node condition types. // When this occurs, the exact value as reported by the Kubernetes API SHOULD be // used. // // [K8s documentation]: https://v1-32.docs.kubernetes.io/docs/reference/node/node-status/#condition // [NodeCondition]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#nodecondition-v1-core K8SNodeConditionTypeKey = attribute.Key("k8s.node.condition.type") // K8SNodeNameKey is the attribute Key conforming to the "k8s.node.name" // semantic conventions. It represents the name of the Node. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "node-1" K8SNodeNameKey = attribute.Key("k8s.node.name") // K8SNodeUIDKey is the attribute Key conforming to the "k8s.node.uid" semantic // conventions. It represents the UID of the Node. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "1eb3a0c6-0477-4080-a9cb-0cb7db65c6a2" K8SNodeUIDKey = attribute.Key("k8s.node.uid") // K8SPodNameKey is the attribute Key conforming to the "k8s.pod.name" semantic // conventions. It represents the name of the Pod. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "opentelemetry-pod-autoconf" K8SPodNameKey = attribute.Key("k8s.pod.name") // K8SPodUIDKey is the attribute Key conforming to the "k8s.pod.uid" semantic // conventions. It represents the UID of the Pod. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff" K8SPodUIDKey = attribute.Key("k8s.pod.uid") // K8SReplicaSetNameKey is the attribute Key conforming to the // "k8s.replicaset.name" semantic conventions. It represents the name of the // ReplicaSet. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "opentelemetry" K8SReplicaSetNameKey = attribute.Key("k8s.replicaset.name") // K8SReplicaSetUIDKey is the attribute Key conforming to the // "k8s.replicaset.uid" semantic conventions. It represents the UID of the // ReplicaSet. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff" K8SReplicaSetUIDKey = attribute.Key("k8s.replicaset.uid") // K8SReplicationControllerNameKey is the attribute Key conforming to the // "k8s.replicationcontroller.name" semantic conventions. It represents the name // of the replication controller. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "opentelemetry" K8SReplicationControllerNameKey = attribute.Key("k8s.replicationcontroller.name") // K8SReplicationControllerUIDKey is the attribute Key conforming to the // "k8s.replicationcontroller.uid" semantic conventions. It represents the UID // of the replication controller. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff" K8SReplicationControllerUIDKey = attribute.Key("k8s.replicationcontroller.uid") // K8SResourceQuotaNameKey is the attribute Key conforming to the // "k8s.resourcequota.name" semantic conventions. It represents the name of the // resource quota. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "opentelemetry" K8SResourceQuotaNameKey = attribute.Key("k8s.resourcequota.name") // K8SResourceQuotaResourceNameKey is the attribute Key conforming to the // "k8s.resourcequota.resource_name" semantic conventions. It represents the // name of the K8s resource a resource quota defines. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "count/replicationcontrollers" // Note: The value for this attribute can be either the full // `count/[.]` string (e.g., count/deployments.apps, // count/pods), or, for certain core Kubernetes resources, just the resource // name (e.g., pods, services, configmaps). Both forms are supported by // Kubernetes for object count quotas. See // [Kubernetes Resource Quotas documentation] for more details. // // [Kubernetes Resource Quotas documentation]: https://kubernetes.io/docs/concepts/policy/resource-quotas/#object-count-quota K8SResourceQuotaResourceNameKey = attribute.Key("k8s.resourcequota.resource_name") // K8SResourceQuotaUIDKey is the attribute Key conforming to the // "k8s.resourcequota.uid" semantic conventions. It represents the UID of the // resource quota. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff" K8SResourceQuotaUIDKey = attribute.Key("k8s.resourcequota.uid") // K8SStatefulSetNameKey is the attribute Key conforming to the // "k8s.statefulset.name" semantic conventions. It represents the name of the // StatefulSet. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "opentelemetry" K8SStatefulSetNameKey = attribute.Key("k8s.statefulset.name") // K8SStatefulSetUIDKey is the attribute Key conforming to the // "k8s.statefulset.uid" semantic conventions. It represents the UID of the // StatefulSet. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff" K8SStatefulSetUIDKey = attribute.Key("k8s.statefulset.uid") // K8SStorageclassNameKey is the attribute Key conforming to the // "k8s.storageclass.name" semantic conventions. It represents the name of K8s // [StorageClass] object. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "gold.storageclass.storage.k8s.io" // // [StorageClass]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#storageclass-v1-storage-k8s-io K8SStorageclassNameKey = attribute.Key("k8s.storageclass.name") // K8SVolumeNameKey is the attribute Key conforming to the "k8s.volume.name" // semantic conventions. It represents the name of the K8s volume. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "volume0" K8SVolumeNameKey = attribute.Key("k8s.volume.name") // K8SVolumeTypeKey is the attribute Key conforming to the "k8s.volume.type" // semantic conventions. It represents the type of the K8s volume. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "emptyDir", "persistentVolumeClaim" K8SVolumeTypeKey = attribute.Key("k8s.volume.type") ) // K8SClusterName returns an attribute KeyValue conforming to the // "k8s.cluster.name" semantic conventions. It represents the name of the // cluster. func K8SClusterName(val string) attribute.KeyValue { return K8SClusterNameKey.String(val) } // K8SClusterUID returns an attribute KeyValue conforming to the // "k8s.cluster.uid" semantic conventions. It represents a pseudo-ID for the // cluster, set to the UID of the `kube-system` namespace. func K8SClusterUID(val string) attribute.KeyValue { return K8SClusterUIDKey.String(val) } // K8SContainerName returns an attribute KeyValue conforming to the // "k8s.container.name" semantic conventions. It represents the name of the // Container from Pod specification, must be unique within a Pod. Container // runtime usually uses different globally unique name (`container.name`). func K8SContainerName(val string) attribute.KeyValue { return K8SContainerNameKey.String(val) } // K8SContainerRestartCount returns an attribute KeyValue conforming to the // "k8s.container.restart_count" semantic conventions. It represents the number // of times the container was restarted. This attribute can be used to identify a // particular container (running or stopped) within a container spec. func K8SContainerRestartCount(val int) attribute.KeyValue { return K8SContainerRestartCountKey.Int(val) } // K8SContainerStatusLastTerminatedReason returns an attribute KeyValue // conforming to the "k8s.container.status.last_terminated_reason" semantic // conventions. It represents the last terminated reason of the Container. func K8SContainerStatusLastTerminatedReason(val string) attribute.KeyValue { return K8SContainerStatusLastTerminatedReasonKey.String(val) } // K8SCronJobAnnotation returns an attribute KeyValue conforming to the // "k8s.cronjob.annotation" semantic conventions. It represents the cronjob // annotation placed on the CronJob, the `` being the annotation name, the // value being the annotation value. func K8SCronJobAnnotation(key string, val string) attribute.KeyValue { return attribute.String("k8s.cronjob.annotation."+key, val) } // K8SCronJobLabel returns an attribute KeyValue conforming to the // "k8s.cronjob.label" semantic conventions. It represents the label placed on // the CronJob, the `` being the label name, the value being the label // value. func K8SCronJobLabel(key string, val string) attribute.KeyValue { return attribute.String("k8s.cronjob.label."+key, val) } // K8SCronJobName returns an attribute KeyValue conforming to the // "k8s.cronjob.name" semantic conventions. It represents the name of the // CronJob. func K8SCronJobName(val string) attribute.KeyValue { return K8SCronJobNameKey.String(val) } // K8SCronJobUID returns an attribute KeyValue conforming to the // "k8s.cronjob.uid" semantic conventions. It represents the UID of the CronJob. func K8SCronJobUID(val string) attribute.KeyValue { return K8SCronJobUIDKey.String(val) } // K8SDaemonSetAnnotation returns an attribute KeyValue conforming to the // "k8s.daemonset.annotation" semantic conventions. It represents the annotation // placed on the DaemonSet, the `` being the annotation name, the value // being the annotation value, even if the value is empty. func K8SDaemonSetAnnotation(key string, val string) attribute.KeyValue { return attribute.String("k8s.daemonset.annotation."+key, val) } // K8SDaemonSetLabel returns an attribute KeyValue conforming to the // "k8s.daemonset.label" semantic conventions. It represents the label placed on // the DaemonSet, the `` being the label name, the value being the label // value, even if the value is empty. func K8SDaemonSetLabel(key string, val string) attribute.KeyValue { return attribute.String("k8s.daemonset.label."+key, val) } // K8SDaemonSetName returns an attribute KeyValue conforming to the // "k8s.daemonset.name" semantic conventions. It represents the name of the // DaemonSet. func K8SDaemonSetName(val string) attribute.KeyValue { return K8SDaemonSetNameKey.String(val) } // K8SDaemonSetUID returns an attribute KeyValue conforming to the // "k8s.daemonset.uid" semantic conventions. It represents the UID of the // DaemonSet. func K8SDaemonSetUID(val string) attribute.KeyValue { return K8SDaemonSetUIDKey.String(val) } // K8SDeploymentAnnotation returns an attribute KeyValue conforming to the // "k8s.deployment.annotation" semantic conventions. It represents the annotation // placed on the Deployment, the `` being the annotation name, the value // being the annotation value, even if the value is empty. func K8SDeploymentAnnotation(key string, val string) attribute.KeyValue { return attribute.String("k8s.deployment.annotation."+key, val) } // K8SDeploymentLabel returns an attribute KeyValue conforming to the // "k8s.deployment.label" semantic conventions. It represents the label placed on // the Deployment, the `` being the label name, the value being the label // value, even if the value is empty. func K8SDeploymentLabel(key string, val string) attribute.KeyValue { return attribute.String("k8s.deployment.label."+key, val) } // K8SDeploymentName returns an attribute KeyValue conforming to the // "k8s.deployment.name" semantic conventions. It represents the name of the // Deployment. func K8SDeploymentName(val string) attribute.KeyValue { return K8SDeploymentNameKey.String(val) } // K8SDeploymentUID returns an attribute KeyValue conforming to the // "k8s.deployment.uid" semantic conventions. It represents the UID of the // Deployment. func K8SDeploymentUID(val string) attribute.KeyValue { return K8SDeploymentUIDKey.String(val) } // K8SHPAMetricType returns an attribute KeyValue conforming to the // "k8s.hpa.metric.type" semantic conventions. It represents the type of metric // source for the horizontal pod autoscaler. func K8SHPAMetricType(val string) attribute.KeyValue { return K8SHPAMetricTypeKey.String(val) } // K8SHPAName returns an attribute KeyValue conforming to the "k8s.hpa.name" // semantic conventions. It represents the name of the horizontal pod autoscaler. func K8SHPAName(val string) attribute.KeyValue { return K8SHPANameKey.String(val) } // K8SHPAScaletargetrefAPIVersion returns an attribute KeyValue conforming to the // "k8s.hpa.scaletargetref.api_version" semantic conventions. It represents the // API version of the target resource to scale for the HorizontalPodAutoscaler. func K8SHPAScaletargetrefAPIVersion(val string) attribute.KeyValue { return K8SHPAScaletargetrefAPIVersionKey.String(val) } // K8SHPAScaletargetrefKind returns an attribute KeyValue conforming to the // "k8s.hpa.scaletargetref.kind" semantic conventions. It represents the kind of // the target resource to scale for the HorizontalPodAutoscaler. func K8SHPAScaletargetrefKind(val string) attribute.KeyValue { return K8SHPAScaletargetrefKindKey.String(val) } // K8SHPAScaletargetrefName returns an attribute KeyValue conforming to the // "k8s.hpa.scaletargetref.name" semantic conventions. It represents the name of // the target resource to scale for the HorizontalPodAutoscaler. func K8SHPAScaletargetrefName(val string) attribute.KeyValue { return K8SHPAScaletargetrefNameKey.String(val) } // K8SHPAUID returns an attribute KeyValue conforming to the "k8s.hpa.uid" // semantic conventions. It represents the UID of the horizontal pod autoscaler. func K8SHPAUID(val string) attribute.KeyValue { return K8SHPAUIDKey.String(val) } // K8SHugepageSize returns an attribute KeyValue conforming to the // "k8s.hugepage.size" semantic conventions. It represents the size (identifier) // of the K8s huge page. func K8SHugepageSize(val string) attribute.KeyValue { return K8SHugepageSizeKey.String(val) } // K8SJobAnnotation returns an attribute KeyValue conforming to the // "k8s.job.annotation" semantic conventions. It represents the annotation placed // on the Job, the `` being the annotation name, the value being the // annotation value, even if the value is empty. func K8SJobAnnotation(key string, val string) attribute.KeyValue { return attribute.String("k8s.job.annotation."+key, val) } // K8SJobLabel returns an attribute KeyValue conforming to the "k8s.job.label" // semantic conventions. It represents the label placed on the Job, the `` // being the label name, the value being the label value, even if the value is // empty. func K8SJobLabel(key string, val string) attribute.KeyValue { return attribute.String("k8s.job.label."+key, val) } // K8SJobName returns an attribute KeyValue conforming to the "k8s.job.name" // semantic conventions. It represents the name of the Job. func K8SJobName(val string) attribute.KeyValue { return K8SJobNameKey.String(val) } // K8SJobUID returns an attribute KeyValue conforming to the "k8s.job.uid" // semantic conventions. It represents the UID of the Job. func K8SJobUID(val string) attribute.KeyValue { return K8SJobUIDKey.String(val) } // K8SNamespaceAnnotation returns an attribute KeyValue conforming to the // "k8s.namespace.annotation" semantic conventions. It represents the annotation // placed on the Namespace, the `` being the annotation name, the value // being the annotation value, even if the value is empty. func K8SNamespaceAnnotation(key string, val string) attribute.KeyValue { return attribute.String("k8s.namespace.annotation."+key, val) } // K8SNamespaceLabel returns an attribute KeyValue conforming to the // "k8s.namespace.label" semantic conventions. It represents the label placed on // the Namespace, the `` being the label name, the value being the label // value, even if the value is empty. func K8SNamespaceLabel(key string, val string) attribute.KeyValue { return attribute.String("k8s.namespace.label."+key, val) } // K8SNamespaceName returns an attribute KeyValue conforming to the // "k8s.namespace.name" semantic conventions. It represents the name of the // namespace that the pod is running in. func K8SNamespaceName(val string) attribute.KeyValue { return K8SNamespaceNameKey.String(val) } // K8SNodeAnnotation returns an attribute KeyValue conforming to the // "k8s.node.annotation" semantic conventions. It represents the annotation // placed on the Node, the `` being the annotation name, the value being the // annotation value, even if the value is empty. func K8SNodeAnnotation(key string, val string) attribute.KeyValue { return attribute.String("k8s.node.annotation."+key, val) } // K8SNodeLabel returns an attribute KeyValue conforming to the "k8s.node.label" // semantic conventions. It represents the label placed on the Node, the `` // being the label name, the value being the label value, even if the value is // empty. func K8SNodeLabel(key string, val string) attribute.KeyValue { return attribute.String("k8s.node.label."+key, val) } // K8SNodeName returns an attribute KeyValue conforming to the "k8s.node.name" // semantic conventions. It represents the name of the Node. func K8SNodeName(val string) attribute.KeyValue { return K8SNodeNameKey.String(val) } // K8SNodeUID returns an attribute KeyValue conforming to the "k8s.node.uid" // semantic conventions. It represents the UID of the Node. func K8SNodeUID(val string) attribute.KeyValue { return K8SNodeUIDKey.String(val) } // K8SPodAnnotation returns an attribute KeyValue conforming to the // "k8s.pod.annotation" semantic conventions. It represents the annotation placed // on the Pod, the `` being the annotation name, the value being the // annotation value. func K8SPodAnnotation(key string, val string) attribute.KeyValue { return attribute.String("k8s.pod.annotation."+key, val) } // K8SPodLabel returns an attribute KeyValue conforming to the "k8s.pod.label" // semantic conventions. It represents the label placed on the Pod, the `` // being the label name, the value being the label value. func K8SPodLabel(key string, val string) attribute.KeyValue { return attribute.String("k8s.pod.label."+key, val) } // K8SPodName returns an attribute KeyValue conforming to the "k8s.pod.name" // semantic conventions. It represents the name of the Pod. func K8SPodName(val string) attribute.KeyValue { return K8SPodNameKey.String(val) } // K8SPodUID returns an attribute KeyValue conforming to the "k8s.pod.uid" // semantic conventions. It represents the UID of the Pod. func K8SPodUID(val string) attribute.KeyValue { return K8SPodUIDKey.String(val) } // K8SReplicaSetAnnotation returns an attribute KeyValue conforming to the // "k8s.replicaset.annotation" semantic conventions. It represents the annotation // placed on the ReplicaSet, the `` being the annotation name, the value // being the annotation value, even if the value is empty. func K8SReplicaSetAnnotation(key string, val string) attribute.KeyValue { return attribute.String("k8s.replicaset.annotation."+key, val) } // K8SReplicaSetLabel returns an attribute KeyValue conforming to the // "k8s.replicaset.label" semantic conventions. It represents the label placed on // the ReplicaSet, the `` being the label name, the value being the label // value, even if the value is empty. func K8SReplicaSetLabel(key string, val string) attribute.KeyValue { return attribute.String("k8s.replicaset.label."+key, val) } // K8SReplicaSetName returns an attribute KeyValue conforming to the // "k8s.replicaset.name" semantic conventions. It represents the name of the // ReplicaSet. func K8SReplicaSetName(val string) attribute.KeyValue { return K8SReplicaSetNameKey.String(val) } // K8SReplicaSetUID returns an attribute KeyValue conforming to the // "k8s.replicaset.uid" semantic conventions. It represents the UID of the // ReplicaSet. func K8SReplicaSetUID(val string) attribute.KeyValue { return K8SReplicaSetUIDKey.String(val) } // K8SReplicationControllerName returns an attribute KeyValue conforming to the // "k8s.replicationcontroller.name" semantic conventions. It represents the name // of the replication controller. func K8SReplicationControllerName(val string) attribute.KeyValue { return K8SReplicationControllerNameKey.String(val) } // K8SReplicationControllerUID returns an attribute KeyValue conforming to the // "k8s.replicationcontroller.uid" semantic conventions. It represents the UID of // the replication controller. func K8SReplicationControllerUID(val string) attribute.KeyValue { return K8SReplicationControllerUIDKey.String(val) } // K8SResourceQuotaName returns an attribute KeyValue conforming to the // "k8s.resourcequota.name" semantic conventions. It represents the name of the // resource quota. func K8SResourceQuotaName(val string) attribute.KeyValue { return K8SResourceQuotaNameKey.String(val) } // K8SResourceQuotaResourceName returns an attribute KeyValue conforming to the // "k8s.resourcequota.resource_name" semantic conventions. It represents the name // of the K8s resource a resource quota defines. func K8SResourceQuotaResourceName(val string) attribute.KeyValue { return K8SResourceQuotaResourceNameKey.String(val) } // K8SResourceQuotaUID returns an attribute KeyValue conforming to the // "k8s.resourcequota.uid" semantic conventions. It represents the UID of the // resource quota. func K8SResourceQuotaUID(val string) attribute.KeyValue { return K8SResourceQuotaUIDKey.String(val) } // K8SStatefulSetAnnotation returns an attribute KeyValue conforming to the // "k8s.statefulset.annotation" semantic conventions. It represents the // annotation placed on the StatefulSet, the `` being the annotation name, // the value being the annotation value, even if the value is empty. func K8SStatefulSetAnnotation(key string, val string) attribute.KeyValue { return attribute.String("k8s.statefulset.annotation."+key, val) } // K8SStatefulSetLabel returns an attribute KeyValue conforming to the // "k8s.statefulset.label" semantic conventions. It represents the label placed // on the StatefulSet, the `` being the label name, the value being the // label value, even if the value is empty. func K8SStatefulSetLabel(key string, val string) attribute.KeyValue { return attribute.String("k8s.statefulset.label."+key, val) } // K8SStatefulSetName returns an attribute KeyValue conforming to the // "k8s.statefulset.name" semantic conventions. It represents the name of the // StatefulSet. func K8SStatefulSetName(val string) attribute.KeyValue { return K8SStatefulSetNameKey.String(val) } // K8SStatefulSetUID returns an attribute KeyValue conforming to the // "k8s.statefulset.uid" semantic conventions. It represents the UID of the // StatefulSet. func K8SStatefulSetUID(val string) attribute.KeyValue { return K8SStatefulSetUIDKey.String(val) } // K8SStorageclassName returns an attribute KeyValue conforming to the // "k8s.storageclass.name" semantic conventions. It represents the name of K8s // [StorageClass] object. // // [StorageClass]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#storageclass-v1-storage-k8s-io func K8SStorageclassName(val string) attribute.KeyValue { return K8SStorageclassNameKey.String(val) } // K8SVolumeName returns an attribute KeyValue conforming to the // "k8s.volume.name" semantic conventions. It represents the name of the K8s // volume. func K8SVolumeName(val string) attribute.KeyValue { return K8SVolumeNameKey.String(val) } // Enum values for k8s.container.status.reason var ( // The container is being created. // Stability: development K8SContainerStatusReasonContainerCreating = K8SContainerStatusReasonKey.String("ContainerCreating") // The container is in a crash loop back off state. // Stability: development K8SContainerStatusReasonCrashLoopBackOff = K8SContainerStatusReasonKey.String("CrashLoopBackOff") // There was an error creating the container configuration. // Stability: development K8SContainerStatusReasonCreateContainerConfigError = K8SContainerStatusReasonKey.String("CreateContainerConfigError") // There was an error pulling the container image. // Stability: development K8SContainerStatusReasonErrImagePull = K8SContainerStatusReasonKey.String("ErrImagePull") // The container image pull is in back off state. // Stability: development K8SContainerStatusReasonImagePullBackOff = K8SContainerStatusReasonKey.String("ImagePullBackOff") // The container was killed due to out of memory. // Stability: development K8SContainerStatusReasonOomKilled = K8SContainerStatusReasonKey.String("OOMKilled") // The container has completed execution. // Stability: development K8SContainerStatusReasonCompleted = K8SContainerStatusReasonKey.String("Completed") // There was an error with the container. // Stability: development K8SContainerStatusReasonError = K8SContainerStatusReasonKey.String("Error") // The container cannot run. // Stability: development K8SContainerStatusReasonContainerCannotRun = K8SContainerStatusReasonKey.String("ContainerCannotRun") ) // Enum values for k8s.container.status.state var ( // The container has terminated. // Stability: development K8SContainerStatusStateTerminated = K8SContainerStatusStateKey.String("terminated") // The container is running. // Stability: development K8SContainerStatusStateRunning = K8SContainerStatusStateKey.String("running") // The container is waiting. // Stability: development K8SContainerStatusStateWaiting = K8SContainerStatusStateKey.String("waiting") ) // Enum values for k8s.namespace.phase var ( // Active namespace phase as described by [K8s API] // Stability: development // // [K8s API]: https://pkg.go.dev/k8s.io/api@v0.31.3/core/v1#NamespacePhase K8SNamespacePhaseActive = K8SNamespacePhaseKey.String("active") // Terminating namespace phase as described by [K8s API] // Stability: development // // [K8s API]: https://pkg.go.dev/k8s.io/api@v0.31.3/core/v1#NamespacePhase K8SNamespacePhaseTerminating = K8SNamespacePhaseKey.String("terminating") ) // Enum values for k8s.node.condition.status var ( // condition_true // Stability: development K8SNodeConditionStatusConditionTrue = K8SNodeConditionStatusKey.String("true") // condition_false // Stability: development K8SNodeConditionStatusConditionFalse = K8SNodeConditionStatusKey.String("false") // condition_unknown // Stability: development K8SNodeConditionStatusConditionUnknown = K8SNodeConditionStatusKey.String("unknown") ) // Enum values for k8s.node.condition.type var ( // The node is healthy and ready to accept pods // Stability: development K8SNodeConditionTypeReady = K8SNodeConditionTypeKey.String("Ready") // Pressure exists on the disk size—that is, if the disk capacity is low // Stability: development K8SNodeConditionTypeDiskPressure = K8SNodeConditionTypeKey.String("DiskPressure") // Pressure exists on the node memory—that is, if the node memory is low // Stability: development K8SNodeConditionTypeMemoryPressure = K8SNodeConditionTypeKey.String("MemoryPressure") // Pressure exists on the processes—that is, if there are too many processes // on the node // Stability: development K8SNodeConditionTypePIDPressure = K8SNodeConditionTypeKey.String("PIDPressure") // The network for the node is not correctly configured // Stability: development K8SNodeConditionTypeNetworkUnavailable = K8SNodeConditionTypeKey.String("NetworkUnavailable") ) // Enum values for k8s.volume.type var ( // A [persistentVolumeClaim] volume // Stability: development // // [persistentVolumeClaim]: https://v1-30.docs.kubernetes.io/docs/concepts/storage/volumes/#persistentvolumeclaim K8SVolumeTypePersistentVolumeClaim = K8SVolumeTypeKey.String("persistentVolumeClaim") // A [configMap] volume // Stability: development // // [configMap]: https://v1-30.docs.kubernetes.io/docs/concepts/storage/volumes/#configmap K8SVolumeTypeConfigMap = K8SVolumeTypeKey.String("configMap") // A [downwardAPI] volume // Stability: development // // [downwardAPI]: https://v1-30.docs.kubernetes.io/docs/concepts/storage/volumes/#downwardapi K8SVolumeTypeDownwardAPI = K8SVolumeTypeKey.String("downwardAPI") // An [emptyDir] volume // Stability: development // // [emptyDir]: https://v1-30.docs.kubernetes.io/docs/concepts/storage/volumes/#emptydir K8SVolumeTypeEmptyDir = K8SVolumeTypeKey.String("emptyDir") // A [secret] volume // Stability: development // // [secret]: https://v1-30.docs.kubernetes.io/docs/concepts/storage/volumes/#secret K8SVolumeTypeSecret = K8SVolumeTypeKey.String("secret") // A [local] volume // Stability: development // // [local]: https://v1-30.docs.kubernetes.io/docs/concepts/storage/volumes/#local K8SVolumeTypeLocal = K8SVolumeTypeKey.String("local") ) // Namespace: linux const ( // LinuxMemorySlabStateKey is the attribute Key conforming to the // "linux.memory.slab.state" semantic conventions. It represents the Linux Slab // memory state. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "reclaimable", "unreclaimable" LinuxMemorySlabStateKey = attribute.Key("linux.memory.slab.state") ) // Enum values for linux.memory.slab.state var ( // reclaimable // Stability: development LinuxMemorySlabStateReclaimable = LinuxMemorySlabStateKey.String("reclaimable") // unreclaimable // Stability: development LinuxMemorySlabStateUnreclaimable = LinuxMemorySlabStateKey.String("unreclaimable") ) // Namespace: log const ( // LogFileNameKey is the attribute Key conforming to the "log.file.name" // semantic conventions. It represents the basename of the file. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "audit.log" LogFileNameKey = attribute.Key("log.file.name") // LogFileNameResolvedKey is the attribute Key conforming to the // "log.file.name_resolved" semantic conventions. It represents the basename of // the file, with symlinks resolved. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "uuid.log" LogFileNameResolvedKey = attribute.Key("log.file.name_resolved") // LogFilePathKey is the attribute Key conforming to the "log.file.path" // semantic conventions. It represents the full path to the file. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "/var/log/mysql/audit.log" LogFilePathKey = attribute.Key("log.file.path") // LogFilePathResolvedKey is the attribute Key conforming to the // "log.file.path_resolved" semantic conventions. It represents the full path to // the file, with symlinks resolved. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "/var/lib/docker/uuid.log" LogFilePathResolvedKey = attribute.Key("log.file.path_resolved") // LogIostreamKey is the attribute Key conforming to the "log.iostream" semantic // conventions. It represents the stream associated with the log. See below for // a list of well-known values. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: LogIostreamKey = attribute.Key("log.iostream") // LogRecordOriginalKey is the attribute Key conforming to the // "log.record.original" semantic conventions. It represents the complete // original Log Record. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "77 <86>1 2015-08-06T21:58:59.694Z 192.168.2.133 inactive - - - // Something happened", "[INFO] 8/3/24 12:34:56 Something happened" // Note: This value MAY be added when processing a Log Record which was // originally transmitted as a string or equivalent data type AND the Body field // of the Log Record does not contain the same value. (e.g. a syslog or a log // record read from a file.) LogRecordOriginalKey = attribute.Key("log.record.original") // LogRecordUIDKey is the attribute Key conforming to the "log.record.uid" // semantic conventions. It represents a unique identifier for the Log Record. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "01ARZ3NDEKTSV4RRFFQ69G5FAV" // Note: If an id is provided, other log records with the same id will be // considered duplicates and can be removed safely. This means, that two // distinguishable log records MUST have different values. // The id MAY be an // [Universally Unique Lexicographically Sortable Identifier (ULID)], but other // identifiers (e.g. UUID) may be used as needed. // // [Universally Unique Lexicographically Sortable Identifier (ULID)]: https://github.com/ulid/spec LogRecordUIDKey = attribute.Key("log.record.uid") ) // LogFileName returns an attribute KeyValue conforming to the "log.file.name" // semantic conventions. It represents the basename of the file. func LogFileName(val string) attribute.KeyValue { return LogFileNameKey.String(val) } // LogFileNameResolved returns an attribute KeyValue conforming to the // "log.file.name_resolved" semantic conventions. It represents the basename of // the file, with symlinks resolved. func LogFileNameResolved(val string) attribute.KeyValue { return LogFileNameResolvedKey.String(val) } // LogFilePath returns an attribute KeyValue conforming to the "log.file.path" // semantic conventions. It represents the full path to the file. func LogFilePath(val string) attribute.KeyValue { return LogFilePathKey.String(val) } // LogFilePathResolved returns an attribute KeyValue conforming to the // "log.file.path_resolved" semantic conventions. It represents the full path to // the file, with symlinks resolved. func LogFilePathResolved(val string) attribute.KeyValue { return LogFilePathResolvedKey.String(val) } // LogRecordOriginal returns an attribute KeyValue conforming to the // "log.record.original" semantic conventions. It represents the complete // original Log Record. func LogRecordOriginal(val string) attribute.KeyValue { return LogRecordOriginalKey.String(val) } // LogRecordUID returns an attribute KeyValue conforming to the "log.record.uid" // semantic conventions. It represents a unique identifier for the Log Record. func LogRecordUID(val string) attribute.KeyValue { return LogRecordUIDKey.String(val) } // Enum values for log.iostream var ( // Logs from stdout stream // Stability: development LogIostreamStdout = LogIostreamKey.String("stdout") // Events from stderr stream // Stability: development LogIostreamStderr = LogIostreamKey.String("stderr") ) // Namespace: mainframe const ( // MainframeLparNameKey is the attribute Key conforming to the // "mainframe.lpar.name" semantic conventions. It represents the name of the // logical partition that hosts a systems with a mainframe operating system. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "LPAR01" MainframeLparNameKey = attribute.Key("mainframe.lpar.name") ) // MainframeLparName returns an attribute KeyValue conforming to the // "mainframe.lpar.name" semantic conventions. It represents the name of the // logical partition that hosts a systems with a mainframe operating system. func MainframeLparName(val string) attribute.KeyValue { return MainframeLparNameKey.String(val) } // Namespace: messaging const ( // MessagingBatchMessageCountKey is the attribute Key conforming to the // "messaging.batch.message_count" semantic conventions. It represents the // number of messages sent, received, or processed in the scope of the batching // operation. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 0, 1, 2 // Note: Instrumentations SHOULD NOT set `messaging.batch.message_count` on // spans that operate with a single message. When a messaging client library // supports both batch and single-message API for the same operation, // instrumentations SHOULD use `messaging.batch.message_count` for batching APIs // and SHOULD NOT use it for single-message APIs. MessagingBatchMessageCountKey = attribute.Key("messaging.batch.message_count") // MessagingClientIDKey is the attribute Key conforming to the // "messaging.client.id" semantic conventions. It represents a unique identifier // for the client that consumes or produces a message. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "client-5", "myhost@8742@s8083jm" MessagingClientIDKey = attribute.Key("messaging.client.id") // MessagingConsumerGroupNameKey is the attribute Key conforming to the // "messaging.consumer.group.name" semantic conventions. It represents the name // of the consumer group with which a consumer is associated. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "my-group", "indexer" // Note: Semantic conventions for individual messaging systems SHOULD document // whether `messaging.consumer.group.name` is applicable and what it means in // the context of that system. MessagingConsumerGroupNameKey = attribute.Key("messaging.consumer.group.name") // MessagingDestinationAnonymousKey is the attribute Key conforming to the // "messaging.destination.anonymous" semantic conventions. It represents a // boolean that is true if the message destination is anonymous (could be // unnamed or have auto-generated name). // // Type: boolean // RequirementLevel: Recommended // Stability: Development // // Examples: MessagingDestinationAnonymousKey = attribute.Key("messaging.destination.anonymous") // MessagingDestinationNameKey is the attribute Key conforming to the // "messaging.destination.name" semantic conventions. It represents the message // destination name. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "MyQueue", "MyTopic" // Note: Destination name SHOULD uniquely identify a specific queue, topic or // other entity within the broker. If // the broker doesn't have such notion, the destination name SHOULD uniquely // identify the broker. MessagingDestinationNameKey = attribute.Key("messaging.destination.name") // MessagingDestinationPartitionIDKey is the attribute Key conforming to the // "messaging.destination.partition.id" semantic conventions. It represents the // identifier of the partition messages are sent to or received from, unique // within the `messaging.destination.name`. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: 1 MessagingDestinationPartitionIDKey = attribute.Key("messaging.destination.partition.id") // MessagingDestinationSubscriptionNameKey is the attribute Key conforming to // the "messaging.destination.subscription.name" semantic conventions. It // represents the name of the destination subscription from which a message is // consumed. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "subscription-a" // Note: Semantic conventions for individual messaging systems SHOULD document // whether `messaging.destination.subscription.name` is applicable and what it // means in the context of that system. MessagingDestinationSubscriptionNameKey = attribute.Key("messaging.destination.subscription.name") // MessagingDestinationTemplateKey is the attribute Key conforming to the // "messaging.destination.template" semantic conventions. It represents the low // cardinality representation of the messaging destination name. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "/customers/{customerId}" // Note: Destination names could be constructed from templates. An example would // be a destination name involving a user name or product id. Although the // destination name in this case is of high cardinality, the underlying template // is of low cardinality and can be effectively used for grouping and // aggregation. MessagingDestinationTemplateKey = attribute.Key("messaging.destination.template") // MessagingDestinationTemporaryKey is the attribute Key conforming to the // "messaging.destination.temporary" semantic conventions. It represents a // boolean that is true if the message destination is temporary and might not // exist anymore after messages are processed. // // Type: boolean // RequirementLevel: Recommended // Stability: Development // // Examples: MessagingDestinationTemporaryKey = attribute.Key("messaging.destination.temporary") // MessagingEventHubsMessageEnqueuedTimeKey is the attribute Key conforming to // the "messaging.eventhubs.message.enqueued_time" semantic conventions. It // represents the UTC epoch seconds at which the message has been accepted and // stored in the entity. // // Type: int // RequirementLevel: Recommended // Stability: Development MessagingEventHubsMessageEnqueuedTimeKey = attribute.Key("messaging.eventhubs.message.enqueued_time") // MessagingGCPPubSubMessageAckDeadlineKey is the attribute Key conforming to // the "messaging.gcp_pubsub.message.ack_deadline" semantic conventions. It // represents the ack deadline in seconds set for the modify ack deadline // request. // // Type: int // RequirementLevel: Recommended // Stability: Development MessagingGCPPubSubMessageAckDeadlineKey = attribute.Key("messaging.gcp_pubsub.message.ack_deadline") // MessagingGCPPubSubMessageAckIDKey is the attribute Key conforming to the // "messaging.gcp_pubsub.message.ack_id" semantic conventions. It represents the // ack id for a given message. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: ack_id MessagingGCPPubSubMessageAckIDKey = attribute.Key("messaging.gcp_pubsub.message.ack_id") // MessagingGCPPubSubMessageDeliveryAttemptKey is the attribute Key conforming // to the "messaging.gcp_pubsub.message.delivery_attempt" semantic conventions. // It represents the delivery attempt for a given message. // // Type: int // RequirementLevel: Recommended // Stability: Development MessagingGCPPubSubMessageDeliveryAttemptKey = attribute.Key("messaging.gcp_pubsub.message.delivery_attempt") // MessagingGCPPubSubMessageOrderingKeyKey is the attribute Key conforming to // the "messaging.gcp_pubsub.message.ordering_key" semantic conventions. It // represents the ordering key for a given message. If the attribute is not // present, the message does not have an ordering key. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: ordering_key MessagingGCPPubSubMessageOrderingKeyKey = attribute.Key("messaging.gcp_pubsub.message.ordering_key") // MessagingKafkaMessageKeyKey is the attribute Key conforming to the // "messaging.kafka.message.key" semantic conventions. It represents the message // keys in Kafka are used for grouping alike messages to ensure they're // processed on the same partition. They differ from `messaging.message.id` in // that they're not unique. If the key is `null`, the attribute MUST NOT be set. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: myKey // Note: If the key type is not string, it's string representation has to be // supplied for the attribute. If the key has no unambiguous, canonical string // form, don't include its value. MessagingKafkaMessageKeyKey = attribute.Key("messaging.kafka.message.key") // MessagingKafkaMessageTombstoneKey is the attribute Key conforming to the // "messaging.kafka.message.tombstone" semantic conventions. It represents a // boolean that is true if the message is a tombstone. // // Type: boolean // RequirementLevel: Recommended // Stability: Development // // Examples: MessagingKafkaMessageTombstoneKey = attribute.Key("messaging.kafka.message.tombstone") // MessagingKafkaOffsetKey is the attribute Key conforming to the // "messaging.kafka.offset" semantic conventions. It represents the offset of a // record in the corresponding Kafka partition. // // Type: int // RequirementLevel: Recommended // Stability: Development MessagingKafkaOffsetKey = attribute.Key("messaging.kafka.offset") // MessagingMessageBodySizeKey is the attribute Key conforming to the // "messaging.message.body.size" semantic conventions. It represents the size of // the message body in bytes. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Note: This can refer to both the compressed or uncompressed body size. If // both sizes are known, the uncompressed // body size should be used. MessagingMessageBodySizeKey = attribute.Key("messaging.message.body.size") // MessagingMessageConversationIDKey is the attribute Key conforming to the // "messaging.message.conversation_id" semantic conventions. It represents the // conversation ID identifying the conversation to which the message belongs, // represented as a string. Sometimes called "Correlation ID". // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: MyConversationId MessagingMessageConversationIDKey = attribute.Key("messaging.message.conversation_id") // MessagingMessageEnvelopeSizeKey is the attribute Key conforming to the // "messaging.message.envelope.size" semantic conventions. It represents the // size of the message body and metadata in bytes. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Note: This can refer to both the compressed or uncompressed size. If both // sizes are known, the uncompressed // size should be used. MessagingMessageEnvelopeSizeKey = attribute.Key("messaging.message.envelope.size") // MessagingMessageIDKey is the attribute Key conforming to the // "messaging.message.id" semantic conventions. It represents a value used by // the messaging system as an identifier for the message, represented as a // string. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: 452a7c7c7c7048c2f887f61572b18fc2 MessagingMessageIDKey = attribute.Key("messaging.message.id") // MessagingOperationNameKey is the attribute Key conforming to the // "messaging.operation.name" semantic conventions. It represents the // system-specific name of the messaging operation. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "ack", "nack", "send" MessagingOperationNameKey = attribute.Key("messaging.operation.name") // MessagingOperationTypeKey is the attribute Key conforming to the // "messaging.operation.type" semantic conventions. It represents a string // identifying the type of the messaging operation. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // Note: If a custom value is used, it MUST be of low cardinality. MessagingOperationTypeKey = attribute.Key("messaging.operation.type") // MessagingRabbitMQDestinationRoutingKeyKey is the attribute Key conforming to // the "messaging.rabbitmq.destination.routing_key" semantic conventions. It // represents the rabbitMQ message routing key. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: myKey MessagingRabbitMQDestinationRoutingKeyKey = attribute.Key("messaging.rabbitmq.destination.routing_key") // MessagingRabbitMQMessageDeliveryTagKey is the attribute Key conforming to the // "messaging.rabbitmq.message.delivery_tag" semantic conventions. It represents // the rabbitMQ message delivery tag. // // Type: int // RequirementLevel: Recommended // Stability: Development MessagingRabbitMQMessageDeliveryTagKey = attribute.Key("messaging.rabbitmq.message.delivery_tag") // MessagingRocketMQConsumptionModelKey is the attribute Key conforming to the // "messaging.rocketmq.consumption_model" semantic conventions. It represents // the model of message consumption. This only applies to consumer spans. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: MessagingRocketMQConsumptionModelKey = attribute.Key("messaging.rocketmq.consumption_model") // MessagingRocketMQMessageDelayTimeLevelKey is the attribute Key conforming to // the "messaging.rocketmq.message.delay_time_level" semantic conventions. It // represents the delay time level for delay message, which determines the // message delay time. // // Type: int // RequirementLevel: Recommended // Stability: Development MessagingRocketMQMessageDelayTimeLevelKey = attribute.Key("messaging.rocketmq.message.delay_time_level") // MessagingRocketMQMessageDeliveryTimestampKey is the attribute Key conforming // to the "messaging.rocketmq.message.delivery_timestamp" semantic conventions. // It represents the timestamp in milliseconds that the delay message is // expected to be delivered to consumer. // // Type: int // RequirementLevel: Recommended // Stability: Development MessagingRocketMQMessageDeliveryTimestampKey = attribute.Key("messaging.rocketmq.message.delivery_timestamp") // MessagingRocketMQMessageGroupKey is the attribute Key conforming to the // "messaging.rocketmq.message.group" semantic conventions. It represents the it // is essential for FIFO message. Messages that belong to the same message group // are always processed one by one within the same consumer group. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: myMessageGroup MessagingRocketMQMessageGroupKey = attribute.Key("messaging.rocketmq.message.group") // MessagingRocketMQMessageKeysKey is the attribute Key conforming to the // "messaging.rocketmq.message.keys" semantic conventions. It represents the // key(s) of message, another way to mark message besides message id. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "keyA", "keyB" MessagingRocketMQMessageKeysKey = attribute.Key("messaging.rocketmq.message.keys") // MessagingRocketMQMessageTagKey is the attribute Key conforming to the // "messaging.rocketmq.message.tag" semantic conventions. It represents the // secondary classifier of message besides topic. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: tagA MessagingRocketMQMessageTagKey = attribute.Key("messaging.rocketmq.message.tag") // MessagingRocketMQMessageTypeKey is the attribute Key conforming to the // "messaging.rocketmq.message.type" semantic conventions. It represents the // type of message. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: MessagingRocketMQMessageTypeKey = attribute.Key("messaging.rocketmq.message.type") // MessagingRocketMQNamespaceKey is the attribute Key conforming to the // "messaging.rocketmq.namespace" semantic conventions. It represents the // namespace of RocketMQ resources, resources in different namespaces are // individual. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: myNamespace MessagingRocketMQNamespaceKey = attribute.Key("messaging.rocketmq.namespace") // MessagingServiceBusDispositionStatusKey is the attribute Key conforming to // the "messaging.servicebus.disposition_status" semantic conventions. It // represents the describes the [settlement type]. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // // [settlement type]: https://learn.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock MessagingServiceBusDispositionStatusKey = attribute.Key("messaging.servicebus.disposition_status") // MessagingServiceBusMessageDeliveryCountKey is the attribute Key conforming to // the "messaging.servicebus.message.delivery_count" semantic conventions. It // represents the number of deliveries that have been attempted for this // message. // // Type: int // RequirementLevel: Recommended // Stability: Development MessagingServiceBusMessageDeliveryCountKey = attribute.Key("messaging.servicebus.message.delivery_count") // MessagingServiceBusMessageEnqueuedTimeKey is the attribute Key conforming to // the "messaging.servicebus.message.enqueued_time" semantic conventions. It // represents the UTC epoch seconds at which the message has been accepted and // stored in the entity. // // Type: int // RequirementLevel: Recommended // Stability: Development MessagingServiceBusMessageEnqueuedTimeKey = attribute.Key("messaging.servicebus.message.enqueued_time") // MessagingSystemKey is the attribute Key conforming to the "messaging.system" // semantic conventions. It represents the messaging system as identified by the // client instrumentation. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // Note: The actual messaging system may differ from the one known by the // client. For example, when using Kafka client libraries to communicate with // Azure Event Hubs, the `messaging.system` is set to `kafka` based on the // instrumentation's best knowledge. MessagingSystemKey = attribute.Key("messaging.system") ) // MessagingBatchMessageCount returns an attribute KeyValue conforming to the // "messaging.batch.message_count" semantic conventions. It represents the number // of messages sent, received, or processed in the scope of the batching // operation. func MessagingBatchMessageCount(val int) attribute.KeyValue { return MessagingBatchMessageCountKey.Int(val) } // MessagingClientID returns an attribute KeyValue conforming to the // "messaging.client.id" semantic conventions. It represents a unique identifier // for the client that consumes or produces a message. func MessagingClientID(val string) attribute.KeyValue { return MessagingClientIDKey.String(val) } // MessagingConsumerGroupName returns an attribute KeyValue conforming to the // "messaging.consumer.group.name" semantic conventions. It represents the name // of the consumer group with which a consumer is associated. func MessagingConsumerGroupName(val string) attribute.KeyValue { return MessagingConsumerGroupNameKey.String(val) } // MessagingDestinationAnonymous returns an attribute KeyValue conforming to the // "messaging.destination.anonymous" semantic conventions. It represents a // boolean that is true if the message destination is anonymous (could be unnamed // or have auto-generated name). func MessagingDestinationAnonymous(val bool) attribute.KeyValue { return MessagingDestinationAnonymousKey.Bool(val) } // MessagingDestinationName returns an attribute KeyValue conforming to the // "messaging.destination.name" semantic conventions. It represents the message // destination name. func MessagingDestinationName(val string) attribute.KeyValue { return MessagingDestinationNameKey.String(val) } // MessagingDestinationPartitionID returns an attribute KeyValue conforming to // the "messaging.destination.partition.id" semantic conventions. It represents // the identifier of the partition messages are sent to or received from, unique // within the `messaging.destination.name`. func MessagingDestinationPartitionID(val string) attribute.KeyValue { return MessagingDestinationPartitionIDKey.String(val) } // MessagingDestinationSubscriptionName returns an attribute KeyValue conforming // to the "messaging.destination.subscription.name" semantic conventions. It // represents the name of the destination subscription from which a message is // consumed. func MessagingDestinationSubscriptionName(val string) attribute.KeyValue { return MessagingDestinationSubscriptionNameKey.String(val) } // MessagingDestinationTemplate returns an attribute KeyValue conforming to the // "messaging.destination.template" semantic conventions. It represents the low // cardinality representation of the messaging destination name. func MessagingDestinationTemplate(val string) attribute.KeyValue { return MessagingDestinationTemplateKey.String(val) } // MessagingDestinationTemporary returns an attribute KeyValue conforming to the // "messaging.destination.temporary" semantic conventions. It represents a // boolean that is true if the message destination is temporary and might not // exist anymore after messages are processed. func MessagingDestinationTemporary(val bool) attribute.KeyValue { return MessagingDestinationTemporaryKey.Bool(val) } // MessagingEventHubsMessageEnqueuedTime returns an attribute KeyValue conforming // to the "messaging.eventhubs.message.enqueued_time" semantic conventions. It // represents the UTC epoch seconds at which the message has been accepted and // stored in the entity. func MessagingEventHubsMessageEnqueuedTime(val int) attribute.KeyValue { return MessagingEventHubsMessageEnqueuedTimeKey.Int(val) } // MessagingGCPPubSubMessageAckDeadline returns an attribute KeyValue conforming // to the "messaging.gcp_pubsub.message.ack_deadline" semantic conventions. It // represents the ack deadline in seconds set for the modify ack deadline // request. func MessagingGCPPubSubMessageAckDeadline(val int) attribute.KeyValue { return MessagingGCPPubSubMessageAckDeadlineKey.Int(val) } // MessagingGCPPubSubMessageAckID returns an attribute KeyValue conforming to the // "messaging.gcp_pubsub.message.ack_id" semantic conventions. It represents the // ack id for a given message. func MessagingGCPPubSubMessageAckID(val string) attribute.KeyValue { return MessagingGCPPubSubMessageAckIDKey.String(val) } // MessagingGCPPubSubMessageDeliveryAttempt returns an attribute KeyValue // conforming to the "messaging.gcp_pubsub.message.delivery_attempt" semantic // conventions. It represents the delivery attempt for a given message. func MessagingGCPPubSubMessageDeliveryAttempt(val int) attribute.KeyValue { return MessagingGCPPubSubMessageDeliveryAttemptKey.Int(val) } // MessagingGCPPubSubMessageOrderingKey returns an attribute KeyValue conforming // to the "messaging.gcp_pubsub.message.ordering_key" semantic conventions. It // represents the ordering key for a given message. If the attribute is not // present, the message does not have an ordering key. func MessagingGCPPubSubMessageOrderingKey(val string) attribute.KeyValue { return MessagingGCPPubSubMessageOrderingKeyKey.String(val) } // MessagingKafkaMessageKey returns an attribute KeyValue conforming to the // "messaging.kafka.message.key" semantic conventions. It represents the message // keys in Kafka are used for grouping alike messages to ensure they're processed // on the same partition. They differ from `messaging.message.id` in that they're // not unique. If the key is `null`, the attribute MUST NOT be set. func MessagingKafkaMessageKey(val string) attribute.KeyValue { return MessagingKafkaMessageKeyKey.String(val) } // MessagingKafkaMessageTombstone returns an attribute KeyValue conforming to the // "messaging.kafka.message.tombstone" semantic conventions. It represents a // boolean that is true if the message is a tombstone. func MessagingKafkaMessageTombstone(val bool) attribute.KeyValue { return MessagingKafkaMessageTombstoneKey.Bool(val) } // MessagingKafkaOffset returns an attribute KeyValue conforming to the // "messaging.kafka.offset" semantic conventions. It represents the offset of a // record in the corresponding Kafka partition. func MessagingKafkaOffset(val int) attribute.KeyValue { return MessagingKafkaOffsetKey.Int(val) } // MessagingMessageBodySize returns an attribute KeyValue conforming to the // "messaging.message.body.size" semantic conventions. It represents the size of // the message body in bytes. func MessagingMessageBodySize(val int) attribute.KeyValue { return MessagingMessageBodySizeKey.Int(val) } // MessagingMessageConversationID returns an attribute KeyValue conforming to the // "messaging.message.conversation_id" semantic conventions. It represents the // conversation ID identifying the conversation to which the message belongs, // represented as a string. Sometimes called "Correlation ID". func MessagingMessageConversationID(val string) attribute.KeyValue { return MessagingMessageConversationIDKey.String(val) } // MessagingMessageEnvelopeSize returns an attribute KeyValue conforming to the // "messaging.message.envelope.size" semantic conventions. It represents the size // of the message body and metadata in bytes. func MessagingMessageEnvelopeSize(val int) attribute.KeyValue { return MessagingMessageEnvelopeSizeKey.Int(val) } // MessagingMessageID returns an attribute KeyValue conforming to the // "messaging.message.id" semantic conventions. It represents a value used by the // messaging system as an identifier for the message, represented as a string. func MessagingMessageID(val string) attribute.KeyValue { return MessagingMessageIDKey.String(val) } // MessagingOperationName returns an attribute KeyValue conforming to the // "messaging.operation.name" semantic conventions. It represents the // system-specific name of the messaging operation. func MessagingOperationName(val string) attribute.KeyValue { return MessagingOperationNameKey.String(val) } // MessagingRabbitMQDestinationRoutingKey returns an attribute KeyValue // conforming to the "messaging.rabbitmq.destination.routing_key" semantic // conventions. It represents the rabbitMQ message routing key. func MessagingRabbitMQDestinationRoutingKey(val string) attribute.KeyValue { return MessagingRabbitMQDestinationRoutingKeyKey.String(val) } // MessagingRabbitMQMessageDeliveryTag returns an attribute KeyValue conforming // to the "messaging.rabbitmq.message.delivery_tag" semantic conventions. It // represents the rabbitMQ message delivery tag. func MessagingRabbitMQMessageDeliveryTag(val int) attribute.KeyValue { return MessagingRabbitMQMessageDeliveryTagKey.Int(val) } // MessagingRocketMQMessageDelayTimeLevel returns an attribute KeyValue // conforming to the "messaging.rocketmq.message.delay_time_level" semantic // conventions. It represents the delay time level for delay message, which // determines the message delay time. func MessagingRocketMQMessageDelayTimeLevel(val int) attribute.KeyValue { return MessagingRocketMQMessageDelayTimeLevelKey.Int(val) } // MessagingRocketMQMessageDeliveryTimestamp returns an attribute KeyValue // conforming to the "messaging.rocketmq.message.delivery_timestamp" semantic // conventions. It represents the timestamp in milliseconds that the delay // message is expected to be delivered to consumer. func MessagingRocketMQMessageDeliveryTimestamp(val int) attribute.KeyValue { return MessagingRocketMQMessageDeliveryTimestampKey.Int(val) } // MessagingRocketMQMessageGroup returns an attribute KeyValue conforming to the // "messaging.rocketmq.message.group" semantic conventions. It represents the it // is essential for FIFO message. Messages that belong to the same message group // are always processed one by one within the same consumer group. func MessagingRocketMQMessageGroup(val string) attribute.KeyValue { return MessagingRocketMQMessageGroupKey.String(val) } // MessagingRocketMQMessageKeys returns an attribute KeyValue conforming to the // "messaging.rocketmq.message.keys" semantic conventions. It represents the // key(s) of message, another way to mark message besides message id. func MessagingRocketMQMessageKeys(val ...string) attribute.KeyValue { return MessagingRocketMQMessageKeysKey.StringSlice(val) } // MessagingRocketMQMessageTag returns an attribute KeyValue conforming to the // "messaging.rocketmq.message.tag" semantic conventions. It represents the // secondary classifier of message besides topic. func MessagingRocketMQMessageTag(val string) attribute.KeyValue { return MessagingRocketMQMessageTagKey.String(val) } // MessagingRocketMQNamespace returns an attribute KeyValue conforming to the // "messaging.rocketmq.namespace" semantic conventions. It represents the // namespace of RocketMQ resources, resources in different namespaces are // individual. func MessagingRocketMQNamespace(val string) attribute.KeyValue { return MessagingRocketMQNamespaceKey.String(val) } // MessagingServiceBusMessageDeliveryCount returns an attribute KeyValue // conforming to the "messaging.servicebus.message.delivery_count" semantic // conventions. It represents the number of deliveries that have been attempted // for this message. func MessagingServiceBusMessageDeliveryCount(val int) attribute.KeyValue { return MessagingServiceBusMessageDeliveryCountKey.Int(val) } // MessagingServiceBusMessageEnqueuedTime returns an attribute KeyValue // conforming to the "messaging.servicebus.message.enqueued_time" semantic // conventions. It represents the UTC epoch seconds at which the message has been // accepted and stored in the entity. func MessagingServiceBusMessageEnqueuedTime(val int) attribute.KeyValue { return MessagingServiceBusMessageEnqueuedTimeKey.Int(val) } // Enum values for messaging.operation.type var ( // A message is created. "Create" spans always refer to a single message and are // used to provide a unique creation context for messages in batch sending // scenarios. // // Stability: development MessagingOperationTypeCreate = MessagingOperationTypeKey.String("create") // One or more messages are provided for sending to an intermediary. If a single // message is sent, the context of the "Send" span can be used as the creation // context and no "Create" span needs to be created. // // Stability: development MessagingOperationTypeSend = MessagingOperationTypeKey.String("send") // One or more messages are requested by a consumer. This operation refers to // pull-based scenarios, where consumers explicitly call methods of messaging // SDKs to receive messages. // // Stability: development MessagingOperationTypeReceive = MessagingOperationTypeKey.String("receive") // One or more messages are processed by a consumer. // // Stability: development MessagingOperationTypeProcess = MessagingOperationTypeKey.String("process") // One or more messages are settled. // // Stability: development MessagingOperationTypeSettle = MessagingOperationTypeKey.String("settle") ) // Enum values for messaging.rocketmq.consumption_model var ( // Clustering consumption model // Stability: development MessagingRocketMQConsumptionModelClustering = MessagingRocketMQConsumptionModelKey.String("clustering") // Broadcasting consumption model // Stability: development MessagingRocketMQConsumptionModelBroadcasting = MessagingRocketMQConsumptionModelKey.String("broadcasting") ) // Enum values for messaging.rocketmq.message.type var ( // Normal message // Stability: development MessagingRocketMQMessageTypeNormal = MessagingRocketMQMessageTypeKey.String("normal") // FIFO message // Stability: development MessagingRocketMQMessageTypeFifo = MessagingRocketMQMessageTypeKey.String("fifo") // Delay message // Stability: development MessagingRocketMQMessageTypeDelay = MessagingRocketMQMessageTypeKey.String("delay") // Transaction message // Stability: development MessagingRocketMQMessageTypeTransaction = MessagingRocketMQMessageTypeKey.String("transaction") ) // Enum values for messaging.servicebus.disposition_status var ( // Message is completed // Stability: development MessagingServiceBusDispositionStatusComplete = MessagingServiceBusDispositionStatusKey.String("complete") // Message is abandoned // Stability: development MessagingServiceBusDispositionStatusAbandon = MessagingServiceBusDispositionStatusKey.String("abandon") // Message is sent to dead letter queue // Stability: development MessagingServiceBusDispositionStatusDeadLetter = MessagingServiceBusDispositionStatusKey.String("dead_letter") // Message is deferred // Stability: development MessagingServiceBusDispositionStatusDefer = MessagingServiceBusDispositionStatusKey.String("defer") ) // Enum values for messaging.system var ( // Apache ActiveMQ // Stability: development MessagingSystemActiveMQ = MessagingSystemKey.String("activemq") // Amazon Simple Notification Service (SNS) // Stability: development MessagingSystemAWSSNS = MessagingSystemKey.String("aws.sns") // Amazon Simple Queue Service (SQS) // Stability: development MessagingSystemAWSSQS = MessagingSystemKey.String("aws_sqs") // Azure Event Grid // Stability: development MessagingSystemEventGrid = MessagingSystemKey.String("eventgrid") // Azure Event Hubs // Stability: development MessagingSystemEventHubs = MessagingSystemKey.String("eventhubs") // Azure Service Bus // Stability: development MessagingSystemServiceBus = MessagingSystemKey.String("servicebus") // Google Cloud Pub/Sub // Stability: development MessagingSystemGCPPubSub = MessagingSystemKey.String("gcp_pubsub") // Java Message Service // Stability: development MessagingSystemJMS = MessagingSystemKey.String("jms") // Apache Kafka // Stability: development MessagingSystemKafka = MessagingSystemKey.String("kafka") // RabbitMQ // Stability: development MessagingSystemRabbitMQ = MessagingSystemKey.String("rabbitmq") // Apache RocketMQ // Stability: development MessagingSystemRocketMQ = MessagingSystemKey.String("rocketmq") // Apache Pulsar // Stability: development MessagingSystemPulsar = MessagingSystemKey.String("pulsar") ) // Namespace: network const ( // NetworkCarrierICCKey is the attribute Key conforming to the // "network.carrier.icc" semantic conventions. It represents the ISO 3166-1 // alpha-2 2-character country code associated with the mobile carrier network. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: DE NetworkCarrierICCKey = attribute.Key("network.carrier.icc") // NetworkCarrierMCCKey is the attribute Key conforming to the // "network.carrier.mcc" semantic conventions. It represents the mobile carrier // country code. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: 310 NetworkCarrierMCCKey = attribute.Key("network.carrier.mcc") // NetworkCarrierMNCKey is the attribute Key conforming to the // "network.carrier.mnc" semantic conventions. It represents the mobile carrier // network code. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: 001 NetworkCarrierMNCKey = attribute.Key("network.carrier.mnc") // NetworkCarrierNameKey is the attribute Key conforming to the // "network.carrier.name" semantic conventions. It represents the name of the // mobile carrier. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: sprint NetworkCarrierNameKey = attribute.Key("network.carrier.name") // NetworkConnectionStateKey is the attribute Key conforming to the // "network.connection.state" semantic conventions. It represents the state of // network connection. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "close_wait" // Note: Connection states are defined as part of the [rfc9293] // // [rfc9293]: https://datatracker.ietf.org/doc/html/rfc9293#section-3.3.2 NetworkConnectionStateKey = attribute.Key("network.connection.state") // NetworkConnectionSubtypeKey is the attribute Key conforming to the // "network.connection.subtype" semantic conventions. It represents the this // describes more details regarding the connection.type. It may be the type of // cell technology connection, but it could be used for describing details about // a wifi connection. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: LTE NetworkConnectionSubtypeKey = attribute.Key("network.connection.subtype") // NetworkConnectionTypeKey is the attribute Key conforming to the // "network.connection.type" semantic conventions. It represents the internet // connection type. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: wifi NetworkConnectionTypeKey = attribute.Key("network.connection.type") // NetworkInterfaceNameKey is the attribute Key conforming to the // "network.interface.name" semantic conventions. It represents the network // interface name. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "lo", "eth0" NetworkInterfaceNameKey = attribute.Key("network.interface.name") // NetworkIODirectionKey is the attribute Key conforming to the // "network.io.direction" semantic conventions. It represents the network IO // operation direction. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "transmit" NetworkIODirectionKey = attribute.Key("network.io.direction") // NetworkLocalAddressKey is the attribute Key conforming to the // "network.local.address" semantic conventions. It represents the local address // of the network connection - IP address or Unix domain socket name. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "10.1.2.80", "/tmp/my.sock" NetworkLocalAddressKey = attribute.Key("network.local.address") // NetworkLocalPortKey is the attribute Key conforming to the // "network.local.port" semantic conventions. It represents the local port // number of the network connection. // // Type: int // RequirementLevel: Recommended // Stability: Stable // // Examples: 65123 NetworkLocalPortKey = attribute.Key("network.local.port") // NetworkPeerAddressKey is the attribute Key conforming to the // "network.peer.address" semantic conventions. It represents the peer address // of the network connection - IP address or Unix domain socket name. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "10.1.2.80", "/tmp/my.sock" NetworkPeerAddressKey = attribute.Key("network.peer.address") // NetworkPeerPortKey is the attribute Key conforming to the "network.peer.port" // semantic conventions. It represents the peer port number of the network // connection. // // Type: int // RequirementLevel: Recommended // Stability: Stable // // Examples: 65123 NetworkPeerPortKey = attribute.Key("network.peer.port") // NetworkProtocolNameKey is the attribute Key conforming to the // "network.protocol.name" semantic conventions. It represents the // [OSI application layer] or non-OSI equivalent. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "amqp", "http", "mqtt" // Note: The value SHOULD be normalized to lowercase. // // [OSI application layer]: https://wikipedia.org/wiki/Application_layer NetworkProtocolNameKey = attribute.Key("network.protocol.name") // NetworkProtocolVersionKey is the attribute Key conforming to the // "network.protocol.version" semantic conventions. It represents the actual // version of the protocol used for network communication. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "1.1", "2" // Note: If protocol version is subject to negotiation (for example using [ALPN] // ), this attribute SHOULD be set to the negotiated version. If the actual // protocol version is not known, this attribute SHOULD NOT be set. // // [ALPN]: https://www.rfc-editor.org/rfc/rfc7301.html NetworkProtocolVersionKey = attribute.Key("network.protocol.version") // NetworkTransportKey is the attribute Key conforming to the // "network.transport" semantic conventions. It represents the // [OSI transport layer] or [inter-process communication method]. // // Type: Enum // RequirementLevel: Recommended // Stability: Stable // // Examples: "tcp", "udp" // Note: The value SHOULD be normalized to lowercase. // // Consider always setting the transport when setting a port number, since // a port number is ambiguous without knowing the transport. For example // different processes could be listening on TCP port 12345 and UDP port 12345. // // [OSI transport layer]: https://wikipedia.org/wiki/Transport_layer // [inter-process communication method]: https://wikipedia.org/wiki/Inter-process_communication NetworkTransportKey = attribute.Key("network.transport") // NetworkTypeKey is the attribute Key conforming to the "network.type" semantic // conventions. It represents the [OSI network layer] or non-OSI equivalent. // // Type: Enum // RequirementLevel: Recommended // Stability: Stable // // Examples: "ipv4", "ipv6" // Note: The value SHOULD be normalized to lowercase. // // [OSI network layer]: https://wikipedia.org/wiki/Network_layer NetworkTypeKey = attribute.Key("network.type") ) // NetworkCarrierICC returns an attribute KeyValue conforming to the // "network.carrier.icc" semantic conventions. It represents the ISO 3166-1 // alpha-2 2-character country code associated with the mobile carrier network. func NetworkCarrierICC(val string) attribute.KeyValue { return NetworkCarrierICCKey.String(val) } // NetworkCarrierMCC returns an attribute KeyValue conforming to the // "network.carrier.mcc" semantic conventions. It represents the mobile carrier // country code. func NetworkCarrierMCC(val string) attribute.KeyValue { return NetworkCarrierMCCKey.String(val) } // NetworkCarrierMNC returns an attribute KeyValue conforming to the // "network.carrier.mnc" semantic conventions. It represents the mobile carrier // network code. func NetworkCarrierMNC(val string) attribute.KeyValue { return NetworkCarrierMNCKey.String(val) } // NetworkCarrierName returns an attribute KeyValue conforming to the // "network.carrier.name" semantic conventions. It represents the name of the // mobile carrier. func NetworkCarrierName(val string) attribute.KeyValue { return NetworkCarrierNameKey.String(val) } // NetworkInterfaceName returns an attribute KeyValue conforming to the // "network.interface.name" semantic conventions. It represents the network // interface name. func NetworkInterfaceName(val string) attribute.KeyValue { return NetworkInterfaceNameKey.String(val) } // NetworkLocalAddress returns an attribute KeyValue conforming to the // "network.local.address" semantic conventions. It represents the local address // of the network connection - IP address or Unix domain socket name. func NetworkLocalAddress(val string) attribute.KeyValue { return NetworkLocalAddressKey.String(val) } // NetworkLocalPort returns an attribute KeyValue conforming to the // "network.local.port" semantic conventions. It represents the local port number // of the network connection. func NetworkLocalPort(val int) attribute.KeyValue { return NetworkLocalPortKey.Int(val) } // NetworkPeerAddress returns an attribute KeyValue conforming to the // "network.peer.address" semantic conventions. It represents the peer address of // the network connection - IP address or Unix domain socket name. func NetworkPeerAddress(val string) attribute.KeyValue { return NetworkPeerAddressKey.String(val) } // NetworkPeerPort returns an attribute KeyValue conforming to the // "network.peer.port" semantic conventions. It represents the peer port number // of the network connection. func NetworkPeerPort(val int) attribute.KeyValue { return NetworkPeerPortKey.Int(val) } // NetworkProtocolName returns an attribute KeyValue conforming to the // "network.protocol.name" semantic conventions. It represents the // [OSI application layer] or non-OSI equivalent. // // [OSI application layer]: https://wikipedia.org/wiki/Application_layer func NetworkProtocolName(val string) attribute.KeyValue { return NetworkProtocolNameKey.String(val) } // NetworkProtocolVersion returns an attribute KeyValue conforming to the // "network.protocol.version" semantic conventions. It represents the actual // version of the protocol used for network communication. func NetworkProtocolVersion(val string) attribute.KeyValue { return NetworkProtocolVersionKey.String(val) } // Enum values for network.connection.state var ( // closed // Stability: development NetworkConnectionStateClosed = NetworkConnectionStateKey.String("closed") // close_wait // Stability: development NetworkConnectionStateCloseWait = NetworkConnectionStateKey.String("close_wait") // closing // Stability: development NetworkConnectionStateClosing = NetworkConnectionStateKey.String("closing") // established // Stability: development NetworkConnectionStateEstablished = NetworkConnectionStateKey.String("established") // fin_wait_1 // Stability: development NetworkConnectionStateFinWait1 = NetworkConnectionStateKey.String("fin_wait_1") // fin_wait_2 // Stability: development NetworkConnectionStateFinWait2 = NetworkConnectionStateKey.String("fin_wait_2") // last_ack // Stability: development NetworkConnectionStateLastAck = NetworkConnectionStateKey.String("last_ack") // listen // Stability: development NetworkConnectionStateListen = NetworkConnectionStateKey.String("listen") // syn_received // Stability: development NetworkConnectionStateSynReceived = NetworkConnectionStateKey.String("syn_received") // syn_sent // Stability: development NetworkConnectionStateSynSent = NetworkConnectionStateKey.String("syn_sent") // time_wait // Stability: development NetworkConnectionStateTimeWait = NetworkConnectionStateKey.String("time_wait") ) // Enum values for network.connection.subtype var ( // GPRS // Stability: development NetworkConnectionSubtypeGprs = NetworkConnectionSubtypeKey.String("gprs") // EDGE // Stability: development NetworkConnectionSubtypeEdge = NetworkConnectionSubtypeKey.String("edge") // UMTS // Stability: development NetworkConnectionSubtypeUmts = NetworkConnectionSubtypeKey.String("umts") // CDMA // Stability: development NetworkConnectionSubtypeCdma = NetworkConnectionSubtypeKey.String("cdma") // EVDO Rel. 0 // Stability: development NetworkConnectionSubtypeEvdo0 = NetworkConnectionSubtypeKey.String("evdo_0") // EVDO Rev. A // Stability: development NetworkConnectionSubtypeEvdoA = NetworkConnectionSubtypeKey.String("evdo_a") // CDMA2000 1XRTT // Stability: development NetworkConnectionSubtypeCdma20001xrtt = NetworkConnectionSubtypeKey.String("cdma2000_1xrtt") // HSDPA // Stability: development NetworkConnectionSubtypeHsdpa = NetworkConnectionSubtypeKey.String("hsdpa") // HSUPA // Stability: development NetworkConnectionSubtypeHsupa = NetworkConnectionSubtypeKey.String("hsupa") // HSPA // Stability: development NetworkConnectionSubtypeHspa = NetworkConnectionSubtypeKey.String("hspa") // IDEN // Stability: development NetworkConnectionSubtypeIden = NetworkConnectionSubtypeKey.String("iden") // EVDO Rev. B // Stability: development NetworkConnectionSubtypeEvdoB = NetworkConnectionSubtypeKey.String("evdo_b") // LTE // Stability: development NetworkConnectionSubtypeLte = NetworkConnectionSubtypeKey.String("lte") // EHRPD // Stability: development NetworkConnectionSubtypeEhrpd = NetworkConnectionSubtypeKey.String("ehrpd") // HSPAP // Stability: development NetworkConnectionSubtypeHspap = NetworkConnectionSubtypeKey.String("hspap") // GSM // Stability: development NetworkConnectionSubtypeGsm = NetworkConnectionSubtypeKey.String("gsm") // TD-SCDMA // Stability: development NetworkConnectionSubtypeTdScdma = NetworkConnectionSubtypeKey.String("td_scdma") // IWLAN // Stability: development NetworkConnectionSubtypeIwlan = NetworkConnectionSubtypeKey.String("iwlan") // 5G NR (New Radio) // Stability: development NetworkConnectionSubtypeNr = NetworkConnectionSubtypeKey.String("nr") // 5G NRNSA (New Radio Non-Standalone) // Stability: development NetworkConnectionSubtypeNrnsa = NetworkConnectionSubtypeKey.String("nrnsa") // LTE CA // Stability: development NetworkConnectionSubtypeLteCa = NetworkConnectionSubtypeKey.String("lte_ca") ) // Enum values for network.connection.type var ( // wifi // Stability: development NetworkConnectionTypeWifi = NetworkConnectionTypeKey.String("wifi") // wired // Stability: development NetworkConnectionTypeWired = NetworkConnectionTypeKey.String("wired") // cell // Stability: development NetworkConnectionTypeCell = NetworkConnectionTypeKey.String("cell") // unavailable // Stability: development NetworkConnectionTypeUnavailable = NetworkConnectionTypeKey.String("unavailable") // unknown // Stability: development NetworkConnectionTypeUnknown = NetworkConnectionTypeKey.String("unknown") ) // Enum values for network.io.direction var ( // transmit // Stability: development NetworkIODirectionTransmit = NetworkIODirectionKey.String("transmit") // receive // Stability: development NetworkIODirectionReceive = NetworkIODirectionKey.String("receive") ) // Enum values for network.transport var ( // TCP // Stability: stable NetworkTransportTCP = NetworkTransportKey.String("tcp") // UDP // Stability: stable NetworkTransportUDP = NetworkTransportKey.String("udp") // Named or anonymous pipe. // Stability: stable NetworkTransportPipe = NetworkTransportKey.String("pipe") // Unix domain socket // Stability: stable NetworkTransportUnix = NetworkTransportKey.String("unix") // QUIC // Stability: stable NetworkTransportQUIC = NetworkTransportKey.String("quic") ) // Enum values for network.type var ( // IPv4 // Stability: stable NetworkTypeIPv4 = NetworkTypeKey.String("ipv4") // IPv6 // Stability: stable NetworkTypeIPv6 = NetworkTypeKey.String("ipv6") ) // Namespace: oci const ( // OCIManifestDigestKey is the attribute Key conforming to the // "oci.manifest.digest" semantic conventions. It represents the digest of the // OCI image manifest. For container images specifically is the digest by which // the container image is known. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: // "sha256:e4ca62c0d62f3e886e684806dfe9d4e0cda60d54986898173c1083856cfda0f4" // Note: Follows [OCI Image Manifest Specification], and specifically the // [Digest property]. // An example can be found in [Example Image Manifest]. // // [OCI Image Manifest Specification]: https://github.com/opencontainers/image-spec/blob/main/manifest.md // [Digest property]: https://github.com/opencontainers/image-spec/blob/main/descriptor.md#digests // [Example Image Manifest]: https://github.com/opencontainers/image-spec/blob/main/manifest.md#example-image-manifest OCIManifestDigestKey = attribute.Key("oci.manifest.digest") ) // OCIManifestDigest returns an attribute KeyValue conforming to the // "oci.manifest.digest" semantic conventions. It represents the digest of the // OCI image manifest. For container images specifically is the digest by which // the container image is known. func OCIManifestDigest(val string) attribute.KeyValue { return OCIManifestDigestKey.String(val) } // Namespace: openai const ( // OpenAIRequestServiceTierKey is the attribute Key conforming to the // "openai.request.service_tier" semantic conventions. It represents the service // tier requested. May be a specific tier, default, or auto. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "auto", "default" OpenAIRequestServiceTierKey = attribute.Key("openai.request.service_tier") // OpenAIResponseServiceTierKey is the attribute Key conforming to the // "openai.response.service_tier" semantic conventions. It represents the // service tier used for the response. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "scale", "default" OpenAIResponseServiceTierKey = attribute.Key("openai.response.service_tier") // OpenAIResponseSystemFingerprintKey is the attribute Key conforming to the // "openai.response.system_fingerprint" semantic conventions. It represents a // fingerprint to track any eventual change in the Generative AI environment. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "fp_44709d6fcb" OpenAIResponseSystemFingerprintKey = attribute.Key("openai.response.system_fingerprint") ) // OpenAIResponseServiceTier returns an attribute KeyValue conforming to the // "openai.response.service_tier" semantic conventions. It represents the service // tier used for the response. func OpenAIResponseServiceTier(val string) attribute.KeyValue { return OpenAIResponseServiceTierKey.String(val) } // OpenAIResponseSystemFingerprint returns an attribute KeyValue conforming to // the "openai.response.system_fingerprint" semantic conventions. It represents a // fingerprint to track any eventual change in the Generative AI environment. func OpenAIResponseSystemFingerprint(val string) attribute.KeyValue { return OpenAIResponseSystemFingerprintKey.String(val) } // Enum values for openai.request.service_tier var ( // The system will utilize scale tier credits until they are exhausted. // Stability: development OpenAIRequestServiceTierAuto = OpenAIRequestServiceTierKey.String("auto") // The system will utilize the default scale tier. // Stability: development OpenAIRequestServiceTierDefault = OpenAIRequestServiceTierKey.String("default") ) // Namespace: opentracing const ( // OpenTracingRefTypeKey is the attribute Key conforming to the // "opentracing.ref_type" semantic conventions. It represents the parent-child // Reference type. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // Note: The causal relationship between a child Span and a parent Span. OpenTracingRefTypeKey = attribute.Key("opentracing.ref_type") ) // Enum values for opentracing.ref_type var ( // The parent Span depends on the child Span in some capacity // Stability: development OpenTracingRefTypeChildOf = OpenTracingRefTypeKey.String("child_of") // The parent Span doesn't depend in any way on the result of the child Span // Stability: development OpenTracingRefTypeFollowsFrom = OpenTracingRefTypeKey.String("follows_from") ) // Namespace: os const ( // OSBuildIDKey is the attribute Key conforming to the "os.build_id" semantic // conventions. It represents the unique identifier for a particular build or // compilation of the operating system. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "TQ3C.230805.001.B2", "20E247", "22621" OSBuildIDKey = attribute.Key("os.build_id") // OSDescriptionKey is the attribute Key conforming to the "os.description" // semantic conventions. It represents the human readable (not intended to be // parsed) OS version information, like e.g. reported by `ver` or // `lsb_release -a` commands. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Microsoft Windows [Version 10.0.18363.778]", "Ubuntu 18.04.1 LTS" OSDescriptionKey = attribute.Key("os.description") // OSNameKey is the attribute Key conforming to the "os.name" semantic // conventions. It represents the human readable operating system name. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "iOS", "Android", "Ubuntu" OSNameKey = attribute.Key("os.name") // OSTypeKey is the attribute Key conforming to the "os.type" semantic // conventions. It represents the operating system type. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: OSTypeKey = attribute.Key("os.type") // OSVersionKey is the attribute Key conforming to the "os.version" semantic // conventions. It represents the version string of the operating system as // defined in [Version Attributes]. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "14.2.1", "18.04.1" // // [Version Attributes]: /docs/resource/README.md#version-attributes OSVersionKey = attribute.Key("os.version") ) // OSBuildID returns an attribute KeyValue conforming to the "os.build_id" // semantic conventions. It represents the unique identifier for a particular // build or compilation of the operating system. func OSBuildID(val string) attribute.KeyValue { return OSBuildIDKey.String(val) } // OSDescription returns an attribute KeyValue conforming to the "os.description" // semantic conventions. It represents the human readable (not intended to be // parsed) OS version information, like e.g. reported by `ver` or // `lsb_release -a` commands. func OSDescription(val string) attribute.KeyValue { return OSDescriptionKey.String(val) } // OSName returns an attribute KeyValue conforming to the "os.name" semantic // conventions. It represents the human readable operating system name. func OSName(val string) attribute.KeyValue { return OSNameKey.String(val) } // OSVersion returns an attribute KeyValue conforming to the "os.version" // semantic conventions. It represents the version string of the operating system // as defined in [Version Attributes]. // // [Version Attributes]: /docs/resource/README.md#version-attributes func OSVersion(val string) attribute.KeyValue { return OSVersionKey.String(val) } // Enum values for os.type var ( // Microsoft Windows // Stability: development OSTypeWindows = OSTypeKey.String("windows") // Linux // Stability: development OSTypeLinux = OSTypeKey.String("linux") // Apple Darwin // Stability: development OSTypeDarwin = OSTypeKey.String("darwin") // FreeBSD // Stability: development OSTypeFreeBSD = OSTypeKey.String("freebsd") // NetBSD // Stability: development OSTypeNetBSD = OSTypeKey.String("netbsd") // OpenBSD // Stability: development OSTypeOpenBSD = OSTypeKey.String("openbsd") // DragonFly BSD // Stability: development OSTypeDragonflyBSD = OSTypeKey.String("dragonflybsd") // HP-UX (Hewlett Packard Unix) // Stability: development OSTypeHPUX = OSTypeKey.String("hpux") // AIX (Advanced Interactive eXecutive) // Stability: development OSTypeAIX = OSTypeKey.String("aix") // SunOS, Oracle Solaris // Stability: development OSTypeSolaris = OSTypeKey.String("solaris") // IBM z/OS // Stability: development OSTypeZOS = OSTypeKey.String("zos") ) // Namespace: otel const ( // OTelComponentNameKey is the attribute Key conforming to the // "otel.component.name" semantic conventions. It represents a name uniquely // identifying the instance of the OpenTelemetry component within its containing // SDK instance. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "otlp_grpc_span_exporter/0", "custom-name" // Note: Implementations SHOULD ensure a low cardinality for this attribute, // even across application or SDK restarts. // E.g. implementations MUST NOT use UUIDs as values for this attribute. // // Implementations MAY achieve these goals by following a // `/` pattern, e.g. // `batching_span_processor/0`. // Hereby `otel.component.type` refers to the corresponding attribute value of // the component. // // The value of `instance-counter` MAY be automatically assigned by the // component and uniqueness within the enclosing SDK instance MUST be // guaranteed. // For example, `` MAY be implemented by using a monotonically // increasing counter (starting with `0`), which is incremented every time an // instance of the given component type is started. // // With this implementation, for example the first Batching Span Processor would // have `batching_span_processor/0` // as `otel.component.name`, the second one `batching_span_processor/1` and so // on. // These values will therefore be reused in the case of an application restart. OTelComponentNameKey = attribute.Key("otel.component.name") // OTelComponentTypeKey is the attribute Key conforming to the // "otel.component.type" semantic conventions. It represents a name identifying // the type of the OpenTelemetry component. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "batching_span_processor", "com.example.MySpanExporter" // Note: If none of the standardized values apply, implementations SHOULD use // the language-defined name of the type. // E.g. for Java the fully qualified classname SHOULD be used in this case. OTelComponentTypeKey = attribute.Key("otel.component.type") // OTelScopeNameKey is the attribute Key conforming to the "otel.scope.name" // semantic conventions. It represents the name of the instrumentation scope - ( // `InstrumentationScope.Name` in OTLP). // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "io.opentelemetry.contrib.mongodb" OTelScopeNameKey = attribute.Key("otel.scope.name") // OTelScopeSchemaURLKey is the attribute Key conforming to the // "otel.scope.schema_url" semantic conventions. It represents the schema URL of // the instrumentation scope. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "https://opentelemetry.io/schemas/1.31.0" OTelScopeSchemaURLKey = attribute.Key("otel.scope.schema_url") // OTelScopeVersionKey is the attribute Key conforming to the // "otel.scope.version" semantic conventions. It represents the version of the // instrumentation scope - (`InstrumentationScope.Version` in OTLP). // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "1.0.0" OTelScopeVersionKey = attribute.Key("otel.scope.version") // OTelSpanParentOriginKey is the attribute Key conforming to the // "otel.span.parent.origin" semantic conventions. It represents the determines // whether the span has a parent span, and if so, // [whether it is a remote parent]. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // // [whether it is a remote parent]: https://opentelemetry.io/docs/specs/otel/trace/api/#isremote OTelSpanParentOriginKey = attribute.Key("otel.span.parent.origin") // OTelSpanSamplingResultKey is the attribute Key conforming to the // "otel.span.sampling_result" semantic conventions. It represents the result // value of the sampler for this span. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: OTelSpanSamplingResultKey = attribute.Key("otel.span.sampling_result") // OTelStatusCodeKey is the attribute Key conforming to the "otel.status_code" // semantic conventions. It represents the name of the code, either "OK" or // "ERROR". MUST NOT be set if the status code is UNSET. // // Type: Enum // RequirementLevel: Recommended // Stability: Stable // // Examples: OTelStatusCodeKey = attribute.Key("otel.status_code") // OTelStatusDescriptionKey is the attribute Key conforming to the // "otel.status_description" semantic conventions. It represents the description // of the Status if it has a value, otherwise not set. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "resource not found" OTelStatusDescriptionKey = attribute.Key("otel.status_description") ) // OTelComponentName returns an attribute KeyValue conforming to the // "otel.component.name" semantic conventions. It represents a name uniquely // identifying the instance of the OpenTelemetry component within its containing // SDK instance. func OTelComponentName(val string) attribute.KeyValue { return OTelComponentNameKey.String(val) } // OTelScopeName returns an attribute KeyValue conforming to the // "otel.scope.name" semantic conventions. It represents the name of the // instrumentation scope - (`InstrumentationScope.Name` in OTLP). func OTelScopeName(val string) attribute.KeyValue { return OTelScopeNameKey.String(val) } // OTelScopeSchemaURL returns an attribute KeyValue conforming to the // "otel.scope.schema_url" semantic conventions. It represents the schema URL of // the instrumentation scope. func OTelScopeSchemaURL(val string) attribute.KeyValue { return OTelScopeSchemaURLKey.String(val) } // OTelScopeVersion returns an attribute KeyValue conforming to the // "otel.scope.version" semantic conventions. It represents the version of the // instrumentation scope - (`InstrumentationScope.Version` in OTLP). func OTelScopeVersion(val string) attribute.KeyValue { return OTelScopeVersionKey.String(val) } // OTelStatusDescription returns an attribute KeyValue conforming to the // "otel.status_description" semantic conventions. It represents the description // of the Status if it has a value, otherwise not set. func OTelStatusDescription(val string) attribute.KeyValue { return OTelStatusDescriptionKey.String(val) } // Enum values for otel.component.type var ( // The builtin SDK batching span processor // // Stability: development OTelComponentTypeBatchingSpanProcessor = OTelComponentTypeKey.String("batching_span_processor") // The builtin SDK simple span processor // // Stability: development OTelComponentTypeSimpleSpanProcessor = OTelComponentTypeKey.String("simple_span_processor") // The builtin SDK batching log record processor // // Stability: development OTelComponentTypeBatchingLogProcessor = OTelComponentTypeKey.String("batching_log_processor") // The builtin SDK simple log record processor // // Stability: development OTelComponentTypeSimpleLogProcessor = OTelComponentTypeKey.String("simple_log_processor") // OTLP span exporter over gRPC with protobuf serialization // // Stability: development OTelComponentTypeOtlpGRPCSpanExporter = OTelComponentTypeKey.String("otlp_grpc_span_exporter") // OTLP span exporter over HTTP with protobuf serialization // // Stability: development OTelComponentTypeOtlpHTTPSpanExporter = OTelComponentTypeKey.String("otlp_http_span_exporter") // OTLP span exporter over HTTP with JSON serialization // // Stability: development OTelComponentTypeOtlpHTTPJSONSpanExporter = OTelComponentTypeKey.String("otlp_http_json_span_exporter") // Zipkin span exporter over HTTP // // Stability: development OTelComponentTypeZipkinHTTPSpanExporter = OTelComponentTypeKey.String("zipkin_http_span_exporter") // OTLP log record exporter over gRPC with protobuf serialization // // Stability: development OTelComponentTypeOtlpGRPCLogExporter = OTelComponentTypeKey.String("otlp_grpc_log_exporter") // OTLP log record exporter over HTTP with protobuf serialization // // Stability: development OTelComponentTypeOtlpHTTPLogExporter = OTelComponentTypeKey.String("otlp_http_log_exporter") // OTLP log record exporter over HTTP with JSON serialization // // Stability: development OTelComponentTypeOtlpHTTPJSONLogExporter = OTelComponentTypeKey.String("otlp_http_json_log_exporter") // The builtin SDK periodically exporting metric reader // // Stability: development OTelComponentTypePeriodicMetricReader = OTelComponentTypeKey.String("periodic_metric_reader") // OTLP metric exporter over gRPC with protobuf serialization // // Stability: development OTelComponentTypeOtlpGRPCMetricExporter = OTelComponentTypeKey.String("otlp_grpc_metric_exporter") // OTLP metric exporter over HTTP with protobuf serialization // // Stability: development OTelComponentTypeOtlpHTTPMetricExporter = OTelComponentTypeKey.String("otlp_http_metric_exporter") // OTLP metric exporter over HTTP with JSON serialization // // Stability: development OTelComponentTypeOtlpHTTPJSONMetricExporter = OTelComponentTypeKey.String("otlp_http_json_metric_exporter") // Prometheus metric exporter over HTTP with the default text-based format // // Stability: development OTelComponentTypePrometheusHTTPTextMetricExporter = OTelComponentTypeKey.String("prometheus_http_text_metric_exporter") ) // Enum values for otel.span.parent.origin var ( // The span does not have a parent, it is a root span // Stability: development OTelSpanParentOriginNone = OTelSpanParentOriginKey.String("none") // The span has a parent and the parent's span context [isRemote()] is false // Stability: development // // [isRemote()]: https://opentelemetry.io/docs/specs/otel/trace/api/#isremote OTelSpanParentOriginLocal = OTelSpanParentOriginKey.String("local") // The span has a parent and the parent's span context [isRemote()] is true // Stability: development // // [isRemote()]: https://opentelemetry.io/docs/specs/otel/trace/api/#isremote OTelSpanParentOriginRemote = OTelSpanParentOriginKey.String("remote") ) // Enum values for otel.span.sampling_result var ( // The span is not sampled and not recording // Stability: development OTelSpanSamplingResultDrop = OTelSpanSamplingResultKey.String("DROP") // The span is not sampled, but recording // Stability: development OTelSpanSamplingResultRecordOnly = OTelSpanSamplingResultKey.String("RECORD_ONLY") // The span is sampled and recording // Stability: development OTelSpanSamplingResultRecordAndSample = OTelSpanSamplingResultKey.String("RECORD_AND_SAMPLE") ) // Enum values for otel.status_code var ( // The operation has been validated by an Application developer or Operator to // have completed successfully. // Stability: stable OTelStatusCodeOk = OTelStatusCodeKey.String("OK") // The operation contains an error. // Stability: stable OTelStatusCodeError = OTelStatusCodeKey.String("ERROR") ) // Namespace: peer const ( // PeerServiceKey is the attribute Key conforming to the "peer.service" semantic // conventions. It represents the [`service.name`] of the remote service. SHOULD // be equal to the actual `service.name` resource attribute of the remote // service if any. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: AuthTokenCache // // [`service.name`]: /docs/resource/README.md#service PeerServiceKey = attribute.Key("peer.service") ) // PeerService returns an attribute KeyValue conforming to the "peer.service" // semantic conventions. It represents the [`service.name`] of the remote // service. SHOULD be equal to the actual `service.name` resource attribute of // the remote service if any. // // [`service.name`]: /docs/resource/README.md#service func PeerService(val string) attribute.KeyValue { return PeerServiceKey.String(val) } // Namespace: process const ( // ProcessArgsCountKey is the attribute Key conforming to the // "process.args_count" semantic conventions. It represents the length of the // process.command_args array. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 4 // Note: This field can be useful for querying or performing bucket analysis on // how many arguments were provided to start a process. More arguments may be an // indication of suspicious activity. ProcessArgsCountKey = attribute.Key("process.args_count") // ProcessCommandKey is the attribute Key conforming to the "process.command" // semantic conventions. It represents the command used to launch the process // (i.e. the command name). On Linux based systems, can be set to the zeroth // string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter // extracted from `GetCommandLineW`. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "cmd/otelcol" ProcessCommandKey = attribute.Key("process.command") // ProcessCommandArgsKey is the attribute Key conforming to the // "process.command_args" semantic conventions. It represents the all the // command arguments (including the command/executable itself) as received by // the process. On Linux-based systems (and some other Unixoid systems // supporting procfs), can be set according to the list of null-delimited // strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this // would be the full argv vector passed to `main`. SHOULD NOT be collected by // default unless there is sanitization that excludes sensitive data. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "cmd/otecol", "--config=config.yaml" ProcessCommandArgsKey = attribute.Key("process.command_args") // ProcessCommandLineKey is the attribute Key conforming to the // "process.command_line" semantic conventions. It represents the full command // used to launch the process as a single string representing the full command. // On Windows, can be set to the result of `GetCommandLineW`. Do not set this if // you have to assemble it just for monitoring; use `process.command_args` // instead. SHOULD NOT be collected by default unless there is sanitization that // excludes sensitive data. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "C:\cmd\otecol --config="my directory\config.yaml"" ProcessCommandLineKey = attribute.Key("process.command_line") // ProcessContextSwitchTypeKey is the attribute Key conforming to the // "process.context_switch_type" semantic conventions. It represents the // specifies whether the context switches for this data point were voluntary or // involuntary. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: ProcessContextSwitchTypeKey = attribute.Key("process.context_switch_type") // ProcessCreationTimeKey is the attribute Key conforming to the // "process.creation.time" semantic conventions. It represents the date and time // the process was created, in ISO 8601 format. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "2023-11-21T09:25:34.853Z" ProcessCreationTimeKey = attribute.Key("process.creation.time") // ProcessExecutableBuildIDGNUKey is the attribute Key conforming to the // "process.executable.build_id.gnu" semantic conventions. It represents the GNU // build ID as found in the `.note.gnu.build-id` ELF section (hex string). // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "c89b11207f6479603b0d49bf291c092c2b719293" ProcessExecutableBuildIDGNUKey = attribute.Key("process.executable.build_id.gnu") // ProcessExecutableBuildIDGoKey is the attribute Key conforming to the // "process.executable.build_id.go" semantic conventions. It represents the Go // build ID as retrieved by `go tool buildid `. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: // "foh3mEXu7BLZjsN9pOwG/kATcXlYVCDEFouRMQed_/WwRFB1hPo9LBkekthSPG/x8hMC8emW2cCjXD0_1aY" ProcessExecutableBuildIDGoKey = attribute.Key("process.executable.build_id.go") // ProcessExecutableBuildIDHtlhashKey is the attribute Key conforming to the // "process.executable.build_id.htlhash" semantic conventions. It represents the // profiling specific build ID for executables. See the OTel specification for // Profiles for more information. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "600DCAFE4A110000F2BF38C493F5FB92" ProcessExecutableBuildIDHtlhashKey = attribute.Key("process.executable.build_id.htlhash") // ProcessExecutableNameKey is the attribute Key conforming to the // "process.executable.name" semantic conventions. It represents the name of the // process executable. On Linux based systems, this SHOULD be set to the base // name of the target of `/proc/[pid]/exe`. On Windows, this SHOULD be set to // the base name of `GetProcessImageFileNameW`. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "otelcol" ProcessExecutableNameKey = attribute.Key("process.executable.name") // ProcessExecutablePathKey is the attribute Key conforming to the // "process.executable.path" semantic conventions. It represents the full path // to the process executable. On Linux based systems, can be set to the target // of `proc/[pid]/exe`. On Windows, can be set to the result of // `GetProcessImageFileNameW`. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "/usr/bin/cmd/otelcol" ProcessExecutablePathKey = attribute.Key("process.executable.path") // ProcessExitCodeKey is the attribute Key conforming to the "process.exit.code" // semantic conventions. It represents the exit code of the process. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 127 ProcessExitCodeKey = attribute.Key("process.exit.code") // ProcessExitTimeKey is the attribute Key conforming to the "process.exit.time" // semantic conventions. It represents the date and time the process exited, in // ISO 8601 format. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "2023-11-21T09:26:12.315Z" ProcessExitTimeKey = attribute.Key("process.exit.time") // ProcessGroupLeaderPIDKey is the attribute Key conforming to the // "process.group_leader.pid" semantic conventions. It represents the PID of the // process's group leader. This is also the process group ID (PGID) of the // process. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 23 ProcessGroupLeaderPIDKey = attribute.Key("process.group_leader.pid") // ProcessInteractiveKey is the attribute Key conforming to the // "process.interactive" semantic conventions. It represents the whether the // process is connected to an interactive shell. // // Type: boolean // RequirementLevel: Recommended // Stability: Development // // Examples: ProcessInteractiveKey = attribute.Key("process.interactive") // ProcessLinuxCgroupKey is the attribute Key conforming to the // "process.linux.cgroup" semantic conventions. It represents the control group // associated with the process. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "1:name=systemd:/user.slice/user-1000.slice/session-3.scope", // "0::/user.slice/user-1000.slice/user@1000.service/tmux-spawn-0267755b-4639-4a27-90ed-f19f88e53748.scope" // Note: Control groups (cgroups) are a kernel feature used to organize and // manage process resources. This attribute provides the path(s) to the // cgroup(s) associated with the process, which should match the contents of the // [/proc/[PID]/cgroup] file. // // [/proc/[PID]/cgroup]: https://man7.org/linux/man-pages/man7/cgroups.7.html ProcessLinuxCgroupKey = attribute.Key("process.linux.cgroup") // ProcessOwnerKey is the attribute Key conforming to the "process.owner" // semantic conventions. It represents the username of the user that owns the // process. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "root" ProcessOwnerKey = attribute.Key("process.owner") // ProcessPagingFaultTypeKey is the attribute Key conforming to the // "process.paging.fault_type" semantic conventions. It represents the type of // page fault for this data point. Type `major` is for major/hard page faults, // and `minor` is for minor/soft page faults. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: ProcessPagingFaultTypeKey = attribute.Key("process.paging.fault_type") // ProcessParentPIDKey is the attribute Key conforming to the // "process.parent_pid" semantic conventions. It represents the parent Process // identifier (PPID). // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 111 ProcessParentPIDKey = attribute.Key("process.parent_pid") // ProcessPIDKey is the attribute Key conforming to the "process.pid" semantic // conventions. It represents the process identifier (PID). // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 1234 ProcessPIDKey = attribute.Key("process.pid") // ProcessRealUserIDKey is the attribute Key conforming to the // "process.real_user.id" semantic conventions. It represents the real user ID // (RUID) of the process. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 1000 ProcessRealUserIDKey = attribute.Key("process.real_user.id") // ProcessRealUserNameKey is the attribute Key conforming to the // "process.real_user.name" semantic conventions. It represents the username of // the real user of the process. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "operator" ProcessRealUserNameKey = attribute.Key("process.real_user.name") // ProcessRuntimeDescriptionKey is the attribute Key conforming to the // "process.runtime.description" semantic conventions. It represents an // additional description about the runtime of the process, for example a // specific vendor customization of the runtime environment. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0 ProcessRuntimeDescriptionKey = attribute.Key("process.runtime.description") // ProcessRuntimeNameKey is the attribute Key conforming to the // "process.runtime.name" semantic conventions. It represents the name of the // runtime of this process. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "OpenJDK Runtime Environment" ProcessRuntimeNameKey = attribute.Key("process.runtime.name") // ProcessRuntimeVersionKey is the attribute Key conforming to the // "process.runtime.version" semantic conventions. It represents the version of // the runtime of this process, as returned by the runtime without modification. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: 14.0.2 ProcessRuntimeVersionKey = attribute.Key("process.runtime.version") // ProcessSavedUserIDKey is the attribute Key conforming to the // "process.saved_user.id" semantic conventions. It represents the saved user ID // (SUID) of the process. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 1002 ProcessSavedUserIDKey = attribute.Key("process.saved_user.id") // ProcessSavedUserNameKey is the attribute Key conforming to the // "process.saved_user.name" semantic conventions. It represents the username of // the saved user. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "operator" ProcessSavedUserNameKey = attribute.Key("process.saved_user.name") // ProcessSessionLeaderPIDKey is the attribute Key conforming to the // "process.session_leader.pid" semantic conventions. It represents the PID of // the process's session leader. This is also the session ID (SID) of the // process. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 14 ProcessSessionLeaderPIDKey = attribute.Key("process.session_leader.pid") // ProcessTitleKey is the attribute Key conforming to the "process.title" // semantic conventions. It represents the process title (proctitle). // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "cat /etc/hostname", "xfce4-session", "bash" // Note: In many Unix-like systems, process title (proctitle), is the string // that represents the name or command line of a running process, displayed by // system monitoring tools like ps, top, and htop. ProcessTitleKey = attribute.Key("process.title") // ProcessUserIDKey is the attribute Key conforming to the "process.user.id" // semantic conventions. It represents the effective user ID (EUID) of the // process. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 1001 ProcessUserIDKey = attribute.Key("process.user.id") // ProcessUserNameKey is the attribute Key conforming to the "process.user.name" // semantic conventions. It represents the username of the effective user of the // process. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "root" ProcessUserNameKey = attribute.Key("process.user.name") // ProcessVpidKey is the attribute Key conforming to the "process.vpid" semantic // conventions. It represents the virtual process identifier. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 12 // Note: The process ID within a PID namespace. This is not necessarily unique // across all processes on the host but it is unique within the process // namespace that the process exists within. ProcessVpidKey = attribute.Key("process.vpid") // ProcessWorkingDirectoryKey is the attribute Key conforming to the // "process.working_directory" semantic conventions. It represents the working // directory of the process. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "/root" ProcessWorkingDirectoryKey = attribute.Key("process.working_directory") ) // ProcessArgsCount returns an attribute KeyValue conforming to the // "process.args_count" semantic conventions. It represents the length of the // process.command_args array. func ProcessArgsCount(val int) attribute.KeyValue { return ProcessArgsCountKey.Int(val) } // ProcessCommand returns an attribute KeyValue conforming to the // "process.command" semantic conventions. It represents the command used to // launch the process (i.e. the command name). On Linux based systems, can be set // to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the // first parameter extracted from `GetCommandLineW`. func ProcessCommand(val string) attribute.KeyValue { return ProcessCommandKey.String(val) } // ProcessCommandArgs returns an attribute KeyValue conforming to the // "process.command_args" semantic conventions. It represents the all the command // arguments (including the command/executable itself) as received by the // process. On Linux-based systems (and some other Unixoid systems supporting // procfs), can be set according to the list of null-delimited strings extracted // from `proc/[pid]/cmdline`. For libc-based executables, this would be the full // argv vector passed to `main`. SHOULD NOT be collected by default unless there // is sanitization that excludes sensitive data. func ProcessCommandArgs(val ...string) attribute.KeyValue { return ProcessCommandArgsKey.StringSlice(val) } // ProcessCommandLine returns an attribute KeyValue conforming to the // "process.command_line" semantic conventions. It represents the full command // used to launch the process as a single string representing the full command. // On Windows, can be set to the result of `GetCommandLineW`. Do not set this if // you have to assemble it just for monitoring; use `process.command_args` // instead. SHOULD NOT be collected by default unless there is sanitization that // excludes sensitive data. func ProcessCommandLine(val string) attribute.KeyValue { return ProcessCommandLineKey.String(val) } // ProcessCreationTime returns an attribute KeyValue conforming to the // "process.creation.time" semantic conventions. It represents the date and time // the process was created, in ISO 8601 format. func ProcessCreationTime(val string) attribute.KeyValue { return ProcessCreationTimeKey.String(val) } // ProcessEnvironmentVariable returns an attribute KeyValue conforming to the // "process.environment_variable" semantic conventions. It represents the process // environment variables, `` being the environment variable name, the value // being the environment variable value. func ProcessEnvironmentVariable(key string, val string) attribute.KeyValue { return attribute.String("process.environment_variable."+key, val) } // ProcessExecutableBuildIDGNU returns an attribute KeyValue conforming to the // "process.executable.build_id.gnu" semantic conventions. It represents the GNU // build ID as found in the `.note.gnu.build-id` ELF section (hex string). func ProcessExecutableBuildIDGNU(val string) attribute.KeyValue { return ProcessExecutableBuildIDGNUKey.String(val) } // ProcessExecutableBuildIDGo returns an attribute KeyValue conforming to the // "process.executable.build_id.go" semantic conventions. It represents the Go // build ID as retrieved by `go tool buildid `. func ProcessExecutableBuildIDGo(val string) attribute.KeyValue { return ProcessExecutableBuildIDGoKey.String(val) } // ProcessExecutableBuildIDHtlhash returns an attribute KeyValue conforming to // the "process.executable.build_id.htlhash" semantic conventions. It represents // the profiling specific build ID for executables. See the OTel specification // for Profiles for more information. func ProcessExecutableBuildIDHtlhash(val string) attribute.KeyValue { return ProcessExecutableBuildIDHtlhashKey.String(val) } // ProcessExecutableName returns an attribute KeyValue conforming to the // "process.executable.name" semantic conventions. It represents the name of the // process executable. On Linux based systems, this SHOULD be set to the base // name of the target of `/proc/[pid]/exe`. On Windows, this SHOULD be set to the // base name of `GetProcessImageFileNameW`. func ProcessExecutableName(val string) attribute.KeyValue { return ProcessExecutableNameKey.String(val) } // ProcessExecutablePath returns an attribute KeyValue conforming to the // "process.executable.path" semantic conventions. It represents the full path to // the process executable. On Linux based systems, can be set to the target of // `proc/[pid]/exe`. On Windows, can be set to the result of // `GetProcessImageFileNameW`. func ProcessExecutablePath(val string) attribute.KeyValue { return ProcessExecutablePathKey.String(val) } // ProcessExitCode returns an attribute KeyValue conforming to the // "process.exit.code" semantic conventions. It represents the exit code of the // process. func ProcessExitCode(val int) attribute.KeyValue { return ProcessExitCodeKey.Int(val) } // ProcessExitTime returns an attribute KeyValue conforming to the // "process.exit.time" semantic conventions. It represents the date and time the // process exited, in ISO 8601 format. func ProcessExitTime(val string) attribute.KeyValue { return ProcessExitTimeKey.String(val) } // ProcessGroupLeaderPID returns an attribute KeyValue conforming to the // "process.group_leader.pid" semantic conventions. It represents the PID of the // process's group leader. This is also the process group ID (PGID) of the // process. func ProcessGroupLeaderPID(val int) attribute.KeyValue { return ProcessGroupLeaderPIDKey.Int(val) } // ProcessInteractive returns an attribute KeyValue conforming to the // "process.interactive" semantic conventions. It represents the whether the // process is connected to an interactive shell. func ProcessInteractive(val bool) attribute.KeyValue { return ProcessInteractiveKey.Bool(val) } // ProcessLinuxCgroup returns an attribute KeyValue conforming to the // "process.linux.cgroup" semantic conventions. It represents the control group // associated with the process. func ProcessLinuxCgroup(val string) attribute.KeyValue { return ProcessLinuxCgroupKey.String(val) } // ProcessOwner returns an attribute KeyValue conforming to the "process.owner" // semantic conventions. It represents the username of the user that owns the // process. func ProcessOwner(val string) attribute.KeyValue { return ProcessOwnerKey.String(val) } // ProcessParentPID returns an attribute KeyValue conforming to the // "process.parent_pid" semantic conventions. It represents the parent Process // identifier (PPID). func ProcessParentPID(val int) attribute.KeyValue { return ProcessParentPIDKey.Int(val) } // ProcessPID returns an attribute KeyValue conforming to the "process.pid" // semantic conventions. It represents the process identifier (PID). func ProcessPID(val int) attribute.KeyValue { return ProcessPIDKey.Int(val) } // ProcessRealUserID returns an attribute KeyValue conforming to the // "process.real_user.id" semantic conventions. It represents the real user ID // (RUID) of the process. func ProcessRealUserID(val int) attribute.KeyValue { return ProcessRealUserIDKey.Int(val) } // ProcessRealUserName returns an attribute KeyValue conforming to the // "process.real_user.name" semantic conventions. It represents the username of // the real user of the process. func ProcessRealUserName(val string) attribute.KeyValue { return ProcessRealUserNameKey.String(val) } // ProcessRuntimeDescription returns an attribute KeyValue conforming to the // "process.runtime.description" semantic conventions. It represents an // additional description about the runtime of the process, for example a // specific vendor customization of the runtime environment. func ProcessRuntimeDescription(val string) attribute.KeyValue { return ProcessRuntimeDescriptionKey.String(val) } // ProcessRuntimeName returns an attribute KeyValue conforming to the // "process.runtime.name" semantic conventions. It represents the name of the // runtime of this process. func ProcessRuntimeName(val string) attribute.KeyValue { return ProcessRuntimeNameKey.String(val) } // ProcessRuntimeVersion returns an attribute KeyValue conforming to the // "process.runtime.version" semantic conventions. It represents the version of // the runtime of this process, as returned by the runtime without modification. func ProcessRuntimeVersion(val string) attribute.KeyValue { return ProcessRuntimeVersionKey.String(val) } // ProcessSavedUserID returns an attribute KeyValue conforming to the // "process.saved_user.id" semantic conventions. It represents the saved user ID // (SUID) of the process. func ProcessSavedUserID(val int) attribute.KeyValue { return ProcessSavedUserIDKey.Int(val) } // ProcessSavedUserName returns an attribute KeyValue conforming to the // "process.saved_user.name" semantic conventions. It represents the username of // the saved user. func ProcessSavedUserName(val string) attribute.KeyValue { return ProcessSavedUserNameKey.String(val) } // ProcessSessionLeaderPID returns an attribute KeyValue conforming to the // "process.session_leader.pid" semantic conventions. It represents the PID of // the process's session leader. This is also the session ID (SID) of the // process. func ProcessSessionLeaderPID(val int) attribute.KeyValue { return ProcessSessionLeaderPIDKey.Int(val) } // ProcessTitle returns an attribute KeyValue conforming to the "process.title" // semantic conventions. It represents the process title (proctitle). func ProcessTitle(val string) attribute.KeyValue { return ProcessTitleKey.String(val) } // ProcessUserID returns an attribute KeyValue conforming to the // "process.user.id" semantic conventions. It represents the effective user ID // (EUID) of the process. func ProcessUserID(val int) attribute.KeyValue { return ProcessUserIDKey.Int(val) } // ProcessUserName returns an attribute KeyValue conforming to the // "process.user.name" semantic conventions. It represents the username of the // effective user of the process. func ProcessUserName(val string) attribute.KeyValue { return ProcessUserNameKey.String(val) } // ProcessVpid returns an attribute KeyValue conforming to the "process.vpid" // semantic conventions. It represents the virtual process identifier. func ProcessVpid(val int) attribute.KeyValue { return ProcessVpidKey.Int(val) } // ProcessWorkingDirectory returns an attribute KeyValue conforming to the // "process.working_directory" semantic conventions. It represents the working // directory of the process. func ProcessWorkingDirectory(val string) attribute.KeyValue { return ProcessWorkingDirectoryKey.String(val) } // Enum values for process.context_switch_type var ( // voluntary // Stability: development ProcessContextSwitchTypeVoluntary = ProcessContextSwitchTypeKey.String("voluntary") // involuntary // Stability: development ProcessContextSwitchTypeInvoluntary = ProcessContextSwitchTypeKey.String("involuntary") ) // Enum values for process.paging.fault_type var ( // major // Stability: development ProcessPagingFaultTypeMajor = ProcessPagingFaultTypeKey.String("major") // minor // Stability: development ProcessPagingFaultTypeMinor = ProcessPagingFaultTypeKey.String("minor") ) // Namespace: profile const ( // ProfileFrameTypeKey is the attribute Key conforming to the // "profile.frame.type" semantic conventions. It represents the describes the // interpreter or compiler of a single frame. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "cpython" ProfileFrameTypeKey = attribute.Key("profile.frame.type") ) // Enum values for profile.frame.type var ( // [.NET] // // Stability: development // // [.NET]: https://wikipedia.org/wiki/.NET ProfileFrameTypeDotnet = ProfileFrameTypeKey.String("dotnet") // [JVM] // // Stability: development // // [JVM]: https://wikipedia.org/wiki/Java_virtual_machine ProfileFrameTypeJVM = ProfileFrameTypeKey.String("jvm") // [Kernel] // // Stability: development // // [Kernel]: https://wikipedia.org/wiki/Kernel_(operating_system) ProfileFrameTypeKernel = ProfileFrameTypeKey.String("kernel") // Can be one of but not limited to [C], [C++], [Go] or [Rust]. If possible, a // more precise value MUST be used. // // Stability: development // // [C]: https://wikipedia.org/wiki/C_(programming_language) // [C++]: https://wikipedia.org/wiki/C%2B%2B // [Go]: https://wikipedia.org/wiki/Go_(programming_language) // [Rust]: https://wikipedia.org/wiki/Rust_(programming_language) ProfileFrameTypeNative = ProfileFrameTypeKey.String("native") // [Perl] // // Stability: development // // [Perl]: https://wikipedia.org/wiki/Perl ProfileFrameTypePerl = ProfileFrameTypeKey.String("perl") // [PHP] // // Stability: development // // [PHP]: https://wikipedia.org/wiki/PHP ProfileFrameTypePHP = ProfileFrameTypeKey.String("php") // [Python] // // Stability: development // // [Python]: https://wikipedia.org/wiki/Python_(programming_language) ProfileFrameTypeCpython = ProfileFrameTypeKey.String("cpython") // [Ruby] // // Stability: development // // [Ruby]: https://wikipedia.org/wiki/Ruby_(programming_language) ProfileFrameTypeRuby = ProfileFrameTypeKey.String("ruby") // [V8JS] // // Stability: development // // [V8JS]: https://wikipedia.org/wiki/V8_(JavaScript_engine) ProfileFrameTypeV8JS = ProfileFrameTypeKey.String("v8js") // [Erlang] // // Stability: development // // [Erlang]: https://en.wikipedia.org/wiki/BEAM_(Erlang_virtual_machine) ProfileFrameTypeBeam = ProfileFrameTypeKey.String("beam") // [Go], // // Stability: development // // [Go]: https://wikipedia.org/wiki/Go_(programming_language) ProfileFrameTypeGo = ProfileFrameTypeKey.String("go") // [Rust] // // Stability: development // // [Rust]: https://wikipedia.org/wiki/Rust_(programming_language) ProfileFrameTypeRust = ProfileFrameTypeKey.String("rust") ) // Namespace: rpc const ( // RPCConnectRPCErrorCodeKey is the attribute Key conforming to the // "rpc.connect_rpc.error_code" semantic conventions. It represents the // [error codes] of the Connect request. Error codes are always string values. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // // [error codes]: https://connectrpc.com//docs/protocol/#error-codes RPCConnectRPCErrorCodeKey = attribute.Key("rpc.connect_rpc.error_code") // RPCGRPCStatusCodeKey is the attribute Key conforming to the // "rpc.grpc.status_code" semantic conventions. It represents the // [numeric status code] of the gRPC request. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // // [numeric status code]: https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md RPCGRPCStatusCodeKey = attribute.Key("rpc.grpc.status_code") // RPCJSONRPCErrorCodeKey is the attribute Key conforming to the // "rpc.jsonrpc.error_code" semantic conventions. It represents the `error.code` // property of response if it is an error response. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: -32700, 100 RPCJSONRPCErrorCodeKey = attribute.Key("rpc.jsonrpc.error_code") // RPCJSONRPCErrorMessageKey is the attribute Key conforming to the // "rpc.jsonrpc.error_message" semantic conventions. It represents the // `error.message` property of response if it is an error response. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Parse error", "User already exists" RPCJSONRPCErrorMessageKey = attribute.Key("rpc.jsonrpc.error_message") // RPCJSONRPCRequestIDKey is the attribute Key conforming to the // "rpc.jsonrpc.request_id" semantic conventions. It represents the `id` // property of request or response. Since protocol allows id to be int, string, // `null` or missing (for notifications), value is expected to be cast to string // for simplicity. Use empty string in case of `null` value. Omit entirely if // this is a notification. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "10", "request-7", "" RPCJSONRPCRequestIDKey = attribute.Key("rpc.jsonrpc.request_id") // RPCJSONRPCVersionKey is the attribute Key conforming to the // "rpc.jsonrpc.version" semantic conventions. It represents the protocol // version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 // doesn't specify this, the value can be omitted. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "2.0", "1.0" RPCJSONRPCVersionKey = attribute.Key("rpc.jsonrpc.version") // RPCMessageCompressedSizeKey is the attribute Key conforming to the // "rpc.message.compressed_size" semantic conventions. It represents the // compressed size of the message in bytes. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: RPCMessageCompressedSizeKey = attribute.Key("rpc.message.compressed_size") // RPCMessageIDKey is the attribute Key conforming to the "rpc.message.id" // semantic conventions. It MUST be calculated as two different counters // starting from `1` one for sent messages and one for received message.. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: // Note: This way we guarantee that the values will be consistent between // different implementations. RPCMessageIDKey = attribute.Key("rpc.message.id") // RPCMessageTypeKey is the attribute Key conforming to the "rpc.message.type" // semantic conventions. It represents the whether this is a received or sent // message. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: RPCMessageTypeKey = attribute.Key("rpc.message.type") // RPCMessageUncompressedSizeKey is the attribute Key conforming to the // "rpc.message.uncompressed_size" semantic conventions. It represents the // uncompressed size of the message in bytes. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: RPCMessageUncompressedSizeKey = attribute.Key("rpc.message.uncompressed_size") // RPCMethodKey is the attribute Key conforming to the "rpc.method" semantic // conventions. It represents the name of the (logical) method being called, // must be equal to the $method part in the span name. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: exampleMethod // Note: This is the logical name of the method from the RPC interface // perspective, which can be different from the name of any implementing // method/function. The `code.function.name` attribute may be used to store the // latter (e.g., method actually executing the call on the server side, RPC // client stub method on the client side). RPCMethodKey = attribute.Key("rpc.method") // RPCServiceKey is the attribute Key conforming to the "rpc.service" semantic // conventions. It represents the full (logical) name of the service being // called, including its package name, if applicable. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: myservice.EchoService // Note: This is the logical name of the service from the RPC interface // perspective, which can be different from the name of any implementing class. // The `code.namespace` attribute may be used to store the latter (despite the // attribute name, it may include a class name; e.g., class with method actually // executing the call on the server side, RPC client stub class on the client // side). RPCServiceKey = attribute.Key("rpc.service") // RPCSystemKey is the attribute Key conforming to the "rpc.system" semantic // conventions. It represents a string identifying the remoting system. See // below for a list of well-known identifiers. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: RPCSystemKey = attribute.Key("rpc.system") ) // RPCConnectRPCRequestMetadata returns an attribute KeyValue conforming to the // "rpc.connect_rpc.request.metadata" semantic conventions. It represents the // connect request metadata, `` being the normalized Connect Metadata key // (lowercase), the value being the metadata values. func RPCConnectRPCRequestMetadata(key string, val ...string) attribute.KeyValue { return attribute.StringSlice("rpc.connect_rpc.request.metadata."+key, val) } // RPCConnectRPCResponseMetadata returns an attribute KeyValue conforming to the // "rpc.connect_rpc.response.metadata" semantic conventions. It represents the // connect response metadata, `` being the normalized Connect Metadata key // (lowercase), the value being the metadata values. func RPCConnectRPCResponseMetadata(key string, val ...string) attribute.KeyValue { return attribute.StringSlice("rpc.connect_rpc.response.metadata."+key, val) } // RPCGRPCRequestMetadata returns an attribute KeyValue conforming to the // "rpc.grpc.request.metadata" semantic conventions. It represents the gRPC // request metadata, `` being the normalized gRPC Metadata key (lowercase), // the value being the metadata values. func RPCGRPCRequestMetadata(key string, val ...string) attribute.KeyValue { return attribute.StringSlice("rpc.grpc.request.metadata."+key, val) } // RPCGRPCResponseMetadata returns an attribute KeyValue conforming to the // "rpc.grpc.response.metadata" semantic conventions. It represents the gRPC // response metadata, `` being the normalized gRPC Metadata key (lowercase), // the value being the metadata values. func RPCGRPCResponseMetadata(key string, val ...string) attribute.KeyValue { return attribute.StringSlice("rpc.grpc.response.metadata."+key, val) } // RPCJSONRPCErrorCode returns an attribute KeyValue conforming to the // "rpc.jsonrpc.error_code" semantic conventions. It represents the `error.code` // property of response if it is an error response. func RPCJSONRPCErrorCode(val int) attribute.KeyValue { return RPCJSONRPCErrorCodeKey.Int(val) } // RPCJSONRPCErrorMessage returns an attribute KeyValue conforming to the // "rpc.jsonrpc.error_message" semantic conventions. It represents the // `error.message` property of response if it is an error response. func RPCJSONRPCErrorMessage(val string) attribute.KeyValue { return RPCJSONRPCErrorMessageKey.String(val) } // RPCJSONRPCRequestID returns an attribute KeyValue conforming to the // "rpc.jsonrpc.request_id" semantic conventions. It represents the `id` property // of request or response. Since protocol allows id to be int, string, `null` or // missing (for notifications), value is expected to be cast to string for // simplicity. Use empty string in case of `null` value. Omit entirely if this is // a notification. func RPCJSONRPCRequestID(val string) attribute.KeyValue { return RPCJSONRPCRequestIDKey.String(val) } // RPCJSONRPCVersion returns an attribute KeyValue conforming to the // "rpc.jsonrpc.version" semantic conventions. It represents the protocol version // as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 doesn't // specify this, the value can be omitted. func RPCJSONRPCVersion(val string) attribute.KeyValue { return RPCJSONRPCVersionKey.String(val) } // RPCMessageCompressedSize returns an attribute KeyValue conforming to the // "rpc.message.compressed_size" semantic conventions. It represents the // compressed size of the message in bytes. func RPCMessageCompressedSize(val int) attribute.KeyValue { return RPCMessageCompressedSizeKey.Int(val) } // RPCMessageID returns an attribute KeyValue conforming to the "rpc.message.id" // semantic conventions. It MUST be calculated as two different counters starting // from `1` one for sent messages and one for received message.. func RPCMessageID(val int) attribute.KeyValue { return RPCMessageIDKey.Int(val) } // RPCMessageUncompressedSize returns an attribute KeyValue conforming to the // "rpc.message.uncompressed_size" semantic conventions. It represents the // uncompressed size of the message in bytes. func RPCMessageUncompressedSize(val int) attribute.KeyValue { return RPCMessageUncompressedSizeKey.Int(val) } // RPCMethod returns an attribute KeyValue conforming to the "rpc.method" // semantic conventions. It represents the name of the (logical) method being // called, must be equal to the $method part in the span name. func RPCMethod(val string) attribute.KeyValue { return RPCMethodKey.String(val) } // RPCService returns an attribute KeyValue conforming to the "rpc.service" // semantic conventions. It represents the full (logical) name of the service // being called, including its package name, if applicable. func RPCService(val string) attribute.KeyValue { return RPCServiceKey.String(val) } // Enum values for rpc.connect_rpc.error_code var ( // cancelled // Stability: development RPCConnectRPCErrorCodeCancelled = RPCConnectRPCErrorCodeKey.String("cancelled") // unknown // Stability: development RPCConnectRPCErrorCodeUnknown = RPCConnectRPCErrorCodeKey.String("unknown") // invalid_argument // Stability: development RPCConnectRPCErrorCodeInvalidArgument = RPCConnectRPCErrorCodeKey.String("invalid_argument") // deadline_exceeded // Stability: development RPCConnectRPCErrorCodeDeadlineExceeded = RPCConnectRPCErrorCodeKey.String("deadline_exceeded") // not_found // Stability: development RPCConnectRPCErrorCodeNotFound = RPCConnectRPCErrorCodeKey.String("not_found") // already_exists // Stability: development RPCConnectRPCErrorCodeAlreadyExists = RPCConnectRPCErrorCodeKey.String("already_exists") // permission_denied // Stability: development RPCConnectRPCErrorCodePermissionDenied = RPCConnectRPCErrorCodeKey.String("permission_denied") // resource_exhausted // Stability: development RPCConnectRPCErrorCodeResourceExhausted = RPCConnectRPCErrorCodeKey.String("resource_exhausted") // failed_precondition // Stability: development RPCConnectRPCErrorCodeFailedPrecondition = RPCConnectRPCErrorCodeKey.String("failed_precondition") // aborted // Stability: development RPCConnectRPCErrorCodeAborted = RPCConnectRPCErrorCodeKey.String("aborted") // out_of_range // Stability: development RPCConnectRPCErrorCodeOutOfRange = RPCConnectRPCErrorCodeKey.String("out_of_range") // unimplemented // Stability: development RPCConnectRPCErrorCodeUnimplemented = RPCConnectRPCErrorCodeKey.String("unimplemented") // internal // Stability: development RPCConnectRPCErrorCodeInternal = RPCConnectRPCErrorCodeKey.String("internal") // unavailable // Stability: development RPCConnectRPCErrorCodeUnavailable = RPCConnectRPCErrorCodeKey.String("unavailable") // data_loss // Stability: development RPCConnectRPCErrorCodeDataLoss = RPCConnectRPCErrorCodeKey.String("data_loss") // unauthenticated // Stability: development RPCConnectRPCErrorCodeUnauthenticated = RPCConnectRPCErrorCodeKey.String("unauthenticated") ) // Enum values for rpc.grpc.status_code var ( // OK // Stability: development RPCGRPCStatusCodeOk = RPCGRPCStatusCodeKey.Int(0) // CANCELLED // Stability: development RPCGRPCStatusCodeCancelled = RPCGRPCStatusCodeKey.Int(1) // UNKNOWN // Stability: development RPCGRPCStatusCodeUnknown = RPCGRPCStatusCodeKey.Int(2) // INVALID_ARGUMENT // Stability: development RPCGRPCStatusCodeInvalidArgument = RPCGRPCStatusCodeKey.Int(3) // DEADLINE_EXCEEDED // Stability: development RPCGRPCStatusCodeDeadlineExceeded = RPCGRPCStatusCodeKey.Int(4) // NOT_FOUND // Stability: development RPCGRPCStatusCodeNotFound = RPCGRPCStatusCodeKey.Int(5) // ALREADY_EXISTS // Stability: development RPCGRPCStatusCodeAlreadyExists = RPCGRPCStatusCodeKey.Int(6) // PERMISSION_DENIED // Stability: development RPCGRPCStatusCodePermissionDenied = RPCGRPCStatusCodeKey.Int(7) // RESOURCE_EXHAUSTED // Stability: development RPCGRPCStatusCodeResourceExhausted = RPCGRPCStatusCodeKey.Int(8) // FAILED_PRECONDITION // Stability: development RPCGRPCStatusCodeFailedPrecondition = RPCGRPCStatusCodeKey.Int(9) // ABORTED // Stability: development RPCGRPCStatusCodeAborted = RPCGRPCStatusCodeKey.Int(10) // OUT_OF_RANGE // Stability: development RPCGRPCStatusCodeOutOfRange = RPCGRPCStatusCodeKey.Int(11) // UNIMPLEMENTED // Stability: development RPCGRPCStatusCodeUnimplemented = RPCGRPCStatusCodeKey.Int(12) // INTERNAL // Stability: development RPCGRPCStatusCodeInternal = RPCGRPCStatusCodeKey.Int(13) // UNAVAILABLE // Stability: development RPCGRPCStatusCodeUnavailable = RPCGRPCStatusCodeKey.Int(14) // DATA_LOSS // Stability: development RPCGRPCStatusCodeDataLoss = RPCGRPCStatusCodeKey.Int(15) // UNAUTHENTICATED // Stability: development RPCGRPCStatusCodeUnauthenticated = RPCGRPCStatusCodeKey.Int(16) ) // Enum values for rpc.message.type var ( // sent // Stability: development RPCMessageTypeSent = RPCMessageTypeKey.String("SENT") // received // Stability: development RPCMessageTypeReceived = RPCMessageTypeKey.String("RECEIVED") ) // Enum values for rpc.system var ( // gRPC // Stability: development RPCSystemGRPC = RPCSystemKey.String("grpc") // Java RMI // Stability: development RPCSystemJavaRmi = RPCSystemKey.String("java_rmi") // .NET WCF // Stability: development RPCSystemDotnetWcf = RPCSystemKey.String("dotnet_wcf") // Apache Dubbo // Stability: development RPCSystemApacheDubbo = RPCSystemKey.String("apache_dubbo") // Connect RPC // Stability: development RPCSystemConnectRPC = RPCSystemKey.String("connect_rpc") ) // Namespace: security_rule const ( // SecurityRuleCategoryKey is the attribute Key conforming to the // "security_rule.category" semantic conventions. It represents a categorization // value keyword used by the entity using the rule for detection of this event. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Attempted Information Leak" SecurityRuleCategoryKey = attribute.Key("security_rule.category") // SecurityRuleDescriptionKey is the attribute Key conforming to the // "security_rule.description" semantic conventions. It represents the // description of the rule generating the event. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Block requests to public DNS over HTTPS / TLS protocols" SecurityRuleDescriptionKey = attribute.Key("security_rule.description") // SecurityRuleLicenseKey is the attribute Key conforming to the // "security_rule.license" semantic conventions. It represents the name of the // license under which the rule used to generate this event is made available. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Apache 2.0" SecurityRuleLicenseKey = attribute.Key("security_rule.license") // SecurityRuleNameKey is the attribute Key conforming to the // "security_rule.name" semantic conventions. It represents the name of the rule // or signature generating the event. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "BLOCK_DNS_over_TLS" SecurityRuleNameKey = attribute.Key("security_rule.name") // SecurityRuleReferenceKey is the attribute Key conforming to the // "security_rule.reference" semantic conventions. It represents the reference // URL to additional information about the rule used to generate this event. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "https://en.wikipedia.org/wiki/DNS_over_TLS" // Note: The URL can point to the vendor’s documentation about the rule. If // that’s not available, it can also be a link to a more general page // describing this type of alert. SecurityRuleReferenceKey = attribute.Key("security_rule.reference") // SecurityRuleRulesetNameKey is the attribute Key conforming to the // "security_rule.ruleset.name" semantic conventions. It represents the name of // the ruleset, policy, group, or parent category in which the rule used to // generate this event is a member. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Standard_Protocol_Filters" SecurityRuleRulesetNameKey = attribute.Key("security_rule.ruleset.name") // SecurityRuleUUIDKey is the attribute Key conforming to the // "security_rule.uuid" semantic conventions. It represents a rule ID that is // unique within the scope of a set or group of agents, observers, or other // entities using the rule for detection of this event. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "550e8400-e29b-41d4-a716-446655440000", "1100110011" SecurityRuleUUIDKey = attribute.Key("security_rule.uuid") // SecurityRuleVersionKey is the attribute Key conforming to the // "security_rule.version" semantic conventions. It represents the version / // revision of the rule being used for analysis. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "1.0.0" SecurityRuleVersionKey = attribute.Key("security_rule.version") ) // SecurityRuleCategory returns an attribute KeyValue conforming to the // "security_rule.category" semantic conventions. It represents a categorization // value keyword used by the entity using the rule for detection of this event. func SecurityRuleCategory(val string) attribute.KeyValue { return SecurityRuleCategoryKey.String(val) } // SecurityRuleDescription returns an attribute KeyValue conforming to the // "security_rule.description" semantic conventions. It represents the // description of the rule generating the event. func SecurityRuleDescription(val string) attribute.KeyValue { return SecurityRuleDescriptionKey.String(val) } // SecurityRuleLicense returns an attribute KeyValue conforming to the // "security_rule.license" semantic conventions. It represents the name of the // license under which the rule used to generate this event is made available. func SecurityRuleLicense(val string) attribute.KeyValue { return SecurityRuleLicenseKey.String(val) } // SecurityRuleName returns an attribute KeyValue conforming to the // "security_rule.name" semantic conventions. It represents the name of the rule // or signature generating the event. func SecurityRuleName(val string) attribute.KeyValue { return SecurityRuleNameKey.String(val) } // SecurityRuleReference returns an attribute KeyValue conforming to the // "security_rule.reference" semantic conventions. It represents the reference // URL to additional information about the rule used to generate this event. func SecurityRuleReference(val string) attribute.KeyValue { return SecurityRuleReferenceKey.String(val) } // SecurityRuleRulesetName returns an attribute KeyValue conforming to the // "security_rule.ruleset.name" semantic conventions. It represents the name of // the ruleset, policy, group, or parent category in which the rule used to // generate this event is a member. func SecurityRuleRulesetName(val string) attribute.KeyValue { return SecurityRuleRulesetNameKey.String(val) } // SecurityRuleUUID returns an attribute KeyValue conforming to the // "security_rule.uuid" semantic conventions. It represents a rule ID that is // unique within the scope of a set or group of agents, observers, or other // entities using the rule for detection of this event. func SecurityRuleUUID(val string) attribute.KeyValue { return SecurityRuleUUIDKey.String(val) } // SecurityRuleVersion returns an attribute KeyValue conforming to the // "security_rule.version" semantic conventions. It represents the version / // revision of the rule being used for analysis. func SecurityRuleVersion(val string) attribute.KeyValue { return SecurityRuleVersionKey.String(val) } // Namespace: server const ( // ServerAddressKey is the attribute Key conforming to the "server.address" // semantic conventions. It represents the server domain name if available // without reverse DNS lookup; otherwise, IP address or Unix domain socket name. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "example.com", "10.1.2.80", "/tmp/my.sock" // Note: When observed from the client side, and when communicating through an // intermediary, `server.address` SHOULD represent the server address behind any // intermediaries, for example proxies, if it's available. ServerAddressKey = attribute.Key("server.address") // ServerPortKey is the attribute Key conforming to the "server.port" semantic // conventions. It represents the server port number. // // Type: int // RequirementLevel: Recommended // Stability: Stable // // Examples: 80, 8080, 443 // Note: When observed from the client side, and when communicating through an // intermediary, `server.port` SHOULD represent the server port behind any // intermediaries, for example proxies, if it's available. ServerPortKey = attribute.Key("server.port") ) // ServerAddress returns an attribute KeyValue conforming to the "server.address" // semantic conventions. It represents the server domain name if available // without reverse DNS lookup; otherwise, IP address or Unix domain socket name. func ServerAddress(val string) attribute.KeyValue { return ServerAddressKey.String(val) } // ServerPort returns an attribute KeyValue conforming to the "server.port" // semantic conventions. It represents the server port number. func ServerPort(val int) attribute.KeyValue { return ServerPortKey.Int(val) } // Namespace: service const ( // ServiceInstanceIDKey is the attribute Key conforming to the // "service.instance.id" semantic conventions. It represents the string ID of // the service instance. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "627cc493-f310-47de-96bd-71410b7dec09" // Note: MUST be unique for each instance of the same // `service.namespace,service.name` pair (in other words // `service.namespace,service.name,service.instance.id` triplet MUST be globally // unique). The ID helps to // distinguish instances of the same service that exist at the same time (e.g. // instances of a horizontally scaled // service). // // Implementations, such as SDKs, are recommended to generate a random Version 1 // or Version 4 [RFC // 4122] UUID, but are free to use an inherent unique ID as // the source of // this value if stability is desirable. In that case, the ID SHOULD be used as // source of a UUID Version 5 and // SHOULD use the following UUID as the namespace: // `4d63009a-8d0f-11ee-aad7-4c796ed8e320`. // // UUIDs are typically recommended, as only an opaque value for the purposes of // identifying a service instance is // needed. Similar to what can be seen in the man page for the // [`/etc/machine-id`] file, the underlying // data, such as pod name and namespace should be treated as confidential, being // the user's choice to expose it // or not via another resource attribute. // // For applications running behind an application server (like unicorn), we do // not recommend using one identifier // for all processes participating in the application. Instead, it's recommended // each division (e.g. a worker // thread in unicorn) to have its own instance.id. // // It's not recommended for a Collector to set `service.instance.id` if it can't // unambiguously determine the // service instance that is generating that telemetry. For instance, creating an // UUID based on `pod.name` will // likely be wrong, as the Collector might not know from which container within // that pod the telemetry originated. // However, Collectors can set the `service.instance.id` if they can // unambiguously determine the service instance // for that telemetry. This is typically the case for scraping receivers, as // they know the target address and // port. // // [RFC // 4122]: https://www.ietf.org/rfc/rfc4122.txt // [`/etc/machine-id`]: https://www.freedesktop.org/software/systemd/man/latest/machine-id.html ServiceInstanceIDKey = attribute.Key("service.instance.id") // ServiceNameKey is the attribute Key conforming to the "service.name" semantic // conventions. It represents the logical name of the service. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "shoppingcart" // Note: MUST be the same for all instances of horizontally scaled services. If // the value was not specified, SDKs MUST fallback to `unknown_service:` // concatenated with [`process.executable.name`], e.g. `unknown_service:bash`. // If `process.executable.name` is not available, the value MUST be set to // `unknown_service`. // // [`process.executable.name`]: process.md ServiceNameKey = attribute.Key("service.name") // ServiceNamespaceKey is the attribute Key conforming to the // "service.namespace" semantic conventions. It represents a namespace for // `service.name`. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Shop" // Note: A string value having a meaning that helps to distinguish a group of // services, for example the team name that owns a group of services. // `service.name` is expected to be unique within the same namespace. If // `service.namespace` is not specified in the Resource then `service.name` is // expected to be unique for all services that have no explicit namespace // defined (so the empty/unspecified namespace is simply one more valid // namespace). Zero-length namespace string is assumed equal to unspecified // namespace. ServiceNamespaceKey = attribute.Key("service.namespace") // ServiceVersionKey is the attribute Key conforming to the "service.version" // semantic conventions. It represents the version string of the service API or // implementation. The format is not defined by these conventions. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "2.0.0", "a01dbef8a" ServiceVersionKey = attribute.Key("service.version") ) // ServiceInstanceID returns an attribute KeyValue conforming to the // "service.instance.id" semantic conventions. It represents the string ID of the // service instance. func ServiceInstanceID(val string) attribute.KeyValue { return ServiceInstanceIDKey.String(val) } // ServiceName returns an attribute KeyValue conforming to the "service.name" // semantic conventions. It represents the logical name of the service. func ServiceName(val string) attribute.KeyValue { return ServiceNameKey.String(val) } // ServiceNamespace returns an attribute KeyValue conforming to the // "service.namespace" semantic conventions. It represents a namespace for // `service.name`. func ServiceNamespace(val string) attribute.KeyValue { return ServiceNamespaceKey.String(val) } // ServiceVersion returns an attribute KeyValue conforming to the // "service.version" semantic conventions. It represents the version string of // the service API or implementation. The format is not defined by these // conventions. func ServiceVersion(val string) attribute.KeyValue { return ServiceVersionKey.String(val) } // Namespace: session const ( // SessionIDKey is the attribute Key conforming to the "session.id" semantic // conventions. It represents a unique id to identify a session. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: 00112233-4455-6677-8899-aabbccddeeff SessionIDKey = attribute.Key("session.id") // SessionPreviousIDKey is the attribute Key conforming to the // "session.previous_id" semantic conventions. It represents the previous // `session.id` for this user, when known. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: 00112233-4455-6677-8899-aabbccddeeff SessionPreviousIDKey = attribute.Key("session.previous_id") ) // SessionID returns an attribute KeyValue conforming to the "session.id" // semantic conventions. It represents a unique id to identify a session. func SessionID(val string) attribute.KeyValue { return SessionIDKey.String(val) } // SessionPreviousID returns an attribute KeyValue conforming to the // "session.previous_id" semantic conventions. It represents the previous // `session.id` for this user, when known. func SessionPreviousID(val string) attribute.KeyValue { return SessionPreviousIDKey.String(val) } // Namespace: signalr const ( // SignalRConnectionStatusKey is the attribute Key conforming to the // "signalr.connection.status" semantic conventions. It represents the signalR // HTTP connection closure status. // // Type: Enum // RequirementLevel: Recommended // Stability: Stable // // Examples: "app_shutdown", "timeout" SignalRConnectionStatusKey = attribute.Key("signalr.connection.status") // SignalRTransportKey is the attribute Key conforming to the // "signalr.transport" semantic conventions. It represents the // [SignalR transport type]. // // Type: Enum // RequirementLevel: Recommended // Stability: Stable // // Examples: "web_sockets", "long_polling" // // [SignalR transport type]: https://github.com/dotnet/aspnetcore/blob/main/src/SignalR/docs/specs/TransportProtocols.md SignalRTransportKey = attribute.Key("signalr.transport") ) // Enum values for signalr.connection.status var ( // The connection was closed normally. // Stability: stable SignalRConnectionStatusNormalClosure = SignalRConnectionStatusKey.String("normal_closure") // The connection was closed due to a timeout. // Stability: stable SignalRConnectionStatusTimeout = SignalRConnectionStatusKey.String("timeout") // The connection was closed because the app is shutting down. // Stability: stable SignalRConnectionStatusAppShutdown = SignalRConnectionStatusKey.String("app_shutdown") ) // Enum values for signalr.transport var ( // ServerSentEvents protocol // Stability: stable SignalRTransportServerSentEvents = SignalRTransportKey.String("server_sent_events") // LongPolling protocol // Stability: stable SignalRTransportLongPolling = SignalRTransportKey.String("long_polling") // WebSockets protocol // Stability: stable SignalRTransportWebSockets = SignalRTransportKey.String("web_sockets") ) // Namespace: source const ( // SourceAddressKey is the attribute Key conforming to the "source.address" // semantic conventions. It represents the source address - domain name if // available without reverse DNS lookup; otherwise, IP address or Unix domain // socket name. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "source.example.com", "10.1.2.80", "/tmp/my.sock" // Note: When observed from the destination side, and when communicating through // an intermediary, `source.address` SHOULD represent the source address behind // any intermediaries, for example proxies, if it's available. SourceAddressKey = attribute.Key("source.address") // SourcePortKey is the attribute Key conforming to the "source.port" semantic // conventions. It represents the source port number. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 3389, 2888 SourcePortKey = attribute.Key("source.port") ) // SourceAddress returns an attribute KeyValue conforming to the "source.address" // semantic conventions. It represents the source address - domain name if // available without reverse DNS lookup; otherwise, IP address or Unix domain // socket name. func SourceAddress(val string) attribute.KeyValue { return SourceAddressKey.String(val) } // SourcePort returns an attribute KeyValue conforming to the "source.port" // semantic conventions. It represents the source port number. func SourcePort(val int) attribute.KeyValue { return SourcePortKey.Int(val) } // Namespace: system const ( // SystemCPULogicalNumberKey is the attribute Key conforming to the // "system.cpu.logical_number" semantic conventions. It represents the // deprecated, use `cpu.logical_number` instead. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 1 SystemCPULogicalNumberKey = attribute.Key("system.cpu.logical_number") // SystemDeviceKey is the attribute Key conforming to the "system.device" // semantic conventions. It represents the device identifier. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "(identifier)" SystemDeviceKey = attribute.Key("system.device") // SystemFilesystemModeKey is the attribute Key conforming to the // "system.filesystem.mode" semantic conventions. It represents the filesystem // mode. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "rw, ro" SystemFilesystemModeKey = attribute.Key("system.filesystem.mode") // SystemFilesystemMountpointKey is the attribute Key conforming to the // "system.filesystem.mountpoint" semantic conventions. It represents the // filesystem mount path. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "/mnt/data" SystemFilesystemMountpointKey = attribute.Key("system.filesystem.mountpoint") // SystemFilesystemStateKey is the attribute Key conforming to the // "system.filesystem.state" semantic conventions. It represents the filesystem // state. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "used" SystemFilesystemStateKey = attribute.Key("system.filesystem.state") // SystemFilesystemTypeKey is the attribute Key conforming to the // "system.filesystem.type" semantic conventions. It represents the filesystem // type. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "ext4" SystemFilesystemTypeKey = attribute.Key("system.filesystem.type") // SystemMemoryStateKey is the attribute Key conforming to the // "system.memory.state" semantic conventions. It represents the memory state. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "free", "cached" SystemMemoryStateKey = attribute.Key("system.memory.state") // SystemPagingDirectionKey is the attribute Key conforming to the // "system.paging.direction" semantic conventions. It represents the paging // access direction. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "in" SystemPagingDirectionKey = attribute.Key("system.paging.direction") // SystemPagingStateKey is the attribute Key conforming to the // "system.paging.state" semantic conventions. It represents the memory paging // state. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "free" SystemPagingStateKey = attribute.Key("system.paging.state") // SystemPagingTypeKey is the attribute Key conforming to the // "system.paging.type" semantic conventions. It represents the memory paging // type. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "minor" SystemPagingTypeKey = attribute.Key("system.paging.type") // SystemProcessStatusKey is the attribute Key conforming to the // "system.process.status" semantic conventions. It represents the process // state, e.g., [Linux Process State Codes]. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "running" // // [Linux Process State Codes]: https://man7.org/linux/man-pages/man1/ps.1.html#PROCESS_STATE_CODES SystemProcessStatusKey = attribute.Key("system.process.status") ) // SystemCPULogicalNumber returns an attribute KeyValue conforming to the // "system.cpu.logical_number" semantic conventions. It represents the // deprecated, use `cpu.logical_number` instead. func SystemCPULogicalNumber(val int) attribute.KeyValue { return SystemCPULogicalNumberKey.Int(val) } // SystemDevice returns an attribute KeyValue conforming to the "system.device" // semantic conventions. It represents the device identifier. func SystemDevice(val string) attribute.KeyValue { return SystemDeviceKey.String(val) } // SystemFilesystemMode returns an attribute KeyValue conforming to the // "system.filesystem.mode" semantic conventions. It represents the filesystem // mode. func SystemFilesystemMode(val string) attribute.KeyValue { return SystemFilesystemModeKey.String(val) } // SystemFilesystemMountpoint returns an attribute KeyValue conforming to the // "system.filesystem.mountpoint" semantic conventions. It represents the // filesystem mount path. func SystemFilesystemMountpoint(val string) attribute.KeyValue { return SystemFilesystemMountpointKey.String(val) } // Enum values for system.filesystem.state var ( // used // Stability: development SystemFilesystemStateUsed = SystemFilesystemStateKey.String("used") // free // Stability: development SystemFilesystemStateFree = SystemFilesystemStateKey.String("free") // reserved // Stability: development SystemFilesystemStateReserved = SystemFilesystemStateKey.String("reserved") ) // Enum values for system.filesystem.type var ( // fat32 // Stability: development SystemFilesystemTypeFat32 = SystemFilesystemTypeKey.String("fat32") // exfat // Stability: development SystemFilesystemTypeExfat = SystemFilesystemTypeKey.String("exfat") // ntfs // Stability: development SystemFilesystemTypeNtfs = SystemFilesystemTypeKey.String("ntfs") // refs // Stability: development SystemFilesystemTypeRefs = SystemFilesystemTypeKey.String("refs") // hfsplus // Stability: development SystemFilesystemTypeHfsplus = SystemFilesystemTypeKey.String("hfsplus") // ext4 // Stability: development SystemFilesystemTypeExt4 = SystemFilesystemTypeKey.String("ext4") ) // Enum values for system.memory.state var ( // Actual used virtual memory in bytes. // Stability: development SystemMemoryStateUsed = SystemMemoryStateKey.String("used") // free // Stability: development SystemMemoryStateFree = SystemMemoryStateKey.String("free") // buffers // Stability: development SystemMemoryStateBuffers = SystemMemoryStateKey.String("buffers") // cached // Stability: development SystemMemoryStateCached = SystemMemoryStateKey.String("cached") ) // Enum values for system.paging.direction var ( // in // Stability: development SystemPagingDirectionIn = SystemPagingDirectionKey.String("in") // out // Stability: development SystemPagingDirectionOut = SystemPagingDirectionKey.String("out") ) // Enum values for system.paging.state var ( // used // Stability: development SystemPagingStateUsed = SystemPagingStateKey.String("used") // free // Stability: development SystemPagingStateFree = SystemPagingStateKey.String("free") ) // Enum values for system.paging.type var ( // major // Stability: development SystemPagingTypeMajor = SystemPagingTypeKey.String("major") // minor // Stability: development SystemPagingTypeMinor = SystemPagingTypeKey.String("minor") ) // Enum values for system.process.status var ( // running // Stability: development SystemProcessStatusRunning = SystemProcessStatusKey.String("running") // sleeping // Stability: development SystemProcessStatusSleeping = SystemProcessStatusKey.String("sleeping") // stopped // Stability: development SystemProcessStatusStopped = SystemProcessStatusKey.String("stopped") // defunct // Stability: development SystemProcessStatusDefunct = SystemProcessStatusKey.String("defunct") ) // Namespace: telemetry const ( // TelemetryDistroNameKey is the attribute Key conforming to the // "telemetry.distro.name" semantic conventions. It represents the name of the // auto instrumentation agent or distribution, if used. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "parts-unlimited-java" // Note: Official auto instrumentation agents and distributions SHOULD set the // `telemetry.distro.name` attribute to // a string starting with `opentelemetry-`, e.g. // `opentelemetry-java-instrumentation`. TelemetryDistroNameKey = attribute.Key("telemetry.distro.name") // TelemetryDistroVersionKey is the attribute Key conforming to the // "telemetry.distro.version" semantic conventions. It represents the version // string of the auto instrumentation agent or distribution, if used. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "1.2.3" TelemetryDistroVersionKey = attribute.Key("telemetry.distro.version") // TelemetrySDKLanguageKey is the attribute Key conforming to the // "telemetry.sdk.language" semantic conventions. It represents the language of // the telemetry SDK. // // Type: Enum // RequirementLevel: Recommended // Stability: Stable // // Examples: TelemetrySDKLanguageKey = attribute.Key("telemetry.sdk.language") // TelemetrySDKNameKey is the attribute Key conforming to the // "telemetry.sdk.name" semantic conventions. It represents the name of the // telemetry SDK as defined above. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "opentelemetry" // Note: The OpenTelemetry SDK MUST set the `telemetry.sdk.name` attribute to // `opentelemetry`. // If another SDK, like a fork or a vendor-provided implementation, is used, // this SDK MUST set the // `telemetry.sdk.name` attribute to the fully-qualified class or module name of // this SDK's main entry point // or another suitable identifier depending on the language. // The identifier `opentelemetry` is reserved and MUST NOT be used in this case. // All custom identifiers SHOULD be stable across different versions of an // implementation. TelemetrySDKNameKey = attribute.Key("telemetry.sdk.name") // TelemetrySDKVersionKey is the attribute Key conforming to the // "telemetry.sdk.version" semantic conventions. It represents the version // string of the telemetry SDK. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "1.2.3" TelemetrySDKVersionKey = attribute.Key("telemetry.sdk.version") ) // TelemetryDistroName returns an attribute KeyValue conforming to the // "telemetry.distro.name" semantic conventions. It represents the name of the // auto instrumentation agent or distribution, if used. func TelemetryDistroName(val string) attribute.KeyValue { return TelemetryDistroNameKey.String(val) } // TelemetryDistroVersion returns an attribute KeyValue conforming to the // "telemetry.distro.version" semantic conventions. It represents the version // string of the auto instrumentation agent or distribution, if used. func TelemetryDistroVersion(val string) attribute.KeyValue { return TelemetryDistroVersionKey.String(val) } // TelemetrySDKName returns an attribute KeyValue conforming to the // "telemetry.sdk.name" semantic conventions. It represents the name of the // telemetry SDK as defined above. func TelemetrySDKName(val string) attribute.KeyValue { return TelemetrySDKNameKey.String(val) } // TelemetrySDKVersion returns an attribute KeyValue conforming to the // "telemetry.sdk.version" semantic conventions. It represents the version string // of the telemetry SDK. func TelemetrySDKVersion(val string) attribute.KeyValue { return TelemetrySDKVersionKey.String(val) } // Enum values for telemetry.sdk.language var ( // cpp // Stability: stable TelemetrySDKLanguageCPP = TelemetrySDKLanguageKey.String("cpp") // dotnet // Stability: stable TelemetrySDKLanguageDotnet = TelemetrySDKLanguageKey.String("dotnet") // erlang // Stability: stable TelemetrySDKLanguageErlang = TelemetrySDKLanguageKey.String("erlang") // go // Stability: stable TelemetrySDKLanguageGo = TelemetrySDKLanguageKey.String("go") // java // Stability: stable TelemetrySDKLanguageJava = TelemetrySDKLanguageKey.String("java") // nodejs // Stability: stable TelemetrySDKLanguageNodejs = TelemetrySDKLanguageKey.String("nodejs") // php // Stability: stable TelemetrySDKLanguagePHP = TelemetrySDKLanguageKey.String("php") // python // Stability: stable TelemetrySDKLanguagePython = TelemetrySDKLanguageKey.String("python") // ruby // Stability: stable TelemetrySDKLanguageRuby = TelemetrySDKLanguageKey.String("ruby") // rust // Stability: stable TelemetrySDKLanguageRust = TelemetrySDKLanguageKey.String("rust") // swift // Stability: stable TelemetrySDKLanguageSwift = TelemetrySDKLanguageKey.String("swift") // webjs // Stability: stable TelemetrySDKLanguageWebJS = TelemetrySDKLanguageKey.String("webjs") ) // Namespace: test const ( // TestCaseNameKey is the attribute Key conforming to the "test.case.name" // semantic conventions. It represents the fully qualified human readable name // of the [test case]. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "org.example.TestCase1.test1", "example/tests/TestCase1.test1", // "ExampleTestCase1_test1" // // [test case]: https://wikipedia.org/wiki/Test_case TestCaseNameKey = attribute.Key("test.case.name") // TestCaseResultStatusKey is the attribute Key conforming to the // "test.case.result.status" semantic conventions. It represents the status of // the actual test case result from test execution. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "pass", "fail" TestCaseResultStatusKey = attribute.Key("test.case.result.status") // TestSuiteNameKey is the attribute Key conforming to the "test.suite.name" // semantic conventions. It represents the human readable name of a [test suite] // . // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "TestSuite1" // // [test suite]: https://wikipedia.org/wiki/Test_suite TestSuiteNameKey = attribute.Key("test.suite.name") // TestSuiteRunStatusKey is the attribute Key conforming to the // "test.suite.run.status" semantic conventions. It represents the status of the // test suite run. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "success", "failure", "skipped", "aborted", "timed_out", // "in_progress" TestSuiteRunStatusKey = attribute.Key("test.suite.run.status") ) // TestCaseName returns an attribute KeyValue conforming to the "test.case.name" // semantic conventions. It represents the fully qualified human readable name of // the [test case]. // // [test case]: https://wikipedia.org/wiki/Test_case func TestCaseName(val string) attribute.KeyValue { return TestCaseNameKey.String(val) } // TestSuiteName returns an attribute KeyValue conforming to the // "test.suite.name" semantic conventions. It represents the human readable name // of a [test suite]. // // [test suite]: https://wikipedia.org/wiki/Test_suite func TestSuiteName(val string) attribute.KeyValue { return TestSuiteNameKey.String(val) } // Enum values for test.case.result.status var ( // pass // Stability: development TestCaseResultStatusPass = TestCaseResultStatusKey.String("pass") // fail // Stability: development TestCaseResultStatusFail = TestCaseResultStatusKey.String("fail") ) // Enum values for test.suite.run.status var ( // success // Stability: development TestSuiteRunStatusSuccess = TestSuiteRunStatusKey.String("success") // failure // Stability: development TestSuiteRunStatusFailure = TestSuiteRunStatusKey.String("failure") // skipped // Stability: development TestSuiteRunStatusSkipped = TestSuiteRunStatusKey.String("skipped") // aborted // Stability: development TestSuiteRunStatusAborted = TestSuiteRunStatusKey.String("aborted") // timed_out // Stability: development TestSuiteRunStatusTimedOut = TestSuiteRunStatusKey.String("timed_out") // in_progress // Stability: development TestSuiteRunStatusInProgress = TestSuiteRunStatusKey.String("in_progress") ) // Namespace: thread const ( // ThreadIDKey is the attribute Key conforming to the "thread.id" semantic // conventions. It represents the current "managed" thread ID (as opposed to OS // thread ID). // // Type: int // RequirementLevel: Recommended // Stability: Development ThreadIDKey = attribute.Key("thread.id") // ThreadNameKey is the attribute Key conforming to the "thread.name" semantic // conventions. It represents the current thread name. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: main ThreadNameKey = attribute.Key("thread.name") ) // ThreadID returns an attribute KeyValue conforming to the "thread.id" semantic // conventions. It represents the current "managed" thread ID (as opposed to OS // thread ID). func ThreadID(val int) attribute.KeyValue { return ThreadIDKey.Int(val) } // ThreadName returns an attribute KeyValue conforming to the "thread.name" // semantic conventions. It represents the current thread name. func ThreadName(val string) attribute.KeyValue { return ThreadNameKey.String(val) } // Namespace: tls const ( // TLSCipherKey is the attribute Key conforming to the "tls.cipher" semantic // conventions. It represents the string indicating the [cipher] used during the // current connection. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "TLS_RSA_WITH_3DES_EDE_CBC_SHA", // "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" // Note: The values allowed for `tls.cipher` MUST be one of the `Descriptions` // of the [registered TLS Cipher Suits]. // // [cipher]: https://datatracker.ietf.org/doc/html/rfc5246#appendix-A.5 // [registered TLS Cipher Suits]: https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#table-tls-parameters-4 TLSCipherKey = attribute.Key("tls.cipher") // TLSClientCertificateKey is the attribute Key conforming to the // "tls.client.certificate" semantic conventions. It represents the PEM-encoded // stand-alone certificate offered by the client. This is usually // mutually-exclusive of `client.certificate_chain` since this value also exists // in that list. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "MII..." TLSClientCertificateKey = attribute.Key("tls.client.certificate") // TLSClientCertificateChainKey is the attribute Key conforming to the // "tls.client.certificate_chain" semantic conventions. It represents the array // of PEM-encoded certificates that make up the certificate chain offered by the // client. This is usually mutually-exclusive of `client.certificate` since that // value should be the first certificate in the chain. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "MII...", "MI..." TLSClientCertificateChainKey = attribute.Key("tls.client.certificate_chain") // TLSClientHashMd5Key is the attribute Key conforming to the // "tls.client.hash.md5" semantic conventions. It represents the certificate // fingerprint using the MD5 digest of DER-encoded version of certificate // offered by the client. For consistency with other hash values, this value // should be formatted as an uppercase hash. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "0F76C7F2C55BFD7D8E8B8F4BFBF0C9EC" TLSClientHashMd5Key = attribute.Key("tls.client.hash.md5") // TLSClientHashSha1Key is the attribute Key conforming to the // "tls.client.hash.sha1" semantic conventions. It represents the certificate // fingerprint using the SHA1 digest of DER-encoded version of certificate // offered by the client. For consistency with other hash values, this value // should be formatted as an uppercase hash. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "9E393D93138888D288266C2D915214D1D1CCEB2A" TLSClientHashSha1Key = attribute.Key("tls.client.hash.sha1") // TLSClientHashSha256Key is the attribute Key conforming to the // "tls.client.hash.sha256" semantic conventions. It represents the certificate // fingerprint using the SHA256 digest of DER-encoded version of certificate // offered by the client. For consistency with other hash values, this value // should be formatted as an uppercase hash. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "0687F666A054EF17A08E2F2162EAB4CBC0D265E1D7875BE74BF3C712CA92DAF0" TLSClientHashSha256Key = attribute.Key("tls.client.hash.sha256") // TLSClientIssuerKey is the attribute Key conforming to the "tls.client.issuer" // semantic conventions. It represents the distinguished name of [subject] of // the issuer of the x.509 certificate presented by the client. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "CN=Example Root CA, OU=Infrastructure Team, DC=example, DC=com" // // [subject]: https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6 TLSClientIssuerKey = attribute.Key("tls.client.issuer") // TLSClientJa3Key is the attribute Key conforming to the "tls.client.ja3" // semantic conventions. It represents a hash that identifies clients based on // how they perform an SSL/TLS handshake. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "d4e5b18d6b55c71272893221c96ba240" TLSClientJa3Key = attribute.Key("tls.client.ja3") // TLSClientNotAfterKey is the attribute Key conforming to the // "tls.client.not_after" semantic conventions. It represents the date/Time // indicating when client certificate is no longer considered valid. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "2021-01-01T00:00:00.000Z" TLSClientNotAfterKey = attribute.Key("tls.client.not_after") // TLSClientNotBeforeKey is the attribute Key conforming to the // "tls.client.not_before" semantic conventions. It represents the date/Time // indicating when client certificate is first considered valid. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "1970-01-01T00:00:00.000Z" TLSClientNotBeforeKey = attribute.Key("tls.client.not_before") // TLSClientSubjectKey is the attribute Key conforming to the // "tls.client.subject" semantic conventions. It represents the distinguished // name of subject of the x.509 certificate presented by the client. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "CN=myclient, OU=Documentation Team, DC=example, DC=com" TLSClientSubjectKey = attribute.Key("tls.client.subject") // TLSClientSupportedCiphersKey is the attribute Key conforming to the // "tls.client.supported_ciphers" semantic conventions. It represents the array // of ciphers offered by the client during the client hello. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", // "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" TLSClientSupportedCiphersKey = attribute.Key("tls.client.supported_ciphers") // TLSCurveKey is the attribute Key conforming to the "tls.curve" semantic // conventions. It represents the string indicating the curve used for the given // cipher, when applicable. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "secp256r1" TLSCurveKey = attribute.Key("tls.curve") // TLSEstablishedKey is the attribute Key conforming to the "tls.established" // semantic conventions. It represents the boolean flag indicating if the TLS // negotiation was successful and transitioned to an encrypted tunnel. // // Type: boolean // RequirementLevel: Recommended // Stability: Development // // Examples: true TLSEstablishedKey = attribute.Key("tls.established") // TLSNextProtocolKey is the attribute Key conforming to the "tls.next_protocol" // semantic conventions. It represents the string indicating the protocol being // tunneled. Per the values in the [IANA registry], this string should be lower // case. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "http/1.1" // // [IANA registry]: https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids TLSNextProtocolKey = attribute.Key("tls.next_protocol") // TLSProtocolNameKey is the attribute Key conforming to the "tls.protocol.name" // semantic conventions. It represents the normalized lowercase protocol name // parsed from original string of the negotiated [SSL/TLS protocol version]. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // // [SSL/TLS protocol version]: https://docs.openssl.org/1.1.1/man3/SSL_get_version/#return-values TLSProtocolNameKey = attribute.Key("tls.protocol.name") // TLSProtocolVersionKey is the attribute Key conforming to the // "tls.protocol.version" semantic conventions. It represents the numeric part // of the version parsed from the original string of the negotiated // [SSL/TLS protocol version]. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "1.2", "3" // // [SSL/TLS protocol version]: https://docs.openssl.org/1.1.1/man3/SSL_get_version/#return-values TLSProtocolVersionKey = attribute.Key("tls.protocol.version") // TLSResumedKey is the attribute Key conforming to the "tls.resumed" semantic // conventions. It represents the boolean flag indicating if this TLS connection // was resumed from an existing TLS negotiation. // // Type: boolean // RequirementLevel: Recommended // Stability: Development // // Examples: true TLSResumedKey = attribute.Key("tls.resumed") // TLSServerCertificateKey is the attribute Key conforming to the // "tls.server.certificate" semantic conventions. It represents the PEM-encoded // stand-alone certificate offered by the server. This is usually // mutually-exclusive of `server.certificate_chain` since this value also exists // in that list. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "MII..." TLSServerCertificateKey = attribute.Key("tls.server.certificate") // TLSServerCertificateChainKey is the attribute Key conforming to the // "tls.server.certificate_chain" semantic conventions. It represents the array // of PEM-encoded certificates that make up the certificate chain offered by the // server. This is usually mutually-exclusive of `server.certificate` since that // value should be the first certificate in the chain. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "MII...", "MI..." TLSServerCertificateChainKey = attribute.Key("tls.server.certificate_chain") // TLSServerHashMd5Key is the attribute Key conforming to the // "tls.server.hash.md5" semantic conventions. It represents the certificate // fingerprint using the MD5 digest of DER-encoded version of certificate // offered by the server. For consistency with other hash values, this value // should be formatted as an uppercase hash. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "0F76C7F2C55BFD7D8E8B8F4BFBF0C9EC" TLSServerHashMd5Key = attribute.Key("tls.server.hash.md5") // TLSServerHashSha1Key is the attribute Key conforming to the // "tls.server.hash.sha1" semantic conventions. It represents the certificate // fingerprint using the SHA1 digest of DER-encoded version of certificate // offered by the server. For consistency with other hash values, this value // should be formatted as an uppercase hash. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "9E393D93138888D288266C2D915214D1D1CCEB2A" TLSServerHashSha1Key = attribute.Key("tls.server.hash.sha1") // TLSServerHashSha256Key is the attribute Key conforming to the // "tls.server.hash.sha256" semantic conventions. It represents the certificate // fingerprint using the SHA256 digest of DER-encoded version of certificate // offered by the server. For consistency with other hash values, this value // should be formatted as an uppercase hash. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "0687F666A054EF17A08E2F2162EAB4CBC0D265E1D7875BE74BF3C712CA92DAF0" TLSServerHashSha256Key = attribute.Key("tls.server.hash.sha256") // TLSServerIssuerKey is the attribute Key conforming to the "tls.server.issuer" // semantic conventions. It represents the distinguished name of [subject] of // the issuer of the x.509 certificate presented by the client. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "CN=Example Root CA, OU=Infrastructure Team, DC=example, DC=com" // // [subject]: https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6 TLSServerIssuerKey = attribute.Key("tls.server.issuer") // TLSServerJa3sKey is the attribute Key conforming to the "tls.server.ja3s" // semantic conventions. It represents a hash that identifies servers based on // how they perform an SSL/TLS handshake. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "d4e5b18d6b55c71272893221c96ba240" TLSServerJa3sKey = attribute.Key("tls.server.ja3s") // TLSServerNotAfterKey is the attribute Key conforming to the // "tls.server.not_after" semantic conventions. It represents the date/Time // indicating when server certificate is no longer considered valid. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "2021-01-01T00:00:00.000Z" TLSServerNotAfterKey = attribute.Key("tls.server.not_after") // TLSServerNotBeforeKey is the attribute Key conforming to the // "tls.server.not_before" semantic conventions. It represents the date/Time // indicating when server certificate is first considered valid. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "1970-01-01T00:00:00.000Z" TLSServerNotBeforeKey = attribute.Key("tls.server.not_before") // TLSServerSubjectKey is the attribute Key conforming to the // "tls.server.subject" semantic conventions. It represents the distinguished // name of subject of the x.509 certificate presented by the server. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "CN=myserver, OU=Documentation Team, DC=example, DC=com" TLSServerSubjectKey = attribute.Key("tls.server.subject") ) // TLSCipher returns an attribute KeyValue conforming to the "tls.cipher" // semantic conventions. It represents the string indicating the [cipher] used // during the current connection. // // [cipher]: https://datatracker.ietf.org/doc/html/rfc5246#appendix-A.5 func TLSCipher(val string) attribute.KeyValue { return TLSCipherKey.String(val) } // TLSClientCertificate returns an attribute KeyValue conforming to the // "tls.client.certificate" semantic conventions. It represents the PEM-encoded // stand-alone certificate offered by the client. This is usually // mutually-exclusive of `client.certificate_chain` since this value also exists // in that list. func TLSClientCertificate(val string) attribute.KeyValue { return TLSClientCertificateKey.String(val) } // TLSClientCertificateChain returns an attribute KeyValue conforming to the // "tls.client.certificate_chain" semantic conventions. It represents the array // of PEM-encoded certificates that make up the certificate chain offered by the // client. This is usually mutually-exclusive of `client.certificate` since that // value should be the first certificate in the chain. func TLSClientCertificateChain(val ...string) attribute.KeyValue { return TLSClientCertificateChainKey.StringSlice(val) } // TLSClientHashMd5 returns an attribute KeyValue conforming to the // "tls.client.hash.md5" semantic conventions. It represents the certificate // fingerprint using the MD5 digest of DER-encoded version of certificate offered // by the client. For consistency with other hash values, this value should be // formatted as an uppercase hash. func TLSClientHashMd5(val string) attribute.KeyValue { return TLSClientHashMd5Key.String(val) } // TLSClientHashSha1 returns an attribute KeyValue conforming to the // "tls.client.hash.sha1" semantic conventions. It represents the certificate // fingerprint using the SHA1 digest of DER-encoded version of certificate // offered by the client. For consistency with other hash values, this value // should be formatted as an uppercase hash. func TLSClientHashSha1(val string) attribute.KeyValue { return TLSClientHashSha1Key.String(val) } // TLSClientHashSha256 returns an attribute KeyValue conforming to the // "tls.client.hash.sha256" semantic conventions. It represents the certificate // fingerprint using the SHA256 digest of DER-encoded version of certificate // offered by the client. For consistency with other hash values, this value // should be formatted as an uppercase hash. func TLSClientHashSha256(val string) attribute.KeyValue { return TLSClientHashSha256Key.String(val) } // TLSClientIssuer returns an attribute KeyValue conforming to the // "tls.client.issuer" semantic conventions. It represents the distinguished name // of [subject] of the issuer of the x.509 certificate presented by the client. // // [subject]: https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6 func TLSClientIssuer(val string) attribute.KeyValue { return TLSClientIssuerKey.String(val) } // TLSClientJa3 returns an attribute KeyValue conforming to the "tls.client.ja3" // semantic conventions. It represents a hash that identifies clients based on // how they perform an SSL/TLS handshake. func TLSClientJa3(val string) attribute.KeyValue { return TLSClientJa3Key.String(val) } // TLSClientNotAfter returns an attribute KeyValue conforming to the // "tls.client.not_after" semantic conventions. It represents the date/Time // indicating when client certificate is no longer considered valid. func TLSClientNotAfter(val string) attribute.KeyValue { return TLSClientNotAfterKey.String(val) } // TLSClientNotBefore returns an attribute KeyValue conforming to the // "tls.client.not_before" semantic conventions. It represents the date/Time // indicating when client certificate is first considered valid. func TLSClientNotBefore(val string) attribute.KeyValue { return TLSClientNotBeforeKey.String(val) } // TLSClientSubject returns an attribute KeyValue conforming to the // "tls.client.subject" semantic conventions. It represents the distinguished // name of subject of the x.509 certificate presented by the client. func TLSClientSubject(val string) attribute.KeyValue { return TLSClientSubjectKey.String(val) } // TLSClientSupportedCiphers returns an attribute KeyValue conforming to the // "tls.client.supported_ciphers" semantic conventions. It represents the array // of ciphers offered by the client during the client hello. func TLSClientSupportedCiphers(val ...string) attribute.KeyValue { return TLSClientSupportedCiphersKey.StringSlice(val) } // TLSCurve returns an attribute KeyValue conforming to the "tls.curve" semantic // conventions. It represents the string indicating the curve used for the given // cipher, when applicable. func TLSCurve(val string) attribute.KeyValue { return TLSCurveKey.String(val) } // TLSEstablished returns an attribute KeyValue conforming to the // "tls.established" semantic conventions. It represents the boolean flag // indicating if the TLS negotiation was successful and transitioned to an // encrypted tunnel. func TLSEstablished(val bool) attribute.KeyValue { return TLSEstablishedKey.Bool(val) } // TLSNextProtocol returns an attribute KeyValue conforming to the // "tls.next_protocol" semantic conventions. It represents the string indicating // the protocol being tunneled. Per the values in the [IANA registry], this // string should be lower case. // // [IANA registry]: https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids func TLSNextProtocol(val string) attribute.KeyValue { return TLSNextProtocolKey.String(val) } // TLSProtocolVersion returns an attribute KeyValue conforming to the // "tls.protocol.version" semantic conventions. It represents the numeric part of // the version parsed from the original string of the negotiated // [SSL/TLS protocol version]. // // [SSL/TLS protocol version]: https://docs.openssl.org/1.1.1/man3/SSL_get_version/#return-values func TLSProtocolVersion(val string) attribute.KeyValue { return TLSProtocolVersionKey.String(val) } // TLSResumed returns an attribute KeyValue conforming to the "tls.resumed" // semantic conventions. It represents the boolean flag indicating if this TLS // connection was resumed from an existing TLS negotiation. func TLSResumed(val bool) attribute.KeyValue { return TLSResumedKey.Bool(val) } // TLSServerCertificate returns an attribute KeyValue conforming to the // "tls.server.certificate" semantic conventions. It represents the PEM-encoded // stand-alone certificate offered by the server. This is usually // mutually-exclusive of `server.certificate_chain` since this value also exists // in that list. func TLSServerCertificate(val string) attribute.KeyValue { return TLSServerCertificateKey.String(val) } // TLSServerCertificateChain returns an attribute KeyValue conforming to the // "tls.server.certificate_chain" semantic conventions. It represents the array // of PEM-encoded certificates that make up the certificate chain offered by the // server. This is usually mutually-exclusive of `server.certificate` since that // value should be the first certificate in the chain. func TLSServerCertificateChain(val ...string) attribute.KeyValue { return TLSServerCertificateChainKey.StringSlice(val) } // TLSServerHashMd5 returns an attribute KeyValue conforming to the // "tls.server.hash.md5" semantic conventions. It represents the certificate // fingerprint using the MD5 digest of DER-encoded version of certificate offered // by the server. For consistency with other hash values, this value should be // formatted as an uppercase hash. func TLSServerHashMd5(val string) attribute.KeyValue { return TLSServerHashMd5Key.String(val) } // TLSServerHashSha1 returns an attribute KeyValue conforming to the // "tls.server.hash.sha1" semantic conventions. It represents the certificate // fingerprint using the SHA1 digest of DER-encoded version of certificate // offered by the server. For consistency with other hash values, this value // should be formatted as an uppercase hash. func TLSServerHashSha1(val string) attribute.KeyValue { return TLSServerHashSha1Key.String(val) } // TLSServerHashSha256 returns an attribute KeyValue conforming to the // "tls.server.hash.sha256" semantic conventions. It represents the certificate // fingerprint using the SHA256 digest of DER-encoded version of certificate // offered by the server. For consistency with other hash values, this value // should be formatted as an uppercase hash. func TLSServerHashSha256(val string) attribute.KeyValue { return TLSServerHashSha256Key.String(val) } // TLSServerIssuer returns an attribute KeyValue conforming to the // "tls.server.issuer" semantic conventions. It represents the distinguished name // of [subject] of the issuer of the x.509 certificate presented by the client. // // [subject]: https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6 func TLSServerIssuer(val string) attribute.KeyValue { return TLSServerIssuerKey.String(val) } // TLSServerJa3s returns an attribute KeyValue conforming to the // "tls.server.ja3s" semantic conventions. It represents a hash that identifies // servers based on how they perform an SSL/TLS handshake. func TLSServerJa3s(val string) attribute.KeyValue { return TLSServerJa3sKey.String(val) } // TLSServerNotAfter returns an attribute KeyValue conforming to the // "tls.server.not_after" semantic conventions. It represents the date/Time // indicating when server certificate is no longer considered valid. func TLSServerNotAfter(val string) attribute.KeyValue { return TLSServerNotAfterKey.String(val) } // TLSServerNotBefore returns an attribute KeyValue conforming to the // "tls.server.not_before" semantic conventions. It represents the date/Time // indicating when server certificate is first considered valid. func TLSServerNotBefore(val string) attribute.KeyValue { return TLSServerNotBeforeKey.String(val) } // TLSServerSubject returns an attribute KeyValue conforming to the // "tls.server.subject" semantic conventions. It represents the distinguished // name of subject of the x.509 certificate presented by the server. func TLSServerSubject(val string) attribute.KeyValue { return TLSServerSubjectKey.String(val) } // Enum values for tls.protocol.name var ( // ssl // Stability: development TLSProtocolNameSsl = TLSProtocolNameKey.String("ssl") // tls // Stability: development TLSProtocolNameTLS = TLSProtocolNameKey.String("tls") ) // Namespace: url const ( // URLDomainKey is the attribute Key conforming to the "url.domain" semantic // conventions. It represents the domain extracted from the `url.full`, such as // "opentelemetry.io". // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "www.foo.bar", "opentelemetry.io", "3.12.167.2", // "[1080:0:0:0:8:800:200C:417A]" // Note: In some cases a URL may refer to an IP and/or port directly, without a // domain name. In this case, the IP address would go to the domain field. If // the URL contains a [literal IPv6 address] enclosed by `[` and `]`, the `[` // and `]` characters should also be captured in the domain field. // // [literal IPv6 address]: https://www.rfc-editor.org/rfc/rfc2732#section-2 URLDomainKey = attribute.Key("url.domain") // URLExtensionKey is the attribute Key conforming to the "url.extension" // semantic conventions. It represents the file extension extracted from the // `url.full`, excluding the leading dot. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "png", "gz" // Note: The file extension is only set if it exists, as not every url has a // file extension. When the file name has multiple extensions `example.tar.gz`, // only the last one should be captured `gz`, not `tar.gz`. URLExtensionKey = attribute.Key("url.extension") // URLFragmentKey is the attribute Key conforming to the "url.fragment" semantic // conventions. It represents the [URI fragment] component. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "SemConv" // // [URI fragment]: https://www.rfc-editor.org/rfc/rfc3986#section-3.5 URLFragmentKey = attribute.Key("url.fragment") // URLFullKey is the attribute Key conforming to the "url.full" semantic // conventions. It represents the absolute URL describing a network resource // according to [RFC3986]. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "https://www.foo.bar/search?q=OpenTelemetry#SemConv", "//localhost" // Note: For network calls, URL usually has // `scheme://host[:port][path][?query][#fragment]` format, where the fragment // is not transmitted over HTTP, but if it is known, it SHOULD be included // nevertheless. // // `url.full` MUST NOT contain credentials passed via URL in form of // `https://username:password@www.example.com/`. // In such case username and password SHOULD be redacted and attribute's value // SHOULD be `https://REDACTED:REDACTED@www.example.com/`. // // `url.full` SHOULD capture the absolute URL when it is available (or can be // reconstructed). // // Sensitive content provided in `url.full` SHOULD be scrubbed when // instrumentations can identify it. // // // Query string values for the following keys SHOULD be redacted by default and // replaced by the // value `REDACTED`: // // - [`AWSAccessKeyId`] // - [`Signature`] // - [`sig`] // - [`X-Goog-Signature`] // // This list is subject to change over time. // // When a query string value is redacted, the query string key SHOULD still be // preserved, e.g. // `https://www.example.com/path?color=blue&sig=REDACTED`. // // [RFC3986]: https://www.rfc-editor.org/rfc/rfc3986 // [`AWSAccessKeyId`]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/RESTAuthentication.html#RESTAuthenticationQueryStringAuth // [`Signature`]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/RESTAuthentication.html#RESTAuthenticationQueryStringAuth // [`sig`]: https://learn.microsoft.com/azure/storage/common/storage-sas-overview#sas-token // [`X-Goog-Signature`]: https://cloud.google.com/storage/docs/access-control/signed-urls URLFullKey = attribute.Key("url.full") // URLOriginalKey is the attribute Key conforming to the "url.original" semantic // conventions. It represents the unmodified original URL as seen in the event // source. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "https://www.foo.bar/search?q=OpenTelemetry#SemConv", // "search?q=OpenTelemetry" // Note: In network monitoring, the observed URL may be a full URL, whereas in // access logs, the URL is often just represented as a path. This field is meant // to represent the URL as it was observed, complete or not. // `url.original` might contain credentials passed via URL in form of // `https://username:password@www.example.com/`. In such case password and // username SHOULD NOT be redacted and attribute's value SHOULD remain the same. URLOriginalKey = attribute.Key("url.original") // URLPathKey is the attribute Key conforming to the "url.path" semantic // conventions. It represents the [URI path] component. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "/search" // Note: Sensitive content provided in `url.path` SHOULD be scrubbed when // instrumentations can identify it. // // [URI path]: https://www.rfc-editor.org/rfc/rfc3986#section-3.3 URLPathKey = attribute.Key("url.path") // URLPortKey is the attribute Key conforming to the "url.port" semantic // conventions. It represents the port extracted from the `url.full`. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 443 URLPortKey = attribute.Key("url.port") // URLQueryKey is the attribute Key conforming to the "url.query" semantic // conventions. It represents the [URI query] component. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "q=OpenTelemetry" // Note: Sensitive content provided in `url.query` SHOULD be scrubbed when // instrumentations can identify it. // // // Query string values for the following keys SHOULD be redacted by default and // replaced by the value `REDACTED`: // // - [`AWSAccessKeyId`] // - [`Signature`] // - [`sig`] // - [`X-Goog-Signature`] // // This list is subject to change over time. // // When a query string value is redacted, the query string key SHOULD still be // preserved, e.g. // `q=OpenTelemetry&sig=REDACTED`. // // [URI query]: https://www.rfc-editor.org/rfc/rfc3986#section-3.4 // [`AWSAccessKeyId`]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/RESTAuthentication.html#RESTAuthenticationQueryStringAuth // [`Signature`]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/RESTAuthentication.html#RESTAuthenticationQueryStringAuth // [`sig`]: https://learn.microsoft.com/azure/storage/common/storage-sas-overview#sas-token // [`X-Goog-Signature`]: https://cloud.google.com/storage/docs/access-control/signed-urls URLQueryKey = attribute.Key("url.query") // URLRegisteredDomainKey is the attribute Key conforming to the // "url.registered_domain" semantic conventions. It represents the highest // registered url domain, stripped of the subdomain. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "example.com", "foo.co.uk" // Note: This value can be determined precisely with the [public suffix list]. // For example, the registered domain for `foo.example.com` is `example.com`. // Trying to approximate this by simply taking the last two labels will not work // well for TLDs such as `co.uk`. // // [public suffix list]: https://publicsuffix.org/ URLRegisteredDomainKey = attribute.Key("url.registered_domain") // URLSchemeKey is the attribute Key conforming to the "url.scheme" semantic // conventions. It represents the [URI scheme] component identifying the used // protocol. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "https", "ftp", "telnet" // // [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1 URLSchemeKey = attribute.Key("url.scheme") // URLSubdomainKey is the attribute Key conforming to the "url.subdomain" // semantic conventions. It represents the subdomain portion of a fully // qualified domain name includes all of the names except the host name under // the registered_domain. In a partially qualified domain, or if the // qualification level of the full name cannot be determined, subdomain contains // all of the names below the registered domain. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "east", "sub2.sub1" // Note: The subdomain portion of `www.east.mydomain.co.uk` is `east`. If the // domain has multiple levels of subdomain, such as `sub2.sub1.example.com`, the // subdomain field should contain `sub2.sub1`, with no trailing period. URLSubdomainKey = attribute.Key("url.subdomain") // URLTemplateKey is the attribute Key conforming to the "url.template" semantic // conventions. It represents the low-cardinality template of an // [absolute path reference]. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "/users/{id}", "/users/:id", "/users?id={id}" // // [absolute path reference]: https://www.rfc-editor.org/rfc/rfc3986#section-4.2 URLTemplateKey = attribute.Key("url.template") // URLTopLevelDomainKey is the attribute Key conforming to the // "url.top_level_domain" semantic conventions. It represents the effective top // level domain (eTLD), also known as the domain suffix, is the last part of the // domain name. For example, the top level domain for example.com is `com`. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "com", "co.uk" // Note: This value can be determined precisely with the [public suffix list]. // // [public suffix list]: https://publicsuffix.org/ URLTopLevelDomainKey = attribute.Key("url.top_level_domain") ) // URLDomain returns an attribute KeyValue conforming to the "url.domain" // semantic conventions. It represents the domain extracted from the `url.full`, // such as "opentelemetry.io". func URLDomain(val string) attribute.KeyValue { return URLDomainKey.String(val) } // URLExtension returns an attribute KeyValue conforming to the "url.extension" // semantic conventions. It represents the file extension extracted from the // `url.full`, excluding the leading dot. func URLExtension(val string) attribute.KeyValue { return URLExtensionKey.String(val) } // URLFragment returns an attribute KeyValue conforming to the "url.fragment" // semantic conventions. It represents the [URI fragment] component. // // [URI fragment]: https://www.rfc-editor.org/rfc/rfc3986#section-3.5 func URLFragment(val string) attribute.KeyValue { return URLFragmentKey.String(val) } // URLFull returns an attribute KeyValue conforming to the "url.full" semantic // conventions. It represents the absolute URL describing a network resource // according to [RFC3986]. // // [RFC3986]: https://www.rfc-editor.org/rfc/rfc3986 func URLFull(val string) attribute.KeyValue { return URLFullKey.String(val) } // URLOriginal returns an attribute KeyValue conforming to the "url.original" // semantic conventions. It represents the unmodified original URL as seen in the // event source. func URLOriginal(val string) attribute.KeyValue { return URLOriginalKey.String(val) } // URLPath returns an attribute KeyValue conforming to the "url.path" semantic // conventions. It represents the [URI path] component. // // [URI path]: https://www.rfc-editor.org/rfc/rfc3986#section-3.3 func URLPath(val string) attribute.KeyValue { return URLPathKey.String(val) } // URLPort returns an attribute KeyValue conforming to the "url.port" semantic // conventions. It represents the port extracted from the `url.full`. func URLPort(val int) attribute.KeyValue { return URLPortKey.Int(val) } // URLQuery returns an attribute KeyValue conforming to the "url.query" semantic // conventions. It represents the [URI query] component. // // [URI query]: https://www.rfc-editor.org/rfc/rfc3986#section-3.4 func URLQuery(val string) attribute.KeyValue { return URLQueryKey.String(val) } // URLRegisteredDomain returns an attribute KeyValue conforming to the // "url.registered_domain" semantic conventions. It represents the highest // registered url domain, stripped of the subdomain. func URLRegisteredDomain(val string) attribute.KeyValue { return URLRegisteredDomainKey.String(val) } // URLScheme returns an attribute KeyValue conforming to the "url.scheme" // semantic conventions. It represents the [URI scheme] component identifying the // used protocol. // // [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1 func URLScheme(val string) attribute.KeyValue { return URLSchemeKey.String(val) } // URLSubdomain returns an attribute KeyValue conforming to the "url.subdomain" // semantic conventions. It represents the subdomain portion of a fully qualified // domain name includes all of the names except the host name under the // registered_domain. In a partially qualified domain, or if the qualification // level of the full name cannot be determined, subdomain contains all of the // names below the registered domain. func URLSubdomain(val string) attribute.KeyValue { return URLSubdomainKey.String(val) } // URLTemplate returns an attribute KeyValue conforming to the "url.template" // semantic conventions. It represents the low-cardinality template of an // [absolute path reference]. // // [absolute path reference]: https://www.rfc-editor.org/rfc/rfc3986#section-4.2 func URLTemplate(val string) attribute.KeyValue { return URLTemplateKey.String(val) } // URLTopLevelDomain returns an attribute KeyValue conforming to the // "url.top_level_domain" semantic conventions. It represents the effective top // level domain (eTLD), also known as the domain suffix, is the last part of the // domain name. For example, the top level domain for example.com is `com`. func URLTopLevelDomain(val string) attribute.KeyValue { return URLTopLevelDomainKey.String(val) } // Namespace: user const ( // UserEmailKey is the attribute Key conforming to the "user.email" semantic // conventions. It represents the user email address. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "a.einstein@example.com" UserEmailKey = attribute.Key("user.email") // UserFullNameKey is the attribute Key conforming to the "user.full_name" // semantic conventions. It represents the user's full name. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Albert Einstein" UserFullNameKey = attribute.Key("user.full_name") // UserHashKey is the attribute Key conforming to the "user.hash" semantic // conventions. It represents the unique user hash to correlate information for // a user in anonymized form. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "364fc68eaf4c8acec74a4e52d7d1feaa" // Note: Useful if `user.id` or `user.name` contain confidential information and // cannot be used. UserHashKey = attribute.Key("user.hash") // UserIDKey is the attribute Key conforming to the "user.id" semantic // conventions. It represents the unique identifier of the user. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "S-1-5-21-202424912787-2692429404-2351956786-1000" UserIDKey = attribute.Key("user.id") // UserNameKey is the attribute Key conforming to the "user.name" semantic // conventions. It represents the short name or login/username of the user. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "a.einstein" UserNameKey = attribute.Key("user.name") // UserRolesKey is the attribute Key conforming to the "user.roles" semantic // conventions. It represents the array of user roles at the time of the event. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "admin", "reporting_user" UserRolesKey = attribute.Key("user.roles") ) // UserEmail returns an attribute KeyValue conforming to the "user.email" // semantic conventions. It represents the user email address. func UserEmail(val string) attribute.KeyValue { return UserEmailKey.String(val) } // UserFullName returns an attribute KeyValue conforming to the "user.full_name" // semantic conventions. It represents the user's full name. func UserFullName(val string) attribute.KeyValue { return UserFullNameKey.String(val) } // UserHash returns an attribute KeyValue conforming to the "user.hash" semantic // conventions. It represents the unique user hash to correlate information for a // user in anonymized form. func UserHash(val string) attribute.KeyValue { return UserHashKey.String(val) } // UserID returns an attribute KeyValue conforming to the "user.id" semantic // conventions. It represents the unique identifier of the user. func UserID(val string) attribute.KeyValue { return UserIDKey.String(val) } // UserName returns an attribute KeyValue conforming to the "user.name" semantic // conventions. It represents the short name or login/username of the user. func UserName(val string) attribute.KeyValue { return UserNameKey.String(val) } // UserRoles returns an attribute KeyValue conforming to the "user.roles" // semantic conventions. It represents the array of user roles at the time of the // event. func UserRoles(val ...string) attribute.KeyValue { return UserRolesKey.StringSlice(val) } // Namespace: user_agent const ( // UserAgentNameKey is the attribute Key conforming to the "user_agent.name" // semantic conventions. It represents the name of the user-agent extracted from // original. Usually refers to the browser's name. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Safari", "YourApp" // Note: [Example] of extracting browser's name from original string. In the // case of using a user-agent for non-browser products, such as microservices // with multiple names/versions inside the `user_agent.original`, the most // significant name SHOULD be selected. In such a scenario it should align with // `user_agent.version` // // [Example]: https://www.whatsmyua.info UserAgentNameKey = attribute.Key("user_agent.name") // UserAgentOriginalKey is the attribute Key conforming to the // "user_agent.original" semantic conventions. It represents the value of the // [HTTP User-Agent] header sent by the client. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "CERN-LineMode/2.15 libwww/2.17b3", "Mozilla/5.0 (iPhone; CPU // iPhone OS 14_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) // Version/14.1.2 Mobile/15E148 Safari/604.1", "YourApp/1.0.0 // grpc-java-okhttp/1.27.2" // // [HTTP User-Agent]: https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent UserAgentOriginalKey = attribute.Key("user_agent.original") // UserAgentOSNameKey is the attribute Key conforming to the // "user_agent.os.name" semantic conventions. It represents the human readable // operating system name. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "iOS", "Android", "Ubuntu" // Note: For mapping user agent strings to OS names, libraries such as // [ua-parser] can be utilized. // // [ua-parser]: https://github.com/ua-parser UserAgentOSNameKey = attribute.Key("user_agent.os.name") // UserAgentOSVersionKey is the attribute Key conforming to the // "user_agent.os.version" semantic conventions. It represents the version // string of the operating system as defined in [Version Attributes]. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "14.2.1", "18.04.1" // Note: For mapping user agent strings to OS versions, libraries such as // [ua-parser] can be utilized. // // [Version Attributes]: /docs/resource/README.md#version-attributes // [ua-parser]: https://github.com/ua-parser UserAgentOSVersionKey = attribute.Key("user_agent.os.version") // UserAgentSyntheticTypeKey is the attribute Key conforming to the // "user_agent.synthetic.type" semantic conventions. It represents the specifies // the category of synthetic traffic, such as tests or bots. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // Note: This attribute MAY be derived from the contents of the // `user_agent.original` attribute. Components that populate the attribute are // responsible for determining what they consider to be synthetic bot or test // traffic. This attribute can either be set for self-identification purposes, // or on telemetry detected to be generated as a result of a synthetic request. // This attribute is useful for distinguishing between genuine client traffic // and synthetic traffic generated by bots or tests. UserAgentSyntheticTypeKey = attribute.Key("user_agent.synthetic.type") // UserAgentVersionKey is the attribute Key conforming to the // "user_agent.version" semantic conventions. It represents the version of the // user-agent extracted from original. Usually refers to the browser's version. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "14.1.2", "1.0.0" // Note: [Example] of extracting browser's version from original string. In the // case of using a user-agent for non-browser products, such as microservices // with multiple names/versions inside the `user_agent.original`, the most // significant version SHOULD be selected. In such a scenario it should align // with `user_agent.name` // // [Example]: https://www.whatsmyua.info UserAgentVersionKey = attribute.Key("user_agent.version") ) // UserAgentName returns an attribute KeyValue conforming to the // "user_agent.name" semantic conventions. It represents the name of the // user-agent extracted from original. Usually refers to the browser's name. func UserAgentName(val string) attribute.KeyValue { return UserAgentNameKey.String(val) } // UserAgentOriginal returns an attribute KeyValue conforming to the // "user_agent.original" semantic conventions. It represents the value of the // [HTTP User-Agent] header sent by the client. // // [HTTP User-Agent]: https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent func UserAgentOriginal(val string) attribute.KeyValue { return UserAgentOriginalKey.String(val) } // UserAgentOSName returns an attribute KeyValue conforming to the // "user_agent.os.name" semantic conventions. It represents the human readable // operating system name. func UserAgentOSName(val string) attribute.KeyValue { return UserAgentOSNameKey.String(val) } // UserAgentOSVersion returns an attribute KeyValue conforming to the // "user_agent.os.version" semantic conventions. It represents the version string // of the operating system as defined in [Version Attributes]. // // [Version Attributes]: /docs/resource/README.md#version-attributes func UserAgentOSVersion(val string) attribute.KeyValue { return UserAgentOSVersionKey.String(val) } // UserAgentVersion returns an attribute KeyValue conforming to the // "user_agent.version" semantic conventions. It represents the version of the // user-agent extracted from original. Usually refers to the browser's version. func UserAgentVersion(val string) attribute.KeyValue { return UserAgentVersionKey.String(val) } // Enum values for user_agent.synthetic.type var ( // Bot source. // Stability: development UserAgentSyntheticTypeBot = UserAgentSyntheticTypeKey.String("bot") // Synthetic test source. // Stability: development UserAgentSyntheticTypeTest = UserAgentSyntheticTypeKey.String("test") ) // Namespace: vcs const ( // VCSChangeIDKey is the attribute Key conforming to the "vcs.change.id" // semantic conventions. It represents the ID of the change (pull request/merge // request/changelist) if applicable. This is usually a unique (within // repository) identifier generated by the VCS system. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "123" VCSChangeIDKey = attribute.Key("vcs.change.id") // VCSChangeStateKey is the attribute Key conforming to the "vcs.change.state" // semantic conventions. It represents the state of the change (pull // request/merge request/changelist). // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "open", "closed", "merged" VCSChangeStateKey = attribute.Key("vcs.change.state") // VCSChangeTitleKey is the attribute Key conforming to the "vcs.change.title" // semantic conventions. It represents the human readable title of the change // (pull request/merge request/changelist). This title is often a brief summary // of the change and may get merged in to a ref as the commit summary. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Fixes broken thing", "feat: add my new feature", "[chore] update // dependency" VCSChangeTitleKey = attribute.Key("vcs.change.title") // VCSLineChangeTypeKey is the attribute Key conforming to the // "vcs.line_change.type" semantic conventions. It represents the type of line // change being measured on a branch or change. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "added", "removed" VCSLineChangeTypeKey = attribute.Key("vcs.line_change.type") // VCSOwnerNameKey is the attribute Key conforming to the "vcs.owner.name" // semantic conventions. It represents the group owner within the version // control system. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "my-org", "myteam", "business-unit" VCSOwnerNameKey = attribute.Key("vcs.owner.name") // VCSProviderNameKey is the attribute Key conforming to the "vcs.provider.name" // semantic conventions. It represents the name of the version control system // provider. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "github", "gitlab", "gitea", "bitbucket" VCSProviderNameKey = attribute.Key("vcs.provider.name") // VCSRefBaseNameKey is the attribute Key conforming to the "vcs.ref.base.name" // semantic conventions. It represents the name of the [reference] such as // **branch** or **tag** in the repository. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "my-feature-branch", "tag-1-test" // Note: `base` refers to the starting point of a change. For example, `main` // would be the base reference of type branch if you've created a new // reference of type branch from it and created new commits. // // [reference]: https://git-scm.com/docs/gitglossary#def_ref VCSRefBaseNameKey = attribute.Key("vcs.ref.base.name") // VCSRefBaseRevisionKey is the attribute Key conforming to the // "vcs.ref.base.revision" semantic conventions. It represents the revision, // literally [revised version], The revision most often refers to a commit // object in Git, or a revision number in SVN. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "9d59409acf479dfa0df1aa568182e43e43df8bbe28d60fcf2bc52e30068802cc", // "main", "123", "HEAD" // Note: `base` refers to the starting point of a change. For example, `main` // would be the base reference of type branch if you've created a new // reference of type branch from it and created new commits. The // revision can be a full [hash value (see // glossary)], // of the recorded change to a ref within a repository pointing to a // commit [commit] object. It does // not necessarily have to be a hash; it can simply define a [revision // number] // which is an integer that is monotonically increasing. In cases where // it is identical to the `ref.base.name`, it SHOULD still be included. // It is up to the implementer to decide which value to set as the // revision based on the VCS system and situational context. // // [revised version]: https://www.merriam-webster.com/dictionary/revision // [hash value (see // glossary)]: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf // [commit]: https://git-scm.com/docs/git-commit // [revision // number]: https://svnbook.red-bean.com/en/1.7/svn.tour.revs.specifiers.html VCSRefBaseRevisionKey = attribute.Key("vcs.ref.base.revision") // VCSRefBaseTypeKey is the attribute Key conforming to the "vcs.ref.base.type" // semantic conventions. It represents the type of the [reference] in the // repository. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "branch", "tag" // Note: `base` refers to the starting point of a change. For example, `main` // would be the base reference of type branch if you've created a new // reference of type branch from it and created new commits. // // [reference]: https://git-scm.com/docs/gitglossary#def_ref VCSRefBaseTypeKey = attribute.Key("vcs.ref.base.type") // VCSRefHeadNameKey is the attribute Key conforming to the "vcs.ref.head.name" // semantic conventions. It represents the name of the [reference] such as // **branch** or **tag** in the repository. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "my-feature-branch", "tag-1-test" // Note: `head` refers to where you are right now; the current reference at a // given time. // // [reference]: https://git-scm.com/docs/gitglossary#def_ref VCSRefHeadNameKey = attribute.Key("vcs.ref.head.name") // VCSRefHeadRevisionKey is the attribute Key conforming to the // "vcs.ref.head.revision" semantic conventions. It represents the revision, // literally [revised version], The revision most often refers to a commit // object in Git, or a revision number in SVN. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "9d59409acf479dfa0df1aa568182e43e43df8bbe28d60fcf2bc52e30068802cc", // "main", "123", "HEAD" // Note: `head` refers to where you are right now; the current reference at a // given time.The revision can be a full [hash value (see // glossary)], // of the recorded change to a ref within a repository pointing to a // commit [commit] object. It does // not necessarily have to be a hash; it can simply define a [revision // number] // which is an integer that is monotonically increasing. In cases where // it is identical to the `ref.head.name`, it SHOULD still be included. // It is up to the implementer to decide which value to set as the // revision based on the VCS system and situational context. // // [revised version]: https://www.merriam-webster.com/dictionary/revision // [hash value (see // glossary)]: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf // [commit]: https://git-scm.com/docs/git-commit // [revision // number]: https://svnbook.red-bean.com/en/1.7/svn.tour.revs.specifiers.html VCSRefHeadRevisionKey = attribute.Key("vcs.ref.head.revision") // VCSRefHeadTypeKey is the attribute Key conforming to the "vcs.ref.head.type" // semantic conventions. It represents the type of the [reference] in the // repository. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "branch", "tag" // Note: `head` refers to where you are right now; the current reference at a // given time. // // [reference]: https://git-scm.com/docs/gitglossary#def_ref VCSRefHeadTypeKey = attribute.Key("vcs.ref.head.type") // VCSRefTypeKey is the attribute Key conforming to the "vcs.ref.type" semantic // conventions. It represents the type of the [reference] in the repository. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "branch", "tag" // // [reference]: https://git-scm.com/docs/gitglossary#def_ref VCSRefTypeKey = attribute.Key("vcs.ref.type") // VCSRepositoryNameKey is the attribute Key conforming to the // "vcs.repository.name" semantic conventions. It represents the human readable // name of the repository. It SHOULD NOT include any additional identifier like // Group/SubGroup in GitLab or organization in GitHub. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "semantic-conventions", "my-cool-repo" // Note: Due to it only being the name, it can clash with forks of the same // repository if collecting telemetry across multiple orgs or groups in // the same backends. VCSRepositoryNameKey = attribute.Key("vcs.repository.name") // VCSRepositoryURLFullKey is the attribute Key conforming to the // "vcs.repository.url.full" semantic conventions. It represents the // [canonical URL] of the repository providing the complete HTTP(S) address in // order to locate and identify the repository through a browser. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: // "https://github.com/opentelemetry/open-telemetry-collector-contrib", // "https://gitlab.com/my-org/my-project/my-projects-project/repo" // Note: In Git Version Control Systems, the canonical URL SHOULD NOT include // the `.git` extension. // // [canonical URL]: https://support.google.com/webmasters/answer/10347851?hl=en#:~:text=A%20canonical%20URL%20is%20the,Google%20chooses%20one%20as%20canonical. VCSRepositoryURLFullKey = attribute.Key("vcs.repository.url.full") // VCSRevisionDeltaDirectionKey is the attribute Key conforming to the // "vcs.revision_delta.direction" semantic conventions. It represents the type // of revision comparison. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "ahead", "behind" VCSRevisionDeltaDirectionKey = attribute.Key("vcs.revision_delta.direction") ) // VCSChangeID returns an attribute KeyValue conforming to the "vcs.change.id" // semantic conventions. It represents the ID of the change (pull request/merge // request/changelist) if applicable. This is usually a unique (within // repository) identifier generated by the VCS system. func VCSChangeID(val string) attribute.KeyValue { return VCSChangeIDKey.String(val) } // VCSChangeTitle returns an attribute KeyValue conforming to the // "vcs.change.title" semantic conventions. It represents the human readable // title of the change (pull request/merge request/changelist). This title is // often a brief summary of the change and may get merged in to a ref as the // commit summary. func VCSChangeTitle(val string) attribute.KeyValue { return VCSChangeTitleKey.String(val) } // VCSOwnerName returns an attribute KeyValue conforming to the "vcs.owner.name" // semantic conventions. It represents the group owner within the version control // system. func VCSOwnerName(val string) attribute.KeyValue { return VCSOwnerNameKey.String(val) } // VCSRefBaseName returns an attribute KeyValue conforming to the // "vcs.ref.base.name" semantic conventions. It represents the name of the // [reference] such as **branch** or **tag** in the repository. // // [reference]: https://git-scm.com/docs/gitglossary#def_ref func VCSRefBaseName(val string) attribute.KeyValue { return VCSRefBaseNameKey.String(val) } // VCSRefBaseRevision returns an attribute KeyValue conforming to the // "vcs.ref.base.revision" semantic conventions. It represents the revision, // literally [revised version], The revision most often refers to a commit object // in Git, or a revision number in SVN. // // [revised version]: https://www.merriam-webster.com/dictionary/revision func VCSRefBaseRevision(val string) attribute.KeyValue { return VCSRefBaseRevisionKey.String(val) } // VCSRefHeadName returns an attribute KeyValue conforming to the // "vcs.ref.head.name" semantic conventions. It represents the name of the // [reference] such as **branch** or **tag** in the repository. // // [reference]: https://git-scm.com/docs/gitglossary#def_ref func VCSRefHeadName(val string) attribute.KeyValue { return VCSRefHeadNameKey.String(val) } // VCSRefHeadRevision returns an attribute KeyValue conforming to the // "vcs.ref.head.revision" semantic conventions. It represents the revision, // literally [revised version], The revision most often refers to a commit object // in Git, or a revision number in SVN. // // [revised version]: https://www.merriam-webster.com/dictionary/revision func VCSRefHeadRevision(val string) attribute.KeyValue { return VCSRefHeadRevisionKey.String(val) } // VCSRepositoryName returns an attribute KeyValue conforming to the // "vcs.repository.name" semantic conventions. It represents the human readable // name of the repository. It SHOULD NOT include any additional identifier like // Group/SubGroup in GitLab or organization in GitHub. func VCSRepositoryName(val string) attribute.KeyValue { return VCSRepositoryNameKey.String(val) } // VCSRepositoryURLFull returns an attribute KeyValue conforming to the // "vcs.repository.url.full" semantic conventions. It represents the // [canonical URL] of the repository providing the complete HTTP(S) address in // order to locate and identify the repository through a browser. // // [canonical URL]: https://support.google.com/webmasters/answer/10347851?hl=en#:~:text=A%20canonical%20URL%20is%20the,Google%20chooses%20one%20as%20canonical. func VCSRepositoryURLFull(val string) attribute.KeyValue { return VCSRepositoryURLFullKey.String(val) } // Enum values for vcs.change.state var ( // Open means the change is currently active and under review. It hasn't been // merged into the target branch yet, and it's still possible to make changes or // add comments. // Stability: development VCSChangeStateOpen = VCSChangeStateKey.String("open") // WIP (work-in-progress, draft) means the change is still in progress and not // yet ready for a full review. It might still undergo significant changes. // Stability: development VCSChangeStateWip = VCSChangeStateKey.String("wip") // Closed means the merge request has been closed without merging. This can // happen for various reasons, such as the changes being deemed unnecessary, the // issue being resolved in another way, or the author deciding to withdraw the // request. // Stability: development VCSChangeStateClosed = VCSChangeStateKey.String("closed") // Merged indicates that the change has been successfully integrated into the // target codebase. // Stability: development VCSChangeStateMerged = VCSChangeStateKey.String("merged") ) // Enum values for vcs.line_change.type var ( // How many lines were added. // Stability: development VCSLineChangeTypeAdded = VCSLineChangeTypeKey.String("added") // How many lines were removed. // Stability: development VCSLineChangeTypeRemoved = VCSLineChangeTypeKey.String("removed") ) // Enum values for vcs.provider.name var ( // [GitHub] // Stability: development // // [GitHub]: https://github.com VCSProviderNameGithub = VCSProviderNameKey.String("github") // [GitLab] // Stability: development // // [GitLab]: https://gitlab.com VCSProviderNameGitlab = VCSProviderNameKey.String("gitlab") // [Gitea] // Stability: development // // [Gitea]: https://gitea.io VCSProviderNameGitea = VCSProviderNameKey.String("gitea") // [Bitbucket] // Stability: development // // [Bitbucket]: https://bitbucket.org VCSProviderNameBitbucket = VCSProviderNameKey.String("bitbucket") ) // Enum values for vcs.ref.base.type var ( // [branch] // Stability: development // // [branch]: https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefbranchabranch VCSRefBaseTypeBranch = VCSRefBaseTypeKey.String("branch") // [tag] // Stability: development // // [tag]: https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddeftagatag VCSRefBaseTypeTag = VCSRefBaseTypeKey.String("tag") ) // Enum values for vcs.ref.head.type var ( // [branch] // Stability: development // // [branch]: https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefbranchabranch VCSRefHeadTypeBranch = VCSRefHeadTypeKey.String("branch") // [tag] // Stability: development // // [tag]: https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddeftagatag VCSRefHeadTypeTag = VCSRefHeadTypeKey.String("tag") ) // Enum values for vcs.ref.type var ( // [branch] // Stability: development // // [branch]: https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefbranchabranch VCSRefTypeBranch = VCSRefTypeKey.String("branch") // [tag] // Stability: development // // [tag]: https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddeftagatag VCSRefTypeTag = VCSRefTypeKey.String("tag") ) // Enum values for vcs.revision_delta.direction var ( // How many revisions the change is behind the target ref. // Stability: development VCSRevisionDeltaDirectionBehind = VCSRevisionDeltaDirectionKey.String("behind") // How many revisions the change is ahead of the target ref. // Stability: development VCSRevisionDeltaDirectionAhead = VCSRevisionDeltaDirectionKey.String("ahead") ) // Namespace: webengine const ( // WebEngineDescriptionKey is the attribute Key conforming to the // "webengine.description" semantic conventions. It represents the additional // description of the web engine (e.g. detailed version and edition // information). // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "WildFly Full 21.0.0.Final (WildFly Core 13.0.1.Final) - // 2.2.2.Final" WebEngineDescriptionKey = attribute.Key("webengine.description") // WebEngineNameKey is the attribute Key conforming to the "webengine.name" // semantic conventions. It represents the name of the web engine. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "WildFly" WebEngineNameKey = attribute.Key("webengine.name") // WebEngineVersionKey is the attribute Key conforming to the // "webengine.version" semantic conventions. It represents the version of the // web engine. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "21.0.0" WebEngineVersionKey = attribute.Key("webengine.version") ) // WebEngineDescription returns an attribute KeyValue conforming to the // "webengine.description" semantic conventions. It represents the additional // description of the web engine (e.g. detailed version and edition information). func WebEngineDescription(val string) attribute.KeyValue { return WebEngineDescriptionKey.String(val) } // WebEngineName returns an attribute KeyValue conforming to the "webengine.name" // semantic conventions. It represents the name of the web engine. func WebEngineName(val string) attribute.KeyValue { return WebEngineNameKey.String(val) } // WebEngineVersion returns an attribute KeyValue conforming to the // "webengine.version" semantic conventions. It represents the version of the web // engine. func WebEngineVersion(val string) attribute.KeyValue { return WebEngineVersionKey.String(val) } // Namespace: zos const ( // ZOSSmfIDKey is the attribute Key conforming to the "zos.smf.id" semantic // conventions. It represents the System Management Facility (SMF) Identifier // uniquely identified a z/OS system within a SYSPLEX or mainframe environment // and is used for system and performance analysis. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "SYS1" ZOSSmfIDKey = attribute.Key("zos.smf.id") // ZOSSysplexNameKey is the attribute Key conforming to the "zos.sysplex.name" // semantic conventions. It represents the name of the SYSPLEX to which the z/OS // system belongs too. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "SYSPLEX1" ZOSSysplexNameKey = attribute.Key("zos.sysplex.name") ) // ZOSSmfID returns an attribute KeyValue conforming to the "zos.smf.id" semantic // conventions. It represents the System Management Facility (SMF) Identifier // uniquely identified a z/OS system within a SYSPLEX or mainframe environment // and is used for system and performance analysis. func ZOSSmfID(val string) attribute.KeyValue { return ZOSSmfIDKey.String(val) } // ZOSSysplexName returns an attribute KeyValue conforming to the // "zos.sysplex.name" semantic conventions. It represents the name of the SYSPLEX // to which the z/OS system belongs too. func ZOSSysplexName(val string) attribute.KeyValue { return ZOSSysplexNameKey.String(val) } ================================================ FILE: vendor/go.opentelemetry.io/otel/semconv/v1.37.0/doc.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 // Package semconv implements OpenTelemetry semantic conventions. // // OpenTelemetry semantic conventions are agreed standardized naming // patterns for OpenTelemetry things. This package represents the v1.37.0 // version of the OpenTelemetry semantic conventions. package semconv // import "go.opentelemetry.io/otel/semconv/v1.37.0" ================================================ FILE: vendor/go.opentelemetry.io/otel/semconv/v1.37.0/error_type.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package semconv // import "go.opentelemetry.io/otel/semconv/v1.37.0" import ( "reflect" "go.opentelemetry.io/otel/attribute" ) // ErrorType returns an [attribute.KeyValue] identifying the error type of err. // // If err is nil, the returned attribute has the default value // [ErrorTypeOther]. // // If err's type has the method // // ErrorType() string // // then the returned attribute has the value of err.ErrorType(). Otherwise, the // returned attribute has a value derived from the concrete type of err. // // The key of the returned attribute is [ErrorTypeKey]. func ErrorType(err error) attribute.KeyValue { if err == nil { return ErrorTypeOther } return ErrorTypeKey.String(errorType(err)) } func errorType(err error) string { var s string if et, ok := err.(interface{ ErrorType() string }); ok { // Prioritize the ErrorType method if available. s = et.ErrorType() } if s == "" { // Fallback to reflection if the ErrorType method is not supported or // returns an empty value. t := reflect.TypeOf(err) pkg, name := t.PkgPath(), t.Name() if pkg != "" && name != "" { s = pkg + "." + name } else { // The type has no package path or name (predeclared, not-defined, // or alias for a not-defined type). // // This is not guaranteed to be unique, but is a best effort. s = t.String() } } return s } ================================================ FILE: vendor/go.opentelemetry.io/otel/semconv/v1.37.0/exception.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package semconv // import "go.opentelemetry.io/otel/semconv/v1.37.0" const ( // ExceptionEventName is the name of the Span event representing an exception. ExceptionEventName = "exception" ) ================================================ FILE: vendor/go.opentelemetry.io/otel/semconv/v1.37.0/schema.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package semconv // import "go.opentelemetry.io/otel/semconv/v1.37.0" // SchemaURL is the schema URL that matches the version of the semantic conventions // that this package defines. Semconv packages starting from v1.4.0 must declare // non-empty schema URL in the form https://opentelemetry.io/schemas/ const SchemaURL = "https://opentelemetry.io/schemas/1.37.0" ================================================ FILE: vendor/go.opentelemetry.io/otel/semconv/v1.39.0/MIGRATION.md ================================================ # Migration from v1.38.0 to v1.39.0 The `go.opentelemetry.io/otel/semconv/v1.39.0` package should be a drop-in replacement for `go.opentelemetry.io/otel/semconv/v1.38.0` with the following exceptions. ## Removed The following declarations have been removed. Refer to the [OpenTelemetry Semantic Conventions documentation] for deprecation instructions. If the type is not listed in the documentation as deprecated, it has been removed in this version due to lack of applicability or use. If you use any of these non-deprecated declarations in your Go application, please [open an issue] describing your use-case. - `LinuxMemorySlabStateKey` - `LinuxMemorySlabStateReclaimable` - `LinuxMemorySlabStateUnreclaimable` - `PeerService` - `PeerServiceKey` - `RPCConnectRPCErrorCodeAborted` - `RPCConnectRPCErrorCodeAlreadyExists` - `RPCConnectRPCErrorCodeCancelled` - `RPCConnectRPCErrorCodeDataLoss` - `RPCConnectRPCErrorCodeDeadlineExceeded` - `RPCConnectRPCErrorCodeFailedPrecondition` - `RPCConnectRPCErrorCodeInternal` - `RPCConnectRPCErrorCodeInvalidArgument` - `RPCConnectRPCErrorCodeKey` - `RPCConnectRPCErrorCodeNotFound` - `RPCConnectRPCErrorCodeOutOfRange` - `RPCConnectRPCErrorCodePermissionDenied` - `RPCConnectRPCErrorCodeResourceExhausted` - `RPCConnectRPCErrorCodeUnauthenticated` - `RPCConnectRPCErrorCodeUnavailable` - `RPCConnectRPCErrorCodeUnimplemented` - `RPCConnectRPCErrorCodeUnknown` - `RPCConnectRPCRequestMetadata` - `RPCConnectRPCResponseMetadata` - `RPCGRPCRequestMetadata` - `RPCGRPCResponseMetadata` - `RPCGRPCStatusCodeAborted` - `RPCGRPCStatusCodeAlreadyExists` - `RPCGRPCStatusCodeCancelled` - `RPCGRPCStatusCodeDataLoss` - `RPCGRPCStatusCodeDeadlineExceeded` - `RPCGRPCStatusCodeFailedPrecondition` - `RPCGRPCStatusCodeInternal` - `RPCGRPCStatusCodeInvalidArgument` - `RPCGRPCStatusCodeKey` - `RPCGRPCStatusCodeNotFound` - `RPCGRPCStatusCodeOk` - `RPCGRPCStatusCodeOutOfRange` - `RPCGRPCStatusCodePermissionDenied` - `RPCGRPCStatusCodeResourceExhausted` - `RPCGRPCStatusCodeUnauthenticated` - `RPCGRPCStatusCodeUnavailable` - `RPCGRPCStatusCodeUnimplemented` - `RPCGRPCStatusCodeUnknown` - `RPCJSONRPCErrorCode` - `RPCJSONRPCErrorCodeKey` - `RPCJSONRPCErrorMessage` - `RPCJSONRPCErrorMessageKey` - `RPCJSONRPCRequestID` - `RPCJSONRPCRequestIDKey` - `RPCJSONRPCVersion` - `RPCJSONRPCVersionKey` - `RPCService` - `RPCServiceKey` - `RPCSystemApacheDubbo` - `RPCSystemConnectRPC` - `RPCSystemDotnetWcf` - `RPCSystemGRPC` - `RPCSystemJSONRPC` - `RPCSystemJavaRmi` - `RPCSystemKey` - `RPCSystemOncRPC` [OpenTelemetry Semantic Conventions documentation]: https://github.com/open-telemetry/semantic-conventions [open an issue]: https://github.com/open-telemetry/opentelemetry-go/issues/new?template=Blank+issue ================================================ FILE: vendor/go.opentelemetry.io/otel/semconv/v1.39.0/README.md ================================================ # Semconv v1.39.0 [![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/semconv/v1.39.0)](https://pkg.go.dev/go.opentelemetry.io/otel/semconv/v1.39.0) ================================================ FILE: vendor/go.opentelemetry.io/otel/semconv/v1.39.0/attribute_group.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 // Code generated from semantic convention specification. DO NOT EDIT. package semconv // import "go.opentelemetry.io/otel/semconv/v1.39.0" import "go.opentelemetry.io/otel/attribute" // Namespace: android const ( // AndroidAppStateKey is the attribute Key conforming to the "android.app.state" // semantic conventions. It represents the this attribute represents the state // of the application. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "created" // Note: The Android lifecycle states are defined in // [Activity lifecycle callbacks], and from which the `OS identifiers` are // derived. // // [Activity lifecycle callbacks]: https://developer.android.com/guide/components/activities/activity-lifecycle#lc AndroidAppStateKey = attribute.Key("android.app.state") // AndroidOSAPILevelKey is the attribute Key conforming to the // "android.os.api_level" semantic conventions. It represents the uniquely // identifies the framework API revision offered by a version (`os.version`) of // the android operating system. More information can be found in the // [Android API levels documentation]. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "33", "32" // // [Android API levels documentation]: https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels AndroidOSAPILevelKey = attribute.Key("android.os.api_level") ) // AndroidOSAPILevel returns an attribute KeyValue conforming to the // "android.os.api_level" semantic conventions. It represents the uniquely // identifies the framework API revision offered by a version (`os.version`) of // the android operating system. More information can be found in the // [Android API levels documentation]. // // [Android API levels documentation]: https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels func AndroidOSAPILevel(val string) attribute.KeyValue { return AndroidOSAPILevelKey.String(val) } // Enum values for android.app.state var ( // Any time before Activity.onResume() or, if the app has no Activity, // Context.startService() has been called in the app for the first time. // // Stability: development AndroidAppStateCreated = AndroidAppStateKey.String("created") // Any time after Activity.onPause() or, if the app has no Activity, // Context.stopService() has been called when the app was in the foreground // state. // // Stability: development AndroidAppStateBackground = AndroidAppStateKey.String("background") // Any time after Activity.onResume() or, if the app has no Activity, // Context.startService() has been called when the app was in either the created // or background states. // // Stability: development AndroidAppStateForeground = AndroidAppStateKey.String("foreground") ) // Namespace: app const ( // AppBuildIDKey is the attribute Key conforming to the "app.build_id" semantic // conventions. It represents the unique identifier for a particular build or // compilation of the application. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "6cff0a7e-cefc-4668-96f5-1273d8b334d0", // "9f2b833506aa6973a92fde9733e6271f", "my-app-1.0.0-code-123" AppBuildIDKey = attribute.Key("app.build_id") // AppInstallationIDKey is the attribute Key conforming to the // "app.installation.id" semantic conventions. It represents a unique identifier // representing the installation of an application on a specific device. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "2ab2916d-a51f-4ac8-80ee-45ac31a28092" // Note: Its value SHOULD persist across launches of the same application // installation, including through application upgrades. // It SHOULD change if the application is uninstalled or if all applications of // the vendor are uninstalled. // Additionally, users might be able to reset this value (e.g. by clearing // application data). // If an app is installed multiple times on the same device (e.g. in different // accounts on Android), each `app.installation.id` SHOULD have a different // value. // If multiple OpenTelemetry SDKs are used within the same application, they // SHOULD use the same value for `app.installation.id`. // Hardware IDs (e.g. serial number, IMEI, MAC address) MUST NOT be used as the // `app.installation.id`. // // For iOS, this value SHOULD be equal to the [vendor identifier]. // // For Android, examples of `app.installation.id` implementations include: // // - [Firebase Installation ID]. // - A globally unique UUID which is persisted across sessions in your // application. // - [App set ID]. // - [`Settings.getString(Settings.Secure.ANDROID_ID)`]. // // More information about Android identifier best practices can be found in the // [Android user data IDs guide]. // // [vendor identifier]: https://developer.apple.com/documentation/uikit/uidevice/identifierforvendor // [Firebase Installation ID]: https://firebase.google.com/docs/projects/manage-installations // [App set ID]: https://developer.android.com/identity/app-set-id // [`Settings.getString(Settings.Secure.ANDROID_ID)`]: https://developer.android.com/reference/android/provider/Settings.Secure#ANDROID_ID // [Android user data IDs guide]: https://developer.android.com/training/articles/user-data-ids AppInstallationIDKey = attribute.Key("app.installation.id") // AppJankFrameCountKey is the attribute Key conforming to the // "app.jank.frame_count" semantic conventions. It represents a number of frame // renders that experienced jank. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 9, 42 // Note: Depending on platform limitations, the value provided MAY be // approximation. AppJankFrameCountKey = attribute.Key("app.jank.frame_count") // AppJankPeriodKey is the attribute Key conforming to the "app.jank.period" // semantic conventions. It represents the time period, in seconds, for which // this jank is being reported. // // Type: double // RequirementLevel: Recommended // Stability: Development // // Examples: 1.0, 5.0, 10.24 AppJankPeriodKey = attribute.Key("app.jank.period") // AppJankThresholdKey is the attribute Key conforming to the // "app.jank.threshold" semantic conventions. It represents the minimum // rendering threshold for this jank, in seconds. // // Type: double // RequirementLevel: Recommended // Stability: Development // // Examples: 0.016, 0.7, 1.024 AppJankThresholdKey = attribute.Key("app.jank.threshold") // AppScreenCoordinateXKey is the attribute Key conforming to the // "app.screen.coordinate.x" semantic conventions. It represents the x // (horizontal) coordinate of a screen coordinate, in screen pixels. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 0, 131 AppScreenCoordinateXKey = attribute.Key("app.screen.coordinate.x") // AppScreenCoordinateYKey is the attribute Key conforming to the // "app.screen.coordinate.y" semantic conventions. It represents the y // (vertical) component of a screen coordinate, in screen pixels. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 12, 99 AppScreenCoordinateYKey = attribute.Key("app.screen.coordinate.y") // AppScreenIDKey is the attribute Key conforming to the "app.screen.id" // semantic conventions. It represents an identifier that uniquely // differentiates this screen from other screens in the same application. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "f9bc787d-ff05-48ad-90e1-fca1d46130b3", // "com.example.app.MainActivity", "com.example.shop.ProductDetailFragment", // "MyApp.ProfileView", "MyApp.ProfileViewController" // Note: A screen represents only the part of the device display drawn by the // app. It typically contains multiple widgets or UI components and is larger in // scope than individual widgets. Multiple screens can coexist on the same // display simultaneously (e.g., split view on tablets). AppScreenIDKey = attribute.Key("app.screen.id") // AppScreenNameKey is the attribute Key conforming to the "app.screen.name" // semantic conventions. It represents the name of an application screen. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "MainActivity", "ProductDetailFragment", "ProfileView", // "ProfileViewController" // Note: A screen represents only the part of the device display drawn by the // app. It typically contains multiple widgets or UI components and is larger in // scope than individual widgets. Multiple screens can coexist on the same // display simultaneously (e.g., split view on tablets). AppScreenNameKey = attribute.Key("app.screen.name") // AppWidgetIDKey is the attribute Key conforming to the "app.widget.id" // semantic conventions. It represents an identifier that uniquely // differentiates this widget from other widgets in the same application. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "f9bc787d-ff05-48ad-90e1-fca1d46130b3", "submit_order_1829" // Note: A widget is an application component, typically an on-screen visual GUI // element. AppWidgetIDKey = attribute.Key("app.widget.id") // AppWidgetNameKey is the attribute Key conforming to the "app.widget.name" // semantic conventions. It represents the name of an application widget. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "submit", "attack", "Clear Cart" // Note: A widget is an application component, typically an on-screen visual GUI // element. AppWidgetNameKey = attribute.Key("app.widget.name") ) // AppBuildID returns an attribute KeyValue conforming to the "app.build_id" // semantic conventions. It represents the unique identifier for a particular // build or compilation of the application. func AppBuildID(val string) attribute.KeyValue { return AppBuildIDKey.String(val) } // AppInstallationID returns an attribute KeyValue conforming to the // "app.installation.id" semantic conventions. It represents a unique identifier // representing the installation of an application on a specific device. func AppInstallationID(val string) attribute.KeyValue { return AppInstallationIDKey.String(val) } // AppJankFrameCount returns an attribute KeyValue conforming to the // "app.jank.frame_count" semantic conventions. It represents a number of frame // renders that experienced jank. func AppJankFrameCount(val int) attribute.KeyValue { return AppJankFrameCountKey.Int(val) } // AppJankPeriod returns an attribute KeyValue conforming to the // "app.jank.period" semantic conventions. It represents the time period, in // seconds, for which this jank is being reported. func AppJankPeriod(val float64) attribute.KeyValue { return AppJankPeriodKey.Float64(val) } // AppJankThreshold returns an attribute KeyValue conforming to the // "app.jank.threshold" semantic conventions. It represents the minimum rendering // threshold for this jank, in seconds. func AppJankThreshold(val float64) attribute.KeyValue { return AppJankThresholdKey.Float64(val) } // AppScreenCoordinateX returns an attribute KeyValue conforming to the // "app.screen.coordinate.x" semantic conventions. It represents the x // (horizontal) coordinate of a screen coordinate, in screen pixels. func AppScreenCoordinateX(val int) attribute.KeyValue { return AppScreenCoordinateXKey.Int(val) } // AppScreenCoordinateY returns an attribute KeyValue conforming to the // "app.screen.coordinate.y" semantic conventions. It represents the y (vertical) // component of a screen coordinate, in screen pixels. func AppScreenCoordinateY(val int) attribute.KeyValue { return AppScreenCoordinateYKey.Int(val) } // AppScreenID returns an attribute KeyValue conforming to the "app.screen.id" // semantic conventions. It represents an identifier that uniquely differentiates // this screen from other screens in the same application. func AppScreenID(val string) attribute.KeyValue { return AppScreenIDKey.String(val) } // AppScreenName returns an attribute KeyValue conforming to the // "app.screen.name" semantic conventions. It represents the name of an // application screen. func AppScreenName(val string) attribute.KeyValue { return AppScreenNameKey.String(val) } // AppWidgetID returns an attribute KeyValue conforming to the "app.widget.id" // semantic conventions. It represents an identifier that uniquely differentiates // this widget from other widgets in the same application. func AppWidgetID(val string) attribute.KeyValue { return AppWidgetIDKey.String(val) } // AppWidgetName returns an attribute KeyValue conforming to the // "app.widget.name" semantic conventions. It represents the name of an // application widget. func AppWidgetName(val string) attribute.KeyValue { return AppWidgetNameKey.String(val) } // Namespace: artifact const ( // ArtifactAttestationFilenameKey is the attribute Key conforming to the // "artifact.attestation.filename" semantic conventions. It represents the // provenance filename of the built attestation which directly relates to the // build artifact filename. This filename SHOULD accompany the artifact at // publish time. See the [SLSA Relationship] specification for more information. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "golang-binary-amd64-v0.1.0.attestation", // "docker-image-amd64-v0.1.0.intoto.json1", "release-1.tar.gz.attestation", // "file-name-package.tar.gz.intoto.json1" // // [SLSA Relationship]: https://slsa.dev/spec/v1.0/distributing-provenance#relationship-between-artifacts-and-attestations ArtifactAttestationFilenameKey = attribute.Key("artifact.attestation.filename") // ArtifactAttestationHashKey is the attribute Key conforming to the // "artifact.attestation.hash" semantic conventions. It represents the full // [hash value (see glossary)], of the built attestation. Some envelopes in the // [software attestation space] also refer to this as the **digest**. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "1b31dfcd5b7f9267bf2ff47651df1cfb9147b9e4df1f335accf65b4cda498408" // // [hash value (see glossary)]: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf // [software attestation space]: https://github.com/in-toto/attestation/tree/main/spec ArtifactAttestationHashKey = attribute.Key("artifact.attestation.hash") // ArtifactAttestationIDKey is the attribute Key conforming to the // "artifact.attestation.id" semantic conventions. It represents the id of the // build [software attestation]. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "123" // // [software attestation]: https://slsa.dev/attestation-model ArtifactAttestationIDKey = attribute.Key("artifact.attestation.id") // ArtifactFilenameKey is the attribute Key conforming to the // "artifact.filename" semantic conventions. It represents the human readable // file name of the artifact, typically generated during build and release // processes. Often includes the package name and version in the file name. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "golang-binary-amd64-v0.1.0", "docker-image-amd64-v0.1.0", // "release-1.tar.gz", "file-name-package.tar.gz" // Note: This file name can also act as the [Package Name] // in cases where the package ecosystem maps accordingly. // Additionally, the artifact [can be published] // for others, but that is not a guarantee. // // [Package Name]: https://slsa.dev/spec/v1.0/terminology#package-model // [can be published]: https://slsa.dev/spec/v1.0/terminology#software-supply-chain ArtifactFilenameKey = attribute.Key("artifact.filename") // ArtifactHashKey is the attribute Key conforming to the "artifact.hash" // semantic conventions. It represents the full [hash value (see glossary)], // often found in checksum.txt on a release of the artifact and used to verify // package integrity. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "9ff4c52759e2c4ac70b7d517bc7fcdc1cda631ca0045271ddd1b192544f8a3e9" // Note: The specific algorithm used to create the cryptographic hash value is // not defined. In situations where an artifact has multiple // cryptographic hashes, it is up to the implementer to choose which // hash value to set here; this should be the most secure hash algorithm // that is suitable for the situation and consistent with the // corresponding attestation. The implementer can then provide the other // hash values through an additional set of attribute extensions as they // deem necessary. // // [hash value (see glossary)]: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf ArtifactHashKey = attribute.Key("artifact.hash") // ArtifactPurlKey is the attribute Key conforming to the "artifact.purl" // semantic conventions. It represents the [Package URL] of the // [package artifact] provides a standard way to identify and locate the // packaged artifact. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "pkg:github/package-url/purl-spec@1209109710924", // "pkg:npm/foo@12.12.3" // // [Package URL]: https://github.com/package-url/purl-spec // [package artifact]: https://slsa.dev/spec/v1.0/terminology#package-model ArtifactPurlKey = attribute.Key("artifact.purl") // ArtifactVersionKey is the attribute Key conforming to the "artifact.version" // semantic conventions. It represents the version of the artifact. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "v0.1.0", "1.2.1", "122691-build" ArtifactVersionKey = attribute.Key("artifact.version") ) // ArtifactAttestationFilename returns an attribute KeyValue conforming to the // "artifact.attestation.filename" semantic conventions. It represents the // provenance filename of the built attestation which directly relates to the // build artifact filename. This filename SHOULD accompany the artifact at // publish time. See the [SLSA Relationship] specification for more information. // // [SLSA Relationship]: https://slsa.dev/spec/v1.0/distributing-provenance#relationship-between-artifacts-and-attestations func ArtifactAttestationFilename(val string) attribute.KeyValue { return ArtifactAttestationFilenameKey.String(val) } // ArtifactAttestationHash returns an attribute KeyValue conforming to the // "artifact.attestation.hash" semantic conventions. It represents the full // [hash value (see glossary)], of the built attestation. Some envelopes in the // [software attestation space] also refer to this as the **digest**. // // [hash value (see glossary)]: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf // [software attestation space]: https://github.com/in-toto/attestation/tree/main/spec func ArtifactAttestationHash(val string) attribute.KeyValue { return ArtifactAttestationHashKey.String(val) } // ArtifactAttestationID returns an attribute KeyValue conforming to the // "artifact.attestation.id" semantic conventions. It represents the id of the // build [software attestation]. // // [software attestation]: https://slsa.dev/attestation-model func ArtifactAttestationID(val string) attribute.KeyValue { return ArtifactAttestationIDKey.String(val) } // ArtifactFilename returns an attribute KeyValue conforming to the // "artifact.filename" semantic conventions. It represents the human readable // file name of the artifact, typically generated during build and release // processes. Often includes the package name and version in the file name. func ArtifactFilename(val string) attribute.KeyValue { return ArtifactFilenameKey.String(val) } // ArtifactHash returns an attribute KeyValue conforming to the "artifact.hash" // semantic conventions. It represents the full [hash value (see glossary)], // often found in checksum.txt on a release of the artifact and used to verify // package integrity. // // [hash value (see glossary)]: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf func ArtifactHash(val string) attribute.KeyValue { return ArtifactHashKey.String(val) } // ArtifactPurl returns an attribute KeyValue conforming to the "artifact.purl" // semantic conventions. It represents the [Package URL] of the // [package artifact] provides a standard way to identify and locate the packaged // artifact. // // [Package URL]: https://github.com/package-url/purl-spec // [package artifact]: https://slsa.dev/spec/v1.0/terminology#package-model func ArtifactPurl(val string) attribute.KeyValue { return ArtifactPurlKey.String(val) } // ArtifactVersion returns an attribute KeyValue conforming to the // "artifact.version" semantic conventions. It represents the version of the // artifact. func ArtifactVersion(val string) attribute.KeyValue { return ArtifactVersionKey.String(val) } // Namespace: aws const ( // AWSBedrockGuardrailIDKey is the attribute Key conforming to the // "aws.bedrock.guardrail.id" semantic conventions. It represents the unique // identifier of the AWS Bedrock Guardrail. A [guardrail] helps safeguard and // prevent unwanted behavior from model responses or user messages. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "sgi5gkybzqak" // // [guardrail]: https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails.html AWSBedrockGuardrailIDKey = attribute.Key("aws.bedrock.guardrail.id") // AWSBedrockKnowledgeBaseIDKey is the attribute Key conforming to the // "aws.bedrock.knowledge_base.id" semantic conventions. It represents the // unique identifier of the AWS Bedrock Knowledge base. A [knowledge base] is a // bank of information that can be queried by models to generate more relevant // responses and augment prompts. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "XFWUPB9PAW" // // [knowledge base]: https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base.html AWSBedrockKnowledgeBaseIDKey = attribute.Key("aws.bedrock.knowledge_base.id") // AWSDynamoDBAttributeDefinitionsKey is the attribute Key conforming to the // "aws.dynamodb.attribute_definitions" semantic conventions. It represents the // JSON-serialized value of each item in the `AttributeDefinitions` request // field. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "{ "AttributeName": "string", "AttributeType": "string" }" AWSDynamoDBAttributeDefinitionsKey = attribute.Key("aws.dynamodb.attribute_definitions") // AWSDynamoDBAttributesToGetKey is the attribute Key conforming to the // "aws.dynamodb.attributes_to_get" semantic conventions. It represents the // value of the `AttributesToGet` request parameter. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "lives", "id" AWSDynamoDBAttributesToGetKey = attribute.Key("aws.dynamodb.attributes_to_get") // AWSDynamoDBConsistentReadKey is the attribute Key conforming to the // "aws.dynamodb.consistent_read" semantic conventions. It represents the value // of the `ConsistentRead` request parameter. // // Type: boolean // RequirementLevel: Recommended // Stability: Development // // Examples: AWSDynamoDBConsistentReadKey = attribute.Key("aws.dynamodb.consistent_read") // AWSDynamoDBConsumedCapacityKey is the attribute Key conforming to the // "aws.dynamodb.consumed_capacity" semantic conventions. It represents the // JSON-serialized value of each item in the `ConsumedCapacity` response field. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "{ "CapacityUnits": number, "GlobalSecondaryIndexes": { "string" : // { "CapacityUnits": number, "ReadCapacityUnits": number, "WriteCapacityUnits": // number } }, "LocalSecondaryIndexes": { "string" : { "CapacityUnits": number, // "ReadCapacityUnits": number, "WriteCapacityUnits": number } }, // "ReadCapacityUnits": number, "Table": { "CapacityUnits": number, // "ReadCapacityUnits": number, "WriteCapacityUnits": number }, "TableName": // "string", "WriteCapacityUnits": number }" AWSDynamoDBConsumedCapacityKey = attribute.Key("aws.dynamodb.consumed_capacity") // AWSDynamoDBCountKey is the attribute Key conforming to the // "aws.dynamodb.count" semantic conventions. It represents the value of the // `Count` response parameter. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 10 AWSDynamoDBCountKey = attribute.Key("aws.dynamodb.count") // AWSDynamoDBExclusiveStartTableKey is the attribute Key conforming to the // "aws.dynamodb.exclusive_start_table" semantic conventions. It represents the // value of the `ExclusiveStartTableName` request parameter. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Users", "CatsTable" AWSDynamoDBExclusiveStartTableKey = attribute.Key("aws.dynamodb.exclusive_start_table") // AWSDynamoDBGlobalSecondaryIndexUpdatesKey is the attribute Key conforming to // the "aws.dynamodb.global_secondary_index_updates" semantic conventions. It // represents the JSON-serialized value of each item in the // `GlobalSecondaryIndexUpdates` request field. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "{ "Create": { "IndexName": "string", "KeySchema": [ { // "AttributeName": "string", "KeyType": "string" } ], "Projection": { // "NonKeyAttributes": [ "string" ], "ProjectionType": "string" }, // "ProvisionedThroughput": { "ReadCapacityUnits": number, "WriteCapacityUnits": // number } }" AWSDynamoDBGlobalSecondaryIndexUpdatesKey = attribute.Key("aws.dynamodb.global_secondary_index_updates") // AWSDynamoDBGlobalSecondaryIndexesKey is the attribute Key conforming to the // "aws.dynamodb.global_secondary_indexes" semantic conventions. It represents // the JSON-serialized value of each item of the `GlobalSecondaryIndexes` // request field. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "{ "IndexName": "string", "KeySchema": [ { "AttributeName": // "string", "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [ // "string" ], "ProjectionType": "string" }, "ProvisionedThroughput": { // "ReadCapacityUnits": number, "WriteCapacityUnits": number } }" AWSDynamoDBGlobalSecondaryIndexesKey = attribute.Key("aws.dynamodb.global_secondary_indexes") // AWSDynamoDBIndexNameKey is the attribute Key conforming to the // "aws.dynamodb.index_name" semantic conventions. It represents the value of // the `IndexName` request parameter. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "name_to_group" AWSDynamoDBIndexNameKey = attribute.Key("aws.dynamodb.index_name") // AWSDynamoDBItemCollectionMetricsKey is the attribute Key conforming to the // "aws.dynamodb.item_collection_metrics" semantic conventions. It represents // the JSON-serialized value of the `ItemCollectionMetrics` response field. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "{ "string" : [ { "ItemCollectionKey": { "string" : { "B": blob, // "BOOL": boolean, "BS": [ blob ], "L": [ "AttributeValue" ], "M": { "string" : // "AttributeValue" }, "N": "string", "NS": [ "string" ], "NULL": boolean, "S": // "string", "SS": [ "string" ] } }, "SizeEstimateRangeGB": [ number ] } ] }" AWSDynamoDBItemCollectionMetricsKey = attribute.Key("aws.dynamodb.item_collection_metrics") // AWSDynamoDBLimitKey is the attribute Key conforming to the // "aws.dynamodb.limit" semantic conventions. It represents the value of the // `Limit` request parameter. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 10 AWSDynamoDBLimitKey = attribute.Key("aws.dynamodb.limit") // AWSDynamoDBLocalSecondaryIndexesKey is the attribute Key conforming to the // "aws.dynamodb.local_secondary_indexes" semantic conventions. It represents // the JSON-serialized value of each item of the `LocalSecondaryIndexes` request // field. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "{ "IndexArn": "string", "IndexName": "string", "IndexSizeBytes": // number, "ItemCount": number, "KeySchema": [ { "AttributeName": "string", // "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [ "string" ], // "ProjectionType": "string" } }" AWSDynamoDBLocalSecondaryIndexesKey = attribute.Key("aws.dynamodb.local_secondary_indexes") // AWSDynamoDBProjectionKey is the attribute Key conforming to the // "aws.dynamodb.projection" semantic conventions. It represents the value of // the `ProjectionExpression` request parameter. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Title", "Title, Price, Color", "Title, Description, RelatedItems, // ProductReviews" AWSDynamoDBProjectionKey = attribute.Key("aws.dynamodb.projection") // AWSDynamoDBProvisionedReadCapacityKey is the attribute Key conforming to the // "aws.dynamodb.provisioned_read_capacity" semantic conventions. It represents // the value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. // // Type: double // RequirementLevel: Recommended // Stability: Development // // Examples: 1.0, 2.0 AWSDynamoDBProvisionedReadCapacityKey = attribute.Key("aws.dynamodb.provisioned_read_capacity") // AWSDynamoDBProvisionedWriteCapacityKey is the attribute Key conforming to the // "aws.dynamodb.provisioned_write_capacity" semantic conventions. It represents // the value of the `ProvisionedThroughput.WriteCapacityUnits` request // parameter. // // Type: double // RequirementLevel: Recommended // Stability: Development // // Examples: 1.0, 2.0 AWSDynamoDBProvisionedWriteCapacityKey = attribute.Key("aws.dynamodb.provisioned_write_capacity") // AWSDynamoDBScanForwardKey is the attribute Key conforming to the // "aws.dynamodb.scan_forward" semantic conventions. It represents the value of // the `ScanIndexForward` request parameter. // // Type: boolean // RequirementLevel: Recommended // Stability: Development // // Examples: AWSDynamoDBScanForwardKey = attribute.Key("aws.dynamodb.scan_forward") // AWSDynamoDBScannedCountKey is the attribute Key conforming to the // "aws.dynamodb.scanned_count" semantic conventions. It represents the value of // the `ScannedCount` response parameter. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 50 AWSDynamoDBScannedCountKey = attribute.Key("aws.dynamodb.scanned_count") // AWSDynamoDBSegmentKey is the attribute Key conforming to the // "aws.dynamodb.segment" semantic conventions. It represents the value of the // `Segment` request parameter. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 10 AWSDynamoDBSegmentKey = attribute.Key("aws.dynamodb.segment") // AWSDynamoDBSelectKey is the attribute Key conforming to the // "aws.dynamodb.select" semantic conventions. It represents the value of the // `Select` request parameter. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "ALL_ATTRIBUTES", "COUNT" AWSDynamoDBSelectKey = attribute.Key("aws.dynamodb.select") // AWSDynamoDBTableCountKey is the attribute Key conforming to the // "aws.dynamodb.table_count" semantic conventions. It represents the number of // items in the `TableNames` response parameter. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 20 AWSDynamoDBTableCountKey = attribute.Key("aws.dynamodb.table_count") // AWSDynamoDBTableNamesKey is the attribute Key conforming to the // "aws.dynamodb.table_names" semantic conventions. It represents the keys in // the `RequestItems` object field. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "Users", "Cats" AWSDynamoDBTableNamesKey = attribute.Key("aws.dynamodb.table_names") // AWSDynamoDBTotalSegmentsKey is the attribute Key conforming to the // "aws.dynamodb.total_segments" semantic conventions. It represents the value // of the `TotalSegments` request parameter. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 100 AWSDynamoDBTotalSegmentsKey = attribute.Key("aws.dynamodb.total_segments") // AWSECSClusterARNKey is the attribute Key conforming to the // "aws.ecs.cluster.arn" semantic conventions. It represents the ARN of an // [ECS cluster]. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster" // // [ECS cluster]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html AWSECSClusterARNKey = attribute.Key("aws.ecs.cluster.arn") // AWSECSContainerARNKey is the attribute Key conforming to the // "aws.ecs.container.arn" semantic conventions. It represents the Amazon // Resource Name (ARN) of an [ECS container instance]. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: // "arn:aws:ecs:us-west-1:123456789123:container/32624152-9086-4f0e-acae-1a75b14fe4d9" // // [ECS container instance]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html AWSECSContainerARNKey = attribute.Key("aws.ecs.container.arn") // AWSECSLaunchtypeKey is the attribute Key conforming to the // "aws.ecs.launchtype" semantic conventions. It represents the [launch type] // for an ECS task. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // // [launch type]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html AWSECSLaunchtypeKey = attribute.Key("aws.ecs.launchtype") // AWSECSTaskARNKey is the attribute Key conforming to the "aws.ecs.task.arn" // semantic conventions. It represents the ARN of a running [ECS task]. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: // "arn:aws:ecs:us-west-1:123456789123:task/10838bed-421f-43ef-870a-f43feacbbb5b", // "arn:aws:ecs:us-west-1:123456789123:task/my-cluster/task-id/23ebb8ac-c18f-46c6-8bbe-d55d0e37cfbd" // // [ECS task]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#ecs-resource-ids AWSECSTaskARNKey = attribute.Key("aws.ecs.task.arn") // AWSECSTaskFamilyKey is the attribute Key conforming to the // "aws.ecs.task.family" semantic conventions. It represents the family name of // the [ECS task definition] used to create the ECS task. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "opentelemetry-family" // // [ECS task definition]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html AWSECSTaskFamilyKey = attribute.Key("aws.ecs.task.family") // AWSECSTaskIDKey is the attribute Key conforming to the "aws.ecs.task.id" // semantic conventions. It represents the ID of a running ECS task. The ID MUST // be extracted from `task.arn`. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "10838bed-421f-43ef-870a-f43feacbbb5b", // "23ebb8ac-c18f-46c6-8bbe-d55d0e37cfbd" AWSECSTaskIDKey = attribute.Key("aws.ecs.task.id") // AWSECSTaskRevisionKey is the attribute Key conforming to the // "aws.ecs.task.revision" semantic conventions. It represents the revision for // the task definition used to create the ECS task. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "8", "26" AWSECSTaskRevisionKey = attribute.Key("aws.ecs.task.revision") // AWSEKSClusterARNKey is the attribute Key conforming to the // "aws.eks.cluster.arn" semantic conventions. It represents the ARN of an EKS // cluster. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster" AWSEKSClusterARNKey = attribute.Key("aws.eks.cluster.arn") // AWSExtendedRequestIDKey is the attribute Key conforming to the // "aws.extended_request_id" semantic conventions. It represents the AWS // extended request ID as returned in the response header `x-amz-id-2`. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: // "wzHcyEWfmOGDIE5QOhTAqFDoDWP3y8IUvpNINCwL9N4TEHbUw0/gZJ+VZTmCNCWR7fezEN3eCiQ=" AWSExtendedRequestIDKey = attribute.Key("aws.extended_request_id") // AWSKinesisStreamNameKey is the attribute Key conforming to the // "aws.kinesis.stream_name" semantic conventions. It represents the name of the // AWS Kinesis [stream] the request refers to. Corresponds to the // `--stream-name` parameter of the Kinesis [describe-stream] operation. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "some-stream-name" // // [stream]: https://docs.aws.amazon.com/streams/latest/dev/introduction.html // [describe-stream]: https://docs.aws.amazon.com/cli/latest/reference/kinesis/describe-stream.html AWSKinesisStreamNameKey = attribute.Key("aws.kinesis.stream_name") // AWSLambdaInvokedARNKey is the attribute Key conforming to the // "aws.lambda.invoked_arn" semantic conventions. It represents the full invoked // ARN as provided on the `Context` passed to the function ( // `Lambda-Runtime-Invoked-Function-Arn` header on the // `/runtime/invocation/next` applicable). // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "arn:aws:lambda:us-east-1:123456:function:myfunction:myalias" // Note: This may be different from `cloud.resource_id` if an alias is involved. AWSLambdaInvokedARNKey = attribute.Key("aws.lambda.invoked_arn") // AWSLambdaResourceMappingIDKey is the attribute Key conforming to the // "aws.lambda.resource_mapping.id" semantic conventions. It represents the UUID // of the [AWS Lambda EvenSource Mapping]. An event source is mapped to a lambda // function. It's contents are read by Lambda and used to trigger a function. // This isn't available in the lambda execution context or the lambda runtime // environtment. This is going to be populated by the AWS SDK for each language // when that UUID is present. Some of these operations are // Create/Delete/Get/List/Update EventSourceMapping. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "587ad24b-03b9-4413-8202-bbd56b36e5b7" // // [AWS Lambda EvenSource Mapping]: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html AWSLambdaResourceMappingIDKey = attribute.Key("aws.lambda.resource_mapping.id") // AWSLogGroupARNsKey is the attribute Key conforming to the // "aws.log.group.arns" semantic conventions. It represents the Amazon Resource // Name(s) (ARN) of the AWS log group(s). // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:*" // Note: See the [log group ARN format documentation]. // // [log group ARN format documentation]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format AWSLogGroupARNsKey = attribute.Key("aws.log.group.arns") // AWSLogGroupNamesKey is the attribute Key conforming to the // "aws.log.group.names" semantic conventions. It represents the name(s) of the // AWS log group(s) an application is writing to. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "/aws/lambda/my-function", "opentelemetry-service" // Note: Multiple log groups must be supported for cases like multi-container // applications, where a single application has sidecar containers, and each // write to their own log group. AWSLogGroupNamesKey = attribute.Key("aws.log.group.names") // AWSLogStreamARNsKey is the attribute Key conforming to the // "aws.log.stream.arns" semantic conventions. It represents the ARN(s) of the // AWS log stream(s). // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: // "arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:log-stream:logs/main/10838bed-421f-43ef-870a-f43feacbbb5b" // Note: See the [log stream ARN format documentation]. One log group can // contain several log streams, so these ARNs necessarily identify both a log // group and a log stream. // // [log stream ARN format documentation]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format AWSLogStreamARNsKey = attribute.Key("aws.log.stream.arns") // AWSLogStreamNamesKey is the attribute Key conforming to the // "aws.log.stream.names" semantic conventions. It represents the name(s) of the // AWS log stream(s) an application is writing to. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "logs/main/10838bed-421f-43ef-870a-f43feacbbb5b" AWSLogStreamNamesKey = attribute.Key("aws.log.stream.names") // AWSRequestIDKey is the attribute Key conforming to the "aws.request_id" // semantic conventions. It represents the AWS request ID as returned in the // response headers `x-amzn-requestid`, `x-amzn-request-id` or // `x-amz-request-id`. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "79b9da39-b7ae-508a-a6bc-864b2829c622", "C9ER4AJX75574TDJ" AWSRequestIDKey = attribute.Key("aws.request_id") // AWSS3BucketKey is the attribute Key conforming to the "aws.s3.bucket" // semantic conventions. It represents the S3 bucket name the request refers to. // Corresponds to the `--bucket` parameter of the [S3 API] operations. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "some-bucket-name" // Note: The `bucket` attribute is applicable to all S3 operations that // reference a bucket, i.e. that require the bucket name as a mandatory // parameter. // This applies to almost all S3 operations except `list-buckets`. // // [S3 API]: https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html AWSS3BucketKey = attribute.Key("aws.s3.bucket") // AWSS3CopySourceKey is the attribute Key conforming to the // "aws.s3.copy_source" semantic conventions. It represents the source object // (in the form `bucket`/`key`) for the copy operation. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "someFile.yml" // Note: The `copy_source` attribute applies to S3 copy operations and // corresponds to the `--copy-source` parameter // of the [copy-object operation within the S3 API]. // This applies in particular to the following operations: // // - [copy-object] // - [upload-part-copy] // // // [copy-object operation within the S3 API]: https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html // [copy-object]: https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html // [upload-part-copy]: https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html AWSS3CopySourceKey = attribute.Key("aws.s3.copy_source") // AWSS3DeleteKey is the attribute Key conforming to the "aws.s3.delete" // semantic conventions. It represents the delete request container that // specifies the objects to be deleted. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: // "Objects=[{Key=string,VersionId=string},{Key=string,VersionId=string}],Quiet=boolean" // Note: The `delete` attribute is only applicable to the [delete-object] // operation. // The `delete` attribute corresponds to the `--delete` parameter of the // [delete-objects operation within the S3 API]. // // [delete-object]: https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html // [delete-objects operation within the S3 API]: https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-objects.html AWSS3DeleteKey = attribute.Key("aws.s3.delete") // AWSS3KeyKey is the attribute Key conforming to the "aws.s3.key" semantic // conventions. It represents the S3 object key the request refers to. // Corresponds to the `--key` parameter of the [S3 API] operations. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "someFile.yml" // Note: The `key` attribute is applicable to all object-related S3 operations, // i.e. that require the object key as a mandatory parameter. // This applies in particular to the following operations: // // - [copy-object] // - [delete-object] // - [get-object] // - [head-object] // - [put-object] // - [restore-object] // - [select-object-content] // - [abort-multipart-upload] // - [complete-multipart-upload] // - [create-multipart-upload] // - [list-parts] // - [upload-part] // - [upload-part-copy] // // // [S3 API]: https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html // [copy-object]: https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html // [delete-object]: https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html // [get-object]: https://docs.aws.amazon.com/cli/latest/reference/s3api/get-object.html // [head-object]: https://docs.aws.amazon.com/cli/latest/reference/s3api/head-object.html // [put-object]: https://docs.aws.amazon.com/cli/latest/reference/s3api/put-object.html // [restore-object]: https://docs.aws.amazon.com/cli/latest/reference/s3api/restore-object.html // [select-object-content]: https://docs.aws.amazon.com/cli/latest/reference/s3api/select-object-content.html // [abort-multipart-upload]: https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html // [complete-multipart-upload]: https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html // [create-multipart-upload]: https://docs.aws.amazon.com/cli/latest/reference/s3api/create-multipart-upload.html // [list-parts]: https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html // [upload-part]: https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html // [upload-part-copy]: https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html AWSS3KeyKey = attribute.Key("aws.s3.key") // AWSS3PartNumberKey is the attribute Key conforming to the // "aws.s3.part_number" semantic conventions. It represents the part number of // the part being uploaded in a multipart-upload operation. This is a positive // integer between 1 and 10,000. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 3456 // Note: The `part_number` attribute is only applicable to the [upload-part] // and [upload-part-copy] operations. // The `part_number` attribute corresponds to the `--part-number` parameter of // the // [upload-part operation within the S3 API]. // // [upload-part]: https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html // [upload-part-copy]: https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html // [upload-part operation within the S3 API]: https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html AWSS3PartNumberKey = attribute.Key("aws.s3.part_number") // AWSS3UploadIDKey is the attribute Key conforming to the "aws.s3.upload_id" // semantic conventions. It represents the upload ID that identifies the // multipart upload. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "dfRtDYWFbkRONycy.Yxwh66Yjlx.cph0gtNBtJ" // Note: The `upload_id` attribute applies to S3 multipart-upload operations and // corresponds to the `--upload-id` parameter // of the [S3 API] multipart operations. // This applies in particular to the following operations: // // - [abort-multipart-upload] // - [complete-multipart-upload] // - [list-parts] // - [upload-part] // - [upload-part-copy] // // // [S3 API]: https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html // [abort-multipart-upload]: https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html // [complete-multipart-upload]: https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html // [list-parts]: https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html // [upload-part]: https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html // [upload-part-copy]: https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html AWSS3UploadIDKey = attribute.Key("aws.s3.upload_id") // AWSSecretsmanagerSecretARNKey is the attribute Key conforming to the // "aws.secretsmanager.secret.arn" semantic conventions. It represents the ARN // of the Secret stored in the Secrets Mangger. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: // "arn:aws:secretsmanager:us-east-1:123456789012:secret:SecretName-6RandomCharacters" AWSSecretsmanagerSecretARNKey = attribute.Key("aws.secretsmanager.secret.arn") // AWSSNSTopicARNKey is the attribute Key conforming to the "aws.sns.topic.arn" // semantic conventions. It represents the ARN of the AWS SNS Topic. An Amazon // SNS [topic] is a logical access point that acts as a communication channel. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "arn:aws:sns:us-east-1:123456789012:mystack-mytopic-NZJ5JSMVGFIE" // // [topic]: https://docs.aws.amazon.com/sns/latest/dg/sns-create-topic.html AWSSNSTopicARNKey = attribute.Key("aws.sns.topic.arn") // AWSSQSQueueURLKey is the attribute Key conforming to the "aws.sqs.queue.url" // semantic conventions. It represents the URL of the AWS SQS Queue. It's a // unique identifier for a queue in Amazon Simple Queue Service (SQS) and is // used to access the queue and perform actions on it. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "https://sqs.us-east-1.amazonaws.com/123456789012/MyQueue" AWSSQSQueueURLKey = attribute.Key("aws.sqs.queue.url") // AWSStepFunctionsActivityARNKey is the attribute Key conforming to the // "aws.step_functions.activity.arn" semantic conventions. It represents the ARN // of the AWS Step Functions Activity. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "arn:aws:states:us-east-1:123456789012:activity:get-greeting" AWSStepFunctionsActivityARNKey = attribute.Key("aws.step_functions.activity.arn") // AWSStepFunctionsStateMachineARNKey is the attribute Key conforming to the // "aws.step_functions.state_machine.arn" semantic conventions. It represents // the ARN of the AWS Step Functions State Machine. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: // "arn:aws:states:us-east-1:123456789012:stateMachine:myStateMachine:1" AWSStepFunctionsStateMachineARNKey = attribute.Key("aws.step_functions.state_machine.arn") ) // AWSBedrockGuardrailID returns an attribute KeyValue conforming to the // "aws.bedrock.guardrail.id" semantic conventions. It represents the unique // identifier of the AWS Bedrock Guardrail. A [guardrail] helps safeguard and // prevent unwanted behavior from model responses or user messages. // // [guardrail]: https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails.html func AWSBedrockGuardrailID(val string) attribute.KeyValue { return AWSBedrockGuardrailIDKey.String(val) } // AWSBedrockKnowledgeBaseID returns an attribute KeyValue conforming to the // "aws.bedrock.knowledge_base.id" semantic conventions. It represents the unique // identifier of the AWS Bedrock Knowledge base. A [knowledge base] is a bank of // information that can be queried by models to generate more relevant responses // and augment prompts. // // [knowledge base]: https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base.html func AWSBedrockKnowledgeBaseID(val string) attribute.KeyValue { return AWSBedrockKnowledgeBaseIDKey.String(val) } // AWSDynamoDBAttributeDefinitions returns an attribute KeyValue conforming to // the "aws.dynamodb.attribute_definitions" semantic conventions. It represents // the JSON-serialized value of each item in the `AttributeDefinitions` request // field. func AWSDynamoDBAttributeDefinitions(val ...string) attribute.KeyValue { return AWSDynamoDBAttributeDefinitionsKey.StringSlice(val) } // AWSDynamoDBAttributesToGet returns an attribute KeyValue conforming to the // "aws.dynamodb.attributes_to_get" semantic conventions. It represents the value // of the `AttributesToGet` request parameter. func AWSDynamoDBAttributesToGet(val ...string) attribute.KeyValue { return AWSDynamoDBAttributesToGetKey.StringSlice(val) } // AWSDynamoDBConsistentRead returns an attribute KeyValue conforming to the // "aws.dynamodb.consistent_read" semantic conventions. It represents the value // of the `ConsistentRead` request parameter. func AWSDynamoDBConsistentRead(val bool) attribute.KeyValue { return AWSDynamoDBConsistentReadKey.Bool(val) } // AWSDynamoDBConsumedCapacity returns an attribute KeyValue conforming to the // "aws.dynamodb.consumed_capacity" semantic conventions. It represents the // JSON-serialized value of each item in the `ConsumedCapacity` response field. func AWSDynamoDBConsumedCapacity(val ...string) attribute.KeyValue { return AWSDynamoDBConsumedCapacityKey.StringSlice(val) } // AWSDynamoDBCount returns an attribute KeyValue conforming to the // "aws.dynamodb.count" semantic conventions. It represents the value of the // `Count` response parameter. func AWSDynamoDBCount(val int) attribute.KeyValue { return AWSDynamoDBCountKey.Int(val) } // AWSDynamoDBExclusiveStartTable returns an attribute KeyValue conforming to the // "aws.dynamodb.exclusive_start_table" semantic conventions. It represents the // value of the `ExclusiveStartTableName` request parameter. func AWSDynamoDBExclusiveStartTable(val string) attribute.KeyValue { return AWSDynamoDBExclusiveStartTableKey.String(val) } // AWSDynamoDBGlobalSecondaryIndexUpdates returns an attribute KeyValue // conforming to the "aws.dynamodb.global_secondary_index_updates" semantic // conventions. It represents the JSON-serialized value of each item in the // `GlobalSecondaryIndexUpdates` request field. func AWSDynamoDBGlobalSecondaryIndexUpdates(val ...string) attribute.KeyValue { return AWSDynamoDBGlobalSecondaryIndexUpdatesKey.StringSlice(val) } // AWSDynamoDBGlobalSecondaryIndexes returns an attribute KeyValue conforming to // the "aws.dynamodb.global_secondary_indexes" semantic conventions. It // represents the JSON-serialized value of each item of the // `GlobalSecondaryIndexes` request field. func AWSDynamoDBGlobalSecondaryIndexes(val ...string) attribute.KeyValue { return AWSDynamoDBGlobalSecondaryIndexesKey.StringSlice(val) } // AWSDynamoDBIndexName returns an attribute KeyValue conforming to the // "aws.dynamodb.index_name" semantic conventions. It represents the value of the // `IndexName` request parameter. func AWSDynamoDBIndexName(val string) attribute.KeyValue { return AWSDynamoDBIndexNameKey.String(val) } // AWSDynamoDBItemCollectionMetrics returns an attribute KeyValue conforming to // the "aws.dynamodb.item_collection_metrics" semantic conventions. It represents // the JSON-serialized value of the `ItemCollectionMetrics` response field. func AWSDynamoDBItemCollectionMetrics(val string) attribute.KeyValue { return AWSDynamoDBItemCollectionMetricsKey.String(val) } // AWSDynamoDBLimit returns an attribute KeyValue conforming to the // "aws.dynamodb.limit" semantic conventions. It represents the value of the // `Limit` request parameter. func AWSDynamoDBLimit(val int) attribute.KeyValue { return AWSDynamoDBLimitKey.Int(val) } // AWSDynamoDBLocalSecondaryIndexes returns an attribute KeyValue conforming to // the "aws.dynamodb.local_secondary_indexes" semantic conventions. It represents // the JSON-serialized value of each item of the `LocalSecondaryIndexes` request // field. func AWSDynamoDBLocalSecondaryIndexes(val ...string) attribute.KeyValue { return AWSDynamoDBLocalSecondaryIndexesKey.StringSlice(val) } // AWSDynamoDBProjection returns an attribute KeyValue conforming to the // "aws.dynamodb.projection" semantic conventions. It represents the value of the // `ProjectionExpression` request parameter. func AWSDynamoDBProjection(val string) attribute.KeyValue { return AWSDynamoDBProjectionKey.String(val) } // AWSDynamoDBProvisionedReadCapacity returns an attribute KeyValue conforming to // the "aws.dynamodb.provisioned_read_capacity" semantic conventions. It // represents the value of the `ProvisionedThroughput.ReadCapacityUnits` request // parameter. func AWSDynamoDBProvisionedReadCapacity(val float64) attribute.KeyValue { return AWSDynamoDBProvisionedReadCapacityKey.Float64(val) } // AWSDynamoDBProvisionedWriteCapacity returns an attribute KeyValue conforming // to the "aws.dynamodb.provisioned_write_capacity" semantic conventions. It // represents the value of the `ProvisionedThroughput.WriteCapacityUnits` request // parameter. func AWSDynamoDBProvisionedWriteCapacity(val float64) attribute.KeyValue { return AWSDynamoDBProvisionedWriteCapacityKey.Float64(val) } // AWSDynamoDBScanForward returns an attribute KeyValue conforming to the // "aws.dynamodb.scan_forward" semantic conventions. It represents the value of // the `ScanIndexForward` request parameter. func AWSDynamoDBScanForward(val bool) attribute.KeyValue { return AWSDynamoDBScanForwardKey.Bool(val) } // AWSDynamoDBScannedCount returns an attribute KeyValue conforming to the // "aws.dynamodb.scanned_count" semantic conventions. It represents the value of // the `ScannedCount` response parameter. func AWSDynamoDBScannedCount(val int) attribute.KeyValue { return AWSDynamoDBScannedCountKey.Int(val) } // AWSDynamoDBSegment returns an attribute KeyValue conforming to the // "aws.dynamodb.segment" semantic conventions. It represents the value of the // `Segment` request parameter. func AWSDynamoDBSegment(val int) attribute.KeyValue { return AWSDynamoDBSegmentKey.Int(val) } // AWSDynamoDBSelect returns an attribute KeyValue conforming to the // "aws.dynamodb.select" semantic conventions. It represents the value of the // `Select` request parameter. func AWSDynamoDBSelect(val string) attribute.KeyValue { return AWSDynamoDBSelectKey.String(val) } // AWSDynamoDBTableCount returns an attribute KeyValue conforming to the // "aws.dynamodb.table_count" semantic conventions. It represents the number of // items in the `TableNames` response parameter. func AWSDynamoDBTableCount(val int) attribute.KeyValue { return AWSDynamoDBTableCountKey.Int(val) } // AWSDynamoDBTableNames returns an attribute KeyValue conforming to the // "aws.dynamodb.table_names" semantic conventions. It represents the keys in the // `RequestItems` object field. func AWSDynamoDBTableNames(val ...string) attribute.KeyValue { return AWSDynamoDBTableNamesKey.StringSlice(val) } // AWSDynamoDBTotalSegments returns an attribute KeyValue conforming to the // "aws.dynamodb.total_segments" semantic conventions. It represents the value of // the `TotalSegments` request parameter. func AWSDynamoDBTotalSegments(val int) attribute.KeyValue { return AWSDynamoDBTotalSegmentsKey.Int(val) } // AWSECSClusterARN returns an attribute KeyValue conforming to the // "aws.ecs.cluster.arn" semantic conventions. It represents the ARN of an // [ECS cluster]. // // [ECS cluster]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html func AWSECSClusterARN(val string) attribute.KeyValue { return AWSECSClusterARNKey.String(val) } // AWSECSContainerARN returns an attribute KeyValue conforming to the // "aws.ecs.container.arn" semantic conventions. It represents the Amazon // Resource Name (ARN) of an [ECS container instance]. // // [ECS container instance]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html func AWSECSContainerARN(val string) attribute.KeyValue { return AWSECSContainerARNKey.String(val) } // AWSECSTaskARN returns an attribute KeyValue conforming to the // "aws.ecs.task.arn" semantic conventions. It represents the ARN of a running // [ECS task]. // // [ECS task]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#ecs-resource-ids func AWSECSTaskARN(val string) attribute.KeyValue { return AWSECSTaskARNKey.String(val) } // AWSECSTaskFamily returns an attribute KeyValue conforming to the // "aws.ecs.task.family" semantic conventions. It represents the family name of // the [ECS task definition] used to create the ECS task. // // [ECS task definition]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html func AWSECSTaskFamily(val string) attribute.KeyValue { return AWSECSTaskFamilyKey.String(val) } // AWSECSTaskID returns an attribute KeyValue conforming to the "aws.ecs.task.id" // semantic conventions. It represents the ID of a running ECS task. The ID MUST // be extracted from `task.arn`. func AWSECSTaskID(val string) attribute.KeyValue { return AWSECSTaskIDKey.String(val) } // AWSECSTaskRevision returns an attribute KeyValue conforming to the // "aws.ecs.task.revision" semantic conventions. It represents the revision for // the task definition used to create the ECS task. func AWSECSTaskRevision(val string) attribute.KeyValue { return AWSECSTaskRevisionKey.String(val) } // AWSEKSClusterARN returns an attribute KeyValue conforming to the // "aws.eks.cluster.arn" semantic conventions. It represents the ARN of an EKS // cluster. func AWSEKSClusterARN(val string) attribute.KeyValue { return AWSEKSClusterARNKey.String(val) } // AWSExtendedRequestID returns an attribute KeyValue conforming to the // "aws.extended_request_id" semantic conventions. It represents the AWS extended // request ID as returned in the response header `x-amz-id-2`. func AWSExtendedRequestID(val string) attribute.KeyValue { return AWSExtendedRequestIDKey.String(val) } // AWSKinesisStreamName returns an attribute KeyValue conforming to the // "aws.kinesis.stream_name" semantic conventions. It represents the name of the // AWS Kinesis [stream] the request refers to. Corresponds to the `--stream-name` // parameter of the Kinesis [describe-stream] operation. // // [stream]: https://docs.aws.amazon.com/streams/latest/dev/introduction.html // [describe-stream]: https://docs.aws.amazon.com/cli/latest/reference/kinesis/describe-stream.html func AWSKinesisStreamName(val string) attribute.KeyValue { return AWSKinesisStreamNameKey.String(val) } // AWSLambdaInvokedARN returns an attribute KeyValue conforming to the // "aws.lambda.invoked_arn" semantic conventions. It represents the full invoked // ARN as provided on the `Context` passed to the function ( // `Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` // applicable). func AWSLambdaInvokedARN(val string) attribute.KeyValue { return AWSLambdaInvokedARNKey.String(val) } // AWSLambdaResourceMappingID returns an attribute KeyValue conforming to the // "aws.lambda.resource_mapping.id" semantic conventions. It represents the UUID // of the [AWS Lambda EvenSource Mapping]. An event source is mapped to a lambda // function. It's contents are read by Lambda and used to trigger a function. // This isn't available in the lambda execution context or the lambda runtime // environtment. This is going to be populated by the AWS SDK for each language // when that UUID is present. Some of these operations are // Create/Delete/Get/List/Update EventSourceMapping. // // [AWS Lambda EvenSource Mapping]: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html func AWSLambdaResourceMappingID(val string) attribute.KeyValue { return AWSLambdaResourceMappingIDKey.String(val) } // AWSLogGroupARNs returns an attribute KeyValue conforming to the // "aws.log.group.arns" semantic conventions. It represents the Amazon Resource // Name(s) (ARN) of the AWS log group(s). func AWSLogGroupARNs(val ...string) attribute.KeyValue { return AWSLogGroupARNsKey.StringSlice(val) } // AWSLogGroupNames returns an attribute KeyValue conforming to the // "aws.log.group.names" semantic conventions. It represents the name(s) of the // AWS log group(s) an application is writing to. func AWSLogGroupNames(val ...string) attribute.KeyValue { return AWSLogGroupNamesKey.StringSlice(val) } // AWSLogStreamARNs returns an attribute KeyValue conforming to the // "aws.log.stream.arns" semantic conventions. It represents the ARN(s) of the // AWS log stream(s). func AWSLogStreamARNs(val ...string) attribute.KeyValue { return AWSLogStreamARNsKey.StringSlice(val) } // AWSLogStreamNames returns an attribute KeyValue conforming to the // "aws.log.stream.names" semantic conventions. It represents the name(s) of the // AWS log stream(s) an application is writing to. func AWSLogStreamNames(val ...string) attribute.KeyValue { return AWSLogStreamNamesKey.StringSlice(val) } // AWSRequestID returns an attribute KeyValue conforming to the "aws.request_id" // semantic conventions. It represents the AWS request ID as returned in the // response headers `x-amzn-requestid`, `x-amzn-request-id` or `x-amz-request-id` // . func AWSRequestID(val string) attribute.KeyValue { return AWSRequestIDKey.String(val) } // AWSS3Bucket returns an attribute KeyValue conforming to the "aws.s3.bucket" // semantic conventions. It represents the S3 bucket name the request refers to. // Corresponds to the `--bucket` parameter of the [S3 API] operations. // // [S3 API]: https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html func AWSS3Bucket(val string) attribute.KeyValue { return AWSS3BucketKey.String(val) } // AWSS3CopySource returns an attribute KeyValue conforming to the // "aws.s3.copy_source" semantic conventions. It represents the source object (in // the form `bucket`/`key`) for the copy operation. func AWSS3CopySource(val string) attribute.KeyValue { return AWSS3CopySourceKey.String(val) } // AWSS3Delete returns an attribute KeyValue conforming to the "aws.s3.delete" // semantic conventions. It represents the delete request container that // specifies the objects to be deleted. func AWSS3Delete(val string) attribute.KeyValue { return AWSS3DeleteKey.String(val) } // AWSS3Key returns an attribute KeyValue conforming to the "aws.s3.key" semantic // conventions. It represents the S3 object key the request refers to. // Corresponds to the `--key` parameter of the [S3 API] operations. // // [S3 API]: https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html func AWSS3Key(val string) attribute.KeyValue { return AWSS3KeyKey.String(val) } // AWSS3PartNumber returns an attribute KeyValue conforming to the // "aws.s3.part_number" semantic conventions. It represents the part number of // the part being uploaded in a multipart-upload operation. This is a positive // integer between 1 and 10,000. func AWSS3PartNumber(val int) attribute.KeyValue { return AWSS3PartNumberKey.Int(val) } // AWSS3UploadID returns an attribute KeyValue conforming to the // "aws.s3.upload_id" semantic conventions. It represents the upload ID that // identifies the multipart upload. func AWSS3UploadID(val string) attribute.KeyValue { return AWSS3UploadIDKey.String(val) } // AWSSecretsmanagerSecretARN returns an attribute KeyValue conforming to the // "aws.secretsmanager.secret.arn" semantic conventions. It represents the ARN of // the Secret stored in the Secrets Mangger. func AWSSecretsmanagerSecretARN(val string) attribute.KeyValue { return AWSSecretsmanagerSecretARNKey.String(val) } // AWSSNSTopicARN returns an attribute KeyValue conforming to the // "aws.sns.topic.arn" semantic conventions. It represents the ARN of the AWS SNS // Topic. An Amazon SNS [topic] is a logical access point that acts as a // communication channel. // // [topic]: https://docs.aws.amazon.com/sns/latest/dg/sns-create-topic.html func AWSSNSTopicARN(val string) attribute.KeyValue { return AWSSNSTopicARNKey.String(val) } // AWSSQSQueueURL returns an attribute KeyValue conforming to the // "aws.sqs.queue.url" semantic conventions. It represents the URL of the AWS SQS // Queue. It's a unique identifier for a queue in Amazon Simple Queue Service // (SQS) and is used to access the queue and perform actions on it. func AWSSQSQueueURL(val string) attribute.KeyValue { return AWSSQSQueueURLKey.String(val) } // AWSStepFunctionsActivityARN returns an attribute KeyValue conforming to the // "aws.step_functions.activity.arn" semantic conventions. It represents the ARN // of the AWS Step Functions Activity. func AWSStepFunctionsActivityARN(val string) attribute.KeyValue { return AWSStepFunctionsActivityARNKey.String(val) } // AWSStepFunctionsStateMachineARN returns an attribute KeyValue conforming to // the "aws.step_functions.state_machine.arn" semantic conventions. It represents // the ARN of the AWS Step Functions State Machine. func AWSStepFunctionsStateMachineARN(val string) attribute.KeyValue { return AWSStepFunctionsStateMachineARNKey.String(val) } // Enum values for aws.ecs.launchtype var ( // Amazon EC2 // Stability: development AWSECSLaunchtypeEC2 = AWSECSLaunchtypeKey.String("ec2") // Amazon Fargate // Stability: development AWSECSLaunchtypeFargate = AWSECSLaunchtypeKey.String("fargate") ) // Namespace: azure const ( // AzureClientIDKey is the attribute Key conforming to the "azure.client.id" // semantic conventions. It represents the unique identifier of the client // instance. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "3ba4827d-4422-483f-b59f-85b74211c11d", "storage-client-1" AzureClientIDKey = attribute.Key("azure.client.id") // AzureCosmosDBConnectionModeKey is the attribute Key conforming to the // "azure.cosmosdb.connection.mode" semantic conventions. It represents the // cosmos client connection mode. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: AzureCosmosDBConnectionModeKey = attribute.Key("azure.cosmosdb.connection.mode") // AzureCosmosDBConsistencyLevelKey is the attribute Key conforming to the // "azure.cosmosdb.consistency.level" semantic conventions. It represents the // account or request [consistency level]. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "Eventual", "ConsistentPrefix", "BoundedStaleness", "Strong", // "Session" // // [consistency level]: https://learn.microsoft.com/azure/cosmos-db/consistency-levels AzureCosmosDBConsistencyLevelKey = attribute.Key("azure.cosmosdb.consistency.level") // AzureCosmosDBOperationContactedRegionsKey is the attribute Key conforming to // the "azure.cosmosdb.operation.contacted_regions" semantic conventions. It // represents the list of regions contacted during operation in the order that // they were contacted. If there is more than one region listed, it indicates // that the operation was performed on multiple regions i.e. cross-regional // call. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "North Central US", "Australia East", "Australia Southeast" // Note: Region name matches the format of `displayName` in [Azure Location API] // // [Azure Location API]: https://learn.microsoft.com/rest/api/resources/subscriptions/list-locations AzureCosmosDBOperationContactedRegionsKey = attribute.Key("azure.cosmosdb.operation.contacted_regions") // AzureCosmosDBOperationRequestChargeKey is the attribute Key conforming to the // "azure.cosmosdb.operation.request_charge" semantic conventions. It represents // the number of request units consumed by the operation. // // Type: double // RequirementLevel: Recommended // Stability: Development // // Examples: 46.18, 1.0 AzureCosmosDBOperationRequestChargeKey = attribute.Key("azure.cosmosdb.operation.request_charge") // AzureCosmosDBRequestBodySizeKey is the attribute Key conforming to the // "azure.cosmosdb.request.body.size" semantic conventions. It represents the // request payload size in bytes. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: AzureCosmosDBRequestBodySizeKey = attribute.Key("azure.cosmosdb.request.body.size") // AzureCosmosDBResponseSubStatusCodeKey is the attribute Key conforming to the // "azure.cosmosdb.response.sub_status_code" semantic conventions. It represents // the cosmos DB sub status code. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 1000, 1002 AzureCosmosDBResponseSubStatusCodeKey = attribute.Key("azure.cosmosdb.response.sub_status_code") // AzureResourceProviderNamespaceKey is the attribute Key conforming to the // "azure.resource_provider.namespace" semantic conventions. It represents the // [Azure Resource Provider Namespace] as recognized by the client. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Microsoft.Storage", "Microsoft.KeyVault", "Microsoft.ServiceBus" // // [Azure Resource Provider Namespace]: https://learn.microsoft.com/azure/azure-resource-manager/management/azure-services-resource-providers AzureResourceProviderNamespaceKey = attribute.Key("azure.resource_provider.namespace") // AzureServiceRequestIDKey is the attribute Key conforming to the // "azure.service.request.id" semantic conventions. It represents the unique // identifier of the service request. It's generated by the Azure service and // returned with the response. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "00000000-0000-0000-0000-000000000000" AzureServiceRequestIDKey = attribute.Key("azure.service.request.id") ) // AzureClientID returns an attribute KeyValue conforming to the // "azure.client.id" semantic conventions. It represents the unique identifier of // the client instance. func AzureClientID(val string) attribute.KeyValue { return AzureClientIDKey.String(val) } // AzureCosmosDBOperationContactedRegions returns an attribute KeyValue // conforming to the "azure.cosmosdb.operation.contacted_regions" semantic // conventions. It represents the list of regions contacted during operation in // the order that they were contacted. If there is more than one region listed, // it indicates that the operation was performed on multiple regions i.e. // cross-regional call. func AzureCosmosDBOperationContactedRegions(val ...string) attribute.KeyValue { return AzureCosmosDBOperationContactedRegionsKey.StringSlice(val) } // AzureCosmosDBOperationRequestCharge returns an attribute KeyValue conforming // to the "azure.cosmosdb.operation.request_charge" semantic conventions. It // represents the number of request units consumed by the operation. func AzureCosmosDBOperationRequestCharge(val float64) attribute.KeyValue { return AzureCosmosDBOperationRequestChargeKey.Float64(val) } // AzureCosmosDBRequestBodySize returns an attribute KeyValue conforming to the // "azure.cosmosdb.request.body.size" semantic conventions. It represents the // request payload size in bytes. func AzureCosmosDBRequestBodySize(val int) attribute.KeyValue { return AzureCosmosDBRequestBodySizeKey.Int(val) } // AzureCosmosDBResponseSubStatusCode returns an attribute KeyValue conforming to // the "azure.cosmosdb.response.sub_status_code" semantic conventions. It // represents the cosmos DB sub status code. func AzureCosmosDBResponseSubStatusCode(val int) attribute.KeyValue { return AzureCosmosDBResponseSubStatusCodeKey.Int(val) } // AzureResourceProviderNamespace returns an attribute KeyValue conforming to the // "azure.resource_provider.namespace" semantic conventions. It represents the // [Azure Resource Provider Namespace] as recognized by the client. // // [Azure Resource Provider Namespace]: https://learn.microsoft.com/azure/azure-resource-manager/management/azure-services-resource-providers func AzureResourceProviderNamespace(val string) attribute.KeyValue { return AzureResourceProviderNamespaceKey.String(val) } // AzureServiceRequestID returns an attribute KeyValue conforming to the // "azure.service.request.id" semantic conventions. It represents the unique // identifier of the service request. It's generated by the Azure service and // returned with the response. func AzureServiceRequestID(val string) attribute.KeyValue { return AzureServiceRequestIDKey.String(val) } // Enum values for azure.cosmosdb.connection.mode var ( // Gateway (HTTP) connection. // Stability: development AzureCosmosDBConnectionModeGateway = AzureCosmosDBConnectionModeKey.String("gateway") // Direct connection. // Stability: development AzureCosmosDBConnectionModeDirect = AzureCosmosDBConnectionModeKey.String("direct") ) // Enum values for azure.cosmosdb.consistency.level var ( // Strong // Stability: development AzureCosmosDBConsistencyLevelStrong = AzureCosmosDBConsistencyLevelKey.String("Strong") // Bounded Staleness // Stability: development AzureCosmosDBConsistencyLevelBoundedStaleness = AzureCosmosDBConsistencyLevelKey.String("BoundedStaleness") // Session // Stability: development AzureCosmosDBConsistencyLevelSession = AzureCosmosDBConsistencyLevelKey.String("Session") // Eventual // Stability: development AzureCosmosDBConsistencyLevelEventual = AzureCosmosDBConsistencyLevelKey.String("Eventual") // Consistent Prefix // Stability: development AzureCosmosDBConsistencyLevelConsistentPrefix = AzureCosmosDBConsistencyLevelKey.String("ConsistentPrefix") ) // Namespace: browser const ( // BrowserBrandsKey is the attribute Key conforming to the "browser.brands" // semantic conventions. It represents the array of brand name and version // separated by a space. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: " Not A;Brand 99", "Chromium 99", "Chrome 99" // Note: This value is intended to be taken from the [UA client hints API] ( // `navigator.userAgentData.brands`). // // [UA client hints API]: https://wicg.github.io/ua-client-hints/#interface BrowserBrandsKey = attribute.Key("browser.brands") // BrowserLanguageKey is the attribute Key conforming to the "browser.language" // semantic conventions. It represents the preferred language of the user using // the browser. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "en", "en-US", "fr", "fr-FR" // Note: This value is intended to be taken from the Navigator API // `navigator.language`. BrowserLanguageKey = attribute.Key("browser.language") // BrowserMobileKey is the attribute Key conforming to the "browser.mobile" // semantic conventions. It represents a boolean that is true if the browser is // running on a mobile device. // // Type: boolean // RequirementLevel: Recommended // Stability: Development // // Examples: // Note: This value is intended to be taken from the [UA client hints API] ( // `navigator.userAgentData.mobile`). If unavailable, this attribute SHOULD be // left unset. // // [UA client hints API]: https://wicg.github.io/ua-client-hints/#interface BrowserMobileKey = attribute.Key("browser.mobile") // BrowserPlatformKey is the attribute Key conforming to the "browser.platform" // semantic conventions. It represents the platform on which the browser is // running. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Windows", "macOS", "Android" // Note: This value is intended to be taken from the [UA client hints API] ( // `navigator.userAgentData.platform`). If unavailable, the legacy // `navigator.platform` API SHOULD NOT be used instead and this attribute SHOULD // be left unset in order for the values to be consistent. // The list of possible values is defined in the // [W3C User-Agent Client Hints specification]. Note that some (but not all) of // these values can overlap with values in the // [`os.type` and `os.name` attributes]. However, for consistency, the values in // the `browser.platform` attribute should capture the exact value that the user // agent provides. // // [UA client hints API]: https://wicg.github.io/ua-client-hints/#interface // [W3C User-Agent Client Hints specification]: https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform // [`os.type` and `os.name` attributes]: ./os.md BrowserPlatformKey = attribute.Key("browser.platform") ) // BrowserBrands returns an attribute KeyValue conforming to the "browser.brands" // semantic conventions. It represents the array of brand name and version // separated by a space. func BrowserBrands(val ...string) attribute.KeyValue { return BrowserBrandsKey.StringSlice(val) } // BrowserLanguage returns an attribute KeyValue conforming to the // "browser.language" semantic conventions. It represents the preferred language // of the user using the browser. func BrowserLanguage(val string) attribute.KeyValue { return BrowserLanguageKey.String(val) } // BrowserMobile returns an attribute KeyValue conforming to the "browser.mobile" // semantic conventions. It represents a boolean that is true if the browser is // running on a mobile device. func BrowserMobile(val bool) attribute.KeyValue { return BrowserMobileKey.Bool(val) } // BrowserPlatform returns an attribute KeyValue conforming to the // "browser.platform" semantic conventions. It represents the platform on which // the browser is running. func BrowserPlatform(val string) attribute.KeyValue { return BrowserPlatformKey.String(val) } // Namespace: cassandra const ( // CassandraConsistencyLevelKey is the attribute Key conforming to the // "cassandra.consistency.level" semantic conventions. It represents the // consistency level of the query. Based on consistency values from [CQL]. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // // [CQL]: https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html CassandraConsistencyLevelKey = attribute.Key("cassandra.consistency.level") // CassandraCoordinatorDCKey is the attribute Key conforming to the // "cassandra.coordinator.dc" semantic conventions. It represents the data // center of the coordinating node for a query. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: us-west-2 CassandraCoordinatorDCKey = attribute.Key("cassandra.coordinator.dc") // CassandraCoordinatorIDKey is the attribute Key conforming to the // "cassandra.coordinator.id" semantic conventions. It represents the ID of the // coordinating node for a query. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: be13faa2-8574-4d71-926d-27f16cf8a7af CassandraCoordinatorIDKey = attribute.Key("cassandra.coordinator.id") // CassandraPageSizeKey is the attribute Key conforming to the // "cassandra.page.size" semantic conventions. It represents the fetch size used // for paging, i.e. how many rows will be returned at once. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 5000 CassandraPageSizeKey = attribute.Key("cassandra.page.size") // CassandraQueryIdempotentKey is the attribute Key conforming to the // "cassandra.query.idempotent" semantic conventions. It represents the whether // or not the query is idempotent. // // Type: boolean // RequirementLevel: Recommended // Stability: Development // // Examples: CassandraQueryIdempotentKey = attribute.Key("cassandra.query.idempotent") // CassandraSpeculativeExecutionCountKey is the attribute Key conforming to the // "cassandra.speculative_execution.count" semantic conventions. It represents // the number of times a query was speculatively executed. Not set or `0` if the // query was not executed speculatively. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 0, 2 CassandraSpeculativeExecutionCountKey = attribute.Key("cassandra.speculative_execution.count") ) // CassandraCoordinatorDC returns an attribute KeyValue conforming to the // "cassandra.coordinator.dc" semantic conventions. It represents the data center // of the coordinating node for a query. func CassandraCoordinatorDC(val string) attribute.KeyValue { return CassandraCoordinatorDCKey.String(val) } // CassandraCoordinatorID returns an attribute KeyValue conforming to the // "cassandra.coordinator.id" semantic conventions. It represents the ID of the // coordinating node for a query. func CassandraCoordinatorID(val string) attribute.KeyValue { return CassandraCoordinatorIDKey.String(val) } // CassandraPageSize returns an attribute KeyValue conforming to the // "cassandra.page.size" semantic conventions. It represents the fetch size used // for paging, i.e. how many rows will be returned at once. func CassandraPageSize(val int) attribute.KeyValue { return CassandraPageSizeKey.Int(val) } // CassandraQueryIdempotent returns an attribute KeyValue conforming to the // "cassandra.query.idempotent" semantic conventions. It represents the whether // or not the query is idempotent. func CassandraQueryIdempotent(val bool) attribute.KeyValue { return CassandraQueryIdempotentKey.Bool(val) } // CassandraSpeculativeExecutionCount returns an attribute KeyValue conforming to // the "cassandra.speculative_execution.count" semantic conventions. It // represents the number of times a query was speculatively executed. Not set or // `0` if the query was not executed speculatively. func CassandraSpeculativeExecutionCount(val int) attribute.KeyValue { return CassandraSpeculativeExecutionCountKey.Int(val) } // Enum values for cassandra.consistency.level var ( // All // Stability: development CassandraConsistencyLevelAll = CassandraConsistencyLevelKey.String("all") // Each Quorum // Stability: development CassandraConsistencyLevelEachQuorum = CassandraConsistencyLevelKey.String("each_quorum") // Quorum // Stability: development CassandraConsistencyLevelQuorum = CassandraConsistencyLevelKey.String("quorum") // Local Quorum // Stability: development CassandraConsistencyLevelLocalQuorum = CassandraConsistencyLevelKey.String("local_quorum") // One // Stability: development CassandraConsistencyLevelOne = CassandraConsistencyLevelKey.String("one") // Two // Stability: development CassandraConsistencyLevelTwo = CassandraConsistencyLevelKey.String("two") // Three // Stability: development CassandraConsistencyLevelThree = CassandraConsistencyLevelKey.String("three") // Local One // Stability: development CassandraConsistencyLevelLocalOne = CassandraConsistencyLevelKey.String("local_one") // Any // Stability: development CassandraConsistencyLevelAny = CassandraConsistencyLevelKey.String("any") // Serial // Stability: development CassandraConsistencyLevelSerial = CassandraConsistencyLevelKey.String("serial") // Local Serial // Stability: development CassandraConsistencyLevelLocalSerial = CassandraConsistencyLevelKey.String("local_serial") ) // Namespace: cicd const ( // CICDPipelineActionNameKey is the attribute Key conforming to the // "cicd.pipeline.action.name" semantic conventions. It represents the kind of // action a pipeline run is performing. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "BUILD", "RUN", "SYNC" CICDPipelineActionNameKey = attribute.Key("cicd.pipeline.action.name") // CICDPipelineNameKey is the attribute Key conforming to the // "cicd.pipeline.name" semantic conventions. It represents the human readable // name of the pipeline within a CI/CD system. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Build and Test", "Lint", "Deploy Go Project", // "deploy_to_environment" CICDPipelineNameKey = attribute.Key("cicd.pipeline.name") // CICDPipelineResultKey is the attribute Key conforming to the // "cicd.pipeline.result" semantic conventions. It represents the result of a // pipeline run. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "success", "failure", "timeout", "skipped" CICDPipelineResultKey = attribute.Key("cicd.pipeline.result") // CICDPipelineRunIDKey is the attribute Key conforming to the // "cicd.pipeline.run.id" semantic conventions. It represents the unique // identifier of a pipeline run within a CI/CD system. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "120912" CICDPipelineRunIDKey = attribute.Key("cicd.pipeline.run.id") // CICDPipelineRunStateKey is the attribute Key conforming to the // "cicd.pipeline.run.state" semantic conventions. It represents the pipeline // run goes through these states during its lifecycle. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "pending", "executing", "finalizing" CICDPipelineRunStateKey = attribute.Key("cicd.pipeline.run.state") // CICDPipelineRunURLFullKey is the attribute Key conforming to the // "cicd.pipeline.run.url.full" semantic conventions. It represents the [URL] of // the pipeline run, providing the complete address in order to locate and // identify the pipeline run. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: // "https://github.com/open-telemetry/semantic-conventions/actions/runs/9753949763?pr=1075" // // [URL]: https://wikipedia.org/wiki/URL CICDPipelineRunURLFullKey = attribute.Key("cicd.pipeline.run.url.full") // CICDPipelineTaskNameKey is the attribute Key conforming to the // "cicd.pipeline.task.name" semantic conventions. It represents the human // readable name of a task within a pipeline. Task here most closely aligns with // a [computing process] in a pipeline. Other terms for tasks include commands, // steps, and procedures. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Run GoLang Linter", "Go Build", "go-test", "deploy_binary" // // [computing process]: https://wikipedia.org/wiki/Pipeline_(computing) CICDPipelineTaskNameKey = attribute.Key("cicd.pipeline.task.name") // CICDPipelineTaskRunIDKey is the attribute Key conforming to the // "cicd.pipeline.task.run.id" semantic conventions. It represents the unique // identifier of a task run within a pipeline. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "12097" CICDPipelineTaskRunIDKey = attribute.Key("cicd.pipeline.task.run.id") // CICDPipelineTaskRunResultKey is the attribute Key conforming to the // "cicd.pipeline.task.run.result" semantic conventions. It represents the // result of a task run. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "success", "failure", "timeout", "skipped" CICDPipelineTaskRunResultKey = attribute.Key("cicd.pipeline.task.run.result") // CICDPipelineTaskRunURLFullKey is the attribute Key conforming to the // "cicd.pipeline.task.run.url.full" semantic conventions. It represents the // [URL] of the pipeline task run, providing the complete address in order to // locate and identify the pipeline task run. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: // "https://github.com/open-telemetry/semantic-conventions/actions/runs/9753949763/job/26920038674?pr=1075" // // [URL]: https://wikipedia.org/wiki/URL CICDPipelineTaskRunURLFullKey = attribute.Key("cicd.pipeline.task.run.url.full") // CICDPipelineTaskTypeKey is the attribute Key conforming to the // "cicd.pipeline.task.type" semantic conventions. It represents the type of the // task within a pipeline. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "build", "test", "deploy" CICDPipelineTaskTypeKey = attribute.Key("cicd.pipeline.task.type") // CICDSystemComponentKey is the attribute Key conforming to the // "cicd.system.component" semantic conventions. It represents the name of a // component of the CICD system. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "controller", "scheduler", "agent" CICDSystemComponentKey = attribute.Key("cicd.system.component") // CICDWorkerIDKey is the attribute Key conforming to the "cicd.worker.id" // semantic conventions. It represents the unique identifier of a worker within // a CICD system. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "abc123", "10.0.1.2", "controller" CICDWorkerIDKey = attribute.Key("cicd.worker.id") // CICDWorkerNameKey is the attribute Key conforming to the "cicd.worker.name" // semantic conventions. It represents the name of a worker within a CICD // system. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "agent-abc", "controller", "Ubuntu LTS" CICDWorkerNameKey = attribute.Key("cicd.worker.name") // CICDWorkerStateKey is the attribute Key conforming to the "cicd.worker.state" // semantic conventions. It represents the state of a CICD worker / agent. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "idle", "busy", "down" CICDWorkerStateKey = attribute.Key("cicd.worker.state") // CICDWorkerURLFullKey is the attribute Key conforming to the // "cicd.worker.url.full" semantic conventions. It represents the [URL] of the // worker, providing the complete address in order to locate and identify the // worker. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "https://cicd.example.org/worker/abc123" // // [URL]: https://wikipedia.org/wiki/URL CICDWorkerURLFullKey = attribute.Key("cicd.worker.url.full") ) // CICDPipelineName returns an attribute KeyValue conforming to the // "cicd.pipeline.name" semantic conventions. It represents the human readable // name of the pipeline within a CI/CD system. func CICDPipelineName(val string) attribute.KeyValue { return CICDPipelineNameKey.String(val) } // CICDPipelineRunID returns an attribute KeyValue conforming to the // "cicd.pipeline.run.id" semantic conventions. It represents the unique // identifier of a pipeline run within a CI/CD system. func CICDPipelineRunID(val string) attribute.KeyValue { return CICDPipelineRunIDKey.String(val) } // CICDPipelineRunURLFull returns an attribute KeyValue conforming to the // "cicd.pipeline.run.url.full" semantic conventions. It represents the [URL] of // the pipeline run, providing the complete address in order to locate and // identify the pipeline run. // // [URL]: https://wikipedia.org/wiki/URL func CICDPipelineRunURLFull(val string) attribute.KeyValue { return CICDPipelineRunURLFullKey.String(val) } // CICDPipelineTaskName returns an attribute KeyValue conforming to the // "cicd.pipeline.task.name" semantic conventions. It represents the human // readable name of a task within a pipeline. Task here most closely aligns with // a [computing process] in a pipeline. Other terms for tasks include commands, // steps, and procedures. // // [computing process]: https://wikipedia.org/wiki/Pipeline_(computing) func CICDPipelineTaskName(val string) attribute.KeyValue { return CICDPipelineTaskNameKey.String(val) } // CICDPipelineTaskRunID returns an attribute KeyValue conforming to the // "cicd.pipeline.task.run.id" semantic conventions. It represents the unique // identifier of a task run within a pipeline. func CICDPipelineTaskRunID(val string) attribute.KeyValue { return CICDPipelineTaskRunIDKey.String(val) } // CICDPipelineTaskRunURLFull returns an attribute KeyValue conforming to the // "cicd.pipeline.task.run.url.full" semantic conventions. It represents the // [URL] of the pipeline task run, providing the complete address in order to // locate and identify the pipeline task run. // // [URL]: https://wikipedia.org/wiki/URL func CICDPipelineTaskRunURLFull(val string) attribute.KeyValue { return CICDPipelineTaskRunURLFullKey.String(val) } // CICDSystemComponent returns an attribute KeyValue conforming to the // "cicd.system.component" semantic conventions. It represents the name of a // component of the CICD system. func CICDSystemComponent(val string) attribute.KeyValue { return CICDSystemComponentKey.String(val) } // CICDWorkerID returns an attribute KeyValue conforming to the "cicd.worker.id" // semantic conventions. It represents the unique identifier of a worker within a // CICD system. func CICDWorkerID(val string) attribute.KeyValue { return CICDWorkerIDKey.String(val) } // CICDWorkerName returns an attribute KeyValue conforming to the // "cicd.worker.name" semantic conventions. It represents the name of a worker // within a CICD system. func CICDWorkerName(val string) attribute.KeyValue { return CICDWorkerNameKey.String(val) } // CICDWorkerURLFull returns an attribute KeyValue conforming to the // "cicd.worker.url.full" semantic conventions. It represents the [URL] of the // worker, providing the complete address in order to locate and identify the // worker. // // [URL]: https://wikipedia.org/wiki/URL func CICDWorkerURLFull(val string) attribute.KeyValue { return CICDWorkerURLFullKey.String(val) } // Enum values for cicd.pipeline.action.name var ( // The pipeline run is executing a build. // Stability: development CICDPipelineActionNameBuild = CICDPipelineActionNameKey.String("BUILD") // The pipeline run is executing. // Stability: development CICDPipelineActionNameRun = CICDPipelineActionNameKey.String("RUN") // The pipeline run is executing a sync. // Stability: development CICDPipelineActionNameSync = CICDPipelineActionNameKey.String("SYNC") ) // Enum values for cicd.pipeline.result var ( // The pipeline run finished successfully. // Stability: development CICDPipelineResultSuccess = CICDPipelineResultKey.String("success") // The pipeline run did not finish successfully, eg. due to a compile error or a // failing test. Such failures are usually detected by non-zero exit codes of // the tools executed in the pipeline run. // Stability: development CICDPipelineResultFailure = CICDPipelineResultKey.String("failure") // The pipeline run failed due to an error in the CICD system, eg. due to the // worker being killed. // Stability: development CICDPipelineResultError = CICDPipelineResultKey.String("error") // A timeout caused the pipeline run to be interrupted. // Stability: development CICDPipelineResultTimeout = CICDPipelineResultKey.String("timeout") // The pipeline run was cancelled, eg. by a user manually cancelling the // pipeline run. // Stability: development CICDPipelineResultCancellation = CICDPipelineResultKey.String("cancellation") // The pipeline run was skipped, eg. due to a precondition not being met. // Stability: development CICDPipelineResultSkip = CICDPipelineResultKey.String("skip") ) // Enum values for cicd.pipeline.run.state var ( // The run pending state spans from the event triggering the pipeline run until // the execution of the run starts (eg. time spent in a queue, provisioning // agents, creating run resources). // // Stability: development CICDPipelineRunStatePending = CICDPipelineRunStateKey.String("pending") // The executing state spans the execution of any run tasks (eg. build, test). // Stability: development CICDPipelineRunStateExecuting = CICDPipelineRunStateKey.String("executing") // The finalizing state spans from when the run has finished executing (eg. // cleanup of run resources). // Stability: development CICDPipelineRunStateFinalizing = CICDPipelineRunStateKey.String("finalizing") ) // Enum values for cicd.pipeline.task.run.result var ( // The task run finished successfully. // Stability: development CICDPipelineTaskRunResultSuccess = CICDPipelineTaskRunResultKey.String("success") // The task run did not finish successfully, eg. due to a compile error or a // failing test. Such failures are usually detected by non-zero exit codes of // the tools executed in the task run. // Stability: development CICDPipelineTaskRunResultFailure = CICDPipelineTaskRunResultKey.String("failure") // The task run failed due to an error in the CICD system, eg. due to the worker // being killed. // Stability: development CICDPipelineTaskRunResultError = CICDPipelineTaskRunResultKey.String("error") // A timeout caused the task run to be interrupted. // Stability: development CICDPipelineTaskRunResultTimeout = CICDPipelineTaskRunResultKey.String("timeout") // The task run was cancelled, eg. by a user manually cancelling the task run. // Stability: development CICDPipelineTaskRunResultCancellation = CICDPipelineTaskRunResultKey.String("cancellation") // The task run was skipped, eg. due to a precondition not being met. // Stability: development CICDPipelineTaskRunResultSkip = CICDPipelineTaskRunResultKey.String("skip") ) // Enum values for cicd.pipeline.task.type var ( // build // Stability: development CICDPipelineTaskTypeBuild = CICDPipelineTaskTypeKey.String("build") // test // Stability: development CICDPipelineTaskTypeTest = CICDPipelineTaskTypeKey.String("test") // deploy // Stability: development CICDPipelineTaskTypeDeploy = CICDPipelineTaskTypeKey.String("deploy") ) // Enum values for cicd.worker.state var ( // The worker is not performing work for the CICD system. It is available to the // CICD system to perform work on (online / idle). // Stability: development CICDWorkerStateAvailable = CICDWorkerStateKey.String("available") // The worker is performing work for the CICD system. // Stability: development CICDWorkerStateBusy = CICDWorkerStateKey.String("busy") // The worker is not available to the CICD system (disconnected / down). // Stability: development CICDWorkerStateOffline = CICDWorkerStateKey.String("offline") ) // Namespace: client const ( // ClientAddressKey is the attribute Key conforming to the "client.address" // semantic conventions. It represents the client address - domain name if // available without reverse DNS lookup; otherwise, IP address or Unix domain // socket name. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "client.example.com", "10.1.2.80", "/tmp/my.sock" // Note: When observed from the server side, and when communicating through an // intermediary, `client.address` SHOULD represent the client address behind any // intermediaries, for example proxies, if it's available. ClientAddressKey = attribute.Key("client.address") // ClientPortKey is the attribute Key conforming to the "client.port" semantic // conventions. It represents the client port number. // // Type: int // RequirementLevel: Recommended // Stability: Stable // // Examples: 65123 // Note: When observed from the server side, and when communicating through an // intermediary, `client.port` SHOULD represent the client port behind any // intermediaries, for example proxies, if it's available. ClientPortKey = attribute.Key("client.port") ) // ClientAddress returns an attribute KeyValue conforming to the "client.address" // semantic conventions. It represents the client address - domain name if // available without reverse DNS lookup; otherwise, IP address or Unix domain // socket name. func ClientAddress(val string) attribute.KeyValue { return ClientAddressKey.String(val) } // ClientPort returns an attribute KeyValue conforming to the "client.port" // semantic conventions. It represents the client port number. func ClientPort(val int) attribute.KeyValue { return ClientPortKey.Int(val) } // Namespace: cloud const ( // CloudAccountIDKey is the attribute Key conforming to the "cloud.account.id" // semantic conventions. It represents the cloud account ID the resource is // assigned to. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "111111111111", "opentelemetry" CloudAccountIDKey = attribute.Key("cloud.account.id") // CloudAvailabilityZoneKey is the attribute Key conforming to the // "cloud.availability_zone" semantic conventions. It represents the cloud // regions often have multiple, isolated locations known as zones to increase // availability. Availability zone represents the zone where the resource is // running. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "us-east-1c" // Note: Availability zones are called "zones" on Alibaba Cloud and Google // Cloud. CloudAvailabilityZoneKey = attribute.Key("cloud.availability_zone") // CloudPlatformKey is the attribute Key conforming to the "cloud.platform" // semantic conventions. It represents the cloud platform in use. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // Note: The prefix of the service SHOULD match the one specified in // `cloud.provider`. CloudPlatformKey = attribute.Key("cloud.platform") // CloudProviderKey is the attribute Key conforming to the "cloud.provider" // semantic conventions. It represents the name of the cloud provider. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: CloudProviderKey = attribute.Key("cloud.provider") // CloudRegionKey is the attribute Key conforming to the "cloud.region" semantic // conventions. It represents the geographical region within a cloud provider. // When associated with a resource, this attribute specifies the region where // the resource operates. When calling services or APIs deployed on a cloud, // this attribute identifies the region where the called destination is // deployed. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "us-central1", "us-east-1" // Note: Refer to your provider's docs to see the available regions, for example // [Alibaba Cloud regions], [AWS regions], [Azure regions], // [Google Cloud regions], or [Tencent Cloud regions]. // // [Alibaba Cloud regions]: https://www.alibabacloud.com/help/doc-detail/40654.htm // [AWS regions]: https://aws.amazon.com/about-aws/global-infrastructure/regions_az/ // [Azure regions]: https://azure.microsoft.com/global-infrastructure/geographies/ // [Google Cloud regions]: https://cloud.google.com/about/locations // [Tencent Cloud regions]: https://www.tencentcloud.com/document/product/213/6091 CloudRegionKey = attribute.Key("cloud.region") // CloudResourceIDKey is the attribute Key conforming to the "cloud.resource_id" // semantic conventions. It represents the cloud provider-specific native // identifier of the monitored cloud resource (e.g. an [ARN] on AWS, a // [fully qualified resource ID] on Azure, a [full resource name] on GCP). // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "arn:aws:lambda:REGION:ACCOUNT_ID:function:my-function", // "//run.googleapis.com/projects/PROJECT_ID/locations/LOCATION_ID/services/SERVICE_ID", // "/subscriptions//resourceGroups/ // /providers/Microsoft.Web/sites//functions/" // Note: On some cloud providers, it may not be possible to determine the full // ID at startup, // so it may be necessary to set `cloud.resource_id` as a span attribute // instead. // // The exact value to use for `cloud.resource_id` depends on the cloud provider. // The following well-known definitions MUST be used if you set this attribute // and they apply: // // - **AWS Lambda:** The function [ARN]. // Take care not to use the "invoked ARN" directly but replace any // [alias suffix] // with the resolved function version, as the same runtime instance may be // invocable with // multiple different aliases. // - **GCP:** The [URI of the resource] // - **Azure:** The [Fully Qualified Resource ID] of the invoked function, // *not* the function app, having the form // // `/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/` // . // This means that a span attribute MUST be used, as an Azure function app // can host multiple functions that would usually share // a TracerProvider. // // // [ARN]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html // [fully qualified resource ID]: https://learn.microsoft.com/rest/api/resources/resources/get-by-id // [full resource name]: https://google.aip.dev/122#full-resource-names // [ARN]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html // [alias suffix]: https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html // [URI of the resource]: https://cloud.google.com/iam/docs/full-resource-names // [Fully Qualified Resource ID]: https://learn.microsoft.com/rest/api/resources/resources/get-by-id CloudResourceIDKey = attribute.Key("cloud.resource_id") ) // CloudAccountID returns an attribute KeyValue conforming to the // "cloud.account.id" semantic conventions. It represents the cloud account ID // the resource is assigned to. func CloudAccountID(val string) attribute.KeyValue { return CloudAccountIDKey.String(val) } // CloudAvailabilityZone returns an attribute KeyValue conforming to the // "cloud.availability_zone" semantic conventions. It represents the cloud // regions often have multiple, isolated locations known as zones to increase // availability. Availability zone represents the zone where the resource is // running. func CloudAvailabilityZone(val string) attribute.KeyValue { return CloudAvailabilityZoneKey.String(val) } // CloudRegion returns an attribute KeyValue conforming to the "cloud.region" // semantic conventions. It represents the geographical region within a cloud // provider. When associated with a resource, this attribute specifies the region // where the resource operates. When calling services or APIs deployed on a // cloud, this attribute identifies the region where the called destination is // deployed. func CloudRegion(val string) attribute.KeyValue { return CloudRegionKey.String(val) } // CloudResourceID returns an attribute KeyValue conforming to the // "cloud.resource_id" semantic conventions. It represents the cloud // provider-specific native identifier of the monitored cloud resource (e.g. an // [ARN] on AWS, a [fully qualified resource ID] on Azure, a [full resource name] // on GCP). // // [ARN]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html // [fully qualified resource ID]: https://learn.microsoft.com/rest/api/resources/resources/get-by-id // [full resource name]: https://google.aip.dev/122#full-resource-names func CloudResourceID(val string) attribute.KeyValue { return CloudResourceIDKey.String(val) } // Enum values for cloud.platform var ( // Akamai Cloud Compute // Stability: development CloudPlatformAkamaiCloudCompute = CloudPlatformKey.String("akamai_cloud.compute") // Alibaba Cloud Elastic Compute Service // Stability: development CloudPlatformAlibabaCloudECS = CloudPlatformKey.String("alibaba_cloud_ecs") // Alibaba Cloud Function Compute // Stability: development CloudPlatformAlibabaCloudFC = CloudPlatformKey.String("alibaba_cloud_fc") // Red Hat OpenShift on Alibaba Cloud // Stability: development CloudPlatformAlibabaCloudOpenShift = CloudPlatformKey.String("alibaba_cloud_openshift") // AWS Elastic Compute Cloud // Stability: development CloudPlatformAWSEC2 = CloudPlatformKey.String("aws_ec2") // AWS Elastic Container Service // Stability: development CloudPlatformAWSECS = CloudPlatformKey.String("aws_ecs") // AWS Elastic Kubernetes Service // Stability: development CloudPlatformAWSEKS = CloudPlatformKey.String("aws_eks") // AWS Lambda // Stability: development CloudPlatformAWSLambda = CloudPlatformKey.String("aws_lambda") // AWS Elastic Beanstalk // Stability: development CloudPlatformAWSElasticBeanstalk = CloudPlatformKey.String("aws_elastic_beanstalk") // AWS App Runner // Stability: development CloudPlatformAWSAppRunner = CloudPlatformKey.String("aws_app_runner") // Red Hat OpenShift on AWS (ROSA) // Stability: development CloudPlatformAWSOpenShift = CloudPlatformKey.String("aws_openshift") // Azure Virtual Machines // Stability: development CloudPlatformAzureVM = CloudPlatformKey.String("azure.vm") // Azure Container Apps // Stability: development CloudPlatformAzureContainerApps = CloudPlatformKey.String("azure.container_apps") // Azure Container Instances // Stability: development CloudPlatformAzureContainerInstances = CloudPlatformKey.String("azure.container_instances") // Azure Kubernetes Service // Stability: development CloudPlatformAzureAKS = CloudPlatformKey.String("azure.aks") // Azure Functions // Stability: development CloudPlatformAzureFunctions = CloudPlatformKey.String("azure.functions") // Azure App Service // Stability: development CloudPlatformAzureAppService = CloudPlatformKey.String("azure.app_service") // Azure Red Hat OpenShift // Stability: development CloudPlatformAzureOpenShift = CloudPlatformKey.String("azure.openshift") // Google Vertex AI Agent Engine // Stability: development CloudPlatformGCPAgentEngine = CloudPlatformKey.String("gcp.agent_engine") // Google Bare Metal Solution (BMS) // Stability: development CloudPlatformGCPBareMetalSolution = CloudPlatformKey.String("gcp_bare_metal_solution") // Google Cloud Compute Engine (GCE) // Stability: development CloudPlatformGCPComputeEngine = CloudPlatformKey.String("gcp_compute_engine") // Google Cloud Run // Stability: development CloudPlatformGCPCloudRun = CloudPlatformKey.String("gcp_cloud_run") // Google Cloud Kubernetes Engine (GKE) // Stability: development CloudPlatformGCPKubernetesEngine = CloudPlatformKey.String("gcp_kubernetes_engine") // Google Cloud Functions (GCF) // Stability: development CloudPlatformGCPCloudFunctions = CloudPlatformKey.String("gcp_cloud_functions") // Google Cloud App Engine (GAE) // Stability: development CloudPlatformGCPAppEngine = CloudPlatformKey.String("gcp_app_engine") // Red Hat OpenShift on Google Cloud // Stability: development CloudPlatformGCPOpenShift = CloudPlatformKey.String("gcp_openshift") // Server on Hetzner Cloud // Stability: development CloudPlatformHetznerCloudServer = CloudPlatformKey.String("hetzner.cloud_server") // Red Hat OpenShift on IBM Cloud // Stability: development CloudPlatformIBMCloudOpenShift = CloudPlatformKey.String("ibm_cloud_openshift") // Compute on Oracle Cloud Infrastructure (OCI) // Stability: development CloudPlatformOracleCloudCompute = CloudPlatformKey.String("oracle_cloud_compute") // Kubernetes Engine (OKE) on Oracle Cloud Infrastructure (OCI) // Stability: development CloudPlatformOracleCloudOKE = CloudPlatformKey.String("oracle_cloud_oke") // Tencent Cloud Cloud Virtual Machine (CVM) // Stability: development CloudPlatformTencentCloudCVM = CloudPlatformKey.String("tencent_cloud_cvm") // Tencent Cloud Elastic Kubernetes Service (EKS) // Stability: development CloudPlatformTencentCloudEKS = CloudPlatformKey.String("tencent_cloud_eks") // Tencent Cloud Serverless Cloud Function (SCF) // Stability: development CloudPlatformTencentCloudSCF = CloudPlatformKey.String("tencent_cloud_scf") // Vultr Cloud Compute // Stability: development CloudPlatformVultrCloudCompute = CloudPlatformKey.String("vultr.cloud_compute") ) // Enum values for cloud.provider var ( // Akamai Cloud // Stability: development CloudProviderAkamaiCloud = CloudProviderKey.String("akamai_cloud") // Alibaba Cloud // Stability: development CloudProviderAlibabaCloud = CloudProviderKey.String("alibaba_cloud") // Amazon Web Services // Stability: development CloudProviderAWS = CloudProviderKey.String("aws") // Microsoft Azure // Stability: development CloudProviderAzure = CloudProviderKey.String("azure") // Google Cloud Platform // Stability: development CloudProviderGCP = CloudProviderKey.String("gcp") // Heroku Platform as a Service // Stability: development CloudProviderHeroku = CloudProviderKey.String("heroku") // Hetzner // Stability: development CloudProviderHetzner = CloudProviderKey.String("hetzner") // IBM Cloud // Stability: development CloudProviderIBMCloud = CloudProviderKey.String("ibm_cloud") // Oracle Cloud Infrastructure (OCI) // Stability: development CloudProviderOracleCloud = CloudProviderKey.String("oracle_cloud") // Tencent Cloud // Stability: development CloudProviderTencentCloud = CloudProviderKey.String("tencent_cloud") // Vultr // Stability: development CloudProviderVultr = CloudProviderKey.String("vultr") ) // Namespace: cloudevents const ( // CloudEventsEventIDKey is the attribute Key conforming to the // "cloudevents.event_id" semantic conventions. It represents the [event_id] // uniquely identifies the event. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "123e4567-e89b-12d3-a456-426614174000", "0001" // // [event_id]: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id CloudEventsEventIDKey = attribute.Key("cloudevents.event_id") // CloudEventsEventSourceKey is the attribute Key conforming to the // "cloudevents.event_source" semantic conventions. It represents the [source] // identifies the context in which an event happened. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "https://github.com/cloudevents", "/cloudevents/spec/pull/123", // "my-service" // // [source]: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1 CloudEventsEventSourceKey = attribute.Key("cloudevents.event_source") // CloudEventsEventSpecVersionKey is the attribute Key conforming to the // "cloudevents.event_spec_version" semantic conventions. It represents the // [version of the CloudEvents specification] which the event uses. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: 1.0 // // [version of the CloudEvents specification]: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion CloudEventsEventSpecVersionKey = attribute.Key("cloudevents.event_spec_version") // CloudEventsEventSubjectKey is the attribute Key conforming to the // "cloudevents.event_subject" semantic conventions. It represents the [subject] // of the event in the context of the event producer (identified by source). // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: mynewfile.jpg // // [subject]: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject CloudEventsEventSubjectKey = attribute.Key("cloudevents.event_subject") // CloudEventsEventTypeKey is the attribute Key conforming to the // "cloudevents.event_type" semantic conventions. It represents the [event_type] // contains a value describing the type of event related to the originating // occurrence. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "com.github.pull_request.opened", "com.example.object.deleted.v2" // // [event_type]: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type CloudEventsEventTypeKey = attribute.Key("cloudevents.event_type") ) // CloudEventsEventID returns an attribute KeyValue conforming to the // "cloudevents.event_id" semantic conventions. It represents the [event_id] // uniquely identifies the event. // // [event_id]: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id func CloudEventsEventID(val string) attribute.KeyValue { return CloudEventsEventIDKey.String(val) } // CloudEventsEventSource returns an attribute KeyValue conforming to the // "cloudevents.event_source" semantic conventions. It represents the [source] // identifies the context in which an event happened. // // [source]: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1 func CloudEventsEventSource(val string) attribute.KeyValue { return CloudEventsEventSourceKey.String(val) } // CloudEventsEventSpecVersion returns an attribute KeyValue conforming to the // "cloudevents.event_spec_version" semantic conventions. It represents the // [version of the CloudEvents specification] which the event uses. // // [version of the CloudEvents specification]: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion func CloudEventsEventSpecVersion(val string) attribute.KeyValue { return CloudEventsEventSpecVersionKey.String(val) } // CloudEventsEventSubject returns an attribute KeyValue conforming to the // "cloudevents.event_subject" semantic conventions. It represents the [subject] // of the event in the context of the event producer (identified by source). // // [subject]: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject func CloudEventsEventSubject(val string) attribute.KeyValue { return CloudEventsEventSubjectKey.String(val) } // CloudEventsEventType returns an attribute KeyValue conforming to the // "cloudevents.event_type" semantic conventions. It represents the [event_type] // contains a value describing the type of event related to the originating // occurrence. // // [event_type]: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type func CloudEventsEventType(val string) attribute.KeyValue { return CloudEventsEventTypeKey.String(val) } // Namespace: cloudfoundry const ( // CloudFoundryAppIDKey is the attribute Key conforming to the // "cloudfoundry.app.id" semantic conventions. It represents the guid of the // application. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "218fc5a9-a5f1-4b54-aa05-46717d0ab26d" // Note: Application instrumentation should use the value from environment // variable `VCAP_APPLICATION.application_id`. This is the same value as // reported by `cf app --guid`. CloudFoundryAppIDKey = attribute.Key("cloudfoundry.app.id") // CloudFoundryAppInstanceIDKey is the attribute Key conforming to the // "cloudfoundry.app.instance.id" semantic conventions. It represents the index // of the application instance. 0 when just one instance is active. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "0", "1" // Note: CloudFoundry defines the `instance_id` in the [Loggregator v2 envelope] // . // It is used for logs and metrics emitted by CloudFoundry. It is // supposed to contain the application instance index for applications // deployed on the runtime. // // Application instrumentation should use the value from environment // variable `CF_INSTANCE_INDEX`. // // [Loggregator v2 envelope]: https://github.com/cloudfoundry/loggregator-api#v2-envelope CloudFoundryAppInstanceIDKey = attribute.Key("cloudfoundry.app.instance.id") // CloudFoundryAppNameKey is the attribute Key conforming to the // "cloudfoundry.app.name" semantic conventions. It represents the name of the // application. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "my-app-name" // Note: Application instrumentation should use the value from environment // variable `VCAP_APPLICATION.application_name`. This is the same value // as reported by `cf apps`. CloudFoundryAppNameKey = attribute.Key("cloudfoundry.app.name") // CloudFoundryOrgIDKey is the attribute Key conforming to the // "cloudfoundry.org.id" semantic conventions. It represents the guid of the // CloudFoundry org the application is running in. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "218fc5a9-a5f1-4b54-aa05-46717d0ab26d" // Note: Application instrumentation should use the value from environment // variable `VCAP_APPLICATION.org_id`. This is the same value as // reported by `cf org --guid`. CloudFoundryOrgIDKey = attribute.Key("cloudfoundry.org.id") // CloudFoundryOrgNameKey is the attribute Key conforming to the // "cloudfoundry.org.name" semantic conventions. It represents the name of the // CloudFoundry organization the app is running in. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "my-org-name" // Note: Application instrumentation should use the value from environment // variable `VCAP_APPLICATION.org_name`. This is the same value as // reported by `cf orgs`. CloudFoundryOrgNameKey = attribute.Key("cloudfoundry.org.name") // CloudFoundryProcessIDKey is the attribute Key conforming to the // "cloudfoundry.process.id" semantic conventions. It represents the UID // identifying the process. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "218fc5a9-a5f1-4b54-aa05-46717d0ab26d" // Note: Application instrumentation should use the value from environment // variable `VCAP_APPLICATION.process_id`. It is supposed to be equal to // `VCAP_APPLICATION.app_id` for applications deployed to the runtime. // For system components, this could be the actual PID. CloudFoundryProcessIDKey = attribute.Key("cloudfoundry.process.id") // CloudFoundryProcessTypeKey is the attribute Key conforming to the // "cloudfoundry.process.type" semantic conventions. It represents the type of // process. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "web" // Note: CloudFoundry applications can consist of multiple jobs. Usually the // main process will be of type `web`. There can be additional background // tasks or side-cars with different process types. CloudFoundryProcessTypeKey = attribute.Key("cloudfoundry.process.type") // CloudFoundrySpaceIDKey is the attribute Key conforming to the // "cloudfoundry.space.id" semantic conventions. It represents the guid of the // CloudFoundry space the application is running in. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "218fc5a9-a5f1-4b54-aa05-46717d0ab26d" // Note: Application instrumentation should use the value from environment // variable `VCAP_APPLICATION.space_id`. This is the same value as // reported by `cf space --guid`. CloudFoundrySpaceIDKey = attribute.Key("cloudfoundry.space.id") // CloudFoundrySpaceNameKey is the attribute Key conforming to the // "cloudfoundry.space.name" semantic conventions. It represents the name of the // CloudFoundry space the application is running in. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "my-space-name" // Note: Application instrumentation should use the value from environment // variable `VCAP_APPLICATION.space_name`. This is the same value as // reported by `cf spaces`. CloudFoundrySpaceNameKey = attribute.Key("cloudfoundry.space.name") // CloudFoundrySystemIDKey is the attribute Key conforming to the // "cloudfoundry.system.id" semantic conventions. It represents a guid or // another name describing the event source. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "cf/gorouter" // Note: CloudFoundry defines the `source_id` in the [Loggregator v2 envelope]. // It is used for logs and metrics emitted by CloudFoundry. It is // supposed to contain the component name, e.g. "gorouter", for // CloudFoundry components. // // When system components are instrumented, values from the // [Bosh spec] // should be used. The `system.id` should be set to // `spec.deployment/spec.name`. // // [Loggregator v2 envelope]: https://github.com/cloudfoundry/loggregator-api#v2-envelope // [Bosh spec]: https://bosh.io/docs/jobs/#properties-spec CloudFoundrySystemIDKey = attribute.Key("cloudfoundry.system.id") // CloudFoundrySystemInstanceIDKey is the attribute Key conforming to the // "cloudfoundry.system.instance.id" semantic conventions. It represents a guid // describing the concrete instance of the event source. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "218fc5a9-a5f1-4b54-aa05-46717d0ab26d" // Note: CloudFoundry defines the `instance_id` in the [Loggregator v2 envelope] // . // It is used for logs and metrics emitted by CloudFoundry. It is // supposed to contain the vm id for CloudFoundry components. // // When system components are instrumented, values from the // [Bosh spec] // should be used. The `system.instance.id` should be set to `spec.id`. // // [Loggregator v2 envelope]: https://github.com/cloudfoundry/loggregator-api#v2-envelope // [Bosh spec]: https://bosh.io/docs/jobs/#properties-spec CloudFoundrySystemInstanceIDKey = attribute.Key("cloudfoundry.system.instance.id") ) // CloudFoundryAppID returns an attribute KeyValue conforming to the // "cloudfoundry.app.id" semantic conventions. It represents the guid of the // application. func CloudFoundryAppID(val string) attribute.KeyValue { return CloudFoundryAppIDKey.String(val) } // CloudFoundryAppInstanceID returns an attribute KeyValue conforming to the // "cloudfoundry.app.instance.id" semantic conventions. It represents the index // of the application instance. 0 when just one instance is active. func CloudFoundryAppInstanceID(val string) attribute.KeyValue { return CloudFoundryAppInstanceIDKey.String(val) } // CloudFoundryAppName returns an attribute KeyValue conforming to the // "cloudfoundry.app.name" semantic conventions. It represents the name of the // application. func CloudFoundryAppName(val string) attribute.KeyValue { return CloudFoundryAppNameKey.String(val) } // CloudFoundryOrgID returns an attribute KeyValue conforming to the // "cloudfoundry.org.id" semantic conventions. It represents the guid of the // CloudFoundry org the application is running in. func CloudFoundryOrgID(val string) attribute.KeyValue { return CloudFoundryOrgIDKey.String(val) } // CloudFoundryOrgName returns an attribute KeyValue conforming to the // "cloudfoundry.org.name" semantic conventions. It represents the name of the // CloudFoundry organization the app is running in. func CloudFoundryOrgName(val string) attribute.KeyValue { return CloudFoundryOrgNameKey.String(val) } // CloudFoundryProcessID returns an attribute KeyValue conforming to the // "cloudfoundry.process.id" semantic conventions. It represents the UID // identifying the process. func CloudFoundryProcessID(val string) attribute.KeyValue { return CloudFoundryProcessIDKey.String(val) } // CloudFoundryProcessType returns an attribute KeyValue conforming to the // "cloudfoundry.process.type" semantic conventions. It represents the type of // process. func CloudFoundryProcessType(val string) attribute.KeyValue { return CloudFoundryProcessTypeKey.String(val) } // CloudFoundrySpaceID returns an attribute KeyValue conforming to the // "cloudfoundry.space.id" semantic conventions. It represents the guid of the // CloudFoundry space the application is running in. func CloudFoundrySpaceID(val string) attribute.KeyValue { return CloudFoundrySpaceIDKey.String(val) } // CloudFoundrySpaceName returns an attribute KeyValue conforming to the // "cloudfoundry.space.name" semantic conventions. It represents the name of the // CloudFoundry space the application is running in. func CloudFoundrySpaceName(val string) attribute.KeyValue { return CloudFoundrySpaceNameKey.String(val) } // CloudFoundrySystemID returns an attribute KeyValue conforming to the // "cloudfoundry.system.id" semantic conventions. It represents a guid or another // name describing the event source. func CloudFoundrySystemID(val string) attribute.KeyValue { return CloudFoundrySystemIDKey.String(val) } // CloudFoundrySystemInstanceID returns an attribute KeyValue conforming to the // "cloudfoundry.system.instance.id" semantic conventions. It represents a guid // describing the concrete instance of the event source. func CloudFoundrySystemInstanceID(val string) attribute.KeyValue { return CloudFoundrySystemInstanceIDKey.String(val) } // Namespace: code const ( // CodeColumnNumberKey is the attribute Key conforming to the // "code.column.number" semantic conventions. It represents the column number in // `code.file.path` best representing the operation. It SHOULD point within the // code unit named in `code.function.name`. This attribute MUST NOT be used on // the Profile signal since the data is already captured in 'message Line'. This // constraint is imposed to prevent redundancy and maintain data integrity. // // Type: int // RequirementLevel: Recommended // Stability: Stable CodeColumnNumberKey = attribute.Key("code.column.number") // CodeFilePathKey is the attribute Key conforming to the "code.file.path" // semantic conventions. It represents the source code file name that identifies // the code unit as uniquely as possible (preferably an absolute file path). // This attribute MUST NOT be used on the Profile signal since the data is // already captured in 'message Function'. This constraint is imposed to prevent // redundancy and maintain data integrity. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: /usr/local/MyApplication/content_root/app/index.php CodeFilePathKey = attribute.Key("code.file.path") // CodeFunctionNameKey is the attribute Key conforming to the // "code.function.name" semantic conventions. It represents the method or // function fully-qualified name without arguments. The value should fit the // natural representation of the language runtime, which is also likely the same // used within `code.stacktrace` attribute value. This attribute MUST NOT be // used on the Profile signal since the data is already captured in 'message // Function'. This constraint is imposed to prevent redundancy and maintain data // integrity. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "com.example.MyHttpService.serveRequest", // "GuzzleHttp\Client::transfer", "fopen" // Note: Values and format depends on each language runtime, thus it is // impossible to provide an exhaustive list of examples. // The values are usually the same (or prefixes of) the ones found in native // stack trace representation stored in // `code.stacktrace` without information on arguments. // // Examples: // // - Java method: `com.example.MyHttpService.serveRequest` // - Java anonymous class method: `com.mycompany.Main$1.myMethod` // - Java lambda method: // `com.mycompany.Main$$Lambda/0x0000748ae4149c00.myMethod` // - PHP function: `GuzzleHttp\Client::transfer` // - Go function: `github.com/my/repo/pkg.foo.func5` // - Elixir: `OpenTelemetry.Ctx.new` // - Erlang: `opentelemetry_ctx:new` // - Rust: `playground::my_module::my_cool_func` // - C function: `fopen` CodeFunctionNameKey = attribute.Key("code.function.name") // CodeLineNumberKey is the attribute Key conforming to the "code.line.number" // semantic conventions. It represents the line number in `code.file.path` best // representing the operation. It SHOULD point within the code unit named in // `code.function.name`. This attribute MUST NOT be used on the Profile signal // since the data is already captured in 'message Line'. This constraint is // imposed to prevent redundancy and maintain data integrity. // // Type: int // RequirementLevel: Recommended // Stability: Stable CodeLineNumberKey = attribute.Key("code.line.number") // CodeStacktraceKey is the attribute Key conforming to the "code.stacktrace" // semantic conventions. It represents a stacktrace as a string in the natural // representation for the language runtime. The representation is identical to // [`exception.stacktrace`]. This attribute MUST NOT be used on the Profile // signal since the data is already captured in 'message Location'. This // constraint is imposed to prevent redundancy and maintain data integrity. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\n at // com.example.GenerateTrace.methodA(GenerateTrace.java:9)\n at // com.example.GenerateTrace.main(GenerateTrace.java:5) // // [`exception.stacktrace`]: /docs/exceptions/exceptions-spans.md#stacktrace-representation CodeStacktraceKey = attribute.Key("code.stacktrace") ) // CodeColumnNumber returns an attribute KeyValue conforming to the // "code.column.number" semantic conventions. It represents the column number in // `code.file.path` best representing the operation. It SHOULD point within the // code unit named in `code.function.name`. This attribute MUST NOT be used on // the Profile signal since the data is already captured in 'message Line'. This // constraint is imposed to prevent redundancy and maintain data integrity. func CodeColumnNumber(val int) attribute.KeyValue { return CodeColumnNumberKey.Int(val) } // CodeFilePath returns an attribute KeyValue conforming to the "code.file.path" // semantic conventions. It represents the source code file name that identifies // the code unit as uniquely as possible (preferably an absolute file path). This // attribute MUST NOT be used on the Profile signal since the data is already // captured in 'message Function'. This constraint is imposed to prevent // redundancy and maintain data integrity. func CodeFilePath(val string) attribute.KeyValue { return CodeFilePathKey.String(val) } // CodeFunctionName returns an attribute KeyValue conforming to the // "code.function.name" semantic conventions. It represents the method or // function fully-qualified name without arguments. The value should fit the // natural representation of the language runtime, which is also likely the same // used within `code.stacktrace` attribute value. This attribute MUST NOT be used // on the Profile signal since the data is already captured in 'message // Function'. This constraint is imposed to prevent redundancy and maintain data // integrity. func CodeFunctionName(val string) attribute.KeyValue { return CodeFunctionNameKey.String(val) } // CodeLineNumber returns an attribute KeyValue conforming to the // "code.line.number" semantic conventions. It represents the line number in // `code.file.path` best representing the operation. It SHOULD point within the // code unit named in `code.function.name`. This attribute MUST NOT be used on // the Profile signal since the data is already captured in 'message Line'. This // constraint is imposed to prevent redundancy and maintain data integrity. func CodeLineNumber(val int) attribute.KeyValue { return CodeLineNumberKey.Int(val) } // CodeStacktrace returns an attribute KeyValue conforming to the // "code.stacktrace" semantic conventions. It represents a stacktrace as a string // in the natural representation for the language runtime. The representation is // identical to [`exception.stacktrace`]. This attribute MUST NOT be used on the // Profile signal since the data is already captured in 'message Location'. This // constraint is imposed to prevent redundancy and maintain data integrity. // // [`exception.stacktrace`]: /docs/exceptions/exceptions-spans.md#stacktrace-representation func CodeStacktrace(val string) attribute.KeyValue { return CodeStacktraceKey.String(val) } // Namespace: container const ( // ContainerCommandKey is the attribute Key conforming to the // "container.command" semantic conventions. It represents the command used to // run the container (i.e. the command name). // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "otelcontribcol" // Note: If using embedded credentials or sensitive data, it is recommended to // remove them to prevent potential leakage. ContainerCommandKey = attribute.Key("container.command") // ContainerCommandArgsKey is the attribute Key conforming to the // "container.command_args" semantic conventions. It represents the all the // command arguments (including the command/executable itself) run by the // container. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "otelcontribcol", "--config", "config.yaml" ContainerCommandArgsKey = attribute.Key("container.command_args") // ContainerCommandLineKey is the attribute Key conforming to the // "container.command_line" semantic conventions. It represents the full command // run by the container as a single string representing the full command. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "otelcontribcol --config config.yaml" ContainerCommandLineKey = attribute.Key("container.command_line") // ContainerCSIPluginNameKey is the attribute Key conforming to the // "container.csi.plugin.name" semantic conventions. It represents the name of // the CSI ([Container Storage Interface]) plugin used by the volume. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "pd.csi.storage.gke.io" // Note: This can sometimes be referred to as a "driver" in CSI implementations. // This should represent the `name` field of the GetPluginInfo RPC. // // [Container Storage Interface]: https://github.com/container-storage-interface/spec ContainerCSIPluginNameKey = attribute.Key("container.csi.plugin.name") // ContainerCSIVolumeIDKey is the attribute Key conforming to the // "container.csi.volume.id" semantic conventions. It represents the unique // volume ID returned by the CSI ([Container Storage Interface]) plugin. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "projects/my-gcp-project/zones/my-gcp-zone/disks/my-gcp-disk" // Note: This can sometimes be referred to as a "volume handle" in CSI // implementations. This should represent the `Volume.volume_id` field in CSI // spec. // // [Container Storage Interface]: https://github.com/container-storage-interface/spec ContainerCSIVolumeIDKey = attribute.Key("container.csi.volume.id") // ContainerIDKey is the attribute Key conforming to the "container.id" semantic // conventions. It represents the container ID. Usually a UUID, as for example // used to [identify Docker containers]. The UUID might be abbreviated. // // Type: string // RequirementLevel: Recommended // Stability: Alpha // // Examples: "a3bf90e006b2" // // [identify Docker containers]: https://docs.docker.com/engine/containers/run/#container-identification ContainerIDKey = attribute.Key("container.id") // ContainerImageIDKey is the attribute Key conforming to the // "container.image.id" semantic conventions. It represents the runtime specific // image identifier. Usually a hash algorithm followed by a UUID. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: // "sha256:19c92d0a00d1b66d897bceaa7319bee0dd38a10a851c60bcec9474aa3f01e50f" // Note: Docker defines a sha256 of the image id; `container.image.id` // corresponds to the `Image` field from the Docker container inspect [API] // endpoint. // K8s defines a link to the container registry repository with digest // `"imageID": "registry.azurecr.io /namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625"` // . // The ID is assigned by the container runtime and can vary in different // environments. Consider using `oci.manifest.digest` if it is important to // identify the same image in different environments/runtimes. // // [API]: https://docs.docker.com/reference/api/engine/version/v1.52/#tag/Container/operation/ContainerInspect ContainerImageIDKey = attribute.Key("container.image.id") // ContainerImageNameKey is the attribute Key conforming to the // "container.image.name" semantic conventions. It represents the name of the // image the container was built on. // // Type: string // RequirementLevel: Recommended // Stability: Alpha // // Examples: "gcr.io/opentelemetry/operator" ContainerImageNameKey = attribute.Key("container.image.name") // ContainerImageRepoDigestsKey is the attribute Key conforming to the // "container.image.repo_digests" semantic conventions. It represents the repo // digests of the container image as provided by the container runtime. // // Type: string[] // RequirementLevel: Recommended // Stability: Alpha // // Examples: // "example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb", // "internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578" // Note: [Docker] and [CRI] report those under the `RepoDigests` field. // // [Docker]: https://docs.docker.com/reference/api/engine/version/v1.52/#tag/Image/operation/ImageInspect // [CRI]: https://github.com/kubernetes/cri-api/blob/c75ef5b473bbe2d0a4fc92f82235efd665ea8e9f/pkg/apis/runtime/v1/api.proto#L1237-L1238 ContainerImageRepoDigestsKey = attribute.Key("container.image.repo_digests") // ContainerImageTagsKey is the attribute Key conforming to the // "container.image.tags" semantic conventions. It represents the container // image tags. An example can be found in [Docker Image Inspect]. Should be only // the `` section of the full name for example from // `registry.example.com/my-org/my-image:`. // // Type: string[] // RequirementLevel: Recommended // Stability: Alpha // // Examples: "v1.27.1", "3.5.7-0" // // [Docker Image Inspect]: https://docs.docker.com/reference/api/engine/version/v1.52/#tag/Image/operation/ImageInspect ContainerImageTagsKey = attribute.Key("container.image.tags") // ContainerNameKey is the attribute Key conforming to the "container.name" // semantic conventions. It represents the container name used by container // runtime. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "opentelemetry-autoconf" ContainerNameKey = attribute.Key("container.name") // ContainerRuntimeDescriptionKey is the attribute Key conforming to the // "container.runtime.description" semantic conventions. It represents a // description about the runtime which could include, for example details about // the CRI/API version being used or other customisations. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "docker://19.3.1 - CRI: 1.22.0" ContainerRuntimeDescriptionKey = attribute.Key("container.runtime.description") // ContainerRuntimeNameKey is the attribute Key conforming to the // "container.runtime.name" semantic conventions. It represents the container // runtime managing this container. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "docker", "containerd", "rkt" ContainerRuntimeNameKey = attribute.Key("container.runtime.name") // ContainerRuntimeVersionKey is the attribute Key conforming to the // "container.runtime.version" semantic conventions. It represents the version // of the runtime of this process, as returned by the runtime without // modification. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: 1.0.0 ContainerRuntimeVersionKey = attribute.Key("container.runtime.version") ) // ContainerCommand returns an attribute KeyValue conforming to the // "container.command" semantic conventions. It represents the command used to // run the container (i.e. the command name). func ContainerCommand(val string) attribute.KeyValue { return ContainerCommandKey.String(val) } // ContainerCommandArgs returns an attribute KeyValue conforming to the // "container.command_args" semantic conventions. It represents the all the // command arguments (including the command/executable itself) run by the // container. func ContainerCommandArgs(val ...string) attribute.KeyValue { return ContainerCommandArgsKey.StringSlice(val) } // ContainerCommandLine returns an attribute KeyValue conforming to the // "container.command_line" semantic conventions. It represents the full command // run by the container as a single string representing the full command. func ContainerCommandLine(val string) attribute.KeyValue { return ContainerCommandLineKey.String(val) } // ContainerCSIPluginName returns an attribute KeyValue conforming to the // "container.csi.plugin.name" semantic conventions. It represents the name of // the CSI ([Container Storage Interface]) plugin used by the volume. // // [Container Storage Interface]: https://github.com/container-storage-interface/spec func ContainerCSIPluginName(val string) attribute.KeyValue { return ContainerCSIPluginNameKey.String(val) } // ContainerCSIVolumeID returns an attribute KeyValue conforming to the // "container.csi.volume.id" semantic conventions. It represents the unique // volume ID returned by the CSI ([Container Storage Interface]) plugin. // // [Container Storage Interface]: https://github.com/container-storage-interface/spec func ContainerCSIVolumeID(val string) attribute.KeyValue { return ContainerCSIVolumeIDKey.String(val) } // ContainerID returns an attribute KeyValue conforming to the "container.id" // semantic conventions. It represents the container ID. Usually a UUID, as for // example used to [identify Docker containers]. The UUID might be abbreviated. // // [identify Docker containers]: https://docs.docker.com/engine/containers/run/#container-identification func ContainerID(val string) attribute.KeyValue { return ContainerIDKey.String(val) } // ContainerImageID returns an attribute KeyValue conforming to the // "container.image.id" semantic conventions. It represents the runtime specific // image identifier. Usually a hash algorithm followed by a UUID. func ContainerImageID(val string) attribute.KeyValue { return ContainerImageIDKey.String(val) } // ContainerImageName returns an attribute KeyValue conforming to the // "container.image.name" semantic conventions. It represents the name of the // image the container was built on. func ContainerImageName(val string) attribute.KeyValue { return ContainerImageNameKey.String(val) } // ContainerImageRepoDigests returns an attribute KeyValue conforming to the // "container.image.repo_digests" semantic conventions. It represents the repo // digests of the container image as provided by the container runtime. func ContainerImageRepoDigests(val ...string) attribute.KeyValue { return ContainerImageRepoDigestsKey.StringSlice(val) } // ContainerImageTags returns an attribute KeyValue conforming to the // "container.image.tags" semantic conventions. It represents the container image // tags. An example can be found in [Docker Image Inspect]. Should be only the // `` section of the full name for example from // `registry.example.com/my-org/my-image:`. // // [Docker Image Inspect]: https://docs.docker.com/reference/api/engine/version/v1.52/#tag/Image/operation/ImageInspect func ContainerImageTags(val ...string) attribute.KeyValue { return ContainerImageTagsKey.StringSlice(val) } // ContainerLabel returns an attribute KeyValue conforming to the // "container.label" semantic conventions. It represents the container labels, // `` being the label name, the value being the label value. func ContainerLabel(key string, val string) attribute.KeyValue { return attribute.String("container.label."+key, val) } // ContainerName returns an attribute KeyValue conforming to the "container.name" // semantic conventions. It represents the container name used by container // runtime. func ContainerName(val string) attribute.KeyValue { return ContainerNameKey.String(val) } // ContainerRuntimeDescription returns an attribute KeyValue conforming to the // "container.runtime.description" semantic conventions. It represents a // description about the runtime which could include, for example details about // the CRI/API version being used or other customisations. func ContainerRuntimeDescription(val string) attribute.KeyValue { return ContainerRuntimeDescriptionKey.String(val) } // ContainerRuntimeName returns an attribute KeyValue conforming to the // "container.runtime.name" semantic conventions. It represents the container // runtime managing this container. func ContainerRuntimeName(val string) attribute.KeyValue { return ContainerRuntimeNameKey.String(val) } // ContainerRuntimeVersion returns an attribute KeyValue conforming to the // "container.runtime.version" semantic conventions. It represents the version of // the runtime of this process, as returned by the runtime without modification. func ContainerRuntimeVersion(val string) attribute.KeyValue { return ContainerRuntimeVersionKey.String(val) } // Namespace: cpu const ( // CPULogicalNumberKey is the attribute Key conforming to the // "cpu.logical_number" semantic conventions. It represents the logical CPU // number [0..n-1]. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 1 CPULogicalNumberKey = attribute.Key("cpu.logical_number") // CPUModeKey is the attribute Key conforming to the "cpu.mode" semantic // conventions. It represents the mode of the CPU. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "user", "system" CPUModeKey = attribute.Key("cpu.mode") ) // CPULogicalNumber returns an attribute KeyValue conforming to the // "cpu.logical_number" semantic conventions. It represents the logical CPU // number [0..n-1]. func CPULogicalNumber(val int) attribute.KeyValue { return CPULogicalNumberKey.Int(val) } // Enum values for cpu.mode var ( // User // Stability: development CPUModeUser = CPUModeKey.String("user") // System // Stability: development CPUModeSystem = CPUModeKey.String("system") // Nice // Stability: development CPUModeNice = CPUModeKey.String("nice") // Idle // Stability: development CPUModeIdle = CPUModeKey.String("idle") // IO Wait // Stability: development CPUModeIOWait = CPUModeKey.String("iowait") // Interrupt // Stability: development CPUModeInterrupt = CPUModeKey.String("interrupt") // Steal // Stability: development CPUModeSteal = CPUModeKey.String("steal") // Kernel // Stability: development CPUModeKernel = CPUModeKey.String("kernel") ) // Namespace: db const ( // DBClientConnectionPoolNameKey is the attribute Key conforming to the // "db.client.connection.pool.name" semantic conventions. It represents the name // of the connection pool; unique within the instrumented application. In case // the connection pool implementation doesn't provide a name, instrumentation // SHOULD use a combination of parameters that would make the name unique, for // example, combining attributes `server.address`, `server.port`, and // `db.namespace`, formatted as `server.address:server.port/db.namespace`. // Instrumentations that generate connection pool name following different // patterns SHOULD document it. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "myDataSource" DBClientConnectionPoolNameKey = attribute.Key("db.client.connection.pool.name") // DBClientConnectionStateKey is the attribute Key conforming to the // "db.client.connection.state" semantic conventions. It represents the state of // a connection in the pool. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "idle" DBClientConnectionStateKey = attribute.Key("db.client.connection.state") // DBCollectionNameKey is the attribute Key conforming to the // "db.collection.name" semantic conventions. It represents the name of a // collection (table, container) within the database. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "public.users", "customers" // Note: It is RECOMMENDED to capture the value as provided by the application // without attempting to do any case normalization. // // The collection name SHOULD NOT be extracted from `db.query.text`, // when the database system supports query text with multiple collections // in non-batch operations. // // For batch operations, if the individual operations are known to have the same // collection name then that collection name SHOULD be used. DBCollectionNameKey = attribute.Key("db.collection.name") // DBNamespaceKey is the attribute Key conforming to the "db.namespace" semantic // conventions. It represents the name of the database, fully qualified within // the server address and port. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "customers", "test.users" // Note: If a database system has multiple namespace components, they SHOULD be // concatenated from the most general to the most specific namespace component, // using `|` as a separator between the components. Any missing components (and // their associated separators) SHOULD be omitted. // Semantic conventions for individual database systems SHOULD document what // `db.namespace` means in the context of that system. // It is RECOMMENDED to capture the value as provided by the application without // attempting to do any case normalization. DBNamespaceKey = attribute.Key("db.namespace") // DBOperationBatchSizeKey is the attribute Key conforming to the // "db.operation.batch.size" semantic conventions. It represents the number of // queries included in a batch operation. // // Type: int // RequirementLevel: Recommended // Stability: Stable // // Examples: 2, 3, 4 // Note: Operations are only considered batches when they contain two or more // operations, and so `db.operation.batch.size` SHOULD never be `1`. DBOperationBatchSizeKey = attribute.Key("db.operation.batch.size") // DBOperationNameKey is the attribute Key conforming to the "db.operation.name" // semantic conventions. It represents the name of the operation or command // being executed. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "findAndModify", "HMSET", "SELECT" // Note: It is RECOMMENDED to capture the value as provided by the application // without attempting to do any case normalization. // // The operation name SHOULD NOT be extracted from `db.query.text`, // when the database system supports query text with multiple operations // in non-batch operations. // // If spaces can occur in the operation name, multiple consecutive spaces // SHOULD be normalized to a single space. // // For batch operations, if the individual operations are known to have the same // operation name // then that operation name SHOULD be used prepended by `BATCH `, // otherwise `db.operation.name` SHOULD be `BATCH` or some other database // system specific term if more applicable. DBOperationNameKey = attribute.Key("db.operation.name") // DBQuerySummaryKey is the attribute Key conforming to the "db.query.summary" // semantic conventions. It represents the low cardinality summary of a database // query. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "SELECT wuser_table", "INSERT shipping_details SELECT orders", "get // user by id" // Note: The query summary describes a class of database queries and is useful // as a grouping key, especially when analyzing telemetry for database // calls involving complex queries. // // Summary may be available to the instrumentation through // instrumentation hooks or other means. If it is not available, // instrumentations // that support query parsing SHOULD generate a summary following // [Generating query summary] // section. // // [Generating query summary]: /docs/db/database-spans.md#generating-a-summary-of-the-query DBQuerySummaryKey = attribute.Key("db.query.summary") // DBQueryTextKey is the attribute Key conforming to the "db.query.text" // semantic conventions. It represents the database query being executed. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "SELECT * FROM wuser_table where username = ?", "SET mykey ?" // Note: For sanitization see [Sanitization of `db.query.text`]. // For batch operations, if the individual operations are known to have the same // query text then that query text SHOULD be used, otherwise all of the // individual query texts SHOULD be concatenated with separator `; ` or some // other database system specific separator if more applicable. // Parameterized query text SHOULD NOT be sanitized. Even though parameterized // query text can potentially have sensitive data, by using a parameterized // query the user is giving a strong signal that any sensitive data will be // passed as parameter values, and the benefit to observability of capturing the // static part of the query text by default outweighs the risk. // // [Sanitization of `db.query.text`]: /docs/db/database-spans.md#sanitization-of-dbquerytext DBQueryTextKey = attribute.Key("db.query.text") // DBResponseReturnedRowsKey is the attribute Key conforming to the // "db.response.returned_rows" semantic conventions. It represents the number of // rows returned by the operation. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 10, 30, 1000 DBResponseReturnedRowsKey = attribute.Key("db.response.returned_rows") // DBResponseStatusCodeKey is the attribute Key conforming to the // "db.response.status_code" semantic conventions. It represents the database // response status code. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "102", "ORA-17002", "08P01", "404" // Note: The status code returned by the database. Usually it represents an // error code, but may also represent partial success, warning, or differentiate // between various types of successful outcomes. // Semantic conventions for individual database systems SHOULD document what // `db.response.status_code` means in the context of that system. DBResponseStatusCodeKey = attribute.Key("db.response.status_code") // DBStoredProcedureNameKey is the attribute Key conforming to the // "db.stored_procedure.name" semantic conventions. It represents the name of a // stored procedure within the database. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "GetCustomer" // Note: It is RECOMMENDED to capture the value as provided by the application // without attempting to do any case normalization. // // For batch operations, if the individual operations are known to have the same // stored procedure name then that stored procedure name SHOULD be used. DBStoredProcedureNameKey = attribute.Key("db.stored_procedure.name") // DBSystemNameKey is the attribute Key conforming to the "db.system.name" // semantic conventions. It represents the database management system (DBMS) // product as identified by the client instrumentation. // // Type: Enum // RequirementLevel: Recommended // Stability: Stable // // Examples: // Note: The actual DBMS may differ from the one identified by the client. For // example, when using PostgreSQL client libraries to connect to a CockroachDB, // the `db.system.name` is set to `postgresql` based on the instrumentation's // best knowledge. DBSystemNameKey = attribute.Key("db.system.name") ) // DBClientConnectionPoolName returns an attribute KeyValue conforming to the // "db.client.connection.pool.name" semantic conventions. It represents the name // of the connection pool; unique within the instrumented application. In case // the connection pool implementation doesn't provide a name, instrumentation // SHOULD use a combination of parameters that would make the name unique, for // example, combining attributes `server.address`, `server.port`, and // `db.namespace`, formatted as `server.address:server.port/db.namespace`. // Instrumentations that generate connection pool name following different // patterns SHOULD document it. func DBClientConnectionPoolName(val string) attribute.KeyValue { return DBClientConnectionPoolNameKey.String(val) } // DBCollectionName returns an attribute KeyValue conforming to the // "db.collection.name" semantic conventions. It represents the name of a // collection (table, container) within the database. func DBCollectionName(val string) attribute.KeyValue { return DBCollectionNameKey.String(val) } // DBNamespace returns an attribute KeyValue conforming to the "db.namespace" // semantic conventions. It represents the name of the database, fully qualified // within the server address and port. func DBNamespace(val string) attribute.KeyValue { return DBNamespaceKey.String(val) } // DBOperationBatchSize returns an attribute KeyValue conforming to the // "db.operation.batch.size" semantic conventions. It represents the number of // queries included in a batch operation. func DBOperationBatchSize(val int) attribute.KeyValue { return DBOperationBatchSizeKey.Int(val) } // DBOperationName returns an attribute KeyValue conforming to the // "db.operation.name" semantic conventions. It represents the name of the // operation or command being executed. func DBOperationName(val string) attribute.KeyValue { return DBOperationNameKey.String(val) } // DBOperationParameter returns an attribute KeyValue conforming to the // "db.operation.parameter" semantic conventions. It represents a database // operation parameter, with `` being the parameter name, and the attribute // value being a string representation of the parameter value. func DBOperationParameter(key string, val string) attribute.KeyValue { return attribute.String("db.operation.parameter."+key, val) } // DBQueryParameter returns an attribute KeyValue conforming to the // "db.query.parameter" semantic conventions. It represents a database query // parameter, with `` being the parameter name, and the attribute value // being a string representation of the parameter value. func DBQueryParameter(key string, val string) attribute.KeyValue { return attribute.String("db.query.parameter."+key, val) } // DBQuerySummary returns an attribute KeyValue conforming to the // "db.query.summary" semantic conventions. It represents the low cardinality // summary of a database query. func DBQuerySummary(val string) attribute.KeyValue { return DBQuerySummaryKey.String(val) } // DBQueryText returns an attribute KeyValue conforming to the "db.query.text" // semantic conventions. It represents the database query being executed. func DBQueryText(val string) attribute.KeyValue { return DBQueryTextKey.String(val) } // DBResponseReturnedRows returns an attribute KeyValue conforming to the // "db.response.returned_rows" semantic conventions. It represents the number of // rows returned by the operation. func DBResponseReturnedRows(val int) attribute.KeyValue { return DBResponseReturnedRowsKey.Int(val) } // DBResponseStatusCode returns an attribute KeyValue conforming to the // "db.response.status_code" semantic conventions. It represents the database // response status code. func DBResponseStatusCode(val string) attribute.KeyValue { return DBResponseStatusCodeKey.String(val) } // DBStoredProcedureName returns an attribute KeyValue conforming to the // "db.stored_procedure.name" semantic conventions. It represents the name of a // stored procedure within the database. func DBStoredProcedureName(val string) attribute.KeyValue { return DBStoredProcedureNameKey.String(val) } // Enum values for db.client.connection.state var ( // idle // Stability: development DBClientConnectionStateIdle = DBClientConnectionStateKey.String("idle") // used // Stability: development DBClientConnectionStateUsed = DBClientConnectionStateKey.String("used") ) // Enum values for db.system.name var ( // Some other SQL database. Fallback only. // Stability: development DBSystemNameOtherSQL = DBSystemNameKey.String("other_sql") // [Adabas (Adaptable Database System)] // Stability: development // // [Adabas (Adaptable Database System)]: https://documentation.softwareag.com/?pf=adabas DBSystemNameSoftwareagAdabas = DBSystemNameKey.String("softwareag.adabas") // [Actian Ingres] // Stability: development // // [Actian Ingres]: https://www.actian.com/databases/ingres/ DBSystemNameActianIngres = DBSystemNameKey.String("actian.ingres") // [Amazon DynamoDB] // Stability: development // // [Amazon DynamoDB]: https://aws.amazon.com/pm/dynamodb/ DBSystemNameAWSDynamoDB = DBSystemNameKey.String("aws.dynamodb") // [Amazon Redshift] // Stability: development // // [Amazon Redshift]: https://aws.amazon.com/redshift/ DBSystemNameAWSRedshift = DBSystemNameKey.String("aws.redshift") // [Azure Cosmos DB] // Stability: development // // [Azure Cosmos DB]: https://learn.microsoft.com/azure/cosmos-db DBSystemNameAzureCosmosDB = DBSystemNameKey.String("azure.cosmosdb") // [InterSystems Caché] // Stability: development // // [InterSystems Caché]: https://www.intersystems.com/products/cache/ DBSystemNameIntersystemsCache = DBSystemNameKey.String("intersystems.cache") // [Apache Cassandra] // Stability: development // // [Apache Cassandra]: https://cassandra.apache.org/ DBSystemNameCassandra = DBSystemNameKey.String("cassandra") // [ClickHouse] // Stability: development // // [ClickHouse]: https://clickhouse.com/ DBSystemNameClickHouse = DBSystemNameKey.String("clickhouse") // [CockroachDB] // Stability: development // // [CockroachDB]: https://www.cockroachlabs.com/ DBSystemNameCockroachDB = DBSystemNameKey.String("cockroachdb") // [Couchbase] // Stability: development // // [Couchbase]: https://www.couchbase.com/ DBSystemNameCouchbase = DBSystemNameKey.String("couchbase") // [Apache CouchDB] // Stability: development // // [Apache CouchDB]: https://couchdb.apache.org/ DBSystemNameCouchDB = DBSystemNameKey.String("couchdb") // [Apache Derby] // Stability: development // // [Apache Derby]: https://db.apache.org/derby/ DBSystemNameDerby = DBSystemNameKey.String("derby") // [Elasticsearch] // Stability: development // // [Elasticsearch]: https://www.elastic.co/elasticsearch DBSystemNameElasticsearch = DBSystemNameKey.String("elasticsearch") // [Firebird] // Stability: development // // [Firebird]: https://www.firebirdsql.org/ DBSystemNameFirebirdSQL = DBSystemNameKey.String("firebirdsql") // [Google Cloud Spanner] // Stability: development // // [Google Cloud Spanner]: https://cloud.google.com/spanner DBSystemNameGCPSpanner = DBSystemNameKey.String("gcp.spanner") // [Apache Geode] // Stability: development // // [Apache Geode]: https://geode.apache.org/ DBSystemNameGeode = DBSystemNameKey.String("geode") // [H2 Database] // Stability: development // // [H2 Database]: https://h2database.com/ DBSystemNameH2database = DBSystemNameKey.String("h2database") // [Apache HBase] // Stability: development // // [Apache HBase]: https://hbase.apache.org/ DBSystemNameHBase = DBSystemNameKey.String("hbase") // [Apache Hive] // Stability: development // // [Apache Hive]: https://hive.apache.org/ DBSystemNameHive = DBSystemNameKey.String("hive") // [HyperSQL Database] // Stability: development // // [HyperSQL Database]: https://hsqldb.org/ DBSystemNameHSQLDB = DBSystemNameKey.String("hsqldb") // [IBM Db2] // Stability: development // // [IBM Db2]: https://www.ibm.com/db2 DBSystemNameIBMDB2 = DBSystemNameKey.String("ibm.db2") // [IBM Informix] // Stability: development // // [IBM Informix]: https://www.ibm.com/products/informix DBSystemNameIBMInformix = DBSystemNameKey.String("ibm.informix") // [IBM Netezza] // Stability: development // // [IBM Netezza]: https://www.ibm.com/products/netezza DBSystemNameIBMNetezza = DBSystemNameKey.String("ibm.netezza") // [InfluxDB] // Stability: development // // [InfluxDB]: https://www.influxdata.com/ DBSystemNameInfluxDB = DBSystemNameKey.String("influxdb") // [Instant] // Stability: development // // [Instant]: https://www.instantdb.com/ DBSystemNameInstantDB = DBSystemNameKey.String("instantdb") // [MariaDB] // Stability: stable // // [MariaDB]: https://mariadb.org/ DBSystemNameMariaDB = DBSystemNameKey.String("mariadb") // [Memcached] // Stability: development // // [Memcached]: https://memcached.org/ DBSystemNameMemcached = DBSystemNameKey.String("memcached") // [MongoDB] // Stability: development // // [MongoDB]: https://www.mongodb.com/ DBSystemNameMongoDB = DBSystemNameKey.String("mongodb") // [Microsoft SQL Server] // Stability: stable // // [Microsoft SQL Server]: https://www.microsoft.com/sql-server DBSystemNameMicrosoftSQLServer = DBSystemNameKey.String("microsoft.sql_server") // [MySQL] // Stability: stable // // [MySQL]: https://www.mysql.com/ DBSystemNameMySQL = DBSystemNameKey.String("mysql") // [Neo4j] // Stability: development // // [Neo4j]: https://neo4j.com/ DBSystemNameNeo4j = DBSystemNameKey.String("neo4j") // [OpenSearch] // Stability: development // // [OpenSearch]: https://opensearch.org/ DBSystemNameOpenSearch = DBSystemNameKey.String("opensearch") // [Oracle Database] // Stability: development // // [Oracle Database]: https://www.oracle.com/database/ DBSystemNameOracleDB = DBSystemNameKey.String("oracle.db") // [PostgreSQL] // Stability: stable // // [PostgreSQL]: https://www.postgresql.org/ DBSystemNamePostgreSQL = DBSystemNameKey.String("postgresql") // [Redis] // Stability: development // // [Redis]: https://redis.io/ DBSystemNameRedis = DBSystemNameKey.String("redis") // [SAP HANA] // Stability: development // // [SAP HANA]: https://www.sap.com/products/technology-platform/hana/what-is-sap-hana.html DBSystemNameSAPHANA = DBSystemNameKey.String("sap.hana") // [SAP MaxDB] // Stability: development // // [SAP MaxDB]: https://maxdb.sap.com/ DBSystemNameSAPMaxDB = DBSystemNameKey.String("sap.maxdb") // [SQLite] // Stability: development // // [SQLite]: https://www.sqlite.org/ DBSystemNameSQLite = DBSystemNameKey.String("sqlite") // [Teradata] // Stability: development // // [Teradata]: https://www.teradata.com/ DBSystemNameTeradata = DBSystemNameKey.String("teradata") // [Trino] // Stability: development // // [Trino]: https://trino.io/ DBSystemNameTrino = DBSystemNameKey.String("trino") ) // Namespace: deployment const ( // DeploymentEnvironmentNameKey is the attribute Key conforming to the // "deployment.environment.name" semantic conventions. It represents the name of // the [deployment environment] (aka deployment tier). // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "staging", "production" // Note: `deployment.environment.name` does not affect the uniqueness // constraints defined through // the `service.namespace`, `service.name` and `service.instance.id` resource // attributes. // This implies that resources carrying the following attribute combinations // MUST be // considered to be identifying the same service: // // - `service.name=frontend`, `deployment.environment.name=production` // - `service.name=frontend`, `deployment.environment.name=staging`. // // // [deployment environment]: https://wikipedia.org/wiki/Deployment_environment DeploymentEnvironmentNameKey = attribute.Key("deployment.environment.name") // DeploymentIDKey is the attribute Key conforming to the "deployment.id" // semantic conventions. It represents the id of the deployment. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "1208" DeploymentIDKey = attribute.Key("deployment.id") // DeploymentNameKey is the attribute Key conforming to the "deployment.name" // semantic conventions. It represents the name of the deployment. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "deploy my app", "deploy-frontend" DeploymentNameKey = attribute.Key("deployment.name") // DeploymentStatusKey is the attribute Key conforming to the // "deployment.status" semantic conventions. It represents the status of the // deployment. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: DeploymentStatusKey = attribute.Key("deployment.status") ) // DeploymentEnvironmentName returns an attribute KeyValue conforming to the // "deployment.environment.name" semantic conventions. It represents the name of // the [deployment environment] (aka deployment tier). // // [deployment environment]: https://wikipedia.org/wiki/Deployment_environment func DeploymentEnvironmentName(val string) attribute.KeyValue { return DeploymentEnvironmentNameKey.String(val) } // DeploymentID returns an attribute KeyValue conforming to the "deployment.id" // semantic conventions. It represents the id of the deployment. func DeploymentID(val string) attribute.KeyValue { return DeploymentIDKey.String(val) } // DeploymentName returns an attribute KeyValue conforming to the // "deployment.name" semantic conventions. It represents the name of the // deployment. func DeploymentName(val string) attribute.KeyValue { return DeploymentNameKey.String(val) } // Enum values for deployment.status var ( // failed // Stability: development DeploymentStatusFailed = DeploymentStatusKey.String("failed") // succeeded // Stability: development DeploymentStatusSucceeded = DeploymentStatusKey.String("succeeded") ) // Namespace: destination const ( // DestinationAddressKey is the attribute Key conforming to the // "destination.address" semantic conventions. It represents the destination // address - domain name if available without reverse DNS lookup; otherwise, IP // address or Unix domain socket name. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "destination.example.com", "10.1.2.80", "/tmp/my.sock" // Note: When observed from the source side, and when communicating through an // intermediary, `destination.address` SHOULD represent the destination address // behind any intermediaries, for example proxies, if it's available. DestinationAddressKey = attribute.Key("destination.address") // DestinationPortKey is the attribute Key conforming to the "destination.port" // semantic conventions. It represents the destination port number. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 3389, 2888 DestinationPortKey = attribute.Key("destination.port") ) // DestinationAddress returns an attribute KeyValue conforming to the // "destination.address" semantic conventions. It represents the destination // address - domain name if available without reverse DNS lookup; otherwise, IP // address or Unix domain socket name. func DestinationAddress(val string) attribute.KeyValue { return DestinationAddressKey.String(val) } // DestinationPort returns an attribute KeyValue conforming to the // "destination.port" semantic conventions. It represents the destination port // number. func DestinationPort(val int) attribute.KeyValue { return DestinationPortKey.Int(val) } // Namespace: device const ( // DeviceIDKey is the attribute Key conforming to the "device.id" semantic // conventions. It represents a unique identifier representing the device. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "123456789012345", "01:23:45:67:89:AB" // Note: Its value SHOULD be identical for all apps on a device and it SHOULD // NOT change if an app is uninstalled and re-installed. // However, it might be resettable by the user for all apps on a device. // Hardware IDs (e.g. vendor-specific serial number, IMEI or MAC address) MAY be // used as values. // // More information about Android identifier best practices can be found in the // [Android user data IDs guide]. // // > [!WARNING]> This attribute may contain sensitive (PII) information. Caution // > should be taken when storing personal data or anything which can identify a // > user. GDPR and data protection laws may apply, // > ensure you do your own due diligence.> Due to these reasons, this // > identifier is not recommended for consumer applications and will likely // > result in rejection from both Google Play and App Store. // > However, it may be appropriate for specific enterprise scenarios, such as // > kiosk devices or enterprise-managed devices, with appropriate compliance // > clearance. // > Any instrumentation providing this identifier MUST implement it as an // > opt-in feature.> See [`app.installation.id`]> for a more // > privacy-preserving alternative. // // [Android user data IDs guide]: https://developer.android.com/training/articles/user-data-ids // [`app.installation.id`]: /docs/registry/attributes/app.md#app-installation-id DeviceIDKey = attribute.Key("device.id") // DeviceManufacturerKey is the attribute Key conforming to the // "device.manufacturer" semantic conventions. It represents the name of the // device manufacturer. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Apple", "Samsung" // Note: The Android OS provides this field via [Build]. iOS apps SHOULD // hardcode the value `Apple`. // // [Build]: https://developer.android.com/reference/android/os/Build#MANUFACTURER DeviceManufacturerKey = attribute.Key("device.manufacturer") // DeviceModelIdentifierKey is the attribute Key conforming to the // "device.model.identifier" semantic conventions. It represents the model // identifier for the device. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "iPhone3,4", "SM-G920F" // Note: It's recommended this value represents a machine-readable version of // the model identifier rather than the market or consumer-friendly name of the // device. DeviceModelIdentifierKey = attribute.Key("device.model.identifier") // DeviceModelNameKey is the attribute Key conforming to the "device.model.name" // semantic conventions. It represents the marketing name for the device model. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "iPhone 6s Plus", "Samsung Galaxy S6" // Note: It's recommended this value represents a human-readable version of the // device model rather than a machine-readable alternative. DeviceModelNameKey = attribute.Key("device.model.name") ) // DeviceID returns an attribute KeyValue conforming to the "device.id" semantic // conventions. It represents a unique identifier representing the device. func DeviceID(val string) attribute.KeyValue { return DeviceIDKey.String(val) } // DeviceManufacturer returns an attribute KeyValue conforming to the // "device.manufacturer" semantic conventions. It represents the name of the // device manufacturer. func DeviceManufacturer(val string) attribute.KeyValue { return DeviceManufacturerKey.String(val) } // DeviceModelIdentifier returns an attribute KeyValue conforming to the // "device.model.identifier" semantic conventions. It represents the model // identifier for the device. func DeviceModelIdentifier(val string) attribute.KeyValue { return DeviceModelIdentifierKey.String(val) } // DeviceModelName returns an attribute KeyValue conforming to the // "device.model.name" semantic conventions. It represents the marketing name for // the device model. func DeviceModelName(val string) attribute.KeyValue { return DeviceModelNameKey.String(val) } // Namespace: disk const ( // DiskIODirectionKey is the attribute Key conforming to the "disk.io.direction" // semantic conventions. It represents the disk IO operation direction. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "read" DiskIODirectionKey = attribute.Key("disk.io.direction") ) // Enum values for disk.io.direction var ( // read // Stability: development DiskIODirectionRead = DiskIODirectionKey.String("read") // write // Stability: development DiskIODirectionWrite = DiskIODirectionKey.String("write") ) // Namespace: dns const ( // DNSAnswersKey is the attribute Key conforming to the "dns.answers" semantic // conventions. It represents the list of IPv4 or IPv6 addresses resolved during // DNS lookup. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "10.0.0.1", "2001:0db8:85a3:0000:0000:8a2e:0370:7334" DNSAnswersKey = attribute.Key("dns.answers") // DNSQuestionNameKey is the attribute Key conforming to the "dns.question.name" // semantic conventions. It represents the name being queried. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "www.example.com", "opentelemetry.io" // Note: The name represents the queried domain name as it appears in the DNS // query without any additional normalization. DNSQuestionNameKey = attribute.Key("dns.question.name") ) // DNSAnswers returns an attribute KeyValue conforming to the "dns.answers" // semantic conventions. It represents the list of IPv4 or IPv6 addresses // resolved during DNS lookup. func DNSAnswers(val ...string) attribute.KeyValue { return DNSAnswersKey.StringSlice(val) } // DNSQuestionName returns an attribute KeyValue conforming to the // "dns.question.name" semantic conventions. It represents the name being // queried. func DNSQuestionName(val string) attribute.KeyValue { return DNSQuestionNameKey.String(val) } // Namespace: elasticsearch const ( // ElasticsearchNodeNameKey is the attribute Key conforming to the // "elasticsearch.node.name" semantic conventions. It represents the represents // the human-readable identifier of the node/instance to which a request was // routed. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "instance-0000000001" ElasticsearchNodeNameKey = attribute.Key("elasticsearch.node.name") ) // ElasticsearchNodeName returns an attribute KeyValue conforming to the // "elasticsearch.node.name" semantic conventions. It represents the represents // the human-readable identifier of the node/instance to which a request was // routed. func ElasticsearchNodeName(val string) attribute.KeyValue { return ElasticsearchNodeNameKey.String(val) } // Namespace: enduser const ( // EnduserIDKey is the attribute Key conforming to the "enduser.id" semantic // conventions. It represents the unique identifier of an end user in the // system. It maybe a username, email address, or other identifier. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "username" // Note: Unique identifier of an end user in the system. // // > [!Warning] // > This field contains sensitive (PII) information. EnduserIDKey = attribute.Key("enduser.id") // EnduserPseudoIDKey is the attribute Key conforming to the "enduser.pseudo.id" // semantic conventions. It represents the pseudonymous identifier of an end // user. This identifier should be a random value that is not directly linked or // associated with the end user's actual identity. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "QdH5CAWJgqVT4rOr0qtumf" // Note: Pseudonymous identifier of an end user. // // > [!Warning] // > This field contains sensitive (linkable PII) information. EnduserPseudoIDKey = attribute.Key("enduser.pseudo.id") ) // EnduserID returns an attribute KeyValue conforming to the "enduser.id" // semantic conventions. It represents the unique identifier of an end user in // the system. It maybe a username, email address, or other identifier. func EnduserID(val string) attribute.KeyValue { return EnduserIDKey.String(val) } // EnduserPseudoID returns an attribute KeyValue conforming to the // "enduser.pseudo.id" semantic conventions. It represents the pseudonymous // identifier of an end user. This identifier should be a random value that is // not directly linked or associated with the end user's actual identity. func EnduserPseudoID(val string) attribute.KeyValue { return EnduserPseudoIDKey.String(val) } // Namespace: error const ( // ErrorMessageKey is the attribute Key conforming to the "error.message" // semantic conventions. It represents a message providing more detail about an // error in human-readable form. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Unexpected input type: string", "The user has exceeded their // storage quota" // Note: `error.message` should provide additional context and detail about an // error. // It is NOT RECOMMENDED to duplicate the value of `error.type` in // `error.message`. // It is also NOT RECOMMENDED to duplicate the value of `exception.message` in // `error.message`. // // `error.message` is NOT RECOMMENDED for metrics or spans due to its unbounded // cardinality and overlap with span status. ErrorMessageKey = attribute.Key("error.message") // ErrorTypeKey is the attribute Key conforming to the "error.type" semantic // conventions. It represents the describes a class of error the operation ended // with. // // Type: Enum // RequirementLevel: Recommended // Stability: Stable // // Examples: "timeout", "java.net.UnknownHostException", // "server_certificate_invalid", "500" // Note: The `error.type` SHOULD be predictable, and SHOULD have low // cardinality. // // When `error.type` is set to a type (e.g., an exception type), its // canonical class name identifying the type within the artifact SHOULD be used. // // Instrumentations SHOULD document the list of errors they report. // // The cardinality of `error.type` within one instrumentation library SHOULD be // low. // Telemetry consumers that aggregate data from multiple instrumentation // libraries and applications // should be prepared for `error.type` to have high cardinality at query time // when no // additional filters are applied. // // If the operation has completed successfully, instrumentations SHOULD NOT set // `error.type`. // // If a specific domain defines its own set of error identifiers (such as HTTP // or RPC status codes), // it's RECOMMENDED to: // // - Use a domain-specific attribute // - Set `error.type` to capture all errors, regardless of whether they are // defined within the domain-specific set or not. ErrorTypeKey = attribute.Key("error.type") ) // ErrorMessage returns an attribute KeyValue conforming to the "error.message" // semantic conventions. It represents a message providing more detail about an // error in human-readable form. func ErrorMessage(val string) attribute.KeyValue { return ErrorMessageKey.String(val) } // Enum values for error.type var ( // A fallback error value to be used when the instrumentation doesn't define a // custom value. // // Stability: stable ErrorTypeOther = ErrorTypeKey.String("_OTHER") ) // Namespace: exception const ( // ExceptionMessageKey is the attribute Key conforming to the // "exception.message" semantic conventions. It represents the exception // message. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "Division by zero", "Can't convert 'int' object to str implicitly" ExceptionMessageKey = attribute.Key("exception.message") // ExceptionStacktraceKey is the attribute Key conforming to the // "exception.stacktrace" semantic conventions. It represents a stacktrace as a // string in the natural representation for the language runtime. The // representation is to be determined and documented by each language SIG. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: Exception in thread "main" java.lang.RuntimeException: Test // exception\n at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\n at // com.example.GenerateTrace.methodA(GenerateTrace.java:9)\n at // com.example.GenerateTrace.main(GenerateTrace.java:5) ExceptionStacktraceKey = attribute.Key("exception.stacktrace") // ExceptionTypeKey is the attribute Key conforming to the "exception.type" // semantic conventions. It represents the type of the exception (its // fully-qualified class name, if applicable). The dynamic type of the exception // should be preferred over the static type in languages that support it. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "java.net.ConnectException", "OSError" ExceptionTypeKey = attribute.Key("exception.type") ) // ExceptionMessage returns an attribute KeyValue conforming to the // "exception.message" semantic conventions. It represents the exception message. func ExceptionMessage(val string) attribute.KeyValue { return ExceptionMessageKey.String(val) } // ExceptionStacktrace returns an attribute KeyValue conforming to the // "exception.stacktrace" semantic conventions. It represents a stacktrace as a // string in the natural representation for the language runtime. The // representation is to be determined and documented by each language SIG. func ExceptionStacktrace(val string) attribute.KeyValue { return ExceptionStacktraceKey.String(val) } // ExceptionType returns an attribute KeyValue conforming to the "exception.type" // semantic conventions. It represents the type of the exception (its // fully-qualified class name, if applicable). The dynamic type of the exception // should be preferred over the static type in languages that support it. func ExceptionType(val string) attribute.KeyValue { return ExceptionTypeKey.String(val) } // Namespace: faas const ( // FaaSColdstartKey is the attribute Key conforming to the "faas.coldstart" // semantic conventions. It represents a boolean that is true if the serverless // function is executed for the first time (aka cold-start). // // Type: boolean // RequirementLevel: Recommended // Stability: Development // // Examples: FaaSColdstartKey = attribute.Key("faas.coldstart") // FaaSCronKey is the attribute Key conforming to the "faas.cron" semantic // conventions. It represents a string containing the schedule period as // [Cron Expression]. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: 0/5 * * * ? * // // [Cron Expression]: https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm FaaSCronKey = attribute.Key("faas.cron") // FaaSDocumentCollectionKey is the attribute Key conforming to the // "faas.document.collection" semantic conventions. It represents the name of // the source on which the triggering operation was performed. For example, in // Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the // database name. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "myBucketName", "myDbName" FaaSDocumentCollectionKey = attribute.Key("faas.document.collection") // FaaSDocumentNameKey is the attribute Key conforming to the // "faas.document.name" semantic conventions. It represents the document // name/table subjected to the operation. For example, in Cloud Storage or S3 is // the name of the file, and in Cosmos DB the table name. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "myFile.txt", "myTableName" FaaSDocumentNameKey = attribute.Key("faas.document.name") // FaaSDocumentOperationKey is the attribute Key conforming to the // "faas.document.operation" semantic conventions. It represents the describes // the type of the operation that was performed on the data. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: FaaSDocumentOperationKey = attribute.Key("faas.document.operation") // FaaSDocumentTimeKey is the attribute Key conforming to the // "faas.document.time" semantic conventions. It represents a string containing // the time when the data was accessed in the [ISO 8601] format expressed in // [UTC]. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: 2020-01-23T13:47:06Z // // [ISO 8601]: https://www.iso.org/iso-8601-date-and-time-format.html // [UTC]: https://www.w3.org/TR/NOTE-datetime FaaSDocumentTimeKey = attribute.Key("faas.document.time") // FaaSInstanceKey is the attribute Key conforming to the "faas.instance" // semantic conventions. It represents the execution environment ID as a string, // that will be potentially reused for other invocations to the same // function/function version. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "2021/06/28/[$LATEST]2f399eb14537447da05ab2a2e39309de" // Note: - **AWS Lambda:** Use the (full) log stream name. FaaSInstanceKey = attribute.Key("faas.instance") // FaaSInvocationIDKey is the attribute Key conforming to the // "faas.invocation_id" semantic conventions. It represents the invocation ID of // the current function invocation. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: af9d5aa4-a685-4c5f-a22b-444f80b3cc28 FaaSInvocationIDKey = attribute.Key("faas.invocation_id") // FaaSInvokedNameKey is the attribute Key conforming to the "faas.invoked_name" // semantic conventions. It represents the name of the invoked function. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: my-function // Note: SHOULD be equal to the `faas.name` resource attribute of the invoked // function. FaaSInvokedNameKey = attribute.Key("faas.invoked_name") // FaaSInvokedProviderKey is the attribute Key conforming to the // "faas.invoked_provider" semantic conventions. It represents the cloud // provider of the invoked function. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // Note: SHOULD be equal to the `cloud.provider` resource attribute of the // invoked function. FaaSInvokedProviderKey = attribute.Key("faas.invoked_provider") // FaaSInvokedRegionKey is the attribute Key conforming to the // "faas.invoked_region" semantic conventions. It represents the cloud region of // the invoked function. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: eu-central-1 // Note: SHOULD be equal to the `cloud.region` resource attribute of the invoked // function. FaaSInvokedRegionKey = attribute.Key("faas.invoked_region") // FaaSMaxMemoryKey is the attribute Key conforming to the "faas.max_memory" // semantic conventions. It represents the amount of memory available to the // serverless function converted to Bytes. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Note: It's recommended to set this attribute since e.g. too little memory can // easily stop a Java AWS Lambda function from working correctly. On AWS Lambda, // the environment variable `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this // information (which must be multiplied by 1,048,576). FaaSMaxMemoryKey = attribute.Key("faas.max_memory") // FaaSNameKey is the attribute Key conforming to the "faas.name" semantic // conventions. It represents the name of the single function that this runtime // instance executes. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "my-function", "myazurefunctionapp/some-function-name" // Note: This is the name of the function as configured/deployed on the FaaS // platform and is usually different from the name of the callback // function (which may be stored in the // [`code.namespace`/`code.function.name`] // span attributes). // // For some cloud providers, the above definition is ambiguous. The following // definition of function name MUST be used for this attribute // (and consequently the span name) for the listed cloud providers/products: // // - **Azure:** The full name `/`, i.e., function app name // followed by a forward slash followed by the function name (this form // can also be seen in the resource JSON for the function). // This means that a span attribute MUST be used, as an Azure function // app can host multiple functions that would usually share // a TracerProvider (see also the `cloud.resource_id` attribute). // // // [`code.namespace`/`code.function.name`]: /docs/general/attributes.md#source-code-attributes FaaSNameKey = attribute.Key("faas.name") // FaaSTimeKey is the attribute Key conforming to the "faas.time" semantic // conventions. It represents a string containing the function invocation time // in the [ISO 8601] format expressed in [UTC]. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: 2020-01-23T13:47:06Z // // [ISO 8601]: https://www.iso.org/iso-8601-date-and-time-format.html // [UTC]: https://www.w3.org/TR/NOTE-datetime FaaSTimeKey = attribute.Key("faas.time") // FaaSTriggerKey is the attribute Key conforming to the "faas.trigger" semantic // conventions. It represents the type of the trigger which caused this function // invocation. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: FaaSTriggerKey = attribute.Key("faas.trigger") // FaaSVersionKey is the attribute Key conforming to the "faas.version" semantic // conventions. It represents the immutable version of the function being // executed. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "26", "pinkfroid-00002" // Note: Depending on the cloud provider and platform, use: // // - **AWS Lambda:** The [function version] // (an integer represented as a decimal string). // - **Google Cloud Run (Services):** The [revision] // (i.e., the function name plus the revision suffix). // - **Google Cloud Functions:** The value of the // [`K_REVISION` environment variable]. // - **Azure Functions:** Not applicable. Do not set this attribute. // // // [function version]: https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html // [revision]: https://cloud.google.com/run/docs/managing/revisions // [`K_REVISION` environment variable]: https://cloud.google.com/run/docs/container-contract#services-env-vars FaaSVersionKey = attribute.Key("faas.version") ) // FaaSColdstart returns an attribute KeyValue conforming to the "faas.coldstart" // semantic conventions. It represents a boolean that is true if the serverless // function is executed for the first time (aka cold-start). func FaaSColdstart(val bool) attribute.KeyValue { return FaaSColdstartKey.Bool(val) } // FaaSCron returns an attribute KeyValue conforming to the "faas.cron" semantic // conventions. It represents a string containing the schedule period as // [Cron Expression]. // // [Cron Expression]: https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm func FaaSCron(val string) attribute.KeyValue { return FaaSCronKey.String(val) } // FaaSDocumentCollection returns an attribute KeyValue conforming to the // "faas.document.collection" semantic conventions. It represents the name of the // source on which the triggering operation was performed. For example, in Cloud // Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database // name. func FaaSDocumentCollection(val string) attribute.KeyValue { return FaaSDocumentCollectionKey.String(val) } // FaaSDocumentName returns an attribute KeyValue conforming to the // "faas.document.name" semantic conventions. It represents the document // name/table subjected to the operation. For example, in Cloud Storage or S3 is // the name of the file, and in Cosmos DB the table name. func FaaSDocumentName(val string) attribute.KeyValue { return FaaSDocumentNameKey.String(val) } // FaaSDocumentTime returns an attribute KeyValue conforming to the // "faas.document.time" semantic conventions. It represents a string containing // the time when the data was accessed in the [ISO 8601] format expressed in // [UTC]. // // [ISO 8601]: https://www.iso.org/iso-8601-date-and-time-format.html // [UTC]: https://www.w3.org/TR/NOTE-datetime func FaaSDocumentTime(val string) attribute.KeyValue { return FaaSDocumentTimeKey.String(val) } // FaaSInstance returns an attribute KeyValue conforming to the "faas.instance" // semantic conventions. It represents the execution environment ID as a string, // that will be potentially reused for other invocations to the same // function/function version. func FaaSInstance(val string) attribute.KeyValue { return FaaSInstanceKey.String(val) } // FaaSInvocationID returns an attribute KeyValue conforming to the // "faas.invocation_id" semantic conventions. It represents the invocation ID of // the current function invocation. func FaaSInvocationID(val string) attribute.KeyValue { return FaaSInvocationIDKey.String(val) } // FaaSInvokedName returns an attribute KeyValue conforming to the // "faas.invoked_name" semantic conventions. It represents the name of the // invoked function. func FaaSInvokedName(val string) attribute.KeyValue { return FaaSInvokedNameKey.String(val) } // FaaSInvokedRegion returns an attribute KeyValue conforming to the // "faas.invoked_region" semantic conventions. It represents the cloud region of // the invoked function. func FaaSInvokedRegion(val string) attribute.KeyValue { return FaaSInvokedRegionKey.String(val) } // FaaSMaxMemory returns an attribute KeyValue conforming to the // "faas.max_memory" semantic conventions. It represents the amount of memory // available to the serverless function converted to Bytes. func FaaSMaxMemory(val int) attribute.KeyValue { return FaaSMaxMemoryKey.Int(val) } // FaaSName returns an attribute KeyValue conforming to the "faas.name" semantic // conventions. It represents the name of the single function that this runtime // instance executes. func FaaSName(val string) attribute.KeyValue { return FaaSNameKey.String(val) } // FaaSTime returns an attribute KeyValue conforming to the "faas.time" semantic // conventions. It represents a string containing the function invocation time in // the [ISO 8601] format expressed in [UTC]. // // [ISO 8601]: https://www.iso.org/iso-8601-date-and-time-format.html // [UTC]: https://www.w3.org/TR/NOTE-datetime func FaaSTime(val string) attribute.KeyValue { return FaaSTimeKey.String(val) } // FaaSVersion returns an attribute KeyValue conforming to the "faas.version" // semantic conventions. It represents the immutable version of the function // being executed. func FaaSVersion(val string) attribute.KeyValue { return FaaSVersionKey.String(val) } // Enum values for faas.document.operation var ( // When a new object is created. // Stability: development FaaSDocumentOperationInsert = FaaSDocumentOperationKey.String("insert") // When an object is modified. // Stability: development FaaSDocumentOperationEdit = FaaSDocumentOperationKey.String("edit") // When an object is deleted. // Stability: development FaaSDocumentOperationDelete = FaaSDocumentOperationKey.String("delete") ) // Enum values for faas.invoked_provider var ( // Alibaba Cloud // Stability: development FaaSInvokedProviderAlibabaCloud = FaaSInvokedProviderKey.String("alibaba_cloud") // Amazon Web Services // Stability: development FaaSInvokedProviderAWS = FaaSInvokedProviderKey.String("aws") // Microsoft Azure // Stability: development FaaSInvokedProviderAzure = FaaSInvokedProviderKey.String("azure") // Google Cloud Platform // Stability: development FaaSInvokedProviderGCP = FaaSInvokedProviderKey.String("gcp") // Tencent Cloud // Stability: development FaaSInvokedProviderTencentCloud = FaaSInvokedProviderKey.String("tencent_cloud") ) // Enum values for faas.trigger var ( // A response to some data source operation such as a database or filesystem // read/write // Stability: development FaaSTriggerDatasource = FaaSTriggerKey.String("datasource") // To provide an answer to an inbound HTTP request // Stability: development FaaSTriggerHTTP = FaaSTriggerKey.String("http") // A function is set to be executed when messages are sent to a messaging system // Stability: development FaaSTriggerPubSub = FaaSTriggerKey.String("pubsub") // A function is scheduled to be executed regularly // Stability: development FaaSTriggerTimer = FaaSTriggerKey.String("timer") // If none of the others apply // Stability: development FaaSTriggerOther = FaaSTriggerKey.String("other") ) // Namespace: feature_flag const ( // FeatureFlagContextIDKey is the attribute Key conforming to the // "feature_flag.context.id" semantic conventions. It represents the unique // identifier for the flag evaluation context. For example, the targeting key. // // Type: string // RequirementLevel: Recommended // Stability: Release_Candidate // // Examples: "5157782b-2203-4c80-a857-dbbd5e7761db" FeatureFlagContextIDKey = attribute.Key("feature_flag.context.id") // FeatureFlagKeyKey is the attribute Key conforming to the "feature_flag.key" // semantic conventions. It represents the lookup key of the feature flag. // // Type: string // RequirementLevel: Recommended // Stability: Release_Candidate // // Examples: "logo-color" FeatureFlagKeyKey = attribute.Key("feature_flag.key") // FeatureFlagProviderNameKey is the attribute Key conforming to the // "feature_flag.provider.name" semantic conventions. It represents the // identifies the feature flag provider. // // Type: string // RequirementLevel: Recommended // Stability: Release_Candidate // // Examples: "Flag Manager" FeatureFlagProviderNameKey = attribute.Key("feature_flag.provider.name") // FeatureFlagResultReasonKey is the attribute Key conforming to the // "feature_flag.result.reason" semantic conventions. It represents the reason // code which shows how a feature flag value was determined. // // Type: Enum // RequirementLevel: Recommended // Stability: Release_Candidate // // Examples: "static", "targeting_match", "error", "default" FeatureFlagResultReasonKey = attribute.Key("feature_flag.result.reason") // FeatureFlagResultValueKey is the attribute Key conforming to the // "feature_flag.result.value" semantic conventions. It represents the evaluated // value of the feature flag. // // Type: any // RequirementLevel: Recommended // Stability: Release_Candidate // // Examples: "#ff0000", true, 3 // Note: With some feature flag providers, feature flag results can be quite // large or contain private or sensitive details. // Because of this, `feature_flag.result.variant` is often the preferred // attribute if it is available. // // It may be desirable to redact or otherwise limit the size and scope of // `feature_flag.result.value` if possible. // Because the evaluated flag value is unstructured and may be any type, it is // left to the instrumentation author to determine how best to achieve this. FeatureFlagResultValueKey = attribute.Key("feature_flag.result.value") // FeatureFlagResultVariantKey is the attribute Key conforming to the // "feature_flag.result.variant" semantic conventions. It represents a semantic // identifier for an evaluated flag value. // // Type: string // RequirementLevel: Recommended // Stability: Release_Candidate // // Examples: "red", "true", "on" // Note: A semantic identifier, commonly referred to as a variant, provides a // means // for referring to a value without including the value itself. This can // provide additional context for understanding the meaning behind a value. // For example, the variant `red` maybe be used for the value `#c05543`. FeatureFlagResultVariantKey = attribute.Key("feature_flag.result.variant") // FeatureFlagSetIDKey is the attribute Key conforming to the // "feature_flag.set.id" semantic conventions. It represents the identifier of // the [flag set] to which the feature flag belongs. // // Type: string // RequirementLevel: Recommended // Stability: Release_Candidate // // Examples: "proj-1", "ab98sgs", "service1/dev" // // [flag set]: https://openfeature.dev/specification/glossary/#flag-set FeatureFlagSetIDKey = attribute.Key("feature_flag.set.id") // FeatureFlagVersionKey is the attribute Key conforming to the // "feature_flag.version" semantic conventions. It represents the version of the // ruleset used during the evaluation. This may be any stable value which // uniquely identifies the ruleset. // // Type: string // RequirementLevel: Recommended // Stability: Release_Candidate // // Examples: "1", "01ABCDEF" FeatureFlagVersionKey = attribute.Key("feature_flag.version") ) // FeatureFlagContextID returns an attribute KeyValue conforming to the // "feature_flag.context.id" semantic conventions. It represents the unique // identifier for the flag evaluation context. For example, the targeting key. func FeatureFlagContextID(val string) attribute.KeyValue { return FeatureFlagContextIDKey.String(val) } // FeatureFlagKey returns an attribute KeyValue conforming to the // "feature_flag.key" semantic conventions. It represents the lookup key of the // feature flag. func FeatureFlagKey(val string) attribute.KeyValue { return FeatureFlagKeyKey.String(val) } // FeatureFlagProviderName returns an attribute KeyValue conforming to the // "feature_flag.provider.name" semantic conventions. It represents the // identifies the feature flag provider. func FeatureFlagProviderName(val string) attribute.KeyValue { return FeatureFlagProviderNameKey.String(val) } // FeatureFlagResultVariant returns an attribute KeyValue conforming to the // "feature_flag.result.variant" semantic conventions. It represents a semantic // identifier for an evaluated flag value. func FeatureFlagResultVariant(val string) attribute.KeyValue { return FeatureFlagResultVariantKey.String(val) } // FeatureFlagSetID returns an attribute KeyValue conforming to the // "feature_flag.set.id" semantic conventions. It represents the identifier of // the [flag set] to which the feature flag belongs. // // [flag set]: https://openfeature.dev/specification/glossary/#flag-set func FeatureFlagSetID(val string) attribute.KeyValue { return FeatureFlagSetIDKey.String(val) } // FeatureFlagVersion returns an attribute KeyValue conforming to the // "feature_flag.version" semantic conventions. It represents the version of the // ruleset used during the evaluation. This may be any stable value which // uniquely identifies the ruleset. func FeatureFlagVersion(val string) attribute.KeyValue { return FeatureFlagVersionKey.String(val) } // Enum values for feature_flag.result.reason var ( // The resolved value is static (no dynamic evaluation). // Stability: release_candidate FeatureFlagResultReasonStatic = FeatureFlagResultReasonKey.String("static") // The resolved value fell back to a pre-configured value (no dynamic evaluation // occurred or dynamic evaluation yielded no result). // Stability: release_candidate FeatureFlagResultReasonDefault = FeatureFlagResultReasonKey.String("default") // The resolved value was the result of a dynamic evaluation, such as a rule or // specific user-targeting. // Stability: release_candidate FeatureFlagResultReasonTargetingMatch = FeatureFlagResultReasonKey.String("targeting_match") // The resolved value was the result of pseudorandom assignment. // Stability: release_candidate FeatureFlagResultReasonSplit = FeatureFlagResultReasonKey.String("split") // The resolved value was retrieved from cache. // Stability: release_candidate FeatureFlagResultReasonCached = FeatureFlagResultReasonKey.String("cached") // The resolved value was the result of the flag being disabled in the // management system. // Stability: release_candidate FeatureFlagResultReasonDisabled = FeatureFlagResultReasonKey.String("disabled") // The reason for the resolved value could not be determined. // Stability: release_candidate FeatureFlagResultReasonUnknown = FeatureFlagResultReasonKey.String("unknown") // The resolved value is non-authoritative or possibly out of date // Stability: release_candidate FeatureFlagResultReasonStale = FeatureFlagResultReasonKey.String("stale") // The resolved value was the result of an error. // Stability: release_candidate FeatureFlagResultReasonError = FeatureFlagResultReasonKey.String("error") ) // Namespace: file const ( // FileAccessedKey is the attribute Key conforming to the "file.accessed" // semantic conventions. It represents the time when the file was last accessed, // in ISO 8601 format. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "2021-01-01T12:00:00Z" // Note: This attribute might not be supported by some file systems — NFS, // FAT32, in embedded OS, etc. FileAccessedKey = attribute.Key("file.accessed") // FileAttributesKey is the attribute Key conforming to the "file.attributes" // semantic conventions. It represents the array of file attributes. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "readonly", "hidden" // Note: Attributes names depend on the OS or file system. Here’s a // non-exhaustive list of values expected for this attribute: `archive`, // `compressed`, `directory`, `encrypted`, `execute`, `hidden`, `immutable`, // `journaled`, `read`, `readonly`, `symbolic link`, `system`, `temporary`, // `write`. FileAttributesKey = attribute.Key("file.attributes") // FileChangedKey is the attribute Key conforming to the "file.changed" semantic // conventions. It represents the time when the file attributes or metadata was // last changed, in ISO 8601 format. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "2021-01-01T12:00:00Z" // Note: `file.changed` captures the time when any of the file's properties or // attributes (including the content) are changed, while `file.modified` // captures the timestamp when the file content is modified. FileChangedKey = attribute.Key("file.changed") // FileCreatedKey is the attribute Key conforming to the "file.created" semantic // conventions. It represents the time when the file was created, in ISO 8601 // format. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "2021-01-01T12:00:00Z" // Note: This attribute might not be supported by some file systems — NFS, // FAT32, in embedded OS, etc. FileCreatedKey = attribute.Key("file.created") // FileDirectoryKey is the attribute Key conforming to the "file.directory" // semantic conventions. It represents the directory where the file is located. // It should include the drive letter, when appropriate. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "/home/user", "C:\Program Files\MyApp" FileDirectoryKey = attribute.Key("file.directory") // FileExtensionKey is the attribute Key conforming to the "file.extension" // semantic conventions. It represents the file extension, excluding the leading // dot. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "png", "gz" // Note: When the file name has multiple extensions (example.tar.gz), only the // last one should be captured ("gz", not "tar.gz"). FileExtensionKey = attribute.Key("file.extension") // FileForkNameKey is the attribute Key conforming to the "file.fork_name" // semantic conventions. It represents the name of the fork. A fork is // additional data associated with a filesystem object. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Zone.Identifier" // Note: On Linux, a resource fork is used to store additional data with a // filesystem object. A file always has at least one fork for the data portion, // and additional forks may exist. // On NTFS, this is analogous to an Alternate Data Stream (ADS), and the default // data stream for a file is just called $DATA. Zone.Identifier is commonly used // by Windows to track contents downloaded from the Internet. An ADS is // typically of the form: C:\path\to\filename.extension:some_fork_name, and // some_fork_name is the value that should populate `fork_name`. // `filename.extension` should populate `file.name`, and `extension` should // populate `file.extension`. The full path, `file.path`, will include the fork // name. FileForkNameKey = attribute.Key("file.fork_name") // FileGroupIDKey is the attribute Key conforming to the "file.group.id" // semantic conventions. It represents the primary Group ID (GID) of the file. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "1000" FileGroupIDKey = attribute.Key("file.group.id") // FileGroupNameKey is the attribute Key conforming to the "file.group.name" // semantic conventions. It represents the primary group name of the file. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "users" FileGroupNameKey = attribute.Key("file.group.name") // FileInodeKey is the attribute Key conforming to the "file.inode" semantic // conventions. It represents the inode representing the file in the filesystem. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "256383" FileInodeKey = attribute.Key("file.inode") // FileModeKey is the attribute Key conforming to the "file.mode" semantic // conventions. It represents the mode of the file in octal representation. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "0640" FileModeKey = attribute.Key("file.mode") // FileModifiedKey is the attribute Key conforming to the "file.modified" // semantic conventions. It represents the time when the file content was last // modified, in ISO 8601 format. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "2021-01-01T12:00:00Z" FileModifiedKey = attribute.Key("file.modified") // FileNameKey is the attribute Key conforming to the "file.name" semantic // conventions. It represents the name of the file including the extension, // without the directory. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "example.png" FileNameKey = attribute.Key("file.name") // FileOwnerIDKey is the attribute Key conforming to the "file.owner.id" // semantic conventions. It represents the user ID (UID) or security identifier // (SID) of the file owner. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "1000" FileOwnerIDKey = attribute.Key("file.owner.id") // FileOwnerNameKey is the attribute Key conforming to the "file.owner.name" // semantic conventions. It represents the username of the file owner. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "root" FileOwnerNameKey = attribute.Key("file.owner.name") // FilePathKey is the attribute Key conforming to the "file.path" semantic // conventions. It represents the full path to the file, including the file // name. It should include the drive letter, when appropriate. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "/home/alice/example.png", "C:\Program Files\MyApp\myapp.exe" FilePathKey = attribute.Key("file.path") // FileSizeKey is the attribute Key conforming to the "file.size" semantic // conventions. It represents the file size in bytes. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: FileSizeKey = attribute.Key("file.size") // FileSymbolicLinkTargetPathKey is the attribute Key conforming to the // "file.symbolic_link.target_path" semantic conventions. It represents the path // to the target of a symbolic link. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "/usr/bin/python3" // Note: This attribute is only applicable to symbolic links. FileSymbolicLinkTargetPathKey = attribute.Key("file.symbolic_link.target_path") ) // FileAccessed returns an attribute KeyValue conforming to the "file.accessed" // semantic conventions. It represents the time when the file was last accessed, // in ISO 8601 format. func FileAccessed(val string) attribute.KeyValue { return FileAccessedKey.String(val) } // FileAttributes returns an attribute KeyValue conforming to the // "file.attributes" semantic conventions. It represents the array of file // attributes. func FileAttributes(val ...string) attribute.KeyValue { return FileAttributesKey.StringSlice(val) } // FileChanged returns an attribute KeyValue conforming to the "file.changed" // semantic conventions. It represents the time when the file attributes or // metadata was last changed, in ISO 8601 format. func FileChanged(val string) attribute.KeyValue { return FileChangedKey.String(val) } // FileCreated returns an attribute KeyValue conforming to the "file.created" // semantic conventions. It represents the time when the file was created, in ISO // 8601 format. func FileCreated(val string) attribute.KeyValue { return FileCreatedKey.String(val) } // FileDirectory returns an attribute KeyValue conforming to the "file.directory" // semantic conventions. It represents the directory where the file is located. // It should include the drive letter, when appropriate. func FileDirectory(val string) attribute.KeyValue { return FileDirectoryKey.String(val) } // FileExtension returns an attribute KeyValue conforming to the "file.extension" // semantic conventions. It represents the file extension, excluding the leading // dot. func FileExtension(val string) attribute.KeyValue { return FileExtensionKey.String(val) } // FileForkName returns an attribute KeyValue conforming to the "file.fork_name" // semantic conventions. It represents the name of the fork. A fork is additional // data associated with a filesystem object. func FileForkName(val string) attribute.KeyValue { return FileForkNameKey.String(val) } // FileGroupID returns an attribute KeyValue conforming to the "file.group.id" // semantic conventions. It represents the primary Group ID (GID) of the file. func FileGroupID(val string) attribute.KeyValue { return FileGroupIDKey.String(val) } // FileGroupName returns an attribute KeyValue conforming to the // "file.group.name" semantic conventions. It represents the primary group name // of the file. func FileGroupName(val string) attribute.KeyValue { return FileGroupNameKey.String(val) } // FileInode returns an attribute KeyValue conforming to the "file.inode" // semantic conventions. It represents the inode representing the file in the // filesystem. func FileInode(val string) attribute.KeyValue { return FileInodeKey.String(val) } // FileMode returns an attribute KeyValue conforming to the "file.mode" semantic // conventions. It represents the mode of the file in octal representation. func FileMode(val string) attribute.KeyValue { return FileModeKey.String(val) } // FileModified returns an attribute KeyValue conforming to the "file.modified" // semantic conventions. It represents the time when the file content was last // modified, in ISO 8601 format. func FileModified(val string) attribute.KeyValue { return FileModifiedKey.String(val) } // FileName returns an attribute KeyValue conforming to the "file.name" semantic // conventions. It represents the name of the file including the extension, // without the directory. func FileName(val string) attribute.KeyValue { return FileNameKey.String(val) } // FileOwnerID returns an attribute KeyValue conforming to the "file.owner.id" // semantic conventions. It represents the user ID (UID) or security identifier // (SID) of the file owner. func FileOwnerID(val string) attribute.KeyValue { return FileOwnerIDKey.String(val) } // FileOwnerName returns an attribute KeyValue conforming to the // "file.owner.name" semantic conventions. It represents the username of the file // owner. func FileOwnerName(val string) attribute.KeyValue { return FileOwnerNameKey.String(val) } // FilePath returns an attribute KeyValue conforming to the "file.path" semantic // conventions. It represents the full path to the file, including the file name. // It should include the drive letter, when appropriate. func FilePath(val string) attribute.KeyValue { return FilePathKey.String(val) } // FileSize returns an attribute KeyValue conforming to the "file.size" semantic // conventions. It represents the file size in bytes. func FileSize(val int) attribute.KeyValue { return FileSizeKey.Int(val) } // FileSymbolicLinkTargetPath returns an attribute KeyValue conforming to the // "file.symbolic_link.target_path" semantic conventions. It represents the path // to the target of a symbolic link. func FileSymbolicLinkTargetPath(val string) attribute.KeyValue { return FileSymbolicLinkTargetPathKey.String(val) } // Namespace: gcp const ( // GCPAppHubApplicationContainerKey is the attribute Key conforming to the // "gcp.apphub.application.container" semantic conventions. It represents the // container within GCP where the AppHub application is defined. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "projects/my-container-project" GCPAppHubApplicationContainerKey = attribute.Key("gcp.apphub.application.container") // GCPAppHubApplicationIDKey is the attribute Key conforming to the // "gcp.apphub.application.id" semantic conventions. It represents the name of // the application as configured in AppHub. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "my-application" GCPAppHubApplicationIDKey = attribute.Key("gcp.apphub.application.id") // GCPAppHubApplicationLocationKey is the attribute Key conforming to the // "gcp.apphub.application.location" semantic conventions. It represents the GCP // zone or region where the application is defined. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "us-central1" GCPAppHubApplicationLocationKey = attribute.Key("gcp.apphub.application.location") // GCPAppHubServiceCriticalityTypeKey is the attribute Key conforming to the // "gcp.apphub.service.criticality_type" semantic conventions. It represents the // criticality of a service indicates its importance to the business. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // Note: [See AppHub type enum] // // [See AppHub type enum]: https://cloud.google.com/app-hub/docs/reference/rest/v1/Attributes#type GCPAppHubServiceCriticalityTypeKey = attribute.Key("gcp.apphub.service.criticality_type") // GCPAppHubServiceEnvironmentTypeKey is the attribute Key conforming to the // "gcp.apphub.service.environment_type" semantic conventions. It represents the // environment of a service is the stage of a software lifecycle. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // Note: [See AppHub environment type] // // [See AppHub environment type]: https://cloud.google.com/app-hub/docs/reference/rest/v1/Attributes#type_1 GCPAppHubServiceEnvironmentTypeKey = attribute.Key("gcp.apphub.service.environment_type") // GCPAppHubServiceIDKey is the attribute Key conforming to the // "gcp.apphub.service.id" semantic conventions. It represents the name of the // service as configured in AppHub. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "my-service" GCPAppHubServiceIDKey = attribute.Key("gcp.apphub.service.id") // GCPAppHubWorkloadCriticalityTypeKey is the attribute Key conforming to the // "gcp.apphub.workload.criticality_type" semantic conventions. It represents // the criticality of a workload indicates its importance to the business. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // Note: [See AppHub type enum] // // [See AppHub type enum]: https://cloud.google.com/app-hub/docs/reference/rest/v1/Attributes#type GCPAppHubWorkloadCriticalityTypeKey = attribute.Key("gcp.apphub.workload.criticality_type") // GCPAppHubWorkloadEnvironmentTypeKey is the attribute Key conforming to the // "gcp.apphub.workload.environment_type" semantic conventions. It represents // the environment of a workload is the stage of a software lifecycle. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // Note: [See AppHub environment type] // // [See AppHub environment type]: https://cloud.google.com/app-hub/docs/reference/rest/v1/Attributes#type_1 GCPAppHubWorkloadEnvironmentTypeKey = attribute.Key("gcp.apphub.workload.environment_type") // GCPAppHubWorkloadIDKey is the attribute Key conforming to the // "gcp.apphub.workload.id" semantic conventions. It represents the name of the // workload as configured in AppHub. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "my-workload" GCPAppHubWorkloadIDKey = attribute.Key("gcp.apphub.workload.id") // GCPAppHubDestinationApplicationContainerKey is the attribute Key conforming // to the "gcp.apphub_destination.application.container" semantic conventions. // It represents the container within GCP where the AppHub destination // application is defined. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "projects/my-container-project" GCPAppHubDestinationApplicationContainerKey = attribute.Key("gcp.apphub_destination.application.container") // GCPAppHubDestinationApplicationIDKey is the attribute Key conforming to the // "gcp.apphub_destination.application.id" semantic conventions. It represents // the name of the destination application as configured in AppHub. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "my-application" GCPAppHubDestinationApplicationIDKey = attribute.Key("gcp.apphub_destination.application.id") // GCPAppHubDestinationApplicationLocationKey is the attribute Key conforming to // the "gcp.apphub_destination.application.location" semantic conventions. It // represents the GCP zone or region where the destination application is // defined. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "us-central1" GCPAppHubDestinationApplicationLocationKey = attribute.Key("gcp.apphub_destination.application.location") // GCPAppHubDestinationServiceCriticalityTypeKey is the attribute Key conforming // to the "gcp.apphub_destination.service.criticality_type" semantic // conventions. It represents the criticality of a destination workload // indicates its importance to the business as specified in [AppHub type enum]. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // // [AppHub type enum]: https://cloud.google.com/app-hub/docs/reference/rest/v1/Attributes#type GCPAppHubDestinationServiceCriticalityTypeKey = attribute.Key("gcp.apphub_destination.service.criticality_type") // GCPAppHubDestinationServiceEnvironmentTypeKey is the attribute Key conforming // to the "gcp.apphub_destination.service.environment_type" semantic // conventions. It represents the software lifecycle stage of a destination // service as defined [AppHub environment type]. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // // [AppHub environment type]: https://cloud.google.com/app-hub/docs/reference/rest/v1/Attributes#type_1 GCPAppHubDestinationServiceEnvironmentTypeKey = attribute.Key("gcp.apphub_destination.service.environment_type") // GCPAppHubDestinationServiceIDKey is the attribute Key conforming to the // "gcp.apphub_destination.service.id" semantic conventions. It represents the // name of the destination service as configured in AppHub. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "my-service" GCPAppHubDestinationServiceIDKey = attribute.Key("gcp.apphub_destination.service.id") // GCPAppHubDestinationWorkloadCriticalityTypeKey is the attribute Key // conforming to the "gcp.apphub_destination.workload.criticality_type" semantic // conventions. It represents the criticality of a destination workload // indicates its importance to the business as specified in [AppHub type enum]. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // // [AppHub type enum]: https://cloud.google.com/app-hub/docs/reference/rest/v1/Attributes#type GCPAppHubDestinationWorkloadCriticalityTypeKey = attribute.Key("gcp.apphub_destination.workload.criticality_type") // GCPAppHubDestinationWorkloadEnvironmentTypeKey is the attribute Key // conforming to the "gcp.apphub_destination.workload.environment_type" semantic // conventions. It represents the environment of a destination workload is the // stage of a software lifecycle as provided in the [AppHub environment type]. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // // [AppHub environment type]: https://cloud.google.com/app-hub/docs/reference/rest/v1/Attributes#type_1 GCPAppHubDestinationWorkloadEnvironmentTypeKey = attribute.Key("gcp.apphub_destination.workload.environment_type") // GCPAppHubDestinationWorkloadIDKey is the attribute Key conforming to the // "gcp.apphub_destination.workload.id" semantic conventions. It represents the // name of the destination workload as configured in AppHub. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "my-workload" GCPAppHubDestinationWorkloadIDKey = attribute.Key("gcp.apphub_destination.workload.id") // GCPClientServiceKey is the attribute Key conforming to the // "gcp.client.service" semantic conventions. It represents the identifies the // Google Cloud service for which the official client library is intended. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "appengine", "run", "firestore", "alloydb", "spanner" // Note: Intended to be a stable identifier for Google Cloud client libraries // that is uniform across implementation languages. The value should be derived // from the canonical service domain for the service; for example, // 'foo.googleapis.com' should result in a value of 'foo'. GCPClientServiceKey = attribute.Key("gcp.client.service") // GCPCloudRunJobExecutionKey is the attribute Key conforming to the // "gcp.cloud_run.job.execution" semantic conventions. It represents the name of // the Cloud Run [execution] being run for the Job, as set by the // [`CLOUD_RUN_EXECUTION`] environment variable. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "job-name-xxxx", "sample-job-mdw84" // // [execution]: https://cloud.google.com/run/docs/managing/job-executions // [`CLOUD_RUN_EXECUTION`]: https://cloud.google.com/run/docs/container-contract#jobs-env-vars GCPCloudRunJobExecutionKey = attribute.Key("gcp.cloud_run.job.execution") // GCPCloudRunJobTaskIndexKey is the attribute Key conforming to the // "gcp.cloud_run.job.task_index" semantic conventions. It represents the index // for a task within an execution as provided by the [`CLOUD_RUN_TASK_INDEX`] // environment variable. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 0, 1 // // [`CLOUD_RUN_TASK_INDEX`]: https://cloud.google.com/run/docs/container-contract#jobs-env-vars GCPCloudRunJobTaskIndexKey = attribute.Key("gcp.cloud_run.job.task_index") // GCPGCEInstanceHostnameKey is the attribute Key conforming to the // "gcp.gce.instance.hostname" semantic conventions. It represents the hostname // of a GCE instance. This is the full value of the default or [custom hostname] // . // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "my-host1234.example.com", // "sample-vm.us-west1-b.c.my-project.internal" // // [custom hostname]: https://cloud.google.com/compute/docs/instances/custom-hostname-vm GCPGCEInstanceHostnameKey = attribute.Key("gcp.gce.instance.hostname") // GCPGCEInstanceNameKey is the attribute Key conforming to the // "gcp.gce.instance.name" semantic conventions. It represents the instance name // of a GCE instance. This is the value provided by `host.name`, the visible // name of the instance in the Cloud Console UI, and the prefix for the default // hostname of the instance as defined by the [default internal DNS name]. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "instance-1", "my-vm-name" // // [default internal DNS name]: https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names GCPGCEInstanceNameKey = attribute.Key("gcp.gce.instance.name") ) // GCPAppHubApplicationContainer returns an attribute KeyValue conforming to the // "gcp.apphub.application.container" semantic conventions. It represents the // container within GCP where the AppHub application is defined. func GCPAppHubApplicationContainer(val string) attribute.KeyValue { return GCPAppHubApplicationContainerKey.String(val) } // GCPAppHubApplicationID returns an attribute KeyValue conforming to the // "gcp.apphub.application.id" semantic conventions. It represents the name of // the application as configured in AppHub. func GCPAppHubApplicationID(val string) attribute.KeyValue { return GCPAppHubApplicationIDKey.String(val) } // GCPAppHubApplicationLocation returns an attribute KeyValue conforming to the // "gcp.apphub.application.location" semantic conventions. It represents the GCP // zone or region where the application is defined. func GCPAppHubApplicationLocation(val string) attribute.KeyValue { return GCPAppHubApplicationLocationKey.String(val) } // GCPAppHubServiceID returns an attribute KeyValue conforming to the // "gcp.apphub.service.id" semantic conventions. It represents the name of the // service as configured in AppHub. func GCPAppHubServiceID(val string) attribute.KeyValue { return GCPAppHubServiceIDKey.String(val) } // GCPAppHubWorkloadID returns an attribute KeyValue conforming to the // "gcp.apphub.workload.id" semantic conventions. It represents the name of the // workload as configured in AppHub. func GCPAppHubWorkloadID(val string) attribute.KeyValue { return GCPAppHubWorkloadIDKey.String(val) } // GCPAppHubDestinationApplicationContainer returns an attribute KeyValue // conforming to the "gcp.apphub_destination.application.container" semantic // conventions. It represents the container within GCP where the AppHub // destination application is defined. func GCPAppHubDestinationApplicationContainer(val string) attribute.KeyValue { return GCPAppHubDestinationApplicationContainerKey.String(val) } // GCPAppHubDestinationApplicationID returns an attribute KeyValue conforming to // the "gcp.apphub_destination.application.id" semantic conventions. It // represents the name of the destination application as configured in AppHub. func GCPAppHubDestinationApplicationID(val string) attribute.KeyValue { return GCPAppHubDestinationApplicationIDKey.String(val) } // GCPAppHubDestinationApplicationLocation returns an attribute KeyValue // conforming to the "gcp.apphub_destination.application.location" semantic // conventions. It represents the GCP zone or region where the destination // application is defined. func GCPAppHubDestinationApplicationLocation(val string) attribute.KeyValue { return GCPAppHubDestinationApplicationLocationKey.String(val) } // GCPAppHubDestinationServiceID returns an attribute KeyValue conforming to the // "gcp.apphub_destination.service.id" semantic conventions. It represents the // name of the destination service as configured in AppHub. func GCPAppHubDestinationServiceID(val string) attribute.KeyValue { return GCPAppHubDestinationServiceIDKey.String(val) } // GCPAppHubDestinationWorkloadID returns an attribute KeyValue conforming to the // "gcp.apphub_destination.workload.id" semantic conventions. It represents the // name of the destination workload as configured in AppHub. func GCPAppHubDestinationWorkloadID(val string) attribute.KeyValue { return GCPAppHubDestinationWorkloadIDKey.String(val) } // GCPClientService returns an attribute KeyValue conforming to the // "gcp.client.service" semantic conventions. It represents the identifies the // Google Cloud service for which the official client library is intended. func GCPClientService(val string) attribute.KeyValue { return GCPClientServiceKey.String(val) } // GCPCloudRunJobExecution returns an attribute KeyValue conforming to the // "gcp.cloud_run.job.execution" semantic conventions. It represents the name of // the Cloud Run [execution] being run for the Job, as set by the // [`CLOUD_RUN_EXECUTION`] environment variable. // // [execution]: https://cloud.google.com/run/docs/managing/job-executions // [`CLOUD_RUN_EXECUTION`]: https://cloud.google.com/run/docs/container-contract#jobs-env-vars func GCPCloudRunJobExecution(val string) attribute.KeyValue { return GCPCloudRunJobExecutionKey.String(val) } // GCPCloudRunJobTaskIndex returns an attribute KeyValue conforming to the // "gcp.cloud_run.job.task_index" semantic conventions. It represents the index // for a task within an execution as provided by the [`CLOUD_RUN_TASK_INDEX`] // environment variable. // // [`CLOUD_RUN_TASK_INDEX`]: https://cloud.google.com/run/docs/container-contract#jobs-env-vars func GCPCloudRunJobTaskIndex(val int) attribute.KeyValue { return GCPCloudRunJobTaskIndexKey.Int(val) } // GCPGCEInstanceHostname returns an attribute KeyValue conforming to the // "gcp.gce.instance.hostname" semantic conventions. It represents the hostname // of a GCE instance. This is the full value of the default or [custom hostname] // . // // [custom hostname]: https://cloud.google.com/compute/docs/instances/custom-hostname-vm func GCPGCEInstanceHostname(val string) attribute.KeyValue { return GCPGCEInstanceHostnameKey.String(val) } // GCPGCEInstanceName returns an attribute KeyValue conforming to the // "gcp.gce.instance.name" semantic conventions. It represents the instance name // of a GCE instance. This is the value provided by `host.name`, the visible name // of the instance in the Cloud Console UI, and the prefix for the default // hostname of the instance as defined by the [default internal DNS name]. // // [default internal DNS name]: https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names func GCPGCEInstanceName(val string) attribute.KeyValue { return GCPGCEInstanceNameKey.String(val) } // Enum values for gcp.apphub.service.criticality_type var ( // Mission critical service. // Stability: development GCPAppHubServiceCriticalityTypeMissionCritical = GCPAppHubServiceCriticalityTypeKey.String("MISSION_CRITICAL") // High impact. // Stability: development GCPAppHubServiceCriticalityTypeHigh = GCPAppHubServiceCriticalityTypeKey.String("HIGH") // Medium impact. // Stability: development GCPAppHubServiceCriticalityTypeMedium = GCPAppHubServiceCriticalityTypeKey.String("MEDIUM") // Low impact. // Stability: development GCPAppHubServiceCriticalityTypeLow = GCPAppHubServiceCriticalityTypeKey.String("LOW") ) // Enum values for gcp.apphub.service.environment_type var ( // Production environment. // Stability: development GCPAppHubServiceEnvironmentTypeProduction = GCPAppHubServiceEnvironmentTypeKey.String("PRODUCTION") // Staging environment. // Stability: development GCPAppHubServiceEnvironmentTypeStaging = GCPAppHubServiceEnvironmentTypeKey.String("STAGING") // Test environment. // Stability: development GCPAppHubServiceEnvironmentTypeTest = GCPAppHubServiceEnvironmentTypeKey.String("TEST") // Development environment. // Stability: development GCPAppHubServiceEnvironmentTypeDevelopment = GCPAppHubServiceEnvironmentTypeKey.String("DEVELOPMENT") ) // Enum values for gcp.apphub.workload.criticality_type var ( // Mission critical service. // Stability: development GCPAppHubWorkloadCriticalityTypeMissionCritical = GCPAppHubWorkloadCriticalityTypeKey.String("MISSION_CRITICAL") // High impact. // Stability: development GCPAppHubWorkloadCriticalityTypeHigh = GCPAppHubWorkloadCriticalityTypeKey.String("HIGH") // Medium impact. // Stability: development GCPAppHubWorkloadCriticalityTypeMedium = GCPAppHubWorkloadCriticalityTypeKey.String("MEDIUM") // Low impact. // Stability: development GCPAppHubWorkloadCriticalityTypeLow = GCPAppHubWorkloadCriticalityTypeKey.String("LOW") ) // Enum values for gcp.apphub.workload.environment_type var ( // Production environment. // Stability: development GCPAppHubWorkloadEnvironmentTypeProduction = GCPAppHubWorkloadEnvironmentTypeKey.String("PRODUCTION") // Staging environment. // Stability: development GCPAppHubWorkloadEnvironmentTypeStaging = GCPAppHubWorkloadEnvironmentTypeKey.String("STAGING") // Test environment. // Stability: development GCPAppHubWorkloadEnvironmentTypeTest = GCPAppHubWorkloadEnvironmentTypeKey.String("TEST") // Development environment. // Stability: development GCPAppHubWorkloadEnvironmentTypeDevelopment = GCPAppHubWorkloadEnvironmentTypeKey.String("DEVELOPMENT") ) // Enum values for gcp.apphub_destination.service.criticality_type var ( // Mission critical service. // Stability: development GCPAppHubDestinationServiceCriticalityTypeMissionCritical = GCPAppHubDestinationServiceCriticalityTypeKey.String("MISSION_CRITICAL") // High impact. // Stability: development GCPAppHubDestinationServiceCriticalityTypeHigh = GCPAppHubDestinationServiceCriticalityTypeKey.String("HIGH") // Medium impact. // Stability: development GCPAppHubDestinationServiceCriticalityTypeMedium = GCPAppHubDestinationServiceCriticalityTypeKey.String("MEDIUM") // Low impact. // Stability: development GCPAppHubDestinationServiceCriticalityTypeLow = GCPAppHubDestinationServiceCriticalityTypeKey.String("LOW") ) // Enum values for gcp.apphub_destination.service.environment_type var ( // Production environment. // Stability: development GCPAppHubDestinationServiceEnvironmentTypeProduction = GCPAppHubDestinationServiceEnvironmentTypeKey.String("PRODUCTION") // Staging environment. // Stability: development GCPAppHubDestinationServiceEnvironmentTypeStaging = GCPAppHubDestinationServiceEnvironmentTypeKey.String("STAGING") // Test environment. // Stability: development GCPAppHubDestinationServiceEnvironmentTypeTest = GCPAppHubDestinationServiceEnvironmentTypeKey.String("TEST") // Development environment. // Stability: development GCPAppHubDestinationServiceEnvironmentTypeDevelopment = GCPAppHubDestinationServiceEnvironmentTypeKey.String("DEVELOPMENT") ) // Enum values for gcp.apphub_destination.workload.criticality_type var ( // Mission critical service. // Stability: development GCPAppHubDestinationWorkloadCriticalityTypeMissionCritical = GCPAppHubDestinationWorkloadCriticalityTypeKey.String("MISSION_CRITICAL") // High impact. // Stability: development GCPAppHubDestinationWorkloadCriticalityTypeHigh = GCPAppHubDestinationWorkloadCriticalityTypeKey.String("HIGH") // Medium impact. // Stability: development GCPAppHubDestinationWorkloadCriticalityTypeMedium = GCPAppHubDestinationWorkloadCriticalityTypeKey.String("MEDIUM") // Low impact. // Stability: development GCPAppHubDestinationWorkloadCriticalityTypeLow = GCPAppHubDestinationWorkloadCriticalityTypeKey.String("LOW") ) // Enum values for gcp.apphub_destination.workload.environment_type var ( // Production environment. // Stability: development GCPAppHubDestinationWorkloadEnvironmentTypeProduction = GCPAppHubDestinationWorkloadEnvironmentTypeKey.String("PRODUCTION") // Staging environment. // Stability: development GCPAppHubDestinationWorkloadEnvironmentTypeStaging = GCPAppHubDestinationWorkloadEnvironmentTypeKey.String("STAGING") // Test environment. // Stability: development GCPAppHubDestinationWorkloadEnvironmentTypeTest = GCPAppHubDestinationWorkloadEnvironmentTypeKey.String("TEST") // Development environment. // Stability: development GCPAppHubDestinationWorkloadEnvironmentTypeDevelopment = GCPAppHubDestinationWorkloadEnvironmentTypeKey.String("DEVELOPMENT") ) // Namespace: gen_ai const ( // GenAIAgentDescriptionKey is the attribute Key conforming to the // "gen_ai.agent.description" semantic conventions. It represents the free-form // description of the GenAI agent provided by the application. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Helps with math problems", "Generates fiction stories" GenAIAgentDescriptionKey = attribute.Key("gen_ai.agent.description") // GenAIAgentIDKey is the attribute Key conforming to the "gen_ai.agent.id" // semantic conventions. It represents the unique identifier of the GenAI agent. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "asst_5j66UpCpwteGg4YSxUnt7lPY" GenAIAgentIDKey = attribute.Key("gen_ai.agent.id") // GenAIAgentNameKey is the attribute Key conforming to the "gen_ai.agent.name" // semantic conventions. It represents the human-readable name of the GenAI // agent provided by the application. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Math Tutor", "Fiction Writer" GenAIAgentNameKey = attribute.Key("gen_ai.agent.name") // GenAIConversationIDKey is the attribute Key conforming to the // "gen_ai.conversation.id" semantic conventions. It represents the unique // identifier for a conversation (session, thread), used to store and correlate // messages within this conversation. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "conv_5j66UpCpwteGg4YSxUnt7lPY" GenAIConversationIDKey = attribute.Key("gen_ai.conversation.id") // GenAIDataSourceIDKey is the attribute Key conforming to the // "gen_ai.data_source.id" semantic conventions. It represents the data source // identifier. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "H7STPQYOND" // Note: Data sources are used by AI agents and RAG applications to store // grounding data. A data source may be an external database, object store, // document collection, website, or any other storage system used by the GenAI // agent or application. The `gen_ai.data_source.id` SHOULD match the identifier // used by the GenAI system rather than a name specific to the external storage, // such as a database or object store. Semantic conventions referencing // `gen_ai.data_source.id` MAY also leverage additional attributes, such as // `db.*`, to further identify and describe the data source. GenAIDataSourceIDKey = attribute.Key("gen_ai.data_source.id") // GenAIEmbeddingsDimensionCountKey is the attribute Key conforming to the // "gen_ai.embeddings.dimension.count" semantic conventions. It represents the // number of dimensions the resulting output embeddings should have. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 512, 1024 GenAIEmbeddingsDimensionCountKey = attribute.Key("gen_ai.embeddings.dimension.count") // GenAIEvaluationExplanationKey is the attribute Key conforming to the // "gen_ai.evaluation.explanation" semantic conventions. It represents a // free-form explanation for the assigned score provided by the evaluator. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "The response is factually accurate but lacks sufficient detail to // fully address the question." GenAIEvaluationExplanationKey = attribute.Key("gen_ai.evaluation.explanation") // GenAIEvaluationNameKey is the attribute Key conforming to the // "gen_ai.evaluation.name" semantic conventions. It represents the name of the // evaluation metric used for the GenAI response. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Relevance", "IntentResolution" GenAIEvaluationNameKey = attribute.Key("gen_ai.evaluation.name") // GenAIEvaluationScoreLabelKey is the attribute Key conforming to the // "gen_ai.evaluation.score.label" semantic conventions. It represents the human // readable label for evaluation. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "relevant", "not_relevant", "correct", "incorrect", "pass", "fail" // Note: This attribute provides a human-readable interpretation of the // evaluation score produced by an evaluator. For example, a score value of 1 // could mean "relevant" in one evaluation system and "not relevant" in another, // depending on the scoring range and evaluator. The label SHOULD have low // cardinality. Possible values depend on the evaluation metric and evaluator // used; implementations SHOULD document the possible values. GenAIEvaluationScoreLabelKey = attribute.Key("gen_ai.evaluation.score.label") // GenAIEvaluationScoreValueKey is the attribute Key conforming to the // "gen_ai.evaluation.score.value" semantic conventions. It represents the // evaluation score returned by the evaluator. // // Type: double // RequirementLevel: Recommended // Stability: Development // // Examples: 4.0 GenAIEvaluationScoreValueKey = attribute.Key("gen_ai.evaluation.score.value") // GenAIInputMessagesKey is the attribute Key conforming to the // "gen_ai.input.messages" semantic conventions. It represents the chat history // provided to the model as an input. // // Type: any // RequirementLevel: Recommended // Stability: Development // // Examples: "[\n {\n "role": "user",\n "parts": [\n {\n "type": "text",\n // "content": "Weather in Paris?"\n }\n ]\n },\n {\n "role": "assistant",\n // "parts": [\n {\n "type": "tool_call",\n "id": // "call_VSPygqKTWdrhaFErNvMV18Yl",\n "name": "get_weather",\n "arguments": {\n // "location": "Paris"\n }\n }\n ]\n },\n {\n "role": "tool",\n "parts": [\n {\n // "type": "tool_call_response",\n "id": " call_VSPygqKTWdrhaFErNvMV18Yl",\n // "result": "rainy, 57°F"\n }\n ]\n }\n]\n" // Note: Instrumentations MUST follow [Input messages JSON schema]. // When the attribute is recorded on events, it MUST be recorded in structured // form. When recorded on spans, it MAY be recorded as a JSON string if // structured // format is not supported and SHOULD be recorded in structured form otherwise. // // Messages MUST be provided in the order they were sent to the model. // Instrumentations MAY provide a way for users to filter or truncate // input messages. // // > [!Warning] // > This attribute is likely to contain sensitive information including // > user/PII data. // // See [Recording content on attributes] // section for more details. // // [Input messages JSON schema]: /docs/gen-ai/gen-ai-input-messages.json // [Recording content on attributes]: /docs/gen-ai/gen-ai-spans.md#recording-content-on-attributes GenAIInputMessagesKey = attribute.Key("gen_ai.input.messages") // GenAIOperationNameKey is the attribute Key conforming to the // "gen_ai.operation.name" semantic conventions. It represents the name of the // operation being performed. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // Note: If one of the predefined values applies, but specific system uses a // different name it's RECOMMENDED to document it in the semantic conventions // for specific GenAI system and use system-specific name in the // instrumentation. If a different name is not documented, instrumentation // libraries SHOULD use applicable predefined value. GenAIOperationNameKey = attribute.Key("gen_ai.operation.name") // GenAIOutputMessagesKey is the attribute Key conforming to the // "gen_ai.output.messages" semantic conventions. It represents the messages // returned by the model where each message represents a specific model response // (choice, candidate). // // Type: any // RequirementLevel: Recommended // Stability: Development // // Examples: "[\n {\n "role": "assistant",\n "parts": [\n {\n "type": "text",\n // "content": "The weather in Paris is currently rainy with a temperature of // 57°F."\n }\n ],\n "finish_reason": "stop"\n }\n]\n" // Note: Instrumentations MUST follow [Output messages JSON schema] // // Each message represents a single output choice/candidate generated by // the model. Each message corresponds to exactly one generation // (choice/candidate) and vice versa - one choice cannot be split across // multiple messages or one message cannot contain parts from multiple choices. // // When the attribute is recorded on events, it MUST be recorded in structured // form. When recorded on spans, it MAY be recorded as a JSON string if // structured // format is not supported and SHOULD be recorded in structured form otherwise. // // Instrumentations MAY provide a way for users to filter or truncate // output messages. // // > [!Warning] // > This attribute is likely to contain sensitive information including // > user/PII data. // // See [Recording content on attributes] // section for more details. // // [Output messages JSON schema]: /docs/gen-ai/gen-ai-output-messages.json // [Recording content on attributes]: /docs/gen-ai/gen-ai-spans.md#recording-content-on-attributes GenAIOutputMessagesKey = attribute.Key("gen_ai.output.messages") // GenAIOutputTypeKey is the attribute Key conforming to the // "gen_ai.output.type" semantic conventions. It represents the represents the // content type requested by the client. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // Note: This attribute SHOULD be used when the client requests output of a // specific type. The model may return zero or more outputs of this type. // This attribute specifies the output modality and not the actual output // format. For example, if an image is requested, the actual output could be a // URL pointing to an image file. // Additional output format details may be recorded in the future in the // `gen_ai.output.{type}.*` attributes. GenAIOutputTypeKey = attribute.Key("gen_ai.output.type") // GenAIPromptNameKey is the attribute Key conforming to the // "gen_ai.prompt.name" semantic conventions. It represents the name of the // prompt that uniquely identifies it. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "analyze-code" GenAIPromptNameKey = attribute.Key("gen_ai.prompt.name") // GenAIProviderNameKey is the attribute Key conforming to the // "gen_ai.provider.name" semantic conventions. It represents the Generative AI // provider as identified by the client or server instrumentation. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // Note: The attribute SHOULD be set based on the instrumentation's best // knowledge and may differ from the actual model provider. // // Multiple providers, including Azure OpenAI, Gemini, and AI hosting platforms // are accessible using the OpenAI REST API and corresponding client libraries, // but may proxy or host models from different providers. // // The `gen_ai.request.model`, `gen_ai.response.model`, and `server.address` // attributes may help identify the actual system in use. // // The `gen_ai.provider.name` attribute acts as a discriminator that // identifies the GenAI telemetry format flavor specific to that provider // within GenAI semantic conventions. // It SHOULD be set consistently with provider-specific attributes and signals. // For example, GenAI spans, metrics, and events related to AWS Bedrock // should have the `gen_ai.provider.name` set to `aws.bedrock` and include // applicable `aws.bedrock.*` attributes and are not expected to include // `openai.*` attributes. GenAIProviderNameKey = attribute.Key("gen_ai.provider.name") // GenAIRequestChoiceCountKey is the attribute Key conforming to the // "gen_ai.request.choice.count" semantic conventions. It represents the target // number of candidate completions to return. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 3 GenAIRequestChoiceCountKey = attribute.Key("gen_ai.request.choice.count") // GenAIRequestEncodingFormatsKey is the attribute Key conforming to the // "gen_ai.request.encoding_formats" semantic conventions. It represents the // encoding formats requested in an embeddings operation, if specified. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "base64"], ["float", "binary" // Note: In some GenAI systems the encoding formats are called embedding types. // Also, some GenAI systems only accept a single format per request. GenAIRequestEncodingFormatsKey = attribute.Key("gen_ai.request.encoding_formats") // GenAIRequestFrequencyPenaltyKey is the attribute Key conforming to the // "gen_ai.request.frequency_penalty" semantic conventions. It represents the // frequency penalty setting for the GenAI request. // // Type: double // RequirementLevel: Recommended // Stability: Development // // Examples: 0.1 GenAIRequestFrequencyPenaltyKey = attribute.Key("gen_ai.request.frequency_penalty") // GenAIRequestMaxTokensKey is the attribute Key conforming to the // "gen_ai.request.max_tokens" semantic conventions. It represents the maximum // number of tokens the model generates for a request. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 100 GenAIRequestMaxTokensKey = attribute.Key("gen_ai.request.max_tokens") // GenAIRequestModelKey is the attribute Key conforming to the // "gen_ai.request.model" semantic conventions. It represents the name of the // GenAI model a request is being made to. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: gpt-4 GenAIRequestModelKey = attribute.Key("gen_ai.request.model") // GenAIRequestPresencePenaltyKey is the attribute Key conforming to the // "gen_ai.request.presence_penalty" semantic conventions. It represents the // presence penalty setting for the GenAI request. // // Type: double // RequirementLevel: Recommended // Stability: Development // // Examples: 0.1 GenAIRequestPresencePenaltyKey = attribute.Key("gen_ai.request.presence_penalty") // GenAIRequestSeedKey is the attribute Key conforming to the // "gen_ai.request.seed" semantic conventions. It represents the requests with // same seed value more likely to return same result. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 100 GenAIRequestSeedKey = attribute.Key("gen_ai.request.seed") // GenAIRequestStopSequencesKey is the attribute Key conforming to the // "gen_ai.request.stop_sequences" semantic conventions. It represents the list // of sequences that the model will use to stop generating further tokens. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "forest", "lived" GenAIRequestStopSequencesKey = attribute.Key("gen_ai.request.stop_sequences") // GenAIRequestTemperatureKey is the attribute Key conforming to the // "gen_ai.request.temperature" semantic conventions. It represents the // temperature setting for the GenAI request. // // Type: double // RequirementLevel: Recommended // Stability: Development // // Examples: 0.0 GenAIRequestTemperatureKey = attribute.Key("gen_ai.request.temperature") // GenAIRequestTopKKey is the attribute Key conforming to the // "gen_ai.request.top_k" semantic conventions. It represents the top_k sampling // setting for the GenAI request. // // Type: double // RequirementLevel: Recommended // Stability: Development // // Examples: 1.0 GenAIRequestTopKKey = attribute.Key("gen_ai.request.top_k") // GenAIRequestTopPKey is the attribute Key conforming to the // "gen_ai.request.top_p" semantic conventions. It represents the top_p sampling // setting for the GenAI request. // // Type: double // RequirementLevel: Recommended // Stability: Development // // Examples: 1.0 GenAIRequestTopPKey = attribute.Key("gen_ai.request.top_p") // GenAIResponseFinishReasonsKey is the attribute Key conforming to the // "gen_ai.response.finish_reasons" semantic conventions. It represents the // array of reasons the model stopped generating tokens, corresponding to each // generation received. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "stop"], ["stop", "length" GenAIResponseFinishReasonsKey = attribute.Key("gen_ai.response.finish_reasons") // GenAIResponseIDKey is the attribute Key conforming to the // "gen_ai.response.id" semantic conventions. It represents the unique // identifier for the completion. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "chatcmpl-123" GenAIResponseIDKey = attribute.Key("gen_ai.response.id") // GenAIResponseModelKey is the attribute Key conforming to the // "gen_ai.response.model" semantic conventions. It represents the name of the // model that generated the response. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "gpt-4-0613" GenAIResponseModelKey = attribute.Key("gen_ai.response.model") // GenAISystemInstructionsKey is the attribute Key conforming to the // "gen_ai.system_instructions" semantic conventions. It represents the system // message or instructions provided to the GenAI model separately from the chat // history. // // Type: any // RequirementLevel: Recommended // Stability: Development // // Examples: "[\n {\n "type": "text",\n "content": "You are an Agent that greet // users, always use greetings tool to respond"\n }\n]\n", "[\n {\n "type": // "text",\n "content": "You are a language translator."\n },\n {\n "type": // "text",\n "content": "Your mission is to translate text in English to // French."\n }\n]\n" // Note: This attribute SHOULD be used when the corresponding provider or API // allows to provide system instructions or messages separately from the // chat history. // // Instructions that are part of the chat history SHOULD be recorded in // `gen_ai.input.messages` attribute instead. // // Instrumentations MUST follow [System instructions JSON schema]. // // When recorded on spans, it MAY be recorded as a JSON string if structured // format is not supported and SHOULD be recorded in structured form otherwise. // // Instrumentations MAY provide a way for users to filter or truncate // system instructions. // // > [!Warning] // > This attribute may contain sensitive information. // // See [Recording content on attributes] // section for more details. // // [System instructions JSON schema]: /docs/gen-ai/gen-ai-system-instructions.json // [Recording content on attributes]: /docs/gen-ai/gen-ai-spans.md#recording-content-on-attributes GenAISystemInstructionsKey = attribute.Key("gen_ai.system_instructions") // GenAITokenTypeKey is the attribute Key conforming to the "gen_ai.token.type" // semantic conventions. It represents the type of token being counted. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "input", "output" GenAITokenTypeKey = attribute.Key("gen_ai.token.type") // GenAIToolCallArgumentsKey is the attribute Key conforming to the // "gen_ai.tool.call.arguments" semantic conventions. It represents the // parameters passed to the tool call. // // Type: any // RequirementLevel: Recommended // Stability: Development // // Examples: "{\n "location": "San Francisco?",\n "date": "2025-10-01"\n}\n" // Note: > [!WARNING] // // > This attribute may contain sensitive information. // // It's expected to be an object - in case a serialized string is available // to the instrumentation, the instrumentation SHOULD do the best effort to // deserialize it to an object. When recorded on spans, it MAY be recorded as a // JSON string if structured format is not supported and SHOULD be recorded in // structured form otherwise. GenAIToolCallArgumentsKey = attribute.Key("gen_ai.tool.call.arguments") // GenAIToolCallIDKey is the attribute Key conforming to the // "gen_ai.tool.call.id" semantic conventions. It represents the tool call // identifier. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "call_mszuSIzqtI65i1wAUOE8w5H4" GenAIToolCallIDKey = attribute.Key("gen_ai.tool.call.id") // GenAIToolCallResultKey is the attribute Key conforming to the // "gen_ai.tool.call.result" semantic conventions. It represents the result // returned by the tool call (if any and if execution was successful). // // Type: any // RequirementLevel: Recommended // Stability: Development // // Examples: "{\n "temperature_range": {\n "high": 75,\n "low": 60\n },\n // "conditions": "sunny"\n}\n" // Note: > [!WARNING] // // > This attribute may contain sensitive information. // // It's expected to be an object - in case a serialized string is available // to the instrumentation, the instrumentation SHOULD do the best effort to // deserialize it to an object. When recorded on spans, it MAY be recorded as a // JSON string if structured format is not supported and SHOULD be recorded in // structured form otherwise. GenAIToolCallResultKey = attribute.Key("gen_ai.tool.call.result") // GenAIToolDefinitionsKey is the attribute Key conforming to the // "gen_ai.tool.definitions" semantic conventions. It represents the list of // source system tool definitions available to the GenAI agent or model. // // Type: any // RequirementLevel: Recommended // Stability: Development // // Examples: "[\n {\n "type": "function",\n "name": "get_current_weather",\n // "description": "Get the current weather in a given location",\n "parameters": // {\n "type": "object",\n "properties": {\n "location": {\n "type": "string",\n // "description": "The city and state, e.g. San Francisco, CA"\n },\n "unit": // {\n "type": "string",\n "enum": [\n "celsius",\n "fahrenheit"\n ]\n }\n },\n // "required": [\n "location",\n "unit"\n ]\n }\n }\n]\n" // Note: The value of this attribute matches source system tool definition // format. // // It's expected to be an array of objects where each object represents a tool // definition. In case a serialized string is available // to the instrumentation, the instrumentation SHOULD do the best effort to // deserialize it to an array. When recorded on spans, it MAY be recorded as a // JSON string if structured format is not supported and SHOULD be recorded in // structured form otherwise. // // Since this attribute could be large, it's NOT RECOMMENDED to populate // it by default. Instrumentations MAY provide a way to enable // populating this attribute. GenAIToolDefinitionsKey = attribute.Key("gen_ai.tool.definitions") // GenAIToolDescriptionKey is the attribute Key conforming to the // "gen_ai.tool.description" semantic conventions. It represents the tool // description. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Multiply two numbers" GenAIToolDescriptionKey = attribute.Key("gen_ai.tool.description") // GenAIToolNameKey is the attribute Key conforming to the "gen_ai.tool.name" // semantic conventions. It represents the name of the tool utilized by the // agent. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Flights" GenAIToolNameKey = attribute.Key("gen_ai.tool.name") // GenAIToolTypeKey is the attribute Key conforming to the "gen_ai.tool.type" // semantic conventions. It represents the type of the tool utilized by the // agent. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "function", "extension", "datastore" // Note: Extension: A tool executed on the agent-side to directly call external // APIs, bridging the gap between the agent and real-world systems. // Agent-side operations involve actions that are performed by the agent on the // server or within the agent's controlled environment. // Function: A tool executed on the client-side, where the agent generates // parameters for a predefined function, and the client executes the logic. // Client-side operations are actions taken on the user's end or within the // client application. // Datastore: A tool used by the agent to access and query structured or // unstructured external data for retrieval-augmented tasks or knowledge // updates. GenAIToolTypeKey = attribute.Key("gen_ai.tool.type") // GenAIUsageInputTokensKey is the attribute Key conforming to the // "gen_ai.usage.input_tokens" semantic conventions. It represents the number of // tokens used in the GenAI input (prompt). // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 100 GenAIUsageInputTokensKey = attribute.Key("gen_ai.usage.input_tokens") // GenAIUsageOutputTokensKey is the attribute Key conforming to the // "gen_ai.usage.output_tokens" semantic conventions. It represents the number // of tokens used in the GenAI response (completion). // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 180 GenAIUsageOutputTokensKey = attribute.Key("gen_ai.usage.output_tokens") ) // GenAIAgentDescription returns an attribute KeyValue conforming to the // "gen_ai.agent.description" semantic conventions. It represents the free-form // description of the GenAI agent provided by the application. func GenAIAgentDescription(val string) attribute.KeyValue { return GenAIAgentDescriptionKey.String(val) } // GenAIAgentID returns an attribute KeyValue conforming to the "gen_ai.agent.id" // semantic conventions. It represents the unique identifier of the GenAI agent. func GenAIAgentID(val string) attribute.KeyValue { return GenAIAgentIDKey.String(val) } // GenAIAgentName returns an attribute KeyValue conforming to the // "gen_ai.agent.name" semantic conventions. It represents the human-readable // name of the GenAI agent provided by the application. func GenAIAgentName(val string) attribute.KeyValue { return GenAIAgentNameKey.String(val) } // GenAIConversationID returns an attribute KeyValue conforming to the // "gen_ai.conversation.id" semantic conventions. It represents the unique // identifier for a conversation (session, thread), used to store and correlate // messages within this conversation. func GenAIConversationID(val string) attribute.KeyValue { return GenAIConversationIDKey.String(val) } // GenAIDataSourceID returns an attribute KeyValue conforming to the // "gen_ai.data_source.id" semantic conventions. It represents the data source // identifier. func GenAIDataSourceID(val string) attribute.KeyValue { return GenAIDataSourceIDKey.String(val) } // GenAIEmbeddingsDimensionCount returns an attribute KeyValue conforming to the // "gen_ai.embeddings.dimension.count" semantic conventions. It represents the // number of dimensions the resulting output embeddings should have. func GenAIEmbeddingsDimensionCount(val int) attribute.KeyValue { return GenAIEmbeddingsDimensionCountKey.Int(val) } // GenAIEvaluationExplanation returns an attribute KeyValue conforming to the // "gen_ai.evaluation.explanation" semantic conventions. It represents a // free-form explanation for the assigned score provided by the evaluator. func GenAIEvaluationExplanation(val string) attribute.KeyValue { return GenAIEvaluationExplanationKey.String(val) } // GenAIEvaluationName returns an attribute KeyValue conforming to the // "gen_ai.evaluation.name" semantic conventions. It represents the name of the // evaluation metric used for the GenAI response. func GenAIEvaluationName(val string) attribute.KeyValue { return GenAIEvaluationNameKey.String(val) } // GenAIEvaluationScoreLabel returns an attribute KeyValue conforming to the // "gen_ai.evaluation.score.label" semantic conventions. It represents the human // readable label for evaluation. func GenAIEvaluationScoreLabel(val string) attribute.KeyValue { return GenAIEvaluationScoreLabelKey.String(val) } // GenAIEvaluationScoreValue returns an attribute KeyValue conforming to the // "gen_ai.evaluation.score.value" semantic conventions. It represents the // evaluation score returned by the evaluator. func GenAIEvaluationScoreValue(val float64) attribute.KeyValue { return GenAIEvaluationScoreValueKey.Float64(val) } // GenAIPromptName returns an attribute KeyValue conforming to the // "gen_ai.prompt.name" semantic conventions. It represents the name of the // prompt that uniquely identifies it. func GenAIPromptName(val string) attribute.KeyValue { return GenAIPromptNameKey.String(val) } // GenAIRequestChoiceCount returns an attribute KeyValue conforming to the // "gen_ai.request.choice.count" semantic conventions. It represents the target // number of candidate completions to return. func GenAIRequestChoiceCount(val int) attribute.KeyValue { return GenAIRequestChoiceCountKey.Int(val) } // GenAIRequestEncodingFormats returns an attribute KeyValue conforming to the // "gen_ai.request.encoding_formats" semantic conventions. It represents the // encoding formats requested in an embeddings operation, if specified. func GenAIRequestEncodingFormats(val ...string) attribute.KeyValue { return GenAIRequestEncodingFormatsKey.StringSlice(val) } // GenAIRequestFrequencyPenalty returns an attribute KeyValue conforming to the // "gen_ai.request.frequency_penalty" semantic conventions. It represents the // frequency penalty setting for the GenAI request. func GenAIRequestFrequencyPenalty(val float64) attribute.KeyValue { return GenAIRequestFrequencyPenaltyKey.Float64(val) } // GenAIRequestMaxTokens returns an attribute KeyValue conforming to the // "gen_ai.request.max_tokens" semantic conventions. It represents the maximum // number of tokens the model generates for a request. func GenAIRequestMaxTokens(val int) attribute.KeyValue { return GenAIRequestMaxTokensKey.Int(val) } // GenAIRequestModel returns an attribute KeyValue conforming to the // "gen_ai.request.model" semantic conventions. It represents the name of the // GenAI model a request is being made to. func GenAIRequestModel(val string) attribute.KeyValue { return GenAIRequestModelKey.String(val) } // GenAIRequestPresencePenalty returns an attribute KeyValue conforming to the // "gen_ai.request.presence_penalty" semantic conventions. It represents the // presence penalty setting for the GenAI request. func GenAIRequestPresencePenalty(val float64) attribute.KeyValue { return GenAIRequestPresencePenaltyKey.Float64(val) } // GenAIRequestSeed returns an attribute KeyValue conforming to the // "gen_ai.request.seed" semantic conventions. It represents the requests with // same seed value more likely to return same result. func GenAIRequestSeed(val int) attribute.KeyValue { return GenAIRequestSeedKey.Int(val) } // GenAIRequestStopSequences returns an attribute KeyValue conforming to the // "gen_ai.request.stop_sequences" semantic conventions. It represents the list // of sequences that the model will use to stop generating further tokens. func GenAIRequestStopSequences(val ...string) attribute.KeyValue { return GenAIRequestStopSequencesKey.StringSlice(val) } // GenAIRequestTemperature returns an attribute KeyValue conforming to the // "gen_ai.request.temperature" semantic conventions. It represents the // temperature setting for the GenAI request. func GenAIRequestTemperature(val float64) attribute.KeyValue { return GenAIRequestTemperatureKey.Float64(val) } // GenAIRequestTopK returns an attribute KeyValue conforming to the // "gen_ai.request.top_k" semantic conventions. It represents the top_k sampling // setting for the GenAI request. func GenAIRequestTopK(val float64) attribute.KeyValue { return GenAIRequestTopKKey.Float64(val) } // GenAIRequestTopP returns an attribute KeyValue conforming to the // "gen_ai.request.top_p" semantic conventions. It represents the top_p sampling // setting for the GenAI request. func GenAIRequestTopP(val float64) attribute.KeyValue { return GenAIRequestTopPKey.Float64(val) } // GenAIResponseFinishReasons returns an attribute KeyValue conforming to the // "gen_ai.response.finish_reasons" semantic conventions. It represents the array // of reasons the model stopped generating tokens, corresponding to each // generation received. func GenAIResponseFinishReasons(val ...string) attribute.KeyValue { return GenAIResponseFinishReasonsKey.StringSlice(val) } // GenAIResponseID returns an attribute KeyValue conforming to the // "gen_ai.response.id" semantic conventions. It represents the unique identifier // for the completion. func GenAIResponseID(val string) attribute.KeyValue { return GenAIResponseIDKey.String(val) } // GenAIResponseModel returns an attribute KeyValue conforming to the // "gen_ai.response.model" semantic conventions. It represents the name of the // model that generated the response. func GenAIResponseModel(val string) attribute.KeyValue { return GenAIResponseModelKey.String(val) } // GenAIToolCallID returns an attribute KeyValue conforming to the // "gen_ai.tool.call.id" semantic conventions. It represents the tool call // identifier. func GenAIToolCallID(val string) attribute.KeyValue { return GenAIToolCallIDKey.String(val) } // GenAIToolDescription returns an attribute KeyValue conforming to the // "gen_ai.tool.description" semantic conventions. It represents the tool // description. func GenAIToolDescription(val string) attribute.KeyValue { return GenAIToolDescriptionKey.String(val) } // GenAIToolName returns an attribute KeyValue conforming to the // "gen_ai.tool.name" semantic conventions. It represents the name of the tool // utilized by the agent. func GenAIToolName(val string) attribute.KeyValue { return GenAIToolNameKey.String(val) } // GenAIToolType returns an attribute KeyValue conforming to the // "gen_ai.tool.type" semantic conventions. It represents the type of the tool // utilized by the agent. func GenAIToolType(val string) attribute.KeyValue { return GenAIToolTypeKey.String(val) } // GenAIUsageInputTokens returns an attribute KeyValue conforming to the // "gen_ai.usage.input_tokens" semantic conventions. It represents the number of // tokens used in the GenAI input (prompt). func GenAIUsageInputTokens(val int) attribute.KeyValue { return GenAIUsageInputTokensKey.Int(val) } // GenAIUsageOutputTokens returns an attribute KeyValue conforming to the // "gen_ai.usage.output_tokens" semantic conventions. It represents the number of // tokens used in the GenAI response (completion). func GenAIUsageOutputTokens(val int) attribute.KeyValue { return GenAIUsageOutputTokensKey.Int(val) } // Enum values for gen_ai.operation.name var ( // Chat completion operation such as [OpenAI Chat API] // Stability: development // // [OpenAI Chat API]: https://platform.openai.com/docs/api-reference/chat GenAIOperationNameChat = GenAIOperationNameKey.String("chat") // Multimodal content generation operation such as [Gemini Generate Content] // Stability: development // // [Gemini Generate Content]: https://ai.google.dev/api/generate-content GenAIOperationNameGenerateContent = GenAIOperationNameKey.String("generate_content") // Text completions operation such as [OpenAI Completions API (Legacy)] // Stability: development // // [OpenAI Completions API (Legacy)]: https://platform.openai.com/docs/api-reference/completions GenAIOperationNameTextCompletion = GenAIOperationNameKey.String("text_completion") // Embeddings operation such as [OpenAI Create embeddings API] // Stability: development // // [OpenAI Create embeddings API]: https://platform.openai.com/docs/api-reference/embeddings/create GenAIOperationNameEmbeddings = GenAIOperationNameKey.String("embeddings") // Create GenAI agent // Stability: development GenAIOperationNameCreateAgent = GenAIOperationNameKey.String("create_agent") // Invoke GenAI agent // Stability: development GenAIOperationNameInvokeAgent = GenAIOperationNameKey.String("invoke_agent") // Execute a tool // Stability: development GenAIOperationNameExecuteTool = GenAIOperationNameKey.String("execute_tool") ) // Enum values for gen_ai.output.type var ( // Plain text // Stability: development GenAIOutputTypeText = GenAIOutputTypeKey.String("text") // JSON object with known or unknown schema // Stability: development GenAIOutputTypeJSON = GenAIOutputTypeKey.String("json") // Image // Stability: development GenAIOutputTypeImage = GenAIOutputTypeKey.String("image") // Speech // Stability: development GenAIOutputTypeSpeech = GenAIOutputTypeKey.String("speech") ) // Enum values for gen_ai.provider.name var ( // [OpenAI] // Stability: development // // [OpenAI]: https://openai.com/ GenAIProviderNameOpenAI = GenAIProviderNameKey.String("openai") // Any Google generative AI endpoint // Stability: development GenAIProviderNameGCPGenAI = GenAIProviderNameKey.String("gcp.gen_ai") // [Vertex AI] // Stability: development // // [Vertex AI]: https://cloud.google.com/vertex-ai GenAIProviderNameGCPVertexAI = GenAIProviderNameKey.String("gcp.vertex_ai") // [Gemini] // Stability: development // // [Gemini]: https://cloud.google.com/products/gemini GenAIProviderNameGCPGemini = GenAIProviderNameKey.String("gcp.gemini") // [Anthropic] // Stability: development // // [Anthropic]: https://www.anthropic.com/ GenAIProviderNameAnthropic = GenAIProviderNameKey.String("anthropic") // [Cohere] // Stability: development // // [Cohere]: https://cohere.com/ GenAIProviderNameCohere = GenAIProviderNameKey.String("cohere") // Azure AI Inference // Stability: development GenAIProviderNameAzureAIInference = GenAIProviderNameKey.String("azure.ai.inference") // [Azure OpenAI] // Stability: development // // [Azure OpenAI]: https://azure.microsoft.com/products/ai-services/openai-service/ GenAIProviderNameAzureAIOpenAI = GenAIProviderNameKey.String("azure.ai.openai") // [IBM Watsonx AI] // Stability: development // // [IBM Watsonx AI]: https://www.ibm.com/products/watsonx-ai GenAIProviderNameIBMWatsonxAI = GenAIProviderNameKey.String("ibm.watsonx.ai") // [AWS Bedrock] // Stability: development // // [AWS Bedrock]: https://aws.amazon.com/bedrock GenAIProviderNameAWSBedrock = GenAIProviderNameKey.String("aws.bedrock") // [Perplexity] // Stability: development // // [Perplexity]: https://www.perplexity.ai/ GenAIProviderNamePerplexity = GenAIProviderNameKey.String("perplexity") // [xAI] // Stability: development // // [xAI]: https://x.ai/ GenAIProviderNameXAI = GenAIProviderNameKey.String("x_ai") // [DeepSeek] // Stability: development // // [DeepSeek]: https://www.deepseek.com/ GenAIProviderNameDeepseek = GenAIProviderNameKey.String("deepseek") // [Groq] // Stability: development // // [Groq]: https://groq.com/ GenAIProviderNameGroq = GenAIProviderNameKey.String("groq") // [Mistral AI] // Stability: development // // [Mistral AI]: https://mistral.ai/ GenAIProviderNameMistralAI = GenAIProviderNameKey.String("mistral_ai") ) // Enum values for gen_ai.token.type var ( // Input tokens (prompt, input, etc.) // Stability: development GenAITokenTypeInput = GenAITokenTypeKey.String("input") // Output tokens (completion, response, etc.) // Stability: development GenAITokenTypeOutput = GenAITokenTypeKey.String("output") ) // Namespace: geo const ( // GeoContinentCodeKey is the attribute Key conforming to the // "geo.continent.code" semantic conventions. It represents the two-letter code // representing continent’s name. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: GeoContinentCodeKey = attribute.Key("geo.continent.code") // GeoCountryISOCodeKey is the attribute Key conforming to the // "geo.country.iso_code" semantic conventions. It represents the two-letter ISO // Country Code ([ISO 3166-1 alpha2]). // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "CA" // // [ISO 3166-1 alpha2]: https://wikipedia.org/wiki/ISO_3166-1#Codes GeoCountryISOCodeKey = attribute.Key("geo.country.iso_code") // GeoLocalityNameKey is the attribute Key conforming to the "geo.locality.name" // semantic conventions. It represents the locality name. Represents the name of // a city, town, village, or similar populated place. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Montreal", "Berlin" GeoLocalityNameKey = attribute.Key("geo.locality.name") // GeoLocationLatKey is the attribute Key conforming to the "geo.location.lat" // semantic conventions. It represents the latitude of the geo location in // [WGS84]. // // Type: double // RequirementLevel: Recommended // Stability: Development // // Examples: 45.505918 // // [WGS84]: https://wikipedia.org/wiki/World_Geodetic_System#WGS84 GeoLocationLatKey = attribute.Key("geo.location.lat") // GeoLocationLonKey is the attribute Key conforming to the "geo.location.lon" // semantic conventions. It represents the longitude of the geo location in // [WGS84]. // // Type: double // RequirementLevel: Recommended // Stability: Development // // Examples: -73.61483 // // [WGS84]: https://wikipedia.org/wiki/World_Geodetic_System#WGS84 GeoLocationLonKey = attribute.Key("geo.location.lon") // GeoPostalCodeKey is the attribute Key conforming to the "geo.postal_code" // semantic conventions. It represents the postal code associated with the // location. Values appropriate for this field may also be known as a postcode // or ZIP code and will vary widely from country to country. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "94040" GeoPostalCodeKey = attribute.Key("geo.postal_code") // GeoRegionISOCodeKey is the attribute Key conforming to the // "geo.region.iso_code" semantic conventions. It represents the region ISO code // ([ISO 3166-2]). // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "CA-QC" // // [ISO 3166-2]: https://wikipedia.org/wiki/ISO_3166-2 GeoRegionISOCodeKey = attribute.Key("geo.region.iso_code") ) // GeoCountryISOCode returns an attribute KeyValue conforming to the // "geo.country.iso_code" semantic conventions. It represents the two-letter ISO // Country Code ([ISO 3166-1 alpha2]). // // [ISO 3166-1 alpha2]: https://wikipedia.org/wiki/ISO_3166-1#Codes func GeoCountryISOCode(val string) attribute.KeyValue { return GeoCountryISOCodeKey.String(val) } // GeoLocalityName returns an attribute KeyValue conforming to the // "geo.locality.name" semantic conventions. It represents the locality name. // Represents the name of a city, town, village, or similar populated place. func GeoLocalityName(val string) attribute.KeyValue { return GeoLocalityNameKey.String(val) } // GeoLocationLat returns an attribute KeyValue conforming to the // "geo.location.lat" semantic conventions. It represents the latitude of the geo // location in [WGS84]. // // [WGS84]: https://wikipedia.org/wiki/World_Geodetic_System#WGS84 func GeoLocationLat(val float64) attribute.KeyValue { return GeoLocationLatKey.Float64(val) } // GeoLocationLon returns an attribute KeyValue conforming to the // "geo.location.lon" semantic conventions. It represents the longitude of the // geo location in [WGS84]. // // [WGS84]: https://wikipedia.org/wiki/World_Geodetic_System#WGS84 func GeoLocationLon(val float64) attribute.KeyValue { return GeoLocationLonKey.Float64(val) } // GeoPostalCode returns an attribute KeyValue conforming to the // "geo.postal_code" semantic conventions. It represents the postal code // associated with the location. Values appropriate for this field may also be // known as a postcode or ZIP code and will vary widely from country to country. func GeoPostalCode(val string) attribute.KeyValue { return GeoPostalCodeKey.String(val) } // GeoRegionISOCode returns an attribute KeyValue conforming to the // "geo.region.iso_code" semantic conventions. It represents the region ISO code // ([ISO 3166-2]). // // [ISO 3166-2]: https://wikipedia.org/wiki/ISO_3166-2 func GeoRegionISOCode(val string) attribute.KeyValue { return GeoRegionISOCodeKey.String(val) } // Enum values for geo.continent.code var ( // Africa // Stability: development GeoContinentCodeAf = GeoContinentCodeKey.String("AF") // Antarctica // Stability: development GeoContinentCodeAn = GeoContinentCodeKey.String("AN") // Asia // Stability: development GeoContinentCodeAs = GeoContinentCodeKey.String("AS") // Europe // Stability: development GeoContinentCodeEu = GeoContinentCodeKey.String("EU") // North America // Stability: development GeoContinentCodeNa = GeoContinentCodeKey.String("NA") // Oceania // Stability: development GeoContinentCodeOc = GeoContinentCodeKey.String("OC") // South America // Stability: development GeoContinentCodeSa = GeoContinentCodeKey.String("SA") ) // Namespace: go const ( // GoMemoryTypeKey is the attribute Key conforming to the "go.memory.type" // semantic conventions. It represents the type of memory. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "other", "stack" GoMemoryTypeKey = attribute.Key("go.memory.type") ) // Enum values for go.memory.type var ( // Memory allocated from the heap that is reserved for stack space, whether or // not it is currently in-use. // Stability: development GoMemoryTypeStack = GoMemoryTypeKey.String("stack") // Memory used by the Go runtime, excluding other categories of memory usage // described in this enumeration. // Stability: development GoMemoryTypeOther = GoMemoryTypeKey.String("other") ) // Namespace: graphql const ( // GraphQLDocumentKey is the attribute Key conforming to the "graphql.document" // semantic conventions. It represents the GraphQL document being executed. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: query findBookById { bookById(id: ?) { name } } // Note: The value may be sanitized to exclude sensitive information. GraphQLDocumentKey = attribute.Key("graphql.document") // GraphQLOperationNameKey is the attribute Key conforming to the // "graphql.operation.name" semantic conventions. It represents the name of the // operation being executed. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: findBookById GraphQLOperationNameKey = attribute.Key("graphql.operation.name") // GraphQLOperationTypeKey is the attribute Key conforming to the // "graphql.operation.type" semantic conventions. It represents the type of the // operation being executed. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "query", "mutation", "subscription" GraphQLOperationTypeKey = attribute.Key("graphql.operation.type") ) // GraphQLDocument returns an attribute KeyValue conforming to the // "graphql.document" semantic conventions. It represents the GraphQL document // being executed. func GraphQLDocument(val string) attribute.KeyValue { return GraphQLDocumentKey.String(val) } // GraphQLOperationName returns an attribute KeyValue conforming to the // "graphql.operation.name" semantic conventions. It represents the name of the // operation being executed. func GraphQLOperationName(val string) attribute.KeyValue { return GraphQLOperationNameKey.String(val) } // Enum values for graphql.operation.type var ( // GraphQL query // Stability: development GraphQLOperationTypeQuery = GraphQLOperationTypeKey.String("query") // GraphQL mutation // Stability: development GraphQLOperationTypeMutation = GraphQLOperationTypeKey.String("mutation") // GraphQL subscription // Stability: development GraphQLOperationTypeSubscription = GraphQLOperationTypeKey.String("subscription") ) // Namespace: heroku const ( // HerokuAppIDKey is the attribute Key conforming to the "heroku.app.id" // semantic conventions. It represents the unique identifier for the // application. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "2daa2797-e42b-4624-9322-ec3f968df4da" HerokuAppIDKey = attribute.Key("heroku.app.id") // HerokuReleaseCommitKey is the attribute Key conforming to the // "heroku.release.commit" semantic conventions. It represents the commit hash // for the current release. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "e6134959463efd8966b20e75b913cafe3f5ec" HerokuReleaseCommitKey = attribute.Key("heroku.release.commit") // HerokuReleaseCreationTimestampKey is the attribute Key conforming to the // "heroku.release.creation_timestamp" semantic conventions. It represents the // time and date the release was created. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "2022-10-23T18:00:42Z" HerokuReleaseCreationTimestampKey = attribute.Key("heroku.release.creation_timestamp") ) // HerokuAppID returns an attribute KeyValue conforming to the "heroku.app.id" // semantic conventions. It represents the unique identifier for the application. func HerokuAppID(val string) attribute.KeyValue { return HerokuAppIDKey.String(val) } // HerokuReleaseCommit returns an attribute KeyValue conforming to the // "heroku.release.commit" semantic conventions. It represents the commit hash // for the current release. func HerokuReleaseCommit(val string) attribute.KeyValue { return HerokuReleaseCommitKey.String(val) } // HerokuReleaseCreationTimestamp returns an attribute KeyValue conforming to the // "heroku.release.creation_timestamp" semantic conventions. It represents the // time and date the release was created. func HerokuReleaseCreationTimestamp(val string) attribute.KeyValue { return HerokuReleaseCreationTimestampKey.String(val) } // Namespace: host const ( // HostArchKey is the attribute Key conforming to the "host.arch" semantic // conventions. It represents the CPU architecture the host system is running // on. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: HostArchKey = attribute.Key("host.arch") // HostCPUCacheL2SizeKey is the attribute Key conforming to the // "host.cpu.cache.l2.size" semantic conventions. It represents the amount of // level 2 memory cache available to the processor (in Bytes). // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 12288000 HostCPUCacheL2SizeKey = attribute.Key("host.cpu.cache.l2.size") // HostCPUFamilyKey is the attribute Key conforming to the "host.cpu.family" // semantic conventions. It represents the family or generation of the CPU. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "6", "PA-RISC 1.1e" HostCPUFamilyKey = attribute.Key("host.cpu.family") // HostCPUModelIDKey is the attribute Key conforming to the "host.cpu.model.id" // semantic conventions. It represents the model identifier. It provides more // granular information about the CPU, distinguishing it from other CPUs within // the same family. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "6", "9000/778/B180L" HostCPUModelIDKey = attribute.Key("host.cpu.model.id") // HostCPUModelNameKey is the attribute Key conforming to the // "host.cpu.model.name" semantic conventions. It represents the model // designation of the processor. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz" HostCPUModelNameKey = attribute.Key("host.cpu.model.name") // HostCPUSteppingKey is the attribute Key conforming to the "host.cpu.stepping" // semantic conventions. It represents the stepping or core revisions. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "1", "r1p1" HostCPUSteppingKey = attribute.Key("host.cpu.stepping") // HostCPUVendorIDKey is the attribute Key conforming to the // "host.cpu.vendor.id" semantic conventions. It represents the processor // manufacturer identifier. A maximum 12-character string. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "GenuineIntel" // Note: [CPUID] command returns the vendor ID string in EBX, EDX and ECX // registers. Writing these to memory in this order results in a 12-character // string. // // [CPUID]: https://wiki.osdev.org/CPUID HostCPUVendorIDKey = attribute.Key("host.cpu.vendor.id") // HostIDKey is the attribute Key conforming to the "host.id" semantic // conventions. It represents the unique host ID. For Cloud, this must be the // instance_id assigned by the cloud provider. For non-containerized systems, // this should be the `machine-id`. See the table below for the sources to use // to determine the `machine-id` based on operating system. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "fdbf79e8af94cb7f9e8df36789187052" HostIDKey = attribute.Key("host.id") // HostImageIDKey is the attribute Key conforming to the "host.image.id" // semantic conventions. It represents the VM image ID or host OS image ID. For // Cloud, this value is from the provider. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "ami-07b06b442921831e5" HostImageIDKey = attribute.Key("host.image.id") // HostImageNameKey is the attribute Key conforming to the "host.image.name" // semantic conventions. It represents the name of the VM image or OS install // the host was instantiated from. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "infra-ami-eks-worker-node-7d4ec78312", "CentOS-8-x86_64-1905" HostImageNameKey = attribute.Key("host.image.name") // HostImageVersionKey is the attribute Key conforming to the // "host.image.version" semantic conventions. It represents the version string // of the VM image or host OS as defined in [Version Attributes]. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "0.1" // // [Version Attributes]: /docs/resource/README.md#version-attributes HostImageVersionKey = attribute.Key("host.image.version") // HostIPKey is the attribute Key conforming to the "host.ip" semantic // conventions. It represents the available IP addresses of the host, excluding // loopback interfaces. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "192.168.1.140", "fe80::abc2:4a28:737a:609e" // Note: IPv4 Addresses MUST be specified in dotted-quad notation. IPv6 // addresses MUST be specified in the [RFC 5952] format. // // [RFC 5952]: https://www.rfc-editor.org/rfc/rfc5952.html HostIPKey = attribute.Key("host.ip") // HostMacKey is the attribute Key conforming to the "host.mac" semantic // conventions. It represents the available MAC addresses of the host, excluding // loopback interfaces. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "AC-DE-48-23-45-67", "AC-DE-48-23-45-67-01-9F" // Note: MAC Addresses MUST be represented in [IEEE RA hexadecimal form]: as // hyphen-separated octets in uppercase hexadecimal form from most to least // significant. // // [IEEE RA hexadecimal form]: https://standards.ieee.org/wp-content/uploads/import/documents/tutorials/eui.pdf HostMacKey = attribute.Key("host.mac") // HostNameKey is the attribute Key conforming to the "host.name" semantic // conventions. It represents the name of the host. On Unix systems, it may // contain what the hostname command returns, or the fully qualified hostname, // or another name specified by the user. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "opentelemetry-test" HostNameKey = attribute.Key("host.name") // HostTypeKey is the attribute Key conforming to the "host.type" semantic // conventions. It represents the type of host. For Cloud, this must be the // machine type. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "n1-standard-1" HostTypeKey = attribute.Key("host.type") ) // HostCPUCacheL2Size returns an attribute KeyValue conforming to the // "host.cpu.cache.l2.size" semantic conventions. It represents the amount of // level 2 memory cache available to the processor (in Bytes). func HostCPUCacheL2Size(val int) attribute.KeyValue { return HostCPUCacheL2SizeKey.Int(val) } // HostCPUFamily returns an attribute KeyValue conforming to the // "host.cpu.family" semantic conventions. It represents the family or generation // of the CPU. func HostCPUFamily(val string) attribute.KeyValue { return HostCPUFamilyKey.String(val) } // HostCPUModelID returns an attribute KeyValue conforming to the // "host.cpu.model.id" semantic conventions. It represents the model identifier. // It provides more granular information about the CPU, distinguishing it from // other CPUs within the same family. func HostCPUModelID(val string) attribute.KeyValue { return HostCPUModelIDKey.String(val) } // HostCPUModelName returns an attribute KeyValue conforming to the // "host.cpu.model.name" semantic conventions. It represents the model // designation of the processor. func HostCPUModelName(val string) attribute.KeyValue { return HostCPUModelNameKey.String(val) } // HostCPUStepping returns an attribute KeyValue conforming to the // "host.cpu.stepping" semantic conventions. It represents the stepping or core // revisions. func HostCPUStepping(val string) attribute.KeyValue { return HostCPUSteppingKey.String(val) } // HostCPUVendorID returns an attribute KeyValue conforming to the // "host.cpu.vendor.id" semantic conventions. It represents the processor // manufacturer identifier. A maximum 12-character string. func HostCPUVendorID(val string) attribute.KeyValue { return HostCPUVendorIDKey.String(val) } // HostID returns an attribute KeyValue conforming to the "host.id" semantic // conventions. It represents the unique host ID. For Cloud, this must be the // instance_id assigned by the cloud provider. For non-containerized systems, // this should be the `machine-id`. See the table below for the sources to use to // determine the `machine-id` based on operating system. func HostID(val string) attribute.KeyValue { return HostIDKey.String(val) } // HostImageID returns an attribute KeyValue conforming to the "host.image.id" // semantic conventions. It represents the VM image ID or host OS image ID. For // Cloud, this value is from the provider. func HostImageID(val string) attribute.KeyValue { return HostImageIDKey.String(val) } // HostImageName returns an attribute KeyValue conforming to the // "host.image.name" semantic conventions. It represents the name of the VM image // or OS install the host was instantiated from. func HostImageName(val string) attribute.KeyValue { return HostImageNameKey.String(val) } // HostImageVersion returns an attribute KeyValue conforming to the // "host.image.version" semantic conventions. It represents the version string of // the VM image or host OS as defined in [Version Attributes]. // // [Version Attributes]: /docs/resource/README.md#version-attributes func HostImageVersion(val string) attribute.KeyValue { return HostImageVersionKey.String(val) } // HostIP returns an attribute KeyValue conforming to the "host.ip" semantic // conventions. It represents the available IP addresses of the host, excluding // loopback interfaces. func HostIP(val ...string) attribute.KeyValue { return HostIPKey.StringSlice(val) } // HostMac returns an attribute KeyValue conforming to the "host.mac" semantic // conventions. It represents the available MAC addresses of the host, excluding // loopback interfaces. func HostMac(val ...string) attribute.KeyValue { return HostMacKey.StringSlice(val) } // HostName returns an attribute KeyValue conforming to the "host.name" semantic // conventions. It represents the name of the host. On Unix systems, it may // contain what the hostname command returns, or the fully qualified hostname, or // another name specified by the user. func HostName(val string) attribute.KeyValue { return HostNameKey.String(val) } // HostType returns an attribute KeyValue conforming to the "host.type" semantic // conventions. It represents the type of host. For Cloud, this must be the // machine type. func HostType(val string) attribute.KeyValue { return HostTypeKey.String(val) } // Enum values for host.arch var ( // AMD64 // Stability: development HostArchAMD64 = HostArchKey.String("amd64") // ARM32 // Stability: development HostArchARM32 = HostArchKey.String("arm32") // ARM64 // Stability: development HostArchARM64 = HostArchKey.String("arm64") // Itanium // Stability: development HostArchIA64 = HostArchKey.String("ia64") // 32-bit PowerPC // Stability: development HostArchPPC32 = HostArchKey.String("ppc32") // 64-bit PowerPC // Stability: development HostArchPPC64 = HostArchKey.String("ppc64") // IBM z/Architecture // Stability: development HostArchS390x = HostArchKey.String("s390x") // 32-bit x86 // Stability: development HostArchX86 = HostArchKey.String("x86") ) // Namespace: http const ( // HTTPConnectionStateKey is the attribute Key conforming to the // "http.connection.state" semantic conventions. It represents the state of the // HTTP connection in the HTTP connection pool. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "active", "idle" HTTPConnectionStateKey = attribute.Key("http.connection.state") // HTTPRequestBodySizeKey is the attribute Key conforming to the // "http.request.body.size" semantic conventions. It represents the size of the // request payload body in bytes. This is the number of bytes transferred // excluding headers and is often, but not always, present as the // [Content-Length] header. For requests using transport encoding, this should // be the compressed size. // // Type: int // RequirementLevel: Recommended // Stability: Development // // [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length HTTPRequestBodySizeKey = attribute.Key("http.request.body.size") // HTTPRequestMethodKey is the attribute Key conforming to the // "http.request.method" semantic conventions. It represents the HTTP request // method. // // Type: Enum // RequirementLevel: Recommended // Stability: Stable // // Examples: "GET", "POST", "HEAD" // Note: HTTP request method value SHOULD be "known" to the instrumentation. // By default, this convention defines "known" methods as the ones listed in // [RFC9110], // the PATCH method defined in [RFC5789] // and the QUERY method defined in [httpbis-safe-method-w-body]. // // If the HTTP request method is not known to instrumentation, it MUST set the // `http.request.method` attribute to `_OTHER`. // // If the HTTP instrumentation could end up converting valid HTTP request // methods to `_OTHER`, then it MUST provide a way to override // the list of known HTTP methods. If this override is done via environment // variable, then the environment variable MUST be named // OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of // case-sensitive known HTTP methods // (this list MUST be a full override of the default known method, it is not a // list of known methods in addition to the defaults). // // HTTP method names are case-sensitive and `http.request.method` attribute // value MUST match a known HTTP method name exactly. // Instrumentations for specific web frameworks that consider HTTP methods to be // case insensitive, SHOULD populate a canonical equivalent. // Tracing instrumentations that do so, MUST also set // `http.request.method_original` to the original value. // // [RFC9110]: https://www.rfc-editor.org/rfc/rfc9110.html#name-methods // [RFC5789]: https://www.rfc-editor.org/rfc/rfc5789.html // [httpbis-safe-method-w-body]: https://datatracker.ietf.org/doc/draft-ietf-httpbis-safe-method-w-body/?include_text=1 HTTPRequestMethodKey = attribute.Key("http.request.method") // HTTPRequestMethodOriginalKey is the attribute Key conforming to the // "http.request.method_original" semantic conventions. It represents the // original HTTP method sent by the client in the request line. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "GeT", "ACL", "foo" HTTPRequestMethodOriginalKey = attribute.Key("http.request.method_original") // HTTPRequestResendCountKey is the attribute Key conforming to the // "http.request.resend_count" semantic conventions. It represents the ordinal // number of request resending attempt (for any reason, including redirects). // // Type: int // RequirementLevel: Recommended // Stability: Stable // // Note: The resend count SHOULD be updated each time an HTTP request gets // resent by the client, regardless of what was the cause of the resending (e.g. // redirection, authorization failure, 503 Server Unavailable, network issues, // or any other). HTTPRequestResendCountKey = attribute.Key("http.request.resend_count") // HTTPRequestSizeKey is the attribute Key conforming to the "http.request.size" // semantic conventions. It represents the total size of the request in bytes. // This should be the total number of bytes sent over the wire, including the // request line (HTTP/1.1), framing (HTTP/2 and HTTP/3), headers, and request // body if any. // // Type: int // RequirementLevel: Recommended // Stability: Development HTTPRequestSizeKey = attribute.Key("http.request.size") // HTTPResponseBodySizeKey is the attribute Key conforming to the // "http.response.body.size" semantic conventions. It represents the size of the // response payload body in bytes. This is the number of bytes transferred // excluding headers and is often, but not always, present as the // [Content-Length] header. For requests using transport encoding, this should // be the compressed size. // // Type: int // RequirementLevel: Recommended // Stability: Development // // [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length HTTPResponseBodySizeKey = attribute.Key("http.response.body.size") // HTTPResponseSizeKey is the attribute Key conforming to the // "http.response.size" semantic conventions. It represents the total size of // the response in bytes. This should be the total number of bytes sent over the // wire, including the status line (HTTP/1.1), framing (HTTP/2 and HTTP/3), // headers, and response body and trailers if any. // // Type: int // RequirementLevel: Recommended // Stability: Development HTTPResponseSizeKey = attribute.Key("http.response.size") // HTTPResponseStatusCodeKey is the attribute Key conforming to the // "http.response.status_code" semantic conventions. It represents the // [HTTP response status code]. // // Type: int // RequirementLevel: Recommended // Stability: Stable // // Examples: 200 // // [HTTP response status code]: https://tools.ietf.org/html/rfc7231#section-6 HTTPResponseStatusCodeKey = attribute.Key("http.response.status_code") // HTTPRouteKey is the attribute Key conforming to the "http.route" semantic // conventions. It represents the matched route template for the request. This // MUST be low-cardinality and include all static path segments, with dynamic // path segments represented with placeholders. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "/users/:userID?", "my-controller/my-action/{id?}" // Note: MUST NOT be populated when this is not supported by the HTTP server // framework as the route attribute should have low-cardinality and the URI path // can NOT substitute it. // SHOULD include the [application root] if there is one. // // A static path segment is a part of the route template with a fixed, // low-cardinality value. This includes literal strings like `/users/` and // placeholders that // are constrained to a finite, predefined set of values, e.g. `{controller}` or // `{action}`. // // A dynamic path segment is a placeholder for a value that can have high // cardinality and is not constrained to a predefined list like static path // segments. // // Instrumentations SHOULD use routing information provided by the corresponding // web framework. They SHOULD pick the most precise source of routing // information and MAY // support custom route formatting. Instrumentations SHOULD document the format // and the API used to obtain the route string. // // [application root]: /docs/http/http-spans.md#http-server-definitions HTTPRouteKey = attribute.Key("http.route") ) // HTTPRequestBodySize returns an attribute KeyValue conforming to the // "http.request.body.size" semantic conventions. It represents the size of the // request payload body in bytes. This is the number of bytes transferred // excluding headers and is often, but not always, present as the // [Content-Length] header. For requests using transport encoding, this should be // the compressed size. // // [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length func HTTPRequestBodySize(val int) attribute.KeyValue { return HTTPRequestBodySizeKey.Int(val) } // HTTPRequestHeader returns an attribute KeyValue conforming to the // "http.request.header" semantic conventions. It represents the HTTP request // headers, `` being the normalized HTTP Header name (lowercase), the value // being the header values. func HTTPRequestHeader(key string, val ...string) attribute.KeyValue { return attribute.StringSlice("http.request.header."+key, val) } // HTTPRequestMethodOriginal returns an attribute KeyValue conforming to the // "http.request.method_original" semantic conventions. It represents the // original HTTP method sent by the client in the request line. func HTTPRequestMethodOriginal(val string) attribute.KeyValue { return HTTPRequestMethodOriginalKey.String(val) } // HTTPRequestResendCount returns an attribute KeyValue conforming to the // "http.request.resend_count" semantic conventions. It represents the ordinal // number of request resending attempt (for any reason, including redirects). func HTTPRequestResendCount(val int) attribute.KeyValue { return HTTPRequestResendCountKey.Int(val) } // HTTPRequestSize returns an attribute KeyValue conforming to the // "http.request.size" semantic conventions. It represents the total size of the // request in bytes. This should be the total number of bytes sent over the wire, // including the request line (HTTP/1.1), framing (HTTP/2 and HTTP/3), headers, // and request body if any. func HTTPRequestSize(val int) attribute.KeyValue { return HTTPRequestSizeKey.Int(val) } // HTTPResponseBodySize returns an attribute KeyValue conforming to the // "http.response.body.size" semantic conventions. It represents the size of the // response payload body in bytes. This is the number of bytes transferred // excluding headers and is often, but not always, present as the // [Content-Length] header. For requests using transport encoding, this should be // the compressed size. // // [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length func HTTPResponseBodySize(val int) attribute.KeyValue { return HTTPResponseBodySizeKey.Int(val) } // HTTPResponseHeader returns an attribute KeyValue conforming to the // "http.response.header" semantic conventions. It represents the HTTP response // headers, `` being the normalized HTTP Header name (lowercase), the value // being the header values. func HTTPResponseHeader(key string, val ...string) attribute.KeyValue { return attribute.StringSlice("http.response.header."+key, val) } // HTTPResponseSize returns an attribute KeyValue conforming to the // "http.response.size" semantic conventions. It represents the total size of the // response in bytes. This should be the total number of bytes sent over the // wire, including the status line (HTTP/1.1), framing (HTTP/2 and HTTP/3), // headers, and response body and trailers if any. func HTTPResponseSize(val int) attribute.KeyValue { return HTTPResponseSizeKey.Int(val) } // HTTPResponseStatusCode returns an attribute KeyValue conforming to the // "http.response.status_code" semantic conventions. It represents the // [HTTP response status code]. // // [HTTP response status code]: https://tools.ietf.org/html/rfc7231#section-6 func HTTPResponseStatusCode(val int) attribute.KeyValue { return HTTPResponseStatusCodeKey.Int(val) } // HTTPRoute returns an attribute KeyValue conforming to the "http.route" // semantic conventions. It represents the matched route template for the // request. This MUST be low-cardinality and include all static path segments, // with dynamic path segments represented with placeholders. func HTTPRoute(val string) attribute.KeyValue { return HTTPRouteKey.String(val) } // Enum values for http.connection.state var ( // active state. // Stability: development HTTPConnectionStateActive = HTTPConnectionStateKey.String("active") // idle state. // Stability: development HTTPConnectionStateIdle = HTTPConnectionStateKey.String("idle") ) // Enum values for http.request.method var ( // CONNECT method. // Stability: stable HTTPRequestMethodConnect = HTTPRequestMethodKey.String("CONNECT") // DELETE method. // Stability: stable HTTPRequestMethodDelete = HTTPRequestMethodKey.String("DELETE") // GET method. // Stability: stable HTTPRequestMethodGet = HTTPRequestMethodKey.String("GET") // HEAD method. // Stability: stable HTTPRequestMethodHead = HTTPRequestMethodKey.String("HEAD") // OPTIONS method. // Stability: stable HTTPRequestMethodOptions = HTTPRequestMethodKey.String("OPTIONS") // PATCH method. // Stability: stable HTTPRequestMethodPatch = HTTPRequestMethodKey.String("PATCH") // POST method. // Stability: stable HTTPRequestMethodPost = HTTPRequestMethodKey.String("POST") // PUT method. // Stability: stable HTTPRequestMethodPut = HTTPRequestMethodKey.String("PUT") // TRACE method. // Stability: stable HTTPRequestMethodTrace = HTTPRequestMethodKey.String("TRACE") // QUERY method. // Stability: development HTTPRequestMethodQuery = HTTPRequestMethodKey.String("QUERY") // Any HTTP method that the instrumentation has no prior knowledge of. // Stability: stable HTTPRequestMethodOther = HTTPRequestMethodKey.String("_OTHER") ) // Namespace: hw const ( // HwBatteryCapacityKey is the attribute Key conforming to the // "hw.battery.capacity" semantic conventions. It represents the design capacity // in Watts-hours or Amper-hours. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "9.3Ah", "50Wh" HwBatteryCapacityKey = attribute.Key("hw.battery.capacity") // HwBatteryChemistryKey is the attribute Key conforming to the // "hw.battery.chemistry" semantic conventions. It represents the battery // [chemistry], e.g. Lithium-Ion, Nickel-Cadmium, etc. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Li-ion", "NiMH" // // [chemistry]: https://schemas.dmtf.org/wbem/cim-html/2.31.0/CIM_Battery.html HwBatteryChemistryKey = attribute.Key("hw.battery.chemistry") // HwBatteryStateKey is the attribute Key conforming to the "hw.battery.state" // semantic conventions. It represents the current state of the battery. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: HwBatteryStateKey = attribute.Key("hw.battery.state") // HwBiosVersionKey is the attribute Key conforming to the "hw.bios_version" // semantic conventions. It represents the BIOS version of the hardware // component. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "1.2.3" HwBiosVersionKey = attribute.Key("hw.bios_version") // HwDriverVersionKey is the attribute Key conforming to the "hw.driver_version" // semantic conventions. It represents the driver version for the hardware // component. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "10.2.1-3" HwDriverVersionKey = attribute.Key("hw.driver_version") // HwEnclosureTypeKey is the attribute Key conforming to the "hw.enclosure.type" // semantic conventions. It represents the type of the enclosure (useful for // modular systems). // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Computer", "Storage", "Switch" HwEnclosureTypeKey = attribute.Key("hw.enclosure.type") // HwFirmwareVersionKey is the attribute Key conforming to the // "hw.firmware_version" semantic conventions. It represents the firmware // version of the hardware component. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "2.0.1" HwFirmwareVersionKey = attribute.Key("hw.firmware_version") // HwGpuTaskKey is the attribute Key conforming to the "hw.gpu.task" semantic // conventions. It represents the type of task the GPU is performing. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: HwGpuTaskKey = attribute.Key("hw.gpu.task") // HwIDKey is the attribute Key conforming to the "hw.id" semantic conventions. // It represents an identifier for the hardware component, unique within the // monitored host. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "win32battery_battery_testsysa33_1" HwIDKey = attribute.Key("hw.id") // HwLimitTypeKey is the attribute Key conforming to the "hw.limit_type" // semantic conventions. It represents the type of limit for hardware // components. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: HwLimitTypeKey = attribute.Key("hw.limit_type") // HwLogicalDiskRaidLevelKey is the attribute Key conforming to the // "hw.logical_disk.raid_level" semantic conventions. It represents the RAID // Level of the logical disk. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "RAID0+1", "RAID5", "RAID10" HwLogicalDiskRaidLevelKey = attribute.Key("hw.logical_disk.raid_level") // HwLogicalDiskStateKey is the attribute Key conforming to the // "hw.logical_disk.state" semantic conventions. It represents the state of the // logical disk space usage. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: HwLogicalDiskStateKey = attribute.Key("hw.logical_disk.state") // HwMemoryTypeKey is the attribute Key conforming to the "hw.memory.type" // semantic conventions. It represents the type of the memory module. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "DDR4", "DDR5", "LPDDR5" HwMemoryTypeKey = attribute.Key("hw.memory.type") // HwModelKey is the attribute Key conforming to the "hw.model" semantic // conventions. It represents the descriptive model name of the hardware // component. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "PERC H740P", "Intel(R) Core(TM) i7-10700K", "Dell XPS 15 Battery" HwModelKey = attribute.Key("hw.model") // HwNameKey is the attribute Key conforming to the "hw.name" semantic // conventions. It represents an easily-recognizable name for the hardware // component. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "eth0" HwNameKey = attribute.Key("hw.name") // HwNetworkLogicalAddressesKey is the attribute Key conforming to the // "hw.network.logical_addresses" semantic conventions. It represents the // logical addresses of the adapter (e.g. IP address, or WWPN). // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "172.16.8.21", "57.11.193.42" HwNetworkLogicalAddressesKey = attribute.Key("hw.network.logical_addresses") // HwNetworkPhysicalAddressKey is the attribute Key conforming to the // "hw.network.physical_address" semantic conventions. It represents the // physical address of the adapter (e.g. MAC address, or WWNN). // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "00-90-F5-E9-7B-36" HwNetworkPhysicalAddressKey = attribute.Key("hw.network.physical_address") // HwParentKey is the attribute Key conforming to the "hw.parent" semantic // conventions. It represents the unique identifier of the parent component // (typically the `hw.id` attribute of the enclosure, or disk controller). // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "dellStorage_perc_0" HwParentKey = attribute.Key("hw.parent") // HwPhysicalDiskSmartAttributeKey is the attribute Key conforming to the // "hw.physical_disk.smart_attribute" semantic conventions. It represents the // [S.M.A.R.T.] (Self-Monitoring, Analysis, and Reporting Technology) attribute // of the physical disk. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Spin Retry Count", "Seek Error Rate", "Raw Read Error Rate" // // [S.M.A.R.T.]: https://wikipedia.org/wiki/S.M.A.R.T. HwPhysicalDiskSmartAttributeKey = attribute.Key("hw.physical_disk.smart_attribute") // HwPhysicalDiskStateKey is the attribute Key conforming to the // "hw.physical_disk.state" semantic conventions. It represents the state of the // physical disk endurance utilization. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: HwPhysicalDiskStateKey = attribute.Key("hw.physical_disk.state") // HwPhysicalDiskTypeKey is the attribute Key conforming to the // "hw.physical_disk.type" semantic conventions. It represents the type of the // physical disk. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "HDD", "SSD", "10K" HwPhysicalDiskTypeKey = attribute.Key("hw.physical_disk.type") // HwSensorLocationKey is the attribute Key conforming to the // "hw.sensor_location" semantic conventions. It represents the location of the // sensor. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "cpu0", "ps1", "INLET", "CPU0_DIE", "AMBIENT", "MOTHERBOARD", "PS0 // V3_3", "MAIN_12V", "CPU_VCORE" HwSensorLocationKey = attribute.Key("hw.sensor_location") // HwSerialNumberKey is the attribute Key conforming to the "hw.serial_number" // semantic conventions. It represents the serial number of the hardware // component. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "CNFCP0123456789" HwSerialNumberKey = attribute.Key("hw.serial_number") // HwStateKey is the attribute Key conforming to the "hw.state" semantic // conventions. It represents the current state of the component. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: HwStateKey = attribute.Key("hw.state") // HwTapeDriveOperationTypeKey is the attribute Key conforming to the // "hw.tape_drive.operation_type" semantic conventions. It represents the type // of tape drive operation. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: HwTapeDriveOperationTypeKey = attribute.Key("hw.tape_drive.operation_type") // HwTypeKey is the attribute Key conforming to the "hw.type" semantic // conventions. It represents the type of the component. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // Note: Describes the category of the hardware component for which `hw.state` // is being reported. For example, `hw.type=temperature` along with // `hw.state=degraded` would indicate that the temperature of the hardware // component has been reported as `degraded`. HwTypeKey = attribute.Key("hw.type") // HwVendorKey is the attribute Key conforming to the "hw.vendor" semantic // conventions. It represents the vendor name of the hardware component. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Dell", "HP", "Intel", "AMD", "LSI", "Lenovo" HwVendorKey = attribute.Key("hw.vendor") ) // HwBatteryCapacity returns an attribute KeyValue conforming to the // "hw.battery.capacity" semantic conventions. It represents the design capacity // in Watts-hours or Amper-hours. func HwBatteryCapacity(val string) attribute.KeyValue { return HwBatteryCapacityKey.String(val) } // HwBatteryChemistry returns an attribute KeyValue conforming to the // "hw.battery.chemistry" semantic conventions. It represents the battery // [chemistry], e.g. Lithium-Ion, Nickel-Cadmium, etc. // // [chemistry]: https://schemas.dmtf.org/wbem/cim-html/2.31.0/CIM_Battery.html func HwBatteryChemistry(val string) attribute.KeyValue { return HwBatteryChemistryKey.String(val) } // HwBiosVersion returns an attribute KeyValue conforming to the // "hw.bios_version" semantic conventions. It represents the BIOS version of the // hardware component. func HwBiosVersion(val string) attribute.KeyValue { return HwBiosVersionKey.String(val) } // HwDriverVersion returns an attribute KeyValue conforming to the // "hw.driver_version" semantic conventions. It represents the driver version for // the hardware component. func HwDriverVersion(val string) attribute.KeyValue { return HwDriverVersionKey.String(val) } // HwEnclosureType returns an attribute KeyValue conforming to the // "hw.enclosure.type" semantic conventions. It represents the type of the // enclosure (useful for modular systems). func HwEnclosureType(val string) attribute.KeyValue { return HwEnclosureTypeKey.String(val) } // HwFirmwareVersion returns an attribute KeyValue conforming to the // "hw.firmware_version" semantic conventions. It represents the firmware version // of the hardware component. func HwFirmwareVersion(val string) attribute.KeyValue { return HwFirmwareVersionKey.String(val) } // HwID returns an attribute KeyValue conforming to the "hw.id" semantic // conventions. It represents an identifier for the hardware component, unique // within the monitored host. func HwID(val string) attribute.KeyValue { return HwIDKey.String(val) } // HwLogicalDiskRaidLevel returns an attribute KeyValue conforming to the // "hw.logical_disk.raid_level" semantic conventions. It represents the RAID // Level of the logical disk. func HwLogicalDiskRaidLevel(val string) attribute.KeyValue { return HwLogicalDiskRaidLevelKey.String(val) } // HwMemoryType returns an attribute KeyValue conforming to the "hw.memory.type" // semantic conventions. It represents the type of the memory module. func HwMemoryType(val string) attribute.KeyValue { return HwMemoryTypeKey.String(val) } // HwModel returns an attribute KeyValue conforming to the "hw.model" semantic // conventions. It represents the descriptive model name of the hardware // component. func HwModel(val string) attribute.KeyValue { return HwModelKey.String(val) } // HwName returns an attribute KeyValue conforming to the "hw.name" semantic // conventions. It represents an easily-recognizable name for the hardware // component. func HwName(val string) attribute.KeyValue { return HwNameKey.String(val) } // HwNetworkLogicalAddresses returns an attribute KeyValue conforming to the // "hw.network.logical_addresses" semantic conventions. It represents the logical // addresses of the adapter (e.g. IP address, or WWPN). func HwNetworkLogicalAddresses(val ...string) attribute.KeyValue { return HwNetworkLogicalAddressesKey.StringSlice(val) } // HwNetworkPhysicalAddress returns an attribute KeyValue conforming to the // "hw.network.physical_address" semantic conventions. It represents the physical // address of the adapter (e.g. MAC address, or WWNN). func HwNetworkPhysicalAddress(val string) attribute.KeyValue { return HwNetworkPhysicalAddressKey.String(val) } // HwParent returns an attribute KeyValue conforming to the "hw.parent" semantic // conventions. It represents the unique identifier of the parent component // (typically the `hw.id` attribute of the enclosure, or disk controller). func HwParent(val string) attribute.KeyValue { return HwParentKey.String(val) } // HwPhysicalDiskSmartAttribute returns an attribute KeyValue conforming to the // "hw.physical_disk.smart_attribute" semantic conventions. It represents the // [S.M.A.R.T.] (Self-Monitoring, Analysis, and Reporting Technology) attribute // of the physical disk. // // [S.M.A.R.T.]: https://wikipedia.org/wiki/S.M.A.R.T. func HwPhysicalDiskSmartAttribute(val string) attribute.KeyValue { return HwPhysicalDiskSmartAttributeKey.String(val) } // HwPhysicalDiskType returns an attribute KeyValue conforming to the // "hw.physical_disk.type" semantic conventions. It represents the type of the // physical disk. func HwPhysicalDiskType(val string) attribute.KeyValue { return HwPhysicalDiskTypeKey.String(val) } // HwSensorLocation returns an attribute KeyValue conforming to the // "hw.sensor_location" semantic conventions. It represents the location of the // sensor. func HwSensorLocation(val string) attribute.KeyValue { return HwSensorLocationKey.String(val) } // HwSerialNumber returns an attribute KeyValue conforming to the // "hw.serial_number" semantic conventions. It represents the serial number of // the hardware component. func HwSerialNumber(val string) attribute.KeyValue { return HwSerialNumberKey.String(val) } // HwVendor returns an attribute KeyValue conforming to the "hw.vendor" semantic // conventions. It represents the vendor name of the hardware component. func HwVendor(val string) attribute.KeyValue { return HwVendorKey.String(val) } // Enum values for hw.battery.state var ( // Charging // Stability: development HwBatteryStateCharging = HwBatteryStateKey.String("charging") // Discharging // Stability: development HwBatteryStateDischarging = HwBatteryStateKey.String("discharging") ) // Enum values for hw.gpu.task var ( // Decoder // Stability: development HwGpuTaskDecoder = HwGpuTaskKey.String("decoder") // Encoder // Stability: development HwGpuTaskEncoder = HwGpuTaskKey.String("encoder") // General // Stability: development HwGpuTaskGeneral = HwGpuTaskKey.String("general") ) // Enum values for hw.limit_type var ( // Critical // Stability: development HwLimitTypeCritical = HwLimitTypeKey.String("critical") // Degraded // Stability: development HwLimitTypeDegraded = HwLimitTypeKey.String("degraded") // High Critical // Stability: development HwLimitTypeHighCritical = HwLimitTypeKey.String("high.critical") // High Degraded // Stability: development HwLimitTypeHighDegraded = HwLimitTypeKey.String("high.degraded") // Low Critical // Stability: development HwLimitTypeLowCritical = HwLimitTypeKey.String("low.critical") // Low Degraded // Stability: development HwLimitTypeLowDegraded = HwLimitTypeKey.String("low.degraded") // Maximum // Stability: development HwLimitTypeMax = HwLimitTypeKey.String("max") // Throttled // Stability: development HwLimitTypeThrottled = HwLimitTypeKey.String("throttled") // Turbo // Stability: development HwLimitTypeTurbo = HwLimitTypeKey.String("turbo") ) // Enum values for hw.logical_disk.state var ( // Used // Stability: development HwLogicalDiskStateUsed = HwLogicalDiskStateKey.String("used") // Free // Stability: development HwLogicalDiskStateFree = HwLogicalDiskStateKey.String("free") ) // Enum values for hw.physical_disk.state var ( // Remaining // Stability: development HwPhysicalDiskStateRemaining = HwPhysicalDiskStateKey.String("remaining") ) // Enum values for hw.state var ( // Degraded // Stability: development HwStateDegraded = HwStateKey.String("degraded") // Failed // Stability: development HwStateFailed = HwStateKey.String("failed") // Needs Cleaning // Stability: development HwStateNeedsCleaning = HwStateKey.String("needs_cleaning") // OK // Stability: development HwStateOk = HwStateKey.String("ok") // Predicted Failure // Stability: development HwStatePredictedFailure = HwStateKey.String("predicted_failure") ) // Enum values for hw.tape_drive.operation_type var ( // Mount // Stability: development HwTapeDriveOperationTypeMount = HwTapeDriveOperationTypeKey.String("mount") // Unmount // Stability: development HwTapeDriveOperationTypeUnmount = HwTapeDriveOperationTypeKey.String("unmount") // Clean // Stability: development HwTapeDriveOperationTypeClean = HwTapeDriveOperationTypeKey.String("clean") ) // Enum values for hw.type var ( // Battery // Stability: development HwTypeBattery = HwTypeKey.String("battery") // CPU // Stability: development HwTypeCPU = HwTypeKey.String("cpu") // Disk controller // Stability: development HwTypeDiskController = HwTypeKey.String("disk_controller") // Enclosure // Stability: development HwTypeEnclosure = HwTypeKey.String("enclosure") // Fan // Stability: development HwTypeFan = HwTypeKey.String("fan") // GPU // Stability: development HwTypeGpu = HwTypeKey.String("gpu") // Logical disk // Stability: development HwTypeLogicalDisk = HwTypeKey.String("logical_disk") // Memory // Stability: development HwTypeMemory = HwTypeKey.String("memory") // Network // Stability: development HwTypeNetwork = HwTypeKey.String("network") // Physical disk // Stability: development HwTypePhysicalDisk = HwTypeKey.String("physical_disk") // Power supply // Stability: development HwTypePowerSupply = HwTypeKey.String("power_supply") // Tape drive // Stability: development HwTypeTapeDrive = HwTypeKey.String("tape_drive") // Temperature // Stability: development HwTypeTemperature = HwTypeKey.String("temperature") // Voltage // Stability: development HwTypeVoltage = HwTypeKey.String("voltage") ) // Namespace: ios const ( // IOSAppStateKey is the attribute Key conforming to the "ios.app.state" // semantic conventions. It represents the this attribute represents the state // of the application. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // Note: The iOS lifecycle states are defined in the // [UIApplicationDelegate documentation], and from which the `OS terminology` // column values are derived. // // [UIApplicationDelegate documentation]: https://developer.apple.com/documentation/uikit/uiapplicationdelegate IOSAppStateKey = attribute.Key("ios.app.state") ) // Enum values for ios.app.state var ( // The app has become `active`. Associated with UIKit notification // `applicationDidBecomeActive`. // // Stability: development IOSAppStateActive = IOSAppStateKey.String("active") // The app is now `inactive`. Associated with UIKit notification // `applicationWillResignActive`. // // Stability: development IOSAppStateInactive = IOSAppStateKey.String("inactive") // The app is now in the background. This value is associated with UIKit // notification `applicationDidEnterBackground`. // // Stability: development IOSAppStateBackground = IOSAppStateKey.String("background") // The app is now in the foreground. This value is associated with UIKit // notification `applicationWillEnterForeground`. // // Stability: development IOSAppStateForeground = IOSAppStateKey.String("foreground") // The app is about to terminate. Associated with UIKit notification // `applicationWillTerminate`. // // Stability: development IOSAppStateTerminate = IOSAppStateKey.String("terminate") ) // Namespace: jsonrpc const ( // JSONRPCProtocolVersionKey is the attribute Key conforming to the // "jsonrpc.protocol.version" semantic conventions. It represents the protocol // version, as specified in the `jsonrpc` property of the request and its // corresponding response. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "2.0", "1.0" JSONRPCProtocolVersionKey = attribute.Key("jsonrpc.protocol.version") // JSONRPCRequestIDKey is the attribute Key conforming to the // "jsonrpc.request.id" semantic conventions. It represents a string // representation of the `id` property of the request and its corresponding // response. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "10", "request-7" // Note: Under the [JSON-RPC specification], the `id` property may be a string, // number, null, or omitted entirely. When omitted, the request is treated as a // notification. Using `null` is not equivalent to omitting the `id`, but it is // discouraged. // Instrumentations SHOULD NOT capture this attribute when the `id` is `null` or // omitted. // // [JSON-RPC specification]: https://www.jsonrpc.org/specification JSONRPCRequestIDKey = attribute.Key("jsonrpc.request.id") ) // JSONRPCProtocolVersion returns an attribute KeyValue conforming to the // "jsonrpc.protocol.version" semantic conventions. It represents the protocol // version, as specified in the `jsonrpc` property of the request and its // corresponding response. func JSONRPCProtocolVersion(val string) attribute.KeyValue { return JSONRPCProtocolVersionKey.String(val) } // JSONRPCRequestID returns an attribute KeyValue conforming to the // "jsonrpc.request.id" semantic conventions. It represents a string // representation of the `id` property of the request and its corresponding // response. func JSONRPCRequestID(val string) attribute.KeyValue { return JSONRPCRequestIDKey.String(val) } // Namespace: k8s const ( // K8SClusterNameKey is the attribute Key conforming to the "k8s.cluster.name" // semantic conventions. It represents the name of the cluster. // // Type: string // RequirementLevel: Recommended // Stability: Alpha // // Examples: "opentelemetry-cluster" K8SClusterNameKey = attribute.Key("k8s.cluster.name") // K8SClusterUIDKey is the attribute Key conforming to the "k8s.cluster.uid" // semantic conventions. It represents a pseudo-ID for the cluster, set to the // UID of the `kube-system` namespace. // // Type: string // RequirementLevel: Recommended // Stability: Alpha // // Examples: "218fc5a9-a5f1-4b54-aa05-46717d0ab26d" // Note: K8s doesn't have support for obtaining a cluster ID. If this is ever // added, we will recommend collecting the `k8s.cluster.uid` through the // official APIs. In the meantime, we are able to use the `uid` of the // `kube-system` namespace as a proxy for cluster ID. Read on for the // rationale. // // Every object created in a K8s cluster is assigned a distinct UID. The // `kube-system` namespace is used by Kubernetes itself and will exist // for the lifetime of the cluster. Using the `uid` of the `kube-system` // namespace is a reasonable proxy for the K8s ClusterID as it will only // change if the cluster is rebuilt. Furthermore, Kubernetes UIDs are // UUIDs as standardized by // [ISO/IEC 9834-8 and ITU-T X.667]. // Which states: // // > If generated according to one of the mechanisms defined in Rec. // > ITU-T X.667 | ISO/IEC 9834-8, a UUID is either guaranteed to be // > different from all other UUIDs generated before 3603 A.D., or is // > extremely likely to be different (depending on the mechanism chosen). // // Therefore, UIDs between clusters should be extremely unlikely to // conflict. // // [ISO/IEC 9834-8 and ITU-T X.667]: https://www.itu.int/ITU-T/studygroups/com17/oid.html K8SClusterUIDKey = attribute.Key("k8s.cluster.uid") // K8SContainerNameKey is the attribute Key conforming to the // "k8s.container.name" semantic conventions. It represents the name of the // Container from Pod specification, must be unique within a Pod. Container // runtime usually uses different globally unique name (`container.name`). // // Type: string // RequirementLevel: Recommended // Stability: Alpha // // Examples: "redis" K8SContainerNameKey = attribute.Key("k8s.container.name") // K8SContainerRestartCountKey is the attribute Key conforming to the // "k8s.container.restart_count" semantic conventions. It represents the number // of times the container was restarted. This attribute can be used to identify // a particular container (running or stopped) within a container spec. // // Type: int // RequirementLevel: Recommended // Stability: Alpha // // Examples: K8SContainerRestartCountKey = attribute.Key("k8s.container.restart_count") // K8SContainerStatusLastTerminatedReasonKey is the attribute Key conforming to // the "k8s.container.status.last_terminated_reason" semantic conventions. It // represents the last terminated reason of the Container. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Evicted", "Error" K8SContainerStatusLastTerminatedReasonKey = attribute.Key("k8s.container.status.last_terminated_reason") // K8SContainerStatusReasonKey is the attribute Key conforming to the // "k8s.container.status.reason" semantic conventions. It represents the reason // for the container state. Corresponds to the `reason` field of the: // [K8s ContainerStateWaiting] or [K8s ContainerStateTerminated]. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "ContainerCreating", "CrashLoopBackOff", // "CreateContainerConfigError", "ErrImagePull", "ImagePullBackOff", // "OOMKilled", "Completed", "Error", "ContainerCannotRun" // // [K8s ContainerStateWaiting]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#containerstatewaiting-v1-core // [K8s ContainerStateTerminated]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#containerstateterminated-v1-core K8SContainerStatusReasonKey = attribute.Key("k8s.container.status.reason") // K8SContainerStatusStateKey is the attribute Key conforming to the // "k8s.container.status.state" semantic conventions. It represents the state of // the container. [K8s ContainerState]. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "terminated", "running", "waiting" // // [K8s ContainerState]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#containerstate-v1-core K8SContainerStatusStateKey = attribute.Key("k8s.container.status.state") // K8SCronJobNameKey is the attribute Key conforming to the "k8s.cronjob.name" // semantic conventions. It represents the name of the CronJob. // // Type: string // RequirementLevel: Recommended // Stability: Alpha // // Examples: "opentelemetry" K8SCronJobNameKey = attribute.Key("k8s.cronjob.name") // K8SCronJobUIDKey is the attribute Key conforming to the "k8s.cronjob.uid" // semantic conventions. It represents the UID of the CronJob. // // Type: string // RequirementLevel: Recommended // Stability: Alpha // // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff" K8SCronJobUIDKey = attribute.Key("k8s.cronjob.uid") // K8SDaemonSetNameKey is the attribute Key conforming to the // "k8s.daemonset.name" semantic conventions. It represents the name of the // DaemonSet. // // Type: string // RequirementLevel: Recommended // Stability: Alpha // // Examples: "opentelemetry" K8SDaemonSetNameKey = attribute.Key("k8s.daemonset.name") // K8SDaemonSetUIDKey is the attribute Key conforming to the "k8s.daemonset.uid" // semantic conventions. It represents the UID of the DaemonSet. // // Type: string // RequirementLevel: Recommended // Stability: Alpha // // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff" K8SDaemonSetUIDKey = attribute.Key("k8s.daemonset.uid") // K8SDeploymentNameKey is the attribute Key conforming to the // "k8s.deployment.name" semantic conventions. It represents the name of the // Deployment. // // Type: string // RequirementLevel: Recommended // Stability: Alpha // // Examples: "opentelemetry" K8SDeploymentNameKey = attribute.Key("k8s.deployment.name") // K8SDeploymentUIDKey is the attribute Key conforming to the // "k8s.deployment.uid" semantic conventions. It represents the UID of the // Deployment. // // Type: string // RequirementLevel: Recommended // Stability: Alpha // // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff" K8SDeploymentUIDKey = attribute.Key("k8s.deployment.uid") // K8SHPAMetricTypeKey is the attribute Key conforming to the // "k8s.hpa.metric.type" semantic conventions. It represents the type of metric // source for the horizontal pod autoscaler. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Resource", "ContainerResource" // Note: This attribute reflects the `type` field of spec.metrics[] in the HPA. K8SHPAMetricTypeKey = attribute.Key("k8s.hpa.metric.type") // K8SHPANameKey is the attribute Key conforming to the "k8s.hpa.name" semantic // conventions. It represents the name of the horizontal pod autoscaler. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "opentelemetry" K8SHPANameKey = attribute.Key("k8s.hpa.name") // K8SHPAScaletargetrefAPIVersionKey is the attribute Key conforming to the // "k8s.hpa.scaletargetref.api_version" semantic conventions. It represents the // API version of the target resource to scale for the HorizontalPodAutoscaler. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "apps/v1", "autoscaling/v2" // Note: This maps to the `apiVersion` field in the `scaleTargetRef` of the HPA // spec. K8SHPAScaletargetrefAPIVersionKey = attribute.Key("k8s.hpa.scaletargetref.api_version") // K8SHPAScaletargetrefKindKey is the attribute Key conforming to the // "k8s.hpa.scaletargetref.kind" semantic conventions. It represents the kind of // the target resource to scale for the HorizontalPodAutoscaler. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Deployment", "StatefulSet" // Note: This maps to the `kind` field in the `scaleTargetRef` of the HPA spec. K8SHPAScaletargetrefKindKey = attribute.Key("k8s.hpa.scaletargetref.kind") // K8SHPAScaletargetrefNameKey is the attribute Key conforming to the // "k8s.hpa.scaletargetref.name" semantic conventions. It represents the name of // the target resource to scale for the HorizontalPodAutoscaler. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "my-deployment", "my-statefulset" // Note: This maps to the `name` field in the `scaleTargetRef` of the HPA spec. K8SHPAScaletargetrefNameKey = attribute.Key("k8s.hpa.scaletargetref.name") // K8SHPAUIDKey is the attribute Key conforming to the "k8s.hpa.uid" semantic // conventions. It represents the UID of the horizontal pod autoscaler. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff" K8SHPAUIDKey = attribute.Key("k8s.hpa.uid") // K8SHugepageSizeKey is the attribute Key conforming to the "k8s.hugepage.size" // semantic conventions. It represents the size (identifier) of the K8s huge // page. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "2Mi" K8SHugepageSizeKey = attribute.Key("k8s.hugepage.size") // K8SJobNameKey is the attribute Key conforming to the "k8s.job.name" semantic // conventions. It represents the name of the Job. // // Type: string // RequirementLevel: Recommended // Stability: Alpha // // Examples: "opentelemetry" K8SJobNameKey = attribute.Key("k8s.job.name") // K8SJobUIDKey is the attribute Key conforming to the "k8s.job.uid" semantic // conventions. It represents the UID of the Job. // // Type: string // RequirementLevel: Recommended // Stability: Alpha // // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff" K8SJobUIDKey = attribute.Key("k8s.job.uid") // K8SNamespaceNameKey is the attribute Key conforming to the // "k8s.namespace.name" semantic conventions. It represents the name of the // namespace that the pod is running in. // // Type: string // RequirementLevel: Recommended // Stability: Alpha // // Examples: "default" K8SNamespaceNameKey = attribute.Key("k8s.namespace.name") // K8SNamespacePhaseKey is the attribute Key conforming to the // "k8s.namespace.phase" semantic conventions. It represents the phase of the // K8s namespace. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "active", "terminating" // Note: This attribute aligns with the `phase` field of the // [K8s NamespaceStatus] // // [K8s NamespaceStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#namespacestatus-v1-core K8SNamespacePhaseKey = attribute.Key("k8s.namespace.phase") // K8SNodeConditionStatusKey is the attribute Key conforming to the // "k8s.node.condition.status" semantic conventions. It represents the status of // the condition, one of True, False, Unknown. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "true", "false", "unknown" // Note: This attribute aligns with the `status` field of the // [NodeCondition] // // [NodeCondition]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#nodecondition-v1-core K8SNodeConditionStatusKey = attribute.Key("k8s.node.condition.status") // K8SNodeConditionTypeKey is the attribute Key conforming to the // "k8s.node.condition.type" semantic conventions. It represents the condition // type of a K8s Node. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "Ready", "DiskPressure" // Note: K8s Node conditions as described // by [K8s documentation]. // // This attribute aligns with the `type` field of the // [NodeCondition] // // The set of possible values is not limited to those listed here. Managed // Kubernetes environments, // or custom controllers MAY introduce additional node condition types. // When this occurs, the exact value as reported by the Kubernetes API SHOULD be // used. // // [K8s documentation]: https://v1-32.docs.kubernetes.io/docs/reference/node/node-status/#condition // [NodeCondition]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#nodecondition-v1-core K8SNodeConditionTypeKey = attribute.Key("k8s.node.condition.type") // K8SNodeNameKey is the attribute Key conforming to the "k8s.node.name" // semantic conventions. It represents the name of the Node. // // Type: string // RequirementLevel: Recommended // Stability: Alpha // // Examples: "node-1" K8SNodeNameKey = attribute.Key("k8s.node.name") // K8SNodeUIDKey is the attribute Key conforming to the "k8s.node.uid" semantic // conventions. It represents the UID of the Node. // // Type: string // RequirementLevel: Recommended // Stability: Alpha // // Examples: "1eb3a0c6-0477-4080-a9cb-0cb7db65c6a2" K8SNodeUIDKey = attribute.Key("k8s.node.uid") // K8SPodHostnameKey is the attribute Key conforming to the "k8s.pod.hostname" // semantic conventions. It represents the specifies the hostname of the Pod. // // Type: string // RequirementLevel: Recommended // Stability: Alpha // // Examples: "collector-gateway" // Note: The K8s Pod spec has an optional hostname field, which can be used to // specify a hostname. // Refer to [K8s docs] // for more information about this field. // // This attribute aligns with the `hostname` field of the // [K8s PodSpec]. // // [K8s docs]: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-hostname-and-subdomain-field // [K8s PodSpec]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.34/#podspec-v1-core K8SPodHostnameKey = attribute.Key("k8s.pod.hostname") // K8SPodIPKey is the attribute Key conforming to the "k8s.pod.ip" semantic // conventions. It represents the IP address allocated to the Pod. // // Type: string // RequirementLevel: Recommended // Stability: Alpha // // Examples: "172.18.0.2" // Note: This attribute aligns with the `podIP` field of the // [K8s PodStatus]. // // [K8s PodStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.34/#podstatus-v1-core K8SPodIPKey = attribute.Key("k8s.pod.ip") // K8SPodNameKey is the attribute Key conforming to the "k8s.pod.name" semantic // conventions. It represents the name of the Pod. // // Type: string // RequirementLevel: Recommended // Stability: Alpha // // Examples: "opentelemetry-pod-autoconf" K8SPodNameKey = attribute.Key("k8s.pod.name") // K8SPodStartTimeKey is the attribute Key conforming to the // "k8s.pod.start_time" semantic conventions. It represents the start timestamp // of the Pod. // // Type: string // RequirementLevel: Recommended // Stability: Alpha // // Examples: "2025-12-04T08:41:03Z" // Note: Date and time at which the object was acknowledged by the Kubelet. // This is before the Kubelet pulled the container image(s) for the pod. // // This attribute aligns with the `startTime` field of the // [K8s PodStatus], // in ISO 8601 (RFC 3339 compatible) format. // // [K8s PodStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.34/#podstatus-v1-core K8SPodStartTimeKey = attribute.Key("k8s.pod.start_time") // K8SPodStatusPhaseKey is the attribute Key conforming to the // "k8s.pod.status.phase" semantic conventions. It represents the phase for the // pod. Corresponds to the `phase` field of the: [K8s PodStatus]. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "Pending", "Running" // // [K8s PodStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.33/#podstatus-v1-core K8SPodStatusPhaseKey = attribute.Key("k8s.pod.status.phase") // K8SPodStatusReasonKey is the attribute Key conforming to the // "k8s.pod.status.reason" semantic conventions. It represents the reason for // the pod state. Corresponds to the `reason` field of the: [K8s PodStatus]. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "Evicted", "NodeAffinity" // // [K8s PodStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.33/#podstatus-v1-core K8SPodStatusReasonKey = attribute.Key("k8s.pod.status.reason") // K8SPodUIDKey is the attribute Key conforming to the "k8s.pod.uid" semantic // conventions. It represents the UID of the Pod. // // Type: string // RequirementLevel: Recommended // Stability: Alpha // // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff" K8SPodUIDKey = attribute.Key("k8s.pod.uid") // K8SReplicaSetNameKey is the attribute Key conforming to the // "k8s.replicaset.name" semantic conventions. It represents the name of the // ReplicaSet. // // Type: string // RequirementLevel: Recommended // Stability: Alpha // // Examples: "opentelemetry" K8SReplicaSetNameKey = attribute.Key("k8s.replicaset.name") // K8SReplicaSetUIDKey is the attribute Key conforming to the // "k8s.replicaset.uid" semantic conventions. It represents the UID of the // ReplicaSet. // // Type: string // RequirementLevel: Recommended // Stability: Alpha // // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff" K8SReplicaSetUIDKey = attribute.Key("k8s.replicaset.uid") // K8SReplicationControllerNameKey is the attribute Key conforming to the // "k8s.replicationcontroller.name" semantic conventions. It represents the name // of the replication controller. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "opentelemetry" K8SReplicationControllerNameKey = attribute.Key("k8s.replicationcontroller.name") // K8SReplicationControllerUIDKey is the attribute Key conforming to the // "k8s.replicationcontroller.uid" semantic conventions. It represents the UID // of the replication controller. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff" K8SReplicationControllerUIDKey = attribute.Key("k8s.replicationcontroller.uid") // K8SResourceQuotaNameKey is the attribute Key conforming to the // "k8s.resourcequota.name" semantic conventions. It represents the name of the // resource quota. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "opentelemetry" K8SResourceQuotaNameKey = attribute.Key("k8s.resourcequota.name") // K8SResourceQuotaResourceNameKey is the attribute Key conforming to the // "k8s.resourcequota.resource_name" semantic conventions. It represents the // name of the K8s resource a resource quota defines. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "count/replicationcontrollers" // Note: The value for this attribute can be either the full // `count/[.]` string (e.g., count/deployments.apps, // count/pods), or, for certain core Kubernetes resources, just the resource // name (e.g., pods, services, configmaps). Both forms are supported by // Kubernetes for object count quotas. See // [Kubernetes Resource Quotas documentation] for more details. // // [Kubernetes Resource Quotas documentation]: https://kubernetes.io/docs/concepts/policy/resource-quotas/#quota-on-object-count K8SResourceQuotaResourceNameKey = attribute.Key("k8s.resourcequota.resource_name") // K8SResourceQuotaUIDKey is the attribute Key conforming to the // "k8s.resourcequota.uid" semantic conventions. It represents the UID of the // resource quota. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff" K8SResourceQuotaUIDKey = attribute.Key("k8s.resourcequota.uid") // K8SStatefulSetNameKey is the attribute Key conforming to the // "k8s.statefulset.name" semantic conventions. It represents the name of the // StatefulSet. // // Type: string // RequirementLevel: Recommended // Stability: Alpha // // Examples: "opentelemetry" K8SStatefulSetNameKey = attribute.Key("k8s.statefulset.name") // K8SStatefulSetUIDKey is the attribute Key conforming to the // "k8s.statefulset.uid" semantic conventions. It represents the UID of the // StatefulSet. // // Type: string // RequirementLevel: Recommended // Stability: Alpha // // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff" K8SStatefulSetUIDKey = attribute.Key("k8s.statefulset.uid") // K8SStorageclassNameKey is the attribute Key conforming to the // "k8s.storageclass.name" semantic conventions. It represents the name of K8s // [StorageClass] object. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "gold.storageclass.storage.k8s.io" // // [StorageClass]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#storageclass-v1-storage-k8s-io K8SStorageclassNameKey = attribute.Key("k8s.storageclass.name") // K8SVolumeNameKey is the attribute Key conforming to the "k8s.volume.name" // semantic conventions. It represents the name of the K8s volume. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "volume0" K8SVolumeNameKey = attribute.Key("k8s.volume.name") // K8SVolumeTypeKey is the attribute Key conforming to the "k8s.volume.type" // semantic conventions. It represents the type of the K8s volume. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "emptyDir", "persistentVolumeClaim" K8SVolumeTypeKey = attribute.Key("k8s.volume.type") ) // K8SClusterName returns an attribute KeyValue conforming to the // "k8s.cluster.name" semantic conventions. It represents the name of the // cluster. func K8SClusterName(val string) attribute.KeyValue { return K8SClusterNameKey.String(val) } // K8SClusterUID returns an attribute KeyValue conforming to the // "k8s.cluster.uid" semantic conventions. It represents a pseudo-ID for the // cluster, set to the UID of the `kube-system` namespace. func K8SClusterUID(val string) attribute.KeyValue { return K8SClusterUIDKey.String(val) } // K8SContainerName returns an attribute KeyValue conforming to the // "k8s.container.name" semantic conventions. It represents the name of the // Container from Pod specification, must be unique within a Pod. Container // runtime usually uses different globally unique name (`container.name`). func K8SContainerName(val string) attribute.KeyValue { return K8SContainerNameKey.String(val) } // K8SContainerRestartCount returns an attribute KeyValue conforming to the // "k8s.container.restart_count" semantic conventions. It represents the number // of times the container was restarted. This attribute can be used to identify a // particular container (running or stopped) within a container spec. func K8SContainerRestartCount(val int) attribute.KeyValue { return K8SContainerRestartCountKey.Int(val) } // K8SContainerStatusLastTerminatedReason returns an attribute KeyValue // conforming to the "k8s.container.status.last_terminated_reason" semantic // conventions. It represents the last terminated reason of the Container. func K8SContainerStatusLastTerminatedReason(val string) attribute.KeyValue { return K8SContainerStatusLastTerminatedReasonKey.String(val) } // K8SCronJobAnnotation returns an attribute KeyValue conforming to the // "k8s.cronjob.annotation" semantic conventions. It represents the cronjob // annotation placed on the CronJob, the `` being the annotation name, the // value being the annotation value. func K8SCronJobAnnotation(key string, val string) attribute.KeyValue { return attribute.String("k8s.cronjob.annotation."+key, val) } // K8SCronJobLabel returns an attribute KeyValue conforming to the // "k8s.cronjob.label" semantic conventions. It represents the label placed on // the CronJob, the `` being the label name, the value being the label // value. func K8SCronJobLabel(key string, val string) attribute.KeyValue { return attribute.String("k8s.cronjob.label."+key, val) } // K8SCronJobName returns an attribute KeyValue conforming to the // "k8s.cronjob.name" semantic conventions. It represents the name of the // CronJob. func K8SCronJobName(val string) attribute.KeyValue { return K8SCronJobNameKey.String(val) } // K8SCronJobUID returns an attribute KeyValue conforming to the // "k8s.cronjob.uid" semantic conventions. It represents the UID of the CronJob. func K8SCronJobUID(val string) attribute.KeyValue { return K8SCronJobUIDKey.String(val) } // K8SDaemonSetAnnotation returns an attribute KeyValue conforming to the // "k8s.daemonset.annotation" semantic conventions. It represents the annotation // placed on the DaemonSet, the `` being the annotation name, the value // being the annotation value, even if the value is empty. func K8SDaemonSetAnnotation(key string, val string) attribute.KeyValue { return attribute.String("k8s.daemonset.annotation."+key, val) } // K8SDaemonSetLabel returns an attribute KeyValue conforming to the // "k8s.daemonset.label" semantic conventions. It represents the label placed on // the DaemonSet, the `` being the label name, the value being the label // value, even if the value is empty. func K8SDaemonSetLabel(key string, val string) attribute.KeyValue { return attribute.String("k8s.daemonset.label."+key, val) } // K8SDaemonSetName returns an attribute KeyValue conforming to the // "k8s.daemonset.name" semantic conventions. It represents the name of the // DaemonSet. func K8SDaemonSetName(val string) attribute.KeyValue { return K8SDaemonSetNameKey.String(val) } // K8SDaemonSetUID returns an attribute KeyValue conforming to the // "k8s.daemonset.uid" semantic conventions. It represents the UID of the // DaemonSet. func K8SDaemonSetUID(val string) attribute.KeyValue { return K8SDaemonSetUIDKey.String(val) } // K8SDeploymentAnnotation returns an attribute KeyValue conforming to the // "k8s.deployment.annotation" semantic conventions. It represents the annotation // placed on the Deployment, the `` being the annotation name, the value // being the annotation value, even if the value is empty. func K8SDeploymentAnnotation(key string, val string) attribute.KeyValue { return attribute.String("k8s.deployment.annotation."+key, val) } // K8SDeploymentLabel returns an attribute KeyValue conforming to the // "k8s.deployment.label" semantic conventions. It represents the label placed on // the Deployment, the `` being the label name, the value being the label // value, even if the value is empty. func K8SDeploymentLabel(key string, val string) attribute.KeyValue { return attribute.String("k8s.deployment.label."+key, val) } // K8SDeploymentName returns an attribute KeyValue conforming to the // "k8s.deployment.name" semantic conventions. It represents the name of the // Deployment. func K8SDeploymentName(val string) attribute.KeyValue { return K8SDeploymentNameKey.String(val) } // K8SDeploymentUID returns an attribute KeyValue conforming to the // "k8s.deployment.uid" semantic conventions. It represents the UID of the // Deployment. func K8SDeploymentUID(val string) attribute.KeyValue { return K8SDeploymentUIDKey.String(val) } // K8SHPAMetricType returns an attribute KeyValue conforming to the // "k8s.hpa.metric.type" semantic conventions. It represents the type of metric // source for the horizontal pod autoscaler. func K8SHPAMetricType(val string) attribute.KeyValue { return K8SHPAMetricTypeKey.String(val) } // K8SHPAName returns an attribute KeyValue conforming to the "k8s.hpa.name" // semantic conventions. It represents the name of the horizontal pod autoscaler. func K8SHPAName(val string) attribute.KeyValue { return K8SHPANameKey.String(val) } // K8SHPAScaletargetrefAPIVersion returns an attribute KeyValue conforming to the // "k8s.hpa.scaletargetref.api_version" semantic conventions. It represents the // API version of the target resource to scale for the HorizontalPodAutoscaler. func K8SHPAScaletargetrefAPIVersion(val string) attribute.KeyValue { return K8SHPAScaletargetrefAPIVersionKey.String(val) } // K8SHPAScaletargetrefKind returns an attribute KeyValue conforming to the // "k8s.hpa.scaletargetref.kind" semantic conventions. It represents the kind of // the target resource to scale for the HorizontalPodAutoscaler. func K8SHPAScaletargetrefKind(val string) attribute.KeyValue { return K8SHPAScaletargetrefKindKey.String(val) } // K8SHPAScaletargetrefName returns an attribute KeyValue conforming to the // "k8s.hpa.scaletargetref.name" semantic conventions. It represents the name of // the target resource to scale for the HorizontalPodAutoscaler. func K8SHPAScaletargetrefName(val string) attribute.KeyValue { return K8SHPAScaletargetrefNameKey.String(val) } // K8SHPAUID returns an attribute KeyValue conforming to the "k8s.hpa.uid" // semantic conventions. It represents the UID of the horizontal pod autoscaler. func K8SHPAUID(val string) attribute.KeyValue { return K8SHPAUIDKey.String(val) } // K8SHugepageSize returns an attribute KeyValue conforming to the // "k8s.hugepage.size" semantic conventions. It represents the size (identifier) // of the K8s huge page. func K8SHugepageSize(val string) attribute.KeyValue { return K8SHugepageSizeKey.String(val) } // K8SJobAnnotation returns an attribute KeyValue conforming to the // "k8s.job.annotation" semantic conventions. It represents the annotation placed // on the Job, the `` being the annotation name, the value being the // annotation value, even if the value is empty. func K8SJobAnnotation(key string, val string) attribute.KeyValue { return attribute.String("k8s.job.annotation."+key, val) } // K8SJobLabel returns an attribute KeyValue conforming to the "k8s.job.label" // semantic conventions. It represents the label placed on the Job, the `` // being the label name, the value being the label value, even if the value is // empty. func K8SJobLabel(key string, val string) attribute.KeyValue { return attribute.String("k8s.job.label."+key, val) } // K8SJobName returns an attribute KeyValue conforming to the "k8s.job.name" // semantic conventions. It represents the name of the Job. func K8SJobName(val string) attribute.KeyValue { return K8SJobNameKey.String(val) } // K8SJobUID returns an attribute KeyValue conforming to the "k8s.job.uid" // semantic conventions. It represents the UID of the Job. func K8SJobUID(val string) attribute.KeyValue { return K8SJobUIDKey.String(val) } // K8SNamespaceAnnotation returns an attribute KeyValue conforming to the // "k8s.namespace.annotation" semantic conventions. It represents the annotation // placed on the Namespace, the `` being the annotation name, the value // being the annotation value, even if the value is empty. func K8SNamespaceAnnotation(key string, val string) attribute.KeyValue { return attribute.String("k8s.namespace.annotation."+key, val) } // K8SNamespaceLabel returns an attribute KeyValue conforming to the // "k8s.namespace.label" semantic conventions. It represents the label placed on // the Namespace, the `` being the label name, the value being the label // value, even if the value is empty. func K8SNamespaceLabel(key string, val string) attribute.KeyValue { return attribute.String("k8s.namespace.label."+key, val) } // K8SNamespaceName returns an attribute KeyValue conforming to the // "k8s.namespace.name" semantic conventions. It represents the name of the // namespace that the pod is running in. func K8SNamespaceName(val string) attribute.KeyValue { return K8SNamespaceNameKey.String(val) } // K8SNodeAnnotation returns an attribute KeyValue conforming to the // "k8s.node.annotation" semantic conventions. It represents the annotation // placed on the Node, the `` being the annotation name, the value being the // annotation value, even if the value is empty. func K8SNodeAnnotation(key string, val string) attribute.KeyValue { return attribute.String("k8s.node.annotation."+key, val) } // K8SNodeLabel returns an attribute KeyValue conforming to the "k8s.node.label" // semantic conventions. It represents the label placed on the Node, the `` // being the label name, the value being the label value, even if the value is // empty. func K8SNodeLabel(key string, val string) attribute.KeyValue { return attribute.String("k8s.node.label."+key, val) } // K8SNodeName returns an attribute KeyValue conforming to the "k8s.node.name" // semantic conventions. It represents the name of the Node. func K8SNodeName(val string) attribute.KeyValue { return K8SNodeNameKey.String(val) } // K8SNodeUID returns an attribute KeyValue conforming to the "k8s.node.uid" // semantic conventions. It represents the UID of the Node. func K8SNodeUID(val string) attribute.KeyValue { return K8SNodeUIDKey.String(val) } // K8SPodAnnotation returns an attribute KeyValue conforming to the // "k8s.pod.annotation" semantic conventions. It represents the annotation placed // on the Pod, the `` being the annotation name, the value being the // annotation value. func K8SPodAnnotation(key string, val string) attribute.KeyValue { return attribute.String("k8s.pod.annotation."+key, val) } // K8SPodHostname returns an attribute KeyValue conforming to the // "k8s.pod.hostname" semantic conventions. It represents the specifies the // hostname of the Pod. func K8SPodHostname(val string) attribute.KeyValue { return K8SPodHostnameKey.String(val) } // K8SPodIP returns an attribute KeyValue conforming to the "k8s.pod.ip" semantic // conventions. It represents the IP address allocated to the Pod. func K8SPodIP(val string) attribute.KeyValue { return K8SPodIPKey.String(val) } // K8SPodLabel returns an attribute KeyValue conforming to the "k8s.pod.label" // semantic conventions. It represents the label placed on the Pod, the `` // being the label name, the value being the label value. func K8SPodLabel(key string, val string) attribute.KeyValue { return attribute.String("k8s.pod.label."+key, val) } // K8SPodName returns an attribute KeyValue conforming to the "k8s.pod.name" // semantic conventions. It represents the name of the Pod. func K8SPodName(val string) attribute.KeyValue { return K8SPodNameKey.String(val) } // K8SPodStartTime returns an attribute KeyValue conforming to the // "k8s.pod.start_time" semantic conventions. It represents the start timestamp // of the Pod. func K8SPodStartTime(val string) attribute.KeyValue { return K8SPodStartTimeKey.String(val) } // K8SPodUID returns an attribute KeyValue conforming to the "k8s.pod.uid" // semantic conventions. It represents the UID of the Pod. func K8SPodUID(val string) attribute.KeyValue { return K8SPodUIDKey.String(val) } // K8SReplicaSetAnnotation returns an attribute KeyValue conforming to the // "k8s.replicaset.annotation" semantic conventions. It represents the annotation // placed on the ReplicaSet, the `` being the annotation name, the value // being the annotation value, even if the value is empty. func K8SReplicaSetAnnotation(key string, val string) attribute.KeyValue { return attribute.String("k8s.replicaset.annotation."+key, val) } // K8SReplicaSetLabel returns an attribute KeyValue conforming to the // "k8s.replicaset.label" semantic conventions. It represents the label placed on // the ReplicaSet, the `` being the label name, the value being the label // value, even if the value is empty. func K8SReplicaSetLabel(key string, val string) attribute.KeyValue { return attribute.String("k8s.replicaset.label."+key, val) } // K8SReplicaSetName returns an attribute KeyValue conforming to the // "k8s.replicaset.name" semantic conventions. It represents the name of the // ReplicaSet. func K8SReplicaSetName(val string) attribute.KeyValue { return K8SReplicaSetNameKey.String(val) } // K8SReplicaSetUID returns an attribute KeyValue conforming to the // "k8s.replicaset.uid" semantic conventions. It represents the UID of the // ReplicaSet. func K8SReplicaSetUID(val string) attribute.KeyValue { return K8SReplicaSetUIDKey.String(val) } // K8SReplicationControllerName returns an attribute KeyValue conforming to the // "k8s.replicationcontroller.name" semantic conventions. It represents the name // of the replication controller. func K8SReplicationControllerName(val string) attribute.KeyValue { return K8SReplicationControllerNameKey.String(val) } // K8SReplicationControllerUID returns an attribute KeyValue conforming to the // "k8s.replicationcontroller.uid" semantic conventions. It represents the UID of // the replication controller. func K8SReplicationControllerUID(val string) attribute.KeyValue { return K8SReplicationControllerUIDKey.String(val) } // K8SResourceQuotaName returns an attribute KeyValue conforming to the // "k8s.resourcequota.name" semantic conventions. It represents the name of the // resource quota. func K8SResourceQuotaName(val string) attribute.KeyValue { return K8SResourceQuotaNameKey.String(val) } // K8SResourceQuotaResourceName returns an attribute KeyValue conforming to the // "k8s.resourcequota.resource_name" semantic conventions. It represents the name // of the K8s resource a resource quota defines. func K8SResourceQuotaResourceName(val string) attribute.KeyValue { return K8SResourceQuotaResourceNameKey.String(val) } // K8SResourceQuotaUID returns an attribute KeyValue conforming to the // "k8s.resourcequota.uid" semantic conventions. It represents the UID of the // resource quota. func K8SResourceQuotaUID(val string) attribute.KeyValue { return K8SResourceQuotaUIDKey.String(val) } // K8SStatefulSetAnnotation returns an attribute KeyValue conforming to the // "k8s.statefulset.annotation" semantic conventions. It represents the // annotation placed on the StatefulSet, the `` being the annotation name, // the value being the annotation value, even if the value is empty. func K8SStatefulSetAnnotation(key string, val string) attribute.KeyValue { return attribute.String("k8s.statefulset.annotation."+key, val) } // K8SStatefulSetLabel returns an attribute KeyValue conforming to the // "k8s.statefulset.label" semantic conventions. It represents the label placed // on the StatefulSet, the `` being the label name, the value being the // label value, even if the value is empty. func K8SStatefulSetLabel(key string, val string) attribute.KeyValue { return attribute.String("k8s.statefulset.label."+key, val) } // K8SStatefulSetName returns an attribute KeyValue conforming to the // "k8s.statefulset.name" semantic conventions. It represents the name of the // StatefulSet. func K8SStatefulSetName(val string) attribute.KeyValue { return K8SStatefulSetNameKey.String(val) } // K8SStatefulSetUID returns an attribute KeyValue conforming to the // "k8s.statefulset.uid" semantic conventions. It represents the UID of the // StatefulSet. func K8SStatefulSetUID(val string) attribute.KeyValue { return K8SStatefulSetUIDKey.String(val) } // K8SStorageclassName returns an attribute KeyValue conforming to the // "k8s.storageclass.name" semantic conventions. It represents the name of K8s // [StorageClass] object. // // [StorageClass]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#storageclass-v1-storage-k8s-io func K8SStorageclassName(val string) attribute.KeyValue { return K8SStorageclassNameKey.String(val) } // K8SVolumeName returns an attribute KeyValue conforming to the // "k8s.volume.name" semantic conventions. It represents the name of the K8s // volume. func K8SVolumeName(val string) attribute.KeyValue { return K8SVolumeNameKey.String(val) } // Enum values for k8s.container.status.reason var ( // The container is being created. // Stability: development K8SContainerStatusReasonContainerCreating = K8SContainerStatusReasonKey.String("ContainerCreating") // The container is in a crash loop back off state. // Stability: development K8SContainerStatusReasonCrashLoopBackOff = K8SContainerStatusReasonKey.String("CrashLoopBackOff") // There was an error creating the container configuration. // Stability: development K8SContainerStatusReasonCreateContainerConfigError = K8SContainerStatusReasonKey.String("CreateContainerConfigError") // There was an error pulling the container image. // Stability: development K8SContainerStatusReasonErrImagePull = K8SContainerStatusReasonKey.String("ErrImagePull") // The container image pull is in back off state. // Stability: development K8SContainerStatusReasonImagePullBackOff = K8SContainerStatusReasonKey.String("ImagePullBackOff") // The container was killed due to out of memory. // Stability: development K8SContainerStatusReasonOomKilled = K8SContainerStatusReasonKey.String("OOMKilled") // The container has completed execution. // Stability: development K8SContainerStatusReasonCompleted = K8SContainerStatusReasonKey.String("Completed") // There was an error with the container. // Stability: development K8SContainerStatusReasonError = K8SContainerStatusReasonKey.String("Error") // The container cannot run. // Stability: development K8SContainerStatusReasonContainerCannotRun = K8SContainerStatusReasonKey.String("ContainerCannotRun") ) // Enum values for k8s.container.status.state var ( // The container has terminated. // Stability: development K8SContainerStatusStateTerminated = K8SContainerStatusStateKey.String("terminated") // The container is running. // Stability: development K8SContainerStatusStateRunning = K8SContainerStatusStateKey.String("running") // The container is waiting. // Stability: development K8SContainerStatusStateWaiting = K8SContainerStatusStateKey.String("waiting") ) // Enum values for k8s.namespace.phase var ( // Active namespace phase as described by [K8s API] // Stability: development // // [K8s API]: https://pkg.go.dev/k8s.io/api@v0.31.3/core/v1#NamespacePhase K8SNamespacePhaseActive = K8SNamespacePhaseKey.String("active") // Terminating namespace phase as described by [K8s API] // Stability: development // // [K8s API]: https://pkg.go.dev/k8s.io/api@v0.31.3/core/v1#NamespacePhase K8SNamespacePhaseTerminating = K8SNamespacePhaseKey.String("terminating") ) // Enum values for k8s.node.condition.status var ( // condition_true // Stability: development K8SNodeConditionStatusConditionTrue = K8SNodeConditionStatusKey.String("true") // condition_false // Stability: development K8SNodeConditionStatusConditionFalse = K8SNodeConditionStatusKey.String("false") // condition_unknown // Stability: development K8SNodeConditionStatusConditionUnknown = K8SNodeConditionStatusKey.String("unknown") ) // Enum values for k8s.node.condition.type var ( // The node is healthy and ready to accept pods // Stability: development K8SNodeConditionTypeReady = K8SNodeConditionTypeKey.String("Ready") // Pressure exists on the disk size—that is, if the disk capacity is low // Stability: development K8SNodeConditionTypeDiskPressure = K8SNodeConditionTypeKey.String("DiskPressure") // Pressure exists on the node memory—that is, if the node memory is low // Stability: development K8SNodeConditionTypeMemoryPressure = K8SNodeConditionTypeKey.String("MemoryPressure") // Pressure exists on the processes—that is, if there are too many processes // on the node // Stability: development K8SNodeConditionTypePIDPressure = K8SNodeConditionTypeKey.String("PIDPressure") // The network for the node is not correctly configured // Stability: development K8SNodeConditionTypeNetworkUnavailable = K8SNodeConditionTypeKey.String("NetworkUnavailable") ) // Enum values for k8s.pod.status.phase var ( // The pod has been accepted by the system, but one or more of the containers // has not been started. This includes time before being bound to a node, as // well as time spent pulling images onto the host. // // Stability: development K8SPodStatusPhasePending = K8SPodStatusPhaseKey.String("Pending") // The pod has been bound to a node and all of the containers have been started. // At least one container is still running or is in the process of being // restarted. // // Stability: development K8SPodStatusPhaseRunning = K8SPodStatusPhaseKey.String("Running") // All containers in the pod have voluntarily terminated with a container exit // code of 0, and the system is not going to restart any of these containers. // // Stability: development K8SPodStatusPhaseSucceeded = K8SPodStatusPhaseKey.String("Succeeded") // All containers in the pod have terminated, and at least one container has // terminated in a failure (exited with a non-zero exit code or was stopped by // the system). // // Stability: development K8SPodStatusPhaseFailed = K8SPodStatusPhaseKey.String("Failed") // For some reason the state of the pod could not be obtained, typically due to // an error in communicating with the host of the pod. // // Stability: development K8SPodStatusPhaseUnknown = K8SPodStatusPhaseKey.String("Unknown") ) // Enum values for k8s.pod.status.reason var ( // The pod is evicted. // Stability: development K8SPodStatusReasonEvicted = K8SPodStatusReasonKey.String("Evicted") // The pod is in a status because of its node affinity // Stability: development K8SPodStatusReasonNodeAffinity = K8SPodStatusReasonKey.String("NodeAffinity") // The reason on a pod when its state cannot be confirmed as kubelet is // unresponsive on the node it is (was) running. // // Stability: development K8SPodStatusReasonNodeLost = K8SPodStatusReasonKey.String("NodeLost") // The node is shutdown // Stability: development K8SPodStatusReasonShutdown = K8SPodStatusReasonKey.String("Shutdown") // The pod was rejected admission to the node because of an error during // admission that could not be categorized. // // Stability: development K8SPodStatusReasonUnexpectedAdmissionError = K8SPodStatusReasonKey.String("UnexpectedAdmissionError") ) // Enum values for k8s.volume.type var ( // A [persistentVolumeClaim] volume // Stability: development // // [persistentVolumeClaim]: https://v1-30.docs.kubernetes.io/docs/concepts/storage/volumes/#persistentvolumeclaim K8SVolumeTypePersistentVolumeClaim = K8SVolumeTypeKey.String("persistentVolumeClaim") // A [configMap] volume // Stability: development // // [configMap]: https://v1-30.docs.kubernetes.io/docs/concepts/storage/volumes/#configmap K8SVolumeTypeConfigMap = K8SVolumeTypeKey.String("configMap") // A [downwardAPI] volume // Stability: development // // [downwardAPI]: https://v1-30.docs.kubernetes.io/docs/concepts/storage/volumes/#downwardapi K8SVolumeTypeDownwardAPI = K8SVolumeTypeKey.String("downwardAPI") // An [emptyDir] volume // Stability: development // // [emptyDir]: https://v1-30.docs.kubernetes.io/docs/concepts/storage/volumes/#emptydir K8SVolumeTypeEmptyDir = K8SVolumeTypeKey.String("emptyDir") // A [secret] volume // Stability: development // // [secret]: https://v1-30.docs.kubernetes.io/docs/concepts/storage/volumes/#secret K8SVolumeTypeSecret = K8SVolumeTypeKey.String("secret") // A [local] volume // Stability: development // // [local]: https://v1-30.docs.kubernetes.io/docs/concepts/storage/volumes/#local K8SVolumeTypeLocal = K8SVolumeTypeKey.String("local") ) // Namespace: log const ( // LogFileNameKey is the attribute Key conforming to the "log.file.name" // semantic conventions. It represents the basename of the file. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "audit.log" LogFileNameKey = attribute.Key("log.file.name") // LogFileNameResolvedKey is the attribute Key conforming to the // "log.file.name_resolved" semantic conventions. It represents the basename of // the file, with symlinks resolved. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "uuid.log" LogFileNameResolvedKey = attribute.Key("log.file.name_resolved") // LogFilePathKey is the attribute Key conforming to the "log.file.path" // semantic conventions. It represents the full path to the file. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "/var/log/mysql/audit.log" LogFilePathKey = attribute.Key("log.file.path") // LogFilePathResolvedKey is the attribute Key conforming to the // "log.file.path_resolved" semantic conventions. It represents the full path to // the file, with symlinks resolved. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "/var/lib/docker/uuid.log" LogFilePathResolvedKey = attribute.Key("log.file.path_resolved") // LogIostreamKey is the attribute Key conforming to the "log.iostream" semantic // conventions. It represents the stream associated with the log. See below for // a list of well-known values. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: LogIostreamKey = attribute.Key("log.iostream") // LogRecordOriginalKey is the attribute Key conforming to the // "log.record.original" semantic conventions. It represents the complete // original Log Record. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "77 <86>1 2015-08-06T21:58:59.694Z 192.168.2.133 inactive - - - // Something happened", "[INFO] 8/3/24 12:34:56 Something happened" // Note: This value MAY be added when processing a Log Record which was // originally transmitted as a string or equivalent data type AND the Body field // of the Log Record does not contain the same value. (e.g. a syslog or a log // record read from a file.) LogRecordOriginalKey = attribute.Key("log.record.original") // LogRecordUIDKey is the attribute Key conforming to the "log.record.uid" // semantic conventions. It represents a unique identifier for the Log Record. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "01ARZ3NDEKTSV4RRFFQ69G5FAV" // Note: If an id is provided, other log records with the same id will be // considered duplicates and can be removed safely. This means, that two // distinguishable log records MUST have different values. // The id MAY be an // [Universally Unique Lexicographically Sortable Identifier (ULID)], but other // identifiers (e.g. UUID) may be used as needed. // // [Universally Unique Lexicographically Sortable Identifier (ULID)]: https://github.com/ulid/spec LogRecordUIDKey = attribute.Key("log.record.uid") ) // LogFileName returns an attribute KeyValue conforming to the "log.file.name" // semantic conventions. It represents the basename of the file. func LogFileName(val string) attribute.KeyValue { return LogFileNameKey.String(val) } // LogFileNameResolved returns an attribute KeyValue conforming to the // "log.file.name_resolved" semantic conventions. It represents the basename of // the file, with symlinks resolved. func LogFileNameResolved(val string) attribute.KeyValue { return LogFileNameResolvedKey.String(val) } // LogFilePath returns an attribute KeyValue conforming to the "log.file.path" // semantic conventions. It represents the full path to the file. func LogFilePath(val string) attribute.KeyValue { return LogFilePathKey.String(val) } // LogFilePathResolved returns an attribute KeyValue conforming to the // "log.file.path_resolved" semantic conventions. It represents the full path to // the file, with symlinks resolved. func LogFilePathResolved(val string) attribute.KeyValue { return LogFilePathResolvedKey.String(val) } // LogRecordOriginal returns an attribute KeyValue conforming to the // "log.record.original" semantic conventions. It represents the complete // original Log Record. func LogRecordOriginal(val string) attribute.KeyValue { return LogRecordOriginalKey.String(val) } // LogRecordUID returns an attribute KeyValue conforming to the "log.record.uid" // semantic conventions. It represents a unique identifier for the Log Record. func LogRecordUID(val string) attribute.KeyValue { return LogRecordUIDKey.String(val) } // Enum values for log.iostream var ( // Logs from stdout stream // Stability: development LogIostreamStdout = LogIostreamKey.String("stdout") // Events from stderr stream // Stability: development LogIostreamStderr = LogIostreamKey.String("stderr") ) // Namespace: mainframe const ( // MainframeLparNameKey is the attribute Key conforming to the // "mainframe.lpar.name" semantic conventions. It represents the name of the // logical partition that hosts a systems with a mainframe operating system. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "LPAR01" MainframeLparNameKey = attribute.Key("mainframe.lpar.name") ) // MainframeLparName returns an attribute KeyValue conforming to the // "mainframe.lpar.name" semantic conventions. It represents the name of the // logical partition that hosts a systems with a mainframe operating system. func MainframeLparName(val string) attribute.KeyValue { return MainframeLparNameKey.String(val) } // Namespace: mcp const ( // McpMethodNameKey is the attribute Key conforming to the "mcp.method.name" // semantic conventions. It represents the name of the request or notification // method. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: McpMethodNameKey = attribute.Key("mcp.method.name") // McpProtocolVersionKey is the attribute Key conforming to the // "mcp.protocol.version" semantic conventions. It represents the [version] of // the Model Context Protocol used. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "2025-06-18" // // [version]: https://modelcontextprotocol.io/specification/versioning McpProtocolVersionKey = attribute.Key("mcp.protocol.version") // McpResourceURIKey is the attribute Key conforming to the "mcp.resource.uri" // semantic conventions. It represents the value of the resource uri. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "postgres://database/customers/schema", // "file:///home/user/documents/report.pdf" // Note: This is a URI of the resource provided in the following requests or // notifications: `resources/read`, `resources/subscribe`, // `resources/unsubscribe`, or `notifications/resources/updated`. McpResourceURIKey = attribute.Key("mcp.resource.uri") // McpSessionIDKey is the attribute Key conforming to the "mcp.session.id" // semantic conventions. It represents the identifies [MCP session]. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "191c4850af6c49e08843a3f6c80e5046" // // [MCP session]: https://modelcontextprotocol.io/specification/2025-06-18/basic/transports#session-management McpSessionIDKey = attribute.Key("mcp.session.id") ) // McpProtocolVersion returns an attribute KeyValue conforming to the // "mcp.protocol.version" semantic conventions. It represents the [version] of // the Model Context Protocol used. // // [version]: https://modelcontextprotocol.io/specification/versioning func McpProtocolVersion(val string) attribute.KeyValue { return McpProtocolVersionKey.String(val) } // McpResourceURI returns an attribute KeyValue conforming to the // "mcp.resource.uri" semantic conventions. It represents the value of the // resource uri. func McpResourceURI(val string) attribute.KeyValue { return McpResourceURIKey.String(val) } // McpSessionID returns an attribute KeyValue conforming to the "mcp.session.id" // semantic conventions. It represents the identifies [MCP session]. // // [MCP session]: https://modelcontextprotocol.io/specification/2025-06-18/basic/transports#session-management func McpSessionID(val string) attribute.KeyValue { return McpSessionIDKey.String(val) } // Enum values for mcp.method.name var ( // Notification cancelling a previously-issued request. // // Stability: development McpMethodNameNotificationsCancelled = McpMethodNameKey.String("notifications/cancelled") // Request to initialize the MCP client. // // Stability: development McpMethodNameInitialize = McpMethodNameKey.String("initialize") // Notification indicating that the MCP client has been initialized. // // Stability: development McpMethodNameNotificationsInitialized = McpMethodNameKey.String("notifications/initialized") // Notification indicating the progress for a long-running operation. // // Stability: development McpMethodNameNotificationsProgress = McpMethodNameKey.String("notifications/progress") // Request to check that the other party is still alive. // // Stability: development McpMethodNamePing = McpMethodNameKey.String("ping") // Request to list resources available on server. // // Stability: development McpMethodNameResourcesList = McpMethodNameKey.String("resources/list") // Request to list resource templates available on server. // // Stability: development McpMethodNameResourcesTemplatesList = McpMethodNameKey.String("resources/templates/list") // Request to read a resource. // // Stability: development McpMethodNameResourcesRead = McpMethodNameKey.String("resources/read") // Notification indicating that the list of resources has changed. // // Stability: development McpMethodNameNotificationsResourcesListChanged = McpMethodNameKey.String("notifications/resources/list_changed") // Request to subscribe to a resource. // // Stability: development McpMethodNameResourcesSubscribe = McpMethodNameKey.String("resources/subscribe") // Request to unsubscribe from resource updates. // // Stability: development McpMethodNameResourcesUnsubscribe = McpMethodNameKey.String("resources/unsubscribe") // Notification indicating that a resource has been updated. // // Stability: development McpMethodNameNotificationsResourcesUpdated = McpMethodNameKey.String("notifications/resources/updated") // Request to list prompts available on server. // // Stability: development McpMethodNamePromptsList = McpMethodNameKey.String("prompts/list") // Request to get a prompt. // // Stability: development McpMethodNamePromptsGet = McpMethodNameKey.String("prompts/get") // Notification indicating that the list of prompts has changed. // // Stability: development McpMethodNameNotificationsPromptsListChanged = McpMethodNameKey.String("notifications/prompts/list_changed") // Request to list tools available on server. // // Stability: development McpMethodNameToolsList = McpMethodNameKey.String("tools/list") // Request to call a tool. // // Stability: development McpMethodNameToolsCall = McpMethodNameKey.String("tools/call") // Notification indicating that the list of tools has changed. // // Stability: development McpMethodNameNotificationsToolsListChanged = McpMethodNameKey.String("notifications/tools/list_changed") // Request to set the logging level. // // Stability: development McpMethodNameLoggingSetLevel = McpMethodNameKey.String("logging/setLevel") // Notification indicating that a message has been received. // // Stability: development McpMethodNameNotificationsMessage = McpMethodNameKey.String("notifications/message") // Request to create a sampling message. // // Stability: development McpMethodNameSamplingCreateMessage = McpMethodNameKey.String("sampling/createMessage") // Request to complete a prompt. // // Stability: development McpMethodNameCompletionComplete = McpMethodNameKey.String("completion/complete") // Request to list roots available on server. // // Stability: development McpMethodNameRootsList = McpMethodNameKey.String("roots/list") // Notification indicating that the list of roots has changed. // // Stability: development McpMethodNameNotificationsRootsListChanged = McpMethodNameKey.String("notifications/roots/list_changed") // Request from the server to elicit additional information from the user via // the client // // Stability: development McpMethodNameElicitationCreate = McpMethodNameKey.String("elicitation/create") ) // Namespace: messaging const ( // MessagingBatchMessageCountKey is the attribute Key conforming to the // "messaging.batch.message_count" semantic conventions. It represents the // number of messages sent, received, or processed in the scope of the batching // operation. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 0, 1, 2 // Note: Instrumentations SHOULD NOT set `messaging.batch.message_count` on // spans that operate with a single message. When a messaging client library // supports both batch and single-message API for the same operation, // instrumentations SHOULD use `messaging.batch.message_count` for batching APIs // and SHOULD NOT use it for single-message APIs. MessagingBatchMessageCountKey = attribute.Key("messaging.batch.message_count") // MessagingClientIDKey is the attribute Key conforming to the // "messaging.client.id" semantic conventions. It represents a unique identifier // for the client that consumes or produces a message. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "client-5", "myhost@8742@s8083jm" MessagingClientIDKey = attribute.Key("messaging.client.id") // MessagingConsumerGroupNameKey is the attribute Key conforming to the // "messaging.consumer.group.name" semantic conventions. It represents the name // of the consumer group with which a consumer is associated. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "my-group", "indexer" // Note: Semantic conventions for individual messaging systems SHOULD document // whether `messaging.consumer.group.name` is applicable and what it means in // the context of that system. MessagingConsumerGroupNameKey = attribute.Key("messaging.consumer.group.name") // MessagingDestinationAnonymousKey is the attribute Key conforming to the // "messaging.destination.anonymous" semantic conventions. It represents a // boolean that is true if the message destination is anonymous (could be // unnamed or have auto-generated name). // // Type: boolean // RequirementLevel: Recommended // Stability: Development // // Examples: MessagingDestinationAnonymousKey = attribute.Key("messaging.destination.anonymous") // MessagingDestinationNameKey is the attribute Key conforming to the // "messaging.destination.name" semantic conventions. It represents the message // destination name. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "MyQueue", "MyTopic" // Note: Destination name SHOULD uniquely identify a specific queue, topic or // other entity within the broker. If // the broker doesn't have such notion, the destination name SHOULD uniquely // identify the broker. MessagingDestinationNameKey = attribute.Key("messaging.destination.name") // MessagingDestinationPartitionIDKey is the attribute Key conforming to the // "messaging.destination.partition.id" semantic conventions. It represents the // identifier of the partition messages are sent to or received from, unique // within the `messaging.destination.name`. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: 1 MessagingDestinationPartitionIDKey = attribute.Key("messaging.destination.partition.id") // MessagingDestinationSubscriptionNameKey is the attribute Key conforming to // the "messaging.destination.subscription.name" semantic conventions. It // represents the name of the destination subscription from which a message is // consumed. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "subscription-a" // Note: Semantic conventions for individual messaging systems SHOULD document // whether `messaging.destination.subscription.name` is applicable and what it // means in the context of that system. MessagingDestinationSubscriptionNameKey = attribute.Key("messaging.destination.subscription.name") // MessagingDestinationTemplateKey is the attribute Key conforming to the // "messaging.destination.template" semantic conventions. It represents the low // cardinality representation of the messaging destination name. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "/customers/{customerId}" // Note: Destination names could be constructed from templates. An example would // be a destination name involving a user name or product id. Although the // destination name in this case is of high cardinality, the underlying template // is of low cardinality and can be effectively used for grouping and // aggregation. MessagingDestinationTemplateKey = attribute.Key("messaging.destination.template") // MessagingDestinationTemporaryKey is the attribute Key conforming to the // "messaging.destination.temporary" semantic conventions. It represents a // boolean that is true if the message destination is temporary and might not // exist anymore after messages are processed. // // Type: boolean // RequirementLevel: Recommended // Stability: Development // // Examples: MessagingDestinationTemporaryKey = attribute.Key("messaging.destination.temporary") // MessagingEventHubsMessageEnqueuedTimeKey is the attribute Key conforming to // the "messaging.eventhubs.message.enqueued_time" semantic conventions. It // represents the UTC epoch seconds at which the message has been accepted and // stored in the entity. // // Type: int // RequirementLevel: Recommended // Stability: Development MessagingEventHubsMessageEnqueuedTimeKey = attribute.Key("messaging.eventhubs.message.enqueued_time") // MessagingGCPPubSubMessageAckDeadlineKey is the attribute Key conforming to // the "messaging.gcp_pubsub.message.ack_deadline" semantic conventions. It // represents the ack deadline in seconds set for the modify ack deadline // request. // // Type: int // RequirementLevel: Recommended // Stability: Development MessagingGCPPubSubMessageAckDeadlineKey = attribute.Key("messaging.gcp_pubsub.message.ack_deadline") // MessagingGCPPubSubMessageAckIDKey is the attribute Key conforming to the // "messaging.gcp_pubsub.message.ack_id" semantic conventions. It represents the // ack id for a given message. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: ack_id MessagingGCPPubSubMessageAckIDKey = attribute.Key("messaging.gcp_pubsub.message.ack_id") // MessagingGCPPubSubMessageDeliveryAttemptKey is the attribute Key conforming // to the "messaging.gcp_pubsub.message.delivery_attempt" semantic conventions. // It represents the delivery attempt for a given message. // // Type: int // RequirementLevel: Recommended // Stability: Development MessagingGCPPubSubMessageDeliveryAttemptKey = attribute.Key("messaging.gcp_pubsub.message.delivery_attempt") // MessagingGCPPubSubMessageOrderingKeyKey is the attribute Key conforming to // the "messaging.gcp_pubsub.message.ordering_key" semantic conventions. It // represents the ordering key for a given message. If the attribute is not // present, the message does not have an ordering key. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: ordering_key MessagingGCPPubSubMessageOrderingKeyKey = attribute.Key("messaging.gcp_pubsub.message.ordering_key") // MessagingKafkaMessageKeyKey is the attribute Key conforming to the // "messaging.kafka.message.key" semantic conventions. It represents the message // keys in Kafka are used for grouping alike messages to ensure they're // processed on the same partition. They differ from `messaging.message.id` in // that they're not unique. If the key is `null`, the attribute MUST NOT be set. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: myKey // Note: If the key type is not string, it's string representation has to be // supplied for the attribute. If the key has no unambiguous, canonical string // form, don't include its value. MessagingKafkaMessageKeyKey = attribute.Key("messaging.kafka.message.key") // MessagingKafkaMessageTombstoneKey is the attribute Key conforming to the // "messaging.kafka.message.tombstone" semantic conventions. It represents a // boolean that is true if the message is a tombstone. // // Type: boolean // RequirementLevel: Recommended // Stability: Development // // Examples: MessagingKafkaMessageTombstoneKey = attribute.Key("messaging.kafka.message.tombstone") // MessagingKafkaOffsetKey is the attribute Key conforming to the // "messaging.kafka.offset" semantic conventions. It represents the offset of a // record in the corresponding Kafka partition. // // Type: int // RequirementLevel: Recommended // Stability: Development MessagingKafkaOffsetKey = attribute.Key("messaging.kafka.offset") // MessagingMessageBodySizeKey is the attribute Key conforming to the // "messaging.message.body.size" semantic conventions. It represents the size of // the message body in bytes. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Note: This can refer to both the compressed or uncompressed body size. If // both sizes are known, the uncompressed // body size should be used. MessagingMessageBodySizeKey = attribute.Key("messaging.message.body.size") // MessagingMessageConversationIDKey is the attribute Key conforming to the // "messaging.message.conversation_id" semantic conventions. It represents the // conversation ID identifying the conversation to which the message belongs, // represented as a string. Sometimes called "Correlation ID". // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: MyConversationId MessagingMessageConversationIDKey = attribute.Key("messaging.message.conversation_id") // MessagingMessageEnvelopeSizeKey is the attribute Key conforming to the // "messaging.message.envelope.size" semantic conventions. It represents the // size of the message body and metadata in bytes. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Note: This can refer to both the compressed or uncompressed size. If both // sizes are known, the uncompressed // size should be used. MessagingMessageEnvelopeSizeKey = attribute.Key("messaging.message.envelope.size") // MessagingMessageIDKey is the attribute Key conforming to the // "messaging.message.id" semantic conventions. It represents a value used by // the messaging system as an identifier for the message, represented as a // string. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: 452a7c7c7c7048c2f887f61572b18fc2 MessagingMessageIDKey = attribute.Key("messaging.message.id") // MessagingOperationNameKey is the attribute Key conforming to the // "messaging.operation.name" semantic conventions. It represents the // system-specific name of the messaging operation. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "ack", "nack", "send" MessagingOperationNameKey = attribute.Key("messaging.operation.name") // MessagingOperationTypeKey is the attribute Key conforming to the // "messaging.operation.type" semantic conventions. It represents a string // identifying the type of the messaging operation. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // Note: If a custom value is used, it MUST be of low cardinality. MessagingOperationTypeKey = attribute.Key("messaging.operation.type") // MessagingRabbitMQDestinationRoutingKeyKey is the attribute Key conforming to // the "messaging.rabbitmq.destination.routing_key" semantic conventions. It // represents the rabbitMQ message routing key. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: myKey MessagingRabbitMQDestinationRoutingKeyKey = attribute.Key("messaging.rabbitmq.destination.routing_key") // MessagingRabbitMQMessageDeliveryTagKey is the attribute Key conforming to the // "messaging.rabbitmq.message.delivery_tag" semantic conventions. It represents // the rabbitMQ message delivery tag. // // Type: int // RequirementLevel: Recommended // Stability: Development MessagingRabbitMQMessageDeliveryTagKey = attribute.Key("messaging.rabbitmq.message.delivery_tag") // MessagingRocketMQConsumptionModelKey is the attribute Key conforming to the // "messaging.rocketmq.consumption_model" semantic conventions. It represents // the model of message consumption. This only applies to consumer spans. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: MessagingRocketMQConsumptionModelKey = attribute.Key("messaging.rocketmq.consumption_model") // MessagingRocketMQMessageDelayTimeLevelKey is the attribute Key conforming to // the "messaging.rocketmq.message.delay_time_level" semantic conventions. It // represents the delay time level for delay message, which determines the // message delay time. // // Type: int // RequirementLevel: Recommended // Stability: Development MessagingRocketMQMessageDelayTimeLevelKey = attribute.Key("messaging.rocketmq.message.delay_time_level") // MessagingRocketMQMessageDeliveryTimestampKey is the attribute Key conforming // to the "messaging.rocketmq.message.delivery_timestamp" semantic conventions. // It represents the timestamp in milliseconds that the delay message is // expected to be delivered to consumer. // // Type: int // RequirementLevel: Recommended // Stability: Development MessagingRocketMQMessageDeliveryTimestampKey = attribute.Key("messaging.rocketmq.message.delivery_timestamp") // MessagingRocketMQMessageGroupKey is the attribute Key conforming to the // "messaging.rocketmq.message.group" semantic conventions. It represents the it // is essential for FIFO message. Messages that belong to the same message group // are always processed one by one within the same consumer group. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: myMessageGroup MessagingRocketMQMessageGroupKey = attribute.Key("messaging.rocketmq.message.group") // MessagingRocketMQMessageKeysKey is the attribute Key conforming to the // "messaging.rocketmq.message.keys" semantic conventions. It represents the // key(s) of message, another way to mark message besides message id. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "keyA", "keyB" MessagingRocketMQMessageKeysKey = attribute.Key("messaging.rocketmq.message.keys") // MessagingRocketMQMessageTagKey is the attribute Key conforming to the // "messaging.rocketmq.message.tag" semantic conventions. It represents the // secondary classifier of message besides topic. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: tagA MessagingRocketMQMessageTagKey = attribute.Key("messaging.rocketmq.message.tag") // MessagingRocketMQMessageTypeKey is the attribute Key conforming to the // "messaging.rocketmq.message.type" semantic conventions. It represents the // type of message. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: MessagingRocketMQMessageTypeKey = attribute.Key("messaging.rocketmq.message.type") // MessagingRocketMQNamespaceKey is the attribute Key conforming to the // "messaging.rocketmq.namespace" semantic conventions. It represents the // namespace of RocketMQ resources, resources in different namespaces are // individual. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: myNamespace MessagingRocketMQNamespaceKey = attribute.Key("messaging.rocketmq.namespace") // MessagingServiceBusDispositionStatusKey is the attribute Key conforming to // the "messaging.servicebus.disposition_status" semantic conventions. It // represents the describes the [settlement type]. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // // [settlement type]: https://learn.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock MessagingServiceBusDispositionStatusKey = attribute.Key("messaging.servicebus.disposition_status") // MessagingServiceBusMessageDeliveryCountKey is the attribute Key conforming to // the "messaging.servicebus.message.delivery_count" semantic conventions. It // represents the number of deliveries that have been attempted for this // message. // // Type: int // RequirementLevel: Recommended // Stability: Development MessagingServiceBusMessageDeliveryCountKey = attribute.Key("messaging.servicebus.message.delivery_count") // MessagingServiceBusMessageEnqueuedTimeKey is the attribute Key conforming to // the "messaging.servicebus.message.enqueued_time" semantic conventions. It // represents the UTC epoch seconds at which the message has been accepted and // stored in the entity. // // Type: int // RequirementLevel: Recommended // Stability: Development MessagingServiceBusMessageEnqueuedTimeKey = attribute.Key("messaging.servicebus.message.enqueued_time") // MessagingSystemKey is the attribute Key conforming to the "messaging.system" // semantic conventions. It represents the messaging system as identified by the // client instrumentation. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // Note: The actual messaging system may differ from the one known by the // client. For example, when using Kafka client libraries to communicate with // Azure Event Hubs, the `messaging.system` is set to `kafka` based on the // instrumentation's best knowledge. MessagingSystemKey = attribute.Key("messaging.system") ) // MessagingBatchMessageCount returns an attribute KeyValue conforming to the // "messaging.batch.message_count" semantic conventions. It represents the number // of messages sent, received, or processed in the scope of the batching // operation. func MessagingBatchMessageCount(val int) attribute.KeyValue { return MessagingBatchMessageCountKey.Int(val) } // MessagingClientID returns an attribute KeyValue conforming to the // "messaging.client.id" semantic conventions. It represents a unique identifier // for the client that consumes or produces a message. func MessagingClientID(val string) attribute.KeyValue { return MessagingClientIDKey.String(val) } // MessagingConsumerGroupName returns an attribute KeyValue conforming to the // "messaging.consumer.group.name" semantic conventions. It represents the name // of the consumer group with which a consumer is associated. func MessagingConsumerGroupName(val string) attribute.KeyValue { return MessagingConsumerGroupNameKey.String(val) } // MessagingDestinationAnonymous returns an attribute KeyValue conforming to the // "messaging.destination.anonymous" semantic conventions. It represents a // boolean that is true if the message destination is anonymous (could be unnamed // or have auto-generated name). func MessagingDestinationAnonymous(val bool) attribute.KeyValue { return MessagingDestinationAnonymousKey.Bool(val) } // MessagingDestinationName returns an attribute KeyValue conforming to the // "messaging.destination.name" semantic conventions. It represents the message // destination name. func MessagingDestinationName(val string) attribute.KeyValue { return MessagingDestinationNameKey.String(val) } // MessagingDestinationPartitionID returns an attribute KeyValue conforming to // the "messaging.destination.partition.id" semantic conventions. It represents // the identifier of the partition messages are sent to or received from, unique // within the `messaging.destination.name`. func MessagingDestinationPartitionID(val string) attribute.KeyValue { return MessagingDestinationPartitionIDKey.String(val) } // MessagingDestinationSubscriptionName returns an attribute KeyValue conforming // to the "messaging.destination.subscription.name" semantic conventions. It // represents the name of the destination subscription from which a message is // consumed. func MessagingDestinationSubscriptionName(val string) attribute.KeyValue { return MessagingDestinationSubscriptionNameKey.String(val) } // MessagingDestinationTemplate returns an attribute KeyValue conforming to the // "messaging.destination.template" semantic conventions. It represents the low // cardinality representation of the messaging destination name. func MessagingDestinationTemplate(val string) attribute.KeyValue { return MessagingDestinationTemplateKey.String(val) } // MessagingDestinationTemporary returns an attribute KeyValue conforming to the // "messaging.destination.temporary" semantic conventions. It represents a // boolean that is true if the message destination is temporary and might not // exist anymore after messages are processed. func MessagingDestinationTemporary(val bool) attribute.KeyValue { return MessagingDestinationTemporaryKey.Bool(val) } // MessagingEventHubsMessageEnqueuedTime returns an attribute KeyValue conforming // to the "messaging.eventhubs.message.enqueued_time" semantic conventions. It // represents the UTC epoch seconds at which the message has been accepted and // stored in the entity. func MessagingEventHubsMessageEnqueuedTime(val int) attribute.KeyValue { return MessagingEventHubsMessageEnqueuedTimeKey.Int(val) } // MessagingGCPPubSubMessageAckDeadline returns an attribute KeyValue conforming // to the "messaging.gcp_pubsub.message.ack_deadline" semantic conventions. It // represents the ack deadline in seconds set for the modify ack deadline // request. func MessagingGCPPubSubMessageAckDeadline(val int) attribute.KeyValue { return MessagingGCPPubSubMessageAckDeadlineKey.Int(val) } // MessagingGCPPubSubMessageAckID returns an attribute KeyValue conforming to the // "messaging.gcp_pubsub.message.ack_id" semantic conventions. It represents the // ack id for a given message. func MessagingGCPPubSubMessageAckID(val string) attribute.KeyValue { return MessagingGCPPubSubMessageAckIDKey.String(val) } // MessagingGCPPubSubMessageDeliveryAttempt returns an attribute KeyValue // conforming to the "messaging.gcp_pubsub.message.delivery_attempt" semantic // conventions. It represents the delivery attempt for a given message. func MessagingGCPPubSubMessageDeliveryAttempt(val int) attribute.KeyValue { return MessagingGCPPubSubMessageDeliveryAttemptKey.Int(val) } // MessagingGCPPubSubMessageOrderingKey returns an attribute KeyValue conforming // to the "messaging.gcp_pubsub.message.ordering_key" semantic conventions. It // represents the ordering key for a given message. If the attribute is not // present, the message does not have an ordering key. func MessagingGCPPubSubMessageOrderingKey(val string) attribute.KeyValue { return MessagingGCPPubSubMessageOrderingKeyKey.String(val) } // MessagingKafkaMessageKey returns an attribute KeyValue conforming to the // "messaging.kafka.message.key" semantic conventions. It represents the message // keys in Kafka are used for grouping alike messages to ensure they're processed // on the same partition. They differ from `messaging.message.id` in that they're // not unique. If the key is `null`, the attribute MUST NOT be set. func MessagingKafkaMessageKey(val string) attribute.KeyValue { return MessagingKafkaMessageKeyKey.String(val) } // MessagingKafkaMessageTombstone returns an attribute KeyValue conforming to the // "messaging.kafka.message.tombstone" semantic conventions. It represents a // boolean that is true if the message is a tombstone. func MessagingKafkaMessageTombstone(val bool) attribute.KeyValue { return MessagingKafkaMessageTombstoneKey.Bool(val) } // MessagingKafkaOffset returns an attribute KeyValue conforming to the // "messaging.kafka.offset" semantic conventions. It represents the offset of a // record in the corresponding Kafka partition. func MessagingKafkaOffset(val int) attribute.KeyValue { return MessagingKafkaOffsetKey.Int(val) } // MessagingMessageBodySize returns an attribute KeyValue conforming to the // "messaging.message.body.size" semantic conventions. It represents the size of // the message body in bytes. func MessagingMessageBodySize(val int) attribute.KeyValue { return MessagingMessageBodySizeKey.Int(val) } // MessagingMessageConversationID returns an attribute KeyValue conforming to the // "messaging.message.conversation_id" semantic conventions. It represents the // conversation ID identifying the conversation to which the message belongs, // represented as a string. Sometimes called "Correlation ID". func MessagingMessageConversationID(val string) attribute.KeyValue { return MessagingMessageConversationIDKey.String(val) } // MessagingMessageEnvelopeSize returns an attribute KeyValue conforming to the // "messaging.message.envelope.size" semantic conventions. It represents the size // of the message body and metadata in bytes. func MessagingMessageEnvelopeSize(val int) attribute.KeyValue { return MessagingMessageEnvelopeSizeKey.Int(val) } // MessagingMessageID returns an attribute KeyValue conforming to the // "messaging.message.id" semantic conventions. It represents a value used by the // messaging system as an identifier for the message, represented as a string. func MessagingMessageID(val string) attribute.KeyValue { return MessagingMessageIDKey.String(val) } // MessagingOperationName returns an attribute KeyValue conforming to the // "messaging.operation.name" semantic conventions. It represents the // system-specific name of the messaging operation. func MessagingOperationName(val string) attribute.KeyValue { return MessagingOperationNameKey.String(val) } // MessagingRabbitMQDestinationRoutingKey returns an attribute KeyValue // conforming to the "messaging.rabbitmq.destination.routing_key" semantic // conventions. It represents the rabbitMQ message routing key. func MessagingRabbitMQDestinationRoutingKey(val string) attribute.KeyValue { return MessagingRabbitMQDestinationRoutingKeyKey.String(val) } // MessagingRabbitMQMessageDeliveryTag returns an attribute KeyValue conforming // to the "messaging.rabbitmq.message.delivery_tag" semantic conventions. It // represents the rabbitMQ message delivery tag. func MessagingRabbitMQMessageDeliveryTag(val int) attribute.KeyValue { return MessagingRabbitMQMessageDeliveryTagKey.Int(val) } // MessagingRocketMQMessageDelayTimeLevel returns an attribute KeyValue // conforming to the "messaging.rocketmq.message.delay_time_level" semantic // conventions. It represents the delay time level for delay message, which // determines the message delay time. func MessagingRocketMQMessageDelayTimeLevel(val int) attribute.KeyValue { return MessagingRocketMQMessageDelayTimeLevelKey.Int(val) } // MessagingRocketMQMessageDeliveryTimestamp returns an attribute KeyValue // conforming to the "messaging.rocketmq.message.delivery_timestamp" semantic // conventions. It represents the timestamp in milliseconds that the delay // message is expected to be delivered to consumer. func MessagingRocketMQMessageDeliveryTimestamp(val int) attribute.KeyValue { return MessagingRocketMQMessageDeliveryTimestampKey.Int(val) } // MessagingRocketMQMessageGroup returns an attribute KeyValue conforming to the // "messaging.rocketmq.message.group" semantic conventions. It represents the it // is essential for FIFO message. Messages that belong to the same message group // are always processed one by one within the same consumer group. func MessagingRocketMQMessageGroup(val string) attribute.KeyValue { return MessagingRocketMQMessageGroupKey.String(val) } // MessagingRocketMQMessageKeys returns an attribute KeyValue conforming to the // "messaging.rocketmq.message.keys" semantic conventions. It represents the // key(s) of message, another way to mark message besides message id. func MessagingRocketMQMessageKeys(val ...string) attribute.KeyValue { return MessagingRocketMQMessageKeysKey.StringSlice(val) } // MessagingRocketMQMessageTag returns an attribute KeyValue conforming to the // "messaging.rocketmq.message.tag" semantic conventions. It represents the // secondary classifier of message besides topic. func MessagingRocketMQMessageTag(val string) attribute.KeyValue { return MessagingRocketMQMessageTagKey.String(val) } // MessagingRocketMQNamespace returns an attribute KeyValue conforming to the // "messaging.rocketmq.namespace" semantic conventions. It represents the // namespace of RocketMQ resources, resources in different namespaces are // individual. func MessagingRocketMQNamespace(val string) attribute.KeyValue { return MessagingRocketMQNamespaceKey.String(val) } // MessagingServiceBusMessageDeliveryCount returns an attribute KeyValue // conforming to the "messaging.servicebus.message.delivery_count" semantic // conventions. It represents the number of deliveries that have been attempted // for this message. func MessagingServiceBusMessageDeliveryCount(val int) attribute.KeyValue { return MessagingServiceBusMessageDeliveryCountKey.Int(val) } // MessagingServiceBusMessageEnqueuedTime returns an attribute KeyValue // conforming to the "messaging.servicebus.message.enqueued_time" semantic // conventions. It represents the UTC epoch seconds at which the message has been // accepted and stored in the entity. func MessagingServiceBusMessageEnqueuedTime(val int) attribute.KeyValue { return MessagingServiceBusMessageEnqueuedTimeKey.Int(val) } // Enum values for messaging.operation.type var ( // A message is created. "Create" spans always refer to a single message and are // used to provide a unique creation context for messages in batch sending // scenarios. // // Stability: development MessagingOperationTypeCreate = MessagingOperationTypeKey.String("create") // One or more messages are provided for sending to an intermediary. If a single // message is sent, the context of the "Send" span can be used as the creation // context and no "Create" span needs to be created. // // Stability: development MessagingOperationTypeSend = MessagingOperationTypeKey.String("send") // One or more messages are requested by a consumer. This operation refers to // pull-based scenarios, where consumers explicitly call methods of messaging // SDKs to receive messages. // // Stability: development MessagingOperationTypeReceive = MessagingOperationTypeKey.String("receive") // One or more messages are processed by a consumer. // // Stability: development MessagingOperationTypeProcess = MessagingOperationTypeKey.String("process") // One or more messages are settled. // // Stability: development MessagingOperationTypeSettle = MessagingOperationTypeKey.String("settle") ) // Enum values for messaging.rocketmq.consumption_model var ( // Clustering consumption model // Stability: development MessagingRocketMQConsumptionModelClustering = MessagingRocketMQConsumptionModelKey.String("clustering") // Broadcasting consumption model // Stability: development MessagingRocketMQConsumptionModelBroadcasting = MessagingRocketMQConsumptionModelKey.String("broadcasting") ) // Enum values for messaging.rocketmq.message.type var ( // Normal message // Stability: development MessagingRocketMQMessageTypeNormal = MessagingRocketMQMessageTypeKey.String("normal") // FIFO message // Stability: development MessagingRocketMQMessageTypeFifo = MessagingRocketMQMessageTypeKey.String("fifo") // Delay message // Stability: development MessagingRocketMQMessageTypeDelay = MessagingRocketMQMessageTypeKey.String("delay") // Transaction message // Stability: development MessagingRocketMQMessageTypeTransaction = MessagingRocketMQMessageTypeKey.String("transaction") ) // Enum values for messaging.servicebus.disposition_status var ( // Message is completed // Stability: development MessagingServiceBusDispositionStatusComplete = MessagingServiceBusDispositionStatusKey.String("complete") // Message is abandoned // Stability: development MessagingServiceBusDispositionStatusAbandon = MessagingServiceBusDispositionStatusKey.String("abandon") // Message is sent to dead letter queue // Stability: development MessagingServiceBusDispositionStatusDeadLetter = MessagingServiceBusDispositionStatusKey.String("dead_letter") // Message is deferred // Stability: development MessagingServiceBusDispositionStatusDefer = MessagingServiceBusDispositionStatusKey.String("defer") ) // Enum values for messaging.system var ( // Apache ActiveMQ // Stability: development MessagingSystemActiveMQ = MessagingSystemKey.String("activemq") // Amazon Simple Notification Service (SNS) // Stability: development MessagingSystemAWSSNS = MessagingSystemKey.String("aws.sns") // Amazon Simple Queue Service (SQS) // Stability: development MessagingSystemAWSSQS = MessagingSystemKey.String("aws_sqs") // Azure Event Grid // Stability: development MessagingSystemEventGrid = MessagingSystemKey.String("eventgrid") // Azure Event Hubs // Stability: development MessagingSystemEventHubs = MessagingSystemKey.String("eventhubs") // Azure Service Bus // Stability: development MessagingSystemServiceBus = MessagingSystemKey.String("servicebus") // Google Cloud Pub/Sub // Stability: development MessagingSystemGCPPubSub = MessagingSystemKey.String("gcp_pubsub") // Java Message Service // Stability: development MessagingSystemJMS = MessagingSystemKey.String("jms") // Apache Kafka // Stability: development MessagingSystemKafka = MessagingSystemKey.String("kafka") // RabbitMQ // Stability: development MessagingSystemRabbitMQ = MessagingSystemKey.String("rabbitmq") // Apache RocketMQ // Stability: development MessagingSystemRocketMQ = MessagingSystemKey.String("rocketmq") // Apache Pulsar // Stability: development MessagingSystemPulsar = MessagingSystemKey.String("pulsar") ) // Namespace: network const ( // NetworkCarrierICCKey is the attribute Key conforming to the // "network.carrier.icc" semantic conventions. It represents the ISO 3166-1 // alpha-2 2-character country code associated with the mobile carrier network. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: DE NetworkCarrierICCKey = attribute.Key("network.carrier.icc") // NetworkCarrierMCCKey is the attribute Key conforming to the // "network.carrier.mcc" semantic conventions. It represents the mobile carrier // country code. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: 310 NetworkCarrierMCCKey = attribute.Key("network.carrier.mcc") // NetworkCarrierMNCKey is the attribute Key conforming to the // "network.carrier.mnc" semantic conventions. It represents the mobile carrier // network code. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: 001 NetworkCarrierMNCKey = attribute.Key("network.carrier.mnc") // NetworkCarrierNameKey is the attribute Key conforming to the // "network.carrier.name" semantic conventions. It represents the name of the // mobile carrier. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: sprint NetworkCarrierNameKey = attribute.Key("network.carrier.name") // NetworkConnectionStateKey is the attribute Key conforming to the // "network.connection.state" semantic conventions. It represents the state of // network connection. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "close_wait" // Note: Connection states are defined as part of the [rfc9293] // // [rfc9293]: https://datatracker.ietf.org/doc/html/rfc9293#section-3.3.2 NetworkConnectionStateKey = attribute.Key("network.connection.state") // NetworkConnectionSubtypeKey is the attribute Key conforming to the // "network.connection.subtype" semantic conventions. It represents the this // describes more details regarding the connection.type. It may be the type of // cell technology connection, but it could be used for describing details about // a wifi connection. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: LTE NetworkConnectionSubtypeKey = attribute.Key("network.connection.subtype") // NetworkConnectionTypeKey is the attribute Key conforming to the // "network.connection.type" semantic conventions. It represents the internet // connection type. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: wifi NetworkConnectionTypeKey = attribute.Key("network.connection.type") // NetworkInterfaceNameKey is the attribute Key conforming to the // "network.interface.name" semantic conventions. It represents the network // interface name. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "lo", "eth0" NetworkInterfaceNameKey = attribute.Key("network.interface.name") // NetworkIODirectionKey is the attribute Key conforming to the // "network.io.direction" semantic conventions. It represents the network IO // operation direction. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "transmit" NetworkIODirectionKey = attribute.Key("network.io.direction") // NetworkLocalAddressKey is the attribute Key conforming to the // "network.local.address" semantic conventions. It represents the local address // of the network connection - IP address or Unix domain socket name. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "10.1.2.80", "/tmp/my.sock" NetworkLocalAddressKey = attribute.Key("network.local.address") // NetworkLocalPortKey is the attribute Key conforming to the // "network.local.port" semantic conventions. It represents the local port // number of the network connection. // // Type: int // RequirementLevel: Recommended // Stability: Stable // // Examples: 65123 NetworkLocalPortKey = attribute.Key("network.local.port") // NetworkPeerAddressKey is the attribute Key conforming to the // "network.peer.address" semantic conventions. It represents the peer address // of the network connection - IP address or Unix domain socket name. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "10.1.2.80", "/tmp/my.sock" NetworkPeerAddressKey = attribute.Key("network.peer.address") // NetworkPeerPortKey is the attribute Key conforming to the "network.peer.port" // semantic conventions. It represents the peer port number of the network // connection. // // Type: int // RequirementLevel: Recommended // Stability: Stable // // Examples: 65123 NetworkPeerPortKey = attribute.Key("network.peer.port") // NetworkProtocolNameKey is the attribute Key conforming to the // "network.protocol.name" semantic conventions. It represents the // [OSI application layer] or non-OSI equivalent. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "amqp", "http", "mqtt" // Note: The value SHOULD be normalized to lowercase. // // [OSI application layer]: https://wikipedia.org/wiki/Application_layer NetworkProtocolNameKey = attribute.Key("network.protocol.name") // NetworkProtocolVersionKey is the attribute Key conforming to the // "network.protocol.version" semantic conventions. It represents the actual // version of the protocol used for network communication. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "1.1", "2" // Note: If protocol version is subject to negotiation (for example using [ALPN] // ), this attribute SHOULD be set to the negotiated version. If the actual // protocol version is not known, this attribute SHOULD NOT be set. // // [ALPN]: https://www.rfc-editor.org/rfc/rfc7301.html NetworkProtocolVersionKey = attribute.Key("network.protocol.version") // NetworkTransportKey is the attribute Key conforming to the // "network.transport" semantic conventions. It represents the // [OSI transport layer] or [inter-process communication method]. // // Type: Enum // RequirementLevel: Recommended // Stability: Stable // // Examples: "tcp", "udp" // Note: The value SHOULD be normalized to lowercase. // // Consider always setting the transport when setting a port number, since // a port number is ambiguous without knowing the transport. For example // different processes could be listening on TCP port 12345 and UDP port 12345. // // [OSI transport layer]: https://wikipedia.org/wiki/Transport_layer // [inter-process communication method]: https://wikipedia.org/wiki/Inter-process_communication NetworkTransportKey = attribute.Key("network.transport") // NetworkTypeKey is the attribute Key conforming to the "network.type" semantic // conventions. It represents the [OSI network layer] or non-OSI equivalent. // // Type: Enum // RequirementLevel: Recommended // Stability: Stable // // Examples: "ipv4", "ipv6" // Note: The value SHOULD be normalized to lowercase. // // [OSI network layer]: https://wikipedia.org/wiki/Network_layer NetworkTypeKey = attribute.Key("network.type") ) // NetworkCarrierICC returns an attribute KeyValue conforming to the // "network.carrier.icc" semantic conventions. It represents the ISO 3166-1 // alpha-2 2-character country code associated with the mobile carrier network. func NetworkCarrierICC(val string) attribute.KeyValue { return NetworkCarrierICCKey.String(val) } // NetworkCarrierMCC returns an attribute KeyValue conforming to the // "network.carrier.mcc" semantic conventions. It represents the mobile carrier // country code. func NetworkCarrierMCC(val string) attribute.KeyValue { return NetworkCarrierMCCKey.String(val) } // NetworkCarrierMNC returns an attribute KeyValue conforming to the // "network.carrier.mnc" semantic conventions. It represents the mobile carrier // network code. func NetworkCarrierMNC(val string) attribute.KeyValue { return NetworkCarrierMNCKey.String(val) } // NetworkCarrierName returns an attribute KeyValue conforming to the // "network.carrier.name" semantic conventions. It represents the name of the // mobile carrier. func NetworkCarrierName(val string) attribute.KeyValue { return NetworkCarrierNameKey.String(val) } // NetworkInterfaceName returns an attribute KeyValue conforming to the // "network.interface.name" semantic conventions. It represents the network // interface name. func NetworkInterfaceName(val string) attribute.KeyValue { return NetworkInterfaceNameKey.String(val) } // NetworkLocalAddress returns an attribute KeyValue conforming to the // "network.local.address" semantic conventions. It represents the local address // of the network connection - IP address or Unix domain socket name. func NetworkLocalAddress(val string) attribute.KeyValue { return NetworkLocalAddressKey.String(val) } // NetworkLocalPort returns an attribute KeyValue conforming to the // "network.local.port" semantic conventions. It represents the local port number // of the network connection. func NetworkLocalPort(val int) attribute.KeyValue { return NetworkLocalPortKey.Int(val) } // NetworkPeerAddress returns an attribute KeyValue conforming to the // "network.peer.address" semantic conventions. It represents the peer address of // the network connection - IP address or Unix domain socket name. func NetworkPeerAddress(val string) attribute.KeyValue { return NetworkPeerAddressKey.String(val) } // NetworkPeerPort returns an attribute KeyValue conforming to the // "network.peer.port" semantic conventions. It represents the peer port number // of the network connection. func NetworkPeerPort(val int) attribute.KeyValue { return NetworkPeerPortKey.Int(val) } // NetworkProtocolName returns an attribute KeyValue conforming to the // "network.protocol.name" semantic conventions. It represents the // [OSI application layer] or non-OSI equivalent. // // [OSI application layer]: https://wikipedia.org/wiki/Application_layer func NetworkProtocolName(val string) attribute.KeyValue { return NetworkProtocolNameKey.String(val) } // NetworkProtocolVersion returns an attribute KeyValue conforming to the // "network.protocol.version" semantic conventions. It represents the actual // version of the protocol used for network communication. func NetworkProtocolVersion(val string) attribute.KeyValue { return NetworkProtocolVersionKey.String(val) } // Enum values for network.connection.state var ( // closed // Stability: development NetworkConnectionStateClosed = NetworkConnectionStateKey.String("closed") // close_wait // Stability: development NetworkConnectionStateCloseWait = NetworkConnectionStateKey.String("close_wait") // closing // Stability: development NetworkConnectionStateClosing = NetworkConnectionStateKey.String("closing") // established // Stability: development NetworkConnectionStateEstablished = NetworkConnectionStateKey.String("established") // fin_wait_1 // Stability: development NetworkConnectionStateFinWait1 = NetworkConnectionStateKey.String("fin_wait_1") // fin_wait_2 // Stability: development NetworkConnectionStateFinWait2 = NetworkConnectionStateKey.String("fin_wait_2") // last_ack // Stability: development NetworkConnectionStateLastAck = NetworkConnectionStateKey.String("last_ack") // listen // Stability: development NetworkConnectionStateListen = NetworkConnectionStateKey.String("listen") // syn_received // Stability: development NetworkConnectionStateSynReceived = NetworkConnectionStateKey.String("syn_received") // syn_sent // Stability: development NetworkConnectionStateSynSent = NetworkConnectionStateKey.String("syn_sent") // time_wait // Stability: development NetworkConnectionStateTimeWait = NetworkConnectionStateKey.String("time_wait") ) // Enum values for network.connection.subtype var ( // GPRS // Stability: development NetworkConnectionSubtypeGprs = NetworkConnectionSubtypeKey.String("gprs") // EDGE // Stability: development NetworkConnectionSubtypeEdge = NetworkConnectionSubtypeKey.String("edge") // UMTS // Stability: development NetworkConnectionSubtypeUmts = NetworkConnectionSubtypeKey.String("umts") // CDMA // Stability: development NetworkConnectionSubtypeCdma = NetworkConnectionSubtypeKey.String("cdma") // EVDO Rel. 0 // Stability: development NetworkConnectionSubtypeEvdo0 = NetworkConnectionSubtypeKey.String("evdo_0") // EVDO Rev. A // Stability: development NetworkConnectionSubtypeEvdoA = NetworkConnectionSubtypeKey.String("evdo_a") // CDMA2000 1XRTT // Stability: development NetworkConnectionSubtypeCdma20001xrtt = NetworkConnectionSubtypeKey.String("cdma2000_1xrtt") // HSDPA // Stability: development NetworkConnectionSubtypeHsdpa = NetworkConnectionSubtypeKey.String("hsdpa") // HSUPA // Stability: development NetworkConnectionSubtypeHsupa = NetworkConnectionSubtypeKey.String("hsupa") // HSPA // Stability: development NetworkConnectionSubtypeHspa = NetworkConnectionSubtypeKey.String("hspa") // IDEN // Stability: development NetworkConnectionSubtypeIden = NetworkConnectionSubtypeKey.String("iden") // EVDO Rev. B // Stability: development NetworkConnectionSubtypeEvdoB = NetworkConnectionSubtypeKey.String("evdo_b") // LTE // Stability: development NetworkConnectionSubtypeLte = NetworkConnectionSubtypeKey.String("lte") // EHRPD // Stability: development NetworkConnectionSubtypeEhrpd = NetworkConnectionSubtypeKey.String("ehrpd") // HSPAP // Stability: development NetworkConnectionSubtypeHspap = NetworkConnectionSubtypeKey.String("hspap") // GSM // Stability: development NetworkConnectionSubtypeGsm = NetworkConnectionSubtypeKey.String("gsm") // TD-SCDMA // Stability: development NetworkConnectionSubtypeTdScdma = NetworkConnectionSubtypeKey.String("td_scdma") // IWLAN // Stability: development NetworkConnectionSubtypeIwlan = NetworkConnectionSubtypeKey.String("iwlan") // 5G NR (New Radio) // Stability: development NetworkConnectionSubtypeNr = NetworkConnectionSubtypeKey.String("nr") // 5G NRNSA (New Radio Non-Standalone) // Stability: development NetworkConnectionSubtypeNrnsa = NetworkConnectionSubtypeKey.String("nrnsa") // LTE CA // Stability: development NetworkConnectionSubtypeLteCa = NetworkConnectionSubtypeKey.String("lte_ca") ) // Enum values for network.connection.type var ( // wifi // Stability: development NetworkConnectionTypeWifi = NetworkConnectionTypeKey.String("wifi") // wired // Stability: development NetworkConnectionTypeWired = NetworkConnectionTypeKey.String("wired") // cell // Stability: development NetworkConnectionTypeCell = NetworkConnectionTypeKey.String("cell") // unavailable // Stability: development NetworkConnectionTypeUnavailable = NetworkConnectionTypeKey.String("unavailable") // unknown // Stability: development NetworkConnectionTypeUnknown = NetworkConnectionTypeKey.String("unknown") ) // Enum values for network.io.direction var ( // transmit // Stability: development NetworkIODirectionTransmit = NetworkIODirectionKey.String("transmit") // receive // Stability: development NetworkIODirectionReceive = NetworkIODirectionKey.String("receive") ) // Enum values for network.transport var ( // TCP // Stability: stable NetworkTransportTCP = NetworkTransportKey.String("tcp") // UDP // Stability: stable NetworkTransportUDP = NetworkTransportKey.String("udp") // Named or anonymous pipe. // Stability: stable NetworkTransportPipe = NetworkTransportKey.String("pipe") // Unix domain socket // Stability: stable NetworkTransportUnix = NetworkTransportKey.String("unix") // QUIC // Stability: stable NetworkTransportQUIC = NetworkTransportKey.String("quic") ) // Enum values for network.type var ( // IPv4 // Stability: stable NetworkTypeIPv4 = NetworkTypeKey.String("ipv4") // IPv6 // Stability: stable NetworkTypeIPv6 = NetworkTypeKey.String("ipv6") ) // Namespace: nfs const ( // NfsOperationNameKey is the attribute Key conforming to the // "nfs.operation.name" semantic conventions. It represents the NFSv4+ operation // name. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "OPEN", "READ", "GETATTR" NfsOperationNameKey = attribute.Key("nfs.operation.name") // NfsServerRepcacheStatusKey is the attribute Key conforming to the // "nfs.server.repcache.status" semantic conventions. It represents the linux: // one of "hit" (NFSD_STATS_RC_HITS), "miss" (NFSD_STATS_RC_MISSES), or // "nocache" (NFSD_STATS_RC_NOCACHE -- uncacheable). // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: hit NfsServerRepcacheStatusKey = attribute.Key("nfs.server.repcache.status") ) // NfsOperationName returns an attribute KeyValue conforming to the // "nfs.operation.name" semantic conventions. It represents the NFSv4+ operation // name. func NfsOperationName(val string) attribute.KeyValue { return NfsOperationNameKey.String(val) } // NfsServerRepcacheStatus returns an attribute KeyValue conforming to the // "nfs.server.repcache.status" semantic conventions. It represents the linux: // one of "hit" (NFSD_STATS_RC_HITS), "miss" (NFSD_STATS_RC_MISSES), or "nocache" // (NFSD_STATS_RC_NOCACHE -- uncacheable). func NfsServerRepcacheStatus(val string) attribute.KeyValue { return NfsServerRepcacheStatusKey.String(val) } // Namespace: oci const ( // OCIManifestDigestKey is the attribute Key conforming to the // "oci.manifest.digest" semantic conventions. It represents the digest of the // OCI image manifest. For container images specifically is the digest by which // the container image is known. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: // "sha256:e4ca62c0d62f3e886e684806dfe9d4e0cda60d54986898173c1083856cfda0f4" // Note: Follows [OCI Image Manifest Specification], and specifically the // [Digest property]. // An example can be found in [Example Image Manifest]. // // [OCI Image Manifest Specification]: https://github.com/opencontainers/image-spec/blob/main/manifest.md // [Digest property]: https://github.com/opencontainers/image-spec/blob/main/descriptor.md#digests // [Example Image Manifest]: https://github.com/opencontainers/image-spec/blob/main/manifest.md#example-image-manifest OCIManifestDigestKey = attribute.Key("oci.manifest.digest") ) // OCIManifestDigest returns an attribute KeyValue conforming to the // "oci.manifest.digest" semantic conventions. It represents the digest of the // OCI image manifest. For container images specifically is the digest by which // the container image is known. func OCIManifestDigest(val string) attribute.KeyValue { return OCIManifestDigestKey.String(val) } // Namespace: onc_rpc const ( // OncRPCProcedureNameKey is the attribute Key conforming to the // "onc_rpc.procedure.name" semantic conventions. It represents the ONC/Sun RPC // procedure name. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "OPEN", "READ", "GETATTR" OncRPCProcedureNameKey = attribute.Key("onc_rpc.procedure.name") // OncRPCProcedureNumberKey is the attribute Key conforming to the // "onc_rpc.procedure.number" semantic conventions. It represents the ONC/Sun // RPC procedure number. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: OncRPCProcedureNumberKey = attribute.Key("onc_rpc.procedure.number") // OncRPCProgramNameKey is the attribute Key conforming to the // "onc_rpc.program.name" semantic conventions. It represents the ONC/Sun RPC // program name. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "portmapper", "nfs" OncRPCProgramNameKey = attribute.Key("onc_rpc.program.name") // OncRPCVersionKey is the attribute Key conforming to the "onc_rpc.version" // semantic conventions. It represents the ONC/Sun RPC program version. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: OncRPCVersionKey = attribute.Key("onc_rpc.version") ) // OncRPCProcedureName returns an attribute KeyValue conforming to the // "onc_rpc.procedure.name" semantic conventions. It represents the ONC/Sun RPC // procedure name. func OncRPCProcedureName(val string) attribute.KeyValue { return OncRPCProcedureNameKey.String(val) } // OncRPCProcedureNumber returns an attribute KeyValue conforming to the // "onc_rpc.procedure.number" semantic conventions. It represents the ONC/Sun RPC // procedure number. func OncRPCProcedureNumber(val int) attribute.KeyValue { return OncRPCProcedureNumberKey.Int(val) } // OncRPCProgramName returns an attribute KeyValue conforming to the // "onc_rpc.program.name" semantic conventions. It represents the ONC/Sun RPC // program name. func OncRPCProgramName(val string) attribute.KeyValue { return OncRPCProgramNameKey.String(val) } // OncRPCVersion returns an attribute KeyValue conforming to the // "onc_rpc.version" semantic conventions. It represents the ONC/Sun RPC program // version. func OncRPCVersion(val int) attribute.KeyValue { return OncRPCVersionKey.Int(val) } // Namespace: openai const ( // OpenAIRequestServiceTierKey is the attribute Key conforming to the // "openai.request.service_tier" semantic conventions. It represents the service // tier requested. May be a specific tier, default, or auto. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "auto", "default" OpenAIRequestServiceTierKey = attribute.Key("openai.request.service_tier") // OpenAIResponseServiceTierKey is the attribute Key conforming to the // "openai.response.service_tier" semantic conventions. It represents the // service tier used for the response. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "scale", "default" OpenAIResponseServiceTierKey = attribute.Key("openai.response.service_tier") // OpenAIResponseSystemFingerprintKey is the attribute Key conforming to the // "openai.response.system_fingerprint" semantic conventions. It represents a // fingerprint to track any eventual change in the Generative AI environment. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "fp_44709d6fcb" OpenAIResponseSystemFingerprintKey = attribute.Key("openai.response.system_fingerprint") ) // OpenAIResponseServiceTier returns an attribute KeyValue conforming to the // "openai.response.service_tier" semantic conventions. It represents the service // tier used for the response. func OpenAIResponseServiceTier(val string) attribute.KeyValue { return OpenAIResponseServiceTierKey.String(val) } // OpenAIResponseSystemFingerprint returns an attribute KeyValue conforming to // the "openai.response.system_fingerprint" semantic conventions. It represents a // fingerprint to track any eventual change in the Generative AI environment. func OpenAIResponseSystemFingerprint(val string) attribute.KeyValue { return OpenAIResponseSystemFingerprintKey.String(val) } // Enum values for openai.request.service_tier var ( // The system will utilize scale tier credits until they are exhausted. // Stability: development OpenAIRequestServiceTierAuto = OpenAIRequestServiceTierKey.String("auto") // The system will utilize the default scale tier. // Stability: development OpenAIRequestServiceTierDefault = OpenAIRequestServiceTierKey.String("default") ) // Namespace: openshift const ( // OpenShiftClusterquotaNameKey is the attribute Key conforming to the // "openshift.clusterquota.name" semantic conventions. It represents the name of // the cluster quota. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "opentelemetry" OpenShiftClusterquotaNameKey = attribute.Key("openshift.clusterquota.name") // OpenShiftClusterquotaUIDKey is the attribute Key conforming to the // "openshift.clusterquota.uid" semantic conventions. It represents the UID of // the cluster quota. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff" OpenShiftClusterquotaUIDKey = attribute.Key("openshift.clusterquota.uid") ) // OpenShiftClusterquotaName returns an attribute KeyValue conforming to the // "openshift.clusterquota.name" semantic conventions. It represents the name of // the cluster quota. func OpenShiftClusterquotaName(val string) attribute.KeyValue { return OpenShiftClusterquotaNameKey.String(val) } // OpenShiftClusterquotaUID returns an attribute KeyValue conforming to the // "openshift.clusterquota.uid" semantic conventions. It represents the UID of // the cluster quota. func OpenShiftClusterquotaUID(val string) attribute.KeyValue { return OpenShiftClusterquotaUIDKey.String(val) } // Namespace: opentracing const ( // OpenTracingRefTypeKey is the attribute Key conforming to the // "opentracing.ref_type" semantic conventions. It represents the parent-child // Reference type. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // Note: The causal relationship between a child Span and a parent Span. OpenTracingRefTypeKey = attribute.Key("opentracing.ref_type") ) // Enum values for opentracing.ref_type var ( // The parent Span depends on the child Span in some capacity // Stability: development OpenTracingRefTypeChildOf = OpenTracingRefTypeKey.String("child_of") // The parent Span doesn't depend in any way on the result of the child Span // Stability: development OpenTracingRefTypeFollowsFrom = OpenTracingRefTypeKey.String("follows_from") ) // Namespace: os const ( // OSBuildIDKey is the attribute Key conforming to the "os.build_id" semantic // conventions. It represents the unique identifier for a particular build or // compilation of the operating system. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "TQ3C.230805.001.B2", "20E247", "22621" OSBuildIDKey = attribute.Key("os.build_id") // OSDescriptionKey is the attribute Key conforming to the "os.description" // semantic conventions. It represents the human readable (not intended to be // parsed) OS version information, like e.g. reported by `ver` or // `lsb_release -a` commands. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Microsoft Windows [Version 10.0.18363.778]", "Ubuntu 18.04.1 LTS" OSDescriptionKey = attribute.Key("os.description") // OSNameKey is the attribute Key conforming to the "os.name" semantic // conventions. It represents the human readable operating system name. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "iOS", "Android", "Ubuntu" OSNameKey = attribute.Key("os.name") // OSTypeKey is the attribute Key conforming to the "os.type" semantic // conventions. It represents the operating system type. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: OSTypeKey = attribute.Key("os.type") // OSVersionKey is the attribute Key conforming to the "os.version" semantic // conventions. It represents the version string of the operating system as // defined in [Version Attributes]. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "14.2.1", "18.04.1" // // [Version Attributes]: /docs/resource/README.md#version-attributes OSVersionKey = attribute.Key("os.version") ) // OSBuildID returns an attribute KeyValue conforming to the "os.build_id" // semantic conventions. It represents the unique identifier for a particular // build or compilation of the operating system. func OSBuildID(val string) attribute.KeyValue { return OSBuildIDKey.String(val) } // OSDescription returns an attribute KeyValue conforming to the "os.description" // semantic conventions. It represents the human readable (not intended to be // parsed) OS version information, like e.g. reported by `ver` or // `lsb_release -a` commands. func OSDescription(val string) attribute.KeyValue { return OSDescriptionKey.String(val) } // OSName returns an attribute KeyValue conforming to the "os.name" semantic // conventions. It represents the human readable operating system name. func OSName(val string) attribute.KeyValue { return OSNameKey.String(val) } // OSVersion returns an attribute KeyValue conforming to the "os.version" // semantic conventions. It represents the version string of the operating system // as defined in [Version Attributes]. // // [Version Attributes]: /docs/resource/README.md#version-attributes func OSVersion(val string) attribute.KeyValue { return OSVersionKey.String(val) } // Enum values for os.type var ( // Microsoft Windows // Stability: development OSTypeWindows = OSTypeKey.String("windows") // Linux // Stability: development OSTypeLinux = OSTypeKey.String("linux") // Apple Darwin // Stability: development OSTypeDarwin = OSTypeKey.String("darwin") // FreeBSD // Stability: development OSTypeFreeBSD = OSTypeKey.String("freebsd") // NetBSD // Stability: development OSTypeNetBSD = OSTypeKey.String("netbsd") // OpenBSD // Stability: development OSTypeOpenBSD = OSTypeKey.String("openbsd") // DragonFly BSD // Stability: development OSTypeDragonflyBSD = OSTypeKey.String("dragonflybsd") // HP-UX (Hewlett Packard Unix) // Stability: development OSTypeHPUX = OSTypeKey.String("hpux") // AIX (Advanced Interactive eXecutive) // Stability: development OSTypeAIX = OSTypeKey.String("aix") // SunOS, Oracle Solaris // Stability: development OSTypeSolaris = OSTypeKey.String("solaris") // IBM z/OS // Stability: development OSTypeZOS = OSTypeKey.String("zos") ) // Namespace: otel const ( // OTelComponentNameKey is the attribute Key conforming to the // "otel.component.name" semantic conventions. It represents a name uniquely // identifying the instance of the OpenTelemetry component within its containing // SDK instance. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "otlp_grpc_span_exporter/0", "custom-name" // Note: Implementations SHOULD ensure a low cardinality for this attribute, // even across application or SDK restarts. // E.g. implementations MUST NOT use UUIDs as values for this attribute. // // Implementations MAY achieve these goals by following a // `/` pattern, e.g. // `batching_span_processor/0`. // Hereby `otel.component.type` refers to the corresponding attribute value of // the component. // // The value of `instance-counter` MAY be automatically assigned by the // component and uniqueness within the enclosing SDK instance MUST be // guaranteed. // For example, `` MAY be implemented by using a monotonically // increasing counter (starting with `0`), which is incremented every time an // instance of the given component type is started. // // With this implementation, for example the first Batching Span Processor would // have `batching_span_processor/0` // as `otel.component.name`, the second one `batching_span_processor/1` and so // on. // These values will therefore be reused in the case of an application restart. OTelComponentNameKey = attribute.Key("otel.component.name") // OTelComponentTypeKey is the attribute Key conforming to the // "otel.component.type" semantic conventions. It represents a name identifying // the type of the OpenTelemetry component. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "batching_span_processor", "com.example.MySpanExporter" // Note: If none of the standardized values apply, implementations SHOULD use // the language-defined name of the type. // E.g. for Java the fully qualified classname SHOULD be used in this case. OTelComponentTypeKey = attribute.Key("otel.component.type") // OTelEventNameKey is the attribute Key conforming to the "otel.event.name" // semantic conventions. It represents the identifies the class / type of event. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "browser.mouse.click", "device.app.lifecycle" // Note: This attribute SHOULD be used by non-OTLP exporters when destination // does not support `EventName` or equivalent field. This attribute MAY be used // by applications using existing logging libraries so that it can be used to // set the `EventName` field by Collector or SDK components. OTelEventNameKey = attribute.Key("otel.event.name") // OTelScopeNameKey is the attribute Key conforming to the "otel.scope.name" // semantic conventions. It represents the name of the instrumentation scope - ( // `InstrumentationScope.Name` in OTLP). // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "io.opentelemetry.contrib.mongodb" OTelScopeNameKey = attribute.Key("otel.scope.name") // OTelScopeSchemaURLKey is the attribute Key conforming to the // "otel.scope.schema_url" semantic conventions. It represents the schema URL of // the instrumentation scope. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "https://opentelemetry.io/schemas/1.31.0" OTelScopeSchemaURLKey = attribute.Key("otel.scope.schema_url") // OTelScopeVersionKey is the attribute Key conforming to the // "otel.scope.version" semantic conventions. It represents the version of the // instrumentation scope - (`InstrumentationScope.Version` in OTLP). // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "1.0.0" OTelScopeVersionKey = attribute.Key("otel.scope.version") // OTelSpanParentOriginKey is the attribute Key conforming to the // "otel.span.parent.origin" semantic conventions. It represents the determines // whether the span has a parent span, and if so, // [whether it is a remote parent]. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // // [whether it is a remote parent]: https://opentelemetry.io/docs/specs/otel/trace/api/#isremote OTelSpanParentOriginKey = attribute.Key("otel.span.parent.origin") // OTelSpanSamplingResultKey is the attribute Key conforming to the // "otel.span.sampling_result" semantic conventions. It represents the result // value of the sampler for this span. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: OTelSpanSamplingResultKey = attribute.Key("otel.span.sampling_result") // OTelStatusCodeKey is the attribute Key conforming to the "otel.status_code" // semantic conventions. It represents the name of the code, either "OK" or // "ERROR". MUST NOT be set if the status code is UNSET. // // Type: Enum // RequirementLevel: Recommended // Stability: Stable // // Examples: OTelStatusCodeKey = attribute.Key("otel.status_code") // OTelStatusDescriptionKey is the attribute Key conforming to the // "otel.status_description" semantic conventions. It represents the description // of the Status if it has a value, otherwise not set. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "resource not found" OTelStatusDescriptionKey = attribute.Key("otel.status_description") ) // OTelComponentName returns an attribute KeyValue conforming to the // "otel.component.name" semantic conventions. It represents a name uniquely // identifying the instance of the OpenTelemetry component within its containing // SDK instance. func OTelComponentName(val string) attribute.KeyValue { return OTelComponentNameKey.String(val) } // OTelEventName returns an attribute KeyValue conforming to the // "otel.event.name" semantic conventions. It represents the identifies the class // / type of event. func OTelEventName(val string) attribute.KeyValue { return OTelEventNameKey.String(val) } // OTelScopeName returns an attribute KeyValue conforming to the // "otel.scope.name" semantic conventions. It represents the name of the // instrumentation scope - (`InstrumentationScope.Name` in OTLP). func OTelScopeName(val string) attribute.KeyValue { return OTelScopeNameKey.String(val) } // OTelScopeSchemaURL returns an attribute KeyValue conforming to the // "otel.scope.schema_url" semantic conventions. It represents the schema URL of // the instrumentation scope. func OTelScopeSchemaURL(val string) attribute.KeyValue { return OTelScopeSchemaURLKey.String(val) } // OTelScopeVersion returns an attribute KeyValue conforming to the // "otel.scope.version" semantic conventions. It represents the version of the // instrumentation scope - (`InstrumentationScope.Version` in OTLP). func OTelScopeVersion(val string) attribute.KeyValue { return OTelScopeVersionKey.String(val) } // OTelStatusDescription returns an attribute KeyValue conforming to the // "otel.status_description" semantic conventions. It represents the description // of the Status if it has a value, otherwise not set. func OTelStatusDescription(val string) attribute.KeyValue { return OTelStatusDescriptionKey.String(val) } // Enum values for otel.component.type var ( // The builtin SDK batching span processor // // Stability: development OTelComponentTypeBatchingSpanProcessor = OTelComponentTypeKey.String("batching_span_processor") // The builtin SDK simple span processor // // Stability: development OTelComponentTypeSimpleSpanProcessor = OTelComponentTypeKey.String("simple_span_processor") // The builtin SDK batching log record processor // // Stability: development OTelComponentTypeBatchingLogProcessor = OTelComponentTypeKey.String("batching_log_processor") // The builtin SDK simple log record processor // // Stability: development OTelComponentTypeSimpleLogProcessor = OTelComponentTypeKey.String("simple_log_processor") // OTLP span exporter over gRPC with protobuf serialization // // Stability: development OTelComponentTypeOtlpGRPCSpanExporter = OTelComponentTypeKey.String("otlp_grpc_span_exporter") // OTLP span exporter over HTTP with protobuf serialization // // Stability: development OTelComponentTypeOtlpHTTPSpanExporter = OTelComponentTypeKey.String("otlp_http_span_exporter") // OTLP span exporter over HTTP with JSON serialization // // Stability: development OTelComponentTypeOtlpHTTPJSONSpanExporter = OTelComponentTypeKey.String("otlp_http_json_span_exporter") // Zipkin span exporter over HTTP // // Stability: development OTelComponentTypeZipkinHTTPSpanExporter = OTelComponentTypeKey.String("zipkin_http_span_exporter") // OTLP log record exporter over gRPC with protobuf serialization // // Stability: development OTelComponentTypeOtlpGRPCLogExporter = OTelComponentTypeKey.String("otlp_grpc_log_exporter") // OTLP log record exporter over HTTP with protobuf serialization // // Stability: development OTelComponentTypeOtlpHTTPLogExporter = OTelComponentTypeKey.String("otlp_http_log_exporter") // OTLP log record exporter over HTTP with JSON serialization // // Stability: development OTelComponentTypeOtlpHTTPJSONLogExporter = OTelComponentTypeKey.String("otlp_http_json_log_exporter") // The builtin SDK periodically exporting metric reader // // Stability: development OTelComponentTypePeriodicMetricReader = OTelComponentTypeKey.String("periodic_metric_reader") // OTLP metric exporter over gRPC with protobuf serialization // // Stability: development OTelComponentTypeOtlpGRPCMetricExporter = OTelComponentTypeKey.String("otlp_grpc_metric_exporter") // OTLP metric exporter over HTTP with protobuf serialization // // Stability: development OTelComponentTypeOtlpHTTPMetricExporter = OTelComponentTypeKey.String("otlp_http_metric_exporter") // OTLP metric exporter over HTTP with JSON serialization // // Stability: development OTelComponentTypeOtlpHTTPJSONMetricExporter = OTelComponentTypeKey.String("otlp_http_json_metric_exporter") // Prometheus metric exporter over HTTP with the default text-based format // // Stability: development OTelComponentTypePrometheusHTTPTextMetricExporter = OTelComponentTypeKey.String("prometheus_http_text_metric_exporter") ) // Enum values for otel.span.parent.origin var ( // The span does not have a parent, it is a root span // Stability: development OTelSpanParentOriginNone = OTelSpanParentOriginKey.String("none") // The span has a parent and the parent's span context [isRemote()] is false // Stability: development // // [isRemote()]: https://opentelemetry.io/docs/specs/otel/trace/api/#isremote OTelSpanParentOriginLocal = OTelSpanParentOriginKey.String("local") // The span has a parent and the parent's span context [isRemote()] is true // Stability: development // // [isRemote()]: https://opentelemetry.io/docs/specs/otel/trace/api/#isremote OTelSpanParentOriginRemote = OTelSpanParentOriginKey.String("remote") ) // Enum values for otel.span.sampling_result var ( // The span is not sampled and not recording // Stability: development OTelSpanSamplingResultDrop = OTelSpanSamplingResultKey.String("DROP") // The span is not sampled, but recording // Stability: development OTelSpanSamplingResultRecordOnly = OTelSpanSamplingResultKey.String("RECORD_ONLY") // The span is sampled and recording // Stability: development OTelSpanSamplingResultRecordAndSample = OTelSpanSamplingResultKey.String("RECORD_AND_SAMPLE") ) // Enum values for otel.status_code var ( // The operation has been validated by an Application developer or Operator to // have completed successfully. // Stability: stable OTelStatusCodeOk = OTelStatusCodeKey.String("OK") // The operation contains an error. // Stability: stable OTelStatusCodeError = OTelStatusCodeKey.String("ERROR") ) // Namespace: pprof const ( // PprofLocationIsFoldedKey is the attribute Key conforming to the // "pprof.location.is_folded" semantic conventions. It represents the provides // an indication that multiple symbols map to this location's address, for // example due to identical code folding by the linker. In that case the line // information represents one of the multiple symbols. This field must be // recomputed when the symbolization state of the profile changes. // // Type: boolean // RequirementLevel: Recommended // Stability: Development // // Examples: PprofLocationIsFoldedKey = attribute.Key("pprof.location.is_folded") // PprofMappingHasFilenamesKey is the attribute Key conforming to the // "pprof.mapping.has_filenames" semantic conventions. It represents the // indicates that there are filenames related to this mapping. // // Type: boolean // RequirementLevel: Recommended // Stability: Development // // Examples: PprofMappingHasFilenamesKey = attribute.Key("pprof.mapping.has_filenames") // PprofMappingHasFunctionsKey is the attribute Key conforming to the // "pprof.mapping.has_functions" semantic conventions. It represents the // indicates that there are functions related to this mapping. // // Type: boolean // RequirementLevel: Recommended // Stability: Development // // Examples: PprofMappingHasFunctionsKey = attribute.Key("pprof.mapping.has_functions") // PprofMappingHasInlineFramesKey is the attribute Key conforming to the // "pprof.mapping.has_inline_frames" semantic conventions. It represents the // indicates that there are inline frames related to this mapping. // // Type: boolean // RequirementLevel: Recommended // Stability: Development // // Examples: PprofMappingHasInlineFramesKey = attribute.Key("pprof.mapping.has_inline_frames") // PprofMappingHasLineNumbersKey is the attribute Key conforming to the // "pprof.mapping.has_line_numbers" semantic conventions. It represents the // indicates that there are line numbers related to this mapping. // // Type: boolean // RequirementLevel: Recommended // Stability: Development // // Examples: PprofMappingHasLineNumbersKey = attribute.Key("pprof.mapping.has_line_numbers") // PprofProfileCommentKey is the attribute Key conforming to the // "pprof.profile.comment" semantic conventions. It represents the free-form // text associated with the profile. This field should not be used to store any // machine-readable information, it is only for human-friendly content. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "hello world", "bazinga" PprofProfileCommentKey = attribute.Key("pprof.profile.comment") // PprofProfileDocURLKey is the attribute Key conforming to the // "pprof.profile.doc_url" semantic conventions. It represents the documentation // link for this profile type. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "http://pprof.example.com/cpu-profile.html" // Note: The URL must be absolute and may be missing if the profile was // generated by code that did not supply a link PprofProfileDocURLKey = attribute.Key("pprof.profile.doc_url") // PprofProfileDropFramesKey is the attribute Key conforming to the // "pprof.profile.drop_frames" semantic conventions. It represents the frames // with Function.function_name fully matching the regexp will be dropped from // the samples, along with their successors. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "/foobar/" PprofProfileDropFramesKey = attribute.Key("pprof.profile.drop_frames") // PprofProfileKeepFramesKey is the attribute Key conforming to the // "pprof.profile.keep_frames" semantic conventions. It represents the frames // with Function.function_name fully matching the regexp will be kept, even if // it matches drop_frames. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "/bazinga/" PprofProfileKeepFramesKey = attribute.Key("pprof.profile.keep_frames") ) // PprofLocationIsFolded returns an attribute KeyValue conforming to the // "pprof.location.is_folded" semantic conventions. It represents the provides an // indication that multiple symbols map to this location's address, for example // due to identical code folding by the linker. In that case the line information // represents one of the multiple symbols. This field must be recomputed when the // symbolization state of the profile changes. func PprofLocationIsFolded(val bool) attribute.KeyValue { return PprofLocationIsFoldedKey.Bool(val) } // PprofMappingHasFilenames returns an attribute KeyValue conforming to the // "pprof.mapping.has_filenames" semantic conventions. It represents the // indicates that there are filenames related to this mapping. func PprofMappingHasFilenames(val bool) attribute.KeyValue { return PprofMappingHasFilenamesKey.Bool(val) } // PprofMappingHasFunctions returns an attribute KeyValue conforming to the // "pprof.mapping.has_functions" semantic conventions. It represents the // indicates that there are functions related to this mapping. func PprofMappingHasFunctions(val bool) attribute.KeyValue { return PprofMappingHasFunctionsKey.Bool(val) } // PprofMappingHasInlineFrames returns an attribute KeyValue conforming to the // "pprof.mapping.has_inline_frames" semantic conventions. It represents the // indicates that there are inline frames related to this mapping. func PprofMappingHasInlineFrames(val bool) attribute.KeyValue { return PprofMappingHasInlineFramesKey.Bool(val) } // PprofMappingHasLineNumbers returns an attribute KeyValue conforming to the // "pprof.mapping.has_line_numbers" semantic conventions. It represents the // indicates that there are line numbers related to this mapping. func PprofMappingHasLineNumbers(val bool) attribute.KeyValue { return PprofMappingHasLineNumbersKey.Bool(val) } // PprofProfileComment returns an attribute KeyValue conforming to the // "pprof.profile.comment" semantic conventions. It represents the free-form text // associated with the profile. This field should not be used to store any // machine-readable information, it is only for human-friendly content. func PprofProfileComment(val ...string) attribute.KeyValue { return PprofProfileCommentKey.StringSlice(val) } // PprofProfileDocURL returns an attribute KeyValue conforming to the // "pprof.profile.doc_url" semantic conventions. It represents the documentation // link for this profile type. func PprofProfileDocURL(val string) attribute.KeyValue { return PprofProfileDocURLKey.String(val) } // PprofProfileDropFrames returns an attribute KeyValue conforming to the // "pprof.profile.drop_frames" semantic conventions. It represents the frames // with Function.function_name fully matching the regexp will be dropped from the // samples, along with their successors. func PprofProfileDropFrames(val string) attribute.KeyValue { return PprofProfileDropFramesKey.String(val) } // PprofProfileKeepFrames returns an attribute KeyValue conforming to the // "pprof.profile.keep_frames" semantic conventions. It represents the frames // with Function.function_name fully matching the regexp will be kept, even if it // matches drop_frames. func PprofProfileKeepFrames(val string) attribute.KeyValue { return PprofProfileKeepFramesKey.String(val) } // Namespace: process const ( // ProcessArgsCountKey is the attribute Key conforming to the // "process.args_count" semantic conventions. It represents the length of the // process.command_args array. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 4 // Note: This field can be useful for querying or performing bucket analysis on // how many arguments were provided to start a process. More arguments may be an // indication of suspicious activity. ProcessArgsCountKey = attribute.Key("process.args_count") // ProcessCommandKey is the attribute Key conforming to the "process.command" // semantic conventions. It represents the command used to launch the process // (i.e. the command name). On Linux based systems, can be set to the zeroth // string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter // extracted from `GetCommandLineW`. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "cmd/otelcol" ProcessCommandKey = attribute.Key("process.command") // ProcessCommandArgsKey is the attribute Key conforming to the // "process.command_args" semantic conventions. It represents the all the // command arguments (including the command/executable itself) as received by // the process. On Linux-based systems (and some other Unixoid systems // supporting procfs), can be set according to the list of null-delimited // strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this // would be the full argv vector passed to `main`. SHOULD NOT be collected by // default unless there is sanitization that excludes sensitive data. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "cmd/otecol", "--config=config.yaml" ProcessCommandArgsKey = attribute.Key("process.command_args") // ProcessCommandLineKey is the attribute Key conforming to the // "process.command_line" semantic conventions. It represents the full command // used to launch the process as a single string representing the full command. // On Windows, can be set to the result of `GetCommandLineW`. Do not set this if // you have to assemble it just for monitoring; use `process.command_args` // instead. SHOULD NOT be collected by default unless there is sanitization that // excludes sensitive data. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "C:\cmd\otecol --config="my directory\config.yaml"" ProcessCommandLineKey = attribute.Key("process.command_line") // ProcessContextSwitchTypeKey is the attribute Key conforming to the // "process.context_switch.type" semantic conventions. It represents the // specifies whether the context switches for this data point were voluntary or // involuntary. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: ProcessContextSwitchTypeKey = attribute.Key("process.context_switch.type") // ProcessCreationTimeKey is the attribute Key conforming to the // "process.creation.time" semantic conventions. It represents the date and time // the process was created, in ISO 8601 format. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "2023-11-21T09:25:34.853Z" ProcessCreationTimeKey = attribute.Key("process.creation.time") // ProcessExecutableBuildIDGNUKey is the attribute Key conforming to the // "process.executable.build_id.gnu" semantic conventions. It represents the GNU // build ID as found in the `.note.gnu.build-id` ELF section (hex string). // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "c89b11207f6479603b0d49bf291c092c2b719293" ProcessExecutableBuildIDGNUKey = attribute.Key("process.executable.build_id.gnu") // ProcessExecutableBuildIDGoKey is the attribute Key conforming to the // "process.executable.build_id.go" semantic conventions. It represents the Go // build ID as retrieved by `go tool buildid `. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: // "foh3mEXu7BLZjsN9pOwG/kATcXlYVCDEFouRMQed_/WwRFB1hPo9LBkekthSPG/x8hMC8emW2cCjXD0_1aY" ProcessExecutableBuildIDGoKey = attribute.Key("process.executable.build_id.go") // ProcessExecutableBuildIDHtlhashKey is the attribute Key conforming to the // "process.executable.build_id.htlhash" semantic conventions. It represents the // profiling specific build ID for executables. See the OTel specification for // Profiles for more information. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "600DCAFE4A110000F2BF38C493F5FB92" ProcessExecutableBuildIDHtlhashKey = attribute.Key("process.executable.build_id.htlhash") // ProcessExecutableNameKey is the attribute Key conforming to the // "process.executable.name" semantic conventions. It represents the name of the // process executable. On Linux based systems, this SHOULD be set to the base // name of the target of `/proc/[pid]/exe`. On Windows, this SHOULD be set to // the base name of `GetProcessImageFileNameW`. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "otelcol" ProcessExecutableNameKey = attribute.Key("process.executable.name") // ProcessExecutablePathKey is the attribute Key conforming to the // "process.executable.path" semantic conventions. It represents the full path // to the process executable. On Linux based systems, can be set to the target // of `proc/[pid]/exe`. On Windows, can be set to the result of // `GetProcessImageFileNameW`. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "/usr/bin/cmd/otelcol" ProcessExecutablePathKey = attribute.Key("process.executable.path") // ProcessExitCodeKey is the attribute Key conforming to the "process.exit.code" // semantic conventions. It represents the exit code of the process. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 127 ProcessExitCodeKey = attribute.Key("process.exit.code") // ProcessExitTimeKey is the attribute Key conforming to the "process.exit.time" // semantic conventions. It represents the date and time the process exited, in // ISO 8601 format. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "2023-11-21T09:26:12.315Z" ProcessExitTimeKey = attribute.Key("process.exit.time") // ProcessGroupLeaderPIDKey is the attribute Key conforming to the // "process.group_leader.pid" semantic conventions. It represents the PID of the // process's group leader. This is also the process group ID (PGID) of the // process. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 23 ProcessGroupLeaderPIDKey = attribute.Key("process.group_leader.pid") // ProcessInteractiveKey is the attribute Key conforming to the // "process.interactive" semantic conventions. It represents the whether the // process is connected to an interactive shell. // // Type: boolean // RequirementLevel: Recommended // Stability: Development // // Examples: ProcessInteractiveKey = attribute.Key("process.interactive") // ProcessLinuxCgroupKey is the attribute Key conforming to the // "process.linux.cgroup" semantic conventions. It represents the control group // associated with the process. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "1:name=systemd:/user.slice/user-1000.slice/session-3.scope", // "0::/user.slice/user-1000.slice/user@1000.service/tmux-spawn-0267755b-4639-4a27-90ed-f19f88e53748.scope" // Note: Control groups (cgroups) are a kernel feature used to organize and // manage process resources. This attribute provides the path(s) to the // cgroup(s) associated with the process, which should match the contents of the // [/proc/[PID]/cgroup] file. // // [/proc/[PID]/cgroup]: https://man7.org/linux/man-pages/man7/cgroups.7.html ProcessLinuxCgroupKey = attribute.Key("process.linux.cgroup") // ProcessOwnerKey is the attribute Key conforming to the "process.owner" // semantic conventions. It represents the username of the user that owns the // process. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "root" ProcessOwnerKey = attribute.Key("process.owner") // ProcessParentPIDKey is the attribute Key conforming to the // "process.parent_pid" semantic conventions. It represents the parent Process // identifier (PPID). // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 111 ProcessParentPIDKey = attribute.Key("process.parent_pid") // ProcessPIDKey is the attribute Key conforming to the "process.pid" semantic // conventions. It represents the process identifier (PID). // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 1234 ProcessPIDKey = attribute.Key("process.pid") // ProcessRealUserIDKey is the attribute Key conforming to the // "process.real_user.id" semantic conventions. It represents the real user ID // (RUID) of the process. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 1000 ProcessRealUserIDKey = attribute.Key("process.real_user.id") // ProcessRealUserNameKey is the attribute Key conforming to the // "process.real_user.name" semantic conventions. It represents the username of // the real user of the process. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "operator" ProcessRealUserNameKey = attribute.Key("process.real_user.name") // ProcessRuntimeDescriptionKey is the attribute Key conforming to the // "process.runtime.description" semantic conventions. It represents an // additional description about the runtime of the process, for example a // specific vendor customization of the runtime environment. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0 ProcessRuntimeDescriptionKey = attribute.Key("process.runtime.description") // ProcessRuntimeNameKey is the attribute Key conforming to the // "process.runtime.name" semantic conventions. It represents the name of the // runtime of this process. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "OpenJDK Runtime Environment" ProcessRuntimeNameKey = attribute.Key("process.runtime.name") // ProcessRuntimeVersionKey is the attribute Key conforming to the // "process.runtime.version" semantic conventions. It represents the version of // the runtime of this process, as returned by the runtime without modification. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: 14.0.2 ProcessRuntimeVersionKey = attribute.Key("process.runtime.version") // ProcessSavedUserIDKey is the attribute Key conforming to the // "process.saved_user.id" semantic conventions. It represents the saved user ID // (SUID) of the process. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 1002 ProcessSavedUserIDKey = attribute.Key("process.saved_user.id") // ProcessSavedUserNameKey is the attribute Key conforming to the // "process.saved_user.name" semantic conventions. It represents the username of // the saved user. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "operator" ProcessSavedUserNameKey = attribute.Key("process.saved_user.name") // ProcessSessionLeaderPIDKey is the attribute Key conforming to the // "process.session_leader.pid" semantic conventions. It represents the PID of // the process's session leader. This is also the session ID (SID) of the // process. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 14 ProcessSessionLeaderPIDKey = attribute.Key("process.session_leader.pid") // ProcessStateKey is the attribute Key conforming to the "process.state" // semantic conventions. It represents the process state, e.g., // [Linux Process State Codes]. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "running" // // [Linux Process State Codes]: https://man7.org/linux/man-pages/man1/ps.1.html#PROCESS_STATE_CODES ProcessStateKey = attribute.Key("process.state") // ProcessTitleKey is the attribute Key conforming to the "process.title" // semantic conventions. It represents the process title (proctitle). // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "cat /etc/hostname", "xfce4-session", "bash" // Note: In many Unix-like systems, process title (proctitle), is the string // that represents the name or command line of a running process, displayed by // system monitoring tools like ps, top, and htop. ProcessTitleKey = attribute.Key("process.title") // ProcessUserIDKey is the attribute Key conforming to the "process.user.id" // semantic conventions. It represents the effective user ID (EUID) of the // process. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 1001 ProcessUserIDKey = attribute.Key("process.user.id") // ProcessUserNameKey is the attribute Key conforming to the "process.user.name" // semantic conventions. It represents the username of the effective user of the // process. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "root" ProcessUserNameKey = attribute.Key("process.user.name") // ProcessVpidKey is the attribute Key conforming to the "process.vpid" semantic // conventions. It represents the virtual process identifier. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 12 // Note: The process ID within a PID namespace. This is not necessarily unique // across all processes on the host but it is unique within the process // namespace that the process exists within. ProcessVpidKey = attribute.Key("process.vpid") // ProcessWorkingDirectoryKey is the attribute Key conforming to the // "process.working_directory" semantic conventions. It represents the working // directory of the process. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "/root" ProcessWorkingDirectoryKey = attribute.Key("process.working_directory") ) // ProcessArgsCount returns an attribute KeyValue conforming to the // "process.args_count" semantic conventions. It represents the length of the // process.command_args array. func ProcessArgsCount(val int) attribute.KeyValue { return ProcessArgsCountKey.Int(val) } // ProcessCommand returns an attribute KeyValue conforming to the // "process.command" semantic conventions. It represents the command used to // launch the process (i.e. the command name). On Linux based systems, can be set // to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the // first parameter extracted from `GetCommandLineW`. func ProcessCommand(val string) attribute.KeyValue { return ProcessCommandKey.String(val) } // ProcessCommandArgs returns an attribute KeyValue conforming to the // "process.command_args" semantic conventions. It represents the all the command // arguments (including the command/executable itself) as received by the // process. On Linux-based systems (and some other Unixoid systems supporting // procfs), can be set according to the list of null-delimited strings extracted // from `proc/[pid]/cmdline`. For libc-based executables, this would be the full // argv vector passed to `main`. SHOULD NOT be collected by default unless there // is sanitization that excludes sensitive data. func ProcessCommandArgs(val ...string) attribute.KeyValue { return ProcessCommandArgsKey.StringSlice(val) } // ProcessCommandLine returns an attribute KeyValue conforming to the // "process.command_line" semantic conventions. It represents the full command // used to launch the process as a single string representing the full command. // On Windows, can be set to the result of `GetCommandLineW`. Do not set this if // you have to assemble it just for monitoring; use `process.command_args` // instead. SHOULD NOT be collected by default unless there is sanitization that // excludes sensitive data. func ProcessCommandLine(val string) attribute.KeyValue { return ProcessCommandLineKey.String(val) } // ProcessCreationTime returns an attribute KeyValue conforming to the // "process.creation.time" semantic conventions. It represents the date and time // the process was created, in ISO 8601 format. func ProcessCreationTime(val string) attribute.KeyValue { return ProcessCreationTimeKey.String(val) } // ProcessEnvironmentVariable returns an attribute KeyValue conforming to the // "process.environment_variable" semantic conventions. It represents the process // environment variables, `` being the environment variable name, the value // being the environment variable value. func ProcessEnvironmentVariable(key string, val string) attribute.KeyValue { return attribute.String("process.environment_variable."+key, val) } // ProcessExecutableBuildIDGNU returns an attribute KeyValue conforming to the // "process.executable.build_id.gnu" semantic conventions. It represents the GNU // build ID as found in the `.note.gnu.build-id` ELF section (hex string). func ProcessExecutableBuildIDGNU(val string) attribute.KeyValue { return ProcessExecutableBuildIDGNUKey.String(val) } // ProcessExecutableBuildIDGo returns an attribute KeyValue conforming to the // "process.executable.build_id.go" semantic conventions. It represents the Go // build ID as retrieved by `go tool buildid `. func ProcessExecutableBuildIDGo(val string) attribute.KeyValue { return ProcessExecutableBuildIDGoKey.String(val) } // ProcessExecutableBuildIDHtlhash returns an attribute KeyValue conforming to // the "process.executable.build_id.htlhash" semantic conventions. It represents // the profiling specific build ID for executables. See the OTel specification // for Profiles for more information. func ProcessExecutableBuildIDHtlhash(val string) attribute.KeyValue { return ProcessExecutableBuildIDHtlhashKey.String(val) } // ProcessExecutableName returns an attribute KeyValue conforming to the // "process.executable.name" semantic conventions. It represents the name of the // process executable. On Linux based systems, this SHOULD be set to the base // name of the target of `/proc/[pid]/exe`. On Windows, this SHOULD be set to the // base name of `GetProcessImageFileNameW`. func ProcessExecutableName(val string) attribute.KeyValue { return ProcessExecutableNameKey.String(val) } // ProcessExecutablePath returns an attribute KeyValue conforming to the // "process.executable.path" semantic conventions. It represents the full path to // the process executable. On Linux based systems, can be set to the target of // `proc/[pid]/exe`. On Windows, can be set to the result of // `GetProcessImageFileNameW`. func ProcessExecutablePath(val string) attribute.KeyValue { return ProcessExecutablePathKey.String(val) } // ProcessExitCode returns an attribute KeyValue conforming to the // "process.exit.code" semantic conventions. It represents the exit code of the // process. func ProcessExitCode(val int) attribute.KeyValue { return ProcessExitCodeKey.Int(val) } // ProcessExitTime returns an attribute KeyValue conforming to the // "process.exit.time" semantic conventions. It represents the date and time the // process exited, in ISO 8601 format. func ProcessExitTime(val string) attribute.KeyValue { return ProcessExitTimeKey.String(val) } // ProcessGroupLeaderPID returns an attribute KeyValue conforming to the // "process.group_leader.pid" semantic conventions. It represents the PID of the // process's group leader. This is also the process group ID (PGID) of the // process. func ProcessGroupLeaderPID(val int) attribute.KeyValue { return ProcessGroupLeaderPIDKey.Int(val) } // ProcessInteractive returns an attribute KeyValue conforming to the // "process.interactive" semantic conventions. It represents the whether the // process is connected to an interactive shell. func ProcessInteractive(val bool) attribute.KeyValue { return ProcessInteractiveKey.Bool(val) } // ProcessLinuxCgroup returns an attribute KeyValue conforming to the // "process.linux.cgroup" semantic conventions. It represents the control group // associated with the process. func ProcessLinuxCgroup(val string) attribute.KeyValue { return ProcessLinuxCgroupKey.String(val) } // ProcessOwner returns an attribute KeyValue conforming to the "process.owner" // semantic conventions. It represents the username of the user that owns the // process. func ProcessOwner(val string) attribute.KeyValue { return ProcessOwnerKey.String(val) } // ProcessParentPID returns an attribute KeyValue conforming to the // "process.parent_pid" semantic conventions. It represents the parent Process // identifier (PPID). func ProcessParentPID(val int) attribute.KeyValue { return ProcessParentPIDKey.Int(val) } // ProcessPID returns an attribute KeyValue conforming to the "process.pid" // semantic conventions. It represents the process identifier (PID). func ProcessPID(val int) attribute.KeyValue { return ProcessPIDKey.Int(val) } // ProcessRealUserID returns an attribute KeyValue conforming to the // "process.real_user.id" semantic conventions. It represents the real user ID // (RUID) of the process. func ProcessRealUserID(val int) attribute.KeyValue { return ProcessRealUserIDKey.Int(val) } // ProcessRealUserName returns an attribute KeyValue conforming to the // "process.real_user.name" semantic conventions. It represents the username of // the real user of the process. func ProcessRealUserName(val string) attribute.KeyValue { return ProcessRealUserNameKey.String(val) } // ProcessRuntimeDescription returns an attribute KeyValue conforming to the // "process.runtime.description" semantic conventions. It represents an // additional description about the runtime of the process, for example a // specific vendor customization of the runtime environment. func ProcessRuntimeDescription(val string) attribute.KeyValue { return ProcessRuntimeDescriptionKey.String(val) } // ProcessRuntimeName returns an attribute KeyValue conforming to the // "process.runtime.name" semantic conventions. It represents the name of the // runtime of this process. func ProcessRuntimeName(val string) attribute.KeyValue { return ProcessRuntimeNameKey.String(val) } // ProcessRuntimeVersion returns an attribute KeyValue conforming to the // "process.runtime.version" semantic conventions. It represents the version of // the runtime of this process, as returned by the runtime without modification. func ProcessRuntimeVersion(val string) attribute.KeyValue { return ProcessRuntimeVersionKey.String(val) } // ProcessSavedUserID returns an attribute KeyValue conforming to the // "process.saved_user.id" semantic conventions. It represents the saved user ID // (SUID) of the process. func ProcessSavedUserID(val int) attribute.KeyValue { return ProcessSavedUserIDKey.Int(val) } // ProcessSavedUserName returns an attribute KeyValue conforming to the // "process.saved_user.name" semantic conventions. It represents the username of // the saved user. func ProcessSavedUserName(val string) attribute.KeyValue { return ProcessSavedUserNameKey.String(val) } // ProcessSessionLeaderPID returns an attribute KeyValue conforming to the // "process.session_leader.pid" semantic conventions. It represents the PID of // the process's session leader. This is also the session ID (SID) of the // process. func ProcessSessionLeaderPID(val int) attribute.KeyValue { return ProcessSessionLeaderPIDKey.Int(val) } // ProcessTitle returns an attribute KeyValue conforming to the "process.title" // semantic conventions. It represents the process title (proctitle). func ProcessTitle(val string) attribute.KeyValue { return ProcessTitleKey.String(val) } // ProcessUserID returns an attribute KeyValue conforming to the // "process.user.id" semantic conventions. It represents the effective user ID // (EUID) of the process. func ProcessUserID(val int) attribute.KeyValue { return ProcessUserIDKey.Int(val) } // ProcessUserName returns an attribute KeyValue conforming to the // "process.user.name" semantic conventions. It represents the username of the // effective user of the process. func ProcessUserName(val string) attribute.KeyValue { return ProcessUserNameKey.String(val) } // ProcessVpid returns an attribute KeyValue conforming to the "process.vpid" // semantic conventions. It represents the virtual process identifier. func ProcessVpid(val int) attribute.KeyValue { return ProcessVpidKey.Int(val) } // ProcessWorkingDirectory returns an attribute KeyValue conforming to the // "process.working_directory" semantic conventions. It represents the working // directory of the process. func ProcessWorkingDirectory(val string) attribute.KeyValue { return ProcessWorkingDirectoryKey.String(val) } // Enum values for process.context_switch.type var ( // voluntary // Stability: development ProcessContextSwitchTypeVoluntary = ProcessContextSwitchTypeKey.String("voluntary") // involuntary // Stability: development ProcessContextSwitchTypeInvoluntary = ProcessContextSwitchTypeKey.String("involuntary") ) // Enum values for process.state var ( // running // Stability: development ProcessStateRunning = ProcessStateKey.String("running") // sleeping // Stability: development ProcessStateSleeping = ProcessStateKey.String("sleeping") // stopped // Stability: development ProcessStateStopped = ProcessStateKey.String("stopped") // defunct // Stability: development ProcessStateDefunct = ProcessStateKey.String("defunct") ) // Namespace: profile const ( // ProfileFrameTypeKey is the attribute Key conforming to the // "profile.frame.type" semantic conventions. It represents the describes the // interpreter or compiler of a single frame. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "cpython" ProfileFrameTypeKey = attribute.Key("profile.frame.type") ) // Enum values for profile.frame.type var ( // [.NET] // // Stability: development // // [.NET]: https://wikipedia.org/wiki/.NET ProfileFrameTypeDotnet = ProfileFrameTypeKey.String("dotnet") // [JVM] // // Stability: development // // [JVM]: https://wikipedia.org/wiki/Java_virtual_machine ProfileFrameTypeJVM = ProfileFrameTypeKey.String("jvm") // [Kernel] // // Stability: development // // [Kernel]: https://wikipedia.org/wiki/Kernel_(operating_system) ProfileFrameTypeKernel = ProfileFrameTypeKey.String("kernel") // Can be one of but not limited to [C], [C++], [Go] or [Rust]. If possible, a // more precise value MUST be used. // // Stability: development // // [C]: https://wikipedia.org/wiki/C_(programming_language) // [C++]: https://wikipedia.org/wiki/C%2B%2B // [Go]: https://wikipedia.org/wiki/Go_(programming_language) // [Rust]: https://wikipedia.org/wiki/Rust_(programming_language) ProfileFrameTypeNative = ProfileFrameTypeKey.String("native") // [Perl] // // Stability: development // // [Perl]: https://wikipedia.org/wiki/Perl ProfileFrameTypePerl = ProfileFrameTypeKey.String("perl") // [PHP] // // Stability: development // // [PHP]: https://wikipedia.org/wiki/PHP ProfileFrameTypePHP = ProfileFrameTypeKey.String("php") // [Python] // // Stability: development // // [Python]: https://wikipedia.org/wiki/Python_(programming_language) ProfileFrameTypeCpython = ProfileFrameTypeKey.String("cpython") // [Ruby] // // Stability: development // // [Ruby]: https://wikipedia.org/wiki/Ruby_(programming_language) ProfileFrameTypeRuby = ProfileFrameTypeKey.String("ruby") // [V8JS] // // Stability: development // // [V8JS]: https://wikipedia.org/wiki/V8_(JavaScript_engine) ProfileFrameTypeV8JS = ProfileFrameTypeKey.String("v8js") // [Erlang] // // Stability: development // // [Erlang]: https://en.wikipedia.org/wiki/BEAM_(Erlang_virtual_machine) ProfileFrameTypeBeam = ProfileFrameTypeKey.String("beam") // [Go], // // Stability: development // // [Go]: https://wikipedia.org/wiki/Go_(programming_language) ProfileFrameTypeGo = ProfileFrameTypeKey.String("go") // [Rust] // // Stability: development // // [Rust]: https://wikipedia.org/wiki/Rust_(programming_language) ProfileFrameTypeRust = ProfileFrameTypeKey.String("rust") ) // Namespace: rpc const ( // RPCMessageCompressedSizeKey is the attribute Key conforming to the // "rpc.message.compressed_size" semantic conventions. It represents the // compressed size of the message in bytes. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: RPCMessageCompressedSizeKey = attribute.Key("rpc.message.compressed_size") // RPCMessageIDKey is the attribute Key conforming to the "rpc.message.id" // semantic conventions. It MUST be calculated as two different counters // starting from `1` one for sent messages and one for received message.. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: // Note: This way we guarantee that the values will be consistent between // different implementations. RPCMessageIDKey = attribute.Key("rpc.message.id") // RPCMessageTypeKey is the attribute Key conforming to the "rpc.message.type" // semantic conventions. It represents the whether this is a received or sent // message. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: RPCMessageTypeKey = attribute.Key("rpc.message.type") // RPCMessageUncompressedSizeKey is the attribute Key conforming to the // "rpc.message.uncompressed_size" semantic conventions. It represents the // uncompressed size of the message in bytes. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: RPCMessageUncompressedSizeKey = attribute.Key("rpc.message.uncompressed_size") // RPCMethodKey is the attribute Key conforming to the "rpc.method" semantic // conventions. It represents the fully-qualified logical name of the method // from the RPC interface perspective. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "com.example.ExampleService/exampleMethod", "EchoService/Echo", // "_OTHER" // Note: The method name MAY have unbounded cardinality in edge or error cases. // // Some RPC frameworks or libraries provide a fixed set of recognized methods // for client stubs and server implementations. Instrumentations for such // frameworks MUST set this attribute to the original method name only // when the method is recognized by the framework or library. // // When the method is not recognized, for example, when the server receives // a request for a method that is not predefined on the server, or when // instrumentation is not able to reliably detect if the method is predefined, // the attribute MUST be set to `_OTHER`. In such cases, tracing // instrumentations MUST also set `rpc.method_original` attribute to // the original method value. // // If the RPC instrumentation could end up converting valid RPC methods to // `_OTHER`, then it SHOULD provide a way to configure the list of recognized // RPC methods. // // The `rpc.method` can be different from the name of any implementing // method/function. // The `code.function.name` attribute may be used to record the fully-qualified // method actually executing the call on the server side, or the // RPC client stub method on the client side. RPCMethodKey = attribute.Key("rpc.method") // RPCMethodOriginalKey is the attribute Key conforming to the // "rpc.method_original" semantic conventions. It represents the original name // of the method used by the client. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "com.myservice.EchoService/catchAll", // "com.myservice.EchoService/unknownMethod", "InvalidMethod" RPCMethodOriginalKey = attribute.Key("rpc.method_original") // RPCResponseStatusCodeKey is the attribute Key conforming to the // "rpc.response.status_code" semantic conventions. It represents the status // code of the RPC returned by the RPC server or generated by the client. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "OK", "DEADLINE_EXCEEDED", "-32602" // Note: Usually it represents an error code, but may also represent partial // success, warning, or differentiate between various types of successful // outcomes. // Semantic conventions for individual RPC frameworks SHOULD document what // `rpc.response.status_code` means in the context of that system and which // values are considered to represent errors. RPCResponseStatusCodeKey = attribute.Key("rpc.response.status_code") // RPCSystemNameKey is the attribute Key conforming to the "rpc.system.name" // semantic conventions. It represents the Remote Procedure Call (RPC) system. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // Note: The client and server RPC systems may differ for the same RPC // interaction. For example, a client may use Apache Dubbo or Connect RPC to // communicate with a server that uses gRPC since both protocols provide // compatibility with gRPC. RPCSystemNameKey = attribute.Key("rpc.system.name") ) // RPCMessageCompressedSize returns an attribute KeyValue conforming to the // "rpc.message.compressed_size" semantic conventions. It represents the // compressed size of the message in bytes. func RPCMessageCompressedSize(val int) attribute.KeyValue { return RPCMessageCompressedSizeKey.Int(val) } // RPCMessageID returns an attribute KeyValue conforming to the "rpc.message.id" // semantic conventions. It MUST be calculated as two different counters starting // from `1` one for sent messages and one for received message.. func RPCMessageID(val int) attribute.KeyValue { return RPCMessageIDKey.Int(val) } // RPCMessageUncompressedSize returns an attribute KeyValue conforming to the // "rpc.message.uncompressed_size" semantic conventions. It represents the // uncompressed size of the message in bytes. func RPCMessageUncompressedSize(val int) attribute.KeyValue { return RPCMessageUncompressedSizeKey.Int(val) } // RPCMethod returns an attribute KeyValue conforming to the "rpc.method" // semantic conventions. It represents the fully-qualified logical name of the // method from the RPC interface perspective. func RPCMethod(val string) attribute.KeyValue { return RPCMethodKey.String(val) } // RPCMethodOriginal returns an attribute KeyValue conforming to the // "rpc.method_original" semantic conventions. It represents the original name of // the method used by the client. func RPCMethodOriginal(val string) attribute.KeyValue { return RPCMethodOriginalKey.String(val) } // RPCRequestMetadata returns an attribute KeyValue conforming to the // "rpc.request.metadata" semantic conventions. It represents the RPC request // metadata, `` being the normalized RPC metadata key (lowercase), the value // being the metadata values. func RPCRequestMetadata(key string, val ...string) attribute.KeyValue { return attribute.StringSlice("rpc.request.metadata."+key, val) } // RPCResponseMetadata returns an attribute KeyValue conforming to the // "rpc.response.metadata" semantic conventions. It represents the RPC response // metadata, `` being the normalized RPC metadata key (lowercase), the value // being the metadata values. func RPCResponseMetadata(key string, val ...string) attribute.KeyValue { return attribute.StringSlice("rpc.response.metadata."+key, val) } // RPCResponseStatusCode returns an attribute KeyValue conforming to the // "rpc.response.status_code" semantic conventions. It represents the status code // of the RPC returned by the RPC server or generated by the client. func RPCResponseStatusCode(val string) attribute.KeyValue { return RPCResponseStatusCodeKey.String(val) } // Enum values for rpc.message.type var ( // sent // Stability: development RPCMessageTypeSent = RPCMessageTypeKey.String("SENT") // received // Stability: development RPCMessageTypeReceived = RPCMessageTypeKey.String("RECEIVED") ) // Enum values for rpc.system.name var ( // [gRPC] // Stability: development // // [gRPC]: https://grpc.io/ RPCSystemNameGRPC = RPCSystemNameKey.String("grpc") // [Apache Dubbo] // Stability: development // // [Apache Dubbo]: https://dubbo.apache.org/ RPCSystemNameDubbo = RPCSystemNameKey.String("dubbo") // [Connect RPC] // Stability: development // // [Connect RPC]: https://connectrpc.com/ RPCSystemNameConnectrpc = RPCSystemNameKey.String("connectrpc") // [JSON-RPC] // Stability: development // // [JSON-RPC]: https://www.jsonrpc.org/ RPCSystemNameJSONRPC = RPCSystemNameKey.String("jsonrpc") ) // Namespace: security_rule const ( // SecurityRuleCategoryKey is the attribute Key conforming to the // "security_rule.category" semantic conventions. It represents a categorization // value keyword used by the entity using the rule for detection of this event. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Attempted Information Leak" SecurityRuleCategoryKey = attribute.Key("security_rule.category") // SecurityRuleDescriptionKey is the attribute Key conforming to the // "security_rule.description" semantic conventions. It represents the // description of the rule generating the event. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Block requests to public DNS over HTTPS / TLS protocols" SecurityRuleDescriptionKey = attribute.Key("security_rule.description") // SecurityRuleLicenseKey is the attribute Key conforming to the // "security_rule.license" semantic conventions. It represents the name of the // license under which the rule used to generate this event is made available. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Apache 2.0" SecurityRuleLicenseKey = attribute.Key("security_rule.license") // SecurityRuleNameKey is the attribute Key conforming to the // "security_rule.name" semantic conventions. It represents the name of the rule // or signature generating the event. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "BLOCK_DNS_over_TLS" SecurityRuleNameKey = attribute.Key("security_rule.name") // SecurityRuleReferenceKey is the attribute Key conforming to the // "security_rule.reference" semantic conventions. It represents the reference // URL to additional information about the rule used to generate this event. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "https://en.wikipedia.org/wiki/DNS_over_TLS" // Note: The URL can point to the vendor’s documentation about the rule. If // that’s not available, it can also be a link to a more general page // describing this type of alert. SecurityRuleReferenceKey = attribute.Key("security_rule.reference") // SecurityRuleRulesetNameKey is the attribute Key conforming to the // "security_rule.ruleset.name" semantic conventions. It represents the name of // the ruleset, policy, group, or parent category in which the rule used to // generate this event is a member. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Standard_Protocol_Filters" SecurityRuleRulesetNameKey = attribute.Key("security_rule.ruleset.name") // SecurityRuleUUIDKey is the attribute Key conforming to the // "security_rule.uuid" semantic conventions. It represents a rule ID that is // unique within the scope of a set or group of agents, observers, or other // entities using the rule for detection of this event. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "550e8400-e29b-41d4-a716-446655440000", "1100110011" SecurityRuleUUIDKey = attribute.Key("security_rule.uuid") // SecurityRuleVersionKey is the attribute Key conforming to the // "security_rule.version" semantic conventions. It represents the version / // revision of the rule being used for analysis. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "1.0.0" SecurityRuleVersionKey = attribute.Key("security_rule.version") ) // SecurityRuleCategory returns an attribute KeyValue conforming to the // "security_rule.category" semantic conventions. It represents a categorization // value keyword used by the entity using the rule for detection of this event. func SecurityRuleCategory(val string) attribute.KeyValue { return SecurityRuleCategoryKey.String(val) } // SecurityRuleDescription returns an attribute KeyValue conforming to the // "security_rule.description" semantic conventions. It represents the // description of the rule generating the event. func SecurityRuleDescription(val string) attribute.KeyValue { return SecurityRuleDescriptionKey.String(val) } // SecurityRuleLicense returns an attribute KeyValue conforming to the // "security_rule.license" semantic conventions. It represents the name of the // license under which the rule used to generate this event is made available. func SecurityRuleLicense(val string) attribute.KeyValue { return SecurityRuleLicenseKey.String(val) } // SecurityRuleName returns an attribute KeyValue conforming to the // "security_rule.name" semantic conventions. It represents the name of the rule // or signature generating the event. func SecurityRuleName(val string) attribute.KeyValue { return SecurityRuleNameKey.String(val) } // SecurityRuleReference returns an attribute KeyValue conforming to the // "security_rule.reference" semantic conventions. It represents the reference // URL to additional information about the rule used to generate this event. func SecurityRuleReference(val string) attribute.KeyValue { return SecurityRuleReferenceKey.String(val) } // SecurityRuleRulesetName returns an attribute KeyValue conforming to the // "security_rule.ruleset.name" semantic conventions. It represents the name of // the ruleset, policy, group, or parent category in which the rule used to // generate this event is a member. func SecurityRuleRulesetName(val string) attribute.KeyValue { return SecurityRuleRulesetNameKey.String(val) } // SecurityRuleUUID returns an attribute KeyValue conforming to the // "security_rule.uuid" semantic conventions. It represents a rule ID that is // unique within the scope of a set or group of agents, observers, or other // entities using the rule for detection of this event. func SecurityRuleUUID(val string) attribute.KeyValue { return SecurityRuleUUIDKey.String(val) } // SecurityRuleVersion returns an attribute KeyValue conforming to the // "security_rule.version" semantic conventions. It represents the version / // revision of the rule being used for analysis. func SecurityRuleVersion(val string) attribute.KeyValue { return SecurityRuleVersionKey.String(val) } // Namespace: server const ( // ServerAddressKey is the attribute Key conforming to the "server.address" // semantic conventions. It represents the server domain name if available // without reverse DNS lookup; otherwise, IP address or Unix domain socket name. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "example.com", "10.1.2.80", "/tmp/my.sock" // Note: When observed from the client side, and when communicating through an // intermediary, `server.address` SHOULD represent the server address behind any // intermediaries, for example proxies, if it's available. ServerAddressKey = attribute.Key("server.address") // ServerPortKey is the attribute Key conforming to the "server.port" semantic // conventions. It represents the server port number. // // Type: int // RequirementLevel: Recommended // Stability: Stable // // Examples: 80, 8080, 443 // Note: When observed from the client side, and when communicating through an // intermediary, `server.port` SHOULD represent the server port behind any // intermediaries, for example proxies, if it's available. ServerPortKey = attribute.Key("server.port") ) // ServerAddress returns an attribute KeyValue conforming to the "server.address" // semantic conventions. It represents the server domain name if available // without reverse DNS lookup; otherwise, IP address or Unix domain socket name. func ServerAddress(val string) attribute.KeyValue { return ServerAddressKey.String(val) } // ServerPort returns an attribute KeyValue conforming to the "server.port" // semantic conventions. It represents the server port number. func ServerPort(val int) attribute.KeyValue { return ServerPortKey.Int(val) } // Namespace: service const ( // ServiceInstanceIDKey is the attribute Key conforming to the // "service.instance.id" semantic conventions. It represents the string ID of // the service instance. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "627cc493-f310-47de-96bd-71410b7dec09" // Note: MUST be unique for each instance of the same // `service.namespace,service.name` pair (in other words // `service.namespace,service.name,service.instance.id` triplet MUST be globally // unique). The ID helps to // distinguish instances of the same service that exist at the same time (e.g. // instances of a horizontally scaled // service). // // Implementations, such as SDKs, are recommended to generate a random Version 1 // or Version 4 [RFC // 4122] UUID, but are free to use an inherent unique ID as // the source of // this value if stability is desirable. In that case, the ID SHOULD be used as // source of a UUID Version 5 and // SHOULD use the following UUID as the namespace: // `4d63009a-8d0f-11ee-aad7-4c796ed8e320`. // // UUIDs are typically recommended, as only an opaque value for the purposes of // identifying a service instance is // needed. Similar to what can be seen in the man page for the // [`/etc/machine-id`] file, the underlying // data, such as pod name and namespace should be treated as confidential, being // the user's choice to expose it // or not via another resource attribute. // // For applications running behind an application server (like unicorn), we do // not recommend using one identifier // for all processes participating in the application. Instead, it's recommended // each division (e.g. a worker // thread in unicorn) to have its own instance.id. // // It's not recommended for a Collector to set `service.instance.id` if it can't // unambiguously determine the // service instance that is generating that telemetry. For instance, creating an // UUID based on `pod.name` will // likely be wrong, as the Collector might not know from which container within // that pod the telemetry originated. // However, Collectors can set the `service.instance.id` if they can // unambiguously determine the service instance // for that telemetry. This is typically the case for scraping receivers, as // they know the target address and // port. // // [RFC // 4122]: https://www.ietf.org/rfc/rfc4122.txt // [`/etc/machine-id`]: https://www.freedesktop.org/software/systemd/man/latest/machine-id.html ServiceInstanceIDKey = attribute.Key("service.instance.id") // ServiceNameKey is the attribute Key conforming to the "service.name" semantic // conventions. It represents the logical name of the service. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "shoppingcart" // Note: MUST be the same for all instances of horizontally scaled services. If // the value was not specified, SDKs MUST fallback to `unknown_service:` // concatenated with [`process.executable.name`], e.g. `unknown_service:bash`. // If `process.executable.name` is not available, the value MUST be set to // `unknown_service`. // // [`process.executable.name`]: process.md ServiceNameKey = attribute.Key("service.name") // ServiceNamespaceKey is the attribute Key conforming to the // "service.namespace" semantic conventions. It represents a namespace for // `service.name`. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Shop" // Note: A string value having a meaning that helps to distinguish a group of // services, for example the team name that owns a group of services. // `service.name` is expected to be unique within the same namespace. If // `service.namespace` is not specified in the Resource then `service.name` is // expected to be unique for all services that have no explicit namespace // defined (so the empty/unspecified namespace is simply one more valid // namespace). Zero-length namespace string is assumed equal to unspecified // namespace. ServiceNamespaceKey = attribute.Key("service.namespace") // ServicePeerNameKey is the attribute Key conforming to the "service.peer.name" // semantic conventions. It represents the logical name of the service on the // other side of the connection. SHOULD be equal to the actual [`service.name`] // resource attribute of the remote service if any. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "shoppingcart" // // [`service.name`]: /docs/resource/README.md#service ServicePeerNameKey = attribute.Key("service.peer.name") // ServicePeerNamespaceKey is the attribute Key conforming to the // "service.peer.namespace" semantic conventions. It represents the logical // namespace of the service on the other side of the connection. SHOULD be equal // to the actual [`service.namespace`] resource attribute of the remote service // if any. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Shop" // // [`service.namespace`]: /docs/resource/README.md#service ServicePeerNamespaceKey = attribute.Key("service.peer.namespace") // ServiceVersionKey is the attribute Key conforming to the "service.version" // semantic conventions. It represents the version string of the service // component. The format is not defined by these conventions. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "2.0.0", "a01dbef8a" ServiceVersionKey = attribute.Key("service.version") ) // ServiceInstanceID returns an attribute KeyValue conforming to the // "service.instance.id" semantic conventions. It represents the string ID of the // service instance. func ServiceInstanceID(val string) attribute.KeyValue { return ServiceInstanceIDKey.String(val) } // ServiceName returns an attribute KeyValue conforming to the "service.name" // semantic conventions. It represents the logical name of the service. func ServiceName(val string) attribute.KeyValue { return ServiceNameKey.String(val) } // ServiceNamespace returns an attribute KeyValue conforming to the // "service.namespace" semantic conventions. It represents a namespace for // `service.name`. func ServiceNamespace(val string) attribute.KeyValue { return ServiceNamespaceKey.String(val) } // ServicePeerName returns an attribute KeyValue conforming to the // "service.peer.name" semantic conventions. It represents the logical name of // the service on the other side of the connection. SHOULD be equal to the actual // [`service.name`] resource attribute of the remote service if any. // // [`service.name`]: /docs/resource/README.md#service func ServicePeerName(val string) attribute.KeyValue { return ServicePeerNameKey.String(val) } // ServicePeerNamespace returns an attribute KeyValue conforming to the // "service.peer.namespace" semantic conventions. It represents the logical // namespace of the service on the other side of the connection. SHOULD be equal // to the actual [`service.namespace`] resource attribute of the remote service // if any. // // [`service.namespace`]: /docs/resource/README.md#service func ServicePeerNamespace(val string) attribute.KeyValue { return ServicePeerNamespaceKey.String(val) } // ServiceVersion returns an attribute KeyValue conforming to the // "service.version" semantic conventions. It represents the version string of // the service component. The format is not defined by these conventions. func ServiceVersion(val string) attribute.KeyValue { return ServiceVersionKey.String(val) } // Namespace: session const ( // SessionIDKey is the attribute Key conforming to the "session.id" semantic // conventions. It represents a unique id to identify a session. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: 00112233-4455-6677-8899-aabbccddeeff SessionIDKey = attribute.Key("session.id") // SessionPreviousIDKey is the attribute Key conforming to the // "session.previous_id" semantic conventions. It represents the previous // `session.id` for this user, when known. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: 00112233-4455-6677-8899-aabbccddeeff SessionPreviousIDKey = attribute.Key("session.previous_id") ) // SessionID returns an attribute KeyValue conforming to the "session.id" // semantic conventions. It represents a unique id to identify a session. func SessionID(val string) attribute.KeyValue { return SessionIDKey.String(val) } // SessionPreviousID returns an attribute KeyValue conforming to the // "session.previous_id" semantic conventions. It represents the previous // `session.id` for this user, when known. func SessionPreviousID(val string) attribute.KeyValue { return SessionPreviousIDKey.String(val) } // Namespace: signalr const ( // SignalRConnectionStatusKey is the attribute Key conforming to the // "signalr.connection.status" semantic conventions. It represents the signalR // HTTP connection closure status. // // Type: Enum // RequirementLevel: Recommended // Stability: Stable // // Examples: "app_shutdown", "timeout" SignalRConnectionStatusKey = attribute.Key("signalr.connection.status") // SignalRTransportKey is the attribute Key conforming to the // "signalr.transport" semantic conventions. It represents the // [SignalR transport type]. // // Type: Enum // RequirementLevel: Recommended // Stability: Stable // // Examples: "web_sockets", "long_polling" // // [SignalR transport type]: https://github.com/dotnet/aspnetcore/blob/main/src/SignalR/docs/specs/TransportProtocols.md SignalRTransportKey = attribute.Key("signalr.transport") ) // Enum values for signalr.connection.status var ( // The connection was closed normally. // Stability: stable SignalRConnectionStatusNormalClosure = SignalRConnectionStatusKey.String("normal_closure") // The connection was closed due to a timeout. // Stability: stable SignalRConnectionStatusTimeout = SignalRConnectionStatusKey.String("timeout") // The connection was closed because the app is shutting down. // Stability: stable SignalRConnectionStatusAppShutdown = SignalRConnectionStatusKey.String("app_shutdown") ) // Enum values for signalr.transport var ( // ServerSentEvents protocol // Stability: stable SignalRTransportServerSentEvents = SignalRTransportKey.String("server_sent_events") // LongPolling protocol // Stability: stable SignalRTransportLongPolling = SignalRTransportKey.String("long_polling") // WebSockets protocol // Stability: stable SignalRTransportWebSockets = SignalRTransportKey.String("web_sockets") ) // Namespace: source const ( // SourceAddressKey is the attribute Key conforming to the "source.address" // semantic conventions. It represents the source address - domain name if // available without reverse DNS lookup; otherwise, IP address or Unix domain // socket name. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "source.example.com", "10.1.2.80", "/tmp/my.sock" // Note: When observed from the destination side, and when communicating through // an intermediary, `source.address` SHOULD represent the source address behind // any intermediaries, for example proxies, if it's available. SourceAddressKey = attribute.Key("source.address") // SourcePortKey is the attribute Key conforming to the "source.port" semantic // conventions. It represents the source port number. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 3389, 2888 SourcePortKey = attribute.Key("source.port") ) // SourceAddress returns an attribute KeyValue conforming to the "source.address" // semantic conventions. It represents the source address - domain name if // available without reverse DNS lookup; otherwise, IP address or Unix domain // socket name. func SourceAddress(val string) attribute.KeyValue { return SourceAddressKey.String(val) } // SourcePort returns an attribute KeyValue conforming to the "source.port" // semantic conventions. It represents the source port number. func SourcePort(val int) attribute.KeyValue { return SourcePortKey.Int(val) } // Namespace: system const ( // SystemDeviceKey is the attribute Key conforming to the "system.device" // semantic conventions. It represents the device identifier. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "(identifier)" SystemDeviceKey = attribute.Key("system.device") // SystemFilesystemModeKey is the attribute Key conforming to the // "system.filesystem.mode" semantic conventions. It represents the filesystem // mode. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "rw, ro" SystemFilesystemModeKey = attribute.Key("system.filesystem.mode") // SystemFilesystemMountpointKey is the attribute Key conforming to the // "system.filesystem.mountpoint" semantic conventions. It represents the // filesystem mount path. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "/mnt/data" SystemFilesystemMountpointKey = attribute.Key("system.filesystem.mountpoint") // SystemFilesystemStateKey is the attribute Key conforming to the // "system.filesystem.state" semantic conventions. It represents the filesystem // state. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "used" SystemFilesystemStateKey = attribute.Key("system.filesystem.state") // SystemFilesystemTypeKey is the attribute Key conforming to the // "system.filesystem.type" semantic conventions. It represents the filesystem // type. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "ext4" SystemFilesystemTypeKey = attribute.Key("system.filesystem.type") // SystemMemoryLinuxSlabStateKey is the attribute Key conforming to the // "system.memory.linux.slab.state" semantic conventions. It represents the // Linux Slab memory state. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "reclaimable", "unreclaimable" SystemMemoryLinuxSlabStateKey = attribute.Key("system.memory.linux.slab.state") // SystemMemoryStateKey is the attribute Key conforming to the // "system.memory.state" semantic conventions. It represents the memory state. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "free", "cached" SystemMemoryStateKey = attribute.Key("system.memory.state") // SystemPagingDirectionKey is the attribute Key conforming to the // "system.paging.direction" semantic conventions. It represents the paging // access direction. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "in" SystemPagingDirectionKey = attribute.Key("system.paging.direction") // SystemPagingFaultTypeKey is the attribute Key conforming to the // "system.paging.fault.type" semantic conventions. It represents the paging // fault type. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "minor" SystemPagingFaultTypeKey = attribute.Key("system.paging.fault.type") // SystemPagingStateKey is the attribute Key conforming to the // "system.paging.state" semantic conventions. It represents the memory paging // state. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "free" SystemPagingStateKey = attribute.Key("system.paging.state") ) // SystemDevice returns an attribute KeyValue conforming to the "system.device" // semantic conventions. It represents the device identifier. func SystemDevice(val string) attribute.KeyValue { return SystemDeviceKey.String(val) } // SystemFilesystemMode returns an attribute KeyValue conforming to the // "system.filesystem.mode" semantic conventions. It represents the filesystem // mode. func SystemFilesystemMode(val string) attribute.KeyValue { return SystemFilesystemModeKey.String(val) } // SystemFilesystemMountpoint returns an attribute KeyValue conforming to the // "system.filesystem.mountpoint" semantic conventions. It represents the // filesystem mount path. func SystemFilesystemMountpoint(val string) attribute.KeyValue { return SystemFilesystemMountpointKey.String(val) } // Enum values for system.filesystem.state var ( // used // Stability: development SystemFilesystemStateUsed = SystemFilesystemStateKey.String("used") // free // Stability: development SystemFilesystemStateFree = SystemFilesystemStateKey.String("free") // reserved // Stability: development SystemFilesystemStateReserved = SystemFilesystemStateKey.String("reserved") ) // Enum values for system.filesystem.type var ( // fat32 // Stability: development SystemFilesystemTypeFat32 = SystemFilesystemTypeKey.String("fat32") // exfat // Stability: development SystemFilesystemTypeExfat = SystemFilesystemTypeKey.String("exfat") // ntfs // Stability: development SystemFilesystemTypeNtfs = SystemFilesystemTypeKey.String("ntfs") // refs // Stability: development SystemFilesystemTypeRefs = SystemFilesystemTypeKey.String("refs") // hfsplus // Stability: development SystemFilesystemTypeHfsplus = SystemFilesystemTypeKey.String("hfsplus") // ext4 // Stability: development SystemFilesystemTypeExt4 = SystemFilesystemTypeKey.String("ext4") ) // Enum values for system.memory.linux.slab.state var ( // reclaimable // Stability: development SystemMemoryLinuxSlabStateReclaimable = SystemMemoryLinuxSlabStateKey.String("reclaimable") // unreclaimable // Stability: development SystemMemoryLinuxSlabStateUnreclaimable = SystemMemoryLinuxSlabStateKey.String("unreclaimable") ) // Enum values for system.memory.state var ( // Actual used virtual memory in bytes. // Stability: development SystemMemoryStateUsed = SystemMemoryStateKey.String("used") // free // Stability: development SystemMemoryStateFree = SystemMemoryStateKey.String("free") // buffers // Stability: development SystemMemoryStateBuffers = SystemMemoryStateKey.String("buffers") // cached // Stability: development SystemMemoryStateCached = SystemMemoryStateKey.String("cached") ) // Enum values for system.paging.direction var ( // in // Stability: development SystemPagingDirectionIn = SystemPagingDirectionKey.String("in") // out // Stability: development SystemPagingDirectionOut = SystemPagingDirectionKey.String("out") ) // Enum values for system.paging.fault.type var ( // major // Stability: development SystemPagingFaultTypeMajor = SystemPagingFaultTypeKey.String("major") // minor // Stability: development SystemPagingFaultTypeMinor = SystemPagingFaultTypeKey.String("minor") ) // Enum values for system.paging.state var ( // used // Stability: development SystemPagingStateUsed = SystemPagingStateKey.String("used") // free // Stability: development SystemPagingStateFree = SystemPagingStateKey.String("free") ) // Namespace: telemetry const ( // TelemetryDistroNameKey is the attribute Key conforming to the // "telemetry.distro.name" semantic conventions. It represents the name of the // auto instrumentation agent or distribution, if used. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "parts-unlimited-java" // Note: Official auto instrumentation agents and distributions SHOULD set the // `telemetry.distro.name` attribute to // a string starting with `opentelemetry-`, e.g. // `opentelemetry-java-instrumentation`. TelemetryDistroNameKey = attribute.Key("telemetry.distro.name") // TelemetryDistroVersionKey is the attribute Key conforming to the // "telemetry.distro.version" semantic conventions. It represents the version // string of the auto instrumentation agent or distribution, if used. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "1.2.3" TelemetryDistroVersionKey = attribute.Key("telemetry.distro.version") // TelemetrySDKLanguageKey is the attribute Key conforming to the // "telemetry.sdk.language" semantic conventions. It represents the language of // the telemetry SDK. // // Type: Enum // RequirementLevel: Recommended // Stability: Stable // // Examples: TelemetrySDKLanguageKey = attribute.Key("telemetry.sdk.language") // TelemetrySDKNameKey is the attribute Key conforming to the // "telemetry.sdk.name" semantic conventions. It represents the name of the // telemetry SDK as defined above. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "opentelemetry" // Note: The OpenTelemetry SDK MUST set the `telemetry.sdk.name` attribute to // `opentelemetry`. // If another SDK, like a fork or a vendor-provided implementation, is used, // this SDK MUST set the // `telemetry.sdk.name` attribute to the fully-qualified class or module name of // this SDK's main entry point // or another suitable identifier depending on the language. // The identifier `opentelemetry` is reserved and MUST NOT be used in this case. // All custom identifiers SHOULD be stable across different versions of an // implementation. TelemetrySDKNameKey = attribute.Key("telemetry.sdk.name") // TelemetrySDKVersionKey is the attribute Key conforming to the // "telemetry.sdk.version" semantic conventions. It represents the version // string of the telemetry SDK. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "1.2.3" TelemetrySDKVersionKey = attribute.Key("telemetry.sdk.version") ) // TelemetryDistroName returns an attribute KeyValue conforming to the // "telemetry.distro.name" semantic conventions. It represents the name of the // auto instrumentation agent or distribution, if used. func TelemetryDistroName(val string) attribute.KeyValue { return TelemetryDistroNameKey.String(val) } // TelemetryDistroVersion returns an attribute KeyValue conforming to the // "telemetry.distro.version" semantic conventions. It represents the version // string of the auto instrumentation agent or distribution, if used. func TelemetryDistroVersion(val string) attribute.KeyValue { return TelemetryDistroVersionKey.String(val) } // TelemetrySDKName returns an attribute KeyValue conforming to the // "telemetry.sdk.name" semantic conventions. It represents the name of the // telemetry SDK as defined above. func TelemetrySDKName(val string) attribute.KeyValue { return TelemetrySDKNameKey.String(val) } // TelemetrySDKVersion returns an attribute KeyValue conforming to the // "telemetry.sdk.version" semantic conventions. It represents the version string // of the telemetry SDK. func TelemetrySDKVersion(val string) attribute.KeyValue { return TelemetrySDKVersionKey.String(val) } // Enum values for telemetry.sdk.language var ( // cpp // Stability: stable TelemetrySDKLanguageCPP = TelemetrySDKLanguageKey.String("cpp") // dotnet // Stability: stable TelemetrySDKLanguageDotnet = TelemetrySDKLanguageKey.String("dotnet") // erlang // Stability: stable TelemetrySDKLanguageErlang = TelemetrySDKLanguageKey.String("erlang") // go // Stability: stable TelemetrySDKLanguageGo = TelemetrySDKLanguageKey.String("go") // java // Stability: stable TelemetrySDKLanguageJava = TelemetrySDKLanguageKey.String("java") // nodejs // Stability: stable TelemetrySDKLanguageNodejs = TelemetrySDKLanguageKey.String("nodejs") // php // Stability: stable TelemetrySDKLanguagePHP = TelemetrySDKLanguageKey.String("php") // python // Stability: stable TelemetrySDKLanguagePython = TelemetrySDKLanguageKey.String("python") // ruby // Stability: stable TelemetrySDKLanguageRuby = TelemetrySDKLanguageKey.String("ruby") // rust // Stability: stable TelemetrySDKLanguageRust = TelemetrySDKLanguageKey.String("rust") // swift // Stability: stable TelemetrySDKLanguageSwift = TelemetrySDKLanguageKey.String("swift") // webjs // Stability: stable TelemetrySDKLanguageWebJS = TelemetrySDKLanguageKey.String("webjs") ) // Namespace: test const ( // TestCaseNameKey is the attribute Key conforming to the "test.case.name" // semantic conventions. It represents the fully qualified human readable name // of the [test case]. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "org.example.TestCase1.test1", "example/tests/TestCase1.test1", // "ExampleTestCase1_test1" // // [test case]: https://wikipedia.org/wiki/Test_case TestCaseNameKey = attribute.Key("test.case.name") // TestCaseResultStatusKey is the attribute Key conforming to the // "test.case.result.status" semantic conventions. It represents the status of // the actual test case result from test execution. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "pass", "fail" TestCaseResultStatusKey = attribute.Key("test.case.result.status") // TestSuiteNameKey is the attribute Key conforming to the "test.suite.name" // semantic conventions. It represents the human readable name of a [test suite] // . // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "TestSuite1" // // [test suite]: https://wikipedia.org/wiki/Test_suite TestSuiteNameKey = attribute.Key("test.suite.name") // TestSuiteRunStatusKey is the attribute Key conforming to the // "test.suite.run.status" semantic conventions. It represents the status of the // test suite run. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "success", "failure", "skipped", "aborted", "timed_out", // "in_progress" TestSuiteRunStatusKey = attribute.Key("test.suite.run.status") ) // TestCaseName returns an attribute KeyValue conforming to the "test.case.name" // semantic conventions. It represents the fully qualified human readable name of // the [test case]. // // [test case]: https://wikipedia.org/wiki/Test_case func TestCaseName(val string) attribute.KeyValue { return TestCaseNameKey.String(val) } // TestSuiteName returns an attribute KeyValue conforming to the // "test.suite.name" semantic conventions. It represents the human readable name // of a [test suite]. // // [test suite]: https://wikipedia.org/wiki/Test_suite func TestSuiteName(val string) attribute.KeyValue { return TestSuiteNameKey.String(val) } // Enum values for test.case.result.status var ( // pass // Stability: development TestCaseResultStatusPass = TestCaseResultStatusKey.String("pass") // fail // Stability: development TestCaseResultStatusFail = TestCaseResultStatusKey.String("fail") ) // Enum values for test.suite.run.status var ( // success // Stability: development TestSuiteRunStatusSuccess = TestSuiteRunStatusKey.String("success") // failure // Stability: development TestSuiteRunStatusFailure = TestSuiteRunStatusKey.String("failure") // skipped // Stability: development TestSuiteRunStatusSkipped = TestSuiteRunStatusKey.String("skipped") // aborted // Stability: development TestSuiteRunStatusAborted = TestSuiteRunStatusKey.String("aborted") // timed_out // Stability: development TestSuiteRunStatusTimedOut = TestSuiteRunStatusKey.String("timed_out") // in_progress // Stability: development TestSuiteRunStatusInProgress = TestSuiteRunStatusKey.String("in_progress") ) // Namespace: thread const ( // ThreadIDKey is the attribute Key conforming to the "thread.id" semantic // conventions. It represents the current "managed" thread ID (as opposed to OS // thread ID). // // Type: int // RequirementLevel: Recommended // Stability: Development // // Note: // Examples of where the value can be extracted from: // // | Language or platform | Source | // | --- | --- | // | JVM | `Thread.currentThread().threadId()` | // | .NET | `Thread.CurrentThread.ManagedThreadId` | // | Python | `threading.current_thread().ident` | // | Ruby | `Thread.current.object_id` | // | C++ | `std::this_thread::get_id()` | // | Erlang | `erlang:self()` | ThreadIDKey = attribute.Key("thread.id") // ThreadNameKey is the attribute Key conforming to the "thread.name" semantic // conventions. It represents the current thread name. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: main // Note: // Examples of where the value can be extracted from: // // | Language or platform | Source | // | --- | --- | // | JVM | `Thread.currentThread().getName()` | // | .NET | `Thread.CurrentThread.Name` | // | Python | `threading.current_thread().name` | // | Ruby | `Thread.current.name` | // | Erlang | `erlang:process_info(self(), registered_name)` | ThreadNameKey = attribute.Key("thread.name") ) // ThreadID returns an attribute KeyValue conforming to the "thread.id" semantic // conventions. It represents the current "managed" thread ID (as opposed to OS // thread ID). func ThreadID(val int) attribute.KeyValue { return ThreadIDKey.Int(val) } // ThreadName returns an attribute KeyValue conforming to the "thread.name" // semantic conventions. It represents the current thread name. func ThreadName(val string) attribute.KeyValue { return ThreadNameKey.String(val) } // Namespace: tls const ( // TLSCipherKey is the attribute Key conforming to the "tls.cipher" semantic // conventions. It represents the string indicating the [cipher] used during the // current connection. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "TLS_RSA_WITH_3DES_EDE_CBC_SHA", // "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" // Note: The values allowed for `tls.cipher` MUST be one of the `Descriptions` // of the [registered TLS Cipher Suits]. // // [cipher]: https://datatracker.ietf.org/doc/html/rfc5246#appendix-A.5 // [registered TLS Cipher Suits]: https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#table-tls-parameters-4 TLSCipherKey = attribute.Key("tls.cipher") // TLSClientCertificateKey is the attribute Key conforming to the // "tls.client.certificate" semantic conventions. It represents the PEM-encoded // stand-alone certificate offered by the client. This is usually // mutually-exclusive of `client.certificate_chain` since this value also exists // in that list. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "MII..." TLSClientCertificateKey = attribute.Key("tls.client.certificate") // TLSClientCertificateChainKey is the attribute Key conforming to the // "tls.client.certificate_chain" semantic conventions. It represents the array // of PEM-encoded certificates that make up the certificate chain offered by the // client. This is usually mutually-exclusive of `client.certificate` since that // value should be the first certificate in the chain. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "MII...", "MI..." TLSClientCertificateChainKey = attribute.Key("tls.client.certificate_chain") // TLSClientHashMd5Key is the attribute Key conforming to the // "tls.client.hash.md5" semantic conventions. It represents the certificate // fingerprint using the MD5 digest of DER-encoded version of certificate // offered by the client. For consistency with other hash values, this value // should be formatted as an uppercase hash. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "0F76C7F2C55BFD7D8E8B8F4BFBF0C9EC" TLSClientHashMd5Key = attribute.Key("tls.client.hash.md5") // TLSClientHashSha1Key is the attribute Key conforming to the // "tls.client.hash.sha1" semantic conventions. It represents the certificate // fingerprint using the SHA1 digest of DER-encoded version of certificate // offered by the client. For consistency with other hash values, this value // should be formatted as an uppercase hash. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "9E393D93138888D288266C2D915214D1D1CCEB2A" TLSClientHashSha1Key = attribute.Key("tls.client.hash.sha1") // TLSClientHashSha256Key is the attribute Key conforming to the // "tls.client.hash.sha256" semantic conventions. It represents the certificate // fingerprint using the SHA256 digest of DER-encoded version of certificate // offered by the client. For consistency with other hash values, this value // should be formatted as an uppercase hash. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "0687F666A054EF17A08E2F2162EAB4CBC0D265E1D7875BE74BF3C712CA92DAF0" TLSClientHashSha256Key = attribute.Key("tls.client.hash.sha256") // TLSClientIssuerKey is the attribute Key conforming to the "tls.client.issuer" // semantic conventions. It represents the distinguished name of [subject] of // the issuer of the x.509 certificate presented by the client. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "CN=Example Root CA, OU=Infrastructure Team, DC=example, DC=com" // // [subject]: https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6 TLSClientIssuerKey = attribute.Key("tls.client.issuer") // TLSClientJa3Key is the attribute Key conforming to the "tls.client.ja3" // semantic conventions. It represents a hash that identifies clients based on // how they perform an SSL/TLS handshake. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "d4e5b18d6b55c71272893221c96ba240" TLSClientJa3Key = attribute.Key("tls.client.ja3") // TLSClientNotAfterKey is the attribute Key conforming to the // "tls.client.not_after" semantic conventions. It represents the date/Time // indicating when client certificate is no longer considered valid. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "2021-01-01T00:00:00.000Z" TLSClientNotAfterKey = attribute.Key("tls.client.not_after") // TLSClientNotBeforeKey is the attribute Key conforming to the // "tls.client.not_before" semantic conventions. It represents the date/Time // indicating when client certificate is first considered valid. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "1970-01-01T00:00:00.000Z" TLSClientNotBeforeKey = attribute.Key("tls.client.not_before") // TLSClientSubjectKey is the attribute Key conforming to the // "tls.client.subject" semantic conventions. It represents the distinguished // name of subject of the x.509 certificate presented by the client. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "CN=myclient, OU=Documentation Team, DC=example, DC=com" TLSClientSubjectKey = attribute.Key("tls.client.subject") // TLSClientSupportedCiphersKey is the attribute Key conforming to the // "tls.client.supported_ciphers" semantic conventions. It represents the array // of ciphers offered by the client during the client hello. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", // "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" TLSClientSupportedCiphersKey = attribute.Key("tls.client.supported_ciphers") // TLSCurveKey is the attribute Key conforming to the "tls.curve" semantic // conventions. It represents the string indicating the curve used for the given // cipher, when applicable. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "secp256r1" TLSCurveKey = attribute.Key("tls.curve") // TLSEstablishedKey is the attribute Key conforming to the "tls.established" // semantic conventions. It represents the boolean flag indicating if the TLS // negotiation was successful and transitioned to an encrypted tunnel. // // Type: boolean // RequirementLevel: Recommended // Stability: Development // // Examples: true TLSEstablishedKey = attribute.Key("tls.established") // TLSNextProtocolKey is the attribute Key conforming to the "tls.next_protocol" // semantic conventions. It represents the string indicating the protocol being // tunneled. Per the values in the [IANA registry], this string should be lower // case. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "http/1.1" // // [IANA registry]: https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids TLSNextProtocolKey = attribute.Key("tls.next_protocol") // TLSProtocolNameKey is the attribute Key conforming to the "tls.protocol.name" // semantic conventions. It represents the normalized lowercase protocol name // parsed from original string of the negotiated [SSL/TLS protocol version]. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // // [SSL/TLS protocol version]: https://docs.openssl.org/1.1.1/man3/SSL_get_version/#return-values TLSProtocolNameKey = attribute.Key("tls.protocol.name") // TLSProtocolVersionKey is the attribute Key conforming to the // "tls.protocol.version" semantic conventions. It represents the numeric part // of the version parsed from the original string of the negotiated // [SSL/TLS protocol version]. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "1.2", "3" // // [SSL/TLS protocol version]: https://docs.openssl.org/1.1.1/man3/SSL_get_version/#return-values TLSProtocolVersionKey = attribute.Key("tls.protocol.version") // TLSResumedKey is the attribute Key conforming to the "tls.resumed" semantic // conventions. It represents the boolean flag indicating if this TLS connection // was resumed from an existing TLS negotiation. // // Type: boolean // RequirementLevel: Recommended // Stability: Development // // Examples: true TLSResumedKey = attribute.Key("tls.resumed") // TLSServerCertificateKey is the attribute Key conforming to the // "tls.server.certificate" semantic conventions. It represents the PEM-encoded // stand-alone certificate offered by the server. This is usually // mutually-exclusive of `server.certificate_chain` since this value also exists // in that list. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "MII..." TLSServerCertificateKey = attribute.Key("tls.server.certificate") // TLSServerCertificateChainKey is the attribute Key conforming to the // "tls.server.certificate_chain" semantic conventions. It represents the array // of PEM-encoded certificates that make up the certificate chain offered by the // server. This is usually mutually-exclusive of `server.certificate` since that // value should be the first certificate in the chain. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "MII...", "MI..." TLSServerCertificateChainKey = attribute.Key("tls.server.certificate_chain") // TLSServerHashMd5Key is the attribute Key conforming to the // "tls.server.hash.md5" semantic conventions. It represents the certificate // fingerprint using the MD5 digest of DER-encoded version of certificate // offered by the server. For consistency with other hash values, this value // should be formatted as an uppercase hash. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "0F76C7F2C55BFD7D8E8B8F4BFBF0C9EC" TLSServerHashMd5Key = attribute.Key("tls.server.hash.md5") // TLSServerHashSha1Key is the attribute Key conforming to the // "tls.server.hash.sha1" semantic conventions. It represents the certificate // fingerprint using the SHA1 digest of DER-encoded version of certificate // offered by the server. For consistency with other hash values, this value // should be formatted as an uppercase hash. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "9E393D93138888D288266C2D915214D1D1CCEB2A" TLSServerHashSha1Key = attribute.Key("tls.server.hash.sha1") // TLSServerHashSha256Key is the attribute Key conforming to the // "tls.server.hash.sha256" semantic conventions. It represents the certificate // fingerprint using the SHA256 digest of DER-encoded version of certificate // offered by the server. For consistency with other hash values, this value // should be formatted as an uppercase hash. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "0687F666A054EF17A08E2F2162EAB4CBC0D265E1D7875BE74BF3C712CA92DAF0" TLSServerHashSha256Key = attribute.Key("tls.server.hash.sha256") // TLSServerIssuerKey is the attribute Key conforming to the "tls.server.issuer" // semantic conventions. It represents the distinguished name of [subject] of // the issuer of the x.509 certificate presented by the client. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "CN=Example Root CA, OU=Infrastructure Team, DC=example, DC=com" // // [subject]: https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6 TLSServerIssuerKey = attribute.Key("tls.server.issuer") // TLSServerJa3sKey is the attribute Key conforming to the "tls.server.ja3s" // semantic conventions. It represents a hash that identifies servers based on // how they perform an SSL/TLS handshake. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "d4e5b18d6b55c71272893221c96ba240" TLSServerJa3sKey = attribute.Key("tls.server.ja3s") // TLSServerNotAfterKey is the attribute Key conforming to the // "tls.server.not_after" semantic conventions. It represents the date/Time // indicating when server certificate is no longer considered valid. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "2021-01-01T00:00:00.000Z" TLSServerNotAfterKey = attribute.Key("tls.server.not_after") // TLSServerNotBeforeKey is the attribute Key conforming to the // "tls.server.not_before" semantic conventions. It represents the date/Time // indicating when server certificate is first considered valid. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "1970-01-01T00:00:00.000Z" TLSServerNotBeforeKey = attribute.Key("tls.server.not_before") // TLSServerSubjectKey is the attribute Key conforming to the // "tls.server.subject" semantic conventions. It represents the distinguished // name of subject of the x.509 certificate presented by the server. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "CN=myserver, OU=Documentation Team, DC=example, DC=com" TLSServerSubjectKey = attribute.Key("tls.server.subject") ) // TLSCipher returns an attribute KeyValue conforming to the "tls.cipher" // semantic conventions. It represents the string indicating the [cipher] used // during the current connection. // // [cipher]: https://datatracker.ietf.org/doc/html/rfc5246#appendix-A.5 func TLSCipher(val string) attribute.KeyValue { return TLSCipherKey.String(val) } // TLSClientCertificate returns an attribute KeyValue conforming to the // "tls.client.certificate" semantic conventions. It represents the PEM-encoded // stand-alone certificate offered by the client. This is usually // mutually-exclusive of `client.certificate_chain` since this value also exists // in that list. func TLSClientCertificate(val string) attribute.KeyValue { return TLSClientCertificateKey.String(val) } // TLSClientCertificateChain returns an attribute KeyValue conforming to the // "tls.client.certificate_chain" semantic conventions. It represents the array // of PEM-encoded certificates that make up the certificate chain offered by the // client. This is usually mutually-exclusive of `client.certificate` since that // value should be the first certificate in the chain. func TLSClientCertificateChain(val ...string) attribute.KeyValue { return TLSClientCertificateChainKey.StringSlice(val) } // TLSClientHashMd5 returns an attribute KeyValue conforming to the // "tls.client.hash.md5" semantic conventions. It represents the certificate // fingerprint using the MD5 digest of DER-encoded version of certificate offered // by the client. For consistency with other hash values, this value should be // formatted as an uppercase hash. func TLSClientHashMd5(val string) attribute.KeyValue { return TLSClientHashMd5Key.String(val) } // TLSClientHashSha1 returns an attribute KeyValue conforming to the // "tls.client.hash.sha1" semantic conventions. It represents the certificate // fingerprint using the SHA1 digest of DER-encoded version of certificate // offered by the client. For consistency with other hash values, this value // should be formatted as an uppercase hash. func TLSClientHashSha1(val string) attribute.KeyValue { return TLSClientHashSha1Key.String(val) } // TLSClientHashSha256 returns an attribute KeyValue conforming to the // "tls.client.hash.sha256" semantic conventions. It represents the certificate // fingerprint using the SHA256 digest of DER-encoded version of certificate // offered by the client. For consistency with other hash values, this value // should be formatted as an uppercase hash. func TLSClientHashSha256(val string) attribute.KeyValue { return TLSClientHashSha256Key.String(val) } // TLSClientIssuer returns an attribute KeyValue conforming to the // "tls.client.issuer" semantic conventions. It represents the distinguished name // of [subject] of the issuer of the x.509 certificate presented by the client. // // [subject]: https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6 func TLSClientIssuer(val string) attribute.KeyValue { return TLSClientIssuerKey.String(val) } // TLSClientJa3 returns an attribute KeyValue conforming to the "tls.client.ja3" // semantic conventions. It represents a hash that identifies clients based on // how they perform an SSL/TLS handshake. func TLSClientJa3(val string) attribute.KeyValue { return TLSClientJa3Key.String(val) } // TLSClientNotAfter returns an attribute KeyValue conforming to the // "tls.client.not_after" semantic conventions. It represents the date/Time // indicating when client certificate is no longer considered valid. func TLSClientNotAfter(val string) attribute.KeyValue { return TLSClientNotAfterKey.String(val) } // TLSClientNotBefore returns an attribute KeyValue conforming to the // "tls.client.not_before" semantic conventions. It represents the date/Time // indicating when client certificate is first considered valid. func TLSClientNotBefore(val string) attribute.KeyValue { return TLSClientNotBeforeKey.String(val) } // TLSClientSubject returns an attribute KeyValue conforming to the // "tls.client.subject" semantic conventions. It represents the distinguished // name of subject of the x.509 certificate presented by the client. func TLSClientSubject(val string) attribute.KeyValue { return TLSClientSubjectKey.String(val) } // TLSClientSupportedCiphers returns an attribute KeyValue conforming to the // "tls.client.supported_ciphers" semantic conventions. It represents the array // of ciphers offered by the client during the client hello. func TLSClientSupportedCiphers(val ...string) attribute.KeyValue { return TLSClientSupportedCiphersKey.StringSlice(val) } // TLSCurve returns an attribute KeyValue conforming to the "tls.curve" semantic // conventions. It represents the string indicating the curve used for the given // cipher, when applicable. func TLSCurve(val string) attribute.KeyValue { return TLSCurveKey.String(val) } // TLSEstablished returns an attribute KeyValue conforming to the // "tls.established" semantic conventions. It represents the boolean flag // indicating if the TLS negotiation was successful and transitioned to an // encrypted tunnel. func TLSEstablished(val bool) attribute.KeyValue { return TLSEstablishedKey.Bool(val) } // TLSNextProtocol returns an attribute KeyValue conforming to the // "tls.next_protocol" semantic conventions. It represents the string indicating // the protocol being tunneled. Per the values in the [IANA registry], this // string should be lower case. // // [IANA registry]: https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids func TLSNextProtocol(val string) attribute.KeyValue { return TLSNextProtocolKey.String(val) } // TLSProtocolVersion returns an attribute KeyValue conforming to the // "tls.protocol.version" semantic conventions. It represents the numeric part of // the version parsed from the original string of the negotiated // [SSL/TLS protocol version]. // // [SSL/TLS protocol version]: https://docs.openssl.org/1.1.1/man3/SSL_get_version/#return-values func TLSProtocolVersion(val string) attribute.KeyValue { return TLSProtocolVersionKey.String(val) } // TLSResumed returns an attribute KeyValue conforming to the "tls.resumed" // semantic conventions. It represents the boolean flag indicating if this TLS // connection was resumed from an existing TLS negotiation. func TLSResumed(val bool) attribute.KeyValue { return TLSResumedKey.Bool(val) } // TLSServerCertificate returns an attribute KeyValue conforming to the // "tls.server.certificate" semantic conventions. It represents the PEM-encoded // stand-alone certificate offered by the server. This is usually // mutually-exclusive of `server.certificate_chain` since this value also exists // in that list. func TLSServerCertificate(val string) attribute.KeyValue { return TLSServerCertificateKey.String(val) } // TLSServerCertificateChain returns an attribute KeyValue conforming to the // "tls.server.certificate_chain" semantic conventions. It represents the array // of PEM-encoded certificates that make up the certificate chain offered by the // server. This is usually mutually-exclusive of `server.certificate` since that // value should be the first certificate in the chain. func TLSServerCertificateChain(val ...string) attribute.KeyValue { return TLSServerCertificateChainKey.StringSlice(val) } // TLSServerHashMd5 returns an attribute KeyValue conforming to the // "tls.server.hash.md5" semantic conventions. It represents the certificate // fingerprint using the MD5 digest of DER-encoded version of certificate offered // by the server. For consistency with other hash values, this value should be // formatted as an uppercase hash. func TLSServerHashMd5(val string) attribute.KeyValue { return TLSServerHashMd5Key.String(val) } // TLSServerHashSha1 returns an attribute KeyValue conforming to the // "tls.server.hash.sha1" semantic conventions. It represents the certificate // fingerprint using the SHA1 digest of DER-encoded version of certificate // offered by the server. For consistency with other hash values, this value // should be formatted as an uppercase hash. func TLSServerHashSha1(val string) attribute.KeyValue { return TLSServerHashSha1Key.String(val) } // TLSServerHashSha256 returns an attribute KeyValue conforming to the // "tls.server.hash.sha256" semantic conventions. It represents the certificate // fingerprint using the SHA256 digest of DER-encoded version of certificate // offered by the server. For consistency with other hash values, this value // should be formatted as an uppercase hash. func TLSServerHashSha256(val string) attribute.KeyValue { return TLSServerHashSha256Key.String(val) } // TLSServerIssuer returns an attribute KeyValue conforming to the // "tls.server.issuer" semantic conventions. It represents the distinguished name // of [subject] of the issuer of the x.509 certificate presented by the client. // // [subject]: https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6 func TLSServerIssuer(val string) attribute.KeyValue { return TLSServerIssuerKey.String(val) } // TLSServerJa3s returns an attribute KeyValue conforming to the // "tls.server.ja3s" semantic conventions. It represents a hash that identifies // servers based on how they perform an SSL/TLS handshake. func TLSServerJa3s(val string) attribute.KeyValue { return TLSServerJa3sKey.String(val) } // TLSServerNotAfter returns an attribute KeyValue conforming to the // "tls.server.not_after" semantic conventions. It represents the date/Time // indicating when server certificate is no longer considered valid. func TLSServerNotAfter(val string) attribute.KeyValue { return TLSServerNotAfterKey.String(val) } // TLSServerNotBefore returns an attribute KeyValue conforming to the // "tls.server.not_before" semantic conventions. It represents the date/Time // indicating when server certificate is first considered valid. func TLSServerNotBefore(val string) attribute.KeyValue { return TLSServerNotBeforeKey.String(val) } // TLSServerSubject returns an attribute KeyValue conforming to the // "tls.server.subject" semantic conventions. It represents the distinguished // name of subject of the x.509 certificate presented by the server. func TLSServerSubject(val string) attribute.KeyValue { return TLSServerSubjectKey.String(val) } // Enum values for tls.protocol.name var ( // ssl // Stability: development TLSProtocolNameSsl = TLSProtocolNameKey.String("ssl") // tls // Stability: development TLSProtocolNameTLS = TLSProtocolNameKey.String("tls") ) // Namespace: url const ( // URLDomainKey is the attribute Key conforming to the "url.domain" semantic // conventions. It represents the domain extracted from the `url.full`, such as // "opentelemetry.io". // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "www.foo.bar", "opentelemetry.io", "3.12.167.2", // "[1080:0:0:0:8:800:200C:417A]" // Note: In some cases a URL may refer to an IP and/or port directly, without a // domain name. In this case, the IP address would go to the domain field. If // the URL contains a [literal IPv6 address] enclosed by `[` and `]`, the `[` // and `]` characters should also be captured in the domain field. // // [literal IPv6 address]: https://www.rfc-editor.org/rfc/rfc2732#section-2 URLDomainKey = attribute.Key("url.domain") // URLExtensionKey is the attribute Key conforming to the "url.extension" // semantic conventions. It represents the file extension extracted from the // `url.full`, excluding the leading dot. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "png", "gz" // Note: The file extension is only set if it exists, as not every url has a // file extension. When the file name has multiple extensions `example.tar.gz`, // only the last one should be captured `gz`, not `tar.gz`. URLExtensionKey = attribute.Key("url.extension") // URLFragmentKey is the attribute Key conforming to the "url.fragment" semantic // conventions. It represents the [URI fragment] component. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "SemConv" // // [URI fragment]: https://www.rfc-editor.org/rfc/rfc3986#section-3.5 URLFragmentKey = attribute.Key("url.fragment") // URLFullKey is the attribute Key conforming to the "url.full" semantic // conventions. It represents the absolute URL describing a network resource // according to [RFC3986]. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "https://www.foo.bar/search?q=OpenTelemetry#SemConv", "//localhost" // Note: For network calls, URL usually has // `scheme://host[:port][path][?query][#fragment]` format, where the fragment // is not transmitted over HTTP, but if it is known, it SHOULD be included // nevertheless. // // `url.full` MUST NOT contain credentials passed via URL in form of // `https://username:password@www.example.com/`. // In such case username and password SHOULD be redacted and attribute's value // SHOULD be `https://REDACTED:REDACTED@www.example.com/`. // // `url.full` SHOULD capture the absolute URL when it is available (or can be // reconstructed). // // Sensitive content provided in `url.full` SHOULD be scrubbed when // instrumentations can identify it. // // // Query string values for the following keys SHOULD be redacted by default and // replaced by the // value `REDACTED`: // // - [`AWSAccessKeyId`] // - [`Signature`] // - [`sig`] // - [`X-Goog-Signature`] // // This list is subject to change over time. // // When a query string value is redacted, the query string key SHOULD still be // preserved, e.g. // `https://www.example.com/path?color=blue&sig=REDACTED`. // // [RFC3986]: https://www.rfc-editor.org/rfc/rfc3986 // [`AWSAccessKeyId`]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/RESTAuthentication.html#RESTAuthenticationQueryStringAuth // [`Signature`]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/RESTAuthentication.html#RESTAuthenticationQueryStringAuth // [`sig`]: https://learn.microsoft.com/azure/storage/common/storage-sas-overview#sas-token // [`X-Goog-Signature`]: https://cloud.google.com/storage/docs/access-control/signed-urls URLFullKey = attribute.Key("url.full") // URLOriginalKey is the attribute Key conforming to the "url.original" semantic // conventions. It represents the unmodified original URL as seen in the event // source. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "https://www.foo.bar/search?q=OpenTelemetry#SemConv", // "search?q=OpenTelemetry" // Note: In network monitoring, the observed URL may be a full URL, whereas in // access logs, the URL is often just represented as a path. This field is meant // to represent the URL as it was observed, complete or not. // `url.original` might contain credentials passed via URL in form of // `https://username:password@www.example.com/`. In such case password and // username SHOULD NOT be redacted and attribute's value SHOULD remain the same. URLOriginalKey = attribute.Key("url.original") // URLPathKey is the attribute Key conforming to the "url.path" semantic // conventions. It represents the [URI path] component. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "/search" // Note: Sensitive content provided in `url.path` SHOULD be scrubbed when // instrumentations can identify it. // // [URI path]: https://www.rfc-editor.org/rfc/rfc3986#section-3.3 URLPathKey = attribute.Key("url.path") // URLPortKey is the attribute Key conforming to the "url.port" semantic // conventions. It represents the port extracted from the `url.full`. // // Type: int // RequirementLevel: Recommended // Stability: Development // // Examples: 443 URLPortKey = attribute.Key("url.port") // URLQueryKey is the attribute Key conforming to the "url.query" semantic // conventions. It represents the [URI query] component. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "q=OpenTelemetry" // Note: Sensitive content provided in `url.query` SHOULD be scrubbed when // instrumentations can identify it. // // // Query string values for the following keys SHOULD be redacted by default and // replaced by the value `REDACTED`: // // - [`AWSAccessKeyId`] // - [`Signature`] // - [`sig`] // - [`X-Goog-Signature`] // // This list is subject to change over time. // // When a query string value is redacted, the query string key SHOULD still be // preserved, e.g. // `q=OpenTelemetry&sig=REDACTED`. // // [URI query]: https://www.rfc-editor.org/rfc/rfc3986#section-3.4 // [`AWSAccessKeyId`]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/RESTAuthentication.html#RESTAuthenticationQueryStringAuth // [`Signature`]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/RESTAuthentication.html#RESTAuthenticationQueryStringAuth // [`sig`]: https://learn.microsoft.com/azure/storage/common/storage-sas-overview#sas-token // [`X-Goog-Signature`]: https://cloud.google.com/storage/docs/access-control/signed-urls URLQueryKey = attribute.Key("url.query") // URLRegisteredDomainKey is the attribute Key conforming to the // "url.registered_domain" semantic conventions. It represents the highest // registered url domain, stripped of the subdomain. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "example.com", "foo.co.uk" // Note: This value can be determined precisely with the [public suffix list]. // For example, the registered domain for `foo.example.com` is `example.com`. // Trying to approximate this by simply taking the last two labels will not work // well for TLDs such as `co.uk`. // // [public suffix list]: https://publicsuffix.org/ URLRegisteredDomainKey = attribute.Key("url.registered_domain") // URLSchemeKey is the attribute Key conforming to the "url.scheme" semantic // conventions. It represents the [URI scheme] component identifying the used // protocol. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "https", "ftp", "telnet" // // [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1 URLSchemeKey = attribute.Key("url.scheme") // URLSubdomainKey is the attribute Key conforming to the "url.subdomain" // semantic conventions. It represents the subdomain portion of a fully // qualified domain name includes all of the names except the host name under // the registered_domain. In a partially qualified domain, or if the // qualification level of the full name cannot be determined, subdomain contains // all of the names below the registered domain. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "east", "sub2.sub1" // Note: The subdomain portion of `www.east.mydomain.co.uk` is `east`. If the // domain has multiple levels of subdomain, such as `sub2.sub1.example.com`, the // subdomain field should contain `sub2.sub1`, with no trailing period. URLSubdomainKey = attribute.Key("url.subdomain") // URLTemplateKey is the attribute Key conforming to the "url.template" semantic // conventions. It represents the low-cardinality template of an // [absolute path reference]. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "/users/{id}", "/users/:id", "/users?id={id}" // // [absolute path reference]: https://www.rfc-editor.org/rfc/rfc3986#section-4.2 URLTemplateKey = attribute.Key("url.template") // URLTopLevelDomainKey is the attribute Key conforming to the // "url.top_level_domain" semantic conventions. It represents the effective top // level domain (eTLD), also known as the domain suffix, is the last part of the // domain name. For example, the top level domain for example.com is `com`. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "com", "co.uk" // Note: This value can be determined precisely with the [public suffix list]. // // [public suffix list]: https://publicsuffix.org/ URLTopLevelDomainKey = attribute.Key("url.top_level_domain") ) // URLDomain returns an attribute KeyValue conforming to the "url.domain" // semantic conventions. It represents the domain extracted from the `url.full`, // such as "opentelemetry.io". func URLDomain(val string) attribute.KeyValue { return URLDomainKey.String(val) } // URLExtension returns an attribute KeyValue conforming to the "url.extension" // semantic conventions. It represents the file extension extracted from the // `url.full`, excluding the leading dot. func URLExtension(val string) attribute.KeyValue { return URLExtensionKey.String(val) } // URLFragment returns an attribute KeyValue conforming to the "url.fragment" // semantic conventions. It represents the [URI fragment] component. // // [URI fragment]: https://www.rfc-editor.org/rfc/rfc3986#section-3.5 func URLFragment(val string) attribute.KeyValue { return URLFragmentKey.String(val) } // URLFull returns an attribute KeyValue conforming to the "url.full" semantic // conventions. It represents the absolute URL describing a network resource // according to [RFC3986]. // // [RFC3986]: https://www.rfc-editor.org/rfc/rfc3986 func URLFull(val string) attribute.KeyValue { return URLFullKey.String(val) } // URLOriginal returns an attribute KeyValue conforming to the "url.original" // semantic conventions. It represents the unmodified original URL as seen in the // event source. func URLOriginal(val string) attribute.KeyValue { return URLOriginalKey.String(val) } // URLPath returns an attribute KeyValue conforming to the "url.path" semantic // conventions. It represents the [URI path] component. // // [URI path]: https://www.rfc-editor.org/rfc/rfc3986#section-3.3 func URLPath(val string) attribute.KeyValue { return URLPathKey.String(val) } // URLPort returns an attribute KeyValue conforming to the "url.port" semantic // conventions. It represents the port extracted from the `url.full`. func URLPort(val int) attribute.KeyValue { return URLPortKey.Int(val) } // URLQuery returns an attribute KeyValue conforming to the "url.query" semantic // conventions. It represents the [URI query] component. // // [URI query]: https://www.rfc-editor.org/rfc/rfc3986#section-3.4 func URLQuery(val string) attribute.KeyValue { return URLQueryKey.String(val) } // URLRegisteredDomain returns an attribute KeyValue conforming to the // "url.registered_domain" semantic conventions. It represents the highest // registered url domain, stripped of the subdomain. func URLRegisteredDomain(val string) attribute.KeyValue { return URLRegisteredDomainKey.String(val) } // URLScheme returns an attribute KeyValue conforming to the "url.scheme" // semantic conventions. It represents the [URI scheme] component identifying the // used protocol. // // [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1 func URLScheme(val string) attribute.KeyValue { return URLSchemeKey.String(val) } // URLSubdomain returns an attribute KeyValue conforming to the "url.subdomain" // semantic conventions. It represents the subdomain portion of a fully qualified // domain name includes all of the names except the host name under the // registered_domain. In a partially qualified domain, or if the qualification // level of the full name cannot be determined, subdomain contains all of the // names below the registered domain. func URLSubdomain(val string) attribute.KeyValue { return URLSubdomainKey.String(val) } // URLTemplate returns an attribute KeyValue conforming to the "url.template" // semantic conventions. It represents the low-cardinality template of an // [absolute path reference]. // // [absolute path reference]: https://www.rfc-editor.org/rfc/rfc3986#section-4.2 func URLTemplate(val string) attribute.KeyValue { return URLTemplateKey.String(val) } // URLTopLevelDomain returns an attribute KeyValue conforming to the // "url.top_level_domain" semantic conventions. It represents the effective top // level domain (eTLD), also known as the domain suffix, is the last part of the // domain name. For example, the top level domain for example.com is `com`. func URLTopLevelDomain(val string) attribute.KeyValue { return URLTopLevelDomainKey.String(val) } // Namespace: user const ( // UserEmailKey is the attribute Key conforming to the "user.email" semantic // conventions. It represents the user email address. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "a.einstein@example.com" UserEmailKey = attribute.Key("user.email") // UserFullNameKey is the attribute Key conforming to the "user.full_name" // semantic conventions. It represents the user's full name. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Albert Einstein" UserFullNameKey = attribute.Key("user.full_name") // UserHashKey is the attribute Key conforming to the "user.hash" semantic // conventions. It represents the unique user hash to correlate information for // a user in anonymized form. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "364fc68eaf4c8acec74a4e52d7d1feaa" // Note: Useful if `user.id` or `user.name` contain confidential information and // cannot be used. UserHashKey = attribute.Key("user.hash") // UserIDKey is the attribute Key conforming to the "user.id" semantic // conventions. It represents the unique identifier of the user. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "S-1-5-21-202424912787-2692429404-2351956786-1000" UserIDKey = attribute.Key("user.id") // UserNameKey is the attribute Key conforming to the "user.name" semantic // conventions. It represents the short name or login/username of the user. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "a.einstein" UserNameKey = attribute.Key("user.name") // UserRolesKey is the attribute Key conforming to the "user.roles" semantic // conventions. It represents the array of user roles at the time of the event. // // Type: string[] // RequirementLevel: Recommended // Stability: Development // // Examples: "admin", "reporting_user" UserRolesKey = attribute.Key("user.roles") ) // UserEmail returns an attribute KeyValue conforming to the "user.email" // semantic conventions. It represents the user email address. func UserEmail(val string) attribute.KeyValue { return UserEmailKey.String(val) } // UserFullName returns an attribute KeyValue conforming to the "user.full_name" // semantic conventions. It represents the user's full name. func UserFullName(val string) attribute.KeyValue { return UserFullNameKey.String(val) } // UserHash returns an attribute KeyValue conforming to the "user.hash" semantic // conventions. It represents the unique user hash to correlate information for a // user in anonymized form. func UserHash(val string) attribute.KeyValue { return UserHashKey.String(val) } // UserID returns an attribute KeyValue conforming to the "user.id" semantic // conventions. It represents the unique identifier of the user. func UserID(val string) attribute.KeyValue { return UserIDKey.String(val) } // UserName returns an attribute KeyValue conforming to the "user.name" semantic // conventions. It represents the short name or login/username of the user. func UserName(val string) attribute.KeyValue { return UserNameKey.String(val) } // UserRoles returns an attribute KeyValue conforming to the "user.roles" // semantic conventions. It represents the array of user roles at the time of the // event. func UserRoles(val ...string) attribute.KeyValue { return UserRolesKey.StringSlice(val) } // Namespace: user_agent const ( // UserAgentNameKey is the attribute Key conforming to the "user_agent.name" // semantic conventions. It represents the name of the user-agent extracted from // original. Usually refers to the browser's name. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Safari", "YourApp" // Note: [Example] of extracting browser's name from original string. In the // case of using a user-agent for non-browser products, such as microservices // with multiple names/versions inside the `user_agent.original`, the most // significant name SHOULD be selected. In such a scenario it should align with // `user_agent.version` // // [Example]: https://uaparser.dev/#demo UserAgentNameKey = attribute.Key("user_agent.name") // UserAgentOriginalKey is the attribute Key conforming to the // "user_agent.original" semantic conventions. It represents the value of the // [HTTP User-Agent] header sent by the client. // // Type: string // RequirementLevel: Recommended // Stability: Stable // // Examples: "CERN-LineMode/2.15 libwww/2.17b3", "Mozilla/5.0 (iPhone; CPU // iPhone OS 14_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) // Version/14.1.2 Mobile/15E148 Safari/604.1", "YourApp/1.0.0 // grpc-java-okhttp/1.27.2" // // [HTTP User-Agent]: https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent UserAgentOriginalKey = attribute.Key("user_agent.original") // UserAgentOSNameKey is the attribute Key conforming to the // "user_agent.os.name" semantic conventions. It represents the human readable // operating system name. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "iOS", "Android", "Ubuntu" // Note: For mapping user agent strings to OS names, libraries such as // [ua-parser] can be utilized. // // [ua-parser]: https://github.com/ua-parser UserAgentOSNameKey = attribute.Key("user_agent.os.name") // UserAgentOSVersionKey is the attribute Key conforming to the // "user_agent.os.version" semantic conventions. It represents the version // string of the operating system as defined in [Version Attributes]. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "14.2.1", "18.04.1" // Note: For mapping user agent strings to OS versions, libraries such as // [ua-parser] can be utilized. // // [Version Attributes]: /docs/resource/README.md#version-attributes // [ua-parser]: https://github.com/ua-parser UserAgentOSVersionKey = attribute.Key("user_agent.os.version") // UserAgentSyntheticTypeKey is the attribute Key conforming to the // "user_agent.synthetic.type" semantic conventions. It represents the specifies // the category of synthetic traffic, such as tests or bots. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: // Note: This attribute MAY be derived from the contents of the // `user_agent.original` attribute. Components that populate the attribute are // responsible for determining what they consider to be synthetic bot or test // traffic. This attribute can either be set for self-identification purposes, // or on telemetry detected to be generated as a result of a synthetic request. // This attribute is useful for distinguishing between genuine client traffic // and synthetic traffic generated by bots or tests. UserAgentSyntheticTypeKey = attribute.Key("user_agent.synthetic.type") // UserAgentVersionKey is the attribute Key conforming to the // "user_agent.version" semantic conventions. It represents the version of the // user-agent extracted from original. Usually refers to the browser's version. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "14.1.2", "1.0.0" // Note: [Example] of extracting browser's version from original string. In the // case of using a user-agent for non-browser products, such as microservices // with multiple names/versions inside the `user_agent.original`, the most // significant version SHOULD be selected. In such a scenario it should align // with `user_agent.name` // // [Example]: https://uaparser.dev/#demo UserAgentVersionKey = attribute.Key("user_agent.version") ) // UserAgentName returns an attribute KeyValue conforming to the // "user_agent.name" semantic conventions. It represents the name of the // user-agent extracted from original. Usually refers to the browser's name. func UserAgentName(val string) attribute.KeyValue { return UserAgentNameKey.String(val) } // UserAgentOriginal returns an attribute KeyValue conforming to the // "user_agent.original" semantic conventions. It represents the value of the // [HTTP User-Agent] header sent by the client. // // [HTTP User-Agent]: https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent func UserAgentOriginal(val string) attribute.KeyValue { return UserAgentOriginalKey.String(val) } // UserAgentOSName returns an attribute KeyValue conforming to the // "user_agent.os.name" semantic conventions. It represents the human readable // operating system name. func UserAgentOSName(val string) attribute.KeyValue { return UserAgentOSNameKey.String(val) } // UserAgentOSVersion returns an attribute KeyValue conforming to the // "user_agent.os.version" semantic conventions. It represents the version string // of the operating system as defined in [Version Attributes]. // // [Version Attributes]: /docs/resource/README.md#version-attributes func UserAgentOSVersion(val string) attribute.KeyValue { return UserAgentOSVersionKey.String(val) } // UserAgentVersion returns an attribute KeyValue conforming to the // "user_agent.version" semantic conventions. It represents the version of the // user-agent extracted from original. Usually refers to the browser's version. func UserAgentVersion(val string) attribute.KeyValue { return UserAgentVersionKey.String(val) } // Enum values for user_agent.synthetic.type var ( // Bot source. // Stability: development UserAgentSyntheticTypeBot = UserAgentSyntheticTypeKey.String("bot") // Synthetic test source. // Stability: development UserAgentSyntheticTypeTest = UserAgentSyntheticTypeKey.String("test") ) // Namespace: vcs const ( // VCSChangeIDKey is the attribute Key conforming to the "vcs.change.id" // semantic conventions. It represents the ID of the change (pull request/merge // request/changelist) if applicable. This is usually a unique (within // repository) identifier generated by the VCS system. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "123" VCSChangeIDKey = attribute.Key("vcs.change.id") // VCSChangeStateKey is the attribute Key conforming to the "vcs.change.state" // semantic conventions. It represents the state of the change (pull // request/merge request/changelist). // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "open", "closed", "merged" VCSChangeStateKey = attribute.Key("vcs.change.state") // VCSChangeTitleKey is the attribute Key conforming to the "vcs.change.title" // semantic conventions. It represents the human readable title of the change // (pull request/merge request/changelist). This title is often a brief summary // of the change and may get merged in to a ref as the commit summary. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "Fixes broken thing", "feat: add my new feature", "[chore] update // dependency" VCSChangeTitleKey = attribute.Key("vcs.change.title") // VCSLineChangeTypeKey is the attribute Key conforming to the // "vcs.line_change.type" semantic conventions. It represents the type of line // change being measured on a branch or change. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "added", "removed" VCSLineChangeTypeKey = attribute.Key("vcs.line_change.type") // VCSOwnerNameKey is the attribute Key conforming to the "vcs.owner.name" // semantic conventions. It represents the group owner within the version // control system. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "my-org", "myteam", "business-unit" VCSOwnerNameKey = attribute.Key("vcs.owner.name") // VCSProviderNameKey is the attribute Key conforming to the "vcs.provider.name" // semantic conventions. It represents the name of the version control system // provider. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "github", "gitlab", "gitea", "bitbucket" VCSProviderNameKey = attribute.Key("vcs.provider.name") // VCSRefBaseNameKey is the attribute Key conforming to the "vcs.ref.base.name" // semantic conventions. It represents the name of the [reference] such as // **branch** or **tag** in the repository. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "my-feature-branch", "tag-1-test" // Note: `base` refers to the starting point of a change. For example, `main` // would be the base reference of type branch if you've created a new // reference of type branch from it and created new commits. // // [reference]: https://git-scm.com/docs/gitglossary#def_ref VCSRefBaseNameKey = attribute.Key("vcs.ref.base.name") // VCSRefBaseRevisionKey is the attribute Key conforming to the // "vcs.ref.base.revision" semantic conventions. It represents the revision, // literally [revised version], The revision most often refers to a commit // object in Git, or a revision number in SVN. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "9d59409acf479dfa0df1aa568182e43e43df8bbe28d60fcf2bc52e30068802cc", // "main", "123", "HEAD" // Note: `base` refers to the starting point of a change. For example, `main` // would be the base reference of type branch if you've created a new // reference of type branch from it and created new commits. The // revision can be a full [hash value (see // glossary)], // of the recorded change to a ref within a repository pointing to a // commit [commit] object. It does // not necessarily have to be a hash; it can simply define a [revision // number] // which is an integer that is monotonically increasing. In cases where // it is identical to the `ref.base.name`, it SHOULD still be included. // It is up to the implementer to decide which value to set as the // revision based on the VCS system and situational context. // // [revised version]: https://www.merriam-webster.com/dictionary/revision // [hash value (see // glossary)]: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf // [commit]: https://git-scm.com/docs/git-commit // [revision // number]: https://svnbook.red-bean.com/en/1.7/svn.tour.revs.specifiers.html VCSRefBaseRevisionKey = attribute.Key("vcs.ref.base.revision") // VCSRefBaseTypeKey is the attribute Key conforming to the "vcs.ref.base.type" // semantic conventions. It represents the type of the [reference] in the // repository. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "branch", "tag" // Note: `base` refers to the starting point of a change. For example, `main` // would be the base reference of type branch if you've created a new // reference of type branch from it and created new commits. // // [reference]: https://git-scm.com/docs/gitglossary#def_ref VCSRefBaseTypeKey = attribute.Key("vcs.ref.base.type") // VCSRefHeadNameKey is the attribute Key conforming to the "vcs.ref.head.name" // semantic conventions. It represents the name of the [reference] such as // **branch** or **tag** in the repository. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "my-feature-branch", "tag-1-test" // Note: `head` refers to where you are right now; the current reference at a // given time. // // [reference]: https://git-scm.com/docs/gitglossary#def_ref VCSRefHeadNameKey = attribute.Key("vcs.ref.head.name") // VCSRefHeadRevisionKey is the attribute Key conforming to the // "vcs.ref.head.revision" semantic conventions. It represents the revision, // literally [revised version], The revision most often refers to a commit // object in Git, or a revision number in SVN. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "9d59409acf479dfa0df1aa568182e43e43df8bbe28d60fcf2bc52e30068802cc", // "main", "123", "HEAD" // Note: `head` refers to where you are right now; the current reference at a // given time.The revision can be a full [hash value (see // glossary)], // of the recorded change to a ref within a repository pointing to a // commit [commit] object. It does // not necessarily have to be a hash; it can simply define a [revision // number] // which is an integer that is monotonically increasing. In cases where // it is identical to the `ref.head.name`, it SHOULD still be included. // It is up to the implementer to decide which value to set as the // revision based on the VCS system and situational context. // // [revised version]: https://www.merriam-webster.com/dictionary/revision // [hash value (see // glossary)]: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf // [commit]: https://git-scm.com/docs/git-commit // [revision // number]: https://svnbook.red-bean.com/en/1.7/svn.tour.revs.specifiers.html VCSRefHeadRevisionKey = attribute.Key("vcs.ref.head.revision") // VCSRefHeadTypeKey is the attribute Key conforming to the "vcs.ref.head.type" // semantic conventions. It represents the type of the [reference] in the // repository. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "branch", "tag" // Note: `head` refers to where you are right now; the current reference at a // given time. // // [reference]: https://git-scm.com/docs/gitglossary#def_ref VCSRefHeadTypeKey = attribute.Key("vcs.ref.head.type") // VCSRefTypeKey is the attribute Key conforming to the "vcs.ref.type" semantic // conventions. It represents the type of the [reference] in the repository. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "branch", "tag" // // [reference]: https://git-scm.com/docs/gitglossary#def_ref VCSRefTypeKey = attribute.Key("vcs.ref.type") // VCSRepositoryNameKey is the attribute Key conforming to the // "vcs.repository.name" semantic conventions. It represents the human readable // name of the repository. It SHOULD NOT include any additional identifier like // Group/SubGroup in GitLab or organization in GitHub. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "semantic-conventions", "my-cool-repo" // Note: Due to it only being the name, it can clash with forks of the same // repository if collecting telemetry across multiple orgs or groups in // the same backends. VCSRepositoryNameKey = attribute.Key("vcs.repository.name") // VCSRepositoryURLFullKey is the attribute Key conforming to the // "vcs.repository.url.full" semantic conventions. It represents the // [canonical URL] of the repository providing the complete HTTP(S) address in // order to locate and identify the repository through a browser. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: // "https://github.com/opentelemetry/open-telemetry-collector-contrib", // "https://gitlab.com/my-org/my-project/my-projects-project/repo" // Note: In Git Version Control Systems, the canonical URL SHOULD NOT include // the `.git` extension. // // [canonical URL]: https://support.google.com/webmasters/answer/10347851 VCSRepositoryURLFullKey = attribute.Key("vcs.repository.url.full") // VCSRevisionDeltaDirectionKey is the attribute Key conforming to the // "vcs.revision_delta.direction" semantic conventions. It represents the type // of revision comparison. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "ahead", "behind" VCSRevisionDeltaDirectionKey = attribute.Key("vcs.revision_delta.direction") ) // VCSChangeID returns an attribute KeyValue conforming to the "vcs.change.id" // semantic conventions. It represents the ID of the change (pull request/merge // request/changelist) if applicable. This is usually a unique (within // repository) identifier generated by the VCS system. func VCSChangeID(val string) attribute.KeyValue { return VCSChangeIDKey.String(val) } // VCSChangeTitle returns an attribute KeyValue conforming to the // "vcs.change.title" semantic conventions. It represents the human readable // title of the change (pull request/merge request/changelist). This title is // often a brief summary of the change and may get merged in to a ref as the // commit summary. func VCSChangeTitle(val string) attribute.KeyValue { return VCSChangeTitleKey.String(val) } // VCSOwnerName returns an attribute KeyValue conforming to the "vcs.owner.name" // semantic conventions. It represents the group owner within the version control // system. func VCSOwnerName(val string) attribute.KeyValue { return VCSOwnerNameKey.String(val) } // VCSRefBaseName returns an attribute KeyValue conforming to the // "vcs.ref.base.name" semantic conventions. It represents the name of the // [reference] such as **branch** or **tag** in the repository. // // [reference]: https://git-scm.com/docs/gitglossary#def_ref func VCSRefBaseName(val string) attribute.KeyValue { return VCSRefBaseNameKey.String(val) } // VCSRefBaseRevision returns an attribute KeyValue conforming to the // "vcs.ref.base.revision" semantic conventions. It represents the revision, // literally [revised version], The revision most often refers to a commit object // in Git, or a revision number in SVN. // // [revised version]: https://www.merriam-webster.com/dictionary/revision func VCSRefBaseRevision(val string) attribute.KeyValue { return VCSRefBaseRevisionKey.String(val) } // VCSRefHeadName returns an attribute KeyValue conforming to the // "vcs.ref.head.name" semantic conventions. It represents the name of the // [reference] such as **branch** or **tag** in the repository. // // [reference]: https://git-scm.com/docs/gitglossary#def_ref func VCSRefHeadName(val string) attribute.KeyValue { return VCSRefHeadNameKey.String(val) } // VCSRefHeadRevision returns an attribute KeyValue conforming to the // "vcs.ref.head.revision" semantic conventions. It represents the revision, // literally [revised version], The revision most often refers to a commit object // in Git, or a revision number in SVN. // // [revised version]: https://www.merriam-webster.com/dictionary/revision func VCSRefHeadRevision(val string) attribute.KeyValue { return VCSRefHeadRevisionKey.String(val) } // VCSRepositoryName returns an attribute KeyValue conforming to the // "vcs.repository.name" semantic conventions. It represents the human readable // name of the repository. It SHOULD NOT include any additional identifier like // Group/SubGroup in GitLab or organization in GitHub. func VCSRepositoryName(val string) attribute.KeyValue { return VCSRepositoryNameKey.String(val) } // VCSRepositoryURLFull returns an attribute KeyValue conforming to the // "vcs.repository.url.full" semantic conventions. It represents the // [canonical URL] of the repository providing the complete HTTP(S) address in // order to locate and identify the repository through a browser. // // [canonical URL]: https://support.google.com/webmasters/answer/10347851 func VCSRepositoryURLFull(val string) attribute.KeyValue { return VCSRepositoryURLFullKey.String(val) } // Enum values for vcs.change.state var ( // Open means the change is currently active and under review. It hasn't been // merged into the target branch yet, and it's still possible to make changes or // add comments. // Stability: development VCSChangeStateOpen = VCSChangeStateKey.String("open") // WIP (work-in-progress, draft) means the change is still in progress and not // yet ready for a full review. It might still undergo significant changes. // Stability: development VCSChangeStateWip = VCSChangeStateKey.String("wip") // Closed means the merge request has been closed without merging. This can // happen for various reasons, such as the changes being deemed unnecessary, the // issue being resolved in another way, or the author deciding to withdraw the // request. // Stability: development VCSChangeStateClosed = VCSChangeStateKey.String("closed") // Merged indicates that the change has been successfully integrated into the // target codebase. // Stability: development VCSChangeStateMerged = VCSChangeStateKey.String("merged") ) // Enum values for vcs.line_change.type var ( // How many lines were added. // Stability: development VCSLineChangeTypeAdded = VCSLineChangeTypeKey.String("added") // How many lines were removed. // Stability: development VCSLineChangeTypeRemoved = VCSLineChangeTypeKey.String("removed") ) // Enum values for vcs.provider.name var ( // [GitHub] // Stability: development // // [GitHub]: https://github.com VCSProviderNameGithub = VCSProviderNameKey.String("github") // [GitLab] // Stability: development // // [GitLab]: https://gitlab.com VCSProviderNameGitlab = VCSProviderNameKey.String("gitlab") // [Gitea] // Stability: development // // [Gitea]: https://gitea.io VCSProviderNameGitea = VCSProviderNameKey.String("gitea") // [Bitbucket] // Stability: development // // [Bitbucket]: https://bitbucket.org VCSProviderNameBitbucket = VCSProviderNameKey.String("bitbucket") ) // Enum values for vcs.ref.base.type var ( // [branch] // Stability: development // // [branch]: https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefbranchabranch VCSRefBaseTypeBranch = VCSRefBaseTypeKey.String("branch") // [tag] // Stability: development // // [tag]: https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddeftagatag VCSRefBaseTypeTag = VCSRefBaseTypeKey.String("tag") ) // Enum values for vcs.ref.head.type var ( // [branch] // Stability: development // // [branch]: https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefbranchabranch VCSRefHeadTypeBranch = VCSRefHeadTypeKey.String("branch") // [tag] // Stability: development // // [tag]: https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddeftagatag VCSRefHeadTypeTag = VCSRefHeadTypeKey.String("tag") ) // Enum values for vcs.ref.type var ( // [branch] // Stability: development // // [branch]: https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefbranchabranch VCSRefTypeBranch = VCSRefTypeKey.String("branch") // [tag] // Stability: development // // [tag]: https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddeftagatag VCSRefTypeTag = VCSRefTypeKey.String("tag") ) // Enum values for vcs.revision_delta.direction var ( // How many revisions the change is behind the target ref. // Stability: development VCSRevisionDeltaDirectionBehind = VCSRevisionDeltaDirectionKey.String("behind") // How many revisions the change is ahead of the target ref. // Stability: development VCSRevisionDeltaDirectionAhead = VCSRevisionDeltaDirectionKey.String("ahead") ) // Namespace: webengine const ( // WebEngineDescriptionKey is the attribute Key conforming to the // "webengine.description" semantic conventions. It represents the additional // description of the web engine (e.g. detailed version and edition // information). // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "WildFly Full 21.0.0.Final (WildFly Core 13.0.1.Final) - // 2.2.2.Final" WebEngineDescriptionKey = attribute.Key("webengine.description") // WebEngineNameKey is the attribute Key conforming to the "webengine.name" // semantic conventions. It represents the name of the web engine. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "WildFly" WebEngineNameKey = attribute.Key("webengine.name") // WebEngineVersionKey is the attribute Key conforming to the // "webengine.version" semantic conventions. It represents the version of the // web engine. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "21.0.0" WebEngineVersionKey = attribute.Key("webengine.version") ) // WebEngineDescription returns an attribute KeyValue conforming to the // "webengine.description" semantic conventions. It represents the additional // description of the web engine (e.g. detailed version and edition information). func WebEngineDescription(val string) attribute.KeyValue { return WebEngineDescriptionKey.String(val) } // WebEngineName returns an attribute KeyValue conforming to the "webengine.name" // semantic conventions. It represents the name of the web engine. func WebEngineName(val string) attribute.KeyValue { return WebEngineNameKey.String(val) } // WebEngineVersion returns an attribute KeyValue conforming to the // "webengine.version" semantic conventions. It represents the version of the web // engine. func WebEngineVersion(val string) attribute.KeyValue { return WebEngineVersionKey.String(val) } // Namespace: zos const ( // ZOSSmfIDKey is the attribute Key conforming to the "zos.smf.id" semantic // conventions. It represents the System Management Facility (SMF) Identifier // uniquely identified a z/OS system within a SYSPLEX or mainframe environment // and is used for system and performance analysis. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "SYS1" ZOSSmfIDKey = attribute.Key("zos.smf.id") // ZOSSysplexNameKey is the attribute Key conforming to the "zos.sysplex.name" // semantic conventions. It represents the name of the SYSPLEX to which the z/OS // system belongs too. // // Type: string // RequirementLevel: Recommended // Stability: Development // // Examples: "SYSPLEX1" ZOSSysplexNameKey = attribute.Key("zos.sysplex.name") ) // ZOSSmfID returns an attribute KeyValue conforming to the "zos.smf.id" semantic // conventions. It represents the System Management Facility (SMF) Identifier // uniquely identified a z/OS system within a SYSPLEX or mainframe environment // and is used for system and performance analysis. func ZOSSmfID(val string) attribute.KeyValue { return ZOSSmfIDKey.String(val) } // ZOSSysplexName returns an attribute KeyValue conforming to the // "zos.sysplex.name" semantic conventions. It represents the name of the SYSPLEX // to which the z/OS system belongs too. func ZOSSysplexName(val string) attribute.KeyValue { return ZOSSysplexNameKey.String(val) } ================================================ FILE: vendor/go.opentelemetry.io/otel/semconv/v1.39.0/doc.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 // Package semconv implements OpenTelemetry semantic conventions. // // OpenTelemetry semantic conventions are agreed standardized naming // patterns for OpenTelemetry things. This package represents the v1.39.0 // version of the OpenTelemetry semantic conventions. package semconv // import "go.opentelemetry.io/otel/semconv/v1.39.0" ================================================ FILE: vendor/go.opentelemetry.io/otel/semconv/v1.39.0/error_type.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package semconv // import "go.opentelemetry.io/otel/semconv/v1.39.0" import ( "reflect" "go.opentelemetry.io/otel/attribute" ) // ErrorType returns an [attribute.KeyValue] identifying the error type of err. // // If err is nil, the returned attribute has the default value // [ErrorTypeOther]. // // If err's type has the method // // ErrorType() string // // then the returned attribute has the value of err.ErrorType(). Otherwise, the // returned attribute has a value derived from the concrete type of err. // // The key of the returned attribute is [ErrorTypeKey]. func ErrorType(err error) attribute.KeyValue { if err == nil { return ErrorTypeOther } return ErrorTypeKey.String(errorType(err)) } func errorType(err error) string { var s string if et, ok := err.(interface{ ErrorType() string }); ok { // Prioritize the ErrorType method if available. s = et.ErrorType() } if s == "" { // Fallback to reflection if the ErrorType method is not supported or // returns an empty value. t := reflect.TypeOf(err) pkg, name := t.PkgPath(), t.Name() if pkg != "" && name != "" { s = pkg + "." + name } else { // The type has no package path or name (predeclared, not-defined, // or alias for a not-defined type). // // This is not guaranteed to be unique, but is a best effort. s = t.String() } } return s } ================================================ FILE: vendor/go.opentelemetry.io/otel/semconv/v1.39.0/exception.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package semconv // import "go.opentelemetry.io/otel/semconv/v1.39.0" const ( // ExceptionEventName is the name of the Span event representing an exception. ExceptionEventName = "exception" ) ================================================ FILE: vendor/go.opentelemetry.io/otel/semconv/v1.39.0/httpconv/metric.go ================================================ // Code generated from semantic convention specification. DO NOT EDIT. // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 // Package httpconv provides types and functionality for OpenTelemetry semantic // conventions in the "http" namespace. package httpconv import ( "context" "sync" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/metric" "go.opentelemetry.io/otel/metric/noop" ) var ( addOptPool = &sync.Pool{New: func() any { return &[]metric.AddOption{} }} recOptPool = &sync.Pool{New: func() any { return &[]metric.RecordOption{} }} ) // ErrorTypeAttr is an attribute conforming to the error.type semantic // conventions. It represents the describes a class of error the operation ended // with. type ErrorTypeAttr string var ( // ErrorTypeOther is a fallback error value to be used when the instrumentation // doesn't define a custom value. ErrorTypeOther ErrorTypeAttr = "_OTHER" ) // ConnectionStateAttr is an attribute conforming to the http.connection.state // semantic conventions. It represents the state of the HTTP connection in the // HTTP connection pool. type ConnectionStateAttr string var ( // ConnectionStateActive is the active state. ConnectionStateActive ConnectionStateAttr = "active" // ConnectionStateIdle is the idle state. ConnectionStateIdle ConnectionStateAttr = "idle" ) // RequestMethodAttr is an attribute conforming to the http.request.method // semantic conventions. It represents the HTTP request method. type RequestMethodAttr string var ( // RequestMethodConnect is the CONNECT method. RequestMethodConnect RequestMethodAttr = "CONNECT" // RequestMethodDelete is the DELETE method. RequestMethodDelete RequestMethodAttr = "DELETE" // RequestMethodGet is the GET method. RequestMethodGet RequestMethodAttr = "GET" // RequestMethodHead is the HEAD method. RequestMethodHead RequestMethodAttr = "HEAD" // RequestMethodOptions is the OPTIONS method. RequestMethodOptions RequestMethodAttr = "OPTIONS" // RequestMethodPatch is the PATCH method. RequestMethodPatch RequestMethodAttr = "PATCH" // RequestMethodPost is the POST method. RequestMethodPost RequestMethodAttr = "POST" // RequestMethodPut is the PUT method. RequestMethodPut RequestMethodAttr = "PUT" // RequestMethodTrace is the TRACE method. RequestMethodTrace RequestMethodAttr = "TRACE" // RequestMethodQuery is the QUERY method. RequestMethodQuery RequestMethodAttr = "QUERY" // RequestMethodOther is the any HTTP method that the instrumentation has no // prior knowledge of. RequestMethodOther RequestMethodAttr = "_OTHER" ) // UserAgentSyntheticTypeAttr is an attribute conforming to the // user_agent.synthetic.type semantic conventions. It represents the specifies // the category of synthetic traffic, such as tests or bots. type UserAgentSyntheticTypeAttr string var ( // UserAgentSyntheticTypeBot is the bot source. UserAgentSyntheticTypeBot UserAgentSyntheticTypeAttr = "bot" // UserAgentSyntheticTypeTest is the synthetic test source. UserAgentSyntheticTypeTest UserAgentSyntheticTypeAttr = "test" ) // ClientActiveRequests is an instrument used to record metric values conforming // to the "http.client.active_requests" semantic conventions. It represents the // number of active HTTP requests. type ClientActiveRequests struct { metric.Int64UpDownCounter } var newClientActiveRequestsOpts = []metric.Int64UpDownCounterOption{ metric.WithDescription("Number of active HTTP requests."), metric.WithUnit("{request}"), } // NewClientActiveRequests returns a new ClientActiveRequests instrument. func NewClientActiveRequests( m metric.Meter, opt ...metric.Int64UpDownCounterOption, ) (ClientActiveRequests, error) { // Check if the meter is nil. if m == nil { return ClientActiveRequests{noop.Int64UpDownCounter{}}, nil } if len(opt) == 0 { opt = newClientActiveRequestsOpts } else { opt = append(opt, newClientActiveRequestsOpts...) } i, err := m.Int64UpDownCounter( "http.client.active_requests", opt..., ) if err != nil { return ClientActiveRequests{noop.Int64UpDownCounter{}}, err } return ClientActiveRequests{i}, nil } // Inst returns the underlying metric instrument. func (m ClientActiveRequests) Inst() metric.Int64UpDownCounter { return m.Int64UpDownCounter } // Name returns the semantic convention name of the instrument. func (ClientActiveRequests) Name() string { return "http.client.active_requests" } // Unit returns the semantic convention unit of the instrument func (ClientActiveRequests) Unit() string { return "{request}" } // Description returns the semantic convention description of the instrument func (ClientActiveRequests) Description() string { return "Number of active HTTP requests." } // Add adds incr to the existing count for attrs. // // The serverAddress is the server domain name if available without reverse DNS // lookup; otherwise, IP address or Unix domain socket name. // // The serverPort is the server port number. // // All additional attrs passed are included in the recorded value. func (m ClientActiveRequests) Add( ctx context.Context, incr int64, serverAddress string, serverPort int, attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { m.Int64UpDownCounter.Add(ctx, incr) return } o := addOptPool.Get().(*[]metric.AddOption) defer func() { *o = (*o)[:0] addOptPool.Put(o) }() *o = append( *o, metric.WithAttributes( append( attrs, attribute.String("server.address", serverAddress), attribute.Int("server.port", serverPort), )..., ), ) m.Int64UpDownCounter.Add(ctx, incr, *o...) } // AddSet adds incr to the existing count for set. func (m ClientActiveRequests) AddSet(ctx context.Context, incr int64, set attribute.Set) { if set.Len() == 0 { m.Int64UpDownCounter.Add(ctx, incr) return } o := addOptPool.Get().(*[]metric.AddOption) defer func() { *o = (*o)[:0] addOptPool.Put(o) }() *o = append(*o, metric.WithAttributeSet(set)) m.Int64UpDownCounter.Add(ctx, incr, *o...) } // AttrURLTemplate returns an optional attribute for the "url.template" semantic // convention. It represents the low-cardinality template of an // [absolute path reference]. // // [absolute path reference]: https://www.rfc-editor.org/rfc/rfc3986#section-4.2 func (ClientActiveRequests) AttrURLTemplate(val string) attribute.KeyValue { return attribute.String("url.template", val) } // AttrRequestMethod returns an optional attribute for the "http.request.method" // semantic convention. It represents the HTTP request method. func (ClientActiveRequests) AttrRequestMethod(val RequestMethodAttr) attribute.KeyValue { return attribute.String("http.request.method", string(val)) } // AttrURLScheme returns an optional attribute for the "url.scheme" semantic // convention. It represents the [URI scheme] component identifying the used // protocol. // // [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1 func (ClientActiveRequests) AttrURLScheme(val string) attribute.KeyValue { return attribute.String("url.scheme", val) } // ClientConnectionDuration is an instrument used to record metric values // conforming to the "http.client.connection.duration" semantic conventions. It // represents the duration of the successfully established outbound HTTP // connections. type ClientConnectionDuration struct { metric.Float64Histogram } var newClientConnectionDurationOpts = []metric.Float64HistogramOption{ metric.WithDescription("The duration of the successfully established outbound HTTP connections."), metric.WithUnit("s"), } // NewClientConnectionDuration returns a new ClientConnectionDuration instrument. func NewClientConnectionDuration( m metric.Meter, opt ...metric.Float64HistogramOption, ) (ClientConnectionDuration, error) { // Check if the meter is nil. if m == nil { return ClientConnectionDuration{noop.Float64Histogram{}}, nil } if len(opt) == 0 { opt = newClientConnectionDurationOpts } else { opt = append(opt, newClientConnectionDurationOpts...) } i, err := m.Float64Histogram( "http.client.connection.duration", opt..., ) if err != nil { return ClientConnectionDuration{noop.Float64Histogram{}}, err } return ClientConnectionDuration{i}, nil } // Inst returns the underlying metric instrument. func (m ClientConnectionDuration) Inst() metric.Float64Histogram { return m.Float64Histogram } // Name returns the semantic convention name of the instrument. func (ClientConnectionDuration) Name() string { return "http.client.connection.duration" } // Unit returns the semantic convention unit of the instrument func (ClientConnectionDuration) Unit() string { return "s" } // Description returns the semantic convention description of the instrument func (ClientConnectionDuration) Description() string { return "The duration of the successfully established outbound HTTP connections." } // Record records val to the current distribution for attrs. // // The serverAddress is the server domain name if available without reverse DNS // lookup; otherwise, IP address or Unix domain socket name. // // The serverPort is the server port number. // // All additional attrs passed are included in the recorded value. func (m ClientConnectionDuration) Record( ctx context.Context, val float64, serverAddress string, serverPort int, attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { m.Float64Histogram.Record(ctx, val) return } o := recOptPool.Get().(*[]metric.RecordOption) defer func() { *o = (*o)[:0] recOptPool.Put(o) }() *o = append( *o, metric.WithAttributes( append( attrs, attribute.String("server.address", serverAddress), attribute.Int("server.port", serverPort), )..., ), ) m.Float64Histogram.Record(ctx, val, *o...) } // RecordSet records val to the current distribution for set. func (m ClientConnectionDuration) RecordSet(ctx context.Context, val float64, set attribute.Set) { if set.Len() == 0 { m.Float64Histogram.Record(ctx, val) return } o := recOptPool.Get().(*[]metric.RecordOption) defer func() { *o = (*o)[:0] recOptPool.Put(o) }() *o = append(*o, metric.WithAttributeSet(set)) m.Float64Histogram.Record(ctx, val, *o...) } // AttrNetworkPeerAddress returns an optional attribute for the // "network.peer.address" semantic convention. It represents the peer address of // the network connection - IP address or Unix domain socket name. func (ClientConnectionDuration) AttrNetworkPeerAddress(val string) attribute.KeyValue { return attribute.String("network.peer.address", val) } // AttrNetworkProtocolVersion returns an optional attribute for the // "network.protocol.version" semantic convention. It represents the actual // version of the protocol used for network communication. func (ClientConnectionDuration) AttrNetworkProtocolVersion(val string) attribute.KeyValue { return attribute.String("network.protocol.version", val) } // AttrURLScheme returns an optional attribute for the "url.scheme" semantic // convention. It represents the [URI scheme] component identifying the used // protocol. // // [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1 func (ClientConnectionDuration) AttrURLScheme(val string) attribute.KeyValue { return attribute.String("url.scheme", val) } // ClientOpenConnections is an instrument used to record metric values conforming // to the "http.client.open_connections" semantic conventions. It represents the // number of outbound HTTP connections that are currently active or idle on the // client. type ClientOpenConnections struct { metric.Int64UpDownCounter } var newClientOpenConnectionsOpts = []metric.Int64UpDownCounterOption{ metric.WithDescription("Number of outbound HTTP connections that are currently active or idle on the client."), metric.WithUnit("{connection}"), } // NewClientOpenConnections returns a new ClientOpenConnections instrument. func NewClientOpenConnections( m metric.Meter, opt ...metric.Int64UpDownCounterOption, ) (ClientOpenConnections, error) { // Check if the meter is nil. if m == nil { return ClientOpenConnections{noop.Int64UpDownCounter{}}, nil } if len(opt) == 0 { opt = newClientOpenConnectionsOpts } else { opt = append(opt, newClientOpenConnectionsOpts...) } i, err := m.Int64UpDownCounter( "http.client.open_connections", opt..., ) if err != nil { return ClientOpenConnections{noop.Int64UpDownCounter{}}, err } return ClientOpenConnections{i}, nil } // Inst returns the underlying metric instrument. func (m ClientOpenConnections) Inst() metric.Int64UpDownCounter { return m.Int64UpDownCounter } // Name returns the semantic convention name of the instrument. func (ClientOpenConnections) Name() string { return "http.client.open_connections" } // Unit returns the semantic convention unit of the instrument func (ClientOpenConnections) Unit() string { return "{connection}" } // Description returns the semantic convention description of the instrument func (ClientOpenConnections) Description() string { return "Number of outbound HTTP connections that are currently active or idle on the client." } // Add adds incr to the existing count for attrs. // // The connectionState is the state of the HTTP connection in the HTTP connection // pool. // // The serverAddress is the server domain name if available without reverse DNS // lookup; otherwise, IP address or Unix domain socket name. // // The serverPort is the server port number. // // All additional attrs passed are included in the recorded value. func (m ClientOpenConnections) Add( ctx context.Context, incr int64, connectionState ConnectionStateAttr, serverAddress string, serverPort int, attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { m.Int64UpDownCounter.Add(ctx, incr) return } o := addOptPool.Get().(*[]metric.AddOption) defer func() { *o = (*o)[:0] addOptPool.Put(o) }() *o = append( *o, metric.WithAttributes( append( attrs, attribute.String("http.connection.state", string(connectionState)), attribute.String("server.address", serverAddress), attribute.Int("server.port", serverPort), )..., ), ) m.Int64UpDownCounter.Add(ctx, incr, *o...) } // AddSet adds incr to the existing count for set. func (m ClientOpenConnections) AddSet(ctx context.Context, incr int64, set attribute.Set) { if set.Len() == 0 { m.Int64UpDownCounter.Add(ctx, incr) return } o := addOptPool.Get().(*[]metric.AddOption) defer func() { *o = (*o)[:0] addOptPool.Put(o) }() *o = append(*o, metric.WithAttributeSet(set)) m.Int64UpDownCounter.Add(ctx, incr, *o...) } // AttrNetworkPeerAddress returns an optional attribute for the // "network.peer.address" semantic convention. It represents the peer address of // the network connection - IP address or Unix domain socket name. func (ClientOpenConnections) AttrNetworkPeerAddress(val string) attribute.KeyValue { return attribute.String("network.peer.address", val) } // AttrNetworkProtocolVersion returns an optional attribute for the // "network.protocol.version" semantic convention. It represents the actual // version of the protocol used for network communication. func (ClientOpenConnections) AttrNetworkProtocolVersion(val string) attribute.KeyValue { return attribute.String("network.protocol.version", val) } // AttrURLScheme returns an optional attribute for the "url.scheme" semantic // convention. It represents the [URI scheme] component identifying the used // protocol. // // [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1 func (ClientOpenConnections) AttrURLScheme(val string) attribute.KeyValue { return attribute.String("url.scheme", val) } // ClientRequestBodySize is an instrument used to record metric values conforming // to the "http.client.request.body.size" semantic conventions. It represents the // size of HTTP client request bodies. type ClientRequestBodySize struct { metric.Int64Histogram } var newClientRequestBodySizeOpts = []metric.Int64HistogramOption{ metric.WithDescription("Size of HTTP client request bodies."), metric.WithUnit("By"), } // NewClientRequestBodySize returns a new ClientRequestBodySize instrument. func NewClientRequestBodySize( m metric.Meter, opt ...metric.Int64HistogramOption, ) (ClientRequestBodySize, error) { // Check if the meter is nil. if m == nil { return ClientRequestBodySize{noop.Int64Histogram{}}, nil } if len(opt) == 0 { opt = newClientRequestBodySizeOpts } else { opt = append(opt, newClientRequestBodySizeOpts...) } i, err := m.Int64Histogram( "http.client.request.body.size", opt..., ) if err != nil { return ClientRequestBodySize{noop.Int64Histogram{}}, err } return ClientRequestBodySize{i}, nil } // Inst returns the underlying metric instrument. func (m ClientRequestBodySize) Inst() metric.Int64Histogram { return m.Int64Histogram } // Name returns the semantic convention name of the instrument. func (ClientRequestBodySize) Name() string { return "http.client.request.body.size" } // Unit returns the semantic convention unit of the instrument func (ClientRequestBodySize) Unit() string { return "By" } // Description returns the semantic convention description of the instrument func (ClientRequestBodySize) Description() string { return "Size of HTTP client request bodies." } // Record records val to the current distribution for attrs. // // The requestMethod is the HTTP request method. // // The serverAddress is the server domain name if available without reverse DNS // lookup; otherwise, IP address or Unix domain socket name. // // The serverPort is the server port number. // // All additional attrs passed are included in the recorded value. // // The size of the request payload body in bytes. This is the number of bytes // transferred excluding headers and is often, but not always, present as the // [Content-Length] header. For requests using transport encoding, this should be // the compressed size. // // [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length func (m ClientRequestBodySize) Record( ctx context.Context, val int64, requestMethod RequestMethodAttr, serverAddress string, serverPort int, attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { m.Int64Histogram.Record(ctx, val) return } o := recOptPool.Get().(*[]metric.RecordOption) defer func() { *o = (*o)[:0] recOptPool.Put(o) }() *o = append( *o, metric.WithAttributes( append( attrs, attribute.String("http.request.method", string(requestMethod)), attribute.String("server.address", serverAddress), attribute.Int("server.port", serverPort), )..., ), ) m.Int64Histogram.Record(ctx, val, *o...) } // RecordSet records val to the current distribution for set. // // The size of the request payload body in bytes. This is the number of bytes // transferred excluding headers and is often, but not always, present as the // [Content-Length] header. For requests using transport encoding, this should be // the compressed size. // // [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length func (m ClientRequestBodySize) RecordSet(ctx context.Context, val int64, set attribute.Set) { if set.Len() == 0 { m.Int64Histogram.Record(ctx, val) return } o := recOptPool.Get().(*[]metric.RecordOption) defer func() { *o = (*o)[:0] recOptPool.Put(o) }() *o = append(*o, metric.WithAttributeSet(set)) m.Int64Histogram.Record(ctx, val, *o...) } // AttrErrorType returns an optional attribute for the "error.type" semantic // convention. It represents the describes a class of error the operation ended // with. func (ClientRequestBodySize) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue { return attribute.String("error.type", string(val)) } // AttrResponseStatusCode returns an optional attribute for the // "http.response.status_code" semantic convention. It represents the // [HTTP response status code]. // // [HTTP response status code]: https://tools.ietf.org/html/rfc7231#section-6 func (ClientRequestBodySize) AttrResponseStatusCode(val int) attribute.KeyValue { return attribute.Int("http.response.status_code", val) } // AttrNetworkProtocolName returns an optional attribute for the // "network.protocol.name" semantic convention. It represents the // [OSI application layer] or non-OSI equivalent. // // [OSI application layer]: https://wikipedia.org/wiki/Application_layer func (ClientRequestBodySize) AttrNetworkProtocolName(val string) attribute.KeyValue { return attribute.String("network.protocol.name", val) } // AttrURLTemplate returns an optional attribute for the "url.template" semantic // convention. It represents the low-cardinality template of an // [absolute path reference]. // // [absolute path reference]: https://www.rfc-editor.org/rfc/rfc3986#section-4.2 func (ClientRequestBodySize) AttrURLTemplate(val string) attribute.KeyValue { return attribute.String("url.template", val) } // AttrNetworkProtocolVersion returns an optional attribute for the // "network.protocol.version" semantic convention. It represents the actual // version of the protocol used for network communication. func (ClientRequestBodySize) AttrNetworkProtocolVersion(val string) attribute.KeyValue { return attribute.String("network.protocol.version", val) } // AttrURLScheme returns an optional attribute for the "url.scheme" semantic // convention. It represents the [URI scheme] component identifying the used // protocol. // // [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1 func (ClientRequestBodySize) AttrURLScheme(val string) attribute.KeyValue { return attribute.String("url.scheme", val) } // ClientRequestDuration is an instrument used to record metric values conforming // to the "http.client.request.duration" semantic conventions. It represents the // duration of HTTP client requests. type ClientRequestDuration struct { metric.Float64Histogram } var newClientRequestDurationOpts = []metric.Float64HistogramOption{ metric.WithDescription("Duration of HTTP client requests."), metric.WithUnit("s"), } // NewClientRequestDuration returns a new ClientRequestDuration instrument. func NewClientRequestDuration( m metric.Meter, opt ...metric.Float64HistogramOption, ) (ClientRequestDuration, error) { // Check if the meter is nil. if m == nil { return ClientRequestDuration{noop.Float64Histogram{}}, nil } if len(opt) == 0 { opt = newClientRequestDurationOpts } else { opt = append(opt, newClientRequestDurationOpts...) } i, err := m.Float64Histogram( "http.client.request.duration", opt..., ) if err != nil { return ClientRequestDuration{noop.Float64Histogram{}}, err } return ClientRequestDuration{i}, nil } // Inst returns the underlying metric instrument. func (m ClientRequestDuration) Inst() metric.Float64Histogram { return m.Float64Histogram } // Name returns the semantic convention name of the instrument. func (ClientRequestDuration) Name() string { return "http.client.request.duration" } // Unit returns the semantic convention unit of the instrument func (ClientRequestDuration) Unit() string { return "s" } // Description returns the semantic convention description of the instrument func (ClientRequestDuration) Description() string { return "Duration of HTTP client requests." } // Record records val to the current distribution for attrs. // // The requestMethod is the HTTP request method. // // The serverAddress is the server domain name if available without reverse DNS // lookup; otherwise, IP address or Unix domain socket name. // // The serverPort is the server port number. // // All additional attrs passed are included in the recorded value. func (m ClientRequestDuration) Record( ctx context.Context, val float64, requestMethod RequestMethodAttr, serverAddress string, serverPort int, attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { m.Float64Histogram.Record(ctx, val) return } o := recOptPool.Get().(*[]metric.RecordOption) defer func() { *o = (*o)[:0] recOptPool.Put(o) }() *o = append( *o, metric.WithAttributes( append( attrs, attribute.String("http.request.method", string(requestMethod)), attribute.String("server.address", serverAddress), attribute.Int("server.port", serverPort), )..., ), ) m.Float64Histogram.Record(ctx, val, *o...) } // RecordSet records val to the current distribution for set. func (m ClientRequestDuration) RecordSet(ctx context.Context, val float64, set attribute.Set) { if set.Len() == 0 { m.Float64Histogram.Record(ctx, val) return } o := recOptPool.Get().(*[]metric.RecordOption) defer func() { *o = (*o)[:0] recOptPool.Put(o) }() *o = append(*o, metric.WithAttributeSet(set)) m.Float64Histogram.Record(ctx, val, *o...) } // AttrErrorType returns an optional attribute for the "error.type" semantic // convention. It represents the describes a class of error the operation ended // with. func (ClientRequestDuration) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue { return attribute.String("error.type", string(val)) } // AttrResponseStatusCode returns an optional attribute for the // "http.response.status_code" semantic convention. It represents the // [HTTP response status code]. // // [HTTP response status code]: https://tools.ietf.org/html/rfc7231#section-6 func (ClientRequestDuration) AttrResponseStatusCode(val int) attribute.KeyValue { return attribute.Int("http.response.status_code", val) } // AttrNetworkProtocolName returns an optional attribute for the // "network.protocol.name" semantic convention. It represents the // [OSI application layer] or non-OSI equivalent. // // [OSI application layer]: https://wikipedia.org/wiki/Application_layer func (ClientRequestDuration) AttrNetworkProtocolName(val string) attribute.KeyValue { return attribute.String("network.protocol.name", val) } // AttrNetworkProtocolVersion returns an optional attribute for the // "network.protocol.version" semantic convention. It represents the actual // version of the protocol used for network communication. func (ClientRequestDuration) AttrNetworkProtocolVersion(val string) attribute.KeyValue { return attribute.String("network.protocol.version", val) } // AttrURLScheme returns an optional attribute for the "url.scheme" semantic // convention. It represents the [URI scheme] component identifying the used // protocol. // // [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1 func (ClientRequestDuration) AttrURLScheme(val string) attribute.KeyValue { return attribute.String("url.scheme", val) } // AttrURLTemplate returns an optional attribute for the "url.template" semantic // convention. It represents the low-cardinality template of an // [absolute path reference]. // // [absolute path reference]: https://www.rfc-editor.org/rfc/rfc3986#section-4.2 func (ClientRequestDuration) AttrURLTemplate(val string) attribute.KeyValue { return attribute.String("url.template", val) } // ClientResponseBodySize is an instrument used to record metric values // conforming to the "http.client.response.body.size" semantic conventions. It // represents the size of HTTP client response bodies. type ClientResponseBodySize struct { metric.Int64Histogram } var newClientResponseBodySizeOpts = []metric.Int64HistogramOption{ metric.WithDescription("Size of HTTP client response bodies."), metric.WithUnit("By"), } // NewClientResponseBodySize returns a new ClientResponseBodySize instrument. func NewClientResponseBodySize( m metric.Meter, opt ...metric.Int64HistogramOption, ) (ClientResponseBodySize, error) { // Check if the meter is nil. if m == nil { return ClientResponseBodySize{noop.Int64Histogram{}}, nil } if len(opt) == 0 { opt = newClientResponseBodySizeOpts } else { opt = append(opt, newClientResponseBodySizeOpts...) } i, err := m.Int64Histogram( "http.client.response.body.size", opt..., ) if err != nil { return ClientResponseBodySize{noop.Int64Histogram{}}, err } return ClientResponseBodySize{i}, nil } // Inst returns the underlying metric instrument. func (m ClientResponseBodySize) Inst() metric.Int64Histogram { return m.Int64Histogram } // Name returns the semantic convention name of the instrument. func (ClientResponseBodySize) Name() string { return "http.client.response.body.size" } // Unit returns the semantic convention unit of the instrument func (ClientResponseBodySize) Unit() string { return "By" } // Description returns the semantic convention description of the instrument func (ClientResponseBodySize) Description() string { return "Size of HTTP client response bodies." } // Record records val to the current distribution for attrs. // // The requestMethod is the HTTP request method. // // The serverAddress is the server domain name if available without reverse DNS // lookup; otherwise, IP address or Unix domain socket name. // // The serverPort is the server port number. // // All additional attrs passed are included in the recorded value. // // The size of the response payload body in bytes. This is the number of bytes // transferred excluding headers and is often, but not always, present as the // [Content-Length] header. For requests using transport encoding, this should be // the compressed size. // // [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length func (m ClientResponseBodySize) Record( ctx context.Context, val int64, requestMethod RequestMethodAttr, serverAddress string, serverPort int, attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { m.Int64Histogram.Record(ctx, val) return } o := recOptPool.Get().(*[]metric.RecordOption) defer func() { *o = (*o)[:0] recOptPool.Put(o) }() *o = append( *o, metric.WithAttributes( append( attrs, attribute.String("http.request.method", string(requestMethod)), attribute.String("server.address", serverAddress), attribute.Int("server.port", serverPort), )..., ), ) m.Int64Histogram.Record(ctx, val, *o...) } // RecordSet records val to the current distribution for set. // // The size of the response payload body in bytes. This is the number of bytes // transferred excluding headers and is often, but not always, present as the // [Content-Length] header. For requests using transport encoding, this should be // the compressed size. // // [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length func (m ClientResponseBodySize) RecordSet(ctx context.Context, val int64, set attribute.Set) { if set.Len() == 0 { m.Int64Histogram.Record(ctx, val) return } o := recOptPool.Get().(*[]metric.RecordOption) defer func() { *o = (*o)[:0] recOptPool.Put(o) }() *o = append(*o, metric.WithAttributeSet(set)) m.Int64Histogram.Record(ctx, val, *o...) } // AttrErrorType returns an optional attribute for the "error.type" semantic // convention. It represents the describes a class of error the operation ended // with. func (ClientResponseBodySize) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue { return attribute.String("error.type", string(val)) } // AttrResponseStatusCode returns an optional attribute for the // "http.response.status_code" semantic convention. It represents the // [HTTP response status code]. // // [HTTP response status code]: https://tools.ietf.org/html/rfc7231#section-6 func (ClientResponseBodySize) AttrResponseStatusCode(val int) attribute.KeyValue { return attribute.Int("http.response.status_code", val) } // AttrNetworkProtocolName returns an optional attribute for the // "network.protocol.name" semantic convention. It represents the // [OSI application layer] or non-OSI equivalent. // // [OSI application layer]: https://wikipedia.org/wiki/Application_layer func (ClientResponseBodySize) AttrNetworkProtocolName(val string) attribute.KeyValue { return attribute.String("network.protocol.name", val) } // AttrURLTemplate returns an optional attribute for the "url.template" semantic // convention. It represents the low-cardinality template of an // [absolute path reference]. // // [absolute path reference]: https://www.rfc-editor.org/rfc/rfc3986#section-4.2 func (ClientResponseBodySize) AttrURLTemplate(val string) attribute.KeyValue { return attribute.String("url.template", val) } // AttrNetworkProtocolVersion returns an optional attribute for the // "network.protocol.version" semantic convention. It represents the actual // version of the protocol used for network communication. func (ClientResponseBodySize) AttrNetworkProtocolVersion(val string) attribute.KeyValue { return attribute.String("network.protocol.version", val) } // AttrURLScheme returns an optional attribute for the "url.scheme" semantic // convention. It represents the [URI scheme] component identifying the used // protocol. // // [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1 func (ClientResponseBodySize) AttrURLScheme(val string) attribute.KeyValue { return attribute.String("url.scheme", val) } // ServerActiveRequests is an instrument used to record metric values conforming // to the "http.server.active_requests" semantic conventions. It represents the // number of active HTTP server requests. type ServerActiveRequests struct { metric.Int64UpDownCounter } var newServerActiveRequestsOpts = []metric.Int64UpDownCounterOption{ metric.WithDescription("Number of active HTTP server requests."), metric.WithUnit("{request}"), } // NewServerActiveRequests returns a new ServerActiveRequests instrument. func NewServerActiveRequests( m metric.Meter, opt ...metric.Int64UpDownCounterOption, ) (ServerActiveRequests, error) { // Check if the meter is nil. if m == nil { return ServerActiveRequests{noop.Int64UpDownCounter{}}, nil } if len(opt) == 0 { opt = newServerActiveRequestsOpts } else { opt = append(opt, newServerActiveRequestsOpts...) } i, err := m.Int64UpDownCounter( "http.server.active_requests", opt..., ) if err != nil { return ServerActiveRequests{noop.Int64UpDownCounter{}}, err } return ServerActiveRequests{i}, nil } // Inst returns the underlying metric instrument. func (m ServerActiveRequests) Inst() metric.Int64UpDownCounter { return m.Int64UpDownCounter } // Name returns the semantic convention name of the instrument. func (ServerActiveRequests) Name() string { return "http.server.active_requests" } // Unit returns the semantic convention unit of the instrument func (ServerActiveRequests) Unit() string { return "{request}" } // Description returns the semantic convention description of the instrument func (ServerActiveRequests) Description() string { return "Number of active HTTP server requests." } // Add adds incr to the existing count for attrs. // // The requestMethod is the HTTP request method. // // The urlScheme is the the [URI scheme] component identifying the used protocol. // // All additional attrs passed are included in the recorded value. // // [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1 func (m ServerActiveRequests) Add( ctx context.Context, incr int64, requestMethod RequestMethodAttr, urlScheme string, attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { m.Int64UpDownCounter.Add(ctx, incr) return } o := addOptPool.Get().(*[]metric.AddOption) defer func() { *o = (*o)[:0] addOptPool.Put(o) }() *o = append( *o, metric.WithAttributes( append( attrs, attribute.String("http.request.method", string(requestMethod)), attribute.String("url.scheme", urlScheme), )..., ), ) m.Int64UpDownCounter.Add(ctx, incr, *o...) } // AddSet adds incr to the existing count for set. func (m ServerActiveRequests) AddSet(ctx context.Context, incr int64, set attribute.Set) { if set.Len() == 0 { m.Int64UpDownCounter.Add(ctx, incr) return } o := addOptPool.Get().(*[]metric.AddOption) defer func() { *o = (*o)[:0] addOptPool.Put(o) }() *o = append(*o, metric.WithAttributeSet(set)) m.Int64UpDownCounter.Add(ctx, incr, *o...) } // AttrServerAddress returns an optional attribute for the "server.address" // semantic convention. It represents the name of the local HTTP server that // received the request. func (ServerActiveRequests) AttrServerAddress(val string) attribute.KeyValue { return attribute.String("server.address", val) } // AttrServerPort returns an optional attribute for the "server.port" semantic // convention. It represents the port of the local HTTP server that received the // request. func (ServerActiveRequests) AttrServerPort(val int) attribute.KeyValue { return attribute.Int("server.port", val) } // ServerRequestBodySize is an instrument used to record metric values conforming // to the "http.server.request.body.size" semantic conventions. It represents the // size of HTTP server request bodies. type ServerRequestBodySize struct { metric.Int64Histogram } var newServerRequestBodySizeOpts = []metric.Int64HistogramOption{ metric.WithDescription("Size of HTTP server request bodies."), metric.WithUnit("By"), } // NewServerRequestBodySize returns a new ServerRequestBodySize instrument. func NewServerRequestBodySize( m metric.Meter, opt ...metric.Int64HistogramOption, ) (ServerRequestBodySize, error) { // Check if the meter is nil. if m == nil { return ServerRequestBodySize{noop.Int64Histogram{}}, nil } if len(opt) == 0 { opt = newServerRequestBodySizeOpts } else { opt = append(opt, newServerRequestBodySizeOpts...) } i, err := m.Int64Histogram( "http.server.request.body.size", opt..., ) if err != nil { return ServerRequestBodySize{noop.Int64Histogram{}}, err } return ServerRequestBodySize{i}, nil } // Inst returns the underlying metric instrument. func (m ServerRequestBodySize) Inst() metric.Int64Histogram { return m.Int64Histogram } // Name returns the semantic convention name of the instrument. func (ServerRequestBodySize) Name() string { return "http.server.request.body.size" } // Unit returns the semantic convention unit of the instrument func (ServerRequestBodySize) Unit() string { return "By" } // Description returns the semantic convention description of the instrument func (ServerRequestBodySize) Description() string { return "Size of HTTP server request bodies." } // Record records val to the current distribution for attrs. // // The requestMethod is the HTTP request method. // // The urlScheme is the the [URI scheme] component identifying the used protocol. // // All additional attrs passed are included in the recorded value. // // [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1 // // The size of the request payload body in bytes. This is the number of bytes // transferred excluding headers and is often, but not always, present as the // [Content-Length] header. For requests using transport encoding, this should be // the compressed size. // // [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length func (m ServerRequestBodySize) Record( ctx context.Context, val int64, requestMethod RequestMethodAttr, urlScheme string, attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { m.Int64Histogram.Record(ctx, val) return } o := recOptPool.Get().(*[]metric.RecordOption) defer func() { *o = (*o)[:0] recOptPool.Put(o) }() *o = append( *o, metric.WithAttributes( append( attrs, attribute.String("http.request.method", string(requestMethod)), attribute.String("url.scheme", urlScheme), )..., ), ) m.Int64Histogram.Record(ctx, val, *o...) } // RecordSet records val to the current distribution for set. // // The size of the request payload body in bytes. This is the number of bytes // transferred excluding headers and is often, but not always, present as the // [Content-Length] header. For requests using transport encoding, this should be // the compressed size. // // [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length func (m ServerRequestBodySize) RecordSet(ctx context.Context, val int64, set attribute.Set) { if set.Len() == 0 { m.Int64Histogram.Record(ctx, val) return } o := recOptPool.Get().(*[]metric.RecordOption) defer func() { *o = (*o)[:0] recOptPool.Put(o) }() *o = append(*o, metric.WithAttributeSet(set)) m.Int64Histogram.Record(ctx, val, *o...) } // AttrErrorType returns an optional attribute for the "error.type" semantic // convention. It represents the describes a class of error the operation ended // with. func (ServerRequestBodySize) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue { return attribute.String("error.type", string(val)) } // AttrResponseStatusCode returns an optional attribute for the // "http.response.status_code" semantic convention. It represents the // [HTTP response status code]. // // [HTTP response status code]: https://tools.ietf.org/html/rfc7231#section-6 func (ServerRequestBodySize) AttrResponseStatusCode(val int) attribute.KeyValue { return attribute.Int("http.response.status_code", val) } // AttrRoute returns an optional attribute for the "http.route" semantic // convention. It represents the matched route template for the request. This // MUST be low-cardinality and include all static path segments, with dynamic // path segments represented with placeholders. func (ServerRequestBodySize) AttrRoute(val string) attribute.KeyValue { return attribute.String("http.route", val) } // AttrNetworkProtocolName returns an optional attribute for the // "network.protocol.name" semantic convention. It represents the // [OSI application layer] or non-OSI equivalent. // // [OSI application layer]: https://wikipedia.org/wiki/Application_layer func (ServerRequestBodySize) AttrNetworkProtocolName(val string) attribute.KeyValue { return attribute.String("network.protocol.name", val) } // AttrNetworkProtocolVersion returns an optional attribute for the // "network.protocol.version" semantic convention. It represents the actual // version of the protocol used for network communication. func (ServerRequestBodySize) AttrNetworkProtocolVersion(val string) attribute.KeyValue { return attribute.String("network.protocol.version", val) } // AttrServerAddress returns an optional attribute for the "server.address" // semantic convention. It represents the name of the local HTTP server that // received the request. func (ServerRequestBodySize) AttrServerAddress(val string) attribute.KeyValue { return attribute.String("server.address", val) } // AttrServerPort returns an optional attribute for the "server.port" semantic // convention. It represents the port of the local HTTP server that received the // request. func (ServerRequestBodySize) AttrServerPort(val int) attribute.KeyValue { return attribute.Int("server.port", val) } // AttrUserAgentSyntheticType returns an optional attribute for the // "user_agent.synthetic.type" semantic convention. It represents the specifies // the category of synthetic traffic, such as tests or bots. func (ServerRequestBodySize) AttrUserAgentSyntheticType(val UserAgentSyntheticTypeAttr) attribute.KeyValue { return attribute.String("user_agent.synthetic.type", string(val)) } // ServerRequestDuration is an instrument used to record metric values conforming // to the "http.server.request.duration" semantic conventions. It represents the // duration of HTTP server requests. type ServerRequestDuration struct { metric.Float64Histogram } var newServerRequestDurationOpts = []metric.Float64HistogramOption{ metric.WithDescription("Duration of HTTP server requests."), metric.WithUnit("s"), } // NewServerRequestDuration returns a new ServerRequestDuration instrument. func NewServerRequestDuration( m metric.Meter, opt ...metric.Float64HistogramOption, ) (ServerRequestDuration, error) { // Check if the meter is nil. if m == nil { return ServerRequestDuration{noop.Float64Histogram{}}, nil } if len(opt) == 0 { opt = newServerRequestDurationOpts } else { opt = append(opt, newServerRequestDurationOpts...) } i, err := m.Float64Histogram( "http.server.request.duration", opt..., ) if err != nil { return ServerRequestDuration{noop.Float64Histogram{}}, err } return ServerRequestDuration{i}, nil } // Inst returns the underlying metric instrument. func (m ServerRequestDuration) Inst() metric.Float64Histogram { return m.Float64Histogram } // Name returns the semantic convention name of the instrument. func (ServerRequestDuration) Name() string { return "http.server.request.duration" } // Unit returns the semantic convention unit of the instrument func (ServerRequestDuration) Unit() string { return "s" } // Description returns the semantic convention description of the instrument func (ServerRequestDuration) Description() string { return "Duration of HTTP server requests." } // Record records val to the current distribution for attrs. // // The requestMethod is the HTTP request method. // // The urlScheme is the the [URI scheme] component identifying the used protocol. // // All additional attrs passed are included in the recorded value. // // [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1 func (m ServerRequestDuration) Record( ctx context.Context, val float64, requestMethod RequestMethodAttr, urlScheme string, attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { m.Float64Histogram.Record(ctx, val) return } o := recOptPool.Get().(*[]metric.RecordOption) defer func() { *o = (*o)[:0] recOptPool.Put(o) }() *o = append( *o, metric.WithAttributes( append( attrs, attribute.String("http.request.method", string(requestMethod)), attribute.String("url.scheme", urlScheme), )..., ), ) m.Float64Histogram.Record(ctx, val, *o...) } // RecordSet records val to the current distribution for set. func (m ServerRequestDuration) RecordSet(ctx context.Context, val float64, set attribute.Set) { if set.Len() == 0 { m.Float64Histogram.Record(ctx, val) return } o := recOptPool.Get().(*[]metric.RecordOption) defer func() { *o = (*o)[:0] recOptPool.Put(o) }() *o = append(*o, metric.WithAttributeSet(set)) m.Float64Histogram.Record(ctx, val, *o...) } // AttrErrorType returns an optional attribute for the "error.type" semantic // convention. It represents the describes a class of error the operation ended // with. func (ServerRequestDuration) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue { return attribute.String("error.type", string(val)) } // AttrResponseStatusCode returns an optional attribute for the // "http.response.status_code" semantic convention. It represents the // [HTTP response status code]. // // [HTTP response status code]: https://tools.ietf.org/html/rfc7231#section-6 func (ServerRequestDuration) AttrResponseStatusCode(val int) attribute.KeyValue { return attribute.Int("http.response.status_code", val) } // AttrRoute returns an optional attribute for the "http.route" semantic // convention. It represents the matched route template for the request. This // MUST be low-cardinality and include all static path segments, with dynamic // path segments represented with placeholders. func (ServerRequestDuration) AttrRoute(val string) attribute.KeyValue { return attribute.String("http.route", val) } // AttrNetworkProtocolName returns an optional attribute for the // "network.protocol.name" semantic convention. It represents the // [OSI application layer] or non-OSI equivalent. // // [OSI application layer]: https://wikipedia.org/wiki/Application_layer func (ServerRequestDuration) AttrNetworkProtocolName(val string) attribute.KeyValue { return attribute.String("network.protocol.name", val) } // AttrNetworkProtocolVersion returns an optional attribute for the // "network.protocol.version" semantic convention. It represents the actual // version of the protocol used for network communication. func (ServerRequestDuration) AttrNetworkProtocolVersion(val string) attribute.KeyValue { return attribute.String("network.protocol.version", val) } // AttrServerAddress returns an optional attribute for the "server.address" // semantic convention. It represents the name of the local HTTP server that // received the request. func (ServerRequestDuration) AttrServerAddress(val string) attribute.KeyValue { return attribute.String("server.address", val) } // AttrServerPort returns an optional attribute for the "server.port" semantic // convention. It represents the port of the local HTTP server that received the // request. func (ServerRequestDuration) AttrServerPort(val int) attribute.KeyValue { return attribute.Int("server.port", val) } // AttrUserAgentSyntheticType returns an optional attribute for the // "user_agent.synthetic.type" semantic convention. It represents the specifies // the category of synthetic traffic, such as tests or bots. func (ServerRequestDuration) AttrUserAgentSyntheticType(val UserAgentSyntheticTypeAttr) attribute.KeyValue { return attribute.String("user_agent.synthetic.type", string(val)) } // ServerResponseBodySize is an instrument used to record metric values // conforming to the "http.server.response.body.size" semantic conventions. It // represents the size of HTTP server response bodies. type ServerResponseBodySize struct { metric.Int64Histogram } var newServerResponseBodySizeOpts = []metric.Int64HistogramOption{ metric.WithDescription("Size of HTTP server response bodies."), metric.WithUnit("By"), } // NewServerResponseBodySize returns a new ServerResponseBodySize instrument. func NewServerResponseBodySize( m metric.Meter, opt ...metric.Int64HistogramOption, ) (ServerResponseBodySize, error) { // Check if the meter is nil. if m == nil { return ServerResponseBodySize{noop.Int64Histogram{}}, nil } if len(opt) == 0 { opt = newServerResponseBodySizeOpts } else { opt = append(opt, newServerResponseBodySizeOpts...) } i, err := m.Int64Histogram( "http.server.response.body.size", opt..., ) if err != nil { return ServerResponseBodySize{noop.Int64Histogram{}}, err } return ServerResponseBodySize{i}, nil } // Inst returns the underlying metric instrument. func (m ServerResponseBodySize) Inst() metric.Int64Histogram { return m.Int64Histogram } // Name returns the semantic convention name of the instrument. func (ServerResponseBodySize) Name() string { return "http.server.response.body.size" } // Unit returns the semantic convention unit of the instrument func (ServerResponseBodySize) Unit() string { return "By" } // Description returns the semantic convention description of the instrument func (ServerResponseBodySize) Description() string { return "Size of HTTP server response bodies." } // Record records val to the current distribution for attrs. // // The requestMethod is the HTTP request method. // // The urlScheme is the the [URI scheme] component identifying the used protocol. // // All additional attrs passed are included in the recorded value. // // [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1 // // The size of the response payload body in bytes. This is the number of bytes // transferred excluding headers and is often, but not always, present as the // [Content-Length] header. For requests using transport encoding, this should be // the compressed size. // // [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length func (m ServerResponseBodySize) Record( ctx context.Context, val int64, requestMethod RequestMethodAttr, urlScheme string, attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { m.Int64Histogram.Record(ctx, val) return } o := recOptPool.Get().(*[]metric.RecordOption) defer func() { *o = (*o)[:0] recOptPool.Put(o) }() *o = append( *o, metric.WithAttributes( append( attrs, attribute.String("http.request.method", string(requestMethod)), attribute.String("url.scheme", urlScheme), )..., ), ) m.Int64Histogram.Record(ctx, val, *o...) } // RecordSet records val to the current distribution for set. // // The size of the response payload body in bytes. This is the number of bytes // transferred excluding headers and is often, but not always, present as the // [Content-Length] header. For requests using transport encoding, this should be // the compressed size. // // [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length func (m ServerResponseBodySize) RecordSet(ctx context.Context, val int64, set attribute.Set) { if set.Len() == 0 { m.Int64Histogram.Record(ctx, val) return } o := recOptPool.Get().(*[]metric.RecordOption) defer func() { *o = (*o)[:0] recOptPool.Put(o) }() *o = append(*o, metric.WithAttributeSet(set)) m.Int64Histogram.Record(ctx, val, *o...) } // AttrErrorType returns an optional attribute for the "error.type" semantic // convention. It represents the describes a class of error the operation ended // with. func (ServerResponseBodySize) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue { return attribute.String("error.type", string(val)) } // AttrResponseStatusCode returns an optional attribute for the // "http.response.status_code" semantic convention. It represents the // [HTTP response status code]. // // [HTTP response status code]: https://tools.ietf.org/html/rfc7231#section-6 func (ServerResponseBodySize) AttrResponseStatusCode(val int) attribute.KeyValue { return attribute.Int("http.response.status_code", val) } // AttrRoute returns an optional attribute for the "http.route" semantic // convention. It represents the matched route template for the request. This // MUST be low-cardinality and include all static path segments, with dynamic // path segments represented with placeholders. func (ServerResponseBodySize) AttrRoute(val string) attribute.KeyValue { return attribute.String("http.route", val) } // AttrNetworkProtocolName returns an optional attribute for the // "network.protocol.name" semantic convention. It represents the // [OSI application layer] or non-OSI equivalent. // // [OSI application layer]: https://wikipedia.org/wiki/Application_layer func (ServerResponseBodySize) AttrNetworkProtocolName(val string) attribute.KeyValue { return attribute.String("network.protocol.name", val) } // AttrNetworkProtocolVersion returns an optional attribute for the // "network.protocol.version" semantic convention. It represents the actual // version of the protocol used for network communication. func (ServerResponseBodySize) AttrNetworkProtocolVersion(val string) attribute.KeyValue { return attribute.String("network.protocol.version", val) } // AttrServerAddress returns an optional attribute for the "server.address" // semantic convention. It represents the name of the local HTTP server that // received the request. func (ServerResponseBodySize) AttrServerAddress(val string) attribute.KeyValue { return attribute.String("server.address", val) } // AttrServerPort returns an optional attribute for the "server.port" semantic // convention. It represents the port of the local HTTP server that received the // request. func (ServerResponseBodySize) AttrServerPort(val int) attribute.KeyValue { return attribute.Int("server.port", val) } // AttrUserAgentSyntheticType returns an optional attribute for the // "user_agent.synthetic.type" semantic convention. It represents the specifies // the category of synthetic traffic, such as tests or bots. func (ServerResponseBodySize) AttrUserAgentSyntheticType(val UserAgentSyntheticTypeAttr) attribute.KeyValue { return attribute.String("user_agent.synthetic.type", string(val)) } ================================================ FILE: vendor/go.opentelemetry.io/otel/semconv/v1.39.0/schema.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package semconv // import "go.opentelemetry.io/otel/semconv/v1.39.0" // SchemaURL is the schema URL that matches the version of the semantic conventions // that this package defines. Semconv packages starting from v1.4.0 must declare // non-empty schema URL in the form https://opentelemetry.io/schemas/ const SchemaURL = "https://opentelemetry.io/schemas/1.39.0" ================================================ FILE: vendor/go.opentelemetry.io/otel/trace/LICENSE ================================================ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -------------------------------------------------------------------------------- Copyright 2009 The Go Authors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: vendor/go.opentelemetry.io/otel/trace/README.md ================================================ # Trace API [![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/trace)](https://pkg.go.dev/go.opentelemetry.io/otel/trace) ================================================ FILE: vendor/go.opentelemetry.io/otel/trace/auto.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package trace // import "go.opentelemetry.io/otel/trace" import ( "context" "encoding/json" "fmt" "math" "os" "reflect" "runtime" "strconv" "strings" "sync" "sync/atomic" "time" "unicode/utf8" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" semconv "go.opentelemetry.io/otel/semconv/v1.39.0" "go.opentelemetry.io/otel/trace/embedded" "go.opentelemetry.io/otel/trace/internal/telemetry" ) // newAutoTracerProvider returns an auto-instrumentable [trace.TracerProvider]. // If an [go.opentelemetry.io/auto.Instrumentation] is configured to instrument // the process using the returned TracerProvider, all of the telemetry it // produces will be processed and handled by that Instrumentation. By default, // if no Instrumentation instruments the TracerProvider it will not generate // any trace telemetry. func newAutoTracerProvider() TracerProvider { return tracerProviderInstance } var tracerProviderInstance = new(autoTracerProvider) type autoTracerProvider struct{ embedded.TracerProvider } var _ TracerProvider = autoTracerProvider{} func (autoTracerProvider) Tracer(name string, opts ...TracerOption) Tracer { cfg := NewTracerConfig(opts...) return autoTracer{ name: name, version: cfg.InstrumentationVersion(), schemaURL: cfg.SchemaURL(), } } type autoTracer struct { embedded.Tracer name, schemaURL, version string } var _ Tracer = autoTracer{} func (t autoTracer) Start(ctx context.Context, name string, opts ...SpanStartOption) (context.Context, Span) { var psc, sc SpanContext sampled := true span := new(autoSpan) // Ask eBPF for sampling decision and span context info. t.start(ctx, span, &psc, &sampled, &sc) span.sampled.Store(sampled) span.spanContext = sc ctx = ContextWithSpan(ctx, span) if sampled { // Only build traces if sampled. cfg := NewSpanStartConfig(opts...) span.traces, span.span = t.traces(name, cfg, span.spanContext, psc) } return ctx, span } // Expected to be implemented in eBPF. // //go:noinline func (*autoTracer) start( ctx context.Context, spanPtr *autoSpan, psc *SpanContext, sampled *bool, sc *SpanContext, ) { start(ctx, spanPtr, psc, sampled, sc) } // start is used for testing. var start = func(context.Context, *autoSpan, *SpanContext, *bool, *SpanContext) {} func (t autoTracer) traces(name string, cfg SpanConfig, sc, psc SpanContext) (*telemetry.Traces, *telemetry.Span) { span := &telemetry.Span{ TraceID: telemetry.TraceID(sc.TraceID()), SpanID: telemetry.SpanID(sc.SpanID()), Flags: uint32(sc.TraceFlags()), TraceState: sc.TraceState().String(), ParentSpanID: telemetry.SpanID(psc.SpanID()), Name: name, Kind: spanKind(cfg.SpanKind()), } span.Attrs, span.DroppedAttrs = convCappedAttrs(maxSpan.Attrs, cfg.Attributes()) links := cfg.Links() if limit := maxSpan.Links; limit == 0 { n := int64(len(links)) if n > 0 { span.DroppedLinks = uint32(min(n, math.MaxUint32)) // nolint: gosec // Bounds checked. } } else { if limit > 0 { n := int64(max(len(links)-limit, 0)) span.DroppedLinks = uint32(min(n, math.MaxUint32)) // nolint: gosec // Bounds checked. links = links[n:] } span.Links = convLinks(links) } if t := cfg.Timestamp(); !t.IsZero() { span.StartTime = cfg.Timestamp() } else { span.StartTime = time.Now() } return &telemetry.Traces{ ResourceSpans: []*telemetry.ResourceSpans{ { ScopeSpans: []*telemetry.ScopeSpans{ { Scope: &telemetry.Scope{ Name: t.name, Version: t.version, }, Spans: []*telemetry.Span{span}, SchemaURL: t.schemaURL, }, }, }, }, }, span } func spanKind(kind SpanKind) telemetry.SpanKind { switch kind { case SpanKindInternal: return telemetry.SpanKindInternal case SpanKindServer: return telemetry.SpanKindServer case SpanKindClient: return telemetry.SpanKindClient case SpanKindProducer: return telemetry.SpanKindProducer case SpanKindConsumer: return telemetry.SpanKindConsumer } return telemetry.SpanKind(0) // undefined. } type autoSpan struct { embedded.Span spanContext SpanContext sampled atomic.Bool mu sync.Mutex traces *telemetry.Traces span *telemetry.Span } func (s *autoSpan) SpanContext() SpanContext { if s == nil { return SpanContext{} } // s.spanContext is immutable, do not acquire lock s.mu. return s.spanContext } func (s *autoSpan) IsRecording() bool { if s == nil { return false } return s.sampled.Load() } func (s *autoSpan) SetStatus(c codes.Code, msg string) { if s == nil || !s.sampled.Load() { return } s.mu.Lock() defer s.mu.Unlock() if s.span.Status == nil { s.span.Status = new(telemetry.Status) } s.span.Status.Message = msg switch c { case codes.Unset: s.span.Status.Code = telemetry.StatusCodeUnset case codes.Error: s.span.Status.Code = telemetry.StatusCodeError case codes.Ok: s.span.Status.Code = telemetry.StatusCodeOK } } func (s *autoSpan) SetAttributes(attrs ...attribute.KeyValue) { if s == nil || !s.sampled.Load() { return } s.mu.Lock() defer s.mu.Unlock() limit := maxSpan.Attrs if limit == 0 { // No attributes allowed. n := int64(len(attrs)) if n > 0 { s.span.DroppedAttrs += uint32(min(n, math.MaxUint32)) // nolint: gosec // Bounds checked. } return } m := make(map[string]int) for i, a := range s.span.Attrs { m[a.Key] = i } for _, a := range attrs { val := convAttrValue(a.Value) if val.Empty() { s.span.DroppedAttrs++ continue } if idx, ok := m[string(a.Key)]; ok { s.span.Attrs[idx] = telemetry.Attr{ Key: string(a.Key), Value: val, } } else if limit < 0 || len(s.span.Attrs) < limit { s.span.Attrs = append(s.span.Attrs, telemetry.Attr{ Key: string(a.Key), Value: val, }) m[string(a.Key)] = len(s.span.Attrs) - 1 } else { s.span.DroppedAttrs++ } } } // convCappedAttrs converts up to limit attrs into a []telemetry.Attr. The // number of dropped attributes is also returned. func convCappedAttrs(limit int, attrs []attribute.KeyValue) ([]telemetry.Attr, uint32) { n := len(attrs) if limit == 0 { var out uint32 if n > 0 { out = uint32(min(int64(n), math.MaxUint32)) // nolint: gosec // Bounds checked. } return nil, out } if limit < 0 { // Unlimited. return convAttrs(attrs), 0 } if n < 0 { n = 0 } limit = min(n, limit) return convAttrs(attrs[:limit]), uint32(n - limit) // nolint: gosec // Bounds checked. } func convAttrs(attrs []attribute.KeyValue) []telemetry.Attr { if len(attrs) == 0 { // Avoid allocations if not necessary. return nil } out := make([]telemetry.Attr, 0, len(attrs)) for _, attr := range attrs { key := string(attr.Key) val := convAttrValue(attr.Value) if val.Empty() { continue } out = append(out, telemetry.Attr{Key: key, Value: val}) } return out } func convAttrValue(value attribute.Value) telemetry.Value { switch value.Type() { case attribute.BOOL: return telemetry.BoolValue(value.AsBool()) case attribute.INT64: return telemetry.Int64Value(value.AsInt64()) case attribute.FLOAT64: return telemetry.Float64Value(value.AsFloat64()) case attribute.STRING: v := truncate(maxSpan.AttrValueLen, value.AsString()) return telemetry.StringValue(v) case attribute.BOOLSLICE: slice := value.AsBoolSlice() out := make([]telemetry.Value, 0, len(slice)) for _, v := range slice { out = append(out, telemetry.BoolValue(v)) } return telemetry.SliceValue(out...) case attribute.INT64SLICE: slice := value.AsInt64Slice() out := make([]telemetry.Value, 0, len(slice)) for _, v := range slice { out = append(out, telemetry.Int64Value(v)) } return telemetry.SliceValue(out...) case attribute.FLOAT64SLICE: slice := value.AsFloat64Slice() out := make([]telemetry.Value, 0, len(slice)) for _, v := range slice { out = append(out, telemetry.Float64Value(v)) } return telemetry.SliceValue(out...) case attribute.STRINGSLICE: slice := value.AsStringSlice() out := make([]telemetry.Value, 0, len(slice)) for _, v := range slice { v = truncate(maxSpan.AttrValueLen, v) out = append(out, telemetry.StringValue(v)) } return telemetry.SliceValue(out...) } return telemetry.Value{} } // truncate returns a truncated version of s such that it contains less than // the limit number of characters. Truncation is applied by returning the limit // number of valid characters contained in s. // // If limit is negative, it returns the original string. // // UTF-8 is supported. When truncating, all invalid characters are dropped // before applying truncation. // // If s already contains less than the limit number of bytes, it is returned // unchanged. No invalid characters are removed. func truncate(limit int, s string) string { // This prioritize performance in the following order based on the most // common expected use-cases. // // - Short values less than the default limit (128). // - Strings with valid encodings that exceed the limit. // - No limit. // - Strings with invalid encodings that exceed the limit. if limit < 0 || len(s) <= limit { return s } // Optimistically, assume all valid UTF-8. var b strings.Builder count := 0 for i, c := range s { if c != utf8.RuneError { count++ if count > limit { return s[:i] } continue } _, size := utf8.DecodeRuneInString(s[i:]) if size == 1 { // Invalid encoding. b.Grow(len(s) - 1) _, _ = b.WriteString(s[:i]) s = s[i:] break } } // Fast-path, no invalid input. if b.Cap() == 0 { return s } // Truncate while validating UTF-8. for i := 0; i < len(s) && count < limit; { c := s[i] if c < utf8.RuneSelf { // Optimization for single byte runes (common case). _ = b.WriteByte(c) i++ count++ continue } _, size := utf8.DecodeRuneInString(s[i:]) if size == 1 { // We checked for all 1-byte runes above, this is a RuneError. i++ continue } _, _ = b.WriteString(s[i : i+size]) i += size count++ } return b.String() } func (s *autoSpan) End(opts ...SpanEndOption) { if s == nil || !s.sampled.Swap(false) { return } // s.end exists so the lock (s.mu) is not held while s.ended is called. s.ended(s.end(opts)) } func (s *autoSpan) end(opts []SpanEndOption) []byte { s.mu.Lock() defer s.mu.Unlock() cfg := NewSpanEndConfig(opts...) if t := cfg.Timestamp(); !t.IsZero() { s.span.EndTime = cfg.Timestamp() } else { s.span.EndTime = time.Now() } b, _ := json.Marshal(s.traces) // TODO: do not ignore this error. return b } // Expected to be implemented in eBPF. // //go:noinline func (*autoSpan) ended(buf []byte) { ended(buf) } // ended is used for testing. var ended = func([]byte) {} func (s *autoSpan) RecordError(err error, opts ...EventOption) { if s == nil || err == nil || !s.sampled.Load() { return } cfg := NewEventConfig(opts...) attrs := cfg.Attributes() attrs = append(attrs, semconv.ExceptionType(typeStr(err)), semconv.ExceptionMessage(err.Error()), ) if cfg.StackTrace() { buf := make([]byte, 2048) n := runtime.Stack(buf, false) attrs = append(attrs, semconv.ExceptionStacktrace(string(buf[0:n]))) } s.mu.Lock() defer s.mu.Unlock() s.addEvent(semconv.ExceptionEventName, cfg.Timestamp(), attrs) } func typeStr(i any) string { t := reflect.TypeOf(i) if t.PkgPath() == "" && t.Name() == "" { // Likely a builtin type. return t.String() } return fmt.Sprintf("%s.%s", t.PkgPath(), t.Name()) } func (s *autoSpan) AddEvent(name string, opts ...EventOption) { if s == nil || !s.sampled.Load() { return } cfg := NewEventConfig(opts...) s.mu.Lock() defer s.mu.Unlock() s.addEvent(name, cfg.Timestamp(), cfg.Attributes()) } // addEvent adds an event with name and attrs at tStamp to the span. The span // lock (s.mu) needs to be held by the caller. func (s *autoSpan) addEvent(name string, tStamp time.Time, attrs []attribute.KeyValue) { limit := maxSpan.Events if limit == 0 { s.span.DroppedEvents++ return } if limit > 0 && len(s.span.Events) == limit { // Drop head while avoiding allocation of more capacity. copy(s.span.Events[:limit-1], s.span.Events[1:]) s.span.Events = s.span.Events[:limit-1] s.span.DroppedEvents++ } e := &telemetry.SpanEvent{Time: tStamp, Name: name} e.Attrs, e.DroppedAttrs = convCappedAttrs(maxSpan.EventAttrs, attrs) s.span.Events = append(s.span.Events, e) } func (s *autoSpan) AddLink(link Link) { if s == nil || !s.sampled.Load() { return } l := maxSpan.Links s.mu.Lock() defer s.mu.Unlock() if l == 0 { s.span.DroppedLinks++ return } if l > 0 && len(s.span.Links) == l { // Drop head while avoiding allocation of more capacity. copy(s.span.Links[:l-1], s.span.Links[1:]) s.span.Links = s.span.Links[:l-1] s.span.DroppedLinks++ } s.span.Links = append(s.span.Links, convLink(link)) } func convLinks(links []Link) []*telemetry.SpanLink { out := make([]*telemetry.SpanLink, 0, len(links)) for _, link := range links { out = append(out, convLink(link)) } return out } func convLink(link Link) *telemetry.SpanLink { l := &telemetry.SpanLink{ TraceID: telemetry.TraceID(link.SpanContext.TraceID()), SpanID: telemetry.SpanID(link.SpanContext.SpanID()), TraceState: link.SpanContext.TraceState().String(), Flags: uint32(link.SpanContext.TraceFlags()), } l.Attrs, l.DroppedAttrs = convCappedAttrs(maxSpan.LinkAttrs, link.Attributes) return l } func (s *autoSpan) SetName(name string) { if s == nil || !s.sampled.Load() { return } s.mu.Lock() defer s.mu.Unlock() s.span.Name = name } func (*autoSpan) TracerProvider() TracerProvider { return newAutoTracerProvider() } // maxSpan are the span limits resolved during startup. var maxSpan = newSpanLimits() type spanLimits struct { // Attrs is the number of allowed attributes for a span. // // This is resolved from the environment variable value for the // OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT key if it exists. Otherwise, the // environment variable value for OTEL_ATTRIBUTE_COUNT_LIMIT, or 128 if // that is not set, is used. Attrs int // AttrValueLen is the maximum attribute value length allowed for a span. // // This is resolved from the environment variable value for the // OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT key if it exists. Otherwise, the // environment variable value for OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT, or -1 // if that is not set, is used. AttrValueLen int // Events is the number of allowed events for a span. // // This is resolved from the environment variable value for the // OTEL_SPAN_EVENT_COUNT_LIMIT key, or 128 is used if that is not set. Events int // EventAttrs is the number of allowed attributes for a span event. // // The is resolved from the environment variable value for the // OTEL_EVENT_ATTRIBUTE_COUNT_LIMIT key, or 128 is used if that is not set. EventAttrs int // Links is the number of allowed Links for a span. // // This is resolved from the environment variable value for the // OTEL_SPAN_LINK_COUNT_LIMIT, or 128 is used if that is not set. Links int // LinkAttrs is the number of allowed attributes for a span link. // // This is resolved from the environment variable value for the // OTEL_LINK_ATTRIBUTE_COUNT_LIMIT, or 128 is used if that is not set. LinkAttrs int } func newSpanLimits() spanLimits { return spanLimits{ Attrs: firstEnv( 128, "OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT", "OTEL_ATTRIBUTE_COUNT_LIMIT", ), AttrValueLen: firstEnv( -1, // Unlimited. "OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT", "OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT", ), Events: firstEnv(128, "OTEL_SPAN_EVENT_COUNT_LIMIT"), EventAttrs: firstEnv(128, "OTEL_EVENT_ATTRIBUTE_COUNT_LIMIT"), Links: firstEnv(128, "OTEL_SPAN_LINK_COUNT_LIMIT"), LinkAttrs: firstEnv(128, "OTEL_LINK_ATTRIBUTE_COUNT_LIMIT"), } } // firstEnv returns the parsed integer value of the first matching environment // variable from keys. The defaultVal is returned if the value is not an // integer or no match is found. func firstEnv(defaultVal int, keys ...string) int { for _, key := range keys { strV := os.Getenv(key) if strV == "" { continue } v, err := strconv.Atoi(strV) if err == nil { return v } // Ignore invalid environment variable. } return defaultVal } ================================================ FILE: vendor/go.opentelemetry.io/otel/trace/config.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package trace // import "go.opentelemetry.io/otel/trace" import ( "slices" "time" "go.opentelemetry.io/otel/attribute" ) // TracerConfig is a group of options for a Tracer. type TracerConfig struct { instrumentationVersion string // Schema URL of the telemetry emitted by the Tracer. schemaURL string attrs attribute.Set } // InstrumentationVersion returns the version of the library providing instrumentation. func (t *TracerConfig) InstrumentationVersion() string { return t.instrumentationVersion } // InstrumentationAttributes returns the attributes associated with the library // providing instrumentation. func (t *TracerConfig) InstrumentationAttributes() attribute.Set { return t.attrs } // SchemaURL returns the Schema URL of the telemetry emitted by the Tracer. func (t *TracerConfig) SchemaURL() string { return t.schemaURL } // NewTracerConfig applies all the options to a returned TracerConfig. func NewTracerConfig(options ...TracerOption) TracerConfig { var config TracerConfig for _, option := range options { config = option.apply(config) } return config } // TracerOption applies an option to a TracerConfig. type TracerOption interface { apply(TracerConfig) TracerConfig } type tracerOptionFunc func(TracerConfig) TracerConfig func (fn tracerOptionFunc) apply(cfg TracerConfig) TracerConfig { return fn(cfg) } // SpanConfig is a group of options for a Span. type SpanConfig struct { attributes []attribute.KeyValue timestamp time.Time links []Link newRoot bool spanKind SpanKind stackTrace bool } // Attributes describe the associated qualities of a Span. func (cfg *SpanConfig) Attributes() []attribute.KeyValue { return cfg.attributes } // Timestamp is a time in a Span life-cycle. func (cfg *SpanConfig) Timestamp() time.Time { return cfg.timestamp } // StackTrace reports whether stack trace capturing is enabled. func (cfg *SpanConfig) StackTrace() bool { return cfg.stackTrace } // Links are the associations a Span has with other Spans. func (cfg *SpanConfig) Links() []Link { return cfg.links } // NewRoot identifies a Span as the root Span for a new trace. This is // commonly used when an existing trace crosses trust boundaries and the // remote parent span context should be ignored for security. func (cfg *SpanConfig) NewRoot() bool { return cfg.newRoot } // SpanKind is the role a Span has in a trace. func (cfg *SpanConfig) SpanKind() SpanKind { return cfg.spanKind } // NewSpanStartConfig applies all the options to a returned SpanConfig. // No validation is performed on the returned SpanConfig (e.g. no uniqueness // checking or bounding of data), it is left to the SDK to perform this // action. func NewSpanStartConfig(options ...SpanStartOption) SpanConfig { var c SpanConfig for _, option := range options { c = option.applySpanStart(c) } return c } // NewSpanEndConfig applies all the options to a returned SpanConfig. // No validation is performed on the returned SpanConfig (e.g. no uniqueness // checking or bounding of data), it is left to the SDK to perform this // action. func NewSpanEndConfig(options ...SpanEndOption) SpanConfig { var c SpanConfig for _, option := range options { c = option.applySpanEnd(c) } return c } // SpanStartOption applies an option to a SpanConfig. These options are applicable // only when the span is created. type SpanStartOption interface { applySpanStart(SpanConfig) SpanConfig } type spanOptionFunc func(SpanConfig) SpanConfig func (fn spanOptionFunc) applySpanStart(cfg SpanConfig) SpanConfig { return fn(cfg) } // SpanEndOption applies an option to a SpanConfig. These options are // applicable only when the span is ended. type SpanEndOption interface { applySpanEnd(SpanConfig) SpanConfig } // EventConfig is a group of options for an Event. type EventConfig struct { attributes []attribute.KeyValue timestamp time.Time stackTrace bool } // Attributes describe the associated qualities of an Event. func (cfg *EventConfig) Attributes() []attribute.KeyValue { return cfg.attributes } // Timestamp is a time in an Event life-cycle. func (cfg *EventConfig) Timestamp() time.Time { return cfg.timestamp } // StackTrace reports whether stack trace capturing is enabled. func (cfg *EventConfig) StackTrace() bool { return cfg.stackTrace } // NewEventConfig applies all the EventOptions to a returned EventConfig. If no // timestamp option is passed, the returned EventConfig will have a Timestamp // set to the call time, otherwise no validation is performed on the returned // EventConfig. func NewEventConfig(options ...EventOption) EventConfig { var c EventConfig for _, option := range options { c = option.applyEvent(c) } if c.timestamp.IsZero() { c.timestamp = time.Now() } return c } // EventOption applies span event options to an EventConfig. type EventOption interface { applyEvent(EventConfig) EventConfig } // SpanOption are options that can be used at both the beginning and end of a span. type SpanOption interface { SpanStartOption SpanEndOption } // SpanStartEventOption are options that can be used at the start of a span, or with an event. type SpanStartEventOption interface { SpanStartOption EventOption } // SpanEndEventOption are options that can be used at the end of a span, or with an event. type SpanEndEventOption interface { SpanEndOption EventOption } type attributeOption []attribute.KeyValue func (o attributeOption) applySpan(c SpanConfig) SpanConfig { c.attributes = append(c.attributes, []attribute.KeyValue(o)...) return c } func (o attributeOption) applySpanStart(c SpanConfig) SpanConfig { return o.applySpan(c) } func (o attributeOption) applyEvent(c EventConfig) EventConfig { c.attributes = append(c.attributes, []attribute.KeyValue(o)...) return c } var _ SpanStartEventOption = attributeOption{} // WithAttributes adds the attributes related to a span life-cycle event. // These attributes are used to describe the work a Span represents when this // option is provided to a Span's start event. Otherwise, these // attributes provide additional information about the event being recorded // (e.g. error, state change, processing progress, system event). // // If multiple of these options are passed the attributes of each successive // option will extend the attributes instead of overwriting. There is no // guarantee of uniqueness in the resulting attributes. func WithAttributes(attributes ...attribute.KeyValue) SpanStartEventOption { return attributeOption(attributes) } // SpanEventOption are options that can be used with an event or a span. type SpanEventOption interface { SpanOption EventOption } type timestampOption time.Time func (o timestampOption) applySpan(c SpanConfig) SpanConfig { c.timestamp = time.Time(o) return c } func (o timestampOption) applySpanStart(c SpanConfig) SpanConfig { return o.applySpan(c) } func (o timestampOption) applySpanEnd(c SpanConfig) SpanConfig { return o.applySpan(c) } func (o timestampOption) applyEvent(c EventConfig) EventConfig { c.timestamp = time.Time(o) return c } var _ SpanEventOption = timestampOption{} // WithTimestamp sets the time of a Span or Event life-cycle moment (e.g. // started, stopped, errored). func WithTimestamp(t time.Time) SpanEventOption { return timestampOption(t) } type stackTraceOption bool func (o stackTraceOption) applyEvent(c EventConfig) EventConfig { c.stackTrace = bool(o) return c } func (o stackTraceOption) applySpan(c SpanConfig) SpanConfig { c.stackTrace = bool(o) return c } func (o stackTraceOption) applySpanEnd(c SpanConfig) SpanConfig { return o.applySpan(c) } // WithStackTrace sets the flag to capture the error with stack trace (e.g. true, false). func WithStackTrace(b bool) SpanEndEventOption { return stackTraceOption(b) } // WithLinks adds links to a Span. The links are added to the existing Span // links, i.e. this does not overwrite. Links with invalid span context are ignored. func WithLinks(links ...Link) SpanStartOption { return spanOptionFunc(func(cfg SpanConfig) SpanConfig { cfg.links = append(cfg.links, links...) return cfg }) } // WithNewRoot specifies that the Span should be treated as a root Span. Any // existing parent span context will be ignored when defining the Span's trace // identifiers. func WithNewRoot() SpanStartOption { return spanOptionFunc(func(cfg SpanConfig) SpanConfig { cfg.newRoot = true return cfg }) } // WithSpanKind sets the SpanKind of a Span. func WithSpanKind(kind SpanKind) SpanStartOption { return spanOptionFunc(func(cfg SpanConfig) SpanConfig { cfg.spanKind = kind return cfg }) } // WithInstrumentationVersion sets the instrumentation version. func WithInstrumentationVersion(version string) TracerOption { return tracerOptionFunc(func(cfg TracerConfig) TracerConfig { cfg.instrumentationVersion = version return cfg }) } // mergeSets returns the union of keys between a and b. Any duplicate keys will // use the value associated with b. func mergeSets(a, b attribute.Set) attribute.Set { // NewMergeIterator uses the first value for any duplicates. iter := attribute.NewMergeIterator(&b, &a) merged := make([]attribute.KeyValue, 0, a.Len()+b.Len()) for iter.Next() { merged = append(merged, iter.Attribute()) } return attribute.NewSet(merged...) } // WithInstrumentationAttributes adds the instrumentation attributes. // // This is equivalent to calling [WithInstrumentationAttributeSet] with an // [attribute.Set] created from a clone of the passed attributes. // [WithInstrumentationAttributeSet] is recommended for more control. // // If multiple [WithInstrumentationAttributes] or [WithInstrumentationAttributeSet] // options are passed, the attributes will be merged together in the order // they are passed. Attributes with duplicate keys will use the last value passed. func WithInstrumentationAttributes(attr ...attribute.KeyValue) TracerOption { set := attribute.NewSet(slices.Clone(attr)...) return WithInstrumentationAttributeSet(set) } // WithInstrumentationAttributeSet adds the instrumentation attributes. // // If multiple [WithInstrumentationAttributes] or [WithInstrumentationAttributeSet] // options are passed, the attributes will be merged together in the order // they are passed. Attributes with duplicate keys will use the last value passed. func WithInstrumentationAttributeSet(set attribute.Set) TracerOption { if set.Len() == 0 { return tracerOptionFunc(func(config TracerConfig) TracerConfig { return config }) } return tracerOptionFunc(func(config TracerConfig) TracerConfig { if config.attrs.Len() == 0 { config.attrs = set } else { config.attrs = mergeSets(config.attrs, set) } return config }) } // WithSchemaURL sets the schema URL for the Tracer. func WithSchemaURL(schemaURL string) TracerOption { return tracerOptionFunc(func(cfg TracerConfig) TracerConfig { cfg.schemaURL = schemaURL return cfg }) } ================================================ FILE: vendor/go.opentelemetry.io/otel/trace/context.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package trace // import "go.opentelemetry.io/otel/trace" import "context" type traceContextKeyType int const currentSpanKey traceContextKeyType = iota // ContextWithSpan returns a copy of parent with span set as the current Span. func ContextWithSpan(parent context.Context, span Span) context.Context { return context.WithValue(parent, currentSpanKey, span) } // ContextWithSpanContext returns a copy of parent with sc as the current // Span. The Span implementation that wraps sc is non-recording and performs // no operations other than to return sc as the SpanContext from the // SpanContext method. func ContextWithSpanContext(parent context.Context, sc SpanContext) context.Context { return ContextWithSpan(parent, nonRecordingSpan{sc: sc}) } // ContextWithRemoteSpanContext returns a copy of parent with rsc set explicitly // as a remote SpanContext and as the current Span. The Span implementation // that wraps rsc is non-recording and performs no operations other than to // return rsc as the SpanContext from the SpanContext method. func ContextWithRemoteSpanContext(parent context.Context, rsc SpanContext) context.Context { return ContextWithSpanContext(parent, rsc.WithRemote(true)) } // SpanFromContext returns the current Span from ctx. // // If no Span is currently set in ctx an implementation of a Span that // performs no operations is returned. func SpanFromContext(ctx context.Context) Span { if ctx == nil { return noopSpanInstance } if span, ok := ctx.Value(currentSpanKey).(Span); ok { return span } return noopSpanInstance } // SpanContextFromContext returns the current Span's SpanContext. func SpanContextFromContext(ctx context.Context) SpanContext { return SpanFromContext(ctx).SpanContext() } ================================================ FILE: vendor/go.opentelemetry.io/otel/trace/doc.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 /* Package trace provides an implementation of the tracing part of the OpenTelemetry API. To participate in distributed traces a Span needs to be created for the operation being performed as part of a traced workflow. In its simplest form: var tracer trace.Tracer func init() { tracer = otel.Tracer("instrumentation/package/name") } func operation(ctx context.Context) { var span trace.Span ctx, span = tracer.Start(ctx, "operation") defer span.End() // ... } A Tracer is unique to the instrumentation and is used to create Spans. Instrumentation should be designed to accept a TracerProvider from which it can create its own unique Tracer. Alternatively, the registered global TracerProvider from the go.opentelemetry.io/otel package can be used as a default. const ( name = "instrumentation/package/name" version = "0.1.0" ) type Instrumentation struct { tracer trace.Tracer } func NewInstrumentation(tp trace.TracerProvider) *Instrumentation { if tp == nil { tp = otel.TracerProvider() } return &Instrumentation{ tracer: tp.Tracer(name, trace.WithInstrumentationVersion(version)), } } func operation(ctx context.Context, inst *Instrumentation) { var span trace.Span ctx, span = inst.tracer.Start(ctx, "operation") defer span.End() // ... } # API Implementations This package does not conform to the standard Go versioning policy; all of its interfaces may have methods added to them without a package major version bump. This non-standard API evolution could surprise an uninformed implementation author. They could unknowingly build their implementation in a way that would result in a runtime panic for their users that update to the new API. The API is designed to help inform an instrumentation author about this non-standard API evolution. It requires them to choose a default behavior for unimplemented interface methods. There are three behavior choices they can make: - Compilation failure - Panic - Default to another implementation All interfaces in this API embed a corresponding interface from [go.opentelemetry.io/otel/trace/embedded]. If an author wants the default behavior of their implementations to be a compilation failure, signaling to their users they need to update to the latest version of that implementation, they need to embed the corresponding interface from [go.opentelemetry.io/otel/trace/embedded] in their implementation. For example, import "go.opentelemetry.io/otel/trace/embedded" type TracerProvider struct { embedded.TracerProvider // ... } If an author wants the default behavior of their implementations to panic, they can embed the API interface directly. import "go.opentelemetry.io/otel/trace" type TracerProvider struct { trace.TracerProvider // ... } This option is not recommended. It will lead to publishing packages that contain runtime panics when users update to newer versions of [go.opentelemetry.io/otel/trace], which may be done with a transitive dependency. Finally, an author can embed another implementation in theirs. The embedded implementation will be used for methods not defined by the author. For example, an author who wants to default to silently dropping the call can use [go.opentelemetry.io/otel/trace/noop]: import "go.opentelemetry.io/otel/trace/noop" type TracerProvider struct { noop.TracerProvider // ... } It is strongly recommended that authors only embed [go.opentelemetry.io/otel/trace/noop] if they choose this default behavior. That implementation is the only one OpenTelemetry authors can guarantee will fully implement all the API interfaces when a user updates their API. */ package trace // import "go.opentelemetry.io/otel/trace" ================================================ FILE: vendor/go.opentelemetry.io/otel/trace/embedded/README.md ================================================ # Trace Embedded [![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/trace/embedded)](https://pkg.go.dev/go.opentelemetry.io/otel/trace/embedded) ================================================ FILE: vendor/go.opentelemetry.io/otel/trace/embedded/embedded.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 // Package embedded provides interfaces embedded within the [OpenTelemetry // trace API]. // // Implementers of the [OpenTelemetry trace API] can embed the relevant type // from this package into their implementation directly. Doing so will result // in a compilation error for users when the [OpenTelemetry trace API] is // extended (which is something that can happen without a major version bump of // the API package). // // [OpenTelemetry trace API]: https://pkg.go.dev/go.opentelemetry.io/otel/trace package embedded // import "go.opentelemetry.io/otel/trace/embedded" // TracerProvider is embedded in // [go.opentelemetry.io/otel/trace.TracerProvider]. // // Embed this interface in your implementation of the // [go.opentelemetry.io/otel/trace.TracerProvider] if you want users to // experience a compilation error, signaling they need to update to your latest // implementation, when the [go.opentelemetry.io/otel/trace.TracerProvider] // interface is extended (which is something that can happen without a major // version bump of the API package). type TracerProvider interface{ tracerProvider() } // Tracer is embedded in [go.opentelemetry.io/otel/trace.Tracer]. // // Embed this interface in your implementation of the // [go.opentelemetry.io/otel/trace.Tracer] if you want users to experience a // compilation error, signaling they need to update to your latest // implementation, when the [go.opentelemetry.io/otel/trace.Tracer] interface // is extended (which is something that can happen without a major version bump // of the API package). type Tracer interface{ tracer() } // Span is embedded in [go.opentelemetry.io/otel/trace.Span]. // // Embed this interface in your implementation of the // [go.opentelemetry.io/otel/trace.Span] if you want users to experience a // compilation error, signaling they need to update to your latest // implementation, when the [go.opentelemetry.io/otel/trace.Span] interface is // extended (which is something that can happen without a major version bump of // the API package). type Span interface{ span() } ================================================ FILE: vendor/go.opentelemetry.io/otel/trace/hex.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package trace // import "go.opentelemetry.io/otel/trace" const ( // hexLU is a hex lookup table of the 16 lowercase hex digits. // The character values of the string are indexed at the equivalent // hexadecimal value they represent. This table efficiently encodes byte data // into a string representation of hexadecimal. hexLU = "0123456789abcdef" // hexRev is a reverse hex lookup table for lowercase hex digits. // The table is efficiently decodes a hexadecimal string into bytes. // Valid hexadecimal characters are indexed at their respective values. All // other invalid ASCII characters are represented with '\xff'. // // The '\xff' character is used as invalid because no valid character has // the upper 4 bits set. Meaning, an efficient validation can be performed // over multiple character parsing by checking these bits remain zero. hexRev = "" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\x0a\x0b\x0c\x0d\x0e\x0f\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" ) ================================================ FILE: vendor/go.opentelemetry.io/otel/trace/internal/telemetry/attr.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package telemetry // import "go.opentelemetry.io/otel/trace/internal/telemetry" // Attr is a key-value pair. type Attr struct { Key string `json:"key,omitempty"` Value Value `json:"value,omitempty"` } // String returns an Attr for a string value. func String(key, value string) Attr { return Attr{key, StringValue(value)} } // Int64 returns an Attr for an int64 value. func Int64(key string, value int64) Attr { return Attr{key, Int64Value(value)} } // Int returns an Attr for an int value. func Int(key string, value int) Attr { return Int64(key, int64(value)) } // Float64 returns an Attr for a float64 value. func Float64(key string, value float64) Attr { return Attr{key, Float64Value(value)} } // Bool returns an Attr for a bool value. func Bool(key string, value bool) Attr { return Attr{key, BoolValue(value)} } // Bytes returns an Attr for a []byte value. // The passed slice must not be changed after it is passed. func Bytes(key string, value []byte) Attr { return Attr{key, BytesValue(value)} } // Slice returns an Attr for a []Value value. // The passed slice must not be changed after it is passed. func Slice(key string, value ...Value) Attr { return Attr{key, SliceValue(value...)} } // Map returns an Attr for a map value. // The passed slice must not be changed after it is passed. func Map(key string, value ...Attr) Attr { return Attr{key, MapValue(value...)} } // Equal reports whether a is equal to b. func (a Attr) Equal(b Attr) bool { return a.Key == b.Key && a.Value.Equal(b.Value) } ================================================ FILE: vendor/go.opentelemetry.io/otel/trace/internal/telemetry/doc.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 /* Package telemetry provides a lightweight representations of OpenTelemetry telemetry that is compatible with the OTLP JSON protobuf encoding. */ package telemetry // import "go.opentelemetry.io/otel/trace/internal/telemetry" ================================================ FILE: vendor/go.opentelemetry.io/otel/trace/internal/telemetry/id.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package telemetry // import "go.opentelemetry.io/otel/trace/internal/telemetry" import ( "encoding/hex" "errors" "fmt" ) const ( traceIDSize = 16 spanIDSize = 8 ) // TraceID is a custom data type that is used for all trace IDs. type TraceID [traceIDSize]byte // String returns the hex string representation form of a TraceID. func (tid TraceID) String() string { return hex.EncodeToString(tid[:]) } // IsEmpty reports whether the TraceID contains only zero bytes. func (tid TraceID) IsEmpty() bool { return tid == [traceIDSize]byte{} } // MarshalJSON converts the trace ID into a hex string enclosed in quotes. func (tid TraceID) MarshalJSON() ([]byte, error) { if tid.IsEmpty() { return []byte(`""`), nil } return marshalJSON(tid[:]) } // UnmarshalJSON inflates the trace ID from hex string, possibly enclosed in // quotes. func (tid *TraceID) UnmarshalJSON(data []byte) error { *tid = [traceIDSize]byte{} return unmarshalJSON(tid[:], data) } // SpanID is a custom data type that is used for all span IDs. type SpanID [spanIDSize]byte // String returns the hex string representation form of a SpanID. func (sid SpanID) String() string { return hex.EncodeToString(sid[:]) } // IsEmpty reports whether the SpanID contains only zero bytes. func (sid SpanID) IsEmpty() bool { return sid == [spanIDSize]byte{} } // MarshalJSON converts span ID into a hex string enclosed in quotes. func (sid SpanID) MarshalJSON() ([]byte, error) { if sid.IsEmpty() { return []byte(`""`), nil } return marshalJSON(sid[:]) } // UnmarshalJSON decodes span ID from hex string, possibly enclosed in quotes. func (sid *SpanID) UnmarshalJSON(data []byte) error { *sid = [spanIDSize]byte{} return unmarshalJSON(sid[:], data) } // marshalJSON converts id into a hex string enclosed in quotes. func marshalJSON(id []byte) ([]byte, error) { // Plus 2 quote chars at the start and end. hexLen := hex.EncodedLen(len(id)) + 2 b := make([]byte, hexLen) hex.Encode(b[1:hexLen-1], id) b[0], b[hexLen-1] = '"', '"' return b, nil } // unmarshalJSON inflates trace id from hex string, possibly enclosed in quotes. func unmarshalJSON(dst, src []byte) error { if l := len(src); l >= 2 && src[0] == '"' && src[l-1] == '"' { src = src[1 : l-1] } nLen := len(src) if nLen == 0 { return nil } if len(dst) != hex.DecodedLen(nLen) { return errors.New("invalid length for ID") } _, err := hex.Decode(dst, src) if err != nil { return fmt.Errorf("cannot unmarshal ID from string '%s': %w", string(src), err) } return nil } ================================================ FILE: vendor/go.opentelemetry.io/otel/trace/internal/telemetry/number.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package telemetry // import "go.opentelemetry.io/otel/trace/internal/telemetry" import ( "encoding/json" "strconv" ) // protoInt64 represents the protobuf encoding of integers which can be either // strings or integers. type protoInt64 int64 // Int64 returns the protoInt64 as an int64. func (i *protoInt64) Int64() int64 { return int64(*i) } // UnmarshalJSON decodes both strings and integers. func (i *protoInt64) UnmarshalJSON(data []byte) error { if data[0] == '"' { var str string if err := json.Unmarshal(data, &str); err != nil { return err } parsedInt, err := strconv.ParseInt(str, 10, 64) if err != nil { return err } *i = protoInt64(parsedInt) } else { var parsedInt int64 if err := json.Unmarshal(data, &parsedInt); err != nil { return err } *i = protoInt64(parsedInt) } return nil } // protoUint64 represents the protobuf encoding of integers which can be either // strings or integers. type protoUint64 uint64 // Int64 returns the protoUint64 as a uint64. func (i *protoUint64) Uint64() uint64 { return uint64(*i) } // UnmarshalJSON decodes both strings and integers. func (i *protoUint64) UnmarshalJSON(data []byte) error { if data[0] == '"' { var str string if err := json.Unmarshal(data, &str); err != nil { return err } parsedUint, err := strconv.ParseUint(str, 10, 64) if err != nil { return err } *i = protoUint64(parsedUint) } else { var parsedUint uint64 if err := json.Unmarshal(data, &parsedUint); err != nil { return err } *i = protoUint64(parsedUint) } return nil } ================================================ FILE: vendor/go.opentelemetry.io/otel/trace/internal/telemetry/resource.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package telemetry // import "go.opentelemetry.io/otel/trace/internal/telemetry" import ( "bytes" "encoding/json" "errors" "fmt" "io" ) // Resource information. type Resource struct { // Attrs are the set of attributes that describe the resource. Attribute // keys MUST be unique (it is not allowed to have more than one attribute // with the same key). Attrs []Attr `json:"attributes,omitempty"` // DroppedAttrs is the number of dropped attributes. If the value // is 0, then no attributes were dropped. DroppedAttrs uint32 `json:"droppedAttributesCount,omitempty"` } // UnmarshalJSON decodes the OTLP formatted JSON contained in data into r. func (r *Resource) UnmarshalJSON(data []byte) error { decoder := json.NewDecoder(bytes.NewReader(data)) t, err := decoder.Token() if err != nil { return err } if t != json.Delim('{') { return errors.New("invalid Resource type") } for decoder.More() { keyIface, err := decoder.Token() if err != nil { if errors.Is(err, io.EOF) { // Empty. return nil } return err } key, ok := keyIface.(string) if !ok { return fmt.Errorf("invalid Resource field: %#v", keyIface) } switch key { case "attributes": err = decoder.Decode(&r.Attrs) case "droppedAttributesCount", "dropped_attributes_count": err = decoder.Decode(&r.DroppedAttrs) default: // Skip unknown. } if err != nil { return err } } return nil } ================================================ FILE: vendor/go.opentelemetry.io/otel/trace/internal/telemetry/scope.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package telemetry // import "go.opentelemetry.io/otel/trace/internal/telemetry" import ( "bytes" "encoding/json" "errors" "fmt" "io" ) // Scope is the identifying values of the instrumentation scope. type Scope struct { Name string `json:"name,omitempty"` Version string `json:"version,omitempty"` Attrs []Attr `json:"attributes,omitempty"` DroppedAttrs uint32 `json:"droppedAttributesCount,omitempty"` } // UnmarshalJSON decodes the OTLP formatted JSON contained in data into r. func (s *Scope) UnmarshalJSON(data []byte) error { decoder := json.NewDecoder(bytes.NewReader(data)) t, err := decoder.Token() if err != nil { return err } if t != json.Delim('{') { return errors.New("invalid Scope type") } for decoder.More() { keyIface, err := decoder.Token() if err != nil { if errors.Is(err, io.EOF) { // Empty. return nil } return err } key, ok := keyIface.(string) if !ok { return fmt.Errorf("invalid Scope field: %#v", keyIface) } switch key { case "name": err = decoder.Decode(&s.Name) case "version": err = decoder.Decode(&s.Version) case "attributes": err = decoder.Decode(&s.Attrs) case "droppedAttributesCount", "dropped_attributes_count": err = decoder.Decode(&s.DroppedAttrs) default: // Skip unknown. } if err != nil { return err } } return nil } ================================================ FILE: vendor/go.opentelemetry.io/otel/trace/internal/telemetry/span.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package telemetry // import "go.opentelemetry.io/otel/trace/internal/telemetry" import ( "bytes" "encoding/hex" "encoding/json" "errors" "fmt" "io" "math" "time" ) // A Span represents a single operation performed by a single component of the // system. type Span struct { // A unique identifier for a trace. All spans from the same trace share // the same `trace_id`. The ID is a 16-byte array. An ID with all zeroes OR // of length other than 16 bytes is considered invalid (empty string in OTLP/JSON // is zero-length and thus is also invalid). // // This field is required. TraceID TraceID `json:"traceId,omitempty"` // A unique identifier for a span within a trace, assigned when the span // is created. The ID is an 8-byte array. An ID with all zeroes OR of length // other than 8 bytes is considered invalid (empty string in OTLP/JSON // is zero-length and thus is also invalid). // // This field is required. SpanID SpanID `json:"spanId,omitempty"` // trace_state conveys information about request position in multiple distributed tracing graphs. // It is a trace_state in w3c-trace-context format: https://www.w3.org/TR/trace-context/#tracestate-header // See also https://github.com/w3c/distributed-tracing for more details about this field. TraceState string `json:"traceState,omitempty"` // The `span_id` of this span's parent span. If this is a root span, then this // field must be empty. The ID is an 8-byte array. ParentSpanID SpanID `json:"parentSpanId,omitempty"` // Flags, a bit field. // // Bits 0-7 (8 least significant bits) are the trace flags as defined in W3C Trace // Context specification. To read the 8-bit W3C trace flag, use // `flags & SPAN_FLAGS_TRACE_FLAGS_MASK`. // // See https://www.w3.org/TR/trace-context-2/#trace-flags for the flag definitions. // // Bits 8 and 9 represent the 3 states of whether a span's parent // is remote. The states are (unknown, is not remote, is remote). // To read whether the value is known, use `(flags & SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK) != 0`. // To read whether the span is remote, use `(flags & SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK) != 0`. // // When creating span messages, if the message is logically forwarded from another source // with an equivalent flags fields (i.e., usually another OTLP span message), the field SHOULD // be copied as-is. If creating from a source that does not have an equivalent flags field // (such as a runtime representation of an OpenTelemetry span), the high 22 bits MUST // be set to zero. // Readers MUST NOT assume that bits 10-31 (22 most significant bits) will be zero. // // [Optional]. Flags uint32 `json:"flags,omitempty"` // A description of the span's operation. // // For example, the name can be a qualified method name or a file name // and a line number where the operation is called. A best practice is to use // the same display name at the same call point in an application. // This makes it easier to correlate spans in different traces. // // This field is semantically required to be set to non-empty string. // Empty value is equivalent to an unknown span name. // // This field is required. Name string `json:"name"` // Distinguishes between spans generated in a particular context. For example, // two spans with the same name may be distinguished using `CLIENT` (caller) // and `SERVER` (callee) to identify queueing latency associated with the span. Kind SpanKind `json:"kind,omitempty"` // start_time_unix_nano is the start time of the span. On the client side, this is the time // kept by the local machine where the span execution starts. On the server side, this // is the time when the server's application handler starts running. // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. // // This field is semantically required and it is expected that end_time >= start_time. StartTime time.Time `json:"startTimeUnixNano,omitempty"` // end_time_unix_nano is the end time of the span. On the client side, this is the time // kept by the local machine where the span execution ends. On the server side, this // is the time when the server application handler stops running. // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. // // This field is semantically required and it is expected that end_time >= start_time. EndTime time.Time `json:"endTimeUnixNano,omitempty"` // attributes is a collection of key/value pairs. Note, global attributes // like server name can be set using the resource API. Examples of attributes: // // "/http/user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36" // "/http/server_latency": 300 // "example.com/myattribute": true // "example.com/score": 10.239 // // The OpenTelemetry API specification further restricts the allowed value types: // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/README.md#attribute // Attribute keys MUST be unique (it is not allowed to have more than one // attribute with the same key). Attrs []Attr `json:"attributes,omitempty"` // dropped_attributes_count is the number of attributes that were discarded. Attributes // can be discarded because their keys are too long or because there are too many // attributes. If this value is 0, then no attributes were dropped. DroppedAttrs uint32 `json:"droppedAttributesCount,omitempty"` // events is a collection of Event items. Events []*SpanEvent `json:"events,omitempty"` // dropped_events_count is the number of dropped events. If the value is 0, then no // events were dropped. DroppedEvents uint32 `json:"droppedEventsCount,omitempty"` // links is a collection of Links, which are references from this span to a span // in the same or different trace. Links []*SpanLink `json:"links,omitempty"` // dropped_links_count is the number of dropped links after the maximum size was // enforced. If this value is 0, then no links were dropped. DroppedLinks uint32 `json:"droppedLinksCount,omitempty"` // An optional final status for this span. Semantically when Status isn't set, it means // span's status code is unset, i.e. assume STATUS_CODE_UNSET (code = 0). Status *Status `json:"status,omitempty"` } // MarshalJSON encodes s into OTLP formatted JSON. func (s Span) MarshalJSON() ([]byte, error) { startT := s.StartTime.UnixNano() if s.StartTime.IsZero() || startT < 0 { startT = 0 } endT := s.EndTime.UnixNano() if s.EndTime.IsZero() || endT < 0 { endT = 0 } // Override non-empty default SpanID marshal and omitempty. var parentSpanId string if !s.ParentSpanID.IsEmpty() { b := make([]byte, hex.EncodedLen(spanIDSize)) hex.Encode(b, s.ParentSpanID[:]) parentSpanId = string(b) } type Alias Span return json.Marshal(struct { Alias ParentSpanID string `json:"parentSpanId,omitempty"` StartTime uint64 `json:"startTimeUnixNano,omitempty"` EndTime uint64 `json:"endTimeUnixNano,omitempty"` }{ Alias: Alias(s), ParentSpanID: parentSpanId, StartTime: uint64(startT), // nolint:gosec // >0 checked above. EndTime: uint64(endT), // nolint:gosec // >0 checked above. }) } // UnmarshalJSON decodes the OTLP formatted JSON contained in data into s. func (s *Span) UnmarshalJSON(data []byte) error { decoder := json.NewDecoder(bytes.NewReader(data)) t, err := decoder.Token() if err != nil { return err } if t != json.Delim('{') { return errors.New("invalid Span type") } for decoder.More() { keyIface, err := decoder.Token() if err != nil { if errors.Is(err, io.EOF) { // Empty. return nil } return err } key, ok := keyIface.(string) if !ok { return fmt.Errorf("invalid Span field: %#v", keyIface) } switch key { case "traceId", "trace_id": err = decoder.Decode(&s.TraceID) case "spanId", "span_id": err = decoder.Decode(&s.SpanID) case "traceState", "trace_state": err = decoder.Decode(&s.TraceState) case "parentSpanId", "parent_span_id": err = decoder.Decode(&s.ParentSpanID) case "flags": err = decoder.Decode(&s.Flags) case "name": err = decoder.Decode(&s.Name) case "kind": err = decoder.Decode(&s.Kind) case "startTimeUnixNano", "start_time_unix_nano": var val protoUint64 err = decoder.Decode(&val) v := int64(min(val.Uint64(), math.MaxInt64)) // nolint: gosec // Overflow checked. s.StartTime = time.Unix(0, v) case "endTimeUnixNano", "end_time_unix_nano": var val protoUint64 err = decoder.Decode(&val) v := int64(min(val.Uint64(), math.MaxInt64)) // nolint: gosec // Overflow checked. s.EndTime = time.Unix(0, v) case "attributes": err = decoder.Decode(&s.Attrs) case "droppedAttributesCount", "dropped_attributes_count": err = decoder.Decode(&s.DroppedAttrs) case "events": err = decoder.Decode(&s.Events) case "droppedEventsCount", "dropped_events_count": err = decoder.Decode(&s.DroppedEvents) case "links": err = decoder.Decode(&s.Links) case "droppedLinksCount", "dropped_links_count": err = decoder.Decode(&s.DroppedLinks) case "status": err = decoder.Decode(&s.Status) default: // Skip unknown. } if err != nil { return err } } return nil } // SpanFlags represents constants used to interpret the // Span.flags field, which is protobuf 'fixed32' type and is to // be used as bit-fields. Each non-zero value defined in this enum is // a bit-mask. To extract the bit-field, for example, use an // expression like: // // (span.flags & SPAN_FLAGS_TRACE_FLAGS_MASK) // // See https://www.w3.org/TR/trace-context-2/#trace-flags for the flag definitions. // // Note that Span flags were introduced in version 1.1 of the // OpenTelemetry protocol. Older Span producers do not set this // field, consequently consumers should not rely on the absence of a // particular flag bit to indicate the presence of a particular feature. type SpanFlags int32 const ( // SpanFlagsTraceFlagsMask is a mask for trace-flags. // // Bits 0-7 are used for trace flags. SpanFlagsTraceFlagsMask SpanFlags = 255 // SpanFlagsContextHasIsRemoteMask is a mask for HAS_IS_REMOTE status. // // Bits 8 and 9 are used to indicate that the parent span or link span is // remote. Bit 8 (`HAS_IS_REMOTE`) indicates whether the value is known. SpanFlagsContextHasIsRemoteMask SpanFlags = 256 // SpanFlagsContextIsRemoteMask is a mask for IS_REMOTE status. // // Bits 8 and 9 are used to indicate that the parent span or link span is // remote. Bit 9 (`IS_REMOTE`) indicates whether the span or link is // remote. SpanFlagsContextIsRemoteMask SpanFlags = 512 ) // SpanKind is the type of span. Can be used to specify additional relationships between spans // in addition to a parent/child relationship. type SpanKind int32 const ( // SpanKindInternal indicates that the span represents an internal // operation within an application, as opposed to an operation happening at // the boundaries. SpanKindInternal SpanKind = 1 // SpanKindServer indicates that the span covers server-side handling of an // RPC or other remote network request. SpanKindServer SpanKind = 2 // SpanKindClient indicates that the span describes a request to some // remote service. SpanKindClient SpanKind = 3 // SpanKindProducer indicates that the span describes a producer sending a // message to a broker. Unlike SpanKindClient and SpanKindServer, there is // often no direct critical path latency relationship between producer and // consumer spans. A SpanKindProducer span ends when the message was // accepted by the broker while the logical processing of the message might // span a much longer time. SpanKindProducer SpanKind = 4 // SpanKindConsumer indicates that the span describes a consumer receiving // a message from a broker. Like SpanKindProducer, there is often no direct // critical path latency relationship between producer and consumer spans. SpanKindConsumer SpanKind = 5 ) // SpanEvent is a time-stamped annotation of the span, consisting of // user-supplied text description and key-value pairs. type SpanEvent struct { // time_unix_nano is the time the event occurred. Time time.Time `json:"timeUnixNano,omitempty"` // name of the event. // This field is semantically required to be set to non-empty string. Name string `json:"name,omitempty"` // attributes is a collection of attribute key/value pairs on the event. // Attribute keys MUST be unique (it is not allowed to have more than one // attribute with the same key). Attrs []Attr `json:"attributes,omitempty"` // dropped_attributes_count is the number of dropped attributes. If the value is 0, // then no attributes were dropped. DroppedAttrs uint32 `json:"droppedAttributesCount,omitempty"` } // MarshalJSON encodes e into OTLP formatted JSON. func (e SpanEvent) MarshalJSON() ([]byte, error) { t := e.Time.UnixNano() if e.Time.IsZero() || t < 0 { t = 0 } type Alias SpanEvent return json.Marshal(struct { Alias Time uint64 `json:"timeUnixNano,omitempty"` }{ Alias: Alias(e), Time: uint64(t), // nolint: gosec // >0 checked above }) } // UnmarshalJSON decodes the OTLP formatted JSON contained in data into se. func (se *SpanEvent) UnmarshalJSON(data []byte) error { decoder := json.NewDecoder(bytes.NewReader(data)) t, err := decoder.Token() if err != nil { return err } if t != json.Delim('{') { return errors.New("invalid SpanEvent type") } for decoder.More() { keyIface, err := decoder.Token() if err != nil { if errors.Is(err, io.EOF) { // Empty. return nil } return err } key, ok := keyIface.(string) if !ok { return fmt.Errorf("invalid SpanEvent field: %#v", keyIface) } switch key { case "timeUnixNano", "time_unix_nano": var val protoUint64 err = decoder.Decode(&val) v := int64(min(val.Uint64(), math.MaxInt64)) // nolint: gosec // Overflow checked. se.Time = time.Unix(0, v) case "name": err = decoder.Decode(&se.Name) case "attributes": err = decoder.Decode(&se.Attrs) case "droppedAttributesCount", "dropped_attributes_count": err = decoder.Decode(&se.DroppedAttrs) default: // Skip unknown. } if err != nil { return err } } return nil } // SpanLink is a reference from the current span to another span in the same // trace or in a different trace. For example, this can be used in batching // operations, where a single batch handler processes multiple requests from // different traces or when the handler receives a request from a different // project. type SpanLink struct { // A unique identifier of a trace that this linked span is part of. The ID is a // 16-byte array. TraceID TraceID `json:"traceId,omitempty"` // A unique identifier for the linked span. The ID is an 8-byte array. SpanID SpanID `json:"spanId,omitempty"` // The trace_state associated with the link. TraceState string `json:"traceState,omitempty"` // attributes is a collection of attribute key/value pairs on the link. // Attribute keys MUST be unique (it is not allowed to have more than one // attribute with the same key). Attrs []Attr `json:"attributes,omitempty"` // dropped_attributes_count is the number of dropped attributes. If the value is 0, // then no attributes were dropped. DroppedAttrs uint32 `json:"droppedAttributesCount,omitempty"` // Flags, a bit field. // // Bits 0-7 (8 least significant bits) are the trace flags as defined in W3C Trace // Context specification. To read the 8-bit W3C trace flag, use // `flags & SPAN_FLAGS_TRACE_FLAGS_MASK`. // // See https://www.w3.org/TR/trace-context-2/#trace-flags for the flag definitions. // // Bits 8 and 9 represent the 3 states of whether the link is remote. // The states are (unknown, is not remote, is remote). // To read whether the value is known, use `(flags & SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK) != 0`. // To read whether the link is remote, use `(flags & SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK) != 0`. // // Readers MUST NOT assume that bits 10-31 (22 most significant bits) will be zero. // When creating new spans, bits 10-31 (most-significant 22-bits) MUST be zero. // // [Optional]. Flags uint32 `json:"flags,omitempty"` } // UnmarshalJSON decodes the OTLP formatted JSON contained in data into sl. func (sl *SpanLink) UnmarshalJSON(data []byte) error { decoder := json.NewDecoder(bytes.NewReader(data)) t, err := decoder.Token() if err != nil { return err } if t != json.Delim('{') { return errors.New("invalid SpanLink type") } for decoder.More() { keyIface, err := decoder.Token() if err != nil { if errors.Is(err, io.EOF) { // Empty. return nil } return err } key, ok := keyIface.(string) if !ok { return fmt.Errorf("invalid SpanLink field: %#v", keyIface) } switch key { case "traceId", "trace_id": err = decoder.Decode(&sl.TraceID) case "spanId", "span_id": err = decoder.Decode(&sl.SpanID) case "traceState", "trace_state": err = decoder.Decode(&sl.TraceState) case "attributes": err = decoder.Decode(&sl.Attrs) case "droppedAttributesCount", "dropped_attributes_count": err = decoder.Decode(&sl.DroppedAttrs) case "flags": err = decoder.Decode(&sl.Flags) default: // Skip unknown. } if err != nil { return err } } return nil } ================================================ FILE: vendor/go.opentelemetry.io/otel/trace/internal/telemetry/status.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package telemetry // import "go.opentelemetry.io/otel/trace/internal/telemetry" // StatusCode is the status of a Span. // // For the semantics of status codes see // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#set-status type StatusCode int32 const ( // StatusCodeUnset is the default status. StatusCodeUnset StatusCode = 0 // StatusCodeOK is used when the Span has been validated by an Application // developer or Operator to have completed successfully. StatusCodeOK StatusCode = 1 // StatusCodeError is used when the Span contains an error. StatusCodeError StatusCode = 2 ) var statusCodeStrings = []string{ "Unset", "OK", "Error", } func (s StatusCode) String() string { if s >= 0 && int(s) < len(statusCodeStrings) { return statusCodeStrings[s] } return "" } // Status defines a logical error model that is suitable for different // programming environments, including REST APIs and RPC APIs. type Status struct { // A developer-facing human readable error message. Message string `json:"message,omitempty"` // The status code. Code StatusCode `json:"code,omitempty"` } ================================================ FILE: vendor/go.opentelemetry.io/otel/trace/internal/telemetry/traces.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package telemetry // import "go.opentelemetry.io/otel/trace/internal/telemetry" import ( "bytes" "encoding/json" "errors" "fmt" "io" ) // Traces represents the traces data that can be stored in a persistent storage, // OR can be embedded by other protocols that transfer OTLP traces data but do // not implement the OTLP protocol. // // The main difference between this message and collector protocol is that // in this message there will not be any "control" or "metadata" specific to // OTLP protocol. // // When new fields are added into this message, the OTLP request MUST be updated // as well. type Traces struct { // An array of ResourceSpans. // For data coming from a single resource this array will typically contain // one element. Intermediary nodes that receive data from multiple origins // typically batch the data before forwarding further and in that case this // array will contain multiple elements. ResourceSpans []*ResourceSpans `json:"resourceSpans,omitempty"` } // UnmarshalJSON decodes the OTLP formatted JSON contained in data into td. func (td *Traces) UnmarshalJSON(data []byte) error { decoder := json.NewDecoder(bytes.NewReader(data)) t, err := decoder.Token() if err != nil { return err } if t != json.Delim('{') { return errors.New("invalid TracesData type") } for decoder.More() { keyIface, err := decoder.Token() if err != nil { if errors.Is(err, io.EOF) { // Empty. return nil } return err } key, ok := keyIface.(string) if !ok { return fmt.Errorf("invalid TracesData field: %#v", keyIface) } switch key { case "resourceSpans", "resource_spans": err = decoder.Decode(&td.ResourceSpans) default: // Skip unknown. } if err != nil { return err } } return nil } // ResourceSpans is a collection of ScopeSpans from a Resource. type ResourceSpans struct { // The resource for the spans in this message. // If this field is not set then no resource info is known. Resource Resource `json:"resource"` // A list of ScopeSpans that originate from a resource. ScopeSpans []*ScopeSpans `json:"scopeSpans,omitempty"` // This schema_url applies to the data in the "resource" field. It does not apply // to the data in the "scope_spans" field which have their own schema_url field. SchemaURL string `json:"schemaUrl,omitempty"` } // UnmarshalJSON decodes the OTLP formatted JSON contained in data into rs. func (rs *ResourceSpans) UnmarshalJSON(data []byte) error { decoder := json.NewDecoder(bytes.NewReader(data)) t, err := decoder.Token() if err != nil { return err } if t != json.Delim('{') { return errors.New("invalid ResourceSpans type") } for decoder.More() { keyIface, err := decoder.Token() if err != nil { if errors.Is(err, io.EOF) { // Empty. return nil } return err } key, ok := keyIface.(string) if !ok { return fmt.Errorf("invalid ResourceSpans field: %#v", keyIface) } switch key { case "resource": err = decoder.Decode(&rs.Resource) case "scopeSpans", "scope_spans": err = decoder.Decode(&rs.ScopeSpans) case "schemaUrl", "schema_url": err = decoder.Decode(&rs.SchemaURL) default: // Skip unknown. } if err != nil { return err } } return nil } // ScopeSpans is a collection of Spans produced by an InstrumentationScope. type ScopeSpans struct { // The instrumentation scope information for the spans in this message. // Semantically when InstrumentationScope isn't set, it is equivalent with // an empty instrumentation scope name (unknown). Scope *Scope `json:"scope"` // A list of Spans that originate from an instrumentation scope. Spans []*Span `json:"spans,omitempty"` // The Schema URL, if known. This is the identifier of the Schema that the span data // is recorded in. To learn more about Schema URL see // https://opentelemetry.io/docs/specs/otel/schemas/#schema-url // This schema_url applies to all spans and span events in the "spans" field. SchemaURL string `json:"schemaUrl,omitempty"` } // UnmarshalJSON decodes the OTLP formatted JSON contained in data into ss. func (ss *ScopeSpans) UnmarshalJSON(data []byte) error { decoder := json.NewDecoder(bytes.NewReader(data)) t, err := decoder.Token() if err != nil { return err } if t != json.Delim('{') { return errors.New("invalid ScopeSpans type") } for decoder.More() { keyIface, err := decoder.Token() if err != nil { if errors.Is(err, io.EOF) { // Empty. return nil } return err } key, ok := keyIface.(string) if !ok { return fmt.Errorf("invalid ScopeSpans field: %#v", keyIface) } switch key { case "scope": err = decoder.Decode(&ss.Scope) case "spans": err = decoder.Decode(&ss.Spans) case "schemaUrl", "schema_url": err = decoder.Decode(&ss.SchemaURL) default: // Skip unknown. } if err != nil { return err } } return nil } ================================================ FILE: vendor/go.opentelemetry.io/otel/trace/internal/telemetry/value.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package telemetry // import "go.opentelemetry.io/otel/trace/internal/telemetry" import ( "bytes" "cmp" "encoding/base64" "encoding/json" "errors" "fmt" "io" "math" "slices" "strconv" "unsafe" ) // A Value represents a structured value. // A zero value is valid and represents an empty value. type Value struct { // Ensure forward compatibility by explicitly making this not comparable. noCmp [0]func() //nolint: unused // This is indeed used. // num holds the value for Int64, Float64, and Bool. It holds the length // for String, Bytes, Slice, Map. num uint64 // any holds either the KindBool, KindInt64, KindFloat64, stringptr, // bytesptr, sliceptr, or mapptr. If KindBool, KindInt64, or KindFloat64 // then the value of Value is in num as described above. Otherwise, it // contains the value wrapped in the appropriate type. any any } type ( // sliceptr represents a value in Value.any for KindString Values. stringptr *byte // bytesptr represents a value in Value.any for KindBytes Values. bytesptr *byte // sliceptr represents a value in Value.any for KindSlice Values. sliceptr *Value // mapptr represents a value in Value.any for KindMap Values. mapptr *Attr ) // ValueKind is the kind of a [Value]. type ValueKind int // ValueKind values. const ( ValueKindEmpty ValueKind = iota ValueKindBool ValueKindFloat64 ValueKindInt64 ValueKindString ValueKindBytes ValueKindSlice ValueKindMap ) var valueKindStrings = []string{ "Empty", "Bool", "Float64", "Int64", "String", "Bytes", "Slice", "Map", } func (k ValueKind) String() string { if k >= 0 && int(k) < len(valueKindStrings) { return valueKindStrings[k] } return "" } // StringValue returns a new [Value] for a string. func StringValue(v string) Value { return Value{ num: uint64(len(v)), any: stringptr(unsafe.StringData(v)), } } // IntValue returns a [Value] for an int. func IntValue(v int) Value { return Int64Value(int64(v)) } // Int64Value returns a [Value] for an int64. func Int64Value(v int64) Value { return Value{ num: uint64(v), // nolint: gosec // Store raw bytes. any: ValueKindInt64, } } // Float64Value returns a [Value] for a float64. func Float64Value(v float64) Value { return Value{num: math.Float64bits(v), any: ValueKindFloat64} } // BoolValue returns a [Value] for a bool. func BoolValue(v bool) Value { //nolint:revive // Not a control flag. var n uint64 if v { n = 1 } return Value{num: n, any: ValueKindBool} } // BytesValue returns a [Value] for a byte slice. The passed slice must not be // changed after it is passed. func BytesValue(v []byte) Value { return Value{ num: uint64(len(v)), any: bytesptr(unsafe.SliceData(v)), } } // SliceValue returns a [Value] for a slice of [Value]. The passed slice must // not be changed after it is passed. func SliceValue(vs ...Value) Value { return Value{ num: uint64(len(vs)), any: sliceptr(unsafe.SliceData(vs)), } } // MapValue returns a new [Value] for a slice of key-value pairs. The passed // slice must not be changed after it is passed. func MapValue(kvs ...Attr) Value { return Value{ num: uint64(len(kvs)), any: mapptr(unsafe.SliceData(kvs)), } } // AsString returns the value held by v as a string. func (v Value) AsString() string { if sp, ok := v.any.(stringptr); ok { return unsafe.String(sp, v.num) } // TODO: error handle return "" } // asString returns the value held by v as a string. It will panic if the Value // is not KindString. func (v Value) asString() string { return unsafe.String(v.any.(stringptr), v.num) } // AsInt64 returns the value held by v as an int64. func (v Value) AsInt64() int64 { if v.Kind() != ValueKindInt64 { // TODO: error handle return 0 } return v.asInt64() } // asInt64 returns the value held by v as an int64. If v is not of KindInt64, // this will return garbage. func (v Value) asInt64() int64 { // Assumes v.num was a valid int64 (overflow not checked). return int64(v.num) // nolint: gosec } // AsBool returns the value held by v as a bool. func (v Value) AsBool() bool { if v.Kind() != ValueKindBool { // TODO: error handle return false } return v.asBool() } // asBool returns the value held by v as a bool. If v is not of KindBool, this // will return garbage. func (v Value) asBool() bool { return v.num == 1 } // AsFloat64 returns the value held by v as a float64. func (v Value) AsFloat64() float64 { if v.Kind() != ValueKindFloat64 { // TODO: error handle return 0 } return v.asFloat64() } // asFloat64 returns the value held by v as a float64. If v is not of // KindFloat64, this will return garbage. func (v Value) asFloat64() float64 { return math.Float64frombits(v.num) } // AsBytes returns the value held by v as a []byte. func (v Value) AsBytes() []byte { if sp, ok := v.any.(bytesptr); ok { return unsafe.Slice((*byte)(sp), v.num) } // TODO: error handle return nil } // asBytes returns the value held by v as a []byte. It will panic if the Value // is not KindBytes. func (v Value) asBytes() []byte { return unsafe.Slice((*byte)(v.any.(bytesptr)), v.num) } // AsSlice returns the value held by v as a []Value. func (v Value) AsSlice() []Value { if sp, ok := v.any.(sliceptr); ok { return unsafe.Slice((*Value)(sp), v.num) } // TODO: error handle return nil } // asSlice returns the value held by v as a []Value. It will panic if the Value // is not KindSlice. func (v Value) asSlice() []Value { return unsafe.Slice((*Value)(v.any.(sliceptr)), v.num) } // AsMap returns the value held by v as a []Attr. func (v Value) AsMap() []Attr { if sp, ok := v.any.(mapptr); ok { return unsafe.Slice((*Attr)(sp), v.num) } // TODO: error handle return nil } // asMap returns the value held by v as a []Attr. It will panic if the // Value is not KindMap. func (v Value) asMap() []Attr { return unsafe.Slice((*Attr)(v.any.(mapptr)), v.num) } // Kind returns the Kind of v. func (v Value) Kind() ValueKind { switch x := v.any.(type) { case ValueKind: return x case stringptr: return ValueKindString case bytesptr: return ValueKindBytes case sliceptr: return ValueKindSlice case mapptr: return ValueKindMap default: return ValueKindEmpty } } // Empty reports whether v does not hold any value. func (v Value) Empty() bool { return v.Kind() == ValueKindEmpty } // Equal reports whether v is equal to w. func (v Value) Equal(w Value) bool { k1 := v.Kind() k2 := w.Kind() if k1 != k2 { return false } switch k1 { case ValueKindInt64, ValueKindBool: return v.num == w.num case ValueKindString: return v.asString() == w.asString() case ValueKindFloat64: return v.asFloat64() == w.asFloat64() case ValueKindSlice: return slices.EqualFunc(v.asSlice(), w.asSlice(), Value.Equal) case ValueKindMap: sv := sortMap(v.asMap()) sw := sortMap(w.asMap()) return slices.EqualFunc(sv, sw, Attr.Equal) case ValueKindBytes: return bytes.Equal(v.asBytes(), w.asBytes()) case ValueKindEmpty: return true default: // TODO: error handle return false } } func sortMap(m []Attr) []Attr { sm := make([]Attr, len(m)) copy(sm, m) slices.SortFunc(sm, func(a, b Attr) int { return cmp.Compare(a.Key, b.Key) }) return sm } // String returns Value's value as a string, formatted like [fmt.Sprint]. // // The returned string is meant for debugging; // the string representation is not stable. func (v Value) String() string { switch v.Kind() { case ValueKindString: return v.asString() case ValueKindInt64: // Assumes v.num was a valid int64 (overflow not checked). return strconv.FormatInt(int64(v.num), 10) // nolint: gosec case ValueKindFloat64: return strconv.FormatFloat(v.asFloat64(), 'g', -1, 64) case ValueKindBool: return strconv.FormatBool(v.asBool()) case ValueKindBytes: return string(v.asBytes()) case ValueKindMap: return fmt.Sprint(v.asMap()) case ValueKindSlice: return fmt.Sprint(v.asSlice()) case ValueKindEmpty: return "" default: // Try to handle this as gracefully as possible. // // Don't panic here. The goal here is to have developers find this // first if a slog.Kind is is not handled. It is // preferable to have user's open issue asking why their attributes // have a "unhandled: " prefix than say that their code is panicking. return fmt.Sprintf("", v.Kind()) } } // MarshalJSON encodes v into OTLP formatted JSON. func (v *Value) MarshalJSON() ([]byte, error) { switch v.Kind() { case ValueKindString: return json.Marshal(struct { Value string `json:"stringValue"` }{v.asString()}) case ValueKindInt64: return json.Marshal(struct { Value string `json:"intValue"` }{strconv.FormatInt(int64(v.num), 10)}) // nolint: gosec // From raw bytes. case ValueKindFloat64: return json.Marshal(struct { Value float64 `json:"doubleValue"` }{v.asFloat64()}) case ValueKindBool: return json.Marshal(struct { Value bool `json:"boolValue"` }{v.asBool()}) case ValueKindBytes: return json.Marshal(struct { Value []byte `json:"bytesValue"` }{v.asBytes()}) case ValueKindMap: return json.Marshal(struct { Value struct { Values []Attr `json:"values"` } `json:"kvlistValue"` }{struct { Values []Attr `json:"values"` }{v.asMap()}}) case ValueKindSlice: return json.Marshal(struct { Value struct { Values []Value `json:"values"` } `json:"arrayValue"` }{struct { Values []Value `json:"values"` }{v.asSlice()}}) case ValueKindEmpty: return nil, nil default: return nil, fmt.Errorf("unknown Value kind: %s", v.Kind().String()) } } // UnmarshalJSON decodes the OTLP formatted JSON contained in data into v. func (v *Value) UnmarshalJSON(data []byte) error { decoder := json.NewDecoder(bytes.NewReader(data)) t, err := decoder.Token() if err != nil { return err } if t != json.Delim('{') { return errors.New("invalid Value type") } for decoder.More() { keyIface, err := decoder.Token() if err != nil { if errors.Is(err, io.EOF) { // Empty. return nil } return err } key, ok := keyIface.(string) if !ok { return fmt.Errorf("invalid Value key: %#v", keyIface) } switch key { case "stringValue", "string_value": var val string err = decoder.Decode(&val) *v = StringValue(val) case "boolValue", "bool_value": var val bool err = decoder.Decode(&val) *v = BoolValue(val) case "intValue", "int_value": var val protoInt64 err = decoder.Decode(&val) *v = Int64Value(val.Int64()) case "doubleValue", "double_value": var val float64 err = decoder.Decode(&val) *v = Float64Value(val) case "bytesValue", "bytes_value": var val64 string if err := decoder.Decode(&val64); err != nil { return err } var val []byte val, err = base64.StdEncoding.DecodeString(val64) *v = BytesValue(val) case "arrayValue", "array_value": var val struct{ Values []Value } err = decoder.Decode(&val) *v = SliceValue(val.Values...) case "kvlistValue", "kvlist_value": var val struct{ Values []Attr } err = decoder.Decode(&val) *v = MapValue(val.Values...) default: // Skip unknown. continue } // Use first valid. Ignore the rest. return err } // Only unknown fields. Return nil without unmarshaling any value. return nil } ================================================ FILE: vendor/go.opentelemetry.io/otel/trace/nonrecording.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package trace // import "go.opentelemetry.io/otel/trace" // nonRecordingSpan is a minimal implementation of a Span that wraps a // SpanContext. It performs no operations other than to return the wrapped // SpanContext. type nonRecordingSpan struct { noopSpan sc SpanContext } // SpanContext returns the wrapped SpanContext. func (s nonRecordingSpan) SpanContext() SpanContext { return s.sc } ================================================ FILE: vendor/go.opentelemetry.io/otel/trace/noop/README.md ================================================ # Trace Noop [![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/trace/noop)](https://pkg.go.dev/go.opentelemetry.io/otel/trace/noop) ================================================ FILE: vendor/go.opentelemetry.io/otel/trace/noop/noop.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 // Package noop provides an implementation of the OpenTelemetry trace API that // produces no telemetry and minimizes used computation resources. // // Using this package to implement the OpenTelemetry trace API will effectively // disable OpenTelemetry. // // This implementation can be embedded in other implementations of the // OpenTelemetry trace API. Doing so will mean the implementation defaults to // no operation for methods it does not implement. package noop // import "go.opentelemetry.io/otel/trace/noop" import ( "context" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" "go.opentelemetry.io/otel/trace" "go.opentelemetry.io/otel/trace/embedded" ) var ( // Compile-time check this implements the OpenTelemetry API. _ trace.TracerProvider = TracerProvider{} _ trace.Tracer = Tracer{} _ trace.Span = Span{} ) // TracerProvider is an OpenTelemetry No-Op TracerProvider. type TracerProvider struct{ embedded.TracerProvider } // NewTracerProvider returns a TracerProvider that does not record any telemetry. func NewTracerProvider() TracerProvider { return TracerProvider{} } // Tracer returns an OpenTelemetry Tracer that does not record any telemetry. func (TracerProvider) Tracer(string, ...trace.TracerOption) trace.Tracer { return Tracer{} } // Tracer is an OpenTelemetry No-Op Tracer. type Tracer struct{ embedded.Tracer } // Start creates a span. The created span will be set in a child context of ctx // and returned with the span. // // If ctx contains a span context, the returned span will also contain that // span context. If the span context in ctx is for a non-recording span, that // span instance will be returned directly. func (Tracer) Start(ctx context.Context, _ string, _ ...trace.SpanStartOption) (context.Context, trace.Span) { span := trace.SpanFromContext(ctx) // If the parent context contains a non-zero span context, that span // context needs to be returned as a non-recording span // (https://github.com/open-telemetry/opentelemetry-specification/blob/3a1dde966a4ce87cce5adf464359fe369741bbea/specification/trace/api.md#behavior-of-the-api-in-the-absence-of-an-installed-sdk). var zeroSC trace.SpanContext if sc := span.SpanContext(); !sc.Equal(zeroSC) { if !span.IsRecording() { // If the span is not recording return it directly. return ctx, span } // Otherwise, return the span context needs in a non-recording span. span = Span{sc: sc} } else { // No parent, return a No-Op span with an empty span context. span = noopSpanInstance } return trace.ContextWithSpan(ctx, span), span } var noopSpanInstance trace.Span = Span{} // Span is an OpenTelemetry No-Op Span. type Span struct { embedded.Span sc trace.SpanContext } // SpanContext returns an empty span context. func (s Span) SpanContext() trace.SpanContext { return s.sc } // IsRecording always returns false. func (Span) IsRecording() bool { return false } // SetStatus does nothing. func (Span) SetStatus(codes.Code, string) {} // SetAttributes does nothing. func (Span) SetAttributes(...attribute.KeyValue) {} // End does nothing. func (Span) End(...trace.SpanEndOption) {} // RecordError does nothing. func (Span) RecordError(error, ...trace.EventOption) {} // AddEvent does nothing. func (Span) AddEvent(string, ...trace.EventOption) {} // AddLink does nothing. func (Span) AddLink(trace.Link) {} // SetName does nothing. func (Span) SetName(string) {} // TracerProvider returns a No-Op TracerProvider. func (Span) TracerProvider() trace.TracerProvider { return TracerProvider{} } ================================================ FILE: vendor/go.opentelemetry.io/otel/trace/noop.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package trace // import "go.opentelemetry.io/otel/trace" import ( "context" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" "go.opentelemetry.io/otel/trace/embedded" ) // NewNoopTracerProvider returns an implementation of TracerProvider that // performs no operations. The Tracer and Spans created from the returned // TracerProvider also perform no operations. // // Deprecated: Use [go.opentelemetry.io/otel/trace/noop.NewTracerProvider] // instead. func NewNoopTracerProvider() TracerProvider { return noopTracerProvider{} } type noopTracerProvider struct{ embedded.TracerProvider } var _ TracerProvider = noopTracerProvider{} // Tracer returns noop implementation of Tracer. func (noopTracerProvider) Tracer(string, ...TracerOption) Tracer { return noopTracer{} } // noopTracer is an implementation of Tracer that performs no operations. type noopTracer struct{ embedded.Tracer } var _ Tracer = noopTracer{} // Start carries forward a non-recording Span, if one is present in the context, otherwise it // creates a no-op Span. func (noopTracer) Start(ctx context.Context, _ string, _ ...SpanStartOption) (context.Context, Span) { span := SpanFromContext(ctx) if _, ok := span.(nonRecordingSpan); !ok { // span is likely already a noopSpan, but let's be sure span = noopSpanInstance } return ContextWithSpan(ctx, span), span } // noopSpan is an implementation of Span that performs no operations. type noopSpan struct{ embedded.Span } var noopSpanInstance Span = noopSpan{} // SpanContext returns an empty span context. func (noopSpan) SpanContext() SpanContext { return SpanContext{} } // IsRecording always returns false. func (noopSpan) IsRecording() bool { return false } // SetStatus does nothing. func (noopSpan) SetStatus(codes.Code, string) {} // SetError does nothing. func (noopSpan) SetError(bool) {} // SetAttributes does nothing. func (noopSpan) SetAttributes(...attribute.KeyValue) {} // End does nothing. func (noopSpan) End(...SpanEndOption) {} // RecordError does nothing. func (noopSpan) RecordError(error, ...EventOption) {} // AddEvent does nothing. func (noopSpan) AddEvent(string, ...EventOption) {} // AddLink does nothing. func (noopSpan) AddLink(Link) {} // SetName does nothing. func (noopSpan) SetName(string) {} // TracerProvider returns a no-op TracerProvider. func (s noopSpan) TracerProvider() TracerProvider { return s.tracerProvider(autoInstEnabled) } // autoInstEnabled defines if the auto-instrumentation SDK is enabled. // // The auto-instrumentation is expected to overwrite this value to true when it // attaches to the process. var autoInstEnabled = new(bool) // tracerProvider return a noopTracerProvider if autoEnabled is false, // otherwise it will return a TracerProvider from the sdk package used in // auto-instrumentation. // //go:noinline func (noopSpan) tracerProvider(autoEnabled *bool) TracerProvider { if *autoEnabled { return newAutoTracerProvider() } return noopTracerProvider{} } ================================================ FILE: vendor/go.opentelemetry.io/otel/trace/provider.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package trace // import "go.opentelemetry.io/otel/trace" import "go.opentelemetry.io/otel/trace/embedded" // TracerProvider provides Tracers that are used by instrumentation code to // trace computational workflows. // // A TracerProvider is the collection destination of all Spans from Tracers it // provides, it represents a unique telemetry collection pipeline. How that // pipeline is defined, meaning how those Spans are collected, processed, and // where they are exported, depends on its implementation. Instrumentation // authors do not need to define this implementation, rather just use the // provided Tracers to instrument code. // // Commonly, instrumentation code will accept a TracerProvider implementation // at runtime from its users or it can simply use the globally registered one // (see https://pkg.go.dev/go.opentelemetry.io/otel#GetTracerProvider). // // Warning: Methods may be added to this interface in minor releases. See // package documentation on API implementation for information on how to set // default behavior for unimplemented methods. type TracerProvider interface { // Users of the interface can ignore this. This embedded type is only used // by implementations of this interface. See the "API Implementations" // section of the package documentation for more information. embedded.TracerProvider // Tracer returns a unique Tracer scoped to be used by instrumentation code // to trace computational workflows. The scope and identity of that // instrumentation code is uniquely defined by the name and options passed. // // The passed name needs to uniquely identify instrumentation code. // Therefore, it is recommended that name is the Go package name of the // library providing instrumentation (note: not the code being // instrumented). Instrumentation libraries can have multiple versions, // therefore, the WithInstrumentationVersion option should be used to // distinguish these different codebases. Additionally, instrumentation // libraries may sometimes use traces to communicate different domains of // workflow data (i.e. using spans to communicate workflow events only). If // this is the case, the WithScopeAttributes option should be used to // uniquely identify Tracers that handle the different domains of workflow // data. // // If the same name and options are passed multiple times, the same Tracer // will be returned (it is up to the implementation if this will be the // same underlying instance of that Tracer or not). It is not necessary to // call this multiple times with the same name and options to get an // up-to-date Tracer. All implementations will ensure any TracerProvider // configuration changes are propagated to all provided Tracers. // // If name is empty, then an implementation defined default name will be // used instead. // // This method is safe to call concurrently. Tracer(name string, options ...TracerOption) Tracer } ================================================ FILE: vendor/go.opentelemetry.io/otel/trace/span.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package trace // import "go.opentelemetry.io/otel/trace" import ( "context" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" "go.opentelemetry.io/otel/trace/embedded" ) // Span is the individual component of a trace. It represents a single named // and timed operation of a workflow that is traced. A Tracer is used to // create a Span and it is then up to the operation the Span represents to // properly end the Span when the operation itself ends. // // Warning: Methods may be added to this interface in minor releases. See // package documentation on API implementation for information on how to set // default behavior for unimplemented methods. type Span interface { // Users of the interface can ignore this. This embedded type is only used // by implementations of this interface. See the "API Implementations" // section of the package documentation for more information. embedded.Span // End completes the Span. The Span is considered complete and ready to be // delivered through the rest of the telemetry pipeline after this method // is called. Therefore, updates to the Span are not allowed after this // method has been called. End(options ...SpanEndOption) // AddEvent adds an event with the provided name and options. AddEvent(name string, options ...EventOption) // AddLink adds a link. // Adding links at span creation using WithLinks is preferred to calling AddLink // later, for contexts that are available during span creation, because head // sampling decisions can only consider information present during span creation. AddLink(link Link) // IsRecording returns the recording state of the Span. It will return // true if the Span is active and events can be recorded. IsRecording() bool // RecordError will record err as an exception span event for this span. An // additional call to SetStatus is required if the Status of the Span should // be set to Error, as this method does not change the Span status. If this // span is not being recorded or err is nil then this method does nothing. RecordError(err error, options ...EventOption) // SpanContext returns the SpanContext of the Span. The returned SpanContext // is usable even after the End method has been called for the Span. SpanContext() SpanContext // SetStatus sets the status of the Span in the form of a code and a // description, provided the status hasn't already been set to a higher // value before (OK > Error > Unset). The description is only included in a // status when the code is for an error. SetStatus(code codes.Code, description string) // SetName sets the Span name. SetName(name string) // SetAttributes sets kv as attributes of the Span. If a key from kv // already exists for an attribute of the Span it will be overwritten with // the value contained in kv. // // Note that adding attributes at span creation using [WithAttributes] is preferred // to calling SetAttribute later, as samplers can only consider information // already present during span creation. SetAttributes(kv ...attribute.KeyValue) // TracerProvider returns a TracerProvider that can be used to generate // additional Spans on the same telemetry pipeline as the current Span. TracerProvider() TracerProvider } // Link is the relationship between two Spans. The relationship can be within // the same Trace or across different Traces. // // For example, a Link is used in the following situations: // // 1. Batch Processing: A batch of operations may contain operations // associated with one or more traces/spans. Since there can only be one // parent SpanContext, a Link is used to keep reference to the // SpanContext of all operations in the batch. // 2. Public Endpoint: A SpanContext for an in incoming client request on a // public endpoint should be considered untrusted. In such a case, a new // trace with its own identity and sampling decision needs to be created, // but this new trace needs to be related to the original trace in some // form. A Link is used to keep reference to the original SpanContext and // track the relationship. type Link struct { // SpanContext of the linked Span. SpanContext SpanContext // Attributes describe the aspects of the link. Attributes []attribute.KeyValue } // LinkFromContext returns a link encapsulating the SpanContext in the provided // ctx. func LinkFromContext(ctx context.Context, attrs ...attribute.KeyValue) Link { return Link{ SpanContext: SpanContextFromContext(ctx), Attributes: attrs, } } // SpanKind is the role a Span plays in a Trace. type SpanKind int // As a convenience, these match the proto definition, see // https://github.com/open-telemetry/opentelemetry-proto/blob/30d237e1ff3ab7aa50e0922b5bebdd93505090af/opentelemetry/proto/trace/v1/trace.proto#L101-L129 // // The unspecified value is not a valid `SpanKind`. Use `ValidateSpanKind()` // to coerce a span kind to a valid value. const ( // SpanKindUnspecified is an unspecified SpanKind and is not a valid // SpanKind. SpanKindUnspecified should be replaced with SpanKindInternal // if it is received. SpanKindUnspecified SpanKind = 0 // SpanKindInternal is a SpanKind for a Span that represents an internal // operation within an application. SpanKindInternal SpanKind = 1 // SpanKindServer is a SpanKind for a Span that represents the operation // of handling a request from a client. SpanKindServer SpanKind = 2 // SpanKindClient is a SpanKind for a Span that represents the operation // of client making a request to a server. SpanKindClient SpanKind = 3 // SpanKindProducer is a SpanKind for a Span that represents the operation // of a producer sending a message to a message broker. Unlike // SpanKindClient and SpanKindServer, there is often no direct // relationship between this kind of Span and a SpanKindConsumer kind. A // SpanKindProducer Span will end once the message is accepted by the // message broker which might not overlap with the processing of that // message. SpanKindProducer SpanKind = 4 // SpanKindConsumer is a SpanKind for a Span that represents the operation // of a consumer receiving a message from a message broker. Like // SpanKindProducer Spans, there is often no direct relationship between // this Span and the Span that produced the message. SpanKindConsumer SpanKind = 5 ) // ValidateSpanKind returns a valid span kind value. This will coerce // invalid values into the default value, SpanKindInternal. func ValidateSpanKind(spanKind SpanKind) SpanKind { switch spanKind { case SpanKindInternal, SpanKindServer, SpanKindClient, SpanKindProducer, SpanKindConsumer: // valid return spanKind default: return SpanKindInternal } } // String returns the specified name of the SpanKind in lower-case. func (sk SpanKind) String() string { switch sk { case SpanKindInternal: return "internal" case SpanKindServer: return "server" case SpanKindClient: return "client" case SpanKindProducer: return "producer" case SpanKindConsumer: return "consumer" default: return "unspecified" } } ================================================ FILE: vendor/go.opentelemetry.io/otel/trace/trace.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package trace // import "go.opentelemetry.io/otel/trace" import ( "encoding/json" ) const ( // FlagsSampled is a bitmask with the sampled bit set. A SpanContext // with the sampling bit set means the span is sampled. FlagsSampled = TraceFlags(0x01) errInvalidHexID errorConst = "trace-id and span-id can only contain [0-9a-f] characters, all lowercase" errInvalidTraceIDLength errorConst = "hex encoded trace-id must have length equals to 32" errNilTraceID errorConst = "trace-id can't be all zero" errInvalidSpanIDLength errorConst = "hex encoded span-id must have length equals to 16" errNilSpanID errorConst = "span-id can't be all zero" ) type errorConst string func (e errorConst) Error() string { return string(e) } // TraceID is a unique identity of a trace. // nolint:revive // revive complains about stutter of `trace.TraceID`. type TraceID [16]byte var ( nilTraceID TraceID _ json.Marshaler = nilTraceID ) // IsValid reports whether the trace TraceID is valid. A valid trace ID does // not consist of zeros only. func (t TraceID) IsValid() bool { return t != nilTraceID } // MarshalJSON implements a custom marshal function to encode TraceID // as a hex string. func (t TraceID) MarshalJSON() ([]byte, error) { b := [32 + 2]byte{0: '"', 33: '"'} h := t.hexBytes() copy(b[1:], h[:]) return b[:], nil } // String returns the hex string representation form of a TraceID. func (t TraceID) String() string { h := t.hexBytes() return string(h[:]) } // hexBytes returns the hex string representation form of a TraceID. func (t TraceID) hexBytes() [32]byte { return [32]byte{ hexLU[t[0x0]>>4], hexLU[t[0x0]&0xf], hexLU[t[0x1]>>4], hexLU[t[0x1]&0xf], hexLU[t[0x2]>>4], hexLU[t[0x2]&0xf], hexLU[t[0x3]>>4], hexLU[t[0x3]&0xf], hexLU[t[0x4]>>4], hexLU[t[0x4]&0xf], hexLU[t[0x5]>>4], hexLU[t[0x5]&0xf], hexLU[t[0x6]>>4], hexLU[t[0x6]&0xf], hexLU[t[0x7]>>4], hexLU[t[0x7]&0xf], hexLU[t[0x8]>>4], hexLU[t[0x8]&0xf], hexLU[t[0x9]>>4], hexLU[t[0x9]&0xf], hexLU[t[0xa]>>4], hexLU[t[0xa]&0xf], hexLU[t[0xb]>>4], hexLU[t[0xb]&0xf], hexLU[t[0xc]>>4], hexLU[t[0xc]&0xf], hexLU[t[0xd]>>4], hexLU[t[0xd]&0xf], hexLU[t[0xe]>>4], hexLU[t[0xe]&0xf], hexLU[t[0xf]>>4], hexLU[t[0xf]&0xf], } } // SpanID is a unique identity of a span in a trace. type SpanID [8]byte var ( nilSpanID SpanID _ json.Marshaler = nilSpanID ) // IsValid reports whether the SpanID is valid. A valid SpanID does not consist // of zeros only. func (s SpanID) IsValid() bool { return s != nilSpanID } // MarshalJSON implements a custom marshal function to encode SpanID // as a hex string. func (s SpanID) MarshalJSON() ([]byte, error) { b := [16 + 2]byte{0: '"', 17: '"'} h := s.hexBytes() copy(b[1:], h[:]) return b[:], nil } // String returns the hex string representation form of a SpanID. func (s SpanID) String() string { b := s.hexBytes() return string(b[:]) } func (s SpanID) hexBytes() [16]byte { return [16]byte{ hexLU[s[0]>>4], hexLU[s[0]&0xf], hexLU[s[1]>>4], hexLU[s[1]&0xf], hexLU[s[2]>>4], hexLU[s[2]&0xf], hexLU[s[3]>>4], hexLU[s[3]&0xf], hexLU[s[4]>>4], hexLU[s[4]&0xf], hexLU[s[5]>>4], hexLU[s[5]&0xf], hexLU[s[6]>>4], hexLU[s[6]&0xf], hexLU[s[7]>>4], hexLU[s[7]&0xf], } } // TraceIDFromHex returns a TraceID from a hex string if it is compliant with // the W3C trace-context specification. See more at // https://www.w3.org/TR/trace-context/#trace-id // nolint:revive // revive complains about stutter of `trace.TraceIDFromHex`. func TraceIDFromHex(h string) (TraceID, error) { if len(h) != 32 { return [16]byte{}, errInvalidTraceIDLength } var b [16]byte invalidMark := byte(0) for i := 0; i < len(h); i += 4 { b[i/2] = (hexRev[h[i]] << 4) | hexRev[h[i+1]] b[i/2+1] = (hexRev[h[i+2]] << 4) | hexRev[h[i+3]] invalidMark |= hexRev[h[i]] | hexRev[h[i+1]] | hexRev[h[i+2]] | hexRev[h[i+3]] } // If the upper 4 bits of any byte are not zero, there was an invalid hex // character since invalid hex characters are 0xff in hexRev. if invalidMark&0xf0 != 0 { return [16]byte{}, errInvalidHexID } // If we didn't set any bits, then h was all zeros. if invalidMark == 0 { return [16]byte{}, errNilTraceID } return b, nil } // SpanIDFromHex returns a SpanID from a hex string if it is compliant // with the w3c trace-context specification. // See more at https://www.w3.org/TR/trace-context/#parent-id func SpanIDFromHex(h string) (SpanID, error) { if len(h) != 16 { return [8]byte{}, errInvalidSpanIDLength } var b [8]byte invalidMark := byte(0) for i := 0; i < len(h); i += 4 { b[i/2] = (hexRev[h[i]] << 4) | hexRev[h[i+1]] b[i/2+1] = (hexRev[h[i+2]] << 4) | hexRev[h[i+3]] invalidMark |= hexRev[h[i]] | hexRev[h[i+1]] | hexRev[h[i+2]] | hexRev[h[i+3]] } // If the upper 4 bits of any byte are not zero, there was an invalid hex // character since invalid hex characters are 0xff in hexRev. if invalidMark&0xf0 != 0 { return [8]byte{}, errInvalidHexID } // If we didn't set any bits, then h was all zeros. if invalidMark == 0 { return [8]byte{}, errNilSpanID } return b, nil } // TraceFlags contains flags that can be set on a SpanContext. type TraceFlags byte //nolint:revive // revive complains about stutter of `trace.TraceFlags`. // IsSampled reports whether the sampling bit is set in the TraceFlags. func (tf TraceFlags) IsSampled() bool { return tf&FlagsSampled == FlagsSampled } // WithSampled sets the sampling bit in a new copy of the TraceFlags. func (tf TraceFlags) WithSampled(sampled bool) TraceFlags { // nolint:revive // sampled is not a control flag. if sampled { return tf | FlagsSampled } return tf &^ FlagsSampled } // MarshalJSON implements a custom marshal function to encode TraceFlags // as a hex string. func (tf TraceFlags) MarshalJSON() ([]byte, error) { b := [2 + 2]byte{0: '"', 3: '"'} h := tf.hexBytes() copy(b[1:], h[:]) return b[:], nil } // String returns the hex string representation form of TraceFlags. func (tf TraceFlags) String() string { h := tf.hexBytes() return string(h[:]) } func (tf TraceFlags) hexBytes() [2]byte { return [2]byte{hexLU[tf>>4], hexLU[tf&0xf]} } // SpanContextConfig contains mutable fields usable for constructing // an immutable SpanContext. type SpanContextConfig struct { TraceID TraceID SpanID SpanID TraceFlags TraceFlags TraceState TraceState Remote bool } // NewSpanContext constructs a SpanContext using values from the provided // SpanContextConfig. func NewSpanContext(config SpanContextConfig) SpanContext { return SpanContext{ traceID: config.TraceID, spanID: config.SpanID, traceFlags: config.TraceFlags, traceState: config.TraceState, remote: config.Remote, } } // SpanContext contains identifying trace information about a Span. type SpanContext struct { traceID TraceID spanID SpanID traceFlags TraceFlags traceState TraceState remote bool } var _ json.Marshaler = SpanContext{} // IsValid reports whether the SpanContext is valid. A valid span context has a // valid TraceID and SpanID. func (sc SpanContext) IsValid() bool { return sc.HasTraceID() && sc.HasSpanID() } // IsRemote reports whether the SpanContext represents a remotely-created Span. func (sc SpanContext) IsRemote() bool { return sc.remote } // WithRemote returns a copy of sc with the Remote property set to remote. func (sc SpanContext) WithRemote(remote bool) SpanContext { return SpanContext{ traceID: sc.traceID, spanID: sc.spanID, traceFlags: sc.traceFlags, traceState: sc.traceState, remote: remote, } } // TraceID returns the TraceID from the SpanContext. func (sc SpanContext) TraceID() TraceID { return sc.traceID } // HasTraceID reports whether the SpanContext has a valid TraceID. func (sc SpanContext) HasTraceID() bool { return sc.traceID.IsValid() } // WithTraceID returns a new SpanContext with the TraceID replaced. func (sc SpanContext) WithTraceID(traceID TraceID) SpanContext { return SpanContext{ traceID: traceID, spanID: sc.spanID, traceFlags: sc.traceFlags, traceState: sc.traceState, remote: sc.remote, } } // SpanID returns the SpanID from the SpanContext. func (sc SpanContext) SpanID() SpanID { return sc.spanID } // HasSpanID reports whether the SpanContext has a valid SpanID. func (sc SpanContext) HasSpanID() bool { return sc.spanID.IsValid() } // WithSpanID returns a new SpanContext with the SpanID replaced. func (sc SpanContext) WithSpanID(spanID SpanID) SpanContext { return SpanContext{ traceID: sc.traceID, spanID: spanID, traceFlags: sc.traceFlags, traceState: sc.traceState, remote: sc.remote, } } // TraceFlags returns the flags from the SpanContext. func (sc SpanContext) TraceFlags() TraceFlags { return sc.traceFlags } // IsSampled reports whether the sampling bit is set in the SpanContext's TraceFlags. func (sc SpanContext) IsSampled() bool { return sc.traceFlags.IsSampled() } // WithTraceFlags returns a new SpanContext with the TraceFlags replaced. func (sc SpanContext) WithTraceFlags(flags TraceFlags) SpanContext { return SpanContext{ traceID: sc.traceID, spanID: sc.spanID, traceFlags: flags, traceState: sc.traceState, remote: sc.remote, } } // TraceState returns the TraceState from the SpanContext. func (sc SpanContext) TraceState() TraceState { return sc.traceState } // WithTraceState returns a new SpanContext with the TraceState replaced. func (sc SpanContext) WithTraceState(state TraceState) SpanContext { return SpanContext{ traceID: sc.traceID, spanID: sc.spanID, traceFlags: sc.traceFlags, traceState: state, remote: sc.remote, } } // Equal reports whether two SpanContext values are equal. func (sc SpanContext) Equal(other SpanContext) bool { return sc.traceID == other.traceID && sc.spanID == other.spanID && sc.traceFlags == other.traceFlags && sc.traceState.String() == other.traceState.String() && sc.remote == other.remote } // MarshalJSON implements a custom marshal function to encode a SpanContext. func (sc SpanContext) MarshalJSON() ([]byte, error) { return json.Marshal(SpanContextConfig{ TraceID: sc.traceID, SpanID: sc.spanID, TraceFlags: sc.traceFlags, TraceState: sc.traceState, Remote: sc.remote, }) } ================================================ FILE: vendor/go.opentelemetry.io/otel/trace/tracer.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package trace // import "go.opentelemetry.io/otel/trace" import ( "context" "go.opentelemetry.io/otel/trace/embedded" ) // Tracer is the creator of Spans. // // Warning: Methods may be added to this interface in minor releases. See // package documentation on API implementation for information on how to set // default behavior for unimplemented methods. type Tracer interface { // Users of the interface can ignore this. This embedded type is only used // by implementations of this interface. See the "API Implementations" // section of the package documentation for more information. embedded.Tracer // Start creates a span and a context.Context containing the newly-created span. // // If the context.Context provided in `ctx` contains a Span then the newly-created // Span will be a child of that span, otherwise it will be a root span. This behavior // can be overridden by providing `WithNewRoot()` as a SpanOption, causing the // newly-created Span to be a root span even if `ctx` contains a Span. // // When creating a Span it is recommended to provide all known span attributes using // the `WithAttributes()` SpanOption as samplers will only have access to the // attributes provided when a Span is created. // // Any Span that is created MUST also be ended. This is the responsibility of the user. // Implementations of this API may leak memory or other resources if Spans are not ended. Start(ctx context.Context, spanName string, opts ...SpanStartOption) (context.Context, Span) } ================================================ FILE: vendor/go.opentelemetry.io/otel/trace/tracestate.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package trace // import "go.opentelemetry.io/otel/trace" import ( "encoding/json" "fmt" "strings" ) const ( maxListMembers = 32 listDelimiters = "," memberDelimiter = "=" errInvalidKey errorConst = "invalid tracestate key" errInvalidValue errorConst = "invalid tracestate value" errInvalidMember errorConst = "invalid tracestate list-member" errMemberNumber errorConst = "too many list-members in tracestate" errDuplicate errorConst = "duplicate list-member in tracestate" ) type member struct { Key string Value string } // according to (chr = %x20 / (nblk-char = %x21-2B / %x2D-3C / %x3E-7E) ) // means (chr = %x20-2B / %x2D-3C / %x3E-7E) . func checkValueChar(v byte) bool { return v >= '\x20' && v <= '\x7e' && v != '\x2c' && v != '\x3d' } // according to (nblk-chr = %x21-2B / %x2D-3C / %x3E-7E) . func checkValueLast(v byte) bool { return v >= '\x21' && v <= '\x7e' && v != '\x2c' && v != '\x3d' } // based on the W3C Trace Context specification // // value = (0*255(chr)) nblk-chr // nblk-chr = %x21-2B / %x2D-3C / %x3E-7E // chr = %x20 / nblk-chr // // see https://www.w3.org/TR/trace-context-1/#value func checkValue(val string) bool { n := len(val) if n == 0 || n > 256 { return false } for i := 0; i < n-1; i++ { if !checkValueChar(val[i]) { return false } } return checkValueLast(val[n-1]) } func checkKeyRemain(key string) bool { // ( lcalpha / DIGIT / "_" / "-"/ "*" / "/" ) for _, v := range key { if isAlphaNum(byte(v)) { continue } switch v { case '_', '-', '*', '/': continue } return false } return true } // according to // // simple-key = lcalpha (0*255( lcalpha / DIGIT / "_" / "-"/ "*" / "/" )) // system-id = lcalpha (0*13( lcalpha / DIGIT / "_" / "-"/ "*" / "/" )) // // param n is remain part length, should be 255 in simple-key or 13 in system-id. func checkKeyPart(key string, n int) bool { if key == "" { return false } first := key[0] // key's first char ret := len(key[1:]) <= n ret = ret && first >= 'a' && first <= 'z' return ret && checkKeyRemain(key[1:]) } func isAlphaNum(c byte) bool { if c >= 'a' && c <= 'z' { return true } return c >= '0' && c <= '9' } // according to // // tenant-id = ( lcalpha / DIGIT ) 0*240( lcalpha / DIGIT / "_" / "-"/ "*" / "/" ) // // param n is remain part length, should be 240 exactly. func checkKeyTenant(key string, n int) bool { if key == "" { return false } return isAlphaNum(key[0]) && len(key[1:]) <= n && checkKeyRemain(key[1:]) } // based on the W3C Trace Context specification // // key = simple-key / multi-tenant-key // simple-key = lcalpha (0*255( lcalpha / DIGIT / "_" / "-"/ "*" / "/" )) // multi-tenant-key = tenant-id "@" system-id // tenant-id = ( lcalpha / DIGIT ) (0*240( lcalpha / DIGIT / "_" / "-"/ "*" / "/" )) // system-id = lcalpha (0*13( lcalpha / DIGIT / "_" / "-"/ "*" / "/" )) // lcalpha = %x61-7A ; a-z // // see https://www.w3.org/TR/trace-context-1/#tracestate-header. func checkKey(key string) bool { tenant, system, ok := strings.Cut(key, "@") if !ok { return checkKeyPart(key, 255) } return checkKeyTenant(tenant, 240) && checkKeyPart(system, 13) } func newMember(key, value string) (member, error) { if !checkKey(key) { return member{}, errInvalidKey } if !checkValue(value) { return member{}, errInvalidValue } return member{Key: key, Value: value}, nil } func parseMember(m string) (member, error) { key, val, ok := strings.Cut(m, memberDelimiter) if !ok { return member{}, fmt.Errorf("%w: %s", errInvalidMember, m) } key = strings.TrimLeft(key, " \t") val = strings.TrimRight(val, " \t") result, e := newMember(key, val) if e != nil { return member{}, fmt.Errorf("%w: %s", errInvalidMember, m) } return result, nil } // String encodes member into a string compliant with the W3C Trace Context // specification. func (m member) String() string { return m.Key + "=" + m.Value } // TraceState provides additional vendor-specific trace identification // information across different distributed tracing systems. It represents an // immutable list consisting of key/value pairs, each pair is referred to as a // list-member. // // TraceState conforms to the W3C Trace Context specification // (https://www.w3.org/TR/trace-context-1). All operations that create or copy // a TraceState do so by validating all input and will only produce TraceState // that conform to the specification. Specifically, this means that all // list-member's key/value pairs are valid, no duplicate list-members exist, // and the maximum number of list-members (32) is not exceeded. type TraceState struct { //nolint:revive // revive complains about stutter of `trace.TraceState` // list is the members in order. list []member } var _ json.Marshaler = TraceState{} // ParseTraceState attempts to decode a TraceState from the passed // string. It returns an error if the input is invalid according to the W3C // Trace Context specification. func ParseTraceState(ts string) (TraceState, error) { if ts == "" { return TraceState{}, nil } wrapErr := func(err error) error { return fmt.Errorf("failed to parse tracestate: %w", err) } var members []member found := make(map[string]struct{}) for ts != "" { var memberStr string memberStr, ts, _ = strings.Cut(ts, listDelimiters) if memberStr == "" { continue } m, err := parseMember(memberStr) if err != nil { return TraceState{}, wrapErr(err) } if _, ok := found[m.Key]; ok { return TraceState{}, wrapErr(errDuplicate) } found[m.Key] = struct{}{} members = append(members, m) if n := len(members); n > maxListMembers { return TraceState{}, wrapErr(errMemberNumber) } } return TraceState{list: members}, nil } // MarshalJSON marshals the TraceState into JSON. func (ts TraceState) MarshalJSON() ([]byte, error) { return json.Marshal(ts.String()) } // String encodes the TraceState into a string compliant with the W3C // Trace Context specification. The returned string will be invalid if the // TraceState contains any invalid members. func (ts TraceState) String() string { if len(ts.list) == 0 { return "" } var n int n += len(ts.list) // member delimiters: '=' n += len(ts.list) - 1 // list delimiters: ',' for _, mem := range ts.list { n += len(mem.Key) n += len(mem.Value) } var sb strings.Builder sb.Grow(n) _, _ = sb.WriteString(ts.list[0].Key) _ = sb.WriteByte('=') _, _ = sb.WriteString(ts.list[0].Value) for i := 1; i < len(ts.list); i++ { _ = sb.WriteByte(listDelimiters[0]) _, _ = sb.WriteString(ts.list[i].Key) _ = sb.WriteByte('=') _, _ = sb.WriteString(ts.list[i].Value) } return sb.String() } // Get returns the value paired with key from the corresponding TraceState // list-member if it exists, otherwise an empty string is returned. func (ts TraceState) Get(key string) string { for _, member := range ts.list { if member.Key == key { return member.Value } } return "" } // Walk walks all key value pairs in the TraceState by calling f // Iteration stops if f returns false. func (ts TraceState) Walk(f func(key, value string) bool) { for _, m := range ts.list { if !f(m.Key, m.Value) { break } } } // Insert adds a new list-member defined by the key/value pair to the // TraceState. If a list-member already exists for the given key, that // list-member's value is updated. The new or updated list-member is always // moved to the beginning of the TraceState as specified by the W3C Trace // Context specification. // // If key or value are invalid according to the W3C Trace Context // specification an error is returned with the original TraceState. // // If adding a new list-member means the TraceState would have more members // then is allowed, the new list-member will be inserted and the right-most // list-member will be dropped in the returned TraceState. func (ts TraceState) Insert(key, value string) (TraceState, error) { m, err := newMember(key, value) if err != nil { return ts, err } n := len(ts.list) found := n for i := range ts.list { if ts.list[i].Key == key { found = i } } cTS := TraceState{} if found == n && n < maxListMembers { cTS.list = make([]member, n+1) } else { cTS.list = make([]member, n) } cTS.list[0] = m // When the number of members exceeds capacity, drop the "right-most". copy(cTS.list[1:], ts.list[0:found]) if found < n { copy(cTS.list[1+found:], ts.list[found+1:]) } return cTS, nil } // Delete returns a copy of the TraceState with the list-member identified by // key removed. func (ts TraceState) Delete(key string) TraceState { members := make([]member, ts.Len()) copy(members, ts.list) for i, member := range ts.list { if member.Key == key { members = append(members[:i], members[i+1:]...) // TraceState should contain no duplicate members. break } } return TraceState{list: members} } // Len returns the number of list-members in the TraceState. func (ts TraceState) Len() int { return len(ts.list) } ================================================ FILE: vendor/go.opentelemetry.io/otel/trace.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package otel // import "go.opentelemetry.io/otel" import ( "go.opentelemetry.io/otel/internal/global" "go.opentelemetry.io/otel/trace" ) // Tracer creates a named tracer that implements Tracer interface. // If the name is an empty string then provider uses default name. // // This is short for GetTracerProvider().Tracer(name, opts...) func Tracer(name string, opts ...trace.TracerOption) trace.Tracer { return GetTracerProvider().Tracer(name, opts...) } // GetTracerProvider returns the registered global trace provider. // If none is registered then an instance of NoopTracerProvider is returned. // // Use the trace provider to create a named tracer. E.g. // // tracer := otel.GetTracerProvider().Tracer("example.com/foo") // // or // // tracer := otel.Tracer("example.com/foo") func GetTracerProvider() trace.TracerProvider { return global.TracerProvider() } // SetTracerProvider registers `tp` as the global trace provider. func SetTracerProvider(tp trace.TracerProvider) { global.SetTracerProvider(tp) } ================================================ FILE: vendor/go.opentelemetry.io/otel/verify_released_changelog.sh ================================================ #!/bin/bash # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 set -euo pipefail TARGET="${1:?Must provide target ref}" FILE="CHANGELOG.md" TEMP_DIR=$(mktemp -d) echo "Temp folder: $TEMP_DIR" # Only the latest commit of the feature branch is available # automatically. To diff with the base branch, we need to # fetch that too (and we only need its latest commit). git fetch origin "${TARGET}" --depth=1 # Checkout the previous version on the base branch of the changelog to tmpfolder git --work-tree="$TEMP_DIR" checkout FETCH_HEAD $FILE PREVIOUS_FILE="$TEMP_DIR/$FILE" CURRENT_FILE="$FILE" PREVIOUS_LOCKED_FILE="$TEMP_DIR/previous_locked_section.md" CURRENT_LOCKED_FILE="$TEMP_DIR/current_locked_section.md" # Extract released sections from the previous version awk '/^/ {flag=1} /^/ {flag=0} flag' "$PREVIOUS_FILE" > "$PREVIOUS_LOCKED_FILE" # Extract released sections from the current version awk '/^/ {flag=1} /^/ {flag=0} flag' "$CURRENT_FILE" > "$CURRENT_LOCKED_FILE" # Compare the released sections if ! diff -q "$PREVIOUS_LOCKED_FILE" "$CURRENT_LOCKED_FILE"; then echo "Error: The released sections of the changelog file have been modified." diff "$PREVIOUS_LOCKED_FILE" "$CURRENT_LOCKED_FILE" rm -rf "$TEMP_DIR" false fi rm -rf "$TEMP_DIR" echo "The released sections remain unchanged." ================================================ FILE: vendor/go.opentelemetry.io/otel/version.go ================================================ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package otel // import "go.opentelemetry.io/otel" // Version is the current release version of OpenTelemetry in use. func Version() string { return "1.40.0" } ================================================ FILE: vendor/go.opentelemetry.io/otel/versions.yaml ================================================ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 module-sets: stable-v1: version: v1.40.0 modules: - go.opentelemetry.io/otel - go.opentelemetry.io/otel/bridge/opencensus - go.opentelemetry.io/otel/bridge/opencensus/test - go.opentelemetry.io/otel/bridge/opentracing - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp - go.opentelemetry.io/otel/exporters/otlp/otlptrace - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp - go.opentelemetry.io/otel/exporters/stdout/stdoutmetric - go.opentelemetry.io/otel/exporters/stdout/stdouttrace - go.opentelemetry.io/otel/exporters/zipkin - go.opentelemetry.io/otel/metric - go.opentelemetry.io/otel/sdk - go.opentelemetry.io/otel/sdk/metric - go.opentelemetry.io/otel/trace experimental-metrics: version: v0.62.0 modules: - go.opentelemetry.io/otel/exporters/prometheus experimental-logs: version: v0.16.0 modules: - go.opentelemetry.io/otel/log - go.opentelemetry.io/otel/log/logtest - go.opentelemetry.io/otel/sdk/log - go.opentelemetry.io/otel/sdk/log/logtest - go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc - go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp - go.opentelemetry.io/otel/exporters/stdout/stdoutlog experimental-schema: version: v0.0.14 modules: - go.opentelemetry.io/otel/schema excluded-modules: - go.opentelemetry.io/otel/internal/tools - go.opentelemetry.io/otel/trace/internal/telemetry/test modules: go.opentelemetry.io/otel/exporters/stdout/stdouttrace: version-refs: - ./internal/version.go go.opentelemetry.io/otel/exporters/stdout/stdoutmetric: version-refs: - ./internal/version.go go.opentelemetry.io/otel/exporters/prometheus: version-refs: - ./internal/version.go go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc: version-refs: - ./internal/version.go go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc: version-refs: - ./internal/version.go go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp: version-refs: - ./internal/version.go go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp: version-refs: - ./internal/version.go ================================================ FILE: vendor/go.podman.io/common/LICENSE ================================================ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "{}" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright {yyyy} {name of copyright owner} Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: vendor/go.podman.io/common/pkg/auth/auth.go ================================================ package auth import ( "bufio" "context" "errors" "fmt" "net/url" "os" "path/filepath" "strings" "github.com/sirupsen/logrus" passwd "go.podman.io/common/pkg/password" "go.podman.io/image/v5/docker" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/pkg/docker/config" "go.podman.io/image/v5/pkg/sysregistriesv2" "go.podman.io/image/v5/types" "go.podman.io/storage/pkg/fileutils" "go.podman.io/storage/pkg/homedir" ) // ErrNewCredentialsInvalid means that the new user-provided credentials are // not accepted by the registry. type ErrNewCredentialsInvalid struct { underlyingError error message string } // Error returns the error message as a string. func (e ErrNewCredentialsInvalid) Error() string { return e.message } // Unwrap returns the underlying error. func (e ErrNewCredentialsInvalid) Unwrap() error { return e.underlyingError } // GetDefaultAuthFile returns env value REGISTRY_AUTH_FILE as default // --authfile path used in multiple --authfile flag definitions // Will fail over to DOCKER_CONFIG if REGISTRY_AUTH_FILE environment is not set // // WARNINGS: // - In almost all invocations, expect this function to return ""; so it can not be used // for directly accessing the file. // - Use this only for commands that _read_ credentials, not write them. // The path may refer to github.com/containers auth.json, or to Docker config.json, // and the distinction is lost; writing auth.json data to config.json may not be consumable by Docker, // or it may overwrite and discard unrelated Docker configuration set by the user. func GetDefaultAuthFile() string { // Keep this in sync with the default logic in systemContextWithOptions! if authfile := os.Getenv("REGISTRY_AUTH_FILE"); authfile != "" { return authfile } // This pre-existing behavior is not conceptually consistent: // If users have a ~/.docker/config.json in the default path, and no environment variable // set, we read auth.json first, falling back to config.json; // but if DOCKER_CONFIG is set, we read only config.json in that path, and we don’t read auth.json at all. if authEnv := os.Getenv("DOCKER_CONFIG"); authEnv != "" { return filepath.Join(authEnv, "config.json") } return "" } // CheckAuthFile validates a path option, failing if the option is set but the referenced file is not accessible. func CheckAuthFile(pathOption string) error { if pathOption == "" { return nil } if err := fileutils.Exists(pathOption); err != nil { return fmt.Errorf("credential file is not accessible: %w", err) } return nil } // systemContextWithOptions returns a version of sys // updated with authFile, dockerCompatAuthFile and certDir values (if they are not ""). // NOTE: this is a shallow copy that can be used and updated, but may share // data with the original parameter. func systemContextWithOptions(sys *types.SystemContext, authFile, dockerCompatAuthFile, certDir string) (*types.SystemContext, error) { if sys != nil { sysCopy := *sys sys = &sysCopy } else { sys = &types.SystemContext{} } defaultDockerConfigPath := filepath.Join(homedir.Get(), ".docker", "config.json") switch { case authFile != "" && dockerCompatAuthFile != "": return nil, errors.New("options for paths to the credential file and to the Docker-compatible credential file can not be set simultaneously") case authFile != "": if authFile == defaultDockerConfigPath { logrus.Warn("saving credentials to ~/.docker/config.json, but not using Docker-compatible file format") } sys.AuthFilePath = authFile case dockerCompatAuthFile != "": sys.DockerCompatAuthFilePath = dockerCompatAuthFile default: // Keep this in sync with GetDefaultAuthFile()! // // Note that c/image does not natively implement the REGISTRY_AUTH_FILE // variable, so not all callers look for credentials in this location. if authFileVar := os.Getenv("REGISTRY_AUTH_FILE"); authFileVar != "" { if authFileVar == defaultDockerConfigPath { logrus.Warn("$REGISTRY_AUTH_FILE points to ~/.docker/config.json, but the file format is not fully compatible; use the Docker-compatible file path option instead") } sys.AuthFilePath = authFileVar } else if dockerConfig := os.Getenv("DOCKER_CONFIG"); dockerConfig != "" { // This preserves pre-existing _inconsistent_ behavior: // If the Docker configuration exists in the default ~/.docker/config.json location, // we DO NOT write to it; instead, we update auth.json in the default path. // Only if the user explicitly sets DOCKER_CONFIG, we write to that config.json. sys.DockerCompatAuthFilePath = filepath.Join(dockerConfig, "config.json") } } if certDir != "" { sys.DockerCertPath = certDir } return sys, nil } // Login implements a “log in” command with the provided opts and args // reading the password from opts.Stdin or the options in opts. func Login(ctx context.Context, systemContext *types.SystemContext, opts *LoginOptions, args []string) error { systemContext, err := systemContextWithOptions(systemContext, opts.AuthFile, opts.DockerCompatAuthFile, opts.CertDir) if err != nil { return err } var key, registry string switch len(args) { case 0: if !opts.AcceptUnspecifiedRegistry { return errors.New("please provide a registry to log in to") } if key, err = defaultRegistryWhenUnspecified(systemContext); err != nil { return err } registry = key logrus.Debugf("registry not specified, default to the first registry %q from registries.conf", key) case 1: key, registry, err = parseCredentialsKey(args[0], opts.AcceptRepositories) if err != nil { return err } default: return errors.New("login accepts only one registry to log in to") } authConfig, err := config.GetCredentials(systemContext, key) if err != nil { return fmt.Errorf("get credentials: %w", err) } if opts.GetLoginSet { if authConfig.Username == "" { return fmt.Errorf("not logged into %s", key) } fmt.Fprintf(opts.Stdout, "%s\n", authConfig.Username) return nil } if authConfig.IdentityToken != "" { return errors.New("currently logged in, auth file contains an Identity token") } password := opts.Password if opts.StdinPassword { var stdinPasswordStrBuilder strings.Builder if opts.Password != "" { return errors.New("can't specify both --password-stdin and --password") } if opts.Username == "" { return errors.New("must provide --username with --password-stdin") } scanner := bufio.NewScanner(opts.Stdin) for scanner.Scan() { fmt.Fprint(&stdinPasswordStrBuilder, scanner.Text()) } password = stdinPasswordStrBuilder.String() } // If no username and no password is specified, try to use existing ones. if opts.Username == "" && password == "" && authConfig.Username != "" && authConfig.Password != "" { fmt.Fprintf(opts.Stdout, "Authenticating with existing credentials for %s\n", key) if err := docker.CheckAuth(ctx, systemContext, authConfig.Username, authConfig.Password, registry); err == nil { fmt.Fprintf(opts.Stdout, "Existing credentials are valid. Already logged in to %s\n", registry) return nil } fmt.Fprintln(opts.Stdout, "Existing credentials are invalid, please enter valid username and password") } username, password, err := getUserAndPass(opts, password, authConfig.Username) if err != nil { return fmt.Errorf("getting username and password: %w", err) } if err = docker.CheckAuth(ctx, systemContext, username, password, registry); err == nil { if !opts.NoWriteBack { // Write the new credentials to the authfile desc, err := config.SetCredentials(systemContext, key, username, password) if err != nil { return err } if opts.Verbose { fmt.Fprintln(opts.Stdout, "Used: ", desc) } } fmt.Fprintln(opts.Stdout, "Login Succeeded!") return nil } if unauthorized, ok := err.(docker.ErrUnauthorizedForCredentials); ok { logrus.Debugf("error logging into %q: %v", key, unauthorized) return ErrNewCredentialsInvalid{ underlyingError: err, message: fmt.Sprintf("logging into %q: invalid username/password", key), } } return fmt.Errorf("authenticating creds for %q: %w", key, err) } // parseCredentialsKey turns the provided argument into a valid credential key // and computes the registry part. func parseCredentialsKey(arg string, acceptRepositories bool) (key, registry string, err error) { // URL arguments are replaced with their host[:port] parts. key, err = replaceURLByHostPort(arg) if err != nil { return "", "", err } registry, _, _ = strings.Cut(key, "/") if !acceptRepositories { return registry, registry, nil } // Return early if the key isn't namespaced or uses an http{s} prefix. if registry == key { return key, registry, nil } // Sanity-check that the key looks reasonable (e.g. doesn't use invalid characters), // and does not contain a tag or digest. // WARNING: ref.Named() MUST NOT be used to compute key, because // reference.ParseNormalizedNamed() turns docker.io/vendor to docker.io/library/vendor // Ideally c/image should provide dedicated validation functionality. ref, err := reference.ParseNormalizedNamed(key) if err != nil { return "", "", fmt.Errorf("parse reference from %q: %w", key, err) } if !reference.IsNameOnly(ref) { return "", "", fmt.Errorf("reference %q contains tag or digest", ref.String()) } refRegistry := reference.Domain(ref) if refRegistry != registry { // This should never happen, check just to make sure return "", "", fmt.Errorf("internal error: key %q registry mismatch, %q vs. %q", key, ref, refRegistry) } return key, registry, nil } // If the specified string starts with http{s} it is replaced with it's // host[:port] parts; everything else is stripped. Otherwise, the string is // returned as is. func replaceURLByHostPort(repository string) (string, error) { if !strings.HasPrefix(repository, "https://") && !strings.HasPrefix(repository, "http://") { return repository, nil } u, err := url.Parse(repository) if err != nil { return "", fmt.Errorf("trimming http{s} prefix: %v", err) } return u.Host, nil } // getUserAndPass gets the username and password from STDIN if not given // using the -u and -p flags. If the username prompt is left empty, the // displayed userFromAuthFile will be used instead. func getUserAndPass(opts *LoginOptions, password, userFromAuthFile string) (user, pass string, err error) { username := opts.Username if username == "" { if opts.Stdin == nil { return "", "", errors.New("cannot prompt for username without stdin") } if userFromAuthFile != "" { fmt.Fprintf(opts.Stdout, "Username (%s): ", userFromAuthFile) } else { fmt.Fprint(opts.Stdout, "Username: ") } reader := bufio.NewReader(opts.Stdin) username, err = reader.ReadString('\n') if err != nil { return "", "", fmt.Errorf("reading username: %w", err) } // If the user just hit enter, use the displayed user from // the authentication file. This allows to do a lazy // `$ buildah login -p $NEW_PASSWORD` without specifying the // user. if strings.TrimSpace(username) == "" { username = userFromAuthFile } } if password == "" { fmt.Fprint(opts.Stdout, "Password: ") pass, err := passwd.Read(int(os.Stdin.Fd())) if err != nil { return "", "", fmt.Errorf("reading password: %w", err) } password = string(pass) fmt.Fprintln(opts.Stdout) } return strings.TrimSpace(username), password, err } // Logout implements a “log out” command with the provided opts and args. func Logout(systemContext *types.SystemContext, opts *LogoutOptions, args []string) error { if err := CheckAuthFile(opts.AuthFile); err != nil { return err } if err := CheckAuthFile(opts.DockerCompatAuthFile); err != nil { return err } systemContext, err := systemContextWithOptions(systemContext, opts.AuthFile, opts.DockerCompatAuthFile, "") if err != nil { return err } if opts.All { if len(args) != 0 { return errors.New("--all takes no arguments") } if err := config.RemoveAllAuthentication(systemContext); err != nil { return err } fmt.Fprintln(opts.Stdout, "Removed login credentials for all registries") return nil } var key, registry string switch len(args) { case 0: if !opts.AcceptUnspecifiedRegistry { return errors.New("please provide a registry to log out from") } if key, err = defaultRegistryWhenUnspecified(systemContext); err != nil { return err } registry = key logrus.Debugf("registry not specified, default to the first registry %q from registries.conf", key) case 1: key, registry, err = parseCredentialsKey(args[0], opts.AcceptRepositories) if err != nil { return err } default: return errors.New("logout accepts only one registry to log out from") } err = config.RemoveAuthentication(systemContext, key) if err == nil { fmt.Fprintf(opts.Stdout, "Removed login credentials for %s\n", key) return nil } if errors.Is(err, config.ErrNotLoggedIn) { authConfig, err := config.GetCredentials(systemContext, key) if err != nil { return fmt.Errorf("get credentials: %w", err) } authInvalid := docker.CheckAuth(context.Background(), systemContext, authConfig.Username, authConfig.Password, registry) if authConfig.Username != "" && authConfig.Password != "" && authInvalid == nil { fmt.Printf("Not logged into %s with current tool. Existing credentials were established via docker login. Please use docker logout instead.\n", key) //nolint:forbidigo return nil } return fmt.Errorf("not logged into %s", key) } return fmt.Errorf("logging out of %q: %w", key, err) } // defaultRegistryWhenUnspecified returns first registry from search list of registry.conf // used by login/logout when registry argument is not specified. func defaultRegistryWhenUnspecified(systemContext *types.SystemContext) (string, error) { registriesFromFile, err := sysregistriesv2.UnqualifiedSearchRegistries(systemContext) if err != nil { return "", fmt.Errorf("getting registry from registry.conf, please specify a registry: %w", err) } if len(registriesFromFile) == 0 { return "", errors.New("no registries found in registries.conf, a registry must be provided") } return registriesFromFile[0], nil } ================================================ FILE: vendor/go.podman.io/common/pkg/auth/cli.go ================================================ package auth import ( "io" "github.com/spf13/pflag" "go.podman.io/common/pkg/completion" ) // LoginOptions represents common flags in login // In addition, the caller should probably provide a --tls-verify flag (that affects the provided // *types.SystemContest). type LoginOptions struct { // CLI flags managed by the FlagSet returned by GetLoginFlags // Callers that use GetLoginFlags should not need to touch these values at all; callers that use // other CLI frameworks should set them based on user input. AuthFile string DockerCompatAuthFile string CertDir string Password string Username string StdinPassword bool GetLoginSet bool Verbose bool // set to true for verbose output AcceptRepositories bool // set to true to allow namespaces or repositories rather than just registries // Options caller can set Stdin io.Reader // set to os.Stdin Stdout io.Writer // set to os.Stdout AcceptUnspecifiedRegistry bool // set to true if allows login with unspecified registry NoWriteBack bool // set to true to not write the credentials to the authfile/cred helpers } // LogoutOptions represents the results for flags in logout. type LogoutOptions struct { // CLI flags managed by the FlagSet returned by GetLogoutFlags // Callers that use GetLogoutFlags should not need to touch these values at all; callers that use // other CLI frameworks should set them based on user input. AuthFile string DockerCompatAuthFile string All bool AcceptRepositories bool // set to true to allow namespaces or repositories rather than just registries // Options caller can set Stdout io.Writer // set to os.Stdout AcceptUnspecifiedRegistry bool // set to true if allows logout with unspecified registry } // GetLoginFlags defines and returns login flags for containers tools. func GetLoginFlags(flags *LoginOptions) *pflag.FlagSet { fs := pflag.FlagSet{} fs.StringVar(&flags.AuthFile, "authfile", "", "path of the authentication file. Use REGISTRY_AUTH_FILE environment variable to override") fs.StringVar(&flags.DockerCompatAuthFile, "compat-auth-file", "", "path of a Docker-compatible config file to update instead") fs.StringVar(&flags.CertDir, "cert-dir", "", "use certificates at the specified path to access the registry") fs.StringVarP(&flags.Password, "password", "p", "", "Password for registry") fs.StringVarP(&flags.Username, "username", "u", "", "Username for registry") fs.BoolVar(&flags.StdinPassword, "password-stdin", false, "Take the password from stdin") fs.BoolVar(&flags.GetLoginSet, "get-login", false, "Return the current login user for the registry") fs.BoolVarP(&flags.Verbose, "verbose", "v", false, "Write more detailed information to stdout") return &fs } // GetLoginFlagsCompletions returns the FlagCompletions for the login flags. func GetLoginFlagsCompletions() completion.FlagCompletions { flagCompletion := completion.FlagCompletions{} flagCompletion["authfile"] = completion.AutocompleteDefault flagCompletion["compat-auth-file"] = completion.AutocompleteDefault flagCompletion["cert-dir"] = completion.AutocompleteDefault flagCompletion["password"] = completion.AutocompleteNone flagCompletion["username"] = completion.AutocompleteNone return flagCompletion } // GetLogoutFlags defines and returns logout flags for containers tools. func GetLogoutFlags(flags *LogoutOptions) *pflag.FlagSet { fs := pflag.FlagSet{} fs.StringVar(&flags.AuthFile, "authfile", "", "path of the authentication file. Use REGISTRY_AUTH_FILE environment variable to override") fs.StringVar(&flags.DockerCompatAuthFile, "compat-auth-file", "", "path of a Docker-compatible config file to update instead") fs.BoolVarP(&flags.All, "all", "a", false, "Remove the cached credentials for all registries in the auth file") return &fs } // GetLogoutFlagsCompletions returns the FlagCompletions for the logout flags. func GetLogoutFlagsCompletions() completion.FlagCompletions { flagCompletion := completion.FlagCompletions{} flagCompletion["authfile"] = completion.AutocompleteDefault flagCompletion["compat-auth-file"] = completion.AutocompleteDefault return flagCompletion } ================================================ FILE: vendor/go.podman.io/common/pkg/capabilities/capabilities.go ================================================ package capabilities // Copyright 2013-2018 Docker, Inc. // NOTE: this package has been copied from github.com/docker/docker but been // changed significantly to fit the needs of libpod. import ( "errors" "fmt" "slices" "strings" "sync" "github.com/moby/sys/capability" ) var ( // ErrUnknownCapability is thrown when an unknown capability is processed. ErrUnknownCapability = errors.New("unknown capability") // ContainerImageLabels - label can indicate the required // capabilities required by containers to run the container image. ContainerImageLabels = []string{"io.containers.capabilities"} ) // All is a special value used to add/drop all known capabilities. // Useful on the CLI for `--cap-add=all` etc. const All = "ALL" func capName(c capability.Cap) string { return "CAP_" + strings.ToUpper(c.String()) } // capStrList returns all capabilities supported by the currently running kernel, // or an error if the list can not be obtained. var capStrList = sync.OnceValues(func() ([]string, error) { list, err := capability.ListSupported() if err != nil { return nil, err } caps := make([]string, len(list)) for i, c := range list { caps[i] = capName(c) } slices.Sort(caps) return caps, nil }) // BoundingSet returns the capabilities in the current bounding set. func BoundingSet() ([]string, error) { return boundingSet() } var boundingSet = sync.OnceValues(func() ([]string, error) { currentCaps, err := capability.NewPid2(0) if err != nil { return nil, err } err = currentCaps.Load() if err != nil { return nil, err } list, err := capability.ListSupported() if err != nil { return nil, err } var r []string for _, c := range list { if !currentCaps.Get(capability.BOUNDING, c) { continue } r = append(r, capName(c)) } slices.Sort(r) return r, nil }) // AllCapabilities returns all capabilities supported by the running kernel. func AllCapabilities() []string { list, _ := capStrList() return list } // NormalizeCapabilities normalizes caps by adding a "CAP_" prefix (if not yet // present). func NormalizeCapabilities(caps []string) ([]string, error) { all, err := capStrList() if err != nil { return nil, err } normalized := make([]string, 0, len(caps)) for _, c := range caps { c = strings.ToUpper(c) if c == All { normalized = append(normalized, c) continue } if !strings.HasPrefix(c, "CAP_") { c = "CAP_" + c } if !slices.Contains(all, c) { return nil, fmt.Errorf("%q: %w", c, ErrUnknownCapability) } normalized = append(normalized, c) } slices.Sort(normalized) return normalized, nil } // ValidateCapabilities validates if caps only contains valid capabilities. func ValidateCapabilities(caps []string) error { all, err := capStrList() if err != nil { return err } for _, c := range caps { if !slices.Contains(all, c) { return fmt.Errorf("%q: %w", c, ErrUnknownCapability) } } return nil } // MergeCapabilities computes a set of capabilities by adding capabilities // to or dropping them from base. // // Note that: // "ALL" in capAdd adds returns known capabilities // "All" in capDrop returns only the capabilities specified in capAdd. func MergeCapabilities(base, adds, drops []string) ([]string, error) { // Normalize the base capabilities base, err := NormalizeCapabilities(base) if err != nil { return nil, err } if len(adds) == 0 && len(drops) == 0 { // Nothing to tweak; we're done return base, nil } capDrop, err := NormalizeCapabilities(drops) if err != nil { return nil, err } capAdd, err := NormalizeCapabilities(adds) if err != nil { return nil, err } if slices.Contains(capDrop, All) { if slices.Contains(capAdd, All) { return nil, errors.New("adding all caps and removing all caps not allowed") } // "Drop" all capabilities; return what's in capAdd instead slices.Sort(capAdd) return capAdd, nil } if slices.Contains(capAdd, All) { base, err = BoundingSet() if err != nil { return nil, err } capAdd = []string{} } else { for _, add := range capAdd { if slices.Contains(capDrop, add) { return nil, fmt.Errorf("capability %q cannot be dropped and added", add) } } } for _, drop := range capDrop { if slices.Contains(capAdd, drop) { return nil, fmt.Errorf("capability %q cannot be dropped and added", drop) } } caps := make([]string, 0, len(base)+len(capAdd)) // Drop any capabilities in capDrop that are in base for _, cap := range base { if slices.Contains(capDrop, cap) { continue } caps = append(caps, cap) } // Add any capabilities in capAdd that are not in base for _, cap := range capAdd { if slices.Contains(base, cap) { continue } caps = append(caps, cap) } slices.Sort(caps) return caps, nil } ================================================ FILE: vendor/go.podman.io/common/pkg/completion/completion.go ================================================ package completion import ( "bufio" "os" "strings" "unicode" "github.com/spf13/cobra" "go.podman.io/common/pkg/capabilities" ) // FlagCompletions - hold flag completion functions to be applied later with CompleteCommandFlags(). type FlagCompletions map[string]func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) // CompleteCommandFlags - Add completion functions for each flagname in FlagCompletions. func CompleteCommandFlags(cmd *cobra.Command, flags FlagCompletions) { for flagName, completionFunc := range flags { _ = cmd.RegisterFlagCompletionFunc(flagName, completionFunc) } } /* Autocomplete Functions for cobra ValidArgsFunction */ // AutocompleteNone - Block the default shell completion (no paths). func AutocompleteNone(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) { return nil, cobra.ShellCompDirectiveNoFileComp } // AutocompleteDefault - Use the default shell completion, // allows path completion. func AutocompleteDefault(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) { return nil, cobra.ShellCompDirectiveDefault } // AutocompleteCapabilities - Autocomplete linux capabilities options. // Used by --cap-add and --cap-drop. func AutocompleteCapabilities(_ *cobra.Command, _ []string, toComplete string) ([]string, cobra.ShellCompDirective) { caps := capabilities.AllCapabilities() // convertCase will convert a string to lowercase only if the user input is lowercase convertCase := func(s string) string { return s } if len(toComplete) > 0 && unicode.IsLower(rune(toComplete[0])) { convertCase = strings.ToLower } // offset is used to trim "CAP_" if the user doesn't type CA... or ca... offset := 0 if !strings.HasPrefix(toComplete, convertCase("CA")) { // setting the offset to 4 is safe since each cap starts with CAP_ offset = 4 } completions := make([]string, 0, len(caps)) for _, cap := range caps { completions = append(completions, convertCase(cap)[offset:]) } // add ALL here which is also a valid argument completions = append(completions, convertCase(capabilities.All)) return completions, cobra.ShellCompDirectiveNoFileComp } // autocompleteSubIDName - autocomplete the names in /etc/subuid or /etc/subgid. func autocompleteSubIDName(filename string) ([]string, cobra.ShellCompDirective) { file, err := os.Open(filename) if err != nil { return nil, cobra.ShellCompDirectiveError } defer file.Close() var names []string scanner := bufio.NewScanner(file) for scanner.Scan() { name, _, _ := strings.Cut(scanner.Text(), ":") names = append(names, name) } if err = scanner.Err(); err != nil { return nil, cobra.ShellCompDirectiveError } return names, cobra.ShellCompDirectiveNoFileComp } // AutocompleteSubgidName - Autocomplete subgidname based on the names in the /etc/subgid file. func AutocompleteSubgidName(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) { return autocompleteSubIDName("/etc/subgid") } // AutocompleteSubuidName - Autocomplete subuidname based on the names in the /etc/subuid file. func AutocompleteSubuidName(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) { return autocompleteSubIDName("/etc/subuid") } // AutocompletePlatform - Autocomplete platform supported by container engines. func AutocompletePlatform(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) { completions := []string{ "linux/386", "linux/amd64", "linux/arm", "linux/arm64", "linux/ppc64", "linux/ppc64le", "linux/mips", "linux/mipsle", "linux/mips64", "linux/mips64le", "linux/riscv64", "linux/s390x", "windows/386", "windows/amd64", "windows/arm", } return completions, cobra.ShellCompDirectiveNoFileComp } // AutocompleteArch - Autocomplete architectures supported by container engines. func AutocompleteArch(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) { completions := []string{ "386", "amd64", "arm", "arm64", "ppc64", "ppc64le", "mips", "mipsle", "mips64", "mips64le", "riscv64", "s390x", } return completions, cobra.ShellCompDirectiveNoFileComp } // AutocompleteOS - Autocomplete OS supported by container engines. func AutocompleteOS(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) { completions := []string{"linux", "windows"} return completions, cobra.ShellCompDirectiveNoFileComp } // AutocompleteJSONFormat - Autocomplete format flag option. // -> "json". func AutocompleteJSONFormat(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) { return []string{"json"}, cobra.ShellCompDirectiveNoFileComp } // AutocompleteOneArg - Autocomplete one random arg. func AutocompleteOneArg(_ *cobra.Command, args []string, _ string) ([]string, cobra.ShellCompDirective) { if len(args) == 1 { return nil, cobra.ShellCompDirectiveDefault } return nil, cobra.ShellCompDirectiveNoFileComp } ================================================ FILE: vendor/go.podman.io/common/pkg/flag/flag.go ================================================ package flag import ( "strconv" "github.com/spf13/pflag" ) // OptionalBool is a boolean with a separate presence flag and value. type OptionalBool struct { present bool value bool } // Present returns the bool's presence flag. func (ob *OptionalBool) Present() bool { return ob.present } // Value returns the bool's value. Should only be used if Present() is true. func (ob *OptionalBool) Value() bool { return ob.value } // optionalBool is a cli.Generic == flag.Value implementation equivalent to // the one underlying flag.Bool, except that it records whether the flag has been set. // This is distinct from optionalBool to (pretend to) force callers to use // optionalBoolFlag. type optionalBoolValue OptionalBool // OptionalBoolFlag creates new flag for an optional in the specified flag with // the specified name and usage. func OptionalBoolFlag(fs *pflag.FlagSet, p *OptionalBool, name, usage string) *pflag.Flag { flag := fs.VarPF(internalNewOptionalBoolValue(p), name, "", usage) flag.NoOptDefVal = "true" flag.DefValue = "false" return flag } // WARNING: Do not directly use this method to define optionalBool flag. // Caller should use optionalBoolFlag. func internalNewOptionalBoolValue(p *OptionalBool) pflag.Value { p.present = false return (*optionalBoolValue)(p) } // Set parses the string to a bool and sets it. func (ob *optionalBoolValue) Set(s string) error { v, err := strconv.ParseBool(s) if err != nil { return err } ob.value = v ob.present = true return nil } // String returns the string representation of the string. func (ob *optionalBoolValue) String() string { if !ob.present { return "" // This is, sadly, not round-trip safe: --flag is interpreted as --flag=true } return strconv.FormatBool(ob.value) } // Type returns the type. func (ob *optionalBoolValue) Type() string { return "bool" } // IsBoolFlag indicates that it's a bool flag. func (ob *optionalBoolValue) IsBoolFlag() bool { return true } // OptionalString is a string with a separate presence flag. type OptionalString struct { present bool value string } // Present returns the strings's presence flag. func (os *OptionalString) Present() bool { return os.present } // Value returns the string's value. Should only be used if Present() is true. func (os *OptionalString) Value() string { return os.value } // optionalString is a cli.Generic == flag.Value implementation equivalent to // the one underlying flag.String, except that it records whether the flag has been set. // This is distinct from optionalString to (pretend to) force callers to use // newoptionalString. type optionalStringValue OptionalString // NewOptionalStringValue returns a pflag.Value for the string. func NewOptionalStringValue(p *OptionalString) pflag.Value { p.present = false return (*optionalStringValue)(p) } // Set sets the string. func (ob *optionalStringValue) Set(s string) error { ob.value = s ob.present = true return nil } // String returns the string if present. func (ob *optionalStringValue) String() string { if !ob.present { return "" // This is, sadly, not round-trip safe: --flag= is interpreted as {present:true, value:""} } return ob.value } // Type returns the string type. func (ob *optionalStringValue) Type() string { return "string" } // OptionalInt is a int with a separate presence flag. type OptionalInt struct { present bool value int } // Present returns the int's presence flag. func (oi *OptionalInt) Present() bool { return oi.present } // Value returns the int's value. Should only be used if Present() is true. func (oi *OptionalInt) Value() int { return oi.value } // optionalInt is a cli.Generic == flag.Value implementation equivalent to // the one underlying flag.Int, except that it records whether the flag has been set. // This is distinct from optionalInt to (pretend to) force callers to use // newoptionalIntValue. type optionalIntValue OptionalInt // NewOptionalIntValue returns the pflag.Value of the int. func NewOptionalIntValue(p *OptionalInt) pflag.Value { p.present = false return (*optionalIntValue)(p) } // Set parses the string to an int and sets it. func (ob *optionalIntValue) Set(s string) error { v, err := strconv.ParseInt(s, 0, strconv.IntSize) if err != nil { return err } ob.value = int(v) ob.present = true return nil } // String returns the string representation of the int. func (ob *optionalIntValue) String() string { if !ob.present { return "" // If the value is not present, just return an empty string, any other value wouldn't make sense. } return strconv.Itoa(ob.value) } // Type returns the int's type. func (ob *optionalIntValue) Type() string { return "int" } ================================================ FILE: vendor/go.podman.io/common/pkg/json-proxy/handler.go ================================================ package jsonproxy import ( "bytes" "context" "encoding/json" "errors" "fmt" "io" "os" "sync" "syscall" "github.com/opencontainers/go-digest" imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" "github.com/sirupsen/logrus" "go.podman.io/image/v5/image" "go.podman.io/image/v5/manifest" "go.podman.io/image/v5/pkg/blobinfocache" "go.podman.io/image/v5/signature" "go.podman.io/image/v5/transports/alltransports" "go.podman.io/image/v5/types" ) // handler is the core request processing logic. type handler struct { // lock protects everything else in this structure. lock sync.Mutex // Dependency injection functions. getSystemContext func() (*types.SystemContext, error) getPolicyContext func() (*signature.PolicyContext, error) logger logrus.FieldLogger // Internal state. sysctx *types.SystemContext cache types.BlobInfoCache imageSerial uint64 images map[uint64]*openImage activePipes map[uint32]*activePipe } // newHandler creates a new handler with the given dependencies. func newHandler(getSystemContext func() (*types.SystemContext, error), getPolicyContext func() (*signature.PolicyContext, error), logger logrus.FieldLogger) *handler { return &handler{ getSystemContext: getSystemContext, getPolicyContext: getPolicyContext, logger: logger, images: make(map[uint64]*openImage), activePipes: make(map[uint32]*activePipe), } } // close releases all resources associated with this handler. func (h *handler) close() { h.lock.Lock() defer h.lock.Unlock() for _, image := range h.images { if err := image.src.Close(); err != nil { // This shouldn't be fatal h.logger.Warnf("Failed to close image: %v", err) } } } // Initialize performs one-time initialization, and returns the protocol version. func (h *handler) Initialize(ctx context.Context, args []any) (replyBuf, error) { h.lock.Lock() defer h.lock.Unlock() var ret replyBuf if len(args) != 0 { return ret, errors.New("invalid request, expecting zero arguments") } if h.sysctx != nil { return ret, errors.New("already initialized") } sysctx, err := h.getSystemContext() if err != nil { return ret, err } h.sysctx = sysctx h.cache = blobinfocache.DefaultCache(sysctx) r := replyBuf{ value: protocolVersion, } return r, nil } // OpenImage accepts a string image reference i.e. TRANSPORT:REF - like `skopeo copy`. // The return value is an opaque integer handle. func (h *handler) OpenImage(ctx context.Context, args []any) (replyBuf, error) { return h.openImageImpl(ctx, args, false) } func (h *handler) openImageImpl(ctx context.Context, args []any, allowNotFound bool) (retReplyBuf replyBuf, retErr error) { h.lock.Lock() defer h.lock.Unlock() var ret replyBuf if h.sysctx == nil { return ret, errors.New("client error: must invoke Initialize") } if len(args) != 1 { return ret, errors.New("invalid request, expecting one argument") } imageref, ok := args[0].(string) if !ok { return ret, fmt.Errorf("expecting string imageref, not %T", args[0]) } imgRef, err := alltransports.ParseImageName(imageref) if err != nil { return ret, err } imgsrc, err := imgRef.NewImageSource(ctx, h.sysctx) if err != nil { if allowNotFound && isNotFoundImageError(err) { ret.value = sentinelImageID return ret, nil } return ret, err } policyContext, err := h.getPolicyContext() if err != nil { return ret, err } defer func() { if err := policyContext.Destroy(); err != nil { retErr = noteCloseFailure(retErr, "tearing down policy context", err) } }() unparsedTopLevel := image.UnparsedInstance(imgsrc, nil) allowed, err := policyContext.IsRunningImageAllowed(ctx, unparsedTopLevel) if err != nil { return ret, err } if !allowed { return ret, errors.New("internal inconsistency: policy verification failed without returning an error") } // Note that we never return zero as an imageid; this code doesn't yet // handle overflow though. h.imageSerial++ openimg := &openImage{ id: h.imageSerial, src: imgsrc, } h.images[openimg.id] = openimg ret.value = openimg.id return ret, nil } // OpenImageOptional accepts a string image reference i.e. TRANSPORT:REF - like `skopeo copy`. // The return value is an opaque integer handle. If the image does not exist, zero // is returned. func (h *handler) OpenImageOptional(ctx context.Context, args []any) (replyBuf, error) { return h.openImageImpl(ctx, args, true) } func (h *handler) CloseImage(ctx context.Context, args []any) (replyBuf, error) { h.lock.Lock() defer h.lock.Unlock() var ret replyBuf if h.sysctx == nil { return ret, errors.New("client error: must invoke Initialize") } if len(args) != 1 { return ret, errors.New("invalid request, expecting one argument") } imgref, err := h.parseImageFromID(args[0]) if err != nil { return ret, err } imgref.src.Close() delete(h.images, imgref.id) return ret, nil } // parseUint64 validates that a number fits inside a JavaScript safe integer. func parseUint64(v any) (uint64, error) { f, ok := v.(float64) if !ok { return 0, fmt.Errorf("expecting numeric, not %T", v) } if f > maxJSONFloat { return 0, fmt.Errorf("out of range integer for numeric %f", f) } return uint64(f), nil } func (h *handler) parseImageFromID(v any) (*openImage, error) { imgid, err := parseUint64(v) if err != nil { return nil, err } if imgid == sentinelImageID { return nil, errors.New("invalid imageid value of zero") } imgref, ok := h.images[imgid] if !ok { return nil, fmt.Errorf("no image %v", imgid) } return imgref, nil } func (h *handler) allocPipe() (*os.File, *activePipe, error) { piper, pipew, err := os.Pipe() if err != nil { return nil, nil, err } f := activePipe{ w: pipew, } h.activePipes[uint32(pipew.Fd())] = &f f.wg.Add(1) return piper, &f, nil } // returnBytes generates a return pipe() from a byte array. // In the future it might be nicer to return this via memfd_create(). func (h *handler) returnBytes(retval any, buf []byte) (replyBuf, error) { var ret replyBuf piper, f, err := h.allocPipe() if err != nil { return ret, err } go func() { // Signal completion when we return defer f.wg.Done() _, err = io.Copy(f.w, bytes.NewReader(buf)) if err != nil { f.err = err } }() ret.value = retval ret.fd = piper ret.pipeid = uint32(f.w.Fd()) return ret, nil } // cacheTargetManifest is invoked when GetManifest or GetConfig is invoked // the first time for a given image. If the requested image is a manifest // list, this function resolves it to the image matching the calling process' // operating system and architecture. // // TODO: Add GetRawManifest or so that exposes manifest lists. func (h *handler) cacheTargetManifest(ctx context.Context, img *openImage) error { if img.cachedimg != nil { return nil } unparsedToplevel := image.UnparsedInstance(img.src, nil) mfest, manifestType, err := unparsedToplevel.Manifest(ctx) if err != nil { return err } var target *image.UnparsedImage if manifest.MIMETypeIsMultiImage(manifestType) { manifestList, err := manifest.ListFromBlob(mfest, manifestType) if err != nil { return err } instanceDigest, err := manifestList.ChooseInstance(h.sysctx) if err != nil { return err } target = image.UnparsedInstance(img.src, &instanceDigest) } else { target = unparsedToplevel } cachedimg, err := image.FromUnparsedImage(ctx, h.sysctx, target) if err != nil { return err } img.cachedimg = cachedimg return nil } // GetManifest returns a copy of the manifest, converted to OCI format, along with the original digest. // Manifest lists are resolved to the current operating system and architecture. func (h *handler) GetManifest(ctx context.Context, args []any) (replyBuf, error) { h.lock.Lock() defer h.lock.Unlock() var ret replyBuf if h.sysctx == nil { return ret, errors.New("client error: must invoke Initialize") } if len(args) != 1 { return ret, errors.New("invalid request, expecting one argument") } imgref, err := h.parseImageFromID(args[0]) if err != nil { return ret, err } err = h.cacheTargetManifest(ctx, imgref) if err != nil { return ret, err } img := imgref.cachedimg rawManifest, manifestType, err := img.Manifest(ctx) if err != nil { return ret, err } // We only support OCI and docker2schema2. We know docker2schema2 can be easily+cheaply // converted into OCI, so consumers only need to see OCI. switch manifestType { case imgspecv1.MediaTypeImageManifest, manifest.DockerV2Schema2MediaType: break // Explicitly reject e.g. docker schema 1 type with a "legacy" note case manifest.DockerV2Schema1MediaType, manifest.DockerV2Schema1SignedMediaType: return ret, fmt.Errorf("unsupported legacy manifest MIME type: %s", manifestType) default: return ret, fmt.Errorf("unsupported manifest MIME type: %s", manifestType) } // We always return the original digest, as that's what clients need to do pull-by-digest // and in general identify the image. digest, err := manifest.Digest(rawManifest) if err != nil { return ret, err } var serialized []byte // But, we convert to OCI format on the wire if it's not already. The idea here is that by reusing the containers/image // stack, clients to this proxy can pretend the world is OCI only, and not need to care about e.g. // docker schema and MIME types. if manifestType != imgspecv1.MediaTypeImageManifest { manifestUpdates := types.ManifestUpdateOptions{ManifestMIMEType: imgspecv1.MediaTypeImageManifest} ociImage, err := img.UpdatedImage(ctx, manifestUpdates) if err != nil { return ret, err } ociSerialized, _, err := ociImage.Manifest(ctx) if err != nil { return ret, err } serialized = ociSerialized } else { serialized = rawManifest } return h.returnBytes(digest, serialized) } // GetFullConfig returns a copy of the image configuration, converted to OCI format. // https://github.com/opencontainers/image-spec/blob/main/config.md func (h *handler) GetFullConfig(ctx context.Context, args []any) (replyBuf, error) { h.lock.Lock() defer h.lock.Unlock() var ret replyBuf if h.sysctx == nil { return ret, errors.New("client error: must invoke Initialize") } if len(args) != 1 { return ret, errors.New("invalid request, expecting: [imgid]") } imgref, err := h.parseImageFromID(args[0]) if err != nil { return ret, err } err = h.cacheTargetManifest(ctx, imgref) if err != nil { return ret, err } img := imgref.cachedimg config, err := img.OCIConfig(ctx) if err != nil { return ret, err } serialized, err := json.Marshal(&config) if err != nil { return ret, err } return h.returnBytes(nil, serialized) } // GetConfig returns a copy of the container runtime configuration, converted to OCI format. // Note that due to a historical mistake, this returns not the full image configuration, // but just the container runtime configuration. You should use GetFullConfig instead. func (h *handler) GetConfig(ctx context.Context, args []any) (replyBuf, error) { h.lock.Lock() defer h.lock.Unlock() var ret replyBuf if h.sysctx == nil { return ret, errors.New("client error: must invoke Initialize") } if len(args) != 1 { return ret, errors.New("invalid request, expecting: [imgid]") } imgref, err := h.parseImageFromID(args[0]) if err != nil { return ret, err } err = h.cacheTargetManifest(ctx, imgref) if err != nil { return ret, err } img := imgref.cachedimg config, err := img.OCIConfig(ctx) if err != nil { return ret, err } serialized, err := json.Marshal(&config.Config) if err != nil { return ret, err } return h.returnBytes(nil, serialized) } // GetBlob fetches a blob, performing digest verification. func (h *handler) GetBlob(ctx context.Context, args []any) (replyBuf, error) { h.lock.Lock() defer h.lock.Unlock() var ret replyBuf if h.sysctx == nil { return ret, errors.New("client error: must invoke Initialize") } if len(args) != 3 { return ret, fmt.Errorf("found %d args, expecting (imgid, digest, size)", len(args)) } imgref, err := h.parseImageFromID(args[0]) if err != nil { return ret, err } digestStr, ok := args[1].(string) if !ok { return ret, errors.New("expecting string blobid") } size, err := parseUint64(args[2]) if err != nil { return ret, err } d, err := digest.Parse(digestStr) if err != nil { return ret, err } blobr, blobSize, err := imgref.src.GetBlob(ctx, types.BlobInfo{Digest: d, Size: int64(size)}, h.cache) if err != nil { return ret, err } piper, f, err := h.allocPipe() if err != nil { blobr.Close() return ret, err } go func() { // Signal completion when we return defer blobr.Close() defer f.wg.Done() verifier := d.Verifier() tr := io.TeeReader(blobr, verifier) n, err := io.Copy(f.w, tr) if err != nil { f.err = err return } if n != int64(size) { f.err = fmt.Errorf("expected %d bytes in blob, got %d", size, n) } if !verifier.Verified() { f.err = fmt.Errorf("corrupted blob, expecting %s", d.String()) } }() ret.value = blobSize ret.fd = piper ret.pipeid = uint32(f.w.Fd()) return ret, nil } // GetRawBlob can be viewed as a more general purpose successor // to GetBlob. First, it does not verify the digest, which in // some cases is unnecessary as the client would prefer to do it. // // It also does not use the "FinishPipe" API call, but instead // returns *two* file descriptors, one for errors and one for data. // // On (initial) success, the return value provided to the client is the size of the blob. func (h *handler) GetRawBlob(ctx context.Context, args []any) (replyBuf, error) { h.lock.Lock() defer h.lock.Unlock() var ret replyBuf if h.sysctx == nil { return ret, errors.New("client error: must invoke Initialize") } if len(args) != 2 { return ret, fmt.Errorf("found %d args, expecting (imgid, digest)", len(args)) } imgref, err := h.parseImageFromID(args[0]) if err != nil { return ret, err } digestStr, ok := args[1].(string) if !ok { return ret, errors.New("expecting string blobid") } d, err := digest.Parse(digestStr) if err != nil { return ret, err } blobr, blobSize, err := imgref.src.GetBlob(ctx, types.BlobInfo{Digest: d, Size: int64(-1)}, h.cache) if err != nil { return ret, err } // Note this doesn't call allocPipe; we're not using the FinishPipe infrastructure. piper, pipew, err := os.Pipe() if err != nil { blobr.Close() return ret, err } errpipeR, errpipeW, err := os.Pipe() if err != nil { piper.Close() pipew.Close() blobr.Close() return ret, err } // Asynchronous worker doing a copy go func() { // We own the read from registry, and write pipe objects defer blobr.Close() defer pipew.Close() defer errpipeW.Close() h.logger.Debugf("Copying blob to client: %d bytes", blobSize) _, err := io.Copy(pipew, blobr) // Handle errors here by serializing a JSON error back over // the error channel. In either case, both file descriptors // will be closed, signaling the completion of the operation. if err != nil { h.logger.Debugf("Sending error to client: %v", err) serializedErr := newProxyError(err) buf, marshalErr := json.Marshal(serializedErr) if marshalErr != nil { h.logger.Errorf("Failed to marshal error: %v", marshalErr) return } _, writeErr := errpipeW.Write(buf) if writeErr != nil && !errors.Is(writeErr, syscall.EPIPE) { h.logger.Debugf("Writing to client: %v", writeErr) } } h.logger.Debugf("Completed GetRawBlob operation") }() ret.value = blobSize ret.fd = piper ret.errfd = errpipeR return ret, nil } // GetLayerInfo returns data about the layers of an image, useful for reading the layer contents. // // This is the same as GetLayerInfoPiped, but returns its contents inline. This is subject to // failure for large images (because we use SOCK_SEQPACKET which has a maximum buffer size) // and is hence only retained for backwards compatibility. Callers are expected to use // the semver to know whether they can call the new API. func (h *handler) GetLayerInfo(ctx context.Context, args []any) (replyBuf, error) { h.lock.Lock() defer h.lock.Unlock() var ret replyBuf if h.sysctx == nil { return ret, errors.New("client error: must invoke Initialize") } if len(args) != 1 { return ret, fmt.Errorf("found %d args, expecting (imgid)", len(args)) } imgref, err := h.parseImageFromID(args[0]) if err != nil { return ret, err } err = h.cacheTargetManifest(ctx, imgref) if err != nil { return ret, err } img := imgref.cachedimg layerInfos, err := img.LayerInfosForCopy(ctx) if err != nil { return ret, err } if layerInfos == nil { layerInfos = img.LayerInfos() } layers := make([]convertedLayerInfo, 0, len(layerInfos)) for _, layer := range layerInfos { layers = append(layers, convertedLayerInfo{layer.Digest, layer.Size, layer.MediaType}) } ret.value = layers return ret, nil } // GetLayerInfoPiped returns data about the layers of an image, useful for reading the layer contents. // // This needs to be called since the data returned by GetManifest() does not allow to correctly // calling GetBlob() for the containers-storage: transport (which doesn't store the original compressed // representations referenced in the manifest). func (h *handler) GetLayerInfoPiped(ctx context.Context, args []any) (replyBuf, error) { h.lock.Lock() defer h.lock.Unlock() var ret replyBuf if h.sysctx == nil { return ret, errors.New("client error: must invoke Initialize") } if len(args) != 1 { return ret, fmt.Errorf("found %d args, expecting (imgid)", len(args)) } imgref, err := h.parseImageFromID(args[0]) if err != nil { return ret, err } err = h.cacheTargetManifest(ctx, imgref) if err != nil { return ret, err } img := imgref.cachedimg layerInfos, err := img.LayerInfosForCopy(ctx) if err != nil { return ret, err } if layerInfos == nil { layerInfos = img.LayerInfos() } layers := make([]convertedLayerInfo, 0, len(layerInfos)) for _, layer := range layerInfos { layers = append(layers, convertedLayerInfo{layer.Digest, layer.Size, layer.MediaType}) } serialized, err := json.Marshal(&layers) if err != nil { return ret, err } return h.returnBytes(nil, serialized) } // FinishPipe waits for the worker goroutine to finish, and closes the write side of the pipe. func (h *handler) FinishPipe(ctx context.Context, args []any) (replyBuf, error) { h.lock.Lock() defer h.lock.Unlock() var ret replyBuf pipeidv, err := parseUint64(args[0]) if err != nil { return ret, err } pipeid := uint32(pipeidv) f, ok := h.activePipes[pipeid] if !ok { return ret, fmt.Errorf("finishpipe: no active pipe %d", pipeid) } // Wait for the goroutine to complete f.wg.Wait() h.logger.Debug("Completed pipe goroutine") // And only now do we close the write half; this forces the client to call this API f.w.Close() // Propagate any errors from the goroutine worker err = f.err delete(h.activePipes, pipeid) return ret, err } // processRequest dispatches a remote request. // replyBuf is the result of the invocation. // terminate should be true if processing of requests should halt. func (h *handler) processRequest(ctx context.Context, readBytes []byte) (rb replyBuf, terminate bool, err error) { var req request // Parse the request JSON if err = json.Unmarshal(readBytes, &req); err != nil { err = fmt.Errorf("invalid request: %v", err) return } h.logger.Debugf("Executing method %s", req.Method) // Dispatch on the method switch req.Method { case "Initialize": rb, err = h.Initialize(ctx, req.Args) case "OpenImage": rb, err = h.OpenImage(ctx, req.Args) case "OpenImageOptional": rb, err = h.OpenImageOptional(ctx, req.Args) case "CloseImage": rb, err = h.CloseImage(ctx, req.Args) case "GetManifest": rb, err = h.GetManifest(ctx, req.Args) case "GetConfig": rb, err = h.GetConfig(ctx, req.Args) case "GetFullConfig": rb, err = h.GetFullConfig(ctx, req.Args) case "GetBlob": rb, err = h.GetBlob(ctx, req.Args) case "GetRawBlob": rb, err = h.GetRawBlob(ctx, req.Args) case "GetLayerInfo": rb, err = h.GetLayerInfo(ctx, req.Args) case "GetLayerInfoPiped": rb, err = h.GetLayerInfoPiped(ctx, req.Args) case "FinishPipe": rb, err = h.FinishPipe(ctx, req.Args) case "Shutdown": terminate = true // NOTE: If you add a method here, you should very likely be bumping the // const protocolVersion above. default: err = fmt.Errorf("unknown method: %s", req.Method) } return } ================================================ FILE: vendor/go.podman.io/common/pkg/json-proxy/proxy.go ================================================ // EXPERIMENTAL: This package is experimental and subject to breaking changes. // The APIs may change in incompatible ways without notice. Use with caution // in production environments. package jsonproxy import ( "github.com/sirupsen/logrus" "go.podman.io/image/v5/signature" "go.podman.io/image/v5/types" ) // options holds the internal configuration for a Manager. type options struct { getSystemContext func() (*types.SystemContext, error) getPolicyContext func() (*signature.PolicyContext, error) logger logrus.FieldLogger } // Option configures a Manager. Use the With* functions to create Options. // // EXPERIMENTAL: This type is experimental and subject to breaking changes. type Option func(*options) // WithSystemContext sets the function used to obtain a SystemContext for image operations. // // EXPERIMENTAL: This function is experimental and subject to breaking changes. func WithSystemContext(fn func() (*types.SystemContext, error)) Option { return func(o *options) { o.getSystemContext = fn } } // WithPolicyContext sets the function used to obtain a PolicyContext for signature verification. // // EXPERIMENTAL: This function is experimental and subject to breaking changes. func WithPolicyContext(fn func() (*signature.PolicyContext, error)) Option { return func(o *options) { o.getPolicyContext = fn } } // WithLogger sets the logger for the Manager. If not provided, the logrus // standard logger is used. // // EXPERIMENTAL: This function is experimental and subject to breaking changes. func WithLogger(logger logrus.FieldLogger) Option { return func(o *options) { o.logger = logger } } ================================================ FILE: vendor/go.podman.io/common/pkg/json-proxy/proxy_unix.go ================================================ //go:build !windows package jsonproxy import ( "context" "errors" "fmt" "io" "net" "os" "github.com/sirupsen/logrus" ) // manager is the proxy server for managing JSON-RPC proxy operations. // Use NewManager to create one. type manager struct { handler *handler logger logrus.FieldLogger } // NewManager creates a new proxy manager with the given options. // WithSystemContext and WithPolicyContext are required. // // EXPERIMENTAL: This function is experimental and subject to breaking changes. func NewManager(opts ...Option) (*manager, error) { o := &options{} for _, opt := range opts { opt(o) } if o.getSystemContext == nil { return nil, errors.New("WithSystemContext is required") } if o.getPolicyContext == nil { return nil, errors.New("WithPolicyContext is required") } if o.logger == nil { o.logger = logrus.StandardLogger() } handler := newHandler(o.getSystemContext, o.getPolicyContext, o.logger) return &manager{ handler: handler, logger: o.logger, }, nil } // Serve runs the proxy server, reading requests from the given socket file descriptor. func (m *manager) Serve(ctx context.Context, sockfd int) error { defer m.handler.close() // Convert the socket FD passed by client into a net.FileConn fd := os.NewFile(uintptr(sockfd), "sock") fconn, err := net.FileConn(fd) if err != nil { return err } conn, ok := fconn.(*net.UnixConn) if !ok { return fmt.Errorf("expected unix connection, got %T", fconn) } // Allocate a buffer to copy the packet into buf := make([]byte, maxMsgSize) for { select { case <-ctx.Done(): return ctx.Err() default: } n, _, err := conn.ReadFrom(buf) if err != nil { if errors.Is(err, io.EOF) { return nil } return fmt.Errorf("reading socket: %v", err) } readbuf := buf[0:n] rb, terminate, err := m.handler.processRequest(ctx, readbuf) if terminate { m.logger.Debug("terminating") return nil } if err := rb.send(conn, err); err != nil { return fmt.Errorf("writing to socket: %w", err) } } } // Close releases all resources associated with this manager. func (m *manager) Close() error { m.handler.close() return nil } ================================================ FILE: vendor/go.podman.io/common/pkg/json-proxy/types.go ================================================ package jsonproxy import ( "errors" "fmt" "os" "sync" "syscall" "github.com/opencontainers/go-digest" "go.podman.io/common/pkg/retry" "go.podman.io/image/v5/types" ) // protocolVersion is semantic version of the protocol used by this proxy. // The first version of the protocol has major version 0.2 to signify a // departure from the original code which used HTTP. // // When bumping this, please also update the man page. const protocolVersion = "0.2.8" // maxMsgSize is the current limit on a packet size. // Note that all non-metadata (i.e. payload data) is sent over a pipe. const maxMsgSize = 32 * 1024 // maxJSONFloat is ECMA Number.MAX_SAFE_INTEGER // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER // We hard error if the input JSON numbers we expect to be // integers are above this. const maxJSONFloat = float64(uint64(1)<<53 - 1) // sentinelImageID represents "image not found" on the wire. const sentinelImageID = 0 // request is the JSON serialization of a function call. type request struct { // Method is the name of the function. Method string `json:"method"` // Args is the arguments (parsed inside the function). Args []any `json:"args"` } type proxyErrorCode string const ( // proxyErrPipe means we got EPIPE writing to a pipe owned by the client. proxyErrPipe proxyErrorCode = "EPIPE" // proxyErrRetryable can be used by clients to automatically retry operations. proxyErrRetryable proxyErrorCode = "retryable" // proxyErrOther represents all other errors. proxyErrOther proxyErrorCode = "other" ) // proxyError is serialized over the errfd channel for GetRawBlob. type proxyError struct { Code proxyErrorCode `json:"code"` Message string `json:"message"` } // reply is serialized to JSON as the return value from a function call. type reply struct { // Success is true if and only if the call succeeded. Success bool `json:"success"` // Value is an arbitrary value (or values, as array/map) returned from the call. Value any `json:"value"` // PipeID is an index into open pipes, and should be passed to FinishPipe. PipeID uint32 `json:"pipeid"` // ErrorCode will be non-empty if error is set (new in 0.2.8). ErrorCode proxyErrorCode `json:"error_code"` // Error should be non-empty if Success == false. Error string `json:"error"` } // replyBuf is our internal deserialization of reply plus optional fd. type replyBuf struct { // value will be converted to a reply Value. value any // fd is the read half of a pipe, passed back to the client for additional data. fd *os.File // errfd will be a serialization of error state. This is optional and is currently // only used by GetRawBlob. errfd *os.File // pipeid will be provided to the client as PipeID, an index into our open pipes. pipeid uint32 } // activePipe is an open pipe to the client // that contains an error value. type activePipe struct { // w is the write half of the pipe. w *os.File // wg is completed when our worker goroutine is done. wg sync.WaitGroup // err may be set in our worker goroutine. err error } // openImage is an opened image reference. type openImage struct { // id is an opaque integer handle. id uint64 src types.ImageSource cachedimg types.Image } // convertedLayerInfo is the reduced form of the OCI type BlobInfo // used in the return value of GetLayerInfo. type convertedLayerInfo struct { Digest digest.Digest `json:"digest"` Size int64 `json:"size"` MediaType string `json:"media_type"` } // mapProxyErrorCode turns an error into a known string value. func mapProxyErrorCode(err error) proxyErrorCode { switch { case err == nil: return "" case errors.Is(err, syscall.EPIPE): return proxyErrPipe case retry.IsErrorRetryable(err): return proxyErrRetryable default: return proxyErrOther } } // newProxyError creates a serializable structure for // the client containing a mapped error code based // on the error type, plus its value as a string. func newProxyError(err error) proxyError { return proxyError{ Code: mapProxyErrorCode(err), Message: fmt.Sprintf("%v", err), } } ================================================ FILE: vendor/go.podman.io/common/pkg/json-proxy/types_unix.go ================================================ //go:build unix package jsonproxy import ( "encoding/json" "io" "net" "syscall" "github.com/sirupsen/logrus" ) // send writes a reply buffer to the socket. func (buf replyBuf) send(conn *net.UnixConn, err error) error { logrus.Debugf("Sending reply: err=%v value=%v pipeid=%v datafd=%v errfd=%v", err, buf.value, buf.pipeid, buf.fd, buf.errfd) // We took ownership of these FDs, so close when we're done sending them or on error defer func() { if buf.fd != nil { buf.fd.Close() } if buf.errfd != nil { buf.errfd.Close() } }() replyToSerialize := reply{ Success: err == nil, Value: buf.value, PipeID: buf.pipeid, } if err != nil { replyToSerialize.ErrorCode = mapProxyErrorCode(err) replyToSerialize.Error = err.Error() } serializedReply, err := json.Marshal(&replyToSerialize) if err != nil { return err } // Copy the FD number(s) to the socket ancillary buffer fds := make([]int, 0) if buf.fd != nil { fds = append(fds, int(buf.fd.Fd())) } if buf.errfd != nil { fds = append(fds, int(buf.errfd.Fd())) } oob := syscall.UnixRights(fds...) n, oobn, err := conn.WriteMsgUnix(serializedReply, oob, nil) if err != nil { return err } // Validate that we sent the full packet if n != len(serializedReply) || oobn != len(oob) { return io.ErrShortWrite } return nil } ================================================ FILE: vendor/go.podman.io/common/pkg/json-proxy/utils.go ================================================ package jsonproxy import ( "errors" "fmt" dockerdistributionerrcode "github.com/docker/distribution/registry/api/errcode" dockerdistributionapi "github.com/docker/distribution/registry/api/v2" ociarchive "go.podman.io/image/v5/oci/archive" ocilayout "go.podman.io/image/v5/oci/layout" "go.podman.io/image/v5/storage" ) // noteCloseFailure helps with handling close errors in defer statements. func noteCloseFailure(err error, description string, closeErr error) error { // We don't accept a Closer() and close it ourselves because signature.PolicyContext has .Destroy(), not .Close(). // This also makes it harder for a caller to do // defer noteCloseFailure(returnedErr, …) // which doesn't use the right value of returnedErr, and doesn't update it. if err == nil { return fmt.Errorf("%s: %w", description, closeErr) } // In this case we prioritize the primary error for use with %w; closeErr is usually less relevant, or might be a consequence of the primary error. return fmt.Errorf("%w (%s: %v)", err, description, closeErr) } // isNotFoundImageError checks if an error indicates that an image was not found. func isNotFoundImageError(err error) bool { var layoutImageNotFoundError ocilayout.ImageNotFoundError var archiveImageNotFoundError ociarchive.ImageNotFoundError return isDockerManifestUnknownError(err) || errors.Is(err, storage.ErrNoSuchImage) || errors.As(err, &layoutImageNotFoundError) || errors.As(err, &archiveImageNotFoundError) } // isDockerManifestUnknownError checks if an error is a Docker manifest unknown error. func isDockerManifestUnknownError(err error) bool { var ec dockerdistributionerrcode.ErrorCoder if !errors.As(err, &ec) { return false } return ec.ErrorCode() == dockerdistributionapi.ErrorCodeManifestUnknown } ================================================ FILE: vendor/go.podman.io/common/pkg/password/password_supported.go ================================================ //go:build linux || darwin || freebsd || netbsd package password import ( "errors" "os" "os/signal" "syscall" terminal "golang.org/x/term" ) var ErrInterrupt = errors.New("interrupted") // Read reads a password from the terminal without echo. func Read(fd int) ([]byte, error) { // Store and restore the terminal status on interruptions to // avoid that the terminal remains in the password state // This is necessary as for https://github.com/golang/go/issues/31180 oldState, err := terminal.GetState(fd) if err != nil { return make([]byte, 0), err } type Buffer struct { Buffer []byte Error error } errorChannel := make(chan Buffer, 1) // SIGINT and SIGTERM restore the terminal, otherwise the no-echo mode would remain intact interruptChannel := make(chan os.Signal, 1) signal.Notify(interruptChannel, syscall.SIGINT, syscall.SIGTERM) defer func() { signal.Stop(interruptChannel) close(interruptChannel) }() go func() { for range interruptChannel { if oldState != nil { _ = terminal.Restore(fd, oldState) } errorChannel <- Buffer{Buffer: make([]byte, 0), Error: ErrInterrupt} } }() go func() { buf, err := terminal.ReadPassword(fd) errorChannel <- Buffer{Buffer: buf, Error: err} }() buf := <-errorChannel return buf.Buffer, buf.Error } ================================================ FILE: vendor/go.podman.io/common/pkg/password/password_windows.go ================================================ //go:build windows package password import ( terminal "golang.org/x/term" ) // Read reads a password from the terminal. func Read(fd int) ([]byte, error) { oldState, err := terminal.GetState(fd) if err != nil { return make([]byte, 0), err } buf, err := terminal.ReadPassword(fd) if oldState != nil { _ = terminal.Restore(fd, oldState) } return buf, err } ================================================ FILE: vendor/go.podman.io/common/pkg/report/camelcase/LICENSE.md ================================================ The MIT License (MIT) Copyright (c) 2015 Fatih Arslan Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: vendor/go.podman.io/common/pkg/report/camelcase/README.md ================================================ # CamelCase [![GoDoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](http://godoc.org/github.com/fatih/camelcase) [![Build Status](http://img.shields.io/travis/fatih/camelcase.svg?style=flat-square)](https://travis-ci.org/fatih/camelcase) CamelCase is a Golang (Go) package to split the words of a camelcase type string into a slice of words. It can be used to convert a camelcase word (lower or upper case) into any type of word. ## Splitting rules: 1. If string is not valid UTF-8, return it without splitting as single item array. 2. Assign all unicode characters into one of 4 sets: lower case letters, upper case letters, numbers, and all other characters. 3. Iterate through characters of string, introducing splits between adjacent characters that belong to different sets. 4. Iterate through array of split strings, and if a given string is upper case: * if subsequent string is lower case: * move last character of upper case string to beginning of lower case string ## Install ```bash go get github.com/fatih/camelcase ``` ## Usage and examples ```go split := camelcase.Split("GolangPackage") fmt.Println(split[0], split[1]) // prints: "Golang", "Package" ``` Both lower camel case and upper camel case are supported. For more info please check: [http://en.wikipedia.org/wiki/CamelCase](http://en.wikipedia.org/wiki/CamelCase) Below are some example cases: ``` "" => [] "lowercase" => ["lowercase"] "Class" => ["Class"] "MyClass" => ["My", "Class"] "MyC" => ["My", "C"] "HTML" => ["HTML"] "PDFLoader" => ["PDF", "Loader"] "AString" => ["A", "String"] "SimpleXMLParser" => ["Simple", "XML", "Parser"] "vimRPCPlugin" => ["vim", "RPC", "Plugin"] "GL11Version" => ["GL", "11", "Version"] "99Bottles" => ["99", "Bottles"] "May5" => ["May", "5"] "BFG9000" => ["BFG", "9000"] "BöseÜberraschung" => ["Böse", "Überraschung"] "Two spaces" => ["Two", " ", "spaces"] "BadUTF8\xe2\xe2\xa1" => ["BadUTF8\xe2\xe2\xa1"] ``` ================================================ FILE: vendor/go.podman.io/common/pkg/report/camelcase/camelcase.go ================================================ // Package camelcase is a micro package to split the words of a camelcase type // string into a slice of words. package camelcase import ( "unicode" "unicode/utf8" ) // Split splits the camelcase word and returns a list of words. It also // supports digits. Both lower camel case and upper camel case are supported. // For more info please check: http://en.wikipedia.org/wiki/CamelCase // // Examples // // "" => [""] // "lowercase" => ["lowercase"] // "Class" => ["Class"] // "MyClass" => ["My", "Class"] // "MyC" => ["My", "C"] // "HTML" => ["HTML"] // "PDFLoader" => ["PDF", "Loader"] // "AString" => ["A", "String"] // "SimpleXMLParser" => ["Simple", "XML", "Parser"] // "vimRPCPlugin" => ["vim", "RPC", "Plugin"] // "GL11Version" => ["GL", "11", "Version"] // "99Bottles" => ["99", "Bottles"] // "May5" => ["May", "5"] // "BFG9000" => ["BFG", "9000"] // "BöseÜberraschung" => ["Böse", "Überraschung"] // "Two spaces" => ["Two", " ", "spaces"] // "BadUTF8\xe2\xe2\xa1" => ["BadUTF8\xe2\xe2\xa1"] // // Splitting rules // // 1. If string is not valid UTF-8, return it without splitting as // single item array. // 2. Assign all unicode characters into one of 4 sets: lower case // letters, upper case letters, numbers, and all other characters. // 3. Iterate through characters of string, introducing splits // between adjacent characters that belong to different sets. // 4. Iterate through array of split strings, and if a given string // is upper case: // if subsequent string is lower case: // move last character of upper case string to beginning of // lower case string func Split(src string) (entries []string) { // don't split invalid utf8 if !utf8.ValidString(src) { return []string{src} } entries = []string{} var runes [][]rune var class, lastClass int // split into fields based on class of unicode character for _, r := range src { switch { case unicode.IsLower(r): class = 1 case unicode.IsUpper(r): class = 2 case unicode.IsDigit(r): class = 3 default: class = 4 } if class == lastClass { runes[len(runes)-1] = append(runes[len(runes)-1], r) } else { runes = append(runes, []rune{r}) } lastClass = class } // handle upper case -> lower case sequences, e.g. // "PDFL", "oader" -> "PDF", "Loader" for i := range len(runes) - 1 { if unicode.IsUpper(runes[i][0]) && unicode.IsLower(runes[i+1][0]) { runes[i+1] = append([]rune{runes[i][len(runes[i])-1]}, runes[i+1]...) runes[i] = runes[i][:len(runes[i])-1] } } // construct []string from results for _, s := range runes { if len(s) > 0 { entries = append(entries, string(s)) } } return entries } ================================================ FILE: vendor/go.podman.io/common/pkg/report/doc.go ================================================ /* Package report provides helper structs/methods/funcs for formatting output # Examples To format output for an array of structs: ExamplePodman: headers := report.Headers(struct { ID string }{}, nil) f := report.New(os.Stdout, "Command Name") f, _ := f.Parse(report.OriginPodman, "{{range .}}{{.ID}}{{end}}") defer f.Flush() if f.RenderHeaders { f.Execute(headers) } f.Execute( map[string]string{ "ID":"fa85da03b40141899f3af3de6d27852b", }) // Output: // ID // fa85da03b40141899f3af3de6d27852b ExampleUser: headers := report.Headers(struct { CID string }{}, map[string]string{"CID":"ID"}) f, _ := report.New(os.Stdout, "Command Name").Parse(report.OriginUser, "table {{.CID}}") defer f.Flush() if f.RenderHeaders { t.Execute(t, headers) } t.Execute(t,map[string]string{ "CID":"fa85da03b40141899f3af3de6d27852b", }) // Output: // ID // fa85da03b40141899f3af3de6d27852b Helpers: if report.IsJSON(cmd.Flag("format").Value.String()) { ... process JSON and output } if report.HasTable(cmd.Flag("format").Value.String()) { ... "table" keyword prefix in format text } # Template Functions The following template functions are added to the template when parsed: - join strings.Join, {{join .Field separator}} - json encode field as JSON {{ json .Field }} - lower strings.ToLower {{ .Field | lower }} - pad add spaces as prefix and suffix {{ pad . 2 2 }} - split strings.Split {{ .Field | split }} - title strings.Title {{ .Field | title }} - truncate limit field length {{ truncate . 10 }} - upper strings.ToUpper {{ .Field | upper }} report.Funcs() may be used to add additional template functions. Adding an existing function will replace that function for the life of that template. Note: Your code should not ignore errors */ package report ================================================ FILE: vendor/go.podman.io/common/pkg/report/formatter.go ================================================ package report import ( "io" "maps" "strings" "text/tabwriter" "text/template" ) // Flusher is the interface that wraps the Flush method. type Flusher interface { Flush() error } // NopFlusher represents a type which flush operation is nop. type NopFlusher struct{} // Flush is a nop operation. func (f *NopFlusher) Flush() error { return nil } type Origin int const ( OriginUnknown Origin = iota OriginPodman OriginUser ) func (o Origin) String() string { switch o { case OriginPodman: return "OriginPodman" case OriginUser: return "OriginUser" default: return "OriginUnknown" } } // Formatter holds the configured Writer and parsed Template, additional state fields are // maintained to assist in the podman command report writing. type Formatter struct { Origin Origin // Source of go template. OriginUser or OriginPodman RenderHeaders bool // Hint, default behavior for given template is to include headers RenderTable bool // Does template have "table" keyword flusher Flusher // Flush any buffered formatted output template *template.Template // Go text/template for formatting output text string // value of canonical template after processing writer io.Writer // Destination for formatted output } // stringsCutPrefix is equivalent to Go 1.20’s strings.CutPrefix. // Replace this function with a direct call to the standard library after we update to Go 1.20. func stringsCutPrefix(s, prefix string) (string, bool) { if !strings.HasPrefix(s, prefix) { return s, false } return s[len(prefix):], true } // Parse parses golang template returning a formatter // // - OriginPodman implies text is a template from podman code. Output will // be filtered through a tabwriter. // // - OriginUser implies text is a template from a user. If template includes // keyword "table" output will be filtered through a tabwriter. func (f *Formatter) Parse(origin Origin, text string) (*Formatter, error) { f.Origin = origin // docker tries to be smart and replaces \n with the actual newline character. // For compat we do the same but this will break formats such as '{{printf "\n"}}' // To be backwards compatible with the previous behavior we try to replace and // parse the template. If it fails use the original text and parse again. var normText string textWithoutTable, hasTable := stringsCutPrefix(text, "table ") switch { case hasTable: f.RenderTable = true normText = "{{range .}}" + NormalizeFormat(text) + "{{end -}}" text = "{{range .}}" + textWithoutTable + "{{end -}}" case OriginUser == origin: normText = EnforceRange(NormalizeFormat(text)) text = EnforceRange(text) default: normText = NormalizeFormat(text) } if f.RenderTable || origin == OriginPodman { tw := tabwriter.NewWriter(f.writer, 12, 2, 2, ' ', tabwriter.StripEscape) f.writer = tw f.flusher = tw f.RenderHeaders = true } tmpl, err := f.template.Funcs(template.FuncMap(DefaultFuncs)).Parse(normText) if err != nil { tmpl, err = f.template.Funcs(template.FuncMap(DefaultFuncs)).Parse(text) f.template = tmpl f.text = text return f, err } f.text = normText f.template = tmpl return f, nil } // Funcs adds the elements of the argument map to the template's function map. // A default template function will be replaced if there is a key collision. func (f *Formatter) Funcs(funcMap template.FuncMap) *Formatter { m := make(template.FuncMap, len(DefaultFuncs)+len(funcMap)) maps.Copy(m, DefaultFuncs) maps.Copy(m, funcMap) f.template = f.template.Funcs(funcMap) return f } // Init either resets the given tabwriter with new values or wraps w in tabwriter with given values. func (f *Formatter) Init(w io.Writer, minwidth, tabwidth, padding int, padchar byte, flags uint) *Formatter { flags |= tabwriter.StripEscape if tw, ok := f.writer.(*tabwriter.Writer); ok { tw = tw.Init(w, minwidth, tabwidth, padding, padchar, flags) f.writer = tw f.flusher = tw } else { tw = tabwriter.NewWriter(w, minwidth, tabwidth, padding, padchar, flags) f.writer = tw f.flusher = tw } return f } // Execute applies a parsed template to the specified data object, // and writes the output to Formatter.Writer. func (f *Formatter) Execute(data any) error { return f.template.Execute(f.writer, data) } // Flush should be called after the last call to Write to ensure // that any data buffered in the Formatter is written to output. Any // incomplete escape sequence at the end is considered // complete for formatting purposes. func (f *Formatter) Flush() error { // Indirection is required here to prevent caller from having to know when // value of Flusher may be changed. return f.flusher.Flush() } // Writer returns the embedded io.Writer from Formatter. func (f *Formatter) Writer() io.Writer { return f.writer } // New allocates a new, undefined Formatter with the given name and Writer. func New(output io.Writer, name string) *Formatter { f := new(Formatter) f.flusher = new(NopFlusher) if flusher, ok := output.(Flusher); ok { f.flusher = flusher } f.template = template.New(name) f.writer = output return f } ================================================ FILE: vendor/go.podman.io/common/pkg/report/template.go ================================================ package report import ( "bytes" "encoding/json" "maps" "reflect" "strings" "text/template" "go.podman.io/common/pkg/report/camelcase" "go.podman.io/storage/pkg/regexp" ) // Template embeds template.Template to add functionality to methods. type Template struct { *template.Template isTable bool } // FuncMap is aliased from template.FuncMap. type FuncMap template.FuncMap // tableReplacer will remove 'table ' prefix and clean up tabs. var tableReplacer = strings.NewReplacer( "table ", "", `\t`, "\t", " ", "\t", `\n`, "\n", ) // escapedReplacer will clean up escaped characters from CLI. var escapedReplacer = strings.NewReplacer( `\t`, "\t", `\n`, "\n", ) var DefaultFuncs = FuncMap{ "join": strings.Join, "json": func(v any) string { buf := new(bytes.Buffer) enc := json.NewEncoder(buf) enc.SetEscapeHTML(false) _ = enc.Encode(v) // Remove the trailing new line added by the encoder return strings.TrimSpace(buf.String()) }, "lower": strings.ToLower, "pad": padWithSpace, "split": strings.Split, "title": strings.Title, //nolint:staticcheck "truncate": truncateWithLength, "upper": strings.ToUpper, } // NormalizeFormat reads given go template format provided by CLI and munges it into what we need. func NormalizeFormat(format string) string { var f string // two replacers used so we only remove the prefix keyword `table` if strings.HasPrefix(format, "table ") { f = tableReplacer.Replace(format) } else { f = escapedReplacer.Replace(format) } if !strings.HasSuffix(f, "\n") { f += "\n" } return f } // padWithSpace adds spaces*prefix and spaces*suffix to the input when it is non-empty. func padWithSpace(source string, prefix, suffix int) string { if source == "" { return source } return strings.Repeat(" ", prefix) + source + strings.Repeat(" ", suffix) } // truncateWithLength truncates the source string up to the length provided by the input. func truncateWithLength(source string, length int) string { if len(source) < length { return source } return source[:length] } // Headers queries the interface for field names. // Array of map is returned to support range templates // Note: unexported fields can be supported by adding field to overrides // Note: It is left to the developer to write out said headers // // Podman commands use the general rules of: // 1) unchanged --format includes headers // 2) --format '{{.ID}" # no headers // 3) --format 'table {{.ID}}' # includes headers func Headers(object any, overrides map[string]string) []map[string]string { value := reflect.ValueOf(object) if value.Kind() == reflect.Pointer { value = value.Elem() } // Column header will be field name upper-cased. headers := make(map[string]string, value.NumField()) for i := range value.Type().NumField() { field := value.Type().Field(i) // Recurse to find field names from promoted structs if field.Type.Kind() == reflect.Struct && field.Anonymous { h := Headers(reflect.New(field.Type).Interface(), nil) maps.Copy(headers, h[0]) continue } name := strings.Join(camelcase.Split(field.Name), " ") headers[field.Name] = strings.ToUpper(name) } if len(overrides) > 0 { // Override column header as provided for k, v := range overrides { headers[k] = strings.ToUpper(v) } } return []map[string]string{headers} } // NewTemplate creates a new template object. func NewTemplate(name string) *Template { return &Template{Template: template.New(name).Funcs(template.FuncMap(DefaultFuncs))} } // Parse parses text as a template body for t. func (t *Template) Parse(text string) (*Template, error) { if strings.HasPrefix(text, "table ") { t.isTable = true text = "{{range .}}" + NormalizeFormat(text) + "{{end -}}" } else { text = NormalizeFormat(text) } tt, err := t.Template.Funcs(template.FuncMap(DefaultFuncs)).Parse(text) return &Template{tt, t.isTable}, err } // Funcs adds the elements of the argument map to the template's function map. // A default template function will be replace if there is a key collision. func (t *Template) Funcs(funcMap FuncMap) *Template { m := make(FuncMap) maps.Copy(m, DefaultFuncs) maps.Copy(m, funcMap) return &Template{Template: t.Template.Funcs(template.FuncMap(m)), isTable: t.isTable} } // IsTable returns true if format string defines a "table". func (t *Template) IsTable() bool { return t.isTable } var rangeRegex = regexp.Delayed(`(?s){{\s*range\s*\.\s*}}.*{{\s*end\s*-?\s*}}`) // EnforceRange ensures that the format string contains a range. func EnforceRange(format string) string { if !rangeRegex.MatchString(format) { return "{{range .}}" + format + "{{end -}}" } return format } // HasTable returns whether the format is a table. func HasTable(format string) bool { return strings.HasPrefix(format, "table ") } ================================================ FILE: vendor/go.podman.io/common/pkg/report/validate.go ================================================ package report import ( "go.podman.io/storage/pkg/regexp" ) // Check for json, {{json }} and {{ json. }} which are not valid go template, // {{json .}} is valid and thus not matched to let the template handle it like docker does. var jsonRegex = regexp.Delayed(`^\s*(json|{{\s*json\.?\s*}})\s*$`) // IsJSON check if CLI --format string is a JSON request // // if report.IsJSON(cmd.Flag("format").Value.String()) { // ... process JSON and output // } func IsJSON(s string) bool { return jsonRegex.MatchString(s) } ================================================ FILE: vendor/go.podman.io/common/pkg/report/writer.go ================================================ package report import ( "io" "text/tabwriter" ) // Writer aliases tabwriter.Writer to provide Podman defaults. type Writer struct { *tabwriter.Writer } // NewWriter initializes a new report.Writer with given values. func NewWriter(output io.Writer, minwidth, tabwidth, padding int, padchar byte, flags uint) (*Writer, error) { t := tabwriter.NewWriter(output, minwidth, tabwidth, padding, padchar, flags) return &Writer{t}, nil } // NewWriterDefault initializes a new report.Writer with Podman defaults. func NewWriterDefault(output io.Writer) (*Writer, error) { return NewWriter(output, 12, 2, 2, ' ', 0) } // Flush any output left in buffers. func (w *Writer) Flush() error { return w.Writer.Flush() } ================================================ FILE: vendor/go.podman.io/common/pkg/retry/retry.go ================================================ package retry import ( "context" "io" "math" "math/rand/v2" "net" "net/http" "net/url" "syscall" "time" "github.com/docker/distribution/registry/api/errcode" errcodev2 "github.com/docker/distribution/registry/api/v2" "github.com/hashicorp/go-multierror" "github.com/sirupsen/logrus" "go.podman.io/image/v5/docker" ) // Options defines the option to retry. type Options struct { MaxRetry int // The number of times to possibly retry. Delay time.Duration // The delay to use between retries, if set. IsErrorRetryable func(error) bool } // RetryOptions is deprecated, use Options. type RetryOptions = Options // nolint:revive // RetryIfNecessary deprecated function use IfNecessary. func RetryIfNecessary(ctx context.Context, operation func() error, options *Options) error { // nolint:revive return IfNecessary(ctx, operation, options) } // IfNecessary retries the operation in exponential backoff with the retry Options. func IfNecessary(ctx context.Context, operation func() error, options *Options) error { var isRetryable func(error) bool if options.IsErrorRetryable != nil { isRetryable = options.IsErrorRetryable } else { isRetryable = IsErrorRetryable } err := operation() for attempt := 0; err != nil && isRetryable(err) && attempt < options.MaxRetry; attempt++ { delay := time.Duration(int(math.Pow(2, float64(attempt)))) * time.Second if options.Delay != 0 { delay = options.Delay } logrus.Warnf("Failed, retrying in %s ... (%d/%d). Error: %v", delay, attempt+1, options.MaxRetry, err) delay += rand.N(delay / 10) // 10 % jitter so that a failure blip doesn’t cause a deterministic stampede logrus.Debugf("Retry delay with added jitter: %s", delay) select { case <-time.After(delay): // Do nothing. case <-ctx.Done(): return err } err = operation() } return err } // IsErrorRetryable makes a HEURISTIC determination whether it is worth retrying upon encountering an error. // That heuristic is NOT STABLE and it CAN CHANGE AT ANY TIME. // Callers that have a hard requirement for specific treatment of a class of errors should make their own check // instead of relying on this function maintaining its past behavior. func IsErrorRetryable(err error) bool { switch err { case nil: return false case context.Canceled, context.DeadlineExceeded: return false default: // continue } type unwrapper interface { Unwrap() error } switch e := err.(type) { case errcode.Error: switch e.Code { case errcode.ErrorCodeUnauthorized, errcode.ErrorCodeDenied, errcodev2.ErrorCodeNameUnknown, errcodev2.ErrorCodeManifestUnknown: return false } return true case docker.UnexpectedHTTPStatusError: // Retry on 502, 502 and 503 http server errors, they appear to be quite common in the field. // https://github.com/containers/common/issues/2299 if e.StatusCode >= http.StatusBadGateway && e.StatusCode <= http.StatusGatewayTimeout { return true } return false case *net.OpError: return IsErrorRetryable(e.Err) case *url.Error: // This includes errors returned by the net/http client. if e.Err == io.EOF { // Happens when a server accepts a HTTP connection and sends EOF return true } return IsErrorRetryable(e.Err) case syscall.Errno: return isErrnoRetryable(e) case errcode.Errors: // if this error is a group of errors, process them all in turn for i := range e { if !IsErrorRetryable(e[i]) { return false } } return true case *multierror.Error: // if this error is a group of errors, process them all in turn for i := range e.Errors { if !IsErrorRetryable(e.Errors[i]) { return false } } return true case net.Error: if e.Timeout() { return true } if unwrappable, ok := e.(unwrapper); ok { err = unwrappable.Unwrap() return IsErrorRetryable(err) } case unwrapper: // Test this last, because various error types might implement .Unwrap() err = e.Unwrap() return IsErrorRetryable(err) } return false } func isErrnoRetryable(e error) bool { switch e { case syscall.ECONNREFUSED, syscall.EINTR, syscall.EAGAIN, syscall.EBUSY, syscall.ENETDOWN, syscall.ENETUNREACH, syscall.ENETRESET, syscall.ECONNABORTED, syscall.ECONNRESET, syscall.ETIMEDOUT, syscall.EHOSTDOWN, syscall.EHOSTUNREACH: return true } return isErrnoERESTART(e) } ================================================ FILE: vendor/go.podman.io/common/pkg/retry/retry_linux.go ================================================ package retry import ( "syscall" ) func isErrnoERESTART(e error) bool { return e == syscall.ERESTART } ================================================ FILE: vendor/go.podman.io/common/pkg/retry/retry_unsupported.go ================================================ //go:build !linux package retry func isErrnoERESTART(e error) bool { return false } ================================================ FILE: vendor/go.podman.io/image/v5/LICENSE ================================================ Apache License Version 2.0, January 2004 https://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: vendor/go.podman.io/image/v5/copy/blob.go ================================================ package copy import ( "context" "errors" "fmt" "io" "github.com/sirupsen/logrus" "go.podman.io/image/v5/internal/private" compressiontypes "go.podman.io/image/v5/pkg/compression/types" "go.podman.io/image/v5/types" ) // copyBlobFromStream copies a blob with srcInfo (with known Digest and Annotations and possibly known Size) from srcReader to dest, // perhaps sending a copy to an io.Writer if getOriginalLayerCopyWriter != nil, // perhaps (de/re/)compressing it if canModifyBlob, // and returns a complete blobInfo of the copied blob. func (ic *imageCopier) copyBlobFromStream(ctx context.Context, srcReader io.Reader, srcInfo types.BlobInfo, getOriginalLayerCopyWriter func(decompressor compressiontypes.DecompressorFunc) io.Writer, isConfig bool, toEncrypt bool, bar *progressBar, layerIndex int, emptyLayer bool, ) (types.BlobInfo, error) { // The copying happens through a pipeline of connected io.Readers; // that pipeline is built by updating stream. // === Input: srcReader stream := sourceStream{ reader: srcReader, info: srcInfo, } // === Process input through digestingReader to validate against the expected digest. // Be paranoid; in case PutBlob somehow managed to ignore an error from digestingReader, // use a separate validation failure indicator. // Note that for this check we don't use the stronger "validationSucceeded" indicator, because // dest.PutBlob may detect that the layer already exists, in which case we don't // read stream to the end, and validation does not happen. digestingReader, err := newDigestingReader(stream.reader, srcInfo.Digest) if err != nil { return types.BlobInfo{}, fmt.Errorf("preparing to verify blob %s: %w", srcInfo.Digest, err) } stream.reader = digestingReader // === Update progress bars stream.reader = bar.ProxyReader(stream.reader) // === Decrypt the stream, if required. decryptionStep, err := ic.blobPipelineDecryptionStep(&stream, srcInfo) if err != nil { return types.BlobInfo{}, err } // === Detect compression of the input stream. // This requires us to “peek ahead” into the stream to read the initial part, which requires us to chain through another io.Reader returned by DetectCompression. detectedCompression, err := blobPipelineDetectCompressionStep(&stream, srcInfo) if err != nil { return types.BlobInfo{}, err } // === Send a copy of the original, uncompressed, stream, to a separate path if necessary. var originalLayerReader io.Reader // DO NOT USE this other than to drain the input if no other consumer in the pipeline has done so. if getOriginalLayerCopyWriter != nil { stream.reader = io.TeeReader(stream.reader, getOriginalLayerCopyWriter(detectedCompression.decompressor)) originalLayerReader = stream.reader } // WARNING: If you are adding new reasons to change the blob, update also the OptimizeDestinationImageAlreadyExists // short-circuit conditions canModifyBlob := !isConfig && ic.cannotModifyManifestReason == "" // === Deal with layer compression/decompression if necessary compressionStep, err := ic.blobPipelineCompressionStep(&stream, canModifyBlob, srcInfo, detectedCompression) if err != nil { return types.BlobInfo{}, err } defer compressionStep.close() // === Encrypt the stream for valid mediatypes if ociEncryptConfig provided if decryptionStep.decrypting && toEncrypt { // If nothing else, we can only set uploadedInfo.CryptoOperation to a single value. // Before relaxing this, see the original pull request’s review if there are other reasons to reject this. return types.BlobInfo{}, errors.New("Unable to support both decryption and encryption in the same copy") } encryptionStep, err := ic.blobPipelineEncryptionStep(&stream, toEncrypt, srcInfo, decryptionStep) if err != nil { return types.BlobInfo{}, err } // === Report progress using the ic.c.options.Progress channel, if required. if ic.c.options.Progress != nil && ic.c.options.ProgressInterval > 0 { progressReader := newProgressReader( stream.reader, ic.c.options.Progress, ic.c.options.ProgressInterval, srcInfo, ) defer progressReader.reportDone() stream.reader = progressReader } // === Finally, send the layer stream to dest. options := private.PutBlobOptions{ Cache: ic.c.blobInfoCache, IsConfig: isConfig, EmptyLayer: emptyLayer, } if !isConfig { options.LayerIndex = &layerIndex } destBlob, err := ic.c.dest.PutBlobWithOptions(ctx, &errorAnnotationReader{stream.reader}, stream.info, options) if err != nil { return types.BlobInfo{}, fmt.Errorf("writing blob: %w", err) } uploadedInfo := updatedBlobInfoFromUpload(stream.info, destBlob) compressionStep.updateCompressionEdits(&uploadedInfo.CompressionOperation, &uploadedInfo.CompressionAlgorithm, &uploadedInfo.Annotations) decryptionStep.updateCryptoOperation(&uploadedInfo.CryptoOperation) if err := encryptionStep.updateCryptoOperationAndAnnotations(&uploadedInfo.CryptoOperation, &uploadedInfo.Annotations); err != nil { return types.BlobInfo{}, err } // This is fairly horrible: the writer from getOriginalLayerCopyWriter wants to consume // all of the input (to compute DiffIDs), even if dest.PutBlob does not need it. // So, read everything from originalLayerReader, which will cause the rest to be // sent there if we are not already at EOF. if getOriginalLayerCopyWriter != nil { logrus.Debugf("Consuming rest of the original blob to satisfy getOriginalLayerCopyWriter") _, err := io.Copy(io.Discard, originalLayerReader) if err != nil { return types.BlobInfo{}, fmt.Errorf("reading input blob %s: %w", srcInfo.Digest, err) } } if digestingReader.validationFailed { // Coverage: This should never happen. return types.BlobInfo{}, fmt.Errorf("Internal error writing blob %s, digest verification failed but was ignored", srcInfo.Digest) } if stream.info.Digest != "" && uploadedInfo.Digest != stream.info.Digest { return types.BlobInfo{}, fmt.Errorf("Internal error writing blob %s, blob with digest %s saved with digest %s", srcInfo.Digest, stream.info.Digest, uploadedInfo.Digest) } if digestingReader.validationSucceeded { if err := compressionStep.recordValidatedDigestData(ic.c, uploadedInfo, srcInfo, encryptionStep, decryptionStep); err != nil { return types.BlobInfo{}, err } } return uploadedInfo, nil } // sourceStream encapsulates an input consumed by copyBlobFromStream, in progress of being built. // This allows handles of individual aspects to build the copy pipeline without _too much_ // specific cooperation by the caller. // // We are currently very far from a generalized plug-and-play API for building/consuming the pipeline // without specific knowledge of various aspects in copyBlobFromStream; that may come one day. type sourceStream struct { reader io.Reader info types.BlobInfo // corresponding to the data available in reader. } // errorAnnotationReader wraps the io.Reader passed to PutBlob for annotating the error happened during read. // These errors are reported as PutBlob errors, so we would otherwise misleadingly attribute them to the copy destination. type errorAnnotationReader struct { reader io.Reader } // Read annotates the error happened during read func (r errorAnnotationReader) Read(b []byte) (n int, err error) { n, err = r.reader.Read(b) if err != nil && err != io.EOF { return n, fmt.Errorf("happened during read: %w", err) } return n, err } // updatedBlobInfoFromUpload returns inputInfo updated with uploadedBlob which was created based on inputInfo. func updatedBlobInfoFromUpload(inputInfo types.BlobInfo, uploadedBlob private.UploadedBlob) types.BlobInfo { // The transport is only tasked with dealing with the raw blob, and possibly computing Digest/Size. // Handling of compression, encryption, and the related MIME types and the like are all the responsibility // of the generic code in this package. return types.BlobInfo{ Digest: uploadedBlob.Digest, Size: uploadedBlob.Size, URLs: nil, // This _must_ be cleared if Digest changes; clear it in other cases as well, to preserve previous behavior. Annotations: inputInfo.Annotations, MediaType: inputInfo.MediaType, // Mostly irrelevant, MediaType is updated based on Compression/Crypto. CompressionOperation: inputInfo.CompressionOperation, // Expected to be unset, and only updated by copyBlobFromStream. CompressionAlgorithm: inputInfo.CompressionAlgorithm, // Expected to be unset, and only updated by copyBlobFromStream. CryptoOperation: inputInfo.CryptoOperation, // Expected to be unset, and only updated by copyBlobFromStream. } } ================================================ FILE: vendor/go.podman.io/image/v5/copy/compression.go ================================================ package copy import ( "errors" "fmt" "io" "maps" imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" "github.com/sirupsen/logrus" internalblobinfocache "go.podman.io/image/v5/internal/blobinfocache" "go.podman.io/image/v5/manifest" "go.podman.io/image/v5/pkg/compression" compressiontypes "go.podman.io/image/v5/pkg/compression/types" "go.podman.io/image/v5/types" chunkedToc "go.podman.io/storage/pkg/chunked/toc" ) var ( // defaultCompressionFormat is used if the destination transport requests // compression, and the user does not explicitly instruct us to use an algorithm. defaultCompressionFormat = &compression.Gzip // compressionBufferSize is the buffer size used to compress a blob compressionBufferSize = 1048576 // expectedBaseCompressionFormats is used to check if a blob with a specified media type is compressed // using the algorithm that the media type says it should be compressed with expectedBaseCompressionFormats = map[string]*compressiontypes.Algorithm{ imgspecv1.MediaTypeImageLayerGzip: &compression.Gzip, imgspecv1.MediaTypeImageLayerZstd: &compression.Zstd, manifest.DockerV2Schema2LayerMediaType: &compression.Gzip, manifest.DockerV2SchemaLayerMediaTypeZstd: &compression.Zstd, } ) // bpDetectCompressionStepData contains data that the copy pipeline needs about the “detect compression” step. type bpDetectCompressionStepData struct { isCompressed bool format compressiontypes.Algorithm // Valid if isCompressed decompressor compressiontypes.DecompressorFunc // Valid if isCompressed srcCompressorBaseVariantName string // Compressor name to possibly record in the blob info cache for the source blob. } // blobPipelineDetectCompressionStep updates *stream to detect its current compression format. // srcInfo is only used for error messages. // Returns data for other steps. func blobPipelineDetectCompressionStep(stream *sourceStream, srcInfo types.BlobInfo) (bpDetectCompressionStepData, error) { // This requires us to “peek ahead” into the stream to read the initial part, which requires us to chain through another io.Reader returned by DetectCompression. format, decompressor, reader, err := compression.DetectCompressionFormat(stream.reader) // We could skip this in some cases, but let's keep the code path uniform if err != nil { return bpDetectCompressionStepData{}, fmt.Errorf("reading blob %s: %w", srcInfo.Digest, err) } stream.reader = reader if decompressor != nil && format.Name() == compressiontypes.ZstdAlgorithmName { tocDigest, err := chunkedToc.GetTOCDigest(srcInfo.Annotations) if err != nil { return bpDetectCompressionStepData{}, err } if tocDigest != nil { format = compression.ZstdChunked } } res := bpDetectCompressionStepData{ isCompressed: decompressor != nil, format: format, decompressor: decompressor, } if res.isCompressed { res.srcCompressorBaseVariantName = format.BaseVariantName() } else { res.srcCompressorBaseVariantName = internalblobinfocache.Uncompressed } if expectedBaseFormat, known := expectedBaseCompressionFormats[stream.info.MediaType]; known && res.isCompressed && format.BaseVariantName() != expectedBaseFormat.Name() { logrus.Debugf("blob %s with type %s should be compressed with %s, but compressor appears to be %s", srcInfo.Digest.String(), srcInfo.MediaType, expectedBaseFormat.Name(), format.Name()) } return res, nil } // bpCompressionStepData contains data that the copy pipeline needs about the compression step. type bpCompressionStepData struct { operation bpcOperation // What we are actually doing uploadedOperation types.LayerCompression // Operation to use for updating the blob metadata (matching the end state, not necessarily what we do) uploadedAlgorithm *compressiontypes.Algorithm // An algorithm parameter for the compressionOperation edits. uploadedAnnotations map[string]string // Compression-related annotations that should be set on the uploaded blob. WARNING: This is only set after the srcStream.reader is fully consumed. srcCompressorBaseVariantName string // Compressor base variant name to record in the blob info cache for the source blob. uploadedCompressorBaseVariantName string // Compressor base variant name to record in the blob info cache for the uploaded blob. uploadedCompressorSpecificVariantName string // Compressor specific variant name to record in the blob info cache for the uploaded blob. closers []io.Closer // Objects to close after the upload is done, if any. } type bpcOperation int const ( bpcOpInvalid bpcOperation = iota bpcOpPreserveOpaque // We are preserving something where compression is not applicable bpcOpPreserveCompressed // We are preserving a compressed, and decompressible, layer bpcOpPreserveUncompressed // We are preserving an uncompressed, and compressible, layer bpcOpCompressUncompressed // We are compressing uncompressed data bpcOpRecompressCompressed // We are recompressing compressed data bpcOpDecompressCompressed // We are decompressing compressed data ) // blobPipelineCompressionStep updates *stream to compress and/or decompress it. // srcInfo is primarily used for error messages. // Returns data for other steps; the caller should eventually call updateCompressionEdits and perhaps recordValidatedBlobData, // and must eventually call close. func (ic *imageCopier) blobPipelineCompressionStep(stream *sourceStream, canModifyBlob bool, srcInfo types.BlobInfo, detected bpDetectCompressionStepData, ) (*bpCompressionStepData, error) { // WARNING: If you are adding new reasons to change the blob, update also the OptimizeDestinationImageAlreadyExists // short-circuit conditions layerCompressionChangeSupported := ic.src.CanChangeLayerCompression(stream.info.MediaType) if !layerCompressionChangeSupported { logrus.Debugf("Compression change for blob %s (%q) not supported", srcInfo.Digest, stream.info.MediaType) } if canModifyBlob && layerCompressionChangeSupported { for _, fn := range []func(*sourceStream, bpDetectCompressionStepData) (*bpCompressionStepData, error){ ic.bpcPreserveEncrypted, ic.bpcCompressUncompressed, ic.bpcRecompressCompressed, ic.bpcDecompressCompressed, } { res, err := fn(stream, detected) if err != nil { return nil, err } if res != nil { return res, nil } } } return ic.bpcPreserveOriginal(stream, detected, layerCompressionChangeSupported), nil } // bpcPreserveEncrypted checks if the input is encrypted, and returns a *bpCompressionStepData if so. func (ic *imageCopier) bpcPreserveEncrypted(stream *sourceStream, _ bpDetectCompressionStepData) (*bpCompressionStepData, error) { if isOciEncrypted(stream.info.MediaType) { // We can’t do anything with an encrypted blob unless decrypted. logrus.Debugf("Using original blob without modification for encrypted blob") return &bpCompressionStepData{ operation: bpcOpPreserveOpaque, uploadedOperation: types.PreserveOriginal, uploadedAlgorithm: nil, srcCompressorBaseVariantName: internalblobinfocache.UnknownCompression, uploadedCompressorBaseVariantName: internalblobinfocache.UnknownCompression, uploadedCompressorSpecificVariantName: internalblobinfocache.UnknownCompression, }, nil } return nil, nil } // bpcCompressUncompressed checks if we should be compressing an uncompressed input, and returns a *bpCompressionStepData if so. func (ic *imageCopier) bpcCompressUncompressed(stream *sourceStream, detected bpDetectCompressionStepData) (*bpCompressionStepData, error) { if ic.c.dest.DesiredLayerCompression() == types.Compress && !detected.isCompressed { logrus.Debugf("Compressing blob on the fly") var uploadedAlgorithm *compressiontypes.Algorithm if ic.compressionFormat != nil { uploadedAlgorithm = ic.compressionFormat } else { uploadedAlgorithm = defaultCompressionFormat } reader, annotations := ic.compressedStream(stream.reader, *uploadedAlgorithm) // Note: reader must be closed on all return paths. stream.reader = reader stream.info = types.BlobInfo{ // FIXME? Should we preserve more data in src.info? Digest: "", Size: -1, } specificVariantName := uploadedAlgorithm.Name() if specificVariantName == uploadedAlgorithm.BaseVariantName() { specificVariantName = internalblobinfocache.UnknownCompression } return &bpCompressionStepData{ operation: bpcOpCompressUncompressed, uploadedOperation: types.Compress, uploadedAlgorithm: uploadedAlgorithm, uploadedAnnotations: annotations, srcCompressorBaseVariantName: detected.srcCompressorBaseVariantName, uploadedCompressorBaseVariantName: uploadedAlgorithm.BaseVariantName(), uploadedCompressorSpecificVariantName: specificVariantName, closers: []io.Closer{reader}, }, nil } return nil, nil } // bpcRecompressCompressed checks if we should be recompressing a compressed input to another format, and returns a *bpCompressionStepData if so. func (ic *imageCopier) bpcRecompressCompressed(stream *sourceStream, detected bpDetectCompressionStepData) (*bpCompressionStepData, error) { if ic.c.dest.DesiredLayerCompression() == types.Compress && detected.isCompressed && ic.compressionFormat != nil && (ic.compressionFormat.Name() != detected.format.Name() && ic.compressionFormat.Name() != detected.format.BaseVariantName()) { // When the blob is compressed, but the desired format is different, it first needs to be decompressed and finally // re-compressed using the desired format. logrus.Debugf("Blob will be converted") decompressed, err := detected.decompressor(stream.reader) if err != nil { return nil, err } succeeded := false defer func() { if !succeeded { decompressed.Close() } }() recompressed, annotations := ic.compressedStream(decompressed, *ic.compressionFormat) // Note: recompressed must be closed on all return paths. stream.reader = recompressed stream.info = types.BlobInfo{ // FIXME? Should we preserve more data in src.info? Notably the current approach correctly removes zstd:chunked metadata annotations. Digest: "", Size: -1, } specificVariantName := ic.compressionFormat.Name() if specificVariantName == ic.compressionFormat.BaseVariantName() { specificVariantName = internalblobinfocache.UnknownCompression } succeeded = true return &bpCompressionStepData{ operation: bpcOpRecompressCompressed, uploadedOperation: types.PreserveOriginal, uploadedAlgorithm: ic.compressionFormat, uploadedAnnotations: annotations, srcCompressorBaseVariantName: detected.srcCompressorBaseVariantName, uploadedCompressorBaseVariantName: ic.compressionFormat.BaseVariantName(), uploadedCompressorSpecificVariantName: specificVariantName, closers: []io.Closer{decompressed, recompressed}, }, nil } return nil, nil } // bpcDecompressCompressed checks if we should be decompressing a compressed input, and returns a *bpCompressionStepData if so. func (ic *imageCopier) bpcDecompressCompressed(stream *sourceStream, detected bpDetectCompressionStepData) (*bpCompressionStepData, error) { if ic.c.dest.DesiredLayerCompression() == types.Decompress && detected.isCompressed { logrus.Debugf("Blob will be decompressed") s, err := detected.decompressor(stream.reader) if err != nil { return nil, err } // Note: s must be closed on all return paths. stream.reader = s stream.info = types.BlobInfo{ // FIXME? Should we preserve more data in src.info? Notably the current approach correctly removes zstd:chunked metadata annotations. Digest: "", Size: -1, } return &bpCompressionStepData{ operation: bpcOpDecompressCompressed, uploadedOperation: types.Decompress, uploadedAlgorithm: nil, srcCompressorBaseVariantName: detected.srcCompressorBaseVariantName, uploadedCompressorBaseVariantName: internalblobinfocache.Uncompressed, uploadedCompressorSpecificVariantName: internalblobinfocache.UnknownCompression, closers: []io.Closer{s}, }, nil } return nil, nil } // bpcPreserveOriginal returns a *bpCompressionStepData for not changing the original blob. // This does not change the sourceStream parameter; we include it for symmetry with other // pipeline steps. func (ic *imageCopier) bpcPreserveOriginal(_ *sourceStream, detected bpDetectCompressionStepData, layerCompressionChangeSupported bool, ) *bpCompressionStepData { logrus.Debugf("Using original blob without modification") // Remember if the original blob was compressed, and if so how, so that if // LayerInfosForCopy() returned something that differs from what was in the // source's manifest, and UpdatedImage() needs to call UpdateLayerInfos(), // it will be able to correctly derive the MediaType for the copied blob. // // But don’t touch blobs in objects where we can’t change compression, // so that src.UpdatedImage() doesn’t fail; assume that for such blobs // LayerInfosForCopy() should not be making any changes in the first place. var bpcOp bpcOperation var uploadedOp types.LayerCompression var algorithm *compressiontypes.Algorithm switch { case !layerCompressionChangeSupported: bpcOp = bpcOpPreserveOpaque uploadedOp = types.PreserveOriginal algorithm = nil case detected.isCompressed: bpcOp = bpcOpPreserveCompressed uploadedOp = types.PreserveOriginal algorithm = &detected.format default: bpcOp = bpcOpPreserveUncompressed uploadedOp = types.Decompress algorithm = nil } return &bpCompressionStepData{ operation: bpcOp, uploadedOperation: uploadedOp, uploadedAlgorithm: algorithm, srcCompressorBaseVariantName: detected.srcCompressorBaseVariantName, // We only record the base variant of the format on upload; we didn’t do anything with // the TOC, we don’t know whether it matches the blob digest, so we don’t want to trigger // reuse of any kind between the blob digest and the TOC digest. uploadedCompressorBaseVariantName: detected.srcCompressorBaseVariantName, uploadedCompressorSpecificVariantName: internalblobinfocache.UnknownCompression, } } // updateCompressionEdits sets *operation, *algorithm and updates *annotations, if necessary. func (d *bpCompressionStepData) updateCompressionEdits(operation *types.LayerCompression, algorithm **compressiontypes.Algorithm, annotations *map[string]string) { *operation = d.uploadedOperation // If we can modify the layer's blob, set the desired algorithm for it to be set in the manifest. *algorithm = d.uploadedAlgorithm if *annotations == nil { *annotations = map[string]string{} } maps.Copy(*annotations, d.uploadedAnnotations) } // recordValidatedDigestData updates b.blobInfoCache with data about the created uploadedInfo (as returned by PutBlob) // and the original srcInfo (which the caller guarantees has been validated). // This must ONLY be called if all data has been validated by OUR code, and is not coming from third parties. func (d *bpCompressionStepData) recordValidatedDigestData(c *copier, uploadedInfo types.BlobInfo, srcInfo types.BlobInfo, encryptionStep *bpEncryptionStepData, decryptionStep *bpDecryptionStepData, ) error { // Don’t record any associations that involve encrypted data. This is a bit crude, // some blob substitutions (replacing pulls of encrypted data with local reuse of known decryption outcomes) // might be safe, but it’s not trivially obvious, so let’s be conservative for now. // This crude approach also means we don’t need to record whether a blob is encrypted // in the blob info cache (which would probably be necessary for any more complex logic), // and the simplicity is attractive. if !encryptionStep.encrypting && !decryptionStep.decrypting { // If d.operation != bpcOpPreserve*, we now have two reliable digest values: // srcinfo.Digest describes the pre-d.operation input, verified by digestingReader // uploadedInfo.Digest describes the post-d.operation output, computed by PutBlob // (because we set stream.info.Digest == "", this must have been computed afresh). switch d.operation { case bpcOpPreserveOpaque: // No useful information case bpcOpCompressUncompressed: c.blobInfoCache.RecordDigestUncompressedPair(uploadedInfo.Digest, srcInfo.Digest) if d.uploadedAnnotations != nil { tocDigest, err := chunkedToc.GetTOCDigest(d.uploadedAnnotations) if err != nil { return fmt.Errorf("parsing just-created compression annotations: %w", err) } if tocDigest != nil { c.blobInfoCache.RecordTOCUncompressedPair(*tocDigest, srcInfo.Digest) } } case bpcOpDecompressCompressed: c.blobInfoCache.RecordDigestUncompressedPair(srcInfo.Digest, uploadedInfo.Digest) case bpcOpRecompressCompressed, bpcOpPreserveCompressed: // We know one or two compressed digests. BlobInfoCache associates compression variants via the uncompressed digest, // and we don’t know that one. // That also means that repeated copies with the same recompression don’t identify reuse opportunities (unless // RecordDigestUncompressedPair was called for both compressed variants for some other reason). case bpcOpPreserveUncompressed: c.blobInfoCache.RecordDigestUncompressedPair(srcInfo.Digest, srcInfo.Digest) case bpcOpInvalid: fallthrough default: return fmt.Errorf("Internal error: Unexpected d.operation value %#v", d.operation) } } if d.srcCompressorBaseVariantName == "" || d.uploadedCompressorBaseVariantName == "" || d.uploadedCompressorSpecificVariantName == "" { return fmt.Errorf("internal error: missing compressor names (src base: %q, uploaded base: %q, uploaded specific: %q)", d.srcCompressorBaseVariantName, d.uploadedCompressorBaseVariantName, d.uploadedCompressorSpecificVariantName) } if d.uploadedCompressorBaseVariantName != internalblobinfocache.UnknownCompression { c.blobInfoCache.RecordDigestCompressorData(uploadedInfo.Digest, internalblobinfocache.DigestCompressorData{ BaseVariantCompressor: d.uploadedCompressorBaseVariantName, SpecificVariantCompressor: d.uploadedCompressorSpecificVariantName, SpecificVariantAnnotations: d.uploadedAnnotations, }) } if srcInfo.Digest != "" && srcInfo.Digest != uploadedInfo.Digest && d.srcCompressorBaseVariantName != internalblobinfocache.UnknownCompression { // If the source is already using some TOC-dependent variant, we either copied the // blob as is, or perhaps decompressed it; either way we don’t trust the TOC digest, // so record neither the variant name, nor the TOC digest. c.blobInfoCache.RecordDigestCompressorData(srcInfo.Digest, internalblobinfocache.DigestCompressorData{ BaseVariantCompressor: d.srcCompressorBaseVariantName, SpecificVariantCompressor: internalblobinfocache.UnknownCompression, SpecificVariantAnnotations: nil, }) } return nil } // close closes objects that carry state throughout the compression/decompression operation. func (d *bpCompressionStepData) close() { for _, c := range d.closers { c.Close() } } // doCompression reads all input from src and writes its compressed equivalent to dest. func doCompression(dest io.Writer, src io.Reader, metadata map[string]string, compressionFormat compressiontypes.Algorithm, compressionLevel *int) error { compressor, err := compression.CompressStreamWithMetadata(dest, metadata, compressionFormat, compressionLevel) if err != nil { return err } buf := make([]byte, compressionBufferSize) _, err = io.CopyBuffer(compressor, src, buf) // Sets err to nil, i.e. causes dest.Close() if err != nil { compressor.Close() return err } return compressor.Close() } // compressGoroutine reads all input from src and writes its compressed equivalent to dest. func (ic *imageCopier) compressGoroutine(dest *io.PipeWriter, src io.Reader, metadata map[string]string, compressionFormat compressiontypes.Algorithm) { err := errors.New("Internal error: unexpected panic in compressGoroutine") defer func() { // Note that this is not the same as {defer dest.CloseWithError(err)}; we need err to be evaluated lazily. _ = dest.CloseWithError(err) // CloseWithError(nil) is equivalent to Close(), always returns nil }() err = doCompression(dest, src, metadata, compressionFormat, ic.compressionLevel) } // compressedStream returns a stream the input reader compressed using format, and a metadata map. // The caller must close the returned reader. // AFTER the stream is consumed, metadata will be updated with annotations to use on the data. func (ic *imageCopier) compressedStream(reader io.Reader, algorithm compressiontypes.Algorithm) (io.ReadCloser, map[string]string) { pipeReader, pipeWriter := io.Pipe() annotations := map[string]string{} // If this fails while writing data, it will do pipeWriter.CloseWithError(); if it fails otherwise, // e.g. because we have exited and due to pipeReader.Close() above further writing to the pipe has failed, // we don’t care. go ic.compressGoroutine(pipeWriter, reader, annotations, algorithm) // Closes pipeWriter return pipeReader, annotations } ================================================ FILE: vendor/go.podman.io/image/v5/copy/copy.go ================================================ package copy import ( "context" "errors" "fmt" "io" "os" "slices" "time" encconfig "github.com/containers/ocicrypt/config" digest "github.com/opencontainers/go-digest" "github.com/sirupsen/logrus" "go.podman.io/image/v5/docker/reference" internalblobinfocache "go.podman.io/image/v5/internal/blobinfocache" "go.podman.io/image/v5/internal/digests" "go.podman.io/image/v5/internal/image" "go.podman.io/image/v5/internal/imagedestination" "go.podman.io/image/v5/internal/imagesource" internalManifest "go.podman.io/image/v5/internal/manifest" "go.podman.io/image/v5/internal/private" "go.podman.io/image/v5/manifest" "go.podman.io/image/v5/pkg/blobinfocache" compression "go.podman.io/image/v5/pkg/compression/types" "go.podman.io/image/v5/signature" "go.podman.io/image/v5/signature/signer" "go.podman.io/image/v5/transports" "go.podman.io/image/v5/types" "golang.org/x/sync/semaphore" "golang.org/x/term" ) var ( // ErrDecryptParamsMissing is returned if there is missing decryption parameters ErrDecryptParamsMissing = errors.New("Necessary DecryptParameters not present") // maxParallelDownloads is used to limit the maximum number of parallel // downloads. Let's follow Firefox by limiting it to 6. maxParallelDownloads = uint(6) ) // InstancePlatformFilter specifies a platform by OS and Architecture for filtering instances type InstancePlatformFilter struct { OS string // OS, e.g., "linux" Architecture string // Architecture, e.g., "amd64" } const ( // CopySystemImage is the default value which, when set in // Options.ImageListSelection, indicates that the caller expects only one // image to be copied, so if the source reference refers to a list of // images, one that matches the current system will be selected. CopySystemImage ImageListSelection = iota // CopyAllImages is a value which, when set in Options.ImageListSelection, // indicates that the caller expects to copy multiple images, and if // the source reference refers to a list, that the list and every image // to which it refers will be copied. If the source reference refers // to a list, the target reference can not accept lists, an error // should be returned. CopyAllImages // CopySpecificImages is a value which, when set in // Options.ImageListSelection, indicates that the caller expects the // source reference to be either a single image or a list of images, // and if the source reference is a list, wants only specific instances // from it copied (or none of them, if the list of instances to copy is // empty), along with the list itself. If the target reference can // only accept one image (i.e., it cannot accept lists), an error // should be returned. CopySpecificImages ) // ImageListSelection is one of CopySystemImage, CopyAllImages, or // CopySpecificImages, to control whether, when the source reference is a list, // copy.Image() copies only an image which matches the current runtime // environment, or all images which match the supplied reference, or only // specific images from the source reference. type ImageListSelection int // Options allows supplying non-default configuration modifying the behavior of CopyImage. type Options struct { RemoveSignatures bool // Remove any pre-existing signatures. Signers and SignBy… will still add a new signature. // Signers to use to add signatures during the copy. // Callers are still responsible for closing these Signer objects; they can be reused for multiple copy.Image operations in a row. Signers []*signer.Signer SignBy string // If non-empty, asks for a signature to be added during the copy, and specifies a key ID, as accepted by signature.NewGPGSigningMechanism().SignDockerManifest(), SignPassphrase string // Passphrase to use when signing with the key ID from `SignBy`. SignBySigstorePrivateKeyFile string // If non-empty, asks for a signature to be added during the copy, using a sigstore private key file at the provided path. SignSigstorePrivateKeyPassphrase []byte // Passphrase to use when signing with `SignBySigstorePrivateKeyFile`. SignIdentity reference.Named // Identify to use when signing, defaults to the docker reference of the destination ReportWriter io.Writer SourceCtx *types.SystemContext DestinationCtx *types.SystemContext ProgressInterval time.Duration // time to wait between reports to signal the progress channel Progress chan types.ProgressProperties // Reported to when ProgressInterval has arrived for a single artifact+offset. // Preserve digests, and fail if we cannot. PreserveDigests bool // manifest MIME type of image set by user. "" is default and means use the autodetection to the manifest MIME type ForceManifestMIMEType string ImageListSelection ImageListSelection // set to either CopySystemImage (the default), CopyAllImages, or CopySpecificImages to control which instances we copy when the source reference is a list; ignored if the source reference is not a list Instances []digest.Digest // if ImageListSelection is CopySpecificImages, copy only these instances, instances matching the InstancePlatforms list, and the list itself InstancePlatforms []InstancePlatformFilter // if ImageListSelection is CopySpecificImages, copy instances with matching OS/Architecture (all variants and compressions), it also copies the index/manifest_list instance. // Give priority to pulling gzip images if multiple images are present when configured to OptionalBoolTrue, // prefers the best compression if this is configured as OptionalBoolFalse. Choose automatically (and the choice may change over time) // if this is set to OptionalBoolUndefined (which is the default behavior, and recommended for most callers). // This only affects CopySystemImage. PreferGzipInstances types.OptionalBool // If OciEncryptConfig is non-nil, it indicates that an image should be encrypted. // The encryption options is derived from the construction of EncryptConfig object. OciEncryptConfig *encconfig.EncryptConfig // OciEncryptLayers represents the list of layers to encrypt. // If nil, don't encrypt any layers. // If non-nil and len==0, denotes encrypt all layers. // integers in the slice represent 0-indexed layer indices, with support for negative // indexing. i.e. 0 is the first layer, -1 is the last (top-most) layer. OciEncryptLayers *[]int // OciDecryptConfig contains the config that can be used to decrypt an image if it is // encrypted if non-nil. If nil, it does not attempt to decrypt an image. OciDecryptConfig *encconfig.DecryptConfig // A weighted semaphore to limit the amount of concurrently copied layers and configs. Applies to all copy operations using the semaphore. If set, MaxParallelDownloads is ignored. ConcurrentBlobCopiesSemaphore *semaphore.Weighted // MaxParallelDownloads indicates the maximum layers to pull at the same time. Applies to a single copy operation. A reasonable default is used if this is left as 0. Ignored if ConcurrentBlobCopiesSemaphore is set. MaxParallelDownloads uint // When OptimizeDestinationImageAlreadyExists is set, optimize the copy assuming that the destination image already // exists (and is equivalent). Making the eventual (no-op) copy more performant for this case. Enabling the option // is slightly pessimistic if the destination image doesn't exist, or is not equivalent. OptimizeDestinationImageAlreadyExists bool // Download layer contents with "nondistributable" media types ("foreign" layers) and translate the layer media type // to not indicate "nondistributable". DownloadForeignLayers bool // Contains slice of OptionCompressionVariant, where copy will ensure that for each platform // in the manifest list, a variant with the requested compression will exist. // Invalid when copying a non-multi-architecture image. That will probably // change in the future. EnsureCompressionVariantsExist []OptionCompressionVariant // ForceCompressionFormat ensures that the compression algorithm set in // DestinationCtx.CompressionFormat is used exclusively, and blobs of other // compression algorithms are not reused. ForceCompressionFormat bool // ReportResolvedReference, if set, asks the destination transport to store // a “resolved” (more detailed) reference to the created image // into the value this option points to. // What “resolved” means is transport-specific. // Most transports don’t support this, and cause the value to be set to nil. // // For the containers-storage: transport, the reference contains an image ID, // so that storage.ResolveReference returns exactly the created image. // WARNING: It is unspecified whether the reference also contains a reference.Named element. ReportResolvedReference *types.ImageReference // DestinationTimestamp, if set, will force timestamps of content created in the destination to this value. // Most transports don't support this. // // In oci-archive: destinations, this will set the create/mod/access timestamps in each tar entry // (but not a timestamp of the created archive file). DestinationTimestamp *time.Time // FIXME: // - this reference to an internal type is unusable from the outside even if we made the field public // - what is the actual semantics? Right now it is probably “choices to use when writing to the destination”, TBD // - anyway do we want to expose _all_ of the digests.Options tunables, or fewer? // - … do we want to expose _more_ granularity than that? // - (“must have at least sha512 integrity when reading”, what does “at least” mean for random pairs of algorithms?) // - should some of this be in config files, maybe ever per-registry? digestOptions digests.Options } // OptionCompressionVariant allows to supply information about // selected compression algorithm and compression level by the // end-user. Refer to EnsureCompressionVariantsExist to know // more about its usage. type OptionCompressionVariant struct { Algorithm compression.Algorithm Level *int // Only used when we are creating a new image instance using the specified algorithm, not when the image already contains such an instance } // copier allows us to keep track of diffID values for blobs, and other // data shared across one or more images in a possible manifest list. // The owner must call close() when done. type copier struct { policyContext *signature.PolicyContext dest private.ImageDestination rawSource private.ImageSource options *Options // never nil reportWriter io.Writer progressOutput io.Writer unparsedToplevel *image.UnparsedImage // for rawSource blobInfoCache internalblobinfocache.BlobInfoCache2 concurrentBlobCopiesSemaphore *semaphore.Weighted // Limits the amount of concurrently copied blobs signers []*signer.Signer // Signers to use to create new signatures for the image signersToClose []*signer.Signer // Signers that should be closed when this copier is destroyed. } // Internal function to validate `requireCompressionFormatMatch` for copySingleImageOptions func shouldRequireCompressionFormatMatch(options *Options) (bool, error) { if options.ForceCompressionFormat && (options.DestinationCtx == nil || options.DestinationCtx.CompressionFormat == nil) { return false, fmt.Errorf("cannot use ForceCompressionFormat with undefined default compression format") } return options.ForceCompressionFormat, nil } // Image copies image from srcRef to destRef, using policyContext to validate // source image admissibility. It returns the manifest which was written to // the new copy of the image. func Image(ctx context.Context, policyContext *signature.PolicyContext, destRef, srcRef types.ImageReference, options *Options) (copiedManifest []byte, retErr error) { if options == nil { options = &Options{} } // FIXME: Currently, digestsOptions is not implemented at all, and exists in the codebase // only to allow gradually building the feature set. // After c/image/copy consistently implements it, provide a public digest options API of some kind. optionsCopy := *options optionsCopy.digestOptions = digests.CanonicalDefault() options = &optionsCopy if err := validateImageListSelection(options.ImageListSelection); err != nil { return nil, err } reportWriter := io.Discard if options.ReportWriter != nil { reportWriter = options.ReportWriter } // safeClose amends retErr with an error from c.Close(), if any. safeClose := func(name string, c io.Closer) { err := c.Close() if err == nil { return } // Do not use %w for err as we don't want it to be unwrapped by callers. if retErr != nil { retErr = fmt.Errorf(" (%s: %s): %w", name, err.Error(), retErr) } else { retErr = fmt.Errorf(" (%s: %s)", name, err.Error()) } } publicDest, err := destRef.NewImageDestination(ctx, options.DestinationCtx) if err != nil { return nil, fmt.Errorf("initializing destination %s: %w", transports.ImageName(destRef), err) } dest := imagedestination.FromPublic(publicDest) defer safeClose("dest", dest) publicRawSource, err := srcRef.NewImageSource(ctx, options.SourceCtx) if err != nil { return nil, fmt.Errorf("initializing source %s: %w", transports.ImageName(srcRef), err) } rawSource := imagesource.FromPublic(publicRawSource) defer safeClose("src", rawSource) // If reportWriter is not a TTY (e.g., when piping to a file), do not // print the progress bars to avoid long and hard to parse output. // Instead use printCopyInfo() to print single line "Copying ..." messages. progressOutput := reportWriter if !isTTY(reportWriter) { progressOutput = io.Discard } c := &copier{ policyContext: policyContext, dest: dest, rawSource: rawSource, options: options, reportWriter: reportWriter, progressOutput: progressOutput, unparsedToplevel: image.UnparsedInstance(rawSource, nil), // FIXME? The cache is used for sources and destinations equally, but we only have a SourceCtx and DestinationCtx. // For now, use DestinationCtx (because blob reuse changes the behavior of the destination side more). // Conceptually the cache settings should be in copy.Options instead. blobInfoCache: internalblobinfocache.FromBlobInfoCache(blobinfocache.DefaultCache(options.DestinationCtx)), } defer c.close() c.blobInfoCache.Open() defer c.blobInfoCache.Close() // Set the concurrentBlobCopiesSemaphore if we can copy layers in parallel. if dest.HasThreadSafePutBlob() && rawSource.HasThreadSafeGetBlob() { c.concurrentBlobCopiesSemaphore = c.options.ConcurrentBlobCopiesSemaphore if c.concurrentBlobCopiesSemaphore == nil { max := c.options.MaxParallelDownloads if max == 0 { max = maxParallelDownloads } c.concurrentBlobCopiesSemaphore = semaphore.NewWeighted(int64(max)) } } else { c.concurrentBlobCopiesSemaphore = semaphore.NewWeighted(int64(1)) if c.options.ConcurrentBlobCopiesSemaphore != nil { if err := c.options.ConcurrentBlobCopiesSemaphore.Acquire(ctx, 1); err != nil { return nil, fmt.Errorf("acquiring semaphore for concurrent blob copies: %w", err) } defer c.options.ConcurrentBlobCopiesSemaphore.Release(1) } } if err := c.setupSigners(); err != nil { return nil, err } multiImage, err := isMultiImage(ctx, c.unparsedToplevel) if err != nil { return nil, fmt.Errorf("determining manifest MIME type for %s: %w", transports.ImageName(srcRef), err) } if !multiImage { if len(options.EnsureCompressionVariantsExist) > 0 { return nil, fmt.Errorf("EnsureCompressionVariantsExist is not implemented when not creating a multi-architecture image") } requireCompressionFormatMatch, err := shouldRequireCompressionFormatMatch(options) if err != nil { return nil, err } // The simple case: just copy a single image. single, err := c.copySingleImage(ctx, c.unparsedToplevel, nil, copySingleImageOptions{requireCompressionFormatMatch: requireCompressionFormatMatch}) if err != nil { return nil, err } copiedManifest = single.manifest } else if c.options.ImageListSelection == CopySystemImage { if len(options.EnsureCompressionVariantsExist) > 0 { return nil, fmt.Errorf("EnsureCompressionVariantsExist is not implemented when not creating a multi-architecture image") } requireCompressionFormatMatch, err := shouldRequireCompressionFormatMatch(options) if err != nil { return nil, err } // This is a manifest list, and we weren't asked to copy multiple images. Choose a single image that // matches the current system to copy, and copy it. mfest, manifestType, err := c.unparsedToplevel.Manifest(ctx) if err != nil { return nil, fmt.Errorf("reading manifest for %s: %w", transports.ImageName(srcRef), err) } manifestList, err := internalManifest.ListFromBlob(mfest, manifestType) if err != nil { return nil, fmt.Errorf("parsing primary manifest as list for %s: %w", transports.ImageName(srcRef), err) } instanceDigest, err := manifestList.ChooseInstanceByCompression(c.options.SourceCtx, c.options.PreferGzipInstances) // try to pick one that matches c.options.SourceCtx if err != nil { return nil, fmt.Errorf("choosing an image from manifest list %s: %w", transports.ImageName(srcRef), err) } logrus.Debugf("Source is a manifest list; copying (only) instance %s for current system", instanceDigest) unparsedInstance := image.UnparsedInstance(rawSource, &instanceDigest) single, err := c.copySingleImage(ctx, unparsedInstance, nil, copySingleImageOptions{requireCompressionFormatMatch: requireCompressionFormatMatch}) if err != nil { return nil, fmt.Errorf("copying system image from manifest list: %w", err) } copiedManifest = single.manifest } else { /* c.options.ImageListSelection == CopyAllImages or c.options.ImageListSelection == CopySpecificImages, */ // If we were asked to copy multiple images and can't, that's an error. if !supportsMultipleImages(c.dest) { return nil, fmt.Errorf("copying multiple images: destination transport %q does not support copying multiple images as a group", destRef.Transport().Name()) } // Copy some or all of the images. switch c.options.ImageListSelection { case CopyAllImages: logrus.Debugf("Source is a manifest list; copying all instances") case CopySpecificImages: logrus.Debugf("Source is a manifest list; copying some instances") } if copiedManifest, err = c.copyMultipleImages(ctx); err != nil { return nil, err } } if options.ReportResolvedReference != nil { *options.ReportResolvedReference = nil // The default outcome, if not specifically supported by the transport. } if err := c.dest.CommitWithOptions(ctx, private.CommitOptions{ UnparsedToplevel: c.unparsedToplevel, ReportResolvedReference: options.ReportResolvedReference, Timestamp: options.DestinationTimestamp, }); err != nil { return nil, fmt.Errorf("committing the finished image: %w", err) } return copiedManifest, nil } // Printf writes a formatted string to c.reportWriter. // Note that the method name Printf is not entirely arbitrary: (go tool vet) // has a built-in list of functions/methods (whatever object they are for) // which have their format strings checked; for other names we would have // to pass a parameter to every (go tool vet) invocation. func (c *copier) Printf(format string, a ...any) { fmt.Fprintf(c.reportWriter, format, a...) } // close tears down state owned by copier. func (c *copier) close() { for i, s := range c.signersToClose { if err := s.Close(); err != nil { logrus.Warnf("Error closing per-copy signer %d: %v", i+1, err) } } } // validateImageListSelection returns an error if the passed-in value is not one that we recognize as a valid ImageListSelection value func validateImageListSelection(selection ImageListSelection) error { switch selection { case CopySystemImage, CopyAllImages, CopySpecificImages: return nil default: return fmt.Errorf("Invalid value for options.ImageListSelection: %d", selection) } } // Checks if the destination supports accepting multiple images by checking if it can support // manifest types that are lists of other manifests. func supportsMultipleImages(dest types.ImageDestination) bool { mtypes := dest.SupportedManifestMIMETypes() if len(mtypes) == 0 { // Anything goes! return true } return slices.ContainsFunc(mtypes, manifest.MIMETypeIsMultiImage) } // isTTY returns true if the io.Writer is a file and a tty. func isTTY(w io.Writer) bool { if f, ok := w.(*os.File); ok { return term.IsTerminal(int(f.Fd())) } return false } ================================================ FILE: vendor/go.podman.io/image/v5/copy/digesting_reader.go ================================================ package copy import ( "fmt" "hash" "io" digest "github.com/opencontainers/go-digest" ) type digestingReader struct { source io.Reader digester digest.Digester hash hash.Hash expectedDigest digest.Digest validationFailed bool validationSucceeded bool } // newDigestingReader returns an io.Reader implementation with contents of source, which will eventually return a non-EOF error // or set validationSucceeded/validationFailed to true if the source stream does/does not match expectedDigest. // (neither is set if EOF is never reached). func newDigestingReader(source io.Reader, expectedDigest digest.Digest) (*digestingReader, error) { var digester digest.Digester if err := expectedDigest.Validate(); err != nil { return nil, fmt.Errorf("invalid digest specification %q: %w", expectedDigest, err) } digestAlgorithm := expectedDigest.Algorithm() if !digestAlgorithm.Available() { return nil, fmt.Errorf("invalid digest specification %q: unsupported digest algorithm %q", expectedDigest, digestAlgorithm) } digester = digestAlgorithm.Digester() return &digestingReader{ source: source, digester: digester, hash: digester.Hash(), expectedDigest: expectedDigest, validationFailed: false, }, nil } func (d *digestingReader) Read(p []byte) (int, error) { n, err := d.source.Read(p) if n > 0 { if n2, err := d.hash.Write(p[:n]); n2 != n || err != nil { // Coverage: This should not happen, the hash.Hash interface requires // d.digest.Write to never return an error, and the io.Writer interface // requires n2 == len(input) if no error is returned. return 0, fmt.Errorf("updating digest during verification: %d vs. %d: %w", n2, n, err) } } if err == io.EOF { actualDigest := d.digester.Digest() if actualDigest != d.expectedDigest { d.validationFailed = true return 0, fmt.Errorf("Digest did not match, expected %s, got %s", d.expectedDigest, actualDigest) } d.validationSucceeded = true } return n, err } ================================================ FILE: vendor/go.podman.io/image/v5/copy/encryption.go ================================================ package copy import ( "fmt" "maps" "slices" "strings" "github.com/containers/ocicrypt" imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" "go.podman.io/image/v5/types" ) // isOciEncrypted returns a bool indicating if a mediatype is encrypted // This function will be moved to be part of OCI spec when adopted. func isOciEncrypted(mediatype string) bool { return strings.HasSuffix(mediatype, "+encrypted") } // isEncrypted checks if an image is encrypted func isEncrypted(i types.Image) bool { layers := i.LayerInfos() return slices.ContainsFunc(layers, func(l types.BlobInfo) bool { return isOciEncrypted(l.MediaType) }) } // bpDecryptionStepData contains data that the copy pipeline needs about the decryption step. type bpDecryptionStepData struct { decrypting bool // We are actually decrypting the stream } // blobPipelineDecryptionStep updates *stream to decrypt if, it necessary. // srcInfo is only used for error messages. // Returns data for other steps; the caller should eventually use updateCryptoOperation. func (ic *imageCopier) blobPipelineDecryptionStep(stream *sourceStream, srcInfo types.BlobInfo) (*bpDecryptionStepData, error) { if !isOciEncrypted(stream.info.MediaType) || ic.c.options.OciDecryptConfig == nil { return &bpDecryptionStepData{ decrypting: false, }, nil } if ic.cannotModifyManifestReason != "" { return nil, fmt.Errorf("layer %s should be decrypted, but we can’t modify the manifest: %s", srcInfo.Digest, ic.cannotModifyManifestReason) } desc := imgspecv1.Descriptor{ Annotations: stream.info.Annotations, } // DecryptLayer supposedly returns a digest of the decrypted stream. // In practice, that value is never set in the current implementation. // And we shouldn’t use it anyway, because it is not trusted: encryption can be made to a public key, // i.e. it doesn’t authenticate the origin of the metadata in any way. reader, _, err := ocicrypt.DecryptLayer(ic.c.options.OciDecryptConfig, stream.reader, desc, false) if err != nil { return nil, fmt.Errorf("decrypting layer %s: %w", srcInfo.Digest, err) } stream.reader = reader stream.info.Digest = "" stream.info.Size = -1 maps.DeleteFunc(stream.info.Annotations, func(k string, _ string) bool { return strings.HasPrefix(k, "org.opencontainers.image.enc") }) return &bpDecryptionStepData{ decrypting: true, }, nil } // updateCryptoOperation sets *operation, if necessary. func (d *bpDecryptionStepData) updateCryptoOperation(operation *types.LayerCrypto) { if d.decrypting { *operation = types.Decrypt } } // bpEncryptionStepData contains data that the copy pipeline needs about the encryption step. type bpEncryptionStepData struct { encrypting bool // We are actually encrypting the stream finalizer ocicrypt.EncryptLayerFinalizer } // blobPipelineEncryptionStep updates *stream to encrypt if, it required by toEncrypt. // srcInfo is primarily used for error messages. // Returns data for other steps; the caller should eventually call updateCryptoOperationAndAnnotations. func (ic *imageCopier) blobPipelineEncryptionStep(stream *sourceStream, toEncrypt bool, srcInfo types.BlobInfo, decryptionStep *bpDecryptionStepData, ) (*bpEncryptionStepData, error) { if !toEncrypt || isOciEncrypted(srcInfo.MediaType) || ic.c.options.OciEncryptConfig == nil { return &bpEncryptionStepData{ encrypting: false, }, nil } if ic.cannotModifyManifestReason != "" { return nil, fmt.Errorf("layer %s should be encrypted, but we can’t modify the manifest: %s", srcInfo.Digest, ic.cannotModifyManifestReason) } var annotations map[string]string if !decryptionStep.decrypting { annotations = srcInfo.Annotations } desc := imgspecv1.Descriptor{ MediaType: srcInfo.MediaType, Digest: srcInfo.Digest, Size: srcInfo.Size, Annotations: annotations, } reader, finalizer, err := ocicrypt.EncryptLayer(ic.c.options.OciEncryptConfig, stream.reader, desc) if err != nil { return nil, fmt.Errorf("encrypting blob %s: %w", srcInfo.Digest, err) } stream.reader = reader stream.info.Digest = "" stream.info.Size = -1 return &bpEncryptionStepData{ encrypting: true, finalizer: finalizer, }, nil } // updateCryptoOperationAndAnnotations sets *operation and updates *annotations, if necessary. func (d *bpEncryptionStepData) updateCryptoOperationAndAnnotations(operation *types.LayerCrypto, annotations *map[string]string) error { if !d.encrypting { return nil } encryptAnnotations, err := d.finalizer() if err != nil { return fmt.Errorf("Unable to finalize encryption: %w", err) } *operation = types.Encrypt if *annotations == nil { *annotations = map[string]string{} } maps.Copy(*annotations, encryptAnnotations) return nil } ================================================ FILE: vendor/go.podman.io/image/v5/copy/manifest.go ================================================ package copy import ( "context" "errors" "fmt" "slices" "strings" v1 "github.com/opencontainers/image-spec/specs-go/v1" "github.com/sirupsen/logrus" internalManifest "go.podman.io/image/v5/internal/manifest" "go.podman.io/image/v5/internal/set" "go.podman.io/image/v5/manifest" compressiontypes "go.podman.io/image/v5/pkg/compression/types" "go.podman.io/image/v5/types" ) // preferredManifestMIMETypes lists manifest MIME types in order of our preference, if we can't use the original manifest and need to convert. // Prefer v2s2 to v2s1 because v2s2 does not need to be changed when uploading to a different location. // Include v2s1 signed but not v2s1 unsigned, because docker/distribution requires a signature even if the unsigned MIME type is used. var preferredManifestMIMETypes = []string{manifest.DockerV2Schema2MediaType, manifest.DockerV2Schema1SignedMediaType} // allManifestMIMETypes lists all possible manifest MIME types. var allManifestMIMETypes = []string{v1.MediaTypeImageManifest, manifest.DockerV2Schema2MediaType, manifest.DockerV2Schema1SignedMediaType, manifest.DockerV2Schema1MediaType} // orderedSet is a list of strings (MIME types or platform descriptors in our case), with each string appearing at most once. type orderedSet struct { list []string included *set.Set[string] } // newOrderedSet creates a correctly initialized orderedSet. // [Sometimes it would be really nice if Golang had constructors…] func newOrderedSet() *orderedSet { return &orderedSet{ list: []string{}, included: set.New[string](), } } // append adds s to the end of os, only if it is not included already. func (os *orderedSet) append(s string) { if !os.included.Contains(s) { os.list = append(os.list, s) os.included.Add(s) } } // determineManifestConversionInputs contains the inputs for determineManifestConversion. type determineManifestConversionInputs struct { srcMIMEType string // MIME type of the input manifest destSupportedManifestMIMETypes []string // MIME types supported by the destination, per types.ImageDestination.SupportedManifestMIMETypes() forceManifestMIMEType string // User’s choice of forced manifest MIME type requestedCompressionFormat *compressiontypes.Algorithm // Compression algorithm to use, if the user _explictily_ requested one. requiresOCIEncryption bool // Restrict to manifest formats that can support OCI encryption cannotModifyManifestReason string // The reason the manifest cannot be modified, or an empty string if it can } // manifestConversionPlan contains the decisions made by determineManifestConversion. type manifestConversionPlan struct { // The preferred manifest MIME type (whether we are converting to it or using it unmodified). // We compute this only to show it in error messages; without having to add this context // in an error message, we would be happy enough to know only that no conversion is needed. preferredMIMEType string preferredMIMETypeNeedsConversion bool // True if using preferredMIMEType requires a conversion step. otherMIMETypeCandidates []string // Other possible alternatives, in order } // determineManifestConversion returns a plan for what formats, and possibly conversions, to use based on in. func determineManifestConversion(in determineManifestConversionInputs) (manifestConversionPlan, error) { srcType := in.srcMIMEType normalizedSrcType := manifest.NormalizedMIMEType(srcType) if srcType != normalizedSrcType { logrus.Debugf("Source manifest MIME type %q, treating it as %q", srcType, normalizedSrcType) srcType = normalizedSrcType } destSupportedManifestMIMETypes := in.destSupportedManifestMIMETypes if in.forceManifestMIMEType != "" { destSupportedManifestMIMETypes = []string{in.forceManifestMIMEType} } if len(destSupportedManifestMIMETypes) == 0 { destSupportedManifestMIMETypes = allManifestMIMETypes } restrictiveCompressionRequired := in.requestedCompressionFormat != nil && !internalManifest.CompressionAlgorithmIsUniversallySupported(*in.requestedCompressionFormat) supportedByDest := set.New[string]() for _, t := range destSupportedManifestMIMETypes { if in.requiresOCIEncryption && !manifest.MIMETypeSupportsEncryption(t) { continue } if restrictiveCompressionRequired && !internalManifest.MIMETypeSupportsCompressionAlgorithm(t, *in.requestedCompressionFormat) { continue } supportedByDest.Add(t) } if supportedByDest.Empty() { if len(destSupportedManifestMIMETypes) == 0 { // Coverage: This should never happen, empty values were replaced by allManifestMIMETypes return manifestConversionPlan{}, errors.New("internal error: destSupportedManifestMIMETypes is empty") } // We know, and have verified, that destSupportedManifestMIMETypes is not empty, so some filtering of supported MIME types must have been involved. // destSupportedManifestMIMETypes has three possible origins: if in.forceManifestMIMEType != "" { // 1. forceManifestType specified switch { case in.requiresOCIEncryption && restrictiveCompressionRequired: return manifestConversionPlan{}, fmt.Errorf("compression using %s, and encryption, required together with format %s, which does not support both", in.requestedCompressionFormat.Name(), in.forceManifestMIMEType) case in.requiresOCIEncryption: return manifestConversionPlan{}, fmt.Errorf("encryption required together with format %s, which does not support encryption", in.forceManifestMIMEType) case restrictiveCompressionRequired: return manifestConversionPlan{}, fmt.Errorf("compression using %s required together with format %s, which does not support it", in.requestedCompressionFormat.Name(), in.forceManifestMIMEType) default: return manifestConversionPlan{}, errors.New("internal error: forceManifestMIMEType was rejected for an unknown reason") } } if len(in.destSupportedManifestMIMETypes) == 0 { // 2. destination accepts anything and we have chosen allManifestTypes if !restrictiveCompressionRequired { // Coverage: This should never happen. // If we have not rejected for encryption reasons, we must have rejected due to encryption, but // allManifestTypes includes OCI, which supports encryption. return manifestConversionPlan{}, errors.New("internal error: in.destSupportedManifestMIMETypes is empty but supportedByDest is empty as well") } // This can legitimately happen when the user asks for completely unsupported formats like Bzip2 or Xz. return manifestConversionPlan{}, fmt.Errorf("compression using %s required, but none of the known manifest formats support it", in.requestedCompressionFormat.Name()) } // 3. destination accepts a restricted list of mime types destMIMEList := strings.Join(destSupportedManifestMIMETypes, ", ") switch { case in.requiresOCIEncryption && restrictiveCompressionRequired: return manifestConversionPlan{}, fmt.Errorf("compression using %s, and encryption, required but the destination only supports MIME types [%s], none of which support both", in.requestedCompressionFormat.Name(), destMIMEList) case in.requiresOCIEncryption: return manifestConversionPlan{}, fmt.Errorf("encryption required but the destination only supports MIME types [%s], none of which support encryption", destMIMEList) case restrictiveCompressionRequired: return manifestConversionPlan{}, fmt.Errorf("compression using %s required but the destination only supports MIME types [%s], none of which support it", in.requestedCompressionFormat.Name(), destMIMEList) default: // Coverage: This should never happen, we only filter for in.requiresOCIEncryption || restrictiveCompressionRequired return manifestConversionPlan{}, errors.New("internal error: supportedByDest is empty but destSupportedManifestMIMETypes is not, and we are neither encrypting nor requiring a restrictive compression algorithm") } } // destSupportedManifestMIMETypes is a static guess; a particular registry may still only support a subset of the types. // So, build a list of types to try in order of decreasing preference. // FIXME? This treats manifest.DockerV2Schema1SignedMediaType and manifest.DockerV2Schema1MediaType as distinct, // although we are not really making any conversion, and it is very unlikely that a destination would support one but not the other. // In practice, schema1 is probably the lowest common denominator, so we would expect to try the first one of the MIME types // and never attempt the other one. prioritizedTypes := newOrderedSet() // First of all, prefer to keep the original manifest unmodified. if supportedByDest.Contains(srcType) { prioritizedTypes.append(srcType) } if in.cannotModifyManifestReason != "" { // We could also drop this check and have the caller // make the choice; it is already doing that to an extent, to improve error // messages. But it is nice to hide the “if we can't modify, do no conversion” // special case in here; the caller can then worry (or not) only about a good UI. logrus.Debugf("We can't modify the manifest, hoping for the best...") return manifestConversionPlan{ // Take our chances - FIXME? Or should we fail without trying? preferredMIMEType: srcType, otherMIMETypeCandidates: []string{}, }, nil } // Then use our list of preferred types. for _, t := range preferredManifestMIMETypes { if supportedByDest.Contains(t) { prioritizedTypes.append(t) } } // Finally, try anything else the destination supports. for _, t := range destSupportedManifestMIMETypes { if supportedByDest.Contains(t) { prioritizedTypes.append(t) } } logrus.Debugf("Manifest has MIME type %s, ordered candidate list [%s]", srcType, strings.Join(prioritizedTypes.list, ", ")) if len(prioritizedTypes.list) == 0 { // Coverage: destSupportedManifestMIMETypes and supportedByDest, which is a subset, is not empty (or we would have exited above), so this should never happen. return manifestConversionPlan{}, errors.New("Internal error: no candidate MIME types") } res := manifestConversionPlan{ preferredMIMEType: prioritizedTypes.list[0], otherMIMETypeCandidates: prioritizedTypes.list[1:], } res.preferredMIMETypeNeedsConversion = res.preferredMIMEType != srcType if !res.preferredMIMETypeNeedsConversion { logrus.Debugf("... will first try using the original manifest unmodified") } return res, nil } // isMultiImage returns true if img is a list of images func isMultiImage(ctx context.Context, img types.UnparsedImage) (bool, error) { _, mt, err := img.Manifest(ctx) if err != nil { return false, err } return manifest.MIMETypeIsMultiImage(mt), nil } // determineListConversion takes the current MIME type of a list of manifests, // the list of MIME types supported for a given destination, and a possible // forced value, and returns the MIME type to which we should convert the list // of manifests (regardless of whether we are converting to it or using it // unmodified) and a slice of other list types which might be supported by the // destination. func (c *copier) determineListConversion(currentListMIMEType string, destSupportedMIMETypes []string, forcedListMIMEType string) (string, []string, error) { // If there's no list of supported types, then anything we support is expected to be supported. if len(destSupportedMIMETypes) == 0 { destSupportedMIMETypes = manifest.SupportedListMIMETypes } // If we're forcing it, replace the list of supported types with the forced value. if forcedListMIMEType != "" { destSupportedMIMETypes = []string{forcedListMIMEType} } prioritizedTypes := newOrderedSet() // The first priority is the current type, if it's in the list, since that lets us avoid a // conversion that isn't strictly necessary. if slices.Contains(destSupportedMIMETypes, currentListMIMEType) { prioritizedTypes.append(currentListMIMEType) } // Pick out the other list types that we support. for _, t := range destSupportedMIMETypes { if manifest.MIMETypeIsMultiImage(t) { prioritizedTypes.append(t) } } logrus.Debugf("Manifest list has MIME type %q, ordered candidate list [%s]", currentListMIMEType, strings.Join(destSupportedMIMETypes, ", ")) if len(prioritizedTypes.list) == 0 { return "", nil, fmt.Errorf("destination does not support any supported manifest list types (%v)", manifest.SupportedListMIMETypes) } selectedType := prioritizedTypes.list[0] otherSupportedTypes := prioritizedTypes.list[1:] if selectedType != currentListMIMEType { logrus.Debugf("... will convert to %s first, and then try %v", selectedType, otherSupportedTypes) } else { logrus.Debugf("... will use the original manifest list type, and then try %v", otherSupportedTypes) } // Done. return selectedType, otherSupportedTypes, nil } ================================================ FILE: vendor/go.podman.io/image/v5/copy/multiple.go ================================================ package copy import ( "bytes" "context" "errors" "fmt" "maps" "slices" "sort" "strings" digest "github.com/opencontainers/go-digest" imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" "github.com/sirupsen/logrus" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/internal/image" internalManifest "go.podman.io/image/v5/internal/manifest" "go.podman.io/image/v5/internal/set" "go.podman.io/image/v5/manifest" "go.podman.io/image/v5/pkg/compression" ) type instanceCopyKind int const ( instanceCopyCopy instanceCopyKind = iota instanceCopyClone ) type instanceCopy struct { op instanceCopyKind sourceDigest digest.Digest // Fields which can be used by callers when operation // is `instanceCopyCopy` copyForceCompressionFormat bool // Fields which can be used by callers when operation // is `instanceCopyClone` cloneArtifactType string cloneCompressionVariant OptionCompressionVariant clonePlatform *imgspecv1.Platform cloneAnnotations map[string]string } // internal type only to make imgspecv1.Platform comparable type platformComparable struct { architecture string os string osVersion string osFeatures string variant string } // Converts imgspecv1.Platform to a comparable format. func platformV1ToPlatformComparable(platform *imgspecv1.Platform) platformComparable { if platform == nil { return platformComparable{} } osFeatures := slices.Clone(platform.OSFeatures) sort.Strings(osFeatures) return platformComparable{ architecture: platform.Architecture, os: platform.OS, // This is strictly speaking ambiguous, fields of OSFeatures can contain a ','. Probably good enough for now. osFeatures: strings.Join(osFeatures, ","), osVersion: platform.OSVersion, variant: platform.Variant, } } // platformCompressionMap prepares a mapping of platformComparable -> CompressionAlgorithmNames for given digests func platformCompressionMap(list internalManifest.List, instanceDigests []digest.Digest) (map[platformComparable]*set.Set[string], error) { res := make(map[platformComparable]*set.Set[string]) for _, instanceDigest := range instanceDigests { instanceDetails, err := list.Instance(instanceDigest) if err != nil { return nil, fmt.Errorf("getting details for instance %s: %w", instanceDigest, err) } platform := platformV1ToPlatformComparable(instanceDetails.ReadOnly.Platform) platformSet, ok := res[platform] if !ok { platformSet = set.New[string]() res[platform] = platformSet } platformSet.AddSeq(slices.Values(instanceDetails.ReadOnly.CompressionAlgorithmNames)) } return res, nil } func validateCompressionVariantExists(input []OptionCompressionVariant) error { for _, option := range input { _, err := compression.AlgorithmByName(option.Algorithm.Name()) if err != nil { return fmt.Errorf("invalid algorithm %q in option.EnsureCompressionVariantsExist: %w", option.Algorithm.Name(), err) } } return nil } // prepareInstanceCopies prepares a list of instances which needs to copied to the manifest list. func prepareInstanceCopies(list internalManifest.List, instanceDigests []digest.Digest, options *Options) ([]instanceCopy, error) { res := []instanceCopy{} if options.ImageListSelection == CopySpecificImages && len(options.EnsureCompressionVariantsExist) > 0 { // List can already contain compressed instance for a compression selected in `EnsureCompressionVariantsExist` // It's unclear what it means when `CopySpecificImages` includes an instance in options.Instances, // EnsureCompressionVariantsExist asks for an instance with some compression, // an instance with that compression already exists, but is not included in options.Instances. // We might define the semantics and implement this in the future. return res, fmt.Errorf("EnsureCompressionVariantsExist is not implemented for CopySpecificImages") } err := validateCompressionVariantExists(options.EnsureCompressionVariantsExist) if err != nil { return res, err } compressionsByPlatform, err := platformCompressionMap(list, instanceDigests) if err != nil { return nil, err } // Determine which specific images to copy (combining digest-based and platform-based selection) var specificImages *set.Set[digest.Digest] if options.ImageListSelection == CopySpecificImages { specificImages, err = determineSpecificImages(options, list) if err != nil { return nil, err } } for i, instanceDigest := range instanceDigests { if options.ImageListSelection == CopySpecificImages && !specificImages.Contains(instanceDigest) { logrus.Debugf("Skipping instance %s (%d/%d)", instanceDigest, i+1, len(instanceDigests)) continue } instanceDetails, err := list.Instance(instanceDigest) if err != nil { return res, fmt.Errorf("getting details for instance %s: %w", instanceDigest, err) } forceCompressionFormat, err := shouldRequireCompressionFormatMatch(options) if err != nil { return nil, err } res = append(res, instanceCopy{ op: instanceCopyCopy, sourceDigest: instanceDigest, copyForceCompressionFormat: forceCompressionFormat, }) platform := platformV1ToPlatformComparable(instanceDetails.ReadOnly.Platform) compressionList := compressionsByPlatform[platform] for _, compressionVariant := range options.EnsureCompressionVariantsExist { if !compressionList.Contains(compressionVariant.Algorithm.Name()) { res = append(res, instanceCopy{ op: instanceCopyClone, sourceDigest: instanceDigest, cloneArtifactType: instanceDetails.ReadOnly.ArtifactType, cloneCompressionVariant: compressionVariant, clonePlatform: instanceDetails.ReadOnly.Platform, cloneAnnotations: maps.Clone(instanceDetails.ReadOnly.Annotations), }) // add current compression to the list so that we don’t create duplicate clones compressionList.Add(compressionVariant.Algorithm.Name()) } } } return res, nil } // determineSpecificImages returns a set of images to copy based on the // Instances and InstancePlatforms fields of the passed-in options structure func determineSpecificImages(options *Options, updatedList internalManifest.List) (*set.Set[digest.Digest], error) { specificImages := set.NewWithValues(options.Instances...) if len(options.InstancePlatforms) > 0 { // Find ALL instances matching each platform specification (OS and Architecture) for _, filter := range options.InstancePlatforms { matched := false instanceDigests := updatedList.Instances() for _, instanceDigest := range instanceDigests { instanceDetails, err := updatedList.Instance(instanceDigest) if err != nil { return nil, fmt.Errorf("getting details for instance %s: %w", instanceDigest, err) } // Match the platform. We match nil platforms against empty filter values. instanceOS := "" instanceArch := "" if instanceDetails.ReadOnly.Platform != nil { instanceOS = instanceDetails.ReadOnly.Platform.OS instanceArch = instanceDetails.ReadOnly.Platform.Architecture } if instanceOS == filter.OS && instanceArch == filter.Architecture { specificImages.Add(instanceDigest) matched = true } } if !matched { return nil, fmt.Errorf("no instances found for platform %s/%s", filter.OS, filter.Architecture) } } } return specificImages, nil } // copyMultipleImages copies some or all of an image list's instances, using // c.policyContext to validate source image admissibility. func (c *copier) copyMultipleImages(ctx context.Context) (copiedManifest []byte, retErr error) { // Parse the list and get a copy of the original value after it's re-encoded. manifestList, manifestType, err := c.unparsedToplevel.Manifest(ctx) if err != nil { return nil, fmt.Errorf("reading manifest list: %w", err) } originalList, err := internalManifest.ListFromBlob(manifestList, manifestType) if err != nil { return nil, fmt.Errorf("parsing manifest list %q: %w", string(manifestList), err) } updatedList := originalList.CloneInternal() sigs, err := c.sourceSignatures(ctx, c.unparsedToplevel, "Getting image list signatures", "Checking if image list destination supports signatures") if err != nil { return nil, err } // If the destination is a digested reference, make a note of that, determine what digest value we're // expecting, and check that the source manifest matches it. destIsDigestedReference := false if named := c.dest.Reference().DockerReference(); named != nil { if digested, ok := named.(reference.Digested); ok { destIsDigestedReference = true matches, err := manifest.MatchesDigest(manifestList, digested.Digest()) if err != nil { return nil, fmt.Errorf("computing digest of source image's manifest: %w", err) } if !matches { return nil, errors.New("Digest of source image's manifest would not match destination reference") } } } // Determine if we're allowed to modify the manifest list. // If we can, set to the empty string. If we can't, set to the reason why. // Compare, and perhaps keep in sync with, the version in copySingleImage. cannotModifyManifestListReason := "" if len(sigs) > 0 { cannotModifyManifestListReason = "Would invalidate signatures" } if destIsDigestedReference { cannotModifyManifestListReason = "Destination specifies a digest" } if c.options.PreserveDigests { cannotModifyManifestListReason = "Instructed to preserve digests" } // Determine if we'll need to convert the manifest list to a different format. forceListMIMEType := c.options.ForceManifestMIMEType switch forceListMIMEType { case manifest.DockerV2Schema1MediaType, manifest.DockerV2Schema1SignedMediaType, manifest.DockerV2Schema2MediaType: forceListMIMEType = manifest.DockerV2ListMediaType case imgspecv1.MediaTypeImageManifest: forceListMIMEType = imgspecv1.MediaTypeImageIndex } // FIXME: This does not take into account cannotModifyManifestListReason. selectedListType, otherManifestMIMETypeCandidates, err := c.determineListConversion(manifestType, c.dest.SupportedManifestMIMETypes(), forceListMIMEType) if err != nil { return nil, fmt.Errorf("determining manifest list type to write to destination: %w", err) } if selectedListType != originalList.MIMEType() { if cannotModifyManifestListReason != "" { return nil, fmt.Errorf("Manifest list must be converted to type %q to be written to destination, but we cannot modify it: %q", selectedListType, cannotModifyManifestListReason) } } // Copy each image, or just the ones we want to copy, in turn. instanceDigests := updatedList.Instances() instanceEdits := []internalManifest.ListEdit{} instanceCopyList, err := prepareInstanceCopies(updatedList, instanceDigests, c.options) if err != nil { return nil, fmt.Errorf("preparing instances for copy: %w", err) } c.Printf("Copying %d images generated from %d images in list\n", len(instanceCopyList), len(instanceDigests)) for i, instance := range instanceCopyList { // Update instances to be edited by their `ListOperation` and // populate necessary fields. switch instance.op { case instanceCopyCopy: logrus.Debugf("Copying instance %s (%d/%d)", instance.sourceDigest, i+1, len(instanceCopyList)) c.Printf("Copying image %s (%d/%d)\n", instance.sourceDigest, i+1, len(instanceCopyList)) unparsedInstance := image.UnparsedInstance(c.rawSource, &instanceCopyList[i].sourceDigest) updated, err := c.copySingleImage(ctx, unparsedInstance, &instanceCopyList[i].sourceDigest, copySingleImageOptions{requireCompressionFormatMatch: instance.copyForceCompressionFormat}) if err != nil { return nil, fmt.Errorf("copying image %d/%d from manifest list: %w", i+1, len(instanceCopyList), err) } // Record the result of a possible conversion here. instanceEdits = append(instanceEdits, internalManifest.ListEdit{ ListOperation: internalManifest.ListOpUpdate, UpdateOldDigest: instance.sourceDigest, UpdateDigest: updated.manifestDigest, UpdateSize: int64(len(updated.manifest)), UpdateCompressionAlgorithms: updated.compressionAlgorithms, UpdateMediaType: updated.manifestMIMEType, }) case instanceCopyClone: logrus.Debugf("Replicating instance %s (%d/%d)", instance.sourceDigest, i+1, len(instanceCopyList)) c.Printf("Replicating image %s (%d/%d)\n", instance.sourceDigest, i+1, len(instanceCopyList)) unparsedInstance := image.UnparsedInstance(c.rawSource, &instanceCopyList[i].sourceDigest) updated, err := c.copySingleImage(ctx, unparsedInstance, &instanceCopyList[i].sourceDigest, copySingleImageOptions{ requireCompressionFormatMatch: true, compressionFormat: &instance.cloneCompressionVariant.Algorithm, compressionLevel: instance.cloneCompressionVariant.Level, }) if err != nil { return nil, fmt.Errorf("replicating image %d/%d from manifest list: %w", i+1, len(instanceCopyList), err) } // Record the result of a possible conversion here. instanceEdits = append(instanceEdits, internalManifest.ListEdit{ ListOperation: internalManifest.ListOpAdd, AddDigest: updated.manifestDigest, AddSize: int64(len(updated.manifest)), AddMediaType: updated.manifestMIMEType, AddArtifactType: instance.cloneArtifactType, AddPlatform: instance.clonePlatform, AddAnnotations: instance.cloneAnnotations, AddCompressionAlgorithms: updated.compressionAlgorithms, }) default: return nil, fmt.Errorf("copying image: invalid copy operation %d", instance.op) } } // Now reset the digest/size/types of the manifests in the list to account for any conversions that we made. if err = updatedList.EditInstances(instanceEdits, cannotModifyManifestListReason != ""); err != nil { return nil, fmt.Errorf("updating manifest list: %w", err) } // Iterate through supported list types, preferred format first. c.Printf("Writing manifest list to image destination\n") var errs []string for _, thisListType := range append([]string{selectedListType}, otherManifestMIMETypeCandidates...) { var attemptedList internalManifest.ListPublic = updatedList logrus.Debugf("Trying to use manifest list type %s…", thisListType) // Perform the list conversion, if we need one. if thisListType != updatedList.MIMEType() { attemptedList, err = updatedList.ConvertToMIMEType(thisListType) if err != nil { return nil, fmt.Errorf("converting manifest list to list with MIME type %q: %w", thisListType, err) } } // Check if the updates or a type conversion meaningfully changed the list of images // by serializing them both so that we can compare them. attemptedManifestList, err := attemptedList.Serialize() if err != nil { return nil, fmt.Errorf("encoding updated manifest list (%q: %#v): %w", updatedList.MIMEType(), updatedList.Instances(), err) } originalManifestList, err := originalList.Serialize() if err != nil { return nil, fmt.Errorf("encoding original manifest list for comparison (%q: %#v): %w", originalList.MIMEType(), originalList.Instances(), err) } // If we can't just use the original value, but we have to change it, flag an error. if !bytes.Equal(attemptedManifestList, originalManifestList) { if cannotModifyManifestListReason != "" { return nil, fmt.Errorf("Manifest list was edited, but we cannot modify it: %q", cannotModifyManifestListReason) } logrus.Debugf("Manifest list has been updated") } else { // We can just use the original value, so use it instead of the one we just rebuilt, so that we don't change the digest. attemptedManifestList = manifestList } // Save the manifest list. err = c.dest.PutManifest(ctx, attemptedManifestList, nil) if err != nil { logrus.Debugf("Upload of manifest list type %s failed: %v", thisListType, err) errs = append(errs, fmt.Sprintf("%s(%v)", thisListType, err)) continue } errs = nil manifestList = attemptedManifestList break } if errs != nil { return nil, fmt.Errorf("Uploading manifest list failed, attempted the following formats: %s", strings.Join(errs, ", ")) } // Sign the manifest list. newSigs, err := c.createSignatures(ctx, manifestList, c.options.SignIdentity) if err != nil { return nil, err } sigs = append(slices.Clone(sigs), newSigs...) c.Printf("Storing list signatures\n") if err := c.dest.PutSignaturesWithFormat(ctx, sigs, nil); err != nil { return nil, fmt.Errorf("writing signatures: %w", err) } return manifestList, nil } ================================================ FILE: vendor/go.podman.io/image/v5/copy/progress_bars.go ================================================ package copy import ( "context" "fmt" "io" "math" "time" "github.com/vbauerster/mpb/v8" "github.com/vbauerster/mpb/v8/decor" "go.podman.io/image/v5/internal/private" "go.podman.io/image/v5/types" ) // newProgressPool creates a *mpb.Progress. // The caller must eventually call pool.Wait() after the pool will no longer be updated. // NOTE: Every progress bar created within the progress pool must either successfully // complete or be aborted, or pool.Wait() will hang. That is typically done // using "defer bar.Abort(false)", which must be called BEFORE pool.Wait() is called. func (c *copier) newProgressPool() *mpb.Progress { return mpb.New(mpb.WithWidth(40), mpb.WithOutput(c.progressOutput)) } // customPartialBlobDecorFunc implements mpb.DecorFunc for the partial blobs retrieval progress bar func customPartialBlobDecorFunc(s decor.Statistics) string { current := decor.SizeB1024(s.Current) total := decor.SizeB1024(s.Total) refill := decor.SizeB1024(s.Refill) if s.Total == 0 { return fmt.Sprintf("%.1f / %.1f (skipped: %.1f)", current, total, refill) } // If we didn't do a partial fetch then let's not output a distracting ("skipped: 0.0b = 0.00%") if s.Refill == 0 { return fmt.Sprintf("%.1f / %.1f", current, total) } percentage := 100.0 * float64(s.Refill) / float64(s.Total) return fmt.Sprintf("%.1f / %.1f (skipped: %.1f = %.2f%%)", current, total, refill, percentage) } // progressBar wraps a *mpb.Bar, allowing us to add extra state and methods. type progressBar struct { *mpb.Bar originalSize int64 // or -1 if unknown } // createProgressBar creates a progressBar in pool. Note that if the copier's reportWriter // is io.Discard, the progress bar's output will be discarded. Callers may call printCopyInfo() // to print a single line instead. // // NOTE: Every progress bar created within a progress pool must either successfully // complete or be aborted, or pool.Wait() will hang. That is typically done // using "defer bar.Abort(false)", which must happen BEFORE pool.Wait() is called. // // As a convention, most users of progress bars should call mark100PercentComplete on full success; // by convention, we don't leave progress bars in partial state when fully done // (even if we copied much less data than anticipated). func (c *copier) createProgressBar(pool *mpb.Progress, partial bool, info types.BlobInfo, kind string, onComplete string) (*progressBar, error) { // shortDigestLen is the length of the digest used for blobs. const shortDigestLen = 12 if err := info.Digest.Validate(); err != nil { // digest.Digest.Encoded() panics on failure, so validate explicitly. return nil, err } prefix := fmt.Sprintf("Copying %s %s", kind, info.Digest.Encoded()) // Truncate the prefix (chopping of some part of the digest) to make all progress bars aligned in a column. maxPrefixLen := len("Copying blob ") + shortDigestLen if len(prefix) > maxPrefixLen { prefix = prefix[:maxPrefixLen] } // onComplete will replace prefix once the bar/spinner has completed onComplete = prefix + " " + onComplete // Use a normal progress bar when we know the size (i.e., size > 0). // Otherwise, use a spinner to indicate that something's happening. var bar *mpb.Bar if info.Size > 0 { if partial { bar = pool.AddBar(info.Size, mpb.BarFillerClearOnComplete(), mpb.PrependDecorators( decor.OnComplete(decor.Name(prefix), onComplete), ), mpb.AppendDecorators( decor.Any(customPartialBlobDecorFunc), ), ) } else { bar = pool.AddBar(info.Size, mpb.BarFillerClearOnComplete(), mpb.PrependDecorators( decor.OnComplete(decor.Name(prefix), onComplete), ), mpb.AppendDecorators( decor.OnComplete(decor.CountersKibiByte("%.1f / %.1f"), ""), decor.Name(" | "), decor.OnComplete(decor.EwmaSpeed(decor.SizeB1024(0), "% .1f", 30), ""), ), ) } } else { bar = pool.New(0, mpb.SpinnerStyle(".", "..", "...", "....", "").PositionLeft(), mpb.BarFillerClearOnComplete(), mpb.PrependDecorators( decor.OnComplete(decor.Name(prefix), onComplete), ), mpb.AppendDecorators( decor.OnComplete(decor.EwmaSpeed(decor.SizeB1024(0), "% .1f", 30), ""), ), ) } return &progressBar{ Bar: bar, originalSize: info.Size, }, nil } // printCopyInfo prints a "Copying ..." message on the copier if the output is // set to `io.Discard`. In that case, the progress bars won't be rendered but // we still want to indicate when blobs and configs are copied. func (c *copier) printCopyInfo(kind string, info types.BlobInfo) { if c.progressOutput == io.Discard { c.Printf("Copying %s %s\n", kind, info.Digest) } } // mark100PercentComplete marks the progress bars as 100% complete; // it may do so by possibly advancing the current state if it is below the known total. func (bar *progressBar) mark100PercentComplete() { if bar.originalSize > 0 { // We can't call bar.SetTotal even if we wanted to; the total can not be changed // after a progress bar is created with a definite total. bar.SetCurrent(bar.originalSize) // This triggers the completion condition. } else { // -1 = unknown size // 0 is somewhat of a special case: Unlike c/image, where 0 is a definite known // size (possible at least in theory), in mpb, zero-sized progress bars are treated // as unknown size, in particular they are not configured to be marked as // complete on bar.Current() reaching bar.total (because that would happen already // when creating the progress bar). // That means that we are both _allowed_ to call SetTotal, and we _have to_. bar.SetTotal(-1, true) // total < 0 = set it to bar.Current(), report it; and mark the bar as complete. } } // blobChunkAccessorProxy wraps a BlobChunkAccessor and updates a *progressBar // with the number of received bytes. type blobChunkAccessorProxy struct { wrapped private.BlobChunkAccessor // The underlying BlobChunkAccessor bar *progressBar // A progress bar updated with the number of bytes read so far } // GetBlobAt returns a sequential channel of readers that contain data for the requested // blob chunks, and a channel that might get a single error value. // The specified chunks must be not overlapping and sorted by their offset. // The readers must be fully consumed, in the order they are returned, before blocking // to read the next chunk. // If the Length for the last chunk is set to math.MaxUint64, then it // fully fetches the remaining data from the offset to the end of the blob. func (s *blobChunkAccessorProxy) GetBlobAt(ctx context.Context, info types.BlobInfo, chunks []private.ImageSourceChunk) (chan io.ReadCloser, chan error, error) { start := time.Now() rc, errs, err := s.wrapped.GetBlobAt(ctx, info, chunks) if err == nil { total := int64(0) for _, c := range chunks { // do not update the progress bar if there is a chunk with unknown length. if c.Length == math.MaxUint64 { return rc, errs, err } total += int64(c.Length) } s.bar.EwmaIncrInt64(total, time.Since(start)) } return rc, errs, err } ================================================ FILE: vendor/go.podman.io/image/v5/copy/progress_channel.go ================================================ package copy import ( "io" "time" "go.podman.io/image/v5/types" ) // progressReader is a reader that reports its progress to a types.ProgressProperties channel on an interval. type progressReader struct { source io.Reader channel chan<- types.ProgressProperties interval time.Duration artifact types.BlobInfo lastUpdate time.Time offset uint64 offsetUpdate uint64 } // newProgressReader creates a new progress reader for: // `source`: The source when internally reading bytes // `channel`: The reporter channel to which the progress will be sent // `interval`: The update interval to indicate how often the progress should update // `artifact`: The blob metadata which is currently being progressed func newProgressReader( source io.Reader, channel chan<- types.ProgressProperties, interval time.Duration, artifact types.BlobInfo, ) *progressReader { // The progress reader constructor informs the progress channel // that a new artifact will be read channel <- types.ProgressProperties{ Event: types.ProgressEventNewArtifact, Artifact: artifact, } return &progressReader{ source: source, channel: channel, interval: interval, artifact: artifact, lastUpdate: time.Now(), offset: 0, offsetUpdate: 0, } } // reportDone indicates to the internal channel that the progress has been // finished func (r *progressReader) reportDone() { r.channel <- types.ProgressProperties{ Event: types.ProgressEventDone, Artifact: r.artifact, Offset: r.offset, OffsetUpdate: r.offsetUpdate, } } // Read continuously reads bytes into the progress reader and reports the // status via the internal channel func (r *progressReader) Read(p []byte) (int, error) { n, err := r.source.Read(p) r.offset += uint64(n) r.offsetUpdate += uint64(n) // Fire the progress reader in the provided interval if time.Since(r.lastUpdate) > r.interval { r.channel <- types.ProgressProperties{ Event: types.ProgressEventRead, Artifact: r.artifact, Offset: r.offset, OffsetUpdate: r.offsetUpdate, } r.lastUpdate = time.Now() r.offsetUpdate = 0 } return n, err } ================================================ FILE: vendor/go.podman.io/image/v5/copy/sign.go ================================================ package copy import ( "context" "fmt" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/internal/private" internalsig "go.podman.io/image/v5/internal/signature" internalSigner "go.podman.io/image/v5/internal/signer" "go.podman.io/image/v5/signature/sigstore" "go.podman.io/image/v5/signature/simplesigning" "go.podman.io/image/v5/transports" ) // setupSigners initializes c.signers. func (c *copier) setupSigners() error { c.signers = append(c.signers, c.options.Signers...) // c.signersToClose is intentionally not updated with c.options.Signers. // We immediately append created signers to c.signers, and we rely on c.close() to clean them up; so we don’t need // to clean up any created signers on failure. if c.options.SignBy != "" { opts := []simplesigning.Option{ simplesigning.WithKeyFingerprint(c.options.SignBy), } if c.options.SignPassphrase != "" { opts = append(opts, simplesigning.WithPassphrase(c.options.SignPassphrase)) } signer, err := simplesigning.NewSigner(opts...) if err != nil { return err } c.signers = append(c.signers, signer) c.signersToClose = append(c.signersToClose, signer) } if c.options.SignBySigstorePrivateKeyFile != "" { signer, err := sigstore.NewSigner( sigstore.WithPrivateKeyFile(c.options.SignBySigstorePrivateKeyFile, c.options.SignSigstorePrivateKeyPassphrase), ) if err != nil { return err } c.signers = append(c.signers, signer) c.signersToClose = append(c.signersToClose, signer) } return nil } // sourceSignatures returns signatures from unparsedSource, // and verifies that they can be used (to avoid copying a large image when we // can tell in advance that it would ultimately fail) func (c *copier) sourceSignatures(ctx context.Context, unparsed private.UnparsedImage, gettingSignaturesMessage, checkingDestMessage string, ) ([]internalsig.Signature, error) { var sigs []internalsig.Signature if c.options.RemoveSignatures { sigs = []internalsig.Signature{} } else { c.Printf("%s\n", gettingSignaturesMessage) s, err := unparsed.UntrustedSignatures(ctx) if err != nil { return nil, fmt.Errorf("reading signatures: %w", err) } sigs = s } if len(sigs) != 0 { c.Printf("%s\n", checkingDestMessage) if err := c.dest.SupportsSignatures(ctx); err != nil { return nil, fmt.Errorf("Can not copy signatures to %s: %w", transports.ImageName(c.dest.Reference()), err) } } return sigs, nil } // createSignatures creates signatures for manifest and an optional identity. func (c *copier) createSignatures(ctx context.Context, manifest []byte, identity reference.Named) ([]internalsig.Signature, error) { if len(c.signers) == 0 { // We must exit early here, otherwise copies with no Docker reference wouldn’t be possible. return nil, nil } if identity != nil { if reference.IsNameOnly(identity) { return nil, fmt.Errorf("Sign identity must be a fully specified reference %s", identity.String()) } } else { identity = c.dest.Reference().DockerReference() if identity == nil { return nil, fmt.Errorf("Cannot determine canonical Docker reference for destination %s", transports.ImageName(c.dest.Reference())) } } res := make([]internalsig.Signature, 0, len(c.signers)) for signerIndex, signer := range c.signers { msg := internalSigner.ProgressMessage(signer) if len(c.signers) == 1 { c.Printf("Creating signature: %s\n", msg) } else { c.Printf("Creating signature %d: %s\n", signerIndex+1, msg) } newSig, err := internalSigner.SignImageManifest(ctx, signer, manifest, identity) if err != nil { if len(c.signers) == 1 { return nil, fmt.Errorf("creating signature: %w", err) } else { return nil, fmt.Errorf("creating signature %d: %w", signerIndex+1, err) } } res = append(res, newSig) } return res, nil } ================================================ FILE: vendor/go.podman.io/image/v5/copy/single.go ================================================ package copy import ( "bytes" "context" "errors" "fmt" "io" "iter" "maps" "reflect" "slices" "strings" "sync" digest "github.com/opencontainers/go-digest" imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" "github.com/sirupsen/logrus" "github.com/vbauerster/mpb/v8" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/internal/image" "go.podman.io/image/v5/internal/pkg/platform" "go.podman.io/image/v5/internal/private" "go.podman.io/image/v5/internal/set" "go.podman.io/image/v5/manifest" "go.podman.io/image/v5/pkg/compression" compressiontypes "go.podman.io/image/v5/pkg/compression/types" "go.podman.io/image/v5/transports" "go.podman.io/image/v5/types" chunkedToc "go.podman.io/storage/pkg/chunked/toc" ) // imageCopier tracks state specific to a single image (possibly an item of a manifest list) type imageCopier struct { c *copier manifestUpdates *types.ManifestUpdateOptions src *image.SourcedImage manifestConversionPlan manifestConversionPlan diffIDsAreNeeded bool cannotModifyManifestReason string // The reason the manifest cannot be modified, or an empty string if it can canSubstituteBlobs bool compressionFormat *compressiontypes.Algorithm // Compression algorithm to use, if the user explicitly requested one, or nil. compressionLevel *int requireCompressionFormatMatch bool } type copySingleImageOptions struct { requireCompressionFormatMatch bool compressionFormat *compressiontypes.Algorithm // Compression algorithm to use, if the user explicitly requested one, or nil. compressionLevel *int } // copySingleImageResult carries data produced by copySingleImage type copySingleImageResult struct { manifest []byte manifestMIMEType string manifestDigest digest.Digest compressionAlgorithms []compressiontypes.Algorithm } // copySingleImage copies a single (non-manifest-list) image unparsedImage, using c.policyContext to validate // source image admissibility. func (c *copier) copySingleImage(ctx context.Context, unparsedImage *image.UnparsedImage, targetInstance *digest.Digest, opts copySingleImageOptions) (copySingleImageResult, error) { // The caller is handling manifest lists; this could happen only if a manifest list contains a manifest list. // Make sure we fail cleanly in such cases. multiImage, err := isMultiImage(ctx, unparsedImage) if err != nil { // FIXME FIXME: How to name a reference for the sub-image? return copySingleImageResult{}, fmt.Errorf("determining manifest MIME type for %s: %w", transports.ImageName(unparsedImage.Reference()), err) } if multiImage { return copySingleImageResult{}, fmt.Errorf("Unexpectedly received a manifest list instead of a manifest for a single image") } // Please keep this policy check BEFORE reading any other information about the image. // (The multiImage check above only matches the MIME type, which we have received anyway. // Actual parsing of anything should be deferred.) if allowed, err := c.policyContext.IsRunningImageAllowed(ctx, unparsedImage); !allowed || err != nil { // Be paranoid and fail if either return value indicates so. return copySingleImageResult{}, fmt.Errorf("Source image rejected: %w", err) } src, err := image.FromUnparsedImage(ctx, c.options.SourceCtx, unparsedImage) if err != nil { return copySingleImageResult{}, fmt.Errorf("initializing image from source %s: %w", transports.ImageName(c.rawSource.Reference()), err) } // If the destination is a digested reference, make a note of that, determine what digest value we're // expecting, and check that the source manifest matches it. If the source manifest doesn't, but it's // one item from a manifest list that matches it, accept that as a match. destIsDigestedReference := false if named := c.dest.Reference().DockerReference(); named != nil { if digested, ok := named.(reference.Digested); ok { destIsDigestedReference = true matches, err := manifest.MatchesDigest(src.ManifestBlob, digested.Digest()) if err != nil { return copySingleImageResult{}, fmt.Errorf("computing digest of source image's manifest: %w", err) } if !matches { manifestList, _, err := c.unparsedToplevel.Manifest(ctx) if err != nil { return copySingleImageResult{}, fmt.Errorf("reading manifest from source image: %w", err) } matches, err = manifest.MatchesDigest(manifestList, digested.Digest()) if err != nil { return copySingleImageResult{}, fmt.Errorf("computing digest of source image's manifest: %w", err) } if !matches { return copySingleImageResult{}, errors.New("Digest of source image's manifest would not match destination reference") } } } } if err := prepareImageConfigForDest(ctx, c.options.DestinationCtx, src, c.dest); err != nil { return copySingleImageResult{}, err } sigs, err := c.sourceSignatures(ctx, src, "Getting image source signatures", "Checking if image destination supports signatures") if err != nil { return copySingleImageResult{}, err } // Determine if we're allowed to modify the manifest. // If we can, set to the empty string. If we can't, set to the reason why. // Compare, and perhaps keep in sync with, the version in copyMultipleImages. cannotModifyManifestReason := "" if len(sigs) > 0 { cannotModifyManifestReason = "Would invalidate signatures" } if destIsDigestedReference { cannotModifyManifestReason = "Destination specifies a digest" } if c.options.PreserveDigests { cannotModifyManifestReason = "Instructed to preserve digests" } ic := imageCopier{ c: c, manifestUpdates: &types.ManifestUpdateOptions{InformationOnly: types.ManifestUpdateInformation{Destination: c.dest}}, src: src, // manifestConversionPlan and diffIDsAreNeeded are computed later cannotModifyManifestReason: cannotModifyManifestReason, requireCompressionFormatMatch: opts.requireCompressionFormatMatch, } if opts.compressionFormat != nil { ic.compressionFormat = opts.compressionFormat ic.compressionLevel = opts.compressionLevel } else if c.options.DestinationCtx != nil { // Note that compressionFormat and compressionLevel can be nil. ic.compressionFormat = c.options.DestinationCtx.CompressionFormat ic.compressionLevel = c.options.DestinationCtx.CompressionLevel } // HACK: Don’t combine zstd:chunked and encryption. // zstd:chunked can only usefully be consumed using range requests of parts of the layer, which would require the encryption // to support decrypting arbitrary subsets of the stream. That’s plausible but not supported using the encryption API we have. // Also, the chunked metadata is exposed in annotations unencrypted, which reveals the TOC digest = layer identity without // encryption. (That can be determined from the unencrypted config anyway, but, still...) // // Ideally this should query a well-defined property of the compression algorithm (and $somehow determine the right fallback) instead of // hard-coding zstd:chunked / zstd. if ic.c.options.OciEncryptLayers != nil { format := ic.compressionFormat if format == nil { format = defaultCompressionFormat } if format.Name() == compressiontypes.ZstdChunkedAlgorithmName { if ic.requireCompressionFormatMatch { return copySingleImageResult{}, errors.New("explicitly requested to combine zstd:chunked with encryption, which is not beneficial; use plain zstd instead") } logrus.Warnf("Compression using zstd:chunked is not beneficial for encrypted layers, using plain zstd instead") ic.compressionFormat = &compression.Zstd } } // Decide whether we can substitute blobs with semantic equivalents: // - Don’t do that if we can’t modify the manifest at all // - Ensure _this_ copy sees exactly the intended data when either processing a signed image or signing it. // This may be too conservative, but for now, better safe than sorry, _especially_ on the len(c.signers) != 0 path: // The signature makes the content non-repudiable, so it very much matters that the signature is made over exactly what the user intended. // We do intend the RecordDigestUncompressedPair calls to only work with reliable data, but at least there’s a risk // that the compressed version coming from a third party may be designed to attack some other decompressor implementation, // and we would reuse and sign it. ic.canSubstituteBlobs = ic.cannotModifyManifestReason == "" && len(c.signers) == 0 if err := ic.updateEmbeddedDockerReference(); err != nil { return copySingleImageResult{}, err } destRequiresOciEncryption := (isEncrypted(src) && ic.c.options.OciDecryptConfig == nil) || c.options.OciEncryptLayers != nil ic.manifestConversionPlan, err = determineManifestConversion(determineManifestConversionInputs{ srcMIMEType: ic.src.ManifestMIMEType, destSupportedManifestMIMETypes: ic.c.dest.SupportedManifestMIMETypes(), forceManifestMIMEType: c.options.ForceManifestMIMEType, requestedCompressionFormat: ic.compressionFormat, requiresOCIEncryption: destRequiresOciEncryption, cannotModifyManifestReason: ic.cannotModifyManifestReason, }) if err != nil { return copySingleImageResult{}, err } // We set up this part of ic.manifestUpdates quite early, not just around the // code that calls copyUpdatedConfigAndManifest, so that other parts of the copy code // (e.g. the UpdatedImageNeedsLayerDiffIDs check just below) can make decisions based // on the expected destination format. if ic.manifestConversionPlan.preferredMIMETypeNeedsConversion { ic.manifestUpdates.ManifestMIMEType = ic.manifestConversionPlan.preferredMIMEType } // If src.UpdatedImageNeedsLayerDiffIDs(ic.manifestUpdates) will be true, it needs to be true by the time we get here. ic.diffIDsAreNeeded = src.UpdatedImageNeedsLayerDiffIDs(*ic.manifestUpdates) // If enabled, fetch and compare the destination's manifest. And as an optimization skip updating the destination iff equal if c.options.OptimizeDestinationImageAlreadyExists { shouldUpdateSigs := len(sigs) > 0 || len(c.signers) != 0 // TODO: Consider allowing signatures updates only and skipping the image's layers/manifest copy if possible noPendingManifestUpdates := ic.noPendingManifestUpdates() logrus.Debugf("Checking if we can skip copying: has signatures=%t, OCI encryption=%t, no manifest updates=%t, compression match required for reusing blobs=%t", shouldUpdateSigs, destRequiresOciEncryption, noPendingManifestUpdates, opts.requireCompressionFormatMatch) if !shouldUpdateSigs && !destRequiresOciEncryption && noPendingManifestUpdates && !ic.requireCompressionFormatMatch { matchedResult, err := ic.compareImageDestinationManifestEqual(ctx, targetInstance) if err != nil { logrus.Warnf("Failed to compare destination image manifest: %v", err) return copySingleImageResult{}, err } if matchedResult != nil { c.Printf("Skipping: image already present at destination\n") return *matchedResult, nil } } } compressionAlgos, err := ic.copyLayers(ctx) if err != nil { return copySingleImageResult{}, err } // With docker/distribution registries we do not know whether the registry accepts schema2 or schema1 only; // and at least with the OpenShift registry "acceptschema2" option, there is no way to detect the support // without actually trying to upload something and getting a types.ManifestTypeRejectedError. // So, try the preferred manifest MIME type with possibly-updated blob digests, media types, and sizes if // we're altering how they're compressed. If the process succeeds, fine… manifestBytes, manifestDigest, err := ic.copyUpdatedConfigAndManifest(ctx, targetInstance) wipResult := copySingleImageResult{ manifest: manifestBytes, manifestMIMEType: ic.manifestConversionPlan.preferredMIMEType, manifestDigest: manifestDigest, } if err != nil { logrus.Debugf("Writing manifest using preferred type %s failed: %v", ic.manifestConversionPlan.preferredMIMEType, err) // … if it fails, and the failure is either because the manifest is rejected by the registry, or // because we failed to create a manifest of the specified type because the specific manifest type // doesn't support the type of compression we're trying to use (e.g. docker v2s2 and zstd), we may // have other options available that could still succeed. var manifestTypeRejectedError types.ManifestTypeRejectedError var manifestLayerCompressionIncompatibilityError manifest.ManifestLayerCompressionIncompatibilityError isManifestRejected := errors.As(err, &manifestTypeRejectedError) isCompressionIncompatible := errors.As(err, &manifestLayerCompressionIncompatibilityError) if (!isManifestRejected && !isCompressionIncompatible) || len(ic.manifestConversionPlan.otherMIMETypeCandidates) == 0 { // We don’t have other options. // In principle the code below would handle this as well, but the resulting error message is fairly ugly. // Don’t bother the user with MIME types if we have no choice. return copySingleImageResult{}, err } // If the original MIME type is acceptable, determineManifestConversion always uses it as ic.manifestConversionPlan.preferredMIMEType. // So if we are here, we will definitely be trying to convert the manifest. // With ic.cannotModifyManifestReason != "", that would just be a string of repeated failures for the same reason, // so let’s bail out early and with a better error message. if ic.cannotModifyManifestReason != "" { return copySingleImageResult{}, fmt.Errorf("writing manifest failed and we cannot try conversions: %q: %w", cannotModifyManifestReason, err) } // errs is a list of errors when trying various manifest types. Also serves as an "upload succeeded" flag when set to nil. errs := []string{fmt.Sprintf("%s(%v)", ic.manifestConversionPlan.preferredMIMEType, err)} for _, manifestMIMEType := range ic.manifestConversionPlan.otherMIMETypeCandidates { logrus.Debugf("Trying to use manifest type %s…", manifestMIMEType) ic.manifestUpdates.ManifestMIMEType = manifestMIMEType attemptedManifest, attemptedManifestDigest, err := ic.copyUpdatedConfigAndManifest(ctx, targetInstance) if err != nil { logrus.Debugf("Upload of manifest type %s failed: %v", manifestMIMEType, err) errs = append(errs, fmt.Sprintf("%s(%v)", manifestMIMEType, err)) continue } // We have successfully uploaded a manifest. wipResult = copySingleImageResult{ manifest: attemptedManifest, manifestMIMEType: manifestMIMEType, manifestDigest: attemptedManifestDigest, } errs = nil // Mark this as a success so that we don't abort below. break } if errs != nil { return copySingleImageResult{}, fmt.Errorf("Uploading manifest failed, attempted the following formats: %s", strings.Join(errs, ", ")) } } if targetInstance != nil { targetInstance = &wipResult.manifestDigest } newSigs, err := c.createSignatures(ctx, wipResult.manifest, c.options.SignIdentity) if err != nil { return copySingleImageResult{}, err } sigs = append(slices.Clone(sigs), newSigs...) if len(sigs) > 0 { c.Printf("Storing signatures\n") if err := c.dest.PutSignaturesWithFormat(ctx, sigs, targetInstance); err != nil { return copySingleImageResult{}, fmt.Errorf("writing signatures: %w", err) } } wipResult.compressionAlgorithms = compressionAlgos res := wipResult // We are done return res, nil } // prepareImageConfigForDest enforces dest.MustMatchRuntimeOS and handles dest.NoteOriginalOCIConfig, if necessary. func prepareImageConfigForDest(ctx context.Context, sys *types.SystemContext, src types.Image, dest private.ImageDestination) error { ociConfig, configErr := src.OCIConfig(ctx) // Do not fail on configErr here, this might be an artifact // and maybe nothing needs this to be a container image and to process the config. if dest.MustMatchRuntimeOS() { if configErr != nil { return fmt.Errorf("parsing image configuration: %w", configErr) } wantedPlatforms := platform.WantedPlatforms(sys) if !slices.ContainsFunc(wantedPlatforms, func(wantedPlatform imgspecv1.Platform) bool { // For a transitional period, this might trigger warnings because the Variant // field was added to OCI config only recently. If this turns out to be too noisy, // revert this check to only look for (OS, Architecture). return platform.MatchesPlatform(ociConfig.Platform, wantedPlatform) }) { options := newOrderedSet() for _, p := range wantedPlatforms { options.append(fmt.Sprintf("%s+%s+%q", p.OS, p.Architecture, p.Variant)) } logrus.Infof("Image operating system mismatch: image uses OS %q+architecture %q+%q, expecting one of %q", ociConfig.OS, ociConfig.Architecture, ociConfig.Variant, strings.Join(options.list, ", ")) } } if err := dest.NoteOriginalOCIConfig(ociConfig, configErr); err != nil { return err } return nil } // updateEmbeddedDockerReference handles the Docker reference embedded in Docker schema1 manifests. func (ic *imageCopier) updateEmbeddedDockerReference() error { if ic.c.dest.IgnoresEmbeddedDockerReference() { return nil // Destination would prefer us not to update the embedded reference. } destRef := ic.c.dest.Reference().DockerReference() if destRef == nil { return nil // Destination does not care about Docker references } if !ic.src.EmbeddedDockerReferenceConflicts(destRef) { return nil // No reference embedded in the manifest, or it matches destRef already. } if ic.cannotModifyManifestReason != "" { return fmt.Errorf("Copying a schema1 image with an embedded Docker reference to %s (Docker reference %s) would change the manifest, which we cannot do: %q", transports.ImageName(ic.c.dest.Reference()), destRef.String(), ic.cannotModifyManifestReason) } ic.manifestUpdates.EmbeddedDockerReference = destRef return nil } func (ic *imageCopier) noPendingManifestUpdates() bool { return reflect.DeepEqual(*ic.manifestUpdates, types.ManifestUpdateOptions{InformationOnly: ic.manifestUpdates.InformationOnly}) } // compareImageDestinationManifestEqual compares the source and destination image manifests (reading the manifest from the // (possibly remote) destination). If they are equal, it returns a full copySingleImageResult, nil otherwise. func (ic *imageCopier) compareImageDestinationManifestEqual(ctx context.Context, targetInstance *digest.Digest) (*copySingleImageResult, error) { destImageSource, err := ic.c.dest.Reference().NewImageSource(ctx, ic.c.options.DestinationCtx) if err != nil { logrus.Debugf("Unable to create destination image %s source: %v", transports.ImageName(ic.c.dest.Reference()), err) return nil, nil } defer destImageSource.Close() destManifest, destManifestType, err := destImageSource.GetManifest(ctx, targetInstance) if err != nil { logrus.Debugf("Unable to get destination image %s/%s manifest: %v", transports.ImageName(destImageSource.Reference()), targetInstance, err) return nil, nil } if !bytes.Equal(ic.src.ManifestBlob, destManifest) { logrus.Debugf("Source and destination manifests differ") return nil, nil } logrus.Debugf("Destination already matches the source manifest") srcManifestDigest, err := manifest.Digest(ic.src.ManifestBlob) if err != nil { return nil, fmt.Errorf("calculating manifest digest: %w", err) } compressionAlgos := set.New[string]() for _, srcInfo := range ic.src.LayerInfos() { _, c, err := compressionEditsFromBlobInfo(srcInfo) if err != nil { return nil, err } if c != nil { compressionAlgos.Add(c.Name()) } } algos, err := algorithmsByNames(compressionAlgos.All()) if err != nil { return nil, err } // Destination and source manifests, types and digests should all be equivalent return ©SingleImageResult{ manifest: destManifest, manifestMIMEType: destManifestType, manifestDigest: srcManifestDigest, compressionAlgorithms: algos, }, nil } // copyLayers copies layers from ic.src/ic.c.rawSource to dest, using and updating ic.manifestUpdates if necessary and ic.cannotModifyManifestReason == "". func (ic *imageCopier) copyLayers(ctx context.Context) ([]compressiontypes.Algorithm, error) { srcInfos := ic.src.LayerInfos() updatedSrcInfos, err := ic.src.LayerInfosForCopy(ctx) if err != nil { return nil, err } srcInfosUpdated := false if updatedSrcInfos != nil && !reflect.DeepEqual(srcInfos, updatedSrcInfos) { if ic.cannotModifyManifestReason != "" { return nil, fmt.Errorf("Copying this image would require changing layer representation, which we cannot do: %q", ic.cannotModifyManifestReason) } srcInfos = updatedSrcInfos srcInfosUpdated = true } type copyLayerData struct { destInfo types.BlobInfo diffID digest.Digest err error } // The manifest is used to extract the information whether a given // layer is empty. man, err := manifest.FromBlob(ic.src.ManifestBlob, ic.src.ManifestMIMEType) if err != nil { return nil, err } manifestLayerInfos := man.LayerInfos() data := make([]copyLayerData, len(srcInfos)) copyLayerHelper := func(index int, srcLayer types.BlobInfo, toEncrypt bool, pool *mpb.Progress, srcRef reference.Named) { defer ic.c.concurrentBlobCopiesSemaphore.Release(1) cld := copyLayerData{} if !ic.c.options.DownloadForeignLayers && ic.c.dest.AcceptsForeignLayerURLs() && len(srcLayer.URLs) != 0 { // DiffIDs are, currently, needed only when converting from schema1. // In which case src.LayerInfos will not have URLs because schema1 // does not support them. if ic.diffIDsAreNeeded { cld.err = errors.New("getting DiffID for foreign layers is unimplemented") } else { cld.destInfo = srcLayer logrus.Debugf("Skipping foreign layer %q copy to %s", cld.destInfo.Digest, ic.c.dest.Reference().Transport().Name()) } } else { cld.destInfo, cld.diffID, cld.err = ic.copyLayer(ctx, srcLayer, toEncrypt, pool, index, srcRef, manifestLayerInfos[index].EmptyLayer) } data[index] = cld } // Decide which layers to encrypt layersToEncrypt := set.New[int]() if ic.c.options.OciEncryptLayers != nil { totalLayers := len(srcInfos) for _, l := range *ic.c.options.OciEncryptLayers { switch { case l >= 0 && l < totalLayers: layersToEncrypt.Add(l) case l < 0 && l+totalLayers >= 0: // Implies (l + totalLayers) < totalLayers layersToEncrypt.Add(l + totalLayers) // If l is negative, it is reverse indexed. default: return nil, fmt.Errorf("when choosing layers to encrypt, layer index %d out of range (%d layers exist)", l, totalLayers) } } if len(*ic.c.options.OciEncryptLayers) == 0 { // “encrypt all layers” for i := 0; i < len(srcInfos); i++ { layersToEncrypt.Add(i) } } } if err := func() error { // A scope for defer progressPool := ic.c.newProgressPool() defer progressPool.Wait() // Ensure we wait for all layers to be copied. progressPool.Wait() must not be called while any of the copyLayerHelpers interact with the progressPool. copyGroup := sync.WaitGroup{} defer copyGroup.Wait() for i, srcLayer := range srcInfos { if err := ic.c.concurrentBlobCopiesSemaphore.Acquire(ctx, 1); err != nil { // This can only fail with ctx.Err(), so no need to blame acquiring the semaphore. return fmt.Errorf("copying layer: %w", err) } copyGroup.Go(func() { copyLayerHelper(i, srcLayer, layersToEncrypt.Contains(i), progressPool, ic.c.rawSource.Reference().DockerReference()) }) } // A call to copyGroup.Wait() is done at this point by the defer above. return nil }(); err != nil { return nil, err } compressionAlgos := set.New[string]() destInfos := make([]types.BlobInfo, len(srcInfos)) diffIDs := make([]digest.Digest, len(srcInfos)) for i, cld := range data { if cld.err != nil { return nil, cld.err } if cld.destInfo.CompressionAlgorithm != nil { compressionAlgos.Add(cld.destInfo.CompressionAlgorithm.Name()) } destInfos[i] = cld.destInfo diffIDs[i] = cld.diffID } // WARNING: If you are adding new reasons to change ic.manifestUpdates, also update the // OptimizeDestinationImageAlreadyExists short-circuit conditions ic.manifestUpdates.InformationOnly.LayerInfos = destInfos if ic.diffIDsAreNeeded { ic.manifestUpdates.InformationOnly.LayerDiffIDs = diffIDs } if srcInfosUpdated || layerDigestsDiffer(srcInfos, destInfos) { ic.manifestUpdates.LayerInfos = destInfos } algos, err := algorithmsByNames(compressionAlgos.All()) if err != nil { return nil, err } return algos, nil } // layerDigestsDiffer returns true iff the digests in a and b differ (ignoring sizes and possible other fields) func layerDigestsDiffer(a, b []types.BlobInfo) bool { return !slices.EqualFunc(a, b, func(a, b types.BlobInfo) bool { return a.Digest == b.Digest }) } // copyUpdatedConfigAndManifest updates the image per ic.manifestUpdates, if necessary, // stores the resulting config and manifest to the destination, and returns the stored manifest // and its digest. func (ic *imageCopier) copyUpdatedConfigAndManifest(ctx context.Context, instanceDigest *digest.Digest) ([]byte, digest.Digest, error) { var pendingImage types.Image = ic.src if !ic.noPendingManifestUpdates() { if ic.cannotModifyManifestReason != "" { return nil, "", fmt.Errorf("Internal error: copy needs an updated manifest but that was known to be forbidden: %q", ic.cannotModifyManifestReason) } if !ic.diffIDsAreNeeded && ic.src.UpdatedImageNeedsLayerDiffIDs(*ic.manifestUpdates) { // We have set ic.diffIDsAreNeeded based on the preferred MIME type returned by determineManifestConversion. // So, this can only happen if we are trying to upload using one of the other MIME type candidates. // Because UpdatedImageNeedsLayerDiffIDs is true only when converting from s1 to s2, this case should only arise // when ic.c.dest.SupportedManifestMIMETypes() includes both s1 and s2, the upload using s1 failed, and we are now trying s2. // Supposedly s2-only registries do not exist or are extremely rare, so failing with this error message is good enough for now. // If handling such registries turns out to be necessary, we could compute ic.diffIDsAreNeeded based on the full list of manifest MIME type candidates. return nil, "", fmt.Errorf("Can not convert image to %s, preparing DiffIDs for this case is not supported", ic.manifestUpdates.ManifestMIMEType) } pi, err := ic.src.UpdatedImage(ctx, *ic.manifestUpdates) if err != nil { return nil, "", fmt.Errorf("creating an updated image manifest: %w", err) } pendingImage = pi } man, _, err := pendingImage.Manifest(ctx) if err != nil { return nil, "", fmt.Errorf("reading manifest: %w", err) } if err := ic.copyConfig(ctx, pendingImage); err != nil { return nil, "", err } ic.c.Printf("Writing manifest to image destination\n") manifestDigest, err := manifest.Digest(man) if err != nil { return nil, "", err } if instanceDigest != nil { instanceDigest = &manifestDigest } if err := ic.c.dest.PutManifest(ctx, man, instanceDigest); err != nil { logrus.Debugf("Error %v while writing manifest %q", err, string(man)) return nil, "", fmt.Errorf("writing manifest: %w", err) } return man, manifestDigest, nil } // copyConfig copies config.json, if any, from src to dest. func (ic *imageCopier) copyConfig(ctx context.Context, src types.Image) error { srcInfo := src.ConfigInfo() if srcInfo.Digest != "" { if err := ic.c.concurrentBlobCopiesSemaphore.Acquire(ctx, 1); err != nil { // This can only fail with ctx.Err(), so no need to blame acquiring the semaphore. return fmt.Errorf("copying config: %w", err) } defer ic.c.concurrentBlobCopiesSemaphore.Release(1) destInfo, err := func() (types.BlobInfo, error) { // A scope for defer progressPool := ic.c.newProgressPool() defer progressPool.Wait() bar, err := ic.c.createProgressBar(progressPool, false, srcInfo, "config", "done") if err != nil { return types.BlobInfo{}, err } defer bar.Abort(false) ic.c.printCopyInfo("config", srcInfo) configBlob, err := src.ConfigBlob(ctx) if err != nil { return types.BlobInfo{}, fmt.Errorf("reading config blob %s: %w", srcInfo.Digest, err) } destInfo, err := ic.copyBlobFromStream(ctx, bytes.NewReader(configBlob), srcInfo, nil, true, false, bar, -1, false) if err != nil { return types.BlobInfo{}, err } bar.mark100PercentComplete() return destInfo, nil }() if err != nil { return err } if destInfo.Digest != srcInfo.Digest { return fmt.Errorf("Internal error: copying uncompressed config blob %s changed digest to %s", srcInfo.Digest, destInfo.Digest) } } return nil } // diffIDResult contains both a digest value and an error from diffIDComputationGoroutine. // We could also send the error through the pipeReader, but this more cleanly separates the copying of the layer and the DiffID computation. type diffIDResult struct { digest digest.Digest err error } // compressionEditsFromBlobInfo returns a (CompressionOperation, CompressionAlgorithm) value pair suitable // for types.BlobInfo. func compressionEditsFromBlobInfo(srcInfo types.BlobInfo) (types.LayerCompression, *compressiontypes.Algorithm, error) { // This MIME type → compression mapping belongs in manifest-specific code in our manifest // package (but we should preferably replace/change UpdatedImage instead of productizing // this workaround). switch srcInfo.MediaType { case manifest.DockerV2Schema2LayerMediaType, imgspecv1.MediaTypeImageLayerGzip: return types.PreserveOriginal, &compression.Gzip, nil case imgspecv1.MediaTypeImageLayerZstd: tocDigest, err := chunkedToc.GetTOCDigest(srcInfo.Annotations) if err != nil { return types.PreserveOriginal, nil, err } if tocDigest != nil { return types.PreserveOriginal, &compression.ZstdChunked, nil } return types.PreserveOriginal, &compression.Zstd, nil case manifest.DockerV2SchemaLayerMediaTypeUncompressed, imgspecv1.MediaTypeImageLayer: return types.Decompress, nil, nil default: return types.PreserveOriginal, nil, nil } } // copyLayer copies a layer with srcInfo (with known Digest and Annotations and possibly known Size) in src to dest, perhaps (de/re/)compressing it, // and returns a complete blobInfo of the copied layer, and a value for LayerDiffIDs if diffIDIsNeeded // srcRef can be used as an additional hint to the destination during checking whether a layer can be reused but srcRef can be nil. func (ic *imageCopier) copyLayer(ctx context.Context, srcInfo types.BlobInfo, toEncrypt bool, pool *mpb.Progress, layerIndex int, srcRef reference.Named, emptyLayer bool) (types.BlobInfo, digest.Digest, error) { // If the srcInfo doesn't contain compression information, try to compute it from the // MediaType, which was either read from a manifest by way of LayerInfos() or constructed // by LayerInfosForCopy(), if it was supplied at all. If we succeed in copying the blob, // the BlobInfo we return will be passed to UpdatedImage() and then to UpdateLayerInfos(), // which uses the compression information to compute the updated MediaType values. // (Sadly UpdatedImage() is documented to not update MediaTypes from // ManifestUpdateOptions.LayerInfos[].MediaType, so we are doing it indirectly.) if srcInfo.CompressionOperation == types.PreserveOriginal && srcInfo.CompressionAlgorithm == nil { op, algo, err := compressionEditsFromBlobInfo(srcInfo) if err != nil { return types.BlobInfo{}, "", err } srcInfo.CompressionOperation = op srcInfo.CompressionAlgorithm = algo } ic.c.printCopyInfo("blob", srcInfo) diffIDIsNeeded := false var cachedDiffID digest.Digest = "" if ic.diffIDsAreNeeded { cachedDiffID = ic.c.blobInfoCache.UncompressedDigest(srcInfo.Digest) // May be "" diffIDIsNeeded = cachedDiffID == "" } // When encrypting to decrypting, only use the simple code path. We might be able to optimize more // (e.g. if we know the DiffID of an encrypted compressed layer, it might not be necessary to pull, decrypt and decompress again), // but it’s not trivially safe to do such things, so until someone takes the effort to make a comprehensive argument, let’s not. encryptingOrDecrypting := toEncrypt || (isOciEncrypted(srcInfo.MediaType) && ic.c.options.OciDecryptConfig != nil) canAvoidProcessingCompleteLayer := !diffIDIsNeeded && !encryptingOrDecrypting // Don’t read the layer from the source if we already have the blob, and optimizations are acceptable. if canAvoidProcessingCompleteLayer { canChangeLayerCompression := ic.src.CanChangeLayerCompression(srcInfo.MediaType) logrus.Debugf("Checking if we can reuse blob %s: general substitution = %v, compression for MIME type %q = %v", srcInfo.Digest, ic.canSubstituteBlobs, srcInfo.MediaType, canChangeLayerCompression) canSubstitute := ic.canSubstituteBlobs && canChangeLayerCompression var requiredCompression *compressiontypes.Algorithm if ic.requireCompressionFormatMatch { requiredCompression = ic.compressionFormat } var tocDigest digest.Digest // Check if we have a chunked layer in storage that's based on that blob. These layers are stored by their TOC digest. d, err := chunkedToc.GetTOCDigest(srcInfo.Annotations) if err != nil { return types.BlobInfo{}, "", err } if d != nil { tocDigest = *d } reused, reusedBlob, err := ic.c.dest.TryReusingBlobWithOptions(ctx, srcInfo, private.TryReusingBlobOptions{ Cache: ic.c.blobInfoCache, CanSubstitute: canSubstitute, EmptyLayer: emptyLayer, LayerIndex: &layerIndex, SrcRef: srcRef, PossibleManifestFormats: append([]string{ic.manifestConversionPlan.preferredMIMEType}, ic.manifestConversionPlan.otherMIMETypeCandidates...), RequiredCompression: requiredCompression, OriginalCompression: srcInfo.CompressionAlgorithm, TOCDigest: tocDigest, }) if err != nil { return types.BlobInfo{}, "", fmt.Errorf("trying to reuse blob %s at destination: %w", srcInfo.Digest, err) } if reused { logrus.Debugf("Skipping blob %s (already present):", srcInfo.Digest) if err := func() error { // A scope for defer label := "skipped: already exists" if reusedBlob.MatchedByTOCDigest { label = "skipped: already exists (found by TOC)" } bar, err := ic.c.createProgressBar(pool, false, types.BlobInfo{Digest: reusedBlob.Digest, Size: 0}, "blob", label) if err != nil { return err } defer bar.Abort(false) bar.mark100PercentComplete() return nil }(); err != nil { return types.BlobInfo{}, "", err } // Throw an event that the layer has been skipped if ic.c.options.Progress != nil && ic.c.options.ProgressInterval > 0 { ic.c.options.Progress <- types.ProgressProperties{ Event: types.ProgressEventSkipped, Artifact: srcInfo, } } return updatedBlobInfoFromReuse(srcInfo, reusedBlob), cachedDiffID, nil } } // A partial pull is managed by the destination storage, that decides what portions // of the source file are not known yet and must be fetched. // Attempt a partial only when the source allows to retrieve a blob partially and // the destination has support for it. if canAvoidProcessingCompleteLayer && ic.c.rawSource.SupportsGetBlobAt() && ic.c.dest.SupportsPutBlobPartial() { reused, blobInfo, err := func() (bool, types.BlobInfo, error) { // A scope for defer bar, err := ic.c.createProgressBar(pool, true, srcInfo, "blob", "done") if err != nil { return false, types.BlobInfo{}, err } hideProgressBar := true defer func() { // Note that this is not the same as defer bar.Abort(hideProgressBar); we need hideProgressBar to be evaluated lazily. bar.Abort(hideProgressBar) }() proxy := blobChunkAccessorProxy{ wrapped: ic.c.rawSource, bar: bar, } uploadedBlob, err := ic.c.dest.PutBlobPartial(ctx, &proxy, srcInfo, private.PutBlobPartialOptions{ Cache: ic.c.blobInfoCache, EmptyLayer: emptyLayer, LayerIndex: layerIndex, }) if err == nil { if srcInfo.Size != -1 { refill := srcInfo.Size - bar.Current() bar.SetCurrent(srcInfo.Size) bar.SetRefill(refill) } bar.mark100PercentComplete() hideProgressBar = false logrus.Debugf("Retrieved partial blob %v", srcInfo.Digest) return true, updatedBlobInfoFromUpload(srcInfo, uploadedBlob), nil } // On a "partial content not available" error, ignore it and retrieve the whole layer. var perr private.ErrFallbackToOrdinaryLayerDownload if errors.As(err, &perr) { logrus.Debugf("Failed to retrieve partial blob: %v", err) return false, types.BlobInfo{}, nil } return false, types.BlobInfo{}, err }() if err != nil { return types.BlobInfo{}, "", fmt.Errorf("partial pull of blob %s: %w", srcInfo.Digest, err) } if reused { return blobInfo, cachedDiffID, nil } } // Fallback: copy the layer, computing the diffID if we need to do so return func() (types.BlobInfo, digest.Digest, error) { // A scope for defer bar, err := ic.c.createProgressBar(pool, false, srcInfo, "blob", "done") if err != nil { return types.BlobInfo{}, "", err } defer bar.Abort(false) srcStream, srcBlobSize, err := ic.c.rawSource.GetBlob(ctx, srcInfo, ic.c.blobInfoCache) if err != nil { return types.BlobInfo{}, "", fmt.Errorf("reading blob %s: %w", srcInfo.Digest, err) } defer srcStream.Close() blobInfo, diffIDChan, err := ic.copyLayerFromStream(ctx, srcStream, types.BlobInfo{Digest: srcInfo.Digest, Size: srcBlobSize, MediaType: srcInfo.MediaType, Annotations: srcInfo.Annotations}, diffIDIsNeeded, toEncrypt, bar, layerIndex, emptyLayer) if err != nil { return types.BlobInfo{}, "", err } diffID := cachedDiffID if diffIDIsNeeded { select { case <-ctx.Done(): return types.BlobInfo{}, "", ctx.Err() case diffIDResult := <-diffIDChan: if diffIDResult.err != nil { return types.BlobInfo{}, "", fmt.Errorf("computing layer DiffID: %w", diffIDResult.err) } logrus.Debugf("Computed DiffID %s for layer %s", diffIDResult.digest, srcInfo.Digest) // Don’t record any associations that involve encrypted data. This is a bit crude, // some blob substitutions (replacing pulls of encrypted data with local reuse of known decryption outcomes) // might be safe, but it’s not trivially obvious, so let’s be conservative for now. // This crude approach also means we don’t need to record whether a blob is encrypted // in the blob info cache (which would probably be necessary for any more complex logic), // and the simplicity is attractive. if !encryptingOrDecrypting { // This is safe because we have just computed diffIDResult.Digest ourselves, and in the process // we have read all of the input blob, so srcInfo.Digest must have been validated by digestingReader. ic.c.blobInfoCache.RecordDigestUncompressedPair(srcInfo.Digest, diffIDResult.digest) } diffID = diffIDResult.digest } } bar.mark100PercentComplete() return blobInfo, diffID, nil }() } // updatedBlobInfoFromReuse returns inputInfo updated with reusedBlob which was created based on inputInfo. func updatedBlobInfoFromReuse(inputInfo types.BlobInfo, reusedBlob private.ReusedBlob) types.BlobInfo { // The transport is only tasked with finding the blob, determining its size if necessary, and returning the right // compression format if the blob was substituted. // Handling of compression, encryption, and the related MIME types and the like are all the responsibility // of the generic code in this package. res := types.BlobInfo{ Digest: reusedBlob.Digest, Size: reusedBlob.Size, URLs: nil, // This _must_ be cleared if Digest changes; clear it in other cases as well, to preserve previous behavior. // FIXME: This should remove zstd:chunked annotations IF the original was chunked and the new one isn’t // (but those annotations being left with incorrect values should not break pulls). Annotations: maps.Clone(inputInfo.Annotations), MediaType: inputInfo.MediaType, // Mostly irrelevant, MediaType is updated based on Compression*/CryptoOperation. CompressionOperation: reusedBlob.CompressionOperation, CompressionAlgorithm: reusedBlob.CompressionAlgorithm, CryptoOperation: inputInfo.CryptoOperation, // Expected to be unset anyway. } // The transport is only expected to fill CompressionOperation and CompressionAlgorithm // if the blob was substituted; otherwise, it is optional, and if not set, fill it in based // on what we know from the srcInfos we were given. if reusedBlob.Digest == inputInfo.Digest { if res.CompressionOperation == types.PreserveOriginal { res.CompressionOperation = inputInfo.CompressionOperation } if res.CompressionAlgorithm == nil { res.CompressionAlgorithm = inputInfo.CompressionAlgorithm } } if len(reusedBlob.CompressionAnnotations) != 0 { if res.Annotations == nil { res.Annotations = map[string]string{} } maps.Copy(res.Annotations, reusedBlob.CompressionAnnotations) } return res } // copyLayerFromStream is an implementation detail of copyLayer; mostly providing a separate “defer” scope. // it copies a blob with srcInfo (with known Digest and Annotations and possibly known Size) from srcStream to dest, // perhaps (de/re/)compressing the stream, // and returns a complete blobInfo of the copied blob and perhaps a <-chan diffIDResult if diffIDIsNeeded, to be read by the caller. func (ic *imageCopier) copyLayerFromStream(ctx context.Context, srcStream io.Reader, srcInfo types.BlobInfo, diffIDIsNeeded bool, toEncrypt bool, bar *progressBar, layerIndex int, emptyLayer bool, ) (types.BlobInfo, <-chan diffIDResult, error) { var getDiffIDRecorder func(compressiontypes.DecompressorFunc) io.Writer // = nil var diffIDChan chan diffIDResult err := errors.New("Internal error: unexpected panic in copyLayer") // For pipeWriter.CloseWithbelow if diffIDIsNeeded { diffIDChan = make(chan diffIDResult, 1) // Buffered, so that sending a value after this or our caller has failed and exited does not block. pipeReader, pipeWriter := io.Pipe() defer func() { // Note that this is not the same as {defer pipeWriter.CloseWithError(err)}; we need err to be evaluated lazily. _ = pipeWriter.CloseWithError(err) // CloseWithError(nil) is equivalent to Close(), always returns nil }() getDiffIDRecorder = func(decompressor compressiontypes.DecompressorFunc) io.Writer { // If this fails, e.g. because we have exited and due to pipeWriter.CloseWithError() above further // reading from the pipe has failed, we don’t really care. // We only read from diffIDChan if the rest of the flow has succeeded, and when we do read from it, // the return value includes an error indication, which we do check. // // If this gets never called, pipeReader will not be used anywhere, but pipeWriter will only be // closed above, so we are happy enough with both pipeReader and pipeWriter to just get collected by GC. go diffIDComputationGoroutine(diffIDChan, pipeReader, decompressor) // Closes pipeReader return pipeWriter } } blobInfo, err := ic.copyBlobFromStream(ctx, srcStream, srcInfo, getDiffIDRecorder, false, toEncrypt, bar, layerIndex, emptyLayer) // Sets err to nil on success return blobInfo, diffIDChan, err // We need the defer … pipeWriter.CloseWithError() to happen HERE so that the caller can block on reading from diffIDChan } // diffIDComputationGoroutine reads all input from layerStream, uncompresses using decompressor if necessary, and sends its digest, and status, if any, to dest. func diffIDComputationGoroutine(dest chan<- diffIDResult, layerStream io.ReadCloser, decompressor compressiontypes.DecompressorFunc) { result := diffIDResult{ digest: "", err: errors.New("Internal error: unexpected panic in diffIDComputationGoroutine"), } defer func() { dest <- result }() defer layerStream.Close() // We do not care to bother the other end of the pipe with other failures; we send them to dest instead. result.digest, result.err = computeDiffID(layerStream, decompressor) } // computeDiffID reads all input from layerStream, uncompresses it using decompressor if necessary, and returns its digest. func computeDiffID(stream io.Reader, decompressor compressiontypes.DecompressorFunc) (digest.Digest, error) { if decompressor != nil { s, err := decompressor(stream) if err != nil { return "", err } defer s.Close() stream = s } return digest.Canonical.FromReader(stream) } // algorithmsByNames returns slice of Algorithms from a sequence of Algorithm Names func algorithmsByNames(names iter.Seq[string]) ([]compressiontypes.Algorithm, error) { result := []compressiontypes.Algorithm{} for name := range names { algo, err := compression.AlgorithmByName(name) if err != nil { return nil, err } result = append(result, algo) } return result, nil } ================================================ FILE: vendor/go.podman.io/image/v5/directory/directory_dest.go ================================================ package directory import ( "context" "errors" "fmt" "io" "os" "path/filepath" "runtime" "github.com/opencontainers/go-digest" "github.com/sirupsen/logrus" "go.podman.io/image/v5/internal/imagedestination/impl" "go.podman.io/image/v5/internal/imagedestination/stubs" "go.podman.io/image/v5/internal/private" "go.podman.io/image/v5/internal/putblobdigest" "go.podman.io/image/v5/internal/signature" "go.podman.io/image/v5/types" "go.podman.io/storage/pkg/fileutils" ) // ErrNotContainerImageDir indicates that the directory doesn't match the expected contents of a directory created // using the 'dir' transport var ErrNotContainerImageDir = errors.New("not a containers image directory, don't want to overwrite important data") type dirImageDestination struct { impl.Compat impl.PropertyMethodsInitialize stubs.IgnoresOriginalOCIConfig stubs.NoPutBlobPartialInitialize stubs.AlwaysSupportsSignatures ref dirReference usesNonSHA256Digest bool } // newImageDestination returns an ImageDestination for writing to a directory. func newImageDestination(sys *types.SystemContext, ref dirReference) (private.ImageDestination, error) { desiredLayerCompression := types.PreserveOriginal if sys != nil { if sys.DirForceCompress { desiredLayerCompression = types.Compress if sys.DirForceDecompress { return nil, fmt.Errorf("Cannot compress and decompress at the same time") } } if sys.DirForceDecompress { desiredLayerCompression = types.Decompress } } // If directory exists check if it is empty // if not empty, check whether the contents match that of a container image directory and overwrite the contents // if the contents don't match throw an error dirExists, err := pathExists(ref.resolvedPath) if err != nil { return nil, fmt.Errorf("checking for path %q: %w", ref.resolvedPath, err) } if dirExists { isEmpty, err := isDirEmpty(ref.resolvedPath) if err != nil { return nil, err } if !isEmpty { versionExists, err := pathExists(ref.versionPath()) if err != nil { return nil, fmt.Errorf("checking if path exists %q: %w", ref.versionPath(), err) } if versionExists { contents, err := os.ReadFile(ref.versionPath()) if err != nil { return nil, err } // check if contents of version file is what we expect it to be versionStr := string(contents) parsedVersion, err := parseVersion(versionStr) if err != nil { return nil, ErrNotContainerImageDir } if parsedVersion.isGreaterThan(maxSupportedVersion) { return nil, UnsupportedVersionError{Version: versionStr, Path: ref.resolvedPath} } } else { return nil, ErrNotContainerImageDir } // delete directory contents so that only one image is in the directory at a time if err = removeDirContents(ref.resolvedPath); err != nil { return nil, fmt.Errorf("erasing contents in %q: %w", ref.resolvedPath, err) } logrus.Debugf("overwriting existing container image directory %q", ref.resolvedPath) } } else { // create directory if it doesn't exist if err := os.MkdirAll(ref.resolvedPath, 0o755); err != nil { return nil, fmt.Errorf("unable to create directory %q: %w", ref.resolvedPath, err) } } d := &dirImageDestination{ PropertyMethodsInitialize: impl.PropertyMethods(impl.Properties{ SupportedManifestMIMETypes: nil, DesiredLayerCompression: desiredLayerCompression, AcceptsForeignLayerURLs: false, MustMatchRuntimeOS: false, IgnoresEmbeddedDockerReference: false, // N/A, DockerReference() returns nil. HasThreadSafePutBlob: true, }), NoPutBlobPartialInitialize: stubs.NoPutBlobPartial(ref), ref: ref, } d.Compat = impl.AddCompat(d) return d, nil } // Reference returns the reference used to set up this destination. Note that this should directly correspond to user's intent, // e.g. it should use the public hostname instead of the result of resolving CNAMEs or following redirects. func (d *dirImageDestination) Reference() types.ImageReference { return d.ref } // Close removes resources associated with an initialized ImageDestination, if any. func (d *dirImageDestination) Close() error { return nil } // PutBlobWithOptions writes contents of stream and returns data representing the result. // inputInfo.Digest can be optionally provided if known; if provided, and stream is read to the end without error, the digest MUST match the stream contents. // inputInfo.Size is the expected length of stream, if known. // inputInfo.MediaType describes the blob format, if known. // WARNING: The contents of stream are being verified on the fly. Until stream.Read() returns io.EOF, the contents of the data SHOULD NOT be available // to any other readers for download using the supplied digest. // If stream.Read() at any time, ESPECIALLY at end of input, returns an error, PutBlobWithOptions MUST 1) fail, and 2) delete any data stored so far. func (d *dirImageDestination) PutBlobWithOptions(ctx context.Context, stream io.Reader, inputInfo types.BlobInfo, options private.PutBlobOptions) (private.UploadedBlob, error) { blobFile, err := os.CreateTemp(d.ref.path, "dir-put-blob") if err != nil { return private.UploadedBlob{}, err } succeeded := false explicitClosed := false defer func() { if !explicitClosed { blobFile.Close() } if !succeeded { os.Remove(blobFile.Name()) } }() digester, stream := putblobdigest.DigestIfUnknown(stream, inputInfo) // TODO: This can take quite some time, and should ideally be cancellable using ctx.Done(). size, err := io.Copy(blobFile, stream) if err != nil { return private.UploadedBlob{}, err } blobDigest := digester.Digest() if blobDigest.Algorithm() != digest.Canonical { // compare the special case in layerPath d.usesNonSHA256Digest = true } if inputInfo.Size != -1 && size != inputInfo.Size { return private.UploadedBlob{}, fmt.Errorf("Size mismatch when copying %s, expected %d, got %d", blobDigest, inputInfo.Size, size) } if err := blobFile.Sync(); err != nil { return private.UploadedBlob{}, err } // On POSIX systems, blobFile was created with mode 0600, so we need to make it readable. // On Windows, the “permissions of newly created files” argument to syscall.Open is // ignored and the file is already readable; besides, blobFile.Chmod, i.e. syscall.Fchmod, // always fails on Windows. if runtime.GOOS != "windows" { if err := blobFile.Chmod(0o644); err != nil { return private.UploadedBlob{}, err } } blobPath, err := d.ref.layerPath(blobDigest) if err != nil { return private.UploadedBlob{}, err } // need to explicitly close the file, since a rename won't otherwise not work on Windows blobFile.Close() explicitClosed = true if err := os.Rename(blobFile.Name(), blobPath); err != nil { return private.UploadedBlob{}, err } succeeded = true return private.UploadedBlob{Digest: blobDigest, Size: size}, nil } // TryReusingBlobWithOptions checks whether the transport already contains, or can efficiently reuse, a blob, and if so, applies it to the current destination // (e.g. if the blob is a filesystem layer, this signifies that the changes it describes need to be applied again when composing a filesystem tree). // info.Digest must not be empty. // If the blob has been successfully reused, returns (true, info, nil). // If the transport can not reuse the requested blob, TryReusingBlob returns (false, {}, nil); it returns a non-nil error only on an unexpected failure. func (d *dirImageDestination) TryReusingBlobWithOptions(ctx context.Context, info types.BlobInfo, options private.TryReusingBlobOptions) (bool, private.ReusedBlob, error) { if !impl.OriginalCandidateMatchesTryReusingBlobOptions(options) { return false, private.ReusedBlob{}, nil } if info.Digest == "" { return false, private.ReusedBlob{}, fmt.Errorf("Can not check for a blob with unknown digest") } blobPath, err := d.ref.layerPath(info.Digest) if err != nil { return false, private.ReusedBlob{}, err } finfo, err := os.Stat(blobPath) if err != nil && os.IsNotExist(err) { return false, private.ReusedBlob{}, nil } if err != nil { return false, private.ReusedBlob{}, err } return true, private.ReusedBlob{Digest: info.Digest, Size: finfo.Size()}, nil } // PutManifest writes manifest to the destination. // If instanceDigest is not nil, it contains a digest of the specific manifest instance to write the manifest for (when // the primary manifest is a manifest list); this should always be nil if the primary manifest is not a manifest list. // It is expected but not enforced that the instanceDigest, when specified, matches the digest of `manifest` as generated // by `manifest.Digest()`. // FIXME? This should also receive a MIME type if known, to differentiate between schema versions. // If the destination is in principle available, refuses this manifest type (e.g. it does not recognize the schema), // but may accept a different manifest type, the returned error must be an ManifestTypeRejectedError. func (d *dirImageDestination) PutManifest(ctx context.Context, manifest []byte, instanceDigest *digest.Digest) error { if instanceDigest != nil && instanceDigest.Algorithm() != digest.Canonical { // compare the special case in manifestPath d.usesNonSHA256Digest = true } path, err := d.ref.manifestPath(instanceDigest) if err != nil { return err } return os.WriteFile(path, manifest, 0o644) } // PutSignaturesWithFormat writes a set of signatures to the destination. // If instanceDigest is not nil, it contains a digest of the specific manifest instance to write or overwrite the signatures for // (when the primary manifest is a manifest list); this should always be nil if the primary manifest is not a manifest list. // MUST be called after PutManifest (signatures may reference manifest contents). func (d *dirImageDestination) PutSignaturesWithFormat(ctx context.Context, signatures []signature.Signature, instanceDigest *digest.Digest) error { if instanceDigest != nil && instanceDigest.Algorithm() != digest.Canonical { // compare the special case in signaturePath d.usesNonSHA256Digest = true } for i, sig := range signatures { blob, err := signature.Blob(sig) if err != nil { return err } path, err := d.ref.signaturePath(i, instanceDigest) if err != nil { return err } if err := os.WriteFile(path, blob, 0o644); err != nil { return err } } return nil } // CommitWithOptions marks the process of storing the image as successful and asks for the image to be persisted. // WARNING: This does not have any transactional semantics: // - Uploaded data MAY be visible to others before CommitWithOptions() is called // - Uploaded data MAY be removed or MAY remain around if Close() is called without CommitWithOptions() (i.e. rollback is allowed but not guaranteed) func (d *dirImageDestination) CommitWithOptions(ctx context.Context, options private.CommitOptions) error { versionToWrite := version1_1 if d.usesNonSHA256Digest { versionToWrite = version1_2 } err := os.WriteFile(d.ref.versionPath(), []byte(versionToWrite.String()), 0o644) if err != nil { return fmt.Errorf("writing version file %q: %w", d.ref.versionPath(), err) } return nil } // returns true if path exists func pathExists(path string) (bool, error) { err := fileutils.Exists(path) if err == nil { return true, nil } if os.IsNotExist(err) { return false, nil } return false, err } // returns true if directory is empty func isDirEmpty(path string) (bool, error) { files, err := os.ReadDir(path) if err != nil { return false, err } return len(files) == 0, nil } // deletes the contents of a directory func removeDirContents(path string) error { files, err := os.ReadDir(path) if err != nil { return err } for _, file := range files { if err := os.RemoveAll(filepath.Join(path, file.Name())); err != nil { return err } } return nil } ================================================ FILE: vendor/go.podman.io/image/v5/directory/directory_src.go ================================================ package directory import ( "context" "fmt" "io" "os" "github.com/opencontainers/go-digest" "go.podman.io/image/v5/internal/imagesource/impl" "go.podman.io/image/v5/internal/imagesource/stubs" "go.podman.io/image/v5/internal/manifest" "go.podman.io/image/v5/internal/private" "go.podman.io/image/v5/internal/signature" "go.podman.io/image/v5/types" ) type dirImageSource struct { impl.Compat impl.PropertyMethodsInitialize impl.DoesNotAffectLayerInfosForCopy stubs.NoGetBlobAtInitialize ref dirReference } // newImageSource returns an ImageSource reading from an existing directory. // The caller must call .Close() on the returned ImageSource. func newImageSource(ref dirReference) (private.ImageSource, error) { versionPath := ref.versionPath() contents, err := os.ReadFile(versionPath) if err != nil { if !os.IsNotExist(err) { return nil, fmt.Errorf("reading version file %q: %w", versionPath, err) } } else { versionStr := string(contents) parsedVersion, err := parseVersion(versionStr) if err != nil { return nil, fmt.Errorf("invalid version file content: %q", versionStr) } if parsedVersion.isGreaterThan(maxSupportedVersion) { return nil, UnsupportedVersionError{Version: versionStr, Path: ref.resolvedPath} } } s := &dirImageSource{ PropertyMethodsInitialize: impl.PropertyMethods(impl.Properties{ HasThreadSafeGetBlob: false, }), NoGetBlobAtInitialize: stubs.NoGetBlobAt(ref), ref: ref, } s.Compat = impl.AddCompat(s) return s, nil } // Reference returns the reference used to set up this source, _as specified by the user_ // (not as the image itself, or its underlying storage, claims). This can be used e.g. to determine which public keys are trusted for this image. func (s *dirImageSource) Reference() types.ImageReference { return s.ref } // Close removes resources associated with an initialized ImageSource, if any. func (s *dirImageSource) Close() error { return nil } // GetManifest returns the image's manifest along with its MIME type (which may be empty when it can't be determined but the manifest is available). // It may use a remote (= slow) service. // If instanceDigest is not nil, it contains a digest of the specific manifest instance to retrieve (when the primary manifest is a manifest list); // this never happens if the primary manifest is not a manifest list (e.g. if the source never returns manifest lists). func (s *dirImageSource) GetManifest(ctx context.Context, instanceDigest *digest.Digest) ([]byte, string, error) { path, err := s.ref.manifestPath(instanceDigest) if err != nil { return nil, "", err } m, err := os.ReadFile(path) if err != nil { return nil, "", err } return m, manifest.GuessMIMEType(m), err } // GetBlob returns a stream for the specified blob, and the blob’s size (or -1 if unknown). // The Digest field in BlobInfo is guaranteed to be provided, Size may be -1 and MediaType may be optionally provided. // May update BlobInfoCache, preferably after it knows for certain that a blob truly exists at a specific location. func (s *dirImageSource) GetBlob(ctx context.Context, info types.BlobInfo, cache types.BlobInfoCache) (io.ReadCloser, int64, error) { path, err := s.ref.layerPath(info.Digest) if err != nil { return nil, -1, err } r, err := os.Open(path) if err != nil { return nil, -1, err } fi, err := r.Stat() if err != nil { return nil, -1, err } return r, fi.Size(), nil } // GetSignaturesWithFormat returns the image's signatures. It may use a remote (= slow) service. // If instanceDigest is not nil, it contains a digest of the specific manifest instance to retrieve signatures for // (when the primary manifest is a manifest list); this never happens if the primary manifest is not a manifest list // (e.g. if the source never returns manifest lists). func (s *dirImageSource) GetSignaturesWithFormat(ctx context.Context, instanceDigest *digest.Digest) ([]signature.Signature, error) { signatures := []signature.Signature{} for i := 0; ; i++ { path, err := s.ref.signaturePath(i, instanceDigest) if err != nil { return nil, err } sigBlob, err := os.ReadFile(path) if err != nil { if os.IsNotExist(err) { break } return nil, err } signature, err := signature.FromBlob(sigBlob) if err != nil { return nil, fmt.Errorf("parsing signature %q: %w", path, err) } signatures = append(signatures, signature) } return signatures, nil } ================================================ FILE: vendor/go.podman.io/image/v5/directory/directory_transport.go ================================================ package directory import ( "context" "errors" "fmt" "path/filepath" "strings" "github.com/opencontainers/go-digest" "go.podman.io/image/v5/directory/explicitfilepath" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/internal/image" "go.podman.io/image/v5/transports" "go.podman.io/image/v5/types" ) func init() { transports.Register(Transport) } // Transport is an ImageTransport for directory paths. var Transport = dirTransport{} type dirTransport struct{} func (t dirTransport) Name() string { return "dir" } // ParseReference converts a string, which should not start with the ImageTransport.Name prefix, into an ImageReference. func (t dirTransport) ParseReference(reference string) (types.ImageReference, error) { return NewReference(reference) } // ValidatePolicyConfigurationScope checks that scope is a valid name for a signature.PolicyTransportScopes keys // (i.e. a valid PolicyConfigurationIdentity() or PolicyConfigurationNamespaces() return value). // It is acceptable to allow an invalid value which will never be matched, it can "only" cause user confusion. // scope passed to this function will not be "", that value is always allowed. func (t dirTransport) ValidatePolicyConfigurationScope(scope string) error { if !strings.HasPrefix(scope, "/") { return fmt.Errorf("Invalid scope %s: Must be an absolute path", scope) } // Refuse also "/", otherwise "/" and "" would have the same semantics, // and "" could be unexpectedly shadowed by the "/" entry. if scope == "/" { return errors.New(`Invalid scope "/": Use the generic default scope ""`) } cleaned := filepath.Clean(scope) if cleaned != scope { return fmt.Errorf(`Invalid scope %s: Uses non-canonical format, perhaps try %s`, scope, cleaned) } return nil } // dirReference is an ImageReference for directory paths. type dirReference struct { // Note that the interpretation of paths below depends on the underlying filesystem state, which may change under us at any time! // Either of the paths may point to a different, or no, inode over time. resolvedPath may contain symbolic links, and so on. // Generally we follow the intent of the user, and use the "path" member for filesystem operations (e.g. the user can use a relative path to avoid // being exposed to symlinks and renames in the parent directories to the working directory). // (But in general, we make no attempt to be completely safe against concurrent hostile filesystem modifications.) path string // As specified by the user. May be relative, contain symlinks, etc. resolvedPath string // Absolute path with no symlinks, at least at the time of its creation. Primarily used for policy namespaces. } // There is no directory.ParseReference because it is rather pointless. // Callers who need a transport-independent interface will go through // dirTransport.ParseReference; callers who intentionally deal with directories // can use directory.NewReference. // NewReference returns a directory reference for a specified path. // // We do not expose an API supplying the resolvedPath; we could, but recomputing it // is generally cheap enough that we prefer being confident about the properties of resolvedPath. func NewReference(path string) (types.ImageReference, error) { resolved, err := explicitfilepath.ResolvePathToFullyExplicit(path) if err != nil { return nil, err } return dirReference{path: path, resolvedPath: resolved}, nil } func (ref dirReference) Transport() types.ImageTransport { return Transport } // StringWithinTransport returns a string representation of the reference, which MUST be such that // reference.Transport().ParseReference(reference.StringWithinTransport()) returns an equivalent reference. // NOTE: The returned string is not promised to be equal to the original input to ParseReference; // e.g. default attribute values omitted by the user may be filled in the return value, or vice versa. // WARNING: Do not use the return value in the UI to describe an image, it does not contain the Transport().Name() prefix. func (ref dirReference) StringWithinTransport() string { return ref.path } // DockerReference returns a Docker reference associated with this reference // (fully explicit, i.e. !reference.IsNameOnly, but reflecting user intent, // not e.g. after redirect or alias processing), or nil if unknown/not applicable. func (ref dirReference) DockerReference() reference.Named { return nil } // PolicyConfigurationIdentity returns a string representation of the reference, suitable for policy lookup. // This MUST reflect user intent, not e.g. after processing of third-party redirects or aliases; // The value SHOULD be fully explicit about its semantics, with no hidden defaults, AND canonical // (i.e. various references with exactly the same semantics should return the same configuration identity) // It is fine for the return value to be equal to StringWithinTransport(), and it is desirable but // not required/guaranteed that it will be a valid input to Transport().ParseReference(). // Returns "" if configuration identities for these references are not supported. func (ref dirReference) PolicyConfigurationIdentity() string { return ref.resolvedPath } // PolicyConfigurationNamespaces returns a list of other policy configuration namespaces to search // for if explicit configuration for PolicyConfigurationIdentity() is not set. The list will be processed // in order, terminating on first match, and an implicit "" is always checked at the end. // It is STRONGLY recommended for the first element, if any, to be a prefix of PolicyConfigurationIdentity(), // and each following element to be a prefix of the element preceding it. func (ref dirReference) PolicyConfigurationNamespaces() []string { res := []string{} path := ref.resolvedPath for { lastSlash := strings.LastIndex(path, "/") if lastSlash == -1 || lastSlash == 0 { break } path = path[:lastSlash] res = append(res, path) } // Note that we do not include "/"; it is redundant with the default "" global default, // and rejected by dirTransport.ValidatePolicyConfigurationScope above. return res } // NewImage returns a types.ImageCloser for this reference, possibly specialized for this ImageTransport. // The caller must call .Close() on the returned ImageCloser. // NOTE: If any kind of signature verification should happen, build an UnparsedImage from the value returned by NewImageSource, // verify that UnparsedImage, and convert it into a real Image via image.FromUnparsedImage. // WARNING: This may not do the right thing for a manifest list, see image.FromSource for details. func (ref dirReference) NewImage(ctx context.Context, sys *types.SystemContext) (types.ImageCloser, error) { return image.FromReference(ctx, sys, ref) } // NewImageSource returns a types.ImageSource for this reference. // The caller must call .Close() on the returned ImageSource. func (ref dirReference) NewImageSource(ctx context.Context, sys *types.SystemContext) (types.ImageSource, error) { return newImageSource(ref) } // NewImageDestination returns a types.ImageDestination for this reference. // The caller must call .Close() on the returned ImageDestination. func (ref dirReference) NewImageDestination(ctx context.Context, sys *types.SystemContext) (types.ImageDestination, error) { return newImageDestination(sys, ref) } // DeleteImage deletes the named image from the registry, if supported. func (ref dirReference) DeleteImage(ctx context.Context, sys *types.SystemContext) error { return errors.New("Deleting images not implemented for dir: images") } // manifestPath returns a path for the manifest within a directory using our conventions. func (ref dirReference) manifestPath(instanceDigest *digest.Digest) (string, error) { if instanceDigest != nil { if err := instanceDigest.Validate(); err != nil { // digest.Digest.Encoded() panics on failure, and could possibly result in a path with ../, so validate explicitly. return "", err } var filename string if instanceDigest.Algorithm() == digest.Canonical { filename = instanceDigest.Encoded() + ".manifest.json" } else { filename = instanceDigest.Algorithm().String() + "-" + instanceDigest.Encoded() + ".manifest.json" } return filepath.Join(ref.path, filename), nil } return filepath.Join(ref.path, "manifest.json"), nil } // layerPath returns a path for a layer tarball within a directory using our conventions. func (ref dirReference) layerPath(d digest.Digest) (string, error) { if err := d.Validate(); err != nil { // digest.Digest.Encoded() panics on failure, and could possibly result in a path with ../, so validate explicitly. return "", err } var filename string if d.Algorithm() == digest.Canonical { filename = d.Encoded() } else { filename = d.Algorithm().String() + "-" + d.Encoded() } return filepath.Join(ref.path, filename), nil } // signaturePath returns a path for a signature within a directory using our conventions. func (ref dirReference) signaturePath(index int, instanceDigest *digest.Digest) (string, error) { if instanceDigest != nil { if err := instanceDigest.Validate(); err != nil { // digest.Digest.Encoded() panics on failure, and could possibly result in a path with ../, so validate explicitly. return "", err } var prefix string if instanceDigest.Algorithm() == digest.Canonical { prefix = instanceDigest.Encoded() } else { prefix = instanceDigest.Algorithm().String() + "-" + instanceDigest.Encoded() } return filepath.Join(ref.path, fmt.Sprintf(prefix+".signature-%d", index+1)), nil } return filepath.Join(ref.path, fmt.Sprintf("signature-%d", index+1)), nil } // versionPath returns a path for the version file within a directory using our conventions. func (ref dirReference) versionPath() string { return filepath.Join(ref.path, "version") } ================================================ FILE: vendor/go.podman.io/image/v5/directory/explicitfilepath/path.go ================================================ package explicitfilepath import ( "fmt" "os" "path/filepath" "go.podman.io/storage/pkg/fileutils" ) // ResolvePathToFullyExplicit returns the input path converted to an absolute, no-symlinks, cleaned up path. // To do so, all elements of the input path must exist; as a special case, the final component may be // a non-existent name (but not a symlink pointing to a non-existent name) // This is intended as a helper for implementations of types.ImageReference.PolicyConfigurationIdentity etc. func ResolvePathToFullyExplicit(path string) (string, error) { switch err := fileutils.Lexists(path); { case err == nil: return resolveExistingPathToFullyExplicit(path) case os.IsNotExist(err): parent, file := filepath.Split(path) resolvedParent, err := resolveExistingPathToFullyExplicit(parent) if err != nil { return "", err } if file == "." || file == ".." { // Coverage: This can happen, but very rarely: if we have successfully resolved the parent, both "." and ".." in it should have been resolved as well. // This can still happen if there is a filesystem race condition, causing the Lstat() above to fail but the later resolution to succeed. // We do not care to promise anything if such filesystem race conditions can happen, but we definitely don't want to return "."/".." components // in the resulting path, and especially not at the end. return "", fmt.Errorf("Unexpectedly missing special filename component in %s", path) } resolvedPath := filepath.Join(resolvedParent, file) // As a sanity check, ensure that there are no "." or ".." components. cleanedResolvedPath := filepath.Clean(resolvedPath) if cleanedResolvedPath != resolvedPath { // Coverage: This should never happen. return "", fmt.Errorf("Internal inconsistency: Path %s resolved to %s still cleaned up to %s", path, resolvedPath, cleanedResolvedPath) } return resolvedPath, nil default: // err != nil, unrecognized return "", err } } // resolveExistingPathToFullyExplicit is the same as ResolvePathToFullyExplicit, // but without the special case for missing final component. func resolveExistingPathToFullyExplicit(path string) (string, error) { resolved, err := filepath.Abs(path) if err != nil { return "", err // Coverage: This can fail only if os.Getwd() fails. } resolved, err = filepath.EvalSymlinks(resolved) if err != nil { return "", err } return filepath.Clean(resolved), nil } ================================================ FILE: vendor/go.podman.io/image/v5/directory/version.go ================================================ package directory import ( "fmt" ) const ( versionPrefix = "Directory Transport Version: " ) // version represents a parsed directory transport version type version struct { major int minor int } // Supported versions // Write version file based on digest algorithm used. // 1.1 for sha256-only images, 1.2 otherwise. var ( version1_1 = version{major: 1, minor: 1} version1_2 = version{major: 1, minor: 2} maxSupportedVersion = version1_2 ) // String formats a version as a string suitable for writing to the version file func (v version) String() string { return fmt.Sprintf("%s%d.%d\n", versionPrefix, v.major, v.minor) } // parseVersion parses a version string into major and minor components. // Returns an error if the format is invalid. func parseVersion(versionStr string) (version, error) { var v version expectedFormat := versionPrefix + "%d.%d\n" // Sscanf parsing is a bit loose (treats spaces specially), but a strict check immediately follows n, err := fmt.Sscanf(versionStr, expectedFormat, &v.major, &v.minor) if err != nil || n != 2 || versionStr != v.String() { return version{}, fmt.Errorf("invalid version format") } return v, nil } // TODO: Potential refactor for better interoperability with `cmp` // https://github.com/containers/container-libs/pull/475#discussion_r2571131267 // isGreaterThan returns true if v is greater than other func (v version) isGreaterThan(other version) bool { if v.major != other.major { return v.major > other.major } return v.minor > other.minor } // UnsupportedVersionError indicates that the directory uses a version newer than we support type UnsupportedVersionError struct { Version string // The unsupported version string found Path string // The path to the directory } func (e UnsupportedVersionError) Error() string { return fmt.Sprintf("unsupported directory transport version %q at %s", e.Version, e.Path) } ================================================ FILE: vendor/go.podman.io/image/v5/docker/archive/dest.go ================================================ package archive import ( "context" "fmt" "go.podman.io/image/v5/docker/internal/tarfile" "go.podman.io/image/v5/internal/private" "go.podman.io/image/v5/types" ) type archiveImageDestination struct { *tarfile.Destination // Implements most of types.ImageDestination ref archiveReference writer *Writer // Should be closed if closeWriter closeWriter bool } func newImageDestination(sys *types.SystemContext, ref archiveReference) (private.ImageDestination, error) { if ref.sourceIndex != -1 { return nil, fmt.Errorf("Destination reference must not contain a manifest index @%d", ref.sourceIndex) } var writer *Writer var closeWriter bool if ref.writer != nil { writer = ref.writer closeWriter = false } else { w, err := NewWriter(sys, ref.path) if err != nil { return nil, err } writer = w closeWriter = true } d := &archiveImageDestination{ ref: ref, writer: writer, closeWriter: closeWriter, } tarDest := tarfile.NewDestination(sys, writer.archive, ref.Transport().Name(), ref.ref, d.CommitWithOptions) if sys != nil && sys.DockerArchiveAdditionalTags != nil { tarDest.AddRepoTags(sys.DockerArchiveAdditionalTags) } d.Destination = tarDest return d, nil } // Reference returns the reference used to set up this destination. Note that this should directly correspond to user's intent, // e.g. it should use the public hostname instead of the result of resolving CNAMEs or following redirects. func (d *archiveImageDestination) Reference() types.ImageReference { return d.ref } // Close removes resources associated with an initialized ImageDestination, if any. func (d *archiveImageDestination) Close() error { if d.closeWriter { return d.writer.Close() } return nil } // CommitWithOptions marks the process of storing the image as successful and asks for the image to be persisted. // WARNING: This does not have any transactional semantics: // - Uploaded data MAY be visible to others before CommitWithOptions() is called // - Uploaded data MAY be removed or MAY remain around if Close() is called without CommitWithOptions() (i.e. rollback is allowed but not guaranteed) func (d *archiveImageDestination) CommitWithOptions(ctx context.Context, options private.CommitOptions) error { d.writer.imageCommitted() if d.closeWriter { // We could do this only in .Close(), but failures in .Close() are much more likely to be // ignored by callers that use defer. So, in single-image destinations, try to complete // the archive here. // But if Commit() is never called, let .Close() clean up. err := d.writer.Close() d.closeWriter = false return err } return nil } ================================================ FILE: vendor/go.podman.io/image/v5/docker/archive/reader.go ================================================ package archive import ( "fmt" "go.podman.io/image/v5/docker/internal/tarfile" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/transports" "go.podman.io/image/v5/types" ) // Reader manages a single Docker archive, allows listing its contents and accessing // individual images with less overhead than creating image references individually // (because the archive is, if necessary, copied or decompressed only once). type Reader struct { path string // The original, user-specified path; not the maintained temporary file, if any archive *tarfile.Reader } // NewReader returns a Reader for path. // The caller should call .Close() on the returned object. func NewReader(sys *types.SystemContext, path string) (*Reader, error) { archive, err := tarfile.NewReaderFromFile(sys, path) if err != nil { return nil, err } return &Reader{ path: path, archive: archive, }, nil } // Close deletes temporary files associated with the Reader, if any. func (r *Reader) Close() error { return r.archive.Close() } // NewReaderForReference creates a Reader from a Reader-independent imageReference, which must be from docker/archive.Transport, // and a variant of imageReference that points at the same image within the reader. // The caller should call .Close() on the returned Reader. func NewReaderForReference(sys *types.SystemContext, ref types.ImageReference) (*Reader, types.ImageReference, error) { standalone, ok := ref.(archiveReference) if !ok { return nil, nil, fmt.Errorf("Internal error: NewReaderForReference called for a non-docker/archive ImageReference %s", transports.ImageName(ref)) } if standalone.archiveReader != nil { return nil, nil, fmt.Errorf("Internal error: NewReaderForReference called for a reader-bound reference %s", standalone.StringWithinTransport()) } reader, err := NewReader(sys, standalone.path) if err != nil { return nil, nil, err } succeeded := false defer func() { if !succeeded { reader.Close() } }() readerRef, err := newReference(standalone.path, standalone.ref, standalone.sourceIndex, reader.archive, nil) if err != nil { return nil, nil, err } succeeded = true return reader, readerRef, nil } // List returns the a set of references for images in the Reader, // grouped by the image the references point to. // The references are valid only until the Reader is closed. func (r *Reader) List() ([][]types.ImageReference, error) { res := [][]types.ImageReference{} for imageIndex, image := range r.archive.Manifest { refs := []types.ImageReference{} for _, tag := range image.RepoTags { parsedTag, err := reference.ParseNormalizedNamed(tag) if err != nil { return nil, fmt.Errorf("Invalid tag %#v in manifest item @%d: %w", tag, imageIndex, err) } nt, ok := parsedTag.(reference.NamedTagged) if !ok { return nil, fmt.Errorf("Invalid tag %q (%s): does not contain a tag", tag, parsedTag.String()) } ref, err := newReference(r.path, nt, -1, r.archive, nil) if err != nil { return nil, fmt.Errorf("creating a reference for tag %#v in manifest item @%d: %w", tag, imageIndex, err) } refs = append(refs, ref) } if len(refs) == 0 { ref, err := newReference(r.path, nil, imageIndex, r.archive, nil) if err != nil { return nil, fmt.Errorf("creating a reference for manifest item @%d: %w", imageIndex, err) } refs = append(refs, ref) } res = append(res, refs) } return res, nil } // ManifestTagsForReference returns the set of tags “matching” ref in reader, as strings // (i.e. exposing the short names before normalization). // The function reports an error if ref does not identify a single image. // If ref contains a NamedTagged reference, only a single tag “matching” ref is returned; // If ref contains a source index, or neither a NamedTagged nor a source index, all tags // matching the image are returned. // Almost all users should use List() or ImageReference.DockerReference() instead. func (r *Reader) ManifestTagsForReference(ref types.ImageReference) ([]string, error) { archiveRef, ok := ref.(archiveReference) if !ok { return nil, fmt.Errorf("Internal error: ManifestTagsForReference called for a non-docker/archive ImageReference %s", transports.ImageName(ref)) } manifestItem, tagIndex, err := r.archive.ChooseManifestItem(archiveRef.ref, archiveRef.sourceIndex) if err != nil { return nil, err } if tagIndex != -1 { return []string{manifestItem.RepoTags[tagIndex]}, nil } return manifestItem.RepoTags, nil } ================================================ FILE: vendor/go.podman.io/image/v5/docker/archive/src.go ================================================ package archive import ( "go.podman.io/image/v5/docker/internal/tarfile" "go.podman.io/image/v5/internal/private" "go.podman.io/image/v5/types" ) type archiveImageSource struct { *tarfile.Source // Implements most of types.ImageSource ref archiveReference } // newImageSource returns a types.ImageSource for the specified image reference. // The caller must call .Close() on the returned ImageSource. func newImageSource(sys *types.SystemContext, ref archiveReference) (private.ImageSource, error) { var archive *tarfile.Reader var closeArchive bool if ref.archiveReader != nil { archive = ref.archiveReader closeArchive = false } else { a, err := tarfile.NewReaderFromFile(sys, ref.path) if err != nil { return nil, err } archive = a closeArchive = true } src := tarfile.NewSource(archive, closeArchive, ref.Transport().Name(), ref.ref, ref.sourceIndex) return &archiveImageSource{ Source: src, ref: ref, }, nil } // Reference returns the reference used to set up this source, _as specified by the user_ // (not as the image itself, or its underlying storage, claims). This can be used e.g. to determine which public keys are trusted for this image. func (s *archiveImageSource) Reference() types.ImageReference { return s.ref } ================================================ FILE: vendor/go.podman.io/image/v5/docker/archive/transport.go ================================================ package archive import ( "context" "errors" "fmt" "strconv" "strings" "go.podman.io/image/v5/docker/internal/tarfile" "go.podman.io/image/v5/docker/reference" ctrImage "go.podman.io/image/v5/internal/image" "go.podman.io/image/v5/transports" "go.podman.io/image/v5/types" ) func init() { transports.Register(Transport) } // Transport is an ImageTransport for local Docker archives. var Transport = archiveTransport{} type archiveTransport struct{} func (t archiveTransport) Name() string { return "docker-archive" } // ParseReference converts a string, which should not start with the ImageTransport.Name prefix, into an ImageReference. func (t archiveTransport) ParseReference(reference string) (types.ImageReference, error) { return ParseReference(reference) } // ValidatePolicyConfigurationScope checks that scope is a valid name for a signature.PolicyTransportScopes keys // (i.e. a valid PolicyConfigurationIdentity() or PolicyConfigurationNamespaces() return value). // It is acceptable to allow an invalid value which will never be matched, it can "only" cause user confusion. // scope passed to this function will not be "", that value is always allowed. func (t archiveTransport) ValidatePolicyConfigurationScope(scope string) error { // See the explanation in archiveReference.PolicyConfigurationIdentity. return errors.New(`docker-archive: does not support any scopes except the default "" one`) } // archiveReference is an ImageReference for Docker images. type archiveReference struct { path string // May be nil to read the only image in an archive, or to create an untagged image. ref reference.NamedTagged // If not -1, a zero-based index of the image in the manifest. Valid only for sources. // Must not be set if ref is set. sourceIndex int // If not nil, must have been created from path (but archiveReader.path may point at a temporary // file, not necessarily path precisely). archiveReader *tarfile.Reader // If not nil, must have been created for path writer *Writer } // ParseReference converts a string, which should not start with the ImageTransport.Name prefix, into an Docker ImageReference. func ParseReference(refString string) (types.ImageReference, error) { if refString == "" { return nil, fmt.Errorf("docker-archive reference %s isn't of the form [:]", refString) } path, tagOrIndex, gotTagOrIndex := strings.Cut(refString, ":") var nt reference.NamedTagged sourceIndex := -1 if gotTagOrIndex { // A :tag or :@index was specified. if len(tagOrIndex) > 0 && tagOrIndex[0] == '@' { i, err := strconv.Atoi(tagOrIndex[1:]) if err != nil { return nil, fmt.Errorf("Invalid source index %s: %w", tagOrIndex, err) } if i < 0 { return nil, fmt.Errorf("Invalid source index @%d: must not be negative", i) } sourceIndex = i } else { ref, err := reference.ParseNormalizedNamed(tagOrIndex) if err != nil { return nil, fmt.Errorf("docker-archive parsing reference: %w", err) } ref = reference.TagNameOnly(ref) refTagged, isTagged := ref.(reference.NamedTagged) if !isTagged { // If ref contains a digest, TagNameOnly does not change it return nil, fmt.Errorf("reference does not include a tag: %s", ref.String()) } nt = refTagged } } return newReference(path, nt, sourceIndex, nil, nil) } // NewReference returns a Docker archive reference for a path and an optional reference. func NewReference(path string, ref reference.NamedTagged) (types.ImageReference, error) { return newReference(path, ref, -1, nil, nil) } // NewIndexReference returns a Docker archive reference for a path and a zero-based source manifest index. func NewIndexReference(path string, sourceIndex int) (types.ImageReference, error) { if sourceIndex < 0 { return nil, fmt.Errorf("invalid call to NewIndexReference with negative index %d", sourceIndex) } return newReference(path, nil, sourceIndex, nil, nil) } // newReference returns a docker archive reference for a path, an optional reference or sourceIndex, // and optionally a tarfile.Reader and/or a tarfile.Writer matching path. func newReference(path string, ref reference.NamedTagged, sourceIndex int, archiveReader *tarfile.Reader, writer *Writer, ) (types.ImageReference, error) { if strings.Contains(path, ":") { return nil, fmt.Errorf("Invalid docker-archive: reference: colon in path %q is not supported", path) } if ref != nil && sourceIndex != -1 { return nil, fmt.Errorf("Invalid docker-archive: reference: cannot use both a tag and a source index") } if _, isDigest := ref.(reference.Canonical); isDigest { return nil, fmt.Errorf("docker-archive doesn't support digest references: %s", ref.String()) } if sourceIndex != -1 && sourceIndex < 0 { return nil, fmt.Errorf("Invalid docker-archive: reference: index @%d must not be negative", sourceIndex) } return archiveReference{ path: path, ref: ref, sourceIndex: sourceIndex, archiveReader: archiveReader, writer: writer, }, nil } func (ref archiveReference) Transport() types.ImageTransport { return Transport } // StringWithinTransport returns a string representation of the reference, which MUST be such that // reference.Transport().ParseReference(reference.StringWithinTransport()) returns an equivalent reference. // NOTE: The returned string is not promised to be equal to the original input to ParseReference; // e.g. default attribute values omitted by the user may be filled in the return value, or vice versa. // WARNING: Do not use the return value in the UI to describe an image, it does not contain the Transport().Name() prefix. func (ref archiveReference) StringWithinTransport() string { switch { case ref.ref != nil: return fmt.Sprintf("%s:%s", ref.path, ref.ref.String()) case ref.sourceIndex != -1: return fmt.Sprintf("%s:@%d", ref.path, ref.sourceIndex) default: return ref.path } } // DockerReference returns a Docker reference associated with this reference // (fully explicit, i.e. !reference.IsNameOnly, but reflecting user intent, // not e.g. after redirect or alias processing), or nil if unknown/not applicable. func (ref archiveReference) DockerReference() reference.Named { return ref.ref } // PolicyConfigurationIdentity returns a string representation of the reference, suitable for policy lookup. // This MUST reflect user intent, not e.g. after processing of third-party redirects or aliases; // The value SHOULD be fully explicit about its semantics, with no hidden defaults, AND canonical // (i.e. various references with exactly the same semantics should return the same configuration identity) // It is fine for the return value to be equal to StringWithinTransport(), and it is desirable but // not required/guaranteed that it will be a valid input to Transport().ParseReference(). // Returns "" if configuration identities for these references are not supported. func (ref archiveReference) PolicyConfigurationIdentity() string { // Punt, the justification is similar to dockerReference.PolicyConfigurationIdentity. return "" } // PolicyConfigurationNamespaces returns a list of other policy configuration namespaces to search // for if explicit configuration for PolicyConfigurationIdentity() is not set. The list will be processed // in order, terminating on first match, and an implicit "" is always checked at the end. // It is STRONGLY recommended for the first element, if any, to be a prefix of PolicyConfigurationIdentity(), // and each following element to be a prefix of the element preceding it. func (ref archiveReference) PolicyConfigurationNamespaces() []string { // TODO return []string{} } // NewImage returns a types.ImageCloser for this reference, possibly specialized for this ImageTransport. // The caller must call .Close() on the returned ImageCloser. // NOTE: If any kind of signature verification should happen, build an UnparsedImage from the value returned by NewImageSource, // verify that UnparsedImage, and convert it into a real Image via image.FromUnparsedImage. // WARNING: This may not do the right thing for a manifest list, see image.FromSource for details. func (ref archiveReference) NewImage(ctx context.Context, sys *types.SystemContext) (types.ImageCloser, error) { return ctrImage.FromReference(ctx, sys, ref) } // NewImageSource returns a types.ImageSource for this reference. // The caller must call .Close() on the returned ImageSource. func (ref archiveReference) NewImageSource(ctx context.Context, sys *types.SystemContext) (types.ImageSource, error) { return newImageSource(sys, ref) } // NewImageDestination returns a types.ImageDestination for this reference. // The caller must call .Close() on the returned ImageDestination. func (ref archiveReference) NewImageDestination(ctx context.Context, sys *types.SystemContext) (types.ImageDestination, error) { return newImageDestination(sys, ref) } // DeleteImage deletes the named image from the registry, if supported. func (ref archiveReference) DeleteImage(ctx context.Context, sys *types.SystemContext) error { // Not really supported, for safety reasons. return errors.New("Deleting images not implemented for docker-archive: images") } ================================================ FILE: vendor/go.podman.io/image/v5/docker/archive/writer.go ================================================ package archive import ( "errors" "fmt" "io" "os" "sync" "go.podman.io/image/v5/docker/internal/tarfile" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/types" ) // Writer manages a single in-progress Docker archive and allows adding images to it. type Writer struct { path string // The original, user-specified path; not the maintained temporary file, if any regularFile bool // path refers to a regular file (e.g. not a pipe) archive *tarfile.Writer writer io.Closer // The following state can only be accessed with the mutex held. mutex sync.Mutex hadCommit bool // At least one successful commit has happened } // NewWriter returns a Writer for path. // The caller should call .Close() on the returned object. func NewWriter(sys *types.SystemContext, path string) (*Writer, error) { // path can be either a pipe or a regular file // in the case of a pipe, we require that we can open it for write // in the case of a regular file, we don't want to overwrite any pre-existing file // so we check for Size() == 0 below (This is racy, but using O_EXCL would also be racy, // only in a different way. Either way, it’s up to the user to not have two writers to the same path.) fh, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE, 0o644) if err != nil { return nil, fmt.Errorf("opening file %q: %w", path, err) } succeeded := false defer func() { if !succeeded { fh.Close() } }() fhStat, err := fh.Stat() if err != nil { return nil, fmt.Errorf("statting file %q: %w", path, err) } regularFile := fhStat.Mode().IsRegular() if regularFile && fhStat.Size() != 0 { return nil, errors.New("docker-archive doesn't support modifying existing images") } archive := tarfile.NewWriter(fh) succeeded = true return &Writer{ path: path, regularFile: regularFile, archive: archive, writer: fh, hadCommit: false, }, nil } // imageCommitted notifies the Writer that at least one image was successfully committed to the stream. func (w *Writer) imageCommitted() { w.mutex.Lock() defer w.mutex.Unlock() w.hadCommit = true } // Close writes all outstanding data about images to the archive, and // releases state associated with the Writer, if any. // No more images can be added after this is called. func (w *Writer) Close() error { err := w.archive.Close() if err2 := w.writer.Close(); err2 != nil && err == nil { err = err2 } if err == nil && w.regularFile && !w.hadCommit { // Writing to the destination never had a success; delete the destination if we created it. // This is done primarily because we don’t implement adding another image to a pre-existing image, so if we // left a partial archive around (notably because reading from the _source_ has failed), we couldn’t retry without // the caller manually deleting the partial archive. So, delete it instead. // // Archives with at least one successfully created image are left around; they might still be valuable. // // Note a corner case: If there _originally_ was an empty file (which is not a valid archive anyway), this deletes it. // Ideally, if w.regularFile, we should write the full contents to a temporary file and use os.Rename here, only on success. if err2 := os.Remove(w.path); err2 != nil { err = err2 } } return err } // NewReference returns an ImageReference that allows adding an image to Writer, // with an optional reference. func (w *Writer) NewReference(destinationRef reference.NamedTagged) (types.ImageReference, error) { return newReference(w.path, destinationRef, -1, nil, w) } ================================================ FILE: vendor/go.podman.io/image/v5/docker/body_reader.go ================================================ package docker import ( "context" "errors" "fmt" "io" "math" "math/rand/v2" "net/http" "net/url" "strconv" "strings" "syscall" "time" "github.com/sirupsen/logrus" ) const ( // bodyReaderMinimumProgress is the minimum progress we consider a good reason to retry bodyReaderMinimumProgress = 1 * 1024 * 1024 // bodyReaderMSSinceLastRetry is the minimum time since a last retry we consider a good reason to retry bodyReaderMSSinceLastRetry = 60 * 1_000 ) // bodyReader is an io.ReadCloser returned by dockerImageSource.GetBlob, // which can transparently resume some (very limited) kinds of aborted connections. type bodyReader struct { ctx context.Context c *dockerClient path string // path to pass to makeRequest to retry logURL *url.URL // a string to use in error messages firstConnectionTime time.Time body io.ReadCloser // The currently open connection we use to read data, or nil if there is nothing to read from / close. lastRetryOffset int64 // -1 if N/A lastRetryTime time.Time // IsZero() if N/A offset int64 // Current offset within the blob lastSuccessTime time.Time // IsZero() if N/A } // newBodyReader creates a bodyReader for request path in c. // firstBody is an already correctly opened body for the blob, returning the full blob from the start. // If reading from firstBody fails, bodyReader may heuristically decide to resume. func newBodyReader(ctx context.Context, c *dockerClient, path string, firstBody io.ReadCloser) (io.ReadCloser, error) { logURL, err := c.resolveRequestURL(path) if err != nil { return nil, err } res := &bodyReader{ ctx: ctx, c: c, path: path, logURL: logURL, firstConnectionTime: time.Now(), body: firstBody, lastRetryOffset: -1, lastRetryTime: time.Time{}, offset: 0, lastSuccessTime: time.Time{}, } return res, nil } // parseDecimalInString ensures that s[start:] starts with a non-negative decimal number, and returns that number and the offset after the number. func parseDecimalInString(s string, start int) (int64, int, error) { i := start for i < len(s) && s[i] >= '0' && s[i] <= '9' { i++ } if i == start { return -1, -1, errors.New("missing decimal number") } v, err := strconv.ParseInt(s[start:i], 10, 64) if err != nil { return -1, -1, fmt.Errorf("parsing number: %w", err) } return v, i, nil } // parseExpectedChar ensures that s[pos] is the expected byte, and returns the offset after it. func parseExpectedChar(s string, pos int, expected byte) (int, error) { if pos == len(s) || s[pos] != expected { return -1, fmt.Errorf("missing expected %q", expected) } return pos + 1, nil } // parseContentRange ensures that res contains a Content-Range header with a byte range, and returns (first, last, completeLength) on success. Size can be -1. func parseContentRange(res *http.Response) (int64, int64, int64, error) { hdrs := res.Header.Values("Content-Range") switch len(hdrs) { case 0: return -1, -1, -1, errors.New("missing Content-Range: header") case 1: break default: return -1, -1, -1, fmt.Errorf("ambiguous Content-Range:, %d header values", len(hdrs)) } hdr := hdrs[0] expectedPrefix := "bytes " if !strings.HasPrefix(hdr, expectedPrefix) { return -1, -1, -1, fmt.Errorf("invalid Content-Range: %q, missing prefix %q", hdr, expectedPrefix) } first, pos, err := parseDecimalInString(hdr, len(expectedPrefix)) if err != nil { return -1, -1, -1, fmt.Errorf("invalid Content-Range: %q, parsing first-pos: %w", hdr, err) } pos, err = parseExpectedChar(hdr, pos, '-') if err != nil { return -1, -1, -1, fmt.Errorf("invalid Content-Range: %q: %w", hdr, err) } last, pos, err := parseDecimalInString(hdr, pos) if err != nil { return -1, -1, -1, fmt.Errorf("invalid Content-Range: %q, parsing last-pos: %w", hdr, err) } pos, err = parseExpectedChar(hdr, pos, '/') if err != nil { return -1, -1, -1, fmt.Errorf("invalid Content-Range: %q: %w", hdr, err) } completeLength := int64(-1) if pos < len(hdr) && hdr[pos] == '*' { pos++ } else { completeLength, pos, err = parseDecimalInString(hdr, pos) if err != nil { return -1, -1, -1, fmt.Errorf("invalid Content-Range: %q, parsing complete-length: %w", hdr, err) } } if pos < len(hdr) { return -1, -1, -1, fmt.Errorf("invalid Content-Range: %q, unexpected trailing content", hdr) } return first, last, completeLength, nil } // Read implements io.ReadCloser func (br *bodyReader) Read(p []byte) (int, error) { if br.body == nil { return 0, fmt.Errorf("internal error: bodyReader.Read called on a closed object for %s", br.logURL.Redacted()) } n, err := br.body.Read(p) br.offset += int64(n) switch { case err == nil || err == io.EOF: br.lastSuccessTime = time.Now() return n, err // Unlike the default: case, don’t log anything. case errors.Is(err, io.ErrUnexpectedEOF) || errors.Is(err, syscall.ECONNRESET): originalErr := err redactedURL := br.logURL.Redacted() if err := br.errorIfNotReconnecting(originalErr, redactedURL); err != nil { return n, err } if err := br.body.Close(); err != nil { logrus.Debugf("Error closing blob body: %v", err) // … and ignore err otherwise } br.body = nil time.Sleep(1*time.Second + rand.N(100_000*time.Microsecond)) // Some jitter so that a failure blip doesn’t cause a deterministic stampede headers := map[string][]string{ "Range": {fmt.Sprintf("bytes=%d-", br.offset)}, } res, err := br.c.makeRequest(br.ctx, http.MethodGet, br.path, headers, nil, v2Auth, nil) if err != nil { return n, fmt.Errorf("%w (while reconnecting: %v)", originalErr, err) } consumedBody := false defer func() { if !consumedBody { res.Body.Close() } }() switch res.StatusCode { case http.StatusPartialContent: // OK // A client MUST inspect a 206 response's Content-Type and Content-Range field(s) to determine what parts are enclosed and whether additional requests are needed. // The recipient of an invalid Content-Range MUST NOT attempt to recombine the received content with a stored representation. first, last, completeLength, err := parseContentRange(res) if err != nil { return n, fmt.Errorf("%w (after reconnecting, invalid Content-Range header: %v)", originalErr, err) } // We don’t handle responses that start at an unrequested offset, nor responses that terminate before the end of the full blob. if first != br.offset || (completeLength != -1 && last+1 != completeLength) { return n, fmt.Errorf("%w (after reconnecting at offset %d, got unexpected Content-Range %d-%d/%d)", originalErr, br.offset, first, last, completeLength) } // Continue below case http.StatusOK: return n, fmt.Errorf("%w (after reconnecting, server did not process a Range: header, status %d)", originalErr, http.StatusOK) default: err := registryHTTPResponseToError(res) return n, fmt.Errorf("%w (after reconnecting, fetching blob: %v)", originalErr, err) } logrus.Debugf("Successfully reconnected to %s", redactedURL) consumedBody = true br.body = res.Body br.lastRetryOffset = br.offset br.lastRetryTime = time.Now() return n, nil default: logrus.Debugf("Error reading blob body from %s: %#v", br.logURL.Redacted(), err) return n, err } } // millisecondsSinceOptional is like currentTime.Sub(tm).Milliseconds, but it returns a floating-point value. // If tm.IsZero(), it returns math.NaN() func millisecondsSinceOptional(currentTime time.Time, tm time.Time) float64 { if tm.IsZero() { return math.NaN() } return float64(currentTime.Sub(tm).Nanoseconds()) / 1_000_000.0 } // errorIfNotReconnecting makes a heuristic decision whether we should reconnect after err at redactedURL; if so, it returns nil, // otherwise it returns an appropriate error to return to the caller (possibly augmented with data about the heuristic) func (br *bodyReader) errorIfNotReconnecting(originalErr error, redactedURL string) error { currentTime := time.Now() msSinceFirstConnection := millisecondsSinceOptional(currentTime, br.firstConnectionTime) msSinceLastRetry := millisecondsSinceOptional(currentTime, br.lastRetryTime) msSinceLastSuccess := millisecondsSinceOptional(currentTime, br.lastSuccessTime) logrus.Debugf("Reading blob body from %s failed (%#v), decision inputs: total %d @%.3f ms, last retry %d @%.3f ms, last progress @%.3f ms", redactedURL, originalErr, br.offset, msSinceFirstConnection, br.lastRetryOffset, msSinceLastRetry, msSinceLastSuccess) progress := br.offset - br.lastRetryOffset if progress >= bodyReaderMinimumProgress { logrus.Infof("Reading blob body from %s failed (%v), reconnecting after %d bytes…", redactedURL, originalErr, progress) return nil } if br.lastRetryTime.IsZero() { logrus.Infof("Reading blob body from %s failed (%v), reconnecting (first reconnection)…", redactedURL, originalErr) return nil } if msSinceLastRetry >= bodyReaderMSSinceLastRetry { logrus.Infof("Reading blob body from %s failed (%v), reconnecting after %.3f ms…", redactedURL, originalErr, msSinceLastRetry) return nil } logrus.Debugf("Not reconnecting to %s: insufficient progress %d / time since last retry %.3f ms", redactedURL, progress, msSinceLastRetry) return fmt.Errorf("(heuristic tuning data: total %d @%.3f ms, last retry %d @%.3f ms, last progress @ %.3f ms): %w", br.offset, msSinceFirstConnection, br.lastRetryOffset, msSinceLastRetry, msSinceLastSuccess, originalErr) } // Close implements io.ReadCloser func (br *bodyReader) Close() error { if br.body == nil { return nil } err := br.body.Close() br.body = nil return err } ================================================ FILE: vendor/go.podman.io/image/v5/docker/cache.go ================================================ package docker import ( "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/types" ) // bicTransportScope returns a BICTransportScope appropriate for ref. func bicTransportScope(ref dockerReference) types.BICTransportScope { // Blobs can be reused across the whole registry. return types.BICTransportScope{Opaque: reference.Domain(ref.ref)} } // newBICLocationReference returns a BICLocationReference appropriate for ref. func newBICLocationReference(ref dockerReference) types.BICLocationReference { // Blobs are scoped to repositories (the tag/digest are not necessary to reuse a blob). return types.BICLocationReference{Opaque: ref.ref.Name()} } // parseBICLocationReference returns a repository for encoded lr. func parseBICLocationReference(lr types.BICLocationReference) (reference.Named, error) { return reference.ParseNormalizedNamed(lr.Opaque) } ================================================ FILE: vendor/go.podman.io/image/v5/docker/daemon/client.go ================================================ package daemon import ( "crypto/tls" "crypto/x509" "fmt" "net/http" "os" "path/filepath" "time" "github.com/docker/go-connections/tlsconfig" dockerclient "github.com/moby/moby/client" "go.podman.io/image/v5/types" ) // NewDockerClient initializes a new API client based on the passed SystemContext. func newDockerClient(sys *types.SystemContext) (*dockerclient.Client, error) { host := dockerclient.DefaultDockerHost if sys != nil && sys.DockerDaemonHost != "" { host = sys.DockerDaemonHost } opts := []dockerclient.Opt{ dockerclient.WithHost(host), } // We conditionalize building the TLS configuration only to TLS sockets: // // The dockerclient.Client implementation differentiates between // - Client.proto, which is ~how the connection is establishe (IP / AF_UNIX/Windows) // - Client.scheme, which is what is sent over the connection (HTTP with/without TLS). // // Only Client.proto is set from the URL in dockerclient.WithHost(), // Client.scheme is detected based on a http.Client.TLSClientConfig presence; // dockerclient.WithHTTPClient with a client that has TLSClientConfig set // will, by default, trigger an attempt to use TLS. // // So, don’t use WithHTTPClient for unix:// sockets at all. // // Similarly, if we want to communicate over plain HTTP on a TCP socket (http://), // we also should not set TLSClientConfig. We continue to use WithHTTPClient // with our slightly non-default settings to avoid a behavior change on updates of c/image. // // Alternatively we could use dockerclient.WithScheme to drive the TLS/non-TLS logic // explicitly, but we would still want to set WithHTTPClient (differently) for https:// and http:// ; // so that would not be any simpler. serverURL, err := dockerclient.ParseHostURL(host) if err != nil { return nil, err } switch serverURL.Scheme { case "unix": // Nothing case "npipe": // Nothing case "http": hc := httpConfig() opts = append(opts, dockerclient.WithHTTPClient(hc)) default: hc, err := tlsConfig(sys) if err != nil { return nil, err } opts = append(opts, dockerclient.WithHTTPClient(hc)) } return dockerclient.New(opts...) } func tlsConfig(sys *types.SystemContext) (*http.Client, error) { // This is intended to follow github.com/moby/moby/client.defaultHTTPClient // and approximately github.com/moby/moby/client.WithTLSClientConfigFromEnv; // we can’t use WithTLSClientConfig because 1) it uses ExclusiveRootPools:true, // and 2) there is no clean way to override the crypto choices of tlsconfig.Client. // So, we need to load the certs and keys ourselves in the BaseTLSConfig case // anyway, we might just as well do it in the other case as well. var tlsConfig *tls.Config if sys != nil && sys.BaseTLSConfig != nil { tlsConfig = sys.BaseTLSConfig.Clone() } else { tlsConfig = &tls.Config{ // As of 2025-08, tlsconfig.ClientDefault() differs from Go 1.23 defaults only in CipherSuites; // so, limit us to only using that value. If go-connections/tlsconfig changes its policy, we // will want to consider that and make a decision whether to follow suit. // There is some chance that eventually the Go default will be to require TLS 1.3, and that point // we might want to drop the dependency on go-connections entirely. CipherSuites: tlsconfig.ClientDefault().CipherSuites, } } if sys != nil { if sys.DockerDaemonInsecureSkipTLSVerify { tlsConfig.InsecureSkipVerify = true } else if sys.DockerDaemonCertPath != "" { caFilePath := filepath.Join(sys.DockerDaemonCertPath, "ca.pem") caData, err := os.ReadFile(caFilePath) if err != nil { return nil, fmt.Errorf("reading CA file %q: %w", caFilePath, err) } caPool, err := x509.SystemCertPool() if err != nil { return nil, fmt.Errorf("reading systemwide CAs: %w", err) } if !caPool.AppendCertsFromPEM(caData) { return nil, fmt.Errorf("no certificate found in %q", caFilePath) } tlsConfig.RootCAs = caPool } if sys.DockerDaemonCertPath != "" { cert, err := tls.LoadX509KeyPair( filepath.Join(sys.DockerDaemonCertPath, "cert.pem"), filepath.Join(sys.DockerDaemonCertPath, "key.pem")) if err != nil { return nil, fmt.Errorf("loading X509 key pair: %w", err) } tlsConfig.Certificates = []tls.Certificate{cert} } } return &http.Client{ Transport: &http.Transport{ Proxy: http.ProxyFromEnvironment, TLSClientConfig: tlsConfig, // In general we want to follow github.com/moby/moby/client.defaultHTTPClient , as long as it doesn’t affect compatibility. // These idle connection limits really only apply to long-running clients, which is not our case here; // we include the same values purely for symmetry. MaxIdleConns: 6, IdleConnTimeout: 30 * time.Second, }, CheckRedirect: dockerclient.CheckRedirect, }, nil } func httpConfig() *http.Client { return &http.Client{ Transport: &http.Transport{ Proxy: http.ProxyFromEnvironment, TLSClientConfig: nil, // In general we want to follow github.com/moby/moby/client.defaultHTTPClient , as long as it doesn’t affect compatibility. // These idle connection limits really only apply to long-running clients, which is not our case here; // we include the same values purely for symmetry. MaxIdleConns: 6, IdleConnTimeout: 30 * time.Second, }, CheckRedirect: dockerclient.CheckRedirect, } } ================================================ FILE: vendor/go.podman.io/image/v5/docker/daemon/daemon_dest.go ================================================ package daemon import ( "context" "encoding/json" "errors" "fmt" "io" "github.com/moby/moby/client" "github.com/sirupsen/logrus" "go.podman.io/image/v5/docker/internal/tarfile" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/internal/private" "go.podman.io/image/v5/types" ) type daemonImageDestination struct { ref daemonReference mustMatchRuntimeOS bool *tarfile.Destination // Implements most of types.ImageDestination archive *tarfile.Writer // For talking to imageLoadGoroutine goroutineCancel context.CancelFunc statusChannel <-chan error writer *io.PipeWriter // Other state committed bool // writer has been closed } // newImageDestination returns a types.ImageDestination for the specified image reference. func newImageDestination(ctx context.Context, sys *types.SystemContext, ref daemonReference) (private.ImageDestination, error) { if ref.ref == nil { return nil, fmt.Errorf("Invalid destination docker-daemon:%s: a destination must be a name:tag", ref.StringWithinTransport()) } namedTaggedRef, ok := ref.ref.(reference.NamedTagged) if !ok { return nil, fmt.Errorf("Invalid destination docker-daemon:%s: a destination must be a name:tag", ref.StringWithinTransport()) } mustMatchRuntimeOS := sys == nil || sys.DockerDaemonHost == client.DefaultDockerHost c, err := newDockerClient(sys) if err != nil { return nil, fmt.Errorf("initializing docker engine client: %w", err) } reader, writer := io.Pipe() archive := tarfile.NewWriter(writer) // Commit() may never be called, so we may never read from this channel; so, make this buffered to allow imageLoadGoroutine to write status and terminate even if we never read it. statusChannel := make(chan error, 1) goroutineContext, goroutineCancel := context.WithCancel(ctx) go imageLoadGoroutine(goroutineContext, c, reader, statusChannel) d := &daemonImageDestination{ ref: ref, mustMatchRuntimeOS: mustMatchRuntimeOS, archive: archive, goroutineCancel: goroutineCancel, statusChannel: statusChannel, writer: writer, committed: false, } d.Destination = tarfile.NewDestination(sys, archive, ref.Transport().Name(), namedTaggedRef, d.CommitWithOptions) return d, nil } // imageLoadGoroutine accepts tar stream on reader, sends it to c, and reports error or success by writing to statusChannel func imageLoadGoroutine(ctx context.Context, c *client.Client, reader *io.PipeReader, statusChannel chan<- error) { defer c.Close() err := errors.New("Internal error: unexpected panic in imageLoadGoroutine") defer func() { logrus.Debugf("docker-daemon: sending done, status %v", err) statusChannel <- err }() defer func() { if err == nil { reader.Close() } else { if err := reader.CloseWithError(err); err != nil { logrus.Debugf("imageLoadGoroutine: Error during reader.CloseWithError: %v", err) } } }() err = imageLoad(ctx, c, reader) } // imageLoad accepts tar stream on reader and sends it to c func imageLoad(ctx context.Context, c *client.Client, reader *io.PipeReader) error { res, err := c.ImageLoad(ctx, reader, client.ImageLoadWithQuiet(true)) if err != nil { return fmt.Errorf("starting a load operation in docker engine: %w", err) } defer res.Close() // jsonError and jsonMessage are small subsets of docker/docker/pkg/jsonmessage.JSONError and JSONMessage, // copied here to minimize dependencies. type jsonError struct { Message string `json:"message,omitempty"` } type jsonMessage struct { Error *jsonError `json:"errorDetail,omitempty"` } dec := json.NewDecoder(res) for { var msg jsonMessage if err := dec.Decode(&msg); err != nil { if err == io.EOF { break } return fmt.Errorf("parsing docker load progress: %w", err) } if msg.Error != nil { return fmt.Errorf("docker engine reported: %q", msg.Error.Message) } } return nil // No error reported = success } // DesiredLayerCompression indicates if layers must be compressed, decompressed or preserved func (d *daemonImageDestination) DesiredLayerCompression() types.LayerCompression { return types.PreserveOriginal } // MustMatchRuntimeOS returns true iff the destination can store only images targeted for the current runtime architecture and OS. False otherwise. func (d *daemonImageDestination) MustMatchRuntimeOS() bool { return d.mustMatchRuntimeOS } // Close removes resources associated with an initialized ImageDestination, if any. func (d *daemonImageDestination) Close() error { if !d.committed { logrus.Debugf("docker-daemon: Closing tar stream to abort loading") // In principle, goroutineCancel() should abort the HTTP request and stop the process from continuing. // In practice, though, various HTTP implementations used by client.Client.ImageLoad() (including // https://github.com/golang/net/blob/master/context/ctxhttp/ctxhttp_pre17.go and the // net/http version with native Context support in Go 1.7) do not always actually immediately cancel // the operation: they may process the HTTP request, or a part of it, to completion in a goroutine, and // return early if the context is canceled without terminating the goroutine at all. // So we need this CloseWithError to terminate sending the HTTP request Body // immediately, and hopefully, through terminating the sending which uses "Transfer-Encoding: chunked"" without sending // the terminating zero-length chunk, prevent the docker daemon from processing the tar stream at all. // Whether that works or not, closing the PipeWriter seems desirable in any case. if err := d.writer.CloseWithError(errors.New("Aborting upload, daemonImageDestination closed without a previous .CommitWithOptions()")); err != nil { return err } } d.goroutineCancel() return nil } func (d *daemonImageDestination) Reference() types.ImageReference { return d.ref } // CommitWithOptions marks the process of storing the image as successful and asks for the image to be persisted. // WARNING: This does not have any transactional semantics: // - Uploaded data MAY be visible to others before CommitWithOptions() is called // - Uploaded data MAY be removed or MAY remain around if Close() is called without CommitWithOptions() (i.e. rollback is allowed but not guaranteed) func (d *daemonImageDestination) CommitWithOptions(ctx context.Context, options private.CommitOptions) error { logrus.Debugf("docker-daemon: Closing tar stream") if err := d.archive.Close(); err != nil { return err } if err := d.writer.Close(); err != nil { return err } d.committed = true // We may still fail, but we are done sending to imageLoadGoroutine. logrus.Debugf("docker-daemon: Waiting for status") select { case <-ctx.Done(): return ctx.Err() case err := <-d.statusChannel: return err } } ================================================ FILE: vendor/go.podman.io/image/v5/docker/daemon/daemon_src.go ================================================ package daemon import ( "context" "fmt" "go.podman.io/image/v5/docker/internal/tarfile" "go.podman.io/image/v5/internal/private" "go.podman.io/image/v5/types" ) type daemonImageSource struct { ref daemonReference *tarfile.Source // Implements most of types.ImageSource } // newImageSource returns a types.ImageSource for the specified image reference. // The caller must call .Close() on the returned ImageSource. // // It would be great if we were able to stream the input tar as it is being // sent; but Docker sends the top-level manifest, which determines which paths // to look for, at the end, so in we will need to seek back and re-read, several times. // (We could, perhaps, expect an exact sequence, assume that the first plaintext file // is the config, and that the following len(RootFS) files are the layers, but that feels // way too brittle.) func newImageSource(ctx context.Context, sys *types.SystemContext, ref daemonReference) (private.ImageSource, error) { c, err := newDockerClient(sys) if err != nil { return nil, fmt.Errorf("initializing docker engine client: %w", err) } defer c.Close() // Per NewReference(), ref.StringWithinTransport() is either an image ID (config digest), or a !reference.NameOnly() reference. // Either way ImageSave should create a tarball with exactly one image. inputStream, err := c.ImageSave(ctx, []string{ref.StringWithinTransport()}) if err != nil { return nil, fmt.Errorf("loading image from docker engine: %w", err) } defer inputStream.Close() archive, err := tarfile.NewReaderFromStream(sys, inputStream) if err != nil { return nil, err } src := tarfile.NewSource(archive, true, ref.Transport().Name(), nil, -1) return &daemonImageSource{ ref: ref, Source: src, }, nil } // Reference returns the reference used to set up this source, _as specified by the user_ // (not as the image itself, or its underlying storage, claims). This can be used e.g. to determine which public keys are trusted for this image. func (s *daemonImageSource) Reference() types.ImageReference { return s.ref } ================================================ FILE: vendor/go.podman.io/image/v5/docker/daemon/daemon_transport.go ================================================ package daemon import ( "context" "errors" "fmt" "github.com/opencontainers/go-digest" "go.podman.io/image/v5/docker/policyconfiguration" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/internal/image" "go.podman.io/image/v5/transports" "go.podman.io/image/v5/types" ) func init() { transports.Register(Transport) } // Transport is an ImageTransport for images managed by a local Docker daemon. var Transport = daemonTransport{} type daemonTransport struct{} // Name returns the name of the transport, which must be unique among other transports. func (t daemonTransport) Name() string { return "docker-daemon" } // ParseReference converts a string, which should not start with the ImageTransport.Name prefix, into an ImageReference. func (t daemonTransport) ParseReference(reference string) (types.ImageReference, error) { return ParseReference(reference) } // ValidatePolicyConfigurationScope checks that scope is a valid name for a signature.PolicyTransportScopes keys // (i.e. a valid PolicyConfigurationIdentity() or PolicyConfigurationNamespaces() return value). // It is acceptable to allow an invalid value which will never be matched, it can "only" cause user confusion. // scope passed to this function will not be "", that value is always allowed. func (t daemonTransport) ValidatePolicyConfigurationScope(scope string) error { // ID values cannot be effectively namespaced, and are clearly invalid host:port values. if _, err := digest.Parse(scope); err == nil { return fmt.Errorf(`docker-daemon: can not use algo:digest value %s as a namespace`, scope) } // FIXME? We could be verifying the various character set and length restrictions // from docker/distribution/reference.regexp.go, but other than that there // are few semantically invalid strings. return nil } // daemonReference is an ImageReference for images managed by a local Docker daemon // Exactly one of id and ref can be set. // For daemonImageSource, both id and ref are acceptable, ref must not be a NameOnly (interpreted as all tags in that repository by the daemon) // For daemonImageDestination, it must be a ref, which is NamedTagged. // (We could, in principle, also allow storing images without tagging them, and the user would have to refer to them using the docker image ID = config digest. // Using the config digest requires the caller to parse the manifest themselves, which is very cumbersome; so, for now, we don’t bother.) type daemonReference struct { id digest.Digest ref reference.Named // !reference.IsNameOnly } // ParseReference converts a string, which should not start with the ImageTransport.Name prefix, into an ImageReference. func ParseReference(refString string) (types.ImageReference, error) { // This is intended to be compatible with reference.ParseAnyReference, but more strict about refusing some of the ambiguous cases. // In particular, this rejects unprefixed digest values (64 hex chars), and sha256 digest prefixes (sha256:fewer-than-64-hex-chars). // digest:hexstring is structurally the same as a reponame:tag (meaning docker.io/library/reponame:tag). // reference.ParseAnyReference interprets such strings as digests. if dgst, err := digest.Parse(refString); err == nil { // The daemon explicitly refuses to tag images with a reponame equal to digest.Canonical - but _only_ this digest name. // Other digest references are ambiguous, so refuse them. if dgst.Algorithm() != digest.Canonical { return nil, fmt.Errorf("Invalid docker-daemon: reference %s: only digest algorithm %s accepted", refString, digest.Canonical) } return NewReference(dgst, nil) } ref, err := reference.ParseNormalizedNamed(refString) // This also rejects unprefixed digest values if err != nil { return nil, err } if reference.FamiliarName(ref) == digest.Canonical.String() { return nil, fmt.Errorf("Invalid docker-daemon: reference %s: The %s repository name is reserved for (non-shortened) digest references", refString, digest.Canonical) } return NewReference("", ref) } // NewReference returns a docker-daemon reference for either the supplied image ID (config digest) or the supplied reference (which must satisfy !reference.IsNameOnly) func NewReference(id digest.Digest, ref reference.Named) (types.ImageReference, error) { switch { case id != "" && ref != nil: return nil, errors.New("docker-daemon: reference must not have an image ID and a reference string specified at the same time") case id == "" && ref == nil: return nil, errors.New("docker-daemon: reference must have at least one of an image ID and a reference string") case ref != nil: if reference.IsNameOnly(ref) { return nil, fmt.Errorf("docker-daemon: reference %s has neither a tag nor a digest", reference.FamiliarString(ref)) } // A github.com/distribution/reference value can have a tag and a digest at the same time! // Most versions of docker/reference do not handle that (ignoring the tag), so reject such input. // This MAY be accepted in the future. // (Even if it were supported, the semantics of policy namespaces are unclear - should we drop // the tag or the digest first?) _, isTagged := ref.(reference.NamedTagged) _, isDigested := ref.(reference.Canonical) if isTagged && isDigested { return nil, fmt.Errorf("docker-daemon: references with both a tag and digest are currently not supported") } } return daemonReference{ id: id, ref: ref, }, nil } func (ref daemonReference) Transport() types.ImageTransport { return Transport } // StringWithinTransport returns a string representation of the reference, which MUST be such that // reference.Transport().ParseReference(reference.StringWithinTransport()) returns an equivalent reference. // NOTE: The returned string is not promised to be equal to the original input to ParseReference; // e.g. default attribute values omitted by the user may be filled in the return value, or vice versa. // WARNING: Do not use the return value in the UI to describe an image, it does not contain the Transport().Name() prefix; // instead, see transports.ImageName(). func (ref daemonReference) StringWithinTransport() string { switch { case ref.id != "": return ref.id.String() case ref.ref != nil: return reference.FamiliarString(ref.ref) default: // Coverage: Should never happen, NewReference above should refuse such values. panic("Internal inconsistency: daemonReference has empty id and nil ref") } } // DockerReference returns a Docker reference associated with this reference // (fully explicit, i.e. !reference.IsNameOnly, but reflecting user intent, // not e.g. after redirect or alias processing), or nil if unknown/not applicable. func (ref daemonReference) DockerReference() reference.Named { return ref.ref // May be nil } // PolicyConfigurationIdentity returns a string representation of the reference, suitable for policy lookup. // This MUST reflect user intent, not e.g. after processing of third-party redirects or aliases; // The value SHOULD be fully explicit about its semantics, with no hidden defaults, AND canonical // (i.e. various references with exactly the same semantics should return the same configuration identity) // It is fine for the return value to be equal to StringWithinTransport(), and it is desirable but // not required/guaranteed that it will be a valid input to Transport().ParseReference(). // Returns "" if configuration identities for these references are not supported. func (ref daemonReference) PolicyConfigurationIdentity() string { // We must allow referring to images in the daemon by image ID, otherwise untagged images would not be accessible. // But the existence of image IDs means that we can’t truly well namespace the input: // a single image can be namespaced either using the name or the ID depending on how it is named. // // That’s fairly unexpected, but we have to cope somehow. // // So, use the ordinary docker/policyconfiguration namespacing for named images. // image IDs all fall into the root namespace. // Users can set up the root namespace to be either untrusted or rejected, // and to set up specific trust for named namespaces. This allows verifying image // identity when a name is known, and unnamed images would be untrusted or rejected. switch { case ref.id != "": return "" // This still allows using the default "" scope to define a global policy for ID-identified images. case ref.ref != nil: res, err := policyconfiguration.DockerReferenceIdentity(ref.ref) if res == "" || err != nil { // Coverage: Should never happen, NewReference above should refuse values which could cause a failure. panic(fmt.Sprintf("Internal inconsistency: policyconfiguration.DockerReferenceIdentity returned %#v, %v", res, err)) } return res default: // Coverage: Should never happen, NewReference above should refuse such values. panic("Internal inconsistency: daemonReference has empty id and nil ref") } } // PolicyConfigurationNamespaces returns a list of other policy configuration namespaces to search // for if explicit configuration for PolicyConfigurationIdentity() is not set. The list will be processed // in order, terminating on first match, and an implicit "" is always checked at the end. // It is STRONGLY recommended for the first element, if any, to be a prefix of PolicyConfigurationIdentity(), // and each following element to be a prefix of the element preceding it. func (ref daemonReference) PolicyConfigurationNamespaces() []string { // See the explanation in daemonReference.PolicyConfigurationIdentity. switch { case ref.id != "": return []string{} case ref.ref != nil: return policyconfiguration.DockerReferenceNamespaces(ref.ref) default: // Coverage: Should never happen, NewReference above should refuse such values. panic("Internal inconsistency: daemonReference has empty id and nil ref") } } // NewImage returns a types.ImageCloser for this reference, possibly specialized for this ImageTransport. // The caller must call .Close() on the returned ImageCloser. // NOTE: If any kind of signature verification should happen, build an UnparsedImage from the value returned by NewImageSource, // verify that UnparsedImage, and convert it into a real Image via image.FromUnparsedImage. // WARNING: This may not do the right thing for a manifest list, see image.FromSource for details. func (ref daemonReference) NewImage(ctx context.Context, sys *types.SystemContext) (types.ImageCloser, error) { return image.FromReference(ctx, sys, ref) } // NewImageSource returns a types.ImageSource for this reference. // The caller must call .Close() on the returned ImageSource. func (ref daemonReference) NewImageSource(ctx context.Context, sys *types.SystemContext) (types.ImageSource, error) { return newImageSource(ctx, sys, ref) } // NewImageDestination returns a types.ImageDestination for this reference. // The caller must call .Close() on the returned ImageDestination. func (ref daemonReference) NewImageDestination(ctx context.Context, sys *types.SystemContext) (types.ImageDestination, error) { return newImageDestination(ctx, sys, ref) } // DeleteImage deletes the named image from the registry, if supported. func (ref daemonReference) DeleteImage(ctx context.Context, sys *types.SystemContext) error { // Should this just untag the image? Should this stop running containers? // The semantics is not quite as clear as for remote repositories. // The user can run (docker rmi) directly anyway, so, for now(?), punt instead of trying to guess what the user meant. return errors.New("Deleting images not implemented for docker-daemon: images") } ================================================ FILE: vendor/go.podman.io/image/v5/docker/distribution_error.go ================================================ // Code below is taken from https://github.com/distribution/distribution/blob/a4d9db5a884b70be0c96dd6a7a9dbef4f2798c51/registry/client/errors.go // Copyright 2022 github.com/distribution/distribution authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package docker import ( "encoding/json" "errors" "fmt" "io" "net/http" "slices" "github.com/docker/distribution/registry/api/errcode" ) // errNoErrorsInBody is returned when an HTTP response body parses to an empty // errcode.Errors slice. var errNoErrorsInBody = errors.New("no error details found in HTTP response body") // UnexpectedHTTPStatusError is returned when an unexpected HTTP status is // returned when making a registry api call. type UnexpectedHTTPStatusError struct { // StatusCode code as returned from the server, so callers can // match the exact code to make certain decisions if needed. StatusCode int // status text as displayed in the error message, not exposed as callers should match the number. status string } func (e UnexpectedHTTPStatusError) Error() string { return fmt.Sprintf("received unexpected HTTP status: %s", e.status) } func newUnexpectedHTTPStatusError(resp *http.Response) UnexpectedHTTPStatusError { return UnexpectedHTTPStatusError{ StatusCode: resp.StatusCode, status: resp.Status, } } // unexpectedHTTPResponseError is returned when an expected HTTP status code // is returned, but the content was unexpected and failed to be parsed. type unexpectedHTTPResponseError struct { ParseErr error StatusCode int Response []byte } func (e *unexpectedHTTPResponseError) Error() string { return fmt.Sprintf("error parsing HTTP %d response body: %s: %q", e.StatusCode, e.ParseErr.Error(), string(e.Response)) } func parseHTTPErrorResponse(statusCode int, r io.Reader) error { var errors errcode.Errors body, err := io.ReadAll(r) if err != nil { return err } // For backward compatibility, handle irregularly formatted // messages that contain a "details" field. var detailsErr struct { Details string `json:"details"` } err = json.Unmarshal(body, &detailsErr) if err == nil && detailsErr.Details != "" { switch statusCode { case http.StatusUnauthorized: return errcode.ErrorCodeUnauthorized.WithMessage(detailsErr.Details) case http.StatusTooManyRequests: return errcode.ErrorCodeTooManyRequests.WithMessage(detailsErr.Details) default: return errcode.ErrorCodeUnknown.WithMessage(detailsErr.Details) } } if err := json.Unmarshal(body, &errors); err != nil { return &unexpectedHTTPResponseError{ ParseErr: err, StatusCode: statusCode, Response: body, } } if len(errors) == 0 { // If there was no error specified in the body, return // UnexpectedHTTPResponseError. return &unexpectedHTTPResponseError{ ParseErr: errNoErrorsInBody, StatusCode: statusCode, Response: body, } } return errors } func makeErrorList(err error) []error { if errL, ok := err.(errcode.Errors); ok { return []error(errL) } return []error{err} } func mergeErrors(err1, err2 error) error { return errcode.Errors(append(slices.Clone(makeErrorList(err1)), makeErrorList(err2)...)) } // handleErrorResponse returns error parsed from HTTP response for an // unsuccessful HTTP response code (in the range 400 - 499 inclusive). An // UnexpectedHTTPStatusError returned for response code outside of expected // range. func handleErrorResponse(resp *http.Response) error { switch { case resp.StatusCode == http.StatusUnauthorized: // Check for OAuth errors within the `WWW-Authenticate` header first // See https://tools.ietf.org/html/rfc6750#section-3 for c := range iterateAuthHeader(resp.Header) { if c.Scheme == "bearer" { var err errcode.Error // codes defined at https://tools.ietf.org/html/rfc6750#section-3.1 switch c.Parameters["error"] { case "invalid_token": err.Code = errcode.ErrorCodeUnauthorized case "insufficient_scope": err.Code = errcode.ErrorCodeDenied default: continue } if description := c.Parameters["error_description"]; description != "" { err.Message = description } else { err.Message = err.Code.Message() } return mergeErrors(err, parseHTTPErrorResponse(resp.StatusCode, resp.Body)) } } fallthrough case resp.StatusCode >= 400 && resp.StatusCode < 500: err := parseHTTPErrorResponse(resp.StatusCode, resp.Body) if uErr, ok := err.(*unexpectedHTTPResponseError); ok && resp.StatusCode == 401 { return errcode.ErrorCodeUnauthorized.WithDetail(uErr.Response) } return err } return newUnexpectedHTTPStatusError(resp) } ================================================ FILE: vendor/go.podman.io/image/v5/docker/docker_client.go ================================================ package docker import ( "context" "crypto/tls" "encoding/json" "errors" "fmt" "io" "net/http" "net/url" "os" "path/filepath" "slices" "strconv" "strings" "sync" "time" "github.com/docker/distribution/registry/api/errcode" v2 "github.com/docker/distribution/registry/api/v2" "github.com/docker/go-connections/tlsconfig" digest "github.com/opencontainers/go-digest" imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" "github.com/sirupsen/logrus" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/internal/iolimits" "go.podman.io/image/v5/internal/multierr" "go.podman.io/image/v5/internal/set" "go.podman.io/image/v5/internal/useragent" "go.podman.io/image/v5/manifest" "go.podman.io/image/v5/pkg/docker/config" "go.podman.io/image/v5/pkg/sysregistriesv2" "go.podman.io/image/v5/pkg/tlsclientconfig" "go.podman.io/image/v5/types" "go.podman.io/storage/pkg/fileutils" "go.podman.io/storage/pkg/homedir" "golang.org/x/sync/semaphore" ) const ( dockerHostname = "docker.io" dockerV1Hostname = "index.docker.io" dockerRegistry = "registry-1.docker.io" resolvedPingV2URL = "%s://%s/v2/" tagsPath = "/v2/%s/tags/list" manifestPath = "/v2/%s/manifests/%s" blobsPath = "/v2/%s/blobs/%s" blobUploadPath = "/v2/%s/blobs/uploads/" extensionsSignaturePath = "/extensions/v2/%s/signatures/%s" minimumTokenLifetimeSeconds = 60 extensionSignatureSchemaVersion = 2 // extensionSignature.Version extensionSignatureTypeAtomic = "atomic" // extensionSignature.Type backoffNumIterations = 5 backoffInitialDelay = 2 * time.Second backoffMaxDelay = 60 * time.Second ) type certPath struct { path string absolute bool } var ( homeCertDir = filepath.FromSlash(".config/containers/certs.d") perHostCertDirs = []certPath{ {path: etcDir + "/containers/certs.d", absolute: true}, {path: etcDir + "/docker/certs.d", absolute: true}, } ) // extensionSignature and extensionSignatureList come from github.com/openshift/origin/pkg/dockerregistry/server/signaturedispatcher.go: // signature represents a Docker image signature. type extensionSignature struct { Version int `json:"schemaVersion"` // Version specifies the schema version Name string `json:"name"` // Name must be in "sha256:@signatureName" format Type string `json:"type"` // Type is optional, of not set it will be defaulted to "AtomicImageV1" Content []byte `json:"content"` // Content contains the signature } // signatureList represents list of Docker image signatures. type extensionSignatureList struct { Signatures []extensionSignature `json:"signatures"` } // bearerToken records a cached token we can use to authenticate, or a pending process to obtain one. // // The goroutine obtaining the token holds lock to block concurrent token requests, and fills the structure (err and possibly the other fields) // before releasing the lock. // Other goroutines obtain lock to block on the token request, if any; and then inspect err to see if the token is usable. // If it is not, they try to get a new one. type bearerToken struct { // lock is held while obtaining the token. Potentially nested inside dockerClient.tokenCacheLock. // This is a counting semaphore only because we need a cancellable lock operation. lock *semaphore.Weighted // The following fields can only be accessed with lock held. err error // nil if the token was successfully obtained (but may be expired); an error if the next lock holder _must_ obtain a new token. token string expirationTime time.Time } // dockerClient is configuration for dealing with a single container registry. type dockerClient struct { // The following members are set by newDockerClient and do not change afterwards. sys *types.SystemContext registry string userAgent string // tlsClientConfig is setup by newDockerClient and will be used and updated // by detectProperties(). Callers can edit tlsClientConfig.InsecureSkipVerify in the meantime. tlsClientConfig *tls.Config // The following members are not set by newDockerClient and must be set by callers if needed. auth types.DockerAuthConfig registryToken string signatureBase lookasideStorageBase useSigstoreAttachments bool scope authScope // The following members are detected registry properties: // They are set after a successful detectProperties(), and never change afterwards. client *http.Client scheme string challenges []challenge supportsSignatures bool // Private state for setupRequestAuth tokenCacheLock sync.Mutex // Protects tokenCache. tokenCache map[string]*bearerToken // Private state for detectProperties: detectPropertiesOnce sync.Once // detectPropertiesOnce is used to execute detectProperties() at most once. detectPropertiesError error // detectPropertiesError caches the initial error. // Private state for logResponseWarnings reportedWarningsLock sync.Mutex reportedWarnings *set.Set[string] } type authScope struct { resourceType string remoteName string actions string } // sendAuth determines whether we need authentication for v2 or v1 endpoint. type sendAuth int const ( // v2 endpoint with authentication. v2Auth sendAuth = iota // v1 endpoint with authentication. // TODO: Get v1Auth working // v1Auth // no authentication, works for both v1 and v2. noAuth ) // dockerCertDir returns a path to a directory to be consumed by tlsclientconfig.SetupCertificates() depending on ctx and hostPort. func dockerCertDir(sys *types.SystemContext, hostPort string) (string, error) { if sys != nil && sys.DockerCertPath != "" { return sys.DockerCertPath, nil } if sys != nil && sys.DockerPerHostCertDirPath != "" { return filepath.Join(sys.DockerPerHostCertDirPath, hostPort), nil } var ( hostCertDir string fullCertDirPath string ) for _, perHostCertDir := range append([]certPath{{path: filepath.Join(homedir.Get(), homeCertDir), absolute: false}}, perHostCertDirs...) { if sys != nil && sys.RootForImplicitAbsolutePaths != "" && perHostCertDir.absolute { hostCertDir = filepath.Join(sys.RootForImplicitAbsolutePaths, perHostCertDir.path) } else { hostCertDir = perHostCertDir.path } fullCertDirPath = filepath.Join(hostCertDir, hostPort) err := fileutils.Exists(fullCertDirPath) if err == nil { break } if os.IsNotExist(err) { continue } if os.IsPermission(err) { logrus.Debugf("error accessing certs directory due to permissions: %v", err) continue } return "", err } return fullCertDirPath, nil } // newDockerClientFromRef returns a new dockerClient instance for refHostname (a host a specified in the Docker image reference, not canonicalized to dockerRegistry) // “write” specifies whether the client will be used for "write" access (in particular passed to lookaside.go:toplevelFromSection) // signatureBase is always set in the return value // The caller must call .Close() on the returned client when done. func newDockerClientFromRef(sys *types.SystemContext, ref dockerReference, registryConfig *registryConfiguration, write bool, actions string) (*dockerClient, error) { auth, err := config.GetCredentialsForRef(sys, ref.ref) if err != nil { return nil, fmt.Errorf("getting username and password: %w", err) } sigBase, err := registryConfig.lookasideStorageBaseURL(ref, write) if err != nil { return nil, err } registry := reference.Domain(ref.ref) client, err := newDockerClient(sys, registry, ref.ref.Name()) if err != nil { return nil, err } client.auth = auth if sys != nil { client.registryToken = sys.DockerBearerRegistryToken } client.signatureBase = sigBase client.useSigstoreAttachments = registryConfig.useSigstoreAttachments(ref) client.scope.resourceType = "repository" client.scope.actions = actions client.scope.remoteName = reference.Path(ref.ref) return client, nil } // newDockerClient returns a new dockerClient instance for the given registry // and reference. The reference is used to query the registry configuration // and can either be a registry (e.g, "registry.com[:5000]"), a repository // (e.g., "registry.com[:5000][/some/namespace]/repo"). // Please note that newDockerClient does not set all members of dockerClient // (e.g., username and password); those must be set by callers if necessary. // The caller must call .Close() on the returned client when done. func newDockerClient(sys *types.SystemContext, registry, reference string) (*dockerClient, error) { hostName := registry if registry == dockerHostname { registry = dockerRegistry } var tlsClientConfig *tls.Config if sys != nil && sys.BaseTLSConfig != nil { tlsClientConfig = sys.BaseTLSConfig.Clone() } else { tlsClientConfig = &tls.Config{ // As of 2025-08, tlsconfig.ClientDefault() differs from Go 1.23 defaults only in CipherSuites; // so, limit us to only using that value. If go-connections/tlsconfig changes its policy, we // will want to consider that and make a decision whether to follow suit. // There is some chance that eventually the Go default will be to require TLS 1.3, and that point // we might want to drop the dependency on go-connections entirely. CipherSuites: tlsconfig.ClientDefault().CipherSuites, } } // It is undefined whether the host[:port] string for dockerHostname should be dockerHostname or dockerRegistry, // because docker/docker does not read the certs.d subdirectory at all in that case. We use the user-visible // dockerHostname here, because it is more symmetrical to read the configuration in that case as well, and because // generally the UI hides the existence of the different dockerRegistry. But note that this behavior is // undocumented and may change if docker/docker changes. certDir, err := dockerCertDir(sys, hostName) if err != nil { return nil, err } if err := tlsclientconfig.SetupCertificates(certDir, tlsClientConfig); err != nil { return nil, err } // Check if TLS verification shall be skipped (default=false) which can // be specified in the sysregistriesv2 configuration. skipVerify := false reg, err := sysregistriesv2.FindRegistry(sys, reference) if err != nil { return nil, fmt.Errorf("loading registries: %w", err) } if reg != nil { if reg.Blocked { return nil, fmt.Errorf("registry %s is blocked in one of %s", reg.Prefix, sysregistriesv2.ConfigurationSourceDescription(sys)) } skipVerify = reg.Insecure } tlsClientConfig.InsecureSkipVerify = skipVerify userAgent := useragent.DefaultUserAgent if sys != nil && sys.DockerRegistryUserAgent != "" { userAgent = sys.DockerRegistryUserAgent } return &dockerClient{ sys: sys, registry: registry, userAgent: userAgent, tlsClientConfig: tlsClientConfig, tokenCache: map[string]*bearerToken{}, reportedWarnings: set.New[string](), }, nil } // CheckAuth validates the credentials by attempting to log into the registry // returns an error if an error occurred while making the http request or the status code received was 401 func CheckAuth(ctx context.Context, sys *types.SystemContext, username, password, registry string) error { client, err := newDockerClient(sys, registry, registry) if err != nil { return fmt.Errorf("creating new docker client: %w", err) } defer client.Close() client.auth = types.DockerAuthConfig{ Username: username, Password: password, } resp, err := client.makeRequest(ctx, http.MethodGet, "/v2/", nil, nil, v2Auth, nil) if err != nil { return err } defer resp.Body.Close() if resp.StatusCode != http.StatusOK { err := registryHTTPResponseToError(resp) if resp.StatusCode == http.StatusUnauthorized { err = ErrUnauthorizedForCredentials{Err: err} } return err } return nil } // SearchResult holds the information of each matching image // It matches the output returned by the v1 endpoint type SearchResult struct { Name string `json:"name"` Description string `json:"description"` // StarCount states the number of stars the image has StarCount int `json:"star_count"` IsTrusted bool `json:"is_trusted"` // IsAutomated states whether the image is an automated build IsAutomated bool `json:"is_automated"` // IsOfficial states whether the image is an official build IsOfficial bool `json:"is_official"` } // SearchRegistry queries a registry for images that contain "image" in their name // The limit is the max number of results desired // Note: The limit value doesn't work with all registries // for example registry.access.redhat.com returns all the results without limiting it to the limit value func SearchRegistry(ctx context.Context, sys *types.SystemContext, registry, image string, limit int) ([]SearchResult, error) { type V2Results struct { // Repositories holds the results returned by the /v2/_catalog endpoint Repositories []string `json:"repositories"` } type V1Results struct { // Results holds the results returned by the /v1/search endpoint Results []SearchResult `json:"results"` } v1Res := &V1Results{} // Get credentials from authfile for the underlying hostname // We can't use GetCredentialsForRef here because we want to search the whole registry. auth, err := config.GetCredentials(sys, registry) if err != nil { return nil, fmt.Errorf("getting username and password: %w", err) } // The /v2/_catalog endpoint has been disabled for docker.io therefore // the call made to that endpoint will fail. So using the v1 hostname // for docker.io for simplicity of implementation and the fact that it // returns search results. hostname := registry if registry == dockerHostname { hostname = dockerV1Hostname // A search term of library/foo does not find the library/foo image on the docker.io servers, // which is surprising - and that Docker is modifying the search term client-side this same way, // and it seems convenient to do the same thing. // Read more here: https://github.com/containers/image/pull/2133#issue-1928524334 image = strings.TrimPrefix(image, "library/") } client, err := newDockerClient(sys, hostname, registry) if err != nil { return nil, fmt.Errorf("creating new docker client: %w", err) } defer client.Close() client.auth = auth if sys != nil { client.registryToken = sys.DockerBearerRegistryToken } // Only try the v1 search endpoint if the search query is not empty. If it is // empty skip to the v2 endpoint. if image != "" { // set up the query values for the v1 endpoint u := url.URL{ Path: "/v1/search", } q := u.Query() q.Set("q", image) q.Set("n", strconv.Itoa(limit)) u.RawQuery = q.Encode() logrus.Debugf("trying to talk to v1 search endpoint") resp, err := client.makeRequest(ctx, http.MethodGet, u.String(), nil, nil, noAuth, nil) if err != nil { logrus.Debugf("error getting search results from v1 endpoint %q: %v", registry, err) } else { defer resp.Body.Close() if resp.StatusCode != http.StatusOK { logrus.Debugf("error getting search results from v1 endpoint %q: %v", registry, httpResponseToError(resp, "")) } else { if err := json.NewDecoder(resp.Body).Decode(v1Res); err != nil { return nil, err } return v1Res.Results, nil } } } logrus.Debugf("trying to talk to v2 search endpoint") searchRes := []SearchResult{} path := "/v2/_catalog" for len(searchRes) < limit { resp, err := client.makeRequest(ctx, http.MethodGet, path, nil, nil, v2Auth, nil) if err != nil { logrus.Debugf("error getting search results from v2 endpoint %q: %v", registry, err) return nil, fmt.Errorf("couldn't search registry %q: %w", registry, err) } defer resp.Body.Close() if resp.StatusCode != http.StatusOK { err := registryHTTPResponseToError(resp) logrus.Errorf("error getting search results from v2 endpoint %q: %v", registry, err) return nil, fmt.Errorf("couldn't search registry %q: %w", registry, err) } v2Res := &V2Results{} if err := json.NewDecoder(resp.Body).Decode(v2Res); err != nil { return nil, err } for _, repo := range v2Res.Repositories { if len(searchRes) == limit { break } if strings.Contains(repo, image) { res := SearchResult{ Name: repo, } // bugzilla.redhat.com/show_bug.cgi?id=1976283 // If we have a full match, make sure it's listed as the first result. // (Note there might be a full match we never see if we reach the result limit first.) if repo == image { searchRes = append([]SearchResult{res}, searchRes...) } else { searchRes = append(searchRes, res) } } } link := resp.Header.Get("Link") if link == "" { break } linkURLPart, _, _ := strings.Cut(link, ";") linkURL, err := url.Parse(strings.Trim(linkURLPart, "<>")) if err != nil { return searchRes, err } // can be relative or absolute, but we only want the path (and I // guess we're in trouble if it forwards to a new place...) path = linkURL.Path if linkURL.RawQuery != "" { path += "?" path += linkURL.RawQuery } } return searchRes, nil } // makeRequest creates and executes a http.Request with the specified parameters, adding authentication and TLS options for the Docker client. // The host name and schema is taken from the client or autodetected, and the path is relative to it, i.e. the path usually starts with /v2/. func (c *dockerClient) makeRequest(ctx context.Context, method, path string, headers map[string][]string, stream io.Reader, auth sendAuth, extraScope *authScope) (*http.Response, error) { if err := c.detectProperties(ctx); err != nil { return nil, err } requestURL, err := c.resolveRequestURL(path) if err != nil { return nil, err } return c.makeRequestToResolvedURL(ctx, method, requestURL, headers, stream, -1, auth, extraScope) } // resolveRequestURL turns a path for c.makeRequest into a full URL. // Most users should call makeRequest directly, this exists basically to make the URL available for debug logs. func (c *dockerClient) resolveRequestURL(path string) (*url.URL, error) { urlString := fmt.Sprintf("%s://%s%s", c.scheme, c.registry, path) res, err := url.Parse(urlString) if err != nil { return nil, err } return res, nil } // Checks if the auth headers in the response contain an indication of a failed // authorization because of an "insufficient_scope" error. If that's the case, // returns the required scope to be used for fetching a new token. func needsRetryWithUpdatedScope(res *http.Response) (bool, *authScope) { if res.StatusCode == http.StatusUnauthorized { for challenge := range iterateAuthHeader(res.Header) { if challenge.Scheme == "bearer" { if errmsg, ok := challenge.Parameters["error"]; ok && errmsg == "insufficient_scope" { if scope, ok := challenge.Parameters["scope"]; ok && scope != "" { if newScope, err := parseAuthScope(scope); err == nil { return true, newScope } else { logrus.WithFields(logrus.Fields{ "error": err, "scope": scope, "challenge": challenge, }).Error("Failed to parse the authentication scope from the given challenge") } } } } } } return false, nil } // parseRetryAfter determines the delay required by the "Retry-After" header in res and returns it, // silently falling back to fallbackDelay if the header is missing or invalid. func parseRetryAfter(res *http.Response, fallbackDelay time.Duration) time.Duration { after := res.Header.Get("Retry-After") if after == "" { return fallbackDelay } logrus.Debugf("Detected 'Retry-After' header %q", after) // First, check if we have a numerical value. if num, err := strconv.ParseInt(after, 10, 64); err == nil { return time.Duration(num) * time.Second } // Second, check if we have an HTTP date. if t, err := http.ParseTime(after); err == nil { // If the delta between the date and now is positive, use it. delta := time.Until(t) if delta > 0 { return delta } logrus.Debugf("Retry-After date in the past, ignoring it") return fallbackDelay } logrus.Debugf("Invalid Retry-After format, ignoring it") return fallbackDelay } // makeRequestToResolvedURL creates and executes a http.Request with the specified parameters, adding authentication and TLS options for the Docker client. // streamLen, if not -1, specifies the length of the data expected on stream. // makeRequest should generally be preferred. // In case of an HTTP 429 status code in the response, it may automatically retry a few times. // TODO(runcom): too many arguments here, use a struct func (c *dockerClient) makeRequestToResolvedURL(ctx context.Context, method string, requestURL *url.URL, headers map[string][]string, stream io.Reader, streamLen int64, auth sendAuth, extraScope *authScope) (*http.Response, error) { delay := backoffInitialDelay attempts := 0 for { res, err := c.makeRequestToResolvedURLOnce(ctx, method, requestURL, headers, stream, streamLen, auth, extraScope) if err != nil { return nil, err } attempts++ // By default we use pre-defined scopes per operation. In // certain cases, this can fail when our authentication is // insufficient, then we might be getting an error back with a // Www-Authenticate Header indicating an insufficient scope. // // Check for that and update the client challenges to retry after // requesting a new token // // We only try this on the first attempt, to not overload an // already struggling server. // We also cannot retry with a body (stream != nil) as stream // was already read if attempts == 1 && stream == nil && auth != noAuth { if retry, newScope := needsRetryWithUpdatedScope(res); retry { logrus.Debug("Detected insufficient_scope error, will retry request with updated scope") res.Body.Close() // Note: This retry ignores extraScope. That’s, strictly speaking, incorrect, but we don’t currently // expect the insufficient_scope errors to happen for those callers. If that changes, we can add support // for more than one extra scope. res, err = c.makeRequestToResolvedURLOnce(ctx, method, requestURL, headers, stream, streamLen, auth, newScope) if err != nil { return nil, err } extraScope = newScope } } if res.StatusCode != http.StatusTooManyRequests || // Only retry on StatusTooManyRequests, success or other failure is returned to caller immediately stream != nil || // We can't retry with a body (which is not restartable in the general case) attempts == backoffNumIterations { return res, nil } // close response body before retry or context done res.Body.Close() delay = min(parseRetryAfter(res, delay), backoffMaxDelay) logrus.Debugf("Too many requests to %s: sleeping for %f seconds before next attempt", requestURL.Redacted(), delay.Seconds()) select { case <-ctx.Done(): return nil, ctx.Err() case <-time.After(delay): // Nothing } delay *= 2 // If the registry does not specify a delay, back off exponentially. } } // makeRequestToResolvedURLOnce creates and executes a http.Request with the specified parameters, adding authentication and TLS options for the Docker client. // streamLen, if not -1, specifies the length of the data expected on stream. // makeRequest should generally be preferred. // Note that no exponential back off is performed when receiving an http 429 status code. func (c *dockerClient) makeRequestToResolvedURLOnce(ctx context.Context, method string, resolvedURL *url.URL, headers map[string][]string, stream io.Reader, streamLen int64, auth sendAuth, extraScope *authScope) (*http.Response, error) { req, err := http.NewRequestWithContext(ctx, method, resolvedURL.String(), stream) if err != nil { return nil, err } if streamLen != -1 { // Do not blindly overwrite if streamLen == -1, http.NewRequestWithContext above can figure out the length of bytes.Reader and similar objects without us having to compute it. req.ContentLength = streamLen } req.Header.Set("Docker-Distribution-API-Version", "registry/2.0") for n, h := range headers { for _, hh := range h { req.Header.Add(n, hh) } } req.Header.Add("User-Agent", c.userAgent) if auth == v2Auth { if err := c.setupRequestAuth(req, extraScope); err != nil { return nil, err } } logrus.Debugf("%s %s", method, resolvedURL.Redacted()) res, err := c.client.Do(req) if err != nil { return nil, err } if warnings := res.Header.Values("Warning"); len(warnings) != 0 { c.logResponseWarnings(res, warnings) } return res, nil } // logResponseWarnings logs warningHeaders from res, if any. func (c *dockerClient) logResponseWarnings(res *http.Response, warningHeaders []string) { c.reportedWarningsLock.Lock() defer c.reportedWarningsLock.Unlock() for _, header := range warningHeaders { warningString := parseRegistryWarningHeader(header) if warningString == "" { logrus.Debugf("Ignored Warning: header from registry: %q", header) } else { if !c.reportedWarnings.Contains(warningString) { c.reportedWarnings.Add(warningString) // Note that reportedWarnings is based only on warningString, so that we don’t // repeat the same warning for every request - but the warning includes the URL; // so it may not be specific to that URL. logrus.Warnf("Warning from registry (first encountered at %q): %q", res.Request.URL.Redacted(), warningString) } else { logrus.Debugf("Repeated warning from registry at %q: %q", res.Request.URL.Redacted(), warningString) } } } } // parseRegistryWarningHeader parses a Warning: header per RFC 7234, limited to the warning // values allowed by opencontainers/distribution-spec. // It returns the warning string if the header has the expected format, or "" otherwise. func parseRegistryWarningHeader(header string) string { const expectedPrefix = `299 - "` const expectedSuffix = `"` // warning-value = warn-code SP warn-agent SP warn-text [ SP warn-date ] // distribution-spec requires warn-code=299, warn-agent="-", warn-date missing header, ok := strings.CutPrefix(header, expectedPrefix) if !ok { return "" } header, ok = strings.CutSuffix(header, expectedSuffix) if !ok { return "" } // ”Recipients that process the value of a quoted-string MUST handle a quoted-pair // as if it were replaced by the octet following the backslash.”, so let’s do that… res := strings.Builder{} afterBackslash := false for _, c := range []byte(header) { // []byte because escaping is defined in terms of bytes, not Unicode code points switch { case c == 0x7F || (c < ' ' && c != '\t'): return "" // Control characters are forbidden case afterBackslash: res.WriteByte(c) afterBackslash = false case c == '"': // This terminates the warn-text and warn-date, forbidden by distribution-spec, follows, // or completely invalid input. return "" case c == '\\': afterBackslash = true default: res.WriteByte(c) } } if afterBackslash { return "" } return res.String() } // we're using the challenges from the /v2/ ping response and not the one from the destination // URL in this request because: // // 1) docker does that as well // 2) gcr.io is sending 401 without a WWW-Authenticate header in the real request // // debugging: https://github.com/containers/image/pull/211#issuecomment-273426236 and follows up func (c *dockerClient) setupRequestAuth(req *http.Request, extraScope *authScope) error { if len(c.challenges) == 0 { return nil } schemeNames := make([]string, 0, len(c.challenges)) for _, challenge := range c.challenges { schemeNames = append(schemeNames, challenge.Scheme) switch challenge.Scheme { case "basic": req.SetBasicAuth(c.auth.Username, c.auth.Password) return nil case "bearer": token, err := c.obtainBearerToken(req.Context(), challenge, extraScope) if err != nil { return err } req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", token)) return nil default: logrus.Debugf("no handler for %s authentication", challenge.Scheme) } } logrus.Infof("None of the challenges sent by server (%s) are supported, trying an unauthenticated request anyway", strings.Join(schemeNames, ", ")) return nil } // obtainBearerToken gets an "Authorization: Bearer" token if one is available, or obtains a fresh one. func (c *dockerClient) obtainBearerToken(ctx context.Context, challenge challenge, extraScope *authScope) (string, error) { if c.registryToken != "" { return c.registryToken, nil } cacheKey := "" scopes := []authScope{c.scope} if extraScope != nil { // Using ':' as a separator here is unambiguous because getBearerToken below // uses the same separator when formatting a remote request (and because // repository names that we create can't contain colons, and extraScope values // coming from a server come from `parseAuthScope`, which also splits on colons). cacheKey = fmt.Sprintf("%s:%s:%s", extraScope.resourceType, extraScope.remoteName, extraScope.actions) if colonCount := strings.Count(cacheKey, ":"); colonCount != 2 { return "", fmt.Errorf( "Internal error: there must be exactly 2 colons in the cacheKey ('%s') but got %d", cacheKey, colonCount, ) } scopes = append(scopes, *extraScope) } token, newEntry, err := func() (*bearerToken, bool, error) { // A scope for defer c.tokenCacheLock.Lock() defer c.tokenCacheLock.Unlock() token, ok := c.tokenCache[cacheKey] if ok { return token, false, nil } else { token = &bearerToken{ lock: semaphore.NewWeighted(1), } // If this is a new *bearerToken, lock the entry before adding it to the cache, so that any other goroutine that finds // this entry blocks until we obtain the token for the first time, and does not see an empty object // (and does not try to obtain the token itself when we are going to do so). if err := token.lock.Acquire(ctx, 1); err != nil { // We do not block on this Acquire, so we don’t really expect to fail here — but if ctx is canceled, // there is no point in trying to continue anyway. return nil, false, err } c.tokenCache[cacheKey] = token return token, true, nil } }() if err != nil { return "", err } if !newEntry { // If this is an existing *bearerToken, obtain the lock only after releasing c.tokenCacheLock, // so that users of other cacheKey values are not blocked for the whole duration of our HTTP roundtrip. if err := token.lock.Acquire(ctx, 1); err != nil { return "", err } } defer token.lock.Release(1) if !newEntry && token.err == nil && !time.Now().After(token.expirationTime) { return token.token, nil // We have a usable token already. } if c.auth.IdentityToken != "" { err = c.getBearerTokenOAuth2(ctx, token, challenge, scopes) } else { err = c.getBearerToken(ctx, token, challenge, scopes) } token.err = err if token.err != nil { return "", token.err } return token.token, nil } // getBearerTokenOAuth2 obtains an "Authorization: Bearer" token using a pre-existing identity token per // https://github.com/distribution/distribution/blob/main/docs/spec/auth/oauth.md for challenge and scopes, // and writes it into dest. func (c *dockerClient) getBearerTokenOAuth2(ctx context.Context, dest *bearerToken, challenge challenge, scopes []authScope, ) error { realm, ok := challenge.Parameters["realm"] if !ok { return errors.New("missing realm in bearer auth challenge") } authReq, err := http.NewRequestWithContext(ctx, http.MethodPost, realm, nil) if err != nil { return err } // Make the form data required against the oauth2 authentication // More details here: https://docs.docker.com/registry/spec/auth/oauth/ params := authReq.URL.Query() if service, ok := challenge.Parameters["service"]; ok && service != "" { params.Add("service", service) } for _, scope := range scopes { if scope.resourceType != "" && scope.remoteName != "" && scope.actions != "" { params.Add("scope", fmt.Sprintf("%s:%s:%s", scope.resourceType, scope.remoteName, scope.actions)) } } params.Add("grant_type", "refresh_token") params.Add("refresh_token", c.auth.IdentityToken) params.Add("client_id", "containers/image") authReq.Body = io.NopCloser(strings.NewReader(params.Encode())) authReq.Header.Add("User-Agent", c.userAgent) authReq.Header.Add("Content-Type", "application/x-www-form-urlencoded") logrus.Debugf("%s %s", authReq.Method, authReq.URL.Redacted()) res, err := c.client.Do(authReq) if err != nil { return err } defer res.Body.Close() if err := httpResponseToError(res, "Trying to obtain access token"); err != nil { return err } return dest.readFromHTTPResponseBody(res) } // getBearerToken obtains an "Authorization: Bearer" token using a GET request, per // https://github.com/distribution/distribution/blob/main/docs/spec/auth/token.md for challenge and scopes, // and writes it into dest. func (c *dockerClient) getBearerToken(ctx context.Context, dest *bearerToken, challenge challenge, scopes []authScope, ) error { realm, ok := challenge.Parameters["realm"] if !ok { return errors.New("missing realm in bearer auth challenge") } authReq, err := http.NewRequestWithContext(ctx, http.MethodGet, realm, nil) if err != nil { return err } params := authReq.URL.Query() if c.auth.Username != "" { params.Add("account", c.auth.Username) } if service, ok := challenge.Parameters["service"]; ok && service != "" { params.Add("service", service) } for _, scope := range scopes { if scope.resourceType != "" && scope.remoteName != "" && scope.actions != "" { params.Add("scope", fmt.Sprintf("%s:%s:%s", scope.resourceType, scope.remoteName, scope.actions)) } } authReq.URL.RawQuery = params.Encode() if c.auth.Username != "" && c.auth.Password != "" { authReq.SetBasicAuth(c.auth.Username, c.auth.Password) } authReq.Header.Add("User-Agent", c.userAgent) logrus.Debugf("%s %s", authReq.Method, authReq.URL.Redacted()) res, err := c.client.Do(authReq) if err != nil { return err } defer res.Body.Close() if err := httpResponseToError(res, "Requesting bearer token"); err != nil { return err } return dest.readFromHTTPResponseBody(res) } // readFromHTTPResponseBody sets token data by parsing a http.Response. // The caller is still responsible for ensuring res.Body is closed. func (bt *bearerToken) readFromHTTPResponseBody(res *http.Response) error { blob, err := iolimits.ReadAtMost(res.Body, iolimits.MaxAuthTokenBodySize) if err != nil { return err } var token struct { Token string `json:"token"` AccessToken string `json:"access_token"` ExpiresIn int `json:"expires_in"` IssuedAt time.Time `json:"issued_at"` expirationTime time.Time } if err := json.Unmarshal(blob, &token); err != nil { const bodySampleLength = 50 bodySample := blob if len(bodySample) > bodySampleLength { bodySample = bodySample[:bodySampleLength] } return fmt.Errorf("decoding bearer token (last URL %q, body start %q): %w", res.Request.URL.Redacted(), string(bodySample), err) } bt.token = token.Token if bt.token == "" { bt.token = token.AccessToken } if token.ExpiresIn < minimumTokenLifetimeSeconds { token.ExpiresIn = minimumTokenLifetimeSeconds logrus.Debugf("Increasing token expiration to: %d seconds", token.ExpiresIn) } if token.IssuedAt.IsZero() { token.IssuedAt = time.Now().UTC() } bt.expirationTime = token.IssuedAt.Add(time.Duration(token.ExpiresIn) * time.Second) return nil } // detectPropertiesHelper performs the work of detectProperties which executes // it at most once. func (c *dockerClient) detectPropertiesHelper(ctx context.Context) error { // We overwrite the TLS clients `InsecureSkipVerify` only if explicitly // specified by the system context if c.sys != nil && c.sys.DockerInsecureSkipTLSVerify != types.OptionalBoolUndefined { c.tlsClientConfig.InsecureSkipVerify = c.sys.DockerInsecureSkipTLSVerify == types.OptionalBoolTrue } tr := tlsclientconfig.NewTransport() tr.TLSClientConfig = c.tlsClientConfig // if set DockerProxyURL explicitly, use the DockerProxyURL instead of system proxy if c.sys != nil && c.sys.DockerProxyURL != nil { tr.Proxy = http.ProxyURL(c.sys.DockerProxyURL) } if c.sys != nil && c.sys.DockerProxy != nil { tr.Proxy = func(request *http.Request) (*url.URL, error) { return c.sys.DockerProxy(request.URL) } } c.client = &http.Client{Transport: tr} ping := func(scheme string) error { pingURL, err := url.Parse(fmt.Sprintf(resolvedPingV2URL, scheme, c.registry)) if err != nil { return err } resp, err := c.makeRequestToResolvedURL(ctx, http.MethodGet, pingURL, nil, nil, -1, noAuth, nil) if err != nil { logrus.Debugf("Ping %s err %s (%#v)", pingURL.Redacted(), err.Error(), err) return err } defer resp.Body.Close() logrus.Debugf("Ping %s status %d", pingURL.Redacted(), resp.StatusCode) if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusUnauthorized { return registryHTTPResponseToError(resp) } c.challenges = slices.Collect(iterateAuthHeader(resp.Header)) c.scheme = scheme c.supportsSignatures = resp.Header.Get("X-Registry-Supports-Signatures") == "1" return nil } err := ping("https") if err != nil && c.tlsClientConfig.InsecureSkipVerify { err = ping("http") } if err != nil { err = fmt.Errorf("pinging container registry %s: %w", c.registry, err) } return err } // detectProperties detects various properties of the registry. // See the dockerClient documentation for members which are affected by this. func (c *dockerClient) detectProperties(ctx context.Context) error { c.detectPropertiesOnce.Do(func() { c.detectPropertiesError = c.detectPropertiesHelper(ctx) }) return c.detectPropertiesError } // fetchManifest fetches a manifest for (the repo of ref) + tagOrDigest. // The caller is responsible for ensuring tagOrDigest uses the expected format. func (c *dockerClient) fetchManifest(ctx context.Context, ref dockerReference, tagOrDigest string) ([]byte, string, error) { path := fmt.Sprintf(manifestPath, reference.Path(ref.ref), tagOrDigest) headers := map[string][]string{ "Accept": manifest.DefaultRequestedManifestMIMETypes, } res, err := c.makeRequest(ctx, http.MethodGet, path, headers, nil, v2Auth, nil) if err != nil { return nil, "", err } logrus.Debugf("Content-Type from manifest GET is %q", res.Header.Get("Content-Type")) defer res.Body.Close() if res.StatusCode != http.StatusOK { return nil, "", fmt.Errorf("reading manifest %s in %s: %w", tagOrDigest, ref.ref.Name(), registryHTTPResponseToError(res)) } manblob, err := iolimits.ReadAtMost(res.Body, iolimits.MaxManifestBodySize) if err != nil { return nil, "", err } return manblob, simplifyContentType(res.Header.Get("Content-Type")), nil } // getExternalBlob returns the reader of the first available blob URL from urls, which must not be empty. // This function can return nil reader when no url is supported by this function. In this case, the caller // should fallback to fetch the non-external blob (i.e. pull from the registry). func (c *dockerClient) getExternalBlob(ctx context.Context, urls []string) (io.ReadCloser, int64, error) { if len(urls) == 0 { return nil, 0, errors.New("internal error: getExternalBlob called with no URLs") } var remoteErrors []error for _, u := range urls { blobURL, err := url.Parse(u) if err != nil || (blobURL.Scheme != "http" && blobURL.Scheme != "https") { continue // unsupported url. skip this url. } // NOTE: we must not authenticate on additional URLs as those // can be abused to leak credentials or tokens. Please // refer to CVE-2020-15157 for more information. resp, err := c.makeRequestToResolvedURL(ctx, http.MethodGet, blobURL, nil, nil, -1, noAuth, nil) if err != nil { remoteErrors = append(remoteErrors, err) continue } if resp.StatusCode != http.StatusOK { err := fmt.Errorf("error fetching external blob from %q: %w", u, newUnexpectedHTTPStatusError(resp)) remoteErrors = append(remoteErrors, err) logrus.Debug(err) resp.Body.Close() continue } size, err := getBlobSize(resp) if err != nil { size = -1 } return resp.Body, size, nil } if remoteErrors == nil { return nil, 0, nil // fallback to non-external blob } return nil, 0, fmt.Errorf("failed fetching external blob from all urls: %w", multierr.Format("", ", ", "", remoteErrors)) } func getBlobSize(resp *http.Response) (int64, error) { hdrs := resp.Header.Values("Content-Length") if len(hdrs) == 0 { return -1, errors.New(`Missing "Content-Length" header in response`) } hdr := hdrs[0] // Equivalent to resp.Header.Get(…) size, err := strconv.ParseInt(hdr, 10, 64) if err != nil { // Go’s response reader should already reject such values. return -1, err } if size < 0 { // '-' is not a valid character in Content-Length, so negative values are invalid. Go’s response reader should already reject such values. return -1, fmt.Errorf(`Invalid negative "Content-Length" %q`, hdr) } return size, nil } // getBlob returns a stream for the specified blob in ref, and the blob’s size (or -1 if unknown). // The Digest field in BlobInfo is guaranteed to be provided, Size may be -1 and MediaType may be optionally provided. // May update BlobInfoCache, preferably after it knows for certain that a blob truly exists at a specific location. func (c *dockerClient) getBlob(ctx context.Context, ref dockerReference, info types.BlobInfo, cache types.BlobInfoCache) (io.ReadCloser, int64, error) { if len(info.URLs) != 0 { r, s, err := c.getExternalBlob(ctx, info.URLs) if err != nil { return nil, 0, err } else if r != nil { return r, s, nil } } if err := info.Digest.Validate(); err != nil { // Make sure info.Digest.String() does not contain any unexpected characters return nil, 0, err } path := fmt.Sprintf(blobsPath, reference.Path(ref.ref), info.Digest.String()) logrus.Debugf("Downloading %s", path) res, err := c.makeRequest(ctx, http.MethodGet, path, nil, nil, v2Auth, nil) if err != nil { return nil, 0, err } if res.StatusCode != http.StatusOK { err := registryHTTPResponseToError(res) res.Body.Close() return nil, 0, fmt.Errorf("fetching blob: %w", err) } cache.RecordKnownLocation(ref.Transport(), bicTransportScope(ref), info.Digest, newBICLocationReference(ref)) blobSize, err := getBlobSize(res) if err != nil { // See above, we don't guarantee returning a size logrus.Debugf("failed to get blob size: %v", err) blobSize = -1 } reconnectingReader, err := newBodyReader(ctx, c, path, res.Body) if err != nil { res.Body.Close() return nil, 0, err } return reconnectingReader, blobSize, nil } // getOCIDescriptorContents returns the contents a blob specified by descriptor in ref, which must fit within limit. func (c *dockerClient) getOCIDescriptorContents(ctx context.Context, ref dockerReference, desc imgspecv1.Descriptor, maxSize int, cache types.BlobInfoCache) ([]byte, error) { // Note that this copies all kinds of attachments: attestations, and whatever else is there, // not just signatures. We leave the signature consumers to decide based on the MIME type. if err := desc.Digest.Validate(); err != nil { // .Algorithm() might panic without this check return nil, fmt.Errorf("invalid digest %q: %w", desc.Digest.String(), err) } digestAlgorithm := desc.Digest.Algorithm() if !digestAlgorithm.Available() { return nil, fmt.Errorf("invalid digest %q: unsupported digest algorithm %q", desc.Digest.String(), digestAlgorithm.String()) } reader, _, err := c.getBlob(ctx, ref, manifest.BlobInfoFromOCI1Descriptor(desc), cache) if err != nil { return nil, err } defer reader.Close() payload, err := iolimits.ReadAtMost(reader, maxSize) if err != nil { return nil, fmt.Errorf("reading blob %s in %s: %w", desc.Digest.String(), ref.ref.Name(), err) } actualDigest := digestAlgorithm.FromBytes(payload) if actualDigest != desc.Digest { return nil, fmt.Errorf("digest mismatch, expected %q, got %q", desc.Digest.String(), actualDigest.String()) } return payload, nil } // isManifestUnknownError returns true iff err from fetchManifest is a “manifest unknown” error. func isManifestUnknownError(err error) bool { // docker/distribution, and as defined in the spec var ec errcode.ErrorCoder if errors.As(err, &ec) && ec.ErrorCode() == v2.ErrorCodeManifestUnknown { return true } // registry.redhat.io as of October 2022 var e errcode.Error if errors.As(err, &e) && e.ErrorCode() == errcode.ErrorCodeUnknown && e.Message == "Not Found" { return true } // Harbor v2.10.2 if errors.As(err, &e) && e.ErrorCode() == errcode.ErrorCodeUnknown && strings.Contains(strings.ToLower(e.Message), "not found") { return true } // opencontainers/distribution-spec does not require the errcode.Error payloads to be used, // but specifies that the HTTP status must be 404. var unexpected *unexpectedHTTPResponseError if errors.As(err, &unexpected) && unexpected.StatusCode == http.StatusNotFound { return true } return false } // getSigstoreAttachmentManifest loads and parses the manifest for sigstore attachments for // digest in ref. // It returns (nil, nil) if the manifest does not exist. func (c *dockerClient) getSigstoreAttachmentManifest(ctx context.Context, ref dockerReference, digest digest.Digest) (*manifest.OCI1, error) { tag, err := sigstoreAttachmentTag(digest) if err != nil { return nil, err } sigstoreRef, err := reference.WithTag(reference.TrimNamed(ref.ref), tag) if err != nil { return nil, err } logrus.Debugf("Looking for sigstore attachments in %s", sigstoreRef.String()) manifestBlob, mimeType, err := c.fetchManifest(ctx, ref, tag) if err != nil { // FIXME: Are we going to need better heuristics?? // This alone is probably a good enough reason for sigstore to be opt-in only, // otherwise we would just break ordinary copies. if isManifestUnknownError(err) { logrus.Debugf("Fetching sigstore attachment manifest failed, assuming it does not exist: %v", err) return nil, nil } logrus.Debugf("Fetching sigstore attachment manifest failed: %v", err) return nil, err } if mimeType != imgspecv1.MediaTypeImageManifest { // FIXME: Try anyway?? return nil, fmt.Errorf("unexpected MIME type for sigstore attachment manifest %s: %q", sigstoreRef.String(), mimeType) } res, err := manifest.OCI1FromManifest(manifestBlob) if err != nil { return nil, fmt.Errorf("parsing manifest %s: %w", sigstoreRef.String(), err) } return res, nil } // getExtensionsSignatures returns signatures from the X-Registry-Supports-Signatures API extension, // using the original data structures. func (c *dockerClient) getExtensionsSignatures(ctx context.Context, ref dockerReference, manifestDigest digest.Digest) (*extensionSignatureList, error) { if err := manifestDigest.Validate(); err != nil { // Make sure manifestDigest.String() does not contain any unexpected characters return nil, err } path := fmt.Sprintf(extensionsSignaturePath, reference.Path(ref.ref), manifestDigest) res, err := c.makeRequest(ctx, http.MethodGet, path, nil, nil, v2Auth, nil) if err != nil { return nil, err } defer res.Body.Close() if res.StatusCode != http.StatusOK { return nil, fmt.Errorf("downloading signatures for %s in %s: %w", manifestDigest, ref.ref.Name(), registryHTTPResponseToError(res)) } body, err := iolimits.ReadAtMost(res.Body, iolimits.MaxSignatureListBodySize) if err != nil { return nil, err } var parsedBody extensionSignatureList if err := json.Unmarshal(body, &parsedBody); err != nil { return nil, fmt.Errorf("decoding signature list: %w", err) } return &parsedBody, nil } // sigstoreAttachmentTag returns a sigstore attachment tag for the specified digest. func sigstoreAttachmentTag(d digest.Digest) (string, error) { if err := d.Validate(); err != nil { // Make sure d.String() doesn’t contain any unexpected characters return "", err } return strings.Replace(d.String(), ":", "-", 1) + ".sig", nil } // Close removes resources associated with an initialized dockerClient, if any. func (c *dockerClient) Close() error { if c.client != nil { c.client.CloseIdleConnections() } return nil } ================================================ FILE: vendor/go.podman.io/image/v5/docker/docker_image.go ================================================ package docker import ( "context" "encoding/json" "errors" "fmt" "net/http" "net/url" "strings" "github.com/opencontainers/go-digest" "github.com/sirupsen/logrus" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/internal/image" "go.podman.io/image/v5/manifest" "go.podman.io/image/v5/types" ) // Image is a Docker-specific implementation of types.ImageCloser with a few extra methods // which are specific to Docker. type Image struct { types.ImageCloser src *dockerImageSource } // newImage returns a new Image interface type after setting up // a client to the registry hosting the given image. // The caller must call .Close() on the returned Image. func newImage(ctx context.Context, sys *types.SystemContext, ref dockerReference) (types.ImageCloser, error) { s, err := newImageSource(ctx, sys, ref) if err != nil { return nil, err } img, err := image.FromSource(ctx, sys, s) if err != nil { return nil, err } return &Image{ImageCloser: img, src: s}, nil } // SourceRefFullName returns a fully expanded name for the repository this image is in. func (i *Image) SourceRefFullName() string { return i.src.logicalRef.ref.Name() } // GetRepositoryTags list all tags available in the repository. The tag // provided inside the ImageReference will be ignored. (This is a // backward-compatible shim method which calls the module-level // GetRepositoryTags) func (i *Image) GetRepositoryTags(ctx context.Context) ([]string, error) { return GetRepositoryTags(ctx, i.src.c.sys, i.src.logicalRef) } // GetRepositoryTags list all tags available in the repository. The tag // provided inside the ImageReference will be ignored. func GetRepositoryTags(ctx context.Context, sys *types.SystemContext, ref types.ImageReference) ([]string, error) { dr, ok := ref.(dockerReference) if !ok { return nil, errors.New("ref must be a dockerReference") } registryConfig, err := loadRegistryConfiguration(sys) if err != nil { return nil, err } path := fmt.Sprintf(tagsPath, reference.Path(dr.ref)) client, err := newDockerClientFromRef(sys, dr, registryConfig, false, "pull") if err != nil { return nil, fmt.Errorf("failed to create client: %w", err) } defer client.Close() tags := make([]string, 0) for { res, err := client.makeRequest(ctx, http.MethodGet, path, nil, nil, v2Auth, nil) if err != nil { return nil, err } defer res.Body.Close() if res.StatusCode != http.StatusOK { return nil, fmt.Errorf("fetching tags list: %w", registryHTTPResponseToError(res)) } var tagsHolder struct { Tags []string } if err = json.NewDecoder(res.Body).Decode(&tagsHolder); err != nil { return nil, err } for _, tag := range tagsHolder.Tags { if _, err := reference.WithTag(dr.ref, tag); err != nil { // Ensure the tag does not contain unexpected values // Per https://github.com/containers/skopeo/issues/2409 , Sonatype Nexus 3.58, contrary // to the spec, may include JSON null values in the list; and Go silently parses them as "". if tag == "" { logrus.Debugf("Ignoring invalid empty tag") continue } // Per https://github.com/containers/skopeo/issues/2346 , unknown versions of JFrog Artifactory, // contrary to the tag format specified in // https://github.com/opencontainers/distribution-spec/blob/8a871c8234977df058f1a14e299fe0a673853da2/spec.md?plain=1#L160 , // include digests in the list. if _, err := digest.Parse(tag); err == nil { logrus.Debugf("Ignoring invalid tag %q matching a digest format", tag) continue } return nil, fmt.Errorf("registry returned invalid tag %q: %w", tag, err) } tags = append(tags, tag) } link := res.Header.Get("Link") if link == "" { break } linkURLPart, _, _ := strings.Cut(link, ";") linkURL, err := url.Parse(strings.Trim(linkURLPart, "<>")) if err != nil { return tags, err } // can be relative or absolute, but we only want the path (and I // guess we're in trouble if it forwards to a new place...) path = linkURL.Path if linkURL.RawQuery != "" { path += "?" path += linkURL.RawQuery } } return tags, nil } // GetDigest returns the image's digest // Use this to optimize and avoid use of an ImageSource based on the returned digest; // if you are going to use an ImageSource anyway, it’s more efficient to create it first // and compute the digest from the value returned by GetManifest. // NOTE: Implemented to avoid Docker Hub API limits, and mirror configuration may be // ignored (but may be implemented in the future) func GetDigest(ctx context.Context, sys *types.SystemContext, ref types.ImageReference) (digest.Digest, error) { dr, ok := ref.(dockerReference) if !ok { return "", errors.New("ref must be a dockerReference") } if dr.isUnknownDigest { return "", fmt.Errorf("docker: reference %q is for unknown digest case; cannot get digest", dr.StringWithinTransport()) } tagOrDigest, err := dr.tagOrDigest() if err != nil { return "", err } registryConfig, err := loadRegistryConfiguration(sys) if err != nil { return "", err } client, err := newDockerClientFromRef(sys, dr, registryConfig, false, "pull") if err != nil { return "", fmt.Errorf("failed to create client: %w", err) } defer client.Close() path := fmt.Sprintf(manifestPath, reference.Path(dr.ref), tagOrDigest) headers := map[string][]string{ "Accept": manifest.DefaultRequestedManifestMIMETypes, } res, err := client.makeRequest(ctx, http.MethodHead, path, headers, nil, v2Auth, nil) if err != nil { return "", err } defer res.Body.Close() if res.StatusCode != http.StatusOK { return "", fmt.Errorf("reading digest %s in %s: %w", tagOrDigest, dr.ref.Name(), registryHTTPResponseToError(res)) } dig, err := digest.Parse(res.Header.Get("Docker-Content-Digest")) if err != nil { return "", err } return dig, nil } ================================================ FILE: vendor/go.podman.io/image/v5/docker/docker_image_dest.go ================================================ package docker import ( "bytes" "context" "crypto/rand" "encoding/json" "errors" "fmt" "io" "maps" "net/http" "net/url" "os" "path/filepath" "slices" "strings" "github.com/docker/distribution/registry/api/errcode" v2 "github.com/docker/distribution/registry/api/v2" "github.com/opencontainers/go-digest" imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" "github.com/sirupsen/logrus" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/internal/blobinfocache" "go.podman.io/image/v5/internal/imagedestination/impl" "go.podman.io/image/v5/internal/imagedestination/stubs" "go.podman.io/image/v5/internal/iolimits" "go.podman.io/image/v5/internal/private" "go.podman.io/image/v5/internal/putblobdigest" "go.podman.io/image/v5/internal/set" "go.podman.io/image/v5/internal/signature" "go.podman.io/image/v5/internal/streamdigest" "go.podman.io/image/v5/internal/uploadreader" "go.podman.io/image/v5/manifest" "go.podman.io/image/v5/pkg/blobinfocache/none" compressiontypes "go.podman.io/image/v5/pkg/compression/types" "go.podman.io/image/v5/types" ) type dockerImageDestination struct { impl.Compat impl.PropertyMethodsInitialize stubs.IgnoresOriginalOCIConfig stubs.NoPutBlobPartialInitialize ref dockerReference c *dockerClient // State manifestDigest digest.Digest // or "" if not yet known. } // newImageDestination creates a new ImageDestination for the specified image reference. func newImageDestination(sys *types.SystemContext, ref dockerReference) (private.ImageDestination, error) { registryConfig, err := loadRegistryConfiguration(sys) if err != nil { return nil, err } c, err := newDockerClientFromRef(sys, ref, registryConfig, true, "pull,push") if err != nil { return nil, err } mimeTypes := []string{ imgspecv1.MediaTypeImageManifest, manifest.DockerV2Schema2MediaType, imgspecv1.MediaTypeImageIndex, manifest.DockerV2ListMediaType, } if c.sys == nil || !c.sys.DockerDisableDestSchema1MIMETypes { mimeTypes = append(mimeTypes, manifest.DockerV2Schema1SignedMediaType, manifest.DockerV2Schema1MediaType) } dest := &dockerImageDestination{ PropertyMethodsInitialize: impl.PropertyMethods(impl.Properties{ SupportedManifestMIMETypes: mimeTypes, DesiredLayerCompression: types.Compress, MustMatchRuntimeOS: false, IgnoresEmbeddedDockerReference: false, // We do want the manifest updated; older registry versions refuse manifests if the embedded reference does not match. HasThreadSafePutBlob: true, }), NoPutBlobPartialInitialize: stubs.NoPutBlobPartial(ref), ref: ref, c: c, } dest.Compat = impl.AddCompat(dest) return dest, nil } // Reference returns the reference used to set up this destination. Note that this should directly correspond to user's intent, // e.g. it should use the public hostname instead of the result of resolving CNAMEs or following redirects. func (d *dockerImageDestination) Reference() types.ImageReference { return d.ref } // Close removes resources associated with an initialized ImageDestination, if any. func (d *dockerImageDestination) Close() error { return d.c.Close() } // SupportsSignatures returns an error (to be displayed to the user) if the destination certainly can't store signatures. // Note: It is still possible for PutSignatures to fail if SupportsSignatures returns nil. func (d *dockerImageDestination) SupportsSignatures(ctx context.Context) error { if err := d.c.detectProperties(ctx); err != nil { return err } switch { case d.c.supportsSignatures: return nil case d.c.signatureBase != nil: return nil default: return errors.New("Internal error: X-Registry-Supports-Signatures extension not supported, and lookaside should not be empty configuration") } } // AcceptsForeignLayerURLs returns false iff foreign layers in manifest should be actually // uploaded to the image destination, true otherwise. func (d *dockerImageDestination) AcceptsForeignLayerURLs() bool { return true } // sizeCounter is an io.Writer which only counts the total size of its input. type sizeCounter struct{ size int64 } func (c *sizeCounter) Write(p []byte) (n int, err error) { c.size += int64(len(p)) return len(p), nil } // PutBlobWithOptions writes contents of stream and returns data representing the result. // inputInfo.Digest can be optionally provided if known; if provided, and stream is read to the end without error, the digest MUST match the stream contents. // inputInfo.Size is the expected length of stream, if known. // inputInfo.MediaType describes the blob format, if known. // WARNING: The contents of stream are being verified on the fly. Until stream.Read() returns io.EOF, the contents of the data SHOULD NOT be available // to any other readers for download using the supplied digest. // If stream.Read() at any time, ESPECIALLY at end of input, returns an error, PutBlobWithOptions MUST 1) fail, and 2) delete any data stored so far. func (d *dockerImageDestination) PutBlobWithOptions(ctx context.Context, stream io.Reader, inputInfo types.BlobInfo, options private.PutBlobOptions) (private.UploadedBlob, error) { // If requested, precompute the blob digest to prevent uploading layers that already exist on the registry. // This functionality is particularly useful when BlobInfoCache has not been populated with compressed digests, // the source blob is uncompressed, and the destination blob is being compressed "on the fly". if inputInfo.Digest == "" && d.c.sys != nil && d.c.sys.DockerRegistryPushPrecomputeDigests { logrus.Debugf("Precomputing digest layer for %s", reference.Path(d.ref.ref)) streamCopy, cleanup, err := streamdigest.ComputeBlobInfo(d.c.sys, stream, &inputInfo) if err != nil { return private.UploadedBlob{}, err } defer cleanup() stream = streamCopy } if inputInfo.Digest != "" { // This should not really be necessary, at least the copy code calls TryReusingBlob automatically. // Still, we need to check, if only because the "initiate upload" endpoint does not have a documented "blob already exists" return value. haveBlob, reusedInfo, err := d.tryReusingExactBlob(ctx, inputInfo, options.Cache) if err != nil { return private.UploadedBlob{}, err } if haveBlob { return private.UploadedBlob{Digest: reusedInfo.Digest, Size: reusedInfo.Size}, nil } } // FIXME? Chunked upload, progress reporting, etc. uploadPath := fmt.Sprintf(blobUploadPath, reference.Path(d.ref.ref)) logrus.Debugf("Uploading %s", uploadPath) res, err := d.c.makeRequest(ctx, http.MethodPost, uploadPath, nil, nil, v2Auth, nil) if err != nil { return private.UploadedBlob{}, err } defer res.Body.Close() if res.StatusCode != http.StatusAccepted { logrus.Debugf("Error initiating layer upload, response %#v", *res) return private.UploadedBlob{}, fmt.Errorf("initiating layer upload to %s in %s: %w", uploadPath, d.c.registry, registryHTTPResponseToError(res)) } uploadLocation, err := res.Location() if err != nil { return private.UploadedBlob{}, fmt.Errorf("determining upload URL: %w", err) } digester, stream := putblobdigest.DigestIfCanonicalUnknown(stream, inputInfo) sizeCounter := &sizeCounter{} stream = io.TeeReader(stream, sizeCounter) uploadLocation, err = func() (*url.URL, error) { // A scope for defer uploadReader := uploadreader.NewUploadReader(stream) // This error text should never be user-visible, we terminate only after makeRequestToResolvedURL // returns, so there isn’t a way for the error text to be provided to any of our callers. defer uploadReader.Terminate(errors.New("Reading data from an already terminated upload")) res, err = d.c.makeRequestToResolvedURL(ctx, http.MethodPatch, uploadLocation, map[string][]string{"Content-Type": {"application/octet-stream"}}, uploadReader, inputInfo.Size, v2Auth, nil) if err != nil { logrus.Debugf("Error uploading layer chunked %v", err) return nil, err } defer res.Body.Close() if !successStatus(res.StatusCode) { return nil, fmt.Errorf("uploading layer chunked: %w", registryHTTPResponseToError(res)) } uploadLocation, err := res.Location() if err != nil { return nil, fmt.Errorf("determining upload URL: %w", err) } return uploadLocation, nil }() if err != nil { return private.UploadedBlob{}, err } blobDigest := digester.Digest() // FIXME: DELETE uploadLocation on failure (does not really work in docker/distribution servers, which incorrectly require the "delete" action in the token's scope) locationQuery := uploadLocation.Query() locationQuery.Set("digest", blobDigest.String()) uploadLocation.RawQuery = locationQuery.Encode() res, err = d.c.makeRequestToResolvedURL(ctx, http.MethodPut, uploadLocation, map[string][]string{"Content-Type": {"application/octet-stream"}}, nil, -1, v2Auth, nil) if err != nil { return private.UploadedBlob{}, err } defer res.Body.Close() if res.StatusCode != http.StatusCreated { logrus.Debugf("Error uploading layer, response %#v", *res) return private.UploadedBlob{}, fmt.Errorf("uploading layer to %s: %w", uploadLocation, registryHTTPResponseToError(res)) } logrus.Debugf("Upload of layer %s complete", blobDigest) options.Cache.RecordKnownLocation(d.ref.Transport(), bicTransportScope(d.ref), blobDigest, newBICLocationReference(d.ref)) return private.UploadedBlob{Digest: blobDigest, Size: sizeCounter.size}, nil } // blobExists returns true iff repo contains a blob with digest, and if so, also its size. // If the destination does not contain the blob, or it is unknown, blobExists ordinarily returns (false, -1, nil); // it returns a non-nil error only on an unexpected failure. func (d *dockerImageDestination) blobExists(ctx context.Context, repo reference.Named, digest digest.Digest, extraScope *authScope) (bool, int64, error) { if err := digest.Validate(); err != nil { // Make sure digest.String() does not contain any unexpected characters return false, -1, err } checkPath := fmt.Sprintf(blobsPath, reference.Path(repo), digest.String()) logrus.Debugf("Checking %s", checkPath) res, err := d.c.makeRequest(ctx, http.MethodHead, checkPath, nil, nil, v2Auth, extraScope) if err != nil { return false, -1, err } defer res.Body.Close() switch res.StatusCode { case http.StatusOK: size, err := getBlobSize(res) if err != nil { return false, -1, fmt.Errorf("determining size of blob %s in %s: %w", digest, repo.Name(), err) } logrus.Debugf("... already exists") return true, size, nil case http.StatusUnauthorized: logrus.Debugf("... not authorized") return false, -1, fmt.Errorf("checking whether a blob %s exists in %s: %w", digest, repo.Name(), registryHTTPResponseToError(res)) case http.StatusNotFound: logrus.Debugf("... not present") return false, -1, nil default: return false, -1, fmt.Errorf("checking whether a blob %s exists in %s: %w", digest, repo.Name(), registryHTTPResponseToError(res)) } } // mountBlob tries to mount blob srcDigest from srcRepo to the current destination. func (d *dockerImageDestination) mountBlob(ctx context.Context, srcRepo reference.Named, srcDigest digest.Digest, extraScope *authScope) error { u := url.URL{ Path: fmt.Sprintf(blobUploadPath, reference.Path(d.ref.ref)), RawQuery: url.Values{ "mount": {srcDigest.String()}, "from": {reference.Path(srcRepo)}, }.Encode(), } logrus.Debugf("Trying to mount %s", u.Redacted()) res, err := d.c.makeRequest(ctx, http.MethodPost, u.String(), nil, nil, v2Auth, extraScope) if err != nil { return err } defer res.Body.Close() switch res.StatusCode { case http.StatusCreated: logrus.Debugf("... mount OK") return nil case http.StatusAccepted: // Oops, the mount was ignored - either the registry does not support that yet, or the blob does not exist; the registry has started an ordinary upload process. // Abort, and let the ultimate caller do an upload when its ready, instead. // NOTE: This does not really work in docker/distribution servers, which incorrectly require the "delete" action in the token's scope, and is thus entirely untested. uploadLocation, err := res.Location() if err != nil { return fmt.Errorf("determining upload URL after a mount attempt: %w", err) } logrus.Debugf("... started an upload instead of mounting, trying to cancel at %s", uploadLocation.Redacted()) res2, err := d.c.makeRequestToResolvedURL(ctx, http.MethodDelete, uploadLocation, nil, nil, -1, v2Auth, extraScope) if err != nil { logrus.Debugf("Error trying to cancel an inadvertent upload: %s", err) } else { defer res2.Body.Close() if res2.StatusCode != http.StatusNoContent { logrus.Debugf("Error trying to cancel an inadvertent upload, status %s", http.StatusText(res.StatusCode)) } } // Anyway, if canceling the upload fails, ignore it and return the more important error: return fmt.Errorf("Mounting %s from %s to %s started an upload instead", srcDigest, srcRepo.Name(), d.ref.ref.Name()) default: logrus.Debugf("Error mounting, response %#v", *res) return fmt.Errorf("mounting %s from %s to %s: %w", srcDigest, srcRepo.Name(), d.ref.ref.Name(), registryHTTPResponseToError(res)) } } // tryReusingExactBlob is a subset of TryReusingBlob which _only_ looks for exactly the specified // blob in the current repository, with no cross-repo reuse or mounting; cache may be updated, it is not read. // The caller must ensure info.Digest is set. func (d *dockerImageDestination) tryReusingExactBlob(ctx context.Context, info types.BlobInfo, cache blobinfocache.BlobInfoCache2) (bool, private.ReusedBlob, error) { exists, size, err := d.blobExists(ctx, d.ref.ref, info.Digest, nil) if err != nil { return false, private.ReusedBlob{}, err } if exists { cache.RecordKnownLocation(d.ref.Transport(), bicTransportScope(d.ref), info.Digest, newBICLocationReference(d.ref)) return true, private.ReusedBlob{Digest: info.Digest, Size: size}, nil } return false, private.ReusedBlob{}, nil } func optionalCompressionName(algo *compressiontypes.Algorithm) string { if algo != nil { return algo.Name() } return "nil" } // TryReusingBlobWithOptions checks whether the transport already contains, or can efficiently reuse, a blob, and if so, applies it to the current destination // (e.g. if the blob is a filesystem layer, this signifies that the changes it describes need to be applied again when composing a filesystem tree). // info.Digest must not be empty. // If the blob has been successfully reused, returns (true, info, nil). // If the transport can not reuse the requested blob, TryReusingBlob returns (false, {}, nil); it returns a non-nil error only on an unexpected failure. func (d *dockerImageDestination) TryReusingBlobWithOptions(ctx context.Context, info types.BlobInfo, options private.TryReusingBlobOptions) (bool, private.ReusedBlob, error) { if info.Digest == "" { return false, private.ReusedBlob{}, errors.New("Can not check for a blob with unknown digest") } originalCandidateKnownToBeMissing := false if impl.OriginalCandidateMatchesTryReusingBlobOptions(options) { // First, check whether the blob happens to already exist at the destination. haveBlob, reusedInfo, err := d.tryReusingExactBlob(ctx, info, options.Cache) if err != nil { return false, private.ReusedBlob{}, err } if haveBlob { return true, reusedInfo, nil } originalCandidateKnownToBeMissing = true } else { logrus.Debugf("Ignoring exact blob match, compression %s does not match required %s or MIME types %#v", optionalCompressionName(options.OriginalCompression), optionalCompressionName(options.RequiredCompression), options.PossibleManifestFormats) // We can get here with a blob detected to be zstd when the user wants a zstd:chunked. // In that case we keep originalCandiateKnownToBeMissing = false, so that if we find // a BIC entry for this blob, we do use that entry and return a zstd:chunked entry // with the BIC’s annotations. // This is not quite correct, it only works if the BIC also contains an acceptable _location_. // Ideally, we could look up just the compression algorithm/annotations for info.digest, // and use it even if no location candidate exists and the original dandidate is present. } // Then try reusing blobs from other locations. candidates := options.Cache.CandidateLocations2(d.ref.Transport(), bicTransportScope(d.ref), info.Digest, blobinfocache.CandidateLocations2Options{ CanSubstitute: options.CanSubstitute, PossibleManifestFormats: options.PossibleManifestFormats, RequiredCompression: options.RequiredCompression, }) for _, candidate := range candidates { var candidateRepo reference.Named if !candidate.UnknownLocation { var err error candidateRepo, err = parseBICLocationReference(candidate.Location) if err != nil { logrus.Debugf("Error parsing BlobInfoCache location reference: %s", err) continue } if candidate.CompressionAlgorithm != nil { logrus.Debugf("Trying to reuse blob with cached digest %s compressed with %s in destination repo %s", candidate.Digest.String(), candidate.CompressionAlgorithm.Name(), candidateRepo.Name()) } else { logrus.Debugf("Trying to reuse blob with cached digest %s in destination repo %s", candidate.Digest.String(), candidateRepo.Name()) } // Sanity checks: if reference.Domain(candidateRepo) != reference.Domain(d.ref.ref) { // OCI distribution spec 1.1 allows mounting blobs without specifying the source repo // (the "from" parameter); in that case we might try to use these candidates as well. // // OTOH that would mean we can’t do the “blobExists” check, and if there is no match // we could get an upload request that we would have to cancel. logrus.Debugf("... Internal error: domain %s does not match destination %s", reference.Domain(candidateRepo), reference.Domain(d.ref.ref)) continue } } else { if candidate.CompressionAlgorithm != nil { logrus.Debugf("Trying to reuse blob with cached digest %s compressed with %s with no location match, checking current repo", candidate.Digest.String(), candidate.CompressionAlgorithm.Name()) } else { logrus.Debugf("Trying to reuse blob with cached digest %s in destination repo with no location match, checking current repo", candidate.Digest.String()) } // This digest is a known variant of this blob but we don’t // have a recorded location in this registry, let’s try looking // for it in the current repo. candidateRepo = reference.TrimNamed(d.ref.ref) } if originalCandidateKnownToBeMissing && candidateRepo.Name() == d.ref.ref.Name() && candidate.Digest == info.Digest { logrus.Debug("... Already tried the primary destination") continue } // Whatever happens here, don't abort the entire operation. It's likely we just don't have permissions, and if it is a critical network error, we will find out soon enough anyway. // Checking candidateRepo, and mounting from it, requires an // expanded token scope. extraScope := &authScope{ resourceType: "repository", remoteName: reference.Path(candidateRepo), actions: "pull", } // This existence check is not, strictly speaking, necessary: We only _really_ need it to get the blob size, and we could record that in the cache instead. // But a "failed" d.mountBlob currently leaves around an unterminated server-side upload, which we would try to cancel. // So, without this existence check, it would be 1 request on success, 2 requests on failure; with it, it is 2 requests on success, 1 request on failure. // On success we avoid the actual costly upload; so, in a sense, the success case is "free", but failures are always costly. // Even worse, docker/distribution does not actually reasonably implement canceling uploads // (it would require a "delete" action in the token, and Quay does not give that to anyone, so we can't ask); // so, be a nice client and don't create unnecessary upload sessions on the server. exists, size, err := d.blobExists(ctx, candidateRepo, candidate.Digest, extraScope) if err != nil { logrus.Debugf("... Failed: %v", err) continue } if !exists { // FIXME? Should we drop the blob from cache here (and elsewhere?)? continue // logrus.Debug() already happened in blobExists } if candidateRepo.Name() != d.ref.ref.Name() { if err := d.mountBlob(ctx, candidateRepo, candidate.Digest, extraScope); err != nil { logrus.Debugf("... Mount failed: %v", err) continue } } options.Cache.RecordKnownLocation(d.ref.Transport(), bicTransportScope(d.ref), candidate.Digest, newBICLocationReference(d.ref)) return true, private.ReusedBlob{ Digest: candidate.Digest, Size: size, CompressionOperation: candidate.CompressionOperation, CompressionAlgorithm: candidate.CompressionAlgorithm, CompressionAnnotations: candidate.CompressionAnnotations, }, nil } return false, private.ReusedBlob{}, nil } // PutManifest writes manifest to the destination. // When the primary manifest is a manifest list, if instanceDigest is nil, we're saving the list // itself, else instanceDigest contains a digest of the specific manifest instance to overwrite the // manifest for; when the primary manifest is not a manifest list, instanceDigest should always be nil. // FIXME? This should also receive a MIME type if known, to differentiate between schema versions. // If the destination is in principle available, refuses this manifest type (e.g. it does not recognize the schema), // but may accept a different manifest type, the returned error must be an ManifestTypeRejectedError. func (d *dockerImageDestination) PutManifest(ctx context.Context, m []byte, instanceDigest *digest.Digest) error { var refTail string // If d.ref.isUnknownDigest=true, then we push without a tag, so get the // digest that will be used if d.ref.isUnknownDigest { digest, err := manifest.Digest(m) if err != nil { return err } refTail = digest.String() } else if instanceDigest != nil { // If the instanceDigest is provided, then use it as the refTail, because the reference, // whether it includes a tag or a digest, refers to the list as a whole, and not this // particular instance. refTail = instanceDigest.String() // Double-check that the manifest we've been given matches the digest we've been given. // This also validates the format of instanceDigest. matches, err := manifest.MatchesDigest(m, *instanceDigest) if err != nil { return fmt.Errorf("digesting manifest in PutManifest: %w", err) } if !matches { manifestDigest, merr := manifest.Digest(m) if merr != nil { return fmt.Errorf("Attempted to PutManifest using an explicitly specified digest (%q) that didn't match the manifest's digest: %w", instanceDigest.String(), merr) } return fmt.Errorf("Attempted to PutManifest using an explicitly specified digest (%q) that didn't match the manifest's digest (%q)", instanceDigest.String(), manifestDigest.String()) } } else { // Compute the digest of the main manifest, or the list if it's a list, so that we // have a digest value to use if we're asked to save a signature for the manifest. digest, err := manifest.Digest(m) if err != nil { return err } d.manifestDigest = digest // The refTail should be either a digest (which we expect to match the value we just // computed) or a tag name. refTail, err = d.ref.tagOrDigest() if err != nil { return err } } return d.uploadManifest(ctx, m, refTail) } // uploadManifest writes manifest to tagOrDigest. func (d *dockerImageDestination) uploadManifest(ctx context.Context, m []byte, tagOrDigest string) error { path := fmt.Sprintf(manifestPath, reference.Path(d.ref.ref), tagOrDigest) headers := map[string][]string{} mimeType := manifest.GuessMIMEType(m) if mimeType != "" { headers["Content-Type"] = []string{mimeType} } res, err := d.c.makeRequest(ctx, http.MethodPut, path, headers, bytes.NewReader(m), v2Auth, nil) if err != nil { return err } defer res.Body.Close() if !successStatus(res.StatusCode) { rawErr := registryHTTPResponseToError(res) err := fmt.Errorf("uploading manifest %s to %s: %w", tagOrDigest, d.ref.ref.Name(), rawErr) if isManifestInvalidError(rawErr) { err = types.ManifestTypeRejectedError{Err: err} } return err } // A HTTP server may not be a registry at all, and just return 200 OK to everything // (in particular that can fairly easily happen after tearing down a website and // replacing it with a global 302 redirect to a new website, completely ignoring the // path in the request); in that case we could “succeed” uploading a whole image. // With docker/distribution we could rely on a Docker-Content-Digest header being present // (because docker/distribution/registry/client has been failing uploads if it was missing), // but that has been defined as explicitly optional by // https://github.com/opencontainers/distribution-spec/blob/ec90a2af85fe4d612cf801e1815b95bfa40ae72b/spec.md#legacy-docker-support-http-headers // So, just note the missing header in a debug log. if v := res.Header.Values("Docker-Content-Digest"); len(v) == 0 { logrus.Debugf("Manifest upload response didn’t contain a Docker-Content-Digest header, it might not be a container registry") } return nil } // successStatus returns true if the argument is a successful HTTP response // code (in the range 200 - 399 inclusive). func successStatus(status int) bool { return status >= 200 && status <= 399 } // isManifestInvalidError returns true iff err from registryHTTPResponseToError is a “manifest invalid” error. func isManifestInvalidError(err error) bool { var ec errcode.ErrorCoder if ok := errors.As(err, &ec); !ok { return false } switch ec.ErrorCode() { // ErrorCodeManifestInvalid is returned by OpenShift with acceptschema2=false. case v2.ErrorCodeManifestInvalid: return true // ErrorCodeTagInvalid is returned by docker/distribution (at least as of commit ec87e9b6971d831f0eff752ddb54fb64693e51cd) // when uploading to a tag (because it can’t find a matching tag inside the manifest) case v2.ErrorCodeTagInvalid: return true // ErrorCodeUnsupported with 'Invalid JSON syntax' is returned by AWS ECR when // uploading an OCI manifest that is (correctly, according to the spec) missing // a top-level media type. See libpod issue #1719 // FIXME: remove this case when ECR behavior is fixed case errcode.ErrorCodeUnsupported: return strings.Contains(err.Error(), "Invalid JSON syntax") default: return false } } // PutSignaturesWithFormat writes a set of signatures to the destination. // If instanceDigest is not nil, it contains a digest of the specific manifest instance to write or overwrite the signatures for // (when the primary manifest is a manifest list); this should always be nil if the primary manifest is not a manifest list. // MUST be called after PutManifest (signatures may reference manifest contents). func (d *dockerImageDestination) PutSignaturesWithFormat(ctx context.Context, signatures []signature.Signature, instanceDigest *digest.Digest) error { if instanceDigest == nil { if d.manifestDigest == "" { // This shouldn’t happen, ImageDestination users are required to call PutManifest before PutSignatures return errors.New("Unknown manifest digest, can't add signatures") } instanceDigest = &d.manifestDigest } sigstoreSignatures := []signature.Sigstore{} otherSignatures := []signature.Signature{} for _, sig := range signatures { if sigstoreSig, ok := sig.(signature.Sigstore); ok { sigstoreSignatures = append(sigstoreSignatures, sigstoreSig) } else { otherSignatures = append(otherSignatures, sig) } } // Only write sigstores signatures to sigstores attachments. We _could_ store them to lookaside // instead, but that would probably be rather surprising. // FIXME: So should we enable sigstores in all cases? Or write in all cases, but opt-in to read? if len(sigstoreSignatures) != 0 { if err := d.putSignaturesToSigstoreAttachments(ctx, sigstoreSignatures, *instanceDigest); err != nil { return err } } if len(otherSignatures) != 0 { if err := d.c.detectProperties(ctx); err != nil { return err } switch { case d.c.supportsSignatures: if err := d.putSignaturesToAPIExtension(ctx, otherSignatures, *instanceDigest); err != nil { return err } case d.c.signatureBase != nil: if err := d.putSignaturesToLookaside(otherSignatures, *instanceDigest); err != nil { return err } default: return errors.New("Internal error: X-Registry-Supports-Signatures extension not supported, and lookaside should not be empty configuration") } } return nil } // putSignaturesToLookaside implements PutSignaturesWithFormat() from the lookaside location configured in s.c.signatureBase, // which is not nil, for a manifest with manifestDigest. func (d *dockerImageDestination) putSignaturesToLookaside(signatures []signature.Signature, manifestDigest digest.Digest) error { // FIXME? This overwrites files one at a time, definitely not atomic. // A failure when updating signatures with a reordered copy could lose some of them. // Skip dealing with the manifest digest if not necessary. if len(signatures) == 0 { return nil } // NOTE: Keep this in sync with docs/signature-protocols.md! for i, signature := range signatures { sigURL, err := lookasideStorageURL(d.c.signatureBase, manifestDigest, i) if err != nil { return err } if err := d.putOneSignature(sigURL, signature); err != nil { return err } } // Remove any other signatures, if present. // We stop at the first missing signature; if a previous deleting loop aborted // prematurely, this may not clean up all of them, but one missing signature // is enough for dockerImageSource to stop looking for other signatures, so that // is sufficient. for i := len(signatures); ; i++ { sigURL, err := lookasideStorageURL(d.c.signatureBase, manifestDigest, i) if err != nil { return err } missing, err := d.c.deleteOneSignature(sigURL) if err != nil { return err } if missing { break } } return nil } // putOneSignature stores sig to sigURL. // NOTE: Keep this in sync with docs/signature-protocols.md! func (d *dockerImageDestination) putOneSignature(sigURL *url.URL, sig signature.Signature) error { switch sigURL.Scheme { case "file": logrus.Debugf("Writing to %s", sigURL.Path) err := os.MkdirAll(filepath.Dir(sigURL.Path), 0o755) if err != nil { return err } blob, err := signature.Blob(sig) if err != nil { return err } err = os.WriteFile(sigURL.Path, blob, 0o644) if err != nil { return err } return nil case "http", "https": return fmt.Errorf("Writing directly to a %s lookaside %s is not supported. Configure a lookaside-staging: location", sigURL.Scheme, sigURL.Redacted()) default: return fmt.Errorf("Unsupported scheme when writing signature to %s", sigURL.Redacted()) } } func (d *dockerImageDestination) putSignaturesToSigstoreAttachments(ctx context.Context, signatures []signature.Sigstore, manifestDigest digest.Digest) error { if !d.c.useSigstoreAttachments { return errors.New("writing sigstore attachments is disabled by configuration") } ociManifest, err := d.c.getSigstoreAttachmentManifest(ctx, d.ref, manifestDigest) if err != nil { return err } var ociConfig imgspecv1.Image // Most fields empty by default if ociManifest == nil { ociManifest = manifest.OCI1FromComponents(imgspecv1.Descriptor{ MediaType: imgspecv1.MediaTypeImageConfig, Digest: "", // We will fill this in later. Size: 0, }, nil) ociConfig.RootFS.Type = "layers" } else { logrus.Debugf("Fetching sigstore attachment config %s", ociManifest.Config.Digest.String()) // We don’t benefit from a real BlobInfoCache here because we never try to reuse/mount configs. configBlob, err := d.c.getOCIDescriptorContents(ctx, d.ref, ociManifest.Config, iolimits.MaxConfigBodySize, none.NoCache) if err != nil { return err } if err := json.Unmarshal(configBlob, &ociConfig); err != nil { return fmt.Errorf("parsing sigstore attachment config %s in %s: %w", ociManifest.Config.Digest.String(), d.ref.ref.Name(), err) } } // To make sure we can safely append to the slices of ociManifest, without adding a remote dependency on the code that creates it. ociManifest.Layers = slices.Clone(ociManifest.Layers) // We don’t need to ^^^ for ociConfig.RootFS.DiffIDs because we have created it empty ourselves, and json.Unmarshal is documented to append() to // the slice in the original object (or in a newly allocated object). for _, sig := range signatures { mimeType := sig.UntrustedMIMEType() payloadBlob := sig.UntrustedPayload() annotations := sig.UntrustedAnnotations() alreadyOnRegistry := false for _, layer := range ociManifest.Layers { if layerMatchesSigstoreSignature(layer, mimeType, payloadBlob, annotations) { logrus.Debugf("Signature with digest %s already exists on the registry", layer.Digest.String()) alreadyOnRegistry = true break } } if alreadyOnRegistry { continue } // We don’t benefit from a real BlobInfoCache here because we never try to reuse/mount attachment payloads. // That might eventually need to change if payloads grow to be not just signatures, but something // significantly large. sigDesc, err := d.putBlobBytesAsOCI(ctx, payloadBlob, mimeType, private.PutBlobOptions{ Cache: none.NoCache, IsConfig: false, EmptyLayer: false, LayerIndex: nil, }) if err != nil { return err } sigDesc.Annotations = annotations ociManifest.Layers = append(ociManifest.Layers, sigDesc) ociConfig.RootFS.DiffIDs = append(ociConfig.RootFS.DiffIDs, sigDesc.Digest) logrus.Debugf("Adding new signature, digest %s", sigDesc.Digest.String()) } configBlob, err := json.Marshal(ociConfig) if err != nil { return err } logrus.Debugf("Uploading updated sigstore attachment config") // We don’t benefit from a real BlobInfoCache here because we never try to reuse/mount configs. configDesc, err := d.putBlobBytesAsOCI(ctx, configBlob, imgspecv1.MediaTypeImageConfig, private.PutBlobOptions{ Cache: none.NoCache, IsConfig: true, EmptyLayer: false, LayerIndex: nil, }) if err != nil { return err } ociManifest.Config = configDesc manifestBlob, err := ociManifest.Serialize() if err != nil { return err } attachmentTag, err := sigstoreAttachmentTag(manifestDigest) if err != nil { return err } logrus.Debugf("Uploading sigstore attachment manifest") return d.uploadManifest(ctx, manifestBlob, attachmentTag) } func layerMatchesSigstoreSignature(layer imgspecv1.Descriptor, mimeType string, payloadBlob []byte, annotations map[string]string, ) bool { if layer.MediaType != mimeType || layer.Size != int64(len(payloadBlob)) || // This is not quite correct, we should use the layer’s digest algorithm. // But right now we don’t want to deal with corner cases like bad digest formats // or unavailable algorithms; in the worst case we end up with duplicate signature // entries. layer.Digest.String() != digest.FromBytes(payloadBlob).String() || !maps.Equal(layer.Annotations, annotations) { return false } return true } // putBlobBytesAsOCI uploads a blob with the specified contents, and returns an appropriate // OCI descriptor. func (d *dockerImageDestination) putBlobBytesAsOCI(ctx context.Context, contents []byte, mimeType string, options private.PutBlobOptions) (imgspecv1.Descriptor, error) { blobDigest := digest.FromBytes(contents) info, err := d.PutBlobWithOptions(ctx, bytes.NewReader(contents), types.BlobInfo{ Digest: blobDigest, Size: int64(len(contents)), MediaType: mimeType, }, options) if err != nil { return imgspecv1.Descriptor{}, fmt.Errorf("writing blob %s: %w", blobDigest.String(), err) } return imgspecv1.Descriptor{ MediaType: mimeType, Digest: info.Digest, Size: info.Size, }, nil } // deleteOneSignature deletes a signature from sigURL, if it exists. // If it successfully determines that the signature does not exist, returns (true, nil) // NOTE: Keep this in sync with docs/signature-protocols.md! func (c *dockerClient) deleteOneSignature(sigURL *url.URL) (missing bool, err error) { switch sigURL.Scheme { case "file": logrus.Debugf("Deleting %s", sigURL.Path) err := os.Remove(sigURL.Path) if err != nil && os.IsNotExist(err) { return true, nil } return false, err case "http", "https": return false, fmt.Errorf("Writing directly to a %s lookaside %s is not supported. Configure a lookaside-staging: location", sigURL.Scheme, sigURL.Redacted()) default: return false, fmt.Errorf("Unsupported scheme when deleting signature from %s", sigURL.Redacted()) } } // putSignaturesToAPIExtension implements PutSignaturesWithFormat() using the X-Registry-Supports-Signatures API extension, // for a manifest with manifestDigest. func (d *dockerImageDestination) putSignaturesToAPIExtension(ctx context.Context, signatures []signature.Signature, manifestDigest digest.Digest) error { // Skip dealing with the manifest digest, or reading the old state, if not necessary. if len(signatures) == 0 { return nil } // Because image signatures are a shared resource in Atomic Registry, the default upload // always adds signatures. Eventually we should also allow removing signatures, // but the X-Registry-Supports-Signatures API extension does not support that yet. existingSignatures, err := d.c.getExtensionsSignatures(ctx, d.ref, manifestDigest) if err != nil { return err } existingSigNames := set.New[string]() for _, sig := range existingSignatures.Signatures { existingSigNames.Add(sig.Name) } for _, newSigWithFormat := range signatures { newSigSimple, ok := newSigWithFormat.(signature.SimpleSigning) if !ok { return signature.UnsupportedFormatError(newSigWithFormat) } newSig := newSigSimple.UntrustedSignature() if slices.ContainsFunc(existingSignatures.Signatures, func(existingSig extensionSignature) bool { return existingSig.Version == extensionSignatureSchemaVersion && existingSig.Type == extensionSignatureTypeAtomic && bytes.Equal(existingSig.Content, newSig) }) { continue } // The API expect us to invent a new unique name. This is racy, but hopefully good enough. var signatureName string for { randBytes := make([]byte, 16) n, err := rand.Read(randBytes) if err != nil || n != 16 { return fmt.Errorf("generating random signature len %d: %w", n, err) } signatureName = fmt.Sprintf("%s@%032x", manifestDigest.String(), randBytes) if !existingSigNames.Contains(signatureName) { break } } sig := extensionSignature{ Version: extensionSignatureSchemaVersion, Name: signatureName, Type: extensionSignatureTypeAtomic, Content: newSig, } body, err := json.Marshal(sig) if err != nil { return err } // manifestDigest is known to be valid because it was not rejected by getExtensionsSignatures above. path := fmt.Sprintf(extensionsSignaturePath, reference.Path(d.ref.ref), manifestDigest.String()) res, err := d.c.makeRequest(ctx, http.MethodPut, path, nil, bytes.NewReader(body), v2Auth, nil) if err != nil { return err } defer res.Body.Close() if res.StatusCode != http.StatusCreated { logrus.Debugf("Error uploading signature, status %d, %#v", res.StatusCode, res) return fmt.Errorf("uploading signature to %s in %s: %w", path, d.c.registry, registryHTTPResponseToError(res)) } } return nil } // CommitWithOptions marks the process of storing the image as successful and asks for the image to be persisted. // WARNING: This does not have any transactional semantics: // - Uploaded data MAY be visible to others before CommitWithOptions() is called // - Uploaded data MAY be removed or MAY remain around if Close() is called without CommitWithOptions() (i.e. rollback is allowed but not guaranteed) func (d *dockerImageDestination) CommitWithOptions(ctx context.Context, options private.CommitOptions) error { return nil } ================================================ FILE: vendor/go.podman.io/image/v5/docker/docker_image_src.go ================================================ package docker import ( "bytes" "context" "encoding/json" "errors" "fmt" "io" "math" "mime" "mime/multipart" "net/http" "net/url" "os" "os/exec" "strings" "sync" digest "github.com/opencontainers/go-digest" "github.com/sirupsen/logrus" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/internal/imagesource/impl" "go.podman.io/image/v5/internal/imagesource/stubs" "go.podman.io/image/v5/internal/iolimits" "go.podman.io/image/v5/internal/private" "go.podman.io/image/v5/internal/signature" "go.podman.io/image/v5/manifest" "go.podman.io/image/v5/pkg/blobinfocache/none" "go.podman.io/image/v5/pkg/sysregistriesv2" "go.podman.io/image/v5/types" "go.podman.io/storage/pkg/regexp" ) // maxLookasideSignatures is an arbitrary limit for the total number of signatures we would try to read from a lookaside server, // even if it were broken or malicious and it continued serving an enormous number of items. const maxLookasideSignatures = 128 type dockerImageSource struct { impl.Compat impl.PropertyMethodsInitialize impl.DoesNotAffectLayerInfosForCopy stubs.ImplementsGetBlobAt logicalRef dockerReference // The reference the user requested. This must satisfy !isUnknownDigest physicalRef dockerReference // The actual reference we are accessing (possibly a mirror). This must satisfy !isUnknownDigest c *dockerClient // State cachedManifest []byte // nil if not loaded yet cachedManifestMIMEType string // Only valid if cachedManifest != nil } // newImageSource creates a new ImageSource for the specified image reference. // The caller must call .Close() on the returned ImageSource. // The caller must ensure !ref.isUnknownDigest. func newImageSource(ctx context.Context, sys *types.SystemContext, ref dockerReference) (*dockerImageSource, error) { if ref.isUnknownDigest { return nil, fmt.Errorf("reading images from docker: reference %q without a tag or digest is not supported", ref.StringWithinTransport()) } registryConfig, err := loadRegistryConfiguration(sys) if err != nil { return nil, err } registry, err := sysregistriesv2.FindRegistry(sys, ref.ref.Name()) if err != nil { return nil, fmt.Errorf("loading registries configuration: %w", err) } if registry == nil { // No configuration was found for the provided reference, so use the // equivalent of a default configuration. registry = &sysregistriesv2.Registry{ Endpoint: sysregistriesv2.Endpoint{ Location: ref.ref.String(), }, Prefix: ref.ref.String(), } } // Check all endpoints for the manifest availability. If we find one that does // contain the image, it will be used for all future pull actions. Always try the // non-mirror original location last; this both transparently handles the case // of no mirrors configured, and ensures we return the error encountered when // accessing the upstream location if all endpoints fail. pullSources, err := registry.PullSourcesFromReference(ref.ref) if err != nil { return nil, err } type attempt struct { ref reference.Named err error } attempts := []attempt{} for _, pullSource := range pullSources { if sys != nil && sys.DockerLogMirrorChoice { logrus.Infof("Trying to access %q", pullSource.Reference) } else { logrus.Debugf("Trying to access %q", pullSource.Reference) } s, err := newImageSourceAttempt(ctx, sys, ref, pullSource, registryConfig) if err == nil { return s, nil } logrus.Debugf("Accessing %q failed: %v", pullSource.Reference, err) attempts = append(attempts, attempt{ ref: pullSource.Reference, err: err, }) } switch len(attempts) { case 0: return nil, errors.New("Internal error: newImageSource returned without trying any endpoint") case 1: return nil, attempts[0].err // If no mirrors are used, perfectly preserve the error type and add no noise. default: // Don’t just build a string, try to preserve the typed error. primary := &attempts[len(attempts)-1] extras := []string{} for _, attempt := range attempts[:len(attempts)-1] { // This is difficult to fit into a single-line string, when the error can contain arbitrary strings including any metacharacters we decide to use. // The paired [] at least have some chance of being unambiguous. extras = append(extras, fmt.Sprintf("[%s: %v]", attempt.ref.String(), attempt.err)) } return nil, fmt.Errorf("(Mirrors also failed: %s): %s: %w", strings.Join(extras, "\n"), primary.ref.String(), primary.err) } } // newImageSourceAttempt is an internal helper for newImageSource. Everyone else must call newImageSource. // Given a logicalReference and a pullSource, return a dockerImageSource if it is reachable. // The caller must call .Close() on the returned ImageSource. func newImageSourceAttempt(ctx context.Context, sys *types.SystemContext, logicalRef dockerReference, pullSource sysregistriesv2.PullSource, registryConfig *registryConfiguration, ) (*dockerImageSource, error) { physicalRef, err := newReference(pullSource.Reference, false) if err != nil { return nil, err } endpointSys := sys // sys.DockerAuthConfig does not explicitly specify a registry; we must not blindly send the credentials intended for the primary endpoint to mirrors. if endpointSys != nil && endpointSys.DockerAuthConfig != nil && reference.Domain(physicalRef.ref) != reference.Domain(logicalRef.ref) { copy := *endpointSys copy.DockerAuthConfig = nil copy.DockerBearerRegistryToken = "" endpointSys = © } client, err := newDockerClientFromRef(endpointSys, physicalRef, registryConfig, false, "pull") if err != nil { return nil, err } client.tlsClientConfig.InsecureSkipVerify = pullSource.Endpoint.Insecure s := &dockerImageSource{ PropertyMethodsInitialize: impl.PropertyMethods(impl.Properties{ HasThreadSafeGetBlob: true, }), logicalRef: logicalRef, physicalRef: physicalRef, c: client, } s.Compat = impl.AddCompat(s) if err := s.ensureManifestIsLoaded(ctx); err != nil { client.Close() return nil, err } if h, err := sysregistriesv2.AdditionalLayerStoreAuthHelper(endpointSys); err == nil && h != "" { acf := map[string]struct { Username string `json:"username,omitempty"` Password string `json:"password,omitempty"` IdentityToken string `json:"identityToken,omitempty"` }{ physicalRef.ref.String(): { Username: client.auth.Username, Password: client.auth.Password, IdentityToken: client.auth.IdentityToken, }, } acfD, err := json.Marshal(acf) if err != nil { logrus.Warnf("failed to marshal auth config: %v", err) } else { cmd := exec.Command(h) cmd.Stdin = bytes.NewReader(acfD) if err := cmd.Run(); err != nil { var stderr string if ee, ok := err.(*exec.ExitError); ok { stderr = string(ee.Stderr) } logrus.Warnf("Failed to call additional-layer-store-auth-helper (stderr:%s): %v", stderr, err) } } } return s, nil } // Reference returns the reference used to set up this source, _as specified by the user_ // (not as the image itself, or its underlying storage, claims). This can be used e.g. to determine which public keys are trusted for this image. func (s *dockerImageSource) Reference() types.ImageReference { return s.logicalRef } // Close removes resources associated with an initialized ImageSource, if any. func (s *dockerImageSource) Close() error { return s.c.Close() } // simplifyContentType drops parameters from a HTTP media type (see https://tools.ietf.org/html/rfc7231#section-3.1.1.1) // Alternatively, an empty string is returned unchanged, and invalid values are "simplified" to an empty string. func simplifyContentType(contentType string) string { if contentType == "" { return contentType } mimeType, _, err := mime.ParseMediaType(contentType) if err != nil { return "" } return mimeType } // GetManifest returns the image's manifest along with its MIME type (which may be empty when it can't be determined but the manifest is available). // It may use a remote (= slow) service. // If instanceDigest is not nil, it contains a digest of the specific manifest instance to retrieve (when the primary manifest is a manifest list); // this never happens if the primary manifest is not a manifest list (e.g. if the source never returns manifest lists). func (s *dockerImageSource) GetManifest(ctx context.Context, instanceDigest *digest.Digest) ([]byte, string, error) { if instanceDigest != nil { if err := instanceDigest.Validate(); err != nil { // Make sure instanceDigest.String() does not contain any unexpected characters return nil, "", err } return s.fetchManifest(ctx, instanceDigest.String()) } err := s.ensureManifestIsLoaded(ctx) if err != nil { return nil, "", err } return s.cachedManifest, s.cachedManifestMIMEType, nil } // fetchManifest fetches a manifest for tagOrDigest. // The caller is responsible for ensuring tagOrDigest uses the expected format. func (s *dockerImageSource) fetchManifest(ctx context.Context, tagOrDigest string) ([]byte, string, error) { return s.c.fetchManifest(ctx, s.physicalRef, tagOrDigest) } // ensureManifestIsLoaded sets s.cachedManifest and s.cachedManifestMIMEType // // ImageSource implementations are not required or expected to do any caching, // but because our signatures are “attached” to the manifest digest, // we need to ensure that the digest of the manifest returned by GetManifest(ctx, nil) // and used by GetSignatures(ctx, nil) are consistent, otherwise we would get spurious // signature verification failures when pulling while a tag is being updated. func (s *dockerImageSource) ensureManifestIsLoaded(ctx context.Context) error { if s.cachedManifest != nil { return nil } reference, err := s.physicalRef.tagOrDigest() if err != nil { return err } manblob, mt, err := s.fetchManifest(ctx, reference) if err != nil { return err } // We might validate manblob against the Docker-Content-Digest header here to protect against transport errors. s.cachedManifest = manblob s.cachedManifestMIMEType = mt return nil } // splitHTTP200ResponseToPartial splits a 200 response in multiple streams as specified by the chunks func splitHTTP200ResponseToPartial(streams chan io.ReadCloser, errs chan error, body io.ReadCloser, chunks []private.ImageSourceChunk) { defer close(streams) defer close(errs) currentOffset := uint64(0) body = makeBufferedNetworkReader(body, 64, 16384) defer body.Close() for _, c := range chunks { if c.Offset != currentOffset { if c.Offset < currentOffset { errs <- fmt.Errorf("invalid chunk offset specified %v (expected >= %v)", c.Offset, currentOffset) break } toSkip := c.Offset - currentOffset if _, err := io.Copy(io.Discard, io.LimitReader(body, int64(toSkip))); err != nil { errs <- err break } currentOffset += toSkip } var reader io.Reader if c.Length == math.MaxUint64 { reader = body } else { reader = io.LimitReader(body, int64(c.Length)) } s := signalCloseReader{ closed: make(chan struct{}), stream: io.NopCloser(reader), consumeStream: true, } streams <- s // Wait until the stream is closed before going to the next chunk <-s.closed currentOffset += c.Length } } // handle206Response reads a 206 response and send each part as a separate ReadCloser to the streams chan. func handle206Response(streams chan io.ReadCloser, errs chan error, body io.ReadCloser, chunks []private.ImageSourceChunk, mediaType string, params map[string]string) { defer close(streams) defer close(errs) if !strings.HasPrefix(mediaType, "multipart/") { streams <- body return } boundary, found := params["boundary"] if !found { errs <- errors.New("could not find boundary") body.Close() return } buffered := makeBufferedNetworkReader(body, 64, 16384) defer buffered.Close() mr := multipart.NewReader(buffered, boundary) parts := 0 for { p, err := mr.NextPart() if err != nil { if err != io.EOF { errs <- err } if parts != len(chunks) { errs <- errors.New("invalid number of chunks returned by the server") } return } if parts >= len(chunks) { errs <- errors.New("too many parts returned by the server") break } s := signalCloseReader{ closed: make(chan struct{}), stream: p, } streams <- s // NextPart() cannot be called while the current part // is being read, so wait until it is closed <-s.closed parts++ } } var multipartByteRangesRe = regexp.Delayed("multipart/byteranges; boundary=([A-Za-z-0-9:]+)") func parseMediaType(contentType string) (string, map[string]string, error) { mediaType, params, err := mime.ParseMediaType(contentType) if err != nil { if err == mime.ErrInvalidMediaParameter { // CloudFront returns an invalid MIME type, that contains an unquoted ":" in the boundary // param, let's handle it here. matches := multipartByteRangesRe.FindStringSubmatch(contentType) if len(matches) == 2 { mediaType = "multipart/byteranges" params = map[string]string{ "boundary": matches[1], } err = nil } } if err != nil { return "", nil, err } } return mediaType, params, err } // GetBlobAt returns a sequential channel of readers that contain data for the requested // blob chunks, and a channel that might get a single error value. // The specified chunks must be not overlapping and sorted by their offset. // The readers must be fully consumed, in the order they are returned, before blocking // to read the next chunk. // If the Length for the last chunk is set to math.MaxUint64, then it // fully fetches the remaining data from the offset to the end of the blob. func (s *dockerImageSource) GetBlobAt(ctx context.Context, info types.BlobInfo, chunks []private.ImageSourceChunk) (chan io.ReadCloser, chan error, error) { headers := make(map[string][]string) rangeVals := make([]string, 0, len(chunks)) lastFound := false for _, c := range chunks { if lastFound { return nil, nil, fmt.Errorf("internal error: another chunk requested after an util-EOF chunk") } // If the Length is set to -1, then request anything after the specified offset. if c.Length == math.MaxUint64 { lastFound = true rangeVals = append(rangeVals, fmt.Sprintf("%d-", c.Offset)) } else { rangeVals = append(rangeVals, fmt.Sprintf("%d-%d", c.Offset, c.Offset+c.Length-1)) } } headers["Range"] = []string{fmt.Sprintf("bytes=%s", strings.Join(rangeVals, ","))} if len(info.URLs) != 0 { return nil, nil, fmt.Errorf("external URLs not supported with GetBlobAt") } if err := info.Digest.Validate(); err != nil { // Make sure info.Digest.String() does not contain any unexpected characters return nil, nil, err } path := fmt.Sprintf(blobsPath, reference.Path(s.physicalRef.ref), info.Digest.String()) logrus.Debugf("Downloading %s", path) res, err := s.c.makeRequest(ctx, http.MethodGet, path, headers, nil, v2Auth, nil) if err != nil { return nil, nil, err } switch res.StatusCode { case http.StatusOK: // if the server replied with a 200 status code, convert the full body response to a series of // streams as it would have been done with 206. streams := make(chan io.ReadCloser) errs := make(chan error) go splitHTTP200ResponseToPartial(streams, errs, res.Body, chunks) return streams, errs, nil case http.StatusPartialContent: mediaType, params, err := parseMediaType(res.Header.Get("Content-Type")) if err != nil { return nil, nil, err } streams := make(chan io.ReadCloser) errs := make(chan error) go handle206Response(streams, errs, res.Body, chunks, mediaType, params) return streams, errs, nil case http.StatusBadRequest: res.Body.Close() return nil, nil, private.BadPartialRequestError{Status: res.Status} default: err := registryHTTPResponseToError(res) res.Body.Close() return nil, nil, fmt.Errorf("fetching partial blob: %w", err) } } // GetBlob returns a stream for the specified blob, and the blob’s size (or -1 if unknown). // The Digest field in BlobInfo is guaranteed to be provided, Size may be -1 and MediaType may be optionally provided. // May update BlobInfoCache, preferably after it knows for certain that a blob truly exists at a specific location. func (s *dockerImageSource) GetBlob(ctx context.Context, info types.BlobInfo, cache types.BlobInfoCache) (io.ReadCloser, int64, error) { return s.c.getBlob(ctx, s.physicalRef, info, cache) } // GetSignaturesWithFormat returns the image's signatures. It may use a remote (= slow) service. // If instanceDigest is not nil, it contains a digest of the specific manifest instance to retrieve signatures for // (when the primary manifest is a manifest list); this never happens if the primary manifest is not a manifest list // (e.g. if the source never returns manifest lists). func (s *dockerImageSource) GetSignaturesWithFormat(ctx context.Context, instanceDigest *digest.Digest) ([]signature.Signature, error) { if err := s.c.detectProperties(ctx); err != nil { return nil, err } var res []signature.Signature switch { case s.c.supportsSignatures: if err := s.appendSignaturesFromAPIExtension(ctx, &res, instanceDigest); err != nil { return nil, err } case s.c.signatureBase != nil: if err := s.appendSignaturesFromLookaside(ctx, &res, instanceDigest); err != nil { return nil, err } default: return nil, errors.New("Internal error: X-Registry-Supports-Signatures extension not supported, and lookaside should not be empty configuration") } if err := s.appendSignaturesFromSigstoreAttachments(ctx, &res, instanceDigest); err != nil { return nil, err } return res, nil } // manifestDigest returns a digest of the manifest, from instanceDigest if non-nil; or from the supplied reference, // or finally, from a fetched manifest. func (s *dockerImageSource) manifestDigest(ctx context.Context, instanceDigest *digest.Digest) (digest.Digest, error) { if instanceDigest != nil { return *instanceDigest, nil } if digested, ok := s.physicalRef.ref.(reference.Digested); ok { d := digested.Digest() if d.Algorithm() == digest.Canonical { return d, nil } } if err := s.ensureManifestIsLoaded(ctx); err != nil { return "", err } return manifest.Digest(s.cachedManifest) } // appendSignaturesFromLookaside implements GetSignaturesWithFormat() from the lookaside location configured in s.c.signatureBase, // which is not nil, storing the signatures to *dest. // On error, the contents of *dest are undefined. func (s *dockerImageSource) appendSignaturesFromLookaside(ctx context.Context, dest *[]signature.Signature, instanceDigest *digest.Digest) error { manifestDigest, err := s.manifestDigest(ctx, instanceDigest) if err != nil { return err } // NOTE: Keep this in sync with docs/signature-protocols.md! for i := 0; ; i++ { if i >= maxLookasideSignatures { return fmt.Errorf("server provided %d signatures, assuming that's unreasonable and a server error", maxLookasideSignatures) } sigURL, err := lookasideStorageURL(s.c.signatureBase, manifestDigest, i) if err != nil { return err } signature, missing, err := s.getOneSignature(ctx, sigURL) if err != nil { return err } if missing { break } *dest = append(*dest, signature) } return nil } // getOneSignature downloads one signature from sigURL, and returns (signature, false, nil) // If it successfully determines that the signature does not exist, returns (nil, true, nil). // NOTE: Keep this in sync with docs/signature-protocols.md! func (s *dockerImageSource) getOneSignature(ctx context.Context, sigURL *url.URL) (signature.Signature, bool, error) { switch sigURL.Scheme { case "file": logrus.Debugf("Reading %s", sigURL.Path) sigBlob, err := os.ReadFile(sigURL.Path) if err != nil { if os.IsNotExist(err) { return nil, true, nil } return nil, false, err } sig, err := signature.FromBlob(sigBlob) if err != nil { return nil, false, fmt.Errorf("parsing signature %q: %w", sigURL.Path, err) } return sig, false, nil case "http", "https": logrus.Debugf("GET %s", sigURL.Redacted()) req, err := http.NewRequestWithContext(ctx, http.MethodGet, sigURL.String(), nil) if err != nil { return nil, false, err } res, err := s.c.client.Do(req) if err != nil { return nil, false, err } defer res.Body.Close() if res.StatusCode == http.StatusNotFound { logrus.Debugf("... got status 404, as expected = end of signatures") return nil, true, nil } else if res.StatusCode != http.StatusOK { return nil, false, fmt.Errorf("reading signature from %s: %w", sigURL.Redacted(), newUnexpectedHTTPStatusError(res)) } contentType := res.Header.Get("Content-Type") if mimeType := simplifyContentType(contentType); mimeType == "text/html" { logrus.Warnf("Signature %q has Content-Type %q, unexpected for a signature", sigURL.Redacted(), contentType) // Don’t immediately fail; the lookaside spec does not place any requirements on Content-Type. // If the content really is HTML, it’s going to fail in signature.FromBlob. } sigBlob, err := iolimits.ReadAtMost(res.Body, iolimits.MaxSignatureBodySize) if err != nil { return nil, false, err } sig, err := signature.FromBlob(sigBlob) if err != nil { return nil, false, fmt.Errorf("parsing signature %s: %w", sigURL.Redacted(), err) } return sig, false, nil default: return nil, false, fmt.Errorf("Unsupported scheme when reading signature from %s", sigURL.Redacted()) } } // appendSignaturesFromAPIExtension implements GetSignaturesWithFormat() using the X-Registry-Supports-Signatures API extension, // storing the signatures to *dest. // On error, the contents of *dest are undefined. func (s *dockerImageSource) appendSignaturesFromAPIExtension(ctx context.Context, dest *[]signature.Signature, instanceDigest *digest.Digest) error { manifestDigest, err := s.manifestDigest(ctx, instanceDigest) if err != nil { return err } parsedBody, err := s.c.getExtensionsSignatures(ctx, s.physicalRef, manifestDigest) if err != nil { return err } for _, sig := range parsedBody.Signatures { if sig.Version == extensionSignatureSchemaVersion && sig.Type == extensionSignatureTypeAtomic { *dest = append(*dest, signature.SimpleSigningFromBlob(sig.Content)) } } return nil } // appendSignaturesFromSigstoreAttachments implements GetSignaturesWithFormat() using the sigstore tag convention, // storing the signatures to *dest. // On error, the contents of *dest are undefined. func (s *dockerImageSource) appendSignaturesFromSigstoreAttachments(ctx context.Context, dest *[]signature.Signature, instanceDigest *digest.Digest) error { if !s.c.useSigstoreAttachments { logrus.Debugf("Not looking for sigstore attachments: disabled by configuration") return nil } manifestDigest, err := s.manifestDigest(ctx, instanceDigest) if err != nil { return err } ociManifest, err := s.c.getSigstoreAttachmentManifest(ctx, s.physicalRef, manifestDigest) if err != nil { return err } if ociManifest == nil { return nil } logrus.Debugf("Found a sigstore attachment manifest with %d layers", len(ociManifest.Layers)) for layerIndex, layer := range ociManifest.Layers { // Note that this copies all kinds of attachments: attestations, and whatever else is there, // not just signatures. We leave the signature consumers to decide based on the MIME type. logrus.Debugf("Fetching sigstore attachment %d/%d: %s", layerIndex+1, len(ociManifest.Layers), layer.Digest.String()) // We don’t benefit from a real BlobInfoCache here because we never try to reuse/mount attachment payloads. // That might eventually need to change if payloads grow to be not just signatures, but something // significantly large. payload, err := s.c.getOCIDescriptorContents(ctx, s.physicalRef, layer, iolimits.MaxSignatureBodySize, none.NoCache) if err != nil { return err } *dest = append(*dest, signature.SigstoreFromComponents(layer.MediaType, payload, layer.Annotations)) } return nil } // deleteImage deletes the named image from the registry, if supported. func deleteImage(ctx context.Context, sys *types.SystemContext, ref dockerReference) error { if ref.isUnknownDigest { return fmt.Errorf("Docker reference without a tag or digest cannot be deleted") } registryConfig, err := loadRegistryConfiguration(sys) if err != nil { return err } // docker/distribution does not document what action should be used for deleting images. // // Current docker/distribution requires "pull" for reading the manifest and "delete" for deleting it. // quay.io requires "push" (an explicit "pull" is unnecessary), does not grant any token (fails parsing the request) if "delete" is included. // OpenShift ignores the action string (both the password and the token is an OpenShift API token identifying a user). // // We have to hard-code a single string, luckily both docker/distribution and quay.io support "*" to mean "everything". c, err := newDockerClientFromRef(sys, ref, registryConfig, true, "*") if err != nil { return err } defer c.Close() headers := map[string][]string{ "Accept": manifest.DefaultRequestedManifestMIMETypes, } refTail, err := ref.tagOrDigest() if err != nil { return err } getPath := fmt.Sprintf(manifestPath, reference.Path(ref.ref), refTail) get, err := c.makeRequest(ctx, http.MethodGet, getPath, headers, nil, v2Auth, nil) if err != nil { return err } defer get.Body.Close() switch get.StatusCode { case http.StatusOK: case http.StatusNotFound: return fmt.Errorf("Unable to delete %v. Image may not exist or is not stored with a v2 Schema in a v2 registry", ref.ref) default: return fmt.Errorf("deleting %v: %w", ref.ref, registryHTTPResponseToError(get)) } manifestBody, err := iolimits.ReadAtMost(get.Body, iolimits.MaxManifestBodySize) if err != nil { return err } manifestDigest, err := manifest.Digest(manifestBody) if err != nil { return fmt.Errorf("computing manifest digest: %w", err) } deletePath := fmt.Sprintf(manifestPath, reference.Path(ref.ref), manifestDigest) // When retrieving the digest from a registry >= 2.3 use the following header: // "Accept": "application/vnd.docker.distribution.manifest.v2+json" delete, err := c.makeRequest(ctx, http.MethodDelete, deletePath, headers, nil, v2Auth, nil) if err != nil { return err } defer delete.Body.Close() if delete.StatusCode != http.StatusAccepted { return fmt.Errorf("deleting %v: %w", ref.ref, registryHTTPResponseToError(delete)) } for i := 0; ; i++ { sigURL, err := lookasideStorageURL(c.signatureBase, manifestDigest, i) if err != nil { return err } missing, err := c.deleteOneSignature(sigURL) if err != nil { return err } if missing { break } } return nil } type bufferedNetworkReaderBuffer struct { data []byte len int consumed int err error } type bufferedNetworkReader struct { stream io.ReadCloser emptyBuffer chan *bufferedNetworkReaderBuffer readyBuffer chan *bufferedNetworkReaderBuffer terminate chan bool current *bufferedNetworkReaderBuffer mutex sync.Mutex gotEOF bool } // handleBufferedNetworkReader runs in a goroutine func handleBufferedNetworkReader(br *bufferedNetworkReader) { defer close(br.readyBuffer) for { select { case b := <-br.emptyBuffer: b.len, b.err = br.stream.Read(b.data) br.readyBuffer <- b if b.err != nil { return } case <-br.terminate: return } } } func (n *bufferedNetworkReader) Close() error { close(n.terminate) close(n.emptyBuffer) return n.stream.Close() } func (n *bufferedNetworkReader) read(p []byte) (int, error) { if n.current != nil { copied := copy(p, n.current.data[n.current.consumed:n.current.len]) n.current.consumed += copied if n.current.consumed == n.current.len { n.emptyBuffer <- n.current n.current = nil } if copied > 0 { return copied, nil } } if n.gotEOF { return 0, io.EOF } var b *bufferedNetworkReaderBuffer select { case b = <-n.readyBuffer: if b.err != nil { if b.err != io.EOF { return b.len, b.err } n.gotEOF = true } b.consumed = 0 n.current = b return n.read(p) case <-n.terminate: return 0, io.EOF } } func (n *bufferedNetworkReader) Read(p []byte) (int, error) { n.mutex.Lock() defer n.mutex.Unlock() return n.read(p) } func makeBufferedNetworkReader(stream io.ReadCloser, nBuffers, bufferSize uint) *bufferedNetworkReader { br := bufferedNetworkReader{ stream: stream, emptyBuffer: make(chan *bufferedNetworkReaderBuffer, nBuffers), readyBuffer: make(chan *bufferedNetworkReaderBuffer, nBuffers), terminate: make(chan bool), } go func() { handleBufferedNetworkReader(&br) }() for range nBuffers { b := bufferedNetworkReaderBuffer{ data: make([]byte, bufferSize), } br.emptyBuffer <- &b } return &br } type signalCloseReader struct { closed chan struct{} stream io.ReadCloser consumeStream bool } func (s signalCloseReader) Read(p []byte) (int, error) { return s.stream.Read(p) } func (s signalCloseReader) Close() error { defer close(s.closed) if s.consumeStream { if _, err := io.Copy(io.Discard, s.stream); err != nil { s.stream.Close() return err } } return s.stream.Close() } ================================================ FILE: vendor/go.podman.io/image/v5/docker/docker_transport.go ================================================ package docker import ( "context" "errors" "fmt" "strings" "go.podman.io/image/v5/docker/policyconfiguration" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/transports" "go.podman.io/image/v5/types" ) // UnknownDigestSuffix can be appended to a reference when the caller // wants to push an image without a tag or digest. // NewReferenceUnknownDigest() is called when this const is detected. const UnknownDigestSuffix = "@@unknown-digest@@" func init() { transports.Register(Transport) } // Transport is an ImageTransport for container registry-hosted images. var Transport = dockerTransport{} type dockerTransport struct{} func (t dockerTransport) Name() string { return "docker" } // ParseReference converts a string, which should not start with the ImageTransport.Name prefix, into an ImageReference. func (t dockerTransport) ParseReference(reference string) (types.ImageReference, error) { return ParseReference(reference) } // ValidatePolicyConfigurationScope checks that scope is a valid name for a signature.PolicyTransportScopes keys // (i.e. a valid PolicyConfigurationIdentity() or PolicyConfigurationNamespaces() return value). // It is acceptable to allow an invalid value which will never be matched, it can "only" cause user confusion. // scope passed to this function will not be "", that value is always allowed. func (t dockerTransport) ValidatePolicyConfigurationScope(scope string) error { // FIXME? We could be verifying the various character set and length restrictions // from docker/distribution/reference.regexp.go, but other than that there // are few semantically invalid strings. return nil } // dockerReference is an ImageReference for Docker images. type dockerReference struct { ref reference.Named // By construction we know that !reference.IsNameOnly(ref) unless isUnknownDigest=true isUnknownDigest bool } // ParseReference converts a string, which should not start with the ImageTransport.Name prefix, into an Docker ImageReference. func ParseReference(refString string) (types.ImageReference, error) { refString, ok := strings.CutPrefix(refString, "//") if !ok { return nil, fmt.Errorf("docker: image reference %s does not start with //", refString) } refString, unknownDigest := strings.CutSuffix(refString, UnknownDigestSuffix) ref, err := reference.ParseNormalizedNamed(refString) if err != nil { return nil, err } if unknownDigest { if !reference.IsNameOnly(ref) { return nil, fmt.Errorf("docker: image reference %q has unknown digest set but it contains either a tag or digest", ref.String()+UnknownDigestSuffix) } return NewReferenceUnknownDigest(ref) } ref = reference.TagNameOnly(ref) return NewReference(ref) } // NewReference returns a Docker reference for a named reference. The reference must satisfy !reference.IsNameOnly(). func NewReference(ref reference.Named) (types.ImageReference, error) { return newReference(ref, false) } // NewReferenceUnknownDigest returns a Docker reference for a named reference, which can be used to write images without setting // a tag on the registry. The reference must satisfy reference.IsNameOnly() func NewReferenceUnknownDigest(ref reference.Named) (types.ImageReference, error) { return newReference(ref, true) } // newReference returns a dockerReference for a named reference. func newReference(ref reference.Named, unknownDigest bool) (dockerReference, error) { if reference.IsNameOnly(ref) && !unknownDigest { return dockerReference{}, fmt.Errorf("Docker reference %s is not for an unknown digest case; tag or digest is needed", reference.FamiliarString(ref)) } if !reference.IsNameOnly(ref) && unknownDigest { return dockerReference{}, fmt.Errorf("Docker reference %s is for an unknown digest case but reference has a tag or digest", reference.FamiliarString(ref)) } // A github.com/distribution/reference value can have a tag and a digest at the same time! // The docker/distribution API does not really support that (we can’t ask for an image with a specific // tag and digest), so fail. This MAY be accepted in the future. // (Even if it were supported, the semantics of policy namespaces are unclear - should we drop // the tag or the digest first?) _, isTagged := ref.(reference.NamedTagged) _, isDigested := ref.(reference.Canonical) if isTagged && isDigested { return dockerReference{}, errors.New("Docker references with both a tag and digest are currently not supported") } return dockerReference{ ref: ref, isUnknownDigest: unknownDigest, }, nil } func (ref dockerReference) Transport() types.ImageTransport { return Transport } // StringWithinTransport returns a string representation of the reference, which MUST be such that // reference.Transport().ParseReference(reference.StringWithinTransport()) returns an equivalent reference. // NOTE: The returned string is not promised to be equal to the original input to ParseReference; // e.g. default attribute values omitted by the user may be filled in the return value, or vice versa. // WARNING: Do not use the return value in the UI to describe an image, it does not contain the Transport().Name() prefix. func (ref dockerReference) StringWithinTransport() string { famString := "//" + reference.FamiliarString(ref.ref) if ref.isUnknownDigest { return famString + UnknownDigestSuffix } return famString } // DockerReference returns a Docker reference associated with this reference // (fully explicit, i.e. !reference.IsNameOnly, but reflecting user intent, // not e.g. after redirect or alias processing), or nil if unknown/not applicable. func (ref dockerReference) DockerReference() reference.Named { return ref.ref } // PolicyConfigurationIdentity returns a string representation of the reference, suitable for policy lookup. // This MUST reflect user intent, not e.g. after processing of third-party redirects or aliases; // The value SHOULD be fully explicit about its semantics, with no hidden defaults, AND canonical // (i.e. various references with exactly the same semantics should return the same configuration identity) // It is fine for the return value to be equal to StringWithinTransport(), and it is desirable but // not required/guaranteed that it will be a valid input to Transport().ParseReference(). // Returns "" if configuration identities for these references are not supported. func (ref dockerReference) PolicyConfigurationIdentity() string { if ref.isUnknownDigest { return ref.ref.Name() } res, err := policyconfiguration.DockerReferenceIdentity(ref.ref) if res == "" || err != nil { // Coverage: Should never happen, NewReference above should refuse values which could cause a failure. panic(fmt.Sprintf("Internal inconsistency: policyconfiguration.DockerReferenceIdentity returned %#v, %v", res, err)) } return res } // PolicyConfigurationNamespaces returns a list of other policy configuration namespaces to search // for if explicit configuration for PolicyConfigurationIdentity() is not set. The list will be processed // in order, terminating on first match, and an implicit "" is always checked at the end. // It is STRONGLY recommended for the first element, if any, to be a prefix of PolicyConfigurationIdentity(), // and each following element to be a prefix of the element preceding it. func (ref dockerReference) PolicyConfigurationNamespaces() []string { namespaces := policyconfiguration.DockerReferenceNamespaces(ref.ref) if ref.isUnknownDigest { if len(namespaces) != 0 && namespaces[0] == ref.ref.Name() { namespaces = namespaces[1:] } } return namespaces } // NewImage returns a types.ImageCloser for this reference, possibly specialized for this ImageTransport. // The caller must call .Close() on the returned ImageCloser. // NOTE: If any kind of signature verification should happen, build an UnparsedImage from the value returned by NewImageSource, // verify that UnparsedImage, and convert it into a real Image via image.FromUnparsedImage. // WARNING: This may not do the right thing for a manifest list, see image.FromSource for details. func (ref dockerReference) NewImage(ctx context.Context, sys *types.SystemContext) (types.ImageCloser, error) { return newImage(ctx, sys, ref) } // NewImageSource returns a types.ImageSource for this reference. // The caller must call .Close() on the returned ImageSource. func (ref dockerReference) NewImageSource(ctx context.Context, sys *types.SystemContext) (types.ImageSource, error) { return newImageSource(ctx, sys, ref) } // NewImageDestination returns a types.ImageDestination for this reference. // The caller must call .Close() on the returned ImageDestination. func (ref dockerReference) NewImageDestination(ctx context.Context, sys *types.SystemContext) (types.ImageDestination, error) { return newImageDestination(sys, ref) } // DeleteImage deletes the named image from the registry, if supported. func (ref dockerReference) DeleteImage(ctx context.Context, sys *types.SystemContext) error { return deleteImage(ctx, sys, ref) } // tagOrDigest returns a tag or digest from the reference. func (ref dockerReference) tagOrDigest() (string, error) { if ref, ok := ref.ref.(reference.Canonical); ok { return ref.Digest().String(), nil } if ref, ok := ref.ref.(reference.NamedTagged); ok { return ref.Tag(), nil } if ref.isUnknownDigest { return "", fmt.Errorf("Docker reference %q is for an unknown digest case, has neither a digest nor a tag", reference.FamiliarString(ref.ref)) } // This should not happen, NewReference above refuses reference.IsNameOnly values. return "", fmt.Errorf("Internal inconsistency: Reference %s unexpectedly has neither a digest nor a tag", reference.FamiliarString(ref.ref)) } ================================================ FILE: vendor/go.podman.io/image/v5/docker/errors.go ================================================ package docker import ( "errors" "fmt" "net/http" "github.com/docker/distribution/registry/api/errcode" "github.com/sirupsen/logrus" ) var ( // ErrV1NotSupported is returned when we're trying to talk to a // docker V1 registry. // Deprecated: The V1 container registry detection is no longer performed, so this error is never returned. ErrV1NotSupported = errors.New("can't talk to a V1 container registry") // ErrTooManyRequests is returned when the status code returned is 429 ErrTooManyRequests = errors.New("too many requests to registry") ) // ErrUnauthorizedForCredentials is returned when the status code returned is 401 type ErrUnauthorizedForCredentials struct { // We only use a struct to allow a type assertion, without limiting the contents of the error otherwise. Err error } func (e ErrUnauthorizedForCredentials) Error() string { return fmt.Sprintf("unable to retrieve auth token: invalid username/password: %s", e.Err.Error()) } // httpResponseToError translates the https.Response into an error, possibly prefixing it with the supplied context. It returns // nil if the response is not considered an error. // NOTE: Almost all callers in this package should use registryHTTPResponseToError instead. func httpResponseToError(res *http.Response, context string) error { switch res.StatusCode { case http.StatusOK: return nil case http.StatusTooManyRequests: return ErrTooManyRequests case http.StatusUnauthorized: err := registryHTTPResponseToError(res) return ErrUnauthorizedForCredentials{Err: err} default: if context == "" { return newUnexpectedHTTPStatusError(res) } return fmt.Errorf("%s: %w", context, newUnexpectedHTTPStatusError(res)) } } // registryHTTPResponseToError creates a Go error from an HTTP error response of a docker/distribution // registry. // // WARNING: The OCI distribution spec says // “A `4XX` response code from the registry MAY return a body in any format.”; but if it is // JSON, it MUST use the errcode.Error structure. // So, callers should primarily decide based on HTTP StatusCode, not based on error type here. func registryHTTPResponseToError(res *http.Response) error { err := handleErrorResponse(res) // len(errs) == 0 should never be returned by handleErrorResponse; if it does, we don't modify it and let the caller report it as is. if errs, ok := err.(errcode.Errors); ok && len(errs) > 0 { // The docker/distribution registry implementation almost never returns // more than one error in the HTTP body; it seems there is only one // possible instance, where the second error reports a cleanup failure // we don't really care about. // // The only _common_ case where a multi-element error is returned is // created by the handleErrorResponse parser when OAuth authorization fails: // the first element contains errors from a WWW-Authenticate header, the second // element contains errors from the response body. // // In that case the first one is currently _slightly_ more informative (ErrorCodeUnauthorized // for invalid tokens, ErrorCodeDenied for permission denied with a valid token // for the first error, vs. ErrorCodeUnauthorized for both cases for the second error.) // // Also, docker/docker similarly only logs the other errors and returns the // first one. if len(errs) > 1 { logrus.Debugf("Discarding non-primary errors:") for _, err := range errs[1:] { logrus.Debugf(" %s", err.Error()) } } err = errs[0] } switch e := err.(type) { case *unexpectedHTTPResponseError: response := string(e.Response) if len(response) > 50 { response = response[:50] + "..." } // %.0w makes e visible to error.Unwrap() without including any text err = fmt.Errorf("StatusCode: %d, %q%.0w", e.StatusCode, response, e) case errcode.Error: // e.Error() is fmt.Sprintf("%s: %s", e.Code.Error(), e.Message, which is usually // rather redundant. So reword it without using e.Code.Error() if e.Message is the default. if e.Message == e.Code.Message() { // %.0w makes e visible to error.Unwrap() without including any text err = fmt.Errorf("%s%.0w", e.Message, e) } } return err } ================================================ FILE: vendor/go.podman.io/image/v5/docker/internal/tarfile/dest.go ================================================ package tarfile import ( "bytes" "context" "encoding/json" "errors" "fmt" "io" "github.com/opencontainers/go-digest" "github.com/sirupsen/logrus" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/internal/imagedestination/impl" "go.podman.io/image/v5/internal/imagedestination/stubs" "go.podman.io/image/v5/internal/iolimits" "go.podman.io/image/v5/internal/private" "go.podman.io/image/v5/internal/streamdigest" "go.podman.io/image/v5/manifest" "go.podman.io/image/v5/types" ) // Destination is a partial implementation of private.ImageDestination for writing to a Writer. type Destination struct { impl.Compat impl.PropertyMethodsInitialize stubs.IgnoresOriginalOCIConfig stubs.NoPutBlobPartialInitialize stubs.NoSignaturesInitialize archive *Writer commitWithOptions func(ctx context.Context, options private.CommitOptions) error repoTags []reference.NamedTagged // Other state. config []byte sysCtx *types.SystemContext } // NewDestination returns a tarfile.Destination adding images to the specified Writer. // commitWithOptions implements ImageDestination.CommitWithOptions. func NewDestination(sys *types.SystemContext, archive *Writer, transportName string, ref reference.NamedTagged, commitWithOptions func(ctx context.Context, options private.CommitOptions) error, ) *Destination { repoTags := []reference.NamedTagged{} if ref != nil { repoTags = append(repoTags, ref) } dest := &Destination{ PropertyMethodsInitialize: impl.PropertyMethods(impl.Properties{ SupportedManifestMIMETypes: []string{ manifest.DockerV2Schema2MediaType, // We rely on the types.Image.UpdatedImage schema conversion capabilities. }, DesiredLayerCompression: types.Decompress, AcceptsForeignLayerURLs: false, MustMatchRuntimeOS: false, IgnoresEmbeddedDockerReference: false, // N/A, we only accept schema2 images where EmbeddedDockerReferenceConflicts() is always false. // The code _is_ actually thread-safe, but apart from computing sizes/digests of layers where // this is unknown in advance, the actual copy is serialized by d.archive, so there probably isn’t // much benefit from concurrency, mostly just extra CPU, memory and I/O contention. HasThreadSafePutBlob: false, }), NoPutBlobPartialInitialize: stubs.NoPutBlobPartialRaw(transportName), NoSignaturesInitialize: stubs.NoSignatures("Storing signatures for docker tar files is not supported"), archive: archive, commitWithOptions: commitWithOptions, repoTags: repoTags, sysCtx: sys, } dest.Compat = impl.AddCompat(dest) return dest } // AddRepoTags adds the specified tags to the destination's repoTags. func (d *Destination) AddRepoTags(tags []reference.NamedTagged) { d.repoTags = append(d.repoTags, tags...) } // PutBlobWithOptions writes contents of stream and returns data representing the result. // inputInfo.Digest can be optionally provided if known; if provided, and stream is read to the end without error, the digest MUST match the stream contents. // inputInfo.Size is the expected length of stream, if known. // inputInfo.MediaType describes the blob format, if known. // WARNING: The contents of stream are being verified on the fly. Until stream.Read() returns io.EOF, the contents of the data SHOULD NOT be available // to any other readers for download using the supplied digest. // If stream.Read() at any time, ESPECIALLY at end of input, returns an error, PutBlobWithOptions MUST 1) fail, and 2) delete any data stored so far. func (d *Destination) PutBlobWithOptions(ctx context.Context, stream io.Reader, inputInfo types.BlobInfo, options private.PutBlobOptions) (private.UploadedBlob, error) { // Ouch, we need to stream the blob into a temporary file just to determine the size. // When the layer is decompressed, we also have to generate the digest on uncompressed data. if inputInfo.Size == -1 || inputInfo.Digest == "" { logrus.Debugf("docker tarfile: input with unknown size, streaming to disk first ...") streamCopy, cleanup, err := streamdigest.ComputeBlobInfo(d.sysCtx, stream, &inputInfo) if err != nil { return private.UploadedBlob{}, err } defer cleanup() stream = streamCopy logrus.Debugf("... streaming done") } if err := d.archive.lock(); err != nil { return private.UploadedBlob{}, err } defer d.archive.unlock() // Maybe the blob has been already sent ok, reusedInfo, err := d.archive.tryReusingBlobLocked(inputInfo) if err != nil { return private.UploadedBlob{}, err } if ok { return private.UploadedBlob{Digest: reusedInfo.Digest, Size: reusedInfo.Size}, nil } if options.IsConfig { buf, err := iolimits.ReadAtMost(stream, iolimits.MaxConfigBodySize) if err != nil { return private.UploadedBlob{}, fmt.Errorf("reading Config file stream: %w", err) } d.config = buf configPath, err := d.archive.configPath(inputInfo.Digest) if err != nil { return private.UploadedBlob{}, err } if err := d.archive.sendFileLocked(configPath, inputInfo.Size, bytes.NewReader(buf)); err != nil { return private.UploadedBlob{}, fmt.Errorf("writing Config file: %w", err) } } else { layerPath, err := d.archive.physicalLayerPath(inputInfo.Digest) if err != nil { return private.UploadedBlob{}, err } if err := d.archive.sendFileLocked(layerPath, inputInfo.Size, stream); err != nil { return private.UploadedBlob{}, err } } d.archive.recordBlobLocked(types.BlobInfo{Digest: inputInfo.Digest, Size: inputInfo.Size}) return private.UploadedBlob{Digest: inputInfo.Digest, Size: inputInfo.Size}, nil } // TryReusingBlobWithOptions checks whether the transport already contains, or can efficiently reuse, a blob, and if so, applies it to the current destination // (e.g. if the blob is a filesystem layer, this signifies that the changes it describes need to be applied again when composing a filesystem tree). // info.Digest must not be empty. // If the blob has been successfully reused, returns (true, info, nil). // If the transport can not reuse the requested blob, TryReusingBlob returns (false, {}, nil); it returns a non-nil error only on an unexpected failure. func (d *Destination) TryReusingBlobWithOptions(ctx context.Context, info types.BlobInfo, options private.TryReusingBlobOptions) (bool, private.ReusedBlob, error) { if !impl.OriginalCandidateMatchesTryReusingBlobOptions(options) { return false, private.ReusedBlob{}, nil } if err := d.archive.lock(); err != nil { return false, private.ReusedBlob{}, err } defer d.archive.unlock() return d.archive.tryReusingBlobLocked(info) } // PutManifest writes manifest to the destination. // The instanceDigest value is expected to always be nil, because this transport does not support manifest lists, so // there can be no secondary manifests. // FIXME? This should also receive a MIME type if known, to differentiate between schema versions. // If the destination is in principle available, refuses this manifest type (e.g. it does not recognize the schema), // but may accept a different manifest type, the returned error must be an ManifestTypeRejectedError. func (d *Destination) PutManifest(ctx context.Context, m []byte, instanceDigest *digest.Digest) error { if instanceDigest != nil { return errors.New(`Manifest lists are not supported for docker tar files`) } // We do not bother with types.ManifestTypeRejectedError; our .SupportedManifestMIMETypes() above is already providing only one alternative, // so the caller trying a different manifest kind would be pointless. var man manifest.Schema2 if err := json.Unmarshal(m, &man); err != nil { return fmt.Errorf("parsing manifest: %w", err) } if man.SchemaVersion != 2 || man.MediaType != manifest.DockerV2Schema2MediaType { return errors.New("Unsupported manifest type, need a Docker schema 2 manifest") } if err := d.archive.lock(); err != nil { return err } defer d.archive.unlock() if err := d.archive.writeLegacyMetadataLocked(man.LayersDescriptors, d.config, d.repoTags); err != nil { return err } return d.archive.ensureManifestItemLocked(man.LayersDescriptors, man.ConfigDescriptor.Digest, d.repoTags) } // CommitWithOptions marks the process of storing the image as successful and asks for the image to be persisted. // WARNING: This does not have any transactional semantics: // - Uploaded data MAY be visible to others before CommitWithOptions() is called // - Uploaded data MAY be removed or MAY remain around if Close() is called without CommitWithOptions() (i.e. rollback is allowed but not guaranteed) func (d *Destination) CommitWithOptions(ctx context.Context, options private.CommitOptions) error { // This indirection exists because impl.Compat expects all ImageDestinationInternalOnly methods // to be implemented in one place. return d.commitWithOptions(ctx, options) } ================================================ FILE: vendor/go.podman.io/image/v5/docker/internal/tarfile/reader.go ================================================ package tarfile import ( "archive/tar" "encoding/json" "errors" "fmt" "io" "os" "path" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/internal/iolimits" "go.podman.io/image/v5/internal/tmpdir" "go.podman.io/image/v5/pkg/compression" "go.podman.io/image/v5/types" ) // Reader is a ((docker save)-formatted) tar archive that allows random access to any component. type Reader struct { // None of the fields below are modified after the archive is created, until .Close(); // this allows concurrent readers of the same archive. path string // "" if the archive has already been closed. removeOnClose bool // Remove file on close if true Manifest []ManifestItem // Guaranteed to exist after the archive is created. } // NewReaderFromFile returns a Reader for the specified path. // The caller should call .Close() on the returned archive when done. func NewReaderFromFile(sys *types.SystemContext, path string) (*Reader, error) { file, err := os.Open(path) if err != nil { return nil, fmt.Errorf("opening file %q: %w", path, err) } defer file.Close() // If the file is seekable and already not compressed we can just return the file itself // as a source. Otherwise we pass the stream to NewReaderFromStream. var stream io.Reader = file if _, err := file.Seek(0, io.SeekCurrent); err == nil { // seeking is possible decompressed, isCompressed, err := compression.AutoDecompress(file) if err != nil { return nil, fmt.Errorf("detecting compression for file %q: %w", path, err) } defer decompressed.Close() stream = decompressed if !isCompressed { return newReader(path, false) } } return NewReaderFromStream(sys, stream) } // NewReaderFromStream returns a Reader for the specified inputStream, // which can be either compressed or uncompressed. The caller can close the // inputStream immediately after NewReaderFromFile returns. // The caller should call .Close() on the returned archive when done. func NewReaderFromStream(sys *types.SystemContext, inputStream io.Reader) (*Reader, error) { // Save inputStream to a temporary file tarCopyFile, err := tmpdir.CreateBigFileTemp(sys, "docker-tar") if err != nil { return nil, fmt.Errorf("creating temporary file: %w", err) } defer tarCopyFile.Close() succeeded := false defer func() { if !succeeded { os.Remove(tarCopyFile.Name()) } }() // In order to be compatible with docker-load, we need to support // auto-decompression (it's also a nice quality-of-life thing to avoid // giving users really confusing "invalid tar header" errors). uncompressedStream, _, err := compression.AutoDecompress(inputStream) if err != nil { return nil, fmt.Errorf("auto-decompressing input: %w", err) } defer uncompressedStream.Close() // Copy the plain archive to the temporary file. // // TODO: This can take quite some time, and should ideally be cancellable // using a context.Context. if _, err := io.Copy(tarCopyFile, uncompressedStream); err != nil { return nil, fmt.Errorf("copying contents to temporary file %q: %w", tarCopyFile.Name(), err) } succeeded = true return newReader(tarCopyFile.Name(), true) } // newReader creates a Reader for the specified path and removeOnClose flag. // The caller should call .Close() on the returned archive when done. func newReader(path string, removeOnClose bool) (*Reader, error) { // This is a valid enough archive, except Manifest is not yet filled. r := Reader{ path: path, removeOnClose: removeOnClose, } succeeded := false defer func() { if !succeeded { r.Close() } }() // We initialize Manifest immediately when constructing the Reader instead // of later on-demand because every caller will need the data, and because doing it now // removes the need to synchronize the access/creation of the data if the archive is later // used from multiple goroutines to access different images. // FIXME? Do we need to deal with the legacy format? bytes, err := r.readTarComponent(manifestFileName, iolimits.MaxTarFileManifestSize) if err != nil { return nil, err } if err := json.Unmarshal(bytes, &r.Manifest); err != nil { return nil, fmt.Errorf("decoding tar manifest.json: %w", err) } succeeded = true return &r, nil } // Close removes resources associated with an initialized Reader, if any. func (r *Reader) Close() error { path := r.path r.path = "" // Mark the archive as closed if r.removeOnClose { return os.Remove(path) } return nil } // ChooseManifestItem selects a manifest item from r.Manifest matching (ref, sourceIndex), one or // both of which should be (nil, -1). // On success, it returns the manifest item and an index of the matching tag, if a tag was used // for matching; the index is -1 if a tag was not used. func (r *Reader) ChooseManifestItem(ref reference.NamedTagged, sourceIndex int) (*ManifestItem, int, error) { switch { case ref != nil && sourceIndex != -1: return nil, -1, fmt.Errorf("Internal error: Cannot have both ref %s and source index @%d", ref.String(), sourceIndex) case ref != nil: refString := ref.String() for i := range r.Manifest { for tagIndex, tag := range r.Manifest[i].RepoTags { parsedTag, err := reference.ParseNormalizedNamed(tag) if err != nil { return nil, -1, fmt.Errorf("Invalid tag %#v in manifest.json item @%d: %w", tag, i, err) } if parsedTag.String() == refString { return &r.Manifest[i], tagIndex, nil } } } return nil, -1, fmt.Errorf("Tag %#v not found", refString) case sourceIndex != -1: if sourceIndex >= len(r.Manifest) { return nil, -1, fmt.Errorf("Invalid source index @%d, only %d manifest items available", sourceIndex, len(r.Manifest)) } return &r.Manifest[sourceIndex], -1, nil default: if len(r.Manifest) != 1 { return nil, -1, fmt.Errorf("Unexpected tar manifest.json: expected 1 item, got %d", len(r.Manifest)) } return &r.Manifest[0], -1, nil } } // tarReadCloser is a way to close the backing file of a tar.Reader when the user no longer needs the tar component. type tarReadCloser struct { *tar.Reader backingFile *os.File } func (t *tarReadCloser) Close() error { return t.backingFile.Close() } // openTarComponent returns a ReadCloser for the specific file within the archive. // This is linear scan; we assume that the tar file will have a fairly small amount of files (~layers), // and that filesystem caching will make the repeated seeking over the (uncompressed) tarPath cheap enough. // It is safe to call this method from multiple goroutines simultaneously. // The caller should call .Close() on the returned stream. func (r *Reader) openTarComponent(componentPath string) (io.ReadCloser, error) { // This is only a sanity check; if anyone did concurrently close ra, this access is technically // racy against the write in .Close(). if r.path == "" { return nil, errors.New("Internal error: trying to read an already closed tarfile.Reader") } f, err := os.Open(r.path) if err != nil { return nil, err } succeeded := false defer func() { if !succeeded { f.Close() } }() tarReader, header, err := findTarComponent(f, componentPath) if err != nil { return nil, err } if header == nil { return nil, os.ErrNotExist } if header.FileInfo().Mode()&os.ModeType == os.ModeSymlink { // FIXME: untested // We follow only one symlink; so no loops are possible. if _, err := f.Seek(0, io.SeekStart); err != nil { return nil, err } // The new path could easily point "outside" the archive, but we only compare it to existing tar headers without extracting the archive, // so we don't care. tarReader, header, err = findTarComponent(f, path.Join(path.Dir(componentPath), header.Linkname)) if err != nil { return nil, err } if header == nil { return nil, os.ErrNotExist } } if !header.FileInfo().Mode().IsRegular() { return nil, fmt.Errorf("Error reading tar archive component %q: not a regular file", header.Name) } succeeded = true return &tarReadCloser{Reader: tarReader, backingFile: f}, nil } // findTarComponent returns a header and a reader matching componentPath within inputFile, // or (nil, nil, nil) if not found. func findTarComponent(inputFile io.Reader, componentPath string) (*tar.Reader, *tar.Header, error) { t := tar.NewReader(inputFile) componentPath = path.Clean(componentPath) for { h, err := t.Next() if err == io.EOF { break } if err != nil { return nil, nil, err } if path.Clean(h.Name) == componentPath { return t, h, nil } } return nil, nil, nil } // readTarComponent returns full contents of componentPath. // It is safe to call this method from multiple goroutines simultaneously. func (r *Reader) readTarComponent(path string, limit int) ([]byte, error) { file, err := r.openTarComponent(path) if err != nil { return nil, fmt.Errorf("loading tar component %q: %w", path, err) } defer file.Close() bytes, err := iolimits.ReadAtMost(file, limit) if err != nil { return nil, err } return bytes, nil } ================================================ FILE: vendor/go.podman.io/image/v5/docker/internal/tarfile/src.go ================================================ package tarfile import ( "archive/tar" "bytes" "context" "encoding/json" "errors" "fmt" "io" "os" "path" "sync" digest "github.com/opencontainers/go-digest" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/internal/imagesource/impl" "go.podman.io/image/v5/internal/imagesource/stubs" "go.podman.io/image/v5/internal/iolimits" "go.podman.io/image/v5/manifest" "go.podman.io/image/v5/pkg/compression" "go.podman.io/image/v5/types" ) // Source is a partial implementation of types.ImageSource for reading from tarPath. type Source struct { impl.Compat impl.PropertyMethodsInitialize impl.NoSignatures impl.DoesNotAffectLayerInfosForCopy stubs.NoGetBlobAtInitialize archive *Reader closeArchive bool // .Close() the archive when the source is closed. // If ref is nil and sourceIndex is -1, indicates the only image in the archive. ref reference.NamedTagged // May be nil sourceIndex int // May be -1 // The following data is only available after ensureCachedDataIsPresent() succeeds tarManifest *ManifestItem // nil if not available yet. configBytes []byte configDigest digest.Digest orderedDiffIDList []digest.Digest knownLayers map[digest.Digest]*layerInfo // Other state generatedManifest []byte // Private cache for GetManifest(), nil if not set yet. cacheDataLock sync.Once // Private state for ensureCachedDataIsPresent to make it concurrency-safe cacheDataResult error // Private state for ensureCachedDataIsPresent } type layerInfo struct { path string size int64 } // NewSource returns a tarfile.Source for an image in the specified archive matching ref // and sourceIndex (or the only image if they are (nil, -1)). // The archive will be closed if closeArchive func NewSource(archive *Reader, closeArchive bool, transportName string, ref reference.NamedTagged, sourceIndex int) *Source { s := &Source{ PropertyMethodsInitialize: impl.PropertyMethods(impl.Properties{ HasThreadSafeGetBlob: true, }), NoGetBlobAtInitialize: stubs.NoGetBlobAtRaw(transportName), archive: archive, closeArchive: closeArchive, ref: ref, sourceIndex: sourceIndex, } s.Compat = impl.AddCompat(s) return s } // ensureCachedDataIsPresent loads data necessary for any of the public accessors. // It is safe to call this from multi-threaded code. func (s *Source) ensureCachedDataIsPresent() error { s.cacheDataLock.Do(func() { s.cacheDataResult = s.ensureCachedDataIsPresentPrivate() }) return s.cacheDataResult } // ensureCachedDataIsPresentPrivate is a private implementation detail of ensureCachedDataIsPresent. // Call ensureCachedDataIsPresent instead. func (s *Source) ensureCachedDataIsPresentPrivate() error { tarManifest, _, err := s.archive.ChooseManifestItem(s.ref, s.sourceIndex) if err != nil { return err } // Read and parse config. configBytes, err := s.archive.readTarComponent(tarManifest.Config, iolimits.MaxConfigBodySize) if err != nil { return err } var parsedConfig manifest.Schema2Image // There's a lot of info there, but we only really care about layer DiffIDs. if err := json.Unmarshal(configBytes, &parsedConfig); err != nil { return fmt.Errorf("decoding tar config %q: %w", tarManifest.Config, err) } if parsedConfig.RootFS == nil { return fmt.Errorf("Invalid image config (rootFS is not set): %q", tarManifest.Config) } knownLayers, err := s.prepareLayerData(tarManifest, &parsedConfig) if err != nil { return err } // Success; commit. s.tarManifest = tarManifest s.configBytes = configBytes s.configDigest = digest.FromBytes(configBytes) s.orderedDiffIDList = parsedConfig.RootFS.DiffIDs s.knownLayers = knownLayers return nil } // Close removes resources associated with an initialized Source, if any. func (s *Source) Close() error { if s.closeArchive { return s.archive.Close() } return nil } // TarManifest returns contents of manifest.json func (s *Source) TarManifest() []ManifestItem { return s.archive.Manifest } func (s *Source) prepareLayerData(tarManifest *ManifestItem, parsedConfig *manifest.Schema2Image) (map[digest.Digest]*layerInfo, error) { // Collect layer data available in manifest and config. if len(tarManifest.Layers) != len(parsedConfig.RootFS.DiffIDs) { return nil, fmt.Errorf("Inconsistent layer count: %d in manifest, %d in config", len(tarManifest.Layers), len(parsedConfig.RootFS.DiffIDs)) } knownLayers := map[digest.Digest]*layerInfo{} unknownLayerSizes := map[string]*layerInfo{} // Points into knownLayers, a "to do list" of items with unknown sizes. for i, diffID := range parsedConfig.RootFS.DiffIDs { if _, ok := knownLayers[diffID]; ok { // Apparently it really can happen that a single image contains the same layer diff more than once. // In that case, the diffID validation ensures that both layers truly are the same, and it should not matter // which of the tarManifest.Layers paths is used; (docker save) actually makes the duplicates symlinks to the original. continue } layerPath := path.Clean(tarManifest.Layers[i]) if _, ok := unknownLayerSizes[layerPath]; ok { return nil, fmt.Errorf("Layer tarfile %q used for two different DiffID values", layerPath) } li := &layerInfo{ // A new element in each iteration path: layerPath, size: -1, } knownLayers[diffID] = li unknownLayerSizes[layerPath] = li } // Scan the tar file to collect layer sizes. file, err := os.Open(s.archive.path) if err != nil { return nil, err } defer file.Close() t := tar.NewReader(file) for { h, err := t.Next() if err == io.EOF { break } if err != nil { return nil, err } layerPath := path.Clean(h.Name) // FIXME: Cache this data across images in Reader. if li, ok := unknownLayerSizes[layerPath]; ok { // Since GetBlob will decompress layers that are compressed we need // to do the decompression here as well, otherwise we will // incorrectly report the size. Pretty critical, since tools like // umoci always compress layer blobs. Obviously we only bother with // the slower method of checking if it's compressed. uncompressedStream, isCompressed, err := compression.AutoDecompress(t) if err != nil { return nil, fmt.Errorf("auto-decompressing %q to determine its size: %w", layerPath, err) } defer uncompressedStream.Close() uncompressedSize := h.Size if isCompressed { uncompressedSize, err = io.Copy(io.Discard, uncompressedStream) if err != nil { return nil, fmt.Errorf("reading %q to find its size: %w", layerPath, err) } } li.size = uncompressedSize delete(unknownLayerSizes, layerPath) } } if len(unknownLayerSizes) != 0 { return nil, errors.New("Some layer tarfiles are missing in the tarball") // This could do with a better error reporting, if this ever happened in practice. } return knownLayers, nil } // GetManifest returns the image's manifest along with its MIME type (which may be empty when it can't be determined but the manifest is available). // It may use a remote (= slow) service. // If instanceDigest is not nil, it contains a digest of the specific manifest instance to retrieve (when the primary manifest is a manifest list); // this never happens if the primary manifest is not a manifest list (e.g. if the source never returns manifest lists). // This source implementation does not support manifest lists, so the passed-in instanceDigest should always be nil, // as the primary manifest can not be a list, so there can be no secondary instances. func (s *Source) GetManifest(ctx context.Context, instanceDigest *digest.Digest) ([]byte, string, error) { if instanceDigest != nil { // How did we even get here? GetManifest(ctx, nil) has returned a manifest.DockerV2Schema2MediaType. return nil, "", errors.New(`Manifest lists are not supported by "docker-daemon:"`) } if s.generatedManifest == nil { if err := s.ensureCachedDataIsPresent(); err != nil { return nil, "", err } m := manifest.Schema2{ SchemaVersion: 2, MediaType: manifest.DockerV2Schema2MediaType, ConfigDescriptor: manifest.Schema2Descriptor{ MediaType: manifest.DockerV2Schema2ConfigMediaType, Size: int64(len(s.configBytes)), Digest: s.configDigest, }, LayersDescriptors: []manifest.Schema2Descriptor{}, } for _, diffID := range s.orderedDiffIDList { li, ok := s.knownLayers[diffID] if !ok { return nil, "", fmt.Errorf("Internal inconsistency: Information about layer %s missing", diffID) } m.LayersDescriptors = append(m.LayersDescriptors, manifest.Schema2Descriptor{ Digest: diffID, // diffID is a digest of the uncompressed tarball MediaType: manifest.DockerV2Schema2LayerMediaType, Size: li.size, }) } manifestBytes, err := json.Marshal(&m) if err != nil { return nil, "", err } s.generatedManifest = manifestBytes } return s.generatedManifest, manifest.DockerV2Schema2MediaType, nil } // uncompressedReadCloser is an io.ReadCloser that closes both the uncompressed stream and the underlying input. type uncompressedReadCloser struct { io.Reader underlyingCloser func() error uncompressedCloser func() error } func (r uncompressedReadCloser) Close() error { var res error if err := r.uncompressedCloser(); err != nil { res = err } if err := r.underlyingCloser(); err != nil && res == nil { res = err } return res } // GetBlob returns a stream for the specified blob, and the blob’s size (or -1 if unknown). // The Digest field in BlobInfo is guaranteed to be provided, Size may be -1 and MediaType may be optionally provided. // May update BlobInfoCache, preferably after it knows for certain that a blob truly exists at a specific location. func (s *Source) GetBlob(ctx context.Context, info types.BlobInfo, cache types.BlobInfoCache) (io.ReadCloser, int64, error) { if err := s.ensureCachedDataIsPresent(); err != nil { return nil, 0, err } if info.Digest == s.configDigest { // FIXME? Implement a more general algorithm matching instead of assuming sha256. return io.NopCloser(bytes.NewReader(s.configBytes)), int64(len(s.configBytes)), nil } if li, ok := s.knownLayers[info.Digest]; ok { // diffID is a digest of the uncompressed tarball, underlyingStream, err := s.archive.openTarComponent(li.path) if err != nil { return nil, 0, err } closeUnderlyingStream := true defer func() { if closeUnderlyingStream { underlyingStream.Close() } }() // In order to handle the fact that digests != diffIDs (and thus that a // caller which is trying to verify the blob will run into problems), // we need to decompress blobs. This is a bit ugly, but it's a // consequence of making everything addressable by their DiffID rather // than by their digest... // // In particular, because the v2s2 manifest being generated uses // DiffIDs, any caller of GetBlob is going to be asking for DiffIDs of // layers not their _actual_ digest. The result is that copy/... will // be verifying a "digest" which is not the actual layer's digest (but // is instead the DiffID). uncompressedStream, _, err := compression.AutoDecompress(underlyingStream) if err != nil { return nil, 0, fmt.Errorf("auto-decompressing blob %s: %w", info.Digest, err) } newStream := uncompressedReadCloser{ Reader: uncompressedStream, underlyingCloser: underlyingStream.Close, uncompressedCloser: uncompressedStream.Close, } closeUnderlyingStream = false return newStream, li.size, nil } return nil, 0, fmt.Errorf("Unknown blob %s", info.Digest) } ================================================ FILE: vendor/go.podman.io/image/v5/docker/internal/tarfile/types.go ================================================ package tarfile import ( "github.com/opencontainers/go-digest" "go.podman.io/image/v5/manifest" ) // Various data structures. // Based on github.com/docker/docker/image/tarexport/tarexport.go const ( manifestFileName = "manifest.json" legacyLayerFileName = "layer.tar" legacyConfigFileName = "json" legacyVersionFileName = "VERSION" legacyRepositoriesFileName = "repositories" ) // ManifestItem is an element of the array stored in the top-level manifest.json file. type ManifestItem struct { // NOTE: This is visible as docker/tarfile.ManifestItem, and a part of the stable API. Config string RepoTags []string Layers []string Parent imageID `json:",omitempty"` LayerSources map[digest.Digest]manifest.Schema2Descriptor `json:",omitempty"` } type imageID string ================================================ FILE: vendor/go.podman.io/image/v5/docker/internal/tarfile/writer.go ================================================ package tarfile import ( "archive/tar" "bytes" "encoding/json" "errors" "fmt" "io" "os" "path/filepath" "slices" "sync" "time" "github.com/opencontainers/go-digest" "github.com/sirupsen/logrus" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/internal/private" "go.podman.io/image/v5/internal/set" "go.podman.io/image/v5/manifest" "go.podman.io/image/v5/types" ) // Writer allows creating a (docker save)-formatted tar archive containing one or more images. type Writer struct { mutex sync.Mutex // ALL of the following members can only be accessed with the mutex held. // Use Writer.lock() to obtain the mutex. writer io.Writer tar *tar.Writer // nil if the Writer has already been closed. // Other state. blobs map[digest.Digest]types.BlobInfo // list of already-sent blobs repositories map[string]map[string]string legacyLayers *set.Set[string] // A set of IDs of legacy layers that have been already sent. manifest []ManifestItem manifestByConfig map[digest.Digest]int // A map from config digest to an entry index in manifest above. } // NewWriter returns a Writer for the specified io.Writer. // The caller must eventually call .Close() on the returned object to create a valid archive. func NewWriter(dest io.Writer) *Writer { return &Writer{ writer: dest, tar: tar.NewWriter(dest), blobs: make(map[digest.Digest]types.BlobInfo), repositories: map[string]map[string]string{}, legacyLayers: set.New[string](), manifestByConfig: map[digest.Digest]int{}, } } // lock does some sanity checks and locks the Writer. // If this function succeeds, the caller must call w.unlock. // Do not use Writer.mutex directly. func (w *Writer) lock() error { w.mutex.Lock() if w.tar == nil { w.mutex.Unlock() return errors.New("Internal error: trying to use an already closed tarfile.Writer") } return nil } // unlock releases the lock obtained by Writer.lock // Do not use Writer.mutex directly. func (w *Writer) unlock() { w.mutex.Unlock() } // tryReusingBlobLocked checks whether the transport already contains, a blob, and if so, returns its metadata. // info.Digest must not be empty. // If the blob has been successfully reused, returns (true, info, nil). // If the transport can not reuse the requested blob, tryReusingBlob returns (false, {}, nil); it returns a non-nil error only on an unexpected failure. // The caller must have locked the Writer. func (w *Writer) tryReusingBlobLocked(info types.BlobInfo) (bool, private.ReusedBlob, error) { if info.Digest == "" { return false, private.ReusedBlob{}, errors.New("Can not check for a blob with unknown digest") } if blob, ok := w.blobs[info.Digest]; ok { return true, private.ReusedBlob{Digest: info.Digest, Size: blob.Size}, nil } return false, private.ReusedBlob{}, nil } // recordBlob records metadata of a recorded blob, which must contain at least a digest and size. // The caller must have locked the Writer. func (w *Writer) recordBlobLocked(info types.BlobInfo) { w.blobs[info.Digest] = info } // ensureSingleLegacyLayerLocked writes legacy VERSION and configuration files for a single layer // The caller must have locked the Writer. func (w *Writer) ensureSingleLegacyLayerLocked(layerID string, layerDigest digest.Digest, configBytes []byte) error { if !w.legacyLayers.Contains(layerID) { // Create a symlink for the legacy format, where there is one subdirectory per layer ("image"). // See also the comment in physicalLayerPath. physicalLayerPath, err := w.physicalLayerPath(layerDigest) if err != nil { return err } if err := w.sendSymlinkLocked(filepath.Join(layerID, legacyLayerFileName), filepath.Join("..", physicalLayerPath)); err != nil { return fmt.Errorf("creating layer symbolic link: %w", err) } b := []byte("1.0") if err := w.sendBytesLocked(filepath.Join(layerID, legacyVersionFileName), b); err != nil { return fmt.Errorf("writing VERSION file: %w", err) } if err := w.sendBytesLocked(filepath.Join(layerID, legacyConfigFileName), configBytes); err != nil { return fmt.Errorf("writing config json file: %w", err) } w.legacyLayers.Add(layerID) } return nil } // writeLegacyMetadataLocked writes legacy layer metadata and records tags for a single image. func (w *Writer) writeLegacyMetadataLocked(layerDescriptors []manifest.Schema2Descriptor, configBytes []byte, repoTags []reference.NamedTagged) error { var chainID digest.Digest lastLayerID := "" for i, l := range layerDescriptors { // The legacy format requires a config file per layer layerConfig := make(map[string]any) // The root layer doesn't have any parent if lastLayerID != "" { layerConfig["parent"] = lastLayerID } // The top layer configuration file is generated by using subpart of the image configuration if i == len(layerDescriptors)-1 { var config map[string]*json.RawMessage err := json.Unmarshal(configBytes, &config) if err != nil { return fmt.Errorf("unmarshaling config: %w", err) } for _, attr := range [7]string{"architecture", "config", "container", "container_config", "created", "docker_version", "os"} { layerConfig[attr] = config[attr] } } // This chainID value matches the computation in docker/docker/layer.CreateChainID … if err := l.Digest.Validate(); err != nil { // This should never fail on this code path, still: make sure the chainID computation is unambiguous. return err } if chainID == "" { chainID = l.Digest } else { chainID = digest.Canonical.FromString(chainID.String() + " " + l.Digest.String()) } // … but note that the image ID does not _exactly_ match docker/docker/image/v1.CreateID, primarily because // we create the image configs differently in details. At least recent versions allocate new IDs on load, // so this is fine as long as the IDs we use are unique / cannot loop. // // For intermediate images, we could just use the chainID as an image ID, but using a digest of ~the created // config makes sure that everything uses the same “namespace”; a bit less efficient but clearer. // // Temporarily add the chainID to the config, only for the purpose of generating the image ID. layerConfig["layer_id"] = chainID b, err := json.Marshal(layerConfig) // Note that layerConfig["id"] is not set yet at this point. if err != nil { return fmt.Errorf("marshaling layer config: %w", err) } delete(layerConfig, "layer_id") layerID := digest.Canonical.FromBytes(b).Encoded() layerConfig["id"] = layerID configBytes, err := json.Marshal(layerConfig) if err != nil { return fmt.Errorf("marshaling layer config: %w", err) } if err := w.ensureSingleLegacyLayerLocked(layerID, l.Digest, configBytes); err != nil { return err } lastLayerID = layerID } if lastLayerID != "" { for _, repoTag := range repoTags { if val, ok := w.repositories[repoTag.Name()]; ok { val[repoTag.Tag()] = lastLayerID } else { w.repositories[repoTag.Name()] = map[string]string{repoTag.Tag(): lastLayerID} } } } return nil } // checkManifestItemsMatch checks that a and b describe the same image, // and returns an error if that’s not the case (which should never happen). func checkManifestItemsMatch(a, b *ManifestItem) error { if a.Config != b.Config { return fmt.Errorf("Internal error: Trying to reuse ManifestItem values with configs %#v vs. %#v", a.Config, b.Config) } if !slices.Equal(a.Layers, b.Layers) { return fmt.Errorf("Internal error: Trying to reuse ManifestItem values with layers %#v vs. %#v", a.Layers, b.Layers) } // Ignore RepoTags, that will be built later. // Ignore Parent and LayerSources, which we don’t set to anything meaningful. return nil } // ensureManifestItemLocked ensures that there is a manifest item pointing to (layerDescriptors, configDigest) with repoTags // The caller must have locked the Writer. func (w *Writer) ensureManifestItemLocked(layerDescriptors []manifest.Schema2Descriptor, configDigest digest.Digest, repoTags []reference.NamedTagged) error { layerPaths := []string{} for _, l := range layerDescriptors { p, err := w.physicalLayerPath(l.Digest) if err != nil { return err } layerPaths = append(layerPaths, p) } var item *ManifestItem configPath, err := w.configPath(configDigest) if err != nil { return err } newItem := ManifestItem{ Config: configPath, RepoTags: []string{}, Layers: layerPaths, Parent: "", // We don’t have this information LayerSources: nil, } if i, ok := w.manifestByConfig[configDigest]; ok { item = &w.manifest[i] if err := checkManifestItemsMatch(item, &newItem); err != nil { return err } } else { i := len(w.manifest) w.manifestByConfig[configDigest] = i w.manifest = append(w.manifest, newItem) item = &w.manifest[i] } knownRepoTags := set.New[string]() knownRepoTags.AddSeq(slices.Values(item.RepoTags)) for _, tag := range repoTags { // For github.com/docker/docker consumers, this works just as well as // refString := ref.String() // because when reading the RepoTags strings, github.com/docker/docker/reference // normalizes both of them to the same value. // // Doing it this way to include the normalized-out `docker.io[/library]` does make // a difference for github.com/projectatomic/docker consumers, with the // “Add --add-registry and --block-registry options to docker daemon” patch. // These consumers treat reference strings which include a hostname and reference // strings without a hostname differently. // // Using the host name here is more explicit about the intent, and it has the same // effect as (docker pull) in projectatomic/docker, which tags the result using // a hostname-qualified reference. // See https://github.com/containers/image/issues/72 for a more detailed // analysis and explanation. refString := fmt.Sprintf("%s:%s", tag.Name(), tag.Tag()) if !knownRepoTags.Contains(refString) { item.RepoTags = append(item.RepoTags, refString) knownRepoTags.Add(refString) } } return nil } // Close writes all outstanding data about images to the archive, and finishes writing data // to the underlying io.Writer. // No more images can be added after this is called. func (w *Writer) Close() error { if err := w.lock(); err != nil { return err } defer w.unlock() b, err := json.Marshal(&w.manifest) if err != nil { return err } if err := w.sendBytesLocked(manifestFileName, b); err != nil { return err } b, err = json.Marshal(w.repositories) if err != nil { return fmt.Errorf("marshaling repositories: %w", err) } if err := w.sendBytesLocked(legacyRepositoriesFileName, b); err != nil { return fmt.Errorf("writing config json file: %w", err) } if err := w.tar.Close(); err != nil { return err } w.tar = nil // Mark the Writer as closed. return nil } // configPath returns a path we choose for storing a config with the specified digest. // NOTE: This is an internal implementation detail, not a format property, and can change // any time. func (w *Writer) configPath(configDigest digest.Digest) (string, error) { if err := configDigest.Validate(); err != nil { // digest.Digest.Encoded() panics on failure, and could possibly result in unexpected paths, so validate explicitly. return "", err } return configDigest.Encoded() + ".json", nil } // physicalLayerPath returns a path we choose for storing a layer with the specified digest // (the actual path, i.e. a regular file, not a symlink that may be used in the legacy format). // NOTE: This is an internal implementation detail, not a format property, and can change // any time. func (w *Writer) physicalLayerPath(layerDigest digest.Digest) (string, error) { if err := layerDigest.Validate(); err != nil { // digest.Digest.Encoded() panics on failure, and could possibly result in unexpected paths, so validate explicitly. return "", err } // Note that this can't be e.g. filepath.Join(l.Digest.Encoded(), legacyLayerFileName); due to the way // writeLegacyMetadata constructs layer IDs differently from inputinfo.Digest values (as described // inside it), most of the layers would end up in subdirectories alone without any metadata; (docker load) // tries to load every subdirectory as an image and fails if the config is missing. So, keep the layers // in the root of the tarball. return layerDigest.Encoded() + ".tar", nil } type tarFI struct { path string size int64 isSymlink bool } func (t *tarFI) Name() string { return t.path } func (t *tarFI) Size() int64 { return t.size } func (t *tarFI) Mode() os.FileMode { if t.isSymlink { return os.ModeSymlink } return 0o444 } func (t *tarFI) ModTime() time.Time { return time.Unix(0, 0) } func (t *tarFI) IsDir() bool { return false } func (t *tarFI) Sys() any { return nil } // sendSymlinkLocked sends a symlink into the tar stream. // The caller must have locked the Writer. func (w *Writer) sendSymlinkLocked(path string, target string) error { hdr, err := tar.FileInfoHeader(&tarFI{path: path, size: 0, isSymlink: true}, target) if err != nil { return err } logrus.Debugf("Sending as tar link %s -> %s", path, target) return w.tar.WriteHeader(hdr) } // sendBytesLocked sends a path into the tar stream. // The caller must have locked the Writer. func (w *Writer) sendBytesLocked(path string, b []byte) error { return w.sendFileLocked(path, int64(len(b)), bytes.NewReader(b)) } // sendFileLocked sends a file into the tar stream. // The caller must have locked the Writer. func (w *Writer) sendFileLocked(path string, expectedSize int64, stream io.Reader) error { hdr, err := tar.FileInfoHeader(&tarFI{path: path, size: expectedSize}, "") if err != nil { return err } logrus.Debugf("Sending as tar file %s", path) if err := w.tar.WriteHeader(hdr); err != nil { return err } // TODO: This can take quite some time, and should ideally be cancellable using a context.Context. size, err := io.Copy(w.tar, stream) if err != nil { return err } if size != expectedSize { return fmt.Errorf("Size mismatch when copying %s, expected %d, got %d", path, expectedSize, size) } return nil } ================================================ FILE: vendor/go.podman.io/image/v5/docker/paths_common.go ================================================ //go:build !freebsd package docker const etcDir = "/etc" ================================================ FILE: vendor/go.podman.io/image/v5/docker/paths_freebsd.go ================================================ //go:build freebsd package docker const etcDir = "/usr/local/etc" ================================================ FILE: vendor/go.podman.io/image/v5/docker/policyconfiguration/naming.go ================================================ package policyconfiguration import ( "errors" "fmt" "strings" "go.podman.io/image/v5/docker/reference" ) // DockerReferenceIdentity returns a string representation of the reference, suitable for policy lookup, // as a backend for ImageReference.PolicyConfigurationIdentity. // The reference must satisfy !reference.IsNameOnly(). func DockerReferenceIdentity(ref reference.Named) (string, error) { res := ref.Name() tagged, isTagged := ref.(reference.NamedTagged) digested, isDigested := ref.(reference.Canonical) switch { case isTagged && isDigested: // Note that this CAN actually happen. return "", fmt.Errorf("Unexpected Docker reference %s with both a name and a digest", reference.FamiliarString(ref)) case !isTagged && !isDigested: // This should not happen, the caller is expected to ensure !reference.IsNameOnly() return "", fmt.Errorf("Internal inconsistency: Docker reference %s with neither a tag nor a digest", reference.FamiliarString(ref)) case isTagged: res = res + ":" + tagged.Tag() case isDigested: res = res + "@" + digested.Digest().String() default: // Coverage: The above was supposed to be exhaustive. return "", errors.New("Internal inconsistency, unexpected default branch") } return res, nil } // DockerReferenceNamespaces returns a list of other policy configuration namespaces to search, // as a backend for ImageReference.PolicyConfigurationIdentity. // The reference must satisfy !reference.IsNameOnly(). func DockerReferenceNamespaces(ref reference.Named) []string { // Look for a match of the repository, and then of the possible parent // namespaces. Note that this only happens on the expanded host names // and repository names, i.e. "busybox" is looked up as "docker.io/library/busybox", // then in its parent "docker.io/library"; in none of "busybox", // un-namespaced "library" nor in "" supposedly implicitly representing "library/". // // ref.Name() == ref.Domain() + "/" + ref.Path(), so the last // iteration matches the host name (for any namespace). res := []string{} name := ref.Name() for { res = append(res, name) lastSlash := strings.LastIndex(name, "/") if lastSlash == -1 { break } name = name[:lastSlash] } // Strip port number if any, before appending to res slice. // Currently, the most compatible behavior is to return // example.com:8443/ns, example.com:8443, *.com. // If a port number is not specified, the expected behavior would be // example.com/ns, example.com, *.com portNumColon := strings.Index(name, ":") if portNumColon != -1 { name = name[:portNumColon] } // Append wildcarded domains to res slice for { firstDot := strings.Index(name, ".") if firstDot == -1 { break } name = name[firstDot+1:] res = append(res, "*."+name) } return res } ================================================ FILE: vendor/go.podman.io/image/v5/docker/reference/README.md ================================================ This is a copy of github.com/docker/distribution/reference as of commit 3226863cbcba6dbc2f6c83a37b28126c934af3f8, except that ParseAnyReferenceWithSet has been removed to drop the dependency on github.com/docker/distribution/digestset. ================================================ FILE: vendor/go.podman.io/image/v5/docker/reference/helpers.go ================================================ package reference import "path" // IsNameOnly returns true if reference only contains a repo name. func IsNameOnly(ref Named) bool { if _, ok := ref.(NamedTagged); ok { return false } if _, ok := ref.(Canonical); ok { return false } return true } // FamiliarName returns the familiar name string // for the given named, familiarizing if needed. func FamiliarName(ref Named) string { if nn, ok := ref.(normalizedNamed); ok { return nn.Familiar().Name() } return ref.Name() } // FamiliarString returns the familiar string representation // for the given reference, familiarizing if needed. func FamiliarString(ref Reference) string { if nn, ok := ref.(normalizedNamed); ok { return nn.Familiar().String() } return ref.String() } // FamiliarMatch reports whether ref matches the specified pattern. // See https://godoc.org/path#Match for supported patterns. func FamiliarMatch(pattern string, ref Reference) (bool, error) { matched, err := path.Match(pattern, FamiliarString(ref)) if namedRef, isNamed := ref.(Named); isNamed && !matched { matched, _ = path.Match(pattern, FamiliarName(namedRef)) } return matched, err } ================================================ FILE: vendor/go.podman.io/image/v5/docker/reference/normalize.go ================================================ package reference import ( "errors" "fmt" "strings" "github.com/opencontainers/go-digest" ) var ( legacyDefaultDomain = "index.docker.io" defaultDomain = "docker.io" officialRepoName = "library" defaultTag = "latest" ) // normalizedNamed represents a name which has been // normalized and has a familiar form. A familiar name // is what is used in Docker UI. An example normalized // name is "docker.io/library/ubuntu" and corresponding // familiar name of "ubuntu". type normalizedNamed interface { Named Familiar() Named } // ParseNormalizedNamed parses a string into a named reference // transforming a familiar name from Docker UI to a fully // qualified reference. If the value may be an identifier // use ParseAnyReference. func ParseNormalizedNamed(s string) (Named, error) { if ok := anchoredIdentifierRegexp.MatchString(s); ok { return nil, fmt.Errorf("invalid repository name (%s), cannot specify 64-byte hexadecimal strings", s) } domain, remainder := splitDockerDomain(s) var remoteName string if tagSep := strings.IndexRune(remainder, ':'); tagSep > -1 { remoteName = remainder[:tagSep] } else { remoteName = remainder } if strings.ToLower(remoteName) != remoteName { return nil, errors.New("invalid reference format: repository name must be lowercase") } ref, err := Parse(domain + "/" + remainder) if err != nil { return nil, err } named, isNamed := ref.(Named) if !isNamed { return nil, fmt.Errorf("reference %s has no name", ref.String()) } return named, nil } // ParseDockerRef normalizes the image reference following the docker convention. This is added // mainly for backward compatibility. // The reference returned can only be either tagged or digested. For reference contains both tag // and digest, the function returns digested reference, e.g. docker.io/library/busybox:latest@ // sha256:7cc4b5aefd1d0cadf8d97d4350462ba51c694ebca145b08d7d41b41acc8db5aa will be returned as // docker.io/library/busybox@sha256:7cc4b5aefd1d0cadf8d97d4350462ba51c694ebca145b08d7d41b41acc8db5aa. func ParseDockerRef(ref string) (Named, error) { named, err := ParseNormalizedNamed(ref) if err != nil { return nil, err } if _, ok := named.(NamedTagged); ok { if canonical, ok := named.(Canonical); ok { // The reference is both tagged and digested, only // return digested. newNamed, err := WithName(canonical.Name()) if err != nil { return nil, err } newCanonical, err := WithDigest(newNamed, canonical.Digest()) if err != nil { return nil, err } return newCanonical, nil } } return TagNameOnly(named), nil } // splitDockerDomain splits a repository name to domain and remotename string. // If no valid domain is found, the default domain is used. Repository name // needs to be already validated before. func splitDockerDomain(name string) (domain, remainder string) { i := strings.IndexRune(name, '/') if i == -1 || (!strings.ContainsAny(name[:i], ".:") && name[:i] != "localhost") { domain, remainder = defaultDomain, name } else { domain, remainder = name[:i], name[i+1:] } if domain == legacyDefaultDomain { domain = defaultDomain } if domain == defaultDomain && !strings.ContainsRune(remainder, '/') { remainder = officialRepoName + "/" + remainder } return domain, remainder } // familiarizeName returns a shortened version of the name familiar // to the Docker UI. Familiar names have the default domain // "docker.io" and "library/" repository prefix removed. // For example, "docker.io/library/redis" will have the familiar // name "redis" and "docker.io/dmcgowan/myapp" will be "dmcgowan/myapp". // Returns a familiarized named only reference. func familiarizeName(named namedRepository) repository { repo := repository{ domain: named.Domain(), path: named.Path(), } if repo.domain == defaultDomain { repo.domain = "" // Handle official repositories which have the pattern "library/" if split := strings.Split(repo.path, "/"); len(split) == 2 && split[0] == officialRepoName { repo.path = split[1] } } return repo } func (r reference) Familiar() Named { return reference{ namedRepository: familiarizeName(r.namedRepository), tag: r.tag, digest: r.digest, } } func (r repository) Familiar() Named { return familiarizeName(r) } func (t taggedReference) Familiar() Named { return taggedReference{ namedRepository: familiarizeName(t.namedRepository), tag: t.tag, } } func (c canonicalReference) Familiar() Named { return canonicalReference{ namedRepository: familiarizeName(c.namedRepository), digest: c.digest, } } // TagNameOnly adds the default tag "latest" to a reference if it only has // a repo name. func TagNameOnly(ref Named) Named { if IsNameOnly(ref) { namedTagged, err := WithTag(ref, defaultTag) if err != nil { // Default tag must be valid, to create a NamedTagged // type with non-validated input the WithTag function // should be used instead panic(err) } return namedTagged } return ref } // ParseAnyReference parses a reference string as a possible identifier, // full digest, or familiar name. // // Deprecated: This parses inputs with 64 hexadecimal characters as sha256 digests, // and that can’t be generalized (a digest algorithm can not be determined purely // from the length of the input). // // In the future, image IDs will either stay 256-bit, but will not be SHA-256 values; // or they will support arbitrary algorithms, in which case the hexadecimal-only syntax // is not sufficient. Either way, this function will not be fit for purpose. // // Callers (if any) should redesign their syntax to strictly differentiate between // image IDs (with an as-yet-unknown future syntax) and named image references. func ParseAnyReference(ref string) (Reference, error) { if ok := anchoredIdentifierRegexp.MatchString(ref); ok { return digestReference("sha256:" + ref), nil } if dgst, err := digest.Parse(ref); err == nil { return digestReference(dgst), nil } return ParseNormalizedNamed(ref) } ================================================ FILE: vendor/go.podman.io/image/v5/docker/reference/reference.go ================================================ // Package reference provides a general type to represent any way of referencing images within the registry. // Its main purpose is to abstract tags and digests (content-addressable hash). // // Grammar // // reference := name [ ":" tag ] [ "@" digest ] // name := [domain '/'] path-component ['/' path-component]* // domain := domain-component ['.' domain-component]* [':' port-number] // domain-component := /([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])/ // port-number := /[0-9]+/ // path-component := alphanumeric [separator alphanumeric]* // alphanumeric := /[a-z0-9]+/ // separator := /[_.]|__|[-]*/ // // tag := /[\w][\w.-]{0,127}/ // // digest := digest-algorithm ":" digest-hex // digest-algorithm := digest-algorithm-component [ digest-algorithm-separator digest-algorithm-component ]* // digest-algorithm-separator := /[+.-_]/ // digest-algorithm-component := /[A-Za-z][A-Za-z0-9]*/ // digest-hex := /[0-9a-fA-F]{32,}/ ; At least 128 bit digest value // // identifier := /[a-f0-9]{64}/ // short-identifier := /[a-f0-9]{6,64}/ package reference import ( "errors" "fmt" "strings" "github.com/opencontainers/go-digest" ) const ( // NameTotalLengthMax is the maximum total number of characters in a repository name. NameTotalLengthMax = 255 ) var ( // ErrReferenceInvalidFormat represents an error while trying to parse a string as a reference. ErrReferenceInvalidFormat = errors.New("invalid reference format") // ErrTagInvalidFormat represents an error while trying to parse a string as a tag. ErrTagInvalidFormat = errors.New("invalid tag format") // ErrDigestInvalidFormat represents an error while trying to parse a string as a tag. ErrDigestInvalidFormat = errors.New("invalid digest format") // ErrNameContainsUppercase is returned for invalid repository names that contain uppercase characters. ErrNameContainsUppercase = errors.New("repository name must be lowercase") // ErrNameEmpty is returned for empty, invalid repository names. ErrNameEmpty = errors.New("repository name must have at least one component") // ErrNameTooLong is returned when a repository name is longer than NameTotalLengthMax. ErrNameTooLong = fmt.Errorf("repository name must not be more than %v characters", NameTotalLengthMax) // ErrNameNotCanonical is returned when a name is not canonical. ErrNameNotCanonical = errors.New("repository name must be canonical") ) // Reference is an opaque object reference identifier that may include // modifiers such as a hostname, name, tag, and digest. type Reference interface { // String returns the full reference String() string } // Field provides a wrapper type for resolving correct reference types when // working with encoding. type Field struct { reference Reference } // AsField wraps a reference in a Field for encoding. func AsField(reference Reference) Field { return Field{reference} } // Reference unwraps the reference type from the field to // return the Reference object. This object should be // of the appropriate type to further check for different // reference types. func (f Field) Reference() Reference { return f.reference } // MarshalText serializes the field to byte text which // is the string of the reference. func (f Field) MarshalText() (p []byte, err error) { return []byte(f.reference.String()), nil } // UnmarshalText parses text bytes by invoking the // reference parser to ensure the appropriately // typed reference object is wrapped by field. func (f *Field) UnmarshalText(p []byte) error { r, err := Parse(string(p)) if err != nil { return err } f.reference = r return nil } // Named is an object with a full name type Named interface { Reference Name() string } // Tagged is an object which has a tag type Tagged interface { Reference Tag() string } // NamedTagged is an object including a name and tag. type NamedTagged interface { Named Tag() string } // Digested is an object which has a digest // in which it can be referenced by type Digested interface { Reference Digest() digest.Digest } // Canonical reference is an object with a fully unique // name including a name with domain and digest type Canonical interface { Named Digest() digest.Digest } // namedRepository is a reference to a repository with a name. // A namedRepository has both domain and path components. type namedRepository interface { Named Domain() string Path() string } // Domain returns the domain part of the Named reference func Domain(named Named) string { if r, ok := named.(namedRepository); ok { return r.Domain() } domain, _ := splitDomain(named.Name()) return domain } // Path returns the name without the domain part of the Named reference func Path(named Named) (name string) { if r, ok := named.(namedRepository); ok { return r.Path() } _, path := splitDomain(named.Name()) return path } func splitDomain(name string) (string, string) { match := anchoredNameRegexp.FindStringSubmatch(name) if len(match) != 3 { return "", name } return match[1], match[2] } // SplitHostname splits a named reference into a // hostname and name string. If no valid hostname is // found, the hostname is empty and the full value // is returned as name // Deprecated: Use Domain or Path func SplitHostname(named Named) (string, string) { if r, ok := named.(namedRepository); ok { return r.Domain(), r.Path() } return splitDomain(named.Name()) } // Parse parses s and returns a syntactically valid Reference. // If an error was encountered it is returned, along with a nil Reference. // NOTE: Parse will not handle short digests. func Parse(s string) (Reference, error) { matches := ReferenceRegexp.FindStringSubmatch(s) if matches == nil { if s == "" { return nil, ErrNameEmpty } if ReferenceRegexp.FindStringSubmatch(strings.ToLower(s)) != nil { return nil, ErrNameContainsUppercase } return nil, ErrReferenceInvalidFormat } if len(matches[1]) > NameTotalLengthMax { return nil, ErrNameTooLong } var repo repository nameMatch := anchoredNameRegexp.FindStringSubmatch(matches[1]) if len(nameMatch) == 3 { repo.domain = nameMatch[1] repo.path = nameMatch[2] } else { repo.domain = "" repo.path = matches[1] } ref := reference{ namedRepository: repo, tag: matches[2], } if matches[3] != "" { var err error ref.digest, err = digest.Parse(matches[3]) if err != nil { return nil, err } } r := getBestReferenceType(ref) if r == nil { return nil, ErrNameEmpty } return r, nil } // ParseNamed parses s and returns a syntactically valid reference implementing // the Named interface. The reference must have a name and be in the canonical // form, otherwise an error is returned. // If an error was encountered it is returned, along with a nil Reference. // NOTE: ParseNamed will not handle short digests. func ParseNamed(s string) (Named, error) { named, err := ParseNormalizedNamed(s) if err != nil { return nil, err } if named.String() != s { return nil, ErrNameNotCanonical } return named, nil } // WithName returns a named object representing the given string. If the input // is invalid ErrReferenceInvalidFormat will be returned. func WithName(name string) (Named, error) { if len(name) > NameTotalLengthMax { return nil, ErrNameTooLong } match := anchoredNameRegexp.FindStringSubmatch(name) if match == nil || len(match) != 3 { return nil, ErrReferenceInvalidFormat } return repository{ domain: match[1], path: match[2], }, nil } // WithTag combines the name from "name" and the tag from "tag" to form a // reference incorporating both the name and the tag. func WithTag(name Named, tag string) (NamedTagged, error) { if !anchoredTagRegexp.MatchString(tag) { return nil, ErrTagInvalidFormat } var repo repository if r, ok := name.(namedRepository); ok { repo.domain = r.Domain() repo.path = r.Path() } else { repo.path = name.Name() } if canonical, ok := name.(Canonical); ok { return reference{ namedRepository: repo, tag: tag, digest: canonical.Digest(), }, nil } return taggedReference{ namedRepository: repo, tag: tag, }, nil } // WithDigest combines the name from "name" and the digest from "digest" to form // a reference incorporating both the name and the digest. func WithDigest(name Named, digest digest.Digest) (Canonical, error) { if !anchoredDigestRegexp.MatchString(digest.String()) { return nil, ErrDigestInvalidFormat } var repo repository if r, ok := name.(namedRepository); ok { repo.domain = r.Domain() repo.path = r.Path() } else { repo.path = name.Name() } if tagged, ok := name.(Tagged); ok { return reference{ namedRepository: repo, tag: tagged.Tag(), digest: digest, }, nil } return canonicalReference{ namedRepository: repo, digest: digest, }, nil } // TrimNamed removes any tag or digest from the named reference. func TrimNamed(ref Named) Named { domain, path := SplitHostname(ref) return repository{ domain: domain, path: path, } } func getBestReferenceType(ref reference) Reference { if ref.Name() == "" { // Allow digest only references if ref.digest != "" { return digestReference(ref.digest) } return nil } if ref.tag == "" { if ref.digest != "" { return canonicalReference{ namedRepository: ref.namedRepository, digest: ref.digest, } } return ref.namedRepository } if ref.digest == "" { return taggedReference{ namedRepository: ref.namedRepository, tag: ref.tag, } } return ref } type reference struct { namedRepository tag string digest digest.Digest } func (r reference) String() string { return r.Name() + ":" + r.tag + "@" + r.digest.String() } func (r reference) Tag() string { return r.tag } func (r reference) Digest() digest.Digest { return r.digest } type repository struct { domain string path string } func (r repository) String() string { return r.Name() } func (r repository) Name() string { if r.domain == "" { return r.path } return r.domain + "/" + r.path } func (r repository) Domain() string { return r.domain } func (r repository) Path() string { return r.path } type digestReference digest.Digest func (d digestReference) String() string { return digest.Digest(d).String() } func (d digestReference) Digest() digest.Digest { return digest.Digest(d) } type taggedReference struct { namedRepository tag string } func (t taggedReference) String() string { return t.Name() + ":" + t.tag } func (t taggedReference) Tag() string { return t.tag } type canonicalReference struct { namedRepository digest digest.Digest } func (c canonicalReference) String() string { return c.Name() + "@" + c.digest.String() } func (c canonicalReference) Digest() digest.Digest { return c.digest } ================================================ FILE: vendor/go.podman.io/image/v5/docker/reference/regexp-additions.go ================================================ package reference // Return true if the specified string fully matches `IdentifierRegexp`. func IsFullIdentifier(s string) bool { return anchoredIdentifierRegexp.MatchString(s) } ================================================ FILE: vendor/go.podman.io/image/v5/docker/reference/regexp.go ================================================ package reference import ( "regexp" "strings" storageRegexp "go.podman.io/storage/pkg/regexp" ) const ( // alphaNumeric defines the alpha numeric atom, typically a // component of names. This only allows lower case characters and digits. alphaNumeric = `[a-z0-9]+` // separator defines the separators allowed to be embedded in name // components. This allow one period, one or two underscore and multiple // dashes. Repeated dashes and underscores are intentionally treated // differently. In order to support valid hostnames as name components, // supporting repeated dash was added. Additionally double underscore is // now allowed as a separator to loosen the restriction for previously // supported names. separator = `(?:[._]|__|[-]*)` // repository name to start with a component as defined by DomainRegexp // and followed by an optional port. domainComponent = `(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])` // The string counterpart for TagRegexp. tag = `[\w][\w.-]{0,127}` // The string counterpart for DigestRegexp. digestPat = `[A-Za-z][A-Za-z0-9]*(?:[-_+.][A-Za-z][A-Za-z0-9]*)*[:][[:xdigit:]]{32,}` // The string counterpart for IdentifierRegexp. identifier = `([a-f0-9]{64})` // The string counterpart for ShortIdentifierRegexp. shortIdentifier = `([a-f0-9]{6,64})` ) var ( // nameComponent restricts registry path component names to start // with at least one letter or number, with following parts able to be // separated by one period, one or two underscore and multiple dashes. nameComponent = expression( alphaNumeric, optional(repeated(separator, alphaNumeric))) domain = expression( domainComponent, optional(repeated(literal(`.`), domainComponent)), optional(literal(`:`), `[0-9]+`)) // DomainRegexp defines the structure of potential domain components // that may be part of image names. This is purposely a subset of what is // allowed by DNS to ensure backwards compatibility with Docker image // names. DomainRegexp = re(domain) // TagRegexp matches valid tag names. From docker/docker:graph/tags.go. TagRegexp = re(tag) anchoredTag = anchored(tag) // anchoredTagRegexp matches valid tag names, anchored at the start and // end of the matched string. anchoredTagRegexp = storageRegexp.Delayed(anchoredTag) // DigestRegexp matches valid digests. DigestRegexp = re(digestPat) anchoredDigest = anchored(digestPat) // anchoredDigestRegexp matches valid digests, anchored at the start and // end of the matched string. anchoredDigestRegexp = storageRegexp.Delayed(anchoredDigest) namePat = expression( optional(domain, literal(`/`)), nameComponent, optional(repeated(literal(`/`), nameComponent))) // NameRegexp is the format for the name component of references. The // regexp has capturing groups for the domain and name part omitting // the separating forward slash from either. NameRegexp = re(namePat) anchoredName = anchored( optional(capture(domain), literal(`/`)), capture(nameComponent, optional(repeated(literal(`/`), nameComponent)))) // anchoredNameRegexp is used to parse a name value, capturing the // domain and trailing components. anchoredNameRegexp = storageRegexp.Delayed(anchoredName) referencePat = anchored(capture(namePat), optional(literal(":"), capture(tag)), optional(literal("@"), capture(digestPat))) // ReferenceRegexp is the full supported format of a reference. The regexp // is anchored and has capturing groups for name, tag, and digest // components. ReferenceRegexp = re(referencePat) // IdentifierRegexp is the format for string identifier used as a // content addressable identifier using sha256. These identifiers // are like digests without the algorithm, since sha256 is used. IdentifierRegexp = re(identifier) // ShortIdentifierRegexp is the format used to represent a prefix // of an identifier. A prefix may be used to match a sha256 identifier // within a list of trusted identifiers. ShortIdentifierRegexp = re(shortIdentifier) anchoredIdentifier = anchored(identifier) // anchoredIdentifierRegexp is used to check or match an // identifier value, anchored at start and end of string. anchoredIdentifierRegexp = storageRegexp.Delayed(anchoredIdentifier) ) // re compiles the string to a regular expression. var re = regexp.MustCompile // literal compiles s into a literal regular expression, escaping any regexp // reserved characters. func literal(s string) string { return regexp.QuoteMeta(s) } // expression defines a full expression, where each regular expression must // follow the previous. func expression(res ...string) string { return strings.Join(res, "") } // optional wraps the expression in a non-capturing group and makes the // production optional. func optional(res ...string) string { return group(expression(res...)) + `?` } // repeated wraps the regexp in a non-capturing group to get one or more // matches. func repeated(res ...string) string { return group(expression(res...)) + `+` } // group wraps the regexp in a non-capturing group. func group(res ...string) string { return `(?:` + expression(res...) + `)` } // capture wraps the expression in a capturing group. func capture(res ...string) string { return `(` + expression(res...) + `)` } // anchored anchors the regular expression by adding start and end delimiters. func anchored(res ...string) string { return `^` + expression(res...) + `$` } ================================================ FILE: vendor/go.podman.io/image/v5/docker/registries_d.go ================================================ package docker import ( "errors" "fmt" "io/fs" "net/url" "os" "path" "path/filepath" "strings" "github.com/opencontainers/go-digest" "github.com/sirupsen/logrus" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/internal/rootless" "go.podman.io/image/v5/types" "go.podman.io/storage/pkg/fileutils" "go.podman.io/storage/pkg/homedir" "gopkg.in/yaml.v3" ) // systemRegistriesDirPath is the path to registries.d, used for locating lookaside Docker signature storage. // You can override this at build time with // -ldflags '-X go.podman.io/image/v5/docker.systemRegistriesDirPath=$your_path' var systemRegistriesDirPath = builtinRegistriesDirPath // builtinRegistriesDirPath is the path to registries.d. // DO NOT change this, instead see systemRegistriesDirPath above. const builtinRegistriesDirPath = etcDir + "/containers/registries.d" // userRegistriesDirPath is the path to the per user registries.d. var userRegistriesDir = filepath.FromSlash(".config/containers/registries.d") // defaultUserDockerDir is the default lookaside directory for unprivileged user var defaultUserDockerDir = filepath.FromSlash(".local/share/containers/sigstore") // defaultDockerDir is the default lookaside directory for root var defaultDockerDir = "/var/lib/containers/sigstore" // registryConfiguration is one of the files in registriesDirPath configuring lookaside locations, or the result of merging them all. // NOTE: Keep this in sync with docs/registries.d.md! type registryConfiguration struct { DefaultDocker *registryNamespace `yaml:"default-docker"` // The key is a namespace, using fully-expanded Docker reference format or parent namespaces (per dockerReference.PolicyConfiguration*), Docker map[string]registryNamespace `yaml:"docker"` } // registryNamespace defines lookaside locations for a single namespace. type registryNamespace struct { Lookaside string `yaml:"lookaside"` // For reading, and if LookasideStaging is not present, for writing. LookasideStaging string `yaml:"lookaside-staging"` // For writing only. SigStore string `yaml:"sigstore"` // For compatibility, deprecated in favor of Lookaside. SigStoreStaging string `yaml:"sigstore-staging"` // For compatibility, deprecated in favor of LookasideStaging. UseSigstoreAttachments *bool `yaml:"use-sigstore-attachments,omitempty"` } // lookasideStorageBase is an "opaque" type representing a lookaside Docker signature storage. // Users outside of this file should use SignatureStorageBaseURL and lookasideStorageURL below. type lookasideStorageBase *url.URL // SignatureStorageBaseURL reads configuration to find an appropriate lookaside storage URL for ref, for write access if “write”. // the usage of the BaseURL is defined under docker/distribution registries—separate storage of docs/signature-protocols.md // Warning: This function only exposes configuration in registries.d; // just because this function returns an URL does not mean that the URL will be used by c/image/docker (e.g. if the registry natively supports X-R-S-S). func SignatureStorageBaseURL(sys *types.SystemContext, ref types.ImageReference, write bool) (*url.URL, error) { dr, ok := ref.(dockerReference) if !ok { return nil, errors.New("ref must be a dockerReference") } config, err := loadRegistryConfiguration(sys) if err != nil { return nil, err } return config.lookasideStorageBaseURL(dr, write) } // loadRegistryConfiguration returns a registryConfiguration appropriate for sys. func loadRegistryConfiguration(sys *types.SystemContext) (*registryConfiguration, error) { dirPath := registriesDirPath(sys) logrus.Debugf(`Using registries.d directory %s`, dirPath) return loadAndMergeConfig(dirPath) } // registriesDirPath returns a path to registries.d func registriesDirPath(sys *types.SystemContext) string { return registriesDirPathWithHomeDir(sys, homedir.Get()) } // registriesDirPathWithHomeDir is an internal implementation detail of registriesDirPath, // it exists only to allow testing it with an artificial home directory. func registriesDirPathWithHomeDir(sys *types.SystemContext, homeDir string) string { if sys != nil && sys.RegistriesDirPath != "" { return sys.RegistriesDirPath } userRegistriesDirPath := filepath.Join(homeDir, userRegistriesDir) if err := fileutils.Exists(userRegistriesDirPath); err == nil { return userRegistriesDirPath } if sys != nil && sys.RootForImplicitAbsolutePaths != "" { return filepath.Join(sys.RootForImplicitAbsolutePaths, systemRegistriesDirPath) } return systemRegistriesDirPath } // loadAndMergeConfig loads configuration files in dirPath // FIXME: Probably rename to loadRegistryConfigurationForPath func loadAndMergeConfig(dirPath string) (*registryConfiguration, error) { mergedConfig := registryConfiguration{Docker: map[string]registryNamespace{}} dockerDefaultMergedFrom := "" nsMergedFrom := map[string]string{} dir, err := os.Open(dirPath) if err != nil { if os.IsNotExist(err) { return &mergedConfig, nil } return nil, err } configNames, err := dir.Readdirnames(0) if err != nil { return nil, err } for _, configName := range configNames { if !strings.HasSuffix(configName, ".yaml") { continue } configPath := filepath.Join(dirPath, configName) configBytes, err := os.ReadFile(configPath) if err != nil { if errors.Is(err, fs.ErrNotExist) { // file must have been removed between the directory listing // and the open call, ignore that as it is a expected race continue } return nil, err } var config registryConfiguration err = yaml.Unmarshal(configBytes, &config) if err != nil { return nil, fmt.Errorf("parsing %s: %w", configPath, err) } if config.DefaultDocker != nil { if mergedConfig.DefaultDocker != nil { return nil, fmt.Errorf(`Error parsing signature storage configuration: "default-docker" defined both in %q and %q`, dockerDefaultMergedFrom, configPath) } mergedConfig.DefaultDocker = config.DefaultDocker dockerDefaultMergedFrom = configPath } for nsName, nsConfig := range config.Docker { // includes config.Docker == nil if _, ok := mergedConfig.Docker[nsName]; ok { return nil, fmt.Errorf(`Error parsing signature storage configuration: "docker" namespace %q defined both in %q and %q`, nsName, nsMergedFrom[nsName], configPath) } mergedConfig.Docker[nsName] = nsConfig nsMergedFrom[nsName] = configPath } } return &mergedConfig, nil } // lookasideStorageBaseURL returns an appropriate signature storage URL for ref, for write access if “write”. // the usage of the BaseURL is defined under docker/distribution registries—separate storage of docs/signature-protocols.md func (config *registryConfiguration) lookasideStorageBaseURL(dr dockerReference, write bool) (*url.URL, error) { topLevel := config.signatureTopLevel(dr, write) var baseURL *url.URL if topLevel != "" { u, err := url.Parse(topLevel) if err != nil { return nil, fmt.Errorf("Invalid signature storage URL %s: %w", topLevel, err) } baseURL = u } else { // returns default directory if no lookaside specified in configuration file baseURL = builtinDefaultLookasideStorageDir(rootless.GetRootlessEUID()) logrus.Debugf(" No signature storage configuration found for %s, using built-in default %s", dr.PolicyConfigurationIdentity(), baseURL.Redacted()) } // NOTE: Keep this in sync with docs/signature-protocols.md! // FIXME? Restrict to explicitly supported schemes? repo := reference.Path(dr.ref) // Note that this is without a tag or digest. if path.Clean(repo) != repo { // Coverage: This should not be reachable because /./ and /../ components are not valid in docker references return nil, fmt.Errorf("Unexpected path elements in Docker reference %s for signature storage", dr.ref.String()) } baseURL.Path = baseURL.Path + "/" + repo return baseURL, nil } // builtinDefaultLookasideStorageDir returns default signature storage URL as per euid func builtinDefaultLookasideStorageDir(euid int) *url.URL { if euid != 0 { return &url.URL{Scheme: "file", Path: filepath.Join(homedir.Get(), defaultUserDockerDir)} } return &url.URL{Scheme: "file", Path: defaultDockerDir} } // config.signatureTopLevel returns an URL string configured in config for ref, for write access if “write”. // (the top level of the storage, namespaced by repo.FullName etc.), or "" if nothing has been configured. func (config *registryConfiguration) signatureTopLevel(ref dockerReference, write bool) string { if config.Docker != nil { // Look for a full match. identity := ref.PolicyConfigurationIdentity() if ns, ok := config.Docker[identity]; ok { logrus.Debugf(` Lookaside configuration: using "docker" namespace %s`, identity) if ret := ns.signatureTopLevel(write); ret != "" { return ret } } // Look for a match of the possible parent namespaces. for _, name := range ref.PolicyConfigurationNamespaces() { if ns, ok := config.Docker[name]; ok { logrus.Debugf(` Lookaside configuration: using "docker" namespace %s`, name) if ret := ns.signatureTopLevel(write); ret != "" { return ret } } } } // Look for a default location if config.DefaultDocker != nil { logrus.Debugf(` Lookaside configuration: using "default-docker" configuration`) if ret := config.DefaultDocker.signatureTopLevel(write); ret != "" { return ret } } return "" } // config.useSigstoreAttachments returns whether we should look for and write sigstore attachments. // for ref. func (config *registryConfiguration) useSigstoreAttachments(ref dockerReference) bool { if config.Docker != nil { // Look for a full match. identity := ref.PolicyConfigurationIdentity() if ns, ok := config.Docker[identity]; ok { logrus.Debugf(` Sigstore attachments: using "docker" namespace %s`, identity) if ns.UseSigstoreAttachments != nil { return *ns.UseSigstoreAttachments } } // Look for a match of the possible parent namespaces. for _, name := range ref.PolicyConfigurationNamespaces() { if ns, ok := config.Docker[name]; ok { logrus.Debugf(` Sigstore attachments: using "docker" namespace %s`, name) if ns.UseSigstoreAttachments != nil { return *ns.UseSigstoreAttachments } } } } // Look for a default location if config.DefaultDocker != nil { logrus.Debugf(` Sigstore attachments: using "default-docker" configuration`) if config.DefaultDocker.UseSigstoreAttachments != nil { return *config.DefaultDocker.UseSigstoreAttachments } } return false } // ns.signatureTopLevel returns an URL string configured in ns for ref, for write access if “write”. // or "" if nothing has been configured. func (ns registryNamespace) signatureTopLevel(write bool) string { if write { if ns.LookasideStaging != "" { logrus.Debugf(` Using "lookaside-staging" %s`, ns.LookasideStaging) return ns.LookasideStaging } if ns.SigStoreStaging != "" { logrus.Debugf(` Using "sigstore-staging" %s`, ns.SigStoreStaging) return ns.SigStoreStaging } } if ns.Lookaside != "" { logrus.Debugf(` Using "lookaside" %s`, ns.Lookaside) return ns.Lookaside } if ns.SigStore != "" { logrus.Debugf(` Using "sigstore" %s`, ns.SigStore) return ns.SigStore } return "" } // lookasideStorageURL returns an URL usable for accessing signature index in base with known manifestDigest. // base is not nil from the caller // NOTE: Keep this in sync with docs/signature-protocols.md! func lookasideStorageURL(base lookasideStorageBase, manifestDigest digest.Digest, index int) (*url.URL, error) { if err := manifestDigest.Validate(); err != nil { // digest.Digest.Encoded() panics on failure, and could possibly result in a path with ../, so validate explicitly. return nil, err } sigURL := *base sigURL.Path = fmt.Sprintf("%s@%s=%s/signature-%d", sigURL.Path, manifestDigest.Algorithm(), manifestDigest.Encoded(), index+1) return &sigURL, nil } ================================================ FILE: vendor/go.podman.io/image/v5/docker/wwwauthenticate.go ================================================ package docker // Based on github.com/docker/distribution/registry/client/auth/authchallenge.go, primarily stripping unnecessary dependencies. import ( "fmt" "iter" "net/http" "strings" ) // challenge carries information from a WWW-Authenticate response header. // See RFC 7235. type challenge struct { // Scheme is the auth-scheme according to RFC 7235 Scheme string // Parameters are the auth-params according to RFC 7235 Parameters map[string]string } // Octet types from RFC 7230. type octetType byte var octetTypes [256]octetType const ( isToken octetType = 1 << iota isSpace ) func init() { // OCTET = // CHAR = // CTL = // CR = // LF = // SP = // HT = // <"> = // CRLF = CR LF // LWS = [CRLF] 1*( SP | HT ) // TEXT = // separators = "(" | ")" | "<" | ">" | "@" | "," | ";" | ":" | "\" | <"> // | "/" | "[" | "]" | "?" | "=" | "{" | "}" | SP | HT // token = 1* // qdtext = > for c := range octetTypes { var t octetType isCtl := c <= 31 || c == 127 isChar := 0 <= c && c <= 127 isSeparator := strings.ContainsRune(" \t\"(),/:;<=>?@[]\\{}", rune(c)) if strings.ContainsRune(" \t\r\n", rune(c)) { t |= isSpace } if isChar && !isCtl && !isSeparator { t |= isToken } octetTypes[c] = t } } func iterateAuthHeader(header http.Header) iter.Seq[challenge] { return func(yield func(challenge) bool) { for _, h := range header[http.CanonicalHeaderKey("WWW-Authenticate")] { v, p := parseValueAndParams(h) if v != "" { if !yield(challenge{Scheme: v, Parameters: p}) { return } } } } } // parseAuthScope parses an authentication scope string of the form `$resource:$remote:$actions` func parseAuthScope(scopeStr string) (*authScope, error) { if parts := strings.Split(scopeStr, ":"); len(parts) == 3 { return &authScope{ resourceType: parts[0], remoteName: parts[1], actions: parts[2], }, nil } return nil, fmt.Errorf("error parsing auth scope: '%s'", scopeStr) } // NOTE: This is not a fully compliant parser per RFC 7235: // Most notably it does not support more than one challenge within a single header // Some of the whitespace parsing also seems noncompliant. // But it is clearly better than what we used to have… func parseValueAndParams(header string) (value string, params map[string]string) { params = make(map[string]string) value, s := expectToken(header) if value == "" { return value, params } value = strings.ToLower(value) s = "," + skipSpace(s) for strings.HasPrefix(s, ",") { var pkey string pkey, s = expectToken(skipSpace(s[1:])) if pkey == "" { return value, params } if !strings.HasPrefix(s, "=") { return value, params } var pvalue string pvalue, s = expectTokenOrQuoted(s[1:]) if pvalue == "" { return value, params } pkey = strings.ToLower(pkey) params[pkey] = pvalue s = skipSpace(s) } return value, params } func skipSpace(s string) (rest string) { i := 0 for ; i < len(s); i++ { if octetTypes[s[i]]&isSpace == 0 { break } } return s[i:] } func expectToken(s string) (token, rest string) { i := 0 for ; i < len(s); i++ { if octetTypes[s[i]]&isToken == 0 { break } } return s[:i], s[i:] } func expectTokenOrQuoted(s string) (value string, rest string) { if !strings.HasPrefix(s, "\"") { return expectToken(s) } s = s[1:] for i := 0; i < len(s); i++ { switch s[i] { case '"': return s[:i], s[i+1:] case '\\': p := make([]byte, len(s)-1) j := copy(p, s[:i]) escape := true for i++; i < len(s); i++ { b := s[i] switch { case escape: escape = false p[j] = b j++ case b == '\\': escape = true case b == '"': return string(p[:j]), s[i+1:] default: p[j] = b j++ } } return "", "" } } return "", "" } ================================================ FILE: vendor/go.podman.io/image/v5/image/docker_schema2.go ================================================ package image import ( "go.podman.io/image/v5/internal/image" ) // GzippedEmptyLayer is a gzip-compressed version of an empty tar file (1024 NULL bytes) // This comes from github.com/docker/distribution/manifest/schema1/config_builder.go; there is // a non-zero embedded timestamp; we could zero that, but that would just waste storage space // in registries, so let’s use the same values. var GzippedEmptyLayer = image.GzippedEmptyLayer // GzippedEmptyLayerDigest is a digest of GzippedEmptyLayer const GzippedEmptyLayerDigest = image.GzippedEmptyLayerDigest ================================================ FILE: vendor/go.podman.io/image/v5/image/sourced.go ================================================ // Package image consolidates knowledge about various container image formats // (as opposed to image storage mechanisms, which are handled by types.ImageSource) // and exposes all of them using an unified interface. package image import ( "context" "go.podman.io/image/v5/internal/image" "go.podman.io/image/v5/types" ) // FromSource returns a types.ImageCloser implementation for the default instance of source. // If source is a manifest list, .Manifest() still returns the manifest list, // but other methods transparently return data from an appropriate image instance. // // The caller must call .Close() on the returned ImageCloser. // // FromSource “takes ownership” of the input ImageSource and will call src.Close() // when the image is closed. (This does not prevent callers from using both the // Image and ImageSource objects simultaneously, but it means that they only need to // the Image.) // // NOTE: If any kind of signature verification should happen, build an UnparsedImage from the value returned by NewImageSource, // verify that UnparsedImage, and convert it into a real Image via image.FromUnparsedImage instead of calling this function. func FromSource(ctx context.Context, sys *types.SystemContext, src types.ImageSource) (types.ImageCloser, error) { return image.FromSource(ctx, sys, src) } // FromUnparsedImage returns a types.Image implementation for unparsed. // If unparsed represents a manifest list, .Manifest() still returns the manifest list, // but other methods transparently return data from an appropriate single image. // // The Image must not be used after the underlying ImageSource is Close()d. func FromUnparsedImage(ctx context.Context, sys *types.SystemContext, unparsed *UnparsedImage) (types.Image, error) { return image.FromUnparsedImage(ctx, sys, unparsed) } ================================================ FILE: vendor/go.podman.io/image/v5/image/unparsed.go ================================================ package image import ( "github.com/opencontainers/go-digest" "go.podman.io/image/v5/internal/image" "go.podman.io/image/v5/internal/private" "go.podman.io/image/v5/internal/unparsedimage" "go.podman.io/image/v5/types" ) // UnparsedImage implements types.UnparsedImage . // An UnparsedImage is a pair of (ImageSource, instance digest); it can represent either a manifest list or a single image instance. type UnparsedImage = image.UnparsedImage // UnparsedInstance returns a types.UnparsedImage implementation for (source, instanceDigest). // If instanceDigest is not nil, it contains a digest of the specific manifest instance to retrieve (when the primary manifest is a manifest list). // // This implementation of [types.UnparsedImage] ensures that [types.UnparsedImage.Manifest] validates the image // against instanceDigest if set, or, if not, a digest implied by src.Reference, if any. // // The UnparsedImage must not be used after the underlying ImageSource is Close()d. func UnparsedInstance(src types.ImageSource, instanceDigest *digest.Digest) *UnparsedImage { return image.UnparsedInstance(src, instanceDigest) } // unparsedWithRef wraps a private.UnparsedImage, claiming another replacementRef type unparsedWithRef struct { private.UnparsedImage ref types.ImageReference } func (uwr *unparsedWithRef) Reference() types.ImageReference { return uwr.ref } // UnparsedInstanceWithReference returns a types.UnparsedImage for wrappedInstance which claims to be a replacementRef. // This is useful for combining image data with other reference values, e.g. to check signatures on a locally-pulled image // based on a remote-registry policy. // // For the purposes of digest validation in [types.UnparsedImage.Manifest], what matters is the // reference originally used to create wrappedInstance, not replacementRef. func UnparsedInstanceWithReference(wrappedInstance types.UnparsedImage, replacementRef types.ImageReference) types.UnparsedImage { return &unparsedWithRef{ UnparsedImage: unparsedimage.FromPublic(wrappedInstance), ref: replacementRef, } } ================================================ FILE: vendor/go.podman.io/image/v5/internal/blobinfocache/blobinfocache.go ================================================ package blobinfocache import ( digest "github.com/opencontainers/go-digest" "go.podman.io/image/v5/types" ) // FromBlobInfoCache returns a BlobInfoCache2 based on a BlobInfoCache, returning the original // object if it implements BlobInfoCache2, or a wrapper which discards compression information // if it only implements BlobInfoCache. func FromBlobInfoCache(bic types.BlobInfoCache) BlobInfoCache2 { if bic2, ok := bic.(BlobInfoCache2); ok { return bic2 } return &v1OnlyBlobInfoCache{ BlobInfoCache: bic, } } type v1OnlyBlobInfoCache struct { types.BlobInfoCache } func (bic *v1OnlyBlobInfoCache) Open() { } func (bic *v1OnlyBlobInfoCache) Close() { } func (bic *v1OnlyBlobInfoCache) UncompressedDigestForTOC(tocDigest digest.Digest) digest.Digest { return "" } func (bic *v1OnlyBlobInfoCache) RecordTOCUncompressedPair(tocDigest digest.Digest, uncompressed digest.Digest) { } func (bic *v1OnlyBlobInfoCache) RecordDigestCompressorData(anyDigest digest.Digest, data DigestCompressorData) { } func (bic *v1OnlyBlobInfoCache) CandidateLocations2(transport types.ImageTransport, scope types.BICTransportScope, digest digest.Digest, options CandidateLocations2Options) []BICReplacementCandidate2 { return nil } // CandidateLocationsFromV2 converts a slice of BICReplacementCandidate2 to a slice of // types.BICReplacementCandidate, dropping compression information. func CandidateLocationsFromV2(v2candidates []BICReplacementCandidate2) []types.BICReplacementCandidate { candidates := make([]types.BICReplacementCandidate, 0, len(v2candidates)) for _, c := range v2candidates { candidates = append(candidates, types.BICReplacementCandidate{ Digest: c.Digest, Location: c.Location, }) } return candidates } ================================================ FILE: vendor/go.podman.io/image/v5/internal/blobinfocache/types.go ================================================ package blobinfocache import ( digest "github.com/opencontainers/go-digest" compressiontypes "go.podman.io/image/v5/pkg/compression/types" "go.podman.io/image/v5/types" ) const ( // Uncompressed is the value we store in a blob info cache to indicate that we know that // the blob in the corresponding location is not compressed. Uncompressed = "uncompressed" // UnknownCompression is the value we store in a blob info cache to indicate that we don't // know if the blob in the corresponding location is compressed (and if so, how) or not. UnknownCompression = "unknown" ) // BlobInfoCache2 extends BlobInfoCache by adding the ability to track information about what kind // of compression was applied to the blobs it keeps information about. type BlobInfoCache2 interface { types.BlobInfoCache // Open() sets up the cache for future accesses, potentially acquiring costly state. Each Open() must be paired with a Close(). // Note that public callers may call the types.BlobInfoCache operations without Open()/Close(). Open() // Close destroys state created by Open(). Close() // UncompressedDigestForTOC returns an uncompressed digest corresponding to anyDigest. // Returns "" if the uncompressed digest is unknown. UncompressedDigestForTOC(tocDigest digest.Digest) digest.Digest // RecordTOCUncompressedPair records that the tocDigest corresponds to uncompressed. // WARNING: Only call this for LOCALLY VERIFIED data; don’t record a digest pair just because some remote author claims so (e.g. // because a manifest/config pair exists); otherwise the cache could be poisoned and allow substituting unexpected blobs. // (Eventually, the DiffIDs in image config could detect the substitution, but that may be too late, and not all image formats contain that data.) RecordTOCUncompressedPair(tocDigest digest.Digest, uncompressed digest.Digest) // RecordDigestCompressorData records data for the blob with the specified digest. // WARNING: Only call this with LOCALLY VERIFIED data: // - don’t record a compressor for a digest just because some remote author claims so // (e.g. because a manifest says so); // - don’t record the non-base variant or annotations if we are not _sure_ that the base variant // and the blob’s digest match the non-base variant’s annotations (e.g. because we saw them // in a manifest) // otherwise the cache could be poisoned and cause us to make incorrect edits to type // information in a manifest. RecordDigestCompressorData(anyDigest digest.Digest, data DigestCompressorData) // CandidateLocations2 returns a prioritized, limited, number of blobs and their locations (if known) // that could possibly be reused within the specified (transport scope) (if they still // exist, which is not guaranteed). CandidateLocations2(transport types.ImageTransport, scope types.BICTransportScope, digest digest.Digest, options CandidateLocations2Options) []BICReplacementCandidate2 } // DigestCompressorData is information known about how a blob is compressed. // (This is worded generically, but basically targeted at the zstd / zstd:chunked situation.) type DigestCompressorData struct { BaseVariantCompressor string // A compressor’s base variant name, or Uncompressed or UnknownCompression. // The following fields are only valid if the base variant is neither Uncompressed nor UnknownCompression: SpecificVariantCompressor string // A non-base variant compressor (or UnknownCompression if the true format is just the base variant) SpecificVariantAnnotations map[string]string // Annotations required to benefit from the base variant. } // CandidateLocations2Options are used in CandidateLocations2. type CandidateLocations2Options struct { // If !CanSubstitute, the returned candidates will match the submitted digest exactly; if // CanSubstitute, data from previous RecordDigestUncompressedPair calls is used to also look // up variants of the blob which have the same uncompressed digest. CanSubstitute bool PossibleManifestFormats []string // If set, a set of possible manifest formats; at least one should support the reused layer RequiredCompression *compressiontypes.Algorithm // If set, only reuse layers with a matching algorithm } // BICReplacementCandidate2 is an item returned by BlobInfoCache2.CandidateLocations2. type BICReplacementCandidate2 struct { Digest digest.Digest CompressionOperation types.LayerCompression // Either types.Decompress for uncompressed, or types.Compress for compressed CompressionAlgorithm *compressiontypes.Algorithm // An algorithm when the candidate is compressed, or nil when it is uncompressed CompressionAnnotations map[string]string // If necessary, annotations necessary to use CompressionAlgorithm UnknownLocation bool // is true when `Location` for this blob is not set Location types.BICLocationReference // not set if UnknownLocation is set to `true` } ================================================ FILE: vendor/go.podman.io/image/v5/internal/digests/digests.go ================================================ // Package digests provides an internal representation of users’ digest use preferences. // // Something like this _might_ be eventually made available as a public API: // before doing so, carefully think whether the API should be modified before we commit to it. package digests import ( "errors" "fmt" "github.com/opencontainers/go-digest" ) // Options records users’ preferences for used digest algorithm usage. // It is a value type and can be copied using ordinary assignment. // // It can only be created using one of the provided constructors. type Options struct { initialized bool // To prevent uses that don’t call a public constructor; this is necessary to enforce the .Available() promise. // If any of the fields below is set, it is guaranteed to be .Available(). mustUse digest.Algorithm // If not "", written digests must use this algorithm. prefer digest.Algorithm // If not "", use this algorithm whenever possible. defaultAlgo digest.Algorithm // If not "", use this algorithm if there is no reason to use anything else. } // CanonicalDefault is Options which default to using digest.Canonical if there is no reason to use a different algorithm // (e.g. when there is no pre-existing digest). // // The configuration can be customized using .WithPreferred() or .WithDefault(). func CanonicalDefault() Options { // This does not set .defaultAlgo so that .WithDefault() can be called (once). return Options{ initialized: true, } } // MustUse constructs Options which always use algo. func MustUse(algo digest.Algorithm) (Options, error) { // We don’t provide Options.WithMustUse because there is no other option that makes a difference // once .mustUse is set. if !algo.Available() { return Options{}, fmt.Errorf("attempt to use an unavailable digest algorithm %q", algo.String()) } return Options{ initialized: true, mustUse: algo, }, nil } // WithPreferred returns a copy of o with a “preferred” algorithm set to algo. // The preferred algorithm is used whenever possible (but if there is a strict requirement to use something else, it will be overridden). func (o Options) WithPreferred(algo digest.Algorithm) (Options, error) { if err := o.ensureInitialized(); err != nil { return Options{}, err } if o.prefer != "" { return Options{}, errors.New("digests.Options already have a 'prefer' algorithm configured") } if !algo.Available() { return Options{}, fmt.Errorf("attempt to use an unavailable digest algorithm %q", algo.String()) } o.prefer = algo return o, nil } // WithDefault returns a copy of o with a “default” algorithm set to algo. // The default algorithm is used if there is no reason to use anything else (e.g. when there is no pre-existing digest). func (o Options) WithDefault(algo digest.Algorithm) (Options, error) { if err := o.ensureInitialized(); err != nil { return Options{}, err } if o.defaultAlgo != "" { return Options{}, errors.New("digests.Options already have a 'default' algorithm configured") } if !algo.Available() { return Options{}, fmt.Errorf("attempt to use an unavailable digest algorithm %q", algo.String()) } o.defaultAlgo = algo return o, nil } // ensureInitialized returns an error if o is not initialized. func (o Options) ensureInitialized() error { if !o.initialized { return errors.New("internal error: use of uninitialized digests.Options") } return nil } // Situation records the context in which a digest is being chosen. type Situation struct { Preexisting digest.Digest // If not "", a pre-existing digest value (frequently one which is cheaper to use than others) CannotChangeAlgorithmReason string // The reason why we must use Preexisting, or "" if we can use other algorithms. } // Choose chooses a digest algorithm based on the options and the situation. func (o Options) Choose(s Situation) (digest.Algorithm, error) { if err := o.ensureInitialized(); err != nil { return "", err } if s.CannotChangeAlgorithmReason != "" && s.Preexisting == "" { return "", fmt.Errorf("internal error: digests.Situation.CannotChangeAlgorithmReason is set but Preexisting is empty") } var choice digest.Algorithm // = what we want to use switch { case o.mustUse != "": choice = o.mustUse case s.CannotChangeAlgorithmReason != "": choice = s.Preexisting.Algorithm() if !choice.Available() { return "", fmt.Errorf("existing digest uses unimplemented algorithm %s", choice) } case o.prefer != "": choice = o.prefer case s.Preexisting != "" && s.Preexisting.Algorithm().Available(): choice = s.Preexisting.Algorithm() case o.defaultAlgo != "": choice = o.defaultAlgo default: choice = digest.Canonical // We assume digest.Canonical is always available. } if s.CannotChangeAlgorithmReason != "" && choice != s.Preexisting.Algorithm() { return "", fmt.Errorf("requested to always use digest algorithm %s but we cannot replace existing digest algorithm %s: %s", choice, s.Preexisting.Algorithm(), s.CannotChangeAlgorithmReason) } return choice, nil } // MustUseSet returns an algorithm if o is set to always use a specific algorithm, "" if it is flexible. func (o Options) MustUseSet() digest.Algorithm { // We don’t do .ensureInitialized() because that would require an extra error value just for that. // This should not be a part of any public API either way. if o.mustUse != "" { return o.mustUse } return "" } ================================================ FILE: vendor/go.podman.io/image/v5/internal/image/digest_validation.go ================================================ package image import ( "fmt" "github.com/opencontainers/go-digest" ) func validateBlobAgainstDigest(blob []byte, expectedDigest digest.Digest) error { if expectedDigest == "" { return fmt.Errorf("expected digest is empty") } err := expectedDigest.Validate() if err != nil { return fmt.Errorf("invalid digest format %q: %w", expectedDigest, err) } digestAlgorithm := expectedDigest.Algorithm() if !digestAlgorithm.Available() { return fmt.Errorf("unsupported digest algorithm: %s", digestAlgorithm) } computedDigest := digestAlgorithm.FromBytes(blob) if computedDigest != expectedDigest { return fmt.Errorf("blob digest %s does not match expected %s", computedDigest, expectedDigest) } return nil } ================================================ FILE: vendor/go.podman.io/image/v5/internal/image/docker_list.go ================================================ package image import ( "context" "fmt" "go.podman.io/image/v5/internal/manifest" "go.podman.io/image/v5/types" ) func manifestSchema2FromManifestList(ctx context.Context, sys *types.SystemContext, src types.ImageSource, manblob []byte) (genericManifest, error) { list, err := manifest.Schema2ListFromManifest(manblob) if err != nil { return nil, fmt.Errorf("parsing schema2 manifest list: %w", err) } targetManifestDigest, err := list.ChooseInstance(sys) if err != nil { return nil, fmt.Errorf("choosing image instance: %w", err) } manblob, mt, err := src.GetManifest(ctx, &targetManifestDigest) if err != nil { return nil, fmt.Errorf("fetching target platform image selected from manifest list: %w", err) } matches, err := manifest.MatchesDigest(manblob, targetManifestDigest) if err != nil { return nil, fmt.Errorf("computing manifest digest: %w", err) } if !matches { return nil, fmt.Errorf("Image manifest does not match selected manifest digest %s", targetManifestDigest) } return manifestInstanceFromBlob(ctx, sys, src, manblob, mt) } ================================================ FILE: vendor/go.podman.io/image/v5/internal/image/docker_schema1.go ================================================ package image import ( "context" "fmt" "github.com/opencontainers/go-digest" imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/manifest" "go.podman.io/image/v5/types" ) type manifestSchema1 struct { m *manifest.Schema1 } func manifestSchema1FromManifest(manifestBlob []byte) (genericManifest, error) { m, err := manifest.Schema1FromManifest(manifestBlob) if err != nil { return nil, err } return &manifestSchema1{m: m}, nil } // manifestSchema1FromComponents builds a new manifestSchema1 from the supplied data. func manifestSchema1FromComponents(ref reference.Named, fsLayers []manifest.Schema1FSLayers, history []manifest.Schema1History, architecture string) (genericManifest, error) { m, err := manifest.Schema1FromComponents(ref, fsLayers, history, architecture) if err != nil { return nil, err } return &manifestSchema1{m: m}, nil } func (m *manifestSchema1) serialize() ([]byte, error) { return m.m.Serialize() } func (m *manifestSchema1) manifestMIMEType() string { return manifest.DockerV2Schema1SignedMediaType } // ConfigInfo returns a complete BlobInfo for the separate config object, or a BlobInfo{Digest:""} if there isn't a separate object. // Note that the config object may not exist in the underlying storage in the return value of UpdatedImage! Use ConfigBlob() below. func (m *manifestSchema1) ConfigInfo() types.BlobInfo { return m.m.ConfigInfo() } // ConfigBlob returns the blob described by ConfigInfo, iff ConfigInfo().Digest != ""; nil otherwise. // The result is cached; it is OK to call this however often you need. func (m *manifestSchema1) ConfigBlob(context.Context) ([]byte, error) { return nil, nil } // OCIConfig returns the image configuration as per OCI v1 image-spec. Information about // layers in the resulting configuration isn't guaranteed to be returned to due how // old image manifests work (docker v2s1 especially). func (m *manifestSchema1) OCIConfig(ctx context.Context) (*imgspecv1.Image, error) { v2s2, err := m.convertToManifestSchema2(ctx, &types.ManifestUpdateOptions{}) if err != nil { return nil, err } return v2s2.OCIConfig(ctx) } // LayerInfos returns a list of BlobInfos of layers referenced by this image, in order (the root layer first, and then successive layered layers). // The Digest field is guaranteed to be provided; Size may be -1. // WARNING: The list may contain duplicates, and they are semantically relevant. func (m *manifestSchema1) LayerInfos() []types.BlobInfo { return manifestLayerInfosToBlobInfos(m.m.LayerInfos()) } // EmbeddedDockerReferenceConflicts whether a Docker reference embedded in the manifest, if any, conflicts with destination ref. // It returns false if the manifest does not embed a Docker reference. // (This embedding unfortunately happens for Docker schema1, please do not add support for this in any new formats.) func (m *manifestSchema1) EmbeddedDockerReferenceConflicts(ref reference.Named) bool { // This is a bit convoluted: We can’t just have a "get embedded docker reference" method // and have the “does it conflict” logic in the generic copy code, because the manifest does not actually // embed a full docker/distribution reference, but only the repo name and tag (without the host name). // So we would have to provide a “return repo without host name, and tag” getter for the generic code, // which would be very awkward. Instead, we do the matching here in schema1-specific code, and all the // generic copy code needs to know about is reference.Named and that a manifest may need updating // for some destinations. name := reference.Path(ref) var tag string if tagged, isTagged := ref.(reference.NamedTagged); isTagged { tag = tagged.Tag() } else { tag = "" } return m.m.Name != name || m.m.Tag != tag } // Inspect returns various information for (skopeo inspect) parsed from the manifest and configuration. func (m *manifestSchema1) Inspect(context.Context) (*types.ImageInspectInfo, error) { return m.m.Inspect(nil) } // UpdatedImageNeedsLayerDiffIDs returns true iff UpdatedImage(options) needs InformationOnly.LayerDiffIDs. // This is a horribly specific interface, but computing InformationOnly.LayerDiffIDs can be very expensive to compute // (most importantly it forces us to download the full layers even if they are already present at the destination). func (m *manifestSchema1) UpdatedImageNeedsLayerDiffIDs(options types.ManifestUpdateOptions) bool { return (options.ManifestMIMEType == manifest.DockerV2Schema2MediaType || options.ManifestMIMEType == imgspecv1.MediaTypeImageManifest) } // UpdatedImage returns a types.Image modified according to options. // This does not change the state of the original Image object. func (m *manifestSchema1) UpdatedImage(ctx context.Context, options types.ManifestUpdateOptions) (types.Image, error) { copy := manifestSchema1{m: manifest.Schema1Clone(m.m)} // We have 2 MIME types for schema 1, which are basically equivalent (even the un-"Signed" MIME type will be rejected if there isn’t a signature; so, // handle conversions between them by doing nothing. if options.ManifestMIMEType != manifest.DockerV2Schema1MediaType && options.ManifestMIMEType != manifest.DockerV2Schema1SignedMediaType { converted, err := convertManifestIfRequiredWithUpdate(ctx, options, map[string]manifestConvertFn{ imgspecv1.MediaTypeImageManifest: copy.convertToManifestOCI1, manifest.DockerV2Schema2MediaType: copy.convertToManifestSchema2Generic, }) if err != nil { return nil, err } if converted != nil { return converted, nil } } // No conversion required, update manifest if options.LayerInfos != nil { if err := copy.m.UpdateLayerInfos(options.LayerInfos); err != nil { return nil, err } } if options.EmbeddedDockerReference != nil { copy.m.Name = reference.Path(options.EmbeddedDockerReference) if tagged, isTagged := options.EmbeddedDockerReference.(reference.NamedTagged); isTagged { copy.m.Tag = tagged.Tag() } else { copy.m.Tag = "" } } return memoryImageFromManifest(©), nil } // convertToManifestSchema2Generic returns a genericManifest implementation converted to manifest.DockerV2Schema2MediaType. // It may use options.InformationOnly and also adjust *options to be appropriate for editing the returned // value. // This does not change the state of the original manifestSchema1 object. // // We need this function just because a function returning an implementation of the genericManifest // interface is not automatically assignable to a function type returning the genericManifest interface func (m *manifestSchema1) convertToManifestSchema2Generic(ctx context.Context, options *types.ManifestUpdateOptions) (genericManifest, error) { return m.convertToManifestSchema2(ctx, options) } // convertToManifestSchema2 returns a genericManifest implementation converted to manifest.DockerV2Schema2MediaType. // It may use options.InformationOnly and also adjust *options to be appropriate for editing the returned // value. // This does not change the state of the original manifestSchema1 object. // // Based on github.com/docker/docker/distribution/pull_v2.go func (m *manifestSchema1) convertToManifestSchema2(_ context.Context, options *types.ManifestUpdateOptions) (*manifestSchema2, error) { uploadedLayerInfos := options.InformationOnly.LayerInfos layerDiffIDs := options.InformationOnly.LayerDiffIDs if len(m.m.ExtractedV1Compatibility) == 0 { // What would this even mean?! Anyhow, the rest of the code depends on FSLayers[0] and ExtractedV1Compatibility[0] existing. return nil, fmt.Errorf("Cannot convert an image with 0 history entries to %s", manifest.DockerV2Schema2MediaType) } if len(m.m.ExtractedV1Compatibility) != len(m.m.FSLayers) { return nil, fmt.Errorf("Inconsistent schema 1 manifest: %d history entries, %d fsLayers entries", len(m.m.ExtractedV1Compatibility), len(m.m.FSLayers)) } if uploadedLayerInfos != nil && len(uploadedLayerInfos) != len(m.m.FSLayers) { return nil, fmt.Errorf("Internal error: uploaded %d blobs, but schema1 manifest has %d fsLayers", len(uploadedLayerInfos), len(m.m.FSLayers)) } if layerDiffIDs != nil && len(layerDiffIDs) != len(m.m.FSLayers) { return nil, fmt.Errorf("Internal error: collected %d DiffID values, but schema1 manifest has %d fsLayers", len(layerDiffIDs), len(m.m.FSLayers)) } var convertedLayerUpdates []types.BlobInfo // Only used if options.LayerInfos != nil if options.LayerInfos != nil { if len(options.LayerInfos) != len(m.m.FSLayers) { return nil, fmt.Errorf("Error converting image: layer edits for %d layers vs %d existing layers", len(options.LayerInfos), len(m.m.FSLayers)) } convertedLayerUpdates = []types.BlobInfo{} } // Build a list of the diffIDs for the non-empty layers. diffIDs := []digest.Digest{} var layers []manifest.Schema2Descriptor for v1Index := len(m.m.ExtractedV1Compatibility) - 1; v1Index >= 0; v1Index-- { v2Index := (len(m.m.ExtractedV1Compatibility) - 1) - v1Index if !m.m.ExtractedV1Compatibility[v1Index].ThrowAway { var size int64 if uploadedLayerInfos != nil { size = uploadedLayerInfos[v2Index].Size } var d digest.Digest if layerDiffIDs != nil { d = layerDiffIDs[v2Index] } layers = append(layers, manifest.Schema2Descriptor{ MediaType: manifest.DockerV2Schema2LayerMediaType, Size: size, Digest: m.m.FSLayers[v1Index].BlobSum, }) if options.LayerInfos != nil { convertedLayerUpdates = append(convertedLayerUpdates, options.LayerInfos[v2Index]) } diffIDs = append(diffIDs, d) } } configJSON, err := m.m.ToSchema2Config(diffIDs) if err != nil { return nil, err } configDescriptor := manifest.Schema2Descriptor{ MediaType: manifest.DockerV2Schema2ConfigMediaType, Size: int64(len(configJSON)), Digest: digest.FromBytes(configJSON), } if options.LayerInfos != nil { options.LayerInfos = convertedLayerUpdates } return manifestSchema2FromComponents(configDescriptor, nil, configJSON, layers), nil } // convertToManifestOCI1 returns a genericManifest implementation converted to imgspecv1.MediaTypeImageManifest. // It may use options.InformationOnly and also adjust *options to be appropriate for editing the returned // value. // This does not change the state of the original manifestSchema1 object. func (m *manifestSchema1) convertToManifestOCI1(ctx context.Context, options *types.ManifestUpdateOptions) (genericManifest, error) { // We can't directly convert to OCI, but we can transitively convert via a Docker V2.2 Distribution manifest m2, err := m.convertToManifestSchema2(ctx, options) if err != nil { return nil, err } return m2.convertToManifestOCI1(ctx, options) } // SupportsEncryption returns if encryption is supported for the manifest type func (m *manifestSchema1) SupportsEncryption(context.Context) bool { return false } // CanChangeLayerCompression returns true if we can compress/decompress layers with mimeType in the current image // (and the code can handle that). // NOTE: Even if this returns true, the relevant format might not accept all compression algorithms; the set of accepted // algorithms depends not on the current format, but possibly on the target of a conversion (if UpdatedImage converts // to a different manifest format). func (m *manifestSchema1) CanChangeLayerCompression(mimeType string) bool { return true // There are no MIME types in the manifest, so we must assume a valid image. } ================================================ FILE: vendor/go.podman.io/image/v5/internal/image/docker_schema2.go ================================================ package image import ( "bytes" "context" "crypto/sha256" "encoding/hex" "encoding/json" "errors" "fmt" "strings" "github.com/opencontainers/go-digest" imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" "github.com/sirupsen/logrus" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/internal/iolimits" "go.podman.io/image/v5/manifest" "go.podman.io/image/v5/pkg/blobinfocache/none" "go.podman.io/image/v5/types" ) // GzippedEmptyLayer is a gzip-compressed version of an empty tar file (1024 NULL bytes) // This comes from github.com/docker/distribution/manifest/schema1/config_builder.go; there is // a non-zero embedded timestamp; we could zero that, but that would just waste storage space // in registries, so let’s use the same values. // // This is publicly visible as c/image/image.GzippedEmptyLayer. var GzippedEmptyLayer = []byte{ 31, 139, 8, 0, 0, 9, 110, 136, 0, 255, 98, 24, 5, 163, 96, 20, 140, 88, 0, 8, 0, 0, 255, 255, 46, 175, 181, 239, 0, 4, 0, 0, } // GzippedEmptyLayerDigest is a digest of GzippedEmptyLayer // // This is publicly visible as c/image/image.GzippedEmptyLayerDigest. const GzippedEmptyLayerDigest = digest.Digest("sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4") type manifestSchema2 struct { src types.ImageSource // May be nil if configBlob is not nil configBlob []byte // If set, corresponds to contents of ConfigDescriptor. m *manifest.Schema2 } func manifestSchema2FromManifest(src types.ImageSource, manifestBlob []byte) (genericManifest, error) { m, err := manifest.Schema2FromManifest(manifestBlob) if err != nil { return nil, err } return &manifestSchema2{ src: src, m: m, }, nil } // manifestSchema2FromComponents builds a new manifestSchema2 from the supplied data: func manifestSchema2FromComponents(config manifest.Schema2Descriptor, src types.ImageSource, configBlob []byte, layers []manifest.Schema2Descriptor) *manifestSchema2 { return &manifestSchema2{ src: src, configBlob: configBlob, m: manifest.Schema2FromComponents(config, layers), } } func (m *manifestSchema2) serialize() ([]byte, error) { return m.m.Serialize() } func (m *manifestSchema2) manifestMIMEType() string { return m.m.MediaType } // ConfigInfo returns a complete BlobInfo for the separate config object, or a BlobInfo{Digest:""} if there isn't a separate object. // Note that the config object may not exist in the underlying storage in the return value of UpdatedImage! Use ConfigBlob() below. func (m *manifestSchema2) ConfigInfo() types.BlobInfo { return m.m.ConfigInfo() } // OCIConfig returns the image configuration as per OCI v1 image-spec. Information about // layers in the resulting configuration isn't guaranteed to be returned to due how // old image manifests work (docker v2s1 especially). func (m *manifestSchema2) OCIConfig(ctx context.Context) (*imgspecv1.Image, error) { configBlob, err := m.ConfigBlob(ctx) if err != nil { return nil, err } // docker v2s2 and OCI v1 are mostly compatible but v2s2 contains more fields // than OCI v1. This unmarshal makes sure we drop docker v2s2 // fields that aren't needed in OCI v1. configOCI := &imgspecv1.Image{} if err := json.Unmarshal(configBlob, configOCI); err != nil { return nil, err } return configOCI, nil } // ConfigBlob returns the blob described by ConfigInfo, iff ConfigInfo().Digest != ""; nil otherwise. // The result is cached; it is OK to call this however often you need. func (m *manifestSchema2) ConfigBlob(ctx context.Context) ([]byte, error) { if m.configBlob == nil { if m.src == nil { return nil, fmt.Errorf("Internal error: neither src nor configBlob set in manifestSchema2") } stream, _, err := m.src.GetBlob(ctx, manifest.BlobInfoFromSchema2Descriptor(m.m.ConfigDescriptor), none.NoCache) if err != nil { return nil, err } defer stream.Close() blob, err := iolimits.ReadAtMost(stream, iolimits.MaxConfigBodySize) if err != nil { return nil, err } if err := validateBlobAgainstDigest(blob, m.m.ConfigDescriptor.Digest); err != nil { return nil, fmt.Errorf("config validation failed: %w", err) } m.configBlob = blob } return m.configBlob, nil } // LayerInfos returns a list of BlobInfos of layers referenced by this image, in order (the root layer first, and then successive layered layers). // The Digest field is guaranteed to be provided; Size may be -1. // WARNING: The list may contain duplicates, and they are semantically relevant. func (m *manifestSchema2) LayerInfos() []types.BlobInfo { return manifestLayerInfosToBlobInfos(m.m.LayerInfos()) } // EmbeddedDockerReferenceConflicts whether a Docker reference embedded in the manifest, if any, conflicts with destination ref. // It returns false if the manifest does not embed a Docker reference. // (This embedding unfortunately happens for Docker schema1, please do not add support for this in any new formats.) func (m *manifestSchema2) EmbeddedDockerReferenceConflicts(ref reference.Named) bool { return false } // Inspect returns various information for (skopeo inspect) parsed from the manifest and configuration. func (m *manifestSchema2) Inspect(ctx context.Context) (*types.ImageInspectInfo, error) { getter := func(info types.BlobInfo) ([]byte, error) { if info.Digest != m.ConfigInfo().Digest { // Shouldn't ever happen return nil, errors.New("asked for a different config blob") } config, err := m.ConfigBlob(ctx) if err != nil { return nil, err } return config, nil } return m.m.Inspect(getter) } // UpdatedImageNeedsLayerDiffIDs returns true iff UpdatedImage(options) needs InformationOnly.LayerDiffIDs. // This is a horribly specific interface, but computing InformationOnly.LayerDiffIDs can be very expensive to compute // (most importantly it forces us to download the full layers even if they are already present at the destination). func (m *manifestSchema2) UpdatedImageNeedsLayerDiffIDs(options types.ManifestUpdateOptions) bool { return false } // UpdatedImage returns a types.Image modified according to options. // This does not change the state of the original Image object. // The returned error will be a manifest.ManifestLayerCompressionIncompatibilityError // if the CompressionOperation and CompressionAlgorithm specified in one or more // options.LayerInfos items is anything other than gzip. func (m *manifestSchema2) UpdatedImage(ctx context.Context, options types.ManifestUpdateOptions) (types.Image, error) { copy := manifestSchema2{ // NOTE: This is not a deep copy, it still shares slices etc. src: m.src, configBlob: m.configBlob, m: manifest.Schema2Clone(m.m), } converted, err := convertManifestIfRequiredWithUpdate(ctx, options, map[string]manifestConvertFn{ manifest.DockerV2Schema1MediaType: copy.convertToManifestSchema1, manifest.DockerV2Schema1SignedMediaType: copy.convertToManifestSchema1, imgspecv1.MediaTypeImageManifest: copy.convertToManifestOCI1, }) if err != nil { return nil, err } if converted != nil { return converted, nil } // No conversion required, update manifest if options.LayerInfos != nil { if err := copy.m.UpdateLayerInfos(options.LayerInfos); err != nil { return nil, err } } // Ignore options.EmbeddedDockerReference: it may be set when converting from schema1 to schema2, but we really don't care. return memoryImageFromManifest(©), nil } func oci1DescriptorFromSchema2Descriptor(d manifest.Schema2Descriptor) imgspecv1.Descriptor { return imgspecv1.Descriptor{ MediaType: d.MediaType, Size: d.Size, Digest: d.Digest, URLs: d.URLs, } } // convertToManifestOCI1 returns a genericManifest implementation converted to imgspecv1.MediaTypeImageManifest. // It may use options.InformationOnly and also adjust *options to be appropriate for editing the returned // value. // This does not change the state of the original manifestSchema2 object. func (m *manifestSchema2) convertToManifestOCI1(ctx context.Context, _ *types.ManifestUpdateOptions) (genericManifest, error) { configOCI, err := m.OCIConfig(ctx) if err != nil { return nil, err } configOCIBytes, err := json.Marshal(configOCI) if err != nil { return nil, err } config := imgspecv1.Descriptor{ MediaType: imgspecv1.MediaTypeImageConfig, Size: int64(len(configOCIBytes)), Digest: digest.FromBytes(configOCIBytes), } layers := make([]imgspecv1.Descriptor, len(m.m.LayersDescriptors)) for idx := range layers { layers[idx] = oci1DescriptorFromSchema2Descriptor(m.m.LayersDescriptors[idx]) switch m.m.LayersDescriptors[idx].MediaType { case manifest.DockerV2Schema2ForeignLayerMediaType: layers[idx].MediaType = imgspecv1.MediaTypeImageLayerNonDistributable //nolint:staticcheck // NonDistributable layers are deprecated, but we want to continue to support manipulating pre-existing images. case manifest.DockerV2Schema2ForeignLayerMediaTypeGzip: layers[idx].MediaType = imgspecv1.MediaTypeImageLayerNonDistributableGzip //nolint:staticcheck // NonDistributable layers are deprecated, but we want to continue to support manipulating pre-existing images. case manifest.DockerV2SchemaLayerMediaTypeUncompressed: layers[idx].MediaType = imgspecv1.MediaTypeImageLayer case manifest.DockerV2Schema2LayerMediaType: layers[idx].MediaType = imgspecv1.MediaTypeImageLayerGzip case manifest.DockerV2SchemaLayerMediaTypeZstd: layers[idx].MediaType = imgspecv1.MediaTypeImageLayerZstd default: return nil, fmt.Errorf("Unknown media type during manifest conversion: %q", m.m.LayersDescriptors[idx].MediaType) } } return manifestOCI1FromComponents(config, m.src, configOCIBytes, layers), nil } // convertToManifestSchema1 returns a genericManifest implementation converted to manifest.DockerV2Schema1{Signed,}MediaType. // It may use options.InformationOnly and also adjust *options to be appropriate for editing the returned // value. // This does not change the state of the original manifestSchema2 object. // // Based on docker/distribution/manifest/schema1/config_builder.go func (m *manifestSchema2) convertToManifestSchema1(ctx context.Context, options *types.ManifestUpdateOptions) (genericManifest, error) { dest := options.InformationOnly.Destination var convertedLayerUpdates []types.BlobInfo // Only used if options.LayerInfos != nil if options.LayerInfos != nil { if len(options.LayerInfos) != len(m.m.LayersDescriptors) { return nil, fmt.Errorf("Error converting image: layer edits for %d layers vs %d existing layers", len(options.LayerInfos), len(m.m.LayersDescriptors)) } convertedLayerUpdates = []types.BlobInfo{} } configBytes, err := m.ConfigBlob(ctx) if err != nil { return nil, err } imageConfig := &manifest.Schema2Image{} if err := json.Unmarshal(configBytes, imageConfig); err != nil { return nil, err } // Build fsLayers and History, discarding all configs. We will patch the top-level config in later. fsLayers := make([]manifest.Schema1FSLayers, len(imageConfig.History)) history := make([]manifest.Schema1History, len(imageConfig.History)) nonemptyLayerIndex := 0 var parentV1ID string // Set in the loop v1ID := "" haveGzippedEmptyLayer := false if len(imageConfig.History) == 0 { // What would this even mean?! Anyhow, the rest of the code depends on fsLayers[0] and history[0] existing. return nil, fmt.Errorf("Cannot convert an image with 0 history entries to %s", manifest.DockerV2Schema1SignedMediaType) } for v2Index, historyEntry := range imageConfig.History { parentV1ID = v1ID v1Index := len(imageConfig.History) - 1 - v2Index var blobDigest digest.Digest if historyEntry.EmptyLayer { emptyLayerBlobInfo := types.BlobInfo{Digest: GzippedEmptyLayerDigest, Size: int64(len(GzippedEmptyLayer))} if !haveGzippedEmptyLayer { logrus.Debugf("Uploading empty layer during conversion to schema 1") // Ideally we should update the relevant BlobInfoCache about this layer, but that would require passing it down here, // and anyway this blob is so small that it’s easier to just copy it than to worry about figuring out another location where to get it. info, err := dest.PutBlob(ctx, bytes.NewReader(GzippedEmptyLayer), emptyLayerBlobInfo, none.NoCache, false) if err != nil { return nil, fmt.Errorf("uploading empty layer: %w", err) } if info.Digest != emptyLayerBlobInfo.Digest { return nil, fmt.Errorf("Internal error: Uploaded empty layer has digest %#v instead of %s", info.Digest, emptyLayerBlobInfo.Digest) } haveGzippedEmptyLayer = true } if options.LayerInfos != nil { convertedLayerUpdates = append(convertedLayerUpdates, emptyLayerBlobInfo) } blobDigest = emptyLayerBlobInfo.Digest } else { if nonemptyLayerIndex >= len(m.m.LayersDescriptors) { return nil, fmt.Errorf("Invalid image configuration, needs more than the %d distributed layers", len(m.m.LayersDescriptors)) } if options.LayerInfos != nil { convertedLayerUpdates = append(convertedLayerUpdates, options.LayerInfos[nonemptyLayerIndex]) } blobDigest = m.m.LayersDescriptors[nonemptyLayerIndex].Digest nonemptyLayerIndex++ } // AFAICT pull ignores these ID values, at least nowadays, so we could use anything unique, including a simple counter. Use what Docker uses for cargo-cult consistency. v, err := v1IDFromBlobDigestAndComponents(blobDigest, parentV1ID) if err != nil { return nil, err } v1ID = v fakeImage := manifest.Schema1V1Compatibility{ ID: v1ID, Parent: parentV1ID, Comment: historyEntry.Comment, Created: historyEntry.Created, Author: historyEntry.Author, ThrowAway: historyEntry.EmptyLayer, } fakeImage.ContainerConfig.Cmd = []string{historyEntry.CreatedBy} v1CompatibilityBytes, err := json.Marshal(&fakeImage) if err != nil { return nil, fmt.Errorf("Internal error: Error creating v1compatibility for %#v", fakeImage) } fsLayers[v1Index] = manifest.Schema1FSLayers{BlobSum: blobDigest} history[v1Index] = manifest.Schema1History{V1Compatibility: string(v1CompatibilityBytes)} // Note that parentV1ID of the top layer is preserved when exiting this loop } // Now patch in real configuration for the top layer (v1Index == 0) v1ID, err = v1IDFromBlobDigestAndComponents(fsLayers[0].BlobSum, parentV1ID, string(configBytes)) // See above WRT v1ID value generation and cargo-cult consistency. if err != nil { return nil, err } v1Config, err := v1ConfigFromConfigJSON(configBytes, v1ID, parentV1ID, imageConfig.History[len(imageConfig.History)-1].EmptyLayer) if err != nil { return nil, err } history[0].V1Compatibility = string(v1Config) if options.LayerInfos != nil { options.LayerInfos = convertedLayerUpdates } m1, err := manifestSchema1FromComponents(dest.Reference().DockerReference(), fsLayers, history, imageConfig.Architecture) if err != nil { return nil, err // This should never happen, we should have created all the components correctly. } return m1, nil } func v1IDFromBlobDigestAndComponents(blobDigest digest.Digest, others ...string) (string, error) { if err := blobDigest.Validate(); err != nil { return "", err } parts := append([]string{blobDigest.Encoded()}, others...) v1IDHash := sha256.Sum256([]byte(strings.Join(parts, " "))) return hex.EncodeToString(v1IDHash[:]), nil } func v1ConfigFromConfigJSON(configJSON []byte, v1ID, parentV1ID string, throwaway bool) ([]byte, error) { // Preserve everything we don't specifically know about. // (This must be a *json.RawMessage, even though *[]byte is fairly redundant, because only *RawMessage implements json.Marshaler.) rawContents := map[string]*json.RawMessage{} if err := json.Unmarshal(configJSON, &rawContents); err != nil { // We have already unmarshaled it before, using a more detailed schema?! return nil, err } delete(rawContents, "rootfs") delete(rawContents, "history") updates := map[string]any{"id": v1ID} if parentV1ID != "" { updates["parent"] = parentV1ID } if throwaway { updates["throwaway"] = throwaway } for field, value := range updates { encoded, err := json.Marshal(value) if err != nil { return nil, err } rawContents[field] = (*json.RawMessage)(&encoded) } return json.Marshal(rawContents) } // SupportsEncryption returns if encryption is supported for the manifest type func (m *manifestSchema2) SupportsEncryption(context.Context) bool { return false } // CanChangeLayerCompression returns true if we can compress/decompress layers with mimeType in the current image // (and the code can handle that). // NOTE: Even if this returns true, the relevant format might not accept all compression algorithms; the set of accepted // algorithms depends not on the current format, but possibly on the target of a conversion (if UpdatedImage converts // to a different manifest format). func (m *manifestSchema2) CanChangeLayerCompression(mimeType string) bool { return m.m.CanChangeLayerCompression(mimeType) } ================================================ FILE: vendor/go.podman.io/image/v5/internal/image/manifest.go ================================================ package image import ( "context" "fmt" imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/manifest" "go.podman.io/image/v5/types" ) // genericManifest is an interface for parsing, modifying image manifests and related data. // The public methods are related to types.Image so that embedding a genericManifest implements most of it, // but there are also public methods that are only visible by packages that can import c/image/internal/image. type genericManifest interface { serialize() ([]byte, error) manifestMIMEType() string // ConfigInfo returns a complete BlobInfo for the separate config object, or a BlobInfo{Digest:""} if there isn't a separate object. // Note that the config object may not exist in the underlying storage in the return value of UpdatedImage! Use ConfigBlob() below. ConfigInfo() types.BlobInfo // ConfigBlob returns the blob described by ConfigInfo, iff ConfigInfo().Digest != ""; nil otherwise. // The result is cached; it is OK to call this however often you need. ConfigBlob(context.Context) ([]byte, error) // OCIConfig returns the image configuration as per OCI v1 image-spec. Information about // layers in the resulting configuration isn't guaranteed to be returned to due how // old image manifests work (docker v2s1 especially). OCIConfig(context.Context) (*imgspecv1.Image, error) // LayerInfos returns a list of BlobInfos of layers referenced by this image, in order (the root layer first, and then successive layered layers). // The Digest field is guaranteed to be provided; Size may be -1. // WARNING: The list may contain duplicates, and they are semantically relevant. LayerInfos() []types.BlobInfo // EmbeddedDockerReferenceConflicts whether a Docker reference embedded in the manifest, if any, conflicts with destination ref. // It returns false if the manifest does not embed a Docker reference. // (This embedding unfortunately happens for Docker schema1, please do not add support for this in any new formats.) EmbeddedDockerReferenceConflicts(ref reference.Named) bool // Inspect returns various information for (skopeo inspect) parsed from the manifest and configuration. Inspect(context.Context) (*types.ImageInspectInfo, error) // UpdatedImageNeedsLayerDiffIDs returns true iff UpdatedImage(options) needs InformationOnly.LayerDiffIDs. // This is a horribly specific interface, but computing InformationOnly.LayerDiffIDs can be very expensive to compute // (most importantly it forces us to download the full layers even if they are already present at the destination). UpdatedImageNeedsLayerDiffIDs(options types.ManifestUpdateOptions) bool // UpdatedImage returns a types.Image modified according to options. // This does not change the state of the original Image object. UpdatedImage(ctx context.Context, options types.ManifestUpdateOptions) (types.Image, error) // SupportsEncryption returns if encryption is supported for the manifest type // // Deprecated: Initially used to determine if a manifest can be copied from a source manifest type since // the process of updating a manifest between different manifest types was to update then convert. // This resulted in some fields in the update being lost. This has been fixed by: https://github.com/containers/image/pull/836 SupportsEncryption(ctx context.Context) bool // The following methods are not a part of types.Image: // === // CanChangeLayerCompression returns true if we can compress/decompress layers with mimeType in the current image // (and the code can handle that). // NOTE: Even if this returns true, the relevant format might not accept all compression algorithms; the set of accepted // algorithms depends not on the current format, but possibly on the target of a conversion (if UpdatedImage converts // to a different manifest format). CanChangeLayerCompression(mimeType string) bool } // manifestInstanceFromBlob returns a genericManifest implementation for (manblob, mt) in src. // If manblob is a manifest list, it implicitly chooses an appropriate image from the list. func manifestInstanceFromBlob(ctx context.Context, sys *types.SystemContext, src types.ImageSource, manblob []byte, mt string) (genericManifest, error) { switch manifest.NormalizedMIMEType(mt) { case manifest.DockerV2Schema1MediaType, manifest.DockerV2Schema1SignedMediaType: return manifestSchema1FromManifest(manblob) case imgspecv1.MediaTypeImageManifest: return manifestOCI1FromManifest(src, manblob) case manifest.DockerV2Schema2MediaType: return manifestSchema2FromManifest(src, manblob) case manifest.DockerV2ListMediaType: return manifestSchema2FromManifestList(ctx, sys, src, manblob) case imgspecv1.MediaTypeImageIndex: return manifestOCI1FromImageIndex(ctx, sys, src, manblob) default: // Note that this may not be reachable, manifest.NormalizedMIMEType has a default for unknown values. return nil, fmt.Errorf("Unimplemented manifest MIME type %q", mt) } } // manifestLayerInfosToBlobInfos extracts a []types.BlobInfo from a []manifest.LayerInfo. func manifestLayerInfosToBlobInfos(layers []manifest.LayerInfo) []types.BlobInfo { blobs := make([]types.BlobInfo, len(layers)) for i, layer := range layers { blobs[i] = layer.BlobInfo } return blobs } // manifestConvertFn (a method of genericManifest object) returns a genericManifest implementation // converted to a specific manifest MIME type. // It may use options.InformationOnly and also adjust *options to be appropriate for editing the returned // value. // This does not change the state of the original genericManifest object. type manifestConvertFn func(ctx context.Context, options *types.ManifestUpdateOptions) (genericManifest, error) // convertManifestIfRequiredWithUpdate will run conversion functions of a manifest if // required and re-apply the options to the converted type. // It returns (nil, nil) if no conversion was requested. func convertManifestIfRequiredWithUpdate(ctx context.Context, options types.ManifestUpdateOptions, converters map[string]manifestConvertFn) (types.Image, error) { if options.ManifestMIMEType == "" { return nil, nil } converter, ok := converters[options.ManifestMIMEType] if !ok { return nil, fmt.Errorf("Unsupported conversion type: %v", options.ManifestMIMEType) } optionsCopy := options convertedManifest, err := converter(ctx, &optionsCopy) if err != nil { return nil, err } convertedImage := memoryImageFromManifest(convertedManifest) optionsCopy.ManifestMIMEType = "" return convertedImage.UpdatedImage(ctx, optionsCopy) } ================================================ FILE: vendor/go.podman.io/image/v5/internal/image/memory.go ================================================ package image import ( "context" "errors" "go.podman.io/image/v5/types" ) // memoryImage is a mostly-implementation of types.Image assembled from data // created in memory, used primarily as a return value of types.Image.UpdatedImage // as a way to carry various structured information in a type-safe and easy-to-use way. // Note that this _only_ carries the immediate metadata; it is _not_ a stand-alone // collection of all related information, e.g. there is no way to get layer blobs // from a memoryImage. type memoryImage struct { genericManifest serializedManifest []byte // A private cache for Manifest() } func memoryImageFromManifest(m genericManifest) types.Image { return &memoryImage{ genericManifest: m, serializedManifest: nil, } } // Reference returns the reference used to set up this source, _as specified by the user_ // (not as the image itself, or its underlying storage, claims). This can be used e.g. to determine which public keys are trusted for this image. func (i *memoryImage) Reference() types.ImageReference { // It would really be inappropriate to return the ImageReference of the image this was based on. return nil } // Size returns the size of the image as stored, if known, or -1 if not. func (i *memoryImage) Size() (int64, error) { return -1, nil } // Manifest is like ImageSource.GetManifest, but the result is cached; it is OK to call this however often you need. func (i *memoryImage) Manifest(ctx context.Context) ([]byte, string, error) { if i.serializedManifest == nil { m, err := i.genericManifest.serialize() if err != nil { return nil, "", err } i.serializedManifest = m } return i.serializedManifest, i.genericManifest.manifestMIMEType(), nil } // Signatures is like ImageSource.GetSignatures, but the result is cached; it is OK to call this however often you need. func (i *memoryImage) Signatures(ctx context.Context) ([][]byte, error) { // Modifying an image invalidates signatures; a caller asking the updated image for signatures // is probably confused. return nil, errors.New("Internal error: Image.Signatures() is not supported for images modified in memory") } // LayerInfosForCopy returns an updated set of layer blob information which may not match the manifest. // The Digest field is guaranteed to be provided; Size may be -1. // WARNING: The list may contain duplicates, and they are semantically relevant. func (i *memoryImage) LayerInfosForCopy(ctx context.Context) ([]types.BlobInfo, error) { return nil, nil } ================================================ FILE: vendor/go.podman.io/image/v5/internal/image/oci.go ================================================ package image import ( "context" "encoding/json" "errors" "fmt" "slices" ociencspec "github.com/containers/ocicrypt/spec" imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/internal/iolimits" internalManifest "go.podman.io/image/v5/internal/manifest" "go.podman.io/image/v5/manifest" "go.podman.io/image/v5/pkg/blobinfocache/none" "go.podman.io/image/v5/types" ) type manifestOCI1 struct { src types.ImageSource // May be nil if configBlob is not nil configBlob []byte // If set, corresponds to contents of m.Config. m *manifest.OCI1 } func manifestOCI1FromManifest(src types.ImageSource, manifestBlob []byte) (genericManifest, error) { m, err := manifest.OCI1FromManifest(manifestBlob) if err != nil { return nil, err } return &manifestOCI1{ src: src, m: m, }, nil } // manifestOCI1FromComponents builds a new manifestOCI1 from the supplied data: func manifestOCI1FromComponents(config imgspecv1.Descriptor, src types.ImageSource, configBlob []byte, layers []imgspecv1.Descriptor) genericManifest { return &manifestOCI1{ src: src, configBlob: configBlob, m: manifest.OCI1FromComponents(config, layers), } } func (m *manifestOCI1) serialize() ([]byte, error) { return m.m.Serialize() } func (m *manifestOCI1) manifestMIMEType() string { return imgspecv1.MediaTypeImageManifest } // ConfigInfo returns a complete BlobInfo for the separate config object, or a BlobInfo{Digest:""} if there isn't a separate object. // Note that the config object may not exist in the underlying storage in the return value of UpdatedImage! Use ConfigBlob() below. func (m *manifestOCI1) ConfigInfo() types.BlobInfo { return m.m.ConfigInfo() } // ConfigBlob returns the blob described by ConfigInfo, iff ConfigInfo().Digest != ""; nil otherwise. // The result is cached; it is OK to call this however often you need. func (m *manifestOCI1) ConfigBlob(ctx context.Context) ([]byte, error) { if m.configBlob == nil { if m.src == nil { return nil, errors.New("Internal error: neither src nor configBlob set in manifestOCI1") } stream, _, err := m.src.GetBlob(ctx, manifest.BlobInfoFromOCI1Descriptor(m.m.Config), none.NoCache) if err != nil { return nil, err } defer stream.Close() blob, err := iolimits.ReadAtMost(stream, iolimits.MaxConfigBodySize) if err != nil { return nil, err } if err := validateBlobAgainstDigest(blob, m.m.Config.Digest); err != nil { return nil, fmt.Errorf("config validation failed: %w", err) } m.configBlob = blob } return m.configBlob, nil } // OCIConfig returns the image configuration as per OCI v1 image-spec. Information about // layers in the resulting configuration isn't guaranteed to be returned to due how // old image manifests work (docker v2s1 especially). func (m *manifestOCI1) OCIConfig(ctx context.Context) (*imgspecv1.Image, error) { if m.m.Config.MediaType != imgspecv1.MediaTypeImageConfig { return nil, internalManifest.NewNonImageArtifactError(&m.m.Manifest) } cb, err := m.ConfigBlob(ctx) if err != nil { return nil, err } configOCI := &imgspecv1.Image{} if err := json.Unmarshal(cb, configOCI); err != nil { return nil, err } return configOCI, nil } // LayerInfos returns a list of BlobInfos of layers referenced by this image, in order (the root layer first, and then successive layered layers). // The Digest field is guaranteed to be provided; Size may be -1. // WARNING: The list may contain duplicates, and they are semantically relevant. func (m *manifestOCI1) LayerInfos() []types.BlobInfo { return manifestLayerInfosToBlobInfos(m.m.LayerInfos()) } // EmbeddedDockerReferenceConflicts whether a Docker reference embedded in the manifest, if any, conflicts with destination ref. // It returns false if the manifest does not embed a Docker reference. // (This embedding unfortunately happens for Docker schema1, please do not add support for this in any new formats.) func (m *manifestOCI1) EmbeddedDockerReferenceConflicts(ref reference.Named) bool { return false } // Inspect returns various information for (skopeo inspect) parsed from the manifest and configuration. func (m *manifestOCI1) Inspect(ctx context.Context) (*types.ImageInspectInfo, error) { getter := func(info types.BlobInfo) ([]byte, error) { if info.Digest != m.ConfigInfo().Digest { // Shouldn't ever happen return nil, errors.New("asked for a different config blob") } config, err := m.ConfigBlob(ctx) if err != nil { return nil, err } return config, nil } return m.m.Inspect(getter) } // UpdatedImageNeedsLayerDiffIDs returns true iff UpdatedImage(options) needs InformationOnly.LayerDiffIDs. // This is a horribly specific interface, but computing InformationOnly.LayerDiffIDs can be very expensive to compute // (most importantly it forces us to download the full layers even if they are already present at the destination). func (m *manifestOCI1) UpdatedImageNeedsLayerDiffIDs(options types.ManifestUpdateOptions) bool { return false } // UpdatedImage returns a types.Image modified according to options. // This does not change the state of the original Image object. // The returned error will be a manifest.ManifestLayerCompressionIncompatibilityError // if the combination of CompressionOperation and CompressionAlgorithm specified // in one or more options.LayerInfos items indicates that a layer is compressed using // an algorithm that is not allowed in OCI. func (m *manifestOCI1) UpdatedImage(ctx context.Context, options types.ManifestUpdateOptions) (types.Image, error) { copy := manifestOCI1{ // NOTE: This is not a deep copy, it still shares slices etc. src: m.src, configBlob: m.configBlob, m: manifest.OCI1Clone(m.m), } converted, err := convertManifestIfRequiredWithUpdate(ctx, options, map[string]manifestConvertFn{ manifest.DockerV2Schema2MediaType: copy.convertToManifestSchema2Generic, manifest.DockerV2Schema1MediaType: copy.convertToManifestSchema1, manifest.DockerV2Schema1SignedMediaType: copy.convertToManifestSchema1, }) if err != nil { return nil, err } if converted != nil { return converted, nil } // No conversion required, update manifest if options.LayerInfos != nil { if err := copy.m.UpdateLayerInfos(options.LayerInfos); err != nil { return nil, err } } // Ignore options.EmbeddedDockerReference: it may be set when converting from schema1, but we really don't care. return memoryImageFromManifest(©), nil } func schema2DescriptorFromOCI1Descriptor(d imgspecv1.Descriptor) manifest.Schema2Descriptor { return manifest.Schema2Descriptor{ MediaType: d.MediaType, Size: d.Size, Digest: d.Digest, URLs: d.URLs, } } // convertToManifestSchema2Generic returns a genericManifest implementation converted to manifest.DockerV2Schema2MediaType. // It may use options.InformationOnly and also adjust *options to be appropriate for editing the returned // value. // This does not change the state of the original manifestSchema1 object. // // We need this function just because a function returning an implementation of the genericManifest // interface is not automatically assignable to a function type returning the genericManifest interface func (m *manifestOCI1) convertToManifestSchema2Generic(ctx context.Context, options *types.ManifestUpdateOptions) (genericManifest, error) { return m.convertToManifestSchema2(ctx, options) } // layerEditsOfOCIOnlyFeatures checks if options requires some layer edits to be done before converting to a Docker format. // If not, it returns (nil, nil). // If decryption is required, it returns a set of edits to provide to OCI1.UpdateLayerInfos, // and edits *options to not try decryption again. func (m *manifestOCI1) layerEditsOfOCIOnlyFeatures(options *types.ManifestUpdateOptions) ([]types.BlobInfo, error) { if options == nil || options.LayerInfos == nil { return nil, nil } originalInfos := m.LayerInfos() if len(originalInfos) != len(options.LayerInfos) { return nil, fmt.Errorf("preparing to decrypt before conversion: %d layers vs. %d layer edits", len(originalInfos), len(options.LayerInfos)) } ociOnlyEdits := slices.Clone(originalInfos) // Start with a full copy so that we don't forget to copy anything: use the current data in full unless we intentionally deviate. laterEdits := slices.Clone(options.LayerInfos) needsOCIOnlyEdits := false for i, edit := range options.LayerInfos { // Unless determined otherwise, don't do any compression-related MIME type conversions. m.LayerInfos() should not set these edit instructions, but be explicit. ociOnlyEdits[i].CompressionOperation = types.PreserveOriginal ociOnlyEdits[i].CompressionAlgorithm = nil if edit.CryptoOperation == types.Decrypt { needsOCIOnlyEdits = true // Encrypted types must be removed before conversion because they can’t be represented in Docker schemas ociOnlyEdits[i].CryptoOperation = types.Decrypt laterEdits[i].CryptoOperation = types.PreserveOriginalCrypto // Don't try to decrypt in a schema[12] manifest later, that would fail. } if originalInfos[i].MediaType == imgspecv1.MediaTypeImageLayerZstd || originalInfos[i].MediaType == imgspecv1.MediaTypeImageLayerNonDistributableZstd { //nolint:staticcheck // NonDistributable layers are deprecated, but we want to continue to support manipulating pre-existing images. needsOCIOnlyEdits = true // Zstd MIME types must be removed before conversion because they can’t be represented in Docker schemas. ociOnlyEdits[i].CompressionOperation = edit.CompressionOperation ociOnlyEdits[i].CompressionAlgorithm = edit.CompressionAlgorithm laterEdits[i].CompressionOperation = types.PreserveOriginal laterEdits[i].CompressionAlgorithm = nil } } if !needsOCIOnlyEdits { return nil, nil } options.LayerInfos = laterEdits return ociOnlyEdits, nil } // convertToManifestSchema2 returns a genericManifest implementation converted to manifest.DockerV2Schema2MediaType. // It may use options.InformationOnly and also adjust *options to be appropriate for editing the returned // value. // This does not change the state of the original manifestOCI1 object. func (m *manifestOCI1) convertToManifestSchema2(_ context.Context, options *types.ManifestUpdateOptions) (*manifestSchema2, error) { if m.m.Config.MediaType != imgspecv1.MediaTypeImageConfig { return nil, internalManifest.NewNonImageArtifactError(&m.m.Manifest) } // Mostly we first make a format conversion, and _afterwards_ do layer edits. But first we need to do the layer edits // which remove OCI-specific features, because trying to convert those layers would fail. // So, do the layer updates for decryption, and for conversions from Zstd. ociManifest := m.m ociOnlyEdits, err := m.layerEditsOfOCIOnlyFeatures(options) if err != nil { return nil, err } if ociOnlyEdits != nil { ociManifest = manifest.OCI1Clone(ociManifest) if err := ociManifest.UpdateLayerInfos(ociOnlyEdits); err != nil { return nil, err } } // Create a copy of the descriptor. config := schema2DescriptorFromOCI1Descriptor(ociManifest.Config) // Above, we have already checked that this manifest refers to an image, not an OCI artifact, // so the only difference between OCI and DockerSchema2 is the mediatypes. The // media type of the manifest is handled by manifestSchema2FromComponents. config.MediaType = manifest.DockerV2Schema2ConfigMediaType layers := make([]manifest.Schema2Descriptor, len(ociManifest.Layers)) for idx := range layers { layers[idx] = schema2DescriptorFromOCI1Descriptor(ociManifest.Layers[idx]) switch layers[idx].MediaType { case imgspecv1.MediaTypeImageLayerNonDistributable: //nolint:staticcheck // NonDistributable layers are deprecated, but we want to continue to support manipulating pre-existing images. layers[idx].MediaType = manifest.DockerV2Schema2ForeignLayerMediaType case imgspecv1.MediaTypeImageLayerNonDistributableGzip: //nolint:staticcheck // NonDistributable layers are deprecated, but we want to continue to support manipulating pre-existing images. layers[idx].MediaType = manifest.DockerV2Schema2ForeignLayerMediaTypeGzip case imgspecv1.MediaTypeImageLayerNonDistributableZstd: //nolint:staticcheck // NonDistributable layers are deprecated, but we want to continue to support manipulating pre-existing images. return nil, fmt.Errorf("Error during manifest conversion: %q: zstd compression is not supported for docker images", layers[idx].MediaType) case imgspecv1.MediaTypeImageLayer: layers[idx].MediaType = manifest.DockerV2SchemaLayerMediaTypeUncompressed case imgspecv1.MediaTypeImageLayerGzip: layers[idx].MediaType = manifest.DockerV2Schema2LayerMediaType case imgspecv1.MediaTypeImageLayerZstd: return nil, fmt.Errorf("Error during manifest conversion: %q: zstd compression is not officially supported for docker images", layers[idx].MediaType) case ociencspec.MediaTypeLayerEnc, ociencspec.MediaTypeLayerGzipEnc, ociencspec.MediaTypeLayerZstdEnc, ociencspec.MediaTypeLayerNonDistributableEnc, ociencspec.MediaTypeLayerNonDistributableGzipEnc, ociencspec.MediaTypeLayerNonDistributableZstdEnc: return nil, fmt.Errorf("during manifest conversion: encrypted layers (%q) are not supported in docker images", layers[idx].MediaType) default: return nil, fmt.Errorf("Unknown media type during manifest conversion: %q", layers[idx].MediaType) } } // Rather than copying the ConfigBlob now, we just pass m.src to the // translated manifest, since the only difference is the mediatype of // descriptors there is no change to any blob stored in m.src. return manifestSchema2FromComponents(config, m.src, nil, layers), nil } // convertToManifestSchema1 returns a genericManifest implementation converted to manifest.DockerV2Schema1{Signed,}MediaType. // It may use options.InformationOnly and also adjust *options to be appropriate for editing the returned // value. // This does not change the state of the original manifestOCI1 object. func (m *manifestOCI1) convertToManifestSchema1(ctx context.Context, options *types.ManifestUpdateOptions) (genericManifest, error) { if m.m.Config.MediaType != imgspecv1.MediaTypeImageConfig { return nil, internalManifest.NewNonImageArtifactError(&m.m.Manifest) } // We can't directly convert images to V1, but we can transitively convert via a V2 image m2, err := m.convertToManifestSchema2(ctx, options) if err != nil { return nil, err } return m2.convertToManifestSchema1(ctx, options) } // SupportsEncryption returns if encryption is supported for the manifest type func (m *manifestOCI1) SupportsEncryption(context.Context) bool { return true } // CanChangeLayerCompression returns true if we can compress/decompress layers with mimeType in the current image // (and the code can handle that). // NOTE: Even if this returns true, the relevant format might not accept all compression algorithms; the set of accepted // algorithms depends not on the current format, but possibly on the target of a conversion (if UpdatedImage converts // to a different manifest format). func (m *manifestOCI1) CanChangeLayerCompression(mimeType string) bool { return m.m.CanChangeLayerCompression(mimeType) } ================================================ FILE: vendor/go.podman.io/image/v5/internal/image/oci_index.go ================================================ package image import ( "context" "fmt" "go.podman.io/image/v5/internal/manifest" "go.podman.io/image/v5/types" ) func manifestOCI1FromImageIndex(ctx context.Context, sys *types.SystemContext, src types.ImageSource, manblob []byte) (genericManifest, error) { index, err := manifest.OCI1IndexFromManifest(manblob) if err != nil { return nil, fmt.Errorf("parsing OCI1 index: %w", err) } targetManifestDigest, err := index.ChooseInstance(sys) if err != nil { return nil, fmt.Errorf("choosing image instance: %w", err) } manblob, mt, err := src.GetManifest(ctx, &targetManifestDigest) if err != nil { return nil, fmt.Errorf("fetching target platform image selected from image index: %w", err) } matches, err := manifest.MatchesDigest(manblob, targetManifestDigest) if err != nil { return nil, fmt.Errorf("computing manifest digest: %w", err) } if !matches { return nil, fmt.Errorf("Image manifest does not match selected manifest digest %s", targetManifestDigest) } return manifestInstanceFromBlob(ctx, sys, src, manblob, mt) } ================================================ FILE: vendor/go.podman.io/image/v5/internal/image/sourced.go ================================================ // Package image consolidates knowledge about various container image formats // (as opposed to image storage mechanisms, which are handled by types.ImageSource) // and exposes all of them using an unified interface. package image import ( "context" "go.podman.io/image/v5/types" ) // FromReference returns a types.ImageCloser implementation for the default instance reading from reference. // If reference points to a manifest list, .Manifest() still returns the manifest list, // but other methods transparently return data from an appropriate image instance. // // The caller must call .Close() on the returned ImageCloser. // // NOTE: If any kind of signature verification should happen, build an UnparsedImage from the value returned by NewImageSource, // verify that UnparsedImage, and convert it into a real Image via image.FromUnparsedImage instead of calling this function. func FromReference(ctx context.Context, sys *types.SystemContext, ref types.ImageReference) (types.ImageCloser, error) { src, err := ref.NewImageSource(ctx, sys) if err != nil { return nil, err } img, err := FromSource(ctx, sys, src) if err != nil { src.Close() return nil, err } return img, nil } // imageCloser implements types.ImageCloser, perhaps allowing simple users // to use a single object without having keep a reference to a types.ImageSource // only to call types.ImageSource.Close(). type imageCloser struct { types.Image src types.ImageSource } // FromSource returns a types.ImageCloser implementation for the default instance of source. // If source is a manifest list, .Manifest() still returns the manifest list, // but other methods transparently return data from an appropriate image instance. // // The caller must call .Close() on the returned ImageCloser. // // FromSource “takes ownership” of the input ImageSource and will call src.Close() // when the image is closed. (This does not prevent callers from using both the // Image and ImageSource objects simultaneously, but it means that they only need to // the Image.) // // NOTE: If any kind of signature verification should happen, build an UnparsedImage from the value returned by NewImageSource, // verify that UnparsedImage, and convert it into a real Image via image.FromUnparsedImage instead of calling this function. // // Most callers can use either FromUnparsedImage or FromReference instead. // // This is publicly visible as c/image/image.FromSource. func FromSource(ctx context.Context, sys *types.SystemContext, src types.ImageSource) (types.ImageCloser, error) { img, err := FromUnparsedImage(ctx, sys, UnparsedInstance(src, nil)) if err != nil { return nil, err } return &imageCloser{ Image: img, src: src, }, nil } func (ic *imageCloser) Close() error { return ic.src.Close() } // SourcedImage is a general set of utilities for working with container images, // whatever is their underlying transport (i.e. ImageSource-independent). // Note the existence of docker.Image and image.memoryImage: various instances // of a types.Image may not be a SourcedImage directly. // // Most external users of `types.Image` do not care, and those who care about `docker.Image` know they do. // // Internal users may depend on methods available in SourcedImage but not (yet?) in types.Image. type SourcedImage struct { *UnparsedImage ManifestBlob []byte // The manifest of the relevant instance ManifestMIMEType string // MIME type of ManifestBlob // genericManifest contains data corresponding to manifestBlob. // NOTE: The manifest may have been modified in the process; DO NOT reserialize and store genericManifest // if you want to preserve the original manifest; use manifestBlob directly. genericManifest } // FromUnparsedImage returns a types.Image implementation for unparsed. // If unparsed represents a manifest list, .Manifest() still returns the manifest list, // but other methods transparently return data from an appropriate single image. // // The Image must not be used after the underlying ImageSource is Close()d. // // This is publicly visible as c/image/image.FromUnparsedImage. func FromUnparsedImage(ctx context.Context, sys *types.SystemContext, unparsed *UnparsedImage) (*SourcedImage, error) { // Note that the input parameter above is specifically *image.UnparsedImage, not types.UnparsedImage: // we want to be able to use unparsed.src. We could make that an explicit interface, but, well, // this is the only UnparsedImage implementation around, anyway. // NOTE: It is essential for signature verification that all parsing done in this object happens on the same manifest which is returned by unparsed.Manifest(). manifestBlob, manifestMIMEType, err := unparsed.Manifest(ctx) if err != nil { return nil, err } parsedManifest, err := manifestInstanceFromBlob(ctx, sys, unparsed.src, manifestBlob, manifestMIMEType) if err != nil { return nil, err } return &SourcedImage{ UnparsedImage: unparsed, ManifestBlob: manifestBlob, ManifestMIMEType: manifestMIMEType, genericManifest: parsedManifest, }, nil } // Size returns the size of the image as stored, if it's known, or -1 if it isn't. func (i *SourcedImage) Size() (int64, error) { return -1, nil } // Manifest overrides the UnparsedImage.Manifest to always use the fields which we have already fetched. func (i *SourcedImage) Manifest(ctx context.Context) ([]byte, string, error) { return i.ManifestBlob, i.ManifestMIMEType, nil } func (i *SourcedImage) LayerInfosForCopy(ctx context.Context) ([]types.BlobInfo, error) { return i.UnparsedImage.src.LayerInfosForCopy(ctx, i.UnparsedImage.instanceDigest) } ================================================ FILE: vendor/go.podman.io/image/v5/internal/image/unparsed.go ================================================ package image import ( "context" "fmt" "github.com/opencontainers/go-digest" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/internal/imagesource" "go.podman.io/image/v5/internal/private" "go.podman.io/image/v5/internal/signature" "go.podman.io/image/v5/manifest" "go.podman.io/image/v5/types" ) // UnparsedImage implements types.UnparsedImage . // An UnparsedImage is a pair of (ImageSource, instance digest); it can represent either a manifest list or a single image instance. // // This is publicly visible as c/image/image.UnparsedImage. type UnparsedImage struct { src private.ImageSource instanceDigest *digest.Digest cachedManifest []byte // A private cache for Manifest(); nil if not yet known. // A private cache for Manifest(), may be the empty string if guessing failed. // Valid iff cachedManifest is not nil. cachedManifestMIMEType string cachedSignatures []signature.Signature // A private cache for Signatures(); nil if not yet known. } // UnparsedInstance returns a types.UnparsedImage implementation for (source, instanceDigest). // If instanceDigest is not nil, it contains a digest of the specific manifest instance to retrieve (when the primary manifest is a manifest list). // // This implementation of [types.UnparsedImage] ensures that [types.UnparsedImage.Manifest] validates the image // against instanceDigest if set, or, if not, a digest implied by src.Reference, if any. // // The UnparsedImage must not be used after the underlying ImageSource is Close()d. // // This is publicly visible as c/image/image.UnparsedInstance. func UnparsedInstance(src types.ImageSource, instanceDigest *digest.Digest) *UnparsedImage { return &UnparsedImage{ src: imagesource.FromPublic(src), instanceDigest: instanceDigest, } } // Reference returns the reference used to set up this source, _as specified by the user_ // (not as the image itself, or its underlying storage, claims). This can be used e.g. to determine which public keys are trusted for this image. func (i *UnparsedImage) Reference() types.ImageReference { // Note that this does not depend on instanceDigest; e.g. all instances within a manifest list need to be signed with the manifest list identity. return i.src.Reference() } // Manifest is like ImageSource.GetManifest, but the result is cached; it is OK to call this however often you need. // // Users of UnparsedImage are promised that this validates the image // against either i.instanceDigest if set, or against a digest included in i.src.Reference. func (i *UnparsedImage) Manifest(ctx context.Context) ([]byte, string, error) { if i.cachedManifest == nil { m, mt, err := i.src.GetManifest(ctx, i.instanceDigest) if err != nil { return nil, "", err } // ImageSource.GetManifest does not do digest verification, but we do; // this immediately protects also any user of types.Image. if digest, haveDigest := i.expectedManifestDigest(); haveDigest { matches, err := manifest.MatchesDigest(m, digest) if err != nil { return nil, "", fmt.Errorf("computing manifest digest: %w", err) } if !matches { return nil, "", fmt.Errorf("Manifest does not match provided manifest digest %s", digest) } } i.cachedManifest = m i.cachedManifestMIMEType = mt } return i.cachedManifest, i.cachedManifestMIMEType, nil } // expectedManifestDigest returns a the expected value of the manifest digest, and an indicator whether it is known. // The bool return value seems redundant with digest != ""; it is used explicitly // to refuse (unexpected) situations when the digest exists but is "". func (i *UnparsedImage) expectedManifestDigest() (digest.Digest, bool) { if i.instanceDigest != nil { return *i.instanceDigest, true } ref := i.Reference().DockerReference() if ref != nil { if canonical, ok := ref.(reference.Canonical); ok { return canonical.Digest(), true } } return "", false } // Signatures is like ImageSource.GetSignatures, but the result is cached; it is OK to call this however often you need. func (i *UnparsedImage) Signatures(ctx context.Context) ([][]byte, error) { // It would be consistent to make this an internal/unparsedimage/impl.Compat wrapper, // but this is very likely to be the only implementation ever. sigs, err := i.UntrustedSignatures(ctx) if err != nil { return nil, err } simpleSigs := [][]byte{} for _, sig := range sigs { if sig, ok := sig.(signature.SimpleSigning); ok { simpleSigs = append(simpleSigs, sig.UntrustedSignature()) } } return simpleSigs, nil } // UntrustedSignatures is like ImageSource.GetSignaturesWithFormat, but the result is cached; it is OK to call this however often you need. func (i *UnparsedImage) UntrustedSignatures(ctx context.Context) ([]signature.Signature, error) { if i.cachedSignatures == nil { sigs, err := i.src.GetSignaturesWithFormat(ctx, i.instanceDigest) if err != nil { return nil, err } i.cachedSignatures = sigs } return i.cachedSignatures, nil } ================================================ FILE: vendor/go.podman.io/image/v5/internal/imagedestination/impl/compat.go ================================================ package impl import ( "context" "io" "github.com/opencontainers/go-digest" "go.podman.io/image/v5/internal/blobinfocache" "go.podman.io/image/v5/internal/private" "go.podman.io/image/v5/internal/signature" "go.podman.io/image/v5/types" ) // Compat implements the obsolete parts of types.ImageDestination // for implementations of private.ImageDestination. // See AddCompat below. type Compat struct { dest private.ImageDestinationInternalOnly } // AddCompat initializes Compat to implement the obsolete parts of types.ImageDestination // for implementations of private.ImageDestination. // // Use it like this: // // type yourDestination struct { // impl.Compat // … // } // // dest := &yourDestination{…} // dest.Compat = impl.AddCompat(dest) func AddCompat(dest private.ImageDestinationInternalOnly) Compat { return Compat{dest} } // PutBlob writes contents of stream and returns data representing the result. // inputInfo.Digest can be optionally provided if known; if provided, and stream is read to the end without error, the digest MUST match the stream contents. // inputInfo.Size is the expected length of stream, if known. // inputInfo.MediaType describes the blob format, if known. // May update cache. // WARNING: The contents of stream are being verified on the fly. Until stream.Read() returns io.EOF, the contents of the data SHOULD NOT be available // to any other readers for download using the supplied digest. // If stream.Read() at any time, ESPECIALLY at end of input, returns an error, PutBlob MUST 1) fail, and 2) delete any data stored so far. func (c *Compat) PutBlob(ctx context.Context, stream io.Reader, inputInfo types.BlobInfo, cache types.BlobInfoCache, isConfig bool) (types.BlobInfo, error) { res, err := c.dest.PutBlobWithOptions(ctx, stream, inputInfo, private.PutBlobOptions{ Cache: blobinfocache.FromBlobInfoCache(cache), IsConfig: isConfig, }) if err != nil { return types.BlobInfo{}, err } return types.BlobInfo{ Digest: res.Digest, Size: res.Size, }, nil } // TryReusingBlob checks whether the transport already contains, or can efficiently reuse, a blob, and if so, applies it to the current destination // (e.g. if the blob is a filesystem layer, this signifies that the changes it describes need to be applied again when composing a filesystem tree). // info.Digest must not be empty. // If canSubstitute, TryReusingBlob can use an equivalent equivalent of the desired blob; in that case the returned info may not match the input. // If the blob has been successfully reused, returns (true, info, nil); info must contain at least a digest and size, and may // include CompressionOperation and CompressionAlgorithm fields to indicate that a change to the compression type should be // reflected in the manifest that will be written. // If the transport can not reuse the requested blob, TryReusingBlob returns (false, {}, nil); it returns a non-nil error only on an unexpected failure. // May use and/or update cache. func (c *Compat) TryReusingBlob(ctx context.Context, info types.BlobInfo, cache types.BlobInfoCache, canSubstitute bool) (bool, types.BlobInfo, error) { reused, blob, err := c.dest.TryReusingBlobWithOptions(ctx, info, private.TryReusingBlobOptions{ Cache: blobinfocache.FromBlobInfoCache(cache), CanSubstitute: canSubstitute, }) if !reused || err != nil { return reused, types.BlobInfo{}, err } res := types.BlobInfo{ Digest: blob.Digest, Size: blob.Size, CompressionOperation: blob.CompressionOperation, CompressionAlgorithm: blob.CompressionAlgorithm, } // This is probably not necessary; we preserve MediaType to decrease risks of breaking for external callers. // Some transports were not setting the MediaType field anyway, and others were setting the old value on substitution; // provide the value in cases where it is likely to be correct. if blob.Digest == info.Digest { res.MediaType = info.MediaType } return true, res, nil } // PutSignatures writes a set of signatures to the destination. // If instanceDigest is not nil, it contains a digest of the specific manifest instance to write or overwrite the signatures for // (when the primary manifest is a manifest list); this should always be nil if the primary manifest is not a manifest list. // MUST be called after PutManifest (signatures may reference manifest contents). func (c *Compat) PutSignatures(ctx context.Context, signatures [][]byte, instanceDigest *digest.Digest) error { withFormat := []signature.Signature{} for _, sig := range signatures { withFormat = append(withFormat, signature.SimpleSigningFromBlob(sig)) } return c.dest.PutSignaturesWithFormat(ctx, withFormat, instanceDigest) } // Commit marks the process of storing the image as successful and asks for the image to be persisted. // unparsedToplevel contains data about the top-level manifest of the source (which may be a single-arch image or a manifest list // if PutManifest was only called for the single-arch image with instanceDigest == nil), primarily to allow lookups by the // original manifest list digest, if desired. // WARNING: This does not have any transactional semantics: // - Uploaded data MAY be visible to others before Commit() is called // - Uploaded data MAY be removed or MAY remain around if Close() is called without Commit() (i.e. rollback is allowed but not guaranteed) func (c *Compat) Commit(ctx context.Context, unparsedToplevel types.UnparsedImage) error { return c.dest.CommitWithOptions(ctx, private.CommitOptions{ UnparsedToplevel: unparsedToplevel, }) } ================================================ FILE: vendor/go.podman.io/image/v5/internal/imagedestination/impl/helpers.go ================================================ package impl import ( "go.podman.io/image/v5/internal/manifest" "go.podman.io/image/v5/internal/private" ) // OriginalCandidateMatchesTryReusingBlobOptions returns true if the original blob passed to TryReusingBlobWithOptions // is acceptable based on opts. func OriginalCandidateMatchesTryReusingBlobOptions(opts private.TryReusingBlobOptions) bool { return manifest.CandidateCompressionMatchesReuseConditions(manifest.ReuseConditions{ PossibleManifestFormats: opts.PossibleManifestFormats, RequiredCompression: opts.RequiredCompression, }, opts.OriginalCompression) } ================================================ FILE: vendor/go.podman.io/image/v5/internal/imagedestination/impl/properties.go ================================================ package impl import "go.podman.io/image/v5/types" // Properties collects properties of an ImageDestination that are constant throughout its lifetime // (but might differ across instances). type Properties struct { // SupportedManifestMIMETypes tells which manifest MIME types the destination supports. // A empty slice or nil means any MIME type can be tried to upload. SupportedManifestMIMETypes []string // DesiredLayerCompression indicates the kind of compression to apply on layers DesiredLayerCompression types.LayerCompression // AcceptsForeignLayerURLs is false if foreign layers in manifest should be actually // uploaded to the image destination, true otherwise. AcceptsForeignLayerURLs bool // MustMatchRuntimeOS is set to true if the destination can store only images targeted for the current runtime architecture and OS. MustMatchRuntimeOS bool // IgnoresEmbeddedDockerReference is set to true if the destination does not care about Image.EmbeddedDockerReferenceConflicts(), // and would prefer to receive an unmodified manifest instead of one modified for the destination. // Does not make a difference if Reference().DockerReference() is nil. IgnoresEmbeddedDockerReference bool // HasThreadSafePutBlob indicates that PutBlob can be executed concurrently. HasThreadSafePutBlob bool } // PropertyMethodsInitialize implements parts of private.ImageDestination corresponding to Properties. type PropertyMethodsInitialize struct { // We need two separate structs, PropertyMethodsInitialize and Properties, because Go prohibits fields and methods with the same name. vals Properties } // PropertyMethods creates an PropertyMethodsInitialize for vals. func PropertyMethods(vals Properties) PropertyMethodsInitialize { return PropertyMethodsInitialize{ vals: vals, } } // SupportedManifestMIMETypes tells which manifest mime types the destination supports // If an empty slice or nil it's returned, then any mime type can be tried to upload func (o PropertyMethodsInitialize) SupportedManifestMIMETypes() []string { return o.vals.SupportedManifestMIMETypes } // DesiredLayerCompression indicates the kind of compression to apply on layers func (o PropertyMethodsInitialize) DesiredLayerCompression() types.LayerCompression { return o.vals.DesiredLayerCompression } // AcceptsForeignLayerURLs returns false iff foreign layers in manifest should be actually // uploaded to the image destination, true otherwise. func (o PropertyMethodsInitialize) AcceptsForeignLayerURLs() bool { return o.vals.AcceptsForeignLayerURLs } // MustMatchRuntimeOS returns true iff the destination can store only images targeted for the current runtime architecture and OS. False otherwise. func (o PropertyMethodsInitialize) MustMatchRuntimeOS() bool { return o.vals.MustMatchRuntimeOS } // IgnoresEmbeddedDockerReference() returns true iff the destination does not care about Image.EmbeddedDockerReferenceConflicts(), // and would prefer to receive an unmodified manifest instead of one modified for the destination. // Does not make a difference if Reference().DockerReference() is nil. func (o PropertyMethodsInitialize) IgnoresEmbeddedDockerReference() bool { return o.vals.IgnoresEmbeddedDockerReference } // HasThreadSafePutBlob indicates whether PutBlob can be executed concurrently. func (o PropertyMethodsInitialize) HasThreadSafePutBlob() bool { return o.vals.HasThreadSafePutBlob } ================================================ FILE: vendor/go.podman.io/image/v5/internal/imagedestination/stubs/original_oci_config.go ================================================ package stubs import ( imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" ) // IgnoresOriginalOCIConfig implements NoteOriginalOCIConfig() that does nothing. type IgnoresOriginalOCIConfig struct{} // NoteOriginalOCIConfig provides the config of the image, as it exists on the source, BUT converted to OCI format, // or an error obtaining that value (e.g. if the image is an artifact and not a container image). // The destination can use it in its TryReusingBlob/PutBlob implementations // (otherwise it only obtains the final config after all layers are written). func (stub IgnoresOriginalOCIConfig) NoteOriginalOCIConfig(ociConfig *imgspecv1.Image, configErr error) error { return nil } ================================================ FILE: vendor/go.podman.io/image/v5/internal/imagedestination/stubs/put_blob_partial.go ================================================ package stubs import ( "context" "fmt" "go.podman.io/image/v5/internal/private" "go.podman.io/image/v5/types" ) // NoPutBlobPartialInitialize implements parts of private.ImageDestination // for transports that don’t support PutBlobPartial(). // See NoPutBlobPartial() below. type NoPutBlobPartialInitialize struct { transportName string } // NoPutBlobPartial creates a NoPutBlobPartialInitialize for ref. func NoPutBlobPartial(ref types.ImageReference) NoPutBlobPartialInitialize { return NoPutBlobPartialRaw(ref.Transport().Name()) } // NoPutBlobPartialRaw is the same thing as NoPutBlobPartial, but it can be used // in situations where no ImageReference is available. func NoPutBlobPartialRaw(transportName string) NoPutBlobPartialInitialize { return NoPutBlobPartialInitialize{ transportName: transportName, } } // SupportsPutBlobPartial returns true if PutBlobPartial is supported. func (stub NoPutBlobPartialInitialize) SupportsPutBlobPartial() bool { return false } // PutBlobPartial attempts to create a blob using the data that is already present // at the destination. chunkAccessor is accessed in a non-sequential way to retrieve the missing chunks. // It is available only if SupportsPutBlobPartial(). // Even if SupportsPutBlobPartial() returns true, the call can fail. // If the call fails with ErrFallbackToOrdinaryLayerDownload, the caller can fall back to PutBlobWithOptions. // The fallback _must not_ be done otherwise. func (stub NoPutBlobPartialInitialize) PutBlobPartial(ctx context.Context, chunkAccessor private.BlobChunkAccessor, srcInfo types.BlobInfo, options private.PutBlobPartialOptions) (private.UploadedBlob, error) { return private.UploadedBlob{}, fmt.Errorf("internal error: PutBlobPartial is not supported by the %q transport", stub.transportName) } // ImplementsPutBlobPartial implements SupportsPutBlobPartial() that returns true. type ImplementsPutBlobPartial struct{} // SupportsPutBlobPartial returns true if PutBlobPartial is supported. func (stub ImplementsPutBlobPartial) SupportsPutBlobPartial() bool { return true } ================================================ FILE: vendor/go.podman.io/image/v5/internal/imagedestination/stubs/signatures.go ================================================ package stubs import ( "context" "errors" "github.com/opencontainers/go-digest" "go.podman.io/image/v5/internal/signature" ) // NoSignaturesInitialize implements parts of private.ImageDestination // for transports that don’t support storing signatures. // See NoSignatures() below. type NoSignaturesInitialize struct { message string } // NoSignatures creates a NoSignaturesInitialize, failing with message. func NoSignatures(message string) NoSignaturesInitialize { return NoSignaturesInitialize{ message: message, } } // SupportsSignatures returns an error (to be displayed to the user) if the destination certainly can't store signatures. // Note: It is still possible for PutSignatures to fail if SupportsSignatures returns nil. func (stub NoSignaturesInitialize) SupportsSignatures(ctx context.Context) error { return errors.New(stub.message) } // PutSignaturesWithFormat writes a set of signatures to the destination. // If instanceDigest is not nil, it contains a digest of the specific manifest instance to write or overwrite the signatures for // (when the primary manifest is a manifest list); this should always be nil if the primary manifest is not a manifest list. // MUST be called after PutManifest (signatures may reference manifest contents). func (stub NoSignaturesInitialize) PutSignaturesWithFormat(ctx context.Context, signatures []signature.Signature, instanceDigest *digest.Digest) error { if len(signatures) != 0 { return errors.New(stub.message) } return nil } // SupportsSignatures implements SupportsSignatures() that returns nil. // Note that it might be even more useful to return a value dynamically detected based on type AlwaysSupportsSignatures struct{} // SupportsSignatures returns an error (to be displayed to the user) if the destination certainly can't store signatures. // Note: It is still possible for PutSignatures to fail if SupportsSignatures returns nil. func (stub AlwaysSupportsSignatures) SupportsSignatures(ctx context.Context) error { return nil } ================================================ FILE: vendor/go.podman.io/image/v5/internal/imagedestination/stubs/stubs.go ================================================ // Package stubs contains trivial stubs for parts of private.ImageDestination. // It can be used from internal/wrapper, so it should not drag in any extra dependencies. // Compare with imagedestination/impl, which might require non-trivial implementation work. // // There are two kinds of stubs: // // First, there are pure stubs, like ImplementsPutBlobPartial. Those can just be included in an imageDestination // implementation: // // type yourDestination struct { // stubs.ImplementsPutBlobPartial // … // } // // Second, there are stubs with a constructor, like NoPutBlobPartialInitialize. The Initialize marker // means that a constructor must be called: // // type yourDestination struct { // stubs.NoPutBlobPartialInitialize // … // } // // dest := &yourDestination{ // … // NoPutBlobPartialInitialize: stubs.NoPutBlobPartial(ref), // } package stubs ================================================ FILE: vendor/go.podman.io/image/v5/internal/imagedestination/wrapper.go ================================================ package imagedestination import ( "context" "io" "github.com/opencontainers/go-digest" "go.podman.io/image/v5/internal/imagedestination/stubs" "go.podman.io/image/v5/internal/private" "go.podman.io/image/v5/internal/signature" "go.podman.io/image/v5/types" ) // wrapped provides the private.ImageDestination operations // for a destination that only implements types.ImageDestination type wrapped struct { stubs.IgnoresOriginalOCIConfig stubs.NoPutBlobPartialInitialize types.ImageDestination } // FromPublic(dest) returns an object that provides the private.ImageDestination API // // Eventually, we might want to expose this function, and methods of the returned object, // as a public API (or rather, a variant that does not include the already-superseded // methods of types.ImageDestination, and has added more future-proofing), and more strongly // deprecate direct use of types.ImageDestination. // // NOTE: The returned API MUST NOT be a public interface (it can be either just a struct // with public methods, or perhaps a private interface), so that we can add methods // without breaking any external implementers of a public interface. func FromPublic(dest types.ImageDestination) private.ImageDestination { if dest2, ok := dest.(private.ImageDestination); ok { return dest2 } return &wrapped{ NoPutBlobPartialInitialize: stubs.NoPutBlobPartial(dest.Reference()), ImageDestination: dest, } } // PutBlobWithOptions writes contents of stream and returns data representing the result. // inputInfo.Digest can be optionally provided if known; if provided, and stream is read to the end without error, the digest MUST match the stream contents. // inputInfo.Size is the expected length of stream, if known. // inputInfo.MediaType describes the blob format, if known. // WARNING: The contents of stream are being verified on the fly. Until stream.Read() returns io.EOF, the contents of the data SHOULD NOT be available // to any other readers for download using the supplied digest. // If stream.Read() at any time, ESPECIALLY at end of input, returns an error, PutBlobWithOptions MUST 1) fail, and 2) delete any data stored so far. func (w *wrapped) PutBlobWithOptions(ctx context.Context, stream io.Reader, inputInfo types.BlobInfo, options private.PutBlobOptions) (private.UploadedBlob, error) { res, err := w.PutBlob(ctx, stream, inputInfo, options.Cache, options.IsConfig) if err != nil { return private.UploadedBlob{}, err } return private.UploadedBlob{ Digest: res.Digest, Size: res.Size, }, nil } // TryReusingBlobWithOptions checks whether the transport already contains, or can efficiently reuse, a blob, and if so, applies it to the current destination // (e.g. if the blob is a filesystem layer, this signifies that the changes it describes need to be applied again when composing a filesystem tree). // info.Digest must not be empty. // If the blob has been successfully reused, returns (true, info, nil). // If the transport can not reuse the requested blob, TryReusingBlob returns (false, {}, nil); it returns a non-nil error only on an unexpected failure. func (w *wrapped) TryReusingBlobWithOptions(ctx context.Context, info types.BlobInfo, options private.TryReusingBlobOptions) (bool, private.ReusedBlob, error) { if options.RequiredCompression != nil { return false, private.ReusedBlob{}, nil } reused, blob, err := w.TryReusingBlob(ctx, info, options.Cache, options.CanSubstitute) if !reused || err != nil { return reused, private.ReusedBlob{}, err } return true, private.ReusedBlob{ Digest: blob.Digest, Size: blob.Size, CompressionOperation: blob.CompressionOperation, CompressionAlgorithm: blob.CompressionAlgorithm, // CompressionAnnotations could be set to blob.Annotations, but that may contain unrelated // annotations, and we didn’t use the blob.Annotations field previously, so we’ll // continue not using it. }, nil } // PutSignaturesWithFormat writes a set of signatures to the destination. // If instanceDigest is not nil, it contains a digest of the specific manifest instance to write or overwrite the signatures for // (when the primary manifest is a manifest list); this should always be nil if the primary manifest is not a manifest list. // MUST be called after PutManifest (signatures may reference manifest contents). func (w *wrapped) PutSignaturesWithFormat(ctx context.Context, signatures []signature.Signature, instanceDigest *digest.Digest) error { simpleSigs := [][]byte{} for _, sig := range signatures { simpleSig, ok := sig.(signature.SimpleSigning) if !ok { return signature.UnsupportedFormatError(sig) } simpleSigs = append(simpleSigs, simpleSig.UntrustedSignature()) } return w.PutSignatures(ctx, simpleSigs, instanceDigest) } // CommitWithOptions marks the process of storing the image as successful and asks for the image to be persisted. // WARNING: This does not have any transactional semantics: // - Uploaded data MAY be visible to others before CommitWithOptions() is called // - Uploaded data MAY be removed or MAY remain around if Close() is called without CommitWithOptions() (i.e. rollback is allowed but not guaranteed) func (w *wrapped) CommitWithOptions(ctx context.Context, options private.CommitOptions) error { return w.Commit(ctx, options.UnparsedToplevel) } ================================================ FILE: vendor/go.podman.io/image/v5/internal/imagesource/impl/compat.go ================================================ package impl import ( "context" "github.com/opencontainers/go-digest" "go.podman.io/image/v5/internal/private" "go.podman.io/image/v5/internal/signature" ) // Compat implements the obsolete parts of types.ImageSource // for implementations of private.ImageSource. // See AddCompat below. type Compat struct { src private.ImageSourceInternalOnly } // AddCompat initializes Compat to implement the obsolete parts of types.ImageSource // for implementations of private.ImageSource. // // Use it like this: // // type yourSource struct { // impl.Compat // … // } // // src := &yourSource{…} // src.Compat = impl.AddCompat(src) func AddCompat(src private.ImageSourceInternalOnly) Compat { return Compat{src} } // GetSignatures returns the image's signatures. It may use a remote (= slow) service. // If instanceDigest is not nil, it contains a digest of the specific manifest instance to retrieve signatures for // (when the primary manifest is a manifest list); this never happens if the primary manifest is not a manifest list // (e.g. if the source never returns manifest lists). func (c *Compat) GetSignatures(ctx context.Context, instanceDigest *digest.Digest) ([][]byte, error) { // Silently ignore signatures with other formats; the caller can’t handle them. // Admittedly callers that want to sync all of the image might want to fail instead; this // way an upgrade of c/image neither breaks them nor adds new functionality. // Alternatively, we could possibly define the old GetSignatures to use the multi-format // signature.Blob representation now, in general, but that could silently break them as well. sigs, err := c.src.GetSignaturesWithFormat(ctx, instanceDigest) if err != nil { return nil, err } simpleSigs := [][]byte{} for _, sig := range sigs { if sig, ok := sig.(signature.SimpleSigning); ok { simpleSigs = append(simpleSigs, sig.UntrustedSignature()) } } return simpleSigs, nil } ================================================ FILE: vendor/go.podman.io/image/v5/internal/imagesource/impl/layer_infos.go ================================================ package impl import ( "context" "github.com/opencontainers/go-digest" "go.podman.io/image/v5/types" ) // DoesNotAffectLayerInfosForCopy implements LayerInfosForCopy() that returns nothing. type DoesNotAffectLayerInfosForCopy struct{} // LayerInfosForCopy returns either nil (meaning the values in the manifest are fine), or updated values for the layer // blobsums that are listed in the image's manifest. If values are returned, they should be used when using GetBlob() // to read the image's layers. // If instanceDigest is not nil, it contains a digest of the specific manifest instance to retrieve BlobInfos for // (when the primary manifest is a manifest list); this never happens if the primary manifest is not a manifest list // (e.g. if the source never returns manifest lists). // The Digest field is guaranteed to be provided; Size may be -1. // WARNING: The list may contain duplicates, and they are semantically relevant. func (stub DoesNotAffectLayerInfosForCopy) LayerInfosForCopy(ctx context.Context, instanceDigest *digest.Digest) ([]types.BlobInfo, error) { return nil, nil } ================================================ FILE: vendor/go.podman.io/image/v5/internal/imagesource/impl/properties.go ================================================ package impl // Properties collects properties of an ImageSource that are constant throughout its lifetime // (but might differ across instances). type Properties struct { // HasThreadSafeGetBlob indicates whether GetBlob can be executed concurrently. HasThreadSafeGetBlob bool } // PropertyMethodsInitialize implements parts of private.ImageSource corresponding to Properties. type PropertyMethodsInitialize struct { // We need two separate structs, PropertyMethodsInitialize and Properties, because Go prohibits fields and methods with the same name. vals Properties } // PropertyMethods creates an PropertyMethodsInitialize for vals. func PropertyMethods(vals Properties) PropertyMethodsInitialize { return PropertyMethodsInitialize{ vals: vals, } } // HasThreadSafeGetBlob indicates whether GetBlob can be executed concurrently. func (o PropertyMethodsInitialize) HasThreadSafeGetBlob() bool { return o.vals.HasThreadSafeGetBlob } ================================================ FILE: vendor/go.podman.io/image/v5/internal/imagesource/impl/signatures.go ================================================ package impl import ( "context" "github.com/opencontainers/go-digest" "go.podman.io/image/v5/internal/signature" ) // NoSignatures implements GetSignatures() that returns nothing. type NoSignatures struct{} // GetSignaturesWithFormat returns the image's signatures. It may use a remote (= slow) service. // If instanceDigest is not nil, it contains a digest of the specific manifest instance to retrieve signatures for // (when the primary manifest is a manifest list); this never happens if the primary manifest is not a manifest list // (e.g. if the source never returns manifest lists). func (stub NoSignatures) GetSignaturesWithFormat(ctx context.Context, instanceDigest *digest.Digest) ([]signature.Signature, error) { return nil, nil } ================================================ FILE: vendor/go.podman.io/image/v5/internal/imagesource/stubs/get_blob_at.go ================================================ package stubs import ( "context" "fmt" "io" "go.podman.io/image/v5/internal/private" "go.podman.io/image/v5/types" ) // NoGetBlobAtInitialize implements parts of private.ImageSource // for transports that don’t support GetBlobAt(). // See NoGetBlobAt() below. type NoGetBlobAtInitialize struct { transportName string } // NoGetBlobAt() creates a NoGetBlobAtInitialize for ref. func NoGetBlobAt(ref types.ImageReference) NoGetBlobAtInitialize { return NoGetBlobAtRaw(ref.Transport().Name()) } // NoGetBlobAtRaw is the same thing as NoGetBlobAt, but it can be used // in situations where no ImageReference is available. func NoGetBlobAtRaw(transportName string) NoGetBlobAtInitialize { return NoGetBlobAtInitialize{ transportName: transportName, } } // SupportsGetBlobAt() returns true if GetBlobAt (BlobChunkAccessor) is supported. func (stub NoGetBlobAtInitialize) SupportsGetBlobAt() bool { return false } // GetBlobAt returns a sequential channel of readers that contain data for the requested // blob chunks, and a channel that might get a single error value. // The specified chunks must be not overlapping and sorted by their offset. // The readers must be fully consumed, in the order they are returned, before blocking // to read the next chunk. // If the Length for the last chunk is set to math.MaxUint64, then it // fully fetches the remaining data from the offset to the end of the blob. func (stub NoGetBlobAtInitialize) GetBlobAt(ctx context.Context, info types.BlobInfo, chunks []private.ImageSourceChunk) (chan io.ReadCloser, chan error, error) { return nil, nil, fmt.Errorf("internal error: GetBlobAt is not supported by the %q transport", stub.transportName) } // ImplementsGetBlobAt implements SupportsGetBlobAt() that returns true. type ImplementsGetBlobAt struct{} // SupportsGetBlobAt() returns true if GetBlobAt (BlobChunkAccessor) is supported. func (stub ImplementsGetBlobAt) SupportsGetBlobAt() bool { return true } ================================================ FILE: vendor/go.podman.io/image/v5/internal/imagesource/stubs/stubs.go ================================================ // Package stubs contains trivial stubs for parts of private.ImageSource. // It can be used from internal/wrapper, so it should not drag in any extra dependencies. // Compare with imagesource/impl, which might require non-trivial implementation work. // // There are two kinds of stubs: // // First, there are pure stubs, like ImplementsGetBlobAt. Those can just be included in an ImageSource // // implementation: // // type yourSource struct { // stubs.ImplementsGetBlobAt // … // } // // Second, there are stubs with a constructor, like NoGetBlobAtInitialize. The Initialize marker // means that a constructor must be called: // // type yourSource struct { // stubs.NoGetBlobAtInitialize // … // } // // dest := &yourSource{ // … // NoGetBlobAtInitialize: stubs.NoGetBlobAt(ref), // } package stubs ================================================ FILE: vendor/go.podman.io/image/v5/internal/imagesource/wrapper.go ================================================ package imagesource import ( "context" "github.com/opencontainers/go-digest" "go.podman.io/image/v5/internal/imagesource/stubs" "go.podman.io/image/v5/internal/private" "go.podman.io/image/v5/internal/signature" "go.podman.io/image/v5/types" ) // wrapped provides the private.ImageSource operations // for a source that only implements types.ImageSource type wrapped struct { stubs.NoGetBlobAtInitialize types.ImageSource } // FromPublic(src) returns an object that provides the private.ImageSource API // // Eventually, we might want to expose this function, and methods of the returned object, // as a public API (or rather, a variant that does not include the already-superseded // methods of types.ImageSource, and has added more future-proofing), and more strongly // deprecate direct use of types.ImageSource. // // NOTE: The returned API MUST NOT be a public interface (it can be either just a struct // with public methods, or perhaps a private interface), so that we can add methods // without breaking any external implementers of a public interface. func FromPublic(src types.ImageSource) private.ImageSource { if src2, ok := src.(private.ImageSource); ok { return src2 } return &wrapped{ NoGetBlobAtInitialize: stubs.NoGetBlobAt(src.Reference()), ImageSource: src, } } // GetSignaturesWithFormat returns the image's signatures. It may use a remote (= slow) service. // If instanceDigest is not nil, it contains a digest of the specific manifest instance to retrieve signatures for // (when the primary manifest is a manifest list); this never happens if the primary manifest is not a manifest list // (e.g. if the source never returns manifest lists). func (w *wrapped) GetSignaturesWithFormat(ctx context.Context, instanceDigest *digest.Digest) ([]signature.Signature, error) { sigs, err := w.GetSignatures(ctx, instanceDigest) if err != nil { return nil, err } res := []signature.Signature{} for _, sig := range sigs { res = append(res, signature.SimpleSigningFromBlob(sig)) } return res, nil } ================================================ FILE: vendor/go.podman.io/image/v5/internal/iolimits/iolimits.go ================================================ package iolimits import ( "fmt" "io" ) // All constants below are intended to be used as limits for `ReadAtMost`. The // immediate use-case for limiting the size of in-memory copied data is to // protect against OOM DOS attacks as described inCVE-2020-1702. Instead of // copying data until running out of memory, we error out after hitting the // specified limit. const ( // megaByte denotes one megabyte and is intended to be used as a limit in // `ReadAtMost`. megaByte = 1 << 20 // MaxManifestBodySize is the maximum allowed size of a manifest. The limit // of 4 MB aligns with the one of a Docker registry: // https://github.com/docker/distribution/blob/a8371794149d1d95f1e846744b05c87f2f825e5a/registry/handlers/manifests.go#L30 MaxManifestBodySize = 4 * megaByte // MaxAuthTokenBodySize is the maximum allowed size of an auth token. // The limit of 1 MB is considered to be greatly sufficient. MaxAuthTokenBodySize = megaByte // MaxSignatureListBodySize is the maximum allowed size of a signature list. // The limit of 4 MB is considered to be greatly sufficient. MaxSignatureListBodySize = 4 * megaByte // MaxSignatureBodySize is the maximum allowed size of a signature. // The limit of 4 MB is considered to be greatly sufficient. MaxSignatureBodySize = 4 * megaByte // MaxErrorBodySize is the maximum allowed size of an error-response body. // The limit of 1 MB is considered to be greatly sufficient. MaxErrorBodySize = megaByte // MaxConfigBodySize is the maximum allowed size of a config blob. // The limit of 4 MB is considered to be greatly sufficient. MaxConfigBodySize = 4 * megaByte // MaxOpenShiftStatusBody is the maximum allowed size of an OpenShift status body. // The limit of 4 MB is considered to be greatly sufficient. MaxOpenShiftStatusBody = 4 * megaByte // MaxTarFileManifestSize is the maximum allowed size of a (docker save)-like manifest (which may contain multiple images) // The limit of 1 MB is considered to be greatly sufficient. MaxTarFileManifestSize = megaByte ) // ReadAtMost reads from reader and errors out if the specified limit (in bytes) is exceeded. func ReadAtMost(reader io.Reader, limit int) ([]byte, error) { limitedReader := io.LimitReader(reader, int64(limit+1)) res, err := io.ReadAll(limitedReader) if err != nil { return nil, err } if len(res) > limit { return nil, fmt.Errorf("exceeded maximum allowed size of %d bytes", limit) } return res, nil } ================================================ FILE: vendor/go.podman.io/image/v5/internal/manifest/common.go ================================================ package manifest import ( "encoding/json" "fmt" ) // AllowedManifestFields is a bit mask of “essential” manifest fields that ValidateUnambiguousManifestFormat // can expect to be present. type AllowedManifestFields int const ( AllowedFieldConfig AllowedManifestFields = 1 << iota AllowedFieldFSLayers AllowedFieldHistory AllowedFieldLayers AllowedFieldManifests AllowedFieldFirstUnusedBit // Keep this at the end! ) // ValidateUnambiguousManifestFormat rejects manifests (incl. multi-arch) that look like more than // one kind we currently recognize, i.e. if they contain any of the known “essential” format fields // other than the ones the caller specifically allows. // expectedMIMEType is used only for diagnostics. // NOTE: The caller should do the non-heuristic validations (e.g. check for any specified format // identification/version, or other “magic numbers”) before calling this, to cleanly reject unambiguous // data that just isn’t what was expected, as opposed to actually ambiguous data. func ValidateUnambiguousManifestFormat(manifest []byte, expectedMIMEType string, allowed AllowedManifestFields, ) error { if allowed >= AllowedFieldFirstUnusedBit { return fmt.Errorf("internal error: invalid allowedManifestFields value %#v", allowed) } // Use a private type to decode, not just a map[string]any, because we want // to also reject case-insensitive matches (which would be used by Go when really decoding // the manifest). // (It is expected that as manifest formats are added or extended over time, more fields will be added // here.) detectedFields := struct { Config any `json:"config"` FSLayers any `json:"fsLayers"` History any `json:"history"` Layers any `json:"layers"` Manifests any `json:"manifests"` }{} if err := json.Unmarshal(manifest, &detectedFields); err != nil { // The caller was supposed to already validate version numbers, so this should not happen; // let’s not bother with making this error “nice”. return err } unexpected := []string{} // Sadly this isn’t easy to automate in Go, without reflection. So, copy&paste. if detectedFields.Config != nil && (allowed&AllowedFieldConfig) == 0 { unexpected = append(unexpected, "config") } if detectedFields.FSLayers != nil && (allowed&AllowedFieldFSLayers) == 0 { unexpected = append(unexpected, "fsLayers") } if detectedFields.History != nil && (allowed&AllowedFieldHistory) == 0 { unexpected = append(unexpected, "history") } if detectedFields.Layers != nil && (allowed&AllowedFieldLayers) == 0 { unexpected = append(unexpected, "layers") } if detectedFields.Manifests != nil && (allowed&AllowedFieldManifests) == 0 { unexpected = append(unexpected, "manifests") } if len(unexpected) != 0 { return fmt.Errorf(`rejecting ambiguous manifest, unexpected fields %#v in supposedly %s`, unexpected, expectedMIMEType) } return nil } ================================================ FILE: vendor/go.podman.io/image/v5/internal/manifest/docker_schema2.go ================================================ package manifest import ( "github.com/opencontainers/go-digest" ) // Schema2Descriptor is a “descriptor” in docker/distribution schema 2. // // This is publicly visible as c/image/manifest.Schema2Descriptor. type Schema2Descriptor struct { MediaType string `json:"mediaType"` Size int64 `json:"size"` Digest digest.Digest `json:"digest"` URLs []string `json:"urls,omitempty"` } ================================================ FILE: vendor/go.podman.io/image/v5/internal/manifest/docker_schema2_list.go ================================================ package manifest import ( "encoding/json" "fmt" "slices" "github.com/opencontainers/go-digest" imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" platform "go.podman.io/image/v5/internal/pkg/platform" compression "go.podman.io/image/v5/pkg/compression/types" "go.podman.io/image/v5/types" ) // Schema2PlatformSpec describes the platform which a particular manifest is // specialized for. // This is publicly visible as c/image/manifest.Schema2PlatformSpec. type Schema2PlatformSpec struct { Architecture string `json:"architecture"` OS string `json:"os"` OSVersion string `json:"os.version,omitempty"` OSFeatures []string `json:"os.features,omitempty"` Variant string `json:"variant,omitempty"` Features []string `json:"features,omitempty"` // removed in OCI } // Schema2ManifestDescriptor references a platform-specific manifest. // This is publicly visible as c/image/manifest.Schema2ManifestDescriptor. type Schema2ManifestDescriptor struct { Schema2Descriptor Platform Schema2PlatformSpec `json:"platform"` } // Schema2ListPublic is a list of platform-specific manifests. // This is publicly visible as c/image/manifest.Schema2List. // Internal users should usually use Schema2List instead. type Schema2ListPublic struct { SchemaVersion int `json:"schemaVersion"` MediaType string `json:"mediaType"` Manifests []Schema2ManifestDescriptor `json:"manifests"` } // MIMEType returns the MIME type of this particular manifest list. func (list *Schema2ListPublic) MIMEType() string { return list.MediaType } // Instances returns a slice of digests of the manifests that this list knows of. func (list *Schema2ListPublic) Instances() []digest.Digest { results := make([]digest.Digest, len(list.Manifests)) for i, m := range list.Manifests { results[i] = m.Digest } return results } // Instance returns the ListUpdate of a particular instance in the list. func (list *Schema2ListPublic) Instance(instanceDigest digest.Digest) (ListUpdate, error) { for _, manifest := range list.Manifests { if manifest.Digest == instanceDigest { ret := ListUpdate{ Digest: manifest.Digest, Size: manifest.Size, MediaType: manifest.MediaType, } ret.ReadOnly.CompressionAlgorithmNames = []string{compression.GzipAlgorithmName} platform := ociPlatformFromSchema2PlatformSpec(manifest.Platform) ret.ReadOnly.Platform = &platform return ret, nil } } return ListUpdate{}, fmt.Errorf("unable to find instance %s passed to Schema2List.Instances", instanceDigest) } // UpdateInstances updates the sizes, digests, and media types of the manifests // which the list catalogs. func (list *Schema2ListPublic) UpdateInstances(updates []ListUpdate) error { editInstances := []ListEdit{} for i, instance := range updates { editInstances = append(editInstances, ListEdit{ UpdateOldDigest: list.Manifests[i].Digest, UpdateDigest: instance.Digest, UpdateSize: instance.Size, UpdateMediaType: instance.MediaType, ListOperation: ListOpUpdate, }) } return list.editInstances(editInstances, false) } // editInstances edits information about the list's instances, based on instructions in editInstances. // If cannotModifyManifest, avoidable updates should be skipped. func (list *Schema2ListPublic) editInstances(editInstances []ListEdit, cannotModifyManifest bool) error { _ = cannotModifyManifest // None of the edits we make are avoidable. addedEntries := []Schema2ManifestDescriptor{} for i, editInstance := range editInstances { switch editInstance.ListOperation { case ListOpUpdate: if err := editInstance.UpdateOldDigest.Validate(); err != nil { return fmt.Errorf("Schema2List.EditInstances: Attempting to update %s which is an invalid digest: %w", editInstance.UpdateOldDigest, err) } if err := editInstance.UpdateDigest.Validate(); err != nil { return fmt.Errorf("Schema2List.EditInstances: Modified digest %s is an invalid digest: %w", editInstance.UpdateDigest, err) } targetIndex := slices.IndexFunc(list.Manifests, func(m Schema2ManifestDescriptor) bool { return m.Digest == editInstance.UpdateOldDigest }) if targetIndex == -1 { return fmt.Errorf("Schema2List.EditInstances: digest %s not found", editInstance.UpdateOldDigest) } list.Manifests[targetIndex].Digest = editInstance.UpdateDigest if editInstance.UpdateSize < 0 { return fmt.Errorf("update %d of %d passed to Schema2List.UpdateInstances had an invalid size (%d)", i+1, len(editInstances), editInstance.UpdateSize) } list.Manifests[targetIndex].Size = editInstance.UpdateSize if editInstance.UpdateMediaType == "" { return fmt.Errorf("update %d of %d passed to Schema2List.UpdateInstances had no media type (was %q)", i+1, len(editInstances), list.Manifests[i].MediaType) } list.Manifests[targetIndex].MediaType = editInstance.UpdateMediaType case ListOpAdd: if editInstance.AddPlatform == nil { // Should we create a struct with empty fields instead? // Right now ListOpAdd is only called when an instance with the same platform value // already exists in the manifest, so this should not be reached in practice. return fmt.Errorf("adding a schema2 list instance with no platform specified is not supported") } addedEntries = append(addedEntries, Schema2ManifestDescriptor{ Schema2Descriptor{ Digest: editInstance.AddDigest, Size: editInstance.AddSize, MediaType: editInstance.AddMediaType, }, schema2PlatformSpecFromOCIPlatform(*editInstance.AddPlatform), }) default: return fmt.Errorf("internal error: invalid operation: %d", editInstance.ListOperation) } } if len(addedEntries) != 0 { // slices.Clone() here to ensure a private backing array; // an external caller could have manually created Schema2ListPublic with a slice with extra capacity. list.Manifests = append(slices.Clone(list.Manifests), addedEntries...) } return nil } // EditInstances edits information about the list's instances, based on instructions in editInstances. // If cannotModifyManifest, avoidable updates should be skipped. func (list *Schema2List) EditInstances(editInstances []ListEdit, cannotModifyManifest bool) error { return list.editInstances(editInstances, cannotModifyManifest) } func (list *Schema2ListPublic) ChooseInstanceByCompression(ctx *types.SystemContext, preferGzip types.OptionalBool) (digest.Digest, error) { // ChooseInstanceByCompression is same as ChooseInstance for schema2 manifest list. return list.ChooseInstance(ctx) } // ChooseInstance parses blob as a schema2 manifest list, and returns the digest // of the image which is appropriate for the current environment. func (list *Schema2ListPublic) ChooseInstance(ctx *types.SystemContext) (digest.Digest, error) { wantedPlatforms := platform.WantedPlatforms(ctx) for _, wantedPlatform := range wantedPlatforms { for _, d := range list.Manifests { imagePlatform := ociPlatformFromSchema2PlatformSpec(d.Platform) if platform.MatchesPlatform(imagePlatform, wantedPlatform) { return d.Digest, nil } } } return "", fmt.Errorf("no image found in manifest list for architecture %q, variant %q, OS %q", wantedPlatforms[0].Architecture, wantedPlatforms[0].Variant, wantedPlatforms[0].OS) } // Serialize returns the list in a blob format. // NOTE: Serialize() does not in general reproduce the original blob if this object was loaded from one, even if no modifications were made! func (list *Schema2ListPublic) Serialize() ([]byte, error) { buf, err := json.Marshal(list) if err != nil { return nil, fmt.Errorf("marshaling Schema2List %#v: %w", list, err) } return buf, nil } // Schema2ListPublicFromComponents creates a Schema2 manifest list instance from the // supplied data. // This is publicly visible as c/image/manifest.Schema2ListFromComponents. func Schema2ListPublicFromComponents(components []Schema2ManifestDescriptor) *Schema2ListPublic { list := Schema2ListPublic{ SchemaVersion: 2, MediaType: DockerV2ListMediaType, Manifests: make([]Schema2ManifestDescriptor, len(components)), } for i, component := range components { m := Schema2ManifestDescriptor{ Schema2Descriptor{ MediaType: component.MediaType, Size: component.Size, Digest: component.Digest, URLs: slices.Clone(component.URLs), }, Schema2PlatformSpec{ Architecture: component.Platform.Architecture, OS: component.Platform.OS, OSVersion: component.Platform.OSVersion, OSFeatures: slices.Clone(component.Platform.OSFeatures), Variant: component.Platform.Variant, Features: slices.Clone(component.Platform.Features), }, } list.Manifests[i] = m } return &list } // Schema2ListPublicClone creates a deep copy of the passed-in list. // This is publicly visible as c/image/manifest.Schema2ListClone. func Schema2ListPublicClone(list *Schema2ListPublic) *Schema2ListPublic { return Schema2ListPublicFromComponents(list.Manifests) } // ToOCI1Index returns the list encoded as an OCI1 index. func (list *Schema2ListPublic) ToOCI1Index() (*OCI1IndexPublic, error) { components := make([]imgspecv1.Descriptor, 0, len(list.Manifests)) for _, manifest := range list.Manifests { platform := ociPlatformFromSchema2PlatformSpec(manifest.Platform) components = append(components, imgspecv1.Descriptor{ MediaType: manifest.MediaType, Size: manifest.Size, Digest: manifest.Digest, URLs: slices.Clone(manifest.URLs), Platform: &platform, }) } oci := OCI1IndexPublicFromComponents(components, nil) return oci, nil } // ToSchema2List returns the list encoded as a Schema2 list. func (list *Schema2ListPublic) ToSchema2List() (*Schema2ListPublic, error) { return Schema2ListPublicClone(list), nil } // Schema2ListPublicFromManifest creates a Schema2 manifest list instance from marshalled // JSON, presumably generated by encoding a Schema2 manifest list. // This is publicly visible as c/image/manifest.Schema2ListFromManifest. func Schema2ListPublicFromManifest(manifest []byte) (*Schema2ListPublic, error) { list := Schema2ListPublic{ Manifests: []Schema2ManifestDescriptor{}, } if err := json.Unmarshal(manifest, &list); err != nil { return nil, fmt.Errorf("unmarshaling Schema2List %q: %w", string(manifest), err) } if err := ValidateUnambiguousManifestFormat(manifest, DockerV2ListMediaType, AllowedFieldManifests); err != nil { return nil, err } return &list, nil } // Clone returns a deep copy of this list and its contents. func (list *Schema2ListPublic) Clone() ListPublic { return Schema2ListPublicClone(list) } // ConvertToMIMEType converts the passed-in manifest list to a manifest // list of the specified type. func (list *Schema2ListPublic) ConvertToMIMEType(manifestMIMEType string) (ListPublic, error) { switch normalized := NormalizedMIMEType(manifestMIMEType); normalized { case DockerV2ListMediaType: return list.Clone(), nil case imgspecv1.MediaTypeImageIndex: return list.ToOCI1Index() case DockerV2Schema1MediaType, DockerV2Schema1SignedMediaType, imgspecv1.MediaTypeImageManifest, DockerV2Schema2MediaType: return nil, fmt.Errorf("Can not convert manifest list to MIME type %q, which is not a list type", manifestMIMEType) default: // Note that this may not be reachable, NormalizedMIMEType has a default for unknown values. return nil, fmt.Errorf("Unimplemented manifest list MIME type %s", manifestMIMEType) } } // Schema2List is a list of platform-specific manifests. type Schema2List struct { Schema2ListPublic } func schema2ListFromPublic(public *Schema2ListPublic) *Schema2List { return &Schema2List{*public} } func (list *Schema2List) CloneInternal() List { return schema2ListFromPublic(Schema2ListPublicClone(&list.Schema2ListPublic)) } func (list *Schema2List) Clone() ListPublic { return list.CloneInternal() } // Schema2ListFromManifest creates a Schema2 manifest list instance from marshalled // JSON, presumably generated by encoding a Schema2 manifest list. func Schema2ListFromManifest(manifest []byte) (*Schema2List, error) { public, err := Schema2ListPublicFromManifest(manifest) if err != nil { return nil, err } return schema2ListFromPublic(public), nil } // ociPlatformFromSchema2PlatformSpec converts a schema2 platform p to the OCI struccture. func ociPlatformFromSchema2PlatformSpec(p Schema2PlatformSpec) imgspecv1.Platform { return imgspecv1.Platform{ Architecture: p.Architecture, OS: p.OS, OSVersion: p.OSVersion, OSFeatures: slices.Clone(p.OSFeatures), Variant: p.Variant, // Features is not supported in OCI, and discarded. } } ================================================ FILE: vendor/go.podman.io/image/v5/internal/manifest/errors.go ================================================ package manifest import ( "fmt" imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" ) // FIXME: This is a duplicate of c/image/manifestDockerV2Schema2ConfigMediaType. // Deduplicate that, depending on outcome of https://github.com/containers/image/pull/1791 . const dockerV2Schema2ConfigMediaType = "application/vnd.docker.container.image.v1+json" // NonImageArtifactError (detected via errors.As) is used when asking for an image-specific operation // on an object which is not a “container image” in the standard sense (e.g. an OCI artifact) // // This is publicly visible as c/image/manifest.NonImageArtifactError (but we don’t provide a public constructor) type NonImageArtifactError struct { // Callers should not be blindly calling image-specific operations and only checking MIME types // on failure; if they care about the artifact type, they should check before using it. // If they blindly assume an image, they don’t really need this value; just a type check // is sufficient for basic "we can only pull images" UI. // // Also, there are fairly widespread “artifacts” which nevertheless use imgspecv1.MediaTypeImageConfig, // e.g. https://github.com/sigstore/cosign/blob/main/specs/SIGNATURE_SPEC.md , which could cause the callers // to complain about a non-image artifact with the correct MIME type; we should probably add some other kind of // type discrimination, _and_ somehow make it available in the API, if we expect API callers to make decisions // based on that kind of data. // // So, let’s not expose this until a specific need is identified. mimeType string } // NewNonImageArtifactError returns a NonImageArtifactError about an artifact manifest. // // This is typically called if manifest.Config.MediaType != imgspecv1.MediaTypeImageConfig . func NewNonImageArtifactError(manifest *imgspecv1.Manifest) error { // Callers decide based on manifest.Config.MediaType that this is not an image; // in that case manifest.ArtifactType can be optionally defined, and if it is, it is typically // more relevant because config may be ~absent with imgspecv1.MediaTypeEmptyJSON. // // If ArtifactType and Config.MediaType are both defined and non-trivial, presumably // ArtifactType is the “top-level” one, although that’s not defined by the spec. mimeType := manifest.ArtifactType if mimeType == "" { mimeType = manifest.Config.MediaType } return NonImageArtifactError{mimeType: mimeType} } func (e NonImageArtifactError) Error() string { // Special-case these invalid mixed images, which show up from time to time: if e.mimeType == dockerV2Schema2ConfigMediaType { return fmt.Sprintf("invalid mixed OCI image with Docker v2s2 config (%q)", e.mimeType) } return fmt.Sprintf("unsupported image-specific operation on artifact with type %q", e.mimeType) } ================================================ FILE: vendor/go.podman.io/image/v5/internal/manifest/list.go ================================================ package manifest import ( "fmt" digest "github.com/opencontainers/go-digest" imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" compression "go.podman.io/image/v5/pkg/compression/types" "go.podman.io/image/v5/types" ) // ListPublic is a subset of List which is a part of the public API; // so no methods can be added, removed or changed. // // Internal users should usually use List instead. type ListPublic interface { // MIMEType returns the MIME type of this particular manifest list. MIMEType() string // Instances returns a list of the manifests that this list knows of, other than its own. Instances() []digest.Digest // Update information about the list's instances. The length of the passed-in slice must // match the length of the list of instances which the list already contains, and every field // must be specified. UpdateInstances([]ListUpdate) error // Instance returns the size and MIME type of a particular instance in the list. Instance(digest.Digest) (ListUpdate, error) // ChooseInstance selects which manifest is most appropriate for the platform described by the // SystemContext, or for the current platform if the SystemContext doesn't specify any details. ChooseInstance(ctx *types.SystemContext) (digest.Digest, error) // Serialize returns the list in a blob format. // NOTE: Serialize() does not in general reproduce the original blob if this object was loaded // from, even if no modifications were made! Serialize() ([]byte, error) // ConvertToMIMEType returns the list rebuilt to the specified MIME type, or an error. ConvertToMIMEType(mimeType string) (ListPublic, error) // Clone returns a deep copy of this list and its contents. Clone() ListPublic } // List is an interface for parsing, modifying lists of image manifests. // Callers can either use this abstract interface without understanding the details of the formats, // or instantiate a specific implementation (e.g. manifest.OCI1Index) and access the public members // directly. type List interface { ListPublic // CloneInternal returns a deep copy of this list and its contents. CloneInternal() List // ChooseInstanceInstanceByCompression selects which manifest is most appropriate for the platform and compression described by the // SystemContext ( or for the current platform if the SystemContext doesn't specify any detail ) and preferGzip for compression which // when configured to OptionalBoolTrue and chooses best available compression when it is OptionalBoolFalse or left OptionalBoolUndefined. ChooseInstanceByCompression(ctx *types.SystemContext, preferGzip types.OptionalBool) (digest.Digest, error) // EditInstances edits information about the list's instances, based on instructions in editInstances. // If cannotModifyManifest, avoidable updates should be skipped. EditInstances(editInstances []ListEdit, cannotModifyManifest bool) error } // ListUpdate includes the fields which a List's UpdateInstances() method will modify. // This is publicly visible as c/image/manifest.ListUpdate. type ListUpdate struct { Digest digest.Digest Size int64 MediaType string // ReadOnly fields: may be set by Instance(), ignored by UpdateInstance() ReadOnly struct { Platform *imgspecv1.Platform Annotations map[string]string CompressionAlgorithmNames []string ArtifactType string } } type ListOp int const ( listOpInvalid ListOp = iota ListOpAdd ListOpUpdate ) // ListEdit includes the fields which a List's EditInstances() method will modify. type ListEdit struct { ListOperation ListOp // if Op == ListEditUpdate (basically the previous UpdateInstances). All fields must be set. UpdateOldDigest digest.Digest UpdateDigest digest.Digest UpdateSize int64 UpdateMediaType string UpdateAffectAnnotations bool UpdateAnnotations map[string]string UpdateCompressionAlgorithms []compression.Algorithm // If Op = ListEditAdd. All fields must be set. AddDigest digest.Digest AddSize int64 AddMediaType string AddArtifactType string AddPlatform *imgspecv1.Platform AddAnnotations map[string]string AddCompressionAlgorithms []compression.Algorithm } // ListPublicFromBlob parses a list of manifests. // This is publicly visible as c/image/manifest.ListFromBlob. func ListPublicFromBlob(manifest []byte, manifestMIMEType string) (ListPublic, error) { list, err := ListFromBlob(manifest, manifestMIMEType) if err != nil { return nil, err } return list, nil } // ListFromBlob parses a list of manifests. func ListFromBlob(manifest []byte, manifestMIMEType string) (List, error) { normalized := NormalizedMIMEType(manifestMIMEType) switch normalized { case DockerV2ListMediaType: return Schema2ListFromManifest(manifest) case imgspecv1.MediaTypeImageIndex: return OCI1IndexFromManifest(manifest) case DockerV2Schema1MediaType, DockerV2Schema1SignedMediaType, imgspecv1.MediaTypeImageManifest, DockerV2Schema2MediaType: return nil, fmt.Errorf("Treating single images as manifest lists is not implemented") } return nil, fmt.Errorf("Unimplemented manifest list MIME type %q (normalized as %q)", manifestMIMEType, normalized) } ================================================ FILE: vendor/go.podman.io/image/v5/internal/manifest/manifest.go ================================================ package manifest import ( "encoding/json" "slices" "github.com/containers/libtrust" digest "github.com/opencontainers/go-digest" imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" compressiontypes "go.podman.io/image/v5/pkg/compression/types" ) // FIXME: Should we just use docker/distribution and docker/docker implementations directly? // FIXME(runcom, mitr): should we have a mediatype pkg?? const ( // DockerV2Schema1MediaType MIME type represents Docker manifest schema 1 DockerV2Schema1MediaType = "application/vnd.docker.distribution.manifest.v1+json" // DockerV2Schema1SignedMediaType MIME type represents Docker manifest schema 1 with a JWS signature DockerV2Schema1SignedMediaType = "application/vnd.docker.distribution.manifest.v1+prettyjws" // DockerV2Schema2MediaType MIME type represents Docker manifest schema 2 DockerV2Schema2MediaType = "application/vnd.docker.distribution.manifest.v2+json" // DockerV2Schema2ConfigMediaType is the MIME type used for schema 2 config blobs. DockerV2Schema2ConfigMediaType = "application/vnd.docker.container.image.v1+json" // DockerV2Schema2LayerMediaType is the MIME type used for schema 2 layers. DockerV2Schema2LayerMediaType = "application/vnd.docker.image.rootfs.diff.tar.gzip" // DockerV2SchemaLayerMediaTypeUncompressed is the mediaType used for uncompressed layers. DockerV2SchemaLayerMediaTypeUncompressed = "application/vnd.docker.image.rootfs.diff.tar" // DockerV2SchemaLayerMediaTypeZstd is the MIME type used for schema 2 layers. DockerV2SchemaLayerMediaTypeZstd = "application/vnd.docker.image.rootfs.diff.tar.zstd" // DockerV2ListMediaType MIME type represents Docker manifest schema 2 list DockerV2ListMediaType = "application/vnd.docker.distribution.manifest.list.v2+json" // DockerV2Schema2ForeignLayerMediaType is the MIME type used for schema 2 foreign layers. DockerV2Schema2ForeignLayerMediaType = "application/vnd.docker.image.rootfs.foreign.diff.tar" // DockerV2Schema2ForeignLayerMediaTypeGzip is the MIME type used for gzipped schema 2 foreign layers. DockerV2Schema2ForeignLayerMediaTypeGzip = "application/vnd.docker.image.rootfs.foreign.diff.tar.gzip" ) // GuessMIMEType guesses MIME type of a manifest and returns it _if it is recognized_, or "" if unknown or unrecognized. // FIXME? We should, in general, prefer out-of-band MIME type instead of blindly parsing the manifest, // but we may not have such metadata available (e.g. when the manifest is a local file). // This is publicly visible as c/image/manifest.GuessMIMEType. func GuessMIMEType(manifest []byte) string { // A subset of manifest fields; the rest is silently ignored by json.Unmarshal. // Also docker/distribution/manifest.Versioned. meta := struct { MediaType string `json:"mediaType"` SchemaVersion int `json:"schemaVersion"` Signatures any `json:"signatures"` }{} if err := json.Unmarshal(manifest, &meta); err != nil { return "" } switch meta.MediaType { case DockerV2Schema2MediaType, DockerV2ListMediaType, imgspecv1.MediaTypeImageManifest, imgspecv1.MediaTypeImageIndex: // A recognized type. return meta.MediaType } // this is the only way the function can return DockerV2Schema1MediaType, and recognizing that is essential for stripping the JWS signatures = computing the correct manifest digest. switch meta.SchemaVersion { case 1: if meta.Signatures != nil { return DockerV2Schema1SignedMediaType } return DockerV2Schema1MediaType case 2: // Best effort to understand if this is an OCI image since mediaType // wasn't in the manifest for OCI image-spec < 1.0.2. // For docker v2s2 meta.MediaType should have been set. But given the data, this is our best guess. ociMan := struct { Config struct { MediaType string `json:"mediaType"` } `json:"config"` }{} if err := json.Unmarshal(manifest, &ociMan); err != nil { return "" } switch ociMan.Config.MediaType { case imgspecv1.MediaTypeImageConfig: return imgspecv1.MediaTypeImageManifest case DockerV2Schema2ConfigMediaType: // This case should not happen since a Docker image // must declare a top-level media type and // `meta.MediaType` has already been checked. return DockerV2Schema2MediaType } // Maybe an image index or an OCI artifact. ociIndex := struct { Manifests []imgspecv1.Descriptor `json:"manifests"` }{} if err := json.Unmarshal(manifest, &ociIndex); err != nil { return "" } if len(ociIndex.Manifests) != 0 { if ociMan.Config.MediaType == "" { return imgspecv1.MediaTypeImageIndex } // FIXME: this is mixing media types of manifests and configs. return ociMan.Config.MediaType } // It's most likely an OCI artifact with a custom config media // type which is not (and cannot) be covered by the media-type // checks cabove. return imgspecv1.MediaTypeImageManifest } return "" } // Digest returns the digest of a docker manifest, with any necessary implied transformations like stripping v1s1 signatures. // This is publicly visible as c/image/manifest.Digest. func Digest(manifest []byte) (digest.Digest, error) { return DigestWithAlgorithm(manifest, digest.Canonical) } // DigestWithAlgorithm returns the digest of a docker manifest using the specified algorithm, // with any necessary implied transformations like stripping v1s1 signatures. // This is publicly visible as c/image/manifest.DigestWithAlgorithm. func DigestWithAlgorithm(manifest []byte, algo digest.Algorithm) (digest.Digest, error) { if GuessMIMEType(manifest) == DockerV2Schema1SignedMediaType { sig, err := libtrust.ParsePrettySignature(manifest, "signatures") if err != nil { return "", err } manifest, err = sig.Payload() if err != nil { // Coverage: This should never happen, libtrust's Payload() can fail only if joseBase64UrlDecode() fails, on a string // that libtrust itself has josebase64UrlEncode()d return "", err } } return algo.FromBytes(manifest), nil } // MatchesDigest returns true iff the manifest matches expectedDigest. // Error may be set if this returns false. // Note that this is not doing ConstantTimeCompare; by the time we get here, the cryptographic signature must already have been verified, // or we are not using a cryptographic channel and the attacker can modify the digest along with the manifest blob. // This is publicly visible as c/image/manifest.MatchesDigest. func MatchesDigest(manifest []byte, expectedDigest digest.Digest) (bool, error) { // This should eventually support various digest types. actualDigest, err := Digest(manifest) if err != nil { return false, err } return expectedDigest == actualDigest, nil } // NormalizedMIMEType returns the effective MIME type of a manifest MIME type returned by a server, // centralizing various workarounds. // This is publicly visible as c/image/manifest.NormalizedMIMEType. func NormalizedMIMEType(input string) string { switch input { // "application/json" is a valid v2s1 value per https://github.com/docker/distribution/blob/master/docs/spec/manifest-v2-1.md . // This works for now, when nothing else seems to return "application/json"; if that were not true, the mapping/detection might // need to happen within the ImageSource. case "application/json": return DockerV2Schema1SignedMediaType case DockerV2Schema1MediaType, DockerV2Schema1SignedMediaType, imgspecv1.MediaTypeImageManifest, imgspecv1.MediaTypeImageIndex, DockerV2Schema2MediaType, DockerV2ListMediaType: return input default: // If it's not a recognized manifest media type, or we have failed determining the type, we'll try one last time // to deserialize using v2s1 as per https://github.com/docker/distribution/blob/master/manifests.go#L108 // and https://github.com/docker/distribution/blob/master/manifest/schema1/manifest.go#L50 // // Crane registries can also return "text/plain", or pretty much anything else depending on a file extension “recognized” in the tag. // This makes no real sense, but it happens // because requests for manifests are // redirected to a content distribution // network which is configured that way. See https://bugzilla.redhat.com/show_bug.cgi?id=1389442 return DockerV2Schema1SignedMediaType } } // CompressionAlgorithmIsUniversallySupported returns true if MIMETypeSupportsCompressionAlgorithm(mimeType, algo) returns true for all mimeType values. func CompressionAlgorithmIsUniversallySupported(algo compressiontypes.Algorithm) bool { // Compare the discussion about BaseVariantName in MIMETypeSupportsCompressionAlgorithm(). switch algo.Name() { case compressiontypes.GzipAlgorithmName: return true default: return false } } // MIMETypeSupportsCompressionAlgorithm returns true if mimeType can represent algo. func MIMETypeSupportsCompressionAlgorithm(mimeType string, algo compressiontypes.Algorithm) bool { if CompressionAlgorithmIsUniversallySupported(algo) { return true } // This does not use BaseVariantName: Plausibly a manifest format might support zstd but not have annotation fields. // The logic might have to be more complex (and more ad-hoc) if more manifest formats, with more capabilities, emerge. switch algo.Name() { case compressiontypes.ZstdAlgorithmName, compressiontypes.ZstdChunkedAlgorithmName: return mimeType == imgspecv1.MediaTypeImageManifest default: // Includes Bzip2AlgorithmName and XzAlgorithmName, which are defined names but are not supported anywhere return false } } // ReuseConditions are an input to CandidateCompressionMatchesReuseConditions; // it is a struct to allow longer and better-documented field names. type ReuseConditions struct { PossibleManifestFormats []string // If set, a set of possible manifest formats; at least one should support the reused layer RequiredCompression *compressiontypes.Algorithm // If set, only reuse layers with a matching algorithm } // CandidateCompressionMatchesReuseConditions returns true if a layer with candidateCompression // (which can be nil to represent uncompressed or unknown) matches reuseConditions. func CandidateCompressionMatchesReuseConditions(c ReuseConditions, candidateCompression *compressiontypes.Algorithm) bool { if c.RequiredCompression != nil { if candidateCompression == nil || (c.RequiredCompression.Name() != candidateCompression.Name() && c.RequiredCompression.Name() != candidateCompression.BaseVariantName()) { return false } } // For candidateCompression == nil, we can’t tell the difference between “uncompressed” and “unknown”; // and “uncompressed” is acceptable in all known formats (well, it seems to work in practice for schema1), // so don’t impose any restrictions if candidateCompression == nil if c.PossibleManifestFormats != nil && candidateCompression != nil { if !slices.ContainsFunc(c.PossibleManifestFormats, func(mt string) bool { return MIMETypeSupportsCompressionAlgorithm(mt, *candidateCompression) }) { return false } } return true } ================================================ FILE: vendor/go.podman.io/image/v5/internal/manifest/oci_index.go ================================================ package manifest import ( "bytes" "encoding/json" "fmt" "maps" "math" "runtime" "slices" "github.com/opencontainers/go-digest" imgspec "github.com/opencontainers/image-spec/specs-go" imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" platform "go.podman.io/image/v5/internal/pkg/platform" compression "go.podman.io/image/v5/pkg/compression/types" "go.podman.io/image/v5/types" ) const ( // OCI1InstanceAnnotationCompressionZSTD is an annotation name that can be placed on a manifest descriptor in an OCI index. // The value of the annotation must be the string "true". // If this annotation is present on a manifest, consuming that image instance requires support for Zstd compression. // That also suggests that this instance benefits from // Zstd compression, so it can be preferred by compatible consumers over instances that // use gzip, depending on their local policy. OCI1InstanceAnnotationCompressionZSTD = "io.github.containers.compression.zstd" OCI1InstanceAnnotationCompressionZSTDValue = "true" ) // OCI1IndexPublic is just an alias for the OCI index type, but one which we can // provide methods for. // This is publicly visible as c/image/manifest.OCI1Index // Internal users should usually use OCI1Index instead. type OCI1IndexPublic struct { imgspecv1.Index } // MIMEType returns the MIME type of this particular manifest index. func (index *OCI1IndexPublic) MIMEType() string { return imgspecv1.MediaTypeImageIndex } // Instances returns a slice of digests of the manifests that this index knows of. func (index *OCI1IndexPublic) Instances() []digest.Digest { results := make([]digest.Digest, len(index.Manifests)) for i, m := range index.Manifests { results[i] = m.Digest } return results } // Instance returns the ListUpdate of a particular instance in the index. func (index *OCI1IndexPublic) Instance(instanceDigest digest.Digest) (ListUpdate, error) { for _, manifest := range index.Manifests { if manifest.Digest == instanceDigest { ret := ListUpdate{ Digest: manifest.Digest, Size: manifest.Size, MediaType: manifest.MediaType, } ret.ReadOnly.Platform = manifest.Platform ret.ReadOnly.Annotations = manifest.Annotations ret.ReadOnly.CompressionAlgorithmNames = annotationsToCompressionAlgorithmNames(manifest.Annotations) ret.ReadOnly.ArtifactType = manifest.ArtifactType return ret, nil } } return ListUpdate{}, fmt.Errorf("unable to find instance %s in OCI1Index", instanceDigest) } // UpdateInstances updates the sizes, digests, and media types of the manifests // which the list catalogs. func (index *OCI1IndexPublic) UpdateInstances(updates []ListUpdate) error { editInstances := []ListEdit{} for i, instance := range updates { editInstances = append(editInstances, ListEdit{ UpdateOldDigest: index.Manifests[i].Digest, UpdateDigest: instance.Digest, UpdateSize: instance.Size, UpdateMediaType: instance.MediaType, ListOperation: ListOpUpdate, }) } return index.editInstances(editInstances, false) } func annotationsToCompressionAlgorithmNames(annotations map[string]string) []string { result := make([]string, 0, 1) if annotations[OCI1InstanceAnnotationCompressionZSTD] == OCI1InstanceAnnotationCompressionZSTDValue { result = append(result, compression.ZstdAlgorithmName) } // No compression was detected, hence assume instance has default compression `Gzip` if len(result) == 0 { result = append(result, compression.GzipAlgorithmName) } return result } // addCompressionAnnotations updates annotationsMap for a manifest, based on compressionAlgorithms known to be used in that instance. // If cannotModifyManifest, avoidable updates should be skipped (i.e. this does nothing, because the algorithm annotation is “only” used for prioritization). func addCompressionAnnotations(compressionAlgorithms []compression.Algorithm, annotationsMap *map[string]string, cannotModifyManifest bool) { if cannotModifyManifest { return } // TODO: This should also delete the algorithm if map already contains an algorithm and compressionAlgorithm // list has a different algorithm. To do that, we would need to modify the callers to always provide a reliable // and full compressionAlghorithms list. if *annotationsMap == nil && len(compressionAlgorithms) > 0 { *annotationsMap = map[string]string{} } for _, algo := range compressionAlgorithms { switch algo.BaseVariantName() { case compression.ZstdAlgorithmName: (*annotationsMap)[OCI1InstanceAnnotationCompressionZSTD] = OCI1InstanceAnnotationCompressionZSTDValue default: continue } } } // editInstances edits information about the list's instances, based on instructions in editInstances. // If cannotModifyManifest, avoidable updates should be skipped. func (index *OCI1IndexPublic) editInstances(editInstances []ListEdit, cannotModifyManifest bool) error { addedEntries := []imgspecv1.Descriptor{} updatedAnnotations := false for i, editInstance := range editInstances { switch editInstance.ListOperation { case ListOpUpdate: if err := editInstance.UpdateOldDigest.Validate(); err != nil { return fmt.Errorf("OCI1Index.EditInstances: Attempting to update %s which is an invalid digest: %w", editInstance.UpdateOldDigest, err) } if err := editInstance.UpdateDigest.Validate(); err != nil { return fmt.Errorf("OCI1Index.EditInstances: Modified digest %s is an invalid digest: %w", editInstance.UpdateDigest, err) } targetIndex := slices.IndexFunc(index.Manifests, func(m imgspecv1.Descriptor) bool { return m.Digest == editInstance.UpdateOldDigest }) if targetIndex == -1 { return fmt.Errorf("OCI1Index.EditInstances: digest %s not found", editInstance.UpdateOldDigest) } index.Manifests[targetIndex].Digest = editInstance.UpdateDigest if editInstance.UpdateSize < 0 { return fmt.Errorf("update %d of %d passed to OCI1Index.UpdateInstances had an invalid size (%d)", i+1, len(editInstances), editInstance.UpdateSize) } index.Manifests[targetIndex].Size = editInstance.UpdateSize if editInstance.UpdateMediaType == "" { return fmt.Errorf("update %d of %d passed to OCI1Index.UpdateInstances had no media type (was %q)", i+1, len(editInstances), index.Manifests[i].MediaType) } index.Manifests[targetIndex].MediaType = editInstance.UpdateMediaType if editInstance.UpdateAnnotations != nil { updatedAnnotations = true if editInstance.UpdateAffectAnnotations { index.Manifests[targetIndex].Annotations = maps.Clone(editInstance.UpdateAnnotations) } else { if index.Manifests[targetIndex].Annotations == nil { index.Manifests[targetIndex].Annotations = map[string]string{} } maps.Copy(index.Manifests[targetIndex].Annotations, editInstance.UpdateAnnotations) } } // FIXME: This does not set updatedAnnotations, so we don’t re-sort images with Zstd instances if some other // tool created them without the OCI1InstanceAnnotationCompressionZSTD annotation. addCompressionAnnotations(editInstance.UpdateCompressionAlgorithms, &index.Manifests[targetIndex].Annotations, cannotModifyManifest) case ListOpAdd: annotations := map[string]string{} if editInstance.AddAnnotations != nil { annotations = maps.Clone(editInstance.AddAnnotations) } addCompressionAnnotations(editInstance.AddCompressionAlgorithms, &annotations, false) // We are adding a full new entry, so skipping the annotation would still not allow preserving the original manifest. addedEntries = append(addedEntries, imgspecv1.Descriptor{ MediaType: editInstance.AddMediaType, ArtifactType: editInstance.AddArtifactType, Size: editInstance.AddSize, Digest: editInstance.AddDigest, Platform: editInstance.AddPlatform, Annotations: annotations, }) default: return fmt.Errorf("internal error: invalid operation: %d", editInstance.ListOperation) } } if len(addedEntries) != 0 { // slices.Clone() here to ensure the slice uses a private backing array; // an external caller could have manually created OCI1IndexPublic with a slice with extra capacity. index.Manifests = append(slices.Clone(index.Manifests), addedEntries...) } if len(addedEntries) != 0 || updatedAnnotations { slices.SortStableFunc(index.Manifests, func(a, b imgspecv1.Descriptor) int { // FIXME? With Go 1.21 and cmp.Compare available, turn instanceIsZstd into an integer score that can be compared, and generalizes // into more algorithms? aZstd := instanceIsZstd(a) bZstd := instanceIsZstd(b) switch { case aZstd == bZstd: return 0 case !aZstd: // Implies bZstd return -1 default: // aZstd && !bZstd return 1 } }) } return nil } // EditInstances edits information about the list's instances, based on instructions in editInstances. // If cannotModifyManifest, avoidable updates should be skipped. func (index *OCI1Index) EditInstances(editInstances []ListEdit, cannotModifyManifest bool) error { return index.editInstances(editInstances, cannotModifyManifest) } // instanceIsZstd returns true if instance is a zstd instance otherwise false. func instanceIsZstd(manifest imgspecv1.Descriptor) bool { if value, ok := manifest.Annotations[OCI1InstanceAnnotationCompressionZSTD]; ok && value == "true" { return true } return false } type instanceCandidate struct { platformIndex int // Index of the candidate in platform.WantedPlatforms: lower numbers are preferred; or math.maxInt if the candidate doesn’t have a platform isZstd bool // tells if particular instance if zstd instance manifestPosition int // A zero-based index of the instance in the manifest list digest digest.Digest // Instance digest } func (ic instanceCandidate) isPreferredOver(other *instanceCandidate, preferGzip types.OptionalBool) bool { switch { case ic.platformIndex != other.platformIndex: return ic.platformIndex < other.platformIndex case ic.isZstd != other.isZstd: if preferGzip != types.OptionalBoolTrue { return ic.isZstd } else { return !ic.isZstd } case ic.manifestPosition != other.manifestPosition: return ic.manifestPosition < other.manifestPosition } panic("internal error: invalid comparison between two candidates") // This should not be reachable because in all calls we make, the two candidates differ at least in manifestPosition. } // chooseInstance is a private equivalent to ChooseInstanceByCompression, // shared by ChooseInstance and ChooseInstanceByCompression. func (index *OCI1IndexPublic) chooseInstance(ctx *types.SystemContext, preferGzip types.OptionalBool) (digest.Digest, error) { wantedPlatforms := platform.WantedPlatforms(ctx) var bestMatch *instanceCandidate bestMatch = nil for manifestIndex, d := range index.Manifests { candidate := instanceCandidate{platformIndex: math.MaxInt, manifestPosition: manifestIndex, isZstd: instanceIsZstd(d), digest: d.Digest} if d.Platform != nil { imagePlatform := ociPlatformClone(*d.Platform) platformIndex := slices.IndexFunc(wantedPlatforms, func(wantedPlatform imgspecv1.Platform) bool { return platform.MatchesPlatform(imagePlatform, wantedPlatform) }) if platformIndex == -1 { continue } candidate.platformIndex = platformIndex } if bestMatch == nil || candidate.isPreferredOver(bestMatch, preferGzip) { bestMatch = &candidate } } if bestMatch != nil { return bestMatch.digest, nil } return "", fmt.Errorf("no image found in image index for architecture %q, variant %q, OS %q", wantedPlatforms[0].Architecture, wantedPlatforms[0].Variant, wantedPlatforms[0].OS) } func (index *OCI1Index) ChooseInstanceByCompression(ctx *types.SystemContext, preferGzip types.OptionalBool) (digest.Digest, error) { return index.chooseInstance(ctx, preferGzip) } // ChooseInstance parses blob as an oci v1 manifest index, and returns the digest // of the image which is appropriate for the current environment. func (index *OCI1IndexPublic) ChooseInstance(ctx *types.SystemContext) (digest.Digest, error) { return index.chooseInstance(ctx, types.OptionalBoolFalse) } // Serialize returns the index in a blob format. // NOTE: Serialize() does not in general reproduce the original blob if this object was loaded from one, even if no modifications were made! func (index *OCI1IndexPublic) Serialize() ([]byte, error) { buf, err := json.Marshal(index) if err != nil { return nil, fmt.Errorf("marshaling OCI1Index %#v: %w", index, err) } return buf, nil } // OCI1IndexPublicFromComponents creates an OCI1 image index instance from the // supplied data. // This is publicly visible as c/image/manifest.OCI1IndexFromComponents. func OCI1IndexPublicFromComponents(components []imgspecv1.Descriptor, annotations map[string]string) *OCI1IndexPublic { index := OCI1IndexPublic{ imgspecv1.Index{ Versioned: imgspec.Versioned{SchemaVersion: 2}, MediaType: imgspecv1.MediaTypeImageIndex, Manifests: make([]imgspecv1.Descriptor, len(components)), Annotations: maps.Clone(annotations), }, } for i, component := range components { index.Manifests[i] = oci1DescriptorClone(component) } return &index } func oci1DescriptorClone(d imgspecv1.Descriptor) imgspecv1.Descriptor { var platform *imgspecv1.Platform if d.Platform != nil { platformCopy := ociPlatformClone(*d.Platform) platform = &platformCopy } return imgspecv1.Descriptor{ MediaType: d.MediaType, Digest: d.Digest, Size: d.Size, URLs: slices.Clone(d.URLs), Annotations: maps.Clone(d.Annotations), Data: bytes.Clone(d.Data), Platform: platform, ArtifactType: d.ArtifactType, } } // OCI1IndexPublicClone creates a deep copy of the passed-in index. // This is publicly visible as c/image/manifest.OCI1IndexClone. func OCI1IndexPublicClone(index *OCI1IndexPublic) *OCI1IndexPublic { var subject *imgspecv1.Descriptor if index.Subject != nil { s := oci1DescriptorClone(*index.Subject) subject = &s } manifests := make([]imgspecv1.Descriptor, len(index.Manifests)) for i, m := range index.Manifests { manifests[i] = oci1DescriptorClone(m) } return &OCI1IndexPublic{ Index: imgspecv1.Index{ Versioned: index.Versioned, MediaType: index.MediaType, ArtifactType: index.ArtifactType, Manifests: manifests, Subject: subject, Annotations: maps.Clone(index.Annotations), }, } } // ToOCI1Index returns the index encoded as an OCI1 index. func (index *OCI1IndexPublic) ToOCI1Index() (*OCI1IndexPublic, error) { return OCI1IndexPublicClone(index), nil } // ToSchema2List returns the index encoded as a Schema2 list. func (index *OCI1IndexPublic) ToSchema2List() (*Schema2ListPublic, error) { components := make([]Schema2ManifestDescriptor, 0, len(index.Manifests)) for _, manifest := range index.Manifests { platform := manifest.Platform if platform == nil { platform = &imgspecv1.Platform{ OS: runtime.GOOS, Architecture: runtime.GOARCH, } } components = append(components, Schema2ManifestDescriptor{ Schema2Descriptor{ MediaType: manifest.MediaType, Size: manifest.Size, Digest: manifest.Digest, URLs: slices.Clone(manifest.URLs), }, schema2PlatformSpecFromOCIPlatform(*platform), }) } s2 := Schema2ListPublicFromComponents(components) return s2, nil } // OCI1IndexPublicFromManifest creates an OCI1 manifest index instance from marshalled // JSON, presumably generated by encoding a OCI1 manifest index. // This is publicly visible as c/image/manifest.OCI1IndexFromManifest. func OCI1IndexPublicFromManifest(manifest []byte) (*OCI1IndexPublic, error) { index := OCI1IndexPublic{ Index: imgspecv1.Index{ Versioned: imgspec.Versioned{SchemaVersion: 2}, MediaType: imgspecv1.MediaTypeImageIndex, Manifests: []imgspecv1.Descriptor{}, Annotations: make(map[string]string), }, } if err := json.Unmarshal(manifest, &index); err != nil { return nil, fmt.Errorf("unmarshaling OCI1Index %q: %w", string(manifest), err) } if err := ValidateUnambiguousManifestFormat(manifest, imgspecv1.MediaTypeImageIndex, AllowedFieldManifests); err != nil { return nil, err } return &index, nil } // Clone returns a deep copy of this list and its contents. func (index *OCI1IndexPublic) Clone() ListPublic { return OCI1IndexPublicClone(index) } // ConvertToMIMEType converts the passed-in image index to a manifest list of // the specified type. func (index *OCI1IndexPublic) ConvertToMIMEType(manifestMIMEType string) (ListPublic, error) { switch normalized := NormalizedMIMEType(manifestMIMEType); normalized { case DockerV2ListMediaType: return index.ToSchema2List() case imgspecv1.MediaTypeImageIndex: return index.Clone(), nil case DockerV2Schema1MediaType, DockerV2Schema1SignedMediaType, imgspecv1.MediaTypeImageManifest, DockerV2Schema2MediaType: return nil, fmt.Errorf("Can not convert image index to MIME type %q, which is not a list type", manifestMIMEType) default: // Note that this may not be reachable, NormalizedMIMEType has a default for unknown values. return nil, fmt.Errorf("Unimplemented manifest MIME type %s", manifestMIMEType) } } type OCI1Index struct { OCI1IndexPublic } func oci1IndexFromPublic(public *OCI1IndexPublic) *OCI1Index { return &OCI1Index{*public} } func (index *OCI1Index) CloneInternal() List { return oci1IndexFromPublic(OCI1IndexPublicClone(&index.OCI1IndexPublic)) } func (index *OCI1Index) Clone() ListPublic { return index.CloneInternal() } // OCI1IndexFromManifest creates a OCI1 manifest list instance from marshalled // JSON, presumably generated by encoding a OCI1 manifest list. func OCI1IndexFromManifest(manifest []byte) (*OCI1Index, error) { public, err := OCI1IndexPublicFromManifest(manifest) if err != nil { return nil, err } return oci1IndexFromPublic(public), nil } // ociPlatformClone returns an independent copy of p. func ociPlatformClone(p imgspecv1.Platform) imgspecv1.Platform { // The only practical way in Go to give read-only access to an array is to copy it. // The only practical way in Go to copy a deep structure is to either do it manually field by field, // or to use reflection (incl. a round-trip through JSON, which uses reflection). // // The combination of the two is just sad, and leads to code like this, which will // need to be updated with every new Platform field. return imgspecv1.Platform{ Architecture: p.Architecture, OS: p.OS, OSVersion: p.OSVersion, OSFeatures: slices.Clone(p.OSFeatures), Variant: p.Variant, } } // schema2PlatformSpecFromOCIPlatform converts an OCI platform p to the schema2 structure. func schema2PlatformSpecFromOCIPlatform(p imgspecv1.Platform) Schema2PlatformSpec { return Schema2PlatformSpec{ Architecture: p.Architecture, OS: p.OS, OSVersion: p.OSVersion, OSFeatures: slices.Clone(p.OSFeatures), Variant: p.Variant, Features: nil, } } ================================================ FILE: vendor/go.podman.io/image/v5/internal/multierr/multierr.go ================================================ package multierr import ( "fmt" "strings" ) // Format creates an error value from the input array (which should not be empty) // If the input contains a single error value, it is returned as is. // If there are multiple, they are formatted as a multi-error (with Unwrap() []error) with the provided initial, separator, and ending strings. // // Typical usage: // // var errs []error // // … // errs = append(errs, …) // // … // if errs != nil { return multierr.Format("Failures doing $FOO", "\n* ", "", errs)} func Format(first, middle, last string, errs []error) error { switch len(errs) { case 0: return fmt.Errorf("internal error: multierr.Format called with 0 errors") case 1: return errs[0] default: // We have to do this — and this function only really exists — because fmt.Errorf(format, errs...) is invalid: // []error is not a valid parameter to a function expecting []any anyErrs := make([]any, 0, len(errs)) for _, e := range errs { anyErrs = append(anyErrs, e) } return fmt.Errorf(first+"%w"+strings.Repeat(middle+"%w", len(errs)-1)+last, anyErrs...) } } ================================================ FILE: vendor/go.podman.io/image/v5/internal/pkg/platform/platform_matcher.go ================================================ package platform // Largely based on // https://github.com/moby/moby/blob/bc846d2e8fe5538220e0c31e9d0e8446f6fbc022/distribution/cpuinfo_unix.go // Copyright 2012-2017 Docker, Inc. // // https://github.com/containerd/containerd/blob/726dcaea50883e51b2ec6db13caff0e7936b711d/platforms/cpuinfo.go // Copyright The containerd Authors. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // https://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. import ( "bufio" "fmt" "os" "runtime" "slices" "strings" imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" "github.com/sirupsen/logrus" "go.podman.io/image/v5/types" ) // For Linux, the kernel has already detected the ABI, ISA and Features. // So we don't need to access the ARM registers to detect platform information // by ourselves. We can just parse these information from /proc/cpuinfo func getCPUInfo(pattern string) (info string, err error) { if runtime.GOOS != "linux" { return "", fmt.Errorf("getCPUInfo for OS %s not implemented", runtime.GOOS) } cpuinfo, err := os.Open("/proc/cpuinfo") if err != nil { return "", err } defer cpuinfo.Close() // Start to Parse the Cpuinfo line by line. For SMP SoC, we parse // the first core is enough. scanner := bufio.NewScanner(cpuinfo) for scanner.Scan() { newline := scanner.Text() list := strings.Split(newline, ":") if len(list) > 1 && strings.EqualFold(strings.TrimSpace(list[0]), pattern) { return strings.TrimSpace(list[1]), nil } } // Check whether the scanner encountered errors err = scanner.Err() if err != nil { return "", err } return "", fmt.Errorf("getCPUInfo for pattern: %s not found", pattern) } func getCPUVariantDarwinWindows(arch string) string { // Darwin and Windows only support v7 for ARM32 and v8 for ARM64 and so we can use // runtime.GOARCH to determine the variants var variant string switch arch { case "arm64": variant = "v8" case "arm": variant = "v7" default: variant = "" } return variant } func getCPUVariantArm() string { variant, err := getCPUInfo("Cpu architecture") if err != nil { logrus.Errorf("Couldn't get cpu architecture: %v", err) return "" } switch strings.ToLower(variant) { case "8", "aarch64": variant = "v8" case "7m", "?(12)", "?(13)", "?(14)", "?(15)", "?(16)", "?(17)": variant = "v7" case "7": // handle RPi Zero variant mismatch due to wrong variant from kernel // https://github.com/containerd/containerd/pull/4530 // https://www.raspberrypi.org/forums/viewtopic.php?t=12614 // https://github.com/moby/moby/pull/36121#issuecomment-398328286 model, err := getCPUInfo("model name") if err != nil { logrus.Errorf("Couldn't get cpu model name, it may be the corner case where variant is 6: %v", err) return "" } // model name is NOT a value provided by the CPU; it is another outcome of Linux CPU detection, // https://github.com/torvalds/linux/blob/190bf7b14b0cf3df19c059061be032bd8994a597/arch/arm/mm/proc-v6.S#L178C35-L178C35 // (matching happens based on value + mask at https://github.com/torvalds/linux/blob/190bf7b14b0cf3df19c059061be032bd8994a597/arch/arm/mm/proc-v6.S#L273-L274 ) // ARM CPU ID starts with a “main” ID register https://developer.arm.com/documentation/ddi0406/cb/System-Level-Architecture/System-Control-Registers-in-a-VMSA-implementation/VMSA-System-control-registers-descriptions--in-register-order/MIDR--Main-ID-Register--VMSA?lang=en , // but the ARMv6/ARMv7 differences are not a single dimension, https://developer.arm.com/documentation/ddi0406/cb/System-Level-Architecture/The-CPUID-Identification-Scheme?lang=en . // The Linux "cpu architecture" is determined by a “memory model” feature. // // So, the "armv6-compatible" check basically checks for a "v6 or v7 CPU, but not one found listed as a known v7 one in the .proc.info.init tables of // https://github.com/torvalds/linux/blob/190bf7b14b0cf3df19c059061be032bd8994a597/arch/arm/mm/proc-v7.S . if strings.HasPrefix(strings.ToLower(model), "armv6-compatible") { logrus.Debugf("Detected corner case, setting cpu variant to v6") variant = "v6" } else { variant = "v7" } case "6", "6tej": variant = "v6" case "5", "5t", "5te", "5tej": variant = "v5" case "4", "4t": variant = "v4" case "3": variant = "v3" default: variant = "" } return variant } func getCPUVariant(os string, arch string) string { if os == "darwin" || os == "windows" { return getCPUVariantDarwinWindows(arch) } if arch == "arm" || arch == "arm64" { return getCPUVariantArm() } return "" } // compatibility contains, for a specified architecture, a list of known variants, in the // order from most capable (most restrictive) to least capable (most compatible). // Architectures that don’t have variants should not have an entry here. var compatibility = map[string][]string{ "arm": {"v8", "v7", "v6", "v5"}, "arm64": {"v8"}, } // WantedPlatforms returns all compatible platforms with the platform specifics possibly overridden by user, // the most compatible platform is first. // If some option (arch, os, variant) is not present, a value from current platform is detected. func WantedPlatforms(ctx *types.SystemContext) []imgspecv1.Platform { // Note that this does not use Platform.OSFeatures and Platform.OSVersion at all. // The fields are not specified by the OCI specification, as of version 1.1, usefully enough // to be interoperable, anyway. wantedArch := runtime.GOARCH wantedVariant := "" if ctx != nil && ctx.ArchitectureChoice != "" { wantedArch = ctx.ArchitectureChoice } else { // Only auto-detect the variant if we are using the default architecture. // If the user has specified the ArchitectureChoice, don't autodetect, even if // ctx.ArchitectureChoice == runtime.GOARCH, because we have no idea whether the runtime.GOARCH // value is relevant to the use case, and if we do autodetect a variant, // ctx.VariantChoice can't be used to override it back to "". wantedVariant = getCPUVariant(runtime.GOOS, runtime.GOARCH) } if ctx != nil && ctx.VariantChoice != "" { wantedVariant = ctx.VariantChoice } wantedOS := runtime.GOOS if ctx != nil && ctx.OSChoice != "" { wantedOS = ctx.OSChoice } var variants []string = nil if wantedVariant != "" { // If the user requested a specific variant, we'll walk down // the list from most to least compatible. if variantOrder := compatibility[wantedArch]; variantOrder != nil { if i := slices.Index(variantOrder, wantedVariant); i != -1 { variants = variantOrder[i:] } } if variants == nil { // user wants a variant which we know nothing about - not even compatibility variants = []string{wantedVariant} } // Make sure to have a candidate with an empty variant as well. variants = append(variants, "") } else { // Make sure to have a candidate with an empty variant as well. variants = append(variants, "") // If available add the entire compatibility matrix for the specific architecture. if possibleVariants, ok := compatibility[wantedArch]; ok { variants = append(variants, possibleVariants...) } } res := make([]imgspecv1.Platform, 0, len(variants)) for _, v := range variants { res = append(res, imgspecv1.Platform{ OS: wantedOS, Architecture: wantedArch, Variant: v, }) } return res } // MatchesPlatform returns true if a platform descriptor from a multi-arch image matches // an item from the return value of WantedPlatforms. func MatchesPlatform(image imgspecv1.Platform, wanted imgspecv1.Platform) bool { return image.Architecture == wanted.Architecture && image.OS == wanted.OS && image.Variant == wanted.Variant } ================================================ FILE: vendor/go.podman.io/image/v5/internal/private/private.go ================================================ package private import ( "context" "io" "time" "github.com/opencontainers/go-digest" imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/internal/blobinfocache" "go.podman.io/image/v5/internal/signature" compression "go.podman.io/image/v5/pkg/compression/types" "go.podman.io/image/v5/types" ) // ImageSourceInternalOnly is the part of private.ImageSource that is not // a part of types.ImageSource. type ImageSourceInternalOnly interface { // SupportsGetBlobAt() returns true if GetBlobAt (BlobChunkAccessor) is supported. SupportsGetBlobAt() bool // BlobChunkAccessor.GetBlobAt is available only if SupportsGetBlobAt(). BlobChunkAccessor // GetSignaturesWithFormat returns the image's signatures. It may use a remote (= slow) service. // If instanceDigest is not nil, it contains a digest of the specific manifest instance to retrieve signatures for // (when the primary manifest is a manifest list); this never happens if the primary manifest is not a manifest list // (e.g. if the source never returns manifest lists). GetSignaturesWithFormat(ctx context.Context, instanceDigest *digest.Digest) ([]signature.Signature, error) } // ImageSource is an internal extension to the types.ImageSource interface. type ImageSource interface { types.ImageSource ImageSourceInternalOnly } // ImageDestinationInternalOnly is the part of private.ImageDestination that is not // a part of types.ImageDestination. type ImageDestinationInternalOnly interface { // SupportsPutBlobPartial returns true if PutBlobPartial is supported. SupportsPutBlobPartial() bool // FIXME: Add SupportsSignaturesWithFormat or something like that, to allow early failures // on unsupported formats. // NoteOriginalOCIConfig provides the config of the image, as it exists on the source, BUT converted to OCI format, // or an error obtaining that value (e.g. if the image is an artifact and not a container image). // The destination can use it in its TryReusingBlob/PutBlob implementations // (otherwise it only obtains the final config after all layers are written). NoteOriginalOCIConfig(ociConfig *imgspecv1.Image, configErr error) error // PutBlobWithOptions writes contents of stream and returns data representing the result. // inputInfo.Digest can be optionally provided if known; if provided, and stream is read to the end without error, the digest MUST match the stream contents. // inputInfo.Size is the expected length of stream, if known. // inputInfo.MediaType describes the blob format, if known. // WARNING: The contents of stream are being verified on the fly. Until stream.Read() returns io.EOF, the contents of the data SHOULD NOT be available // to any other readers for download using the supplied digest. // If stream.Read() at any time, ESPECIALLY at end of input, returns an error, PutBlobWithOptions MUST 1) fail, and 2) delete any data stored so far. PutBlobWithOptions(ctx context.Context, stream io.Reader, inputInfo types.BlobInfo, options PutBlobOptions) (UploadedBlob, error) // PutBlobPartial attempts to create a blob using the data that is already present // at the destination. chunkAccessor is accessed in a non-sequential way to retrieve the missing chunks. // It is available only if SupportsPutBlobPartial(). // Even if SupportsPutBlobPartial() returns true, the call can fail. // If the call fails with ErrFallbackToOrdinaryLayerDownload, the caller can fall back to PutBlobWithOptions. // The fallback _must not_ be done otherwise. PutBlobPartial(ctx context.Context, chunkAccessor BlobChunkAccessor, srcInfo types.BlobInfo, options PutBlobPartialOptions) (UploadedBlob, error) // TryReusingBlobWithOptions checks whether the transport already contains, or can efficiently reuse, a blob, and if so, applies it to the current destination // (e.g. if the blob is a filesystem layer, this signifies that the changes it describes need to be applied again when composing a filesystem tree). // info.Digest must not be empty. // If the blob has been successfully reused, returns (true, info, nil). // If the transport can not reuse the requested blob, TryReusingBlob returns (false, {}, nil); it returns a non-nil error only on an unexpected failure. TryReusingBlobWithOptions(ctx context.Context, info types.BlobInfo, options TryReusingBlobOptions) (bool, ReusedBlob, error) // PutSignaturesWithFormat writes a set of signatures to the destination. // If instanceDigest is not nil, it contains a digest of the specific manifest instance to write or overwrite the signatures for // (when the primary manifest is a manifest list); this should always be nil if the primary manifest is not a manifest list. // MUST be called after PutManifest (signatures may reference manifest contents). PutSignaturesWithFormat(ctx context.Context, signatures []signature.Signature, instanceDigest *digest.Digest) error // CommitWithOptions marks the process of storing the image as successful and asks for the image to be persisted. // WARNING: This does not have any transactional semantics: // - Uploaded data MAY be visible to others before CommitWithOptions() is called // - Uploaded data MAY be removed or MAY remain around if Close() is called without CommitWithOptions() (i.e. rollback is allowed but not guaranteed) CommitWithOptions(ctx context.Context, options CommitOptions) error } // ImageDestination is an internal extension to the types.ImageDestination // interface. type ImageDestination interface { types.ImageDestination ImageDestinationInternalOnly } // UploadedBlob is information about a blob written to a destination. // It is the subset of types.BlobInfo fields the transport is responsible for setting; all fields must be provided. type UploadedBlob struct { Digest digest.Digest Size int64 } // PutBlobOptions are used in PutBlobWithOptions. type PutBlobOptions struct { Cache blobinfocache.BlobInfoCache2 // Cache to optionally update with the uploaded bloblook up blob infos. IsConfig bool // True if the blob is a config // The following fields are new to internal/private. Users of internal/private MUST fill them in, // but they also must expect that they will be ignored by types.ImageDestination transports. // Transports, OTOH, MUST support these fields being zero-valued for types.ImageDestination callers // if they use internal/imagedestination/impl.Compat; // in that case, they will all be consistently zero-valued. EmptyLayer bool // True if the blob is an "empty"/"throwaway" layer, and may not necessarily be physically represented. LayerIndex *int // If the blob is a layer, a zero-based index of the layer within the image; nil otherwise. } // PutBlobPartialOptions are used in PutBlobPartial. type PutBlobPartialOptions struct { Cache blobinfocache.BlobInfoCache2 // Cache to use and/or update. EmptyLayer bool // True if the blob is an "empty"/"throwaway" layer, and may not necessarily be physically represented. LayerIndex int // A zero-based index of the layer within the image (PutBlobPartial is only called with layer-like blobs, not configs) } // TryReusingBlobOptions are used in TryReusingBlobWithOptions. type TryReusingBlobOptions struct { Cache blobinfocache.BlobInfoCache2 // Cache to use and/or update. // If true, it is allowed to use an equivalent of the desired blob; // in that case the returned info may not match the input. CanSubstitute bool // The following fields are new to internal/private. Users of internal/private MUST fill them in, // but they also must expect that they will be ignored by types.ImageDestination transports. // Transports, OTOH, MUST support these fields being zero-valued for types.ImageDestination callers // if they use internal/imagedestination/impl.Compat; // in that case, they will all be consistently zero-valued. EmptyLayer bool // True if the blob is an "empty"/"throwaway" layer, and may not necessarily be physically represented. LayerIndex *int // If the blob is a layer, a zero-based index of the layer within the image; nil otherwise. SrcRef reference.Named // A reference to the source image that contains the input blob. PossibleManifestFormats []string // A set of possible manifest formats; at least one should support the reused layer blob. RequiredCompression *compression.Algorithm // If set, reuse blobs with a matching algorithm as per implementations in internal/imagedestination/impl.helpers.go OriginalCompression *compression.Algorithm // May be nil to indicate “uncompressed” or “unknown”. TOCDigest digest.Digest // If specified, the blob can be looked up in the destination also by its TOC digest. } // ReusedBlob is information about a blob reused in a destination. // It is the subset of types.BlobInfo fields the transport is responsible for setting. type ReusedBlob struct { Digest digest.Digest // Must be provided Size int64 // Must be provided // The following compression fields should be set when the reuse substitutes // a differently-compressed blob. // They may be set also to change from a base variant to a specific variant of an algorithm. CompressionOperation types.LayerCompression // Compress/Decompress, matching the reused blob; PreserveOriginal if N/A CompressionAlgorithm *compression.Algorithm // Algorithm if compressed, nil if decompressed or N/A // Annotations that should be added, for CompressionAlgorithm. Note that they might need to be // added even if the digest doesn’t change (if we found the annotations in a cache). CompressionAnnotations map[string]string MatchedByTOCDigest bool // Whether the layer was reused/matched by TOC digest. Used only for UI purposes. } // CommitOptions are used in CommitWithOptions type CommitOptions struct { // UnparsedToplevel contains data about the top-level manifest of the source (which may be a single-arch image or a manifest list // if PutManifest was only called for the single-arch image with instanceDigest == nil), primarily to allow lookups by the // original manifest list digest, if desired. UnparsedToplevel types.UnparsedImage // ReportResolvedReference, if set, asks the transport to store a “resolved” (more detailed) reference to the created image // into the value this option points to. // What “resolved” means is transport-specific. // Transports which don’t support reporting resolved references can ignore the field; the generic copy code writes "nil" into the value. ReportResolvedReference *types.ImageReference // Timestamp, if set, will force timestamps of content created in the destination to this value. // Most transports don't support this. // // In oci-archive: destinations, this will set the create/mod/access timestamps in each tar entry // (but not a timestamp of the created archive file). Timestamp *time.Time } // ImageSourceChunk is a portion of a blob. // This API is experimental and can be changed without bumping the major version number. type ImageSourceChunk struct { // Offset specifies the starting position of the chunk within the source blob. Offset uint64 // Length specifies the size of the chunk. If it is set to math.MaxUint64, // then it refers to all the data from Offset to the end of the blob. Length uint64 } // BlobChunkAccessor allows fetching discontiguous chunks of a blob. type BlobChunkAccessor interface { // GetBlobAt returns a sequential channel of readers that contain data for the requested // blob chunks, and a channel that might get a single error value. // The specified chunks must be not overlapping and sorted by their offset. // The readers must be fully consumed, in the order they are returned, before blocking // to read the next chunk. // If the Length for the last chunk is set to math.MaxUint64, then it // fully fetches the remaining data from the offset to the end of the blob. GetBlobAt(ctx context.Context, info types.BlobInfo, chunks []ImageSourceChunk) (chan io.ReadCloser, chan error, error) } // BadPartialRequestError is returned by BlobChunkAccessor.GetBlobAt on an invalid request. type BadPartialRequestError struct { Status string } func (e BadPartialRequestError) Error() string { return e.Status } // UnparsedImage is an internal extension to the types.UnparsedImage interface. type UnparsedImage interface { types.UnparsedImage // UntrustedSignatures is like ImageSource.GetSignaturesWithFormat, but the result is cached; it is OK to call this however often you need. UntrustedSignatures(ctx context.Context) ([]signature.Signature, error) } // ErrFallbackToOrdinaryLayerDownload is a custom error type returned by PutBlobPartial. // It suggests to the caller that a fallback mechanism can be used instead of a hard failure; // otherwise the caller of PutBlobPartial _must not_ fall back to PutBlob. type ErrFallbackToOrdinaryLayerDownload struct { err error } func (c ErrFallbackToOrdinaryLayerDownload) Error() string { return c.err.Error() } func (c ErrFallbackToOrdinaryLayerDownload) Unwrap() error { return c.err } func NewErrFallbackToOrdinaryLayerDownload(err error) error { return ErrFallbackToOrdinaryLayerDownload{err: err} } ================================================ FILE: vendor/go.podman.io/image/v5/internal/putblobdigest/put_blob_digest.go ================================================ package putblobdigest import ( "io" "github.com/opencontainers/go-digest" "go.podman.io/image/v5/types" ) // Digester computes a digest of the provided stream, if not known yet. type Digester struct { knownDigest digest.Digest // Or "" digester digest.Digester // Or nil } // newDigester initiates computation of a digest.Canonical digest of stream, // if !validDigest; otherwise it just records knownDigest to be returned later. // The caller MUST use the returned stream instead of the original value. func newDigester(stream io.Reader, knownDigest digest.Digest, validDigest bool) (Digester, io.Reader) { if validDigest { return Digester{knownDigest: knownDigest}, stream } else { res := Digester{ digester: digest.Canonical.Digester(), } stream = io.TeeReader(stream, res.digester.Hash()) return res, stream } } // DigestIfUnknown initiates computation of a digest.Canonical digest of stream, // if no digest is supplied in the provided blobInfo; otherwise blobInfo.Digest will // be used (accepting any algorithm). // The caller MUST use the returned stream instead of the original value. func DigestIfUnknown(stream io.Reader, blobInfo types.BlobInfo) (Digester, io.Reader) { d := blobInfo.Digest return newDigester(stream, d, d != "") } // DigestIfCanonicalUnknown initiates computation of a digest.Canonical digest of stream, // if a digest.Canonical digest is not supplied in the provided blobInfo; // otherwise blobInfo.Digest will be used. // The caller MUST use the returned stream instead of the original value. func DigestIfCanonicalUnknown(stream io.Reader, blobInfo types.BlobInfo) (Digester, io.Reader) { d := blobInfo.Digest return newDigester(stream, d, d != "" && d.Algorithm() == digest.Canonical) } // Digest() returns a digest value possibly computed by Digester. // This must be called only after all of the stream returned by a Digester constructor // has been successfully read. func (d Digester) Digest() digest.Digest { if d.digester != nil { return d.digester.Digest() } return d.knownDigest } ================================================ FILE: vendor/go.podman.io/image/v5/internal/rootless/rootless.go ================================================ package rootless import ( "os" "strconv" ) // GetRootlessEUID returns the UID of the current user (in the parent userNS, if any) // // Podman and similar software, in “rootless” configuration, when run as a non-root // user, very early switches to a user namespace, where Geteuid() == 0 (but does not // switch to a limited mount namespace); so, code relying on Geteuid() would use // system-wide paths in e.g. /var, when the user is actually not privileged to write to // them, and expects state to be stored in the home directory. // // If Podman is setting up such a user namespace, it records the original UID in an // environment variable, allowing us to make choices based on the actual user’s identity. func GetRootlessEUID() int { euidEnv := os.Getenv("_CONTAINERS_ROOTLESS_UID") if euidEnv != "" { euid, _ := strconv.Atoi(euidEnv) return euid } return os.Geteuid() } ================================================ FILE: vendor/go.podman.io/image/v5/internal/set/set.go ================================================ package set import ( "iter" "maps" ) // FIXME: // - Docstrings // - This should be in a public library somewhere type Set[E comparable] struct { m map[E]struct{} } func New[E comparable]() *Set[E] { return &Set[E]{ m: map[E]struct{}{}, } } func NewWithValues[E comparable](values ...E) *Set[E] { s := New[E]() for _, v := range values { s.Add(v) } return s } func (s *Set[E]) Add(v E) { s.m[v] = struct{}{} // Possibly writing the same struct{}{} presence marker again. } func (s *Set[E]) AddSeq(seq iter.Seq[E]) { for v := range seq { s.Add(v) } } func (s *Set[E]) Delete(v E) { delete(s.m, v) } func (s *Set[E]) Contains(v E) bool { _, ok := s.m[v] return ok } func (s *Set[E]) Empty() bool { return len(s.m) == 0 } func (s *Set[E]) All() iter.Seq[E] { return maps.Keys(s.m) } ================================================ FILE: vendor/go.podman.io/image/v5/internal/signature/signature.go ================================================ package signature import ( "bytes" "errors" "fmt" ) // FIXME FIXME: MIME type? Int? String? // An interface with a name, parse methods? type FormatID string const ( SimpleSigningFormat FormatID = "simple-signing" SigstoreFormat FormatID = "sigstore-json" // Update also UnsupportedFormatError below ) // Signature is an image signature of some kind. type Signature interface { FormatID() FormatID // blobChunk returns a representation of signature as a []byte, suitable for long-term storage. // Almost everyone should use signature.Blob() instead. blobChunk() ([]byte, error) } // Blob returns a representation of sig as a []byte, suitable for long-term storage. func Blob(sig Signature) ([]byte, error) { chunk, err := sig.blobChunk() if err != nil { return nil, err } format := sig.FormatID() switch format { case SimpleSigningFormat: // For compatibility with old dir formats: return chunk, nil default: res := []byte{0} // Start with a zero byte to clearly mark this is a binary format, and disambiguate from random text. res = append(res, []byte(format)...) res = append(res, '\n') res = append(res, chunk...) return res, nil } } // FromBlob returns a signature from parsing a blob created by signature.Blob. func FromBlob(blob []byte) (Signature, error) { if len(blob) == 0 { return nil, errors.New("empty signature blob") } // Historically we’ve just been using GPG with no identification; try to auto-detect that. switch blob[0] { // OpenPGP "compressed data" wrapping the message case 0xA0, 0xA1, 0xA2, 0xA3, // bit 7 = 1; bit 6 = 0 (old packet format); bits 5…2 = 8 (tag: compressed data packet); bits 1…0 = length-type (any) 0xC8, // bit 7 = 1; bit 6 = 1 (new packet format); bits 5…0 = 8 (tag: compressed data packet) // OpenPGP “one-pass signature” starting a signature 0x90, 0x91, 0x92, 0x3d, // bit 7 = 1; bit 6 = 0 (old packet format); bits 5…2 = 4 (tag: one-pass signature packet); bits 1…0 = length-type (any) 0xC4, // bit 7 = 1; bit 6 = 1 (new packet format); bits 5…0 = 4 (tag: one-pass signature packet) // OpenPGP signature packet signing the following data 0x88, 0x89, 0x8A, 0x8B, // bit 7 = 1; bit 6 = 0 (old packet format); bits 5…2 = 2 (tag: signature packet); bits 1…0 = length-type (any) 0xC2: // bit 7 = 1; bit 6 = 1 (new packet format); bits 5…0 = 2 (tag: signature packet) return SimpleSigningFromBlob(blob), nil // The newer format: binary 0, format name, newline, data case 0x00: blob = blob[1:] formatBytes, blobChunk, foundNewline := bytes.Cut(blob, []byte{'\n'}) if !foundNewline { return nil, fmt.Errorf("invalid signature format, missing newline") } for _, b := range formatBytes { if b < 32 || b >= 0x7F { return nil, fmt.Errorf("invalid signature format, non-ASCII byte %#x", b) } } switch { case bytes.Equal(formatBytes, []byte(SimpleSigningFormat)): return SimpleSigningFromBlob(blobChunk), nil case bytes.Equal(formatBytes, []byte(SigstoreFormat)): return sigstoreFromBlobChunk(blobChunk) default: return nil, fmt.Errorf("unrecognized signature format %q", string(formatBytes)) } default: return nil, fmt.Errorf("unrecognized signature format, starting with binary %#x", blob[0]) } } // UnsupportedFormatError returns an error complaining about sig having an unsupported format. func UnsupportedFormatError(sig Signature) error { formatID := sig.FormatID() switch formatID { case SimpleSigningFormat, SigstoreFormat: return fmt.Errorf("unsupported signature format %s", string(formatID)) default: return fmt.Errorf("unsupported, and unrecognized, signature format %q", string(formatID)) } } ================================================ FILE: vendor/go.podman.io/image/v5/internal/signature/sigstore.go ================================================ package signature import ( "bytes" "encoding/json" "maps" ) const ( // from sigstore/cosign/pkg/types.SimpleSigningMediaType SigstoreSignatureMIMEType = "application/vnd.dev.cosign.simplesigning.v1+json" // from sigstore/cosign/pkg/oci/static.SignatureAnnotationKey SigstoreSignatureAnnotationKey = "dev.cosignproject.cosign/signature" // from sigstore/cosign/pkg/oci/static.BundleAnnotationKey SigstoreSETAnnotationKey = "dev.sigstore.cosign/bundle" // from sigstore/cosign/pkg/oci/static.CertificateAnnotationKey SigstoreCertificateAnnotationKey = "dev.sigstore.cosign/certificate" // from sigstore/cosign/pkg/oci/static.ChainAnnotationKey SigstoreIntermediateCertificateChainAnnotationKey = "dev.sigstore.cosign/chain" ) // Sigstore is a github.com/cosign/cosign signature. // For the persistent-storage format used for blobChunk(), we want // a degree of forward compatibility against unexpected field changes // (as has happened before), which is why this data type // contains just a payload + annotations (including annotations // that we don’t recognize or support), instead of individual fields // for the known annotations. type Sigstore struct { untrustedMIMEType string untrustedPayload []byte untrustedAnnotations map[string]string } // sigstoreJSONRepresentation needs the files to be public, which we don’t want for // the main Sigstore type. type sigstoreJSONRepresentation struct { UntrustedMIMEType string `json:"mimeType"` UntrustedPayload []byte `json:"payload"` UntrustedAnnotations map[string]string `json:"annotations"` } // SigstoreFromComponents returns a Sigstore object from its components. func SigstoreFromComponents(untrustedMimeType string, untrustedPayload []byte, untrustedAnnotations map[string]string) Sigstore { return Sigstore{ untrustedMIMEType: untrustedMimeType, untrustedPayload: bytes.Clone(untrustedPayload), untrustedAnnotations: maps.Clone(untrustedAnnotations), } } // sigstoreFromBlobChunk converts a Sigstore signature, as returned by Sigstore.blobChunk, into a Sigstore object. func sigstoreFromBlobChunk(blobChunk []byte) (Sigstore, error) { var v sigstoreJSONRepresentation if err := json.Unmarshal(blobChunk, &v); err != nil { return Sigstore{}, err } return SigstoreFromComponents(v.UntrustedMIMEType, v.UntrustedPayload, v.UntrustedAnnotations), nil } func (s Sigstore) FormatID() FormatID { return SigstoreFormat } // blobChunk returns a representation of signature as a []byte, suitable for long-term storage. // Almost everyone should use signature.Blob() instead. func (s Sigstore) blobChunk() ([]byte, error) { return json.Marshal(sigstoreJSONRepresentation{ UntrustedMIMEType: s.UntrustedMIMEType(), UntrustedPayload: s.UntrustedPayload(), UntrustedAnnotations: s.UntrustedAnnotations(), }) } func (s Sigstore) UntrustedMIMEType() string { return s.untrustedMIMEType } func (s Sigstore) UntrustedPayload() []byte { return bytes.Clone(s.untrustedPayload) } func (s Sigstore) UntrustedAnnotations() map[string]string { return maps.Clone(s.untrustedAnnotations) } ================================================ FILE: vendor/go.podman.io/image/v5/internal/signature/simple.go ================================================ package signature import "bytes" // SimpleSigning is a “simple signing” signature. type SimpleSigning struct { untrustedSignature []byte } // SimpleSigningFromBlob converts a “simple signing” signature into a SimpleSigning object. func SimpleSigningFromBlob(blobChunk []byte) SimpleSigning { return SimpleSigning{ untrustedSignature: bytes.Clone(blobChunk), } } func (s SimpleSigning) FormatID() FormatID { return SimpleSigningFormat } // blobChunk returns a representation of signature as a []byte, suitable for long-term storage. // Almost everyone should use signature.Blob() instead. func (s SimpleSigning) blobChunk() ([]byte, error) { return bytes.Clone(s.untrustedSignature), nil } func (s SimpleSigning) UntrustedSignature() []byte { return bytes.Clone(s.untrustedSignature) } ================================================ FILE: vendor/go.podman.io/image/v5/internal/signer/signer.go ================================================ package signer import ( "context" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/internal/signature" ) // Signer is an object, possibly carrying state, that can be used by copy.Image to sign one or more container images. // This type is visible to external callers, so it has no public fields or methods apart from Close(). // // The owner of a Signer must call Close() when done. type Signer struct { implementation SignerImplementation } // NewSigner creates a public Signer from a SignerImplementation func NewSigner(impl SignerImplementation) *Signer { return &Signer{implementation: impl} } func (s *Signer) Close() error { return s.implementation.Close() } // ProgressMessage returns a human-readable sentence that makes sense to write before starting to create a single signature. // Alternatively, should SignImageManifest be provided a logging writer of some kind? func ProgressMessage(signer *Signer) string { return signer.implementation.ProgressMessage() } // SignImageManifest invokes a SignerImplementation. // This is a function, not a method, so that it can only be called by code that is allowed to import this internal subpackage. func SignImageManifest(ctx context.Context, signer *Signer, manifest []byte, dockerReference reference.Named) (signature.Signature, error) { return signer.implementation.SignImageManifest(ctx, manifest, dockerReference) } // SignerImplementation is an object, possibly carrying state, that can be used by copy.Image to sign one or more container images. // This interface is distinct from Signer so that implementations can be created outside of this package. type SignerImplementation interface { // ProgressMessage returns a human-readable sentence that makes sense to write before starting to create a single signature. ProgressMessage() string // SignImageManifest creates a new signature for manifest m as dockerReference. SignImageManifest(ctx context.Context, m []byte, dockerReference reference.Named) (signature.Signature, error) Close() error } ================================================ FILE: vendor/go.podman.io/image/v5/internal/streamdigest/stream_digest.go ================================================ package streamdigest import ( "fmt" "io" "os" "go.podman.io/image/v5/internal/putblobdigest" "go.podman.io/image/v5/internal/tmpdir" "go.podman.io/image/v5/types" ) // ComputeBlobInfo streams a blob to a temporary file and populates Digest and Size in inputInfo. // The temporary file is returned as an io.Reader along with a cleanup function. // It is the caller's responsibility to call the cleanup function, which closes and removes the temporary file. // If an error occurs, inputInfo is not modified. func ComputeBlobInfo(sys *types.SystemContext, stream io.Reader, inputInfo *types.BlobInfo) (io.Reader, func(), error) { diskBlob, err := tmpdir.CreateBigFileTemp(sys, "stream-blob") if err != nil { return nil, nil, fmt.Errorf("creating temporary on-disk layer: %w", err) } cleanup := func() { diskBlob.Close() os.Remove(diskBlob.Name()) } digester, stream := putblobdigest.DigestIfCanonicalUnknown(stream, *inputInfo) written, err := io.Copy(diskBlob, stream) if err != nil { cleanup() return nil, nil, fmt.Errorf("writing to temporary on-disk layer: %w", err) } _, err = diskBlob.Seek(0, io.SeekStart) if err != nil { cleanup() return nil, nil, fmt.Errorf("rewinding temporary on-disk layer: %w", err) } inputInfo.Digest = digester.Digest() inputInfo.Size = written return diskBlob, cleanup, nil } ================================================ FILE: vendor/go.podman.io/image/v5/internal/tmpdir/tmpdir.go ================================================ package tmpdir import ( "os" "runtime" "go.podman.io/image/v5/types" ) // unixTempDirForBigFiles is the directory path to store big files on non Windows systems. // You can override this at build time with // -ldflags '-X go.podman.io/image/v5/internal/tmpdir.unixTempDirForBigFiles=$your_path' var unixTempDirForBigFiles = builtinUnixTempDirForBigFiles // builtinUnixTempDirForBigFiles is the directory path to store big files. // Do not use the system default of os.TempDir(), usually /tmp, because with systemd it could be a tmpfs. // DO NOT change this, instead see unixTempDirForBigFiles above. const builtinUnixTempDirForBigFiles = "/var/tmp" const prefix = "container_images_" // TemporaryDirectoryForBigFiles returns a directory for temporary (big) files. // On non Windows systems it avoids the use of os.TempDir(), because the default temporary directory usually falls under /tmp // which on systemd based systems could be the unsuitable tmpfs filesystem. func temporaryDirectoryForBigFiles(sys *types.SystemContext) string { if sys != nil && sys.BigFilesTemporaryDir != "" { return sys.BigFilesTemporaryDir } var temporaryDirectoryForBigFiles string if runtime.GOOS == "windows" { temporaryDirectoryForBigFiles = os.TempDir() } else { temporaryDirectoryForBigFiles = unixTempDirForBigFiles } return temporaryDirectoryForBigFiles } func CreateBigFileTemp(sys *types.SystemContext, name string) (*os.File, error) { return os.CreateTemp(temporaryDirectoryForBigFiles(sys), prefix+name) } func MkDirBigFileTemp(sys *types.SystemContext, name string) (string, error) { return os.MkdirTemp(temporaryDirectoryForBigFiles(sys), prefix+name) } ================================================ FILE: vendor/go.podman.io/image/v5/internal/unparsedimage/wrapper.go ================================================ package unparsedimage import ( "context" "go.podman.io/image/v5/internal/private" "go.podman.io/image/v5/internal/signature" "go.podman.io/image/v5/types" ) // wrapped provides the private.UnparsedImage operations // for an object that only implements types.UnparsedImage type wrapped struct { types.UnparsedImage } // FromPublic(unparsed) returns an object that provides the private.UnparsedImage API func FromPublic(unparsed types.UnparsedImage) private.UnparsedImage { if unparsed2, ok := unparsed.(private.UnparsedImage); ok { return unparsed2 } return &wrapped{ UnparsedImage: unparsed, } } // UntrustedSignatures is like ImageSource.GetSignaturesWithFormat, but the result is cached; it is OK to call this however often you need. func (w *wrapped) UntrustedSignatures(ctx context.Context) ([]signature.Signature, error) { sigs, err := w.Signatures(ctx) if err != nil { return nil, err } res := []signature.Signature{} for _, sig := range sigs { res = append(res, signature.SimpleSigningFromBlob(sig)) } return res, nil } ================================================ FILE: vendor/go.podman.io/image/v5/internal/uploadreader/upload_reader.go ================================================ package uploadreader import ( "io" "sync" ) // UploadReader is a pass-through reader for use in sending non-trivial data using the net/http // package (http.NewRequest, http.Post and the like). // // The net/http package uses a separate goroutine to upload data to a HTTP connection, // and it is possible for the server to return a response (typically an error) before consuming // the full body of the request. In that case http.Client.Do can return with an error while // the body is still being read — regardless of the cancellation, if any, of http.Request.Context(). // // As a result, any data used/updated by the io.Reader() provided as the request body may be // used/updated even after http.Client.Do returns, causing races. // // To fix this, UploadReader provides a synchronized Terminate() method, which can block for // a not-completely-negligible time (for a duration of the underlying Read()), but guarantees that // after Terminate() returns, the underlying reader is never used any more (unlike calling // the cancellation callback of context.WithCancel, which returns before any recipients may have // reacted to the cancellation). type UploadReader struct { mutex sync.Mutex // The following members can only be used with mutex held reader io.Reader terminationError error // nil if not terminated yet } // NewUploadReader returns an UploadReader for an "underlying" reader. func NewUploadReader(underlying io.Reader) *UploadReader { return &UploadReader{ reader: underlying, terminationError: nil, } } // Read returns the error set by Terminate, if any, or calls the underlying reader. // It is safe to call this from a different goroutine than Terminate. func (ur *UploadReader) Read(p []byte) (int, error) { ur.mutex.Lock() defer ur.mutex.Unlock() if ur.terminationError != nil { return 0, ur.terminationError } return ur.reader.Read(p) } // Terminate waits for in-progress Read calls, if any, to finish, and ensures that after // this function returns, any Read calls will fail with the provided error, and the underlying // reader will never be used any more. // // It is safe to call this from a different goroutine than Read. func (ur *UploadReader) Terminate(err error) { ur.mutex.Lock() // May block for some time if ur.reader.Read() is in progress defer ur.mutex.Unlock() ur.terminationError = err } ================================================ FILE: vendor/go.podman.io/image/v5/internal/useragent/useragent.go ================================================ package useragent import "go.podman.io/image/v5/version" // DefaultUserAgent is a value that should be used by User-Agent headers, unless the user specifically instructs us otherwise. var DefaultUserAgent = "containers/" + version.Version + " (github.com/containers/image)" ================================================ FILE: vendor/go.podman.io/image/v5/manifest/common.go ================================================ package manifest import ( "fmt" "github.com/sirupsen/logrus" compressiontypes "go.podman.io/image/v5/pkg/compression/types" "go.podman.io/image/v5/types" ) // layerInfosToStrings converts a list of layer infos, presumably obtained from a Manifest.LayerInfos() // method call, into a format suitable for inclusion in a types.ImageInspectInfo structure. func layerInfosToStrings(infos []LayerInfo) []string { layers := make([]string, len(infos)) for i, info := range infos { layers[i] = info.Digest.String() } return layers } // compressionMIMETypeSet describes a set of MIME type “variants” that represent differently-compressed // versions of “the same kind of content”. // The map key is the return value of compressiontypes.Algorithm.Name(), or mtsUncompressed; // the map value is a MIME type, or mtsUnsupportedMIMEType to mean "recognized but unsupported". type compressionMIMETypeSet map[string]string const ( mtsUncompressed = "" // A key in compressionMIMETypeSet for the uncompressed variant mtsUnsupportedMIMEType = "" // A value in compressionMIMETypeSet that means “recognized but unsupported” ) // findCompressionMIMETypeSet returns a pointer to a compressionMIMETypeSet in variantTable that contains a value of mimeType, or nil if not found func findCompressionMIMETypeSet(variantTable []compressionMIMETypeSet, mimeType string) compressionMIMETypeSet { for _, variants := range variantTable { for _, mt := range variants { if mt == mimeType { return variants } } } return nil } // compressionVariantMIMEType returns a variant of mimeType for the specified algorithm (which may be nil // to mean "no compression"), based on variantTable. // The returned error will be a ManifestLayerCompressionIncompatibilityError if mimeType has variants // that differ only in what type of compression is applied, but it can't be combined with this // algorithm to produce an updated MIME type that complies with the standard that defines mimeType. // If the compression algorithm is unrecognized, or mimeType is not known to have variants that // differ from it only in what type of compression has been applied, the returned error will not be // a ManifestLayerCompressionIncompatibilityError. func compressionVariantMIMEType(variantTable []compressionMIMETypeSet, mimeType string, algorithm *compressiontypes.Algorithm) (string, error) { if mimeType == mtsUnsupportedMIMEType { // Prevent matching against the {algo:mtsUnsupportedMIMEType} entries return "", fmt.Errorf("cannot update unknown MIME type") } variants := findCompressionMIMETypeSet(variantTable, mimeType) if variants != nil { name := mtsUncompressed if algorithm != nil { name = algorithm.BaseVariantName() } if res, ok := variants[name]; ok { if res != mtsUnsupportedMIMEType { return res, nil } if name != mtsUncompressed { return "", ManifestLayerCompressionIncompatibilityError{fmt.Sprintf("%s compression is not supported for type %q", name, mimeType)} } return "", ManifestLayerCompressionIncompatibilityError{fmt.Sprintf("uncompressed variant is not supported for type %q", mimeType)} } if name != mtsUncompressed { return "", ManifestLayerCompressionIncompatibilityError{fmt.Sprintf("unknown compressed with algorithm %s variant for type %q", name, mimeType)} } // We can't very well say “the idea of no compression is unknown” return "", ManifestLayerCompressionIncompatibilityError{fmt.Sprintf("uncompressed variant is not supported for type %q", mimeType)} } if algorithm != nil { return "", fmt.Errorf("unsupported MIME type for compression: %q", mimeType) } return "", fmt.Errorf("unsupported MIME type for decompression: %q", mimeType) } // updatedMIMEType returns the result of applying edits in updated (MediaType, CompressionOperation) to // mimeType, based on variantTable. It may use updated.Digest for error messages. // The returned error will be a ManifestLayerCompressionIncompatibilityError if mimeType has variants // that differ only in what type of compression is applied, but applying updated.CompressionOperation // and updated.CompressionAlgorithm to it won't produce an updated MIME type that complies with the // standard that defines mimeType. func updatedMIMEType(variantTable []compressionMIMETypeSet, mimeType string, updated types.BlobInfo) (string, error) { // Note that manifests in containers-storage might be reporting the // wrong media type since the original manifests are stored while layers // are decompressed in storage. Hence, we need to consider the case // that an already {de}compressed layer should be {de}compressed; // compressionVariantMIMEType does that by not caring whether the original is // {de}compressed. switch updated.CompressionOperation { case types.PreserveOriginal: // Force a change to the media type if we're being told to use a particular compressor, // since it might be different from the one associated with the media type. Otherwise, // try to keep the original media type. if updated.CompressionAlgorithm != nil { return compressionVariantMIMEType(variantTable, mimeType, updated.CompressionAlgorithm) } // Keep the original media type. return mimeType, nil case types.Decompress: return compressionVariantMIMEType(variantTable, mimeType, nil) case types.Compress: if updated.CompressionAlgorithm == nil { logrus.Debugf("Error preparing updated manifest: blob %q was compressed but does not specify by which algorithm: falling back to use the original blob", updated.Digest) return mimeType, nil } return compressionVariantMIMEType(variantTable, mimeType, updated.CompressionAlgorithm) default: return "", fmt.Errorf("unknown compression operation (%d)", updated.CompressionOperation) } } // ManifestLayerCompressionIncompatibilityError indicates that a specified compression algorithm // could not be applied to a layer MIME type. A caller that receives this should either retry // the call with a different compression algorithm, or attempt to use a different manifest type. type ManifestLayerCompressionIncompatibilityError struct { text string } func (m ManifestLayerCompressionIncompatibilityError) Error() string { return m.text } // compressionVariantsRecognizeMIMEType returns true if variantTable contains data about compressing/decompressing layers with mimeType // Note that the caller still needs to worry about a specific algorithm not being supported. func compressionVariantsRecognizeMIMEType(variantTable []compressionMIMETypeSet, mimeType string) bool { if mimeType == mtsUnsupportedMIMEType { // Prevent matching against the {algo:mtsUnsupportedMIMEType} entries return false } variants := findCompressionMIMETypeSet(variantTable, mimeType) return variants != nil // Alternatively, this could be len(variants) > 1, but really the caller should ask about a specific algorithm. } // imgInspectLayersFromLayerInfos converts a list of layer infos, presumably obtained from a Manifest.LayerInfos() // method call, into a format suitable for inclusion in a types.ImageInspectInfo structure. func imgInspectLayersFromLayerInfos(infos []LayerInfo) []types.ImageInspectLayer { layers := make([]types.ImageInspectLayer, len(infos)) for i, info := range infos { layers[i].MIMEType = info.MediaType layers[i].Digest = info.Digest layers[i].Size = info.Size layers[i].Annotations = info.Annotations } return layers } ================================================ FILE: vendor/go.podman.io/image/v5/manifest/docker_schema1.go ================================================ package manifest import ( "encoding/json" "errors" "fmt" "slices" "strings" "time" "github.com/moby/moby/client/pkg/versions" "github.com/opencontainers/go-digest" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/internal/manifest" "go.podman.io/image/v5/internal/set" compressiontypes "go.podman.io/image/v5/pkg/compression/types" "go.podman.io/image/v5/types" "go.podman.io/storage/pkg/regexp" ) // Schema1FSLayers is an entry of the "fsLayers" array in docker/distribution schema 1. type Schema1FSLayers struct { BlobSum digest.Digest `json:"blobSum"` } // Schema1History is an entry of the "history" array in docker/distribution schema 1. type Schema1History struct { V1Compatibility string `json:"v1Compatibility"` } // Schema1 is a manifest in docker/distribution schema 1. type Schema1 struct { Name string `json:"name"` Tag string `json:"tag"` Architecture string `json:"architecture"` FSLayers []Schema1FSLayers `json:"fsLayers"` History []Schema1History `json:"history"` // Keep this in sync with ExtractedV1Compatibility! ExtractedV1Compatibility []Schema1V1Compatibility `json:"-"` // Keep this in sync with History! Does not contain the full config (Schema2V1Image) SchemaVersion int `json:"schemaVersion"` } type schema1V1CompatibilityContainerConfig struct { Cmd []string } // Schema1V1Compatibility is a v1Compatibility in docker/distribution schema 1. type Schema1V1Compatibility struct { ID string `json:"id"` Parent string `json:"parent,omitempty"` Comment string `json:"comment,omitempty"` Created time.Time `json:"created"` ContainerConfig schema1V1CompatibilityContainerConfig `json:"container_config"` Author string `json:"author,omitempty"` ThrowAway bool `json:"throwaway,omitempty"` } // Schema1FromManifest creates a Schema1 manifest instance from a manifest blob. // (NOTE: The instance is not necessary a literal representation of the original blob, // layers with duplicate IDs are eliminated.) func Schema1FromManifest(manifestBlob []byte) (*Schema1, error) { s1 := Schema1{} if err := json.Unmarshal(manifestBlob, &s1); err != nil { return nil, err } if s1.SchemaVersion != 1 { return nil, fmt.Errorf("unsupported schema version %d", s1.SchemaVersion) } if err := manifest.ValidateUnambiguousManifestFormat(manifestBlob, DockerV2Schema1SignedMediaType, manifest.AllowedFieldFSLayers|manifest.AllowedFieldHistory); err != nil { return nil, err } if err := s1.initialize(); err != nil { return nil, err } if err := s1.fixManifestLayers(); err != nil { return nil, err } return &s1, nil } // Schema1FromComponents creates an Schema1 manifest instance from the supplied data. func Schema1FromComponents(ref reference.Named, fsLayers []Schema1FSLayers, history []Schema1History, architecture string) (*Schema1, error) { var name, tag string if ref != nil { // Well, what to do if it _is_ nil? Most consumers actually don't use these fields nowadays, so we might as well try not supplying them. name = reference.Path(ref) if tagged, ok := ref.(reference.NamedTagged); ok { tag = tagged.Tag() } } s1 := Schema1{ Name: name, Tag: tag, Architecture: architecture, FSLayers: fsLayers, History: history, SchemaVersion: 1, } if err := s1.initialize(); err != nil { return nil, err } return &s1, nil } // Schema1Clone creates a copy of the supplied Schema1 manifest. func Schema1Clone(src *Schema1) *Schema1 { copy := *src return © } // initialize initializes ExtractedV1Compatibility and verifies invariants, so that the rest of this code can assume a minimally healthy manifest. func (m *Schema1) initialize() error { if len(m.FSLayers) != len(m.History) { return errors.New("length of history not equal to number of layers") } if len(m.FSLayers) == 0 { return errors.New("no FSLayers in manifest") } m.ExtractedV1Compatibility = make([]Schema1V1Compatibility, len(m.History)) for i, h := range m.History { if err := json.Unmarshal([]byte(h.V1Compatibility), &m.ExtractedV1Compatibility[i]); err != nil { return fmt.Errorf("parsing v2s1 history entry %d: %w", i, err) } } return nil } // ConfigInfo returns a complete BlobInfo for the separate config object, or a BlobInfo{Digest:""} if there isn't a separate object. func (m *Schema1) ConfigInfo() types.BlobInfo { return types.BlobInfo{} } // LayerInfos returns a list of LayerInfos of layers referenced by this image, in order (the root layer first, and then successive layered layers). // The Digest field is guaranteed to be provided; Size may be -1. // WARNING: The list may contain duplicates, and they are semantically relevant. func (m *Schema1) LayerInfos() []LayerInfo { layers := make([]LayerInfo, 0, len(m.FSLayers)) for i, layer := range slices.Backward(m.FSLayers) { // NOTE: This includes empty layers (where m.History.V1Compatibility->ThrowAway) layers = append(layers, LayerInfo{ BlobInfo: types.BlobInfo{Digest: layer.BlobSum, Size: -1}, EmptyLayer: m.ExtractedV1Compatibility[i].ThrowAway, }) } return layers } const fakeSchema1MIMEType = DockerV2Schema2LayerMediaType // Used only in schema1CompressionMIMETypeSets var schema1CompressionMIMETypeSets = []compressionMIMETypeSet{ { mtsUncompressed: fakeSchema1MIMEType, compressiontypes.GzipAlgorithmName: fakeSchema1MIMEType, compressiontypes.ZstdAlgorithmName: mtsUnsupportedMIMEType, }, } // UpdateLayerInfos replaces the original layers with the specified BlobInfos (size+digest+urls), in order (the root layer first, and then successive layered layers) func (m *Schema1) UpdateLayerInfos(layerInfos []types.BlobInfo) error { // Our LayerInfos includes empty layers (where m.ExtractedV1Compatibility[].ThrowAway), so expect them to be included here as well. if len(m.FSLayers) != len(layerInfos) { return fmt.Errorf("Error preparing updated manifest: layer count changed from %d to %d", len(m.FSLayers), len(layerInfos)) } m.FSLayers = make([]Schema1FSLayers, len(layerInfos)) for i, info := range layerInfos { // There are no MIME types in schema1, but we do a “conversion” here to reject unsupported compression algorithms, // in a way that is consistent with the other schema implementations. if _, err := updatedMIMEType(schema1CompressionMIMETypeSets, fakeSchema1MIMEType, info); err != nil { return fmt.Errorf("preparing updated manifest, layer %q: %w", info.Digest, err) } // (docker push) sets up m.ExtractedV1Compatibility[].{Id,Parent} based on values of info.Digest, // but (docker pull) ignores them in favor of computing DiffIDs from uncompressed data, except verifying the child->parent links and uniqueness. // So, we don't bother recomputing the IDs in m.History.V1Compatibility. m.FSLayers[(len(layerInfos)-1)-i].BlobSum = info.Digest if info.CryptoOperation != types.PreserveOriginalCrypto { return fmt.Errorf("encryption change (for layer %q) is not supported in schema1 manifests", info.Digest) } } return nil } // Serialize returns the manifest in a blob format. // NOTE: Serialize() does not in general reproduce the original blob if this object was loaded from one, even if no modifications were made! func (m *Schema1) Serialize() ([]byte, error) { // docker/distribution requires a signature even if the incoming data uses the nominally unsigned DockerV2Schema1MediaType. unsigned, err := json.Marshal(*m) if err != nil { return nil, err } return AddDummyV2S1Signature(unsigned) } // fixManifestLayers, after validating the supplied manifest // (to use correctly-formatted IDs, and to not have non-consecutive ID collisions in m.History), // modifies manifest to only have one entry for each layer ID in m.History (deleting the older duplicates, // both from m.History and m.FSLayers). // Note that even after this succeeds, m.FSLayers may contain duplicate entries // (for Dockerfile operations which change the configuration but not the filesystem). func (m *Schema1) fixManifestLayers() error { // m.initialize() has verified that len(m.FSLayers) == len(m.History) for _, compat := range m.ExtractedV1Compatibility { if err := validateV1ID(compat.ID); err != nil { return err } } if m.ExtractedV1Compatibility[len(m.ExtractedV1Compatibility)-1].Parent != "" { return errors.New("Invalid parent ID in the base layer of the image") } // check general duplicates to error instead of a deadlock idmap := set.New[string]() var lastID string for _, img := range m.ExtractedV1Compatibility { // skip IDs that appear after each other, we handle those later if img.ID != lastID && idmap.Contains(img.ID) { return fmt.Errorf("ID %+v appears multiple times in manifest", img.ID) } lastID = img.ID idmap.Add(lastID) } // backwards loop so that we keep the remaining indexes after removing items for i := len(m.ExtractedV1Compatibility) - 2; i >= 0; i-- { if m.ExtractedV1Compatibility[i].ID == m.ExtractedV1Compatibility[i+1].ID { // repeated ID. remove and continue m.FSLayers = slices.Delete(m.FSLayers, i, i+1) m.History = slices.Delete(m.History, i, i+1) m.ExtractedV1Compatibility = slices.Delete(m.ExtractedV1Compatibility, i, i+1) } else if m.ExtractedV1Compatibility[i].Parent != m.ExtractedV1Compatibility[i+1].ID { return fmt.Errorf("Invalid parent ID. Expected %v, got %q", m.ExtractedV1Compatibility[i+1].ID, m.ExtractedV1Compatibility[i].Parent) } } return nil } var validHex = regexp.Delayed(`^([a-f0-9]{64})$`) func validateV1ID(id string) error { if ok := validHex.MatchString(id); !ok { return fmt.Errorf("image ID %q is invalid", id) } return nil } // Inspect returns various information for (skopeo inspect) parsed from the manifest and configuration. func (m *Schema1) Inspect(_ func(types.BlobInfo) ([]byte, error)) (*types.ImageInspectInfo, error) { s1 := &Schema2V1Image{} if err := json.Unmarshal([]byte(m.History[0].V1Compatibility), s1); err != nil { return nil, err } layerInfos := m.LayerInfos() i := &types.ImageInspectInfo{ Tag: m.Tag, Created: &s1.Created, DockerVersion: s1.DockerVersion, Architecture: s1.Architecture, Variant: s1.Variant, Os: s1.OS, Layers: layerInfosToStrings(layerInfos), LayersData: imgInspectLayersFromLayerInfos(layerInfos), Author: s1.Author, } if s1.Config != nil { i.Labels = s1.Config.Labels i.Env = s1.Config.Env } return i, nil } // ToSchema2Config builds a schema2-style configuration blob using the supplied diffIDs. func (m *Schema1) ToSchema2Config(diffIDs []digest.Digest) ([]byte, error) { // Convert the schema 1 compat info into a schema 2 config, constructing some of the fields // that aren't directly comparable using info from the manifest. if len(m.History) == 0 { return nil, errors.New("image has no layers") } s1 := Schema2V1Image{} config := []byte(m.History[0].V1Compatibility) err := json.Unmarshal(config, &s1) if err != nil { return nil, fmt.Errorf("decoding configuration: %w", err) } // Images created with versions prior to 1.8.3 require us to re-encode the encoded object, // adding some fields that aren't "omitempty". if s1.DockerVersion != "" && versions.LessThan(s1.DockerVersion, "1.8.3") { config, err = json.Marshal(&s1) if err != nil { return nil, fmt.Errorf("re-encoding compat image config %#v: %w", s1, err) } } // Build the history. convertedHistory := []Schema2History{} for _, compat := range slices.Backward(m.ExtractedV1Compatibility) { hitem := Schema2History{ Created: compat.Created, CreatedBy: strings.Join(compat.ContainerConfig.Cmd, " "), Author: compat.Author, Comment: compat.Comment, EmptyLayer: compat.ThrowAway, } convertedHistory = append(convertedHistory, hitem) } // Build the rootfs information. We need the decompressed sums that we've been // calculating to fill in the DiffIDs. It's expected (but not enforced by us) // that the number of diffIDs corresponds to the number of non-EmptyLayer // entries in the history. rootFS := &Schema2RootFS{ Type: "layers", DiffIDs: diffIDs, } // And now for some raw manipulation. raw := make(map[string]*json.RawMessage) err = json.Unmarshal(config, &raw) if err != nil { return nil, fmt.Errorf("re-decoding compat image config %#v: %w", s1, err) } // Drop some fields. delete(raw, "id") delete(raw, "parent") delete(raw, "parent_id") delete(raw, "layer_id") delete(raw, "throwaway") delete(raw, "Size") // Add the history and rootfs information. rootfs, err := json.Marshal(rootFS) if err != nil { return nil, fmt.Errorf("error encoding rootfs information %#v: %w", rootFS, err) } rawRootfs := json.RawMessage(rootfs) raw["rootfs"] = &rawRootfs history, err := json.Marshal(convertedHistory) if err != nil { return nil, fmt.Errorf("error encoding history information %#v: %w", convertedHistory, err) } rawHistory := json.RawMessage(history) raw["history"] = &rawHistory // Encode the result. config, err = json.Marshal(raw) if err != nil { return nil, fmt.Errorf("error re-encoding compat image config %#v: %w", s1, err) } return config, nil } // ImageID computes an ID which can uniquely identify this image by its contents. func (m *Schema1) ImageID(diffIDs []digest.Digest) (string, error) { image, err := m.ToSchema2Config(diffIDs) if err != nil { return "", err } return digest.FromBytes(image).Encoded(), nil } ================================================ FILE: vendor/go.podman.io/image/v5/manifest/docker_schema2.go ================================================ package manifest import ( "encoding/json" "fmt" "time" "github.com/opencontainers/go-digest" "go.podman.io/image/v5/internal/manifest" compressiontypes "go.podman.io/image/v5/pkg/compression/types" "go.podman.io/image/v5/pkg/strslice" "go.podman.io/image/v5/types" ) // Schema2Descriptor is a “descriptor” in docker/distribution schema 2. type Schema2Descriptor = manifest.Schema2Descriptor // BlobInfoFromSchema2Descriptor returns a types.BlobInfo based on the input schema 2 descriptor. func BlobInfoFromSchema2Descriptor(desc Schema2Descriptor) types.BlobInfo { return types.BlobInfo{ Digest: desc.Digest, Size: desc.Size, URLs: desc.URLs, MediaType: desc.MediaType, } } // Schema2 is a manifest in docker/distribution schema 2. type Schema2 struct { SchemaVersion int `json:"schemaVersion"` MediaType string `json:"mediaType"` ConfigDescriptor Schema2Descriptor `json:"config"` LayersDescriptors []Schema2Descriptor `json:"layers"` } // Schema2Port is a Port, a string containing port number and protocol in the // format "80/tcp", from docker/go-connections/nat. type Schema2Port string // Schema2PortSet is a PortSet, a collection of structs indexed by Port, from // docker/go-connections/nat. type Schema2PortSet map[Schema2Port]struct{} // Schema2HealthConfig is a HealthConfig, which holds configuration settings // for the HEALTHCHECK feature, from docker/docker/api/types/container. type Schema2HealthConfig struct { // Test is the test to perform to check that the container is healthy. // An empty slice means to inherit the default. // The options are: // {} : inherit healthcheck // {"NONE"} : disable healthcheck // {"CMD", args...} : exec arguments directly // {"CMD-SHELL", command} : run command with system's default shell Test []string `json:",omitempty"` // Zero means to inherit. Durations are expressed as integer nanoseconds. StartPeriod time.Duration `json:",omitempty"` // StartPeriod is the time to wait after starting before running the first check. StartInterval time.Duration `json:",omitempty"` // StartInterval is the time to wait between checks during the start period. Interval time.Duration `json:",omitempty"` // Interval is the time to wait between checks. Timeout time.Duration `json:",omitempty"` // Timeout is the time to wait before considering the check to have hung. // Retries is the number of consecutive failures needed to consider a container as unhealthy. // Zero means inherit. Retries int `json:",omitempty"` } // Schema2Config is a Config in docker/docker/api/types/container. type Schema2Config struct { Hostname string // Hostname Domainname string // Domainname User string // User that will run the command(s) inside the container, also support user:group AttachStdin bool // Attach the standard input, makes possible user interaction AttachStdout bool // Attach the standard output AttachStderr bool // Attach the standard error ExposedPorts Schema2PortSet `json:",omitempty"` // List of exposed ports Tty bool // Attach standard streams to a tty, including stdin if it is not closed. OpenStdin bool // Open stdin StdinOnce bool // If true, close stdin after the 1 attached client disconnects. Env []string // List of environment variable to set in the container Cmd strslice.StrSlice // Command to run when starting the container Healthcheck *Schema2HealthConfig `json:",omitempty"` // Healthcheck describes how to check the container is healthy ArgsEscaped bool `json:",omitempty"` // True if command is already escaped (Windows specific) Image string // Name of the image as it was passed by the operator (e.g. could be symbolic) Volumes map[string]struct{} // List of volumes (mounts) used for the container WorkingDir string // Current directory (PWD) in the command will be launched Entrypoint strslice.StrSlice // Entrypoint to run when starting the container NetworkDisabled bool `json:",omitempty"` // Is network disabled MacAddress string `json:",omitempty"` // Mac Address of the container OnBuild []string // ONBUILD metadata that were defined on the image Dockerfile Labels map[string]string // List of labels set to this container StopSignal string `json:",omitempty"` // Signal to stop a container StopTimeout *int `json:",omitempty"` // Timeout (in seconds) to stop a container Shell strslice.StrSlice `json:",omitempty"` // Shell for shell-form of RUN, CMD, ENTRYPOINT } // Schema2V1Image is a V1Image in docker/docker/image. type Schema2V1Image struct { // ID is a unique 64 character identifier of the image ID string `json:"id,omitempty"` // Parent is the ID of the parent image Parent string `json:"parent,omitempty"` // Comment is the commit message that was set when committing the image Comment string `json:"comment,omitempty"` // Created is the timestamp at which the image was created Created time.Time `json:"created"` // Container is the id of the container used to commit Container string `json:"container,omitempty"` // ContainerConfig is the configuration of the container that is committed into the image ContainerConfig Schema2Config `json:"container_config"` // DockerVersion specifies the version of Docker that was used to build the image DockerVersion string `json:"docker_version,omitempty"` // Author is the name of the author that was specified when committing the image Author string `json:"author,omitempty"` // Config is the configuration of the container received from the client Config *Schema2Config `json:"config,omitempty"` // Architecture is the hardware that the image is built and runs on Architecture string `json:"architecture,omitempty"` // Variant is a variant of the CPU that the image is built and runs on Variant string `json:"variant,omitempty"` // OS is the operating system used to built and run the image OS string `json:"os,omitempty"` // Size is the total size of the image including all layers it is composed of Size int64 `json:",omitempty"` } // Schema2RootFS is a description of how to build up an image's root filesystem, from docker/docker/image. type Schema2RootFS struct { Type string `json:"type"` DiffIDs []digest.Digest `json:"diff_ids,omitempty"` } // Schema2History stores build commands that were used to create an image, from docker/docker/image. type Schema2History struct { // Created is the timestamp at which the image was created Created time.Time `json:"created"` // Author is the name of the author that was specified when committing the image Author string `json:"author,omitempty"` // CreatedBy keeps the Dockerfile command used while building the image CreatedBy string `json:"created_by,omitempty"` // Comment is the commit message that was set when committing the image Comment string `json:"comment,omitempty"` // EmptyLayer is set to true if this history item did not generate a // layer. Otherwise, the history item is associated with the next // layer in the RootFS section. EmptyLayer bool `json:"empty_layer,omitempty"` } // Schema2Image is an Image in docker/docker/image. type Schema2Image struct { Schema2V1Image Parent digest.Digest `json:"parent,omitempty"` RootFS *Schema2RootFS `json:"rootfs,omitempty"` History []Schema2History `json:"history,omitempty"` OSVersion string `json:"os.version,omitempty"` OSFeatures []string `json:"os.features,omitempty"` } // Schema2FromManifest creates a Schema2 manifest instance from a manifest blob. func Schema2FromManifest(manifestBlob []byte) (*Schema2, error) { s2 := Schema2{} if err := json.Unmarshal(manifestBlob, &s2); err != nil { return nil, err } if err := manifest.ValidateUnambiguousManifestFormat(manifestBlob, DockerV2Schema2MediaType, manifest.AllowedFieldConfig|manifest.AllowedFieldLayers); err != nil { return nil, err } // Check manifest's and layers' media types. if err := SupportedSchema2MediaType(s2.MediaType); err != nil { return nil, err } for _, layer := range s2.LayersDescriptors { if err := SupportedSchema2MediaType(layer.MediaType); err != nil { return nil, err } } return &s2, nil } // Schema2FromComponents creates an Schema2 manifest instance from the supplied data. func Schema2FromComponents(config Schema2Descriptor, layers []Schema2Descriptor) *Schema2 { return &Schema2{ SchemaVersion: 2, MediaType: DockerV2Schema2MediaType, ConfigDescriptor: config, LayersDescriptors: layers, } } // Schema2Clone creates a copy of the supplied Schema2 manifest. func Schema2Clone(src *Schema2) *Schema2 { copy := *src return © } // ConfigInfo returns a complete BlobInfo for the separate config object, or a BlobInfo{Digest:""} if there isn't a separate object. func (m *Schema2) ConfigInfo() types.BlobInfo { return BlobInfoFromSchema2Descriptor(m.ConfigDescriptor) } // LayerInfos returns a list of LayerInfos of layers referenced by this image, in order (the root layer first, and then successive layered layers). // The Digest field is guaranteed to be provided; Size may be -1. // WARNING: The list may contain duplicates, and they are semantically relevant. func (m *Schema2) LayerInfos() []LayerInfo { blobs := make([]LayerInfo, 0, len(m.LayersDescriptors)) for _, layer := range m.LayersDescriptors { blobs = append(blobs, LayerInfo{ BlobInfo: BlobInfoFromSchema2Descriptor(layer), EmptyLayer: false, }) } return blobs } var schema2CompressionMIMETypeSets = []compressionMIMETypeSet{ { mtsUncompressed: DockerV2Schema2ForeignLayerMediaType, compressiontypes.GzipAlgorithmName: DockerV2Schema2ForeignLayerMediaTypeGzip, compressiontypes.ZstdAlgorithmName: mtsUnsupportedMIMEType, }, { mtsUncompressed: DockerV2SchemaLayerMediaTypeUncompressed, compressiontypes.GzipAlgorithmName: DockerV2Schema2LayerMediaType, compressiontypes.ZstdAlgorithmName: mtsUnsupportedMIMEType, }, } // UpdateLayerInfos replaces the original layers with the specified BlobInfos (size+digest+urls), in order (the root layer first, and then successive layered layers) // The returned error will be a manifest.ManifestLayerCompressionIncompatibilityError if any of the layerInfos includes a combination of CompressionOperation and // CompressionAlgorithm that would result in anything other than gzip compression. func (m *Schema2) UpdateLayerInfos(layerInfos []types.BlobInfo) error { if len(m.LayersDescriptors) != len(layerInfos) { return fmt.Errorf("Error preparing updated manifest: layer count changed from %d to %d", len(m.LayersDescriptors), len(layerInfos)) } original := m.LayersDescriptors m.LayersDescriptors = make([]Schema2Descriptor, len(layerInfos)) for i, info := range layerInfos { mimeType := original[i].MediaType // First make sure we support the media type of the original layer. if err := SupportedSchema2MediaType(mimeType); err != nil { return fmt.Errorf("Error preparing updated manifest: unknown media type of original layer %q: %q", info.Digest, mimeType) } mimeType, err := updatedMIMEType(schema2CompressionMIMETypeSets, mimeType, info) if err != nil { return fmt.Errorf("preparing updated manifest, layer %q: %w", info.Digest, err) } m.LayersDescriptors[i].MediaType = mimeType m.LayersDescriptors[i].Digest = info.Digest m.LayersDescriptors[i].Size = info.Size m.LayersDescriptors[i].URLs = info.URLs if info.CryptoOperation != types.PreserveOriginalCrypto { return fmt.Errorf("encryption change (for layer %q) is not supported in schema2 manifests", info.Digest) } } return nil } // Serialize returns the manifest in a blob format. // NOTE: Serialize() does not in general reproduce the original blob if this object was loaded from one, even if no modifications were made! func (m *Schema2) Serialize() ([]byte, error) { return json.Marshal(*m) } // Inspect returns various information for (skopeo inspect) parsed from the manifest and configuration. func (m *Schema2) Inspect(configGetter func(types.BlobInfo) ([]byte, error)) (*types.ImageInspectInfo, error) { config, err := configGetter(m.ConfigInfo()) if err != nil { return nil, err } s2 := &Schema2Image{} if err := json.Unmarshal(config, s2); err != nil { return nil, err } layerInfos := m.LayerInfos() i := &types.ImageInspectInfo{ Tag: "", Created: &s2.Created, DockerVersion: s2.DockerVersion, Architecture: s2.Architecture, Variant: s2.Variant, Os: s2.OS, Layers: layerInfosToStrings(layerInfos), LayersData: imgInspectLayersFromLayerInfos(layerInfos), Author: s2.Author, } if s2.Config != nil { i.Labels = s2.Config.Labels i.Env = s2.Config.Env } return i, nil } // ImageID computes an ID which can uniquely identify this image by its contents. func (m *Schema2) ImageID([]digest.Digest) (string, error) { if err := m.ConfigDescriptor.Digest.Validate(); err != nil { return "", err } return m.ConfigDescriptor.Digest.Encoded(), nil } // CanChangeLayerCompression returns true if we can compress/decompress layers with mimeType in the current image // (and the code can handle that). // NOTE: Even if this returns true, the relevant format might not accept all compression algorithms; the set of accepted // algorithms depends not on the current format, but possibly on the target of a conversion. func (m *Schema2) CanChangeLayerCompression(mimeType string) bool { return compressionVariantsRecognizeMIMEType(schema2CompressionMIMETypeSets, mimeType) } ================================================ FILE: vendor/go.podman.io/image/v5/manifest/docker_schema2_list.go ================================================ package manifest import ( "go.podman.io/image/v5/internal/manifest" ) // Schema2PlatformSpec describes the platform which a particular manifest is // specialized for. type Schema2PlatformSpec = manifest.Schema2PlatformSpec // Schema2ManifestDescriptor references a platform-specific manifest. type Schema2ManifestDescriptor = manifest.Schema2ManifestDescriptor // Schema2List is a list of platform-specific manifests. type Schema2List = manifest.Schema2ListPublic // Schema2ListFromComponents creates a Schema2 manifest list instance from the // supplied data. func Schema2ListFromComponents(components []Schema2ManifestDescriptor) *Schema2List { return manifest.Schema2ListPublicFromComponents(components) } // Schema2ListClone creates a deep copy of the passed-in list. func Schema2ListClone(list *Schema2List) *Schema2List { return manifest.Schema2ListPublicClone(list) } // Schema2ListFromManifest creates a Schema2 manifest list instance from marshalled // JSON, presumably generated by encoding a Schema2 manifest list. func Schema2ListFromManifest(manifestBlob []byte) (*Schema2List, error) { return manifest.Schema2ListPublicFromManifest(manifestBlob) } ================================================ FILE: vendor/go.podman.io/image/v5/manifest/list.go ================================================ package manifest import ( imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" "go.podman.io/image/v5/internal/manifest" ) // SupportedListMIMETypes is a list of the manifest list types that we know how to // read/manipulate/write. var SupportedListMIMETypes = []string{ DockerV2ListMediaType, imgspecv1.MediaTypeImageIndex, } // List is an interface for parsing, modifying lists of image manifests. // Callers can either use this abstract interface without understanding the details of the formats, // or instantiate a specific implementation (e.g. manifest.OCI1Index) and access the public members // directly. type List = manifest.ListPublic // ListUpdate includes the fields which a List's UpdateInstances() method will modify. type ListUpdate = manifest.ListUpdate // ListFromBlob parses a list of manifests. func ListFromBlob(manifestBlob []byte, manifestMIMEType string) (List, error) { return manifest.ListPublicFromBlob(manifestBlob, manifestMIMEType) } // ConvertListToMIMEType converts the passed-in manifest list to a manifest // list of the specified type. func ConvertListToMIMEType(list List, manifestMIMEType string) (List, error) { return list.ConvertToMIMEType(manifestMIMEType) } ================================================ FILE: vendor/go.podman.io/image/v5/manifest/manifest.go ================================================ package manifest import ( "fmt" "github.com/containers/libtrust" digest "github.com/opencontainers/go-digest" imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" "go.podman.io/image/v5/internal/manifest" "go.podman.io/image/v5/types" ) // FIXME: Should we just use docker/distribution and docker/docker implementations directly? // FIXME(runcom, mitr): should we have a mediatype pkg?? const ( // DockerV2Schema1MediaType MIME type represents Docker manifest schema 1 DockerV2Schema1MediaType = manifest.DockerV2Schema1MediaType // DockerV2Schema1SignedMediaType MIME type represents Docker manifest schema 1 with a JWS signature DockerV2Schema1SignedMediaType = manifest.DockerV2Schema1SignedMediaType // DockerV2Schema2MediaType MIME type represents Docker manifest schema 2 DockerV2Schema2MediaType = manifest.DockerV2Schema2MediaType // DockerV2Schema2ConfigMediaType is the MIME type used for schema 2 config blobs. DockerV2Schema2ConfigMediaType = manifest.DockerV2Schema2ConfigMediaType // DockerV2Schema2LayerMediaType is the MIME type used for schema 2 layers. DockerV2Schema2LayerMediaType = manifest.DockerV2Schema2LayerMediaType // DockerV2SchemaLayerMediaTypeUncompressed is the mediaType used for uncompressed layers. DockerV2SchemaLayerMediaTypeUncompressed = manifest.DockerV2SchemaLayerMediaTypeUncompressed // DockerV2SchemaLayerMediaTypeZstd is the mediaType used for zstd layers. // Warning: This mediaType is not officially supported in https://github.com/distribution/distribution/blob/main/docs/content/spec/manifest-v2-2.md but some images may exhibit it. Support is partial. DockerV2SchemaLayerMediaTypeZstd = manifest.DockerV2SchemaLayerMediaTypeZstd // DockerV2ListMediaType MIME type represents Docker manifest schema 2 list DockerV2ListMediaType = manifest.DockerV2ListMediaType // DockerV2Schema2ForeignLayerMediaType is the MIME type used for schema 2 foreign layers. DockerV2Schema2ForeignLayerMediaType = manifest.DockerV2Schema2ForeignLayerMediaType // DockerV2Schema2ForeignLayerMediaTypeGzip is the MIME type used for gzipped schema 2 foreign layers. DockerV2Schema2ForeignLayerMediaTypeGzip = manifest.DockerV2Schema2ForeignLayerMediaTypeGzip ) // NonImageArtifactError (detected via errors.As) is used when asking for an image-specific operation // on an object which is not a “container image” in the standard sense (e.g. an OCI artifact) type NonImageArtifactError = manifest.NonImageArtifactError // SupportedSchema2MediaType checks if the specified string is a supported Docker v2s2 media type. func SupportedSchema2MediaType(m string) error { switch m { case DockerV2ListMediaType, DockerV2Schema1MediaType, DockerV2Schema1SignedMediaType, DockerV2Schema2ConfigMediaType, DockerV2Schema2ForeignLayerMediaType, DockerV2Schema2ForeignLayerMediaTypeGzip, DockerV2Schema2LayerMediaType, DockerV2Schema2MediaType, DockerV2SchemaLayerMediaTypeUncompressed, DockerV2SchemaLayerMediaTypeZstd: return nil default: return fmt.Errorf("unsupported docker v2s2 media type: %q", m) } } // DefaultRequestedManifestMIMETypes is a list of MIME types a types.ImageSource // should request from the backend unless directed otherwise. var DefaultRequestedManifestMIMETypes = []string{ imgspecv1.MediaTypeImageManifest, DockerV2Schema2MediaType, DockerV2Schema1SignedMediaType, DockerV2Schema1MediaType, DockerV2ListMediaType, imgspecv1.MediaTypeImageIndex, } // Manifest is an interface for parsing, modifying image manifests in isolation. // Callers can either use this abstract interface without understanding the details of the formats, // or instantiate a specific implementation (e.g. manifest.OCI1) and access the public members // directly. // // See types.Image for functionality not limited to manifests, including format conversions and config parsing. // This interface is similar to, but not strictly equivalent to, the equivalent methods in types.Image. type Manifest interface { // ConfigInfo returns a complete BlobInfo for the separate config object, or a BlobInfo{Digest:""} if there isn't a separate object. ConfigInfo() types.BlobInfo // LayerInfos returns a list of LayerInfos of layers referenced by this image, in order (the root layer first, and then successive layered layers). // The Digest field is guaranteed to be provided; Size may be -1. // WARNING: The list may contain duplicates, and they are semantically relevant. LayerInfos() []LayerInfo // UpdateLayerInfos replaces the original layers with the specified BlobInfos (size+digest+urls), in order (the root layer first, and then successive layered layers) UpdateLayerInfos(layerInfos []types.BlobInfo) error // ImageID computes an ID which can uniquely identify this image by its contents, irrespective // of which (of possibly more than one simultaneously valid) reference was used to locate the // image, and unchanged by whether or how the layers are compressed. The result takes the form // of the hexadecimal portion of a digest.Digest. ImageID(diffIDs []digest.Digest) (string, error) // Inspect returns various information for (skopeo inspect) parsed from the manifest, // incorporating information from a configuration blob returned by configGetter, if // the underlying image format is expected to include a configuration blob. Inspect(configGetter func(types.BlobInfo) ([]byte, error)) (*types.ImageInspectInfo, error) // Serialize returns the manifest in a blob format. // NOTE: Serialize() does not in general reproduce the original blob if this object was loaded from one, even if no modifications were made! Serialize() ([]byte, error) } // LayerInfo is an extended version of types.BlobInfo for low-level users of Manifest.LayerInfos. type LayerInfo struct { types.BlobInfo EmptyLayer bool // The layer is an “empty”/“throwaway” one, and may or may not be physically represented in various transport / storage systems. false if the manifest type does not have the concept. } // GuessMIMEType guesses MIME type of a manifest and returns it _if it is recognized_, or "" if unknown or unrecognized. // FIXME? We should, in general, prefer out-of-band MIME type instead of blindly parsing the manifest, // but we may not have such metadata available (e.g. when the manifest is a local file). func GuessMIMEType(manifestBlob []byte) string { return manifest.GuessMIMEType(manifestBlob) } // Digest returns the a digest of a docker manifest, with any necessary implied transformations like stripping v1s1 signatures. func Digest(manifestBlob []byte) (digest.Digest, error) { return manifest.Digest(manifestBlob) } // DigestWithAlgorithm returns the digest of a docker manifest using the specified algorithm, // with any necessary implied transformations like stripping v1s1 signatures. func DigestWithAlgorithm(manifestBlob []byte, algo digest.Algorithm) (digest.Digest, error) { return manifest.DigestWithAlgorithm(manifestBlob, algo) } // MatchesDigest returns true iff the manifest matches expectedDigest. // Error may be set if this returns false. // Note that this is not doing ConstantTimeCompare; by the time we get here, the cryptographic signature must already have been verified, // or we are not using a cryptographic channel and the attacker can modify the digest along with the manifest blob. func MatchesDigest(manifestBlob []byte, expectedDigest digest.Digest) (bool, error) { return manifest.MatchesDigest(manifestBlob, expectedDigest) } // AddDummyV2S1Signature adds an JWS signature with a temporary key (i.e. useless) to a v2s1 manifest. // This is useful to make the manifest acceptable to a docker/distribution registry (even though nothing needs or wants the JWS signature). func AddDummyV2S1Signature(manifest []byte) ([]byte, error) { key, err := libtrust.GenerateECP256PrivateKey() if err != nil { return nil, err // Coverage: This can fail only if rand.Reader fails. } js, err := libtrust.NewJSONSignature(manifest) if err != nil { return nil, err } if err := js.Sign(key); err != nil { // Coverage: This can fail basically only if rand.Reader fails. return nil, err } return js.PrettySignature("signatures") } // MIMETypeIsMultiImage returns true if mimeType is a list of images func MIMETypeIsMultiImage(mimeType string) bool { return mimeType == DockerV2ListMediaType || mimeType == imgspecv1.MediaTypeImageIndex } // MIMETypeSupportsEncryption returns true if the mimeType supports encryption func MIMETypeSupportsEncryption(mimeType string) bool { return mimeType == imgspecv1.MediaTypeImageManifest } // NormalizedMIMEType returns the effective MIME type of a manifest MIME type returned by a server, // centralizing various workarounds. func NormalizedMIMEType(input string) string { return manifest.NormalizedMIMEType(input) } // FromBlob returns a Manifest instance for the specified manifest blob and the corresponding MIME type func FromBlob(manblob []byte, mt string) (Manifest, error) { nmt := NormalizedMIMEType(mt) switch nmt { case DockerV2Schema1MediaType, DockerV2Schema1SignedMediaType: return Schema1FromManifest(manblob) case imgspecv1.MediaTypeImageManifest: return OCI1FromManifest(manblob) case DockerV2Schema2MediaType: return Schema2FromManifest(manblob) case DockerV2ListMediaType, imgspecv1.MediaTypeImageIndex: return nil, fmt.Errorf("Treating manifest lists as individual manifests is not implemented") } // Note that this may not be reachable, NormalizedMIMEType has a default for unknown values. return nil, fmt.Errorf("Unimplemented manifest MIME type %q (normalized as %q)", mt, nmt) } ================================================ FILE: vendor/go.podman.io/image/v5/manifest/oci.go ================================================ package manifest import ( "encoding/json" "fmt" "slices" "strings" ociencspec "github.com/containers/ocicrypt/spec" "github.com/opencontainers/go-digest" "github.com/opencontainers/image-spec/specs-go" imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" "go.podman.io/image/v5/internal/manifest" compressiontypes "go.podman.io/image/v5/pkg/compression/types" "go.podman.io/image/v5/types" ) // BlobInfoFromOCI1Descriptor returns a types.BlobInfo based on the input OCI1 descriptor. func BlobInfoFromOCI1Descriptor(desc imgspecv1.Descriptor) types.BlobInfo { return types.BlobInfo{ Digest: desc.Digest, Size: desc.Size, URLs: desc.URLs, Annotations: desc.Annotations, MediaType: desc.MediaType, } } // OCI1 is a manifest.Manifest implementation for OCI images. // The underlying data from imgspecv1.Manifest is also available. type OCI1 struct { imgspecv1.Manifest } // SupportedOCI1MediaType checks if the specified string is a supported OCI1 // media type. // // Deprecated: blindly rejecting unknown MIME types when the consumer does not // need to process the input just reduces interoperability (and violates the // standard) with no benefit, and that this function does not check that the // media type is appropriate for any specific purpose, so it’s not all that // useful for validation anyway. func SupportedOCI1MediaType(m string) error { switch m { case imgspecv1.MediaTypeDescriptor, imgspecv1.MediaTypeImageConfig, imgspecv1.MediaTypeImageLayer, imgspecv1.MediaTypeImageLayerGzip, imgspecv1.MediaTypeImageLayerZstd, imgspecv1.MediaTypeImageLayerNonDistributable, imgspecv1.MediaTypeImageLayerNonDistributableGzip, imgspecv1.MediaTypeImageLayerNonDistributableZstd, //nolint:staticcheck // NonDistributable layers are deprecated, but we want to continue to support manipulating pre-existing images. imgspecv1.MediaTypeImageManifest, imgspecv1.MediaTypeLayoutHeader, ociencspec.MediaTypeLayerEnc, ociencspec.MediaTypeLayerGzipEnc: return nil default: return fmt.Errorf("unsupported OCIv1 media type: %q", m) } } // OCI1FromManifest creates an OCI1 manifest instance from a manifest blob. func OCI1FromManifest(manifestBlob []byte) (*OCI1, error) { oci1 := OCI1{} if err := json.Unmarshal(manifestBlob, &oci1); err != nil { return nil, err } if err := manifest.ValidateUnambiguousManifestFormat(manifestBlob, imgspecv1.MediaTypeImageManifest, manifest.AllowedFieldConfig|manifest.AllowedFieldLayers); err != nil { return nil, err } return &oci1, nil } // OCI1FromComponents creates an OCI1 manifest instance from the supplied data. func OCI1FromComponents(config imgspecv1.Descriptor, layers []imgspecv1.Descriptor) *OCI1 { return &OCI1{ imgspecv1.Manifest{ Versioned: specs.Versioned{SchemaVersion: 2}, MediaType: imgspecv1.MediaTypeImageManifest, Config: config, Layers: layers, }, } } // OCI1Clone creates a copy of the supplied OCI1 manifest. func OCI1Clone(src *OCI1) *OCI1 { return &OCI1{ Manifest: src.Manifest, } } // ConfigInfo returns a complete BlobInfo for the separate config object, or a BlobInfo{Digest:""} if there isn't a separate object. func (m *OCI1) ConfigInfo() types.BlobInfo { return BlobInfoFromOCI1Descriptor(m.Config) } // LayerInfos returns a list of LayerInfos of layers referenced by this image, in order (the root layer first, and then successive layered layers). // The Digest field is guaranteed to be provided; Size may be -1. // WARNING: The list may contain duplicates, and they are semantically relevant. func (m *OCI1) LayerInfos() []LayerInfo { blobs := make([]LayerInfo, 0, len(m.Layers)) for _, layer := range m.Layers { blobs = append(blobs, LayerInfo{ BlobInfo: BlobInfoFromOCI1Descriptor(layer), EmptyLayer: false, }) } return blobs } var oci1CompressionMIMETypeSets = []compressionMIMETypeSet{ { mtsUncompressed: imgspecv1.MediaTypeImageLayerNonDistributable, //nolint:staticcheck // NonDistributable layers are deprecated, but we want to continue to support manipulating pre-existing images. compressiontypes.GzipAlgorithmName: imgspecv1.MediaTypeImageLayerNonDistributableGzip, //nolint:staticcheck // NonDistributable layers are deprecated, but we want to continue to support manipulating pre-existing images. compressiontypes.ZstdAlgorithmName: imgspecv1.MediaTypeImageLayerNonDistributableZstd, //nolint:staticcheck // NonDistributable layers are deprecated, but we want to continue to support manipulating pre-existing images. }, { mtsUncompressed: imgspecv1.MediaTypeImageLayer, compressiontypes.GzipAlgorithmName: imgspecv1.MediaTypeImageLayerGzip, compressiontypes.ZstdAlgorithmName: imgspecv1.MediaTypeImageLayerZstd, }, } // UpdateLayerInfos replaces the original layers with the specified BlobInfos (size+digest+urls+mediatype), in order (the root layer first, and then successive layered layers) // The returned error will be a manifest.ManifestLayerCompressionIncompatibilityError if any of the layerInfos includes a combination of CompressionOperation and // CompressionAlgorithm that isn't supported by OCI. // // It’s generally the caller’s responsibility to determine whether a particular edit is acceptable, rather than relying on // failures of this function, because the layer is typically created _before_ UpdateLayerInfos is called, because UpdateLayerInfos needs // to know the final digest). See OCI1.CanChangeLayerCompression for some help in determining this; other aspects like compression // algorithms that might not be supported by a format, or the limited set of MIME types accepted for encryption, are not currently // handled — that logic should eventually also be provided as OCI1 methods, not hard-coded in callers. func (m *OCI1) UpdateLayerInfos(layerInfos []types.BlobInfo) error { if len(m.Layers) != len(layerInfos) { return fmt.Errorf("Error preparing updated manifest: layer count changed from %d to %d", len(m.Layers), len(layerInfos)) } original := m.Layers m.Layers = make([]imgspecv1.Descriptor, len(layerInfos)) for i, info := range layerInfos { mimeType := original[i].MediaType if info.CryptoOperation == types.Decrypt { decMimeType, err := getDecryptedMediaType(mimeType) if err != nil { return fmt.Errorf("error preparing updated manifest: decryption specified but original mediatype is not encrypted: %q", mimeType) } mimeType = decMimeType } mimeType, err := updatedMIMEType(oci1CompressionMIMETypeSets, mimeType, info) if err != nil { return fmt.Errorf("preparing updated manifest, layer %q: %w", info.Digest, err) } if info.CryptoOperation == types.Encrypt { encMediaType, err := getEncryptedMediaType(mimeType) if err != nil { return fmt.Errorf("error preparing updated manifest: encryption specified but no counterpart for mediatype: %q", mimeType) } mimeType = encMediaType } m.Layers[i].MediaType = mimeType m.Layers[i].Digest = info.Digest m.Layers[i].Size = info.Size m.Layers[i].Annotations = info.Annotations m.Layers[i].URLs = info.URLs } return nil } // getEncryptedMediaType will return the mediatype to its encrypted counterpart and return // an error if the mediatype does not support encryption func getEncryptedMediaType(mediatype string) (string, error) { parts := strings.Split(mediatype, "+") if slices.Contains(parts[1:], "encrypted") { return "", fmt.Errorf("unsupported mediaType: %q already encrypted", mediatype) } unsuffixedMediatype := parts[0] switch unsuffixedMediatype { case DockerV2Schema2LayerMediaType, imgspecv1.MediaTypeImageLayer, imgspecv1.MediaTypeImageLayerNonDistributable: //nolint:staticcheck // NonDistributable layers are deprecated, but we want to continue to support manipulating pre-existing images. return mediatype + "+encrypted", nil } return "", fmt.Errorf("unsupported mediaType to encrypt: %q", mediatype) } // getDecryptedMediaType will return the mediatype to its encrypted counterpart and return // an error if the mediatype does not support decryption func getDecryptedMediaType(mediatype string) (string, error) { res, ok := strings.CutSuffix(mediatype, "+encrypted") if !ok { return "", fmt.Errorf("unsupported mediaType to decrypt: %q", mediatype) } return res, nil } // Serialize returns the manifest in a blob format. // NOTE: Serialize() does not in general reproduce the original blob if this object was loaded from one, even if no modifications were made! func (m *OCI1) Serialize() ([]byte, error) { return json.Marshal(*m) } // Inspect returns various information for (skopeo inspect) parsed from the manifest and configuration. func (m *OCI1) Inspect(configGetter func(types.BlobInfo) ([]byte, error)) (*types.ImageInspectInfo, error) { if m.Config.MediaType != imgspecv1.MediaTypeImageConfig { // We could return at least the layers, but that’s already available in a better format via types.Image.LayerInfos. // Most software calling this without human intervention is going to expect the values to be realistic and relevant, // and is probably better served by failing; we can always re-visit that later if we fail now, but // if we started returning some data for OCI artifacts now, we couldn’t start failing in this function later. return nil, manifest.NewNonImageArtifactError(&m.Manifest) } config, err := configGetter(m.ConfigInfo()) if err != nil { return nil, err } v1 := &imgspecv1.Image{} if err := json.Unmarshal(config, v1); err != nil { return nil, err } d1 := &Schema2V1Image{} if err := json.Unmarshal(config, d1); err != nil { return nil, err } layerInfos := m.LayerInfos() i := &types.ImageInspectInfo{ Tag: "", Created: v1.Created, DockerVersion: d1.DockerVersion, Labels: v1.Config.Labels, Architecture: v1.Architecture, Variant: v1.Variant, Os: v1.OS, Layers: layerInfosToStrings(layerInfos), LayersData: imgInspectLayersFromLayerInfos(layerInfos), Env: v1.Config.Env, Author: v1.Author, } return i, nil } // ImageID computes an ID which can uniquely identify this image by its contents. func (m *OCI1) ImageID(diffIDs []digest.Digest) (string, error) { // The way m.Config.Digest “uniquely identifies” an image is // by containing RootFS.DiffIDs, which identify the layers of the image. // For non-image artifacts, the we can’t expect the config to change // any time the other layers (semantically) change, so this approach of // distinguishing objects only by m.Config.Digest doesn’t work in general. // // Any caller of this method presumably wants to disambiguate the same // images with a different representation, but doesn’t want to disambiguate // representations (by using a manifest digest). So, submitting a non-image // artifact to such a caller indicates an expectation mismatch. // So, we just fail here instead of inventing some other ID value (e.g. // by combining the config and blob layer digests). That still // gives us the option to not fail, and return some value, in the future, // without committing to that approach now. // (The only known caller of ImageID is storage/storageImageDestination.computeID, // which can’t work with non-image artifacts.) if m.Config.MediaType != imgspecv1.MediaTypeImageConfig { return "", manifest.NewNonImageArtifactError(&m.Manifest) } if err := m.Config.Digest.Validate(); err != nil { return "", err } return m.Config.Digest.Encoded(), nil } // CanChangeLayerCompression returns true if we can compress/decompress layers with mimeType in the current image // (and the code can handle that). // NOTE: Even if this returns true, the relevant format might not accept all compression algorithms; the set of accepted // algorithms depends not on the current format, but possibly on the target of a conversion. func (m *OCI1) CanChangeLayerCompression(mimeType string) bool { if m.Config.MediaType != imgspecv1.MediaTypeImageConfig { return false } return compressionVariantsRecognizeMIMEType(oci1CompressionMIMETypeSets, mimeType) } ================================================ FILE: vendor/go.podman.io/image/v5/manifest/oci_index.go ================================================ package manifest import ( imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" "go.podman.io/image/v5/internal/manifest" ) // OCI1Index is just an alias for the OCI index type, but one which we can // provide methods for. type OCI1Index = manifest.OCI1IndexPublic // OCI1IndexFromComponents creates an OCI1 image index instance from the // supplied data. func OCI1IndexFromComponents(components []imgspecv1.Descriptor, annotations map[string]string) *OCI1Index { return manifest.OCI1IndexPublicFromComponents(components, annotations) } // OCI1IndexClone creates a deep copy of the passed-in index. func OCI1IndexClone(index *OCI1Index) *OCI1Index { return manifest.OCI1IndexPublicClone(index) } // OCI1IndexFromManifest creates an OCI1 manifest index instance from marshalled // JSON, presumably generated by encoding a OCI1 manifest index. func OCI1IndexFromManifest(manifestBlob []byte) (*OCI1Index, error) { return manifest.OCI1IndexPublicFromManifest(manifestBlob) } ================================================ FILE: vendor/go.podman.io/image/v5/oci/archive/oci_dest.go ================================================ package archive import ( "context" "fmt" "io" "os" "time" digest "github.com/opencontainers/go-digest" imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" "github.com/sirupsen/logrus" "go.podman.io/image/v5/internal/imagedestination" "go.podman.io/image/v5/internal/imagedestination/impl" "go.podman.io/image/v5/internal/private" "go.podman.io/image/v5/internal/signature" "go.podman.io/image/v5/types" "go.podman.io/storage/pkg/archive" "go.podman.io/storage/pkg/idtools" ) type ociArchiveImageDestination struct { impl.Compat ref ociArchiveReference unpackedDest private.ImageDestination tempDirRef tempDirOCIRef } // newImageDestination returns an ImageDestination for writing to an existing directory. func newImageDestination(ctx context.Context, sys *types.SystemContext, ref ociArchiveReference) (private.ImageDestination, error) { tempDirRef, err := createOCIRef(sys, ref.image) if err != nil { return nil, fmt.Errorf("creating oci reference: %w", err) } unpackedDest, err := tempDirRef.ociRefExtracted.NewImageDestination(ctx, sys) if err != nil { if err := tempDirRef.deleteTempDir(); err != nil { return nil, fmt.Errorf("deleting temp directory %q: %w", tempDirRef.tempDirectory, err) } return nil, err } d := &ociArchiveImageDestination{ ref: ref, unpackedDest: imagedestination.FromPublic(unpackedDest), tempDirRef: tempDirRef, } d.Compat = impl.AddCompat(d) return d, nil } // Reference returns the reference used to set up this destination. func (d *ociArchiveImageDestination) Reference() types.ImageReference { return d.ref } // Close removes resources associated with an initialized ImageDestination, if any // Close deletes the temp directory of the oci-archive image func (d *ociArchiveImageDestination) Close() error { defer func() { err := d.tempDirRef.deleteTempDir() logrus.Debugf("Error deleting temporary directory: %v", err) }() return d.unpackedDest.Close() } func (d *ociArchiveImageDestination) SupportedManifestMIMETypes() []string { return d.unpackedDest.SupportedManifestMIMETypes() } // SupportsSignatures returns an error (to be displayed to the user) if the destination certainly can't store signatures func (d *ociArchiveImageDestination) SupportsSignatures(ctx context.Context) error { return d.unpackedDest.SupportsSignatures(ctx) } func (d *ociArchiveImageDestination) DesiredLayerCompression() types.LayerCompression { return d.unpackedDest.DesiredLayerCompression() } // AcceptsForeignLayerURLs returns false iff foreign layers in manifest should be actually // uploaded to the image destination, true otherwise. func (d *ociArchiveImageDestination) AcceptsForeignLayerURLs() bool { return d.unpackedDest.AcceptsForeignLayerURLs() } // MustMatchRuntimeOS returns true iff the destination can store only images targeted for the current runtime architecture and OS. False otherwise func (d *ociArchiveImageDestination) MustMatchRuntimeOS() bool { return d.unpackedDest.MustMatchRuntimeOS() } // IgnoresEmbeddedDockerReference returns true iff the destination does not care about Image.EmbeddedDockerReferenceConflicts(), // and would prefer to receive an unmodified manifest instead of one modified for the destination. // Does not make a difference if Reference().DockerReference() is nil. func (d *ociArchiveImageDestination) IgnoresEmbeddedDockerReference() bool { return d.unpackedDest.IgnoresEmbeddedDockerReference() } // HasThreadSafePutBlob indicates whether PutBlob can be executed concurrently. func (d *ociArchiveImageDestination) HasThreadSafePutBlob() bool { return false } // SupportsPutBlobPartial returns true if PutBlobPartial is supported. func (d *ociArchiveImageDestination) SupportsPutBlobPartial() bool { return d.unpackedDest.SupportsPutBlobPartial() } // NoteOriginalOCIConfig provides the config of the image, as it exists on the source, BUT converted to OCI format, // or an error obtaining that value (e.g. if the image is an artifact and not a container image). // The destination can use it in its TryReusingBlob/PutBlob implementations // (otherwise it only obtains the final config after all layers are written). func (d *ociArchiveImageDestination) NoteOriginalOCIConfig(ociConfig *imgspecv1.Image, configErr error) error { return d.unpackedDest.NoteOriginalOCIConfig(ociConfig, configErr) } // PutBlobWithOptions writes contents of stream and returns data representing the result. // inputInfo.Digest can be optionally provided if known; if provided, and stream is read to the end without error, the digest MUST match the stream contents. // inputInfo.Size is the expected length of stream, if known. // inputInfo.MediaType describes the blob format, if known. // WARNING: The contents of stream are being verified on the fly. Until stream.Read() returns io.EOF, the contents of the data SHOULD NOT be available // to any other readers for download using the supplied digest. // If stream.Read() at any time, ESPECIALLY at end of input, returns an error, PutBlobWithOptions MUST 1) fail, and 2) delete any data stored so far. func (d *ociArchiveImageDestination) PutBlobWithOptions(ctx context.Context, stream io.Reader, inputInfo types.BlobInfo, options private.PutBlobOptions) (private.UploadedBlob, error) { return d.unpackedDest.PutBlobWithOptions(ctx, stream, inputInfo, options) } // PutBlobPartial attempts to create a blob using the data that is already present // at the destination. chunkAccessor is accessed in a non-sequential way to retrieve the missing chunks. // It is available only if SupportsPutBlobPartial(). // Even if SupportsPutBlobPartial() returns true, the call can fail. // If the call fails with ErrFallbackToOrdinaryLayerDownload, the caller can fall back to PutBlobWithOptions. // The fallback _must not_ be done otherwise. func (d *ociArchiveImageDestination) PutBlobPartial(ctx context.Context, chunkAccessor private.BlobChunkAccessor, srcInfo types.BlobInfo, options private.PutBlobPartialOptions) (private.UploadedBlob, error) { return d.unpackedDest.PutBlobPartial(ctx, chunkAccessor, srcInfo, options) } // TryReusingBlobWithOptions checks whether the transport already contains, or can efficiently reuse, a blob, and if so, applies it to the current destination // (e.g. if the blob is a filesystem layer, this signifies that the changes it describes need to be applied again when composing a filesystem tree). // info.Digest must not be empty. // If the blob has been successfully reused, returns (true, info, nil). // If the transport can not reuse the requested blob, TryReusingBlob returns (false, {}, nil); it returns a non-nil error only on an unexpected failure. func (d *ociArchiveImageDestination) TryReusingBlobWithOptions(ctx context.Context, info types.BlobInfo, options private.TryReusingBlobOptions) (bool, private.ReusedBlob, error) { return d.unpackedDest.TryReusingBlobWithOptions(ctx, info, options) } // PutManifest writes the manifest to the destination. // If instanceDigest is not nil, it contains a digest of the specific manifest instance to overwrite the manifest for (when // the primary manifest is a manifest list); this should always be nil if the primary manifest is not a manifest list. // It is expected but not enforced that the instanceDigest, when specified, matches the digest of `manifest` as generated // by `manifest.Digest()`. func (d *ociArchiveImageDestination) PutManifest(ctx context.Context, m []byte, instanceDigest *digest.Digest) error { return d.unpackedDest.PutManifest(ctx, m, instanceDigest) } // PutSignaturesWithFormat writes a set of signatures to the destination. // If instanceDigest is not nil, it contains a digest of the specific manifest instance to write or overwrite the signatures for // (when the primary manifest is a manifest list); this should always be nil if the primary manifest is not a manifest list. // MUST be called after PutManifest (signatures may reference manifest contents). func (d *ociArchiveImageDestination) PutSignaturesWithFormat(ctx context.Context, signatures []signature.Signature, instanceDigest *digest.Digest) error { return d.unpackedDest.PutSignaturesWithFormat(ctx, signatures, instanceDigest) } // CommitWithOptions marks the process of storing the image as successful and asks for the image to be persisted. // WARNING: This does not have any transactional semantics: // - Uploaded data MAY be visible to others before CommitWithOptions() is called // - Uploaded data MAY be removed or MAY remain around if Close() is called without CommitWithOptions() (i.e. rollback is allowed but not guaranteed) func (d *ociArchiveImageDestination) CommitWithOptions(ctx context.Context, options private.CommitOptions) error { if err := d.unpackedDest.CommitWithOptions(ctx, options); err != nil { return fmt.Errorf("storing image %q: %w", d.ref.image, err) } // path of directory to tar up src := d.tempDirRef.tempDirectory // path to save tarred up file dst := d.ref.resolvedFile return tarDirectory(src, dst, options.Timestamp) } // tar converts the directory at src and saves it to dst // if contentModTimes is non-nil, tar header entries times are set to this func tarDirectory(src, dst string, contentModTimes *time.Time) (retErr error) { // input is a stream of bytes from the archive of the directory at path input, err := archive.TarWithOptions(src, &archive.TarOptions{ Compression: archive.Uncompressed, // Don’t include the data about the user account this code is running under. ChownOpts: &idtools.IDPair{UID: 0, GID: 0}, // override tar header timestamps Timestamp: contentModTimes, }) if err != nil { return fmt.Errorf("retrieving stream of bytes from %q: %w", src, err) } defer input.Close() // creates the tar file outFile, err := os.Create(dst) if err != nil { return fmt.Errorf("creating tar file %q: %w", dst, err) } // since we are writing to this file, make sure we handle errors defer func() { closeErr := outFile.Close() if retErr == nil { retErr = closeErr } }() // copies the contents of the directory to the tar file // TODO: This can take quite some time, and should ideally be cancellable using a context.Context. _, err = io.Copy(outFile, input) return err } ================================================ FILE: vendor/go.podman.io/image/v5/oci/archive/oci_src.go ================================================ package archive import ( "context" "errors" "fmt" "io" digest "github.com/opencontainers/go-digest" imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" "github.com/sirupsen/logrus" "go.podman.io/image/v5/internal/imagesource" "go.podman.io/image/v5/internal/imagesource/impl" "go.podman.io/image/v5/internal/private" "go.podman.io/image/v5/internal/signature" ocilayout "go.podman.io/image/v5/oci/layout" "go.podman.io/image/v5/types" ) // ImageNotFoundError is used when the OCI structure, in principle, exists and seems valid enough, // but nothing matches the “image” part of the provided reference. type ImageNotFoundError struct { ref ociArchiveReference // We may make members public, or add methods, in the future. } func (e ImageNotFoundError) Error() string { return fmt.Sprintf("no descriptor found for reference %q", e.ref.image) } // ArchiveFileNotFoundError occurs when the archive file does not exist. type ArchiveFileNotFoundError struct { // ref is the image reference ref ociArchiveReference // path is the file path that was not present path string } func (e ArchiveFileNotFoundError) Error() string { return fmt.Sprintf("archive file not found: %q", e.path) } type ociArchiveImageSource struct { impl.Compat ref ociArchiveReference unpackedSrc private.ImageSource tempDirRef tempDirOCIRef } // newImageSource returns an ImageSource for reading from an existing directory. // newImageSource untars the file and saves it in a temp directory func newImageSource(ctx context.Context, sys *types.SystemContext, ref ociArchiveReference) (private.ImageSource, error) { tempDirRef, err := createUntarTempDir(sys, ref) if err != nil { return nil, fmt.Errorf("creating temp directory: %w", err) } unpackedSrc, err := tempDirRef.ociRefExtracted.NewImageSource(ctx, sys) if err != nil { var notFound ocilayout.ImageNotFoundError if errors.As(err, ¬Found) { err = ImageNotFoundError{ref: ref} } if err := tempDirRef.deleteTempDir(); err != nil { return nil, fmt.Errorf("deleting temp directory %q: %w", tempDirRef.tempDirectory, err) } return nil, err } s := &ociArchiveImageSource{ ref: ref, unpackedSrc: imagesource.FromPublic(unpackedSrc), tempDirRef: tempDirRef, } s.Compat = impl.AddCompat(s) return s, nil } // LoadManifestDescriptor loads the manifest // // Deprecated: use LoadManifestDescriptorWithContext instead func LoadManifestDescriptor(imgRef types.ImageReference) (imgspecv1.Descriptor, error) { return LoadManifestDescriptorWithContext(nil, imgRef) } // LoadManifestDescriptorWithContext loads the manifest func LoadManifestDescriptorWithContext(sys *types.SystemContext, imgRef types.ImageReference) (imgspecv1.Descriptor, error) { ociArchRef, ok := imgRef.(ociArchiveReference) if !ok { return imgspecv1.Descriptor{}, errors.New("error typecasting, need type ociArchiveReference") } tempDirRef, err := createUntarTempDir(sys, ociArchRef) if err != nil { return imgspecv1.Descriptor{}, fmt.Errorf("creating temp directory: %w", err) } defer func() { err := tempDirRef.deleteTempDir() logrus.Debugf("Error deleting temporary directory: %v", err) }() descriptor, err := ocilayout.LoadManifestDescriptor(tempDirRef.ociRefExtracted) if err != nil { return imgspecv1.Descriptor{}, fmt.Errorf("loading index: %w", err) } return descriptor, nil } // Reference returns the reference used to set up this source. func (s *ociArchiveImageSource) Reference() types.ImageReference { return s.ref } // Close removes resources associated with an initialized ImageSource, if any. // Close deletes the temporary directory at dst func (s *ociArchiveImageSource) Close() error { defer func() { err := s.tempDirRef.deleteTempDir() logrus.Debugf("error deleting tmp dir: %v", err) }() return s.unpackedSrc.Close() } // GetManifest returns the image's manifest along with its MIME type (which may be empty when it can't be determined but the manifest is available). // It may use a remote (= slow) service. // If instanceDigest is not nil, it contains a digest of the specific manifest instance to retrieve (when the primary manifest is a manifest list); // this never happens if the primary manifest is not a manifest list (e.g. if the source never returns manifest lists). func (s *ociArchiveImageSource) GetManifest(ctx context.Context, instanceDigest *digest.Digest) ([]byte, string, error) { return s.unpackedSrc.GetManifest(ctx, instanceDigest) } // HasThreadSafeGetBlob indicates whether GetBlob can be executed concurrently. func (s *ociArchiveImageSource) HasThreadSafeGetBlob() bool { return false } // GetBlob returns a stream for the specified blob, and the blob’s size (or -1 if unknown). // The Digest field in BlobInfo is guaranteed to be provided, Size may be -1 and MediaType may be optionally provided. // May update BlobInfoCache, preferably after it knows for certain that a blob truly exists at a specific location. func (s *ociArchiveImageSource) GetBlob(ctx context.Context, info types.BlobInfo, cache types.BlobInfoCache) (io.ReadCloser, int64, error) { return s.unpackedSrc.GetBlob(ctx, info, cache) } // SupportsGetBlobAt() returns true if GetBlobAt (BlobChunkAccessor) is supported. func (s *ociArchiveImageSource) SupportsGetBlobAt() bool { return s.unpackedSrc.SupportsGetBlobAt() } // GetBlobAt returns a sequential channel of readers that contain data for the requested // blob chunks, and a channel that might get a single error value. // The specified chunks must be not overlapping and sorted by their offset. // The readers must be fully consumed, in the order they are returned, before blocking // to read the next chunk. // If the Length for the last chunk is set to math.MaxUint64, then it // fully fetches the remaining data from the offset to the end of the blob. func (s *ociArchiveImageSource) GetBlobAt(ctx context.Context, info types.BlobInfo, chunks []private.ImageSourceChunk) (chan io.ReadCloser, chan error, error) { return s.unpackedSrc.GetBlobAt(ctx, info, chunks) } // GetSignaturesWithFormat returns the image's signatures. It may use a remote (= slow) service. // If instanceDigest is not nil, it contains a digest of the specific manifest instance to retrieve signatures for // (when the primary manifest is a manifest list); this never happens if the primary manifest is not a manifest list // (e.g. if the source never returns manifest lists). func (s *ociArchiveImageSource) GetSignaturesWithFormat(ctx context.Context, instanceDigest *digest.Digest) ([]signature.Signature, error) { return s.unpackedSrc.GetSignaturesWithFormat(ctx, instanceDigest) } // LayerInfosForCopy returns either nil (meaning the values in the manifest are fine), or updated values for the layer // blobsums that are listed in the image's manifest. If values are returned, they should be used when using GetBlob() // to read the image's layers. // If instanceDigest is not nil, it contains a digest of the specific manifest instance to retrieve BlobInfos for // (when the primary manifest is a manifest list); this never happens if the primary manifest is not a manifest list // (e.g. if the source never returns manifest lists). // The Digest field is guaranteed to be provided; Size may be -1. // WARNING: The list may contain duplicates, and they are semantically relevant. func (s *ociArchiveImageSource) LayerInfosForCopy(ctx context.Context, instanceDigest *digest.Digest) ([]types.BlobInfo, error) { return s.unpackedSrc.LayerInfosForCopy(ctx, instanceDigest) } ================================================ FILE: vendor/go.podman.io/image/v5/oci/archive/oci_transport.go ================================================ package archive import ( "context" "errors" "fmt" "io/fs" "os" "strings" "go.podman.io/image/v5/directory/explicitfilepath" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/internal/image" "go.podman.io/image/v5/internal/tmpdir" "go.podman.io/image/v5/oci/internal" ocilayout "go.podman.io/image/v5/oci/layout" "go.podman.io/image/v5/transports" "go.podman.io/image/v5/types" "go.podman.io/storage/pkg/archive" ) func init() { transports.Register(Transport) } // Transport is an ImageTransport for OCI archive // it creates an oci-archive tar file by calling into the OCI transport // tarring the directory created by oci and deleting the directory var Transport = ociArchiveTransport{} type ociArchiveTransport struct{} // ociArchiveReference is an ImageReference for OCI Archive paths type ociArchiveReference struct { file string resolvedFile string image string } func (t ociArchiveTransport) Name() string { return "oci-archive" } // ParseReference converts a string, which should not start with the ImageTransport.Name prefix // into an ImageReference. func (t ociArchiveTransport) ParseReference(reference string) (types.ImageReference, error) { return ParseReference(reference) } // ValidatePolicyConfigurationScope checks that scope is a valid name for a signature.PolicyTransportScopes keys func (t ociArchiveTransport) ValidatePolicyConfigurationScope(scope string) error { return internal.ValidateScope(scope) } // ParseReference converts a string, which should not start with the ImageTransport.Name prefix, into an OCI archive ImageReference. func ParseReference(reference string) (types.ImageReference, error) { file, image := internal.SplitPathAndImage(reference) return NewReference(file, image) } // NewReference returns an OCI archive reference for a file and an optional image name annotation (if not ""). func NewReference(file, image string) (types.ImageReference, error) { resolved, err := explicitfilepath.ResolvePathToFullyExplicit(file) if err != nil { return nil, err } if err := internal.ValidateOCIPath(file); err != nil { return nil, err } if err := internal.ValidateImageName(image); err != nil { return nil, err } return ociArchiveReference{file: file, resolvedFile: resolved, image: image}, nil } func (ref ociArchiveReference) Transport() types.ImageTransport { return Transport } // StringWithinTransport returns a string representation of the reference, which MUST be such that // reference.Transport().ParseReference(reference.StringWithinTransport()) returns an equivalent reference. func (ref ociArchiveReference) StringWithinTransport() string { return fmt.Sprintf("%s:%s", ref.file, ref.image) } // DockerReference returns a Docker reference associated with this reference func (ref ociArchiveReference) DockerReference() reference.Named { return nil } // PolicyConfigurationIdentity returns a string representation of the reference, suitable for policy lookup. func (ref ociArchiveReference) PolicyConfigurationIdentity() string { // NOTE: ref.image is not a part of the image identity, because "$dir:$someimage" and "$dir:" may mean the // same image and the two can’t be statically disambiguated. Using at least the repository directory is // less granular but hopefully still useful. return ref.resolvedFile } // PolicyConfigurationNamespaces returns a list of other policy configuration namespaces to search // for if explicit configuration for PolicyConfigurationIdentity() is not set func (ref ociArchiveReference) PolicyConfigurationNamespaces() []string { res := []string{} path := ref.resolvedFile for { lastSlash := strings.LastIndex(path, "/") // Note that we do not include "/"; it is redundant with the default "" global default, // and rejected by ociTransport.ValidatePolicyConfigurationScope above. if lastSlash == -1 || path == "/" { break } res = append(res, path) path = path[:lastSlash] } return res } // NewImage returns a types.ImageCloser for this reference, possibly specialized for this ImageTransport. // The caller must call .Close() on the returned ImageCloser. // NOTE: If any kind of signature verification should happen, build an UnparsedImage from the value returned by NewImageSource, // verify that UnparsedImage, and convert it into a real Image via image.FromUnparsedImage. // WARNING: This may not do the right thing for a manifest list, see image.FromSource for details. func (ref ociArchiveReference) NewImage(ctx context.Context, sys *types.SystemContext) (types.ImageCloser, error) { return image.FromReference(ctx, sys, ref) } // NewImageSource returns a types.ImageSource for this reference. // The caller must call .Close() on the returned ImageSource. func (ref ociArchiveReference) NewImageSource(ctx context.Context, sys *types.SystemContext) (types.ImageSource, error) { return newImageSource(ctx, sys, ref) } // NewImageDestination returns a types.ImageDestination for this reference. // The caller must call .Close() on the returned ImageDestination. func (ref ociArchiveReference) NewImageDestination(ctx context.Context, sys *types.SystemContext) (types.ImageDestination, error) { return newImageDestination(ctx, sys, ref) } // DeleteImage deletes the named image from the registry, if supported. func (ref ociArchiveReference) DeleteImage(ctx context.Context, sys *types.SystemContext) error { return errors.New("Deleting images not implemented for oci: images") } // struct to store the ociReference and temporary directory returned by createOCIRef type tempDirOCIRef struct { tempDirectory string ociRefExtracted types.ImageReference } // deletes the temporary directory created func (t *tempDirOCIRef) deleteTempDir() error { return os.RemoveAll(t.tempDirectory) } // createOCIRef creates the oci reference of the image // If SystemContext.BigFilesTemporaryDir not "", overrides the temporary directory to use for storing big files func createOCIRef(sys *types.SystemContext, image string) (tempDirOCIRef, error) { dir, err := tmpdir.MkDirBigFileTemp(sys, "oci") if err != nil { return tempDirOCIRef{}, fmt.Errorf("creating temp directory: %w", err) } ociRef, err := ocilayout.NewReference(dir, image) if err != nil { return tempDirOCIRef{}, err } tempDirRef := tempDirOCIRef{tempDirectory: dir, ociRefExtracted: ociRef} return tempDirRef, nil } // creates the temporary directory and copies the tarred content to it func createUntarTempDir(sys *types.SystemContext, ref ociArchiveReference) (tempDirOCIRef, error) { src := ref.resolvedFile arch, err := os.Open(src) if err != nil { if errors.Is(err, fs.ErrNotExist) { return tempDirOCIRef{}, ArchiveFileNotFoundError{ref: ref, path: src} } else { return tempDirOCIRef{}, err } } defer arch.Close() tempDirRef, err := createOCIRef(sys, ref.image) if err != nil { return tempDirOCIRef{}, fmt.Errorf("creating oci reference: %w", err) } dst := tempDirRef.tempDirectory // TODO: This can take quite some time, and should ideally be cancellable using a context.Context. if err := archive.NewDefaultArchiver().Untar(arch, dst, &archive.TarOptions{NoLchown: true}); err != nil { if err := tempDirRef.deleteTempDir(); err != nil { return tempDirOCIRef{}, fmt.Errorf("deleting temp directory %q: %w", tempDirRef.tempDirectory, err) } return tempDirOCIRef{}, fmt.Errorf("untarring file %q: %w", tempDirRef.tempDirectory, err) } return tempDirRef, nil } ================================================ FILE: vendor/go.podman.io/image/v5/oci/internal/oci_util.go ================================================ package internal import ( "errors" "fmt" "path/filepath" "regexp" "runtime" "strconv" "strings" ) // annotation spex from https://github.com/opencontainers/image-spec/blob/master/annotations.md#pre-defined-annotation-keys const ( separator = `(?:[-._:@+]|--)` alphanum = `(?:[A-Za-z0-9]+)` component = `(?:` + alphanum + `(?:` + separator + alphanum + `)*)` ) var ( refRegexp = regexp.MustCompile(`^` + component + `(?:/` + component + `)*$`) windowsRefRegexp = regexp.MustCompile(`^([a-zA-Z]:\\.+?):(.*)$`) ) // ValidateImageName returns nil if the image name is empty or matches the open-containers image name specs. // In any other case an error is returned. func ValidateImageName(image string) error { if len(image) == 0 { return nil } var err error if !refRegexp.MatchString(image) { err = fmt.Errorf("Invalid image %s", image) } return err } // SplitPathAndImage tries to split the provided OCI reference into the OCI path and image. // Neither path nor image parts are validated at this stage. func SplitPathAndImage(reference string) (string, string) { if runtime.GOOS == "windows" { return splitPathAndImageWindows(reference) } return splitPathAndImageNonWindows(reference) } func splitPathAndImageWindows(reference string) (string, string) { groups := windowsRefRegexp.FindStringSubmatch(reference) // nil group means no match if groups == nil { return reference, "" } // we expect three elements. First one full match, second the capture group for the path and // the third the capture group for the image if len(groups) != 3 { return reference, "" } return groups[1], groups[2] } func splitPathAndImageNonWindows(reference string) (string, string) { path, image, _ := strings.Cut(reference, ":") // image is set to "" if there is no ":" return path, image } // ValidateOCIPath takes the OCI path and validates it. func ValidateOCIPath(path string) error { if runtime.GOOS == "windows" { // On Windows we must allow for a ':' as part of the path if strings.Count(path, ":") > 1 { return fmt.Errorf("Invalid OCI reference: path %s contains more than one colon", path) } } else { if strings.Contains(path, ":") { return fmt.Errorf("Invalid OCI reference: path %s contains a colon", path) } } return nil } // ValidateScope validates a policy configuration scope for an OCI transport. func ValidateScope(scope string) error { var err error if runtime.GOOS == "windows" { err = validateScopeWindows(scope) } else { err = validateScopeNonWindows(scope) } if err != nil { return err } cleaned := filepath.Clean(scope) if cleaned != scope { return fmt.Errorf(`Invalid scope %s: Uses non-canonical path format, perhaps try with path %s`, scope, cleaned) } return nil } func validateScopeWindows(scope string) error { matched, _ := regexp.MatchString(`^[a-zA-Z]:\\`, scope) if !matched { return fmt.Errorf("Invalid scope '%s'. Must be an absolute path", scope) } return nil } func validateScopeNonWindows(scope string) error { if !strings.HasPrefix(scope, "/") { return fmt.Errorf("Invalid scope %s: must be an absolute path", scope) } // Refuse also "/", otherwise "/" and "" would have the same semantics, // and "" could be unexpectedly shadowed by the "/" entry. if scope == "/" { return errors.New(`Invalid scope "/": Use the generic default scope ""`) } return nil } // parseOCIReferenceName parses the image from the oci reference. func parseOCIReferenceName(image string) (img string, index int, err error) { index = -1 if strings.HasPrefix(image, "@") { idx, err := strconv.Atoi(image[1:]) if err != nil { return "", index, fmt.Errorf("Invalid source index @%s: not an integer: %w", image[1:], err) } if idx < 0 { return "", index, fmt.Errorf("Invalid source index @%d: must not be negative", idx) } index = idx } else { img = image } return img, index, nil } // ParseReferenceIntoElements splits the oci reference into location, image name and source index if exists func ParseReferenceIntoElements(reference string) (string, string, int, error) { dir, image := SplitPathAndImage(reference) image, index, err := parseOCIReferenceName(image) if err != nil { return "", "", -1, err } return dir, image, index, nil } ================================================ FILE: vendor/go.podman.io/image/v5/oci/layout/oci_delete.go ================================================ package layout import ( "context" "encoding/json" "fmt" "io/fs" "os" "slices" digest "github.com/opencontainers/go-digest" imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" "github.com/sirupsen/logrus" "go.podman.io/image/v5/internal/set" "go.podman.io/image/v5/types" ) // DeleteImage deletes the named image from the directory, if supported. func (ref ociReference) DeleteImage(ctx context.Context, sys *types.SystemContext) error { sharedBlobsDir := "" if sys != nil && sys.OCISharedBlobDirPath != "" { sharedBlobsDir = sys.OCISharedBlobDirPath } descriptor, descriptorIndex, err := ref.getManifestDescriptor() if err != nil { return err } blobsUsedByImage := make(map[digest.Digest]int) if err := ref.countBlobsForDescriptor(blobsUsedByImage, &descriptor, sharedBlobsDir); err != nil { return err } blobsToDelete, err := ref.getBlobsToDelete(blobsUsedByImage, sharedBlobsDir) if err != nil { return err } err = ref.deleteBlobs(blobsToDelete) if err != nil { return err } return ref.deleteReferenceFromIndex(descriptorIndex) } // countBlobsForDescriptor updates dest with usage counts of blobs required for descriptor, INCLUDING descriptor itself. func (ref ociReference) countBlobsForDescriptor(dest map[digest.Digest]int, descriptor *imgspecv1.Descriptor, sharedBlobsDir string) error { blobPath, err := ref.blobPath(descriptor.Digest, sharedBlobsDir) if err != nil { return err } dest[descriptor.Digest]++ switch descriptor.MediaType { case imgspecv1.MediaTypeImageManifest: manifest, err := parseJSON[imgspecv1.Manifest](blobPath) if err != nil { return err } dest[manifest.Config.Digest]++ for _, layer := range manifest.Layers { dest[layer.Digest]++ } case imgspecv1.MediaTypeImageIndex: index, err := parseIndex(blobPath) if err != nil { return err } if err := ref.countBlobsReferencedByIndex(dest, index, sharedBlobsDir); err != nil { return err } default: return fmt.Errorf("unsupported mediaType in index: %q", descriptor.MediaType) } return nil } // countBlobsReferencedByIndex updates dest with usage counts of blobs required for index, EXCLUDING the index itself. func (ref ociReference) countBlobsReferencedByIndex(destination map[digest.Digest]int, index *imgspecv1.Index, sharedBlobsDir string) error { for _, descriptor := range index.Manifests { if err := ref.countBlobsForDescriptor(destination, &descriptor, sharedBlobsDir); err != nil { return err } } return nil } // This takes in a map of the digest and their usage count in the manifest to be deleted // It will compare it to the digest usage in the root index, and return a set of the blobs that can be safely deleted func (ref ociReference) getBlobsToDelete(blobsUsedByDescriptorToDelete map[digest.Digest]int, sharedBlobsDir string) (*set.Set[digest.Digest], error) { rootIndex, err := ref.getIndex() if err != nil { return nil, err } blobsUsedInRootIndex := make(map[digest.Digest]int) err = ref.countBlobsReferencedByIndex(blobsUsedInRootIndex, rootIndex, sharedBlobsDir) if err != nil { return nil, err } blobsToDelete := set.New[digest.Digest]() for digest, count := range blobsUsedInRootIndex { if count-blobsUsedByDescriptorToDelete[digest] == 0 { blobsToDelete.Add(digest) } } return blobsToDelete, nil } // This transport never generates layouts where blobs for an image are both in the local blobs directory // and the shared one; it’s either one or the other, depending on how OCISharedBlobDirPath is set. // // But we can’t correctly compute use counts for OCISharedBlobDirPath (because we don't know what // the other layouts sharing that directory are, and we might not even have permission to read them), // so we can’t really delete any blobs in that case. // Checking the _local_ blobs directory, and deleting blobs from there, doesn't really hurt, // in case the layout was created using some other tool or without OCISharedBlobDirPath set, so let's silently // check for local blobs (but we should make no noise if the blobs are actually in the shared directory). // // So, NOTE: the blobPath() call below hard-codes "" even in calls where OCISharedBlobDirPath is set func (ref ociReference) deleteBlobs(blobsToDelete *set.Set[digest.Digest]) error { for digest := range blobsToDelete.All() { blobPath, err := ref.blobPath(digest, "") // Only delete in the local directory, see comment above if err != nil { return err } err = deleteBlob(blobPath) if err != nil { return err } } return nil } func deleteBlob(blobPath string) error { logrus.Debug(fmt.Sprintf("Deleting blob at %q", blobPath)) err := os.Remove(blobPath) if err != nil && !os.IsNotExist(err) { return err } else { return nil } } func (ref ociReference) deleteReferenceFromIndex(referenceIndex int) error { index, err := ref.getIndex() if err != nil { return err } index.Manifests = slices.Delete(index.Manifests, referenceIndex, referenceIndex+1) return saveJSON(ref.indexPath(), index) } func saveJSON(path string, content any) (retErr error) { // If the file already exists, get its mode to preserve it var mode fs.FileMode existingfi, err := os.Stat(path) if err != nil { if !os.IsNotExist(err) { return err } else { // File does not exist, use default mode mode = 0o644 } } else { mode = existingfi.Mode() } file, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, mode) if err != nil { return err } // since we are writing to this file, make sure we handle errors defer func() { closeErr := file.Close() if retErr == nil { retErr = closeErr } }() return json.NewEncoder(file).Encode(content) } ================================================ FILE: vendor/go.podman.io/image/v5/oci/layout/oci_dest.go ================================================ package layout import ( "context" "encoding/json" "errors" "fmt" "io" "io/fs" "os" "path/filepath" "runtime" "slices" digest "github.com/opencontainers/go-digest" imgspec "github.com/opencontainers/image-spec/specs-go" imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" "go.podman.io/image/v5/internal/imagedestination/impl" "go.podman.io/image/v5/internal/imagedestination/stubs" "go.podman.io/image/v5/internal/manifest" "go.podman.io/image/v5/internal/private" "go.podman.io/image/v5/internal/putblobdigest" "go.podman.io/image/v5/types" "go.podman.io/storage/pkg/fileutils" ) type ociImageDestination struct { impl.Compat impl.PropertyMethodsInitialize stubs.IgnoresOriginalOCIConfig stubs.NoPutBlobPartialInitialize stubs.NoSignaturesInitialize ref ociReference index imgspecv1.Index sharedBlobDir string } // newImageDestination returns an ImageDestination for writing to an existing directory. func newImageDestination(sys *types.SystemContext, ref ociReference) (private.ImageDestination, error) { if ref.sourceIndex != -1 { return nil, fmt.Errorf("Destination reference must not contain a manifest index @%d", ref.sourceIndex) } var index *imgspecv1.Index if indexExists(ref) { var err error index, err = ref.getIndex() if err != nil { return nil, err } } else { index = &imgspecv1.Index{ Versioned: imgspec.Versioned{SchemaVersion: 2}, MediaType: imgspecv1.MediaTypeImageIndex, Annotations: make(map[string]string), } } desiredLayerCompression := types.Compress if sys != nil && sys.OCIAcceptUncompressedLayers { desiredLayerCompression = types.PreserveOriginal } d := &ociImageDestination{ PropertyMethodsInitialize: impl.PropertyMethods(impl.Properties{ SupportedManifestMIMETypes: []string{ imgspecv1.MediaTypeImageManifest, imgspecv1.MediaTypeImageIndex, }, DesiredLayerCompression: desiredLayerCompression, AcceptsForeignLayerURLs: true, MustMatchRuntimeOS: false, IgnoresEmbeddedDockerReference: false, // N/A, DockerReference() returns nil. HasThreadSafePutBlob: true, }), NoPutBlobPartialInitialize: stubs.NoPutBlobPartial(ref), NoSignaturesInitialize: stubs.NoSignatures("Pushing signatures for OCI images is not supported"), ref: ref, index: *index, } d.Compat = impl.AddCompat(d) if sys != nil { d.sharedBlobDir = sys.OCISharedBlobDirPath } if err := ensureDirectoryExists(d.ref.dir); err != nil { return nil, err } // Per the OCI image specification, layouts MUST have a "blobs" subdirectory, // but it MAY be empty (e.g. if we never end up calling PutBlob) // https://github.com/opencontainers/image-spec/blame/7c889fafd04a893f5c5f50b7ab9963d5d64e5242/image-layout.md#L19 if err := ensureDirectoryExists(filepath.Join(d.ref.dir, imgspecv1.ImageBlobsDir)); err != nil { return nil, err } return d, nil } // Reference returns the reference used to set up this destination. Note that this should directly correspond to user's intent, // e.g. it should use the public hostname instead of the result of resolving CNAMEs or following redirects. func (d *ociImageDestination) Reference() types.ImageReference { return d.ref } // Close removes resources associated with an initialized ImageDestination, if any. func (d *ociImageDestination) Close() error { return nil } // PutBlobWithOptions writes contents of stream and returns data representing the result. // inputInfo.Digest can be optionally provided if known; if provided, and stream is read to the end without error, the digest MUST match the stream contents. // inputInfo.Size is the expected length of stream, if known. // inputInfo.MediaType describes the blob format, if known. // WARNING: The contents of stream are being verified on the fly. Until stream.Read() returns io.EOF, the contents of the data SHOULD NOT be available // to any other readers for download using the supplied digest. // If stream.Read() at any time, ESPECIALLY at end of input, returns an error, PutBlobWithOptions MUST 1) fail, and 2) delete any data stored so far. func (d *ociImageDestination) PutBlobWithOptions(ctx context.Context, stream io.Reader, inputInfo types.BlobInfo, options private.PutBlobOptions) (_ private.UploadedBlob, retErr error) { blobFile, err := os.CreateTemp(d.ref.dir, "oci-put-blob") if err != nil { return private.UploadedBlob{}, err } succeeded := false explicitClosed := false defer func() { if !explicitClosed { closeErr := blobFile.Close() if retErr == nil { retErr = closeErr } } if !succeeded { os.Remove(blobFile.Name()) } }() digester, stream := putblobdigest.DigestIfCanonicalUnknown(stream, inputInfo) // TODO: This can take quite some time, and should ideally be cancellable using ctx.Done(). size, err := io.Copy(blobFile, stream) if err != nil { return private.UploadedBlob{}, err } blobDigest := digester.Digest() if inputInfo.Size != -1 && size != inputInfo.Size { return private.UploadedBlob{}, fmt.Errorf("Size mismatch when copying %s, expected %d, got %d", blobDigest, inputInfo.Size, size) } if err := d.blobFileSyncAndRename(blobFile, blobDigest, &explicitClosed); err != nil { return private.UploadedBlob{}, err } succeeded = true return private.UploadedBlob{Digest: blobDigest, Size: size}, nil } // blobFileSyncAndRename syncs the specified blobFile on the filesystem and renames it to the // specific blob path determined by the blobDigest. The closed pointer indicates to the caller // whether blobFile has been closed or not. func (d *ociImageDestination) blobFileSyncAndRename(blobFile *os.File, blobDigest digest.Digest, closed *bool) error { if err := blobFile.Sync(); err != nil { return err } // On POSIX systems, blobFile was created with mode 0600, so we need to make it readable. // On Windows, the “permissions of newly created files” argument to syscall.Open is // ignored and the file is already readable; besides, blobFile.Chmod, i.e. syscall.Fchmod, // always fails on Windows. if runtime.GOOS != "windows" { if err := blobFile.Chmod(0o644); err != nil { return err } } blobPath, err := d.ref.blobPath(blobDigest, d.sharedBlobDir) if err != nil { return err } if err := ensureParentDirectoryExists(blobPath); err != nil { return err } // need to explicitly close the file, since a rename won't otherwise work on Windows err = blobFile.Close() if err != nil { return err } *closed = true if err := os.Rename(blobFile.Name(), blobPath); err != nil { return err } return nil } // TryReusingBlobWithOptions checks whether the transport already contains, or can efficiently reuse, a blob, and if so, applies it to the current destination // (e.g. if the blob is a filesystem layer, this signifies that the changes it describes need to be applied again when composing a filesystem tree). // info.Digest must not be empty. // If the blob has been successfully reused, returns (true, info, nil). // If the transport can not reuse the requested blob, TryReusingBlob returns (false, {}, nil); it returns a non-nil error only on an unexpected failure. func (d *ociImageDestination) TryReusingBlobWithOptions(ctx context.Context, info types.BlobInfo, options private.TryReusingBlobOptions) (bool, private.ReusedBlob, error) { if !impl.OriginalCandidateMatchesTryReusingBlobOptions(options) { return false, private.ReusedBlob{}, nil } if info.Digest == "" { return false, private.ReusedBlob{}, errors.New("Can not check for a blob with unknown digest") } blobPath, err := d.ref.blobPath(info.Digest, d.sharedBlobDir) if err != nil { return false, private.ReusedBlob{}, err } finfo, err := os.Stat(blobPath) if err != nil && os.IsNotExist(err) { return false, private.ReusedBlob{}, nil } if err != nil { return false, private.ReusedBlob{}, err } return true, private.ReusedBlob{Digest: info.Digest, Size: finfo.Size()}, nil } // PutManifest writes a manifest to the destination. Per our list of supported manifest MIME types, // this should be either an OCI manifest (possibly converted to this format by the caller) or index, // neither of which we'll need to modify further. // If instanceDigest is not nil, it contains a digest of the specific manifest instance to overwrite the manifest for (when // the primary manifest is a manifest list); this should always be nil if the primary manifest is not a manifest list. // It is expected but not enforced that the instanceDigest, when specified, matches the digest of `manifest` as generated // by `manifest.Digest()`. // FIXME? This should also receive a MIME type if known, to differentiate between schema versions. // If the destination is in principle available, refuses this manifest type (e.g. it does not recognize the schema), // but may accept a different manifest type, the returned error must be an ManifestTypeRejectedError. func (d *ociImageDestination) PutManifest(ctx context.Context, m []byte, instanceDigest *digest.Digest) error { var digest digest.Digest var err error if instanceDigest != nil { digest = *instanceDigest } else { digest, err = manifest.Digest(m) if err != nil { return err } } blobPath, err := d.ref.blobPath(digest, d.sharedBlobDir) if err != nil { return err } if err := ensureParentDirectoryExists(blobPath); err != nil { return err } if err := os.WriteFile(blobPath, m, 0o644); err != nil { return err } if instanceDigest != nil { return nil } // If we had platform information, we'd build an imgspecv1.Platform structure here. // Start filling out the descriptor for this entry desc := imgspecv1.Descriptor{} desc.Digest = digest desc.Size = int64(len(m)) if d.ref.image != "" { desc.Annotations = make(map[string]string) desc.Annotations[imgspecv1.AnnotationRefName] = d.ref.image } // If we knew the MIME type, we wouldn't have to guess here. desc.MediaType = manifest.GuessMIMEType(m) d.addManifest(&desc) return nil } func (d *ociImageDestination) addManifest(desc *imgspecv1.Descriptor) { // If the new entry has a name, remove any conflicting names which we already have. if desc.Annotations != nil && desc.Annotations[imgspecv1.AnnotationRefName] != "" { // The name is being set on a new entry, so remove any older ones that had the same name. // We might be storing an index and all of its component images, and we'll want to attach // the name to the last one, which is the index. for i, manifest := range d.index.Manifests { if manifest.Annotations[imgspecv1.AnnotationRefName] == desc.Annotations[imgspecv1.AnnotationRefName] { delete(d.index.Manifests[i].Annotations, imgspecv1.AnnotationRefName) break } } } // If it has the same digest as another entry in the index, we already overwrote the file, // so just pick up the other information. for i, manifest := range d.index.Manifests { if manifest.Digest == desc.Digest && manifest.Annotations[imgspecv1.AnnotationRefName] == "" { // Replace it completely. d.index.Manifests[i] = *desc return } } // It's a new entry to be added to the index. Use slices.Clone() to avoid a remote dependency on how d.index was created. d.index.Manifests = append(slices.Clone(d.index.Manifests), *desc) } // CommitWithOptions marks the process of storing the image as successful and asks for the image to be persisted. // WARNING: This does not have any transactional semantics: // - Uploaded data MAY be visible to others before CommitWithOptions() is called // - Uploaded data MAY be removed or MAY remain around if Close() is called without CommitWithOptions() (i.e. rollback is allowed but not guaranteed) func (d *ociImageDestination) CommitWithOptions(ctx context.Context, options private.CommitOptions) error { layoutBytes, err := json.Marshal(imgspecv1.ImageLayout{ Version: imgspecv1.ImageLayoutVersion, }) if err != nil { return err } if err := os.WriteFile(d.ref.ociLayoutPath(), layoutBytes, 0o644); err != nil { return err } indexJSON, err := json.Marshal(d.index) if err != nil { return err } return os.WriteFile(d.ref.indexPath(), indexJSON, 0o644) } // PutBlobFromLocalFileOption is unused but may receive functionality in the future. type PutBlobFromLocalFileOption struct{} // PutBlobFromLocalFile arranges the data from path to be used as blob with digest. // It computes, and returns, the digest and size of the used file. // // This function can be used instead of dest.PutBlob() where the ImageDestination requires PutBlob() to be called. func PutBlobFromLocalFile(ctx context.Context, dest types.ImageDestination, file string, options ...PutBlobFromLocalFileOption) (_ digest.Digest, _ int64, retErr error) { d, ok := dest.(*ociImageDestination) if !ok { return "", -1, errors.New("caller error: PutBlobFromLocalFile called with a non-oci: destination") } succeeded := false blobFileClosed := false blobFile, err := os.CreateTemp(d.ref.dir, "oci-put-blob") if err != nil { return "", -1, err } defer func() { if !blobFileClosed { closeErr := blobFile.Close() if retErr == nil { retErr = closeErr } } if !succeeded { os.Remove(blobFile.Name()) } }() srcFile, err := os.Open(file) if err != nil { return "", -1, err } defer srcFile.Close() err = fileutils.ReflinkOrCopy(srcFile, blobFile) if err != nil { return "", -1, err } _, err = blobFile.Seek(0, io.SeekStart) if err != nil { return "", -1, err } blobDigest, err := digest.FromReader(blobFile) if err != nil { return "", -1, err } fileInfo, err := blobFile.Stat() if err != nil { return "", -1, err } if err := d.blobFileSyncAndRename(blobFile, blobDigest, &blobFileClosed); err != nil { return "", -1, err } succeeded = true return blobDigest, fileInfo.Size(), nil } func ensureDirectoryExists(path string) error { if err := fileutils.Exists(path); err != nil && errors.Is(err, fs.ErrNotExist) { if err := os.MkdirAll(path, 0o755); err != nil { return err } } return nil } // ensureParentDirectoryExists ensures the parent of the supplied path exists. func ensureParentDirectoryExists(path string) error { return ensureDirectoryExists(filepath.Dir(path)) } // indexExists checks whether the index location specified in the OCI reference exists. // The implementation is opinionated, since in case of unexpected errors false is returned func indexExists(ref ociReference) bool { err := fileutils.Exists(ref.indexPath()) if err == nil { return true } if os.IsNotExist(err) { return false } return true } ================================================ FILE: vendor/go.podman.io/image/v5/oci/layout/oci_src.go ================================================ package layout import ( "context" "crypto/tls" "errors" "fmt" "io" "net/http" "net/url" "os" "strconv" "github.com/docker/go-connections/tlsconfig" "github.com/opencontainers/go-digest" imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" "go.podman.io/image/v5/internal/imagesource/impl" "go.podman.io/image/v5/internal/imagesource/stubs" "go.podman.io/image/v5/internal/manifest" "go.podman.io/image/v5/internal/private" "go.podman.io/image/v5/pkg/tlsclientconfig" "go.podman.io/image/v5/types" "go.podman.io/storage/pkg/fileutils" ) // ImageNotFoundError is used when the OCI structure, in principle, exists and seems valid enough, // but nothing matches the “image” part of the provided reference. type ImageNotFoundError struct { ref ociReference // We may make members public, or add methods, in the future. } func (e ImageNotFoundError) Error() string { return fmt.Sprintf("no descriptor found for reference %q", e.ref.image) } type ociImageSource struct { impl.Compat impl.PropertyMethodsInitialize impl.NoSignatures impl.DoesNotAffectLayerInfosForCopy stubs.NoGetBlobAtInitialize ref ociReference index *imgspecv1.Index descriptor imgspecv1.Descriptor client *http.Client sharedBlobDir string } // newImageSource returns an ImageSource for reading from an existing directory. func newImageSource(sys *types.SystemContext, ref ociReference) (private.ImageSource, error) { tr := tlsclientconfig.NewTransport() if sys != nil && sys.BaseTLSConfig != nil { tr.TLSClientConfig = sys.BaseTLSConfig.Clone() } else { tr.TLSClientConfig = &tls.Config{ // As of 2025-08, tlsconfig.ClientDefault() differs from Go 1.23 defaults only in CipherSuites; // so, limit us to only using that value. If go-connections/tlsconfig changes its policy, we // will want to consider that and make a decision whether to follow suit. // There is some chance that eventually the Go default will be to require TLS 1.3, and that point // we might want to drop the dependency on go-connections entirely. CipherSuites: tlsconfig.ClientDefault().CipherSuites, } } if sys != nil && sys.OCICertPath != "" { if err := tlsclientconfig.SetupCertificates(sys.OCICertPath, tr.TLSClientConfig); err != nil { return nil, err } tr.TLSClientConfig.InsecureSkipVerify = sys.OCIInsecureSkipTLSVerify } client := &http.Client{} client.Transport = tr descriptor, _, err := ref.getManifestDescriptor() if err != nil { return nil, err } index, err := ref.getIndex() if err != nil { return nil, err } s := &ociImageSource{ PropertyMethodsInitialize: impl.PropertyMethods(impl.Properties{ HasThreadSafeGetBlob: false, }), NoGetBlobAtInitialize: stubs.NoGetBlobAt(ref), ref: ref, index: index, descriptor: descriptor, client: client, } if sys != nil { // TODO(jonboulle): check dir existence? s.sharedBlobDir = sys.OCISharedBlobDirPath } s.Compat = impl.AddCompat(s) return s, nil } // Reference returns the reference used to set up this source. func (s *ociImageSource) Reference() types.ImageReference { return s.ref } // Close removes resources associated with an initialized ImageSource, if any. func (s *ociImageSource) Close() error { s.client.CloseIdleConnections() return nil } // GetManifest returns the image's manifest along with its MIME type (which may be empty when it can't be determined but the manifest is available). // It may use a remote (= slow) service. // If instanceDigest is not nil, it contains a digest of the specific manifest instance to retrieve (when the primary manifest is a manifest list); // this never happens if the primary manifest is not a manifest list (e.g. if the source never returns manifest lists). func (s *ociImageSource) GetManifest(ctx context.Context, instanceDigest *digest.Digest) ([]byte, string, error) { var dig digest.Digest var mimeType string var err error if instanceDigest == nil { dig = s.descriptor.Digest mimeType = s.descriptor.MediaType } else { dig = *instanceDigest for _, md := range s.index.Manifests { if md.Digest == dig { mimeType = md.MediaType break } } } manifestPath, err := s.ref.blobPath(dig, s.sharedBlobDir) if err != nil { return nil, "", err } m, err := os.ReadFile(manifestPath) if err != nil { return nil, "", err } if mimeType == "" { mimeType = manifest.GuessMIMEType(m) } return m, mimeType, nil } // GetBlob returns a stream for the specified blob, and the blob’s size (or -1 if unknown). // The Digest field in BlobInfo is guaranteed to be provided, Size may be -1 and MediaType may be optionally provided. // May update BlobInfoCache, preferably after it knows for certain that a blob truly exists at a specific location. func (s *ociImageSource) GetBlob(ctx context.Context, info types.BlobInfo, cache types.BlobInfoCache) (io.ReadCloser, int64, error) { if len(info.URLs) != 0 { r, s, err := s.getExternalBlob(ctx, info.URLs) if err != nil { return nil, 0, err } else if r != nil { return r, s, nil } } path, err := s.ref.blobPath(info.Digest, s.sharedBlobDir) if err != nil { return nil, 0, err } r, err := os.Open(path) if err != nil { return nil, 0, err } fi, err := r.Stat() if err != nil { return nil, 0, err } return r, fi.Size(), nil } // getExternalBlob returns the reader of the first available blob URL from urls, which must not be empty. // This function can return nil reader when no url is supported by this function. In this case, the caller // should fallback to fetch the non-external blob (i.e. pull from the registry). func (s *ociImageSource) getExternalBlob(ctx context.Context, urls []string) (io.ReadCloser, int64, error) { if len(urls) == 0 { return nil, 0, errors.New("internal error: getExternalBlob called with no URLs") } errWrap := errors.New("failed fetching external blob from all urls") hasSupportedURL := false for _, u := range urls { if u, err := url.Parse(u); err != nil || (u.Scheme != "http" && u.Scheme != "https") { continue // unsupported url. skip this url. } hasSupportedURL = true req, err := http.NewRequestWithContext(ctx, http.MethodGet, u, nil) if err != nil { errWrap = fmt.Errorf("fetching %q failed %s: %w", u, err.Error(), errWrap) continue } resp, err := s.client.Do(req) if err != nil { errWrap = fmt.Errorf("fetching %q failed %s: %w", u, err.Error(), errWrap) continue } if resp.StatusCode != http.StatusOK { resp.Body.Close() errWrap = fmt.Errorf("fetching %q failed, response code not 200: %w", u, errWrap) continue } return resp.Body, getBlobSize(resp), nil } if !hasSupportedURL { return nil, 0, nil // fallback to non-external blob } return nil, 0, errWrap } func getBlobSize(resp *http.Response) int64 { size, err := strconv.ParseInt(resp.Header.Get("Content-Length"), 10, 64) if err != nil { size = -1 } return size } // GetLocalBlobPath returns the local path to the blob file with the given digest. // The returned path is checked for existence so when a non existing digest is // given an error will be returned. // // Important: The returned path must be treated as read only, writing the file will // corrupt the oci layout as the digest no longer matches. func GetLocalBlobPath(ctx context.Context, src types.ImageSource, digest digest.Digest) (string, error) { s, ok := src.(*ociImageSource) if !ok { return "", errors.New("caller error: GetLocalBlobPath called with a non-oci: source") } path, err := s.ref.blobPath(digest, s.sharedBlobDir) if err != nil { return "", err } if err := fileutils.Exists(path); err != nil { return "", err } return path, nil } ================================================ FILE: vendor/go.podman.io/image/v5/oci/layout/oci_transport.go ================================================ package layout import ( "context" "encoding/json" "errors" "fmt" "os" "path/filepath" "strings" "github.com/opencontainers/go-digest" imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" "go.podman.io/image/v5/directory/explicitfilepath" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/internal/image" "go.podman.io/image/v5/internal/manifest" "go.podman.io/image/v5/oci/internal" "go.podman.io/image/v5/transports" "go.podman.io/image/v5/types" ) func init() { transports.Register(Transport) } var ( // Transport is an ImageTransport for OCI directories. Transport = ociTransport{} // ErrMoreThanOneImage is an error returned when the manifest includes // more than one image and the user should choose which one to use. ErrMoreThanOneImage = errors.New("more than one image in oci, choose an image") ) type ociTransport struct{} func (t ociTransport) Name() string { return "oci" } // ParseReference converts a string, which should not start with the ImageTransport.Name prefix, into an ImageReference. func (t ociTransport) ParseReference(reference string) (types.ImageReference, error) { return ParseReference(reference) } // ValidatePolicyConfigurationScope checks that scope is a valid name for a signature.PolicyTransportScopes keys // (i.e. a valid PolicyConfigurationIdentity() or PolicyConfigurationNamespaces() return value). // It is acceptable to allow an invalid value which will never be matched, it can "only" cause user confusion. // scope passed to this function will not be "", that value is always allowed. func (t ociTransport) ValidatePolicyConfigurationScope(scope string) error { return internal.ValidateScope(scope) } // ociReference is an ImageReference for OCI directory paths. type ociReference struct { // Note that the interpretation of paths below depends on the underlying filesystem state, which may change under us at any time! // Either of the paths may point to a different, or no, inode over time. resolvedDir may contain symbolic links, and so on. // Generally we follow the intent of the user, and use the "dir" member for filesystem operations (e.g. the user can use a relative path to avoid // being exposed to symlinks and renames in the parent directories to the working directory). // (But in general, we make no attempt to be completely safe against concurrent hostile filesystem modifications.) dir string // As specified by the user. May be relative, contain symlinks, etc. resolvedDir string // Absolute path with no symlinks, at least at the time of its creation. Primarily used for policy namespaces. // If image=="" && sourceIndex==-1, it means the "only image" in the index.json is used in the case it is a source // for destinations, the image name annotation "image.ref.name" is not added to the index.json. // // Must not be set if sourceIndex is set (the value is not -1). image string // If not -1, a zero-based index of an image in the manifest index. Valid only for sources. // Must not be set if image is set. sourceIndex int } // ParseReference converts a string, which should not start with the ImageTransport.Name prefix, into an OCI ImageReference. func ParseReference(reference string) (types.ImageReference, error) { dir, image, index, err := internal.ParseReferenceIntoElements(reference) if err != nil { return nil, err } return newReference(dir, image, index) } // newReference returns an OCI reference for a directory, and an image name annotation or sourceIndex. // // If sourceIndex==-1, the index will not be valid to point out the source image, only image will be used. // We do not expose an API supplying the resolvedDir; we could, but recomputing it // is generally cheap enough that we prefer being confident about the properties of resolvedDir. func newReference(dir, image string, sourceIndex int) (types.ImageReference, error) { resolved, err := explicitfilepath.ResolvePathToFullyExplicit(dir) if err != nil { return nil, err } if err := internal.ValidateOCIPath(dir); err != nil { return nil, err } if err = internal.ValidateImageName(image); err != nil { return nil, err } if sourceIndex != -1 && sourceIndex < 0 { return nil, fmt.Errorf("Invalid oci: layout reference: index @%d must not be negative", sourceIndex) } if sourceIndex != -1 && image != "" { return nil, fmt.Errorf("Invalid oci: layout reference: cannot use both an image %s and a source index @%d", image, sourceIndex) } return ociReference{dir: dir, resolvedDir: resolved, image: image, sourceIndex: sourceIndex}, nil } // NewIndexReference returns an OCI reference for a path and a zero-based source manifest index. func NewIndexReference(dir string, sourceIndex int) (types.ImageReference, error) { if sourceIndex < 0 { return nil, fmt.Errorf("invalid call to NewIndexReference with negative index %d", sourceIndex) } return newReference(dir, "", sourceIndex) } // NewReference returns an OCI reference for a directory and an optional image name annotation (if not ""). func NewReference(dir, image string) (types.ImageReference, error) { return newReference(dir, image, -1) } func (ref ociReference) Transport() types.ImageTransport { return Transport } // StringWithinTransport returns a string representation of the reference, which MUST be such that // reference.Transport().ParseReference(reference.StringWithinTransport()) returns an equivalent reference. // NOTE: The returned string is not promised to be equal to the original input to ParseReference; // e.g. default attribute values omitted by the user may be filled in the return value, or vice versa. // WARNING: Do not use the return value in the UI to describe an image, it does not contain the Transport().Name() prefix. func (ref ociReference) StringWithinTransport() string { if ref.sourceIndex == -1 { return fmt.Sprintf("%s:%s", ref.dir, ref.image) } return fmt.Sprintf("%s:@%d", ref.dir, ref.sourceIndex) } // DockerReference returns a Docker reference associated with this reference // (fully explicit, i.e. !reference.IsNameOnly, but reflecting user intent, // not e.g. after redirect or alias processing), or nil if unknown/not applicable. func (ref ociReference) DockerReference() reference.Named { return nil } // PolicyConfigurationIdentity returns a string representation of the reference, suitable for policy lookup. // This MUST reflect user intent, not e.g. after processing of third-party redirects or aliases; // The value SHOULD be fully explicit about its semantics, with no hidden defaults, AND canonical // (i.e. various references with exactly the same semantics should return the same configuration identity) // It is fine for the return value to be equal to StringWithinTransport(), and it is desirable but // not required/guaranteed that it will be a valid input to Transport().ParseReference(). // Returns "" if configuration identities for these references are not supported. func (ref ociReference) PolicyConfigurationIdentity() string { // NOTE: ref.image is not a part of the image identity, because "$dir:$someimage" and "$dir:" may mean the // same image and the two can’t be statically disambiguated. Using at least the repository directory is // less granular but hopefully still useful. return ref.resolvedDir } // PolicyConfigurationNamespaces returns a list of other policy configuration namespaces to search // for if explicit configuration for PolicyConfigurationIdentity() is not set. The list will be processed // in order, terminating on first match, and an implicit "" is always checked at the end. // It is STRONGLY recommended for the first element, if any, to be a prefix of PolicyConfigurationIdentity(), // and each following element to be a prefix of the element preceding it. func (ref ociReference) PolicyConfigurationNamespaces() []string { res := []string{} path := ref.resolvedDir for { lastSlash := strings.LastIndex(path, "/") // Note that we do not include "/"; it is redundant with the default "" global default, // and rejected by ociTransport.ValidatePolicyConfigurationScope above. if lastSlash == -1 || path == "/" { break } res = append(res, path) path = path[:lastSlash] } return res } // NewImage returns a types.ImageCloser for this reference, possibly specialized for this ImageTransport. // The caller must call .Close() on the returned ImageCloser. // NOTE: If any kind of signature verification should happen, build an UnparsedImage from the value returned by NewImageSource, // verify that UnparsedImage, and convert it into a real Image via image.FromUnparsedImage. // WARNING: This may not do the right thing for a manifest list, see image.FromSource for details. func (ref ociReference) NewImage(ctx context.Context, sys *types.SystemContext) (types.ImageCloser, error) { return image.FromReference(ctx, sys, ref) } // getIndex returns a pointer to the index references by this ociReference. If an error occurs opening an index nil is returned together // with an error. func (ref ociReference) getIndex() (*imgspecv1.Index, error) { return parseIndex(ref.indexPath()) } func parseIndex(path string) (*imgspecv1.Index, error) { return parseJSON[imgspecv1.Index](path) } func parseJSON[T any](path string) (*T, error) { content, err := os.Open(path) if err != nil { return nil, err } defer content.Close() obj := new(T) if err := json.NewDecoder(content).Decode(obj); err != nil { return nil, err } return obj, nil } func (ref ociReference) getManifestDescriptor() (imgspecv1.Descriptor, int, error) { index, err := ref.getIndex() if err != nil { return imgspecv1.Descriptor{}, -1, err } switch { case ref.image != "" && ref.sourceIndex != -1: // Coverage: newReference refuses to create such references. return imgspecv1.Descriptor{}, -1, fmt.Errorf("Internal error: Cannot have both ref %s and source index @%d", ref.image, ref.sourceIndex) case ref.sourceIndex != -1: if ref.sourceIndex >= len(index.Manifests) { return imgspecv1.Descriptor{}, -1, fmt.Errorf("index %d is too large, only %d entries available", ref.sourceIndex, len(index.Manifests)) } return index.Manifests[ref.sourceIndex], ref.sourceIndex, nil case ref.image != "": // if image specified, look through all manifests for a match var unsupportedMIMETypes []string for i, md := range index.Manifests { if refName, ok := md.Annotations[imgspecv1.AnnotationRefName]; ok && refName == ref.image { if md.MediaType == imgspecv1.MediaTypeImageManifest || md.MediaType == imgspecv1.MediaTypeImageIndex || md.MediaType == manifest.DockerV2Schema2MediaType || md.MediaType == manifest.DockerV2ListMediaType { return md, i, nil } unsupportedMIMETypes = append(unsupportedMIMETypes, md.MediaType) } } if len(unsupportedMIMETypes) != 0 { return imgspecv1.Descriptor{}, -1, fmt.Errorf("reference %q matches unsupported manifest MIME types %q", ref.image, unsupportedMIMETypes) } return imgspecv1.Descriptor{}, -1, ImageNotFoundError{ref} default: // return manifest if only one image is in the oci directory if len(index.Manifests) != 1 { // ask user to choose image when more than one image in the oci directory return imgspecv1.Descriptor{}, -1, ErrMoreThanOneImage } return index.Manifests[0], 0, nil } } // LoadManifestDescriptor loads the manifest descriptor to be used to retrieve the image name // when pulling an image func LoadManifestDescriptor(imgRef types.ImageReference) (imgspecv1.Descriptor, error) { ociRef, ok := imgRef.(ociReference) if !ok { return imgspecv1.Descriptor{}, errors.New("error typecasting, need type ociRef") } md, _, err := ociRef.getManifestDescriptor() return md, err } // NewImageSource returns a types.ImageSource for this reference. // The caller must call .Close() on the returned ImageSource. func (ref ociReference) NewImageSource(ctx context.Context, sys *types.SystemContext) (types.ImageSource, error) { return newImageSource(sys, ref) } // NewImageDestination returns a types.ImageDestination for this reference. // The caller must call .Close() on the returned ImageDestination. func (ref ociReference) NewImageDestination(ctx context.Context, sys *types.SystemContext) (types.ImageDestination, error) { return newImageDestination(sys, ref) } // ociLayoutPath returns a path for the oci-layout within a directory using OCI conventions. func (ref ociReference) ociLayoutPath() string { return filepath.Join(ref.dir, imgspecv1.ImageLayoutFile) } // indexPath returns a path for the index.json within a directory using OCI conventions. func (ref ociReference) indexPath() string { return filepath.Join(ref.dir, imgspecv1.ImageIndexFile) } // blobPath returns a path for a blob within a directory using OCI image-layout conventions. func (ref ociReference) blobPath(digest digest.Digest, sharedBlobDir string) (string, error) { if err := digest.Validate(); err != nil { return "", fmt.Errorf("unexpected digest reference %s: %w", digest, err) } var blobDir string if sharedBlobDir != "" { blobDir = sharedBlobDir } else { blobDir = filepath.Join(ref.dir, imgspecv1.ImageBlobsDir) } return filepath.Join(blobDir, digest.Algorithm().String(), digest.Encoded()), nil } ================================================ FILE: vendor/go.podman.io/image/v5/oci/layout/reader.go ================================================ package layout import ( "encoding/json" "fmt" "os" "path/filepath" imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" "go.podman.io/image/v5/types" ) // This file is named reader.go for consistency with other transports’ // handling of “image containers”, but we don’t actually need a stateful reader object. // ListResult wraps the image reference and the manifest for loading type ListResult struct { Reference types.ImageReference ManifestDescriptor imgspecv1.Descriptor } // List returns a slice of manifests included in the archive func List(dir string) ([]ListResult, error) { var res []ListResult indexJSON, err := os.ReadFile(filepath.Join(dir, imgspecv1.ImageIndexFile)) if err != nil { return nil, err } var index imgspecv1.Index if err := json.Unmarshal(indexJSON, &index); err != nil { return nil, err } for manifestIndex, md := range index.Manifests { refName := md.Annotations[imgspecv1.AnnotationRefName] index := -1 if refName == "" { index = manifestIndex } ref, err := newReference(dir, refName, index) if err != nil { return nil, fmt.Errorf("error creating image reference: %w", err) } reference := ListResult{ Reference: ref, ManifestDescriptor: md, } res = append(res, reference) } return res, nil } ================================================ FILE: vendor/go.podman.io/image/v5/openshift/openshift-copies.go ================================================ package openshift import ( "crypto/tls" "crypto/x509" "encoding/base64" "errors" "fmt" "net" "net/http" "net/netip" "net/url" "os" "path" "path/filepath" "reflect" "slices" "strings" "time" "dario.cat/mergo" "github.com/sirupsen/logrus" "go.podman.io/image/v5/internal/multierr" "go.podman.io/image/v5/types" "go.podman.io/storage/pkg/homedir" "gopkg.in/yaml.v3" ) // restTLSClientConfig is a modified copy of k8s.io/kubernetes/pkg/client/restclient.TLSClientConfig. // restTLSClientConfig contains settings to enable transport layer security type restTLSClientConfig struct { // Server requires TLS client certificate authentication CertFile string // Server requires TLS client certificate authentication KeyFile string // Trusted root certificates for server CAFile string // CertData holds PEM-encoded bytes (typically read from a client certificate file). // CertData takes precedence over CertFile CertData []byte // KeyData holds PEM-encoded bytes (typically read from a client certificate key file). // KeyData takes precedence over KeyFile KeyData []byte // CAData holds PEM-encoded bytes (typically read from a root certificates bundle). // CAData takes precedence over CAFile CAData []byte } // restConfig is a modified copy of k8s.io/kubernetes/pkg/client/restclient.Config. // Config holds the common attributes that can be passed to a Kubernetes client on // initialization. type restConfig struct { // Host must be a host string, a host:port pair, or a URL to the base of the apiserver. // If a URL is given then the (optional) Path of that URL represents a prefix that must // be appended to all request URIs used to access the apiserver. This allows a frontend // proxy to easily relocate all of the apiserver endpoints. Host string // Server requires Basic authentication Username string Password string // Server requires Bearer authentication. This client will not attempt to use // refresh tokens for an OAuth2 flow. // TODO: demonstrate an OAuth2 compatible client. BearerToken string // TLSClientConfig contains settings to enable transport layer security TLSClientConfig restTLSClientConfig // Server should be accessed without verifying the TLS // certificate. For testing only. Insecure bool } // ClientConfig is a modified copy of k8s.io/kubernetes/pkg/client/unversioned/clientcmd.ClientConfig. // ClientConfig is used to make it easy to get an api server client type clientConfig interface { // ClientConfig returns a complete client config ClientConfig() (*restConfig, error) } // defaultClientConfig is a modified copy of openshift/origin/pkg/cmd/util/clientcmd.DefaultClientConfig. func defaultClientConfig() clientConfig { loadingRules := newOpenShiftClientConfigLoadingRules() // REMOVED: Allowing command-line overriding of loadingRules // REMOVED: clientcmd.ConfigOverrides clientConfig := newNonInteractiveDeferredLoadingClientConfig(loadingRules) return clientConfig } var recommendedHomeFile = path.Join(homedir.Get(), ".kube/config") // newOpenShiftClientConfigLoadingRules is a modified copy of openshift/origin/pkg/cmd/cli/config.NewOpenShiftClientConfigLoadingRules. // NewOpenShiftClientConfigLoadingRules returns file priority loading rules for OpenShift. // 1. --config value // 2. if KUBECONFIG env var has a value, use it. Otherwise, ~/.kube/config file func newOpenShiftClientConfigLoadingRules() *clientConfigLoadingRules { chain := []string{} envVarFile := os.Getenv("KUBECONFIG") if len(envVarFile) != 0 { chain = append(chain, filepath.SplitList(envVarFile)...) } else { chain = append(chain, recommendedHomeFile) } return &clientConfigLoadingRules{ Precedence: chain, // REMOVED: Migration support; run (oc login) to trigger migration } } // deferredLoadingClientConfig is a modified copy of k8s.io/kubernetes/pkg/client/unversioned/clientcmd.DeferredLoadingClientConfig. // DeferredLoadingClientConfig is a ClientConfig interface that is backed by a set of loading rules // It is used in cases where the loading rules may change after you've instantiated them and you want to be sure that // the most recent rules are used. This is useful in cases where you bind flags to loading rule parameters before // the parse happens and you want your calling code to be ignorant of how the values are being mutated to avoid // passing extraneous information down a call stack type deferredLoadingClientConfig struct { loadingRules *clientConfigLoadingRules clientConfig clientConfig } // NewNonInteractiveDeferredLoadingClientConfig is a modified copy of k8s.io/kubernetes/pkg/client/unversioned/clientcmd.NewNonInteractiveDeferredLoadingClientConfig. // NewNonInteractiveDeferredLoadingClientConfig creates a ConfigClientClientConfig using the passed context name func newNonInteractiveDeferredLoadingClientConfig(loadingRules *clientConfigLoadingRules) clientConfig { return &deferredLoadingClientConfig{loadingRules: loadingRules} } func (config *deferredLoadingClientConfig) createClientConfig() (clientConfig, error) { if config.clientConfig == nil { // REMOVED: Support for concurrent use in multiple threads. mergedConfig, err := config.loadingRules.Load() if err != nil { return nil, err } // REMOVED: Interactive fallback support. mergedClientConfig := newNonInteractiveClientConfig(*mergedConfig) config.clientConfig = mergedClientConfig } return config.clientConfig, nil } // ClientConfig is a modified copy of k8s.io/kubernetes/pkg/client/unversioned/clientcmd.DeferredLoadingClientConfig.ClientConfig. // ClientConfig implements ClientConfig func (config *deferredLoadingClientConfig) ClientConfig() (*restConfig, error) { mergedClientConfig, err := config.createClientConfig() if err != nil { return nil, err } mergedConfig, err := mergedClientConfig.ClientConfig() if err != nil { return nil, err } // REMOVED: In-cluster service account configuration use. return mergedConfig, nil } var ( // DefaultCluster is the cluster config used when no other config is specified // TODO: eventually apiserver should start on 443 and be secure by default defaultCluster = clientcmdCluster{Server: "http://localhost:8080"} // EnvVarCluster allows overriding the DefaultCluster using an envvar for the server name envVarCluster = clientcmdCluster{Server: os.Getenv("KUBERNETES_MASTER")} ) // directClientConfig is a modified copy of k8s.io/kubernetes/pkg/client/unversioned/clientcmd.DirectClientConfig. // DirectClientConfig is a ClientConfig interface that is backed by a clientcmdapi.Config, options overrides, and an optional fallbackReader for auth information type directClientConfig struct { config clientcmdConfig } // newNonInteractiveClientConfig is a modified copy of k8s.io/kubernetes/pkg/client/unversioned/clientcmd.NewNonInteractiveClientConfig. // NewNonInteractiveClientConfig creates a DirectClientConfig using the passed context name and does not have a fallback reader for auth information func newNonInteractiveClientConfig(config clientcmdConfig) clientConfig { return &directClientConfig{config} } // ClientConfig is a modified copy of k8s.io/kubernetes/pkg/client/unversioned/clientcmd.DirectClientConfig.ClientConfig. // ClientConfig implements ClientConfig func (config *directClientConfig) ClientConfig() (*restConfig, error) { if err := config.ConfirmUsable(); err != nil { return nil, err } configAuthInfo := config.getAuthInfo() configClusterInfo := config.getCluster() clientConfig := &restConfig{} clientConfig.Host = configClusterInfo.Server if u, err := url.ParseRequestURI(clientConfig.Host); err == nil && u.Opaque == "" && len(u.Path) > 1 { u.RawQuery = "" u.Fragment = "" clientConfig.Host = u.String() } // only try to read the auth information if we are secure if isConfigTransportTLS(*clientConfig) { var err error // REMOVED: Support for interactive fallback. userAuthPartialConfig := getUserIdentificationPartialConfig(configAuthInfo) if err = mergo.MergeWithOverwrite(clientConfig, userAuthPartialConfig); err != nil { return nil, err } serverAuthPartialConfig, err := getServerIdentificationPartialConfig(configClusterInfo) if err != nil { return nil, err } if err = mergo.MergeWithOverwrite(clientConfig, serverAuthPartialConfig); err != nil { return nil, err } } return clientConfig, nil } // getServerIdentificationPartialConfig is a modified copy of k8s.io/kubernetes/pkg/client/unversioned/clientcmd.getServerIdentificationPartialConfig. // clientauth.Info object contain both user identification and server identification. We want different precedence orders for // both, so we have to split the objects and merge them separately // we want this order of precedence for the server identification // 1. configClusterInfo (the final result of command line flags and merged .kubeconfig files) // 2. configAuthInfo.auth-path (this file can contain information that conflicts with #1, and we want #1 to win the priority) // 3. load the ~/.kubernetes_auth file as a default func getServerIdentificationPartialConfig(configClusterInfo clientcmdCluster) (*restConfig, error) { mergedConfig := &restConfig{} // configClusterInfo holds the information identify the server provided by .kubeconfig configClientConfig := &restConfig{} configClientConfig.TLSClientConfig.CAFile = configClusterInfo.CertificateAuthority configClientConfig.TLSClientConfig.CAData = configClusterInfo.CertificateAuthorityData configClientConfig.Insecure = configClusterInfo.InsecureSkipTLSVerify if err := mergo.MergeWithOverwrite(mergedConfig, configClientConfig); err != nil { return nil, err } return mergedConfig, nil } // getUserIdentificationPartialConfig is a modified copy of k8s.io/kubernetes/pkg/client/unversioned/clientcmd.getUserIdentificationPartialConfig. // clientauth.Info object contain both user identification and server identification. We want different precedence orders for // both, so we have to split the objects and merge them separately // we want this order of precedence for user identification // 1. configAuthInfo minus auth-path (the final result of command line flags and merged .kubeconfig files) // 2. configAuthInfo.auth-path (this file can contain information that conflicts with #1, and we want #1 to win the priority) // 3. if there is not enough information to identify the user, load try the ~/.kubernetes_auth file // 4. if there is not enough information to identify the user, prompt if possible func getUserIdentificationPartialConfig(configAuthInfo clientcmdAuthInfo) *restConfig { mergedConfig := &restConfig{} // blindly overwrite existing values based on precedence if len(configAuthInfo.Token) > 0 { mergedConfig.BearerToken = configAuthInfo.Token } if len(configAuthInfo.ClientCertificate) > 0 || len(configAuthInfo.ClientCertificateData) > 0 { mergedConfig.TLSClientConfig.CertFile = configAuthInfo.ClientCertificate mergedConfig.TLSClientConfig.CertData = configAuthInfo.ClientCertificateData mergedConfig.TLSClientConfig.KeyFile = configAuthInfo.ClientKey mergedConfig.TLSClientConfig.KeyData = configAuthInfo.ClientKeyData } if len(configAuthInfo.Username) > 0 || len(configAuthInfo.Password) > 0 { mergedConfig.Username = configAuthInfo.Username mergedConfig.Password = configAuthInfo.Password } // REMOVED: prompting for missing information. return mergedConfig } // ConfirmUsable is a modified copy of k8s.io/kubernetes/pkg/client/unversioned/clientcmd.DirectClientConfig.ConfirmUsable. // ConfirmUsable looks a particular context and determines if that particular part of the config is usable. There might still be errors in the config, // but no errors in the sections requested or referenced. It does not return early so that it can find as many errors as possible. func (config *directClientConfig) ConfirmUsable() error { var validationErrors []error validationErrors = append(validationErrors, validateAuthInfo(config.getAuthInfoName(), config.getAuthInfo())...) validationErrors = append(validationErrors, validateClusterInfo(config.getClusterName(), config.getCluster())...) // when direct client config is specified, and our only error is that no server is defined, we should // return a standard "no config" error if len(validationErrors) == 1 && validationErrors[0] == errEmptyCluster { return newErrConfigurationInvalid([]error{errEmptyConfig}) } return newErrConfigurationInvalid(validationErrors) } // getContextName is a modified copy of k8s.io/kubernetes/pkg/client/unversioned/clientcmd.DirectClientConfig.getContextName. func (config *directClientConfig) getContextName() string { // REMOVED: overrides support return config.config.CurrentContext } // getAuthInfoName is a modified copy of k8s.io/kubernetes/pkg/client/unversioned/clientcmd.DirectClientConfig.getAuthInfoName. func (config *directClientConfig) getAuthInfoName() string { // REMOVED: overrides support return config.getContext().AuthInfo } // getClusterName is a modified copy of k8s.io/kubernetes/pkg/client/unversioned/clientcmd.DirectClientConfig.getClusterName. func (config *directClientConfig) getClusterName() string { // REMOVED: overrides support return config.getContext().Cluster } // getContext is a modified copy of k8s.io/kubernetes/pkg/client/unversioned/clientcmd.DirectClientConfig.getContext. func (config *directClientConfig) getContext() clientcmdContext { contexts := config.config.Contexts contextName := config.getContextName() var mergedContext clientcmdContext if configContext, exists := contexts[contextName]; exists { if err := mergo.MergeWithOverwrite(&mergedContext, configContext); err != nil { logrus.Debugf("Can't merge configContext: %v", err) } } // REMOVED: overrides support return mergedContext } var ( errEmptyConfig = errors.New("no configuration has been provided") // message is for consistency with old behavior errEmptyCluster = errors.New("cluster has no server defined") ) // helper for checking certificate/key/CA func validateFileIsReadable(name string) error { answer, err := os.Open(name) defer func() { if err := answer.Close(); err != nil { logrus.Debugf("Error closing %v: %v", name, err) } }() return err } // validateClusterInfo is a modified copy of k8s.io/kubernetes/pkg/client/unversioned/clientcmd.DirectClientConfig.validateClusterInfo. // validateClusterInfo looks for conflicts and errors in the cluster info func validateClusterInfo(clusterName string, clusterInfo clientcmdCluster) []error { var validationErrors []error if reflect.DeepEqual(clientcmdCluster{}, clusterInfo) { return []error{errEmptyCluster} } if len(clusterInfo.Server) == 0 { if len(clusterName) == 0 { validationErrors = append(validationErrors, errors.New("default cluster has no server defined")) } else { validationErrors = append(validationErrors, fmt.Errorf("no server found for cluster %q", clusterName)) } } // Make sure CA data and CA file aren't both specified if len(clusterInfo.CertificateAuthority) != 0 && len(clusterInfo.CertificateAuthorityData) != 0 { validationErrors = append(validationErrors, fmt.Errorf("certificate-authority-data and certificate-authority are both specified for %v. certificate-authority-data will override", clusterName)) } if len(clusterInfo.CertificateAuthority) != 0 { err := validateFileIsReadable(clusterInfo.CertificateAuthority) if err != nil { validationErrors = append(validationErrors, fmt.Errorf("unable to read certificate-authority %v for %v due to %w", clusterInfo.CertificateAuthority, clusterName, err)) } } return validationErrors } // validateAuthInfo is a modified copy of k8s.io/kubernetes/pkg/client/unversioned/clientcmd.DirectClientConfig.validateAuthInfo. // validateAuthInfo looks for conflicts and errors in the auth info func validateAuthInfo(authInfoName string, authInfo clientcmdAuthInfo) []error { var validationErrors []error usingAuthPath := false methods := make([]string, 0, 3) if len(authInfo.Token) != 0 { methods = append(methods, "token") } if len(authInfo.Username) != 0 || len(authInfo.Password) != 0 { methods = append(methods, "basicAuth") } if len(authInfo.ClientCertificate) != 0 || len(authInfo.ClientCertificateData) != 0 { // Make sure cert data and file aren't both specified if len(authInfo.ClientCertificate) != 0 && len(authInfo.ClientCertificateData) != 0 { validationErrors = append(validationErrors, fmt.Errorf("client-cert-data and client-cert are both specified for %v. client-cert-data will override", authInfoName)) } // Make sure key data and file aren't both specified if len(authInfo.ClientKey) != 0 && len(authInfo.ClientKeyData) != 0 { validationErrors = append(validationErrors, fmt.Errorf("client-key-data and client-key are both specified for %v; client-key-data will override", authInfoName)) } // Make sure a key is specified if len(authInfo.ClientKey) == 0 && len(authInfo.ClientKeyData) == 0 { validationErrors = append(validationErrors, fmt.Errorf("client-key-data or client-key must be specified for %v to use the clientCert authentication method", authInfoName)) } if len(authInfo.ClientCertificate) != 0 { err := validateFileIsReadable(authInfo.ClientCertificate) if err != nil { validationErrors = append(validationErrors, fmt.Errorf("unable to read client-cert %v for %v due to %w", authInfo.ClientCertificate, authInfoName, err)) } } if len(authInfo.ClientKey) != 0 { err := validateFileIsReadable(authInfo.ClientKey) if err != nil { validationErrors = append(validationErrors, fmt.Errorf("unable to read client-key %v for %v due to %w", authInfo.ClientKey, authInfoName, err)) } } } // authPath also provides information for the client to identify the server, so allow multiple auth methods in that case if (len(methods) > 1) && (!usingAuthPath) { validationErrors = append(validationErrors, fmt.Errorf("more than one authentication method found for %v; found %v, only one is allowed", authInfoName, methods)) } return validationErrors } // getAuthInfo is a modified copy of k8s.io/kubernetes/pkg/client/unversioned/clientcmd.DirectClientConfig.getAuthInfo. func (config *directClientConfig) getAuthInfo() clientcmdAuthInfo { authInfos := config.config.AuthInfos authInfoName := config.getAuthInfoName() var mergedAuthInfo clientcmdAuthInfo if configAuthInfo, exists := authInfos[authInfoName]; exists { if err := mergo.MergeWithOverwrite(&mergedAuthInfo, configAuthInfo); err != nil { logrus.Debugf("Can't merge configAuthInfo: %v", err) } } // REMOVED: overrides support return mergedAuthInfo } // getCluster is a modified copy of k8s.io/kubernetes/pkg/client/unversioned/clientcmd.DirectClientConfig.getCluster. func (config *directClientConfig) getCluster() clientcmdCluster { clusterInfos := config.config.Clusters clusterInfoName := config.getClusterName() var mergedClusterInfo clientcmdCluster if err := mergo.MergeWithOverwrite(&mergedClusterInfo, defaultCluster); err != nil { logrus.Debugf("Can't merge defaultCluster: %v", err) } if err := mergo.MergeWithOverwrite(&mergedClusterInfo, envVarCluster); err != nil { logrus.Debugf("Can't merge envVarCluster: %v", err) } if configClusterInfo, exists := clusterInfos[clusterInfoName]; exists { if err := mergo.MergeWithOverwrite(&mergedClusterInfo, configClusterInfo); err != nil { logrus.Debugf("Can't merge configClusterInfo: %v", err) } } // REMOVED: overrides support return mergedClusterInfo } // newAggregate is a modified copy of k8s.io/apimachinery/pkg/util/errors.NewAggregate. // NewAggregate converts a slice of errors into an Aggregate interface, which // is itself an implementation of the error interface. If the slice is empty, // this returns nil. // It will check if any of the element of input error list is nil, to avoid // nil pointer panic when call Error(). func newAggregate(errlist []error) error { if len(errlist) == 0 { return nil } // In case of input error list contains nil var errs []error for _, e := range errlist { if e != nil { errs = append(errs, e) } } if len(errs) == 0 { return nil } return multierr.Format("[", ", ", "]", errs) } // errConfigurationInvalid is a modified? copy of k8s.io/kubernetes/pkg/client/unversioned/clientcmd.errConfigurationInvalid. // errConfigurationInvalid is a set of errors indicating the configuration is invalid. type errConfigurationInvalid []error var _ error = errConfigurationInvalid{} // REMOVED: utilerrors.Aggregate implementation for errConfigurationInvalid. // newErrConfigurationInvalid is a modified? copy of k8s.io/kubernetes/pkg/client/unversioned/clientcmd.newErrConfigurationInvalid. func newErrConfigurationInvalid(errs []error) error { switch len(errs) { case 0: return nil default: return errConfigurationInvalid(errs) } } // Error implements the error interface func (e errConfigurationInvalid) Error() string { return fmt.Sprintf("invalid configuration: %v", newAggregate(e).Error()) } // clientConfigLoadingRules is a modified copy of k8s.io/kubernetes/pkg/client/unversioned/clientcmd.ClientConfigLoadingRules // ClientConfigLoadingRules is an ExplicitPath and string slice of specific locations that are used for merging together a Config // Callers can put the chain together however they want, but we'd recommend: // EnvVarPathFiles if set (a list of files if set) OR the HomeDirectoryPath // ExplicitPath is special, because if a user specifically requests a certain file be used and error is reported if this file is not present type clientConfigLoadingRules struct { Precedence []string } // Load is a modified copy of k8s.io/kubernetes/pkg/client/unversioned/clientcmd.ClientConfigLoadingRules.Load // Load starts by running the MigrationRules and then // takes the loading rules and returns a Config object based on following rules. // // - if the ExplicitPath, return the unmerged explicit file // - Otherwise, return a merged config based on the Precedence slice // // A missing ExplicitPath file produces an error. Empty filenames or other missing files are ignored. // Read errors or files with non-deserializable content produce errors. // The first file to set a particular map key wins and map key's value is never changed. // BUT, if you set a struct value that is NOT contained inside of map, the value WILL be changed. // This results in some odd looking logic to merge in one direction, merge in the other, and then merge the two. // It also means that if two files specify a "red-user", only values from the first file's red-user are used. Even // non-conflicting entries from the second file's "red-user" are discarded. // Relative paths inside of the .kubeconfig files are resolved against the .kubeconfig file's parent folder // and only absolute file paths are returned. func (rules *clientConfigLoadingRules) Load() (*clientcmdConfig, error) { errlist := []error{} kubeConfigFiles := []string{} // REMOVED: explicit path support kubeConfigFiles = append(kubeConfigFiles, rules.Precedence...) kubeconfigs := []*clientcmdConfig{} // read and cache the config files so that we only look at them once for _, filename := range kubeConfigFiles { if len(filename) == 0 { // no work to do continue } config, err := loadFromFile(filename) if os.IsNotExist(err) { // skip missing files continue } if err != nil { errlist = append(errlist, fmt.Errorf("loading config file %q: %w", filename, err)) continue } kubeconfigs = append(kubeconfigs, config) } // first merge all of our maps mapConfig := clientcmdNewConfig() for _, kubeconfig := range kubeconfigs { if err := mergo.MergeWithOverwrite(mapConfig, kubeconfig); err != nil { return nil, err } } // merge all of the struct values in the reverse order so that priority is given correctly // errors are not added to the list the second time nonMapConfig := clientcmdNewConfig() for _, kubeconfig := range slices.Backward(kubeconfigs) { if err := mergo.MergeWithOverwrite(nonMapConfig, kubeconfig); err != nil { return nil, err } } // since values are overwritten, but maps values are not, we can merge the non-map config on top of the map config and // get the values we expect. config := clientcmdNewConfig() if err := mergo.MergeWithOverwrite(config, mapConfig); err != nil { return nil, err } if err := mergo.MergeWithOverwrite(config, nonMapConfig); err != nil { return nil, err } // REMOVED: Possibility to skip this. if err := resolveLocalPaths(config); err != nil { errlist = append(errlist, err) } return config, newAggregate(errlist) } // loadFromFile is a modified copy of k8s.io/kubernetes/pkg/client/unversioned/clientcmd.LoadFromFile // LoadFromFile takes a filename and deserializes the contents into Config object func loadFromFile(filename string) (*clientcmdConfig, error) { kubeconfigBytes, err := os.ReadFile(filename) if err != nil { return nil, err } config, err := load(kubeconfigBytes) if err != nil { return nil, err } // set LocationOfOrigin on every Cluster, User, and Context for key, obj := range config.AuthInfos { obj.LocationOfOrigin = filename config.AuthInfos[key] = obj } for key, obj := range config.Clusters { obj.LocationOfOrigin = filename config.Clusters[key] = obj } for key, obj := range config.Contexts { obj.LocationOfOrigin = filename config.Contexts[key] = obj } if config.AuthInfos == nil { config.AuthInfos = map[string]*clientcmdAuthInfo{} } if config.Clusters == nil { config.Clusters = map[string]*clientcmdCluster{} } if config.Contexts == nil { config.Contexts = map[string]*clientcmdContext{} } return config, nil } // load is a modified copy of k8s.io/kubernetes/pkg/client/unversioned/clientcmd.Load // Load takes a byte slice and deserializes the contents into Config object. // Encapsulates deserialization without assuming the source is a file. func load(data []byte) (*clientcmdConfig, error) { config := clientcmdNewConfig() // if there's no data in a file, return the default object instead of failing (DecodeInto reject empty input) if len(data) == 0 { return config, nil } // Note: This does absolutely no kind/version checking or conversions. if err := yaml.Unmarshal(data, config); err != nil { return nil, err } return config, nil } // resolveLocalPaths is a modified copy of k8s.io/kubernetes/pkg/client/unversioned/clientcmd.ClientConfigLoadingRules.resolveLocalPaths. // ResolveLocalPaths resolves all relative paths in the config object with respect to the stanza's LocationOfOrigin // this cannot be done directly inside of LoadFromFile because doing so there would make it impossible to load a file without // modification of its contents. func resolveLocalPaths(config *clientcmdConfig) error { for _, cluster := range config.Clusters { if len(cluster.LocationOfOrigin) == 0 { continue } base, err := filepath.Abs(filepath.Dir(cluster.LocationOfOrigin)) if err != nil { return fmt.Errorf("Could not determine the absolute path of config file %s: %w", cluster.LocationOfOrigin, err) } if err := resolvePaths(getClusterFileReferences(cluster), base); err != nil { return err } } for _, authInfo := range config.AuthInfos { if len(authInfo.LocationOfOrigin) == 0 { continue } base, err := filepath.Abs(filepath.Dir(authInfo.LocationOfOrigin)) if err != nil { return fmt.Errorf("Could not determine the absolute path of config file %s: %w", authInfo.LocationOfOrigin, err) } if err := resolvePaths(getAuthInfoFileReferences(authInfo), base); err != nil { return err } } return nil } // getClusterFileReferences is a modified copy of k8s.io/kubernetes/pkg/client/unversioned/clientcmd.ClientConfigLoadingRules.GetClusterFileReferences. func getClusterFileReferences(cluster *clientcmdCluster) []*string { return []*string{&cluster.CertificateAuthority} } // getAuthInfoFileReferences is a modified copy of k8s.io/kubernetes/pkg/client/unversioned/clientcmd.ClientConfigLoadingRules.GetAuthInfoFileReferences. func getAuthInfoFileReferences(authInfo *clientcmdAuthInfo) []*string { return []*string{&authInfo.ClientCertificate, &authInfo.ClientKey} } // resolvePaths is a modified copy of k8s.io/kubernetes/pkg/client/unversioned/clientcmd.ClientConfigLoadingRules.resolvePaths. // ResolvePaths updates the given refs to be absolute paths, relative to the given base directory func resolvePaths(refs []*string, base string) error { for _, ref := range refs { // Don't resolve empty paths if len(*ref) > 0 { // Don't resolve absolute paths if !filepath.IsAbs(*ref) { *ref = filepath.Join(base, *ref) } } } return nil } // restClientFor is a modified copy of k8s.io/kubernetes/pkg/client/restclient.RESTClientFor. // RESTClientFor returns a RESTClient that satisfies the requested attributes on a client Config // object. Note that a RESTClient may require fields that are optional when initializing a Client. // A RESTClient created by this method is generic - it expects to operate on an API that follows // the Kubernetes conventions, but may not be the Kubernetes API. func restClientFor(sys *types.SystemContext, config *restConfig) (*url.URL, *http.Client, error) { // REMOVED: Configurable GroupVersion, Codec // REMOVED: Configurable versionedAPIPath baseURL, err := defaultServerURLFor(config) if err != nil { return nil, nil, err } transport, err := transportFor(sys, config) if err != nil { return nil, nil, err } var httpClient *http.Client if transport != http.DefaultTransport { httpClient = &http.Client{Transport: transport} } // REMOVED: Configurable QPS, Burst, ContentConfig // REMOVED: Actually returning a RESTClient object. return baseURL, httpClient, nil } // defaultServerURL is a modified copy of k8s.io/kubernetes/pkg/client/restclient.DefaultServerURL. // DefaultServerURL converts a host, host:port, or URL string to the default base server API path // to use with a Client at a given API version following the standard conventions for a // Kubernetes API. func defaultServerURL(host string, defaultTLS bool) (*url.URL, error) { if host == "" { return nil, errors.New("host must be a URL or a host:port pair") } base := host hostURL, err := url.Parse(base) if err != nil { return nil, err } if hostURL.Scheme == "" { scheme := "http://" if defaultTLS { scheme = "https://" } hostURL, err = url.Parse(scheme + base) if err != nil { return nil, err } if hostURL.Path != "" && hostURL.Path != "/" { return nil, fmt.Errorf("host must be a URL or a host:port pair: %q", base) } } // REMOVED: versionedAPIPath computation. return hostURL, nil } // defaultServerURLFor is a modified copy of k8s.io/kubernetes/pkg/client/restclient.defaultServerURLFor. // defaultServerUrlFor is shared between IsConfigTransportTLS and RESTClientFor. It // requires Host and Version to be set prior to being called. func defaultServerURLFor(config *restConfig) (*url.URL, error) { // TODO: move the default to secure when the apiserver supports TLS by default // config.Insecure is taken to mean "I want HTTPS but don't bother checking the certs against a CA." hasCA := len(config.TLSClientConfig.CAFile) != 0 || len(config.TLSClientConfig.CAData) != 0 hasCert := len(config.TLSClientConfig.CertFile) != 0 || len(config.TLSClientConfig.CertData) != 0 defaultTLS := hasCA || hasCert || config.Insecure host := config.Host if host == "" { host = "localhost" } // REMOVED: Configurable APIPath, GroupVersion return defaultServerURL(host, defaultTLS) } // transportFor is a modified copy of k8s.io/kubernetes/pkg/client/restclient.transportFor. // TransportFor returns an http.RoundTripper that will provide the authentication // or transport level security defined by the provided Config. Will return the // default http.DefaultTransport if no special case behavior is needed. func transportFor(sys *types.SystemContext, config *restConfig) (http.RoundTripper, error) { // REMOVED: separation between restclient.Config and transport.Config, Transport, WrapTransport support return transportNew(sys, config) } // isConfigTransportTLS is a modified copy of k8s.io/kubernetes/pkg/client/restclient.IsConfigTransportTLS. // IsConfigTransportTLS returns true if and only if the provided // config will result in a protected connection to the server when it // is passed to restclient.RESTClientFor(). Use to determine when to // send credentials over the wire. // // Note: the Insecure flag is ignored when testing for this value, so MITM attacks are // still possible. func isConfigTransportTLS(config restConfig) bool { baseURL, err := defaultServerURLFor(&config) if err != nil { return false } return baseURL.Scheme == "https" } // transportNew is a modified copy of k8s.io/kubernetes/pkg/client/transport.New. // New returns an http.RoundTripper that will provide the authentication // or transport level security defined by the provided Config. func transportNew(sys *types.SystemContext, config *restConfig) (http.RoundTripper, error) { // REMOVED: custom config.Transport support. // Set transport level security var ( rt http.RoundTripper err error ) rt, err = tlsCacheGet(sys, config) if err != nil { return nil, err } // REMOVED: HTTPWrappersForConfig(config, rt) in favor of the caller setting HTTP headers itself based on restConfig. Only this inlined check remains. if len(config.Username) != 0 && len(config.BearerToken) != 0 { return nil, errors.New("username/password or bearer token may be set, but not both") } return rt, nil } // newProxierWithNoProxyCIDR is a modified copy of k8s.io/apimachinery/pkg/util/net.NewProxierWithNoProxyCIDR. // NewProxierWithNoProxyCIDR constructs a Proxier function that respects CIDRs in NO_PROXY and delegates if // no matching CIDRs are found func newProxierWithNoProxyCIDR(delegate func(req *http.Request) (*url.URL, error)) func(req *http.Request) (*url.URL, error) { // we wrap the default method, so we only need to perform our check if the NO_PROXY envvar has a CIDR in it noProxyEnv := os.Getenv("NO_PROXY") cidrs := []netip.Prefix{} for noProxyRule := range strings.SplitSeq(noProxyEnv, ",") { prefix, err := netip.ParsePrefix(noProxyRule) if err == nil { cidrs = append(cidrs, prefix) } } if len(cidrs) == 0 { return delegate } return func(req *http.Request) (*url.URL, error) { host := req.URL.Host // for some urls, the Host is already the host, not the host:port if _, err := netip.ParseAddr(host); err != nil { var err error host, _, err = net.SplitHostPort(req.URL.Host) if err != nil { return delegate(req) } } ip, err := netip.ParseAddr(host) if err != nil { return delegate(req) } if slices.ContainsFunc(cidrs, func(cidr netip.Prefix) bool { return cidr.Contains(ip) }) { return nil, nil } return delegate(req) } } // tlsCacheGet is a modified copy of k8s.io/kubernetes/pkg/client/transport.tlsTransportCache.get. func tlsCacheGet(sys *types.SystemContext, config *restConfig) (http.RoundTripper, error) { // REMOVED: any actual caching // Get the TLS options for this client config tlsConfig, err := tlsConfigFor(sys, config) if err != nil { return nil, err } // The options didn't require a custom TLS config if tlsConfig == nil { return http.DefaultTransport, nil } // REMOVED: Call to k8s.io/apimachinery/pkg/util/net.SetTransportDefaults; instead of the generic machinery and conditionals, hard-coded the result here. t := &http.Transport{ // http.ProxyFromEnvironment doesn't respect CIDRs and that makes it impossible to exclude things like pod and service IPs from proxy settings // ProxierWithNoProxyCIDR allows CIDR rules in NO_PROXY Proxy: newProxierWithNoProxyCIDR(http.ProxyFromEnvironment), TLSHandshakeTimeout: 10 * time.Second, TLSClientConfig: tlsConfig, DialContext: (&net.Dialer{ Timeout: 30 * time.Second, KeepAlive: 30 * time.Second, }).DialContext, } // Allow clients to disable http2 if needed. if s := os.Getenv("DISABLE_HTTP2"); len(s) == 0 { t.ForceAttemptHTTP2 = true } return t, nil } // tlsConfigFor is a modified copy of k8s.io/kubernetes/pkg/client/transport.TLSConfigFor. // TLSConfigFor returns a tls.Config that will provide the transport level security defined // by the provided Config. Will return nil if no transport level security is requested. func tlsConfigFor(sys *types.SystemContext, c *restConfig) (*tls.Config, error) { if !c.HasCA() && !c.HasCertAuth() && !c.Insecure && (sys == nil || sys.BaseTLSConfig == nil) { return nil, nil } if c.HasCA() && c.Insecure { return nil, errors.New("specifying a root certificates file with the insecure flag is not allowed") } if err := loadTLSFiles(c); err != nil { return nil, err } var tlsConfig *tls.Config if sys != nil && sys.BaseTLSConfig != nil { tlsConfig = sys.BaseTLSConfig.Clone() } else { tlsConfig = &tls.Config{} } tlsConfig.InsecureSkipVerify = c.Insecure if c.HasCA() { tlsConfig.RootCAs = rootCertPool(c.TLSClientConfig.CAData) } if c.HasCertAuth() { cert, err := tls.X509KeyPair(c.TLSClientConfig.CertData, c.TLSClientConfig.KeyData) if err != nil { return nil, err } tlsConfig.Certificates = []tls.Certificate{cert} } return tlsConfig, nil } // loadTLSFiles is a modified copy of k8s.io/kubernetes/pkg/client/transport.loadTLSFiles. // loadTLSFiles copies the data from the CertFile, KeyFile, and CAFile fields into the CertData, // KeyData, and CAFile fields, or returns an error. If no error is returned, all three fields are // either populated or were empty to start. func loadTLSFiles(c *restConfig) error { var err error c.TLSClientConfig.CAData, err = dataFromSliceOrFile(c.TLSClientConfig.CAData, c.TLSClientConfig.CAFile) if err != nil { return err } c.TLSClientConfig.CertData, err = dataFromSliceOrFile(c.TLSClientConfig.CertData, c.TLSClientConfig.CertFile) if err != nil { return err } c.TLSClientConfig.KeyData, err = dataFromSliceOrFile(c.TLSClientConfig.KeyData, c.TLSClientConfig.KeyFile) if err != nil { return err } return nil } // dataFromSliceOrFile is a modified copy of k8s.io/kubernetes/pkg/client/transport.dataFromSliceOrFile. // dataFromSliceOrFile returns data from the slice (if non-empty), or from the file, // or an error if an error occurred reading the file func dataFromSliceOrFile(data []byte, file string) ([]byte, error) { if len(data) > 0 { return data, nil } if len(file) > 0 { fileData, err := os.ReadFile(file) if err != nil { return []byte{}, err } return fileData, nil } return nil, nil } // rootCertPool is a modified copy of k8s.io/kubernetes/pkg/client/transport.rootCertPool. // rootCertPool returns nil if caData is empty. When passed along, this will mean "use system CAs". // When caData is not empty, it will be the ONLY information used in the CertPool. func rootCertPool(caData []byte) *x509.CertPool { // What we really want is a copy of x509.systemRootsPool, but that isn't exposed. It's difficult to build (see the go // code for a look at the platform specific insanity), so we'll use the fact that RootCAs == nil gives us the system values // It doesn't allow trusting either/or, but hopefully that won't be an issue if len(caData) == 0 { return nil } // if we have caData, use it certPool := x509.NewCertPool() certPool.AppendCertsFromPEM(caData) return certPool } // HasCA is a modified copy of k8s.io/kubernetes/pkg/client/transport.Config.HasCA. // HasCA returns whether the configuration has a certificate authority or not. func (c *restConfig) HasCA() bool { return len(c.TLSClientConfig.CAData) > 0 || len(c.TLSClientConfig.CAFile) > 0 } // HasCertAuth is a modified copy of k8s.io/kubernetes/pkg/client/transport.Config.HasCertAuth. // HasCertAuth returns whether the configuration has certificate authentication or not. func (c *restConfig) HasCertAuth() bool { return len(c.TLSClientConfig.CertData) != 0 || len(c.TLSClientConfig.CertFile) != 0 } // clientcmdConfig is a modified copy of k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api.Config. // Config holds the information needed to build connect to remote kubernetes clusters as a given user // IMPORTANT if you add fields to this struct, please update IsConfigEmpty() type clientcmdConfig struct { // Clusters is a map of referenceable names to cluster configs Clusters clustersMap `yaml:"clusters"` // AuthInfos is a map of referenceable names to user configs AuthInfos authInfosMap `yaml:"users"` // Contexts is a map of referenceable names to context configs Contexts contextsMap `yaml:"contexts"` // CurrentContext is the name of the context that you would like to use by default CurrentContext string `yaml:"current-context"` } type clustersMap map[string]*clientcmdCluster func (m *clustersMap) UnmarshalYAML(value *yaml.Node) error { var a []v1NamedCluster if err := value.Decode(&a); err != nil { return err } for _, e := range a { cluster := e.Cluster // Allocates a new instance in each iteration (*m)[e.Name] = &cluster } return nil } type authInfosMap map[string]*clientcmdAuthInfo func (m *authInfosMap) UnmarshalYAML(value *yaml.Node) error { var a []v1NamedAuthInfo if err := value.Decode(&a); err != nil { return err } for _, e := range a { authInfo := e.AuthInfo // Allocates a new instance in each iteration (*m)[e.Name] = &authInfo } return nil } type contextsMap map[string]*clientcmdContext func (m *contextsMap) UnmarshalYAML(value *yaml.Node) error { var a []v1NamedContext if err := value.Decode(&a); err != nil { return err } for _, e := range a { context := e.Context // Allocates a new instance in each iteration (*m)[e.Name] = &context } return nil } // clientcmdNewConfig is a modified copy of k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api.NewConfig. // NewConfig is a convenience function that returns a new Config object with non-nil maps func clientcmdNewConfig() *clientcmdConfig { return &clientcmdConfig{ Clusters: make(map[string]*clientcmdCluster), AuthInfos: make(map[string]*clientcmdAuthInfo), Contexts: make(map[string]*clientcmdContext), } } // yamlBinaryAsBase64String is a []byte that can be stored in yaml as a !!str, not a !!binary type yamlBinaryAsBase64String []byte func (bin *yamlBinaryAsBase64String) UnmarshalText(text []byte) error { res := make([]byte, base64.StdEncoding.DecodedLen(len(text))) n, err := base64.StdEncoding.Decode(res, text) if err != nil { return err } *bin = res[:n] return nil } // clientcmdCluster is a modified copy of k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api.Cluster. // Cluster contains information about how to communicate with a kubernetes cluster type clientcmdCluster struct { // LocationOfOrigin indicates where this object came from. It is used for round tripping config post-merge, but never serialized. LocationOfOrigin string // Server is the address of the kubernetes cluster (https://hostname:port). Server string `yaml:"server"` // InsecureSkipTLSVerify skips the validity check for the server's certificate. This will make your HTTPS connections insecure. InsecureSkipTLSVerify bool `yaml:"insecure-skip-tls-verify,omitempty"` // CertificateAuthority is the path to a cert file for the certificate authority. CertificateAuthority string `yaml:"certificate-authority,omitempty"` // CertificateAuthorityData contains PEM-encoded certificate authority certificates. Overrides CertificateAuthority CertificateAuthorityData yamlBinaryAsBase64String `yaml:"certificate-authority-data,omitempty"` } // clientcmdAuthInfo is a modified copy of k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api.AuthInfo. // AuthInfo contains information that describes identity information. This is use to tell the kubernetes cluster who you are. type clientcmdAuthInfo struct { // LocationOfOrigin indicates where this object came from. It is used for round tripping config post-merge, but never serialized. LocationOfOrigin string // ClientCertificate is the path to a client cert file for TLS. ClientCertificate string `yaml:"client-certificate,omitempty"` // ClientCertificateData contains PEM-encoded data from a client cert file for TLS. Overrides ClientCertificate ClientCertificateData yamlBinaryAsBase64String `yaml:"client-certificate-data,omitempty"` // ClientKey is the path to a client key file for TLS. ClientKey string `yaml:"client-key,omitempty"` // ClientKeyData contains PEM-encoded data from a client key file for TLS. Overrides ClientKey ClientKeyData yamlBinaryAsBase64String `yaml:"client-key-data,omitempty"` // Token is the bearer token for authentication to the kubernetes cluster. Token string `yaml:"token,omitempty"` // Username is the username for basic authentication to the kubernetes cluster. Username string `yaml:"username,omitempty"` // Password is the password for basic authentication to the kubernetes cluster. Password string `yaml:"password,omitempty"` } // clientcmdContext is a modified copy of k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api.Context. // Context is a tuple of references to a cluster (how do I communicate with a kubernetes cluster), a user (how do I identify myself), and a namespace (what subset of resources do I want to work with) type clientcmdContext struct { // LocationOfOrigin indicates where this object came from. It is used for round tripping config post-merge, but never serialized. LocationOfOrigin string // Cluster is the name of the cluster for this context Cluster string `yaml:"cluster"` // AuthInfo is the name of the authInfo for this context AuthInfo string `yaml:"user"` // Namespace is the default namespace to use on unspecified requests Namespace string `yaml:"namespace,omitempty"` } // v1NamedCluster is a modified copy of k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api.v1.NamedCluster. // NamedCluster relates nicknames to cluster information type v1NamedCluster struct { // Name is the nickname for this Cluster Name string `yaml:"name"` // Cluster holds the cluster information Cluster clientcmdCluster `yaml:"cluster"` } // v1NamedContext is a modified copy of k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api.v1.NamedContext. // NamedContext relates nicknames to context information type v1NamedContext struct { // Name is the nickname for this Context Name string `yaml:"name"` // Context holds the context information Context clientcmdContext `yaml:"context"` } // v1NamedAuthInfo is a modified copy of k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api.v1.NamedAuthInfo. // NamedAuthInfo relates nicknames to auth information type v1NamedAuthInfo struct { // Name is the nickname for this AuthInfo Name string `yaml:"name"` // AuthInfo holds the auth information AuthInfo clientcmdAuthInfo `yaml:"user"` } ================================================ FILE: vendor/go.podman.io/image/v5/openshift/openshift.go ================================================ package openshift import ( "bytes" "context" "encoding/json" "errors" "fmt" "io" "net/http" "net/url" "strings" "github.com/sirupsen/logrus" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/internal/iolimits" "go.podman.io/image/v5/types" "go.podman.io/image/v5/version" ) // openshiftClient is configuration for dealing with a single image stream, for reading or writing. type openshiftClient struct { ref openshiftReference baseURL *url.URL // Values from Kubernetes configuration httpClient *http.Client bearerToken string // "" if not used username string // "" if not used password string // if username != "" } // newOpenshiftClient creates a new openshiftClient for the specified reference. func newOpenshiftClient(sys *types.SystemContext, ref openshiftReference) (*openshiftClient, error) { // Overall, this is modelled on openshift/origin/pkg/cmd/util/clientcmd.New().ClientConfig() and openshift/origin/pkg/client. cmdConfig := defaultClientConfig() logrus.Debugf("cmdConfig: %#v", cmdConfig) restConfig, err := cmdConfig.ClientConfig() if err != nil { return nil, err } // REMOVED: SetOpenShiftDefaults (values are not overridable in config files, so hard-coded these defaults.) logrus.Debugf("restConfig: %#v", restConfig) baseURL, httpClient, err := restClientFor(sys, restConfig) if err != nil { return nil, err } logrus.Debugf("URL: %#v", *baseURL) if httpClient == nil { httpClient = http.DefaultClient } return &openshiftClient{ ref: ref, baseURL: baseURL, httpClient: httpClient, bearerToken: restConfig.BearerToken, username: restConfig.Username, password: restConfig.Password, }, nil } func (c *openshiftClient) close() { c.httpClient.CloseIdleConnections() } // doRequest performs a correctly authenticated request to a specified path, and returns response body or an error object. func (c *openshiftClient) doRequest(ctx context.Context, method, path string, requestBody []byte) ([]byte, error) { requestURL := *c.baseURL requestURL.Path = path var requestBodyReader io.Reader if requestBody != nil { logrus.Debugf("Will send body: %s", requestBody) requestBodyReader = bytes.NewReader(requestBody) } req, err := http.NewRequestWithContext(ctx, method, requestURL.String(), requestBodyReader) if err != nil { return nil, err } if len(c.bearerToken) != 0 { req.Header.Set("Authorization", "Bearer "+c.bearerToken) } else if len(c.username) != 0 { req.SetBasicAuth(c.username, c.password) } req.Header.Set("Accept", "application/json, */*") req.Header.Set("User-Agent", fmt.Sprintf("skopeo/%s", version.Version)) if requestBody != nil { req.Header.Set("Content-Type", "application/json") } logrus.Debugf("%s %s", method, requestURL.Redacted()) res, err := c.httpClient.Do(req) if err != nil { return nil, err } defer res.Body.Close() body, err := iolimits.ReadAtMost(res.Body, iolimits.MaxOpenShiftStatusBody) if err != nil { return nil, err } logrus.Debugf("Got body: %s", body) // FIXME: Just throwing this useful information away only to try to guess later... logrus.Debugf("Got content-type: %s", res.Header.Get("Content-Type")) var status status statusValid := false if err := json.Unmarshal(body, &status); err == nil && len(status.Status) > 0 { statusValid = true } switch { case res.StatusCode == http.StatusSwitchingProtocols: // FIXME?! No idea why this weird case exists in k8s.io/kubernetes/pkg/client/restclient. if statusValid && status.Status != "Success" { return nil, errors.New(status.Message) } case res.StatusCode >= http.StatusOK && res.StatusCode <= http.StatusPartialContent: // OK. default: if statusValid { return nil, errors.New(status.Message) } return nil, fmt.Errorf("HTTP error: status code: %d (%s), body: %s", res.StatusCode, http.StatusText(res.StatusCode), string(body)) } return body, nil } // getImage loads the specified image object. func (c *openshiftClient) getImage(ctx context.Context, imageStreamImageName string) (*image, error) { // FIXME: validate components per validation.IsValidPathSegmentName? path := fmt.Sprintf("/oapi/v1/namespaces/%s/imagestreamimages/%s@%s", c.ref.namespace, c.ref.stream, imageStreamImageName) body, err := c.doRequest(ctx, http.MethodGet, path, nil) if err != nil { return nil, err } // Note: This does absolutely no kind/version checking or conversions. var isi imageStreamImage if err := json.Unmarshal(body, &isi); err != nil { return nil, err } return &isi.Image, nil } // convertDockerImageReference takes an image API DockerImageReference value and returns a reference we can actually use; // currently OpenShift stores the cluster-internal service IPs here, which are unusable from the outside. func (c *openshiftClient) convertDockerImageReference(ref string) (string, error) { _, repo, gotRepo := strings.Cut(ref, "/") if !gotRepo { return "", fmt.Errorf("Invalid format of docker reference %q: missing '/'", ref) } return reference.Domain(c.ref.dockerReference) + "/" + repo, nil } // These structs are subsets of github.com/openshift/origin/pkg/image/api/v1 and its dependencies. type imageStream struct { Status imageStreamStatus `json:"status"` } type imageStreamStatus struct { DockerImageRepository string `json:"dockerImageRepository"` Tags []namedTagEventList `json:"tags,omitempty"` } type namedTagEventList struct { Tag string `json:"tag"` Items []tagEvent `json:"items"` } type tagEvent struct { DockerImageReference string `json:"dockerImageReference"` Image string `json:"image"` } type imageStreamImage struct { Image image `json:"image"` } type image struct { objectMeta `json:"metadata"` DockerImageReference string `json:"dockerImageReference,omitempty"` // DockerImageMetadata runtime.RawExtension `json:"dockerImageMetadata,omitempty"` DockerImageMetadataVersion string `json:"dockerImageMetadataVersion,omitempty"` DockerImageManifest string `json:"dockerImageManifest,omitempty"` // DockerImageLayers []ImageLayer `json:"dockerImageLayers"` Signatures []imageSignature `json:"signatures,omitempty"` } const imageSignatureTypeAtomic string = "atomic" type imageSignature struct { typeMeta `json:",inline"` objectMeta `json:"metadata"` Type string `json:"type"` Content []byte `json:"content"` // Conditions []SignatureCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` // ImageIdentity string `json:"imageIdentity,omitempty"` // SignedClaims map[string]string `json:"signedClaims,omitempty"` // Created *unversioned.Time `json:"created,omitempty"` // IssuedBy SignatureIssuer `json:"issuedBy,omitempty"` // IssuedTo SignatureSubject `json:"issuedTo,omitempty"` } type typeMeta struct { Kind string `json:"kind,omitempty"` APIVersion string `json:"apiVersion,omitempty"` } type objectMeta struct { Name string `json:"name,omitempty"` GenerateName string `json:"generateName,omitempty"` Namespace string `json:"namespace,omitempty"` SelfLink string `json:"selfLink,omitempty"` ResourceVersion string `json:"resourceVersion,omitempty"` Generation int64 `json:"generation,omitempty"` DeletionGracePeriodSeconds *int64 `json:"deletionGracePeriodSeconds,omitempty"` Labels map[string]string `json:"labels,omitempty"` Annotations map[string]string `json:"annotations,omitempty"` } // A subset of k8s.io/kubernetes/pkg/api/unversioned/Status type status struct { Status string `json:"status,omitempty"` Message string `json:"message,omitempty"` // Reason StatusReason `json:"reason,omitempty"` // Details *StatusDetails `json:"details,omitempty"` Code int32 `json:"code,omitempty"` } ================================================ FILE: vendor/go.podman.io/image/v5/openshift/openshift_dest.go ================================================ package openshift import ( "bytes" "context" "crypto/rand" "encoding/json" "errors" "fmt" "io" "net/http" "slices" "github.com/opencontainers/go-digest" imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" "go.podman.io/image/v5/docker" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/internal/imagedestination" "go.podman.io/image/v5/internal/imagedestination/impl" "go.podman.io/image/v5/internal/imagedestination/stubs" "go.podman.io/image/v5/internal/private" "go.podman.io/image/v5/internal/set" "go.podman.io/image/v5/internal/signature" "go.podman.io/image/v5/manifest" "go.podman.io/image/v5/types" ) type openshiftImageDestination struct { impl.Compat stubs.AlwaysSupportsSignatures client *openshiftClient docker private.ImageDestination // The docker/distribution API endpoint // State imageStreamImageName string // "" if not yet known } // newImageDestination creates a new ImageDestination for the specified reference. func newImageDestination(ctx context.Context, sys *types.SystemContext, ref openshiftReference) (private.ImageDestination, error) { client, err := newOpenshiftClient(sys, ref) if err != nil { return nil, err } // FIXME: Should this always use a digest, not a tag? Uploading to Docker by tag requires the tag _inside_ the manifest to match, // i.e. a single signed image cannot be available under multiple tags. But with types.ImageDestination, we don't know // the manifest digest at this point. dockerRefString := fmt.Sprintf("//%s/%s/%s:%s", reference.Domain(client.ref.dockerReference), client.ref.namespace, client.ref.stream, client.ref.dockerReference.Tag()) dockerRef, err := docker.ParseReference(dockerRefString) if err != nil { return nil, err } docker, err := dockerRef.NewImageDestination(ctx, sys) if err != nil { return nil, err } d := &openshiftImageDestination{ client: client, docker: imagedestination.FromPublic(docker), } d.Compat = impl.AddCompat(d) return d, nil } // Reference returns the reference used to set up this destination. Note that this should directly correspond to user's intent, // e.g. it should use the public hostname instead of the result of resolving CNAMEs or following redirects. func (d *openshiftImageDestination) Reference() types.ImageReference { return d.client.ref } // Close removes resources associated with an initialized ImageDestination, if any. func (d *openshiftImageDestination) Close() error { err := d.docker.Close() d.client.close() return err } func (d *openshiftImageDestination) SupportedManifestMIMETypes() []string { return d.docker.SupportedManifestMIMETypes() } func (d *openshiftImageDestination) DesiredLayerCompression() types.LayerCompression { return types.Compress } // AcceptsForeignLayerURLs returns false iff foreign layers in manifest should be actually // uploaded to the image destination, true otherwise. func (d *openshiftImageDestination) AcceptsForeignLayerURLs() bool { return true } // MustMatchRuntimeOS returns true iff the destination can store only images targeted for the current runtime architecture and OS. False otherwise. func (d *openshiftImageDestination) MustMatchRuntimeOS() bool { return false } // IgnoresEmbeddedDockerReference returns true iff the destination does not care about Image.EmbeddedDockerReferenceConflicts(), // and would prefer to receive an unmodified manifest instead of one modified for the destination. // Does not make a difference if Reference().DockerReference() is nil. func (d *openshiftImageDestination) IgnoresEmbeddedDockerReference() bool { return d.docker.IgnoresEmbeddedDockerReference() } // HasThreadSafePutBlob indicates whether PutBlob can be executed concurrently. func (d *openshiftImageDestination) HasThreadSafePutBlob() bool { return false } // SupportsPutBlobPartial returns true if PutBlobPartial is supported. func (d *openshiftImageDestination) SupportsPutBlobPartial() bool { return d.docker.SupportsPutBlobPartial() } // NoteOriginalOCIConfig provides the config of the image, as it exists on the source, BUT converted to OCI format, // or an error obtaining that value (e.g. if the image is an artifact and not a container image). // The destination can use it in its TryReusingBlob/PutBlob implementations // (otherwise it only obtains the final config after all layers are written). func (d *openshiftImageDestination) NoteOriginalOCIConfig(ociConfig *imgspecv1.Image, configErr error) error { return d.docker.NoteOriginalOCIConfig(ociConfig, configErr) } // PutBlobWithOptions writes contents of stream and returns data representing the result. // inputInfo.Digest can be optionally provided if known; if provided, and stream is read to the end without error, the digest MUST match the stream contents. // inputInfo.Size is the expected length of stream, if known. // inputInfo.MediaType describes the blob format, if known. // WARNING: The contents of stream are being verified on the fly. Until stream.Read() returns io.EOF, the contents of the data SHOULD NOT be available // to any other readers for download using the supplied digest. // If stream.Read() at any time, ESPECIALLY at end of input, returns an error, PutBlobWithOptions MUST 1) fail, and 2) delete any data stored so far. func (d *openshiftImageDestination) PutBlobWithOptions(ctx context.Context, stream io.Reader, inputInfo types.BlobInfo, options private.PutBlobOptions) (private.UploadedBlob, error) { return d.docker.PutBlobWithOptions(ctx, stream, inputInfo, options) } // PutBlobPartial attempts to create a blob using the data that is already present // at the destination. chunkAccessor is accessed in a non-sequential way to retrieve the missing chunks. // It is available only if SupportsPutBlobPartial(). // Even if SupportsPutBlobPartial() returns true, the call can fail. // If the call fails with ErrFallbackToOrdinaryLayerDownload, the caller can fall back to PutBlobWithOptions. // The fallback _must not_ be done otherwise. func (d *openshiftImageDestination) PutBlobPartial(ctx context.Context, chunkAccessor private.BlobChunkAccessor, srcInfo types.BlobInfo, options private.PutBlobPartialOptions) (private.UploadedBlob, error) { return d.docker.PutBlobPartial(ctx, chunkAccessor, srcInfo, options) } // TryReusingBlobWithOptions checks whether the transport already contains, or can efficiently reuse, a blob, and if so, applies it to the current destination // (e.g. if the blob is a filesystem layer, this signifies that the changes it describes need to be applied again when composing a filesystem tree). // info.Digest must not be empty. // If the blob has been successfully reused, returns (true, info, nil). // If the transport can not reuse the requested blob, TryReusingBlob returns (false, {}, nil); it returns a non-nil error only on an unexpected failure. func (d *openshiftImageDestination) TryReusingBlobWithOptions(ctx context.Context, info types.BlobInfo, options private.TryReusingBlobOptions) (bool, private.ReusedBlob, error) { return d.docker.TryReusingBlobWithOptions(ctx, info, options) } // PutManifest writes manifest to the destination. // FIXME? This should also receive a MIME type if known, to differentiate between schema versions. // If the destination is in principle available, refuses this manifest type (e.g. it does not recognize the schema), // but may accept a different manifest type, the returned error must be an ManifestTypeRejectedError. func (d *openshiftImageDestination) PutManifest(ctx context.Context, m []byte, instanceDigest *digest.Digest) error { if instanceDigest == nil { manifestDigest, err := manifest.Digest(m) if err != nil { return err } d.imageStreamImageName = manifestDigest.String() } return d.docker.PutManifest(ctx, m, instanceDigest) } // PutSignaturesWithFormat writes a set of signatures to the destination. // If instanceDigest is not nil, it contains a digest of the specific manifest instance to write or overwrite the signatures for // (when the primary manifest is a manifest list); this should always be nil if the primary manifest is not a manifest list. // MUST be called after PutManifest (signatures may reference manifest contents). func (d *openshiftImageDestination) PutSignaturesWithFormat(ctx context.Context, signatures []signature.Signature, instanceDigest *digest.Digest) error { var imageStreamImageName string if instanceDigest == nil { if d.imageStreamImageName == "" { return errors.New("Internal error: Unknown manifest digest, can't add signatures") } imageStreamImageName = d.imageStreamImageName } else { imageStreamImageName = instanceDigest.String() } // Because image signatures are a shared resource in Atomic Registry, the default upload // always adds signatures. Eventually we should also allow removing signatures. if len(signatures) == 0 { return nil // No need to even read the old state. } image, err := d.client.getImage(ctx, imageStreamImageName) if err != nil { return err } existingSigNames := set.New[string]() for _, sig := range image.Signatures { existingSigNames.Add(sig.objectMeta.Name) } for _, newSigWithFormat := range signatures { newSigSimple, ok := newSigWithFormat.(signature.SimpleSigning) if !ok { return signature.UnsupportedFormatError(newSigWithFormat) } newSig := newSigSimple.UntrustedSignature() if slices.ContainsFunc(image.Signatures, func(existingSig imageSignature) bool { return existingSig.Type == imageSignatureTypeAtomic && bytes.Equal(existingSig.Content, newSig) }) { continue } // The API expect us to invent a new unique name. This is racy, but hopefully good enough. var signatureName string for { randBytes := make([]byte, 16) n, err := rand.Read(randBytes) if err != nil || n != 16 { return fmt.Errorf("generating random signature len %d: %w", n, err) } signatureName = fmt.Sprintf("%s@%032x", imageStreamImageName, randBytes) if !existingSigNames.Contains(signatureName) { break } } // Note: This does absolutely no kind/version checking or conversions. sig := imageSignature{ typeMeta: typeMeta{ Kind: "ImageSignature", APIVersion: "v1", }, objectMeta: objectMeta{Name: signatureName}, Type: imageSignatureTypeAtomic, Content: newSig, } body, err := json.Marshal(sig) if err != nil { return err } _, err = d.client.doRequest(ctx, http.MethodPost, "/oapi/v1/imagesignatures", body) if err != nil { return err } } return nil } // CommitWithOptions marks the process of storing the image as successful and asks for the image to be persisted. // WARNING: This does not have any transactional semantics: // - Uploaded data MAY be visible to others before CommitWithOptions() is called // - Uploaded data MAY be removed or MAY remain around if Close() is called without CommitWithOptions() (i.e. rollback is allowed but not guaranteed) func (d *openshiftImageDestination) CommitWithOptions(ctx context.Context, options private.CommitOptions) error { return d.docker.CommitWithOptions(ctx, options) } ================================================ FILE: vendor/go.podman.io/image/v5/openshift/openshift_src.go ================================================ package openshift import ( "context" "encoding/json" "errors" "fmt" "io" "net/http" "github.com/opencontainers/go-digest" "github.com/sirupsen/logrus" "go.podman.io/image/v5/docker" "go.podman.io/image/v5/internal/imagesource/impl" "go.podman.io/image/v5/internal/imagesource/stubs" "go.podman.io/image/v5/internal/private" "go.podman.io/image/v5/internal/signature" "go.podman.io/image/v5/types" ) type openshiftImageSource struct { impl.Compat impl.DoesNotAffectLayerInfosForCopy // This is slightly suboptimal. We could forward GetBlobAt(), but we need to call ensureImageIsResolved in SupportsGetBlobAt(), // and that method doesn’t provide a context for timing out. That could actually be fixed (SupportsGetBlobAt is private and we // can change it), but this is a deprecated transport anyway, so for now we just punt. stubs.NoGetBlobAtInitialize client *openshiftClient // Values specific to this image sys *types.SystemContext // State docker types.ImageSource // The docker/distribution API endpoint, or nil if not resolved yet imageStreamImageName string // Resolved image identifier, or "" if not known yet } // newImageSource creates a new ImageSource for the specified reference. // The caller must call .Close() on the returned ImageSource. func newImageSource(sys *types.SystemContext, ref openshiftReference) (private.ImageSource, error) { client, err := newOpenshiftClient(sys, ref) if err != nil { return nil, err } s := &openshiftImageSource{ NoGetBlobAtInitialize: stubs.NoGetBlobAt(ref), client: client, sys: sys, } s.Compat = impl.AddCompat(s) return s, nil } // Reference returns the reference used to set up this source, _as specified by the user_ // (not as the image itself, or its underlying storage, claims). This can be used e.g. to determine which public keys are trusted for this image. func (s *openshiftImageSource) Reference() types.ImageReference { return s.client.ref } // Close removes resources associated with an initialized ImageSource, if any. func (s *openshiftImageSource) Close() error { var err error if s.docker != nil { err = s.docker.Close() s.docker = nil } s.client.close() return err } // GetManifest returns the image's manifest along with its MIME type (which may be empty when it can't be determined but the manifest is available). // It may use a remote (= slow) service. // If instanceDigest is not nil, it contains a digest of the specific manifest instance to retrieve (when the primary manifest is a manifest list); // this never happens if the primary manifest is not a manifest list (e.g. if the source never returns manifest lists). func (s *openshiftImageSource) GetManifest(ctx context.Context, instanceDigest *digest.Digest) ([]byte, string, error) { if err := s.ensureImageIsResolved(ctx); err != nil { return nil, "", err } return s.docker.GetManifest(ctx, instanceDigest) } // HasThreadSafeGetBlob indicates whether GetBlob can be executed concurrently. func (s *openshiftImageSource) HasThreadSafeGetBlob() bool { return false } // GetBlob returns a stream for the specified blob, and the blob’s size (or -1 if unknown). // The Digest field in BlobInfo is guaranteed to be provided, Size may be -1 and MediaType may be optionally provided. // May update BlobInfoCache, preferably after it knows for certain that a blob truly exists at a specific location. func (s *openshiftImageSource) GetBlob(ctx context.Context, info types.BlobInfo, cache types.BlobInfoCache) (io.ReadCloser, int64, error) { if err := s.ensureImageIsResolved(ctx); err != nil { return nil, 0, err } return s.docker.GetBlob(ctx, info, cache) } // GetSignaturesWithFormat returns the image's signatures. It may use a remote (= slow) service. // If instanceDigest is not nil, it contains a digest of the specific manifest instance to retrieve signatures for // (when the primary manifest is a manifest list); this never happens if the primary manifest is not a manifest list // (e.g. if the source never returns manifest lists). func (s *openshiftImageSource) GetSignaturesWithFormat(ctx context.Context, instanceDigest *digest.Digest) ([]signature.Signature, error) { var imageStreamImageName string if instanceDigest == nil { if err := s.ensureImageIsResolved(ctx); err != nil { return nil, err } imageStreamImageName = s.imageStreamImageName } else { if err := instanceDigest.Validate(); err != nil { // Make sure instanceDigest.String() does not contain any unexpected characters return nil, err } imageStreamImageName = instanceDigest.String() } image, err := s.client.getImage(ctx, imageStreamImageName) if err != nil { return nil, err } var sigs []signature.Signature for _, sig := range image.Signatures { if sig.Type == imageSignatureTypeAtomic { sigs = append(sigs, signature.SimpleSigningFromBlob(sig.Content)) } } return sigs, nil } // ensureImageIsResolved sets up s.docker and s.imageStreamImageName func (s *openshiftImageSource) ensureImageIsResolved(ctx context.Context) error { if s.docker != nil { return nil } // FIXME: validate components per validation.IsValidPathSegmentName? path := fmt.Sprintf("/oapi/v1/namespaces/%s/imagestreams/%s", s.client.ref.namespace, s.client.ref.stream) body, err := s.client.doRequest(ctx, http.MethodGet, path, nil) if err != nil { return err } // Note: This does absolutely no kind/version checking or conversions. var is imageStream if err := json.Unmarshal(body, &is); err != nil { return err } var te *tagEvent for _, tag := range is.Status.Tags { if tag.Tag != s.client.ref.dockerReference.Tag() { continue } if len(tag.Items) > 0 { te = &tag.Items[0] break } } if te == nil { return errors.New("No matching tag found") } logrus.Debugf("tag event %#v", te) dockerRefString, err := s.client.convertDockerImageReference(te.DockerImageReference) if err != nil { return err } logrus.Debugf("Resolved reference %#v", dockerRefString) dockerRef, err := docker.ParseReference("//" + dockerRefString) if err != nil { return err } d, err := dockerRef.NewImageSource(ctx, s.sys) if err != nil { return err } s.docker = d s.imageStreamImageName = te.Image return nil } ================================================ FILE: vendor/go.podman.io/image/v5/openshift/openshift_transport.go ================================================ package openshift import ( "context" "errors" "fmt" "strings" "go.podman.io/image/v5/docker/policyconfiguration" "go.podman.io/image/v5/docker/reference" genericImage "go.podman.io/image/v5/internal/image" "go.podman.io/image/v5/transports" "go.podman.io/image/v5/types" "go.podman.io/storage/pkg/regexp" ) func init() { transports.Register(Transport) } // Transport is an ImageTransport for OpenShift registry-hosted images. var Transport = openshiftTransport{} type openshiftTransport struct{} func (t openshiftTransport) Name() string { return "atomic" } // ParseReference converts a string, which should not start with the ImageTransport.Name prefix, into an ImageReference. func (t openshiftTransport) ParseReference(reference string) (types.ImageReference, error) { return ParseReference(reference) } // Note that imageNameRegexp is namespace/stream:tag, this // is HOSTNAME/namespace/stream:tag or parent prefixes. // Keep this in sync with imageNameRegexp! var scopeRegexp = regexp.Delayed("^[^/]*(/[^:/]*(/[^:/]*(:[^:/]*)?)?)?$") // ValidatePolicyConfigurationScope checks that scope is a valid name for a signature.PolicyTransportScopes keys // (i.e. a valid PolicyConfigurationIdentity() or PolicyConfigurationNamespaces() return value). // It is acceptable to allow an invalid value which will never be matched, it can "only" cause user confusion. // scope passed to this function will not be "", that value is always allowed. func (t openshiftTransport) ValidatePolicyConfigurationScope(scope string) error { if scopeRegexp.FindStringIndex(scope) == nil { return fmt.Errorf("Invalid scope name %s", scope) } return nil } // openshiftReference is an ImageReference for OpenShift images. type openshiftReference struct { dockerReference reference.NamedTagged namespace string // Computed from dockerReference in advance. stream string // Computed from dockerReference in advance. } // ParseReference converts a string, which should not start with the ImageTransport.Name prefix, into an OpenShift ImageReference. func ParseReference(ref string) (types.ImageReference, error) { r, err := reference.ParseNormalizedNamed(ref) if err != nil { return nil, fmt.Errorf("failed to parse image reference %q: %w", ref, err) } tagged, ok := r.(reference.NamedTagged) if !ok { return nil, fmt.Errorf("invalid image reference %s, expected format: 'hostname/namespace/stream:tag'", ref) } return NewReference(tagged) } // NewReference returns an OpenShift reference for a reference.NamedTagged func NewReference(dockerRef reference.NamedTagged) (types.ImageReference, error) { r := strings.SplitN(reference.Path(dockerRef), "/", 3) if len(r) != 2 { return nil, fmt.Errorf("invalid image reference: %s, expected format: 'hostname/namespace/stream:tag'", reference.FamiliarString(dockerRef)) } return openshiftReference{ namespace: r[0], stream: r[1], dockerReference: dockerRef, }, nil } func (ref openshiftReference) Transport() types.ImageTransport { return Transport } // StringWithinTransport returns a string representation of the reference, which MUST be such that // reference.Transport().ParseReference(reference.StringWithinTransport()) returns an equivalent reference. // NOTE: The returned string is not promised to be equal to the original input to ParseReference; // e.g. default attribute values omitted by the user may be filled in the return value, or vice versa. // WARNING: Do not use the return value in the UI to describe an image, it does not contain the Transport().Name() prefix. func (ref openshiftReference) StringWithinTransport() string { return reference.FamiliarString(ref.dockerReference) } // DockerReference returns a Docker reference associated with this reference // (fully explicit, i.e. !reference.IsNameOnly, but reflecting user intent, // not e.g. after redirect or alias processing), or nil if unknown/not applicable. func (ref openshiftReference) DockerReference() reference.Named { return ref.dockerReference } // PolicyConfigurationIdentity returns a string representation of the reference, suitable for policy lookup. // This MUST reflect user intent, not e.g. after processing of third-party redirects or aliases; // The value SHOULD be fully explicit about its semantics, with no hidden defaults, AND canonical // (i.e. various references with exactly the same semantics should return the same configuration identity) // It is fine for the return value to be equal to StringWithinTransport(), and it is desirable but // not required/guaranteed that it will be a valid input to Transport().ParseReference(). // Returns "" if configuration identities for these references are not supported. func (ref openshiftReference) PolicyConfigurationIdentity() string { res, err := policyconfiguration.DockerReferenceIdentity(ref.dockerReference) if res == "" || err != nil { // Coverage: Should never happen, NewReference constructs a valid tagged reference. panic(fmt.Sprintf("Internal inconsistency: policyconfiguration.DockerReferenceIdentity returned %#v, %v", res, err)) } return res } // PolicyConfigurationNamespaces returns a list of other policy configuration namespaces to search // for if explicit configuration for PolicyConfigurationIdentity() is not set. The list will be processed // in order, terminating on first match, and an implicit "" is always checked at the end. // It is STRONGLY recommended for the first element, if any, to be a prefix of PolicyConfigurationIdentity(), // and each following element to be a prefix of the element preceding it. func (ref openshiftReference) PolicyConfigurationNamespaces() []string { return policyconfiguration.DockerReferenceNamespaces(ref.dockerReference) } // NewImage returns a types.ImageCloser for this reference, possibly specialized for this ImageTransport. // The caller must call .Close() on the returned ImageCloser. // NOTE: If any kind of signature verification should happen, build an UnparsedImage from the value returned by NewImageSource, // verify that UnparsedImage, and convert it into a real Image via image.FromUnparsedImage. // WARNING: This may not do the right thing for a manifest list, see image.FromSource for details. func (ref openshiftReference) NewImage(ctx context.Context, sys *types.SystemContext) (types.ImageCloser, error) { return genericImage.FromReference(ctx, sys, ref) } // NewImageSource returns a types.ImageSource for this reference. // The caller must call .Close() on the returned ImageSource. func (ref openshiftReference) NewImageSource(ctx context.Context, sys *types.SystemContext) (types.ImageSource, error) { return newImageSource(sys, ref) } // NewImageDestination returns a types.ImageDestination for this reference. // The caller must call .Close() on the returned ImageDestination. func (ref openshiftReference) NewImageDestination(ctx context.Context, sys *types.SystemContext) (types.ImageDestination, error) { return newImageDestination(ctx, sys, ref) } // DeleteImage deletes the named image from the registry, if supported. func (ref openshiftReference) DeleteImage(ctx context.Context, sys *types.SystemContext) error { return errors.New("Deleting images not implemented for atomic: images") } ================================================ FILE: vendor/go.podman.io/image/v5/pkg/blobinfocache/default.go ================================================ package blobinfocache import ( "fmt" "os" "path/filepath" "github.com/sirupsen/logrus" "go.podman.io/image/v5/internal/rootless" "go.podman.io/image/v5/pkg/blobinfocache/memory" "go.podman.io/image/v5/pkg/blobinfocache/sqlite" "go.podman.io/image/v5/types" ) const ( // blobInfoCacheFilename is the file name used for blob info caches. // If the format changes in an incompatible way, increase the version number. blobInfoCacheFilename = "blob-info-cache-v1.sqlite" // systemBlobInfoCacheDir is the directory containing the blob info cache (in blobInfocacheFilename) for root-running processes. systemBlobInfoCacheDir = "/var/lib/containers/cache" ) // blobInfoCacheDir returns a path to a blob info cache appropriate for sys and euid. // euid is used so that (sudo …) does not write root-owned files into the unprivileged users’ home directory. func blobInfoCacheDir(sys *types.SystemContext, euid int) (string, error) { if sys != nil && sys.BlobInfoCacheDir != "" { return sys.BlobInfoCacheDir, nil } // FIXME? On Windows, os.Geteuid() returns -1. What should we do? Right now we treat it as unprivileged // and fail (fall back to memory-only) if neither HOME nor XDG_DATA_HOME is set, which is, at least, safe. if euid == 0 { if sys != nil && sys.RootForImplicitAbsolutePaths != "" { return filepath.Join(sys.RootForImplicitAbsolutePaths, systemBlobInfoCacheDir), nil } return systemBlobInfoCacheDir, nil } // This is intended to mirror the GraphRoot determination in github.com/containers/libpod/pkg/util.GetRootlessStorageOpts. dataDir := os.Getenv("XDG_DATA_HOME") if dataDir == "" { home := os.Getenv("HOME") if home == "" { return "", fmt.Errorf("neither XDG_DATA_HOME nor HOME was set non-empty") } dataDir = filepath.Join(home, ".local", "share") } return filepath.Join(dataDir, "containers", "cache"), nil } // DefaultCache returns the default BlobInfoCache implementation appropriate for sys. func DefaultCache(sys *types.SystemContext) types.BlobInfoCache { dir, err := blobInfoCacheDir(sys, rootless.GetRootlessEUID()) if err != nil { logrus.Debugf("Error determining a location for %s, using a memory-only cache", blobInfoCacheFilename) return memory.New() } path := filepath.Join(dir, blobInfoCacheFilename) if err := os.MkdirAll(dir, 0o700); err != nil { logrus.Debugf("Error creating parent directories for %s, using a memory-only cache: %v", path, err) return memory.New() } // It might make sense to keep a single sqlite cache object, and a single initialized sqlite connection, open // as global singleton, for the vast majority of callers who don’t override thde cache location. // OTOH that would keep a file descriptor open forever, even for long-term callers who copy images rarely, // and the performance benefit to this over using an Open()/Close() pair for a single image copy is < 10%. cache, err := sqlite.New(path) if err != nil { logrus.Debugf("Error creating a SQLite blob info cache at %s, using a memory-only cache: %v", path, err) return memory.New() } logrus.Debugf("Using SQLite blob info cache at %s", path) return cache } // CleanupDefaultCache removes the blob info cache directory. // It deletes the cache directory but it does not affect any file or memory buffer currently // in use. func CleanupDefaultCache(sys *types.SystemContext) error { dir, err := blobInfoCacheDir(sys, rootless.GetRootlessEUID()) if err != nil { // Mirror the DefaultCache behavior that does not fail in this case return nil } return os.RemoveAll(dir) } ================================================ FILE: vendor/go.podman.io/image/v5/pkg/blobinfocache/internal/prioritize/prioritize.go ================================================ // Package prioritize provides utilities for filtering and prioritizing locations in // types.BlobInfoCache.CandidateLocations. package prioritize import ( "cmp" "slices" "time" "github.com/opencontainers/go-digest" "github.com/sirupsen/logrus" "go.podman.io/image/v5/internal/blobinfocache" "go.podman.io/image/v5/internal/manifest" "go.podman.io/image/v5/pkg/compression" "go.podman.io/image/v5/types" ) // replacementAttempts is the number of blob replacement candidates with known location returned by destructivelyPrioritizeReplacementCandidates, // and therefore ultimately by types.BlobInfoCache.CandidateLocations. // This is a heuristic/guess, and could well use a different value. const replacementAttempts = 5 // replacementUnknownLocationAttempts is the number of blob replacement candidates with unknown Location returned by destructivelyPrioritizeReplacementCandidates, // and therefore ultimately by blobinfocache.BlobInfoCache2.CandidateLocations2. // This is a heuristic/guess, and could well use a different value. const replacementUnknownLocationAttempts = 2 // CandidateTemplate is a subset of BICReplacementCandidate2 with data related to a specific digest, // which can be later combined with information about a location. type CandidateTemplate struct { digest digest.Digest compressionOperation types.LayerCompression // Either types.Decompress for uncompressed, or types.Compress for compressed compressionAlgorithm *compression.Algorithm // An algorithm when the candidate is compressed, or nil when it is uncompressed compressionAnnotations map[string]string // If necessary, annotations necessary to use compressionAlgorithm } // CandidateTemplateWithCompression returns a CandidateTemplate if a blob with data is acceptable // for a CandidateLocations* call with v2Options. // // v2Options can be set to nil if the call is CandidateLocations (i.e. compression is not required to be known); // if not nil, the call is assumed to be CandidateLocations2. func CandidateTemplateWithCompression(v2Options *blobinfocache.CandidateLocations2Options, digest digest.Digest, data blobinfocache.DigestCompressorData) *CandidateTemplate { if v2Options == nil { return &CandidateTemplate{ // Anything goes. The compressionOperation, compressionAlgorithm and compressionAnnotations values are not used. digest: digest, } } requiredCompression := "nil" if v2Options.RequiredCompression != nil { requiredCompression = v2Options.RequiredCompression.Name() } switch data.BaseVariantCompressor { case blobinfocache.Uncompressed: if !manifest.CandidateCompressionMatchesReuseConditions(manifest.ReuseConditions{ PossibleManifestFormats: v2Options.PossibleManifestFormats, RequiredCompression: v2Options.RequiredCompression, }, nil) { logrus.Debugf("Ignoring BlobInfoCache record of digest %q, uncompressed format does not match required %s or MIME types %#v", digest.String(), requiredCompression, v2Options.PossibleManifestFormats) return nil } return &CandidateTemplate{ digest: digest, compressionOperation: types.Decompress, compressionAlgorithm: nil, compressionAnnotations: nil, } case blobinfocache.UnknownCompression: logrus.Debugf("Ignoring BlobInfoCache record of digest %q with unknown compression", digest.String()) return nil // Not allowed with CandidateLocations2 default: // See if we can use the specific variant, first. if data.SpecificVariantCompressor != blobinfocache.UnknownCompression { algo, err := compression.AlgorithmByName(data.SpecificVariantCompressor) if err != nil { logrus.Debugf("Not considering unrecognized specific compression variant %q for BlobInfoCache record of digest %q: %v", data.SpecificVariantCompressor, digest.String(), err) } else { if !manifest.CandidateCompressionMatchesReuseConditions(manifest.ReuseConditions{ PossibleManifestFormats: v2Options.PossibleManifestFormats, RequiredCompression: v2Options.RequiredCompression, }, &algo) { logrus.Debugf("Ignoring specific compression variant %q for BlobInfoCache record of digest %q, it does not match required %s or MIME types %#v", data.SpecificVariantCompressor, digest.String(), requiredCompression, v2Options.PossibleManifestFormats) } else { return &CandidateTemplate{ digest: digest, compressionOperation: types.Compress, compressionAlgorithm: &algo, compressionAnnotations: data.SpecificVariantAnnotations, } } } } // Try the base variant. algo, err := compression.AlgorithmByName(data.BaseVariantCompressor) if err != nil { logrus.Debugf("Ignoring BlobInfoCache record of digest %q with unrecognized compression %q: %v", digest.String(), data.BaseVariantCompressor, err) return nil // The BICReplacementCandidate2.CompressionAlgorithm field is required } if !manifest.CandidateCompressionMatchesReuseConditions(manifest.ReuseConditions{ PossibleManifestFormats: v2Options.PossibleManifestFormats, RequiredCompression: v2Options.RequiredCompression, }, &algo) { logrus.Debugf("Ignoring BlobInfoCache record of digest %q, compression %q does not match required %s or MIME types %#v", digest.String(), data.BaseVariantCompressor, requiredCompression, v2Options.PossibleManifestFormats) return nil } return &CandidateTemplate{ digest: digest, compressionOperation: types.Compress, compressionAlgorithm: &algo, compressionAnnotations: nil, } } } // CandidateWithTime is the input to types.BICReplacementCandidate prioritization. type CandidateWithTime struct { candidate blobinfocache.BICReplacementCandidate2 // The replacement candidate lastSeen time.Time // Time the candidate was last known to exist (either read or written) (not set for Candidate.UnknownLocation) } // CandidateWithLocation returns a complete CandidateWithTime combining (template from CandidateTemplateWithCompression, location, lastSeen) func (template CandidateTemplate) CandidateWithLocation(location types.BICLocationReference, lastSeen time.Time) CandidateWithTime { return CandidateWithTime{ candidate: blobinfocache.BICReplacementCandidate2{ Digest: template.digest, CompressionOperation: template.compressionOperation, CompressionAlgorithm: template.compressionAlgorithm, CompressionAnnotations: template.compressionAnnotations, UnknownLocation: false, Location: location, }, lastSeen: lastSeen, } } // CandidateWithUnknownLocation returns a complete CandidateWithTime for a template from CandidateTemplateWithCompression and an unknown location. func (template CandidateTemplate) CandidateWithUnknownLocation() CandidateWithTime { return CandidateWithTime{ candidate: blobinfocache.BICReplacementCandidate2{ Digest: template.digest, CompressionOperation: template.compressionOperation, CompressionAlgorithm: template.compressionAlgorithm, CompressionAnnotations: template.compressionAnnotations, UnknownLocation: true, Location: types.BICLocationReference{Opaque: ""}, }, lastSeen: time.Time{}, } } // candidateSortState is a closure for a comparison used by slices.SortFunc on candidates to prioritize, // along with the specially-treated digest values relevant to the ordering. type candidateSortState struct { primaryDigest digest.Digest // The digest the user actually asked for uncompressedDigest digest.Digest // The uncompressed digest corresponding to primaryDigest. May be "", or even equal to primaryDigest } func (css *candidateSortState) compare(xi, xj CandidateWithTime) int { // primaryDigest entries come first, more recent first. // uncompressedDigest entries, if uncompressedDigest is set and != primaryDigest, come last, more recent entry first. // Other digest values are primarily sorted by time (more recent first), secondarily by digest (to provide a deterministic order) // First, deal with the primaryDigest/uncompressedDigest cases: if xi.candidate.Digest != xj.candidate.Digest { // - The two digests are different, and one (or both) of the digests is primaryDigest or uncompressedDigest: time does not matter if xi.candidate.Digest == css.primaryDigest { return -1 } if xj.candidate.Digest == css.primaryDigest { return 1 } if css.uncompressedDigest != "" { if xi.candidate.Digest == css.uncompressedDigest { return 1 } if xj.candidate.Digest == css.uncompressedDigest { return -1 } } } else { // xi.Candidate.Digest == xj.Candidate.Digest // The two digests are the same, and are either primaryDigest or uncompressedDigest: order by time if xi.candidate.Digest == css.primaryDigest || (css.uncompressedDigest != "" && xi.candidate.Digest == css.uncompressedDigest) { return -xi.lastSeen.Compare(xj.lastSeen) } } // Neither of the digests are primaryDigest/uncompressedDigest: if cmp := xi.lastSeen.Compare(xj.lastSeen); cmp != 0 { // Order primarily by time return -cmp } // Fall back to digest, if timestamps end up _exactly_ the same (how?!) return cmp.Compare(xi.candidate.Digest, xj.candidate.Digest) } // destructivelyPrioritizeReplacementCandidatesWithMax is destructivelyPrioritizeReplacementCandidates with parameters for the // number of entries to limit for known and unknown location separately, only to make testing simpler. func destructivelyPrioritizeReplacementCandidatesWithMax(cs []CandidateWithTime, primaryDigest, uncompressedDigest digest.Digest, totalLimit int, noLocationLimit int) []blobinfocache.BICReplacementCandidate2 { // split unknown candidates and known candidates // and limit them separately. var knownLocationCandidates []CandidateWithTime var unknownLocationCandidates []CandidateWithTime // We don't need to use sort.Stable() because nanosecond timestamps are (presumably?) unique, so no two elements should // compare equal. slices.SortFunc(cs, (&candidateSortState{ primaryDigest: primaryDigest, uncompressedDigest: uncompressedDigest, }).compare) for _, candidate := range cs { if candidate.candidate.UnknownLocation { unknownLocationCandidates = append(unknownLocationCandidates, candidate) } else { knownLocationCandidates = append(knownLocationCandidates, candidate) } } knownLocationCandidatesUsed := min(len(knownLocationCandidates), totalLimit) remainingCapacity := totalLimit - knownLocationCandidatesUsed unknownLocationCandidatesUsed := min(noLocationLimit, remainingCapacity, len(unknownLocationCandidates)) res := make([]blobinfocache.BICReplacementCandidate2, knownLocationCandidatesUsed) for i := 0; i < knownLocationCandidatesUsed; i++ { res[i] = knownLocationCandidates[i].candidate } // If candidates with unknown location are found, lets add them to final list for i := range unknownLocationCandidatesUsed { res = append(res, unknownLocationCandidates[i].candidate) } return res } // DestructivelyPrioritizeReplacementCandidates consumes AND DESTROYS an array of possible replacement candidates with their last known existence times, // the primary digest the user actually asked for, the corresponding uncompressed digest (if known, possibly equal to the primary digest) returns an // appropriately prioritized and/or trimmed result suitable for a return value from types.BlobInfoCache.CandidateLocations. // // WARNING: The array of candidates is destructively modified. (The implementation of this function could of course // make a copy, but all CandidateLocations implementations build the slice of candidates only for the single purpose of calling this function anyway.) func DestructivelyPrioritizeReplacementCandidates(cs []CandidateWithTime, primaryDigest, uncompressedDigest digest.Digest) []blobinfocache.BICReplacementCandidate2 { return destructivelyPrioritizeReplacementCandidatesWithMax(cs, primaryDigest, uncompressedDigest, replacementAttempts, replacementUnknownLocationAttempts) } ================================================ FILE: vendor/go.podman.io/image/v5/pkg/blobinfocache/memory/memory.go ================================================ // Package memory implements an in-memory BlobInfoCache. package memory import ( "sync" "time" digest "github.com/opencontainers/go-digest" "github.com/sirupsen/logrus" "go.podman.io/image/v5/internal/blobinfocache" "go.podman.io/image/v5/internal/set" "go.podman.io/image/v5/pkg/blobinfocache/internal/prioritize" "go.podman.io/image/v5/types" ) // locationKey only exists to make lookup in knownLocations easier. type locationKey struct { transport string scope types.BICTransportScope blobDigest digest.Digest } // cache implements an in-memory-only BlobInfoCache. type cache struct { mutex sync.Mutex // The following fields can only be accessed with mutex held. uncompressedDigests map[digest.Digest]digest.Digest uncompressedDigestsByTOC map[digest.Digest]digest.Digest digestsByUncompressed map[digest.Digest]*set.Set[digest.Digest] // stores a set of digests for each uncompressed digest knownLocations map[locationKey]map[types.BICLocationReference]time.Time // stores last known existence time for each location reference compressors map[digest.Digest]blobinfocache.DigestCompressorData // stores compression data for each digest; BaseVariantCompressor != UnknownCompression } // New returns a BlobInfoCache implementation which is in-memory only. // // This is primarily intended for tests, but also used as a fallback // if blobinfocache.DefaultCache can’t determine, or set up, the // location for a persistent cache. Most users should use // blobinfocache.DefaultCache. instead of calling this directly. // Manual users of types.{ImageSource,ImageDestination} might also use // this instead of a persistent cache. func New() types.BlobInfoCache { return new2() } func new2() *cache { return &cache{ uncompressedDigests: map[digest.Digest]digest.Digest{}, uncompressedDigestsByTOC: map[digest.Digest]digest.Digest{}, digestsByUncompressed: map[digest.Digest]*set.Set[digest.Digest]{}, knownLocations: map[locationKey]map[types.BICLocationReference]time.Time{}, compressors: map[digest.Digest]blobinfocache.DigestCompressorData{}, } } // Open() sets up the cache for future accesses, potentially acquiring costly state. Each Open() must be paired with a Close(). // Note that public callers may call the types.BlobInfoCache operations without Open()/Close(). func (mem *cache) Open() { } // Close destroys state created by Open(). func (mem *cache) Close() { } // UncompressedDigest returns an uncompressed digest corresponding to anyDigest. // May return anyDigest if it is known to be uncompressed. // Returns "" if nothing is known about the digest (it may be compressed or uncompressed). func (mem *cache) UncompressedDigest(anyDigest digest.Digest) digest.Digest { mem.mutex.Lock() defer mem.mutex.Unlock() return mem.uncompressedDigestLocked(anyDigest) } // uncompressedDigestLocked implements types.BlobInfoCache.UncompressedDigest, but must be called only with mem.mutex held. func (mem *cache) uncompressedDigestLocked(anyDigest digest.Digest) digest.Digest { if d, ok := mem.uncompressedDigests[anyDigest]; ok { return d } // Presence in digestsByUncompressed implies that anyDigest must already refer to an uncompressed digest. // This way we don't have to waste storage space with trivial (uncompressed, uncompressed) mappings // when we already record a (compressed, uncompressed) pair. if s, ok := mem.digestsByUncompressed[anyDigest]; ok && !s.Empty() { return anyDigest } return "" } // RecordDigestUncompressedPair records that the uncompressed version of anyDigest is uncompressed. // It’s allowed for anyDigest == uncompressed. // WARNING: Only call this for LOCALLY VERIFIED data; don’t record a digest pair just because some remote author claims so (e.g. // because a manifest/config pair exists); otherwise the cache could be poisoned and allow substituting unexpected blobs. // (Eventually, the DiffIDs in image config could detect the substitution, but that may be too late, and not all image formats contain that data.) func (mem *cache) RecordDigestUncompressedPair(anyDigest digest.Digest, uncompressed digest.Digest) { mem.mutex.Lock() defer mem.mutex.Unlock() if previous, ok := mem.uncompressedDigests[anyDigest]; ok && previous != uncompressed { logrus.Warnf("Uncompressed digest for blob %s previously recorded as %s, now %s", anyDigest, previous, uncompressed) } mem.uncompressedDigests[anyDigest] = uncompressed anyDigestSet, ok := mem.digestsByUncompressed[uncompressed] if !ok { anyDigestSet = set.New[digest.Digest]() mem.digestsByUncompressed[uncompressed] = anyDigestSet } anyDigestSet.Add(anyDigest) } // UncompressedDigestForTOC returns an uncompressed digest corresponding to anyDigest. // Returns "" if the uncompressed digest is unknown. func (mem *cache) UncompressedDigestForTOC(tocDigest digest.Digest) digest.Digest { mem.mutex.Lock() defer mem.mutex.Unlock() if d, ok := mem.uncompressedDigestsByTOC[tocDigest]; ok { return d } return "" } // RecordTOCUncompressedPair records that the tocDigest corresponds to uncompressed. // WARNING: Only call this for LOCALLY VERIFIED data; don’t record a digest pair just because some remote author claims so (e.g. // because a manifest/config pair exists); otherwise the cache could be poisoned and allow substituting unexpected blobs. // (Eventually, the DiffIDs in image config could detect the substitution, but that may be too late, and not all image formats contain that data.) func (mem *cache) RecordTOCUncompressedPair(tocDigest digest.Digest, uncompressed digest.Digest) { mem.mutex.Lock() defer mem.mutex.Unlock() if previous, ok := mem.uncompressedDigestsByTOC[tocDigest]; ok && previous != uncompressed { logrus.Warnf("Uncompressed digest for blob with TOC %q previously recorded as %q, now %q", tocDigest, previous, uncompressed) } mem.uncompressedDigestsByTOC[tocDigest] = uncompressed } // RecordKnownLocation records that a blob with the specified digest exists within the specified (transport, scope) scope, // and can be reused given the opaque location data. func (mem *cache) RecordKnownLocation(transport types.ImageTransport, scope types.BICTransportScope, blobDigest digest.Digest, location types.BICLocationReference) { mem.mutex.Lock() defer mem.mutex.Unlock() key := locationKey{transport: transport.Name(), scope: scope, blobDigest: blobDigest} locationScope, ok := mem.knownLocations[key] if !ok { locationScope = map[types.BICLocationReference]time.Time{} mem.knownLocations[key] = locationScope } locationScope[location] = time.Now() // Possibly overwriting an older entry. } // RecordDigestCompressorData records data for the blob with the specified digest. // WARNING: Only call this with LOCALLY VERIFIED data: // - don’t record a compressor for a digest just because some remote author claims so // (e.g. because a manifest says so); // - don’t record the non-base variant or annotations if we are not _sure_ that the base variant // and the blob’s digest match the non-base variant’s annotations (e.g. because we saw them // in a manifest) // // otherwise the cache could be poisoned and cause us to make incorrect edits to type // information in a manifest. func (mem *cache) RecordDigestCompressorData(anyDigest digest.Digest, data blobinfocache.DigestCompressorData) { mem.mutex.Lock() defer mem.mutex.Unlock() if previous, ok := mem.compressors[anyDigest]; ok { if previous.BaseVariantCompressor != data.BaseVariantCompressor { logrus.Warnf("Base compressor for blob with digest %s previously recorded as %s, now %s", anyDigest, previous.BaseVariantCompressor, data.BaseVariantCompressor) } else if previous.SpecificVariantCompressor != blobinfocache.UnknownCompression && data.SpecificVariantCompressor != blobinfocache.UnknownCompression && previous.SpecificVariantCompressor != data.SpecificVariantCompressor { logrus.Warnf("Specific compressor for blob with digest %s previously recorded as %s, now %s", anyDigest, previous.SpecificVariantCompressor, data.SpecificVariantCompressor) } // We don’t check SpecificVariantAnnotations for equality, it’s possible that their generation is not deterministic. // Preserve specific variant information if the incoming data does not have it. if data.BaseVariantCompressor != blobinfocache.UnknownCompression && data.SpecificVariantCompressor == blobinfocache.UnknownCompression && previous.SpecificVariantCompressor != blobinfocache.UnknownCompression { data.SpecificVariantCompressor = previous.SpecificVariantCompressor data.SpecificVariantAnnotations = previous.SpecificVariantAnnotations } } if data.BaseVariantCompressor == blobinfocache.UnknownCompression { delete(mem.compressors, anyDigest) return } mem.compressors[anyDigest] = data } // appendReplacementCandidates creates prioritize.CandidateWithTime values for digest in memory // with corresponding compression info from mem.compressors, and returns the result of appending // them to candidates. // v2Options is not nil if the caller is CandidateLocations2: this allows including candidates with unknown location, and filters out candidates // with unknown compression. func (mem *cache) appendReplacementCandidates(candidates []prioritize.CandidateWithTime, transport types.ImageTransport, scope types.BICTransportScope, digest digest.Digest, v2Options *blobinfocache.CandidateLocations2Options, ) []prioritize.CandidateWithTime { compressionData := blobinfocache.DigestCompressorData{ BaseVariantCompressor: blobinfocache.UnknownCompression, SpecificVariantCompressor: blobinfocache.UnknownCompression, SpecificVariantAnnotations: nil, } if v, ok := mem.compressors[digest]; ok { compressionData = v } template := prioritize.CandidateTemplateWithCompression(v2Options, digest, compressionData) if template == nil { return candidates } locations := mem.knownLocations[locationKey{transport: transport.Name(), scope: scope, blobDigest: digest}] // nil if not present if len(locations) > 0 { for l, t := range locations { candidates = append(candidates, template.CandidateWithLocation(l, t)) } } else if v2Options != nil { candidates = append(candidates, template.CandidateWithUnknownLocation()) } return candidates } // CandidateLocations returns a prioritized, limited, number of blobs and their locations that could possibly be reused // within the specified (transport scope) (if they still exist, which is not guaranteed). // // If !canSubstitute, the returned candidates will match the submitted digest exactly; if canSubstitute, // data from previous RecordDigestUncompressedPair calls is used to also look up variants of the blob which have the same // uncompressed digest. func (mem *cache) CandidateLocations(transport types.ImageTransport, scope types.BICTransportScope, primaryDigest digest.Digest, canSubstitute bool) []types.BICReplacementCandidate { return blobinfocache.CandidateLocationsFromV2(mem.candidateLocations(transport, scope, primaryDigest, canSubstitute, nil)) } // CandidateLocations2 returns a prioritized, limited, number of blobs and their locations (if known) // that could possibly be reused within the specified (transport scope) (if they still // exist, which is not guaranteed). func (mem *cache) CandidateLocations2(transport types.ImageTransport, scope types.BICTransportScope, primaryDigest digest.Digest, options blobinfocache.CandidateLocations2Options) []blobinfocache.BICReplacementCandidate2 { return mem.candidateLocations(transport, scope, primaryDigest, options.CanSubstitute, &options) } // candidateLocations implements CandidateLocations / CandidateLocations2. // v2Options is not nil if the caller is CandidateLocations2. func (mem *cache) candidateLocations(transport types.ImageTransport, scope types.BICTransportScope, primaryDigest digest.Digest, canSubstitute bool, v2Options *blobinfocache.CandidateLocations2Options, ) []blobinfocache.BICReplacementCandidate2 { mem.mutex.Lock() defer mem.mutex.Unlock() res := []prioritize.CandidateWithTime{} res = mem.appendReplacementCandidates(res, transport, scope, primaryDigest, v2Options) var uncompressedDigest digest.Digest // = "" if canSubstitute { if uncompressedDigest = mem.uncompressedDigestLocked(primaryDigest); uncompressedDigest != "" { otherDigests := mem.digestsByUncompressed[uncompressedDigest] // nil if not present in the map if otherDigests != nil { for d := range otherDigests.All() { if d != primaryDigest && d != uncompressedDigest { res = mem.appendReplacementCandidates(res, transport, scope, d, v2Options) } } } if uncompressedDigest != primaryDigest { res = mem.appendReplacementCandidates(res, transport, scope, uncompressedDigest, v2Options) } } } return prioritize.DestructivelyPrioritizeReplacementCandidates(res, primaryDigest, uncompressedDigest) } ================================================ FILE: vendor/go.podman.io/image/v5/pkg/blobinfocache/none/none.go ================================================ // Package none implements a dummy BlobInfoCache which records no data. package none import ( "github.com/opencontainers/go-digest" "go.podman.io/image/v5/internal/blobinfocache" "go.podman.io/image/v5/types" ) // noCache implements a dummy BlobInfoCache which records no data. type noCache struct{} // NoCache implements BlobInfoCache by not recording any data. // // This exists primarily for implementations of configGetter for // Manifest.Inspect, because configs only have one representation. // Any use of BlobInfoCache with blobs should usually use at least a // short-lived cache, ideally blobinfocache.DefaultCache. var NoCache blobinfocache.BlobInfoCache2 = blobinfocache.FromBlobInfoCache(&noCache{}) // UncompressedDigest returns an uncompressed digest corresponding to anyDigest. // May return anyDigest if it is known to be uncompressed. // Returns "" if nothing is known about the digest (it may be compressed or uncompressed). func (noCache) UncompressedDigest(anyDigest digest.Digest) digest.Digest { return "" } // RecordDigestUncompressedPair records that the uncompressed version of anyDigest is uncompressed. // It’s allowed for anyDigest == uncompressed. // WARNING: Only call this for LOCALLY VERIFIED data; don’t record a digest pair just because some remote author claims so (e.g. // because a manifest/config pair exists); otherwise the cache could be poisoned and allow substituting unexpected blobs. // (Eventually, the DiffIDs in image config could detect the substitution, but that may be too late, and not all image formats contain that data.) func (noCache) RecordDigestUncompressedPair(anyDigest digest.Digest, uncompressed digest.Digest) { } // UncompressedDigestForTOC returns an uncompressed digest corresponding to anyDigest. // Returns "" if the uncompressed digest is unknown. func (noCache) UncompressedDigestForTOC(tocDigest digest.Digest) digest.Digest { return "" } // RecordTOCUncompressedPair records that the tocDigest corresponds to uncompressed. // WARNING: Only call this for LOCALLY VERIFIED data; don’t record a digest pair just because some remote author claims so (e.g. // because a manifest/config pair exists); otherwise the cache could be poisoned and allow substituting unexpected blobs. // (Eventually, the DiffIDs in image config could detect the substitution, but that may be too late, and not all image formats contain that data.) func (noCache) RecordTOCUncompressedPair(tocDigest digest.Digest, uncompressed digest.Digest) { } // RecordKnownLocation records that a blob with the specified digest exists within the specified (transport, scope) scope, // and can be reused given the opaque location data. func (noCache) RecordKnownLocation(transport types.ImageTransport, scope types.BICTransportScope, blobDigest digest.Digest, location types.BICLocationReference) { } // CandidateLocations returns a prioritized, limited, number of blobs and their locations that could possibly be reused // within the specified (transport scope) (if they still exist, which is not guaranteed). // // If !canSubstitute, the returned candidates will match the submitted digest exactly; if canSubstitute, // data from previous RecordDigestUncompressedPair calls is used to also look up variants of the blob which have the same // uncompressed digest. func (noCache) CandidateLocations(transport types.ImageTransport, scope types.BICTransportScope, digest digest.Digest, canSubstitute bool) []types.BICReplacementCandidate { return nil } ================================================ FILE: vendor/go.podman.io/image/v5/pkg/blobinfocache/sqlite/sqlite.go ================================================ // Package boltdb implements a BlobInfoCache backed by SQLite. package sqlite import ( "database/sql" "encoding/json" "errors" "fmt" "sync" "time" _ "github.com/mattn/go-sqlite3" // Registers the "sqlite3" backend backend for database/sql "github.com/opencontainers/go-digest" "github.com/sirupsen/logrus" "go.podman.io/image/v5/internal/blobinfocache" "go.podman.io/image/v5/pkg/blobinfocache/internal/prioritize" "go.podman.io/image/v5/types" ) const ( // NOTE: There is no versioning data inside the file; this is a “cache”, so on an incompatible format upgrade // we can simply start over with a different filename; update blobInfoCacheFilename. // That also means we don’t have to worry about co-existing readers/writers which know different versions of the schema // (which would require compatibility in both directions). // Assembled sqlite options used when opening the database. sqliteOptions = "?" + // Deal with timezone automatically. // go-sqlite3 always _records_ timestamps as a text: time in local time + a time zone offset. // _loc affects how the values are _parsed_: (which timezone is assumed for numeric timestamps or for text which does not specify an offset, or) // if the time zone offset matches the specified time zone, the timestamp is assumed to be in that time zone / location; // (otherwise an unnamed time zone carrying just a hard-coded offset, but no location / DST rules is used). "_loc=auto" + // Force an fsync after each transaction (https://www.sqlite.org/pragma.html#pragma_synchronous). "&_sync=FULL" + // Allow foreign keys (https://www.sqlite.org/pragma.html#pragma_foreign_keys). // We don’t currently use any foreign keys, but this is a good choice long-term (not default in SQLite only for historical reasons). "&_foreign_keys=1" + // Use BEGIN EXCLUSIVE (https://www.sqlite.org/lang_transaction.html); // i.e. obtain a write lock for _all_ transactions at the transaction start (never use a read lock, // never upgrade from a read to a write lock - that can fail if multiple read lock owners try to do that simultaneously). // // This, together with go-sqlite3’s default for _busy_timeout=5000, means that we should never see a “database is locked” error, // the database should block on the exclusive lock when starting a transaction, and the problematic case of two simultaneous // holders of a read lock trying to upgrade to a write lock (and one necessarily failing) is prevented. // Compare https://github.com/mattn/go-sqlite3/issues/274 . // // Ideally the BEGIN / BEGIN EXCLUSIVE decision could be made per-transaction, compare https://github.com/mattn/go-sqlite3/pull/1167 // or https://github.com/mattn/go-sqlite3/issues/400 . // The currently-proposed workaround is to create two different SQL “databases” (= connection pools) with different _txlock settings, // which seems rather wasteful. "&_txlock=exclusive" ) // cache is a BlobInfoCache implementation which uses a SQLite file at the specified path. type cache struct { path string // The database/sql package says “It is rarely necessary to close a DB.”, and steers towards a long-term *sql.DB connection pool. // That’s probably very applicable for database-backed services, where the database is the primary data store. That’s not necessarily // the case for callers of c/image, where image operations might be a small proportion of the total runtime, and the cache is fairly // incidental even to the image operations. It’s also hard for us to use that model, because the public BlobInfoCache object doesn’t have // a Close method, so creating a lot of single-use caches could leak data. // // Instead, the private BlobInfoCache2 interface provides Open/Close methods, and they are called by c/image/copy.Image. // This amortizes the cost of opening/closing the SQLite state over a single image copy, while keeping no long-term resources open. // Some rough benchmarks in https://github.com/containers/image/pull/2092 suggest relative costs on the order of "25" for a single // *sql.DB left open long-term, "27" for a *sql.DB open for a single image copy, and "40" for opening/closing a *sql.DB for every // single transaction; so the Open/Close per image copy seems a reasonable compromise (especially compared to the previous implementation, // somewhere around "700"). lock sync.Mutex // The following fields can only be accessed with lock held. refCount int // number of outstanding Open() calls db *sql.DB // nil if not set (may happen even if refCount > 0 on errors) } // New returns BlobInfoCache implementation which uses a SQLite file at path. // // Most users should call blobinfocache.DefaultCache instead. func New(path string) (types.BlobInfoCache, error) { return new2(path) } func new2(path string) (*cache, error) { db, err := rawOpen(path) if err != nil { return nil, fmt.Errorf("initializing blob info cache at %q: %w", path, err) } err = func() (retErr error) { // A scope for defer defer func() { closeErr := db.Close() if retErr == nil { retErr = closeErr } }() // We don’t check the schema before every operation, because that would be costly // and because we assume schema changes will be handled by using a different path. return ensureDBHasCurrentSchema(db) }() if err != nil { return nil, err } return &cache{ path: path, refCount: 0, db: nil, }, nil } // rawOpen returns a new *sql.DB for path. // The caller should arrange for it to be .Close()d. func rawOpen(path string) (*sql.DB, error) { // This exists to centralize the use of sqliteOptions. return sql.Open("sqlite3", path+sqliteOptions) } // Open() sets up the cache for future accesses, potentially acquiring costly state. Each Open() must be paired with a Close(). // Note that public callers may call the types.BlobInfoCache operations without Open()/Close(). func (sqc *cache) Open() { sqc.lock.Lock() defer sqc.lock.Unlock() if sqc.refCount == 0 { db, err := rawOpen(sqc.path) if err != nil { logrus.Warnf("Error opening (previously-successfully-opened) blob info cache at %q: %v", sqc.path, err) db = nil // But still increase sqc.refCount, because a .Close() will happen } sqc.db = db } sqc.refCount++ } // Close destroys state created by Open(). func (sqc *cache) Close() { sqc.lock.Lock() defer sqc.lock.Unlock() switch sqc.refCount { case 0: logrus.Errorf("internal error using pkg/blobinfocache/sqlite.cache: Close() without a matching Open()") return case 1: if sqc.db != nil { sqc.db.Close() sqc.db = nil } } sqc.refCount-- } type void struct{} // So that we don’t have to write struct{}{} all over the place // transaction calls fn within a read-write transaction in sqc. func transaction[T any](sqc *cache, fn func(tx *sql.Tx) (T, error)) (_ T, retErr error) { db, closeDB, err := func() (*sql.DB, func() error, error) { // A scope for defer sqc.lock.Lock() defer sqc.lock.Unlock() if sqc.db != nil { return sqc.db, func() error { return nil }, nil } db, err := rawOpen(sqc.path) if err != nil { return nil, nil, fmt.Errorf("opening blob info cache at %q: %w", sqc.path, err) } return db, db.Close, nil }() if err != nil { var zeroRes T // A zero value of T return zeroRes, err } defer func() { closeErr := closeDB() if retErr == nil { retErr = closeErr } }() return dbTransaction(db, fn) } // dbTransaction calls fn within a read-write transaction in db. func dbTransaction[T any](db *sql.DB, fn func(tx *sql.Tx) (T, error)) (T, error) { // Ideally we should be able to distinguish between read-only and read-write transactions, see the _txlock=exclusive discussion. var zeroRes T // A zero value of T tx, err := db.Begin() if err != nil { return zeroRes, fmt.Errorf("beginning transaction: %w", err) } succeeded := false defer func() { if !succeeded { if err := tx.Rollback(); err != nil { logrus.Errorf("Rolling back transaction: %v", err) } } }() res, err := fn(tx) if err != nil { return zeroRes, err } if err := tx.Commit(); err != nil { return zeroRes, fmt.Errorf("committing transaction: %w", err) } succeeded = true return res, nil } // querySingleValue executes a SELECT which is expected to return at most one row with a single column. // It returns (value, true, nil) on success, or (value, false, nil) if no row was returned. func querySingleValue[T any](tx *sql.Tx, query string, params ...any) (T, bool, error) { var value T if err := tx.QueryRow(query, params...).Scan(&value); err != nil { var zeroValue T // A zero value of T if errors.Is(err, sql.ErrNoRows) { return zeroValue, false, nil } return zeroValue, false, err } return value, true, nil } // ensureDBHasCurrentSchema adds the necessary tables and indices to a database. // This is typically used when creating a previously-nonexistent database. // We don’t really anticipate schema migrations; with c/image usually vendored, not using // shared libraries, migrating a schema on an existing database would affect old-version users. // Instead, schema changes are likely to be implemented by using a different cache file name, // and leaving existing caches around for old users. func ensureDBHasCurrentSchema(db *sql.DB) error { // Considered schema design alternatives: // // (Overall, considering the overall network latency and disk I/O costs of many-megabyte layer pulls which are happening while referring // to the blob info cache, it seems reasonable to prioritize readability over microoptimization of this database.) // // * This schema uses the text representation of digests. // // We use the fairly wasteful text with hexadecimal digits because digest.Digest does not define a binary representation; // and the way digest.Digest.Hex() is deprecated in favor of digest.Digest.Encoded(), and the way digest.Algorithm // is documented to “define the string encoding” suggests that assuming a hexadecimal representation and turning that // into binary ourselves is not a good idea in general; we would have to special-case the currently-known algorithm // — and that would require us to implement two code paths, one of them basically never exercised / never tested. // // * There are two separate items for recording the uncompressed digest and digest compressors. // Alternatively, we could have a single "digest facts" table with NULLable columns. // // The way the BlobInfoCache API works, we are only going to write one value at a time, so // sharing a table would not be any more efficient for writes (same number of lookups, larger row tuples). // Reads in candidateLocations would not be more efficient either, the searches in DigestCompressors and DigestUncompressedPairs // do not coincide (we want a compressor for every candidate, but the uncompressed digest only for the primary digest; and then // we search in DigestUncompressedPairs by uncompressed digest, not by the primary key). // // Also, using separate items allows the single-item writes to be done using a simple INSERT OR REPLACE, instead of having to // do a more verbose ON CONFLICT(…) DO UPDATE SET … = …. // // * Joins (the two that exist in appendReplacementCandidates) are based on the text representation of digests. // // Using integer primary keys might make the joins themselves a bit more efficient, but then we would need to involve an extra // join to translate from/to the user-provided digests anyway. If anything, that extra join (potentially more btree lookups) // is probably costlier than comparing a few more bytes of data. // // Perhaps more importantly, storing digest texts directly makes the database dumps much easier to read for humans without // having to do extra steps to decode the integers into digest values (either by running sqlite commands with joins, or mentally). // items := []struct{ itemName, command string }{ { "DigestUncompressedPairs", `CREATE TABLE IF NOT EXISTS DigestUncompressedPairs(` + // index implied by PRIMARY KEY `anyDigest TEXT PRIMARY KEY NOT NULL,` + // DigestUncompressedPairs_index_uncompressedDigest `uncompressedDigest TEXT NOT NULL )`, }, { "DigestUncompressedPairs_index_uncompressedDigest", `CREATE INDEX IF NOT EXISTS DigestUncompressedPairs_index_uncompressedDigest ON DigestUncompressedPairs(uncompressedDigest)`, }, { "DigestCompressors", `CREATE TABLE IF NOT EXISTS DigestCompressors(` + // index implied by PRIMARY KEY `digest TEXT PRIMARY KEY NOT NULL,` + // May include blobinfocache.Uncompressed (not blobinfocache.UnknownCompression). `compressor TEXT NOT NULL )`, }, { "KnownLocations", `CREATE TABLE IF NOT EXISTS KnownLocations( transport TEXT NOT NULL, scope TEXT NOT NULL, digest TEXT NOT NULL, location TEXT NOT NULL,` + // TIMESTAMP is parsed by SQLITE as a NUMERIC affinity, but go-sqlite3 stores text in the (Go formatting semantics) // format "2006-01-02 15:04:05.999999999-07:00". // See also the _loc option in the sql.Open data source name. `time TIMESTAMP NOT NULL,` + // Implies an index. // We also search by (transport, scope, digest), that doesn’t need an extra index // because it is a prefix of the implied primary-key index. `PRIMARY KEY (transport, scope, digest, location) )`, }, { "DigestTOCUncompressedPairs", `CREATE TABLE IF NOT EXISTS DigestTOCUncompressedPairs(` + // index implied by PRIMARY KEY `tocDigest TEXT PRIMARY KEY NOT NULL,` + `uncompressedDigest TEXT NOT NULL )`, }, { "DigestSpecificVariantCompressors", // If changing the schema incompatibly, merge this with DigestCompressors. `CREATE TABLE IF NOT EXISTS DigestSpecificVariantCompressors(` + // index implied by PRIMARY KEY `digest TEXT PRIMARY KEY NOT NULL,` + // The compressor is not `UnknownCompression`. `specificVariantCompressor TEXT NOT NULL, specificVariantAnnotations BLOB NOT NULL )`, }, } _, err := dbTransaction(db, func(tx *sql.Tx) (void, error) { // If the the last-created item exists, assume nothing needs to be done. lastItemName := items[len(items)-1].itemName _, found, err := querySingleValue[int](tx, "SELECT 1 FROM sqlite_schema WHERE name=?", lastItemName) if err != nil { return void{}, fmt.Errorf("checking if SQLite schema item %q exists: %w", lastItemName, err) } if !found { // Item does not exist, assuming a fresh database. for _, i := range items { if _, err := tx.Exec(i.command); err != nil { return void{}, fmt.Errorf("creating item %s: %w", i.itemName, err) } } } return void{}, nil }) return err } // uncompressedDigest implements types.BlobInfoCache.UncompressedDigest within a transaction. func (sqc *cache) uncompressedDigest(tx *sql.Tx, anyDigest digest.Digest) (digest.Digest, error) { uncompressedString, found, err := querySingleValue[string](tx, "SELECT uncompressedDigest FROM DigestUncompressedPairs WHERE anyDigest = ?", anyDigest.String()) if err != nil { return "", err } if found { d, err := digest.Parse(uncompressedString) if err != nil { return "", err } return d, nil } // A record as uncompressedDigest implies that anyDigest must already refer to an uncompressed digest. // This way we don't have to waste storage space with trivial (uncompressed, uncompressed) mappings // when we already record a (compressed, uncompressed) pair. _, found, err = querySingleValue[int](tx, "SELECT 1 FROM DigestUncompressedPairs WHERE uncompressedDigest = ?", anyDigest.String()) if err != nil { return "", err } if found { return anyDigest, nil } return "", nil } // UncompressedDigest returns an uncompressed digest corresponding to anyDigest. // May return anyDigest if it is known to be uncompressed. // Returns "" if nothing is known about the digest (it may be compressed or uncompressed). func (sqc *cache) UncompressedDigest(anyDigest digest.Digest) digest.Digest { res, err := transaction(sqc, func(tx *sql.Tx) (digest.Digest, error) { return sqc.uncompressedDigest(tx, anyDigest) }) if err != nil { return "" // FIXME? Log err (but throttle the log volume on repeated accesses)? } return res } // RecordDigestUncompressedPair records that the uncompressed version of anyDigest is uncompressed. // It’s allowed for anyDigest == uncompressed. // WARNING: Only call this for LOCALLY VERIFIED data; don’t record a digest pair just because some remote author claims so (e.g. // because a manifest/config pair exists); otherwise the cache could be poisoned and allow substituting unexpected blobs. // (Eventually, the DiffIDs in image config could detect the substitution, but that may be too late, and not all image formats contain that data.) func (sqc *cache) RecordDigestUncompressedPair(anyDigest digest.Digest, uncompressed digest.Digest) { _, _ = transaction(sqc, func(tx *sql.Tx) (void, error) { previousString, gotPrevious, err := querySingleValue[string](tx, "SELECT uncompressedDigest FROM DigestUncompressedPairs WHERE anyDigest = ?", anyDigest.String()) if err != nil { return void{}, fmt.Errorf("looking for uncompressed digest for %q", anyDigest) } if gotPrevious { previous, err := digest.Parse(previousString) if err != nil { return void{}, err } if previous != uncompressed { logrus.Warnf("Uncompressed digest for blob %s previously recorded as %s, now %s", anyDigest, previous, uncompressed) } } if _, err := tx.Exec("INSERT OR REPLACE INTO DigestUncompressedPairs(anyDigest, uncompressedDigest) VALUES (?, ?)", anyDigest.String(), uncompressed.String()); err != nil { return void{}, fmt.Errorf("recording uncompressed digest %q for %q: %w", uncompressed, anyDigest, err) } return void{}, nil }) // FIXME? Log error (but throttle the log volume on repeated accesses)? } // UncompressedDigestForTOC returns an uncompressed digest corresponding to anyDigest. // Returns "" if the uncompressed digest is unknown. func (sqc *cache) UncompressedDigestForTOC(tocDigest digest.Digest) digest.Digest { res, err := transaction(sqc, func(tx *sql.Tx) (digest.Digest, error) { uncompressedString, found, err := querySingleValue[string](tx, "SELECT uncompressedDigest FROM DigestTOCUncompressedPairs WHERE tocDigest = ?", tocDigest.String()) if err != nil { return "", err } if found { d, err := digest.Parse(uncompressedString) if err != nil { return "", err } return d, nil } return "", nil }) if err != nil { return "" // FIXME? Log err (but throttle the log volume on repeated accesses)? } return res } // RecordTOCUncompressedPair records that the tocDigest corresponds to uncompressed. // WARNING: Only call this for LOCALLY VERIFIED data; don’t record a digest pair just because some remote author claims so (e.g. // because a manifest/config pair exists); otherwise the cache could be poisoned and allow substituting unexpected blobs. // (Eventually, the DiffIDs in image config could detect the substitution, but that may be too late, and not all image formats contain that data.) func (sqc *cache) RecordTOCUncompressedPair(tocDigest digest.Digest, uncompressed digest.Digest) { _, _ = transaction(sqc, func(tx *sql.Tx) (void, error) { previousString, gotPrevious, err := querySingleValue[string](tx, "SELECT uncompressedDigest FROM DigestTOCUncompressedPairs WHERE tocDigest = ?", tocDigest.String()) if err != nil { return void{}, fmt.Errorf("looking for uncompressed digest for blob with TOC %q", tocDigest) } if gotPrevious { previous, err := digest.Parse(previousString) if err != nil { return void{}, err } if previous != uncompressed { logrus.Warnf("Uncompressed digest for blob with TOC %q previously recorded as %q, now %q", tocDigest, previous, uncompressed) } } if _, err := tx.Exec("INSERT OR REPLACE INTO DigestTOCUncompressedPairs(tocDigest, uncompressedDigest) VALUES (?, ?)", tocDigest.String(), uncompressed.String()); err != nil { return void{}, fmt.Errorf("recording uncompressed digest %q for blob with TOC %q: %w", uncompressed, tocDigest, err) } return void{}, nil }) // FIXME? Log error (but throttle the log volume on repeated accesses)? } // RecordKnownLocation records that a blob with the specified digest exists within the specified (transport, scope) scope, // and can be reused given the opaque location data. func (sqc *cache) RecordKnownLocation(transport types.ImageTransport, scope types.BICTransportScope, digest digest.Digest, location types.BICLocationReference) { _, _ = transaction(sqc, func(tx *sql.Tx) (void, error) { if _, err := tx.Exec("INSERT OR REPLACE INTO KnownLocations(transport, scope, digest, location, time) VALUES (?, ?, ?, ?, ?)", transport.Name(), scope.Opaque, digest.String(), location.Opaque, time.Now()); err != nil { // Possibly overwriting an older entry. return void{}, fmt.Errorf("recording known location %q for (%q, %q, %q): %w", location.Opaque, transport.Name(), scope.Opaque, digest.String(), err) } return void{}, nil }) // FIXME? Log error (but throttle the log volume on repeated accesses)? } // RecordDigestCompressorData records data for the blob with the specified digest. // WARNING: Only call this with LOCALLY VERIFIED data: // - don’t record a compressor for a digest just because some remote author claims so // (e.g. because a manifest says so); // - don’t record the non-base variant or annotations if we are not _sure_ that the base variant // and the blob’s digest match the non-base variant’s annotations (e.g. because we saw them // in a manifest) // // otherwise the cache could be poisoned and cause us to make incorrect edits to type // information in a manifest. func (sqc *cache) RecordDigestCompressorData(anyDigest digest.Digest, data blobinfocache.DigestCompressorData) { _, _ = transaction(sqc, func(tx *sql.Tx) (void, error) { previous, gotPrevious, err := querySingleValue[string](tx, "SELECT compressor FROM DigestCompressors WHERE digest = ?", anyDigest.String()) if err != nil { return void{}, fmt.Errorf("looking for compressor of %q", anyDigest) } warned := false if gotPrevious && previous != data.BaseVariantCompressor { logrus.Warnf("Compressor for blob with digest %s previously recorded as %s, now %s", anyDigest, previous, data.BaseVariantCompressor) warned = true } if data.BaseVariantCompressor == blobinfocache.UnknownCompression { if _, err := tx.Exec("DELETE FROM DigestCompressors WHERE digest = ?", anyDigest.String()); err != nil { return void{}, fmt.Errorf("deleting compressor for digest %q: %w", anyDigest, err) } if _, err := tx.Exec("DELETE FROM DigestSpecificVariantCompressors WHERE digest = ?", anyDigest.String()); err != nil { return void{}, fmt.Errorf("deleting specific variant compressor for digest %q: %w", anyDigest, err) } } else { if _, err := tx.Exec("INSERT OR REPLACE INTO DigestCompressors(digest, compressor) VALUES (?, ?)", anyDigest.String(), data.BaseVariantCompressor); err != nil { return void{}, fmt.Errorf("recording compressor %q for %q: %w", data.BaseVariantCompressor, anyDigest, err) } } if data.SpecificVariantCompressor != blobinfocache.UnknownCompression { if !warned { // Don’t warn twice about the same digest prevSVC, found, err := querySingleValue[string](tx, "SELECT specificVariantCompressor FROM DigestSpecificVariantCompressors WHERE digest = ?", anyDigest.String()) if err != nil { return void{}, fmt.Errorf("looking for specific variant compressor of %q", anyDigest) } if found && data.SpecificVariantCompressor != prevSVC { logrus.Warnf("Specific compressor for blob with digest %s previously recorded as %s, now %s", anyDigest, prevSVC, data.SpecificVariantCompressor) } } annotations, err := json.Marshal(data.SpecificVariantAnnotations) if err != nil { return void{}, err } if _, err := tx.Exec("INSERT OR REPLACE INTO DigestSpecificVariantCompressors(digest, specificVariantCompressor, specificVariantAnnotations) VALUES (?, ?, ?)", anyDigest.String(), data.SpecificVariantCompressor, annotations); err != nil { return void{}, fmt.Errorf("recording specific variant compressor %q/%q for %q: %w", data.SpecificVariantCompressor, annotations, anyDigest, err) } } return void{}, nil }) // FIXME? Log error (but throttle the log volume on repeated accesses)? } // appendReplacementCandidates creates prioritize.CandidateWithTime values for (transport, scope, digest), // and returns the result of appending them to candidates. // v2Options is not nil if the caller is CandidateLocations2: this allows including candidates with unknown location, and filters out candidates // with unknown compression. func (sqc *cache) appendReplacementCandidates(candidates []prioritize.CandidateWithTime, tx *sql.Tx, transport types.ImageTransport, scope types.BICTransportScope, digest digest.Digest, v2Options *blobinfocache.CandidateLocations2Options, ) ([]prioritize.CandidateWithTime, error) { compressionData := blobinfocache.DigestCompressorData{ BaseVariantCompressor: blobinfocache.UnknownCompression, SpecificVariantCompressor: blobinfocache.UnknownCompression, SpecificVariantAnnotations: nil, } if v2Options != nil { var baseVariantCompressor string var specificVariantCompressor sql.NullString var annotationBytes []byte switch err := tx.QueryRow("SELECT compressor, specificVariantCompressor, specificVariantAnnotations "+ "FROM DigestCompressors LEFT JOIN DigestSpecificVariantCompressors USING (digest) WHERE digest = ?", digest.String()). Scan(&baseVariantCompressor, &specificVariantCompressor, &annotationBytes); { case errors.Is(err, sql.ErrNoRows): // Do nothing case err != nil: return nil, fmt.Errorf("scanning compressor data: %w", err) default: compressionData.BaseVariantCompressor = baseVariantCompressor if specificVariantCompressor.Valid && annotationBytes != nil { compressionData.SpecificVariantCompressor = specificVariantCompressor.String if err := json.Unmarshal(annotationBytes, &compressionData.SpecificVariantAnnotations); err != nil { return nil, err } } } } template := prioritize.CandidateTemplateWithCompression(v2Options, digest, compressionData) if template == nil { return candidates, nil } rows, err := tx.Query("SELECT location, time FROM KnownLocations "+ "WHERE transport = ? AND scope = ? AND KnownLocations.digest = ?", transport.Name(), scope.Opaque, digest.String()) if err != nil { return nil, fmt.Errorf("looking up candidate locations: %w", err) } defer rows.Close() rowAdded := false for rows.Next() { var location string var time time.Time if err := rows.Scan(&location, &time); err != nil { return nil, fmt.Errorf("scanning candidate: %w", err) } candidates = append(candidates, template.CandidateWithLocation(types.BICLocationReference{Opaque: location}, time)) rowAdded = true } if err := rows.Err(); err != nil { return nil, fmt.Errorf("iterating through locations: %w", err) } if !rowAdded && v2Options != nil { candidates = append(candidates, template.CandidateWithUnknownLocation()) } return candidates, nil } // CandidateLocations2 returns a prioritized, limited, number of blobs and their locations (if known) // that could possibly be reused within the specified (transport scope) (if they still // exist, which is not guaranteed). func (sqc *cache) CandidateLocations2(transport types.ImageTransport, scope types.BICTransportScope, digest digest.Digest, options blobinfocache.CandidateLocations2Options) []blobinfocache.BICReplacementCandidate2 { return sqc.candidateLocations(transport, scope, digest, options.CanSubstitute, &options) } // candidateLocations implements CandidateLocations / CandidateLocations2. // v2Options is not nil if the caller is CandidateLocations2. func (sqc *cache) candidateLocations(transport types.ImageTransport, scope types.BICTransportScope, primaryDigest digest.Digest, canSubstitute bool, v2Options *blobinfocache.CandidateLocations2Options, ) []blobinfocache.BICReplacementCandidate2 { var uncompressedDigest digest.Digest // = "" res, err := transaction(sqc, func(tx *sql.Tx) ([]prioritize.CandidateWithTime, error) { res := []prioritize.CandidateWithTime{} res, err := sqc.appendReplacementCandidates(res, tx, transport, scope, primaryDigest, v2Options) if err != nil { return nil, err } if canSubstitute { uncompressedDigest, err = sqc.uncompressedDigest(tx, primaryDigest) if err != nil { return nil, err } if uncompressedDigest != "" { // FIXME? We could integrate this with appendReplacementCandidates into a single join instead of N+1 queries. // (In the extreme, we could turn _everything_ this function does into a single query. // And going even further, even DestructivelyPrioritizeReplacementCandidates could be turned into SQL.) // For now, we prioritize simplicity, and sharing both code and implementation structure with the other cache implementations. rows, err := tx.Query("SELECT anyDigest FROM DigestUncompressedPairs WHERE uncompressedDigest = ?", uncompressedDigest.String()) if err != nil { return nil, fmt.Errorf("querying for other digests: %w", err) } defer rows.Close() for rows.Next() { var otherDigestString string if err := rows.Scan(&otherDigestString); err != nil { return nil, fmt.Errorf("scanning other digest: %w", err) } otherDigest, err := digest.Parse(otherDigestString) if err != nil { return nil, err } if otherDigest != primaryDigest && otherDigest != uncompressedDigest { res, err = sqc.appendReplacementCandidates(res, tx, transport, scope, otherDigest, v2Options) if err != nil { return nil, err } } } if err := rows.Err(); err != nil { return nil, fmt.Errorf("iterating through other digests: %w", err) } if uncompressedDigest != primaryDigest { res, err = sqc.appendReplacementCandidates(res, tx, transport, scope, uncompressedDigest, v2Options) if err != nil { return nil, err } } } } return res, nil }) if err != nil { return []blobinfocache.BICReplacementCandidate2{} // FIXME? Log err (but throttle the log volume on repeated accesses)? } return prioritize.DestructivelyPrioritizeReplacementCandidates(res, primaryDigest, uncompressedDigest) } // CandidateLocations returns a prioritized, limited, number of blobs and their locations that could possibly be reused // within the specified (transport scope) (if they still exist, which is not guaranteed). // // If !canSubstitute, the returned candidates will match the submitted digest exactly; if canSubstitute, // data from previous RecordDigestUncompressedPair calls is used to also look up variants of the blob which have the same // uncompressed digest. func (sqc *cache) CandidateLocations(transport types.ImageTransport, scope types.BICTransportScope, digest digest.Digest, canSubstitute bool) []types.BICReplacementCandidate { return blobinfocache.CandidateLocationsFromV2(sqc.candidateLocations(transport, scope, digest, canSubstitute, nil)) } ================================================ FILE: vendor/go.podman.io/image/v5/pkg/cli/basetls/basetls.go ================================================ // Package basetls encapsulates a set of base TLS settings (not keys/certificates) // configured via containers-tls-details.yaml(5). // // CLI integration should generally be done using c/image/pkg/cli/basetls/tlsdetails instead // of using the TLSDetailsFile directly. package basetls import ( "bytes" "crypto/tls" "encoding/json" "errors" "fmt" "slices" ) // Config encapsulates user’s choices about base TLS settings, typically // configured via containers-tls-details.yaml(5). // // Most codebases should pass around the resulting *tls.Config, without depending on this subpackage; // this primarily exists as a separate type to allow passing the configuration around within (version-matched) RPC systems, // using the MarshalText/UnmarshalText methods. type Config struct { // We keep the text representation because we start with it, and this way we don't have // to implement formatting back to text. This is an internal detail, so we can change that later. text TLSDetailsFile config *tls.Config // Parsed from .text, both match } // TLSDetailsFile contains a set of TLS options. // // To consume such a file, most callers should use c/image/pkg/cli/basetls/tlsdetails instead // of dealing with this type explicitly. // // This type is exported primarily to allow creating parameter files programmatically // (and eventually the tlsdetails subpackage should provide an API to convert this type into // the appropriate file contents, so that callers don't need to do that manually). type TLSDetailsFile struct { // Keep this in sync with docs/containers-tls-details.yaml.5.md ! MinVersion string `yaml:"minVersion,omitempty"` // If set, minimum version to use throughout the program. CipherSuites []string `yaml:"cipherSuites,omitempty"` // If set, allowed TLS cipher suites to use throughout the program. NamedGroups []string `yaml:"namedGroups,omitempty"` // If set, allowed TLS named groups to use throughout the program. } // NewFromTLSDetails creates a Config from a TLSDetailsFile. func NewFromTLSDetails(details *TLSDetailsFile) (*Config, error) { res := Config{ text: TLSDetailsFile{}, config: &tls.Config{}, } configChanged := false for _, fn := range []func(input *TLSDetailsFile) (bool, error){ res.parseMinVersion, res.parseCipherSuites, res.parseNamedGroups, } { changed, err := fn(details) if err != nil { return nil, err } if changed { configChanged = true } } if !configChanged { res.config = nil } return &res, nil } // tlsVersions maps TLS version strings to their crypto/tls constants. // We could use the `tls.VersionName` names, but those are verbose and contain spaces; // similarly the OpenShift enum values (“VersionTLS11”) are unergonomic. var tlsVersions = map[string]uint16{ "1.0": tls.VersionTLS10, "1.1": tls.VersionTLS11, "1.2": tls.VersionTLS12, "1.3": tls.VersionTLS13, } func (c *Config) parseMinVersion(input *TLSDetailsFile) (bool, error) { if input.MinVersion == "" { return false, nil } v, ok := tlsVersions[input.MinVersion] if !ok { return false, fmt.Errorf("unrecognized TLS minimum version %q", input.MinVersion) } c.text.MinVersion = input.MinVersion c.config.MinVersion = v return true, nil } // cipherSuitesByName returns a map from cipher suite name to its ID. func cipherSuitesByName() map[string]uint16 { // The Go standard library uses IANA names and already contains the mapping (for relevant values) // sadly we still need to turn it into a lookup map. suites := make(map[string]uint16) for _, cs := range tls.CipherSuites() { suites[cs.Name] = cs.ID } for _, cs := range tls.InsecureCipherSuites() { suites[cs.Name] = cs.ID } return suites } func (c *Config) parseCipherSuites(input *TLSDetailsFile) (bool, error) { if input.CipherSuites == nil { return false, nil } suitesByName := cipherSuitesByName() ids := []uint16{} for _, name := range input.CipherSuites { id, ok := suitesByName[name] if !ok { return false, fmt.Errorf("unrecognized TLS cipher suite %q", name) } ids = append(ids, id) } c.text.CipherSuites = slices.Clone(input.CipherSuites) c.config.CipherSuites = ids return true, nil } // groupsByName maps curve/group names to their tls.CurveID. // The names match IANA TLS Supported Groups registry. // // Yes, the x25519 names differ in capitalization. // Go’s tls.CurveID has a .String() method, but it // uses the Go names. var groupsByName = map[string]tls.CurveID{ "secp256r1": tls.CurveP256, "secp384r1": tls.CurveP384, "secp521r1": tls.CurveP521, "x25519": tls.X25519, "X25519MLKEM768": tls.X25519MLKEM768, } func (c *Config) parseNamedGroups(input *TLSDetailsFile) (bool, error) { if input.NamedGroups == nil { return false, nil } ids := []tls.CurveID{} for _, name := range input.NamedGroups { id, ok := groupsByName[name] if !ok { return false, fmt.Errorf("unrecognized TLS named group %q", name) } ids = append(ids, id) } c.text.NamedGroups = slices.Clone(input.NamedGroups) c.config.CurvePreferences = ids return true, nil } // TLSConfig returns a *tls.Config matching the provided settings. // If c contains no settings, it returns nil. // Otherwise, the returned *tls.Config is freshly allocated and the caller can modify it as needed. func (c *Config) TLSConfig() *tls.Config { if c.config == nil { return nil } return c.config.Clone() } // marshaledSerialization is the data we use in MarshalText/UnmarshalText, // marshaled using JSON. // // Note that the file format is using YAML, but we use JSON, to minimize dependencies // in backend code where we don't need comments and the brackets are not annoying users. type marshaledSerialization struct { Version int Data TLSDetailsFile } const marshaledSerializationVersion1 = 1 // MarshalText serializes c to a text representation. // // The representation is intended to be reasonably stable across updates to c/image, // but the consumer must not be older than the producer. func (c Config) MarshalText() ([]byte, error) { data := marshaledSerialization{ Version: marshaledSerializationVersion1, Data: c.text, } return json.Marshal(data) } // UnmarshalText parses the output of MarshalText. // // The format is otherwise undocumented and we do not promise ongoing compatibility with producers external to this package. func (c *Config) UnmarshalText(text []byte) error { var data marshaledSerialization // In the future, this should be an even stricter parser, e.g. refusing duplicate fields // and requiring a case-sensitive field name match. decoder := json.NewDecoder(bytes.NewReader(text)) decoder.DisallowUnknownFields() if err := decoder.Decode(&data); err != nil { return err } if decoder.More() { return errors.New("unexpected extra data after a JSON object") } if data.Version != marshaledSerializationVersion1 { return fmt.Errorf("unsupported version %d", data.Version) } v, err := NewFromTLSDetails(&data.Data) if err != nil { return err } *c = *v return nil } ================================================ FILE: vendor/go.podman.io/image/v5/pkg/cli/basetls/tlsdetails/tlsdetails.go ================================================ // Package tlsdetails implements the containers-tls-details.yaml(5) file format. // // Recommended CLI integration is by a --tls-details flag parsed using BaseTLSFromOptionalFile, with the following documentation: // // --tls-details is a path to a containers-tls-details.yaml(5) file, affecting TLS behavior throughout the program. // // If not set, defaults to a reasonable default that may change over time (depending on system’s global policy, // version of the program, version of the Go language, and the like). // // Users should generally not use this option unless they have a process to ensure that the configuration will be kept up to date. package tlsdetails import ( "bytes" "fmt" "os" "go.podman.io/image/v5/pkg/cli/basetls" "gopkg.in/yaml.v3" ) // BaseTLSFromOptionalFile returns a basetls.Config matching a containers-tls-details.yaml file at the specified path. // If path is "", it returns a valid basetls.Config with no settings (where config.TLSConfig() will return nil). func BaseTLSFromOptionalFile(path string) (*basetls.Config, error) { if path == "" { return basetls.NewFromTLSDetails(&basetls.TLSDetailsFile{}) } return BaseTLSFromFile(path) } // BaseTLSFromFile returns a basetls.Config matching a containers-tls-details.yaml file at the specified path. func BaseTLSFromFile(path string) (*basetls.Config, error) { details, err := ParseFile(path) if err != nil { return nil, err } res, err := basetls.NewFromTLSDetails(details) if err != nil { return nil, fmt.Errorf("parsing TLS details %q: %w", path, err) } return res, nil } // ParseFile parses a basetls.TLSDetailsFile at the specified path. // // Most consumers of the parameter file should use BaseTLSFromFile or BaseTLSFromOptionalFile instead. func ParseFile(path string) (*basetls.TLSDetailsFile, error) { var res basetls.TLSDetailsFile source, err := os.ReadFile(path) if err != nil { return nil, fmt.Errorf("reading %q: %w", path, err) } dec := yaml.NewDecoder(bytes.NewReader(source)) dec.KnownFields(true) if err = dec.Decode(&res); err != nil { return nil, fmt.Errorf("parsing %q: %w", path, err) } return &res, nil } ================================================ FILE: vendor/go.podman.io/image/v5/pkg/cli/passphrase.go ================================================ package cli import ( "bufio" "errors" "fmt" "io" "os" "strings" "github.com/sirupsen/logrus" ) // ReadPassphraseFile returns the first line of the specified path. // For convenience, an empty string is returned if the path is empty. func ReadPassphraseFile(path string) (string, error) { if path == "" { return "", nil } logrus.Debugf("Reading user-specified passphrase for signing from %s", path) ppf, err := os.Open(path) if err != nil { return "", err } defer ppf.Close() // Read the *first* line in the passphrase file, just as gpg(1) does. buf, err := bufio.NewReader(ppf).ReadBytes('\n') if err != nil && !errors.Is(err, io.EOF) { return "", fmt.Errorf("reading passphrase file: %w", err) } return strings.TrimSuffix(string(buf), "\n"), nil } ================================================ FILE: vendor/go.podman.io/image/v5/pkg/cli/sigstore/params/sigstore.go ================================================ package params import ( "bytes" "fmt" "os" "gopkg.in/yaml.v3" ) // SigningParameterFile collects parameters used for creating sigstore signatures. // // To consume such a file, most callers should use c/image/pkg/cli/sigstore instead // of dealing with this type explicitly using ParseFile. // // This type is exported primarily to allow creating parameter files programmatically // (and eventually this subpackage should provide an API to convert this type into // the appropriate file contents, so that callers don’t need to do that manually). type SigningParameterFile struct { // Keep this in sync with docs/containers-sigstore-signing-params.yaml.5.md ! PrivateKeyFile string `yaml:"privateKeyFile,omitempty"` // If set, sign using a private key stored in this file. PrivateKeyPassphraseFile string `yaml:"privateKeyPassphraseFile,omitempty"` // A file that contains the passprase required for PrivateKeyFile. Fulcio *SigningParameterFileFulcio `yaml:"fulcio,omitempty"` // If set, sign using a short-lived key and a Fulcio-issued certificate. RekorURL string `yaml:"rekorURL,omitempty"` // If set, upload the signature to the specified Rekor server, and include a log inclusion proof in the signature. } // SigningParameterFileFulcio is a subset of SigningParameterFile dedicated to Fulcio parameters. type SigningParameterFileFulcio struct { // Keep this in sync with docs/containers-sigstore-signing-params.yaml.5.md ! FulcioURL string `yaml:"fulcioURL,omitempty"` // URL of the Fulcio server. Required. // How to obtain the OIDC ID token required by Fulcio. Required. OIDCMode OIDCMode `yaml:"oidcMode,omitempty"` // oidcMode = staticToken OIDCIDToken string `yaml:"oidcIDToken,omitempty"` // oidcMode = deviceGrant || interactive OIDCIssuerURL string `yaml:"oidcIssuerURL,omitempty"` // OIDCClientID string `yaml:"oidcClientID,omitempty"` OIDCClientSecret string `yaml:"oidcClientSecret,omitempty"` } type OIDCMode string const ( // OIDCModeStaticToken means the parameter file contains an user-provided OIDC ID token value. OIDCModeStaticToken OIDCMode = "staticToken" // OIDCModeDeviceGrant specifies the OIDC ID token should be obtained using a device authorization grant (RFC 8628). OIDCModeDeviceGrant OIDCMode = "deviceGrant" // OIDCModeInteractive specifies the OIDC ID token should be obtained interactively (automatically opening a browser, // or interactively prompting the user.) OIDCModeInteractive OIDCMode = "interactive" ) // ParseFile parses a SigningParameterFile at the specified path. // // Most consumers of the parameter file should use c/image/pkg/cli/sigstore to obtain a *signer.Signer instead. func ParseFile(path string) (*SigningParameterFile, error) { var res SigningParameterFile source, err := os.ReadFile(path) if err != nil { return nil, fmt.Errorf("reading %q: %w", path, err) } dec := yaml.NewDecoder(bytes.NewReader(source)) dec.KnownFields(true) if err = dec.Decode(&res); err != nil { return nil, fmt.Errorf("parsing %q: %w", path, err) } return &res, nil } ================================================ FILE: vendor/go.podman.io/image/v5/pkg/cli/sigstore/sigstore.go ================================================ package sigstore import ( "errors" "fmt" "io" "net/url" "go.podman.io/image/v5/pkg/cli" "go.podman.io/image/v5/pkg/cli/sigstore/params" "go.podman.io/image/v5/signature/signer" "go.podman.io/image/v5/signature/sigstore" "go.podman.io/image/v5/signature/sigstore/fulcio" "go.podman.io/image/v5/signature/sigstore/rekor" ) // Options collects data that the caller should provide to NewSignerFromParameterFile. // The caller should set all fields unless documented otherwise. type Options struct { PrivateKeyPassphrasePrompt func(keyFile string) (string, error) // A function to call to interactively prompt for a passphrase Stdin io.Reader Stdout io.Writer } // NewSignerFromParameterFile returns a signature.Signer which creates sigstore signatures based a parameter file at the specified path. // // The caller must call Close() on the returned Signer. func NewSignerFromParameterFile(path string, options *Options) (*signer.Signer, error) { params, err := params.ParseFile(path) if err != nil { return nil, fmt.Errorf("setting up signing using parameter file %q: %w", path, err) } return newSignerFromParameterData(params, options) } // newSignerFromParameterData returns a signature.Signer which creates sigstore signatures based on parameter file contents. // // The caller must call Close() on the returned Signer. func newSignerFromParameterData(params *params.SigningParameterFile, options *Options) (*signer.Signer, error) { opts := []sigstore.Option{} if params.PrivateKeyFile != "" { var getPassphrase func(keyFile string) (string, error) switch { case params.PrivateKeyPassphraseFile != "": getPassphrase = func(_ string) (string, error) { return cli.ReadPassphraseFile(params.PrivateKeyPassphraseFile) } case options.PrivateKeyPassphrasePrompt != nil: getPassphrase = options.PrivateKeyPassphrasePrompt default: // This shouldn’t happen, the caller is expected to set options.PrivateKeyPassphrasePrompt return nil, fmt.Errorf("private key %s specified, but no way to get a passphrase", params.PrivateKeyFile) } passphrase, err := getPassphrase(params.PrivateKeyFile) if err != nil { return nil, err } opts = append(opts, sigstore.WithPrivateKeyFile(params.PrivateKeyFile, []byte(passphrase))) } if params.Fulcio != nil { fulcioOpt, err := fulcioOption(params.Fulcio, options) if err != nil { return nil, err } opts = append(opts, fulcioOpt) } if params.RekorURL != "" { rekorURL, err := url.Parse(params.RekorURL) if err != nil { return nil, fmt.Errorf("parsing rekorURL %q: %w", params.RekorURL, err) } opts = append(opts, rekor.WithRekor(rekorURL)) } return sigstore.NewSigner(opts...) } // fulcioOption returns a sigstore.Option for Fulcio use based on f. func fulcioOption(f *params.SigningParameterFileFulcio, options *Options) (sigstore.Option, error) { if f.FulcioURL == "" { return nil, errors.New("missing fulcioURL") } fulcioURL, err := url.Parse(f.FulcioURL) if err != nil { return nil, fmt.Errorf("parsing fulcioURL %q: %w", f.FulcioURL, err) } if f.OIDCMode == params.OIDCModeStaticToken { if f.OIDCIDToken == "" { return nil, errors.New("missing oidcToken") } return fulcio.WithFulcioAndPreexistingOIDCIDToken(fulcioURL, f.OIDCIDToken), nil } if f.OIDCIssuerURL == "" { return nil, errors.New("missing oidcIssuerURL") } oidcIssuerURL, err := url.Parse(f.OIDCIssuerURL) if err != nil { return nil, fmt.Errorf("parsing oidcIssuerURL %q: %w", f.OIDCIssuerURL, err) } switch f.OIDCMode { case params.OIDCModeDeviceGrant: return fulcio.WithFulcioAndDeviceAuthorizationGrantOIDC(fulcioURL, oidcIssuerURL, f.OIDCClientID, f.OIDCClientSecret, options.Stdout), nil case params.OIDCModeInteractive: return fulcio.WithFulcioAndInteractiveOIDC(fulcioURL, oidcIssuerURL, f.OIDCClientID, f.OIDCClientSecret, options.Stdin, options.Stdout), nil case "": return nil, errors.New("missing oidcMode") case params.OIDCModeStaticToken: return nil, errors.New("internal inconsistency: SigningParameterFileOIDCModeStaticToken was supposed to already be handled") default: return nil, fmt.Errorf("unknown oidcMode value %q", f.OIDCMode) } } ================================================ FILE: vendor/go.podman.io/image/v5/pkg/compression/compression.go ================================================ package compression import ( "bytes" "compress/bzip2" "fmt" "io" "github.com/klauspost/pgzip" "github.com/sirupsen/logrus" "github.com/ulikunitz/xz" "go.podman.io/image/v5/pkg/compression/internal" "go.podman.io/image/v5/pkg/compression/types" "go.podman.io/storage/pkg/chunked/compressor" ) // Algorithm is a compression algorithm that can be used for CompressStream. type Algorithm = types.Algorithm var ( // Gzip compression. Gzip = internal.NewAlgorithm(types.GzipAlgorithmName, "", []byte{0x1F, 0x8B, 0x08}, GzipDecompressor, gzipCompressor) // Bzip2 compression. Bzip2 = internal.NewAlgorithm(types.Bzip2AlgorithmName, "", []byte{0x42, 0x5A, 0x68}, Bzip2Decompressor, bzip2Compressor) // Xz compression. Xz = internal.NewAlgorithm(types.XzAlgorithmName, "", []byte{0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00}, XzDecompressor, xzCompressor) // Zstd compression. Zstd = internal.NewAlgorithm(types.ZstdAlgorithmName, "", []byte{0x28, 0xb5, 0x2f, 0xfd}, ZstdDecompressor, zstdCompressor) // ZstdChunked is a Zstd compression with chunk metadata which allows random access to individual files. ZstdChunked = internal.NewAlgorithm(types.ZstdChunkedAlgorithmName, types.ZstdAlgorithmName, nil, ZstdDecompressor, compressor.ZstdCompressor) compressionAlgorithms = map[string]Algorithm{ Gzip.Name(): Gzip, Bzip2.Name(): Bzip2, Xz.Name(): Xz, Zstd.Name(): Zstd, ZstdChunked.Name(): ZstdChunked, } ) // AlgorithmByName returns the compressor by its name func AlgorithmByName(name string) (Algorithm, error) { algorithm, ok := compressionAlgorithms[name] if ok { return algorithm, nil } return Algorithm{}, fmt.Errorf("cannot find compressor for %q", name) } // DecompressorFunc returns the decompressed stream, given a compressed stream. // The caller must call Close() on the decompressed stream (even if the compressed input stream does not need closing!). type DecompressorFunc = internal.DecompressorFunc // GzipDecompressor is a DecompressorFunc for the gzip compression algorithm. func GzipDecompressor(r io.Reader) (io.ReadCloser, error) { return pgzip.NewReader(r) } // Bzip2Decompressor is a DecompressorFunc for the bzip2 compression algorithm. func Bzip2Decompressor(r io.Reader) (io.ReadCloser, error) { return io.NopCloser(bzip2.NewReader(r)), nil } // XzDecompressor is a DecompressorFunc for the xz compression algorithm. func XzDecompressor(r io.Reader) (io.ReadCloser, error) { r, err := xz.NewReader(r) if err != nil { return nil, err } return io.NopCloser(r), nil } // gzipCompressor is a CompressorFunc for the gzip compression algorithm. func gzipCompressor(r io.Writer, metadata map[string]string, level *int) (io.WriteCloser, error) { if level != nil { return pgzip.NewWriterLevel(r, *level) } return pgzip.NewWriter(r), nil } // bzip2Compressor is a CompressorFunc for the bzip2 compression algorithm. func bzip2Compressor(r io.Writer, metadata map[string]string, level *int) (io.WriteCloser, error) { return nil, fmt.Errorf("bzip2 compression not supported") } // xzCompressor is a CompressorFunc for the xz compression algorithm. func xzCompressor(r io.Writer, metadata map[string]string, level *int) (io.WriteCloser, error) { return xz.NewWriter(r) } // CompressStream returns the compressor by its name func CompressStream(dest io.Writer, algo Algorithm, level *int) (io.WriteCloser, error) { m := map[string]string{} return internal.AlgorithmCompressor(algo)(dest, m, level) } // CompressStreamWithMetadata returns the compressor by its name. // // Compressing a stream may create integrity data that allows consuming the compressed byte stream // while only using subsets of the compressed data (if the compressed data is seekable and most // of the uncompressed data is already present via other means), while still protecting integrity // of the compressed stream against unwanted modification. (In OCI container images, this metadata // is usually carried in manifest annotations.) // // Such a partial decompression is not implemented by this package; it is consumed e.g. by // github.com/containers/storage/pkg/chunked . // // If the compression generates such metadata, it is written to the provided metadata map. func CompressStreamWithMetadata(dest io.Writer, metadata map[string]string, algo Algorithm, level *int) (io.WriteCloser, error) { return internal.AlgorithmCompressor(algo)(dest, metadata, level) } // DetectCompressionFormat returns an Algorithm and DecompressorFunc if the input is recognized as a compressed format, an invalid // value and nil otherwise. // Because it consumes the start of input, other consumers must use the returned io.Reader instead to also read from the beginning. func DetectCompressionFormat(input io.Reader) (Algorithm, DecompressorFunc, io.Reader, error) { buffer := [8]byte{} n, err := io.ReadAtLeast(input, buffer[:], len(buffer)) if err != nil && err != io.EOF && err != io.ErrUnexpectedEOF { // This is a “real” error. We could just ignore it this time, process the data we have, and hope that the source will report the same error again. // Instead, fail immediately with the original error cause instead of a possibly secondary/misleading error returned later. return Algorithm{}, nil, nil, err } var retAlgo Algorithm var decompressor DecompressorFunc for _, algo := range compressionAlgorithms { prefix := internal.AlgorithmPrefix(algo) if len(prefix) > 0 && bytes.HasPrefix(buffer[:n], prefix) { logrus.Debugf("Detected compression format %s", algo.Name()) retAlgo = algo decompressor = internal.AlgorithmDecompressor(algo) break } } if decompressor == nil { logrus.Debugf("No compression detected") } return retAlgo, decompressor, io.MultiReader(bytes.NewReader(buffer[:n]), input), nil } // DetectCompression returns a DecompressorFunc if the input is recognized as a compressed format, nil otherwise. // Because it consumes the start of input, other consumers must use the returned io.Reader instead to also read from the beginning. func DetectCompression(input io.Reader) (DecompressorFunc, io.Reader, error) { _, d, r, e := DetectCompressionFormat(input) return d, r, e } // AutoDecompress takes a stream and returns an uncompressed version of the // same stream. // The caller must call Close() on the returned stream (even if the input does not need, // or does not even support, closing!). func AutoDecompress(stream io.Reader) (io.ReadCloser, bool, error) { decompressor, stream, err := DetectCompression(stream) if err != nil { return nil, false, fmt.Errorf("detecting compression: %w", err) } var res io.ReadCloser if decompressor != nil { res, err = decompressor(stream) if err != nil { return nil, false, fmt.Errorf("initializing decompression: %w", err) } } else { res = io.NopCloser(stream) } return res, decompressor != nil, nil } ================================================ FILE: vendor/go.podman.io/image/v5/pkg/compression/internal/types.go ================================================ package internal import "io" // CompressorFunc writes the compressed stream to the given writer using the specified compression level. // // Compressing a stream may create integrity data that allows consuming the compressed byte stream // while only using subsets of the compressed data (if the compressed data is seekable and most // of the uncompressed data is already present via other means), while still protecting integrity // of the compressed stream against unwanted modification. (In OCI container images, this metadata // is usually carried in manifest annotations.) // // If the compression generates such metadata, it is written to the provided metadata map. // // The caller must call Close() on the stream (even if the input stream does not need closing!). type CompressorFunc func(io.Writer, map[string]string, *int) (io.WriteCloser, error) // DecompressorFunc returns the decompressed stream, given a compressed stream. // The caller must call Close() on the decompressed stream (even if the compressed input stream does not need closing!). type DecompressorFunc func(io.Reader) (io.ReadCloser, error) // Algorithm is a compression algorithm that can be used for CompressStream. type Algorithm struct { name string baseVariantName string prefix []byte // Initial bytes of a stream compressed using this algorithm, or empty to disable detection. decompressor DecompressorFunc compressor CompressorFunc } // NewAlgorithm creates an Algorithm instance. // nontrivialBaseVariantName is typically "". // This function exists so that Algorithm instances can only be created by code that // is allowed to import this internal subpackage. func NewAlgorithm(name, nontrivialBaseVariantName string, prefix []byte, decompressor DecompressorFunc, compressor CompressorFunc) Algorithm { baseVariantName := name if nontrivialBaseVariantName != "" { baseVariantName = nontrivialBaseVariantName } return Algorithm{ name: name, baseVariantName: baseVariantName, prefix: prefix, decompressor: decompressor, compressor: compressor, } } // Name returns the name for the compression algorithm. func (c Algorithm) Name() string { return c.name } // BaseVariantName returns the name of the “base variant” of the compression algorithm. // It is either equal to Name() of the same algorithm, or equal to Name() of some other Algorithm (the “base variant”). // This supports a single level of “is-a” relationship between compression algorithms, e.g. where "zstd:chunked" data is valid "zstd" data. func (c Algorithm) BaseVariantName() string { return c.baseVariantName } // AlgorithmCompressor returns the compressor field of algo. // This is a function instead of a public method so that it is only callable by code // that is allowed to import this internal subpackage. func AlgorithmCompressor(algo Algorithm) CompressorFunc { return algo.compressor } // AlgorithmDecompressor returns the decompressor field of algo. // This is a function instead of a public method so that it is only callable by code // that is allowed to import this internal subpackage. func AlgorithmDecompressor(algo Algorithm) DecompressorFunc { return algo.decompressor } // AlgorithmPrefix returns the prefix field of algo. // This is a function instead of a public method so that it is only callable by code // that is allowed to import this internal subpackage. func AlgorithmPrefix(algo Algorithm) []byte { return algo.prefix } ================================================ FILE: vendor/go.podman.io/image/v5/pkg/compression/types/types.go ================================================ package types import ( "go.podman.io/image/v5/pkg/compression/internal" ) // DecompressorFunc returns the decompressed stream, given a compressed stream. // The caller must call Close() on the decompressed stream (even if the compressed input stream does not need closing!). type DecompressorFunc = internal.DecompressorFunc // Algorithm is a compression algorithm provided and supported by pkg/compression. // It can’t be supplied from the outside. type Algorithm = internal.Algorithm const ( // GzipAlgorithmName is the name used by pkg/compression.Gzip. // NOTE: Importing only this /types package does not inherently guarantee a Gzip algorithm // will actually be available. (In fact it is intended for this types package not to depend // on any of the implementations.) GzipAlgorithmName = "gzip" // Bzip2AlgorithmName is the name used by pkg/compression.Bzip2. // NOTE: Importing only this /types package does not inherently guarantee a Bzip2 algorithm // will actually be available. (In fact it is intended for this types package not to depend // on any of the implementations.) Bzip2AlgorithmName = "bzip2" // XzAlgorithmName is the name used by pkg/compression.Xz. // NOTE: Importing only this /types package does not inherently guarantee a Xz algorithm // will actually be available. (In fact it is intended for this types package not to depend // on any of the implementations.) XzAlgorithmName = "Xz" // ZstdAlgorithmName is the name used by pkg/compression.Zstd. // NOTE: Importing only this /types package does not inherently guarantee a Zstd algorithm // will actually be available. (In fact it is intended for this types package not to depend // on any of the implementations.) ZstdAlgorithmName = "zstd" // ZstdChunkedAlgorithmName is the name used by pkg/compression.ZstdChunked. // NOTE: Importing only this /types package does not inherently guarantee a ZstdChunked algorithm // will actually be available. (In fact it is intended for this types package not to depend // on any of the implementations.) ZstdChunkedAlgorithmName = "zstd:chunked" ) ================================================ FILE: vendor/go.podman.io/image/v5/pkg/compression/zstd.go ================================================ package compression import ( "io" "github.com/klauspost/compress/zstd" ) type wrapperZstdDecoder struct { decoder *zstd.Decoder } func (w *wrapperZstdDecoder) Close() error { w.decoder.Close() return nil } func (w *wrapperZstdDecoder) DecodeAll(input, dst []byte) ([]byte, error) { return w.decoder.DecodeAll(input, dst) } func (w *wrapperZstdDecoder) Read(p []byte) (int, error) { return w.decoder.Read(p) } func (w *wrapperZstdDecoder) Reset(r io.Reader) error { return w.decoder.Reset(r) } func (w *wrapperZstdDecoder) WriteTo(wr io.Writer) (int64, error) { return w.decoder.WriteTo(wr) } func zstdReader(buf io.Reader) (io.ReadCloser, error) { decoder, err := zstd.NewReader(buf) return &wrapperZstdDecoder{decoder: decoder}, err } func zstdWriter(dest io.Writer) (io.WriteCloser, error) { return zstd.NewWriter(dest) } func zstdWriterWithLevel(dest io.Writer, level int) (*zstd.Encoder, error) { el := zstd.EncoderLevelFromZstd(level) return zstd.NewWriter(dest, zstd.WithEncoderLevel(el)) } // zstdCompressor is a CompressorFunc for the zstd compression algorithm. func zstdCompressor(r io.Writer, metadata map[string]string, level *int) (io.WriteCloser, error) { if level == nil { return zstdWriter(r) } return zstdWriterWithLevel(r, *level) } // ZstdDecompressor is a DecompressorFunc for the zstd compression algorithm. func ZstdDecompressor(r io.Reader) (io.ReadCloser, error) { return zstdReader(r) } ================================================ FILE: vendor/go.podman.io/image/v5/pkg/docker/config/config.go ================================================ package config import ( "encoding/base64" "encoding/json" "errors" "fmt" "io/fs" "iter" "maps" "os" "os/exec" "path/filepath" "runtime" "strings" helperclient "github.com/docker/docker-credential-helpers/client" "github.com/docker/docker-credential-helpers/credentials" "github.com/sirupsen/logrus" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/internal/multierr" "go.podman.io/image/v5/internal/set" "go.podman.io/image/v5/pkg/sysregistriesv2" "go.podman.io/image/v5/types" "go.podman.io/storage/pkg/fileutils" "go.podman.io/storage/pkg/homedir" "go.podman.io/storage/pkg/ioutils" ) type dockerAuthConfig struct { Auth string `json:"auth,omitempty"` IdentityToken string `json:"identitytoken,omitempty"` } type dockerConfigFile struct { AuthConfigs map[string]dockerAuthConfig `json:"auths"` CredHelpers map[string]string `json:"credHelpers,omitempty"` } var ( defaultPerUIDPathFormat = filepath.FromSlash("/run/containers/%d/auth.json") xdgConfigHomePath = filepath.FromSlash("containers/auth.json") xdgRuntimeDirPath = filepath.FromSlash("containers/auth.json") dockerHomePath = filepath.FromSlash(".docker/config.json") dockerLegacyHomePath = ".dockercfg" nonLinuxAuthFilePath = filepath.FromSlash(".config/containers/auth.json") // ErrNotLoggedIn is returned for users not logged into a registry // that they are trying to logout of ErrNotLoggedIn = errors.New("not logged in") // ErrNotSupported is returned for unsupported methods ErrNotSupported = errors.New("not supported") ) // authPath combines a path to a file with container registry credentials, // along with expected properties of that path (currently just whether it's // legacy format or not). type authPath struct { path string legacyFormat bool } // newAuthPathDefault constructs an authPath in non-legacy format. func newAuthPathDefault(path string) authPath { return authPath{path: path, legacyFormat: false} } // GetAllCredentials returns the registry credentials for all registries stored // in any of the configured credential helpers. func GetAllCredentials(sys *types.SystemContext) (map[string]types.DockerAuthConfig, error) { // To keep things simple, let's first extract all registries from all // possible sources, and then call `GetCredentials` on them. That // prevents us from having to reverse engineer the logic in // `GetCredentials`. allKeys := set.New[string]() // To use GetCredentials, we must at least convert the URL forms into host names. // While we're at it, we’ll also canonicalize docker.io to the standard format. normalizedDockerIORegistry := normalizeRegistry("docker.io") helpers, err := sysregistriesv2.CredentialHelpers(sys) if err != nil { return nil, err } for _, helper := range helpers { switch helper { // Special-case the built-in helper for auth files. case sysregistriesv2.AuthenticationFileHelper: for _, path := range getAuthFilePaths(sys, homedir.Get()) { // parse returns an empty map in case the path doesn't exist. fileContents, err := path.parse() if err != nil { return nil, fmt.Errorf("reading JSON file %q: %w", path.path, err) } // Credential helpers in the auth file have a // direct mapping to a registry, so we can just // walk the map. allKeys.AddSeq(maps.Keys(fileContents.CredHelpers)) for key := range fileContents.AuthConfigs { key := normalizeAuthFileKey(key, path.legacyFormat) if key == normalizedDockerIORegistry { key = "docker.io" } allKeys.Add(key) } } // External helpers. default: creds, err := listCredsInCredHelper(helper) if err != nil { logrus.Debugf("Error listing credentials stored in credential helper %s: %v", helper, err) if errors.Is(err, exec.ErrNotFound) { creds = nil // It's okay if the helper doesn't exist. } else { return nil, err } } allKeys.AddSeq(maps.Keys(creds)) } } // Now use `GetCredentials` to the specific auth configs for each // previously listed registry. allCreds := make(map[string]types.DockerAuthConfig) for key := range allKeys.All() { creds, err := GetCredentials(sys, key) if err != nil { // Note: we rely on the logging in `GetCredentials`. return nil, err } if creds != (types.DockerAuthConfig{}) { allCreds[key] = creds } } return allCreds, nil } // getAuthFilePaths returns a slice of authPaths based on the system context // in the order they should be searched. Note that some paths may not exist. // The homeDir parameter should always be homedir.Get(), and is only intended to be overridden // by tests. func getAuthFilePaths(sys *types.SystemContext, homeDir string) []authPath { paths := []authPath{} pathToAuth, userSpecifiedPath, err := getPathToAuth(sys) if err == nil { paths = append(paths, pathToAuth) } else { // Error means that the path set for XDG_RUNTIME_DIR does not exist // but we don't want to completely fail in the case that the user is pulling a public image // Logging the error as a warning instead and moving on to pulling the image logrus.Warnf("%v: Trying to pull image in the event that it is a public image.", err) } if !userSpecifiedPath { xdgCfgHome := os.Getenv("XDG_CONFIG_HOME") if xdgCfgHome == "" { xdgCfgHome = filepath.Join(homeDir, ".config") } paths = append(paths, newAuthPathDefault(filepath.Join(xdgCfgHome, xdgConfigHomePath))) if dockerConfig := os.Getenv("DOCKER_CONFIG"); dockerConfig != "" { paths = append(paths, newAuthPathDefault(filepath.Join(dockerConfig, "config.json"))) } else { paths = append(paths, newAuthPathDefault(filepath.Join(homeDir, dockerHomePath)), ) } paths = append(paths, authPath{path: filepath.Join(homeDir, dockerLegacyHomePath), legacyFormat: true}, ) } return paths } // GetCredentials returns the registry credentials matching key, appropriate for // sys and the users’ configuration. // If an entry is not found, an empty struct is returned. // A valid key is a repository, a namespace within a registry, or a registry hostname. // // GetCredentialsForRef should almost always be used in favor of this API. func GetCredentials(sys *types.SystemContext, key string) (types.DockerAuthConfig, error) { return getCredentialsWithHomeDir(sys, key, homedir.Get()) } // GetCredentialsForRef returns the registry credentials necessary for // accessing ref on the registry ref points to, // appropriate for sys and the users’ configuration. // If an entry is not found, an empty struct is returned. func GetCredentialsForRef(sys *types.SystemContext, ref reference.Named) (types.DockerAuthConfig, error) { return getCredentialsWithHomeDir(sys, ref.Name(), homedir.Get()) } // getCredentialsWithHomeDir is an internal implementation detail of // GetCredentialsForRef and GetCredentials. It exists only to allow testing it // with an artificial home directory. func getCredentialsWithHomeDir(sys *types.SystemContext, key, homeDir string) (types.DockerAuthConfig, error) { _, err := validateKey(key) if err != nil { return types.DockerAuthConfig{}, err } if sys != nil && sys.DockerAuthConfig != nil { logrus.Debugf("Returning credentials for %s from DockerAuthConfig", key) return *sys.DockerAuthConfig, nil } var registry string // We compute this once because it is used in several places. if firstSlash := strings.IndexRune(key, '/'); firstSlash != -1 { registry = key[:firstSlash] } else { registry = key } // Anonymous function to query credentials from auth files. getCredentialsFromAuthFiles := func() (types.DockerAuthConfig, string, error) { for _, path := range getAuthFilePaths(sys, homeDir) { creds, err := findCredentialsInFile(key, registry, path) if err != nil { return types.DockerAuthConfig{}, "", err } if creds != (types.DockerAuthConfig{}) { return creds, path.path, nil } } return types.DockerAuthConfig{}, "", nil } helpers, err := sysregistriesv2.CredentialHelpers(sys) if err != nil { return types.DockerAuthConfig{}, err } var multiErr []error for _, helper := range helpers { var ( creds types.DockerAuthConfig helperKey string credHelperPath string err error ) switch helper { // Special-case the built-in helper for auth files. case sysregistriesv2.AuthenticationFileHelper: helperKey = key creds, credHelperPath, err = getCredentialsFromAuthFiles() // External helpers. default: // This intentionally uses "registry", not "key"; we don't support namespaced // credentials in helpers, but a "registry" is a valid parent of "key". helperKey = registry creds, err = getCredsFromCredHelper(helper, registry) } if err != nil { logrus.Debugf("Error looking up credentials for %s in credential helper %s: %v", helperKey, helper, err) multiErr = append(multiErr, err) continue } if creds != (types.DockerAuthConfig{}) { msg := fmt.Sprintf("Found credentials for %s in credential helper %s", helperKey, helper) if credHelperPath != "" { msg = fmt.Sprintf("%s in file %s", msg, credHelperPath) } logrus.Debug(msg) return creds, nil } } if multiErr != nil { return types.DockerAuthConfig{}, multierr.Format("errors looking up credentials:\n\t* ", "\nt* ", "\n", multiErr) } logrus.Debugf("No credentials for %s found", key) return types.DockerAuthConfig{}, nil } // GetAuthentication returns the registry credentials matching key, appropriate for // sys and the users’ configuration. // If an entry is not found, an empty struct is returned. // A valid key is a repository, a namespace within a registry, or a registry hostname. // // Deprecated: This API only has support for username and password. To get the // support for oauth2 in container registry authentication, we added the new // GetCredentialsForRef and GetCredentials API. The new API should be used and this API is kept to // maintain backward compatibility. func GetAuthentication(sys *types.SystemContext, key string) (string, string, error) { return getAuthenticationWithHomeDir(sys, key, homedir.Get()) } // getAuthenticationWithHomeDir is an internal implementation detail of GetAuthentication, // it exists only to allow testing it with an artificial home directory. func getAuthenticationWithHomeDir(sys *types.SystemContext, key, homeDir string) (string, string, error) { creds, err := getCredentialsWithHomeDir(sys, key, homeDir) if err != nil { return "", "", err } if creds.IdentityToken != "" { return "", "", fmt.Errorf("non-empty identity token found and this API doesn't support it: %w", ErrNotSupported) } return creds.Username, creds.Password, nil } // SetCredentials stores the username and password in a location // appropriate for sys and the users’ configuration. // A valid key is a repository, a namespace within a registry, or a registry hostname; // using forms other than just a registry may fail depending on configuration. // Returns a human-readable description of the location that was updated. // NOTE: The return value is only intended to be read by humans; its form is not an API, // it may change (or new forms can be added) any time. func SetCredentials(sys *types.SystemContext, key, username, password string) (string, error) { helpers, jsonEditor, key, isNamespaced, err := prepareForEdit(sys, key, true) if err != nil { return "", err } // Make sure to collect all errors. var multiErr []error for _, helper := range helpers { var desc string var err error switch helper { // Special-case the built-in helpers for auth files. case sysregistriesv2.AuthenticationFileHelper: desc, err = jsonEditor(sys, func(fileContents *dockerConfigFile) (bool, string, error) { if ch, exists := fileContents.CredHelpers[key]; exists { if isNamespaced { return false, "", unsupportedNamespaceErr(ch) } desc, err := setCredsInCredHelper(ch, key, username, password) if err != nil { return false, "", err } return false, desc, nil } creds := base64.StdEncoding.EncodeToString([]byte(username + ":" + password)) newCreds := dockerAuthConfig{Auth: creds} fileContents.AuthConfigs[key] = newCreds return true, "", nil }) // External helpers. default: if isNamespaced { err = unsupportedNamespaceErr(helper) } else { desc, err = setCredsInCredHelper(helper, key, username, password) } } if err != nil { multiErr = append(multiErr, err) logrus.Debugf("Error storing credentials for %s in credential helper %s: %v", key, helper, err) continue } logrus.Debugf("Stored credentials for %s in credential helper %s", key, helper) return desc, nil } return "", multierr.Format("Errors storing credentials\n\t* ", "\n\t* ", "\n", multiErr) } func unsupportedNamespaceErr(helper string) error { return fmt.Errorf("namespaced key is not supported for credential helper %s", helper) } // SetAuthentication stores the username and password in the credential helper or file // See the documentation of SetCredentials for format of "key" func SetAuthentication(sys *types.SystemContext, key, username, password string) error { _, err := SetCredentials(sys, key, username, password) return err } // RemoveAuthentication removes credentials for `key` from all possible // sources such as credential helpers and auth files. // A valid key is a repository, a namespace within a registry, or a registry hostname; // using forms other than just a registry may fail depending on configuration. func RemoveAuthentication(sys *types.SystemContext, key string) error { helpers, jsonEditor, key, isNamespaced, err := prepareForEdit(sys, key, true) if err != nil { return err } isLoggedIn := false removeFromCredHelper := func(helper string) error { if isNamespaced { logrus.Debugf("Not removing credentials because namespaced keys are not supported for the credential helper: %s", helper) return nil } err := deleteCredsFromCredHelper(helper, key) if err == nil { logrus.Debugf("Credentials for %q were deleted from credential helper %s", key, helper) isLoggedIn = true return nil } if credentials.IsErrCredentialsNotFoundMessage(err.Error()) { logrus.Debugf("Not logged in to %s with credential helper %s", key, helper) return nil } return fmt.Errorf("removing credentials for %s from credential helper %s: %w", key, helper, err) } var multiErr []error for _, helper := range helpers { var err error switch helper { // Special-case the built-in helper for auth files. case sysregistriesv2.AuthenticationFileHelper: _, err = jsonEditor(sys, func(fileContents *dockerConfigFile) (bool, string, error) { var helperErr error if innerHelper, exists := fileContents.CredHelpers[key]; exists { helperErr = removeFromCredHelper(innerHelper) } if _, ok := fileContents.AuthConfigs[key]; ok { isLoggedIn = true delete(fileContents.AuthConfigs, key) } return true, "", helperErr }) if err != nil { multiErr = append(multiErr, err) } // External helpers. default: if err := removeFromCredHelper(helper); err != nil { multiErr = append(multiErr, err) } } } if multiErr != nil { return multierr.Format("errors removing credentials\n\t* ", "\n\t*", "\n", multiErr) } if !isLoggedIn { return ErrNotLoggedIn } return nil } // RemoveAllAuthentication deletes all the credentials stored in credential // helpers and auth files. func RemoveAllAuthentication(sys *types.SystemContext) error { helpers, jsonEditor, _, _, err := prepareForEdit(sys, "", false) if err != nil { return err } var multiErr []error for _, helper := range helpers { var err error switch helper { // Special-case the built-in helper for auth files. case sysregistriesv2.AuthenticationFileHelper: _, err = jsonEditor(sys, func(fileContents *dockerConfigFile) (bool, string, error) { for registry, helper := range fileContents.CredHelpers { // Helpers in auth files are expected // to exist, so no special treatment // for them. if err := deleteCredsFromCredHelper(helper, registry); err != nil { return false, "", err } } fileContents.CredHelpers = make(map[string]string) fileContents.AuthConfigs = make(map[string]dockerAuthConfig) return true, "", nil }) // External helpers. default: var creds map[string]string creds, err = listCredsInCredHelper(helper) if err != nil { if errors.Is(err, exec.ErrNotFound) { // It's okay if the helper doesn't exist. continue } else { break } } for registry := range creds { err = deleteCredsFromCredHelper(helper, registry) if err != nil { break } } } if err != nil { logrus.Debugf("Error removing credentials from credential helper %s: %v", helper, err) multiErr = append(multiErr, err) continue } logrus.Debugf("All credentials removed from credential helper %s", helper) } if multiErr != nil { return multierr.Format("errors removing all credentials:\n\t* ", "\n\t* ", "\n", multiErr) } return nil } // prepareForEdit processes sys and key (if keyRelevant) to return: // - a list of credential helpers // - a function which can be used to edit the JSON file // - the key value to actually use in credential helpers / JSON // - a boolean which is true if key is namespaced (and should not be used with credential helpers). func prepareForEdit(sys *types.SystemContext, key string, keyRelevant bool) ([]string, func(*types.SystemContext, func(*dockerConfigFile) (bool, string, error)) (string, error), string, bool, error) { var isNamespaced bool if keyRelevant { ns, err := validateKey(key) if err != nil { return nil, nil, "", false, err } isNamespaced = ns } if sys != nil && sys.DockerCompatAuthFilePath != "" { if sys.AuthFilePath != "" { return nil, nil, "", false, errors.New("AuthFilePath and DockerCompatAuthFilePath can not be set simultaneously") } if keyRelevant { if isNamespaced { return nil, nil, "", false, fmt.Errorf("Credentials cannot be recorded in Docker-compatible format with namespaced key %q", key) } if key == "docker.io" { key = "https://index.docker.io/v1/" } } // Do not use helpers defined in sysregistriesv2 because Docker isn’t aware of them. return []string{sysregistriesv2.AuthenticationFileHelper}, modifyDockerConfigJSON, key, false, nil } helpers, err := sysregistriesv2.CredentialHelpers(sys) if err != nil { return nil, nil, "", false, err } return helpers, modifyJSON, key, isNamespaced, nil } func listCredsInCredHelper(credHelper string) (map[string]string, error) { helperName := fmt.Sprintf("docker-credential-%s", credHelper) p := helperclient.NewShellProgramFunc(helperName) return helperclient.List(p) } // getPathToAuth gets the path of the auth.json file used for reading and writing credentials, // and a boolean indicating whether the return value came from an explicit user choice (i.e. not defaults) func getPathToAuth(sys *types.SystemContext) (authPath, bool, error) { return getPathToAuthWithOS(sys, runtime.GOOS) } // getPathToAuthWithOS is an internal implementation detail of getPathToAuth, // it exists only to allow testing it with an artificial runtime.GOOS. func getPathToAuthWithOS(sys *types.SystemContext, goOS string) (authPath, bool, error) { if sys != nil { if sys.AuthFilePath != "" && sys.DockerCompatAuthFilePath != "" { return authPath{}, false, errors.New("AuthFilePath and DockerCompatAuthFilePath can not be set simultaneously") } if sys.AuthFilePath != "" { return newAuthPathDefault(sys.AuthFilePath), true, nil } // When reading, we can process auth.json and Docker’s config.json with the same code. // When writing, prepareForEdit chooses an appropriate jsonEditor implementation. if sys.DockerCompatAuthFilePath != "" { return newAuthPathDefault(sys.DockerCompatAuthFilePath), true, nil } if sys.LegacyFormatAuthFilePath != "" { return authPath{path: sys.LegacyFormatAuthFilePath, legacyFormat: true}, true, nil } // Note: RootForImplicitAbsolutePaths should not affect paths starting with $HOME if sys.RootForImplicitAbsolutePaths != "" && goOS == "linux" { return newAuthPathDefault(filepath.Join(sys.RootForImplicitAbsolutePaths, fmt.Sprintf(defaultPerUIDPathFormat, os.Getuid()))), false, nil } } if goOS != "linux" { return newAuthPathDefault(filepath.Join(homedir.Get(), nonLinuxAuthFilePath)), false, nil } runtimeDir := os.Getenv("XDG_RUNTIME_DIR") if runtimeDir != "" { // This function does not in general need to separately check that the returned path exists; that’s racy, and callers will fail accessing the file anyway. // We are checking for fs.ErrNotExist here only to give the user better guidance what to do in this special case. err := fileutils.Exists(runtimeDir) if errors.Is(err, fs.ErrNotExist) { // This means the user set the XDG_RUNTIME_DIR variable and either forgot to create the directory // or made a typo while setting the environment variable, // so return an error referring to $XDG_RUNTIME_DIR instead of xdgRuntimeDirPath inside. return authPath{}, false, fmt.Errorf("%q directory set by $XDG_RUNTIME_DIR does not exist. Either create the directory or unset $XDG_RUNTIME_DIR.: %w", runtimeDir, err) } // else ignore err and let the caller fail accessing xdgRuntimeDirPath. return newAuthPathDefault(filepath.Join(runtimeDir, xdgRuntimeDirPath)), false, nil } return newAuthPathDefault(fmt.Sprintf(defaultPerUIDPathFormat, os.Getuid())), false, nil } // parse unmarshals the credentials stored in the auth.json file and returns it // or returns an empty dockerConfigFile data structure if auth.json does not exist // if the file exists and is empty, this function returns an error. func (path authPath) parse() (dockerConfigFile, error) { var fileContents dockerConfigFile raw, err := os.ReadFile(path.path) if err != nil { if os.IsNotExist(err) { fileContents.AuthConfigs = map[string]dockerAuthConfig{} return fileContents, nil } return dockerConfigFile{}, err } if path.legacyFormat { if err = json.Unmarshal(raw, &fileContents.AuthConfigs); err != nil { return dockerConfigFile{}, fmt.Errorf("unmarshaling JSON at %q: %w", path.path, err) } return fileContents, nil } if err = json.Unmarshal(raw, &fileContents); err != nil { return dockerConfigFile{}, fmt.Errorf("unmarshaling JSON at %q: %w", path.path, err) } if fileContents.AuthConfigs == nil { fileContents.AuthConfigs = map[string]dockerAuthConfig{} } if fileContents.CredHelpers == nil { fileContents.CredHelpers = make(map[string]string) } return fileContents, nil } // modifyJSON finds an auth.json file, calls editor on the contents, and // writes it back if editor returns true. // Returns a human-readable description of the file, to be returned by SetCredentials. // // The editor may also return a human-readable description of the updated location; if it is "", // the file itself is used. func modifyJSON(sys *types.SystemContext, editor func(fileContents *dockerConfigFile) (bool, string, error)) (string, error) { path, _, err := getPathToAuth(sys) if err != nil { return "", err } if path.legacyFormat { return "", fmt.Errorf("writes to %s using legacy format are not supported", path.path) } dir := filepath.Dir(path.path) if err = os.MkdirAll(dir, 0o700); err != nil { return "", err } fileContents, err := path.parse() if err != nil { return "", fmt.Errorf("reading JSON file %q: %w", path.path, err) } updated, description, err := editor(&fileContents) if err != nil { return "", fmt.Errorf("updating %q: %w", path.path, err) } if updated { newData, err := json.MarshalIndent(fileContents, "", "\t") if err != nil { return "", fmt.Errorf("marshaling JSON %q: %w", path.path, err) } if err = ioutils.AtomicWriteFile(path.path, newData, 0o600); err != nil { return "", fmt.Errorf("writing to file %q: %w", path.path, err) } } if description == "" { description = path.path } return description, nil } // modifyDockerConfigJSON finds a docker config.json file, calls editor on the contents, and // writes it back if editor returns true. // Returns a human-readable description of the file, to be returned by SetCredentials. // // The editor may also return a human-readable description of the updated location; if it is "", // the file itself is used. func modifyDockerConfigJSON(sys *types.SystemContext, editor func(fileContents *dockerConfigFile) (bool, string, error)) (string, error) { if sys == nil || sys.DockerCompatAuthFilePath == "" { return "", errors.New("internal error: modifyDockerConfigJSON called with DockerCompatAuthFilePath not set") } path := sys.DockerCompatAuthFilePath dir := filepath.Dir(path) if err := os.MkdirAll(dir, 0o700); err != nil { return "", err } // Try hard not to clobber fields we don’t understand, even fields which may be added in future Docker versions. var rawContents map[string]json.RawMessage originalBytes, err := os.ReadFile(path) switch { case err == nil: if err := json.Unmarshal(originalBytes, &rawContents); err != nil { return "", fmt.Errorf("unmarshaling JSON at %q: %w", path, err) } case errors.Is(err, fs.ErrNotExist): rawContents = map[string]json.RawMessage{} default: // err != nil return "", err } syntheticContents := dockerConfigFile{ AuthConfigs: map[string]dockerAuthConfig{}, CredHelpers: map[string]string{}, } // json.Unmarshal also falls back to case-insensitive field matching; this code does not do that. Presumably // config.json is mostly maintained by machines doing `docker login`, so the files should, hopefully, not contain field names with // unexpected case. if rawAuths, ok := rawContents["auths"]; ok { // This conversion will lose fields we don’t know about; when updating an entry, we can’t tell whether an unknown field // should be preserved or discarded (because it is made obsolete/unwanted with the new credentials). // It might make sense to track which entries of "auths" we actually modified, and to not touch any others. if err := json.Unmarshal(rawAuths, &syntheticContents.AuthConfigs); err != nil { return "", fmt.Errorf(`unmarshaling "auths" in JSON at %q: %w`, path, err) } } if rawCH, ok := rawContents["credHelpers"]; ok { if err := json.Unmarshal(rawCH, &syntheticContents.CredHelpers); err != nil { return "", fmt.Errorf(`unmarshaling "credHelpers" in JSON at %q: %w`, path, err) } } updated, description, err := editor(&syntheticContents) if err != nil { return "", fmt.Errorf("updating %q: %w", path, err) } if updated { rawAuths, err := json.MarshalIndent(syntheticContents.AuthConfigs, "", "\t") if err != nil { return "", fmt.Errorf("marshaling JSON %q: %w", path, err) } rawContents["auths"] = rawAuths // We never modify syntheticContents.CredHelpers, so we don’t need to update it. newData, err := json.MarshalIndent(rawContents, "", "\t") if err != nil { return "", fmt.Errorf("marshaling JSON %q: %w", path, err) } if err = ioutils.AtomicWriteFile(path, newData, 0o600); err != nil { return "", fmt.Errorf("writing to file %q: %w", path, err) } } if description == "" { description = path } return description, nil } func getCredsFromCredHelper(credHelper, registry string) (types.DockerAuthConfig, error) { helperName := fmt.Sprintf("docker-credential-%s", credHelper) p := helperclient.NewShellProgramFunc(helperName) creds, err := helperclient.Get(p, registry) if err != nil { if credentials.IsErrCredentialsNotFoundMessage(err.Error()) { logrus.Debugf("Not logged in to %s with credential helper %s", registry, credHelper) err = nil } return types.DockerAuthConfig{}, err } switch creds.Username { case "": return types.DockerAuthConfig{ IdentityToken: creds.Secret, }, nil default: return types.DockerAuthConfig{ Username: creds.Username, Password: creds.Secret, }, nil } } // setCredsInCredHelper stores (username, password) for registry in credHelper. // Returns a human-readable description of the destination, to be returned by SetCredentials. func setCredsInCredHelper(credHelper, registry, username, password string) (string, error) { helperName := fmt.Sprintf("docker-credential-%s", credHelper) p := helperclient.NewShellProgramFunc(helperName) creds := &credentials.Credentials{ ServerURL: registry, Username: username, Secret: password, } if err := helperclient.Store(p, creds); err != nil { return "", err } return fmt.Sprintf("credential helper: %s", credHelper), nil } func deleteCredsFromCredHelper(credHelper, registry string) error { helperName := fmt.Sprintf("docker-credential-%s", credHelper) p := helperclient.NewShellProgramFunc(helperName) return helperclient.Erase(p, registry) } // findCredentialsInFile looks for credentials matching "key" // (which is "registry" or a namespace in "registry") in "path". func findCredentialsInFile(key, registry string, path authPath) (types.DockerAuthConfig, error) { fileContents, err := path.parse() if err != nil { return types.DockerAuthConfig{}, fmt.Errorf("reading JSON file %q: %w", path.path, err) } // First try cred helpers. They should always be normalized. // This intentionally uses "registry", not "key"; we don't support namespaced // credentials in helpers. if ch, exists := fileContents.CredHelpers[registry]; exists { logrus.Debugf("Looking up in credential helper %s based on credHelpers entry in %s", ch, path.path) return getCredsFromCredHelper(ch, registry) } // Support sub-registry namespaces in auth. // (This is not a feature of ~/.docker/config.json; we support it even for // those files as an extension.) // // Repo or namespace keys are only supported as exact matches. For registry // keys we prefer exact matches as well. for key := range authKeyLookupOrder(key, registry, path.legacyFormat) { if val, exists := fileContents.AuthConfigs[key]; exists { return decodeDockerAuth(path.path, key, val) } } // bad luck; let's normalize the entries first // This primarily happens for legacyFormat, which for a time used API URLs // (http[s:]//…/v1/) as keys. // Secondarily, (docker login) accepted URLs with no normalization for // several years, and matched registry hostnames against that, so support // those entries even in non-legacyFormat ~/.docker/config.json. // The docker.io registry still uses the /v1/ key with a special host name, // so account for that as well. registry = normalizeRegistry(registry) for k, v := range fileContents.AuthConfigs { if normalizeAuthFileKey(k, path.legacyFormat) == registry { return decodeDockerAuth(path.path, k, v) } } // Only log this if we found nothing; getCredentialsWithHomeDir logs the // source of found data. logrus.Debugf("No credentials matching %s found in %s", key, path.path) return types.DockerAuthConfig{}, nil } // authKeyLookupOrder returns a sequence for lookup keys matching (key or registry) // in file with legacyFormat, in order from the best match to worst. // For example, in a non-legacy file, // when given a repository key "quay.io/repo/ns/image", it returns // - quay.io/repo/ns/image // - quay.io/repo/ns // - quay.io/repo // - quay.io func authKeyLookupOrder(key, registry string, legacyFormat bool) iter.Seq[string] { return func(yield func(string) bool) { if legacyFormat { _ = yield(registry) // We stop in any case return } for { if !yield(key) { return } lastSlash := strings.LastIndex(key, "/") if lastSlash == -1 { break } key = key[:lastSlash] } } } // decodeDockerAuth decodes the username and password from conf, // which is entry key in path. func decodeDockerAuth(path, key string, conf dockerAuthConfig) (types.DockerAuthConfig, error) { decoded, err := base64.StdEncoding.DecodeString(conf.Auth) if err != nil { return types.DockerAuthConfig{}, err } user, passwordPart, valid := strings.Cut(string(decoded), ":") if !valid { // if it's invalid just skip, as docker does if len(decoded) > 0 { // Docker writes "auths": { "$host": {} } entries if a credential helper is used, don’t warn about those logrus.Warnf(`Error parsing the "auth" field of a credential entry %q in %q, missing semicolon`, key, path) // Don’t include the text of decoded, because that might put secrets into a log. } else { logrus.Debugf("Found an empty credential entry %q in %q (an unhandled credential helper marker?), moving on", key, path) } return types.DockerAuthConfig{}, nil } password := strings.Trim(passwordPart, "\x00") return types.DockerAuthConfig{ Username: user, Password: password, IdentityToken: conf.IdentityToken, }, nil } // normalizeAuthFileKey takes a key, converts it to a host name and normalizes // the resulting registry. func normalizeAuthFileKey(key string, legacyFormat bool) string { stripped := strings.TrimPrefix(key, "http://") stripped = strings.TrimPrefix(stripped, "https://") if legacyFormat || stripped != key { stripped, _, _ = strings.Cut(stripped, "/") } return normalizeRegistry(stripped) } // normalizeRegistry converts the provided registry if a known docker.io host // is provided. func normalizeRegistry(registry string) string { switch registry { case "registry-1.docker.io", "docker.io": return "index.docker.io" } return registry } // validateKey verifies that the input key does not have a prefix that is not // allowed and returns an indicator if the key is namespaced. func validateKey(key string) (bool, error) { if strings.HasPrefix(key, "http://") || strings.HasPrefix(key, "https://") { return false, fmt.Errorf("key %s contains http[s]:// prefix", key) } // Ideally this should only accept explicitly valid keys, compare // validateIdentityRemappingPrefix. For now, just reject values that look // like tagged or digested values. if strings.ContainsRune(key, '@') { return false, fmt.Errorf(`key %s contains a '@' character`, key) } firstSlash := strings.IndexRune(key, '/') isNamespaced := firstSlash != -1 // Reject host/repo:tag, but allow localhost:5000 and localhost:5000/foo. if isNamespaced && strings.ContainsRune(key[firstSlash+1:], ':') { return false, fmt.Errorf(`key %s contains a ':' character after host[:port]`, key) } // check if the provided key contains one or more subpaths. return isNamespaced, nil } ================================================ FILE: vendor/go.podman.io/image/v5/pkg/strslice/README.md ================================================ This package was replicated from [github.com/docker/docker v17.04.0-ce](https://github.com/docker/docker/tree/v17.04.0-ce/api/types/strslice). ================================================ FILE: vendor/go.podman.io/image/v5/pkg/strslice/strslice.go ================================================ package strslice import "encoding/json" // StrSlice represents a string or an array of strings. // We need to override the json decoder to accept both options. type StrSlice []string // UnmarshalJSON decodes the byte slice whether it's a string or an array of // strings. This method is needed to implement json.Unmarshaler. func (e *StrSlice) UnmarshalJSON(b []byte) error { if len(b) == 0 { // With no input, we preserve the existing value by returning nil and // leaving the target alone. This allows defining default values for // the type. return nil } p := make([]string, 0, 1) if err := json.Unmarshal(b, &p); err != nil { var s string if err := json.Unmarshal(b, &s); err != nil { return err } p = append(p, s) } *e = p return nil } ================================================ FILE: vendor/go.podman.io/image/v5/pkg/sysregistriesv2/paths_common.go ================================================ //go:build !freebsd package sysregistriesv2 // builtinRegistriesConfPath is the path to the registry configuration file. // DO NOT change this, instead see systemRegistriesConfPath above. const builtinRegistriesConfPath = "/etc/containers/registries.conf" // builtinRegistriesConfDirPath is the path to the registry configuration directory. // DO NOT change this, instead see systemRegistriesConfDirectoryPath above. const builtinRegistriesConfDirPath = "/etc/containers/registries.conf.d" ================================================ FILE: vendor/go.podman.io/image/v5/pkg/sysregistriesv2/paths_freebsd.go ================================================ //go:build freebsd package sysregistriesv2 // builtinRegistriesConfPath is the path to the registry configuration file. // DO NOT change this, instead see systemRegistriesConfPath above. const builtinRegistriesConfPath = "/usr/local/etc/containers/registries.conf" // builtinRegistriesConfDirPath is the path to the registry configuration directory. // DO NOT change this, instead see systemRegistriesConfDirectoryPath above. const builtinRegistriesConfDirPath = "/usr/local/etc/containers/registries.conf.d" ================================================ FILE: vendor/go.podman.io/image/v5/pkg/sysregistriesv2/shortnames.go ================================================ package sysregistriesv2 import ( "fmt" "maps" "os" "path/filepath" "reflect" "strings" "github.com/BurntSushi/toml" "github.com/sirupsen/logrus" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/internal/multierr" "go.podman.io/image/v5/internal/rootless" "go.podman.io/image/v5/types" "go.podman.io/storage/pkg/homedir" "go.podman.io/storage/pkg/lockfile" ) // defaultShortNameMode is the default mode of registries.conf files if the // corresponding field is left empty. const defaultShortNameMode = types.ShortNameModePermissive // userShortNamesFile is the user-specific config file to store aliases. var userShortNamesFile = filepath.FromSlash("containers/short-name-aliases.conf") // shortNameAliasesConfPath returns the path to the machine-generated // short-name-aliases.conf file. func shortNameAliasesConfPath(ctx *types.SystemContext) (string, error) { if ctx != nil && len(ctx.UserShortNameAliasConfPath) > 0 { return ctx.UserShortNameAliasConfPath, nil } if rootless.GetRootlessEUID() == 0 { // Root user or in a non-conforming user NS return filepath.Join("/var/cache", userShortNamesFile), nil } // Rootless user cacheRoot, err := homedir.GetCacheHome() if err != nil { return "", err } return filepath.Join(cacheRoot, userShortNamesFile), nil } // shortNameAliasConf is a subset of the `V2RegistriesConf` format. It's used in the // software-maintained `userShortNamesFile`. type shortNameAliasConf struct { // A map for aliasing short names to their fully-qualified image // reference counter parts. // Note that Aliases is niled after being loaded from a file. Aliases map[string]string `toml:"aliases"` // If you add any field, make sure to update nonempty() below. } // nonempty returns true if config contains at least one configuration entry. func (c *shortNameAliasConf) nonempty() bool { copy := *c // A shallow copy if copy.Aliases != nil && len(copy.Aliases) == 0 { copy.Aliases = nil } return !reflect.DeepEqual(copy, shortNameAliasConf{}) } // alias combines the parsed value of an alias with the config file it has been // specified in. The config file is crucial for an improved user experience // such that users are able to resolve potential pull errors. type alias struct { // The parsed value of an alias. May be nil if set to "" in a config. value reference.Named // The config file the alias originates from. configOrigin string } // shortNameAliasCache is the result of parsing shortNameAliasConf, // pre-processed for faster usage. type shortNameAliasCache struct { // Note that an alias value may be nil iff it's set as an empty string // in the config. namedAliases map[string]alias } // ResolveShortNameAlias performs an alias resolution of the specified name. // The user-specific short-name-aliases.conf has precedence over aliases in the // assembled registries.conf. It returns the possibly resolved alias or nil, a // human-readable description of the config where the alias is specified, and // an error. The origin of the config file is crucial for an improved user // experience such that users are able to resolve potential pull errors. // Almost all callers should use pkg/shortnames instead. // // Note that it’s the caller’s responsibility to pass only a repository // (reference.IsNameOnly) as the short name. func ResolveShortNameAlias(ctx *types.SystemContext, name string) (reference.Named, string, error) { if err := validateShortName(name); err != nil { return nil, "", err } confPath, lock, err := shortNameAliasesConfPathAndLock(ctx) if err != nil { return nil, "", err } // Acquire the lock as a reader to allow for multiple routines in the // same process space to read simultaneously. lock.RLock() defer lock.Unlock() _, aliasCache, err := loadShortNameAliasConf(confPath) if err != nil { return nil, "", err } // First look up the short-name-aliases.conf. Note that a value may be // nil iff it's set as an empty string in the config. alias, resolved := aliasCache.namedAliases[name] if resolved { return alias.value, alias.configOrigin, nil } config, err := getConfig(ctx) if err != nil { return nil, "", err } alias, resolved = config.aliasCache.namedAliases[name] if resolved { return alias.value, alias.configOrigin, nil } return nil, "", nil } // editShortNameAlias loads the aliases.conf file and changes it. If value is // set, it adds the name-value pair as a new alias. Otherwise, it will remove // name from the config. func editShortNameAlias(ctx *types.SystemContext, name string, value *string) (retErr error) { if err := validateShortName(name); err != nil { return err } if value != nil { if _, err := parseShortNameValue(*value); err != nil { return err } } confPath, lock, err := shortNameAliasesConfPathAndLock(ctx) if err != nil { return err } // Acquire the lock as a writer to prevent data corruption. lock.Lock() defer lock.Unlock() // Load the short-name-alias.conf, add the specified name-value pair, // and write it back to the file. conf, _, err := loadShortNameAliasConf(confPath) if err != nil { return err } if conf.Aliases == nil { // Ensure we have a map to update. conf.Aliases = make(map[string]string) } if value != nil { conf.Aliases[name] = *value } else { // If the name does not exist, throw an error. if _, exists := conf.Aliases[name]; !exists { return fmt.Errorf("short-name alias %q not found in %q: please check registries.conf files", name, confPath) } delete(conf.Aliases, name) } f, err := os.OpenFile(confPath, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0o600) if err != nil { return err } // since we are writing to this file, make sure we handle err on Close() defer func() { closeErr := f.Close() if retErr == nil { retErr = closeErr } }() encoder := toml.NewEncoder(f) return encoder.Encode(conf) } // AddShortNameAlias adds the specified name-value pair as a new alias to the // user-specific aliases.conf. It may override an existing alias for `name`. // // Note that it’s the caller’s responsibility to pass only a repository // (reference.IsNameOnly) as the short name. func AddShortNameAlias(ctx *types.SystemContext, name string, value string) error { return editShortNameAlias(ctx, name, &value) } // RemoveShortNameAlias clears the alias for the specified name. It throws an // error in case name does not exist in the machine-generated // short-name-alias.conf. In such case, the alias must be specified in one of // the registries.conf files, which is the users' responsibility. // // Note that it’s the caller’s responsibility to pass only a repository // (reference.IsNameOnly) as the short name. func RemoveShortNameAlias(ctx *types.SystemContext, name string) error { return editShortNameAlias(ctx, name, nil) } // parseShortNameValue parses the specified alias into a reference.Named. The alias is // expected to not be tagged or carry a digest and *must* include a // domain/registry. // // Note that the returned reference is always normalized. func parseShortNameValue(alias string) (reference.Named, error) { ref, err := reference.Parse(alias) if err != nil { return nil, fmt.Errorf("parsing alias %q: %w", alias, err) } if _, ok := ref.(reference.Digested); ok { return nil, fmt.Errorf("invalid alias %q: must not contain digest", alias) } if _, ok := ref.(reference.Tagged); ok { return nil, fmt.Errorf("invalid alias %q: must not contain tag", alias) } named, ok := ref.(reference.Named) if !ok { return nil, fmt.Errorf("invalid alias %q: must contain registry and repository", alias) } registry := reference.Domain(named) if !strings.ContainsAny(registry, ".:") && registry != "localhost" { return nil, fmt.Errorf("invalid alias %q: must contain registry and repository", alias) } // A final parse to make sure that docker.io references are correctly // normalized (e.g., docker.io/alpine to docker.io/library/alpine. named, err = reference.ParseNormalizedNamed(alias) return named, err } // validateShortName parses the specified `name` of an alias (i.e., the left-hand // side) and checks if it's a short name and does not include a tag or digest. func validateShortName(name string) error { repo, err := reference.Parse(name) if err != nil { return fmt.Errorf("cannot parse short name: %q: %w", name, err) } if _, ok := repo.(reference.Digested); ok { return fmt.Errorf("invalid short name %q: must not contain digest", name) } if _, ok := repo.(reference.Tagged); ok { return fmt.Errorf("invalid short name %q: must not contain tag", name) } named, ok := repo.(reference.Named) if !ok { return fmt.Errorf("invalid short name %q: no name", name) } registry := reference.Domain(named) if strings.ContainsAny(registry, ".:") || registry == "localhost" { return fmt.Errorf("invalid short name %q: must not contain registry", name) } return nil } // newShortNameAliasCache parses shortNameAliasConf and returns the corresponding internal // representation. func newShortNameAliasCache(path string, conf *shortNameAliasConf) (*shortNameAliasCache, error) { res := shortNameAliasCache{ namedAliases: make(map[string]alias), } errs := []error{} for name, value := range conf.Aliases { if err := validateShortName(name); err != nil { errs = append(errs, err) } // Empty right-hand side values in config files allow to reset // an alias in a previously loaded config. This way, drop-in // config files from registries.conf.d can reset potentially // malconfigured aliases. if value == "" { res.namedAliases[name] = alias{nil, path} continue } named, err := parseShortNameValue(value) if err != nil { // We want to report *all* malformed entries to avoid a // whack-a-mole for the user. errs = append(errs, err) } else { res.namedAliases[name] = alias{named, path} } } if len(errs) > 0 { return nil, multierr.Format("", "\n", "", errs) } return &res, nil } // updateWithConfigurationFrom updates c with configuration from updates. // In case of conflict, updates is preferred. func (c *shortNameAliasCache) updateWithConfigurationFrom(updates *shortNameAliasCache) { maps.Copy(c.namedAliases, updates.namedAliases) } func loadShortNameAliasConf(confPath string) (*shortNameAliasConf, *shortNameAliasCache, error) { conf := shortNameAliasConf{} meta, err := toml.DecodeFile(confPath, &conf) if err != nil && !os.IsNotExist(err) { // It's okay if the config doesn't exist. Other errors are not. return nil, nil, fmt.Errorf("loading short-name aliases config file %q: %w", confPath, err) } if keys := meta.Undecoded(); len(keys) > 0 { logrus.Debugf("Failed to decode keys %q from %q", keys, confPath) } // Even if we don’t always need the cache, doing so validates the machine-generated config. The // file could still be corrupted by another process or user. cache, err := newShortNameAliasCache(confPath, &conf) if err != nil { return nil, nil, fmt.Errorf("loading short-name aliases config file %q: %w", confPath, err) } return &conf, cache, nil } func shortNameAliasesConfPathAndLock(ctx *types.SystemContext) (string, *lockfile.LockFile, error) { shortNameAliasesConfPath, err := shortNameAliasesConfPath(ctx) if err != nil { return "", nil, err } // Make sure the path to file exists. if err := os.MkdirAll(filepath.Dir(shortNameAliasesConfPath), 0o700); err != nil { return "", nil, err } lockPath := shortNameAliasesConfPath + ".lock" locker, err := lockfile.GetLockFile(lockPath) return shortNameAliasesConfPath, locker, err } ================================================ FILE: vendor/go.podman.io/image/v5/pkg/sysregistriesv2/system_registries_v2.go ================================================ package sysregistriesv2 import ( "errors" "fmt" "io/fs" "maps" "os" "path/filepath" "reflect" "slices" "sort" "strings" "sync" "github.com/BurntSushi/toml" "github.com/sirupsen/logrus" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/types" "go.podman.io/storage/pkg/fileutils" "go.podman.io/storage/pkg/homedir" "go.podman.io/storage/pkg/regexp" ) // systemRegistriesConfPath is the path to the system-wide registry // configuration file and is used to add/subtract potential registries for // obtaining images. You can override this at build time with // -ldflags '-X go.podman.io/image/v5/sysregistries.systemRegistriesConfPath=$your_path' var systemRegistriesConfPath = builtinRegistriesConfPath // systemRegistriesConfDirPath is the path to the system-wide registry // configuration directory and is used to add/subtract potential registries for // obtaining images. You can override this at build time with // -ldflags '-X go.podman.io/image/v5/sysregistries.systemRegistriesConfDirectoryPath=$your_path' var systemRegistriesConfDirPath = builtinRegistriesConfDirPath // AuthenticationFileHelper is a special key for credential helpers indicating // the usage of consulting containers-auth.json files instead of a credential // helper. const AuthenticationFileHelper = "containers-auth.json" const ( // configuration values for "pull-from-mirror" // mirrors will be used for both digest pulls and tag pulls MirrorAll = "all" // mirrors will only be used for digest pulls MirrorByDigestOnly = "digest-only" // mirrors will only be used for tag pulls MirrorByTagOnly = "tag-only" ) // Endpoint describes a remote location of a registry. type Endpoint struct { // The endpoint's remote location. Can be empty iff Prefix contains // wildcard in the format: "*.example.com" for subdomain matching. // Please refer to FindRegistry / PullSourcesFromReference instead // of accessing/interpreting `Location` directly. Location string `toml:"location,omitempty"` // If true, certs verification will be skipped and HTTP (non-TLS) // connections will be allowed. Insecure bool `toml:"insecure,omitempty"` // PullFromMirror is used for adding restrictions to image pull through the mirror. // Set to "all", "digest-only", or "tag-only". // If "digest-only", mirrors will only be used for digest pulls. Pulling images by // tag can potentially yield different images, depending on which endpoint // we pull from. Restricting mirrors to pulls by digest avoids that issue. // If "tag-only", mirrors will only be used for tag pulls. For a more up-to-date and expensive mirror // that it is less likely to be out of sync if tags move, it should not be unnecessarily // used for digest references. // Default is "all" (or left empty), mirrors will be used for both digest pulls and tag pulls unless the mirror-by-digest-only is set for the primary registry. // This can only be set in a registry's Mirror field, not in the registry's primary Endpoint. // This per-mirror setting is allowed only when mirror-by-digest-only is not configured for the primary registry. PullFromMirror string `toml:"pull-from-mirror,omitempty"` } // userRegistriesFile is the path to the per user registry configuration file. var userRegistriesFile = filepath.FromSlash(".config/containers/registries.conf") // userRegistriesDir is the path to the per user registry configuration file. var userRegistriesDir = filepath.FromSlash(".config/containers/registries.conf.d") // rewriteReference will substitute the provided reference `prefix` to the // endpoints `location` from the `ref` and creates a new named reference from it. // The function errors if the newly created reference is not parsable. func (e *Endpoint) rewriteReference(ref reference.Named, prefix string) (reference.Named, error) { refString := ref.String() var newNamedRef string // refMatchingPrefix returns the length of the match. Everything that // follows the match gets appended to registries location. prefixLen := refMatchingPrefix(refString, prefix) if prefixLen == -1 { return nil, fmt.Errorf("invalid prefix '%v' for reference '%v'", prefix, refString) } // In the case of an empty `location` field, simply return the original // input ref as-is. // // FIXME: already validated in postProcessRegistries, so check can probably // be dropped. // https://github.com/containers/image/pull/1191#discussion_r610621608 if e.Location == "" { if !strings.HasPrefix(prefix, "*.") { return nil, fmt.Errorf("invalid prefix '%v' for empty location, should be in the format: *.example.com", prefix) } return ref, nil } newNamedRef = e.Location + refString[prefixLen:] newParsedRef, err := reference.ParseNamed(newNamedRef) if err != nil { return nil, fmt.Errorf("rewriting reference: %w", err) } return newParsedRef, nil } // Registry represents a registry. type Registry struct { // Prefix is used for matching images, and to translate one namespace to // another. If `Prefix="example.com/bar"`, `location="example.com/foo/bar"` // and we pull from "example.com/bar/myimage:latest", the image will // effectively be pulled from "example.com/foo/bar/myimage:latest". // If no Prefix is specified, it defaults to the specified location. // Prefix can also be in the format: "*.example.com" for matching // subdomains. The wildcard should only be in the beginning and should also // not contain any namespaces or special characters: "/", "@" or ":". // Please refer to FindRegistry / PullSourcesFromReference instead // of accessing/interpreting `Prefix` directly. Prefix string `toml:"prefix"` // A registry is an Endpoint too Endpoint // The registry's mirrors. Mirrors []Endpoint `toml:"mirror,omitempty"` // If true, pulling from the registry will be blocked. Blocked bool `toml:"blocked,omitempty"` // If true, mirrors will only be used for digest pulls. Pulling images by // tag can potentially yield different images, depending on which endpoint // we pull from. Restricting mirrors to pulls by digest avoids that issue. MirrorByDigestOnly bool `toml:"mirror-by-digest-only,omitempty"` } // PullSource consists of an Endpoint and a Reference. Note that the reference is // rewritten according to the registries prefix and the Endpoint's location. type PullSource struct { Endpoint Endpoint Reference reference.Named } // PullSourcesFromReference returns a slice of PullSource's based on the passed // reference. func (r *Registry) PullSourcesFromReference(ref reference.Named) ([]PullSource, error) { var endpoints []Endpoint _, isDigested := ref.(reference.Canonical) if r.MirrorByDigestOnly { // Only use mirrors when the reference is a digested one. if isDigested { endpoints = append(endpoints, r.Mirrors...) } } else { for _, mirror := range r.Mirrors { // skip the mirror if per mirror setting exists but reference does not match the restriction switch mirror.PullFromMirror { case MirrorByDigestOnly: if !isDigested { continue } case MirrorByTagOnly: if isDigested { continue } } endpoints = append(endpoints, mirror) } } endpoints = append(endpoints, r.Endpoint) sources := []PullSource{} for _, ep := range endpoints { rewritten, err := ep.rewriteReference(ref, r.Prefix) if err != nil { return nil, err } sources = append(sources, PullSource{Endpoint: ep, Reference: rewritten}) } return sources, nil } // V1TOMLregistries is for backwards compatibility to sysregistries v1 type V1TOMLregistries struct { Registries []string `toml:"registries"` } // V1TOMLConfig is for backwards compatibility to sysregistries v1 type V1TOMLConfig struct { Search V1TOMLregistries `toml:"search"` Insecure V1TOMLregistries `toml:"insecure"` Block V1TOMLregistries `toml:"block"` } // V1RegistriesConf is the sysregistries v1 configuration format. type V1RegistriesConf struct { V1TOMLConfig `toml:"registries"` } // Nonempty returns true if config contains at least one configuration entry. // Empty arrays are treated as missing entries. func (config *V1RegistriesConf) Nonempty() bool { copy := *config // A shallow copy if copy.V1TOMLConfig.Search.Registries != nil && len(copy.V1TOMLConfig.Search.Registries) == 0 { copy.V1TOMLConfig.Search.Registries = nil } if copy.V1TOMLConfig.Insecure.Registries != nil && len(copy.V1TOMLConfig.Insecure.Registries) == 0 { copy.V1TOMLConfig.Insecure.Registries = nil } if copy.V1TOMLConfig.Block.Registries != nil && len(copy.V1TOMLConfig.Block.Registries) == 0 { copy.V1TOMLConfig.Block.Registries = nil } return copy.hasSetField() } // hasSetField returns true if config contains at least one configuration entry. // This is useful because of a subtlety of the behavior of the TOML decoder, where a missing array field // is not modified while unmarshaling (in our case remains to nil), while an [] is unmarshaled // as a non-nil []string{}. func (config *V1RegistriesConf) hasSetField() bool { return !reflect.DeepEqual(*config, V1RegistriesConf{}) } // V2RegistriesConf is the sysregistries v2 configuration format. type V2RegistriesConf struct { Registries []Registry `toml:"registry"` // An array of host[:port] (not prefix!) entries to use for resolving unqualified image references UnqualifiedSearchRegistries []string `toml:"unqualified-search-registries"` // An array of global credential helpers to use for authentication // (e.g., ["pass", "secretservice"]). The helpers are consulted in the // specified order. Note that "containers-auth.json" is a reserved // value for consulting auth files as specified in // containers-auth.json(5). // // If empty, CredentialHelpers defaults to ["containers-auth.json"]. CredentialHelpers []string `toml:"credential-helpers"` // ShortNameMode defines how short-name resolution should be handled by // _consumers_ of this package. Depending on the mode, the user should // be prompted with a choice of using one of the unqualified-search // registries when referring to a short name. // // Valid modes are: * "prompt": prompt if stdout is a TTY, otherwise // use all unqualified-search registries * "enforcing": always prompt // and error if stdout is not a TTY * "disabled": do not prompt and // potentially use all unqualified-search registries ShortNameMode string `toml:"short-name-mode"` // AdditionalLayerStoreAuthHelper is a helper binary that receives // registry credentials pass them to Additional Layer Store for // registry authentication. These credentials are only collected when pulling (not pushing). AdditionalLayerStoreAuthHelper string `toml:"additional-layer-store-auth-helper"` shortNameAliasConf // If you add any field, make sure to update Nonempty() below. } // Nonempty returns true if config contains at least one configuration entry. func (config *V2RegistriesConf) Nonempty() bool { copy := *config // A shallow copy if copy.Registries != nil && len(copy.Registries) == 0 { copy.Registries = nil } if copy.UnqualifiedSearchRegistries != nil && len(copy.UnqualifiedSearchRegistries) == 0 { copy.UnqualifiedSearchRegistries = nil } if copy.CredentialHelpers != nil && len(copy.CredentialHelpers) == 0 { copy.CredentialHelpers = nil } if !copy.shortNameAliasConf.nonempty() { copy.shortNameAliasConf = shortNameAliasConf{} } return copy.hasSetField() } // hasSetField returns true if config contains at least one configuration entry. // This is useful because of a subtlety of the behavior of the TOML decoder, where a missing array field // is not modified while unmarshaling (in our case remains to nil), while an [] is unmarshaled // as a non-nil []string{}. func (config *V2RegistriesConf) hasSetField() bool { return !reflect.DeepEqual(*config, V2RegistriesConf{}) } // parsedConfig is the result of parsing, and possibly merging, configuration files; // it is the boundary between the process of reading+ingesting the files, and // later interpreting the configuration based on caller’s requests. type parsedConfig struct { // NOTE: Update also parsedConfig.updateWithConfigurationFrom! // partialV2 must continue to exist to maintain the return value of TryUpdatingCache // for compatibility with existing callers. // We store the authoritative Registries and UnqualifiedSearchRegistries values there as well. partialV2 V2RegistriesConf // Absolute path to the configuration file that set the UnqualifiedSearchRegistries. unqualifiedSearchRegistriesOrigin string // Result of parsing of partialV2.ShortNameMode. // NOTE: May be ShortNameModeInvalid to represent ShortNameMode == "" in intermediate values; // the full configuration in configCache / getConfig() always contains a valid value. shortNameMode types.ShortNameMode aliasCache *shortNameAliasCache } // InvalidRegistries represents an invalid registry configurations. An example // is when "registry.com" is defined multiple times in the configuration but // with conflicting security settings. type InvalidRegistries struct { s string } // Error returns the error string. func (e *InvalidRegistries) Error() string { return e.s } // parseLocation parses the input string, performs some sanity checks and returns // the sanitized input string. An error is returned if the input string is // empty or if contains an "http{s,}://" prefix. func parseLocation(input string) (string, error) { trimmed := strings.TrimRight(input, "/") // FIXME: This check needs to exist but fails for empty Location field with // wildcarded prefix. Removal of this check "only" allows invalid input in, // and does not prevent correct operation. // https://github.com/containers/image/pull/1191#discussion_r610122617 // // if trimmed == "" { // return "", &InvalidRegistries{s: "invalid location: cannot be empty"} // } // if strings.HasPrefix(trimmed, "http://") || strings.HasPrefix(trimmed, "https://") { msg := fmt.Sprintf("invalid location '%s': URI schemes are not supported", input) return "", &InvalidRegistries{s: msg} } return trimmed, nil } // ConvertToV2 returns a v2 config corresponding to a v1 one. func (config *V1RegistriesConf) ConvertToV2() (*V2RegistriesConf, error) { regMap := make(map[string]*Registry) // The order of the registries is not really important, but make it deterministic (the same for the same config file) // to minimize behavior inconsistency and not contribute to difficult-to-reproduce situations. registryOrder := []string{} getRegistry := func(location string) (*Registry, error) { // Note: _pointer_ to a long-lived object var err error location, err = parseLocation(location) if err != nil { return nil, err } reg, exists := regMap[location] if !exists { reg = &Registry{ Endpoint: Endpoint{Location: location}, Mirrors: []Endpoint{}, Prefix: location, } regMap[location] = reg registryOrder = append(registryOrder, location) } return reg, nil } for _, blocked := range config.V1TOMLConfig.Block.Registries { reg, err := getRegistry(blocked) if err != nil { return nil, err } reg.Blocked = true } for _, insecure := range config.V1TOMLConfig.Insecure.Registries { reg, err := getRegistry(insecure) if err != nil { return nil, err } reg.Insecure = true } res := &V2RegistriesConf{ UnqualifiedSearchRegistries: config.V1TOMLConfig.Search.Registries, } for _, location := range registryOrder { reg := regMap[location] res.Registries = append(res.Registries, *reg) } return res, nil } // anchoredDomainRegexp is an internal implementation detail of postProcess, defining the valid values of elements of UnqualifiedSearchRegistries. var anchoredDomainRegexp = regexp.Delayed("^" + reference.DomainRegexp.String() + "$") // postProcess checks the consistency of all the configuration, looks for conflicts, // and normalizes the configuration (e.g., sets the Prefix to Location if not set). func (config *V2RegistriesConf) postProcessRegistries() error { regMap := make(map[string][]*Registry) for i := range config.Registries { reg := &config.Registries[i] // make sure Location and Prefix are valid var err error reg.Location, err = parseLocation(reg.Location) if err != nil { return err } if reg.Prefix == "" { if reg.Location == "" { return &InvalidRegistries{s: "invalid condition: both location and prefix are unset"} } reg.Prefix = reg.Location } else { reg.Prefix, err = parseLocation(reg.Prefix) if err != nil { return err } // FIXME: allow config authors to always use Prefix. // https://github.com/containers/image/pull/1191#discussion_r610622495 if !strings.HasPrefix(reg.Prefix, "*.") && reg.Location == "" { return &InvalidRegistries{s: "invalid condition: location is unset and prefix is not in the format: *.example.com"} } } // validate the mirror usage settings does not apply to primary registry if reg.PullFromMirror != "" { return fmt.Errorf("pull-from-mirror must not be set for a non-mirror registry %q", reg.Prefix) } // make sure mirrors are valid for j := range reg.Mirrors { mir := ®.Mirrors[j] mir.Location, err = parseLocation(mir.Location) if err != nil { return err } // FIXME: unqualifiedSearchRegistries now also accepts empty values // and shouldn't // https://github.com/containers/image/pull/1191#discussion_r610623216 if mir.Location == "" { return &InvalidRegistries{s: "invalid condition: mirror location is unset"} } if reg.MirrorByDigestOnly && mir.PullFromMirror != "" { return &InvalidRegistries{s: fmt.Sprintf("cannot set mirror usage mirror-by-digest-only for the registry (%q) and pull-from-mirror for per-mirror (%q) at the same time", reg.Prefix, mir.Location)} } if mir.PullFromMirror != "" && mir.PullFromMirror != MirrorAll && mir.PullFromMirror != MirrorByDigestOnly && mir.PullFromMirror != MirrorByTagOnly { return &InvalidRegistries{s: fmt.Sprintf("unsupported pull-from-mirror value %q for mirror %q", mir.PullFromMirror, mir.Location)} } } if reg.Location == "" { regMap[reg.Prefix] = append(regMap[reg.Prefix], reg) } else { regMap[reg.Location] = append(regMap[reg.Location], reg) } } // Given a registry can be mentioned multiple times (e.g., to have // multiple prefixes backed by different mirrors), we need to make sure // there are no conflicts among them. // // Note: we need to iterate over the registries array to ensure a // deterministic behavior which is not guaranteed by maps. for _, reg := range config.Registries { var others []*Registry var ok bool if reg.Location == "" { others, ok = regMap[reg.Prefix] } else { others, ok = regMap[reg.Location] } if !ok { return fmt.Errorf("Internal error in V2RegistriesConf.PostProcess: entry in regMap is missing") } for _, other := range others { if reg.Insecure != other.Insecure { msg := fmt.Sprintf("registry '%s' is defined multiple times with conflicting 'insecure' setting", reg.Location) return &InvalidRegistries{s: msg} } if reg.Blocked != other.Blocked { msg := fmt.Sprintf("registry '%s' is defined multiple times with conflicting 'blocked' setting", reg.Location) return &InvalidRegistries{s: msg} } } } for i := range config.UnqualifiedSearchRegistries { registry, err := parseLocation(config.UnqualifiedSearchRegistries[i]) if err != nil { return err } if !anchoredDomainRegexp.MatchString(registry) { return &InvalidRegistries{fmt.Sprintf("Invalid unqualified-search-registries entry %#v", registry)} } config.UnqualifiedSearchRegistries[i] = registry } // Registries are ordered and the first longest prefix always wins, // rendering later items with the same prefix non-existent. We cannot error // out anymore as this might break existing users, so let's just ignore them // to guarantee that the same prefix exists only once. // // As a side effect of parsedConfig.updateWithConfigurationFrom, the Registries slice // is always sorted. To be consistent in situations where it is not called (no drop-ins), // sort it here as well. prefixes := []string{} uniqueRegistries := make(map[string]Registry) for i := range config.Registries { // TODO: should we warn if we see the same prefix being used multiple times? prefix := config.Registries[i].Prefix if _, exists := uniqueRegistries[prefix]; !exists { uniqueRegistries[prefix] = config.Registries[i] prefixes = append(prefixes, prefix) } } sort.Strings(prefixes) config.Registries = []Registry{} for _, prefix := range prefixes { config.Registries = append(config.Registries, uniqueRegistries[prefix]) } return nil } // ConfigPath returns the path to the system-wide registry configuration file. // // Deprecated: This API implies configuration is read from files, and that there is only one. // Please use ConfigurationSourceDescription to obtain a string usable for error messages. func ConfigPath(ctx *types.SystemContext) string { return newConfigWrapper(ctx).configPath } // ConfigDirPath returns the path to the directory for drop-in // registry configuration files. // // Deprecated: This API implies configuration is read from directories, and that there is only one. // Please use ConfigurationSourceDescription to obtain a string usable for error messages. func ConfigDirPath(ctx *types.SystemContext) string { configWrapper := newConfigWrapper(ctx) if configWrapper.userConfigDirPath != "" { return configWrapper.userConfigDirPath } return configWrapper.configDirPath } // configWrapper is used to store the paths from ConfigPath and ConfigDirPath // and acts as a key to the internal cache. type configWrapper struct { // path to the registries.conf file configPath string // path to system-wide registries.conf.d directory, or "" if not used configDirPath string // path to user specified registries.conf.d directory, or "" if not used userConfigDirPath string } // newConfigWrapper returns a configWrapper for the specified SystemContext. func newConfigWrapper(ctx *types.SystemContext) configWrapper { return newConfigWrapperWithHomeDir(ctx, homedir.Get()) } // newConfigWrapperWithHomeDir is an internal implementation detail of newConfigWrapper, // it exists only to allow testing it with an artificial home directory. func newConfigWrapperWithHomeDir(ctx *types.SystemContext, homeDir string) configWrapper { var wrapper configWrapper userRegistriesFilePath := filepath.Join(homeDir, userRegistriesFile) userRegistriesDirPath := filepath.Join(homeDir, userRegistriesDir) // decide configPath using per-user path or system file if ctx != nil && ctx.SystemRegistriesConfPath != "" { wrapper.configPath = ctx.SystemRegistriesConfPath } else if err := fileutils.Exists(userRegistriesFilePath); err == nil { // per-user registries.conf exists, not reading system dir // return config dirs from ctx or per-user one wrapper.configPath = userRegistriesFilePath if ctx != nil && ctx.SystemRegistriesConfDirPath != "" { wrapper.configDirPath = ctx.SystemRegistriesConfDirPath } else { wrapper.userConfigDirPath = userRegistriesDirPath } return wrapper } else if ctx != nil && ctx.RootForImplicitAbsolutePaths != "" { wrapper.configPath = filepath.Join(ctx.RootForImplicitAbsolutePaths, systemRegistriesConfPath) } else { wrapper.configPath = systemRegistriesConfPath } // potentially use both system and per-user dirs if not using per-user config file if ctx != nil && ctx.SystemRegistriesConfDirPath != "" { // dir explicitly chosen: use only that one wrapper.configDirPath = ctx.SystemRegistriesConfDirPath } else if ctx != nil && ctx.RootForImplicitAbsolutePaths != "" { wrapper.configDirPath = filepath.Join(ctx.RootForImplicitAbsolutePaths, systemRegistriesConfDirPath) wrapper.userConfigDirPath = userRegistriesDirPath } else { wrapper.configDirPath = systemRegistriesConfDirPath wrapper.userConfigDirPath = userRegistriesDirPath } return wrapper } // ConfigurationSourceDescription returns a string containers paths of registries.conf and registries.conf.d func ConfigurationSourceDescription(ctx *types.SystemContext) string { wrapper := newConfigWrapper(ctx) configSources := []string{wrapper.configPath} if wrapper.configDirPath != "" { configSources = append(configSources, wrapper.configDirPath) } if wrapper.userConfigDirPath != "" { configSources = append(configSources, wrapper.userConfigDirPath) } return strings.Join(configSources, ", ") } // configMutex is used to synchronize concurrent accesses to configCache. var configMutex = sync.Mutex{} // configCache caches already loaded configs with config paths as keys and is // used to avoid redundantly parsing configs. Concurrent accesses to the cache // are synchronized via configMutex. var configCache = make(map[configWrapper]*parsedConfig) // InvalidateCache invalidates the registry cache. This function is meant to be // used for long-running processes that need to reload potential changes made to // the cached registry config files. func InvalidateCache() { configMutex.Lock() defer configMutex.Unlock() configCache = make(map[configWrapper]*parsedConfig) } // getConfig returns the config object corresponding to ctx, loading it if it is not yet cached. func getConfig(ctx *types.SystemContext) (*parsedConfig, error) { wrapper := newConfigWrapper(ctx) configMutex.Lock() if config, inCache := configCache[wrapper]; inCache { configMutex.Unlock() return config, nil } configMutex.Unlock() return tryUpdatingCache(ctx, wrapper) } // dropInConfigs returns a slice of drop-in-configs from the registries.conf.d // directory. func dropInConfigs(wrapper configWrapper) ([]string, error) { var ( configs []string dirPaths []string ) if wrapper.configDirPath != "" { dirPaths = append(dirPaths, wrapper.configDirPath) } if wrapper.userConfigDirPath != "" { dirPaths = append(dirPaths, wrapper.userConfigDirPath) } for _, dirPath := range dirPaths { err := filepath.WalkDir(dirPath, // WalkFunc to read additional configs func(path string, d fs.DirEntry, err error) error { switch { case err != nil: // return error (could be a permission problem) return err case d == nil: // this should only happen when err != nil but let's be sure return nil case d.IsDir(): if path != dirPath { // make sure to not recurse into sub-directories return filepath.SkipDir } // ignore directories return nil default: // only add *.conf files if strings.HasSuffix(path, ".conf") { configs = append(configs, path) } return nil } }, ) if err != nil && !os.IsNotExist(err) { // Ignore IsNotExist errors: most systems won't have a registries.conf.d // directory. return nil, fmt.Errorf("reading registries.conf.d: %w", err) } } return configs, nil } // TryUpdatingCache loads the configuration from the provided `SystemContext` // without using the internal cache. On success, the loaded configuration will // be added into the internal registry cache. // It returns the resulting configuration; this is DEPRECATED and may not correctly // reflect any future data handled by this package. func TryUpdatingCache(ctx *types.SystemContext) (*V2RegistriesConf, error) { config, err := tryUpdatingCache(ctx, newConfigWrapper(ctx)) if err != nil { return nil, err } return &config.partialV2, err } // tryUpdatingCache implements TryUpdatingCache with an additional configWrapper // argument to avoid redundantly calculating the config paths. func tryUpdatingCache(ctx *types.SystemContext, wrapper configWrapper) (*parsedConfig, error) { configMutex.Lock() defer configMutex.Unlock() // load the config config, err := loadConfigFile(wrapper.configPath, false) if err != nil { // Continue with an empty []Registry if we use the default config, which // implies that the config path of the SystemContext isn't set. // // Note: if ctx.SystemRegistriesConfPath points to the default config, // we will still return an error. if os.IsNotExist(err) && (ctx == nil || ctx.SystemRegistriesConfPath == "") { config = &parsedConfig{} config.partialV2 = V2RegistriesConf{Registries: []Registry{}} config.aliasCache, err = newShortNameAliasCache("", &shortNameAliasConf{}) if err != nil { return nil, err // Should never happen } } else { return nil, fmt.Errorf("loading registries configuration %q: %w", wrapper.configPath, err) } } // Load the configs from the conf directory path. dinConfigs, err := dropInConfigs(wrapper) if err != nil { return nil, err } for _, path := range dinConfigs { // Enforce v2 format for drop-in-configs. dropIn, err := loadConfigFile(path, true) if err != nil { if errors.Is(err, fs.ErrNotExist) { // file must have been removed between the directory listing // and the open call, ignore that as it is a expected race continue } return nil, fmt.Errorf("loading drop-in registries configuration %q: %w", path, err) } config.updateWithConfigurationFrom(dropIn) } if config.shortNameMode == types.ShortNameModeInvalid { config.shortNameMode = defaultShortNameMode } if len(config.partialV2.CredentialHelpers) == 0 { config.partialV2.CredentialHelpers = []string{AuthenticationFileHelper} } // populate the cache configCache[wrapper] = config return config, nil } // GetRegistries has been deprecated. Use FindRegistry instead. // // GetRegistries loads and returns the registries specified in the config. // Note the parsed content of registry config files is cached. For reloading, // use `InvalidateCache` and re-call `GetRegistries`. func GetRegistries(ctx *types.SystemContext) ([]Registry, error) { config, err := getConfig(ctx) if err != nil { return nil, err } return config.partialV2.Registries, nil } // UnqualifiedSearchRegistries returns a list of host[:port] entries to try // for unqualified image search, in the returned order) func UnqualifiedSearchRegistries(ctx *types.SystemContext) ([]string, error) { registries, _, err := UnqualifiedSearchRegistriesWithOrigin(ctx) return registries, err } // UnqualifiedSearchRegistriesWithOrigin returns a list of host[:port] entries // to try for unqualified image search, in the returned order. It also returns // a human-readable description of where these entries are specified (e.g., a // registries.conf file). func UnqualifiedSearchRegistriesWithOrigin(ctx *types.SystemContext) ([]string, string, error) { config, err := getConfig(ctx) if err != nil { return nil, "", err } return config.partialV2.UnqualifiedSearchRegistries, config.unqualifiedSearchRegistriesOrigin, nil } // parseShortNameMode translates the string into well-typed // types.ShortNameMode. func parseShortNameMode(mode string) (types.ShortNameMode, error) { switch mode { case "disabled": return types.ShortNameModeDisabled, nil case "enforcing": return types.ShortNameModeEnforcing, nil case "permissive": return types.ShortNameModePermissive, nil default: return types.ShortNameModeInvalid, fmt.Errorf("invalid short-name mode: %q", mode) } } // GetShortNameMode returns the configured types.ShortNameMode. func GetShortNameMode(ctx *types.SystemContext) (types.ShortNameMode, error) { if ctx != nil && ctx.ShortNameMode != nil { return *ctx.ShortNameMode, nil } config, err := getConfig(ctx) if err != nil { return -1, err } return config.shortNameMode, err } // CredentialHelpers returns the global top-level credential helpers. func CredentialHelpers(sys *types.SystemContext) ([]string, error) { config, err := getConfig(sys) if err != nil { return nil, err } return config.partialV2.CredentialHelpers, nil } // AdditionalLayerStoreAuthHelper returns the helper for passing registry // credentials to Additional Layer Store. func AdditionalLayerStoreAuthHelper(sys *types.SystemContext) (string, error) { config, err := getConfig(sys) if err != nil { return "", err } return config.partialV2.AdditionalLayerStoreAuthHelper, nil } // refMatchingSubdomainPrefix returns the length of ref // iff ref, which is a registry, repository namespace, repository or image reference (as formatted by // reference.Domain(), reference.Named.Name() or reference.Reference.String() // — note that this requires the name to start with an explicit hostname!), // matches a Registry.Prefix value containing wildcarded subdomains in the // format: *.example.com. Wildcards are only accepted at the beginning, so // other formats like example.*.com will not work. Wildcarded prefixes also // cannot contain port numbers or namespaces in them. func refMatchingSubdomainPrefix(ref, prefix string) int { index := strings.Index(ref, prefix[1:]) if index == -1 { return -1 } if strings.Contains(ref[:index], "/") { return -1 } index += len(prefix[1:]) if index == len(ref) { return index } switch ref[index] { case ':', '/', '@': return index default: return -1 } } // refMatchingPrefix returns the length of the prefix iff ref, // which is a registry, repository namespace, repository or image reference (as formatted by // reference.Domain(), reference.Named.Name() or reference.Reference.String() // — note that this requires the name to start with an explicit hostname!), // matches a Registry.Prefix value. // (This is split from the caller primarily to make testing easier.) func refMatchingPrefix(ref, prefix string) int { switch { case strings.HasPrefix(prefix, "*."): return refMatchingSubdomainPrefix(ref, prefix) case len(ref) < len(prefix): return -1 case len(ref) == len(prefix): if ref == prefix { return len(prefix) } return -1 case len(ref) > len(prefix): if !strings.HasPrefix(ref, prefix) { return -1 } c := ref[len(prefix)] // This allows "example.com:5000" to match "example.com", // which is unintended; that will get fixed eventually, DON'T RELY // ON THE CURRENT BEHAVIOR. if c == ':' || c == '/' || c == '@' { return len(prefix) } return -1 default: panic("Internal error: impossible comparison outcome") } } // FindRegistry returns the Registry with the longest prefix for ref, // which is a registry, repository namespace repository or image reference (as formatted by // reference.Domain(), reference.Named.Name() or reference.Reference.String() // — note that this requires the name to start with an explicit hostname!). // If no Registry prefixes the image, nil is returned. func FindRegistry(ctx *types.SystemContext, ref string) (*Registry, error) { config, err := getConfig(ctx) if err != nil { return nil, err } return findRegistryWithParsedConfig(config, ref) } // findRegistryWithParsedConfig implements `FindRegistry` with a pre-loaded // parseConfig. func findRegistryWithParsedConfig(config *parsedConfig, ref string) (*Registry, error) { reg := Registry{} prefixLen := 0 for _, r := range config.partialV2.Registries { if refMatchingPrefix(ref, r.Prefix) != -1 { length := len(r.Prefix) if length > prefixLen { reg = r prefixLen = length } } } if prefixLen != 0 { return ®, nil } return nil, nil } // loadConfigFile loads and unmarshals a single config file. // Use forceV2 if the config must in the v2 format. func loadConfigFile(path string, forceV2 bool) (*parsedConfig, error) { logrus.Debugf("Loading registries configuration %q", path) // tomlConfig allows us to unmarshal either V1 or V2 simultaneously. type tomlConfig struct { V2RegistriesConf V1RegistriesConf // for backwards compatibility with sysregistries v1 } // Load the tomlConfig. Note that `DecodeFile` will overwrite set fields. var combinedTOML tomlConfig meta, err := toml.DecodeFile(path, &combinedTOML) if err != nil { return nil, err } if keys := meta.Undecoded(); len(keys) > 0 { logrus.Debugf("Failed to decode keys %q from %q", keys, path) } if combinedTOML.V1RegistriesConf.hasSetField() { // Enforce the v2 format if requested. if forceV2 { return nil, &InvalidRegistries{s: "registry must be in v2 format but is in v1"} } // Convert a v1 config into a v2 config. if combinedTOML.V2RegistriesConf.hasSetField() { return nil, &InvalidRegistries{s: fmt.Sprintf("mixing sysregistry v1/v2 is not supported: %#v", combinedTOML)} } converted, err := combinedTOML.V1RegistriesConf.ConvertToV2() if err != nil { return nil, err } combinedTOML.V1RegistriesConf = V1RegistriesConf{} combinedTOML.V2RegistriesConf = *converted } res := parsedConfig{partialV2: combinedTOML.V2RegistriesConf} // Post process registries, set the correct prefixes, sanity checks, etc. if err := res.partialV2.postProcessRegistries(); err != nil { return nil, err } res.unqualifiedSearchRegistriesOrigin = path if len(res.partialV2.ShortNameMode) > 0 { mode, err := parseShortNameMode(res.partialV2.ShortNameMode) if err != nil { return nil, err } res.shortNameMode = mode } else { res.shortNameMode = types.ShortNameModeInvalid } // Valid wildcarded prefixes must be in the format: *.example.com // FIXME: Move to postProcessRegistries // https://github.com/containers/image/pull/1191#discussion_r610623829 for i := range res.partialV2.Registries { prefix := res.partialV2.Registries[i].Prefix if strings.HasPrefix(prefix, "*.") && strings.ContainsAny(prefix, "/@:") { msg := fmt.Sprintf("Wildcarded prefix should be in the format: *.example.com. Current prefix %q is incorrectly formatted", prefix) return nil, &InvalidRegistries{s: msg} } } // Parse and validate short-name aliases. cache, err := newShortNameAliasCache(path, &res.partialV2.shortNameAliasConf) if err != nil { return nil, fmt.Errorf("validating short-name aliases: %w", err) } res.aliasCache = cache // Clear conf.partialV2.shortNameAliasConf to make it available for garbage collection and // reduce memory consumption. We're consulting aliasCache for lookups. res.partialV2.shortNameAliasConf = shortNameAliasConf{} return &res, nil } // updateWithConfigurationFrom updates c with configuration from updates. // // Fields present in updates will typically replace already set fields in c. // The [[registry]] and alias tables are merged. func (c *parsedConfig) updateWithConfigurationFrom(updates *parsedConfig) { // == Merge Registries: registryMap := make(map[string]Registry) for i := range c.partialV2.Registries { registryMap[c.partialV2.Registries[i].Prefix] = c.partialV2.Registries[i] } // Merge the freshly loaded registries. for i := range updates.partialV2.Registries { registryMap[updates.partialV2.Registries[i].Prefix] = updates.partialV2.Registries[i] } // Go maps have a non-deterministic order when iterating the keys, so // we sort the keys to enforce some order in Registries slice. // Some consumers of c/image (e.g., CRI-O) log the configuration // and a non-deterministic order could easily cause confusion. prefixes := slices.Sorted(maps.Keys(registryMap)) c.partialV2.Registries = []Registry{} for _, prefix := range prefixes { c.partialV2.Registries = append(c.partialV2.Registries, registryMap[prefix]) } // == Merge UnqualifiedSearchRegistries: // This depends on an subtlety of the behavior of the TOML decoder, where a missing array field // is not modified while unmarshaling (in our case remains to nil), while an [] is unmarshaled // as a non-nil []string{}. if updates.partialV2.UnqualifiedSearchRegistries != nil { c.partialV2.UnqualifiedSearchRegistries = updates.partialV2.UnqualifiedSearchRegistries c.unqualifiedSearchRegistriesOrigin = updates.unqualifiedSearchRegistriesOrigin } // == Merge credential helpers: if updates.partialV2.CredentialHelpers != nil { c.partialV2.CredentialHelpers = updates.partialV2.CredentialHelpers } // == Merge shortNameMode: // We don’t maintain c.partialV2.ShortNameMode. if updates.shortNameMode != types.ShortNameModeInvalid { c.shortNameMode = updates.shortNameMode } // == Merge AdditionalLayerStoreAuthHelper: if updates.partialV2.AdditionalLayerStoreAuthHelper != "" { c.partialV2.AdditionalLayerStoreAuthHelper = updates.partialV2.AdditionalLayerStoreAuthHelper } // == Merge aliasCache: // We don’t maintain (in fact we actively clear) c.partialV2.shortNameAliasConf. c.aliasCache.updateWithConfigurationFrom(updates.aliasCache) } ================================================ FILE: vendor/go.podman.io/image/v5/pkg/tlsclientconfig/tlsclientconfig.go ================================================ package tlsclientconfig import ( "crypto/tls" "crypto/x509" "errors" "fmt" "net" "net/http" "os" "path/filepath" "slices" "strings" "time" "github.com/sirupsen/logrus" ) // SetupCertificates opens all .crt, .cert, and .key files in dir and appends / loads certs and key pairs as appropriate to tlsc func SetupCertificates(dir string, tlsc *tls.Config) error { logrus.Debugf("Looking for TLS certificates and private keys in %s", dir) fs, err := os.ReadDir(dir) if err != nil { if os.IsNotExist(err) { return nil } if os.IsPermission(err) { logrus.Debugf("Skipping scan of %s due to permission error: %v", dir, err) return nil } return err } for _, f := range fs { fullPath := filepath.Join(dir, f.Name()) if strings.HasSuffix(f.Name(), ".crt") { logrus.Debugf(" crt: %s", fullPath) data, err := os.ReadFile(fullPath) if err != nil { if errors.Is(err, os.ErrNotExist) { // file must have been removed between the directory listing // and the open call, ignore that as it is a expected race continue } return err } if tlsc.RootCAs == nil { systemPool, err := x509.SystemCertPool() if err != nil { return fmt.Errorf("unable to get system cert pool: %w", err) } tlsc.RootCAs = systemPool } tlsc.RootCAs.AppendCertsFromPEM(data) } if base, ok := strings.CutSuffix(f.Name(), ".cert"); ok { certName := f.Name() keyName := base + ".key" logrus.Debugf(" cert: %s", fullPath) if !hasFile(fs, keyName) { return fmt.Errorf("missing key %s for client certificate %s. Note that CA certificates should use the extension .crt", keyName, certName) } cert, err := tls.LoadX509KeyPair(filepath.Join(dir, certName), filepath.Join(dir, keyName)) if err != nil { return err } tlsc.Certificates = append(slices.Clone(tlsc.Certificates), cert) } if base, ok := strings.CutSuffix(f.Name(), ".key"); ok { keyName := f.Name() certName := base + ".cert" logrus.Debugf(" key: %s", fullPath) if !hasFile(fs, certName) { return fmt.Errorf("missing client certificate %s for key %s", certName, keyName) } } } return nil } func hasFile(files []os.DirEntry, name string) bool { return slices.ContainsFunc(files, func(f os.DirEntry) bool { return f.Name() == name }) } // NewTransport Creates a default transport func NewTransport() *http.Transport { direct := &net.Dialer{ Timeout: 30 * time.Second, KeepAlive: 30 * time.Second, } tr := &http.Transport{ Proxy: http.ProxyFromEnvironment, DialContext: direct.DialContext, TLSHandshakeTimeout: 10 * time.Second, IdleConnTimeout: 90 * time.Second, MaxIdleConns: 100, } return tr } ================================================ FILE: vendor/go.podman.io/image/v5/sif/load.go ================================================ package sif import ( "bufio" "context" "fmt" "io" "os" "os/exec" "path/filepath" "strings" "github.com/sirupsen/logrus" "github.com/sylabs/sif/v2/pkg/sif" ) // injectedScriptTargetPath is the path injectedScript should be written to in the created image. const injectedScriptTargetPath = "/podman/runscript" // parseDefFile parses a SIF definition file from reader, // and returns non-trivial contents of the %environment and %runscript sections. func parseDefFile(reader io.Reader) ([]string, []string, error) { type parserState int const ( parsingOther parserState = iota parsingEnvironment parsingRunscript ) environment := []string{} runscript := []string{} state := parsingOther scanner := bufio.NewScanner(reader) for scanner.Scan() { s := strings.TrimSpace(scanner.Text()) switch { case s == `%environment`: state = parsingEnvironment case s == `%runscript`: state = parsingRunscript case strings.HasPrefix(s, "%"): state = parsingOther case state == parsingEnvironment: if s != "" && !strings.HasPrefix(s, "#") { environment = append(environment, s) } case state == parsingRunscript: runscript = append(runscript, s) default: // parsingOther: ignore the line } } if err := scanner.Err(); err != nil { return nil, nil, fmt.Errorf("reading lines from SIF definition file object: %w", err) } return environment, runscript, nil } // generateInjectedScript generates a shell script based on // SIF definition file %environment and %runscript data, and returns it. func generateInjectedScript(environment []string, runscript []string) []byte { script := fmt.Sprintf("#!/bin/bash\n"+ "%s\n"+ "%s\n", strings.Join(environment, "\n"), strings.Join(runscript, "\n")) return []byte(script) } // processDefFile finds sif.DataDeffile in sifImage, if any, // and returns: // - the command to run // - contents of a script to inject as injectedScriptTargetPath, or nil func processDefFile(sifImage *sif.FileImage) (string, []byte, error) { var environment, runscript []string desc, err := sifImage.GetDescriptor(sif.WithDataType(sif.DataDeffile)) if err == nil { environment, runscript, err = parseDefFile(desc.GetReader()) if err != nil { return "", nil, err } } var command string var injectedScript []byte if len(environment) == 0 && len(runscript) == 0 { command = "bash" injectedScript = nil } else { injectedScript = generateInjectedScript(environment, runscript) command = injectedScriptTargetPath } return command, injectedScript, nil } func writeInjectedScript(extractedRootPath string, injectedScript []byte) error { if injectedScript == nil { return nil } filePath := filepath.Join(extractedRootPath, injectedScriptTargetPath) parentDirPath := filepath.Dir(filePath) if err := os.MkdirAll(parentDirPath, 0o755); err != nil { return fmt.Errorf("creating %s: %w", parentDirPath, err) } if err := os.WriteFile(filePath, injectedScript, 0o755); err != nil { return fmt.Errorf("writing %s to %s: %w", injectedScriptTargetPath, filePath, err) } return nil } // createTarFromSIFInputs creates a tar file at tarPath, using a squashfs image at squashFSPath. // It can also use extractedRootPath and scriptPath, which are allocated for its exclusive use, // if necessary. func createTarFromSIFInputs(ctx context.Context, tarPath, squashFSPath string, injectedScript []byte, extractedRootPath, scriptPath string) error { // It's safe for the Remove calls to happen even before we create the files, because tempDir is exclusive // for our use. defer os.RemoveAll(extractedRootPath) // Almost everything in extractedRootPath comes from squashFSPath. conversionCommand := fmt.Sprintf("unsquashfs -d %s -f %s && tar --acls --xattrs -C %s -cpf %s ./", extractedRootPath, squashFSPath, extractedRootPath, tarPath) script := "#!/bin/sh\n" + conversionCommand + "\n" if err := os.WriteFile(scriptPath, []byte(script), 0o755); err != nil { return err } defer os.Remove(scriptPath) // On top of squashFSPath, we only add injectedScript, if necessary. if err := writeInjectedScript(extractedRootPath, injectedScript); err != nil { return err } logrus.Debugf("Converting squashfs to tar, command: %s ...", conversionCommand) cmd := exec.CommandContext(ctx, "fakeroot", "--", scriptPath) output, err := cmd.CombinedOutput() if err != nil { return fmt.Errorf("converting image: %w, output: %s", err, string(output)) } logrus.Debugf("... finished converting squashfs to tar") return nil } // convertSIFToElements processes sifImage and creates/returns // the relevant elements for constructing an OCI-like image: // - A path to a tar file containing a root filesystem, // - A command to run. // The returned tar file path is inside tempDir, which can be assumed to be empty // at start, and is exclusively used by the current process (i.e. it is safe // to use hard-coded relative paths within it). func convertSIFToElements(ctx context.Context, sifImage *sif.FileImage, tempDir string) (string, []string, error) { // We could allocate unique names for all of these using os.{CreateTemp,MkdirTemp}, but tempDir is exclusive, // so we can just hard-code a set of unique values here. // We create and/or manage cleanup of these two paths. squashFSPath := filepath.Join(tempDir, "rootfs.squashfs") tarPath := filepath.Join(tempDir, "rootfs.tar") // We only allocate these paths, the user is responsible for cleaning them up. extractedRootPath := filepath.Join(tempDir, "rootfs") scriptPath := filepath.Join(tempDir, "script") succeeded := false // It's safe for the Remove calls to happen even before we create the files, because tempDir is exclusive // for our use. // Ideally we would remove squashFSPath immediately after creating extractedRootPath, but we need // to run both creation and consumption of extractedRootPath in the same fakeroot context. // So, overall, this process requires at least 2 compressed copies (SIF and squashFSPath) and 2 // uncompressed copies (extractedRootPath and tarPath) of the data, all using up space at the same time. // That's rather unsatisfactory, ideally we would be streaming the data directly from a squashfs parser // reading from the SIF file to a tarball, for 1 compressed and 1 uncompressed copy. defer os.Remove(squashFSPath) defer func() { if !succeeded { os.Remove(tarPath) } }() command, injectedScript, err := processDefFile(sifImage) if err != nil { return "", nil, err } rootFS, err := sifImage.GetDescriptor(sif.WithPartitionType(sif.PartPrimSys)) if err != nil { return "", nil, fmt.Errorf("looking up rootfs from SIF file: %w", err) } // TODO: We'd prefer not to make a full copy of the file here; unsquashfs ≥ 4.4 // has an -o option that allows extracting a squashfs from the SIF file directly, // but that version is not currently available in RHEL 8. logrus.Debugf("Creating a temporary squashfs image %s ...", squashFSPath) if err := func() (retErr error) { // A scope for defer f, err := os.Create(squashFSPath) if err != nil { return err } // since we are writing to this file, make sure we handle err on Close() defer func() { closeErr := f.Close() if retErr == nil { retErr = closeErr } }() // TODO: This can take quite some time, and should ideally be cancellable using ctx.Done(). if _, err := io.CopyN(f, rootFS.GetReader(), rootFS.Size()); err != nil { return err } return nil }(); err != nil { return "", nil, err } logrus.Debugf("... finished creating a temporary squashfs image") if err := createTarFromSIFInputs(ctx, tarPath, squashFSPath, injectedScript, extractedRootPath, scriptPath); err != nil { return "", nil, err } succeeded = true return tarPath, []string{command}, nil } ================================================ FILE: vendor/go.podman.io/image/v5/sif/src.go ================================================ package sif import ( "bytes" "context" "encoding/json" "errors" "fmt" "io" "os" "github.com/opencontainers/go-digest" imgspecs "github.com/opencontainers/image-spec/specs-go" imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" "github.com/sirupsen/logrus" "github.com/sylabs/sif/v2/pkg/sif" "go.podman.io/image/v5/internal/imagesource/impl" "go.podman.io/image/v5/internal/imagesource/stubs" "go.podman.io/image/v5/internal/private" "go.podman.io/image/v5/internal/tmpdir" "go.podman.io/image/v5/types" ) type sifImageSource struct { impl.Compat impl.PropertyMethodsInitialize impl.NoSignatures impl.DoesNotAffectLayerInfosForCopy stubs.NoGetBlobAtInitialize ref sifReference workDir string layerDigest digest.Digest layerSize int64 layerFile string config []byte configDigest digest.Digest manifest []byte } // getBlobInfo returns the digest, and size of the provided file. func getBlobInfo(path string) (digest.Digest, int64, error) { f, err := os.Open(path) if err != nil { return "", -1, fmt.Errorf("opening %q for reading: %w", path, err) } defer f.Close() // TODO: Instead of writing the tar file to disk, and reading // it here again, stream the tar file to a pipe and // compute the digest while writing it to disk. logrus.Debugf("Computing a digest of the SIF conversion output...") digester := digest.Canonical.Digester() // TODO: This can take quite some time, and should ideally be cancellable using ctx.Done(). size, err := io.Copy(digester.Hash(), f) if err != nil { return "", -1, fmt.Errorf("reading %q: %w", path, err) } digest := digester.Digest() logrus.Debugf("... finished computing the digest of the SIF conversion output") return digest, size, nil } // newImageSource returns an ImageSource for reading from an existing directory. // newImageSource extracts SIF objects and saves them in a temp directory. func newImageSource(ctx context.Context, sys *types.SystemContext, ref sifReference) (private.ImageSource, error) { sifImg, err := sif.LoadContainerFromPath(ref.file, sif.OptLoadWithFlag(os.O_RDONLY)) if err != nil { return nil, fmt.Errorf("loading SIF file: %w", err) } defer func() { _ = sifImg.UnloadContainer() }() workDir, err := tmpdir.MkDirBigFileTemp(sys, "sif") if err != nil { return nil, fmt.Errorf("creating temp directory: %w", err) } succeeded := false defer func() { if !succeeded { os.RemoveAll(workDir) } }() layerPath, commandLine, err := convertSIFToElements(ctx, sifImg, workDir) if err != nil { return nil, fmt.Errorf("converting rootfs from SquashFS to Tarball: %w", err) } layerDigest, layerSize, err := getBlobInfo(layerPath) if err != nil { return nil, fmt.Errorf("gathering blob information: %w", err) } created := sifImg.ModifiedAt() config := imgspecv1.Image{ Created: &created, Platform: imgspecv1.Platform{ Architecture: sifImg.PrimaryArch(), OS: "linux", }, Config: imgspecv1.ImageConfig{ Cmd: commandLine, }, RootFS: imgspecv1.RootFS{ Type: "layers", DiffIDs: []digest.Digest{layerDigest}, }, History: []imgspecv1.History{ { Created: &created, CreatedBy: fmt.Sprintf("/bin/sh -c #(nop) ADD file:%s in %c", layerDigest.Encoded(), os.PathSeparator), Comment: "imported from SIF, uuid: " + sifImg.ID(), }, { Created: &created, CreatedBy: "/bin/sh -c #(nop) CMD [\"bash\"]", EmptyLayer: true, }, }, } configBytes, err := json.Marshal(&config) if err != nil { return nil, fmt.Errorf("generating configuration blob for %q: %w", ref.resolvedFile, err) } configDigest := digest.Canonical.FromBytes(configBytes) manifest := imgspecv1.Manifest{ Versioned: imgspecs.Versioned{SchemaVersion: 2}, MediaType: imgspecv1.MediaTypeImageManifest, Config: imgspecv1.Descriptor{ Digest: configDigest, Size: int64(len(configBytes)), MediaType: imgspecv1.MediaTypeImageConfig, }, Layers: []imgspecv1.Descriptor{{ Digest: layerDigest, Size: layerSize, MediaType: imgspecv1.MediaTypeImageLayer, }}, } manifestBytes, err := json.Marshal(&manifest) if err != nil { return nil, fmt.Errorf("generating manifest for %q: %w", ref.resolvedFile, err) } succeeded = true s := &sifImageSource{ PropertyMethodsInitialize: impl.PropertyMethods(impl.Properties{ HasThreadSafeGetBlob: true, }), NoGetBlobAtInitialize: stubs.NoGetBlobAt(ref), ref: ref, workDir: workDir, layerDigest: layerDigest, layerSize: layerSize, layerFile: layerPath, config: configBytes, configDigest: configDigest, manifest: manifestBytes, } s.Compat = impl.AddCompat(s) return s, nil } // Reference returns the reference used to set up this source. func (s *sifImageSource) Reference() types.ImageReference { return s.ref } // Close removes resources associated with an initialized ImageSource, if any. func (s *sifImageSource) Close() error { return os.RemoveAll(s.workDir) } // GetBlob returns a stream for the specified blob, and the blob’s size (or -1 if unknown). // The Digest field in BlobInfo is guaranteed to be provided, Size may be -1 and MediaType may be optionally provided. // May update BlobInfoCache, preferably after it knows for certain that a blob truly exists at a specific location. func (s *sifImageSource) GetBlob(ctx context.Context, info types.BlobInfo, cache types.BlobInfoCache) (io.ReadCloser, int64, error) { switch info.Digest { case s.configDigest: return io.NopCloser(bytes.NewReader(s.config)), int64(len(s.config)), nil case s.layerDigest: reader, err := os.Open(s.layerFile) if err != nil { return nil, -1, fmt.Errorf("opening %q: %w", s.layerFile, err) } return reader, s.layerSize, nil default: return nil, -1, fmt.Errorf("no blob with digest %q found", info.Digest.String()) } } // GetManifest returns the image's manifest along with its MIME type (which may be empty when it can't be determined but the manifest is available). // It may use a remote (= slow) service. // If instanceDigest is not nil, it contains a digest of the specific manifest instance to retrieve (when the primary manifest is a manifest list); // this never happens if the primary manifest is not a manifest list (e.g. if the source never returns manifest lists). func (s *sifImageSource) GetManifest(ctx context.Context, instanceDigest *digest.Digest) ([]byte, string, error) { if instanceDigest != nil { return nil, "", errors.New("manifest lists are not supported by the sif transport") } return s.manifest, imgspecv1.MediaTypeImageManifest, nil } ================================================ FILE: vendor/go.podman.io/image/v5/sif/transport.go ================================================ package sif import ( "context" "errors" "fmt" "path/filepath" "strings" "go.podman.io/image/v5/directory/explicitfilepath" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/internal/image" "go.podman.io/image/v5/transports" "go.podman.io/image/v5/types" ) func init() { transports.Register(Transport) } // Transport is an ImageTransport for SIF images. var Transport = sifTransport{} type sifTransport struct{} func (t sifTransport) Name() string { return "sif" } // ParseReference converts a string, which should not start with the ImageTransport.Name prefix, into an ImageReference. func (t sifTransport) ParseReference(reference string) (types.ImageReference, error) { return NewReference(reference) } // ValidatePolicyConfigurationScope checks that scope is a valid name for a signature.PolicyTransportScopes keys // (i.e. a valid PolicyConfigurationIdentity() or PolicyConfigurationNamespaces() return value). // It is acceptable to allow an invalid value which will never be matched, it can "only" cause user confusion. // scope passed to this function will not be "", that value is always allowed. func (t sifTransport) ValidatePolicyConfigurationScope(scope string) error { if !strings.HasPrefix(scope, "/") { return fmt.Errorf("Invalid scope %s: Must be an absolute path", scope) } // Refuse also "/", otherwise "/" and "" would have the same semantics, // and "" could be unexpectedly shadowed by the "/" entry. if scope == "/" { return errors.New(`Invalid scope "/": Use the generic default scope ""`) } cleaned := filepath.Clean(scope) if cleaned != scope { return fmt.Errorf(`Invalid scope %s: Uses non-canonical format, perhaps try %s`, scope, cleaned) } return nil } // sifReference is an ImageReference for SIF images. type sifReference struct { // Note that the interpretation of paths below depends on the underlying filesystem state, which may change under us at any time! // Either of the paths may point to a different, or no, inode over time. resolvedFile may contain symbolic links, and so on. // Generally we follow the intent of the user, and use the "file" member for filesystem operations (e.g. the user can use a relative path to avoid // being exposed to symlinks and renames in the parent directories to the working directory). // (But in general, we make no attempt to be completely safe against concurrent hostile filesystem modifications.) file string // As specified by the user. May be relative, contain symlinks, etc. resolvedFile string // Absolute file path with no symlinks, at least at the time of its creation. Primarily used for policy namespaces. } // There is no sif.ParseReference because it is rather pointless. // Callers who need a transport-independent interface will go through // sifTransport.ParseReference; callers who intentionally deal with SIF files // can use sif.NewReference. // NewReference returns an image file reference for a specified path. func NewReference(file string) (types.ImageReference, error) { // We do not expose an API supplying the resolvedFile; we could, but recomputing it // is generally cheap enough that we prefer being confident about the properties of resolvedFile. resolved, err := explicitfilepath.ResolvePathToFullyExplicit(file) if err != nil { return nil, err } return sifReference{file: file, resolvedFile: resolved}, nil } func (ref sifReference) Transport() types.ImageTransport { return Transport } // StringWithinTransport returns a string representation of the reference, which MUST be such that // reference.Transport().ParseReference(reference.StringWithinTransport()) returns an equivalent reference. // NOTE: The returned string is not promised to be equal to the original input to ParseReference; // e.g. default attribute values omitted by the user may be filled in the return value, or vice versa. // WARNING: Do not use the return value in the UI to describe an image, it does not contain the Transport().Name() prefix; // instead, see transports.ImageName(). func (ref sifReference) StringWithinTransport() string { return ref.file } // DockerReference returns a Docker reference associated with this reference // (fully explicit, i.e. !reference.IsNameOnly, but reflecting user intent, // not e.g. after redirect or alias processing), or nil if unknown/not applicable. func (ref sifReference) DockerReference() reference.Named { return nil } // PolicyConfigurationIdentity returns a string representation of the reference, suitable for policy lookup. // This MUST reflect user intent, not e.g. after processing of third-party redirects or aliases; // The value SHOULD be fully explicit about its semantics, with no hidden defaults, AND canonical // (i.e. various references with exactly the same semantics should return the same configuration identity) // It is fine for the return value to be equal to StringWithinTransport(), and it is desirable but // not required/guaranteed that it will be a valid input to Transport().ParseReference(). // Returns "" if configuration identities for these references are not supported. func (ref sifReference) PolicyConfigurationIdentity() string { return ref.resolvedFile } // PolicyConfigurationNamespaces returns a list of other policy configuration namespaces to search // for if explicit configuration for PolicyConfigurationIdentity() is not set. The list will be processed // in order, terminating on first match, and an implicit "" is always checked at the end. // It is STRONGLY recommended for the first element, if any, to be a prefix of PolicyConfigurationIdentity(), // and each following element to be a prefix of the element preceding it. func (ref sifReference) PolicyConfigurationNamespaces() []string { res := []string{} path := ref.resolvedFile for { lastSlash := strings.LastIndex(path, "/") if lastSlash == -1 || lastSlash == 0 { break } path = path[:lastSlash] res = append(res, path) } // Note that we do not include "/"; it is redundant with the default "" global default, // and rejected by sifTransport.ValidatePolicyConfigurationScope above. return res } // NewImage returns a types.ImageCloser for this reference, possibly specialized for this ImageTransport. // The caller must call .Close() on the returned ImageCloser. // NOTE: If any kind of signature verification should happen, build an UnparsedImage from the value returned by NewImageSource, // verify that UnparsedImage, and convert it into a real Image via image.FromUnparsedImage. // WARNING: This may not do the right thing for a manifest list, see image.FromSource for details. func (ref sifReference) NewImage(ctx context.Context, sys *types.SystemContext) (types.ImageCloser, error) { return image.FromReference(ctx, sys, ref) } // NewImageSource returns a types.ImageSource for this reference. // The caller must call .Close() on the returned ImageSource. func (ref sifReference) NewImageSource(ctx context.Context, sys *types.SystemContext) (types.ImageSource, error) { return newImageSource(ctx, sys, ref) } // NewImageDestination returns a types.ImageDestination for this reference. // The caller must call .Close() on the returned ImageDestination. func (ref sifReference) NewImageDestination(ctx context.Context, sys *types.SystemContext) (types.ImageDestination, error) { return nil, errors.New(`"sif:" locations can only be read from, not written to`) } // DeleteImage deletes the named image from the registry, if supported. func (ref sifReference) DeleteImage(ctx context.Context, sys *types.SystemContext) error { return errors.New("Deleting images not implemented for sif: images") } ================================================ FILE: vendor/go.podman.io/image/v5/signature/docker.go ================================================ // Note: Consider the API unstable until the code supports at least three different image formats or transports. package signature import ( "errors" "fmt" "strings" "github.com/opencontainers/go-digest" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/manifest" "go.podman.io/image/v5/signature/internal" ) // SignOptions includes optional parameters for signing container images. type SignOptions struct { // Passphare to use when signing with the key identity. Passphrase string } // SignDockerManifest returns a signature for manifest as the specified dockerReference, // using mech and keyIdentity, and the specified options. func SignDockerManifestWithOptions(m []byte, dockerReference string, mech SigningMechanism, keyIdentity string, options *SignOptions) ([]byte, error) { manifestDigest, err := manifest.Digest(m) if err != nil { return nil, err } sig := newUntrustedSignature(manifestDigest, dockerReference) var passphrase string if options != nil { passphrase = options.Passphrase // The gpgme implementation can’t use passphrase with \n; reject it here for consistent behavior. if strings.Contains(passphrase, "\n") { return nil, errors.New("invalid passphrase: must not contain a line break") } } return sig.sign(mech, keyIdentity, passphrase) } // SignDockerManifest returns a signature for manifest as the specified dockerReference, // using mech and keyIdentity. func SignDockerManifest(m []byte, dockerReference string, mech SigningMechanism, keyIdentity string) ([]byte, error) { return SignDockerManifestWithOptions(m, dockerReference, mech, keyIdentity, nil) } // VerifyDockerManifestSignature checks that unverifiedSignature uses expectedKeyIdentity to sign unverifiedManifest as expectedDockerReference, // using mech. func VerifyDockerManifestSignature(unverifiedSignature, unverifiedManifest []byte, expectedDockerReference string, mech SigningMechanism, expectedKeyIdentity string, ) (*Signature, error) { sig, _, err := VerifyImageManifestSignatureUsingKeyIdentityList(unverifiedSignature, unverifiedManifest, expectedDockerReference, mech, []string{expectedKeyIdentity}) return sig, err } // VerifyImageManifestSignatureUsingKeyIdentityList checks that unverifiedSignature uses one of the expectedKeyIdentities // to sign unverifiedManifest as expectedDockerReference, using mech. Returns the verified signature and the key identity that // was used to verify it. func VerifyImageManifestSignatureUsingKeyIdentityList(unverifiedSignature, unverifiedManifest []byte, expectedDockerReference string, mech SigningMechanism, expectedKeyIdentities []string, ) (*Signature, string, error) { expectedRef, err := reference.ParseNormalizedNamed(expectedDockerReference) if err != nil { return nil, "", err } sig, matchedKeyIdentity, err := verifyAndExtractSignature(mech, unverifiedSignature, signatureAcceptanceRules{ acceptedKeyIdentities: expectedKeyIdentities, validateSignedDockerReference: func(signedDockerReference string) error { signedRef, err := reference.ParseNormalizedNamed(signedDockerReference) if err != nil { return internal.NewInvalidSignatureError(fmt.Sprintf("Invalid docker reference %q in signature", signedDockerReference)) } if signedRef.String() != expectedRef.String() { return internal.NewInvalidSignatureError(fmt.Sprintf("Docker reference %q does not match %q", signedDockerReference, expectedDockerReference)) } return nil }, validateSignedDockerManifestDigest: func(signedDockerManifestDigest digest.Digest) error { matches, err := manifest.MatchesDigest(unverifiedManifest, signedDockerManifestDigest) if err != nil { return err } if !matches { return internal.NewInvalidSignatureError(fmt.Sprintf("Signature for docker digest %q does not match", signedDockerManifestDigest)) } return nil }, }) if err != nil { return nil, "", err } return sig, matchedKeyIdentity, err } ================================================ FILE: vendor/go.podman.io/image/v5/signature/fulcio_cert.go ================================================ package signature import ( "crypto" "crypto/ecdsa" "crypto/x509" "encoding/asn1" "errors" "fmt" "slices" "time" "github.com/sigstore/fulcio/pkg/certificate" "github.com/sigstore/sigstore/pkg/cryptoutils" "go.podman.io/image/v5/signature/internal" ) // fulcioTrustRoot contains policy allow validating Fulcio-issued certificates. // Users should call validate() on the policy before using it. type fulcioTrustRoot struct { caCertificates *x509.CertPool oidcIssuer string subjectEmail string } func (f *fulcioTrustRoot) validate() error { if f.oidcIssuer == "" { return errors.New("Internal inconsistency: Fulcio use set up without OIDC issuer") } if f.subjectEmail == "" { return errors.New("Internal inconsistency: Fulcio use set up without subject email") } return nil } // fulcioIssuerInCertificate returns the OIDC issuer recorded by Fulcio in unutrustedCertificate; // it fails if the extension is not present in the certificate, or on any inconsistency. func fulcioIssuerInCertificate(untrustedCertificate *x509.Certificate) (string, error) { // == Validate the recorded OIDC issuer gotOIDCIssuer1 := false gotOIDCIssuer2 := false var oidcIssuer1, oidcIssuer2 string // certificate.ParseExtensions doesn’t reject duplicate extensions, and doesn’t detect inconsistencies // between certificate.OIDIssuer and certificate.OIDIssuerV2. // Go 1.19 rejects duplicate extensions universally; but until we can require Go 1.19, // reject duplicates manually. for _, untrustedExt := range untrustedCertificate.Extensions { if untrustedExt.Id.Equal(certificate.OIDIssuer) { //nolint:staticcheck // This is deprecated, but we must continue to accept it. if gotOIDCIssuer1 { // Coverage: This is unreachable in Go ≥1.19, which rejects certificates with duplicate extensions // already in ParseCertificate. return "", internal.NewInvalidSignatureError("Fulcio certificate has a duplicate OIDC issuer v1 extension") } oidcIssuer1 = string(untrustedExt.Value) gotOIDCIssuer1 = true } else if untrustedExt.Id.Equal(certificate.OIDIssuerV2) { if gotOIDCIssuer2 { // Coverage: This is unreachable in Go ≥1.19, which rejects certificates with duplicate extensions // already in ParseCertificate. return "", internal.NewInvalidSignatureError("Fulcio certificate has a duplicate OIDC issuer v2 extension") } rest, err := asn1.Unmarshal(untrustedExt.Value, &oidcIssuer2) if err != nil { return "", internal.NewInvalidSignatureError(fmt.Sprintf("invalid ASN.1 in OIDC issuer v2 extension: %v", err)) } if len(rest) != 0 { return "", internal.NewInvalidSignatureError("invalid ASN.1 in OIDC issuer v2 extension, trailing data") } gotOIDCIssuer2 = true } } switch { case gotOIDCIssuer1 && gotOIDCIssuer2: if oidcIssuer1 != oidcIssuer2 { return "", internal.NewInvalidSignatureError(fmt.Sprintf("inconsistent OIDC issuer extension values: v1 %#v, v2 %#v", oidcIssuer1, oidcIssuer2)) } return oidcIssuer1, nil case gotOIDCIssuer1: return oidcIssuer1, nil case gotOIDCIssuer2: return oidcIssuer2, nil default: return "", internal.NewInvalidSignatureError("Fulcio certificate is missing the issuer extension") } } func (f *fulcioTrustRoot) verifyFulcioCertificateAtTime(relevantTime time.Time, untrustedCertificateBytes []byte, untrustedIntermediateChainBytes []byte) (crypto.PublicKey, error) { // == Verify the certificate is correctly signed var untrustedIntermediatePool *x509.CertPool // = nil // untrustedCertificateChainPool.AppendCertsFromPEM does something broadly similar, // but it seems to optimize for memory usage at the cost of larger CPU usage (i.e. to load // the hundreds of trusted CAs). Golang’s TLS code similarly calls individual AddCert // for intermediate certificates. if len(untrustedIntermediateChainBytes) > 0 { untrustedIntermediateChain, err := cryptoutils.UnmarshalCertificatesFromPEM(untrustedIntermediateChainBytes) if err != nil { return nil, internal.NewInvalidSignatureError(fmt.Sprintf("loading certificate chain: %v", err)) } untrustedIntermediatePool = x509.NewCertPool() if len(untrustedIntermediateChain) > 1 { for _, untrustedIntermediateCert := range untrustedIntermediateChain[:len(untrustedIntermediateChain)-1] { untrustedIntermediatePool.AddCert(untrustedIntermediateCert) } } } untrustedCertificate, err := parseLeafCertFromPEM(untrustedCertificateBytes) if err != nil { return nil, err } // Go rejects Subject Alternative Name that has no DNSNames, EmailAddresses, IPAddresses and URIs; // we match SAN ourselves, so override that. if len(untrustedCertificate.UnhandledCriticalExtensions) > 0 { var remaining []asn1.ObjectIdentifier for _, oid := range untrustedCertificate.UnhandledCriticalExtensions { if !oid.Equal(cryptoutils.SANOID) { remaining = append(remaining, oid) } } untrustedCertificate.UnhandledCriticalExtensions = remaining } if _, err := untrustedCertificate.Verify(x509.VerifyOptions{ Intermediates: untrustedIntermediatePool, Roots: f.caCertificates, // NOTE: Cosign uses untrustedCertificate.NotBefore here (i.e. uses _that_ time for intermediate certificate validation), // and validates the leaf certificate against relevantTime manually. // We verify the full certificate chain against relevantTime instead. // Assuming the certificate is fulcio-generated and very short-lived, that should make little difference. CurrentTime: relevantTime, KeyUsages: []x509.ExtKeyUsage{x509.ExtKeyUsageCodeSigning}, }); err != nil { return nil, internal.NewInvalidSignatureError(fmt.Sprintf("veryfing leaf certificate failed: %v", err)) } // Cosign verifies a SCT of the certificate (either embedded, or even, probably irrelevant, externally-supplied). // // We don’t currently do that. // // At the very least, with Fulcio we require Rekor SETs to prove Rekor contains a log of the signature, and that // already contains the full certificate; so a SCT of the certificate is superfluous (assuming Rekor allowed searching by // certificate subject, which, well…). That argument might go away if we add support for RFC 3161 timestamps instead of Rekor. // // Secondarily, assuming a trusted Fulcio server (which, to be fair, might not be the case for the public one) SCT is not clearly // better than the Fulcio server maintaining an audit log; a SCT can only reveal a misissuance if there is some other authoritative // log of approved Fulcio invocations, and it’s not clear where that would come from, especially human users manually // logging in using OpenID are not going to maintain a record of those actions. // // Also, the SCT does not help reveal _what_ was maliciously signed, nor does it protect against malicious signatures // by correctly-issued certificates. // // So, pragmatically, the ideal design seem to be to only do signatures from a trusted build system (which is, by definition, // the arbiter of desired vs. malicious signatures) that maintains an audit log of performed signature operations; and that seems to // make the SCT (and all of Rekor apart from the trusted timestamp) unnecessary. // == Validate the recorded OIDC issuer oidcIssuer, err := fulcioIssuerInCertificate(untrustedCertificate) if err != nil { return nil, err } if oidcIssuer != f.oidcIssuer { return nil, internal.NewInvalidSignatureError(fmt.Sprintf("Unexpected Fulcio OIDC issuer %q", oidcIssuer)) } // == Validate the OIDC subject if !slices.Contains(untrustedCertificate.EmailAddresses, f.subjectEmail) { return nil, internal.NewInvalidSignatureError(fmt.Sprintf("Required email %q not found (got %q)", f.subjectEmail, untrustedCertificate.EmailAddresses)) } // FIXME: Match more subject types? Cosign does: // - .DNSNames (can’t be issued by Fulcio) // - .IPAddresses (can’t be issued by Fulcio) // - .URIs (CAN be issued by Fulcio) // - OtherName values in SAN (CAN be issued by Fulcio) // - Various values about GitHub workflows (CAN be issued by Fulcio) // What does it… mean to get an OAuth2 identity for an IP address? // FIXME: How far into Turing-completeness for the issuer/subject do we need to get? Simultaneously accepted alternatives, for // issuers and/or subjects and/or combinations? Regexps? More? return untrustedCertificate.PublicKey, nil } func parseLeafCertFromPEM(untrustedCertificateBytes []byte) (*x509.Certificate, error) { untrustedLeafCerts, err := cryptoutils.UnmarshalCertificatesFromPEM(untrustedCertificateBytes) if err != nil { return nil, internal.NewInvalidSignatureError(fmt.Sprintf("parsing leaf certificate: %v", err)) } switch len(untrustedLeafCerts) { case 0: return nil, internal.NewInvalidSignatureError("no certificate found in signature certificate data") case 1: // OK return untrustedLeafCerts[0], nil default: return nil, internal.NewInvalidSignatureError("unexpected multiple certificates present in signature certificate data") } } func verifyRekorFulcio(rekorPublicKeys []*ecdsa.PublicKey, fulcioTrustRoot *fulcioTrustRoot, untrustedRekorSET []byte, untrustedCertificateBytes []byte, untrustedIntermediateChainBytes []byte, untrustedBase64Signature string, untrustedPayloadBytes []byte, ) (crypto.PublicKey, error) { rekorSETTime, err := internal.VerifyRekorSET(rekorPublicKeys, untrustedRekorSET, untrustedCertificateBytes, untrustedBase64Signature, untrustedPayloadBytes) if err != nil { return nil, err } return fulcioTrustRoot.verifyFulcioCertificateAtTime(rekorSETTime, untrustedCertificateBytes, untrustedIntermediateChainBytes) } ================================================ FILE: vendor/go.podman.io/image/v5/signature/internal/errors.go ================================================ package internal // InvalidSignatureError is returned when parsing an invalid signature. // This is publicly visible as signature.InvalidSignatureError type InvalidSignatureError struct { msg string } func (err InvalidSignatureError) Error() string { return err.msg } func NewInvalidSignatureError(msg string) InvalidSignatureError { return InvalidSignatureError{msg: msg} } // JSONFormatToInvalidSignatureError converts JSONFormatError to InvalidSignatureError. // All other errors are returned as is. func JSONFormatToInvalidSignatureError(err error) error { if formatErr, ok := err.(JSONFormatError); ok { err = NewInvalidSignatureError(formatErr.Error()) } return err } ================================================ FILE: vendor/go.podman.io/image/v5/signature/internal/json.go ================================================ package internal import ( "bytes" "encoding/json" "fmt" "io" "go.podman.io/image/v5/internal/set" ) // JSONFormatError is returned when JSON does not match expected format. type JSONFormatError string func (err JSONFormatError) Error() string { return string(err) } // ParanoidUnmarshalJSONObject unmarshals data as a JSON object, but failing on the slightest unexpected aspect // (including duplicated keys, unrecognized keys, and non-matching types). Uses fieldResolver to // determine the destination for a field value, which should return a pointer to the destination if valid, or nil if the key is rejected. // // The fieldResolver approach is useful for decoding the Policy.Transports map; using it for structs is a bit lazy, // we could use reflection to automate this. Later? func ParanoidUnmarshalJSONObject(data []byte, fieldResolver func(string) any) error { seenKeys := set.New[string]() dec := json.NewDecoder(bytes.NewReader(data)) t, err := dec.Token() if err != nil { return JSONFormatError(err.Error()) } if t != json.Delim('{') { return JSONFormatError(fmt.Sprintf("JSON object expected, got %#v", t)) } for { t, err := dec.Token() if err != nil { return JSONFormatError(err.Error()) } if t == json.Delim('}') { break } key, ok := t.(string) if !ok { // Coverage: This should never happen, dec.Token() rejects non-string-literals in this state. return JSONFormatError(fmt.Sprintf("Key string literal expected, got %#v", t)) } if seenKeys.Contains(key) { return JSONFormatError(fmt.Sprintf("Duplicate key %q", key)) } seenKeys.Add(key) valuePtr := fieldResolver(key) if valuePtr == nil { return JSONFormatError(fmt.Sprintf("Unknown key %q", key)) } // This works like json.Unmarshal, in particular it allows us to implement UnmarshalJSON to implement strict parsing of the field value. if err := dec.Decode(valuePtr); err != nil { return JSONFormatError(err.Error()) } } if _, err := dec.Token(); err != io.EOF { return JSONFormatError("Unexpected data after JSON object") } return nil } // ParanoidUnmarshalJSONObjectExactFields unmarshals data as a JSON object, but failing on the slightest unexpected aspect // (including duplicated keys, unrecognized keys, and non-matching types). Each of the fields in exactFields // must be present exactly once, and none other fields are accepted. func ParanoidUnmarshalJSONObjectExactFields(data []byte, exactFields map[string]any) error { seenKeys := set.New[string]() if err := ParanoidUnmarshalJSONObject(data, func(key string) any { if valuePtr, ok := exactFields[key]; ok { seenKeys.Add(key) return valuePtr } return nil }); err != nil { return err } for key := range exactFields { if !seenKeys.Contains(key) { return JSONFormatError(fmt.Sprintf(`Key %q missing in a JSON object`, key)) } } return nil } ================================================ FILE: vendor/go.podman.io/image/v5/signature/internal/rekor_api_types.go ================================================ package internal import ( "bytes" "encoding/json" "fmt" ) const rekorHashedrekordKind = "hashedrekord" type RekorHashedrekord struct { APIVersion *string `json:"apiVersion"` Spec json.RawMessage `json:"spec"` } func (m *RekorHashedrekord) Kind() string { return rekorHashedrekordKind } func (m *RekorHashedrekord) SetKind(val string) { } func (m *RekorHashedrekord) UnmarshalJSON(raw []byte) error { var base struct { Kind string `json:"kind"` } dec := json.NewDecoder(bytes.NewReader(raw)) dec.UseNumber() if err := dec.Decode(&base); err != nil { return err } switch base.Kind { case rekorHashedrekordKind: var data struct { // We can’t use RekorHashedRekord directly, because that would be an infinite recursion. APIVersion *string `json:"apiVersion"` Spec json.RawMessage `json:"spec"` } dec = json.NewDecoder(bytes.NewReader(raw)) dec.UseNumber() if err := dec.Decode(&data); err != nil { return err } res := RekorHashedrekord{ APIVersion: data.APIVersion, Spec: data.Spec, } *m = res return nil default: return fmt.Errorf("invalid kind value: %q", base.Kind) } } func (m RekorHashedrekord) MarshalJSON() ([]byte, error) { return json.Marshal(struct { Kind string `json:"kind"` APIVersion *string `json:"apiVersion"` Spec json.RawMessage `json:"spec"` }{ Kind: m.Kind(), APIVersion: m.APIVersion, Spec: m.Spec, }) } type RekorHashedrekordV001Schema struct { Data *RekorHashedrekordV001SchemaData `json:"data"` Signature *RekorHashedrekordV001SchemaSignature `json:"signature"` } type RekorHashedrekordV001SchemaData struct { Hash *RekorHashedrekordV001SchemaDataHash `json:"hash,omitempty"` } type RekorHashedrekordV001SchemaDataHash struct { Algorithm *string `json:"algorithm"` Value *string `json:"value"` } const ( RekorHashedrekordV001SchemaDataHashAlgorithmSha256 string = "sha256" RekorHashedrekordV001SchemaDataHashAlgorithmSha384 string = "sha384" RekorHashedrekordV001SchemaDataHashAlgorithmSha512 string = "sha512" ) type RekorHashedrekordV001SchemaSignature struct { Content []byte `json:"content,omitempty"` PublicKey *RekorHashedrekordV001SchemaSignaturePublicKey `json:"publicKey,omitempty"` } type RekorHashedrekordV001SchemaSignaturePublicKey struct { Content []byte `json:"content,omitempty"` } ================================================ FILE: vendor/go.podman.io/image/v5/signature/internal/rekor_set.go ================================================ package internal import ( "bytes" "crypto/ecdsa" "crypto/sha256" "encoding/base64" "encoding/hex" "encoding/json" "encoding/pem" "fmt" "time" "github.com/cyberphone/json-canonicalization/go/src/webpki.org/jsoncanonicalizer" ) // This is the github.com/sigstore/rekor/pkg/generated/models.Hashedrekord.APIVersion for github.com/sigstore/rekor/pkg/generated/models.HashedrekordV001Schema. // We could alternatively use github.com/sigstore/rekor/pkg/types/hashedrekord.APIVERSION, but that subpackage adds too many dependencies. const RekorHashedRekordV001APIVersion = "0.0.1" // UntrustedRekorSET is a parsed content of the sigstore-signature Rekor SET // (note that this a signature-specific format, not a format directly used by the Rekor API). // This corresponds to github.com/sigstore/cosign/bundle.RekorBundle, but we impose a stricter decoder. type UntrustedRekorSET struct { UntrustedSignedEntryTimestamp []byte // A signature over some canonical JSON form of UntrustedPayload UntrustedPayload json.RawMessage } type UntrustedRekorPayload struct { Body []byte // In cosign, this is an any, but only a string works IntegratedTime int64 LogIndex int64 LogID string } // A compile-time check that UntrustedRekorSET implements json.Unmarshaler var _ json.Unmarshaler = (*UntrustedRekorSET)(nil) // UnmarshalJSON implements the json.Unmarshaler interface func (s *UntrustedRekorSET) UnmarshalJSON(data []byte) error { return JSONFormatToInvalidSignatureError(s.strictUnmarshalJSON(data)) } // strictUnmarshalJSON is UnmarshalJSON, except that it may return the internal JSONFormatError error type. // Splitting it into a separate function allows us to do the JSONFormatError → InvalidSignatureError in a single place, the caller. func (s *UntrustedRekorSET) strictUnmarshalJSON(data []byte) error { return ParanoidUnmarshalJSONObjectExactFields(data, map[string]any{ "SignedEntryTimestamp": &s.UntrustedSignedEntryTimestamp, "Payload": &s.UntrustedPayload, }) } // A compile-time check that UntrustedRekorSET and *UntrustedRekorSET implements json.Marshaler var ( _ json.Marshaler = UntrustedRekorSET{} _ json.Marshaler = (*UntrustedRekorSET)(nil) ) // MarshalJSON implements the json.Marshaler interface. func (s UntrustedRekorSET) MarshalJSON() ([]byte, error) { return json.Marshal(map[string]any{ "SignedEntryTimestamp": s.UntrustedSignedEntryTimestamp, "Payload": s.UntrustedPayload, }) } // A compile-time check that UntrustedRekorPayload implements json.Unmarshaler var _ json.Unmarshaler = (*UntrustedRekorPayload)(nil) // UnmarshalJSON implements the json.Unmarshaler interface func (p *UntrustedRekorPayload) UnmarshalJSON(data []byte) error { return JSONFormatToInvalidSignatureError(p.strictUnmarshalJSON(data)) } // strictUnmarshalJSON is UnmarshalJSON, except that it may return the internal JSONFormatError error type. // Splitting it into a separate function allows us to do the JSONFormatError → InvalidSignatureError in a single place, the caller. func (p *UntrustedRekorPayload) strictUnmarshalJSON(data []byte) error { return ParanoidUnmarshalJSONObjectExactFields(data, map[string]any{ "body": &p.Body, "integratedTime": &p.IntegratedTime, "logIndex": &p.LogIndex, "logID": &p.LogID, }) } // A compile-time check that UntrustedRekorPayload and *UntrustedRekorPayload implements json.Marshaler var ( _ json.Marshaler = UntrustedRekorPayload{} _ json.Marshaler = (*UntrustedRekorPayload)(nil) ) // MarshalJSON implements the json.Marshaler interface. func (p UntrustedRekorPayload) MarshalJSON() ([]byte, error) { return json.Marshal(map[string]any{ "body": p.Body, "integratedTime": p.IntegratedTime, "logIndex": p.LogIndex, "logID": p.LogID, }) } // VerifyRekorSET verifies that unverifiedRekorSET is correctly signed by publicKey and matches the rest of the data. // Returns bundle upload time on success. func VerifyRekorSET(publicKeys []*ecdsa.PublicKey, unverifiedRekorSET []byte, unverifiedKeyOrCertBytes []byte, unverifiedBase64Signature string, unverifiedPayloadBytes []byte) (time.Time, error) { // FIXME: Should the publicKey parameter hard-code ecdsa? // == Parse SET bytes var untrustedSET UntrustedRekorSET // Sadly. we need to parse and transform untrusted data before verifying a cryptographic signature... if err := json.Unmarshal(unverifiedRekorSET, &untrustedSET); err != nil { return time.Time{}, NewInvalidSignatureError(err.Error()) } // == Verify SET signature // Cosign unmarshals and re-marshals UntrustedPayload; that seems unnecessary, // assuming jsoncanonicalizer is designed to operate on untrusted data. untrustedSETPayloadCanonicalBytes, err := jsoncanonicalizer.Transform(untrustedSET.UntrustedPayload) if err != nil { return time.Time{}, NewInvalidSignatureError(fmt.Sprintf("canonicalizing Rekor SET JSON: %v", err)) } untrustedSETPayloadHash := sha256.Sum256(untrustedSETPayloadCanonicalBytes) publicKeymatched := false for _, pk := range publicKeys { if ecdsa.VerifyASN1(pk, untrustedSETPayloadHash[:], untrustedSET.UntrustedSignedEntryTimestamp) { publicKeymatched = true break } } if !publicKeymatched { return time.Time{}, NewInvalidSignatureError("cryptographic signature verification of Rekor SET failed") } // == Parse SET payload // Parse the cryptographically-verified canonicalized variant, NOT the originally-delivered representation, // to decrease risk of exploiting the JSON parser. Note that if there were an arbitrary execution vulnerability, the attacker // could have exploited the parsing of unverifiedRekorSET above already; so this, at best, ensures more consistent processing // of the SET payload. var rekorPayload UntrustedRekorPayload if err := json.Unmarshal(untrustedSETPayloadCanonicalBytes, &rekorPayload); err != nil { return time.Time{}, NewInvalidSignatureError(fmt.Sprintf("parsing Rekor SET payload: %v", err.Error())) } // FIXME: Consider being much more strict about decoding JSON. var hashedRekord RekorHashedrekord if err := json.Unmarshal(rekorPayload.Body, &hashedRekord); err != nil { return time.Time{}, NewInvalidSignatureError(fmt.Sprintf("decoding the body of a Rekor SET payload: %v", err)) } // The decode of HashedRekord validates the "kind": "hashedrecord" field, which is otherwise invisible to us. if hashedRekord.APIVersion == nil { return time.Time{}, NewInvalidSignatureError("missing Rekor SET Payload API version") } if *hashedRekord.APIVersion != RekorHashedRekordV001APIVersion { return time.Time{}, NewInvalidSignatureError(fmt.Sprintf("unsupported Rekor SET Payload hashedrekord version %#v", hashedRekord.APIVersion)) } var hashedRekordV001 RekorHashedrekordV001Schema if err := json.Unmarshal(hashedRekord.Spec, &hashedRekordV001); err != nil { return time.Time{}, NewInvalidSignatureError(fmt.Sprintf("decoding hashedrekod spec: %v", err)) } // == Match unverifiedKeyOrCertBytes if hashedRekordV001.Signature == nil { return time.Time{}, NewInvalidSignatureError(`Missing "signature" field in hashedrekord`) } if hashedRekordV001.Signature.PublicKey == nil { return time.Time{}, NewInvalidSignatureError(`Missing "signature.publicKey" field in hashedrekord`) } rekorKeyOrCertPEM, rest := pem.Decode(hashedRekordV001.Signature.PublicKey.Content) if rekorKeyOrCertPEM == nil { return time.Time{}, NewInvalidSignatureError("publicKey in Rekor SET is not in PEM format") } if len(rest) != 0 { return time.Time{}, NewInvalidSignatureError("publicKey in Rekor SET has trailing data") } // FIXME: For public keys, let the caller provide the DER-formatted blob instead // of round-tripping through PEM. unverifiedKeyOrCertPEM, rest := pem.Decode(unverifiedKeyOrCertBytes) if unverifiedKeyOrCertPEM == nil { return time.Time{}, NewInvalidSignatureError("public key or cert to be matched against publicKey in Rekor SET is not in PEM format") } if len(rest) != 0 { return time.Time{}, NewInvalidSignatureError("public key or cert to be matched against publicKey in Rekor SET has trailing data") } // NOTE: This compares the PEM payload, but not the object type or headers. if !bytes.Equal(rekorKeyOrCertPEM.Bytes, unverifiedKeyOrCertPEM.Bytes) { return time.Time{}, NewInvalidSignatureError("publicKey in Rekor SET does not match") } // == Match unverifiedSignatureBytes unverifiedSignatureBytes, err := base64.StdEncoding.DecodeString(unverifiedBase64Signature) if err != nil { return time.Time{}, NewInvalidSignatureError(fmt.Sprintf("decoding signature base64: %v", err)) } if !bytes.Equal(hashedRekordV001.Signature.Content, unverifiedSignatureBytes) { return time.Time{}, NewInvalidSignatureError(fmt.Sprintf("signature in Rekor SET does not match: %#v vs. %#v", string(hashedRekordV001.Signature.Content), string(unverifiedSignatureBytes))) } // == Match unverifiedPayloadBytes if hashedRekordV001.Data == nil { return time.Time{}, NewInvalidSignatureError(`Missing "data" field in hashedrekord`) } if hashedRekordV001.Data.Hash == nil { return time.Time{}, NewInvalidSignatureError(`Missing "data.hash" field in hashedrekord`) } if hashedRekordV001.Data.Hash.Algorithm == nil { return time.Time{}, NewInvalidSignatureError(`Missing "data.hash.algorithm" field in hashedrekord`) } // FIXME: Rekor 1.3.5 has added SHA-386 and SHA-512 as recognized values. // Eventually we should support them as well. // Short-term, Cosign (as of 2024-02 and Cosign 2.2.3) only produces and accepts SHA-256, so right now that’s not a compatibility // issue. if *hashedRekordV001.Data.Hash.Algorithm != RekorHashedrekordV001SchemaDataHashAlgorithmSha256 { return time.Time{}, NewInvalidSignatureError(fmt.Sprintf(`Unexpected "data.hash.algorithm" value %#v`, *hashedRekordV001.Data.Hash.Algorithm)) } if hashedRekordV001.Data.Hash.Value == nil { return time.Time{}, NewInvalidSignatureError(`Missing "data.hash.value" field in hashedrekord`) } rekorPayloadHash, err := hex.DecodeString(*hashedRekordV001.Data.Hash.Value) if err != nil { return time.Time{}, NewInvalidSignatureError(fmt.Sprintf(`Invalid "data.hash.value" field in hashedrekord: %v`, err)) } unverifiedPayloadHash := sha256.Sum256(unverifiedPayloadBytes) if !bytes.Equal(rekorPayloadHash, unverifiedPayloadHash[:]) { return time.Time{}, NewInvalidSignatureError("payload in Rekor SET does not match") } // == All OK; return the relevant time. return time.Unix(rekorPayload.IntegratedTime, 0), nil } ================================================ FILE: vendor/go.podman.io/image/v5/signature/internal/sequoia/gosequoia.c ================================================ /* * SPDX-License-Identifier: Apache-2.0 OR FSFAP * SPDX-FileCopyrightText: 2025 Daiki Ueno * * You can redistribute and/or modify this file under the terms of either * Apache License 2.0 (https://www.apache.org/licenses/LICENSE-2.0.html), or * FSF All Permissive License * (https://www.gnu.org/prep/maintain/html_node/License-Notices-for-Other-Files.html), * or both in parallel, as here. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "gosequoia.h" #if defined(GO_SEQUOIA_ENABLE_DLOPEN) && GO_SEQUOIA_ENABLE_DLOPEN #include #include #include #include /* If SEQUOIA_SONAME is defined, dlopen handle can be automatically * set; otherwise, the caller needs to call * go_sequoia_ensure_library with soname determined at run time. */ #ifdef SEQUOIA_SONAME static void ensure_library (void) { if (go_sequoia_ensure_library (SEQUOIA_SONAME, RTLD_LAZY | RTLD_LOCAL) < 0) abort (); } #if defined(GO_SEQUOIA_ENABLE_PTHREAD) && GO_SEQUOIA_ENABLE_PTHREAD #include static pthread_once_t dlopen_once = PTHREAD_ONCE_INIT; #define ENSURE_LIBRARY pthread_once(&dlopen_once, ensure_library) #else /* GO_SEQUOIA_ENABLE_PTHREAD */ #define ENSURE_LIBRARY do { \ if (!go_sequoia_dlhandle) \ ensure_library(); \ } while (0) #endif /* !GO_SEQUOIA_ENABLE_PTHREAD */ #else /* SEQUOIA_SONAME */ #define ENSURE_LIBRARY do {} while (0) #endif /* !SEQUOIA_SONAME */ static void *go_sequoia_dlhandle; /* Define redirection symbols */ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-macros" #if (2 <= __GNUC__ || (4 <= __clang_major__)) #define FUNC(ret, name, args, cargs) \ static __typeof__(name)(*go_sequoia_sym_##name); #else #define FUNC(ret, name, args, cargs) \ static ret(*go_sequoia_sym_##name)args; #endif #define VOID_FUNC FUNC #include "gosequoiafuncs.h" #undef VOID_FUNC #undef FUNC #pragma GCC diagnostic pop /* Define redirection wrapper functions */ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-macros" #define FUNC(ret, name, args, cargs) \ ret go_##name args \ { \ ENSURE_LIBRARY; \ assert (go_sequoia_sym_##name); \ return go_sequoia_sym_##name cargs; \ } #define VOID_FUNC(ret, name, args, cargs) \ ret go_##name args \ { \ ENSURE_LIBRARY; \ assert (go_sequoia_sym_##name); \ go_sequoia_sym_##name cargs; \ } #include "gosequoiafuncs.h" #undef VOID_FUNC #undef FUNC #pragma GCC diagnostic pop static int ensure_symbol (const char *name, void **symp) { if (!*symp) { void *sym = dlsym (go_sequoia_dlhandle, name); if (!sym) return -EINVAL; *symp = sym; } return 0; } int go_sequoia_ensure_library (const char *soname, int flags) { int err; if (!go_sequoia_dlhandle) { go_sequoia_dlhandle = dlopen (soname, flags); if (!go_sequoia_dlhandle) return -EINVAL; } #define ENSURE_SYMBOL(name) \ ensure_symbol(#name, (void **)&go_sequoia_sym_##name) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-macros" #define FUNC(ret, name, args, cargs) \ err = ENSURE_SYMBOL(name); \ if (err < 0) \ { \ dlclose (go_sequoia_dlhandle); \ go_sequoia_dlhandle = NULL; \ return err; \ } #define VOID_FUNC FUNC #include "gosequoiafuncs.h" #undef VOID_FUNC #undef FUNC #pragma GCC diagnostic pop #undef ENSURE_SYMBOL return 0; } void go_sequoia_unload_library (void) { if (go_sequoia_dlhandle) { dlclose (go_sequoia_dlhandle); go_sequoia_dlhandle = NULL; } #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-macros" #define FUNC(ret, name, args, cargs) \ go_sequoia_sym_##name = NULL; #define VOID_FUNC FUNC #include "gosequoiafuncs.h" #undef VOID_FUNC #undef FUNC #pragma GCC diagnostic pop } unsigned go_sequoia_is_usable (void) { return go_sequoia_dlhandle != NULL; } #else /* GO_SEQUOIA_ENABLE_DLOPEN */ int go_sequoia_ensure_library (const char *soname, int flags) { (void) soname; (void) flags; return 0; } void go_sequoia_unload_library (void) { } unsigned go_sequoia_is_usable (void) { /* The library is linked at build time, thus always usable */ return 1; } #endif /* !GO_SEQUOIA_ENABLE_DLOPEN */ ================================================ FILE: vendor/go.podman.io/image/v5/signature/internal/sequoia/gosequoia.h ================================================ /* * SPDX-License-Identifier: Apache-2.0 OR FSFAP * SPDX-FileCopyrightText: 2025 Daiki Ueno * * You can redistribute and/or modify this file under the terms of either * Apache License 2.0 (https://www.apache.org/licenses/LICENSE-2.0.html), or * FSF All Permissive License * (https://www.gnu.org/prep/maintain/html_node/License-Notices-for-Other-Files.html), * or both in parallel, as here. */ #ifndef GO_SEQUOIA_H_ #define GO_SEQUOIA_H_ #include #if defined(GO_SEQUOIA_ENABLE_DLOPEN) && GO_SEQUOIA_ENABLE_DLOPEN #define FUNC(ret, name, args, cargs) \ ret go_##name args; #define VOID_FUNC FUNC #include "gosequoiafuncs.h" #undef VOID_FUNC #undef FUNC #define GO_SEQUOIA_FUNC(name) go_##name #else #define GO_SEQUOIA_FUNC(name) name #endif /* GO_SEQUOIA_ENABLE_DLOPEN */ /* Ensure SONAME to be loaded with dlopen FLAGS, and all the necessary * symbols are resolved. * * Returns 0 on success; negative error code otherwise. * * Note that this function is NOT thread-safe; when calling it from * multi-threaded programs, protect it with a locking mechanism. */ int go_sequoia_ensure_library (const char *soname, int flags); /* Unload library and reset symbols. * * Note that this function is NOT thread-safe; when calling it from * multi-threaded programs, protect it with a locking mechanism. */ void go_sequoia_unload_library (void); /* Return 1 if the library is loaded and usable. * * Note that this function is NOT thread-safe; when calling it from * multi-threaded programs, protect it with a locking mechanism. */ unsigned go_sequoia_is_usable (void); #endif /* GO_SEQUOIA_H_ */ ================================================ FILE: vendor/go.podman.io/image/v5/signature/internal/sequoia/gosequoiafuncs.h ================================================ /* * This file was automatically generated from sequoia.h, * which is covered by the following license: * SPDX-License-Identifier: Apache-2.0 */ VOID_FUNC(void, sequoia_error_free, (struct SequoiaError *err_ptr), (err_ptr)) FUNC(struct SequoiaMechanism *, sequoia_mechanism_new_from_directory, (const char *dir_ptr, struct SequoiaError **err_ptr), (dir_ptr, err_ptr)) FUNC(struct SequoiaMechanism *, sequoia_mechanism_new_ephemeral, (struct SequoiaError **err_ptr), (err_ptr)) VOID_FUNC(void, sequoia_mechanism_free, (struct SequoiaMechanism *mechanism_ptr), (mechanism_ptr)) VOID_FUNC(void, sequoia_signature_free, (struct SequoiaSignature *signature_ptr), (signature_ptr)) FUNC(const uint8_t *, sequoia_signature_get_data, (const struct SequoiaSignature *signature_ptr, size_t *data_len), (signature_ptr, data_len)) VOID_FUNC(void, sequoia_verification_result_free, (struct SequoiaVerificationResult *result_ptr), (result_ptr)) FUNC(const uint8_t *, sequoia_verification_result_get_content, (const struct SequoiaVerificationResult *result_ptr, size_t *data_len), (result_ptr, data_len)) FUNC(const char *, sequoia_verification_result_get_signer, (const struct SequoiaVerificationResult *result_ptr), (result_ptr)) FUNC(struct SequoiaSignature *, sequoia_sign, (struct SequoiaMechanism *mechanism_ptr, const char *key_handle_ptr, const char *password_ptr, const uint8_t *data_ptr, size_t data_len, struct SequoiaError **err_ptr), (mechanism_ptr, key_handle_ptr, password_ptr, data_ptr, data_len, err_ptr)) FUNC(struct SequoiaVerificationResult *, sequoia_verify, (struct SequoiaMechanism *mechanism_ptr, const uint8_t *signature_ptr, size_t signature_len, struct SequoiaError **err_ptr), (mechanism_ptr, signature_ptr, signature_len, err_ptr)) VOID_FUNC(void, sequoia_import_result_free, (struct SequoiaImportResult *result_ptr), (result_ptr)) FUNC(size_t, sequoia_import_result_get_count, (const struct SequoiaImportResult *result_ptr), (result_ptr)) FUNC(const char *, sequoia_import_result_get_content, (const struct SequoiaImportResult *result_ptr, size_t index, struct SequoiaError **err_ptr), (result_ptr, index, err_ptr)) FUNC(struct SequoiaImportResult *, sequoia_import_keys, (struct SequoiaMechanism *mechanism_ptr, const uint8_t *blob_ptr, size_t blob_len, struct SequoiaError **err_ptr), (mechanism_ptr, blob_ptr, blob_len, err_ptr)) FUNC(int, sequoia_set_logger_consumer, (void (*consumer)(enum SequoiaLogLevel, const char *), struct SequoiaError **err_ptr), (consumer, err_ptr)) ================================================ FILE: vendor/go.podman.io/image/v5/signature/internal/sequoia/sequoia.go ================================================ //go:build containers_image_sequoia package sequoia // #cgo CFLAGS: -I. -DGO_SEQUOIA_ENABLE_DLOPEN=1 // #include "gosequoia.h" // #include // #include // typedef void (*sequoia_logger_consumer_t) (enum SequoiaLogLevel level, char *message); // extern void sequoia_logrus_logger (enum SequoiaLogLevel level, char *message); import "C" import ( "errors" "fmt" "path/filepath" "runtime" "sync" "unsafe" "github.com/sirupsen/logrus" ) // sequoiaLibraryDir is the path to the directory where libpodman_sequoia is installed, // if it is not in the platform’s default library path. // You can override this at build time with // -ldflags '-X go.podman.io/image/v5/signature/sequoia.sequoiaLibraryDir=$your_path' var sequoiaLibraryDir = "" type SigningMechanism struct { mechanism *C.SequoiaMechanism } // NewMechanismFromDirectory initializes a mechanism using (user-managed) Sequoia state // in dir, which can be "" to indicate the default (using $SEQUOIA_HOME or the default home directory location). func NewMechanismFromDirectory( dir string, ) (*SigningMechanism, error) { var cerr *C.SequoiaError var cDir *C.char if dir != "" { cDir = C.CString(dir) defer C.free(unsafe.Pointer(cDir)) } cMechanism := C.go_sequoia_mechanism_new_from_directory(cDir, &cerr) if cMechanism == nil { defer C.go_sequoia_error_free(cerr) return nil, errors.New(C.GoString(cerr.message)) } return &SigningMechanism{ mechanism: cMechanism, }, nil } func NewEphemeralMechanism() (*SigningMechanism, error) { var cerr *C.SequoiaError cMechanism := C.go_sequoia_mechanism_new_ephemeral(&cerr) if cMechanism == nil { defer C.go_sequoia_error_free(cerr) return nil, errors.New(C.GoString(cerr.message)) } return &SigningMechanism{ mechanism: cMechanism, }, nil } func (m *SigningMechanism) SignWithPassphrase( input []byte, keyIdentity string, passphrase string, ) ([]byte, error) { var cerr *C.SequoiaError var cPassphrase *C.char if passphrase == "" { cPassphrase = nil } else { cPassphrase = C.CString(passphrase) defer C.free(unsafe.Pointer(cPassphrase)) } cKeyIdentity := C.CString(keyIdentity) defer C.free(unsafe.Pointer(cKeyIdentity)) sig := C.go_sequoia_sign( m.mechanism, cKeyIdentity, cPassphrase, (*C.uchar)(unsafe.Pointer(unsafe.SliceData(input))), C.size_t(len(input)), &cerr, ) if sig == nil { defer C.go_sequoia_error_free(cerr) return nil, errors.New(C.GoString(cerr.message)) } defer C.go_sequoia_signature_free(sig) var size C.size_t cData := C.go_sequoia_signature_get_data(sig, &size) if size > C.size_t(C.INT_MAX) { return nil, errors.New("overflow") // Coverage: This should not reasonably happen, and we don’t want to generate gigabytes of input to test this. } return C.GoBytes(unsafe.Pointer(cData), C.int(size)), nil } func (m *SigningMechanism) Sign( input []byte, keyIdentity string, ) ([]byte, error) { return m.SignWithPassphrase(input, keyIdentity, "") } func (m *SigningMechanism) Verify( unverifiedSignature []byte, ) (contents []byte, keyIdentity string, err error) { var cerr *C.SequoiaError result := C.go_sequoia_verify( m.mechanism, (*C.uchar)(unsafe.Pointer(unsafe.SliceData(unverifiedSignature))), C.size_t(len(unverifiedSignature)), &cerr, ) if result == nil { defer C.go_sequoia_error_free(cerr) return nil, "", errors.New(C.GoString(cerr.message)) } defer C.go_sequoia_verification_result_free(result) var size C.size_t cContent := C.go_sequoia_verification_result_get_content(result, &size) if size > C.size_t(C.INT_MAX) { return nil, "", errors.New("overflow") // Coverage: This should not reasonably happen, and we don’t want to generate gigabytes of input to test this. } contents = C.GoBytes(unsafe.Pointer(cContent), C.int(size)) cSigner := C.go_sequoia_verification_result_get_signer(result) keyIdentity = C.GoString(cSigner) return contents, keyIdentity, nil } func (m *SigningMechanism) ImportKeys(blob []byte) ([]string, error) { var cerr *C.SequoiaError result := C.go_sequoia_import_keys( m.mechanism, (*C.uchar)(unsafe.Pointer(unsafe.SliceData(blob))), C.size_t(len(blob)), &cerr, ) if result == nil { defer C.go_sequoia_error_free(cerr) return nil, errors.New(C.GoString(cerr.message)) } defer C.go_sequoia_import_result_free(result) keyIdentities := []string{} count := C.go_sequoia_import_result_get_count(result) for i := C.size_t(0); i < count; i++ { var cerr *C.SequoiaError cKeyIdentity := C.go_sequoia_import_result_get_content(result, i, &cerr) if cerr != nil { defer C.go_sequoia_error_free(cerr) // Coverage: this can fail only if i is out of range. return nil, errors.New(C.GoString(cerr.message)) } keyIdentities = append(keyIdentities, C.GoString(cKeyIdentity)) } return keyIdentities, nil } func (m *SigningMechanism) Close() error { C.go_sequoia_mechanism_free(m.mechanism) return nil } //export sequoia_logrus_logger func sequoia_logrus_logger(level C.enum_SequoiaLogLevel, message *C.char) { var logrusLevel logrus.Level switch level { // Coverage: We are not in control of whether / how the Rust code chooses to log things. case C.SEQUOIA_LOG_LEVEL_ERROR: logrusLevel = logrus.ErrorLevel case C.SEQUOIA_LOG_LEVEL_WARN: logrusLevel = logrus.WarnLevel case C.SEQUOIA_LOG_LEVEL_INFO: logrusLevel = logrus.InfoLevel case C.SEQUOIA_LOG_LEVEL_DEBUG: logrusLevel = logrus.DebugLevel case C.SEQUOIA_LOG_LEVEL_TRACE: logrusLevel = logrus.TraceLevel case C.SEQUOIA_LOG_LEVEL_UNKNOWN: fallthrough default: logrusLevel = logrus.ErrorLevel // Should never happen } logrus.StandardLogger().Log(logrusLevel, C.GoString(message)) } // initOnce should only be called by Init. func initOnce() error { var soName string switch runtime.GOOS { case "linux": soName = "libpodman_sequoia.so.0" case "darwin": soName = "libpodman_sequoia.dylib" default: return fmt.Errorf("Unhandled OS %q in sequoia initialization", runtime.GOOS) // Coverage: This is ~by definition not reached in tests. } if sequoiaLibraryDir != "" { soName = filepath.Join(sequoiaLibraryDir, soName) } cSOName := C.CString(soName) defer C.free(unsafe.Pointer(cSOName)) if C.go_sequoia_ensure_library(cSOName, C.RTLD_NOW|C.RTLD_GLOBAL) < 0 { return fmt.Errorf("unable to load %q", soName) // Coverage: This is impractical to test in-process, with the static go_sequoia_dlhandle. } var cerr *C.SequoiaError if C.go_sequoia_set_logger_consumer(C.sequoia_logger_consumer_t(C.sequoia_logrus_logger), &cerr) != 0 { defer C.go_sequoia_error_free(cerr) // Coverage: This is impractical to test in-process, with the static go_sequoia_dlhandle. return fmt.Errorf("initializing logging: %s", C.GoString(cerr.message)) } return nil } // Init ensures the libpodman_sequoia library is available. // It is safe to call from arbitrary goroutines. var Init = sync.OnceValue(initOnce) ================================================ FILE: vendor/go.podman.io/image/v5/signature/internal/sequoia/sequoia.h ================================================ // SPDX-License-Identifier: Apache-2.0 #pragma once #include #include #include #include typedef enum SequoiaErrorKind { SEQUOIA_ERROR_KIND_UNKNOWN, SEQUOIA_ERROR_KIND_INVALID_ARGUMENT, SEQUOIA_ERROR_KIND_IO_ERROR, } SequoiaErrorKind; typedef enum SequoiaLogLevel { SEQUOIA_LOG_LEVEL_UNKNOWN, SEQUOIA_LOG_LEVEL_ERROR, SEQUOIA_LOG_LEVEL_WARN, SEQUOIA_LOG_LEVEL_INFO, SEQUOIA_LOG_LEVEL_DEBUG, SEQUOIA_LOG_LEVEL_TRACE, } SequoiaLogLevel; typedef struct SequoiaImportResult SequoiaImportResult; typedef struct SequoiaMechanism SequoiaMechanism; typedef struct SequoiaSignature SequoiaSignature; typedef struct SequoiaVerificationResult SequoiaVerificationResult; typedef struct SequoiaError { enum SequoiaErrorKind kind; char *message; } SequoiaError; void sequoia_error_free(struct SequoiaError *err_ptr); struct SequoiaMechanism *sequoia_mechanism_new_from_directory(const char *dir_ptr, struct SequoiaError **err_ptr); struct SequoiaMechanism *sequoia_mechanism_new_ephemeral(struct SequoiaError **err_ptr); void sequoia_mechanism_free(struct SequoiaMechanism *mechanism_ptr); void sequoia_signature_free(struct SequoiaSignature *signature_ptr); const uint8_t *sequoia_signature_get_data(const struct SequoiaSignature *signature_ptr, size_t *data_len); void sequoia_verification_result_free(struct SequoiaVerificationResult *result_ptr); const uint8_t *sequoia_verification_result_get_content(const struct SequoiaVerificationResult *result_ptr, size_t *data_len); const char *sequoia_verification_result_get_signer(const struct SequoiaVerificationResult *result_ptr); struct SequoiaSignature *sequoia_sign(struct SequoiaMechanism *mechanism_ptr, const char *key_handle_ptr, const char *password_ptr, const uint8_t *data_ptr, size_t data_len, struct SequoiaError **err_ptr); struct SequoiaVerificationResult *sequoia_verify(struct SequoiaMechanism *mechanism_ptr, const uint8_t *signature_ptr, size_t signature_len, struct SequoiaError **err_ptr); void sequoia_import_result_free(struct SequoiaImportResult *result_ptr); size_t sequoia_import_result_get_count(const struct SequoiaImportResult *result_ptr); const char *sequoia_import_result_get_content(const struct SequoiaImportResult *result_ptr, size_t index, struct SequoiaError **err_ptr); struct SequoiaImportResult *sequoia_import_keys(struct SequoiaMechanism *mechanism_ptr, const uint8_t *blob_ptr, size_t blob_len, struct SequoiaError **err_ptr); int sequoia_set_logger_consumer(void (*consumer)(enum SequoiaLogLevel level, const char *message), struct SequoiaError **err_ptr); ================================================ FILE: vendor/go.podman.io/image/v5/signature/internal/sigstore_payload.go ================================================ package internal import ( "bytes" "crypto" "encoding/base64" "encoding/json" "errors" "fmt" "strings" "time" digest "github.com/opencontainers/go-digest" sigstoreSignature "github.com/sigstore/sigstore/pkg/signature" "go.podman.io/image/v5/version" ) const ( sigstoreSignatureType = "cosign container image signature" sigstoreHarcodedHashAlgorithm = crypto.SHA256 ) // UntrustedSigstorePayload is a parsed content of a sigstore signature payload (not the full signature) type UntrustedSigstorePayload struct { untrustedDockerManifestDigest digest.Digest untrustedDockerReference string // FIXME: more precise type? untrustedCreatorID *string // This is intentionally an int64; the native JSON float64 type would allow to represent _some_ sub-second precision, // but not nearly enough (with current timestamp values, a single unit in the last place is on the order of hundreds of nanoseconds). // So, this is explicitly an int64, and we reject fractional values. If we did need more precise timestamps eventually, // we would add another field, UntrustedTimestampNS int64. untrustedTimestamp *int64 } // NewUntrustedSigstorePayload returns an UntrustedSigstorePayload object with // the specified primary contents and appropriate metadata. func NewUntrustedSigstorePayload(dockerManifestDigest digest.Digest, dockerReference string) UntrustedSigstorePayload { // Use intermediate variables for these values so that we can take their addresses. // Golang guarantees that they will have a new address on every execution. creatorID := "containers/image " + version.Version timestamp := time.Now().Unix() return UntrustedSigstorePayload{ untrustedDockerManifestDigest: dockerManifestDigest, untrustedDockerReference: dockerReference, untrustedCreatorID: &creatorID, untrustedTimestamp: ×tamp, } } // A compile-time check that UntrustedSigstorePayload and *UntrustedSigstorePayload implements json.Marshaler var ( _ json.Marshaler = UntrustedSigstorePayload{} _ json.Marshaler = (*UntrustedSigstorePayload)(nil) ) // MarshalJSON implements the json.Marshaler interface. func (s UntrustedSigstorePayload) MarshalJSON() ([]byte, error) { if s.untrustedDockerManifestDigest == "" || s.untrustedDockerReference == "" { return nil, errors.New("Unexpected empty signature content") } critical := map[string]any{ "type": sigstoreSignatureType, "image": map[string]string{"docker-manifest-digest": s.untrustedDockerManifestDigest.String()}, "identity": map[string]string{"docker-reference": s.untrustedDockerReference}, } optional := map[string]any{} if s.untrustedCreatorID != nil { optional["creator"] = *s.untrustedCreatorID } if s.untrustedTimestamp != nil { optional["timestamp"] = *s.untrustedTimestamp } signature := map[string]any{ "critical": critical, "optional": optional, } return json.Marshal(signature) } // Compile-time check that UntrustedSigstorePayload implements json.Unmarshaler var _ json.Unmarshaler = (*UntrustedSigstorePayload)(nil) // UnmarshalJSON implements the json.Unmarshaler interface func (s *UntrustedSigstorePayload) UnmarshalJSON(data []byte) error { return JSONFormatToInvalidSignatureError(s.strictUnmarshalJSON(data)) } // strictUnmarshalJSON is UnmarshalJSON, except that it may return the internal JSONFormatError error type. // Splitting it into a separate function allows us to do the JSONFormatError → InvalidSignatureError in a single place, the caller. func (s *UntrustedSigstorePayload) strictUnmarshalJSON(data []byte) error { var critical, optional json.RawMessage if err := ParanoidUnmarshalJSONObjectExactFields(data, map[string]any{ "critical": &critical, "optional": &optional, }); err != nil { return err } var creatorID string var timestamp float64 gotCreatorID, gotTimestamp := false, false // /usr/bin/cosign generates "optional": null if there are no user-specified annotations. if !bytes.Equal(optional, []byte("null")) { if err := ParanoidUnmarshalJSONObject(optional, func(key string) any { switch key { case "creator": gotCreatorID = true return &creatorID case "timestamp": gotTimestamp = true return ×tamp default: var ignore any return &ignore } }); err != nil { return err } } if gotCreatorID { s.untrustedCreatorID = &creatorID } if gotTimestamp { intTimestamp := int64(timestamp) if float64(intTimestamp) != timestamp { return NewInvalidSignatureError("Field optional.timestamp is not an integer") } s.untrustedTimestamp = &intTimestamp } var t string var image, identity json.RawMessage if err := ParanoidUnmarshalJSONObjectExactFields(critical, map[string]any{ "type": &t, "image": &image, "identity": &identity, }); err != nil { return err } if t != sigstoreSignatureType { return NewInvalidSignatureError(fmt.Sprintf("Unrecognized signature type %s", t)) } var digestString string if err := ParanoidUnmarshalJSONObjectExactFields(image, map[string]any{ "docker-manifest-digest": &digestString, }); err != nil { return err } digestValue, err := digest.Parse(digestString) if err != nil { return NewInvalidSignatureError(fmt.Sprintf(`invalid docker-manifest-digest value %q: %v`, digestString, err)) } s.untrustedDockerManifestDigest = digestValue return ParanoidUnmarshalJSONObjectExactFields(identity, map[string]any{ "docker-reference": &s.untrustedDockerReference, }) } // SigstorePayloadAcceptanceRules specifies how to decide whether an untrusted payload is acceptable. // We centralize the actual parsing and data extraction in VerifySigstorePayload; this supplies // the policy. We use an object instead of supplying func parameters to verifyAndExtractSignature // because the functions have the same or similar types, so there is a risk of exchanging the functions; // named members of this struct are more explicit. type SigstorePayloadAcceptanceRules struct { ValidateSignedDockerReference func(string) error ValidateSignedDockerManifestDigest func(digest.Digest) error } // verifySigstorePayloadBlobSignature verifies unverifiedSignature of unverifiedPayload was correctly created // by any of the public keys in publicKeys. // // This is an internal implementation detail of VerifySigstorePayload and should have no other callers. // It is INSUFFICIENT alone to consider the signature acceptable. func verifySigstorePayloadBlobSignature(publicKeys []crypto.PublicKey, unverifiedPayload, unverifiedSignature []byte) error { if len(publicKeys) == 0 { return errors.New("Need at least one public key to verify the sigstore payload, but got 0") } verifiers := make([]sigstoreSignature.Verifier, 0, len(publicKeys)) for _, key := range publicKeys { // Failing to load a verifier indicates that something is really, really // invalid about the public key; prefer to fail even if the signature might be // valid with other keys, so that users fix their fallback keys before they need them. // For that reason, we even initialize all verifiers before trying to validate the signature // with any key. verifier, err := sigstoreSignature.LoadVerifier(key, sigstoreHarcodedHashAlgorithm) if err != nil { return err } verifiers = append(verifiers, verifier) } var failures []string for _, verifier := range verifiers { // github.com/sigstore/cosign/pkg/cosign.verifyOCISignature uses signatureoptions.WithContext(), // which seems to be not used by anything. So we don’t bother. err := verifier.VerifySignature(bytes.NewReader(unverifiedSignature), bytes.NewReader(unverifiedPayload)) if err == nil { return nil } failures = append(failures, err.Error()) } if len(failures) == 0 { // Coverage: We have checked there is at least one public key, any success causes an early return, // and any failure adds an entry to failures => there must be at least one error. return fmt.Errorf("Internal error: signature verification failed but no errors have been recorded") } return NewInvalidSignatureError("cryptographic signature verification failed: " + strings.Join(failures, ", ")) } // VerifySigstorePayload verifies unverifiedBase64Signature of unverifiedPayload was correctly created by any of the public keys in publicKeys, and that its principal components // match expected values, both as specified by rules, and returns it. // We return an *UntrustedSigstorePayload, although nothing actually uses it, // just to double-check against stupid typos. func VerifySigstorePayload(publicKeys []crypto.PublicKey, unverifiedPayload []byte, unverifiedBase64Signature string, rules SigstorePayloadAcceptanceRules) (*UntrustedSigstorePayload, error) { unverifiedSignature, err := base64.StdEncoding.DecodeString(unverifiedBase64Signature) if err != nil { return nil, NewInvalidSignatureError(fmt.Sprintf("base64 decoding: %v", err)) } if err := verifySigstorePayloadBlobSignature(publicKeys, unverifiedPayload, unverifiedSignature); err != nil { return nil, err } var unmatchedPayload UntrustedSigstorePayload if err := json.Unmarshal(unverifiedPayload, &unmatchedPayload); err != nil { return nil, NewInvalidSignatureError(err.Error()) } if err := rules.ValidateSignedDockerManifestDigest(unmatchedPayload.untrustedDockerManifestDigest); err != nil { return nil, err } if err := rules.ValidateSignedDockerReference(unmatchedPayload.untrustedDockerReference); err != nil { return nil, err } // SigstorePayloadAcceptanceRules have accepted this value. return &unmatchedPayload, nil } ================================================ FILE: vendor/go.podman.io/image/v5/signature/mechanism.go ================================================ // Note: Consider the API unstable until the code supports at least three different image formats or transports. package signature import ( "bytes" "errors" "fmt" "io" "strings" // This code is used only to parse the data in an explicitly-untrusted // code path, where cryptography is not relevant. For now, continue to // use this frozen deprecated implementation. When mechanism_openpgp.go // migrates to another implementation, this should migrate as well. //lint:ignore SA1019 See above "golang.org/x/crypto/openpgp" //nolint:staticcheck ) // SigningMechanism abstracts a way to sign binary blobs and verify their signatures. // Each mechanism should eventually be closed by calling Close(). type SigningMechanism interface { // Close removes resources associated with the mechanism, if any. Close() error // SupportsSigning returns nil if the mechanism supports signing, or a SigningNotSupportedError. SupportsSigning() error // Sign creates a (non-detached) signature of input using keyIdentity. // Fails with a SigningNotSupportedError if the mechanism does not support signing. Sign(input []byte, keyIdentity string) ([]byte, error) // Verify parses unverifiedSignature and returns the content and the signer's identity. // For mechanisms created using NewEphemeralGPGSigningMechanism, the returned key identity // is expected to be one of the values returned by NewEphemeralGPGSigningMechanism, // or the mechanism should implement signingMechanismWithVerificationIdentityLookup. Verify(unverifiedSignature []byte) (contents []byte, keyIdentity string, err error) // UntrustedSignatureContents returns UNTRUSTED contents of the signature WITHOUT ANY VERIFICATION, // along with a short identifier of the key used for signing. // WARNING: The short key identifier (which corresponds to "Key ID" for OpenPGP keys) // is NOT the same as a "key identity" used in other calls to this interface, and // the values may have no recognizable relationship if the public key is not available. UntrustedSignatureContents(untrustedSignature []byte) (untrustedContents []byte, shortKeyIdentifier string, err error) } // signingMechanismWithPassphrase is an internal extension of SigningMechanism. type signingMechanismWithPassphrase interface { SigningMechanism // Sign creates a (non-detached) signature of input using keyIdentity and passphrase. // Fails with a SigningNotSupportedError if the mechanism does not support signing. SignWithPassphrase(input []byte, keyIdentity string, passphrase string) ([]byte, error) } // signingMechanismWithVerificationIdentityLookup is an internal extension of SigningMechanism. type signingMechanismWithVerificationIdentityLookup interface { SigningMechanism // keyIdentityForVerificationKeyIdentity re-checks the key identity returned by Verify // if it doesn't match an identity returned by NewEphemeralGPGSigningMechanism, trying to match it. // (To be more specific, for mechanisms which return a subkey fingerprint from Verify, // this converts the subkey fingerprint into the corresponding primary key fingerprint.) keyIdentityForVerificationKeyIdentity(keyIdentity string) (string, error) } // SigningNotSupportedError is returned when trying to sign using a mechanism which does not support that. type SigningNotSupportedError string func (err SigningNotSupportedError) Error() string { return string(err) } // NewGPGSigningMechanism returns a new GPG/OpenPGP signing mechanism for the user’s default // GPG configuration ($GNUPGHOME / ~/.gnupg) // The caller must call .Close() on the returned SigningMechanism. func NewGPGSigningMechanism() (SigningMechanism, error) { return newGPGSigningMechanismInDirectory("") } // NewEphemeralGPGSigningMechanism returns a new GPG/OpenPGP signing mechanism which // recognizes _only_ public keys from the supplied blob, and returns the identities // of these keys. // The caller must call .Close() on the returned SigningMechanism. func NewEphemeralGPGSigningMechanism(blob []byte) (SigningMechanism, []string, error) { return newEphemeralGPGSigningMechanism([][]byte{blob}) } // gpgUntrustedSignatureContents returns UNTRUSTED contents of the signature WITHOUT ANY VERIFICATION, // along with a short identifier of the key used for signing. // WARNING: The short key identifier (which corresponds to "Key ID" for OpenPGP keys) // is NOT the same as a "key identity" used in other calls to this interface, and // the values may have no recognizable relationship if the public key is not available. func gpgUntrustedSignatureContents(untrustedSignature []byte) (untrustedContents []byte, shortKeyIdentifier string, err error) { // This uses the Golang-native OpenPGP implementation instead of gpgme because we are not doing any cryptography. md, err := openpgp.ReadMessage(bytes.NewReader(untrustedSignature), openpgp.EntityList{}, nil, nil) if err != nil { return nil, "", err } if !md.IsSigned { return nil, "", errors.New("The input is not a signature") } content, err := io.ReadAll(md.UnverifiedBody) if err != nil { // Coverage: An error during reading the body can happen only if // 1) the message is encrypted, which is not our case (and we don’t give ReadMessage the key // to decrypt the contents anyway), or // 2) the message is signed AND we give ReadMessage a corresponding public key, which we don’t. return nil, "", err } // Uppercase the key ID for minimal consistency with the gpgme-returned fingerprints // (but note that key ID is a suffix of the fingerprint only for V4 keys, not V3)! return content, strings.ToUpper(fmt.Sprintf("%016X", md.SignedByKeyId)), nil } ================================================ FILE: vendor/go.podman.io/image/v5/signature/mechanism_gpgme.go ================================================ //go:build !containers_image_openpgp package signature // This is shared by mechanism_gpgme_only.go and mechanism_sequoia.go; in both situations // newGPGSigningMechanismInDirectory is implemented using GPGME. import ( "bytes" "errors" "fmt" "os" "github.com/proglottis/gpgme" "go.podman.io/image/v5/signature/internal" ) // A GPG/OpenPGP signing mechanism, implemented using gpgme. type gpgmeSigningMechanism struct { ctx *gpgme.Context ephemeralDir string // If not "", a directory to be removed on Close() } // newGPGMESigningMechanism returns a new GPG/OpenPGP signing mechanism for ctx. // The caller must call .Close() on the returned SigningMechanism; if ephemeralDir is set, // the .Close() call will remove its contents. func newGPGMESigningMechanism(ctx *gpgme.Context, ephemeralDir string) signingMechanismWithPassphrase { return &gpgmeSigningMechanism{ ctx: ctx, ephemeralDir: ephemeralDir, } } // newGPGSigningMechanismInDirectory returns a new GPG/OpenPGP signing mechanism, using optionalDir if not empty. // The caller must call .Close() on the returned SigningMechanism. func newGPGSigningMechanismInDirectory(optionalDir string) (signingMechanismWithPassphrase, error) { ctx, err := newGPGMEContext(optionalDir) if err != nil { return nil, err } return newGPGMESigningMechanism(ctx, ""), nil } // newGPGMEContext returns a new *gpgme.Context, using optionalDir if not empty. func newGPGMEContext(optionalDir string) (*gpgme.Context, error) { ctx, err := gpgme.New() if err != nil { return nil, err } if err = ctx.SetProtocol(gpgme.ProtocolOpenPGP); err != nil { return nil, err } if optionalDir != "" { err := ctx.SetEngineInfo(gpgme.ProtocolOpenPGP, "", optionalDir) if err != nil { return nil, err } } ctx.SetArmor(false) ctx.SetTextMode(false) return ctx, nil } func (m *gpgmeSigningMechanism) Close() error { if m.ephemeralDir != "" { os.RemoveAll(m.ephemeralDir) // Ignore an error, if any } return nil } // SupportsSigning returns nil if the mechanism supports signing, or a SigningNotSupportedError. func (m *gpgmeSigningMechanism) SupportsSigning() error { return nil } // Sign creates a (non-detached) signature of input using keyIdentity and passphrase. // Fails with a SigningNotSupportedError if the mechanism does not support signing. func (m *gpgmeSigningMechanism) SignWithPassphrase(input []byte, keyIdentity string, passphrase string) ([]byte, error) { key, err := m.ctx.GetKey(keyIdentity, true) if err != nil { return nil, err } inputData, err := gpgme.NewDataBytes(input) if err != nil { return nil, err } var sigBuffer bytes.Buffer sigData, err := gpgme.NewDataWriter(&sigBuffer) if err != nil { return nil, err } if passphrase != "" { // Callback to write the passphrase to the specified file descriptor. callback := func(uidHint string, prevWasBad bool, gpgmeFD *os.File) error { if prevWasBad { return errors.New("bad passphrase") } _, err := gpgmeFD.WriteString(passphrase + "\n") return err } if err := m.ctx.SetCallback(callback); err != nil { return nil, fmt.Errorf("setting gpgme passphrase callback: %w", err) } // Loopback mode will use the callback instead of prompting the user. if err := m.ctx.SetPinEntryMode(gpgme.PinEntryLoopback); err != nil { return nil, fmt.Errorf("setting gpgme pinentry mode: %w", err) } } if err = m.ctx.Sign([]*gpgme.Key{key}, inputData, sigData, gpgme.SigModeNormal); err != nil { return nil, err } return sigBuffer.Bytes(), nil } // Sign creates a (non-detached) signature of input using keyIdentity. // Fails with a SigningNotSupportedError if the mechanism does not support signing. func (m *gpgmeSigningMechanism) Sign(input []byte, keyIdentity string) ([]byte, error) { return m.SignWithPassphrase(input, keyIdentity, "") } // Verify parses unverifiedSignature and returns the content and the signer's identity. // For mechanisms created using NewEphemeralGPGSigningMechanism, the returned key identity // is expected to be one of the values returned by NewEphemeralGPGSigningMechanism, // or the mechanism should implement signingMechanismWithVerificationIdentityLookup. func (m *gpgmeSigningMechanism) Verify(unverifiedSignature []byte) (contents []byte, keyIdentity string, err error) { signedBuffer := bytes.Buffer{} signedData, err := gpgme.NewDataWriter(&signedBuffer) if err != nil { return nil, "", err } unverifiedSignatureData, err := gpgme.NewDataBytes(unverifiedSignature) if err != nil { return nil, "", err } _, sigs, err := m.ctx.Verify(unverifiedSignatureData, nil, signedData) if err != nil { return nil, "", err } if len(sigs) != 1 { return nil, "", internal.NewInvalidSignatureError(fmt.Sprintf("Unexpected GPG signature count %d", len(sigs))) } sig := sigs[0] // This is sig.Summary == gpgme.SigSumValid except for key trust, which we handle ourselves if sig.Status != nil || sig.Validity == gpgme.ValidityNever || sig.ValidityReason != nil || sig.WrongKeyUsage { // FIXME: Better error reporting eventually return nil, "", internal.NewInvalidSignatureError(fmt.Sprintf("Invalid GPG signature: %#v", sig)) } return signedBuffer.Bytes(), sig.Fingerprint, nil } // keyIdentityForVerificationKeyIdentity re-checks the key identity returned by Verify // if it doesn't match an identity returned by NewEphemeralGPGSigningMechanism, trying to match it. // (To be more specific, for mechanisms which return a subkey fingerprint from Verify, // this converts the subkey fingerprint into the corresponding primary key fingerprint.) func (m *gpgmeSigningMechanism) keyIdentityForVerificationKeyIdentity(keyIdentity string) (string, error) { // In theory, if keyIdentity refers to a subkey, the same subkey could be attached to different primary keys; // in that case, GetKey fails with “ambiguous name”. // We _could_ handle that, by using KeyList* (GetKey is internally just a helper for KeyList*), but sharing // a subkey that way is very unexpected, so, for now, prefer the much simpler implementation. key, err := m.ctx.GetKey(keyIdentity, false) if err != nil { return "", err } // In theory this value could be nil if (gpg --list-keys --with-colons) misses a "pub:" line // or a "fpr:" line, but gpg (in recent enough versions) prints that unconditionally. // codespell:ignore fpr return key.Fingerprint(), nil } // UntrustedSignatureContents returns UNTRUSTED contents of the signature WITHOUT ANY VERIFICATION, // along with a short identifier of the key used for signing. // WARNING: The short key identifier (which corresponds to "Key ID" for OpenPGP keys) // is NOT the same as a "key identity" used in other calls to this interface, and // the values may have no recognizable relationship if the public key is not available. func (m *gpgmeSigningMechanism) UntrustedSignatureContents(untrustedSignature []byte) (untrustedContents []byte, shortKeyIdentifier string, err error) { return gpgUntrustedSignatureContents(untrustedSignature) } ================================================ FILE: vendor/go.podman.io/image/v5/signature/mechanism_gpgme_only.go ================================================ //go:build !containers_image_openpgp && !containers_image_sequoia package signature import ( "os" "github.com/proglottis/gpgme" ) // newEphemeralGPGSigningMechanism returns a new GPG/OpenPGP signing mechanism which // recognizes _only_ public keys from the supplied blobs, and returns the identities // of these keys. // The caller must call .Close() on the returned SigningMechanism. func newEphemeralGPGSigningMechanism(blobs [][]byte) (signingMechanismWithPassphrase, []string, error) { dir, err := os.MkdirTemp("", "containers-ephemeral-gpg-") if err != nil { return nil, nil, err } removeDir := true defer func() { if removeDir { os.RemoveAll(dir) } }() ctx, err := newGPGMEContext(dir) if err != nil { return nil, nil, err } keyIdentities := []string{} for _, blob := range blobs { ki, err := importKeysFromBytes(ctx, blob) if err != nil { return nil, nil, err } keyIdentities = append(keyIdentities, ki...) } mech := newGPGMESigningMechanism(ctx, dir) removeDir = false return mech, keyIdentities, nil } // importKeysFromBytes imports public keys from the supplied blob and returns their identities. // The blob is assumed to have an appropriate format (the caller is expected to know which one). // NOTE: This may modify long-term state (e.g. key storage in a directory underlying the mechanism); // but we do not make this public, it can only be used through newEphemeralGPGSigningMechanism. func importKeysFromBytes(ctx *gpgme.Context, blob []byte) ([]string, error) { inputData, err := gpgme.NewDataBytes(blob) if err != nil { return nil, err } res, err := ctx.Import(inputData) if err != nil { return nil, err } keyIdentities := []string{} for _, i := range res.Imports { if i.Result == nil { keyIdentities = append(keyIdentities, i.Fingerprint) } } return keyIdentities, nil } ================================================ FILE: vendor/go.podman.io/image/v5/signature/mechanism_openpgp.go ================================================ //go:build containers_image_openpgp package signature import ( "bytes" "errors" "fmt" "io" "os" "path" "strings" "time" "go.podman.io/image/v5/signature/internal" "go.podman.io/storage/pkg/homedir" // This is a fallback code; the primary recommendation is to use the gpgme mechanism // implementation, which is out-of-process and more appropriate for handling long-term private key material // than any Go implementation. // For this verify-only fallback, we haven't reviewed any of the // existing alternatives to choose; so, for now, continue to // use this frozen deprecated implementation. //lint:ignore SA1019 See above "golang.org/x/crypto/openpgp" //nolint:staticcheck ) // A GPG/OpenPGP signing mechanism, implemented using x/crypto/openpgp. type openpgpSigningMechanism struct { keyring openpgp.EntityList } // newGPGSigningMechanismInDirectory returns a new GPG/OpenPGP signing mechanism, using optionalDir if not empty. // The caller must call .Close() on the returned SigningMechanism. func newGPGSigningMechanismInDirectory(optionalDir string) (signingMechanismWithPassphrase, error) { m := &openpgpSigningMechanism{ keyring: openpgp.EntityList{}, } gpgHome := optionalDir if gpgHome == "" { gpgHome = os.Getenv("GNUPGHOME") if gpgHome == "" { gpgHome = path.Join(homedir.Get(), ".gnupg") } } pubring, err := os.ReadFile(path.Join(gpgHome, "pubring.gpg")) if err != nil { if !os.IsNotExist(err) { return nil, err } } else { _, err := m.importKeysFromBytes(pubring) if err != nil { return nil, err } } return m, nil } // newEphemeralGPGSigningMechanism returns a new GPG/OpenPGP signing mechanism which // recognizes _only_ public keys from the supplied blob, and returns the identities // of these keys. // The caller must call .Close() on the returned SigningMechanism. func newEphemeralGPGSigningMechanism(blobs [][]byte) (signingMechanismWithPassphrase, []string, error) { m := &openpgpSigningMechanism{ keyring: openpgp.EntityList{}, } keyIdentities := []string{} for _, blob := range blobs { ki, err := m.importKeysFromBytes(blob) if err != nil { return nil, nil, err } keyIdentities = append(keyIdentities, ki...) } return m, keyIdentities, nil } func (m *openpgpSigningMechanism) Close() error { return nil } // importKeysFromBytes imports public keys from the supplied blob and returns their identities. // The blob is assumed to have an appropriate format (the caller is expected to know which one). func (m *openpgpSigningMechanism) importKeysFromBytes(blob []byte) ([]string, error) { keyring, err := openpgp.ReadKeyRing(bytes.NewReader(blob)) if err != nil { k, e2 := openpgp.ReadArmoredKeyRing(bytes.NewReader(blob)) if e2 != nil { return nil, err // The original error -- FIXME: is this better? } keyring = k } keyIdentities := []string{} for _, entity := range keyring { if entity.PrimaryKey == nil { // Coverage: This should never happen, openpgp.ReadEntity fails with a // openpgp.errors.StructuralError instead of returning an entity with this // field set to nil. continue } // Uppercase the fingerprint to be compatible with gpgme keyIdentities = append(keyIdentities, strings.ToUpper(fmt.Sprintf("%x", entity.PrimaryKey.Fingerprint))) m.keyring = append(m.keyring, entity) } return keyIdentities, nil } // SupportsSigning returns nil if the mechanism supports signing, or a SigningNotSupportedError. func (m *openpgpSigningMechanism) SupportsSigning() error { return SigningNotSupportedError("signing is not supported in go.podman.io/image built with the containers_image_openpgp build tag") } // Sign creates a (non-detached) signature of input using keyIdentity. // Fails with a SigningNotSupportedError if the mechanism does not support signing. func (m *openpgpSigningMechanism) SignWithPassphrase(input []byte, keyIdentity string, passphrase string) ([]byte, error) { return nil, SigningNotSupportedError("signing is not supported in go.podman.io/image built with the containers_image_openpgp build tag") } // Sign creates a (non-detached) signature of input using keyIdentity. // Fails with a SigningNotSupportedError if the mechanism does not support signing. func (m *openpgpSigningMechanism) Sign(input []byte, keyIdentity string) ([]byte, error) { return m.SignWithPassphrase(input, keyIdentity, "") } // Verify parses unverifiedSignature and returns the content and the signer's identity. // For mechanisms created using NewEphemeralGPGSigningMechanism, the returned key identity // is expected to be one of the values returned by NewEphemeralGPGSigningMechanism, // or the mechanism should implement signingMechanismWithVerificationIdentityLookup. func (m *openpgpSigningMechanism) Verify(unverifiedSignature []byte) (contents []byte, keyIdentity string, err error) { md, err := openpgp.ReadMessage(bytes.NewReader(unverifiedSignature), m.keyring, nil, nil) if err != nil { return nil, "", err } if !md.IsSigned { return nil, "", errors.New("not signed") } content, err := io.ReadAll(md.UnverifiedBody) if err != nil { // Coverage: md.UnverifiedBody.Read only fails if the body is encrypted // (and possibly also signed, but it _must_ be encrypted) and the signing // “modification detection code” detects a mismatch. But in that case, // we would expect the signature verification to fail as well, and that is checked // first. Besides, we are not supplying any decryption keys, so we really // can never reach this “encrypted data MDC mismatch” path. return nil, "", err } if md.SignatureError != nil { return nil, "", fmt.Errorf("signature error: %v", md.SignatureError) } if md.SignedBy == nil { return nil, "", internal.NewInvalidSignatureError(fmt.Sprintf("Key not found for key ID %x in signature", md.SignedByKeyId)) } if md.Signature != nil { if md.Signature.SigLifetimeSecs != nil { expiry := md.Signature.CreationTime.Add(time.Duration(*md.Signature.SigLifetimeSecs) * time.Second) if time.Now().After(expiry) { return nil, "", internal.NewInvalidSignatureError(fmt.Sprintf("Signature expired on %s", expiry)) } } } else if md.SignatureV3 == nil { // Coverage: If md.SignedBy != nil, the final md.UnverifiedBody.Read() either sets one of md.Signature or md.SignatureV3, // or sets md.SignatureError. return nil, "", internal.NewInvalidSignatureError("Unexpected openpgp.MessageDetails: neither Signature nor SignatureV3 is set") } // Uppercase the fingerprint to be compatible with gpgme return content, strings.ToUpper(fmt.Sprintf("%x", md.SignedBy.Entity.PrimaryKey.Fingerprint)), nil } // UntrustedSignatureContents returns UNTRUSTED contents of the signature WITHOUT ANY VERIFICATION, // along with a short identifier of the key used for signing. // WARNING: The short key identifier (which corresponds to "Key ID" for OpenPGP keys) // is NOT the same as a "key identity" used in other calls to this interface, and // the values may have no recognizable relationship if the public key is not available. func (m *openpgpSigningMechanism) UntrustedSignatureContents(untrustedSignature []byte) (untrustedContents []byte, shortKeyIdentifier string, err error) { return gpgUntrustedSignatureContents(untrustedSignature) } ================================================ FILE: vendor/go.podman.io/image/v5/signature/mechanism_sequoia.go ================================================ //go:build containers_image_sequoia package signature import ( "go.podman.io/image/v5/signature/internal/sequoia" ) // A GPG/OpenPGP signing mechanism, implemented using Sequoia and only supporting verification. // Legacy users who reach newGPGSigningMechanismInDirectory will use GPGME. // Signing using Sequoia is preferable, but should happen via signature/simplesequoia.NewSigner, not using // the legacy mechanism API. type sequoiaEphemeralSigningMechanism struct { inner *sequoia.SigningMechanism } // newEphemeralGPGSigningMechanism returns a new GPG/OpenPGP signing mechanism which // recognizes _only_ public keys from the supplied blobs, and returns the identities // of these keys. // The caller must call .Close() on the returned SigningMechanism. func newEphemeralGPGSigningMechanism(blobs [][]byte) (signingMechanismWithPassphrase, []string, error) { if err := sequoia.Init(); err != nil { return nil, nil, err // Coverage: This is impractical to test in-process, with the static go_sequoia_dlhandle. } mech, err := sequoia.NewEphemeralMechanism() if err != nil { return nil, nil, err } keyIdentities := []string{} for _, blob := range blobs { ki, err := mech.ImportKeys(blob) if err != nil { return nil, nil, err } keyIdentities = append(keyIdentities, ki...) } return &sequoiaEphemeralSigningMechanism{ inner: mech, }, keyIdentities, nil } func (m *sequoiaEphemeralSigningMechanism) Close() error { return m.inner.Close() } // SupportsSigning returns nil if the mechanism supports signing, or a SigningNotSupportedError. func (m *sequoiaEphemeralSigningMechanism) SupportsSigning() error { // This code is externally reachable via NewEphemeralGPGSigningMechanism(), but that API provides no way to // import or generate a key. return SigningNotSupportedError("caller error: Attempt to sign using a mechanism created via NewEphemeralGPGSigningMechanism().") } // Sign creates a (non-detached) signature of input using keyIdentity and passphrase. // Fails with a SigningNotSupportedError if the mechanism does not support signing. func (m *sequoiaEphemeralSigningMechanism) SignWithPassphrase(input []byte, keyIdentity string, passphrase string) ([]byte, error) { // This code is externally reachable via NewEphemeralGPGSigningMechanism(), but that API provides no way to // import or generate a key. return nil, SigningNotSupportedError("caller error: Attempt to sign using a mechanism created via NewEphemeralGPGSigningMechanism().") } // Sign creates a (non-detached) signature of input using keyIdentity. // Fails with a SigningNotSupportedError if the mechanism does not support signing. func (m *sequoiaEphemeralSigningMechanism) Sign(input []byte, keyIdentity string) ([]byte, error) { return m.SignWithPassphrase(input, keyIdentity, "") } // Verify parses unverifiedSignature and returns the content and the signer's identity. // For mechanisms created using NewEphemeralGPGSigningMechanism, the returned key identity // is expected to be one of the values returned by NewEphemeralGPGSigningMechanism, // or the mechanism should implement signingMechanismWithVerificationIdentityLookup. func (m *sequoiaEphemeralSigningMechanism) Verify(unverifiedSignature []byte) (contents []byte, keyIdentity string, err error) { return m.inner.Verify(unverifiedSignature) } // UntrustedSignatureContents returns UNTRUSTED contents of the signature WITHOUT ANY VERIFICATION, // along with a short identifier of the key used for signing. // WARNING: The short key identifier (which corresponds to "Key ID" for OpenPGP keys) // is NOT the same as a "key identity" used in other calls to this interface, and // the values may have no recognizable relationship if the public key is not available. func (m *sequoiaEphemeralSigningMechanism) UntrustedSignatureContents(untrustedSignature []byte) (untrustedContents []byte, shortKeyIdentifier string, err error) { return gpgUntrustedSignatureContents(untrustedSignature) } ================================================ FILE: vendor/go.podman.io/image/v5/signature/pki_cert.go ================================================ package signature import ( "crypto" "crypto/x509" "errors" "fmt" "slices" "github.com/sigstore/sigstore/pkg/cryptoutils" "go.podman.io/image/v5/signature/internal" ) type pkiTrustRoot struct { caRootsCertificates *x509.CertPool caIntermediateCertificates *x509.CertPool subjectEmail string subjectHostname string } func (p *pkiTrustRoot) validate() error { if p.subjectEmail == "" && p.subjectHostname == "" { return errors.New("Internal inconsistency: PKI use set up without subject email or subject hostname") } return nil } func verifyPKI(pkiTrustRoot *pkiTrustRoot, untrustedCertificateBytes []byte, untrustedIntermediateChainBytes []byte) (crypto.PublicKey, error) { var untrustedIntermediatePool *x509.CertPool if pkiTrustRoot.caIntermediateCertificates != nil { untrustedIntermediatePool = pkiTrustRoot.caIntermediateCertificates.Clone() } else { untrustedIntermediatePool = x509.NewCertPool() } if len(untrustedIntermediateChainBytes) > 0 { untrustedIntermediateChain, err := cryptoutils.UnmarshalCertificatesFromPEM(untrustedIntermediateChainBytes) if err != nil { return nil, internal.NewInvalidSignatureError(fmt.Sprintf("loading certificate chain: %v", err)) } if len(untrustedIntermediateChain) > 1 { for _, untrustedIntermediateCert := range untrustedIntermediateChain[:len(untrustedIntermediateChain)-1] { untrustedIntermediatePool.AddCert(untrustedIntermediateCert) } } } untrustedCertificate, err := parseLeafCertFromPEM(untrustedCertificateBytes) if err != nil { return nil, err } if _, err := untrustedCertificate.Verify(x509.VerifyOptions{ Intermediates: untrustedIntermediatePool, Roots: pkiTrustRoot.caRootsCertificates, KeyUsages: []x509.ExtKeyUsage{x509.ExtKeyUsageCodeSigning}, }); err != nil { return nil, internal.NewInvalidSignatureError(fmt.Sprintf("veryfing leaf certificate failed: %v", err)) } if pkiTrustRoot.subjectEmail != "" { if !slices.Contains(untrustedCertificate.EmailAddresses, pkiTrustRoot.subjectEmail) { return nil, internal.NewInvalidSignatureError(fmt.Sprintf("Required email %q not found (got %q)", pkiTrustRoot.subjectEmail, untrustedCertificate.EmailAddresses)) } } if pkiTrustRoot.subjectHostname != "" { if err = untrustedCertificate.VerifyHostname(pkiTrustRoot.subjectHostname); err != nil { return nil, internal.NewInvalidSignatureError(fmt.Sprintf("Unexpected subject hostname: %v", err)) } } return untrustedCertificate.PublicKey, nil } ================================================ FILE: vendor/go.podman.io/image/v5/signature/policy_config.go ================================================ // policy_config.go handles creation of policy objects, either by parsing JSON // or by programs building them programmatically. // The New* constructors are intended to be a stable API. FIXME: after an independent review. // Do not invoke the internals of the JSON marshaling/unmarshaling directly. // We can't just blindly call json.Unmarshal because that would silently ignore // typos, and that would just not do for security policy. // FIXME? This is by no means an user-friendly parser: No location information in error messages, no other context. // But at least it is not worse than blind json.Unmarshal()… package signature import ( "encoding/json" "errors" "fmt" "os" "path/filepath" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/signature/internal" "go.podman.io/image/v5/transports" "go.podman.io/image/v5/types" "go.podman.io/storage/pkg/fileutils" "go.podman.io/storage/pkg/homedir" "go.podman.io/storage/pkg/regexp" ) // systemDefaultPolicyPath is the policy path used for DefaultPolicy(). // You can override this at build time with // -ldflags '-X go.podman.io/image/v5/signature.systemDefaultPolicyPath=$your_path' var systemDefaultPolicyPath = builtinDefaultPolicyPath // userPolicyFile is the path to the per user policy path. var userPolicyFile = filepath.FromSlash(".config/containers/policy.json") // InvalidPolicyFormatError is returned when parsing an invalid policy configuration. type InvalidPolicyFormatError string func (err InvalidPolicyFormatError) Error() string { return string(err) } // DefaultPolicy returns the default policy of the system. // Most applications should be using this method to get the policy configured // by the system administrator. // sys should usually be nil, can be set to override the default. // NOTE: When this function returns an error, report it to the user and abort. // DO NOT hard-code fallback policies in your application. func DefaultPolicy(sys *types.SystemContext) (*Policy, error) { policyPath, err := defaultPolicyPath(sys) if err != nil { return nil, err } return NewPolicyFromFile(policyPath) } // defaultPolicyPath returns a path to the relevant policy of the system, or an error if the policy is missing. func defaultPolicyPath(sys *types.SystemContext) (string, error) { policyFilePath, err := defaultPolicyPathWithHomeDir(sys, homedir.Get(), systemDefaultPolicyPath) if err != nil { return "", err } return policyFilePath, nil } // defaultPolicyPathWithHomeDir is an internal implementation detail of defaultPolicyPath, // it exists only to allow testing it with artificial paths. func defaultPolicyPathWithHomeDir(sys *types.SystemContext, homeDir string, systemPolicyPath string) (string, error) { if sys != nil && sys.SignaturePolicyPath != "" { return sys.SignaturePolicyPath, nil } userPolicyFilePath := filepath.Join(homeDir, userPolicyFile) if err := fileutils.Exists(userPolicyFilePath); err == nil { return userPolicyFilePath, nil } if sys != nil && sys.RootForImplicitAbsolutePaths != "" { return filepath.Join(sys.RootForImplicitAbsolutePaths, systemPolicyPath), nil } if err := fileutils.Exists(systemPolicyPath); err == nil { return systemPolicyPath, nil } return "", fmt.Errorf("no policy.json file found at any of the following: %q, %q", userPolicyFilePath, systemPolicyPath) } // NewPolicyFromFile returns a policy configured in the specified file. func NewPolicyFromFile(fileName string) (*Policy, error) { contents, err := os.ReadFile(fileName) if err != nil { return nil, err } policy, err := NewPolicyFromBytes(contents) if err != nil { return nil, fmt.Errorf("invalid policy in %q: %w", fileName, err) } return policy, nil } // NewPolicyFromBytes returns a policy parsed from the specified blob. // Use this function instead of calling json.Unmarshal directly. func NewPolicyFromBytes(data []byte) (*Policy, error) { p := Policy{} if err := json.Unmarshal(data, &p); err != nil { return nil, InvalidPolicyFormatError(err.Error()) } return &p, nil } // Compile-time check that Policy implements json.Unmarshaler. var _ json.Unmarshaler = (*Policy)(nil) // UnmarshalJSON implements the json.Unmarshaler interface. func (p *Policy) UnmarshalJSON(data []byte) error { *p = Policy{} transports := policyTransportsMap{} if err := internal.ParanoidUnmarshalJSONObject(data, func(key string) any { switch key { case "default": return &p.Default case "transports": return &transports default: return nil } }); err != nil { return err } if p.Default == nil { return InvalidPolicyFormatError("Default policy is missing") } p.Transports = map[string]PolicyTransportScopes(transports) return nil } // policyTransportsMap is a specialization of this map type for the strict JSON parsing semantics appropriate for the Policy.Transports member. type policyTransportsMap map[string]PolicyTransportScopes // Compile-time check that policyTransportsMap implements json.Unmarshaler. var _ json.Unmarshaler = (*policyTransportsMap)(nil) // UnmarshalJSON implements the json.Unmarshaler interface. func (m *policyTransportsMap) UnmarshalJSON(data []byte) error { // We can't unmarshal directly into map values because it is not possible to take an address of a map value. // So, use a temporary map of pointers-to-slices and convert. tmpMap := map[string]*PolicyTransportScopes{} if err := internal.ParanoidUnmarshalJSONObject(data, func(key string) any { // transport can be nil transport := transports.Get(key) // internal.ParanoidUnmarshalJSONObject detects key duplication for us, check just to be safe. if _, ok := tmpMap[key]; ok { return nil } ptsWithTransport := policyTransportScopesWithTransport{ transport: transport, dest: &PolicyTransportScopes{}, // This allocates a new instance on each call. } tmpMap[key] = ptsWithTransport.dest return &ptsWithTransport }); err != nil { return err } for key, ptr := range tmpMap { (*m)[key] = *ptr } return nil } // Compile-time check that PolicyTransportScopes "implements"" json.Unmarshaler. // we want to only use policyTransportScopesWithTransport var _ json.Unmarshaler = (*PolicyTransportScopes)(nil) // UnmarshalJSON implements the json.Unmarshaler interface. func (m *PolicyTransportScopes) UnmarshalJSON(data []byte) error { return errors.New("Do not try to unmarshal PolicyTransportScopes directly") } // policyTransportScopesWithTransport is a way to unmarshal a PolicyTransportScopes // while validating using a specific ImageTransport if not nil. type policyTransportScopesWithTransport struct { transport types.ImageTransport dest *PolicyTransportScopes } // Compile-time check that policyTransportScopesWithTransport implements json.Unmarshaler. var _ json.Unmarshaler = (*policyTransportScopesWithTransport)(nil) // UnmarshalJSON implements the json.Unmarshaler interface. func (m *policyTransportScopesWithTransport) UnmarshalJSON(data []byte) error { // We can't unmarshal directly into map values because it is not possible to take an address of a map value. // So, use a temporary map of pointers-to-slices and convert. tmpMap := map[string]*PolicyRequirements{} if err := internal.ParanoidUnmarshalJSONObject(data, func(key string) any { // internal.ParanoidUnmarshalJSONObject detects key duplication for us, check just to be safe. if _, ok := tmpMap[key]; ok { return nil } if key != "" && m.transport != nil { if err := m.transport.ValidatePolicyConfigurationScope(key); err != nil { return nil } } ptr := &PolicyRequirements{} // This allocates a new instance on each call. tmpMap[key] = ptr return ptr }); err != nil { return err } for key, ptr := range tmpMap { (*m.dest)[key] = *ptr } return nil } // Compile-time check that PolicyRequirements implements json.Unmarshaler. var _ json.Unmarshaler = (*PolicyRequirements)(nil) // UnmarshalJSON implements the json.Unmarshaler interface. func (m *PolicyRequirements) UnmarshalJSON(data []byte) error { reqJSONs := []json.RawMessage{} if err := json.Unmarshal(data, &reqJSONs); err != nil { return err } if len(reqJSONs) == 0 { return InvalidPolicyFormatError("List of verification policy requirements must not be empty") } res := make([]PolicyRequirement, len(reqJSONs)) for i, reqJSON := range reqJSONs { req, err := newPolicyRequirementFromJSON(reqJSON) if err != nil { return err } res[i] = req } *m = res return nil } // newPolicyRequirementFromJSON parses JSON data into a PolicyRequirement implementation. func newPolicyRequirementFromJSON(data []byte) (PolicyRequirement, error) { var typeField prCommon if err := json.Unmarshal(data, &typeField); err != nil { return nil, err } var res PolicyRequirement switch typeField.Type { case prTypeInsecureAcceptAnything: res = &prInsecureAcceptAnything{} case prTypeReject: res = &prReject{} case prTypeSignedBy: res = &prSignedBy{} case prTypeSignedBaseLayer: res = &prSignedBaseLayer{} case prTypeSigstoreSigned: res = &prSigstoreSigned{} default: return nil, InvalidPolicyFormatError(fmt.Sprintf("Unknown policy requirement type %q", typeField.Type)) } if err := json.Unmarshal(data, &res); err != nil { return nil, err } return res, nil } // newPRInsecureAcceptAnything is NewPRInsecureAcceptAnything, except it returns the private type. func newPRInsecureAcceptAnything() *prInsecureAcceptAnything { return &prInsecureAcceptAnything{prCommon{Type: prTypeInsecureAcceptAnything}} } // NewPRInsecureAcceptAnything returns a new "insecureAcceptAnything" PolicyRequirement. func NewPRInsecureAcceptAnything() PolicyRequirement { return newPRInsecureAcceptAnything() } // Compile-time check that prInsecureAcceptAnything implements json.Unmarshaler. var _ json.Unmarshaler = (*prInsecureAcceptAnything)(nil) // UnmarshalJSON implements the json.Unmarshaler interface. func (pr *prInsecureAcceptAnything) UnmarshalJSON(data []byte) error { *pr = prInsecureAcceptAnything{} var tmp prInsecureAcceptAnything if err := internal.ParanoidUnmarshalJSONObjectExactFields(data, map[string]any{ "type": &tmp.Type, }); err != nil { return err } if tmp.Type != prTypeInsecureAcceptAnything { return InvalidPolicyFormatError(fmt.Sprintf("Unexpected policy requirement type %q", tmp.Type)) } *pr = *newPRInsecureAcceptAnything() return nil } // newPRReject is NewPRReject, except it returns the private type. func newPRReject() *prReject { return &prReject{prCommon{Type: prTypeReject}} } // NewPRReject returns a new "reject" PolicyRequirement. func NewPRReject() PolicyRequirement { return newPRReject() } // Compile-time check that prReject implements json.Unmarshaler. var _ json.Unmarshaler = (*prReject)(nil) // UnmarshalJSON implements the json.Unmarshaler interface. func (pr *prReject) UnmarshalJSON(data []byte) error { *pr = prReject{} var tmp prReject if err := internal.ParanoidUnmarshalJSONObjectExactFields(data, map[string]any{ "type": &tmp.Type, }); err != nil { return err } if tmp.Type != prTypeReject { return InvalidPolicyFormatError(fmt.Sprintf("Unexpected policy requirement type %q", tmp.Type)) } *pr = *newPRReject() return nil } // newPRSignedBy returns a new prSignedBy if parameters are valid. func newPRSignedBy(keyType sbKeyType, keyPath string, keyPaths []string, keyData []byte, signedIdentity PolicyReferenceMatch) (*prSignedBy, error) { if !keyType.IsValid() { return nil, InvalidPolicyFormatError(fmt.Sprintf("invalid keyType %q", keyType)) } keySources := 0 if keyPath != "" { keySources++ } if keyPaths != nil { keySources++ } if keyData != nil { keySources++ } if keySources != 1 { return nil, InvalidPolicyFormatError("exactly one of keyPath, keyPaths and keyData must be specified") } if signedIdentity == nil { return nil, InvalidPolicyFormatError("signedIdentity not specified") } return &prSignedBy{ prCommon: prCommon{Type: prTypeSignedBy}, KeyType: keyType, KeyPath: keyPath, KeyPaths: keyPaths, KeyData: keyData, SignedIdentity: signedIdentity, }, nil } // newPRSignedByKeyPath is NewPRSignedByKeyPath, except it returns the private type. func newPRSignedByKeyPath(keyType sbKeyType, keyPath string, signedIdentity PolicyReferenceMatch) (*prSignedBy, error) { return newPRSignedBy(keyType, keyPath, nil, nil, signedIdentity) } // NewPRSignedByKeyPath returns a new "signedBy" PolicyRequirement using a KeyPath func NewPRSignedByKeyPath(keyType sbKeyType, keyPath string, signedIdentity PolicyReferenceMatch) (PolicyRequirement, error) { return newPRSignedByKeyPath(keyType, keyPath, signedIdentity) } // newPRSignedByKeyPaths is NewPRSignedByKeyPaths, except it returns the private type. func newPRSignedByKeyPaths(keyType sbKeyType, keyPaths []string, signedIdentity PolicyReferenceMatch) (*prSignedBy, error) { return newPRSignedBy(keyType, "", keyPaths, nil, signedIdentity) } // NewPRSignedByKeyPaths returns a new "signedBy" PolicyRequirement using KeyPaths func NewPRSignedByKeyPaths(keyType sbKeyType, keyPaths []string, signedIdentity PolicyReferenceMatch) (PolicyRequirement, error) { return newPRSignedByKeyPaths(keyType, keyPaths, signedIdentity) } // newPRSignedByKeyData is NewPRSignedByKeyData, except it returns the private type. func newPRSignedByKeyData(keyType sbKeyType, keyData []byte, signedIdentity PolicyReferenceMatch) (*prSignedBy, error) { return newPRSignedBy(keyType, "", nil, keyData, signedIdentity) } // NewPRSignedByKeyData returns a new "signedBy" PolicyRequirement using a KeyData func NewPRSignedByKeyData(keyType sbKeyType, keyData []byte, signedIdentity PolicyReferenceMatch) (PolicyRequirement, error) { return newPRSignedByKeyData(keyType, keyData, signedIdentity) } // Compile-time check that prSignedBy implements json.Unmarshaler. var _ json.Unmarshaler = (*prSignedBy)(nil) // UnmarshalJSON implements the json.Unmarshaler interface. func (pr *prSignedBy) UnmarshalJSON(data []byte) error { *pr = prSignedBy{} var tmp prSignedBy gotKeyPath, gotKeyPaths, gotKeyData := false, false, false var signedIdentity json.RawMessage if err := internal.ParanoidUnmarshalJSONObject(data, func(key string) any { switch key { case "type": return &tmp.Type case "keyType": return &tmp.KeyType case "keyPath": gotKeyPath = true return &tmp.KeyPath case "keyPaths": gotKeyPaths = true return &tmp.KeyPaths case "keyData": gotKeyData = true return &tmp.KeyData case "signedIdentity": return &signedIdentity default: return nil } }); err != nil { return err } if tmp.Type != prTypeSignedBy { return InvalidPolicyFormatError(fmt.Sprintf("Unexpected policy requirement type %q", tmp.Type)) } if signedIdentity == nil { tmp.SignedIdentity = NewPRMMatchRepoDigestOrExact() } else { si, err := newPolicyReferenceMatchFromJSON(signedIdentity) if err != nil { return err } tmp.SignedIdentity = si } var res *prSignedBy var err error switch { case gotKeyPath && !gotKeyPaths && !gotKeyData: res, err = newPRSignedByKeyPath(tmp.KeyType, tmp.KeyPath, tmp.SignedIdentity) case !gotKeyPath && gotKeyPaths && !gotKeyData: res, err = newPRSignedByKeyPaths(tmp.KeyType, tmp.KeyPaths, tmp.SignedIdentity) case !gotKeyPath && !gotKeyPaths && gotKeyData: res, err = newPRSignedByKeyData(tmp.KeyType, tmp.KeyData, tmp.SignedIdentity) case !gotKeyPath && !gotKeyPaths && !gotKeyData: return InvalidPolicyFormatError("Exactly one of keyPath, keyPaths and keyData must be specified, none of them present") default: return fmt.Errorf("Exactly one of keyPath, keyPaths and keyData must be specified, more than one present") } if err != nil { return err } *pr = *res return nil } // IsValid returns true iff kt is a recognized value func (kt sbKeyType) IsValid() bool { switch kt { case SBKeyTypeGPGKeys, SBKeyTypeSignedByGPGKeys, SBKeyTypeX509Certificates, SBKeyTypeSignedByX509CAs: return true default: return false } } // Compile-time check that sbKeyType implements json.Unmarshaler. var _ json.Unmarshaler = (*sbKeyType)(nil) // UnmarshalJSON implements the json.Unmarshaler interface. func (kt *sbKeyType) UnmarshalJSON(data []byte) error { *kt = sbKeyType("") var s string if err := json.Unmarshal(data, &s); err != nil { return err } if !sbKeyType(s).IsValid() { return InvalidPolicyFormatError(fmt.Sprintf("Unrecognized keyType value %q", s)) } *kt = sbKeyType(s) return nil } // newPRSignedBaseLayer is NewPRSignedBaseLayer, except it returns the private type. func newPRSignedBaseLayer(baseLayerIdentity PolicyReferenceMatch) (*prSignedBaseLayer, error) { if baseLayerIdentity == nil { return nil, InvalidPolicyFormatError("baseLayerIdentity not specified") } return &prSignedBaseLayer{ prCommon: prCommon{Type: prTypeSignedBaseLayer}, BaseLayerIdentity: baseLayerIdentity, }, nil } // NewPRSignedBaseLayer returns a new "signedBaseLayer" PolicyRequirement. func NewPRSignedBaseLayer(baseLayerIdentity PolicyReferenceMatch) (PolicyRequirement, error) { return newPRSignedBaseLayer(baseLayerIdentity) } // Compile-time check that prSignedBaseLayer implements json.Unmarshaler. var _ json.Unmarshaler = (*prSignedBaseLayer)(nil) // UnmarshalJSON implements the json.Unmarshaler interface. func (pr *prSignedBaseLayer) UnmarshalJSON(data []byte) error { *pr = prSignedBaseLayer{} var tmp prSignedBaseLayer var baseLayerIdentity json.RawMessage if err := internal.ParanoidUnmarshalJSONObjectExactFields(data, map[string]any{ "type": &tmp.Type, "baseLayerIdentity": &baseLayerIdentity, }); err != nil { return err } if tmp.Type != prTypeSignedBaseLayer { return InvalidPolicyFormatError(fmt.Sprintf("Unexpected policy requirement type %q", tmp.Type)) } bli, err := newPolicyReferenceMatchFromJSON(baseLayerIdentity) if err != nil { return err } res, err := newPRSignedBaseLayer(bli) if err != nil { // Coverage: This should never happen, newPolicyReferenceMatchFromJSON has ensured bli is valid. return err } *pr = *res return nil } // newPolicyReferenceMatchFromJSON parses JSON data into a PolicyReferenceMatch implementation. func newPolicyReferenceMatchFromJSON(data []byte) (PolicyReferenceMatch, error) { var typeField prmCommon if err := json.Unmarshal(data, &typeField); err != nil { return nil, err } var res PolicyReferenceMatch switch typeField.Type { case prmTypeMatchExact: res = &prmMatchExact{} case prmTypeMatchRepoDigestOrExact: res = &prmMatchRepoDigestOrExact{} case prmTypeMatchRepository: res = &prmMatchRepository{} case prmTypeExactReference: res = &prmExactReference{} case prmTypeExactRepository: res = &prmExactRepository{} case prmTypeRemapIdentity: res = &prmRemapIdentity{} default: return nil, InvalidPolicyFormatError(fmt.Sprintf("Unknown policy reference match type %q", typeField.Type)) } if err := json.Unmarshal(data, &res); err != nil { return nil, err } return res, nil } // newPRMMatchExact is NewPRMMatchExact, except it returns the private type. func newPRMMatchExact() *prmMatchExact { return &prmMatchExact{prmCommon{Type: prmTypeMatchExact}} } // NewPRMMatchExact returns a new "matchExact" PolicyReferenceMatch. func NewPRMMatchExact() PolicyReferenceMatch { return newPRMMatchExact() } // Compile-time check that prmMatchExact implements json.Unmarshaler. var _ json.Unmarshaler = (*prmMatchExact)(nil) // UnmarshalJSON implements the json.Unmarshaler interface. func (prm *prmMatchExact) UnmarshalJSON(data []byte) error { *prm = prmMatchExact{} var tmp prmMatchExact if err := internal.ParanoidUnmarshalJSONObjectExactFields(data, map[string]any{ "type": &tmp.Type, }); err != nil { return err } if tmp.Type != prmTypeMatchExact { return InvalidPolicyFormatError(fmt.Sprintf("Unexpected policy requirement type %q", tmp.Type)) } *prm = *newPRMMatchExact() return nil } // newPRMMatchRepoDigestOrExact is NewPRMMatchRepoDigestOrExact, except it returns the private type. func newPRMMatchRepoDigestOrExact() *prmMatchRepoDigestOrExact { return &prmMatchRepoDigestOrExact{prmCommon{Type: prmTypeMatchRepoDigestOrExact}} } // NewPRMMatchRepoDigestOrExact returns a new "matchRepoDigestOrExact" PolicyReferenceMatch. func NewPRMMatchRepoDigestOrExact() PolicyReferenceMatch { return newPRMMatchRepoDigestOrExact() } // Compile-time check that prmMatchRepoDigestOrExact implements json.Unmarshaler. var _ json.Unmarshaler = (*prmMatchRepoDigestOrExact)(nil) // UnmarshalJSON implements the json.Unmarshaler interface. func (prm *prmMatchRepoDigestOrExact) UnmarshalJSON(data []byte) error { *prm = prmMatchRepoDigestOrExact{} var tmp prmMatchRepoDigestOrExact if err := internal.ParanoidUnmarshalJSONObjectExactFields(data, map[string]any{ "type": &tmp.Type, }); err != nil { return err } if tmp.Type != prmTypeMatchRepoDigestOrExact { return InvalidPolicyFormatError(fmt.Sprintf("Unexpected policy requirement type %q", tmp.Type)) } *prm = *newPRMMatchRepoDigestOrExact() return nil } // newPRMMatchRepository is NewPRMMatchRepository, except it returns the private type. func newPRMMatchRepository() *prmMatchRepository { return &prmMatchRepository{prmCommon{Type: prmTypeMatchRepository}} } // NewPRMMatchRepository returns a new "matchRepository" PolicyReferenceMatch. func NewPRMMatchRepository() PolicyReferenceMatch { return newPRMMatchRepository() } // Compile-time check that prmMatchRepository implements json.Unmarshaler. var _ json.Unmarshaler = (*prmMatchRepository)(nil) // UnmarshalJSON implements the json.Unmarshaler interface. func (prm *prmMatchRepository) UnmarshalJSON(data []byte) error { *prm = prmMatchRepository{} var tmp prmMatchRepository if err := internal.ParanoidUnmarshalJSONObjectExactFields(data, map[string]any{ "type": &tmp.Type, }); err != nil { return err } if tmp.Type != prmTypeMatchRepository { return InvalidPolicyFormatError(fmt.Sprintf("Unexpected policy requirement type %q", tmp.Type)) } *prm = *newPRMMatchRepository() return nil } // newPRMExactReference is NewPRMExactReference, except it returns the private type. func newPRMExactReference(dockerReference string) (*prmExactReference, error) { ref, err := reference.ParseNormalizedNamed(dockerReference) if err != nil { return nil, InvalidPolicyFormatError(fmt.Sprintf("Invalid format of dockerReference %q: %s", dockerReference, err.Error())) } if reference.IsNameOnly(ref) { return nil, InvalidPolicyFormatError(fmt.Sprintf("dockerReference %q contains neither a tag nor digest", dockerReference)) } return &prmExactReference{ prmCommon: prmCommon{Type: prmTypeExactReference}, DockerReference: dockerReference, }, nil } // NewPRMExactReference returns a new "exactReference" PolicyReferenceMatch. func NewPRMExactReference(dockerReference string) (PolicyReferenceMatch, error) { return newPRMExactReference(dockerReference) } // Compile-time check that prmExactReference implements json.Unmarshaler. var _ json.Unmarshaler = (*prmExactReference)(nil) // UnmarshalJSON implements the json.Unmarshaler interface. func (prm *prmExactReference) UnmarshalJSON(data []byte) error { *prm = prmExactReference{} var tmp prmExactReference if err := internal.ParanoidUnmarshalJSONObjectExactFields(data, map[string]any{ "type": &tmp.Type, "dockerReference": &tmp.DockerReference, }); err != nil { return err } if tmp.Type != prmTypeExactReference { return InvalidPolicyFormatError(fmt.Sprintf("Unexpected policy requirement type %q", tmp.Type)) } res, err := newPRMExactReference(tmp.DockerReference) if err != nil { return err } *prm = *res return nil } // newPRMExactRepository is NewPRMExactRepository, except it returns the private type. func newPRMExactRepository(dockerRepository string) (*prmExactRepository, error) { if _, err := reference.ParseNormalizedNamed(dockerRepository); err != nil { return nil, InvalidPolicyFormatError(fmt.Sprintf("Invalid format of dockerRepository %q: %s", dockerRepository, err.Error())) } return &prmExactRepository{ prmCommon: prmCommon{Type: prmTypeExactRepository}, DockerRepository: dockerRepository, }, nil } // NewPRMExactRepository returns a new "exactRepository" PolicyRepositoryMatch. func NewPRMExactRepository(dockerRepository string) (PolicyReferenceMatch, error) { return newPRMExactRepository(dockerRepository) } // Compile-time check that prmExactRepository implements json.Unmarshaler. var _ json.Unmarshaler = (*prmExactRepository)(nil) // UnmarshalJSON implements the json.Unmarshaler interface. func (prm *prmExactRepository) UnmarshalJSON(data []byte) error { *prm = prmExactRepository{} var tmp prmExactRepository if err := internal.ParanoidUnmarshalJSONObjectExactFields(data, map[string]any{ "type": &tmp.Type, "dockerRepository": &tmp.DockerRepository, }); err != nil { return err } if tmp.Type != prmTypeExactRepository { return InvalidPolicyFormatError(fmt.Sprintf("Unexpected policy requirement type %q", tmp.Type)) } res, err := newPRMExactRepository(tmp.DockerRepository) if err != nil { return err } *prm = *res return nil } // Private objects for validateIdentityRemappingPrefix var ( // remapIdentityDomainRegexp matches exactly a reference domain (name[:port]) remapIdentityDomainRegexp = regexp.Delayed("^" + reference.DomainRegexp.String() + "$") // remapIdentityDomainPrefixRegexp matches a reference that starts with a domain; // we need this because reference.NameRegexp accepts short names with docker.io implied. remapIdentityDomainPrefixRegexp = regexp.Delayed("^" + reference.DomainRegexp.String() + "/") // remapIdentityNameRegexp matches exactly a reference.Named name (possibly unnormalized) remapIdentityNameRegexp = regexp.Delayed("^" + reference.NameRegexp.String() + "$") ) // validateIdentityRemappingPrefix returns an InvalidPolicyFormatError if s is detected to be invalid // for the Prefix or SignedPrefix values of prmRemapIdentity. // Note that it may not recognize _all_ invalid values. func validateIdentityRemappingPrefix(s string) error { if remapIdentityDomainRegexp.MatchString(s) || (remapIdentityNameRegexp.MatchString(s) && remapIdentityDomainPrefixRegexp.MatchString(s)) { // FIXME? This does not reject "shortname" nor "ns/shortname", because docker/reference // does not provide an API for the short vs. long name logic. // It will either not match, or fail in the ParseNamed call of // prmRemapIdentity.remapReferencePrefix when trying to use such a prefix. return nil } return InvalidPolicyFormatError(fmt.Sprintf("prefix %q is not valid", s)) } // newPRMRemapIdentity is NewPRMRemapIdentity, except it returns the private type. func newPRMRemapIdentity(prefix, signedPrefix string) (*prmRemapIdentity, error) { if err := validateIdentityRemappingPrefix(prefix); err != nil { return nil, err } if err := validateIdentityRemappingPrefix(signedPrefix); err != nil { return nil, err } return &prmRemapIdentity{ prmCommon: prmCommon{Type: prmTypeRemapIdentity}, Prefix: prefix, SignedPrefix: signedPrefix, }, nil } // NewPRMRemapIdentity returns a new "remapIdentity" PolicyRepositoryMatch. func NewPRMRemapIdentity(prefix, signedPrefix string) (PolicyReferenceMatch, error) { return newPRMRemapIdentity(prefix, signedPrefix) } // Compile-time check that prmRemapIdentity implements json.Unmarshaler. var _ json.Unmarshaler = (*prmRemapIdentity)(nil) // UnmarshalJSON implements the json.Unmarshaler interface. func (prm *prmRemapIdentity) UnmarshalJSON(data []byte) error { *prm = prmRemapIdentity{} var tmp prmRemapIdentity if err := internal.ParanoidUnmarshalJSONObjectExactFields(data, map[string]any{ "type": &tmp.Type, "prefix": &tmp.Prefix, "signedPrefix": &tmp.SignedPrefix, }); err != nil { return err } if tmp.Type != prmTypeRemapIdentity { return InvalidPolicyFormatError(fmt.Sprintf("Unexpected policy requirement type %q", tmp.Type)) } res, err := newPRMRemapIdentity(tmp.Prefix, tmp.SignedPrefix) if err != nil { return err } *prm = *res return nil } ================================================ FILE: vendor/go.podman.io/image/v5/signature/policy_config_sigstore.go ================================================ package signature import ( "encoding/json" "fmt" "go.podman.io/image/v5/signature/internal" ) // PRSigstoreSignedOption is way to pass values to NewPRSigstoreSigned type PRSigstoreSignedOption func(*prSigstoreSigned) error // PRSigstoreSignedWithKeyPath specifies a value for the "keyPath" field when calling NewPRSigstoreSigned. func PRSigstoreSignedWithKeyPath(keyPath string) PRSigstoreSignedOption { return func(pr *prSigstoreSigned) error { if pr.KeyPath != "" { return InvalidPolicyFormatError(`"keyPath" already specified`) } pr.KeyPath = keyPath return nil } } // PRSigstoreSignedWithKeyPaths specifies a value for the "keyPaths" field when calling NewPRSigstoreSigned. func PRSigstoreSignedWithKeyPaths(keyPaths []string) PRSigstoreSignedOption { return func(pr *prSigstoreSigned) error { if pr.KeyPaths != nil { return InvalidPolicyFormatError(`"keyPaths" already specified`) } if len(keyPaths) == 0 { return InvalidPolicyFormatError(`"keyPaths" contains no entries`) } pr.KeyPaths = keyPaths return nil } } // PRSigstoreSignedWithKeyData specifies a value for the "keyData" field when calling NewPRSigstoreSigned. func PRSigstoreSignedWithKeyData(keyData []byte) PRSigstoreSignedOption { return func(pr *prSigstoreSigned) error { if pr.KeyData != nil { return InvalidPolicyFormatError(`"keyData" already specified`) } pr.KeyData = keyData return nil } } // PRSigstoreSignedWithKeyDatas specifies a value for the "keyDatas" field when calling NewPRSigstoreSigned. func PRSigstoreSignedWithKeyDatas(keyDatas [][]byte) PRSigstoreSignedOption { return func(pr *prSigstoreSigned) error { if pr.KeyDatas != nil { return InvalidPolicyFormatError(`"keyDatas" already specified`) } if len(keyDatas) == 0 { return InvalidPolicyFormatError(`"keyDatas" contains no entries`) } pr.KeyDatas = keyDatas return nil } } // PRSigstoreSignedWithFulcio specifies a value for the "fulcio" field when calling NewPRSigstoreSigned. func PRSigstoreSignedWithFulcio(fulcio PRSigstoreSignedFulcio) PRSigstoreSignedOption { return func(pr *prSigstoreSigned) error { if pr.Fulcio != nil { return InvalidPolicyFormatError(`"fulcio" already specified`) } pr.Fulcio = fulcio return nil } } // PRSigstoreSignedWithPKI specifies a value for the "pki" field when calling NewPRSigstoreSigned. func PRSigstoreSignedWithPKI(p PRSigstoreSignedPKI) PRSigstoreSignedOption { return func(pr *prSigstoreSigned) error { if pr.PKI != nil { return InvalidPolicyFormatError(`"pki" already specified`) } pr.PKI = p return nil } } // PRSigstoreSignedWithRekorPublicKeyPath specifies a value for the "rekorPublicKeyPath" field when calling NewPRSigstoreSigned. func PRSigstoreSignedWithRekorPublicKeyPath(rekorPublicKeyPath string) PRSigstoreSignedOption { return func(pr *prSigstoreSigned) error { if pr.RekorPublicKeyPath != "" { return InvalidPolicyFormatError(`"rekorPublicKeyPath" already specified`) } pr.RekorPublicKeyPath = rekorPublicKeyPath return nil } } // PRSigstoreSignedWithRekorPublicKeyPaths specifies a value for the rRekorPublickeyPaths" field when calling NewPRSigstoreSigned. func PRSigstoreSignedWithRekorPublicKeyPaths(rekorPublickeyPaths []string) PRSigstoreSignedOption { return func(pr *prSigstoreSigned) error { if pr.RekorPublicKeyPaths != nil { return InvalidPolicyFormatError(`"rekorPublickeyPaths" already specified`) } if len(rekorPublickeyPaths) == 0 { return InvalidPolicyFormatError(`"rekorPublickeyPaths" contains no entries`) } pr.RekorPublicKeyPaths = rekorPublickeyPaths return nil } } // PRSigstoreSignedWithRekorPublicKeyData specifies a value for the "rekorPublicKeyData" field when calling NewPRSigstoreSigned. func PRSigstoreSignedWithRekorPublicKeyData(rekorPublicKeyData []byte) PRSigstoreSignedOption { return func(pr *prSigstoreSigned) error { if pr.RekorPublicKeyData != nil { return InvalidPolicyFormatError(`"rekorPublicKeyData" already specified`) } pr.RekorPublicKeyData = rekorPublicKeyData return nil } } // PRSigstoreSignedWithRekorPublicKeyDatas specifies a value for the "rekorPublickeyDatas" field when calling NewPRSigstoreSigned. func PRSigstoreSignedWithRekorPublicKeyDatas(rekorPublickeyDatas [][]byte) PRSigstoreSignedOption { return func(pr *prSigstoreSigned) error { if pr.RekorPublicKeyDatas != nil { return InvalidPolicyFormatError(`"rekorPublickeyDatas" already specified`) } if len(rekorPublickeyDatas) == 0 { return InvalidPolicyFormatError(`"rekorPublickeyDatas" contains no entries`) } pr.RekorPublicKeyDatas = rekorPublickeyDatas return nil } } // PRSigstoreSignedWithSignedIdentity specifies a value for the "signedIdentity" field when calling NewPRSigstoreSigned. func PRSigstoreSignedWithSignedIdentity(signedIdentity PolicyReferenceMatch) PRSigstoreSignedOption { return func(pr *prSigstoreSigned) error { if pr.SignedIdentity != nil { return InvalidPolicyFormatError(`"signedIdentity" already specified`) } pr.SignedIdentity = signedIdentity return nil } } // newPRSigstoreSigned is NewPRSigstoreSigned, except it returns the private type. func newPRSigstoreSigned(options ...PRSigstoreSignedOption) (*prSigstoreSigned, error) { res := prSigstoreSigned{ prCommon: prCommon{Type: prTypeSigstoreSigned}, } for _, o := range options { if err := o(&res); err != nil { return nil, err } } keySources := 0 if res.KeyPath != "" { keySources++ } if res.KeyPaths != nil { keySources++ } if res.KeyData != nil { keySources++ } if res.KeyDatas != nil { keySources++ } if res.Fulcio != nil { keySources++ } if res.PKI != nil { keySources++ } if keySources != 1 { return nil, InvalidPolicyFormatError("exactly one of keyPath, keyPaths, keyData, keyDatas, fulcio, and pki must be specified") } rekorSources := 0 if res.RekorPublicKeyPath != "" { rekorSources++ } if res.RekorPublicKeyPaths != nil { rekorSources++ } if res.RekorPublicKeyData != nil { rekorSources++ } if res.RekorPublicKeyDatas != nil { rekorSources++ } if rekorSources > 1 { return nil, InvalidPolicyFormatError("at most one of rekorPublickeyPath, rekorPublicKeyPaths, rekorPublickeyData and rekorPublicKeyDatas can be used simultaneously") } if res.Fulcio != nil && rekorSources == 0 { return nil, InvalidPolicyFormatError("At least one of rekorPublickeyPath, rekorPublicKeyPaths, rekorPublickeyData and rekorPublicKeyDatas must be specified if fulcio is used") } if res.PKI != nil && rekorSources > 0 { return nil, InvalidPolicyFormatError("rekorPublickeyPath, rekorPublicKeyPaths, rekorPublickeyData and rekorPublicKeyDatas are not supported for pki") } if res.SignedIdentity == nil { return nil, InvalidPolicyFormatError("signedIdentity not specified") } return &res, nil } // NewPRSigstoreSigned returns a new "sigstoreSigned" PolicyRequirement based on options. func NewPRSigstoreSigned(options ...PRSigstoreSignedOption) (PolicyRequirement, error) { return newPRSigstoreSigned(options...) } // NewPRSigstoreSignedKeyPath returns a new "sigstoreSigned" PolicyRequirement using a KeyPath func NewPRSigstoreSignedKeyPath(keyPath string, signedIdentity PolicyReferenceMatch) (PolicyRequirement, error) { return NewPRSigstoreSigned( PRSigstoreSignedWithKeyPath(keyPath), PRSigstoreSignedWithSignedIdentity(signedIdentity), ) } // NewPRSigstoreSignedKeyData returns a new "sigstoreSigned" PolicyRequirement using a KeyData func NewPRSigstoreSignedKeyData(keyData []byte, signedIdentity PolicyReferenceMatch) (PolicyRequirement, error) { return NewPRSigstoreSigned( PRSigstoreSignedWithKeyData(keyData), PRSigstoreSignedWithSignedIdentity(signedIdentity), ) } // Compile-time check that prSigstoreSigned implements json.Unmarshaler. var _ json.Unmarshaler = (*prSigstoreSigned)(nil) // UnmarshalJSON implements the json.Unmarshaler interface. func (pr *prSigstoreSigned) UnmarshalJSON(data []byte) error { *pr = prSigstoreSigned{} var tmp prSigstoreSigned var gotKeyPath, gotKeyPaths, gotKeyData, gotKeyDatas, gotFulcio, gotPKI bool var gotRekorPublicKeyPath, gotRekorPublicKeyPaths, gotRekorPublicKeyData, gotRekorPublicKeyDatas bool var fulcio prSigstoreSignedFulcio var pki prSigstoreSignedPKI var signedIdentity json.RawMessage if err := internal.ParanoidUnmarshalJSONObject(data, func(key string) any { switch key { case "type": return &tmp.Type case "keyPath": gotKeyPath = true return &tmp.KeyPath case "keyPaths": gotKeyPaths = true return &tmp.KeyPaths case "keyData": gotKeyData = true return &tmp.KeyData case "keyDatas": gotKeyDatas = true return &tmp.KeyDatas case "fulcio": gotFulcio = true return &fulcio case "rekorPublicKeyPath": gotRekorPublicKeyPath = true return &tmp.RekorPublicKeyPath case "rekorPublicKeyPaths": gotRekorPublicKeyPaths = true return &tmp.RekorPublicKeyPaths case "rekorPublicKeyData": gotRekorPublicKeyData = true return &tmp.RekorPublicKeyData case "rekorPublicKeyDatas": gotRekorPublicKeyDatas = true return &tmp.RekorPublicKeyDatas case "pki": gotPKI = true return &pki case "signedIdentity": return &signedIdentity default: return nil } }); err != nil { return err } if tmp.Type != prTypeSigstoreSigned { return InvalidPolicyFormatError(fmt.Sprintf("Unexpected policy requirement type %q", tmp.Type)) } if signedIdentity == nil { tmp.SignedIdentity = NewPRMMatchRepoDigestOrExact() } else { si, err := newPolicyReferenceMatchFromJSON(signedIdentity) if err != nil { return err } tmp.SignedIdentity = si } var opts []PRSigstoreSignedOption if gotKeyPath { opts = append(opts, PRSigstoreSignedWithKeyPath(tmp.KeyPath)) } if gotKeyPaths { opts = append(opts, PRSigstoreSignedWithKeyPaths(tmp.KeyPaths)) } if gotKeyData { opts = append(opts, PRSigstoreSignedWithKeyData(tmp.KeyData)) } if gotKeyDatas { opts = append(opts, PRSigstoreSignedWithKeyDatas(tmp.KeyDatas)) } if gotFulcio { opts = append(opts, PRSigstoreSignedWithFulcio(&fulcio)) } if gotRekorPublicKeyPath { opts = append(opts, PRSigstoreSignedWithRekorPublicKeyPath(tmp.RekorPublicKeyPath)) } if gotRekorPublicKeyPaths { opts = append(opts, PRSigstoreSignedWithRekorPublicKeyPaths(tmp.RekorPublicKeyPaths)) } if gotRekorPublicKeyData { opts = append(opts, PRSigstoreSignedWithRekorPublicKeyData(tmp.RekorPublicKeyData)) } if gotRekorPublicKeyDatas { opts = append(opts, PRSigstoreSignedWithRekorPublicKeyDatas(tmp.RekorPublicKeyDatas)) } if gotPKI { opts = append(opts, PRSigstoreSignedWithPKI(&pki)) } opts = append(opts, PRSigstoreSignedWithSignedIdentity(tmp.SignedIdentity)) res, err := newPRSigstoreSigned(opts...) if err != nil { return err } *pr = *res return nil } // PRSigstoreSignedFulcioOption is a way to pass values to NewPRSigstoreSignedFulcio type PRSigstoreSignedFulcioOption func(*prSigstoreSignedFulcio) error // PRSigstoreSignedFulcioWithCAPath specifies a value for the "caPath" field when calling NewPRSigstoreSignedFulcio func PRSigstoreSignedFulcioWithCAPath(caPath string) PRSigstoreSignedFulcioOption { return func(f *prSigstoreSignedFulcio) error { if f.CAPath != "" { return InvalidPolicyFormatError(`"caPath" already specified`) } f.CAPath = caPath return nil } } // PRSigstoreSignedFulcioWithCAData specifies a value for the "caData" field when calling NewPRSigstoreSignedFulcio func PRSigstoreSignedFulcioWithCAData(caData []byte) PRSigstoreSignedFulcioOption { return func(f *prSigstoreSignedFulcio) error { if f.CAData != nil { return InvalidPolicyFormatError(`"caData" already specified`) } f.CAData = caData return nil } } // PRSigstoreSignedFulcioWithOIDCIssuer specifies a value for the "oidcIssuer" field when calling NewPRSigstoreSignedFulcio func PRSigstoreSignedFulcioWithOIDCIssuer(oidcIssuer string) PRSigstoreSignedFulcioOption { return func(f *prSigstoreSignedFulcio) error { if f.OIDCIssuer != "" { return InvalidPolicyFormatError(`"oidcIssuer" already specified`) } f.OIDCIssuer = oidcIssuer return nil } } // PRSigstoreSignedFulcioWithSubjectEmail specifies a value for the "subjectEmail" field when calling NewPRSigstoreSignedFulcio func PRSigstoreSignedFulcioWithSubjectEmail(subjectEmail string) PRSigstoreSignedFulcioOption { return func(f *prSigstoreSignedFulcio) error { if f.SubjectEmail != "" { return InvalidPolicyFormatError(`"subjectEmail" already specified`) } f.SubjectEmail = subjectEmail return nil } } // newPRSigstoreSignedFulcio is NewPRSigstoreSignedFulcio, except it returns the private type func newPRSigstoreSignedFulcio(options ...PRSigstoreSignedFulcioOption) (*prSigstoreSignedFulcio, error) { res := prSigstoreSignedFulcio{} for _, o := range options { if err := o(&res); err != nil { return nil, err } } if res.CAPath != "" && res.CAData != nil { return nil, InvalidPolicyFormatError("caPath and caData cannot be used simultaneously") } if res.CAPath == "" && res.CAData == nil { return nil, InvalidPolicyFormatError("At least one of caPath and caData must be specified") } if res.OIDCIssuer == "" { return nil, InvalidPolicyFormatError("oidcIssuer not specified") } if res.SubjectEmail == "" { return nil, InvalidPolicyFormatError("subjectEmail not specified") } return &res, nil } // NewPRSigstoreSignedFulcio returns a PRSigstoreSignedFulcio based on options. func NewPRSigstoreSignedFulcio(options ...PRSigstoreSignedFulcioOption) (PRSigstoreSignedFulcio, error) { return newPRSigstoreSignedFulcio(options...) } // Compile-time check that prSigstoreSignedFulcio implements json.Unmarshaler. var _ json.Unmarshaler = (*prSigstoreSignedFulcio)(nil) func (f *prSigstoreSignedFulcio) UnmarshalJSON(data []byte) error { *f = prSigstoreSignedFulcio{} var tmp prSigstoreSignedFulcio var gotCAPath, gotCAData, gotOIDCIssuer, gotSubjectEmail bool // = false... if err := internal.ParanoidUnmarshalJSONObject(data, func(key string) any { switch key { case "caPath": gotCAPath = true return &tmp.CAPath case "caData": gotCAData = true return &tmp.CAData case "oidcIssuer": gotOIDCIssuer = true return &tmp.OIDCIssuer case "subjectEmail": gotSubjectEmail = true return &tmp.SubjectEmail default: return nil } }); err != nil { return err } var opts []PRSigstoreSignedFulcioOption if gotCAPath { opts = append(opts, PRSigstoreSignedFulcioWithCAPath(tmp.CAPath)) } if gotCAData { opts = append(opts, PRSigstoreSignedFulcioWithCAData(tmp.CAData)) } if gotOIDCIssuer { opts = append(opts, PRSigstoreSignedFulcioWithOIDCIssuer(tmp.OIDCIssuer)) } if gotSubjectEmail { opts = append(opts, PRSigstoreSignedFulcioWithSubjectEmail(tmp.SubjectEmail)) } res, err := newPRSigstoreSignedFulcio(opts...) if err != nil { return err } *f = *res return nil } // PRSigstoreSignedPKIOption is a way to pass values to NewPRSigstoreSignedPKI type PRSigstoreSignedPKIOption func(*prSigstoreSignedPKI) error // PRSigstoreSignedPKIWithCARootsPath specifies a value for the "caRootsPath" field when calling NewPRSigstoreSignedPKI func PRSigstoreSignedPKIWithCARootsPath(caRootsPath string) PRSigstoreSignedPKIOption { return func(p *prSigstoreSignedPKI) error { if p.CARootsPath != "" { return InvalidPolicyFormatError(`"caRootsPath" already specified`) } p.CARootsPath = caRootsPath return nil } } // PRSigstoreSignedPKIWithCARootsData specifies a value for the "caRootsData" field when calling NewPRSigstoreSignedPKI func PRSigstoreSignedPKIWithCARootsData(caRootsData []byte) PRSigstoreSignedPKIOption { return func(p *prSigstoreSignedPKI) error { if p.CARootsData != nil { return InvalidPolicyFormatError(`"caRootsData" already specified`) } p.CARootsData = caRootsData return nil } } // PRSigstoreSignedPKIWithCAIntermediatesPath specifies a value for the "caIntermediatesPath" field when calling NewPRSigstoreSignedPKI func PRSigstoreSignedPKIWithCAIntermediatesPath(caIntermediatesPath string) PRSigstoreSignedPKIOption { return func(p *prSigstoreSignedPKI) error { if p.CAIntermediatesPath != "" { return InvalidPolicyFormatError(`"caIntermediatesPath" already specified`) } p.CAIntermediatesPath = caIntermediatesPath return nil } } // PRSigstoreSignedPKIWithCAIntermediatesData specifies a value for the "caIntermediatesData" field when calling NewPRSigstoreSignedPKI func PRSigstoreSignedPKIWithCAIntermediatesData(caIntermediatesData []byte) PRSigstoreSignedPKIOption { return func(p *prSigstoreSignedPKI) error { if p.CAIntermediatesData != nil { return InvalidPolicyFormatError(`"caIntermediatesData" already specified`) } p.CAIntermediatesData = caIntermediatesData return nil } } // PRSigstoreSignedPKIWithSubjectEmail specifies a value for the "subjectEmail" field when calling NewPRSigstoreSignedPKI func PRSigstoreSignedPKIWithSubjectEmail(subjectEmail string) PRSigstoreSignedPKIOption { return func(p *prSigstoreSignedPKI) error { if p.SubjectEmail != "" { return InvalidPolicyFormatError(`"subjectEmail" already specified`) } p.SubjectEmail = subjectEmail return nil } } // PRSigstoreSignedPKIWithSubjectHostname specifies a value for the "subjectHostname" field when calling NewPRSigstoreSignedPKI func PRSigstoreSignedPKIWithSubjectHostname(subjectHostname string) PRSigstoreSignedPKIOption { return func(p *prSigstoreSignedPKI) error { if p.SubjectHostname != "" { return InvalidPolicyFormatError(`"subjectHostname" already specified`) } p.SubjectHostname = subjectHostname return nil } } // newPRSigstoreSignedPKI is NewPRSigstoreSignedPKI, except it returns the private type func newPRSigstoreSignedPKI(options ...PRSigstoreSignedPKIOption) (*prSigstoreSignedPKI, error) { res := prSigstoreSignedPKI{} for _, o := range options { if err := o(&res); err != nil { return nil, err } } if res.CARootsPath != "" && res.CARootsData != nil { return nil, InvalidPolicyFormatError("caRootsPath and caRootsData cannot be used simultaneously") } if res.CARootsPath == "" && res.CARootsData == nil { return nil, InvalidPolicyFormatError("At least one of caRootsPath and caRootsData must be specified") } if res.CAIntermediatesPath != "" && res.CAIntermediatesData != nil { return nil, InvalidPolicyFormatError("caIntermediatesPath and caIntermediatesData cannot be used simultaneously") } if res.SubjectEmail == "" && res.SubjectHostname == "" { return nil, InvalidPolicyFormatError("At least one of subjectEmail, subjectHostname must be specified") } return &res, nil } // NewPRSigstoreSignedPKI returns a PRSigstoreSignedPKI based on options. func NewPRSigstoreSignedPKI(options ...PRSigstoreSignedPKIOption) (PRSigstoreSignedPKI, error) { return newPRSigstoreSignedPKI(options...) } // Compile-time check that prSigstoreSignedPKI implements json.Unmarshaler. var _ json.Unmarshaler = (*prSigstoreSignedPKI)(nil) func (p *prSigstoreSignedPKI) UnmarshalJSON(data []byte) error { *p = prSigstoreSignedPKI{} var tmp prSigstoreSignedPKI var gotCARootsPath, gotCARootsData, gotCAIntermediatesPath, gotCAIntermediatesData, gotSubjectEmail, gotSubjectHostname bool if err := internal.ParanoidUnmarshalJSONObject(data, func(key string) any { switch key { case "caRootsPath": gotCARootsPath = true return &tmp.CARootsPath case "caRootsData": gotCARootsData = true return &tmp.CARootsData case "caIntermediatesPath": gotCAIntermediatesPath = true return &tmp.CAIntermediatesPath case "caIntermediatesData": gotCAIntermediatesData = true return &tmp.CAIntermediatesData case "subjectEmail": gotSubjectEmail = true return &tmp.SubjectEmail case "subjectHostname": gotSubjectHostname = true return &tmp.SubjectHostname default: return nil } }); err != nil { return err } var opts []PRSigstoreSignedPKIOption if gotCARootsPath { opts = append(opts, PRSigstoreSignedPKIWithCARootsPath(tmp.CARootsPath)) } if gotCARootsData { opts = append(opts, PRSigstoreSignedPKIWithCARootsData(tmp.CARootsData)) } if gotCAIntermediatesPath { opts = append(opts, PRSigstoreSignedPKIWithCAIntermediatesPath(tmp.CAIntermediatesPath)) } if gotCAIntermediatesData { opts = append(opts, PRSigstoreSignedPKIWithCAIntermediatesData(tmp.CAIntermediatesData)) } if gotSubjectEmail { opts = append(opts, PRSigstoreSignedPKIWithSubjectEmail(tmp.SubjectEmail)) } if gotSubjectHostname { opts = append(opts, PRSigstoreSignedPKIWithSubjectHostname(tmp.SubjectHostname)) } res, err := newPRSigstoreSignedPKI(opts...) if err != nil { return err } *p = *res return nil } ================================================ FILE: vendor/go.podman.io/image/v5/signature/policy_eval.go ================================================ // This defines the top-level policy evaluation API. // To the extent possible, the interface of the functions provided // here is intended to be completely unambiguous, and stable for users // to rely on. package signature import ( "context" "fmt" "github.com/sirupsen/logrus" "go.podman.io/image/v5/internal/private" "go.podman.io/image/v5/internal/unparsedimage" "go.podman.io/image/v5/types" ) // PolicyRequirementError is an explanatory text for rejecting a signature or an image. type PolicyRequirementError string func (err PolicyRequirementError) Error() string { return string(err) } // signatureAcceptanceResult is the principal value returned by isSignatureAuthorAccepted. type signatureAcceptanceResult string const ( sarAccepted signatureAcceptanceResult = "sarAccepted" sarRejected signatureAcceptanceResult = "sarRejected" sarUnknown signatureAcceptanceResult = "sarUnknown" ) // PolicyRequirement is a rule which must be satisfied by at least one of the signatures of an image. // The type is public, but its definition is private. type PolicyRequirement interface { // FIXME: For speed, we should support creating per-context state (not stored in the PolicyRequirement), to cache // costly initialization like creating temporary GPG home directories and reading files. // Setup() (someState, error) // Then, the operations below would be done on the someState object, not directly on a PolicyRequirement. // isSignatureAuthorAccepted, given an image and a signature blob, returns: // - sarAccepted if the signature has been verified against the appropriate public key // (where "appropriate public key" may depend on the contents of the signature); // in that case a parsed Signature should be returned. // - sarRejected if the signature has not been verified; // in that case error must be non-nil, and should be an PolicyRequirementError if evaluation // succeeded but the result was rejection. // - sarUnknown if this PolicyRequirement does not deal with signatures. // NOTE: sarUnknown should not be returned if this PolicyRequirement should make a decision but something failed. // Returning sarUnknown and a non-nil error value is invalid. // WARNING: This makes the signature contents acceptable for further processing, // but it does not necessarily mean that the contents of the signature are // consistent with local policy. // For example: // - Do not use a true value to determine whether to run // a container based on this image; use IsRunningImageAllowed instead. // - Just because a signature is accepted does not automatically mean the contents of the // signature are authorized to run code as root, or to affect system or cluster configuration. isSignatureAuthorAccepted(ctx context.Context, image private.UnparsedImage, sig []byte) (signatureAcceptanceResult, *Signature, error) // isRunningImageAllowed returns true if the requirement allows running an image. // If it returns false, err must be non-nil, and should be an PolicyRequirementError if evaluation // succeeded but the result was rejection. // WARNING: This validates signatures and the manifest, but does not download or validate the // layers. Users must validate that the layers match their expected digests. isRunningImageAllowed(ctx context.Context, image private.UnparsedImage) (bool, error) // verifiesSignatures returns true if and only if the requirement performs cryptographic // signature verification on the entire contents of the image before allowing it. verifiesSignatures() bool } // PolicyReferenceMatch specifies a set of image identities accepted in PolicyRequirement. // The type is public, but its implementation is private. type PolicyReferenceMatch interface { // matchesDockerReference decides whether a specific image identity is accepted for an image // (or, usually, for the image's Reference().DockerReference()). Note that // image.Reference().DockerReference() may be nil. matchesDockerReference(image private.UnparsedImage, signatureDockerReference string) bool } // PolicyContext encapsulates a policy and possible cached state // for speeding up its evaluation. type PolicyContext struct { Policy *Policy state policyContextState // Internal consistency checking requireSigned bool } // policyContextState is used internally to verify the users are not misusing a PolicyContext. type policyContextState string const ( pcInitializing policyContextState = "Initializing" pcReady policyContextState = "Ready" pcInUse policyContextState = "InUse" pcDestroying policyContextState = "Destroying" pcDestroyed policyContextState = "Destroyed" ) // changeState changes pc.state, or fails if the state is unexpected func (pc *PolicyContext) changeState(expected, new policyContextState) error { if pc.state != expected { return fmt.Errorf(`Invalid PolicyContext state, expected %q, found %q`, expected, pc.state) } pc.state = new return nil } // NewPolicyContext sets up and initializes a context for the specified policy. // The policy must not be modified while the context exists. FIXME: make a deep copy? // If this function succeeds, the caller should call PolicyContext.Destroy() when done. func NewPolicyContext(policy *Policy) (*PolicyContext, error) { pc := &PolicyContext{Policy: policy, state: pcInitializing} // FIXME: initialize if err := pc.changeState(pcInitializing, pcReady); err != nil { // Huh?! This should never fail, we didn't give the pointer to anybody. // Just give up and leave unclean state around. return nil, err } return pc, nil } // Destroy should be called when the user of the context is done with it. func (pc *PolicyContext) Destroy() error { if err := pc.changeState(pcReady, pcDestroying); err != nil { return err } // FIXME: destroy return pc.changeState(pcDestroying, pcDestroyed) } // policyIdentityLogName returns a string description of the image identity for policy purposes. // ONLY use this for log messages, not for any decisions! func policyIdentityLogName(ref types.ImageReference) string { return ref.Transport().Name() + ":" + ref.PolicyConfigurationIdentity() } // RequireSignatureVerification modifies policy requirement handling. If passed // `true`, at least one policy requirement which performs signature verification // on the entire image contents must be present. func (pc *PolicyContext) RequireSignatureVerification(val bool) { pc.requireSigned = val } // requirementsForImageRef selects the appropriate requirements for ref. func (pc *PolicyContext) requirementsForImageRef(ref types.ImageReference) PolicyRequirements { // Do we have a PolicyTransportScopes for this transport? transportName := ref.Transport().Name() if transportScopes, ok := pc.Policy.Transports[transportName]; ok { // Look for a full match. identity := ref.PolicyConfigurationIdentity() if req, ok := transportScopes[identity]; ok { logrus.Debugf(` Using transport %q policy section %q`, transportName, identity) return req } // Look for a match of the possible parent namespaces. for _, name := range ref.PolicyConfigurationNamespaces() { if req, ok := transportScopes[name]; ok { logrus.Debugf(` Using transport %q specific policy section %q`, transportName, name) return req } } // Look for a default match for the transport. if req, ok := transportScopes[""]; ok { logrus.Debugf(` Using transport %q policy section ""`, transportName) return req } } logrus.Debugf(" Using default policy section") return pc.Policy.Default } // GetSignaturesWithAcceptedAuthor returns those signatures from an image // for which the policy accepts the author (and which have been successfully // verified). // NOTE: This may legitimately return an empty list and no error, if the image // has no signatures or only invalid signatures. // WARNING: This makes the signature contents acceptable for further processing, // but it does not necessarily mean that the contents of the signature are // consistent with local policy. // For example: // - Do not use a an existence of an accepted signature to determine whether to run // a container based on this image; use IsRunningImageAllowed instead. // - Just because a signature is accepted does not automatically mean the contents of the // signature are authorized to run code as root, or to affect system or cluster configuration. func (pc *PolicyContext) GetSignaturesWithAcceptedAuthor(ctx context.Context, publicImage types.UnparsedImage) (sigs []*Signature, finalErr error) { if err := pc.changeState(pcReady, pcInUse); err != nil { return nil, err } defer func() { if err := pc.changeState(pcInUse, pcReady); err != nil { sigs = nil finalErr = err } }() image := unparsedimage.FromPublic(publicImage) logrus.Debugf("GetSignaturesWithAcceptedAuthor for image %s", policyIdentityLogName(image.Reference())) reqs := pc.requirementsForImageRef(image.Reference()) // FIXME: Use image.UntrustedSignatures, use that to improve error messages (needs tests!) unverifiedSignatures, err := image.Signatures(ctx) if err != nil { return nil, err } res := make([]*Signature, 0, len(unverifiedSignatures)) for sigNumber, sig := range unverifiedSignatures { var acceptedSig *Signature // non-nil if accepted rejected := false // FIXME? Say more about the contents of the signature, i.e. parse it even before verification?! logrus.Debugf("Evaluating signature %d:", sigNumber) interpretingReqs: for reqNumber, req := range reqs { // FIXME: Log the requirement itself? For now, we use just the number. // FIXME: supply state switch res, as, err := req.isSignatureAuthorAccepted(ctx, image, sig); res { case sarAccepted: if as == nil { // Coverage: this should never happen logrus.Debugf(" Requirement %d: internal inconsistency: sarAccepted but no parsed contents", reqNumber) rejected = true break interpretingReqs } logrus.Debugf(" Requirement %d: signature accepted", reqNumber) if acceptedSig == nil { acceptedSig = as } else if *as != *acceptedSig { // Coverage: this should never happen // Huh?! Two ways of verifying the same signature blob resulted in two different parses of its already accepted contents? logrus.Debugf(" Requirement %d: internal inconsistency: sarAccepted but different parsed contents", reqNumber) rejected = true acceptedSig = nil break interpretingReqs } case sarRejected: logrus.Debugf(" Requirement %d: signature rejected: %s", reqNumber, err.Error()) rejected = true break interpretingReqs case sarUnknown: if err != nil { // Coverage: this should never happen logrus.Debugf(" Requirement %d: internal inconsistency: sarUnknown but an error message %s", reqNumber, err.Error()) rejected = true break interpretingReqs } logrus.Debugf(" Requirement %d: signature state unknown, continuing", reqNumber) default: // Coverage: this should never happen logrus.Debugf(" Requirement %d: internal inconsistency: unknown result %#v", reqNumber, string(res)) rejected = true break interpretingReqs } } // This also handles the (invalid) case of empty reqs, by rejecting the signature. if acceptedSig != nil && !rejected { logrus.Debugf(" Overall: OK, signature accepted") res = append(res, acceptedSig) } else { logrus.Debugf(" Overall: Signature not accepted") } } return res, nil } // IsRunningImageAllowed returns true iff the policy allows running the image. // If it returns false, err must be non-nil, and should be an PolicyRequirementError if evaluation // succeeded but the result was rejection. // WARNING: This validates signatures and the manifest, but does not download or validate the // layers. Users must validate that the layers match their expected digests. func (pc *PolicyContext) IsRunningImageAllowed(ctx context.Context, publicImage types.UnparsedImage) (res bool, finalErr error) { if err := pc.changeState(pcReady, pcInUse); err != nil { return false, err } defer func() { if err := pc.changeState(pcInUse, pcReady); err != nil { res = false finalErr = err } }() image := unparsedimage.FromPublic(publicImage) logrus.Debugf("IsRunningImageAllowed for image %s", policyIdentityLogName(image.Reference())) reqs := pc.requirementsForImageRef(image.Reference()) if len(reqs) == 0 { return false, PolicyRequirementError("List of verification policy requirements must not be empty") } wasSignatureVerified := false for reqNumber, req := range reqs { // FIXME: supply state allowed, err := req.isRunningImageAllowed(ctx, image) if !allowed { logrus.Debugf("Requirement %d: denied, done", reqNumber) return false, err } logrus.Debugf(" Requirement %d: allowed", reqNumber) if req.verifiesSignatures() { wasSignatureVerified = true } } if pc.requireSigned && !wasSignatureVerified { return false, PolicyRequirementError(fmt.Sprintf("No signature verification policy found for image %s", policyIdentityLogName(image.Reference()))) } // We have tested that len(reqs) != 0, so at least one req must have explicitly allowed this image. logrus.Debugf("Overall: allowed") return true, nil } ================================================ FILE: vendor/go.podman.io/image/v5/signature/policy_eval_baselayer.go ================================================ // Policy evaluation for prSignedBaseLayer. package signature import ( "context" "github.com/sirupsen/logrus" "go.podman.io/image/v5/internal/private" ) func (pr *prSignedBaseLayer) isSignatureAuthorAccepted(ctx context.Context, image private.UnparsedImage, sig []byte) (signatureAcceptanceResult, *Signature, error) { return sarUnknown, nil, nil } func (pr *prSignedBaseLayer) isRunningImageAllowed(ctx context.Context, image private.UnparsedImage) (bool, error) { // FIXME? Reject this at policy parsing time already? logrus.Errorf("signedBaseLayer not implemented yet!") return false, PolicyRequirementError("signedBaseLayer not implemented yet!") } func (pr *prSignedBaseLayer) verifiesSignatures() bool { return false } ================================================ FILE: vendor/go.podman.io/image/v5/signature/policy_eval_signedby.go ================================================ // Policy evaluation for prSignedBy. package signature import ( "context" "errors" "fmt" digest "github.com/opencontainers/go-digest" "go.podman.io/image/v5/internal/multierr" "go.podman.io/image/v5/internal/private" "go.podman.io/image/v5/manifest" ) func (pr *prSignedBy) isSignatureAuthorAccepted(ctx context.Context, image private.UnparsedImage, sig []byte) (signatureAcceptanceResult, *Signature, error) { switch pr.KeyType { case SBKeyTypeGPGKeys: case SBKeyTypeSignedByGPGKeys, SBKeyTypeX509Certificates, SBKeyTypeSignedByX509CAs: // FIXME? Reject this at policy parsing time already? return sarRejected, nil, fmt.Errorf(`Unimplemented "keyType" value %q`, string(pr.KeyType)) default: // This should never happen, newPRSignedBy ensures KeyType.IsValid() return sarRejected, nil, fmt.Errorf(`Unknown "keyType" value %q`, string(pr.KeyType)) } // FIXME: move this to per-context initialization const notOneSourceErrorText = `Internal inconsistency: not exactly one of "keyPath", "keyPaths" and "keyData" specified` data, err := loadBytesFromConfigSources(configBytesSources{ inconsistencyErrorMessage: notOneSourceErrorText, path: pr.KeyPath, paths: pr.KeyPaths, data: pr.KeyData, }) if err != nil { return sarRejected, nil, err } if data == nil { return sarRejected, nil, errors.New(notOneSourceErrorText) } // FIXME: move this to per-context initialization mech, trustedIdentities, err := newEphemeralGPGSigningMechanism(data) if err != nil { return sarRejected, nil, err } defer mech.Close() if len(trustedIdentities) == 0 { return sarRejected, nil, PolicyRequirementError("No public keys imported") } signature, _, err := verifyAndExtractSignature(mech, sig, signatureAcceptanceRules{ acceptedKeyIdentities: trustedIdentities, validateSignedDockerReference: func(ref string) error { if !pr.SignedIdentity.matchesDockerReference(image, ref) { return PolicyRequirementError(fmt.Sprintf("Signature for identity %q is not accepted", ref)) } return nil }, validateSignedDockerManifestDigest: func(digest digest.Digest) error { m, _, err := image.Manifest(ctx) if err != nil { return err } digestMatches, err := manifest.MatchesDigest(m, digest) if err != nil { return err } if !digestMatches { return PolicyRequirementError(fmt.Sprintf("Signature for digest %s does not match", digest)) } return nil }, }) if err != nil { return sarRejected, nil, err } return sarAccepted, signature, nil } func (pr *prSignedBy) isRunningImageAllowed(ctx context.Context, image private.UnparsedImage) (bool, error) { // FIXME: Use image.UntrustedSignatures, use that to improve error messages // (needs tests!) sigs, err := image.Signatures(ctx) if err != nil { return false, err } var rejections []error for _, s := range sigs { var reason error switch res, _, err := pr.isSignatureAuthorAccepted(ctx, image, s); res { case sarAccepted: // One accepted signature is enough. return true, nil case sarRejected: reason = err case sarUnknown: // Huh?! This should not happen at all; treat it as any other invalid value. fallthrough default: reason = fmt.Errorf(`Internal error: Unexpected signature verification result %q`, string(res)) } rejections = append(rejections, reason) } var summary error switch len(rejections) { case 0: summary = PolicyRequirementError("A signature was required, but no signature exists") case 1: summary = rejections[0] default: summary = PolicyRequirementError(multierr.Format("None of the signatures were accepted, reasons: ", "; ", "", rejections).Error()) } return false, summary } func (pr *prSignedBy) verifiesSignatures() bool { return true } ================================================ FILE: vendor/go.podman.io/image/v5/signature/policy_eval_sigstore.go ================================================ // Policy evaluation for prSigstoreSigned. package signature import ( "context" "crypto" "crypto/ecdsa" "crypto/x509" "errors" "fmt" "os" "strings" digest "github.com/opencontainers/go-digest" "github.com/sigstore/sigstore/pkg/cryptoutils" "go.podman.io/image/v5/internal/multierr" "go.podman.io/image/v5/internal/private" "go.podman.io/image/v5/internal/signature" "go.podman.io/image/v5/manifest" "go.podman.io/image/v5/signature/internal" ) // configBytesSources contains configuration fields which may result in one or more []byte values type configBytesSources struct { inconsistencyErrorMessage string // Error to return if more than one source is set path string // …Path: a path to a file containing the data, or "" paths []string // …Paths: paths to files containing the data, or nil data []byte // …Data: a single instance ofhe raw data, or nil datas [][]byte // …Datas: the raw data, or nil // codespell:ignore datas } // loadBytesFromConfigSources ensures at most one of the sources in src is set, // and returns the referenced data, or nil if neither is set. func loadBytesFromConfigSources(src configBytesSources) ([][]byte, error) { sources := 0 var data [][]byte // = nil if src.path != "" { sources++ d, err := os.ReadFile(src.path) if err != nil { return nil, err } data = [][]byte{d} } if src.paths != nil { sources++ data = [][]byte{} for _, path := range src.paths { d, err := os.ReadFile(path) if err != nil { return nil, err } data = append(data, d) } } if src.data != nil { sources++ data = [][]byte{src.data} } if src.datas != nil { // codespell:ignore datas sources++ data = src.datas // codespell:ignore datas } if sources > 1 { return nil, errors.New(src.inconsistencyErrorMessage) } return data, nil } // prepareTrustRoot creates a fulcioTrustRoot from the input data. // (This also prevents external implementations of this interface, ensuring that prSigstoreSignedFulcio is the only one.) func (f *prSigstoreSignedFulcio) prepareTrustRoot() (*fulcioTrustRoot, error) { caCertPEMs, err := loadBytesFromConfigSources(configBytesSources{ inconsistencyErrorMessage: `Internal inconsistency: both "caPath" and "caData" specified`, path: f.CAPath, data: f.CAData, }) if err != nil { return nil, err } if len(caCertPEMs) != 1 { return nil, errors.New(`Internal inconsistency: Fulcio specified with not exactly one of "caPath" nor "caData"`) } certs := x509.NewCertPool() if ok := certs.AppendCertsFromPEM(caCertPEMs[0]); !ok { return nil, errors.New("error loading Fulcio CA certificates") } fulcio := fulcioTrustRoot{ caCertificates: certs, oidcIssuer: f.OIDCIssuer, subjectEmail: f.SubjectEmail, } if err := fulcio.validate(); err != nil { return nil, err } return &fulcio, nil } // prepareTrustRoot creates a pkiTrustRoot from the input data. // (This also prevents external implementations of this interface, ensuring that prSigstoreSignedPKI is the only one.) func (p *prSigstoreSignedPKI) prepareTrustRoot() (*pkiTrustRoot, error) { caRootsCertPEMs, err := loadBytesFromConfigSources(configBytesSources{ inconsistencyErrorMessage: `Internal inconsistency: both "caRootsPath" and "caRootsData" specified`, path: p.CARootsPath, data: p.CARootsData, }) if err != nil { return nil, err } if len(caRootsCertPEMs) != 1 { return nil, errors.New(`Internal inconsistency: PKI specified with not exactly one of "caRootsPath" nor "caRootsData"`) } rootsCerts := x509.NewCertPool() if ok := rootsCerts.AppendCertsFromPEM(caRootsCertPEMs[0]); !ok { return nil, errors.New("error loading PKI CA Roots certificates") } pki := pkiTrustRoot{ caRootsCertificates: rootsCerts, subjectEmail: p.SubjectEmail, subjectHostname: p.SubjectHostname, } caIntermediateCertPEMs, err := loadBytesFromConfigSources(configBytesSources{ inconsistencyErrorMessage: `Internal inconsistency: both "caIntermediatesPath" and "caIntermediatesData" specified`, path: p.CAIntermediatesPath, data: p.CAIntermediatesData, }) if err != nil { return nil, err } if caIntermediateCertPEMs != nil { if len(caIntermediateCertPEMs) != 1 { return nil, errors.New(`Internal inconsistency: PKI specified with invalid value from "caIntermediatesPath" or "caIntermediatesData"`) } intermediatePool := x509.NewCertPool() trustedIntermediates, err := cryptoutils.UnmarshalCertificatesFromPEM(caIntermediateCertPEMs[0]) if err != nil { return nil, internal.NewInvalidSignatureError(fmt.Sprintf("loading trusted intermediate certificates: %v", err)) } for _, trustedIntermediateCert := range trustedIntermediates { intermediatePool.AddCert(trustedIntermediateCert) } pki.caIntermediateCertificates = intermediatePool } if err := pki.validate(); err != nil { return nil, err } return &pki, nil } // sigstoreSignedTrustRoot contains an already parsed version of the prSigstoreSigned policy type sigstoreSignedTrustRoot struct { publicKeys []crypto.PublicKey fulcio *fulcioTrustRoot rekorPublicKeys []*ecdsa.PublicKey pki *pkiTrustRoot } func (pr *prSigstoreSigned) prepareTrustRoot() (*sigstoreSignedTrustRoot, error) { res := sigstoreSignedTrustRoot{} publicKeyPEMs, err := loadBytesFromConfigSources(configBytesSources{ inconsistencyErrorMessage: `Internal inconsistency: more than one of "keyPath", "keyPaths", "keyData", "keyDatas" specified`, path: pr.KeyPath, paths: pr.KeyPaths, data: pr.KeyData, datas: pr.KeyDatas, // codespell:ignore datas }) if err != nil { return nil, err } if publicKeyPEMs != nil { for index, keyData := range publicKeyPEMs { pk, err := cryptoutils.UnmarshalPEMToPublicKey(keyData) if err != nil { return nil, fmt.Errorf("parsing public key %d: %w", index+1, err) } res.publicKeys = append(res.publicKeys, pk) } if len(res.publicKeys) == 0 { return nil, errors.New(`Internal inconsistency: "keyPath", "keyPaths", "keyData" and "keyDatas" produced no public keys`) } } if pr.Fulcio != nil { f, err := pr.Fulcio.prepareTrustRoot() if err != nil { return nil, err } res.fulcio = f } rekorPublicKeyPEMs, err := loadBytesFromConfigSources(configBytesSources{ inconsistencyErrorMessage: `Internal inconsistency: both "rekorPublicKeyPath" and "rekorPublicKeyData" specified`, path: pr.RekorPublicKeyPath, paths: pr.RekorPublicKeyPaths, data: pr.RekorPublicKeyData, datas: pr.RekorPublicKeyDatas, // codespell:ignore datas }) if err != nil { return nil, err } if rekorPublicKeyPEMs != nil { for index, pem := range rekorPublicKeyPEMs { pk, err := cryptoutils.UnmarshalPEMToPublicKey(pem) if err != nil { return nil, fmt.Errorf("parsing Rekor public key %d: %w", index+1, err) } pkECDSA, ok := pk.(*ecdsa.PublicKey) if !ok { return nil, fmt.Errorf("Rekor public key %d is not using ECDSA", index+1) } res.rekorPublicKeys = append(res.rekorPublicKeys, pkECDSA) } if len(res.rekorPublicKeys) == 0 { return nil, errors.New(`Internal inconsistency: "rekorPublicKeyPath", "rekorPublicKeyPaths", "rekorPublicKeyData" and "rekorPublicKeyDatas" produced no public keys`) } } if pr.PKI != nil { p, err := pr.PKI.prepareTrustRoot() if err != nil { return nil, err } res.pki = p } return &res, nil } func (pr *prSigstoreSigned) isSignatureAuthorAccepted(ctx context.Context, image private.UnparsedImage, sig []byte) (signatureAcceptanceResult, *Signature, error) { // We don’t know of a single user of this API, and we might return unexpected values in Signature. // For now, just punt. return sarRejected, nil, errors.New("isSignatureAuthorAccepted is not implemented for sigstore") } func (pr *prSigstoreSigned) isSignatureAccepted(ctx context.Context, image private.UnparsedImage, sig signature.Sigstore) (signatureAcceptanceResult, error) { // FIXME: move this to per-context initialization trustRoot, err := pr.prepareTrustRoot() if err != nil { return sarRejected, err } untrustedAnnotations := sig.UntrustedAnnotations() untrustedBase64Signature, ok := untrustedAnnotations[signature.SigstoreSignatureAnnotationKey] if !ok { return sarRejected, fmt.Errorf("missing %s annotation", signature.SigstoreSignatureAnnotationKey) } untrustedPayload := sig.UntrustedPayload() keySources := 0 if trustRoot.publicKeys != nil { keySources++ } if trustRoot.fulcio != nil { keySources++ } if trustRoot.pki != nil { keySources++ } var publicKeys []crypto.PublicKey switch { case keySources > 1: // newPRSigstoreSigned rejects more than one key sources. return sarRejected, errors.New("Internal inconsistency: More than one of public key, Fulcio, or PKI specified") case keySources == 0: // newPRSigstoreSigned rejects empty key sources. return sarRejected, errors.New("Internal inconsistency: A public key, Fulcio, or PKI must be specified.") case trustRoot.publicKeys != nil: if trustRoot.rekorPublicKeys != nil { untrustedSET, ok := untrustedAnnotations[signature.SigstoreSETAnnotationKey] if !ok { // For user convenience; passing an empty []byte to VerifyRekorSet should work. return sarRejected, fmt.Errorf("missing %s annotation", signature.SigstoreSETAnnotationKey) } var rekorFailures []string for _, candidatePublicKey := range trustRoot.publicKeys { // We could use publicKeyPEM directly, but let’s re-marshal to avoid inconsistencies. // FIXME: We could just generate DER instead of the full PEM text recreatedPublicKeyPEM, err := cryptoutils.MarshalPublicKeyToPEM(candidatePublicKey) if err != nil { // Coverage: The key was loaded from a PEM format, so it’s unclear how this could fail. // (PEM is not essential, MarshalPublicKeyToPEM can only fail if marshaling to ASN1.DER fails.) return sarRejected, fmt.Errorf("re-marshaling public key to PEM: %w", err) } // We don’t care about the Rekor timestamp, just about log presence. _, err = internal.VerifyRekorSET(trustRoot.rekorPublicKeys, []byte(untrustedSET), recreatedPublicKeyPEM, untrustedBase64Signature, untrustedPayload) if err == nil { publicKeys = append(publicKeys, candidatePublicKey) break // The SET can only accept one public key entry, so if we found one, the rest either doesn’t match or is a duplicate } rekorFailures = append(rekorFailures, err.Error()) } if len(publicKeys) == 0 { if len(rekorFailures) == 0 { // Coverage: We have ensured that len(trustRoot.publicKeys) != 0, when nothing succeeds, there must be at least one failure. return sarRejected, errors.New(`Internal inconsistency: Rekor SET did not match any key but we have no failures.`) } return sarRejected, internal.NewInvalidSignatureError(fmt.Sprintf("No public key verified against the RekorSET: %s", strings.Join(rekorFailures, ", "))) } } else { publicKeys = trustRoot.publicKeys } case trustRoot.fulcio != nil: if trustRoot.rekorPublicKeys == nil { // newPRSigstoreSigned rejects such combinations. return sarRejected, errors.New("Internal inconsistency: Fulcio CA specified without a Rekor public key") } untrustedSET, ok := untrustedAnnotations[signature.SigstoreSETAnnotationKey] if !ok { // For user convenience; passing an empty []byte to VerifyRekorSet should correctly reject it anyway. return sarRejected, fmt.Errorf("missing %s annotation", signature.SigstoreSETAnnotationKey) } untrustedCert, ok := untrustedAnnotations[signature.SigstoreCertificateAnnotationKey] if !ok { // For user convenience; passing an empty []byte to VerifyRekorSet should correctly reject it anyway. return sarRejected, fmt.Errorf("missing %s annotation", signature.SigstoreCertificateAnnotationKey) } var untrustedIntermediateChainBytes []byte if untrustedIntermediateChain, ok := untrustedAnnotations[signature.SigstoreIntermediateCertificateChainAnnotationKey]; ok { untrustedIntermediateChainBytes = []byte(untrustedIntermediateChain) } pk, err := verifyRekorFulcio(trustRoot.rekorPublicKeys, trustRoot.fulcio, []byte(untrustedSET), []byte(untrustedCert), untrustedIntermediateChainBytes, untrustedBase64Signature, untrustedPayload) if err != nil { return sarRejected, err } publicKeys = []crypto.PublicKey{pk} case trustRoot.pki != nil: if trustRoot.rekorPublicKeys != nil { // newPRSigstoreSigned rejects such combinations. return sarRejected, errors.New("Internal inconsistency: PKI specified with a Rekor public key") } untrustedCert, ok := untrustedAnnotations[signature.SigstoreCertificateAnnotationKey] if !ok { return sarRejected, fmt.Errorf("missing %s annotation", signature.SigstoreCertificateAnnotationKey) } var untrustedIntermediateChainBytes []byte if untrustedIntermediateChain, ok := untrustedAnnotations[signature.SigstoreIntermediateCertificateChainAnnotationKey]; ok { untrustedIntermediateChainBytes = []byte(untrustedIntermediateChain) } pk, err := verifyPKI(trustRoot.pki, []byte(untrustedCert), untrustedIntermediateChainBytes) if err != nil { return sarRejected, err } publicKeys = []crypto.PublicKey{pk} } if len(publicKeys) == 0 { // Coverage: This should never happen, we ensured that trustRoot.publicKeys is non-empty if set, // and we have already excluded the possibility in the switch above. return sarRejected, fmt.Errorf("Internal inconsistency: publicKey not set before verifying sigstore payload") } signature, err := internal.VerifySigstorePayload(publicKeys, untrustedPayload, untrustedBase64Signature, internal.SigstorePayloadAcceptanceRules{ ValidateSignedDockerReference: func(ref string) error { if !pr.SignedIdentity.matchesDockerReference(image, ref) { return PolicyRequirementError(fmt.Sprintf("Signature for identity %q is not accepted", ref)) } return nil }, ValidateSignedDockerManifestDigest: func(digest digest.Digest) error { m, _, err := image.Manifest(ctx) if err != nil { return err } digestMatches, err := manifest.MatchesDigest(m, digest) if err != nil { return err } if !digestMatches { return PolicyRequirementError(fmt.Sprintf("Signature for digest %s does not match", digest)) } return nil }, }) if err != nil { return sarRejected, err } if signature == nil { // A paranoid sanity check that VerifySigstorePayload has returned consistent values return sarRejected, errors.New("internal error: VerifySigstorePayload succeeded but returned no data") // Coverage: This should never happen. } return sarAccepted, nil } func (pr *prSigstoreSigned) isRunningImageAllowed(ctx context.Context, image private.UnparsedImage) (bool, error) { sigs, err := image.UntrustedSignatures(ctx) if err != nil { return false, err } var rejections []error foundNonSigstoreSignatures := 0 foundSigstoreNonAttachments := 0 for _, s := range sigs { sigstoreSig, ok := s.(signature.Sigstore) if !ok { foundNonSigstoreSignatures++ continue } if sigstoreSig.UntrustedMIMEType() != signature.SigstoreSignatureMIMEType { foundSigstoreNonAttachments++ continue } var reason error switch res, err := pr.isSignatureAccepted(ctx, image, sigstoreSig); res { case sarAccepted: // One accepted signature is enough. return true, nil case sarRejected: reason = err case sarUnknown: // Huh?! This should not happen at all; treat it as any other invalid value. fallthrough default: reason = fmt.Errorf(`Internal error: Unexpected signature verification result %q`, string(res)) } rejections = append(rejections, reason) } var summary error switch len(rejections) { case 0: if foundNonSigstoreSignatures == 0 && foundSigstoreNonAttachments == 0 { // A nice message for the most common case. summary = PolicyRequirementError("A signature was required, but no signature exists") } else { summary = PolicyRequirementError(fmt.Sprintf("A signature was required, but no signature exists (%d non-sigstore signatures, %d sigstore non-signature attachments)", foundNonSigstoreSignatures, foundSigstoreNonAttachments)) } case 1: summary = rejections[0] default: summary = PolicyRequirementError(multierr.Format("None of the signatures were accepted, reasons: ", "; ", "", rejections).Error()) } return false, summary } func (pr *prSigstoreSigned) verifiesSignatures() bool { return true } ================================================ FILE: vendor/go.podman.io/image/v5/signature/policy_eval_simple.go ================================================ // Policy evaluation for the various simple PolicyRequirement types. package signature import ( "context" "fmt" "go.podman.io/image/v5/internal/private" "go.podman.io/image/v5/transports" ) func (pr *prInsecureAcceptAnything) isSignatureAuthorAccepted(ctx context.Context, image private.UnparsedImage, sig []byte) (signatureAcceptanceResult, *Signature, error) { // prInsecureAcceptAnything semantics: Every image is allowed to run, // but this does not consider the signature as verified. return sarUnknown, nil, nil } func (pr *prInsecureAcceptAnything) isRunningImageAllowed(ctx context.Context, image private.UnparsedImage) (bool, error) { return true, nil } func (pr *prInsecureAcceptAnything) verifiesSignatures() bool { return false } func (pr *prReject) isSignatureAuthorAccepted(ctx context.Context, image private.UnparsedImage, sig []byte) (signatureAcceptanceResult, *Signature, error) { return sarRejected, nil, PolicyRequirementError(fmt.Sprintf("Any signatures for image %s are rejected by policy.", transports.ImageName(image.Reference()))) } func (pr *prReject) isRunningImageAllowed(ctx context.Context, image private.UnparsedImage) (bool, error) { return false, PolicyRequirementError(fmt.Sprintf("Running image %s is rejected by policy.", transports.ImageName(image.Reference()))) } func (pr *prReject) verifiesSignatures() bool { return false } ================================================ FILE: vendor/go.podman.io/image/v5/signature/policy_paths_common.go ================================================ //go:build !freebsd package signature // builtinDefaultPolicyPath is the policy path used for DefaultPolicy(). // DO NOT change this, instead see systemDefaultPolicyPath above. const builtinDefaultPolicyPath = "/etc/containers/policy.json" ================================================ FILE: vendor/go.podman.io/image/v5/signature/policy_paths_freebsd.go ================================================ //go:build freebsd package signature // builtinDefaultPolicyPath is the policy path used for DefaultPolicy(). // DO NOT change this, instead see systemDefaultPolicyPath above. const builtinDefaultPolicyPath = "/usr/local/etc/containers/policy.json" ================================================ FILE: vendor/go.podman.io/image/v5/signature/policy_reference_match.go ================================================ // PolicyReferenceMatch implementations. package signature import ( "fmt" "strings" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/internal/private" "go.podman.io/image/v5/transports" ) // parseImageAndDockerReference converts an image and a reference string into two parsed entities, failing on any error and handling unidentified images. func parseImageAndDockerReference(image private.UnparsedImage, s2 string) (reference.Named, reference.Named, error) { r1 := image.Reference().DockerReference() if r1 == nil { return nil, nil, PolicyRequirementError(fmt.Sprintf("Docker reference match attempted on image %s with no known Docker reference identity", transports.ImageName(image.Reference()))) } r2, err := reference.ParseNormalizedNamed(s2) if err != nil { return nil, nil, err } return r1, r2, nil } func (prm *prmMatchExact) matchesDockerReference(image private.UnparsedImage, signatureDockerReference string) bool { intended, signature, err := parseImageAndDockerReference(image, signatureDockerReference) if err != nil { return false } // Do not add default tags: image.Reference().DockerReference() should contain it already, and signatureDockerReference should be exact; so, verify that now. if reference.IsNameOnly(intended) || reference.IsNameOnly(signature) { return false } return signature.String() == intended.String() } // matchRepoDigestOrExactReferenceValues implements prmMatchRepoDigestOrExact.matchesDockerReference // using reference.Named values. func matchRepoDigestOrExactReferenceValues(intended, signature reference.Named) bool { // Do not add default tags: image.Reference().DockerReference() should contain it already, and signatureDockerReference should be exact; so, verify that now. if reference.IsNameOnly(signature) { return false } switch intended.(type) { case reference.NamedTagged: // Includes the case when intended has both a tag and a digest. return signature.String() == intended.String() case reference.Canonical: // We don’t actually compare the manifest digest against the signature here; that happens prSignedBy.in UnparsedImage.Manifest. // Because UnparsedImage.Manifest verifies the intended.Digest() against the manifest, and prSignedBy verifies the signature digest against the manifest, // we know that signature digest matches intended.Digest() (but intended.Digest() and signature digest may use different algorithms) return signature.Name() == intended.Name() default: // !reference.IsNameOnly(intended) return false } } func (prm *prmMatchRepoDigestOrExact) matchesDockerReference(image private.UnparsedImage, signatureDockerReference string) bool { intended, signature, err := parseImageAndDockerReference(image, signatureDockerReference) if err != nil { return false } return matchRepoDigestOrExactReferenceValues(intended, signature) } func (prm *prmMatchRepository) matchesDockerReference(image private.UnparsedImage, signatureDockerReference string) bool { intended, signature, err := parseImageAndDockerReference(image, signatureDockerReference) if err != nil { return false } return signature.Name() == intended.Name() } // parseDockerReferences converts two reference strings into parsed entities, failing on any error func parseDockerReferences(s1, s2 string) (reference.Named, reference.Named, error) { r1, err := reference.ParseNormalizedNamed(s1) if err != nil { return nil, nil, err } r2, err := reference.ParseNormalizedNamed(s2) if err != nil { return nil, nil, err } return r1, r2, nil } func (prm *prmExactReference) matchesDockerReference(image private.UnparsedImage, signatureDockerReference string) bool { intended, signature, err := parseDockerReferences(prm.DockerReference, signatureDockerReference) if err != nil { return false } // prm.DockerReference and signatureDockerReference should be exact; so, verify that now. if reference.IsNameOnly(intended) || reference.IsNameOnly(signature) { return false } return signature.String() == intended.String() } func (prm *prmExactRepository) matchesDockerReference(image private.UnparsedImage, signatureDockerReference string) bool { intended, signature, err := parseDockerReferences(prm.DockerRepository, signatureDockerReference) if err != nil { return false } return signature.Name() == intended.Name() } // refMatchesPrefix returns true if ref matches prm.Prefix. func (prm *prmRemapIdentity) refMatchesPrefix(ref reference.Named) bool { name := ref.Name() switch { case len(name) < len(prm.Prefix): return false case len(name) == len(prm.Prefix): return name == prm.Prefix case len(name) > len(prm.Prefix): // We are matching only ref.Name(), not ref.String(), so the only separator we are // expecting is '/': // - '@' is only valid to separate a digest, i.e. not a part of ref.Name() // - similarly ':' to mark a tag would not be a part of ref.Name(); it can be a part of a // host:port domain syntax, but we don't treat that specially and require an exact match // of the domain. return strings.HasPrefix(name, prm.Prefix) && name[len(prm.Prefix)] == '/' default: panic("Internal error: impossible comparison outcome") } } // remapReferencePrefix returns the result of remapping ref, if it matches prm.Prefix // or the original ref if it does not. func (prm *prmRemapIdentity) remapReferencePrefix(ref reference.Named) (reference.Named, error) { if !prm.refMatchesPrefix(ref) { return ref, nil } refString := ref.String() newNamedRef := strings.Replace(refString, prm.Prefix, prm.SignedPrefix, 1) newParsedRef, err := reference.ParseNamed(newNamedRef) if err != nil { return nil, fmt.Errorf(`error rewriting reference from %q to %q: %w`, refString, newNamedRef, err) } return newParsedRef, nil } func (prm *prmRemapIdentity) matchesDockerReference(image private.UnparsedImage, signatureDockerReference string) bool { intended, signature, err := parseImageAndDockerReference(image, signatureDockerReference) if err != nil { return false } intended, err = prm.remapReferencePrefix(intended) if err != nil { return false } return matchRepoDigestOrExactReferenceValues(intended, signature) } ================================================ FILE: vendor/go.podman.io/image/v5/signature/policy_types.go ================================================ // Note: Consider the API unstable until the code supports at least three different image formats or transports. // This defines types used to represent a signature verification policy in memory. // Do not use the private types directly; either parse a configuration file, or construct a Policy from PolicyRequirements // built using the constructor functions provided in policy_config.go. package signature // NOTE: Keep this in sync with docs/containers-policy.json.5.md! // Policy defines requirements for considering a signature, or an image, valid. type Policy struct { // Default applies to any image which does not have a matching policy in Transports. // Note that this can happen even if a matching PolicyTransportScopes exists in Transports // if the image matches none of the scopes. Default PolicyRequirements `json:"default"` Transports map[string]PolicyTransportScopes `json:"transports"` } // PolicyTransportScopes defines policies for images for a specific transport, // for various scopes, the map keys. // Scopes are defined by the transport (types.ImageReference.PolicyConfigurationIdentity etc.); // there is one scope precisely matching to a single image, and namespace scopes as prefixes // of the single-image scope. (e.g. hostname[/zero[/or[/more[/namespaces[/individualimage]]]]]) // The empty scope, if exists, is considered a parent namespace of all other scopes. // Most specific scope wins, duplication is prohibited (hard failure). type PolicyTransportScopes map[string]PolicyRequirements // PolicyRequirements is a set of requirements applying to a set of images; each of them must be satisfied (though perhaps each by a different signature). // Must not be empty, frequently will only contain a single element. type PolicyRequirements []PolicyRequirement // PolicyRequirement is a rule which must be satisfied by at least one of the signatures of an image. // The type is public, but its definition is private. // prCommon is the common type field in a JSON encoding of PolicyRequirement. type prCommon struct { Type prTypeIdentifier `json:"type"` } // prTypeIdentifier is string designating a kind of a PolicyRequirement. type prTypeIdentifier string const ( prTypeInsecureAcceptAnything prTypeIdentifier = "insecureAcceptAnything" prTypeReject prTypeIdentifier = "reject" prTypeSignedBy prTypeIdentifier = "signedBy" prTypeSignedBaseLayer prTypeIdentifier = "signedBaseLayer" prTypeSigstoreSigned prTypeIdentifier = "sigstoreSigned" ) // prInsecureAcceptAnything is a PolicyRequirement with type = prTypeInsecureAcceptAnything: // every image is allowed to run. // Note that because PolicyRequirements are implicitly ANDed, this is necessary only if it is the only rule (to make the list non-empty and the policy explicit). // NOTE: This allows the image to run; it DOES NOT consider the signature verified (per IsSignatureAuthorAccepted). // FIXME? Better name? type prInsecureAcceptAnything struct { prCommon } // prReject is a PolicyRequirement with type = prTypeReject: every image is rejected. type prReject struct { prCommon } // prSignedBy is a PolicyRequirement with type = prTypeSignedBy: the image is signed by trusted keys for a specified identity type prSignedBy struct { prCommon // KeyType specifies what kind of key reference KeyPath/KeyPaths/KeyData is. // Acceptable values are “GPGKeys” | “signedByGPGKeys” “X.509Certificates” | “signedByX.509CAs” // FIXME: eventually also support GPGTOFU, X.509TOFU, with KeyPath only KeyType sbKeyType `json:"keyType"` // KeyPath is a pathname to a local file containing the trusted key(s). Exactly one of KeyPath, KeyPaths and KeyData must be specified. KeyPath string `json:"keyPath,omitempty"` // KeyPaths is a set of pathnames to local files containing the trusted key(s). Exactly one of KeyPath, KeyPaths and KeyData must be specified. KeyPaths []string `json:"keyPaths,omitempty"` // KeyData contains the trusted key(s), base64-encoded. Exactly one of KeyPath, KeyPaths and KeyData must be specified. KeyData []byte `json:"keyData,omitempty"` // SignedIdentity specifies what image identity the signature must be claiming about the image. // Defaults to "matchRepoDigestOrExact" if not specified. SignedIdentity PolicyReferenceMatch `json:"signedIdentity"` } // sbKeyType are the allowed values for prSignedBy.KeyType type sbKeyType string const ( // SBKeyTypeGPGKeys refers to keys contained in a GPG keyring SBKeyTypeGPGKeys sbKeyType = "GPGKeys" // SBKeyTypeSignedByGPGKeys refers to keys signed by keys in a GPG keyring SBKeyTypeSignedByGPGKeys sbKeyType = "signedByGPGKeys" // SBKeyTypeX509Certificates refers to keys in a set of X.509 certificates // FIXME: PEM, DER? SBKeyTypeX509Certificates sbKeyType = "X509Certificates" // SBKeyTypeSignedByX509CAs refers to keys signed by one of the X.509 CAs // FIXME: PEM, DER? SBKeyTypeSignedByX509CAs sbKeyType = "signedByX509CAs" ) // prSignedBaseLayer is a PolicyRequirement with type = prSignedBaseLayer: the image has a specified, correctly signed, base image. type prSignedBaseLayer struct { prCommon // BaseLayerIdentity specifies the base image to look for. "match-exact" is rejected, "match-repository" is unlikely to be useful. BaseLayerIdentity PolicyReferenceMatch `json:"baseLayerIdentity"` } // prSigstoreSigned is a PolicyRequirement with type = prTypeSigstoreSigned: the image is signed by trusted keys for a specified identity type prSigstoreSigned struct { prCommon // KeyPath is a pathname to a local file containing the trusted key. Exactly one of KeyPath, KeyPaths, KeyData, KeyDatas, Fulcio, and PKI must be specified. KeyPath string `json:"keyPath,omitempty"` // KeyPaths is a set of pathnames to local files containing the trusted key(s). Exactly one of KeyPath, KeyPaths, KeyData, KeyDatas, Fulcio, and PKI must be specified. KeyPaths []string `json:"keyPaths,omitempty"` // KeyData contains the trusted key, base64-encoded. Exactly one of KeyPath, KeyPaths, KeyData, KeyDatas, Fulcio, and PKI must be specified. KeyData []byte `json:"keyData,omitempty"` // KeyDatas is a set of trusted keys, base64-encoded. Exactly one of KeyPath, KeyPaths, KeyData, KeyDatas, Fulcio, and PKI must be specified. KeyDatas [][]byte `json:"keyDatas,omitempty"` // Fulcio specifies which Fulcio-generated certificates are accepted. Exactly one of KeyPath, KeyPaths, KeyData, KeyDatas, Fulcio, and PKI must be specified. // If Fulcio is specified, one of RekorPublicKeyPath or RekorPublicKeyData must be specified as well. Fulcio PRSigstoreSignedFulcio `json:"fulcio,omitempty"` // RekorPublicKeyPath is a pathname to local file containing a public key of a Rekor server which must record acceptable signatures. // If Fulcio is used, one of RekorPublicKeyPath, RekorPublicKeyPaths, RekorPublicKeyData and RekorPublicKeyDatas must be specified as well; // otherwise it is optional (and Rekor inclusion is not required if a Rekor public key is not specified). RekorPublicKeyPath string `json:"rekorPublicKeyPath,omitempty"` // RekorPublicKeyPaths is a set of pathnames to local files, each containing a public key of a Rekor server. One of the keys must record acceptable signatures. // If Fulcio is used, one of RekorPublicKeyPath, RekorPublicKeyPaths, RekorPublicKeyData and RekorPublicKeyDatas must be specified as well; // otherwise it is optional (and Rekor inclusion is not required if a Rekor public key is not specified). RekorPublicKeyPaths []string `json:"rekorPublicKeyPaths,omitempty"` // RekorPublicKeyPath contain a base64-encoded public key of a Rekor server which must record acceptable signatures. // If Fulcio is used, one of RekorPublicKeyPath, RekorPublicKeyPaths, RekorPublicKeyData and RekorPublicKeyDatas must be specified as well; // otherwise it is optional (and Rekor inclusion is not required if a Rekor public key is not specified). RekorPublicKeyData []byte `json:"rekorPublicKeyData,omitempty"` // RekorPublicKeyDatas each contain a base64-encoded public key of a Rekor server. One of the keys must record acceptable signatures. // If Fulcio is used, one of RekorPublicKeyPath, RekorPublicKeyPaths, RekorPublicKeyData and RekorPublicKeyDatas must be specified as well; // otherwise it is optional (and Rekor inclusion is not required if a Rekor public key is not specified). RekorPublicKeyDatas [][]byte `json:"rekorPublicKeyDatas,omitempty"` // PKI specifies which PKI-generated certificates are accepted. Exactly one of KeyPath, KeyPaths, KeyData, KeyDatas, Fulcio, and PKI must be specified. PKI PRSigstoreSignedPKI `json:"pki,omitempty"` // SignedIdentity specifies what image identity the signature must be claiming about the image. // Defaults to "matchRepoDigestOrExact" if not specified. // Note that /usr/bin/cosign interoperability might require using repo-only matching. SignedIdentity PolicyReferenceMatch `json:"signedIdentity"` } // PRSigstoreSignedFulcio contains Fulcio configuration options for a "sigstoreSigned" PolicyRequirement. // This is a public type with a single private implementation. type PRSigstoreSignedFulcio interface { // toFulcioTrustRoot creates a fulcioTrustRoot from the input data. // (This also prevents external implementations of this interface, ensuring that prSigstoreSignedFulcio is the only one.) prepareTrustRoot() (*fulcioTrustRoot, error) } // prSigstoreSignedFulcio collects Fulcio configuration options for prSigstoreSigned type prSigstoreSignedFulcio struct { // CAPath a path to a file containing accepted CA root certificates, in PEM format. Exactly one of CAPath and CAData must be specified. CAPath string `json:"caPath,omitempty"` // CAData contains accepted CA root certificates in PEM format, all of that base64-encoded. Exactly one of CAPath and CAData must be specified. CAData []byte `json:"caData,omitempty"` // OIDCIssuer specifies the expected OIDC issuer, recorded by Fulcio into the generated certificates. OIDCIssuer string `json:"oidcIssuer,omitempty"` // SubjectEmail specifies the expected email address of the authenticated OIDC identity, recorded by Fulcio into the generated certificates. SubjectEmail string `json:"subjectEmail,omitempty"` } // PRSigstoreSignedPKI contains PKI configuration options for a "sigstoreSigned" PolicyRequirement. type PRSigstoreSignedPKI interface { // prepareTrustRoot creates a pkiTrustRoot from the input data. // (This also prevents external implementations of this interface, ensuring that prSigstoreSignedPKI is the only one.) prepareTrustRoot() (*pkiTrustRoot, error) } // prSigstoreSignedPKI contains non-fulcio certificate PKI configuration options for prSigstoreSigned type prSigstoreSignedPKI struct { // CARootsPath a path to a file containing accepted CA root certificates, in PEM format. Exactly one of CARootsPath and CARootsData must be specified. CARootsPath string `json:"caRootsPath,omitempty"` // CARootsData contains accepted CA root certificates in PEM format, all of that base64-encoded. Exactly one of CARootsPath and CARootsData must be specified. CARootsData []byte `json:"caRootsData,omitempty"` // CAIntermediatesPath a path to a file containing accepted CA intermediate certificates, in PEM format. Only one of CAIntermediatesPath or CAIntermediatesData can be specified, not both. CAIntermediatesPath string `json:"caIntermediatesPath,omitempty"` // CAIntermediatesData contains accepted CA intermediate certificates in PEM format, all of that base64-encoded. Only one of CAIntermediatesPath or CAIntermediatesData can be specified, not both. CAIntermediatesData []byte `json:"caIntermediatesData,omitempty"` // SubjectEmail specifies the expected email address imposed on the subject to which the certificate was issued. At least one of SubjectEmail and SubjectHostname must be specified. SubjectEmail string `json:"subjectEmail,omitempty"` // SubjectHostname specifies the expected hostname imposed on the subject to which the certificate was issued. At least one of SubjectEmail and SubjectHostname must be specified. SubjectHostname string `json:"subjectHostname,omitempty"` } // PolicyReferenceMatch specifies a set of image identities accepted in PolicyRequirement. // The type is public, but its implementation is private. // prmCommon is the common type field in a JSON encoding of PolicyReferenceMatch. type prmCommon struct { Type prmTypeIdentifier `json:"type"` } // prmTypeIdentifier is string designating a kind of a PolicyReferenceMatch. type prmTypeIdentifier string const ( prmTypeMatchExact prmTypeIdentifier = "matchExact" prmTypeMatchRepoDigestOrExact prmTypeIdentifier = "matchRepoDigestOrExact" prmTypeMatchRepository prmTypeIdentifier = "matchRepository" prmTypeExactReference prmTypeIdentifier = "exactReference" prmTypeExactRepository prmTypeIdentifier = "exactRepository" prmTypeRemapIdentity prmTypeIdentifier = "remapIdentity" ) // prmMatchExact is a PolicyReferenceMatch with type = prmMatchExact: the two references must match exactly. type prmMatchExact struct { prmCommon } // prmMatchRepoDigestOrExact is a PolicyReferenceMatch with type = prmMatchExactOrDigest: the two references must match exactly, // except that digest references are also accepted if the repository name matches (regardless of tag/digest) and the signature applies to the referenced digest type prmMatchRepoDigestOrExact struct { prmCommon } // prmMatchRepository is a PolicyReferenceMatch with type = prmMatchRepository: the two references must use the same repository, may differ in the tag. type prmMatchRepository struct { prmCommon } // prmExactReference is a PolicyReferenceMatch with type = prmExactReference: matches a specified reference exactly. type prmExactReference struct { prmCommon DockerReference string `json:"dockerReference"` } // prmExactRepository is a PolicyReferenceMatch with type = prmExactRepository: matches a specified repository, with any tag. type prmExactRepository struct { prmCommon DockerRepository string `json:"dockerRepository"` } // prmRemapIdentity is a PolicyReferenceMatch with type = prmRemapIdentity: like prmMatchRepoDigestOrExact, // except that a namespace (at least a host:port, at most a single repository) is substituted before matching the two references. type prmRemapIdentity struct { prmCommon Prefix string `json:"prefix"` SignedPrefix string `json:"signedPrefix"` // Possibly let the users make a choice for tag/digest matching behavior // similar to prmMatchExact/prmMatchRepository? } ================================================ FILE: vendor/go.podman.io/image/v5/signature/signer/signer.go ================================================ package signer import "go.podman.io/image/v5/internal/signer" // Signer is an object, possibly carrying state, that can be used by copy.Image to sign one or more container images. // It can only be created from within the containers/image package; it can’t be implemented externally. // // The owner of a Signer must call Close() when done. type Signer = signer.Signer ================================================ FILE: vendor/go.podman.io/image/v5/signature/sigstore/copied.go ================================================ package sigstore import ( "crypto" "crypto/ecdsa" "crypto/ed25519" "crypto/rsa" "crypto/x509" "encoding/pem" "errors" "fmt" "github.com/secure-systems-lab/go-securesystemslib/encrypted" "github.com/sigstore/sigstore/pkg/cryptoutils" "github.com/sigstore/sigstore/pkg/signature" ) // The following code was copied from github.com/sigstore. // FIXME: Eliminate that duplication. // Copyright 2021 The Sigstore Authors. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. const ( // from sigstore/cosign/pkg/cosign.CosignPrivateKeyPemType. cosignPrivateKeyPemType = "ENCRYPTED COSIGN PRIVATE KEY" // from sigstore/cosign/pkg/cosign.SigstorePrivateKeyPemType. sigstorePrivateKeyPemType = "ENCRYPTED SIGSTORE PRIVATE KEY" ) // from sigstore/cosign/pkg/cosign.loadPrivateKey // FIXME: Do we need all of these key formats? func loadPrivateKey(key []byte, pass []byte) (signature.SignerVerifier, error) { // Decrypt first p, _ := pem.Decode(key) if p == nil { return nil, errors.New("invalid pem block") } if p.Type != sigstorePrivateKeyPemType && p.Type != cosignPrivateKeyPemType { return nil, fmt.Errorf("unsupported pem type: %s", p.Type) } x509Encoded, err := encrypted.Decrypt(p.Bytes, pass) if err != nil { return nil, fmt.Errorf("decrypt: %w", err) } pk, err := x509.ParsePKCS8PrivateKey(x509Encoded) if err != nil { return nil, fmt.Errorf("parsing private key: %w", err) } switch pk := pk.(type) { case *rsa.PrivateKey: return signature.LoadRSAPKCS1v15SignerVerifier(pk, crypto.SHA256) case *ecdsa.PrivateKey: return signature.LoadECDSASignerVerifier(pk, crypto.SHA256) case ed25519.PrivateKey: return signature.LoadED25519SignerVerifier(pk) default: return nil, errors.New("unsupported key type") } } // simplified from sigstore/cosign/pkg/cosign.marshalKeyPair // loadPrivateKey always requires a encryption, so this always requires a passphrase. func marshalKeyPair(privateKey crypto.PrivateKey, publicKey crypto.PublicKey, password []byte) (_privateKey []byte, _publicKey []byte, err error) { x509Encoded, err := x509.MarshalPKCS8PrivateKey(privateKey) if err != nil { return nil, nil, fmt.Errorf("x509 encoding private key: %w", err) } encBytes, err := encrypted.Encrypt(x509Encoded, password) if err != nil { return nil, nil, err } // store in PEM format privBytes := pem.EncodeToMemory(&pem.Block{ Bytes: encBytes, // Use the older “COSIGN” type name; as of 2023-03-30 cosign’s main branch generates “SIGSTORE” types, // but a version of cosign that can accept them has not yet been released. Type: cosignPrivateKeyPemType, }) // Now do the public key pubBytes, err := cryptoutils.MarshalPublicKeyToPEM(publicKey) if err != nil { return nil, nil, err } return privBytes, pubBytes, nil } ================================================ FILE: vendor/go.podman.io/image/v5/signature/sigstore/fulcio/fulcio.go ================================================ package fulcio import ( "crypto" "crypto/ecdsa" "crypto/elliptic" "crypto/rand" "crypto/sha256" "crypto/x509" "fmt" "io" "net/url" "github.com/sigstore/fulcio/pkg/api" "github.com/sigstore/sigstore/pkg/oauth" "github.com/sigstore/sigstore/pkg/oauthflow" sigstoreSignature "github.com/sigstore/sigstore/pkg/signature" "github.com/sirupsen/logrus" "go.podman.io/image/v5/internal/useragent" "go.podman.io/image/v5/signature/sigstore/internal" "golang.org/x/oauth2" ) // setupSignerWithFulcio updates s with a certificate generated by fulcioURL based on oidcIDToken func setupSignerWithFulcio(s *internal.SigstoreSigner, fulcioURL *url.URL, oidcIDToken *oauthflow.OIDCIDToken) error { // ECDSA-P256 is the only interoperable algorithm per // https://github.com/sigstore/cosign/blob/main/specs/SIGNATURE_SPEC.md#signature-schemes . privateKey, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader) if err != nil { return fmt.Errorf("generating short-term private key: %w", err) } keyAlgorithm := "ecdsa" // SHA-256 is opencontainers/go-digest.Canonical, thus the algorithm to use here as well per // https://github.com/sigstore/cosign/blob/main/specs/SIGNATURE_SPEC.md#hashing-algorithms signer, err := sigstoreSignature.LoadECDSASigner(privateKey, crypto.SHA256) if err != nil { return fmt.Errorf("initializing short-term private key: %w", err) } s.PrivateKey = signer logrus.Debugf("Requesting a certificate from Fulcio at %s", fulcioURL.Redacted()) fulcioClient := api.NewClient(fulcioURL, api.WithUserAgent(useragent.DefaultUserAgent)) // Sign the email address as part of the request h := sha256.Sum256([]byte(oidcIDToken.Subject)) keyOwnershipProof, err := ecdsa.SignASN1(rand.Reader, privateKey, h[:]) if err != nil { return fmt.Errorf("Error signing key ownership proof: %w", err) } publicKeyBytes, err := x509.MarshalPKIXPublicKey(&privateKey.PublicKey) if err != nil { return fmt.Errorf("converting public key to ASN.1: %w", err) } // Note that unlike most OAuth2 uses, this passes the ID token, not an access token. // This is only secure if every Fulcio server has an individual client ID value // = fulcioOIDCClientID, distinct from other Fulcio servers, // that is embedded into the ID token’s "aud" field. resp, err := fulcioClient.SigningCert(api.CertificateRequest{ PublicKey: api.Key{ Content: publicKeyBytes, Algorithm: keyAlgorithm, }, SignedEmailAddress: keyOwnershipProof, }, oidcIDToken.RawString) if err != nil { return fmt.Errorf("obtaining certificate from Fulcio: %w", err) } s.FulcioGeneratedCertificate = resp.CertPEM s.FulcioGeneratedCertificateChain = resp.ChainPEM // Cosign goes through an unmarshal/marshal roundtrip for Fulcio-generated certificates, let’s not do that. s.SigningKeyOrCert = resp.CertPEM return nil } // WithFulcioAndPreexistingOIDCIDToken sets up signing to use a short-lived key and a Fulcio-issued certificate // based on a caller-provided OIDC ID token. func WithFulcioAndPreexistingOIDCIDToken(fulcioURL *url.URL, oidcIDToken string) internal.Option { return func(s *internal.SigstoreSigner) error { if s.PrivateKey != nil { return fmt.Errorf("multiple private key sources specified when preparing to create sigstore signatures") } // This adds dependencies even just to parse the token. We could possibly reimplement that, and split this variant // into a subpackage without the OIDC dependencies… but really, is this going to be used in significantly different situations // than the two interactive OIDC authentication workflows? // // Are there any widely used tools to manually obtain an ID token? Why would there be? // For long-term usage, users provisioning a static OIDC credential might just as well provision an already-generated certificate // or something like that. logrus.Debugf("Using a statically-provided OIDC token") staticTokenGetter := oauthflow.StaticTokenGetter{RawToken: oidcIDToken} oidcIDToken, err := staticTokenGetter.GetIDToken(nil, oauth2.Config{}) if err != nil { return fmt.Errorf("parsing OIDC token: %w", err) } return setupSignerWithFulcio(s, fulcioURL, oidcIDToken) } } // WithFulcioAndDeviceAuthorizationGrantOIDC sets up signing to use a short-lived key and a Fulcio-issued certificate // based on an OIDC ID token obtained using a device authorization grant (RFC 8628). // // interactiveOutput must be directly accessible to a human user in real time (i.e. not be just a log file). func WithFulcioAndDeviceAuthorizationGrantOIDC(fulcioURL *url.URL, oidcIssuerURL *url.URL, oidcClientID, oidcClientSecret string, interactiveOutput io.Writer, ) internal.Option { return func(s *internal.SigstoreSigner) error { if s.PrivateKey != nil { return fmt.Errorf("multiple private key sources specified when preparing to create sigstore signatures") } logrus.Debugf("Starting OIDC device flow for issuer %s", oidcIssuerURL.Redacted()) tokenGetter := oauthflow.NewDeviceFlowTokenGetterForIssuer(oidcIssuerURL.String()) tokenGetter.MessagePrinter = func(s string) { fmt.Fprintln(interactiveOutput, s) } oidcIDToken, err := oauthflow.OIDConnect(oidcIssuerURL.String(), oidcClientID, oidcClientSecret, "", tokenGetter) if err != nil { return fmt.Errorf("Error authenticating with OIDC: %w", err) } return setupSignerWithFulcio(s, fulcioURL, oidcIDToken) } } // WithFulcioAndInterativeOIDC sets up signing to use a short-lived key and a Fulcio-issued certificate // based on an interactively-obtained OIDC ID token. // The token is obtained // - directly using a browser, listening on localhost, automatically opening a browser to the OIDC issuer, // to be redirected on localhost. (I.e. the current environment must allow launching a browser that connect back to the current process; // either or both may be impossible in a container or a remote VM). // - or by instructing the user to manually open a browser, obtain the OIDC code, and interactively input it as text. // // interactiveInput and interactiveOutput must both be directly operable by a human user in real time (i.e. not be just a log file). func WithFulcioAndInteractiveOIDC(fulcioURL *url.URL, oidcIssuerURL *url.URL, oidcClientID, oidcClientSecret string, interactiveInput io.Reader, interactiveOutput io.Writer, ) internal.Option { return func(s *internal.SigstoreSigner) error { if s.PrivateKey != nil { return fmt.Errorf("multiple private key sources specified when preparing to create sigstore signatures") } logrus.Debugf("Starting interactive OIDC authentication for issuer %s", oidcIssuerURL.Redacted()) // This is intended to match oauthflow.DefaultIDTokenGetter (incl. the update in init()), overriding only input/output htmlPage, err := oauth.GetInteractiveSuccessHTML(false, 10) if err != nil { return fmt.Errorf("formatting HTML content: %w", err) } tokenGetter := &oauthflow.InteractiveIDTokenGetter{ HTMLPage: htmlPage, Input: interactiveInput, Output: interactiveOutput, } oidcIDToken, err := oauthflow.OIDConnect(oidcIssuerURL.String(), oidcClientID, oidcClientSecret, "", tokenGetter) if err != nil { return fmt.Errorf("Error authenticating with OIDC: %w", err) } return setupSignerWithFulcio(s, fulcioURL, oidcIDToken) } } ================================================ FILE: vendor/go.podman.io/image/v5/signature/sigstore/generate.go ================================================ package sigstore import ( "crypto/ecdsa" "crypto/elliptic" "crypto/rand" ) // GenerateKeyPairResult is a struct to ensure the private and public parts can not be confused by the caller. type GenerateKeyPairResult struct { PublicKey []byte PrivateKey []byte } // GenerateKeyPair generates a public/private key pair usable for signing images using the sigstore format, // and returns key representations suitable for storing in long-term files (with the private key encrypted using the provided passphrase). // The specific key kind (e.g. algorithm, size), as well as the file format, are unspecified by this API, // and can change with best practices over time. func GenerateKeyPair(passphrase []byte) (*GenerateKeyPairResult, error) { // https://github.com/sigstore/cosign/blob/main/specs/SIGNATURE_SPEC.md#signature-schemes // only requires ECDSA-P256 to be supported, so that’s what we must use. rawKey, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader) if err != nil { // Coverage: This can fail only if the randomness source fails return nil, err } private, public, err := marshalKeyPair(rawKey, rawKey.Public(), passphrase) if err != nil { return nil, err } return &GenerateKeyPairResult{ PublicKey: public, PrivateKey: private, }, nil } ================================================ FILE: vendor/go.podman.io/image/v5/signature/sigstore/internal/signer.go ================================================ package internal import ( "bytes" "context" "encoding/base64" "encoding/json" "errors" "fmt" sigstoreSignature "github.com/sigstore/sigstore/pkg/signature" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/internal/signature" "go.podman.io/image/v5/manifest" "go.podman.io/image/v5/signature/internal" ) type Option func(*SigstoreSigner) error // SigstoreSigner is a signer.SignerImplementation implementation for sigstore signatures. // It is initialized using various closures that implement Option, sadly over several subpackages, to decrease the // dependency impact. type SigstoreSigner struct { PrivateKey sigstoreSignature.Signer // May be nil during initialization SigningKeyOrCert []byte // For possible Rekor upload; always initialized together with PrivateKey // Fulcio results to include FulcioGeneratedCertificate []byte // Or nil FulcioGeneratedCertificateChain []byte // Or nil // Rekor state RekorUploader func(ctx context.Context, keyOrCertBytes []byte, signatureBytes []byte, payloadBytes []byte) ([]byte, error) // Or nil } // ProgressMessage returns a human-readable sentence that makes sense to write before starting to create a single signature. func (s *SigstoreSigner) ProgressMessage() string { return "Signing image using a sigstore signature" } // SignImageManifest creates a new signature for manifest m as dockerReference. func (s *SigstoreSigner) SignImageManifest(ctx context.Context, m []byte, dockerReference reference.Named) (signature.Signature, error) { if s.PrivateKey == nil { return nil, errors.New("internal error: nothing to sign with, should have been detected in NewSigner") } if reference.IsNameOnly(dockerReference) { return nil, fmt.Errorf("reference %s can’t be signed, it has neither a tag nor a digest", dockerReference.String()) } manifestDigest, err := manifest.Digest(m) if err != nil { return nil, err } // sigstore/cosign completely ignores dockerReference for actual policy decisions. // They record the repo (but NOT THE TAG) in the value; without the tag we can’t detect version rollbacks. // So, just do what simple signing does, and cosign won’t mind. payloadData := internal.NewUntrustedSigstorePayload(manifestDigest, dockerReference.String()) payloadBytes, err := json.Marshal(payloadData) if err != nil { return nil, err } // github.com/sigstore/cosign/internal/pkg/cosign.payloadSigner uses signatureoptions.WithContext(), // which seems to be not used by anything. So we don’t bother. signatureBytes, err := s.PrivateKey.SignMessage(bytes.NewReader(payloadBytes)) if err != nil { return nil, fmt.Errorf("creating signature: %w", err) } base64Signature := base64.StdEncoding.EncodeToString(signatureBytes) var rekorSETBytes []byte // = nil if s.RekorUploader != nil { set, err := s.RekorUploader(ctx, s.SigningKeyOrCert, signatureBytes, payloadBytes) if err != nil { return nil, err } rekorSETBytes = set } annotations := map[string]string{ signature.SigstoreSignatureAnnotationKey: base64Signature, } if s.FulcioGeneratedCertificate != nil { annotations[signature.SigstoreCertificateAnnotationKey] = string(s.FulcioGeneratedCertificate) } if s.FulcioGeneratedCertificateChain != nil { annotations[signature.SigstoreIntermediateCertificateChainAnnotationKey] = string(s.FulcioGeneratedCertificateChain) } if rekorSETBytes != nil { annotations[signature.SigstoreSETAnnotationKey] = string(rekorSETBytes) } return signature.SigstoreFromComponents(signature.SigstoreSignatureMIMEType, payloadBytes, annotations), nil } func (s *SigstoreSigner) Close() error { return nil } ================================================ FILE: vendor/go.podman.io/image/v5/signature/sigstore/rekor/leveled_logger.go ================================================ package rekor import ( "fmt" "github.com/hashicorp/go-retryablehttp" "github.com/sirupsen/logrus" ) // leveledLogger adapts our use of logrus to the expected go-retryablehttp.LeveledLogger interface. type leveledLogger struct { logger *logrus.Logger } func leveledLoggerForLogrus(logger *logrus.Logger) retryablehttp.LeveledLogger { return &leveledLogger{logger: logger} } // log is the actual conversion implementation func (l *leveledLogger) log(level logrus.Level, msg string, keysAndValues []any) { fields := logrus.Fields{} for i := 0; i < len(keysAndValues)-1; i += 2 { key := keysAndValues[i] keyString, isString := key.(string) if !isString { // It seems attractive to panic() here, but we might already be in a failure state, so let’s not make it worse keyString = fmt.Sprintf("[Invalid LeveledLogger key %#v]", key) } fields[keyString] = keysAndValues[i+1] } l.logger.WithFields(fields).Log(level, msg) } // Debug implements retryablehttp.LeveledLogger func (l *leveledLogger) Debug(msg string, keysAndValues ...any) { l.log(logrus.DebugLevel, msg, keysAndValues) } // Error implements retryablehttp.LeveledLogger func (l *leveledLogger) Error(msg string, keysAndValues ...any) { l.log(logrus.ErrorLevel, msg, keysAndValues) } // Info implements retryablehttp.LeveledLogger func (l *leveledLogger) Info(msg string, keysAndValues ...any) { l.log(logrus.InfoLevel, msg, keysAndValues) } // Warn implements retryablehttp.LeveledLogger func (l *leveledLogger) Warn(msg string, keysAndValues ...any) { l.log(logrus.WarnLevel, msg, keysAndValues) } ================================================ FILE: vendor/go.podman.io/image/v5/signature/sigstore/rekor/openapi_infra.go ================================================ package rekor // The following code is the essence of the relevant code paths from github.com/go-openapi/runtime, // heavily modified since. // Copyright 2015 go-swagger maintainers // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. import ( "bytes" "context" "encoding/json" "io" "net/http" "path" ) // makeRequest makes a http request to the requested requestPath, and returns the received response. func (r *rekorClient) makeRequest(ctx context.Context, method, requestPath string, bodyContent any) (*http.Response, error) { var body io.Reader headers := http.Header{} headers.Set("Accept", "application/json") if bodyContent != nil { buf := bytes.NewBuffer(nil) body = buf headers.Set("Content-Type", "application/json") enc := json.NewEncoder(buf) enc.SetEscapeHTML(false) if err := enc.Encode(bodyContent); err != nil { return nil, err } } req, err := http.NewRequestWithContext(ctx, method, path.Join(r.basePath, requestPath), body) if err != nil { return nil, err } // Only Scheme and Host are used from rekorURL. // Really this should probabbly use r.rekorURL.JoinPath(requestPath) (which, notably, correctly deals with path escaping), // and pass that to NewRequestWithContext, but this use of path.Join is consistent with go-openapi/runtime v0.24.1 . req.URL.Scheme = r.rekorURL.Scheme req.URL.Host = r.rekorURL.Host req.Header = headers res, err := r.httpClient.Do(req) if err != nil { return nil, err } // Note that we don’t care to even read the Content-Type: header; we blindly assume the format is the requested JSON. return res, nil } // decodeHTTPResponseBodyAsJSON decodes the body of a HTTP response in a manner compatible with github.com/go-openapi/runtime. func decodeHTTPResponseBodyAsJSON(res *http.Response, data any) error { dec := json.NewDecoder(res.Body) dec.UseNumber() err := dec.Decode(data) if err == io.EOF { // This seems unwanted at a first glance; go-swagger added it in https://github.com/go-swagger/go-swagger/issues/192 , it’s unclear // whether it’s correct or still necessary. err = nil } return err } ================================================ FILE: vendor/go.podman.io/image/v5/signature/sigstore/rekor/rekor.go ================================================ package rekor import ( "context" "crypto/sha256" "crypto/tls" "encoding/base64" "encoding/hex" "encoding/json" "errors" "fmt" "net/http" "net/url" "strings" "github.com/hashicorp/go-cleanhttp" "github.com/hashicorp/go-retryablehttp" "github.com/sirupsen/logrus" "go.podman.io/image/v5/signature/internal" signerInternal "go.podman.io/image/v5/signature/sigstore/internal" ) const ( // defaultRetryCount is the default number of retries defaultRetryCount = 3 ) // WithRekor asks the generated signature to be uploaded to the specified Rekor server, // and to include a log inclusion proof in the signature. func WithRekor(rekorURL *url.URL) signerInternal.Option { return func(s *signerInternal.SigstoreSigner) error { logrus.Debugf("Using Rekor server at %s", rekorURL.Redacted()) baseTLSConfig := (*tls.Config)(nil) // FIXME: decide on an API — should it be shared with Fulcio? client := newRekorClient(rekorURL, baseTLSConfig) s.RekorUploader = client.uploadKeyOrCert return nil } } // rekorClient allows uploading entries to Rekor. type rekorClient struct { rekorURL *url.URL // Only Scheme and Host is actually used, consistent with github.com/sigstore/rekor/pkg/client. basePath string httpClient *http.Client } // newRekorClient creates a rekorClient for rekorURL. // If baseTLSConfig is not nil, it may contain TLS _algorithm_ options (e.g. TLS version, cipher suites, “curves”, etc.). func newRekorClient(rekorURL *url.URL, baseTLSConfig *tls.Config) *rekorClient { retryableClient := retryablehttp.NewClient() transport := cleanhttp.DefaultTransport() if baseTLSConfig != nil { transport.TLSClientConfig = baseTLSConfig.Clone() } retryableClient.HTTPClient = &http.Client{Transport: transport} retryableClient.RetryMax = defaultRetryCount retryableClient.Logger = leveledLoggerForLogrus(logrus.StandardLogger()) basePath := rekorURL.Path if !strings.HasPrefix(basePath, "/") { // Includes basePath == "", i.e. URL just a https://hostname basePath = "/" + basePath } return &rekorClient{ rekorURL: rekorURL, basePath: basePath, httpClient: retryableClient.StandardClient(), } } // rekorEntryToSET converts a Rekor log entry into a sigstore “signed entry timestamp”. func rekorEntryToSET(entry *rekorLogEntryAnon) (internal.UntrustedRekorSET, error) { // We could plausibly call entry.Validate() here; that mostly just uses unnecessary reflection instead of direct == nil checks. // Right now the only extra validation .Validate() does is *entry.LogIndex >= 0 and a regex check on *entry.LogID; // we don’t particularly care about either of these (notably signature verification only uses the Body value). if entry.Verification == nil || entry.IntegratedTime == nil || entry.LogIndex == nil || entry.LogID == nil { return internal.UntrustedRekorSET{}, fmt.Errorf("invalid Rekor entry (missing data): %#v", *entry) } bodyBase64, ok := entry.Body.(string) if !ok { return internal.UntrustedRekorSET{}, fmt.Errorf("unexpected Rekor entry body type: %#v", entry.Body) } body, err := base64.StdEncoding.DecodeString(bodyBase64) if err != nil { return internal.UntrustedRekorSET{}, fmt.Errorf("error parsing Rekor entry body: %w", err) } payloadJSON, err := internal.UntrustedRekorPayload{ Body: body, IntegratedTime: *entry.IntegratedTime, LogIndex: *entry.LogIndex, LogID: *entry.LogID, }.MarshalJSON() if err != nil { return internal.UntrustedRekorSET{}, err } return internal.UntrustedRekorSET{ UntrustedSignedEntryTimestamp: entry.Verification.SignedEntryTimestamp, UntrustedPayload: payloadJSON, }, nil } // uploadEntry ensures proposedEntry exists in Rekor (usually uploading it), and returns the resulting log entry. func (r *rekorClient) uploadEntry(ctx context.Context, proposedEntry rekorProposedEntry) (rekorLogEntry, error) { logrus.Debugf("Calling Rekor's CreateLogEntry") resp, err := r.createLogEntry(ctx, proposedEntry) if err != nil { // In ordinary operation, we should not get duplicate entries, because our payload contains a timestamp, // so it is supposed to be unique; and the default key format, ECDSA p256, also contains a nonce. // But conflicts can fairly easily happen during debugging and experimentation, so it pays to handle this. var conflictErr *createLogEntryConflictError if errors.As(err, &conflictErr) && conflictErr.location != "" { location := conflictErr.location logrus.Debugf("CreateLogEntry reported a conflict, location = %s", location) // We might be able to just GET the returned Location, but let’s use the formal API method. // OTOH that requires us to hard-code the URI structure… uuidDelimiter := strings.LastIndexByte(location, '/') if uuidDelimiter != -1 { // Otherwise the URI is unexpected, and fall through to the bottom uuid := location[uuidDelimiter+1:] logrus.Debugf("Calling Rekor's NewGetLogEntryByUUIDParamsWithContext") resp2, err := r.getLogEntryByUUID(ctx, uuid) if err != nil { return nil, fmt.Errorf("Error re-loading previously-created log entry with UUID %s: %w", uuid, err) } return resp2, nil } } return nil, fmt.Errorf("Error uploading a log entry: %w", err) } return resp, nil } // stringPointer is a helper to create *string fields in JSON data. func stringPointer(s string) *string { return &s } // uploadKeyOrCert integrates this code into sigstore/internal.Signer. // Given components of the created signature, it returns a SET that should be added to the signature. func (r *rekorClient) uploadKeyOrCert(ctx context.Context, keyOrCertBytes []byte, signatureBytes []byte, payloadBytes []byte) ([]byte, error) { payloadHash := sha256.Sum256(payloadBytes) // Consistent with cosign. hashedRekordSpec, err := json.Marshal(internal.RekorHashedrekordV001Schema{ Data: &internal.RekorHashedrekordV001SchemaData{ Hash: &internal.RekorHashedrekordV001SchemaDataHash{ Algorithm: stringPointer(internal.RekorHashedrekordV001SchemaDataHashAlgorithmSha256), Value: stringPointer(hex.EncodeToString(payloadHash[:])), }, }, Signature: &internal.RekorHashedrekordV001SchemaSignature{ Content: signatureBytes, PublicKey: &internal.RekorHashedrekordV001SchemaSignaturePublicKey{ Content: keyOrCertBytes, }, }, }) if err != nil { return nil, err } proposedEntry := internal.RekorHashedrekord{ APIVersion: stringPointer(internal.RekorHashedRekordV001APIVersion), Spec: hashedRekordSpec, } uploadedPayload, err := r.uploadEntry(ctx, &proposedEntry) if err != nil { return nil, err } if len(uploadedPayload) != 1 { return nil, fmt.Errorf("expected 1 Rekor entry, got %d", len(uploadedPayload)) } var storedEntry *rekorLogEntryAnon // This “loop” extracts the single value from the uploadedPayload map. for _, p := range uploadedPayload { storedEntry = &p break } rekorBundle, err := rekorEntryToSET(storedEntry) if err != nil { return nil, err } rekorSETBytes, err := json.Marshal(rekorBundle) if err != nil { return nil, err } return rekorSETBytes, nil } ================================================ FILE: vendor/go.podman.io/image/v5/signature/sigstore/rekor/rekor_api.go ================================================ package rekor // The following code is the essence of the relevant code paths from github.com/sigstore/rekor/pkg/generated/client/..., // heavily modified since. // Copyright 2021 The Sigstore Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // import ( "context" "fmt" "net/http" "net/url" ) // createLogEntryConflictError describes a response with status code 409: // The request conflicts with the current state of the transparency log. // This typically happens when trying to upload an existing entry again. type createLogEntryConflictError struct { location string err string } func (o *createLogEntryConflictError) Error() string { return o.err } // createLogEntry creates an entry in the transparency log // // Creates an entry in the transparency log for a detached signature, public key, and content. Items can be included in the request or fetched by the server when URLs are specified. func (r *rekorClient) createLogEntry(ctx context.Context, proposedEntry rekorProposedEntry) (rekorLogEntry, error) { res, err := r.makeRequest(ctx, http.MethodPost, "/api/v1/log/entries", proposedEntry) if err != nil { return nil, err } defer res.Body.Close() switch res.StatusCode { case http.StatusCreated: result := rekorLogEntry{} if err := decodeHTTPResponseBodyAsJSON(res, &result); err != nil { return nil, err } return result, nil case http.StatusBadRequest: result := rekorError{} if err := decodeHTTPResponseBodyAsJSON(res, &result); err != nil { return nil, err } return nil, fmt.Errorf("Rekor /api/v1/log/entries failed: bad request (%d), %+v", res.StatusCode, result) case http.StatusConflict: result := rekorError{} if err := decodeHTTPResponseBodyAsJSON(res, &result); err != nil { return nil, err } return nil, &createLogEntryConflictError{ location: res.Header.Get("Location"), err: fmt.Sprintf("Rekor /api/v1/log/entries failed with a conflict (%d), %+v", res.StatusCode, result), } default: result := rekorError{} if err := decodeHTTPResponseBodyAsJSON(res, &result); err != nil { return nil, err } return nil, fmt.Errorf("Rekor /api/v1/log/entries failed with unexpected status %d: %+v", res.StatusCode, result) } } // getLogEntryByUUID gets log entry and information required to generate an inclusion proof for the entry in the transparency log // // Returns the entry, root hash, tree size, and a list of hashes that can be used to calculate proof of an entry being included in the transparency log func (r *rekorClient) getLogEntryByUUID(ctx context.Context, entryUUID string) (rekorLogEntry, error) { res, err := r.makeRequest(ctx, http.MethodGet, "/api/v1/log/entries/"+url.PathEscape(entryUUID), nil) if err != nil { return nil, err } defer res.Body.Close() switch res.StatusCode { case http.StatusOK: result := rekorLogEntry{} if err := decodeHTTPResponseBodyAsJSON(res, &result); err != nil { return nil, err } return result, nil case http.StatusNotFound: // We don’t care to define a separate error type; we don’t need it ourselves. return nil, fmt.Errorf("Rekor /api/v1/log/entries/{entryUUID}: entry not found (%d)", res.StatusCode) default: result := rekorError{} if err := decodeHTTPResponseBodyAsJSON(res, &result); err != nil { return nil, err } return nil, fmt.Errorf("Rekor /api/v1/log/entries/{entryUUID} failed with unexpected status %d: %+v", res.StatusCode, result) } } ================================================ FILE: vendor/go.podman.io/image/v5/signature/sigstore/rekor/rekor_api_types.go ================================================ package rekor type rekorError struct { Code int64 `json:"code,omitempty"` Message string `json:"message,omitempty"` } type rekorProposedEntry interface { // Actually the code, currently, accepts anything that can be marshaled into JSON; use at least the Kind marker from // shared between RekorHashedrekord / and other accepted formats for minimal sanity checking (but without hard-coding // RekorHashedRekord in particular). Kind() string SetKind(string) } type rekorLogEntryAnon struct { Attestation *rekorLogEntryAnonAttestation `json:"attestation,omitempty"` Body any `json:"body"` IntegratedTime *int64 `json:"integratedTime"` LogID *string `json:"logID"` LogIndex *int64 `json:"logIndex"` Verification *rekorLogEntryAnonVerification `json:"verification,omitempty"` } type rekorLogEntryAnonAttestation struct { Data []byte `json:"data,omitempty"` } type rekorLogEntryAnonVerification struct { InclusionProof *rekorInclusionProof `json:"inclusionProof,omitempty"` SignedEntryTimestamp []byte `json:"signedEntryTimestamp,omitempty"` } type rekorLogEntry map[string]rekorLogEntryAnon type rekorInclusionProof struct { Checkpoint *string `json:"checkpoint"` Hashes []string `json:"hashes"` LogIndex *int64 `json:"logIndex"` RootHash *string `json:"rootHash"` TreeSize *int64 `json:"treeSize"` } ================================================ FILE: vendor/go.podman.io/image/v5/signature/sigstore/signer.go ================================================ package sigstore import ( "errors" "fmt" "os" "github.com/sigstore/sigstore/pkg/cryptoutils" internalSigner "go.podman.io/image/v5/internal/signer" "go.podman.io/image/v5/signature/signer" "go.podman.io/image/v5/signature/sigstore/internal" ) type Option = internal.Option func WithPrivateKeyFile(file string, passphrase []byte) Option { return func(s *internal.SigstoreSigner) error { if s.PrivateKey != nil { return fmt.Errorf("multiple private key sources specified when preparing to create sigstore signatures") } if passphrase == nil { return errors.New("private key passphrase not provided") } privateKeyPEM, err := os.ReadFile(file) if err != nil { return fmt.Errorf("reading private key from %s: %w", file, err) } signerVerifier, err := loadPrivateKey(privateKeyPEM, passphrase) if err != nil { return fmt.Errorf("initializing private key: %w", err) } publicKey, err := signerVerifier.PublicKey() if err != nil { return fmt.Errorf("getting public key from private key: %w", err) } publicKeyPEM, err := cryptoutils.MarshalPublicKeyToPEM(publicKey) if err != nil { return fmt.Errorf("converting public key to PEM: %w", err) } s.PrivateKey = signerVerifier s.SigningKeyOrCert = publicKeyPEM return nil } } func NewSigner(opts ...Option) (*signer.Signer, error) { s := internal.SigstoreSigner{} for _, o := range opts { if err := o(&s); err != nil { return nil, err } } if s.PrivateKey == nil { return nil, errors.New("no private key source provided (neither a private key nor Fulcio) when preparing to create sigstore signatures") } return internalSigner.NewSigner(&s), nil } ================================================ FILE: vendor/go.podman.io/image/v5/signature/simple.go ================================================ // Note: Consider the API unstable until the code supports at least three different image formats or transports. // NOTE: Keep this in sync with docs/atomic-signature.md and docs/atomic-signature-embedded.json! package signature import ( "encoding/json" "errors" "fmt" "slices" "time" digest "github.com/opencontainers/go-digest" "go.podman.io/image/v5/signature/internal" "go.podman.io/image/v5/version" ) const ( signatureType = "atomic container signature" ) // InvalidSignatureError is returned when parsing an invalid signature. type InvalidSignatureError = internal.InvalidSignatureError // Signature is a parsed content of a signature. // The only way to get this structure from a blob should be as a return value from a successful call to verifyAndExtractSignature below. type Signature struct { DockerManifestDigest digest.Digest DockerReference string // FIXME: more precise type? } // untrustedSignature is a parsed content of a signature. type untrustedSignature struct { untrustedDockerManifestDigest digest.Digest untrustedDockerReference string // FIXME: more precise type? untrustedCreatorID *string // This is intentionally an int64; the native JSON float64 type would allow to represent _some_ sub-second precision, // but not nearly enough (with current timestamp values, a single unit in the last place is on the order of hundreds of nanoseconds). // So, this is explicitly an int64, and we reject fractional values. If we did need more precise timestamps eventually, // we would add another field, UntrustedTimestampNS int64. untrustedTimestamp *int64 } // UntrustedSignatureInformation is information available in an untrusted signature. // This may be useful when debugging signature verification failures, // or when managing a set of signatures on a single image. // // WARNING: Do not use the contents of this for ANY security decisions, // and be VERY CAREFUL about showing this information to humans in any way which suggest that these values “are probably” reliable. // There is NO REASON to expect the values to be correct, or not intentionally misleading // (including things like “✅ Verified by $authority”) type UntrustedSignatureInformation struct { UntrustedDockerManifestDigest digest.Digest UntrustedDockerReference string // FIXME: more precise type? UntrustedCreatorID *string UntrustedTimestamp *time.Time UntrustedShortKeyIdentifier string } // newUntrustedSignature returns an untrustedSignature object with // the specified primary contents and appropriate metadata. func newUntrustedSignature(dockerManifestDigest digest.Digest, dockerReference string) untrustedSignature { // Use intermediate variables for these values so that we can take their addresses. // Golang guarantees that they will have a new address on every execution. creatorID := "atomic " + version.Version timestamp := time.Now().Unix() return untrustedSignature{ untrustedDockerManifestDigest: dockerManifestDigest, untrustedDockerReference: dockerReference, untrustedCreatorID: &creatorID, untrustedTimestamp: ×tamp, } } // A compile-time check that untrustedSignature and *untrustedSignature implements json.Marshaler var ( _ json.Marshaler = untrustedSignature{} _ json.Marshaler = (*untrustedSignature)(nil) ) // MarshalJSON implements the json.Marshaler interface. func (s untrustedSignature) MarshalJSON() ([]byte, error) { if s.untrustedDockerManifestDigest == "" || s.untrustedDockerReference == "" { return nil, errors.New("Unexpected empty signature content") } critical := map[string]any{ "type": signatureType, "image": map[string]string{"docker-manifest-digest": s.untrustedDockerManifestDigest.String()}, "identity": map[string]string{"docker-reference": s.untrustedDockerReference}, } optional := map[string]any{} if s.untrustedCreatorID != nil { optional["creator"] = *s.untrustedCreatorID } if s.untrustedTimestamp != nil { optional["timestamp"] = *s.untrustedTimestamp } signature := map[string]any{ "critical": critical, "optional": optional, } return json.Marshal(signature) } // Compile-time check that untrustedSignature implements json.Unmarshaler var _ json.Unmarshaler = (*untrustedSignature)(nil) // UnmarshalJSON implements the json.Unmarshaler interface func (s *untrustedSignature) UnmarshalJSON(data []byte) error { return internal.JSONFormatToInvalidSignatureError(s.strictUnmarshalJSON(data)) } // strictUnmarshalJSON is UnmarshalJSON, except that it may return the internal.JSONFormatError error type. // Splitting it into a separate function allows us to do the internal.JSONFormatError → InvalidSignatureError in a single place, the caller. func (s *untrustedSignature) strictUnmarshalJSON(data []byte) error { var critical, optional json.RawMessage if err := internal.ParanoidUnmarshalJSONObjectExactFields(data, map[string]any{ "critical": &critical, "optional": &optional, }); err != nil { return err } var creatorID string var timestamp float64 gotCreatorID, gotTimestamp := false, false if err := internal.ParanoidUnmarshalJSONObject(optional, func(key string) any { switch key { case "creator": gotCreatorID = true return &creatorID case "timestamp": gotTimestamp = true return ×tamp default: var ignore any return &ignore } }); err != nil { return err } if gotCreatorID { s.untrustedCreatorID = &creatorID } if gotTimestamp { intTimestamp := int64(timestamp) if float64(intTimestamp) != timestamp { return internal.NewInvalidSignatureError("Field optional.timestamp is not an integer") } s.untrustedTimestamp = &intTimestamp } var t string var image, identity json.RawMessage if err := internal.ParanoidUnmarshalJSONObjectExactFields(critical, map[string]any{ "type": &t, "image": &image, "identity": &identity, }); err != nil { return err } if t != signatureType { return internal.NewInvalidSignatureError(fmt.Sprintf("Unrecognized signature type %s", t)) } var digestString string if err := internal.ParanoidUnmarshalJSONObjectExactFields(image, map[string]any{ "docker-manifest-digest": &digestString, }); err != nil { return err } digestValue, err := digest.Parse(digestString) if err != nil { return internal.NewInvalidSignatureError(fmt.Sprintf(`invalid docker-manifest-digest value %q: %v`, digestString, err)) } s.untrustedDockerManifestDigest = digestValue return internal.ParanoidUnmarshalJSONObjectExactFields(identity, map[string]any{ "docker-reference": &s.untrustedDockerReference, }) } // Sign formats the signature and returns a blob signed using mech and keyIdentity // (If it seems surprising that this is a method on untrustedSignature, note that there // isn’t a good reason to think that a key used by the user is trusted by any component // of the system just because it is a private key — actually the presence of a private key // on the system increases the likelihood of an a successful attack on that private key // on that particular system.) func (s untrustedSignature) sign(mech SigningMechanism, keyIdentity string, passphrase string) ([]byte, error) { json, err := json.Marshal(s) if err != nil { return nil, err } if newMech, ok := mech.(signingMechanismWithPassphrase); ok { return newMech.SignWithPassphrase(json, keyIdentity, passphrase) } if passphrase != "" { return nil, errors.New("signing mechanism does not support passphrases") } return mech.Sign(json, keyIdentity) } // signatureAcceptanceRules specifies how to decide whether an untrusted signature is acceptable. // We centralize the actual parsing and data extraction in verifyAndExtractSignature; this supplies // the policy. We use an object instead of supplying func parameters to verifyAndExtractSignature // because the functions have the same or similar types, so there is a risk of exchanging the functions; // named members of this struct are more explicit. type signatureAcceptanceRules struct { acceptedKeyIdentities []string validateSignedDockerReference func(string) error validateSignedDockerManifestDigest func(digest.Digest) error } // verifyAndExtractSignature verifies that unverifiedSignature has been signed, and that its principal components // match expected values, both as specified by rules. // Returns the signature, and an identity of the key that signed it. func verifyAndExtractSignature(mech SigningMechanism, unverifiedSignature []byte, rules signatureAcceptanceRules) (*Signature, string, error) { signed, keyIdentity, err := mech.Verify(unverifiedSignature) if err != nil { return nil, "", err } if !slices.Contains(rules.acceptedKeyIdentities, keyIdentity) { withLookup, ok := mech.(signingMechanismWithVerificationIdentityLookup) if !ok { return nil, "", internal.NewInvalidSignatureError(fmt.Sprintf("signature by key %s is not accepted", keyIdentity)) } primaryKey, err := withLookup.keyIdentityForVerificationKeyIdentity(keyIdentity) if err != nil { // Coverage: This only fails if lookup by keyIdentity fails, but we just found and used that key. // Or maybe on some unexpected I/O error. return nil, "", err } if !slices.Contains(rules.acceptedKeyIdentities, primaryKey) { return nil, "", internal.NewInvalidSignatureError(fmt.Sprintf("signature by key %s of %s is not accepted", keyIdentity, primaryKey)) } keyIdentity = primaryKey } var unmatchedSignature untrustedSignature if err := json.Unmarshal(signed, &unmatchedSignature); err != nil { return nil, "", internal.NewInvalidSignatureError(err.Error()) } if err := rules.validateSignedDockerManifestDigest(unmatchedSignature.untrustedDockerManifestDigest); err != nil { return nil, "", err } if err := rules.validateSignedDockerReference(unmatchedSignature.untrustedDockerReference); err != nil { return nil, "", err } // signatureAcceptanceRules have accepted this value. return &Signature{ DockerManifestDigest: unmatchedSignature.untrustedDockerManifestDigest, DockerReference: unmatchedSignature.untrustedDockerReference, }, keyIdentity, nil } // GetUntrustedSignatureInformationWithoutVerifying extracts information available in an untrusted signature, // WITHOUT doing any cryptographic verification. // This may be useful when debugging signature verification failures, // or when managing a set of signatures on a single image. // // WARNING: Do not use the contents of this for ANY security decisions, // and be VERY CAREFUL about showing this information to humans in any way which suggest that these values “are probably” reliable. // There is NO REASON to expect the values to be correct, or not intentionally misleading // (including things like “✅ Verified by $authority”) func GetUntrustedSignatureInformationWithoutVerifying(untrustedSignatureBytes []byte) (*UntrustedSignatureInformation, error) { // NOTE: This should eventually do format autodetection. mech, _, err := NewEphemeralGPGSigningMechanism([]byte{}) if err != nil { return nil, err } defer mech.Close() untrustedContents, shortKeyIdentifier, err := mech.UntrustedSignatureContents(untrustedSignatureBytes) if err != nil { return nil, err } var untrustedDecodedContents untrustedSignature if err := json.Unmarshal(untrustedContents, &untrustedDecodedContents); err != nil { return nil, internal.NewInvalidSignatureError(err.Error()) } var timestamp *time.Time // = nil if untrustedDecodedContents.untrustedTimestamp != nil { ts := time.Unix(*untrustedDecodedContents.untrustedTimestamp, 0) timestamp = &ts } return &UntrustedSignatureInformation{ UntrustedDockerManifestDigest: untrustedDecodedContents.untrustedDockerManifestDigest, UntrustedDockerReference: untrustedDecodedContents.untrustedDockerReference, UntrustedCreatorID: untrustedDecodedContents.untrustedCreatorID, UntrustedTimestamp: timestamp, UntrustedShortKeyIdentifier: shortKeyIdentifier, }, nil } ================================================ FILE: vendor/go.podman.io/image/v5/signature/simplesequoia/mechanism.go ================================================ //go:build containers_image_sequoia package simplesequoia // This implements a signature.signingMechanismWithPassphrase that only supports signing. // // FIXME: Consider restructuring the simple signing signature creation code path // not to require this indirection and all those unimplemented methods. import ( "go.podman.io/image/v5/signature/internal/sequoia" ) // A GPG/OpenPGP signing mechanism, implemented using Sequoia. type sequoiaSigningOnlyMechanism struct { inner *sequoia.SigningMechanism } func (m *sequoiaSigningOnlyMechanism) Close() error { panic("Should never be called") } // SupportsSigning returns nil if the mechanism supports signing, or a SigningNotSupportedError. func (m *sequoiaSigningOnlyMechanism) SupportsSigning() error { panic("Should never be called") } // Sign creates a (non-detached) signature of input using keyIdentity and passphrase. // Fails with a SigningNotSupportedError if the mechanism does not support signing. func (m *sequoiaSigningOnlyMechanism) SignWithPassphrase(input []byte, keyIdentity string, passphrase string) ([]byte, error) { return m.inner.SignWithPassphrase(input, keyIdentity, passphrase) } // Sign creates a (non-detached) signature of input using keyIdentity. // Fails with a SigningNotSupportedError if the mechanism does not support signing. func (m *sequoiaSigningOnlyMechanism) Sign(input []byte, keyIdentity string) ([]byte, error) { panic("Should never be called") } // Verify parses unverifiedSignature and returns the content and the signer's identity func (m *sequoiaSigningOnlyMechanism) Verify(unverifiedSignature []byte) (contents []byte, keyIdentity string, err error) { panic("Should never be called") } // UntrustedSignatureContents returns UNTRUSTED contents of the signature WITHOUT ANY VERIFICATION, // along with a short identifier of the key used for signing. // WARNING: The short key identifier (which corresponds to "Key ID" for OpenPGP keys) // is NOT the same as a "key identity" used in other calls to this interface, and // the values may have no recognizable relationship if the public key is not available. func (m *sequoiaSigningOnlyMechanism) UntrustedSignatureContents(untrustedSignature []byte) (untrustedContents []byte, shortKeyIdentifier string, err error) { panic("Should never be called") } ================================================ FILE: vendor/go.podman.io/image/v5/signature/simplesequoia/options.go ================================================ package simplesequoia import ( "errors" "strings" ) type Option func(*simpleSequoiaSigner) error // WithSequoiaHome returns an Option for NewSigner, specifying a Sequoia home directory to use. func WithSequoiaHome(sequoiaHome string) Option { return func(s *simpleSequoiaSigner) error { s.sequoiaHome = sequoiaHome return nil } } // WithKeyFingerprint returns an Option for NewSigner, specifying a key to sign with, using the provided Sequoia-PGP key fingerprint. func WithKeyFingerprint(keyFingerprint string) Option { return func(s *simpleSequoiaSigner) error { s.keyFingerprint = keyFingerprint return nil } } // WithPassphrase returns an Option for NewSigner, specifying a passphrase for the private key. func WithPassphrase(passphrase string) Option { return func(s *simpleSequoiaSigner) error { // The gpgme implementation can’t use passphrase with \n; reject it here for consistent behavior. // FIXME: We don’t need it in this API at all, but the "\n" check exists in the current call stack. That should go away. if strings.Contains(passphrase, "\n") { return errors.New("invalid passphrase: must not contain a line break") } s.passphrase = passphrase return nil } } ================================================ FILE: vendor/go.podman.io/image/v5/signature/simplesequoia/signer.go ================================================ //go:build containers_image_sequoia package simplesequoia import ( "context" "errors" "fmt" "go.podman.io/image/v5/docker/reference" internalSig "go.podman.io/image/v5/internal/signature" internalSigner "go.podman.io/image/v5/internal/signer" "go.podman.io/image/v5/signature" "go.podman.io/image/v5/signature/internal/sequoia" "go.podman.io/image/v5/signature/signer" ) // simpleSequoiaSigner is a signer.SignerImplementation implementation for simple signing signatures using Sequoia. type simpleSequoiaSigner struct { mech *sequoia.SigningMechanism sequoiaHome string // "" if using the system’s default keyFingerprint string passphrase string // "" if not provided. } // NewSigner returns a signature.Signer which creates “simple signing” signatures using the user’s default // Sequoia PGP configuration. // // The set of options must identify a key to sign with, probably using a WithKeyFingerprint. // // The caller must call Close() on the returned Signer. func NewSigner(opts ...Option) (*signer.Signer, error) { s := simpleSequoiaSigner{} for _, o := range opts { if err := o(&s); err != nil { return nil, err } } if s.keyFingerprint == "" { return nil, errors.New("no key identity provided for simple signing") } if err := sequoia.Init(); err != nil { return nil, err // Coverage: This is impractical to test in-process, with the static go_sequoia_dlhandle. } mech, err := sequoia.NewMechanismFromDirectory(s.sequoiaHome) if err != nil { return nil, fmt.Errorf("initializing Sequoia: %w", err) } s.mech = mech succeeded := false defer func() { if !succeeded { s.mech.Close() // Coverage: This is currently unreachable. } }() // Ideally, we should look up (and unlock?) the key at this point already. FIXME: is that possible? Anyway, low-priority. succeeded = true return internalSigner.NewSigner(&s), nil } // ProgressMessage returns a human-readable sentence that makes sense to write before starting to create a single signature. func (s *simpleSequoiaSigner) ProgressMessage() string { return "Signing image using Sequoia-PGP simple signing" } // SignImageManifest creates a new signature for manifest m as dockerReference. func (s *simpleSequoiaSigner) SignImageManifest(ctx context.Context, m []byte, dockerReference reference.Named) (internalSig.Signature, error) { if reference.IsNameOnly(dockerReference) { return nil, fmt.Errorf("reference %s can’t be signed, it has neither a tag nor a digest", dockerReference.String()) } wrapped := sequoiaSigningOnlyMechanism{ inner: s.mech, } simpleSig, err := signature.SignDockerManifestWithOptions(m, dockerReference.String(), &wrapped, s.keyFingerprint, &signature.SignOptions{ Passphrase: s.passphrase, }) if err != nil { return nil, err } return internalSig.SimpleSigningFromBlob(simpleSig), nil } func (s *simpleSequoiaSigner) Close() error { return s.mech.Close() } ================================================ FILE: vendor/go.podman.io/image/v5/signature/simplesequoia/signer_stub.go ================================================ //go:build !containers_image_sequoia package simplesequoia import ( "errors" "go.podman.io/image/v5/signature/signer" ) // simpleSequoiaSigner is a signer.SignerImplementation implementation for simple signing signatures using Sequoia. type simpleSequoiaSigner struct { // This is not really used, we just keep the struct fields so that the With… Option functions can be compiled. sequoiaHome string // "" if using the system's default keyFingerprint string passphrase string // "" if not provided. } // NewSigner returns a signature.Signer which creates "simple signing" signatures using the user's default // Sequoia PGP configuration. // // The set of options must identify a key to sign with, probably using a WithKeyFingerprint. // // The caller must call Close() on the returned Signer. func NewSigner(opts ...Option) (*signer.Signer, error) { return nil, errors.New("Sequoia-PGP support is not enabled in this build") } ================================================ FILE: vendor/go.podman.io/image/v5/signature/simplesigning/signer.go ================================================ package simplesigning import ( "context" "errors" "fmt" "strings" "go.podman.io/image/v5/docker/reference" internalSig "go.podman.io/image/v5/internal/signature" internalSigner "go.podman.io/image/v5/internal/signer" "go.podman.io/image/v5/signature" "go.podman.io/image/v5/signature/signer" ) // simpleSigner is a signer.SignerImplementation implementation for simple signing signatures. type simpleSigner struct { mech signature.SigningMechanism keyFingerprint string passphrase string // "" if not provided. } type Option func(*simpleSigner) error // WithKeyFingerprint returns an Option for NewSigner, specifying a key to sign with, using the provided GPG key fingerprint. func WithKeyFingerprint(keyFingerprint string) Option { return func(s *simpleSigner) error { s.keyFingerprint = keyFingerprint return nil } } // WithPassphrase returns an Option for NewSigner, specifying a passphrase for the private key. // If this is not specified, the system may interactively prompt using a gpg-agent / pinentry. func WithPassphrase(passphrase string) Option { return func(s *simpleSigner) error { // The gpgme implementation can’t use passphrase with \n; reject it here for consistent behavior. if strings.Contains(passphrase, "\n") { return errors.New("invalid passphrase: must not contain a line break") } s.passphrase = passphrase return nil } } // NewSigner returns a signature.Signer which creates “simple signing” signatures using the user’s default // GPG configuration ($GNUPGHOME / ~/.gnupg). // // The set of options must identify a key to sign with, probably using a WithKeyFingerprint. // // The caller must call Close() on the returned Signer. func NewSigner(opts ...Option) (*signer.Signer, error) { mech, err := signature.NewGPGSigningMechanism() if err != nil { return nil, fmt.Errorf("initializing GPG: %w", err) } succeeded := false defer func() { if !succeeded { mech.Close() } }() if err := mech.SupportsSigning(); err != nil { return nil, fmt.Errorf("Signing not supported: %w", err) } s := simpleSigner{ mech: mech, } for _, o := range opts { if err := o(&s); err != nil { return nil, err } } if s.keyFingerprint == "" { return nil, errors.New("no key identity provided for simple signing") } // Ideally, we should look up (and unlock?) the key at this point already, but our current SigningMechanism API does not allow that. succeeded = true return internalSigner.NewSigner(&s), nil } // ProgressMessage returns a human-readable sentence that makes sense to write before starting to create a single signature. func (s *simpleSigner) ProgressMessage() string { return "Signing image using simple signing" } // SignImageManifest creates a new signature for manifest m as dockerReference. func (s *simpleSigner) SignImageManifest(ctx context.Context, m []byte, dockerReference reference.Named) (internalSig.Signature, error) { if reference.IsNameOnly(dockerReference) { return nil, fmt.Errorf("reference %s can’t be signed, it has neither a tag nor a digest", dockerReference.String()) } simpleSig, err := signature.SignDockerManifestWithOptions(m, dockerReference.String(), s.mech, s.keyFingerprint, &signature.SignOptions{ Passphrase: s.passphrase, }) if err != nil { return nil, err } return internalSig.SimpleSigningFromBlob(simpleSig), nil } func (s *simpleSigner) Close() error { return s.mech.Close() } ================================================ FILE: vendor/go.podman.io/image/v5/storage/storage_dest.go ================================================ //go:build !containers_image_storage_stub package storage import ( "bytes" "context" "encoding/json" "errors" "fmt" "io" "os" "path/filepath" "slices" "strings" "sync" "sync/atomic" digest "github.com/opencontainers/go-digest" imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" "github.com/sirupsen/logrus" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/internal/image" "go.podman.io/image/v5/internal/imagedestination/impl" "go.podman.io/image/v5/internal/imagedestination/stubs" srcImpl "go.podman.io/image/v5/internal/imagesource/impl" srcStubs "go.podman.io/image/v5/internal/imagesource/stubs" "go.podman.io/image/v5/internal/private" "go.podman.io/image/v5/internal/putblobdigest" "go.podman.io/image/v5/internal/signature" "go.podman.io/image/v5/internal/tmpdir" "go.podman.io/image/v5/manifest" "go.podman.io/image/v5/pkg/blobinfocache/none" "go.podman.io/image/v5/types" "go.podman.io/storage" graphdriver "go.podman.io/storage/drivers" "go.podman.io/storage/pkg/archive" "go.podman.io/storage/pkg/chunked" "go.podman.io/storage/pkg/chunked/toc" "go.podman.io/storage/pkg/ioutils" ) var ( // ErrBlobDigestMismatch could potentially be returned when PutBlob() is given a blob // with a digest-based name that doesn't match its contents. // Deprecated: PutBlob() doesn't do this any more (it just accepts the caller’s value), // and there is no known user of this error. ErrBlobDigestMismatch = errors.New("blob digest mismatch") // ErrBlobSizeMismatch is returned when PutBlob() is given a blob // with an expected size that doesn't match the reader. ErrBlobSizeMismatch = errors.New("blob size mismatch") ) type storageImageDestination struct { impl.Compat impl.PropertyMethodsInitialize stubs.ImplementsPutBlobPartial stubs.AlwaysSupportsSignatures imageRef storageReference directory string // Temporary directory where we store blobs until Commit() time nextTempFileID atomic.Int32 // A counter that we use for computing filenames to assign to blobs manifest []byte // (Per-instance) manifest contents, or nil if not yet known. manifestMIMEType string // Valid if manifest != nil manifestDigest digest.Digest // Valid if manifest != nil untrustedDiffIDValues []digest.Digest // From config’s RootFS.DiffIDs (not even validated to be valid digest.Digest!); or nil if not read yet signatures []byte // Signature contents, temporary signatureses map[digest.Digest][]byte // Instance signature contents, temporary metadata storageImageMetadata // Metadata contents being built // Mapping from layer (by index) to the associated ID in the storage. // It's protected *implicitly* since `commitLayer()`, at any given // time, can only be executed by *one* goroutine. Please refer to // `queueOrCommit()` for further details on how the single-caller // guarantee is implemented. indexToStorageID map[int]string // A storage destination may be used concurrently, due to HasThreadSafePutBlob. lock sync.Mutex // Protects lockProtected lockProtected storageImageDestinationLockProtected } // storageImageDestinationLockProtected contains storageImageDestination data which might be // accessed concurrently, due to HasThreadSafePutBlob. // _During the concurrent TryReusingBlob/PutBlob/* calls_ (but not necessarily during the final Commit) // uses must hold storageImageDestination.lock. type storageImageDestinationLockProtected struct { currentIndex int // The index of the layer to be committed (i.e., lower indices have already been committed) indexToAddedLayerInfo map[int]addedLayerInfo // Mapping from layer (by index) to blob to add to the image // Externally, a layer is identified either by (compressed) digest, or by TOC digest // (and we assume the TOC digest also uniquely identifies the contents, i.e. there aren’t two // different formats/ways to parse a single TOC); internally, we use uncompressed digest (“DiffID”) or a TOC digest. // We may or may not know the relationships between these three values. // // When creating a layer, the c/storage layer metadata and image IDs must _only_ be based on trusted values // we have computed ourselves. (Layer reuse can then look up against such trusted values, but it might not // recompute those values for incoming layers — the point of the reuse is that we don’t need to consume the incoming layer.) // // Layer identification: For a layer, at least one of (indexToDiffID, indexToTOCDigest, blobDiffIDs) must be available // before commitLayer is called. // The layer is identified by the first of the three fields which exists, in that order (and the value must be trusted). // // WARNING: All values in indexToDiffID, indexToTOCDigest, and blobDiffIDs are _individually_ trusted, but blobDiffIDs is more subtle. // The values in indexTo* are all consistent, because the code writing them processed them all at once, and consistently. // But it is possible for a layer’s indexToDiffID an indexToTOCDigest to be based on a TOC, without setting blobDiffIDs // for the compressed digest of that index, and for blobDiffIDs[compressedDigest] to be set _separately_ while processing some // other layer entry. In particular it is possible for indexToDiffID[index] and blobDiffIDs[compressedDigestAtIndex]] to refer // to mismatching contents. // Users of these fields should use trustedLayerIdentityDataLocked, which centralizes the validity logic, // instead of interpreting these fields, especially blobDiffIDs, directly. // // Ideally we wouldn’t have blobDiffIDs, and we would just keep records by index, but the public API does not require the caller // to provide layer indices; and configs don’t have layer indices. blobDiffIDs needs to exist for those cases. indexToDiffID map[int]digest.Digest // Mapping from layer index to DiffID // Mapping from layer index to a TOC Digest. // If this is set, then either c/storage/pkg/chunked/toc.GetTOCDigest must have returned a value, or indexToDiffID must be set as well. indexToTOCDigest map[int]digest.Digest blobDiffIDs map[digest.Digest]digest.Digest // Mapping from layer blobsums to their corresponding DiffIDs. CAREFUL: See the WARNING above. // Layer data: Before commitLayer is called, either at least one of (diffOutputs, indexToAdditionalLayer, filenames) // should be available; or indexToDiffID/indexToTOCDigest/blobDiffIDs should be enough to locate an existing c/storage layer. // They are looked up in the order they are mentioned above. diffOutputs map[int]*graphdriver.DriverWithDifferOutput // Mapping from layer index to a partially-pulled layer intermediate data indexToAdditionalLayer map[int]storage.AdditionalLayer // Mapping from layer index to their corresponding additional layer // Mapping from layer blobsums to names of files we used to hold them. If set, fileSizes and blobDiffIDs must also be set. filenames map[digest.Digest]string // Mapping from layer blobsums to their sizes. If set, filenames and blobDiffIDs must also be set. fileSizes map[digest.Digest]int64 // Config configDigest digest.Digest // "" if N/A or not known yet. } // addedLayerInfo records data about a layer to use in this image. type addedLayerInfo struct { digest digest.Digest // Mandatory, the digest of the layer. emptyLayer bool // The layer is an “empty”/“throwaway” one, and may or may not be physically represented in various transport / storage systems. false if the manifest type does not have the concept. } // newImageDestination sets us up to write a new image, caching blobs in a temporary directory until // it's time to Commit() the image func newImageDestination(sys *types.SystemContext, imageRef storageReference) (*storageImageDestination, error) { directory, err := tmpdir.MkDirBigFileTemp(sys, "storage") if err != nil { return nil, fmt.Errorf("creating a temporary directory: %w", err) } dest := &storageImageDestination{ PropertyMethodsInitialize: impl.PropertyMethods(impl.Properties{ SupportedManifestMIMETypes: []string{ imgspecv1.MediaTypeImageManifest, manifest.DockerV2Schema2MediaType, manifest.DockerV2Schema1SignedMediaType, manifest.DockerV2Schema1MediaType, }, // We ultimately have to decompress layers to populate trees on disk // and need to explicitly ask for it here, so that the layers' MIME // types can be set accordingly. DesiredLayerCompression: types.PreserveOriginal, AcceptsForeignLayerURLs: false, MustMatchRuntimeOS: true, IgnoresEmbeddedDockerReference: true, // Yes, we want the unmodified manifest HasThreadSafePutBlob: true, }), imageRef: imageRef, directory: directory, signatureses: make(map[digest.Digest][]byte), metadata: storageImageMetadata{ SignatureSizes: []int{}, SignaturesSizes: make(map[digest.Digest][]int), }, indexToStorageID: make(map[int]string), lockProtected: storageImageDestinationLockProtected{ indexToAddedLayerInfo: make(map[int]addedLayerInfo), indexToDiffID: make(map[int]digest.Digest), indexToTOCDigest: make(map[int]digest.Digest), blobDiffIDs: make(map[digest.Digest]digest.Digest), diffOutputs: make(map[int]*graphdriver.DriverWithDifferOutput), indexToAdditionalLayer: make(map[int]storage.AdditionalLayer), filenames: make(map[digest.Digest]string), fileSizes: make(map[digest.Digest]int64), }, } dest.Compat = impl.AddCompat(dest) return dest, nil } // Reference returns the reference used to set up this destination. Note that this should directly correspond to user's intent, // e.g. it should use the public hostname instead of the result of resolving CNAMEs or following redirects. func (s *storageImageDestination) Reference() types.ImageReference { return s.imageRef } // Close cleans up the temporary directory and additional layer store handlers. func (s *storageImageDestination) Close() error { // This is outside of the scope of HasThreadSafePutBlob, so we don’t need to hold s.lock. for _, al := range s.lockProtected.indexToAdditionalLayer { al.Release() } for _, v := range s.lockProtected.diffOutputs { _ = s.imageRef.transport.store.CleanupStagedLayer(v) } return os.RemoveAll(s.directory) } func (s *storageImageDestination) computeNextBlobCacheFile() string { return filepath.Join(s.directory, fmt.Sprintf("%d", s.nextTempFileID.Add(1))) } // NoteOriginalOCIConfig provides the config of the image, as it exists on the source, BUT converted to OCI format, // or an error obtaining that value (e.g. if the image is an artifact and not a container image). // The destination can use it in its TryReusingBlob/PutBlob implementations // (otherwise it only obtains the final config after all layers are written). func (s *storageImageDestination) NoteOriginalOCIConfig(ociConfig *imgspecv1.Image, configErr error) error { if configErr != nil { return fmt.Errorf("writing to c/storage without a valid image config: %w", configErr) } s.setUntrustedDiffIDValuesFromOCIConfig(ociConfig) return nil } // PutBlobWithOptions writes contents of stream and returns data representing the result. // inputInfo.Digest can be optionally provided if known; if provided, and stream is read to the end without error, the digest MUST match the stream contents. // inputInfo.Size is the expected length of stream, if known. // inputInfo.MediaType describes the blob format, if known. // WARNING: The contents of stream are being verified on the fly. Until stream.Read() returns io.EOF, the contents of the data SHOULD NOT be available // to any other readers for download using the supplied digest. // If stream.Read() at any time, ESPECIALLY at end of input, returns an error, PutBlob MUST 1) fail, and 2) delete any data stored so far. func (s *storageImageDestination) PutBlobWithOptions(ctx context.Context, stream io.Reader, blobinfo types.BlobInfo, options private.PutBlobOptions) (private.UploadedBlob, error) { info, err := s.putBlobToPendingFile(stream, blobinfo, &options) if err != nil { return info, err } if options.IsConfig { s.lock.Lock() defer s.lock.Unlock() if s.lockProtected.configDigest != "" { return private.UploadedBlob{}, fmt.Errorf("after config %q, refusing to record another config %q", s.lockProtected.configDigest.String(), info.Digest.String()) } s.lockProtected.configDigest = info.Digest return info, nil } if options.LayerIndex == nil { return info, nil } return info, s.queueOrCommit(*options.LayerIndex, addedLayerInfo{ digest: info.Digest, emptyLayer: options.EmptyLayer, }) } // putBlobToPendingFile implements ImageDestination.PutBlobWithOptions, storing stream into an on-disk file. // The caller must arrange the blob to be eventually committed using s.commitLayer(). func (s *storageImageDestination) putBlobToPendingFile(stream io.Reader, blobinfo types.BlobInfo, options *private.PutBlobOptions) (private.UploadedBlob, error) { // Stores a layer or data blob in our temporary directory, checking that any information // in the blobinfo matches the incoming data. if blobinfo.Digest != "" { if err := blobinfo.Digest.Validate(); err != nil { return private.UploadedBlob{}, fmt.Errorf("invalid digest %#v: %w", blobinfo.Digest.String(), err) } } // Set up to digest the blob if necessary, and count its size while saving it to a file. filename := s.computeNextBlobCacheFile() file, err := os.OpenFile(filename, os.O_CREATE|os.O_TRUNC|os.O_WRONLY|os.O_EXCL, 0o600) if err != nil { return private.UploadedBlob{}, fmt.Errorf("creating temporary file %q: %w", filename, err) } blobDigest, diffID, count, err := func() (_, _ digest.Digest, _ int64, retErr error) { // A scope for defer // since we are writing to this file, make sure we handle err on Close() defer func() { closeErr := file.Close() if retErr == nil { retErr = closeErr } }() counter := ioutils.NewWriteCounter(file) stream = io.TeeReader(stream, counter) digester, stream := putblobdigest.DigestIfUnknown(stream, blobinfo) decompressed, err := archive.DecompressStream(stream) if err != nil { return "", "", 0, fmt.Errorf("setting up to decompress blob: %w", err) } defer decompressed.Close() diffID := digest.Canonical.Digester() // Copy the data to the file. // TODO: This can take quite some time, and should ideally be cancellable using context.Context. _, err = io.Copy(diffID.Hash(), decompressed) if err != nil { return "", "", 0, fmt.Errorf("storing blob to file %q: %w", filename, err) } return digester.Digest(), diffID.Digest(), counter.Count, nil }() if err != nil { return private.UploadedBlob{}, err } // Determine blob properties, and fail if information that we were given about the blob // is known to be incorrect. blobSize := blobinfo.Size if blobSize < 0 { blobSize = count } else if blobinfo.Size != count { return private.UploadedBlob{}, ErrBlobSizeMismatch } // Record information about the blob. s.lock.Lock() s.lockProtected.blobDiffIDs[blobDigest] = diffID s.lockProtected.fileSizes[blobDigest] = count s.lockProtected.filenames[blobDigest] = filename s.lock.Unlock() // This is safe because we have just computed diffID, and blobDigest was either computed // by us, or validated by the caller (usually copy.digestingReader). options.Cache.RecordDigestUncompressedPair(blobDigest, diffID) return private.UploadedBlob{ Digest: blobDigest, Size: blobSize, }, nil } type zstdFetcher struct { chunkAccessor private.BlobChunkAccessor ctx context.Context blobInfo types.BlobInfo } // GetBlobAt converts from chunked.GetBlobAt to BlobChunkAccessor.GetBlobAt. func (f *zstdFetcher) GetBlobAt(chunks []chunked.ImageSourceChunk) (chan io.ReadCloser, chan error, error) { newChunks := make([]private.ImageSourceChunk, 0, len(chunks)) for _, v := range chunks { i := private.ImageSourceChunk{ Offset: v.Offset, Length: v.Length, } newChunks = append(newChunks, i) } rc, errs, err := f.chunkAccessor.GetBlobAt(f.ctx, f.blobInfo, newChunks) if _, ok := err.(private.BadPartialRequestError); ok { err = chunked.ErrBadRequest{} } return rc, errs, err } // PutBlobPartial attempts to create a blob using the data that is already present // at the destination. chunkAccessor is accessed in a non-sequential way to retrieve the missing chunks. // It is available only if SupportsPutBlobPartial(). // Even if SupportsPutBlobPartial() returns true, the call can fail. // If the call fails with ErrFallbackToOrdinaryLayerDownload, the caller can fall back to PutBlobWithOptions. // The fallback _must not_ be done otherwise. func (s *storageImageDestination) PutBlobPartial(ctx context.Context, chunkAccessor private.BlobChunkAccessor, srcInfo types.BlobInfo, options private.PutBlobPartialOptions) (_ private.UploadedBlob, retErr error) { inputTOCDigest, err := toc.GetTOCDigest(srcInfo.Annotations) if err != nil { return private.UploadedBlob{}, err } // The identity of partially-pulled layers is, as long as we keep compatibility with tar-like consumers, // unfixably ambiguous: there are two possible “views” of the same file (same compressed digest), // the traditional “view” that decompresses the primary stream and consumes a tar file, // and the partial-pull “view” that starts with the TOC. // The two “views” have two separate metadata sets and may refer to different parts of the blob for file contents; // the direct way to ensure they are consistent would be to read the full primary stream (and authenticate it against // the compressed digest), and ensure the metadata and layer contents exactly match the partially-pulled contents - // making the partial pull completely pointless. // // Instead, for partial-pull-capable layers (with inputTOCDigest set), we require the image to “commit” // to uncompressed layer digest values via the config's RootFS.DiffIDs array: // they are already naturally computed for traditionally-pulled layers, and for partially-pulled layers we // do the optimal partial pull, and then reconstruct the uncompressed tar stream just to (expensively) compute this digest. // // Layers which don’t support partial pulls (inputTOCDigest == "", incl. all schema1 layers) can be let through: // the partial pull code will either not engage, or consume the full layer; and the rules of indexToTOCDigest / layerIdentifiedByTOC // ensure the layer is identified by DiffID, i.e. using the traditional “view”. // // But if inputTOCDigest is set and the input image doesn't have RootFS.DiffIDs (the config is invalid for schema2/OCI), // don't allow a partial pull, and fall back to PutBlobWithOptions. // // (The user can opt out of the DiffID commitment checking by a c/storage option, giving up security for performance, // but we will still trigger the fall back here, and we will still enforce a DiffID match, so that the set of accepted images // is the same in both cases, and so that users are not tempted to set the c/storage option to allow accepting some invalid images.) var untrustedDiffID digest.Digest // "" if unknown udid, err := s.untrustedLayerDiffID(options.LayerIndex) if err != nil { var diffIDUnknownErr untrustedLayerDiffIDUnknownError switch { case errors.Is(err, errUntrustedLayerDiffIDNotYetAvailable): // PutBlobPartial is a private API, so all callers are within c/image, and should have called // NoteOriginalOCIConfig first. return private.UploadedBlob{}, fmt.Errorf("internal error: in PutBlobPartial, untrustedLayerDiffID returned errUntrustedLayerDiffIDNotYetAvailable") case errors.As(err, &diffIDUnknownErr): if inputTOCDigest != nil { return private.UploadedBlob{}, private.NewErrFallbackToOrdinaryLayerDownload(err) } untrustedDiffID = "" // A schema1 image or a non-TOC layer with no ambiguity, let it through default: return private.UploadedBlob{}, err } } else { untrustedDiffID = udid } fetcher := zstdFetcher{ chunkAccessor: chunkAccessor, ctx: ctx, blobInfo: srcInfo, } defer func() { var perr chunked.ErrFallbackToOrdinaryLayerDownload if errors.As(retErr, &perr) { retErr = private.NewErrFallbackToOrdinaryLayerDownload(retErr) } }() differ, err := chunked.NewDiffer(ctx, s.imageRef.transport.store, srcInfo.Digest, srcInfo.Size, srcInfo.Annotations, &fetcher) if err != nil { return private.UploadedBlob{}, err } defer differ.Close() out, err := s.imageRef.transport.store.PrepareStagedLayer(nil, differ) if err != nil { return private.UploadedBlob{}, fmt.Errorf("staging a partially-pulled layer: %w", err) } succeeded := false defer func() { if !succeeded { _ = s.imageRef.transport.store.CleanupStagedLayer(out) } }() if out.TOCDigest == "" && out.UncompressedDigest == "" { return private.UploadedBlob{}, errors.New("internal error: PrepareStagedLayer succeeded with neither TOCDigest nor UncompressedDigest set") } blobDigest := srcInfo.Digest s.lock.Lock() if err := func() error { // A scope for defer defer s.lock.Unlock() // For true partial pulls, c/storage decides whether to compute the uncompressed digest based on an option in storage.conf // (defaults to true, to avoid ambiguity.) // c/storage can also be configured, to consume a layer not prepared for partial pulls (primarily to allow composefs conversion), // and in that case it always consumes the full blob and always computes the uncompressed digest. if out.UncompressedDigest != "" { // This is centrally enforced later, in commitLayer, but because we have the value available, // we might just as well check immediately. if untrustedDiffID != "" && out.UncompressedDigest != untrustedDiffID { return fmt.Errorf("uncompressed digest of layer %q is %q, config claims %q", srcInfo.Digest.String(), out.UncompressedDigest.String(), untrustedDiffID.String()) } s.lockProtected.indexToDiffID[options.LayerIndex] = out.UncompressedDigest if out.TOCDigest != "" { s.lockProtected.indexToTOCDigest[options.LayerIndex] = out.TOCDigest options.Cache.RecordTOCUncompressedPair(out.TOCDigest, out.UncompressedDigest) } // If the whole layer has been consumed, chunked.GetDiffer is responsible for ensuring blobDigest has been validated. if out.CompressedDigest != "" { if out.CompressedDigest != blobDigest { return fmt.Errorf("internal error: PrepareStagedLayer returned CompressedDigest %q not matching expected %q", out.CompressedDigest, blobDigest) } // So, record also information about blobDigest, that might benefit reuse. // We trust PrepareStagedLayer to validate or create both values correctly. s.lockProtected.blobDiffIDs[blobDigest] = out.UncompressedDigest options.Cache.RecordDigestUncompressedPair(out.CompressedDigest, out.UncompressedDigest) } } else { // Sanity-check the defined rules for indexToTOCDigest. if inputTOCDigest == nil { return fmt.Errorf("internal error: PrepareStagedLayer returned a TOC-only identity for layer %q with no TOC digest", srcInfo.Digest.String()) } // Use diffID for layer identity if it is known. if uncompressedDigest := options.Cache.UncompressedDigestForTOC(out.TOCDigest); uncompressedDigest != "" { s.lockProtected.indexToDiffID[options.LayerIndex] = uncompressedDigest } s.lockProtected.indexToTOCDigest[options.LayerIndex] = out.TOCDigest } s.lockProtected.diffOutputs[options.LayerIndex] = out return nil }(); err != nil { return private.UploadedBlob{}, err } succeeded = true return private.UploadedBlob{ Digest: blobDigest, Size: srcInfo.Size, }, s.queueOrCommit(options.LayerIndex, addedLayerInfo{ digest: blobDigest, emptyLayer: options.EmptyLayer, }) } // TryReusingBlobWithOptions checks whether the transport already contains, or can efficiently reuse, a blob, and if so, applies it to the current destination // (e.g. if the blob is a filesystem layer, this signifies that the changes it describes need to be applied again when composing a filesystem tree). // info.Digest must not be empty. // If the blob has been successfully reused, returns (true, info, nil). // If the transport can not reuse the requested blob, TryReusingBlob returns (false, {}, nil); it returns a non-nil error only on an unexpected failure. func (s *storageImageDestination) TryReusingBlobWithOptions(ctx context.Context, blobinfo types.BlobInfo, options private.TryReusingBlobOptions) (bool, private.ReusedBlob, error) { if !impl.OriginalCandidateMatchesTryReusingBlobOptions(options) { return false, private.ReusedBlob{}, nil } reused, info, err := s.tryReusingBlobAsPending(blobinfo.Digest, blobinfo.Size, &options) if err != nil || !reused || options.LayerIndex == nil { return reused, info, err } return reused, info, s.queueOrCommit(*options.LayerIndex, addedLayerInfo{ digest: info.Digest, emptyLayer: options.EmptyLayer, }) } // tryReusingBlobAsPending implements TryReusingBlobWithOptions for (blobDigest, size or -1), filling s.blobDiffIDs and other metadata. // The caller must arrange the blob to be eventually committed using s.commitLayer(). func (s *storageImageDestination) tryReusingBlobAsPending(blobDigest digest.Digest, size int64, options *private.TryReusingBlobOptions) (bool, private.ReusedBlob, error) { if blobDigest == "" { return false, private.ReusedBlob{}, errors.New(`Can not check for a blob with unknown digest`) } if err := blobDigest.Validate(); err != nil { return false, private.ReusedBlob{}, fmt.Errorf("Can not check for a blob with invalid digest: %w", err) } useTOCDigest := false // If set, (options.TOCDigest != "" && options.LayerIndex != nil) AND we can use options.TOCDigest safely. if options.TOCDigest != "" && options.LayerIndex != nil { if err := options.TOCDigest.Validate(); err != nil { return false, private.ReusedBlob{}, fmt.Errorf("Can not check for a blob with invalid digest: %w", err) } // Only consider using TOCDigest if we can avoid ambiguous image “views”, see the detailed comment in PutBlobPartial. _, err := s.untrustedLayerDiffID(*options.LayerIndex) if err != nil { var diffIDUnknownErr untrustedLayerDiffIDUnknownError switch { case errors.Is(err, errUntrustedLayerDiffIDNotYetAvailable): // options.TOCDigest is a private API, so all callers are within c/image, and should have called // NoteOriginalOCIConfig first. return false, private.ReusedBlob{}, fmt.Errorf("internal error: in TryReusingBlobWithOptions, untrustedLayerDiffID returned errUntrustedLayerDiffIDNotYetAvailable") case errors.As(err, &diffIDUnknownErr): logrus.Debugf("Not using TOC %q to look for layer reuse: %v", options.TOCDigest, err) // But don’t abort entirely, keep useTOCDigest = false, try a blobDigest match. default: return false, private.ReusedBlob{}, err } } else { useTOCDigest = true } } // lock the entire method as it executes fairly quickly s.lock.Lock() defer s.lock.Unlock() if options.SrcRef != nil && useTOCDigest { // Check if we have the layer in the underlying additional layer store. aLayer, err := s.imageRef.transport.store.LookupAdditionalLayer(options.TOCDigest, options.SrcRef.String()) if err != nil && !errors.Is(err, storage.ErrLayerUnknown) { return false, private.ReusedBlob{}, fmt.Errorf(`looking for compressed layers with digest %q and labels: %w`, blobDigest, err) } else if err == nil { // Compare the long comment in PutBlobPartial. We assume that the Additional Layer Store will, somehow, // avoid layer “view” ambiguity. alsTOCDigest := aLayer.TOCDigest() if alsTOCDigest != options.TOCDigest { // FIXME: If alsTOCDigest is "", the Additional Layer Store FUSE server is probably just too old, and we could // probably go on reading the layer from other sources. // // Currently it should not be possible for alsTOCDigest to be set and not the expected value, but there’s // not that much benefit to checking for equality — we trust the FUSE server to validate the digest either way. return false, private.ReusedBlob{}, fmt.Errorf("additional layer for TOCDigest %q reports unexpected TOCDigest %q", options.TOCDigest, alsTOCDigest) } s.lockProtected.indexToTOCDigest[*options.LayerIndex] = options.TOCDigest s.lockProtected.indexToAdditionalLayer[*options.LayerIndex] = aLayer return true, private.ReusedBlob{ Digest: blobDigest, Size: aLayer.CompressedSize(), }, nil } } // Check if we have a wasn't-compressed layer in storage that's based on that blob. // Check if we've already cached it in a file. if size, ok := s.lockProtected.fileSizes[blobDigest]; ok { // s.lockProtected.blobDiffIDs is set either by putBlobToPendingFile or in createNewLayer when creating the // filenames/fileSizes entry. return true, private.ReusedBlob{ Digest: blobDigest, Size: size, }, nil } layers, err := s.imageRef.transport.store.LayersByUncompressedDigest(blobDigest) if err != nil && !errors.Is(err, storage.ErrLayerUnknown) { return false, private.ReusedBlob{}, fmt.Errorf(`looking for layers with digest %q: %w`, blobDigest, err) } if len(layers) > 0 { s.lockProtected.blobDiffIDs[blobDigest] = blobDigest return true, private.ReusedBlob{ Digest: blobDigest, Size: layers[0].UncompressedSize, }, nil } // Check if we have a was-compressed layer in storage that's based on that blob. layers, err = s.imageRef.transport.store.LayersByCompressedDigest(blobDigest) if err != nil && !errors.Is(err, storage.ErrLayerUnknown) { return false, private.ReusedBlob{}, fmt.Errorf(`looking for compressed layers with digest %q: %w`, blobDigest, err) } if len(layers) > 0 { // LayersByCompressedDigest only finds layers which were created from a full layer blob, and extracting that // always sets UncompressedDigest. diffID := layers[0].UncompressedDigest if diffID == "" { return false, private.ReusedBlob{}, fmt.Errorf("internal error: compressed layer %q (for compressed digest %q) does not have an uncompressed digest", layers[0].ID, blobDigest.String()) } s.lockProtected.blobDiffIDs[blobDigest] = diffID return true, private.ReusedBlob{ Digest: blobDigest, Size: layers[0].CompressedSize, }, nil } // Does the blob correspond to a known DiffID which we already have available? // Because we must return the size, which is unknown for unavailable compressed blobs, the returned BlobInfo refers to the // uncompressed layer, and that can happen only if options.CanSubstitute, or if the incoming manifest already specifies the size. if options.CanSubstitute || size != -1 { if uncompressedDigest := options.Cache.UncompressedDigest(blobDigest); uncompressedDigest != "" && uncompressedDigest != blobDigest { layers, err := s.imageRef.transport.store.LayersByUncompressedDigest(uncompressedDigest) if err != nil && !errors.Is(err, storage.ErrLayerUnknown) { return false, private.ReusedBlob{}, fmt.Errorf(`looking for layers with digest %q: %w`, uncompressedDigest, err) } if found, reused := reusedBlobFromLayerLookup(layers, blobDigest, size, options); found { s.lockProtected.blobDiffIDs[reused.Digest] = uncompressedDigest return true, reused, nil } } } if useTOCDigest { // Check if we know which which UncompressedDigest the TOC digest resolves to, and we have a match for that. // Prefer this over LayersByTOCDigest because we can identify the layer using UncompressedDigest, maximizing reuse. uncompressedDigest := options.Cache.UncompressedDigestForTOC(options.TOCDigest) if uncompressedDigest != "" { layers, err = s.imageRef.transport.store.LayersByUncompressedDigest(uncompressedDigest) if err != nil && !errors.Is(err, storage.ErrLayerUnknown) { return false, private.ReusedBlob{}, fmt.Errorf(`looking for layers with digest %q: %w`, uncompressedDigest, err) } if found, reused := reusedBlobFromLayerLookup(layers, blobDigest, size, options); found { s.lockProtected.indexToDiffID[*options.LayerIndex] = uncompressedDigest reused.MatchedByTOCDigest = true return true, reused, nil } } // Check if we have a chunked layer in storage with the same TOC digest. layers, err := s.imageRef.transport.store.LayersByTOCDigest(options.TOCDigest) if err != nil && !errors.Is(err, storage.ErrLayerUnknown) { return false, private.ReusedBlob{}, fmt.Errorf(`looking for layers with TOC digest %q: %w`, options.TOCDigest, err) } if found, reused := reusedBlobFromLayerLookup(layers, blobDigest, size, options); found { if uncompressedDigest == "" && layers[0].UncompressedDigest != "" { // Determine an uncompressed digest if at all possible, to use a traditional image ID // and to maximize image reuse. uncompressedDigest = layers[0].UncompressedDigest } if uncompressedDigest != "" { s.lockProtected.indexToDiffID[*options.LayerIndex] = uncompressedDigest } s.lockProtected.indexToTOCDigest[*options.LayerIndex] = options.TOCDigest reused.MatchedByTOCDigest = true return true, reused, nil } } // Nope, we don't have it. return false, private.ReusedBlob{}, nil } // reusedBlobFromLayerLookup returns (true, ReusedBlob) if layers contain a usable match; or (false, ...) if not. // The caller is still responsible for setting the layer identification fields, to allow the layer to be found again. func reusedBlobFromLayerLookup(layers []storage.Layer, blobDigest digest.Digest, blobSize int64, options *private.TryReusingBlobOptions) (bool, private.ReusedBlob) { if len(layers) > 0 { if blobSize != -1 { return true, private.ReusedBlob{ Digest: blobDigest, Size: blobSize, } } else if options.CanSubstitute && layers[0].UncompressedDigest != "" { return true, private.ReusedBlob{ Digest: layers[0].UncompressedDigest, Size: layers[0].UncompressedSize, CompressionOperation: types.Decompress, CompressionAlgorithm: nil, } } } return false, private.ReusedBlob{} } // trustedLayerIdentityData is a _consistent_ set of information known about a single layer. type trustedLayerIdentityData struct { // true if we decided the layer should be identified by tocDigest, false if by diffID // This can only be true if c/storage/pkg/chunked/toc.GetTOCDigest returns a value. layerIdentifiedByTOC bool diffID digest.Digest // A digest of the uncompressed full contents of the layer, or "" if unknown; must be set if !layerIdentifiedByTOC tocDigest digest.Digest // A digest of the TOC digest, or "" if unknown; must be set if layerIdentifiedByTOC blobDigest digest.Digest // A digest of the (possibly-compressed) layer as presented, or "" if unknown/untrusted. } // logString() prints a representation of trusted suitable identifying a layer in logs and errors. // The string is already quoted to expose malicious input and does not need to be quoted again. // Note that it does not include _all_ of the contents. func (trusted trustedLayerIdentityData) logString() string { return fmt.Sprintf("%q/%q/%q", trusted.blobDigest, trusted.tocDigest, trusted.diffID) } // trustedLayerIdentityDataLocked returns a _consistent_ set of information for a layer with (layerIndex, blobDigest). // blobDigest is the (possibly-compressed) layer digest referenced in the manifest. // It returns (trusted, true) if the layer was found, or (_, false) if insufficient data is available. // // The caller must hold s.lock. func (s *storageImageDestination) trustedLayerIdentityDataLocked(layerIndex int, blobDigest digest.Digest) (trustedLayerIdentityData, bool) { // The decision about layerIdentifiedByTOC must be _stable_ once the data for layerIndex is set, // even if s.lockProtected.blobDiffIDs changes later and we can subsequently find an entry that wasn’t originally available. // // If we previously didn't have a blobDigest match and decided to use the TOC, but _later_ we happen to find // a blobDigest match, we might in principle want to reconsider, set layerIdentifiedByTOC to false, and use the file: // but the layer in question, and possibly child layers, might already have been committed to storage. // A late-arriving addition to s.lockProtected.blobDiffIDs would mean that we would want to set // new layer IDs for potentially the whole parent chain = throw away the just-created layers and create them all again. // // Such a within-image layer reuse is expected to be pretty rare; instead, ignore the unexpected file match // and proceed to the originally-planned TOC match. res := trustedLayerIdentityData{} diffID, layerIdentifiedByDiffID := s.lockProtected.indexToDiffID[layerIndex] if layerIdentifiedByDiffID { res.layerIdentifiedByTOC = false res.diffID = diffID } if tocDigest, ok := s.lockProtected.indexToTOCDigest[layerIndex]; ok { res.tocDigest = tocDigest if !layerIdentifiedByDiffID { res.layerIdentifiedByTOC = true } } if otherDiffID, ok := s.lockProtected.blobDiffIDs[blobDigest]; ok { if !layerIdentifiedByDiffID && !res.layerIdentifiedByTOC { // This is the only data we have, so it is clearly self-consistent. res.layerIdentifiedByTOC = false res.diffID = otherDiffID res.blobDigest = blobDigest layerIdentifiedByDiffID = true } else { // We have set up the layer identity without referring to blobDigest: // an attacker might have used a manifest with non-matching tocDigest and blobDigest. // But, if we know a trusted diffID value from other sources, and it matches the one for blobDigest, // we know blobDigest is fine as well. if res.diffID != "" && otherDiffID == res.diffID { res.blobDigest = blobDigest } } } if !layerIdentifiedByDiffID && !res.layerIdentifiedByTOC { return trustedLayerIdentityData{}, false // We found nothing at all } return res, true } // computeID computes a recommended image ID based on information we have so far. If // the manifest is not of a type that we recognize, we return an empty value, indicating // that since we don't have a recommendation, a random ID should be used if one needs // to be allocated. func (s *storageImageDestination) computeID(m manifest.Manifest) (string, error) { // This is outside of the scope of HasThreadSafePutBlob, so we don’t need to hold s.lock. layerInfos := m.LayerInfos() // Build the diffID list. We need the decompressed sums that we've been calculating to // fill in the DiffIDs. It's expected (but not enforced by us) that the number of // diffIDs corresponds to the number of non-EmptyLayer entries in the history. var diffIDs []digest.Digest switch m.(type) { case *manifest.Schema1: // Build a list of the diffIDs we've generated for the non-throwaway FS layers for i, li := range layerInfos { if li.EmptyLayer { continue } trusted, ok := s.trustedLayerIdentityDataLocked(i, li.Digest) if !ok { // We have already committed all layers if we get to this point, so the data must have been available. return "", fmt.Errorf("internal inconsistency: layer (%d, %q) not found", i, li.Digest) } if trusted.diffID == "" { if trusted.layerIdentifiedByTOC { logrus.Infof("v2s1 image uses a layer identified by TOC with unknown diffID; choosing a random image ID") return "", nil } return "", fmt.Errorf("internal inconsistency: layer (%d, %q) is not identified by TOC and has no diffID", i, li.Digest) } diffIDs = append(diffIDs, trusted.diffID) } case *manifest.Schema2, *manifest.OCI1: // We know the ID calculation doesn't actually use the diffIDs, so we don't need to populate // the diffID list. default: return "", nil } // We want to use the same ID for “the same” images, but without risking unwanted sharing / malicious image corruption. // // Traditionally that means the same ~config digest, as computed by m.ImageID; // but if we identify a layer by TOC, we verify the layer against neither the (compressed) blob digest in the manifest, // nor against the config’s RootFS.DiffIDs. We don’t really want to do either, to allow partial layer pulls where we never see // most of the data. // // So, if a layer is identified by TOC (and we do validate against the TOC), the fact that we used the TOC, and the value of the TOC, // must enter into the image ID computation. // But for images where no TOC was used, continue to use IDs computed the traditional way, to maximize image reuse on upgrades, // and to introduce the changed behavior only when partial pulls are used. // // Note that it’s not 100% guaranteed that an image pulled by TOC uses an OCI manifest; consider // (skopeo copy --format v2s2 docker://…/zstd-chunked-image containers-storage:… ). So this is not happening only in the OCI case above. ordinaryImageID, err := m.ImageID(diffIDs) if err != nil { return "", err } var tocIDInput strings.Builder // ordinaryImageID is a digest of a config, which is a JSON value. // To avoid the risk of collisions, start the input with @ so that the input is not a valid JSON. tocIDInput.WriteString("@With TOC:") hasLayerPulledByTOC := false for i, li := range layerInfos { trusted, ok := s.trustedLayerIdentityDataLocked(i, li.Digest) if !ok { // We have already committed all layers if we get to this point, so the data must have been available. return "", fmt.Errorf("internal inconsistency: layer (%d, %q) not found", i, li.Digest) } layerValue := "" // An empty string is not a valid digest, so this is unambiguous with the TOC case. if trusted.layerIdentifiedByTOC { hasLayerPulledByTOC = true layerValue = trusted.tocDigest.String() } tocIDInput.WriteString(layerValue) tocIDInput.WriteByte('|') // "|" can not be present in a TOC digest, so this is an unambiguous separator. } if !hasLayerPulledByTOC { return ordinaryImageID, nil } tocImageID := digest.FromString(tocIDInput.String()).Encoded() logrus.Debugf("Ordinary storage image ID %s; a layer was looked up by TOC, so using image ID %s", ordinaryImageID, tocImageID) return tocImageID, nil } // getConfigBlob exists only to let us retrieve the configuration blob so that the manifest package can dig // information out of it for Inspect(). func (s *storageImageDestination) getConfigBlob(info types.BlobInfo) ([]byte, error) { if info.Digest == "" { return nil, errors.New(`no digest supplied when reading blob`) } if err := info.Digest.Validate(); err != nil { return nil, fmt.Errorf("invalid digest supplied when reading blob: %w", err) } // Assume it's a file, since we're only calling this from a place that expects to read files. if filename, ok := s.lockProtected.filenames[info.Digest]; ok { contents, err2 := os.ReadFile(filename) if err2 != nil { return nil, fmt.Errorf(`reading blob from file %q: %w`, filename, err2) } return contents, nil } // If it's not a file, it's a bug, because we're not expecting to be asked for a layer. return nil, errors.New("blob not found") } // queueOrCommit queues the specified layer to be committed to the storage. // If no other goroutine is already committing layers, the layer and all // subsequent layers (if already queued) will be committed to the storage. func (s *storageImageDestination) queueOrCommit(index int, info addedLayerInfo) error { // NOTE: whenever the code below is touched, make sure that all code // paths unlock the lock and to unlock it exactly once. // // Conceptually, the code is divided in two stages: // // 1) Queue in work by marking the layer as ready to be committed. // If at least one previous/parent layer with a lower index has // not yet been committed, return early. // // 2) Process the queued-in work by committing the "ready" layers // in sequence. Make sure that more items can be queued-in // during the comparatively I/O expensive task of committing a // layer. // // The conceptual benefit of this design is that caller can continue // pulling layers after an early return. At any given time, only one // caller is the "worker" routine committing layers. All other routines // can continue pulling and queuing in layers. s.lock.Lock() s.lockProtected.indexToAddedLayerInfo[index] = info // We're still waiting for at least one previous/parent layer to be // committed, so there's nothing to do. if index != s.lockProtected.currentIndex { s.lock.Unlock() return nil } for { info, ok := s.lockProtected.indexToAddedLayerInfo[index] if !ok { break } s.lock.Unlock() // Note: commitLayer locks on-demand. if stopQueue, err := s.commitLayer(index, info, -1); stopQueue || err != nil { return err } s.lock.Lock() index++ } // Set the index at the very end to make sure that only one routine // enters stage 2). s.lockProtected.currentIndex = index s.lock.Unlock() return nil } // commitLayer commits the specified layer with the given index to the storage. // size can usually be -1; it can be provided if the layer is not known to be already present in blobDiffIDs. // // If the layer cannot be committed yet, the function returns (true, nil). // // Note that the previous layer is expected to already be committed. // // Caution: this function must be called without holding `s.lock`. Callers // must guarantee that, at any given time, at most one goroutine may execute // `commitLayer()`. func (s *storageImageDestination) commitLayer(index int, info addedLayerInfo, size int64) (bool, error) { if _, alreadyCommitted := s.indexToStorageID[index]; alreadyCommitted { return false, nil } var parentLayer string // "" if no parent if index != 0 { // s.indexToStorageID can only be written by this function, and our caller // is responsible for ensuring it can be only be called by *one* goroutine at any // given time. Hence, we don't need to lock accesses. prev, ok := s.indexToStorageID[index-1] if !ok { return false, fmt.Errorf("Internal error: commitLayer called with previous layer %d not committed yet", index-1) } parentLayer = prev } if info.emptyLayer { s.indexToStorageID[index] = parentLayer return false, nil } // Collect trusted parameters of the layer. s.lock.Lock() trusted, ok := s.trustedLayerIdentityDataLocked(index, info.digest) s.lock.Unlock() if !ok { // Check if the layer exists already and the caller just (incorrectly) forgot to pass it to us in a PutBlob() / TryReusingBlob() / … // // Use none.NoCache to avoid a repeated DiffID lookup in the BlobInfoCache: a caller // that relies on using a blob digest that has never been seen by the store had better call // TryReusingBlob; not calling PutBlob already violates the documented API, so there’s only // so far we are going to accommodate that (if we should be doing that at all). // // We are also ignoring lookups by TOC, and other non-trivial situations. // Those can only happen using the c/image/internal/private API, // so those internal callers should be fixed to follow the API instead of expanding this fallback. logrus.Debugf("looking for diffID for blob=%+v", info.digest) // Use tryReusingBlobAsPending, not the top-level TryReusingBlobWithOptions, to prevent recursion via queueOrCommit. has, _, err := s.tryReusingBlobAsPending(info.digest, size, &private.TryReusingBlobOptions{ Cache: none.NoCache, CanSubstitute: false, }) if err != nil { return false, fmt.Errorf("checking for a layer based on blob %q: %w", info.digest.String(), err) } if !has { return false, fmt.Errorf("error determining uncompressed digest for blob %q", info.digest.String()) } s.lock.Lock() trusted, ok = s.trustedLayerIdentityDataLocked(index, info.digest) s.lock.Unlock() if !ok { return false, fmt.Errorf("we have blob %q, but don't know its layer ID", info.digest.String()) } } // Ensure that we always see the same “view” of a layer, as identified by the layer’s uncompressed digest, // unless the user has explicitly opted out of this in storage.conf: see the more detailed explanation in PutBlobPartial. if trusted.diffID != "" { untrustedDiffID, err := s.untrustedLayerDiffID(index) if err != nil { var diffIDUnknownErr untrustedLayerDiffIDUnknownError switch { case errors.Is(err, errUntrustedLayerDiffIDNotYetAvailable): logrus.Debugf("Skipping commit for layer %q, manifest not yet available for DiffID check", index) return true, nil case errors.As(err, &diffIDUnknownErr): // If untrustedLayerDiffIDUnknownError, the input image is schema1, has no TOC annotations, // so we could not have reused a TOC-identified layer nor have done a TOC-identified partial pull, // i.e. there is no other “view” to worry about. Sanity-check that we really see the only expected view. // // Or, maybe, the input image is OCI, and has invalid/missing DiffID values in config. In that case // we _must_ fail if we used a TOC-identified layer - but PutBlobPartial should have already // refused to do a partial pull, so we are in an inconsistent state. if trusted.layerIdentifiedByTOC { return false, fmt.Errorf("internal error: layer %d for blob %s was identified by TOC, but we don't have a DiffID in config", index, trusted.logString()) } // else a schema1 image or a non-TOC layer with no ambiguity, let it through default: return false, err } } else if trusted.diffID != untrustedDiffID { return false, fmt.Errorf("layer %d (blob %s) does not match config's DiffID %q", index, trusted.logString(), untrustedDiffID) } } id := layerID(parentLayer, trusted) if layer, err2 := s.imageRef.transport.store.Layer(id); layer != nil && err2 == nil { // There's already a layer that should have the right contents, just reuse it. s.indexToStorageID[index] = layer.ID return false, nil } layer, err := s.createNewLayer(index, trusted, parentLayer, id) if err != nil { return false, err } if layer == nil { return true, nil } s.indexToStorageID[index] = layer.ID return false, nil } // layerID computes a layer (“chain”) ID for (a possibly-empty parentID, trusted) func layerID(parentID string, trusted trustedLayerIdentityData) string { var component string mustHash := false if trusted.layerIdentifiedByTOC { // "@" is not a valid start of a digest.Digest.Encoded(), so this is unambiguous with the !layerIdentifiedByTOC case. // But we _must_ hash this below to get a Digest.Encoded()-formatted value. component = "@TOC=" + trusted.tocDigest.Encoded() mustHash = true } else { component = trusted.diffID.Encoded() // This looks like chain IDs, and it uses the traditional value. } if parentID == "" && !mustHash { return component } return digest.Canonical.FromString(parentID + "+" + component).Encoded() } // createNewLayer creates a new layer newLayerID for (index, trusted) on top of parentLayer (which may be ""). // If the layer cannot be committed yet, the function returns (nil, nil). func (s *storageImageDestination) createNewLayer(index int, trusted trustedLayerIdentityData, parentLayer, newLayerID string) (*storage.Layer, error) { s.lock.Lock() diffOutput, ok := s.lockProtected.diffOutputs[index] s.lock.Unlock() if ok { // Typically, we compute a trusted DiffID value to authenticate the layer contents, see the detailed explanation // in PutBlobPartial. If the user has opted out of that, but we know a trusted DiffID value // (e.g. from a BlobInfoCache), set it in diffOutput. // That way it will be persisted in storage even if the cache is deleted; also // we can use the value below to avoid the untrustedUncompressedDigest logic. if diffOutput.UncompressedDigest == "" && trusted.diffID != "" { diffOutput.UncompressedDigest = trusted.diffID } var untrustedUncompressedDigest digest.Digest if diffOutput.UncompressedDigest == "" { d, err := s.untrustedLayerDiffID(index) if err != nil { var diffIDUnknownErr untrustedLayerDiffIDUnknownError switch { case errors.Is(err, errUntrustedLayerDiffIDNotYetAvailable): logrus.Debugf("Skipping commit for layer %q, manifest not yet available", newLayerID) return nil, nil case errors.As(err, &diffIDUnknownErr): // If untrustedLayerDiffIDUnknownError, the input image is schema1, has no TOC annotations, // so we should have !trusted.layerIdentifiedByTOC, i.e. we should have set // diffOutput.UncompressedDigest above in this function, at the very latest. // // Or, maybe, the input image is OCI, and has invalid/missing DiffID values in config. In that case // commitLayer should have already refused this image when dealing with the “view” ambiguity. return nil, fmt.Errorf("internal error: layer %d for blob %s was partially-pulled with unknown UncompressedDigest, but we don't have a DiffID in config", index, trusted.logString()) default: return nil, err } } untrustedUncompressedDigest = d // While the contents of the digest are untrusted, make sure at least the _format_ is valid, // because we are going to write it to durable storage in expectedLayerDiffIDFlag . if err := untrustedUncompressedDigest.Validate(); err != nil { return nil, err } } flags := make(map[string]any) if untrustedUncompressedDigest != "" { flags[expectedLayerDiffIDFlag] = untrustedUncompressedDigest.String() logrus.Debugf("Setting uncompressed digest to %q for layer %q", untrustedUncompressedDigest, newLayerID) } args := storage.ApplyStagedLayerOptions{ ID: newLayerID, ParentLayer: parentLayer, DiffOutput: diffOutput, DiffOptions: &graphdriver.ApplyDiffWithDifferOpts{ Flags: flags, }, } layer, err := s.imageRef.transport.store.ApplyStagedLayer(args) if err != nil && !errors.Is(err, storage.ErrDuplicateID) { return nil, fmt.Errorf("failed to put layer using a partial pull: %w", err) } return layer, nil } s.lock.Lock() al, ok := s.lockProtected.indexToAdditionalLayer[index] s.lock.Unlock() if ok { layer, err := al.PutAs(newLayerID, parentLayer, nil) if err != nil && !errors.Is(err, storage.ErrDuplicateID) { return nil, fmt.Errorf("failed to put layer from digest and labels: %w", err) } return layer, nil } // Check if we previously cached a file with that blob's contents. If we didn't, // then we need to read the desired contents from a layer. var filename string var gotFilename bool if trusted.blobDigest != "" { s.lock.Lock() filename, gotFilename = s.lockProtected.filenames[trusted.blobDigest] s.lock.Unlock() } var trustedOriginalDigest digest.Digest // For storage.LayerOptions var trustedOriginalSize *int64 if gotFilename { // The code setting .filenames[trusted.blobDigest] is responsible for ensuring that the file contents match trusted.blobDigest. trustedOriginalDigest = trusted.blobDigest trustedOriginalSize = nil // It’s s.lockProtected.fileSizes[trusted.blobDigest], but we don’t hold the lock now, and the consumer can compute it at trivial cost. } else { // Try to find the layer with contents matching the data we use. var layer *storage.Layer // = nil if trusted.diffID != "" { if layers, err2 := s.imageRef.transport.store.LayersByUncompressedDigest(trusted.diffID); err2 == nil && len(layers) > 0 { layer = &layers[0] } } if layer == nil && trusted.tocDigest != "" { if layers, err2 := s.imageRef.transport.store.LayersByTOCDigest(trusted.tocDigest); err2 == nil && len(layers) > 0 { layer = &layers[0] } } if layer == nil && trusted.blobDigest != "" { if layers, err2 := s.imageRef.transport.store.LayersByCompressedDigest(trusted.blobDigest); err2 == nil && len(layers) > 0 { layer = &layers[0] } } if layer == nil { return nil, fmt.Errorf("layer for blob %s not found", trusted.logString()) } // Read the layer's contents. noCompression := archive.Uncompressed diffOptions := &storage.DiffOptions{ Compression: &noCompression, } diff, err2 := s.imageRef.transport.store.Diff("", layer.ID, diffOptions) if err2 != nil { return nil, fmt.Errorf("reading layer %q for blob %s: %w", layer.ID, trusted.logString(), err2) } // Copy the layer diff to a file. Diff() takes a lock that it holds // until the ReadCloser that it returns is closed, and PutLayer() wants // the same lock, so the diff can't just be directly streamed from one // to the other. filename = s.computeNextBlobCacheFile() file, err := os.OpenFile(filename, os.O_CREATE|os.O_TRUNC|os.O_WRONLY|os.O_EXCL, 0o600) if err != nil { diff.Close() return nil, fmt.Errorf("creating temporary file %q: %w", filename, err) } // Copy the data to the file. // TODO: This can take quite some time, and should ideally be cancellable using // ctx.Done(). fileSize, err := io.Copy(file, diff) diff.Close() file.Close() if err != nil { return nil, fmt.Errorf("storing blob to file %q: %w", filename, err) } if trusted.diffID == "" && layer.UncompressedDigest != "" { trusted.diffID = layer.UncompressedDigest // This data might have been unavailable in tryReusingBlobAsPending, and is only known now. } // Set the layer’s CompressedDigest/CompressedSize to relevant values if known, to allow more layer reuse. // But we don’t want to just use the size from the manifest if we never saw the compressed blob, // so that we don’t propagate mistakes / attacks. // // s.lockProtected.fileSizes[trusted.blobDigest] is not set, otherwise we would have found gotFilename. // So, check if the layer we found contains that metadata. (If that layer continues to exist, there’s no benefit // to us propagating the metadata; but that layer could be removed, and in that case propagating the metadata to // this new layer copy can help.) if trusted.blobDigest != "" && layer.CompressedDigest == trusted.blobDigest && layer.CompressedSize > 0 { trustedOriginalDigest = trusted.blobDigest sizeCopy := layer.CompressedSize trustedOriginalSize = &sizeCopy } else { // The stream we have is uncompressed, and it matches trusted.diffID (if known). // // We can legitimately set storage.LayerOptions.OriginalDigest to "", // but that would just result in PutLayer computing the digest of the input stream == trusted.diffID. // So, instead, set .OriginalDigest to the value we know already, to avoid that digest computation. trustedOriginalDigest = trusted.diffID trustedOriginalSize = nil // Probably layer.UncompressedSize, but the consumer can compute it at trivial cost. } // Allow using the already-collected layer contents without extracting the layer again. // // This only matches against the uncompressed digest. // If we have trustedOriginalDigest == trusted.blobDigest, we could arrange to reuse the // same uncompressed stream for future calls of createNewLayer; but for the non-layer blobs (primarily the config), // we assume that the file at filenames[someDigest] matches someDigest _exactly_; we would need to differentiate // between “original files” and “possibly uncompressed files”. // Within-image layer reuse is probably very rare, for now we prefer to avoid that complexity. if trusted.diffID != "" { s.lock.Lock() s.lockProtected.blobDiffIDs[trusted.diffID] = trusted.diffID s.lockProtected.filenames[trusted.diffID] = filename s.lockProtected.fileSizes[trusted.diffID] = fileSize s.lock.Unlock() } } // Read the cached blob and use it as a diff. file, err := os.Open(filename) if err != nil { return nil, fmt.Errorf("opening file %q: %w", filename, err) } defer file.Close() // Build the new layer using the diff, regardless of where it came from. // TODO: This can take quite some time, and should ideally be cancellable using ctx.Done(). layer, _, err := s.imageRef.transport.store.PutLayer(newLayerID, parentLayer, nil, "", false, &storage.LayerOptions{ OriginalDigest: trustedOriginalDigest, OriginalSize: trustedOriginalSize, // nil in many cases // This might be "" if trusted.layerIdentifiedByTOC; in that case PutLayer will compute the value from the stream. UncompressedDigest: trusted.diffID, }, file) if err != nil && !errors.Is(err, storage.ErrDuplicateID) { return nil, fmt.Errorf("adding layer with blob %s: %w", trusted.logString(), err) } return layer, nil } // uncommittedImageSource allows accessing an image’s metadata (not layers) before it has been committed, // to allow using image.FromUnparsedImage. type uncommittedImageSource struct { srcImpl.Compat srcImpl.PropertyMethodsInitialize srcImpl.NoSignatures srcImpl.DoesNotAffectLayerInfosForCopy srcStubs.NoGetBlobAtInitialize d *storageImageDestination } func newUncommittedImageSource(d *storageImageDestination) *uncommittedImageSource { s := &uncommittedImageSource{ PropertyMethodsInitialize: srcImpl.PropertyMethods(srcImpl.Properties{ HasThreadSafeGetBlob: true, }), NoGetBlobAtInitialize: srcStubs.NoGetBlobAt(d.Reference()), d: d, } s.Compat = srcImpl.AddCompat(s) return s } func (u *uncommittedImageSource) Reference() types.ImageReference { return u.d.Reference() } func (u *uncommittedImageSource) Close() error { return nil } func (u *uncommittedImageSource) GetManifest(ctx context.Context, instanceDigest *digest.Digest) ([]byte, string, error) { return u.d.manifest, u.d.manifestMIMEType, nil } func (u *uncommittedImageSource) GetBlob(ctx context.Context, info types.BlobInfo, cache types.BlobInfoCache) (io.ReadCloser, int64, error) { blob, err := u.d.getConfigBlob(info) if err != nil { return nil, -1, err } return io.NopCloser(bytes.NewReader(blob)), int64(len(blob)), nil } // errUntrustedLayerDiffIDNotYetAvailable is returned by untrustedLayerDiffID // if the value is not yet available (but it can be available after s.manifests is set). // This should only happen for external callers of the transport, not for c/image/copy. // // Callers of untrustedLayerDiffID before PutManifest must handle this error specially; // callers after PutManifest can use the default, reporting an internal error. var errUntrustedLayerDiffIDNotYetAvailable = errors.New("internal error: untrustedLayerDiffID has no value available and fallback was not implemented") // untrustedLayerDiffIDUnknownError is returned by untrustedLayerDiffID // if the image’s format does not provide DiffIDs. type untrustedLayerDiffIDUnknownError struct { layerIndex int } func (e untrustedLayerDiffIDUnknownError) Error() string { return fmt.Sprintf("DiffID value for layer %d is unknown or explicitly empty", e.layerIndex) } // untrustedLayerDiffID returns a DiffID value for layerIndex from the image’s config. // It may return two special errors, errUntrustedLayerDiffIDNotYetAvailable or untrustedLayerDiffIDUnknownError. // // WARNING: This function does not even validate that the returned digest has a valid format. // WARNING: We don’t _always_ validate this DiffID value against the layer contents; it must not be used for any deduplication. func (s *storageImageDestination) untrustedLayerDiffID(layerIndex int) (digest.Digest, error) { // At this point, we are either inside the multi-threaded scope of HasThreadSafePutBlob, // nothing is writing to s.manifest yet, and s.untrustedDiffIDValues might have been set // by NoteOriginalOCIConfig and are not being updated any more; // or PutManifest has been called and s.manifest != nil. // Either way this function does not need the protection of s.lock. if s.untrustedDiffIDValues == nil { // Typically, we expect untrustedDiffIDValues to be set by the generic copy code // via NoteOriginalOCIConfig; this is a compatibility fallback for external callers // of the public types.ImageDestination. if s.manifest == nil { return "", errUntrustedLayerDiffIDNotYetAvailable } ctx := context.Background() // This is all happening in memory, no need to worry about cancellation. unparsed := image.UnparsedInstance(newUncommittedImageSource(s), nil) sourced, err := image.FromUnparsedImage(ctx, nil, unparsed) if err != nil { return "", fmt.Errorf("parsing image to be committed: %w", err) } configOCI, err := sourced.OCIConfig(ctx) if err != nil { return "", fmt.Errorf("obtaining config of image to be committed: %w", err) } s.setUntrustedDiffIDValuesFromOCIConfig(configOCI) } // Let entirely empty / missing diffIDs through; but if the array does exist, expect it to contain an entry for every layer, // and fail hard on missing entries. This tries to account for completely naive image producers who just don’t fill DiffID, // while still detecting incorrectly-built / confused images. // // schema1 images don’t have DiffID values in the config. // Our schema1.OCIConfig code produces non-empty DiffID arrays of empty values, so treat arrays of all-empty // values as “DiffID unknown”. // For schema 1, it is important to exit here, before the layerIndex >= len(s.untrustedDiffIDValues) // check, because the format conversion from schema1 to OCI used to compute untrustedDiffIDValues // changes the number of layres (drops items with Schema1V1Compatibility.ThrowAway). if !slices.ContainsFunc(s.untrustedDiffIDValues, func(d digest.Digest) bool { return d != "" }) { return "", untrustedLayerDiffIDUnknownError{ layerIndex: layerIndex, } } if layerIndex >= len(s.untrustedDiffIDValues) { return "", fmt.Errorf("image config has only %d DiffID values, but a layer with index %d exists", len(s.untrustedDiffIDValues), layerIndex) } return s.untrustedDiffIDValues[layerIndex], nil } // setUntrustedDiffIDValuesFromOCIConfig updates s.untrustedDiffIDvalues from config. // The caller must ensure s.lock does not need to be held. func (s *storageImageDestination) setUntrustedDiffIDValuesFromOCIConfig(config *imgspecv1.Image) { s.untrustedDiffIDValues = slices.Clone(config.RootFS.DiffIDs) if s.untrustedDiffIDValues == nil { // Unlikely but possible in theory… s.untrustedDiffIDValues = []digest.Digest{} } } // CommitWithOptions marks the process of storing the image as successful and asks for the image to be persisted. // WARNING: This does not have any transactional semantics: // - Uploaded data MAY be visible to others before CommitWithOptions() is called // - Uploaded data MAY be removed or MAY remain around if Close() is called without CommitWithOptions() (i.e. rollback is allowed but not guaranteed) func (s *storageImageDestination) CommitWithOptions(ctx context.Context, options private.CommitOptions) error { // This function is outside of the scope of HasThreadSafePutBlob, so we don’t need to hold s.lock. if s.manifest == nil { return errors.New("Internal error: storageImageDestination.CommitWithOptions() called without PutManifest()") } toplevelManifest, _, err := options.UnparsedToplevel.Manifest(ctx) if err != nil { return fmt.Errorf("retrieving top-level manifest: %w", err) } // If the name we're saving to includes a digest, then check that the // manifests that we're about to save all either match the one from the // options.UnparsedToplevel, or match the digest in the name that we're using. if s.imageRef.named != nil { if digested, ok := s.imageRef.named.(reference.Digested); ok { matches, err := manifest.MatchesDigest(s.manifest, digested.Digest()) if err != nil { return err } if !matches { matches, err = manifest.MatchesDigest(toplevelManifest, digested.Digest()) if err != nil { return err } } if !matches { return fmt.Errorf("Manifest to be saved does not match expected digest %s", digested.Digest()) } } } // Find the list of layer blobs. man, err := manifest.FromBlob(s.manifest, s.manifestMIMEType) if err != nil { return fmt.Errorf("parsing manifest: %w", err) } layerBlobs := man.LayerInfos() // Extract, commit, or find the layers. for i, blob := range layerBlobs { if stopQueue, err := s.commitLayer(i, addedLayerInfo{ digest: blob.Digest, emptyLayer: blob.EmptyLayer, }, blob.Size); err != nil { return err } else if stopQueue { return fmt.Errorf("Internal error: storageImageDestination.CommitWithOptions(): commitLayer() not ready to commit for layer %q", blob.Digest) } } var lastLayer string if len(layerBlobs) > 0 { // Zero-layer images rarely make sense, but it is technically possible, and may happen for non-image artifacts. prev, ok := s.indexToStorageID[len(layerBlobs)-1] if !ok { return fmt.Errorf("Internal error: storageImageDestination.CommitWithOptions(): previous layer %d hasn't been committed (lastLayer == nil)", len(layerBlobs)-1) } lastLayer = prev } // If one of those blobs was a configuration blob, then we can try to dig out the date when the image // was originally created, in case we're just copying it. If not, no harm done. imgOptions := &storage.ImageOptions{} if inspect, err := man.Inspect(s.getConfigBlob); err == nil && inspect.Created != nil { logrus.Debugf("setting image creation date to %s", inspect.Created) imgOptions.CreationDate = *inspect.Created } // Set up to save the config as a data item. Since we only share layers, the config should be in a file. if s.lockProtected.configDigest != "" { v, err := os.ReadFile(s.lockProtected.filenames[s.lockProtected.configDigest]) if err != nil { return fmt.Errorf("copying config blob %q to image: %w", s.lockProtected.configDigest, err) } imgOptions.BigData = append(imgOptions.BigData, storage.ImageBigDataOption{ Key: s.lockProtected.configDigest.String(), Data: v, Digest: digest.Canonical.FromBytes(v), }) } // Set up to save the options.UnparsedToplevel's manifest if it differs from // the per-platform one, which is saved below. if !bytes.Equal(toplevelManifest, s.manifest) { manifestDigest, err := manifest.Digest(toplevelManifest) if err != nil { return fmt.Errorf("digesting top-level manifest: %w", err) } key, err := manifestBigDataKey(manifestDigest) if err != nil { return err } imgOptions.BigData = append(imgOptions.BigData, storage.ImageBigDataOption{ Key: key, Data: toplevelManifest, Digest: manifestDigest, }) } // Set up to save the image's manifest. Allow looking it up by digest by using the key convention defined by the Store. // Record the manifest twice: using a digest-specific key to allow references to that specific digest instance, // and using storage.ImageDigestBigDataKey for future users that don’t specify any digest and for compatibility with older readers. key, err := manifestBigDataKey(s.manifestDigest) if err != nil { return err } imgOptions.BigData = append(imgOptions.BigData, storage.ImageBigDataOption{ Key: key, Data: s.manifest, Digest: s.manifestDigest, }) imgOptions.BigData = append(imgOptions.BigData, storage.ImageBigDataOption{ Key: storage.ImageDigestBigDataKey, Data: s.manifest, Digest: s.manifestDigest, }) // Set up to save the signatures, if we have any. if len(s.signatures) > 0 { imgOptions.BigData = append(imgOptions.BigData, storage.ImageBigDataOption{ Key: "signatures", Data: s.signatures, Digest: digest.Canonical.FromBytes(s.signatures), }) } for instanceDigest, signatures := range s.signatureses { key, err := signatureBigDataKey(instanceDigest) if err != nil { return err } imgOptions.BigData = append(imgOptions.BigData, storage.ImageBigDataOption{ Key: key, Data: signatures, Digest: digest.Canonical.FromBytes(signatures), }) } // Set up to save our metadata. metadata, err := json.Marshal(s.metadata) if err != nil { return fmt.Errorf("encoding metadata for image: %w", err) } if len(metadata) != 0 { imgOptions.Metadata = string(metadata) } // Create the image record, pointing to the most-recently added layer. intendedID := s.imageRef.id if intendedID == "" { intendedID, err = s.computeID(man) if err != nil { return err } } oldNames := []string{} img, err := s.imageRef.transport.store.CreateImage(intendedID, nil, lastLayer, "", imgOptions) if err != nil { if !errors.Is(err, storage.ErrDuplicateID) { logrus.Debugf("error creating image: %q", err) return fmt.Errorf("creating image %q: %w", intendedID, err) } img, err = s.imageRef.transport.store.Image(intendedID) if err != nil { return fmt.Errorf("reading image %q: %w", intendedID, err) } if img.TopLayer != lastLayer { logrus.Debugf("error creating image: image with ID %q exists, but uses different layers", intendedID) return fmt.Errorf("image with ID %q already exists, but uses a different top layer: %w", intendedID, storage.ErrDuplicateID) } logrus.Debugf("reusing image ID %q", img.ID) oldNames = append(oldNames, img.Names...) // set the data items and metadata on the already-present image // FIXME: this _replaces_ any "signatures" blobs and their // sizes (tracked in the metadata) which might have already // been present with new values, when ideally we'd find a way // to merge them since they all apply to the same image for _, data := range imgOptions.BigData { if err := s.imageRef.transport.store.SetImageBigData(img.ID, data.Key, data.Data, manifest.Digest); err != nil { logrus.Debugf("error saving big data %q for image %q: %v", data.Key, img.ID, err) return fmt.Errorf("saving big data %q for image %q: %w", data.Key, img.ID, err) } } if imgOptions.Metadata != "" { if err := s.imageRef.transport.store.SetMetadata(img.ID, imgOptions.Metadata); err != nil { logrus.Debugf("error saving metadata for image %q: %v", img.ID, err) return fmt.Errorf("saving metadata for image %q: %w", img.ID, err) } logrus.Debugf("saved image metadata %q", imgOptions.Metadata) } } else { logrus.Debugf("created new image ID %q with metadata %q", img.ID, imgOptions.Metadata) } // Clean up the unfinished image on any error. // (Is this the right thing to do if the image has existed before?) commitSucceeded := false defer func() { if !commitSucceeded { logrus.Errorf("Updating image %q (old names %v) failed, deleting it", img.ID, oldNames) if _, err := s.imageRef.transport.store.DeleteImage(img.ID, true); err != nil { logrus.Errorf("Error deleting incomplete image %q: %v", img.ID, err) } } }() // Add the reference's name on the image. We don't need to worry about avoiding duplicate // values because AddNames() will deduplicate the list that we pass to it. if name := s.imageRef.DockerReference(); name != nil { if err := s.imageRef.transport.store.AddNames(img.ID, []string{name.String()}); err != nil { return fmt.Errorf("adding names %v to image %q: %w", name, img.ID, err) } logrus.Debugf("added name %q to image %q", name, img.ID) } if options.ReportResolvedReference != nil { // FIXME? This is using nil for the named reference. // It would be better to also use s.imageRef.named, because that allows us to resolve to the right // digest / manifest (and corresponding signatures). // The problem with that is that resolving such a reference fails if the s.imageRef.named name is moved to a different image // (because it is a tag that moved, or because we have pulled “the same” image for a different architecture). // Right now (2024-11), ReportResolvedReference is only used in c/common/libimage, where the caller only extracts the image ID, // so the name does not matter; to give us options, copy.Options.ReportResolvedReference is explicitly refusing to document // whether the value contains a name. resolved, err := newReference(s.imageRef.transport, nil, intendedID) if err != nil { return fmt.Errorf("creating a resolved reference for (%s, %s): %w", s.imageRef.StringWithinTransport(), intendedID, err) } *options.ReportResolvedReference = resolved } commitSucceeded = true return nil } // PutManifest writes the manifest to the destination. func (s *storageImageDestination) PutManifest(ctx context.Context, manifestBlob []byte, instanceDigest *digest.Digest) error { digest, err := manifest.Digest(manifestBlob) if err != nil { return err } s.manifest = bytes.Clone(manifestBlob) if s.manifest == nil { // Make sure PutManifest can never succeed with s.manifest == nil s.manifest = []byte{} } s.manifestMIMEType = manifest.GuessMIMEType(s.manifest) s.manifestDigest = digest return nil } // PutSignaturesWithFormat writes a set of signatures to the destination. // If instanceDigest is not nil, it contains a digest of the specific manifest instance to write or overwrite the signatures for // (when the primary manifest is a manifest list); this should always be nil if the primary manifest is not a manifest list. // MUST be called after PutManifest (signatures may reference manifest contents). func (s *storageImageDestination) PutSignaturesWithFormat(ctx context.Context, signatures []signature.Signature, instanceDigest *digest.Digest) error { sizes := []int{} sigblob := []byte{} for _, sigWithFormat := range signatures { sig, err := signature.Blob(sigWithFormat) if err != nil { return err } sizes = append(sizes, len(sig)) sigblob = append(sigblob, sig...) } if instanceDigest == nil { s.signatures = sigblob s.metadata.SignatureSizes = sizes if s.manifest != nil { manifestDigest := s.manifestDigest instanceDigest = &manifestDigest } } if instanceDigest != nil { s.signatureses[*instanceDigest] = sigblob s.metadata.SignaturesSizes[*instanceDigest] = sizes } return nil } ================================================ FILE: vendor/go.podman.io/image/v5/storage/storage_image.go ================================================ //go:build !containers_image_storage_stub package storage import ( "context" digest "github.com/opencontainers/go-digest" "go.podman.io/image/v5/internal/image" "go.podman.io/image/v5/types" "go.podman.io/storage" ) // ErrNoSuchImage is returned when we attempt to access an image which // doesn't exist in the storage area. var ErrNoSuchImage = storage.ErrNotAnImage // manifestBigDataKey returns a key suitable for recording a manifest with the specified digest using storage.Store.ImageBigData and related functions. // If a specific manifest digest is explicitly requested by the user, the key returned by this function should be used preferably; // for compatibility, if a manifest is not available under this key, check also storage.ImageDigestBigDataKey func manifestBigDataKey(digest digest.Digest) (string, error) { if err := digest.Validate(); err != nil { // Make sure info.Digest.String() uses the expected format and does not collide with other BigData keys. return "", err } return storage.ImageDigestManifestBigDataNamePrefix + "-" + digest.String(), nil } // signatureBigDataKey returns a key suitable for recording the signatures associated with the manifest with the specified digest using storage.Store.ImageBigData and related functions. // If a specific manifest digest is explicitly requested by the user, the key returned by this function should be used preferably; func signatureBigDataKey(digest digest.Digest) (string, error) { if err := digest.Validate(); err != nil { // digest.Digest.Encoded() panics on failure, so validate explicitly. return "", err } return "signature-" + digest.Encoded(), nil } // storageImageMetadata is stored, as JSON, in storage.Image.Metadata type storageImageMetadata struct { SignatureSizes []int `json:"signature-sizes,omitempty"` // List of sizes of each signature slice SignaturesSizes map[digest.Digest][]int `json:"signatures-sizes,omitempty"` // Sizes of each manifest's signature slice } type storageImageCloser struct { types.ImageCloser size int64 } // Size() returns the previously-computed size of the image, with no error. func (s *storageImageCloser) Size() (int64, error) { return s.size, nil } // newImage creates an image that also knows its size func newImage(ctx context.Context, sys *types.SystemContext, s storageReference) (types.ImageCloser, error) { src, err := newImageSource(sys, s) if err != nil { return nil, err } img, err := image.FromSource(ctx, sys, src) if err != nil { return nil, err } size, err := src.getSize() if err != nil { return nil, err } return &storageImageCloser{ImageCloser: img, size: size}, nil } ================================================ FILE: vendor/go.podman.io/image/v5/storage/storage_reference.go ================================================ //go:build !containers_image_storage_stub package storage import ( "context" "fmt" "slices" "strings" digest "github.com/opencontainers/go-digest" "github.com/sirupsen/logrus" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/manifest" "go.podman.io/image/v5/transports" "go.podman.io/image/v5/types" "go.podman.io/storage" ) // A storageReference holds an arbitrary name and/or an ID, which is a 32-byte // value hex-encoded into a 64-character string, and a reference to a Store // where an image is, or would be, kept. // Either "named" or "id" must be set. type storageReference struct { transport storageTransport named reference.Named // may include a tag and/or a digest id string } func newReference(transport storageTransport, named reference.Named, id string) (*storageReference, error) { if named == nil && id == "" { return nil, ErrInvalidReference } if named != nil && reference.IsNameOnly(named) { return nil, fmt.Errorf("reference %s has neither a tag nor a digest: %w", named.String(), ErrInvalidReference) } if id != "" { if err := validateImageID(id); err != nil { return nil, fmt.Errorf("invalid ID value %q: %v: %w", id, err.Error(), ErrInvalidReference) } } // We take a copy of the transport, which contains a pointer to the // store that it used for resolving this reference, so that the // transport that we'll return from Transport() won't be affected by // further calls to the original transport's SetStore() method. return &storageReference{ transport: transport, named: named, id: id, }, nil } // imageMatchesRepo returns true iff image.Names contains an element with the same repo as ref func imageMatchesRepo(image *storage.Image, ref reference.Named) bool { repo := ref.Name() return slices.ContainsFunc(image.Names, func(name string) bool { if named, err := reference.ParseNormalizedNamed(name); err == nil && named.Name() == repo { return true } return false }) } // multiArchImageMatchesSystemContext returns true if the passed-in image both contains a // multi-arch manifest that matches the passed-in digest, and the image is the per-platform // image instance that matches sys. // // See the comment in storageReference.ResolveImage explaining why // this check is necessary. func multiArchImageMatchesSystemContext(store storage.Store, img *storage.Image, manifestDigest digest.Digest, sys *types.SystemContext) bool { // Load the manifest that matches the specified digest. // We don't need to care about storage.ImageDigestBigDataKey because // manifests lists are only stored into storage by c/image versions // that know about manifestBigDataKey, and only using that key. key, err := manifestBigDataKey(manifestDigest) if err != nil { return false // This should never happen, manifestDigest comes from a reference.Digested, and that validates the format. } manifestBytes, err := store.ImageBigData(img.ID, key) if err != nil { return false } // The manifest is either a list, or not a list. If it's a list, find // the digest of the instance that matches the current system, and try // to load that manifest from the image record, and use it. manifestType := manifest.GuessMIMEType(manifestBytes) if !manifest.MIMETypeIsMultiImage(manifestType) { // manifestDigest directly specifies a per-platform image, so we aren't // choosing among different variants. return false } list, err := manifest.ListFromBlob(manifestBytes, manifestType) if err != nil { return false } chosenInstance, err := list.ChooseInstance(sys) if err != nil { return false } key, err = manifestBigDataKey(chosenInstance) if err != nil { return false } _, err = store.ImageBigData(img.ID, key) return err == nil // true if img.ID is based on chosenInstance. } // Resolve the reference's name to an image ID in the store, if there's already // one present with the same name or ID, and return the image. // // Returns an error matching ErrNoSuchImage if an image matching ref was not found. func (s *storageReference) resolveImage(sys *types.SystemContext) (*storage.Image, error) { var loadedImage *storage.Image if s.id == "" && s.named != nil { // Look for an image that has the expanded reference name as an explicit Name value. image, err := s.transport.store.Image(s.named.String()) if image != nil && err == nil { loadedImage = image s.id = image.ID } } if s.id == "" && s.named != nil { if digested, ok := s.named.(reference.Digested); ok { // Look for an image with the specified digest that has the same name, // though possibly with a different tag or digest, as a Name value, so // that the canonical reference can be implicitly resolved to the image. // // Typically there should be at most one such image, because the same // manifest digest implies the same config, and we choose the storage ID // based on the config (deduplicating images), except: // - the user can explicitly specify an ID when creating the image. // In this case we don't have a preference among the alternatives. // - when pulling an image from a multi-platform manifest list, we also // store the manifest list in the image; this allows referencing a // per-platform image using the manifest list digest, but that also // means that we can have multiple genuinely different images in the // storage matching the same manifest list digest (if pulled using different // SystemContext.{OS,Architecture,Variant}Choice to the same storage). // In this case we prefer the image matching the current SystemContext. images, err := s.transport.store.ImagesByDigest(digested.Digest()) if err == nil && len(images) > 0 { for _, image := range images { if imageMatchesRepo(image, s.named) { if loadedImage == nil || multiArchImageMatchesSystemContext(s.transport.store, image, digested.Digest(), sys) { loadedImage = image s.id = image.ID } } } } } } if s.id == "" { logrus.Debugf("reference %q does not resolve to an image ID", s.StringWithinTransport()) // %.0w makes the error visible to error.Unwrap() without including any text. // ErrNoSuchImage ultimately is “identifier is not an image”, which is not helpful for identifying the root cause. return nil, fmt.Errorf("reference %q does not resolve to an image ID%.0w", s.StringWithinTransport(), ErrNoSuchImage) } if loadedImage == nil { img, err := s.transport.store.Image(s.id) if err != nil { return nil, fmt.Errorf("reading image %q: %w", s.id, err) } loadedImage = img } if s.named != nil { if !imageMatchesRepo(loadedImage, s.named) { logrus.Errorf("no image matching reference %q found", s.StringWithinTransport()) return nil, ErrNoSuchImage } } // Default to having the image digest that we hand back match the most recently // added manifest... if digest, ok := loadedImage.BigDataDigests[storage.ImageDigestBigDataKey]; ok { loadedImage.Digest = digest } // ... unless the named reference says otherwise, and it matches one of the digests // in the image. For those cases, set the Digest field to that value, for the // sake of older consumers that don't know there's a whole list in there now. if s.named != nil { if digested, ok := s.named.(reference.Digested); ok { digest := digested.Digest() if slices.Contains(loadedImage.Digests, digest) { loadedImage.Digest = digest } } } return loadedImage, nil } // Return a Transport object that defaults to using the same store that we used // to build this reference object. func (s storageReference) Transport() types.ImageTransport { return &storageTransport{ store: s.transport.store, defaultUIDMap: s.transport.defaultUIDMap, defaultGIDMap: s.transport.defaultGIDMap, } } // Return a name with a tag or digest, if we have either, else return it bare. func (s storageReference) DockerReference() reference.Named { return s.named } // Return a name with a tag, prefixed with the graph root and driver name, to // disambiguate between images which may be present in multiple stores and // share only their names. func (s storageReference) StringWithinTransport() string { optionsList := "" options := s.transport.store.GraphOptions() if len(options) > 0 { optionsList = ":" + strings.Join(options, ",") } res := "[" + s.transport.store.GraphDriverName() + "@" + s.transport.store.GraphRoot() + "+" + s.transport.store.RunRoot() + optionsList + "]" if s.named != nil { res += s.named.String() } if s.id != "" { res += "@" + s.id } return res } func (s storageReference) PolicyConfigurationIdentity() string { res := "[" + s.transport.store.GraphDriverName() + "@" + s.transport.store.GraphRoot() + "]" if s.named != nil { res += s.named.String() } if s.id != "" { res += "@" + s.id } return res } // Also accept policy that's tied to the combination of the graph root and // driver name, to apply to all images stored in the Store, and to just the // graph root, in case we're using multiple drivers in the same directory for // some reason. func (s storageReference) PolicyConfigurationNamespaces() []string { storeSpec := "[" + s.transport.store.GraphDriverName() + "@" + s.transport.store.GraphRoot() + "]" driverlessStoreSpec := "[" + s.transport.store.GraphRoot() + "]" namespaces := []string{} if s.named != nil { if s.id != "" { // The reference without the ID is also a valid namespace. namespaces = append(namespaces, storeSpec+s.named.String()) } tagged, isTagged := s.named.(reference.Tagged) _, isDigested := s.named.(reference.Digested) if isTagged && isDigested { // s.named is "name:tag@digest"; add a "name:tag" parent namespace. namespaces = append(namespaces, storeSpec+s.named.Name()+":"+tagged.Tag()) } components := strings.Split(s.named.Name(), "/") for len(components) > 0 { namespaces = append(namespaces, storeSpec+strings.Join(components, "/")) components = components[:len(components)-1] } } namespaces = append(namespaces, storeSpec) namespaces = append(namespaces, driverlessStoreSpec) return namespaces } // NewImage returns a types.ImageCloser for this reference, possibly specialized for this ImageTransport. // The caller must call .Close() on the returned ImageCloser. // NOTE: If any kind of signature verification should happen, build an UnparsedImage from the value returned by NewImageSource, // verify that UnparsedImage, and convert it into a real Image via image.FromUnparsedImage. // WARNING: This may not do the right thing for a manifest list, see image.FromSource for details. func (s storageReference) NewImage(ctx context.Context, sys *types.SystemContext) (types.ImageCloser, error) { return newImage(ctx, sys, s) } func (s storageReference) DeleteImage(ctx context.Context, sys *types.SystemContext) error { img, err := s.resolveImage(sys) if err != nil { return err } layers, err := s.transport.store.DeleteImage(img.ID, true) if err == nil { logrus.Debugf("deleted image %q", img.ID) for _, layer := range layers { logrus.Debugf("deleted layer %q", layer) } } return err } func (s storageReference) NewImageSource(ctx context.Context, sys *types.SystemContext) (types.ImageSource, error) { return newImageSource(sys, s) } func (s storageReference) NewImageDestination(ctx context.Context, sys *types.SystemContext) (types.ImageDestination, error) { return newImageDestination(sys, s) } // ResolveReference finds the underlying storage image for a storage.Transport reference. // It returns that image, and an updated reference which can be used to refer back to the _same_ // image again. // // This matters if the input reference contains a tagged name; the destination of the tag can // move in local storage. The updated reference returned by this function contains the resolved // image ID, so later uses of that updated reference will either continue to refer to the same // image, or fail. // // Note that it _is_ possible for the later uses to fail, either because the image was removed // completely, or because the name used in the reference was untaged (even if the underlying image // ID still exists in local storage). // // Returns an error matching ErrNoSuchImage if an image matching ref was not found. func ResolveReference(ref types.ImageReference) (types.ImageReference, *storage.Image, error) { sref, ok := ref.(*storageReference) if !ok { return nil, nil, fmt.Errorf("trying to resolve a non-%s: reference %q", Transport.Name(), transports.ImageName(ref)) } clone := *sref // A shallow copy we can update img, err := clone.resolveImage(nil) if err != nil { return nil, nil, err } return clone, img, nil } ================================================ FILE: vendor/go.podman.io/image/v5/storage/storage_src.go ================================================ //go:build !containers_image_storage_stub package storage import ( "bytes" "context" "encoding/json" "errors" "fmt" "io" "maps" "os" "slices" "sync" digest "github.com/opencontainers/go-digest" imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" "github.com/sirupsen/logrus" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/internal/image" "go.podman.io/image/v5/internal/imagesource/impl" "go.podman.io/image/v5/internal/imagesource/stubs" "go.podman.io/image/v5/internal/signature" "go.podman.io/image/v5/internal/tmpdir" "go.podman.io/image/v5/manifest" "go.podman.io/image/v5/types" "go.podman.io/storage" "go.podman.io/storage/pkg/archive" "go.podman.io/storage/pkg/chunked/toc" "go.podman.io/storage/pkg/ioutils" ) type storageImageSource struct { impl.Compat impl.PropertyMethodsInitialize stubs.NoGetBlobAtInitialize imageRef storageReference image *storage.Image systemContext *types.SystemContext // SystemContext used in GetBlob() to create temporary files metadata storageImageMetadata cachedManifest []byte // A cached copy of the manifest, if already known, or nil cachedManifestMIMEType string // Valid if cachedManifest != nil getBlobMutex sync.Mutex // Mutex to sync state for parallel GetBlob executions getBlobMutexProtected getBlobMutexProtected } // getBlobMutexProtected contains storageImageSource data protected by getBlobMutex. type getBlobMutexProtected struct { // digestToLayerID is a lookup map from a possibly-untrusted uncompressed layer digest (as returned by LayerInfosForCopy) to the // layer ID in the store. digestToLayerID map[digest.Digest]string // layerPosition stores where we are in reading a blob's layers layerPosition map[digest.Digest]int } // expectedLayerDiffIDFlag is a per-layer flag containing an UNTRUSTED uncompressed digest of the layer. // It is set when pulling a layer by TOC; later, this value is used with digestToLayerID // to allow identifying the layer — and the consumer is expected to verify the blob returned by GetBlob against the digest. const expectedLayerDiffIDFlag = "expected-layer-diffid" // newImageSource sets up an image for reading. func newImageSource(sys *types.SystemContext, imageRef storageReference) (*storageImageSource, error) { // First, locate the image. img, err := imageRef.resolveImage(sys) if err != nil { return nil, err } // Build the reader object. image := &storageImageSource{ PropertyMethodsInitialize: impl.PropertyMethods(impl.Properties{ HasThreadSafeGetBlob: true, }), NoGetBlobAtInitialize: stubs.NoGetBlobAt(imageRef), imageRef: imageRef, systemContext: sys, image: img, metadata: storageImageMetadata{ SignatureSizes: []int{}, SignaturesSizes: make(map[digest.Digest][]int), }, getBlobMutexProtected: getBlobMutexProtected{ digestToLayerID: make(map[digest.Digest]string), layerPosition: make(map[digest.Digest]int), }, } image.Compat = impl.AddCompat(image) if img.Metadata != "" { if err := json.Unmarshal([]byte(img.Metadata), &image.metadata); err != nil { return nil, fmt.Errorf("decoding metadata for source image: %w", err) } } return image, nil } // Reference returns the image reference that we used to find this image. func (s *storageImageSource) Reference() types.ImageReference { return s.imageRef } // Close cleans up any resources we tied up while reading the image. func (s *storageImageSource) Close() error { return nil } // GetBlob returns a stream for the specified blob, and the blob’s size (or -1 if unknown). // The Digest field in BlobInfo is guaranteed to be provided, Size may be -1 and MediaType may be optionally provided. // May update BlobInfoCache, preferably after it knows for certain that a blob truly exists at a specific location. func (s *storageImageSource) GetBlob(ctx context.Context, info types.BlobInfo, cache types.BlobInfoCache) (io.ReadCloser, int64, error) { // We need a valid digest value. digest := info.Digest if err := digest.Validate(); err != nil { return nil, 0, err } if digest == image.GzippedEmptyLayerDigest { return io.NopCloser(bytes.NewReader(image.GzippedEmptyLayer)), int64(len(image.GzippedEmptyLayer)), nil } var layers []storage.Layer // This lookup path is strictly necessary for layers identified by TOC digest // (where LayersByUncompressedDigest might not find our layer); // for other layers it is an optimization to avoid the cost of the LayersByUncompressedDigest call. s.getBlobMutex.Lock() layerID, found := s.getBlobMutexProtected.digestToLayerID[digest] s.getBlobMutex.Unlock() if found { if layer, err := s.imageRef.transport.store.Layer(layerID); err == nil { layers = []storage.Layer{*layer} } } else { // Check if the blob corresponds to a diff that was used to initialize any layers. Our // callers should try to retrieve layers using their uncompressed digests, so no need to // check if they're using one of the compressed digests, which we can't reproduce anyway. layers, _ = s.imageRef.transport.store.LayersByUncompressedDigest(digest) } // If it's not a layer, then it must be a data item. if len(layers) == 0 { b, err := s.imageRef.transport.store.ImageBigData(s.image.ID, digest.String()) if err != nil { return nil, 0, err } r := bytes.NewReader(b) logrus.Debugf("exporting opaque data as blob %q", digest.String()) return io.NopCloser(r), int64(r.Len()), nil } // NOTE: the blob is first written to a temporary file and subsequently // closed. The intention is to keep the time we own the storage lock // as short as possible to allow other processes to access the storage. rc, n, _, err := s.getBlobAndLayerID(digest, layers) if err != nil { return nil, 0, err } defer rc.Close() tmpFile, err := tmpdir.CreateBigFileTemp(s.systemContext, "") if err != nil { return nil, 0, err } success := false tmpFileRemovePending := true defer func() { if !success { tmpFile.Close() if tmpFileRemovePending { os.Remove(tmpFile.Name()) } } }() // On Unix and modern Windows (2022 at least) we can eagerly unlink the file to ensure it's automatically // cleaned up on process termination (or if the caller forgets to invoke Close()) // On older versions of Windows we will have to fallback to relying on the caller to invoke Close() if err := os.Remove(tmpFile.Name()); err == nil { tmpFileRemovePending = false } if _, err := io.Copy(tmpFile, rc); err != nil { return nil, 0, err } if _, err := tmpFile.Seek(0, io.SeekStart); err != nil { return nil, 0, err } success = true if tmpFileRemovePending { return ioutils.NewReadCloserWrapper(tmpFile, func() error { tmpFile.Close() return os.Remove(tmpFile.Name()) }), n, nil } return tmpFile, n, nil } // getBlobAndLayer reads the data blob or filesystem layer which matches the digest and size, if given. func (s *storageImageSource) getBlobAndLayerID(digest digest.Digest, layers []storage.Layer) (rc io.ReadCloser, n int64, layerID string, err error) { var layer storage.Layer var diffOptions *storage.DiffOptions // Step through the list of matching layers. Tests may want to verify that if we have multiple layers // which claim to have the same contents, that we actually do have multiple layers, otherwise we could // just go ahead and use the first one every time. s.getBlobMutex.Lock() i := s.getBlobMutexProtected.layerPosition[digest] s.getBlobMutexProtected.layerPosition[digest] = i + 1 s.getBlobMutex.Unlock() if len(layers) > 0 { layer = layers[i%len(layers)] } // Force the storage layer to not try to match any compression that was used when the layer was first // handed to it. noCompression := archive.Uncompressed diffOptions = &storage.DiffOptions{ Compression: &noCompression, } if layer.UncompressedSize < 0 { n = -1 } else { n = layer.UncompressedSize } logrus.Debugf("exporting filesystem layer %q without compression for blob %q", layer.ID, digest) rc, err = s.imageRef.transport.store.Diff("", layer.ID, diffOptions) if err != nil { return nil, -1, "", err } return rc, n, layer.ID, err } // GetManifest() reads the image's manifest. func (s *storageImageSource) GetManifest(ctx context.Context, instanceDigest *digest.Digest) (manifestBlob []byte, mimeType string, err error) { if instanceDigest != nil { key, err := manifestBigDataKey(*instanceDigest) if err != nil { return nil, "", err } blob, err := s.imageRef.transport.store.ImageBigData(s.image.ID, key) if err != nil { return nil, "", fmt.Errorf("reading manifest for image instance %q: %w", *instanceDigest, err) } return blob, manifest.GuessMIMEType(blob), err } if s.cachedManifest == nil { // The manifest is stored as a big data item. // Prefer the manifest corresponding to the user-specified digest, if available. if s.imageRef.named != nil { if digested, ok := s.imageRef.named.(reference.Digested); ok { key, err := manifestBigDataKey(digested.Digest()) if err != nil { return nil, "", err } blob, err := s.imageRef.transport.store.ImageBigData(s.image.ID, key) if err != nil && !os.IsNotExist(err) { // os.IsNotExist is true if the image exists but there is no data corresponding to key return nil, "", err } if err == nil { s.cachedManifest = blob } } } // If the user did not specify a digest, or this is an old image stored before manifestBigDataKey was introduced, use the default manifest. // Note that the manifest may not match the expected digest, and that is likely to fail eventually, e.g. in c/image/image/UnparsedImage.Manifest(). if s.cachedManifest == nil { cachedBlob, err := s.imageRef.transport.store.ImageBigData(s.image.ID, storage.ImageDigestBigDataKey) if err != nil { return nil, "", err } s.cachedManifest = cachedBlob } s.cachedManifestMIMEType = manifest.GuessMIMEType(s.cachedManifest) } return s.cachedManifest, s.cachedManifestMIMEType, err } // LayerInfosForCopy() returns the list of layer blobs that make up the root filesystem of // the image, after they've been decompressed. func (s *storageImageSource) LayerInfosForCopy(ctx context.Context, instanceDigest *digest.Digest) ([]types.BlobInfo, error) { manifestBlob, manifestType, err := s.GetManifest(ctx, instanceDigest) if err != nil { return nil, fmt.Errorf("reading image manifest for %q: %w", s.image.ID, err) } if manifest.MIMETypeIsMultiImage(manifestType) { return nil, errors.New("can't copy layers for a manifest list (shouldn't be attempted)") } man, err := manifest.FromBlob(manifestBlob, manifestType) if err != nil { return nil, fmt.Errorf("parsing image manifest for %q: %w", s.image.ID, err) } uncompressedLayerType := "" gzipCompressedLayerType := "" switch manifestType { case imgspecv1.MediaTypeImageManifest: uncompressedLayerType = imgspecv1.MediaTypeImageLayer gzipCompressedLayerType = imgspecv1.MediaTypeImageLayerGzip case manifest.DockerV2Schema1MediaType, manifest.DockerV2Schema1SignedMediaType, manifest.DockerV2Schema2MediaType: uncompressedLayerType = manifest.DockerV2SchemaLayerMediaTypeUncompressed gzipCompressedLayerType = manifest.DockerV2Schema2LayerMediaType } physicalBlobInfos := []layerForCopy{} // Built reversed layerID := s.image.TopLayer for layerID != "" { layer, err := s.imageRef.transport.store.Layer(layerID) if err != nil { return nil, fmt.Errorf("reading layer %q in image %q: %w", layerID, s.image.ID, err) } blobDigest := layer.UncompressedDigest if blobDigest == "" { if layer.TOCDigest == "" { return nil, fmt.Errorf("uncompressed digest and TOC digest for layer %q is unknown", layerID) } if layer.Flags == nil || layer.Flags[expectedLayerDiffIDFlag] == nil { return nil, fmt.Errorf("TOC digest %q for layer %q is present but %q flag is not set", layer.TOCDigest, layerID, expectedLayerDiffIDFlag) } expectedDigest, ok := layer.Flags[expectedLayerDiffIDFlag].(string) if !ok { return nil, fmt.Errorf("TOC digest %q for layer %q is present but %q flag is not a string", layer.TOCDigest, layerID, expectedLayerDiffIDFlag) } // If the layer is stored by its TOC, report the expected diffID as the layer Digest; // the generic code is responsible for validating the digest. // We can locate the layer without further c/storage help using s.getBlobMutexProtected.digestToLayerID. blobDigest, err = digest.Parse(expectedDigest) if err != nil { return nil, fmt.Errorf("parsing expected diffID %q for layer %q: %w", expectedDigest, layerID, err) } } size := layer.UncompressedSize if size < 0 { size = -1 } s.getBlobMutex.Lock() s.getBlobMutexProtected.digestToLayerID[blobDigest] = layer.ID s.getBlobMutex.Unlock() layerInfo := layerForCopy{ digest: blobDigest, size: size, mediaType: uncompressedLayerType, } physicalBlobInfos = append(physicalBlobInfos, layerInfo) layerID = layer.Parent } slices.Reverse(physicalBlobInfos) res, err := buildLayerInfosForCopy(man.LayerInfos(), physicalBlobInfos, gzipCompressedLayerType) if err != nil { return nil, fmt.Errorf("creating LayerInfosForCopy of image %q: %w", s.image.ID, err) } return res, nil } // layerForCopy is information about a physical layer, an edit to be made by buildLayerInfosForCopy. type layerForCopy struct { digest digest.Digest size int64 mediaType string } // buildLayerInfosForCopy builds a LayerInfosForCopy return value based on manifestInfos from the original manifest, // but using layer data which we can actually produce — physicalInfos for non-empty layers, // and image.GzippedEmptyLayer with gzipCompressedLayerType for empty ones. // (This is split basically only to allow easily unit-testing the part that has no dependencies on the external environment.) func buildLayerInfosForCopy(manifestInfos []manifest.LayerInfo, physicalInfos []layerForCopy, gzipCompressedLayerType string) ([]types.BlobInfo, error) { nextPhysical := 0 res := make([]types.BlobInfo, len(manifestInfos)) for i, mi := range manifestInfos { if mi.EmptyLayer { res[i] = types.BlobInfo{ Digest: image.GzippedEmptyLayerDigest, Size: int64(len(image.GzippedEmptyLayer)), URLs: mi.URLs, Annotations: mi.Annotations, MediaType: gzipCompressedLayerType, } } else { if nextPhysical >= len(physicalInfos) { return nil, fmt.Errorf("expected more than %d physical layers to exist", len(physicalInfos)) } res[i] = types.BlobInfo{ Digest: physicalInfos[nextPhysical].digest, Size: physicalInfos[nextPhysical].size, URLs: mi.URLs, Annotations: mi.Annotations, MediaType: physicalInfos[nextPhysical].mediaType, } nextPhysical++ } // We have changed the compression format, so strip compression-related annotations. if res[i].Annotations != nil { maps.DeleteFunc(res[i].Annotations, func(key string, _ string) bool { _, ok := toc.ChunkedAnnotations[key] return ok }) if len(res[i].Annotations) == 0 { res[i].Annotations = nil } } } if nextPhysical != len(physicalInfos) { return nil, fmt.Errorf("used only %d out of %d physical layers", nextPhysical, len(physicalInfos)) } return res, nil } // GetSignaturesWithFormat returns the image's signatures. It may use a remote (= slow) service. // If instanceDigest is not nil, it contains a digest of the specific manifest instance to retrieve signatures for // (when the primary manifest is a manifest list); this never happens if the primary manifest is not a manifest list // (e.g. if the source never returns manifest lists). func (s *storageImageSource) GetSignaturesWithFormat(ctx context.Context, instanceDigest *digest.Digest) ([]signature.Signature, error) { var offset int signatureBlobs := []byte{} signatureSizes := s.metadata.SignatureSizes key := "signatures" instance := "default instance" if instanceDigest != nil { signatureSizes = s.metadata.SignaturesSizes[*instanceDigest] k, err := signatureBigDataKey(*instanceDigest) if err != nil { return nil, err } key = k if err := instanceDigest.Validate(); err != nil { // digest.Digest.Encoded() panics on failure, so validate explicitly. return nil, err } instance = instanceDigest.Encoded() } if len(signatureSizes) > 0 { data, err := s.imageRef.transport.store.ImageBigData(s.image.ID, key) if err != nil { return nil, fmt.Errorf("looking up signatures data for image %q (%s): %w", s.image.ID, instance, err) } signatureBlobs = data } res := []signature.Signature{} for _, length := range signatureSizes { if offset+length > len(signatureBlobs) { return nil, fmt.Errorf("looking up signatures data for image %q (%s): expected at least %d bytes, only found %d", s.image.ID, instance, len(signatureBlobs), offset+length) } sig, err := signature.FromBlob(signatureBlobs[offset : offset+length]) if err != nil { return nil, fmt.Errorf("parsing signature at (%d, %d): %w", offset, length, err) } res = append(res, sig) offset += length } if offset != len(signatureBlobs) { return nil, fmt.Errorf("signatures data (%s) contained %d extra bytes", instance, len(signatureBlobs)-offset) } return res, nil } // getSize() adds up the sizes of the image's data blobs (which includes the configuration blob), the // signatures, and the uncompressed sizes of all of the image's layers. func (s *storageImageSource) getSize() (int64, error) { var sum int64 // Size up the data blobs. dataNames, err := s.imageRef.transport.store.ListImageBigData(s.image.ID) if err != nil { return -1, fmt.Errorf("reading image %q: %w", s.image.ID, err) } for _, dataName := range dataNames { bigSize, err := s.imageRef.transport.store.ImageBigDataSize(s.image.ID, dataName) if err != nil { return -1, fmt.Errorf("reading data blob size %q for %q: %w", dataName, s.image.ID, err) } sum += bigSize } // Add the signature sizes. for _, sigSize := range s.metadata.SignatureSizes { sum += int64(sigSize) } // Walk the layer list. layerID := s.image.TopLayer for layerID != "" { layer, err := s.imageRef.transport.store.Layer(layerID) if err != nil { return -1, err } if (layer.TOCDigest == "" && layer.UncompressedDigest == "") || (layer.TOCDigest == "" && layer.UncompressedSize < 0) { return -1, fmt.Errorf("size for layer %q is unknown, failing getSize()", layerID) } // FIXME: We allow layer.UncompressedSize < 0 above, because currently images in an Additional Layer Store don’t provide that value. // Right now, various callers in Podman (and, also, newImage in this package) don’t expect the size computation to fail. // Should we update the callers, or do we need to continue returning inaccurate information here? Or should we pay the cost // to compute the size from the diff? if layer.UncompressedSize >= 0 { sum += layer.UncompressedSize } if layer.Parent == "" { break } layerID = layer.Parent } return sum, nil } // Size() adds up the sizes of the image's data blobs (which includes the configuration blob), the // signatures, and the uncompressed sizes of all of the image's layers. func (s *storageImageSource) Size() (int64, error) { return s.getSize() } ================================================ FILE: vendor/go.podman.io/image/v5/storage/storage_transport.go ================================================ //go:build !containers_image_storage_stub package storage import ( "errors" "fmt" "path/filepath" "strings" digest "github.com/opencontainers/go-digest" "github.com/sirupsen/logrus" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/transports" "go.podman.io/image/v5/types" "go.podman.io/storage" "go.podman.io/storage/pkg/idtools" ) const ( minimumTruncatedIDLength = 3 ) func init() { transports.Register(Transport) } var ( // Transport is an ImageTransport that uses either a default // storage.Store or one that's it's explicitly told to use. Transport StoreTransport = &storageTransport{} // ErrInvalidReference is returned when ParseReference() is passed an // empty reference. ErrInvalidReference = errors.New("invalid reference") // ErrPathNotAbsolute is returned when a graph root is not an absolute // path name. ErrPathNotAbsolute = errors.New("path name is not absolute") ) // StoreTransport is an ImageTransport that uses a storage.Store to parse // references, either its own default or one that it's told to use. type StoreTransport interface { types.ImageTransport // SetStore sets the default store for this transport. SetStore(storage.Store) // GetStoreIfSet returns the default store for this transport, or nil if not set/determined yet. GetStoreIfSet() storage.Store // GetImage retrieves the image from the transport's store that's named // by the reference. // Deprecated: Surprisingly, with a StoreTransport reference which contains an ID, // this ignores that ID; and repeated calls of GetStoreImage with the same named reference // can return different images, with no way for the caller to "freeze" the storage.Image identity // without discarding the name entirely. // // Use storage.ResolveReference instead; note that if the image is not found, ResolveReference returns // c/image/v5/storage.ErrNoSuchImage, not c/storage.ErrImageUnknown. GetImage(types.ImageReference) (*storage.Image, error) // GetStoreImage retrieves the image from a specified store that's named // by the reference. // // Deprecated: Surprisingly, with a StoreTransport reference which contains an ID, // this ignores that ID; and repeated calls of GetStoreImage with the same named reference // can return different images, with no way for the caller to "freeze" the storage.Image identity // without discarding the name entirely. // // Also, a StoreTransport reference already contains a store, so providing another one is redundant. // // Use storage.ResolveReference instead; note that if the image is not found, ResolveReference returns // c/image/v5/storage.ErrNoSuchImage, not c/storage.ErrImageUnknown. GetStoreImage(storage.Store, types.ImageReference) (*storage.Image, error) // ParseStoreReference parses a reference, overriding any store // specification that it may contain. ParseStoreReference(store storage.Store, reference string) (*storageReference, error) // NewStoreReference creates a reference for (named@ID) in store. // either of name or ID can be unset; named must not be a reference.IsNameOnly. NewStoreReference(store storage.Store, named reference.Named, id string) (*storageReference, error) // SetDefaultUIDMap sets the default UID map to use when opening stores. SetDefaultUIDMap(idmap []idtools.IDMap) // SetDefaultGIDMap sets the default GID map to use when opening stores. SetDefaultGIDMap(idmap []idtools.IDMap) // DefaultUIDMap returns the default UID map used when opening stores. DefaultUIDMap() []idtools.IDMap // DefaultGIDMap returns the default GID map used when opening stores. DefaultGIDMap() []idtools.IDMap } type storageTransport struct { store storage.Store defaultUIDMap []idtools.IDMap defaultGIDMap []idtools.IDMap } func (s *storageTransport) Name() string { // Still haven't really settled on a name. return "containers-storage" } // SetStore sets the Store object which the Transport will use for parsing // references when information about a Store is not directly specified as part // of the reference. If one is not set, the library will attempt to initialize // one with default settings when a reference needs to be parsed. Calling // SetStore does not affect previously parsed references. func (s *storageTransport) SetStore(store storage.Store) { s.store = store } // GetStoreIfSet returns the default store for this transport, as set using SetStore() or initialized by default, or nil if not set/determined yet. func (s *storageTransport) GetStoreIfSet() storage.Store { return s.store } // SetDefaultUIDMap sets the default UID map to use when opening stores. func (s *storageTransport) SetDefaultUIDMap(idmap []idtools.IDMap) { s.defaultUIDMap = idmap } // SetDefaultGIDMap sets the default GID map to use when opening stores. func (s *storageTransport) SetDefaultGIDMap(idmap []idtools.IDMap) { s.defaultGIDMap = idmap } // DefaultUIDMap returns the default UID map used when opening stores. func (s *storageTransport) DefaultUIDMap() []idtools.IDMap { return s.defaultUIDMap } // DefaultGIDMap returns the default GID map used when opening stores. func (s *storageTransport) DefaultGIDMap() []idtools.IDMap { return s.defaultGIDMap } // ParseStoreReference takes a name or an ID, tries to figure out which it is // relative to the given store, and returns it in a reference object. func (s storageTransport) ParseStoreReference(store storage.Store, ref string) (*storageReference, error) { if ref == "" { return nil, fmt.Errorf("%q is an empty reference: %w", ref, ErrInvalidReference) } if ref[0] == '[' { // Ignore the store specifier. closeIndex := strings.IndexRune(ref, ']') if closeIndex < 1 { return nil, fmt.Errorf("store specifier in %q did not end: %w", ref, ErrInvalidReference) } ref = ref[closeIndex+1:] } // The reference may end with an image ID. Image IDs and digests use the same "@" separator; // here we only peel away an image ID, and leave digests alone. split := strings.LastIndex(ref, "@") id := "" if split != -1 { possibleID := ref[split+1:] if possibleID == "" { return nil, fmt.Errorf("empty trailing digest or ID in %q: %w", ref, ErrInvalidReference) } // If it looks like a digest, leave it alone for now. if _, err := digest.Parse(possibleID); err != nil { // Otherwise… if err := validateImageID(possibleID); err == nil { id = possibleID // … it is a full ID } else if img, err := store.Image(possibleID); err == nil && img != nil && len(possibleID) >= minimumTruncatedIDLength && strings.HasPrefix(img.ID, possibleID) { // … it is a truncated version of the ID of an image that's present in local storage, // so we might as well use the expanded value. id = img.ID } else { return nil, fmt.Errorf("%q does not look like an image ID or digest: %w", possibleID, ErrInvalidReference) } // We have recognized an image ID; peel it off. ref = ref[:split] } } // If we only have one @-delimited portion, then _maybe_ it's a truncated image ID. Only check on that if it's // at least of what we guess is a reasonable minimum length, because we don't want a really short value // like "a" matching an image by ID prefix when the input was actually meant to specify an image name. if id == "" && len(ref) >= minimumTruncatedIDLength && !strings.ContainsAny(ref, "@:") { if img, err := store.Image(ref); err == nil && img != nil && strings.HasPrefix(img.ID, ref) { // It's a truncated version of the ID of an image that's present in local storage; // we need to expand it. id = img.ID ref = "" } } var named reference.Named // Unless we have an un-named "ID" or "@ID" reference (where ID might only have been a prefix), which has been // completely parsed above, the initial portion should be a name, possibly with a tag and/or a digest.. if ref != "" { var err error named, err = reference.ParseNormalizedNamed(ref) if err != nil { return nil, fmt.Errorf("parsing named reference %q: %w", ref, err) } named = reference.TagNameOnly(named) } result, err := s.NewStoreReference(store, named, id) if err != nil { return nil, err } logrus.Debugf("parsed reference into %q", result.StringWithinTransport()) return result, nil } // NewStoreReference creates a reference for (named@ID) in store. // either of name or ID can be unset; named must not be a reference.IsNameOnly. func (s *storageTransport) NewStoreReference(store storage.Store, named reference.Named, id string) (*storageReference, error) { return newReference(storageTransport{store: store, defaultUIDMap: s.defaultUIDMap, defaultGIDMap: s.defaultGIDMap}, named, id) } func (s *storageTransport) GetStore() (storage.Store, error) { // Return the transport's previously-set store. If we don't have one // of those, initialize one now. if s.store == nil { options, err := storage.DefaultStoreOptions() if err != nil { return nil, err } options.UIDMap = s.defaultUIDMap options.GIDMap = s.defaultGIDMap store, err := storage.GetStore(options) if err != nil { return nil, err } s.store = store } return s.store, nil } // ParseReference takes a name and a tag or digest and/or ID // ("_name_"/"@_id_"/"_name_:_tag_"/"_name_:_tag_@_id_"/"_name_@_digest_"/"_name_@_digest_@_id_"/"_name_:_tag_@_digest_"/"_name_:_tag_@_digest_@_id_"), // possibly prefixed with a store specifier in the form "[_graphroot_]" or // "[_driver_@_graphroot_]" or "[_driver_@_graphroot_+_runroot_]" or // "[_driver_@_graphroot_:_options_]" or "[_driver_@_graphroot_+_runroot_:_options_]", // tries to figure out which it is, and returns it in a reference object. // If _id_ is the ID of an image that's present in local storage, it can be truncated, and // even be specified as if it were a _name_, value. func (s *storageTransport) ParseReference(reference string) (types.ImageReference, error) { var store storage.Store // Check if there's a store location prefix. If there is, then it // needs to match a store that was previously initialized using // storage.GetStore(), or be enough to let the storage library fill out // the rest using knowledge that it has from elsewhere. if len(reference) > 0 && reference[0] == '[' { closeIndex := strings.IndexRune(reference, ']') if closeIndex < 1 { return nil, ErrInvalidReference } storeSpec := reference[1:closeIndex] reference = reference[closeIndex+1:] // Peel off a "driver@" from the start. driverInfo := "" driverPart1, driverPart2, gotDriver := strings.Cut(storeSpec, "@") if !gotDriver { storeSpec = driverPart1 if storeSpec == "" { return nil, ErrInvalidReference } } else { driverInfo = driverPart1 if driverInfo == "" { return nil, ErrInvalidReference } storeSpec = driverPart2 if storeSpec == "" { return nil, ErrInvalidReference } } // Peel off a ":options" from the end. var options []string storeSpec, optionsPart, gotOptions := strings.Cut(storeSpec, ":") if gotOptions { options = strings.Split(optionsPart, ",") } // Peel off a "+runroot" from the new end. storeSpec, runRootInfo, _ := strings.Cut(storeSpec, "+") // runRootInfo is "" if there is no "+" // The rest is our graph root. rootInfo := storeSpec // Check that any paths are absolute paths. if rootInfo != "" && !filepath.IsAbs(rootInfo) { return nil, ErrPathNotAbsolute } if runRootInfo != "" && !filepath.IsAbs(runRootInfo) { return nil, ErrPathNotAbsolute } store2, err := storage.GetStore(storage.StoreOptions{ GraphDriverName: driverInfo, GraphRoot: rootInfo, RunRoot: runRootInfo, GraphDriverOptions: options, UIDMap: s.defaultUIDMap, GIDMap: s.defaultGIDMap, }) if err != nil { return nil, err } store = store2 } else { // We didn't have a store spec, so use the default. store2, err := s.GetStore() if err != nil { return nil, err } store = store2 } return s.ParseStoreReference(store, reference) } // Deprecated: Surprisingly, with a StoreTransport reference which contains an ID, // this ignores that ID; and repeated calls of GetStoreImage with the same named reference // can return different images, with no way for the caller to "freeze" the storage.Image identity // without discarding the name entirely. // // Also, a StoreTransport reference already contains a store, so providing another one is redundant. // // Use storage.ResolveReference instead; note that if the image is not found, ResolveReference returns // c/image/v5/storage.ErrNoSuchImage, not c/storage.ErrImageUnknown. func (s storageTransport) GetStoreImage(store storage.Store, ref types.ImageReference) (*storage.Image, error) { dref := ref.DockerReference() if dref != nil { if img, err := store.Image(dref.String()); err == nil { return img, nil } } if sref, ok := ref.(*storageReference); ok { tmpRef := *sref if img, err := tmpRef.resolveImage(nil); err == nil { return img, nil } } return nil, storage.ErrImageUnknown } // Deprecated: Surprisingly, with a StoreTransport reference which contains an ID, // this ignores that ID; and repeated calls of GetStoreImage with the same named reference // can return different images, with no way for the caller to "freeze" the storage.Image identity // without discarding the name entirely. // // Use storage.ResolveReference instead; note that if the image is not found, ResolveReference returns // c/image/v5/storage.ErrNoSuchImage, not c/storage.ErrImageUnknown. func (s *storageTransport) GetImage(ref types.ImageReference) (*storage.Image, error) { store, err := s.GetStore() if err != nil { return nil, err } return s.GetStoreImage(store, ref) } func (s storageTransport) ValidatePolicyConfigurationScope(scope string) error { // Check that there's a store location prefix. Values we're passed are // expected to come from PolicyConfigurationIdentity or // PolicyConfigurationNamespaces, so if there's no store location, // something's wrong. if scope[0] != '[' { return ErrInvalidReference } // Parse the store location prefix. closeIndex := strings.IndexRune(scope, ']') if closeIndex < 1 { return ErrInvalidReference } storeSpec := scope[1:closeIndex] scope = scope[closeIndex+1:] if a, b, ok := strings.Cut(storeSpec, "@"); ok && a != "" && b != "" { // Two components: the driver type and the graph root. if !filepath.IsAbs(b) { return ErrPathNotAbsolute } } else if !ok && a != "" { // One component: the graph root. if !filepath.IsAbs(storeSpec) { return ErrPathNotAbsolute } } else { // Anything else: scope specified in a form we don't // recognize. return ErrInvalidReference } // That might be all of it, and that's okay. if scope == "" { return nil } fields := strings.SplitN(scope, "@", 3) switch len(fields) { case 1: // name only case 2: // name:tag@ID or name[:tag]@digest if idErr := validateImageID(fields[1]); idErr != nil { if _, digestErr := digest.Parse(fields[1]); digestErr != nil { return fmt.Errorf("%v is neither a valid digest(%s) nor a valid ID(%s)", fields[1], digestErr.Error(), idErr.Error()) } } case 3: // name[:tag]@digest@ID if _, err := digest.Parse(fields[1]); err != nil { return err } if err := validateImageID(fields[2]); err != nil { return err } default: // Coverage: This should never happen return errors.New("Internal error: unexpected number of fields form strings.SplitN") } // As for field[0], if it is non-empty at all: // FIXME? We could be verifying the various character set and length restrictions // from docker/distribution/reference.regexp.go, but other than that there // are few semantically invalid strings. return nil } // validateImageID returns nil if id is a valid (full) image ID, or an error func validateImageID(id string) error { _, err := digest.Parse("sha256:" + id) return err } ================================================ FILE: vendor/go.podman.io/image/v5/tarball/doc.go ================================================ // Package tarball provides a way to generate images using one or more layer // tarballs and an optional template configuration. // // An example: // // package main // // import ( // "context" // // cp "go.podman.io/image/v5/copy" // "go.podman.io/image/v5/signature" // "go.podman.io/image/v5/tarball" // "go.podman.io/image/v5/transports/alltransports" // "go.podman.io/image/v5/types" // imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" // ) // // func imageFromTarball() { // src, err := alltransports.ParseImageName("tarball:/var/cache/mock/fedora-26-x86_64/root_cache/cache.tar.gz") // // - or - // // src, err := tarball.Transport.ParseReference("/var/cache/mock/fedora-26-x86_64/root_cache/cache.tar.gz") // if err != nil { // panic(err) // } // updater, ok := src.(tarball.ConfigUpdater) // if !ok { // panic("unexpected: a tarball reference should implement tarball.ConfigUpdater") // } // config := imgspecv1.Image{ // Config: imgspecv1.ImageConfig{ // Cmd: []string{"/bin/bash"}, // }, // } // annotations := make(map[string]string) // annotations[imgspecv1.AnnotationDescription] = "test image built from a mock root cache" // err = updater.ConfigUpdate(config, annotations) // if err != nil { // panic(err) // } // dest, err := alltransports.ParseImageName("docker-daemon:mock:latest") // if err != nil { // panic(err) // } // // policy, err := signature.DefaultPolicy(nil) // if err != nil { // panic(err) // } // // pc, err := signature.NewPolicyContext(policy) // if err != nil { // panic(err) // } // defer pc.Destroy() // _, err = cp.Image(context.TODO(), pc, dest, src, nil) // if err != nil { // panic(err) // } // } package tarball ================================================ FILE: vendor/go.podman.io/image/v5/tarball/tarball_reference.go ================================================ package tarball import ( "context" "fmt" "maps" "os" "strings" imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" "go.podman.io/image/v5/docker/reference" "go.podman.io/image/v5/internal/image" "go.podman.io/image/v5/types" ) // ConfigUpdater is an interface that ImageReferences for "tarball" images also // implement. It can be used to set values for a configuration, and to set // image annotations which will be present in the images returned by the // reference's NewImage() or NewImageSource() methods. type ConfigUpdater interface { ConfigUpdate(config imgspecv1.Image, annotations map[string]string) error } type tarballReference struct { config imgspecv1.Image annotations map[string]string filenames []string stdin []byte } // ConfigUpdate updates the image's default configuration and adds annotations // which will be visible in source images created using this reference. func (r *tarballReference) ConfigUpdate(config imgspecv1.Image, annotations map[string]string) error { r.config = config if r.annotations == nil { r.annotations = make(map[string]string) } maps.Copy(r.annotations, annotations) return nil } func (r *tarballReference) Transport() types.ImageTransport { return Transport } func (r *tarballReference) StringWithinTransport() string { return strings.Join(r.filenames, ":") } func (r *tarballReference) DockerReference() reference.Named { return nil } func (r *tarballReference) PolicyConfigurationIdentity() string { return "" } func (r *tarballReference) PolicyConfigurationNamespaces() []string { return nil } // NewImage returns a types.ImageCloser for this reference, possibly specialized for this ImageTransport. // The caller must call .Close() on the returned ImageCloser. // NOTE: If any kind of signature verification should happen, build an UnparsedImage from the value returned by NewImageSource, // verify that UnparsedImage, and convert it into a real Image via image.FromUnparsedImage. // WARNING: This may not do the right thing for a manifest list, see image.FromSource for details. func (r *tarballReference) NewImage(ctx context.Context, sys *types.SystemContext) (types.ImageCloser, error) { return image.FromReference(ctx, sys, r) } func (r *tarballReference) DeleteImage(ctx context.Context, sys *types.SystemContext) error { for _, filename := range r.filenames { if err := os.Remove(filename); err != nil && !os.IsNotExist(err) { return fmt.Errorf("error removing %q: %w", filename, err) } } return nil } func (r *tarballReference) NewImageDestination(ctx context.Context, sys *types.SystemContext) (types.ImageDestination, error) { return nil, fmt.Errorf(`"tarball:" locations can only be read from, not written to`) } ================================================ FILE: vendor/go.podman.io/image/v5/tarball/tarball_src.go ================================================ package tarball import ( "bytes" "context" "encoding/json" "fmt" "io" "maps" "os" "runtime" "strings" "time" digest "github.com/opencontainers/go-digest" imgspecs "github.com/opencontainers/image-spec/specs-go" imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" "go.podman.io/image/v5/internal/imagesource/impl" "go.podman.io/image/v5/internal/imagesource/stubs" "go.podman.io/image/v5/pkg/compression" compressionTypes "go.podman.io/image/v5/pkg/compression/types" "go.podman.io/image/v5/types" ) type tarballImageSource struct { impl.Compat impl.PropertyMethodsInitialize impl.NoSignatures impl.DoesNotAffectLayerInfosForCopy stubs.NoGetBlobAtInitialize reference tarballReference blobs map[digest.Digest]tarballBlob manifest []byte } // tarballBlob is a blob that tarballImagSource can return by GetBlob. type tarballBlob struct { contents []byte // or nil to read from filename below filename string // valid if contents == nil size int64 } func (r *tarballReference) NewImageSource(ctx context.Context, sys *types.SystemContext) (types.ImageSource, error) { // Pick up the layer comment from the configuration's history list, if one is set. comment := "imported from tarball" if len(r.config.History) > 0 && r.config.History[0].Comment != "" { comment = r.config.History[0].Comment } // Gather up the digests, sizes, and history information for all of the files. blobs := map[digest.Digest]tarballBlob{} diffIDs := []digest.Digest{} created := time.Time{} history := []imgspecv1.History{} layerDescriptors := []imgspecv1.Descriptor{} for _, filename := range r.filenames { var reader io.Reader var blobTime time.Time var blob tarballBlob if filename == "-" { reader = bytes.NewReader(r.stdin) blobTime = time.Now() blob = tarballBlob{ contents: r.stdin, size: int64(len(r.stdin)), } } else { file, err := os.Open(filename) if err != nil { return nil, err } defer file.Close() reader = file fileinfo, err := file.Stat() if err != nil { return nil, fmt.Errorf("error reading size of %q: %w", filename, err) } blobTime = fileinfo.ModTime() blob = tarballBlob{ filename: filename, size: fileinfo.Size(), } } // Set up to digest the file as it is. blobIDdigester := digest.Canonical.Digester() reader = io.TeeReader(reader, blobIDdigester.Hash()) var layerType string var diffIDdigester digest.Digester // If necessary, digest the file after we decompress it. if err := func() error { // A scope for defer format, decompressor, reader, err := compression.DetectCompressionFormat(reader) if err != nil { return err } if decompressor != nil { uncompressed, err := decompressor(reader) if err != nil { return err } defer uncompressed.Close() // It is compressed, so the diffID is the digest of the uncompressed version diffIDdigester = digest.Canonical.Digester() reader = io.TeeReader(uncompressed, diffIDdigester.Hash()) switch format.Name() { case compressionTypes.GzipAlgorithmName: layerType = imgspecv1.MediaTypeImageLayerGzip case compressionTypes.ZstdAlgorithmName: layerType = imgspecv1.MediaTypeImageLayerZstd default: // This is incorrect, but we have no good options, and it is what this transport was historically doing. layerType = imgspecv1.MediaTypeImageLayerGzip } } else { // It is not compressed, so the diffID and the blobID are going to be the same diffIDdigester = blobIDdigester layerType = imgspecv1.MediaTypeImageLayer } // TODO: This can take quite some time, and should ideally be cancellable using ctx.Done(). if _, err := io.Copy(io.Discard, reader); err != nil { return fmt.Errorf("error reading %q: %w", filename, err) } return nil }(); err != nil { return nil, err } // Grab our uncompressed and possibly-compressed digests and sizes. diffID := diffIDdigester.Digest() blobID := blobIDdigester.Digest() diffIDs = append(diffIDs, diffID) blobs[blobID] = blob history = append(history, imgspecv1.History{ Created: &blobTime, CreatedBy: fmt.Sprintf("/bin/sh -c #(nop) ADD file:%s in %c", diffID.Encoded(), os.PathSeparator), Comment: comment, }) // Use the mtime of the most recently modified file as the image's creation time. if created.Before(blobTime) { created = blobTime } layerDescriptors = append(layerDescriptors, imgspecv1.Descriptor{ Digest: blobID, Size: blob.size, MediaType: layerType, }) } // Pick up other defaults from the config in the reference. config := r.config if config.Created == nil { config.Created = &created } if config.Architecture == "" { config.Architecture = runtime.GOARCH } if config.OS == "" { config.OS = runtime.GOOS } config.RootFS = imgspecv1.RootFS{ Type: "layers", DiffIDs: diffIDs, } config.History = history // Encode and digest the image configuration blob. configBytes, err := json.Marshal(&config) if err != nil { return nil, fmt.Errorf("error generating configuration blob for %q: %w", strings.Join(r.filenames, separator), err) } configID := digest.Canonical.FromBytes(configBytes) blobs[configID] = tarballBlob{ contents: configBytes, size: int64(len(configBytes)), } // Populate a manifest with the configuration blob and the layers. manifest := imgspecv1.Manifest{ Versioned: imgspecs.Versioned{SchemaVersion: 2}, MediaType: imgspecv1.MediaTypeImageManifest, Config: imgspecv1.Descriptor{ Digest: configID, Size: int64(len(configBytes)), MediaType: imgspecv1.MediaTypeImageConfig, }, Layers: layerDescriptors, Annotations: maps.Clone(r.annotations), } // Encode the manifest. manifestBytes, err := json.Marshal(&manifest) if err != nil { return nil, fmt.Errorf("error generating manifest for %q: %w", strings.Join(r.filenames, separator), err) } // Return the image. src := &tarballImageSource{ PropertyMethodsInitialize: impl.PropertyMethods(impl.Properties{ HasThreadSafeGetBlob: false, }), NoGetBlobAtInitialize: stubs.NoGetBlobAt(r), reference: *r, blobs: blobs, manifest: manifestBytes, } src.Compat = impl.AddCompat(src) return src, nil } func (is *tarballImageSource) Close() error { return nil } // GetBlob returns a stream for the specified blob, and the blob’s size (or -1 if unknown). // The Digest field in BlobInfo is guaranteed to be provided, Size may be -1 and MediaType may be optionally provided. // May update BlobInfoCache, preferably after it knows for certain that a blob truly exists at a specific location. func (is *tarballImageSource) GetBlob(ctx context.Context, blobinfo types.BlobInfo, cache types.BlobInfoCache) (io.ReadCloser, int64, error) { blob, ok := is.blobs[blobinfo.Digest] if !ok { return nil, -1, fmt.Errorf("no blob with digest %q found", blobinfo.Digest.String()) } if blob.contents != nil { return io.NopCloser(bytes.NewReader(blob.contents)), int64(len(blob.contents)), nil } reader, err := os.Open(blob.filename) if err != nil { return nil, -1, err } return reader, blob.size, nil } // GetManifest returns the image's manifest along with its MIME type (which may be empty when it can't be determined but the manifest is available). // It may use a remote (= slow) service. // If instanceDigest is not nil, it contains a digest of the specific manifest instance to retrieve (when the primary manifest is a manifest list); // this never happens if the primary manifest is not a manifest list (e.g. if the source never returns manifest lists). func (is *tarballImageSource) GetManifest(ctx context.Context, instanceDigest *digest.Digest) ([]byte, string, error) { if instanceDigest != nil { return nil, "", fmt.Errorf("manifest lists are not supported by the %q transport", transportName) } return is.manifest, imgspecv1.MediaTypeImageManifest, nil } func (is *tarballImageSource) Reference() types.ImageReference { return &is.reference } ================================================ FILE: vendor/go.podman.io/image/v5/tarball/tarball_transport.go ================================================ package tarball import ( "errors" "fmt" "io" "os" "strings" "go.podman.io/image/v5/transports" "go.podman.io/image/v5/types" ) const ( transportName = "tarball" separator = ":" ) // Transport implements the types.ImageTransport interface for "tarball:" images, // which are makeshift images constructed using one or more possibly-compressed tar // archives. var Transport = &tarballTransport{} type tarballTransport struct{} func (t *tarballTransport) Name() string { return transportName } func (t *tarballTransport) ParseReference(reference string) (types.ImageReference, error) { var stdin []byte var err error filenames := strings.Split(reference, separator) for _, filename := range filenames { if filename == "-" { stdin, err = io.ReadAll(os.Stdin) if err != nil { return nil, fmt.Errorf("error buffering stdin: %w", err) } continue } f, err := os.Open(filename) if err != nil { return nil, fmt.Errorf("error opening %q: %w", filename, err) } f.Close() } return NewReference(filenames, stdin) } // NewReference creates a new "tarball:" reference for the listed fileNames. // If any of the fileNames is "-", the contents of stdin are used instead. func NewReference(fileNames []string, stdin []byte) (types.ImageReference, error) { for _, path := range fileNames { if strings.Contains(path, separator) { return nil, fmt.Errorf("Invalid path %q: paths including the separator %q are not supported", path, separator) } } return &tarballReference{ filenames: fileNames, stdin: stdin, }, nil } func (t *tarballTransport) ValidatePolicyConfigurationScope(scope string) error { // See the explanation in daemonReference.PolicyConfigurationIdentity. return errors.New(`tarball: does not support any scopes except the default "" one`) } func init() { transports.Register(Transport) } ================================================ FILE: vendor/go.podman.io/image/v5/transports/alltransports/alltransports.go ================================================ package alltransports import ( "fmt" "strings" "go.podman.io/image/v5/transports" "go.podman.io/image/v5/types" // Register all known transports. // NOTE: Make sure docs/containers-transports.5.md and docs/containers-policy.json.5.md are updated when adding or updating // a transport. _ "go.podman.io/image/v5/directory" _ "go.podman.io/image/v5/docker" _ "go.podman.io/image/v5/docker/archive" _ "go.podman.io/image/v5/oci/archive" _ "go.podman.io/image/v5/oci/layout" _ "go.podman.io/image/v5/openshift" _ "go.podman.io/image/v5/sif" _ "go.podman.io/image/v5/tarball" // The docker-daemon transport is registeredy by docker_daemon*.go // The storage transport is registered by storage*.go ) func init() { transports.Register(transports.NewStubTransport("ostree")) // This transport was completely removed. } // ParseImageName converts a URL-like image name to a types.ImageReference. func ParseImageName(imgName string) (types.ImageReference, error) { // Keep this in sync with TransportFromImageName! transportName, withinTransport, valid := strings.Cut(imgName, ":") if !valid { return nil, fmt.Errorf(`Invalid image name %q, expected colon-separated transport:reference`, imgName) } transport := transports.Get(transportName) if transport == nil { return nil, fmt.Errorf(`Invalid image name %q, unknown transport %q`, imgName, transportName) } return transport.ParseReference(withinTransport) } // TransportFromImageName converts an URL-like name to a types.ImageTransport or nil when // the transport is unknown or when the input is invalid. func TransportFromImageName(imageName string) types.ImageTransport { // Keep this in sync with ParseImageName! transportName, _, valid := strings.Cut(imageName, ":") if valid { return transports.Get(transportName) } return nil } ================================================ FILE: vendor/go.podman.io/image/v5/transports/alltransports/docker_daemon.go ================================================ //go:build !containers_image_docker_daemon_stub package alltransports import ( // Register the docker-daemon transport _ "go.podman.io/image/v5/docker/daemon" ) ================================================ FILE: vendor/go.podman.io/image/v5/transports/alltransports/docker_daemon_stub.go ================================================ //go:build containers_image_docker_daemon_stub package alltransports import "go.podman.io/image/v5/transports" func init() { transports.Register(transports.NewStubTransport("docker-daemon")) } ================================================ FILE: vendor/go.podman.io/image/v5/transports/alltransports/storage.go ================================================ //go:build !containers_image_storage_stub package alltransports import ( // Register the storage transport _ "go.podman.io/image/v5/storage" ) ================================================ FILE: vendor/go.podman.io/image/v5/transports/alltransports/storage_stub.go ================================================ //go:build containers_image_storage_stub package alltransports import "go.podman.io/image/v5/transports" func init() { transports.Register(transports.NewStubTransport("containers-storage")) } ================================================ FILE: vendor/go.podman.io/image/v5/transports/stub.go ================================================ package transports import ( "fmt" "go.podman.io/image/v5/types" ) // stubTransport is an implementation of types.ImageTransport which has a name, but rejects any references with “the transport $name: is not supported in this build”. type stubTransport string // NewStubTransport returns an implementation of types.ImageTransport which has a name, but rejects any references with “the transport $name: is not supported in this build”. func NewStubTransport(name string) types.ImageTransport { return stubTransport(name) } // Name returns the name of the transport, which must be unique among other transports. func (s stubTransport) Name() string { return string(s) } // ParseReference converts a string, which should not start with the ImageTransport.Name prefix, into an ImageReference. func (s stubTransport) ParseReference(reference string) (types.ImageReference, error) { return nil, fmt.Errorf(`The transport "%s:" is not supported in this build`, string(s)) } // ValidatePolicyConfigurationScope checks that scope is a valid name for a signature.PolicyTransportScopes keys // (i.e. a valid PolicyConfigurationIdentity() or PolicyConfigurationNamespaces() return value). // It is acceptable to allow an invalid value which will never be matched, it can "only" cause user confusion. // scope passed to this function will not be "", that value is always allowed. func (s stubTransport) ValidatePolicyConfigurationScope(scope string) error { // Allowing any reference in here allows tools with some transports stubbed-out to still // use signature verification policies which refer to these stubbed-out transports. // See also the treatment of unknown transports in policyTransportScopesWithTransport.UnmarshalJSON . return nil } ================================================ FILE: vendor/go.podman.io/image/v5/transports/transports.go ================================================ package transports import ( "fmt" "sort" "sync" "go.podman.io/image/v5/internal/set" "go.podman.io/image/v5/types" ) // knownTransports is a registry of known ImageTransport instances. type knownTransports struct { transports map[string]types.ImageTransport mu sync.Mutex } func (kt *knownTransports) Get(k string) types.ImageTransport { kt.mu.Lock() t := kt.transports[k] kt.mu.Unlock() return t } func (kt *knownTransports) Remove(k string) { kt.mu.Lock() delete(kt.transports, k) kt.mu.Unlock() } func (kt *knownTransports) Add(t types.ImageTransport) { kt.mu.Lock() defer kt.mu.Unlock() name := t.Name() if t := kt.transports[name]; t != nil { panic(fmt.Sprintf("Duplicate image transport name %s", name)) } kt.transports[name] = t } var kt *knownTransports func init() { kt = &knownTransports{ transports: make(map[string]types.ImageTransport), } } // Get returns the transport specified by name or nil when unavailable. func Get(name string) types.ImageTransport { return kt.Get(name) } // Delete deletes a transport from the registered transports. func Delete(name string) { kt.Remove(name) } // Register registers a transport. func Register(t types.ImageTransport) { kt.Add(t) } // ImageName converts a types.ImageReference into an URL-like image name, which MUST be such that // ParseImageName(ImageName(reference)) returns an equivalent reference. // // This is the generally recommended way to refer to images in the UI. // // NOTE: The returned string is not promised to be equal to the original input to ParseImageName; // e.g. default attribute values omitted by the user may be filled in the return value, or vice versa. func ImageName(ref types.ImageReference) string { return ref.Transport().Name() + ":" + ref.StringWithinTransport() } var deprecatedTransports = set.NewWithValues("atomic", "ostree") // ListNames returns a list of non deprecated transport names. // Deprecated transports can be used, but are not presented to users. func ListNames() []string { kt.mu.Lock() defer kt.mu.Unlock() var names []string for _, transport := range kt.transports { if !deprecatedTransports.Contains(transport.Name()) { names = append(names, transport.Name()) } } sort.Strings(names) return names } ================================================ FILE: vendor/go.podman.io/image/v5/types/types.go ================================================ package types import ( "context" "crypto/tls" "io" "net/url" "time" digest "github.com/opencontainers/go-digest" v1 "github.com/opencontainers/image-spec/specs-go/v1" "go.podman.io/image/v5/docker/reference" compression "go.podman.io/image/v5/pkg/compression/types" ) // ImageTransport is a top-level namespace for ways to store/load an image. // It should generally correspond to ImageSource/ImageDestination implementations. // // Note that ImageTransport is based on "ways the users refer to image storage", not necessarily on the underlying physical transport. // For example, all Docker References would be used within a single "docker" transport, regardless of whether the images are pulled over HTTP or HTTPS // (or, even, IPv4 or IPv6). // // OTOH all images using the same transport should (apart from versions of the image format), be interoperable. // For example, several different ImageTransport implementations may be based on local filesystem paths, // but using completely different formats for the contents of that path (a single tar file, a directory containing tarballs, a fully expanded container filesystem, ...) // // See also transports.KnownTransports. type ImageTransport interface { // Name returns the name of the transport, which must be unique among other transports. Name() string // ParseReference converts a string, which should not start with the ImageTransport.Name prefix, into an ImageReference. ParseReference(reference string) (ImageReference, error) // ValidatePolicyConfigurationScope checks that scope is a valid name for a signature.PolicyTransportScopes keys // (i.e. a valid PolicyConfigurationIdentity() or PolicyConfigurationNamespaces() return value). // It is acceptable to allow an invalid value which will never be matched, it can "only" cause user confusion. // scope passed to this function will not be "", that value is always allowed. ValidatePolicyConfigurationScope(scope string) error } // ImageReference is an abstracted way to refer to an image location, namespaced within an ImageTransport. // // The object should preferably be immutable after creation, with any parsing/state-dependent resolving happening // within an ImageTransport.ParseReference() or equivalent API creating the reference object. // That's also why the various identification/formatting methods of this type do not support returning errors. // // WARNING: While this design freezes the content of the reference within this process, it can not freeze the outside // world: paths may be replaced by symlinks elsewhere, HTTP APIs may start returning different results, and so on. type ImageReference interface { Transport() ImageTransport // StringWithinTransport returns a string representation of the reference, which MUST be such that // reference.Transport().ParseReference(reference.StringWithinTransport()) returns an equivalent reference. // NOTE: The returned string is not promised to be equal to the original input to ParseReference; // e.g. default attribute values omitted by the user may be filled in the return value, or vice versa. // WARNING: Do not use the return value in the UI to describe an image, it does not contain the Transport().Name() prefix; // instead, see transports.ImageName(). StringWithinTransport() string // DockerReference returns a Docker reference associated with this reference // (fully explicit, i.e. !reference.IsNameOnly, but reflecting user intent, // not e.g. after redirect or alias processing), or nil if unknown/not applicable. DockerReference() reference.Named // PolicyConfigurationIdentity returns a string representation of the reference, suitable for policy lookup. // This MUST reflect user intent, not e.g. after processing of third-party redirects or aliases; // The value SHOULD be fully explicit about its semantics, with no hidden defaults, AND canonical // (i.e. various references with exactly the same semantics should return the same configuration identity) // It is fine for the return value to be equal to StringWithinTransport(), and it is desirable but // not required/guaranteed that it will be a valid input to Transport().ParseReference(). // Returns "" if configuration identities for these references are not supported. PolicyConfigurationIdentity() string // PolicyConfigurationNamespaces returns a list of other policy configuration namespaces to search // for if explicit configuration for PolicyConfigurationIdentity() is not set. The list will be processed // in order, terminating on first match, and an implicit "" is always checked at the end. // It is STRONGLY recommended for the first element, if any, to be a prefix of PolicyConfigurationIdentity(), // and each following element to be a prefix of the element preceding it. PolicyConfigurationNamespaces() []string // NewImage returns a types.ImageCloser for this reference, possibly specialized for this ImageTransport. // The caller must call .Close() on the returned ImageCloser. // NOTE: If any kind of signature verification should happen, build an UnparsedImage from the value returned by NewImageSource, // verify that UnparsedImage, and convert it into a real Image via image.FromUnparsedImage. // WARNING: This may not do the right thing for a manifest list, see image.FromSource for details. NewImage(ctx context.Context, sys *SystemContext) (ImageCloser, error) // NewImageSource returns a types.ImageSource for this reference. // The caller must call .Close() on the returned ImageSource. NewImageSource(ctx context.Context, sys *SystemContext) (ImageSource, error) // NewImageDestination returns a types.ImageDestination for this reference. // The caller must call .Close() on the returned ImageDestination. NewImageDestination(ctx context.Context, sys *SystemContext) (ImageDestination, error) // DeleteImage deletes the named image from the registry, if supported. DeleteImage(ctx context.Context, sys *SystemContext) error } // LayerCompression indicates if layers must be compressed, decompressed or preserved type LayerCompression int const ( // PreserveOriginal indicates the layer must be preserved, ie // no compression or decompression. PreserveOriginal LayerCompression = iota // Decompress indicates the layer must be decompressed Decompress // Compress indicates the layer must be compressed Compress ) // LayerCrypto indicates if layers have been encrypted or decrypted or none type LayerCrypto int const ( // PreserveOriginalCrypto indicates the layer must be preserved, ie // no encryption/decryption PreserveOriginalCrypto LayerCrypto = iota // Encrypt indicates the layer is encrypted Encrypt // Decrypt indicates the layer is decrypted Decrypt ) // BlobInfo collects known information about a blob (layer/config). // In some situations, some fields may be unknown, in others they may be mandatory; documenting an “unknown” value here does not override that. type BlobInfo struct { Digest digest.Digest // "" if unknown. Size int64 // -1 if unknown URLs []string Annotations map[string]string MediaType string // NOTE: The following fields contain desired _edits_ to blob infos. // Conceptually then don't belong in the BlobInfo object at all; // the edits should be provided specifically as parameters to the edit implementation. // We can’t remove the fields without breaking compatibility, but don’t // add any more. // CompressionOperation is used in Image.UpdateLayerInfos to instruct // whether the original layer's "compressed or not" should be preserved, // possibly while changing the compression algorithm from one to another, // or if it should be changed to compressed or decompressed. // The field defaults to preserve the original layer's compressedness. // TODO: To remove together with CryptoOperation in re-design to remove // field out of BlobInfo. CompressionOperation LayerCompression // CompressionAlgorithm is used in Image.UpdateLayerInfos to set the correct // MIME type for compressed layers (e.g., gzip or zstd). This field MUST be // set when `CompressionOperation == Compress` and MAY be set when // `CompressionOperation == PreserveOriginal` and the compression type is // being changed for an already-compressed layer. CompressionAlgorithm *compression.Algorithm // CryptoOperation is used in Image.UpdateLayerInfos to instruct // whether the original layer was encrypted/decrypted // TODO: To remove together with CompressionOperation in re-design to // remove field out of BlobInfo. CryptoOperation LayerCrypto // Before adding any fields to this struct, read the NOTE above. } // BICTransportScope encapsulates transport-dependent representation of a “scope” where blobs are or are not present. // BlobInfocache.RecordKnownLocations / BlobInfocache.CandidateLocations record data about blobs keyed by (scope, digest). // The scope will typically be similar to an ImageReference, or a superset of it within which blobs are reusable. // // NOTE: The contents of this structure may be recorded in a persistent file, possibly shared across different // tools which use different versions of the transport. Allow for reasonable backward/forward compatibility, // at least by not failing hard when encountering unknown data. type BICTransportScope struct { Opaque string } // BICLocationReference encapsulates transport-dependent representation of a blob location within a BICTransportScope. // Each transport can store arbitrary data using BlobInfoCache.RecordKnownLocation, and ImageDestination.TryReusingBlob // can look it up using BlobInfoCache.CandidateLocations. // // NOTE: The contents of this structure may be recorded in a persistent file, possibly shared across different // tools which use different versions of the transport. Allow for reasonable backward/forward compatibility, // at least by not failing hard when encountering unknown data. type BICLocationReference struct { Opaque string } // BICReplacementCandidate is an item returned by BlobInfoCache.CandidateLocations. type BICReplacementCandidate struct { Digest digest.Digest Location BICLocationReference } // BlobInfoCache records data useful for reusing blobs, or substituting equivalent ones, to avoid unnecessary blob copies. // // It records two kinds of data: // // - Sets of corresponding digest vs. uncompressed digest ("DiffID") pairs: // One of the two digests is known to be uncompressed, and a single uncompressed digest may correspond to more than one compressed digest. // This allows matching compressed layer blobs to existing local uncompressed layers (to avoid unnecessary download and decompression), // or uncompressed layer blobs to existing remote compressed layers (to avoid unnecessary compression and upload)/ // // It is allowed to record an (uncompressed digest, the same uncompressed digest) correspondence, to express that the digest is known // to be uncompressed (i.e. that a conversion from schema1 does not have to decompress the blob to compute a DiffID value). // // This mapping is primarily maintained in generic copy.Image code, but transports may want to contribute more data points if they independently // compress/decompress blobs for their own purposes. // // - Known blob locations, managed by individual transports: // The transports call RecordKnownLocation when encountering a blob that could possibly be reused (typically in GetBlob/PutBlob/TryReusingBlob), // recording transport-specific information that allows the transport to reuse the blob in the future; // then, TryReusingBlob implementations can call CandidateLocations to look up previously recorded blob locations that could be reused. // // Each transport defines its own “scopes” within which blob reuse is possible (e.g. in, the docker/distribution case, blobs // can be directly reused within a registry, or mounted across registries within a registry server.) // // None of the methods return an error indication: errors when neither reading from, nor writing to, the cache, should be fatal; // users of the cache should just fall back to copying the blobs the usual way. // // The BlobInfoCache interface is deprecated. Consumers of this library should use one of the implementations provided by // subpackages of the library's "pkg/blobinfocache" package in preference to implementing the interface on their own. type BlobInfoCache interface { // UncompressedDigest returns an uncompressed digest corresponding to anyDigest. // May return anyDigest if it is known to be uncompressed. // Returns "" if nothing is known about the digest (it may be compressed or uncompressed). UncompressedDigest(anyDigest digest.Digest) digest.Digest // RecordDigestUncompressedPair records that the uncompressed version of anyDigest is uncompressed. // It’s allowed for anyDigest == uncompressed. // WARNING: Only call this for LOCALLY VERIFIED data; don’t record a digest pair just because some remote author claims so (e.g. // because a manifest/config pair exists); otherwise the cache could be poisoned and allow substituting unexpected blobs. // (Eventually, the DiffIDs in image config could detect the substitution, but that may be too late, and not all image formats contain that data.) RecordDigestUncompressedPair(anyDigest digest.Digest, uncompressed digest.Digest) // RecordKnownLocation records that a blob with the specified digest exists within the specified (transport, scope) scope, // and can be reused given the opaque location data. RecordKnownLocation(transport ImageTransport, scope BICTransportScope, digest digest.Digest, location BICLocationReference) // CandidateLocations returns a prioritized, limited, number of blobs and their locations that could possibly be reused // within the specified (transport scope) (if they still exist, which is not guaranteed). // // If !canSubstitute, the returned candidates will match the submitted digest exactly; if canSubstitute, // data from previous RecordDigestUncompressedPair calls is used to also look up variants of the blob which have the same // uncompressed digest. CandidateLocations(transport ImageTransport, scope BICTransportScope, digest digest.Digest, canSubstitute bool) []BICReplacementCandidate } // ImageSource is a service, possibly remote (= slow), to download components of a single image or a named image set (manifest list). // This is primarily useful for copying images around; for examining their properties, Image (below) // is usually more useful. // Each ImageSource should eventually be closed by calling Close(). // // WARNING: Various methods which return an object identified by digest generally do not // validate that the returned data actually matches that digest; this is the caller’s responsibility. // See the individual methods’ documentation for potentially more details. type ImageSource interface { // Reference returns the reference used to set up this source, _as specified by the user_ // (not as the image itself, or its underlying storage, claims). This can be used e.g. to determine which public keys are trusted for this image. Reference() ImageReference // Close removes resources associated with an initialized ImageSource, if any. Close() error // GetManifest returns the image's manifest along with its MIME type (which may be empty when it can't be determined but the manifest is available). // It may use a remote (= slow) service. // If instanceDigest is not nil, it contains a digest of the specific manifest instance to retrieve (when the primary manifest is a manifest list); // this never happens if the primary manifest is not a manifest list (e.g. if the source never returns manifest lists). // // WARNING: This is a raw access to the data as provided by the source; if the reference contains a digest, or instanceDigest is set, // callers must enforce the digest match themselves, typically by using image.UnparsedInstance to access the manifest instead // of calling this directly. (Compare the generic warning applicable to all of the [ImageSource] interface.) GetManifest(ctx context.Context, instanceDigest *digest.Digest) ([]byte, string, error) // GetBlob returns a stream for the specified blob, and the blob’s size (or -1 if unknown). // The Digest field in BlobInfo is guaranteed to be provided, Size may be -1 and MediaType may be optionally provided. // May update BlobInfoCache, preferably after it knows for certain that a blob truly exists at a specific location. // // WARNING: This is a raw access to the data as provided by the source; callers must validate the contents // against the blob’s digest themselves. (Compare the generic warning applicable to all of the [ImageSource] interface.) GetBlob(context.Context, BlobInfo, BlobInfoCache) (io.ReadCloser, int64, error) // HasThreadSafeGetBlob indicates whether GetBlob can be executed concurrently. HasThreadSafeGetBlob() bool // GetSignatures returns the image's signatures. It may use a remote (= slow) service. // If instanceDigest is not nil, it contains a digest of the specific manifest instance to retrieve signatures for // (when the primary manifest is a manifest list); this never happens if the primary manifest is not a manifest list // (e.g. if the source never returns manifest lists). GetSignatures(ctx context.Context, instanceDigest *digest.Digest) ([][]byte, error) // LayerInfosForCopy returns either nil (meaning the values in the manifest are fine), or updated values for the layer // blobsums that are listed in the image's manifest. If values are returned, they should be used when using GetBlob() // to read the image's layers. // If instanceDigest is not nil, it contains a digest of the specific manifest instance to retrieve BlobInfos for // (when the primary manifest is a manifest list); this never happens if the primary manifest is not a manifest list // (e.g. if the source never returns manifest lists). // The Digest field is guaranteed to be provided; Size may be -1. // WARNING: The list may contain duplicates, and they are semantically relevant. LayerInfosForCopy(ctx context.Context, instanceDigest *digest.Digest) ([]BlobInfo, error) } // ImageDestination is a service, possibly remote (= slow), to store components of a single image. // // There is a specific required order for some of the calls: // TryReusingBlob/PutBlob on the various blobs, if any, MUST be called before PutManifest (manifest references blobs, which may be created or compressed only at push time) // PutSignatures, if called, MUST be called after PutManifest (signatures reference manifest contents) // Finally, Commit MUST be called if the caller wants the image, as formed by the components saved above, to persist. // // Each ImageDestination should eventually be closed by calling Close(). type ImageDestination interface { // Reference returns the reference used to set up this destination. Note that this should directly correspond to user's intent, // e.g. it should use the public hostname instead of the result of resolving CNAMEs or following redirects. Reference() ImageReference // Close removes resources associated with an initialized ImageDestination, if any. Close() error // SupportedManifestMIMETypes tells which manifest mime types the destination supports // If an empty slice or nil it's returned, then any mime type can be tried to upload SupportedManifestMIMETypes() []string // SupportsSignatures returns an error (to be displayed to the user) if the destination certainly can't store signatures. // Note: It is still possible for PutSignatures to fail if SupportsSignatures returns nil. SupportsSignatures(ctx context.Context) error // DesiredLayerCompression indicates the kind of compression to apply on layers DesiredLayerCompression() LayerCompression // AcceptsForeignLayerURLs returns false iff foreign layers in manifest should be actually // uploaded to the image destination, true otherwise. AcceptsForeignLayerURLs() bool // MustMatchRuntimeOS returns true iff the destination can store only images targeted for the current runtime architecture and OS. False otherwise. MustMatchRuntimeOS() bool // IgnoresEmbeddedDockerReference() returns true iff the destination does not care about Image.EmbeddedDockerReferenceConflicts(), // and would prefer to receive an unmodified manifest instead of one modified for the destination. // Does not make a difference if Reference().DockerReference() is nil. IgnoresEmbeddedDockerReference() bool // PutBlob writes contents of stream and returns data representing the result. // inputInfo.Digest can be optionally provided if known; if provided, and stream is read to the end without error, the digest MUST match the stream contents. // inputInfo.Size is the expected length of stream, if known. // inputInfo.MediaType describes the blob format, if known. // May update cache. // WARNING: The contents of stream are being verified on the fly. Until stream.Read() returns io.EOF, the contents of the data SHOULD NOT be available // to any other readers for download using the supplied digest. // If stream.Read() at any time, ESPECIALLY at end of input, returns an error, PutBlob MUST 1) fail, and 2) delete any data stored so far. PutBlob(ctx context.Context, stream io.Reader, inputInfo BlobInfo, cache BlobInfoCache, isConfig bool) (BlobInfo, error) // HasThreadSafePutBlob indicates whether PutBlob can be executed concurrently. HasThreadSafePutBlob() bool // TryReusingBlob checks whether the transport already contains, or can efficiently reuse, a blob, and if so, applies it to the current destination // (e.g. if the blob is a filesystem layer, this signifies that the changes it describes need to be applied again when composing a filesystem tree). // info.Digest must not be empty. // If canSubstitute, TryReusingBlob can use an equivalent equivalent of the desired blob; in that case the returned info may not match the input. // If the blob has been successfully reused, returns (true, info, nil); info must contain at least a digest and size, and may // include CompressionOperation and CompressionAlgorithm fields to indicate that a change to the compression type should be // reflected in the manifest that will be written. // If the transport can not reuse the requested blob, TryReusingBlob returns (false, {}, nil); it returns a non-nil error only on an unexpected failure. // May use and/or update cache. TryReusingBlob(ctx context.Context, info BlobInfo, cache BlobInfoCache, canSubstitute bool) (bool, BlobInfo, error) // PutManifest writes manifest to the destination. // If instanceDigest is not nil, it contains a digest of the specific manifest instance to write the manifest for // (when the primary manifest is a manifest list); this should always be nil if the primary manifest is not a manifest list. // It is expected but not enforced that the instanceDigest, when specified, matches the digest of `manifest` as generated // by `manifest.Digest()`. // FIXME? This should also receive a MIME type if known, to differentiate between schema versions. // If the destination is in principle available, refuses this manifest type (e.g. it does not recognize the schema), // but may accept a different manifest type, the returned error must be an ManifestTypeRejectedError. PutManifest(ctx context.Context, manifest []byte, instanceDigest *digest.Digest) error // PutSignatures writes a set of signatures to the destination. // If instanceDigest is not nil, it contains a digest of the specific manifest instance to write or overwrite the signatures for // (when the primary manifest is a manifest list); this should always be nil if the primary manifest is not a manifest list. // MUST be called after PutManifest (signatures may reference manifest contents). PutSignatures(ctx context.Context, signatures [][]byte, instanceDigest *digest.Digest) error // Commit marks the process of storing the image as successful and asks for the image to be persisted. // unparsedToplevel contains data about the top-level manifest of the source (which may be a single-arch image or a manifest list // if PutManifest was only called for the single-arch image with instanceDigest == nil), primarily to allow lookups by the // original manifest list digest, if desired. // WARNING: This does not have any transactional semantics: // - Uploaded data MAY be visible to others before Commit() is called // - Uploaded data MAY be removed or MAY remain around if Close() is called without Commit() (i.e. rollback is allowed but not guaranteed) Commit(ctx context.Context, unparsedToplevel UnparsedImage) error } // ManifestTypeRejectedError is returned by ImageDestination.PutManifest if the destination is in principle available, // refuses specifically this manifest type, but may accept a different manifest type. type ManifestTypeRejectedError struct { // We only use a struct to allow a type assertion, without limiting the contents of the error otherwise. Err error } func (e ManifestTypeRejectedError) Error() string { return e.Err.Error() } // UnparsedImage is an Image-to-be; until it is verified and accepted, it only caries its identity and caches manifest and signature blobs. // Thus, an UnparsedImage can be created from an ImageSource simply by fetching blobs without interpreting them, // allowing cryptographic signature verification to happen first, before even fetching the manifest, or parsing anything else. // This also makes the UnparsedImage→Image conversion an explicitly visible step. // // An UnparsedImage is a pair of (ImageSource, instance digest); it can represent either a manifest list or a single image instance. // // The UnparsedImage must not be used after the underlying ImageSource is Close()d. type UnparsedImage interface { // Reference returns the reference used to set up this source, _as specified by the user_ // (not as the image itself, or its underlying storage, claims). This can be used e.g. to determine which public keys are trusted for this image. Reference() ImageReference // Manifest is like ImageSource.GetManifest, but the result is cached; it is OK to call this however often you need. Manifest(ctx context.Context) ([]byte, string, error) // Signatures is like ImageSource.GetSignatures, but the result is cached; it is OK to call this however often you need. Signatures(ctx context.Context) ([][]byte, error) } // Image is the primary API for inspecting properties of images. // An Image is based on a pair of (ImageSource, instance digest); it can represent either a manifest list or a single image instance. // // The Image must not be used after the underlying ImageSource is Close()d. type Image interface { // Note that Reference may return nil in the return value of UpdatedImage! UnparsedImage // ConfigInfo returns a complete BlobInfo for the separate config object, or a BlobInfo{Digest:""} if there isn't a separate object. // Note that the config object may not exist in the underlying storage in the return value of UpdatedImage! Use ConfigBlob() below. ConfigInfo() BlobInfo // ConfigBlob returns the blob described by ConfigInfo, if ConfigInfo().Digest != ""; nil otherwise. // The result is cached; it is OK to call this however often you need. ConfigBlob(context.Context) ([]byte, error) // OCIConfig returns the image configuration as per OCI v1 image-spec. Information about // layers in the resulting configuration isn't guaranteed to be returned to due how // old image manifests work (docker v2s1 especially). OCIConfig(context.Context) (*v1.Image, error) // LayerInfos returns a list of BlobInfos of layers referenced by this image, in order (the root layer first, and then successive layered layers). // The Digest field is guaranteed to be provided, Size may be -1 and MediaType may be optionally provided. // WARNING: The list may contain duplicates, and they are semantically relevant. LayerInfos() []BlobInfo // LayerInfosForCopy returns either nil (meaning the values in the manifest are fine), or updated values for the layer blobsums that are listed in the image's manifest. // The Digest field is guaranteed to be provided, Size may be -1 and MediaType may be optionally provided. // WARNING: The list may contain duplicates, and they are semantically relevant. LayerInfosForCopy(context.Context) ([]BlobInfo, error) // EmbeddedDockerReferenceConflicts whether a Docker reference embedded in the manifest, if any, conflicts with destination ref. // It returns false if the manifest does not embed a Docker reference. // (This embedding unfortunately happens for Docker schema1, please do not add support for this in any new formats.) EmbeddedDockerReferenceConflicts(ref reference.Named) bool // Inspect returns various information for (skopeo inspect) parsed from the manifest and configuration. Inspect(context.Context) (*ImageInspectInfo, error) // UpdatedImageNeedsLayerDiffIDs returns true iff UpdatedImage(options) needs InformationOnly.LayerDiffIDs. // This is a horribly specific interface, but computing InformationOnly.LayerDiffIDs can be very expensive to compute // (most importantly it forces us to download the full layers even if they are already present at the destination). UpdatedImageNeedsLayerDiffIDs(options ManifestUpdateOptions) bool // UpdatedImage returns a types.Image modified according to options. // Everything in options.InformationOnly should be provided, other fields should be set only if a modification is desired. // This does not change the state of the original Image object. // The returned error will be a manifest.ManifestLayerCompressionIncompatibilityError if // manifests of type options.ManifestMIMEType can not include layers that are compressed // in accordance with the CompressionOperation and CompressionAlgorithm specified in one // or more options.LayerInfos items, though retrying with a different // options.ManifestMIMEType or with different CompressionOperation+CompressionAlgorithm // values might succeed. UpdatedImage(ctx context.Context, options ManifestUpdateOptions) (Image, error) // SupportsEncryption returns an indicator that the image supports encryption // // Deprecated: Initially used to determine if a manifest can be copied from a source manifest type since // the process of updating a manifest between different manifest types was to update then convert. // This resulted in some fields in the update being lost. This has been fixed by: https://github.com/containers/image/pull/836 SupportsEncryption(ctx context.Context) bool // Size returns an approximation of the amount of disk space which is consumed by the image in its current // location. If the size is not known, -1 will be returned. Size() (int64, error) } // ImageCloser is an Image with a Close() method which must be called by the user. // This is returned by ImageReference.NewImage, which transparently instantiates a types.ImageSource, // to ensure that the ImageSource is closed. type ImageCloser interface { Image // Close removes resources associated with an initialized ImageCloser. Close() error } // ManifestUpdateOptions is a way to pass named optional arguments to Image.UpdatedImage type ManifestUpdateOptions struct { LayerInfos []BlobInfo // Complete BlobInfos (size+digest+urls+annotations) which should replace the originals, in order (the root layer first, and then successive layered layers). BlobInfos' MediaType fields are ignored. EmbeddedDockerReference reference.Named ManifestMIMEType string // The values below are NOT requests to modify the image; they provide optional context which may or may not be used. InformationOnly ManifestUpdateInformation } // ManifestUpdateInformation is a component of ManifestUpdateOptions, named here // only to make writing struct literals possible. type ManifestUpdateInformation struct { Destination ImageDestination // and yes, UpdatedImage may write to Destination (see the schema2 → schema1 conversion logic in image/docker_schema2.go) LayerInfos []BlobInfo // Complete BlobInfos (size+digest) which have been uploaded, in order (the root layer first, and then successive layered layers) LayerDiffIDs []digest.Digest // Digest values for the _uncompressed_ contents of the blobs which have been uploaded, in the same order. } // ImageInspectInfo is a set of metadata describing Docker images, primarily their manifest and configuration. // The Tag field is a legacy field which is here just for the Docker v2s1 manifest. It won't be supported // for other manifest types. type ImageInspectInfo struct { Tag string Created *time.Time DockerVersion string Labels map[string]string Architecture string Variant string Os string Layers []string LayersData []ImageInspectLayer Env []string Author string } // ImageInspectLayer is a set of metadata describing an image layers' detail type ImageInspectLayer struct { MIMEType string // "" if unknown. Digest digest.Digest Size int64 // -1 if unknown. Annotations map[string]string } // DockerAuthConfig contains authorization information for connecting to a registry. // the value of Username and Password can be empty for accessing the registry anonymously type DockerAuthConfig struct { Username string Password string // IdentityToken can be used as an refresh_token in place of username and // password to obtain the bearer/access token in oauth2 flow. If identity // token is set, password should not be set. // Ref: https://docs.docker.com/registry/spec/auth/oauth/ IdentityToken string } // OptionalBool is a boolean with an additional undefined value, which is meant // to be used in the context of user input to distinguish between a // user-specified value and a default value. type OptionalBool byte const ( // OptionalBoolUndefined indicates that the OptionalBoolean hasn't been written. OptionalBoolUndefined OptionalBool = iota // OptionalBoolTrue represents the boolean true. OptionalBoolTrue // OptionalBoolFalse represents the boolean false. OptionalBoolFalse ) // NewOptionalBool converts the input bool into either OptionalBoolTrue or // OptionalBoolFalse. The function is meant to avoid boilerplate code of users. func NewOptionalBool(b bool) OptionalBool { o := OptionalBoolFalse if b { o = OptionalBoolTrue } return o } // ShortNameMode defines the mode of short-name resolution. // // The use of unqualified-search registries entails an ambiguity as it's // unclear from which registry a given image, referenced by a short name, may // be pulled from. // // The ShortNameMode type defines how short names should resolve. type ShortNameMode int const ( ShortNameModeInvalid ShortNameMode = iota // Use all configured unqualified-search registries without prompting // the user. ShortNameModeDisabled // If stdout and stdin are a TTY, prompt the user to select a configured // unqualified-search registry. Otherwise, use all configured // unqualified-search registries. // // Note that if only one unqualified-search registry is set, it will be // used without prompting. ShortNameModePermissive // Always prompt the user to select a configured unqualified-search // registry. Throw an error if stdout or stdin is not a TTY as // prompting isn't possible. // // Note that if only one unqualified-search registry is set, it will be // used without prompting. ShortNameModeEnforcing ) // SystemContext allows parameterizing access to implicitly-accessed resources, // like configuration files in /etc and users' login state in their home directory. // Various components can share the same field only if their semantics is exactly // the same; if in doubt, add a new field. // It is always OK to pass nil instead of a SystemContext. type SystemContext struct { // If not "", prefixed to any absolute paths used by default by the library (e.g. in /etc/). // Not used for any of the more specific path overrides available in this struct. // Not used for any paths specified by users in config files (even if the location of the config file _was_ affected by it). // NOTE: If this is set, environment-variable overrides of paths are ignored (to keep the semantics simple: to create an /etc replacement, just set RootForImplicitAbsolutePaths . // and there is no need to worry about the environment.) // NOTE: This does NOT affect paths starting by $HOME. RootForImplicitAbsolutePaths string // === Global configuration overrides === // If not "", overrides the system's default path for signature.Policy configuration. SignaturePolicyPath string // If not "", overrides the system's default path for registries.d (Docker signature storage configuration) RegistriesDirPath string // Path to the system-wide registries configuration file SystemRegistriesConfPath string // Path to the system-wide registries configuration directory SystemRegistriesConfDirPath string // Path to the user-specific short-names configuration file UserShortNameAliasConfPath string // If set, short-name resolution in pkg/shortnames must follow the specified mode ShortNameMode *ShortNameMode // If set, short names will resolve in pkg/shortnames to docker.io only, and unqualified-search registries and // short-name aliases in registries.conf are ignored. Note that this field is only intended to help enforce // resolving to Docker Hub in the Docker-compatible REST API of Podman; it should never be used outside this // specific context. PodmanOnlyShortNamesIgnoreRegistriesConfAndForceDockerHub bool // If not "", overrides the default path for the registry authentication file, but only new format files AuthFilePath string // if not "", overrides the default path for the registry authentication file, but with the legacy format; // the code currently will by default look for legacy format files like .dockercfg in the $HOME dir; // but in addition to the home dir, openshift may mount .dockercfg files (via secret mount) // in locations other than the home dir; openshift components should then set this field in those cases; // this field is ignored if `AuthFilePath` is set (we favor the newer format); // only reading of this data is supported; LegacyFormatAuthFilePath string // If set, a path to a Docker-compatible "config.json" file containing credentials; and no other files are processed. // This must not be set if AuthFilePath is set. // Only credentials and credential helpers in this file apre processed, not any other configuration in this file. DockerCompatAuthFilePath string // If not "", overrides the use of platform.GOARCH when choosing an image or verifying architecture match. ArchitectureChoice string // If not "", overrides the use of platform.GOOS when choosing an image or verifying OS match. OSChoice string // If not "", overrides the use of detected ARM platform variant when choosing an image or verifying variant match. VariantChoice string // If not "", overrides the system's default directory containing a blob info cache. BlobInfoCacheDir string // Additional tags when creating or copying a docker-archive. DockerArchiveAdditionalTags []reference.NamedTagged // If not "", overrides the temporary directory to use for storing big files BigFilesTemporaryDir string // If not nil, may contain TLS _algorithm_ options (e.g. TLS version, cipher suites, “curves”, etc.) // The effect of setting any other options (cryptographic keys, InsecureSkipTLSVerify, callbacks, etc.) is UNDEFINED, // may be inconsistent in various use cases, and may change over time. // Consumers of this value are expected to .Clone() the config and then apply other options. BaseTLSConfig *tls.Config // === OCI.Transport overrides === // If not "", a directory containing a CA certificate (ending with ".crt"), // a client certificate (ending with ".cert") and a client certificate key // (ending with ".key") used when downloading OCI image layers. OCICertPath string // Allow downloading OCI image layers over HTTP, or HTTPS with failed TLS verification. Note that this does not affect other TLS connections. OCIInsecureSkipTLSVerify bool // If not "", use a shared directory for storing blobs rather than within OCI layouts OCISharedBlobDirPath string // Allow UnCompress image layer for OCI image layer OCIAcceptUncompressedLayers bool // === docker.Transport overrides === // If not "", a directory containing a CA certificate (ending with ".crt"), // a client certificate (ending with ".cert") and a client certificate key // (ending with ".key") used when talking to a container registry. DockerCertPath string // If not "", overrides the system’s default path for a directory containing host[:port] subdirectories with the same structure as DockerCertPath above. // Ignored if DockerCertPath is non-empty. DockerPerHostCertDirPath string // Allow contacting container registries over HTTP, or HTTPS with failed TLS verification. Note that this does not affect other TLS connections. DockerInsecureSkipTLSVerify OptionalBool // if nil, the library tries to parse ~/.docker/config.json to retrieve credentials // Ignored if DockerBearerRegistryToken is non-empty. DockerAuthConfig *DockerAuthConfig // if not "", the library uses this registry token to authenticate to the registry DockerBearerRegistryToken string // if not "", an User-Agent header is added to each request when contacting a registry. DockerRegistryUserAgent string // if true, a V1 ping attempt isn't done to give users a better error. Default is false. // Note that this field is used mainly to integrate containers/image into projectatomic/docker // in order to not break any existing docker's integration tests. // // Deprecated: The V1 container registry detection is no longer performed, so setting this flag has no effect. DockerDisableV1Ping bool // If true, dockerImageDestination.SupportedManifestMIMETypes will omit the Schema1 media types from the supported list DockerDisableDestSchema1MIMETypes bool // If true, the physical pull source of docker transport images logged as info level DockerLogMirrorChoice bool // Directory to use for OSTree temporary files // // Deprecated: The OSTree transport has been removed. OSTreeTmpDirPath string // If true, all blobs will have precomputed digests to ensure layers are not uploaded that already exist on the registry. // Note that this requires writing blobs to temporary files, and takes more time than the default behavior, // when the digest for a blob is unknown. DockerRegistryPushPrecomputeDigests bool // DockerProxyURL specifies proxy configuration schema (like socks5://username:password@ip:port) DockerProxyURL *url.URL // DockerProxy is a function that determines the proxy URL for a given request URL. // If set, this takes precedence over DockerProxyURL. The function should return the proxy URL to use, // or nil if no proxy should be used for the given request. DockerProxy func(reqURL *url.URL) (*url.URL, error) // === docker/daemon.Transport overrides === // A directory containing a CA certificate (ending with ".crt"), // a client certificate (ending with ".cert") and a client certificate key // (ending with ".key") used when talking to a Docker daemon. DockerDaemonCertPath string // The hostname or IP to the Docker daemon. If not set (aka ""), client.DefaultDockerHost is assumed. DockerDaemonHost string // Used to skip TLS verification, off by default. To take effect DockerDaemonCertPath needs to be specified as well. DockerDaemonInsecureSkipTLSVerify bool // === dir.Transport overrides === // DirForceCompress compresses the image layers if set to true DirForceCompress bool // DirForceDecompress decompresses the image layers if set to true DirForceDecompress bool // CompressionFormat is the format to use for the compression of the blobs CompressionFormat *compression.Algorithm // CompressionLevel specifies what compression level is used CompressionLevel *int } // ProgressEvent is the type of events a progress reader can produce // Warning: new event types may be added any time. type ProgressEvent uint const ( // ProgressEventNewArtifact will be fired on progress reader setup ProgressEventNewArtifact ProgressEvent = iota // ProgressEventRead indicates that the artifact download is currently in // progress ProgressEventRead // ProgressEventDone is fired when the data transfer has been finished for // the specific artifact ProgressEventDone // ProgressEventSkipped is fired when the artifact has been skipped because // its already available at the destination ProgressEventSkipped ) // ProgressProperties is used to pass information from the copy code to a monitor which // can use the real-time information to produce output or react to changes. type ProgressProperties struct { // The event indicating what Event ProgressEvent // The artifact which has been updated in this interval Artifact BlobInfo // The currently downloaded size in bytes // Increases from 0 to the final Artifact size Offset uint64 // The additional offset which has been downloaded inside the last update // interval. Will be reset after each ProgressEventRead event. OffsetUpdate uint64 } ================================================ FILE: vendor/go.podman.io/image/v5/version/version.go ================================================ package version import "fmt" const ( // VersionMajor is for an API incompatible changes VersionMajor = 5 // VersionMinor is for functionality in a backwards-compatible manner VersionMinor = 40 // VersionPatch is for backwards-compatible bug fixes VersionPatch = 0 // VersionDev indicates development branch. Releases will be empty string. VersionDev = "-dev" ) // Version is the specification version that the package types support. var Version = fmt.Sprintf("%d.%d.%d%s", VersionMajor, VersionMinor, VersionPatch, VersionDev) ================================================ FILE: vendor/go.podman.io/storage/.dockerignore ================================================ bundles .gopath vendor/pkg ================================================ FILE: vendor/go.podman.io/storage/.gitignore ================================================ # containers/storage project generated files to ignore # if you want to ignore files created by your editor/tools, # please consider a global .gitignore https://help.github.com/articles/ignoring-files *.1 *.5 *.exe *~ *.orig *.test .*.swp .DS_Store .idea* # a .bashrc may be added to customize the build environment .bashrc .gopath/ docs/AWS_S3_BUCKET docs/GITCOMMIT docs/GIT_BRANCH docs/VERSION docs/_build docs/_static docs/_templates docs/changed-files # generated by man/md2man-all.sh man/man1 man/man5 man/man8 tests/tools/build vendor/pkg/ .vagrant /containers-storage /containers-storage.* ================================================ FILE: vendor/go.podman.io/storage/.golangci.yml ================================================ version: "2" formatters: enable: - gofumpt linters: enable: - nolintlint - unconvert exclusions: presets: - comments - std-error-handling settings: staticcheck: checks: - all - -ST1003 # https://staticcheck.dev/docs/checks/#ST1003 Poorly chosen identifier. - -QF1008 # https://staticcheck.dev/docs/checks/#QF1008 Omit embedded fields from selector expression. issues: max-issues-per-linter: 0 max-same-issues: 0 ================================================ FILE: vendor/go.podman.io/storage/.mailmap ================================================ # Generate AUTHORS: hack/generate-authors.sh # Tip for finding duplicates (besides scanning the output of AUTHORS for name # duplicates that aren't also email duplicates): scan the output of: # git log --format='%aE - %aN' | sort -uf # # For explanation on this file format: man git-shortlog Patrick Stapleton Shishir Mahajan Erwin van der Koogh Ahmed Kamal Tejesh Mehta Cristian Staretu Cristian Staretu Cristian Staretu Marcus Linke Aleksandrs Fadins Christopher Latham Hu Keping Wayne Chang Chen Chao Daehyeok Mun Guillaume J. Charmes Thatcher Peskens Thatcher Peskens Thatcher Peskens dhrp Jérôme Petazzoni jpetazzo Jérôme Petazzoni Joffrey F Joffrey F Joffrey F Tim Terhorst Andy Smith Walter Stanish Roberto Hashioka Konstantin Pelykh David Sissitka Nolan Darilek Benoit Chesneau Jordan Arentsen Daniel Garcia Miguel Angel Fernández Bhiraj Butala Faiz Khan Victor Lyuboslavsky Jean-Baptiste Barth Matthew Mueller Shih-Yuan Lee Daniel Mizyrycki root Jean-Baptiste Dalido Sven Dowideit Sven Dowideit Sven Dowideit Sven Dowideit <¨SvenDowideit@home.org.au¨> Sven Dowideit Sven Dowideit Sven Dowideit Alexander Morozov Alexander Morozov O.S. Tezer Roberto G. Hashioka Sridhar Ratnakumar Sridhar Ratnakumar Liang-Chi Hsieh Aleksa Sarai Aleksa Sarai Aleksa Sarai Will Weaver Timothy Hobbs Nathan LeClaire Nathan LeClaire Matthew Heon Francisco Carriedo Brian Goff Hollie Teal Jessica Frazelle Jessica Frazelle Jessica Frazelle Jessica Frazelle Jessica Frazelle Thomas LEVEIL Thomas LÉVEIL Antonio Murdaca Antonio Murdaca Antonio Murdaca Antonio Murdaca Antonio Murdaca Darren Shepherd Deshi Xiao Deshi Xiao Doug Davis Jacob Atzen Jeff Nickoloff John Howard (VM) John Howard (VM) John Howard (VM) John Howard (VM) Madhu Venugopal Mary Anthony Mary Anthony moxiegirl Mary Anthony mattyw resouer AJ Bowen soulshake AJ Bowen soulshake Tibor Vass Tibor Vass Vincent Bernat Yestin Sun bin liu John Howard (VM) jhowardmsft Ankush Agarwal Tangi COLIN tangicolin Allen Sun Adrien Gallouët Anuj Bahuguna Anusha Ragunathan Avi Miller Brent Salisbury Chander G Chun Chen Ying Li Daehyeok Mun Daniel, Dao Quang Minh Daniel Nephin Dave Tucker Doug Tangren Frederick F. Kautz IV Ben Golub Harold Cooper hsinko <21551195@zju.edu.cn> Josh Hawn Justin Cormack Kamil Domański Lei Jitang Linus Heckemann Lynda O'Leary Marianna Tessel Michael Huettermann Moysés Borges Nigel Poulton Qiang Huang Boaz Shuster Shuwei Hao Soshi Katsuta Stefan Berger Stephen Day Toli Kuznets Tristan Carel Vincent Demeester Vishnu Kannan xlgao-zju xlgao yuchangchun y00277921 Hao Shu Wei Shengbo Song mYmNeo Shengbo Song Sylvain Bellemare ================================================ FILE: vendor/go.podman.io/storage/AUTHORS ================================================ # This file lists all individuals having contributed content to the repository. # For how it is generated, see `hack/generate-authors.sh`. Aanand Prasad Aaron Davidson Aaron Feng Aaron Huslage Aaron Lehmann Aaron Welch Abel Muiño Abhijeet Kasurde Abhinav Ajgaonkar Abhishek Chanda Abin Shahab Adam Miller Adam Singer Aditi Rajagopal Aditya Adria Casas Adrian Mouat Adrian Oprea Adrien Folie Adrien Gallouët Ahmed Kamal Ahmet Alp Balkan Aidan Feldman Aidan Hobson Sayers AJ Bowen Ajey Charantimath ajneu Akihiro Suda Al Tobey alambike Alan Scherger Alan Thompson Albert Callarisa Albert Zhang Aleksa Sarai Aleksandrs Fadins Alena Prokharchyk Alessandro Boch Alessio Biancalana Alex Chan Alex Crawford Alex Ellis Alex Gaynor Alex Samorukov Alex Warhawk Alexander Artemenko Alexander Boyd Alexander Larsson Alexander Morozov Alexander Shopov Alexandre Beslic Alexandre González Alexandru Sfirlogea Alexey Guskov Alexey Kotlyarov Alexey Shamrin Alexis THOMAS Ali Dehghani Allen Madsen Allen Sun almoehi Alvin Richards amangoel Amen Belayneh Amit Bakshi Amit Krishnan Amy Lindburg Anand Patil AnandkumarPatel Anatoly Borodin Anchal Agrawal Anders Janmyr Andre Dublin <81dublin@gmail.com> Andre Granovsky Andrea Luzzardi Andrea Turli Andreas Köhler Andreas Savvides Andreas Tiefenthaler Andrew C. Bodine Andrew Clay Shafer Andrew Duckworth Andrew France Andrew Gerrand Andrew Guenther Andrew Kuklewicz Andrew Macgregor Andrew Macpherson Andrew Martin Andrew Munsell Andrew Weiss Andrew Williams Andrews Medina Andrey Petrov Andrey Stolbovsky André Martins andy Andy Chambers andy diller Andy Goldstein Andy Kipp Andy Rothfusz Andy Smith Andy Wilson Anes Hasicic Anil Belur Ankush Agarwal Anonmily Anthon van der Neut Anthony Baire Anthony Bishopric Anthony Dahanne Anton Löfgren Anton Nikitin Anton Polonskiy Anton Tiurin Antonio Murdaca Antony Messerli Anuj Bahuguna Anusha Ragunathan apocas ArikaChen Arnaud Porterie Arthur Barr Arthur Gautier Artur Meyster Arun Gupta Asbjørn Enge averagehuman Avi Das Avi Miller ayoshitake Azat Khuyiyakhmetov Bardia Keyoumarsi Barnaby Gray Barry Allard Bartłomiej Piotrowski Bastiaan Bakker bdevloed Ben Firshman Ben Golub Ben Hall Ben Sargent Ben Severson Ben Toews Ben Wiklund Benjamin Atkin Benoit Chesneau Bernerd Schaefer Bert Goethals Bharath Thiruveedula Bhiraj Butala Bill W bin liu Blake Geno Boaz Shuster bobby abbott boucher Bouke Haarsma Boyd Hemphill boynux Bradley Cicenas Bradley Wright Brandon Liu Brandon Philips Brandon Rhodes Brendan Dixon Brent Salisbury Brett Higgins Brett Kochendorfer Brian (bex) Exelbierd Brian Bland Brian DeHamer Brian Dorsey Brian Flad Brian Goff Brian McCallister Brian Olsen Brian Shumate Brian Torres-Gil Brian Trump Brice Jaglin Briehan Lombaard Bruno Bigras Bruno Binet Bruno Gazzera Bruno Renié Bryan Bess Bryan Boreham Bryan Matsuo Bryan Murphy buddhamagnet Burke Libbey Byung Kang Caleb Spare Calen Pennington Cameron Boehmer Cameron Spear Campbell Allen Candid Dauth Carl Henrik Lunde Carl X. Su Carlos Alexandro Becker Carlos Sanchez Carol Fager-Higgins Cary Casey Bisson Cedric Davies Cezar Sa Espinola Chad Swenson Chance Zibolski Chander G Charles Chan Charles Hooper Charles Law Charles Lindsay Charles Merriam Charles Sarrazin Charlie Lewis Chase Bolt ChaYoung You Chen Chao Chen Hanxiao cheney90 Chewey Chia-liang Kao chli Cholerae Hu Chris Alfonso Chris Armstrong Chris Dituri Chris Fordham Chris Khoo Chris McKinnel Chris Seto Chris Snow Chris St. Pierre Chris Stivers Chris Swan Chris Wahl Chris Weyl chrismckinnel Christian Berendt Christian Böhme Christian Persson Christian Rotzoll Christian Simon Christian Stefanescu ChristoperBiscardi Christophe Mehay Christophe Troestler Christopher Currie Christopher Jones Christopher Latham Christopher Rigor Christy Perez Chun Chen Ciro S. Costa Clayton Coleman Clinton Kitson Coenraad Loubser Colin Dunklau Colin Rice Colin Walters Collin Guarino Colm Hally companycy Cory Forsyth cressie176 Cristian Staretu cristiano balducci Cruceru Calin-Cristian Cyril F Daan van Berkel Daehyeok Mun Dafydd Crosby dalanlan Damien Nadé Damien Nozay Damjan Georgievski Dan Anolik Dan Buch Dan Cotora Dan Griffin Dan Hirsch Dan Keder Dan Levy Dan McPherson Dan Stine Dan Walsh Dan Williams Daniel Antlinger Daniel Exner Daniel Farrell Daniel Garcia Daniel Gasienica Daniel Hiltgen Daniel Menet Daniel Mizyrycki Daniel Nephin Daniel Norberg Daniel Nordberg Daniel Robinson Daniel S Daniel Von Fange Daniel YC Lin Daniel Zhang Daniel, Dao Quang Minh Danny Berger Danny Yates Darren Coxall Darren Shepherd Darren Stahl Dave Barboza Dave Henderson Dave MacDonald Dave Tucker David Anderson David Calavera David Corking David Cramer David Currie David Davis David Gageot David Gebler David Lawrence David Mackey David Mat David Mcanulty David Pelaez David R. Jenni David Röthlisberger David Sheets David Sissitka David Xia David Young Davide Ceretti Dawn Chen dcylabs decadent deed02392 Deng Guangxing Deni Bertovic Denis Gladkikh Denis Ollier Dennis Docter Derek Derek Derek Ch Derek McGowan Deric Crago Deshi Xiao devmeyster Devvyn Murphy Dharmit Shah Dieter Reuter Dima Stopel Dimitri John Ledkov Dimitry Andric Dinesh Subhraveti Diogo Monica DiuDiugirl Djibril Koné dkumor Dmitri Logvinenko Dmitry Demeshchuk Dmitry Gusev Dmitry V. Krivenok Dmitry Vorobev Dolph Mathews Dominik Finkbeiner Dominik Honnef Don Kirkby Don Kjer Don Spaulding Donald Huang Dong Chen Donovan Jones Doug Davis Doug MacEachern Doug Tangren Dr Nic Williams dragon788 Dražen Lučanin Dustin Sallings Ed Costello Edmund Wagner Eiichi Tsukata Eike Herzbach Eivind Uggedal Elan Ruusamäe Elias Probst Elijah Zupancic eluck Elvir Kuric Emil Hernvall Emily Maier Emily Rose Emir Ozer Enguerran Eohyung Lee Eric Hanchrow Eric Lee Eric Myhre Eric Paris Eric Rafaloff Eric Rosenberg Eric Sage Eric Windisch Eric Yang Eric-Olivier Lamey Erik Bray Erik Dubbelboer Erik Hollensbe Erik Inge Bolsø Erik Kristensen Erik Weathers Erno Hopearuoho Erwin van der Koogh Euan Eugene Yakubovich eugenkrizo evalle Evan Allrich Evan Carmi Evan Hazlett Evan Krall Evan Phoenix Evan Wies Evgeny Vereshchagin Ewa Czechowska Eystein Måløy Stenberg ezbercih Fabiano Rosas Fabio Falci Fabio Rehm Fabrizio Regini Fabrizio Soppelsa Faiz Khan falmp Fangyuan Gao <21551127@zju.edu.cn> Fareed Dudhia Fathi Boudra Federico Gimenez Felix Geisendörfer Felix Hupfeld Felix Rabe Felix Schindler Ferenc Szabo Fernando Fero Volar Filipe Brandenburger Filipe Oliveira fl0yd Flavio Castelli FLGMwt Florian Florian Klein Florian Maier Florian Weingarten Florin Asavoaie Francesc Campoy Francisco Carriedo Francisco Souza Frank Groeneveld Frank Herrmann Frank Macreery Frank Rosquin Fred Lifton Frederick F. Kautz IV Frederik Loeffert Frederik Nordahl Jul Sabroe Freek Kalter fy2462 Félix Baylac-Jacqué Félix Cantournet Gabe Rosenhouse Gabor Nagy Gabriel Monroy GabrielNicolasAvellaneda Galen Sampson Gareth Rushgrove Garrett Barboza Gaurav gautam, prasanna GennadySpb Geoffrey Bachelet George MacRorie George Xie Georgi Hristozov Gereon Frey German DZ Gert van Valkenhoef Gianluca Borello Gildas Cuisinier gissehel Giuseppe Mazzotta Gleb Fotengauer-Malinovskiy Gleb M Borisov Glyn Normington GoBella Goffert van Gool Gosuke Miyashita Gou Rao Govinda Fichtner Grant Reaber Graydon Hoare Greg Fausak Greg Thornton grossws grunny gs11 Guilhem Lettron Guilherme Salgado Guillaume Dufour Guillaume J. Charmes guoxiuyan Gurjeet Singh Guruprasad gwx296173 Günter Zöchbauer Hans Kristian Flaatten Hans Rødtang Hao Shu Wei Hao Zhang <21521210@zju.edu.cn> Harald Albers Harley Laue Harold Cooper Harry Zhang He Simei heartlock <21521209@zju.edu.cn> Hector Castro Henning Sprang Hobofan Hollie Teal Hong Xu hsinko <21551195@zju.edu.cn> Hu Keping Hu Tao Huanzhong Zhang Huayi Zhang Hugo Duncan Hugo Marisco <0x6875676f@gmail.com> Hunter Blanks huqun Huu Nguyen hyeongkyu.lee hyp3rdino Hyzhou <1187766782@qq.com> Ian Babrou Ian Bishop Ian Bull Ian Calvert Ian Lee Ian Main Ian Truslove Iavael Icaro Seara Igor Dolzhikov Ilkka Laukkanen Ilya Dmitrichenko Ilya Gusev ILYA Khlopotov imre Fitos inglesp Ingo Gottwald Isaac Dupree Isabel Jimenez Isao Jonas Ivan Babrou Ivan Fraixedes Ivan Grcic J Bruni J. Nunn Jack Danger Canty Jacob Atzen Jacob Edelman Jake Champlin Jake Moshenko jakedt James Allen James Carey James Carr James DeFelice James Harrison Fisher James Kyburz James Kyle James Lal James Mills James Nugent James Turnbull Jamie Hannaford Jamshid Afshar Jan Keromnes Jan Koprowski Jan Pazdziora Jan Toebes Jan-Gerd Tenberge Jan-Jaap Driessen Jana Radhakrishnan Januar Wayong Jared Biel Jared Hocutt Jaroslaw Zabiello jaseg Jasmine Hegman Jason Divock Jason Giedymin Jason Green Jason Hall Jason Heiss Jason Livesay Jason McVetta Jason Plum Jason Shepherd Jason Smith Jason Sommer Jason Stangroome jaxgeller Jay Jay Jay Kamat Jean-Baptiste Barth Jean-Baptiste Dalido Jean-Paul Calderone Jean-Tiare Le Bigot Jeff Anderson Jeff Johnston Jeff Lindsay Jeff Mickey Jeff Minard Jeff Nickoloff Jeff Welch Jeffrey Bolle Jeffrey Morgan Jeffrey van Gogh Jenny Gebske Jeremy Grosser Jeremy Price Jeremy Qian Jeremy Unruh Jeroen Jacobs Jesse Dearing Jesse Dubay Jessica Frazelle Jezeniel Zapanta jgeiger Jhon Honce Jian Zhang jianbosun Jilles Oldenbeuving Jim Alateras Jim Perrin Jimmy Cuadra Jimmy Puckett jimmyxian Jinsoo Park Jiri Popelka Jiří Župka jjy jmzwcn Joe Beda Joe Doliner Joe Ferguson Joe Gordon Joe Shaw Joe Van Dyk Joel Friedly Joel Handwell Joel Hansson Joel Wurtz Joey Geiger Joey Gibson Joffrey F Johan Euphrosine Johan Rydberg Johannes 'fish' Ziemke John Costa John Feminella John Gardiner Myers John Gossman John Howard (VM) John OBrien III John Starks John Tims John Warwick John Willis Jon Wedaman Jonas Pfenniger Jonathan A. Sternberg Jonathan Boulle Jonathan Camp Jonathan Dowland Jonathan Lebon Jonathan McCrohan Jonathan Mueller Jonathan Pares Jonathan Rudenberg Joost Cassee Jordan Jordan Arentsen Jordan Sissel Jordan Williams Jose Diaz-Gonzalez Joseph Anthony Pasquale Holsten Joseph Hager Joseph Kern Josh Josh Hawn Josh Poimboeuf Josiah Kiehl José Tomás Albornoz JP jrabbit Julian Taylor Julien Barbier Julien Bisconti Julien Bordellier Julien Dubois Julien Pervillé Julio Montes Jun-Ru Chang Jussi Nummelin Justas Brazauskas Justin Cormack Justin Force Justin Plock Justin Simonelis Justin Terry Jyrki Puttonen Jérôme Petazzoni Jörg Thalheim Kai Blin Kai Qiang Wu(Kennan) Kamil Domański kamjar gerami Kanstantsin Shautsou Karan Lyons Kareem Khazem kargakis Karl Grzeszczak Karol Duleba Katie McLaughlin Kato Kazuyoshi Katrina Owen Kawsar Saiyeed kayrus Ke Xu Keli Hu Ken Cochrane Ken ICHIKAWA Kenfe-Mickael Laventure Kenjiro Nakayama Kent Johnson Kevin "qwazerty" Houdebert Kevin Clark Kevin J. Lynagh Kevin Menard Kevin P. Kucharczyk Kevin Shi Kevin Wallace Kevin Yap kevinmeredith Keyvan Fatehi kies Kim BKC Carlbacker Kim Eik Kimbro Staken Kir Kolyshkin Kiran Gangadharan Kirill SIbirev knappe Kohei Tsuruta Koichi Shiraishi Konrad Kleine Konstantin Pelykh Krasimir Georgiev Kristian Haugene Kristina Zabunova krrg Kun Zhang Kunal Kushwaha Kyle Conroy kyu Lachlan Coote Lai Jiangshan Lajos Papp Lakshan Perera Lalatendu Mohanty lalyos Lance Chen Lance Kinley Lars Butler Lars Kellogg-Stedman Lars R. Damerow Laszlo Meszaros Laurent Erignoux Laurie Voss Leandro Siqueira Lee, Meng-Han leeplay Lei Jitang Len Weincier Lennie Leszek Kowalski Levi Blackstone Levi Gross Lewis Marshall Lewis Peckover Liana Lo Liang Mingqiang Liang-Chi Hsieh liaoqingwei limsy Lin Lu LingFaKe Linus Heckemann Liran Tal Liron Levin Liu Bo Liu Hua LIZAO LI Lloyd Dewolf Lokesh Mandvekar longliqiang88 <394564827@qq.com> Lorenz Leutgeb Lorenzo Fontana Louis Opter Luca Marturana Luca Orlandi Luca-Bogdan Grigorescu Lucas Chan Luis Martínez de Bartolomé Izquierdo Lukas Waslowski lukaspustina Lukasz Zajaczkowski lukemarsden Lynda O'Leary Lénaïc Huard Ma Shimiao Mabin Madhav Puri Madhu Venugopal Mageee <21521230.zju.edu.cn> Mahesh Tiyyagura malnick Malte Janduda manchoz Manfred Touron Manfred Zabarauskas mansinahar Manuel Meurer Manuel Woelker mapk0y Marc Abramowitz Marc Kuo Marc Tamsky Marcelo Salazar Marco Hennings Marcus Farkas Marcus Linke Marcus Ramberg Marek Goldmann Marian Marinov Marianna Tessel Mario Loriedo Marius Gundersen Marius Sturm Marius Voila Mark Allen Mark McGranaghan Mark McKinstry Mark West Marko Mikulicic Marko Tibold Markus Fix Martijn Dwars Martijn van Oosterhout Martin Honermeyer Martin Kelly Martin Mosegaard Amdisen Martin Redmond Mary Anthony Masahito Zembutsu Mason Malone Mateusz Sulima Mathias Monnerville Mathieu Le Marec - Pasquet Matt Apperson Matt Bachmann Matt Bentley Matt Haggard Matt McCormick Matt Moore Matt Robenolt Matthew Heon Matthew Mayer Matthew Mueller Matthew Riley Matthias Klumpp Matthias Kühnle Matthias Rampke Matthieu Hauglustaine mattymo mattyw Mauricio Garavaglia mauriyouth Max Shytikov Maxim Ivanov Maxim Kulkin Maxim Treskin Maxime Petazzoni Meaglith Ma meejah Megan Kostick Mehul Kar Mengdi Gao Mert Yazıcıoğlu Micah Zoltu Michael A. Smith Michael Bridgen Michael Brown Michael Chiang Michael Crosby Michael Currie Michael Friis Michael Gorsuch Michael Grauer Michael Holzheu Michael Hudson-Doyle Michael Huettermann Michael Käufl Michael Neale Michael Prokop Michael Scharf Michael Stapelberg Michael Steinert Michael Thies Michael West Michal Fojtik Michal Gebauer Michal Jemala Michal Minar Michaël Pailloncy Michał Czeraszkiewicz Michiel@unhosted Miguel Angel Fernández Miguel Morales Mihai Borobocea Mihuleacc Sergiu Mike Brown Mike Chelen Mike Danese Mike Dillon Mike Dougherty Mike Gaffney Mike Goelzer Mike Leone Mike MacCana Mike Naberezny Mike Snitzer mikelinjie <294893458@qq.com> Mikhail Sobolev Miloslav Trmač mingqing Mingzhen Feng Mitch Capper mlarcher Mohammad Banikazemi Mohammed Aaqib Ansari Mohit Soni Morgan Bauer Morgante Pell Morgy93 Morten Siebuhr Morton Fox Moysés Borges mqliang Mrunal Patel msabansal mschurenko muge Mustafa Akın Muthukumar R Máximo Cuadros Médi-Rémi Hashim Nahum Shalman Nakul Pathak Nalin Dahyabhai Nan Monnand Deng Naoki Orii Natalie Parker Natanael Copa Nate Brennand Nate Eagleson Nate Jones Nathan Hsieh Nathan Kleyn Nathan LeClaire Nathan McCauley Nathan Williams Neal McBurnett Nelson Chen Nghia Tran Niall O'Higgins Nicholas E. Rabenau Nick Irvine Nick Parker Nick Payne Nick Stenning Nick Stinemates Nicolas Borboën Nicolas De loof Nicolas Dudebout Nicolas Goy Nicolas Kaiser Nicolás Hock Isaza Nigel Poulton NikolaMandic nikolas Nirmal Mehta Nishant Totla NIWA Hideyuki noducks Nolan Darilek nponeccop Nuutti Kotivuori nzwsch O.S. Tezer objectified OddBloke odk- Oguz Bilgic Oh Jinkyun Ohad Schneider Ole Reifschneider Oliver Neal Olivier Gambier Olle Jonsson Oriol Francès Otto Kekäläinen oyld ozlerhakan paetling pandrew panticz Paolo G. Giarrusso Pascal Borreli Pascal Hartig Patrick Devine Patrick Hemmer Patrick Stapleton pattichen Paul paul Paul Annesley Paul Bellamy Paul Bowsher Paul Hammond Paul Jimenez Paul Lietar Paul Liljenberg Paul Morie Paul Nasrat Paul Weaver Pavel Lobashov Pavel Pospisil Pavel Sutyrin Pavel Tikhomirov Pavlos Ratis Peeyush Gupta Peggy Li Pei Su Penghan Wang perhapszzy@sina.com Peter Bourgon Peter Braden Peter Choi Peter Dave Hello Peter Edge Peter Ericson Peter Esbensen Peter Malmgren Peter Salvatore Peter Volpe Peter Waller Phil Phil Estes Phil Spitler Philip Monroe Philipp Wahala Philipp Weissensteiner Phillip Alexander pidster Piergiuliano Bossi Pierre Pierre Carrier Pierre Wacrenier Pierre-Alain RIVIERE Piotr Bogdan pixelistik Porjo Poul Kjeldager Sørensen Pradeep Chhetri Prasanna Gautam Prayag Verma Przemek Hejman pysqz qg <1373319223@qq.com> qhuang Qiang Huang qq690388648 <690388648@qq.com> Quentin Brossard Quentin Perez Quentin Tayssier r0n22 Rafal Jeczalik Rafe Colton Raghavendra K T Raghuram Devarakonda Rajat Pandit Rajdeep Dua Ralle Ralph Bean Ramkumar Ramachandra Ramon van Alteren Ray Tsang ReadmeCritic Recursive Madman Regan McCooey Remi Rampin Renato Riccieri Santos Zannon resouer rgstephens Rhys Hiltner Rich Seymour Richard Richard Burnison Richard Harvey Richard Metzler Richard Scothern Richo Healey Rick Bradley Rick van de Loo Rick Wieman Rik Nijessen Riku Voipio Riley Guerin Ritesh H Shukla Riyaz Faizullabhoy Rob Vesse Robert Bachmann Robert Bittle Robert Obryk Robert Stern Robert Wallis Roberto G. Hashioka Robin Naundorf Robin Schneider Robin Speekenbrink robpc Rodolfo Carvalho Rodrigo Vaz Roel Van Nyen Roger Peppe Rohit Jnagal Rohit Kadam Roland Huß Roland Kammerer Roland Moriz Roma Sokolov Roman Strashkin Ron Smits root root root root Rory Hunter Rory McCune Ross Boucher Rovanion Luckey Rozhnov Alexandr rsmoorthy Rudolph Gottesheim Rui Lopes Ryan Anderson Ryan Aslett Ryan Belgrave Ryan Detzel Ryan Fowler Ryan McLaughlin Ryan O'Donnell Ryan Seto Ryan Thomas Ryan Trauntvein Ryan Wallner RyanDeng Rémy Greinhofer s. rannou s00318865 Sabin Basyal Sachin Joshi Sagar Hani Sainath Grandhi Sally O'Malley Sam Abed Sam Alba Sam Bailey Sam J Sharpe Sam Neirinck Sam Reis Sam Rijs Sambuddha Basu Sami Wagiaalla Samuel Andaya Samuel Dion-Girardeau Samuel Karp Samuel PHAN Sankar சங்கர் Sanket Saurav Santhosh Manohar sapphiredev Satnam Singh satoru Satoshi Amemiya scaleoutsean Scott Bessler Scott Collier Scott Johnston Scott Stamp Scott Walls sdreyesg Sean Christopherson Sean Cronin Sean OMeara Sean P. Kane Sebastiaan van Steenis Sebastiaan van Stijn Senthil Kumar Selvaraj Senthil Kumaran SeongJae Park Seongyeol Lim Serge Hallyn Sergey Alekseev Sergey Evstifeev Sevki Hasirci Shane Canon Shane da Silva shaunol Shawn Landden Shawn Siefkas Shekhar Gulati Sheng Yang Shengbo Song Shih-Yuan Lee Shijiang Wei Shishir Mahajan shuai-z Shuwei Hao Sian Lerk Lau sidharthamani Silas Sewell Simei He Simon Eskildsen Simon Leinen Simon Taranto Sindhu S Sjoerd Langkemper Solganik Alexander Solomon Hykes Song Gao Soshi Katsuta Soulou Spencer Brown Spencer Smith Sridatta Thatipamala Sridhar Ratnakumar Srini Brahmaroutu srinsriv Steeve Morin Stefan Berger Stefan J. Wernli Stefan Praszalowicz Stefan Scherer Stefan Staudenmeyer Stefan Weil Stephen Crosby Stephen Day Stephen Rust Steve Durrheimer Steve Francia Steve Koch Steven Burgess Steven Iveson Steven Merrill Steven Richards Steven Taylor Subhajit Ghosh Sujith Haridasan Suryakumar Sudar Sven Dowideit Swapnil Daingade Sylvain Baubeau Sylvain Bellemare Sébastien Sébastien Luttringer Sébastien Stormacq TAGOMORI Satoshi tang0th Tangi COLIN Tatsuki Sugiura Tatsushi Inagaki Taylor Jones tbonza Ted M. Young Tehmasp Chaudhri Tejesh Mehta terryding77 <550147740@qq.com> tgic Thatcher Peskens theadactyl Thell 'Bo' Fowler Thermionix Thijs Terlouw Thomas Bikeev Thomas Frössman Thomas Gazagnaire Thomas Grainger Thomas Hansen Thomas Leonard Thomas LEVEIL Thomas Orozco Thomas Riccardi Thomas Schroeter Thomas Sjögren Thomas Swift Thomas Tanaka Thomas Texier Tianon Gravi Tibor Vass Tiffany Low Tim Bosse Tim Dettrick Tim Düsterhus Tim Hockin Tim Ruffles Tim Smith Tim Terhorst Tim Wang Tim Waugh Tim Wraight Timothy Hobbs tjwebb123 tobe Tobias Bieniek Tobias Bradtke Tobias Gesellchen Tobias Klauser Tobias Schmidt Tobias Schwab Todd Crane Todd Lunter Todd Whiteman Toli Kuznets Tom Barlow Tom Denham Tom Fotherby Tom Howe Tom Hulihan Tom Maaswinkel Tom X. Tobin Tomas Tomecek Tomasz Kopczynski Tomasz Lipinski Tomasz Nurkiewicz Tommaso Visconti Tomáš Hrčka Tonis Tiigi Tonny Xu Tony Daws Tony Miller toogley Torstein Husebø tpng tracylihui <793912329@qq.com> Travis Cline Travis Thieman Trent Ogren Trevor Trevor Pounds trishnaguha Tristan Carel Troy Denton Tyler Brock Tzu-Jung Lee Tõnis Tiigi Ulysse Carion unknown vagrant Vaidas Jablonskis Veres Lajos vgeta Victor Coisne Victor Costan Victor I. Wood Victor Lyuboslavsky Victor Marmol Victor Palma Victor Vieux Victoria Bialas Vijaya Kumar K Viktor Stanchev Viktor Vojnovski VinayRaghavanKS Vincent Batts Vincent Bernat Vincent Bernat Vincent Demeester Vincent Giersch Vincent Mayers Vincent Woo Vinod Kulkarni Vishal Doshi Vishnu Kannan Vitor Monteiro Vivek Agarwal Vivek Dasgupta Vivek Goyal Vladimir Bulyga Vladimir Kirillov Vladimir Rutsky Vladimir Varankin VladimirAus Vojtech Vitek (V-Teq) waitingkuo Walter Leibbrandt Walter Stanish WANG Chao Wang Xing Ward Vandewege WarheadsSE Wayne Chang Wei-Ting Kuo weiyan Weiyang Zhu Wen Cheng Ma Wendel Fleming Wenxuan Zhao Wenyu You <21551128@zju.edu.cn> Wes Morgan Will Dietz Will Rouesnel Will Weaver willhf William Delanoue William Henry William Hubbs William Riancho William Thurston WiseTrem wlan0 Wolfgang Powisch wonderflow xamyzhao XiaoBing Jiang Xiaoxu Chen xiekeyang Xinzi Zhou Xiuming Chen xlgao-zju xuzhaokui Yahya YAMADA Tsuyoshi Yan Feng Yang Bai yangshukui Yasunori Mahata Yestin Sun Yi EungJun Yibai Zhang Yihang Ho Ying Li Yohei Ueda Yong Tang Yongzhi Pan yorkie Youcef YEKHLEF Yuan Sun yuchangchun yuchengxia Yurii Rashkovskii yuzou Zac Dover Zach Borboa Zachary Jaffee Zain Memon Zaiste! Zane DeGraffenried Zefan Li Zen Lin(Zhinan Lin) Zhang Kun Zhang Wei Zhang Wentao Zhenan Ye <21551168@zju.edu.cn> Zhu Guihua Zhuoyun Wei Zilin Du zimbatm Ziming Dong ZJUshuaizhou <21551191@zju.edu.cn> zmarouf Zoltan Tombol zqh Zuhayr Elahi Zunayed Ali Álex González Álvaro Lázaro Átila Camurça Alves 尹吉峰 搏通 ================================================ FILE: vendor/go.podman.io/storage/LICENSE ================================================ Apache License Version 2.0, January 2004 https://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS Copyright 2013-2016 Docker, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: vendor/go.podman.io/storage/Makefile ================================================ .PHONY: \ all \ binary \ clean \ containers-storage \ cross \ default \ docs \ gccgo \ help \ install \ install.docs \ lint \ local-binary \ local-cross \ local-gccgo \ local-test \ local-test-integration \ local-test-unit \ test-integration \ test-unit NATIVETAGS := AUTOTAGS := $(shell ./hack/btrfs_tag.sh) $(shell ./hack/libsubid_tag.sh) BUILDFLAGS := -tags "$(AUTOTAGS) $(TAGS)" $(FLAGS) GO ?= go TESTFLAGS := $(shell $(GO) test -race $(BUILDFLAGS) ./pkg/stringutils 2>&1 > /dev/null && echo -race) default all: local-binary docs local-cross ## build and cross-build\nbinaries and docs clean: ## remove all built files $(RM) -f containers-storage containers-storage.* docs/*.1 docs/*.5 containers-storage: ## build using gc on the host $(GO) build -compiler gc $(BUILDFLAGS) ./cmd/containers-storage binary local-binary: containers-storage local-gccgo gccgo: ## build using gccgo on the host GCCGO=$(PWD)/hack/gccgo-wrapper.sh $(GO) build -compiler gccgo $(BUILDFLAGS) -o containers-storage.gccgo ./cmd/containers-storage local-cross cross: ## cross build the binaries for arm, darwin, and freebsd @for target in linux/amd64 linux/386 linux/arm linux/arm64 linux/ppc64 linux/ppc64le linux/riscv64 linux/s390x linux/mips linux/mipsle linux/mips64 linux/mips64le darwin/amd64 windows/amd64 freebsd/amd64 freebsd/arm64 ; do \ os=`echo $${target} | cut -f1 -d/` ; \ arch=`echo $${target} | cut -f2 -d/` ; \ suffix=$${os}.$${arch} ; \ echo env CGO_ENABLED=0 GOOS=$${os} GOARCH=$${arch} $(GO) build -compiler gc -tags \"$(NATIVETAGS) $(TAGS)\" $(FLAGS) ./... ; \ env CGO_ENABLED=0 GOOS=$${os} GOARCH=$${arch} $(GO) build -compiler gc -tags "$(NATIVETAGS) $(TAGS)" $(FLAGS) ./... || exit 1 ; \ echo env CGO_ENABLED=0 GOOS=$${os} GOARCH=$${arch} $(GO) build -compiler gc -tags \"$(NATIVETAGS) $(TAGS)\" $(FLAGS) -o containers-storage.$${suffix} ./cmd/containers-storage ; \ env CGO_ENABLED=0 GOOS=$${os} GOARCH=$${arch} $(GO) build -compiler gc -tags "$(NATIVETAGS) $(TAGS)" $(FLAGS) -o containers-storage.$${suffix} ./cmd/containers-storage || exit 1 ; \ done docs: ## build the docs on the host $(MAKE) -C docs docs local-test: local-binary local-test-unit local-test-integration ## build the binaries and run the tests local-test-unit test-unit: local-binary ## run the unit tests on the host (requires\nsuperuser privileges) @$(GO) test -count 1 $(BUILDFLAGS) $(TESTFLAGS) ./... local-test-integration test-integration: local-binary ## run the integration tests on the host (requires\nsuperuser privileges) @cd tests; ./test_runner.bash install.docs: docs $(MAKE) -C docs install install: install.docs lint: golangci-lint run --build-tags="$(AUTOTAGS) $(TAGS)" .PHONY: fmt fmt: golangci-lint fmt help: ## this help @awk 'BEGIN {FS = ":.*?## "} /^[a-z A-Z_-]+:.*?## / {gsub(" ",",",$$1);gsub("\\\\n",sprintf("\n%22c"," "), $$2);printf "\033[36m%-21s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) .PHONY: tidy-in-container tidy-in-container: podman run --privileged --rm --env HOME=/root -v `pwd`:/src -w /src golang make tidy .PHONY: tidy tidy: $(GO) mod tidy $(GO) mod verify $(GO) mod edit -toolchain none ================================================ FILE: vendor/go.podman.io/storage/NOTICE ================================================ Docker Copyright 2012-2016 Docker, Inc. This product includes software developed at Docker, Inc. (https://www.docker.com). This product contains software (https://github.com/kr/pty) developed by Keith Rarick, licensed under the MIT License. The following is courtesy of our legal counsel: Use and transfer of Docker may be subject to certain restrictions by the United States and other governments. It is your responsibility to ensure that your use and/or transfer does not violate applicable laws. For more information, please see https://www.bis.doc.gov See also https://www.apache.org/dev/crypto.html and/or seek legal counsel. ================================================ FILE: vendor/go.podman.io/storage/OWNERS ================================================ approvers: - giuseppe - kolyshkin - mtrmac - nalind - rhatdan - vrothberg reviewers: - Honny1 - TomSweeneyRedHat - flouthoc - kolyshkin - mrunalp - vrothberg ================================================ FILE: vendor/go.podman.io/storage/README.md ================================================ `storage` is a Go library which aims to provide methods for storing filesystem layers, container images, and containers. A `containers-storage` CLI wrapper is also included for manual and scripting use. To build the CLI wrapper, use 'make binary'. Operations which use VMs expect to launch them using 'vagrant', defaulting to using its 'libvirt' provider. The boxes used are also available for the 'virtualbox' provider, and can be selected by setting $VAGRANT_PROVIDER to 'virtualbox' before kicking off the build. The library manages three types of items: layers, images, and containers. A *layer* is a copy-on-write filesystem which is notionally stored as a set of changes relative to its *parent* layer, if it has one. A given layer can only have one parent, but any layer can be the parent of multiple layers. Layers which are parents of other layers should be treated as read-only. An *image* is a reference to a particular layer (its _top_ layer), along with other information which the library can manage for the convenience of its caller. This information typically includes configuration templates for running a binary contained within the image's layers, and may include cryptographic signatures. Multiple images can reference the same layer, as the differences between two images may not be in their layer contents. A *container* is a read-write layer which is a child of an image's top layer, along with information which the library can manage for the convenience of its caller. This information typically includes configuration information for running the specific container. Multiple containers can be derived from a single image. Layers, images, and containers are represented primarily by 32 character hexadecimal IDs, but items of each kind can also have one or more arbitrary names attached to them, which the library will automatically resolve to IDs when they are passed in to API calls which expect IDs. The library can store what it calls *metadata* for each of these types of items. This is expected to be a small piece of data, since it is cached in memory and stored along with the library's own bookkeeping information. Additionally, the library can store one or more of what it calls *big data* for images and containers. This is a named chunk of larger data, which is only in memory when it is being read from or being written to its own disk file. **[Contributing](../CONTRIBUTING.md)** Information about contributing to this project. ================================================ FILE: vendor/go.podman.io/storage/VERSION ================================================ 1.63.0-dev ================================================ FILE: vendor/go.podman.io/storage/check.go ================================================ package storage import ( "archive/tar" "cmp" "errors" "fmt" "io" "os" "path" "path/filepath" "slices" "strings" "sync" "time" "github.com/sirupsen/logrus" drivers "go.podman.io/storage/drivers" "go.podman.io/storage/pkg/archive" "go.podman.io/storage/pkg/idtools" "go.podman.io/storage/pkg/ioutils" "go.podman.io/storage/types" ) var ( // ErrLayerUnaccounted describes a layer that is present in the lower-level storage driver, // but which is not known to or managed by the higher-level driver-agnostic logic. ErrLayerUnaccounted = types.ErrLayerUnaccounted // ErrLayerUnreferenced describes a layer which is not used by any image or container. ErrLayerUnreferenced = types.ErrLayerUnreferenced // ErrLayerIncorrectContentDigest describes a layer for which the contents of one or more // files which were added in the layer appear to have changed. It may instead look like an // unnamed "file integrity checksum failed" error. ErrLayerIncorrectContentDigest = types.ErrLayerIncorrectContentDigest // ErrLayerIncorrectContentSize describes a layer for which regenerating the diff that was // used to populate the layer produced a diff of a different size. We check the digest // first, so it's highly unlikely you'll ever see this error. ErrLayerIncorrectContentSize = types.ErrLayerIncorrectContentSize // ErrLayerContentModified describes a layer which contains contents which should not be // there, or for which ownership/permissions/dates have been changed. ErrLayerContentModified = types.ErrLayerContentModified // ErrLayerDataMissing describes a layer which is missing a big data item. ErrLayerDataMissing = types.ErrLayerDataMissing // ErrLayerMissing describes a layer which is the missing parent of a layer. ErrLayerMissing = types.ErrLayerMissing // ErrImageLayerMissing describes an image which claims to have a layer that we don't know // about. ErrImageLayerMissing = types.ErrImageLayerMissing // ErrImageDataMissing describes an image which is missing a big data item. ErrImageDataMissing = types.ErrImageDataMissing // ErrImageDataIncorrectSize describes an image which has a big data item which looks like // its size has changed, likely because it's been modified somehow. ErrImageDataIncorrectSize = types.ErrImageDataIncorrectSize // ErrContainerImageMissing describes a container which claims to be based on an image that // we don't know about. ErrContainerImageMissing = types.ErrContainerImageMissing // ErrContainerDataMissing describes a container which is missing a big data item. ErrContainerDataMissing = types.ErrContainerDataMissing // ErrContainerDataIncorrectSize describes a container which has a big data item which looks // like its size has changed, likely because it's been modified somehow. ErrContainerDataIncorrectSize = types.ErrContainerDataIncorrectSize ) const ( defaultMaximumUnreferencedLayerAge = 24 * time.Hour ) // CheckOptions is the set of options for Check(), specifying which tests to perform. type CheckOptions struct { LayerUnreferencedMaximumAge *time.Duration // maximum allowed age of unreferenced layers LayerDigests bool // check that contents of image layer diffs can still be reconstructed LayerMountable bool // check that layers are mountable LayerContents bool // check that contents of image layers match their diffs, with no unexpected changes, requires LayerMountable LayerData bool // check that associated "big" data items are present and can be read ImageData bool // check that associated "big" data items are present, can be read, and match the recorded size ContainerData bool // check that associated "big" data items are present and can be read } // checkIgnore is used to tell functions that compare the contents of a mounted // layer to the contents that we'd expect it to have to ignore certain // discrepancies type checkIgnore struct { ownership, timestamps, permissions, filetype bool } // CheckMost returns a CheckOptions with mostly just "quick" checks enabled. func CheckMost() *CheckOptions { return &CheckOptions{ LayerDigests: true, LayerMountable: true, LayerContents: false, LayerData: true, ImageData: true, ContainerData: true, } } // CheckEverything returns a CheckOptions with every check enabled. func CheckEverything() *CheckOptions { return &CheckOptions{ LayerDigests: true, LayerMountable: true, LayerContents: true, LayerData: true, ImageData: true, ContainerData: true, } } // CheckReport is a list of detected problems. type CheckReport struct { Layers map[string][]error // damaged read-write layers ROLayers map[string][]error // damaged read-only layers layerParentsByLayerID map[string]string layerOrder map[string]int Images map[string][]error // damaged read-write images (including those with damaged layers) ROImages map[string][]error // damaged read-only images (including those with damaged layers) Containers map[string][]error // damaged containers (including those based on damaged images) } // RepairOptions is the set of options for Repair(). type RepairOptions struct { RemoveContainers bool // Remove damaged containers } // RepairEverything returns a RepairOptions with every optional remediation // enabled. func RepairEverything() *RepairOptions { return &RepairOptions{ RemoveContainers: true, } } // Check returns a list of problems with what's in the store, as a whole. It can be very expensive // to call. func (s *store) Check(options *CheckOptions) (CheckReport, error) { var ignore checkIgnore for _, o := range s.graphOptions { if strings.Contains(o, "ignore_chown_errors=true") { ignore.ownership = true } if strings.Contains(o, "force_mask=") { ignore.ownership = true ignore.permissions = true ignore.filetype = true } } for o := range s.pullOptions { if strings.Contains(o, "use_hard_links") { if s.pullOptions[o] == "true" { ignore.timestamps = true } } } if options == nil { options = CheckMost() } report := CheckReport{ Layers: make(map[string][]error), ROLayers: make(map[string][]error), layerParentsByLayerID: make(map[string]string), // layers ID -> their parent's ID, if there is one layerOrder: make(map[string]int), // layers ID -> order for removal, if we needed to remove them all Images: make(map[string][]error), ROImages: make(map[string][]error), Containers: make(map[string][]error), } // This map will track known layer IDs. If we have multiple stores, read-only ones can // contain copies of layers that are in the read-write store, but we'll only ever be // mounting or extracting contents from the read-write versions, since we always search it // first. The boolean will track if the layer is referenced by at least one image or // container. referencedLayers := make(map[string]bool) referencedROLayers := make(map[string]bool) // This map caches the headers for items included in layer diffs. diffHeadersByLayer := make(map[string][]*tar.Header) var diffHeadersByLayerMutex sync.Mutex // Walk the list of layer stores, looking at each layer that we didn't see in a // previously-visited store. if _, _, err := readOrWriteAllLayerStores(s, func(store roLayerStore) (struct{}, bool, error) { layers, err := store.Layers() if err != nil { return struct{}{}, true, err } isReadWrite := roLayerStoreIsReallyReadWrite(store) readWriteDesc := "" if !isReadWrite { readWriteDesc = "read-only " } // Examine each layer in turn. for i := range layers { layer := layers[i] id := layer.ID // If we've already seen a layer with this ID, no need to process it again. if _, checked := referencedLayers[id]; checked { continue } if _, checked := referencedROLayers[id]; checked { continue } // Note the parent of this layer, and add it to the map of known layers so // that we know that we've visited it, but we haven't confirmed that it's // used by anything. report.layerParentsByLayerID[id] = layer.Parent if isReadWrite { referencedLayers[id] = false } else { referencedROLayers[id] = false } logrus.Debugf("checking %slayer %s", readWriteDesc, id) // Check that all of the big data items are present and can be read. We // have no digest or size information to compare the contents to (grumble), // so we can't verify that the contents haven't been changed since they // were stored. if options.LayerData { for _, name := range layer.BigDataNames { func() { rc, err := store.BigData(id, name) if err != nil { if errors.Is(err, os.ErrNotExist) { err := fmt.Errorf("%slayer %s: data item %q: %w", readWriteDesc, id, name, ErrLayerDataMissing) if isReadWrite { report.Layers[id] = append(report.Layers[id], err) } else { report.ROLayers[id] = append(report.ROLayers[id], err) } return } err = fmt.Errorf("%slayer %s: data item %q: %w", readWriteDesc, id, name, err) if isReadWrite { report.Layers[id] = append(report.Layers[id], err) } else { report.ROLayers[id] = append(report.ROLayers[id], err) } return } defer rc.Close() if _, err = io.Copy(io.Discard, rc); err != nil { err = fmt.Errorf("%slayer %s: data item %q: %w", readWriteDesc, id, name, err) if isReadWrite { report.Layers[id] = append(report.Layers[id], err) } else { report.ROLayers[id] = append(report.ROLayers[id], err) } return } }() } } // Check that the content we get back when extracting the layer's contents // match the recorded digest and size. A layer for which they're not given // isn't a part of an image, and is likely the read-write layer for a // container, and we can't vouch for the integrity of its contents. // For each layer with known contents, record the headers for the layer's // diff, which we can use to reconstruct the expected contents for the tree // we see when the layer is mounted. if options.LayerDigests && layer.UncompressedDigest != "" { func() { expectedDigest := layer.UncompressedDigest // Double-check that the digest isn't invalid somehow. if err := layer.UncompressedDigest.Validate(); err != nil { err := fmt.Errorf("%slayer %s: %w", readWriteDesc, id, err) if isReadWrite { report.Layers[id] = append(report.Layers[id], err) } else { report.ROLayers[id] = append(report.ROLayers[id], err) } return } // Extract the diff. uncompressed := archive.Uncompressed diffOptions := DiffOptions{ Compression: &uncompressed, } diff, err := store.Diff("", id, &diffOptions) if err != nil { err := fmt.Errorf("%slayer %s: %w", readWriteDesc, id, err) if isReadWrite { report.Layers[id] = append(report.Layers[id], err) } else { report.ROLayers[id] = append(report.ROLayers[id], err) } return } // Digest and count the length of the diff. digester := expectedDigest.Algorithm().Digester() counter := ioutils.NewWriteCounter(digester.Hash()) reader := io.TeeReader(diff, counter) var wg sync.WaitGroup var archiveErr error wg.Go(func() { // Read the diff, one item at a time. tr := tar.NewReader(reader) hdr, err := tr.Next() for err == nil { diffHeadersByLayerMutex.Lock() diffHeadersByLayer[id] = append(diffHeadersByLayer[id], hdr) diffHeadersByLayerMutex.Unlock() hdr, err = tr.Next() } if !errors.Is(err, io.EOF) { archiveErr = err } // consume any trailer after the EOF marker if _, err := io.Copy(io.Discard, reader); err != nil { err = fmt.Errorf("layer %s: consume any trailer after the EOF marker: %w", id, err) if isReadWrite { report.Layers[id] = append(report.Layers[id], err) } else { report.ROLayers[id] = append(report.ROLayers[id], err) } } }) wg.Wait() diff.Close() if archiveErr != nil { // Reading the diff didn't end as expected diffHeadersByLayerMutex.Lock() delete(diffHeadersByLayer, id) diffHeadersByLayerMutex.Unlock() archiveErr = fmt.Errorf("%slayer %s: %w", readWriteDesc, id, archiveErr) if isReadWrite { report.Layers[id] = append(report.Layers[id], archiveErr) } else { report.ROLayers[id] = append(report.ROLayers[id], archiveErr) } return } if digester.Digest() != layer.UncompressedDigest { // The diff digest didn't match. diffHeadersByLayerMutex.Lock() delete(diffHeadersByLayer, id) diffHeadersByLayerMutex.Unlock() err := fmt.Errorf("%slayer %s: %w", readWriteDesc, id, ErrLayerIncorrectContentDigest) if isReadWrite { report.Layers[id] = append(report.Layers[id], err) } else { report.ROLayers[id] = append(report.ROLayers[id], err) } } if layer.UncompressedSize != -1 && counter.Count != layer.UncompressedSize { // We expected the diff to have a specific size, and // it didn't match. diffHeadersByLayerMutex.Lock() delete(diffHeadersByLayer, id) diffHeadersByLayerMutex.Unlock() err := fmt.Errorf("%slayer %s: read %d bytes instead of %d bytes: %w", readWriteDesc, id, counter.Count, layer.UncompressedSize, ErrLayerIncorrectContentSize) if isReadWrite { report.Layers[id] = append(report.Layers[id], err) } else { report.ROLayers[id] = append(report.ROLayers[id], err) } } }() } } // At this point we're out of things that we can be sure will work in read-only // stores, so skip the rest for any stores that aren't also read-write stores. if !isReadWrite { return struct{}{}, false, nil } // Content and mount checks are also things that we can only be sure will work in // read-write stores. for i := range layers { layer := layers[i] id := layer.ID // Compare to what we see when we mount the layer and walk the tree, and // flag cases where content is in the layer that shouldn't be there. The // tar-split implementation of Diff() won't catch this problem by itself. if options.LayerMountable { func() { // Mount the layer. mountPoint, err := s.graphDriver.Get(id, drivers.MountOpts{MountLabel: layer.MountLabel, Options: []string{"ro"}}) if err != nil { err := fmt.Errorf("%slayer %s: %w", readWriteDesc, id, err) if isReadWrite { report.Layers[id] = append(report.Layers[id], err) } else { report.ROLayers[id] = append(report.ROLayers[id], err) } return } // Unmount the layer when we're done in here. defer func() { if err := s.graphDriver.Put(id); err != nil { err := fmt.Errorf("%slayer %s: %w", readWriteDesc, id, err) if isReadWrite { report.Layers[id] = append(report.Layers[id], err) } else { report.ROLayers[id] = append(report.ROLayers[id], err) } return } }() // If we're not looking at layer contents, or we didn't // look at the diff for this layer, we're done here. if !options.LayerDigests || layer.UncompressedDigest == "" || !options.LayerContents { return } // Build a list of all of the changes in all of the layers // that make up the tree we're looking at. diffHeaderSet := [][]*tar.Header{} // If we don't know _all_ of the changes that produced this // layer, it's not part of an image, so we're done here. for layerID := id; layerID != ""; layerID = report.layerParentsByLayerID[layerID] { diffHeadersByLayerMutex.Lock() layerChanges, haveChanges := diffHeadersByLayer[layerID] diffHeadersByLayerMutex.Unlock() if !haveChanges { return } // The diff headers for this layer go _before_ those of // layers that inherited some of its contents. diffHeaderSet = append([][]*tar.Header{layerChanges}, diffHeaderSet...) } expectedCheckDirectory := newCheckDirectoryDefaults() for _, diffHeaders := range diffHeaderSet { expectedCheckDirectory.headers(diffHeaders) } // Scan the directory tree under the mount point. var idmap *idtools.IDMappings if !s.canUseShifting(layer.UIDMap, layer.GIDMap) { // we would have had to chown() layer contents to match ID maps idmap = idtools.NewIDMappingsFromMaps(layer.UIDMap, layer.GIDMap) } actualCheckDirectory, err := newCheckDirectoryFromDirectory(mountPoint) if err != nil { err := fmt.Errorf("scanning contents of %slayer %s: %w", readWriteDesc, id, err) if isReadWrite { report.Layers[id] = append(report.Layers[id], err) } else { report.ROLayers[id] = append(report.ROLayers[id], err) } return } // Every departure from our expectations is an error. diffs := compareCheckDirectory(expectedCheckDirectory, actualCheckDirectory, idmap, ignore) for _, diff := range diffs { err := fmt.Errorf("%slayer %s: %s, %w", readWriteDesc, id, diff, ErrLayerContentModified) if isReadWrite { report.Layers[id] = append(report.Layers[id], err) } else { report.ROLayers[id] = append(report.ROLayers[id], err) } } }() } } // Check that we don't have any dangling parent layer references. for id, parent := range report.layerParentsByLayerID { // If this layer doesn't have a parent, no problem. if parent == "" { continue } // If we've already seen a layer with this parent ID, skip it. if _, checked := referencedLayers[parent]; checked { continue } if _, checked := referencedROLayers[parent]; checked { continue } // We haven't seen a layer with the ID that this layer's record // says is its parent's ID. err := fmt.Errorf("%slayer %s: %w", readWriteDesc, parent, ErrLayerMissing) report.Layers[id] = append(report.Layers[id], err) } return struct{}{}, false, nil }); err != nil { return CheckReport{}, err } // This map will track examined images. If we have multiple stores, read-only ones can // contain copies of images that are also in the read-write store, or the read-write store // may contain a duplicate entry that refers to layers in the read-only stores, but when // trying to export them, we only look at the first copy of the image. examinedImages := make(map[string]struct{}) // Walk the list of image stores, looking at each image that we didn't see in a // previously-visited store. if _, _, err := readAllImageStores(s, func(store roImageStore) (struct{}, bool, error) { images, err := store.Images() if err != nil { return struct{}{}, true, err } isReadWrite := roImageStoreIsReallyReadWrite(store) readWriteDesc := "" if !isReadWrite { readWriteDesc = "read-only " } // Examine each image in turn. for i := range images { image := images[i] id := image.ID // If we've already seen an image with this ID, skip it. if _, checked := examinedImages[id]; checked { continue } examinedImages[id] = struct{}{} logrus.Debugf("checking %simage %s", readWriteDesc, id) if options.ImageData { // Check that all of the big data items are present and reading them // back gives us the right amount of data. Even though we record // digests that can be used to look them up, we don't know how they // were calculated (they're only used as lookup keys), so do not try // to check them. for _, key := range image.BigDataNames { func() { data, err := store.BigData(id, key) if err != nil { if errors.Is(err, os.ErrNotExist) { err = fmt.Errorf("%simage %s: data item %q: %w", readWriteDesc, id, key, ErrImageDataMissing) if isReadWrite { report.Images[id] = append(report.Images[id], err) } else { report.ROImages[id] = append(report.ROImages[id], err) } return } err = fmt.Errorf("%simage %s: data item %q: %w", readWriteDesc, id, key, err) if isReadWrite { report.Images[id] = append(report.Images[id], err) } else { report.ROImages[id] = append(report.ROImages[id], err) } return } if int64(len(data)) != image.BigDataSizes[key] { err = fmt.Errorf("%simage %s: data item %q: %w", readWriteDesc, id, key, ErrImageDataIncorrectSize) if isReadWrite { report.Images[id] = append(report.Images[id], err) } else { report.ROImages[id] = append(report.ROImages[id], err) } return } }() } } // Walk the layers list for the image. For every layer that the image uses // that has errors, the layer's errors are also the image's errors. examinedImageLayers := make(map[string]struct{}) for _, topLayer := range append([]string{image.TopLayer}, image.MappedTopLayers...) { if topLayer == "" { continue } if _, checked := examinedImageLayers[topLayer]; checked { continue } examinedImageLayers[topLayer] = struct{}{} for layer := topLayer; layer != ""; layer = report.layerParentsByLayerID[layer] { // The referenced layer should have a corresponding entry in // one map or the other. _, checked := referencedLayers[layer] _, checkedRO := referencedROLayers[layer] if !checked && !checkedRO { err := fmt.Errorf("layer %s: %w", layer, ErrImageLayerMissing) err = fmt.Errorf("%simage %s: %w", readWriteDesc, id, err) if isReadWrite { report.Images[id] = append(report.Images[id], err) } else { report.ROImages[id] = append(report.ROImages[id], err) } } else { // Count this layer as referenced. Whether by the // image or one of its child layers doesn't matter // at this point. if _, ok := referencedLayers[layer]; ok { referencedLayers[layer] = true } if _, ok := referencedROLayers[layer]; ok { referencedROLayers[layer] = true } } if isReadWrite { if len(report.Layers[layer]) > 0 { report.Images[id] = append(report.Images[id], report.Layers[layer]...) } if len(report.ROLayers[layer]) > 0 { report.Images[id] = append(report.Images[id], report.ROLayers[layer]...) } } else { if len(report.Layers[layer]) > 0 { report.ROImages[id] = append(report.ROImages[id], report.Layers[layer]...) } if len(report.ROLayers[layer]) > 0 { report.ROImages[id] = append(report.ROImages[id], report.ROLayers[layer]...) } } } } } return struct{}{}, false, nil }); err != nil { return CheckReport{}, err } // Iterate over each container in turn. if _, _, err := readContainerStore(s, func() (struct{}, bool, error) { containers, err := s.containerStore.Containers() if err != nil { return struct{}{}, true, err } for i := range containers { container := containers[i] id := container.ID logrus.Debugf("checking container %s", id) if options.ContainerData { // Check that all of the big data items are present and reading them // back gives us the right amount of data. for _, key := range container.BigDataNames { func() { data, err := s.containerStore.BigData(id, key) if err != nil { if errors.Is(err, os.ErrNotExist) { err = fmt.Errorf("container %s: data item %q: %w", id, key, ErrContainerDataMissing) report.Containers[id] = append(report.Containers[id], err) return } err = fmt.Errorf("container %s: data item %q: %w", id, key, err) report.Containers[id] = append(report.Containers[id], err) return } if int64(len(data)) != container.BigDataSizes[key] { err = fmt.Errorf("container %s: data item %q: %w", id, key, ErrContainerDataIncorrectSize) report.Containers[id] = append(report.Containers[id], err) return } }() } } // Look at the container's base image. If the image has errors, the image's errors // are the container's errors. if container.ImageID != "" { if _, checked := examinedImages[container.ImageID]; !checked { err := fmt.Errorf("image %s: %w", container.ImageID, ErrContainerImageMissing) report.Containers[id] = append(report.Containers[id], err) } if len(report.Images[container.ImageID]) > 0 { report.Containers[id] = append(report.Containers[id], report.Images[container.ImageID]...) } if len(report.ROImages[container.ImageID]) > 0 { report.Containers[id] = append(report.Containers[id], report.ROImages[container.ImageID]...) } } // Count the container's layer as referenced. if container.LayerID != "" { referencedLayers[container.LayerID] = true } } return struct{}{}, false, nil }); err != nil { return CheckReport{}, err } // Now go back through all of the layer stores, and flag any layers which don't belong // to an image or a container, and has been around longer than we can reasonably expect // such a layer to be present before a corresponding image record is added. if _, _, err := readAllLayerStores(s, func(store roLayerStore) (struct{}, bool, error) { if isReadWrite := roLayerStoreIsReallyReadWrite(store); !isReadWrite { return struct{}{}, false, nil } layers, err := store.Layers() if err != nil { return struct{}{}, true, err } for _, layer := range layers { maximumAge := defaultMaximumUnreferencedLayerAge if options.LayerUnreferencedMaximumAge != nil { maximumAge = *options.LayerUnreferencedMaximumAge } if referenced := referencedLayers[layer.ID]; !referenced { if layer.Created.IsZero() || layer.Created.Add(maximumAge).Before(time.Now()) { // Either we don't (and never will) know when this layer was // created, or it was created far enough in the past that we're // reasonably sure it's not part of an image that's being written // right now. err := fmt.Errorf("layer %s: %w", layer.ID, ErrLayerUnreferenced) report.Layers[layer.ID] = append(report.Layers[layer.ID], err) } } } return struct{}{}, false, nil }); err != nil { return CheckReport{}, err } // If the driver can tell us about which layers it knows about, we should have previously // examined all of them. Any that we didn't are probably just wasted space. // Note: if the driver doesn't support enumerating layers, it returns ErrNotSupported. if err := s.startUsingGraphDriver(); err != nil { return CheckReport{}, err } defer s.stopUsingGraphDriver() layerList, err := s.graphDriver.ListLayers() if err != nil && !errors.Is(err, drivers.ErrNotSupported) { return CheckReport{}, err } if !errors.Is(err, drivers.ErrNotSupported) { for i, id := range layerList { if _, known := referencedLayers[id]; !known { err := fmt.Errorf("layer %s: %w", id, ErrLayerUnaccounted) report.Layers[id] = append(report.Layers[id], err) } report.layerOrder[id] = i + 1 } } return report, nil } func roLayerStoreIsReallyReadWrite(store roLayerStore) bool { return store.(*layerStore).lockfile.IsReadWrite() } func roImageStoreIsReallyReadWrite(store roImageStore) bool { return store.(*imageStore).lockfile.IsReadWrite() } // Repair removes items which are themselves damaged, or which depend on items which are damaged. // Errors are returned if an attempt to delete an item fails. func (s *store) Repair(report CheckReport, options *RepairOptions) []error { if options == nil { options = RepairEverything() } var errs []error // Just delete damaged containers. if options.RemoveContainers { for id := range report.Containers { err := s.DeleteContainer(id) if err != nil && !errors.Is(err, ErrContainerUnknown) { err := fmt.Errorf("deleting container %s: %w", id, err) errs = append(errs, err) } } } // Now delete damaged images. Note which layers were removed as part of removing those images. deletedLayers := make(map[string]struct{}) for id := range report.Images { layers, err := s.DeleteImage(id, true) if err != nil { if !errors.Is(err, ErrImageUnknown) && !errors.Is(err, ErrLayerUnknown) { err := fmt.Errorf("deleting image %s: %w", id, err) errs = append(errs, err) } } else { for _, layer := range layers { logrus.Debugf("deleted layer %s", layer) deletedLayers[layer] = struct{}{} } logrus.Debugf("deleted image %s", id) } } // Build a list of the layers that we need to remove, sorted with parents of layers before // layers that they are parents of. layersToDelete := make([]string, 0, len(report.Layers)) for id := range report.Layers { layersToDelete = append(layersToDelete, id) } depth := func(id string) int { d := 0 parent := report.layerParentsByLayerID[id] for parent != "" { d++ parent = report.layerParentsByLayerID[parent] } return d } isUnaccounted := func(errs []error) bool { return slices.ContainsFunc(errs, func(err error) bool { return errors.Is(err, ErrLayerUnaccounted) }) } slices.SortFunc(layersToDelete, func(a, b string) int { // we've not heard of either of them, so remove them in the order the driver suggested if isUnaccounted(report.Layers[a]) && isUnaccounted(report.Layers[b]) && report.layerOrder[a] != 0 && report.layerOrder[b] != 0 { return cmp.Compare(report.layerOrder[a], report.layerOrder[b]) } // always delete the one we've heard of first if isUnaccounted(report.Layers[a]) && !isUnaccounted(report.Layers[b]) { return 1 } // always delete the one we've heard of first if !isUnaccounted(report.Layers[a]) && isUnaccounted(report.Layers[b]) { return -1 } // we've heard of both of them; the one that's on the end of a longer chain goes first return -cmp.Compare(depth(a), depth(b)) // closer-to-a-notional-base layers get removed later }) // Now delete the layers that haven't been removed along with images. for _, id := range layersToDelete { if _, ok := deletedLayers[id]; ok { continue } for _, reportedErr := range report.Layers[id] { var err error // If a layer was unaccounted for, remove it at the storage driver level. // Otherwise, remove it at the higher level and let the higher level // logic worry about telling the storage driver to delete the layer. if errors.Is(reportedErr, ErrLayerUnaccounted) { if err = s.graphDriver.Remove(id); err != nil { err = fmt.Errorf("deleting storage layer %s: %v", id, err) } else { logrus.Debugf("deleted storage layer %s", id) } } else { var stillMounted bool if stillMounted, err = s.Unmount(id, true); err == nil && !stillMounted { logrus.Debugf("unmounted layer %s", id) } else if err != nil { logrus.Debugf("unmounting layer %s: %v", id, err) } else { logrus.Debugf("layer %s still mounted", id) } if err = s.DeleteLayer(id); err != nil { err = fmt.Errorf("deleting layer %s: %w", id, err) logrus.Debugf("deleted layer %s", id) } } if err != nil && !errors.Is(err, ErrLayerUnknown) && !errors.Is(err, ErrNotALayer) && !errors.Is(err, os.ErrNotExist) { errs = append(errs, err) } } } return errs } // compareFileInfo returns a string summarizing what's different between the two checkFileInfos func compareFileInfo(a, b checkFileInfo, idmap *idtools.IDMappings, ignore checkIgnore) string { var comparison []string if a.typeflag != b.typeflag && !ignore.filetype { comparison = append(comparison, fmt.Sprintf("filetype:%v→%v", a.typeflag, b.typeflag)) } if idmap != nil && !idmap.Empty() { mappedUID, mappedGID, err := idmap.ToContainer(idtools.IDPair{UID: b.uid, GID: b.gid}) if err != nil { return err.Error() } b.uid, b.gid = mappedUID, mappedGID } if a.uid != b.uid && !ignore.ownership { comparison = append(comparison, fmt.Sprintf("uid:%d→%d", a.uid, b.uid)) } if a.gid != b.gid && !ignore.ownership { comparison = append(comparison, fmt.Sprintf("gid:%d→%d", a.gid, b.gid)) } if a.size != b.size { comparison = append(comparison, fmt.Sprintf("size:%d→%d", a.size, b.size)) } if (os.ModeType|os.ModePerm)&a.mode != (os.ModeType|os.ModePerm)&b.mode && !ignore.permissions { comparison = append(comparison, fmt.Sprintf("mode:%04o→%04o", a.mode, b.mode)) } if a.mtime != b.mtime && !ignore.timestamps { comparison = append(comparison, fmt.Sprintf("mtime:0x%x→0x%x", a.mtime, b.mtime)) } return strings.Join(comparison, ",") } // checkFileInfo is what we care about for files type checkFileInfo struct { typeflag byte uid, gid int size int64 mode os.FileMode mtime int64 // unix-style whole seconds } // checkDirectory is a node in a filesystem record, possibly the top type checkDirectory struct { directory map[string]*checkDirectory // subdirectories file map[string]checkFileInfo // non-directories checkFileInfo } // newCheckDirectory creates an empty checkDirectory func newCheckDirectory(uid, gid int, size int64, mode os.FileMode, mtime int64) *checkDirectory { return &checkDirectory{ directory: make(map[string]*checkDirectory), file: make(map[string]checkFileInfo), checkFileInfo: checkFileInfo{ typeflag: tar.TypeDir, uid: uid, gid: gid, size: size, mode: mode, mtime: mtime, }, } } // newCheckDirectoryDefaults creates an empty checkDirectory with hardwired defaults for the UID // (0), GID (0), size (0) and permissions (0o555) func newCheckDirectoryDefaults() *checkDirectory { return newCheckDirectory(0, 0, 0, 0o555, time.Now().Unix()) } // newCheckDirectoryFromDirectory creates a checkDirectory for an on-disk directory tree func newCheckDirectoryFromDirectory(dir string) (*checkDirectory, error) { cd := newCheckDirectoryDefaults() err := filepath.Walk(dir, func(walkpath string, info os.FileInfo, err error) error { if err != nil && !errors.Is(err, os.ErrNotExist) { return err } rel, err := filepath.Rel(dir, walkpath) if err != nil { return err } hdr, err := tar.FileInfoHeader(info, "") // we don't record link targets, so don't bother looking it up if err != nil { return err } hdr.Name = filepath.ToSlash(rel) cd.header(hdr) return nil }) if err != nil { return nil, err } return cd, nil } // add adds an item to a checkDirectory func (c *checkDirectory) add(path string, typeflag byte, uid, gid int, size int64, mode os.FileMode, mtime int64) { components := strings.Split(path, "/") if components[len(components)-1] == "" { components = components[:len(components)-1] } if components[0] == "." { components = components[1:] } if typeflag != tar.TypeReg { size = 0 } switch len(components) { case 0: c.uid = uid c.gid = gid c.mode = mode c.mtime = mtime return case 1: switch typeflag { case tar.TypeDir: delete(c.file, components[0]) // directory entries are mergers, not replacements if _, present := c.directory[components[0]]; !present { c.directory[components[0]] = newCheckDirectory(uid, gid, size, mode, mtime) } else { c.directory[components[0]].checkFileInfo = checkFileInfo{ typeflag: tar.TypeDir, uid: uid, gid: gid, size: size, mode: mode, mtime: mtime, } } case tar.TypeXGlobalHeader: // ignore, since even though it looks like a valid pathname, it doesn't end // up on the filesystem default: // treat these as TypeReg items delete(c.directory, components[0]) c.file[components[0]] = checkFileInfo{ typeflag: typeflag, uid: uid, gid: gid, size: size, mode: mode, mtime: mtime, } } return } subdirectory := c.directory[components[0]] if subdirectory == nil { subdirectory = newCheckDirectory(uid, gid, size, mode, mtime) c.directory[components[0]] = subdirectory } subdirectory.add(strings.Join(components[1:], "/"), typeflag, uid, gid, size, mode, mtime) } // remove removes an item from a checkDirectory func (c *checkDirectory) remove(path string) { parent, rest, ok := strings.Cut(path, "/") if !ok { delete(c.directory, parent) delete(c.file, parent) return } subdirectory := c.directory[parent] if subdirectory != nil { subdirectory.remove(rest) } } // header updates a checkDirectory using information from the passed-in header func (c *checkDirectory) header(hdr *tar.Header) { name := path.Clean(hdr.Name) dir, base := path.Split(name) if file, ok := strings.CutPrefix(base, archive.WhiteoutPrefix); ok { if base == archive.WhiteoutOpaqueDir { c.remove(path.Clean(dir)) c.add(path.Clean(dir), tar.TypeDir, hdr.Uid, hdr.Gid, hdr.Size, os.FileMode(hdr.Mode), hdr.ModTime.Unix()) } else { c.remove(path.Join(dir, file)) } } else { if hdr.Typeflag == tar.TypeLink { // look up the attributes of the target of the hard link // n.b. by convention, Linkname is always relative to the // root directory of the archive, which is not always the // same as being relative to hdr.Name directory := c for component := range strings.SplitSeq(path.Clean(hdr.Linkname), "/") { if component == "." || component == ".." { continue } if subdir, ok := directory.directory[component]; ok { directory = subdir continue } if file, ok := directory.file[component]; ok { hdr.Typeflag = file.typeflag hdr.Uid = file.uid hdr.Gid = file.gid hdr.Size = file.size hdr.Mode = int64(file.mode) hdr.ModTime = time.Unix(file.mtime, 0) } break } } c.add(name, hdr.Typeflag, hdr.Uid, hdr.Gid, hdr.Size, os.FileMode(hdr.Mode), hdr.ModTime.Unix()) } } // headers updates a checkDirectory using information from the passed-in header slice func (c *checkDirectory) headers(hdrs []*tar.Header) { hdrs = slices.Clone(hdrs) // sort the headers from the diff to ensure that whiteouts appear // before content when they both appear in the same directory, per // https://github.com/opencontainers/image-spec/blob/main/layer.md#whiteouts // and that hard links appear after other types of entries slices.SortStableFunc(hdrs, func(a, b *tar.Header) int { if a.Typeflag != tar.TypeLink && b.Typeflag == tar.TypeLink { return -1 } if a.Typeflag == tar.TypeLink && b.Typeflag != tar.TypeLink { return 1 } adir, afile := path.Split(a.Name) bdir, bfile := path.Split(b.Name) if adir != bdir { return cmp.Compare(a.Name, b.Name) } if afile == archive.WhiteoutOpaqueDir { return -1 } if strings.HasPrefix(afile, archive.WhiteoutPrefix) && !strings.HasPrefix(bfile, archive.WhiteoutPrefix) { return -1 } return 0 }) for _, hdr := range hdrs { c.header(hdr) } } // names provides a sorted list of the path names in the directory tree func (c *checkDirectory) names() []string { names := make([]string, 0, len(c.file)+len(c.directory)) for name := range c.file { names = append(names, name) } for name, subdirectory := range c.directory { names = append(names, name+"/") for _, subname := range subdirectory.names() { names = append(names, name+"/"+subname) } } return names } // compareCheckSubdirectory walks two subdirectory trees and returns a list of differences func compareCheckSubdirectory(path string, a, b *checkDirectory, idmap *idtools.IDMappings, ignore checkIgnore) []string { var diff []string if a == nil { a = newCheckDirectoryDefaults() } if b == nil { b = newCheckDirectoryDefaults() } for aname, adir := range a.directory { if bdir, present := b.directory[aname]; !present { // directory was removed diff = append(diff, "-"+path+"/"+aname+"/") diff = append(diff, compareCheckSubdirectory(path+"/"+aname, adir, nil, idmap, ignore)...) } else { // directory is in both trees; descend if attributes := compareFileInfo(adir.checkFileInfo, bdir.checkFileInfo, idmap, ignore); attributes != "" { diff = append(diff, path+"/"+aname+"("+attributes+")") } diff = append(diff, compareCheckSubdirectory(path+"/"+aname, adir, bdir, idmap, ignore)...) } } for bname, bdir := range b.directory { if _, present := a.directory[bname]; !present { // directory added diff = append(diff, "+"+path+"/"+bname+"/") diff = append(diff, compareCheckSubdirectory(path+"/"+bname, nil, bdir, idmap, ignore)...) } } for aname, afile := range a.file { if bfile, present := b.file[aname]; !present { // non-directory removed or replaced diff = append(diff, "-"+path+"/"+aname) } else { // item is in both trees; compare if attributes := compareFileInfo(afile, bfile, idmap, ignore); attributes != "" { diff = append(diff, path+"/"+aname+"("+attributes+")") } } } for bname := range b.file { filetype, present := a.file[bname] if !present { // non-directory added or replaced with something else diff = append(diff, "+"+path+"/"+bname) continue } if attributes := compareFileInfo(filetype, b.file[bname], idmap, ignore); attributes != "" { // non-directory replaced with non-directory diff = append(diff, "+"+path+"/"+bname+"("+attributes+")") } } return diff } // compareCheckDirectory walks two directory trees and returns a sorted list of differences func compareCheckDirectory(a, b *checkDirectory, idmap *idtools.IDMappings, ignore checkIgnore) []string { diff := compareCheckSubdirectory("", a, b, idmap, ignore) slices.SortFunc(diff, func(a, b string) int { if a[1:] < b[1:] { return -1 } if a[0] == '-' { return -1 } return 1 }) return diff } ================================================ FILE: vendor/go.podman.io/storage/containers.go ================================================ package storage import ( "errors" "fmt" "os" "path/filepath" "slices" "sync" "time" digest "github.com/opencontainers/go-digest" "github.com/sirupsen/logrus" "go.podman.io/storage/pkg/idtools" "go.podman.io/storage/pkg/ioutils" "go.podman.io/storage/pkg/lockfile" "go.podman.io/storage/pkg/stringid" "go.podman.io/storage/pkg/truncindex" ) type containerLocations uint8 // The backing store is split in two json files, one (the volatile) // that is written without fsync() meaning it isn't as robust to // unclean shutdown const ( stableContainerLocation containerLocations = 1 << iota volatileContainerLocation numContainerLocationIndex = iota ) func containerLocationFromIndex(index int) containerLocations { return 1 << index } // A Container is a reference to a read-write layer with metadata. type Container struct { // ID is either one which was specified at create-time, or a random // value which was generated by the library. ID string `json:"id"` // Names is an optional set of user-defined convenience values. The // container can be referred to by its ID or any of its names. Names // are unique among containers. Names []string `json:"names,omitempty"` // ImageID is the ID of the image which was used to create the container. ImageID string `json:"image"` // LayerID is the ID of the read-write layer for the container itself. // It is assumed that the image's top layer is the parent of the container's // read-write layer. LayerID string `json:"layer"` // Metadata is data we keep for the convenience of the caller. It is not // expected to be large, since it is kept in memory. Metadata string `json:"metadata,omitempty"` // BigDataNames is a list of names of data items that we keep for the // convenience of the caller. They can be large, and are only in // memory when being read from or written to disk. BigDataNames []string `json:"big-data-names,omitempty"` // BigDataSizes maps the names in BigDataNames to the sizes of the data // that has been stored, if they're known. BigDataSizes map[string]int64 `json:"big-data-sizes,omitempty"` // BigDataDigests maps the names in BigDataNames to the digests of the // data that has been stored, if they're known. BigDataDigests map[string]digest.Digest `json:"big-data-digests,omitempty"` // Created is the datestamp for when this container was created. Older // versions of the library did not track this information, so callers // will likely want to use the IsZero() method to verify that a value // is set before using it. Created time.Time `json:"created"` // UIDMap and GIDMap are used for setting up a container's root // filesystem for use inside of a user namespace where UID mapping is // being used. UIDMap []idtools.IDMap `json:"uidmap,omitempty"` GIDMap []idtools.IDMap `json:"gidmap,omitempty"` Flags map[string]any `json:"flags,omitempty"` // volatileStore is true if the container is from the volatile json file volatileStore bool `json:"-"` } // rwContainerStore provides bookkeeping for information about Containers. type rwContainerStore interface { metadataStore containerBigDataStore flaggableStore // startWriting makes sure the store is fresh, and locks it for writing. // If this succeeds, the caller MUST call stopWriting(). startWriting() error // stopWriting releases locks obtained by startWriting. stopWriting() // startReading makes sure the store is fresh, and locks it for reading. // If this succeeds, the caller MUST call stopReading(). startReading() error // stopReading releases locks obtained by startReading. stopReading() // create creates a container that has a specified ID (or generates a // random one if an empty value is supplied) and optional names, // based on the specified image, using the specified layer as its // read-write layer. // The maps in the container's options structure are recorded for the // convenience of the caller, nothing more. create(id string, names []string, image, layer string, options *ContainerOptions) (*Container, error) // updateNames modifies names associated with a container based on (op, names). updateNames(id string, names []string, op updateNameOperation) error // Get retrieves information about a container given an ID or name. Get(id string) (*Container, error) // Exists checks if there is a container with the given ID or name. Exists(id string) bool // Delete removes the record of the container. Delete(id string) error // Wipe removes records of all containers. Wipe() error // Lookup attempts to translate a name to an ID. Most methods do this // implicitly. Lookup(name string) (string, error) // Containers returns a slice enumerating the known containers. Containers() ([]Container, error) // Clean up unreferenced datadirs GarbageCollect() error } type containerStore struct { // The following fields are only set when constructing containerStore, and must never be modified afterwards. // They are safe to access without any other locking. lockfile *lockfile.LockFile // Synchronizes readers vs. writers of the _filesystem data_, both cross-process and in-process. dir string jsonPath [numContainerLocationIndex]string inProcessLock sync.RWMutex // Can _only_ be obtained with lockfile held. // The following fields can only be read/written with read/write ownership of inProcessLock, respectively. // Almost all users should use startReading() or startWriting(). lastWrite lockfile.LastWrite containers []*Container idindex *truncindex.TruncIndex byid map[string]*Container bylayer map[string]*Container byname map[string]*Container } func copyContainer(c *Container) *Container { return &Container{ ID: c.ID, Names: copySlicePreferringNil(c.Names), ImageID: c.ImageID, LayerID: c.LayerID, Metadata: c.Metadata, BigDataNames: copySlicePreferringNil(c.BigDataNames), BigDataSizes: copyMapPreferringNil(c.BigDataSizes), BigDataDigests: copyMapPreferringNil(c.BigDataDigests), Created: c.Created, UIDMap: copySlicePreferringNil(c.UIDMap), GIDMap: copySlicePreferringNil(c.GIDMap), Flags: copyMapPreferringNil(c.Flags), volatileStore: c.volatileStore, } } func (c *Container) MountLabel() string { if label, ok := c.Flags[mountLabelFlag].(string); ok { return label } return "" } func (c *Container) ProcessLabel() string { if label, ok := c.Flags[processLabelFlag].(string); ok { return label } return "" } func (c *Container) MountOpts() []string { switch value := c.Flags[mountOptsFlag].(type) { case []string: return value case []any: var mountOpts []string for _, v := range value { if flag, ok := v.(string); ok { mountOpts = append(mountOpts, flag) } } return mountOpts default: return nil } } // The caller must hold r.inProcessLock for reading. func containerLocation(c *Container) containerLocations { if c.volatileStore { return volatileContainerLocation } return stableContainerLocation } // startWritingWithReload makes sure the store is fresh if canReload, and locks it for writing. // If this succeeds, the caller MUST call stopWriting(). // // This is an internal implementation detail of containerStore construction, every other caller // should use startWriting() instead. func (r *containerStore) startWritingWithReload(canReload bool) error { r.lockfile.Lock() r.inProcessLock.Lock() succeeded := false defer func() { if !succeeded { r.inProcessLock.Unlock() r.lockfile.Unlock() } }() if canReload { if _, err := r.reloadIfChanged(true); err != nil { return err } } succeeded = true return nil } // startWriting makes sure the store is fresh, and locks it for writing. // If this succeeds, the caller MUST call stopWriting(). func (r *containerStore) startWriting() error { return r.startWritingWithReload(true) } // stopWriting releases locks obtained by startWriting. func (r *containerStore) stopWriting() { r.inProcessLock.Unlock() r.lockfile.Unlock() } // startReading makes sure the store is fresh, and locks it for reading. // If this succeeds, the caller MUST call stopReading(). func (r *containerStore) startReading() error { // inProcessLocked calls the nested function with r.inProcessLock held for writing. inProcessLocked := func(fn func() error) error { r.inProcessLock.Lock() defer r.inProcessLock.Unlock() return fn() } r.lockfile.RLock() unlockFn := r.lockfile.Unlock // A function to call to clean up, or nil. defer func() { if unlockFn != nil { unlockFn() } }() r.inProcessLock.RLock() unlockFn = r.stopReading // If we are lucky, we can just hold the read locks, check that we are fresh, and continue. _, modified, err := r.modified() if err != nil { return err } if modified { // We are unlucky, and need to reload. // NOTE: Multiple goroutines can get to this place approximately simultaneously. r.inProcessLock.RUnlock() unlockFn = r.lockfile.Unlock // r.lastWrite can change at this point if another goroutine reloads the store before us. That’s why we don’t unconditionally // trigger a load below; we (lock and) reloadIfChanged() again. // First try reloading with r.lockfile held for reading. // r.inProcessLock will serialize all goroutines that got here; // each will re-check on-disk state vs. r.lastWrite, and the first one will actually reload the data. var tryLockedForWriting bool if err := inProcessLocked(func() error { // We could optimize this further: The r.lockfile.GetLastWrite() value shouldn’t change as long as we hold r.lockfile, // so if r.lastWrite was already updated, we don’t need to actually read the on-filesystem lock. var err error tryLockedForWriting, err = r.reloadIfChanged(false) return err }); err != nil { if !tryLockedForWriting { return err } // Not good enough, we need r.lockfile held for writing. So, let’s do that. unlockFn() unlockFn = nil r.lockfile.Lock() unlockFn = r.lockfile.Unlock if err := inProcessLocked(func() error { _, err := r.reloadIfChanged(true) return err }); err != nil { return err } unlockFn() unlockFn = nil r.lockfile.RLock() unlockFn = r.lockfile.Unlock // We need to check for a reload once more because the on-disk state could have been modified // after we released the lock. // If that, _again_, finds inconsistent state, just give up. // We could, plausibly, retry a few times, but that inconsistent state (duplicate container names) // shouldn’t be saved (by correct implementations) in the first place. if err := inProcessLocked(func() error { _, err := r.reloadIfChanged(false) return err }); err != nil { return fmt.Errorf("(even after successfully cleaning up once:) %w", err) } } // NOTE that we hold neither a read nor write inProcessLock at this point. That’s fine in ordinary operation, because // the on-filesystem r.lockfile should protect us against (cooperating) writers, and any use of r.inProcessLock // protects us against in-process writers modifying data. // In presence of non-cooperating writers, we just ensure that 1) the in-memory data is not clearly out-of-date // and 2) access to the in-memory data is not racy; // but we can’t protect against those out-of-process writers modifying _files_ while we are assuming they are in a consistent state. r.inProcessLock.RLock() } unlockFn = nil return nil } // stopReading releases locks obtained by startReading. func (r *containerStore) stopReading() { r.inProcessLock.RUnlock() r.lockfile.Unlock() } // modified returns true if the on-disk state has changed (i.e. if reloadIfChanged may need to modify the store), // and a lockfile.LastWrite value for that update. // // The caller must hold r.lockfile for reading _or_ writing. // The caller must hold r.inProcessLock for reading or writing. func (r *containerStore) modified() (lockfile.LastWrite, bool, error) { return r.lockfile.ModifiedSince(r.lastWrite) } // reloadIfChanged reloads the contents of the store from disk if it is changed. // // The caller must hold r.lockfile for reading _or_ writing; lockedForWriting is true // if it is held for writing. // // The caller must hold r.inProcessLock for WRITING. // // If !lockedForWriting and this function fails, the return value indicates whether // reloadIfChanged() with lockedForWriting could succeed. func (r *containerStore) reloadIfChanged(lockedForWriting bool) (bool, error) { lastWrite, modified, err := r.modified() if err != nil { return false, err } // We require callers to always hold r.inProcessLock for WRITING, even if they might not end up calling r.load() // and modify no fields, to ensure they see fresh data: // r.lockfile.Modified() only returns true once per change. Without an exclusive lock, // one goroutine might see r.lockfile.Modified() == true and decide to load, and in the meanwhile another one could // see r.lockfile.Modified() == false and proceed to use in-memory data without noticing it is stale. if modified { if tryLockedForWriting, err := r.load(lockedForWriting); err != nil { return tryLockedForWriting, err // r.lastWrite is unchanged, so we will load the next time again. } r.lastWrite = lastWrite } return false, nil } // Requires startReading or startWriting. func (r *containerStore) Containers() ([]Container, error) { containers := make([]Container, len(r.containers)) for i := range r.containers { containers[i] = *copyContainer(r.containers[i]) } return containers, nil } // This looks for datadirs in the store directory that are not referenced // by the json file and removes it. These can happen in the case of unclean // shutdowns or regular restarts in transient store mode. // Requires startReading. func (r *containerStore) GarbageCollect() error { entries, err := os.ReadDir(r.dir) if err != nil { // Unexpected, don't try any GC return err } for _, entry := range entries { id := entry.Name() // Does it look like a datadir directory? if !entry.IsDir() || stringid.ValidateID(id) != nil { continue } // Should the id be there? if r.byid[id] != nil { continue } // Otherwise remove datadir logrus.Debugf("removing %q", filepath.Join(r.dir, id)) moreErr := os.RemoveAll(filepath.Join(r.dir, id)) // Propagate first error if moreErr != nil && err == nil { err = moreErr } } return err } func (r *containerStore) datadir(id string) string { return filepath.Join(r.dir, id) } func (r *containerStore) datapath(id, key string) string { return filepath.Join(r.datadir(id), makeBigDataBaseName(key)) } // load reloads the contents of the store from disk. // // Most callers should call reloadIfChanged() instead, to avoid overhead and to correctly // manage r.lastWrite. // // The caller must hold r.lockfile for reading _or_ writing; lockedForWriting is true // if it is held for writing. // The caller must hold r.inProcessLock for WRITING. // // If !lockedForWriting and this function fails, the return value indicates whether // retrying with lockedForWriting could succeed. func (r *containerStore) load(lockedForWriting bool) (bool, error) { var modifiedLocations containerLocations containers := []*Container{} ids := make(map[string]*Container) for locationIndex := range numContainerLocationIndex { location := containerLocationFromIndex(locationIndex) rpath := r.jsonPath[locationIndex] data, err := os.ReadFile(rpath) if err != nil && !os.IsNotExist(err) { return false, err } locationContainers := []*Container{} if len(data) != 0 { if err := json.Unmarshal(data, &locationContainers); err != nil { return false, fmt.Errorf("loading %q: %w", rpath, err) } } for _, container := range locationContainers { // There should be no duplicated ids between json files, but lets check to be sure if ids[container.ID] != nil { continue // skip invalid duplicated container } // Remember where the container came from if location == volatileContainerLocation { container.volatileStore = true } containers = append(containers, container) ids[container.ID] = container } } idlist := make([]string, 0, len(containers)) layers := make(map[string]*Container) names := make(map[string]*Container) var errorToResolveBySaving error // == nil for n, container := range containers { idlist = append(idlist, container.ID) layers[container.LayerID] = containers[n] for _, name := range container.Names { if conflict, ok := names[name]; ok { r.removeName(conflict, name) errorToResolveBySaving = errors.New("container store is inconsistent and the current caller does not hold a write lock") modifiedLocations |= containerLocation(container) } names[name] = containers[n] } } r.containers = containers r.idindex = truncindex.NewTruncIndex(idlist) // Invalid values in idlist are ignored: they are not a reason to refuse processing the whole store. r.byid = ids r.bylayer = layers r.byname = names if errorToResolveBySaving != nil { if !lockedForWriting { return true, errorToResolveBySaving } return false, r.save(modifiedLocations) } return false, nil } // save saves the contents of the store to disk. // The caller must hold r.lockfile locked for writing. // The caller must hold r.inProcessLock for reading (but usually holds it for writing in order to make the desired changes). func (r *containerStore) save(saveLocations containerLocations) error { r.lockfile.AssertLockedForWriting() // This must be done before we write the file, because the process could be terminated // after the file is written but before the lock file is updated. lw, err := r.lockfile.RecordWrite() if err != nil { return err } r.lastWrite = lw for locationIndex := range numContainerLocationIndex { location := containerLocationFromIndex(locationIndex) if location&saveLocations == 0 { continue } rpath := r.jsonPath[locationIndex] if err := os.MkdirAll(filepath.Dir(rpath), 0o700); err != nil { return err } subsetContainers := make([]*Container, 0, len(r.containers)) for _, container := range r.containers { if containerLocation(container) == location { subsetContainers = append(subsetContainers, container) } } jdata, err := json.Marshal(&subsetContainers) if err != nil { return err } var opts *ioutils.AtomicFileWriterOptions if location == volatileContainerLocation { opts = &ioutils.AtomicFileWriterOptions{ NoSync: true, } } if err := ioutils.AtomicWriteFileWithOpts(rpath, jdata, 0o600, opts); err != nil { return err } } return nil } // saveFor saves the contents of the store relevant for modifiedContainer to disk. // The caller must hold r.lockfile locked for writing. // The caller must hold r.inProcessLock for reading (but usually holds it for writing in order to make the desired changes). func (r *containerStore) saveFor(modifiedContainer *Container) error { return r.save(containerLocation(modifiedContainer)) } func newContainerStore(dir string, runDir string, transient bool) (rwContainerStore, error) { if err := os.MkdirAll(dir, 0o700); err != nil { return nil, err } volatileDir := dir if transient { if err := os.MkdirAll(runDir, 0o700); err != nil { return nil, err } volatileDir = runDir } lockfile, err := lockfile.GetLockFile(filepath.Join(volatileDir, "containers.lock")) if err != nil { return nil, err } cstore := containerStore{ lockfile: lockfile, dir: dir, jsonPath: [numContainerLocationIndex]string{ filepath.Join(dir, "containers.json"), filepath.Join(volatileDir, "volatile-containers.json"), }, containers: []*Container{}, byid: make(map[string]*Container), bylayer: make(map[string]*Container), byname: make(map[string]*Container), } if err := cstore.startWritingWithReload(false); err != nil { return nil, err } cstore.lastWrite, err = cstore.lockfile.GetLastWrite() if err != nil { return nil, err } defer cstore.stopWriting() if _, err := cstore.load(true); err != nil { return nil, err } return &cstore, nil } // Requires startReading or startWriting. func (r *containerStore) lookup(id string) (*Container, bool) { if container, ok := r.byid[id]; ok { return container, ok } else if container, ok := r.byname[id]; ok { return container, ok } else if container, ok := r.bylayer[id]; ok { return container, ok } else if longid, err := r.idindex.Get(id); err == nil { if container, ok := r.byid[longid]; ok { return container, ok } } return nil, false } // Requires startWriting. func (r *containerStore) ClearFlag(id string, flag string) error { container, ok := r.lookup(id) if !ok { return ErrContainerUnknown } delete(container.Flags, flag) return r.saveFor(container) } // Requires startWriting. func (r *containerStore) SetFlag(id string, flag string, value any) error { container, ok := r.lookup(id) if !ok { return ErrContainerUnknown } if container.Flags == nil { container.Flags = make(map[string]any) } container.Flags[flag] = value return r.saveFor(container) } // Requires startWriting. func (r *containerStore) create(id string, names []string, image, layer string, options *ContainerOptions) (container *Container, err error) { if options == nil { options = &ContainerOptions{} } if id == "" { id = stringid.GenerateRandomID() _, idInUse := r.byid[id] for idInUse { id = stringid.GenerateRandomID() _, idInUse = r.byid[id] } } if _, idInUse := r.byid[id]; idInUse { return nil, ErrDuplicateID } names = dedupeStrings(names) for _, name := range names { if _, nameInUse := r.byname[name]; nameInUse { return nil, fmt.Errorf("the container name %q is already in use by %s. You have to remove that container to be able to reuse that name: %w", name, r.byname[name].ID, ErrDuplicateName) } } if err := hasOverlappingRanges(options.UIDMap); err != nil { return nil, err } if err := hasOverlappingRanges(options.GIDMap); err != nil { return nil, err } container = &Container{ ID: id, Names: names, ImageID: image, LayerID: layer, Metadata: options.Metadata, BigDataNames: []string{}, BigDataSizes: make(map[string]int64), BigDataDigests: make(map[string]digest.Digest), Created: time.Now().UTC(), Flags: newMapFrom(options.Flags), UIDMap: copySlicePreferringNil(options.UIDMap), GIDMap: copySlicePreferringNil(options.GIDMap), volatileStore: options.Volatile, } if options.MountOpts != nil { container.Flags[mountOptsFlag] = slices.Clone(options.MountOpts) } if options.Volatile { container.Flags[volatileFlag] = true } r.containers = append(r.containers, container) // This can only fail on duplicate IDs, which shouldn’t happen — and in // that case the index is already in the desired state anyway. // Implementing recovery from an unlikely and unimportant failure here // would be too risky. _ = r.idindex.Add(id) r.byid[id] = container r.bylayer[layer] = container for _, name := range names { r.byname[name] = container } defer func() { if err != nil { // now that the in-memory structures know about the new // record, we can use regular Delete() to clean up if // anything breaks from here on out if e := r.Delete(id); e != nil { logrus.Debugf("while cleaning up partially-created container %q we failed to create: %v", id, e) } } }() err = r.saveFor(container) if err != nil { return nil, err } for _, item := range options.BigData { if err = r.SetBigData(id, item.Key, item.Data); err != nil { return nil, err } } container = copyContainer(container) return container, err } // Requires startReading or startWriting. func (r *containerStore) Metadata(id string) (string, error) { if container, ok := r.lookup(id); ok { return container.Metadata, nil } return "", ErrContainerUnknown } // Requires startWriting. func (r *containerStore) SetMetadata(id, metadata string) error { if container, ok := r.lookup(id); ok { container.Metadata = metadata return r.saveFor(container) } return ErrContainerUnknown } // The caller must hold r.inProcessLock for writing. func (r *containerStore) removeName(container *Container, name string) { container.Names = stringSliceWithoutValue(container.Names, name) } // Requires startWriting. func (r *containerStore) updateNames(id string, names []string, op updateNameOperation) error { container, ok := r.lookup(id) if !ok { return ErrContainerUnknown } oldNames := container.Names names, err := applyNameOperation(oldNames, names, op) if err != nil { return err } for _, name := range oldNames { delete(r.byname, name) } for _, name := range names { if otherContainer, ok := r.byname[name]; ok { r.removeName(otherContainer, name) } r.byname[name] = container } container.Names = names return r.saveFor(container) } // Requires startWriting. func (r *containerStore) Delete(id string) error { container, ok := r.lookup(id) if !ok { return ErrContainerUnknown } id = container.ID delete(r.byid, id) // This can only fail if the ID is already missing, which shouldn’t happen — and in that case the index is already in the desired state anyway. // The store’s Delete method is used on various paths to recover from failures, so this should be robust against partially missing data. _ = r.idindex.Delete(id) delete(r.bylayer, container.LayerID) for _, name := range container.Names { delete(r.byname, name) } r.containers = slices.DeleteFunc(r.containers, func(candidate *Container) bool { return candidate.ID == id }) if err := r.saveFor(container); err != nil { return err } if err := os.RemoveAll(r.datadir(id)); err != nil { return err } return nil } // Requires startReading or startWriting. func (r *containerStore) Get(id string) (*Container, error) { if container, ok := r.lookup(id); ok { return copyContainer(container), nil } return nil, ErrContainerUnknown } // Requires startReading or startWriting. func (r *containerStore) Lookup(name string) (id string, err error) { if container, ok := r.lookup(name); ok { return container.ID, nil } return "", ErrContainerUnknown } // Requires startReading or startWriting. func (r *containerStore) Exists(id string) bool { _, ok := r.lookup(id) return ok } // Requires startReading or startWriting. func (r *containerStore) BigData(id, key string) ([]byte, error) { if key == "" { return nil, fmt.Errorf("can't retrieve container big data value for empty name: %w", ErrInvalidBigDataName) } c, ok := r.lookup(id) if !ok { return nil, ErrContainerUnknown } return os.ReadFile(r.datapath(c.ID, key)) } // Requires startWriting. Yes, really, WRITING (see SetBigData). func (r *containerStore) BigDataSize(id, key string) (int64, error) { if key == "" { return -1, fmt.Errorf("can't retrieve size of container big data with empty name: %w", ErrInvalidBigDataName) } c, ok := r.lookup(id) if !ok { return -1, ErrContainerUnknown } if size, ok := c.BigDataSizes[key]; ok { // This is valid, and returns ok == false, for BigDataSizes == nil. return size, nil } if data, err := r.BigData(id, key); err == nil && data != nil { if err = r.SetBigData(id, key, data); err == nil { c, ok := r.lookup(id) if !ok { return -1, ErrContainerUnknown } if size, ok := c.BigDataSizes[key]; ok { return size, nil } } else { return -1, err } } return -1, ErrSizeUnknown } // Requires startWriting. Yes, really, WRITING (see SetBigData). func (r *containerStore) BigDataDigest(id, key string) (digest.Digest, error) { if key == "" { return "", fmt.Errorf("can't retrieve digest of container big data value with empty name: %w", ErrInvalidBigDataName) } c, ok := r.lookup(id) if !ok { return "", ErrContainerUnknown } if d, ok := c.BigDataDigests[key]; ok { // This is valid, and returns ok == false, for BigDataSizes == nil. return d, nil } if data, err := r.BigData(id, key); err == nil && data != nil { if err = r.SetBigData(id, key, data); err == nil { c, ok := r.lookup(id) if !ok { return "", ErrContainerUnknown } if d, ok := c.BigDataDigests[key]; ok { return d, nil } } else { return "", err } } return "", ErrDigestUnknown } // Requires startReading or startWriting. func (r *containerStore) BigDataNames(id string) ([]string, error) { c, ok := r.lookup(id) if !ok { return nil, ErrContainerUnknown } return copySlicePreferringNil(c.BigDataNames), nil } // Requires startWriting. func (r *containerStore) SetBigData(id, key string, data []byte) error { if key == "" { return fmt.Errorf("can't set empty name for container big data item: %w", ErrInvalidBigDataName) } c, ok := r.lookup(id) if !ok { return ErrContainerUnknown } if err := os.MkdirAll(r.datadir(c.ID), 0o700); err != nil { return err } err := ioutils.AtomicWriteFile(r.datapath(c.ID, key), data, 0o600) if err == nil { save := false if c.BigDataSizes == nil { c.BigDataSizes = make(map[string]int64) } oldSize, sizeOk := c.BigDataSizes[key] c.BigDataSizes[key] = int64(len(data)) if c.BigDataDigests == nil { c.BigDataDigests = make(map[string]digest.Digest) } oldDigest, digestOk := c.BigDataDigests[key] newDigest := digest.Canonical.FromBytes(data) c.BigDataDigests[key] = newDigest if !sizeOk || oldSize != c.BigDataSizes[key] || !digestOk || oldDigest != newDigest { save = true } if !slices.Contains(c.BigDataNames, key) { c.BigDataNames = append(c.BigDataNames, key) save = true } if save { err = r.saveFor(c) } } return err } // Requires startWriting. func (r *containerStore) Wipe() error { ids := make([]string, 0, len(r.byid)) for id := range r.byid { ids = append(ids, id) } for _, id := range ids { if err := r.Delete(id); err != nil { return err } } return nil } ================================================ FILE: vendor/go.podman.io/storage/deprecated.go ================================================ package storage import ( "io" "time" digest "github.com/opencontainers/go-digest" drivers "go.podman.io/storage/drivers" "go.podman.io/storage/pkg/archive" ) // The type definitions in this file exist ONLY to maintain formal API compatibility. // DO NOT ADD ANY NEW METHODS TO THESE INTERFACES. // ROFileBasedStore is a deprecated interface with no documented way to use it from callers outside of c/storage. // // Deprecated: There is no way to use this from any external user of c/storage to invoke c/storage functionality. type ROFileBasedStore interface { Locker Load() error ReloadIfChanged() error } // RWFileBasedStore is a deprecated interface with no documented way to use it from callers outside of c/storage. // // Deprecated: There is no way to use this from any external user of c/storage to invoke c/storage functionality. type RWFileBasedStore interface { Save() error } // FileBasedStore is a deprecated interface with no documented way to use it from callers outside of c/storage. // // Deprecated: There is no way to use this from any external user of c/storage to invoke c/storage functionality. type FileBasedStore interface { ROFileBasedStore RWFileBasedStore } // ROMetadataStore is a deprecated interface with no documented way to use it from callers outside of c/storage. // // Deprecated: There is no way to use this from any external user of c/storage to invoke c/storage functionality. type ROMetadataStore interface { Metadata(id string) (string, error) } // RWMetadataStore is a deprecated interface with no documented way to use it from callers outside of c/storage. // // Deprecated: There is no way to use this from any external user of c/storage to invoke c/storage functionality. type RWMetadataStore interface { SetMetadata(id, metadata string) error } // MetadataStore is a deprecated interface with no documented way to use it from callers outside of c/storage. // // Deprecated: There is no way to use this from any external user of c/storage to invoke c/storage functionality. type MetadataStore interface { ROMetadataStore RWMetadataStore } // ROBigDataStore is a deprecated interface with no documented way to use it from callers outside of c/storage. // // Deprecated: There is no way to use this from any external user of c/storage to invoke c/storage functionality. type ROBigDataStore interface { BigData(id, key string) ([]byte, error) BigDataSize(id, key string) (int64, error) BigDataDigest(id, key string) (digest.Digest, error) BigDataNames(id string) ([]string, error) } // RWImageBigDataStore is a deprecated interface with no documented way to use it from callers outside of c/storage. // // Deprecated: There is no way to use this from any external user of c/storage to invoke c/storage functionality. type RWImageBigDataStore interface { SetBigData(id, key string, data []byte, digestManifest func([]byte) (digest.Digest, error)) error } // ContainerBigDataStore is a deprecated interface with no documented way to use it from callers outside of c/storage. // // Deprecated: There is no way to use this from any external user of c/storage to invoke c/storage functionality. type ContainerBigDataStore interface { ROBigDataStore SetBigData(id, key string, data []byte) error } // ROLayerBigDataStore is a deprecated interface with no documented way to use it from callers outside of c/storage. // // Deprecated: There is no way to use this from any external user of c/storage to invoke c/storage functionality. type ROLayerBigDataStore interface { BigData(id, key string) (io.ReadCloser, error) BigDataNames(id string) ([]string, error) } // RWLayerBigDataStore is a deprecated interface with no documented way to use it from callers outside of c/storage. // // Deprecated: There is no way to use this from any external user of c/storage to invoke c/storage functionality. type RWLayerBigDataStore interface { SetBigData(id, key string, data io.Reader) error } // LayerBigDataStore is a deprecated interface with no documented way to use it from callers outside of c/storage. // // Deprecated: There is no way to use this from any external user of c/storage to invoke c/storage functionality. type LayerBigDataStore interface { ROLayerBigDataStore RWLayerBigDataStore } // FlaggableStore is a deprecated interface with no documented way to use it from callers outside of c/storage. // // Deprecated: There is no way to use this from any external user of c/storage to invoke c/storage functionality. type FlaggableStore interface { ClearFlag(id string, flag string) error SetFlag(id string, flag string, value any) error } // ContainerStore is a deprecated interface with no documented way to use it from callers outside of c/storage. // // Deprecated: There is no way to use this from any external user of c/storage to invoke c/storage functionality. type ContainerStore interface { FileBasedStore MetadataStore ContainerBigDataStore FlaggableStore Create(id string, names []string, image, layer, metadata string, options *ContainerOptions) (*Container, error) SetNames(id string, names []string) error AddNames(id string, names []string) error RemoveNames(id string, names []string) error Get(id string) (*Container, error) Exists(id string) bool Delete(id string) error Wipe() error Lookup(name string) (string, error) Containers() ([]Container, error) } // ROImageStore is a deprecated interface with no documented way to use it from callers outside of c/storage. // // Deprecated: There is no way to use this from any external user of c/storage to invoke c/storage functionality. type ROImageStore interface { ROFileBasedStore ROMetadataStore ROBigDataStore Exists(id string) bool Get(id string) (*Image, error) Lookup(name string) (string, error) Images() ([]Image, error) ByDigest(d digest.Digest) ([]*Image, error) } // ImageStore is a deprecated interface with no documented way to use it from callers outside of c/storage. // // Deprecated: There is no way to use this from any external user of c/storage to invoke c/storage functionality. type ImageStore interface { ROImageStore RWFileBasedStore RWMetadataStore RWImageBigDataStore FlaggableStore Create(id string, names []string, layer, metadata string, created time.Time, searchableDigest digest.Digest) (*Image, error) SetNames(id string, names []string) error AddNames(id string, names []string) error RemoveNames(id string, names []string) error Delete(id string) error Wipe() error } // ROLayerStore is a deprecated interface with no documented way to use it from callers outside of c/storage. // // Deprecated: There is no way to use this from any external user of c/storage to invoke c/storage functionality. type ROLayerStore interface { ROFileBasedStore ROMetadataStore ROLayerBigDataStore Exists(id string) bool Get(id string) (*Layer, error) Status() ([][2]string, error) Changes(from, to string) ([]archive.Change, error) Diff(from, to string, options *DiffOptions) (io.ReadCloser, error) DiffSize(from, to string) (int64, error) Size(name string) (int64, error) Lookup(name string) (string, error) LayersByCompressedDigest(d digest.Digest) ([]Layer, error) LayersByUncompressedDigest(d digest.Digest) ([]Layer, error) Layers() ([]Layer, error) } // LayerStore is a deprecated interface with no documented way to use it from callers outside of c/storage. // // Deprecated: There is no way to use this from any external user of c/storage to invoke c/storage functionality. type LayerStore interface { ROLayerStore RWFileBasedStore RWMetadataStore FlaggableStore RWLayerBigDataStore Create(id string, parent *Layer, names []string, mountLabel string, options map[string]string, moreOptions *LayerOptions, writeable bool) (*Layer, error) CreateWithFlags(id string, parent *Layer, names []string, mountLabel string, options map[string]string, moreOptions *LayerOptions, writeable bool, flags map[string]any) (layer *Layer, err error) Put(id string, parent *Layer, names []string, mountLabel string, options map[string]string, moreOptions *LayerOptions, writeable bool, flags map[string]any, diff io.Reader) (*Layer, int64, error) SetNames(id string, names []string) error AddNames(id string, names []string) error RemoveNames(id string, names []string) error Delete(id string) error Wipe() error Mount(id string, options drivers.MountOpts) (string, error) Unmount(id string, force bool) (bool, error) Mounted(id string) (int, error) ParentOwners(id string) (uids, gids []int, err error) ApplyDiff(to string, diff io.Reader) (int64, error) DifferTarget(id string) (string, error) LoadLocked() error PutAdditionalLayer(id string, parentLayer *Layer, names []string, aLayer drivers.AdditionalLayer) (layer *Layer, err error) } ================================================ FILE: vendor/go.podman.io/storage/drivers/btrfs/btrfs.go ================================================ //go:build linux && cgo package btrfs /* #include #include // keep struct field name compatible with btrfs-progs < 6.1. #define max_referenced max_rfer #include #include static void set_name_btrfs_ioctl_vol_args_v2(struct btrfs_ioctl_vol_args_v2* btrfs_struct, const char* value) { snprintf(btrfs_struct->name, BTRFS_SUBVOL_NAME_MAX, "%s", value); } */ import "C" import ( "fmt" "io/fs" "math" "os" "path" "path/filepath" "strconv" "strings" "sync" "unsafe" "github.com/docker/go-units" "github.com/opencontainers/selinux/go-selinux/label" "github.com/sirupsen/logrus" graphdriver "go.podman.io/storage/drivers" "go.podman.io/storage/internal/tempdir" "go.podman.io/storage/pkg/directory" "go.podman.io/storage/pkg/fileutils" "go.podman.io/storage/pkg/idtools" "go.podman.io/storage/pkg/mount" "go.podman.io/storage/pkg/parsers" "go.podman.io/storage/pkg/system" "golang.org/x/sys/unix" ) const defaultPerms = os.FileMode(0o555) func init() { graphdriver.MustRegister("btrfs", Init) } type btrfsOptions struct { minSpace uint64 size uint64 } // Init returns a new BTRFS driver. // An error is returned if BTRFS is not supported. func Init(home string, options graphdriver.Options) (graphdriver.Driver, error) { fsMagic, err := graphdriver.GetFSMagic(home) if err != nil { return nil, err } if fsMagic != graphdriver.FsMagicBtrfs { return nil, fmt.Errorf("%q is not on a btrfs filesystem: %w", home, graphdriver.ErrPrerequisites) } if err := os.MkdirAll(filepath.Join(home, "subvolumes"), 0o700); err != nil { return nil, err } if err := mount.MakePrivate(home); err != nil { return nil, err } opt, userDiskQuota, err := parseOptions(options.DriverOptions) if err != nil { return nil, err } driver := &Driver{ home: home, options: opt, } if userDiskQuota { if err := driver.enableQuota(); err != nil { return nil, err } } return graphdriver.NewNaiveDiffDriver(driver, graphdriver.NewNaiveLayerIDMapUpdater(driver)), nil } func parseOptions(opt []string) (btrfsOptions, bool, error) { var options btrfsOptions userDiskQuota := false for _, option := range opt { key, val, err := parsers.ParseKeyValueOpt(option) if err != nil { return options, userDiskQuota, err } key = strings.ToLower(key) switch key { case "btrfs.min_space": minSpace, err := units.RAMInBytes(val) if err != nil { return options, userDiskQuota, err } userDiskQuota = true options.minSpace = uint64(minSpace) case "btrfs.mountopt": return options, userDiskQuota, fmt.Errorf("btrfs driver does not support mount options") default: return options, userDiskQuota, fmt.Errorf("unknown option %s (%q)", key, option) } } return options, userDiskQuota, nil } // Driver contains information about the filesystem mounted. type Driver struct { // root of the file system home string options btrfsOptions quotaEnabled bool once sync.Once } // String prints the name of the driver (btrfs). func (d *Driver) String() string { return "btrfs" } // Status returns current driver information in a two dimensional string array. // Output contains "Build Version" and "Library Version" of the btrfs libraries used. // Version information can be used to check compatibility with your kernel. func (d *Driver) Status() [][2]string { status := [][2]string{} if bv := btrfsBuildVersion(); bv != "-" { status = append(status, [2]string{"Build Version", bv}) } if lv := btrfsLibVersion(); lv != -1 { status = append(status, [2]string{"Library Version", fmt.Sprintf("%d", lv)}) } return status } // Metadata returns empty metadata for this driver. func (d *Driver) Metadata(id string) (map[string]string, error) { return nil, nil //nolint: nilnil } // Cleanup unmounts the home directory. func (d *Driver) Cleanup() error { return mount.Unmount(d.home) } func free(p *C.char) { C.free(unsafe.Pointer(p)) } func openDir(path string) (*C.DIR, error) { Cpath := C.CString(path) defer free(Cpath) dir := C.opendir(Cpath) if dir == nil { return nil, fmt.Errorf("can't open dir %s", path) } return dir, nil } func closeDir(dir *C.DIR) { if dir != nil { C.closedir(dir) } } func getDirFd(dir *C.DIR) uintptr { return uintptr(C.dirfd(dir)) } func subvolCreate(path, name string) error { dir, err := openDir(path) if err != nil { return err } defer closeDir(dir) var args C.struct_btrfs_ioctl_vol_args for i, c := range []byte(name) { args.name[i] = C.char(c) } _, _, errno := unix.Syscall(unix.SYS_IOCTL, getDirFd(dir), C.BTRFS_IOC_SUBVOL_CREATE, uintptr(unsafe.Pointer(&args))) if errno != 0 { return fmt.Errorf("failed to create btrfs subvolume: %w", errno) } return nil } func subvolSnapshot(src, dest, name string) error { srcDir, err := openDir(src) if err != nil { return err } defer closeDir(srcDir) destDir, err := openDir(dest) if err != nil { return err } defer closeDir(destDir) var args C.struct_btrfs_ioctl_vol_args_v2 args.fd = C.__s64(getDirFd(srcDir)) cs := C.CString(name) C.set_name_btrfs_ioctl_vol_args_v2(&args, cs) C.free(unsafe.Pointer(cs)) _, _, errno := unix.Syscall(unix.SYS_IOCTL, getDirFd(destDir), C.BTRFS_IOC_SNAP_CREATE_V2, uintptr(unsafe.Pointer(&args))) if errno != 0 { return fmt.Errorf("failed to create btrfs snapshot: %w", errno) } return nil } func isSubvolume(p string) (bool, error) { var bufStat unix.Stat_t if err := unix.Lstat(p, &bufStat); err != nil { return false, err } // return true if it is a btrfs subvolume return bufStat.Ino == C.BTRFS_FIRST_FREE_OBJECTID, nil } func subvolDelete(dirpath, name string, quotaEnabled bool) error { dir, err := openDir(dirpath) if err != nil { return err } defer closeDir(dir) fullPath := path.Join(dirpath, name) var args C.struct_btrfs_ioctl_vol_args // walk the btrfs subvolumes walkSubvolumes := func(p string, d fs.DirEntry, err error) error { if err != nil { if os.IsNotExist(err) && p != fullPath { // missing most likely because the path was a subvolume that got removed in the previous iteration // since it's gone anyway, we don't care return nil } return fmt.Errorf("walking subvolumes: %w", err) } // we want to check children only so skip itself // it will be removed after the filepath walk anyways if d.IsDir() && p != fullPath { sv, err := isSubvolume(p) if err != nil { return fmt.Errorf("failed to test if %s is a btrfs subvolume: %w", p, err) } if sv { if err := subvolDelete(path.Dir(p), d.Name(), quotaEnabled); err != nil { return fmt.Errorf("failed to destroy btrfs child subvolume (%s) of parent (%s): %w", p, dirpath, err) } } } return nil } if err := filepath.WalkDir(path.Join(dirpath, name), walkSubvolumes); err != nil { return fmt.Errorf("recursively walking subvolumes for %s failed: %w", dirpath, err) } if quotaEnabled { if qgroupid, err := subvolLookupQgroup(fullPath); err == nil { var args C.struct_btrfs_ioctl_qgroup_create_args args.qgroupid = C.__u64(qgroupid) _, _, errno := unix.Syscall(unix.SYS_IOCTL, getDirFd(dir), C.BTRFS_IOC_QGROUP_CREATE, uintptr(unsafe.Pointer(&args))) if errno != 0 { logrus.Errorf("Failed to delete btrfs qgroup %v for %s: %v", qgroupid, fullPath, errno.Error()) } } else { logrus.Errorf("Failed to lookup btrfs qgroup for %s: %v", fullPath, err.Error()) } } // all subvolumes have been removed // now remove the one originally passed in for i, c := range []byte(name) { args.name[i] = C.char(c) } _, _, errno := unix.Syscall(unix.SYS_IOCTL, getDirFd(dir), C.BTRFS_IOC_SNAP_DESTROY, uintptr(unsafe.Pointer(&args))) if errno != 0 { return fmt.Errorf("failed to destroy btrfs snapshot %s for %s: %w", dirpath, name, errno) } return nil } func (d *Driver) updateQuotaStatus() { d.once.Do(func() { if !d.quotaEnabled { // In case quotaEnabled is not set, check qgroup and update quotaEnabled as needed if err := qgroupStatus(d.home); err != nil { // quota is still not enabled return } d.quotaEnabled = true } }) } func (d *Driver) enableQuota() error { d.updateQuotaStatus() if d.quotaEnabled { return nil } dir, err := openDir(d.home) if err != nil { return err } defer closeDir(dir) var args C.struct_btrfs_ioctl_quota_ctl_args args.cmd = C.BTRFS_QUOTA_CTL_ENABLE _, _, errno := unix.Syscall(unix.SYS_IOCTL, getDirFd(dir), C.BTRFS_IOC_QUOTA_CTL, uintptr(unsafe.Pointer(&args))) if errno != 0 { return fmt.Errorf("failed to enable btrfs quota for %s: %w", dir, errno) } d.quotaEnabled = true return nil } func (d *Driver) subvolRescanQuota() error { d.updateQuotaStatus() if !d.quotaEnabled { return nil } dir, err := openDir(d.home) if err != nil { return err } defer closeDir(dir) var args C.struct_btrfs_ioctl_quota_rescan_args _, _, errno := unix.Syscall(unix.SYS_IOCTL, getDirFd(dir), C.BTRFS_IOC_QUOTA_RESCAN_WAIT, uintptr(unsafe.Pointer(&args))) if errno != 0 { return fmt.Errorf("failed to rescan btrfs quota for %s: %w", dir, errno) } return nil } func subvolLimitQgroup(path string, size uint64) error { dir, err := openDir(path) if err != nil { return err } defer closeDir(dir) var args C.struct_btrfs_ioctl_qgroup_limit_args args.lim.max_rfer = C.__u64(size) args.lim.flags = C.BTRFS_QGROUP_LIMIT_MAX_RFER _, _, errno := unix.Syscall(unix.SYS_IOCTL, getDirFd(dir), C.BTRFS_IOC_QGROUP_LIMIT, uintptr(unsafe.Pointer(&args))) if errno != 0 { return fmt.Errorf("failed to limit qgroup for %s: %w", dir, errno) } return nil } // qgroupStatus performs a BTRFS_IOC_TREE_SEARCH on the root path // with search key of BTRFS_QGROUP_STATUS_KEY. // In case qgroup is enabled, the returned key type will match BTRFS_QGROUP_STATUS_KEY. // For more details please see https://github.com/kdave/btrfs-progs/blob/v4.9/qgroup.c#L1035 func qgroupStatus(path string) error { dir, err := openDir(path) if err != nil { return err } defer closeDir(dir) var args C.struct_btrfs_ioctl_search_args args.key.tree_id = C.BTRFS_QUOTA_TREE_OBJECTID args.key.min_type = C.BTRFS_QGROUP_STATUS_KEY args.key.max_type = C.BTRFS_QGROUP_STATUS_KEY args.key.max_objectid = C.__u64(math.MaxUint64) args.key.max_offset = C.__u64(math.MaxUint64) args.key.max_transid = C.__u64(math.MaxUint64) args.key.nr_items = 4096 _, _, errno := unix.Syscall(unix.SYS_IOCTL, getDirFd(dir), C.BTRFS_IOC_TREE_SEARCH, uintptr(unsafe.Pointer(&args))) if errno != 0 { return fmt.Errorf("failed to search qgroup for %s: %w", path, errno) } sh := (*C.struct_btrfs_ioctl_search_header)(unsafe.Pointer(&args.buf)) if sh._type != C.BTRFS_QGROUP_STATUS_KEY { return fmt.Errorf("invalid qgroup search header type for %s: %v", path, sh._type) } return nil } func subvolLookupQgroup(path string) (uint64, error) { dir, err := openDir(path) if err != nil { return 0, err } defer closeDir(dir) var args C.struct_btrfs_ioctl_ino_lookup_args args.objectid = C.BTRFS_FIRST_FREE_OBJECTID _, _, errno := unix.Syscall(unix.SYS_IOCTL, getDirFd(dir), C.BTRFS_IOC_INO_LOOKUP, uintptr(unsafe.Pointer(&args))) if errno != 0 { return 0, fmt.Errorf("failed to lookup qgroup for %s: %w", dir, errno) } if args.treeid == 0 { return 0, fmt.Errorf("invalid qgroup id for %s: 0", dir) } return uint64(args.treeid), nil } func (d *Driver) subvolumesDir() string { return path.Join(d.home, "subvolumes") } func (d *Driver) subvolumesDirID(id string) string { return path.Join(d.subvolumesDir(), id) } func (d *Driver) quotasDir() string { return path.Join(d.home, "quotas") } func (d *Driver) quotasDirID(id string) string { return path.Join(d.quotasDir(), id) } // CreateFromTemplate creates a layer with the same contents and parent as another layer. func (d *Driver) CreateFromTemplate(id, template string, templateIDMappings *idtools.IDMappings, parent string, parentIDMappings *idtools.IDMappings, opts *graphdriver.CreateOpts, readWrite bool) error { return d.Create(id, template, opts) } // CreateReadWrite creates a layer that is writable for use as a container // file system. func (d *Driver) CreateReadWrite(id, parent string, opts *graphdriver.CreateOpts) error { return d.Create(id, parent, opts) } // Create the filesystem with given id. func (d *Driver) Create(id, parent string, opts *graphdriver.CreateOpts) error { quotas := d.quotasDir() subvolumes := d.subvolumesDir() if err := os.MkdirAll(subvolumes, 0o700); err != nil { return err } if parent == "" { if err := subvolCreate(subvolumes, id); err != nil { return err } if err := os.Chmod(path.Join(subvolumes, id), defaultPerms); err != nil { return err } } else { parentDir := d.subvolumesDirID(parent) st, err := os.Stat(parentDir) if err != nil { return err } if !st.IsDir() { return fmt.Errorf("%s: not a directory", parentDir) } if err := subvolSnapshot(parentDir, subvolumes, id); err != nil { return err } } var storageOpt map[string]string if opts != nil { storageOpt = opts.StorageOpt } if _, ok := storageOpt["size"]; ok { driver := &Driver{} if err := d.parseStorageOpt(storageOpt, driver); err != nil { return err } if err := d.setStorageSize(path.Join(subvolumes, id), driver); err != nil { return err } if err := os.MkdirAll(quotas, 0o700); err != nil { return err } if err := os.WriteFile(path.Join(quotas, id), []byte(fmt.Sprint(driver.options.size)), 0o644); err != nil { return err } } mountLabel := "" if opts != nil { mountLabel = opts.MountLabel } return label.Relabel(path.Join(subvolumes, id), mountLabel, false) } // Parse btrfs storage options func (d *Driver) parseStorageOpt(storageOpt map[string]string, driver *Driver) error { // Read size to change the subvolume disk quota per container for key, val := range storageOpt { key := strings.ToLower(key) switch key { case "size": size, err := units.RAMInBytes(val) if err != nil { return err } driver.options.size = uint64(size) default: return fmt.Errorf("unknown option %s (%q)", key, storageOpt) } } return nil } // Set btrfs storage size func (d *Driver) setStorageSize(dir string, driver *Driver) error { if driver.options.size <= 0 { return fmt.Errorf("btrfs: invalid storage size: %s", units.HumanSize(float64(driver.options.size))) } if d.options.minSpace > 0 && driver.options.size < d.options.minSpace { return fmt.Errorf("btrfs: storage size cannot be less than %s", units.HumanSize(float64(d.options.minSpace))) } if err := d.enableQuota(); err != nil { return err } if err := subvolLimitQgroup(dir, driver.options.size); err != nil { return err } return nil } // Remove the filesystem with given id. func (d *Driver) Remove(id string) error { dir := d.subvolumesDirID(id) if err := fileutils.Exists(dir); err != nil { return err } quotasDir := d.quotasDirID(id) if err := fileutils.Exists(quotasDir); err == nil { if err := os.Remove(quotasDir); err != nil { return err } } else if !os.IsNotExist(err) { return err } // Call updateQuotaStatus() to invoke status update d.updateQuotaStatus() if err := subvolDelete(d.subvolumesDir(), id, d.quotaEnabled); err != nil { if d.quotaEnabled { return err } // If quota is not enabled, fallback to rmdir syscall to delete subvolumes. // This would allow unprivileged user to delete their owned subvolumes // in kernel >= 4.18 without user_subvol_rm_alowed mount option. } if err := system.EnsureRemoveAll(dir); err != nil { return err } if err := d.subvolRescanQuota(); err != nil { return err } return nil } // Get the requested filesystem id. func (d *Driver) Get(id string, options graphdriver.MountOpts) (string, error) { dir := d.subvolumesDirID(id) st, err := os.Stat(dir) if err != nil { return "", err } for _, opt := range options.Options { if opt == "ro" { // ignore "ro" option continue } return "", fmt.Errorf("btrfs driver does not support mount options") } if !st.IsDir() { return "", fmt.Errorf("%s: not a directory", dir) } if quota, err := os.ReadFile(d.quotasDirID(id)); err == nil { if size, err := strconv.ParseUint(string(quota), 10, 64); err == nil && size >= d.options.minSpace { if err := d.enableQuota(); err != nil { return "", err } if err := subvolLimitQgroup(dir, size); err != nil { return "", err } } } return dir, nil } // Put is not implemented for BTRFS as there is no cleanup required for the id. func (d *Driver) Put(id string) error { // Get() creates no runtime resources (like e.g. mounts) // so this doesn't need to do anything. return nil } // ReadWriteDiskUsage returns the disk usage of the writable directory for the ID. // For BTRFS, it queries the subvolumes path for this ID. func (d *Driver) ReadWriteDiskUsage(id string) (*directory.DiskUsage, error) { return directory.Usage(d.subvolumesDirID(id)) } // Exists checks if the id exists in the filesystem. func (d *Driver) Exists(id string) bool { dir := d.subvolumesDirID(id) err := fileutils.Exists(dir) return err == nil } // List all of the layers known to the driver. func (d *Driver) ListLayers() ([]string, error) { entries, err := os.ReadDir(d.subvolumesDir()) if err != nil { return nil, err } results := make([]string, 0, len(entries)) for _, entry := range entries { if !entry.IsDir() { continue } results = append(results, entry.Name()) } return results, nil } // AdditionalImageStores returns additional image stores supported by the driver func (d *Driver) AdditionalImageStores() []string { return nil } // Dedup performs deduplication of the driver's storage. func (d *Driver) Dedup(req graphdriver.DedupArgs) (graphdriver.DedupResult, error) { return graphdriver.DedupResult{}, nil } // DeferredRemove is not implemented. // It calls Remove directly. func (d *Driver) DeferredRemove(id string) (tempdir.CleanupTempDirFunc, error) { return nil, d.Remove(id) } // GetTempDirRootDirs is not implemented. func (d *Driver) GetTempDirRootDirs() []string { return []string{} } ================================================ FILE: vendor/go.podman.io/storage/drivers/btrfs/dummy_unsupported.go ================================================ //go:build !linux || !cgo package btrfs ================================================ FILE: vendor/go.podman.io/storage/drivers/btrfs/version.go ================================================ //go:build linux && cgo package btrfs /* #include // around version 3.16, they did not define lib version yet #ifndef BTRFS_LIB_VERSION #define BTRFS_LIB_VERSION -1 #endif // upstream had removed it, but now it will be coming back #ifndef BTRFS_BUILD_VERSION #define BTRFS_BUILD_VERSION "-" #endif */ import "C" func btrfsBuildVersion() string { return string(C.BTRFS_BUILD_VERSION) } func btrfsLibVersion() int { return int(C.BTRFS_LIB_VERSION) } ================================================ FILE: vendor/go.podman.io/storage/drivers/chown.go ================================================ package graphdriver import ( "bytes" "errors" "fmt" "io/fs" "os" "github.com/opencontainers/selinux/pkg/pwalkdir" "go.podman.io/storage/pkg/idtools" "go.podman.io/storage/pkg/reexec" ) const ( chownByMapsCmd = "storage-chown-by-maps" ) func init() { reexec.Register(chownByMapsCmd, chownByMapsMain) } func chownByMapsMain() { if len(os.Args) < 2 { fmt.Fprintf(os.Stderr, "requires mapping configuration on stdin and directory path") os.Exit(1) } // Read and decode our configuration. discreteMaps := [4][]idtools.IDMap{} config := bytes.Buffer{} if _, err := config.ReadFrom(os.Stdin); err != nil { fmt.Fprintf(os.Stderr, "error reading configuration: %v", err) os.Exit(1) } if err := json.Unmarshal(config.Bytes(), &discreteMaps); err != nil { fmt.Fprintf(os.Stderr, "error decoding configuration: %v", err) os.Exit(1) } // Try to chroot. This may not be possible, and on some systems that // means we just Chdir() to the directory, so from here on we should be // using relative paths. if err := chrootOrChdir(os.Args[1]); err != nil { fmt.Fprintf(os.Stderr, "error chrooting to %q: %v", os.Args[1], err) os.Exit(1) } // Build the mapping objects. toContainer := idtools.NewIDMappingsFromMaps(discreteMaps[0], discreteMaps[1]) if len(toContainer.UIDs()) == 0 && len(toContainer.GIDs()) == 0 { toContainer = nil } toHost := idtools.NewIDMappingsFromMaps(discreteMaps[2], discreteMaps[3]) if len(toHost.UIDs()) == 0 && len(toHost.GIDs()) == 0 { toHost = nil } chowner := newLChowner() var chown fs.WalkDirFunc = func(path string, d fs.DirEntry, _ error) error { info, err := d.Info() if path == "." || err != nil { return nil } return chowner.LChown(path, info, toHost, toContainer) } if err := pwalkdir.Walk(".", chown); err != nil { fmt.Fprintf(os.Stderr, "error during chown: %v", err) os.Exit(1) } os.Exit(0) } // ChownPathByMaps walks the filesystem tree, changing the ownership // information using the toContainer and toHost mappings, using them to replace // on-disk owner UIDs and GIDs which are "host" values in the first map with // UIDs and GIDs for "host" values from the second map which correspond to the // same "container" IDs. func ChownPathByMaps(path string, toContainer, toHost *idtools.IDMappings) error { if toContainer == nil { toContainer = &idtools.IDMappings{} } if toHost == nil { toHost = &idtools.IDMappings{} } config, err := json.Marshal([4][]idtools.IDMap{toContainer.UIDs(), toContainer.GIDs(), toHost.UIDs(), toHost.GIDs()}) if err != nil { return err } cmd := reexec.Command(chownByMapsCmd, path) cmd.Stdin = bytes.NewReader(config) output, err := cmd.CombinedOutput() if len(output) > 0 && err != nil { return fmt.Errorf("%s: %w", string(output), err) } if err != nil { return err } if len(output) > 0 { return errors.New(string(output)) } return nil } type naiveLayerIDMapUpdater struct { ProtoDriver } // NewNaiveLayerIDMapUpdater wraps the ProtoDriver in a LayerIDMapUpdater that // uses ChownPathByMaps to update the ownerships in a layer's filesystem tree. func NewNaiveLayerIDMapUpdater(driver ProtoDriver) LayerIDMapUpdater { return &naiveLayerIDMapUpdater{ProtoDriver: driver} } // UpdateLayerIDMap walks the layer's filesystem tree, changing the ownership // information using the toContainer and toHost mappings, using them to replace // on-disk owner UIDs and GIDs which are "host" values in the first map with // UIDs and GIDs for "host" values from the second map which correspond to the // same "container" IDs. func (n *naiveLayerIDMapUpdater) UpdateLayerIDMap(id string, toContainer, toHost *idtools.IDMappings, mountLabel string) (retErr error) { driver := n.ProtoDriver options := MountOpts{ MountLabel: mountLabel, } layerFs, err := driver.Get(id, options) if err != nil { return err } defer driverPut(driver, id, &retErr) return ChownPathByMaps(layerFs, toContainer, toHost) } // SupportsShifting tells whether the driver support shifting of the UIDs/GIDs to the provided mapping in an userNS func (n *naiveLayerIDMapUpdater) SupportsShifting(uidmap, gidmap []idtools.IDMap) bool { return false } ================================================ FILE: vendor/go.podman.io/storage/drivers/chown_darwin.go ================================================ //go:build darwin package graphdriver import ( "errors" "fmt" "os" "sync" "syscall" "go.podman.io/storage/pkg/idtools" "go.podman.io/storage/pkg/system" ) type inode struct { Dev uint64 Ino uint64 } type platformChowner struct { mutex sync.Mutex inodes map[inode]bool } func newLChowner() *platformChowner { return &platformChowner{ inodes: make(map[inode]bool), } } func (c *platformChowner) LChown(path string, info os.FileInfo, toHost, toContainer *idtools.IDMappings) error { st, ok := info.Sys().(*syscall.Stat_t) if !ok { return nil } i := inode{ Dev: uint64(st.Dev), Ino: st.Ino, } c.mutex.Lock() _, found := c.inodes[i] if !found { c.inodes[i] = true } c.mutex.Unlock() if found { return nil } // Map an on-disk UID/GID pair from host to container // using the first map, then back to the host using the // second map. Skip that first step if they're 0, to // compensate for cases where a parent layer should // have had a mapped value, but didn't. uid, gid := int(st.Uid), int(st.Gid) if toContainer != nil { pair := idtools.IDPair{ UID: uid, GID: gid, } mappedUID, mappedGID, err := toContainer.ToContainer(pair) if err != nil { if (uid != 0) || (gid != 0) { return fmt.Errorf("mapping host ID pair %#v for %q to container: %w", pair, path, err) } mappedUID, mappedGID = uid, gid } uid, gid = mappedUID, mappedGID } if toHost != nil { pair := idtools.IDPair{ UID: uid, GID: gid, } mappedPair, err := toHost.ToHostOverflow(pair) if err != nil { return fmt.Errorf("mapping container ID pair %#v for %q to host: %w", pair, path, err) } uid, gid = mappedPair.UID, mappedPair.GID } if uid != int(st.Uid) || gid != int(st.Gid) { capability, err := system.Lgetxattr(path, "security.capability") if err != nil && !errors.Is(err, system.ENOTSUP) && err != system.ErrNotSupportedPlatform { return fmt.Errorf("%s: %w", os.Args[0], err) } // Make the change. if err := system.Lchown(path, uid, gid); err != nil { return fmt.Errorf("%s: %w", os.Args[0], err) } // Restore the SUID and SGID bits if they were originally set. if (info.Mode()&os.ModeSymlink == 0) && info.Mode()&(os.ModeSetuid|os.ModeSetgid) != 0 { if err := system.Chmod(path, info.Mode()); err != nil { return fmt.Errorf("%s: %w", os.Args[0], err) } } if capability != nil { if err := system.Lsetxattr(path, "security.capability", capability, 0); err != nil { return fmt.Errorf("%s: %w", os.Args[0], err) } } } return nil } ================================================ FILE: vendor/go.podman.io/storage/drivers/chown_unix.go ================================================ //go:build !windows && !darwin package graphdriver import ( "errors" "fmt" "os" "sync" "syscall" "go.podman.io/storage/pkg/idtools" "go.podman.io/storage/pkg/system" ) type inode struct { Dev uint64 Ino uint64 } type platformChowner struct { mutex sync.Mutex inodes map[inode]string } func newLChowner() *platformChowner { return &platformChowner{ inodes: make(map[inode]string), } } func (c *platformChowner) LChown(path string, info os.FileInfo, toHost, toContainer *idtools.IDMappings) error { st, ok := info.Sys().(*syscall.Stat_t) if !ok { return nil } i := inode{ Dev: uint64(st.Dev), //nolint:unconvert Ino: st.Ino, } c.mutex.Lock() oldTarget, found := c.inodes[i] if !found { c.inodes[i] = path } // If we are dealing with a file with multiple links then keep the lock until the file is // chowned to avoid a race where we link to the old version if the file is copied up. if found || st.Nlink > 1 { defer c.mutex.Unlock() } else { c.mutex.Unlock() } if found { // If the dev/inode was already chowned then create a link to the old target instead // of chowning it again. This is necessary when the underlying file system breaks // inodes on copy-up (as it is with overlay with index=off) to maintain the original // link and correct file ownership. // The target already exists so remove it before creating the link to the new target. if err := os.Remove(path); err != nil { return err } return os.Link(oldTarget, path) } // Map an on-disk UID/GID pair from host to container // using the first map, then back to the host using the // second map. Skip that first step if they're 0, to // compensate for cases where a parent layer should // have had a mapped value, but didn't. uid, gid := int(st.Uid), int(st.Gid) if toContainer != nil { pair := idtools.IDPair{ UID: uid, GID: gid, } mappedUID, mappedGID, err := toContainer.ToContainer(pair) if err != nil { if (uid != 0) || (gid != 0) { return fmt.Errorf("mapping host ID pair %#v for %q to container: %w", pair, path, err) } mappedUID, mappedGID = uid, gid } uid, gid = mappedUID, mappedGID } if toHost != nil { pair := idtools.IDPair{ UID: uid, GID: gid, } mappedPair, err := toHost.ToHostOverflow(pair) if err != nil { return fmt.Errorf("mapping container ID pair %#v for %q to host: %w", pair, path, err) } uid, gid = mappedPair.UID, mappedPair.GID } if uid != int(st.Uid) || gid != int(st.Gid) { cap, err := system.Lgetxattr(path, "security.capability") if err != nil && !errors.Is(err, system.ENOTSUP) && !errors.Is(err, system.EOVERFLOW) && err != system.ErrNotSupportedPlatform { return fmt.Errorf("%s: %w", os.Args[0], err) } // Make the change. if err := system.Lchown(path, uid, gid); err != nil { return fmt.Errorf("%s: %w", os.Args[0], err) } // Restore the SUID and SGID bits if they were originally set. if (info.Mode()&os.ModeSymlink == 0) && info.Mode()&(os.ModeSetuid|os.ModeSetgid) != 0 { if err := system.Chmod(path, info.Mode()); err != nil { return fmt.Errorf("%s: %w", os.Args[0], err) } } if cap != nil { if err := system.Lsetxattr(path, "security.capability", cap, 0); err != nil { return fmt.Errorf("%s: %w", os.Args[0], err) } } } return nil } ================================================ FILE: vendor/go.podman.io/storage/drivers/chown_windows.go ================================================ //go:build windows package graphdriver import ( "os" "syscall" "go.podman.io/storage/pkg/idtools" ) type platformChowner struct{} func newLChowner() *platformChowner { return &platformChowner{} } func (c *platformChowner) LChown(path string, info os.FileInfo, toHost, toContainer *idtools.IDMappings) error { return &os.PathError{Op: "lchown", Path: path, Err: syscall.EWINDOWS} } ================================================ FILE: vendor/go.podman.io/storage/drivers/chroot_unix.go ================================================ //go:build !windows package graphdriver import ( "fmt" "os" "syscall" ) // chrootOrChdir() is either a chdir() to the specified path, or a chroot() to the // specified path followed by chdir() to the new root directory func chrootOrChdir(path string) error { if err := syscall.Chroot(path); err != nil { return fmt.Errorf("chrooting to %q: %w", path, err) } if err := syscall.Chdir(string(os.PathSeparator)); err != nil { return fmt.Errorf("changing to %q: %w", path, err) } return nil } ================================================ FILE: vendor/go.podman.io/storage/drivers/chroot_windows.go ================================================ package graphdriver import ( "fmt" "syscall" ) // chrootOrChdir() is either a chdir() to the specified path, or a chroot() to the // specified path followed by chdir() to the new root directory func chrootOrChdir(path string) error { if err := syscall.Chdir(path); err != nil { return fmt.Errorf("changing to %q: %w", path, err) } return nil } ================================================ FILE: vendor/go.podman.io/storage/drivers/copy/copy_linux.go ================================================ //go:build cgo package copy /* #include #ifndef FICLONE #define FICLONE _IOW(0x94, 9, int) #endif */ import "C" import ( "container/list" "errors" "fmt" "io" "os" "path/filepath" "strings" "syscall" "time" "go.podman.io/storage/pkg/idtools" "go.podman.io/storage/pkg/pools" "go.podman.io/storage/pkg/system" "go.podman.io/storage/pkg/unshare" "golang.org/x/sys/unix" ) // Mode indicates whether to use hardlink or copy content type Mode int const ( // Content creates a new file, and copies the content of the file Content Mode = iota // Hardlink creates a new hardlink to the existing file Hardlink ) // CopyRegularToFile copies the content of a file to another func CopyRegularToFile(srcPath string, dstFile *os.File, fileinfo os.FileInfo, copyWithFileRange, copyWithFileClone *bool) error { //nolint: revive srcFile, err := os.Open(srcPath) if err != nil { return err } defer srcFile.Close() if *copyWithFileClone { _, _, errno := unix.Syscall(unix.SYS_IOCTL, dstFile.Fd(), C.FICLONE, srcFile.Fd()) if errno == 0 { return nil } *copyWithFileClone = false if errno == unix.EXDEV { *copyWithFileRange = false } } if *copyWithFileRange { err = doCopyWithFileRange(srcFile, dstFile, fileinfo) // Trying the file_clone may not have caught the exdev case // as the ioctl may not have been available (therefore EINVAL) if err == unix.EXDEV || err == unix.ENOSYS { *copyWithFileRange = false } else { return err } } return legacyCopy(srcFile, dstFile) } // CopyRegular copies the content of a file to another func CopyRegular(srcPath, dstPath string, fileinfo os.FileInfo, copyWithFileRange, copyWithFileClone *bool) error { //nolint: revive // If the destination file already exists, we shouldn't blow it away dstFile, err := os.OpenFile(dstPath, os.O_WRONLY|os.O_CREATE|os.O_EXCL, fileinfo.Mode()) if err != nil { return err } defer dstFile.Close() return CopyRegularToFile(srcPath, dstFile, fileinfo, copyWithFileRange, copyWithFileClone) } func doCopyWithFileRange(srcFile, dstFile *os.File, fileinfo os.FileInfo) error { amountLeftToCopy := fileinfo.Size() for amountLeftToCopy > 0 { n, err := unix.CopyFileRange(int(srcFile.Fd()), nil, int(dstFile.Fd()), nil, int(amountLeftToCopy), 0) if err != nil { return err } amountLeftToCopy = amountLeftToCopy - int64(n) } return nil } func legacyCopy(srcFile io.Reader, dstFile io.Writer) error { _, err := pools.Copy(dstFile, srcFile) return err } func copyXattr(srcPath, dstPath, attr string) error { data, err := system.Lgetxattr(srcPath, attr) if err != nil && !errors.Is(err, system.ENOTSUP) { return err } if data != nil { if err := system.Lsetxattr(dstPath, attr, data, 0); err != nil { return err } } return nil } type fileID struct { dev uint64 ino uint64 } type dirMtimeInfo struct { dstPath *string stat *syscall.Stat_t } // DirCopy copies or hardlinks the contents of one directory to another, // properly handling xattrs, and soft links // // Copying xattrs can be opted out of by passing false for copyXattrs. func DirCopy(srcDir, dstDir string, copyMode Mode, copyXattrs bool) error { copyWithFileRange := true copyWithFileClone := true // This is a map of source file inodes to dst file paths copiedFiles := make(map[fileID]string) dirsToSetMtimes := list.New() err := filepath.Walk(srcDir, func(srcPath string, f os.FileInfo, err error) error { if err != nil { return err } // Rebase path relPath, err := filepath.Rel(srcDir, srcPath) if err != nil { return err } dstPath := filepath.Join(dstDir, relPath) stat, ok := f.Sys().(*syscall.Stat_t) if !ok { return fmt.Errorf("unable to get raw syscall.Stat_t data for %s", srcPath) } isHardlink := false switch mode := f.Mode(); { case mode.IsRegular(): id := fileID{ dev: uint64(stat.Dev), //nolint:unconvert ino: stat.Ino, } if copyMode == Hardlink { isHardlink = true if err2 := os.Link(srcPath, dstPath); err2 != nil { return err2 } } else if hardLinkDstPath, ok := copiedFiles[id]; ok { if err2 := os.Link(hardLinkDstPath, dstPath); err2 != nil { return err2 } } else { if err2 := CopyRegular(srcPath, dstPath, f, ©WithFileRange, ©WithFileClone); err2 != nil { return err2 } copiedFiles[id] = dstPath } case mode.IsDir(): if err := os.Mkdir(dstPath, f.Mode()); err != nil && !os.IsExist(err) { return err } case mode&os.ModeSymlink != 0: link, err := os.Readlink(srcPath) if err != nil { return err } if err := os.Symlink(link, dstPath); err != nil { return err } case mode&os.ModeNamedPipe != 0: if err := unix.Mkfifo(dstPath, stat.Mode); err != nil { return err } case mode&os.ModeSocket != 0: if err := unix.Mknod(dstPath, stat.Mode, int(stat.Rdev)); err != nil { return err } case mode&os.ModeDevice != 0: if unshare.IsRootless() { // cannot create a device if running in user namespace return nil } if err := unix.Mknod(dstPath, stat.Mode, int(stat.Rdev)); err != nil { return err } default: return fmt.Errorf("unknown file type with mode %v for %s", mode, srcPath) } // Everything below is copying metadata from src to dst. All this metadata // already shares an inode for hardlinks. if isHardlink { return nil } if err := idtools.SafeLchown(dstPath, int(stat.Uid), int(stat.Gid)); err != nil { return err } if copyXattrs { if err := doCopyXattrs(srcPath, dstPath); err != nil { return err } } isSymlink := f.Mode()&os.ModeSymlink != 0 // There is no LChmod, so ignore mode for symlink. Also, this // must happen after chown, as that can modify the file mode if !isSymlink { if err := os.Chmod(dstPath, f.Mode()); err != nil { return err } } // system.Chtimes doesn't support a NOFOLLOW flag atm if f.IsDir() { dirsToSetMtimes.PushFront(&dirMtimeInfo{dstPath: &dstPath, stat: stat}) } else if !isSymlink { aTime := time.Unix(stat.Atim.Unix()) mTime := time.Unix(stat.Mtim.Unix()) if err := system.Chtimes(dstPath, aTime, mTime); err != nil { return err } } else { ts := []syscall.Timespec{stat.Atim, stat.Mtim} if err := system.LUtimesNano(dstPath, ts); err != nil { return err } } return nil }) if err != nil { return err } for e := dirsToSetMtimes.Front(); e != nil; e = e.Next() { mtimeInfo := e.Value.(*dirMtimeInfo) ts := []syscall.Timespec{mtimeInfo.stat.Atim, mtimeInfo.stat.Mtim} if err := system.LUtimesNano(*mtimeInfo.dstPath, ts); err != nil { return err } } return nil } func doCopyXattrs(srcPath, dstPath string) error { if err := copyXattr(srcPath, dstPath, "security.capability"); err != nil { return err } xattrs, err := system.Llistxattr(srcPath) if err != nil && !errors.Is(err, system.ENOTSUP) { return err } for _, key := range xattrs { if strings.HasPrefix(key, "user.") { if err := copyXattr(srcPath, dstPath, key); err != nil { return err } } } if unshare.IsRootless() { return nil } // We need to copy this attribute if it appears in an overlay upper layer, as // this function is used to copy those. It is set by overlay if a directory // is removed and then re-created and should not inherit anything from the // same dir in the lower dir. return copyXattr(srcPath, dstPath, "trusted.overlay.opaque") } ================================================ FILE: vendor/go.podman.io/storage/drivers/copy/copy_unsupported.go ================================================ //go:build !linux || !cgo package copy //nolint: predeclared import ( "io" "os" "go.podman.io/storage/pkg/chrootarchive" ) // Mode indicates whether to use hardlink or copy content type Mode int const ( // Content creates a new file, and copies the content of the file Content Mode = iota ) // DirCopy copies or hardlinks the contents of one directory to another, // properly handling soft links func DirCopy(srcDir, dstDir string, _ Mode, _ bool) error { return chrootarchive.NewArchiver(nil).CopyWithTar(srcDir, dstDir) } // CopyRegularToFile copies the content of a file to another func CopyRegularToFile(srcPath string, dstFile *os.File, fileinfo os.FileInfo, copyWithFileRange, copyWithFileClone *bool) error { //nolint: revive // "func name will be used as copy.CopyRegularToFile by other packages, and that stutters" f, err := os.Open(srcPath) if err != nil { return err } defer f.Close() _, err = io.Copy(dstFile, f) return err } // CopyRegular copies the content of a file to another func CopyRegular(srcPath, dstPath string, fileinfo os.FileInfo, copyWithFileRange, copyWithFileClone *bool) error { //nolint:revive // "func name will be used as copy.CopyRegular by other packages, and that stutters" return chrootarchive.NewArchiver(nil).CopyWithTar(srcPath, dstPath) } ================================================ FILE: vendor/go.podman.io/storage/drivers/counter.go ================================================ package graphdriver import "sync" type minfo struct { check bool count int } // RefCounter is a generic counter for use by graphdriver Get/Put calls type RefCounter struct { counts map[string]*minfo mu sync.Mutex checker Checker } // NewRefCounter returns a new RefCounter func NewRefCounter(c Checker) *RefCounter { return &RefCounter{ checker: c, counts: make(map[string]*minfo), } } // Increment increases the ref count for the given id and returns the current count func (c *RefCounter) Increment(path string) int { return c.incdec(path, func(minfo *minfo) { minfo.count++ }) } // Decrement decreases the ref count for the given id and returns the current count func (c *RefCounter) Decrement(path string) int { return c.incdec(path, func(minfo *minfo) { minfo.count-- }) } func (c *RefCounter) incdec(path string, infoOp func(minfo *minfo)) int { c.mu.Lock() m := c.counts[path] if m == nil { m = &minfo{} c.counts[path] = m } // if we are checking this path for the first time check to make sure // if it was already mounted on the system and make sure we have a correct ref // count if it is mounted as it is in use. if !m.check { m.check = true if c.checker.IsMounted(path) { m.count++ } } else if !c.checker.IsMounted(path) { // if the unmount was performed outside of this process (e.g. conmon cleanup) // the ref counter would lose track of it. Check if it is still mounted. m.count = 0 } infoOp(m) count := m.count if count <= 0 { // If the mounted path has been decremented enough have no references, // then its entry can be removed. delete(c.counts, path) } c.mu.Unlock() return count } ================================================ FILE: vendor/go.podman.io/storage/drivers/driver.go ================================================ package graphdriver import ( "errors" "fmt" "io" "os" "path/filepath" "strings" digest "github.com/opencontainers/go-digest" "github.com/sirupsen/logrus" "github.com/vbatts/tar-split/tar/storage" "go.podman.io/storage/internal/dedup" "go.podman.io/storage/internal/tempdir" "go.podman.io/storage/pkg/archive" "go.podman.io/storage/pkg/directory" "go.podman.io/storage/pkg/fileutils" "go.podman.io/storage/pkg/idtools" ) // FsMagic unsigned id of the filesystem in use. type FsMagic uint32 const ( // FsMagicUnsupported is a predefined constant value other than a valid filesystem id. FsMagicUnsupported = FsMagic(0x00000000) ) var ( // All registered drivers drivers map[string]InitFunc // ErrNotSupported returned when driver is not supported. ErrNotSupported = errors.New("driver not supported") // ErrPrerequisites returned when driver does not meet prerequisites. ErrPrerequisites = errors.New("prerequisites for driver not satisfied (wrong filesystem?)") // ErrIncompatibleFS returned when file system is not supported. ErrIncompatibleFS = errors.New("backing file system is unsupported for this graph driver") // ErrLayerUnknown returned when the specified layer is unknown by the driver. ErrLayerUnknown = errors.New("unknown layer") ) // CreateOpts contains optional arguments for Create() and CreateReadWrite() // methods. type CreateOpts struct { MountLabel string StorageOpt map[string]string *idtools.IDMappings } // MountOpts contains optional arguments for Driver.Get() methods. type MountOpts struct { // Mount label is the MAC Labels to assign to mount point (SELINUX) MountLabel string // UidMaps & GidMaps are the User Namespace mappings to be assigned to content in the mount point UidMaps []idtools.IDMap //nolint: revive GidMaps []idtools.IDMap //nolint: revive Options []string // Volatile specifies whether the container storage can be optimized // at the cost of not syncing all the dirty files in memory. Volatile bool // DisableShifting forces the driver to not do any ID shifting at runtime. DisableShifting bool } // ApplyDiffOpts contains optional arguments for ApplyDiff methods. type ApplyDiffOpts struct { Diff io.Reader Mappings *idtools.IDMappings MountLabel string IgnoreChownErrors bool ForceMask *os.FileMode } // ApplyDiffWithDifferOpts contains optional arguments for ApplyDiffWithDiffer methods. type ApplyDiffWithDifferOpts struct { ApplyDiffOpts Flags map[string]any } // DedupArgs contains the information to perform storage deduplication. type DedupArgs struct { // Layers is the list of layers to deduplicate. Layers []string // Options that are passed directly to the pkg/dedup.DedupDirs function. Options dedup.DedupOptions } // DedupResult contains the result of the Dedup() call. type DedupResult struct { // Deduped represents the total number of bytes saved by deduplication. // This value accounts also for all previously deduplicated data, not only the savings // from the last run. Deduped uint64 } // InitFunc initializes the storage driver. type InitFunc func(homedir string, options Options) (Driver, error) // ProtoDriver defines the basic capabilities of a driver. // This interface exists solely to be a minimum set of methods // for client code which choose not to implement the entire Driver // interface and use the NaiveDiffDriver wrapper constructor. // // Use of ProtoDriver directly by client code is not recommended. type ProtoDriver interface { // String returns a string representation of this driver. String() string // CreateReadWrite creates a new, empty filesystem layer that is ready // to be used as the storage for a container. Additional options can // be passed in opts. parent may be "" and opts may be nil. CreateReadWrite(id, parent string, opts *CreateOpts) error // Create creates a new, empty, filesystem layer with the // specified id and parent and options passed in opts. Parent // may be "" and opts may be nil. Create(id, parent string, opts *CreateOpts) error // CreateFromTemplate creates a new filesystem layer with the specified id // and parent, with contents identical to the specified template layer. CreateFromTemplate(id, template string, templateIDMappings *idtools.IDMappings, parent string, parentIDMappings *idtools.IDMappings, opts *CreateOpts, readWrite bool) error // Remove attempts to remove the filesystem layer with this id. // This is soft-deprecated and should not get any new callers; use DeferredRemove. Remove(id string) error // DeferredRemove is used to remove the filesystem layer with this id. // This removal happen immediately (the layer is no longer usable), // but physically deleting the files may be deferred. // Caller MUST call returned Cleanup function EVEN IF the function returns an error. DeferredRemove(id string) (tempdir.CleanupTempDirFunc, error) // GetTempDirRootDirs returns the root directories for temporary directories. // Multiple directories may be returned when drivers support different filesystems // for layers (e.g., overlay with imageStore vs home directory). GetTempDirRootDirs() []string // Get returns the mountpoint for the layered filesystem referred // to by this id. You can optionally specify a mountLabel or "". // Optionally it gets the mappings used to create the layer. // Returns the absolute path to the mounted layered filesystem. Get(id string, options MountOpts) (dir string, err error) // Put releases the system resources for the specified id, // e.g, unmounting layered filesystem. Put(id string) error // Exists returns whether a filesystem layer with the specified // ID exists on this driver. Exists(id string) bool // Returns a list of layer ids that exist on this driver (does not include // additional storage layers). Not supported by all backends. // If the driver requires that layers be removed in a particular order, // usually due to parent-child relationships that it cares about, The // list should be sorted well enough so that if all layers need to be // removed, they can be removed in the order in which they're returned. ListLayers() ([]string, error) // Status returns a set of key-value pairs which give low // level diagnostic status about this driver. Status() [][2]string // Returns a set of key-value pairs which give low level information // about the image/container driver is managing. Metadata(id string) (map[string]string, error) // ReadWriteDiskUsage returns the disk usage of the writable directory for the specified ID. ReadWriteDiskUsage(id string) (*directory.DiskUsage, error) // Cleanup performs necessary tasks to release resources // held by the driver, e.g., unmounting all layered filesystems // known to this driver. Cleanup() error // AdditionalImageStores returns additional image stores supported by the driver // This API is experimental and can be changed without bumping the major version number. AdditionalImageStores() []string // Dedup performs deduplication of the driver's storage. Dedup(DedupArgs) (DedupResult, error) } // DiffDriver is the interface to use to implement graph diffs type DiffDriver interface { // Diff produces an archive of the changes between the specified // layer and its parent layer which may be "". Diff(id string, idMappings *idtools.IDMappings, parent string, parentIDMappings *idtools.IDMappings, mountLabel string) (io.ReadCloser, error) // Changes produces a list of changes between the specified layer // and its parent layer. If parent is "", then all changes will be ADD changes. Changes(id string, idMappings *idtools.IDMappings, parent string, parentIDMappings *idtools.IDMappings, mountLabel string) ([]archive.Change, error) // ApplyDiff extracts the changeset from the given diff into the // layer with the specified id and parent, returning the size of the // new layer in bytes. // The io.Reader must be an uncompressed stream. ApplyDiff(id string, options ApplyDiffOpts) (size int64, err error) // DiffSize calculates the changes between the specified id // and its parent and returns the size in bytes of the changes // relative to its base filesystem directory. DiffSize(id string, idMappings *idtools.IDMappings, parent string, parentIDMappings *idtools.IDMappings, mountLabel string) (size int64, err error) } // LayerIDMapUpdater is the interface that implements ID map changes for layers. type LayerIDMapUpdater interface { // UpdateLayerIDMap walks the layer's filesystem tree, changing the ownership // information using the toContainer and toHost mappings, using them to replace // on-disk owner UIDs and GIDs which are "host" values in the first map with // UIDs and GIDs for "host" values from the second map which correspond to the // same "container" IDs. This method should only be called after a layer is // first created and populated, and before it is mounted, as other changes made // relative to a parent layer, but before this method is called, may be discarded // by Diff(). UpdateLayerIDMap(id string, toContainer, toHost *idtools.IDMappings, mountLabel string) error // SupportsShifting tells whether the driver support shifting of the UIDs/GIDs in a // image to the provided mapping and it is not required to Chown the files when running in // an user namespace. SupportsShifting(uidmap, gidmap []idtools.IDMap) bool } // Driver is the interface for layered/snapshot file system drivers. type Driver interface { ProtoDriver DiffDriver LayerIDMapUpdater } // DriverWithDifferOutput is the result of ApplyDiffWithDiffer // This API is experimental and can be changed without bumping the major version number. type DriverWithDifferOutput struct { Differ Differ Target string Size int64 // Size of the uncompressed layer, -1 if unknown. Must be known if UncompressedDigest is set. UIDs []uint32 GIDs []uint32 UncompressedDigest digest.Digest CompressedDigest digest.Digest Metadata string BigData map[string][]byte // TarSplit is owned by the [DriverWithDifferOutput], and must be closed by calling one of // [Store.ApplyStagedLayer]/[Store.CleanupStagedLayer]. It is nil if not available. TarSplit *os.File TOCDigest digest.Digest // RootDirMode is the mode of the root directory of the layer, if specified. RootDirMode *os.FileMode // Artifacts is a collection of additional artifacts // generated by the differ that the storage driver can use. Artifacts map[string]any } type DifferOutputFormat int const ( // DifferOutputFormatDir means the output is a directory and it will // keep the original layout. DifferOutputFormatDir = iota // DifferOutputFormatFlat will store the files by their checksum, per // pkg/chunked/internal/composefs.RegularFilePathForValidatedDigest. DifferOutputFormatFlat ) // DifferFsVerity is a part of the experimental Differ interface and should not be used from outside of c/storage. // It configures the fsverity requirement. type DifferFsVerity int const ( // DifferFsVerityDisabled means no fs-verity is used DifferFsVerityDisabled = iota // DifferFsVerityIfAvailable means fs-verity is used when supported by // the underlying kernel and filesystem. DifferFsVerityIfAvailable // DifferFsVerityRequired means fs-verity is required. Note this is not // currently set or exposed by the overlay driver. DifferFsVerityRequired ) // DifferOptions is a part of the experimental Differ interface and should not be used from outside of c/storage. // It overrides how the differ works. type DifferOptions struct { // Format defines the destination directory layout format Format DifferOutputFormat // UseFsVerity defines whether fs-verity is used UseFsVerity DifferFsVerity } // Differ defines the interface for using a custom differ. // This API is experimental and can be changed without bumping the major version number. type Differ interface { ApplyDiff(dest string, options *archive.TarOptions, differOpts *DifferOptions) (DriverWithDifferOutput, error) Close() error } // DriverWithDiffer is the interface for direct diff access. // This API is experimental and can be changed without bumping the major version number. type DriverWithDiffer interface { Driver // ApplyDiffWithDiffer applies the changes using the callback function. // The staging directory created by this function is guaranteed to be usable with ApplyDiffFromStagingDirectory. ApplyDiffWithDiffer(options *ApplyDiffWithDifferOpts, differ Differ) (output DriverWithDifferOutput, err error) // ApplyDiffFromStagingDirectory applies the changes using the diffOutput target directory. ApplyDiffFromStagingDirectory(id, parent string, diffOutput *DriverWithDifferOutput, options *ApplyDiffWithDifferOpts) error // CleanupStagingDirectory cleanups the staging directory. It can be used to cleanup the staging directory on errors CleanupStagingDirectory(stagingDirectory string) error // DifferTarget gets the location where files are stored for the layer. DifferTarget(id string) (string, error) } // ApplyDiffStaging is an interface for driver who can apply the diff without holding the main storage lock. // This API is experimental and can be changed without bumping the major version number. type ApplyDiffStaging interface { // StartStagingDiffToApply applies the new layer into a temporary directory. // It returns a CleanupTempDirFunc which can be nil or set regardless if the function return an error or not. // StagedAddition is only set when there is no error returned and the int64 value returns the size of the layer. // This can be done without holding the storage lock, if a parent is given the caller must check for existence // beforehand while holding a lock. StartStagingDiffToApply(parent string, options ApplyDiffOpts) (tempdir.CleanupTempDirFunc, *tempdir.StagedAddition, int64, error) // CommitStagedLayer commits the staged layer from StartStagingDiffToApply(). This must be done while holding the storage lock. CommitStagedLayer(id string, commit *tempdir.StagedAddition) error } // Capabilities defines a list of capabilities a driver may implement. // These capabilities are not required; however, they do determine how a // graphdriver can be used. type Capabilities struct { // Flags that this driver is capable of reproducing exactly equivalent // diffs for read-only layers. If set, clients can rely on the driver // for consistent tar streams, and avoid extra processing to account // for potential differences (eg: the layer store's use of tar-split). ReproducesExactDiffs bool } // CapabilityDriver is the interface for layered file system drivers that // can report on their Capabilities. type CapabilityDriver interface { Capabilities() Capabilities } // AdditionalLayer represents a layer that is stored in the additional layer store // This API is experimental and can be changed without bumping the major version number. type AdditionalLayer interface { // CreateAs creates a new layer from this additional layer CreateAs(id, parent string) error // Info returns arbitrary information stored along with this layer (i.e. `info` file) Info() (io.ReadCloser, error) // Blob returns a reader of the raw contents of this layer. Blob() (io.ReadCloser, error) // Release tells the additional layer store that we don't use this handler. Release() } // AdditionalLayerStoreDriver is the interface for driver that supports // additional layer store functionality. // This API is experimental and can be changed without bumping the major version number. type AdditionalLayerStoreDriver interface { Driver // LookupAdditionalLayer looks up additional layer store by the specified // TOC digest and ref and returns an object representing that layer. LookupAdditionalLayer(tocDigest digest.Digest, ref string) (AdditionalLayer, error) // LookupAdditionalLayer looks up additional layer store by the specified // ID and returns an object representing that layer. LookupAdditionalLayerByID(id string) (AdditionalLayer, error) } // DiffGetterDriver is the interface for layered file system drivers that // provide a specialized function for getting file contents for tar-split. type DiffGetterDriver interface { Driver // DiffGetter returns an interface to efficiently retrieve the contents // of files in a layer. DiffGetter(id string) (FileGetCloser, error) } // FileGetCloser extends the storage.FileGetter interface with a Close method // for cleaning up. type FileGetCloser interface { storage.FileGetter // Close cleans up any resources associated with the FileGetCloser. Close() error } // Checker makes checks on specified filesystems. type Checker interface { // IsMounted returns true if the provided path is mounted for the specific checker IsMounted(path string) bool } func init() { drivers = make(map[string]InitFunc) } // MustRegister registers an InitFunc for the driver, or panics. // It is suitable for package’s init() sections. func MustRegister(name string, initFunc InitFunc) { if err := Register(name, initFunc); err != nil { panic(fmt.Sprintf("failed to register containers/storage graph driver %q: %v", name, err)) } } // Register registers an InitFunc for the driver. func Register(name string, initFunc InitFunc) error { if _, exists := drivers[name]; exists { return fmt.Errorf("name already registered %s", name) } drivers[name] = initFunc return nil } // GetDriver initializes and returns the registered driver func GetDriver(name string, config Options) (Driver, error) { if initFunc, exists := drivers[name]; exists { return initFunc(filepath.Join(config.Root, name), config) } logrus.Errorf("Failed to GetDriver graph %s %s", name, config.Root) return nil, fmt.Errorf("failed to GetDriver graph %s %s: %w", name, config.Root, ErrNotSupported) } // getBuiltinDriver initializes and returns the registered driver, but does not try to load from plugins func getBuiltinDriver(name, home string, options Options) (Driver, error) { if initFunc, exists := drivers[name]; exists { return initFunc(filepath.Join(home, name), options) } logrus.Errorf("Failed to built-in GetDriver graph %s %s", name, home) return nil, fmt.Errorf("failed to built-in GetDriver graph %s %s: %w", name, home, ErrNotSupported) } // Options is used to initialize a graphdriver type Options struct { Root string RunRoot string ImageStore string DriverPriority []string DriverOptions []string ExperimentalEnabled bool } // New creates the driver and initializes it at the specified root. func New(name string, config Options) (Driver, error) { if name != "" { logrus.Debugf("[graphdriver] trying provided driver %q", name) // so the logs show specified driver return GetDriver(name, config) } // Guess for prior driver driversMap := ScanPriorDrivers(config.Root) // use the supplied priority list unless it is empty prioList := config.DriverPriority if len(prioList) == 0 { prioList = Priority } for _, name := range prioList { if name == "vfs" && len(config.DriverPriority) == 0 { // don't use vfs even if there is state present and vfs // has not been explicitly added to the override driver // priority list continue } if _, prior := driversMap[name]; prior { // of the state found from prior drivers, check in order of our priority // which we would prefer driver, err := getBuiltinDriver(name, config.Root, config) if err != nil { // unlike below, we will return error here, because there is prior // state, and now it is no longer supported/prereq/compatible, so // something changed and needs attention. Otherwise the daemon's // images would just "disappear". logrus.Errorf("[graphdriver] prior storage driver %s failed: %s", name, err) return nil, err } // abort starting when there are other prior configured drivers // to ensure the user explicitly selects the driver to load if len(driversMap)-1 > 0 { var driversSlice []string for name := range driversMap { driversSlice = append(driversSlice, name) } return nil, fmt.Errorf("%s contains several valid graphdrivers: %s; Please cleanup or explicitly choose storage driver (-s )", config.Root, strings.Join(driversSlice, ", ")) } logrus.Infof("[graphdriver] using prior storage driver: %s", name) return driver, nil } } // Check for priority drivers first for _, name := range prioList { driver, err := getBuiltinDriver(name, config.Root, config) if err != nil { if isDriverNotSupported(err) { continue } return nil, err } return driver, nil } // Check all registered drivers if no priority driver is found for name, initFunc := range drivers { driver, err := initFunc(filepath.Join(config.Root, name), config) if err != nil { if isDriverNotSupported(err) { continue } return nil, err } return driver, nil } return nil, fmt.Errorf("no supported storage backend found") } // isDriverNotSupported returns true if the error initializing // the graph driver is a non-supported error. func isDriverNotSupported(err error) bool { return errors.Is(err, ErrNotSupported) || errors.Is(err, ErrPrerequisites) || errors.Is(err, ErrIncompatibleFS) } // scanPriorDrivers returns an un-ordered scan of directories of prior storage drivers func ScanPriorDrivers(root string) map[string]bool { driversMap := make(map[string]bool) for driver := range drivers { p := filepath.Join(root, driver) if err := fileutils.Exists(p); err == nil { driversMap[driver] = true } } return driversMap } // driverPut is driver.Put, but errors are handled either by updating mainErr or just logging. // Typical usage: // // func …(…) (err error) { // … // defer driverPut(driver, id, &err) // } func driverPut(driver ProtoDriver, id string, mainErr *error) { if err := driver.Put(id); err != nil { err = fmt.Errorf("unmounting layer %s: %w", id, err) if *mainErr == nil { *mainErr = err } else { logrus.Error(err) } } } ================================================ FILE: vendor/go.podman.io/storage/drivers/driver_darwin.go ================================================ package graphdriver // Slice of drivers that should be used in order var Priority = []string{ "vfs", } // GetFSMagic returns the filesystem id given the path. func GetFSMagic(rootpath string) (FsMagic, error) { // Note it is OK to return FsMagicUnsupported on Windows. return FsMagicUnsupported, nil } ================================================ FILE: vendor/go.podman.io/storage/drivers/driver_freebsd.go ================================================ package graphdriver import ( "golang.org/x/sys/unix" "go.podman.io/storage/pkg/mount" ) const ( // FsMagicZfs filesystem id for Zfs FsMagicZfs = FsMagic(0x2fc12fc1) ) var ( // Slice of drivers that should be used in an order Priority = []string{ "zfs", "vfs", } // FsNames maps filesystem id to name of the filesystem. FsNames = map[FsMagic]string{ FsMagicZfs: "zfs", } ) // NewDefaultChecker returns a check that parses /proc/mountinfo to check // if the specified path is mounted. // No-op on FreeBSD. func NewDefaultChecker() Checker { return &defaultChecker{} } type defaultChecker struct{} func (c *defaultChecker) IsMounted(path string) bool { m, _ := mount.Mounted(path) return m } // Mounted checks if the given path is mounted as the fs type func Mounted(fsType FsMagic, mountPath string) (bool, error) { var buf unix.Statfs_t if err := unix.Statfs(mountPath, &buf); err != nil { return false, err } return FsMagic(buf.Type) == fsType, nil } ================================================ FILE: vendor/go.podman.io/storage/drivers/driver_linux.go ================================================ //go:build linux package graphdriver import ( "path/filepath" "github.com/sirupsen/logrus" "go.podman.io/storage/pkg/mount" "golang.org/x/sys/unix" ) const ( // FsMagicAufs filesystem id for Aufs FsMagicAufs = FsMagic(0x61756673) // FsMagicBtrfs filesystem id for Btrfs FsMagicBtrfs = FsMagic(0x9123683E) // FsMagicCramfs filesystem id for Cramfs FsMagicCramfs = FsMagic(0x28cd3d45) // FsMagicEcryptfs filesystem id for eCryptfs FsMagicEcryptfs = FsMagic(0xf15f) // FsMagicExtfs filesystem id for Extfs FsMagicExtfs = FsMagic(0x0000EF53) // FsMagicF2fs filesystem id for F2fs FsMagicF2fs = FsMagic(0xF2F52010) // FsMagicGPFS filesystem id for GPFS FsMagicGPFS = FsMagic(0x47504653) // FsMagicJffs2Fs filesystem if for Jffs2Fs FsMagicJffs2Fs = FsMagic(0x000072b6) // FsMagicJfs filesystem id for Jfs FsMagicJfs = FsMagic(0x3153464a) // FsMagicNfsFs filesystem id for NfsFs FsMagicNfsFs = FsMagic(0x00006969) // FsMagicRAMFs filesystem id for RamFs FsMagicRAMFs = FsMagic(0x858458f6) // FsMagicReiserFs filesystem id for ReiserFs FsMagicReiserFs = FsMagic(0x52654973) // FsMagicSmbFs filesystem id for SmbFs FsMagicSmbFs = FsMagic(0x0000517B) // FsMagicSquashFs filesystem id for SquashFs FsMagicSquashFs = FsMagic(0x73717368) // FsMagicTmpFs filesystem id for TmpFs FsMagicTmpFs = FsMagic(0x01021994) // FsMagicVxFS filesystem id for VxFs FsMagicVxFS = FsMagic(0xa501fcf5) // FsMagicXfs filesystem id for Xfs FsMagicXfs = FsMagic(0x58465342) // FsMagicZfs filesystem id for Zfs FsMagicZfs = FsMagic(0x2fc12fc1) // FsMagicOverlay filesystem id for overlay FsMagicOverlay = FsMagic(0x794C7630) // FsMagicFUSE filesystem id for FUSE FsMagicFUSE = FsMagic(0x65735546) // FsMagicAcfs filesystem id for Acfs FsMagicAcfs = FsMagic(0x61636673) // FsMagicAfs filesystem id for Afs FsMagicAfs = FsMagic(0x5346414f) // FsMagicCephFs filesystem id for Ceph FsMagicCephFs = FsMagic(0x00C36400) // FsMagicCIFS filesystem id for CIFS FsMagicCIFS = FsMagic(0xFF534D42) // FsMagicEROFS filesystem id for EROFS FsMagicEROFS = FsMagic(0xE0F5E1E2) // FsMagicFHGFS filesystem id for FHGFS FsMagicFHGFSFs = FsMagic(0x19830326) // FsMagicIBRIX filesystem id for IBRIX FsMagicIBRIX = FsMagic(0x013111A8) // FsMagicKAFS filesystem id for KAFS FsMagicKAFS = FsMagic(0x6B414653) // FsMagicLUSTRE filesystem id for LUSTRE FsMagicLUSTRE = FsMagic(0x0BD00BD0) // FsMagicNCP filesystem id for NCP FsMagicNCP = FsMagic(0x564C) // FsMagicNFSD filesystem id for NFSD FsMagicNFSD = FsMagic(0x6E667364) // FsMagicOCFS2 filesystem id for OCFS2 FsMagicOCFS2 = FsMagic(0x7461636F) // FsMagicPANFS filesystem id for PANFS FsMagicPANFS = FsMagic(0xAAD7AAEA) // FsMagicPRLFS filesystem id for PRLFS FsMagicPRLFS = FsMagic(0x7C7C6673) // FsMagicSMB2 filesystem id for SMB2 FsMagicSMB2 = FsMagic(0xFE534D42) // FsMagicSNFS filesystem id for SNFS FsMagicSNFS = FsMagic(0xBEEFDEAD) // FsMagicVBOXSF filesystem id for VBOXSF FsMagicVBOXSF = FsMagic(0x786F4256) // FsMagicVXFS filesystem id for VXFS FsMagicVXFS = FsMagic(0xA501FCF5) ) var ( // Slice of drivers that should be used in an order Priority = []string{ "overlay", "btrfs", "zfs", "vfs", } // FsNames maps filesystem id to name of the filesystem. FsNames = map[FsMagic]string{ FsMagicAufs: "aufs", FsMagicBtrfs: "btrfs", FsMagicCramfs: "cramfs", FsMagicEcryptfs: "ecryptfs", FsMagicEROFS: "erofs", FsMagicExtfs: "extfs", FsMagicF2fs: "f2fs", FsMagicGPFS: "gpfs", FsMagicJffs2Fs: "jffs2", FsMagicJfs: "jfs", FsMagicNfsFs: "nfs", FsMagicOverlay: "overlayfs", FsMagicRAMFs: "ramfs", FsMagicReiserFs: "reiserfs", FsMagicSmbFs: "smb", FsMagicSquashFs: "squashfs", FsMagicTmpFs: "tmpfs", FsMagicUnsupported: "unsupported", FsMagicVxFS: "vxfs", FsMagicXfs: "xfs", FsMagicZfs: "zfs", } ) // GetFSMagic returns the filesystem id given the path. func GetFSMagic(rootpath string) (FsMagic, error) { var buf unix.Statfs_t path := filepath.Dir(rootpath) if err := unix.Statfs(path, &buf); err != nil { return 0, err } if _, ok := FsNames[FsMagic(buf.Type)]; !ok { logrus.Debugf("Unknown filesystem type %#x reported for %s", buf.Type, path) } return FsMagic(buf.Type), nil } // NewFsChecker returns a checker configured for the provided FsMagic func NewFsChecker(t FsMagic) Checker { return &fsChecker{ t: t, } } type fsChecker struct { t FsMagic } func (c *fsChecker) IsMounted(path string) bool { m, _ := Mounted(c.t, path) return m } // NewDefaultChecker returns a check that parses /proc/mountinfo to check // if the specified path is mounted. func NewDefaultChecker() Checker { return &defaultChecker{} } type defaultChecker struct{} func (c *defaultChecker) IsMounted(path string) bool { m, _ := mount.Mounted(path) return m } // isMountPoint checks that the given path is a mount point func isMountPoint(mountPath string) (bool, error) { // it is already the root if mountPath == "/" { return true, nil } var s1, s2 unix.Stat_t if err := unix.Stat(mountPath, &s1); err != nil { return true, err } if err := unix.Stat(filepath.Dir(mountPath), &s2); err != nil { return true, err } return s1.Dev != s2.Dev, nil } // Mounted checks if the given path is mounted as the fs type func Mounted(fsType FsMagic, mountPath string) (bool, error) { var buf unix.Statfs_t if err := unix.Statfs(mountPath, &buf); err != nil { return false, err } if FsMagic(buf.Type) != fsType { return false, nil } return isMountPoint(mountPath) } ================================================ FILE: vendor/go.podman.io/storage/drivers/driver_solaris.go ================================================ //go:build solaris && cgo package graphdriver /* #include #include static inline struct statvfs *getstatfs(char *s) { struct statvfs *buf; int err; buf = (struct statvfs *)malloc(sizeof(struct statvfs)); err = statvfs(s, buf); return buf; } */ import "C" import ( "path/filepath" "unsafe" "github.com/sirupsen/logrus" "go.podman.io/storage/pkg/mount" ) const ( // FsMagicZfs filesystem id for Zfs FsMagicZfs = FsMagic(0x2fc12fc1) ) var ( // Slice of drivers that should be used in an order Priority = []string{ "zfs", } // FsNames maps filesystem id to name of the filesystem. FsNames = map[FsMagic]string{ FsMagicZfs: "zfs", } ) // GetFSMagic returns the filesystem id given the path. func GetFSMagic(rootpath string) (FsMagic, error) { return 0, nil } type fsChecker struct { t FsMagic } func (c *fsChecker) IsMounted(path string) bool { m, _ := Mounted(c.t, path) return m } // NewFsChecker returns a checker configured for the provided FsMagic func NewFsChecker(t FsMagic) Checker { return &fsChecker{ t: t, } } // NewDefaultChecker returns a check that parses /proc/mountinfo to check // if the specified path is mounted. // No-op on Solaris. func NewDefaultChecker() Checker { return &defaultChecker{} } type defaultChecker struct{} func (c *defaultChecker) IsMounted(path string) bool { m, _ := mount.Mounted(path) return m } // Mounted checks if the given path is mounted as the fs type // Solaris supports only ZFS for now func Mounted(fsType FsMagic, mountPath string) (bool, error) { cs := C.CString(filepath.Dir(mountPath)) defer C.free(unsafe.Pointer(cs)) buf := C.getstatfs(cs) defer C.free(unsafe.Pointer(buf)) // on Solaris buf.f_basetype contains ['z', 'f', 's', 0 ... ] if (buf.f_basetype[0] != 122) || (buf.f_basetype[1] != 102) || (buf.f_basetype[2] != 115) || (buf.f_basetype[3] != 0) { logrus.Debugf("[zfs] no zfs dataset found for rootdir '%s'", mountPath) return false, ErrPrerequisites } return true, nil } ================================================ FILE: vendor/go.podman.io/storage/drivers/driver_unsupported.go ================================================ //go:build !linux && !freebsd && !solaris && !darwin package graphdriver // Slice of drivers that should be used in an order var Priority = []string{ "unsupported", } // GetFSMagic returns the filesystem id given the path. func GetFSMagic(rootpath string) (FsMagic, error) { return FsMagicUnsupported, nil } ================================================ FILE: vendor/go.podman.io/storage/drivers/fsdiff.go ================================================ package graphdriver import ( "io" "os" "runtime" "time" "github.com/sirupsen/logrus" "go.podman.io/storage/pkg/archive" "go.podman.io/storage/pkg/chrootarchive" "go.podman.io/storage/pkg/idtools" "go.podman.io/storage/pkg/ioutils" "go.podman.io/storage/pkg/unshare" ) // ApplyUncompressedLayer defines the unpack method used by the graph // driver. var ApplyUncompressedLayer = chrootarchive.ApplyUncompressedLayer // NaiveDiffDriver takes a ProtoDriver and adds the // capability of the Diffing methods which it may or may not // support on its own. See the comment on the exported // NewNaiveDiffDriver function below. type NaiveDiffDriver struct { ProtoDriver LayerIDMapUpdater } // NewNaiveDiffDriver returns a fully functional driver that wraps the // given ProtoDriver and adds the capability of the following methods which // it may or may not support on its own: // // Diff(id string, idMappings *idtools.IDMappings, parent string, parentMappings *idtools.IDMappings, mountLabel string) (io.ReadCloser, error) // Changes(id string, idMappings *idtools.IDMappings, parent string, parentMappings *idtools.IDMappings, mountLabel string) ([]archive.Change, error) // ApplyDiff(id, parent string, options ApplyDiffOpts) (size int64, err error) // DiffSize(id string, idMappings *idtools.IDMappings, parent, parentMappings *idtools.IDMappings, mountLabel string) (size int64, err error) func NewNaiveDiffDriver(driver ProtoDriver, updater LayerIDMapUpdater) Driver { return &NaiveDiffDriver{ProtoDriver: driver, LayerIDMapUpdater: updater} } // Diff produces an archive of the changes between the specified // layer and its parent layer which may be "". func (gdw *NaiveDiffDriver) Diff(id string, idMappings *idtools.IDMappings, parent string, parentMappings *idtools.IDMappings, mountLabel string) (arch io.ReadCloser, err error) { startTime := time.Now() driver := gdw.ProtoDriver if idMappings == nil { idMappings = &idtools.IDMappings{} } if parentMappings == nil { parentMappings = &idtools.IDMappings{} } options := MountOpts{ MountLabel: mountLabel, Options: []string{"ro"}, } layerFs, err := driver.Get(id, options) if err != nil { return nil, err } defer func() { if err != nil { driverPut(driver, id, &err) } }() if parent == "" { archive, err := archive.TarWithOptions(layerFs, &archive.TarOptions{ Compression: archive.Uncompressed, UIDMaps: idMappings.UIDs(), GIDMaps: idMappings.GIDs(), }) if err != nil { return nil, err } return ioutils.NewReadCloserWrapper(archive, func() error { err := archive.Close() driverPut(driver, id, &err) return err }), nil } options.Options = append(options.Options, "ro") parentFs, err := driver.Get(parent, options) if err != nil { return nil, err } defer driverPut(driver, parent, &err) changes, err := archive.ChangesDirs(layerFs, idMappings, parentFs, parentMappings) if err != nil { return nil, err } archive, err := archive.ExportChanges(layerFs, changes, idMappings.UIDs(), idMappings.GIDs()) if err != nil { return nil, err } return ioutils.NewReadCloserWrapper(archive, func() error { err := archive.Close() driverPut(driver, id, &err) // NaiveDiffDriver compares file metadata with parent layers. Parent layers // are extracted from tar's with full second precision on modified time. // We need this hack here to make sure calls within same second receive // correct result. time.Sleep(time.Until(startTime.Truncate(time.Second).Add(time.Second))) return err }), nil } // Changes produces a list of changes between the specified layer // and its parent layer. If parent is "", then all changes will be ADD changes. func (gdw *NaiveDiffDriver) Changes(id string, idMappings *idtools.IDMappings, parent string, parentMappings *idtools.IDMappings, mountLabel string) (_ []archive.Change, retErr error) { driver := gdw.ProtoDriver if idMappings == nil { idMappings = &idtools.IDMappings{} } if parentMappings == nil { parentMappings = &idtools.IDMappings{} } options := MountOpts{ MountLabel: mountLabel, Options: []string{"ro"}, } layerFs, err := driver.Get(id, options) if err != nil { return nil, err } defer driverPut(driver, id, &retErr) parentFs := "" if parent != "" { parentFs, err = driver.Get(parent, options) if err != nil { return nil, err } defer driverPut(driver, parent, &retErr) } return archive.ChangesDirs(layerFs, idMappings, parentFs, parentMappings) } // ApplyDiff extracts the changeset from the given diff into the // layer with the specified id and parent, returning the size of the // new layer in bytes. func (gdw *NaiveDiffDriver) ApplyDiff(id string, options ApplyDiffOpts) (int64, error) { driver := gdw.ProtoDriver if options.Mappings == nil { options.Mappings = &idtools.IDMappings{} } // Mount the root filesystem so we can apply the diff/layer. mountOpts := MountOpts{ MountLabel: options.MountLabel, } layerFs, err := driver.Get(id, mountOpts) if err != nil { return -1, err } defer driverPut(driver, id, &err) defaultForceMask := os.FileMode(0o700) var forceMask *os.FileMode // = nil if runtime.GOOS == "darwin" { forceMask = &defaultForceMask } tarOptions := &archive.TarOptions{ InUserNS: unshare.IsRootless(), IgnoreChownErrors: options.IgnoreChownErrors, ForceMask: forceMask, } if options.Mappings != nil { tarOptions.UIDMaps = options.Mappings.UIDs() tarOptions.GIDMaps = options.Mappings.GIDs() } start := time.Now().UTC() logrus.Debug("Start untar layer") size, err := ApplyUncompressedLayer(layerFs, options.Diff, tarOptions) if err != nil { logrus.Errorf("While applying layer: %s", err) return -1, err } logrus.Debugf("Untar time: %vs", time.Now().UTC().Sub(start).Seconds()) return size, nil } // DiffSize calculates the changes between the specified layer // and its parent and returns the size in bytes of the changes // relative to its base filesystem directory. func (gdw *NaiveDiffDriver) DiffSize(id string, idMappings *idtools.IDMappings, parent string, parentMappings *idtools.IDMappings, mountLabel string) (int64, error) { driver := gdw.ProtoDriver if idMappings == nil { idMappings = &idtools.IDMappings{} } if parentMappings == nil { parentMappings = &idtools.IDMappings{} } changes, err := gdw.Changes(id, idMappings, parent, parentMappings, mountLabel) if err != nil { return 0, err } options := MountOpts{ MountLabel: mountLabel, } layerFs, err := driver.Get(id, options) if err != nil { return 0, err } defer driverPut(driver, id, &err) return archive.ChangesSize(layerFs, changes), nil } ================================================ FILE: vendor/go.podman.io/storage/drivers/jsoniter.go ================================================ package graphdriver import jsoniter "github.com/json-iterator/go" var json = jsoniter.ConfigCompatibleWithStandardLibrary ================================================ FILE: vendor/go.podman.io/storage/drivers/overlay/check.go ================================================ //go:build linux package overlay import ( "errors" "fmt" "os" "path" "path/filepath" "syscall" "github.com/sirupsen/logrus" "go.podman.io/storage/pkg/archive" "go.podman.io/storage/pkg/idmap" "go.podman.io/storage/pkg/idtools" "go.podman.io/storage/pkg/ioutils" "go.podman.io/storage/pkg/mount" "go.podman.io/storage/pkg/system" "go.podman.io/storage/pkg/unshare" "golang.org/x/sys/unix" ) // doesSupportNativeDiff checks whether the filesystem has a bug // which copies up the opaque flag when copying up an opaque // directory or the kernel enable CONFIG_OVERLAY_FS_REDIRECT_DIR. // When these exist naive diff should be used. func doesSupportNativeDiff(d, mountOpts string) error { td, err := os.MkdirTemp(d, "opaque-bug-check") if err != nil { return err } defer func() { if err := os.RemoveAll(td); err != nil { logrus.Warnf("Failed to remove check directory %v: %v", td, err) } }() // Make directories l1/d, l1/d1, l2/d, l3, work, merged if err := os.MkdirAll(filepath.Join(td, "l1", "d"), 0o755); err != nil { return err } if err := os.MkdirAll(filepath.Join(td, "l1", "d1"), 0o755); err != nil { return err } if err := os.MkdirAll(filepath.Join(td, "l2", "d"), 0o755); err != nil { return err } if err := os.Mkdir(filepath.Join(td, "l3"), 0o755); err != nil { return err } if err := os.Mkdir(filepath.Join(td, "work"), 0o755); err != nil { return err } if err := os.Mkdir(filepath.Join(td, "merged"), 0o755); err != nil { return err } // Mark l2/d as opaque if err := system.Lsetxattr(filepath.Join(td, "l2", "d"), archive.GetOverlayXattrName("opaque"), []byte("y"), 0); err != nil { return fmt.Errorf("failed to set opaque flag on middle layer: %w", err) } mountFlags := "lowerdir=%s:%s,upperdir=%s,workdir=%s" if unshare.IsRootless() { mountFlags = mountFlags + ",userxattr" } opts := fmt.Sprintf(mountFlags, path.Join(td, "l2"), path.Join(td, "l1"), path.Join(td, "l3"), path.Join(td, "work")) flags, data := mount.ParseOptions(mountOpts) if data != "" { opts = fmt.Sprintf("%s,%s", opts, data) } if err := unix.Mount("overlay", filepath.Join(td, "merged"), "overlay", uintptr(flags), opts); err != nil { return fmt.Errorf("failed to mount overlay: %w", err) } defer func() { if err := unix.Unmount(filepath.Join(td, "merged"), 0); err != nil { logrus.Warnf("Failed to unmount check directory %v: %v", filepath.Join(td, "merged"), err) } }() // Touch file in d to force copy up of opaque directory "d" from "l2" to "l3" if err := os.WriteFile(filepath.Join(td, "merged", "d", "f"), []byte{}, 0o644); err != nil { return fmt.Errorf("failed to write to merged directory: %w", err) } // Check l3/d does not have opaque flag xattrOpaque, err := system.Lgetxattr(filepath.Join(td, "l3", "d"), archive.GetOverlayXattrName("opaque")) if err != nil { return fmt.Errorf("failed to read opaque flag on upper layer: %w", err) } if string(xattrOpaque) == "y" { return errors.New("opaque flag erroneously copied up, consider update to kernel 4.8 or later to fix") } // rename "d1" to "d2" if err := os.Rename(filepath.Join(td, "merged", "d1"), filepath.Join(td, "merged", "d2")); err != nil { // if rename failed with syscall.EXDEV, the kernel doesn't have CONFIG_OVERLAY_FS_REDIRECT_DIR enabled if err.(*os.LinkError).Err == syscall.EXDEV { return nil } return fmt.Errorf("failed to rename dir in merged directory: %w", err) } // get the xattr of "d2" xattrRedirect, err := system.Lgetxattr(filepath.Join(td, "l3", "d2"), archive.GetOverlayXattrName("redirect")) if err != nil { return fmt.Errorf("failed to read redirect flag on upper layer: %w", err) } if string(xattrRedirect) == "d1" { return errors.New("kernel has CONFIG_OVERLAY_FS_REDIRECT_DIR enabled") } return nil } // doesMetacopy checks if the filesystem is going to optimize changes to // metadata by using nodes marked with an "overlay.metacopy" attribute to avoid // copying up a file from a lower layer unless/until its contents are being // modified func doesMetacopy(d, mountOpts string) (bool, error) { td, err := os.MkdirTemp(d, "metacopy-check") if err != nil { return false, err } defer func() { if err := os.RemoveAll(td); err != nil { logrus.Warnf("Failed to remove check directory %v: %v", td, err) } }() // Make directories l1, l2, work, merged if err := os.MkdirAll(filepath.Join(td, "l1"), 0o755); err != nil { return false, err } if err := ioutils.AtomicWriteFile(filepath.Join(td, "l1", "f"), []byte{0xff}, 0o700); err != nil { return false, err } if err := os.MkdirAll(filepath.Join(td, "l2"), 0o755); err != nil { return false, err } if err := os.Mkdir(filepath.Join(td, "work"), 0o755); err != nil { return false, err } if err := os.Mkdir(filepath.Join(td, "merged"), 0o755); err != nil { return false, err } // Mount using the mandatory options and configured options opts := fmt.Sprintf("lowerdir=%s,upperdir=%s,workdir=%s", path.Join(td, "l1"), path.Join(td, "l2"), path.Join(td, "work")) if unshare.IsRootless() { opts = fmt.Sprintf("%s,userxattr", opts) } flags, data := mount.ParseOptions(mountOpts) if data != "" { opts = fmt.Sprintf("%s,%s", opts, data) } if err := unix.Mount("overlay", filepath.Join(td, "merged"), "overlay", uintptr(flags), opts); err != nil { if errors.Is(err, unix.EINVAL) { logrus.Infof("overlay: metacopy option not supported on this kernel, checked using options %q", mountOpts) return false, nil } return false, fmt.Errorf("failed to mount overlay for metacopy check with %q options: %w", mountOpts, err) } defer func() { if err := unix.Unmount(filepath.Join(td, "merged"), 0); err != nil { logrus.Warnf("Failed to unmount check directory %v: %v", filepath.Join(td, "merged"), err) } }() // Make a change that only impacts the inode, and check if the pulled-up copy is marked // as a metadata-only copy if err := os.Chmod(filepath.Join(td, "merged", "f"), 0o600); err != nil { return false, fmt.Errorf("changing permissions on file for metacopy check: %w", err) } metacopy, err := system.Lgetxattr(filepath.Join(td, "l2", "f"), archive.GetOverlayXattrName("metacopy")) if err != nil { if errors.Is(err, unix.ENOTSUP) { logrus.Info("metacopy option not supported") return false, nil } return false, fmt.Errorf("metacopy flag was not set on file in upper layer: %w", err) } return metacopy != nil, nil } // doesVolatile checks if the filesystem supports the "volatile" mount option func doesVolatile(d string) (bool, error) { td, err := os.MkdirTemp(d, "volatile-check") if err != nil { return false, err } defer func() { if err := os.RemoveAll(td); err != nil { logrus.Warnf("Failed to remove check directory %v: %v", td, err) } }() if err := os.MkdirAll(filepath.Join(td, "lower"), 0o755); err != nil { return false, err } if err := os.MkdirAll(filepath.Join(td, "upper"), 0o755); err != nil { return false, err } if err := os.Mkdir(filepath.Join(td, "work"), 0o755); err != nil { return false, err } if err := os.Mkdir(filepath.Join(td, "merged"), 0o755); err != nil { return false, err } // Mount using the mandatory options and configured options opts := fmt.Sprintf("volatile,lowerdir=%s,upperdir=%s,workdir=%s", path.Join(td, "lower"), path.Join(td, "upper"), path.Join(td, "work")) if unshare.IsRootless() { opts = fmt.Sprintf("%s,userxattr", opts) } if err := unix.Mount("overlay", filepath.Join(td, "merged"), "overlay", 0, opts); err != nil { return false, fmt.Errorf("failed to mount overlay for volatile check: %w", err) } defer func() { if err := unix.Unmount(filepath.Join(td, "merged"), 0); err != nil { logrus.Warnf("Failed to unmount check directory %v: %v", filepath.Join(td, "merged"), err) } }() return true, nil } // supportsIdmappedLowerLayers checks if the kernel supports mounting overlay on top of // a idmapped lower layer. func supportsIdmappedLowerLayers(home string) (bool, error) { layerDir, err := os.MkdirTemp(home, "compat") if err != nil { return false, err } defer func() { _ = os.RemoveAll(layerDir) }() mergedDir := filepath.Join(layerDir, "merged") lowerDir := filepath.Join(layerDir, "lower") lowerMappedDir := filepath.Join(layerDir, "lower-mapped") upperDir := filepath.Join(layerDir, "upper") workDir := filepath.Join(layerDir, "work") idPair := idtools.IDPair{UID: 0, GID: 0} _ = idtools.MkdirAndChown(mergedDir, 0o700, idPair) _ = idtools.MkdirAndChown(lowerDir, 0o700, idPair) _ = idtools.MkdirAndChown(lowerMappedDir, 0o700, idPair) _ = idtools.MkdirAndChown(upperDir, 0o700, idPair) _ = idtools.MkdirAndChown(workDir, 0o700, idPair) mapping := []idtools.IDMap{ { ContainerID: 0, HostID: 0, Size: 1, }, } pid, cleanupFunc, err := idmap.CreateUsernsProcess(mapping, mapping) if err != nil { return false, err } defer cleanupFunc() if err := idmap.CreateIDMappedMount(lowerDir, lowerMappedDir, pid); err != nil { return false, fmt.Errorf("create mapped mount: %w", err) } defer func() { if err := unix.Unmount(lowerMappedDir, unix.MNT_DETACH); err != nil { logrus.Warnf("Unmount %q: %v", lowerMappedDir, err) } }() opts := fmt.Sprintf("lowerdir=%s,upperdir=%s,workdir=%s", lowerMappedDir, upperDir, workDir) flags := uintptr(0) if err := unix.Mount("overlay", mergedDir, "overlay", flags, opts); err != nil { return false, err } defer func() { _ = unix.Unmount(mergedDir, unix.MNT_DETACH) }() return true, nil } // supportsDataOnlyLayers checks if the kernel supports mounting a overlay file system // that uses data-only layers. func supportsDataOnlyLayers(home string) (bool, error) { layerDir, err := os.MkdirTemp(home, "compat") if err != nil { return false, err } defer func() { _ = os.RemoveAll(layerDir) }() mergedDir := filepath.Join(layerDir, "merged") lowerDir := filepath.Join(layerDir, "lower") lowerDirDataOnly := filepath.Join(layerDir, "lower-data") upperDir := filepath.Join(layerDir, "upper") workDir := filepath.Join(layerDir, "work") idPair := idtools.IDPair{UID: 0, GID: 0} _ = idtools.MkdirAndChown(mergedDir, 0o700, idPair) _ = idtools.MkdirAndChown(lowerDir, 0o700, idPair) _ = idtools.MkdirAndChown(lowerDirDataOnly, 0o700, idPair) _ = idtools.MkdirAndChown(upperDir, 0o700, idPair) _ = idtools.MkdirAndChown(workDir, 0o700, idPair) opts := fmt.Sprintf("lowerdir=%s::%s,upperdir=%s,workdir=%s,metacopy=on", lowerDir, lowerDirDataOnly, upperDir, workDir) flags := uintptr(0) if err := unix.Mount("overlay", mergedDir, "overlay", flags, opts); err != nil { return false, err } _ = unix.Unmount(mergedDir, unix.MNT_DETACH) return true, nil } ================================================ FILE: vendor/go.podman.io/storage/drivers/overlay/check_116.go ================================================ //go:build linux package overlay import ( "errors" "io/fs" "path/filepath" "strings" "go.podman.io/storage/pkg/archive" "go.podman.io/storage/pkg/system" ) func scanForMountProgramIndicators(home string) (detected bool, err error) { err = filepath.WalkDir(home, func(path string, d fs.DirEntry, err error) error { if detected { return fs.SkipDir } if err != nil { return err } basename := filepath.Base(path) if strings.HasPrefix(basename, archive.WhiteoutPrefix) { detected = true return fs.SkipDir } if d.IsDir() { xattrs, err := system.Llistxattr(path) if err != nil && !errors.Is(err, system.ENOTSUP) { return err } for _, xattr := range xattrs { if strings.HasPrefix(xattr, "user.fuseoverlayfs.") || strings.HasPrefix(xattr, "user.containers.") { detected = true return fs.SkipDir } } } return nil }) return detected, err } ================================================ FILE: vendor/go.podman.io/storage/drivers/overlay/composefs.go ================================================ //go:build linux package overlay import ( "bytes" "encoding/binary" "errors" "fmt" "os" "os/exec" "path/filepath" "strings" "sync" "sync/atomic" "github.com/sirupsen/logrus" "go.podman.io/storage/pkg/chunked/dump" "go.podman.io/storage/pkg/fsverity" "go.podman.io/storage/pkg/loopback" "golang.org/x/sys/unix" ) var ( composeFsHelperOnce sync.Once composeFsHelperPath string composeFsHelperErr error // skipMountViaFile is used to avoid trying to mount EROFS directly via the file if we already know the current kernel // does not support it. Mounting directly via a file is supported from Linux 6.12. skipMountViaFile atomic.Bool ) func getComposeFsHelper() (string, error) { composeFsHelperOnce.Do(func() { composeFsHelperPath, composeFsHelperErr = exec.LookPath("mkcomposefs") }) return composeFsHelperPath, composeFsHelperErr } func getComposefsBlob(dataDir string) string { return filepath.Join(dataDir, "composefs.blob") } func generateComposeFsBlob(verityDigests map[string]string, toc any, composefsDir string) error { if err := os.MkdirAll(composefsDir, 0o700); err != nil { return err } dumpReader, err := dump.GenerateDump(toc, verityDigests) if err != nil { return err } destFile := getComposefsBlob(composefsDir) writerJSON, err := getComposeFsHelper() if err != nil { return fmt.Errorf("failed to find mkcomposefs: %w", err) } outFile, err := os.OpenFile(destFile, os.O_WRONLY|os.O_CREATE|os.O_EXCL, 0o644) if err != nil { return err } roFile, err := os.Open(fmt.Sprintf("/proc/self/fd/%d", outFile.Fd())) if err != nil { outFile.Close() return fmt.Errorf("failed to reopen %s as read-only: %w", destFile, err) } err = func() error { // a scope to close outFile before setting fsverity on the read-only fd. defer outFile.Close() errBuf := &bytes.Buffer{} cmd := exec.Command(writerJSON, "--from-file", "-", "-") cmd.Stderr = errBuf cmd.Stdin = dumpReader cmd.Stdout = outFile if err := cmd.Run(); err != nil { rErr := fmt.Errorf("failed to convert json to erofs: %w", err) exitErr := &exec.ExitError{} if errors.As(err, &exitErr) { return fmt.Errorf("%w: %s", rErr, strings.TrimSpace(errBuf.String())) } return rErr } return nil }() if err != nil { return err } if err := fsverity.EnableVerity("manifest file", int(roFile.Fd())); err != nil && !errors.Is(err, unix.ENOTSUP) && !errors.Is(err, unix.ENOTTY) { logrus.Warningf("%s", err) } return nil } /* typedef enum { LCFS_EROFS_FLAGS_HAS_ACL = (1 << 0), } lcfs_erofs_flag_t; struct lcfs_erofs_header_s { uint32_t magic; uint32_t version; uint32_t flags; uint32_t unused[5]; } __attribute__((__packed__)); */ // hasACL returns true if the erofs blob has ACLs enabled func hasACL(path string) (bool, error) { const ( LCFS_EROFS_FLAGS_HAS_ACL = (1 << 0) versionNumberSize = 4 magicNumberSize = 4 flagsSize = 4 ) file, err := os.Open(path) if err != nil { return false, err } defer file.Close() // do not worry about checking the magic number, if the file is invalid // we will fail to mount it anyway buffer := make([]byte, versionNumberSize+magicNumberSize+flagsSize) nread, err := file.Read(buffer) if err != nil { return false, err } if nread != len(buffer) { return false, fmt.Errorf("failed to read flags from %q", path) } flags := buffer[versionNumberSize+magicNumberSize:] return binary.LittleEndian.Uint32(flags)&LCFS_EROFS_FLAGS_HAS_ACL != 0, nil } func openBlobFile(blobFile string, hasACL, useLoopDevice bool) (int, error) { if useLoopDevice { loop, err := loopback.AttachLoopDeviceRO(blobFile) if err != nil { return -1, err } defer loop.Close() blobFile = loop.Name() } fsfd, err := unix.Fsopen("erofs", 0) if err != nil { return -1, fmt.Errorf("failed to open erofs filesystem: %w", err) } defer unix.Close(fsfd) if err := unix.FsconfigSetString(fsfd, "source", blobFile); err != nil { return -1, fmt.Errorf("failed to set source for erofs filesystem: %w", err) } if err := unix.FsconfigSetFlag(fsfd, "ro"); err != nil { return -1, fmt.Errorf("failed to set erofs filesystem read-only: %w", err) } if !hasACL { if err := unix.FsconfigSetFlag(fsfd, "noacl"); err != nil { return -1, fmt.Errorf("failed to set noacl for erofs filesystem: %w", err) } } if err := unix.FsconfigCreate(fsfd); err != nil { buffer := make([]byte, 4096) if n, _ := unix.Read(fsfd, buffer); n > 0 { return -1, fmt.Errorf("failed to create erofs filesystem: %s: %w", strings.TrimSuffix(string(buffer[:n]), "\n"), err) } return -1, fmt.Errorf("failed to create erofs filesystem: %w", err) } mfd, err := unix.Fsmount(fsfd, 0, unix.MOUNT_ATTR_RDONLY) if err != nil { buffer := make([]byte, 4096) if n, _ := unix.Read(fsfd, buffer); n > 0 { return -1, fmt.Errorf("failed to mount erofs filesystem: %s: %w", string(buffer[:n]), err) } return -1, fmt.Errorf("failed to mount erofs filesystem: %w", err) } return mfd, nil } func openComposefsMount(dataDir string) (int, error) { blobFile := getComposefsBlob(dataDir) hasACL, err := hasACL(blobFile) if err != nil { return -1, err } if !skipMountViaFile.Load() { fd, err := openBlobFile(blobFile, hasACL, false) if err == nil || !errors.Is(err, unix.ENOTBLK) { return fd, err } logrus.Debugf("The current kernel doesn't support mounting EROFS directly from a file, fallback to a loopback device") skipMountViaFile.Store(true) } return openBlobFile(blobFile, hasACL, true) } func mountComposefsBlob(dataDir, mountPoint string) error { mfd, err := openComposefsMount(dataDir) if err != nil { return err } defer unix.Close(mfd) if err := unix.MoveMount(mfd, "", unix.AT_FDCWD, mountPoint, unix.MOVE_MOUNT_F_EMPTY_PATH); err != nil { return fmt.Errorf("failed to move mount to %q: %w", mountPoint, err) } return nil } ================================================ FILE: vendor/go.podman.io/storage/drivers/overlay/jsoniter.go ================================================ //go:build linux package overlay import jsoniter "github.com/json-iterator/go" var json = jsoniter.ConfigCompatibleWithStandardLibrary ================================================ FILE: vendor/go.podman.io/storage/drivers/overlay/mount.go ================================================ //go:build linux package overlay import ( "bytes" "flag" "fmt" "os" "path/filepath" "runtime" "strings" "go.podman.io/storage/pkg/reexec" "golang.org/x/sys/unix" ) func init() { reexec.Register("storage-mountfrom", mountOverlayFromMain) } func fatal(err error) { fmt.Fprint(os.Stderr, err) os.Exit(1) } type mountOptions struct { Device string Target string Type string Label string Flag uint32 } func mountOverlayFrom(dir, device, target, mType string, flags uintptr, label string) error { options := &mountOptions{ Device: device, Target: target, Type: mType, Flag: uint32(flags), Label: label, } cmd := reexec.Command("storage-mountfrom", dir) w, err := cmd.StdinPipe() if err != nil { return fmt.Errorf("mountfrom error on pipe creation: %w", err) } output := bytes.NewBuffer(nil) cmd.Stdout = output cmd.Stderr = output if err := cmd.Start(); err != nil { w.Close() return fmt.Errorf("mountfrom error on re-exec cmd: %w", err) } // write the options to the pipe for the untar exec to read if err := json.NewEncoder(w).Encode(options); err != nil { w.Close() return fmt.Errorf("mountfrom json encode to pipe failed: %w", err) } w.Close() if err := cmd.Wait(); err != nil { return fmt.Errorf("mountfrom re-exec output: %s: error: %w", output, err) } return nil } // mountfromMain is the entry-point for storage-mountfrom on re-exec. func mountOverlayFromMain() { runtime.LockOSThread() flag.Parse() var options *mountOptions if err := json.NewDecoder(os.Stdin).Decode(&options); err != nil { fatal(err) } // Mount the arguments passed from the specified directory. Some of the // paths mentioned in the values we pass to the kernel are relative to // the specified directory. homedir := flag.Arg(0) if err := os.Chdir(homedir); err != nil { fatal(err) } pageSize := unix.Getpagesize() if len(options.Label) < pageSize { if err := unix.Mount(options.Device, options.Target, options.Type, uintptr(options.Flag), options.Label); err != nil { fatal(err) } os.Exit(0) } // Those arguments still took up too much space. Open the diff // directories and use their descriptor numbers as lowers, using // /proc/self/fd as the current directory. // Split out the various options, since we need to manipulate the // paths, but we don't want to mess with other options. var upperk, upperv, workk, workv, lowerk, lowerv, labelk, labelv, others string for arg := range strings.SplitSeq(options.Label, ",") { key, val, _ := strings.Cut(arg, "=") switch key { case "upperdir": upperk = "upperdir=" upperv = val case "workdir": workk = "workdir=" workv = val case "lowerdir": lowerk = "lowerdir=" lowerv = val case "label": labelk = "label=" labelv = val default: if others == "" { others = arg } else { others = others + "," + arg } } } // Make sure upperdir, workdir, and the target are absolute paths. if upperv != "" && !filepath.IsAbs(upperv) { upperv = filepath.Join(homedir, upperv) } if workv != "" && !filepath.IsAbs(workv) { workv = filepath.Join(homedir, workv) } if !filepath.IsAbs(options.Target) { options.Target = filepath.Join(homedir, options.Target) } // Get a descriptor for each lower, and use that descriptor's name as // the new value for the list of lowers, because it's shorter. if lowerv != "" { var newLowers []string dataOnly := false for lowerPath := range strings.SplitSeq(lowerv, ":") { if lowerPath == "" { dataOnly = true continue } lowerFd, err := unix.Open(lowerPath, unix.O_RDONLY, 0) if err != nil { fatal(err) } var lower string if dataOnly { lower = fmt.Sprintf(":%d", lowerFd) dataOnly = false } else { lower = fmt.Sprintf("%d", lowerFd) } newLowers = append(newLowers, lower) } lowerv = strings.Join(newLowers, ":") } // Reconstruct the Label field. options.Label = upperk + upperv + "," + workk + workv + "," + lowerk + lowerv + "," + labelk + labelv + "," + others options.Label = strings.ReplaceAll(options.Label, ",,", ",") // Okay, try this, if we managed to make the arguments fit. var err error if len(options.Label) < pageSize { if err := os.Chdir("/proc/self/fd"); err != nil { fatal(err) } err = unix.Mount(options.Device, options.Target, options.Type, uintptr(options.Flag), options.Label) } else { err = fmt.Errorf("cannot mount layer, mount data %q too large %d >= page size %d", options.Label, len(options.Label), pageSize) } // Clean up. if err != nil { fmt.Fprintf(os.Stderr, "creating overlay mount to %s, mount_data=%q\n", options.Target, options.Label) fatal(err) } os.Exit(0) } ================================================ FILE: vendor/go.podman.io/storage/drivers/overlay/overlay.go ================================================ //go:build linux package overlay import ( "bytes" "encoding/base64" "errors" "fmt" "io" "io/fs" "os" "os/exec" "path" "path/filepath" "slices" "strconv" "strings" "sync" "syscall" units "github.com/docker/go-units" digest "github.com/opencontainers/go-digest" "github.com/opencontainers/selinux/go-selinux" "github.com/opencontainers/selinux/go-selinux/label" "github.com/sirupsen/logrus" graphdriver "go.podman.io/storage/drivers" "go.podman.io/storage/drivers/overlayutils" "go.podman.io/storage/drivers/quota" "go.podman.io/storage/internal/dedup" "go.podman.io/storage/internal/staging_lockfile" "go.podman.io/storage/internal/tempdir" "go.podman.io/storage/pkg/archive" "go.podman.io/storage/pkg/chrootarchive" "go.podman.io/storage/pkg/directory" "go.podman.io/storage/pkg/fileutils" "go.podman.io/storage/pkg/fsutils" "go.podman.io/storage/pkg/idmap" "go.podman.io/storage/pkg/idtools" "go.podman.io/storage/pkg/mount" "go.podman.io/storage/pkg/parsers" "go.podman.io/storage/pkg/system" "go.podman.io/storage/pkg/unshare" "golang.org/x/sys/unix" ) // untar defines the untar method var untar = chrootarchive.UntarUncompressed const ( defaultPerms = os.FileMode(0o555) mountProgramFlagFile = ".has-mount-program" ) // This backend uses the overlay union filesystem for containers // with diff directories for each layer. // This version of the overlay driver requires at least kernel // 4.0.0 in order to support mounting multiple diff directories. // Each container/image has at least a "diff" directory and "link" file. // If there is also a "lower" file when there are diff layers // below as well as "merged" and "work" directories. The "diff" directory // has the upper layer of the overlay and is used to capture any // changes to the layer. The "lower" file contains all the lower layer // mounts separated by ":" and ordered from uppermost to lowermost // layers. The overlay itself is mounted in the "merged" directory, // and the "work" dir is needed for overlay to work. // The "link" file for each layer contains a unique string for the layer. // Under the "l" directory at the root there will be a symbolic link // with that unique string pointing the "diff" directory for the layer. // The symbolic links are used to reference lower layers in the "lower" // file and on mount. The links are used to shorten the total length // of a layer reference without requiring changes to the layer identifier // or root directory. Mounts are always done relative to root and // referencing the symbolic links in order to ensure the number of // lower directories can fit in a single page for making the mount // syscall. A hard upper limit of 500 lower layers is enforced to ensure // that mounts do not fail due to length. const ( linkDir = "l" stagingDir = "staging" tempDirName = "tempdirs" lowerFile = "lower" maxDepth = 500 stagingLockFile = "staging.lock" tocArtifact = "toc" fsVerityDigestsArtifact = "fs-verity-digests" // idLength represents the number of random characters // which can be used to create the unique link identifier // for every layer. If this value is too long then the // page size limit for the mount command may be exceeded. // The idLength should be selected such that following equation // is true (512 is a buffer for label metadata, 128 is the // number of lowers we want to be able to use without having // to use bind mounts to get all the way to the kernel limit). // ((idLength + len(linkDir) + 1) * 128) <= (pageSize - 512) idLength = 26 ) type overlayOptions struct { imageStores []string layerStores []additionalLayerStore quota quota.Quota mountProgram string skipMountHome bool mountOptions string ignoreChownErrors bool forceMask *os.FileMode useComposefs bool } // Driver contains information about the home directory and the list of active mounts that are created using this driver. type Driver struct { name string home string runhome string imageStore string ctr *graphdriver.RefCounter quotaCtl *quota.Control options overlayOptions naiveDiff graphdriver.DiffDriver supportsDType bool supportsVolatile *bool supportsDataOnly *bool usingMetacopy bool usingComposefs bool stagingDirsLocksMutex sync.Mutex // stagingDirsLocks access is not thread safe, it is required that callers take // stagingDirsLocksMutex on each access to guard against concurrent map writes. stagingDirsLocks map[string]*staging_lockfile.StagingLockFile supportsIDMappedMounts *bool } type additionalLayerStore struct { // path is the directory where this store is available on the host. path string // withReference is true when the store contains image reference information (base64-encoded) // in its layer search path so the path to the diff will be // /base64(reference)// withReference bool } var ( backingFs = "" projectQuotaSupported = false useNaiveDiffLock sync.Once useNaiveDiffOnly bool ) func init() { graphdriver.MustRegister("overlay", Init) graphdriver.MustRegister("overlay2", Init) } func hasMetacopyOption(opts []string) bool { return slices.Contains(opts, "metacopy=on") } func getMountProgramFlagFile(path string) string { return filepath.Join(path, mountProgramFlagFile) } func checkSupportVolatile(home, runhome string) (bool, error) { const feature = "volatile" volatileCacheResult, _, err := cachedFeatureCheck(runhome, feature) var usingVolatile bool if err == nil { if volatileCacheResult { logrus.Debugf("Cached value indicated that volatile is being used") } else { logrus.Debugf("Cached value indicated that volatile is not being used") } usingVolatile = volatileCacheResult } else { usingVolatile, err = doesVolatile(home) if err == nil { if usingVolatile { logrus.Debugf("overlay: test mount indicated that volatile is being used") } else { logrus.Debugf("overlay: test mount indicated that volatile is not being used") } if err = cachedFeatureRecord(runhome, feature, usingVolatile, ""); err != nil { return false, fmt.Errorf("recording volatile-being-used status: %w", err) } } else { usingVolatile = false } } return usingVolatile, nil } // checkAndRecordIDMappedSupport checks and stores if the kernel supports mounting overlay on top of a // idmapped lower layer. func checkAndRecordIDMappedSupport(home, runhome string) (bool, error) { if os.Geteuid() != 0 { return false, nil } feature := "idmapped-lower-dir" overlayCacheResult, overlayCacheText, err := cachedFeatureCheck(runhome, feature) if err == nil { if overlayCacheResult { logrus.Debugf("Cached value indicated that idmapped mounts for overlay are supported") return true, nil } logrus.Debugf("Cached value indicated that idmapped mounts for overlay are not supported") return false, errors.New(overlayCacheText) } supportsIDMappedMounts, err := supportsIdmappedLowerLayers(home) if err2 := cachedFeatureRecord(runhome, feature, supportsIDMappedMounts, ""); err2 != nil { return false, fmt.Errorf("recording overlay idmapped mounts support status: %w", err2) } return supportsIDMappedMounts, err } func checkAndRecordOverlaySupport(home, runhome string) (bool, error) { var supportsDType bool if os.Geteuid() != 0 { return false, nil } feature := "overlay" overlayCacheResult, overlayCacheText, err := cachedFeatureCheck(runhome, feature) if err == nil { if overlayCacheResult { logrus.Debugf("Cached value indicated that overlay is supported") } else { logrus.Debugf("Cached value indicated that overlay is not supported") } supportsDType = overlayCacheResult if !supportsDType { return false, errors.New(overlayCacheText) } } else { supportsDType, err = supportsOverlay(home, idtools.IDPair{UID: 0, GID: 0}) if err != nil { os.Remove(filepath.Join(home, linkDir)) os.Remove(home) patherr, ok := err.(*os.PathError) if ok && patherr.Err == syscall.ENOSPC { return false, err } err = fmt.Errorf("kernel does not support overlay fs: %w", err) if err2 := cachedFeatureRecord(runhome, feature, false, err.Error()); err2 != nil { return false, fmt.Errorf("recording overlay not being supported (%v): %w", err, err2) } return false, err } if err = cachedFeatureRecord(runhome, feature, supportsDType, ""); err != nil { return false, fmt.Errorf("recording overlay support status: %w", err) } } return supportsDType, nil } func (d *Driver) getSupportsVolatile() (bool, error) { if d.supportsVolatile != nil { return *d.supportsVolatile, nil } supportsVolatile, err := checkSupportVolatile(d.home, d.runhome) if err != nil { return false, err } d.supportsVolatile = &supportsVolatile return supportsVolatile, nil } func (d *Driver) getSupportsDataOnly() (bool, error) { if d.supportsDataOnly != nil { return *d.supportsDataOnly, nil } supportsDataOnly, err := supportsDataOnlyLayersCached(d.home, d.runhome) if err != nil { return false, err } d.supportsDataOnly = &supportsDataOnly return supportsDataOnly, nil } // isNetworkFileSystem checks if the specified file system is supported by native overlay // as backing store when running in a user namespace. func isNetworkFileSystem(fsMagic graphdriver.FsMagic) bool { switch fsMagic { // a bunch of network file systems... case graphdriver.FsMagicNfsFs, graphdriver.FsMagicSmbFs, graphdriver.FsMagicAcfs, graphdriver.FsMagicAfs, graphdriver.FsMagicCephFs, graphdriver.FsMagicCIFS, graphdriver.FsMagicGPFS, graphdriver.FsMagicIBRIX, graphdriver.FsMagicKAFS, graphdriver.FsMagicLUSTRE, graphdriver.FsMagicNCP, graphdriver.FsMagicNFSD, graphdriver.FsMagicOCFS2, graphdriver.FsMagicPANFS, graphdriver.FsMagicPRLFS, graphdriver.FsMagicSMB2, graphdriver.FsMagicSNFS, graphdriver.FsMagicVBOXSF, graphdriver.FsMagicVXFS: return true } return false } // Init returns the a native diff driver for overlay filesystem. // If overlay filesystem is not supported on the host, a wrapped graphdriver.ErrNotSupported is returned as error. // If an overlay filesystem is not supported over an existing filesystem then a wrapped graphdriver.ErrIncompatibleFS is returned. func Init(home string, options graphdriver.Options) (graphdriver.Driver, error) { opts, err := parseOptions(options.DriverOptions) if err != nil { return nil, err } fsMagic, err := graphdriver.GetFSMagic(home) if err != nil { return nil, err } fsName, ok := graphdriver.FsNames[fsMagic] if !ok { fsName = "" } backingFs = fsName runhome := filepath.Join(options.RunRoot, filepath.Base(home)) // Create the driver home dir if err := os.MkdirAll(path.Join(home, linkDir), 0o755); err != nil { return nil, err } if options.ImageStore != "" { if err := idtools.MkdirAllAndChown(path.Join(options.ImageStore, linkDir), 0o755, idtools.IDPair{UID: 0, GID: 0}); err != nil { return nil, err } } if err := os.MkdirAll(runhome, 0o700); err != nil { return nil, err } if opts.mountProgram == "" { if supported, err := SupportsNativeOverlay(home, runhome); err != nil { return nil, err } else if !supported { if path, err := exec.LookPath("fuse-overlayfs"); err == nil { opts.mountProgram = path } } } if opts.mountProgram != "" { if unshare.IsRootless() && isNetworkFileSystem(fsMagic) && opts.forceMask == nil { m := os.FileMode(0o700) opts.forceMask = &m logrus.Warnf("Network file system detected as backing store. Enforcing overlay option `force_mask=\"%o\"`. Add it to storage.conf to silence this warning", m) } if err := os.WriteFile(getMountProgramFlagFile(home), []byte("true"), 0o600); err != nil { return nil, err } } else { // check if they are running over btrfs, aufs, overlay, or ecryptfs switch fsMagic { case graphdriver.FsMagicAufs, graphdriver.FsMagicOverlay, graphdriver.FsMagicEcryptfs: return nil, fmt.Errorf("'overlay' is not supported over %s, a mount_program is required: %w", backingFs, graphdriver.ErrIncompatibleFS) } if unshare.IsRootless() && isNetworkFileSystem(fsMagic) { return nil, fmt.Errorf("a network file system with user namespaces is not supported. Please use a mount_program: %w", graphdriver.ErrIncompatibleFS) } } if opts.useComposefs { if unshare.IsRootless() { return nil, fmt.Errorf("composefs is not supported in user namespaces") } if _, err := getComposeFsHelper(); err != nil { return nil, fmt.Errorf("composefs helper program not found: %w", err) } } var usingMetacopy bool var supportsDType bool var supportsVolatile *bool if opts.mountProgram != "" { supportsDType = true t := true supportsVolatile = &t } else { supportsDType, err = checkAndRecordOverlaySupport(home, runhome) if err != nil { return nil, err } feature := fmt.Sprintf("metacopy(%s)", opts.mountOptions) metacopyCacheResult, _, err := cachedFeatureCheck(runhome, feature) if err == nil { if metacopyCacheResult { logrus.Debugf("Cached value indicated that metacopy is being used") } else { logrus.Debugf("Cached value indicated that metacopy is not being used") } usingMetacopy = metacopyCacheResult } else { usingMetacopy, err = doesMetacopy(home, opts.mountOptions) if err == nil { if usingMetacopy { logrus.Debugf("overlay: test mount indicated that metacopy is being used") } else { logrus.Debugf("overlay: test mount indicated that metacopy is not being used") } if err = cachedFeatureRecord(runhome, feature, usingMetacopy, ""); err != nil { return nil, fmt.Errorf("recording metacopy-being-used status: %w", err) } } else { logrus.Infof("overlay: test mount did not indicate whether or not metacopy is being used: %v", err) return nil, err } } } if !opts.skipMountHome { if err := mount.MakePrivate(home); err != nil { return nil, fmt.Errorf("overlay: failed to make mount private: %w", err) } } fileSystemType := graphdriver.FsMagicOverlay if opts.mountProgram != "" { fileSystemType = graphdriver.FsMagicFUSE } d := &Driver{ name: "overlay", home: home, imageStore: options.ImageStore, runhome: runhome, ctr: graphdriver.NewRefCounter(graphdriver.NewFsChecker(fileSystemType)), supportsDType: supportsDType, usingMetacopy: usingMetacopy, supportsVolatile: supportsVolatile, usingComposefs: opts.useComposefs, options: *opts, stagingDirsLocksMutex: sync.Mutex{}, stagingDirsLocks: make(map[string]*staging_lockfile.StagingLockFile), } d.naiveDiff = graphdriver.NewNaiveDiffDriver(d, graphdriver.NewNaiveLayerIDMapUpdater(d)) if backingFs == "xfs" { // Try to enable project quota support over xfs. if d.quotaCtl, err = quota.NewControl(home); err == nil { projectQuotaSupported = true } else if opts.quota.Size > 0 || opts.quota.Inodes > 0 { return nil, fmt.Errorf("storage options overlay.size and overlay.inodes not supported. Filesystem does not support Project Quota: %w", err) } } else if opts.quota.Size > 0 || opts.quota.Inodes > 0 { // if xfs is not the backing fs then error out if the storage-opt overlay.size is used. return nil, fmt.Errorf("storage option overlay.size and overlay.inodes only supported for backingFS XFS. Found %v", backingFs) } logrus.Debugf("backingFs=%s, projectQuotaSupported=%v, useNativeDiff=%v, usingMetacopy=%v", backingFs, projectQuotaSupported, !d.useNaiveDiff(), d.usingMetacopy) return d, nil } func parseOptions(options []string) (*overlayOptions, error) { o := &overlayOptions{} for _, option := range options { key, val, err := parsers.ParseKeyValueOpt(option) if err != nil { return nil, err } trimkey := strings.ToLower(key) trimkey = strings.TrimPrefix(trimkey, "overlay.") trimkey = strings.TrimPrefix(trimkey, "overlay2.") trimkey = strings.TrimPrefix(trimkey, ".") switch trimkey { case "override_kernel_check": logrus.Debugf("overlay: override_kernel_check option was specified, but is no longer necessary") case "mountopt": o.mountOptions = val case "size": logrus.Debugf("overlay: size=%s", val) size, err := units.RAMInBytes(val) if err != nil { return nil, err } o.quota.Size = uint64(size) case "inodes": logrus.Debugf("overlay: inodes=%s", val) inodes, err := strconv.ParseUint(val, 10, 64) if err != nil { return nil, err } o.quota.Inodes = inodes case "imagestore", "additionalimagestore": logrus.Debugf("overlay: imagestore=%s", val) // Additional read only image stores to use for lower paths if val == "" { continue } for store := range strings.SplitSeq(val, ",") { store = filepath.Clean(store) if !filepath.IsAbs(store) { return nil, fmt.Errorf("overlay: image path %q is not absolute. Can not be relative", store) } st, err := os.Stat(store) if err != nil { return nil, fmt.Errorf("overlay: can't stat imageStore dir %s: %w", store, err) } if !st.IsDir() { return nil, fmt.Errorf("overlay: image path %q must be a directory", store) } o.imageStores = append(o.imageStores, store) } case "additionallayerstore": logrus.Debugf("overlay: additionallayerstore=%s", val) // Additional read only layer stores to use for lower paths if val == "" { continue } for lstore := range strings.SplitSeq(val, ",") { elems := strings.Split(lstore, ":") lstore = filepath.Clean(elems[0]) if !filepath.IsAbs(lstore) { return nil, fmt.Errorf("overlay: additionallayerstore path %q is not absolute. Can not be relative", lstore) } st, err := os.Stat(lstore) if err != nil { return nil, fmt.Errorf("overlay: can't stat additionallayerstore dir: %w", err) } if !st.IsDir() { return nil, fmt.Errorf("overlay: additionallayerstore path %q must be a directory", lstore) } var withReference bool for _, e := range elems[1:] { switch e { case "ref": if withReference { return nil, fmt.Errorf("overlay: additionallayerstore config of %q contains %q option twice", lstore, e) } withReference = true default: return nil, fmt.Errorf("overlay: additionallayerstore config %q contains unknown option %q", lstore, e) } } o.layerStores = append(o.layerStores, additionalLayerStore{ path: lstore, withReference: withReference, }) } case "use_composefs": logrus.Debugf("overlay: use_composefs=%s", val) o.useComposefs, err = strconv.ParseBool(val) if err != nil { return nil, err } case "mount_program": logrus.Debugf("overlay: mount_program=%s", val) if val != "" { err := fileutils.Exists(val) if err != nil { return nil, fmt.Errorf("overlay: can't stat program %q: %w", val, err) } } o.mountProgram = val case "skip_mount_home": logrus.Debugf("overlay: skip_mount_home=%s", val) o.skipMountHome, err = strconv.ParseBool(val) if err != nil { return nil, err } case "ignore_chown_errors": logrus.Debugf("overlay: ignore_chown_errors=%s", val) o.ignoreChownErrors, err = strconv.ParseBool(val) if err != nil { return nil, err } case "force_mask": logrus.Debugf("overlay: force_mask=%s", val) var mask int64 switch val { case "shared": mask = 0o755 case "private": mask = 0o700 default: mask, err = strconv.ParseInt(val, 8, 32) if err != nil { return nil, err } } m := os.FileMode(mask) o.forceMask = &m default: return nil, fmt.Errorf("overlay: unknown option %s", key) } } return o, nil } func cachedFeatureSet(feature string, set bool) string { if set { return fmt.Sprintf("%s-true", feature) } return fmt.Sprintf("%s-false", feature) } func cachedFeatureCheck(runhome, feature string) (supported bool, text string, err error) { content, err := os.ReadFile(filepath.Join(runhome, cachedFeatureSet(feature, true))) if err == nil { return true, string(content), nil } content, err = os.ReadFile(filepath.Join(runhome, cachedFeatureSet(feature, false))) if err == nil { return false, string(content), nil } return false, "", err } func cachedFeatureRecord(runhome, feature string, supported bool, text string) (err error) { f, err := os.Create(filepath.Join(runhome, cachedFeatureSet(feature, supported))) if f != nil { if text != "" { fmt.Fprintf(f, "%s", text) } f.Close() } return err } func SupportsNativeOverlay(home, runhome string) (bool, error) { if os.Geteuid() != 0 || home == "" || runhome == "" { return false, nil } var contents string flagContent, err := os.ReadFile(getMountProgramFlagFile(home)) if err == nil { contents = strings.TrimSpace(string(flagContent)) } switch contents { case "true": logrus.Debugf("overlay: storage already configured with a mount-program") return false, nil case "false": // Do nothing. default: needsMountProgram, err := scanForMountProgramIndicators(home) if err != nil && !os.IsNotExist(err) { return false, err } if err := os.WriteFile(getMountProgramFlagFile(home), []byte(fmt.Sprintf("%t", needsMountProgram)), 0o600); err != nil && !os.IsNotExist(err) { return false, err } if needsMountProgram { return false, nil } // fall through to check if we find ourselves needing to use a // mount program now } for _, dir := range []string{home, runhome} { if err := fileutils.Exists(dir); err != nil { _ = idtools.MkdirAllAndChown(dir, 0o700, idtools.IDPair{UID: 0, GID: 0}) } } supportsDType, _ := checkAndRecordOverlaySupport(home, runhome) return supportsDType, nil } func supportsOverlay(home string, rootIDPair idtools.IDPair) (supportsDType bool, err error) { selinuxLabelTest := selinux.PrivContainerMountLabel() logLevel := logrus.ErrorLevel if unshare.IsRootless() { logLevel = logrus.DebugLevel } layerDir, err := os.MkdirTemp(home, "compat") if err != nil { patherr, ok := err.(*os.PathError) if ok && patherr.Err == syscall.ENOSPC { return false, err } } if err == nil { // Check if reading the directory's contents populates the d_type field, which is required // for proper operation of the overlay filesystem. supportsDType, err = fsutils.SupportsDType(layerDir) if err != nil { return false, err } if !supportsDType { return false, overlayutils.ErrDTypeNotSupported("overlay", backingFs) } // Try a test mount in the specific location we're looking at using. mergedDir := filepath.Join(layerDir, "merged") mergedSubdir := filepath.Join(mergedDir, "subdir") lower1Dir := filepath.Join(layerDir, "lower1") lower2Dir := filepath.Join(layerDir, "lower2") lower2Subdir := filepath.Join(lower2Dir, "subdir") lower2SubdirFile := filepath.Join(lower2Subdir, "file") upperDir := filepath.Join(layerDir, "upper") workDir := filepath.Join(layerDir, "work") defer func() { // Permitted to fail, since the various subdirectories // can be empty or not even there, and the home might // legitimately be not empty _ = unix.Unmount(mergedDir, unix.MNT_DETACH) _ = os.RemoveAll(layerDir) _ = os.Remove(home) }() _ = idtools.MkdirAndChown(mergedDir, 0o700, rootIDPair) _ = idtools.MkdirAndChown(lower1Dir, 0o700, rootIDPair) _ = idtools.MkdirAndChown(lower2Dir, 0o700, rootIDPair) _ = idtools.MkdirAndChown(lower2Subdir, 0o700, rootIDPair) _ = idtools.MkdirAndChown(upperDir, 0o700, rootIDPair) _ = idtools.MkdirAndChown(workDir, 0o700, rootIDPair) f, err := os.Create(lower2SubdirFile) if err != nil { logrus.Debugf("Unable to create test file: %v", err) return supportsDType, fmt.Errorf("unable to create test file: %w", err) } f.Close() flags := fmt.Sprintf("lowerdir=%s:%s,upperdir=%s,workdir=%s", lower1Dir, lower2Dir, upperDir, workDir) if selinux.GetEnabled() && selinux.SecurityCheckContext(selinuxLabelTest) == nil { // Linux 5.11 introduced unprivileged overlay mounts but it has an issue // when used together with selinux labels. // Check that overlay supports selinux labels as well. flags = label.FormatMountLabel(flags, selinuxLabelTest) } if unshare.IsRootless() { flags = fmt.Sprintf("%s,userxattr", flags) } if err := syscall.Mknod(filepath.Join(upperDir, "whiteout"), syscall.S_IFCHR|0o600, int(unix.Mkdev(0, 0))); err != nil { logrus.Debugf("Unable to create kernel-style whiteout: %v", err) return supportsDType, fmt.Errorf("unable to create kernel-style whiteout: %w", err) } if len(flags) < unix.Getpagesize() { err := unix.Mount("overlay", mergedDir, "overlay", 0, flags) if err == nil { if err = os.RemoveAll(mergedSubdir); err != nil { logrus.StandardLogger().Logf(logLevel, "overlay: removing an item from the merged directory failed: %v", err) return supportsDType, fmt.Errorf("kernel returned %v when we tried to delete an item in the merged directory: %w", err, graphdriver.ErrNotSupported) } logrus.Debugf("overlay: test mount with multiple lowers succeeded") return supportsDType, nil } logrus.Debugf("overlay: test mount with multiple lowers failed: %v", err) } flags = fmt.Sprintf("lowerdir=%s,upperdir=%s,workdir=%s", lower1Dir, upperDir, workDir) if selinux.GetEnabled() { flags = label.FormatMountLabel(flags, selinuxLabelTest) } if len(flags) < unix.Getpagesize() { err := unix.Mount("overlay", mergedDir, "overlay", 0, flags) if err == nil { logrus.StandardLogger().Logf(logLevel, "overlay: test mount with multiple lowers failed, but succeeded with a single lower") return supportsDType, fmt.Errorf("kernel too old to provide multiple lowers feature for overlay: %w", graphdriver.ErrNotSupported) } logrus.Debugf("overlay: test mount with a single lower failed: %v", err) } logrus.StandardLogger().Logf(logLevel, "'overlay' is not supported over %s at %q", backingFs, home) return supportsDType, fmt.Errorf("'overlay' is not supported over %s at %q: %w", backingFs, home, graphdriver.ErrIncompatibleFS) } logrus.StandardLogger().Logf(logLevel, "'overlay' not found as a supported filesystem on this host. Please ensure kernel is new enough and has overlay support loaded.") return supportsDType, fmt.Errorf("'overlay' not found as a supported filesystem on this host. Please ensure kernel is new enough and has overlay support loaded.: %w", graphdriver.ErrNotSupported) } func (d *Driver) useNaiveDiff() bool { if d.usingComposefs { return true } useNaiveDiffLock.Do(func() { if d.options.mountProgram != "" { useNaiveDiffOnly = true return } feature := fmt.Sprintf("native-diff(%s)", d.options.mountOptions) nativeDiffCacheResult, nativeDiffCacheText, err := cachedFeatureCheck(d.runhome, feature) if err == nil { if nativeDiffCacheResult { logrus.Debugf("Cached value indicated that native-diff is usable") } else { logrus.Debugf("Cached value indicated that native-diff is not being used") logrus.Info(nativeDiffCacheText) } useNaiveDiffOnly = !nativeDiffCacheResult return } if err := doesSupportNativeDiff(d.home, d.options.mountOptions); err != nil { nativeDiffCacheText = fmt.Sprintf("Not using native diff for overlay, this may cause degraded performance for building images: %v", err) logrus.Info(nativeDiffCacheText) useNaiveDiffOnly = true } if err := cachedFeatureRecord(d.runhome, feature, !useNaiveDiffOnly, nativeDiffCacheText); err != nil { logrus.Warnf("Recording overlay native-diff support status: %v", err) } }) return useNaiveDiffOnly } func (d *Driver) String() string { return d.name } // Status returns current driver information in a two dimensional string array. // Output contains "Backing Filesystem" used in this implementation. func (d *Driver) Status() [][2]string { supportsVolatile, err := d.getSupportsVolatile() if err != nil { supportsVolatile = false } return [][2]string{ {"Backing Filesystem", backingFs}, {"Supports d_type", strconv.FormatBool(d.supportsDType)}, {"Native Overlay Diff", strconv.FormatBool(!d.useNaiveDiff())}, {"Using metacopy", strconv.FormatBool(d.usingMetacopy)}, {"Supports shifting", strconv.FormatBool(d.SupportsShifting(nil, nil))}, {"Supports volatile", strconv.FormatBool(supportsVolatile)}, } } // Metadata returns meta data about the overlay driver such as // LowerDir, UpperDir, WorkDir and MergeDir used to store data. func (d *Driver) Metadata(id string) (map[string]string, error) { dir, _, inAdditionalStore := d.dir2(id, false) if err := fileutils.Exists(dir); err != nil { return nil, err } metadata := map[string]string{ "WorkDir": path.Join(dir, "work"), "MergedDir": d.getMergedDir(id, dir, inAdditionalStore), "UpperDir": path.Join(dir, "diff"), } lowerDirs, err := d.getLowerDirs(id) if err != nil { return nil, err } if len(lowerDirs) > 0 { metadata["LowerDir"] = strings.Join(lowerDirs, ":") } return metadata, nil } // Cleanup any state created by overlay which should be cleaned when // the storage is being shutdown. The only state created by the driver // is the bind mount on the home directory. func (d *Driver) Cleanup() error { anyPresent := d.pruneStagingDirectories() if anyPresent { return nil } return mount.Unmount(d.home) } // pruneStagingDirectories cleans up any staging directory that was leaked. // It returns whether any staging directory is still present. func (d *Driver) pruneStagingDirectories() bool { d.stagingDirsLocksMutex.Lock() for _, lock := range d.stagingDirsLocks { if err := lock.UnlockAndDelete(); err != nil { logrus.Warnf("Failed to unlock and delete staging lock file: %v", err) } } clear(d.stagingDirsLocks) d.stagingDirsLocksMutex.Unlock() anyPresent := false stagingDirBase := filepath.Join(d.homeDirForImageStore(), stagingDir) dirs, err := os.ReadDir(stagingDirBase) if err == nil { for _, dir := range dirs { stagingDirToRemove := filepath.Join(stagingDirBase, dir.Name()) lock, err := staging_lockfile.TryLockPath(filepath.Join(stagingDirToRemove, stagingLockFile)) if err != nil { anyPresent = true continue } _ = os.RemoveAll(stagingDirToRemove) if err := lock.UnlockAndDelete(); err != nil { logrus.Warnf("Failed to unlock and delete staging lock file: %v", err) } } } return anyPresent } // LookupAdditionalLayer looks up additional layer store by the specified // TOC digest and ref and returns an object representing that layer. // This API is experimental and can be changed without bumping the major version number. // TODO: to remove the comment once it's no longer experimental. func (d *Driver) LookupAdditionalLayer(tocDigest digest.Digest, ref string) (graphdriver.AdditionalLayer, error) { l, err := d.getAdditionalLayerPath(tocDigest, ref) if err != nil { return nil, err } // Tell the additional layer store that we use this layer. // This will increase reference counter on the store's side. // This will be decreased on Release() method. notifyUseAdditionalLayer(l) return &additionalLayer{ path: l, d: d, }, nil } // LookupAdditionalLayerByID looks up additional layer store by the specified // ID and returns an object representing that layer. // This API is experimental and can be changed without bumping the major version number. // TODO: to remove the comment once it's no longer experimental. func (d *Driver) LookupAdditionalLayerByID(id string) (graphdriver.AdditionalLayer, error) { l, err := d.getAdditionalLayerPathByID(id) if err != nil { return nil, err } // Tell the additional layer store that we use this layer. // This will increase reference counter on the store's side. // This will be decreased on Release() method. notifyUseAdditionalLayer(l) return &additionalLayer{ path: l, d: d, }, nil } // CreateFromTemplate creates a layer with the same contents and parent as another layer. func (d *Driver) CreateFromTemplate(id, template string, templateIDMappings *idtools.IDMappings, parent string, parentIDMappings *idtools.IDMappings, opts *graphdriver.CreateOpts, readWrite bool) error { if readWrite { return d.CreateReadWrite(id, template, opts) } return d.Create(id, template, opts) } // CreateReadWrite creates a layer that is writable for use as a container // file system. func (d *Driver) CreateReadWrite(id, parent string, opts *graphdriver.CreateOpts) error { if opts != nil && len(opts.StorageOpt) != 0 && !projectQuotaSupported { return fmt.Errorf("--storage-opt is supported only for overlay over xfs with 'pquota' mount option") } if opts == nil { opts = &graphdriver.CreateOpts{ StorageOpt: map[string]string{}, } } if d.options.forceMask != nil && d.options.mountProgram == "" { return fmt.Errorf("overlay: force_mask option for writeable layers is only supported with a mount_program") } if _, ok := opts.StorageOpt["size"]; !ok { if opts.StorageOpt == nil { opts.StorageOpt = map[string]string{} } opts.StorageOpt["size"] = strconv.FormatUint(d.options.quota.Size, 10) } if _, ok := opts.StorageOpt["inodes"]; !ok { if opts.StorageOpt == nil { opts.StorageOpt = map[string]string{} } opts.StorageOpt["inodes"] = strconv.FormatUint(d.options.quota.Inodes, 10) } return d.create(id, parent, opts, false) } // Create is used to create the upper, lower, and merge directories required for overlay fs for a given id. // The parent filesystem is used to configure these directories for the overlay. func (d *Driver) Create(id, parent string, opts *graphdriver.CreateOpts) (retErr error) { if opts != nil && len(opts.StorageOpt) != 0 { if _, ok := opts.StorageOpt["size"]; ok { return fmt.Errorf("--storage-opt size is only supported for ReadWrite Layers") } if _, ok := opts.StorageOpt["inodes"]; ok { return fmt.Errorf("--storage-opt inodes is only supported for ReadWrite Layers") } } return d.create(id, parent, opts, true) } // getLayerPermissions returns the base permissions to use for the layer directories. // The first return value is the idPair to create the possible parent directories with. // The second return value is the mode how it should be stored on disk. // The third return value is the mode the layer expects to have which may be stored // in an xattr when using forceMask, without forceMask both values are the same. func (d *Driver) getLayerPermissions(parent string, uidMaps, gidMaps []idtools.IDMap) (idtools.IDPair, idtools.Stat, idtools.Stat, error) { rootUID, rootGID, err := idtools.GetRootUIDGID(uidMaps, gidMaps) if err != nil { return idtools.IDPair{}, idtools.Stat{}, idtools.Stat{}, err } idPair := idtools.IDPair{ UID: rootUID, GID: rootGID, } st := idtools.Stat{IDs: idPair, Mode: defaultPerms} if parent != "" { parentBase := d.dir(parent) parentDiff := filepath.Join(parentBase, "diff") if xSt, err := idtools.GetContainersOverrideXattr(parentDiff); err == nil { st = xSt } else { systemSt, err := system.Stat(parentDiff) if err != nil { return idtools.IDPair{}, idtools.Stat{}, idtools.Stat{}, err } st.IDs.UID = int(systemSt.UID()) st.IDs.GID = int(systemSt.GID()) st.Mode = os.FileMode(systemSt.Mode()) } } forcedSt := st if d.options.forceMask != nil { forcedSt.IDs = idPair forcedSt.Mode = *d.options.forceMask } return idPair, forcedSt, st, nil } func (d *Driver) create(id, parent string, opts *graphdriver.CreateOpts, readOnly bool) (retErr error) { dir, homedir, _ := d.dir2(id, readOnly) disableQuota := readOnly var uidMaps []idtools.IDMap var gidMaps []idtools.IDMap if opts != nil && opts.IDMappings != nil { uidMaps = opts.IDMappings.UIDs() gidMaps = opts.IDMappings.GIDs() } // Make the link directory if it does not exist if err := idtools.MkdirAllAndChown(path.Join(homedir, linkDir), 0o755, idtools.IDPair{UID: 0, GID: 0}); err != nil { return err } idPair, forcedSt, st, err := d.getLayerPermissions(parent, uidMaps, gidMaps) if err != nil { return err } if err := idtools.MkdirAllAndChownNew(path.Dir(dir), 0o755, idPair); err != nil { return err } if err := fileutils.Lexists(dir); err == nil { logrus.Warnf("Trying to create a layer %#v while directory %q already exists; removing it first", id, dir) // Don’t just os.RemoveAll(dir) here; d.Remove also removes the link in linkDir, // so that we can’t end up with two symlinks in linkDir pointing to the same layer. if err := d.Remove(id); err != nil { return fmt.Errorf("removing a pre-existing layer directory %q: %w", dir, err) } } if err := idtools.MkdirAllAndChownNew(dir, 0o700, idPair); err != nil { return err } defer func() { // Clean up on failure if retErr != nil { if err2 := os.RemoveAll(dir); err2 != nil { logrus.Errorf("While recovering from a failure creating a layer, error deleting %#v: %v", dir, err2) } } }() if d.quotaCtl != nil && !disableQuota { quota := quota.Quota{} if opts != nil && len(opts.StorageOpt) > 0 { driver := &Driver{} if err := d.parseStorageOpt(opts.StorageOpt, driver); err != nil { return err } if driver.options.quota.Size > 0 { quota.Size = driver.options.quota.Size } if driver.options.quota.Inodes > 0 { quota.Inodes = driver.options.quota.Inodes } } // Set container disk quota limit // If it is set to 0, we will track the disk usage, but not enforce a limit if err := d.quotaCtl.SetQuota(dir, quota); err != nil { return err } } diff := path.Join(dir, "diff") if err := idtools.MkdirAndChown(diff, forcedSt.Mode, forcedSt.IDs); err != nil { return err } if d.options.forceMask != nil { st.Mode |= os.ModeDir if err := idtools.SetContainersOverrideXattr(diff, st); err != nil { return err } } lid := generateID(idLength) linkBase := path.Join("..", id, "diff") if err := os.Symlink(linkBase, path.Join(homedir, linkDir, lid)); err != nil { return err } // Write link id to link file if err := os.WriteFile(path.Join(dir, "link"), []byte(lid), 0o644); err != nil { return err } if err := idtools.MkdirAndChown(path.Join(dir, "work"), 0o700, forcedSt.IDs); err != nil { return err } if err := idtools.MkdirAndChown(path.Join(dir, "merged"), 0o700, forcedSt.IDs); err != nil { return err } // if no parent directory, create a dummy lower directory and skip writing a "lowers" file if parent == "" { return idtools.MkdirAndChown(path.Join(dir, "empty"), 0o700, forcedSt.IDs) } lower, err := d.getLower(parent) if err != nil { return err } if lower != "" { if err := os.WriteFile(path.Join(dir, lowerFile), []byte(lower), 0o666); err != nil { return err } } return nil } // Parse overlay storage options func (d *Driver) parseStorageOpt(storageOpt map[string]string, driver *Driver) error { // Read size to set the disk project quota per container for key, val := range storageOpt { key := strings.ToLower(key) switch key { case "size": size, err := units.RAMInBytes(val) if err != nil { return err } driver.options.quota.Size = uint64(size) case "inodes": inodes, err := strconv.ParseUint(val, 10, 64) if err != nil { return err } driver.options.quota.Inodes = inodes default: return fmt.Errorf("unknown option %s", key) } } return nil } func (d *Driver) getLower(parent string) (string, error) { parentDir := d.dir(parent) // Ensure parent exists if err := fileutils.Lexists(parentDir); err != nil { return "", err } // Read Parent link fileA parentLink, err := os.ReadFile(path.Join(parentDir, "link")) if err != nil { if !os.IsNotExist(err) { return "", err } logrus.Warnf("Can't read parent link %q because it does not exist. Going through storage to recreate the missing links.", path.Join(parentDir, "link")) if err := d.recreateSymlinks(); err != nil { return "", fmt.Errorf("recreating the links: %w", err) } parentLink, err = os.ReadFile(path.Join(parentDir, "link")) if err != nil { return "", err } } lowers := []string{path.Join(linkDir, string(parentLink))} parentLower, err := os.ReadFile(path.Join(parentDir, lowerFile)) if err == nil { parentLowers := strings.SplitSeq(string(parentLower), ":") lowers = slices.AppendSeq(lowers, parentLowers) } return strings.Join(lowers, ":"), nil } func (d *Driver) dir(id string) string { p, _, _ := d.dir2(id, false) return p } func (d *Driver) getAllImageStores() []string { additionalImageStores := d.AdditionalImageStores() if d.imageStore != "" { additionalImageStores = append([]string{d.imageStore}, additionalImageStores...) } return additionalImageStores } // homeDirForImageStore returns the home directory to use when an image store is configured func (d *Driver) homeDirForImageStore() string { if d.imageStore != "" { return path.Join(d.imageStore, d.name) } // If there is not an image store configured, use the same // store return d.home } func (d *Driver) dir2(id string, useImageStore bool) (string, string, bool) { homedir := d.home if useImageStore { homedir = d.homeDirForImageStore() } newpath := path.Join(homedir, id) if err := fileutils.Exists(newpath); err != nil { for _, p := range d.getAllImageStores() { l := path.Join(p, d.name, id) err = fileutils.Exists(l) if err == nil { return l, homedir, true } } } return newpath, homedir, false } func (d *Driver) getLowerDirs(id string) ([]string, error) { var lowersArray []string lowers, err := os.ReadFile(path.Join(d.dir(id), lowerFile)) if err == nil { for s := range strings.SplitSeq(string(lowers), ":") { lower := d.dir(s) lp, err := os.Readlink(lower) // if the link does not exist, we lost the symlinks during a sudden reboot. // Let's go ahead and recreate those symlinks. if err != nil { if os.IsNotExist(err) { logrus.Warnf("Can't read link %q because it does not exist. A storage corruption might have occurred, attempting to recreate the missing symlinks. It might be best wipe the storage to avoid further errors due to storage corruption.", lower) if err := d.recreateSymlinks(); err != nil { return nil, fmt.Errorf("recreating the missing symlinks: %w", err) } // let's call Readlink on lower again now that we have recreated the missing symlinks lp, err = os.Readlink(lower) if err != nil { return nil, err } } else { return nil, err } } lowersArray = append(lowersArray, path.Clean(d.dir(path.Join("link", lp)))) } } else if !os.IsNotExist(err) { return nil, err } return lowersArray, nil } func (d *Driver) optsAppendMappings(opts string, uidMaps, gidMaps []idtools.IDMap) string { if uidMaps != nil { var uids, gids bytes.Buffer if len(uidMaps) == 1 && uidMaps[0].Size == 1 { fmt.Fprintf(&uids, "squash_to_uid=%d", uidMaps[0].HostID) } else { uids.WriteString("uidmapping=") for _, i := range uidMaps { if uids.Len() > 0 { uids.WriteString(":") } fmt.Fprintf(&uids, "%d:%d:%d", i.ContainerID, i.HostID, i.Size) } } if len(gidMaps) == 1 && gidMaps[0].Size == 1 { fmt.Fprintf(&gids, "squash_to_gid=%d", gidMaps[0].HostID) } else { gids.WriteString("gidmapping=") for _, i := range gidMaps { if gids.Len() > 0 { gids.WriteString(":") } fmt.Fprintf(&gids, "%d:%d:%d", i.ContainerID, i.HostID, i.Size) } } return fmt.Sprintf("%s,%s,%s", opts, uids.String(), gids.String()) } return opts } // Remove cleans the directories that are created for this id. func (d *Driver) Remove(id string) error { return d.removeCommon(id, system.EnsureRemoveAll) } func (d *Driver) removeCommon(id string, cleanup func(string) error) error { dir := d.dir(id) lid, err := os.ReadFile(path.Join(dir, "link")) if err == nil { linkPath := path.Join(d.home, linkDir, string(lid)) if err := cleanup(linkPath); err != nil { logrus.Debugf("Failed to remove link: %v", err) } } d.releaseAdditionalLayerByID(id) if err := cleanup(dir); err != nil && !os.IsNotExist(err) { return err } if d.quotaCtl != nil { d.quotaCtl.ClearQuota(dir) if d.imageStore != "" { d.quotaCtl.ClearQuota(d.imageStore) } } return nil } func (d *Driver) GetTempDirRootDirs() []string { tempDirs := []string{filepath.Join(d.home, tempDirName)} // Include imageStore temp directory if it's configured // Writable layers can only be in d.home or d.imageStore, not in additional image stores if d.imageStore != "" { tempDirs = append(tempDirs, filepath.Join(d.imageStore, d.name, tempDirName)) } return tempDirs } // Determine the correct temp directory root based on where the layer actually exists. func (d *Driver) getTempDirRoot(id string) string { layerDir := d.dir(id) if d.imageStore != "" { expectedLayerDir := path.Join(d.imageStore, d.name, id) if layerDir == expectedLayerDir { return filepath.Join(d.imageStore, d.name, tempDirName) } } return filepath.Join(d.home, tempDirName) } // getTempDirRootForNewLayer returns the correct temp directory root based on where // the layer should be created. // // This must be kept in sync with GetTempDirRootDirs(). func (d *Driver) getTempDirRootForNewLayer() string { return filepath.Join(d.homeDirForImageStore(), tempDirName) } func (d *Driver) DeferredRemove(id string) (tempdir.CleanupTempDirFunc, error) { tempDirRoot := d.getTempDirRoot(id) t, err := tempdir.NewTempDir(tempDirRoot) if err != nil { return nil, err } if err := d.removeCommon(id, t.StageDeletion); err != nil { return t.Cleanup, fmt.Errorf("failed to add to stage directory: %w", err) } return t.Cleanup, nil } // recreateSymlinks goes through the driver's home directory and checks if the diff directory // under each layer has a symlink created for it under the linkDir. If the symlink does not // exist, it creates them func (d *Driver) recreateSymlinks() error { // We have at most 3 corrective actions per layer, so 10 iterations is plenty. const maxIterations = 10 // List all the directories under the home directory dirs, err := os.ReadDir(d.home) if err != nil { return fmt.Errorf("reading driver home directory %q: %w", d.home, err) } // This makes the link directory if it doesn't exist if err := idtools.MkdirAllAndChown(path.Join(d.home, linkDir), 0o755, idtools.IDPair{UID: 0, GID: 0}); err != nil { return err } // Keep looping as long as we take some corrective action in each iteration var errs error madeProgress := true iterations := 0 for madeProgress { errs = nil madeProgress = false // Check that for each layer, there's a link in "l" with the name in // the layer's "link" file that points to the layer's "diff" directory. for _, dir := range dirs { // Skip over the linkDir, stagingDir, tempDirName and anything that is not a directory if dir.Name() == linkDir || dir.Name() == stagingDir || dir.Name() == tempDirName || !dir.IsDir() { continue } // Read the "link" file under each layer to get the name of the symlink data, err := os.ReadFile(path.Join(d.dir(dir.Name()), "link")) if err != nil { errs = errors.Join(errs, fmt.Errorf("reading name of symlink for %q: %w", dir.Name(), err)) continue } linkPath := path.Join(d.home, linkDir, strings.Trim(string(data), "\n")) // Check if the symlink exists, and if it doesn't, create it again with the // name we got from the "link" file err = fileutils.Lexists(linkPath) if err != nil && os.IsNotExist(err) { if err := os.Symlink(path.Join("..", dir.Name(), "diff"), linkPath); err != nil { errs = errors.Join(errs, err) continue } madeProgress = true } else if err != nil { errs = errors.Join(errs, err) continue } } // linkDirFullPath is the full path to the linkDir linkDirFullPath := filepath.Join(d.home, "l") // Now check if we somehow lost a "link" file, by making sure // that each symlink we have corresponds to one. links, err := os.ReadDir(linkDirFullPath) if err != nil { errs = errors.Join(errs, err) continue } // Go through all of the symlinks in the "l" directory for _, link := range links { // Read the symlink's target, which should be "../$layer/diff" target, err := os.Readlink(filepath.Join(linkDirFullPath, link.Name())) if err != nil { errs = errors.Join(errs, err) continue } targetComponents := strings.Split(target, string(os.PathSeparator)) if len(targetComponents) != 3 || targetComponents[0] != ".." || targetComponents[2] != "diff" { errs = errors.Join(errs, fmt.Errorf("link target of %q looks weird: %q", link, target)) // force the link to be recreated on the next pass if err := os.Remove(filepath.Join(linkDirFullPath, link.Name())); err != nil { if !os.IsNotExist(err) { errs = errors.Join(errs, fmt.Errorf("removing link %q: %w", link, err)) } // else don’t report any error, but also don’t set madeProgress. continue } madeProgress = true continue } // Reconstruct the name of the target's link file and check that // it has the basename of our symlink in it. targetID := targetComponents[1] linkFile := filepath.Join(d.dir(targetID), "link") data, err := os.ReadFile(linkFile) if err != nil || string(data) != link.Name() { // NOTE: If two or more links point to the same target, we will update linkFile // with every value of link.Name(), and set madeProgress = true every time. if err := os.WriteFile(linkFile, []byte(link.Name()), 0o644); err != nil { errs = errors.Join(errs, fmt.Errorf("correcting link for layer %s: %w", targetID, err)) continue } madeProgress = true } } iterations++ if iterations >= maxIterations { errs = errors.Join(errs, fmt.Errorf("reached %d iterations in overlay graph driver’s recreateSymlink, giving up", iterations)) break } } return errs } // Get creates and mounts the required file system for the given id and returns the mount path. func (d *Driver) Get(id string, options graphdriver.MountOpts) (string, error) { return d.get(id, false, options) } func (d *Driver) get(id string, disableShifting bool, options graphdriver.MountOpts) (_ string, retErr error) { dir, _, inAdditionalStore := d.dir2(id, false) if err := fileutils.Exists(dir); err != nil { return "", err } if _, err := redirectDiffIfAdditionalLayer(path.Join(dir, "diff"), true); err != nil { return "", err } // user namespace requires this to move a directory from lower to upper. rootUID, rootGID, err := idtools.GetRootUIDGID(options.UidMaps, options.GidMaps) if err != nil { return "", err } rootIDs := idtools.IDPair{UID: rootUID, GID: rootGID} mergedDir := d.getMergedDir(id, dir, inAdditionalStore) // Attempt to create the merged dir if it doesn't exist, but don't chown an already existing directory (it might be in an additional store) if err := idtools.MkdirAllAndChownNew(mergedDir, 0o700, rootIDs); err != nil && !os.IsExist(err) { return "", err } if count := d.ctr.Increment(mergedDir); count > 1 { return mergedDir, nil } defer func() { if retErr != nil { if c := d.ctr.Decrement(mergedDir); c <= 0 { if mntErr := unix.Unmount(mergedDir, 0); mntErr != nil { // Ignore EINVAL, it means the directory is not a mount point and it can happen // if the current function fails before the mount point is created. if !errors.Is(mntErr, unix.EINVAL) { logrus.Errorf("Unmounting %v: %v", mergedDir, mntErr) } } } } }() readWrite := !inAdditionalStore if !d.SupportsShifting(options.UidMaps, options.GidMaps) || options.DisableShifting { disableShifting = true } logLevel := logrus.WarnLevel if unshare.IsRootless() { logLevel = logrus.DebugLevel } optsList := options.Options needsIDMapping := !disableShifting && len(options.UidMaps) > 0 && len(options.GidMaps) > 0 && d.options.mountProgram == "" if len(optsList) == 0 { if d.options.mountOptions != "" { optsList = strings.Split(d.options.mountOptions, ",") } } else { // If metacopy=on is present in d.options.mountOptions it must be present in the mount // options otherwise the kernel refuses to follow the metacopy xattr. if hasMetacopyOption(strings.Split(d.options.mountOptions, ",")) && !hasMetacopyOption(options.Options) { if d.usingMetacopy { logrus.StandardLogger().Logf(logrus.DebugLevel, "Adding metacopy option, configured globally") optsList = append(optsList, "metacopy=on") } } } if !d.usingMetacopy { if hasMetacopyOption(optsList) { if d.options.mountProgram == "" { release := "" var uts unix.Utsname if err := unix.Uname(&uts); err == nil { release = " " + string(uts.Release[:]) + " " + string(uts.Version[:]) } logrus.StandardLogger().Logf(logLevel, "Ignoring global metacopy option, not supported with booted kernel %s", release) } else { logrus.Debugf("Ignoring global metacopy option, the mount program doesn't support it") } } optsList = slices.DeleteFunc(optsList, func(opt string) bool { return opt == "metacopy=on" }) } if slices.Contains(optsList, "ro") { readWrite = false } lowers, err := os.ReadFile(path.Join(dir, lowerFile)) if err != nil && !os.IsNotExist(err) { return "", err } splitLowers := strings.Split(string(lowers), ":") if len(splitLowers) > maxDepth { return "", errors.New("max depth exceeded") } // absLowers is the list of lowers as absolute paths. absLowers := []string{} diffN := 1 perms := defaultPerms if d.options.forceMask != nil { perms = *d.options.forceMask } permsKnown := false st, err := os.Stat(filepath.Join(dir, nameWithSuffix("diff", diffN))) if err == nil { perms = st.Mode() permsKnown = true } for err == nil { absLowers = append(absLowers, filepath.Join(dir, nameWithSuffix("diff", diffN))) diffN++ err = fileutils.Exists(filepath.Join(dir, nameWithSuffix("diff", diffN))) } idmappedMountProcessPid := -1 if needsIDMapping { pid, cleanupFunc, err := idmap.CreateUsernsProcess(options.UidMaps, options.GidMaps) if err != nil { return "", err } idmappedMountProcessPid = pid defer cleanupFunc() } skipIDMappingLayers := make(map[string]string) composefsMounts := []string{} defer func() { for _, m := range composefsMounts { defer func(m string) { if err := unix.Unmount(m, unix.MNT_DETACH); err != nil { logrus.Warnf("Unmount %q: %v", m, err) } }(m) } }() composeFsLayers := []string{} maybeAddComposefsMount := func(lowerID string, i int, readWrite bool) (string, error) { composefsBlob := d.getComposefsData(lowerID) if err := fileutils.Exists(composefsBlob); err != nil { if os.IsNotExist(err) { return "", nil } return "", err } logrus.Debugf("overlay: using composefs blob %s for lower %s", composefsBlob, lowerID) if readWrite && i == 0 { return "", fmt.Errorf("cannot mount a composefs layer as writeable") } dest := d.getStorePrivateDirectory(id, dir, fmt.Sprintf("composefs-layers/%d", i), inAdditionalStore) if err := os.MkdirAll(dest, 0o700); err != nil { return "", err } if err := mountComposefsBlob(composefsBlob, dest); err != nil { return "", err } composefsMounts = append(composefsMounts, dest) composeFsPath, err := d.getDiffPath(lowerID) if err != nil { return "", err } composeFsLayers = append(composeFsLayers, composeFsPath) skipIDMappingLayers[composeFsPath] = composeFsPath return dest, nil } diffDir := path.Join(dir, "diff") if dest, err := maybeAddComposefsMount(id, 0, readWrite); err != nil { return "", err } else if dest != "" { diffDir = dest } // For each lower, resolve its path, and append it and any additional diffN // directories to the lowers list. for i, l := range splitLowers { if l == "" { continue } lower := "" newpath := path.Join(d.home, l) if st, err := os.Stat(newpath); err != nil { for _, p := range d.getAllImageStores() { lower = path.Join(p, d.name, l) if st2, err2 := os.Stat(lower); err2 == nil { if !permsKnown { perms = st2.Mode() permsKnown = true } break } lower = "" } // if it is a "not found" error, that means the symlinks were lost in a sudden reboot // so call the recreateSymlinks function to go through all the layer dirs and recreate // the symlinks with the name from their respective "link" files if lower == "" && os.IsNotExist(err) { logrus.Warnf("Can't stat lower layer %q because it does not exist. Going through storage to recreate the missing symlinks.", newpath) if err := d.recreateSymlinks(); err != nil { return "", fmt.Errorf("recreating the missing symlinks: %w", err) } lower = newpath } else if lower == "" { return "", fmt.Errorf("can't stat lower layer %q: %w", newpath, err) } } else { if !permsKnown { perms = st.Mode() permsKnown = true } lower = newpath } linkContent, err := os.Readlink(lower) if err != nil { return "", err } lowerID := filepath.Base(filepath.Dir(linkContent)) composefsMount, err := maybeAddComposefsMount(lowerID, i+1, readWrite) if err != nil { return "", err } if composefsMount != "" { if needsIDMapping { if err := idmap.CreateIDMappedMount(composefsMount, composefsMount, idmappedMountProcessPid); err != nil { return "", fmt.Errorf("create mapped mount for %q: %w", composefsMount, err) } skipIDMappingLayers[composefsMount] = composefsMount // overlay takes a reference on the mount, so it is safe to unmount // the mapped idmounts as soon as the final overlay file system is mounted. defer func() { if err := unix.Unmount(composefsMount, unix.MNT_DETACH); err != nil { logrus.Warnf("Unmount %q: %v", composefsMount, err) } }() } absLowers = append(absLowers, composefsMount) continue } absLowers = append(absLowers, lower) diffN = 1 err = fileutils.Exists(dumbJoin(lower, "..", nameWithSuffix("diff", diffN))) for err == nil { absLowers = append(absLowers, dumbJoin(lower, "..", nameWithSuffix("diff", diffN))) diffN++ err = fileutils.Exists(dumbJoin(lower, "..", nameWithSuffix("diff", diffN))) } } if len(composeFsLayers) > 0 { optsList = append(optsList, "metacopy=on", "redirect_dir=on") } if len(absLowers) == 0 { absLowers = append(absLowers, path.Join(dir, "empty")) } if err := idtools.MkdirAllAndChown(diffDir, perms, rootIDs); err != nil { if !inAdditionalStore { return "", err } // if it is in an additional store, do not fail if the directory already exists if err2 := fileutils.Exists(diffDir); err2 != nil { return "", err } } workdir := path.Join(dir, "work") if d.options.mountProgram == "" && unshare.IsRootless() { optsList = append(optsList, "userxattr") } if options.Volatile && !slices.Contains(optsList, "volatile") { supported, err := d.getSupportsVolatile() if err != nil { return "", err } // If "volatile" is not supported by the file system, just ignore the request if supported { optsList = append(optsList, "volatile") } } if needsIDMapping { var newAbsDir []string idMappedMounts := make(map[string]string) mappedRoot := filepath.Join(d.home, id, "mapped") if err := os.MkdirAll(mappedRoot, 0o700); err != nil { return "", err } // rewrite the lower dirs to their idmapped mount. c := 0 for _, absLower := range absLowers { mappedMountSrc := getMappedMountRoot(absLower) if _, ok := skipIDMappingLayers[absLower]; ok { newAbsDir = append(newAbsDir, absLower) continue } root, found := idMappedMounts[mappedMountSrc] if !found { root = filepath.Join(mappedRoot, fmt.Sprintf("%d", c)) c++ if err := idmap.CreateIDMappedMount(mappedMountSrc, root, idmappedMountProcessPid); err != nil { return "", fmt.Errorf("create mapped mount for %q on %q: %w", mappedMountSrc, root, err) } idMappedMounts[mappedMountSrc] = root // overlay takes a reference on the mount, so it is safe to unmount // the mapped idmounts as soon as the final overlay file system is mounted. defer func() { if err := unix.Unmount(root, unix.MNT_DETACH); err != nil { logrus.Warnf("Unmount %q: %v", root, err) } }() } // relative path to the layer through the id mapped mount rel, err := filepath.Rel(mappedMountSrc, absLower) if err != nil { return "", err } newAbsDir = append(newAbsDir, filepath.Join(root, rel)) } absLowers = newAbsDir } lowerDirs := strings.Join(absLowers, ":") if len(composeFsLayers) > 0 { sep := "::" supportsDataOnly, err := d.getSupportsDataOnly() if err != nil { return "", err } if !supportsDataOnly { sep = ":" } composeFsLayersLowerDirs := strings.Join(composeFsLayers, sep) lowerDirs = lowerDirs + sep + composeFsLayersLowerDirs } // absLowers is not valid anymore now as we have added composeFsLayers to it, so prevent // its usage. absLowers = nil //nolint:ineffassign var opts string if readWrite { opts = fmt.Sprintf("lowerdir=%s,upperdir=%s,workdir=%s", lowerDirs, diffDir, workdir) } else { opts = fmt.Sprintf("lowerdir=%s:%s", diffDir, lowerDirs) } if len(optsList) > 0 { opts = fmt.Sprintf("%s,%s", opts, strings.Join(optsList, ",")) } mountData := label.FormatMountLabel(opts, options.MountLabel) mountFunc := unix.Mount mountTarget := mergedDir pageSize := unix.Getpagesize() if d.options.mountProgram != "" { mountFunc = func(source string, target string, mType string, flags uintptr, label string) error { if !disableShifting { label = d.optsAppendMappings(label, options.UidMaps, options.GidMaps) } // if forceMask is in place, tell fuse-overlayfs to write the permissions mask to an unprivileged xattr as well. if d.options.forceMask != nil { label = label + ",xattr_permissions=2" } mountProgram := exec.Command(d.options.mountProgram, "-o", label, target) mountProgram.Dir = d.home var b bytes.Buffer mountProgram.Stderr = &b err := mountProgram.Run() if err != nil { output := b.String() if output == "" { output = "" } return fmt.Errorf("using mount program %s: %s: %w", d.options.mountProgram, output, err) } return nil } } else if len(mountData) >= pageSize { // Use mountFrom when the mount data has exceeded the page size. The mount syscall fails if // the mount data cannot fit within a page and relative links make the mount data much // smaller at the expense of requiring a fork exec to chdir(). if readWrite { diffDir := path.Join(id, "diff") workDir := path.Join(id, "work") opts = fmt.Sprintf("lowerdir=%s,upperdir=%s,workdir=%s", lowerDirs, diffDir, workDir) } else { opts = fmt.Sprintf("lowerdir=%s:%s", diffDir, lowerDirs) } if len(optsList) > 0 { opts = strings.Join(append([]string{opts}, optsList...), ",") } mountData = label.FormatMountLabel(opts, options.MountLabel) mountFunc = func(source string, target string, mType string, flags uintptr, label string) error { return mountOverlayFrom(d.home, source, target, mType, flags, label) } if !inAdditionalStore { mountTarget = path.Join(id, "merged") } } // overlay has a check in place to prevent mounting the same file system twice // if volatile was already specified. Yes, the kernel repeats the "work" component. err = os.RemoveAll(filepath.Join(workdir, "work", "incompat", "volatile")) if err != nil && !errors.Is(err, os.ErrNotExist) { return "", err } flags, data := mount.ParseOptions(mountData) logrus.Debugf("overlay: mount_data=%s", mountData) if err := mountFunc("overlay", mountTarget, "overlay", uintptr(flags), data); err != nil { return "", fmt.Errorf("creating overlay mount to %s, mount_data=%q: %w", mountTarget, mountData, err) } return mergedDir, nil } // getStorePrivateDirectory returns a directory path for storing data that requires exclusive access. // If 'inAdditionalStore' is true, the path will be under the rundir, otherwise it will be placed in // the primary store. func (d *Driver) getStorePrivateDirectory(id, layerDir, subdir string, inAdditionalStore bool) string { if inAdditionalStore { return path.Join(d.runhome, id, subdir) } return path.Join(layerDir, subdir) } // getMergedDir returns the directory path that should be used as the mount point for the overlayfs. func (d *Driver) getMergedDir(id, dir string, inAdditionalStore bool) string { // Ordinarily, .Get() (layer mounting) callers are supposed to guarantee exclusion. // // But additional stores are initialized with RO locks and don’t support a write // lock operation at all; and naiveDiff operations cause mounts/unmounts, so they might // happen on code paths where we might only holding a RO lock for the additional store. // To prevent races with other processes mounting or unmounting the layer, // use a private directory under the main store rundir, not the "merged" directory inside the // original layer store holding the layer data. // // To support this, contrary to the _general_ locking rules for .Diff / .Changes (which allow a RO lock), // the top-level Store implementation uses an exclusive lock for the primary layer store; // and since the rundir cannot be shared for different stores, it is safe to assume the // current process has exclusive access to it. // // TO DO: LOCKING BUG: the .DiffSize operation does not currently hold an exclusive lock on the primary store. // (_Some_ of the callers might be better ported to use a metadata-only size computation instead of DiffSize, // but DiffSize probably needs to remain for computing sizes of container’s RW layers.) return d.getStorePrivateDirectory(id, dir, "merged", inAdditionalStore) } // Put unmounts the mount path created for the give id. func (d *Driver) Put(id string) error { dir, _, inAdditionalStore := d.dir2(id, false) if err := fileutils.Exists(dir); err != nil { return err } mountpoint := d.getMergedDir(id, dir, inAdditionalStore) if count := d.ctr.Decrement(mountpoint); count > 0 { return nil } if err := fileutils.Exists(path.Join(dir, lowerFile)); err != nil && !os.IsNotExist(err) { return err } unmounted := false mappedRoot := filepath.Join(d.home, id, "mapped") // It should not happen, but cleanup any mapped mount if it was leaked. if err := fileutils.Exists(mappedRoot); err == nil { mounts, err := os.ReadDir(mappedRoot) if err == nil { // Go through all of the mapped mounts. for _, m := range mounts { _ = unix.Unmount(filepath.Join(mappedRoot, m.Name()), unix.MNT_DETACH) } } } if d.options.mountProgram != "" { // Attempt to unmount the FUSE mount using either fusermount or fusermount3. // If they fail, fallback to unix.Unmount for _, v := range []string{"fusermount3", "fusermount"} { err := exec.Command(v, "-u", mountpoint).Run() if err != nil && !errors.Is(err, exec.ErrNotFound) { logrus.Debugf("Error unmounting %s with %s - %v", mountpoint, v, err) } if err == nil { unmounted = true break } } // If fusermount|fusermount3 failed to unmount the FUSE file system, make sure all // pending changes are propagated to the file system if !unmounted { fd, err := unix.Open(mountpoint, unix.O_DIRECTORY|unix.O_CLOEXEC, 0) if err == nil { if err := unix.Syncfs(fd); err != nil { logrus.Debugf("Error Syncfs(%s) - %v", mountpoint, err) } unix.Close(fd) } } } if !unmounted { if err := unix.Unmount(mountpoint, unix.MNT_DETACH); err != nil && !os.IsNotExist(err) { logrus.Debugf("Failed to unmount %s overlay: %s - %v", id, mountpoint, err) if !errors.Is(err, unix.EINVAL) { return fmt.Errorf("unmounting %q: %w", mountpoint, err) } } } if inAdditionalStore { // check the base name for extra safety if strings.HasPrefix(mountpoint, d.runhome) && filepath.Base(mountpoint) == "merged" { err := os.RemoveAll(filepath.Dir(mountpoint)) if err != nil { logrus.Warningf("Failed to remove mountpoint %s overlay: %s: %v", id, mountpoint, err) } } } else { idPair := idtools.IDPair{UID: 0, GID: 0} fi, err := os.Stat(mountpoint) if err != nil { return err } if stat, ok := fi.Sys().(*syscall.Stat_t); ok { idPair = idtools.IDPair{UID: int(stat.Uid), GID: int(stat.Gid)} } tmpMountpoint := path.Join(dir, "merged.1") if err := idtools.MkdirAndChown(tmpMountpoint, 0o700, idPair); err != nil && !errors.Is(err, os.ErrExist) { return err } // rename(2) can be used on an empty directory, as it is the mountpoint after umount, and it retains // its atomic semantic. In this way the "merged" directory is never removed. if err := unix.Rename(tmpMountpoint, mountpoint); err != nil { logrus.Debugf("Failed to replace mountpoint %s overlay: %s: %v", id, mountpoint, err) return fmt.Errorf("replacing mount point %q: %w", mountpoint, err) } } return nil } // Exists checks to see if the id is already mounted. func (d *Driver) Exists(id string) bool { err := fileutils.Exists(d.dir(id)) return err == nil } // List layers (not including additional image stores) func (d *Driver) ListLayers() ([]string, error) { entries, err := os.ReadDir(d.home) if err != nil { return nil, err } layers := make([]string, 0) for _, entry := range entries { id := entry.Name() switch id { case linkDir, stagingDir, tempDirName, quota.BackingFsBlockDeviceLink, mountProgramFlagFile: // expected, but not a layer. skip it continue default: // Does it look like a datadir directory? if !entry.IsDir() { continue } layers = append(layers, id) } } return layers, nil } // isParent returns if the passed in parent is the direct parent of the passed in layer func (d *Driver) isParent(id, parent string) bool { lowers, err := d.getLowerDirs(id) if err != nil { return false } if parent == "" && len(lowers) > 0 { return false } parentDir := d.dir(parent) var ld string if len(lowers) > 0 { ld = filepath.Dir(lowers[0]) } if ld == "" && parent == "" { return true } return ld == parentDir } func (d *Driver) getWhiteoutFormat() archive.WhiteoutFormat { whiteoutFormat := archive.OverlayWhiteoutFormat if d.options.mountProgram != "" { // If we are using a mount program, we are most likely running // as an unprivileged user that cannot use mknod, so fallback to the // AUFS whiteout format. whiteoutFormat = archive.AUFSWhiteoutFormat } return whiteoutFormat } type overlayFileGetter struct { diffDirs []string composefsMounts map[string]*os.File // map from diff dir to the directory with the composefs blob mounted } func (g *overlayFileGetter) Get(path string) (io.ReadCloser, error) { buf := make([]byte, unix.PathMax) for _, d := range g.diffDirs { if f, found := g.composefsMounts[d]; found { // there is no *at equivalent for getxattr, but it can be emulated by opening the file under /proc/self/fd/$FD/$PATH len, err := unix.Getxattr(fmt.Sprintf("/proc/self/fd/%d/%s", int(f.Fd()), path), "trusted.overlay.redirect", buf) if err != nil { if errors.Is(err, unix.ENODATA) { continue } return nil, &fs.PathError{Op: "getxattr", Path: path, Err: err} } // the xattr value is the path to the file in the composefs layer diff directory return os.Open(filepath.Join(d, string(buf[:len]))) } f, err := os.Open(filepath.Join(d, path)) if err == nil { return f, nil } } if len(g.diffDirs) > 0 { return os.Open(filepath.Join(g.diffDirs[0], path)) } return nil, fmt.Errorf("%s: %w", path, os.ErrNotExist) } func (g *overlayFileGetter) Close() (errs error) { for _, f := range g.composefsMounts { if err := f.Close(); err != nil { errs = errors.Join(errs, err) } if err := unix.Rmdir(f.Name()); err != nil { errs = errors.Join(errs, err) } } return errs } // newStagingDir creates a new staging directory and returns the path to it. func (d *Driver) newStagingDir() (string, error) { stagingDirBase := filepath.Join(d.homeDirForImageStore(), stagingDir) err := os.MkdirAll(stagingDirBase, 0o700) if err != nil && !os.IsExist(err) { return "", err } return os.MkdirTemp(stagingDirBase, "") } // DiffGetter returns a FileGetCloser that can read files from the directory that // contains files for the layer differences, either for this layer, or one of our // lowers if we're just a template directory. Used for direct access for tar-split. func (d *Driver) DiffGetter(id string) (_ graphdriver.FileGetCloser, Err error) { p, err := d.getDiffPath(id) if err != nil { return nil, err } paths, err := d.getLowerDiffPaths(id) if err != nil { return nil, err } // map from diff dir to the directory with the composefs blob mounted composefsMounts := make(map[string]*os.File) defer func() { if Err != nil { for _, f := range composefsMounts { f.Close() if err := unix.Rmdir(f.Name()); err != nil && !os.IsNotExist(err) { logrus.Warnf("Failed to remove %s: %v", f.Name(), err) } } } }() diffDirs := append([]string{p}, paths...) for _, diffDir := range diffDirs { // diffDir has the form $GRAPH_ROOT/overlay/$ID/diff, so grab the $ID from the parent directory id := path.Base(path.Dir(diffDir)) composefsData := d.getComposefsData(id) if fileutils.Exists(composefsData) != nil { // not a composefs layer, ignore it continue } fd, err := openComposefsMount(composefsData) if err != nil { return nil, err } composefsMounts[diffDir] = os.NewFile(uintptr(fd), composefsData) } return &overlayFileGetter{diffDirs: diffDirs, composefsMounts: composefsMounts}, nil } // CleanupStagingDirectory cleanups the staging directory. func (d *Driver) CleanupStagingDirectory(stagingDirectory string) error { parentStagingDir := filepath.Dir(stagingDirectory) d.stagingDirsLocksMutex.Lock() if lock, ok := d.stagingDirsLocks[parentStagingDir]; ok { delete(d.stagingDirsLocks, parentStagingDir) if err := lock.UnlockAndDelete(); err != nil { d.stagingDirsLocksMutex.Unlock() return err } } d.stagingDirsLocksMutex.Unlock() return os.RemoveAll(parentStagingDir) } func supportsDataOnlyLayersCached(home, runhome string) (bool, error) { feature := "dataonly-layers" overlayCacheResult, _, err := cachedFeatureCheck(runhome, feature) if err == nil { if overlayCacheResult { logrus.Debugf("Cached value indicated that data-only layers for overlay are supported") return true, nil } logrus.Debugf("Cached value indicated that data-only layers for overlay are not supported") return false, nil } supportsDataOnly, err := supportsDataOnlyLayers(home) if err2 := cachedFeatureRecord(runhome, feature, supportsDataOnly, ""); err2 != nil { return false, fmt.Errorf("recording overlay data-only layers support status: %w", err2) } return supportsDataOnly, err } // ApplyDiffWithDiffer applies the changes in the new layer using the specified function func (d *Driver) ApplyDiffWithDiffer(options *graphdriver.ApplyDiffWithDifferOpts, differ graphdriver.Differ) (output graphdriver.DriverWithDifferOutput, errRet error) { var idMappings *idtools.IDMappings var forceMask *os.FileMode if options != nil { idMappings = options.Mappings forceMask = options.ForceMask } if d.options.forceMask != nil { forceMask = d.options.forceMask } if idMappings == nil { idMappings = &idtools.IDMappings{} } layerDir, err := d.newStagingDir() if err != nil { return graphdriver.DriverWithDifferOutput{}, err } perms := defaultPerms if forceMask != nil { perms = *forceMask } applyDir := filepath.Join(layerDir, "dir") if err := os.Mkdir(applyDir, perms); err != nil { return graphdriver.DriverWithDifferOutput{}, err } lock, err := staging_lockfile.TryLockPath(filepath.Join(layerDir, stagingLockFile)) if err != nil { return graphdriver.DriverWithDifferOutput{}, err } defer func() { if errRet != nil { d.stagingDirsLocksMutex.Lock() delete(d.stagingDirsLocks, layerDir) d.stagingDirsLocksMutex.Unlock() if err := lock.UnlockAndDelete(); err != nil { errRet = errors.Join(errRet, err) } } }() d.stagingDirsLocksMutex.Lock() d.stagingDirsLocks[layerDir] = lock d.stagingDirsLocksMutex.Unlock() logrus.Debugf("Applying differ in %s", applyDir) differOptions := graphdriver.DifferOptions{ Format: graphdriver.DifferOutputFormatDir, } if d.usingComposefs { differOptions.Format = graphdriver.DifferOutputFormatFlat differOptions.UseFsVerity = graphdriver.DifferFsVerityIfAvailable } out, err := differ.ApplyDiff(applyDir, &archive.TarOptions{ UIDMaps: idMappings.UIDs(), GIDMaps: idMappings.GIDs(), IgnoreChownErrors: d.options.ignoreChownErrors, WhiteoutFormat: d.getWhiteoutFormat(), InUserNS: unshare.IsRootless(), ForceMask: forceMask, }, &differOptions) out.Target = applyDir return out, err } // ApplyDiffFromStagingDirectory applies the changes using the specified staging directory. func (d *Driver) ApplyDiffFromStagingDirectory(id, parent string, diffOutput *graphdriver.DriverWithDifferOutput, options *graphdriver.ApplyDiffWithDifferOpts) (errRet error) { stagingDirectory := diffOutput.Target parentStagingDir := filepath.Dir(stagingDirectory) defer func() { d.stagingDirsLocksMutex.Lock() if lock, ok := d.stagingDirsLocks[parentStagingDir]; ok { delete(d.stagingDirsLocks, parentStagingDir) if err := lock.UnlockAndDelete(); err != nil { errRet = errors.Join(errRet, err) } } d.stagingDirsLocksMutex.Unlock() }() diffPath, err := d.getDiffPath(id) if err != nil { return err } // If the current layer doesn't set the mode for the parent, override it with the parent layer's mode. if d.options.forceMask == nil && diffOutput.RootDirMode == nil && parent != "" { parentDiffPath, err := d.getDiffPath(parent) if err != nil { return err } parentSt, err := os.Stat(parentDiffPath) if err != nil { return err } if err := os.Chmod(stagingDirectory, parentSt.Mode()); err != nil { return err } } if d.usingComposefs { toc := diffOutput.Artifacts[tocArtifact] verityDigests := diffOutput.Artifacts[fsVerityDigestsArtifact].(map[string]string) if err := generateComposeFsBlob(verityDigests, toc, d.getComposefsData(id)); err != nil { return err } } if err := os.RemoveAll(diffPath); err != nil && !os.IsNotExist(err) { return err } return os.Rename(stagingDirectory, diffPath) } // DifferTarget gets the location where files are stored for the layer. func (d *Driver) DifferTarget(id string) (string, error) { return d.getDiffPath(id) } // StartStagingDiffToApply applies the new layer into a temporary directory. // It returns a CleanupTempDirFunc which can be nil or set regardless if the function return an error or not. // StagedAddition is only set when there is no error returned and the int64 value returns the size of the layer. // This can be done without holding the storage lock, if a parent is given the caller must check for existence // beforehand while holding a lock. // // This API is experimental and can be changed without bumping the major version number. func (d *Driver) StartStagingDiffToApply(parent string, options graphdriver.ApplyDiffOpts) (tempdir.CleanupTempDirFunc, *tempdir.StagedAddition, int64, error) { tempDirRoot := d.getTempDirRootForNewLayer() t, err := tempdir.NewTempDir(tempDirRoot) if err != nil { return nil, nil, -1, err } sa, err := t.StageAddition() if err != nil { return t.Cleanup, nil, -1, err } _, forcedSt, st, err := d.getLayerPermissions(parent, options.Mappings.UIDs(), options.Mappings.GIDs()) if err != nil { // If we have a ENOENT it means the parent was removed which can happen as we are unlocked here. // In this case also wrap ErrLayerUnknown which some callers can handle to retry after recreating the parent. if errors.Is(err, fs.ErrNotExist) { err = fmt.Errorf("parent layer %q: %w: %w", parent, graphdriver.ErrLayerUnknown, err) } return t.Cleanup, nil, -1, err } if err := idtools.MkdirAndChown(sa.Path, forcedSt.Mode, forcedSt.IDs); err != nil { return t.Cleanup, nil, -1, err } if d.options.forceMask != nil { st.Mode |= os.ModeDir if err := idtools.SetContainersOverrideXattr(sa.Path, st); err != nil { return t.Cleanup, nil, -1, err } } size, err := d.applyDiff(sa.Path, options) if err != nil { return t.Cleanup, nil, -1, err } return t.Cleanup, sa, size, nil } // CommitStagedLayer that was created with StartStagingDiffToApply(). // // This API is experimental and can be changed without bumping the major version number. func (d *Driver) CommitStagedLayer(id string, sa *tempdir.StagedAddition) error { applyDir, err := d.getDiffPath(id) if err != nil { return err } // The os.Rename() function used by CommitFunc errors when the target directory already // exists, as such delete the dir. The create() function creates it and it would be more // complicated to code in a way that it didn't create it. if err := os.Remove(applyDir); err != nil { return err } return sa.Commit(applyDir) } // ApplyDiff applies the new layer into a root func (d *Driver) ApplyDiff(id string, options graphdriver.ApplyDiffOpts) (size int64, err error) { applyDir, err := d.getDiffPath(id) if err != nil { return 0, err } return d.applyDiff(applyDir, options) } // ApplyDiff applies the new layer into a root. // This can run concurrently with any other driver operations, as such it is the // callers responsibility to ensure the target path passed is safe to use if that is the case. func (d *Driver) applyDiff(target string, options graphdriver.ApplyDiffOpts) (size int64, err error) { idMappings := options.Mappings if idMappings == nil { idMappings = &idtools.IDMappings{} } logrus.Debugf("Applying tar in %s", target) // Overlay doesn't need the parent id to apply the diff if err := untar(options.Diff, target, &archive.TarOptions{ UIDMaps: idMappings.UIDs(), GIDMaps: idMappings.GIDs(), IgnoreChownErrors: d.options.ignoreChownErrors, ForceMask: d.options.forceMask, WhiteoutFormat: d.getWhiteoutFormat(), InUserNS: unshare.IsRootless(), }); err != nil { return 0, err } return directory.Size(target) } func (d *Driver) getComposefsData(id string) string { dir := d.dir(id) return path.Join(dir, "composefs-data") } func (d *Driver) getDiffPath(id string) (string, error) { dir := d.dir(id) return redirectDiffIfAdditionalLayer(path.Join(dir, "diff"), false) } func (d *Driver) getLowerDiffPaths(id string) ([]string, error) { layers, err := d.getLowerDirs(id) if err != nil { return nil, err } for i, l := range layers { layers[i], err = redirectDiffIfAdditionalLayer(l, false) if err != nil { return nil, err } } return layers, nil } // DiffSize calculates the changes between the specified id // and its parent and returns the size in bytes of the changes // relative to its base filesystem directory. func (d *Driver) DiffSize(id string, idMappings *idtools.IDMappings, parent string, parentMappings *idtools.IDMappings, mountLabel string) (size int64, err error) { if !d.isParent(id, parent) { return d.naiveDiff.DiffSize(id, idMappings, parent, parentMappings, mountLabel) } p, err := d.getDiffPath(id) if err != nil { return 0, err } return directory.Size(p) } // Diff produces an archive of the changes between the specified // layer and its parent layer which may be "". func (d *Driver) Diff(id string, idMappings *idtools.IDMappings, parent string, parentMappings *idtools.IDMappings, mountLabel string) (io.ReadCloser, error) { if d.useNaiveDiff() || !d.isParent(id, parent) { return d.naiveDiff.Diff(id, idMappings, parent, parentMappings, mountLabel) } if idMappings == nil { idMappings = &idtools.IDMappings{} } lowerDirs, err := d.getLowerDiffPaths(id) if err != nil { return nil, err } diffPath, err := d.getDiffPath(id) if err != nil { return nil, err } logrus.Debugf("Tar with options on %s", diffPath) return archive.TarWithOptions(diffPath, &archive.TarOptions{ Compression: archive.Uncompressed, UIDMaps: idMappings.UIDs(), GIDMaps: idMappings.GIDs(), WhiteoutFormat: d.getWhiteoutFormat(), WhiteoutData: lowerDirs, }) } // Changes produces a list of changes between the specified layer // and its parent layer. If parent is "", then all changes will be ADD changes. func (d *Driver) Changes(id string, idMappings *idtools.IDMappings, parent string, parentMappings *idtools.IDMappings, mountLabel string) ([]archive.Change, error) { if d.useNaiveDiff() || !d.isParent(id, parent) { return d.naiveDiff.Changes(id, idMappings, parent, parentMappings, mountLabel) } // Overlay doesn't have snapshots, so we need to get changes from all parent // layers. diffPath, err := d.getDiffPath(id) if err != nil { return nil, fmt.Errorf("failed to get diff path: %w", err) } layers, err := d.getLowerDiffPaths(id) if err != nil { return nil, fmt.Errorf("failed to get lower diff path: %w", err) } c, err := archive.OverlayChanges(layers, diffPath) if err != nil { return nil, fmt.Errorf("computing changes: %w", err) } return c, nil } // AdditionalImageStores returns additional image stores supported by the driver func (d *Driver) AdditionalImageStores() []string { return d.options.imageStores } // UpdateLayerIDMap updates ID mappings in a from matching the ones specified // by toContainer to those specified by toHost. func (d *Driver) UpdateLayerIDMap(id string, toContainer, toHost *idtools.IDMappings, mountLabel string) error { var err error dir := d.dir(id) diffDir := filepath.Join(dir, "diff") rootIDs := idtools.IDPair{UID: 0, GID: 0} if toHost != nil { rootUID, rootGID, err := idtools.GetRootUIDGID(toHost.UIDs(), toHost.GIDs()) if err != nil { return err } rootIDs = idtools.IDPair{UID: rootUID, GID: rootGID} } // Mount the new layer and handle ownership changes and possible copy_ups in it. options := graphdriver.MountOpts{ MountLabel: mountLabel, Options: strings.Split(d.options.mountOptions, ","), } layerFs, err := d.get(id, true, options) if err != nil { return err } err = graphdriver.ChownPathByMaps(layerFs, toContainer, toHost) if err != nil { if err2 := d.Put(id); err2 != nil { logrus.Errorf("%v; unmounting %v: %v", err, id, err2) } return err } if err = d.Put(id); err != nil { return err } // Rotate the diff directories. i := 0 perms := defaultPerms st, err := os.Stat(nameWithSuffix(diffDir, i)) if d.options.forceMask != nil { perms = *d.options.forceMask } else { if err == nil { perms = st.Mode() } } for err == nil { i++ err = fileutils.Exists(nameWithSuffix(diffDir, i)) } for i > 0 { err = os.Rename(nameWithSuffix(diffDir, i-1), nameWithSuffix(diffDir, i)) if err != nil { return err } i-- } // We need to re-create the work directory as it might keep a reference // to the old upper layer in the index. workDir := filepath.Join(dir, "work") if err := os.RemoveAll(workDir); err == nil { if err := idtools.MkdirAndChown(workDir, defaultPerms, rootIDs); err != nil { return err } } // Re-create the directory that we're going to use as the upper layer. if err := idtools.MkdirAndChown(diffDir, perms, rootIDs); err != nil { return err } return nil } // supportsIDmappedMounts returns whether the kernel supports using idmapped mounts with // overlay lower layers. func (d *Driver) supportsIDmappedMounts() bool { if d.supportsIDMappedMounts != nil { return *d.supportsIDMappedMounts } supportsIDMappedMounts, err := checkAndRecordIDMappedSupport(d.home, d.runhome) d.supportsIDMappedMounts = &supportsIDMappedMounts if err == nil { return supportsIDMappedMounts } logrus.Debugf("Check for idmapped mounts support %v", err) return false } // SupportsShifting tells whether the driver support shifting of the UIDs/GIDs to the provided mapping in an userNS func (d *Driver) SupportsShifting(uidmap, gidmap []idtools.IDMap) bool { if os.Getenv("_CONTAINERS_OVERLAY_DISABLE_IDMAP") == "yes" { return false } if d.options.mountProgram != "" { // fuse-overlayfs supports only contiguous mappings, since it performs the mapping on the // upper layer too, to avoid https://github.com/containers/podman/issues/10272 if !idtools.IsContiguous(uidmap) { return false } if !idtools.IsContiguous(gidmap) { return false } return true } return d.supportsIDmappedMounts() } // dumbJoin is more or less a dumber version of filepath.Join, but one which // won't Clean() the path, allowing us to append ".." as a component and trust // pathname resolution to do some non-obvious work. func dumbJoin(names ...string) string { if len(names) == 0 { return string(os.PathSeparator) } return strings.Join(names, string(os.PathSeparator)) } func nameWithSuffix(name string, number int) string { if number == 0 { return name } return fmt.Sprintf("%s%d", name, number) } func validateOneAdditionalLayerPath(target string) error { for _, p := range []string{ filepath.Join(target, "diff"), filepath.Join(target, "info"), filepath.Join(target, "blob"), } { if err := fileutils.Exists(p); err != nil { return err } } return nil } func (d *Driver) getAdditionalLayerPath(tocDigest digest.Digest, ref string) (string, error) { refElem := base64.StdEncoding.EncodeToString([]byte(ref)) for _, ls := range d.options.layerStores { ref := "" if ls.withReference { ref = refElem } target := path.Join(ls.path, ref, tocDigest.String()) err := validateOneAdditionalLayerPath(target) if err == nil { return target, nil } logrus.Debugf("additional Layer Store %v failed to stat additional layer: %v", ls, err) } return "", fmt.Errorf("additional layer (%q, %q) not found: %w", tocDigest, ref, graphdriver.ErrLayerUnknown) } func (d *Driver) releaseAdditionalLayerByID(id string) { if al, err := d.getAdditionalLayerPathByID(id); err == nil { notifyReleaseAdditionalLayer(al) } else if !os.IsNotExist(err) { logrus.Warnf("Unexpected error on reading Additional Layer Store pointer %v", err) } } // additionalLayer represents a layer in Additional Layer Store. type additionalLayer struct { path string d *Driver releaseOnce sync.Once } // Info returns arbitrary information stored along with this layer (i.e. `info` file). // This API is experimental and can be changed without bumping the major version number. // TODO: to remove the comment once it's no longer experimental. func (al *additionalLayer) Info() (io.ReadCloser, error) { return os.Open(filepath.Join(al.path, "info")) } // Blob returns a reader of the raw contents of this layer. func (al *additionalLayer) Blob() (io.ReadCloser, error) { return os.Open(filepath.Join(al.path, "blob")) } // CreateAs creates a new layer from this additional layer. // This API is experimental and can be changed without bumping the major version number. // TODO: to remove the comment once it's no longer experimental. func (al *additionalLayer) CreateAs(id, parent string) error { // TODO: support opts if err := al.d.Create(id, parent, nil); err != nil { return err } dir := al.d.dir(id) diffDir := path.Join(dir, "diff") if err := os.RemoveAll(diffDir); err != nil { return err } // tell the additional layer store that we use this layer. // mark this layer as "additional layer" if err := os.WriteFile(path.Join(dir, "additionallayer"), []byte(al.path), 0o644); err != nil { return err } notifyUseAdditionalLayer(al.path) return os.Symlink(filepath.Join(al.path, "diff"), diffDir) } func (d *Driver) getAdditionalLayerPathByID(id string) (string, error) { al, err := os.ReadFile(path.Join(d.dir(id), "additionallayer")) if err != nil { return "", err } return string(al), nil } // Release tells the additional layer store that we don't use this handler. // This API is experimental and can be changed without bumping the major version number. // TODO: to remove the comment once it's no longer experimental. func (al *additionalLayer) Release() { // Tell the additional layer store that we don't use this layer handler. // This will decrease the reference counter on the store's side, which was // increased in LookupAdditionalLayer (so this must be called only once). al.releaseOnce.Do(func() { notifyReleaseAdditionalLayer(al.path) }) } // notifyUseAdditionalLayer notifies Additional Layer Store that we use the specified layer. // This is done by creating "use" file in the layer directory. This is useful for // Additional Layer Store to consider when to perform GC. Notification-aware Additional // Layer Store must return ENOENT. func notifyUseAdditionalLayer(al string) { if !path.IsAbs(al) { logrus.Warnf("additionallayer must be absolute (got: %v)", al) return } useFile := path.Join(al, "use") f, err := os.Create(useFile) if os.IsNotExist(err) { return } else if err == nil { f.Close() if err := os.Remove(useFile); err != nil { logrus.Warnf("Failed to remove use file") } } logrus.Warnf("Unexpected error by Additional Layer Store %v during use; GC doesn't seem to be supported", err) } // notifyReleaseAdditionalLayer notifies Additional Layer Store that we don't use the specified // layer anymore. This is done by rmdir-ing the layer directory. This is useful for // Additional Layer Store to consider when to perform GC. Notification-aware Additional // Layer Store must return ENOENT. func notifyReleaseAdditionalLayer(al string) { if !path.IsAbs(al) { logrus.Warnf("additionallayer must be absolute (got: %v)", al) return } // tell the additional layer store that we don't use this layer anymore. err := unix.Rmdir(al) if os.IsNotExist(err) { return } logrus.Warnf("Unexpected error by Additional Layer Store %v during release; GC doesn't seem to be supported", err) } // redirectDiffIfAdditionalLayer checks if the passed diff path is Additional Layer and // returns the redirected path. If the passed diff is not the one in Additional Layer // Store, it returns the original path without changes. func redirectDiffIfAdditionalLayer(diffPath string, checkExistence bool) (string, error) { if ld, err := os.Readlink(diffPath); err == nil { // diff is the link to Additional Layer Store if !path.IsAbs(ld) { return "", fmt.Errorf("linkpath must be absolute (got: %q)", ld) } if checkExistence { if err := fileutils.Exists(ld); err != nil { return "", fmt.Errorf("failed to access to the linked additional layer: %w", err) } } diffPath = ld } else if err.(*os.PathError).Err != syscall.EINVAL { return "", err } return diffPath, nil } // getMappedMountRoot is a heuristic that calculates the parent directory where // the idmapped mount should be applied. // It is useful to minimize the number of idmapped mounts and at the same time use // a common path as long as possible to reduce the length of the mount data argument. func getMappedMountRoot(path string) string { dirName := filepath.Dir(path) if filepath.Base(dirName) == linkDir { return filepath.Dir(dirName) } return dirName } // Dedup performs deduplication of the driver's storage. func (d *Driver) Dedup(req graphdriver.DedupArgs) (graphdriver.DedupResult, error) { var dirs []string for _, layer := range req.Layers { dir, _, inAdditionalStore := d.dir2(layer, false) if inAdditionalStore { continue } if err := fileutils.Exists(dir); err == nil { dirs = append(dirs, filepath.Join(dir, "diff")) } } r, err := dedup.DedupDirs(dirs, req.Options) if err != nil { return graphdriver.DedupResult{}, err } return graphdriver.DedupResult{Deduped: r.Deduped}, nil } ================================================ FILE: vendor/go.podman.io/storage/drivers/overlay/overlay_disk_quota.go ================================================ //go:build linux && cgo && !exclude_disk_quota package overlay import ( "path" "go.podman.io/storage/pkg/directory" ) // ReadWriteDiskUsage returns the disk usage of the writable directory for the ID. // For Overlay, it attempts to check the XFS quota for size, and falls back to // finding the size of the "diff" directory. func (d *Driver) ReadWriteDiskUsage(id string) (*directory.DiskUsage, error) { usage := &directory.DiskUsage{} if d.quotaCtl != nil { err := d.quotaCtl.GetDiskUsage(d.dir(id), usage) return usage, err } return directory.Usage(path.Join(d.dir(id), "diff")) } ================================================ FILE: vendor/go.podman.io/storage/drivers/overlay/overlay_disk_quota_unsupported.go ================================================ //go:build linux && (!cgo || exclude_disk_quota) package overlay import ( "path" "go.podman.io/storage/pkg/directory" ) // ReadWriteDiskUsage returns the disk usage of the writable directory for the ID. // For Overlay, it attempts to check the XFS quota for size, and falls back to // finding the size of the "diff" directory. func (d *Driver) ReadWriteDiskUsage(id string) (*directory.DiskUsage, error) { return directory.Usage(path.Join(d.dir(id), "diff")) } ================================================ FILE: vendor/go.podman.io/storage/drivers/overlay/overlay_unsupported.go ================================================ //go:build !linux package overlay func SupportsNativeOverlay(graphroot, rundir string) (bool, error) { return false, nil } ================================================ FILE: vendor/go.podman.io/storage/drivers/overlay/randomid.go ================================================ //go:build linux package overlay import ( "crypto/rand" "encoding/base32" "fmt" "io" "os" "syscall" "time" "github.com/sirupsen/logrus" "golang.org/x/sys/unix" ) // generateID creates a new random string identifier with the given length func generateID(l int) string { const ( // ensures we backoff for less than 450ms total. Use the following to // select new value, in units of 10ms: // n*(n+1)/2 = d -> n^2 + n - 2d -> n = (sqrt(8d + 1) - 1)/2 maxretries = 9 backoff = time.Millisecond * 10 ) var ( totalBackoff time.Duration count int retries int size = (l*5 + 7) / 8 u = make([]byte, size) ) // TODO: Include time component, counter component, random component for { // This should never block but the read may fail. Because of this, // we just try to read the random number generator until we get // something. This is a very rare condition but may happen. b := time.Duration(retries) * backoff time.Sleep(b) totalBackoff += b n, err := io.ReadFull(rand.Reader, u[count:]) if err != nil { if retryOnError(err) && retries < maxretries { count += n retries++ logrus.Errorf("Generating version 4 uuid, retrying: %v", err) continue } // Any other errors represent a system problem. What did someone // do to /dev/urandom? panic(fmt.Errorf("reading random number generator, retried for %v: %w", totalBackoff.String(), err)) } break } s := base32.StdEncoding.EncodeToString(u) return s[:l] } // retryOnError tries to detect whether or not retrying would be fruitful. func retryOnError(err error) bool { switch err := err.(type) { case *os.PathError: return retryOnError(err.Err) // unpack the target error case syscall.Errno: if err == unix.EPERM { // EPERM represents an entropy pool exhaustion, a condition under // which we backoff and retry. return true } } return false } ================================================ FILE: vendor/go.podman.io/storage/drivers/overlayutils/overlayutils.go ================================================ //go:build linux package overlayutils import ( "fmt" graphdriver "go.podman.io/storage/drivers" ) // ErrDTypeNotSupported denotes that the backing filesystem doesn't support d_type. func ErrDTypeNotSupported(driver, backingFs string) error { msg := fmt.Sprintf("%s: the backing %s filesystem is formatted without d_type support, which leads to incorrect behavior.", driver, backingFs) if backingFs == "xfs" { msg += " Reformat the filesystem with ftype=1 to enable d_type support." } msg += " Running without d_type is not supported." return fmt.Errorf("%s: %w", msg, graphdriver.ErrNotSupported) } ================================================ FILE: vendor/go.podman.io/storage/drivers/quota/projectquota.go ================================================ package quota // BackingFsBlockDeviceLink is the name of a file that we place in // the home directory of a driver that uses this package. const BackingFsBlockDeviceLink = "backingFsBlockDev" ================================================ FILE: vendor/go.podman.io/storage/drivers/quota/projectquota_supported.go ================================================ //go:build linux && !exclude_disk_quota && cgo // // projectquota.go - implements XFS project quota controls // for setting quota limits on a newly created directory. // It currently supports the legacy XFS specific ioctls. // // TODO: use generic quota control ioctl FS_IOC_FS{GET,SET}XATTR // for both xfs/ext4 for kernel version >= v4.5 // package quota /* #include #include #include #include #include #ifndef FS_XFLAG_PROJINHERIT struct fsxattr { __u32 fsx_xflags; __u32 fsx_extsize; __u32 fsx_nextents; __u32 fsx_projid; unsigned char fsx_pad[12]; }; #define FS_XFLAG_PROJINHERIT 0x00000200 #endif #ifndef FS_IOC_FSGETXATTR #define FS_IOC_FSGETXATTR _IOR ('X', 31, struct fsxattr) #endif #ifndef FS_IOC_FSSETXATTR #define FS_IOC_FSSETXATTR _IOW ('X', 32, struct fsxattr) #endif #ifndef PRJQUOTA #define PRJQUOTA 2 #endif #ifndef FS_PROJ_QUOTA #define FS_PROJ_QUOTA 2 #endif #ifndef Q_XSETPQLIM #define Q_XSETPQLIM QCMD(Q_XSETQLIM, PRJQUOTA) #endif #ifndef Q_XGETPQUOTA #define Q_XGETPQUOTA QCMD(Q_XGETQUOTA, PRJQUOTA) #endif */ import "C" import ( "errors" "fmt" "math" "os" "path" "path/filepath" "sync" "syscall" "unsafe" "github.com/sirupsen/logrus" "go.podman.io/storage/pkg/directory" "golang.org/x/sys/unix" ) const projectIDsAllocatedPerQuotaHome = 10000 // Quota limit params - currently we only control blocks hard limit and inodes type Quota struct { Size uint64 Inodes uint64 } // Control - Context to be used by storage driver (e.g. overlay) // who wants to apply project quotas to container dirs type Control struct { backingFsBlockDev string nextProjectID uint32 quotas *sync.Map basePath string } // Attempt to generate a unigue projectid. Multiple directories // per file system can have quota and they need a group of unique // ids. This function attempts to allocate at least projectIDsAllocatedPerQuotaHome(10000) // unique projectids, based on the inode of the basepath. func generateUniqueProjectID(path string) (uint32, error) { fileinfo, err := os.Stat(path) if err != nil { return 0, err } stat, ok := fileinfo.Sys().(*syscall.Stat_t) if !ok { return 0, fmt.Errorf("not a syscall.Stat_t %s", path) } projectID := projectIDsAllocatedPerQuotaHome + (stat.Ino*projectIDsAllocatedPerQuotaHome)%(math.MaxUint32-projectIDsAllocatedPerQuotaHome) return uint32(projectID), nil } // NewControl - initialize project quota support. // Test to make sure that quota can be set on a test dir and find // the first project id to be used for the next container create. // // Returns nil (and error) if project quota is not supported. // // First get the project id of the basePath directory. // This test will fail if the backing fs is not xfs. // // xfs_quota tool can be used to assign a project id to the driver home directory, e.g.: // echo 100000:/var/lib/containers/storage/overlay >> /etc/projects // echo 200000:/var/lib/containers/storage/volumes >> /etc/projects // echo storage:100000 >> /etc/projid // echo volumes:200000 >> /etc/projid // xfs_quota -x -c 'project -s storage volumes' / // // In the example above, the storage directory project id will be used as a // "start offset" and all containers will be assigned larger project ids // (e.g. >= 100000). Then the volumes directory project id will be used as a // "start offset" and all volumes will be assigned larger project ids // (e.g. >= 200000). // This is a way to prevent xfs_quota management from conflicting with // containers/storage. // Then try to create a test directory with the next project id and set a quota // on it. If that works, continue to scan existing containers to map allocated // project ids. func NewControl(basePath string) (*Control, error) { // // Get project id of parent dir as minimal id to be used by driver // minProjectID, err := getProjectID(basePath) if err != nil { return nil, err } if minProjectID == 0 { // Indicates the storage was never initialized // Generate a unique range of Projectids for this basepath minProjectID, err = generateUniqueProjectID(basePath) if err != nil { return nil, err } } // // create backing filesystem device node // backingFsBlockDev, err := makeBackingFsDev(basePath) if err != nil { return nil, err } // // Test if filesystem supports project quotas by trying to set // a quota on the first available project id // quota := Quota{ Size: 0, Inodes: 0, } q := Control{ backingFsBlockDev: backingFsBlockDev, nextProjectID: minProjectID + 1, quotas: &sync.Map{}, basePath: basePath, } if err := q.setProjectQuota(minProjectID, quota); err != nil { return nil, err } // Clear inherit flag from top-level directory if necessary. if err := stripProjectInherit(basePath); err != nil { return nil, err } // // get first project id to be used for next container // err = q.findNextProjectID() if err != nil { return nil, err } logrus.Debugf("NewControl(%s): nextProjectID = %d", basePath, q.nextProjectID) return &q, nil } // SetQuota - assign a unique project id to directory and set the quota limits // for that project id. // targetPath must exist, must be a directory, and must be empty. func (q *Control) SetQuota(targetPath string, quota Quota) error { var projectID uint32 value, ok := q.quotas.Load(targetPath) if ok { projectID, ok = value.(uint32) } if !ok { projectID = q.nextProjectID // The directory we are setting an ID on must be empty, as // the ID will not be propagated to pre-existing subdirectories. dents, err := os.ReadDir(targetPath) if err != nil { return fmt.Errorf("reading directory %s: %w", targetPath, err) } if len(dents) > 0 { return fmt.Errorf("can only set project ID on empty directories, %s is not empty", targetPath) } // // assign project id to new container directory // err = setProjectID(targetPath, projectID) if err != nil { return err } q.quotas.Store(targetPath, projectID) q.nextProjectID++ } // // set the quota limit for the container's project id // logrus.Debugf("SetQuota path=%s, size=%d, inodes=%d, projectID=%d", targetPath, quota.Size, quota.Inodes, projectID) return q.setProjectQuota(projectID, quota) } // ClearQuota removes the map entry in the quotas map for targetPath. // It does so to prevent the map leaking entries as directories are deleted. func (q *Control) ClearQuota(targetPath string) { q.quotas.Delete(targetPath) } // setProjectQuota - set the quota for project id on xfs block device func (q *Control) setProjectQuota(projectID uint32, quota Quota) error { var d C.fs_disk_quota_t d.d_version = C.FS_DQUOT_VERSION d.d_id = C.__u32(projectID) d.d_flags = C.FS_PROJ_QUOTA if quota.Size > 0 { d.d_fieldmask = d.d_fieldmask | C.FS_DQ_BHARD | C.FS_DQ_BSOFT d.d_blk_hardlimit = C.__u64(quota.Size / 512) d.d_blk_softlimit = d.d_blk_hardlimit } if quota.Inodes > 0 { d.d_fieldmask = d.d_fieldmask | C.FS_DQ_IHARD | C.FS_DQ_ISOFT d.d_ino_hardlimit = C.__u64(quota.Inodes) d.d_ino_softlimit = d.d_ino_hardlimit } cs := C.CString(q.backingFsBlockDev) defer C.free(unsafe.Pointer(cs)) runQuotactl := func() syscall.Errno { _, _, errno := unix.Syscall6(unix.SYS_QUOTACTL, C.Q_XSETPQLIM, uintptr(unsafe.Pointer(cs)), uintptr(d.d_id), uintptr(unsafe.Pointer(&d)), 0, 0) return errno } errno := runQuotactl() // If the backingFsBlockDev does not exist any more then try to recreate it. if errors.Is(errno, unix.ENOENT) { if _, err := makeBackingFsDev(q.basePath); err != nil { return fmt.Errorf( "failed to recreate missing backingFsBlockDev %s for projid %d: %w", q.backingFsBlockDev, projectID, err, ) } if errno := runQuotactl(); errno != 0 { return fmt.Errorf("failed to set quota limit for projid %d on %s after backingFsBlockDev recreation: %w", projectID, q.backingFsBlockDev, errno) } } else if errno != 0 { return fmt.Errorf("failed to set quota limit for projid %d on %s: %w", projectID, q.backingFsBlockDev, errno) } return nil } // GetQuota - get the quota limits of a directory that was configured with SetQuota func (q *Control) GetQuota(targetPath string, quota *Quota) error { d, err := q.fsDiskQuotaFromPath(targetPath) if err != nil { return err } quota.Size = uint64(d.d_blk_hardlimit) * 512 quota.Inodes = uint64(d.d_ino_hardlimit) return nil } // GetDiskUsage - get the current disk usage of a directory that was configured with SetQuota func (q *Control) GetDiskUsage(targetPath string, usage *directory.DiskUsage) error { d, err := q.fsDiskQuotaFromPath(targetPath) if err != nil { return err } usage.Size = int64(d.d_bcount) * 512 usage.InodeCount = int64(d.d_icount) return nil } func (q *Control) fsDiskQuotaFromPath(targetPath string) (C.fs_disk_quota_t, error) { var d C.fs_disk_quota_t var projectID uint32 value, ok := q.quotas.Load(targetPath) if ok { projectID, ok = value.(uint32) } if !ok { return d, fmt.Errorf("quota not found for path : %s", targetPath) } // // get the quota limit for the container's project id // cs := C.CString(q.backingFsBlockDev) defer C.free(unsafe.Pointer(cs)) _, _, errno := unix.Syscall6(unix.SYS_QUOTACTL, C.Q_XGETPQUOTA, uintptr(unsafe.Pointer(cs)), uintptr(C.__u32(projectID)), uintptr(unsafe.Pointer(&d)), 0, 0) if errno != 0 { return d, fmt.Errorf("failed to get quota limit for projid %d on %s: %w", projectID, q.backingFsBlockDev, errno) } return d, nil } // getProjectID - get the project id of path on xfs func getProjectID(targetPath string) (uint32, error) { dir, err := openDir(targetPath) if err != nil { return 0, err } defer closeDir(dir) var fsx C.struct_fsxattr _, _, errno := unix.Syscall(unix.SYS_IOCTL, getDirFd(dir), C.FS_IOC_FSGETXATTR, uintptr(unsafe.Pointer(&fsx))) if errno != 0 { return 0, fmt.Errorf("failed to get projid for %s: %w", targetPath, errno) } return uint32(fsx.fsx_projid), nil } // setProjectID - set the project id of path on xfs func setProjectID(targetPath string, projectID uint32) error { dir, err := openDir(targetPath) if err != nil { return err } defer closeDir(dir) logrus.Debugf("Setting quota project ID %d on %s", projectID, targetPath) var fsx C.struct_fsxattr _, _, errno := unix.Syscall(unix.SYS_IOCTL, getDirFd(dir), C.FS_IOC_FSGETXATTR, uintptr(unsafe.Pointer(&fsx))) if errno != 0 { return fmt.Errorf("failed to get projid for %s: %w", targetPath, errno) } fsx.fsx_projid = C.__u32(projectID) fsx.fsx_xflags |= C.FS_XFLAG_PROJINHERIT _, _, errno = unix.Syscall(unix.SYS_IOCTL, getDirFd(dir), C.FS_IOC_FSSETXATTR, uintptr(unsafe.Pointer(&fsx))) if errno != 0 { return fmt.Errorf("failed to set projid for %s: %w", targetPath, errno) } return nil } // stripProjectInherit strips the project inherit flag from a directory. // Used on the top-level directory to ensure project IDs are only inherited for // files in directories we set quotas on - not the directories we want to set // the quotas on, as that would make everything use the same project ID. func stripProjectInherit(targetPath string) error { dir, err := openDir(targetPath) if err != nil { return err } defer closeDir(dir) var fsx C.struct_fsxattr _, _, errno := unix.Syscall(unix.SYS_IOCTL, getDirFd(dir), C.FS_IOC_FSGETXATTR, uintptr(unsafe.Pointer(&fsx))) if errno != 0 { return fmt.Errorf("failed to get xfs attrs for %s: %w", targetPath, errno) } if fsx.fsx_xflags&C.FS_XFLAG_PROJINHERIT != 0 { // Flag is set, need to clear it. logrus.Debugf("Clearing PROJINHERIT flag from directory %s", targetPath) fsx.fsx_xflags = fsx.fsx_xflags &^ C.FS_XFLAG_PROJINHERIT _, _, errno = unix.Syscall(unix.SYS_IOCTL, getDirFd(dir), C.FS_IOC_FSSETXATTR, uintptr(unsafe.Pointer(&fsx))) if errno != 0 { return fmt.Errorf("failed to clear PROJINHERIT for %s: %w", targetPath, errno) } } return nil } // findNextProjectID - find the next project id to be used for containers // by scanning driver home directory to find used project ids func (q *Control) findNextProjectID() error { files, err := os.ReadDir(q.basePath) if err != nil { return fmt.Errorf("read directory failed : %s", q.basePath) } for _, file := range files { if !file.IsDir() { continue } path := filepath.Join(q.basePath, file.Name()) projid, err := getProjectID(path) if err != nil { return err } if projid > 0 { q.quotas.Store(path, projid) } if q.nextProjectID <= projid { q.nextProjectID = projid + 1 } } return nil } func free(p *C.char) { C.free(unsafe.Pointer(p)) } func openDir(path string) (*C.DIR, error) { Cpath := C.CString(path) defer free(Cpath) dir, errno := C.opendir(Cpath) if dir == nil { return nil, fmt.Errorf("can't open dir %v: %w", Cpath, errno) } return dir, nil } func closeDir(dir *C.DIR) { if dir != nil { C.closedir(dir) } } func getDirFd(dir *C.DIR) uintptr { return uintptr(C.dirfd(dir)) } // Get the backing block device of the driver home directory // and create a block device node under the home directory // to be used by quotactl commands func makeBackingFsDev(home string) (string, error) { var stat unix.Stat_t if err := unix.Stat(home, &stat); err != nil { return "", err } backingFsBlockDev := path.Join(home, BackingFsBlockDeviceLink) backingFsBlockDevTmp := backingFsBlockDev + ".tmp" // Re-create just in case someone copied the home directory over to a new device if err := unix.Mknod(backingFsBlockDevTmp, unix.S_IFBLK|0o600, int(stat.Dev)); err != nil { if !errors.Is(err, unix.EEXIST) { return "", fmt.Errorf("failed to mknod %s: %w", backingFsBlockDevTmp, err) } // On EEXIST, try again after unlinking any potential leftover. _ = unix.Unlink(backingFsBlockDevTmp) if err := unix.Mknod(backingFsBlockDevTmp, unix.S_IFBLK|0o600, int(stat.Dev)); err != nil { return "", fmt.Errorf("failed to mknod %s: %w", backingFsBlockDevTmp, err) } } if err := unix.Rename(backingFsBlockDevTmp, backingFsBlockDev); err != nil { return "", fmt.Errorf("failed to rename %s to %s: %w", backingFsBlockDevTmp, backingFsBlockDev, err) } return backingFsBlockDev, nil } ================================================ FILE: vendor/go.podman.io/storage/drivers/quota/projectquota_unsupported.go ================================================ //go:build !linux || exclude_disk_quota || !cgo package quota import ( "errors" ) // Quota limit params - currently we only control blocks hard limit type Quota struct { Size uint64 Inodes uint64 } // Control - Context to be used by storage driver (e.g. overlay) // who wants to apply project quotas to container dirs type Control struct{} func NewControl(basePath string) (*Control, error) { return nil, errors.New("filesystem does not support, or has not enabled quotas") } // SetQuota - assign a unique project id to directory and set the quota limits // for that project id func (q *Control) SetQuota(targetPath string, quota Quota) error { return errors.New("filesystem does not support, or has not enabled quotas") } // GetQuota - get the quota limits of a directory that was configured with SetQuota func (q *Control) GetQuota(targetPath string, quota *Quota) error { return errors.New("filesystem does not support, or has not enabled quotas") } // ClearQuota removes the map entry in the quotas map for targetPath. // It does so to prevent the map leaking entries as directories are deleted. func (q *Control) ClearQuota(targetPath string) {} ================================================ FILE: vendor/go.podman.io/storage/drivers/register/register_btrfs.go ================================================ //go:build !exclude_graphdriver_btrfs && linux package register import ( // register the btrfs graphdriver _ "go.podman.io/storage/drivers/btrfs" ) ================================================ FILE: vendor/go.podman.io/storage/drivers/register/register_overlay.go ================================================ //go:build !exclude_graphdriver_overlay && linux package register import ( // register the overlay graphdriver _ "go.podman.io/storage/drivers/overlay" ) ================================================ FILE: vendor/go.podman.io/storage/drivers/register/register_vfs.go ================================================ package register import ( // register vfs _ "go.podman.io/storage/drivers/vfs" ) ================================================ FILE: vendor/go.podman.io/storage/drivers/register/register_zfs.go ================================================ //go:build (!exclude_graphdriver_zfs && linux) || (!exclude_graphdriver_zfs && freebsd) || solaris package register import ( // register the zfs driver _ "go.podman.io/storage/drivers/zfs" ) ================================================ FILE: vendor/go.podman.io/storage/drivers/vfs/copy_linux.go ================================================ package vfs import "go.podman.io/storage/drivers/copy" func dirCopy(srcDir, dstDir string) error { return copy.DirCopy(srcDir, dstDir, copy.Content, true) } ================================================ FILE: vendor/go.podman.io/storage/drivers/vfs/copy_unsupported.go ================================================ //go:build !linux package vfs // import "go.podman.io/storage/drivers/vfs" import "go.podman.io/storage/pkg/chrootarchive" func dirCopy(srcDir, dstDir string) error { return chrootarchive.NewArchiver(nil).CopyWithTar(srcDir, dstDir) } ================================================ FILE: vendor/go.podman.io/storage/drivers/vfs/driver.go ================================================ package vfs import ( "fmt" "io" "os" "path/filepath" "runtime" "slices" "strconv" "strings" "github.com/opencontainers/selinux/go-selinux/label" "github.com/sirupsen/logrus" "github.com/vbatts/tar-split/tar/storage" graphdriver "go.podman.io/storage/drivers" "go.podman.io/storage/internal/dedup" "go.podman.io/storage/internal/tempdir" "go.podman.io/storage/pkg/archive" "go.podman.io/storage/pkg/directory" "go.podman.io/storage/pkg/fileutils" "go.podman.io/storage/pkg/idtools" "go.podman.io/storage/pkg/parsers" "go.podman.io/storage/pkg/system" ) const ( defaultPerms = os.FileMode(0o555) tempDirName = "tempdirs" ) func init() { graphdriver.MustRegister("vfs", Init) } // Init returns a new VFS driver. // This sets the home directory for the driver and returns NaiveDiffDriver. func Init(home string, options graphdriver.Options) (graphdriver.Driver, error) { d := &Driver{ name: "vfs", home: home, imageStore: options.ImageStore, } if err := os.MkdirAll(filepath.Join(home, "dir"), 0o700); err != nil { return nil, err } for _, option := range options.DriverOptions { key, val, err := parsers.ParseKeyValueOpt(option) if err != nil { return nil, err } key = strings.ToLower(key) switch key { case "vfs.imagestore", ".imagestore": d.additionalHomes = slices.AppendSeq(d.additionalHomes, strings.SplitSeq(val, ",")) continue case "vfs.mountopt": return nil, fmt.Errorf("vfs driver does not support mount options") case ".ignore_chown_errors", "vfs.ignore_chown_errors": logrus.Debugf("vfs: ignore_chown_errors=%s", val) var err error d.ignoreChownErrors, err = strconv.ParseBool(val) if err != nil { return nil, err } default: return nil, fmt.Errorf("vfs driver does not support %s options", key) } } d.updater = graphdriver.NewNaiveLayerIDMapUpdater(d) d.naiveDiff = graphdriver.NewNaiveDiffDriver(d, d.updater) return d, nil } // Driver holds information about the driver, home directory of the driver. // Driver implements graphdriver.ProtoDriver. It uses only basic vfs operations. // In order to support layering, files are copied from the parent layer into the new layer. There is no copy-on-write support. // Driver must be wrapped in NaiveDiffDriver to be used as a graphdriver.Driver type Driver struct { name string home string additionalHomes []string ignoreChownErrors bool naiveDiff graphdriver.DiffDriver updater graphdriver.LayerIDMapUpdater imageStore string } func (d *Driver) String() string { return "vfs" } // Status is used for implementing the graphdriver.ProtoDriver interface. VFS does not currently have any status information. func (d *Driver) Status() [][2]string { return nil } // Metadata is used for implementing the graphdriver.ProtoDriver interface. VFS does not currently have any meta data. func (d *Driver) Metadata(id string) (map[string]string, error) { return nil, nil //nolint: nilnil } // Cleanup is used to implement graphdriver.ProtoDriver. There is no cleanup required for this driver. func (d *Driver) Cleanup() error { return nil } type fileGetNilCloser struct { storage.FileGetter } func (f fileGetNilCloser) Close() error { return nil } // DiffGetter returns a FileGetCloser that can read files from the directory that // contains files for the layer differences. Used for direct access for tar-split. func (d *Driver) DiffGetter(id string) (graphdriver.FileGetCloser, error) { p := d.dir(id) return fileGetNilCloser{storage.NewPathFileGetter(p)}, nil } // CreateFromTemplate creates a layer with the same contents and parent as another layer. func (d *Driver) CreateFromTemplate(id, template string, templateIDMappings *idtools.IDMappings, parent string, parentIDMappings *idtools.IDMappings, opts *graphdriver.CreateOpts, readWrite bool) error { if readWrite { return d.CreateReadWrite(id, template, opts) } return d.Create(id, template, opts) } // ApplyDiff applies the new layer into a root func (d *Driver) ApplyDiff(id string, options graphdriver.ApplyDiffOpts) (size int64, err error) { if d.ignoreChownErrors { options.IgnoreChownErrors = d.ignoreChownErrors } return d.naiveDiff.ApplyDiff(id, options) } // CreateReadWrite creates a layer that is writable for use as a container // file system. func (d *Driver) CreateReadWrite(id, parent string, opts *graphdriver.CreateOpts) error { return d.create(id, parent, opts, false) } // Create prepares the filesystem for the VFS driver and copies the directory for the given id under the parent. func (d *Driver) Create(id, parent string, opts *graphdriver.CreateOpts) error { return d.create(id, parent, opts, true) } func (d *Driver) create(id, parent string, opts *graphdriver.CreateOpts, ro bool) (retErr error) { if opts != nil && len(opts.StorageOpt) != 0 { return fmt.Errorf("--storage-opt is not supported for vfs") } var uidMaps []idtools.IDMap var gidMaps []idtools.IDMap if opts != nil && opts.IDMappings != nil { uidMaps = opts.IDMappings.UIDs() gidMaps = opts.IDMappings.GIDs() } rootUID, rootGID, err := idtools.GetRootUIDGID(uidMaps, gidMaps) if err != nil { return err } dir := d.dir2(id, ro) if err := os.MkdirAll(filepath.Dir(dir), 0o700); err != nil { return err } defer func() { if retErr != nil { os.RemoveAll(dir) } }() rootPerms := defaultPerms if runtime.GOOS == "darwin" { rootPerms = os.FileMode(0o700) } idPair := idtools.IDPair{UID: rootUID, GID: rootGID} if parent != "" { st, err := system.Stat(d.dir(parent)) if err != nil { return err } rootPerms = os.FileMode(st.Mode()) idPair.UID = int(st.UID()) idPair.GID = int(st.GID()) } if err := idtools.MkdirAllAndChownNew(dir, rootPerms, idPair); err != nil { return err } labelOpts := []string{"level:s0"} if _, mountLabel, err := label.InitLabels(labelOpts); err == nil { if err := label.SetFileLabel(dir, mountLabel); err != nil { logrus.Debugf("Set %s label to %q file ended with error: %v", mountLabel, dir, err) } } if parent != "" { parentDir, err := d.Get(parent, graphdriver.MountOpts{}) if err != nil { return fmt.Errorf("%s: %w", parent, err) } if err := dirCopy(parentDir, dir); err != nil { return err } } return nil } func (d *Driver) dir2(id string, useImageStore bool) string { var homedir string if useImageStore && d.imageStore != "" { homedir = filepath.Join(d.imageStore, d.String(), "dir", filepath.Base(id)) } else { homedir = filepath.Join(d.home, "dir", filepath.Base(id)) } if err := fileutils.Exists(homedir); err != nil { additionalHomes := d.additionalHomes if d.imageStore != "" { additionalHomes = append(additionalHomes, d.imageStore) } for _, home := range additionalHomes { candidate := filepath.Join(home, d.String(), "dir", filepath.Base(id)) fi, err := os.Stat(candidate) if err == nil && fi.IsDir() { return candidate } } } return homedir } func (d *Driver) dir(id string) string { return d.dir2(id, false) } // Remove deletes the content from the directory for a given id. func (d *Driver) Remove(id string) error { return system.EnsureRemoveAll(d.dir(id)) } func (d *Driver) GetTempDirRootDirs() []string { tempDirs := []string{filepath.Join(d.home, tempDirName)} // Include imageStore temp directory if it's configured // Writable layers can only be in d.home or d.imageStore, not in additionalHomes (which are read-only) if d.imageStore != "" { tempDirs = append(tempDirs, filepath.Join(d.imageStore, d.String(), tempDirName)) } return tempDirs } // Determine the correct temp directory root based on where the layer actually exists. func (d *Driver) getTempDirRoot(id string) string { layerDir := d.dir(id) if d.imageStore != "" { expectedLayerDir := filepath.Join(d.imageStore, d.String(), "dir", filepath.Base(id)) if layerDir == expectedLayerDir { return filepath.Join(d.imageStore, d.String(), tempDirName) } } return filepath.Join(d.home, tempDirName) } func (d *Driver) DeferredRemove(id string) (tempdir.CleanupTempDirFunc, error) { tempDirRoot := d.getTempDirRoot(id) t, err := tempdir.NewTempDir(tempDirRoot) if err != nil { return nil, err } layerDir := d.dir(id) if err := t.StageDeletion(layerDir); err != nil { return t.Cleanup, err } return t.Cleanup, nil } // Get returns the directory for the given id. func (d *Driver) Get(id string, options graphdriver.MountOpts) (_ string, retErr error) { dir := d.dir(id) for _, opt := range options.Options { if opt == "ro" { // ignore "ro" option continue } return "", fmt.Errorf("vfs driver does not support mount options") } if st, err := os.Stat(dir); err != nil { return "", err } else if !st.IsDir() { return "", fmt.Errorf("%s: not a directory", dir) } return dir, nil } // Put is a noop for vfs that return nil for the error, since this driver has no runtime resources to clean up. func (d *Driver) Put(id string) error { // The vfs driver has no runtime resources (e.g. mounts) // to clean up, so we don't need anything here return nil } // ReadWriteDiskUsage returns the disk usage of the writable directory for the ID. // For VFS, it queries the directory for this ID. func (d *Driver) ReadWriteDiskUsage(id string) (*directory.DiskUsage, error) { return directory.Usage(d.dir(id)) } // Exists checks to see if the directory exists for the given id. func (d *Driver) Exists(id string) bool { err := fileutils.Exists(d.dir(id)) return err == nil } // List layers (not including additional image stores) func (d *Driver) ListLayers() ([]string, error) { entries, err := os.ReadDir(filepath.Join(d.home, "dir")) if err != nil { return nil, err } layers := make([]string, 0) for _, entry := range entries { id := entry.Name() // Does it look like a datadir directory? if !entry.IsDir() { continue } layers = append(layers, id) } return layers, err } // AdditionalImageStores returns additional image stores supported by the driver func (d *Driver) AdditionalImageStores() []string { if len(d.additionalHomes) > 0 { return d.additionalHomes } return nil } // SupportsShifting tells whether the driver support shifting of the UIDs/GIDs to the provided mapping in an userNS func (d *Driver) SupportsShifting(uidmap, gidmap []idtools.IDMap) bool { return d.updater.SupportsShifting(uidmap, gidmap) } // UpdateLayerIDMap updates ID mappings in a from matching the ones specified // by toContainer to those specified by toHost. func (d *Driver) UpdateLayerIDMap(id string, toContainer, toHost *idtools.IDMappings, mountLabel string) error { if err := d.updater.UpdateLayerIDMap(id, toContainer, toHost, mountLabel); err != nil { return err } dir := d.dir(id) rootIDs, err := toHost.ToHost(idtools.IDPair{UID: 0, GID: 0}) if err != nil { return err } return os.Chown(dir, rootIDs.UID, rootIDs.GID) } // Changes produces a list of changes between the specified layer // and its parent layer. If parent is "", then all changes will be ADD changes. func (d *Driver) Changes(id string, idMappings *idtools.IDMappings, parent string, parentMappings *idtools.IDMappings, mountLabel string) ([]archive.Change, error) { return d.naiveDiff.Changes(id, idMappings, parent, parentMappings, mountLabel) } // Diff produces an archive of the changes between the specified // layer and its parent layer which may be "". func (d *Driver) Diff(id string, idMappings *idtools.IDMappings, parent string, parentMappings *idtools.IDMappings, mountLabel string) (io.ReadCloser, error) { return d.naiveDiff.Diff(id, idMappings, parent, parentMappings, mountLabel) } // DiffSize calculates the changes between the specified id // and its parent and returns the size in bytes of the changes // relative to its base filesystem directory. func (d *Driver) DiffSize(id string, idMappings *idtools.IDMappings, parent string, parentMappings *idtools.IDMappings, mountLabel string) (size int64, err error) { return d.naiveDiff.DiffSize(id, idMappings, parent, parentMappings, mountLabel) } // Dedup performs deduplication of the driver's storage. func (d *Driver) Dedup(req graphdriver.DedupArgs) (graphdriver.DedupResult, error) { var dirs []string for _, layer := range req.Layers { dir := d.dir2(layer, false) if err := fileutils.Exists(dir); err == nil { dirs = append(dirs, dir) } } r, err := dedup.DedupDirs(dirs, req.Options) if err != nil { return graphdriver.DedupResult{}, err } return graphdriver.DedupResult{Deduped: r.Deduped}, nil } ================================================ FILE: vendor/go.podman.io/storage/drivers/zfs/MAINTAINERS ================================================ Jörg Thalheim (@Mic92) Arthur Gautier (@baloose) ================================================ FILE: vendor/go.podman.io/storage/drivers/zfs/zfs.go ================================================ //go:build linux || freebsd package zfs import ( "fmt" "os" "os/exec" "path" "strconv" "strings" "sync" "time" zfs "github.com/mistifyio/go-zfs/v4" "github.com/opencontainers/selinux/go-selinux/label" "github.com/sirupsen/logrus" graphdriver "go.podman.io/storage/drivers" "go.podman.io/storage/internal/tempdir" "go.podman.io/storage/pkg/directory" "go.podman.io/storage/pkg/idtools" "go.podman.io/storage/pkg/mount" "go.podman.io/storage/pkg/parsers" "golang.org/x/sys/unix" ) type zfsOptions struct { fsName string mountPath string mountOptions string } const defaultPerms = os.FileMode(0o555) func init() { graphdriver.MustRegister("zfs", Init) } // Logger returns a zfs logger implementation. type Logger struct{} // Log wraps log message from ZFS driver with a prefix '[zfs]'. func (*Logger) Log(cmd []string) { logrus.WithField("storage-driver", "zfs").Debugf("%s", strings.Join(cmd, " ")) } // Init returns a new ZFS driver. // It takes base mount path and an array of options which are represented as key value pairs. // Each option is in the for key=value. 'zfs.fsname' is expected to be a valid key in the options. func Init(base string, opt graphdriver.Options) (graphdriver.Driver, error) { var err error logger := logrus.WithField("storage-driver", "zfs") if _, err := exec.LookPath("zfs"); err != nil { logger.Debugf("zfs command is not available: %v", err) return nil, fmt.Errorf("the 'zfs' command is not available: %w", graphdriver.ErrPrerequisites) } file, err := unix.Open("/dev/zfs", unix.O_RDWR, 0o600) if err != nil { logger.Debugf("cannot open /dev/zfs: %v", err) return nil, fmt.Errorf("could not open /dev/zfs: %v: %w", err, graphdriver.ErrPrerequisites) } defer unix.Close(file) options, err := parseOptions(opt.DriverOptions) if err != nil { return nil, err } options.mountPath = base rootdir := path.Dir(base) if options.fsName == "" { err = checkRootdirFs(rootdir) if err != nil { return nil, err } } if options.fsName == "" { options.fsName, err = lookupZfsDataset(rootdir) if err != nil { return nil, err } } zfs.SetLogger(new(Logger)) filesystems, err := zfs.Filesystems(options.fsName) if err != nil { return nil, fmt.Errorf("cannot find root filesystem %s: %w", options.fsName, err) } filesystemsCache := make(map[string]bool, len(filesystems)) var rootDataset *zfs.Dataset for _, fs := range filesystems { if fs.Name == options.fsName { rootDataset = fs } filesystemsCache[fs.Name] = true } if rootDataset == nil { return nil, fmt.Errorf("zfs get all -t filesystem -rHp '%s' should contain '%s'", options.fsName, options.fsName) } if err := os.MkdirAll(base, 0o700); err != nil { return nil, fmt.Errorf("failed to create '%s': %w", base, err) } d := &Driver{ dataset: rootDataset, options: options, filesystemsCache: filesystemsCache, ctr: graphdriver.NewRefCounter(graphdriver.NewDefaultChecker()), } return graphdriver.NewNaiveDiffDriver(d, graphdriver.NewNaiveLayerIDMapUpdater(d)), nil } func parseOptions(opt []string) (zfsOptions, error) { var options zfsOptions options.fsName = "" for _, option := range opt { key, val, err := parsers.ParseKeyValueOpt(option) if err != nil { return options, err } key = strings.ToLower(key) switch key { case "zfs.fsname": options.fsName = val case "zfs.mountopt": options.mountOptions = val default: return options, fmt.Errorf("unknown option %s", key) } } return options, nil } func lookupZfsDataset(rootdir string) (string, error) { var stat unix.Stat_t if err := unix.Stat(rootdir, &stat); err != nil { return "", fmt.Errorf("failed to access '%s': %w", rootdir, err) } wantedDev := stat.Dev mounts, err := mount.GetMounts() if err != nil { return "", err } for _, m := range mounts { if err := unix.Stat(m.Mountpoint, &stat); err != nil { logrus.WithField("storage-driver", "zfs").Debugf("failed to stat '%s' while scanning for zfs mount: %v", m.Mountpoint, err) continue // may fail on fuse file systems } if stat.Dev == wantedDev && m.FSType == "zfs" { return m.Source, nil } } return "", fmt.Errorf("failed to find zfs dataset mounted on '%s' in /proc/mounts", rootdir) } // Driver holds information about the driver, such as zfs dataset, options and cache. type Driver struct { dataset *zfs.Dataset options zfsOptions sync.Mutex // protects filesystem cache against concurrent access filesystemsCache map[string]bool ctr *graphdriver.RefCounter } func (d *Driver) String() string { return "zfs" } // Cleanup is called on when program exits, it is a no-op for ZFS. func (d *Driver) Cleanup() error { return nil } // Status returns information about the ZFS filesystem. It returns a two dimensional array of information // such as pool name, dataset name, disk usage, parent quota and compression used. // Currently it return 'Zpool', 'Zpool Health', 'Parent Dataset', 'Space Used By Parent', // 'Space Available', 'Parent Quota' and 'Compression'. func (d *Driver) Status() [][2]string { fsName, _, _ := strings.Cut(d.dataset.Name, "/") pool, err := zfs.GetZpool(fsName) var poolName, poolHealth string if err == nil { poolName = pool.Name poolHealth = pool.Health } else { poolName = fmt.Sprintf("error while getting pool information %v", err) poolHealth = "not available" } quota := "no" if d.dataset.Quota != 0 { quota = strconv.FormatUint(d.dataset.Quota, 10) } return [][2]string{ {"Zpool", poolName}, {"Zpool Health", poolHealth}, {"Parent Dataset", d.dataset.Name}, {"Space Used By Parent", strconv.FormatUint(d.dataset.Used, 10)}, {"Space Available", strconv.FormatUint(d.dataset.Avail, 10)}, {"Parent Quota", quota}, {"Compression", d.dataset.Compression}, } } // Metadata returns image/container metadata related to graph driver func (d *Driver) Metadata(id string) (map[string]string, error) { return map[string]string{ "Mountpoint": d.mountPath(id), "Dataset": d.zfsPath(id), }, nil } func (d *Driver) cloneFilesystem(name, parentName string) error { snapshotName := fmt.Sprintf("%d", time.Now().Nanosecond()) parentDataset := zfs.Dataset{Name: parentName} snapshot, err := parentDataset.Snapshot(snapshotName /*recursive */, false) if err != nil { return err } _, err = snapshot.Clone(name, map[string]string{"mountpoint": "legacy"}) if err == nil { d.Lock() d.filesystemsCache[name] = true d.Unlock() } if err != nil { if err1 := snapshot.Destroy(zfs.DestroyDeferDeletion); err1 != nil { logrus.Warnf("Destroy zfs.DestroyDeferDeletion: %v", err1) } return err } return snapshot.Destroy(zfs.DestroyDeferDeletion) } func (d *Driver) zfsPath(id string) string { return d.options.fsName + "/" + id } func (d *Driver) mountPath(id string) string { return path.Join(d.options.mountPath, "graph", getMountpoint(id)) } // CreateFromTemplate creates a layer with the same contents and parent as another layer. func (d *Driver) CreateFromTemplate(id, template string, templateIDMappings *idtools.IDMappings, parent string, parentIDMappings *idtools.IDMappings, opts *graphdriver.CreateOpts, readWrite bool) error { return d.Create(id, template, opts) } // CreateReadWrite creates a layer that is writable for use as a container // file system. func (d *Driver) CreateReadWrite(id, parent string, opts *graphdriver.CreateOpts) error { return d.Create(id, parent, opts) } // Create prepares the dataset and filesystem for the ZFS driver for the given id under the parent. func (d *Driver) Create(id, parent string, opts *graphdriver.CreateOpts) error { err := d.create(id, parent, opts) if err == nil { return nil } if zfsError, ok := err.(*zfs.Error); ok { if !strings.HasSuffix(zfsError.Stderr, "dataset already exists\n") { return err } // aborted build -> cleanup } else { return err } dataset := zfs.Dataset{Name: d.zfsPath(id)} if err := dataset.Destroy(zfs.DestroyRecursiveClones); err != nil { return err } // retry return d.create(id, parent, opts) } func (d *Driver) create(id, parent string, opts *graphdriver.CreateOpts) error { var storageOpt map[string]string if opts != nil { storageOpt = opts.StorageOpt } name := d.zfsPath(id) mountpoint := d.mountPath(id) quota, err := parseStorageOpt(storageOpt) if err != nil { return err } if parent == "" { rootIDs := idtools.IDPair{UID: 0, GID: 0} var mountLabel string if opts != nil { rootUID, rootGID, err := idtools.GetRootUIDGID(opts.UIDs(), opts.GIDs()) if err != nil { return fmt.Errorf("failed to get root uid/gid: %w", err) } rootIDs = idtools.IDPair{UID: rootUID, GID: rootGID} mountLabel = opts.MountLabel } mountoptions := map[string]string{"mountpoint": "legacy"} fs, err := zfs.CreateFilesystem(name, mountoptions) if err == nil { err = setQuota(name, quota) if err == nil { d.Lock() d.filesystemsCache[fs.Name] = true d.Unlock() } if err := idtools.MkdirAllAndChown(mountpoint, defaultPerms, rootIDs); err != nil { return err } defer func() { if err := unix.Rmdir(mountpoint); err != nil && !os.IsNotExist(err) { logrus.Debugf("Failed to remove %s mount point %s: %v", id, mountpoint, err) } }() mountOpts := label.FormatMountLabel(d.options.mountOptions, mountLabel) if err := mount.Mount(name, mountpoint, "zfs", mountOpts); err != nil { return fmt.Errorf("creating zfs mount: %w", err) } defer func() { if err := detachUnmount(mountpoint); err != nil { logrus.Warnf("failed to unmount %s mount %s: %v", id, mountpoint, err) } }() if err := os.Chmod(mountpoint, defaultPerms); err != nil { return fmt.Errorf("setting permissions on zfs mount: %w", err) } // this is our first mount after creation of the filesystem, and the root dir may still have root // permissions instead of the remapped root uid:gid (if user namespaces are enabled): if err := os.Chown(mountpoint, rootIDs.UID, rootIDs.GID); err != nil { return fmt.Errorf("modifying zfs mountpoint (%s) ownership: %w", mountpoint, err) } } return err } err = d.cloneFilesystem(name, d.zfsPath(parent)) if err == nil { err = setQuota(name, quota) } return err } func parseStorageOpt(storageOpt map[string]string) (string, error) { // Read size to change the disk quota per container for k, v := range storageOpt { key := strings.ToLower(k) switch key { case "size": return v, nil default: return "0", fmt.Errorf("unknown option %s", key) } } return "0", nil } func setQuota(name string, quota string) error { if quota == "0" { return nil } fs, err := zfs.GetDataset(name) if err != nil { return err } return fs.SetProperty("quota", quota) } // Remove deletes the dataset, filesystem and the cache for the given id. func (d *Driver) Remove(id string) error { name := d.zfsPath(id) dataset := zfs.Dataset{Name: name} err := dataset.Destroy(zfs.DestroyRecursive) if err != nil { // We must be tolerant in case the image has already been removed, // for example, accidentally by hand. if _, err1 := zfs.GetDataset(name); err1 == nil { return err } logrus.WithField("storage-driver", "zfs").Debugf("Layer %s has already been removed; ignore it and continue to delete the cache", id) } d.Lock() delete(d.filesystemsCache, name) d.Unlock() return nil } // DeferredRemove is not implemented. // It calls Remove directly. func (d *Driver) DeferredRemove(id string) (tempdir.CleanupTempDirFunc, error) { return nil, d.Remove(id) } // Get returns the mountpoint for the given id after creating the target directories if necessary. func (d *Driver) Get(id string, options graphdriver.MountOpts) (_ string, retErr error) { mountpoint := d.mountPath(id) if count := d.ctr.Increment(mountpoint); count > 1 { return mountpoint, nil } defer func() { if retErr != nil { if c := d.ctr.Decrement(mountpoint); c <= 0 { if mntErr := unix.Unmount(mountpoint, 0); mntErr != nil { logrus.WithField("storage-driver", "zfs").Errorf("Error unmounting %v: %v", mountpoint, mntErr) } if rmErr := unix.Rmdir(mountpoint); rmErr != nil && !os.IsNotExist(rmErr) { logrus.WithField("storage-driver", "zfs").Debugf("Failed to remove %s: %v", id, rmErr) } } } }() // In the case of a read-only mount we first mount read-write so we can set the // correct permissions on the mount point and remount read-only afterwards. remountReadOnly := false mountOptions := d.options.mountOptions if len(options.Options) > 0 { var newOptions []string for _, option := range options.Options { if option == "ro" { // Filter out read-only mount option but remember for later remounting. remountReadOnly = true } else { newOptions = append(newOptions, option) } } mountOptions = strings.Join(newOptions, ",") } filesystem := d.zfsPath(id) opts := label.FormatMountLabel(mountOptions, options.MountLabel) logrus.WithField("storage-driver", "zfs").Debugf(`mount("%s", "%s", "%s")`, filesystem, mountpoint, opts) // Create the target directories if they don't exist if err := os.MkdirAll(mountpoint, 0o755); err != nil { return "", err } if err := mount.Mount(filesystem, mountpoint, "zfs", opts); err != nil { return "", fmt.Errorf("creating zfs mount: %w", err) } if remountReadOnly { opts = label.FormatMountLabel("remount,ro", options.MountLabel) if err := mount.Mount(filesystem, mountpoint, "zfs", opts); err != nil { return "", fmt.Errorf("remounting zfs mount read-only: %w", err) } } return mountpoint, nil } // Put removes the existing mountpoint for the given id if it exists. func (d *Driver) Put(id string) error { mountpoint := d.mountPath(id) if count := d.ctr.Decrement(mountpoint); count > 0 { return nil } logger := logrus.WithField("storage-driver", "zfs") logger.Debugf(`unmount("%s")`, mountpoint) if err := detachUnmount(mountpoint); err != nil { logger.Warnf("Failed to unmount %s mount %s: %v", id, mountpoint, err) } if err := unix.Rmdir(mountpoint); err != nil && !os.IsNotExist(err) { logger.Debugf("Failed to remove %s mount point %s: %v", id, mountpoint, err) } return nil } // ReadWriteDiskUsage returns the disk usage of the writable directory for the ID. // For ZFS, it queries the full mount path for this ID. func (d *Driver) ReadWriteDiskUsage(id string) (*directory.DiskUsage, error) { return directory.Usage(d.mountPath(id)) } // Exists checks to see if the cache entry exists for the given id. func (d *Driver) Exists(id string) bool { d.Lock() defer d.Unlock() return d.filesystemsCache[d.zfsPath(id)] } // List layers (not including additional image stores). Our layers aren't all // dependent on a single well-known dataset, so we can't reliably tell which // datasets are ours and which ones just look like they could be ours. func (d *Driver) ListLayers() ([]string, error) { return nil, graphdriver.ErrNotSupported } // AdditionalImageStores returns additional image stores supported by the driver func (d *Driver) AdditionalImageStores() []string { return nil } // Dedup performs deduplication of the driver's storage. func (d *Driver) Dedup(req graphdriver.DedupArgs) (graphdriver.DedupResult, error) { return graphdriver.DedupResult{}, nil } // GetTempDirRootDirs is not implemented. func (d *Driver) GetTempDirRootDirs() []string { return []string{} } ================================================ FILE: vendor/go.podman.io/storage/drivers/zfs/zfs_freebsd.go ================================================ package zfs import ( "fmt" "github.com/sirupsen/logrus" graphdriver "go.podman.io/storage/drivers" "golang.org/x/sys/unix" ) func checkRootdirFs(rootdir string) error { var buf unix.Statfs_t if err := unix.Statfs(rootdir, &buf); err != nil { return fmt.Errorf("failed to access '%s': %s", rootdir, err) } // on FreeBSD buf.Fstypename contains ['z', 'f', 's', 0 ... ] if (buf.Fstypename[0] != 122) || (buf.Fstypename[1] != 102) || (buf.Fstypename[2] != 115) || (buf.Fstypename[3] != 0) { logrus.WithField("storage-driver", "zfs").Debugf("no zfs dataset found for rootdir '%s'", rootdir) return fmt.Errorf("no zfs dataset found for rootdir '%s': %w", rootdir, graphdriver.ErrPrerequisites) } return nil } func getMountpoint(id string) string { return id } func detachUnmount(mountpoint string) error { // FreeBSD's MNT_FORCE is roughly equivalent to MNT_DETACH return unix.Unmount(mountpoint, unix.MNT_FORCE) } ================================================ FILE: vendor/go.podman.io/storage/drivers/zfs/zfs_linux.go ================================================ package zfs import ( "fmt" "github.com/sirupsen/logrus" graphdriver "go.podman.io/storage/drivers" "golang.org/x/sys/unix" ) func checkRootdirFs(rootDir string) error { fsMagic, err := graphdriver.GetFSMagic(rootDir) if err != nil { return err } backingFS := "unknown" if fsName, ok := graphdriver.FsNames[fsMagic]; ok { backingFS = fsName } if fsMagic != graphdriver.FsMagicZfs { logrus.WithField("root", rootDir).WithField("backingFS", backingFS).WithField("storage-driver", "zfs").Error("No zfs dataset found for root") return fmt.Errorf("no zfs dataset found for rootdir '%s': %w", rootDir, graphdriver.ErrPrerequisites) } return nil } func getMountpoint(id string) string { return id } func detachUnmount(mountpoint string) error { return unix.Unmount(mountpoint, unix.MNT_DETACH) } ================================================ FILE: vendor/go.podman.io/storage/drivers/zfs/zfs_unsupported.go ================================================ //go:build !linux && !freebsd package zfs ================================================ FILE: vendor/go.podman.io/storage/errors.go ================================================ package storage import ( "errors" "go.podman.io/storage/types" ) var ( // ErrContainerUnknown indicates that there was no container with the specified name or ID. ErrContainerUnknown = types.ErrContainerUnknown // ErrDigestUnknown indicates that we were unable to compute the digest of a specified item. ErrDigestUnknown = types.ErrDigestUnknown // ErrDuplicateID indicates that an ID which is to be assigned to a new item is already being used. ErrDuplicateID = types.ErrDuplicateID // ErrDuplicateImageNames indicates that the read-only store uses the same name for multiple images. ErrDuplicateImageNames = types.ErrDuplicateImageNames // ErrDuplicateLayerNames indicates that the read-only store uses the same name for multiple layers. ErrDuplicateLayerNames = types.ErrDuplicateLayerNames // ErrDuplicateName indicates that a name which is to be assigned to a new item is already being used. ErrDuplicateName = types.ErrDuplicateName // ErrImageUnknown indicates that there was no image with the specified name or ID. ErrImageUnknown = types.ErrImageUnknown // ErrImageUsedByContainer is returned when the caller attempts to delete an image that is a container's image. ErrImageUsedByContainer = types.ErrImageUsedByContainer // ErrIncompleteOptions is returned when the caller attempts to initialize a Store without providing required information. ErrIncompleteOptions = types.ErrIncompleteOptions // ErrInvalidBigDataName indicates that the name for a big data item is not acceptable; it may be empty. ErrInvalidBigDataName = types.ErrInvalidBigDataName // ErrLayerHasChildren is returned when the caller attempts to delete a layer that has children. ErrLayerHasChildren = types.ErrLayerHasChildren // ErrLayerNotMounted is returned when the requested information can only be computed for a mounted layer, and the layer is not mounted. ErrLayerNotMounted = types.ErrLayerNotMounted // ErrLayerUnknown indicates that there was no layer with the specified name or ID. ErrLayerUnknown = types.ErrLayerUnknown // ErrLayerUsedByContainer is returned when the caller attempts to delete a layer that is a container's layer. ErrLayerUsedByContainer = types.ErrLayerUsedByContainer // ErrLayerUsedByImage is returned when the caller attempts to delete a layer that is an image's top layer. ErrLayerUsedByImage = types.ErrLayerUsedByImage // ErrLoadError indicates that there was an initialization error. ErrLoadError = types.ErrLoadError // ErrNotAContainer is returned when the caller attempts to delete a container that isn't a container. ErrNotAContainer = types.ErrNotAContainer // ErrNotALayer is returned when the caller attempts to delete a layer that isn't a layer. ErrNotALayer = types.ErrNotALayer // ErrNotAnID is returned when the caller attempts to read or write metadata from an item that doesn't exist. ErrNotAnID = types.ErrNotAnID // ErrNotAnImage is returned when the caller attempts to delete an image that isn't an image. ErrNotAnImage = types.ErrNotAnImage // ErrParentIsContainer is returned when a caller attempts to create a layer as a child of a container's layer. ErrParentIsContainer = types.ErrParentIsContainer // ErrParentUnknown indicates that we didn't record the ID of the parent of the specified layer. ErrParentUnknown = types.ErrParentUnknown // ErrSizeUnknown is returned when the caller asks for the size of a big data item, but the Store couldn't determine the answer. ErrSizeUnknown = types.ErrSizeUnknown // ErrStoreIsReadOnly is returned when the caller makes a call to a read-only store that would require modifying its contents. ErrStoreIsReadOnly = types.ErrStoreIsReadOnly // ErrNotSupported is returned when the requested functionality is not supported. ErrNotSupported = types.ErrNotSupported // ErrInvalidMappings is returned when the specified mappings are invalid. ErrInvalidMappings = types.ErrInvalidMappings // ErrInvalidNameOperation is returned when updateName is called with invalid operation. // Internal error errInvalidUpdateNameOperation = errors.New("invalid update name operation") ) ================================================ FILE: vendor/go.podman.io/storage/idset.go ================================================ package storage import ( "fmt" "strings" "github.com/google/go-intervals/intervalset" "go.podman.io/storage/pkg/idtools" "go.podman.io/storage/types" ) // idSet represents a set of integer IDs. It is stored as an ordered set of intervals. type idSet struct { set *intervalset.ImmutableSet } func newIDSet(intervals []interval) *idSet { s := intervalset.Empty() for _, i := range intervals { s.Add(intervalset.NewSet([]intervalset.Interval{i})) } return &idSet{set: s.ImmutableSet()} } // getHostIDs returns all the host ids in the id map. func getHostIDs(idMaps []idtools.IDMap) *idSet { var intervals []interval for _, m := range idMaps { intervals = append(intervals, interval{start: m.HostID, end: m.HostID + m.Size}) } return newIDSet(intervals) } // getContainerIDs returns all the container ids in the id map. func getContainerIDs(idMaps []idtools.IDMap) *idSet { var intervals []interval for _, m := range idMaps { intervals = append(intervals, interval{start: m.ContainerID, end: m.ContainerID + m.Size}) } return newIDSet(intervals) } // subtract returns the subtraction of `s` and `t`. `s` and `t` are unchanged. func (s *idSet) subtract(t *idSet) *idSet { if s == nil || t == nil { return s } return &idSet{set: s.set.Sub(t.set)} } // union returns the union of `s` and `t`. `s` and `t` are unchanged. func (s *idSet) union(t *idSet) *idSet { if s == nil { return t } else if t == nil { return s } return &idSet{set: s.set.Union(t.set)} } // Methods to iterate over the intervals of the idSet. intervalset doesn't provide one :-( // iterator to idSet. Returns nil if iteration finishes. type iteratorFn func() *interval // cancelFn must be called exactly once unless iteratorFn returns nil, otherwise go routine might // leak. type cancelFn func() func (s *idSet) iterator() (iteratorFn, cancelFn) { if s == nil { return func() *interval { return nil }, func() {} } cancelCh := make(chan byte) dataCh := make(chan interval) go func() { s.set.Intervals(func(ii intervalset.Interval) bool { select { case <-cancelCh: return false case dataCh <- ii.(interval): return true } }) close(dataCh) }() iterator := func() *interval { i, ok := <-dataCh if !ok { return nil } return &i } return iterator, func() { close(cancelCh) } } // size returns the total number of ids in the ID set. func (s *idSet) size() int { var size int iterator, cancel := s.iterator() defer cancel() for i := iterator(); i != nil; i = iterator() { size += i.length() } return size } // findAvailable finds the `n` ids from `s`. func (s *idSet) findAvailable(n int) (*idSet, error) { var intervals []intervalset.Interval iterator, cancel := s.iterator() defer cancel() for i := iterator(); n > 0 && i != nil; i = iterator() { i.end = min(i.end, i.start+n) intervals = append(intervals, *i) n -= i.length() } if n > 0 { return nil, types.ErrNoAvailableIDs } return &idSet{set: intervalset.NewImmutableSet(intervals)}, nil } // zip creates an id map from `s` (host ids) and container ids. func (s *idSet) zip(container *idSet) []idtools.IDMap { hostIterator, hostCancel := s.iterator() defer hostCancel() containerIterator, containerCancel := container.iterator() defer containerCancel() var out []idtools.IDMap for h, c := hostIterator(), containerIterator(); h != nil && c != nil; { if n := min(h.length(), c.length()); n > 0 { out = append(out, idtools.IDMap{ ContainerID: c.start, HostID: h.start, Size: n, }) h.start += n c.start += n } if h.IsZero() { h = hostIterator() } if c.IsZero() { c = containerIterator() } } return out } // interval represents an interval of integers [start, end). Note it is allowed to have // start >= end, in which case it is treated as an empty interval. It implements interface // intervalset.Interval. type interval struct { // Start of the interval (inclusive). start int // End of the interval (exclusive). end int } func (i interval) length() int { return max(0, i.end-i.start) } func (i interval) Intersect(other intervalset.Interval) intervalset.Interval { j := other.(interval) return interval{start: max(i.start, j.start), end: min(i.end, j.end)} } func (i interval) Before(other intervalset.Interval) bool { j := other.(interval) return !i.IsZero() && !j.IsZero() && i.end < j.start } func (i interval) IsZero() bool { return i.length() <= 0 } func (i interval) Bisect(other intervalset.Interval) (intervalset.Interval, intervalset.Interval) { j := other.(interval) if j.IsZero() { return i, interval{} } // Subtracting [j.start, j.end) is equivalent to the union of intersecting (-inf, j.start) and // [j.end, +inf). left := interval{start: i.start, end: min(i.end, j.start)} right := interval{start: max(i.start, j.end), end: i.end} return left, right } func (i interval) Adjoin(other intervalset.Interval) intervalset.Interval { j := other.(interval) if !i.IsZero() && !j.IsZero() && (i.end == j.start || j.end == i.start) { return interval{start: min(i.start, j.start), end: max(i.end, j.end)} } return interval{} } func (i interval) Encompass(other intervalset.Interval) intervalset.Interval { j := other.(interval) switch { case i.IsZero(): return j case j.IsZero(): return i default: return interval{start: min(i.start, j.start), end: max(i.end, j.end)} } } func hasOverlappingRanges(mappings []idtools.IDMap) error { hostIntervals := intervalset.Empty() containerIntervals := intervalset.Empty() var conflicts []string for _, m := range mappings { c := interval{start: m.ContainerID, end: m.ContainerID + m.Size} h := interval{start: m.HostID, end: m.HostID + m.Size} added := false overlaps := false containerIntervals.IntervalsBetween(c, func(x intervalset.Interval) bool { overlaps = true return false }) if overlaps { conflicts = append(conflicts, fmt.Sprintf("%v:%v:%v", m.ContainerID, m.HostID, m.Size)) added = true } containerIntervals.Add(intervalset.NewSet([]intervalset.Interval{c})) hostIntervals.IntervalsBetween(h, func(x intervalset.Interval) bool { overlaps = true return false }) if overlaps && !added { conflicts = append(conflicts, fmt.Sprintf("%v:%v:%v", m.ContainerID, m.HostID, m.Size)) } hostIntervals.Add(intervalset.NewSet([]intervalset.Interval{h})) } if conflicts != nil { if len(conflicts) == 1 { return fmt.Errorf("the specified UID and/or GID mapping %s conflicts with other mappings: %w", conflicts[0], ErrInvalidMappings) } return fmt.Errorf("the specified UID and/or GID mappings %s conflict with other mappings: %w", strings.Join(conflicts, ", "), ErrInvalidMappings) } return nil } ================================================ FILE: vendor/go.podman.io/storage/images.go ================================================ package storage import ( "fmt" "os" "path/filepath" "slices" "strings" "sync" "time" digest "github.com/opencontainers/go-digest" "github.com/sirupsen/logrus" "go.podman.io/storage/pkg/ioutils" "go.podman.io/storage/pkg/lockfile" "go.podman.io/storage/pkg/stringid" "go.podman.io/storage/pkg/stringutils" "go.podman.io/storage/pkg/truncindex" ) const ( // ImageDigestManifestBigDataNamePrefix is a prefix of big data item // names which we consider to be manifests, used for computing a // "digest" value for the image as a whole, by which we can locate the // image later. ImageDigestManifestBigDataNamePrefix = "manifest" // ImageDigestBigDataKey is provided for compatibility with older // versions of the image library. It will be removed in the future. ImageDigestBigDataKey = "manifest" ) // An Image is a reference to a layer and an associated metadata string. type Image struct { // ID is either one which was specified at create-time, or a random // value which was generated by the library. ID string `json:"id"` // Digest is a digest value that we can use to locate the image, if one // was specified at creation-time. Digest digest.Digest `json:"digest,omitempty"` // Digests is a list of digest values of the image's manifests, and // possibly a manually-specified value, that we can use to locate the // image. If Digest is set, its value is also in this list. Digests []digest.Digest `json:"-"` // Names is an optional set of user-defined convenience values. The // image can be referred to by its ID or any of its names. Names are // unique among images, and are often the text representation of tagged // or canonical references. Names []string `json:"names,omitempty"` // NamesHistory is an optional set of Names the image had in the past. The // contained names are free from any duplicates, whereas the newest entry // is the first one. NamesHistory []string `json:"names-history,omitempty"` // TopLayer is the ID of the topmost layer of the image itself, if the // image contains one or more layers. Multiple images can refer to the // same top layer. TopLayer string `json:"layer,omitempty"` // MappedTopLayers are the IDs of alternate versions of the top layer // which have the same contents and parent, and which differ from // TopLayer only in which ID mappings they use. When the image is // to be removed, they should be removed before the TopLayer, as the // graph driver may depend on that. MappedTopLayers []string `json:"mapped-layers,omitempty"` // Metadata is data we keep for the convenience of the caller. It is not // expected to be large, since it is kept in memory. Metadata string `json:"metadata,omitempty"` // BigDataNames is a list of names of data items that we keep for the // convenience of the caller. They can be large, and are only in // memory when being read from or written to disk. BigDataNames []string `json:"big-data-names,omitempty"` // BigDataSizes maps the names in BigDataNames to the sizes of the data // that has been stored, if they're known. BigDataSizes map[string]int64 `json:"big-data-sizes,omitempty"` // BigDataDigests maps the names in BigDataNames to the digests of the // data that has been stored, if they're known. BigDataDigests map[string]digest.Digest `json:"big-data-digests,omitempty"` // Created is the datestamp for when this image was created. Older // versions of the library did not track this information, so callers // will likely want to use the IsZero() method to verify that a value // is set before using it. Created time.Time `json:"created"` // ReadOnly is true if this image resides in a read-only layer store. ReadOnly bool `json:"-"` Flags map[string]any `json:"flags,omitempty"` } // roImageStore provides bookkeeping for information about Images. type roImageStore interface { roMetadataStore roBigDataStore // startReading makes sure the store is fresh, and locks it for reading. // If this succeeds, the caller MUST call stopReading(). startReading() error // stopReading releases locks obtained by startReading. stopReading() // Exists checks if there is an image with the given ID or name. Exists(id string) bool // Get retrieves information about an image given an ID or name. Get(id string) (*Image, error) // Images returns a slice enumerating the known images. Images() ([]Image, error) // ByDigest returns a slice enumerating the images which have either an // explicitly-set digest, or a big data item with a name that starts // with ImageDigestManifestBigDataNamePrefix, which matches the // specified digest. ByDigest(d digest.Digest) ([]*Image, error) } // rwImageStore provides bookkeeping for information about Images. type rwImageStore interface { roImageStore rwMetadataStore rwImageBigDataStore flaggableStore // startWriting makes sure the store is fresh, and locks it for writing. // If this succeeds, the caller MUST call stopWriting(). startWriting() error // stopWriting releases locks obtained by startWriting. stopWriting() // create creates an image that has a specified ID (or a random one) and // optional names, using the specified layer as its topmost (hopefully // read-only) layer. That layer can be referenced by multiple images. create(id string, names []string, layer string, options ImageOptions) (*Image, error) // updateNames modifies names associated with an image based on (op, names). // The values are expected to be valid normalized // named image references. updateNames(id string, names []string, op updateNameOperation) error // Delete removes the record of the image. Delete(id string) error addMappedTopLayer(id, layer string) error removeMappedTopLayer(id, layer string) error // Clean up unreferenced per-image data. GarbageCollect() error // Wipe removes records of all images. Wipe() error } type imageStore struct { // The following fields are only set when constructing imageStore, and must never be modified afterwards. // They are safe to access without any other locking. lockfile *lockfile.LockFile // lockfile.IsReadWrite can be used to distinguish between read-write and read-only image stores. dir string inProcessLock sync.RWMutex // Can _only_ be obtained with lockfile held. // The following fields can only be read/written with read/write ownership of inProcessLock, respectively. // Almost all users should use startReading() or startWriting(). lastWrite lockfile.LastWrite images []*Image idindex *truncindex.TruncIndex byid map[string]*Image byname map[string]*Image bydigest map[digest.Digest][]*Image } func copyImage(i *Image) *Image { return &Image{ ID: i.ID, Digest: i.Digest, Digests: copySlicePreferringNil(i.Digests), Names: copySlicePreferringNil(i.Names), NamesHistory: copySlicePreferringNil(i.NamesHistory), TopLayer: i.TopLayer, MappedTopLayers: copySlicePreferringNil(i.MappedTopLayers), Metadata: i.Metadata, BigDataNames: copySlicePreferringNil(i.BigDataNames), BigDataSizes: copyMapPreferringNil(i.BigDataSizes), BigDataDigests: copyMapPreferringNil(i.BigDataDigests), Created: i.Created, ReadOnly: i.ReadOnly, Flags: copyMapPreferringNil(i.Flags), } } func copyImageSlice(slice []*Image) []*Image { if len(slice) > 0 { cp := make([]*Image, len(slice)) for i := range slice { cp[i] = copyImage(slice[i]) } return cp } return nil } // startWritingWithReload makes sure the store is fresh if canReload, and locks it for writing. // If this succeeds, the caller MUST call stopWriting(). // // This is an internal implementation detail of imageStore construction, every other caller // should use startReading() instead. func (r *imageStore) startWritingWithReload(canReload bool) error { r.lockfile.Lock() r.inProcessLock.Lock() succeeded := false defer func() { if !succeeded { r.inProcessLock.Unlock() r.lockfile.Unlock() } }() if canReload { if _, err := r.reloadIfChanged(true); err != nil { return err } } succeeded = true return nil } // startWriting makes sure the store is fresh, and locks it for writing. // If this succeeds, the caller MUST call stopWriting(). func (r *imageStore) startWriting() error { return r.startWritingWithReload(true) } // stopWriting releases locks obtained by startWriting. func (r *imageStore) stopWriting() { r.inProcessLock.Unlock() r.lockfile.Unlock() } // startReadingWithReload makes sure the store is fresh if canReload, and locks it for reading. // If this succeeds, the caller MUST call stopReading(). // // This is an internal implementation detail of imageStore construction, every other caller // should use startReading() instead. func (r *imageStore) startReadingWithReload(canReload bool) error { // inProcessLocked calls the nested function with r.inProcessLock held for writing. inProcessLocked := func(fn func() error) error { r.inProcessLock.Lock() defer r.inProcessLock.Unlock() return fn() } r.lockfile.RLock() unlockFn := r.lockfile.Unlock // A function to call to clean up, or nil defer func() { if unlockFn != nil { unlockFn() } }() r.inProcessLock.RLock() unlockFn = r.stopReading if canReload { // If we are lucky, we can just hold the read locks, check that we are fresh, and continue. _, modified, err := r.modified() if err != nil { return err } if modified { // We are unlucky, and need to reload. // NOTE: Multiple goroutines can get to this place approximately simultaneously. r.inProcessLock.RUnlock() unlockFn = r.lockfile.Unlock // r.lastWrite can change at this point if another goroutine reloads the store before us. That’s why we don’t unconditionally // trigger a load below; we (lock and) reloadIfChanged() again. // First try reloading with r.lockfile held for reading. // r.inProcessLock will serialize all goroutines that got here; // each will re-check on-disk state vs. r.lastWrite, and the first one will actually reload the data. var tryLockedForWriting bool if err := inProcessLocked(func() error { // We could optimize this further: The r.lockfile.GetLastWrite() value shouldn’t change as long as we hold r.lockfile, // so if r.lastWrite was already updated, we don’t need to actually read the on-filesystem lock. var err error tryLockedForWriting, err = r.reloadIfChanged(false) return err }); err != nil { if !tryLockedForWriting { return err } // Not good enough, we need r.lockfile held for writing. So, let’s do that. unlockFn() unlockFn = nil r.lockfile.Lock() unlockFn = r.lockfile.Unlock if err := inProcessLocked(func() error { _, err := r.reloadIfChanged(true) return err }); err != nil { return err } unlockFn() unlockFn = nil r.lockfile.RLock() unlockFn = r.lockfile.Unlock // We need to check for a reload once more because the on-disk state could have been modified // after we released the lock. // If that, _again_, finds inconsistent state, just give up. // We could, plausibly, retry a few times, but that inconsistent state (duplicate image names) // shouldn’t be saved (by correct implementations) in the first place. if err := inProcessLocked(func() error { _, err := r.reloadIfChanged(false) return err }); err != nil { return fmt.Errorf("(even after successfully cleaning up once:) %w", err) } } // NOTE that we hold neither a read nor write inProcessLock at this point. That’s fine in ordinary operation, because // the on-filesystem r.lockfile should protect us against (cooperating) writers, and any use of r.inProcessLock // protects us against in-process writers modifying data. // In presence of non-cooperating writers, we just ensure that 1) the in-memory data is not clearly out-of-date // and 2) access to the in-memory data is not racy; // but we can’t protect against those out-of-process writers modifying _files_ while we are assuming they are in a consistent state. r.inProcessLock.RLock() } } unlockFn = nil return nil } // startReading makes sure the store is fresh, and locks it for reading. // If this succeeds, the caller MUST call stopReading(). func (r *imageStore) startReading() error { return r.startReadingWithReload(true) } // stopReading releases locks obtained by startReading. func (r *imageStore) stopReading() { r.inProcessLock.RUnlock() r.lockfile.Unlock() } // modified returns true if the on-disk state has changed (i.e. if reloadIfChanged may need to modify the store), // and a lockfile.LastWrite value for that update. // // The caller must hold r.lockfile for reading _or_ writing. // The caller must hold r.inProcessLock for reading or writing. func (r *imageStore) modified() (lockfile.LastWrite, bool, error) { return r.lockfile.ModifiedSince(r.lastWrite) } // reloadIfChanged reloads the contents of the store from disk if it is changed. // // The caller must hold r.lockfile for reading _or_ writing; lockedForWriting is true // if it is held for writing. // // The caller must hold r.inProcessLock for WRITING. // // If !lockedForWriting and this function fails, the return value indicates whether // reloadIfChanged() with lockedForWriting could succeed. func (r *imageStore) reloadIfChanged(lockedForWriting bool) (bool, error) { lastWrite, modified, err := r.modified() if err != nil { return false, err } // We require callers to always hold r.inProcessLock for WRITING, even if they might not end up calling r.load() // and modify no fields, to ensure they see fresh data: // r.lockfile.Modified() only returns true once per change. Without an exclusive lock, // one goroutine might see r.lockfile.Modified() == true and decide to load, and in the meanwhile another one could // see r.lockfile.Modified() == false and proceed to use in-memory data without noticing it is stale. if modified { if tryLockedForWriting, err := r.load(lockedForWriting); err != nil { return tryLockedForWriting, err // r.lastWrite is unchanged, so we will load the next time again. } r.lastWrite = lastWrite } return false, nil } // Requires startReading or startWriting. func (r *imageStore) Images() ([]Image, error) { images := make([]Image, len(r.images)) for i := range r.images { images[i] = *copyImage(r.images[i]) } return images, nil } // This looks for datadirs in the store directory that are not referenced // by the json file and removes it. These can happen in the case of unclean // shutdowns. // Requires startReading or startWriting. func (r *imageStore) GarbageCollect() error { entries, err := os.ReadDir(r.dir) if err != nil { // Unexpected, don't try any GC return err } for _, entry := range entries { id := entry.Name() // Does it look like a datadir directory? if !entry.IsDir() || stringid.ValidateID(id) != nil { continue } // Should the id be there? if r.byid[id] != nil { continue } // Otherwise remove datadir logrus.Debugf("removing %q", filepath.Join(r.dir, id)) moreErr := os.RemoveAll(filepath.Join(r.dir, id)) // Propagate first error if moreErr != nil && err == nil { err = moreErr } } return err } func (r *imageStore) imagespath() string { return filepath.Join(r.dir, "images.json") } func (r *imageStore) datadir(id string) string { return filepath.Join(r.dir, id) } func (r *imageStore) datapath(id, key string) string { return filepath.Join(r.datadir(id), makeBigDataBaseName(key)) } // bigDataNameIsManifest determines if a big data item with the specified name // is considered to be representative of the image, in that its digest can be // said to also be the image's digest. Currently, if its name is, or begins // with, "manifest", we say that it is. func bigDataNameIsManifest(name string) bool { return strings.HasPrefix(name, ImageDigestManifestBigDataNamePrefix) } // recomputeDigests takes a fixed digest and a name-to-digest map and builds a // list of the unique values that would identify the image. // The caller must hold r.inProcessLock for writing. func (i *Image) recomputeDigests() error { validDigests := make([]digest.Digest, 0, len(i.BigDataDigests)+1) digests := make(map[digest.Digest]struct{}) if i.Digest != "" { if err := i.Digest.Validate(); err != nil { return fmt.Errorf("validating image digest %q: %w", string(i.Digest), err) } digests[i.Digest] = struct{}{} validDigests = append(validDigests, i.Digest) } for name, digest := range i.BigDataDigests { if !bigDataNameIsManifest(name) { continue } if err := digest.Validate(); err != nil { return fmt.Errorf("validating digest %q for big data item %q: %w", string(digest), name, err) } // Deduplicate the digest values. if _, known := digests[digest]; !known { digests[digest] = struct{}{} validDigests = append(validDigests, digest) } } if i.Digest == "" && len(validDigests) > 0 { i.Digest = validDigests[0] } i.Digests = validDigests return nil } // load reloads the contents of the store from disk. // // Most callers should call reloadIfChanged() instead, to avoid overhead and to correctly // manage r.lastWrite. // // The caller must hold r.lockfile for reading _or_ writing; lockedForWriting is true // if it is held for writing. // The caller must hold r.inProcessLock for WRITING. // // If !lockedForWriting and this function fails, the return value indicates whether // retrying with lockedForWriting could succeed. func (r *imageStore) load(lockedForWriting bool) (bool, error) { rpath := r.imagespath() data, err := os.ReadFile(rpath) if err != nil && !os.IsNotExist(err) { return false, err } images := []*Image{} if len(data) != 0 { if err := json.Unmarshal(data, &images); err != nil { return false, fmt.Errorf("loading %q: %w", rpath, err) } } idlist := make([]string, 0, len(images)) ids := make(map[string]*Image) names := make(map[string]*Image) digests := make(map[digest.Digest][]*Image) var errorToResolveBySaving error // == nil for n, image := range images { ids[image.ID] = images[n] idlist = append(idlist, image.ID) for _, name := range image.Names { if conflict, ok := names[name]; ok { r.removeName(conflict, name) errorToResolveBySaving = ErrDuplicateImageNames } } // Compute the digest list. if err := image.recomputeDigests(); err != nil { return false, fmt.Errorf("computing digests for image with ID %q (%v): %w", image.ID, image.Names, err) } for _, name := range image.Names { names[name] = image } for _, digest := range image.Digests { list := digests[digest] digests[digest] = append(list, image) } image.ReadOnly = !r.lockfile.IsReadWrite() } if errorToResolveBySaving != nil { if !r.lockfile.IsReadWrite() { return false, errorToResolveBySaving } if !lockedForWriting { return true, errorToResolveBySaving } } r.images = images r.idindex = truncindex.NewTruncIndex(idlist) // Invalid values in idlist are ignored: they are not a reason to refuse processing the whole store. r.byid = ids r.byname = names r.bydigest = digests if errorToResolveBySaving != nil { return false, r.Save() } return false, nil } // Save saves the contents of the store to disk. // The caller must hold r.lockfile locked for writing. // The caller must hold r.inProcessLock for reading (but usually holds it for writing in order to make the desired changes). func (r *imageStore) Save() error { if !r.lockfile.IsReadWrite() { return fmt.Errorf("not allowed to modify the image store at %q: %w", r.imagespath(), ErrStoreIsReadOnly) } r.lockfile.AssertLockedForWriting() rpath := r.imagespath() if err := os.MkdirAll(filepath.Dir(rpath), 0o700); err != nil { return err } jdata, err := json.Marshal(&r.images) if err != nil { return err } // This must be done before we write the file, because the process could be terminated // after the file is written but before the lock file is updated. lw, err := r.lockfile.RecordWrite() if err != nil { return err } r.lastWrite = lw if err := ioutils.AtomicWriteFile(rpath, jdata, 0o600); err != nil { return err } return nil } func newImageStore(dir string) (rwImageStore, error) { if err := os.MkdirAll(dir, 0o700); err != nil { return nil, err } lockfile, err := lockfile.GetLockFile(filepath.Join(dir, "images.lock")) if err != nil { return nil, err } istore := imageStore{ lockfile: lockfile, dir: dir, images: []*Image{}, byid: make(map[string]*Image), byname: make(map[string]*Image), bydigest: make(map[digest.Digest][]*Image), } if err := istore.startWritingWithReload(false); err != nil { return nil, err } defer istore.stopWriting() istore.lastWrite, err = istore.lockfile.GetLastWrite() if err != nil { return nil, err } if _, err := istore.load(true); err != nil { return nil, err } return &istore, nil } func newROImageStore(dir string) (roImageStore, error) { lockfile, err := lockfile.GetROLockFile(filepath.Join(dir, "images.lock")) if err != nil { return nil, err } istore := imageStore{ lockfile: lockfile, dir: dir, images: []*Image{}, byid: make(map[string]*Image), byname: make(map[string]*Image), bydigest: make(map[digest.Digest][]*Image), } if err := istore.startReadingWithReload(false); err != nil { return nil, err } defer istore.stopReading() istore.lastWrite, err = istore.lockfile.GetLastWrite() if err != nil { return nil, err } if _, err := istore.load(false); err != nil { return nil, err } return &istore, nil } // Requires startReading or startWriting. func (r *imageStore) lookup(id string) (*Image, bool) { if image, ok := r.byid[id]; ok { return image, ok } else if image, ok := r.byname[id]; ok { return image, ok } else if longid, err := r.idindex.Get(id); err == nil { image, ok := r.byid[longid] return image, ok } return nil, false } // Requires startWriting. func (r *imageStore) ClearFlag(id string, flag string) error { if !r.lockfile.IsReadWrite() { return fmt.Errorf("not allowed to clear flags on images at %q: %w", r.imagespath(), ErrStoreIsReadOnly) } image, ok := r.lookup(id) if !ok { return fmt.Errorf("locating image with ID %q: %w", id, ErrImageUnknown) } delete(image.Flags, flag) return r.Save() } // Requires startWriting. func (r *imageStore) SetFlag(id string, flag string, value any) error { if !r.lockfile.IsReadWrite() { return fmt.Errorf("not allowed to set flags on images at %q: %w", r.imagespath(), ErrStoreIsReadOnly) } image, ok := r.lookup(id) if !ok { return fmt.Errorf("locating image with ID %q: %w", id, ErrImageUnknown) } if image.Flags == nil { image.Flags = make(map[string]any) } image.Flags[flag] = value return r.Save() } // Requires startWriting. func (r *imageStore) create(id string, names []string, layer string, options ImageOptions) (image *Image, err error) { if !r.lockfile.IsReadWrite() { return nil, fmt.Errorf("not allowed to create new images at %q: %w", r.imagespath(), ErrStoreIsReadOnly) } if id == "" { id = stringid.GenerateRandomID() _, idInUse := r.byid[id] for idInUse { id = stringid.GenerateRandomID() _, idInUse = r.byid[id] } } if _, idInUse := r.byid[id]; idInUse { return nil, fmt.Errorf("an image with ID %q already exists: %w", id, ErrDuplicateID) } names = dedupeStrings(names) for _, name := range names { if image, nameInUse := r.byname[name]; nameInUse { return nil, fmt.Errorf("image name %q is already associated with image %q: %w", name, image.ID, ErrDuplicateName) } } image = &Image{ ID: id, Digest: options.Digest, Digests: dedupeDigests(options.Digests), Names: names, NamesHistory: copySlicePreferringNil(options.NamesHistory), TopLayer: layer, Metadata: options.Metadata, BigDataNames: []string{}, BigDataSizes: make(map[string]int64), BigDataDigests: make(map[string]digest.Digest), Created: options.CreationDate, Flags: newMapFrom(options.Flags), } if image.Created.IsZero() { image.Created = time.Now().UTC() } err = image.recomputeDigests() if err != nil { return nil, fmt.Errorf("validating digests for new image: %w", err) } r.images = append(r.images, image) // This can only fail on duplicate IDs, which shouldn’t happen — and in // that case the index is already in the desired state anyway. // Implementing recovery from an unlikely and unimportant failure here // would be too risky. _ = r.idindex.Add(id) r.byid[id] = image for _, name := range names { r.byname[name] = image } for _, digest := range image.Digests { list := r.bydigest[digest] r.bydigest[digest] = append(list, image) } defer func() { if err != nil { // now that the in-memory structures know about the new // record, we can use regular Delete() to clean up if // anything breaks from here on out if e := r.Delete(id); e != nil { logrus.Debugf("while cleaning up partially-created image %q we failed to create: %v", id, e) } } }() err = r.Save() if err != nil { return nil, err } for _, item := range options.BigData { if item.Digest == "" { item.Digest = digest.Canonical.FromBytes(item.Data) } if err = r.setBigData(image, item.Key, item.Data, item.Digest); err != nil { return nil, err } } image = copyImage(image) return image, err } // Requires startWriting. func (r *imageStore) addMappedTopLayer(id, layer string) error { if image, ok := r.lookup(id); ok { image.MappedTopLayers = append(image.MappedTopLayers, layer) return r.Save() } return fmt.Errorf("locating image with ID %q: %w", id, ErrImageUnknown) } // Requires startWriting. func (r *imageStore) removeMappedTopLayer(id, layer string) error { if image, ok := r.lookup(id); ok { initialLen := len(image.MappedTopLayers) image.MappedTopLayers = stringutils.RemoveFromSlice(image.MappedTopLayers, layer) // No layer was removed. No need to save. if initialLen == len(image.MappedTopLayers) { return nil } return r.Save() } return fmt.Errorf("locating image with ID %q: %w", id, ErrImageUnknown) } // Requires startReading or startWriting. func (r *imageStore) Metadata(id string) (string, error) { if image, ok := r.lookup(id); ok { return image.Metadata, nil } return "", fmt.Errorf("locating image with ID %q: %w", id, ErrImageUnknown) } // Requires startWriting. func (r *imageStore) SetMetadata(id, metadata string) error { if !r.lockfile.IsReadWrite() { return fmt.Errorf("not allowed to modify image metadata at %q: %w", r.imagespath(), ErrStoreIsReadOnly) } if image, ok := r.lookup(id); ok { image.Metadata = metadata return r.Save() } return fmt.Errorf("locating image with ID %q: %w", id, ErrImageUnknown) } // The caller must hold r.inProcessLock for writing. func (r *imageStore) removeName(image *Image, name string) { image.Names = stringSliceWithoutValue(image.Names, name) } // The caller must hold r.inProcessLock for writing. func (i *Image) addNameToHistory(name string) { i.NamesHistory = dedupeStrings(append([]string{name}, i.NamesHistory...)) } // Requires startWriting. func (r *imageStore) updateNames(id string, names []string, op updateNameOperation) error { if !r.lockfile.IsReadWrite() { return fmt.Errorf("not allowed to change image name assignments at %q: %w", r.imagespath(), ErrStoreIsReadOnly) } image, ok := r.lookup(id) if !ok { return fmt.Errorf("locating image with ID %q: %w", id, ErrImageUnknown) } oldNames := image.Names names, err := applyNameOperation(oldNames, names, op) if err != nil { return err } for _, name := range oldNames { delete(r.byname, name) } for _, name := range names { if otherImage, ok := r.byname[name]; ok { r.removeName(otherImage, name) } r.byname[name] = image image.addNameToHistory(name) } image.Names = names return r.Save() } // Requires startWriting. func (r *imageStore) Delete(id string) error { if !r.lockfile.IsReadWrite() { return fmt.Errorf("not allowed to delete images at %q: %w", r.imagespath(), ErrStoreIsReadOnly) } image, ok := r.lookup(id) if !ok { return fmt.Errorf("locating image with ID %q: %w", id, ErrImageUnknown) } id = image.ID delete(r.byid, id) // This can only fail if the ID is already missing, which shouldn’t happen — and in that case the index is already in the desired state anyway. // The store’s Delete method is used on various paths to recover from failures, so this should be robust against partially missing data. _ = r.idindex.Delete(id) for _, name := range image.Names { delete(r.byname, name) } for _, digest := range image.Digests { prunedList := slices.DeleteFunc(r.bydigest[digest], func(i *Image) bool { return i == image }) if len(prunedList) == 0 { delete(r.bydigest, digest) } else { r.bydigest[digest] = prunedList } } r.images = slices.DeleteFunc(r.images, func(candidate *Image) bool { return candidate.ID == id }) if err := r.Save(); err != nil { return err } if err := os.RemoveAll(r.datadir(id)); err != nil { return err } return nil } // Requires startReading or startWriting. func (r *imageStore) Get(id string) (*Image, error) { if image, ok := r.lookup(id); ok { return copyImage(image), nil } return nil, fmt.Errorf("locating image with ID %q: %w", id, ErrImageUnknown) } // Requires startReading or startWriting. func (r *imageStore) Exists(id string) bool { _, ok := r.lookup(id) return ok } // Requires startReading or startWriting. func (r *imageStore) ByDigest(d digest.Digest) ([]*Image, error) { if images, ok := r.bydigest[d]; ok { return copyImageSlice(images), nil } return nil, fmt.Errorf("locating image with digest %q: %w", d, ErrImageUnknown) } // Requires startReading or startWriting. func (r *imageStore) BigData(id, key string) ([]byte, error) { if key == "" { return nil, fmt.Errorf("can't retrieve image big data value for empty name: %w", ErrInvalidBigDataName) } image, ok := r.lookup(id) if !ok { return nil, fmt.Errorf("locating image with ID %q: %w", id, ErrImageUnknown) } return os.ReadFile(r.datapath(image.ID, key)) } // Requires startReading or startWriting. func (r *imageStore) BigDataSize(id, key string) (int64, error) { if key == "" { return -1, fmt.Errorf("can't retrieve size of image big data with empty name: %w", ErrInvalidBigDataName) } image, ok := r.lookup(id) if !ok { return -1, fmt.Errorf("locating image with ID %q: %w", id, ErrImageUnknown) } if size, ok := image.BigDataSizes[key]; ok { // This is valid, and returns ok == false, for BigDataSizes == nil. return size, nil } if data, err := r.BigData(id, key); err == nil && data != nil { return int64(len(data)), nil } return -1, ErrSizeUnknown } // Requires startReading or startWriting. func (r *imageStore) BigDataDigest(id, key string) (digest.Digest, error) { if key == "" { return "", fmt.Errorf("can't retrieve digest of image big data value with empty name: %w", ErrInvalidBigDataName) } image, ok := r.lookup(id) if !ok { return "", fmt.Errorf("locating image with ID %q: %w", id, ErrImageUnknown) } if d, ok := image.BigDataDigests[key]; ok { // This is valid, and returns ok == false, for BigDataDigests == nil. return d, nil } return "", ErrDigestUnknown } // Requires startReading or startWriting. func (r *imageStore) BigDataNames(id string) ([]string, error) { image, ok := r.lookup(id) if !ok { return nil, fmt.Errorf("locating image with ID %q: %w", id, ErrImageUnknown) } return copySlicePreferringNil(image.BigDataNames), nil } // Requires startWriting. func (r *imageStore) SetBigData(id, key string, data []byte, digestManifest func([]byte) (digest.Digest, error)) error { if !r.lockfile.IsReadWrite() { return fmt.Errorf("not allowed to save data items associated with images at %q: %w", r.imagespath(), ErrStoreIsReadOnly) } image, ok := r.lookup(id) if !ok { return fmt.Errorf("locating image with ID %q: %w", id, ErrImageUnknown) } var err error var newDigest digest.Digest if bigDataNameIsManifest(key) { if digestManifest == nil { return fmt.Errorf("digesting manifest: no manifest digest callback provided: %w", ErrDigestUnknown) } if newDigest, err = digestManifest(data); err != nil { return fmt.Errorf("digesting manifest: %w", err) } } else { newDigest = digest.Canonical.FromBytes(data) } return r.setBigData(image, key, data, newDigest) } // Requires startWriting. func (r *imageStore) setBigData(image *Image, key string, data []byte, newDigest digest.Digest) error { if key == "" { return fmt.Errorf("can't set empty name for image big data item: %w", ErrInvalidBigDataName) } err := os.MkdirAll(r.datadir(image.ID), 0o700) if err != nil { return err } err = ioutils.AtomicWriteFile(r.datapath(image.ID, key), data, 0o600) if err == nil { save := false if image.BigDataSizes == nil { image.BigDataSizes = make(map[string]int64) } oldSize, sizeOk := image.BigDataSizes[key] image.BigDataSizes[key] = int64(len(data)) if image.BigDataDigests == nil { image.BigDataDigests = make(map[string]digest.Digest) } oldDigest, digestOk := image.BigDataDigests[key] image.BigDataDigests[key] = newDigest if !sizeOk || oldSize != image.BigDataSizes[key] || !digestOk || oldDigest != newDigest { save = true } if !slices.Contains(image.BigDataNames, key) { image.BigDataNames = append(image.BigDataNames, key) save = true } for _, oldDigest := range image.Digests { // remove the image from the list of images in the digest-based index if list, ok := r.bydigest[oldDigest]; ok { prunedList := slices.DeleteFunc(list, func(i *Image) bool { return i == image }) if len(prunedList) == 0 { delete(r.bydigest, oldDigest) } else { r.bydigest[oldDigest] = prunedList } } } if err = image.recomputeDigests(); err != nil { return fmt.Errorf("loading recomputing image digest information for %s: %w", image.ID, err) } for _, newDigest := range image.Digests { // add the image to the list of images in the digest-based index which // corresponds to the new digest for this item, unless it's already there list := r.bydigest[newDigest] if !slices.Contains(list, image) { r.bydigest[newDigest] = append(list, image) } } if save { err = r.Save() } } return err } // Requires startWriting. func (r *imageStore) Wipe() error { if !r.lockfile.IsReadWrite() { return fmt.Errorf("not allowed to delete images at %q: %w", r.imagespath(), ErrStoreIsReadOnly) } ids := make([]string, 0, len(r.byid)) for id := range r.byid { ids = append(ids, id) } for _, id := range ids { if err := r.Delete(id); err != nil { return err } } return nil } ================================================ FILE: vendor/go.podman.io/storage/internal/dedup/dedup.go ================================================ package dedup import ( "crypto/sha256" "encoding/binary" "errors" "fmt" "hash/crc64" "io/fs" "sync" "github.com/opencontainers/selinux/pkg/pwalkdir" "github.com/sirupsen/logrus" ) var errNotSupported = errors.New("reflinks are not supported on this platform") const ( DedupHashInvalid DedupHashMethod = iota DedupHashCRC DedupHashFileSize DedupHashSHA256 ) type DedupHashMethod int type DedupOptions struct { // HashMethod is the hash function to use to find identical files HashMethod DedupHashMethod } type DedupResult struct { // Deduped represents the total number of bytes saved by deduplication. // This value accounts also for all previously deduplicated data, not only the savings // from the last run. Deduped uint64 } func getFileChecksum(hashMethod DedupHashMethod, path string, info fs.FileInfo) (string, error) { switch hashMethod { case DedupHashInvalid: return "", fmt.Errorf("invalid hash method: %v", hashMethod) case DedupHashFileSize: return fmt.Sprintf("%v", info.Size()), nil case DedupHashSHA256: return readAllFile(path, info, func(buf []byte) (string, error) { h := sha256.New() if _, err := h.Write(buf); err != nil { return "", err } return string(h.Sum(nil)), nil }) case DedupHashCRC: return readAllFile(path, info, func(buf []byte) (string, error) { c := crc64.New(crc64.MakeTable(crc64.ECMA)) if _, err := c.Write(buf); err != nil { return "", err } bufRet := make([]byte, 8) binary.BigEndian.PutUint64(bufRet, c.Sum64()) return string(bufRet), nil }) default: return "", fmt.Errorf("unknown hash method: %v", hashMethod) } } type pathsLocked struct { paths []string lock sync.Mutex } func DedupDirs(dirs []string, options DedupOptions) (DedupResult, error) { res := DedupResult{} hashToPaths := make(map[string]*pathsLocked) lock := sync.Mutex{} // protects `hashToPaths` and `res` dedup, err := newDedupFiles() if err != nil { return res, err } for _, dir := range dirs { logrus.Debugf("Deduping directory %s", dir) if err := pwalkdir.Walk(dir, func(path string, d fs.DirEntry, err error) error { if err != nil { return err } if !d.Type().IsRegular() { return nil } info, err := d.Info() if err != nil { return err } size := uint64(info.Size()) if size == 0 { // do not bother with empty files return nil } // the file was already deduplicated if visited, err := dedup.isFirstVisitOf(info); err != nil { return err } else if visited { return nil } h, err := getFileChecksum(options.HashMethod, path, info) if err != nil { return err } lock.Lock() item, foundItem := hashToPaths[h] if !foundItem { item = &pathsLocked{paths: []string{path}} hashToPaths[h] = item lock.Unlock() return nil } item.lock.Lock() lock.Unlock() dedupBytes, err := func() (uint64, error) { // function to have a scope for the defer statement defer item.lock.Unlock() var dedupBytes uint64 for _, src := range item.paths { deduped, err := dedup.dedup(src, path, info) if err == nil && deduped > 0 { logrus.Debugf("Deduped %q -> %q (%d bytes)", src, path, deduped) dedupBytes += deduped break } logrus.Debugf("Failed to deduplicate: %v", err) if errors.Is(err, errNotSupported) { return dedupBytes, err } } if dedupBytes == 0 { item.paths = append(item.paths, path) } return dedupBytes, nil }() if err != nil { return err } lock.Lock() res.Deduped += dedupBytes lock.Unlock() return nil }); err != nil { // if reflinks are not supported, return immediately without errors if errors.Is(err, errNotSupported) { return res, nil } return res, err } } return res, nil } ================================================ FILE: vendor/go.podman.io/storage/internal/dedup/dedup_linux.go ================================================ package dedup import ( "errors" "fmt" "io" "io/fs" "os" "sync" "syscall" "golang.org/x/sys/unix" ) type deviceInodePair struct { dev uint64 ino uint64 } type dedupFiles struct { lock sync.Mutex visitedInodes map[deviceInodePair]struct{} } func newDedupFiles() (*dedupFiles, error) { return &dedupFiles{ visitedInodes: make(map[deviceInodePair]struct{}), }, nil } func (d *dedupFiles) recordInode(dev, ino uint64) (bool, error) { d.lock.Lock() defer d.lock.Unlock() di := deviceInodePair{ dev: dev, ino: ino, } _, visited := d.visitedInodes[di] d.visitedInodes[di] = struct{}{} return visited, nil } // isFirstVisitOf records that the file is being processed. Returns true if the file was already visited. func (d *dedupFiles) isFirstVisitOf(fi fs.FileInfo) (bool, error) { st, ok := fi.Sys().(*syscall.Stat_t) if !ok { return false, fmt.Errorf("unable to get raw syscall.Stat_t data") } return d.recordInode(uint64(st.Dev), st.Ino) //nolint:unconvert } // dedup deduplicates the file at src path to dst path func (d *dedupFiles) dedup(src, dst string, fiDst fs.FileInfo) (uint64, error) { srcFile, err := os.OpenFile(src, os.O_RDONLY, 0) if err != nil { return 0, fmt.Errorf("failed to open source file: %w", err) } defer srcFile.Close() dstFile, err := os.OpenFile(dst, os.O_WRONLY, 0) if err != nil { return 0, fmt.Errorf("failed to open destination file: %w", err) } defer dstFile.Close() stSrc, err := srcFile.Stat() if err != nil { return 0, fmt.Errorf("failed to stat source file: %w", err) } sSrc, ok := stSrc.Sys().(*syscall.Stat_t) if !ok { return 0, fmt.Errorf("unable to get raw syscall.Stat_t data") } sDest, ok := fiDst.Sys().(*syscall.Stat_t) if !ok { return 0, fmt.Errorf("unable to get raw syscall.Stat_t data") } if sSrc.Dev == sDest.Dev && sSrc.Ino == sDest.Ino { // same inode, we are dealing with a hard link, no need to deduplicate return 0, nil } value := unix.FileDedupeRange{ Src_offset: 0, Src_length: uint64(stSrc.Size()), Info: []unix.FileDedupeRangeInfo{ { Dest_fd: int64(dstFile.Fd()), Dest_offset: 0, }, }, } err = unix.IoctlFileDedupeRange(int(srcFile.Fd()), &value) if err == nil { return value.Info[0].Bytes_deduped, nil } if errors.Is(err, unix.ENOTSUP) { return 0, errNotSupported } return 0, fmt.Errorf("failed to clone file %q: %w", src, err) } func readAllFile(path string, info fs.FileInfo, fn func([]byte) (string, error)) (string, error) { size := info.Size() if size == 0 { return fn(nil) } file, err := os.Open(path) if err != nil { return "", err } defer file.Close() if size < 4096 { // small file, read it all data := make([]byte, size) _, err = io.ReadFull(file, data) if err != nil { return "", err } return fn(data) } mmap, err := unix.Mmap(int(file.Fd()), 0, int(size), unix.PROT_READ, unix.MAP_PRIVATE) if err != nil { return "", fmt.Errorf("failed to mmap file: %w", err) } defer func() { _ = unix.Munmap(mmap) }() _ = unix.Madvise(mmap, unix.MADV_SEQUENTIAL) return fn(mmap) } ================================================ FILE: vendor/go.podman.io/storage/internal/dedup/dedup_unsupported.go ================================================ //go:build !linux package dedup import ( "io/fs" ) type dedupFiles struct{} func newDedupFiles() (*dedupFiles, error) { return nil, errNotSupported } // isFirstVisitOf records that the file is being processed. Returns true if the file was already visited. func (d *dedupFiles) isFirstVisitOf(fi fs.FileInfo) (bool, error) { return false, errNotSupported } // dedup deduplicates the file at src path to dst path func (d *dedupFiles) dedup(src, dst string, fiDst fs.FileInfo) (uint64, error) { return 0, errNotSupported } func readAllFile(path string, info fs.FileInfo, fn func([]byte) (string, error)) (string, error) { return "", errNotSupported } ================================================ FILE: vendor/go.podman.io/storage/internal/rawfilelock/rawfilelock.go ================================================ package rawfilelock import ( "os" ) type LockType byte const ( ReadLock LockType = iota WriteLock ) type FileHandle = fileHandle // OpenLock opens a file for locking // WARNING: This is the underlying file locking primitive of the OS; // because closing FileHandle releases the lock, it is not suitable for use // if there is any chance of two concurrent goroutines attempting to use the same lock. // Most users should use the higher-level operations from internal/staging_lockfile or pkg/lockfile. func OpenLock(path string, readOnly bool) (FileHandle, error) { flags := os.O_CREATE if readOnly { flags |= os.O_RDONLY } else { flags |= os.O_RDWR } fd, err := openHandle(path, flags) if err == nil { return fd, nil } return fd, &os.PathError{Op: "open", Path: path, Err: err} } // TryLockFile attempts to lock a file handle func TryLockFile(fd FileHandle, lockType LockType) error { return lockHandle(fd, lockType, true) } // LockFile locks a file handle func LockFile(fd FileHandle, lockType LockType) error { return lockHandle(fd, lockType, false) } // UnlockAndClose unlocks and closes a file handle func UnlockAndCloseHandle(fd FileHandle) { unlockAndCloseHandle(fd) } // CloseHandle closes a file handle without unlocking // // WARNING: This is a last-resort function for error handling only! // On Unix systems, closing a file descriptor automatically releases any locks, // so "closing without unlocking" is impossible. This function will release // the lock as a side effect of closing the file. // // This function should only be used in error paths where the lock state // is already corrupted or when giving up on lock management entirely. // Normal code should use UnlockAndCloseHandle instead. func CloseHandle(fd FileHandle) { closeHandle(fd) } ================================================ FILE: vendor/go.podman.io/storage/internal/rawfilelock/rawfilelock_unix.go ================================================ //go:build !windows package rawfilelock import ( "time" "golang.org/x/sys/unix" ) type fileHandle uintptr func openHandle(path string, mode int) (fileHandle, error) { mode |= unix.O_CLOEXEC fd, err := unix.Open(path, mode, 0o644) return fileHandle(fd), err } func lockHandle(fd fileHandle, lType LockType, nonblocking bool) error { fType := unix.F_RDLCK if lType != ReadLock { fType = unix.F_WRLCK } lk := unix.Flock_t{ Type: int16(fType), Whence: int16(unix.SEEK_SET), Start: 0, Len: 0, } cmd := unix.F_SETLKW if nonblocking { cmd = unix.F_SETLK } for { err := unix.FcntlFlock(uintptr(fd), cmd, &lk) if err == nil || nonblocking { return err } time.Sleep(10 * time.Millisecond) } } func unlockAndCloseHandle(fd fileHandle) { unix.Close(int(fd)) } func closeHandle(fd fileHandle) { unix.Close(int(fd)) } ================================================ FILE: vendor/go.podman.io/storage/internal/rawfilelock/rawfilelock_windows.go ================================================ //go:build windows package rawfilelock import ( "golang.org/x/sys/windows" ) const ( reserved = 0 allBytes = ^uint32(0) ) type fileHandle windows.Handle func openHandle(path string, mode int) (fileHandle, error) { mode |= windows.O_CLOEXEC fd, err := windows.Open(path, mode, windows.S_IWRITE) return fileHandle(fd), err } func lockHandle(fd fileHandle, lType LockType, nonblocking bool) error { flags := 0 if lType != ReadLock { flags = windows.LOCKFILE_EXCLUSIVE_LOCK } if nonblocking { flags |= windows.LOCKFILE_FAIL_IMMEDIATELY } ol := new(windows.Overlapped) if err := windows.LockFileEx(windows.Handle(fd), uint32(flags), reserved, allBytes, allBytes, ol); err != nil { if nonblocking { return err } panic(err) } return nil } func unlockAndCloseHandle(fd fileHandle) { ol := new(windows.Overlapped) windows.UnlockFileEx(windows.Handle(fd), reserved, allBytes, allBytes, ol) closeHandle(fd) } func closeHandle(fd fileHandle) { windows.Close(windows.Handle(fd)) } ================================================ FILE: vendor/go.podman.io/storage/internal/staging_lockfile/staging_lockfile.go ================================================ package staging_lockfile import ( "fmt" "os" "path/filepath" "sync" "go.podman.io/storage/internal/rawfilelock" ) // StagingLockFile represents a file lock used to coordinate access to staging areas. // Typical usage is via CreateAndLock or TryLockPath, both of which return a StagingLockFile // that must eventually be released with UnlockAndDelete. This ensures that access // to the staging file is properly synchronized both within and across processes. // // WARNING: This struct MUST NOT be created manually. Use the provided helper functions instead. type StagingLockFile struct { // Locking invariant: If stagingLockFileLock is not locked, a StagingLockFile for a particular // path exists if the current process currently owns the lock for that file, and it is recorded in stagingLockFiles. // // The following fields can only be accessed by the goroutine owning the lock. // // An empty string in the file field means that the lock has been released and the StagingLockFile is no longer valid. file string // Also the key in stagingLockFiles fd rawfilelock.FileHandle } const maxRetries = 1000 var ( stagingLockFiles map[string]*StagingLockFile stagingLockFileLock sync.Mutex ) // tryAcquireLockForFile attempts to acquire a lock for the specified file path. func tryAcquireLockForFile(path string) (*StagingLockFile, error) { cleanPath, err := filepath.Abs(path) if err != nil { return nil, fmt.Errorf("ensuring that path %q is an absolute path: %w", path, err) } stagingLockFileLock.Lock() defer stagingLockFileLock.Unlock() if stagingLockFiles == nil { stagingLockFiles = make(map[string]*StagingLockFile) } if _, ok := stagingLockFiles[cleanPath]; ok { return nil, fmt.Errorf("lock %q is used already with other thread", cleanPath) } fd, err := rawfilelock.OpenLock(cleanPath, false) if err != nil { return nil, err } if err = rawfilelock.TryLockFile(fd, rawfilelock.WriteLock); err != nil { // Lock acquisition failed, but holding stagingLockFileLock ensures // no other goroutine in this process could have obtained a lock for this file, // so closing it is still safe. rawfilelock.CloseHandle(fd) return nil, fmt.Errorf("failed to acquire lock on %q: %w", cleanPath, err) } lockFile := &StagingLockFile{ file: cleanPath, fd: fd, } stagingLockFiles[cleanPath] = lockFile return lockFile, nil } // UnlockAndDelete releases the lock, removes the associated file from the filesystem. // // WARNING: After this operation, the StagingLockFile becomes invalid for further use. func (l *StagingLockFile) UnlockAndDelete() error { stagingLockFileLock.Lock() defer stagingLockFileLock.Unlock() if l.file == "" { // Panic when unlocking an unlocked lock. That's a violation // of the lock semantics and will reveal such. panic("calling Unlock on unlocked lock") } defer func() { // It’s important that this happens while we are still holding stagingLockFileLock, to ensure // that no other goroutine has l.file open = that this close is not unlocking the lock under any // other goroutine. (defer ordering is LIFO, so this will happen before we release the stagingLockFileLock) rawfilelock.UnlockAndCloseHandle(l.fd) delete(stagingLockFiles, l.file) l.file = "" }() if err := os.Remove(l.file); err != nil && !os.IsNotExist(err) { return err } return nil } // CreateAndLock creates a new temporary file in the specified directory with the given pattern, // then creates and locks a StagingLockFile for it. The file is created using os.CreateTemp. // Typically, the caller would use the returned lock file path to derive a path to the lock-controlled resource // (e.g. by replacing the "pattern" part of the returned file name with a different prefix) // Caller MUST call UnlockAndDelete() on the returned StagingLockFile to release the lock and delete the file. // // Returns: // - The locked StagingLockFile // - The name of created lock file // - Any error that occurred during the process // // If the file cannot be locked, this function will retry up to maxRetries times before failing. func CreateAndLock(dir string, pattern string) (*StagingLockFile, string, error) { for try := 0; ; try++ { file, err := os.CreateTemp(dir, pattern) if err != nil { return nil, "", err } file.Close() path := file.Name() l, err := tryAcquireLockForFile(path) if err != nil { if try < maxRetries { continue // Retry if the lock cannot be acquired } return nil, "", fmt.Errorf( "failed to allocate lock in %q after %d attempts; last failure on %q: %w", dir, try, filepath.Base(path), err, ) } return l, filepath.Base(path), nil } } // TryLockPath attempts to acquire a lock on an specific path. If the file does not exist, // it will be created. // // Warning: If acquiring a lock is successful, it returns a new StagingLockFile // instance for the file. Caller MUST call UnlockAndDelete() on the returned StagingLockFile // to release the lock and delete the file. func TryLockPath(path string) (*StagingLockFile, error) { return tryAcquireLockForFile(path) } ================================================ FILE: vendor/go.podman.io/storage/internal/tempdir/tempdir.go ================================================ package tempdir import ( "errors" "fmt" "io/fs" "os" "path/filepath" "strconv" "strings" "github.com/sirupsen/logrus" "go.podman.io/storage/internal/staging_lockfile" "go.podman.io/storage/pkg/system" ) /* Locking rules and invariants for TempDir and its recovery mechanism: 1. TempDir Instance Locks: - Path: 'RootDir/lock-XYZ' (in the root directory) - Each TempDir instance creates and holds an exclusive lock on this file immediately during NewTempDir() initialization. - This lock signifies that the temporary directory is in active use by the process/goroutine that holds the TempDir object. 2. Stale Directory Recovery (separate operation): - RecoverStaleDirs() can be called independently to identify and clean up stale temporary directories. - For each potential stale directory (found by listPotentialStaleDirs), it attempts to TryLockPath() its instance lock file. - If TryLockPath() succeeds: The directory is considered stale, and both the directory and lock file are removed. - If TryLockPath() fails: The directory is considered in active use by another process/goroutine, and it's skipped. 3. TempDir Usage: - NewTempDir() immediately creates both the instance lock and the temporary directory. - TempDir.StageDeletion() moves files into the existing temporary directory with counter-based naming. - Files moved into the temporary directory are renamed with a counter-based prefix to ensure uniqueness (e.g., "0-filename", "1-filename"). - Once cleaned up, the TempDir instance cannot be reused - StageDeletion() will return an error. 4. Cleanup Process: - TempDir.Cleanup() removes both the temporary directory and its lock file. - The instance lock is unlocked and deleted after cleanup operations are complete. - The TempDir instance becomes inactive after cleanup (internal fields are reset). - The TempDir instance cannot be reused after Cleanup() - StageDeletion() will fail. 5. TempDir Lifetime: - NewTempDir() creates both the TempDir manager and the actual temporary directory immediately. - The temporary directory is created eagerly during NewTempDir(). - During its lifetime, the temporary directory is protected by its instance lock. - The temporary directory exists until Cleanup() is called, which removes both the directory and its lock file. - Multiple TempDir instances can coexist in the same RootDir, each with its own unique subdirectory and lock. - After cleanup, the TempDir instance cannot be reused. 6. Example Directory Structure: RootDir/ lock-ABC (instance lock for temp-dir-ABC) temp-dir-ABC/ 0-file1 1-file3 lock-XYZ (instance lock for temp-dir-XYZ) temp-dir-XYZ/ 0-file2 */ const ( // tempDirPrefix is the prefix used for creating temporary directories. tempDirPrefix = "temp-dir-" // tempdirLockPrefix is the prefix used for creating lock files for temporary directories. tempdirLockPrefix = "lock-" ) // TempDir represents a temporary directory that is created in a specified root directory. // It manages the lifecycle of the temporary directory, including creation, locking, and cleanup. // Each TempDir instance is associated with a unique subdirectory in the root directory. // Warning: The TempDir instance should be used in a single goroutine. type TempDir struct { RootDir string tempDirPath string // tempDirLock is a lock file (e.g., RootDir/lock-XYZ) specific to this // TempDir instance, indicating it's in active use. tempDirLock *staging_lockfile.StagingLockFile tempDirLockPath string // counter is used to generate unique filenames for added files. counter uint64 } // StagedAddition is a temporary object which holds the information of where to // put the data into and then use Commit() to move the data into the final location. type StagedAddition struct { // Path is the temporary path. The path is not created so caller must create // a file or directory on it in order to use Commit(). The path is only valid // until Commit() is called or until the TempDir instance Cleanup() method is used. Path string } // Commit the staged content into its final destination by using os.Rename(). // That means the dest must be on the same on the same fs as the root directory // that was given to NewTempDir() and the dest must not exist yet. // Commit must only be called once per instance returned from the // StagedAddition() call. func (s *StagedAddition) Commit(destination string) error { err := os.Rename(s.Path, destination) s.Path = "" // invalidate Path to avoid reuse return err } // CleanupTempDirFunc is a function type that can be returned by operations // which need to perform cleanup actions later. type CleanupTempDirFunc func() error // listPotentialStaleDirs scans the RootDir for directories that might be stale temporary directories. // It identifies directories with the tempDirPrefix and their corresponding lock files with the tempdirLockPrefix. // The function returns a map of IDs that correspond to both directories and lock files found. // These IDs are extracted from the filenames by removing their respective prefixes. func listPotentialStaleDirs(rootDir string) (map[string]struct{}, error) { ids := make(map[string]struct{}) dirContent, err := os.ReadDir(rootDir) if err != nil { if errors.Is(err, fs.ErrNotExist) { return nil, nil } return nil, fmt.Errorf("error reading temp dir: %w", err) } for _, entry := range dirContent { if id, ok := strings.CutPrefix(entry.Name(), tempDirPrefix); ok { ids[id] = struct{}{} continue } if id, ok := strings.CutPrefix(entry.Name(), tempdirLockPrefix); ok { ids[id] = struct{}{} } } return ids, nil } // RecoverStaleDirs identifies and removes stale temporary directories in the root directory. // A directory is considered stale if its lock file can be acquired (indicating no active use). // The function attempts to remove both the directory and its lock file. // If a directory's lock cannot be acquired, it is considered in use and is skipped. func RecoverStaleDirs(rootDir string) error { potentialStaleDirs, err := listPotentialStaleDirs(rootDir) if err != nil { return fmt.Errorf("error listing potential stale temp dirs: %w", err) } if len(potentialStaleDirs) == 0 { return nil } var recoveryErrors []error for id := range potentialStaleDirs { lockPath := filepath.Join(rootDir, tempdirLockPrefix+id) tempDirPath := filepath.Join(rootDir, tempDirPrefix+id) // Try to lock the lock file. If it can be locked, the directory is stale. instanceLock, err := staging_lockfile.TryLockPath(lockPath) if err != nil { continue } if rmErr := system.EnsureRemoveAll(tempDirPath); rmErr != nil { recoveryErrors = append(recoveryErrors, fmt.Errorf("error removing stale temp dir: %w", rmErr)) } if unlockErr := instanceLock.UnlockAndDelete(); unlockErr != nil { recoveryErrors = append(recoveryErrors, fmt.Errorf("error unlocking and deleting stale lock file: %w", unlockErr)) } } return errors.Join(recoveryErrors...) } // NewTempDir creates a TempDir and immediately creates both the temporary directory // and its corresponding lock file in the specified RootDir. // The RootDir itself will be created if it doesn't exist. // Note: The caller MUST ensure that returned TempDir instance is cleaned up with .Cleanup(). func NewTempDir(rootDir string) (*TempDir, error) { if err := os.MkdirAll(rootDir, 0o700); err != nil { return nil, fmt.Errorf("creating root temp directory failed: %w", err) } td := &TempDir{ RootDir: rootDir, } tempDirLock, tempDirLockFileName, err := staging_lockfile.CreateAndLock(td.RootDir, tempdirLockPrefix) if err != nil { return nil, fmt.Errorf("creating and locking temp dir instance lock failed: %w", err) } td.tempDirLock = tempDirLock td.tempDirLockPath = filepath.Join(td.RootDir, tempDirLockFileName) // Create the temporary directory that corresponds to the lock file id := strings.TrimPrefix(tempDirLockFileName, tempdirLockPrefix) actualTempDirPath := filepath.Join(td.RootDir, tempDirPrefix+id) if err := os.MkdirAll(actualTempDirPath, 0o700); err != nil { return nil, fmt.Errorf("creating temp directory failed: %w", err) } td.tempDirPath = actualTempDirPath td.counter = 0 return td, nil } // StageAddition creates a new temporary path that is returned as field in the StagedAddition // struct. The returned type StagedAddition has a Commit() function to move the content from // the temporary location to the final one. // // The caller MUST call Commit() before Cleanup() is called on the TempDir, otherwise the // staged content will be deleted and the Commit() will fail. // If the TempDir has been cleaned up already, this method will return an error. func (td *TempDir) StageAddition() (*StagedAddition, error) { if td.tempDirLock == nil { return nil, fmt.Errorf("temp dir instance not initialized or already cleaned up") } fileName := strconv.FormatUint(td.counter, 10) + "-addition" tmpAddPath := filepath.Join(td.tempDirPath, fileName) td.counter++ return &StagedAddition{Path: tmpAddPath}, nil } // StageDeletion moves the specified file into the instance's temporary directory. // The temporary directory must already exist (created during NewTempDir). // Files are renamed with a counter-based prefix (e.g., "0-filename", "1-filename") to ensure uniqueness. // Note: 'path' must be on the same filesystem as the TempDir for os.Rename to work. // The caller MUST ensure .Cleanup() is called. // If the TempDir has been cleaned up, this method will return an error. func (td *TempDir) StageDeletion(path string) error { if td.tempDirLock == nil { return fmt.Errorf("temp dir instance not initialized or already cleaned up") } fileName := fmt.Sprintf("%d-", td.counter) + filepath.Base(path) destPath := filepath.Join(td.tempDirPath, fileName) td.counter++ return os.Rename(path, destPath) } // Cleanup removes the temporary directory and releases its instance lock. // After cleanup, the TempDir instance becomes inactive and cannot be reused. // Subsequent calls to StageDeletion() will fail. // Multiple calls to Cleanup() are safe and will not return an error. // Callers should typically defer Cleanup() to run after any application-level // global locks are released to avoid holding those locks during potentially // slow disk I/O. func (td *TempDir) Cleanup() error { if td.tempDirLock == nil { logrus.Debug("Temp dir already cleaned up") return nil } if err := system.EnsureRemoveAll(td.tempDirPath); err != nil { return fmt.Errorf("removing temp dir failed: %w", err) } lock := td.tempDirLock td.tempDirPath = "" td.tempDirLock = nil td.tempDirLockPath = "" return lock.UnlockAndDelete() } // CleanupTemporaryDirectories cleans up multiple temporary directories by calling their cleanup functions. func CleanupTemporaryDirectories(cleanFuncs ...CleanupTempDirFunc) error { var cleanupErrors []error for _, cleanupFunc := range cleanFuncs { if cleanupFunc == nil { continue } if err := cleanupFunc(); err != nil { cleanupErrors = append(cleanupErrors, err) } } return errors.Join(cleanupErrors...) } ================================================ FILE: vendor/go.podman.io/storage/jsoniter.go ================================================ package storage import jsoniter "github.com/json-iterator/go" var json = jsoniter.ConfigCompatibleWithStandardLibrary ================================================ FILE: vendor/go.podman.io/storage/layers.go ================================================ package storage import ( "bytes" "errors" "fmt" "io" "maps" "math/bits" "os" "path" "path/filepath" "reflect" "slices" "sort" "strings" "sync" "time" "github.com/klauspost/pgzip" digest "github.com/opencontainers/go-digest" "github.com/opencontainers/selinux/go-selinux" "github.com/sirupsen/logrus" "github.com/vbatts/tar-split/archive/tar" "github.com/vbatts/tar-split/tar/asm" "github.com/vbatts/tar-split/tar/storage" drivers "go.podman.io/storage/drivers" "go.podman.io/storage/internal/tempdir" "go.podman.io/storage/pkg/archive" "go.podman.io/storage/pkg/idtools" "go.podman.io/storage/pkg/ioutils" "go.podman.io/storage/pkg/lockfile" "go.podman.io/storage/pkg/mount" "go.podman.io/storage/pkg/pools" "go.podman.io/storage/pkg/stringid" "go.podman.io/storage/pkg/system" "go.podman.io/storage/pkg/tarlog" "go.podman.io/storage/pkg/truncindex" ) const ( tarSplitSuffix = ".tar-split.gz" // tempDirPath is the subdirectory name used for storing temporary directories during layer deletion tempDirPath = "tmp" incompleteFlag = "incomplete" // maxLayerStoreCleanupIterations is the number of times we try to clean up inconsistent layer store state // in readers (which, for implementation reasons, gives other writers the opportunity to create more inconsistent state) // until we just give up. maxLayerStoreCleanupIterations = 3 ) type layerLocations uint8 // The backing store is split in three json files. // The volatile store is written without fsync() meaning it isn't as robust to unclean shutdown. // Optionally, an image store can be configured to store RO layers. // The stable store is used for the remaining layers that don't go into the other stores. const ( stableLayerLocation layerLocations = 1 << iota imageStoreLayerLocation volatileLayerLocation numLayerLocationIndex = iota ) func layerLocationFromIndex(index int) layerLocations { return 1 << index } func indexFromLayerLocation(location layerLocations) int { return bits.TrailingZeros(uint(location)) } // A Layer is a record of a copy-on-write layer that's stored by the lower // level graph driver. type Layer struct { // ID is either one which was specified at create-time, or a random // value which was generated by the library. ID string `json:"id"` // Names is an optional set of user-defined convenience values. The // layer can be referred to by its ID or any of its names. Names are // unique among layers. Names []string `json:"names,omitempty"` // Parent is the ID of a layer from which this layer inherits data. Parent string `json:"parent,omitempty"` // Metadata is data we keep for the convenience of the caller. It is not // expected to be large, since it is kept in memory. Metadata string `json:"metadata,omitempty"` // MountLabel is an SELinux label which should be used when attempting to mount // the layer. MountLabel string `json:"mountlabel,omitempty"` // MountPoint is the path where the layer is mounted, or where it was most // recently mounted. // // WARNING: This field is a snapshot in time: (except for users inside c/storage that // hold the mount lock) the true value can change between subsequent // calls to c/storage API. // // Users that need to handle concurrent mount/unmount attempts should not access this // field at all, and should only use the path returned by .Mount() (and that’s only // assuming no other user will concurrently decide to unmount that mount point). MountPoint string `json:"-"` // MountCount is used as a reference count for the container's layer being // mounted at the mount point. // // WARNING: This field is a snapshot in time; (except for users inside c/storage that // hold the mount lock) the true value can change between subsequent // calls to c/storage API. // // In situations where concurrent mount/unmount attempts can happen, this field // should not be used for any decisions, maybe apart from heuristic user warnings. MountCount int `json:"-"` // Created is the datestamp for when this layer was created. Older // versions of the library did not track this information, so callers // will likely want to use the IsZero() method to verify that a value // is set before using it. Created time.Time `json:"created"` // CompressedDigest is the digest of the blob that was last passed to // ApplyDiff() or create(), as it was presented to us. CompressedDigest digest.Digest `json:"compressed-diff-digest,omitempty"` // CompressedSize is the length of the blob that was last passed to // ApplyDiff() or create(), as it was presented to us. If // CompressedDigest is not set, this should be treated as if it were an // uninitialized value. CompressedSize int64 `json:"compressed-size,omitempty"` // UncompressedDigest is the digest of the blob that was last passed to // ApplyDiff() or create(), after we decompressed it. Often referred to // as a DiffID. UncompressedDigest digest.Digest `json:"diff-digest,omitempty"` // TOCDigest represents the digest of the Table of Contents (TOC) of the blob. // This digest is utilized when the UncompressedDigest is not // validated during the partial image pull process, but the // TOC itself is validated. // It serves as an alternative reference under these specific conditions. TOCDigest digest.Digest `json:"toc-digest,omitempty"` // UncompressedSize is the length of the blob that was last passed to // ApplyDiff() or create(), after we decompressed it. // // - If UncompressedDigest is set, this must be set to a valid value. // - Otherwise, if TOCDigest is set, this is either valid or -1. // - If neither of this digests is set, this should be treated as if it were // an uninitialized value. UncompressedSize int64 `json:"diff-size,omitempty"` // CompressionType is the type of compression which we detected on the blob // that was last passed to ApplyDiff() or create(). CompressionType archive.Compression `json:"compression,omitempty"` // UIDs and GIDs are lists of UIDs and GIDs used in the layer. This // field is only populated (i.e., will only contain one or more // entries) if the layer was created using ApplyDiff() or create(). UIDs []uint32 `json:"uidset,omitempty"` GIDs []uint32 `json:"gidset,omitempty"` // Flags is arbitrary data about the layer. Flags map[string]any `json:"flags,omitempty"` // UIDMap and GIDMap are used for setting up a layer's contents // for use inside of a user namespace where UID mapping is being used. UIDMap []idtools.IDMap `json:"uidmap,omitempty"` GIDMap []idtools.IDMap `json:"gidmap,omitempty"` // ReadOnly is true if this layer resides in a read-only layer store. ReadOnly bool `json:"-"` // location is the location of the store where the layer is present. location layerLocations `json:"-"` // BigDataNames is a list of names of data items that we keep for the // convenience of the caller. They can be large, and are only in // memory when being read from or written to disk. BigDataNames []string `json:"big-data-names,omitempty"` } type layerMountPoint struct { ID string `json:"id"` MountPoint string `json:"path"` MountCount int `json:"count"` } // DiffOptions override the default behavior of Diff() methods. type DiffOptions struct { // Compression, if set overrides the default compressor when generating a diff. Compression *archive.Compression } // layerCreationContents are the options passed to .create to populate a staged // layer type layerCreationContents struct { // These are used via the zstd:chunked pull paths DiffOutput *drivers.DriverWithDifferOutput DiffOptions *drivers.ApplyDiffWithDifferOpts // stagedLayerExtraction is used by the normal tar layer extraction. stagedLayerExtraction *maybeStagedLayerExtraction } // maybeStagedLayerExtraction is a helper to encapsulate details around extracting // a layer potentially before we even take a look if the driver implements the // ApplyDiffStaging interface. // This should be initialized with layerStore.newMaybeStagedLayerExtraction() type maybeStagedLayerExtraction struct { // diff contains the tar archive, can be compressed, must be non nil, but can be at EOF when the content was already staged diff io.Reader // staging interface of the storage driver, set when the driver supports staging and nil otherwise staging drivers.ApplyDiffStaging // result is a placeholder for the applyDiff() result so we can pass that down the stack easily. // If result is not nil the layer was staged successfully, if this is set stagedTarSplit and // stagedLayer must be set as well. result *applyDiffResult // stagedTarSplit is the temp file where we staged the tar split file stagedTarSplit *tempdir.StagedAddition // stagedLayer is the temp directory where we staged the extracted layer content stagedLayer *tempdir.StagedAddition // cleanupFuncs contains the set of tempdir cleanup function that get executed in cleanup() cleanupFuncs []tempdir.CleanupTempDirFunc } type applyDiffResult struct { compressedDigest digest.Digest compressedSize int64 compressionType archive.Compression uncompressedDigest digest.Digest uncompressedSize int64 // size of the data, including the full size of sparse files, and excluding all metadata // It is neither compressedSize nor uncompressedSize. // The use case for this seems unclear, it gets returned in PutLayer() but in the Podman // stack at least that value is never used so maybe we can look into removing this. size int64 uids []uint32 gids []uint32 } // roLayerStore wraps a graph driver, adding the ability to refer to layers by // name, and keeping track of parent-child relationships, along with a list of // all known layers. type roLayerStore interface { roMetadataStore roLayerBigDataStore // startReading makes sure the store is fresh, and locks it for reading. // If this succeeds, the caller MUST call stopReading(). startReading() error // stopReading releases locks obtained by startReading. stopReading() // checkIdOrNameConflict checks if the id or names are already in use and returns an // error in that case. As Special case if the layer already exists it returns it as // well together with the error. checkIdOrNameConflict(id string, names []string) (*Layer, error) // Exists checks if a layer with the specified name or ID is known. Exists(id string) bool // Get retrieves information about a layer given an ID or name. Get(id string) (*Layer, error) // Status returns an slice of key-value pairs, suitable for human consumption, // relaying whatever status information the underlying driver can share. Status() ([][2]string, error) // Changes returns a slice of Change structures, which contain a pathname // (Path) and a description of what sort of change (Kind) was made by the // layer (either ChangeModify, ChangeAdd, or ChangeDelete), relative to a // specified layer. By default, the layer's parent is used as a reference. Changes(from, to string) ([]archive.Change, error) // Diff produces a tarstream which can be applied to a layer with the contents // of the first layer to produce a layer with the contents of the second layer. // By default, the parent of the second layer is used as the first // layer, so it need not be specified. Options can be used to override // default behavior, but are also not required. Diff(from, to string, options *DiffOptions) (io.ReadCloser, error) // DiffSize produces an estimate of the length of the tarstream which would be // produced by Diff. DiffSize(from, to string) (int64, error) // Size produces a cached value for the uncompressed size of the layer, // if one is known, or -1 if it is not known. If the layer can not be // found, it returns an error. Size(name string) (int64, error) // LayersByCompressedDigest returns a slice of the layers with the // specified compressed digest value recorded for them. LayersByCompressedDigest(d digest.Digest) ([]Layer, error) // LayersByUncompressedDigest returns a slice of the layers with the // specified uncompressed digest value recorded for them. LayersByUncompressedDigest(d digest.Digest) ([]Layer, error) // LayersByTOCDigest returns a slice of the layers with the // specified uncompressed digest value recorded for them. LayersByTOCDigest(d digest.Digest) ([]Layer, error) // Layers returns a slice of the known layers. Layers() ([]Layer, error) } // rwLayerStore wraps a graph driver, adding the ability to refer to layers by // name, and keeping track of parent-child relationships, along with a list of // all known layers. type rwLayerStore interface { roLayerStore rwMetadataStore flaggableStore rwLayerBigDataStore // startWriting makes sure the store is fresh, and locks it for writing. // If this succeeds, the caller MUST call stopWriting(). startWriting() error // stopWriting releases locks obtained by startWriting. stopWriting() // create creates a new layer, optionally giving it a specified ID rather than // a randomly-generated one, either inheriting data from another specified // layer or the empty base layer. The new layer can optionally be given names // and have an SELinux label specified for use when mounting it. Some // underlying drivers can accept a "size" option. At this time, most // underlying drivers do not themselves distinguish between writeable // and read-only layers. Returns the new layer structure and the size of the // diff which was applied to its parent to initialize its contents. create(id string, parent *Layer, names []string, mountLabel string, options map[string]string, moreOptions *LayerOptions, writeable bool, contents *layerCreationContents) (*Layer, int64, error) // updateNames modifies names associated with a layer based on (op, names). updateNames(id string, names []string, op updateNameOperation) error // deleteWhileHoldingLock deletes a layer with the specified name or ID. deleteWhileHoldingLock(id string) error // deferredDelete deletes a layer with the specified name or ID. // This removal happen immediately (the layer is no longer usable), // but physically deleting the files may be deferred. // Caller MUST call all returned cleanup functions outside of the locks. deferredDelete(id string) ([]tempdir.CleanupTempDirFunc, error) // Wipe deletes all layers. Wipe() error // Mount mounts a layer for use. If the specified layer is the parent of other // layers, it should not be written to. An SELinux label to be applied to the // mount can be specified to override the one configured for the layer. // The mappings used by the container can be specified. Mount(id string, options drivers.MountOpts) (string, error) // unmount unmounts a layer when it is no longer in use. // If conditional is set, it will fail with ErrLayerNotMounted if the layer is not mounted (without conditional, the caller is // making a promise that the layer is actually mounted). // If force is set, it will physically try to unmount it even if it is mounted multiple times, or even if (!conditional and) // there are no records of it being mounted in the first place. // It returns whether the layer was still mounted at the time this function returned. // WARNING: The return value may already be obsolete by the time it is available // to the caller, so it can be used for heuristic sanity checks at best. It should almost always be ignored. unmount(id string, force bool, conditional bool) (bool, error) // Mounted returns number of times the layer has been mounted. Mounted(id string) (int, error) // ParentOwners returns the UIDs and GIDs of parents of the layer's mountpoint // for which the layer's UID and GID maps don't contain corresponding entries. ParentOwners(id string) (uids, gids []int, err error) // ApplyDiff reads a tarstream which was created by a previous call to Diff and // applies its changes to a specified layer. ApplyDiff(to string, diff io.Reader) (int64, error) // applyDiffWithDifferNoLock applies the changes through the differ callback function. applyDiffWithDifferNoLock(options *drivers.ApplyDiffWithDifferOpts, differ drivers.Differ) (*drivers.DriverWithDifferOutput, error) // CleanupStagingDirectory cleanups the staging directory. It can be used to cleanup the staging directory on errors CleanupStagingDirectory(stagingDirectory string) error // applyDiffFromStagingDirectory uses diffOutput.Target to create the diff. applyDiffFromStagingDirectory(id string, diffOutput *drivers.DriverWithDifferOutput, options *drivers.ApplyDiffWithDifferOpts) error // DifferTarget gets the location where files are stored for the layer. DifferTarget(id string) (string, error) // PutAdditionalLayer creates a layer using the diff contained in the additional layer // store. // This API is experimental and can be changed without bumping the major version number. PutAdditionalLayer(id string, parentLayer *Layer, names []string, aLayer drivers.AdditionalLayer) (layer *Layer, err error) // Clean up unreferenced layers GarbageCollect() error // Dedup deduplicates layers in the store. dedup(drivers.DedupArgs) (drivers.DedupResult, error) // newMaybeStagedLayerExtraction initializes a new maybeStagedLayerExtraction. The caller // must call maybeStagedLayerExtraction.cleanup() to remove any temporary files. newMaybeStagedLayerExtraction(diff io.Reader) *maybeStagedLayerExtraction // stageWithUnlockedStore stages the layer content without needing the store locked. // If the driver does not support stage addition then this is a NOP and does nothing. stageWithUnlockedStore(m *maybeStagedLayerExtraction, parent string, options *LayerOptions) error } type multipleLockFile struct { lockfiles []*lockfile.LockFile } func (l multipleLockFile) Lock() { for _, lock := range l.lockfiles { lock.Lock() } } func (l multipleLockFile) RLock() { for _, lock := range l.lockfiles { lock.RLock() } } func (l multipleLockFile) Unlock() { for _, lock := range l.lockfiles { lock.Unlock() } } func (l multipleLockFile) ModifiedSince(lastWrite lockfile.LastWrite) (lockfile.LastWrite, bool, error) { // Look up only the first lockfile, since this is the value returned by RecordWrite(). return l.lockfiles[0].ModifiedSince(lastWrite) } func (l multipleLockFile) AssertLockedForWriting() { for _, lock := range l.lockfiles { lock.AssertLockedForWriting() } } func (l multipleLockFile) GetLastWrite() (lockfile.LastWrite, error) { return l.lockfiles[0].GetLastWrite() } func (l multipleLockFile) RecordWrite() (lockfile.LastWrite, error) { var lastWrite *lockfile.LastWrite for _, lock := range l.lockfiles { lw, err := lock.RecordWrite() if err != nil { return lw, err } // Return the first value we get so we know that // all the locks have a write time >= to this one. if lastWrite == nil { lastWrite = &lw } } return *lastWrite, nil } func (l multipleLockFile) IsReadWrite() bool { return l.lockfiles[0].IsReadWrite() } func newMultipleLockFile(l ...*lockfile.LockFile) *multipleLockFile { return &multipleLockFile{lockfiles: l} } type layerStore struct { // The following fields are only set when constructing layerStore, and must never be modified afterwards. // They are safe to access without any other locking. lockfile *multipleLockFile // lockfile.IsReadWrite can be used to distinguish between read-write and read-only layer stores. mountsLockfile *lockfile.LockFile // Can _only_ be obtained with inProcessLock held. rundir string jsonPath [numLayerLocationIndex]string layerdir string inProcessLock sync.RWMutex // Can _only_ be obtained with lockfile held. // The following fields can only be read/written with read/write ownership of inProcessLock, respectively. // Almost all users should use startReading() or startWriting(). lastWrite lockfile.LastWrite mountsLastWrite lockfile.LastWrite // Only valid if lockfile.IsReadWrite() layers []*Layer idindex *truncindex.TruncIndex byid map[string]*Layer byname map[string]*Layer bymount map[string]*Layer bycompressedsum map[digest.Digest][]string byuncompressedsum map[digest.Digest][]string bytocsum map[digest.Digest][]string layerspathsModified [numLayerLocationIndex]time.Time // FIXME: This field is only set when constructing layerStore, but locking rules of the driver // interface itself are not documented here. driver drivers.Driver } func copyLayer(l *Layer) *Layer { return &Layer{ ID: l.ID, Names: copySlicePreferringNil(l.Names), Parent: l.Parent, Metadata: l.Metadata, MountLabel: l.MountLabel, MountPoint: l.MountPoint, MountCount: l.MountCount, Created: l.Created, CompressedDigest: l.CompressedDigest, CompressedSize: l.CompressedSize, UncompressedDigest: l.UncompressedDigest, UncompressedSize: l.UncompressedSize, TOCDigest: l.TOCDigest, CompressionType: l.CompressionType, ReadOnly: l.ReadOnly, location: l.location, BigDataNames: copySlicePreferringNil(l.BigDataNames), Flags: copyMapPreferringNil(l.Flags), UIDMap: copySlicePreferringNil(l.UIDMap), GIDMap: copySlicePreferringNil(l.GIDMap), UIDs: copySlicePreferringNil(l.UIDs), GIDs: copySlicePreferringNil(l.GIDs), } } // startWritingWithReload makes sure the store is fresh if canReload, and locks it for writing. // If this succeeds, the caller MUST call stopWriting(). // // This is an internal implementation detail of layerStore construction, every other caller // should use startWriting() instead. func (r *layerStore) startWritingWithReload(canReload bool) error { r.lockfile.Lock() r.inProcessLock.Lock() succeeded := false defer func() { if !succeeded { r.inProcessLock.Unlock() r.lockfile.Unlock() } }() if canReload { if _, err := r.reloadIfChanged(true); err != nil { return err } } succeeded = true return nil } // startWriting makes sure the store is fresh, and locks it for writing. // If this succeeds, the caller MUST call stopWriting(). func (r *layerStore) startWriting() error { return r.startWritingWithReload(true) } // stopWriting releases locks obtained by startWriting. func (r *layerStore) stopWriting() { r.inProcessLock.Unlock() r.lockfile.Unlock() } // startReadingWithReload makes sure the store is fresh if canReload, and locks it for reading. // If this succeeds, the caller MUST call stopReading(). // // This is an internal implementation detail of layerStore construction, every other caller // should use startReading() instead. func (r *layerStore) startReadingWithReload(canReload bool) error { // inProcessLocked calls the nested function with r.inProcessLock held for writing. inProcessLocked := func(fn func() error) error { r.inProcessLock.Lock() defer r.inProcessLock.Unlock() return fn() } r.lockfile.RLock() unlockFn := r.lockfile.Unlock // A function to call to clean up, or nil defer func() { if unlockFn != nil { unlockFn() } }() r.inProcessLock.RLock() unlockFn = r.stopReading if canReload { // If we are lucky, we can just hold the read locks, check that we are fresh, and continue. modified, err := r.modified() if err != nil { return err } if modified { // We are unlucky, and need to reload. // NOTE: Multiple goroutines can get to this place approximately simultaneously. r.inProcessLock.RUnlock() unlockFn = r.lockfile.Unlock cleanupsDone := 0 for { // First try reloading with r.lockfile held for reading. // r.inProcessLock will serialize all goroutines that got here; // each will re-check on-disk state vs. r.lastWrite, and the first one will actually reload the data. var tryLockedForWriting bool err := inProcessLocked(func() error { var err error tryLockedForWriting, err = r.reloadIfChanged(false) return err }) if err == nil { break } if !tryLockedForWriting { return err } if cleanupsDone >= maxLayerStoreCleanupIterations { return fmt.Errorf("(even after %d cleanup attempts:) %w", cleanupsDone, err) } // Not good enough, we need r.lockfile held for writing. So, let’s do that. unlockFn() unlockFn = nil r.lockfile.Lock() unlockFn = r.lockfile.Unlock if err := inProcessLocked(func() error { _, err := r.reloadIfChanged(true) return err }); err != nil { return err } unlockFn() unlockFn = nil r.lockfile.RLock() unlockFn = r.lockfile.Unlock // We need to check for a reload again because the on-disk state could have been modified // after we released the lock. cleanupsDone++ } // NOTE that we hold neither a read nor write inProcessLock at this point. That’s fine in ordinary operation, because // the on-filesystem r.lockfile should protect us against (cooperating) writers, and any use of r.inProcessLock // protects us against in-process writers modifying data. // In presence of non-cooperating writers, we just ensure that 1) the in-memory data is not clearly out-of-date // and 2) access to the in-memory data is not racy; // but we can’t protect against those out-of-process writers modifying _files_ while we are assuming they are in a consistent state. r.inProcessLock.RLock() } } unlockFn = nil return nil } // startReading makes sure the store is fresh, and locks it for reading. // If this succeeds, the caller MUST call stopReading(). func (r *layerStore) startReading() error { return r.startReadingWithReload(true) } // stopReading releases locks obtained by startReading. func (r *layerStore) stopReading() { r.inProcessLock.RUnlock() r.lockfile.Unlock() } // modified returns true if the on-disk state (of layers or mounts) has changed (ie if reloadIcHanged may need to modify the store) // // Note that unlike containerStore.modified and imageStore.modified, this function is not directly used in layerStore.reloadIfChanged(); // it exists only to help the reader ensure it has fresh enough state. // // The caller must hold r.lockfile for reading _or_ writing. // The caller must hold r.inProcessLock for reading or writing. func (r *layerStore) modified() (bool, error) { _, m, err := r.layersModified() if err != nil { return false, err } if m { return true, nil } if r.lockfile.IsReadWrite() { // This means we get, release, and re-obtain, r.mountsLockfile if we actually need to do any kind of reload. // That’s a bit expensive, but hopefully most callers will be read-only and see no changes. // We can’t eliminate these mountsLockfile accesses given the current assumption that Layer objects have _some_ not-very-obsolete // mount data. Maybe we can segregate the mount-dependent and mount-independent operations better... r.mountsLockfile.RLock() defer r.mountsLockfile.Unlock() _, m, err := r.mountsModified() if err != nil { return false, err } if m { return true, nil } } return false, nil } // layersModified() checks if the most recent writer to r.jsonPath[] was a party other than the // last recorded writer. If so, it returns a lockfile.LastWrite value to record on a successful // reload. // It should only be called with the lock held. // The caller must hold r.inProcessLock for reading. func (r *layerStore) layersModified() (lockfile.LastWrite, bool, error) { lastWrite, modified, err := r.lockfile.ModifiedSince(r.lastWrite) if err != nil { return lockfile.LastWrite{}, modified, err } if modified { return lastWrite, true, nil } // If the layers.json file or container-layers.json has been // modified manually, then we have to reload the storage in // any case. for locationIndex := range numLayerLocationIndex { rpath := r.jsonPath[locationIndex] if rpath == "" { continue } info, err := os.Stat(rpath) if err != nil && !os.IsNotExist(err) { return lockfile.LastWrite{}, false, fmt.Errorf("stat layers file: %w", err) } if info != nil && info.ModTime() != r.layerspathsModified[locationIndex] { // In this case the LastWrite value is equal to r.lastWrite; writing it back doesn’t hurt. return lastWrite, true, nil } } return lockfile.LastWrite{}, false, nil } // reloadIfChanged reloads the contents of the store from disk if it is changed. // // The caller must hold r.lockfile for reading _or_ writing; lockedForWriting is true // if it is held for writing. // // The caller must hold r.inProcessLock for WRITING. // // If !lockedForWriting and this function fails, the return value indicates whether // reloadIfChanged() with lockedForWriting could succeed. func (r *layerStore) reloadIfChanged(lockedForWriting bool) (bool, error) { lastWrite, layersModified, err := r.layersModified() if err != nil { return false, err } if layersModified { // r.load also reloads mounts data; so, on this path, we don’t need to call reloadMountsIfChanged. if tryLockedForWriting, err := r.load(lockedForWriting); err != nil { return tryLockedForWriting, err // r.lastWrite is unchanged, so we will load the next time again. } r.lastWrite = lastWrite return false, nil } if r.lockfile.IsReadWrite() { r.mountsLockfile.RLock() defer r.mountsLockfile.Unlock() if err := r.reloadMountsIfChanged(); err != nil { return false, err } } return false, nil } // mountsModified returns true if the on-disk mount state has changed (i.e. if reloadMountsIfChanged may need to modify the store), // and a lockfile.LastWrite value for that update. // // The caller must hold r.mountsLockfile for reading _or_ writing. // The caller must hold r.inProcessLock for reading or writing. func (r *layerStore) mountsModified() (lockfile.LastWrite, bool, error) { return r.mountsLockfile.ModifiedSince(r.mountsLastWrite) } // reloadMountsIfChanged reloads the contents of mountsPath from disk if it is changed. // // The caller must hold r.mountsLockFile for reading or writing. func (r *layerStore) reloadMountsIfChanged() error { lastWrite, modified, err := r.mountsModified() if err != nil { return err } if modified { if err = r.loadMounts(); err != nil { return err } r.mountsLastWrite = lastWrite } return nil } // Requires startReading or startWriting. func (r *layerStore) Layers() ([]Layer, error) { layers := make([]Layer, len(r.layers)) for i := range r.layers { layers[i] = *copyLayer(r.layers[i]) } return layers, nil } // Requires startWriting. func (r *layerStore) GarbageCollect() error { layers, err := r.driver.ListLayers() if err != nil { if errors.Is(err, drivers.ErrNotSupported) { return nil } return err } for _, id := range layers { // Is the id still referenced if r.byid[id] != nil { continue } // Remove layer and any related data of unreferenced id if err := r.driver.Remove(id); err != nil { logrus.Debugf("removing driver layer %q", id) return err } logrus.Debugf("removing %q", r.tspath(id)) os.Remove(r.tspath(id)) logrus.Debugf("removing %q", r.datadir(id)) os.RemoveAll(r.datadir(id)) } return nil } func (r *layerStore) mountspath() string { return filepath.Join(r.rundir, "mountpoints.json") } // load reloads the contents of the store from disk. // // Most callers should call reloadIfChanged() instead, to avoid overhead and to correctly // manage r.lastWrite. // // As a side effect, this sets r.mountsLastWrite. // // The caller must hold r.lockfile for reading _or_ writing; lockedForWriting is true // if it is held for writing. // The caller must hold r.inProcessLock for WRITING. // // If !lockedForWriting and this function fails, the return value indicates whether // retrying with lockedForWriting could succeed. func (r *layerStore) load(lockedForWriting bool) (bool, error) { var modifiedLocations layerLocations layers := []*Layer{} ids := make(map[string]*Layer) if r.lockfile.IsReadWrite() { if err := tempdir.RecoverStaleDirs(filepath.Join(r.layerdir, tempDirPath)); err != nil { return false, err } for _, driverTempDirPath := range r.driver.GetTempDirRootDirs() { if err := tempdir.RecoverStaleDirs(driverTempDirPath); err != nil { return false, err } } } for locationIndex := range numLayerLocationIndex { location := layerLocationFromIndex(locationIndex) rpath := r.jsonPath[locationIndex] if rpath == "" { continue } info, err := os.Stat(rpath) if err != nil { if !os.IsNotExist(err) { return false, err } } else { r.layerspathsModified[locationIndex] = info.ModTime() } data, err := os.ReadFile(rpath) if err != nil && !os.IsNotExist(err) { return false, err } locationLayers := []*Layer{} if len(data) != 0 { if err := json.Unmarshal(data, &locationLayers); err != nil { return false, fmt.Errorf("loading %q: %w", rpath, err) } } for _, layer := range locationLayers { // There should be no duplicated ids between json files, but lets check to be sure if ids[layer.ID] != nil { continue // skip invalid duplicated layer } // Remember where the layer came from layer.location = location layers = append(layers, layer) ids[layer.ID] = layer } } idlist := make([]string, 0, len(layers)) names := make(map[string]*Layer) compressedsums := make(map[digest.Digest][]string) uncompressedsums := make(map[digest.Digest][]string) tocsums := make(map[digest.Digest][]string) var errorToResolveBySaving error // == nil; if there are multiple errors, this is one of them. if r.lockfile.IsReadWrite() { selinux.ClearLabels() } for n, layer := range layers { idlist = append(idlist, layer.ID) for _, name := range layer.Names { if conflict, ok := names[name]; ok { r.removeName(conflict, name) errorToResolveBySaving = ErrDuplicateLayerNames modifiedLocations |= conflict.location } names[name] = layers[n] } if layer.CompressedDigest != "" { compressedsums[layer.CompressedDigest] = append(compressedsums[layer.CompressedDigest], layer.ID) } if layer.UncompressedDigest != "" { uncompressedsums[layer.UncompressedDigest] = append(uncompressedsums[layer.UncompressedDigest], layer.ID) } if layer.TOCDigest != "" { tocsums[layer.TOCDigest] = append(tocsums[layer.TOCDigest], layer.ID) } if layer.MountLabel != "" { selinux.ReserveLabel(layer.MountLabel) } layer.ReadOnly = !r.lockfile.IsReadWrite() // The r.lockfile.IsReadWrite() condition maintains past practice: // Incomplete layers in a read-only store are not treated as a reason to refuse to use other layers from that store // (OTOH creating child layers on top would probably lead to problems?). // We do remove incomplete layers in read-write stores so that we don’t build on top of them. if layerHasIncompleteFlag(layer) && r.lockfile.IsReadWrite() { errorToResolveBySaving = errors.New("an incomplete layer exists and can't be cleaned up") } } if errorToResolveBySaving != nil { if !r.lockfile.IsReadWrite() { return false, errorToResolveBySaving } if !lockedForWriting { return true, errorToResolveBySaving } } r.layers = layers r.idindex = truncindex.NewTruncIndex(idlist) // Invalid values in idlist are ignored: they are not a reason to refuse processing the whole store. r.byid = ids r.byname = names r.bycompressedsum = compressedsums r.byuncompressedsum = uncompressedsums r.bytocsum = tocsums // Load and merge information about which layers are mounted, and where. if r.lockfile.IsReadWrite() { r.mountsLockfile.RLock() defer r.mountsLockfile.Unlock() // We need to reload mounts unconditionally, becuause by creating r.layers from scratch, we have discarded the previous // information, if any. So, obtain a fresh mountsLastWrite value so that we don’t unnecessarily reload the data // afterwards. mountsLastWrite, err := r.mountsLockfile.GetLastWrite() if err != nil { return false, err } if err := r.loadMounts(); err != nil { return false, err } r.mountsLastWrite = mountsLastWrite // NOTE: We will release mountsLockfile when this function returns, so unlike most of the layer data, the // r.layers[].MountPoint, r.layers[].MountCount, and r.bymount values might not reflect // true on-filesystem state already by the time this function returns. // Code that needs the state to be accurate must lock r.mountsLockfile again, // and possibly loadMounts() again. } if errorToResolveBySaving != nil { if !r.lockfile.IsReadWrite() { return false, fmt.Errorf("internal error: layerStore.load has shouldSave but !r.lockfile.IsReadWrite") } // Last step: try to remove anything that a previous // user of this storage area marked for deletion but didn't manage to // actually delete. var incompleteDeletionErrors error // = nil var layersToDelete []*Layer for _, layer := range r.layers { if layer.Flags == nil { layer.Flags = make(map[string]any) } if layerHasIncompleteFlag(layer) { // Important: Do not call r.deleteInternal() here. It modifies r.layers // which causes unexpected side effects while iterating over r.layers here. // The range loop has no idea that the underlying elements where shifted // around. layersToDelete = append(layersToDelete, layer) } } // Now actually delete the layers for _, layer := range layersToDelete { logrus.Warnf("Found incomplete layer %q, deleting it", layer.ID) cleanFunctions, err := r.internalDelete(layer.ID) defer func() { if err := tempdir.CleanupTemporaryDirectories(cleanFunctions...); err != nil { logrus.Errorf("Error cleaning up temporary directories: %v", err) } }() if err != nil { // Don't return the error immediately, because deleteInternal does not saveLayers(); // Even if deleting one incomplete layer fails, call saveLayers() so that other possible successfully // deleted incomplete layers have their metadata correctly removed. incompleteDeletionErrors = errors.Join(incompleteDeletionErrors, fmt.Errorf("deleting layer %#v: %w", layer.ID, err)) } modifiedLocations |= layer.location } if err := r.saveLayers(modifiedLocations); err != nil { return false, err } if incompleteDeletionErrors != nil { return false, incompleteDeletionErrors } } return false, nil } // The caller must hold r.mountsLockfile for reading or writing. // The caller must hold r.inProcessLock for WRITING. func (r *layerStore) loadMounts() error { mounts := make(map[string]*Layer) mpath := r.mountspath() data, err := os.ReadFile(mpath) if err != nil && !os.IsNotExist(err) { return err } layerMounts := []layerMountPoint{} if len(data) != 0 { if err := json.Unmarshal(data, &layerMounts); err != nil { return err } } // Clear all of our mount information. If another process // unmounted something, it (along with its zero count) won't // have been encoded into the version of mountpoints.json that // we're loading, so our count could fall out of sync with it // if we don't, and if we subsequently change something else, // we'd pass that error along to other process that reloaded // the data after we saved it. for _, layer := range r.layers { layer.MountPoint = "" layer.MountCount = 0 } // All of the non-zero count values will have been encoded, so // we reset the still-mounted ones based on the contents. for _, mount := range layerMounts { if mount.MountPoint != "" { if layer, ok := r.lookup(mount.ID); ok { mounts[mount.MountPoint] = layer layer.MountPoint = mount.MountPoint layer.MountCount = mount.MountCount } } } r.bymount = mounts return nil } // save saves the contents of the store to disk. // The caller must hold r.lockfile locked for writing. // The caller must hold r.inProcessLock for WRITING. func (r *layerStore) save(saveLocations layerLocations) error { r.mountsLockfile.Lock() defer r.mountsLockfile.Unlock() if err := r.saveLayers(saveLocations); err != nil { return err } return r.saveMounts() } // saveFor saves the contents of the store relevant for modifiedLayer to disk. // The caller must hold r.lockfile locked for writing. // The caller must hold r.inProcessLock for WRITING. func (r *layerStore) saveFor(modifiedLayer *Layer) error { return r.save(modifiedLayer.location) } // The caller must hold r.lockfile locked for writing. // The caller must hold r.inProcessLock for WRITING. func (r *layerStore) saveLayers(saveLocations layerLocations) error { if !r.lockfile.IsReadWrite() { return fmt.Errorf("not allowed to modify the layer store at %q: %w", r.layerdir, ErrStoreIsReadOnly) } r.lockfile.AssertLockedForWriting() // This must be done before we write the file, because the process could be terminated // after the file is written but before the lock file is updated. lw, err := r.lockfile.RecordWrite() if err != nil { return err } r.lastWrite = lw for locationIndex := range numLayerLocationIndex { location := layerLocationFromIndex(locationIndex) if location&saveLocations == 0 { continue } rpath := r.jsonPath[locationIndex] if rpath == "" { return fmt.Errorf("internal error: no path for location %v", location) } if err := os.MkdirAll(filepath.Dir(rpath), 0o700); err != nil { return err } subsetLayers := make([]*Layer, 0, len(r.layers)) for _, layer := range r.layers { if layer.location == location { subsetLayers = append(subsetLayers, layer) } } jldata, err := json.Marshal(&subsetLayers) if err != nil { return err } opts := ioutils.AtomicFileWriterOptions{} if location == volatileLayerLocation { opts.NoSync = true } if err := ioutils.AtomicWriteFileWithOpts(rpath, jldata, 0o600, &opts); err != nil { return err } r.layerspathsModified[locationIndex] = opts.ModTime } return nil } // The caller must hold r.mountsLockfile for writing. // The caller must hold r.inProcessLock for WRITING. func (r *layerStore) saveMounts() error { if !r.lockfile.IsReadWrite() { return fmt.Errorf("not allowed to modify the layer store at %q: %w", r.layerdir, ErrStoreIsReadOnly) } r.mountsLockfile.AssertLockedForWriting() mpath := r.mountspath() if err := os.MkdirAll(filepath.Dir(mpath), 0o700); err != nil { return err } mounts := make([]layerMountPoint, 0, len(r.layers)) for _, layer := range r.layers { if layer.MountPoint != "" && layer.MountCount > 0 { mounts = append(mounts, layerMountPoint{ ID: layer.ID, MountPoint: layer.MountPoint, MountCount: layer.MountCount, }) } } jmdata, err := json.Marshal(&mounts) if err != nil { return err } // This must be done before we write the file, because the process could be terminated // after the file is written but before the lock file is updated. lw, err := r.mountsLockfile.RecordWrite() if err != nil { return err } r.mountsLastWrite = lw if err = ioutils.AtomicWriteFile(mpath, jmdata, 0o600); err != nil { return err } return r.loadMounts() } func (s *store) newLayerStore(rundir, layerdir, imagedir string, driver drivers.Driver, transient bool) (rwLayerStore, error) { if err := os.MkdirAll(rundir, 0o700); err != nil { return nil, err } if err := os.MkdirAll(layerdir, 0o700); err != nil { return nil, err } if imagedir != "" { if err := os.MkdirAll(imagedir, 0o700); err != nil { return nil, err } } // Note: While the containers.lock file is in rundir for transient stores // we don't want to do this here, because the non-transient layers in // layers.json might be used externally as a read-only layer (using e.g. // additionalimagestores), and that would look for the lockfile in the // same directory var lockFiles []*lockfile.LockFile lockFile, err := lockfile.GetLockFile(filepath.Join(layerdir, "layers.lock")) if err != nil { return nil, err } lockFiles = append(lockFiles, lockFile) if imagedir != "" { lockFile, err := lockfile.GetLockFile(filepath.Join(imagedir, "layers.lock")) if err != nil { return nil, err } lockFiles = append(lockFiles, lockFile) } mountsLockfile, err := lockfile.GetLockFile(filepath.Join(rundir, "mountpoints.lock")) if err != nil { return nil, err } volatileDir := layerdir if transient { volatileDir = rundir } layersImageDir := "" if imagedir != "" { layersImageDir = filepath.Join(imagedir, "layers.json") } rlstore := layerStore{ lockfile: newMultipleLockFile(lockFiles...), mountsLockfile: mountsLockfile, rundir: rundir, jsonPath: [numLayerLocationIndex]string{ filepath.Join(layerdir, "layers.json"), layersImageDir, filepath.Join(volatileDir, "volatile-layers.json"), }, layerdir: layerdir, byid: make(map[string]*Layer), byname: make(map[string]*Layer), bymount: make(map[string]*Layer), driver: driver, } if err := rlstore.startWritingWithReload(false); err != nil { return nil, err } defer rlstore.stopWriting() lw, err := rlstore.lockfile.GetLastWrite() if err != nil { return nil, err } rlstore.lastWrite = lw // rlstore.mountsLastWrite is initialized inside rlstore.load(). if _, err := rlstore.load(true); err != nil { return nil, err } return &rlstore, nil } func newROLayerStore(rundir string, layerdir string, driver drivers.Driver) (roLayerStore, error) { lockfile, err := lockfile.GetROLockFile(filepath.Join(layerdir, "layers.lock")) if err != nil { return nil, err } rlstore := layerStore{ lockfile: newMultipleLockFile(lockfile), mountsLockfile: nil, rundir: rundir, jsonPath: [numLayerLocationIndex]string{ filepath.Join(layerdir, "layers.json"), "", filepath.Join(layerdir, "volatile-layers.json"), }, layerdir: layerdir, byid: make(map[string]*Layer), byname: make(map[string]*Layer), bymount: make(map[string]*Layer), driver: driver, } if err := rlstore.startReadingWithReload(false); err != nil { return nil, err } defer rlstore.stopReading() lw, err := rlstore.lockfile.GetLastWrite() if err != nil { return nil, err } rlstore.lastWrite = lw if _, err := rlstore.load(false); err != nil { return nil, err } return &rlstore, nil } // Requires startReading or startWriting. func (r *layerStore) lookup(id string) (*Layer, bool) { if layer, ok := r.byid[id]; ok { return layer, ok } else if layer, ok := r.byname[id]; ok { return layer, ok } else if longid, err := r.idindex.Get(id); err == nil { layer, ok := r.byid[longid] return layer, ok } return nil, false } // Requires startReading or startWriting. func (r *layerStore) Size(name string) (int64, error) { layer, ok := r.lookup(name) if !ok { return -1, ErrLayerUnknown } // We use the presence of a non-empty digest as an indicator that the size value was intentionally set, and that // a zero value is not just present because it was never set to anything else (which can happen if the layer was // created by a version of this library that didn't keep track of digest and size information). if layer.UncompressedDigest != "" || layer.TOCDigest != "" { return layer.UncompressedSize, nil // This may return -1 if only TOCDigest is set } return -1, nil } // Requires startWriting. func (r *layerStore) ClearFlag(id string, flag string) error { if !r.lockfile.IsReadWrite() { return fmt.Errorf("not allowed to clear flags on layers at %q: %w", r.layerdir, ErrStoreIsReadOnly) } layer, ok := r.lookup(id) if !ok { return ErrLayerUnknown } delete(layer.Flags, flag) return r.saveFor(layer) } // Requires startWriting. func (r *layerStore) SetFlag(id string, flag string, value any) error { if !r.lockfile.IsReadWrite() { return fmt.Errorf("not allowed to set flags on layers at %q: %w", r.layerdir, ErrStoreIsReadOnly) } layer, ok := r.lookup(id) if !ok { return ErrLayerUnknown } if layer.Flags == nil { layer.Flags = make(map[string]any) } layer.Flags[flag] = value return r.saveFor(layer) } func (r *layerStore) Status() ([][2]string, error) { return r.driver.Status(), nil } // Requires startWriting. func (r *layerStore) PutAdditionalLayer(id string, parentLayer *Layer, names []string, aLayer drivers.AdditionalLayer) (layer *Layer, err error) { if layer, err := r.checkIdOrNameConflict(id, names); err != nil { return layer, err } parent := "" if parentLayer != nil { parent = parentLayer.ID } info, err := aLayer.Info() if err != nil { return nil, err } defer info.Close() layer = &Layer{} if err := json.NewDecoder(info).Decode(layer); err != nil { return nil, err } layer.ID = id layer.Parent = parent layer.Created = time.Now().UTC() if err := aLayer.CreateAs(id, parent); err != nil { return nil, err } // TODO: check if necessary fields are filled r.layers = append(r.layers, layer) // This can only fail on duplicate IDs, which shouldn’t happen — and in // that case the index is already in the desired state anyway. // Implementing recovery from an unlikely and unimportant failure here // would be too risky. _ = r.idindex.Add(id) r.byid[id] = layer for _, name := range names { // names got from the additional layer store won't be used r.byname[name] = layer } if layer.CompressedDigest != "" { r.bycompressedsum[layer.CompressedDigest] = append(r.bycompressedsum[layer.CompressedDigest], layer.ID) } if layer.UncompressedDigest != "" { r.byuncompressedsum[layer.UncompressedDigest] = append(r.byuncompressedsum[layer.UncompressedDigest], layer.ID) } if layer.TOCDigest != "" { r.bytocsum[layer.TOCDigest] = append(r.bytocsum[layer.TOCDigest], layer.ID) } if err := r.saveFor(layer); err != nil { if e := r.deleteWhileHoldingLock(layer.ID); e != nil { logrus.Errorf("While recovering from a failure to save layers, error deleting layer %#v: %v", id, e) } return nil, err } return copyLayer(layer), nil } func (r *layerStore) pickStoreLocation(volatile, writeable bool) layerLocations { switch { case volatile: return volatileLayerLocation case !writeable && r.jsonPath[indexFromLayerLocation(imageStoreLayerLocation)] != "": return imageStoreLayerLocation default: return stableLayerLocation } } // checkIdOrNameConflict checks if the id or names are already in use and returns an // error in that case. As Special case if the layer already exists it returns it as // well together with the error. // // Requires startReading or startWriting. func (r *layerStore) checkIdOrNameConflict(id string, names []string) (*Layer, error) { if duplicateLayer, idInUse := r.byid[id]; idInUse { return duplicateLayer, ErrDuplicateID } for _, name := range names { if _, nameInUse := r.byname[name]; nameInUse { return nil, ErrDuplicateName } } return nil, nil } // Requires startWriting. func (r *layerStore) create(id string, parentLayer *Layer, names []string, mountLabel string, options map[string]string, moreOptions *LayerOptions, writeable bool, contents *layerCreationContents) (layer *Layer, size int64, err error) { if moreOptions == nil { moreOptions = &LayerOptions{} } if !r.lockfile.IsReadWrite() { return nil, -1, fmt.Errorf("not allowed to create new layers at %q: %w", r.layerdir, ErrStoreIsReadOnly) } if err := os.MkdirAll(r.rundir, 0o700); err != nil { return nil, -1, err } if err := os.MkdirAll(r.layerdir, 0o700); err != nil { return nil, -1, err } if id == "" { id = stringid.GenerateRandomID() _, idInUse := r.byid[id] for idInUse { id = stringid.GenerateRandomID() _, idInUse = r.byid[id] } } if layer, err := r.checkIdOrNameConflict(id, names); err != nil { return layer, -1, err } parent := "" if parentLayer != nil { parent = parentLayer.ID } var ( templateIDMappings *idtools.IDMappings templateMetadata string templateCompressedDigest digest.Digest templateCompressedSize int64 templateUncompressedDigest digest.Digest templateTOCDigest digest.Digest templateUncompressedSize int64 templateCompressionType archive.Compression templateUIDs, templateGIDs []uint32 templateTSdata []byte ) if moreOptions.TemplateLayer != "" { templateLayer, ok := r.lookup(moreOptions.TemplateLayer) if !ok { return nil, -1, ErrLayerUnknown } templateMetadata = templateLayer.Metadata templateIDMappings = idtools.NewIDMappingsFromMaps(templateLayer.UIDMap, templateLayer.GIDMap) templateTOCDigest = templateLayer.TOCDigest templateCompressedDigest, templateCompressedSize = templateLayer.CompressedDigest, templateLayer.CompressedSize templateUncompressedDigest, templateUncompressedSize = templateLayer.UncompressedDigest, templateLayer.UncompressedSize templateCompressionType = templateLayer.CompressionType templateUIDs, templateGIDs = slices.Clone(templateLayer.UIDs), slices.Clone(templateLayer.GIDs) templateTSdata, err = os.ReadFile(r.tspath(templateLayer.ID)) if err != nil && !errors.Is(err, os.ErrNotExist) { return nil, -1, err } } else { templateIDMappings = &idtools.IDMappings{} } if mountLabel != "" { selinux.ReserveLabel(mountLabel) } // Before actually creating the layer, make a persistent record of it // with the incomplete flag set, so that future processes have a chance // to clean up after it. layer = &Layer{ ID: id, Parent: parent, Names: names, MountLabel: mountLabel, Metadata: templateMetadata, Created: time.Now().UTC(), CompressedDigest: templateCompressedDigest, CompressedSize: templateCompressedSize, UncompressedDigest: templateUncompressedDigest, TOCDigest: templateTOCDigest, UncompressedSize: templateUncompressedSize, CompressionType: templateCompressionType, UIDs: templateUIDs, GIDs: templateGIDs, Flags: newMapFrom(moreOptions.Flags), UIDMap: copySlicePreferringNil(moreOptions.UIDMap), GIDMap: copySlicePreferringNil(moreOptions.GIDMap), BigDataNames: []string{}, location: r.pickStoreLocation(moreOptions.Volatile, writeable), } layer.Flags[incompleteFlag] = true r.layers = append(r.layers, layer) // This can only fail if the ID is already missing, which shouldn’t // happen — and in that case the index is already in the desired state // anyway. This is on various paths to recover from failures, so this // should be robust against partially missing data. _ = r.idindex.Add(id) r.byid[id] = layer for _, name := range names { r.byname[name] = layer } cleanupFailureContext := "" defer func() { if err != nil { // now that the in-memory structures know about the new // record, we can use regular Delete() to clean up if // anything breaks from here on out if cleanupFailureContext == "" { cleanupFailureContext = "unknown: cleanupFailureContext not set at the failure site" } if e := r.deleteWhileHoldingLock(id); e != nil { logrus.Errorf("While recovering from a failure (%s), error deleting layer %#v: %v", cleanupFailureContext, id, e) } } }() if err = r.saveFor(layer); err != nil { cleanupFailureContext = "saving incomplete layer metadata" return nil, -1, err } for _, item := range moreOptions.BigData { if err = r.setBigData(layer, item.Key, item.Data); err != nil { cleanupFailureContext = fmt.Sprintf("saving big data item %q", item.Key) return nil, -1, err } } idMappings := idtools.NewIDMappingsFromMaps(moreOptions.UIDMap, moreOptions.GIDMap) opts := drivers.CreateOpts{ MountLabel: mountLabel, StorageOpt: options, IDMappings: idMappings, } var parentMappings, oldMappings *idtools.IDMappings if parentLayer != nil { parentMappings = idtools.NewIDMappingsFromMaps(parentLayer.UIDMap, parentLayer.GIDMap) } else { parentMappings = &idtools.IDMappings{} } if moreOptions.TemplateLayer != "" { if err = r.driver.CreateFromTemplate(id, moreOptions.TemplateLayer, templateIDMappings, parent, parentMappings, &opts, writeable); err != nil { cleanupFailureContext = fmt.Sprintf("creating a layer from template layer %q", moreOptions.TemplateLayer) return nil, -1, fmt.Errorf("creating copy of template layer %q with ID %q: %w", moreOptions.TemplateLayer, id, err) } oldMappings = templateIDMappings } else { if writeable { if err = r.driver.CreateReadWrite(id, parent, &opts); err != nil { cleanupFailureContext = "creating a read-write layer" return nil, -1, fmt.Errorf("creating read-write layer with ID %q: %w", id, err) } } else { if err = r.driver.Create(id, parent, &opts); err != nil { cleanupFailureContext = "creating a read-only layer" return nil, -1, fmt.Errorf("creating read-only layer with ID %q: %w", id, err) } } if parentLayer != nil { oldMappings = parentMappings } } if oldMappings != nil && (!reflect.DeepEqual(oldMappings.UIDs(), idMappings.UIDs()) || !reflect.DeepEqual(oldMappings.GIDs(), idMappings.GIDs())) { if err = r.driver.UpdateLayerIDMap(id, oldMappings, idMappings, mountLabel); err != nil { cleanupFailureContext = "in UpdateLayerIDMap" return nil, -1, err } } if len(templateTSdata) > 0 { if err = os.MkdirAll(filepath.Dir(r.tspath(id)), 0o700); err != nil { cleanupFailureContext = "creating tar-split parent directory for a copy from template" return nil, -1, err } if err = ioutils.AtomicWriteFile(r.tspath(id), templateTSdata, 0o600); err != nil { cleanupFailureContext = "creating a tar-split copy from template" return nil, -1, err } } size = -1 if contents != nil { if contents.stagedLayerExtraction != nil { if contents.stagedLayerExtraction.result != nil { // The layer is staged, just commit it and update the metadata. if err := contents.stagedLayerExtraction.commitLayer(r, layer.ID); err != nil { cleanupFailureContext = "committing staged layer diff" return nil, -1, err } r.applyDiffResultToLayer(layer, contents.stagedLayerExtraction.result) } else { // The diff was not staged, apply it now here instead. if size, err = r.applyDiffWithOptions(layer.ID, moreOptions, contents.stagedLayerExtraction.diff); err != nil { cleanupFailureContext = "applying layer diff" return nil, -1, err } } } else { // staging logic for the chunked pull path if err := r.applyDiffFromStagingDirectory(layer.ID, contents.DiffOutput, contents.DiffOptions); err != nil { cleanupFailureContext = "applying staged directory diff" return nil, -1, err } } } else { // The layer creation content above would have updated r.bycompressedsum // and r.byuncompressedsum for us, but if we used a template // layer, we didn't call it, so add the new layer as candidates // for searches for layers by checksum if layer.CompressedDigest != "" { r.bycompressedsum[layer.CompressedDigest] = append(r.bycompressedsum[layer.CompressedDigest], layer.ID) } if layer.UncompressedDigest != "" { r.byuncompressedsum[layer.UncompressedDigest] = append(r.byuncompressedsum[layer.UncompressedDigest], layer.ID) } if layer.TOCDigest != "" { r.bytocsum[layer.TOCDigest] = append(r.bytocsum[layer.TOCDigest], layer.ID) } } delete(layer.Flags, incompleteFlag) if err = r.saveFor(layer); err != nil { cleanupFailureContext = "saving finished layer metadata" return nil, -1, err } layer = copyLayer(layer) return layer, size, err } // Requires startReading or startWriting. func (r *layerStore) Mounted(id string) (int, error) { if !r.lockfile.IsReadWrite() { return 0, fmt.Errorf("no mount information for layers at %q: %w", r.mountspath(), ErrStoreIsReadOnly) } layer, ok := r.lookup(id) if !ok { return 0, ErrLayerUnknown } // NOTE: The caller of this function is not holding (currently cannot hold) r.mountsLockfile, // so the data is necessarily obsolete by the time this function returns. So, we don’t even // try to reload it in this function, we just rely on r.load() that happened during // r.startReading() or r.startWriting(). return layer.MountCount, nil } // Requires startWriting. func (r *layerStore) Mount(id string, options drivers.MountOpts) (string, error) { // LOCKING BUG: This is reachable via store.Diff → layerStore.Diff → layerStore.newFileGetter // (with btrfs and zfs graph drivers) holding layerStore only locked for reading, while it modifies // - r.layers[].MountCount (directly and via loadMounts / saveMounts) // - r.layers[].MountPoint (directly and via loadMounts / saveMounts) // - r.bymount (via loadMounts / saveMounts) // You are not allowed to mount layers from readonly stores if they // are not mounted read/only. if !r.lockfile.IsReadWrite() && !slices.Contains(options.Options, "ro") { return "", fmt.Errorf("not allowed to update mount locations for layers at %q: %w", r.mountspath(), ErrStoreIsReadOnly) } r.mountsLockfile.Lock() defer r.mountsLockfile.Unlock() if err := r.reloadMountsIfChanged(); err != nil { return "", err } layer, ok := r.lookup(id) if !ok { return "", ErrLayerUnknown } if layer.MountCount > 0 { mounted, err := mount.Mounted(layer.MountPoint) if err != nil { return "", err } // If the container is not mounted then we have a condition // where the kernel umounted the mount point. This means // that the mount count never got decremented. if mounted { layer.MountCount++ return layer.MountPoint, r.saveMounts() } } if options.MountLabel == "" { options.MountLabel = layer.MountLabel } if (options.UidMaps != nil || options.GidMaps != nil) && !r.driver.SupportsShifting(options.UidMaps, options.GidMaps) { if !reflect.DeepEqual(options.UidMaps, layer.UIDMap) || !reflect.DeepEqual(options.GidMaps, layer.GIDMap) { return "", fmt.Errorf("cannot mount layer %v: shifting not enabled", layer.ID) } } mountpoint, err := r.driver.Get(id, options) if mountpoint != "" && err == nil { if layer.MountPoint != "" { delete(r.bymount, layer.MountPoint) } layer.MountPoint = filepath.Clean(mountpoint) layer.MountCount++ r.bymount[layer.MountPoint] = layer err = r.saveMounts() } return mountpoint, err } // Requires startWriting. func (r *layerStore) unmount(id string, force bool, conditional bool) (bool, error) { // LOCKING BUG: This is reachable via store.Diff → layerStore.Diff → layerStore.newFileGetter → simpleGetCloser.Close() // (with btrfs and zfs graph drivers) holding layerStore only locked for reading, while it modifies // - r.layers[].MountCount (directly and via loadMounts / saveMounts) // - r.layers[].MountPoint (directly and via loadMounts / saveMounts) // - r.bymount (via loadMounts / saveMounts) if !r.lockfile.IsReadWrite() { return false, fmt.Errorf("not allowed to update mount locations for layers at %q: %w", r.mountspath(), ErrStoreIsReadOnly) } r.mountsLockfile.Lock() defer r.mountsLockfile.Unlock() if err := r.reloadMountsIfChanged(); err != nil { return false, err } layer, ok := r.lookup(id) if !ok { layerByMount, ok := r.bymount[filepath.Clean(id)] if !ok { return false, ErrLayerUnknown } layer = layerByMount } if conditional && layer.MountCount == 0 { return false, ErrLayerNotMounted } if force { layer.MountCount = 1 } if layer.MountCount > 1 { layer.MountCount-- return true, r.saveMounts() } err := r.driver.Put(id) if err == nil || os.IsNotExist(err) { if layer.MountPoint != "" { delete(r.bymount, layer.MountPoint) } layer.MountCount-- layer.MountPoint = "" return false, r.saveMounts() } return true, err } // Requires startReading or startWriting. func (r *layerStore) ParentOwners(id string) (uids, gids []int, err error) { if !r.lockfile.IsReadWrite() { return nil, nil, fmt.Errorf("no mount information for layers at %q: %w", r.mountspath(), ErrStoreIsReadOnly) } r.mountsLockfile.RLock() defer r.mountsLockfile.Unlock() // We are not checking r.mountsLockfile.Modified() and calling r.loadMounts here because the store // is only locked for reading = we are not allowed to modify layer data. // Holding r.mountsLockfile protects us against concurrent mount/unmount operations. layer, ok := r.lookup(id) if !ok { return nil, nil, ErrLayerUnknown } if len(layer.UIDMap) == 0 && len(layer.GIDMap) == 0 { // We're not using any mappings, so there aren't any unmapped IDs on parent directories. return nil, nil, nil } if layer.MountPoint == "" { // We don't know which directories to examine. return nil, nil, ErrLayerNotMounted } // Holding r.mountsLockfile protects us against concurrent mount/unmount operations, but we didn’t // hold it continuously since the time we loaded the mount data; so it’s possible the layer // was unmounted in the meantime, or mounted elsewhere. Treat that as if we were run after the unmount, // = a missing mount, not a filesystem error. if _, err := system.Lstat(layer.MountPoint); errors.Is(err, os.ErrNotExist) { return nil, nil, ErrLayerNotMounted } rootuid, rootgid, err := idtools.GetRootUIDGID(layer.UIDMap, layer.GIDMap) if err != nil { return nil, nil, fmt.Errorf("reading root ID values for layer %q: %w", layer.ID, err) } m := idtools.NewIDMappingsFromMaps(layer.UIDMap, layer.GIDMap) fsuids := make(map[int]struct{}) fsgids := make(map[int]struct{}) for dir := filepath.Dir(layer.MountPoint); dir != "" && dir != string(os.PathSeparator); dir = filepath.Dir(dir) { st, err := system.Stat(dir) if err != nil { return nil, nil, fmt.Errorf("read directory ownership: %w", err) } lst, err := system.Lstat(dir) if err != nil { return nil, nil, err } fsuid := int(st.UID()) fsgid := int(st.GID()) if _, _, err := m.ToContainer(idtools.IDPair{UID: fsuid, GID: rootgid}); err != nil { fsuids[fsuid] = struct{}{} } if _, _, err := m.ToContainer(idtools.IDPair{UID: rootuid, GID: fsgid}); err != nil { fsgids[fsgid] = struct{}{} } fsuid = int(lst.UID()) fsgid = int(lst.GID()) if _, _, err := m.ToContainer(idtools.IDPair{UID: fsuid, GID: rootgid}); err != nil { fsuids[fsuid] = struct{}{} } if _, _, err := m.ToContainer(idtools.IDPair{UID: rootuid, GID: fsgid}); err != nil { fsgids[fsgid] = struct{}{} } } for uid := range fsuids { uids = append(uids, uid) } for gid := range fsgids { gids = append(gids, gid) } if len(uids) > 1 { sort.Ints(uids) } if len(gids) > 1 { sort.Ints(gids) } return uids, gids, nil } // Requires startWriting. func (r *layerStore) removeName(layer *Layer, name string) { layer.Names = stringSliceWithoutValue(layer.Names, name) } // Requires startWriting. func (r *layerStore) updateNames(id string, names []string, op updateNameOperation) error { if !r.lockfile.IsReadWrite() { return fmt.Errorf("not allowed to change layer name assignments at %q: %w", r.layerdir, ErrStoreIsReadOnly) } layer, ok := r.lookup(id) if !ok { return ErrLayerUnknown } oldNames := layer.Names names, err := applyNameOperation(oldNames, names, op) if err != nil { return err } for _, name := range oldNames { delete(r.byname, name) } for _, name := range names { if otherLayer, ok := r.byname[name]; ok { r.removeName(otherLayer, name) } r.byname[name] = layer } layer.Names = names return r.saveFor(layer) } func (r *layerStore) datadir(id string) string { return filepath.Join(r.layerdir, id) } func (r *layerStore) datapath(id, key string) string { return filepath.Join(r.datadir(id), makeBigDataBaseName(key)) } // Requires startReading or startWriting. func (r *layerStore) BigData(id, key string) (io.ReadCloser, error) { if key == "" { return nil, fmt.Errorf("can't retrieve layer big data value for empty name: %w", ErrInvalidBigDataName) } layer, ok := r.lookup(id) if !ok { return nil, fmt.Errorf("locating layer with ID %q: %w", id, ErrLayerUnknown) } return os.Open(r.datapath(layer.ID, key)) } // Requires startWriting. func (r *layerStore) SetBigData(id, key string, data io.Reader) error { if !r.lockfile.IsReadWrite() { return fmt.Errorf("not allowed to save data items associated with layers at %q: %w", r.layerdir, ErrStoreIsReadOnly) } layer, ok := r.lookup(id) if !ok { return fmt.Errorf("locating layer with ID %q to write bigdata: %w", id, ErrLayerUnknown) } return r.setBigData(layer, key, data) } func (r *layerStore) setBigData(layer *Layer, key string, data io.Reader) error { if key == "" { return fmt.Errorf("can't set empty name for layer big data item: %w", ErrInvalidBigDataName) } err := os.MkdirAll(r.datadir(layer.ID), 0o700) if err != nil { return err } // NewAtomicFileWriter doesn't overwrite/truncate the existing inode. // BigData() relies on this behaviour when opening the file for read // so that it is either accessing the old data or the new one. writer, err := ioutils.NewAtomicFileWriter(r.datapath(layer.ID, key), 0o600) if err != nil { return fmt.Errorf("opening bigdata file: %w", err) } if _, err := io.Copy(writer, data); err != nil { writer.Close() return fmt.Errorf("copying bigdata for the layer: %w", err) } if err := writer.Close(); err != nil { return fmt.Errorf("closing bigdata file for the layer: %w", err) } if !slices.Contains(layer.BigDataNames, key) { layer.BigDataNames = append(layer.BigDataNames, key) return r.saveFor(layer) } return nil } // Requires startReading or startWriting. func (r *layerStore) BigDataNames(id string) ([]string, error) { layer, ok := r.lookup(id) if !ok { return nil, fmt.Errorf("locating layer with ID %q to retrieve bigdata names: %w", id, ErrImageUnknown) } return copySlicePreferringNil(layer.BigDataNames), nil } // Requires startReading or startWriting. func (r *layerStore) Metadata(id string) (string, error) { if layer, ok := r.lookup(id); ok { return layer.Metadata, nil } return "", ErrLayerUnknown } // Requires startWriting. func (r *layerStore) SetMetadata(id, metadata string) error { if !r.lockfile.IsReadWrite() { return fmt.Errorf("not allowed to modify layer metadata at %q: %w", r.layerdir, ErrStoreIsReadOnly) } if layer, ok := r.lookup(id); ok { layer.Metadata = metadata return r.saveFor(layer) } return ErrLayerUnknown } func (r *layerStore) tspath(id string) string { return filepath.Join(r.layerdir, id+tarSplitSuffix) } // layerHasIncompleteFlag returns true if layer.Flags contains an incompleteFlag set to true // The caller must hold r.inProcessLock for reading. func layerHasIncompleteFlag(layer *Layer) bool { if layer.Flags == nil { return false } if flagValue, ok := layer.Flags[incompleteFlag]; ok { if b, ok := flagValue.(bool); ok && b { return true } } return false } // Requires startWriting. // Caller MUST run all returned cleanup functions after this, EVEN IF the function returns an error. // Ideally outside of the startWriting. func (r *layerStore) internalDelete(id string) ([]tempdir.CleanupTempDirFunc, error) { if !r.lockfile.IsReadWrite() { return nil, fmt.Errorf("not allowed to delete layers at %q: %w", r.layerdir, ErrStoreIsReadOnly) } layer, ok := r.lookup(id) if !ok { return nil, ErrLayerUnknown } // Ensure that if we are interrupted, the layer will be cleaned up. if !layerHasIncompleteFlag(layer) { if layer.Flags == nil { layer.Flags = make(map[string]any) } layer.Flags[incompleteFlag] = true if err := r.saveFor(layer); err != nil { return nil, err } } // We never unset incompleteFlag; below, we remove the entire object from r.layers. tempDirectory, err := tempdir.NewTempDir(filepath.Join(r.layerdir, tempDirPath)) cleanFunctions := []tempdir.CleanupTempDirFunc{} cleanFunctions = append(cleanFunctions, tempDirectory.Cleanup) if err != nil { return nil, err } id = layer.ID cleanFunc, err := r.driver.DeferredRemove(id) cleanFunctions = append(cleanFunctions, cleanFunc) if err != nil && !errors.Is(err, os.ErrNotExist) { return cleanFunctions, err } cleanFunctions = append(cleanFunctions, tempDirectory.Cleanup) if err := tempDirectory.StageDeletion(r.tspath(id)); err != nil && !errors.Is(err, os.ErrNotExist) { return cleanFunctions, err } if err := tempDirectory.StageDeletion(r.datadir(id)); err != nil && !errors.Is(err, os.ErrNotExist) { return cleanFunctions, err } delete(r.byid, id) for _, name := range layer.Names { delete(r.byname, name) } // This can only fail if the ID is already missing, which shouldn’t // happen — and in that case the index is already in the desired state // anyway. The store’s Delete method is used on various paths to // recover from failures, so this should be robust against partially // missing data. _ = r.idindex.Delete(id) mountLabel := layer.MountLabel if layer.MountPoint != "" { delete(r.bymount, layer.MountPoint) } r.deleteInDigestMap(id) r.layers = slices.DeleteFunc(r.layers, func(candidate *Layer) bool { return candidate.ID == id }) if mountLabel != "" && !slices.ContainsFunc(r.layers, func(candidate *Layer) bool { return candidate.MountLabel == mountLabel }) { selinux.ReleaseLabel(mountLabel) } return cleanFunctions, nil } // Requires startWriting. func (r *layerStore) deleteInDigestMap(id string) { for digest, layers := range r.bycompressedsum { if i := slices.Index(layers, id); i != -1 { layers = slices.Delete(layers, i, i+1) r.bycompressedsum[digest] = layers } } for digest, layers := range r.byuncompressedsum { if i := slices.Index(layers, id); i != -1 { layers = slices.Delete(layers, i, i+1) r.byuncompressedsum[digest] = layers } } } // Requires startWriting. // This is soft-deprecated and should not have any new callers; use deferredDelete instead. func (r *layerStore) deleteWhileHoldingLock(id string) error { cleanupFunctions, deferErr := r.deferredDelete(id) cleanupErr := tempdir.CleanupTemporaryDirectories(cleanupFunctions...) return errors.Join(deferErr, cleanupErr) } // Requires startWriting. // Caller MUST run all returned cleanup functions after this, EVEN IF the function returns an error. // Ideally outside of the startWriting. func (r *layerStore) deferredDelete(id string) ([]tempdir.CleanupTempDirFunc, error) { layer, ok := r.lookup(id) if !ok { return nil, ErrLayerUnknown } id = layer.ID // The layer may already have been explicitly unmounted, but if not, we // should try to clean that up before we start deleting anything at the // driver level. for { _, err := r.unmount(id, false, true) if err == ErrLayerNotMounted { break } if err != nil { return nil, err } } cleanFunctions, err := r.internalDelete(id) if err != nil { return cleanFunctions, err } return cleanFunctions, r.saveFor(layer) } // Requires startReading or startWriting. func (r *layerStore) Exists(id string) bool { _, ok := r.lookup(id) return ok } // Requires startReading or startWriting. func (r *layerStore) Get(id string) (*Layer, error) { if layer, ok := r.lookup(id); ok { return copyLayer(layer), nil } return nil, ErrLayerUnknown } // Requires startWriting. func (r *layerStore) Wipe() error { if !r.lockfile.IsReadWrite() { return fmt.Errorf("not allowed to delete layers at %q: %w", r.layerdir, ErrStoreIsReadOnly) } ids := make([]string, 0, len(r.byid)) for id := range r.byid { ids = append(ids, id) } slices.SortFunc(ids, func(a, b string) int { return -r.byid[a].Created.Compare(r.byid[b].Created) }) for _, id := range ids { if err := r.deleteWhileHoldingLock(id); err != nil { return err } } ids, err := r.driver.ListLayers() if err != nil { if !errors.Is(err, drivers.ErrNotSupported) { return err } ids = nil } for _, id := range ids { if err := r.driver.Remove(id); err != nil { return err } } return nil } // Requires startReading or startWriting. func (r *layerStore) findParentAndLayer(from, to string) (fromID string, toID string, fromLayer, toLayer *Layer, err error) { var ok bool toLayer, ok = r.lookup(to) if !ok { return "", "", nil, nil, ErrLayerUnknown } to = toLayer.ID if from == "" { from = toLayer.Parent } if from != "" { fromLayer, ok = r.lookup(from) if ok { from = fromLayer.ID } else { fromLayer, ok = r.lookup(toLayer.Parent) if ok { from = fromLayer.ID } } } return from, to, fromLayer, toLayer, nil } // The caller must hold r.inProcessLock for reading. func (r *layerStore) layerMappings(layer *Layer) *idtools.IDMappings { if layer == nil { return &idtools.IDMappings{} } return idtools.NewIDMappingsFromMaps(layer.UIDMap, layer.GIDMap) } // Requires startReading or startWriting. // // NOTE: Overlay’s implementation assumes use of an exclusive lock over the primary layer store, // see drivers/overlay.Driver.getMergedDir. func (r *layerStore) Changes(from, to string) ([]archive.Change, error) { from, to, fromLayer, toLayer, err := r.findParentAndLayer(from, to) if err != nil { return nil, ErrLayerUnknown } return r.driver.Changes(to, r.layerMappings(toLayer), from, r.layerMappings(fromLayer), toLayer.MountLabel) } type simpleGetCloser struct { r *layerStore path string id string } func (s *simpleGetCloser) Get(path string) (io.ReadCloser, error) { return os.Open(filepath.Join(s.path, path)) } // LOCKING BUG: See the comments in layerStore.Diff func (s *simpleGetCloser) Close() error { _, err := s.r.unmount(s.id, false, false) return err } // LOCKING BUG: See the comments in layerStore.Diff func (r *layerStore) newFileGetter(id string) (drivers.FileGetCloser, error) { if getter, ok := r.driver.(drivers.DiffGetterDriver); ok { fgc, err := getter.DiffGetter(id) if err != nil { return nil, err } if fgc != nil { return fgc, nil } } path, err := r.Mount(id, drivers.MountOpts{Options: []string{"ro"}}) if err != nil { return nil, err } return &simpleGetCloser{ r: r, path: path, id: id, }, nil } // writeCompressedData copies data from source to compressor, which is on top of pwriter. func writeCompressedData(compressor io.WriteCloser, source io.ReadCloser) error { defer compressor.Close() defer source.Close() _, err := io.Copy(compressor, source) return err } // writeCompressedDataGoroutine copies data from source to compressor, which is on top of pwriter. // All error must be reported by updating pwriter. func writeCompressedDataGoroutine(pwriter *io.PipeWriter, compressor io.WriteCloser, source io.ReadCloser) { err := errors.New("internal error: unexpected panic in writeCompressedDataGoroutine") defer func() { // Note that this is not the same as {defer dest.CloseWithError(err)}; we need err to be evaluated lazily. _ = pwriter.CloseWithError(err) // CloseWithError(nil) is equivalent to Close(), always returns nil }() err = writeCompressedData(compressor, source) } // Requires startReading or startWriting. // // NOTE: Overlay’s implementation assumes use of an exclusive lock over the primary layer store, // see drivers/overlay.Driver.getMergedDir. func (r *layerStore) Diff(from, to string, options *DiffOptions) (io.ReadCloser, error) { var metadata storage.Unpacker from, to, fromLayer, toLayer, err := r.findParentAndLayer(from, to) if err != nil { return nil, ErrLayerUnknown } // Default to applying the type of compression that we noted was used // for the layerdiff when it was applied. compression := toLayer.CompressionType // If a particular compression type (or no compression) was selected, // use that instead. if options != nil && options.Compression != nil { compression = *options.Compression } maybeCompressReadCloser := func(rc io.ReadCloser) (io.ReadCloser, error) { // Depending on whether or not compression is desired, return either the // passed-in ReadCloser, or a new one that provides its readers with a // compressed version of the data that the original would have provided // to its readers. if compression == archive.Uncompressed { return rc, nil } preader, pwriter := io.Pipe() compressor, err := archive.CompressStream(pwriter, compression) if err != nil { rc.Close() pwriter.Close() preader.Close() return nil, err } go writeCompressedDataGoroutine(pwriter, compressor, rc) return preader, nil } if from != toLayer.Parent { diff, err := r.driver.Diff(to, r.layerMappings(toLayer), from, r.layerMappings(fromLayer), toLayer.MountLabel) if err != nil { return nil, err } return maybeCompressReadCloser(diff) } if ad, ok := r.driver.(drivers.AdditionalLayerStoreDriver); ok { if aLayer, err := ad.LookupAdditionalLayerByID(to); err == nil { // This is an additional layer. We leverage blob API for acquiring the reproduced raw blob. info, err := aLayer.Info() if err != nil { aLayer.Release() return nil, err } defer info.Close() layer := &Layer{} if err := json.NewDecoder(info).Decode(layer); err != nil { aLayer.Release() return nil, err } blob, err := aLayer.Blob() if err != nil { aLayer.Release() return nil, err } // If layer compression type is different from the expected one, decompress and convert it. if compression != layer.CompressionType { diff, err := archive.DecompressStream(blob) if err != nil { if err2 := blob.Close(); err2 != nil { err = fmt.Errorf("failed to close blob file: %v: %w", err2, err) } aLayer.Release() return nil, err } rc, err := maybeCompressReadCloser(diff) if err != nil { if err2 := closeAll(blob.Close, diff.Close); err2 != nil { err = fmt.Errorf("failed to cleanup: %v: %w", err2, err) } aLayer.Release() return nil, err } return ioutils.NewReadCloserWrapper(rc, func() error { defer aLayer.Release() return closeAll(blob.Close, rc.Close) }), nil } return ioutils.NewReadCloserWrapper(blob, func() error { defer aLayer.Release(); return blob.Close() }), nil } } tsfile, err := os.Open(r.tspath(to)) if err != nil { if !os.IsNotExist(err) { return nil, err } diff, err := r.driver.Diff(to, r.layerMappings(toLayer), from, r.layerMappings(fromLayer), toLayer.MountLabel) if err != nil { return nil, err } return maybeCompressReadCloser(diff) } decompressor, err := pgzip.NewReader(tsfile) if err != nil { if e := tsfile.Close(); e != nil { logrus.Debug(e) } return nil, err } metadata = storage.NewJSONUnpacker(decompressor) // LOCKING BUG: With btrfs and zfs graph drivers), this uses r.Mount() and r.unmount() holding layerStore only locked for reading // but they modify in-memory state. fgetter, err := r.newFileGetter(to) if err != nil { errs := fmt.Errorf("creating file-getter: %w", err) if err := decompressor.Close(); err != nil { errs = errors.Join(errs, fmt.Errorf("closing decompressor: %w", err)) } if err := tsfile.Close(); err != nil { errs = errors.Join(errs, fmt.Errorf("closing tarstream headers: %w", err)) } return nil, errs } tarstream := asm.NewOutputTarStream(fgetter, metadata) rc := ioutils.NewReadCloserWrapper(tarstream, func() error { var errs error if err := decompressor.Close(); err != nil { errs = errors.Join(errs, fmt.Errorf("closing decompressor: %w", err)) } if err := tsfile.Close(); err != nil { errs = errors.Join(errs, fmt.Errorf("closing tarstream headers: %w", err)) } if err := tarstream.Close(); err != nil { errs = errors.Join(errs, fmt.Errorf("closing reconstructed tarstream: %w", err)) } if err := fgetter.Close(); err != nil { errs = errors.Join(errs, fmt.Errorf("closing file-getter: %w", err)) } if errs != nil { return errs } return nil }) return maybeCompressReadCloser(rc) } // Requires startReading or startWriting. func (r *layerStore) DiffSize(from, to string) (size int64, err error) { var fromLayer, toLayer *Layer from, to, fromLayer, toLayer, err = r.findParentAndLayer(from, to) if err != nil { return -1, ErrLayerUnknown } return r.driver.DiffSize(to, r.layerMappings(toLayer), from, r.layerMappings(fromLayer), toLayer.MountLabel) } func updateDigestMap(m *map[digest.Digest][]string, oldvalue, newvalue digest.Digest, id string) { var newList []string if oldvalue != "" { for _, value := range (*m)[oldvalue] { if value != id { newList = append(newList, value) } } if len(newList) > 0 { (*m)[oldvalue] = newList } else { delete(*m, oldvalue) } } if newvalue != "" { (*m)[newvalue] = append((*m)[newvalue], id) } } // Requires startWriting. func (r *layerStore) ApplyDiff(to string, diff io.Reader) (size int64, err error) { return r.applyDiffWithOptions(to, nil, diff) } func createTarSplitFile(r *layerStore, layerID string) (*os.File, error) { if err := os.MkdirAll(filepath.Dir(r.tspath(layerID)), 0o700); err != nil { return nil, err } return os.OpenFile(r.tspath(layerID), os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0o600) } // newMaybeStagedLayerExtraction initializes a new maybeStagedLayerExtraction. The caller // must call maybeStagedLayerExtraction.cleanup() to remove any temporary files. func (r *layerStore) newMaybeStagedLayerExtraction(diff io.Reader) *maybeStagedLayerExtraction { m := &maybeStagedLayerExtraction{ diff: diff, } if d, ok := r.driver.(drivers.ApplyDiffStaging); ok { m.staging = d } return m } func (sl *maybeStagedLayerExtraction) cleanup() error { return tempdir.CleanupTemporaryDirectories(sl.cleanupFuncs...) } // stageWithUnlockedStore stages the layer content without needing the store locked. // If the driver does not support stage addition then this is a NOP and does nothing. // This should be done without holding the storage lock, if a parent is given the caller // must check for existence beforehand while holding a lock. func (r *layerStore) stageWithUnlockedStore(sl *maybeStagedLayerExtraction, parent string, layerOptions *LayerOptions) (retErr error) { if sl.staging == nil { return nil } td, err := tempdir.NewTempDir(filepath.Join(r.layerdir, tempDirPath)) if err != nil { return err } sl.cleanupFuncs = append(sl.cleanupFuncs, td.Cleanup) stagedTarSplit, err := td.StageAddition() if err != nil { return err } sl.stagedTarSplit = stagedTarSplit f, err := os.OpenFile(stagedTarSplit.Path, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0o600) if err != nil { return err } // make sure to check for errors on close and return that one. defer func() { closeErr := f.Close() if retErr == nil { retErr = closeErr } }() result, err := applyDiff(layerOptions, sl.diff, f, func(payload io.Reader) (int64, error) { cleanup, stagedLayer, size, err := sl.staging.StartStagingDiffToApply(parent, drivers.ApplyDiffOpts{ Diff: payload, Mappings: idtools.NewIDMappingsFromMaps(layerOptions.UIDMap, layerOptions.GIDMap), // MountLabel is not supported for the unlocked extraction, see the comment in (*store).PutLayer() MountLabel: "", }) sl.cleanupFuncs = append(sl.cleanupFuncs, cleanup) sl.stagedLayer = stagedLayer return size, err }) if err != nil { return err } if err := f.Sync(); err != nil { return fmt.Errorf("sync staged tar-split file: %w", err) } sl.result = result return nil } // commitLayer() commits the content that was staged in stageWithUnlockedStore() // // Requires startWriting. func (sl *maybeStagedLayerExtraction) commitLayer(r *layerStore, layerID string) error { err := sl.stagedTarSplit.Commit(r.tspath(layerID)) if err != nil { return err } return sl.staging.CommitStagedLayer(layerID, sl.stagedLayer) } // applyDiff can be called without holding any store locks so if the supplied // applyDriverFunc requires locking the caller must ensure proper locking. func applyDiff(layerOptions *LayerOptions, diff io.Reader, tarSplitFile *os.File, applyDriverFunc func(io.Reader) (int64, error)) (*applyDiffResult, error) { header := make([]byte, 10240) n, err := diff.Read(header) if err != nil && err != io.EOF { return nil, err } compression := archive.DetectCompression(header[:n]) defragmented := io.MultiReader(bytes.NewReader(header[:n]), diff) result := applyDiffResult{} var compressedDigester, uncompressedDigester digest.Digester // = nil if layerOptions != nil && layerOptions.OriginalDigest != "" && layerOptions.OriginalDigest.Algorithm() == digest.Canonical { result.compressedDigest = layerOptions.OriginalDigest } else { compressedDigester = digest.Canonical.Digester() } if layerOptions != nil && layerOptions.UncompressedDigest != "" && layerOptions.UncompressedDigest.Algorithm() == digest.Canonical { result.uncompressedDigest = layerOptions.UncompressedDigest } else if compression != archive.Uncompressed { uncompressedDigester = digest.Canonical.Digester() } var compressedWriter io.Writer if compressedDigester != nil { compressedWriter = compressedDigester.Hash() } else { compressedWriter = io.Discard } compressedCounter := ioutils.NewWriteCounter(compressedWriter) defragmented = io.TeeReader(defragmented, compressedCounter) tarSplitWriter := pools.BufioWriter32KPool.Get(tarSplitFile) defer pools.BufioWriter32KPool.Put(tarSplitWriter) uidLog := make(map[uint32]struct{}) gidLog := make(map[uint32]struct{}) var uncompressedCounter *ioutils.WriteCounter size, err := func() (int64, error) { // A scope for defer compressor, err := pgzip.NewWriterLevel(tarSplitWriter, pgzip.BestSpeed) if err != nil { return -1, err } defer compressor.Close() // This must happen before tsdata is consumed. if err := compressor.SetConcurrency(1024*1024, 1); err != nil { // 1024*1024 is the hard-coded default; we're not changing that logrus.Infof("setting compression concurrency threads to 1: %v; ignoring", err) } metadata := storage.NewJSONPacker(compressor) uncompressed, err := archive.DecompressStream(defragmented) if err != nil { return -1, err } defer uncompressed.Close() idLogger, err := tarlog.NewLogger(func(h *tar.Header) { if !strings.HasPrefix(path.Base(h.Name), archive.WhiteoutPrefix) { uidLog[uint32(h.Uid)] = struct{}{} gidLog[uint32(h.Gid)] = struct{}{} } }) if err != nil { return -1, err } defer idLogger.Close() // This must happen before uidLog and gidLog is consumed. uncompressedCounter = ioutils.NewWriteCounter(idLogger) uncompressedWriter := (io.Writer)(uncompressedCounter) if uncompressedDigester != nil { uncompressedWriter = io.MultiWriter(uncompressedWriter, uncompressedDigester.Hash()) } payload, err := asm.NewInputTarStream(io.TeeReader(uncompressed, uncompressedWriter), metadata, storage.NewDiscardFilePutter()) if err != nil { return -1, err } size, err := applyDriverFunc(payload) if err != nil { return -1, err } // Fully consume the payload; it may contain trailing zero padding, and we need all of that // recorded in tar-split (which happens when the data passes through NewInputTarStream). if _, err := io.Copy(io.Discard, payload); err != nil { return -1, err } return size, nil }() if err != nil { return nil, err } if err := tarSplitWriter.Flush(); err != nil { return nil, fmt.Errorf("failed to flush tar-split writer buffer: %w", err) } if compressedDigester != nil { result.compressedDigest = compressedDigester.Digest() } if uncompressedDigester != nil { result.uncompressedDigest = uncompressedDigester.Digest() } if result.uncompressedDigest == "" && compression == archive.Uncompressed { result.uncompressedDigest = result.compressedDigest } if layerOptions != nil && layerOptions.OriginalDigest != "" && layerOptions.OriginalSize != nil { result.compressedSize = *layerOptions.OriginalSize } else { result.compressedSize = compressedCounter.Count } result.uncompressedSize = uncompressedCounter.Count result.compressionType = compression result.uids = make([]uint32, 0, len(uidLog)) for uid := range uidLog { result.uids = append(result.uids, uid) } slices.Sort(result.uids) result.gids = make([]uint32, 0, len(gidLog)) for gid := range gidLog { result.gids = append(result.gids, gid) } slices.Sort(result.gids) result.size = size return &result, err } // Requires startWriting. func (r *layerStore) applyDiffWithOptions(to string, layerOptions *LayerOptions, diff io.Reader) (_ int64, retErr error) { if !r.lockfile.IsReadWrite() { return -1, fmt.Errorf("not allowed to modify layer contents at %q: %w", r.layerdir, ErrStoreIsReadOnly) } layer, ok := r.lookup(to) if !ok { return -1, ErrLayerUnknown } tarSplitFile, err := createTarSplitFile(r, layer.ID) if err != nil { return -1, err } // make sure to check for errors on close and return that one. defer func() { closeErr := tarSplitFile.Close() if retErr == nil { retErr = closeErr } }() result, err := applyDiff(layerOptions, diff, tarSplitFile, func(payload io.Reader) (int64, error) { options := drivers.ApplyDiffOpts{ Diff: payload, Mappings: r.layerMappings(layer), MountLabel: layer.MountLabel, } return r.driver.ApplyDiff(layer.ID, options) }) if err != nil { return -1, err } if err := tarSplitFile.Sync(); err != nil { return -1, fmt.Errorf("sync tar-split file: %w", err) } r.applyDiffResultToLayer(layer, result) err = r.saveFor(layer) return result.size, err } // Requires startWriting. func (r *layerStore) applyDiffResultToLayer(layer *Layer, result *applyDiffResult) { updateDigestMap(&r.bycompressedsum, layer.CompressedDigest, result.compressedDigest, layer.ID) layer.CompressedDigest = result.compressedDigest layer.CompressedSize = result.compressedSize updateDigestMap(&r.byuncompressedsum, layer.UncompressedDigest, result.uncompressedDigest, layer.ID) layer.UncompressedDigest = result.uncompressedDigest layer.UncompressedSize = result.uncompressedSize layer.CompressionType = result.compressionType layer.UIDs = result.uids layer.GIDs = result.gids } // Requires (startReading or?) startWriting. func (r *layerStore) DifferTarget(id string) (string, error) { ddriver, ok := r.driver.(drivers.DriverWithDiffer) if !ok { return "", ErrNotSupported } layer, ok := r.lookup(id) if !ok { return "", ErrLayerUnknown } return ddriver.DifferTarget(layer.ID) } // Requires startWriting. func (r *layerStore) applyDiffFromStagingDirectory(id string, diffOutput *drivers.DriverWithDifferOutput, options *drivers.ApplyDiffWithDifferOpts) (retErr error) { ddriver, ok := r.driver.(drivers.DriverWithDiffer) if !ok { return ErrNotSupported } layer, ok := r.lookup(id) if !ok { return ErrLayerUnknown } if options == nil { options = &drivers.ApplyDiffWithDifferOpts{ ApplyDiffOpts: drivers.ApplyDiffOpts{ Mappings: r.layerMappings(layer), MountLabel: layer.MountLabel, }, Flags: nil, } } err := ddriver.ApplyDiffFromStagingDirectory(layer.ID, layer.Parent, diffOutput, options) if err != nil { return err } layer.UIDs = diffOutput.UIDs layer.GIDs = diffOutput.GIDs updateDigestMap(&r.byuncompressedsum, layer.UncompressedDigest, diffOutput.UncompressedDigest, layer.ID) layer.UncompressedDigest = diffOutput.UncompressedDigest updateDigestMap(&r.bycompressedsum, layer.CompressedDigest, diffOutput.CompressedDigest, layer.ID) layer.CompressedDigest = diffOutput.CompressedDigest updateDigestMap(&r.bytocsum, layer.TOCDigest, diffOutput.TOCDigest, layer.ID) layer.TOCDigest = diffOutput.TOCDigest layer.UncompressedSize = diffOutput.Size layer.Metadata = diffOutput.Metadata if options != nil && options.Flags != nil { if layer.Flags == nil { layer.Flags = make(map[string]any) } maps.Copy(layer.Flags, options.Flags) } if err = r.saveFor(layer); err != nil { return err } if diffOutput.TarSplit != nil { tarSplitFile, err := createTarSplitFile(r, layer.ID) if err != nil { return err } // make sure to check for errors on close and return that one. defer func() { closeErr := tarSplitFile.Close() if retErr == nil { retErr = closeErr } }() tarSplitWriter := pools.BufioWriter32KPool.Get(tarSplitFile) defer pools.BufioWriter32KPool.Put(tarSplitWriter) compressor, err := pgzip.NewWriterLevel(tarSplitWriter, pgzip.BestSpeed) if err != nil { compressor = pgzip.NewWriter(tarSplitWriter) } if _, err := diffOutput.TarSplit.Seek(0, io.SeekStart); err != nil { return err } if err := compressor.SetConcurrency(1024*1024, 1); err != nil { // 1024*1024 is the hard-coded default; we're not changing that logrus.Infof("setting compression concurrency threads to 1: %v; ignoring", err) } if _, err := diffOutput.TarSplit.WriteTo(compressor); err != nil { compressor.Close() return err } compressor.Close() if err := tarSplitWriter.Flush(); err != nil { return fmt.Errorf("failed to flush tar-split writer buffer: %w", err) } if err := tarSplitFile.Sync(); err != nil { return fmt.Errorf("sync tar-split file: %w", err) } } for k, v := range diffOutput.BigData { if err := r.SetBigData(id, k, bytes.NewReader(v)); err != nil { if err2 := r.deleteWhileHoldingLock(id); err2 != nil { logrus.Errorf("While recovering from a failure to set big data, error deleting layer %#v: %v", id, err2) } return err } } return err } // It must be called without any c/storage locks held to allow differ to make c/storage calls. func (r *layerStore) applyDiffWithDifferNoLock(options *drivers.ApplyDiffWithDifferOpts, differ drivers.Differ) (*drivers.DriverWithDifferOutput, error) { ddriver, ok := r.driver.(drivers.DriverWithDiffer) if !ok { return nil, ErrNotSupported } output, err := ddriver.ApplyDiffWithDiffer(options, differ) return &output, err } func (r *layerStore) CleanupStagingDirectory(stagingDirectory string) error { ddriver, ok := r.driver.(drivers.DriverWithDiffer) if !ok { return ErrNotSupported } return ddriver.CleanupStagingDirectory(stagingDirectory) } // Requires startReading or startWriting. func (r *layerStore) layersByDigestMap(m map[digest.Digest][]string, d digest.Digest) ([]Layer, error) { var layers []Layer for _, layerID := range m[d] { layer, ok := r.lookup(layerID) if !ok { return nil, ErrLayerUnknown } layers = append(layers, *copyLayer(layer)) } return layers, nil } // Requires startReading or startWriting. func (r *layerStore) LayersByCompressedDigest(d digest.Digest) ([]Layer, error) { return r.layersByDigestMap(r.bycompressedsum, d) } // Requires startReading or startWriting. func (r *layerStore) LayersByUncompressedDigest(d digest.Digest) ([]Layer, error) { return r.layersByDigestMap(r.byuncompressedsum, d) } // Requires startReading or startWriting. func (r *layerStore) LayersByTOCDigest(d digest.Digest) ([]Layer, error) { return r.layersByDigestMap(r.bytocsum, d) } // Requires startWriting. func (r *layerStore) dedup(req drivers.DedupArgs) (drivers.DedupResult, error) { return r.driver.Dedup(req) } func closeAll(closes ...func() error) (rErr error) { for _, f := range closes { if err := f(); err != nil { if rErr == nil { rErr = fmt.Errorf("close error: %w", err) continue } rErr = fmt.Errorf("%v: %w", err, rErr) } } return rErr } ================================================ FILE: vendor/go.podman.io/storage/lockfile_compat.go ================================================ package storage import ( "go.podman.io/storage/pkg/lockfile" ) // Deprecated: Use lockfile.*LockFile. type Locker = lockfile.Locker //nolint:staticcheck // SA1019 lockfile.Locker is deprecated // Deprecated: Use lockfile.GetLockFile. func GetLockfile(path string) (lockfile.Locker, error) { return lockfile.GetLockfile(path) } // Deprecated: Use lockfile.GetROLockFile. func GetROLockfile(path string) (lockfile.Locker, error) { return lockfile.GetROLockfile(path) } ================================================ FILE: vendor/go.podman.io/storage/pkg/archive/README.md ================================================ This code provides helper functions for dealing with archive files. ================================================ FILE: vendor/go.podman.io/storage/pkg/archive/archive.go ================================================ package archive import ( "archive/tar" "bufio" "bytes" "compress/bzip2" "errors" "fmt" "io" "io/fs" "os" "path/filepath" "runtime" "strconv" "strings" "sync" "syscall" "time" gzip "github.com/klauspost/pgzip" "github.com/sirupsen/logrus" "github.com/ulikunitz/xz" "go.podman.io/storage/pkg/fileutils" "go.podman.io/storage/pkg/idtools" "go.podman.io/storage/pkg/pools" "go.podman.io/storage/pkg/promise" "go.podman.io/storage/pkg/system" "go.podman.io/storage/pkg/unshare" ) type ( // Compression is the state represents if compressed or not. Compression int // WhiteoutFormat is the format of whiteouts unpacked WhiteoutFormat int // TarOptions wraps the tar options. TarOptions struct { IncludeFiles []string ExcludePatterns []string Compression Compression NoLchown bool UIDMaps []idtools.IDMap GIDMaps []idtools.IDMap IgnoreChownErrors bool ChownOpts *idtools.IDPair IncludeSourceDir bool // WhiteoutFormat is the expected on disk format for whiteout files. // This format will be converted to the standard format on pack // and from the standard format on unpack. WhiteoutFormat WhiteoutFormat // This is additional data to be used by the converter. It will // not survive a round trip through JSON, so it's primarily // intended for generating archives (i.e., converting writes). WhiteoutData any // When unpacking, specifies whether overwriting a directory with a // non-directory is allowed and vice versa. NoOverwriteDirNonDir bool // For each include when creating an archive, the included name will be // replaced with the matching name from this map. RebaseNames map[string]string InUserNS bool // CopyPass indicates that the contents of any archive we're creating // will instantly be extracted and written to disk, so we can deviate // from the traditional behavior/format to get features like subsecond // precision in timestamps. CopyPass bool // ForceMask, if set, indicates the permission mask used for created files. ForceMask *os.FileMode // Timestamp, if set, will be set in each header as create/mod/access time Timestamp *time.Time } ) const PaxSchilyXattr = "SCHILY.xattr." const ( tarExt = "tar" windows = "windows" darwin = "darwin" ) var xattrsToIgnore = map[string]any{ "security.selinux": true, } // Archiver allows the reuse of most utility functions of this package with a // pluggable Untar function. To facilitate the passing of specific id mappings // for untar, an archiver can be created with maps which will then be passed to // Untar operations. If ChownOpts is set, its values are mapped using // UntarIDMappings before being used to create files and directories on disk. type Archiver struct { Untar func(io.Reader, string, *TarOptions) error TarIDMappings *idtools.IDMappings ChownOpts *idtools.IDPair UntarIDMappings *idtools.IDMappings } // NewDefaultArchiver returns a new Archiver without any IDMappings func NewDefaultArchiver() *Archiver { return &Archiver{Untar: Untar, TarIDMappings: &idtools.IDMappings{}, UntarIDMappings: &idtools.IDMappings{}} } // breakoutError is used to differentiate errors related to breaking out // When testing archive breakout in the unit tests, this error is expected // in order for the test to pass. type breakoutError error // overwriteError is used to differentiate errors related to attempting to // overwrite a directory with a non-directory or vice-versa. When testing // copying a file over a directory, this error is expected in order for the // test to pass. type overwriteError error const ( // Uncompressed represents the uncompressed. Uncompressed Compression = iota // Bzip2 is bzip2 compression algorithm. Bzip2 // Gzip is gzip compression algorithm. Gzip // Xz is xz compression algorithm. Xz // Zstd is zstd compression algorithm. Zstd ) const ( // AUFSWhiteoutFormat is the default format for whiteouts AUFSWhiteoutFormat WhiteoutFormat = iota // OverlayWhiteoutFormat formats whiteout according to the overlay // standard. OverlayWhiteoutFormat ) // IsArchivePath checks if the (possibly compressed) file at the given path // starts with a tar file header. func IsArchivePath(path string) bool { file, err := os.Open(path) if err != nil { return false } defer file.Close() rdr, err := DecompressStream(file) if err != nil { return false } defer rdr.Close() r := tar.NewReader(rdr) _, err = r.Next() return err == nil } // DetectCompression detects the compression algorithm of the source. func DetectCompression(source []byte) Compression { for compression, m := range map[Compression][]byte{ Bzip2: {0x42, 0x5A, 0x68}, Gzip: {0x1F, 0x8B, 0x08}, Xz: {0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00}, Zstd: {0x28, 0xb5, 0x2f, 0xfd}, } { if len(source) < len(m) { logrus.Debug("Len too short") continue } if bytes.Equal(m, source[:len(m)]) { return compression } } return Uncompressed } // DecompressStream decompresses the archive and returns a ReaderCloser with the decompressed archive. func DecompressStream(archive io.Reader) (_ io.ReadCloser, Err error) { p := pools.BufioReader32KPool buf := p.Get(archive) bs, err := buf.Peek(10) defer func() { if Err != nil { // In the normal case, the buffer is embedded in the ReadCloser return. p.Put(buf) } }() if err != nil && err != io.EOF { // Note: we'll ignore any io.EOF error because there are some odd // cases where the layer.tar file will be empty (zero bytes) and // that results in an io.EOF from the Peek() call. So, in those // cases we'll just treat it as a non-compressed stream and // that means just create an empty layer. // See Issue 18170 return nil, err } compression := DetectCompression(bs) switch compression { case Uncompressed: readBufWrapper := p.NewReadCloserWrapper(buf, buf) return readBufWrapper, nil case Gzip: cleanup := func() { p.Put(buf) } if rc, canUse := tryProcFilter([]string{"pigz", "-d"}, buf, cleanup); canUse { return rc, nil } gzReader, err := gzip.NewReader(buf) if err != nil { return nil, err } readBufWrapper := p.NewReadCloserWrapper(buf, gzReader) return readBufWrapper, nil case Bzip2: bz2Reader := bzip2.NewReader(buf) readBufWrapper := p.NewReadCloserWrapper(buf, bz2Reader) return readBufWrapper, nil case Xz: xzReader, err := xz.NewReader(buf) if err != nil { return nil, err } readBufWrapper := p.NewReadCloserWrapper(buf, xzReader) return readBufWrapper, nil case Zstd: cleanup := func() { p.Put(buf) } if rc, canUse := tryProcFilter([]string{"zstd", "-d"}, buf, cleanup); canUse { return rc, nil } return zstdReader(buf) default: return nil, fmt.Errorf("unsupported compression format %s", (&compression).Extension()) } } // CompressStream compresses the dest with specified compression algorithm. func CompressStream(dest io.Writer, compression Compression) (_ io.WriteCloser, Err error) { p := pools.BufioWriter32KPool buf := p.Get(dest) defer func() { if Err != nil { p.Put(buf) } }() switch compression { case Uncompressed: writeBufWrapper := p.NewWriteCloserWrapper(buf, buf) return writeBufWrapper, nil case Gzip: gzWriter := gzip.NewWriter(dest) writeBufWrapper := p.NewWriteCloserWrapper(buf, gzWriter) return writeBufWrapper, nil case Zstd: return zstdWriter(dest) case Bzip2, Xz: // archive/bzip2 does not support writing, and there is no xz support at all // However, this is not a problem as docker only currently generates gzipped tars return nil, fmt.Errorf("unsupported compression format %s", (&compression).Extension()) default: return nil, fmt.Errorf("unsupported compression format %s", (&compression).Extension()) } } // TarModifierFunc is a function that can be passed to ReplaceFileTarWrapper to // modify the contents or header of an entry in the archive. If the file already // exists in the archive the TarModifierFunc will be called with the Header and // a reader which will return the files content. If the file does not exist both // header and content will be nil. type TarModifierFunc func(path string, header *tar.Header, content io.Reader) (*tar.Header, []byte, error) // ReplaceFileTarWrapper converts inputTarStream to a new tar stream. Files in the // tar stream are modified if they match any of the keys in mods. func ReplaceFileTarWrapper(inputTarStream io.ReadCloser, mods map[string]TarModifierFunc) io.ReadCloser { pipeReader, pipeWriter := io.Pipe() go func() { tarReader := tar.NewReader(inputTarStream) tarWriter := tar.NewWriter(pipeWriter) defer inputTarStream.Close() defer tarWriter.Close() modify := func(name string, original *tar.Header, modifier TarModifierFunc, tarReader io.Reader) error { header, data, err := modifier(name, original, tarReader) switch { case err != nil: return err case header == nil: return nil } header.Name = name header.Size = int64(len(data)) if err := tarWriter.WriteHeader(header); err != nil { return err } if len(data) != 0 { if _, err := tarWriter.Write(data); err != nil { return err } } return nil } var err error var originalHeader *tar.Header for { originalHeader, err = tarReader.Next() if err == io.EOF { break } if err != nil { pipeWriter.CloseWithError(err) return } modifier, ok := mods[originalHeader.Name] if !ok { // No modifiers for this file, copy the header and data if err := tarWriter.WriteHeader(originalHeader); err != nil { pipeWriter.CloseWithError(err) return } if _, err := pools.Copy(tarWriter, tarReader); err != nil { pipeWriter.CloseWithError(err) return } continue } delete(mods, originalHeader.Name) if err := modify(originalHeader.Name, originalHeader, modifier, tarReader); err != nil { pipeWriter.CloseWithError(err) return } } // Apply the modifiers that haven't matched any files in the archive for name, modifier := range mods { if err := modify(name, nil, modifier, nil); err != nil { pipeWriter.CloseWithError(err) return } } pipeWriter.Close() }() return pipeReader } // Extension returns the extension of a file that uses the specified compression algorithm. func (compression *Compression) Extension() string { switch *compression { case Uncompressed: return tarExt case Bzip2: return tarExt + ".bz2" case Gzip: return tarExt + ".gz" case Xz: return tarExt + ".xz" case Zstd: return tarExt + ".zst" } return "" } // nosysFileInfo hides the system-dependent info of the wrapped FileInfo to // prevent tar.FileInfoHeader from introspecting it and potentially calling into // glibc. type nosysFileInfo struct { os.FileInfo } func (fi nosysFileInfo) Sys() any { // A Sys value of type *tar.Header is safe as it is system-independent. // The tar.FileInfoHeader function copies the fields into the returned // header without performing any OS lookups. if sys, ok := fi.FileInfo.Sys().(*tar.Header); ok { return sys } return nil } // sysStatOverride, if non-nil, populates hdr from system-dependent fields of fi. var sysStatOverride func(fi os.FileInfo, hdr *tar.Header) error func fileInfoHeaderNoLookups(fi os.FileInfo, link string) (*tar.Header, error) { if sysStatOverride == nil { return tar.FileInfoHeader(fi, link) } hdr, err := tar.FileInfoHeader(nosysFileInfo{fi}, link) if err != nil { return nil, err } return hdr, sysStatOverride(fi, hdr) } // FileInfoHeader creates a populated Header from fi. // Compared to archive pkg this function fills in more information. // Also, regardless of Go version, this function fills file type bits (e.g. hdr.Mode |= modeISDIR), // which have been deleted since Go 1.9 archive/tar. func FileInfoHeader(name string, fi os.FileInfo, link string) (*tar.Header, error) { hdr, err := fileInfoHeaderNoLookups(fi, link) if err != nil { return nil, err } hdr.Mode = int64(chmodTarEntry(os.FileMode(hdr.Mode))) name, err = canonicalTarName(name, fi.IsDir()) if err != nil { return nil, fmt.Errorf("tar: cannot canonicalize path: %w", err) } hdr.Name = name setHeaderForSpecialDevice(hdr, fi.Sys()) return hdr, nil } // readSecurityXattrToTarHeader reads security.capability, security,image // xattrs from filesystem to a tar header func readSecurityXattrToTarHeader(path string, hdr *tar.Header) error { if hdr.PAXRecords == nil { hdr.PAXRecords = make(map[string]string) } for _, xattr := range []string{"security.capability", "security.ima"} { capability, err := system.Lgetxattr(path, xattr) if err != nil && !errors.Is(err, system.ENOTSUP) && err != system.ErrNotSupportedPlatform { return fmt.Errorf("failed to read %q attribute from %q: %w", xattr, path, err) } if capability != nil { hdr.PAXRecords[PaxSchilyXattr+xattr] = string(capability) } } return nil } // readUserXattrToTarHeader reads user.* xattr from filesystem to a tar header func readUserXattrToTarHeader(path string, hdr *tar.Header) error { xattrs, err := system.Llistxattr(path) if err != nil && !errors.Is(err, system.ENOTSUP) && err != system.ErrNotSupportedPlatform { return err } for _, key := range xattrs { if strings.HasPrefix(key, "user.") && !strings.HasPrefix(key, "user.overlay.") { value, err := system.Lgetxattr(path, key) if err != nil { if errors.Is(err, system.E2BIG) { logrus.Errorf("archive: Skipping xattr for file %s since value is too big: %s", path, key) continue } return err } if hdr.PAXRecords == nil { hdr.PAXRecords = make(map[string]string) } hdr.PAXRecords[PaxSchilyXattr+key] = string(value) } } return nil } type TarWhiteoutHandler interface { Setxattr(path, name string, value []byte) error Mknod(path string, mode uint32, dev int) error Chown(path string, uid, gid int) error } type TarWhiteoutConverter interface { ConvertWrite(*tar.Header, string, os.FileInfo) (*tar.Header, error) ConvertRead(*tar.Header, string) (bool, error) ConvertReadWithHandler(*tar.Header, string, TarWhiteoutHandler) (bool, error) } type tarWriter struct { TarWriter *tar.Writer Buffer *bufio.Writer // for hardlink mapping SeenFiles map[uint64]string IDMappings *idtools.IDMappings ChownOpts *idtools.IDPair // For packing and unpacking whiteout files in the // non standard format. The whiteout files defined // by the AUFS standard are used as the tar whiteout // standard. WhiteoutConverter TarWhiteoutConverter // CopyPass indicates that the contents of any archive we're creating // will instantly be extracted and written to disk, so we can deviate // from the traditional behavior/format to get features like subsecond // precision in timestamps. CopyPass bool // Timestamp, if set, will be set in each header as create/mod/access time Timestamp *time.Time } func newTarWriter(idMapping *idtools.IDMappings, writer io.Writer, chownOpts *idtools.IDPair, timestamp *time.Time) *tarWriter { return &tarWriter{ SeenFiles: make(map[uint64]string), TarWriter: tar.NewWriter(writer), Buffer: pools.BufioWriter32KPool.Get(nil), IDMappings: idMapping, ChownOpts: chownOpts, Timestamp: timestamp, } } // canonicalTarName provides a platform-independent and consistent posix-style // path for files and directories to be archived regardless of the platform. func canonicalTarName(name string, isDir bool) (string, error) { name, err := CanonicalTarNameForPath(name) if err != nil { return "", err } // suffix with '/' for directories if isDir && !strings.HasSuffix(name, "/") { name += "/" } return name, nil } type addFileData struct { // The path from which to read contents. path string // os.Stat for the above. fi os.FileInfo // The file header of the above. hdr *tar.Header // if present, an extra whiteout entry to write after the header. extraWhiteout *tar.Header } // prepareAddFile generates the tar file header(s) for adding a file // from path as name to the tar archive, without writing to the // tar stream. Thus, any error may be ignored without corrupting the // tar file. A (nil, nil) return means that the file should be // ignored for non-error reasons. func (ta *tarWriter) prepareAddFile(path, name string) (*addFileData, error) { fi, err := os.Lstat(path) if err != nil { return nil, err } var link string if fi.Mode()&os.ModeSymlink != 0 { var err error link, err = os.Readlink(path) if err != nil { return nil, err } } if fi.Mode()&os.ModeSocket != 0 { logrus.Infof("archive: skipping %q since it is a socket", path) return nil, nil } hdr, err := FileInfoHeader(name, fi, link) if err != nil { return nil, err } if err := readSecurityXattrToTarHeader(path, hdr); err != nil { return nil, err } if err := readUserXattrToTarHeader(path, hdr); err != nil { return nil, err } if err := ReadFileFlagsToTarHeader(path, hdr); err != nil { return nil, err } if ta.CopyPass { copyPassHeader(hdr) } // if it's not a directory and has more than 1 link, // it's hard linked, so set the type flag accordingly if !fi.IsDir() && hasHardlinks(fi) { inode := getInodeFromStat(fi.Sys()) // a link should have a name that it links too // and that linked name should be first in the tar archive if oldpath, ok := ta.SeenFiles[inode]; ok { hdr.Typeflag = tar.TypeLink hdr.Linkname = oldpath hdr.Size = 0 // This must be here for the writer math to add up! } } // handle re-mapping container ID mappings back to host ID mappings before // writing tar headers/files. We skip whiteout files because they were written // by the kernel and already have proper ownership relative to the host if !strings.HasPrefix(filepath.Base(hdr.Name), WhiteoutPrefix) && !ta.IDMappings.Empty() { fileIDPair, err := getFileUIDGID(fi.Sys()) if err != nil { return nil, err } hdr.Uid, hdr.Gid, err = ta.IDMappings.ToContainer(fileIDPair) if err != nil { return nil, err } } // explicitly override with ChownOpts if ta.ChownOpts != nil { hdr.Uid = ta.ChownOpts.UID hdr.Gid = ta.ChownOpts.GID // Don’t expose the user names from the local system; they probably don’t match the ta.ChownOpts value anyway, // and they unnecessarily give recipients of the tar file potentially private data. hdr.Uname = "" hdr.Gname = "" } // if override timestamp set, replace all times with this if ta.Timestamp != nil { hdr.ModTime = *ta.Timestamp hdr.AccessTime = *ta.Timestamp hdr.ChangeTime = *ta.Timestamp } maybeTruncateHeaderModTime(hdr) result := &addFileData{ path: path, hdr: hdr, fi: fi, } if ta.WhiteoutConverter != nil { // The WhiteoutConverter suggests a generic mechanism, // but this code is only used to convert between // overlayfs (on-disk) and AUFS (in the tar file) // whiteouts, and is initiated because the overlayfs // storage driver returns OverlayWhiteoutFormat from // Driver.getWhiteoutFormat(). // // For AUFS, a directory with all its contents deleted // should be represented as a directory containing a // magic whiteout empty regular file, hence the // extraWhiteout header returned here. result.extraWhiteout, err = ta.WhiteoutConverter.ConvertWrite(hdr, path, fi) if err != nil { return nil, err } } return result, nil } // addFile performs the write. An error here corrupts the tar file. func (ta *tarWriter) addFile(headers *addFileData) error { hdr := headers.hdr if headers.extraWhiteout != nil { if hdr.Typeflag == tar.TypeReg && hdr.Size > 0 { // If we write hdr with hdr.Size > 0, we have // to write the body before we can write the // extraWhiteout header. This can only happen // if the contract for WhiteoutConverter is // not honored, so bail out. return fmt.Errorf("tar: cannot use extra whiteout with non-empty file %s", hdr.Name) } if err := ta.TarWriter.WriteHeader(hdr); err != nil { return err } hdr = headers.extraWhiteout } if err := ta.TarWriter.WriteHeader(hdr); err != nil { return err } if hdr.Typeflag == tar.TypeReg && hdr.Size > 0 { file, err := os.Open(headers.path) if err != nil { return err } ta.Buffer.Reset(ta.TarWriter) defer ta.Buffer.Reset(nil) _, err = io.Copy(ta.Buffer, file) file.Close() if err != nil { return err } err = ta.Buffer.Flush() if err != nil { return err } } if !headers.fi.IsDir() && hasHardlinks(headers.fi) { ino := getInodeFromStat(headers.fi.Sys()) if _, seen := ta.SeenFiles[ino]; !seen { ta.SeenFiles[ino] = headers.hdr.Name } } return nil } func extractTarFileEntry(path, extractDir string, hdr *tar.Header, reader io.Reader, Lchown bool, chownOpts *idtools.IDPair, inUserns, ignoreChownErrors bool, forceMask *os.FileMode, buffer []byte) error { // hdr.Mode is in linux format, which we can use for sycalls, // but for os.Foo() calls we need the mode converted to os.FileMode, // so use hdrInfo.Mode() (they differ for e.g. setuid bits) hdrInfo := hdr.FileInfo() typeFlag := hdr.Typeflag mask := hdrInfo.Mode() // update also the implementation of ForceMask in pkg/chunked if forceMask != nil { mask = *forceMask // If we have a forceMask, force the real type to either be a directory, // a link, or a regular file. if typeFlag != tar.TypeDir && typeFlag != tar.TypeSymlink && typeFlag != tar.TypeLink { typeFlag = tar.TypeReg } } switch typeFlag { case tar.TypeDir: // Create directory unless it exists as a directory already. // In that case we just want to merge the two if fi, err := os.Lstat(path); err != nil || !fi.IsDir() { if err := os.Mkdir(path, mask); err != nil { return err } } case tar.TypeReg: // Source is regular file. We use system.OpenFileSequential to use sequential // file access to avoid depleting the standby list on Windows. // On Linux, this equates to a regular os.OpenFile file, err := os.OpenFile(path, os.O_CREATE|os.O_WRONLY, mask) if err != nil { return err } if _, err := io.CopyBuffer(file, reader, buffer); err != nil { file.Close() return err } if err := file.Close(); err != nil { return err } case tar.TypeBlock, tar.TypeChar: if inUserns { // cannot create devices in a userns logrus.Debugf("Tar: Can't create device %v while running in user namespace", path) return nil } fallthrough case tar.TypeFifo: // Handle this is an OS-specific way if err := handleTarTypeBlockCharFifo(hdr, path); err != nil { return err } case tar.TypeLink: targetPath := filepath.Join(extractDir, hdr.Linkname) // check for hardlink breakout if !strings.HasPrefix(targetPath, extractDir) { return breakoutError(fmt.Errorf("invalid hardlink %q -> %q", targetPath, hdr.Linkname)) } if err := handleLLink(targetPath, path); err != nil { return err } case tar.TypeSymlink: // path -> hdr.Linkname = targetPath // e.g. /extractDir/path/to/symlink -> ../2/file = /extractDir/path/2/file targetPath := filepath.Join(filepath.Dir(path), hdr.Linkname) // the reason we don't need to check symlinks in the path (with FollowSymlinkInScope) is because // that symlink would first have to be created, which would be caught earlier, at this very check: if !strings.HasPrefix(targetPath, extractDir) { return breakoutError(fmt.Errorf("invalid symlink %q -> %q", path, hdr.Linkname)) } if err := os.Symlink(hdr.Linkname, path); err != nil { return err } case tar.TypeXGlobalHeader: logrus.Debug("PAX Global Extended Headers found and ignored") return nil default: return fmt.Errorf("unhandled tar header type %d", hdr.Typeflag) } // Lchown is not supported on Windows. if Lchown && runtime.GOOS != windows { if chownOpts == nil { chownOpts = &idtools.IDPair{UID: hdr.Uid, GID: hdr.Gid} } err := idtools.SafeLchown(path, chownOpts.UID, chownOpts.GID) if err != nil { if ignoreChownErrors { fmt.Fprintf(os.Stderr, "Chown error detected. Ignoring due to ignoreChownErrors flag: %v\n", err) } else { return err } } } // There is no LChmod, so ignore mode for symlink. Also, this // must happen after chown, as that can modify the file mode if err := handleLChmod(hdr, path, hdrInfo, forceMask); err != nil { return err } aTime := hdr.AccessTime if aTime.Before(hdr.ModTime) { // Last access time should never be before last modified time. aTime = hdr.ModTime } // system.Chtimes doesn't support a NOFOLLOW flag atm if hdr.Typeflag == tar.TypeLink { if fi, err := os.Lstat(hdr.Linkname); err == nil && (fi.Mode()&os.ModeSymlink == 0) { if err := system.Chtimes(path, aTime, hdr.ModTime); err != nil { return err } } } else if hdr.Typeflag != tar.TypeSymlink { if err := system.Chtimes(path, aTime, hdr.ModTime); err != nil { return err } } else { ts := []syscall.Timespec{timeToTimespec(aTime), timeToTimespec(hdr.ModTime)} if err := system.LUtimesNano(path, ts); err != nil && err != system.ErrNotSupportedPlatform { return err } } var errs []string for key, value := range hdr.PAXRecords { xattrKey, ok := strings.CutPrefix(key, PaxSchilyXattr) if !ok { continue } if _, found := xattrsToIgnore[xattrKey]; found { continue } if err := system.Lsetxattr(path, xattrKey, []byte(value), 0); err != nil { if errors.Is(err, system.ENOTSUP) || (inUserns && errors.Is(err, syscall.EPERM)) { // Ignore specific error cases: // - ENOTSUP: Expected for graphdrivers lacking extended attribute support: // - Legacy AUFS versions // - FreeBSD with unsupported namespaces (trusted, security) // - EPERM: Expected when operating within a user namespace // All other errors will cause a failure. errs = append(errs, err.Error()) continue } return err } } if forceMask != nil && (typeFlag == tar.TypeReg || typeFlag == tar.TypeDir || runtime.GOOS == "darwin") { value := idtools.Stat{ IDs: idtools.IDPair{UID: hdr.Uid, GID: hdr.Gid}, Mode: hdrInfo.Mode(), Major: int(hdr.Devmajor), Minor: int(hdr.Devminor), } if err := idtools.SetContainersOverrideXattr(path, value); err != nil { return err } } // We defer setting flags on directories until the end of // Unpack or UnpackLayer in case setting them makes the // directory immutable. if hdr.Typeflag != tar.TypeDir { if err := WriteFileFlagsFromTarHeader(path, hdr); err != nil { return err } } if len(errs) > 0 { logrus.WithFields(logrus.Fields{ "errors": errs, }).Warn("ignored xattrs in archive: underlying filesystem doesn't support them") } return nil } // Tar creates an archive from the directory at `path`, and returns it as a // stream of bytes. This is a convenience wrapper for [TarWithOptions]. func Tar(path string, compression Compression) (io.ReadCloser, error) { return TarWithOptions(path, &TarOptions{Compression: compression}) } func tarWithOptionsTo(dest io.WriteCloser, srcPath string, options *TarOptions) (result error) { // Fix the source path to work with long path names. This is a no-op // on platforms other than Windows. srcPath = fixVolumePathPrefix(srcPath) defer func() { if err := dest.Close(); err != nil && result == nil { result = err } }() pm, err := fileutils.NewPatternMatcher(options.ExcludePatterns) if err != nil { return err } compressWriter, err := CompressStream(dest, options.Compression) if err != nil { return err } ta := newTarWriter( idtools.NewIDMappingsFromMaps(options.UIDMaps, options.GIDMaps), compressWriter, options.ChownOpts, options.Timestamp, ) ta.WhiteoutConverter = GetWhiteoutConverter(options.WhiteoutFormat, options.WhiteoutData) ta.CopyPass = options.CopyPass includeFiles := options.IncludeFiles defer func() { if err := compressWriter.Close(); err != nil && result == nil { result = err } }() // this buffer is needed for the duration of this piped stream defer pools.BufioWriter32KPool.Put(ta.Buffer) // In general we log errors here but ignore them because // during e.g. a diff operation the container can continue // mutating the filesystem and we can see transient errors // from this stat, err := os.Lstat(srcPath) if err != nil { return err } if !stat.IsDir() { // We can't later join a non-dir with any includes because the // 'walk' will error if "file/." is stat-ed and "file" is not a // directory. So, we must split the source path and use the // basename as the include. if len(includeFiles) > 0 { logrus.Warn("Tar: Can't archive a file with includes") } dir, base := SplitPathDirEntry(srcPath) srcPath = dir includeFiles = []string{base} } if len(includeFiles) == 0 { includeFiles = []string{"."} } seen := make(map[string]bool) for _, include := range includeFiles { rebaseName := options.RebaseNames[include] walkRoot := getWalkRoot(srcPath, include) if err := filepath.WalkDir(walkRoot, func(filePath string, d fs.DirEntry, err error) error { if err != nil { logrus.Errorf("Tar: Can't stat file %s to tar: %s", srcPath, err) return nil } relFilePath, err := filepath.Rel(srcPath, filePath) if err != nil || (!options.IncludeSourceDir && relFilePath == "." && d.IsDir()) { // Error getting relative path OR we are looking // at the source directory path. Skip in both situations. return nil //nolint: nilerr } if options.IncludeSourceDir && include == "." && relFilePath != "." { relFilePath = strings.Join([]string{".", relFilePath}, string(filepath.Separator)) } skip := false // If "include" is an exact match for the current file // then even if there's an "excludePatterns" pattern that // matches it, don't skip it. IOW, assume an explicit 'include' // is asking for that file no matter what - which is true // for some files, like .dockerignore and Dockerfile (sometimes) if include != relFilePath { matches, err := pm.IsMatch(relFilePath) if err != nil { return fmt.Errorf("matching %s: %w", relFilePath, err) } skip = matches } if skip { // If we want to skip this file and its a directory // then we should first check to see if there's an // excludes pattern (e.g. !dir/file) that starts with this // dir. If so then we can't skip this dir. // Its not a dir then so we can just return/skip. if !d.IsDir() { return nil } // No exceptions (!...) in patterns so just skip dir if !pm.Exclusions() { return filepath.SkipDir } dirSlash := relFilePath + string(filepath.Separator) for _, pat := range pm.Patterns() { if !pat.Exclusion() { continue } if strings.HasPrefix(pat.String()+string(filepath.Separator), dirSlash) { // found a match - so can't skip this dir return nil } } // No matching exclusion dir so just skip dir return filepath.SkipDir } if seen[relFilePath] { return nil } seen[relFilePath] = true // Rename the base resource. if rebaseName != "" { var replacement string if rebaseName != string(filepath.Separator) { // Special case the root directory to replace with an // empty string instead so that we don't end up with // double slashes in the paths. replacement = rebaseName } relFilePath = strings.Replace(relFilePath, include, replacement, 1) } headers, err := ta.prepareAddFile(filePath, relFilePath) if err != nil { logrus.Errorf("Can't add file %s to tar: %s; skipping", filePath, err) } else if headers != nil { if err := ta.addFile(headers); err != nil { return err } } return nil }); err != nil { return err } } return ta.TarWriter.Close() } // TarWithOptions creates an archive from the directory at `path`, only including files whose relative // paths are included in `options.IncludeFiles` (if non-nil) or not in `options.ExcludePatterns`. // // If used on a file system being modified concurrently, // TarWithOptions will create a valid tar archive, but may leave out // some files. func TarWithOptions(srcPath string, options *TarOptions) (io.ReadCloser, error) { pipeReader, pipeWriter := io.Pipe() go func() { err := tarWithOptionsTo(pipeWriter, srcPath, options) if pipeErr := pipeWriter.CloseWithError(err); pipeErr != nil { logrus.Errorf("Can't close pipe writer: %s", pipeErr) } }() return pipeReader, nil } // Unpack unpacks the decompressedArchive to dest with options. func Unpack(decompressedArchive io.Reader, dest string, options *TarOptions) error { tr := tar.NewReader(decompressedArchive) trBuf := pools.BufioReader32KPool.Get(nil) defer pools.BufioReader32KPool.Put(trBuf) var dirs []*tar.Header idMappings := idtools.NewIDMappingsFromMaps(options.UIDMaps, options.GIDMaps) rootIDs := idMappings.RootPair() whiteoutConverter := GetWhiteoutConverter(options.WhiteoutFormat, options.WhiteoutData) buffer := make([]byte, 1<<20) doChown := !options.NoLchown if options.ForceMask != nil { // if ForceMask is in place, make sure lchown is disabled. doChown = false } var rootHdr *tar.Header // Iterate through the files in the archive. loop: for { hdr, err := tr.Next() if err == io.EOF { // end of tar archive break } if err != nil { return err } // Normalize name, for safety and for a simple is-root check // This keeps "../" as-is, but normalizes "/../" to "/". Or Windows: // This keeps "..\" as-is, but normalizes "\..\" to "\". hdr.Name = filepath.Clean(hdr.Name) for _, exclude := range options.ExcludePatterns { if strings.HasPrefix(hdr.Name, exclude) { continue loop } } // After calling filepath.Clean(hdr.Name) above, hdr.Name will now be in // the filepath format for the OS on which the daemon is running. Hence // the check for a slash-suffix MUST be done in an OS-agnostic way. if !strings.HasSuffix(hdr.Name, string(os.PathSeparator)) { // Not the root directory, ensure that the parent directory exists parent := filepath.Dir(hdr.Name) parentPath := filepath.Join(dest, parent) if err := fileutils.Lexists(parentPath); err != nil && os.IsNotExist(err) { err = idtools.MkdirAllAndChownNew(parentPath, 0o777, rootIDs) if err != nil { return err } } } path := filepath.Join(dest, hdr.Name) rel, err := filepath.Rel(dest, path) if err != nil { return err } if rel == "." { rootHdr = hdr } if strings.HasPrefix(rel, ".."+string(os.PathSeparator)) { return breakoutError(fmt.Errorf("%q is outside of %q", hdr.Name, dest)) } // If path exits we almost always just want to remove and replace it // The only exception is when it is a directory *and* the file from // the layer is also a directory. Then we want to merge them (i.e. // just apply the metadata from the layer). if fi, err := os.Lstat(path); err == nil { if options.NoOverwriteDirNonDir && fi.IsDir() && hdr.Typeflag != tar.TypeDir { // If NoOverwriteDirNonDir is true then we cannot replace // an existing directory with a non-directory from the archive. return overwriteError(fmt.Errorf("cannot overwrite directory %q with non-directory %q", path, dest)) } if options.NoOverwriteDirNonDir && !fi.IsDir() && hdr.Typeflag == tar.TypeDir { // If NoOverwriteDirNonDir is true then we cannot replace // an existing non-directory with a directory from the archive. return overwriteError(fmt.Errorf("cannot overwrite non-directory %q with directory %q", path, dest)) } if fi.IsDir() && hdr.Name == "." { continue } if !fi.IsDir() || hdr.Typeflag != tar.TypeDir { if err := os.RemoveAll(path); err != nil { return err } } } trBuf.Reset(tr) chownOpts := options.ChownOpts if err := remapIDs(nil, idMappings, chownOpts, hdr); err != nil { return err } if whiteoutConverter != nil { writeFile, err := whiteoutConverter.ConvertRead(hdr, path) if err != nil { return err } if !writeFile { continue } } if chownOpts != nil { chownOpts = &idtools.IDPair{UID: hdr.Uid, GID: hdr.Gid} } if err = extractTarFileEntry(path, dest, hdr, trBuf, doChown, chownOpts, options.InUserNS, options.IgnoreChownErrors, options.ForceMask, buffer); err != nil { return err } // Directory mtimes must be handled at the end to avoid further // file creation in them to modify the directory mtime if hdr.Typeflag == tar.TypeDir { dirs = append(dirs, hdr) } } for _, hdr := range dirs { path := filepath.Join(dest, hdr.Name) if err := system.Chtimes(path, hdr.AccessTime, hdr.ModTime); err != nil { return err } if err := WriteFileFlagsFromTarHeader(path, hdr); err != nil { return err } } if options.ForceMask != nil { value := idtools.Stat{Mode: os.ModeDir | os.FileMode(0o755)} if rootHdr != nil { value.IDs.UID = rootHdr.Uid value.IDs.GID = rootHdr.Gid value.Mode = os.ModeDir | os.FileMode(rootHdr.Mode) } if err := idtools.SetContainersOverrideXattr(dest, value); err != nil { return err } } return nil } // Untar reads a stream of bytes from `archive`, parses it as a tar archive, // and unpacks it into the directory at `dest`. // The archive may be compressed with one of the following algorithms: // // identity (uncompressed), gzip, bzip2, xz. // // FIXME: specify behavior when target path exists vs. doesn't exist. func Untar(tarArchive io.Reader, dest string, options *TarOptions) error { return untarHandler(tarArchive, dest, options, true) } // UntarUncompressed reads a stream of bytes from `archive`, parses it as a tar archive, // and unpacks it into the directory at `dest`. // The archive must be an uncompressed stream. func UntarUncompressed(tarArchive io.Reader, dest string, options *TarOptions) error { return untarHandler(tarArchive, dest, options, false) } // Handler for teasing out the automatic decompression func untarHandler(tarArchive io.Reader, dest string, options *TarOptions, decompress bool) error { if tarArchive == nil { return fmt.Errorf("empty archive") } dest = filepath.Clean(dest) if options == nil { options = &TarOptions{} } r := tarArchive if decompress { decompressedArchive, err := DecompressStream(tarArchive) if err != nil { return err } defer decompressedArchive.Close() r = decompressedArchive } return Unpack(r, dest, options) } // TarUntar is a convenience function which calls Tar and Untar, with the output of one piped into the other. // If either Tar or Untar fails, TarUntar aborts and returns the error. func (archiver *Archiver) TarUntar(src, dst string) error { logrus.Debugf("TarUntar(%s %s)", src, dst) tarMappings := archiver.TarIDMappings if tarMappings == nil { tarMappings = &idtools.IDMappings{} } options := &TarOptions{ UIDMaps: tarMappings.UIDs(), GIDMaps: tarMappings.GIDs(), Compression: Uncompressed, CopyPass: true, InUserNS: unshare.IsRootless(), } archive, err := TarWithOptions(src, options) if err != nil { return err } defer archive.Close() untarMappings := archiver.UntarIDMappings if untarMappings == nil { untarMappings = &idtools.IDMappings{} } options = &TarOptions{ UIDMaps: untarMappings.UIDs(), GIDMaps: untarMappings.GIDs(), ChownOpts: archiver.ChownOpts, InUserNS: unshare.IsRootless(), } return archiver.Untar(archive, dst, options) } // UntarPath untar a file from path to a destination, src is the source tar file path. func (archiver *Archiver) UntarPath(src, dst string) error { archive, err := os.Open(src) if err != nil { return err } defer archive.Close() untarMappings := archiver.UntarIDMappings if untarMappings == nil { untarMappings = &idtools.IDMappings{} } options := &TarOptions{ UIDMaps: untarMappings.UIDs(), GIDMaps: untarMappings.GIDs(), ChownOpts: archiver.ChownOpts, InUserNS: unshare.IsRootless(), } return archiver.Untar(archive, dst, options) } // CopyWithTar creates a tar archive of filesystem path `src`, and // unpacks it at filesystem path `dst`. // The archive is streamed directly with fixed buffering and no // intermediary disk IO. func (archiver *Archiver) CopyWithTar(src, dst string) error { srcSt, err := os.Stat(src) if err != nil { return err } if !srcSt.IsDir() { return archiver.CopyFileWithTar(src, dst) } // if this archiver is set up with ID mapping we need to create // the new destination directory with the remapped root UID/GID pair // as owner rootIDs := archiver.UntarIDMappings.RootPair() if archiver.ChownOpts != nil { rootIDs = *archiver.ChownOpts } // Create dst, copy src's content into it logrus.Debugf("Creating dest directory: %s", dst) if err := idtools.MkdirAllAndChownNew(dst, 0o755, rootIDs); err != nil { return err } logrus.Debugf("Calling TarUntar(%s, %s)", src, dst) return archiver.TarUntar(src, dst) } // CopyFileWithTar emulates the behavior of the 'cp' command-line // for a single file. It copies a regular file from path `src` to // path `dst`, and preserves all its metadata. func (archiver *Archiver) CopyFileWithTar(src, dst string) (err error) { logrus.Debugf("CopyFileWithTar(%s, %s)", src, dst) srcSt, err := os.Stat(src) if err != nil { return err } if srcSt.IsDir() { return fmt.Errorf("can't copy a directory") } // Clean up the trailing slash. This must be done in an operating // system specific manner. if dst[len(dst)-1] == os.PathSeparator { dst = filepath.Join(dst, filepath.Base(src)) } // Create the holding directory if necessary if err := os.MkdirAll(filepath.Dir(dst), 0o700); err != nil { return err } r, w := io.Pipe() errC := promise.Go(func() error { defer w.Close() srcF, err := os.Open(src) if err != nil { return err } defer srcF.Close() hdr, err := tar.FileInfoHeader(srcSt, "") if err != nil { return err } hdr.Name = filepath.Base(dst) hdr.Mode = int64(chmodTarEntry(os.FileMode(hdr.Mode))) copyPassHeader(hdr) if err := remapIDs(archiver.TarIDMappings, nil, archiver.ChownOpts, hdr); err != nil { return err } tw := tar.NewWriter(w) defer tw.Close() if err := tw.WriteHeader(hdr); err != nil { return err } if _, err := io.Copy(tw, srcF); err != nil { return err } return nil }) defer func() { if er := <-errC; err == nil && er != nil { err = er } }() options := &TarOptions{ UIDMaps: archiver.UntarIDMappings.UIDs(), GIDMaps: archiver.UntarIDMappings.GIDs(), ChownOpts: archiver.ChownOpts, InUserNS: unshare.IsRootless(), NoOverwriteDirNonDir: true, } err = archiver.Untar(r, filepath.Dir(dst), options) if err != nil { r.CloseWithError(err) } return err } func remapIDs(readIDMappings, writeIDMappings *idtools.IDMappings, chownOpts *idtools.IDPair, hdr *tar.Header) (err error) { var uid, gid int if chownOpts != nil { uid, gid = chownOpts.UID, chownOpts.GID } else { if readIDMappings != nil && !readIDMappings.Empty() { uid, gid, err = readIDMappings.ToContainer(idtools.IDPair{UID: hdr.Uid, GID: hdr.Gid}) if err != nil { return err } } else if runtime.GOOS == darwin { uid, gid = hdr.Uid, hdr.Gid if xstat, ok := hdr.PAXRecords[PaxSchilyXattr+idtools.ContainersOverrideXattr]; ok { attrs := strings.Split(xstat, ":") if len(attrs) >= 3 { val, err := strconv.ParseUint(attrs[0], 10, 32) if err != nil { uid = int(val) } val, err = strconv.ParseUint(attrs[1], 10, 32) if err != nil { gid = int(val) } } } } else { uid, gid = hdr.Uid, hdr.Gid } } ids := idtools.IDPair{UID: uid, GID: gid} if writeIDMappings != nil && !writeIDMappings.Empty() { ids, err = writeIDMappings.ToHost(ids) if err != nil { return err } } hdr.Uid, hdr.Gid = ids.UID, ids.GID return nil } // NewTempArchive reads the content of src into a temporary file, and returns the contents // of that file as an archive. The archive can only be read once - as soon as reading completes, // the file will be deleted. func NewTempArchive(src io.Reader, dir string) (*TempArchive, error) { f, err := os.CreateTemp(dir, "") if err != nil { return nil, err } if _, err := io.Copy(f, src); err != nil { return nil, err } if _, err := f.Seek(0, io.SeekStart); err != nil { return nil, err } st, err := f.Stat() if err != nil { return nil, err } size := st.Size() return &TempArchive{File: f, Size: size}, nil } // TempArchive is a temporary archive. The archive can only be read once - as soon as reading completes, // the file will be deleted. type TempArchive struct { *os.File Size int64 // Pre-computed from Stat().Size() as a convenience read int64 closed bool } // Close closes the underlying file if it's still open, or does a no-op // to allow callers to try to close the TempArchive multiple times safely. func (archive *TempArchive) Close() error { if archive.closed { return nil } archive.closed = true return archive.File.Close() } func (archive *TempArchive) Read(data []byte) (int, error) { n, err := archive.File.Read(data) archive.read += int64(n) if err != nil || archive.read == archive.Size { archive.Close() os.Remove(archive.File.Name()) } return n, err } // IsArchive checks for the magic bytes of a tar or any supported compression // algorithm. func IsArchive(header []byte) bool { compression := DetectCompression(header) if compression != Uncompressed { return true } r := tar.NewReader(bytes.NewReader(header)) _, err := r.Next() return err == nil } // UntarPath is a convenience function which looks for an archive // at filesystem path `src`, and unpacks it at `dst`. func UntarPath(src, dst string) error { return NewDefaultArchiver().UntarPath(src, dst) } const ( // HeaderSize is the size in bytes of a tar header HeaderSize = 512 ) // NewArchiver returns a new Archiver func NewArchiver(idMappings *idtools.IDMappings) *Archiver { if idMappings == nil { idMappings = &idtools.IDMappings{} } return &Archiver{Untar: Untar, TarIDMappings: idMappings, UntarIDMappings: idMappings} } // NewArchiverWithChown returns a new Archiver which uses Untar and the provided ID mapping configuration on both ends func NewArchiverWithChown(tarIDMappings *idtools.IDMappings, chownOpts *idtools.IDPair, untarIDMappings *idtools.IDMappings) *Archiver { if tarIDMappings == nil { tarIDMappings = &idtools.IDMappings{} } if untarIDMappings == nil { untarIDMappings = &idtools.IDMappings{} } return &Archiver{Untar: Untar, TarIDMappings: tarIDMappings, ChownOpts: chownOpts, UntarIDMappings: untarIDMappings} } // CopyFileWithTarAndChown returns a function which copies a single file from outside // of any container into our working container, mapping permissions using the // container's ID maps, possibly overridden using the passed-in chownOpts func CopyFileWithTarAndChown(chownOpts *idtools.IDPair, hasher io.Writer, uidmap []idtools.IDMap, gidmap []idtools.IDMap) func(src, dest string) error { untarMappings := idtools.NewIDMappingsFromMaps(uidmap, gidmap) archiver := NewArchiverWithChown(nil, chownOpts, untarMappings) if hasher != nil { originalUntar := archiver.Untar archiver.Untar = func(tarArchive io.Reader, dest string, options *TarOptions) error { contentReader, contentWriter, err := os.Pipe() if err != nil { return fmt.Errorf("creating pipe extract data to %q: %w", dest, err) } defer contentReader.Close() defer contentWriter.Close() var hashError error var hashWorker sync.WaitGroup hashWorker.Go(func() { t := tar.NewReader(contentReader) _, err := t.Next() if err != nil { hashError = err } if _, err = io.Copy(hasher, t); err != nil && err != io.EOF { hashError = err } }) if err = originalUntar(io.TeeReader(tarArchive, contentWriter), dest, options); err != nil { err = fmt.Errorf("extracting data to %q while copying: %w", dest, err) } hashWorker.Wait() if err == nil && hashError != nil { err = fmt.Errorf("calculating digest of data for %q while copying: %w", dest, hashError) } return err } } return archiver.CopyFileWithTar } // CopyWithTarAndChown returns a function which copies a directory tree from outside of // any container into our working container, mapping permissions using the // container's ID maps, possibly overridden using the passed-in chownOpts func CopyWithTarAndChown(chownOpts *idtools.IDPair, hasher io.Writer, uidmap []idtools.IDMap, gidmap []idtools.IDMap) func(src, dest string) error { untarMappings := idtools.NewIDMappingsFromMaps(uidmap, gidmap) archiver := NewArchiverWithChown(nil, chownOpts, untarMappings) if hasher != nil { originalUntar := archiver.Untar archiver.Untar = func(tarArchive io.Reader, dest string, options *TarOptions) error { return originalUntar(io.TeeReader(tarArchive, hasher), dest, options) } } return archiver.CopyWithTar } // UntarPathAndChown returns a function which extracts an archive in a specified // location into our working container, mapping permissions using the // container's ID maps, possibly overridden using the passed-in chownOpts func UntarPathAndChown(chownOpts *idtools.IDPair, hasher io.Writer, uidmap []idtools.IDMap, gidmap []idtools.IDMap) func(src, dest string) error { untarMappings := idtools.NewIDMappingsFromMaps(uidmap, gidmap) archiver := NewArchiverWithChown(nil, chownOpts, untarMappings) if hasher != nil { originalUntar := archiver.Untar archiver.Untar = func(tarArchive io.Reader, dest string, options *TarOptions) error { return originalUntar(io.TeeReader(tarArchive, hasher), dest, options) } } return archiver.UntarPath } // TarPath returns a function which creates an archive of a specified // location in the container's filesystem, mapping permissions using the // container's ID maps func TarPath(uidmap []idtools.IDMap, gidmap []idtools.IDMap) func(path string) (io.ReadCloser, error) { tarMappings := idtools.NewIDMappingsFromMaps(uidmap, gidmap) return func(path string) (io.ReadCloser, error) { return TarWithOptions(path, &TarOptions{ Compression: Uncompressed, UIDMaps: tarMappings.UIDs(), GIDMaps: tarMappings.GIDs(), }) } } // GetOverlayXattrName returns the xattr used by the overlay driver with the // given name. // It uses the trusted.overlay prefix when running as root, and user.overlay // in rootless mode. func GetOverlayXattrName(name string) string { if unshare.IsRootless() { return fmt.Sprintf("user.overlay.%s", name) } return fmt.Sprintf("trusted.overlay.%s", name) } ================================================ FILE: vendor/go.podman.io/storage/pkg/archive/archive_110.go ================================================ //go:build go1.10 package archive import ( "archive/tar" "time" ) func copyPassHeader(hdr *tar.Header) { hdr.Format = tar.FormatPAX } func maybeTruncateHeaderModTime(hdr *tar.Header) { if hdr.Format == tar.FormatUnknown { // one of the first things archive/tar does is round this // value, possibly up, if the format isn't specified, while we // are much better equipped to handle truncation when scanning // for changes between source and an extracted copy of this hdr.ModTime = hdr.ModTime.Truncate(time.Second) } } ================================================ FILE: vendor/go.podman.io/storage/pkg/archive/archive_19.go ================================================ //go:build !go1.10 package archive import ( "archive/tar" ) func copyPassHeader(hdr *tar.Header) { } func maybeTruncateHeaderModTime(hdr *tar.Header) { } ================================================ FILE: vendor/go.podman.io/storage/pkg/archive/archive_bsd.go ================================================ //go:build netbsd || freebsd || darwin package archive import ( "archive/tar" "os" "golang.org/x/sys/unix" ) func handleLChmod(_ *tar.Header, path string, hdrInfo os.FileInfo, forceMask *os.FileMode) error { permissionsMask := hdrInfo.Mode() if forceMask != nil { permissionsMask = *forceMask } return unix.Fchmodat(unix.AT_FDCWD, path, uint32(permissionsMask), unix.AT_SYMLINK_NOFOLLOW) } ================================================ FILE: vendor/go.podman.io/storage/pkg/archive/archive_linux.go ================================================ package archive import ( "archive/tar" "os" "path/filepath" "strings" "syscall" "go.podman.io/storage/pkg/idtools" "go.podman.io/storage/pkg/system" "golang.org/x/sys/unix" ) func getOverlayOpaqueXattrName() string { return GetOverlayXattrName("opaque") } func GetWhiteoutConverter(format WhiteoutFormat, data any) TarWhiteoutConverter { if format == OverlayWhiteoutFormat { if rolayers, ok := data.([]string); ok && len(rolayers) > 0 { return overlayWhiteoutConverter{rolayers: rolayers} } return overlayWhiteoutConverter{rolayers: nil} } return nil } type overlayWhiteoutConverter struct { rolayers []string } func (o overlayWhiteoutConverter) ConvertWrite(hdr *tar.Header, path string, fi os.FileInfo) (*tar.Header, error) { // convert whiteouts to AUFS format if fi.Mode()&os.ModeCharDevice != 0 && hdr.Devmajor == 0 && hdr.Devminor == 0 { // we just rename the file and make it normal dir, filename := filepath.Split(hdr.Name) hdr.Name = filepath.Join(dir, WhiteoutPrefix+filename) hdr.Mode = 0 hdr.Typeflag = tar.TypeReg hdr.Size = 0 } if fi.Mode()&os.ModeDir != 0 { // convert opaque dirs to AUFS format by writing an empty file with the whiteout prefix opaque, err := system.Lgetxattr(path, getOverlayOpaqueXattrName()) if err != nil { return nil, err } if len(opaque) == 1 && opaque[0] == 'y' { if hdr.PAXRecords != nil { delete(hdr.PAXRecords, PaxSchilyXattr+getOverlayOpaqueXattrName()) } // If there are no lower layers, then it can't have been deleted in this layer. if len(o.rolayers) == 0 { return nil, nil //nolint: nilnil } // At this point, we have a directory that's opaque. If it appears in one of the lower // layers, then it was newly-created here, so it wasn't also deleted here. for _, rolayer := range o.rolayers { stat, statErr := os.Stat(filepath.Join(rolayer, hdr.Name)) if statErr != nil && !os.IsNotExist(statErr) && !isENOTDIR(statErr) { // Not sure what happened here. return nil, statErr } if statErr == nil { if stat.Mode()&os.ModeCharDevice != 0 { if isWhiteOut(stat) { return nil, nil //nolint: nilnil } } // It's not whiteout, so it was there in the older layer, so we need to // add a whiteout for this item in this layer. // create a header for the whiteout file // it should inherit some properties from the parent, but be a regular file wo := &tar.Header{ Typeflag: tar.TypeReg, Mode: hdr.Mode & int64(os.ModePerm), Name: filepath.Join(hdr.Name, WhiteoutOpaqueDir), Size: 0, Uid: hdr.Uid, Uname: hdr.Uname, Gid: hdr.Gid, Gname: hdr.Gname, AccessTime: hdr.AccessTime, ChangeTime: hdr.ChangeTime, } return wo, nil } for dir := filepath.Dir(hdr.Name); dir != "" && dir != "." && dir != string(os.PathSeparator); dir = filepath.Dir(dir) { // Check for whiteout for a parent directory in a parent layer. stat, statErr := os.Stat(filepath.Join(rolayer, dir)) if statErr != nil && !os.IsNotExist(statErr) && !isENOTDIR(statErr) { // Not sure what happened here. return nil, statErr } if statErr == nil { if stat.Mode()&os.ModeCharDevice != 0 { // If it's whiteout for a parent directory, then the // original directory wasn't inherited into this layer, // so we don't need to emit whiteout for it. if isWhiteOut(stat) { return nil, nil //nolint: nilnil } } } } } } } return nil, nil } func (overlayWhiteoutConverter) ConvertReadWithHandler(hdr *tar.Header, path string, handler TarWhiteoutHandler) (bool, error) { base := filepath.Base(path) dir := filepath.Dir(path) // if a directory is marked as opaque by the AUFS special file, we need to translate that to overlay if base == WhiteoutOpaqueDir { err := handler.Setxattr(dir, getOverlayOpaqueXattrName(), []byte{'y'}) // don't write the file itself return false, err } // if a file was deleted and we are using overlay, we need to create a character device if originalBase, ok := strings.CutPrefix(base, WhiteoutPrefix); ok { originalPath := filepath.Join(dir, originalBase) if err := handler.Mknod(originalPath, unix.S_IFCHR, 0); err != nil { // If someone does: // rm -rf /foo/bar // in an image, some tools will generate a layer with: // /.wh.foo // /foo/.wh.bar // and when doing the second mknod(), we will fail with // ENOTDIR, since the previous /foo was mknod()'d as a // character device node and not a directory. if isENOTDIR(err) { return false, nil } return false, err } if err := handler.Chown(originalPath, hdr.Uid, hdr.Gid); err != nil { return false, err } // don't write the file itself return false, nil } return true, nil } type directHandler struct{} func (d directHandler) Setxattr(path, name string, value []byte) error { return unix.Setxattr(path, name, value, 0) } func (d directHandler) Mknod(path string, mode uint32, dev int) error { return unix.Mknod(path, mode, dev) } func (d directHandler) Chown(path string, uid, gid int) error { return idtools.SafeChown(path, uid, gid) } func (o overlayWhiteoutConverter) ConvertRead(hdr *tar.Header, path string) (bool, error) { var handler directHandler return o.ConvertReadWithHandler(hdr, path, handler) } func isWhiteOut(stat os.FileInfo) bool { s := stat.Sys().(*syscall.Stat_t) return major(uint64(s.Rdev)) == 0 && minor(uint64(s.Rdev)) == 0 //nolint:unconvert } func GetFileOwner(path string) (uint32, uint32, uint32, error) { f, err := os.Stat(path) if err != nil { return 0, 0, 0, err } s, ok := f.Sys().(*syscall.Stat_t) if ok { return s.Uid, s.Gid, s.Mode & 0o7777, nil } return 0, 0, uint32(f.Mode()), nil } func handleLChmod(hdr *tar.Header, path string, hdrInfo os.FileInfo, forceMask *os.FileMode) error { permissionsMask := hdrInfo.Mode() if forceMask != nil { permissionsMask = *forceMask } if hdr.Typeflag == tar.TypeLink { if fi, err := os.Lstat(hdr.Linkname); err == nil && (fi.Mode()&os.ModeSymlink == 0) { if err := os.Chmod(path, permissionsMask); err != nil { return err } } } else if hdr.Typeflag != tar.TypeSymlink { if err := os.Chmod(path, permissionsMask); err != nil { return err } } return nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/archive/archive_other.go ================================================ //go:build !linux package archive func GetWhiteoutConverter(_ WhiteoutFormat, _ any) TarWhiteoutConverter { return nil } func GetFileOwner(path string) (uint32, uint32, uint32, error) { return 0, 0, 0, nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/archive/archive_unix.go ================================================ //go:build !windows package archive import ( "archive/tar" "errors" "os" "path/filepath" "syscall" "go.podman.io/storage/pkg/idtools" "go.podman.io/storage/pkg/system" "golang.org/x/sys/unix" ) func init() { sysStatOverride = statUnix } // statUnix populates hdr from system-dependent fields of fi without performing // any OS lookups. // Adapted from Moby. func statUnix(fi os.FileInfo, hdr *tar.Header) error { s, ok := fi.Sys().(*syscall.Stat_t) if !ok { return nil } hdr.Uid = int(s.Uid) hdr.Gid = int(s.Gid) if s.Mode&unix.S_IFBLK != 0 || s.Mode&unix.S_IFCHR != 0 { // _nolint_: Whether this conversion is required is hardware- and OS-dependent: the value might be uint64 on Linux, int32 on macOS. // So, this might trigger either "uncovert" (if the conversion is unnecessary) or "nolintlint" (if it is required) hdr.Devmajor = int64(unix.Major(uint64(s.Rdev))) //nolint:unconvert,nolintlint hdr.Devminor = int64(unix.Minor(uint64(s.Rdev))) //nolint:unconvert,nolintlint } return nil } // fixVolumePathPrefix does platform specific processing to ensure that if // the path being passed in is not in a volume path format, convert it to one. func fixVolumePathPrefix(srcPath string) string { return srcPath } // getWalkRoot calculates the root path when performing a TarWithOptions. // We use a separate function as this is platform specific. On Linux, we // can't use filepath.Join(srcPath,include) because this will clean away // a trailing "." or "/" which may be important. func getWalkRoot(srcPath string, include string) string { return srcPath + string(filepath.Separator) + include } // CanonicalTarNameForPath returns platform-specific filepath // to canonical posix-style path for tar archival. p is relative // path. func CanonicalTarNameForPath(p string) (string, error) { return p, nil // already unix-style } // chmodTarEntry is used to adjust the file permissions used in tar header based // on the platform the archival is done. func chmodTarEntry(perm os.FileMode) os.FileMode { return perm // noop for unix as golang APIs provide perm bits correctly } func setHeaderForSpecialDevice(hdr *tar.Header, stat any) { s, ok := stat.(*syscall.Stat_t) if ok { // Currently go does not fill in the major/minors if s.Mode&unix.S_IFBLK != 0 || s.Mode&unix.S_IFCHR != 0 { // _nolint_: Whether this conversion is required is hardware- and OS-dependent: the value might be uint64 on Linux, int32 on macOS. // So, this might trigger either "uncovert" (if the conversion is unnecessary) or "nolintlint" (if it is required) hdr.Devmajor = int64(major(uint64(s.Rdev))) //nolint: unconvert,nolintlint hdr.Devminor = int64(minor(uint64(s.Rdev))) //nolint: unconvert,nolintlint } } } func getInodeFromStat(stat any) (inode uint64) { s, ok := stat.(*syscall.Stat_t) if ok { inode = s.Ino } return inode } func getFileUIDGID(stat any) (idtools.IDPair, error) { s, ok := stat.(*syscall.Stat_t) if !ok { return idtools.IDPair{}, errors.New("cannot convert stat value to syscall.Stat_t") } return idtools.IDPair{UID: int(s.Uid), GID: int(s.Gid)}, nil } func major(device uint64) uint64 { return (device >> 8) & 0xfff } func minor(device uint64) uint64 { return (device & 0xff) | ((device >> 12) & 0xfff00) } // handleTarTypeBlockCharFifo is an OS-specific helper function used by // createTarFile to handle the following types of header: Block; Char; Fifo func handleTarTypeBlockCharFifo(hdr *tar.Header, path string) error { mode := uint32(hdr.Mode & 0o7777) switch hdr.Typeflag { case tar.TypeBlock: mode |= unix.S_IFBLK case tar.TypeChar: mode |= unix.S_IFCHR case tar.TypeFifo: mode |= unix.S_IFIFO } return system.Mknod(path, mode, system.Mkdev(hdr.Devmajor, hdr.Devminor)) } // Hardlink without symlinks func handleLLink(targetPath, path string) error { // Note: on Linux, the link syscall will not follow symlinks. // This behavior is implementation-dependent since // POSIX.1-2008 so to make it clear that we need non-symlink // following here we use the linkat syscall which has a flags // field to select symlink following or not. return unix.Linkat(unix.AT_FDCWD, targetPath, unix.AT_FDCWD, path, 0) } ================================================ FILE: vendor/go.podman.io/storage/pkg/archive/archive_windows.go ================================================ //go:build windows package archive import ( "archive/tar" "fmt" "os" "path/filepath" "strings" "go.podman.io/storage/pkg/idtools" "go.podman.io/storage/pkg/longpath" ) // fixVolumePathPrefix does platform specific processing to ensure that if // the path being passed in is not in a volume path format, convert it to one. func fixVolumePathPrefix(srcPath string) string { return longpath.AddPrefix(srcPath) } // getWalkRoot calculates the root path when performing a TarWithOptions. // We use a separate function as this is platform specific. func getWalkRoot(srcPath string, include string) string { return filepath.Join(srcPath, include) } // CanonicalTarNameForPath returns platform-specific filepath // to canonical posix-style path for tar archival. p is relative // path. func CanonicalTarNameForPath(p string) (string, error) { // windows: convert windows style relative path with backslashes // into forward slashes. Since windows does not allow '/' or '\' // in file names, it is mostly safe to replace however we must // check just in case if strings.Contains(p, "/") { return "", fmt.Errorf("windows path contains forward slash: %s", p) } return strings.Replace(p, string(os.PathSeparator), "/", -1), nil } // chmodTarEntry is used to adjust the file permissions used in tar header based // on the platform the archival is done. func chmodTarEntry(perm os.FileMode) os.FileMode { // perm &= 0755 // this 0-ed out tar flags (like link, regular file, directory marker etc.) permPart := perm & os.ModePerm noPermPart := perm &^ os.ModePerm // Add the x bit: make everything +x from windows permPart |= 0o111 permPart &= 0o755 return noPermPart | permPart } func setHeaderForSpecialDevice(hdr *tar.Header, stat any) { // do nothing. no notion of Rdev, Nlink in stat on Windows } func getInodeFromStat(_ any) uint64 { // do nothing. no notion of Inode in stat on Windows return 0 } // handleTarTypeBlockCharFifo is an OS-specific helper function used by // createTarFile to handle the following types of header: Block; Char; Fifo func handleTarTypeBlockCharFifo(_ *tar.Header, _ string) error { return nil } func handleLChmod(_ *tar.Header, _ string, _ os.FileInfo, _ *os.FileMode) error { return nil } func getFileUIDGID(_ any) (idtools.IDPair, error) { // no notion of file ownership mapping yet on Windows return idtools.IDPair{UID: 0, GID: 0}, nil } // Hardlink without following symlinks func handleLLink(targetPath string, path string) error { return os.Link(targetPath, path) } ================================================ FILE: vendor/go.podman.io/storage/pkg/archive/archive_zstd.go ================================================ package archive import ( "io" "github.com/klauspost/compress/zstd" ) type wrapperZstdDecoder struct { decoder *zstd.Decoder } func (w *wrapperZstdDecoder) Close() error { w.decoder.Close() return nil } func (w *wrapperZstdDecoder) DecodeAll(input, dst []byte) ([]byte, error) { return w.decoder.DecodeAll(input, dst) } func (w *wrapperZstdDecoder) Read(p []byte) (int, error) { return w.decoder.Read(p) } func (w *wrapperZstdDecoder) Reset(r io.Reader) error { return w.decoder.Reset(r) } func (w *wrapperZstdDecoder) WriteTo(wr io.Writer) (int64, error) { return w.decoder.WriteTo(wr) } func zstdReader(buf io.Reader) (io.ReadCloser, error) { decoder, err := zstd.NewReader(buf) return &wrapperZstdDecoder{decoder: decoder}, err } func zstdWriter(dest io.Writer) (io.WriteCloser, error) { return zstd.NewWriter(dest) } ================================================ FILE: vendor/go.podman.io/storage/pkg/archive/changes.go ================================================ package archive import ( "archive/tar" "bytes" "cmp" "fmt" "io" "maps" "os" "path/filepath" "slices" "strings" "syscall" "time" "github.com/sirupsen/logrus" "go.podman.io/storage/pkg/fileutils" "go.podman.io/storage/pkg/idtools" "go.podman.io/storage/pkg/pools" "go.podman.io/storage/pkg/system" ) // ChangeType represents the change type. type ChangeType int const ( // ChangeModify represents the modify operation. ChangeModify = iota // ChangeAdd represents the add operation. ChangeAdd // ChangeDelete represents the delete operation. ChangeDelete ) func (c ChangeType) String() string { switch c { case ChangeModify: return "C" case ChangeAdd: return "A" case ChangeDelete: return "D" } return "" } // Change represents a change, it wraps the change type and path. // It describes changes of the files in the path respect to the // parent layers. The change could be modify, add, delete. // This is used for layer diff. type Change struct { Path string Kind ChangeType } func (change *Change) String() string { return fmt.Sprintf("%s %s", change.Kind, change.Path) } func compareChangesByPath(a, b Change) int { return cmp.Compare(a.Path, b.Path) } // Gnu tar and the go tar writer don't have sub-second mtime // precision, which is problematic when we apply changes via tar // files, we handle this by comparing for exact times, *or* same // second count and either a or b having exactly 0 nanoseconds func sameFsTime(a, b time.Time) bool { return a.Equal(b) || (a.Unix() == b.Unix() && (a.Nanosecond() == 0 || b.Nanosecond() == 0)) } func sameFsTimeSpec(a, b syscall.Timespec) bool { return a.Sec == b.Sec && (a.Nsec == b.Nsec || a.Nsec == 0 || b.Nsec == 0) } // Changes walks the path rw and determines changes for the files in the path, // with respect to the parent layers func Changes(layers []string, rw string) ([]Change, error) { return changes(layers, rw, aufsDeletedFile, aufsMetadataSkip, aufsWhiteoutPresent) } func aufsMetadataSkip(path string) (bool, error) { skip, err := filepath.Match(string(os.PathSeparator)+WhiteoutMetaPrefix+"*", path) if err != nil { skip = true } return skip, err } func aufsDeletedFile(root, path string, fi os.FileInfo) (string, error) { f := filepath.Base(path) // If there is a whiteout, then the file was removed if originalFile, ok := strings.CutPrefix(f, WhiteoutPrefix); ok { return filepath.Join(filepath.Dir(path), originalFile), nil } return "", nil } func aufsWhiteoutPresent(root, path string) (bool, error) { f := filepath.Join(filepath.Dir(path), WhiteoutPrefix+filepath.Base(path)) err := fileutils.Exists(filepath.Join(root, f)) if err == nil { return true, nil } if os.IsNotExist(err) || isENOTDIR(err) { return false, nil } return false, err } func isENOTDIR(err error) bool { if err == nil { return false } if err == syscall.ENOTDIR { return true } if perror, ok := err.(*os.PathError); ok { if errno, ok := perror.Err.(syscall.Errno); ok { return errno == syscall.ENOTDIR } } return false } type ( skipChange func(string) (bool, error) deleteChange func(string, string, os.FileInfo) (string, error) whiteoutChange func(string, string) (bool, error) ) func changes(layers []string, rw string, dc deleteChange, sc skipChange, wc whiteoutChange) ([]Change, error) { var ( changes []Change changedDirs = make(map[string]struct{}) ) err := filepath.Walk(rw, func(path string, f os.FileInfo, err error) error { if err != nil { return err } // Rebase path path, err = filepath.Rel(rw, path) if err != nil { return err } // As this runs on the daemon side, file paths are OS specific. path = filepath.Join(string(os.PathSeparator), path) // Skip root if path == string(os.PathSeparator) { return nil } if sc != nil { if skip, err := sc(path); skip { return err } } change := Change{ Path: path, } deletedFile, err := dc(rw, path, f) if err != nil { return err } // Find out what kind of modification happened if deletedFile != "" { change.Path = deletedFile change.Kind = ChangeDelete } else { // Otherwise, the file was added change.Kind = ChangeAdd // ...Unless it already existed in a top layer, in which case, it's a modification layerScan: for _, layer := range layers { if wc != nil { // ...Unless a lower layer also had whiteout for this directory or one of its parents, // in which case, it's new ignore, err := wc(layer, path) if err != nil { return err } if ignore { break layerScan } for dir := filepath.Dir(path); dir != "" && dir != string(os.PathSeparator); dir = filepath.Dir(dir) { ignore, err = wc(layer, dir) if err != nil { return err } if ignore { break layerScan } } } stat, err := os.Stat(filepath.Join(layer, path)) if err != nil && !os.IsNotExist(err) { return err } if err == nil { // The file existed in the top layer, so that's a modification // However, if it's a directory, maybe it wasn't actually modified. // If you modify /foo/bar/baz, then /foo will be part of the changed files only because it's the parent of bar if stat.IsDir() && f.IsDir() { if f.Size() == stat.Size() && f.Mode() == stat.Mode() && sameFsTime(f.ModTime(), stat.ModTime()) { // Both directories are the same, don't record the change return nil } } change.Kind = ChangeModify break } } } // If /foo/bar/file.txt is modified, then /foo/bar must be part of the changed files. // This block is here to ensure the change is recorded even if the // modify time, mode and size of the parent directory in the rw and ro layers are all equal. // Check https://github.com/docker/docker/pull/13590 for details. if f.IsDir() { changedDirs[path] = struct{}{} } if change.Kind == ChangeAdd || change.Kind == ChangeDelete { parent := filepath.Dir(path) tail := []Change{} for parent != "/" { if _, ok := changedDirs[parent]; !ok && parent != "/" { tail = append([]Change{{Path: parent, Kind: ChangeModify}}, tail...) changedDirs[parent] = struct{}{} } parent = filepath.Dir(parent) } changes = append(changes, tail...) } // Record change changes = append(changes, change) return nil }) if err != nil && !os.IsNotExist(err) { return nil, err } return changes, nil } // FileInfo describes the information of a file. type FileInfo struct { parent *FileInfo idMappings *idtools.IDMappings name string stat *system.StatT children map[string]*FileInfo capability []byte added bool xattrs map[string]string target string } // LookUp looks up the file information of a file. func (info *FileInfo) LookUp(path string) *FileInfo { // As this runs on the daemon side, file paths are OS specific. parent := info if path == string(os.PathSeparator) { return info } for elem := range strings.SplitSeq(path, string(os.PathSeparator)) { if elem != "" { child := parent.children[elem] if child == nil { return nil } parent = child } } return parent } func (info *FileInfo) path() string { if info.parent == nil { // As this runs on the daemon side, file paths are OS specific. return string(os.PathSeparator) } return filepath.Join(info.parent.path(), info.name) } func (info *FileInfo) addChanges(oldInfo *FileInfo, changes *[]Change) { sizeAtEntry := len(*changes) if oldInfo == nil { // add change := Change{ Path: info.path(), Kind: ChangeAdd, } *changes = append(*changes, change) info.added = true } // We make a copy so we can modify it to detect additions // also, we only recurse on the old dir if the new info is a directory // otherwise any previous delete/change is considered recursive oldChildren := make(map[string]*FileInfo) if oldInfo != nil && info.isDir() { maps.Copy(oldChildren, oldInfo.children) } for name, newChild := range info.children { oldChild := oldChildren[name] if oldChild != nil { // change? oldStat := oldChild.stat newStat := newChild.stat // Note: We can't compare inode or ctime or blocksize here, because these change // when copying a file into a container. However, that is not generally a problem // because any content change will change mtime, and any status change should // be visible when actually comparing the stat fields. The only time this // breaks down is if some code intentionally hides a change by setting // back mtime if statDifferent(oldStat, oldInfo, newStat, info) || !bytes.Equal(oldChild.capability, newChild.capability) || oldChild.target != newChild.target || !maps.Equal(oldChild.xattrs, newChild.xattrs) { change := Change{ Path: newChild.path(), Kind: ChangeModify, } *changes = append(*changes, change) newChild.added = true } // Remove from copy so we can detect deletions delete(oldChildren, name) } newChild.addChanges(oldChild, changes) } for _, oldChild := range oldChildren { // delete change := Change{ Path: oldChild.path(), Kind: ChangeDelete, } *changes = append(*changes, change) } // If there were changes inside this directory, we need to add it, even if the directory // itself wasn't changed. This is needed to properly save and restore filesystem permissions. // As this runs on the daemon side, file paths are OS specific. if len(*changes) > sizeAtEntry && info.isDir() && !info.added && info.path() != string(os.PathSeparator) { change := Change{ Path: info.path(), Kind: ChangeModify, } // Let's insert the directory entry before the recently added entries located inside this dir *changes = append(*changes, change) // just to resize the slice, will be overwritten copy((*changes)[sizeAtEntry+1:], (*changes)[sizeAtEntry:]) (*changes)[sizeAtEntry] = change } } // Changes add changes to file information. func (info *FileInfo) Changes(oldInfo *FileInfo) []Change { var changes []Change info.addChanges(oldInfo, &changes) return changes } func newRootFileInfo(idMappings *idtools.IDMappings) *FileInfo { // As this runs on the daemon side, file paths are OS specific. root := &FileInfo{ name: string(os.PathSeparator), idMappings: idMappings, children: make(map[string]*FileInfo), target: "", } return root } // ChangesDirs compares two directories and generates an array of Change objects describing the changes. // If oldDir is "", then all files in newDir will be Add-Changes. func ChangesDirs(newDir string, newMappings *idtools.IDMappings, oldDir string, oldMappings *idtools.IDMappings) ([]Change, error) { var oldRoot, newRoot *FileInfo if oldDir == "" { emptyDir, err := os.MkdirTemp("", "empty") if err != nil { return nil, err } defer os.Remove(emptyDir) oldDir = emptyDir } oldRoot, newRoot, err := collectFileInfoForChanges(oldDir, newDir, oldMappings, newMappings) if err != nil { return nil, err } return newRoot.Changes(oldRoot), nil } // ChangesSize calculates the size in bytes of the provided changes, based on newDir. func ChangesSize(newDir string, changes []Change) int64 { var ( size int64 sf = make(map[uint64]struct{}) ) for _, change := range changes { if change.Kind == ChangeModify || change.Kind == ChangeAdd { file := filepath.Join(newDir, change.Path) fileInfo, err := os.Lstat(file) if err != nil { logrus.Errorf("Can not stat %q: %s", file, err) continue } if fileInfo != nil && !fileInfo.IsDir() { if hasHardlinks(fileInfo) { inode := getIno(fileInfo) if _, ok := sf[inode]; !ok { size += fileInfo.Size() sf[inode] = struct{}{} } } else { size += fileInfo.Size() } } } } return size } // ExportChanges produces an Archive from the provided changes, relative to dir. func ExportChanges(dir string, changes []Change, uidMaps, gidMaps []idtools.IDMap) (io.ReadCloser, error) { reader, writer := io.Pipe() go func() { ta := newTarWriter(idtools.NewIDMappingsFromMaps(uidMaps, gidMaps), writer, nil, nil) // this buffer is needed for the duration of this piped stream defer pools.BufioWriter32KPool.Put(ta.Buffer) slices.SortFunc(changes, compareChangesByPath) // In general we log errors here but ignore them because // during e.g. a diff operation the container can continue // mutating the filesystem and we can see transient errors // from this for _, change := range changes { if change.Kind == ChangeDelete { whiteOutDir := filepath.Dir(change.Path) whiteOutBase := filepath.Base(change.Path) whiteOut := filepath.Join(whiteOutDir, WhiteoutPrefix+whiteOutBase) timestamp := time.Now() hdr := &tar.Header{ Name: whiteOut[1:], Size: 0, ModTime: timestamp, AccessTime: timestamp, ChangeTime: timestamp, } if err := ta.TarWriter.WriteHeader(hdr); err != nil { logrus.Debugf("Can't write whiteout header: %s", err) } } else { path := filepath.Join(dir, change.Path) headers, err := ta.prepareAddFile(path, change.Path[1:]) if err != nil { logrus.Debugf("Can't add file %s to tar: %s", path, err) } else if headers != nil { if err := ta.addFile(headers); err != nil { writer.CloseWithError(err) return } } } } // Make sure to check the error on Close. if err := ta.TarWriter.Close(); err != nil { logrus.Debugf("Can't close layer: %s", err) } if err := writer.Close(); err != nil { logrus.Debugf("failed close Changes writer: %s", err) } }() return reader, nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/archive/changes_linux.go ================================================ package archive import ( "bytes" "cmp" "errors" "fmt" "os" "path/filepath" "slices" "strings" "syscall" "unsafe" "github.com/sirupsen/logrus" "go.podman.io/storage/pkg/idtools" "go.podman.io/storage/pkg/system" "golang.org/x/sys/unix" ) // walker is used to implement collectFileInfoForChanges on linux. Where this // method in general returns the entire contents of two directory trees, we // optimize some FS calls out on linux. In particular, we take advantage of the // fact that getdents(2) returns the inode of each file in the directory being // walked, which, when walking two trees in parallel to generate a list of // changes, can be used to prune subtrees without ever having to lstat(2) them // directly. Eliminating stat calls in this way can save up to seconds on large // images. type walker struct { dir1 string dir2 string root1 *FileInfo root2 *FileInfo idmap1 *idtools.IDMappings //nolint:unused idmap2 *idtools.IDMappings //nolint:unused } // collectFileInfoForChanges returns a complete representation of the trees // rooted at dir1 and dir2, with one important exception: any subtree or // leaf where the inode and device numbers are an exact match between dir1 // and dir2 will be pruned from the results. This method is *only* to be used // to generating a list of changes between the two directories, as it does not // reflect the full contents. func collectFileInfoForChanges(dir1, dir2 string, idmap1, idmap2 *idtools.IDMappings) (*FileInfo, *FileInfo, error) { w := &walker{ dir1: dir1, dir2: dir2, root1: newRootFileInfo(idmap1), root2: newRootFileInfo(idmap2), } i1, err := os.Lstat(w.dir1) if err != nil { return nil, nil, err } i2, err := os.Lstat(w.dir2) if err != nil { return nil, nil, err } if err := w.walk("/", i1, i2); err != nil { return nil, nil, err } return w.root1, w.root2, nil } // Given a FileInfo, its path info, and a reference to the root of the tree // being constructed, register this file with the tree. func walkchunk(path string, fi os.FileInfo, dir string, root *FileInfo) error { if fi == nil { return nil } parent := root.LookUp(filepath.Dir(path)) if parent == nil { return fmt.Errorf("walkchunk: Unexpectedly no parent for %s", path) } info := &FileInfo{ name: filepath.Base(path), children: make(map[string]*FileInfo), parent: parent, idMappings: root.idMappings, target: "", } cpath := filepath.Join(dir, path) stat, err := system.FromStatT(fi.Sys().(*syscall.Stat_t)) if err != nil { return err } info.stat = stat info.capability, err = system.Lgetxattr(cpath, "security.capability") // lgetxattr(2): fs access if err != nil && !errors.Is(err, system.ENOTSUP) { return err } xattrs, err := system.Llistxattr(cpath) if err != nil && !errors.Is(err, system.ENOTSUP) { return err } for _, key := range xattrs { if strings.HasPrefix(key, "user.") { value, err := system.Lgetxattr(cpath, key) if err != nil { if errors.Is(err, system.E2BIG) { logrus.Errorf("archive: Skipping xattr for file %s since value is too big: %s", cpath, key) continue } return err } if info.xattrs == nil { info.xattrs = make(map[string]string) } info.xattrs[key] = string(value) } } if fi.Mode()&os.ModeSymlink != 0 { info.target, err = os.Readlink(cpath) if err != nil { return err } } parent.children[info.name] = info return nil } // Walk a subtree rooted at the same path in both trees being iterated. For // example, /docker/overlay/1234/a/b/c/d and /docker/overlay/8888/a/b/c/d func (w *walker) walk(path string, i1, i2 os.FileInfo) (err error) { // Register these nodes with the return trees, unless we're still at the // (already-created) roots: if path != "/" { if err := walkchunk(path, i1, w.dir1, w.root1); err != nil { return err } if err := walkchunk(path, i2, w.dir2, w.root2); err != nil { return err } } is1Dir := i1 != nil && i1.IsDir() is2Dir := i2 != nil && i2.IsDir() sameDevice := false if i1 != nil && i2 != nil { si1 := i1.Sys().(*syscall.Stat_t) si2 := i2.Sys().(*syscall.Stat_t) if si1.Dev == si2.Dev { sameDevice = true } } // If these files are both non-existent, or leaves (non-dirs), we are done. if !is1Dir && !is2Dir { return nil } // Fetch the names of all the files contained in both directories being walked: var names1, names2 []nameIno if is1Dir { names1, err = readdirnames(filepath.Join(w.dir1, path)) // getdents(2): fs access if err != nil { return err } } if is2Dir { names2, err = readdirnames(filepath.Join(w.dir2, path)) // getdents(2): fs access if err != nil { return err } } // We have lists of the files contained in both parallel directories, sorted // in the same order. Walk them in parallel, generating a unique merged list // of all items present in either or both directories. var names []string ix1 := 0 ix2 := 0 for ix1 < len(names1) && ix2 < len(names2) { ni1 := names1[ix1] ni2 := names2[ix2] switch bytes.Compare([]byte(ni1.name), []byte(ni2.name)) { case -1: // ni1 < ni2 -- advance ni1 // we will not encounter ni1 in names2 names = append(names, ni1.name) ix1++ case 0: // ni1 == ni2 if ni1.ino != ni2.ino || !sameDevice { names = append(names, ni1.name) } ix1++ ix2++ case 1: // ni1 > ni2 -- advance ni2 // we will not encounter ni2 in names1 names = append(names, ni2.name) ix2++ } } for ix1 < len(names1) { names = append(names, names1[ix1].name) ix1++ } for ix2 < len(names2) { names = append(names, names2[ix2].name) ix2++ } // For each of the names present in either or both of the directories being // iterated, stat the name under each root, and recurse the pair of them: for _, name := range names { fname := filepath.Join(path, name) var cInfo1, cInfo2 os.FileInfo if is1Dir { cInfo1, err = os.Lstat(filepath.Join(w.dir1, fname)) // lstat(2): fs access if err != nil && !os.IsNotExist(err) { return err } } if is2Dir { cInfo2, err = os.Lstat(filepath.Join(w.dir2, fname)) // lstat(2): fs access if err != nil && !os.IsNotExist(err) { return err } } if err = w.walk(fname, cInfo1, cInfo2); err != nil { return err } } return nil } // {name,inode} pairs used to support the early-pruning logic of the walker type type nameIno struct { name string ino uint64 } // readdirnames is a hacked-apart version of the Go stdlib code, exposing inode // numbers further up the stack when reading directory contents. Unlike // os.Readdirnames, which returns a list of filenames, this function returns a // list of {filename,inode} pairs. func readdirnames(dirname string) (names []nameIno, err error) { var ( size = 100 buf = make([]byte, 4096) nbuf int bufp int nb int ) f, err := os.Open(dirname) if err != nil { return nil, err } defer f.Close() names = make([]nameIno, 0, size) // Empty with room to grow. for { // Refill the buffer if necessary if bufp >= nbuf { bufp = 0 nbuf, err = unix.ReadDirent(int(f.Fd()), buf) // getdents on linux if nbuf < 0 { nbuf = 0 } if err != nil { return nil, os.NewSyscallError("readdirent", err) } if nbuf <= 0 { break // EOF } } // Drain the buffer nb, names = parseDirent(buf[bufp:nbuf], names) bufp += nb } slices.SortFunc(names, func(a, b nameIno) int { return cmp.Compare(a.name, b.name) }) return names, nil } // parseDirent is a minor modification of unix.ParseDirent (linux version) // which returns {name,inode} pairs instead of just names. func parseDirent(buf []byte, names []nameIno) (consumed int, newnames []nameIno) { origlen := len(buf) for len(buf) > 0 { dirent := (*unix.Dirent)(unsafe.Pointer(&buf[0])) buf = buf[dirent.Reclen:] if dirent.Ino == 0 { // File absent in directory. continue } builder := make([]byte, 0, dirent.Reclen) for i := range len(dirent.Name) { if dirent.Name[i] == 0 { break } builder = append(builder, byte(dirent.Name[i])) } name := string(builder) if name == "." || name == ".." { // Useless names continue } names = append(names, nameIno{name, dirent.Ino}) } return origlen - len(buf), names } // OverlayChanges walks the path rw and determines changes for the files in the path, // with respect to the parent layers func OverlayChanges(layers []string, rw string) ([]Change, error) { dc := func(root, path string, fi os.FileInfo) (string, error) { r, err := overlayDeletedFile(layers, root, path, fi) if err != nil { return "", fmt.Errorf("overlay deleted file query: %w", err) } return r, nil } return changes(layers, rw, dc, nil, overlayLowerContainsWhiteout) } func overlayLowerContainsWhiteout(root, path string) (bool, error) { // Whiteout for a file or directory has the same name, but is for a character // device with major/minor of 0/0. stat, err := os.Stat(filepath.Join(root, path)) if err != nil && !os.IsNotExist(err) && !isENOTDIR(err) { // Not sure what happened here. return false, err } if err == nil && stat.Mode()&os.ModeCharDevice != 0 { if isWhiteOut(stat) { return true, nil } } return false, nil } func overlayDeletedFile(layers []string, root, path string, fi os.FileInfo) (string, error) { // If it's a whiteout item, then a file or directory with that name is removed by this layer. if fi.Mode()&os.ModeCharDevice != 0 { if isWhiteOut(fi) { return path, nil } } // After this we only need to pay attention to directories. if !fi.IsDir() { return "", nil } // If the directory isn't marked as opaque, then it's just a normal directory. opaque, err := system.Lgetxattr(filepath.Join(root, path), getOverlayOpaqueXattrName()) if err != nil { return "", fmt.Errorf("failed querying overlay opaque xattr: %w", err) } if len(opaque) != 1 || opaque[0] != 'y' { return "", err } // If there are no lower layers, then it can't have been deleted and recreated in this layer. if len(layers) == 0 { return "", err } // At this point, we have a directory that's opaque. If it appears in one of the lower // layers, then it was newly-created here, so it wasn't also deleted here. for _, layer := range layers { stat, err := os.Stat(filepath.Join(layer, path)) if err != nil && !os.IsNotExist(err) && !isENOTDIR(err) { // Not sure what happened here. return "", err } if err == nil { if stat.Mode()&os.ModeCharDevice != 0 { if isWhiteOut(stat) { return "", nil } } // It's not whiteout, so it was there in the older layer, so it has to be // marked as deleted in this layer. return path, nil } for dir := filepath.Dir(path); dir != "" && dir != string(os.PathSeparator); dir = filepath.Dir(dir) { // Check for whiteout for a parent directory. stat, err := os.Stat(filepath.Join(layer, dir)) if err != nil && !os.IsNotExist(err) && !isENOTDIR(err) { // Not sure what happened here. return "", err } if err == nil { if stat.Mode()&os.ModeCharDevice != 0 { if isWhiteOut(stat) { return "", nil } } } } } // We didn't find the same path in any older layers, so it was new in this one. return "", nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/archive/changes_other.go ================================================ //go:build !linux package archive import ( "fmt" "io/fs" "os" "path/filepath" "runtime" "strings" "go.podman.io/storage/pkg/idtools" "go.podman.io/storage/pkg/system" ) func collectFileInfoForChanges(oldDir, newDir string, oldIDMap, newIDMap *idtools.IDMappings) (*FileInfo, *FileInfo, error) { var ( oldRoot, newRoot *FileInfo err1, err2 error errs = make(chan error, 2) ) go func() { oldRoot, err1 = collectFileInfo(oldDir, oldIDMap) errs <- err1 }() go func() { newRoot, err2 = collectFileInfo(newDir, newIDMap) errs <- err2 }() // block until both routines have returned for range 2 { if err := <-errs; err != nil { return nil, nil, err } } return oldRoot, newRoot, nil } func collectFileInfo(sourceDir string, idMappings *idtools.IDMappings) (*FileInfo, error) { root := newRootFileInfo(idMappings) sourceStat, err := system.Lstat(sourceDir) if err != nil { return nil, err } err = filepath.WalkDir(sourceDir, func(path string, d fs.DirEntry, err error) error { if err != nil { return err } // Rebase path relPath, err := filepath.Rel(sourceDir, path) if err != nil { return err } // As this runs on the daemon side, file paths are OS specific. relPath = filepath.Join(string(os.PathSeparator), relPath) // See https://github.com/golang/go/issues/9168 - bug in filepath.Join. // Temporary workaround. If the returned path starts with two backslashes, // trim it down to a single backslash. Only relevant on Windows. if runtime.GOOS == "windows" { if strings.HasPrefix(relPath, `\\`) { relPath = relPath[1:] } } if relPath == string(os.PathSeparator) { return nil } parent := root.LookUp(filepath.Dir(relPath)) if parent == nil { return fmt.Errorf("collectFileInfo: Unexpectedly no parent for %s", relPath) } info := &FileInfo{ name: filepath.Base(relPath), children: make(map[string]*FileInfo), parent: parent, idMappings: idMappings, } s, err := system.Lstat(path) if err != nil { return err } // Don't cross mount points. This ignores file mounts to avoid // generating a diff which deletes all files following the // mount. if s.Dev() != sourceStat.Dev() && s.IsDir() { return filepath.SkipDir } info.stat = s info.capability, _ = system.Lgetxattr(path, "security.capability") parent.children[info.name] = info return nil }) if err != nil { return nil, err } return root, nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/archive/changes_unix.go ================================================ //go:build !windows package archive import ( "os" "syscall" "go.podman.io/storage/pkg/idtools" "go.podman.io/storage/pkg/system" "golang.org/x/sys/unix" ) func statDifferent(oldStat *system.StatT, oldInfo *FileInfo, newStat *system.StatT, newInfo *FileInfo) bool { // Don't look at size for dirs, its not a good measure of change oldUID, oldGID := oldStat.UID(), oldStat.GID() uid, gid := newStat.UID(), newStat.GID() if cuid, cgid, err := newInfo.idMappings.ToContainer(idtools.IDPair{UID: int(uid), GID: int(gid)}); err == nil { uid = uint32(cuid) gid = uint32(cgid) if oldInfo != nil { if oldcuid, oldcgid, err := oldInfo.idMappings.ToContainer(idtools.IDPair{UID: int(oldUID), GID: int(oldGID)}); err == nil { oldUID = uint32(oldcuid) oldGID = uint32(oldcgid) } } } ownerChanged := uid != oldUID || gid != oldGID if oldStat.Mode() != newStat.Mode() || ownerChanged || oldStat.Rdev() != newStat.Rdev() || oldStat.Flags() != newStat.Flags() || !sameFsTimeSpec(oldStat.Mtim(), newStat.Mtim()) || // Don't look at size for dirs, its not a good measure of change ((oldStat.Mode()&unix.S_IFDIR != unix.S_IFDIR) && (oldStat.Size() != newStat.Size())) { return true } return false } func (info *FileInfo) isDir() bool { return info.parent == nil || info.stat.Mode()&unix.S_IFDIR != 0 } func getIno(fi os.FileInfo) uint64 { return fi.Sys().(*syscall.Stat_t).Ino } func hasHardlinks(fi os.FileInfo) bool { return fi.Sys().(*syscall.Stat_t).Nlink > 1 } ================================================ FILE: vendor/go.podman.io/storage/pkg/archive/changes_windows.go ================================================ package archive import ( "os" "go.podman.io/storage/pkg/system" ) func statDifferent(oldStat *system.StatT, _ *FileInfo, newStat *system.StatT, _ *FileInfo) bool { // Don't look at size for dirs, its not a good measure of change if oldStat.Mtim() != newStat.Mtim() || oldStat.Mode() != newStat.Mode() || oldStat.Size() != newStat.Size() && !oldStat.Mode().IsDir() { return true } return false } func (info *FileInfo) isDir() bool { return info.parent == nil || info.stat.Mode().IsDir() } func getIno(_ os.FileInfo) uint64 { return 0 } func hasHardlinks(_ os.FileInfo) bool { return false } ================================================ FILE: vendor/go.podman.io/storage/pkg/archive/copy.go ================================================ package archive import ( "archive/tar" "errors" "io" "os" "path/filepath" "strings" "github.com/sirupsen/logrus" "go.podman.io/storage/pkg/fileutils" ) // Errors used or returned by this file. var ( ErrNotDirectory = errors.New("not a directory") ErrDirNotExists = errors.New("no such directory") ErrCannotCopyDir = errors.New("cannot copy directory") ErrInvalidCopySource = errors.New("invalid copy source content") ) // PreserveTrailingDotOrSeparator returns the given cleaned path (after // processing using any utility functions from the path or filepath stdlib // packages) and appends a trailing `/.` or `/` if its corresponding original // path (from before being processed by utility functions from the path or // filepath stdlib packages) ends with a trailing `/.` or `/`. If the cleaned // path already ends in a `.` path segment, then another is not added. If the // clean path already ends in a path separator, then another is not added. func PreserveTrailingDotOrSeparator(cleanedPath, originalPath string) string { // Ensure paths are in platform semantics cleanedPath = normalizePath(cleanedPath) originalPath = normalizePath(originalPath) if !specifiesCurrentDir(cleanedPath) && specifiesCurrentDir(originalPath) { if !hasTrailingPathSeparator(cleanedPath) { // Add a separator if it doesn't already end with one (a cleaned // path would only end in a separator if it is the root). cleanedPath += string(filepath.Separator) } cleanedPath += "." } if !hasTrailingPathSeparator(cleanedPath) && hasTrailingPathSeparator(originalPath) { cleanedPath += string(filepath.Separator) } return cleanedPath } // assertsDirectory returns whether the given path is // asserted to be a directory, i.e., the path ends with // a trailing '/' or `/.`, assuming a path separator of `/`. func assertsDirectory(path string) bool { return hasTrailingPathSeparator(path) || specifiesCurrentDir(path) } // hasTrailingPathSeparator returns whether the given // path ends with the system's path separator character. func hasTrailingPathSeparator(path string) bool { return len(path) > 0 && os.IsPathSeparator(path[len(path)-1]) } // specifiesCurrentDir returns whether the given path specifies // a "current directory", i.e., the last path segment is `.`. func specifiesCurrentDir(path string) bool { return filepath.Base(path) == "." } // SplitPathDirEntry splits the given path between its directory name and its // basename by first cleaning the path but preserves a trailing "." if the // original path specified the current directory. func SplitPathDirEntry(path string) (dir, base string) { cleanedPath := filepath.Clean(normalizePath(path)) if specifiesCurrentDir(path) { cleanedPath += string(filepath.Separator) + "." } return filepath.Dir(cleanedPath), filepath.Base(cleanedPath) } // TarResource archives the resource described by the given CopyInfo to a Tar // archive. A non-nil error is returned if sourcePath does not exist or is // asserted to be a directory but exists as another type of file. // // This function acts as a convenient wrapper around TarWithOptions, which // requires a directory as the source path. TarResource accepts either a // directory or a file path and correctly sets the Tar options. func TarResource(sourceInfo CopyInfo) (content io.ReadCloser, err error) { return TarResourceRebase(sourceInfo.Path, sourceInfo.RebaseName) } // TarResourceRebase is like TarResource but renames the first path element of // items in the resulting tar archive to match the given rebaseName if not "". func TarResourceRebase(sourcePath, rebaseName string) (io.ReadCloser, error) { sourcePath = normalizePath(sourcePath) if err := fileutils.Lexists(sourcePath); err != nil { // Catches the case where the source does not exist or is not a // directory if asserted to be a directory, as this also causes an // error. return nil, err } // Separate the source path between its directory and // the entry in that directory which we are archiving. sourceDir, sourceBase := SplitPathDirEntry(sourcePath) filter := []string{sourceBase} logrus.Debugf("copying %q from %q", sourceBase, sourceDir) return TarWithOptions(sourceDir, &TarOptions{ Compression: Uncompressed, IncludeFiles: filter, IncludeSourceDir: true, RebaseNames: map[string]string{ sourceBase: rebaseName, }, }) } // CopyInfo holds basic info about the source // or destination path of a copy operation. type CopyInfo struct { Path string Exists bool IsDir bool RebaseName string } // CopyInfoSourcePath stats the given path to create a CopyInfo // struct representing that resource for the source of an archive copy // operation. The given path should be an absolute local path. A source path // has all symlinks evaluated that appear before the last path separator ("/" // on Unix). As it is to be a copy source, the path must exist. func CopyInfoSourcePath(path string, followLink bool) (CopyInfo, error) { // normalize the file path and then evaluate the symbol link // we will use the target file instead of the symbol link if // followLink is set path = normalizePath(path) resolvedPath, rebaseName, err := ResolveHostSourcePath(path, followLink) if err != nil { return CopyInfo{}, err } stat, err := os.Lstat(resolvedPath) if err != nil { return CopyInfo{}, err } return CopyInfo{ Path: resolvedPath, Exists: true, IsDir: stat.IsDir(), RebaseName: rebaseName, }, nil } // CopyInfoDestinationPath stats the given path to create a CopyInfo // struct representing that resource for the destination of an archive copy // operation. The given path should be an absolute local path. func CopyInfoDestinationPath(path string) (info CopyInfo, err error) { maxSymlinkIter := 10 // filepath.EvalSymlinks uses 255, but 10 already seems like a lot. path = normalizePath(path) originalPath := path stat, err := os.Lstat(path) if err == nil && stat.Mode()&os.ModeSymlink == 0 { // The path exists and is not a symlink. return CopyInfo{ Path: path, Exists: true, IsDir: stat.IsDir(), }, nil } // While the path is a symlink. for n := 0; err == nil && stat.Mode()&os.ModeSymlink != 0; n++ { if n > maxSymlinkIter { // Don't follow symlinks more than this arbitrary number of times. return CopyInfo{}, errors.New("too many symlinks in " + originalPath) } // The path is a symbolic link. We need to evaluate it so that the // destination of the copy operation is the link target and not the // link itself. This is notably different than CopyInfoSourcePath which // only evaluates symlinks before the last appearing path separator. // Also note that it is okay if the last path element is a broken // symlink as the copy operation should create the target. var linkTarget string linkTarget, err = os.Readlink(path) if err != nil { return CopyInfo{}, err } if !filepath.IsAbs(linkTarget) { // Join with the parent directory. dstParent, _ := SplitPathDirEntry(path) linkTarget = filepath.Join(dstParent, linkTarget) } path = linkTarget stat, err = os.Lstat(path) } if err != nil { // It's okay if the destination path doesn't exist. We can still // continue the copy operation if the parent directory exists. if !os.IsNotExist(err) { return CopyInfo{}, err } // Ensure destination parent dir exists. dstParent, _ := SplitPathDirEntry(path) parentDirStat, err := os.Lstat(dstParent) if err != nil { return CopyInfo{}, err } if !parentDirStat.IsDir() { return CopyInfo{}, ErrNotDirectory } return CopyInfo{Path: path}, nil } // The path exists after resolving symlinks. return CopyInfo{ Path: path, Exists: true, IsDir: stat.IsDir(), }, nil } // PrepareArchiveCopy prepares the given srcContent archive, which should // contain the archived resource described by srcInfo, to the destination // described by dstInfo. Returns the possibly modified content archive along // with the path to the destination directory which it should be extracted to. func PrepareArchiveCopy(srcContent io.Reader, srcInfo, dstInfo CopyInfo) (dstDir string, content io.ReadCloser, err error) { // Ensure in platform semantics srcInfo.Path = normalizePath(srcInfo.Path) dstInfo.Path = normalizePath(dstInfo.Path) // Separate the destination path between its directory and base // components in case the source archive contents need to be rebased. dstDir, dstBase := SplitPathDirEntry(dstInfo.Path) _, srcBase := SplitPathDirEntry(srcInfo.Path) switch { case dstInfo.Exists && dstInfo.IsDir: // The destination exists as a directory. No alteration // to srcContent is needed as its contents can be // simply extracted to the destination directory. return dstInfo.Path, io.NopCloser(srcContent), nil case dstInfo.Exists && srcInfo.IsDir: // The destination exists as some type of file and the source // content is a directory. This is an error condition since // you cannot copy a directory to an existing file location. return "", nil, ErrCannotCopyDir case dstInfo.Exists: // The destination exists as some type of file and the source content // is also a file. The source content entry will have to be renamed to // have a basename which matches the destination path's basename. if len(srcInfo.RebaseName) != 0 { srcBase = srcInfo.RebaseName } return dstDir, RebaseArchiveEntries(srcContent, srcBase, dstBase), nil case srcInfo.IsDir: // The destination does not exist and the source content is an archive // of a directory. The archive should be extracted to the parent of // the destination path instead, and when it is, the directory that is // created as a result should take the name of the destination path. // The source content entries will have to be renamed to have a // basename which matches the destination path's basename. if len(srcInfo.RebaseName) != 0 { srcBase = srcInfo.RebaseName } return dstDir, RebaseArchiveEntries(srcContent, srcBase, dstBase), nil case assertsDirectory(dstInfo.Path): // The destination does not exist and is asserted to be created as a // directory, but the source content is not a directory. This is an // error condition since you cannot create a directory from a file // source. return "", nil, ErrDirNotExists default: // The last remaining case is when the destination does not exist, is // not asserted to be a directory, and the source content is not an // archive of a directory. It this case, the destination file will need // to be created when the archive is extracted and the source content // entry will have to be renamed to have a basename which matches the // destination path's basename. if len(srcInfo.RebaseName) != 0 { srcBase = srcInfo.RebaseName } return dstDir, RebaseArchiveEntries(srcContent, srcBase, dstBase), nil } } // RebaseArchiveEntries rewrites the given srcContent archive replacing // an occurrence of oldBase with newBase at the beginning of entry names. func RebaseArchiveEntries(srcContent io.Reader, oldBase, newBase string) io.ReadCloser { if oldBase == string(os.PathSeparator) { // If oldBase specifies the root directory, use an empty string as // oldBase instead so that newBase doesn't replace the path separator // that all paths will start with. oldBase = "" } rebased, w := io.Pipe() go func() { srcTar := tar.NewReader(srcContent) rebasedTar := tar.NewWriter(w) for { hdr, err := srcTar.Next() if err == io.EOF { // Signals end of archive. rebasedTar.Close() w.Close() return } if err != nil { w.CloseWithError(err) return } hdr.Name = strings.Replace(hdr.Name, oldBase, newBase, 1) if hdr.Typeflag == tar.TypeLink { hdr.Linkname = strings.Replace(hdr.Linkname, oldBase, newBase, 1) } if err = rebasedTar.WriteHeader(hdr); err != nil { w.CloseWithError(err) return } if _, err = io.Copy(rebasedTar, srcTar); err != nil { w.CloseWithError(err) return } } }() return rebased } // CopyResource performs an archive copy from the given source path to the // given destination path. The source path MUST exist and the destination // path's parent directory must exist. func CopyResource(srcPath, dstPath string, followLink bool) error { var ( srcInfo CopyInfo err error ) // Ensure in platform semantics srcPath = normalizePath(srcPath) dstPath = normalizePath(dstPath) // Clean the source and destination paths. srcPath = PreserveTrailingDotOrSeparator(filepath.Clean(srcPath), srcPath) dstPath = PreserveTrailingDotOrSeparator(filepath.Clean(dstPath), dstPath) if srcInfo, err = CopyInfoSourcePath(srcPath, followLink); err != nil { return err } content, err := TarResource(srcInfo) if err != nil { return err } defer content.Close() return CopyTo(content, srcInfo, dstPath) } // CopyTo handles extracting the given content whose // entries should be sourced from srcInfo to dstPath. func CopyTo(content io.Reader, srcInfo CopyInfo, dstPath string) error { // The destination path need not exist, but CopyInfoDestinationPath will // ensure that at least the parent directory exists. dstInfo, err := CopyInfoDestinationPath(normalizePath(dstPath)) if err != nil { return err } dstDir, copyArchive, err := PrepareArchiveCopy(content, srcInfo, dstInfo) if err != nil { return err } defer copyArchive.Close() options := &TarOptions{ NoLchown: true, NoOverwriteDirNonDir: true, } return Untar(copyArchive, dstDir, options) } // ResolveHostSourcePath decides real path need to be copied with parameters such as // whether to follow symbol link or not, if followLink is true, resolvedPath will return // link target of any symbol link file, else it will only resolve symlink of directory // but return symbol link file itself without resolving. func ResolveHostSourcePath(path string, followLink bool) (resolvedPath, rebaseName string, err error) { if followLink { resolvedPath, err = filepath.EvalSymlinks(path) if err != nil { return "", "", err } resolvedPath, rebaseName = GetRebaseName(path, resolvedPath) } else { dirPath, basePath := filepath.Split(path) // if not follow symbol link, then resolve symbol link of parent dir var resolvedDirPath string resolvedDirPath, err = filepath.EvalSymlinks(dirPath) if err != nil { return "", "", err } // resolvedDirPath will have been cleaned (no trailing path separators) so // we can manually join it with the base path element. resolvedPath = resolvedDirPath + string(filepath.Separator) + basePath if hasTrailingPathSeparator(path) && filepath.Base(path) != filepath.Base(resolvedPath) { rebaseName = filepath.Base(path) } } return resolvedPath, rebaseName, nil } // GetRebaseName normalizes and compares path and resolvedPath, // return completed resolved path and rebased file name func GetRebaseName(path, resolvedPath string) (string, string) { // linkTarget will have been cleaned (no trailing path separators and dot) so // we can manually join it with them var rebaseName string if specifiesCurrentDir(path) && !specifiesCurrentDir(resolvedPath) { resolvedPath += string(filepath.Separator) + "." } if hasTrailingPathSeparator(path) && !hasTrailingPathSeparator(resolvedPath) { resolvedPath += string(filepath.Separator) } if filepath.Base(path) != filepath.Base(resolvedPath) { // In the case where the path had a trailing separator and a symlink // evaluation has changed the last path component, we will need to // rebase the name in the archive that is being copied to match the // originally requested name. rebaseName = filepath.Base(path) } return resolvedPath, rebaseName } ================================================ FILE: vendor/go.podman.io/storage/pkg/archive/copy_unix.go ================================================ //go:build !windows package archive import ( "path/filepath" ) func normalizePath(path string) string { return filepath.ToSlash(path) } ================================================ FILE: vendor/go.podman.io/storage/pkg/archive/copy_windows.go ================================================ package archive import ( "path/filepath" ) func normalizePath(path string) string { return filepath.FromSlash(path) } ================================================ FILE: vendor/go.podman.io/storage/pkg/archive/diff.go ================================================ package archive import ( "archive/tar" "fmt" "io" "io/fs" "os" "path/filepath" "runtime" "strings" "github.com/sirupsen/logrus" "go.podman.io/storage/pkg/fileutils" "go.podman.io/storage/pkg/idtools" "go.podman.io/storage/pkg/pools" "go.podman.io/storage/pkg/system" ) // UnpackLayer unpack `layer` to a `dest`. The stream `layer` can be // compressed or uncompressed. // Returns the size in bytes of the contents of the layer. func UnpackLayer(dest string, layer io.Reader, options *TarOptions) (size int64, err error) { tr := tar.NewReader(layer) trBuf := pools.BufioReader32KPool.Get(tr) defer pools.BufioReader32KPool.Put(trBuf) var dirs []*tar.Header unpackedPaths := make(map[string]struct{}) if options == nil { options = &TarOptions{} } idMappings := idtools.NewIDMappingsFromMaps(options.UIDMaps, options.GIDMaps) aufsTempdir := "" aufsHardlinks := make(map[string]*tar.Header) buffer := make([]byte, 1<<20) // Iterate through the files in the archive. for { hdr, err := tr.Next() if err == io.EOF { // end of tar archive break } if err != nil { return 0, err } size += hdr.Size // Normalize name, for safety and for a simple is-root check hdr.Name = filepath.Clean(hdr.Name) // Windows does not support filenames with colons in them. Ignore // these files. This is not a problem though (although it might // appear that it is). Let's suppose a client is running docker pull. // The daemon it points to is Windows. Would it make sense for the // client to be doing a docker pull Ubuntu for example (which has files // with colons in the name under /usr/share/man/man3)? No, absolutely // not as it would really only make sense that they were pulling a // Windows image. However, for development, it is necessary to be able // to pull Linux images which are in the repository. // // TODO Windows. Once the registry is aware of what images are Windows- // specific or Linux-specific, this warning should be changed to an error // to cater for the situation where someone does manage to upload a Linux // image but have it tagged as Windows inadvertently. if runtime.GOOS == windows { if strings.Contains(hdr.Name, ":") { logrus.Warnf("Windows: Ignoring %s (is this a Linux image?)", hdr.Name) continue } } // Note as these operations are platform specific, so must the slash be. if !strings.HasSuffix(hdr.Name, string(os.PathSeparator)) { // Not the root directory, ensure that the parent directory exists. // This happened in some tests where an image had a tarfile without any // parent directories. parent := filepath.Dir(hdr.Name) parentPath := filepath.Join(dest, parent) if err := fileutils.Lexists(parentPath); err != nil && os.IsNotExist(err) { err = os.MkdirAll(parentPath, 0o755) if err != nil { return 0, err } } } // Skip AUFS metadata dirs if strings.HasPrefix(hdr.Name, WhiteoutMetaPrefix) { // Regular files inside /.wh..wh.plnk can be used as hardlink targets // We don't want this directory, but we need the files in them so that // such hardlinks can be resolved. if strings.HasPrefix(hdr.Name, WhiteoutLinkDir) && hdr.Typeflag == tar.TypeReg { basename := filepath.Base(hdr.Name) aufsHardlinks[basename] = hdr if aufsTempdir == "" { if aufsTempdir, err = os.MkdirTemp("", "storageplnk"); err != nil { return 0, err } defer os.RemoveAll(aufsTempdir) } if err := extractTarFileEntry(filepath.Join(aufsTempdir, basename), dest, hdr, tr, true, nil, options.InUserNS, options.IgnoreChownErrors, options.ForceMask, buffer); err != nil { return 0, err } } if hdr.Name != WhiteoutOpaqueDir { continue } } path := filepath.Join(dest, hdr.Name) rel, err := filepath.Rel(dest, path) if err != nil { return 0, err } // Note as these operations are platform specific, so must the slash be. if strings.HasPrefix(rel, ".."+string(os.PathSeparator)) { return 0, breakoutError(fmt.Errorf("%q is outside of %q", hdr.Name, dest)) } base := filepath.Base(path) if strings.HasPrefix(base, WhiteoutPrefix) { dir := filepath.Dir(path) if base == WhiteoutOpaqueDir { err := fileutils.Lexists(dir) if err != nil { return 0, err } err = filepath.WalkDir(dir, func(path string, d fs.DirEntry, err error) error { if err != nil { if os.IsNotExist(err) { err = nil // parent was deleted } return err } if path == dir { return nil } if _, exists := unpackedPaths[path]; !exists { if err := resetImmutable(path, nil); err != nil { return err } err := os.RemoveAll(path) return err } return nil }) if err != nil { return 0, err } } else { originalBase := base[len(WhiteoutPrefix):] originalPath := filepath.Join(dir, originalBase) if err := resetImmutable(originalPath, nil); err != nil { return 0, err } if err := os.RemoveAll(originalPath); err != nil { return 0, err } } } else { // If path exits we almost always just want to remove and replace it. // The only exception is when it is a directory *and* the file from // the layer is also a directory. Then we want to merge them (i.e. // just apply the metadata from the layer). // // We always reset the immutable flag (if present) to allow metadata // changes and to allow directory modification. The flag will be // re-applied based on the contents of hdr either at the end for // directories or in extractTarFileEntry otherwise. if fi, err := os.Lstat(path); err == nil { if err := resetImmutable(path, &fi); err != nil { return 0, err } if !fi.IsDir() || hdr.Typeflag != tar.TypeDir { if err := os.RemoveAll(path); err != nil { return 0, err } } } trBuf.Reset(tr) srcData := io.Reader(trBuf) srcHdr := hdr // Hard links into /.wh..wh.plnk don't work, as we don't extract that directory, so // we manually retarget these into the temporary files we extracted them into if hdr.Typeflag == tar.TypeLink && strings.HasPrefix(filepath.Clean(hdr.Linkname), WhiteoutLinkDir) { linkBasename := filepath.Base(hdr.Linkname) srcHdr = aufsHardlinks[linkBasename] if srcHdr == nil { return 0, fmt.Errorf("invalid aufs hardlink") } tmpFile, err := os.Open(filepath.Join(aufsTempdir, linkBasename)) if err != nil { return 0, err } defer tmpFile.Close() srcData = tmpFile } if err := remapIDs(nil, idMappings, options.ChownOpts, srcHdr); err != nil { return 0, err } if err := extractTarFileEntry(path, dest, srcHdr, srcData, true, nil, options.InUserNS, options.IgnoreChownErrors, options.ForceMask, buffer); err != nil { return 0, err } // Directory mtimes must be handled at the end to avoid further // file creation in them to modify the directory mtime if hdr.Typeflag == tar.TypeDir { dirs = append(dirs, hdr) } unpackedPaths[path] = struct{}{} } } for _, hdr := range dirs { path := filepath.Join(dest, hdr.Name) if err := system.Chtimes(path, hdr.AccessTime, hdr.ModTime); err != nil { return 0, err } if err := WriteFileFlagsFromTarHeader(path, hdr); err != nil { return 0, err } } return size, nil } // ApplyLayer parses a diff in the standard layer format from `layer`, // and applies it to the directory `dest`. The stream `layer` can be // compressed or uncompressed. // Returns the size in bytes of the contents of the layer. func ApplyLayer(dest string, layer io.Reader) (int64, error) { return applyLayerHandler(dest, layer, &TarOptions{}, true) } // ApplyUncompressedLayer parses a diff in the standard layer format from // `layer`, and applies it to the directory `dest`. The stream `layer` // can only be uncompressed. // Returns the size in bytes of the contents of the layer. func ApplyUncompressedLayer(dest string, layer io.Reader, options *TarOptions) (int64, error) { return applyLayerHandler(dest, layer, options, false) } // do the bulk load of ApplyLayer, but allow for not calling DecompressStream func applyLayerHandler(dest string, layer io.Reader, options *TarOptions, decompress bool) (int64, error) { dest = filepath.Clean(dest) // We need to be able to set any perms oldmask, err := system.Umask(0) if err != nil { return 0, err } defer func() { _, _ = system.Umask(oldmask) // Ignore err. This can only fail with ErrNotSupportedPlatform, in which case we would have failed above. }() if decompress { layer, err = DecompressStream(layer) if err != nil { return 0, err } } return UnpackLayer(dest, layer, options) } ================================================ FILE: vendor/go.podman.io/storage/pkg/archive/fflags_bsd.go ================================================ //go:build freebsd package archive import ( "archive/tar" "fmt" "math/bits" "os" "strings" "syscall" "go.podman.io/storage/pkg/system" ) const ( paxSCHILYFflags = "SCHILY.fflags" ) var ( flagNameToValue = map[string]uint32{ "sappnd": system.SF_APPEND, "sappend": system.SF_APPEND, "arch": system.SF_ARCHIVED, "archived": system.SF_ARCHIVED, "schg": system.SF_IMMUTABLE, "schange": system.SF_IMMUTABLE, "simmutable": system.SF_IMMUTABLE, "sunlnk": system.SF_NOUNLINK, "sunlink": system.SF_NOUNLINK, "snapshot": system.SF_SNAPSHOT, "uappnd": system.UF_APPEND, "uappend": system.UF_APPEND, "uarch": system.UF_ARCHIVE, "uarchive": system.UF_ARCHIVE, "hidden": system.UF_HIDDEN, "uhidden": system.UF_HIDDEN, "uchg": system.UF_IMMUTABLE, "uchange": system.UF_IMMUTABLE, "uimmutable": system.UF_IMMUTABLE, "uunlnk": system.UF_NOUNLINK, "uunlink": system.UF_NOUNLINK, "offline": system.UF_OFFLINE, "uoffline": system.UF_OFFLINE, "opaque": system.UF_OPAQUE, "rdonly": system.UF_READONLY, "urdonly": system.UF_READONLY, "readonly": system.UF_READONLY, "ureadonly": system.UF_READONLY, "reparse": system.UF_REPARSE, "ureparse": system.UF_REPARSE, "sparse": system.UF_SPARSE, "usparse": system.UF_SPARSE, "system": system.UF_SYSTEM, "usystem": system.UF_SYSTEM, } // Only include the short names for the reverse map flagValueToName = map[uint32]string{ system.SF_APPEND: "sappnd", system.SF_ARCHIVED: "arch", system.SF_IMMUTABLE: "schg", system.SF_NOUNLINK: "sunlnk", system.SF_SNAPSHOT: "snapshot", system.UF_APPEND: "uappnd", system.UF_ARCHIVE: "uarch", system.UF_HIDDEN: "hidden", system.UF_IMMUTABLE: "uchg", system.UF_NOUNLINK: "uunlnk", system.UF_OFFLINE: "offline", system.UF_OPAQUE: "opaque", system.UF_READONLY: "rdonly", system.UF_REPARSE: "reparse", system.UF_SPARSE: "sparse", system.UF_SYSTEM: "system", } ) func parseFileFlags(fflags string) (uint32, uint32, error) { var set, clear uint32 = 0, 0 for fflag := range strings.SplitSeq(fflags, ",") { isClear := false if clean, ok := strings.CutPrefix(fflag, "no"); ok { isClear = true fflag = clean } if value, ok := flagNameToValue[fflag]; ok { if isClear { clear |= value } else { set |= value } } else { return 0, 0, fmt.Errorf("parsing file flags, unrecognised token: %s", fflag) } } return set, clear, nil } func formatFileFlags(fflags uint32) (string, error) { res := []string{} for fflags != 0 { // Extract lowest set bit fflag := uint32(1) << bits.TrailingZeros32(fflags) if name, ok := flagValueToName[fflag]; ok { res = append(res, name) } else { return "", fmt.Errorf("formatting file flags, unrecognised flag: %x", fflag) } fflags &= ^fflag } return strings.Join(res, ","), nil } func ReadFileFlagsToTarHeader(path string, hdr *tar.Header) error { st, err := system.Lstat(path) if err != nil { return err } fflags, err := formatFileFlags(st.Flags()) if err != nil { return err } if fflags != "" { if hdr.PAXRecords == nil { hdr.PAXRecords = map[string]string{} } hdr.PAXRecords[paxSCHILYFflags] = fflags } return nil } func WriteFileFlagsFromTarHeader(path string, hdr *tar.Header) error { if fflags, ok := hdr.PAXRecords[paxSCHILYFflags]; ok { var set, clear uint32 set, clear, err := parseFileFlags(fflags) if err != nil { return err } // Apply the delta to the existing file flags st, err := system.Lstat(path) if err != nil { return err } return system.Lchflags(path, (st.Flags() & ^clear)|set) } return nil } func resetImmutable(path string, fi *os.FileInfo) error { var flags uint32 if fi != nil { flags = (*fi).Sys().(*syscall.Stat_t).Flags } else { st, err := system.Lstat(path) if err != nil { return err } flags = st.Flags() } if flags&(system.SF_IMMUTABLE|system.UF_IMMUTABLE) != 0 { flags &= ^(system.SF_IMMUTABLE | system.UF_IMMUTABLE) return system.Lchflags(path, flags) } return nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/archive/fflags_unsupported.go ================================================ //go:build !freebsd package archive import ( "archive/tar" "os" ) func ReadFileFlagsToTarHeader(path string, hdr *tar.Header) error { return nil } func WriteFileFlagsFromTarHeader(path string, hdr *tar.Header) error { return nil } func resetImmutable(_ string, _ *os.FileInfo) error { return nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/archive/filter.go ================================================ package archive import ( "bytes" "fmt" "io" "os/exec" "strings" "sync" ) var filterPath sync.Map func getFilterPath(name string) string { path, ok := filterPath.Load(name) if ok { return path.(string) } path, err := exec.LookPath(name) if err != nil { path = "" } filterPath.Store(name, path) return path.(string) } type errorRecordingReader struct { r io.Reader err error } func (r *errorRecordingReader) Read(p []byte) (int, error) { n, err := r.r.Read(p) if r.err == nil && err != io.EOF { r.err = err } return n, err } // tryProcFilter tries to run the command specified in args, passing input to its stdin and returning its stdout. // cleanup() is a caller provided function that will be called when the command finishes running, regardless of // whether it succeeds or fails. // If the command is not found, it returns (nil, false) and the cleanup function is not called. func tryProcFilter(args []string, input io.Reader, cleanup func()) (io.ReadCloser, bool) { path := getFilterPath(args[0]) if path == "" { return nil, false } var stderrBuf bytes.Buffer inputWithError := &errorRecordingReader{r: input} r, w := io.Pipe() cmd := exec.Command(path, args[1:]...) cmd.Stdin = inputWithError cmd.Stdout = w cmd.Stderr = &stderrBuf go func() { err := cmd.Run() // if there is an error reading from input, prefer to return that error if inputWithError.err != nil { err = inputWithError.err } else if err != nil && stderrBuf.Len() > 0 { err = fmt.Errorf("%s: %w", strings.TrimRight(stderrBuf.String(), "\n"), err) } w.CloseWithError(err) // CloseWithErr(nil) == Close() cleanup() }() return r, true } ================================================ FILE: vendor/go.podman.io/storage/pkg/archive/time_linux.go ================================================ package archive import ( "syscall" "time" ) func timeToTimespec(time time.Time) (ts syscall.Timespec) { if time.IsZero() { // Return UTIME_OMIT special value ts.Sec = 0 ts.Nsec = ((1 << 30) - 2) return ts } return syscall.NsecToTimespec(time.UnixNano()) } ================================================ FILE: vendor/go.podman.io/storage/pkg/archive/time_unsupported.go ================================================ //go:build !linux package archive import ( "syscall" "time" ) func timeToTimespec(time time.Time) (ts syscall.Timespec) { nsec := int64(0) if !time.IsZero() { nsec = time.UnixNano() } return syscall.NsecToTimespec(nsec) } ================================================ FILE: vendor/go.podman.io/storage/pkg/archive/whiteouts.go ================================================ package archive // Whiteouts are files with a special meaning for the layered filesystem. // Docker uses AUFS whiteout files inside exported archives. In other // filesystems these files are generated/handled on tar creation/extraction. // WhiteoutPrefix prefix means file is a whiteout. If this is followed by a // filename this means that file has been removed from the base layer. const WhiteoutPrefix = ".wh." // WhiteoutMetaPrefix prefix means whiteout has a special meaning and is not // for removing an actual file. Normally these files are excluded from exported // archives. const WhiteoutMetaPrefix = WhiteoutPrefix + WhiteoutPrefix // WhiteoutLinkDir is a directory AUFS uses for storing hardlink links to other // layers. Normally these should not go into exported archives and all changed // hardlinks should be copied to the top layer. const WhiteoutLinkDir = WhiteoutMetaPrefix + "plnk" // WhiteoutOpaqueDir file means directory has been made opaque - meaning // readdir calls to this directory do not follow to lower layers. const WhiteoutOpaqueDir = WhiteoutMetaPrefix + ".opq" ================================================ FILE: vendor/go.podman.io/storage/pkg/archive/wrap.go ================================================ package archive import ( "archive/tar" "bytes" "io" ) // Generate generates a new archive from the content provided // as input. // // `files` is a sequence of path/content pairs. A new file is // added to the archive for each pair. // If the last pair is incomplete, the file is created with an // empty content. For example: // // Generate("foo.txt", "hello world", "emptyfile") // // The above call will return an archive with 2 files: // - ./foo.txt with content "hello world" // - ./empty with empty content // // FIXME: stream content instead of buffering // FIXME: specify permissions and other archive metadata func Generate(input ...string) (io.Reader, error) { files := parseStringPairs(input...) buf := new(bytes.Buffer) tw := tar.NewWriter(buf) for _, file := range files { name, content := file[0], file[1] hdr := &tar.Header{ Name: name, Size: int64(len(content)), } if err := tw.WriteHeader(hdr); err != nil { return nil, err } if _, err := tw.Write([]byte(content)); err != nil { return nil, err } } if err := tw.Close(); err != nil { return nil, err } return buf, nil } func parseStringPairs(input ...string) [][2]string { output := make([][2]string, 0, len(input)/2+1) for i := 0; i < len(input); i += 2 { var pair [2]string pair[0] = input[i] if i+1 < len(input) { pair[1] = input[i+1] } output = append(output, pair) } return output } ================================================ FILE: vendor/go.podman.io/storage/pkg/chrootarchive/archive.go ================================================ package chrootarchive import ( stdtar "archive/tar" "fmt" "io" "os" "path/filepath" "sync" "go.podman.io/storage/pkg/archive" "go.podman.io/storage/pkg/fileutils" "go.podman.io/storage/pkg/idtools" "go.podman.io/storage/pkg/unshare" ) // NewArchiver returns a new Archiver which uses chrootarchive.Untar func NewArchiver(idMappings *idtools.IDMappings) *archive.Archiver { archiver := archive.NewArchiver(idMappings) archiver.Untar = Untar return archiver } // NewArchiverWithChown returns a new Archiver which uses chrootarchive.Untar and the provided ID mapping configuration on both ends func NewArchiverWithChown(tarIDMappings *idtools.IDMappings, chownOpts *idtools.IDPair, untarIDMappings *idtools.IDMappings) *archive.Archiver { archiver := archive.NewArchiverWithChown(tarIDMappings, chownOpts, untarIDMappings) archiver.Untar = Untar return archiver } // Untar reads a stream of bytes from `archive`, parses it as a tar archive, // and unpacks it into the directory at `dest`. // The archive may be compressed with one of the following algorithms: // // identity (uncompressed), gzip, bzip2, xz. func Untar(tarArchive io.Reader, dest string, options *archive.TarOptions) error { return untarHandler(tarArchive, dest, options, true, dest) } // UntarWithRoot is the same as `Untar`, but allows you to pass in a root directory // The root directory is the directory that will be chrooted to. // `dest` must be a path within `root`, if it is not an error will be returned. // // `root` should set to a directory which is not controlled by any potentially // malicious process. // // This should be used to prevent a potential attacker from manipulating `dest` // such that it would provide access to files outside of `dest` through things // like symlinks. Normally `ResolveSymlinksInScope` would handle this, however // sanitizing symlinks in this manner is inherently racey: // ref: CVE-2018-15664 func UntarWithRoot(tarArchive io.Reader, dest string, options *archive.TarOptions, root string) error { return untarHandler(tarArchive, dest, options, true, root) } // UntarUncompressed reads a stream of bytes from `archive`, parses it as a tar archive, // and unpacks it into the directory at `dest`. // The archive must be an uncompressed stream. func UntarUncompressed(tarArchive io.Reader, dest string, options *archive.TarOptions) error { return untarHandler(tarArchive, dest, options, false, dest) } // Handler for teasing out the automatic decompression func untarHandler(tarArchive io.Reader, dest string, options *archive.TarOptions, decompress bool, root string) error { if tarArchive == nil { return fmt.Errorf("empty archive") } if options == nil { options = &archive.TarOptions{} options.InUserNS = unshare.IsRootless() } idMappings := idtools.NewIDMappingsFromMaps(options.UIDMaps, options.GIDMaps) rootIDs := idMappings.RootPair() dest = filepath.Clean(dest) if err := fileutils.Exists(dest); os.IsNotExist(err) { if err := idtools.MkdirAllAndChownNew(dest, 0o755, rootIDs); err != nil { return err } } destVal, err := newUnpackDestination(root, dest) if err != nil { return err } defer destVal.Close() r := tarArchive if decompress { decompressedArchive, err := archive.DecompressStream(tarArchive) if err != nil { return err } defer decompressedArchive.Close() r = decompressedArchive } return invokeUnpack(r, destVal, options) } // Tar tars the requested path while chrooted to the specified root. func Tar(srcPath string, options *archive.TarOptions, root string) (io.ReadCloser, error) { if options == nil { options = &archive.TarOptions{} } return invokePack(srcPath, options, root) } // CopyFileWithTarAndChown returns a function which copies a single file from outside // of any container into our working container, mapping permissions using the // container's ID maps, possibly overridden using the passed-in chownOpts func CopyFileWithTarAndChown(chownOpts *idtools.IDPair, hasher io.Writer, uidmap []idtools.IDMap, gidmap []idtools.IDMap) func(src, dest string) error { untarMappings := idtools.NewIDMappingsFromMaps(uidmap, gidmap) archiver := NewArchiverWithChown(nil, chownOpts, untarMappings) if hasher != nil { originalUntar := archiver.Untar archiver.Untar = func(tarArchive io.Reader, dest string, options *archive.TarOptions) error { contentReader, contentWriter, err := os.Pipe() if err != nil { return fmt.Errorf("creating pipe extract data to %q: %w", dest, err) } defer contentReader.Close() defer contentWriter.Close() var hashError error var hashWorker sync.WaitGroup hashWorker.Go(func() { t := stdtar.NewReader(contentReader) _, err := t.Next() if err != nil { hashError = err } if _, err = io.Copy(hasher, t); err != nil && err != io.EOF { hashError = err } }) if err = originalUntar(io.TeeReader(tarArchive, contentWriter), dest, options); err != nil { err = fmt.Errorf("extracting data to %q while copying: %w", dest, err) } hashWorker.Wait() if err == nil && hashError != nil { err = fmt.Errorf("calculating digest of data for %q while copying: %w", dest, hashError) } return err } } return archiver.CopyFileWithTar } // CopyWithTarAndChown returns a function which copies a directory tree from outside of // any container into our working container, mapping permissions using the // container's ID maps, possibly overridden using the passed-in chownOpts func CopyWithTarAndChown(chownOpts *idtools.IDPair, hasher io.Writer, uidmap []idtools.IDMap, gidmap []idtools.IDMap) func(src, dest string) error { untarMappings := idtools.NewIDMappingsFromMaps(uidmap, gidmap) archiver := NewArchiverWithChown(nil, chownOpts, untarMappings) if hasher != nil { originalUntar := archiver.Untar archiver.Untar = func(tarArchive io.Reader, dest string, options *archive.TarOptions) error { return originalUntar(io.TeeReader(tarArchive, hasher), dest, options) } } return archiver.CopyWithTar } // UntarPathAndChown returns a function which extracts an archive in a specified // location into our working container, mapping permissions using the // container's ID maps, possibly overridden using the passed-in chownOpts func UntarPathAndChown(chownOpts *idtools.IDPair, hasher io.Writer, uidmap []idtools.IDMap, gidmap []idtools.IDMap) func(src, dest string) error { untarMappings := idtools.NewIDMappingsFromMaps(uidmap, gidmap) archiver := NewArchiverWithChown(nil, chownOpts, untarMappings) if hasher != nil { originalUntar := archiver.Untar archiver.Untar = func(tarArchive io.Reader, dest string, options *archive.TarOptions) error { return originalUntar(io.TeeReader(tarArchive, hasher), dest, options) } } return archiver.UntarPath } ================================================ FILE: vendor/go.podman.io/storage/pkg/chrootarchive/archive_darwin.go ================================================ package chrootarchive import ( "io" "go.podman.io/storage/pkg/archive" ) type unpackDestination struct { dest string } func (dst *unpackDestination) Close() error { return nil } // newUnpackDestination is a no-op on this platform func newUnpackDestination(root, dest string) (*unpackDestination, error) { return &unpackDestination{ dest: dest, }, nil } func invokeUnpack(decompressedArchive io.Reader, dest *unpackDestination, options *archive.TarOptions, ) error { return archive.Unpack(decompressedArchive, dest.dest, options) } func invokePack(srcPath string, options *archive.TarOptions, root string) (io.ReadCloser, error) { _ = root // Restricting the operation to this root is not implemented on macOS return archive.TarWithOptions(srcPath, options) } ================================================ FILE: vendor/go.podman.io/storage/pkg/chrootarchive/archive_unix.go ================================================ //go:build !windows && !darwin package chrootarchive import ( "bytes" "errors" "flag" "fmt" "io" "io/fs" "os" "path/filepath" "runtime" "strings" "golang.org/x/sys/unix" "go.podman.io/storage/pkg/archive" "go.podman.io/storage/pkg/reexec" ) type unpackDestination struct { root *os.File dest string } func (dst *unpackDestination) Close() error { return dst.root.Close() } // tarOptionsDescriptor is passed as an extra file const tarOptionsDescriptor = 3 // rootFileDescriptor is passed as an extra file const rootFileDescriptor = 4 // procPathForFd gives us a string for a descriptor. // Note that while Linux supports actually *reading* this // path, FreeBSD and other platforms don't; but in this codebase // we only compare strings. func procPathForFd(fd int) string { return fmt.Sprintf("/proc/self/fd/%d", fd) } // untar is the entry-point for storage-untar on re-exec. This is not used on // Windows as it does not support chroot, hence no point sandboxing through // chroot and rexec. func untar() { runtime.LockOSThread() flag.Parse() var options archive.TarOptions // read the options from the pipe "ExtraFiles" if err := json.NewDecoder(os.NewFile(tarOptionsDescriptor, "options")).Decode(&options); err != nil { fatal(err) } dst := flag.Arg(0) var root string if len(flag.Args()) > 1 { root = flag.Arg(1) } // FreeBSD doesn't have proc/self, but we can handle it here if root == procPathForFd(rootFileDescriptor) { // Take ownership to ensure it's closed; no need to leak // this afterwards. rootFd := os.NewFile(rootFileDescriptor, "tar-root") defer rootFd.Close() if err := unix.Fchdir(int(rootFd.Fd())); err != nil { fatal(err) } root = "." } else if root == "" { root = dst } if err := chroot(root); err != nil { fatal(err) } if err := archive.Unpack(os.Stdin, dst, &options); err != nil { fatal(err) } // fully consume stdin in case it is zero padded if _, err := flush(os.Stdin); err != nil { fatal(err) } os.Exit(0) } // newUnpackDestination takes a root directory and a destination which // must be underneath it, and returns an object that can unpack // in the target root using a file descriptor. func newUnpackDestination(root, dest string) (*unpackDestination, error) { if root == "" { return nil, errors.New("must specify a root to chroot to") } relDest, err := filepath.Rel(root, dest) if err != nil { return nil, err } if relDest == "." { relDest = "/" } if relDest[0] != '/' { relDest = "/" + relDest } rootfdRaw, err := unix.Open(root, unix.O_RDONLY|unix.O_DIRECTORY|unix.O_CLOEXEC, 0) if err != nil { return nil, &fs.PathError{Op: "open", Path: root, Err: err} } return &unpackDestination{ root: os.NewFile(uintptr(rootfdRaw), "rootfs"), dest: relDest, }, nil } func invokeUnpack(decompressedArchive io.Reader, dest *unpackDestination, options *archive.TarOptions) error { // We can't pass a potentially large exclude list directly via cmd line // because we easily overrun the kernel's max argument/environment size // when the full image list is passed (e.g. when this is used by // `docker load`). We will marshall the options via a pipe to the // child r, w, err := os.Pipe() if err != nil { return fmt.Errorf("untar pipe failure: %w", err) } cmd := reexec.Command("storage-untar", dest.dest, procPathForFd(rootFileDescriptor)) cmd.Stdin = decompressedArchive // If you change this, change tarOptionsDescriptor above cmd.ExtraFiles = append(cmd.ExtraFiles, r) // fd 3 // If you change this, change rootFileDescriptor above too cmd.ExtraFiles = append(cmd.ExtraFiles, dest.root) // fd 4 output := bytes.NewBuffer(nil) cmd.Stdout = output cmd.Stderr = output if err := cmd.Start(); err != nil { w.Close() return fmt.Errorf("untar error on re-exec cmd: %w", err) } // write the options to the pipe for the untar exec to read if err := json.NewEncoder(w).Encode(options); err != nil { w.Close() return fmt.Errorf("untar json encode to pipe failed: %w", err) } w.Close() if err := cmd.Wait(); err != nil { errorOut := fmt.Errorf("unpacking failed (error: %w; output: %s)", err, output) // when `xz -d -c -q | storage-untar ...` failed on storage-untar side, // we need to exhaust `xz`'s output, otherwise the `xz` side will be // pending on write pipe forever if _, err := io.Copy(io.Discard, decompressedArchive); err != nil { return fmt.Errorf("%w\nexhausting input failed (error: %w)", errorOut, err) } return errorOut } return nil } func tar() { runtime.LockOSThread() flag.Parse() src := flag.Arg(0) var root string if len(flag.Args()) > 1 { root = flag.Arg(1) } if root == "" { root = src } if err := realChroot(root); err != nil { fatal(err) } var options archive.TarOptions if err := json.NewDecoder(os.Stdin).Decode(&options); err != nil { fatal(err) } rdr, err := archive.TarWithOptions(src, &options) if err != nil { fatal(err) } defer rdr.Close() if _, err := io.Copy(os.Stdout, rdr); err != nil { fatal(err) } os.Exit(0) } func invokePack(srcPath string, options *archive.TarOptions, root string) (io.ReadCloser, error) { if root == "" { return nil, errors.New("root path must not be empty") } relSrc, err := filepath.Rel(root, srcPath) if err != nil { return nil, err } if relSrc == "." { relSrc = "/" } if relSrc[0] != '/' { relSrc = "/" + relSrc } // make sure we didn't trim a trailing slash with the call to `Rel` if strings.HasSuffix(srcPath, "/") && !strings.HasSuffix(relSrc, "/") { relSrc += "/" } cmd := reexec.Command("storage-tar", relSrc, root) errBuff := bytes.NewBuffer(nil) cmd.Stderr = errBuff tarR, tarW := io.Pipe() cmd.Stdout = tarW stdin, err := cmd.StdinPipe() if err != nil { return nil, fmt.Errorf("getting options pipe for tar process: %w", err) } if err := cmd.Start(); err != nil { return nil, fmt.Errorf("tar error on re-exec cmd: %w", err) } go func() { err := cmd.Wait() if err != nil { err = fmt.Errorf("processing tar file(%s): %w", errBuff, err) } tarW.CloseWithError(err) }() if err := json.NewEncoder(stdin).Encode(options); err != nil { stdin.Close() return nil, fmt.Errorf("tar json encode to pipe failed: %w", err) } stdin.Close() return tarR, nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/chrootarchive/archive_windows.go ================================================ package chrootarchive import ( "io" "go.podman.io/storage/pkg/archive" "go.podman.io/storage/pkg/longpath" ) type unpackDestination struct { dest string } func (dst *unpackDestination) Close() error { return nil } // newUnpackDestination is a no-op on this platform func newUnpackDestination(root, dest string) (*unpackDestination, error) { return &unpackDestination{ dest: dest, }, nil } // chroot is not supported by Windows func chroot(path string) error { return nil } func invokeUnpack(decompressedArchive io.Reader, dest *unpackDestination, options *archive.TarOptions, ) error { // Windows is different to Linux here because Windows does not support // chroot. Hence there is no point sandboxing a chrooted process to // do the unpack. We call inline instead within the daemon process. return archive.Unpack(decompressedArchive, longpath.AddPrefix(dest.dest), options) } func invokePack(srcPath string, options *archive.TarOptions, root string) (io.ReadCloser, error) { // Windows is different to Linux here because Windows does not support // chroot. Hence there is no point sandboxing a chrooted process to // do the pack. We call inline instead within the daemon process. return archive.TarWithOptions(srcPath, options) } ================================================ FILE: vendor/go.podman.io/storage/pkg/chrootarchive/chroot_linux.go ================================================ package chrootarchive import ( "fmt" "net" "os" "os/user" "path/filepath" "github.com/moby/sys/capability" "go.podman.io/storage/pkg/mount" "golang.org/x/sys/unix" ) // chroot on linux uses pivot_root instead of chroot // pivot_root takes a new root and an old root. // Old root must be a sub-dir of new root, it is where the current rootfs will reside after the call to pivot_root. // New root is where the new rootfs is set to. // Old root is removed after the call to pivot_root so it is no longer available under the new root. // This is similar to how libcontainer sets up a container's rootfs func chroot(path string) (err error) { caps, err := capability.NewPid2(0) if err != nil { return err } if err := caps.Load(); err != nil { return err } // initialize nss libraries in Glibc so that the dynamic libraries are loaded in the host // environment not in the chroot from untrusted files. _, _ = user.Lookup("storage") _, _ = net.LookupHost("localhost") // if the process doesn't have CAP_SYS_ADMIN, but does have CAP_SYS_CHROOT, we need to use the actual chroot if !caps.Get(capability.EFFECTIVE, capability.CAP_SYS_ADMIN) && caps.Get(capability.EFFECTIVE, capability.CAP_SYS_CHROOT) { return realChroot(path) } if err := unix.Unshare(unix.CLONE_NEWNS); err != nil { return fmt.Errorf("creating mount namespace before pivot: %w", err) } // make everything in new ns private if err := mount.MakeRPrivate("/"); err != nil { return err } if mounted, _ := mount.Mounted(path); !mounted { if err := mount.Mount(path, path, "bind", "rbind,rw"); err != nil { return realChroot(path) } } // setup oldRoot for pivot_root pivotDir, err := os.MkdirTemp(path, ".pivot_root") if err != nil { return fmt.Errorf("setting up pivot dir: %w", err) } var mounted bool defer func() { if mounted { // make sure pivotDir is not mounted before we try to remove it if errCleanup := unix.Unmount(pivotDir, unix.MNT_DETACH); errCleanup != nil { if err == nil { err = errCleanup } return } } errCleanup := os.Remove(pivotDir) // pivotDir doesn't exist if pivot_root failed and chroot+chdir was successful // because we already cleaned it up on failed pivot_root if errCleanup != nil && !os.IsNotExist(errCleanup) { errCleanup = fmt.Errorf("cleaning up after pivot: %w", errCleanup) if err == nil { err = errCleanup } } }() if err := unix.PivotRoot(path, pivotDir); err != nil { // If pivot fails, fall back to the normal chroot after cleaning up temp dir if err := os.Remove(pivotDir); err != nil { return fmt.Errorf("cleaning up after failed pivot: %w", err) } return realChroot(path) } mounted = true // This is the new path for where the old root (prior to the pivot) has been moved to // This dir contains the rootfs of the caller, which we need to remove so it is not visible during extraction pivotDir = filepath.Join("/", filepath.Base(pivotDir)) if err := unix.Chdir("/"); err != nil { return fmt.Errorf("changing to new root: %w", err) } // Make the pivotDir (where the old root lives) private so it can be unmounted without propagating to the host if err := unix.Mount("", pivotDir, "", unix.MS_PRIVATE|unix.MS_REC, ""); err != nil { return fmt.Errorf("making old root private after pivot: %w", err) } // Now unmount the old root so it's no longer visible from the new root if err := unix.Unmount(pivotDir, unix.MNT_DETACH); err != nil { return fmt.Errorf("while unmounting old root after pivot: %w", err) } mounted = false return nil } func realChroot(path string) error { if err := unix.Chroot(path); err != nil { return fmt.Errorf("after fallback to chroot: %w", err) } if err := unix.Chdir("/"); err != nil { return fmt.Errorf("changing to new root after chroot: %w", err) } return nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/chrootarchive/chroot_unix.go ================================================ //go:build !windows && !linux && !darwin package chrootarchive import "golang.org/x/sys/unix" func realChroot(path string) error { if err := unix.Chroot(path); err != nil { return err } return unix.Chdir("/") } func chroot(path string) error { return realChroot(path) } ================================================ FILE: vendor/go.podman.io/storage/pkg/chrootarchive/diff.go ================================================ package chrootarchive import ( "io" "go.podman.io/storage/pkg/archive" ) // ApplyLayer parses a diff in the standard layer format from `layer`, // and applies it to the directory `dest`. The stream `layer` can only be // uncompressed. // Returns the size in bytes of the contents of the layer. func ApplyLayer(dest string, layer io.Reader) (size int64, err error) { return applyLayerHandler(dest, layer, &archive.TarOptions{}, true) } // ApplyUncompressedLayer parses a diff in the standard layer format from // `layer`, and applies it to the directory `dest`. The stream `layer` // can only be uncompressed. // Returns the size in bytes of the contents of the layer. func ApplyUncompressedLayer(dest string, layer io.Reader, options *archive.TarOptions) (int64, error) { return applyLayerHandler(dest, layer, options, false) } ================================================ FILE: vendor/go.podman.io/storage/pkg/chrootarchive/diff_darwin.go ================================================ package chrootarchive import ( "fmt" "io" "os" "path/filepath" "go.podman.io/storage/pkg/archive" ) // applyLayerHandler parses a diff in the standard layer format from `layer`, and // applies it to the directory `dest`. Returns the size in bytes of the // contents of the layer. func applyLayerHandler(dest string, layer io.Reader, options *archive.TarOptions, decompress bool) (size int64, err error) { dest = filepath.Clean(dest) if decompress { decompressed, err := archive.DecompressStream(layer) if err != nil { return 0, err } defer decompressed.Close() layer = decompressed } tmpDir, err := os.MkdirTemp(os.Getenv("temp"), "temp-storage-extract") if err != nil { return 0, fmt.Errorf("ApplyLayer failed to create temp-storage-extract under %s: %w", dest, err) } s, err := archive.UnpackLayer(dest, layer, options) os.RemoveAll(tmpDir) if err != nil { return 0, fmt.Errorf("ApplyLayer %s failed UnpackLayer to %s: %w", layer, dest, err) } return s, nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/chrootarchive/diff_unix.go ================================================ //go:build !windows && !darwin package chrootarchive import ( "bytes" "flag" "fmt" "io" "os" "path/filepath" "runtime" "go.podman.io/storage/pkg/archive" "go.podman.io/storage/pkg/reexec" "go.podman.io/storage/pkg/system" "go.podman.io/storage/pkg/unshare" ) type applyLayerResponse struct { LayerSize int64 `json:"layerSize"` } // applyLayer is the entry-point for storage-applylayer on re-exec. This is not // used on Windows as it does not support chroot, hence no point sandboxing // through chroot and rexec. func applyLayer() { var ( tmpDir string err error options *archive.TarOptions ) runtime.LockOSThread() flag.Parse() inUserns := unshare.IsRootless() if err := chroot(flag.Arg(0)); err != nil { fatal(err) } // We need to be able to set any perms oldMask, err := system.Umask(0) if err != nil { fatal(err) } defer func() { _, _ = system.Umask(oldMask) // Ignore err. This can only fail with ErrNotSupportedPlatform, in which case we would have failed above. }() if err := json.Unmarshal([]byte(os.Getenv("OPT")), &options); err != nil { fatal(err) } if inUserns { options.InUserNS = true } if tmpDir, err = os.MkdirTemp("/", "temp-storage-extract"); err != nil { fatal(err) } os.Setenv("TMPDIR", tmpDir) size, err := archive.UnpackLayer("/", os.Stdin, options) os.RemoveAll(tmpDir) if err != nil { fatal(err) } encoder := json.NewEncoder(os.Stdout) if err := encoder.Encode(applyLayerResponse{size}); err != nil { fatal(fmt.Errorf("unable to encode layerSize JSON: %w", err)) } if _, err := flush(os.Stdin); err != nil { fatal(err) } os.Exit(0) } // applyLayerHandler parses a diff in the standard layer format from `layer`, and // applies it to the directory `dest`. Returns the size in bytes of the // contents of the layer. func applyLayerHandler(dest string, layer io.Reader, options *archive.TarOptions, decompress bool) (size int64, err error) { dest = filepath.Clean(dest) if decompress { decompressed, err := archive.DecompressStream(layer) if err != nil { return 0, err } defer decompressed.Close() layer = decompressed } if options == nil { options = &archive.TarOptions{} if unshare.IsRootless() { options.InUserNS = true } } data, err := json.Marshal(options) if err != nil { return 0, fmt.Errorf("ApplyLayer json encode: %w", err) } cmd := reexec.Command("storage-applyLayer", dest) cmd.Stdin = layer cmd.Env = append(os.Environ(), fmt.Sprintf("OPT=%s", data)) outBuf, errBuf := new(bytes.Buffer), new(bytes.Buffer) cmd.Stdout, cmd.Stderr = outBuf, errBuf if err = cmd.Run(); err != nil { return 0, fmt.Errorf("ApplyLayer stdout: %s stderr: %s %w", outBuf, errBuf, err) } // Stdout should be a valid JSON struct representing an applyLayerResponse. response := applyLayerResponse{} decoder := json.NewDecoder(outBuf) if err = decoder.Decode(&response); err != nil { return 0, fmt.Errorf("unable to decode ApplyLayer JSON response: %w", err) } return response.LayerSize, nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/chrootarchive/diff_windows.go ================================================ package chrootarchive import ( "fmt" "io" "os" "path/filepath" "go.podman.io/storage/pkg/archive" "go.podman.io/storage/pkg/longpath" ) // applyLayerHandler parses a diff in the standard layer format from `layer`, and // applies it to the directory `dest`. Returns the size in bytes of the // contents of the layer. func applyLayerHandler(dest string, layer io.Reader, options *archive.TarOptions, decompress bool) (size int64, err error) { dest = filepath.Clean(dest) // Ensure it is a Windows-style volume path dest = longpath.AddPrefix(dest) if decompress { decompressed, err := archive.DecompressStream(layer) if err != nil { return 0, err } defer decompressed.Close() layer = decompressed } tmpDir, err := os.MkdirTemp(os.Getenv("temp"), "temp-storage-extract") if err != nil { return 0, fmt.Errorf("ApplyLayer failed to create temp-storage-extract under %s. %s", dest, err) } s, err := archive.UnpackLayer(dest, layer, nil) os.RemoveAll(tmpDir) if err != nil { return 0, fmt.Errorf("ApplyLayer %s failed UnpackLayer to %s: %s", layer, dest, err) } return s, nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/chrootarchive/init_unix.go ================================================ //go:build !windows && !darwin package chrootarchive import ( "fmt" "io" "os" "go.podman.io/storage/pkg/reexec" ) func init() { reexec.Register("storage-applyLayer", applyLayer) reexec.Register("storage-untar", untar) reexec.Register("storage-tar", tar) } func fatal(err error) { fmt.Fprint(os.Stderr, err) os.Exit(1) } // flush consumes all the bytes from the reader discarding // any errors func flush(r io.Reader) (bytes int64, err error) { return io.Copy(io.Discard, r) } ================================================ FILE: vendor/go.podman.io/storage/pkg/chrootarchive/jsoniter.go ================================================ //go:build !windows && !darwin package chrootarchive import jsoniter "github.com/json-iterator/go" var json = jsoniter.ConfigCompatibleWithStandardLibrary ================================================ FILE: vendor/go.podman.io/storage/pkg/chunked/bloom_filter_linux.go ================================================ package chunked import ( "encoding/binary" "fmt" "hash/crc32" "io" "github.com/docker/go-units" ) const bloomFilterMaxLength = 100 * units.MB // max size for bloom filter type bloomFilter struct { bitArray []uint64 k uint32 } func newBloomFilter(size int, k uint32) *bloomFilter { numElements := (size + 63) / 64 if numElements == 0 { numElements = 1 } return &bloomFilter{ bitArray: make([]uint64, numElements), k: k, } } func newBloomFilterFromArray(bitArray []uint64, k uint32) *bloomFilter { return &bloomFilter{ bitArray: bitArray, k: k, } } func (bf *bloomFilter) hashFn(item []byte, seed uint32) (uint64, uint64) { if len(item) == 0 { return 0, 1 } mod := uint32(len(bf.bitArray) * 64) seedSplit := seed % uint32(len(item)) hash := (crc32.ChecksumIEEE(item[:seedSplit]) ^ crc32.ChecksumIEEE(item[seedSplit:])) % mod return uint64(hash / 64), uint64(1 << (hash % 64)) } func (bf *bloomFilter) add(item []byte) { for i := uint32(0); i < bf.k; i++ { index, mask := bf.hashFn(item, i) bf.bitArray[index] |= mask } } func (bf *bloomFilter) maybeContains(item []byte) bool { for i := uint32(0); i < bf.k; i++ { index, mask := bf.hashFn(item, i) if bf.bitArray[index]&mask == 0 { return false } } return true } func (bf *bloomFilter) writeTo(writer io.Writer) error { if err := binary.Write(writer, binary.LittleEndian, uint64(len(bf.bitArray))); err != nil { return err } if err := binary.Write(writer, binary.LittleEndian, bf.k); err != nil { return err } if err := binary.Write(writer, binary.LittleEndian, bf.bitArray); err != nil { return err } return nil } func readBloomFilter(reader io.Reader) (*bloomFilter, error) { var bloomFilterLen uint64 var k uint32 if err := binary.Read(reader, binary.LittleEndian, &bloomFilterLen); err != nil { return nil, err } if err := binary.Read(reader, binary.LittleEndian, &k); err != nil { return nil, err } // sanity check if bloomFilterLen > bloomFilterMaxLength { return nil, fmt.Errorf("bloom filter length %d exceeds max length %d", bloomFilterLen, bloomFilterMaxLength) } bloomFilterArray := make([]uint64, bloomFilterLen) if err := binary.Read(reader, binary.LittleEndian, &bloomFilterArray); err != nil { return nil, err } return newBloomFilterFromArray(bloomFilterArray, k), nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/chunked/cache_linux.go ================================================ package chunked import ( "bytes" "encoding/binary" "encoding/hex" "errors" "fmt" "io" "os" "runtime" "slices" "sort" "strings" "sync" "time" "github.com/docker/go-units" jsoniter "github.com/json-iterator/go" digest "github.com/opencontainers/go-digest" "github.com/sirupsen/logrus" storage "go.podman.io/storage" graphdriver "go.podman.io/storage/drivers" "go.podman.io/storage/pkg/chunked/internal/minimal" "go.podman.io/storage/pkg/ioutils" "golang.org/x/sys/unix" ) const ( cacheKey = "chunked-manifest-cache" cacheVersion = 3 digestSha256Empty = "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" // Using 3 hashes functions and n/m = 10 gives a false positive rate of ~1.7%: // https://pages.cs.wisc.edu/~cao/papers/summary-cache/node8.html bloomFilterScale = 10 // how much bigger is the bloom filter than the number of entries bloomFilterHashes = 3 // number of hash functions for the bloom filter maxTagsLen = 100 * units.MB // max size for tags len ) type cacheFile struct { tagLen int digestLen int fnamesLen int tags []byte vdata []byte fnames []byte bloomFilter *bloomFilter } type layer struct { id string cacheFile *cacheFile target string // mmapBuffer is nil when the cache file is fully loaded in memory. // Otherwise it points to a mmap'ed buffer that is referenced by cacheFile.vdata. mmapBuffer []byte // reloadWithMmap is set when the current process generates the cache file, // and cacheFile reuses the memory buffer used by the generation function. // Next time the layer cache is used, attempt to reload the file using // mmap. reloadWithMmap bool } type layersCache struct { layers []*layer refs int store storage.Store mutex sync.RWMutex } var ( cacheMutex sync.Mutex cache *layersCache ) func (c *layer) release() { runtime.SetFinalizer(c, nil) if c.mmapBuffer != nil { if err := unix.Munmap(c.mmapBuffer); err != nil { logrus.Warnf("Error Munmap: layer %q: %v", c.id, err) } c.mmapBuffer = nil } } func layerFinalizer(c *layer) { c.release() } func (c *layersCache) release() { cacheMutex.Lock() defer cacheMutex.Unlock() c.refs-- if c.refs != 0 { return } for _, l := range c.layers { l.release() } cache = nil } func getLayersCacheRef(store storage.Store) *layersCache { cacheMutex.Lock() defer cacheMutex.Unlock() if cache != nil && cache.store == store { cache.refs++ return cache } cache = &layersCache{ store: store, refs: 1, } return cache } func getLayersCache(store storage.Store) (*layersCache, error) { c := getLayersCacheRef(store) if err := c.load(); err != nil { c.release() return nil, err } return c, nil } // loadLayerBigData attempts to load the specified cacheKey from a file and mmap its content. // If the cache is not backed by a file, then it loads the entire content in memory. // Returns the cache content, and if mmap'ed, the mmap buffer to Munmap. func (c *layersCache) loadLayerBigData(layerID, bigDataKey string) ([]byte, []byte, error) { inputFile, err := c.store.LayerBigData(layerID, bigDataKey) if err != nil { return nil, nil, err } defer inputFile.Close() // if the cache is backed by a file, attempt to mmap it. if osFile, ok := inputFile.(*os.File); ok { st, err := osFile.Stat() if err != nil { logrus.Warningf("Error stat'ing cache file for layer %q: %v", layerID, err) goto fallback } size := st.Size() if size == 0 { logrus.Warningf("Cache file size is zero for layer %q: %v", layerID, err) goto fallback } buf, err := unix.Mmap(int(osFile.Fd()), 0, int(size), unix.PROT_READ, unix.MAP_SHARED) if err != nil { logrus.Warningf("Error mmap'ing cache file for layer %q: %v", layerID, err) goto fallback } // best effort advise to the kernel. _ = unix.Madvise(buf, unix.MADV_RANDOM) return buf, buf, nil } fallback: buf, err := io.ReadAll(inputFile) return buf, nil, err } func makeBinaryDigest(stringDigest string) ([]byte, error) { d, err := digest.Parse(stringDigest) if err != nil { return nil, err } digestBytes, err := hex.DecodeString(d.Encoded()) if err != nil { return nil, err } algo := []byte(d.Algorithm()) buf := make([]byte, 0, len(algo)+1+len(digestBytes)) buf = append(buf, algo...) buf = append(buf, ':') buf = append(buf, digestBytes...) return buf, nil } // loadLayerCache attempts to load the cache file for the specified layer. // If the cache file is not present or it it using a different cache file version, then // the function returns (nil, nil). func (c *layersCache) loadLayerCache(layerID string) (_ *layer, errRet error) { buffer, mmapBuffer, err := c.loadLayerBigData(layerID, cacheKey) if err != nil && !errors.Is(err, os.ErrNotExist) { return nil, err } // there is no existing cache to load if err != nil || buffer == nil { return nil, nil } defer func() { if errRet != nil && mmapBuffer != nil { if err := unix.Munmap(mmapBuffer); err != nil { logrus.Warnf("Error Munmap: layer %q: %v", layerID, err) } } }() cacheFile, err := readCacheFileFromMemory(buffer) if err != nil { return nil, err } if cacheFile == nil { return nil, nil } return c.createLayer(layerID, cacheFile, mmapBuffer) } // createCacheFileFromTOC attempts to create a cache file for the specified layer. // If a TOC is not available, the cache won't be created and nil is returned. func (c *layersCache) createCacheFileFromTOC(layerID string) (*layer, error) { clFile, err := c.store.LayerBigData(layerID, chunkedLayerDataKey) if err != nil && !errors.Is(err, os.ErrNotExist) { return nil, err } var lcd chunkedLayerData if err == nil && clFile != nil { defer clFile.Close() cl, err := io.ReadAll(clFile) if err != nil { return nil, fmt.Errorf("open manifest file: %w", err) } json := jsoniter.ConfigCompatibleWithStandardLibrary if err := json.Unmarshal(cl, &lcd); err != nil { return nil, err } } manifestReader, err := c.store.LayerBigData(layerID, bigDataKey) if err != nil { // the cache file is not needed since there is no manifest file. if errors.Is(err, os.ErrNotExist) { return nil, nil } return nil, err } defer manifestReader.Close() manifest, err := io.ReadAll(manifestReader) if err != nil { return nil, fmt.Errorf("read manifest file: %w", err) } cacheFile, err := writeCache(manifest, lcd.Format, layerID, c.store) if err != nil { return nil, err } l, err := c.createLayer(layerID, cacheFile, nil) if err != nil { return nil, err } l.reloadWithMmap = true return l, nil } func (c *layersCache) load() error { c.mutex.Lock() defer c.mutex.Unlock() loadedLayers := make(map[string]*layer) for _, r := range c.layers { loadedLayers[r.id] = r } allLayers, err := c.store.Layers() if err != nil { return err } var newLayers []*layer for _, r := range allLayers { // The layer is present in the store and it is already loaded. Attempt to // reuse it if mmap'ed. if l, found := loadedLayers[r.ID]; found { // If the layer is not marked for re-load, move it to newLayers. if !l.reloadWithMmap { delete(loadedLayers, r.ID) newLayers = append(newLayers, l) continue } } // try to read the existing cache file. l, err := c.loadLayerCache(r.ID) if err != nil { logrus.Infof("Error loading cache file for layer %q: %v", r.ID, err) } if l != nil { newLayers = append(newLayers, l) continue } if r.ReadOnly { // If the layer is coming from a read-only store, do not attempt // to write to it. // Therefore, we won’t find any matches in read-only-store layers, // unless the read-only store layer comes prepopulated with cacheKey data. continue } // the cache file is either not present or broken. Try to generate it from the TOC. l, err = c.createCacheFileFromTOC(r.ID) if err != nil && !errors.Is(err, storage.ErrLayerUnknown) { logrus.Warningf("Error creating cache file for layer %q: %v", r.ID, err) } if l != nil { newLayers = append(newLayers, l) } } // The layers that are still in loadedLayers are either stale or fully loaded in memory. Clean them up. for _, l := range loadedLayers { l.release() } c.layers = newLayers return nil } // calculateHardLinkFingerprint calculates a hash that can be used to verify if a file // is usable for deduplication with hardlinks. // To calculate the digest, it uses the file payload digest, UID, GID, mode and xattrs. func calculateHardLinkFingerprint(f *fileMetadata) (string, error) { digester := digest.Canonical.Digester() modeString := fmt.Sprintf("%d:%d:%o", f.UID, f.GID, f.Mode) hash := digester.Hash() if _, err := hash.Write([]byte(f.Digest)); err != nil { return "", err } if _, err := hash.Write([]byte(modeString)); err != nil { return "", err } if len(f.Xattrs) > 0 { keys := make([]string, 0, len(f.Xattrs)) for k := range f.Xattrs { keys = append(keys, k) } sort.Strings(keys) for _, k := range keys { if _, err := hash.Write([]byte(k)); err != nil { return "", err } if _, err := hash.Write([]byte(f.Xattrs[k])); err != nil { return "", err } } } return string(digester.Digest()), nil } // generateFileLocation generates a file location in the form $OFFSET$LEN$PATH_POS func generateFileLocation(pathPos int, offset, len uint64) []byte { var buf []byte buf = binary.AppendUvarint(buf, uint64(pathPos)) buf = binary.AppendUvarint(buf, offset) buf = binary.AppendUvarint(buf, len) return buf } // parseFileLocation reads what was written by generateFileLocation. func parseFileLocation(locationData []byte) (int, uint64, uint64, error) { reader := bytes.NewReader(locationData) pathPos, err := binary.ReadUvarint(reader) if err != nil { return 0, 0, 0, err } offset, err := binary.ReadUvarint(reader) if err != nil { return 0, 0, 0, err } len, err := binary.ReadUvarint(reader) if err != nil { return 0, 0, 0, err } return int(pathPos), offset, len, nil } // appendTag appends the $OFFSET$LEN information to the provided $DIGEST. // The [OFFSET; LEN] points to the variable length data where the file locations // are stored. $DIGEST has length digestLen stored in the cache file file header. func appendTag(digest []byte, offset, len uint64) ([]byte, error) { digest = binary.LittleEndian.AppendUint64(digest, offset) digest = binary.LittleEndian.AppendUint64(digest, len) return digest, nil } type setBigData interface { // SetLayerBigData stores a (possibly large) chunk of named data SetLayerBigData(id, key string, data io.Reader) error } func bloomFilterFromTags(tags [][]byte, digestLen int) *bloomFilter { bloomFilter := newBloomFilter(len(tags)*bloomFilterScale, bloomFilterHashes) for _, t := range tags { bloomFilter.add(t[:digestLen]) } return bloomFilter } func writeCacheFileToWriter(writer io.Writer, bloomFilter *bloomFilter, tags [][]byte, tagLen, digestLen int, vdata, fnames bytes.Buffer, tagsBuffer *bytes.Buffer) error { slices.SortFunc(tags, bytes.Compare) for _, t := range tags { if _, err := tagsBuffer.Write(t); err != nil { return err } } // version if err := binary.Write(writer, binary.LittleEndian, uint64(cacheVersion)); err != nil { return err } // len of a tag if err := binary.Write(writer, binary.LittleEndian, uint64(tagLen)); err != nil { return err } // len of a digest if err := binary.Write(writer, binary.LittleEndian, uint64(digestLen)); err != nil { return err } // bloom filter if err := bloomFilter.writeTo(writer); err != nil { return err } // tags length if err := binary.Write(writer, binary.LittleEndian, uint64(tagsBuffer.Len())); err != nil { return err } // vdata length if err := binary.Write(writer, binary.LittleEndian, uint64(vdata.Len())); err != nil { return err } // fnames length if err := binary.Write(writer, binary.LittleEndian, uint64(fnames.Len())); err != nil { return err } // tags if _, err := writer.Write(tagsBuffer.Bytes()); err != nil { return err } // variable length data if _, err := writer.Write(vdata.Bytes()); err != nil { return err } // file names if _, err := writer.Write(fnames.Bytes()); err != nil { return err } return nil } // writeCache write a cache for the layer ID. // It generates a sorted list of digests with their offset to the path location and offset. // The same cache is used to lookup files, chunks and candidates for deduplication with hard links. // There are 3 kind of digests stored: // - digest(file.payload)) // - digest(digest(file.payload) + file.UID + file.GID + file.mode + file.xattrs) // - digest(i) for each i in chunks(file payload) func writeCache(manifest []byte, format graphdriver.DifferOutputFormat, id string, dest setBigData) (*cacheFile, error) { var vdata, tagsBuffer, fnames bytes.Buffer tagLen := 0 digestLen := 0 toc, err := prepareCacheFile(manifest, format) if err != nil { return nil, err } fnamesMap := make(map[string]int) getFileNamePosition := func(name string) (int, error) { if pos, found := fnamesMap[name]; found { return pos, nil } pos := fnames.Len() fnamesMap[name] = pos if err := binary.Write(&fnames, binary.LittleEndian, uint32(len(name))); err != nil { return 0, err } if _, err := fnames.WriteString(name); err != nil { return 0, err } return pos, nil } var tags [][]byte for _, k := range toc { if k.Digest != "" { digest, err := makeBinaryDigest(k.Digest) if err != nil { return nil, err } fileNamePos, err := getFileNamePosition(k.Name) if err != nil { return nil, err } location := generateFileLocation(fileNamePos, 0, uint64(k.Size)) off := uint64(vdata.Len()) l := uint64(len(location)) tag, err := appendTag(digest, off, l) if err != nil { return nil, err } if tagLen == 0 { tagLen = len(tag) } if tagLen != len(tag) { return nil, errors.New("digest with different length found") } tags = append(tags, tag) fp, err := calculateHardLinkFingerprint(k) if err != nil { return nil, err } digestHardLink, err := makeBinaryDigest(fp) if err != nil { return nil, err } tag, err = appendTag(digestHardLink, off, l) if err != nil { return nil, err } if tagLen != len(tag) { return nil, errors.New("digest with different length found") } tags = append(tags, tag) if _, err := vdata.Write(location); err != nil { return nil, err } digestLen = len(digestHardLink) } if k.ChunkDigest != "" { fileNamePos, err := getFileNamePosition(k.Name) if err != nil { return nil, err } location := generateFileLocation(fileNamePos, uint64(k.ChunkOffset), uint64(k.ChunkSize)) off := uint64(vdata.Len()) l := uint64(len(location)) digest, err := makeBinaryDigest(k.ChunkDigest) if err != nil { return nil, err } d, err := appendTag(digest, off, l) if err != nil { return nil, err } if tagLen == 0 { tagLen = len(d) } if tagLen != len(d) { return nil, errors.New("digest with different length found") } tags = append(tags, d) if _, err := vdata.Write(location); err != nil { return nil, err } digestLen = len(digest) } } bloomFilter := bloomFilterFromTags(tags, digestLen) pipeReader, pipeWriter := io.Pipe() errChan := make(chan error, 1) go func() { defer pipeWriter.Close() defer close(errChan) errChan <- writeCacheFileToWriter(pipeWriter, bloomFilter, tags, tagLen, digestLen, vdata, fnames, &tagsBuffer) }() defer pipeReader.Close() counter := ioutils.NewWriteCounter(io.Discard) r := io.TeeReader(pipeReader, counter) if err := dest.SetLayerBigData(id, cacheKey, r); err != nil { return nil, err } if err := <-errChan; err != nil { return nil, err } logrus.Debugf("Written lookaside cache for layer %q with length %v", id, counter.Count) return &cacheFile{ digestLen: digestLen, tagLen: tagLen, tags: tagsBuffer.Bytes(), vdata: vdata.Bytes(), fnames: fnames.Bytes(), fnamesLen: len(fnames.Bytes()), bloomFilter: bloomFilter, }, nil } // readCacheFileFromMemory reads a cache file from a buffer. // It can return (nil, nil) if the cache file uses a different file version that the one currently supported. func readCacheFileFromMemory(bigDataBuffer []byte) (*cacheFile, error) { bigData := bytes.NewReader(bigDataBuffer) var version, tagLen, digestLen, tagsLen, fnamesLen, vdataLen uint64 if err := binary.Read(bigData, binary.LittleEndian, &version); err != nil { return nil, err } if version != cacheVersion { return nil, nil //nolint: nilnil } if err := binary.Read(bigData, binary.LittleEndian, &tagLen); err != nil { return nil, err } if err := binary.Read(bigData, binary.LittleEndian, &digestLen); err != nil { return nil, err } bloomFilter, err := readBloomFilter(bigData) if err != nil { return nil, err } if err := binary.Read(bigData, binary.LittleEndian, &tagsLen); err != nil { return nil, err } if err := binary.Read(bigData, binary.LittleEndian, &vdataLen); err != nil { return nil, err } if err := binary.Read(bigData, binary.LittleEndian, &fnamesLen); err != nil { return nil, err } if tagsLen > maxTagsLen { return nil, fmt.Errorf("tags len %d exceeds the maximum allowed size %d", tagsLen, maxTagsLen) } if digestLen > tagLen { return nil, fmt.Errorf("digest len %d exceeds the tag len %d", digestLen, tagLen) } tags := make([]byte, tagsLen) if _, err := bigData.Read(tags); err != nil { return nil, err } // retrieve the unread part of the buffer. remaining := bigDataBuffer[len(bigDataBuffer)-bigData.Len():] if vdataLen >= uint64(len(remaining)) { return nil, fmt.Errorf("vdata len %d exceeds the remaining buffer size %d", vdataLen, len(remaining)) } vdata := remaining[:vdataLen] fnames := remaining[vdataLen:] return &cacheFile{ bloomFilter: bloomFilter, digestLen: int(digestLen), fnames: fnames, fnamesLen: int(fnamesLen), tagLen: int(tagLen), tags: tags, vdata: vdata, }, nil } func prepareCacheFile(manifest []byte, format graphdriver.DifferOutputFormat) ([]*fileMetadata, error) { toc, err := unmarshalToc(manifest) if err != nil { // ignore errors here. They might be caused by a different manifest format. logrus.Debugf("could not unmarshal manifest: %v", err) return nil, nil //nolint: nilnil } var entries []fileMetadata for i := range toc.Entries { entries = append(entries, fileMetadata{ FileMetadata: toc.Entries[i], }) } switch format { case graphdriver.DifferOutputFormatDir: case graphdriver.DifferOutputFormatFlat: entries, err = makeEntriesFlat(entries, nil) if err != nil { return nil, err } default: return nil, fmt.Errorf("unknown format %q", format) } var r []*fileMetadata chunkSeen := make(map[string]bool) for i := range entries { d := entries[i].Digest if d != "" { r = append(r, &entries[i]) continue } // chunks do not use hard link dedup so keeping just one candidate is enough cd := toc.Entries[i].ChunkDigest if cd != "" && !chunkSeen[cd] { r = append(r, &entries[i]) chunkSeen[cd] = true } } return r, nil } func (c *layersCache) createLayer(id string, cacheFile *cacheFile, mmapBuffer []byte) (*layer, error) { target, err := c.store.DifferTarget(id) if err != nil { return nil, fmt.Errorf("get checkout directory layer %q: %w", id, err) } l := &layer{ id: id, cacheFile: cacheFile, target: target, mmapBuffer: mmapBuffer, } if mmapBuffer != nil { runtime.SetFinalizer(l, layerFinalizer) } return l, nil } func findBinaryTag(binaryDigest []byte, cacheFile *cacheFile) (bool, uint64, uint64) { nElements := len(cacheFile.tags) / cacheFile.tagLen i := sort.Search(nElements, func(i int) bool { d := cacheFile.tags[i*cacheFile.tagLen : i*cacheFile.tagLen+cacheFile.digestLen] return bytes.Compare(d, binaryDigest) >= 0 }) if i < nElements { d := cacheFile.tags[i*cacheFile.tagLen : i*cacheFile.tagLen+cacheFile.digestLen] if bytes.Equal(binaryDigest, d) { startOff := i*cacheFile.tagLen + cacheFile.digestLen // check for corrupted data, there must be 2 u64 (off and len) after the digest. if cacheFile.tagLen < cacheFile.digestLen+16 { return false, 0, 0 } offsetAndLen := cacheFile.tags[startOff : (i+1)*cacheFile.tagLen] off := binary.LittleEndian.Uint64(offsetAndLen[:8]) len := binary.LittleEndian.Uint64(offsetAndLen[8:16]) return true, off, len } } return false, 0, 0 } func (c *layersCache) findDigestInternal(digest string) (string, string, int64, error) { if digest == "" { return "", "", -1, nil } c.mutex.RLock() defer c.mutex.RUnlock() binaryDigest, err := makeBinaryDigest(digest) if err != nil { return "", "", 0, err } for _, layer := range c.layers { if !layer.cacheFile.bloomFilter.maybeContains(binaryDigest) { continue } found, off, tagLen := findBinaryTag(binaryDigest, layer.cacheFile) if found { if uint64(len(layer.cacheFile.vdata)) < off+tagLen { return "", "", 0, fmt.Errorf("corrupted cache file for layer %q", layer.id) } fileLocationData := layer.cacheFile.vdata[off : off+tagLen] fnamePosition, offFile, _, err := parseFileLocation(fileLocationData) if err != nil { return "", "", 0, fmt.Errorf("corrupted cache file for layer %q", layer.id) } if len(layer.cacheFile.fnames) < fnamePosition+4 { return "", "", 0, fmt.Errorf("corrupted cache file for layer %q", layer.id) } lenPath := int(binary.LittleEndian.Uint32(layer.cacheFile.fnames[fnamePosition : fnamePosition+4])) if len(layer.cacheFile.fnames) < fnamePosition+lenPath+4 { return "", "", 0, fmt.Errorf("corrupted cache file for layer %q", layer.id) } path := string(layer.cacheFile.fnames[fnamePosition+4 : fnamePosition+lenPath+4]) // parts[1] is the chunk length, currently unused. return layer.target, path, int64(offFile), nil } } return "", "", -1, nil } // findFileInOtherLayers finds the specified file in other layers. // file is the file to look for. func (c *layersCache) findFileInOtherLayers(file *fileMetadata, useHardLinks bool) (string, string, error) { digest := file.Digest if useHardLinks { var err error digest, err = calculateHardLinkFingerprint(file) if err != nil { return "", "", err } } target, name, off, err := c.findDigestInternal(digest) if off == 0 { return target, name, err } return "", "", nil } func (c *layersCache) findChunkInOtherLayers(chunk *minimal.FileMetadata) (string, string, int64, error) { return c.findDigestInternal(chunk.ChunkDigest) } func unmarshalToc(manifest []byte) (*minimal.TOC, error) { var toc minimal.TOC iter := jsoniter.ParseBytes(jsoniter.ConfigFastest, manifest) for field := iter.ReadObject(); field != ""; field = iter.ReadObject() { switch strings.ToLower(field) { case "version": toc.Version = iter.ReadInt() case "entries": for iter.ReadArray() { var m minimal.FileMetadata for field := iter.ReadObject(); field != ""; field = iter.ReadObject() { switch strings.ToLower(field) { case "type": m.Type = iter.ReadString() case "name": m.Name = iter.ReadString() case "linkname": m.Linkname = iter.ReadString() case "mode": m.Mode = iter.ReadInt64() case "size": m.Size = iter.ReadInt64() case "uid": m.UID = iter.ReadInt() case "gid": m.GID = iter.ReadInt() case "modtime": time, err := time.Parse(time.RFC3339, iter.ReadString()) if err != nil { return nil, err } m.ModTime = &time case "accesstime": time, err := time.Parse(time.RFC3339, iter.ReadString()) if err != nil { return nil, err } m.AccessTime = &time case "changetime": time, err := time.Parse(time.RFC3339, iter.ReadString()) if err != nil { return nil, err } m.ChangeTime = &time case "devmajor": m.Devmajor = iter.ReadInt64() case "devminor": m.Devminor = iter.ReadInt64() case "digest": m.Digest = iter.ReadString() case "offset": m.Offset = iter.ReadInt64() case "endoffset": m.EndOffset = iter.ReadInt64() case "chunksize": m.ChunkSize = iter.ReadInt64() case "chunkoffset": m.ChunkOffset = iter.ReadInt64() case "chunkdigest": m.ChunkDigest = iter.ReadString() case "chunktype": m.ChunkType = iter.ReadString() case "xattrs": m.Xattrs = make(map[string]string) for key := iter.ReadObject(); key != ""; key = iter.ReadObject() { m.Xattrs[key] = iter.ReadString() } default: iter.Skip() } } if m.Type == TypeReg && m.Size == 0 && m.Digest == "" { m.Digest = digestSha256Empty } toc.Entries = append(toc.Entries, m) } case "tarsplitdigest": // strings.ToLower("tarSplitDigest") s := iter.ReadString() d, err := digest.Parse(s) if err != nil { return nil, fmt.Errorf("invalid tarSplitDigest %q: %w", s, err) } toc.TarSplitDigest = d default: iter.Skip() } } // validate there is no extra data in the provided input. This is a security measure to avoid // that the digest we calculate for the TOC refers to the entire document. if iter.Error != nil && iter.Error != io.EOF { return nil, iter.Error } if iter.WhatIsNext() != jsoniter.InvalidValue || !errors.Is(iter.Error, io.EOF) { return nil, fmt.Errorf("unexpected data after manifest") } return &toc, nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/chunked/compression.go ================================================ package chunked import ( "io" "go.podman.io/storage/pkg/chunked/compressor" "go.podman.io/storage/pkg/chunked/internal/minimal" ) const ( TypeReg = minimal.TypeReg TypeChunk = minimal.TypeChunk TypeLink = minimal.TypeLink TypeChar = minimal.TypeChar TypeBlock = minimal.TypeBlock TypeDir = minimal.TypeDir TypeFifo = minimal.TypeFifo TypeSymlink = minimal.TypeSymlink ) // ZstdCompressor is a CompressorFunc for the zstd compression algorithm. // Deprecated: Use pkg/chunked/compressor.ZstdCompressor. func ZstdCompressor(r io.Writer, metadata map[string]string, level *int) (io.WriteCloser, error) { return compressor.ZstdCompressor(r, metadata, level) } ================================================ FILE: vendor/go.podman.io/storage/pkg/chunked/compression_linux.go ================================================ package chunked import ( archivetar "archive/tar" "bytes" "errors" "fmt" "io" "maps" "os" "slices" "strconv" "time" "github.com/klauspost/compress/zstd" "github.com/klauspost/pgzip" digest "github.com/opencontainers/go-digest" "github.com/vbatts/tar-split/archive/tar" "github.com/vbatts/tar-split/tar/asm" "github.com/vbatts/tar-split/tar/storage" "go.podman.io/storage/pkg/chunked/internal/minimal" "golang.org/x/sys/unix" ) const ( // maxTocSize is the maximum size of a blob that we will attempt to process. // It is used to prevent DoS attacks from layers that embed a very large TOC file. maxTocSize = (1 << 20) * 150 ) var typesToTar = map[string]byte{ TypeReg: tar.TypeReg, TypeLink: tar.TypeLink, TypeChar: tar.TypeChar, TypeBlock: tar.TypeBlock, TypeDir: tar.TypeDir, TypeFifo: tar.TypeFifo, TypeSymlink: tar.TypeSymlink, } func typeToTarType(t string) (byte, error) { r, found := typesToTar[t] if !found { return 0, fmt.Errorf("unknown type: %v", t) } return r, nil } // readEstargzChunkedManifest reads the estargz manifest from the seekable stream blobStream. // It may return an error matching ErrFallbackToOrdinaryLayerDownload / errFallbackCanConvert. func readEstargzChunkedManifest(blobStream ImageSourceSeekable, blobSize int64, tocDigest digest.Digest) ([]byte, int64, error) { // information on the format here https://github.com/containerd/stargz-snapshotter/blob/main/docs/stargz-estargz.md footerSize := int64(51) if blobSize <= footerSize { return nil, 0, errors.New("blob too small") } footer := make([]byte, footerSize) streamsOrErrors, err := getBlobAt(blobStream, ImageSourceChunk{Offset: uint64(blobSize - footerSize), Length: uint64(footerSize)}) if err != nil { var badRequestErr ErrBadRequest if errors.As(err, &badRequestErr) { err = errFallbackCanConvert{newErrFallbackToOrdinaryLayerDownload(err)} } return nil, 0, err } for soe := range streamsOrErrors { if soe.stream != nil { _, err = io.ReadFull(soe.stream, footer) _ = soe.stream.Close() } if soe.err != nil && err == nil { err = soe.err } } /* Read the ToC offset: - 10 bytes gzip header - 2 bytes XLEN (length of Extra field) = 26 (4 bytes header + 16 hex digits + len("STARGZ")) - 2 bytes Extra: SI1 = 'S', SI2 = 'G' - 2 bytes Extra: LEN = 22 (16 hex digits + len("STARGZ")) - 22 bytes Extra: subfield = fmt.Sprintf("%016xSTARGZ", offsetOfTOC) - 5 bytes flate header: BFINAL = 1(last block), BTYPE = 0(non-compressed block), LEN = 0 - 8 bytes gzip footer */ tocOffset, err := strconv.ParseInt(string(footer[16:16+22-6]), 16, 64) if err != nil { return nil, 0, fmt.Errorf("parse ToC offset: %w", err) } size := blobSize - footerSize - tocOffset // set a reasonable limit if size > maxTocSize { // Not errFallbackCanConvert: we would still use too much memory. return nil, 0, newErrFallbackToOrdinaryLayerDownload(fmt.Errorf("estargz manifest too big to process in memory (%d bytes)", size)) } streamsOrErrors, err = getBlobAt(blobStream, ImageSourceChunk{Offset: uint64(tocOffset), Length: uint64(size)}) if err != nil { var badRequestErr ErrBadRequest if errors.As(err, &badRequestErr) { err = errFallbackCanConvert{newErrFallbackToOrdinaryLayerDownload(err)} } return nil, 0, err } var manifestUncompressed []byte for soe := range streamsOrErrors { if soe.stream != nil { err1 := func() error { defer soe.stream.Close() r, err := pgzip.NewReader(soe.stream) if err != nil { return err } defer r.Close() aTar := archivetar.NewReader(r) header, err := aTar.Next() if err != nil { return err } // set a reasonable limit if header.Size > maxTocSize { return errors.New("manifest too big") } manifestUncompressed = make([]byte, header.Size) if _, err := io.ReadFull(aTar, manifestUncompressed); err != nil { return err } return nil }() if err == nil { err = err1 } } else if err == nil { err = soe.err } } if manifestUncompressed == nil { return nil, 0, errors.New("manifest not found") } manifestDigester := digest.Canonical.Digester() manifestChecksum := manifestDigester.Hash() if _, err := manifestChecksum.Write(manifestUncompressed); err != nil { return nil, 0, err } if manifestDigester.Digest() != tocDigest { return nil, 0, errors.New("invalid manifest checksum") } return manifestUncompressed, tocOffset, nil } func openTmpFile(tmpDir string) (*os.File, error) { file, err := os.OpenFile(tmpDir, unix.O_TMPFILE|unix.O_RDWR|unix.O_CLOEXEC|unix.O_EXCL, 0o600) if err == nil { return file, nil } return openTmpFileNoTmpFile(tmpDir) } // openTmpFileNoTmpFile is a fallback used by openTmpFile when the underlying file system does not // support O_TMPFILE. func openTmpFileNoTmpFile(tmpDir string) (*os.File, error) { file, err := os.CreateTemp(tmpDir, ".tmpfile") if err != nil { return nil, err } // Unlink the file immediately so that only the open fd refers to it. _ = os.Remove(file.Name()) return file, nil } // readZstdChunkedManifest reads the zstd:chunked manifest from the seekable stream blobStream. // tmpDir is a directory where the tar-split temporary file is written to. The file is opened with // O_TMPFILE so that it is automatically removed when it is closed. // Returns (manifest blob, parsed manifest, tar-split file or nil, manifest offset). // The opened tar-split file’s position is unspecified. // It may return an error matching ErrFallbackToOrdinaryLayerDownload / errFallbackCanConvert. // The compressed parameter indicates whether the manifest and tar-split data are zstd-compressed // (true) or stored uncompressed (false). Uncompressed data is used only for an optimization to convert // a regular OCI layer to zstd:chunked when convert_images is set, and it is not used for distributed images. func readZstdChunkedManifest(tmpDir string, blobStream ImageSourceSeekable, tocDigest digest.Digest, annotations map[string]string, compressed bool) (_ []byte, _ *minimal.TOC, _ *os.File, _ int64, retErr error) { offsetMetadata := annotations[minimal.ManifestInfoKey] if offsetMetadata == "" { return nil, nil, nil, 0, fmt.Errorf("%q annotation missing", minimal.ManifestInfoKey) } var manifestChunk ImageSourceChunk var manifestLengthUncompressed, manifestType uint64 if _, err := fmt.Sscanf(offsetMetadata, "%d:%d:%d:%d", &manifestChunk.Offset, &manifestChunk.Length, &manifestLengthUncompressed, &manifestType); err != nil { return nil, nil, nil, 0, err } // The tarSplit… values are valid if tarSplitChunk.Offset > 0 var tarSplitChunk ImageSourceChunk var tarSplitLengthUncompressed uint64 if tarSplitInfoKeyAnnotation, found := annotations[minimal.TarSplitInfoKey]; found { if _, err := fmt.Sscanf(tarSplitInfoKeyAnnotation, "%d:%d:%d", &tarSplitChunk.Offset, &tarSplitChunk.Length, &tarSplitLengthUncompressed); err != nil { return nil, nil, nil, 0, err } } if manifestType != minimal.ManifestTypeCRFS { return nil, nil, nil, 0, errors.New("invalid manifest type") } // set a reasonable limit if manifestChunk.Length > maxTocSize { // Not errFallbackCanConvert: we would still use too much memory. return nil, nil, nil, 0, newErrFallbackToOrdinaryLayerDownload(fmt.Errorf("zstd:chunked manifest too big to process in memory (%d bytes compressed)", manifestChunk.Length)) } if manifestLengthUncompressed > maxTocSize { // Not errFallbackCanConvert: we would still use too much memory. return nil, nil, nil, 0, newErrFallbackToOrdinaryLayerDownload(fmt.Errorf("zstd:chunked manifest too big to process in memory (%d bytes uncompressed)", manifestLengthUncompressed)) } chunks := []ImageSourceChunk{manifestChunk} if tarSplitChunk.Offset > 0 { chunks = append(chunks, tarSplitChunk) } streamsOrErrors, err := getBlobAt(blobStream, chunks...) if err != nil { var badRequestErr ErrBadRequest if errors.As(err, &badRequestErr) { err = errFallbackCanConvert{newErrFallbackToOrdinaryLayerDownload(err)} } return nil, nil, nil, 0, err } defer func() { err := ensureAllBlobsDone(streamsOrErrors) if retErr == nil { retErr = err } }() readBlob := func(len uint64) ([]byte, error) { soe, ok := <-streamsOrErrors if !ok { return nil, errors.New("stream closed") } if soe.err != nil { return nil, soe.err } defer soe.stream.Close() blob := make([]byte, len) if _, err := io.ReadFull(soe.stream, blob); err != nil { return nil, err } return blob, nil } manifest, err := readBlob(manifestChunk.Length) if err != nil { return nil, nil, nil, 0, err } decodedBlob, err := decodeAndValidateBlob(manifest, manifestLengthUncompressed, tocDigest.String(), compressed) if err != nil { return nil, nil, nil, 0, fmt.Errorf("validating and decompressing TOC: %w", err) } toc, err := unmarshalToc(decodedBlob) if err != nil { return nil, nil, nil, 0, fmt.Errorf("unmarshaling TOC: %w", err) } var decodedTarSplit *os.File if toc.TarSplitDigest != "" { if tarSplitChunk.Offset <= 0 { return nil, nil, nil, 0, fmt.Errorf("TOC requires a tar-split, but the %s annotation does not describe a position", minimal.TarSplitInfoKey) } tarSplit, err := readBlob(tarSplitChunk.Length) if err != nil { return nil, nil, nil, 0, err } decodedTarSplit, err = openTmpFile(tmpDir) if err != nil { return nil, nil, nil, 0, err } defer func() { if retErr != nil { decodedTarSplit.Close() } }() if err := decodeAndValidateBlobToStream(tarSplit, decodedTarSplit, toc.TarSplitDigest.String(), compressed); err != nil { return nil, nil, nil, 0, fmt.Errorf("validating and decompressing tar-split: %w", err) } // We use the TOC for creating on-disk files, but the tar-split for creating metadata // when exporting the layer contents. Ensure the two match, otherwise local inspection of a container // might be misleading about the exported contents. if err := ensureTOCMatchesTarSplit(toc, decodedTarSplit); err != nil { return nil, nil, nil, 0, fmt.Errorf("tar-split and TOC data is inconsistent: %w", err) } } else if tarSplitChunk.Offset > 0 { // We must ignore the tar-split when the digest is not present in the TOC, because we can’t authenticate it. // // But if we asked for the chunk, now we must consume the data to not block the producer. // Ideally the GetBlobAt API should be changed so that this is not necessary. _, err := readBlob(tarSplitChunk.Length) if err != nil { return nil, nil, nil, 0, err } } return decodedBlob, toc, decodedTarSplit, int64(manifestChunk.Offset), nil } // ensureTOCMatchesTarSplit validates that toc and tarSplit contain _exactly_ the same entries. func ensureTOCMatchesTarSplit(toc *minimal.TOC, tarSplit *os.File) error { pendingFiles := map[string]*minimal.FileMetadata{} // Name -> an entry in toc.Entries for i := range toc.Entries { e := &toc.Entries[i] if e.Type != minimal.TypeChunk { if _, ok := pendingFiles[e.Name]; ok { return fmt.Errorf("TOC contains duplicate entries for path %q", e.Name) } pendingFiles[e.Name] = e } } if _, err := tarSplit.Seek(0, io.SeekStart); err != nil { return err } unpacker := storage.NewJSONUnpacker(tarSplit) if err := asm.IterateHeaders(unpacker, func(hdr *tar.Header) error { e, ok := pendingFiles[hdr.Name] if !ok { return fmt.Errorf("tar-split contains an entry for %q missing in TOC", hdr.Name) } delete(pendingFiles, hdr.Name) expected, err := minimal.NewFileMetadata(hdr) if err != nil { return fmt.Errorf("determining expected metadata for %q: %w", hdr.Name, err) } if err := ensureFileMetadataAttributesMatch(e, &expected); err != nil { return fmt.Errorf("TOC and tar-split metadata doesn’t match: %w", err) } return nil }); err != nil { return err } if len(pendingFiles) != 0 { remaining := slices.Collect(maps.Keys(pendingFiles)) if len(remaining) > 5 { remaining = remaining[:5] // Just to limit the size of the output. } return fmt.Errorf("TOC contains entries not present in tar-split, incl. %q", remaining) } return nil } // tarSizeFromTarSplit computes the total tarball size, using only the tarSplit metadata func tarSizeFromTarSplit(tarSplit io.Reader) (int64, error) { var res int64 = 0 unpacker := storage.NewJSONUnpacker(tarSplit) for { entry, err := unpacker.Next() if err != nil { if err == io.EOF { break } return -1, fmt.Errorf("reading tar-split entries: %w", err) } switch entry.Type { case storage.SegmentType: res += int64(len(entry.Payload)) case storage.FileType: // entry.Size is the “logical size”, which might not be the physical size for sparse entries; // but the way tar-split/tar/asm.WriteOutputTarStream combines FileType entries and returned files contents, // sparse files are not supported. // Also https://github.com/opencontainers/image-spec/blob/main/layer.md says // > Sparse files SHOULD NOT be used because they lack consistent support across tar implementations. res += entry.Size default: return -1, fmt.Errorf("unexpected tar-split entry type %q", entry.Type) } } return res, nil } // ensureTimePointersMatch ensures that a and b are equal func ensureTimePointersMatch(a, b *time.Time) error { // We didn’t always use “timeIfNotZero” when creating the TOC, so treat time.IsZero the same as nil. // The archive/tar code turns time.IsZero() timestamps into an Unix timestamp of 0 when writing, but turns an Unix timestamp of 0 // when writing into a (local-timezone) Jan 1 1970, which is not IsZero(). So, treat that the same as IsZero as well. unixZero := time.Unix(0, 0) if a != nil && (a.IsZero() || a.Equal(unixZero)) { a = nil } if b != nil && (b.IsZero() || b.Equal(unixZero)) { b = nil } switch { case a == nil && b == nil: return nil case a == nil: return fmt.Errorf("nil != %v", *b) case b == nil: return fmt.Errorf("%v != nil", *a) default: if a.Equal(*b) { return nil } return fmt.Errorf("%v != %v", *a, *b) } } // ensureFileMetadataAttributesMatch ensures that a and b match in file attributes (it ignores entries relevant to locating data // in the tar stream or matching contents) func ensureFileMetadataAttributesMatch(a, b *minimal.FileMetadata) error { // Keep this in sync with minimal.FileMetadata! if a.Type != b.Type { return fmt.Errorf("mismatch of Type: %q != %q", a.Type, b.Type) } if a.Name != b.Name { return fmt.Errorf("mismatch of Name: %q != %q", a.Name, b.Name) } if a.Linkname != b.Linkname { return fmt.Errorf("mismatch of Linkname: %q != %q", a.Linkname, b.Linkname) } if a.Mode != b.Mode { return fmt.Errorf("mismatch of Mode: %q != %q", a.Mode, b.Mode) } if a.Size != b.Size { return fmt.Errorf("mismatch of Size: %q != %q", a.Size, b.Size) } if a.UID != b.UID { return fmt.Errorf("mismatch of UID: %q != %q", a.UID, b.UID) } if a.GID != b.GID { return fmt.Errorf("mismatch of GID: %q != %q", a.GID, b.GID) } if err := ensureTimePointersMatch(a.ModTime, b.ModTime); err != nil { return fmt.Errorf("mismatch of ModTime: %w", err) } if err := ensureTimePointersMatch(a.AccessTime, b.AccessTime); err != nil { return fmt.Errorf("mismatch of AccessTime: %w", err) } if err := ensureTimePointersMatch(a.ChangeTime, b.ChangeTime); err != nil { return fmt.Errorf("mismatch of ChangeTime: %w", err) } if a.Devmajor != b.Devmajor { return fmt.Errorf("mismatch of Devmajor: %q != %q", a.Devmajor, b.Devmajor) } if a.Devminor != b.Devminor { return fmt.Errorf("mismatch of Devminor: %q != %q", a.Devminor, b.Devminor) } if !maps.Equal(a.Xattrs, b.Xattrs) { return fmt.Errorf("mismatch of Xattrs: %q != %q", a.Xattrs, b.Xattrs) } // Digest is not compared // Offset is not compared // EndOffset is not compared // ChunkSize is not compared // ChunkOffset is not compared // ChunkDigest is not compared // ChunkType is not compared return nil } func validateBlob(blob []byte, expectedCompressedChecksum string) error { d, err := digest.Parse(expectedCompressedChecksum) if err != nil { return fmt.Errorf("invalid digest %q: %w", expectedCompressedChecksum, err) } blobDigester := d.Algorithm().Digester() blobChecksum := blobDigester.Hash() if _, err := blobChecksum.Write(blob); err != nil { return err } if blobDigester.Digest() != d { return fmt.Errorf("invalid blob checksum, expected checksum %s, got %s", d, blobDigester.Digest()) } return nil } func decodeAndValidateBlob(blob []byte, lengthUncompressed uint64, expectedCompressedChecksum string, compressed bool) ([]byte, error) { if err := validateBlob(blob, expectedCompressedChecksum); err != nil { return nil, err } if !compressed { return blob, nil } decoder, err := zstd.NewReader(nil) if err != nil { return nil, err } defer decoder.Close() b := make([]byte, 0, lengthUncompressed) return decoder.DecodeAll(blob, b) } func decodeAndValidateBlobToStream(blob []byte, w *os.File, expectedCompressedChecksum string, compressed bool) error { if err := validateBlob(blob, expectedCompressedChecksum); err != nil { return err } if !compressed { _, err := w.Write(blob) return err } decoder, err := zstd.NewReader(bytes.NewReader(blob)) if err != nil { return err } defer decoder.Close() _, err = decoder.WriteTo(w) return err } ================================================ FILE: vendor/go.podman.io/storage/pkg/chunked/compressor/compressor.go ================================================ package compressor // NOTE: This is used from github.com/containers/image by callers that // don't otherwise use containers/storage, so don't make this depend on any // larger software like the graph drivers. import ( "bufio" "bytes" "io" "github.com/opencontainers/go-digest" "github.com/vbatts/tar-split/archive/tar" "github.com/vbatts/tar-split/tar/asm" "github.com/vbatts/tar-split/tar/storage" "go.podman.io/storage/pkg/chunked/internal/minimal" "go.podman.io/storage/pkg/ioutils" ) const ( RollsumBits = 16 holesThreshold = int64(1 << 10) ) type holesFinder struct { reader *bufio.Reader zeros int64 threshold int64 state int } const ( holesFinderStateRead = iota holesFinderStateAccumulate holesFinderStateFound holesFinderStateEOF ) // readByte reads a single byte from the underlying reader. // If a single byte is read, the return value is (0, RAW-BYTE-VALUE, nil). // If there are at least f.THRESHOLD consecutive zeros, then the // return value is (N_CONSECUTIVE_ZEROS, '\x00'). func (f *holesFinder) readByte() (int64, byte, error) { for { switch f.state { // reading the file stream case holesFinderStateRead: if f.zeros > 0 { f.zeros-- return 0, 0, nil } b, err := f.reader.ReadByte() if err != nil { return 0, b, err } if b != 0 { return 0, b, err } f.zeros = 1 if f.zeros == f.threshold { f.state = holesFinderStateFound } else { f.state = holesFinderStateAccumulate } // accumulating zeros, but still didn't reach the threshold case holesFinderStateAccumulate: b, err := f.reader.ReadByte() if err != nil { if err == io.EOF { f.state = holesFinderStateEOF continue } return 0, b, err } if b == 0 { f.zeros++ if f.zeros == f.threshold { f.state = holesFinderStateFound } } else { if err := f.reader.UnreadByte(); err != nil { return 0, 0, err } f.state = holesFinderStateRead } // found a hole. Number of zeros >= threshold case holesFinderStateFound: b, err := f.reader.ReadByte() if err != nil { if err == io.EOF { f.state = holesFinderStateEOF } holeLen := f.zeros f.zeros = 0 return holeLen, 0, nil } if b != 0 { if err := f.reader.UnreadByte(); err != nil { return 0, 0, err } f.state = holesFinderStateRead holeLen := f.zeros f.zeros = 0 return holeLen, 0, nil } f.zeros++ // reached EOF. Flush pending zeros if any. case holesFinderStateEOF: if f.zeros > 0 { f.zeros-- return 0, 0, nil } return 0, 0, io.EOF } } } type rollingChecksumReader struct { reader *holesFinder closed bool rollsum *RollSum pendingHole int64 // WrittenOut is the total number of bytes read from // the stream. WrittenOut int64 // IsLastChunkZeros tells whether the last generated // chunk is a hole (made of consecutive zeros). If it // is false, then the last chunk is a data chunk // generated by the rolling checksum. IsLastChunkZeros bool } func (rc *rollingChecksumReader) Read(b []byte) (bool, int, error) { rc.IsLastChunkZeros = false if rc.pendingHole > 0 { toCopy := min(rc.pendingHole, int64(len(b))) rc.pendingHole -= toCopy for i := range b[:toCopy] { b[i] = 0 } rc.WrittenOut += toCopy rc.IsLastChunkZeros = true // if there are no other zeros left, terminate the chunk return rc.pendingHole == 0, int(toCopy), nil } if rc.closed { return false, 0, io.EOF } for i := range b { holeLen, n, err := rc.reader.readByte() if err != nil { if err == io.EOF { rc.closed = true if i == 0 { return false, 0, err } return false, i, nil } // Report any other error type return false, -1, err } if holeLen > 0 { for range holeLen { rc.rollsum.Roll(0) } rc.pendingHole = holeLen return true, i, nil } b[i] = n rc.WrittenOut++ rc.rollsum.Roll(n) if rc.rollsum.OnSplitWithBits(RollsumBits) { return true, i + 1, nil } } return false, len(b), nil } type chunk struct { ChunkOffset int64 Offset int64 Checksum string ChunkSize int64 ChunkType string } type tarSplitData struct { compressed *bytes.Buffer digester digest.Digester uncompressedCounter *ioutils.WriteCounter zstd minimal.ZstdWriter packer storage.Packer } func newTarSplitData(createZstdWriter minimal.CreateZstdWriterFunc) (*tarSplitData, error) { compressed := bytes.NewBuffer(nil) digester := digest.Canonical.Digester() zstdWriter, err := createZstdWriter(io.MultiWriter(compressed, digester.Hash())) if err != nil { return nil, err } uncompressedCounter := ioutils.NewWriteCounter(zstdWriter) metaPacker := storage.NewJSONPacker(uncompressedCounter) return &tarSplitData{ compressed: compressed, digester: digester, uncompressedCounter: uncompressedCounter, zstd: zstdWriter, packer: metaPacker, }, nil } func writeZstdChunkedStream(destFile io.Writer, outMetadata map[string]string, reader io.Reader, createZstdWriter minimal.CreateZstdWriterFunc) error { // total written so far. Used to retrieve partial offsets in the file dest := ioutils.NewWriteCounter(destFile) tarSplitData, err := newTarSplitData(createZstdWriter) if err != nil { return err } defer func() { if tarSplitData.zstd != nil { tarSplitData.zstd.Close() } }() its, err := asm.NewInputTarStream(reader, tarSplitData.packer, nil) if err != nil { return err } tr := tar.NewReader(its) tr.RawAccounting = true buf := make([]byte, 4096) zstdWriter, err := createZstdWriter(dest) if err != nil { return err } defer func() { if zstdWriter != nil { zstdWriter.Close() } }() restartCompression := func() (int64, error) { var offset int64 if zstdWriter != nil { if err := zstdWriter.Close(); err != nil { return 0, err } offset = dest.Count zstdWriter.Reset(dest) } return offset, nil } var metadata []minimal.FileMetadata for { hdr, err := tr.Next() if err != nil { if err == io.EOF { break } return err } rawBytes := tr.RawBytes() if _, err := zstdWriter.Write(rawBytes); err != nil { return err } payloadDigester := digest.Canonical.Digester() chunkDigester := digest.Canonical.Digester() // Now handle the payload, if any startOffset := int64(0) lastOffset := int64(0) lastChunkOffset := int64(0) checksum := "" chunks := []chunk{} hf := &holesFinder{ threshold: holesThreshold, reader: bufio.NewReader(tr), } rcReader := &rollingChecksumReader{ reader: hf, rollsum: NewRollSum(), } payloadDest := io.MultiWriter(payloadDigester.Hash(), chunkDigester.Hash(), zstdWriter) for { mustSplit, read, errRead := rcReader.Read(buf) if errRead != nil && errRead != io.EOF { return err } // restart the compression only if there is a payload. if read > 0 { if startOffset == 0 { startOffset, err = restartCompression() if err != nil { return err } lastOffset = startOffset } if _, err := payloadDest.Write(buf[:read]); err != nil { return err } } if (mustSplit || errRead == io.EOF) && startOffset > 0 { off, err := restartCompression() if err != nil { return err } chunkSize := rcReader.WrittenOut - lastChunkOffset if chunkSize > 0 { chunkType := minimal.ChunkTypeData if rcReader.IsLastChunkZeros { chunkType = minimal.ChunkTypeZeros } chunks = append(chunks, chunk{ ChunkOffset: lastChunkOffset, Offset: lastOffset, Checksum: chunkDigester.Digest().String(), ChunkSize: chunkSize, ChunkType: chunkType, }) } lastOffset = off lastChunkOffset = rcReader.WrittenOut chunkDigester = digest.Canonical.Digester() payloadDest = io.MultiWriter(payloadDigester.Hash(), chunkDigester.Hash(), zstdWriter) } if errRead == io.EOF { if startOffset > 0 { checksum = payloadDigester.Digest().String() } break } } mainEntry, err := minimal.NewFileMetadata(hdr) if err != nil { return err } mainEntry.Digest = checksum mainEntry.Offset = startOffset mainEntry.EndOffset = lastOffset entries := []minimal.FileMetadata{mainEntry} for i := 1; i < len(chunks); i++ { entries = append(entries, minimal.FileMetadata{ Type: minimal.TypeChunk, Name: hdr.Name, ChunkOffset: chunks[i].ChunkOffset, }) } if len(chunks) > 1 { for i := range chunks { entries[i].ChunkSize = chunks[i].ChunkSize entries[i].Offset = chunks[i].Offset entries[i].ChunkDigest = chunks[i].Checksum entries[i].ChunkType = chunks[i].ChunkType } } metadata = append(metadata, entries...) } rawBytes := tr.RawBytes() if _, err := zstdWriter.Write(rawBytes); err != nil { zstdWriter.Close() return err } // make sure the entire tarball is flushed to the output as it might contain // some trailing zeros that affect the checksum. if _, err := io.Copy(zstdWriter, its); err != nil { zstdWriter.Close() return err } if err := zstdWriter.Close(); err != nil { return err } zstdWriter = nil if err := tarSplitData.zstd.Close(); err != nil { return err } tarSplitData.zstd = nil ts := minimal.TarSplitData{ Data: tarSplitData.compressed.Bytes(), Digest: tarSplitData.digester.Digest(), UncompressedSize: tarSplitData.uncompressedCounter.Count, } return minimal.WriteZstdChunkedManifest(dest, outMetadata, uint64(dest.Count), &ts, metadata, createZstdWriter) } type zstdChunkedWriter struct { tarSplitOut *io.PipeWriter tarSplitErr chan error } func (w zstdChunkedWriter) Close() error { errClose := w.tarSplitOut.Close() if err := <-w.tarSplitErr; err != nil && err != io.EOF { return err } return errClose } func (w zstdChunkedWriter) Write(p []byte) (int, error) { select { case err := <-w.tarSplitErr: w.tarSplitOut.Close() return 0, err default: return w.tarSplitOut.Write(p) } } // makeZstdChunkedWriter writes a zstd compressed tarball where each file is // compressed separately so it can be addressed separately. Idea based on CRFS: // https://github.com/google/crfs // The difference with CRFS is that the zstd compression is used instead of gzip. // The reason for it is that zstd supports embedding metadata ignored by the decoder // as part of the compressed stream. // A manifest json file with all the metadata is appended at the end of the tarball // stream, using zstd skippable frames. // The final file will look like: // [FILE_1][FILE_2]..[FILE_N][SKIPPABLE FRAME 1][SKIPPABLE FRAME 2] // Where: // [FILE_N]: [ZSTD HEADER][TAR HEADER][PAYLOAD FILE_N][ZSTD FOOTER] // [SKIPPABLE FRAME 1]: [ZSTD SKIPPABLE FRAME, SIZE=MANIFEST LENGTH][MANIFEST] // [SKIPPABLE FRAME 2]: [ZSTD SKIPPABLE FRAME, SIZE=16][MANIFEST_OFFSET][MANIFEST_LENGTH][MANIFEST_LENGTH_UNCOMPRESSED][MANIFEST_TYPE][CHUNKED_ZSTD_MAGIC_NUMBER] // MANIFEST_OFFSET, MANIFEST_LENGTH, MANIFEST_LENGTH_UNCOMPRESSED and CHUNKED_ZSTD_MAGIC_NUMBER are 64 bits unsigned in little endian format. func makeZstdChunkedWriter(out io.Writer, metadata map[string]string, createZstdWriter minimal.CreateZstdWriterFunc) (io.WriteCloser, error) { ch := make(chan error, 1) r, w := io.Pipe() go func() { ch <- writeZstdChunkedStream(out, metadata, r, createZstdWriter) _, _ = io.Copy(io.Discard, r) // Ordinarily writeZstdChunkedStream consumes all of r. If it fails, ensure the write end never blocks and eventually terminates. r.Close() close(ch) }() return zstdChunkedWriter{ tarSplitOut: w, tarSplitErr: ch, }, nil } // ZstdCompressor is a CompressorFunc for the zstd compression algorithm. func ZstdCompressor(r io.Writer, metadata map[string]string, level *int) (io.WriteCloser, error) { if level == nil { l := 10 level = &l } createZstdWriter := func(dest io.Writer) (minimal.ZstdWriter, error) { return minimal.ZstdWriterWithLevel(dest, *level) } return makeZstdChunkedWriter(r, metadata, createZstdWriter) } type noCompression struct { dest io.Writer } func (n *noCompression) Write(p []byte) (int, error) { return n.dest.Write(p) } func (n *noCompression) Close() error { return nil } func (n *noCompression) Flush() error { return nil } func (n *noCompression) Reset(dest io.Writer) { n.dest = dest } // NoCompression writes directly to the output file without any compression // // Such an output does not follow the zstd:chunked spec and cannot be generally consumed; this function // only exists for internal purposes and should not be called from outside c/storage. func NoCompression(r io.Writer, metadata map[string]string) (io.WriteCloser, error) { createZstdWriter := func(dest io.Writer) (minimal.ZstdWriter, error) { return &noCompression{dest: dest}, nil } return makeZstdChunkedWriter(r, metadata, createZstdWriter) } ================================================ FILE: vendor/go.podman.io/storage/pkg/chunked/compressor/rollsum.go ================================================ /* Copyright 2011 The Perkeep Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Package rollsum implements rolling checksums similar to apenwarr's bup, which // is similar to librsync. // // The bup project is at https://github.com/apenwarr/bup and its splitting in // particular is at https://github.com/apenwarr/bup/blob/master/lib/bup/bupsplit.c package compressor import ( "math/bits" ) const ( windowSize = 64 // Roll assumes windowSize is a power of 2 charOffset = 31 ) const ( blobBits = 13 blobSize = 1 << blobBits // 8k ) type RollSum struct { s1, s2 uint32 window [windowSize]uint8 wofs int } func NewRollSum() *RollSum { return &RollSum{ s1: windowSize * charOffset, s2: windowSize * (windowSize - 1) * charOffset, } } func (rs *RollSum) add(drop, add uint32) { s1 := rs.s1 + add - drop rs.s1 = s1 rs.s2 += s1 - uint32(windowSize)*(drop+charOffset) } // Roll adds ch to the rolling sum. func (rs *RollSum) Roll(ch byte) { wp := &rs.window[rs.wofs] rs.add(uint32(*wp), uint32(ch)) *wp = ch rs.wofs = (rs.wofs + 1) & (windowSize - 1) } // OnSplit reports whether at least 13 consecutive trailing bits of // the current checksum are set the same way. func (rs *RollSum) OnSplit() bool { return (rs.s2 & (blobSize - 1)) == ((^0) & (blobSize - 1)) } // OnSplitWithBits reports whether at least n consecutive trailing bits // of the current checksum are set the same way. func (rs *RollSum) OnSplitWithBits(n uint32) bool { mask := (uint32(1) << n) - 1 return rs.s2&mask == (^uint32(0))&mask } func (rs *RollSum) Bits() int { rsum := rs.Digest() >> (blobBits + 1) return blobBits + bits.TrailingZeros32(^rsum) } func (rs *RollSum) Digest() uint32 { return (rs.s1 << 16) | (rs.s2 & 0xffff) } ================================================ FILE: vendor/go.podman.io/storage/pkg/chunked/dump/dump.go ================================================ //go:build unix package dump import ( "bufio" "encoding/base64" "fmt" "io" "path/filepath" "reflect" "strings" "time" "github.com/opencontainers/go-digest" "go.podman.io/storage/pkg/chunked/internal/minimal" storagePath "go.podman.io/storage/pkg/chunked/internal/path" "golang.org/x/sys/unix" ) const ( ESCAPE_STANDARD = 0 NOESCAPE_SPACE = 1 << iota ESCAPE_EQUAL ESCAPE_LONE_DASH ) func escaped(val []byte, escape int) string { noescapeSpace := escape&NOESCAPE_SPACE != 0 escapeEqual := escape&ESCAPE_EQUAL != 0 escapeLoneDash := escape&ESCAPE_LONE_DASH != 0 if escapeLoneDash && len(val) == 1 && val[0] == '-' { return fmt.Sprintf("\\x%.2x", val[0]) } // This is intended to match the C isprint API with LC_CTYPE=C isprint := func(c byte) bool { return c >= 32 && c < 127 } // This is intended to match the C isgraph API with LC_CTYPE=C isgraph := func(c byte) bool { return c > 32 && c < 127 } var result strings.Builder for _, c := range val { hexEscape := false var special string switch c { case '\\': special = "\\\\" case '\n': special = "\\n" case '\r': special = "\\r" case '\t': special = "\\t" case '=': hexEscape = escapeEqual default: if noescapeSpace { hexEscape = !isprint(c) } else { hexEscape = !isgraph(c) } } if special != "" { result.WriteString(special) } else if hexEscape { fmt.Fprintf(&result, "\\x%.2x", c) } else { result.WriteString(string(c)) } } return result.String() } func escapedOptional(val []byte, escape int) string { if len(val) == 0 { return "-" } return escaped(val, escape) } func getStMode(mode uint32, typ string) (uint32, error) { switch typ { case minimal.TypeReg, minimal.TypeLink: mode |= unix.S_IFREG case minimal.TypeChar: mode |= unix.S_IFCHR case minimal.TypeBlock: mode |= unix.S_IFBLK case minimal.TypeDir: mode |= unix.S_IFDIR case minimal.TypeFifo: mode |= unix.S_IFIFO case minimal.TypeSymlink: mode |= unix.S_IFLNK default: return 0, fmt.Errorf("unknown type %s", typ) } return mode, nil } func dumpNode(out io.Writer, added map[string]*minimal.FileMetadata, links map[string]int, verityDigests map[string]string, entry *minimal.FileMetadata) error { path := storagePath.CleanAbsPath(entry.Name) parent := filepath.Dir(path) if _, found := added[parent]; !found && path != "/" { parentEntry := &minimal.FileMetadata{ Name: parent, Type: minimal.TypeDir, Mode: 0o755, } if err := dumpNode(out, added, links, verityDigests, parentEntry); err != nil { return err } } if e, found := added[path]; found { // if the entry was already added, make sure it has the same data if !reflect.DeepEqual(*e, *entry) { return fmt.Errorf("entry %q already added with different data", path) } return nil } added[path] = entry if _, err := fmt.Fprint(out, escaped([]byte(path), ESCAPE_STANDARD)); err != nil { return err } nlinks := links[entry.Name] + links[entry.Linkname] + 1 link := "" if entry.Type == minimal.TypeLink { link = "@" } rdev := unix.Mkdev(uint32(entry.Devmajor), uint32(entry.Devminor)) entryTime := entry.ModTime if entryTime == nil { t := time.Unix(0, 0) entryTime = &t } mode, err := getStMode(uint32(entry.Mode), entry.Type) if err != nil { return err } if _, err := fmt.Fprintf(out, " %d %s%o %d %d %d %d %d.%d ", entry.Size, link, mode, nlinks, entry.UID, entry.GID, rdev, entryTime.Unix(), entryTime.Nanosecond()); err != nil { return err } var payload string if entry.Linkname != "" { if entry.Type == minimal.TypeSymlink { payload = entry.Linkname } else { payload = storagePath.CleanAbsPath(entry.Linkname) } } else if entry.Digest != "" { d, err := digest.Parse(entry.Digest) if err != nil { return fmt.Errorf("invalid digest %q for %q: %w", entry.Digest, entry.Name, err) } path, err := storagePath.RegularFilePathForValidatedDigest(d) if err != nil { return fmt.Errorf("determining physical file path for %q: %w", entry.Name, err) } payload = path } if _, err := fmt.Fprint(out, escapedOptional([]byte(payload), ESCAPE_LONE_DASH)); err != nil { return err } /* inline content. */ if _, err := fmt.Fprint(out, " -"); err != nil { return err } /* store the digest. */ if _, err := fmt.Fprint(out, " "); err != nil { return err } digest := verityDigests[payload] if _, err := fmt.Fprint(out, escapedOptional([]byte(digest), ESCAPE_LONE_DASH)); err != nil { return err } for k, vEncoded := range entry.Xattrs { v, err := base64.StdEncoding.DecodeString(vEncoded) if err != nil { return fmt.Errorf("decode xattr %q: %w", k, err) } name := escaped([]byte(k), ESCAPE_EQUAL) value := escaped(v, ESCAPE_EQUAL) if _, err := fmt.Fprintf(out, " %s=%s", name, value); err != nil { return err } } if _, err := fmt.Fprint(out, "\n"); err != nil { return err } return nil } // GenerateDump generates a dump of the TOC in the same format as `composefs-info dump` func GenerateDump(tocI any, verityDigests map[string]string) (io.Reader, error) { toc, ok := tocI.(*minimal.TOC) if !ok { return nil, fmt.Errorf("invalid TOC type") } pipeR, pipeW := io.Pipe() go func() { closed := false w := bufio.NewWriter(pipeW) defer func() { if !closed { w.Flush() pipeW.Close() } }() links := make(map[string]int) added := make(map[string]*minimal.FileMetadata) for _, e := range toc.Entries { if e.Linkname == "" { continue } if e.Type == minimal.TypeSymlink { continue } links[e.Linkname] = links[e.Linkname] + 1 } if len(toc.Entries) == 0 { root := &minimal.FileMetadata{ Name: "/", Type: minimal.TypeDir, Mode: 0o755, } if err := dumpNode(w, added, links, verityDigests, root); err != nil { pipeW.CloseWithError(err) closed = true return } } for _, e := range toc.Entries { if e.Type == minimal.TypeChunk { continue } if err := dumpNode(w, added, links, verityDigests, &e); err != nil { pipeW.CloseWithError(err) closed = true return } } }() return pipeR, nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/chunked/filesystem_linux.go ================================================ package chunked import ( "encoding/base64" "errors" "fmt" "io" "io/fs" "os" "path/filepath" "strings" "sync/atomic" "syscall" "time" securejoin "github.com/cyphar/filepath-securejoin" "github.com/vbatts/tar-split/archive/tar" driversCopy "go.podman.io/storage/drivers/copy" "go.podman.io/storage/pkg/archive" "go.podman.io/storage/pkg/chunked/internal/minimal" storagePath "go.podman.io/storage/pkg/chunked/internal/path" "golang.org/x/sys/unix" ) // procPathForFile returns an absolute path in /proc which // refers to the file; see procPathForFd. func procPathForFile(f *os.File) string { return procPathForFd(int(f.Fd())) } // procPathForFd returns an absolute path in /proc which // refers to the file; this allows passing a file descriptor // in places that don't accept a file descriptor. func procPathForFd(fd int) string { return fmt.Sprintf("/proc/self/fd/%d", fd) } // fileMetadata is a wrapper around minimal.FileMetadata with additional private fields that // are not part of the TOC document. // Type: TypeChunk entries are stored in Chunks, the primary [fileMetadata] entries never use TypeChunk. type fileMetadata struct { minimal.FileMetadata // chunks stores the TypeChunk entries relevant to this entry when FileMetadata.Type == TypeReg. chunks []*minimal.FileMetadata // skipSetAttrs is set when the file attributes must not be // modified, e.g. it is a hard link from a different source, // or a composefs file. skipSetAttrs bool } // splitPath takes a file path as input and returns two components: dir and base. // Differently than filepath.Split(), this function handles some edge cases. // If the path refers to a file in the root directory, the returned dir is "/". // The returned base value is never empty, it never contains any slash and the // value "..". func splitPath(path string) (string, string, error) { path = storagePath.CleanAbsPath(path) dir, base := filepath.Split(path) if base == "" { base = "." } // Remove trailing slashes from dir, but make sure that "/" is preserved. dir = strings.TrimSuffix(dir, "/") if dir == "" { dir = "/" } if strings.Contains(base, "/") { // This should never happen, but be safe as the base is passed to *at syscalls. return "", "", fmt.Errorf("internal error: splitPath(%q) contains a slash", path) } return dir, base, nil } func doHardLink(dirfd, srcFd int, destFile string) error { destDir, destBase, err := splitPath(destFile) if err != nil { return err } destDirFd := dirfd if destDir != "/" { f, err := openOrCreateDirUnderRoot(dirfd, destDir, 0) if err != nil { return err } defer f.Close() destDirFd = int(f.Fd()) } doLink := func() error { // Using unix.AT_EMPTY_PATH requires CAP_DAC_READ_SEARCH while this variant that uses // /proc/self/fd doesn't and can be used with rootless. srcPath := procPathForFd(srcFd) err := unix.Linkat(unix.AT_FDCWD, srcPath, destDirFd, destBase, unix.AT_SYMLINK_FOLLOW) if err != nil { return &fs.PathError{Op: "linkat", Path: destFile, Err: err} } return nil } err = doLink() // if the destination exists, unlink it first and try again if err != nil && os.IsExist(err) { if err := unix.Unlinkat(destDirFd, destBase, 0); err != nil { return err } return doLink() } return err } func copyFileContent(srcFd int, fileMetadata *fileMetadata, dirfd int, mode os.FileMode, useHardLinks bool) (*os.File, int64, error) { destFile := fileMetadata.Name src := procPathForFd(srcFd) st, err := os.Stat(src) if err != nil { return nil, -1, fmt.Errorf("copy file content for %q: %w", destFile, err) } copyWithFileRange, copyWithFileClone := true, true if useHardLinks { err := doHardLink(dirfd, srcFd, destFile) if err == nil { // if the file was deduplicated with a hard link, skip overriding file metadata. fileMetadata.skipSetAttrs = true return nil, st.Size(), nil } } // If the destination file already exists, we shouldn't blow it away dstFile, err := openFileUnderRoot(dirfd, destFile, newFileFlags, mode) if err != nil { return nil, -1, fmt.Errorf("open file %q under rootfs for copy: %w", destFile, err) } err = driversCopy.CopyRegularToFile(src, dstFile, st, ©WithFileRange, ©WithFileClone) if err != nil { dstFile.Close() return nil, -1, fmt.Errorf("copy to file %q under rootfs: %w", destFile, err) } return dstFile, st.Size(), nil } func timeToTimespec(time *time.Time) (ts unix.Timespec) { if time == nil || time.IsZero() { // Return UTIME_OMIT special value ts.Sec = 0 ts.Nsec = ((1 << 30) - 2) return ts } return unix.NsecToTimespec(time.UnixNano()) } // chown changes the owner and group of the file at the specified path under the directory // pointed by dirfd. // If nofollow is true, the function will not follow symlinks. // If path is empty, the function will change the owner and group of the file descriptor. // absolutePath is the absolute path of the file, used only for error messages. func chown(dirfd int, path string, uid, gid int, nofollow bool, absolutePath string) error { var err error flags := 0 if nofollow { flags |= unix.AT_SYMLINK_NOFOLLOW } else if path == "" { flags |= unix.AT_EMPTY_PATH } err = unix.Fchownat(dirfd, path, uid, gid, flags) if err == nil { return nil } if errors.Is(err, syscall.EINVAL) { return fmt.Errorf(`potentially insufficient UIDs or GIDs available in the user namespace (requested %d:%d for %s): Check /etc/subuid and /etc/subgid if configured locally and run "podman system migrate": %w`, uid, gid, path, err) } return &fs.PathError{Op: "fchownat", Path: absolutePath, Err: err} } // setFileAttrs sets the file attributes for file given metadata func setFileAttrs(dirfd int, file *os.File, mode os.FileMode, metadata *fileMetadata, options *archive.TarOptions, usePath bool) error { if metadata.skipSetAttrs { return nil } if file == nil { return errors.New("invalid file") } fd := int(file.Fd()) t, err := typeToTarType(metadata.Type) if err != nil { return err } // If it is a symlink, force to use the path if t == tar.TypeSymlink { usePath = true } baseName := "" if usePath { dirName := filepath.Dir(metadata.Name) if dirName != "" { parentFd, err := openFileUnderRoot(dirfd, dirName, unix.O_PATH|unix.O_DIRECTORY|unix.O_CLOEXEC, 0) if err != nil { return err } defer parentFd.Close() dirfd = int(parentFd.Fd()) } baseName = filepath.Base(metadata.Name) } doChown := func() error { var err error if usePath { err = chown(dirfd, baseName, metadata.UID, metadata.GID, true, metadata.Name) } else { err = chown(fd, "", metadata.UID, metadata.GID, false, metadata.Name) } if options.IgnoreChownErrors { return nil } return err } doSetXattr := func(k string, v []byte) error { err := unix.Fsetxattr(fd, k, v, 0) if err != nil { return &fs.PathError{Op: "fsetxattr", Path: metadata.Name, Err: err} } return nil } doUtimes := func() error { ts := []unix.Timespec{timeToTimespec(metadata.AccessTime), timeToTimespec(metadata.ModTime)} var err error if usePath { err = unix.UtimesNanoAt(dirfd, baseName, ts, unix.AT_SYMLINK_NOFOLLOW) } else { err = unix.UtimesNanoAt(unix.AT_FDCWD, procPathForFd(fd), ts, 0) } if err != nil { return &fs.PathError{Op: "utimensat", Path: metadata.Name, Err: err} } return nil } doChmod := func() error { var err error op := "" if usePath { err = unix.Fchmodat(dirfd, baseName, uint32(mode), unix.AT_SYMLINK_NOFOLLOW) op = "fchmodat" } else { err = unix.Fchmod(fd, uint32(mode)) op = "fchmod" } if err != nil { return &fs.PathError{Op: op, Path: metadata.Name, Err: err} } return nil } if err := doChown(); err != nil { return err } canIgnore := func(err error) bool { return err == nil || errors.Is(err, unix.ENOSYS) || errors.Is(err, unix.ENOTSUP) } for k, v := range metadata.Xattrs { if _, found := xattrsToIgnore[k]; found { continue } data, err := base64.StdEncoding.DecodeString(v) if err != nil { return fmt.Errorf("decode xattr %q: %w", v, err) } if err := doSetXattr(k, data); !canIgnore(err) { return fmt.Errorf("set xattr %s=%q for %q: %w", k, data, metadata.Name, err) } } if err := doUtimes(); !canIgnore(err) { return err } if err := doChmod(); !canIgnore(err) { return err } return nil } func openFileUnderRootFallback(dirfd int, name string, flags uint64, mode os.FileMode) (int, error) { root := procPathForFd(dirfd) targetRoot, err := os.Readlink(root) if err != nil { return -1, err } hasNoFollow := (flags & unix.O_NOFOLLOW) != 0 var fd int // If O_NOFOLLOW is specified in the flags, then resolve only the parent directory and use the // last component as the path to openat(). if hasNoFollow { dirName, baseName, err := splitPath(name) if err != nil { return -1, err } if dirName != "/" { newRoot, err := securejoin.SecureJoin(root, dirName) if err != nil { return -1, err } root = newRoot } parentDirfd, err := unix.Open(root, unix.O_PATH|unix.O_CLOEXEC, 0) if err != nil { return -1, &fs.PathError{Op: "open", Path: root, Err: err} } defer unix.Close(parentDirfd) fd, err = unix.Openat(parentDirfd, baseName, int(flags), uint32(mode)) if err != nil { return -1, &fs.PathError{Op: "openat", Path: name, Err: err} } } else { newPath, err := securejoin.SecureJoin(root, name) if err != nil { return -1, err } fd, err = unix.Openat(dirfd, newPath, int(flags), uint32(mode)) if err != nil { return -1, &fs.PathError{Op: "openat", Path: newPath, Err: err} } } target, err := os.Readlink(procPathForFd(fd)) if err != nil { unix.Close(fd) return -1, err } // Add an additional check to make sure the opened fd is inside the rootfs if !strings.HasPrefix(target, targetRoot) { unix.Close(fd) return -1, fmt.Errorf("while resolving %q. It resolves outside the root directory", name) } return fd, err } func openFileUnderRootOpenat2(dirfd int, name string, flags uint64, mode os.FileMode) (int, error) { how := unix.OpenHow{ Flags: flags, Mode: uint64(mode & 0o7777), Resolve: unix.RESOLVE_IN_ROOT, } fd, err := unix.Openat2(dirfd, name, &how) if err != nil { return -1, &fs.PathError{Op: "openat2", Path: name, Err: err} } return fd, nil } // skipOpenat2 is set when openat2 is not supported by the underlying kernel and avoid // using it again. var skipOpenat2 int32 // openFileUnderRootRaw tries to open a file using openat2 and if it is not supported fallbacks to a // userspace lookup. func openFileUnderRootRaw(dirfd int, name string, flags uint64, mode os.FileMode) (int, error) { var fd int var err error if name == "" { fd, err := unix.Dup(dirfd) if err != nil { return -1, fmt.Errorf("failed to duplicate file descriptor %d: %w", dirfd, err) } return fd, nil } if atomic.LoadInt32(&skipOpenat2) > 0 { fd, err = openFileUnderRootFallback(dirfd, name, flags, mode) } else { fd, err = openFileUnderRootOpenat2(dirfd, name, flags, mode) // If the function failed with ENOSYS, switch off the support for openat2 // and fallback to using safejoin. if err != nil && errors.Is(err, unix.ENOSYS) { atomic.StoreInt32(&skipOpenat2, 1) fd, err = openFileUnderRootFallback(dirfd, name, flags, mode) } } return fd, err } // openFileUnderRoot safely opens a file under the specified root directory using openat2 // dirfd is an open file descriptor to the target checkout directory. // name is the path to open relative to dirfd. // flags are the flags to pass to the open syscall. // mode specifies the mode to use for newly created files. func openFileUnderRoot(dirfd int, name string, flags uint64, mode os.FileMode) (*os.File, error) { fd, err := openFileUnderRootRaw(dirfd, name, flags, mode) if err == nil { return os.NewFile(uintptr(fd), name), nil } hasCreate := (flags & unix.O_CREAT) != 0 if errors.Is(err, unix.ENOENT) && hasCreate { parent := filepath.Dir(name) if parent != "" { newDirfd, err2 := openOrCreateDirUnderRoot(dirfd, parent, 0) if err2 == nil { defer newDirfd.Close() fd, err := openFileUnderRootRaw(int(newDirfd.Fd()), filepath.Base(name), flags, mode) if err == nil { return os.NewFile(uintptr(fd), name), nil } } } } return nil, fmt.Errorf("open %q under the rootfs: %w", name, err) } // openOrCreateDirUnderRoot safely opens a directory or create it if it is missing. // dirfd is an open file descriptor to the target checkout directory. // name is the path to open relative to dirfd. // mode specifies the mode to use for newly created files. func openOrCreateDirUnderRoot(dirfd int, name string, mode os.FileMode) (*os.File, error) { fd, err := openFileUnderRootRaw(dirfd, name, unix.O_DIRECTORY|unix.O_RDONLY|unix.O_CLOEXEC, 0) if err == nil { return os.NewFile(uintptr(fd), name), nil } if errors.Is(err, unix.ENOENT) { parent := filepath.Dir(name) // do not create the root directory, it should always exist if parent != name { pDir, err2 := openOrCreateDirUnderRoot(dirfd, parent, mode) if err2 != nil { return nil, err } defer pDir.Close() baseName := filepath.Base(name) if err2 := unix.Mkdirat(int(pDir.Fd()), baseName, uint32(mode)); err2 != nil { return nil, &fs.PathError{Op: "mkdirat", Path: name, Err: err2} } fd, err = openFileUnderRootRaw(int(pDir.Fd()), baseName, unix.O_DIRECTORY|unix.O_RDONLY|unix.O_CLOEXEC, 0) if err == nil { return os.NewFile(uintptr(fd), name), nil } } } return nil, err } // appendHole creates a hole with the specified size at the open fd. // fd is the open file descriptor. // name is the path to use for error messages. // size is the size of the hole to create. func appendHole(fd int, name string, size int64) error { off, err := unix.Seek(fd, size, unix.SEEK_CUR) if err != nil { return &fs.PathError{Op: "seek", Path: name, Err: err} } // Make sure the file size is changed. It might be the last hole and no other data written afterwards. if err := unix.Ftruncate(fd, off); err != nil { return &fs.PathError{Op: "ftruncate", Path: name, Err: err} } return nil } func safeMkdir(dirfd int, mode os.FileMode, name string, metadata *fileMetadata, options *archive.TarOptions) error { parent, base, err := splitPath(name) if err != nil { return err } parentFd := dirfd if parent != "/" { parentFile, err := openOrCreateDirUnderRoot(dirfd, parent, 0) if err != nil { return err } defer parentFile.Close() parentFd = int(parentFile.Fd()) } if err := unix.Mkdirat(parentFd, base, uint32(mode)); err != nil { if !os.IsExist(err) { return &fs.PathError{Op: "mkdirat", Path: name, Err: err} } } file, err := openFileUnderRoot(parentFd, base, unix.O_DIRECTORY|unix.O_RDONLY|unix.O_CLOEXEC, 0) if err != nil { return err } defer file.Close() return setFileAttrs(dirfd, file, mode, metadata, options, false) } func safeLink(dirfd int, mode os.FileMode, metadata *fileMetadata, options *archive.TarOptions) error { sourceFile, err := openFileUnderRoot(dirfd, metadata.Linkname, unix.O_PATH|unix.O_RDONLY|unix.O_NOFOLLOW|unix.O_CLOEXEC, 0) if err != nil { return err } defer sourceFile.Close() err = doHardLink(dirfd, int(sourceFile.Fd()), metadata.Name) if err != nil { return err } newFile, err := openFileUnderRoot(dirfd, metadata.Name, unix.O_WRONLY|unix.O_NOFOLLOW, 0) if err != nil { // If the target is a symlink, open the file with O_PATH. if errors.Is(err, unix.ELOOP) { newFile, err := openFileUnderRoot(dirfd, metadata.Name, unix.O_PATH|unix.O_NOFOLLOW, 0) if err != nil { return err } defer newFile.Close() return setFileAttrs(dirfd, newFile, mode, metadata, options, true) } return err } defer newFile.Close() return setFileAttrs(dirfd, newFile, mode, metadata, options, false) } func safeSymlink(dirfd int, metadata *fileMetadata) error { destDir, destBase, err := splitPath(metadata.Name) if err != nil { return err } destDirFd := dirfd if destDir != "/" { f, err := openOrCreateDirUnderRoot(dirfd, destDir, 0) if err != nil { return err } defer f.Close() destDirFd = int(f.Fd()) } if err := unix.Symlinkat(metadata.Linkname, destDirFd, destBase); err != nil { return &fs.PathError{Op: "symlinkat", Path: metadata.Name, Err: err} } return nil } type whiteoutHandler struct { Dirfd int Root string } func (d whiteoutHandler) Setxattr(path, name string, value []byte) error { file, err := openOrCreateDirUnderRoot(d.Dirfd, path, 0) if err != nil { return err } defer file.Close() if err := unix.Fsetxattr(int(file.Fd()), name, value, 0); err != nil { return &fs.PathError{Op: "fsetxattr", Path: path, Err: err} } return nil } func (d whiteoutHandler) Mknod(path string, mode uint32, dev int) error { dir, base, err := splitPath(path) if err != nil { return err } dirfd := d.Dirfd if dir != "/" { dir, err := openOrCreateDirUnderRoot(d.Dirfd, dir, 0) if err != nil { return err } defer dir.Close() dirfd = int(dir.Fd()) } if err := unix.Mknodat(dirfd, base, mode, dev); err != nil { return &fs.PathError{Op: "mknodat", Path: path, Err: err} } return nil } func (d whiteoutHandler) Chown(path string, uid, gid int) error { file, err := openFileUnderRoot(d.Dirfd, path, unix.O_PATH, 0) if err != nil { return err } defer file.Close() return chown(int(file.Fd()), "", uid, gid, false, path) } type readerAtCloser interface { io.ReaderAt io.Closer } // seekableFile is a struct that wraps an *os.File to provide an ImageSourceSeekable. type seekableFile struct { reader readerAtCloser } func (f *seekableFile) Close() error { return f.reader.Close() } func (f *seekableFile) GetBlobAt(chunks []ImageSourceChunk) (chan io.ReadCloser, chan error, error) { streams := make(chan io.ReadCloser) errs := make(chan error) go func() { for _, chunk := range chunks { streams <- io.NopCloser(io.NewSectionReader(f.reader, int64(chunk.Offset), int64(chunk.Length))) } close(streams) close(errs) }() return streams, errs, nil } func newSeekableFile(reader readerAtCloser) *seekableFile { return &seekableFile{reader: reader} } ================================================ FILE: vendor/go.podman.io/storage/pkg/chunked/internal/minimal/compression.go ================================================ package minimal // NOTE: This is used from github.com/containers/image by callers that // don't otherwise use containers/storage, so don't make this depend on any // larger software like the graph drivers. import ( "bytes" "encoding/base64" "encoding/binary" "fmt" "io" "strings" "time" jsoniter "github.com/json-iterator/go" "github.com/klauspost/compress/zstd" "github.com/opencontainers/go-digest" "github.com/vbatts/tar-split/archive/tar" "go.podman.io/storage/pkg/archive" ) // ZstdWriter is an interface that wraps standard io.WriteCloser and Reset() to reuse the compressor with a new writer. type ZstdWriter interface { io.WriteCloser Reset(dest io.Writer) } // CreateZstdWriterFunc is a function that creates a ZstdWriter for the provided destination writer. type CreateZstdWriterFunc func(dest io.Writer) (ZstdWriter, error) // TOC is short for Table of Contents and is used by the zstd:chunked // file format to effectively add an overall index into the contents // of a tarball; it also includes file metadata. type TOC struct { // Version is currently expected to be 1 Version int `json:"version"` // Entries is the list of file metadata in this TOC. // The ordering in this array currently defaults to being the same // as that of the tar stream; however, this should not be relied on. Entries []FileMetadata `json:"entries"` // TarSplitDigest is the checksum of the "tar-split" data which // is included as a distinct skippable zstd frame before the TOC. TarSplitDigest digest.Digest `json:"tarSplitDigest,omitempty"` } // FileMetadata is an entry in the TOC that includes both generic file metadata // that duplicates what can found in the tar header (and should match), but // also special/custom content (see below). // // Regular files may optionally be represented as a sequence of “chunks”, // which may be ChunkTypeData or ChunkTypeZeros (and ChunkTypeData boundaries // are heuristically determined to increase chance of chunk matching / reuse // similar to rsync). In that case, the regular file is represented // as an initial TypeReg entry (with all metadata for the file as a whole) // immediately followed by zero or more TypeChunk entries (containing only Type, // Name and Chunk* fields); if there is at least one TypeChunk entry, the Chunk* // fields are relevant in all of these entries, including the initial // TypeReg one. // // Note that the metadata here, when fetched by a zstd:chunked aware client, // is used instead of that in the tar stream. The contents of the tar stream // are not used in this scenario. type FileMetadata struct { // If you add any fields, update ensureFileMetadataMatches as well! // The metadata below largely duplicates that in the tar headers. Type string `json:"type"` Name string `json:"name"` Linkname string `json:"linkName,omitempty"` Mode int64 `json:"mode,omitempty"` Size int64 `json:"size,omitempty"` UID int `json:"uid,omitempty"` GID int `json:"gid,omitempty"` ModTime *time.Time `json:"modtime,omitempty"` AccessTime *time.Time `json:"accesstime,omitempty"` ChangeTime *time.Time `json:"changetime,omitempty"` Devmajor int64 `json:"devMajor,omitempty"` Devminor int64 `json:"devMinor,omitempty"` Xattrs map[string]string `json:"xattrs,omitempty"` // Digest is a hexadecimal sha256 checksum of the file contents; it // is empty for empty files Digest string `json:"digest,omitempty"` Offset int64 `json:"offset,omitempty"` EndOffset int64 `json:"endOffset,omitempty"` ChunkSize int64 `json:"chunkSize,omitempty"` ChunkOffset int64 `json:"chunkOffset,omitempty"` ChunkDigest string `json:"chunkDigest,omitempty"` ChunkType string `json:"chunkType,omitempty"` } const ( ChunkTypeData = "" ChunkTypeZeros = "zeros" ) const ( // The following types correspond to regular types of entries that can // appear in a tar archive. TypeReg = "reg" TypeLink = "hardlink" TypeChar = "char" TypeBlock = "block" TypeDir = "dir" TypeFifo = "fifo" TypeSymlink = "symlink" // TypeChunk is special; in zstd:chunked not only are files individually // compressed and indexable, there is a "rolling checksum" used to compute // "chunks" of individual file contents, that are also added to the TOC TypeChunk = "chunk" ) var TarTypes = map[byte]string{ tar.TypeReg: TypeReg, tar.TypeLink: TypeLink, tar.TypeChar: TypeChar, tar.TypeBlock: TypeBlock, tar.TypeDir: TypeDir, tar.TypeFifo: TypeFifo, tar.TypeSymlink: TypeSymlink, } func GetType(t byte) (string, error) { r, found := TarTypes[t] if !found { return "", fmt.Errorf("unknown tarball type: %v", t) } return r, nil } const ( // ManifestChecksumKey is a hexadecimal sha256 digest of the compressed manifest digest. ManifestChecksumKey = "io.github.containers.zstd-chunked.manifest-checksum" // ManifestInfoKey is an annotation that signals the start of the TOC (manifest) // contents which are embedded as a skippable zstd frame. It has a format of // four decimal integers separated by `:` as follows: // ::: // The is ManifestTypeCRFS which should have the value `1`. ManifestInfoKey = "io.github.containers.zstd-chunked.manifest-position" // TarSplitInfoKey is an annotation that signals the start of the "tar-split" metadata // contents which are embedded as a skippable zstd frame. It has a format of // three decimal integers separated by `:` as follows: // :: TarSplitInfoKey = "io.github.containers.zstd-chunked.tarsplit-position" // TarSplitChecksumKey is no longer used and is replaced by the TOC.TarSplitDigest field instead. // The value is retained here as a constant as a historical reference for older zstd:chunked images. // // Deprecated: This field should never be relied on - use the digest in the TOC instead. TarSplitChecksumKey = "io.github.containers.zstd-chunked.tarsplit-checksum" // ManifestTypeCRFS is a manifest file compatible with the CRFS TOC file. ManifestTypeCRFS = 1 // FooterSizeSupported is the footer size supported by this implementation. // Newer versions of the image format might increase this value, so reject // any version that is not supported. FooterSizeSupported = 64 ) var ( // when the zstd decoder encounters a skippable frame + 1 byte for the size, it // will ignore it. // https://tools.ietf.org/html/rfc8478#section-3.1.2 skippableFrameMagic = []byte{0x50, 0x2a, 0x4d, 0x18} ZstdChunkedFrameMagic = []byte{0x47, 0x4e, 0x55, 0x6c, 0x49, 0x6e, 0x55, 0x78} ) func appendZstdSkippableFrame(dest io.Writer, data []byte) error { if _, err := dest.Write(skippableFrameMagic); err != nil { return err } size := make([]byte, 4) binary.LittleEndian.PutUint32(size, uint32(len(data))) if _, err := dest.Write(size); err != nil { return err } if _, err := dest.Write(data); err != nil { return err } return nil } type TarSplitData struct { Data []byte Digest digest.Digest UncompressedSize int64 } func WriteZstdChunkedManifest(dest io.Writer, outMetadata map[string]string, offset uint64, tarSplitData *TarSplitData, metadata []FileMetadata, createZstdWriter CreateZstdWriterFunc) error { // 8 is the size of the zstd skippable frame header + the frame size const zstdSkippableFrameHeader = 8 manifestOffset := offset + zstdSkippableFrameHeader toc := TOC{ Version: 1, Entries: metadata, TarSplitDigest: tarSplitData.Digest, } json := jsoniter.ConfigCompatibleWithStandardLibrary // Generate the manifest manifest, err := json.Marshal(toc) if err != nil { return err } var compressedBuffer bytes.Buffer zstdWriter, err := createZstdWriter(&compressedBuffer) if err != nil { return err } if _, err := zstdWriter.Write(manifest); err != nil { zstdWriter.Close() return err } if err := zstdWriter.Close(); err != nil { return err } compressedManifest := compressedBuffer.Bytes() manifestDigester := digest.Canonical.Digester() manifestChecksum := manifestDigester.Hash() if _, err := manifestChecksum.Write(compressedManifest); err != nil { return err } outMetadata[ManifestChecksumKey] = manifestDigester.Digest().String() outMetadata[ManifestInfoKey] = fmt.Sprintf("%d:%d:%d:%d", manifestOffset, len(compressedManifest), len(manifest), ManifestTypeCRFS) if err := appendZstdSkippableFrame(dest, compressedManifest); err != nil { return err } tarSplitOffset := manifestOffset + uint64(len(compressedManifest)) + zstdSkippableFrameHeader outMetadata[TarSplitInfoKey] = fmt.Sprintf("%d:%d:%d", tarSplitOffset, len(tarSplitData.Data), tarSplitData.UncompressedSize) if err := appendZstdSkippableFrame(dest, tarSplitData.Data); err != nil { return err } footer := ZstdChunkedFooterData{ ManifestType: uint64(ManifestTypeCRFS), Offset: manifestOffset, LengthCompressed: uint64(len(compressedManifest)), LengthUncompressed: uint64(len(manifest)), OffsetTarSplit: tarSplitOffset, LengthCompressedTarSplit: uint64(len(tarSplitData.Data)), LengthUncompressedTarSplit: uint64(tarSplitData.UncompressedSize), } manifestDataLE := footerDataToBlob(footer) return appendZstdSkippableFrame(dest, manifestDataLE) } func ZstdWriterWithLevel(dest io.Writer, level int) (ZstdWriter, error) { el := zstd.EncoderLevelFromZstd(level) return zstd.NewWriter(dest, zstd.WithEncoderLevel(el)) } // ZstdChunkedFooterData contains all the data stored in the zstd:chunked footer. // This footer exists to make the blobs self-describing, our implementation // never reads it: // Partial pull security hinges on the TOC digest, and that exists as a layer annotation; // so we are relying on the layer annotations anyway, and doing so means we can avoid // a round-trip to fetch this binary footer. type ZstdChunkedFooterData struct { ManifestType uint64 Offset uint64 LengthCompressed uint64 LengthUncompressed uint64 OffsetTarSplit uint64 LengthCompressedTarSplit uint64 LengthUncompressedTarSplit uint64 ChecksumAnnotationTarSplit string // Deprecated: This field is not a part of the footer and not used for any purpose. } func footerDataToBlob(footer ZstdChunkedFooterData) []byte { // Store the offset to the manifest and its size in LE order manifestDataLE := make([]byte, FooterSizeSupported) binary.LittleEndian.PutUint64(manifestDataLE[8*0:], footer.Offset) binary.LittleEndian.PutUint64(manifestDataLE[8*1:], footer.LengthCompressed) binary.LittleEndian.PutUint64(manifestDataLE[8*2:], footer.LengthUncompressed) binary.LittleEndian.PutUint64(manifestDataLE[8*3:], footer.ManifestType) binary.LittleEndian.PutUint64(manifestDataLE[8*4:], footer.OffsetTarSplit) binary.LittleEndian.PutUint64(manifestDataLE[8*5:], footer.LengthCompressedTarSplit) binary.LittleEndian.PutUint64(manifestDataLE[8*6:], footer.LengthUncompressedTarSplit) copy(manifestDataLE[8*7:], ZstdChunkedFrameMagic) return manifestDataLE } // timeIfNotZero returns a pointer to the time.Time if it is not zero, otherwise it returns nil. func timeIfNotZero(t *time.Time) *time.Time { if t == nil || t.IsZero() { return nil } return t } // NewFileMetadata creates a basic FileMetadata entry for hdr. // The caller must set DigestOffset/EndOffset, and the Chunk* values, separately. func NewFileMetadata(hdr *tar.Header) (FileMetadata, error) { typ, err := GetType(hdr.Typeflag) if err != nil { return FileMetadata{}, err } xattrs := make(map[string]string) for k, v := range hdr.PAXRecords { xattrKey, ok := strings.CutPrefix(k, archive.PaxSchilyXattr) if !ok { continue } xattrs[xattrKey] = base64.StdEncoding.EncodeToString([]byte(v)) } return FileMetadata{ Type: typ, Name: hdr.Name, Linkname: hdr.Linkname, Mode: hdr.Mode, Size: hdr.Size, UID: hdr.Uid, GID: hdr.Gid, ModTime: timeIfNotZero(&hdr.ModTime), AccessTime: timeIfNotZero(&hdr.AccessTime), ChangeTime: timeIfNotZero(&hdr.ChangeTime), Devmajor: hdr.Devmajor, Devminor: hdr.Devminor, Xattrs: xattrs, }, nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/chunked/internal/path/path.go ================================================ package path import ( "fmt" "path/filepath" "github.com/opencontainers/go-digest" ) // CleanAbsPath removes any ".." and "." from the path // and ensures it starts with a "/". If the path refers to the root // directory, it returns "/". func CleanAbsPath(path string) string { return filepath.Clean("/" + path) } // RegularFilePath returns the path used in the composefs backing store for a // regular file with the provided content digest. // // The caller MUST ensure d is a valid digest (in particular, that it contains no path separators or .. entries) func RegularFilePathForValidatedDigest(d digest.Digest) (string, error) { if algo := d.Algorithm(); algo != digest.SHA256 { return "", fmt.Errorf("unexpected digest algorithm %q", algo) } e := d.Encoded() return e[0:2] + "/" + e[2:], nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/chunked/storage.go ================================================ package chunked import ( "io" ) // ImageSourceChunk is a portion of a blob. type ImageSourceChunk struct { Offset uint64 Length uint64 } // ImageSourceSeekable is an image source that permits to fetch chunks of the entire blob. type ImageSourceSeekable interface { // GetBlobAt returns a stream for the specified blob. GetBlobAt([]ImageSourceChunk) (chan io.ReadCloser, chan error, error) } // ErrBadRequest is returned when the request is not valid type ErrBadRequest struct { //nolint: errname } func (e ErrBadRequest) Error() string { return "bad request" } // ErrFallbackToOrdinaryLayerDownload is a custom error type that // suggests to the caller that a fallback mechanism can be used // instead of a hard failure. type ErrFallbackToOrdinaryLayerDownload struct { Err error } func (c ErrFallbackToOrdinaryLayerDownload) Error() string { return c.Err.Error() } func (c ErrFallbackToOrdinaryLayerDownload) Unwrap() error { return c.Err } func newErrFallbackToOrdinaryLayerDownload(err error) error { return ErrFallbackToOrdinaryLayerDownload{Err: err} } ================================================ FILE: vendor/go.podman.io/storage/pkg/chunked/storage_linux.go ================================================ package chunked import ( archivetar "archive/tar" "cmp" "context" "encoding/base64" "errors" "fmt" "hash" "io" "io/fs" "maps" "os" "path/filepath" "reflect" "slices" "strings" "sync" "syscall" "github.com/containerd/stargz-snapshotter/estargz" "github.com/cyphar/filepath-securejoin/pathrs-lite" jsoniter "github.com/json-iterator/go" "github.com/klauspost/compress/zstd" "github.com/klauspost/pgzip" digest "github.com/opencontainers/go-digest" "github.com/sirupsen/logrus" "github.com/vbatts/tar-split/archive/tar" "github.com/vbatts/tar-split/tar/asm" tsStorage "github.com/vbatts/tar-split/tar/storage" storage "go.podman.io/storage" graphdriver "go.podman.io/storage/drivers" "go.podman.io/storage/pkg/archive" "go.podman.io/storage/pkg/chunked/compressor" "go.podman.io/storage/pkg/chunked/internal/minimal" path "go.podman.io/storage/pkg/chunked/internal/path" "go.podman.io/storage/pkg/chunked/toc" "go.podman.io/storage/pkg/fsverity" "go.podman.io/storage/pkg/idtools" "go.podman.io/storage/pkg/system" "golang.org/x/sys/unix" ) const ( maxNumberMissingChunks = 1024 autoMergePartsThreshold = 1024 // if the gap between two ranges is below this threshold, automatically merge them. newFileFlags = (unix.O_CREAT | unix.O_TRUNC | unix.O_EXCL | unix.O_WRONLY) bigDataKey = "zstd-chunked-manifest" chunkedData = "zstd-chunked-data" chunkedLayerDataKey = "zstd-chunked-layer-data" tocKey = "toc" fsVerityDigestsKey = "fs-verity-digests" fileTypeZstdChunked = iota fileTypeEstargz fileTypeNoCompression fileTypeHole copyGoRoutines = 32 ) type compressedFileType int type chunkedDiffer struct { // Initial parameters, used throughout and never modified // ========== pullOptions pullOptions stream ImageSourceSeekable // blobDigest is the digest of the whole compressed layer. It is used if // convertToZstdChunked to validate a layer when it is converted since there // is no TOC referenced by the manifest. blobDigest digest.Digest blobSize int64 // Input format // ========== fileType compressedFileType // convertedToZstdChunked is set to true if the layer needs to // be converted to the zstd:chunked format before it can be // handled. convertToZstdChunked bool // Chunked metadata // This is usually set in NewDiffer, but if convertToZstdChunked, it is only computed in chunkedDiffer.ApplyDiff // ========== // tocDigest is the digest of the TOC document when the layer // is partially pulled, or "" if not relevant to consumers. tocDigest digest.Digest tocOffset int64 manifest []byte toc *minimal.TOC // The parsed contents of manifest, or nil if not yet available tarSplit *os.File uncompressedTarSize int64 // -1 if unknown // skipValidation is set to true if the individual files in // the layer are trusted and should not be validated. skipValidation bool // Long-term caches // This is set in NewDiffer, when the caller must not hold any storage locks, and later consumed in .ApplyDiff() // ========== layersCache *layersCache copyBuffer []byte fsVerityMutex sync.Mutex // protects fsVerityDigests fsVerityDigests map[string]string // Private state of .ApplyDiff // ========== gzipReader *pgzip.Reader zstdReader *zstd.Decoder rawReader io.Reader useFsVerity graphdriver.DifferFsVerity used bool // the differ object was already used and cannot be used again for .ApplyDiff } var xattrsToIgnore = map[string]any{ "security.selinux": true, } // chunkedLayerData is used to store additional information about the layer type chunkedLayerData struct { Format graphdriver.DifferOutputFormat `json:"format"` } // pullOptions contains parsed data from storage.Store.PullOptions. // TO DO: ideally this should be parsed along with the rest of the config file into StoreOptions directly // (and then storage.Store.PullOptions would need to be somehow simulated). type pullOptions struct { enablePartialImages bool // enable_partial_images convertImages bool // convert_images useHardLinks bool // use_hard_links insecureAllowUnpredictableImageContents bool // insecure_allow_unpredictable_image_contents ostreeRepos []string // ostree_repos } func parsePullOptions(store storage.Store) pullOptions { options := store.PullOptions() res := pullOptions{} for _, e := range []struct { dest *bool name string defaultValue bool }{ {&res.enablePartialImages, "enable_partial_images", false}, {&res.convertImages, "convert_images", false}, {&res.useHardLinks, "use_hard_links", false}, {&res.insecureAllowUnpredictableImageContents, "insecure_allow_unpredictable_image_contents", false}, } { if value, ok := options[e.name]; ok { *e.dest = strings.ToLower(value) == "true" } else { *e.dest = e.defaultValue } } res.ostreeRepos = strings.Split(options["ostree_repos"], ":") return res } func (c *chunkedDiffer) convertTarToZstdChunked(destDirectory string, payload *os.File) (int64, *seekableFile, digest.Digest, map[string]string, error) { diff, err := archive.DecompressStream(payload) if err != nil { return 0, nil, "", nil, err } defer diff.Close() f, err := openTmpFile(destDirectory) if err != nil { return 0, nil, "", nil, err } newAnnotations := make(map[string]string) chunked, err := compressor.NoCompression(f, newAnnotations) if err != nil { f.Close() return 0, nil, "", nil, err } convertedOutputDigester := digest.Canonical.Digester() copied, err := io.CopyBuffer(io.MultiWriter(chunked, convertedOutputDigester.Hash()), diff, c.copyBuffer) if err != nil { f.Close() return 0, nil, "", nil, err } if err := chunked.Close(); err != nil { f.Close() return 0, nil, "", nil, err } return copied, newSeekableFile(f), convertedOutputDigester.Digest(), newAnnotations, nil } func (c *chunkedDiffer) Close() error { if c.tarSplit != nil { err := c.tarSplit.Close() c.tarSplit = nil return err } return nil } // NewDiffer returns a differ than can be used with [Store.PrepareStagedLayer]. // If it returns an error that matches ErrFallbackToOrdinaryLayerDownload, the caller can // retry the operation with a different method. // The caller must call Close() on the returned Differ. func NewDiffer(ctx context.Context, store storage.Store, blobDigest digest.Digest, blobSize int64, annotations map[string]string, iss ImageSourceSeekable) (graphdriver.Differ, error) { pullOptions := parsePullOptions(store) if !pullOptions.enablePartialImages { // If pullOptions.convertImages is set, the two options disagree whether fallback is permissible. // Right now, we enable it, but that’s not a promise; rather, such a configuration should ideally be rejected. return nil, newErrFallbackToOrdinaryLayerDownload(errors.New("partial images are disabled")) } // pullOptions.convertImages also serves as a “must not fallback to non-partial pull” option (?!) graphDriver, err := store.GraphDriver() if err != nil { return nil, err } if _, partialSupported := graphDriver.(graphdriver.DriverWithDiffer); !partialSupported { if pullOptions.convertImages { return nil, fmt.Errorf("graph driver %s does not support partial pull but convert_images requires that", graphDriver.String()) } return nil, newErrFallbackToOrdinaryLayerDownload(fmt.Errorf("graph driver %s does not support partial pull", graphDriver.String())) } differ, err := getProperDiffer(store, blobDigest, blobSize, annotations, iss, pullOptions) if err != nil { var fallbackErr ErrFallbackToOrdinaryLayerDownload if !errors.As(err, &fallbackErr) { return nil, err } // If convert_images is enabled, always attempt to convert it instead of returning an error or falling back to a different method. if !pullOptions.convertImages { return nil, err } var canConvertErr errFallbackCanConvert if !errors.As(err, &canConvertErr) { // We are supposed to use makeConvertFromRawDiffer, but that would not work. // Fail, and make sure the error does _not_ match ErrFallbackToOrdinaryLayerDownload: use only the error text, // discard all type information. return nil, fmt.Errorf("neither a partial pull nor convert_images is possible: %s", err.Error()) } logrus.Debugf("Created differ to convert blob %q", blobDigest) return makeConvertFromRawDiffer(store, blobDigest, blobSize, iss, pullOptions) } return differ, nil } // errFallbackCanConvert is an an error type _accompanying_ ErrFallbackToOrdinaryLayerDownload // within getProperDiffer, to mark that using makeConvertFromRawDiffer makes sense. // This is used to distinguish between cases where the environment does not support partial pulls // (e.g. a registry does not support range requests) and convert_images is still possible, // from cases where the image content is unacceptable for partial pulls (e.g. exceeds memory limits) // and convert_images would not help. type errFallbackCanConvert struct { err error } func (e errFallbackCanConvert) Error() string { return e.err.Error() } func (e errFallbackCanConvert) Unwrap() error { return e.err } // getProperDiffer is an implementation detail of NewDiffer. // It returns a “proper” differ (not a convert_images one) if possible. // May return an error matching ErrFallbackToOrdinaryLayerDownload if a fallback to an alternative // (either makeConvertFromRawDiffer, or a non-partial pull) is permissible. func getProperDiffer(store storage.Store, blobDigest digest.Digest, blobSize int64, annotations map[string]string, iss ImageSourceSeekable, pullOptions pullOptions) (graphdriver.Differ, error) { zstdChunkedTOCDigestString, hasZstdChunkedTOC := annotations[minimal.ManifestChecksumKey] estargzTOCDigestString, hasEstargzTOC := annotations[estargz.TOCJSONDigestAnnotation] switch { case hasZstdChunkedTOC && hasEstargzTOC: return nil, errors.New("both zstd:chunked and eStargz TOC found") case hasZstdChunkedTOC: zstdChunkedTOCDigest, err := digest.Parse(zstdChunkedTOCDigestString) if err != nil { return nil, err } differ, err := makeZstdChunkedDiffer(store, blobSize, zstdChunkedTOCDigest, annotations, iss, pullOptions) if err != nil { logrus.Debugf("Could not create zstd:chunked differ for blob %q: %v", blobDigest, err) return nil, err } logrus.Debugf("Created zstd:chunked differ for blob %q", blobDigest) return differ, nil case hasEstargzTOC: estargzTOCDigest, err := digest.Parse(estargzTOCDigestString) if err != nil { return nil, err } differ, err := makeEstargzChunkedDiffer(store, blobSize, estargzTOCDigest, iss, pullOptions) if err != nil { logrus.Debugf("Could not create estargz differ for blob %q: %v", blobDigest, err) return nil, err } logrus.Debugf("Created eStargz differ for blob %q", blobDigest) return differ, nil default: // no TOC message := "no TOC found" if !pullOptions.convertImages { message = "no TOC found and convert_images is not configured" } return nil, errFallbackCanConvert{ newErrFallbackToOrdinaryLayerDownload(errors.New(message)), } } } func makeConvertFromRawDiffer(store storage.Store, blobDigest digest.Digest, blobSize int64, iss ImageSourceSeekable, pullOptions pullOptions) (*chunkedDiffer, error) { layersCache, err := getLayersCache(store) if err != nil { return nil, err } return &chunkedDiffer{ pullOptions: pullOptions, stream: iss, blobDigest: blobDigest, blobSize: blobSize, convertToZstdChunked: true, uncompressedTarSize: -1, // Will be computed later layersCache: layersCache, copyBuffer: makeCopyBuffer(), fsVerityDigests: make(map[string]string), }, nil } // makeZstdChunkedDiffer sets up a chunkedDiffer for a zstd:chunked layer. // It may return an error matching ErrFallbackToOrdinaryLayerDownload / errFallbackCanConvert. func makeZstdChunkedDiffer(store storage.Store, blobSize int64, tocDigest digest.Digest, annotations map[string]string, iss ImageSourceSeekable, pullOptions pullOptions) (_ *chunkedDiffer, retErr error) { manifest, toc, tarSplit, tocOffset, err := readZstdChunkedManifest(store.RunRoot(), iss, tocDigest, annotations, true) if err != nil { // May be ErrFallbackToOrdinaryLayerDownload / errFallbackCanConvert return nil, fmt.Errorf("read zstd:chunked manifest: %w", err) } defer func() { if tarSplit != nil && retErr != nil { tarSplit.Close() } }() var uncompressedTarSize int64 = -1 if tarSplit != nil { if _, err := tarSplit.Seek(0, io.SeekStart); err != nil { return nil, err } uncompressedTarSize, err = tarSizeFromTarSplit(tarSplit) if err != nil { return nil, fmt.Errorf("computing size from tar-split: %w", err) } } else if !pullOptions.insecureAllowUnpredictableImageContents { // With no tar-split, we can't compute the traditional UncompressedDigest. return nil, errFallbackCanConvert{ newErrFallbackToOrdinaryLayerDownload(fmt.Errorf("zstd:chunked layers without tar-split data don't support partial pulls with guaranteed consistency with non-partial pulls")), } } layersCache, err := getLayersCache(store) if err != nil { return nil, err } return &chunkedDiffer{ pullOptions: pullOptions, stream: iss, blobSize: blobSize, fileType: fileTypeZstdChunked, tocDigest: tocDigest, tocOffset: tocOffset, manifest: manifest, toc: toc, tarSplit: tarSplit, uncompressedTarSize: uncompressedTarSize, layersCache: layersCache, copyBuffer: makeCopyBuffer(), fsVerityDigests: make(map[string]string), }, nil } // makeEstargzChunkedDiffer sets up a chunkedDiffer for an estargz layer. // It may return an error matching ErrFallbackToOrdinaryLayerDownload / errFallbackCanConvert. func makeEstargzChunkedDiffer(store storage.Store, blobSize int64, tocDigest digest.Digest, iss ImageSourceSeekable, pullOptions pullOptions) (*chunkedDiffer, error) { if !pullOptions.insecureAllowUnpredictableImageContents { // With no tar-split, we can't compute the traditional UncompressedDigest. return nil, errFallbackCanConvert{ newErrFallbackToOrdinaryLayerDownload(fmt.Errorf("estargz layers don't support partial pulls with guaranteed consistency with non-partial pulls")), } } manifest, tocOffset, err := readEstargzChunkedManifest(iss, blobSize, tocDigest) if err != nil { // May be ErrFallbackToOrdinaryLayerDownload / errFallbackCanConvert return nil, fmt.Errorf("read zstd:chunked manifest: %w", err) } layersCache, err := getLayersCache(store) if err != nil { return nil, err } return &chunkedDiffer{ pullOptions: pullOptions, stream: iss, blobSize: blobSize, fileType: fileTypeEstargz, tocDigest: tocDigest, tocOffset: tocOffset, manifest: manifest, uncompressedTarSize: -1, // We would have to read and decompress the whole layer layersCache: layersCache, copyBuffer: makeCopyBuffer(), fsVerityDigests: make(map[string]string), }, nil } func makeCopyBuffer() []byte { return make([]byte, 2<<20) } // copyFileFromOtherLayer copies a file from another layer // file is the file to look for. // source is the path to the source layer checkout. // name is the path to the file to copy in source. // dirfd is an open file descriptor to the destination root directory. // useHardLinks defines whether the deduplication can be performed using hard links. func copyFileFromOtherLayer(file *fileMetadata, source string, name string, dirfd int, useHardLinks bool) (bool, *os.File, int64, error) { srcDirfd, err := unix.Open(source, unix.O_RDONLY|unix.O_CLOEXEC, 0) if err != nil { return false, nil, 0, &fs.PathError{Op: "open", Path: source, Err: err} } defer unix.Close(srcDirfd) srcFile, err := openFileUnderRoot(srcDirfd, name, unix.O_RDONLY|syscall.O_CLOEXEC, 0) if err != nil { return false, nil, 0, err } defer srcFile.Close() dstFile, written, err := copyFileContent(int(srcFile.Fd()), file, dirfd, 0, useHardLinks) if err != nil { return false, nil, 0, fmt.Errorf("copy content to %q: %w", file.Name, err) } return true, dstFile, written, nil } // canDedupMetadataWithHardLink says whether it is possible to deduplicate file with otherFile. // It checks that the two files have the same UID, GID, file mode and xattrs. func canDedupMetadataWithHardLink(file *fileMetadata, otherFile *fileMetadata) bool { if file.UID != otherFile.UID { return false } if file.GID != otherFile.GID { return false } if file.Mode != otherFile.Mode { return false } if !reflect.DeepEqual(file.Xattrs, otherFile.Xattrs) { return false } return true } // canDedupFileWithHardLink checks if the specified file can be deduplicated by an // open file, given its descriptor and stat data. func canDedupFileWithHardLink(file *fileMetadata, fd int, s os.FileInfo) bool { st, ok := s.Sys().(*syscall.Stat_t) if !ok { return false } path := procPathForFd(fd) listXattrs, err := system.Llistxattr(path) if err != nil { return false } xattrs := make(map[string]string) for _, x := range listXattrs { v, err := system.Lgetxattr(path, x) if err != nil { return false } if _, found := xattrsToIgnore[x]; found { continue } xattrs[x] = string(v) } // fill only the attributes used by canDedupMetadataWithHardLink. otherFile := fileMetadata{ FileMetadata: minimal.FileMetadata{ UID: int(st.Uid), GID: int(st.Gid), Mode: int64(st.Mode), Xattrs: xattrs, }, } return canDedupMetadataWithHardLink(file, &otherFile) } // findFileInOSTreeRepos checks whether the requested file already exist in one of the OSTree repo and copies the file content from there if possible. // file is the file to look for. // ostreeRepos is a list of OSTree repos. // dirfd is an open fd to the destination checkout. // useHardLinks defines whether the deduplication can be performed using hard links. func findFileInOSTreeRepos(file *fileMetadata, ostreeRepos []string, dirfd int, useHardLinks bool) (bool, *os.File, int64, error) { digest, err := digest.Parse(file.Digest) if err != nil { logrus.Debugf("could not parse digest: %v", err) return false, nil, 0, nil } payloadLink := digest.Encoded() + ".payload-link" if len(payloadLink) < 2 { return false, nil, 0, nil } for _, repo := range ostreeRepos { sourceFile := filepath.Join(repo, "objects", payloadLink[:2], payloadLink[2:]) st, err := os.Stat(sourceFile) if err != nil || !st.Mode().IsRegular() { continue } if st.Size() != file.Size { continue } fd, err := unix.Open(sourceFile, unix.O_RDONLY|unix.O_NONBLOCK|unix.O_CLOEXEC, 0) if err != nil { logrus.Debugf("could not open sourceFile %s: %v", sourceFile, err) return false, nil, 0, nil } f := os.NewFile(uintptr(fd), "fd") defer f.Close() // check if the open file can be deduplicated with hard links if useHardLinks && !canDedupFileWithHardLink(file, fd, st) { continue } dstFile, written, err := copyFileContent(fd, file, dirfd, 0, useHardLinks) if err != nil { logrus.Debugf("could not copyFileContent: %v", err) return false, nil, 0, nil } return true, dstFile, written, nil } // If hard links deduplication was used and it has failed, try again without hard links. if useHardLinks { return findFileInOSTreeRepos(file, ostreeRepos, dirfd, false) } return false, nil, 0, nil } // findFileInOtherLayers finds the specified file in other layers. // cache is the layers cache to use. // file is the file to look for. // dirfd is an open file descriptor to the checkout root directory. // useHardLinks defines whether the deduplication can be performed using hard links. func findFileInOtherLayers(cache *layersCache, file *fileMetadata, dirfd int, useHardLinks bool) (bool, *os.File, int64, error) { target, name, err := cache.findFileInOtherLayers(file, useHardLinks) if err != nil || name == "" { return false, nil, 0, err } return copyFileFromOtherLayer(file, target, name, dirfd, useHardLinks) } func maybeDoIDRemap(manifest []fileMetadata, options *archive.TarOptions) error { if options.ChownOpts == nil && len(options.UIDMaps) == 0 || len(options.GIDMaps) == 0 { return nil } idMappings := idtools.NewIDMappingsFromMaps(options.UIDMaps, options.GIDMaps) for i := range manifest { if options.ChownOpts != nil { manifest[i].UID = options.ChownOpts.UID manifest[i].GID = options.ChownOpts.GID } else { pair := idtools.IDPair{ UID: manifest[i].UID, GID: manifest[i].GID, } var err error manifest[i].UID, manifest[i].GID, err = idMappings.ToContainer(pair) if err != nil { return err } } } return nil } func mapToSlice(inputMap map[uint32]struct{}) []uint32 { return slices.Collect(maps.Keys(inputMap)) } func collectIDs(entries []fileMetadata) ([]uint32, []uint32) { uids := make(map[uint32]struct{}) gids := make(map[uint32]struct{}) for _, entry := range entries { uids[uint32(entry.UID)] = struct{}{} gids[uint32(entry.GID)] = struct{}{} } return mapToSlice(uids), mapToSlice(gids) } type originFile struct { Root string Path string Offset int64 } type missingFileChunk struct { Gap int64 Hole bool File *fileMetadata CompressedSize int64 UncompressedSize int64 } type missingPart struct { Hole bool SourceChunk *ImageSourceChunk OriginFile *originFile Chunks []missingFileChunk } func (o *originFile) OpenFile() (io.ReadCloser, error) { srcDirfd, err := unix.Open(o.Root, unix.O_RDONLY|unix.O_CLOEXEC, 0) if err != nil { return nil, &fs.PathError{Op: "open", Path: o.Root, Err: err} } defer unix.Close(srcDirfd) srcFile, err := openFileUnderRoot(srcDirfd, o.Path, unix.O_RDONLY|unix.O_CLOEXEC, 0) if err != nil { return nil, err } if _, err := srcFile.Seek(o.Offset, io.SeekStart); err != nil { srcFile.Close() return nil, err } return srcFile, nil } func (c *chunkedDiffer) prepareCompressedStreamToFile(partCompression compressedFileType, mf *missingFileChunk) (compressedFileType, error) { switch { case partCompression == fileTypeHole: // The entire part is a hole. Do not need to read from a file. return fileTypeHole, nil case mf.Hole: // Only the missing chunk in the requested part refers to a hole. // The received data must be discarded. _, err := io.CopyBuffer(io.Discard, c.rawReader, c.copyBuffer) return fileTypeHole, err case partCompression == fileTypeZstdChunked: if c.zstdReader == nil { r, err := zstd.NewReader(c.rawReader) if err != nil { return partCompression, err } c.zstdReader = r } else { if err := c.zstdReader.Reset(c.rawReader); err != nil { return partCompression, err } } case partCompression == fileTypeEstargz: if c.gzipReader == nil { r, err := pgzip.NewReader(c.rawReader) if err != nil { return partCompression, err } c.gzipReader = r } else { if err := c.gzipReader.Reset(c.rawReader); err != nil { return partCompression, err } } case partCompression == fileTypeNoCompression: return fileTypeNoCompression, nil default: return partCompression, fmt.Errorf("unknown file type %q", c.fileType) } return partCompression, nil } // hashHole writes SIZE zeros to the specified hasher func hashHole(h hash.Hash, size int64, copyBuffer []byte) error { count := min(size, int64(len(copyBuffer))) for i := int64(0); i < count; i++ { copyBuffer[i] = 0 } for size > 0 { count = min(size, int64(len(copyBuffer))) if _, err := h.Write(copyBuffer[:count]); err != nil { return err } size -= count } return nil } func (c *chunkedDiffer) appendCompressedStreamToFile(compression compressedFileType, destFile *destinationFile, size int64) error { switch compression { case fileTypeZstdChunked: defer func() { if err := c.zstdReader.Reset(nil); err != nil { logrus.Warnf("release of references to the previous zstd reader failed: %v", err) } }() if _, err := io.CopyBuffer(destFile.to, io.LimitReader(c.zstdReader, size), c.copyBuffer); err != nil { return err } case fileTypeEstargz: defer c.gzipReader.Close() if _, err := io.CopyBuffer(destFile.to, io.LimitReader(c.gzipReader, size), c.copyBuffer); err != nil { return err } case fileTypeNoCompression: if _, err := io.CopyBuffer(destFile.to, io.LimitReader(c.rawReader, size), c.copyBuffer); err != nil { return err } case fileTypeHole: if err := appendHole(int(destFile.file.Fd()), destFile.metadata.Name, size); err != nil { return err } if destFile.hash != nil { if err := hashHole(destFile.hash, size, c.copyBuffer); err != nil { return err } } default: return fmt.Errorf("unknown file type %q", c.fileType) } return nil } type recordFsVerityFunc func(string, *os.File) error type destinationFile struct { digester digest.Digester dirfd int file *os.File hash hash.Hash metadata *fileMetadata options *archive.TarOptions skipValidation bool to io.Writer recordFsVerity recordFsVerityFunc } func openDestinationFile(dirfd int, metadata *fileMetadata, options *archive.TarOptions, skipValidation bool, recordFsVerity recordFsVerityFunc) (*destinationFile, error) { file, err := openFileUnderRoot(dirfd, metadata.Name, newFileFlags, 0) if err != nil { return nil, err } var digester digest.Digester var hash hash.Hash var to io.Writer if skipValidation { to = file } else { digester = digest.Canonical.Digester() hash = digester.Hash() to = io.MultiWriter(file, hash) } return &destinationFile{ file: file, digester: digester, hash: hash, to: to, metadata: metadata, options: options, dirfd: dirfd, skipValidation: skipValidation, recordFsVerity: recordFsVerity, }, nil } func (d *destinationFile) Close() (Err error) { defer func() { var roFile *os.File var err error if d.recordFsVerity != nil { roFile, err = reopenFileReadOnly(d.file) if err == nil { defer roFile.Close() } else if Err == nil { Err = err } } err = d.file.Close() if Err == nil { Err = err } if Err == nil && roFile != nil { Err = d.recordFsVerity(d.metadata.Name, roFile) } }() if !d.skipValidation { manifestChecksum, err := digest.Parse(d.metadata.Digest) if err != nil { return err } if d.digester.Digest() != manifestChecksum { return fmt.Errorf("checksum mismatch for %q (got %q instead of %q)", d.file.Name(), d.digester.Digest(), manifestChecksum) } } mode := os.FileMode(d.metadata.Mode) if d.options.ForceMask != nil { mode = *d.options.ForceMask } return setFileAttrs(d.dirfd, d.file, mode, d.metadata, d.options, false) } func closeDestinationFiles(files chan *destinationFile, errors chan error) { for f := range files { errors <- f.Close() } close(errors) } func (c *chunkedDiffer) recordFsVerity(path string, roFile *os.File) error { if c.useFsVerity == graphdriver.DifferFsVerityDisabled { return nil } // fsverity.EnableVerity doesn't return an error if fs-verity was already // enabled on the file. err := fsverity.EnableVerity(path, int(roFile.Fd())) if err != nil { if c.useFsVerity == graphdriver.DifferFsVerityRequired { return err } // If it is not required, ignore the error if the filesystem does not support it. if errors.Is(err, unix.ENOTSUP) || errors.Is(err, unix.ENOTTY) { return nil } } verity, err := fsverity.MeasureVerity(path, int(roFile.Fd())) if err != nil { return err } c.fsVerityMutex.Lock() c.fsVerityDigests[path] = verity c.fsVerityMutex.Unlock() return nil } func (c *chunkedDiffer) storeMissingFiles(streams chan io.ReadCloser, errs chan error, dirfd int, missingParts []missingPart, options *archive.TarOptions) (Err error) { var destFile *destinationFile filesToClose := make(chan *destinationFile, 3) closeFilesErrors := make(chan error, 2) go closeDestinationFiles(filesToClose, closeFilesErrors) defer func() { close(filesToClose) for e := range closeFilesErrors { if e != nil && Err == nil { Err = e } } }() for _, missingPart := range missingParts { var part io.ReadCloser partCompression := c.fileType readingFromLocalFile := false switch { case missingPart.Hole: partCompression = fileTypeHole case missingPart.OriginFile != nil: var err error part, err = missingPart.OriginFile.OpenFile() if err != nil { return err } partCompression = fileTypeNoCompression readingFromLocalFile = true case missingPart.SourceChunk != nil: select { case p := <-streams: part = p case err := <-errs: if err == nil { return errors.New("not enough data returned from the server") } return err } if part == nil { return errors.New("invalid stream returned") } default: return errors.New("internal error: missing part misses both local and remote data stream") } for _, mf := range missingPart.Chunks { if mf.Gap > 0 { limitReader := io.LimitReader(part, mf.Gap) _, err := io.CopyBuffer(io.Discard, limitReader, c.copyBuffer) if err != nil { Err = err goto exit } continue } if mf.File.Name == "" { Err = errors.New("file name empty") goto exit } c.rawReader = nil if part != nil { limit := mf.CompressedSize // If we are reading from a source file, use the uncompressed size to limit the reader, because // the compressed size refers to the original layer stream. if readingFromLocalFile { limit = mf.UncompressedSize } c.rawReader = io.LimitReader(part, limit) } compression, err := c.prepareCompressedStreamToFile(partCompression, &mf) if err != nil { Err = err goto exit } // Open the new file if it is different that what is already // opened if destFile == nil || destFile.metadata.Name != mf.File.Name { var err error if destFile != nil { cleanup: for { select { case err = <-closeFilesErrors: if err != nil { Err = err goto exit } default: break cleanup } } filesToClose <- destFile } recordFsVerity := c.recordFsVerity if c.useFsVerity == graphdriver.DifferFsVerityDisabled { recordFsVerity = nil } destFile, err = openDestinationFile(dirfd, mf.File, options, c.skipValidation, recordFsVerity) if err != nil { Err = err goto exit } } if err := c.appendCompressedStreamToFile(compression, destFile, mf.UncompressedSize); err != nil { Err = err goto exit } if c.rawReader != nil { if _, err := io.CopyBuffer(io.Discard, c.rawReader, c.copyBuffer); err != nil { Err = err goto exit } } } exit: if part != nil { part.Close() if Err != nil { break } } } if destFile != nil { return destFile.Close() } return nil } func mergeMissingChunks(missingParts []missingPart, target int) []missingPart { getGap := func(missingParts []missingPart, i int) uint64 { prev := missingParts[i-1].SourceChunk.Offset + missingParts[i-1].SourceChunk.Length return missingParts[i].SourceChunk.Offset - prev } // simple case: merge chunks from the same file. Useful to reduce the number of parts to work with later. newMissingParts := missingParts[0:1] prevIndex := 0 for i := 1; i < len(missingParts); i++ { gap := getGap(missingParts, i) if gap == 0 && missingParts[prevIndex].OriginFile == nil && missingParts[i].OriginFile == nil && !missingParts[prevIndex].Hole && !missingParts[i].Hole && len(missingParts[prevIndex].Chunks) == 1 && len(missingParts[i].Chunks) == 1 && missingParts[prevIndex].Chunks[0].File.Name == missingParts[i].Chunks[0].File.Name { missingParts[prevIndex].SourceChunk.Length += gap + missingParts[i].SourceChunk.Length missingParts[prevIndex].Chunks[0].CompressedSize += missingParts[i].Chunks[0].CompressedSize missingParts[prevIndex].Chunks[0].UncompressedSize += missingParts[i].Chunks[0].UncompressedSize } else { newMissingParts = append(newMissingParts, missingParts[i]) prevIndex++ } } missingParts = newMissingParts type gap struct { from int to int cost uint64 } var requestGaps []gap lastOffset := int(-1) numberSourceChunks := 0 for i, c := range missingParts { if c.OriginFile != nil || c.Hole { // it does not require a network request continue } numberSourceChunks++ if lastOffset >= 0 { prevEnd := missingParts[lastOffset].SourceChunk.Offset + missingParts[lastOffset].SourceChunk.Length cost := c.SourceChunk.Offset - prevEnd g := gap{ from: lastOffset, to: i, cost: cost, } requestGaps = append(requestGaps, g) } lastOffset = i } slices.SortFunc(requestGaps, func(a, b gap) int { return cmp.Compare(a.cost, b.cost) }) toMergeMap := make([]bool, len(missingParts)) remainingToMerge := numberSourceChunks - target for _, g := range requestGaps { if remainingToMerge < 0 && g.cost > autoMergePartsThreshold { continue } for i := g.from + 1; i <= g.to; i++ { toMergeMap[i] = true } remainingToMerge-- } newMissingParts = missingParts[0:1] for i := 1; i < len(missingParts); i++ { if !toMergeMap[i] { newMissingParts = append(newMissingParts, missingParts[i]) } else { gap := getGap(missingParts, i) prev := &newMissingParts[len(newMissingParts)-1] prev.SourceChunk.Length += gap + missingParts[i].SourceChunk.Length prev.Hole = false prev.OriginFile = nil if gap > 0 { gapFile := missingFileChunk{ Gap: int64(gap), } prev.Chunks = append(prev.Chunks, gapFile) } prev.Chunks = append(prev.Chunks, missingParts[i].Chunks...) } } return newMissingParts } func (c *chunkedDiffer) retrieveMissingFiles(stream ImageSourceSeekable, dirfd int, missingParts []missingPart, options *archive.TarOptions) error { var chunksToRequest []ImageSourceChunk calculateChunksToRequest := func() { chunksToRequest = []ImageSourceChunk{} for _, c := range missingParts { if c.OriginFile == nil && !c.Hole { chunksToRequest = append(chunksToRequest, *c.SourceChunk) } } } missingParts = mergeMissingChunks(missingParts, maxNumberMissingChunks) calculateChunksToRequest() // There are some missing files. Prepare a multirange request for the missing chunks. var streams chan io.ReadCloser var err error var errs chan error for { streams, errs, err = stream.GetBlobAt(chunksToRequest) if err == nil { break } if _, ok := err.(ErrBadRequest); ok { if len(chunksToRequest) == 1 { return err } // Merge more chunks to request missingParts = mergeMissingChunks(missingParts, len(chunksToRequest)/2) calculateChunksToRequest() continue } return err } if err := c.storeMissingFiles(streams, errs, dirfd, missingParts, options); err != nil { return err } return nil } type hardLinkToCreate struct { dest string dirfd int mode os.FileMode metadata *fileMetadata } type findAndCopyFileOptions struct { useHardLinks bool ostreeRepos []string options *archive.TarOptions } func reopenFileReadOnly(f *os.File) (*os.File, error) { path := procPathForFile(f) fd, err := unix.Open(path, unix.O_RDONLY|unix.O_CLOEXEC, 0) if err != nil { return nil, &fs.PathError{Op: "open", Path: path, Err: err} } return os.NewFile(uintptr(fd), f.Name()), nil } func (c *chunkedDiffer) findAndCopyFile(dirfd int, r *fileMetadata, copyOptions *findAndCopyFileOptions, mode os.FileMode) (bool, error) { finalizeFile := func(dstFile *os.File) error { if dstFile == nil { return nil } err := setFileAttrs(dirfd, dstFile, mode, r, copyOptions.options, false) if err != nil { dstFile.Close() return err } var roFile *os.File if c.useFsVerity != graphdriver.DifferFsVerityDisabled { roFile, err = reopenFileReadOnly(dstFile) } dstFile.Close() if err != nil { return err } if roFile == nil { return nil } defer roFile.Close() return c.recordFsVerity(r.Name, roFile) } found, dstFile, _, err := findFileInOtherLayers(c.layersCache, r, dirfd, copyOptions.useHardLinks) if err != nil { return false, err } if found { if err := finalizeFile(dstFile); err != nil { return false, err } return true, nil } found, dstFile, _, err = findFileInOSTreeRepos(r, copyOptions.ostreeRepos, dirfd, copyOptions.useHardLinks) if err != nil { return false, err } if found { if err := finalizeFile(dstFile); err != nil { return false, err } return true, nil } return false, nil } // makeEntriesFlat collects regular-file entries from mergedEntries, and produces a new list // where each file content is only represented once, and uses composefs.RegularFilePathForValidatedDigest for its name. // If flatPathNameMap is not nil, this function writes to it a mapping from filepath.Clean(originalName) to the composefs name. func makeEntriesFlat(mergedEntries []fileMetadata, flatPathNameMap map[string]string) ([]fileMetadata, error) { var new []fileMetadata knownFlatPaths := make(map[string]struct{}) for i := range mergedEntries { if mergedEntries[i].Type != TypeReg { continue } if mergedEntries[i].Digest == "" { return nil, fmt.Errorf("missing digest for %q", mergedEntries[i].Name) } digest, err := digest.Parse(mergedEntries[i].Digest) if err != nil { return nil, fmt.Errorf("invalid digest %q for %q: %w", mergedEntries[i].Digest, mergedEntries[i].Name, err) } path, err := path.RegularFilePathForValidatedDigest(digest) if err != nil { return nil, fmt.Errorf("determining physical file path for %q: %w", mergedEntries[i].Name, err) } if flatPathNameMap != nil { flatPathNameMap[filepath.Clean(mergedEntries[i].Name)] = path } if _, known := knownFlatPaths[path]; known { continue } knownFlatPaths[path] = struct{}{} mergedEntries[i].Name = path mergedEntries[i].skipSetAttrs = true new = append(new, mergedEntries[i]) } return new, nil } type streamOrErr struct { stream io.ReadCloser err error } // ensureAllBlobsDone ensures that all blobs are closed and returns the first error encountered. func ensureAllBlobsDone(streamsOrErrors chan streamOrErr) (retErr error) { for soe := range streamsOrErrors { if soe.stream != nil { _ = soe.stream.Close() } else if retErr == nil { retErr = soe.err } } return retErr } // getBlobAtConverterGoroutine reads from the streams and errs channels, then sends // either a stream or an error to the stream channel. The streams channel is closed when // there are no more streams and errors to read. // It ensures that no more than maxStreams streams are returned, and that every item from the // streams and errs channels is consumed. func getBlobAtConverterGoroutine(stream chan streamOrErr, streams chan io.ReadCloser, errs chan error, maxStreams int) { tooManyStreams := false streamsSoFar := 0 err := errors.New("unexpected error in getBlobAtGoroutine") defer func() { if err != nil { stream <- streamOrErr{err: err} } close(stream) }() loop: for { select { case p, ok := <-streams: if !ok { streams = nil break loop } if streamsSoFar >= maxStreams { tooManyStreams = true _ = p.Close() continue } streamsSoFar++ stream <- streamOrErr{stream: p} case err, ok := <-errs: if !ok { errs = nil break loop } stream <- streamOrErr{err: err} } } if streams != nil { for p := range streams { if streamsSoFar >= maxStreams { tooManyStreams = true _ = p.Close() continue } streamsSoFar++ stream <- streamOrErr{stream: p} } } if errs != nil { for err := range errs { stream <- streamOrErr{err: err} } } if tooManyStreams { stream <- streamOrErr{err: fmt.Errorf("too many streams returned, got more than %d", maxStreams)} } err = nil } // getBlobAt provides a much more convenient way to consume data returned by ImageSourceSeekable.GetBlobAt. // GetBlobAt returns two channels, forcing a caller to `select` on both of them — and in Go, reading a closed channel // always succeeds in select. // Instead, getBlobAt provides a single channel with all events, which can be consumed conveniently using `range`. func getBlobAt(is ImageSourceSeekable, chunksToRequest ...ImageSourceChunk) (chan streamOrErr, error) { streams, errs, err := is.GetBlobAt(chunksToRequest) if err != nil { return nil, err } stream := make(chan streamOrErr) go getBlobAtConverterGoroutine(stream, streams, errs, len(chunksToRequest)) return stream, nil } func (c *chunkedDiffer) copyAllBlobToFile(destination *os.File) (digest.Digest, error) { streamsOrErrors, err := getBlobAt(c.stream, ImageSourceChunk{Offset: 0, Length: uint64(c.blobSize)}) if err != nil { return "", err } originalRawDigester := digest.Canonical.Digester() for soe := range streamsOrErrors { if soe.stream != nil { r := io.TeeReader(soe.stream, originalRawDigester.Hash()) // copy the entire tarball and compute its digest _, err = io.CopyBuffer(destination, r, c.copyBuffer) _ = soe.stream.Close() } if soe.err != nil && err == nil { err = soe.err } } return originalRawDigester.Digest(), err } func typeToOsMode(typ string) (os.FileMode, error) { switch typ { case TypeReg, TypeLink: return 0, nil case TypeSymlink: return os.ModeSymlink, nil case TypeDir: return os.ModeDir, nil case TypeChar: return os.ModeDevice | os.ModeCharDevice, nil case TypeBlock: return os.ModeDevice, nil case TypeFifo: return os.ModeNamedPipe, nil } return 0, fmt.Errorf("unknown file type %q", typ) } func (c *chunkedDiffer) ApplyDiff(dest string, options *archive.TarOptions, differOpts *graphdriver.DifferOptions) (graphdriver.DriverWithDifferOutput, error) { if c.used { return graphdriver.DriverWithDifferOutput{}, fmt.Errorf("internal error: chunked differ already used") } c.used = true defer c.layersCache.release() defer func() { if c.zstdReader != nil { c.zstdReader.Close() } }() c.useFsVerity = differOpts.UseFsVerity // stream to use for reading the zstd:chunked or Estargz file. stream := c.stream var compressedDigest digest.Digest var uncompressedDigest digest.Digest if c.convertToZstdChunked { fd, err := unix.Open(dest, unix.O_TMPFILE|unix.O_RDWR|unix.O_CLOEXEC, 0o600) if err != nil { return graphdriver.DriverWithDifferOutput{}, &fs.PathError{Op: "open", Path: dest, Err: err} } blobFile := os.NewFile(uintptr(fd), "blob-file") defer func() { if blobFile != nil { blobFile.Close() } }() // calculate the checksum before accessing the file. compressedDigest, err = c.copyAllBlobToFile(blobFile) if err != nil { return graphdriver.DriverWithDifferOutput{}, err } if compressedDigest != c.blobDigest { return graphdriver.DriverWithDifferOutput{}, fmt.Errorf("invalid digest to convert: expected %q, got %q", c.blobDigest, compressedDigest) } if _, err := blobFile.Seek(0, io.SeekStart); err != nil { return graphdriver.DriverWithDifferOutput{}, err } tarSize, fileSource, diffID, annotations, err := c.convertTarToZstdChunked(dest, blobFile) if err != nil { return graphdriver.DriverWithDifferOutput{}, err } c.uncompressedTarSize = tarSize // fileSource is a O_TMPFILE file descriptor, so we // need to keep it open until the entire file is processed. defer fileSource.Close() // Close the file so that the file descriptor is released and the file is deleted. blobFile.Close() blobFile = nil tocDigest, err := toc.GetTOCDigest(annotations) if err != nil { return graphdriver.DriverWithDifferOutput{}, fmt.Errorf("internal error: parsing just-created zstd:chunked TOC digest: %w", err) } if tocDigest == nil { return graphdriver.DriverWithDifferOutput{}, fmt.Errorf("internal error: just-created zstd:chunked missing TOC digest") } manifest, toc, tarSplit, tocOffset, err := readZstdChunkedManifest(dest, fileSource, *tocDigest, annotations, false) if err != nil { return graphdriver.DriverWithDifferOutput{}, fmt.Errorf("read zstd:chunked manifest: %w", err) } // Use the new file for accessing the zstd:chunked file. stream = fileSource // fill the chunkedDiffer with the data we just read. c.fileType = fileTypeNoCompression c.manifest = manifest c.toc = toc c.tarSplit = tarSplit c.tocOffset = tocOffset // the file was generated by us and the digest for each file was already computed, no need to validate it again. c.skipValidation = true // since we retrieved the whole file and it was validated, set the uncompressed digest. uncompressedDigest = diffID } lcd := chunkedLayerData{ Format: differOpts.Format, } json := jsoniter.ConfigCompatibleWithStandardLibrary lcdBigData, err := json.Marshal(lcd) if err != nil { return graphdriver.DriverWithDifferOutput{}, err } // Generate the manifest toc := c.toc if toc == nil { toc_, err := unmarshalToc(c.manifest) if err != nil { return graphdriver.DriverWithDifferOutput{}, err } toc = toc_ } output := graphdriver.DriverWithDifferOutput{ Differ: c, TarSplit: c.tarSplit, BigData: map[string][]byte{ bigDataKey: c.manifest, chunkedLayerDataKey: lcdBigData, }, Artifacts: map[string]any{ tocKey: toc, }, TOCDigest: c.tocDigest, UncompressedDigest: uncompressedDigest, CompressedDigest: compressedDigest, Size: c.uncompressedTarSize, } whiteoutConverter := archive.GetWhiteoutConverter(options.WhiteoutFormat, options.WhiteoutData) var missingParts []missingPart mergedEntries, err := c.mergeTocEntries(c.fileType, toc.Entries) if err != nil { return output, err } output.UIDs, output.GIDs = collectIDs(mergedEntries) if err := maybeDoIDRemap(mergedEntries, options); err != nil { return output, err } if options.ForceMask != nil { uid, gid, mode, err := archive.GetFileOwner(dest) if err == nil { value := idtools.Stat{ IDs: idtools.IDPair{UID: int(uid), GID: int(gid)}, Mode: os.ModeDir | os.FileMode(mode), } if err := idtools.SetContainersOverrideXattr(dest, value); err != nil { return output, err } } } dirfd, err := unix.Open(dest, unix.O_RDONLY|unix.O_PATH|unix.O_CLOEXEC, 0) if err != nil { return output, &fs.PathError{Op: "open", Path: dest, Err: err} } dirFile := os.NewFile(uintptr(dirfd), dest) defer dirFile.Close() var flatPathNameMap map[string]string // = nil if differOpts != nil && differOpts.Format == graphdriver.DifferOutputFormatFlat { flatPathNameMap = map[string]string{} mergedEntries, err = makeEntriesFlat(mergedEntries, flatPathNameMap) if err != nil { return output, err } createdDirs := make(map[string]struct{}) for _, e := range mergedEntries { // This hard-codes an assumption that RegularFilePathForValidatedDigest creates paths with exactly one directory component. d := filepath.Dir(e.Name) if _, found := createdDirs[d]; !found { if err := unix.Mkdirat(dirfd, d, 0o755); err != nil { return output, &fs.PathError{Op: "mkdirat", Path: d, Err: err} } createdDirs[d] = struct{}{} } } } // hardlinks can point to missing files. So create them after all files // are retrieved var hardLinks []hardLinkToCreate missingPartsSize, totalChunksSize := int64(0), int64(0) copyOptions := findAndCopyFileOptions{ // When the hard links deduplication is used, file attributes are ignored because setting them // modifies the source file as well. useHardLinks: c.pullOptions.useHardLinks, ostreeRepos: c.pullOptions.ostreeRepos, // List of OSTree repositories to use for deduplication options: options, } type copyFileJob struct { njob int index int mode os.FileMode metadata *fileMetadata found bool err error } var wg sync.WaitGroup copyResults := make([]copyFileJob, len(mergedEntries)) copyFileJobs := make(chan copyFileJob) defer func() { if copyFileJobs != nil { close(copyFileJobs) } wg.Wait() }() for range copyGoRoutines { jobs := copyFileJobs wg.Go(func() { for job := range jobs { found, err := c.findAndCopyFile(dirfd, job.metadata, ©Options, job.mode) job.err = err job.found = found copyResults[job.njob] = job } }) } filesToWaitFor := 0 for i := range mergedEntries { r := &mergedEntries[i] mode := os.FileMode(r.Mode) t, err := typeToTarType(r.Type) if err != nil { return output, err } size := r.Size // update also the implementation of ForceMask in pkg/archive if options.ForceMask != nil { mode = *options.ForceMask // special files will be stored as regular files if t != tar.TypeDir && t != tar.TypeSymlink && t != tar.TypeReg && t != tar.TypeLink { t = tar.TypeReg size = 0 } // if the entry will be stored as a directory or a regular file, store in a xattr the original // owner and mode. if t == tar.TypeDir || t == tar.TypeReg { typeMode, err := typeToOsMode(r.Type) if err != nil { return output, err } value := idtools.FormatContainersOverrideXattrDevice(r.UID, r.GID, typeMode|fs.FileMode(r.Mode), int(r.Devmajor), int(r.Devminor)) if r.Xattrs == nil { r.Xattrs = make(map[string]string) } r.Xattrs[idtools.ContainersOverrideXattr] = base64.StdEncoding.EncodeToString([]byte(value)) } } r.Name = path.CleanAbsPath(r.Name) // do not modify the value of symlinks if r.Linkname != "" && t != tar.TypeSymlink { r.Linkname = path.CleanAbsPath(r.Linkname) } if whiteoutConverter != nil { hdr := archivetar.Header{ Typeflag: t, Name: r.Name, Linkname: r.Linkname, Size: size, Mode: int64(mode), Uid: r.UID, Gid: r.GID, } handler := whiteoutHandler{ Dirfd: dirfd, Root: dest, } writeFile, err := whiteoutConverter.ConvertReadWithHandler(&hdr, r.Name, &handler) if err != nil { return output, err } if !writeFile { continue } } switch t { case tar.TypeReg: // Create directly empty files. if size == 0 { // Used to have a scope for cleanup. createEmptyFile := func() error { file, err := openFileUnderRoot(dirfd, r.Name, newFileFlags, 0) if err != nil { return err } defer file.Close() if err := setFileAttrs(dirfd, file, mode, r, options, false); err != nil { return err } return nil } if err := createEmptyFile(); err != nil { return output, err } continue } case tar.TypeDir: if r.Name == "/" { output.RootDirMode = &mode } if err := safeMkdir(dirfd, mode, r.Name, r, options); err != nil { return output, err } continue case tar.TypeLink: dest := dest dirfd := dirfd mode := mode r := r hardLinks = append(hardLinks, hardLinkToCreate{ dest: dest, dirfd: dirfd, mode: mode, metadata: r, }) continue case tar.TypeSymlink: if err := safeSymlink(dirfd, r); err != nil { return output, err } continue case tar.TypeChar: case tar.TypeBlock: case tar.TypeFifo: /* Ignore. */ default: return output, fmt.Errorf("invalid type %q", t) } totalChunksSize += size if t == tar.TypeReg { index := i njob := filesToWaitFor job := copyFileJob{ mode: mode, metadata: &mergedEntries[index], index: index, njob: njob, } copyFileJobs <- job filesToWaitFor++ } } close(copyFileJobs) copyFileJobs = nil wg.Wait() for _, res := range copyResults[:filesToWaitFor] { r := &mergedEntries[res.index] if res.err != nil { return output, res.err } // the file was already copied to its destination // so nothing left to do. if res.found { continue } missingPartsSize += r.Size remainingSize := r.Size // the file is missing, attempt to find individual chunks. for _, chunk := range r.chunks { compressedSize := chunk.EndOffset - chunk.Offset size := remainingSize if chunk.ChunkSize > 0 { size = chunk.ChunkSize } remainingSize = remainingSize - size rawChunk := ImageSourceChunk{ Offset: uint64(chunk.Offset), Length: uint64(compressedSize), } file := missingFileChunk{ File: &mergedEntries[res.index], CompressedSize: compressedSize, UncompressedSize: size, } mp := missingPart{ SourceChunk: &rawChunk, Chunks: []missingFileChunk{ file, }, } switch chunk.ChunkType { case minimal.ChunkTypeData: root, path, offset, err := c.layersCache.findChunkInOtherLayers(chunk) if err != nil { return output, err } if offset >= 0 && validateChunkChecksum(chunk, root, path, offset, c.copyBuffer) { missingPartsSize -= size mp.OriginFile = &originFile{ Root: root, Path: path, Offset: offset, } } case minimal.ChunkTypeZeros: missingPartsSize -= size mp.Hole = true // Mark all chunks belonging to the missing part as holes for i := range mp.Chunks { mp.Chunks[i].Hole = true } } missingParts = append(missingParts, mp) } } // There are some missing files. Prepare a multirange request for the missing chunks. if len(missingParts) > 0 { if err := c.retrieveMissingFiles(stream, dirfd, missingParts, options); err != nil { return output, err } } for _, m := range hardLinks { if err := safeLink(m.dirfd, m.mode, m.metadata, options); err != nil { return output, err } } // To ensure that consumers of the layer who decompress and read the full tar stream, // and consumers who consume the data via the TOC, both see exactly the same data and metadata, // compute the UncompressedDigest. // c/image will then ensure that this value matches the value in the image config’s RootFS.DiffID, i.e. the image must commit // to one UncompressedDigest value for each layer, and that will avoid the ambiguity (in consumers who validate layers against DiffID). // // c/image also uses the UncompressedDigest as a layer ID, allowing it to use the traditional layer and image IDs. // // This is, sadly, quite costly: Up to now we might have only have had to write, and digest, only the new/modified files. // Here we need to read, and digest, the whole layer, even if almost all of it was already present locally previously. // So, really specialized (EXTREMELY RARE) users can opt out of this check using insecureAllowUnpredictableImageContents . // // Layers without a tar-split (estargz layers and old zstd:chunked layers) can't produce an UncompressedDigest that // matches the expected RootFS.DiffID; we always fall back to full pulls, again unless the user opts out // via insecureAllowUnpredictableImageContents . if output.UncompressedDigest == "" { switch { case c.pullOptions.insecureAllowUnpredictableImageContents: // Oh well. Skip the costly digest computation. case output.TarSplit != nil: if _, err := output.TarSplit.Seek(0, io.SeekStart); err != nil { return output, err } metadata := tsStorage.NewJSONUnpacker(output.TarSplit) fg := newStagedFileGetter(dirFile, flatPathNameMap) digester := digest.Canonical.Digester() if err := asm.WriteOutputTarStream(fg, metadata, digester.Hash()); err != nil { return output, fmt.Errorf("digesting staged uncompressed stream: %w", err) } output.UncompressedDigest = digester.Digest() default: // We are checking for this earlier in NewDiffer, so this should not be reachable. return output, fmt.Errorf(`internal error: layer's UncompressedDigest is unknown and "insecure_allow_unpredictable_image_contents" is not set`) } } if totalChunksSize > 0 { logrus.Debugf("Missing %d bytes out of %d (%.2f %%)", missingPartsSize, totalChunksSize, float32(missingPartsSize*100.0)/float32(totalChunksSize)) } output.Artifacts[fsVerityDigestsKey] = c.fsVerityDigests // on success steal the reference to the tarSplit file c.tarSplit = nil return output, nil } func mustSkipFile(fileType compressedFileType, e minimal.FileMetadata) bool { // ignore the metadata files for the estargz format. if fileType != fileTypeEstargz { return false } switch e.Name { // ignore the metadata files for the estargz format. case estargz.PrefetchLandmark, estargz.NoPrefetchLandmark, estargz.TOCTarName: return true } return false } func (c *chunkedDiffer) mergeTocEntries(fileType compressedFileType, entries []minimal.FileMetadata) ([]fileMetadata, error) { countNextChunks := func(start int) int { count := 0 for _, e := range entries[start:] { if e.Type != TypeChunk { return count } count++ } return count } size := 0 for _, entry := range entries { if mustSkipFile(fileType, entry) { continue } if entry.Type != TypeChunk { size++ } } mergedEntries := make([]fileMetadata, size) m := 0 for i := 0; i < len(entries); i++ { e := fileMetadata{FileMetadata: entries[i]} if mustSkipFile(fileType, entries[i]) { continue } if e.Type == TypeChunk { return nil, fmt.Errorf("chunk type without a regular file") } if e.Type == TypeReg { nChunks := countNextChunks(i + 1) e.chunks = make([]*minimal.FileMetadata, nChunks+1) for j := 0; j <= nChunks; j++ { // we need a copy here, otherwise we override the // .Size later copy := entries[i+j] e.chunks[j] = © e.EndOffset = entries[i+j].EndOffset } i += nChunks } mergedEntries[m] = e m++ } // stargz/estargz doesn't store EndOffset so let's calculate it here lastOffset := c.tocOffset for i := len(mergedEntries) - 1; i >= 0; i-- { if mergedEntries[i].EndOffset == 0 { mergedEntries[i].EndOffset = lastOffset } if mergedEntries[i].Offset != 0 { lastOffset = mergedEntries[i].Offset } lastChunkOffset := mergedEntries[i].EndOffset for j := len(mergedEntries[i].chunks) - 1; j >= 0; j-- { mergedEntries[i].chunks[j].EndOffset = lastChunkOffset mergedEntries[i].chunks[j].Size = mergedEntries[i].chunks[j].EndOffset - mergedEntries[i].chunks[j].Offset lastChunkOffset = mergedEntries[i].chunks[j].Offset } } return mergedEntries, nil } // validateChunkChecksum checks if the file at $root/$path[offset:chunk.ChunkSize] has the // same digest as chunk.ChunkDigest func validateChunkChecksum(chunk *minimal.FileMetadata, root, path string, offset int64, copyBuffer []byte) bool { parentDirfd, err := unix.Open(root, unix.O_PATH|unix.O_CLOEXEC, 0) if err != nil { return false } defer unix.Close(parentDirfd) fd, err := openFileUnderRoot(parentDirfd, path, unix.O_RDONLY|unix.O_CLOEXEC, 0) if err != nil { return false } defer fd.Close() if _, err := fd.Seek(offset, io.SeekStart); err != nil { return false } r := io.LimitReader(fd, chunk.ChunkSize) digester := digest.Canonical.Digester() if _, err := io.CopyBuffer(digester.Hash(), r, copyBuffer); err != nil { return false } digest, err := digest.Parse(chunk.ChunkDigest) if err != nil { return false } return digester.Digest() == digest } // newStagedFileGetter returns an object usable as storage.FileGetter for rootDir. // if flatPathNameMap is not nil, it must be used to map logical file names into the backing file paths. func newStagedFileGetter(rootDir *os.File, flatPathNameMap map[string]string) *stagedFileGetter { return &stagedFileGetter{ rootDir: rootDir, flatPathNameMap: flatPathNameMap, } } type stagedFileGetter struct { rootDir *os.File flatPathNameMap map[string]string // nil, or a map from filepath.Clean()ed tar file names to expected on-filesystem names } func (fg *stagedFileGetter) Get(filename string) (io.ReadCloser, error) { if fg.flatPathNameMap != nil { path, ok := fg.flatPathNameMap[filepath.Clean(filename)] if !ok { return nil, fmt.Errorf("no path mapping exists for tar entry %q", filename) } filename = path } pathFD, err := pathrs.OpenatInRoot(fg.rootDir, filename) if err != nil { return nil, err } defer pathFD.Close() return pathrs.Reopen(pathFD, unix.O_RDONLY) } ================================================ FILE: vendor/go.podman.io/storage/pkg/chunked/storage_unsupported.go ================================================ //go:build !linux package chunked import ( "context" "errors" digest "github.com/opencontainers/go-digest" storage "go.podman.io/storage" graphdriver "go.podman.io/storage/drivers" ) // NewDiffer returns a differ than can be used with [Store.PrepareStagedLayer]. // The caller must call Close() on the returned Differ. func NewDiffer(ctx context.Context, store storage.Store, blobDigest digest.Digest, blobSize int64, annotations map[string]string, iss ImageSourceSeekable) (graphdriver.Differ, error) { return nil, newErrFallbackToOrdinaryLayerDownload(errors.New("format not supported on this system")) } ================================================ FILE: vendor/go.podman.io/storage/pkg/chunked/toc/toc.go ================================================ package toc import ( "errors" digest "github.com/opencontainers/go-digest" "go.podman.io/storage/pkg/chunked/internal/minimal" ) // ChunkedAnnotations contains various annotations that might be set or used by the pkg/chunked-supported // compression formats. // // This set does not define their semantics in detail as a public API. // The _only_ intended use of this set is: code that _changes_ layer compression to a format // which is not chunked can/should remove these annotations. var ChunkedAnnotations = map[string]struct{}{ minimal.ManifestChecksumKey: {}, minimal.ManifestInfoKey: {}, minimal.TarSplitInfoKey: {}, minimal.TarSplitChecksumKey: {}, //nolint:staticcheck // The field is deprecated, so removing it when changing compressionn is all the more desirable. tocJSONDigestAnnotation: {}, } // tocJSONDigestAnnotation is the annotation key for the digest of the estargz // TOC JSON. // It is defined in github.com/containerd/stargz-snapshotter/estargz as TOCJSONDigestAnnotation // Duplicate it here to avoid a dependency on the package. const tocJSONDigestAnnotation = "containerd.io/snapshot/stargz/toc.digest" // GetTOCDigest returns the digest of the TOC as recorded in the annotations. // This function retrieves a digest that represents the content of a // table of contents (TOC) from the image's annotations. // This is an experimental feature and may be changed/removed in the future. func GetTOCDigest(annotations map[string]string) (*digest.Digest, error) { d1, ok1 := annotations[tocJSONDigestAnnotation] d2, ok2 := annotations[minimal.ManifestChecksumKey] switch { case ok1 && ok2: return nil, errors.New("both zstd:chunked and eStargz TOC found") case ok1: d, err := digest.Parse(d1) if err != nil { return nil, err } return &d, nil case ok2: d, err := digest.Parse(d2) if err != nil { return nil, err } return &d, nil default: return nil, nil } } ================================================ FILE: vendor/go.podman.io/storage/pkg/config/config.go ================================================ package config import ( "fmt" "os" ) type BtrfsOptionsConfig struct { // MinSpace is the minimal spaces allocated to the device MinSpace string `toml:"min_space,omitempty"` // Size Size string `toml:"size,omitempty"` } type OverlayOptionsConfig struct { // IgnoreChownErrors is a flag for whether chown errors should be // ignored when building an image. IgnoreChownErrors string `toml:"ignore_chown_errors,omitempty"` // MountOpt specifies extra mount options used when mounting MountOpt string `toml:"mountopt,omitempty"` // Alternative program to use for the mount of the file system MountProgram string `toml:"mount_program,omitempty"` // Size Size string `toml:"size,omitempty"` // Inodes is used to set a maximum inodes of the container image. Inodes string `toml:"inodes,omitempty"` // Do not create a bind mount on the storage home SkipMountHome string `toml:"skip_mount_home,omitempty"` // Specify whether composefs must be used to mount the data layers UseComposefs string `toml:"use_composefs,omitempty"` // ForceMask indicates the permissions mask (e.g. "0755") to use for new // files and directories ForceMask string `toml:"force_mask,omitempty"` } type VfsOptionsConfig struct { // IgnoreChownErrors is a flag for whether chown errors should be // ignored when building an image. IgnoreChownErrors string `toml:"ignore_chown_errors,omitempty"` } type ZfsOptionsConfig struct { // MountOpt specifies extra mount options used when mounting MountOpt string `toml:"mountopt,omitempty"` // Name is the File System name of the ZFS File system Name string `toml:"fsname,omitempty"` // Size Size string `toml:"size,omitempty"` } // OptionsConfig represents the "storage.options" TOML config table. type OptionsConfig struct { // AdditionalImagesStores is the location of additional read/only // Image stores. Usually used to access Networked File System // for shared image content AdditionalImageStores []string `toml:"additionalimagestores,omitempty"` // ImageStore is the location of image store which is separated from the // container store. Usually this is not recommended unless users wants // separate store for image and containers. ImageStore string `toml:"imagestore,omitempty"` // AdditionalLayerStores is the location of additional read/only // Layer stores. Usually used to access Networked File System // for shared image content // This API is experimental and can be changed without bumping the // major version number. AdditionalLayerStores []string `toml:"additionallayerstores,omitempty"` // Size Size string `toml:"size,omitempty"` // IgnoreChownErrors is a flag for whether chown errors should be // ignored when building an image. IgnoreChownErrors string `toml:"ignore_chown_errors,omitempty"` // Specify whether composefs must be used to mount the data layers UseComposefs string `toml:"use_composefs,omitempty"` // ForceMask indicates the permissions mask (e.g. "0755") to use for new // files and directories. ForceMask os.FileMode `toml:"force_mask,omitempty"` // RootAutoUsernsUser is the name of one or more entries in /etc/subuid and // /etc/subgid which should be used to set up automatically a userns. RootAutoUsernsUser string `toml:"root-auto-userns-user,omitempty"` // AutoUsernsMinSize is the minimum size for a user namespace that is // created automatically. AutoUsernsMinSize uint32 `toml:"auto-userns-min-size,omitempty"` // AutoUsernsMaxSize is the maximum size for a user namespace that is // created automatically. AutoUsernsMaxSize uint32 `toml:"auto-userns-max-size,omitempty"` // Btrfs container options to be handed to btrfs drivers Btrfs struct{ BtrfsOptionsConfig } `toml:"btrfs,omitempty"` // Thinpool container options to be handed to thinpool drivers (NOP) Thinpool struct{} `toml:"thinpool,omitempty"` // Overlay container options to be handed to overlay drivers Overlay struct{ OverlayOptionsConfig } `toml:"overlay,omitempty"` // Vfs container options to be handed to VFS drivers Vfs struct{ VfsOptionsConfig } `toml:"vfs,omitempty"` // Zfs container options to be handed to ZFS drivers Zfs struct{ ZfsOptionsConfig } `toml:"zfs,omitempty"` // Do not create a bind mount on the storage home SkipMountHome string `toml:"skip_mount_home,omitempty"` // Alternative program to use for the mount of the file system MountProgram string `toml:"mount_program,omitempty"` // MountOpt specifies extra mount options used when mounting MountOpt string `toml:"mountopt,omitempty"` // PullOptions specifies options to be handed to pull managers // This API is experimental and can be changed without bumping the major version number. PullOptions map[string]string `toml:"pull_options,omitempty"` // DisableVolatile doesn't allow volatile mounts when it is set. DisableVolatile bool `toml:"disable-volatile,omitempty"` } // GetGraphDriverOptions returns the driver specific options func GetGraphDriverOptions(driverName string, options OptionsConfig) []string { var doptions []string switch driverName { case "btrfs": if options.Btrfs.MinSpace != "" { return append(doptions, fmt.Sprintf("%s.min_space=%s", driverName, options.Btrfs.MinSpace)) } if options.Btrfs.Size != "" { doptions = append(doptions, fmt.Sprintf("%s.size=%s", driverName, options.Btrfs.Size)) } else if options.Size != "" { doptions = append(doptions, fmt.Sprintf("%s.size=%s", driverName, options.Size)) } case "overlay", "overlay2": // Specify whether composefs must be used to mount the data layers if options.Overlay.IgnoreChownErrors != "" { doptions = append(doptions, fmt.Sprintf("%s.ignore_chown_errors=%s", driverName, options.Overlay.IgnoreChownErrors)) } else if options.IgnoreChownErrors != "" { doptions = append(doptions, fmt.Sprintf("%s.ignore_chown_errors=%s", driverName, options.IgnoreChownErrors)) } if options.Overlay.MountProgram != "" { doptions = append(doptions, fmt.Sprintf("%s.mount_program=%s", driverName, options.Overlay.MountProgram)) } else if options.MountProgram != "" { doptions = append(doptions, fmt.Sprintf("%s.mount_program=%s", driverName, options.MountProgram)) } if options.Overlay.MountOpt != "" { doptions = append(doptions, fmt.Sprintf("%s.mountopt=%s", driverName, options.Overlay.MountOpt)) } else if options.MountOpt != "" { doptions = append(doptions, fmt.Sprintf("%s.mountopt=%s", driverName, options.MountOpt)) } if options.Overlay.Size != "" { doptions = append(doptions, fmt.Sprintf("%s.size=%s", driverName, options.Overlay.Size)) } else if options.Size != "" { doptions = append(doptions, fmt.Sprintf("%s.size=%s", driverName, options.Size)) } if options.Overlay.Inodes != "" { doptions = append(doptions, fmt.Sprintf("%s.inodes=%s", driverName, options.Overlay.Inodes)) } if options.Overlay.SkipMountHome != "" { doptions = append(doptions, fmt.Sprintf("%s.skip_mount_home=%s", driverName, options.Overlay.SkipMountHome)) } else if options.SkipMountHome != "" { doptions = append(doptions, fmt.Sprintf("%s.skip_mount_home=%s", driverName, options.SkipMountHome)) } if options.Overlay.ForceMask != "" { doptions = append(doptions, fmt.Sprintf("%s.force_mask=%s", driverName, options.Overlay.ForceMask)) } else if options.ForceMask != 0 { doptions = append(doptions, fmt.Sprintf("%s.force_mask=%s", driverName, options.ForceMask)) } if options.Overlay.UseComposefs != "" { doptions = append(doptions, fmt.Sprintf("%s.use_composefs=%s", driverName, options.Overlay.UseComposefs)) } case "vfs": if options.Vfs.IgnoreChownErrors != "" { doptions = append(doptions, fmt.Sprintf("%s.ignore_chown_errors=%s", driverName, options.Vfs.IgnoreChownErrors)) } else if options.IgnoreChownErrors != "" { doptions = append(doptions, fmt.Sprintf("%s.ignore_chown_errors=%s", driverName, options.IgnoreChownErrors)) } case "zfs": if options.Zfs.Name != "" { doptions = append(doptions, fmt.Sprintf("%s.fsname=%s", driverName, options.Zfs.Name)) } if options.Zfs.MountOpt != "" { doptions = append(doptions, fmt.Sprintf("%s.mountopt=%s", driverName, options.Zfs.MountOpt)) } else if options.MountOpt != "" { doptions = append(doptions, fmt.Sprintf("%s.mountopt=%s", driverName, options.MountOpt)) } if options.Zfs.Size != "" { doptions = append(doptions, fmt.Sprintf("%s.size=%s", driverName, options.Zfs.Size)) } else if options.Size != "" { doptions = append(doptions, fmt.Sprintf("%s.size=%s", driverName, options.Size)) } } return doptions } ================================================ FILE: vendor/go.podman.io/storage/pkg/directory/directory.go ================================================ package directory import ( "os" "path/filepath" ) // DiskUsage is a structure that describes the disk usage (size and inode count) // of a particular directory. type DiskUsage struct { Size int64 InodeCount int64 } // MoveToSubdir moves all contents of a directory to a subdirectory underneath the original path func MoveToSubdir(oldpath, subdir string) error { infos, err := os.ReadDir(oldpath) if err != nil { return err } for _, info := range infos { if info.Name() != subdir { oldName := filepath.Join(oldpath, info.Name()) newName := filepath.Join(oldpath, subdir, info.Name()) if err := os.Rename(oldName, newName); err != nil { return err } } } return nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/directory/directory_unix.go ================================================ //go:build !windows package directory import ( "errors" "io/fs" "path/filepath" "syscall" ) // Size walks a directory tree and returns its total size in bytes. func Size(dir string) (size int64, err error) { usage, err := Usage(dir) if err != nil { return 0, err } return usage.Size, nil } // Usage walks a directory tree and returns its total size in bytes and the number of inodes. func Usage(dir string) (*DiskUsage, error) { usage := &DiskUsage{} data := make(map[uint64]struct{}) err := filepath.WalkDir(dir, func(d string, entry fs.DirEntry, err error) error { if err != nil { // if dir does not exist, Usage() returns the error. // if dir/x disappeared while walking, Usage() ignores dir/x. if errors.Is(err, fs.ErrNotExist) && d != dir { return nil } return err } fileInfo, err := entry.Info() if err != nil { if errors.Is(err, fs.ErrNotExist) { return nil } return err } // Check inode to only count the sizes of files with multiple hard links once. inode := fileInfo.Sys().(*syscall.Stat_t).Ino if _, exists := data[inode]; exists { return nil } data[inode] = struct{}{} // Ignore directory sizes if entry.IsDir() { return nil } usage.Size += fileInfo.Size() return nil }) // inode count is the number of unique inode numbers we saw usage.InodeCount = int64(len(data)) return usage, err } ================================================ FILE: vendor/go.podman.io/storage/pkg/directory/directory_windows.go ================================================ //go:build windows package directory import ( "errors" "io/fs" "path/filepath" ) // Size walks a directory tree and returns its total size in bytes func Size(dir string) (size int64, err error) { usage, err := Usage(dir) if err != nil { return 0, nil } return usage.Size, nil } // Usage walks a directory tree and returns its total size in bytes and the number of inodes. func Usage(dir string) (*DiskUsage, error) { usage := &DiskUsage{} err := filepath.WalkDir(dir, func(path string, d fs.DirEntry, err error) error { if err != nil { // if dir does not exist, Size() returns the error. // if dir/x disappeared while walking, Size() ignores dir/x. if errors.Is(err, fs.ErrNotExist) && path != dir { return nil } return err } usage.InodeCount++ // Ignore directory sizes if d.IsDir() { return nil } fileInfo, err := d.Info() if err != nil { if errors.Is(err, fs.ErrNotExist) { return nil } return err } usage.Size += fileInfo.Size() return nil }) return usage, err } ================================================ FILE: vendor/go.podman.io/storage/pkg/fileutils/exists_freebsd.go ================================================ package fileutils import ( "errors" "os" "syscall" "golang.org/x/sys/unix" ) // Exists checks whether a file or directory exists at the given path. // If the path is a symlink, the symlink is followed. func Exists(path string) error { // It uses unix.Faccessat which is a faster operation compared to os.Stat for // simply checking the existence of a file. err := unix.Faccessat(unix.AT_FDCWD, path, unix.F_OK, 0) if err != nil { return &os.PathError{Op: "faccessat", Path: path, Err: err} } return nil } // Lexists checks whether a file or directory exists at the given path. // If the path is a symlink, the symlink itself is checked. func Lexists(path string) error { // FreeBSD before 15.0 does not support the AT_SYMLINK_NOFOLLOW flag for // faccessat. In this case, the call to faccessat will return EINVAL and // we fall back to using Lstat. err := unix.Faccessat(unix.AT_FDCWD, path, unix.F_OK, unix.AT_SYMLINK_NOFOLLOW) if err != nil { if errors.Is(err, syscall.EINVAL) { _, err = os.Lstat(path) return err } return &os.PathError{Op: "faccessat", Path: path, Err: err} } return nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/fileutils/exists_unix.go ================================================ //go:build !windows && !freebsd package fileutils import ( "os" "golang.org/x/sys/unix" ) // Exists checks whether a file or directory exists at the given path. // If the path is a symlink, the symlink is followed. func Exists(path string) error { // It uses unix.Faccessat which is a faster operation compared to os.Stat for // simply checking the existence of a file. err := unix.Faccessat(unix.AT_FDCWD, path, unix.F_OK, unix.AT_EACCESS) if err != nil { return &os.PathError{Op: "faccessat", Path: path, Err: err} } return nil } // Lexists checks whether a file or directory exists at the given path. // If the path is a symlink, the symlink itself is checked. func Lexists(path string) error { // It uses unix.Faccessat which is a faster operation compared to os.Stat for // simply checking the existence of a file. err := unix.Faccessat(unix.AT_FDCWD, path, unix.F_OK, unix.AT_SYMLINK_NOFOLLOW|unix.AT_EACCESS) if err != nil { return &os.PathError{Op: "faccessat", Path: path, Err: err} } return nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/fileutils/exists_windows.go ================================================ package fileutils import ( "os" ) // Exists checks whether a file or directory exists at the given path. func Exists(path string) error { _, err := os.Stat(path) return err } // Lexists checks whether a file or directory exists at the given path, without // resolving symlinks func Lexists(path string) error { _, err := os.Lstat(path) return err } ================================================ FILE: vendor/go.podman.io/storage/pkg/fileutils/fileutils.go ================================================ package fileutils import ( "errors" "fmt" "io" "os" "path/filepath" "regexp" "strings" "text/scanner" "github.com/sirupsen/logrus" ) // PatternMatcher allows checking paths against a list of patterns type PatternMatcher struct { patterns []*Pattern exclusions bool } // NewPatternMatcher creates a new matcher object for specific patterns that can // be used later to match against patterns against paths func NewPatternMatcher(patterns []string) (*PatternMatcher, error) { pm := &PatternMatcher{ patterns: make([]*Pattern, 0, len(patterns)), } for _, p := range patterns { // Eliminate leading and trailing whitespace. p = strings.TrimSpace(p) if p == "" { continue } p = filepath.Clean(p) newp := &Pattern{} if p[0] == '!' { if len(p) == 1 { return nil, errors.New("illegal exclusion pattern: \"!\"") } newp.exclusion = true p = strings.TrimPrefix(filepath.Clean(p[1:]), "/") pm.exclusions = true } // Do some syntax checking on the pattern. // filepath's Match() has some really weird rules that are inconsistent // so instead of trying to dup their logic, just call Match() for its // error state and if there is an error in the pattern return it. // If this becomes an issue we can remove this since its really only // needed in the error (syntax) case - which isn't really critical. if _, err := filepath.Match(p, "."); err != nil { return nil, err } newp.cleanedPattern = p pm.patterns = append(pm.patterns, newp) } return pm, nil } // Deprecated: Please use the `MatchesResult` method instead. // Matches matches path against all the patterns. Matches is not safe to be // called concurrently func (pm *PatternMatcher) Matches(file string) (bool, error) { matched := false file = filepath.FromSlash(file) for _, pattern := range pm.patterns { negative := false if pattern.exclusion { negative = true } match, err := pattern.match(file) if err != nil { return false, err } if match { matched = !negative } } if matched { logrus.Debugf("Skipping excluded path: %s", file) } return matched, nil } type MatchResult struct { isMatched bool matches, excludes uint } // Excludes returns true if the overall result is matched func (m *MatchResult) IsMatched() bool { return m.isMatched } // Excludes returns the amount of matches of an MatchResult func (m *MatchResult) Matches() uint { return m.matches } // Excludes returns the amount of excludes of an MatchResult func (m *MatchResult) Excludes() uint { return m.excludes } // MatchesResult verifies the provided filepath against all patterns. // It returns the `*MatchResult` result for the patterns on success, otherwise // an error. This method is not safe to be called concurrently. func (pm *PatternMatcher) MatchesResult(file string) (res *MatchResult, err error) { file = filepath.FromSlash(file) res = &MatchResult{false, 0, 0} for _, pattern := range pm.patterns { negative := false if pattern.exclusion { negative = true } match, err := pattern.match(file) if err != nil { return nil, err } if match { res.isMatched = !negative if negative { res.excludes++ } else { res.matches++ } } } if res.matches > 0 { logrus.Debugf("Skipping excluded path: %s", file) } return res, nil } // IsMatch verifies the provided filepath against all patterns and returns true // if it matches. A match is valid if the last match is a positive one. // It returns an error on failure and is not safe to be called concurrently. func (pm *PatternMatcher) IsMatch(file string) (matched bool, err error) { res, err := pm.MatchesResult(file) if err != nil { return false, err } return res.isMatched, nil } // Exclusions returns true if any of the patterns define exclusions func (pm *PatternMatcher) Exclusions() bool { return pm.exclusions } // Patterns returns array of active patterns func (pm *PatternMatcher) Patterns() []*Pattern { return pm.patterns } // Pattern defines a single regexp used to filter file paths. type Pattern struct { cleanedPattern string regexp *regexp.Regexp exclusion bool } func (p *Pattern) String() string { return p.cleanedPattern } // Exclusion returns true if this pattern defines exclusion func (p *Pattern) Exclusion() bool { return p.exclusion } func (p *Pattern) match(path string) (bool, error) { if p.regexp == nil { if err := p.compile(); err != nil { return false, filepath.ErrBadPattern } } b := p.regexp.MatchString(path) return b, nil } func (p *Pattern) compile() error { var regStrBuilder strings.Builder regStrBuilder.WriteString("^") pattern := p.cleanedPattern // Go through the pattern and convert it to a regexp. // We use a scanner so we can support utf-8 chars. var scan scanner.Scanner scan.Init(strings.NewReader(pattern)) sl := string(os.PathSeparator) escSL := sl const bs = `\` if sl == bs { escSL += bs } for scan.Peek() != scanner.EOF { ch := scan.Next() if ch == '*' { if scan.Peek() == '*' { // is some flavor of "**" scan.Next() // Treat **/ as ** so eat the "/" if string(scan.Peek()) == sl { scan.Next() } if scan.Peek() == scanner.EOF { // is "**EOF" - to align with .gitignore just accept all regStrBuilder.WriteString(".*") } else { // is "**" // Note that this allows for any # of /'s (even 0) because // the .* will eat everything, even /'s regStrBuilder.WriteString("(.*") regStrBuilder.WriteString(escSL) regStrBuilder.WriteString(")?") } } else { // is "*" so map it to anything but "/" regStrBuilder.WriteString("[^") regStrBuilder.WriteString(escSL) regStrBuilder.WriteString("]*") } } else if ch == '?' { // "?" is any char except "/" regStrBuilder.WriteString("[^") regStrBuilder.WriteString(escSL) regStrBuilder.WriteString("]") } else if ch == '.' || ch == '$' { // Escape some regexp special chars that have no meaning // in golang's filepath.Match regStrBuilder.WriteString(bs) regStrBuilder.WriteRune(ch) } else if ch == '\\' { // escape next char. if sl == bs { // On windows map "\" to "\\", meaning an escaped backslash, // and then just continue because filepath.Match on // Windows doesn't allow escaping at all regStrBuilder.WriteString(escSL) continue } if scan.Peek() != scanner.EOF { regStrBuilder.WriteString(bs) regStrBuilder.WriteRune(scan.Next()) } else { return filepath.ErrBadPattern } } else { regStrBuilder.WriteRune(ch) } } regStrBuilder.WriteString("(") regStrBuilder.WriteString(escSL) regStrBuilder.WriteString(".*)?$") re, err := regexp.Compile(regStrBuilder.String()) if err != nil { return err } p.regexp = re return nil } // Matches returns true if file matches any of the patterns // and isn't excluded by any of the subsequent patterns. func Matches(file string, patterns []string) (bool, error) { pm, err := NewPatternMatcher(patterns) if err != nil { return false, err } file = filepath.Clean(file) if file == "." { // Don't let them exclude everything, kind of silly. return false, nil } return pm.IsMatch(file) } // CopyFile copies from src to dst until either EOF is reached // on src or an error occurs. It verifies src exists and removes // the dst if it exists. func CopyFile(src, dst string) (int64, error) { cleanSrc := filepath.Clean(src) cleanDst := filepath.Clean(dst) if cleanSrc == cleanDst { return 0, nil } sf, err := os.Open(cleanSrc) if err != nil { return 0, err } defer sf.Close() if err := os.Remove(cleanDst); err != nil && !os.IsNotExist(err) { return 0, err } df, err := os.Create(cleanDst) if err != nil { return 0, err } defer df.Close() return io.Copy(df, sf) } // ReadSymlinkedDirectory returns the target directory of a symlink. // The target of the symbolic link may not be a file. func ReadSymlinkedDirectory(path string) (string, error) { var realPath string var err error if realPath, err = filepath.Abs(path); err != nil { return "", fmt.Errorf("unable to get absolute path for %s: %w", path, err) } if realPath, err = filepath.EvalSymlinks(realPath); err != nil { return "", fmt.Errorf("failed to canonicalise path for %s: %w", path, err) } realPathInfo, err := os.Stat(realPath) if err != nil { return "", fmt.Errorf("failed to stat target '%s' of '%s': %w", realPath, path, err) } if !realPathInfo.Mode().IsDir() { return "", fmt.Errorf("canonical path points to a file '%s'", realPath) } return realPath, nil } // ReadSymlinkedPath returns the target directory of a symlink. // The target of the symbolic link can be a file and a directory. func ReadSymlinkedPath(path string) (realPath string, err error) { if realPath, err = filepath.Abs(path); err != nil { return "", fmt.Errorf("unable to get absolute path for %q: %w", path, err) } if realPath, err = filepath.EvalSymlinks(realPath); err != nil { return "", fmt.Errorf("failed to canonicalise path for %q: %w", path, err) } if err := Exists(realPath); err != nil { return "", fmt.Errorf("failed to stat target %q of %q: %w", realPath, path, err) } return realPath, nil } // CreateIfNotExists creates a file or a directory only if it does not already exist. func CreateIfNotExists(path string, isDir bool) error { if err := Exists(path); err != nil { if os.IsNotExist(err) { if isDir { return os.MkdirAll(path, 0o755) } if err := os.MkdirAll(filepath.Dir(path), 0o755); err != nil { return err } f, err := os.OpenFile(path, os.O_CREATE, 0o755) if err != nil { return err } f.Close() } } return nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/fileutils/fileutils_darwin.go ================================================ package fileutils import ( "os" "os/exec" "strconv" "strings" ) // GetTotalUsedFds returns the number of used File Descriptors by // executing `lsof -p PID` func GetTotalUsedFds() int { pid := os.Getpid() cmd := exec.Command("lsof", "-p", strconv.Itoa(pid)) output, err := cmd.CombinedOutput() if err != nil { return -1 } outputStr := strings.TrimSpace(string(output)) fds := strings.Split(outputStr, "\n") return len(fds) - 1 } ================================================ FILE: vendor/go.podman.io/storage/pkg/fileutils/fileutils_solaris.go ================================================ package fileutils // GetTotalUsedFds Returns the number of used File Descriptors. // On Solaris these limits are per process and not systemwide func GetTotalUsedFds() int { return -1 } ================================================ FILE: vendor/go.podman.io/storage/pkg/fileutils/fileutils_unix.go ================================================ //go:build linux || freebsd package fileutils import ( "fmt" "os" "github.com/sirupsen/logrus" ) // GetTotalUsedFds Returns the number of used File Descriptors by // reading it via /proc filesystem. func GetTotalUsedFds() int { if fds, err := os.ReadDir(fmt.Sprintf("/proc/%d/fd", os.Getpid())); err != nil { logrus.Errorf("%v", err) } else { return len(fds) } return -1 } ================================================ FILE: vendor/go.podman.io/storage/pkg/fileutils/fileutils_windows.go ================================================ package fileutils // GetTotalUsedFds Returns the number of used File Descriptors. Not supported // on Windows. func GetTotalUsedFds() int { return -1 } ================================================ FILE: vendor/go.podman.io/storage/pkg/fileutils/reflink_linux.go ================================================ package fileutils import ( "io" "os" "golang.org/x/sys/unix" ) // ReflinkOrCopy attempts to reflink the source to the destination fd. // If reflinking fails or is unsupported, it falls back to io.Copy(). func ReflinkOrCopy(src, dst *os.File) error { err := unix.IoctlFileClone(int(dst.Fd()), int(src.Fd())) if err == nil { return nil } _, err = io.Copy(dst, src) return err } ================================================ FILE: vendor/go.podman.io/storage/pkg/fileutils/reflink_unsupported.go ================================================ //go:build !linux package fileutils import ( "io" "os" ) // ReflinkOrCopy attempts to reflink the source to the destination fd. // If reflinking fails or is unsupported, it falls back to io.Copy(). func ReflinkOrCopy(src, dst *os.File) error { _, err := io.Copy(dst, src) return err } ================================================ FILE: vendor/go.podman.io/storage/pkg/fsutils/fsutils_linux.go ================================================ //go:build linux package fsutils import ( "fmt" "os" "unsafe" "golang.org/x/sys/unix" ) func locateDummyIfEmpty(path string) (string, error) { children, err := os.ReadDir(path) if err != nil { return "", err } if len(children) != 0 { return "", nil } dummyFile, err := os.CreateTemp(path, "fsutils-dummy") if err != nil { return "", err } name := dummyFile.Name() err = dummyFile.Close() return name, err } // SupportsDType returns whether the filesystem mounted on path supports d_type func SupportsDType(path string) (bool, error) { // locate dummy so that we have at least one dirent dummy, err := locateDummyIfEmpty(path) if err != nil { return false, err } if dummy != "" { defer os.Remove(dummy) } visited := 0 supportsDType := true fn := func(ent *unix.Dirent) bool { visited++ if ent.Type == unix.DT_UNKNOWN { supportsDType = false // stop iteration return true } // continue iteration return false } if err = iterateReadDir(path, fn); err != nil { return false, err } if visited == 0 { return false, fmt.Errorf("did not hit any dirent during iteration %s", path) } return supportsDType, nil } func iterateReadDir(path string, fn func(*unix.Dirent) bool) error { d, err := os.Open(path) if err != nil { return err } defer d.Close() fd := int(d.Fd()) buf := make([]byte, 4096) for { nbytes, err := unix.ReadDirent(fd, buf) if err != nil { return err } if nbytes == 0 { break } for off := 0; off < nbytes; { ent := (*unix.Dirent)(unsafe.Pointer(&buf[off])) if stop := fn(ent); stop { return nil } off += int(ent.Reclen) } } return nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/fsverity/fsverity_linux.go ================================================ package fsverity import ( "errors" "fmt" "syscall" "unsafe" "golang.org/x/sys/unix" ) // verityDigest struct represents the digest used for verifying the integrity of a file. type verityDigest struct { Fsv unix.FsverityDigest Buf [64]byte } // EnableVerity enables the verity feature on a file represented by the file descriptor 'fd'. The file must be opened // in read-only mode. // The 'description' parameter is a human-readable description of the file. func EnableVerity(description string, fd int) error { enableArg := unix.FsverityEnableArg{ Version: 1, Hash_algorithm: unix.FS_VERITY_HASH_ALG_SHA256, Block_size: 4096, } _, _, e1 := syscall.Syscall(unix.SYS_IOCTL, uintptr(fd), uintptr(unix.FS_IOC_ENABLE_VERITY), uintptr(unsafe.Pointer(&enableArg))) if e1 != 0 && !errors.Is(e1, unix.EEXIST) { return fmt.Errorf("failed to enable verity for %q: %w", description, e1) } return nil } // MeasureVerity measures and returns the verity digest for the file represented by 'fd'. // The 'description' parameter is a human-readable description of the file. func MeasureVerity(description string, fd int) (string, error) { var digest verityDigest digest.Fsv.Size = 64 _, _, e1 := syscall.Syscall(unix.SYS_IOCTL, uintptr(fd), uintptr(unix.FS_IOC_MEASURE_VERITY), uintptr(unsafe.Pointer(&digest))) if e1 != 0 { return "", fmt.Errorf("failed to measure verity for %q: %w", description, e1) } return fmt.Sprintf("%x", digest.Buf[:digest.Fsv.Size]), nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/fsverity/fsverity_unsupported.go ================================================ //go:build !linux package fsverity import ( "fmt" ) // EnableVerity enables the verity feature on a file represented by the file descriptor 'fd'. The file must be opened // in read-only mode. // The 'description' parameter is a human-readable description of the file. func EnableVerity(description string, fd int) error { return fmt.Errorf("fs-verity is not supported on this platform") } // MeasureVerity measures and returns the verity digest for the file represented by 'fd'. // The 'description' parameter is a human-readable description of the file. func MeasureVerity(description string, fd int) (string, error) { return "", fmt.Errorf("fs-verity is not supported on this platform") } ================================================ FILE: vendor/go.podman.io/storage/pkg/homedir/homedir.go ================================================ package homedir import ( "errors" "os" "path/filepath" ) // GetDataHome returns XDG_DATA_HOME. // GetDataHome returns $HOME/.local/share and nil error if XDG_DATA_HOME is not set. // // See also https://standards.freedesktop.org/basedir-spec/latest/ar01s03.html func GetDataHome() (string, error) { if xdgDataHome := os.Getenv("XDG_DATA_HOME"); xdgDataHome != "" { return xdgDataHome, nil } home := Get() if home == "" { return "", errors.New("could not get either XDG_DATA_HOME or HOME") } return filepath.Join(home, ".local", "share"), nil } // GetCacheHome returns XDG_CACHE_HOME. // GetCacheHome returns $HOME/.cache and nil error if XDG_CACHE_HOME is not set. // // See also https://standards.freedesktop.org/basedir-spec/latest/ar01s03.html func GetCacheHome() (string, error) { if xdgCacheHome := os.Getenv("XDG_CACHE_HOME"); xdgCacheHome != "" { return xdgCacheHome, nil } home := Get() if home == "" { return "", errors.New("could not get either XDG_CACHE_HOME or HOME") } return filepath.Join(home, ".cache"), nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/homedir/homedir_unix.go ================================================ //go:build !windows package homedir // Copyright 2013-2018 Docker, Inc. // NOTE: this package has originally been copied from github.com/docker/docker. import ( "fmt" "os" "path/filepath" "strconv" "strings" "sync" "syscall" "github.com/sirupsen/logrus" "go.podman.io/storage/pkg/unshare" ) // Key returns the env var name for the user's home dir based on // the platform being run on func Key() string { return "HOME" } // Get returns the home directory of the current user with the help of // environment variables depending on the target operating system. // Returned path should be used with "path/filepath" to form new paths. // // If linking statically with cgo enabled against glibc, ensure the // osusergo build tag is used. // // If needing to do nss lookups, do not disable cgo or set osusergo. func Get() string { homedir, _ := unshare.HomeDir() return homedir } // GetShortcutString returns the string that is shortcut to user's home directory // in the native shell of the platform running on. func GetShortcutString() string { return "~" } // StickRuntimeDirContents sets the sticky bit on files that are under // XDG_RUNTIME_DIR, so that the files won't be periodically removed by the system. // // StickyRuntimeDir returns slice of sticked files. // StickyRuntimeDir returns nil error if XDG_RUNTIME_DIR is not set. // // See also https://standards.freedesktop.org/basedir-spec/latest/ar01s03.html func StickRuntimeDirContents(files []string) ([]string, error) { runtimeDir, err := GetRuntimeDir() if err != nil { // ignore error if runtimeDir is empty return nil, nil //nolint: nilerr } runtimeDir, err = filepath.Abs(runtimeDir) if err != nil { return nil, err } var sticked []string for _, f := range files { f, err = filepath.Abs(f) if err != nil { return sticked, err } if strings.HasPrefix(f, runtimeDir+"/") { if err = stick(f); err != nil { return sticked, err } sticked = append(sticked, f) } } return sticked, nil } func stick(f string) error { st, err := os.Stat(f) if err != nil { return err } m := st.Mode() m |= os.ModeSticky return os.Chmod(f, m) } var ( rootlessConfigHomeDirError error rootlessConfigHomeDirOnce sync.Once rootlessConfigHomeDir string rootlessRuntimeDirOnce sync.Once rootlessRuntimeDir string ) // isWriteableOnlyByOwner checks that the specified permission mask allows write // access only to the owner. func isWriteableOnlyByOwner(perm os.FileMode) bool { return (perm & 0o722) == 0o700 } // GetConfigHome returns XDG_CONFIG_HOME. // GetConfigHome returns $HOME/.config and nil error if XDG_CONFIG_HOME is not set. // // See also https://standards.freedesktop.org/basedir-spec/latest/ar01s03.html func GetConfigHome() (string, error) { rootlessConfigHomeDirOnce.Do(func() { cfgHomeDir := os.Getenv("XDG_CONFIG_HOME") if cfgHomeDir == "" { home := Get() resolvedHome, err := filepath.EvalSymlinks(home) if err != nil { rootlessConfigHomeDirError = fmt.Errorf("cannot resolve %s: %w", home, err) return } tmpDir := filepath.Join(resolvedHome, ".config") _ = os.MkdirAll(tmpDir, 0o700) st, err := os.Stat(tmpDir) if err != nil { rootlessConfigHomeDirError = err return } else if int(st.Sys().(*syscall.Stat_t).Uid) == os.Geteuid() { cfgHomeDir = tmpDir } else { rootlessConfigHomeDirError = fmt.Errorf("path %q exists and it is not owned by the current user", tmpDir) return } } rootlessConfigHomeDir = cfgHomeDir }) return rootlessConfigHomeDir, rootlessConfigHomeDirError } // GetRuntimeDir returns a directory suitable to store runtime files. // The function will try to use the XDG_RUNTIME_DIR env variable if it is set. // XDG_RUNTIME_DIR is typically configured via pam_systemd. // If XDG_RUNTIME_DIR is not set, GetRuntimeDir will try to find a suitable // directory for the current user. // // See also https://standards.freedesktop.org/basedir-spec/latest/ar01s03.html func GetRuntimeDir() (string, error) { var rootlessRuntimeDirError error rootlessRuntimeDirOnce.Do(func() { runtimeDir := os.Getenv("XDG_RUNTIME_DIR") if runtimeDir != "" { rootlessRuntimeDir, rootlessRuntimeDirError = filepath.EvalSymlinks(runtimeDir) return } uid := strconv.Itoa(unshare.GetRootlessUID()) if runtimeDir == "" { tmpDir := filepath.Join("/run", "user", uid) if err := os.MkdirAll(tmpDir, 0o700); err != nil { logrus.Debug(err) } st, err := os.Lstat(tmpDir) if err == nil && int(st.Sys().(*syscall.Stat_t).Uid) == os.Geteuid() && isWriteableOnlyByOwner(st.Mode().Perm()) { runtimeDir = tmpDir } } if runtimeDir == "" { tmpDir := filepath.Join(os.TempDir(), fmt.Sprintf("storage-run-%s", uid)) if err := os.MkdirAll(tmpDir, 0o700); err != nil { logrus.Debug(err) } st, err := os.Lstat(tmpDir) if err == nil && int(st.Sys().(*syscall.Stat_t).Uid) == os.Geteuid() && isWriteableOnlyByOwner(st.Mode().Perm()) { runtimeDir = tmpDir } else { rootlessRuntimeDirError = fmt.Errorf("path %q exists and it is not writeable only by the current user", tmpDir) return } } rootlessRuntimeDir = runtimeDir }) return rootlessRuntimeDir, rootlessRuntimeDirError } ================================================ FILE: vendor/go.podman.io/storage/pkg/homedir/homedir_windows.go ================================================ package homedir // Copyright 2013-2018 Docker, Inc. // NOTE: this package has originally been copied from github.com/docker/docker. import ( "os" "path/filepath" ) // Key returns the env var name for the user's home dir based on // the platform being run on func Key() string { return "USERPROFILE" } // Get returns the home directory of the current user with the help of // environment variables depending on the target operating system. // Returned path should be used with "path/filepath" to form new paths. func Get() string { home := os.Getenv(Key()) if home != "" { return home } home, _ = os.UserHomeDir() return home } // GetConfigHome returns the home directory of the current user with the help of // environment variables depending on the target operating system. // Returned path should be used with "path/filepath" to form new paths. func GetConfigHome() (string, error) { return filepath.Join(Get(), ".config"), nil } // GetShortcutString returns the string that is shortcut to user's home directory // in the native shell of the platform running on. func GetShortcutString() string { return "%USERPROFILE%" // be careful while using in format functions } // StickRuntimeDirContents is a no-op on Windows func StickRuntimeDirContents(files []string) ([]string, error) { return nil, nil } // GetRuntimeDir returns a directory suitable to store runtime files. // The function will try to use the XDG_RUNTIME_DIR env variable if it is set. // XDG_RUNTIME_DIR is typically configured via pam_systemd. // If XDG_RUNTIME_DIR is not set, GetRuntimeDir will try to find a suitable // directory for the current user. // // See also https://standards.freedesktop.org/basedir-spec/latest/ar01s03.html func GetRuntimeDir() (string, error) { data, err := GetDataHome() if err != nil { return "", err } runtimeDir := filepath.Join(data, "containers", "storage") return runtimeDir, nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/idmap/idmapped_utils.go ================================================ //go:build linux package idmap import ( "errors" "fmt" "io/fs" "os" "runtime" "syscall" "github.com/sirupsen/logrus" "go.podman.io/storage/pkg/idtools" "golang.org/x/sys/unix" ) // CreateIDMappedMount creates a IDMapped bind mount from SOURCE to TARGET using the user namespace // for the PID process. func CreateIDMappedMount(source, target string, pid int) error { path := fmt.Sprintf("/proc/%d/ns/user", pid) userNsFile, err := os.Open(path) if err != nil { return fmt.Errorf("unable to get user ns file descriptor for %q: %w", path, err) } defer userNsFile.Close() targetDirFd, err := unix.OpenTree(unix.AT_FDCWD, source, unix.OPEN_TREE_CLONE) if err != nil { return &os.PathError{Op: "open_tree", Path: source, Err: err} } defer unix.Close(targetDirFd) if err := unix.MountSetattr(targetDirFd, "", unix.AT_EMPTY_PATH|unix.AT_RECURSIVE, &unix.MountAttr{ Attr_set: unix.MOUNT_ATTR_IDMAP, Userns_fd: uint64(userNsFile.Fd()), Propagation: unix.MS_PRIVATE, }); err != nil { return &os.PathError{Op: "mount_setattr", Path: source, Err: err} } if err := os.Mkdir(target, 0o700); err != nil && !errors.Is(err, fs.ErrExist) { return err } if err := unix.MoveMount(targetDirFd, "", 0, target, unix.MOVE_MOUNT_F_EMPTY_PATH); err != nil { return &os.PathError{Op: "move_mount", Path: target, Err: err} } return nil } // CreateUsernsProcess forks the current process and creates a user namespace using the specified // mappings. It returns the pid of the new process. func CreateUsernsProcess(uidMaps []idtools.IDMap, gidMaps []idtools.IDMap) (int, func(), error) { var pid uintptr var err syscall.Errno if runtime.GOARCH == "s390x" { pid, _, err = syscall.Syscall6(uintptr(unix.SYS_CLONE), 0, unix.CLONE_NEWUSER|uintptr(unix.SIGCHLD), 0, 0, 0, 0) } else { pid, _, err = syscall.Syscall6(uintptr(unix.SYS_CLONE), unix.CLONE_NEWUSER|uintptr(unix.SIGCHLD), 0, 0, 0, 0, 0) } if err != 0 { return -1, nil, err } if pid == 0 { _ = unix.Prctl(unix.PR_SET_PDEATHSIG, uintptr(unix.SIGKILL), 0, 0, 0) // just wait for the SIGKILL for { _ = syscall.Pause() } } cleanupFunc := func() { err1 := unix.Kill(int(pid), unix.SIGKILL) if err1 != nil && err1 != syscall.ESRCH { logrus.Warnf("kill process pid: %d with SIGKILL ended with error: %v", int(pid), err1) } if err1 != nil { return } if _, err := unix.Wait4(int(pid), nil, 0, nil); err != nil { logrus.Warnf("wait4 pid: %d ended with error: %v", int(pid), err) } } writeMappings := func(fname string, idmap []idtools.IDMap) error { mappings := "" for _, m := range idmap { mappings = mappings + fmt.Sprintf("%d %d %d\n", m.ContainerID, m.HostID, m.Size) } return os.WriteFile(fmt.Sprintf("/proc/%d/%s", pid, fname), []byte(mappings), 0o600) } if err := writeMappings("uid_map", uidMaps); err != nil { cleanupFunc() return -1, nil, err } if err := writeMappings("gid_map", gidMaps); err != nil { cleanupFunc() return -1, nil, err } return int(pid), cleanupFunc, nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/idmap/idmapped_utils_unsupported.go ================================================ //go:build !linux package idmap import ( "fmt" "go.podman.io/storage/pkg/idtools" ) // CreateIDMappedMount creates a IDMapped bind mount from SOURCE to TARGET using the user namespace // for the PID process. func CreateIDMappedMount(source, target string, pid int) error { return fmt.Errorf("IDMapped mounts are not supported") } // CreateUsernsProcess forks the current process and creates a user namespace using the specified // mappings. It returns the pid of the new process. func CreateUsernsProcess(uidMaps []idtools.IDMap, gidMaps []idtools.IDMap) (int, func(), error) { return -1, nil, fmt.Errorf("IDMapped mounts are not supported") } ================================================ FILE: vendor/go.podman.io/storage/pkg/idtools/idtools.go ================================================ package idtools import ( "bufio" "cmp" "errors" "fmt" "io/fs" "os" "os/user" "runtime" "slices" "strconv" "strings" "sync" "syscall" "github.com/sirupsen/logrus" "go.podman.io/storage/pkg/system" ) // IDMap contains a single entry for user namespace range remapping. An array // of IDMap entries represents the structure that will be provided to the Linux // kernel for creating a user namespace. type IDMap struct { ContainerID int `json:"container_id"` HostID int `json:"host_id"` Size int `json:"size"` } type subIDRange struct { Start int Length int } func compareRanges(a, b subIDRange) int { return cmp.Compare(a.Start, b.Start) } const ( subuidFileName string = "/etc/subuid" subgidFileName string = "/etc/subgid" ContainersOverrideXattr = "user.containers.override_stat" ) // MkdirAllAs creates a directory (include any along the path) and then modifies // ownership to the requested uid/gid. If the directory already exists, this // function will still change ownership to the requested uid/gid pair. // // Deprecated: Use MkdirAllAndChown func MkdirAllAs(path string, mode os.FileMode, ownerUID, ownerGID int) error { return MkdirAllAndChown(path, mode, IDPair{UID: ownerUID, GID: ownerGID}) } // MkdirAs creates a directory and then modifies ownership to the requested uid/gid. // If the directory already exists, this function still changes ownership // // Deprecated: Use MkdirAndChown with a IDPair func MkdirAs(path string, mode os.FileMode, ownerUID, ownerGID int) error { return MkdirAndChown(path, mode, IDPair{UID: ownerUID, GID: ownerGID}) } // MkdirAllAndChown creates a directory (include any along the path) and then modifies // ownership to the requested uid/gid. If the directory already exists, this // function will still change ownership to the requested uid/gid pair. func MkdirAllAndChown(path string, mode os.FileMode, ids IDPair) error { return mkdirAs(path, mode, ids.UID, ids.GID, true, true) } // MkdirAndChown creates a directory and then modifies ownership to the requested uid/gid. // If the directory already exists, this function still changes ownership func MkdirAndChown(path string, mode os.FileMode, ids IDPair) error { return mkdirAs(path, mode, ids.UID, ids.GID, false, true) } // MkdirAllAndChownNew creates a directory (include any along the path) and then modifies // ownership ONLY of newly created directories to the requested uid/gid. If the // directories along the path exist, no change of ownership will be performed func MkdirAllAndChownNew(path string, mode os.FileMode, ids IDPair) error { return mkdirAs(path, mode, ids.UID, ids.GID, true, false) } // GetRootUIDGID retrieves the remapped root uid/gid pair from the set of maps. // If the maps are empty, then the root uid/gid will default to "real" 0/0 func GetRootUIDGID(uidMap, gidMap []IDMap) (int, int, error) { var uid, gid int var err error if len(uidMap) == 1 && uidMap[0].Size == 1 { uid = uidMap[0].HostID } else { uid, err = RawToHost(0, uidMap) if err != nil { return -1, -1, err } } if len(gidMap) == 1 && gidMap[0].Size == 1 { gid = gidMap[0].HostID } else { gid, err = RawToHost(0, gidMap) if err != nil { return -1, -1, err } } return uid, gid, nil } // RawToContainer takes an id mapping, and uses it to translate a host ID to // the remapped ID. If no map is provided, then the translation assumes a // 1-to-1 mapping and returns the passed in id. // // If you wish to map a (uid,gid) combination you should use the corresponding // IDMappings methods, which ensure that you are mapping the correct ID against // the correct mapping. func RawToContainer(hostID int, idMap []IDMap) (int, error) { if idMap == nil { return hostID, nil } for _, m := range idMap { if (hostID >= m.HostID) && (hostID <= (m.HostID + m.Size - 1)) { contID := m.ContainerID + (hostID - m.HostID) return contID, nil } } return -1, fmt.Errorf("host ID %d cannot be mapped to a container ID", hostID) } // RawToHost takes an id mapping and a remapped ID, and translates the ID to // the mapped host ID. If no map is provided, then the translation assumes a // 1-to-1 mapping and returns the passed in id. // // If you wish to map a (uid,gid) combination you should use the corresponding // IDMappings methods, which ensure that you are mapping the correct ID against // the correct mapping. func RawToHost(contID int, idMap []IDMap) (int, error) { if idMap == nil { return contID, nil } for _, m := range idMap { if (contID >= m.ContainerID) && (contID <= (m.ContainerID + m.Size - 1)) { hostID := m.HostID + (contID - m.ContainerID) return hostID, nil } } return -1, fmt.Errorf("container ID %d cannot be mapped to a host ID", contID) } // IDPair is a UID and GID pair type IDPair struct { UID int GID int } // IDMappings contains a mappings of UIDs and GIDs type IDMappings struct { uids []IDMap gids []IDMap } // NewIDMappings takes a requested user and group name and // using the data from /etc/sub{uid,gid} ranges, creates the // proper uid and gid remapping ranges for that user/group pair func NewIDMappings(username, groupname string) (*IDMappings, error) { subuidRanges, err := readSubuid(username) if err != nil { return nil, err } subgidRanges, err := readSubgid(groupname) if err != nil { return nil, err } if len(subuidRanges) == 0 { return nil, fmt.Errorf("no subuid ranges found for user %q in %s", username, subuidFileName) } if len(subgidRanges) == 0 { return nil, fmt.Errorf("no subgid ranges found for group %q in %s", groupname, subgidFileName) } return &IDMappings{ uids: createIDMap(subuidRanges), gids: createIDMap(subgidRanges), }, nil } // NewIDMappingsFromMaps creates a new mapping from two slices // Deprecated: this is a temporary shim while transitioning to IDMapping func NewIDMappingsFromMaps(uids []IDMap, gids []IDMap) *IDMappings { return &IDMappings{uids: uids, gids: gids} } // RootPair returns a uid and gid pair for the root user. The error is ignored // because a root user always exists, and the defaults are correct when the uid // and gid maps are empty. func (i *IDMappings) RootPair() IDPair { uid, gid, _ := GetRootUIDGID(i.uids, i.gids) return IDPair{UID: uid, GID: gid} } // ToHost returns the host UID and GID for the container uid, gid. func (i *IDMappings) ToHost(pair IDPair) (IDPair, error) { var err error var target IDPair target.UID, err = RawToHost(pair.UID, i.uids) if err != nil { return target, err } target.GID, err = RawToHost(pair.GID, i.gids) return target, err } var ( overflowUIDOnce sync.Once overflowGIDOnce sync.Once overflowUID int overflowGID int ) // getOverflowUID returns the UID mapped to the overflow user func getOverflowUID() int { overflowUIDOnce.Do(func() { // 65534 is the value on older kernels where /proc/sys/kernel/overflowuid is not present overflowUID = 65534 if content, err := os.ReadFile("/proc/sys/kernel/overflowuid"); err == nil { if tmp, err := strconv.Atoi(string(content)); err == nil { overflowUID = tmp } } }) return overflowUID } // getOverflowGID returns the GID mapped to the overflow user func getOverflowGID() int { overflowGIDOnce.Do(func() { // 65534 is the value on older kernels where /proc/sys/kernel/overflowgid is not present overflowGID = 65534 if content, err := os.ReadFile("/proc/sys/kernel/overflowgid"); err == nil { if tmp, err := strconv.Atoi(string(content)); err == nil { overflowGID = tmp } } }) return overflowGID } // ToHost returns the host UID and GID for the container uid, gid. // Remapping is only performed if the ids aren't already the remapped root ids // If the mapping is not possible because the target ID is not mapped into // the namespace, then the overflow ID is used. func (i *IDMappings) ToHostOverflow(pair IDPair) (IDPair, error) { var err error target := i.RootPair() if pair.UID != target.UID { target.UID, err = RawToHost(pair.UID, i.uids) if err != nil { target.UID = getOverflowUID() logrus.Debugf("Failed to map UID %v to the target mapping, using the overflow ID %v", pair.UID, target.UID) } } if pair.GID != target.GID { target.GID, err = RawToHost(pair.GID, i.gids) if err != nil { target.GID = getOverflowGID() logrus.Debugf("Failed to map GID %v to the target mapping, using the overflow ID %v", pair.GID, target.GID) } } return target, nil } // ToContainer returns the container UID and GID for the host uid and gid func (i *IDMappings) ToContainer(pair IDPair) (int, int, error) { uid, err := RawToContainer(pair.UID, i.uids) if err != nil { return -1, -1, err } gid, err := RawToContainer(pair.GID, i.gids) return uid, gid, err } // Empty returns true if there are no id mappings func (i *IDMappings) Empty() bool { return len(i.uids) == 0 && len(i.gids) == 0 } // UIDs return the UID mapping // TODO: remove this once everything has been refactored to use pairs func (i *IDMappings) UIDs() []IDMap { return i.uids } // GIDs return the UID mapping // TODO: remove this once everything has been refactored to use pairs func (i *IDMappings) GIDs() []IDMap { return i.gids } func createIDMap(subidRanges []subIDRange) []IDMap { idMap := []IDMap{} // sort the ranges by lowest ID first slices.SortFunc(subidRanges, compareRanges) containerID := 0 for _, idrange := range subidRanges { idMap = append(idMap, IDMap{ ContainerID: containerID, HostID: idrange.Start, Size: idrange.Length, }) containerID = containerID + idrange.Length } return idMap } // parseSubidFile will read the appropriate file (/etc/subuid or /etc/subgid) // and return all found ranges for a specified username. If the special value // "ALL" is supplied for username, then all ranges in the file will be returned func parseSubidFile(path, username string) ([]subIDRange, error) { var ( rangeList []subIDRange uidstr string ) if u, err := user.Lookup(username); err == nil { uidstr = u.Uid } subidFile, err := os.Open(path) if err != nil { return rangeList, err } defer subidFile.Close() s := bufio.NewScanner(subidFile) for s.Scan() { if err := s.Err(); err != nil { return rangeList, err } text := strings.TrimSpace(s.Text()) if text == "" || strings.HasPrefix(text, "#") { continue } parts := strings.Split(text, ":") if len(parts) != 3 { return rangeList, fmt.Errorf("cannot parse subuid/gid information: Format not correct for %s file", path) } if parts[0] == username || username == "ALL" || (parts[0] == uidstr && parts[0] != "") { startid, err := strconv.Atoi(parts[1]) if err != nil { return rangeList, fmt.Errorf("string to int conversion failed during subuid/gid parsing of %s: %w", path, err) } length, err := strconv.Atoi(parts[2]) if err != nil { return rangeList, fmt.Errorf("string to int conversion failed during subuid/gid parsing of %s: %w", path, err) } rangeList = append(rangeList, subIDRange{startid, length}) } } return rangeList, nil } func checkChownErr(err error, name string, uid, gid int) error { var e *os.PathError if errors.As(err, &e) && e.Err == syscall.EINVAL { return fmt.Errorf(`potentially insufficient UIDs or GIDs available in user namespace (requested %d:%d for %s): Check /etc/subuid and /etc/subgid if configured locally and run "podman system migrate": %w`, uid, gid, name, err) } return err } // Stat contains file states that can be overridden with ContainersOverrideXattr. type Stat struct { IDs IDPair Mode os.FileMode Major int Minor int } // FormatContainersOverrideXattr will format the given uid, gid, and mode into a string // that can be used as the value for the ContainersOverrideXattr xattr. func FormatContainersOverrideXattr(uid, gid, mode int) string { return FormatContainersOverrideXattrDevice(uid, gid, fs.FileMode(mode), 0, 0) } // FormatContainersOverrideXattrDevice will format the given uid, gid, and mode into a string // that can be used as the value for the ContainersOverrideXattr xattr. For devices, it also // needs the major and minor numbers. func FormatContainersOverrideXattrDevice(uid, gid int, mode fs.FileMode, major, minor int) string { typ := "" switch mode & os.ModeType { case os.ModeDir: typ = "dir" case os.ModeSymlink: typ = "symlink" case os.ModeNamedPipe: typ = "pipe" case os.ModeSocket: typ = "socket" case os.ModeDevice: typ = fmt.Sprintf("block-%d-%d", major, minor) case os.ModeDevice | os.ModeCharDevice: typ = fmt.Sprintf("char-%d-%d", major, minor) default: typ = "file" } unixMode := mode & os.ModePerm if mode&os.ModeSetuid != 0 { unixMode |= 0o4000 } if mode&os.ModeSetgid != 0 { unixMode |= 0o2000 } if mode&os.ModeSticky != 0 { unixMode |= 0o1000 } return fmt.Sprintf("%d:%d:%04o:%s", uid, gid, unixMode, typ) } // GetContainersOverrideXattr will get and decode ContainersOverrideXattr. func GetContainersOverrideXattr(path string) (Stat, error) { xstat, err := system.Lgetxattr(path, ContainersOverrideXattr) if err != nil { return Stat{}, err } return parseOverrideXattr(xstat) // This will fail if (xstat, err) == (nil, nil), i.e. the xattr does not exist. } func parseOverrideXattr(xstat []byte) (Stat, error) { var stat Stat attrs := strings.Split(string(xstat), ":") if len(attrs) < 3 { return stat, fmt.Errorf("the number of parts in %s is less than 3", ContainersOverrideXattr) } value, err := strconv.ParseUint(attrs[0], 10, 32) if err != nil { return stat, fmt.Errorf("failed to parse UID: %w", err) } stat.IDs.UID = int(value) value, err = strconv.ParseUint(attrs[1], 10, 32) if err != nil { return stat, fmt.Errorf("failed to parse GID: %w", err) } stat.IDs.GID = int(value) value, err = strconv.ParseUint(attrs[2], 8, 32) if err != nil { return stat, fmt.Errorf("failed to parse mode: %w", err) } stat.Mode = os.FileMode(value) & os.ModePerm if value&0o1000 != 0 { stat.Mode |= os.ModeSticky } if value&0o2000 != 0 { stat.Mode |= os.ModeSetgid } if value&0o4000 != 0 { stat.Mode |= os.ModeSetuid } if len(attrs) > 3 { typ := attrs[3] if strings.HasPrefix(typ, "file") { } else if strings.HasPrefix(typ, "dir") { stat.Mode |= os.ModeDir } else if strings.HasPrefix(typ, "symlink") { stat.Mode |= os.ModeSymlink } else if strings.HasPrefix(typ, "pipe") { stat.Mode |= os.ModeNamedPipe } else if strings.HasPrefix(typ, "socket") { stat.Mode |= os.ModeSocket } else if strings.HasPrefix(typ, "block") { stat.Mode |= os.ModeDevice stat.Major, stat.Minor, err = parseDevice(typ) if err != nil { return stat, err } } else if strings.HasPrefix(typ, "char") { stat.Mode |= os.ModeDevice | os.ModeCharDevice stat.Major, stat.Minor, err = parseDevice(typ) if err != nil { return stat, err } } else { return stat, fmt.Errorf("invalid file type %s", typ) } } return stat, nil } func parseDevice(typ string) (int, int, error) { parts := strings.Split(typ, "-") // If there are more than 3 parts, just ignore them to be forward compatible if len(parts) < 3 { return 0, 0, fmt.Errorf("invalid device type %s", typ) } if parts[0] != "block" && parts[0] != "char" { return 0, 0, fmt.Errorf("invalid device type %s", typ) } major, err := strconv.Atoi(parts[1]) if err != nil { return 0, 0, fmt.Errorf("failed to parse major number: %w", err) } minor, err := strconv.Atoi(parts[2]) if err != nil { return 0, 0, fmt.Errorf("failed to parse minor number: %w", err) } return major, minor, nil } // SetContainersOverrideXattr will encode and set ContainersOverrideXattr. func SetContainersOverrideXattr(path string, stat Stat) error { value := FormatContainersOverrideXattrDevice(stat.IDs.UID, stat.IDs.GID, stat.Mode, stat.Major, stat.Minor) return system.Lsetxattr(path, ContainersOverrideXattr, []byte(value), 0) } func SafeChown(name string, uid, gid int) error { if runtime.GOOS == "darwin" { stat := Stat{ Mode: os.FileMode(0o0700), } xstat, err := system.Lgetxattr(name, ContainersOverrideXattr) if err == nil && xstat != nil { stat, err = parseOverrideXattr(xstat) if err != nil { return err } } else { st, err := os.Stat(name) // Ideally we would share this with system.Stat below, but then we would need to convert Mode. if err != nil { return err } stat.Mode = st.Mode() } stat.IDs = IDPair{UID: uid, GID: gid} if err = SetContainersOverrideXattr(name, stat); err != nil { return err } uid = os.Getuid() gid = os.Getgid() } if stat, statErr := system.Stat(name); statErr == nil { if stat.UID() == uint32(uid) && stat.GID() == uint32(gid) { return nil } } return checkChownErr(os.Chown(name, uid, gid), name, uid, gid) } func SafeLchown(name string, uid, gid int) error { if runtime.GOOS == "darwin" { stat := Stat{ Mode: os.FileMode(0o0700), } xstat, err := system.Lgetxattr(name, ContainersOverrideXattr) if err == nil && xstat != nil { stat, err = parseOverrideXattr(xstat) if err != nil { return err } } else { st, err := os.Lstat(name) // Ideally we would share this with system.Stat below, but then we would need to convert Mode. if err != nil { return err } stat.Mode = st.Mode() } stat.IDs = IDPair{UID: uid, GID: gid} if err = SetContainersOverrideXattr(name, stat); err != nil { return err } uid = os.Getuid() gid = os.Getgid() } if stat, statErr := system.Lstat(name); statErr == nil { if stat.UID() == uint32(uid) && stat.GID() == uint32(gid) { return nil } } return checkChownErr(os.Lchown(name, uid, gid), name, uid, gid) } // IsContiguous checks if the specified mapping is contiguous and doesn't // have any hole. func IsContiguous(mappings []IDMap) bool { if len(mappings) < 2 { return true } slices.SortFunc(mappings, func(a, b IDMap) int { return cmp.Compare(a.HostID, b.HostID) }) for i := 1; i < len(mappings); i++ { if mappings[i].HostID != mappings[i-1].HostID+mappings[i-1].Size { return false } } slices.SortFunc(mappings, func(a, b IDMap) int { return cmp.Compare(a.ContainerID, b.ContainerID) }) for i := 1; i < len(mappings); i++ { if mappings[i].ContainerID != mappings[i-1].ContainerID+mappings[i-1].Size { return false } } return true } ================================================ FILE: vendor/go.podman.io/storage/pkg/idtools/idtools_supported.go ================================================ //go:build linux && cgo && libsubid package idtools import ( "errors" "os/user" "sync" "unsafe" ) /* #cgo LDFLAGS: -l subid #include #include #include struct subid_range get_range(struct subid_range *ranges, int i) { return ranges[i]; } // helper for stderr to avoid referencing C.stderr from Go code, // which breaks cgo on musl due to stderr being declared as FILE *const static FILE *subid_stderr(void) { return stderr; } #if !defined(SUBID_ABI_MAJOR) || (SUBID_ABI_MAJOR < 4) # define subid_init libsubid_init # define subid_get_uid_ranges get_subuid_ranges # define subid_get_gid_ranges get_subgid_ranges #endif */ import "C" var onceInit sync.Once func readSubid(username string, isUser bool) ([]subIDRange, error) { var ret []subIDRange uidstr := "" if username == "ALL" { return nil, errors.New("username ALL not supported") } if u, err := user.Lookup(username); err == nil { uidstr = u.Uid } onceInit.Do(func() { C.subid_init(C.CString("storage"), C.subid_stderr()) }) cUsername := C.CString(username) defer C.free(unsafe.Pointer(cUsername)) cuidstr := C.CString(uidstr) defer C.free(unsafe.Pointer(cuidstr)) var nRanges C.int var cRanges *C.struct_subid_range if isUser { nRanges = C.subid_get_uid_ranges(cUsername, &cRanges) if nRanges <= 0 { nRanges = C.subid_get_uid_ranges(cuidstr, &cRanges) } } else { nRanges = C.subid_get_gid_ranges(cUsername, &cRanges) if nRanges <= 0 { nRanges = C.subid_get_gid_ranges(cuidstr, &cRanges) } } if nRanges < 0 { return nil, errors.New("cannot read subids") } defer C.free(unsafe.Pointer(cRanges)) for i := 0; i < int(nRanges); i++ { r := C.get_range(cRanges, C.int(i)) newRange := subIDRange{ Start: int(r.start), Length: int(r.count), } ret = append(ret, newRange) } return ret, nil } func readSubuid(username string) ([]subIDRange, error) { return readSubid(username, true) } func readSubgid(username string) ([]subIDRange, error) { return readSubid(username, false) } ================================================ FILE: vendor/go.podman.io/storage/pkg/idtools/idtools_unix.go ================================================ //go:build !windows package idtools import ( "bytes" "fmt" "io" "os" "path/filepath" "sync" "syscall" "github.com/moby/sys/user" "go.podman.io/storage/pkg/fileutils" "go.podman.io/storage/pkg/system" ) var ( entOnce sync.Once getentCmd string ) func mkdirAs(path string, mode os.FileMode, ownerUID, ownerGID int, mkAll, chownExisting bool) error { // make an array containing the original path asked for, plus (for mkAll == true) // all path components leading up to the complete path that don't exist before we MkdirAll // so that we can chown all of them properly at the end. If chownExisting is false, we won't // chown the full directory path if it exists var paths []string st, err := os.Stat(path) if err != nil && os.IsNotExist(err) { paths = []string{path} } else if err == nil { if !st.IsDir() { return &os.PathError{Op: "mkdir", Path: path, Err: syscall.ENOTDIR} } if chownExisting { // short-circuit--we were called with an existing directory and chown was requested return SafeChown(path, ownerUID, ownerGID) } // nothing to do; directory exists and chown was NOT requested return nil } if mkAll { // walk back to "/" looking for directories which do not exist // and add them to the paths array for chown after creation dirPath := path if !filepath.IsAbs(dirPath) { return fmt.Errorf("path: %s should be absolute", dirPath) } for { dirPath = filepath.Dir(dirPath) if dirPath == "/" { break } if err := fileutils.Exists(dirPath); err != nil && os.IsNotExist(err) { paths = append(paths, dirPath) } } if err := os.MkdirAll(path, mode); err != nil { return err } } else { if err := os.Mkdir(path, mode); err != nil && !os.IsExist(err) { return err } } // even if it existed, we will chown the requested path + any subpaths that // didn't exist when we called MkdirAll for _, pathComponent := range paths { if err := SafeChown(pathComponent, ownerUID, ownerGID); err != nil { return err } } return nil } // CanAccess takes a valid (existing) directory and a uid, gid pair and determines // if that uid, gid pair has access (execute bit) to the directory func CanAccess(path string, pair IDPair) bool { statInfo, err := system.Stat(path) if err != nil { return false } fileMode := os.FileMode(statInfo.Mode()) permBits := fileMode.Perm() return accessible(statInfo.UID() == uint32(pair.UID), statInfo.GID() == uint32(pair.GID), permBits) } func accessible(isOwner, isGroup bool, perms os.FileMode) bool { if isOwner && (perms&0o100 == 0o100) { return true } if isGroup && (perms&0o010 == 0o010) { return true } if perms&0o001 == 0o001 { return true } return false } // LookupUser uses traditional local system files lookup (from libcontainer/user) on a username, // followed by a call to `getent` for supporting host configured non-files passwd and group dbs func LookupUser(username string) (user.User, error) { // first try a local system files lookup using existing capabilities usr, err := user.LookupUser(username) if err == nil { return usr, nil } // local files lookup failed; attempt to call `getent` to query configured passwd dbs usr, err = getentUser(username) if err != nil { return user.User{}, err } return usr, nil } // LookupUID uses traditional local system files lookup (from libcontainer/user) on a uid, // followed by a call to `getent` for supporting host configured non-files passwd and group dbs func LookupUID(uid int) (user.User, error) { // first try a local system files lookup using existing capabilities usr, err := user.LookupUid(uid) if err == nil { return usr, nil } // local files lookup failed; attempt to call `getent` to query configured passwd dbs return getentUser(fmt.Sprintf("%d", uid)) } func getentUser(key string) (user.User, error) { reader, err := callGetent("passwd", key) if err != nil { return user.User{}, err } users, err := user.ParsePasswd(reader) if err != nil { return user.User{}, err } if len(users) == 0 { return user.User{}, fmt.Errorf("getent failed to find passwd entry for %q", key) } return users[0], nil } // LookupGroup uses traditional local system files lookup (from libcontainer/user) on a group name, // followed by a call to `getent` for supporting host configured non-files passwd and group dbs func LookupGroup(groupname string) (user.Group, error) { // first try a local system files lookup using existing capabilities group, err := user.LookupGroup(groupname) if err == nil { return group, nil } // local files lookup failed; attempt to call `getent` to query configured group dbs return getentGroup(groupname) } // LookupGID uses traditional local system files lookup (from libcontainer/user) on a group ID, // followed by a call to `getent` for supporting host configured non-files passwd and group dbs func LookupGID(gid int) (user.Group, error) { // first try a local system files lookup using existing capabilities group, err := user.LookupGid(gid) if err == nil { return group, nil } // local files lookup failed; attempt to call `getent` to query configured group dbs return getentGroup(fmt.Sprintf("%d", gid)) } func getentGroup(key string) (user.Group, error) { reader, err := callGetent("group", key) if err != nil { return user.Group{}, err } groups, err := user.ParseGroup(reader) if err != nil { return user.Group{}, err } if len(groups) == 0 { return user.Group{}, fmt.Errorf("getent failed to find groups entry for %q", key) } return groups[0], nil } func callGetent(db, key string) (io.Reader, error) { entOnce.Do(func() { getentCmd, _ = resolveBinary("getent") }) // if no `getent` command on host, can't do anything else if getentCmd == "" { return nil, fmt.Errorf("") } out, err := execCmd(getentCmd, db, key) if err != nil { exitCode, errC := system.GetExitCode(err) if errC != nil { return nil, err } switch exitCode { case 1: return nil, fmt.Errorf("getent reported invalid parameters/database unknown") case 2: return nil, fmt.Errorf("getent unable to find entry %q in %s database", key, db) case 3: return nil, fmt.Errorf("getent database doesn't support enumeration") default: return nil, err } } return bytes.NewReader(out), nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/idtools/idtools_unsupported.go ================================================ //go:build !linux || !libsubid || !cgo package idtools func readSubuid(username string) ([]subIDRange, error) { return parseSubidFile(subuidFileName, username) } func readSubgid(username string) ([]subIDRange, error) { return parseSubidFile(subgidFileName, username) } ================================================ FILE: vendor/go.podman.io/storage/pkg/idtools/idtools_windows.go ================================================ //go:build windows package idtools import ( "os" ) // Platforms such as Windows do not support the UID/GID concept. So make this // just a wrapper around system.MkdirAll. func mkdirAs(path string, mode os.FileMode, ownerUID, ownerGID int, mkAll, chownExisting bool) error { if err := os.MkdirAll(path, mode); err != nil { return err } return nil } // CanAccess takes a valid (existing) directory and a uid, gid pair and determines // if that uid, gid pair has access (execute bit) to the directory // Windows does not require/support this function, so always return true func CanAccess(path string, pair IDPair) bool { return true } ================================================ FILE: vendor/go.podman.io/storage/pkg/idtools/parser.go ================================================ package idtools import ( "fmt" "math" "math/bits" "strconv" "strings" ) func parseTriple(spec []string) (container, host, size uint32, err error) { cid, err := strconv.ParseUint(spec[0], 10, 32) if err != nil { return 0, 0, 0, fmt.Errorf("parsing id map value %q: %w", spec[0], err) } hid, err := strconv.ParseUint(spec[1], 10, 32) if err != nil { return 0, 0, 0, fmt.Errorf("parsing id map value %q: %w", spec[1], err) } sz, err := strconv.ParseUint(spec[2], 10, 32) if err != nil { return 0, 0, 0, fmt.Errorf("parsing id map value %q: %w", spec[2], err) } return uint32(cid), uint32(hid), uint32(sz), nil } // ParseIDMap parses idmap triples from string. func ParseIDMap(mapSpec []string, mapSetting string) (idmap []IDMap, err error) { stdErr := fmt.Errorf("initializing ID mappings: %s setting is malformed expected [\"uint32:uint32:uint32\"]: %q", mapSetting, mapSpec) for _, idMapSpec := range mapSpec { if idMapSpec == "" { continue } idSpec := strings.Split(idMapSpec, ":") if len(idSpec)%3 != 0 { return nil, stdErr } for i := range idSpec { if i%3 != 0 { continue } cid, hid, size, err := parseTriple(idSpec[i : i+3]) if err != nil { return nil, stdErr } // Avoid possible integer overflow on 32bit builds if bits.UintSize == 32 && (cid > math.MaxInt32 || hid > math.MaxInt32 || size > math.MaxInt32) { return nil, stdErr } mapping := IDMap{ ContainerID: int(cid), HostID: int(hid), Size: int(size), } idmap = append(idmap, mapping) } } return idmap, nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/idtools/usergroupadd_linux.go ================================================ package idtools import ( "fmt" "slices" "strconv" "strings" "sync" "go.podman.io/storage/pkg/regexp" ) // add a user and/or group to Linux /etc/passwd, /etc/group using standard // Linux distribution commands: // adduser --system --shell /bin/false --disabled-login --disabled-password --no-create-home --group // useradd -r -s /bin/false var ( once sync.Once userCommand []string // command, args…, to be finished by adding an user name idOutRegexp = regexp.Delayed(`uid=([0-9]+).*gid=([0-9]+)`) // default length for a UID/GID subordinate range defaultRangeLen = 65536 defaultRangeStart = 100000 ) // AddNamespaceRangesUser takes a username and uses the standard system // utility to create a system user/group pair used to hold the // /etc/sub{uid,gid} ranges which will be used for user namespace // mapping ranges in containers. func AddNamespaceRangesUser(name string) (int, int, error) { if err := addUser(name); err != nil { return -1, -1, fmt.Errorf("adding user %q: %w", name, err) } // Query the system for the created uid and gid pair out, err := execCmd("id", name) if err != nil { return -1, -1, fmt.Errorf("trying to find uid/gid for new user %q: %w", name, err) } matches := idOutRegexp.FindStringSubmatch(strings.TrimSpace(string(out))) if len(matches) != 3 { return -1, -1, fmt.Errorf("can't find uid, gid from `id` output: %q", string(out)) } uid, err := strconv.Atoi(matches[1]) if err != nil { return -1, -1, fmt.Errorf("can't convert found uid (%s) to int: %w", matches[1], err) } gid, err := strconv.Atoi(matches[2]) if err != nil { return -1, -1, fmt.Errorf("can't convert found gid (%s) to int: %w", matches[2], err) } // Now we need to create the subuid/subgid ranges for our new user/group (system users // do not get auto-created ranges in subuid/subgid) if err := createSubordinateRanges(name); err != nil { return -1, -1, fmt.Errorf("couldn't create subordinate ID ranges: %w", err) } return uid, gid, nil } func addUser(userName string) error { once.Do(func() { // set up which commands are used for adding users/groups dependent on distro if _, err := resolveBinary("adduser"); err == nil { userCommand = []string{"adduser", "--system", "--shell", "/bin/false", "--no-create-home", "--disabled-login", "--disabled-password", "--group"} } else if _, err := resolveBinary("useradd"); err == nil { userCommand = []string{"useradd", "-r", "-s", "/bin/false"} } }) if userCommand == nil { return fmt.Errorf("cannot add user; no useradd/adduser binary found") } args := append(slices.Clone(userCommand), userName) out, err := execCmd(args[0], args[1:]...) if err != nil { return fmt.Errorf("failed to add user with error: %w; output: %q", err, string(out)) } return nil } func createSubordinateRanges(name string) error { // first, we should verify that ranges weren't automatically created // by the distro tooling ranges, err := readSubuid(name) if err != nil { return fmt.Errorf("while looking for subuid ranges for user %q: %w", name, err) } if len(ranges) == 0 { // no UID ranges; let's create one startID, err := findNextUIDRange() if err != nil { return fmt.Errorf("can't find available subuid range: %w", err) } out, err := execCmd("usermod", "-v", fmt.Sprintf("%d-%d", startID, startID+defaultRangeLen-1), name) if err != nil { return fmt.Errorf("unable to add subuid range to user: %q; output: %s, err: %w", name, out, err) } } ranges, err = readSubgid(name) if err != nil { return fmt.Errorf("while looking for subgid ranges for user %q: %w", name, err) } if len(ranges) == 0 { // no GID ranges; let's create one startID, err := findNextGIDRange() if err != nil { return fmt.Errorf("can't find available subgid range: %w", err) } out, err := execCmd("usermod", "-w", fmt.Sprintf("%d-%d", startID, startID+defaultRangeLen-1), name) if err != nil { return fmt.Errorf("unable to add subgid range to user: %q; output: %s, err: %w", name, out, err) } } return nil } func findNextUIDRange() (int, error) { ranges, err := readSubuid("ALL") if err != nil { return -1, fmt.Errorf("couldn't parse all ranges in /etc/subuid file: %w", err) } slices.SortFunc(ranges, compareRanges) return findNextRangeStart(ranges) } func findNextGIDRange() (int, error) { ranges, err := readSubgid("ALL") if err != nil { return -1, fmt.Errorf("couldn't parse all ranges in /etc/subgid file: %w", err) } slices.SortFunc(ranges, compareRanges) return findNextRangeStart(ranges) } func findNextRangeStart(rangeList []subIDRange) (int, error) { startID := defaultRangeStart for _, arange := range rangeList { if wouldOverlap(arange, startID) { startID = arange.Start + arange.Length } } return startID, nil } func wouldOverlap(arange subIDRange, ID int) bool { low := ID high := ID + defaultRangeLen if (low >= arange.Start && low <= arange.Start+arange.Length) || (high <= arange.Start+arange.Length && high >= arange.Start) { return true } return false } ================================================ FILE: vendor/go.podman.io/storage/pkg/idtools/usergroupadd_unsupported.go ================================================ //go:build !linux package idtools import "fmt" // AddNamespaceRangesUser takes a name and finds an unused uid, gid pair // and calls the appropriate helper function to add the group and then // the user to the group in /etc/group and /etc/passwd respectively. func AddNamespaceRangesUser(name string) (int, int, error) { return -1, -1, fmt.Errorf("no support for adding users or groups on this OS") } ================================================ FILE: vendor/go.podman.io/storage/pkg/idtools/utils_unix.go ================================================ //go:build !windows package idtools import ( "fmt" "os/exec" "path/filepath" ) func resolveBinary(binname string) (string, error) { binaryPath, err := exec.LookPath(binname) if err != nil { return "", err } resolvedPath, err := filepath.EvalSymlinks(binaryPath) if err != nil { return "", err } // only return no error if the final resolved binary basename // matches what was searched for if filepath.Base(resolvedPath) == binname { return resolvedPath, nil } return "", fmt.Errorf("binary %q does not resolve to a binary of that name in $PATH (%q)", binname, resolvedPath) } func execCmd(cmd string, args ...string) ([]byte, error) { execCmd := exec.Command(cmd, args...) return execCmd.CombinedOutput() } ================================================ FILE: vendor/go.podman.io/storage/pkg/ioutils/buffer.go ================================================ package ioutils import ( "errors" "io" ) var errBufferFull = errors.New("buffer is full") type fixedBuffer struct { buf []byte pos int lastRead int } func (b *fixedBuffer) Write(p []byte) (int, error) { n := copy(b.buf[b.pos:cap(b.buf)], p) b.pos += n if n < len(p) { if b.pos == cap(b.buf) { return n, errBufferFull } return n, io.ErrShortWrite } return n, nil } func (b *fixedBuffer) Read(p []byte) (int, error) { n := copy(p, b.buf[b.lastRead:b.pos]) b.lastRead += n return n, nil } func (b *fixedBuffer) Len() int { return b.pos - b.lastRead } func (b *fixedBuffer) Cap() int { return cap(b.buf) } func (b *fixedBuffer) Reset() { b.pos = 0 b.lastRead = 0 b.buf = b.buf[:0] } func (b *fixedBuffer) String() string { return string(b.buf[b.lastRead:b.pos]) } ================================================ FILE: vendor/go.podman.io/storage/pkg/ioutils/bytespipe.go ================================================ package ioutils import ( "errors" "io" "sync" ) // maxCap is the highest capacity to use in byte slices that buffer data. const maxCap = 1e6 // minCap is the lowest capacity to use in byte slices that buffer data const minCap = 64 // blockThreshold is the minimum number of bytes in the buffer which will cause // a write to BytesPipe to block when allocating a new slice. const blockThreshold = 1e6 var ( // ErrClosed is returned when Write is called on a closed BytesPipe. ErrClosed = errors.New("write to closed BytesPipe") bufPools = make(map[int]*sync.Pool) bufPoolsLock sync.Mutex ) // BytesPipe is io.ReadWriteCloser which works similarly to pipe(queue). // All written data may be read at most once. Also, BytesPipe allocates // and releases new byte slices to adjust to current needs, so the buffer // won't be overgrown after peak loads. type BytesPipe struct { mu sync.Mutex wait *sync.Cond buf []*fixedBuffer bufLen int closeErr error // error to return from next Read. set to nil if not closed. } // NewBytesPipe creates new BytesPipe, initialized by specified slice. // If buf is nil, then it will be initialized with slice which cap is 64. // buf will be adjusted in a way that len(buf) == 0, cap(buf) == cap(buf). func NewBytesPipe() *BytesPipe { bp := &BytesPipe{} bp.buf = append(bp.buf, getBuffer(minCap)) bp.wait = sync.NewCond(&bp.mu) return bp } // Write writes p to BytesPipe. // It can allocate new []byte slices in a process of writing. func (bp *BytesPipe) Write(p []byte) (int, error) { bp.mu.Lock() written := 0 loop0: for { if bp.closeErr != nil { bp.mu.Unlock() return written, ErrClosed } if len(bp.buf) == 0 { bp.buf = append(bp.buf, getBuffer(64)) } // get the last buffer b := bp.buf[len(bp.buf)-1] n, err := b.Write(p) written += n bp.bufLen += n // errBufferFull is an error we expect to get if the buffer is full if err != nil && err != errBufferFull { bp.wait.Broadcast() bp.mu.Unlock() return written, err } // if there was enough room to write all then break if len(p) == n { break } // more data: write to the next slice p = p[n:] // make sure the buffer doesn't grow too big from this write for bp.bufLen >= blockThreshold { bp.wait.Wait() if bp.closeErr != nil { continue loop0 } } // add new byte slice to the buffers slice and continue writing nextCap := min(b.Cap()*2, maxCap) bp.buf = append(bp.buf, getBuffer(nextCap)) } bp.wait.Broadcast() bp.mu.Unlock() return written, nil } // CloseWithError causes further reads from a BytesPipe to return immediately. func (bp *BytesPipe) CloseWithError(err error) error { bp.mu.Lock() if err != nil { bp.closeErr = err } else { bp.closeErr = io.EOF } bp.wait.Broadcast() bp.mu.Unlock() return nil } // Close causes further reads from a BytesPipe to return immediately. func (bp *BytesPipe) Close() error { return bp.CloseWithError(nil) } // Read reads bytes from BytesPipe. // Data could be read only once. func (bp *BytesPipe) Read(p []byte) (int, error) { var n int bp.mu.Lock() if bp.bufLen == 0 { if bp.closeErr != nil { bp.mu.Unlock() return 0, bp.closeErr } bp.wait.Wait() if bp.bufLen == 0 && bp.closeErr != nil { err := bp.closeErr bp.mu.Unlock() return 0, err } } for bp.bufLen > 0 { b := bp.buf[0] read, _ := b.Read(p) // ignore error since fixedBuffer doesn't really return an error n += read bp.bufLen -= read if b.Len() == 0 { // it's empty so return it to the pool and move to the next one returnBuffer(b) bp.buf[0] = nil bp.buf = bp.buf[1:] } if len(p) == read { break } p = p[read:] } bp.wait.Broadcast() bp.mu.Unlock() return n, nil } func returnBuffer(b *fixedBuffer) { b.Reset() bufPoolsLock.Lock() pool := bufPools[b.Cap()] bufPoolsLock.Unlock() if pool != nil { pool.Put(b) } } func getBuffer(size int) *fixedBuffer { bufPoolsLock.Lock() pool, ok := bufPools[size] if !ok { pool = &sync.Pool{New: func() any { return &fixedBuffer{buf: make([]byte, 0, size)} }} bufPools[size] = pool } bufPoolsLock.Unlock() return pool.Get().(*fixedBuffer) } ================================================ FILE: vendor/go.podman.io/storage/pkg/ioutils/fswriters.go ================================================ package ioutils import ( "io" "os" "path/filepath" "time" ) // AtomicFileWriterOptions specifies options for creating the atomic file writer. type AtomicFileWriterOptions struct { // NoSync specifies whether the sync call must be skipped for the file. // If NoSync is not specified, the file is synced to the // storage after it has been written and before it is moved to // the specified path. NoSync bool // On successful return from Close() this is set to the mtime of the // newly written file. ModTime time.Time // Specifies whether Commit() must be explicitly called to write state // to the destination. This allows an application to preserve the original // file when an error occurs during processing (and not just during write) // The default is false, which will auto-commit on Close ExplicitCommit bool } type CommittableWriter interface { io.WriteCloser // Commit closes the temporary file associated with this writer, and // provided no errors (during commit or previously during write operations), // will publish the completed file under the intended destination. Commit() error } var defaultWriterOptions = AtomicFileWriterOptions{} // SetDefaultOptions overrides the default options used when creating an // atomic file writer. func SetDefaultOptions(opts AtomicFileWriterOptions) { defaultWriterOptions = opts } // NewAtomicFileWriterWithOpts returns a CommittableWriter so that writing to it // writes to a temporary file, which can later be committed to a destination path, // either by Closing in the case of auto-commit, or manually calling commit if the // ExplicitCommit option is enabled. Writing and closing concurrently is not // allowed. func NewAtomicFileWriterWithOpts(filename string, perm os.FileMode, opts *AtomicFileWriterOptions) (CommittableWriter, error) { return newAtomicFileWriter(filename, perm, opts) } // newAtomicFileWriter returns a CommittableWriter so that writing to it writes to // a temporary file, which can later be committed to a destination path, either by // Closing in the case of auto-commit, or manually calling commit if the // ExplicitCommit option is enabled. Writing and closing concurrently is not allowed. func newAtomicFileWriter(filename string, perm os.FileMode, opts *AtomicFileWriterOptions) (*atomicFileWriter, error) { f, err := os.CreateTemp(filepath.Dir(filename), ".tmp-"+filepath.Base(filename)) if err != nil { return nil, err } if opts == nil { opts = &defaultWriterOptions } abspath, err := filepath.Abs(filename) if err != nil { return nil, err } return &atomicFileWriter{ f: f, fn: abspath, perm: perm, noSync: opts.NoSync, explicitCommit: opts.ExplicitCommit, }, nil } // NewAtomicFileWriterWithOpts returns a CommittableWriter, with auto-commit enabled. // Writing to it writes to a temporary file and closing it atomically changes the // temporary file to destination path. Writing and closing concurrently is not allowed. func NewAtomicFileWriter(filename string, perm os.FileMode) (CommittableWriter, error) { return NewAtomicFileWriterWithOpts(filename, perm, nil) } // AtomicWriteFile atomically writes data to a file named by filename. func AtomicWriteFileWithOpts(filename string, data []byte, perm os.FileMode, opts *AtomicFileWriterOptions) error { f, err := newAtomicFileWriter(filename, perm, opts) if err != nil { return err } n, err := f.Write(data) if err == nil && n < len(data) { err = io.ErrShortWrite f.writeErr = err } if err1 := f.Close(); err == nil { err = err1 } if opts != nil { opts.ModTime = f.modTime } return err } func AtomicWriteFile(filename string, data []byte, perm os.FileMode) error { return AtomicWriteFileWithOpts(filename, data, perm, nil) } type atomicFileWriter struct { f *os.File fn string writeErr error perm os.FileMode noSync bool modTime time.Time closed bool explicitCommit bool } func (w *atomicFileWriter) Write(dt []byte) (int, error) { n, err := w.f.Write(dt) if err != nil { w.writeErr = err } return n, err } func (w *atomicFileWriter) closeTempFile() error { if w.closed { return nil } w.closed = true return w.f.Close() } func (w *atomicFileWriter) Close() error { return w.complete(!w.explicitCommit) } func (w *atomicFileWriter) Commit() error { return w.complete(true) } func (w *atomicFileWriter) complete(commit bool) (retErr error) { if w == nil || w.closed { return nil } defer func() { err := w.closeTempFile() if retErr != nil || w.writeErr != nil { os.Remove(w.f.Name()) } if retErr == nil { retErr = err } }() if commit { return w.commitState() } return nil } func (w *atomicFileWriter) commitState() error { // Perform a data only sync (fdatasync()) if supported if err := w.postDataWrittenSync(); err != nil { return err } // Capture fstat before closing the fd info, err := w.f.Stat() if err != nil { return err } w.modTime = info.ModTime() if err := w.f.Chmod(w.perm); err != nil { return err } // Perform full sync on platforms that need it if err := w.preRenameSync(); err != nil { return err } // Some platforms require closing before rename (Windows) if err := w.closeTempFile(); err != nil { return err } if w.writeErr == nil { return os.Rename(w.f.Name(), w.fn) } return nil } // AtomicWriteSet is used to atomically write a set // of files and ensure they are visible at the same time. // Must be committed to a new directory. type AtomicWriteSet struct { root string } // NewAtomicWriteSet creates a new atomic write set to // atomically create a set of files. The given directory // is used as the base directory for storing files before // commit. If no temporary directory is given the system // default is used. func NewAtomicWriteSet(tmpDir string) (*AtomicWriteSet, error) { td, err := os.MkdirTemp(tmpDir, "write-set-") if err != nil { return nil, err } return &AtomicWriteSet{ root: td, }, nil } // WriteFile writes a file to the set, guaranteeing the file // has been synced. func (ws *AtomicWriteSet) WriteFile(filename string, data []byte, perm os.FileMode) error { f, err := ws.FileWriter(filename, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, perm) if err != nil { return err } n, err := f.Write(data) if err == nil && n < len(data) { err = io.ErrShortWrite } if err1 := f.Close(); err == nil { err = err1 } return err } type syncFileCloser struct { *os.File } func (w syncFileCloser) Close() error { if !defaultWriterOptions.NoSync { return w.File.Close() } err := dataOrFullSync(w.File) if err1 := w.File.Close(); err == nil { err = err1 } return err } // FileWriter opens a file writer inside the set. The file // should be synced and closed before calling commit. func (ws *AtomicWriteSet) FileWriter(name string, flag int, perm os.FileMode) (io.WriteCloser, error) { f, err := os.OpenFile(filepath.Join(ws.root, name), flag, perm) if err != nil { return nil, err } return syncFileCloser{f}, nil } // Cancel cancels the set and removes all temporary data // created in the set. func (ws *AtomicWriteSet) Cancel() error { return os.RemoveAll(ws.root) } // Commit moves all created files to the target directory. The // target directory must not exist and the parent of the target // directory must exist. func (ws *AtomicWriteSet) Commit(target string) error { return os.Rename(ws.root, target) } // String returns the location the set is writing to. func (ws *AtomicWriteSet) String() string { return ws.root } ================================================ FILE: vendor/go.podman.io/storage/pkg/ioutils/fswriters_linux.go ================================================ package ioutils import ( "os" "golang.org/x/sys/unix" ) func dataOrFullSync(f *os.File) error { return unix.Fdatasync(int(f.Fd())) } func (w *atomicFileWriter) postDataWrittenSync() error { if w.noSync { return nil } return unix.Fdatasync(int(w.f.Fd())) } func (w *atomicFileWriter) preRenameSync() error { // On Linux data can be reliably flushed to media without metadata, so defer return nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/ioutils/fswriters_other.go ================================================ //go:build !linux package ioutils import ( "os" ) func dataOrFullSync(f *os.File) error { return f.Sync() } func (w *atomicFileWriter) postDataWrittenSync() error { // many platforms (Mac, Windows) require a full sync to reliably flush to media return nil } func (w *atomicFileWriter) preRenameSync() error { if w.noSync { return nil } // fsync() on Non-linux Unix, FlushFileBuffers (Windows), F_FULLFSYNC (Mac) return w.f.Sync() } ================================================ FILE: vendor/go.podman.io/storage/pkg/ioutils/readers.go ================================================ package ioutils import ( "context" "crypto/sha256" "encoding/hex" "io" ) type readCloserWrapper struct { io.Reader closer func() error } func (r *readCloserWrapper) Close() error { return r.closer() } type readWriteToCloserWrapper struct { io.Reader io.WriterTo closer func() error } func (r *readWriteToCloserWrapper) Close() error { return r.closer() } // NewReadCloserWrapper returns a new io.ReadCloser. func NewReadCloserWrapper(r io.Reader, closer func() error) io.ReadCloser { if wt, ok := r.(io.WriterTo); ok { return &readWriteToCloserWrapper{ Reader: r, WriterTo: wt, closer: closer, } } return &readCloserWrapper{ Reader: r, closer: closer, } } type readerErrWrapper struct { reader io.Reader closer func() } func (r *readerErrWrapper) Read(p []byte) (int, error) { n, err := r.reader.Read(p) if err != nil { r.closer() } return n, err } // NewReaderErrWrapper returns a new io.Reader. func NewReaderErrWrapper(r io.Reader, closer func()) io.Reader { return &readerErrWrapper{ reader: r, closer: closer, } } // HashData returns the sha256 sum of src. func HashData(src io.Reader) (string, error) { h := sha256.New() if _, err := io.Copy(h, src); err != nil { return "", err } return "sha256:" + hex.EncodeToString(h.Sum(nil)), nil } // OnEOFReader wraps an io.ReadCloser and a function // the function will run at the end of file or close the file. type OnEOFReader struct { Rc io.ReadCloser Fn func() } func (r *OnEOFReader) Read(p []byte) (n int, err error) { n, err = r.Rc.Read(p) if err == io.EOF { r.runFunc() } return n, err } // Close closes the file and run the function. func (r *OnEOFReader) Close() error { err := r.Rc.Close() r.runFunc() return err } func (r *OnEOFReader) runFunc() { if fn := r.Fn; fn != nil { fn() r.Fn = nil } } // cancelReadCloser wraps an io.ReadCloser with a context for cancelling read // operations. type cancelReadCloser struct { cancel func() pR *io.PipeReader // Stream to read from pW *io.PipeWriter } // NewCancelReadCloser creates a wrapper that closes the ReadCloser when the // context is cancelled. The returned io.ReadCloser must be closed when it is // no longer needed. func NewCancelReadCloser(ctx context.Context, in io.ReadCloser) io.ReadCloser { pR, pW := io.Pipe() // Create a context used to signal when the pipe is closed doneCtx, cancel := context.WithCancel(context.Background()) p := &cancelReadCloser{ cancel: cancel, pR: pR, pW: pW, } go func() { _, err := io.Copy(pW, in) select { case <-ctx.Done(): // If the context was closed, p.closeWithError // was already called. Calling it again would // change the error that Read returns. default: p.closeWithError(err) } in.Close() }() go func() { for { select { case <-ctx.Done(): p.closeWithError(ctx.Err()) case <-doneCtx.Done(): return } } }() return p } // Read wraps the Read method of the pipe that provides data from the wrapped // ReadCloser. func (p *cancelReadCloser) Read(buf []byte) (n int, err error) { return p.pR.Read(buf) } // closeWithError closes the wrapper and its underlying reader. It will // cause future calls to Read to return err. func (p *cancelReadCloser) closeWithError(err error) { p.pW.CloseWithError(err) p.cancel() } // Close closes the wrapper its underlying reader. It will cause // future calls to Read to return io.EOF. func (p *cancelReadCloser) Close() error { p.closeWithError(io.EOF) return nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/ioutils/temp_unix.go ================================================ //go:build !windows package ioutils import "os" // TempDir on Unix systems is equivalent to os.MkdirTemp. func TempDir(dir, prefix string) (string, error) { return os.MkdirTemp(dir, prefix) } ================================================ FILE: vendor/go.podman.io/storage/pkg/ioutils/temp_windows.go ================================================ //go:build windows package ioutils import ( "os" "go.podman.io/storage/pkg/longpath" ) // TempDir is the equivalent of os.MkdirTemp, except that the result is in Windows longpath format. func TempDir(dir, prefix string) (string, error) { tempDir, err := os.MkdirTemp(dir, prefix) if err != nil { return "", err } return longpath.AddPrefix(tempDir), nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/ioutils/writeflusher.go ================================================ package ioutils import ( "io" "sync" ) // WriteFlusher wraps the Write and Flush operation ensuring that every write // is a flush. In addition, the Close method can be called to intercept // Read/Write calls if the targets lifecycle has already ended. type WriteFlusher struct { w io.Writer flusher flusher flushed chan struct{} flushedOnce sync.Once closed chan struct{} closeLock sync.Mutex } type flusher interface { Flush() } var errWriteFlusherClosed = io.EOF func (wf *WriteFlusher) Write(b []byte) (n int, err error) { select { case <-wf.closed: return 0, errWriteFlusherClosed default: } n, err = wf.w.Write(b) wf.Flush() // every write is a flush. return n, err } // Flush the stream immediately. func (wf *WriteFlusher) Flush() { select { case <-wf.closed: return default: } wf.flushedOnce.Do(func() { close(wf.flushed) }) wf.flusher.Flush() } // Flushed returns the state of flushed. // If it's flushed, return true, or else it return false. func (wf *WriteFlusher) Flushed() bool { // BUG(stevvooe): Remove this method. Its use is inherently racy. Seems to // be used to detect whether or a response code has been issued or not. // Another hook should be used instead. var flushed bool select { case <-wf.flushed: flushed = true default: } return flushed } // Close closes the write flusher, disallowing any further writes to the // target. After the flusher is closed, all calls to write or flush will // result in an error. func (wf *WriteFlusher) Close() error { wf.closeLock.Lock() defer wf.closeLock.Unlock() select { case <-wf.closed: return errWriteFlusherClosed default: close(wf.closed) } return nil } // NewWriteFlusher returns a new WriteFlusher. func NewWriteFlusher(w io.Writer) *WriteFlusher { var fl flusher if f, ok := w.(flusher); ok { fl = f } else { fl = &NopFlusher{} } return &WriteFlusher{w: w, flusher: fl, closed: make(chan struct{}), flushed: make(chan struct{})} } ================================================ FILE: vendor/go.podman.io/storage/pkg/ioutils/writers.go ================================================ package ioutils import "io" // NopWriter represents a type which write operation is nop. type NopWriter struct{} func (*NopWriter) Write(buf []byte) (int, error) { return len(buf), nil } type nopWriteCloser struct { io.Writer } func (w *nopWriteCloser) Close() error { return nil } // NopWriteCloser returns a nopWriteCloser. func NopWriteCloser(w io.Writer) io.WriteCloser { return &nopWriteCloser{w} } // NopFlusher represents a type which flush operation is nop. type NopFlusher struct{} // Flush is a nop operation. func (f *NopFlusher) Flush() {} type writeCloserWrapper struct { io.Writer closer func() error } func (r *writeCloserWrapper) Close() error { return r.closer() } // NewWriteCloserWrapper returns a new io.WriteCloser. func NewWriteCloserWrapper(w io.Writer, closer func() error) io.WriteCloser { return &writeCloserWrapper{ Writer: w, closer: closer, } } // WriteCounter wraps a concrete io.Writer and hold a count of the number // of bytes written to the writer during a "session". // This can be convenient when write return is masked // (e.g., json.Encoder.Encode()) type WriteCounter struct { Count int64 Writer io.Writer } // NewWriteCounter returns a new WriteCounter. func NewWriteCounter(w io.Writer) *WriteCounter { return &WriteCounter{ Writer: w, } } func (wc *WriteCounter) Write(p []byte) (int, error) { count, err := wc.Writer.Write(p) wc.Count += int64(count) return count, err } ================================================ FILE: vendor/go.podman.io/storage/pkg/lockfile/lastwrite.go ================================================ package lockfile import ( "bytes" cryptorand "crypto/rand" "encoding/binary" "os" "sync/atomic" "time" ) // LastWrite is an opaque identifier of the last write to some *LockFile. // It can be used by users of a *LockFile to determine if the lock indicates changes // since the last check. // // Never construct a LastWrite manually; only accept it from *LockFile methods, and pass it back. type LastWrite struct { // Never modify fields of a LastWrite object; it has value semantics. state []byte // Contents of the lock file. } var lastWriterIDCounter uint64 // Private state for newLastWriterID const lastWriterIDSize = 64 // This must be the same as len(stringid.GenerateRandomID) // newLastWrite returns a new "last write" ID. // The value must be different on every call, and also differ from values // generated by other processes. func newLastWrite() LastWrite { // The ID is (PID, time, per-process counter, random) // PID + time represents both a unique process across reboots, // and a specific time within the process; the per-process counter // is an extra safeguard for in-process concurrency. // The random part disambiguates across process namespaces // (where PID values might collide), serves as a general-purpose // extra safety, _and_ is used to pad the output to lastWriterIDSize, // because other versions of this code exist and they don't work // efficiently if the size of the value changes. pid := os.Getpid() tm := time.Now().UnixNano() counter := atomic.AddUint64(&lastWriterIDCounter, 1) res := make([]byte, lastWriterIDSize) binary.LittleEndian.PutUint64(res[0:8], uint64(tm)) binary.LittleEndian.PutUint64(res[8:16], counter) binary.LittleEndian.PutUint32(res[16:20], uint32(pid)) if n, err := cryptorand.Read(res[20:lastWriterIDSize]); err != nil || n != lastWriterIDSize-20 { panic(err) // This shouldn't happen } return LastWrite{ state: res, } } // serialize returns bytes to write to the lock file to represent the specified write. func (lw LastWrite) serialize() []byte { if lw.state == nil { panic("LastWrite.serialize on an uninitialized object") } return lw.state } // Equals returns true if lw matches other func (lw LastWrite) equals(other LastWrite) bool { if lw.state == nil { panic("LastWrite.equals on an uninitialized object") } if other.state == nil { panic("LastWrite.equals with an uninitialized counterparty") } return bytes.Equal(lw.state, other.state) } // newLastWriteFromData returns a LastWrite corresponding to data that came from a previous LastWrite.serialize func newLastWriteFromData(serialized []byte) LastWrite { if serialized == nil { panic("newLastWriteFromData with nil data") } return LastWrite{ state: serialized, } } ================================================ FILE: vendor/go.podman.io/storage/pkg/lockfile/lockfile.go ================================================ package lockfile import ( "fmt" "os" "path/filepath" "sync" "time" "go.podman.io/storage/internal/rawfilelock" ) // A Locker represents a file lock where the file is used to cache an // identifier of the last party that made changes to whatever's being protected // by the lock. // // Deprecated: Refer directly to *LockFile, the provided implementation, instead. type Locker interface { // Acquire a writer lock. // The default unix implementation panics if: // - opening the lockfile failed // - tried to lock a read-only lock-file Lock() // Unlock the lock. // The default unix implementation panics if: // - unlocking an unlocked lock // - if the lock counter is corrupted Unlock() // Acquire a reader lock. RLock() // Touch records, for others sharing the lock, that the caller was the // last writer. It should only be called with the lock held. // // Deprecated: Use *LockFile.RecordWrite. Touch() error // Modified() checks if the most recent writer was a party other than the // last recorded writer. It should only be called with the lock held. // Deprecated: Use *LockFile.ModifiedSince. Modified() (bool, error) // TouchedSince() checks if the most recent writer modified the file (likely using Touch()) after the specified time. TouchedSince(when time.Time) bool // IsReadWrite() checks if the lock file is read-write IsReadWrite() bool // AssertLocked() can be used by callers that _know_ that they hold the lock (for reading or writing), for sanity checking. // It might do nothing at all, or it may panic if the caller is not the owner of this lock. AssertLocked() // AssertLockedForWriting() can be used by callers that _know_ that they hold the lock locked for writing, for sanity checking. // It might do nothing at all, or it may panic if the caller is not the owner of this lock for writing. AssertLockedForWriting() } // LockFile represents a file lock where the file is used to cache an // identifier of the last party that made changes to whatever's being protected // by the lock. // // It MUST NOT be created manually. Use GetLockFile or GetROLockFile instead. type LockFile struct { // The following fields are only set when constructing *LockFile, and must never be modified afterwards. // They are safe to access without any other locking. file string ro bool // rwMutex serializes concurrent reader-writer acquisitions in the same process space rwMutex *sync.RWMutex // stateMutex is used to synchronize concurrent accesses to the state below stateMutex *sync.Mutex counter int64 lw LastWrite // A global value valid as of the last .Touch() or .Modified() lockType rawfilelock.LockType locked bool // The following fields are only modified on transitions between counter == 0 / counter != 0. // Thus, they can be safely accessed by users _that currently hold the LockFile_ without locking. // In other cases, they need to be protected using stateMutex. fd rawfilelock.FileHandle } var ( lockFiles map[string]*LockFile lockFilesLock sync.Mutex ) // GetLockFile opens a read-write lock file, creating it if necessary. The // *LockFile object may already be locked if the path has already been requested // by the current process. func GetLockFile(path string) (*LockFile, error) { return getLockfile(path, false) } // GetLockfile opens a read-write lock file, creating it if necessary. The // Locker object may already be locked if the path has already been requested // by the current process. // // Deprecated: Use GetLockFile func GetLockfile(path string) (Locker, error) { return GetLockFile(path) } // GetROLockFile opens a read-only lock file, creating it if necessary. The // *LockFile object may already be locked if the path has already been requested // by the current process. func GetROLockFile(path string) (*LockFile, error) { return getLockfile(path, true) } // GetROLockfile opens a read-only lock file, creating it if necessary. The // Locker object may already be locked if the path has already been requested // by the current process. // // Deprecated: Use GetROLockFile func GetROLockfile(path string) (Locker, error) { return GetROLockFile(path) } // Lock locks the lockfile as a writer. Panic if the lock is a read-only one. func (l *LockFile) Lock() { if l.ro { panic("can't take write lock on read-only lock file") } l.lock(rawfilelock.WriteLock) } // RLock locks the lockfile as a reader. func (l *LockFile) RLock() { l.lock(rawfilelock.ReadLock) } // TryLock attempts to lock the lockfile as a writer. Panic if the lock is a read-only one. func (l *LockFile) TryLock() error { if l.ro { panic("can't take write lock on read-only lock file") } return l.tryLock(rawfilelock.WriteLock) } // TryRLock attempts to lock the lockfile as a reader. func (l *LockFile) TryRLock() error { return l.tryLock(rawfilelock.ReadLock) } // Unlock unlocks the lockfile. func (l *LockFile) Unlock() { l.stateMutex.Lock() if !l.locked { // Panic when unlocking an unlocked lock. That's a violation // of the lock semantics and will reveal such. panic("calling Unlock on unlocked lock") } l.counter-- if l.counter < 0 { // Panic when the counter is negative. There is no way we can // recover from a corrupted lock and we need to protect the // storage from corruption. panic(fmt.Sprintf("lock %q has been unlocked too often", l.file)) } if l.counter == 0 { // We should only release the lock when the counter is 0 to // avoid releasing read-locks too early; a given process may // acquire a read lock multiple times. l.locked = false // Close the file descriptor on the last unlock, releasing the // file lock. rawfilelock.UnlockAndCloseHandle(l.fd) } if l.lockType == rawfilelock.ReadLock { l.rwMutex.RUnlock() } else { l.rwMutex.Unlock() } l.stateMutex.Unlock() } func (l *LockFile) AssertLocked() { // DO NOT provide a variant that returns the value of l.locked. // // If the caller does not hold the lock, l.locked might nevertheless be true because another goroutine does hold it, and // we can’t tell the difference. // // Hence, this “AssertLocked” method, which exists only for sanity checks. // Don’t even bother with l.stateMutex: The caller is expected to hold the lock, and in that case l.locked is constant true // with no possible writers. // If the caller does not hold the lock, we are violating the locking/memory model anyway, and accessing the data // without the lock is more efficient for callers, and potentially more visible to lock analysers for incorrect callers. if !l.locked { panic("internal error: lock is not held by the expected owner") } } func (l *LockFile) AssertLockedForWriting() { // DO NOT provide a variant that returns the current lock state. // // The same caveats as for AssertLocked apply equally. l.AssertLocked() // Like AssertLocked, don’t even bother with l.stateMutex. if l.lockType == rawfilelock.ReadLock { panic("internal error: lock is not held for writing") } } // ModifiedSince checks if the lock has been changed since a provided LastWrite value, // and returns the one to record instead. // // If ModifiedSince reports no modification, the previous LastWrite value // is still valid and can continue to be used. // // If this function fails, the LastWriter value of the lock is indeterminate; // the caller should fail and keep using the previously-recorded LastWrite value, // so that it continues failing until the situation is resolved. Similarly, // it should only update the recorded LastWrite value after processing the update: // // lw2, modified, err := state.lock.ModifiedSince(state.lastWrite) // if err != nil { /* fail */ } // state.lastWrite = lw2 // if modified { // if err := reload(); err != nil { /* fail */ } // state.lastWrite = lw2 // } // // The caller must hold the lock (for reading or writing). func (l *LockFile) ModifiedSince(previous LastWrite) (LastWrite, bool, error) { l.AssertLocked() currentLW, err := l.GetLastWrite() if err != nil { return LastWrite{}, false, err } modified := !previous.equals(currentLW) return currentLW, modified, nil } // Modified indicates if the lockfile has been updated since the last time it // was loaded. // NOTE: Unlike ModifiedSince, this returns true the first time it is called on a *LockFile. // Callers cannot, in general, rely on this, because that might have happened for some other // owner of the same *LockFile who created it previously. // // Deprecated: Use *LockFile.ModifiedSince. func (l *LockFile) Modified() (bool, error) { l.stateMutex.Lock() if !l.locked { panic("attempted to check last-writer in lockfile without locking it first") } defer l.stateMutex.Unlock() oldLW := l.lw // Note that this is called with stateMutex held; that’s fine because ModifiedSince doesn’t need to lock it. currentLW, modified, err := l.ModifiedSince(oldLW) if err != nil { return true, err } l.lw = currentLW return modified, nil } // Touch updates the lock file with to record that the current lock holder has modified the lock-protected data. // // Deprecated: Use *LockFile.RecordWrite. func (l *LockFile) Touch() error { lw, err := l.RecordWrite() if err != nil { return err } l.stateMutex.Lock() if !l.locked || (l.lockType == rawfilelock.ReadLock) { panic("attempted to update last-writer in lockfile without the write lock") } defer l.stateMutex.Unlock() l.lw = lw return nil } // IsReadWrite indicates if the lock file is a read-write lock. func (l *LockFile) IsReadWrite() bool { return !l.ro } // getLockFile returns a *LockFile object, possibly (depending on the platform) // working inter-process, and associated with the specified path. // // If ro, the lock is a read-write lock and the returned *LockFile should correspond to the // “lock for reading” (shared) operation; otherwise, the lock is either an exclusive lock, // or a read-write lock and *LockFile should correspond to the “lock for writing” (exclusive) operation. // // WARNING: // - The lock may or MAY NOT be inter-process. // - There may or MAY NOT be an actual object on the filesystem created for the specified path. // - Even if ro, the lock MAY be exclusive. func getLockfile(path string, ro bool) (*LockFile, error) { lockFilesLock.Lock() defer lockFilesLock.Unlock() if lockFiles == nil { lockFiles = make(map[string]*LockFile) } cleanPath, err := filepath.Abs(path) if err != nil { return nil, fmt.Errorf("ensuring that path %q is an absolute path: %w", path, err) } if lockFile, ok := lockFiles[cleanPath]; ok { if ro && lockFile.IsReadWrite() { return nil, fmt.Errorf("lock %q is not a read-only lock", cleanPath) } if !ro && !lockFile.IsReadWrite() { return nil, fmt.Errorf("lock %q is not a read-write lock", cleanPath) } return lockFile, nil } lockFile, err := createLockFileForPath(cleanPath, ro) // platform-dependent LockFile if err != nil { return nil, err } lockFiles[cleanPath] = lockFile return lockFile, nil } // openLock opens a lock file at the specified path, creating the parent directory if it does not exist. func openLock(path string, readOnly bool) (rawfilelock.FileHandle, error) { fd, err := rawfilelock.OpenLock(path, readOnly) if err == nil { return fd, nil } // the directory of the lockfile seems to be removed, try to create it if os.IsNotExist(err) { if err := os.MkdirAll(filepath.Dir(path), 0o700); err != nil { return fd, fmt.Errorf("creating lock file directory: %w", err) } return openLock(path, readOnly) } return fd, &os.PathError{Op: "open", Path: path, Err: err} } // createLockFileForPath returns new *LockFile object, possibly (depending on the platform) // working inter-process and associated with the specified path. // // This function will be called at most once for each path value within a single process. // // If ro, the lock is a read-write lock and the returned *LockFile should correspond to the // “lock for reading” (shared) operation; otherwise, the lock is either an exclusive lock, // or a read-write lock and *LockFile should correspond to the “lock for writing” (exclusive) operation. // // WARNING: // - The lock may or MAY NOT be inter-process. // - There may or MAY NOT be an actual object on the filesystem created for the specified path. // - Even if ro, the lock MAY be exclusive. func createLockFileForPath(path string, ro bool) (*LockFile, error) { // Check if we can open the lock. fd, err := openLock(path, ro) if err != nil { return nil, err } rawfilelock.UnlockAndCloseHandle(fd) lType := rawfilelock.WriteLock if ro { lType = rawfilelock.ReadLock } return &LockFile{ file: path, ro: ro, rwMutex: &sync.RWMutex{}, stateMutex: &sync.Mutex{}, lw: newLastWrite(), // For compatibility, the first call of .Modified() will always report a change. lockType: lType, locked: false, }, nil } // lock locks the lockfile via syscall based on the specified type and // command. func (l *LockFile) lock(lType rawfilelock.LockType) { if lType == rawfilelock.ReadLock { l.rwMutex.RLock() } else { l.rwMutex.Lock() } l.stateMutex.Lock() defer l.stateMutex.Unlock() if l.counter == 0 { // If we're the first reference on the lock, we need to open the file again. fd, err := openLock(l.file, l.ro) if err != nil { panic(err) } l.fd = fd // Optimization: only use the (expensive) syscall when // the counter is 0. In this case, we're either the first // reader lock or a writer lock. if err := rawfilelock.LockFile(l.fd, lType); err != nil { panic(err) } l.lockType = lType l.locked = true } l.counter++ } // lock locks the lockfile via syscall based on the specified type and // command. func (l *LockFile) tryLock(lType rawfilelock.LockType) error { var success bool var rwMutexUnlocker func() if lType == rawfilelock.ReadLock { success = l.rwMutex.TryRLock() rwMutexUnlocker = l.rwMutex.RUnlock } else { success = l.rwMutex.TryLock() rwMutexUnlocker = l.rwMutex.Unlock } if !success { return fmt.Errorf("resource temporarily unavailable") } if !l.stateMutex.TryLock() { rwMutexUnlocker() return fmt.Errorf("resource temporarily unavailable") } defer l.stateMutex.Unlock() if l.counter == 0 { // If we're the first reference on the lock, we need to open the file again. fd, err := openLock(l.file, l.ro) if err != nil { rwMutexUnlocker() return err } l.fd = fd // Optimization: only use the (expensive) syscall when // the counter is 0. In this case, we're either the first // reader lock or a writer lock. if err = rawfilelock.TryLockFile(l.fd, lType); err != nil { rawfilelock.CloseHandle(fd) rwMutexUnlocker() return err } l.lockType = lType l.locked = true } l.counter++ return nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/lockfile/lockfile_unix.go ================================================ //go:build !windows package lockfile import ( "time" "go.podman.io/storage/pkg/system" "golang.org/x/sys/unix" ) // GetLastWrite returns a LastWrite value corresponding to current state of the lock. // This is typically called before (_not after_) loading the state when initializing a consumer // of the data protected by the lock. // During the lifetime of the consumer, the consumer should usually call ModifiedSince instead. // // The caller must hold the lock (for reading or writing). func (l *LockFile) GetLastWrite() (LastWrite, error) { l.AssertLocked() contents := make([]byte, lastWriterIDSize) n, err := unix.Pread(int(l.fd), contents, 0) if err != nil { return LastWrite{}, err } // It is important to handle the partial read case, because // the initial size of the lock file is zero, which is a valid // state (no writes yet) contents = contents[:n] return newLastWriteFromData(contents), nil } // RecordWrite updates the lock with a new LastWrite value, and returns the new value. // // If this function fails, the LastWriter value of the lock is indeterminate; // the caller should keep using the previously-recorded LastWrite value, // and possibly detecting its own modification as an external one: // // lw, err := state.lock.RecordWrite() // if err != nil { /* fail */ } // state.lastWrite = lw // // The caller must hold the lock for writing. func (l *LockFile) RecordWrite() (LastWrite, error) { l.AssertLockedForWriting() lw := newLastWrite() lockContents := lw.serialize() n, err := unix.Pwrite(int(l.fd), lockContents, 0) if err != nil { return LastWrite{}, err } if n != len(lockContents) { return LastWrite{}, unix.ENOSPC } return lw, nil } // TouchedSince indicates if the lock file has been touched since the specified time func (l *LockFile) TouchedSince(when time.Time) bool { st, err := system.Fstat(int(l.fd)) if err != nil { return true } mtim := st.Mtim() touched := time.Unix(mtim.Unix()) return when.Before(touched) } ================================================ FILE: vendor/go.podman.io/storage/pkg/lockfile/lockfile_windows.go ================================================ //go:build windows package lockfile import ( "os" "time" "golang.org/x/sys/windows" ) const ( reserved = 0 allBytes = ^uint32(0) ) // GetLastWrite returns a LastWrite value corresponding to current state of the lock. // This is typically called before (_not after_) loading the state when initializing a consumer // of the data protected by the lock. // During the lifetime of the consumer, the consumer should usually call ModifiedSince instead. // // The caller must hold the lock (for reading or writing) before this function is called. func (l *LockFile) GetLastWrite() (LastWrite, error) { l.AssertLocked() contents := make([]byte, lastWriterIDSize) ol := new(windows.Overlapped) var n uint32 err := windows.ReadFile(windows.Handle(l.fd), contents, &n, ol) if err != nil && err != windows.ERROR_HANDLE_EOF { return LastWrite{}, err } // It is important to handle the partial read case, because // the initial size of the lock file is zero, which is a valid // state (no writes yet) contents = contents[:n] return newLastWriteFromData(contents), nil } // RecordWrite updates the lock with a new LastWrite value, and returns the new value. // // If this function fails, the LastWriter value of the lock is indeterminate; // the caller should keep using the previously-recorded LastWrite value, // and possibly detecting its own modification as an external one: // // lw, err := state.lock.RecordWrite() // if err != nil { /* fail */ } // state.lastWrite = lw // // The caller must hold the lock for writing. func (l *LockFile) RecordWrite() (LastWrite, error) { l.AssertLockedForWriting() lw := newLastWrite() lockContents := lw.serialize() ol := new(windows.Overlapped) var n uint32 err := windows.WriteFile(windows.Handle(l.fd), lockContents, &n, ol) if err != nil { return LastWrite{}, err } if int(n) != len(lockContents) { return LastWrite{}, windows.ERROR_DISK_FULL } return lw, nil } // TouchedSince indicates if the lock file has been touched since the specified time func (l *LockFile) TouchedSince(when time.Time) bool { stat, err := os.Stat(l.file) if err != nil { return true } return when.Before(stat.ModTime()) } ================================================ FILE: vendor/go.podman.io/storage/pkg/longpath/longpath.go ================================================ // longpath introduces some constants and helper functions for handling long paths // in Windows, which are expected to be prepended with `\\?\` and followed by either // a drive letter, a UNC server\share, or a volume identifier. package longpath import ( "strings" ) // Prefix is the longpath prefix for Windows file paths. const Prefix = `\\?\` // AddPrefix will add the Windows long path prefix to the path provided if // it does not already have it. func AddPrefix(path string) string { if !strings.HasPrefix(path, Prefix) { if strings.HasPrefix(path, `\\`) { // This is a UNC path, so we need to add 'UNC' to the path as well. path = Prefix + `UNC` + path[1:] } else { path = Prefix + path } } return path } ================================================ FILE: vendor/go.podman.io/storage/pkg/loopback/attach_loopback.go ================================================ //go:build linux package loopback import ( "errors" "fmt" "io/fs" "os" "syscall" "github.com/sirupsen/logrus" "golang.org/x/sys/unix" ) // Loopback related errors var ( ErrAttachLoopbackDevice = errors.New("loopback attach failed") ErrGetLoopbackBackingFile = errors.New("unable to get loopback backing file") ErrSetCapacity = errors.New("unable set loopback capacity") ) func stringToLoopName(src string) [LoNameSize]uint8 { var dst [LoNameSize]uint8 copy(dst[:], src[:]) return dst } func getNextFreeLoopbackIndex() (int, error) { f, err := os.OpenFile("/dev/loop-control", os.O_RDONLY, 0o644) if err != nil { return 0, err } defer f.Close() index, err := ioctlLoopCtlGetFree(f.Fd()) if index < 0 { index = 0 } return index, err } func openNextAvailableLoopback(sparseName string, sparseFile *os.File) (*os.File, error) { // Read information about the loopback file. var st syscall.Stat_t if err := syscall.Fstat(int(sparseFile.Fd()), &st); err != nil { logrus.Errorf("Reading information about loopback file %s: %v", sparseName, err) return nil, ErrAttachLoopbackDevice } // upper bound to avoid infinite loop remaining := 1000 // Start looking for a free /dev/loop for { if remaining == 0 { logrus.Errorf("No free loopback devices available") return nil, ErrAttachLoopbackDevice } remaining-- index, err := getNextFreeLoopbackIndex() if err != nil { logrus.Debugf("Error retrieving the next available loopback: %s", err) return nil, err } target := fmt.Sprintf("/dev/loop%d", index) // OpenFile adds O_CLOEXEC loopFile, err := os.OpenFile(target, os.O_RDWR, 0o644) if err != nil { // The kernel returns ENXIO when opening a device that is in the "deleting" or "rundown" state, so // just treat ENXIO as if the device does not exist. if errors.Is(err, fs.ErrNotExist) || errors.Is(err, unix.ENXIO) { // Another process could have taken the loopback device in the meantime. So repeat // the process with the next loopback device. continue } logrus.Errorf("Opening loopback device: %s", err) return nil, ErrAttachLoopbackDevice } fi, err := loopFile.Stat() if err != nil { loopFile.Close() logrus.Errorf("Stat loopback device: %s", err) return nil, ErrAttachLoopbackDevice } if fi.Mode()&os.ModeDevice != os.ModeDevice { loopFile.Close() logrus.Errorf("Loopback device %s is not a block device.", target) continue } // Try to attach to the loop file if err := ioctlLoopSetFd(loopFile.Fd(), sparseFile.Fd()); err != nil { loopFile.Close() // If the error is EBUSY, then try the next loopback if err == syscall.EBUSY { continue } logrus.Errorf("Cannot set up loopback device %s: %s", target, err) return nil, ErrAttachLoopbackDevice } // Check if the loopback driver and underlying filesystem agree on the loopback file's // device and inode numbers. dev, ino, err := getLoopbackBackingFile(loopFile) if err != nil { logrus.Errorf("Getting loopback backing file: %s", err) return nil, ErrGetLoopbackBackingFile } if dev != uint64(st.Dev) || ino != st.Ino { //nolint:unconvert logrus.Errorf("Loopback device and filesystem disagree on device/inode for %q: %#x(%d):%#x(%d) vs %#x(%d):%#x(%d)", sparseName, dev, dev, ino, ino, st.Dev, st.Dev, st.Ino, st.Ino) } return loopFile, nil } } // AttachLoopDevice attaches the given sparse file to the next // available loopback device. It returns an opened *os.File. func AttachLoopDevice(sparseName string) (loop *os.File, err error) { return attachLoopDevice(sparseName, false) } // AttachLoopDeviceRO attaches the given sparse file opened read-only to // the next available loopback device. It returns an opened *os.File. func AttachLoopDeviceRO(sparseName string) (loop *os.File, err error) { return attachLoopDevice(sparseName, true) } func attachLoopDevice(sparseName string, readonly bool) (loop *os.File, err error) { var sparseFile *os.File // OpenFile adds O_CLOEXEC if readonly { sparseFile, err = os.OpenFile(sparseName, os.O_RDONLY, 0o644) } else { sparseFile, err = os.OpenFile(sparseName, os.O_RDWR, 0o644) } if err != nil { logrus.Errorf("Opening sparse file: %v", err) return nil, ErrAttachLoopbackDevice } defer sparseFile.Close() loopFile, err := openNextAvailableLoopback(sparseName, sparseFile) if err != nil { return nil, err } // Set the status of the loopback device loopInfo := &loopInfo64{ loFileName: stringToLoopName(loopFile.Name()), loOffset: 0, loFlags: LoFlagsAutoClear, } if err := ioctlLoopSetStatus64(loopFile.Fd(), loopInfo); err != nil { logrus.Errorf("Cannot set up loopback device info: %s", err) // If the call failed, then free the loopback device if err := ioctlLoopClrFd(loopFile.Fd()); err != nil { logrus.Error("While cleaning up the loopback device") } loopFile.Close() return nil, ErrAttachLoopbackDevice } return loopFile, nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/loopback/ioctl.go ================================================ //go:build linux package loopback import ( "syscall" "unsafe" ) func ioctlLoopCtlGetFree(fd uintptr) (int, error) { index, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, LoopCtlGetFree, 0) if err != 0 { return 0, err } return int(index), nil } func ioctlLoopSetFd(loopFd, sparseFd uintptr) error { if _, _, err := syscall.Syscall(syscall.SYS_IOCTL, loopFd, LoopSetFd, sparseFd); err != 0 { return err } return nil } func ioctlLoopSetStatus64(loopFd uintptr, loopInfo *loopInfo64) error { if _, _, err := syscall.Syscall(syscall.SYS_IOCTL, loopFd, LoopSetStatus64, uintptr(unsafe.Pointer(loopInfo))); err != 0 { return err } return nil } func ioctlLoopClrFd(loopFd uintptr) error { if _, _, err := syscall.Syscall(syscall.SYS_IOCTL, loopFd, LoopClrFd, 0); err != 0 { return err } return nil } func ioctlLoopGetStatus64(loopFd uintptr) (*loopInfo64, error) { loopInfo := &loopInfo64{} if _, _, err := syscall.Syscall(syscall.SYS_IOCTL, loopFd, LoopGetStatus64, uintptr(unsafe.Pointer(loopInfo))); err != 0 { return nil, err } return loopInfo, nil } func ioctlLoopSetCapacity(loopFd uintptr, value int) error { if _, _, err := syscall.Syscall(syscall.SYS_IOCTL, loopFd, LoopSetCapacity, uintptr(value)); err != 0 { return err } return nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/loopback/loop_wrapper.go ================================================ //go:build linux package loopback import ( "golang.org/x/sys/unix" ) type loopInfo64 struct { loDevice uint64 /* ioctl r/o */ loInode uint64 /* ioctl r/o */ loRdevice uint64 /* ioctl r/o */ loOffset uint64 loSizelimit uint64 /* bytes, 0 == max available */ loNumber uint32 /* ioctl r/o */ loEncryptType uint32 loEncryptKeySize uint32 /* ioctl w/o */ loFlags uint32 /* ioctl r/o */ loFileName [LoNameSize]uint8 loCryptName [LoNameSize]uint8 loEncryptKey [LoKeySize]uint8 /* ioctl w/o */ loInit [2]uint64 } // IOCTL consts const ( LoopSetFd = unix.LOOP_SET_FD LoopCtlGetFree = unix.LOOP_CTL_GET_FREE LoopGetStatus64 = unix.LOOP_GET_STATUS64 LoopSetStatus64 = unix.LOOP_SET_STATUS64 LoopClrFd = unix.LOOP_CLR_FD LoopSetCapacity = unix.LOOP_SET_CAPACITY ) // LOOP consts. const ( LoFlagsAutoClear = unix.LO_FLAGS_AUTOCLEAR LoFlagsReadOnly = unix.LO_FLAGS_READ_ONLY LoFlagsPartScan = unix.LO_FLAGS_PARTSCAN LoKeySize = unix.LO_KEY_SIZE LoNameSize = unix.LO_NAME_SIZE ) ================================================ FILE: vendor/go.podman.io/storage/pkg/loopback/loopback.go ================================================ //go:build linux package loopback import ( "fmt" "os" "syscall" "github.com/sirupsen/logrus" ) func getLoopbackBackingFile(file *os.File) (uint64, uint64, error) { loopInfo, err := ioctlLoopGetStatus64(file.Fd()) if err != nil { logrus.Errorf("Get loopback backing file: %v", err) return 0, 0, ErrGetLoopbackBackingFile } return loopInfo.loDevice, loopInfo.loInode, nil } // SetCapacity reloads the size for the loopback device. func SetCapacity(file *os.File) error { if err := ioctlLoopSetCapacity(file.Fd(), 0); err != nil { logrus.Errorf("loopbackSetCapacity: %s", err) return ErrSetCapacity } return nil } // FindLoopDeviceFor returns a loopback device file for the specified file which // is backing file of a loop back device. func FindLoopDeviceFor(file *os.File) *os.File { stat, err := file.Stat() if err != nil { return nil } targetInode := stat.Sys().(*syscall.Stat_t).Ino targetDevice := uint64(stat.Sys().(*syscall.Stat_t).Dev) //nolint:unconvert for i := 0; true; i++ { path := fmt.Sprintf("/dev/loop%d", i) file, err := os.OpenFile(path, os.O_RDWR, 0) if err != nil { if os.IsNotExist(err) { return nil } // Ignore all errors until the first not-exist // we want to continue looking for the file continue } dev, inode, err := getLoopbackBackingFile(file) if err == nil && dev == targetDevice && inode == targetInode { return file } file.Close() } return nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/loopback/loopback_unsupported.go ================================================ package loopback ================================================ FILE: vendor/go.podman.io/storage/pkg/mount/flags.go ================================================ package mount import ( "fmt" "strings" ) var flags = map[string]struct { clear bool flag int }{ "defaults": {false, 0}, "ro": {false, RDONLY}, "rw": {true, RDONLY}, "suid": {true, NOSUID}, "nosuid": {false, NOSUID}, "dev": {true, NODEV}, "nodev": {false, NODEV}, "exec": {true, NOEXEC}, "noexec": {false, NOEXEC}, "sync": {false, SYNCHRONOUS}, "async": {true, SYNCHRONOUS}, "dirsync": {false, DIRSYNC}, "remount": {false, REMOUNT}, "mand": {false, MANDLOCK}, "nomand": {true, MANDLOCK}, "atime": {true, NOATIME}, "noatime": {false, NOATIME}, "diratime": {true, NODIRATIME}, "nodiratime": {false, NODIRATIME}, "bind": {false, BIND}, "rbind": {false, RBIND}, "unbindable": {false, UNBINDABLE}, "runbindable": {false, RUNBINDABLE}, "private": {false, PRIVATE}, "rprivate": {false, RPRIVATE}, "shared": {false, SHARED}, "rshared": {false, RSHARED}, "slave": {false, SLAVE}, "rslave": {false, RSLAVE}, "relatime": {false, RELATIME}, "norelatime": {true, RELATIME}, "strictatime": {false, STRICTATIME}, "nostrictatime": {true, STRICTATIME}, } var validFlags = map[string]bool{ "": true, "size": true, "mode": true, "uid": true, "gid": true, "nr_inodes": true, "nr_blocks": true, "mpol": true, } var propagationFlags = map[string]bool{ "bind": true, "rbind": true, "unbindable": true, "runbindable": true, "private": true, "rprivate": true, "shared": true, "rshared": true, "slave": true, "rslave": true, } // MergeTmpfsOptions merge mount options to make sure there is no duplicate. func MergeTmpfsOptions(options []string) ([]string, error) { // We use collisions maps to remove duplicates. // For flag, the key is the flag value (the key for propagation flag is -1) // For data=value, the key is the data flagCollisions := map[int]bool{} dataCollisions := map[string]bool{} var newOptions []string // We process in reverse order for i := len(options) - 1; i >= 0; i-- { option := options[i] if option == "defaults" { continue } if f, ok := flags[option]; ok && f.flag != 0 { // There is only one propagation mode key := f.flag if propagationFlags[option] { key = -1 } // Check to see if there is collision for flag if !flagCollisions[key] { // We prepend the option and add to collision map newOptions = append([]string{option}, newOptions...) flagCollisions[key] = true } continue } opt, _, ok := strings.Cut(option, "=") if !ok || !validFlags[opt] { return nil, fmt.Errorf("invalid tmpfs option %q", opt) } if !dataCollisions[opt] { // We prepend the option and add to collision map newOptions = append([]string{option}, newOptions...) dataCollisions[opt] = true } } return newOptions, nil } // ParseOptions parses fstab type mount options into mount() flags // and device specific data func ParseOptions(options string) (int, string) { var ( flag int data []string ) for o := range strings.SplitSeq(options, ",") { // If the option does not exist in the flags table or the flag // is not supported on the platform, // then it is a data value for a specific fs type if f, exists := flags[o]; exists && f.flag != 0 { if f.clear { flag &= ^f.flag } else { flag |= f.flag } } else { data = append(data, o) } } return flag, strings.Join(data, ",") } // ParseTmpfsOptions parse fstab type mount options into flags and data func ParseTmpfsOptions(options string) (int, string, error) { flags, data := ParseOptions(options) for o := range strings.SplitSeq(data, ",") { opt, _, _ := strings.Cut(o, "=") if !validFlags[opt] { return 0, "", fmt.Errorf("invalid tmpfs option %q", opt) } } return flags, data, nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/mount/flags_freebsd.go ================================================ package mount import ( "golang.org/x/sys/unix" ) const ( // RDONLY will mount the file system read-only. RDONLY = unix.MNT_RDONLY // NOSUID will not allow set-user-identifier or set-group-identifier bits to // take effect. NOSUID = unix.MNT_NOSUID // NOEXEC will not allow execution of any binaries on the mounted file system. NOEXEC = unix.MNT_NOEXEC // SYNCHRONOUS will allow I/O to the file system to be done synchronously. SYNCHRONOUS = unix.MNT_SYNCHRONOUS // REMOUNT will attempt to remount an already-mounted file system. This is // commonly used to change the mount flags for a file system, especially to // make a readonly file system writeable. It does not change device or mount // point. REMOUNT = unix.MNT_UPDATE // NOATIME will not update the file access time when reading from a file. NOATIME = unix.MNT_NOATIME mntDetach = unix.MNT_FORCE NODIRATIME = 0 NODEV = 0 DIRSYNC = 0 MANDLOCK = 0 BIND = 0 RBIND = 0 UNBINDABLE = 0 RUNBINDABLE = 0 PRIVATE = 0 RPRIVATE = 0 SLAVE = 0 RSLAVE = 0 SHARED = 0 RSHARED = 0 RELATIME = 0 STRICTATIME = 0 ) ================================================ FILE: vendor/go.podman.io/storage/pkg/mount/flags_linux.go ================================================ package mount import ( "golang.org/x/sys/unix" ) const ( // RDONLY will mount the file system read-only. RDONLY = unix.MS_RDONLY // NOSUID will not allow set-user-identifier or set-group-identifier bits to // take effect. NOSUID = unix.MS_NOSUID // NODEV will not interpret character or block special devices on the file // system. NODEV = unix.MS_NODEV // NOEXEC will not allow execution of any binaries on the mounted file system. NOEXEC = unix.MS_NOEXEC // SYNCHRONOUS will allow I/O to the file system to be done synchronously. SYNCHRONOUS = unix.MS_SYNCHRONOUS // DIRSYNC will force all directory updates within the file system to be done // synchronously. This affects the following system calls: create, link, // unlink, symlink, mkdir, rmdir, mknod and rename. DIRSYNC = unix.MS_DIRSYNC // REMOUNT will attempt to remount an already-mounted file system. This is // commonly used to change the mount flags for a file system, especially to // make a readonly file system writeable. It does not change device or mount // point. REMOUNT = unix.MS_REMOUNT // MANDLOCK will force mandatory locks on a filesystem. MANDLOCK = unix.MS_MANDLOCK // NOATIME will not update the file access time when reading from a file. NOATIME = unix.MS_NOATIME // NODIRATIME will not update the directory access time. NODIRATIME = unix.MS_NODIRATIME // BIND remounts a subtree somewhere else. BIND = unix.MS_BIND // RBIND remounts a subtree and all possible submounts somewhere else. RBIND = unix.MS_BIND | unix.MS_REC // UNBINDABLE creates a mount which cannot be cloned through a bind operation. UNBINDABLE = unix.MS_UNBINDABLE // RUNBINDABLE marks the entire mount tree as UNBINDABLE. RUNBINDABLE = unix.MS_UNBINDABLE | unix.MS_REC // PRIVATE creates a mount which carries no propagation abilities. PRIVATE = unix.MS_PRIVATE // RPRIVATE marks the entire mount tree as PRIVATE. RPRIVATE = unix.MS_PRIVATE | unix.MS_REC // SLAVE creates a mount which receives propagation from its master, but not // vice versa. SLAVE = unix.MS_SLAVE // RSLAVE marks the entire mount tree as SLAVE. RSLAVE = unix.MS_SLAVE | unix.MS_REC // SHARED creates a mount which provides the ability to create mirrors of // that mount such that mounts and unmounts within any of the mirrors // propagate to the other mirrors. SHARED = unix.MS_SHARED // RSHARED marks the entire mount tree as SHARED. RSHARED = unix.MS_SHARED | unix.MS_REC // RELATIME updates inode access times relative to modify or change time. RELATIME = unix.MS_RELATIME // STRICTATIME allows to explicitly request full atime updates. This makes // it possible for the kernel to default to relatime or noatime but still // allow userspace to override it. STRICTATIME = unix.MS_STRICTATIME mntDetach = unix.MNT_DETACH ) ================================================ FILE: vendor/go.podman.io/storage/pkg/mount/flags_unsupported.go ================================================ //go:build !linux && !freebsd package mount // These flags are unsupported. const ( BIND = 0 DIRSYNC = 0 MANDLOCK = 0 NOATIME = 0 NODEV = 0 NODIRATIME = 0 NOEXEC = 0 NOSUID = 0 UNBINDABLE = 0 RUNBINDABLE = 0 PRIVATE = 0 RPRIVATE = 0 SHARED = 0 RSHARED = 0 SLAVE = 0 RSLAVE = 0 RBIND = 0 RELATIME = 0 RELATIVE = 0 REMOUNT = 0 STRICTATIME = 0 SYNCHRONOUS = 0 RDONLY = 0 mntDetach = 0 ) ================================================ FILE: vendor/go.podman.io/storage/pkg/mount/mount.go ================================================ package mount import ( "cmp" "slices" "strconv" "strings" ) // mountError holds an error from a mount or unmount operation type mountError struct { op string source, target string flags uintptr data string err error } // Error returns a string representation of mountError func (e *mountError) Error() string { out := e.op + " " if e.source != "" { out += e.source + ":" + e.target } else { out += e.target } if e.flags != uintptr(0) { out += ", flags: 0x" + strconv.FormatUint(uint64(e.flags), 16) } if e.data != "" { out += ", data: " + e.data } out += ": " + e.err.Error() return out } // Cause returns the underlying cause of the error func (e *mountError) Cause() error { return e.err } // Unwrap returns the underlying cause of the error func (e *mountError) Unwrap() error { return e.err } // Mount will mount filesystem according to the specified configuration, on the // condition that the target path is *not* already mounted. Options must be // specified like the mount or fstab unix commands: "opt1=val1,opt2=val2". See // flags.go for supported option flags. func Mount(device, target, mType, options string) error { flag, data := ParseOptions(options) if flag&REMOUNT != REMOUNT { if mounted, err := Mounted(target); err != nil || mounted { return err } } return mount(device, target, mType, uintptr(flag), data) } // ForceMount will mount a filesystem according to the specified configuration, // *regardless* if the target path is not already mounted. Options must be // specified like the mount or fstab unix commands: "opt1=val1,opt2=val2". See // flags.go for supported option flags. func ForceMount(device, target, mType, options string) error { flag, data := ParseOptions(options) return mount(device, target, mType, uintptr(flag), data) } // Unmount lazily unmounts a filesystem on supported platforms, otherwise // does a normal unmount. func Unmount(target string) error { return unmount(target, mntDetach) } // RecursiveUnmount unmounts the target and all mounts underneath, starting with // the deepest mount first. func RecursiveUnmount(target string) error { mounts, err := GetMounts() if err != nil { return err } // Make the deepest mount be first slices.SortFunc(mounts, func(a, b *Info) int { return -cmp.Compare(len(a.Mountpoint), len(b.Mountpoint)) }) for i, m := range mounts { if !strings.HasPrefix(m.Mountpoint, target) { continue } if err := Unmount(m.Mountpoint); err != nil && i == len(mounts)-1 { return err // Ignore errors for submounts and continue trying to unmount others // The final unmount should fail if there are any submounts remaining } } return nil } // ForceUnmount lazily unmounts a filesystem on supported platforms, // otherwise does a normal unmount. // // Deprecated: please use Unmount instead, it is identical. func ForceUnmount(target string) error { return unmount(target, mntDetach) } ================================================ FILE: vendor/go.podman.io/storage/pkg/mount/mounter_freebsd.go ================================================ //go:build freebsd && cgo package mount /* #include #include #include #include #include #include */ import "C" import ( "fmt" "strings" "unsafe" ) func allocateIOVecs(options []string) []C.struct_iovec { out := make([]C.struct_iovec, len(options)) for i, option := range options { out[i].iov_base = unsafe.Pointer(C.CString(option)) out[i].iov_len = C.size_t(len(option) + 1) } return out } func mount(device, target, mType string, flag uintptr, data string) error { isNullFS := false options := []string{"fspath", target} if data != "" { for x := range strings.SplitSeq(data, ",") { if x == "bind" { isNullFS = true continue } name, val, _ := strings.Cut(x, "=") options = append(options, name) options = append(options, val) } } if isNullFS { options = append(options, "fstype", "nullfs", "target", device) } else { options = append(options, "fstype", mType, "from", device) } rawOptions := allocateIOVecs(options) for _, rawOption := range rawOptions { defer C.free(rawOption.iov_base) } if errno := C.nmount(&rawOptions[0], C.uint(len(options)), C.int(flag)); errno != 0 { reason := C.GoString(C.strerror(*C.__error())) return fmt.Errorf("failed to call nmount: %s", reason) } return nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/mount/mounter_linux.go ================================================ package mount import ( "golang.org/x/sys/unix" ) const ( // ptypes is the set propagation types. ptypes = unix.MS_SHARED | unix.MS_PRIVATE | unix.MS_SLAVE | unix.MS_UNBINDABLE // pflags is the full set valid flags for a change propagation call. pflags = ptypes | unix.MS_REC | unix.MS_SILENT // broflags is the combination of bind and read only broflags = unix.MS_BIND | unix.MS_RDONLY none = "none" ) // isremount returns true if either device name or flags identify a remount request, false otherwise. func isremount(device string, flags uintptr) bool { switch { // We treat device "" and "none" as a remount request to provide compatibility with // requests that don't explicitly set MS_REMOUNT such as those manipulating bind mounts. case flags&unix.MS_REMOUNT != 0, device == "", device == none: return true default: return false } } func mount(device, target, mType string, flags uintptr, data string) error { oflags := flags &^ ptypes if !isremount(device, flags) || data != "" { // Initial call applying all non-propagation flags for mount // or remount with changed data if err := unix.Mount(device, target, mType, oflags, data); err != nil { return &mountError{ op: "mount", source: device, target: target, flags: oflags, data: data, err: err, } } } if flags&ptypes != 0 { // Change the propagation type. if err := unix.Mount("", target, "", flags&pflags, ""); err != nil { return &mountError{ op: "remount", target: target, flags: flags & pflags, err: err, } } } if oflags&broflags == broflags { // Remount the bind to apply read only. if err := unix.Mount("", target, "", oflags|unix.MS_REMOUNT, ""); err != nil { return &mountError{ op: "remount-ro", target: target, flags: oflags | unix.MS_REMOUNT, err: err, } } } return nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/mount/mounter_unsupported.go ================================================ //go:build !linux && !(freebsd && cgo) package mount func mount(device, target, mType string, flag uintptr, data string) error { panic("Not implemented") } ================================================ FILE: vendor/go.podman.io/storage/pkg/mount/mountinfo.go ================================================ package mount import ( "github.com/moby/sys/mountinfo" ) type Info = mountinfo.Info var Mounted = mountinfo.Mounted func GetMounts() ([]*Info, error) { return mountinfo.GetMounts(nil) } ================================================ FILE: vendor/go.podman.io/storage/pkg/mount/mountinfo_linux.go ================================================ package mount import ( "fmt" "os" "github.com/moby/sys/mountinfo" ) func PidMountInfo(pid int) ([]*Info, error) { f, err := os.Open(fmt.Sprintf("/proc/%d/mountinfo", pid)) if err != nil { return nil, err } defer f.Close() return mountinfo.GetMountsFromReader(f, nil) } ================================================ FILE: vendor/go.podman.io/storage/pkg/mount/sharedsubtree_linux.go ================================================ package mount // MakeShared ensures a mounted filesystem has the SHARED mount option enabled. // See the supported options in flags.go for further reference. func MakeShared(mountPoint string) error { return ensureMountedAs(mountPoint, SHARED) } // MakeRShared ensures a mounted filesystem has the RSHARED mount option enabled. // See the supported options in flags.go for further reference. func MakeRShared(mountPoint string) error { return ensureMountedAs(mountPoint, RSHARED) } // MakePrivate ensures a mounted filesystem has the PRIVATE mount option enabled. // See the supported options in flags.go for further reference. func MakePrivate(mountPoint string) error { return ensureMountedAs(mountPoint, PRIVATE) } // MakeRPrivate ensures a mounted filesystem has the RPRIVATE mount option // enabled. See the supported options in flags.go for further reference. func MakeRPrivate(mountPoint string) error { return ensureMountedAs(mountPoint, RPRIVATE) } // MakeSlave ensures a mounted filesystem has the SLAVE mount option enabled. // See the supported options in flags.go for further reference. func MakeSlave(mountPoint string) error { return ensureMountedAs(mountPoint, SLAVE) } // MakeRSlave ensures a mounted filesystem has the RSLAVE mount option enabled. // See the supported options in flags.go for further reference. func MakeRSlave(mountPoint string) error { return ensureMountedAs(mountPoint, RSLAVE) } // MakeUnbindable ensures a mounted filesystem has the UNBINDABLE mount option // enabled. See the supported options in flags.go for further reference. func MakeUnbindable(mountPoint string) error { return ensureMountedAs(mountPoint, UNBINDABLE) } // MakeRUnbindable ensures a mounted filesystem has the RUNBINDABLE mount // option enabled. See the supported options in flags.go for further reference. func MakeRUnbindable(mountPoint string) error { return ensureMountedAs(mountPoint, RUNBINDABLE) } func ensureMountedAs(mnt string, flags int) error { mounted, err := Mounted(mnt) if err != nil { return err } if !mounted { if err := mount(mnt, mnt, "none", uintptr(BIND), ""); err != nil { return err } } return mount("", mnt, "none", uintptr(flags), "") } ================================================ FILE: vendor/go.podman.io/storage/pkg/mount/unmount_unix.go ================================================ //go:build !windows package mount import ( "time" "golang.org/x/sys/unix" ) func unmount(target string, flags int) error { var err error for range 50 { err = unix.Unmount(target, flags) switch err { case unix.EBUSY: time.Sleep(50 * time.Millisecond) continue case unix.EINVAL, nil: // Ignore "not mounted" error here. Note the same error // can be returned if flags are invalid, so this code // assumes that the flags value is always correct. return nil } break } return &mountError{ op: "umount", target: target, flags: uintptr(flags), err: err, } } ================================================ FILE: vendor/go.podman.io/storage/pkg/mount/unmount_unsupported.go ================================================ //go:build windows package mount func unmount(target string, flag int) error { panic("Not implemented") } ================================================ FILE: vendor/go.podman.io/storage/pkg/parsers/parsers.go ================================================ // Package parsers provides helper functions to parse and validate different type // of string. It can be hosts, unix addresses, tcp addresses, filters, kernel // operating system versions. package parsers import ( "fmt" "strconv" "strings" ) // ParseKeyValueOpt parses and validates the specified string as a key/value pair (key=value) func ParseKeyValueOpt(opt string) (string, string, error) { k, v, ok := strings.Cut(opt, "=") if !ok { return "", "", fmt.Errorf("unable to parse key/value option: %s", opt) } return strings.TrimSpace(k), strings.TrimSpace(v), nil } // ParseUintList parses and validates the specified string as the value // found in some cgroup file (e.g. `cpuset.cpus`, `cpuset.mems`), which could be // one of the formats below. Note that duplicates are actually allowed in the // input string. It returns a `map[int]bool` with available elements from `val` // set to `true`. // Supported formats: // // 7 // 1-6 // 0,3-4,7,8-10 // 0-0,0,1-7 // 03,1-3 <- this is gonna get parsed as [1,2,3] // 3,2,1 // 0-2,3,1 func ParseUintList(val string) (map[int]bool, error) { if val == "" { return map[int]bool{}, nil } availableInts := make(map[int]bool) errInvalidFormat := fmt.Errorf("invalid format: %s", val) for r := range strings.SplitSeq(val, ",") { minS, maxS, ok := strings.Cut(r, "-") if !ok { v, err := strconv.Atoi(r) if err != nil { return nil, errInvalidFormat } availableInts[v] = true } else { min, err := strconv.Atoi(minS) if err != nil { return nil, errInvalidFormat } max, err := strconv.Atoi(maxS) if err != nil { return nil, errInvalidFormat } if max < min { return nil, errInvalidFormat } for i := min; i <= max; i++ { availableInts[i] = true } } } return availableInts, nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/pools/pools.go ================================================ // Package pools provides a collection of pools which provide various // data types with buffers. These can be used to lower the number of // memory allocations and reuse buffers. // // New pools should be added to this package to allow them to be // shared across packages. // // Utility functions which operate on pools should be added to this // package to allow them to be reused. package pools import ( "bufio" "io" "sync" "go.podman.io/storage/pkg/ioutils" ) var ( // BufioReader32KPool is a pool which returns bufio.Reader with a 32K buffer. BufioReader32KPool *BufioReaderPool // BufioWriter32KPool is a pool which returns bufio.Writer with a 32K buffer. BufioWriter32KPool *BufioWriterPool ) const buffer32K = 32 * 1024 // BufioReaderPool is a bufio reader that uses sync.Pool. type BufioReaderPool struct { pool *sync.Pool } func init() { BufioReader32KPool = newBufioReaderPoolWithSize(buffer32K) BufioWriter32KPool = newBufioWriterPoolWithSize(buffer32K) } // newBufioReaderPoolWithSize is unexported because new pools should be // added here to be shared where required. func newBufioReaderPoolWithSize(size int) *BufioReaderPool { pool := &sync.Pool{ New: func() any { return bufio.NewReaderSize(nil, size) }, } return &BufioReaderPool{pool: pool} } // Get returns a bufio.Reader which reads from r. The buffer size is that of the pool. func (bufPool *BufioReaderPool) Get(r io.Reader) *bufio.Reader { buf := bufPool.pool.Get().(*bufio.Reader) buf.Reset(r) return buf } // Put puts the bufio.Reader back into the pool. func (bufPool *BufioReaderPool) Put(b *bufio.Reader) { b.Reset(nil) bufPool.pool.Put(b) } // Copy is a convenience wrapper which uses a buffer to avoid allocation in io.Copy. func Copy(dst io.Writer, src io.Reader) (int64, error) { buf := BufioReader32KPool.Get(src) written, err := io.Copy(dst, buf) BufioReader32KPool.Put(buf) return written, err } // NewReadCloserWrapper returns a wrapper which puts the bufio.Reader back // into the pool and closes the reader if it's an io.ReadCloser. func (bufPool *BufioReaderPool) NewReadCloserWrapper(buf *bufio.Reader, r io.Reader) io.ReadCloser { return ioutils.NewReadCloserWrapper(r, func() error { if readCloser, ok := r.(io.ReadCloser); ok { readCloser.Close() } bufPool.Put(buf) return nil }) } // BufioWriterPool is a bufio writer that uses sync.Pool. type BufioWriterPool struct { pool *sync.Pool } // newBufioWriterPoolWithSize is unexported because new pools should be // added here to be shared where required. func newBufioWriterPoolWithSize(size int) *BufioWriterPool { pool := &sync.Pool{ New: func() any { return bufio.NewWriterSize(nil, size) }, } return &BufioWriterPool{pool: pool} } // Get returns a bufio.Writer which writes to w. The buffer size is that of the pool. func (bufPool *BufioWriterPool) Get(w io.Writer) *bufio.Writer { buf := bufPool.pool.Get().(*bufio.Writer) buf.Reset(w) return buf } // Put puts the bufio.Writer back into the pool. func (bufPool *BufioWriterPool) Put(b *bufio.Writer) { b.Reset(nil) bufPool.pool.Put(b) } // NewWriteCloserWrapper returns a wrapper which puts the bufio.Writer back // into the pool and closes the writer if it's an io.Writecloser. func (bufPool *BufioWriterPool) NewWriteCloserWrapper(buf *bufio.Writer, w io.Writer) io.WriteCloser { return ioutils.NewWriteCloserWrapper(w, func() error { buf.Flush() if writeCloser, ok := w.(io.WriteCloser); ok { writeCloser.Close() } bufPool.Put(buf) return nil }) } ================================================ FILE: vendor/go.podman.io/storage/pkg/promise/promise.go ================================================ package promise // Go is a basic promise implementation: it wraps calls a function in a goroutine, // and returns a channel which will later return the function's return value. func Go(f func() error) chan error { ch := make(chan error, 1) go func() { ch <- f() }() return ch } ================================================ FILE: vendor/go.podman.io/storage/pkg/reexec/README.md ================================================ # reexec The `reexec` package facilitates the busybox style reexec of the docker binary that we require because of the forking limitations of using Go. Handlers can be registered with a name and the argv 0 of the exec of the binary will be used to find and execute custom init paths. ================================================ FILE: vendor/go.podman.io/storage/pkg/reexec/command_freebsd.go ================================================ //go:build freebsd package reexec import ( "context" "os" "os/exec" "golang.org/x/sys/unix" ) // Self returns the path to the current process's binary. // Uses sysctl. func Self() string { path, err := unix.SysctlArgs("kern.proc.pathname", -1) if err == nil { return path } return os.Args[0] } // Command returns *exec.Cmd which has Path as current binary. // For example if current binary is "docker" at "/usr/bin/", then cmd.Path will // be set to "/usr/bin/docker". func Command(args ...string) *exec.Cmd { cmd := exec.Command(Self()) cmd.Args = args return cmd } // CommandContext returns *exec.Cmd which has Path as current binary. func CommandContext(ctx context.Context, args ...string) *exec.Cmd { cmd := exec.CommandContext(ctx, Self()) cmd.Args = args return cmd } ================================================ FILE: vendor/go.podman.io/storage/pkg/reexec/command_linux.go ================================================ //go:build linux package reexec import ( "context" "os/exec" ) // Self returns the path to the current process's binary. // Returns "/proc/self/exe". func Self() string { return "/proc/self/exe" } // Command returns *exec.Cmd which has Path as current binary. // This will use the in-memory version (/proc/self/exe) of the current binary, // it is thus safe to delete or replace the on-disk binary (os.Args[0]). func Command(args ...string) *exec.Cmd { panicIfNotInitialized() cmd := exec.Command(Self()) cmd.Args = args return cmd } // CommandContext returns *exec.Cmd which has Path as current binary. // This will use the in-memory version (/proc/self/exe) of the current binary, // it is thus safe to delete or replace the on-disk binary (os.Args[0]). func CommandContext(ctx context.Context, args ...string) *exec.Cmd { panicIfNotInitialized() cmd := exec.CommandContext(ctx, Self()) cmd.Args = args return cmd } ================================================ FILE: vendor/go.podman.io/storage/pkg/reexec/command_unix.go ================================================ //go:build solaris || darwin package reexec import ( "context" "os/exec" ) // Self returns the path to the current process's binary. // Uses os.Args[0]. func Self() string { return naiveSelf() } // Command returns *exec.Cmd which has Path as current binary. // For example if current binary is "docker" at "/usr/bin/", then cmd.Path will // be set to "/usr/bin/docker". func Command(args ...string) *exec.Cmd { panicIfNotInitialized() cmd := exec.Command(Self()) cmd.Args = args return cmd } // CommandContext returns *exec.Cmd which has Path as current binary. func CommandContext(ctx context.Context, args ...string) *exec.Cmd { panicIfNotInitialized() cmd := exec.CommandContext(ctx, Self()) cmd.Args = args return cmd } ================================================ FILE: vendor/go.podman.io/storage/pkg/reexec/command_unsupported.go ================================================ //go:build !linux && !windows && !freebsd && !solaris && !darwin package reexec import ( "context" "os/exec" ) // Command is unsupported on operating systems apart from Linux, Windows, Solaris and Darwin. func Command(args ...string) *exec.Cmd { panicIfNotInitialized() return nil } // CommandContext is unsupported on operating systems apart from Linux, Windows, Solaris and Darwin. func CommandContext(ctx context.Context, args ...string) *exec.Cmd { panicIfNotInitialized() return nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/reexec/command_windows.go ================================================ //go:build windows package reexec import ( "context" "os/exec" ) // Self returns the path to the current process's binary. // Uses os.Args[0]. func Self() string { return naiveSelf() } // Command returns *exec.Cmd which has Path as current binary. // For example if current binary is "docker.exe" at "C:\", then cmd.Path will // be set to "C:\docker.exe". func Command(args ...string) *exec.Cmd { panicIfNotInitialized() cmd := exec.Command(Self()) cmd.Args = args return cmd } // Command returns *exec.Cmd which has Path as current binary. // For example if current binary is "docker.exe" at "C:\", then cmd.Path will // be set to "C:\docker.exe". func CommandContext(ctx context.Context, args ...string) *exec.Cmd { panicIfNotInitialized() cmd := exec.CommandContext(ctx, Self()) cmd.Args = args return cmd } ================================================ FILE: vendor/go.podman.io/storage/pkg/reexec/reexec.go ================================================ package reexec import ( "fmt" "os" "os/exec" "path/filepath" ) var ( registeredInitializers = make(map[string]func()) initWasCalled = false ) // Register adds an initialization func under the specified name func Register(name string, initializer func()) { if _, exists := registeredInitializers[name]; exists { panic(fmt.Sprintf("reexec func already registered under name %q", name)) } registeredInitializers[name] = initializer } // Init is called as the first part of the exec process and returns true if an // initialization function was called. func Init() bool { initializer, exists := registeredInitializers[os.Args[0]] initWasCalled = true if exists { initializer() return true } return false } func panicIfNotInitialized() { if !initWasCalled { // The reexec package is used to run subroutines in // subprocesses which would otherwise have unacceptable side // effects on the main thread. If you found this error, then // your program uses a package which needs to do this. In // order for that to work, main() should start with this // boilerplate, or an equivalent: // if reexec.Init() { // return // } panic("a library subroutine needed to run a subprocess, but reexec.Init() was not called in main()") } } func naiveSelf() string { name := os.Args[0] if filepath.Base(name) == name { if lp, err := exec.LookPath(name); err == nil { return lp } } // handle conversion of relative paths to absolute if absName, err := filepath.Abs(name); err == nil { return absName } // if we couldn't get absolute name, return original // (NOTE: Go only errors on Abs() if os.Getwd fails) return name } ================================================ FILE: vendor/go.podman.io/storage/pkg/regexp/regexp.go ================================================ package regexp import ( "io" "regexp" "sync" ) // Regexp is a wrapper struct used for wrapping MustCompile regex expressions // used as global variables. Using this structure helps speed the startup time // of apps that want to use global regex variables. This library initializes them on // first use as opposed to the start of the executable. type Regexp struct { *regexpStruct } type regexpStruct struct { _ noCopy once sync.Once regexp *regexp.Regexp val string } func Delayed(val string) Regexp { re := ®expStruct{ val: val, } if precompile { re.regexp = regexp.MustCompile(re.val) } return Regexp{re} } func (re *regexpStruct) compile() { if precompile { return } re.once.Do(func() { re.regexp = regexp.MustCompile(re.val) }) } func (re *regexpStruct) Expand(dst []byte, template []byte, src []byte, match []int) []byte { re.compile() return re.regexp.Expand(dst, template, src, match) } func (re *regexpStruct) ExpandString(dst []byte, template string, src string, match []int) []byte { re.compile() return re.regexp.ExpandString(dst, template, src, match) } func (re *regexpStruct) Find(b []byte) []byte { re.compile() return re.regexp.Find(b) } func (re *regexpStruct) FindAll(b []byte, n int) [][]byte { re.compile() return re.regexp.FindAll(b, n) } func (re *regexpStruct) FindAllIndex(b []byte, n int) [][]int { re.compile() return re.regexp.FindAllIndex(b, n) } func (re *regexpStruct) FindAllString(s string, n int) []string { re.compile() return re.regexp.FindAllString(s, n) } func (re *regexpStruct) FindAllStringIndex(s string, n int) [][]int { re.compile() return re.regexp.FindAllStringIndex(s, n) } func (re *regexpStruct) FindAllStringSubmatch(s string, n int) [][]string { re.compile() return re.regexp.FindAllStringSubmatch(s, n) } func (re *regexpStruct) FindAllStringSubmatchIndex(s string, n int) [][]int { re.compile() return re.regexp.FindAllStringSubmatchIndex(s, n) } func (re *regexpStruct) FindAllSubmatch(b []byte, n int) [][][]byte { re.compile() return re.regexp.FindAllSubmatch(b, n) } func (re *regexpStruct) FindAllSubmatchIndex(b []byte, n int) [][]int { re.compile() return re.regexp.FindAllSubmatchIndex(b, n) } func (re *regexpStruct) FindIndex(b []byte) (loc []int) { re.compile() return re.regexp.FindIndex(b) } func (re *regexpStruct) FindReaderIndex(r io.RuneReader) (loc []int) { re.compile() return re.regexp.FindReaderIndex(r) } func (re *regexpStruct) FindReaderSubmatchIndex(r io.RuneReader) []int { re.compile() return re.regexp.FindReaderSubmatchIndex(r) } func (re *regexpStruct) FindString(s string) string { re.compile() return re.regexp.FindString(s) } func (re *regexpStruct) FindStringIndex(s string) (loc []int) { re.compile() return re.regexp.FindStringIndex(s) } func (re *regexpStruct) FindStringSubmatch(s string) []string { re.compile() return re.regexp.FindStringSubmatch(s) } func (re *regexpStruct) FindStringSubmatchIndex(s string) []int { re.compile() return re.regexp.FindStringSubmatchIndex(s) } func (re *regexpStruct) FindSubmatch(b []byte) [][]byte { re.compile() return re.regexp.FindSubmatch(b) } func (re *regexpStruct) FindSubmatchIndex(b []byte) []int { re.compile() return re.regexp.FindSubmatchIndex(b) } func (re *regexpStruct) LiteralPrefix() (prefix string, complete bool) { re.compile() return re.regexp.LiteralPrefix() } func (re *regexpStruct) Longest() { re.compile() re.regexp.Longest() } func (re *regexpStruct) Match(b []byte) bool { re.compile() return re.regexp.Match(b) } func (re *regexpStruct) MatchReader(r io.RuneReader) bool { re.compile() return re.regexp.MatchReader(r) } func (re *regexpStruct) MatchString(s string) bool { re.compile() return re.regexp.MatchString(s) } func (re *regexpStruct) NumSubexp() int { re.compile() return re.regexp.NumSubexp() } func (re *regexpStruct) ReplaceAll(src, repl []byte) []byte { re.compile() return re.regexp.ReplaceAll(src, repl) } func (re *regexpStruct) ReplaceAllFunc(src []byte, repl func([]byte) []byte) []byte { re.compile() return re.regexp.ReplaceAllFunc(src, repl) } func (re *regexpStruct) ReplaceAllLiteral(src, repl []byte) []byte { re.compile() return re.regexp.ReplaceAllLiteral(src, repl) } func (re *regexpStruct) ReplaceAllLiteralString(src, repl string) string { re.compile() return re.regexp.ReplaceAllLiteralString(src, repl) } func (re *regexpStruct) ReplaceAllString(src, repl string) string { re.compile() return re.regexp.ReplaceAllString(src, repl) } func (re *regexpStruct) ReplaceAllStringFunc(src string, repl func(string) string) string { re.compile() return re.regexp.ReplaceAllStringFunc(src, repl) } func (re *regexpStruct) Split(s string, n int) []string { re.compile() return re.regexp.Split(s, n) } func (re *regexpStruct) String() string { re.compile() return re.regexp.String() } func (re *regexpStruct) SubexpIndex(name string) int { re.compile() return re.regexp.SubexpIndex(name) } func (re *regexpStruct) SubexpNames() []string { re.compile() return re.regexp.SubexpNames() } // noCopy may be added to structs which must not be copied // after the first use. // // See https://golang.org/issues/8005#issuecomment-190753527 // for details. // // Note that it must not be embedded, due to the Lock and Unlock methods. type noCopy struct{} // Lock is a no-op used by -copylocks checker from `go vet`. func (*noCopy) Lock() {} func (*noCopy) Unlock() {} ================================================ FILE: vendor/go.podman.io/storage/pkg/regexp/regexp_dontprecompile.go ================================================ //go:build !regexp_precompile package regexp const precompile = false ================================================ FILE: vendor/go.podman.io/storage/pkg/regexp/regexp_precompile.go ================================================ //go:build regexp_precompile package regexp const precompile = true ================================================ FILE: vendor/go.podman.io/storage/pkg/stringid/README.md ================================================ This package provides helper functions for dealing with string identifiers ================================================ FILE: vendor/go.podman.io/storage/pkg/stringid/stringid.go ================================================ // Package stringid provides helper functions for dealing with string identifiers package stringid import ( cryptorand "crypto/rand" "encoding/hex" "fmt" "io" "math" "math/big" "math/rand" "strconv" "strings" "sync" "time" "go.podman.io/storage/pkg/regexp" ) const shortLen = 12 var ( validShortID = regexp.Delayed("^[a-f0-9]{12}$") validHex = regexp.Delayed(`^[a-f0-9]{64}$`) rngLock sync.Mutex rng *rand.Rand // A RNG with seeding properties we control. It can only be accessed with randLock held. ) // IsShortID determines if an arbitrary string *looks like* a short ID. func IsShortID(id string) bool { return validShortID.MatchString(id) } // TruncateID returns a shorthand version of a string identifier for convenience. // A collision with other shorthands is very unlikely, but possible. // In case of a collision a lookup with TruncIndex.Get() will fail, and the caller // will need to use a longer prefix, or the full-length Id. func TruncateID(id string) string { if i := strings.IndexRune(id, ':'); i >= 0 { id = id[i+1:] } if len(id) > shortLen { id = id[:shortLen] } return id } func generateID(r io.Reader) string { b := make([]byte, 32) for { if _, err := io.ReadFull(r, b); err != nil { panic(err) // This shouldn't happen } id := hex.EncodeToString(b) // if we try to parse the truncated for as an int and we don't have // an error then the value is all numeric and causes issues when // used as a hostname. ref #3869 if _, err := strconv.ParseInt(TruncateID(id), 10, 64); err == nil { continue } return id } } // GenerateRandomID returns a pseudorandom 64-character hex string. func GenerateRandomID() string { return generateID(cryptorand.Reader) } // GenerateNonCryptoID generates unique id without using cryptographically // secure sources of random. // It helps you to save entropy. func GenerateNonCryptoID() string { rngLock.Lock() defer rngLock.Unlock() return generateID(readerFunc(rng.Read)) } // ValidateID checks whether an ID string is a valid image ID. func ValidateID(id string) error { if ok := validHex.MatchString(id); !ok { return fmt.Errorf("image ID %q is invalid", id) } return nil } func init() { // Initialize a private RNG so we generate random ids. Tries to use a // crypto seed before falling back to time. var seed int64 if cryptoseed, err := cryptorand.Int(cryptorand.Reader, big.NewInt(math.MaxInt64)); err != nil { // This should not happen, but worst-case fallback to time-based seed. seed = time.Now().UnixNano() } else { seed = cryptoseed.Int64() } rng = rand.New(rand.NewSource(seed)) } type readerFunc func(p []byte) (int, error) func (fn readerFunc) Read(p []byte) (int, error) { return fn(p) } ================================================ FILE: vendor/go.podman.io/storage/pkg/stringutils/README.md ================================================ This package provides helper functions for dealing with strings ================================================ FILE: vendor/go.podman.io/storage/pkg/stringutils/stringutils.go ================================================ // Package stringutils provides helper functions for dealing with strings. package stringutils import ( "bytes" "math/rand/v2" "strings" ) // GenerateRandomAlphaOnlyString generates an alphabetical random string with length n. func GenerateRandomAlphaOnlyString(n int) string { // make a really long string letters := []byte("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") b := make([]byte, n) for i := range b { b[i] = letters[rand.IntN(len(letters))] } return string(b) } // GenerateRandomASCIIString generates an ASCII random string with length n. func GenerateRandomASCIIString(n int) string { chars := "abcdefghijklmnopqrstuvwxyz" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "~!@#$%^&*()-_+={}[]\\|<,>.?/\"';:` " res := make([]byte, n) for i := range n { res[i] = chars[rand.IntN(len(chars))] } return string(res) } // Ellipsis truncates a string to fit within maxlen, and appends ellipsis (...). // For maxlen of 3 and lower, no ellipsis is appended. func Ellipsis(s string, maxlen int) string { r := []rune(s) if len(r) <= maxlen { return s } if maxlen <= 3 { return string(r[:maxlen]) } return string(r[:maxlen-3]) + "..." } // Truncate truncates a string to maxlen. func Truncate(s string, maxlen int) string { r := []rune(s) if len(r) <= maxlen { return s } return string(r[:maxlen]) } // InSlice tests whether a string is contained in a slice of strings or not. // Comparison is case insensitive func InSlice(slice []string, s string) bool { for _, ss := range slice { if strings.EqualFold(s, ss) { return true } } return false } // RemoveFromSlice removes a string from a slice. The string can be present // multiple times. The entire slice is iterated. func RemoveFromSlice(slice []string, s string) (ret []string) { for _, ss := range slice { if !strings.EqualFold(s, ss) { ret = append(ret, ss) } } return ret } func quote(word string, buf *bytes.Buffer) { // Bail out early for "simple" strings if word != "" && !strings.ContainsAny(word, "\\'\"`${[|&;<>()~*?! \t\n") { buf.WriteString(word) return } buf.WriteString("'") for i := range len(word) { b := word[i] if b == '\'' { // Replace literal ' with a close ', a \', and an open ' buf.WriteString("'\\''") } else { buf.WriteByte(b) } } buf.WriteString("'") } // ShellQuoteArguments takes a list of strings and escapes them so they will be // handled right when passed as arguments to a program via a shell func ShellQuoteArguments(args []string) string { var buf bytes.Buffer for i, arg := range args { if i != 0 { buf.WriteByte(' ') } quote(arg, &buf) } return buf.String() } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/chmod.go ================================================ package system import ( "errors" "os" "syscall" ) func Chmod(name string, mode os.FileMode) error { err := os.Chmod(name, mode) for err != nil && errors.Is(err, syscall.EINTR) { err = os.Chmod(name, mode) } return err } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/chtimes.go ================================================ package system import ( "os" "time" ) // Chtimes changes the access time and modified time of a file at the given path func Chtimes(name string, atime time.Time, mtime time.Time) error { unixMinTime := time.Unix(0, 0) unixMaxTime := maxTime // If the modified time is prior to the Unix Epoch, or after the // end of Unix Time, os.Chtimes has undefined behavior // default to Unix Epoch in this case, just in case if atime.Before(unixMinTime) || atime.After(unixMaxTime) { atime = unixMinTime } if mtime.Before(unixMinTime) || mtime.After(unixMaxTime) { mtime = unixMinTime } if err := os.Chtimes(name, atime, mtime); err != nil { return err } // Take platform specific action for setting create time. if err := setCTime(name, mtime); err != nil { return err } return nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/chtimes_unix.go ================================================ //go:build !windows package system import ( "time" ) // setCTime will set the create time on a file. On Unix, the create // time is updated as a side effect of setting the modified time, so // no action is required. func setCTime(_ string, _ time.Time) error { return nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/chtimes_windows.go ================================================ //go:build windows package system import ( "time" "golang.org/x/sys/windows" ) // setCTime will set the create time on a file. On Windows, this requires // calling SetFileTime and explicitly including the create time. func setCTime(path string, ctime time.Time) error { ctimespec := windows.NsecToTimespec(ctime.UnixNano()) pathp, e := windows.UTF16PtrFromString(path) if e != nil { return e } h, e := windows.CreateFile(pathp, windows.FILE_WRITE_ATTRIBUTES, windows.FILE_SHARE_WRITE, nil, windows.OPEN_EXISTING, windows.FILE_FLAG_BACKUP_SEMANTICS, 0) if e != nil { return e } defer windows.Close(h) c := windows.NsecToFiletime(windows.TimespecToNsec(ctimespec)) return windows.SetFileTime(h, &c, nil, nil) } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/errors.go ================================================ package system import ( "errors" ) // ErrNotSupportedPlatform means the platform is not supported. var ErrNotSupportedPlatform = errors.New("platform and architecture is not supported") ================================================ FILE: vendor/go.podman.io/storage/pkg/system/exitcode.go ================================================ package system import ( "fmt" "os/exec" "syscall" ) // GetExitCode returns the ExitStatus of the specified error if its type is // exec.ExitError, returns 0 and an error otherwise. func GetExitCode(err error) (int, error) { exitCode := 0 if exiterr, ok := err.(*exec.ExitError); ok { if procExit, ok := exiterr.Sys().(syscall.WaitStatus); ok { return procExit.ExitStatus(), nil } } return exitCode, fmt.Errorf("failed to get exit code") } // ProcessExitCode process the specified error and returns the exit status code // if the error was of type exec.ExitError, returns nothing otherwise. func ProcessExitCode(err error) (exitCode int) { if err != nil { var exiterr error if exitCode, exiterr = GetExitCode(err); exiterr != nil { // TODO: Fix this so we check the error's text. // we've failed to retrieve exit code, so we set it to 127 exitCode = 127 } } return exitCode } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/extattr_freebsd.go ================================================ //go:build freebsd package system import ( "os" "unsafe" "golang.org/x/sys/unix" ) const ( EXTATTR_NAMESPACE_EMPTY = unix.EXTATTR_NAMESPACE_EMPTY EXTATTR_NAMESPACE_USER = unix.EXTATTR_NAMESPACE_USER EXTATTR_NAMESPACE_SYSTEM = unix.EXTATTR_NAMESPACE_SYSTEM ) // ExtattrGetLink retrieves the value of the extended attribute identified by attrname // in the given namespace and associated with the given path in the file system. // If the path is a symbolic link, the extended attribute is retrieved from the link itself. // Returns a []byte slice if the extattr is set and nil otherwise. func ExtattrGetLink(path string, attrnamespace int, attrname string) ([]byte, error) { size, errno := unix.ExtattrGetLink(path, attrnamespace, attrname, uintptr(unsafe.Pointer(nil)), 0) if errno != nil { if errno == unix.ENOATTR { return nil, nil } return nil, &os.PathError{Op: "extattr_get_link", Path: path, Err: errno} } if size == 0 { return []byte{}, nil } dest := make([]byte, size) size, errno = unix.ExtattrGetLink(path, attrnamespace, attrname, uintptr(unsafe.Pointer(&dest[0])), size) if errno != nil { return nil, &os.PathError{Op: "extattr_get_link", Path: path, Err: errno} } return dest[:size], nil } // ExtattrSetLink sets the value of extended attribute identified by attrname // in the given namespace and associated with the given path in the file system. // If the path is a symbolic link, the extended attribute is set on the link itself. func ExtattrSetLink(path string, attrnamespace int, attrname string, data []byte) error { if len(data) == 0 { data = []byte{} // ensure non-nil for empty data } if _, errno := unix.ExtattrSetLink(path, attrnamespace, attrname, uintptr(unsafe.Pointer(&data[0])), len(data)); errno != nil { return &os.PathError{Op: "extattr_set_link", Path: path, Err: errno} } return nil } // ExtattrListLink lists extended attributes associated with the given path // in the specified namespace. If the path is a symbolic link, the attributes // are listed from the link itself. func ExtattrListLink(path string, attrnamespace int) ([]string, error) { size, errno := unix.ExtattrListLink(path, attrnamespace, uintptr(unsafe.Pointer(nil)), 0) if errno != nil { return nil, &os.PathError{Op: "extattr_list_link", Path: path, Err: errno} } if size == 0 { return []string{}, nil } dest := make([]byte, size) size, errno = unix.ExtattrListLink(path, attrnamespace, uintptr(unsafe.Pointer(&dest[0])), size) if errno != nil { return nil, &os.PathError{Op: "extattr_list_link", Path: path, Err: errno} } var attrs []string for i := 0; i < size; { // Each attribute is preceded by a single byte length length := int(dest[i]) i++ if i+length > size { break } attrs = append(attrs, string(dest[i:i+length])) i += length } return attrs, nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/extattr_unsupported.go ================================================ //go:build !freebsd package system const ( EXTATTR_NAMESPACE_EMPTY = 0 EXTATTR_NAMESPACE_USER = 0 EXTATTR_NAMESPACE_SYSTEM = 0 ) // ExtattrGetLink is not supported on platforms other than FreeBSD. func ExtattrGetLink(path string, attrnamespace int, attrname string) ([]byte, error) { return nil, ErrNotSupportedPlatform } // ExtattrSetLink is not supported on platforms other than FreeBSD. func ExtattrSetLink(path string, attrnamespace int, attrname string, data []byte) error { return ErrNotSupportedPlatform } // ExtattrListLink is not supported on platforms other than FreeBSD. func ExtattrListLink(path string, attrnamespace int) ([]string, error) { return nil, ErrNotSupportedPlatform } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/init.go ================================================ package system import ( "syscall" "time" "unsafe" ) // maxTime is used by chtimes. var maxTime time.Time func init() { // chtimes initialization if unsafe.Sizeof(syscall.Timespec{}.Nsec) == 8 { // This is a 64 bit timespec // os.Chtimes limits time to the following maxTime = time.Unix(0, 1<<63-1) } else { // This is a 32 bit timespec maxTime = time.Unix(1<<31-1, 0) } } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/init_windows.go ================================================ package system import "os" // LCOWSupported determines if Linux Containers on Windows are supported. // Note: This feature is in development (06/17) and enabled through an // environment variable. At a future time, it will be enabled based // on build number. @jhowardmsft var lcowSupported = false func init() { // LCOW initialization if os.Getenv("LCOW_SUPPORTED") != "" { lcowSupported = true } } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/lchflags_bsd.go ================================================ //go:build freebsd package system import ( "unsafe" "golang.org/x/sys/unix" ) // Flag values from const ( /* * Definitions of flags stored in file flags word. * * Super-user and owner changeable flags. */ UF_SETTABLE uint32 = 0x0000ffff /* mask of owner changeable flags */ UF_NODUMP uint32 = 0x00000001 /* do not dump file */ UF_IMMUTABLE uint32 = 0x00000002 /* file may not be changed */ UF_APPEND uint32 = 0x00000004 /* writes to file may only append */ UF_OPAQUE uint32 = 0x00000008 /* directory is opaque wrt. union */ UF_NOUNLINK uint32 = 0x00000010 /* file may not be removed or renamed */ UF_SYSTEM uint32 = 0x00000080 /* Windows system file bit */ UF_SPARSE uint32 = 0x00000100 /* sparse file */ UF_OFFLINE uint32 = 0x00000200 /* file is offline */ UF_REPARSE uint32 = 0x00000400 /* Windows reparse point file bit */ UF_ARCHIVE uint32 = 0x00000800 /* file needs to be archived */ UF_READONLY uint32 = 0x00001000 /* Windows readonly file bit */ /* This is the same as the MacOS X definition of UF_HIDDEN. */ UF_HIDDEN uint32 = 0x00008000 /* file is hidden */ /* * Super-user changeable flags. */ SF_SETTABLE uint32 = 0xffff0000 /* mask of superuser changeable flags */ SF_ARCHIVED uint32 = 0x00010000 /* file is archived */ SF_IMMUTABLE uint32 = 0x00020000 /* file may not be changed */ SF_APPEND uint32 = 0x00040000 /* writes to file may only append */ SF_NOUNLINK uint32 = 0x00100000 /* file may not be removed or renamed */ SF_SNAPSHOT uint32 = 0x00200000 /* snapshot inode */ ) func Lchflags(path string, flags uint32) error { p, err := unix.BytePtrFromString(path) if err != nil { return err } _, _, e1 := unix.Syscall(unix.SYS_LCHFLAGS, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) if e1 != 0 { return e1 } return nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/lchown.go ================================================ package system import ( "os" "syscall" ) func Lchown(name string, uid, gid int) error { err := syscall.Lchown(name, uid, gid) for err == syscall.EINTR { err = syscall.Lchown(name, uid, gid) } if err != nil { return &os.PathError{Op: "lchown", Path: name, Err: err} } return nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/lcow_unix.go ================================================ //go:build !windows package system // LCOWSupported returns true if Linux containers on Windows are supported. func LCOWSupported() bool { return false } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/lcow_windows.go ================================================ package system // LCOWSupported returns true if Linux containers on Windows are supported. func LCOWSupported() bool { return lcowSupported } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/lstat_unix.go ================================================ //go:build !windows package system import ( "os" "syscall" ) // Lstat takes a path to a file and returns // a system.StatT type pertaining to that file. // // Throws an error if the file does not exist func Lstat(path string) (*StatT, error) { s := &syscall.Stat_t{} if err := syscall.Lstat(path, s); err != nil { return nil, &os.PathError{Op: "Lstat", Path: path, Err: err} } return fromStatT(s) } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/lstat_windows.go ================================================ package system import "os" // Lstat calls os.Lstat to get a fileinfo interface back. // This is then copied into our own locally defined structure. func Lstat(path string) (*StatT, error) { fi, err := os.Lstat(path) if err != nil { return nil, err } return fromStatT(&fi) } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/meminfo.go ================================================ package system // MemInfo contains memory statistics of the host system. type MemInfo struct { // Total usable RAM (i.e. physical RAM minus a few reserved bits and the // kernel binary code). MemTotal int64 // Amount of free memory. MemFree int64 // Total amount of swap space available. SwapTotal int64 // Amount of swap space that is currently unused. SwapFree int64 } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/meminfo_freebsd.go ================================================ //go:build freebsd && cgo package system import ( "errors" "fmt" "unsafe" "golang.org/x/sys/unix" ) // #include // #include // #include // #include import "C" func getMemInfo() (int64, int64, error) { data, err := unix.SysctlRaw("vm.vmtotal") if err != nil { return -1, -1, fmt.Errorf("can't get kernel info: %w", err) } if len(data) != C.sizeof_struct_vmtotal { return -1, -1, fmt.Errorf("unexpected vmtotal size %d", len(data)) } total := (*C.struct_vmtotal)(unsafe.Pointer(&data[0])) pagesize := int64(C.sysconf(C._SC_PAGESIZE)) npages := int64(C.sysconf(C._SC_PHYS_PAGES)) return pagesize * npages, pagesize * int64(total.t_free), nil } func getSwapInfo() (int64, int64, error) { var ( total int64 = 0 used int64 = 0 ) swapCount, err := unix.SysctlUint32("vm.nswapdev") if err != nil { return -1, -1, fmt.Errorf("reading vm.nswapdev: %w", err) } for i := 0; i < int(swapCount); i++ { data, err := unix.SysctlRaw("vm.swap_info", i) if err != nil { return -1, -1, fmt.Errorf("reading vm.swap_info.%d: %w", i, err) } if len(data) != C.sizeof_struct_xswdev { return -1, -1, fmt.Errorf("unexpected swap_info size %d", len(data)) } xsw := (*C.struct_xswdev)(unsafe.Pointer(&data[0])) total += int64(xsw.xsw_nblks) used += int64(xsw.xsw_used) } pagesize := int64(C.sysconf(C._SC_PAGESIZE)) return pagesize * total, pagesize * (total - used), nil } // ReadMemInfo retrieves memory statistics of the host system and returns a // // MemInfo type. func ReadMemInfo() (*MemInfo, error) { MemTotal, MemFree, err := getMemInfo() if err != nil { return nil, fmt.Errorf("getting memory totals %w", err) } SwapTotal, SwapFree, err := getSwapInfo() if err != nil { return nil, fmt.Errorf("getting swap totals %w", err) } if MemTotal < 0 || MemFree < 0 || SwapTotal < 0 || SwapFree < 0 { return nil, errors.New("getting system memory info") } meminfo := &MemInfo{} // Total memory is total physical memory less than memory locked by kernel meminfo.MemTotal = MemTotal meminfo.MemFree = MemFree meminfo.SwapTotal = SwapTotal meminfo.SwapFree = SwapFree return meminfo, nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/meminfo_linux.go ================================================ package system import ( "bufio" "io" "os" "strconv" "strings" "github.com/docker/go-units" ) // ReadMemInfo retrieves memory statistics of the host system and returns a // MemInfo type. func ReadMemInfo() (*MemInfo, error) { file, err := os.Open("/proc/meminfo") if err != nil { return nil, err } defer file.Close() return parseMemInfo(file) } // parseMemInfo parses the /proc/meminfo file into // a MemInfo object given an io.Reader to the file. // Throws error if there are problems reading from the file func parseMemInfo(reader io.Reader) (*MemInfo, error) { meminfo := &MemInfo{} scanner := bufio.NewScanner(reader) for scanner.Scan() { // Expected format: ["MemTotal:", "1234", "kB"] parts := strings.Fields(scanner.Text()) // Sanity checks: Skip malformed entries. if len(parts) < 3 || parts[2] != "kB" { continue } // Convert to bytes. size, err := strconv.Atoi(parts[1]) if err != nil { continue } bytes := int64(size) * units.KiB switch parts[0] { case "MemTotal:": meminfo.MemTotal = bytes case "MemFree:": meminfo.MemFree = bytes case "SwapTotal:": meminfo.SwapTotal = bytes case "SwapFree:": meminfo.SwapFree = bytes } } // Handle errors that may have occurred during the reading of the file. if err := scanner.Err(); err != nil { return nil, err } return meminfo, nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/meminfo_solaris.go ================================================ //go:build solaris && cgo package system import ( "fmt" "unsafe" ) // #cgo CFLAGS: -std=c99 // #cgo LDFLAGS: -lkstat // #include // #include // #include // #include // #include // #include // struct swaptable *allocSwaptable(int num) { // struct swaptable *st; // struct swapent *swapent; // st = (struct swaptable *)malloc(num * sizeof(swapent_t) + sizeof (int)); // swapent = st->swt_ent; // for (int i = 0; i < num; i++,swapent++) { // swapent->ste_path = (char *)malloc(MAXPATHLEN * sizeof (char)); // } // st->swt_n = num; // return st; //} // void freeSwaptable (struct swaptable *st) { // struct swapent *swapent = st->swt_ent; // for (int i = 0; i < st->swt_n; i++,swapent++) { // free(swapent->ste_path); // } // free(st); // } // swapent_t getSwapEnt(swapent_t *ent, int i) { // return ent[i]; // } // int64_t getPpKernel() { // int64_t pp_kernel = 0; // kstat_ctl_t *ksc; // kstat_t *ks; // kstat_named_t *knp; // kid_t kid; // // if ((ksc = kstat_open()) == NULL) { // return -1; // } // if ((ks = kstat_lookup(ksc, "unix", 0, "system_pages")) == NULL) { // return -1; // } // if (((kid = kstat_read(ksc, ks, NULL)) == -1) || // ((knp = kstat_data_lookup(ks, "pp_kernel")) == NULL)) { // return -1; // } // switch (knp->data_type) { // case KSTAT_DATA_UINT64: // pp_kernel = knp->value.ui64; // break; // case KSTAT_DATA_UINT32: // pp_kernel = knp->value.ui32; // break; // } // pp_kernel *= sysconf(_SC_PAGESIZE); // return (pp_kernel > 0 ? pp_kernel : -1); // } import "C" // Get the system memory info using sysconf same as prtconf func getTotalMem() int64 { pagesize := C.sysconf(C._SC_PAGESIZE) npages := C.sysconf(C._SC_PHYS_PAGES) return int64(pagesize * npages) } func getFreeMem() int64 { pagesize := C.sysconf(C._SC_PAGESIZE) npages := C.sysconf(C._SC_AVPHYS_PAGES) return int64(pagesize * npages) } // ReadMemInfo retrieves memory statistics of the host system and returns a // // MemInfo type. func ReadMemInfo() (*MemInfo, error) { ppKernel := C.getPpKernel() MemTotal := getTotalMem() MemFree := getFreeMem() SwapTotal, SwapFree, err := getSysSwap() if ppKernel < 0 || MemTotal < 0 || MemFree < 0 || SwapTotal < 0 || SwapFree < 0 { return nil, fmt.Errorf("getting system memory info %w", err) } meminfo := &MemInfo{} // Total memory is total physical memory less than memory locked by kernel meminfo.MemTotal = MemTotal - int64(ppKernel) meminfo.MemFree = MemFree meminfo.SwapTotal = SwapTotal meminfo.SwapFree = SwapFree return meminfo, nil } func getSysSwap() (int64, int64, error) { var tSwap int64 var fSwap int64 var diskblksPerPage int64 num, err := C.swapctl(C.SC_GETNSWP, nil) if err != nil { return -1, -1, err } st := C.allocSwaptable(num) _, err = C.swapctl(C.SC_LIST, unsafe.Pointer(st)) if err != nil { C.freeSwaptable(st) return -1, -1, err } diskblksPerPage = int64(C.sysconf(C._SC_PAGESIZE) >> C.DEV_BSHIFT) for i := 0; i < int(num); i++ { swapent := C.getSwapEnt(&st.swt_ent[0], C.int(i)) tSwap += int64(swapent.ste_pages) * diskblksPerPage fSwap += int64(swapent.ste_free) * diskblksPerPage } C.freeSwaptable(st) return tSwap, fSwap, nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/meminfo_unsupported.go ================================================ //go:build !linux && !windows && !solaris && !(freebsd && cgo) package system // ReadMemInfo is not supported on platforms other than linux and windows. func ReadMemInfo() (*MemInfo, error) { return nil, ErrNotSupportedPlatform } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/meminfo_windows.go ================================================ package system import ( "unsafe" "golang.org/x/sys/windows" ) var ( modkernel32 = windows.NewLazySystemDLL("kernel32.dll") procGlobalMemoryStatusEx = modkernel32.NewProc("GlobalMemoryStatusEx") ) // https://msdn.microsoft.com/en-us/library/windows/desktop/aa366589(v=vs.85).aspx // https://msdn.microsoft.com/en-us/library/windows/desktop/aa366770(v=vs.85).aspx type memorystatusex struct { dwLength uint32 dwMemoryLoad uint32 ullTotalPhys uint64 ullAvailPhys uint64 ullTotalPageFile uint64 ullAvailPageFile uint64 ullTotalVirtual uint64 ullAvailVirtual uint64 ullAvailExtendedVirtual uint64 } // ReadMemInfo retrieves memory statistics of the host system and returns a // // MemInfo type. func ReadMemInfo() (*MemInfo, error) { msi := &memorystatusex{ dwLength: 64, } r1, _, _ := procGlobalMemoryStatusEx.Call(uintptr(unsafe.Pointer(msi))) if r1 == 0 { return &MemInfo{}, nil } return &MemInfo{ MemTotal: int64(msi.ullTotalPhys), MemFree: int64(msi.ullAvailPhys), SwapTotal: int64(msi.ullTotalPageFile), SwapFree: int64(msi.ullAvailPageFile), }, nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/mknod.go ================================================ //go:build !windows && !freebsd package system import ( "golang.org/x/sys/unix" ) // Mknod creates a filesystem node (file, device special file or named pipe) named path // with attributes specified by mode and dev. func Mknod(path string, mode uint32, dev uint32) error { return unix.Mknod(path, mode, int(dev)) } // Mkdev is used to build the value of linux devices (in /dev/) which specifies major // and minor number of the newly created device special file. // Linux device nodes are a bit weird due to backwards compat with 16 bit device nodes. // They are, from low to high: the lower 8 bits of the minor, then 12 bits of the major, // then the top 12 bits of the minor. func Mkdev(major int64, minor int64) uint32 { return uint32(((minor & 0xfff00) << 12) | ((major & 0xfff) << 8) | (minor & 0xff)) } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/mknod_freebsd.go ================================================ //go:build freebsd package system import ( "golang.org/x/sys/unix" ) // Mknod creates a filesystem node (file, device special file or named pipe) named path // with attributes specified by mode and dev. func Mknod(path string, mode uint32, dev uint64) error { return unix.Mknod(path, mode, dev) } // Mkdev is used to build the value of linux devices (in /dev/) which specifies major // and minor number of the newly created device special file. // Linux device nodes are a bit weird due to backwards compat with 16 bit device nodes. // They are, from low to high: the lower 8 bits of the minor, then 12 bits of the major, // then the top 12 bits of the minor. func Mkdev(major int64, minor int64) uint64 { return uint64(((minor & 0xfff00) << 12) | ((major & 0xfff) << 8) | (minor & 0xff)) } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/mknod_windows.go ================================================ //go:build windows package system // Mknod is not implemented on Windows. func Mknod(path string, mode uint32, dev int) error { return ErrNotSupportedPlatform } // Mkdev is not implemented on Windows. func Mkdev(major int64, minor int64) uint32 { panic("Mkdev not implemented on Windows.") } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/path.go ================================================ package system import "runtime" const defaultUnixPathEnv = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" // DefaultPathEnv is unix style list of directories to search for // executables. Each directory is separated from the next by a colon // ':' character . func DefaultPathEnv(platform string) string { if runtime.GOOS == "windows" { if platform != runtime.GOOS && LCOWSupported() { return defaultUnixPathEnv } // Deliberately empty on Windows containers on Windows as the default path will be set by // the container. Docker has no context of what the default path should be. return "" } return defaultUnixPathEnv } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/path_unix.go ================================================ //go:build !windows package system // CheckSystemDriveAndRemoveDriveLetter verifies that a path, if it includes a drive letter, // is the system drive. This is a no-op on Linux. func CheckSystemDriveAndRemoveDriveLetter(path string) (string, error) { return path, nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/path_windows.go ================================================ //go:build windows package system import ( "fmt" "path/filepath" "strings" ) // CheckSystemDriveAndRemoveDriveLetter verifies and manipulates a Windows path. // This is used, for example, when validating a user provided path in docker cp. // If a drive letter is supplied, it must be the system drive. The drive letter // is always removed. Also, it translates it to OS semantics (IOW / to \). We // need the path in this syntax so that it can ultimately be concatenated with // a Windows long-path which doesn't support drive-letters. Examples: // C: --> Fail // C:\ --> \ // a --> a // /a --> \a // d:\ --> Fail func CheckSystemDriveAndRemoveDriveLetter(path string) (string, error) { if len(path) == 2 && string(path[1]) == ":" { return "", fmt.Errorf("relative path not specified in %q", path) } if !filepath.IsAbs(path) || len(path) < 2 { return filepath.FromSlash(path), nil } if string(path[1]) == ":" && !strings.EqualFold(string(path[0]), "c") { return "", fmt.Errorf("specified path is not on the system drive (C:)") } return filepath.FromSlash(path[2:]), nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/process_unix.go ================================================ //go:build linux || freebsd || solaris || darwin package system import ( "syscall" "golang.org/x/sys/unix" ) // IsProcessAlive returns true if process with a given pid is running. func IsProcessAlive(pid int) bool { err := unix.Kill(pid, syscall.Signal(0)) if err == nil || err == unix.EPERM { return true } return false } // KillProcess force-stops a process. func KillProcess(pid int) { _ = unix.Kill(pid, unix.SIGKILL) } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/rm.go ================================================ package system import ( "errors" "fmt" "os" "syscall" "time" "github.com/sirupsen/logrus" "go.podman.io/storage/pkg/mount" ) // EnsureRemoveAll wraps `os.RemoveAll` to check for specific errors that can // often be remedied. // Only use `EnsureRemoveAll` if you really want to make every effort to remove // a directory. // // Because of the way `os.Remove` (and by extension `os.RemoveAll`) works, there // can be a race between reading directory entries and then actually attempting // to remove everything in the directory. // These types of errors do not need to be returned since it's ok for the dir to // be gone we can just retry the remove operation. // // This should not return a `os.ErrNotExist` kind of error under any circumstances func EnsureRemoveAll(dir string) error { notExistErr := make(map[string]bool) // track retries exitOnErr := make(map[string]int) maxRetry := 1000 // Attempt a simple remove all first, this avoids the more expensive // RecursiveUnmount call if not needed. if err := os.RemoveAll(dir); err == nil { return nil } // Attempt to unmount anything beneath this dir first if err := mount.RecursiveUnmount(dir); err != nil { logrus.Debugf("RecursiveUnmount on %s failed: %v", dir, err) } for { err := os.RemoveAll(dir) if err == nil { return nil } // If the RemoveAll fails with a permission error, we // may have immutable files so try to remove the // immutable flag and redo the RemoveAll. if errors.Is(err, syscall.EPERM) { if err = resetFileFlags(dir); err != nil { return fmt.Errorf("resetting file flags: %w", err) } err = os.RemoveAll(dir) if err == nil { return nil } } pe, ok := err.(*os.PathError) if !ok { return err } if os.IsNotExist(err) { if notExistErr[pe.Path] { return err } notExistErr[pe.Path] = true // There is a race where some subdir can be removed but after the parent // dir entries have been read. // So the path could be from `os.Remove(subdir)` // If the reported non-existent path is not the passed in `dir` we // should just retry, but otherwise return with no error. if pe.Path == dir { return nil } continue } if !IsEBUSY(pe.Err) { return err } if e := mount.Unmount(pe.Path); e != nil { return fmt.Errorf("while removing %s: %w", dir, e) } if exitOnErr[pe.Path] == maxRetry { return err } exitOnErr[pe.Path]++ time.Sleep(10 * time.Millisecond) } } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/rm_common.go ================================================ //go:build !freebsd package system // Reset file flags in a directory tree. This allows EnsureRemoveAll // to delete trees which have the immutable flag set. func resetFileFlags(_ string) error { return nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/rm_freebsd.go ================================================ package system import ( "io/fs" "path/filepath" ) // Reset file flags in a directory tree. This allows EnsureRemoveAll // to delete trees which have the immutable flag set. func resetFileFlags(dir string) error { return filepath.WalkDir(dir, func(path string, d fs.DirEntry, err error) error { if err := Lchflags(path, 0); err != nil { return err } return nil }) } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/stat_common.go ================================================ //go:build !freebsd package system type platformStatT struct{} // Flags return file flags if supported or zero otherwise func (s StatT) Flags() uint32 { _ = s.platformStatT // Silence warnings that StatT.platformStatT is unused (on these platforms) return 0 } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/stat_darwin.go ================================================ package system import "syscall" // fromStatT converts a syscall.Stat_t type to a system.Stat_t type func fromStatT(s *syscall.Stat_t) (*StatT, error) { return &StatT{ size: s.Size, mode: uint32(s.Mode), uid: s.Uid, gid: s.Gid, rdev: uint64(s.Rdev), mtim: s.Mtimespec, }, nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/stat_freebsd.go ================================================ package system import "syscall" type platformStatT struct { flags uint32 } // Flags return file flags if supported or zero otherwise func (s StatT) Flags() uint32 { return s.flags } // fromStatT converts a syscall.Stat_t type to a system.Stat_t type func fromStatT(s *syscall.Stat_t) (*StatT, error) { st := &StatT{ size: s.Size, mode: uint32(s.Mode), uid: s.Uid, gid: s.Gid, rdev: uint64(s.Rdev), mtim: s.Mtimespec, dev: s.Dev, } st.flags = s.Flags st.dev = s.Dev return st, nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/stat_linux.go ================================================ package system import "syscall" // fromStatT converts a syscall.Stat_t type to a system.Stat_t type func fromStatT(s *syscall.Stat_t) (*StatT, error) { return &StatT{ size: s.Size, mode: s.Mode, uid: s.Uid, gid: s.Gid, rdev: uint64(s.Rdev), //nolint:unconvert mtim: s.Mtim, dev: uint64(s.Dev), //nolint:unconvert }, nil } // FromStatT converts a syscall.Stat_t type to a system.Stat_t type // This is exposed on Linux as pkg/archive/changes uses it. func FromStatT(s *syscall.Stat_t) (*StatT, error) { return fromStatT(s) } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/stat_netbsd.go ================================================ package system import "syscall" // fromStatT converts a syscall.Stat_t type to a system.Stat_t type func fromStatT(s *syscall.Stat_t) (*StatT, error) { return &StatT{ size: s.Size, mode: uint32(s.Mode), uid: s.Uid, gid: s.Gid, rdev: uint64(s.Rdev), mtim: s.Mtimespec, }, nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/stat_openbsd.go ================================================ package system import "syscall" // fromStatT converts a syscall.Stat_t type to a system.Stat_t type func fromStatT(s *syscall.Stat_t) (*StatT, error) { return &StatT{ size: s.Size, mode: uint32(s.Mode), uid: s.Uid, gid: s.Gid, rdev: uint64(s.Rdev), mtim: s.Mtim, }, nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/stat_solaris.go ================================================ package system import "syscall" // fromStatT converts a syscall.Stat_t type to a system.Stat_t type func fromStatT(s *syscall.Stat_t) (*StatT, error) { return &StatT{ size: s.Size, mode: uint32(s.Mode), uid: s.Uid, gid: s.Gid, rdev: uint64(s.Rdev), mtim: s.Mtim, }, nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/stat_unix.go ================================================ //go:build !windows package system import ( "os" "strconv" "syscall" "golang.org/x/sys/unix" ) // StatT type contains status of a file. It contains metadata // like permission, owner, group, size, etc about a file. type StatT struct { mode uint32 uid uint32 gid uint32 rdev uint64 size int64 mtim syscall.Timespec dev uint64 platformStatT } // Mode returns file's permission mode. func (s StatT) Mode() uint32 { return s.mode } // UID returns file's user id of owner. func (s StatT) UID() uint32 { return s.uid } // GID returns file's group id of owner. func (s StatT) GID() uint32 { return s.gid } // Rdev returns file's device ID (if it's special file). func (s StatT) Rdev() uint64 { return s.rdev } // Size returns file's size. func (s StatT) Size() int64 { return s.size } // Mtim returns file's last modification time. func (s StatT) Mtim() syscall.Timespec { return s.mtim } // Dev returns a unique identifier for owning filesystem func (s StatT) Dev() uint64 { return s.dev } func (s StatT) IsDir() bool { return (s.mode & unix.S_IFDIR) != 0 } // Stat takes a path to a file and returns // a system.StatT type pertaining to that file. // // Throws an error if the file does not exist func Stat(path string) (*StatT, error) { s := &syscall.Stat_t{} if err := syscall.Stat(path, s); err != nil { return nil, &os.PathError{Op: "Stat", Path: path, Err: err} } return fromStatT(s) } // Fstat takes an open file descriptor and returns // a system.StatT type pertaining to that file. // // Throws an error if the file descriptor is invalid func Fstat(fd int) (*StatT, error) { s := &syscall.Stat_t{} if err := syscall.Fstat(fd, s); err != nil { return nil, &os.PathError{Op: "Fstat", Path: strconv.Itoa(fd), Err: err} } return fromStatT(s) } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/stat_windows.go ================================================ package system import ( "os" "time" ) // StatT type contains status of a file. It contains metadata // like permission, size, etc about a file. type StatT struct { mode os.FileMode size int64 mtim time.Time platformStatT } // Size returns file's size. func (s StatT) Size() int64 { return s.size } // Mode returns file's permission mode. func (s StatT) Mode() os.FileMode { return os.FileMode(s.mode) } // Mtim returns file's last modification time. func (s StatT) Mtim() time.Time { return time.Time(s.mtim) } // UID returns file's user id of owner. // // on windows this is always 0 because there is no concept of UID func (s StatT) UID() uint32 { return 0 } // GID returns file's group id of owner. // // on windows this is always 0 because there is no concept of GID func (s StatT) GID() uint32 { return 0 } // Dev returns a unique identifier for owning filesystem func (s StatT) Dev() uint64 { return 0 } func (s StatT) IsDir() bool { return s.Mode().IsDir() } // Stat takes a path to a file and returns // a system.StatT type pertaining to that file. // // Throws an error if the file does not exist func Stat(path string) (*StatT, error) { fi, err := os.Stat(path) if err != nil { return nil, err } return fromStatT(&fi) } // fromStatT converts a os.FileInfo type to a system.StatT type func fromStatT(fi *os.FileInfo) (*StatT, error) { return &StatT{ size: (*fi).Size(), mode: (*fi).Mode(), mtim: (*fi).ModTime(), }, nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/syscall_unix.go ================================================ //go:build !windows package system import ( "errors" "golang.org/x/sys/unix" ) // Unmount is a platform-specific helper function to call // the unmount syscall. func Unmount(dest string) error { return unix.Unmount(dest, 0) } // CommandLineToArgv should not be used on Unix. // It simply returns commandLine in the only element in the returned array. func CommandLineToArgv(commandLine string) ([]string, error) { return []string{commandLine}, nil } // IsEBUSY checks if the specified error is EBUSY. func IsEBUSY(err error) bool { return errors.Is(err, unix.EBUSY) } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/syscall_windows.go ================================================ package system import ( "unsafe" "github.com/sirupsen/logrus" "golang.org/x/sys/windows" ) var ( ntuserApiset = windows.NewLazyDLL("ext-ms-win-ntuser-window-l1-1-0") procGetVersionExW = modkernel32.NewProc("GetVersionExW") procGetProductInfo = modkernel32.NewProc("GetProductInfo") ) // OSVersion is a wrapper for Windows version information // https://msdn.microsoft.com/en-us/library/windows/desktop/ms724439(v=vs.85).aspx type OSVersion struct { Version uint32 MajorVersion uint8 MinorVersion uint8 Build uint16 } // https://msdn.microsoft.com/en-us/library/windows/desktop/ms724833(v=vs.85).aspx type osVersionInfoEx struct { OSVersionInfoSize uint32 MajorVersion uint32 MinorVersion uint32 BuildNumber uint32 PlatformID uint32 CSDVersion [128]uint16 ServicePackMajor uint16 ServicePackMinor uint16 SuiteMask uint16 ProductType byte Reserve byte } // GetOSVersion gets the operating system version on Windows. Note that // docker.exe must be manifested to get the correct version information. func GetOSVersion() OSVersion { var err error osv := OSVersion{} osv.Version, err = windows.GetVersion() if err != nil { // GetVersion never fails. panic(err) } osv.MajorVersion = uint8(osv.Version & 0xFF) osv.MinorVersion = uint8(osv.Version >> 8 & 0xFF) osv.Build = uint16(osv.Version >> 16) return osv } // IsWindowsClient returns true if the SKU is client // @engine maintainers - this function should not be removed or modified as it // is used to enforce licensing restrictions on Windows. func IsWindowsClient() bool { osviex := &osVersionInfoEx{OSVersionInfoSize: 284} r1, _, err := procGetVersionExW.Call(uintptr(unsafe.Pointer(osviex))) if r1 == 0 { logrus.Warnf("GetVersionExW failed - assuming server SKU: %v", err) return false } const verNTWorkstation = 0x00000001 return osviex.ProductType == verNTWorkstation } // IsIoTCore returns true if the currently running image is based off of // Windows 10 IoT Core. // @engine maintainers - this function should not be removed or modified as it // is used to enforce licensing restrictions on Windows. func IsIoTCore() bool { var returnedProductType uint32 r1, _, err := procGetProductInfo.Call(6, 1, 0, 0, uintptr(unsafe.Pointer(&returnedProductType))) if r1 == 0 { logrus.Warnf("GetProductInfo failed - assuming this is not IoT: %v", err) return false } const productIoTUAP = 0x0000007B const productIoTUAPCommercial = 0x00000083 return returnedProductType == productIoTUAP || returnedProductType == productIoTUAPCommercial } // Unmount is a platform-specific helper function to call // the unmount syscall. Not supported on Windows func Unmount(dest string) error { return nil } // CommandLineToArgv wraps the Windows syscall to turn a commandline into an argument array. func CommandLineToArgv(commandLine string) ([]string, error) { var argc int32 argsPtr, err := windows.UTF16PtrFromString(commandLine) if err != nil { return nil, err } argv, err := windows.CommandLineToArgv(argsPtr, &argc) if err != nil { return nil, err } defer windows.LocalFree(windows.Handle(uintptr(unsafe.Pointer(argv)))) newArgs := make([]string, argc) for i, v := range (*argv)[:argc] { newArgs[i] = string(windows.UTF16ToString((*v)[:])) } return newArgs, nil } // HasWin32KSupport determines whether containers that depend on win32k can // run on this machine. Win32k is the driver used to implement windowing. func HasWin32KSupport() bool { // For now, check for ntuser API support on the host. In the future, a host // may support win32k in containers even if the host does not support ntuser // APIs. return ntuserApiset.Load() == nil } // IsEBUSY checks if the specified error is EBUSY. func IsEBUSY(err error) bool { return false } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/umask.go ================================================ //go:build !windows package system import ( "golang.org/x/sys/unix" ) // Umask sets current process's file mode creation mask to newmask // and returns oldmask. func Umask(newmask int) (oldmask int, err error) { return unix.Umask(newmask), nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/umask_windows.go ================================================ //go:build windows package system // Umask is not supported on the windows platform. func Umask(newmask int) (oldmask int, err error) { // should not be called on cli code path return 0, ErrNotSupportedPlatform } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/utimes_freebsd.go ================================================ package system import ( "syscall" "unsafe" "golang.org/x/sys/unix" ) // LUtimesNano is used to change access and modification time of the specified path. // It's used for symbol link file because unix.UtimesNano doesn't support a NOFOLLOW flag atm. func LUtimesNano(path string, ts []syscall.Timespec) error { atFdCwd := unix.AT_FDCWD var _path *byte _path, err := unix.BytePtrFromString(path) if err != nil { return err } if _, _, err := unix.Syscall6(unix.SYS_UTIMENSAT, uintptr(atFdCwd), uintptr(unsafe.Pointer(_path)), uintptr(unsafe.Pointer(&ts[0])), unix.AT_SYMLINK_NOFOLLOW, 0, 0); err != 0 && err != unix.ENOSYS { return err } return nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/utimes_linux.go ================================================ package system import ( "syscall" "unsafe" "golang.org/x/sys/unix" ) // LUtimesNano is used to change access and modification time of the specified path. // It's used for symbol link file because unix.UtimesNano doesn't support a NOFOLLOW flag atm. func LUtimesNano(path string, ts []syscall.Timespec) error { atFdCwd := unix.AT_FDCWD var _path *byte _path, err := unix.BytePtrFromString(path) if err != nil { return err } if _, _, err := unix.Syscall6(unix.SYS_UTIMENSAT, uintptr(atFdCwd), uintptr(unsafe.Pointer(_path)), uintptr(unsafe.Pointer(&ts[0])), unix.AT_SYMLINK_NOFOLLOW, 0, 0); err != 0 && err != unix.ENOSYS { return err } return nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/utimes_unsupported.go ================================================ //go:build !linux && !freebsd package system import "syscall" // LUtimesNano is only supported on linux and freebsd. func LUtimesNano(path string, ts []syscall.Timespec) error { return ErrNotSupportedPlatform } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/xattrs_darwin.go ================================================ package system import ( "bytes" "os" "golang.org/x/sys/unix" ) const ( // Value is larger than the maximum size allowed E2BIG unix.Errno = unix.E2BIG // Operation not supported ENOTSUP unix.Errno = unix.ENOTSUP ) // Lgetxattr retrieves the value of the extended attribute identified by attr // and associated with the given path in the file system. // Returns a []byte slice if the xattr is set and nil otherwise. func Lgetxattr(path string, attr string) ([]byte, error) { // Start with a 128 length byte array dest := make([]byte, 128) sz, errno := unix.Lgetxattr(path, attr, dest) for errno == unix.ERANGE { // Buffer too small, use zero-sized buffer to get the actual size sz, errno = unix.Lgetxattr(path, attr, []byte{}) if errno != nil { return nil, &os.PathError{Op: "lgetxattr", Path: path, Err: errno} } dest = make([]byte, sz) sz, errno = unix.Lgetxattr(path, attr, dest) } switch { case errno == unix.ENOATTR: return nil, nil case errno != nil: return nil, &os.PathError{Op: "lgetxattr", Path: path, Err: errno} } return dest[:sz], nil } // Lsetxattr sets the value of the extended attribute identified by attr // and associated with the given path in the file system. func Lsetxattr(path string, attr string, data []byte, flags int) error { if err := unix.Lsetxattr(path, attr, data, flags); err != nil { return &os.PathError{Op: "lsetxattr", Path: path, Err: err} } return nil } // Llistxattr lists extended attributes associated with the given path // in the file system. func Llistxattr(path string) ([]string, error) { dest := make([]byte, 128) sz, errno := unix.Llistxattr(path, dest) for errno == unix.ERANGE { // Buffer too small, use zero-sized buffer to get the actual size sz, errno = unix.Llistxattr(path, []byte{}) if errno != nil { return nil, &os.PathError{Op: "llistxattr", Path: path, Err: errno} } dest = make([]byte, sz) sz, errno = unix.Llistxattr(path, dest) } if errno != nil { return nil, &os.PathError{Op: "llistxattr", Path: path, Err: errno} } var attrs []string for token := range bytes.SplitSeq(dest[:sz], []byte{0}) { if len(token) > 0 { attrs = append(attrs, string(token)) } } return attrs, nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/xattrs_freebsd.go ================================================ package system import ( "strings" "golang.org/x/sys/unix" ) const ( // Value is larger than the maximum size allowed E2BIG unix.Errno = unix.E2BIG // Operation not supported ENOTSUP unix.Errno = unix.ENOTSUP // Value is too small or too large for maximum size allowed EOVERFLOW unix.Errno = unix.EOVERFLOW ) var namespaceMap = map[string]int{ "user": EXTATTR_NAMESPACE_USER, "system": EXTATTR_NAMESPACE_SYSTEM, } func xattrToExtattr(xattr string) (namespace int, extattr string, err error) { namespaceName, extattr, found := strings.Cut(xattr, ".") if !found { return -1, "", ENOTSUP } namespace, ok := namespaceMap[namespaceName] if !ok { return -1, "", ENOTSUP } return namespace, extattr, nil } // Lgetxattr retrieves the value of the extended attribute identified by attr // and associated with the given path in the file system. // Returns a []byte slice if the xattr is set and nil otherwise. func Lgetxattr(path string, attr string) ([]byte, error) { namespace, extattr, err := xattrToExtattr(attr) if err != nil { return nil, err } return ExtattrGetLink(path, namespace, extattr) } // Lsetxattr sets the value of the extended attribute identified by attr // and associated with the given path in the file system. func Lsetxattr(path string, attr string, value []byte, flags int) error { if flags != 0 { // FIXME: Flags are not supported on FreeBSD, but we can implement // them mimicking the behavior of the Linux implementation. // See lsetxattr(2) on Linux for more information. return ENOTSUP } namespace, extattr, err := xattrToExtattr(attr) if err != nil { return err } return ExtattrSetLink(path, namespace, extattr, value) } // Llistxattr lists extended attributes associated with the given path // in the file system. func Llistxattr(path string) ([]string, error) { attrs := []string{} for namespaceName, namespace := range namespaceMap { namespaceAttrs, err := ExtattrListLink(path, namespace) if err != nil { return nil, err } for _, attr := range namespaceAttrs { attrs = append(attrs, namespaceName+"."+attr) } } return attrs, nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/xattrs_linux.go ================================================ package system import ( "bytes" "os" "golang.org/x/sys/unix" ) const ( // Value is larger than the maximum size allowed E2BIG unix.Errno = unix.E2BIG // Operation not supported ENOTSUP unix.Errno = unix.ENOTSUP // Value is too small or too large for maximum size allowed EOVERFLOW unix.Errno = unix.EOVERFLOW ) // Lgetxattr retrieves the value of the extended attribute identified by attr // and associated with the given path in the file system. // Returns a []byte slice if the xattr is set and nil otherwise. func Lgetxattr(path string, attr string) ([]byte, error) { // Start with a 128 length byte array dest := make([]byte, 128) sz, errno := unix.Lgetxattr(path, attr, dest) for errno == unix.ERANGE { // Buffer too small, use zero-sized buffer to get the actual size sz, errno = unix.Lgetxattr(path, attr, []byte{}) if errno != nil { return nil, &os.PathError{Op: "lgetxattr", Path: path, Err: errno} } dest = make([]byte, sz) sz, errno = unix.Lgetxattr(path, attr, dest) } switch { case errno == unix.ENODATA: return nil, nil case errno != nil: return nil, &os.PathError{Op: "lgetxattr", Path: path, Err: errno} } return dest[:sz], nil } // Lsetxattr sets the value of the extended attribute identified by attr // and associated with the given path in the file system. func Lsetxattr(path string, attr string, data []byte, flags int) error { if err := unix.Lsetxattr(path, attr, data, flags); err != nil { return &os.PathError{Op: "lsetxattr", Path: path, Err: err} } return nil } // Llistxattr lists extended attributes associated with the given path // in the file system. func Llistxattr(path string) ([]string, error) { dest := make([]byte, 128) sz, errno := unix.Llistxattr(path, dest) for errno == unix.ERANGE { // Buffer too small, use zero-sized buffer to get the actual size sz, errno = unix.Llistxattr(path, []byte{}) if errno != nil { return nil, &os.PathError{Op: "llistxattr", Path: path, Err: errno} } dest = make([]byte, sz) sz, errno = unix.Llistxattr(path, dest) } if errno != nil { return nil, &os.PathError{Op: "llistxattr", Path: path, Err: errno} } var attrs []string for token := range bytes.SplitSeq(dest[:sz], []byte{0}) { if len(token) > 0 { attrs = append(attrs, string(token)) } } return attrs, nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/system/xattrs_unsupported.go ================================================ //go:build !linux && !darwin && !freebsd package system import "syscall" const ( // Value is larger than the maximum size allowed E2BIG syscall.Errno = syscall.Errno(0) // Operation not supported ENOTSUP syscall.Errno = syscall.Errno(0) // Value is too small or too large for maximum size allowed EOVERFLOW syscall.Errno = syscall.Errno(0) ) // Lgetxattr is not supported on platforms other than linux. func Lgetxattr(path string, attr string) ([]byte, error) { return nil, ErrNotSupportedPlatform } // Lsetxattr is not supported on platforms other than linux. func Lsetxattr(path string, attr string, data []byte, flags int) error { return ErrNotSupportedPlatform } // Llistxattr is not supported on platforms other than linux. func Llistxattr(path string) ([]string, error) { return nil, ErrNotSupportedPlatform } ================================================ FILE: vendor/go.podman.io/storage/pkg/tarlog/tarlogger.go ================================================ package tarlog import ( "io" "sync" "github.com/sirupsen/logrus" "github.com/vbatts/tar-split/archive/tar" ) type tarLogger struct { writer *io.PipeWriter closeMutex *sync.Mutex closed bool } // NewLogger returns a writer that, when a tar archive is written to it, calls // `logger` for each file header it encounters in the archive. func NewLogger(logger func(*tar.Header)) (io.WriteCloser, error) { reader, writer := io.Pipe() t := &tarLogger{ writer: writer, closeMutex: new(sync.Mutex), closed: false, } tr := tar.NewReader(reader) t.closeMutex.Lock() go func() { hdr, err := tr.Next() for err == nil { logger(hdr) hdr, err = tr.Next() } // Make sure to avoid writes after the reader has been closed. if err := reader.Close(); err != nil { logrus.Errorf("Closing tarlogger reader: %v", err) } // Unblock the Close(). t.closeMutex.Unlock() }() return t, nil } func (t *tarLogger) Write(b []byte) (int, error) { if t.closed { // We cannot use os.Pipe() as this alters the tar's digest. Using // io.Pipe() requires this workaround as it does not allow for writes // after close. return len(b), nil } n, err := t.writer.Write(b) if err == io.ErrClosedPipe { // The pipe got closed. Track it and avoid to call Write in future. t.closed = true return len(b), nil } return n, err } func (t *tarLogger) Close() error { err := t.writer.Close() // Wait for the reader to finish. t.closeMutex.Lock() return err } ================================================ FILE: vendor/go.podman.io/storage/pkg/truncindex/truncindex.go ================================================ // Package truncindex provides a general 'index tree', used by Docker // in order to be able to reference containers by only a few unambiguous // characters of their id. package truncindex import ( "errors" "fmt" "strings" "sync" "github.com/tchap/go-patricia/v2/patricia" ) var ( // ErrEmptyPrefix is an error returned if the prefix was empty. ErrEmptyPrefix = errors.New("prefix can't be empty") // ErrIllegalChar is returned when a space is in the ID ErrIllegalChar = errors.New("illegal character: ' '") // ErrNotExist is returned when ID or its prefix not found in index. ErrNotExist = errors.New("ID does not exist") ) // ErrAmbiguousPrefix is returned if the prefix was ambiguous // (multiple ids for the prefix). type ErrAmbiguousPrefix struct { //nolint: errname prefix string } func (e ErrAmbiguousPrefix) Error() string { return fmt.Sprintf("Multiple IDs found with provided prefix: %s", e.prefix) } // TruncIndex allows the retrieval of string identifiers by any of their unique prefixes. // This is used to retrieve image and container IDs by more convenient shorthand prefixes. type TruncIndex struct { sync.RWMutex trie *patricia.Trie ids map[string]struct{} } // NewTruncIndex creates a new TruncIndex and initializes with a list of IDs. // Invalid IDs are _silently_ ignored. func NewTruncIndex(ids []string) *TruncIndex { idx := &TruncIndex{ ids: make(map[string]struct{}), // Change patricia max prefix per node length, // because our len(ID) always 64 trie: patricia.NewTrie(patricia.MaxPrefixPerNode(64)), } for _, id := range ids { _ = idx.addID(id) // Ignore invalid IDs. Duplicate IDs are not a problem. } return idx } func (idx *TruncIndex) addID(id string) error { if strings.Contains(id, " ") { return ErrIllegalChar } if id == "" { return ErrEmptyPrefix } if _, exists := idx.ids[id]; exists { return fmt.Errorf("id already exists: '%s'", id) } idx.ids[id] = struct{}{} if inserted := idx.trie.Insert(patricia.Prefix(id), struct{}{}); !inserted { return fmt.Errorf("failed to insert id: %s", id) } return nil } // Add adds a new ID to the TruncIndex. func (idx *TruncIndex) Add(id string) error { idx.Lock() defer idx.Unlock() return idx.addID(id) } // Delete removes an ID from the TruncIndex. If there are multiple IDs // with the given prefix, an error is thrown. func (idx *TruncIndex) Delete(id string) error { idx.Lock() defer idx.Unlock() if _, exists := idx.ids[id]; !exists || id == "" { return fmt.Errorf("no such id: '%s'", id) } delete(idx.ids, id) if deleted := idx.trie.Delete(patricia.Prefix(id)); !deleted { return fmt.Errorf("no such id: '%s'", id) } return nil } // Get retrieves an ID from the TruncIndex. If there are multiple IDs // with the given prefix, an error is thrown. func (idx *TruncIndex) Get(s string) (string, error) { if s == "" { return "", ErrEmptyPrefix } var id string subTreeVisitFunc := func(prefix patricia.Prefix, item patricia.Item) error { if id != "" { // we haven't found the ID if there are two or more IDs id = "" return ErrAmbiguousPrefix{prefix: string(prefix)} } id = string(prefix) return nil } idx.RLock() defer idx.RUnlock() if err := idx.trie.VisitSubtree(patricia.Prefix(s), subTreeVisitFunc); err != nil { return "", err } if id != "" { return id, nil } return "", ErrNotExist } // Iterate iterates over all stored IDs and passes each of them to the given // handler. Take care that the handler method does not call any public // method on truncindex as the internal locking is not reentrant/recursive // and will result in deadlock. func (idx *TruncIndex) Iterate(handler func(id string)) { idx.Lock() defer idx.Unlock() // Ignore the error from Visit: it can only fail if the provided visitor fails, and ours never does. _ = idx.trie.Visit(func(prefix patricia.Prefix, item patricia.Item) error { handler(string(prefix)) return nil }) } ================================================ FILE: vendor/go.podman.io/storage/pkg/unshare/getenv_linux_cgo.go ================================================ //go:build linux && cgo package unshare import ( "unsafe" ) /* #cgo remoteclient CFLAGS: -Wall -Werror #include */ import "C" func getenv(name string) string { cName := C.CString(name) defer C.free(unsafe.Pointer(cName)) value := C.GoString(C.getenv(cName)) return value } ================================================ FILE: vendor/go.podman.io/storage/pkg/unshare/getenv_linux_nocgo.go ================================================ //go:build linux && !cgo package unshare import ( "os" ) func getenv(name string) string { return os.Getenv(name) } ================================================ FILE: vendor/go.podman.io/storage/pkg/unshare/unshare.c ================================================ #if !defined(UNSHARE_NO_CODE_AT_ALL) && defined(__linux__) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* Open Source projects like conda-forge, want to package podman and are based off of centos:6, Conda-force has minimal libc requirements and is lacking the memfd.h file, so we use mmam.h */ #ifndef MFD_ALLOW_SEALING #define MFD_ALLOW_SEALING 2U #endif #ifndef MFD_CLOEXEC #define MFD_CLOEXEC 1U #endif #ifndef F_LINUX_SPECIFIC_BASE #define F_LINUX_SPECIFIC_BASE 1024 #endif #ifndef F_ADD_SEALS #define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9) #define F_GET_SEALS (F_LINUX_SPECIFIC_BASE + 10) #endif #ifndef F_SEAL_SEAL #define F_SEAL_SEAL 0x0001LU #endif #ifndef F_SEAL_SHRINK #define F_SEAL_SHRINK 0x0002LU #endif #ifndef F_SEAL_GROW #define F_SEAL_GROW 0x0004LU #endif #ifndef F_SEAL_WRITE #define F_SEAL_WRITE 0x0008LU #endif #define BUFSTEP 1024 static const char *_max_user_namespaces = "/proc/sys/user/max_user_namespaces"; static const char *_unprivileged_user_namespaces = "/proc/sys/kernel/unprivileged_userns_clone"; static int _containers_unshare_parse_envint(const char *envname) { char *p, *q; long l; p = getenv(envname); if (p == NULL) { return -1; } q = NULL; l = strtol(p, &q, 10); if ((q == NULL) || (*q != '\0')) { fprintf(stderr, "Error parsing \"%s\"=\"%s\"!\n", envname, p); _exit(1); } unsetenv(envname); return l; } static void _check_proc_sys_file(const char *path) { FILE *fp; char buf[32]; size_t n_read; long r; fp = fopen(path, "r"); if (fp == NULL) { if (errno != ENOENT) fprintf(stderr, "Error reading %s: %m\n", _max_user_namespaces); } else { memset(buf, 0, sizeof(buf)); n_read = fread(buf, 1, sizeof(buf) - 1, fp); if (n_read > 0) { r = atoi(buf); if (r == 0) { fprintf(stderr, "User namespaces are not enabled in %s.\n", path); } } else { fprintf(stderr, "Error reading %s: no contents, should contain a number greater than 0.\n", path); } fclose(fp); } } static char **parse_proc_stringlist(const char *list) { int fd, n, i, n_strings; char *buf, *new_buf, **ret; size_t size, new_size, used; fd = open(list, O_RDONLY); if (fd == -1) { return NULL; } buf = NULL; size = 0; used = 0; for (;;) { new_size = used + BUFSTEP; new_buf = realloc(buf, new_size); if (new_buf == NULL) { free(buf); fprintf(stderr, "realloc(%ld): out of memory\n", (long)(size + BUFSTEP)); return NULL; } buf = new_buf; size = new_size; memset(buf + used, '\0', size - used); n = read(fd, buf + used, size - used - 1); if (n < 0) { fprintf(stderr, "read(): %m\n"); return NULL; } if (n == 0) { break; } used += n; } close(fd); n_strings = 0; for (n = 0; n < used; n++) { if ((n == 0) || (buf[n-1] == '\0')) { n_strings++; } } ret = calloc(n_strings + 1, sizeof(char *)); if (ret == NULL) { fprintf(stderr, "calloc(): out of memory\n"); return NULL; } i = 0; for (n = 0; n < used; n++) { if ((n == 0) || (buf[n-1] == '\0')) { ret[i++] = &buf[n]; } } ret[i] = NULL; return ret; } /* * Taken from the runc cloned_binary.c file * Copyright (C) 2019 Aleksa Sarai * Copyright (C) 2019 SUSE LLC * * This work is dual licensed under the following licenses. You may use, * redistribute, and/or modify the work under the conditions of either (or * both) licenses. * * === Apache-2.0 === */ static int try_bindfd(void) { int fd, ret = -1; char src[PATH_MAX] = {0}; char template[64] = {0}; strncpy(template, "/tmp/containers.XXXXXX", sizeof(template) - 1); /* * We need somewhere to mount it, mounting anything over /proc/self is a * BAD idea on the host -- even if we do it temporarily. */ fd = mkstemp(template); if (fd < 0) return ret; close(fd); ret = -EPERM; if (readlink("/proc/self/exe", src, sizeof (src) - 1) < 0) goto out; if (mount(src, template, NULL, MS_BIND, NULL) < 0) goto out; if (mount(NULL, template, NULL, MS_REMOUNT | MS_BIND | MS_RDONLY, NULL) < 0) goto out_umount; /* Get read-only handle that we're sure can't be made read-write. */ ret = open(template, O_PATH | O_CLOEXEC); out_umount: /* * Make sure the MNT_DETACH works, otherwise we could get remounted * read-write and that would be quite bad (the fd would be made read-write * too, invalidating the protection). */ if (umount2(template, MNT_DETACH) < 0) { if (ret >= 0) close(ret); ret = -ENOTRECOVERABLE; } out: /* * We don't care about unlink errors, the worst that happens is that * there's an empty file left around in STATEDIR. */ unlink(template); return ret; } static int copy_self_proc_exe(char **argv) { char *exename; int fd, mmfd, n_read, n_written; struct stat st; char buf[2048]; fd = open("/proc/self/exe", O_RDONLY | O_CLOEXEC); if (fd == -1) { fprintf(stderr, "open(\"/proc/self/exe\"): %m\n"); return -1; } if (fstat(fd, &st) == -1) { fprintf(stderr, "fstat(\"/proc/self/exe\"): %m\n"); close(fd); return -1; } exename = basename(argv[0]); mmfd = syscall(SYS_memfd_create, exename, (long) MFD_ALLOW_SEALING | MFD_CLOEXEC); if (mmfd == -1) { fprintf(stderr, "memfd_create(): %m\n"); goto close_fd; } for (;;) { n_read = read(fd, buf, sizeof(buf)); if (n_read < 0) { fprintf(stderr, "read(\"/proc/self/exe\"): %m\n"); return -1; } if (n_read == 0) { break; } n_written = write(mmfd, buf, n_read); if (n_written < 0) { fprintf(stderr, "write(anonfd): %m\n"); goto close_fd; } if (n_written != n_read) { fprintf(stderr, "write(anonfd): short write (%d != %d)\n", n_written, n_read); goto close_fd; } } close(fd); if (fcntl(mmfd, F_ADD_SEALS, F_SEAL_SHRINK | F_SEAL_GROW | F_SEAL_WRITE | F_SEAL_SEAL) == -1) { fprintf(stderr, "Close_Fd sealing memfd copy: %m\n"); goto close_mmfd; } return mmfd; close_fd: close(fd); close_mmfd: close(mmfd); return -1; } static int containers_reexec(int flags) { char **argv; int fd = -1; argv = parse_proc_stringlist("/proc/self/cmdline"); if (argv == NULL) { return -1; } if (flags & CLONE_NEWNS) fd = try_bindfd(); if (fd < 0) fd = copy_self_proc_exe(argv); if (fd < 0) return fd; if (fexecve(fd, argv, environ) == -1) { close(fd); fprintf(stderr, "Error during reexec(...): %m\n"); return -1; } close(fd); return 0; } void _containers_unshare(void) { int flags, pidfd, continuefd, n, pgrp, sid, ctty; char buf[2048]; flags = _containers_unshare_parse_envint("_Containers-unshare"); if (flags == -1) { return; } if ((flags & CLONE_NEWUSER) != 0) { if (unshare(CLONE_NEWUSER) == -1) { fprintf(stderr, "Error during unshare(CLONE_NEWUSER): %m\n"); _check_proc_sys_file (_max_user_namespaces); _check_proc_sys_file (_unprivileged_user_namespaces); _exit(1); } } pidfd = _containers_unshare_parse_envint("_Containers-pid-pipe"); if (pidfd != -1) { snprintf(buf, sizeof(buf), "%llu", (unsigned long long) getpid()); size_t size = write(pidfd, buf, strlen(buf)); if (size != strlen(buf)) { fprintf(stderr, "Error writing PID to pipe on fd %d: %m\n", pidfd); _exit(1); } close(pidfd); } continuefd = _containers_unshare_parse_envint("_Containers-continue-pipe"); if (continuefd != -1) { n = read(continuefd, buf, sizeof(buf)); if (n > 0) { fprintf(stderr, "Error: %.*s\n", n, buf); _exit(1); } close(continuefd); } sid = _containers_unshare_parse_envint("_Containers-setsid"); if (sid == 1) { if (setsid() == -1) { fprintf(stderr, "Error during setsid: %m\n"); _exit(1); } } pgrp = _containers_unshare_parse_envint("_Containers-setpgrp"); if (pgrp == 1) { if (setpgrp() == -1) { fprintf(stderr, "Error during setpgrp: %m\n"); _exit(1); } } ctty = _containers_unshare_parse_envint("_Containers-ctty"); if (ctty != -1) { if (ioctl(ctty, TIOCSCTTY, 0) == -1) { fprintf(stderr, "Error while setting controlling terminal to %d: %m\n", ctty); _exit(1); } } if ((flags & CLONE_NEWUSER) != 0) { if (setresgid(0, 0, 0) != 0) { fprintf(stderr, "Error during setresgid(0): %m\n"); _exit(1); } if (setresuid(0, 0, 0) != 0) { fprintf(stderr, "Error during setresuid(0): %m\n"); _exit(1); } } if ((flags & ~CLONE_NEWUSER) != 0) { if (unshare(flags & ~CLONE_NEWUSER) == -1) { fprintf(stderr, "Error during unshare(...): %m\n"); _exit(1); } } if (containers_reexec(flags) != 0) { _exit(1); } return; } #endif // !UNSHARE_NO_CODE_AT_ALL ================================================ FILE: vendor/go.podman.io/storage/pkg/unshare/unshare.go ================================================ package unshare import ( "fmt" "os" "os/user" "sync" ) var ( homeDirOnce sync.Once homeDirErr error homeDir string ) // HomeDir returns the home directory for the current user. func HomeDir() (string, error) { homeDirOnce.Do(func() { home := os.Getenv("HOME") if home == "" { usr, err := user.LookupId(fmt.Sprintf("%d", GetRootlessUID())) if err != nil { homeDir, homeDirErr = "", fmt.Errorf("unable to resolve HOME directory: %w", err) return } homeDir, homeDirErr = usr.HomeDir, nil return } homeDir, homeDirErr = home, nil }) return homeDir, homeDirErr } ================================================ FILE: vendor/go.podman.io/storage/pkg/unshare/unshare_cgo.go ================================================ //go:build (linux && cgo && !gccgo) || (freebsd && cgo) package unshare // #cgo CFLAGS: -Wall // extern void _containers_unshare(void); // static void __attribute__((constructor)) init(void) { // _containers_unshare(); // } import "C" ================================================ FILE: vendor/go.podman.io/storage/pkg/unshare/unshare_darwin.go ================================================ //go:build darwin package unshare import ( "os" "github.com/opencontainers/runtime-spec/specs-go" "go.podman.io/storage/pkg/idtools" ) const ( // UsernsEnvName is the environment variable, if set indicates in rootless mode UsernsEnvName = "_CONTAINERS_USERNS_CONFIGURED" ) // IsRootless tells us if we are running in rootless mode func IsRootless() bool { return true } // GetRootlessUID returns the UID of the user in the parent userNS func GetRootlessUID() int { return os.Getuid() } // GetRootlessGID returns the GID of the user in the parent userNS func GetRootlessGID() int { return os.Getgid() } // RootlessEnv returns the environment settings for the rootless containers func RootlessEnv() []string { return append(os.Environ(), UsernsEnvName+"=") } // MaybeReexecUsingUserNamespace re-exec the process in a new namespace func MaybeReexecUsingUserNamespace(evenForRoot bool) { } // GetHostIDMappings reads mappings for the specified process (or the current // process if pid is "self" or an empty string) from the kernel. func GetHostIDMappings(pid string) ([]specs.LinuxIDMapping, []specs.LinuxIDMapping, error) { return nil, nil, nil } // ParseIDMappings parses mapping triples. func ParseIDMappings(uidmap, gidmap []string) ([]idtools.IDMap, []idtools.IDMap, error) { uid, err := idtools.ParseIDMap(uidmap, "userns-uid-map") if err != nil { return nil, nil, err } gid, err := idtools.ParseIDMap(gidmap, "userns-gid-map") if err != nil { return nil, nil, err } return uid, gid, nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/unshare/unshare_freebsd.c ================================================ #if !defined(UNSHARE_NO_CODE_AT_ALL) && defined(__FreeBSD__) #include #include #include #include #include #include static int _containers_unshare_parse_envint(const char *envname) { char *p, *q; long l; p = getenv(envname); if (p == NULL) { return -1; } q = NULL; l = strtol(p, &q, 10); if ((q == NULL) || (*q != '\0')) { fprintf(stderr, "Error parsing \"%s\"=\"%s\"!\n", envname, p); _exit(1); } unsetenv(envname); return l; } void _containers_unshare(void) { int pidfd, continuefd, n, pgrp, sid, ctty; char buf[2048]; pidfd = _containers_unshare_parse_envint("_Containers-pid-pipe"); if (pidfd != -1) { snprintf(buf, sizeof(buf), "%llu", (unsigned long long) getpid()); size_t size = write(pidfd, buf, strlen(buf)); if (size != strlen(buf)) { fprintf(stderr, "Error writing PID to pipe on fd %d: %m\n", pidfd); _exit(1); } close(pidfd); } continuefd = _containers_unshare_parse_envint("_Containers-continue-pipe"); if (continuefd != -1) { n = read(continuefd, buf, sizeof(buf)); if (n > 0) { fprintf(stderr, "Error: %.*s\n", n, buf); _exit(1); } close(continuefd); } sid = _containers_unshare_parse_envint("_Containers-setsid"); if (sid == 1) { if (setsid() == -1) { fprintf(stderr, "Error during setsid: %m\n"); _exit(1); } } pgrp = _containers_unshare_parse_envint("_Containers-setpgrp"); if (pgrp == 1) { if (setpgrp(0, 0) == -1) { fprintf(stderr, "Error during setpgrp: %m\n"); _exit(1); } } ctty = _containers_unshare_parse_envint("_Containers-ctty"); if (ctty != -1) { if (ioctl(ctty, TIOCSCTTY, 0) == -1) { fprintf(stderr, "Error while setting controlling terminal to %d: %m\n", ctty); _exit(1); } } } #endif ================================================ FILE: vendor/go.podman.io/storage/pkg/unshare/unshare_freebsd.go ================================================ //go:build freebsd package unshare import ( "bytes" "errors" "fmt" "io" "os" "os/exec" "runtime" "strconv" "syscall" "github.com/sirupsen/logrus" "go.podman.io/storage/pkg/reexec" ) // Cmd wraps an exec.Cmd created by the reexec package in unshare(), // and one day might handle setting ID maps and other related setting*s // by triggering initialization code in the child. type Cmd struct { *exec.Cmd Setsid bool Setpgrp bool Ctty *os.File Hook func(pid int) error } // Command creates a new Cmd which can be customized. func Command(args ...string) *Cmd { cmd := reexec.Command(args...) return &Cmd{ Cmd: cmd, } } func (c *Cmd) Start() error { runtime.LockOSThread() defer runtime.UnlockOSThread() // Set environment variables to tell the child to synchronize its startup. if c.Env == nil { c.Env = os.Environ() } // Create the pipe for reading the child's PID. pidRead, pidWrite, err := os.Pipe() if err != nil { return fmt.Errorf("creating pid pipe: %w", err) } c.Env = append(c.Env, fmt.Sprintf("_Containers-pid-pipe=%d", len(c.ExtraFiles)+3)) c.ExtraFiles = append(c.ExtraFiles, pidWrite) // Create the pipe for letting the child know to proceed. continueRead, continueWrite, err := os.Pipe() if err != nil { pidRead.Close() pidWrite.Close() return fmt.Errorf("creating continue read/write pipe: %w", err) } c.Env = append(c.Env, fmt.Sprintf("_Containers-continue-pipe=%d", len(c.ExtraFiles)+3)) c.ExtraFiles = append(c.ExtraFiles, continueRead) // Pass along other instructions. if c.Setsid { c.Env = append(c.Env, "_Containers-setsid=1") } if c.Setpgrp { c.Env = append(c.Env, "_Containers-setpgrp=1") } if c.Ctty != nil { c.Env = append(c.Env, fmt.Sprintf("_Containers-ctty=%d", len(c.ExtraFiles)+3)) c.ExtraFiles = append(c.ExtraFiles, c.Ctty) } // Make sure we clean up our pipes. defer func() { if pidRead != nil { pidRead.Close() } if pidWrite != nil { pidWrite.Close() } if continueRead != nil { continueRead.Close() } if continueWrite != nil { continueWrite.Close() } }() // Start the new process. err = c.Cmd.Start() if err != nil { return err } // Close the ends of the pipes that the parent doesn't need. continueRead.Close() continueRead = nil pidWrite.Close() pidWrite = nil // Read the child's PID from the pipe. pidString := "" b := new(bytes.Buffer) if _, err := io.Copy(b, pidRead); err != nil { return fmt.Errorf("reading child PID: %w", err) } pidString = b.String() pid, err := strconv.Atoi(pidString) if err != nil { fmt.Fprintf(continueWrite, "error parsing PID %q: %v", pidString, err) return fmt.Errorf("parsing PID %q: %w", pidString, err) } // Run any additional setup that we want to do before the child starts running proper. if c.Hook != nil { if err = c.Hook(pid); err != nil { fmt.Fprintf(continueWrite, "hook error: %v", err) return err } } return nil } func (c *Cmd) Run() error { if err := c.Start(); err != nil { return err } return c.Wait() } func (c *Cmd) CombinedOutput() ([]byte, error) { return nil, errors.New("unshare: CombinedOutput() not implemented") } func (c *Cmd) Output() ([]byte, error) { return nil, errors.New("unshare: Output() not implemented") } type Runnable interface { Run() error } // ExecRunnable runs the specified unshare command, captures its exit status, // and exits with the same status. func ExecRunnable(cmd Runnable, cleanup func()) { exit := func(status int) { if cleanup != nil { cleanup() } os.Exit(status) } if err := cmd.Run(); err != nil { if exitError, ok := err.(*exec.ExitError); ok { if exitError.ProcessState.Exited() { if waitStatus, ok := exitError.ProcessState.Sys().(syscall.WaitStatus); ok { if waitStatus.Exited() { logrus.Debugf("%v", exitError) exit(waitStatus.ExitStatus()) } if waitStatus.Signaled() { logrus.Debugf("%v", exitError) exit(int(waitStatus.Signal()) + 128) } } } } logrus.Errorf("%v", err) logrus.Errorf("(Unable to determine exit status)") exit(1) } exit(0) } ================================================ FILE: vendor/go.podman.io/storage/pkg/unshare/unshare_gccgo.go ================================================ //go:build linux && cgo && gccgo package unshare // #cgo CFLAGS: -Wall -Wextra // extern void _containers_unshare(void); // static void __attribute__((constructor)) init(void) { // _containers_unshare(); // } import "C" // This next bit is straight out of libcontainer. // AlwaysFalse is here to stay false // (and be exported so the compiler doesn't optimize out its reference) var AlwaysFalse bool func init() { if AlwaysFalse { // by referencing this C init() in a noop test, it will ensure the compiler // links in the C function. // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65134 C.init() } } ================================================ FILE: vendor/go.podman.io/storage/pkg/unshare/unshare_linux.go ================================================ //go:build linux package unshare import ( "bufio" "bytes" "errors" "fmt" "io" "os" "os/exec" "os/signal" "os/user" "runtime" "strconv" "strings" "sync" "syscall" "github.com/moby/sys/capability" "github.com/opencontainers/runtime-spec/specs-go" "github.com/sirupsen/logrus" "go.podman.io/storage/pkg/idtools" "go.podman.io/storage/pkg/reexec" ) // Cmd wraps an exec.Cmd created by the reexec package in unshare(), and // handles setting ID maps and other related settings by triggering // initialization code in the child. type Cmd struct { *exec.Cmd UnshareFlags int UseNewuidmap bool UidMappings []specs.LinuxIDMapping //nolint: revive UseNewgidmap bool GidMappings []specs.LinuxIDMapping //nolint: revive GidMappingsEnableSetgroups bool Setsid bool Setpgrp bool Ctty *os.File OOMScoreAdj *int Hook func(pid int) error } // Command creates a new Cmd which can be customized. func Command(args ...string) *Cmd { cmd := reexec.Command(args...) return &Cmd{ Cmd: cmd, } } func getRootlessUID() int { uidEnv := getenv("_CONTAINERS_ROOTLESS_UID") if uidEnv != "" { u, _ := strconv.Atoi(uidEnv) return u } return os.Geteuid() } func getRootlessGID() int { gidEnv := getenv("_CONTAINERS_ROOTLESS_GID") if gidEnv != "" { u, _ := strconv.Atoi(gidEnv) return u } /* If the _CONTAINERS_ROOTLESS_UID is set, assume the gid==uid. */ uidEnv := os.Getenv("_CONTAINERS_ROOTLESS_UID") if uidEnv != "" { u, _ := strconv.Atoi(uidEnv) return u } return os.Getegid() } // IsSetID checks if specified path has correct FileMode (Setuid|SETGID) or the // matching file capability func IsSetID(path string, modeid os.FileMode, capid capability.Cap) (bool, error) { info, err := os.Stat(path) if err != nil { return false, err } mode := info.Mode() if mode&modeid == modeid { return true, nil } cap, err := capability.NewFile2(path) if err != nil { return false, err } if err := cap.Load(); err != nil { return false, err } return cap.Get(capability.EFFECTIVE, capid), nil } func (c *Cmd) Start() (retErr error) { runtime.LockOSThread() defer runtime.UnlockOSThread() // Set an environment variable to tell the child to synchronize its startup. if c.Env == nil { c.Env = os.Environ() } c.Env = append(c.Env, fmt.Sprintf("_Containers-unshare=%d", c.UnshareFlags)) // Please the libpod "rootless" package to find the expected env variables. if IsRootless() { c.Env = append(c.Env, "_CONTAINERS_USERNS_CONFIGURED=done") c.Env = append(c.Env, fmt.Sprintf("_CONTAINERS_ROOTLESS_UID=%d", getRootlessUID())) c.Env = append(c.Env, fmt.Sprintf("_CONTAINERS_ROOTLESS_GID=%d", getRootlessGID())) } // Create the pipe for reading the child's PID. pidRead, pidWrite, err := os.Pipe() if err != nil { return fmt.Errorf("creating pid pipe: %w", err) } c.Env = append(c.Env, fmt.Sprintf("_Containers-pid-pipe=%d", len(c.ExtraFiles)+3)) c.ExtraFiles = append(c.ExtraFiles, pidWrite) // Create the pipe for letting the child know to proceed. continueRead, continueWrite, err := os.Pipe() if err != nil { pidRead.Close() pidWrite.Close() return fmt.Errorf("creating continue read/write pipe: %w", err) } c.Env = append(c.Env, fmt.Sprintf("_Containers-continue-pipe=%d", len(c.ExtraFiles)+3)) c.ExtraFiles = append(c.ExtraFiles, continueRead) // Pass along other instructions. if c.Setsid { c.Env = append(c.Env, "_Containers-setsid=1") } if c.Setpgrp { c.Env = append(c.Env, "_Containers-setpgrp=1") } if c.Ctty != nil { c.Env = append(c.Env, fmt.Sprintf("_Containers-ctty=%d", len(c.ExtraFiles)+3)) c.ExtraFiles = append(c.ExtraFiles, c.Ctty) } // Make sure we clean up our pipes. defer func() { if pidRead != nil { pidRead.Close() } if pidWrite != nil { pidWrite.Close() } if continueRead != nil { continueRead.Close() } if continueWrite != nil { continueWrite.Close() } }() // Start the new process. err = c.Cmd.Start() if err != nil { return err } // If the function fails from here, we need to make sure the // child process is killed and properly cleaned up. defer func() { if retErr != nil { _ = c.Cmd.Process.Kill() _ = c.Cmd.Wait() } }() // Close the ends of the pipes that the parent doesn't need. continueRead.Close() continueRead = nil pidWrite.Close() pidWrite = nil // Read the child's PID from the pipe. b := new(bytes.Buffer) if _, err := io.Copy(b, pidRead); err != nil { return fmt.Errorf("reading child PID: %w", err) } pidString := b.String() pid, err := strconv.Atoi(pidString) if err != nil { fmt.Fprintf(continueWrite, "error parsing PID %q: %v", pidString, err) return fmt.Errorf("parsing PID %q: %w", pidString, err) } pidString = fmt.Sprintf("%d", pid) // If we created a new user namespace, set any specified mappings. if c.UnshareFlags&syscall.CLONE_NEWUSER != 0 { // Always set "setgroups". setgroups, err := os.OpenFile(fmt.Sprintf("/proc/%s/setgroups", pidString), os.O_TRUNC|os.O_WRONLY, 0) if err != nil { fmt.Fprintf(continueWrite, "error opening setgroups: %v", err) return fmt.Errorf("opening /proc/%s/setgroups: %w", pidString, err) } defer setgroups.Close() if c.GidMappingsEnableSetgroups { if _, err := fmt.Fprintf(setgroups, "allow"); err != nil { fmt.Fprintf(continueWrite, "error writing \"allow\" to setgroups: %v", err) return fmt.Errorf("opening \"allow\" to /proc/%s/setgroups: %w", pidString, err) } } else { if _, err := fmt.Fprintf(setgroups, "deny"); err != nil { fmt.Fprintf(continueWrite, "error writing \"deny\" to setgroups: %v", err) return fmt.Errorf("writing \"deny\" to /proc/%s/setgroups: %w", pidString, err) } } if len(c.UidMappings) == 0 || len(c.GidMappings) == 0 { uidmap, gidmap, err := GetHostIDMappings("") if err != nil { fmt.Fprintf(continueWrite, "error reading ID mappings in parent: %v", err) return fmt.Errorf("reading ID mappings in parent: %w", err) } if len(c.UidMappings) == 0 { c.UidMappings = uidmap for i := range c.UidMappings { c.UidMappings[i].HostID = c.UidMappings[i].ContainerID } } if len(c.GidMappings) == 0 { c.GidMappings = gidmap for i := range c.GidMappings { c.GidMappings[i].HostID = c.GidMappings[i].ContainerID } } } if len(c.GidMappings) > 0 { // Build the GID map, since writing to the proc file has to be done all at once. g := new(bytes.Buffer) for _, m := range c.GidMappings { fmt.Fprintf(g, "%d %d %d\n", m.ContainerID, m.HostID, m.Size) } gidmapSet := false // Set the GID map. if c.UseNewgidmap { path, err := exec.LookPath("newgidmap") if err != nil { return fmt.Errorf("finding newgidmap: %w", err) } cmd := exec.Command(path, append([]string{pidString}, strings.Fields(g.String())...)...) g.Reset() cmd.Stdout = g cmd.Stderr = g if err := cmd.Run(); err == nil { gidmapSet = true } else { logrus.Warnf("running newgidmap: %v: %s", err, g.String()) isSetgid, err := IsSetID(path, os.ModeSetgid, capability.CAP_SETGID) if err != nil { logrus.Warnf("Failed to check for setgid on %s: %v", path, err) } else { if !isSetgid { logrus.Warnf("%s should be setgid or have filecaps setgid", path) } } logrus.Warnf("Falling back to single mapping") g.Reset() fmt.Fprintf(g, "0 %d 1\n", os.Getegid()) } } if !gidmapSet { if c.UseNewgidmap { setgroups, err := os.OpenFile(fmt.Sprintf("/proc/%s/setgroups", pidString), os.O_TRUNC|os.O_WRONLY, 0) if err != nil { fmt.Fprintf(continueWrite, "error opening /proc/%s/setgroups: %v", pidString, err) return fmt.Errorf("opening /proc/%s/setgroups: %w", pidString, err) } defer setgroups.Close() if _, err := fmt.Fprintf(setgroups, "deny"); err != nil { fmt.Fprintf(continueWrite, "error writing 'deny' to /proc/%s/setgroups: %v", pidString, err) return fmt.Errorf("writing 'deny' to /proc/%s/setgroups: %w", pidString, err) } } gidmap, err := os.OpenFile(fmt.Sprintf("/proc/%s/gid_map", pidString), os.O_TRUNC|os.O_WRONLY, 0) if err != nil { fmt.Fprintf(continueWrite, "opening /proc/%s/gid_map: %v", pidString, err) return fmt.Errorf("opening /proc/%s/gid_map: %w", pidString, err) } defer gidmap.Close() if _, err := fmt.Fprintf(gidmap, "%s", g.String()); err != nil { fmt.Fprintf(continueWrite, "writing %q to /proc/%s/gid_map: %v", g.String(), pidString, err) return fmt.Errorf("writing %q to /proc/%s/gid_map: %w", g.String(), pidString, err) } } } if len(c.UidMappings) > 0 { // Build the UID map, since writing to the proc file has to be done all at once. u := new(bytes.Buffer) for _, m := range c.UidMappings { fmt.Fprintf(u, "%d %d %d\n", m.ContainerID, m.HostID, m.Size) } uidmapSet := false // Set the UID map. if c.UseNewuidmap { path, err := exec.LookPath("newuidmap") if err != nil { return fmt.Errorf("finding newuidmap: %w", err) } cmd := exec.Command(path, append([]string{pidString}, strings.Fields(u.String())...)...) u.Reset() cmd.Stdout = u cmd.Stderr = u if err := cmd.Run(); err == nil { uidmapSet = true } else { logrus.Warnf("Error running newuidmap: %v: %s", err, u.String()) isSetuid, err := IsSetID(path, os.ModeSetuid, capability.CAP_SETUID) if err != nil { logrus.Warnf("Failed to check for setuid on %s: %v", path, err) } else { if !isSetuid { logrus.Warnf("%s should be setuid or have filecaps setuid", path) } } logrus.Warnf("Falling back to single mapping") u.Reset() fmt.Fprintf(u, "0 %d 1\n", os.Geteuid()) } } if !uidmapSet { uidmap, err := os.OpenFile(fmt.Sprintf("/proc/%s/uid_map", pidString), os.O_TRUNC|os.O_WRONLY, 0) if err != nil { fmt.Fprintf(continueWrite, "error opening /proc/%s/uid_map: %v", pidString, err) return fmt.Errorf("opening /proc/%s/uid_map: %w", pidString, err) } defer uidmap.Close() if _, err := fmt.Fprintf(uidmap, "%s", u.String()); err != nil { fmt.Fprintf(continueWrite, "error writing %q to /proc/%s/uid_map: %v", u.String(), pidString, err) return fmt.Errorf("writing %q to /proc/%s/uid_map: %w", u.String(), pidString, err) } } } } if c.OOMScoreAdj != nil { oomScoreAdj, err := os.OpenFile(fmt.Sprintf("/proc/%s/oom_score_adj", pidString), os.O_TRUNC|os.O_WRONLY, 0) if err != nil { fmt.Fprintf(continueWrite, "error opening oom_score_adj: %v", err) return fmt.Errorf("opening /proc/%s/oom_score_adj: %w", pidString, err) } defer oomScoreAdj.Close() if _, err := fmt.Fprintf(oomScoreAdj, "%d\n", *c.OOMScoreAdj); err != nil { fmt.Fprintf(continueWrite, "error writing \"%d\" to oom_score_adj: %v", c.OOMScoreAdj, err) return fmt.Errorf("writing \"%d\" to /proc/%s/oom_score_adj: %w", c.OOMScoreAdj, pidString, err) } } // Run any additional setup that we want to do before the child starts running proper. if c.Hook != nil { if err = c.Hook(pid); err != nil { fmt.Fprintf(continueWrite, "hook error: %v", err) return err } } return nil } func (c *Cmd) Run() error { if err := c.Start(); err != nil { return err } return c.Wait() } func (c *Cmd) CombinedOutput() ([]byte, error) { return nil, errors.New("unshare: CombinedOutput() not implemented") } func (c *Cmd) Output() ([]byte, error) { return nil, errors.New("unshare: Output() not implemented") } var ( isRootlessOnce sync.Once isRootless bool ) const ( // UsernsEnvName is the environment variable, if set indicates in rootless mode UsernsEnvName = "_CONTAINERS_USERNS_CONFIGURED" ) // hasFullUsersMappings checks whether the current user namespace has all the IDs mapped. func hasFullUsersMappings() (bool, error) { content, err := os.ReadFile("/proc/self/uid_map") if err != nil { return false, err } // The kernel rejects attempts to create mappings where either starting // point is (u32)-1: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/kernel/user_namespace.c?id=af3e9579ecfb#n1006 . // So, if the uid_map contains 4294967295, the entire IDs space is available in the // user namespace, so it is likely the initial user namespace. return bytes.Contains(content, []byte("4294967295")), nil } var ( hasCapSysAdminOnce sync.Once hasCapSysAdminRet bool hasCapSysAdminErr error ) // IsRootless tells us if we are running in rootless mode func IsRootless() bool { isRootlessOnce.Do(func() { isRootless = getRootlessUID() != 0 || getenv(UsernsEnvName) != "" if !isRootless { hasCapSysAdmin, err := HasCapSysAdmin() if err != nil { logrus.Warnf("Failed to read CAP_SYS_ADMIN presence for the current process") } if err == nil && !hasCapSysAdmin { isRootless = true } } if !isRootless { hasMappings, err := hasFullUsersMappings() if err != nil { logrus.Warnf("Failed to read current user namespace mappings") } if err == nil && !hasMappings { isRootless = true } } }) return isRootless } // GetRootlessUID returns the UID of the user in the parent userNS func GetRootlessUID() int { uidEnv := getenv("_CONTAINERS_ROOTLESS_UID") if uidEnv != "" { u, _ := strconv.Atoi(uidEnv) return u } return os.Getuid() } // GetRootlessGID returns the GID of the user in the parent userNS func GetRootlessGID() int { gidEnv := getenv("_CONTAINERS_ROOTLESS_GID") if gidEnv != "" { u, _ := strconv.Atoi(gidEnv) return u } return os.Getgid() } // RootlessEnv returns the environment settings for the rootless containers func RootlessEnv() []string { return append(os.Environ(), UsernsEnvName+"=done") } type Runnable interface { Run() error } func bailOnError(err error, format string, a ...any) { //nolint:revive,goprintffuncname if err != nil { if format != "" { logrus.Errorf("%s: %v", fmt.Sprintf(format, a...), err) } else { logrus.Errorf("%v", err) } os.Exit(1) } } // MaybeReexecUsingUserNamespace re-exec the process in a new namespace func MaybeReexecUsingUserNamespace(evenForRoot bool) { // If we've already been through this once, no need to try again. if os.Geteuid() == 0 && GetRootlessUID() > 0 { return } var uidNum, gidNum uint64 // Figure out who we are. me, err := user.Current() if !os.IsNotExist(err) { bailOnError(err, "error determining current user") uidNum, err = strconv.ParseUint(me.Uid, 10, 32) bailOnError(err, "error parsing current UID %s", me.Uid) gidNum, err = strconv.ParseUint(me.Gid, 10, 32) bailOnError(err, "error parsing current GID %s", me.Gid) } runtime.LockOSThread() defer runtime.UnlockOSThread() // ID mappings to use to reexec ourselves. var uidmap, gidmap []specs.LinuxIDMapping if uidNum != 0 || evenForRoot { // Read the set of ID mappings that we're allowed to use. Each // range in /etc/subuid and /etc/subgid file is a starting host // ID and a range size. uidmap, gidmap, err = GetSubIDMappings(me.Username, me.Username) if err != nil { logrus.Warnf("Reading allowed ID mappings: %v", err) } if len(uidmap) == 0 { logrus.Warnf("Found no UID ranges set aside for user %q in /etc/subuid.", me.Username) } if len(gidmap) == 0 { logrus.Warnf("Found no GID ranges set aside for user %q in /etc/subgid.", me.Username) } // Map our UID and GID, then the subuid and subgid ranges, // consecutively, starting at 0, to get the mappings to use for // a copy of ourselves. uidmap = append([]specs.LinuxIDMapping{{HostID: uint32(uidNum), ContainerID: 0, Size: 1}}, uidmap...) gidmap = append([]specs.LinuxIDMapping{{HostID: uint32(gidNum), ContainerID: 0, Size: 1}}, gidmap...) var rangeStart uint32 for i := range uidmap { uidmap[i].ContainerID = rangeStart rangeStart += uidmap[i].Size } rangeStart = 0 for i := range gidmap { gidmap[i].ContainerID = rangeStart rangeStart += gidmap[i].Size } } else { // If we have CAP_SYS_ADMIN, then we don't need to create a new namespace in order to be able // to use unshare(), so don't bother creating a new user namespace at this point. capabilities, err := capability.NewPid2(0) bailOnError(err, "Initializing a new Capabilities object of pid 0") err = capabilities.Load() bailOnError(err, "Reading the current capabilities sets") if capabilities.Get(capability.EFFECTIVE, capability.CAP_SYS_ADMIN) { return } // Read the set of ID mappings that we're currently using. uidmap, gidmap, err = GetHostIDMappings("") bailOnError(err, "Reading current ID mappings") // Just reuse them. for i := range uidmap { uidmap[i].HostID = uidmap[i].ContainerID } for i := range gidmap { gidmap[i].HostID = gidmap[i].ContainerID } } // Unlike most uses of reexec or unshare, we're using a name that // _won't_ be recognized as a registered reexec handler, since we // _want_ to fall through reexec.Init() to the normal main(). cmd := Command(append([]string{fmt.Sprintf("%s-in-a-user-namespace", os.Args[0])}, os.Args[1:]...)...) // If, somehow, we don't become UID 0 in our child, indicate that the child shouldn't try again. err = os.Setenv(UsernsEnvName, "1") bailOnError(err, "error setting %s=1 in environment", UsernsEnvName) // Set the default isolation type to use the "rootless" method. if _, present := os.LookupEnv("BUILDAH_ISOLATION"); !present { if err = os.Setenv("BUILDAH_ISOLATION", "rootless"); err != nil { if err := os.Setenv("BUILDAH_ISOLATION", "rootless"); err != nil { logrus.Errorf("Setting BUILDAH_ISOLATION=rootless in environment: %v", err) os.Exit(1) } } } // Reuse our stdio. cmd.Stdin = os.Stdin cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr // Set up a new user namespace with the ID mapping. cmd.UnshareFlags = syscall.CLONE_NEWUSER | syscall.CLONE_NEWNS cmd.UseNewuidmap = uidNum != 0 cmd.UidMappings = uidmap cmd.UseNewgidmap = uidNum != 0 cmd.GidMappings = gidmap cmd.GidMappingsEnableSetgroups = true // Finish up. logrus.Debugf("Running %+v with environment %+v, UID map %+v, and GID map %+v", cmd.Cmd.Args, os.Environ(), cmd.UidMappings, cmd.GidMappings) // Forward SIGHUP, SIGINT, and SIGTERM to our child process. interrupted := make(chan os.Signal, 100) defer func() { signal.Stop(interrupted) close(interrupted) }() cmd.Hook = func(int) error { go func() { for receivedSignal := range interrupted { if err := cmd.Cmd.Process.Signal(receivedSignal); err != nil { logrus.Warnf( "Failed to send a signal '%d' to the Process (PID: %d): %v", receivedSignal, cmd.Cmd.Process.Pid, err, ) } } }() return nil } signal.Notify(interrupted, syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM) // Make sure our child process gets SIGKILLed if we exit, for whatever // reason, before it does. if cmd.Cmd.SysProcAttr == nil { cmd.Cmd.SysProcAttr = &syscall.SysProcAttr{} } cmd.Cmd.SysProcAttr.Pdeathsig = syscall.SIGKILL ExecRunnable(cmd, nil) } // ExecRunnable runs the specified unshare command, captures its exit status, // and exits with the same status. func ExecRunnable(cmd Runnable, cleanup func()) { exit := func(status int) { if cleanup != nil { cleanup() } os.Exit(status) } if err := cmd.Run(); err != nil { if exitError, ok := err.(*exec.ExitError); ok { if exitError.ProcessState.Exited() { if waitStatus, ok := exitError.ProcessState.Sys().(syscall.WaitStatus); ok { if waitStatus.Exited() { logrus.Debugf("%v", exitError) exit(waitStatus.ExitStatus()) } if waitStatus.Signaled() { logrus.Debugf("%v", exitError) exit(int(waitStatus.Signal()) + 128) } } } } logrus.Errorf("%v", err) logrus.Errorf("(Unable to determine exit status)") exit(1) } exit(0) } // getHostIDMappings reads mappings from the named node under /proc. func getHostIDMappings(path string) ([]specs.LinuxIDMapping, error) { var mappings []specs.LinuxIDMapping f, err := os.Open(path) if err != nil { return nil, fmt.Errorf("reading ID mappings from %q: %w", path, err) } defer f.Close() scanner := bufio.NewScanner(f) for scanner.Scan() { line := scanner.Text() fields := strings.Fields(line) if len(fields) != 3 { return nil, fmt.Errorf("line %q from %q has %d fields, not 3", line, path, len(fields)) } cid, err := strconv.ParseUint(fields[0], 10, 32) if err != nil { return nil, fmt.Errorf("parsing container ID value %q from line %q in %q: %w", fields[0], line, path, err) } hid, err := strconv.ParseUint(fields[1], 10, 32) if err != nil { return nil, fmt.Errorf("parsing host ID value %q from line %q in %q: %w", fields[1], line, path, err) } size, err := strconv.ParseUint(fields[2], 10, 32) if err != nil { return nil, fmt.Errorf("parsing size value %q from line %q in %q: %w", fields[2], line, path, err) } mappings = append(mappings, specs.LinuxIDMapping{ContainerID: uint32(cid), HostID: uint32(hid), Size: uint32(size)}) } return mappings, nil } // GetHostIDMappings reads mappings for the specified process (or the current // process if pid is "self" or an empty string) from the kernel. func GetHostIDMappings(pid string) ([]specs.LinuxIDMapping, []specs.LinuxIDMapping, error) { if pid == "" { pid = "self" } uidmap, err := getHostIDMappings(fmt.Sprintf("/proc/%s/uid_map", pid)) if err != nil { return nil, nil, err } gidmap, err := getHostIDMappings(fmt.Sprintf("/proc/%s/gid_map", pid)) if err != nil { return nil, nil, err } return uidmap, gidmap, nil } // GetSubIDMappings reads mappings from /etc/subuid and /etc/subgid. func GetSubIDMappings(user, group string) ([]specs.LinuxIDMapping, []specs.LinuxIDMapping, error) { mappings, err := idtools.NewIDMappings(user, group) if err != nil { return nil, nil, fmt.Errorf("reading subuid mappings for user %q and subgid mappings for group %q: %w", user, group, err) } var uidmap, gidmap []specs.LinuxIDMapping for _, m := range mappings.UIDs() { uidmap = append(uidmap, specs.LinuxIDMapping{ ContainerID: uint32(m.ContainerID), HostID: uint32(m.HostID), Size: uint32(m.Size), }) } for _, m := range mappings.GIDs() { gidmap = append(gidmap, specs.LinuxIDMapping{ ContainerID: uint32(m.ContainerID), HostID: uint32(m.HostID), Size: uint32(m.Size), }) } return uidmap, gidmap, nil } // ParseIDMappings parses mapping triples. func ParseIDMappings(uidmap, gidmap []string) ([]idtools.IDMap, []idtools.IDMap, error) { uid, err := idtools.ParseIDMap(uidmap, "userns-uid-map") if err != nil { return nil, nil, err } gid, err := idtools.ParseIDMap(gidmap, "userns-gid-map") if err != nil { return nil, nil, err } return uid, gid, nil } // HasCapSysAdmin returns whether the current process has CAP_SYS_ADMIN. func HasCapSysAdmin() (bool, error) { hasCapSysAdminOnce.Do(func() { currentCaps, err := capability.NewPid2(0) if err != nil { hasCapSysAdminErr = err return } if err = currentCaps.Load(); err != nil { hasCapSysAdminErr = err return } hasCapSysAdminRet = currentCaps.Get(capability.EFFECTIVE, capability.CAP_SYS_ADMIN) }) return hasCapSysAdminRet, hasCapSysAdminErr } ================================================ FILE: vendor/go.podman.io/storage/pkg/unshare/unshare_unsupported.go ================================================ //go:build !linux && !darwin package unshare import ( "os" "github.com/opencontainers/runtime-spec/specs-go" "go.podman.io/storage/pkg/idtools" ) const ( // UsernsEnvName is the environment variable, if set indicates in rootless mode UsernsEnvName = "_CONTAINERS_USERNS_CONFIGURED" ) // IsRootless tells us if we are running in rootless mode func IsRootless() bool { return os.Getuid() != 0 } // GetRootlessUID returns the UID of the user in the parent userNS func GetRootlessUID() int { return os.Getuid() } // GetRootlessGID returns the GID of the user in the parent userNS func GetRootlessGID() int { return os.Getgid() } // RootlessEnv returns the environment settings for the rootless containers func RootlessEnv() []string { return append(os.Environ(), UsernsEnvName+"=") } // MaybeReexecUsingUserNamespace re-exec the process in a new namespace func MaybeReexecUsingUserNamespace(evenForRoot bool) { } // GetHostIDMappings reads mappings for the specified process (or the current // process if pid is "self" or an empty string) from the kernel. func GetHostIDMappings(pid string) ([]specs.LinuxIDMapping, []specs.LinuxIDMapping, error) { return nil, nil, nil } // ParseIDMappings parses mapping triples. func ParseIDMappings(uidmap, gidmap []string) ([]idtools.IDMap, []idtools.IDMap, error) { return nil, nil, nil } // HasCapSysAdmin returns whether the current process has CAP_SYS_ADMIN. func HasCapSysAdmin() (bool, error) { return os.Geteuid() == 0, nil } ================================================ FILE: vendor/go.podman.io/storage/pkg/unshare/unshare_unsupported_cgo.go ================================================ //go:build cgo && !(linux || freebsd) package unshare // Go refuses to compile a subpackage with CGO_ENABLED=1 if there is a *.c file but no 'import "C"'. // OTOH if we did have an 'import "C"', the Linux-only code would fail to compile. // So, satisfy the Go compiler by using import "C" but #ifdef-ing out all of the code. // #cgo CPPFLAGS: -DUNSHARE_NO_CODE_AT_ALL import "C" ================================================ FILE: vendor/go.podman.io/storage/storage.conf ================================================ # This file is the configuration file for all tools # that use the containers/storage library. The storage.conf file # overrides all other storage.conf files. Container engines using the # container/storage library do not inherit fields from other storage.conf # files. # # Note: The storage.conf file overrides other storage.conf files based on this precedence: # /usr/containers/storage.conf # /etc/containers/storage.conf # $HOME/.config/containers/storage.conf # $XDG_CONFIG_HOME/containers/storage.conf (if XDG_CONFIG_HOME is set) # See man 5 containers-storage.conf for more information # The "storage" table contains all of the server options. [storage] # Default storage driver, must be set for proper operation. driver = "overlay" # Temporary storage location runroot = "/run/containers/storage" # Priority list for the storage drivers that will be tested one # after the other to pick the storage driver if it is not defined. # driver_priority = ["overlay", "btrfs"] # Primary Read/Write location of container storage # When changing the graphroot location on an SELinux system, you must # ensure the labeling matches the default location's labels with the # following commands: # semanage fcontext -a -e /var/lib/containers/storage /NEWSTORAGEPATH # restorecon -R -v /NEWSTORAGEPATH graphroot = "/var/lib/containers/storage" # Optional alternate location of image store if a location separate from the # container store is required. If set, it must be different than graphroot. # imagestore = "" # Storage path for rootless users # # rootless_storage_path = "$HOME/.local/share/containers/storage" # Transient store mode makes all container metadata be saved in temporary storage # (i.e. runroot above). This is faster, but doesn't persist across reboots. # Additional garbage collection must also be performed at boot-time, so this # option should remain disabled in most configurations. # transient_store = true [storage.options] # Storage options to be passed to underlying storage drivers # AdditionalImageStores is used to pass paths to additional Read/Only image stores # Must be comma separated list. additionalimagestores = [ ] # Options controlling how storage is populated when pulling images. [storage.options.pull_options] # Enable the "zstd:chunked" feature, which allows partial pulls, reusing # content that already exists on the system. This is disabled by default, # and must be explicitly enabled to be used. For more on zstd:chunked, see # https://github.com/containers/storage/blob/main/docs/containers-storage-zstd-chunked.md # This is a "string bool": "false" | "true" (cannot be native TOML boolean) # enable_partial_images = "false" # Tells containers/storage to use hard links rather then create new files in # the image, if an identical file already existed in storage. # This is a "string bool": "false" | "true" (cannot be native TOML boolean) # use_hard_links = "false" # Path to an ostree repository that might have # previously pulled content which can be used when attempting to avoid # pulling content from the container registry. # ostree_repos="" # If set to "true", containers/storage will convert images that are # not already in zstd:chunked format to that format before processing # in order to take advantage of local deduplication and hard linking. # It is an expensive operation so it is not enabled by default. # This is a "string bool": "false" | "true" (cannot be native TOML boolean) # convert_images = "false" # This should ALMOST NEVER be set. # It allows partial pulls of images without guaranteeing that "partial # pulls" and non-partial pulls both result in consistent image contents. # This allows pulling estargz images and early versions of zstd:chunked images; # otherwise, these layers always use the traditional non-partial pull path. # # This option should be enabled EXTREMELY rarely, only if ALL images that could # EVER be conceivably pulled on this system are GUARANTEED (e.g. using a signature policy) # to come from a build system trusted to never attack image integrity. # # If this consistency enforcement were disabled, malicious images could be built # in a way designed to evade other audit mechanisms, so presence of most other audit # mechanisms is not a replacement for the above-mentioned need for all images to come # from a trusted build system. # # As a side effect, enabling this option will also make image IDs unpredictable # (usually not equal to the traditional value matching the config digest). # insecure_allow_unpredictable_image_contents = "false" # Root-auto-userns-user is a user name which can be used to look up one or more UID/GID # ranges in the /etc/subuid and /etc/subgid file. These ranges will be partitioned # to containers configured to create automatically a user namespace. Containers # configured to automatically create a user namespace can still overlap with containers # having an explicit mapping set. # This setting is ignored when running as rootless. # root-auto-userns-user = "storage" # # Auto-userns-min-size is the minimum size for a user namespace created automatically. # auto-userns-min-size=1024 # # Auto-userns-max-size is the maximum size for a user namespace created automatically. # auto-userns-max-size=65536 [storage.options.overlay] # ignore_chown_errors can be set to allow a non privileged user running with # a single UID within a user namespace to run containers. The user can pull # and use any image even those with multiple uids. Note multiple UIDs will be # squashed down to the default uid in the container. These images will have no # separation between the users in the container. Only supported for the overlay # and vfs drivers. # This is a "string bool": "false" | "true" (cannot be native TOML boolean) #ignore_chown_errors = "false" # Inodes is used to set a maximum inodes of the container image. # inodes = "" # Path to an helper program to use for mounting the file system instead of mounting it # directly. #mount_program = "/usr/bin/fuse-overlayfs" # mountopt specifies comma separated list of extra mount options mountopt = "nodev" # Set to skip a PRIVATE bind mount on the storage home directory. # This is a "string bool": "false" | "true" (cannot be native TOML boolean) # skip_mount_home = "false" # Set to use composefs to mount data layers with overlay. # This is a "string bool": "false" | "true" (cannot be native TOML boolean) # use_composefs = "false" # Size is used to set a maximum size of the container image. # size = "" # ForceMask specifies the permissions mask that is used for new files and # directories. # # The values "shared" and "private" are accepted. # Octal permission masks are also accepted. # # "": No value specified. # All files/directories, get set with the permissions identified within the # image. # "private": it is equivalent to 0700. # All files/directories get set with 0700 permissions. The owner has rwx # access to the files. No other users on the system can access the files. # This setting could be used with networked based homedirs. # "shared": it is equivalent to 0755. # The owner has rwx access to the files and everyone else can read, access # and execute them. This setting is useful for sharing containers storage # with other users. For instance have a storage owned by root but shared # to rootless users as an additional store. # NOTE: All files within the image are made readable and executable by any # user on the system. Even /etc/shadow within your image is now readable by # any user. # # OCTAL: Users can experiment with other OCTAL Permissions. # # Note: The force_mask Flag is an experimental feature, it could change in the # future. When "force_mask" is set the original permission mask is stored in # the "user.containers.override_stat" xattr and the "mount_program" option must # be specified. Mount programs like "/usr/bin/fuse-overlayfs" present the # extended attribute permissions to processes within containers rather than the # "force_mask" permissions. # # force_mask = "" ================================================ FILE: vendor/go.podman.io/storage/storage.conf-freebsd ================================================ # This file is is the configuration file for all tools # that use the containers/storage library. The storage.conf file # overrides all other storage.conf files. Container engines using the # container/storage library do not inherit fields from other storage.conf # files. # # Note: The storage.conf file overrides other storage.conf files based on this precedence: # /usr/local/share/containers/storage.conf # /usr/local/etc/containers/storage.conf # $HOME/.config/containers/storage.conf # $XDG_CONFIG_HOME/containers/storage.conf (If XDG_CONFIG_HOME is set) # See man 5 containers-storage.conf for more information # The "container storage" table contains all of the server options. [storage] # Default Storage Driver, Must be set for proper operation. driver = "zfs" # Temporary storage location runroot = "/var/run/containers/storage" # Primary Read/Write location of container storage graphroot = "/var/db/containers/storage" # Optional value for image storage location # If set, it must be different than graphroot. # imagestore = "" # Storage path for rootless users # # rootless_storage_path = "$HOME/.local/share/containers/storage" [storage.options] # Storage options to be passed to underlying storage drivers # AdditionalImageStores is used to pass paths to additional Read/Only image stores # Must be comma separated list. additionalimagestores = [ ] # Root-auto-userns-user is a user name which can be used to look up one or more UID/GID # ranges in the /etc/subuid and /etc/subgid file. These ranges will be partitioned # to containers configured to create automatically a user namespace. Containers # configured to automatically create a user namespace can still overlap with containers # having an explicit mapping set. # This setting is ignored when running as rootless. # root-auto-userns-user = "storage" # # Auto-userns-min-size is the minimum size for a user namespace created automatically. # auto-userns-min-size=1024 # # Auto-userns-max-size is the maximum size for a user namespace created automatically. # auto-userns-max-size=65536 [storage.options.overlay] # ignore_chown_errors can be set to allow a non privileged user running with # a single UID within a user namespace to run containers. The user can pull # and use any image even those with multiple uids. Note multiple UIDs will be # squashed down to the default uid in the container. These images will have no # separation between the users in the container. Only supported for the overlay # and vfs drivers. #ignore_chown_errors = "false" # Inodes is used to set a maximum inodes of the container image. # inodes = "" # Path to an helper program to use for mounting the file system instead of mounting it # directly. #mount_program = "/usr/bin/fuse-overlayfs" # mountopt specifies comma separated list of extra mount options mountopt = "nodev" # Set to skip a PRIVATE bind mount on the storage home directory. # skip_mount_home = "false" # Set to use composefs to mount data layers with overlay. # use_composefs = "false" # Size is used to set a maximum size of the container image. # size = "" # ForceMask specifies the permissions mask that is used for new files and # directories. # # The values "shared" and "private" are accepted. # Octal permission masks are also accepted. # # "": No value specified. # All files/directories, get set with the permissions identified within the # image. # "private": it is equivalent to 0700. # All files/directories get set with 0700 permissions. The owner has rwx # access to the files. No other users on the system can access the files. # This setting could be used with networked based homedirs. # "shared": it is equivalent to 0755. # The owner has rwx access to the files and everyone else can read, access # and execute them. This setting is useful for sharing containers storage # with other users. For instance have a storage owned by root but shared # to rootless users as an additional store. # NOTE: All files within the image are made readable and executable by any # user on the system. Even /etc/shadow within your image is now readable by # any user. # # OCTAL: Users can experiment with other OCTAL Permissions. # # Note: The force_mask Flag is an experimental feature, it could change in the # future. When "force_mask" is set the original permission mask is stored in # the "user.containers.override_stat" xattr and the "mount_program" option must # be specified. Mount programs like "/usr/bin/fuse-overlayfs" present the # extended attribute permissions to processes within containers rather then the # "force_mask" permissions. # # force_mask = "" ================================================ FILE: vendor/go.podman.io/storage/store.go ================================================ package storage import ( _ "embed" "encoding/base64" "errors" "fmt" "io" "maps" "os" "path/filepath" "reflect" "slices" "strings" "sync" "syscall" "time" // register all of the built-in drivers _ "go.podman.io/storage/drivers/register" "golang.org/x/sync/errgroup" digest "github.com/opencontainers/go-digest" "github.com/opencontainers/selinux/go-selinux/label" "github.com/sirupsen/logrus" drivers "go.podman.io/storage/drivers" "go.podman.io/storage/internal/dedup" "go.podman.io/storage/internal/tempdir" "go.podman.io/storage/pkg/archive" "go.podman.io/storage/pkg/directory" "go.podman.io/storage/pkg/idtools" "go.podman.io/storage/pkg/ioutils" "go.podman.io/storage/pkg/lockfile" "go.podman.io/storage/pkg/parsers" "go.podman.io/storage/pkg/stringutils" "go.podman.io/storage/pkg/system" "go.podman.io/storage/types" ) type updateNameOperation int const ( setNames updateNameOperation = iota addNames removeNames ) const ( volatileFlag = "Volatile" mountLabelFlag = "MountLabel" processLabelFlag = "ProcessLabel" mountOptsFlag = "MountOpts" ) var ( stores []*store storesLock sync.Mutex ) // roMetadataStore wraps a method for reading metadata associated with an ID. type roMetadataStore interface { // Metadata reads metadata associated with an item with the specified ID. Metadata(id string) (string, error) } // rwMetadataStore wraps a method for setting metadata associated with an ID. type rwMetadataStore interface { // SetMetadata updates the metadata associated with the item with the specified ID. SetMetadata(id, metadata string) error } // metadataStore wraps up methods for getting and setting metadata associated with IDs. type metadataStore interface { roMetadataStore rwMetadataStore } // ApplyStagedLayerOptions contains options to pass to ApplyStagedLayer type ApplyStagedLayerOptions struct { ID string // Mandatory ParentLayer string // Optional Names []string // Optional MountLabel string // Optional Writeable bool // Optional LayerOptions *LayerOptions // Optional DiffOutput *drivers.DriverWithDifferOutput // Mandatory DiffOptions *drivers.ApplyDiffWithDifferOpts // Mandatory } // MultiListOptions contains options to pass to MultiList type MultiListOptions struct { Images bool // if true, Images will be listed in the result Layers bool // if true, layers will be listed in the result Containers bool // if true, containers will be listed in the result } // MultiListResult contains slices of Images, Layers or Containers listed by MultiList method type MultiListResult struct { Images []Image Layers []Layer Containers []Container } // An roBigDataStore wraps up the read-only big-data related methods of the // various types of file-based lookaside stores that we implement. type roBigDataStore interface { // BigData retrieves a (potentially large) piece of data associated with // this ID, if it has previously been set. BigData(id, key string) ([]byte, error) // BigDataSize retrieves the size of a (potentially large) piece of // data associated with this ID, if it has previously been set. BigDataSize(id, key string) (int64, error) // BigDataDigest retrieves the digest of a (potentially large) piece of // data associated with this ID, if it has previously been set. BigDataDigest(id, key string) (digest.Digest, error) // BigDataNames() returns a list of the names of previously-stored pieces of // data. BigDataNames(id string) ([]string, error) } // A rwImageBigDataStore wraps up how we store big-data associated with images. type rwImageBigDataStore interface { // SetBigData stores a (potentially large) piece of data associated // with this ID. // Pass github.com/containers/image/manifest.Digest as digestManifest // to allow ByDigest to find images by their correct digests. SetBigData(id, key string, data []byte, digestManifest func([]byte) (digest.Digest, error)) error } // A containerBigDataStore wraps up how we store big-data associated with containers. type containerBigDataStore interface { roBigDataStore // SetBigData stores a (potentially large) piece of data associated // with this ID. SetBigData(id, key string, data []byte) error } // A roLayerBigDataStore wraps up how we store RO big-data associated with layers. type roLayerBigDataStore interface { // SetBigData stores a (potentially large) piece of data associated // with this ID. BigData(id, key string) (io.ReadCloser, error) // BigDataNames() returns a list of the names of previously-stored pieces of // data. BigDataNames(id string) ([]string, error) } // A rwLayerBigDataStore wraps up how we store big-data associated with layers. type rwLayerBigDataStore interface { // SetBigData stores a (potentially large) piece of data associated // with this ID. SetBigData(id, key string, data io.Reader) error } // A flaggableStore can have flags set and cleared on items which it manages. type flaggableStore interface { // ClearFlag removes a named flag from an item in the store. ClearFlag(id string, flag string) error // SetFlag sets a named flag and its value on an item in the store. SetFlag(id string, flag string, value any) error } type StoreOptions = types.StoreOptions type DedupHashMethod = dedup.DedupHashMethod const ( DedupHashInvalid = dedup.DedupHashInvalid DedupHashCRC = dedup.DedupHashCRC DedupHashFileSize = dedup.DedupHashFileSize DedupHashSHA256 = dedup.DedupHashSHA256 ) type ( DedupOptions = dedup.DedupOptions DedupResult = dedup.DedupResult ) // DedupArgs is used to pass arguments to the Dedup command. type DedupArgs struct { // Options that are passed directly to the internal/dedup.DedupDirs function. Options DedupOptions } // Store wraps up the various types of file-based stores that we use into a // singleton object that initializes and manages them all together. type Store interface { // RunRoot, GraphRoot, GraphDriverName, and GraphOptions retrieve // settings that were passed to GetStore() when the object was created. RunRoot() string GraphRoot() string ImageStore() string TransientStore() bool GraphDriverName() string GraphOptions() []string PullOptions() map[string]string UIDMap() []idtools.IDMap GIDMap() []idtools.IDMap // GraphDriver obtains and returns a handle to the graph Driver object used // by the Store. GraphDriver() (drivers.Driver, error) // CreateLayer creates a new layer in the underlying storage driver, // optionally having the specified ID (one will be assigned if none is // specified), with the specified layer (or no layer) as its parent, // and with optional names. (The writeable flag is ignored.) CreateLayer(id, parent string, names []string, mountLabel string, writeable bool, options *LayerOptions) (*Layer, error) // PutLayer combines the functions of CreateLayer and ApplyDiff, // marking the layer for automatic removal if applying the diff fails // for any reason. // // Note that we do some of this work in a child process. The calling // process's main() function needs to import our pkg/reexec package and // should begin with something like this in order to allow us to // properly start that child process: // if reexec.Init() { // return // } PutLayer(id, parent string, names []string, mountLabel string, writeable bool, options *LayerOptions, diff io.Reader) (*Layer, int64, error) // CreateImage creates a new image, optionally with the specified ID // (one will be assigned if none is specified), with optional names, // referring to a specified image, and with optional metadata. An // image is a record which associates the ID of a layer with a // additional bookkeeping information which the library stores for the // convenience of its caller. CreateImage(id string, names []string, layer, metadata string, options *ImageOptions) (*Image, error) // CreateContainer creates a new container, optionally with the // specified ID (one will be assigned if none is specified), with // optional names, using the specified image's top layer as the basis // for the container's layer, and assigning the specified ID to that // layer (one will be created if none is specified). A container is a // layer which is associated with additional bookkeeping information // which the library stores for the convenience of its caller. CreateContainer(id string, names []string, image, layer, metadata string, options *ContainerOptions) (*Container, error) // Metadata retrieves the metadata which is associated with a layer, // image, or container (whichever the passed-in ID refers to). Metadata(id string) (string, error) // SetMetadata updates the metadata which is associated with a layer, // image, or container (whichever the passed-in ID refers to) to match // the specified value. The metadata value can be retrieved at any // time using Metadata, or using Layer, Image, or Container and reading // the object directly. SetMetadata(id, metadata string) error // Exists checks if there is a layer, image, or container which has the // passed-in ID or name. Exists(id string) bool // Status asks for a status report, in the form of key-value pairs, // from the underlying storage driver. The contents vary from driver // to driver. Status() ([][2]string, error) // Delete removes the layer, image, or container which has the // passed-in ID or name. Note that no safety checks are performed, so // this can leave images with references to layers which do not exist, // and layers with references to parents which no longer exist. Delete(id string) error // DeleteLayer attempts to remove the specified layer. If the layer is the // parent of any other layer, or is referred to by any images, it will return // an error. DeleteLayer(id string) error // DeleteImage removes the specified image if it is not referred to by // any containers. If its top layer is then no longer referred to by // any other images and is not the parent of any other layers, its top // layer will be removed. If that layer's parent is no longer referred // to by any other images and is not the parent of any other layers, // then it, too, will be removed. This procedure will be repeated // until a layer which should not be removed, or the base layer, is // reached, at which point the list of removed layers is returned. If // the commit argument is false, the image and layers are not removed, // but the list of layers which would be removed is still returned. DeleteImage(id string, commit bool) (layers []string, err error) // DeleteContainer removes the specified container and its layer. If // there is no matching container, or if the container exists but its // layer does not, an error will be returned. DeleteContainer(id string) error // Wipe removes all known layers, images, and containers. Wipe() error // MountImage mounts an image to temp directory and returns the mount point. // MountImage allows caller to mount an image. Images will always // be mounted read/only MountImage(id string, mountOptions []string, mountLabel string) (string, error) // Unmount attempts to unmount an image, given an ID. // Returns whether or not the layer is still mounted. // WARNING: The return value may already be obsolete by the time it is available // to the caller, so it can be used for heuristic sanity checks at best. It should almost always be ignored. UnmountImage(id string, force bool) (bool, error) // Mount attempts to mount a layer, image, or container for access, and // returns the pathname if it succeeds. // Note if the mountLabel == "", the default label for the container // will be used. // // Note that we do some of this work in a child process. The calling // process's main() function needs to import our pkg/reexec package and // should begin with something like this in order to allow us to // properly start that child process: // if reexec.Init() { // return // } Mount(id, mountLabel string) (string, error) // Unmount attempts to unmount a layer, image, or container, given an ID, a // name, or a mount path. Returns whether or not the layer is still mounted. // WARNING: The return value may already be obsolete by the time it is available // to the caller, so it can be used for heuristic sanity checks at best. It should almost always be ignored. Unmount(id string, force bool) (bool, error) // Mounted returns number of times the layer has been mounted. // // WARNING: This value might already be obsolete by the time it is returned; // In situations where concurrent mount/unmount attempts can happen, this field // should not be used for any decisions, maybe apart from heuristic user warnings. Mounted(id string) (int, error) // Changes returns a summary of the changes which would need to be made // to one layer to make its contents the same as a second layer. If // the first layer is not specified, the second layer's parent is // assumed. Each Change structure contains a Path relative to the // layer's root directory, and a Kind which is either ChangeAdd, // ChangeModify, or ChangeDelete. Changes(from, to string) ([]archive.Change, error) // DiffSize returns a count of the size of the tarstream which would // specify the changes returned by Changes. DiffSize(from, to string) (int64, error) // Diff returns the tarstream which would specify the changes returned // by Changes. If options are passed in, they can override default // behaviors. Diff(from, to string, options *DiffOptions) (io.ReadCloser, error) // ApplyDiff applies a tarstream to a layer. Information about the // tarstream is cached with the layer. Typically, a layer which is // populated using a tarstream will be expected to not be modified in // any other way, either before or after the diff is applied. // // Note that we do some of this work in a child process. The calling // process's main() function needs to import our pkg/reexec package and // should begin with something like this in order to allow us to // properly start that child process: // if reexec.Init() { // return // } ApplyDiff(to string, diff io.Reader) (int64, error) // PrepareStagedLayer applies a diff to a layer. // It is the caller responsibility to clean the staging directory if it is not // successfully applied with ApplyStagedLayer. // The caller must ensure [Store.ApplyStagedLayer] or [Store.CleanupStagedLayer] is called eventually // with the returned [drivers.DriverWithDifferOutput] object. PrepareStagedLayer(options *drivers.ApplyDiffWithDifferOpts, differ drivers.Differ) (*drivers.DriverWithDifferOutput, error) // ApplyStagedLayer combines the functions of creating a layer and using the staging // directory to populate it. // It marks the layer for automatic removal if applying the diff fails for any reason. ApplyStagedLayer(args ApplyStagedLayerOptions) (*Layer, error) // CleanupStagedLayer cleanups the staging directory. It can be used to cleanup the staging directory on errors CleanupStagedLayer(diffOutput *drivers.DriverWithDifferOutput) error // DifferTarget gets the path to the differ target. DifferTarget(id string) (string, error) // LayersByCompressedDigest returns a slice of the layers with the // specified compressed digest value recorded for them. LayersByCompressedDigest(d digest.Digest) ([]Layer, error) // LayersByUncompressedDigest returns a slice of the layers with the // specified uncompressed digest value recorded for them. LayersByUncompressedDigest(d digest.Digest) ([]Layer, error) // LayersByTOCDigest returns a slice of the layers with the // specified TOC digest value recorded for them. LayersByTOCDigest(d digest.Digest) ([]Layer, error) // LayerSize returns a cached approximation of the layer's size, or -1 // if we don't have a value on hand. LayerSize(id string) (int64, error) // LayerParentOwners returns the UIDs and GIDs of owners of parents of // the layer's mountpoint for which the layer's UID and GID maps (if // any are defined) don't contain corresponding IDs. LayerParentOwners(id string) ([]int, []int, error) // Layers returns a list of the currently known layers. Layers() ([]Layer, error) // Images returns a list of the currently known images. Images() ([]Image, error) // Containers returns a list of the currently known containers. Containers() ([]Container, error) // Names returns the list of names for a layer, image, or container. Names(id string) ([]string, error) // Free removes the store from the list of stores Free() // SetNames changes the list of names for a layer, image, or container. // Duplicate names are removed from the list automatically. // Deprecated: Prone to race conditions, suggested alternatives are `AddNames` and `RemoveNames`. SetNames(id string, names []string) error // AddNames adds the list of names for a layer, image, or container. // Duplicate names are removed from the list automatically. AddNames(id string, names []string) error // RemoveNames removes the list of names for a layer, image, or container. // Duplicate names are removed from the list automatically. RemoveNames(id string, names []string) error // ListImageBigData retrieves a list of the (possibly large) chunks of // named data associated with an image. ListImageBigData(id string) ([]string, error) // ImageBigData retrieves a (possibly large) chunk of named data // associated with an image. ImageBigData(id, key string) ([]byte, error) // ImageBigDataSize retrieves the size of a (possibly large) chunk // of named data associated with an image. ImageBigDataSize(id, key string) (int64, error) // ImageBigDataDigest retrieves the digest of a (possibly large) chunk // of named data associated with an image. ImageBigDataDigest(id, key string) (digest.Digest, error) // SetImageBigData stores a (possibly large) chunk of named data // associated with an image. Pass // github.com/containers/image/manifest.Digest as digestManifest to // allow ImagesByDigest to find images by their correct digests. SetImageBigData(id, key string, data []byte, digestManifest func([]byte) (digest.Digest, error)) error // ImageDirectory returns a path of a directory which the caller can // use to store data, specific to the image, which the library does not // directly manage. The directory will be deleted when the image is // deleted. ImageDirectory(id string) (string, error) // ImageRunDirectory returns a path of a directory which the caller can // use to store data, specific to the image, which the library does not // directly manage. The directory will be deleted when the host system // is restarted. ImageRunDirectory(id string) (string, error) // ListLayerBigData retrieves a list of the (possibly large) chunks of // named data associated with a layer. ListLayerBigData(id string) ([]string, error) // LayerBigData retrieves a (possibly large) chunk of named data // associated with a layer. LayerBigData(id, key string) (io.ReadCloser, error) // SetLayerBigData stores a (possibly large) chunk of named data // associated with a layer. SetLayerBigData(id, key string, data io.Reader) error // ImageSize computes the size of the image's layers and ancillary data. ImageSize(id string) (int64, error) // ListContainerBigData retrieves a list of the (possibly large) chunks of // named data associated with a container. ListContainerBigData(id string) ([]string, error) // ContainerBigData retrieves a (possibly large) chunk of named data // associated with a container. ContainerBigData(id, key string) ([]byte, error) // ContainerBigDataSize retrieves the size of a (possibly large) // chunk of named data associated with a container. ContainerBigDataSize(id, key string) (int64, error) // ContainerBigDataDigest retrieves the digest of a (possibly large) // chunk of named data associated with a container. ContainerBigDataDigest(id, key string) (digest.Digest, error) // SetContainerBigData stores a (possibly large) chunk of named data // associated with a container. SetContainerBigData(id, key string, data []byte) error // ContainerSize computes the size of the container's layer and ancillary // data. Warning: this is a potentially expensive operation. ContainerSize(id string) (int64, error) // Layer returns a specific layer. Layer(id string) (*Layer, error) // Image returns a specific image. Image(id string) (*Image, error) // ImagesByTopLayer returns a list of images which reference the specified // layer as their top layer. They will have different IDs and names // and may have different metadata, big data items, and flags. ImagesByTopLayer(id string) ([]*Image, error) // ImagesByDigest returns a list of images which contain a big data item // named ImageDigestBigDataKey whose contents have the specified digest. ImagesByDigest(d digest.Digest) ([]*Image, error) // Container returns a specific container. Container(id string) (*Container, error) // ContainerByLayer returns a specific container based on its layer ID or // name. ContainerByLayer(id string) (*Container, error) // ContainerDirectory returns a path of a directory which the caller // can use to store data, specific to the container, which the library // does not directly manage. The directory will be deleted when the // container is deleted. ContainerDirectory(id string) (string, error) // SetContainerDirectoryFile is a convenience function which stores // a piece of data in the specified file relative to the container's // directory. SetContainerDirectoryFile(id, file string, data []byte) error // FromContainerDirectory is a convenience function which reads // the contents of the specified file relative to the container's // directory. FromContainerDirectory(id, file string) ([]byte, error) // ContainerRunDirectory returns a path of a directory which the // caller can use to store data, specific to the container, which the // library does not directly manage. The directory will be deleted // when the host system is restarted. ContainerRunDirectory(id string) (string, error) // SetContainerRunDirectoryFile is a convenience function which stores // a piece of data in the specified file relative to the container's // run directory. SetContainerRunDirectoryFile(id, file string, data []byte) error // FromContainerRunDirectory is a convenience function which reads // the contents of the specified file relative to the container's run // directory. FromContainerRunDirectory(id, file string) ([]byte, error) // ContainerParentOwners returns the UIDs and GIDs of owners of parents // of the container's layer's mountpoint for which the layer's UID and // GID maps (if any are defined) don't contain corresponding IDs. ContainerParentOwners(id string) ([]int, []int, error) // Lookup returns the ID of a layer, image, or container with the specified // name or ID. Lookup(name string) (string, error) // Shutdown attempts to free any kernel resources which are being used // by the underlying driver. If "force" is true, any mounted (i.e., in // use) layers are unmounted beforehand. If "force" is not true, then // layers being in use is considered to be an error condition. A list // of still-mounted layers is returned along with possible errors. Shutdown(force bool) (layers []string, err error) // Version returns version information, in the form of key-value pairs, from // the storage package. Version() ([][2]string, error) // GetDigestLock returns digest-specific Locker. GetDigestLock(digest.Digest) (Locker, error) // LayerFromAdditionalLayerStore searches the additional layer store and returns an object // which can create a layer with the specified TOC digest associated with the specified image // reference. Note that this hasn't been stored to this store yet: the actual creation of // a usable layer is done by calling the returned object's PutAs() method. After creating // a layer, the caller must then call the object's Release() method to free any temporary // resources which were allocated for the object by this method or the object's PutAs() // method. // This API is experimental and can be changed without bumping the major version number. LookupAdditionalLayer(tocDigest digest.Digest, imageref string) (AdditionalLayer, error) // Tries to clean up remainders of previous containers or layers that are not // references in the json files. These can happen in the case of unclean // shutdowns or regular restarts in transient store mode. GarbageCollect() error // Check returns a report of things that look wrong in the store. Check(options *CheckOptions) (CheckReport, error) // Repair attempts to remediate problems mentioned in the CheckReport, // usually by deleting layers and images which are damaged. If the // right options are set, it will remove containers as well. Repair(report CheckReport, options *RepairOptions) []error // MultiList returns a MultiListResult structure that contains layer, image, or container // extracts according to the values in MultiListOptions. // MultiList returns consistent values as of a single point in time. // WARNING: The values may already be out of date by the time they are returned to the caller. MultiList(MultiListOptions) (MultiListResult, error) // Dedup deduplicates layers in the store. Dedup(DedupArgs) (drivers.DedupResult, error) } // AdditionalLayer represents a layer that is contained in the additional layer store // This API is experimental and can be changed without bumping the major version number. type AdditionalLayer interface { // PutAs creates layer based on this handler, using diff contents from the additional // layer store. PutAs(id, parent string, names []string) (*Layer, error) // TOCDigest returns the digest of TOC of this layer. Returns "" if unknown. TOCDigest() digest.Digest // CompressedSize returns the compressed size of this layer CompressedSize() int64 // Release tells the additional layer store that we don't use this handler. Release() } type AutoUserNsOptions = types.AutoUserNsOptions type IDMappingOptions = types.IDMappingOptions // LayerOptions is used for passing options to a Store's CreateLayer() and PutLayer() methods. type LayerOptions struct { // IDMappingOptions specifies the type of ID mapping which should be // used for this layer. If nothing is specified, the layer will // inherit settings from its parent layer or, if it has no parent // layer, the Store object. types.IDMappingOptions // TemplateLayer is the ID of a layer whose contents will be used to // initialize this layer. If set, it should be a child of the layer // which we want to use as the parent of the new layer. TemplateLayer string // OriginalDigest specifies a digest of the (possibly-compressed) tarstream (diff), if one is // provided along with these LayerOptions, and reliably known by the caller. // The digest might not be exactly the digest of the provided tarstream // (e.g. the digest might be of a compressed representation, while providing // an uncompressed one); in that case the caller is responsible for the two matching. // Use the default "" if this fields is not applicable or the value is not known. OriginalDigest digest.Digest // OriginalSize specifies a size of the (possibly-compressed) tarstream corresponding // to OriginalDigest. // If the digest does not match the provided tarstream, OriginalSize must match OriginalDigest, // not the tarstream. // Use nil if not applicable or not known. OriginalSize *int64 // UncompressedDigest specifies a digest of the uncompressed version (“DiffID”) // of the tarstream (diff), if one is provided along with these LayerOptions, // and reliably known by the caller. // Use the default "" if this fields is not applicable or the value is not known. UncompressedDigest digest.Digest // True is the layer info can be treated as volatile Volatile bool // BigData is a set of items which should be stored with the layer. BigData []LayerBigDataOption // Flags is a set of named flags and their values to store with the layer. // Currently these can only be set when the layer record is created, but that // could change in the future. Flags map[string]any } type LayerBigDataOption struct { Key string Data io.Reader } // ImageOptions is used for passing options to a Store's CreateImage() method. type ImageOptions struct { // CreationDate, if not zero, will override the default behavior of marking the image as having been // created when CreateImage() was called, recording CreationDate instead. CreationDate time.Time // Digest is a hard-coded digest value that we can use to look up the image. It is optional. Digest digest.Digest // Digests is a list of digest values of the image's manifests, and // possibly a manually-specified value, that we can use to locate the // image. If Digest is set, its value is also in this list. Digests []digest.Digest // Metadata is caller-specified metadata associated with the layer. Metadata string // BigData is a set of items which should be stored with the image. BigData []ImageBigDataOption // NamesHistory is used for guessing for what this image was named when a container was created based // on it, but it no longer has any names. NamesHistory []string // Flags is a set of named flags and their values to store with the image. Currently these can only // be set when the image record is created, but that could change in the future. Flags map[string]any } type ImageBigDataOption struct { Key string Data []byte Digest digest.Digest } // ContainerOptions is used for passing options to a Store's CreateContainer() method. type ContainerOptions struct { // IDMappingOptions specifies the type of ID mapping which should be // used for this container's layer. If nothing is specified, the // container's layer will inherit settings from the image's top layer // or, if it is not being created based on an image, the Store object. types.IDMappingOptions LabelOpts []string // Flags is a set of named flags and their values to store with the container. // Currently these can only be set when the container record is created, but that // could change in the future. Flags map[string]any MountOpts []string Volatile bool StorageOpt map[string]string // Metadata is caller-specified metadata associated with the container. Metadata string // BigData is a set of items which should be stored for the container. BigData []ContainerBigDataOption } type ContainerBigDataOption struct { Key string Data []byte } type store struct { // # Locking hierarchy: // These locks do not all need to be held simultaneously, but if some code does need to lock more than one, it MUST do so in this order: // - graphLock // - layerStore.start{Reading,Writing} // - roLayerStores[].startReading (in the order of the items of the roLayerStores array) // - imageStore.start{Reading,Writing} // - roImageStores[].startReading (in the order of the items of the roImageStores array) // - containerStore.start{Reading,Writing} // The following fields are only set when constructing store, and must never be modified afterwards. // They are safe to access without any other locking. runRoot string graphDriverName string // Initially set to the user-requested value, possibly ""; updated during store construction, and does not change afterwards. graphDriverPriority []string // graphLock: // - Ensures that we always reload graphDriver, and the primary layer store, after any process does store.Shutdown. This is necessary // because (??) the Shutdown may forcibly unmount and clean up, affecting graph driver state in a way only a graph driver // and layer store reinitialization can notice. // - Ensures that store.Shutdown is exclusive with mount operations. This is necessary at because some // graph drivers call mount.MakePrivate() during initialization, the mount operations require that, and the driver’s Cleanup() method // may undo that. So, holding graphLock is required throughout the duration of Shutdown(), and the duration of any mount // (but not unmount) calls. // - Within this store object, protects access to some related in-memory state. graphLock *lockfile.LockFile usernsLock *lockfile.LockFile graphRoot string graphOptions []string imageStoreDir string pullOptions map[string]string uidMap []idtools.IDMap gidMap []idtools.IDMap autoUsernsUser string autoNsMinSize uint32 autoNsMaxSize uint32 imageStore rwImageStore rwImageStores []rwImageStore roImageStores []roImageStore containerStore rwContainerStore digestLockRoot string disableVolatile bool transientStore bool // The following fields can only be accessed with graphLock held. graphLockLastWrite lockfile.LastWrite // FIXME: This field is only set when holding graphLock, but locking rules of the driver // interface itself are not documented here. It is extensively used without holding graphLock. graphDriver drivers.Driver layerStoreUseGetters rwLayerStore // Almost all users should use the provided accessors instead of accessing this field directly. roLayerStoresUseGetters []roLayerStore // Almost all users should use the provided accessors instead of accessing this field directly. // FIXME: The following fields need locking, and don’t have it. additionalUIDs *idSet // Set by getAvailableIDs() additionalGIDs *idSet // Set by getAvailableIDs() } // GetStore attempts to find an already-created Store object matching the // specified location and graph driver, and if it can't, it creates and // initializes a new Store object, and the underlying storage that it controls. // // If StoreOptions `options` haven't been fully populated, then DefaultStoreOptions are used. // // These defaults observe environment variables: // - `STORAGE_DRIVER` for the name of the storage driver to attempt to use // - `STORAGE_OPTS` for the string of options to pass to the driver // // Note that we do some of this work in a child process. The calling process's // main() function needs to import our pkg/reexec package and should begin with // something like this in order to allow us to properly start that child // process: // // if reexec.Init() { // return // } func GetStore(options types.StoreOptions) (Store, error) { defaultOpts, err := types.Options() if err != nil { return nil, err } if options.RunRoot == "" && options.GraphRoot == "" && options.GraphDriverName == "" && len(options.GraphDriverOptions) == 0 { options = defaultOpts } if options.GraphRoot != "" { dir, err := filepath.Abs(options.GraphRoot) if err != nil { return nil, err } options.GraphRoot = dir } if options.RunRoot != "" { dir, err := filepath.Abs(options.RunRoot) if err != nil { return nil, err } options.RunRoot = dir } storesLock.Lock() defer storesLock.Unlock() // return if BOTH run and graph root are matched, otherwise our run-root can be overridden if the graph is found first for _, s := range stores { if (s.graphRoot == options.GraphRoot) && (s.runRoot == options.RunRoot) && (options.GraphDriverName == "" || s.graphDriverName == options.GraphDriverName) { return s, nil } } // if passed a run-root or graph-root alone, the other should be defaulted only error if we have neither. switch { case options.RunRoot == "" && options.GraphRoot == "": return nil, fmt.Errorf("no storage runroot or graphroot specified: %w", ErrIncompleteOptions) case options.GraphRoot == "": options.GraphRoot = defaultOpts.GraphRoot case options.RunRoot == "": options.RunRoot = defaultOpts.RunRoot } if err := os.MkdirAll(options.RunRoot, 0o700); err != nil { return nil, err } if err := os.MkdirAll(options.GraphRoot, 0o700); err != nil { return nil, err } if options.ImageStore != "" { if err := os.MkdirAll(options.ImageStore, 0o700); err != nil { return nil, err } } if err := os.MkdirAll(filepath.Join(options.GraphRoot, options.GraphDriverName), 0o700); err != nil { return nil, err } if options.ImageStore != "" { if err := os.MkdirAll(filepath.Join(options.ImageStore, options.GraphDriverName), 0o700); err != nil { return nil, err } } graphLock, err := lockfile.GetLockFile(filepath.Join(options.GraphRoot, "storage.lock")) if err != nil { return nil, err } usernsLock, err := lockfile.GetLockFile(filepath.Join(options.GraphRoot, "userns.lock")) if err != nil { return nil, err } autoNsMinSize := options.AutoNsMinSize autoNsMaxSize := options.AutoNsMaxSize if autoNsMinSize == 0 { autoNsMinSize = AutoUserNsMinSize } if autoNsMaxSize == 0 { autoNsMaxSize = AutoUserNsMaxSize } s := &store{ runRoot: options.RunRoot, graphDriverName: options.GraphDriverName, graphDriverPriority: options.GraphDriverPriority, graphLock: graphLock, usernsLock: usernsLock, graphRoot: options.GraphRoot, graphOptions: options.GraphDriverOptions, imageStoreDir: options.ImageStore, pullOptions: options.PullOptions, uidMap: copySlicePreferringNil(options.UIDMap), gidMap: copySlicePreferringNil(options.GIDMap), autoUsernsUser: options.RootAutoNsUser, autoNsMinSize: autoNsMinSize, autoNsMaxSize: autoNsMaxSize, disableVolatile: options.DisableVolatile, transientStore: options.TransientStore, additionalUIDs: nil, additionalGIDs: nil, } if err := s.load(); err != nil { return nil, err } stores = append(stores, s) return s, nil } func (s *store) RunRoot() string { return s.runRoot } func (s *store) GraphDriverName() string { return s.graphDriverName } func (s *store) GraphRoot() string { return s.graphRoot } func (s *store) ImageStore() string { return s.imageStoreDir } func (s *store) TransientStore() bool { return s.transientStore } func (s *store) GraphOptions() []string { return s.graphOptions } func (s *store) PullOptions() map[string]string { cp := make(map[string]string, len(s.pullOptions)) maps.Copy(cp, s.pullOptions) return cp } func (s *store) UIDMap() []idtools.IDMap { return copySlicePreferringNil(s.uidMap) } func (s *store) GIDMap() []idtools.IDMap { return copySlicePreferringNil(s.gidMap) } // This must only be called when constructing store; it writes to fields that are assumed to be constant after construction. func (s *store) load() error { var driver drivers.Driver if err := func() error { // A scope for defer s.graphLock.Lock() defer s.graphLock.Unlock() lastWrite, err := s.graphLock.GetLastWrite() if err != nil { return err } s.graphLockLastWrite = lastWrite driver, err = s.createGraphDriverLocked() if err != nil { return err } s.graphDriver = driver s.graphDriverName = driver.String() return nil }(); err != nil { return err } driverPrefix := s.graphDriverName + "-" imgStoreRoot := s.imageStoreDir if imgStoreRoot == "" { imgStoreRoot = s.graphRoot } gipath := filepath.Join(imgStoreRoot, driverPrefix+"images") if err := os.MkdirAll(gipath, 0o700); err != nil { return err } imageStore, err := newImageStore(gipath) if err != nil { return err } s.imageStore = imageStore s.rwImageStores = []rwImageStore{imageStore} gcpath := filepath.Join(s.graphRoot, driverPrefix+"containers") if err := os.MkdirAll(gcpath, 0o700); err != nil { return err } rcpath := filepath.Join(s.runRoot, driverPrefix+"containers") if err := os.MkdirAll(rcpath, 0o700); err != nil { return err } rcs, err := newContainerStore(gcpath, rcpath, s.transientStore) if err != nil { return err } s.containerStore = rcs additionalImageStores := s.graphDriver.AdditionalImageStores() if s.imageStoreDir != "" { additionalImageStores = append([]string{s.graphRoot}, additionalImageStores...) } for _, store := range additionalImageStores { gipath := filepath.Join(store, driverPrefix+"images") var ris roImageStore // both the graphdriver and the imagestore must be used read-write. if store == s.imageStoreDir || store == s.graphRoot { imageStore, err := newImageStore(gipath) if err != nil { return err } s.rwImageStores = append(s.rwImageStores, imageStore) ris = imageStore } else { ris, err = newROImageStore(gipath) if err != nil { if errors.Is(err, syscall.EROFS) { logrus.Debugf("Ignoring creation of lockfiles on read-only file systems %q, %v", gipath, err) continue } return err } } s.roImageStores = append(s.roImageStores, ris) } s.digestLockRoot = filepath.Join(s.runRoot, driverPrefix+"locks") if err := os.MkdirAll(s.digestLockRoot, 0o700); err != nil { return err } return nil } // GetDigestLock returns a digest-specific Locker. func (s *store) GetDigestLock(d digest.Digest) (Locker, error) { return lockfile.GetLockFile(filepath.Join(s.digestLockRoot, d.String())) } // startUsingGraphDriver obtains s.graphLock and ensures that s.graphDriver is set and fresh. // It only intended to be used on a fully-constructed store. // If this succeeds, the caller MUST call stopUsingGraphDriver(). func (s *store) startUsingGraphDriver() error { s.graphLock.Lock() succeeded := false defer func() { if !succeeded { s.graphLock.Unlock() } }() lastWrite, modified, err := s.graphLock.ModifiedSince(s.graphLockLastWrite) if err != nil { return err } if modified { driver, err := s.createGraphDriverLocked() if err != nil { return err } // Our concurrency design requires s.graphDriverName not to be modified after // store is constructed. // It’s fine for driver.String() not to match the requested graph driver name // (e.g. if the user asks for overlay2 and gets overlay), but it must be an idempotent // mapping: // driver1 := drivers.New(userInput, config) // name1 := driver1.String() // name2 := drivers.New(name1, config).String() // assert(name1 == name2) if s.graphDriverName != driver.String() { return fmt.Errorf("graph driver name changed from %q to %q during reload", s.graphDriverName, driver.String()) } s.graphDriver = driver s.layerStoreUseGetters = nil s.graphLockLastWrite = lastWrite } succeeded = true return nil } // stopUsingGraphDriver releases graphLock obtained by startUsingGraphDriver. func (s *store) stopUsingGraphDriver() { s.graphLock.Unlock() } // createGraphDriverLocked creates a new instance of graph driver for s, and returns it. // Almost all users should use startUsingGraphDriver instead. // The caller must hold s.graphLock. func (s *store) createGraphDriverLocked() (drivers.Driver, error) { config := drivers.Options{ Root: s.graphRoot, ImageStore: s.imageStoreDir, RunRoot: s.runRoot, DriverPriority: s.graphDriverPriority, DriverOptions: s.graphOptions, } return drivers.New(s.graphDriverName, config) } func (s *store) GraphDriver() (drivers.Driver, error) { if err := s.startUsingGraphDriver(); err != nil { return nil, err } defer s.stopUsingGraphDriver() return s.graphDriver, nil } // getLayerStoreLocked obtains and returns a handle to the writeable layer store object // used by the Store. // It must be called with s.graphLock held. func (s *store) getLayerStoreLocked() (rwLayerStore, error) { if s.layerStoreUseGetters != nil { return s.layerStoreUseGetters, nil } driverPrefix := s.graphDriverName + "-" rlpath := filepath.Join(s.runRoot, driverPrefix+"layers") if err := os.MkdirAll(rlpath, 0o700); err != nil { return nil, err } glpath := filepath.Join(s.graphRoot, driverPrefix+"layers") if err := os.MkdirAll(glpath, 0o700); err != nil { return nil, err } ilpath := "" if s.imageStoreDir != "" { ilpath = filepath.Join(s.imageStoreDir, driverPrefix+"layers") } rls, err := s.newLayerStore(rlpath, glpath, ilpath, s.graphDriver, s.transientStore) if err != nil { return nil, err } s.layerStoreUseGetters = rls return s.layerStoreUseGetters, nil } // getLayerStore obtains and returns a handle to the writeable layer store object // used by the store. // It must be called WITHOUT s.graphLock held. func (s *store) getLayerStore() (rwLayerStore, error) { if err := s.startUsingGraphDriver(); err != nil { return nil, err } defer s.stopUsingGraphDriver() return s.getLayerStoreLocked() } // getROLayerStoresLocked obtains additional read/only layer store objects used by the // Store. // It must be called with s.graphLock held. func (s *store) getROLayerStoresLocked() ([]roLayerStore, error) { if s.roLayerStoresUseGetters != nil { return s.roLayerStoresUseGetters, nil } driverPrefix := s.graphDriverName + "-" rlpath := filepath.Join(s.runRoot, driverPrefix+"layers") if err := os.MkdirAll(rlpath, 0o700); err != nil { return nil, err } for _, store := range s.graphDriver.AdditionalImageStores() { glpath := filepath.Join(store, driverPrefix+"layers") rls, err := newROLayerStore(rlpath, glpath, s.graphDriver) if err != nil { return nil, err } s.roLayerStoresUseGetters = append(s.roLayerStoresUseGetters, rls) } return s.roLayerStoresUseGetters, nil } // bothLayerStoreKindsLocked returns the primary, and additional read-only, layer store objects used by the store. // It must be called with s.graphLock held. func (s *store) bothLayerStoreKindsLocked() (rwLayerStore, []roLayerStore, error) { primary, err := s.getLayerStoreLocked() if err != nil { return nil, nil, fmt.Errorf("loading primary layer store data: %w", err) } additional, err := s.getROLayerStoresLocked() if err != nil { return nil, nil, fmt.Errorf("loading additional layer stores: %w", err) } return primary, additional, nil } // bothLayerStoreKinds returns the primary, and additional read-only, layer store objects used by the store. // It must be called WITHOUT s.graphLock held. func (s *store) bothLayerStoreKinds() (rwLayerStore, []roLayerStore, error) { if err := s.startUsingGraphDriver(); err != nil { return nil, nil, err } defer s.stopUsingGraphDriver() return s.bothLayerStoreKindsLocked() } // allLayerStores returns a list of all layer store objects used by the Store. // This is a convenience method for read-only users of the Store. // It must be called with s.graphLock held. func (s *store) allLayerStoresLocked() ([]roLayerStore, error) { primary, additional, err := s.bothLayerStoreKindsLocked() if err != nil { return nil, err } return append([]roLayerStore{primary}, additional...), nil } // allLayerStores returns a list of all layer store objects used by the Store. // This is a convenience method for read-only users of the Store. // It must be called WITHOUT s.graphLock held. func (s *store) allLayerStores() ([]roLayerStore, error) { if err := s.startUsingGraphDriver(); err != nil { return nil, err } defer s.stopUsingGraphDriver() return s.allLayerStoresLocked() } // readAllLayerStores processes allLayerStores() in order: // It locks the store for reading, checks for updates, and calls // // (data, done, err) := fn(store) // // until the callback returns done == true, and returns the data from the callback. // // If reading any layer store fails, it immediately returns ({}, true, err). // // If all layer stores are processed without setting done == true, it returns ({}, false, nil). // // Typical usage: // // if res, done, err := s.readAllLayerStores(store, func(…) { // … // }; done { // return res, err // } func readAllLayerStores[T any](s *store, fn func(store roLayerStore) (T, bool, error)) (T, bool, error) { var zeroRes T // A zero value of T layerStores, err := s.allLayerStores() if err != nil { return zeroRes, true, err } for _, s := range layerStores { store := s if err := store.startReading(); err != nil { return zeroRes, true, err } defer store.stopReading() if res, done, err := fn(store); done { return res, true, err } } return zeroRes, false, nil } // writeToLayerStore is a helper for working with store.getLayerStore(): // It locks the store for writing, checks for updates, and calls fn() // It returns the return value of fn, or its own error initializing the store. func writeToLayerStore[T any](s *store, fn func(store rwLayerStore) (T, error)) (T, error) { var zeroRes T // A zero value of T store, err := s.getLayerStore() if err != nil { return zeroRes, err } if err := store.startWriting(); err != nil { return zeroRes, err } defer store.stopWriting() return fn(store) } // readOrWriteAllLayerStores processes allLayerStores() in order: // It locks the writeable store for writing and all others for reading, checks // for updates, and calls // // (data, done, err) := fn(store) // // until the callback returns done == true, and returns the data from the callback. // // If reading or writing any layer store fails, it immediately returns ({}, true, err). // // If all layer stores are processed without setting done == true, it returns ({}, false, nil). // // Typical usage: // // if res, done, err := s.readOrWriteAllLayerStores(store, func(…) { // … // }; done { // return res, err // } func readOrWriteAllLayerStores[T any](s *store, fn func(store roLayerStore) (T, bool, error)) (T, bool, error) { var zeroRes T // A zero value of T rwLayerStore, roLayerStores, err := s.bothLayerStoreKinds() if err != nil { return zeroRes, true, err } if err := rwLayerStore.startWriting(); err != nil { return zeroRes, true, err } defer rwLayerStore.stopWriting() if res, done, err := fn(rwLayerStore); done { return res, true, err } for _, s := range roLayerStores { store := s if err := store.startReading(); err != nil { return zeroRes, true, err } defer store.stopReading() if res, done, err := fn(store); done { return res, true, err } } return zeroRes, false, nil } // allImageStores returns a list of all image store objects used by the Store. // This is a convenience method for read-only users of the Store. func (s *store) allImageStores() []roImageStore { return append([]roImageStore{s.imageStore}, s.roImageStores...) } // readAllImageStores processes allImageStores() in order: // It locks the store for reading, checks for updates, and calls // // (data, done, err) := fn(store) // // until the callback returns done == true, and returns the data from the callback. // // If reading any Image store fails, it immediately returns ({}, true, err). // // If all Image stores are processed without setting done == true, it returns ({}, false, nil). // // Typical usage: // // if res, done, err := readAllImageStores(store, func(…) { // … // }; done { // return res, err // } func readAllImageStores[T any](s *store, fn func(store roImageStore) (T, bool, error)) (T, bool, error) { var zeroRes T // A zero value of T for _, s := range s.allImageStores() { store := s if err := store.startReading(); err != nil { return zeroRes, true, err } defer store.stopReading() if res, done, err := fn(store); done { return res, true, err } } return zeroRes, false, nil } // writeToImageStore is a convenience helper for working with store.imageStore: // It locks the store for writing, checks for updates, and calls fn(), which can then access store.imageStore. // It returns the return value of fn, or its own error initializing the store. func writeToImageStore[T any](s *store, fn func() (T, error)) (T, error) { if err := s.imageStore.startWriting(); err != nil { var zeroRes T // A zero value of T return zeroRes, err } defer s.imageStore.stopWriting() return fn() } // readContainerStore is a convenience helper for working with store.containerStore: // It locks the store for reading, checks for updates, and calls fn(), which can then access store.containerStore. // If reading the container store fails, it returns ({}, true, err). // Returns the return value of fn on success. func readContainerStore[T any](s *store, fn func() (T, bool, error)) (T, bool, error) { if err := s.containerStore.startReading(); err != nil { var zeroRes T // A zero value of T return zeroRes, true, err } defer s.containerStore.stopReading() return fn() } // writeToContainerStore is a convenience helper for working with store.containerStore: // It locks the store for writing, checks for updates, and calls fn(), which can then access store.containerStore. // It returns the return value of fn, or its own error initializing the store. func writeToContainerStore[T any](s *store, fn func() (T, error)) (T, error) { if err := s.containerStore.startWriting(); err != nil { var zeroRes T // A zero value of T return zeroRes, err } defer s.containerStore.stopWriting() return fn() } // writeToAllStores is a convenience helper for writing to all three stores: // It locks the stores for writing, checks for updates, and calls fn(), which can then access the provided layer store, // s.imageStore and s.containerStore. // It returns the return value of fn, or its own error initializing the stores. func (s *store) writeToAllStores(fn func(rlstore rwLayerStore) error) error { rlstore, err := s.getLayerStore() if err != nil { return err } if err := rlstore.startWriting(); err != nil { return err } defer rlstore.stopWriting() if err := s.imageStore.startWriting(); err != nil { return err } defer s.imageStore.stopWriting() if err := s.containerStore.startWriting(); err != nil { return err } defer s.containerStore.stopWriting() return fn(rlstore) } // canUseShifting returns true if we can use mount-time arguments (shifting) to // avoid having to create a mapped top layer for a base image when we want to // use it to create a container using ID mappings. // On entry: // - rlstore must be locked for writing func (s *store) canUseShifting(uidmap, gidmap []idtools.IDMap) bool { return s.graphDriver.SupportsShifting(uidmap, gidmap) } // On entry: // - rlstore must be locked for reading or writing // - rlstores MUST NOT be locked // Returns an extra unlock function to unlock any potentially read locked rlstores by this function. // The unlock function is always set and thus must always be called. func getParentLayer(rlstore roLayerStore, rlstores []roLayerStore, parent string) (*Layer, func(), error) { // function we return to the caller so the caller gets the right stores locked and can unlock at the proper time themselves var lockedLayerStores []roLayerStore unlock := func() { for _, i := range lockedLayerStores { i.stopReading() } } for _, l := range append([]roLayerStore{rlstore}, rlstores...) { lstore := l if lstore != rlstore { if err := lstore.startReading(); err != nil { return nil, unlock, err } lockedLayerStores = append(lockedLayerStores, lstore) } if l, err := lstore.Get(parent); err == nil && l != nil { return l, unlock, nil } } return nil, unlock, ErrLayerUnknown } // On entry: // - rlstore must be locked for writing // - rlstores MUST NOT be locked // // Returns the new copied LayerOptions with mappings set, the parent Layer and // an extra unlock function to unlock any potentially read locked rlstores by this function. // The unlock function is always set and thus must always be called. func populateLayerOptions(s *store, rlstore rwLayerStore, rlstores []roLayerStore, parent string, lOptions *LayerOptions) (*LayerOptions, *Layer, func(), error) { // WARNING: Update also the freshLayer checks in store.PutLayer if adding more logic here. var parentLayer *Layer var options LayerOptions // make sure we always return a valid func instead of nil so the caller can call it without checking unlock := func() {} if lOptions != nil { options = *lOptions options.BigData = slices.Clone(lOptions.BigData) options.Flags = copyMapPreferringNil(lOptions.Flags) } if options.HostUIDMapping { options.UIDMap = nil } if options.HostGIDMapping { options.GIDMap = nil } uidMap := options.UIDMap gidMap := options.GIDMap if parent != "" { var err error parentLayer, unlock, err = getParentLayer(rlstore, rlstores, parent) if err != nil { return nil, nil, unlock, err } if err := s.containerStore.startWriting(); err != nil { return nil, nil, unlock, err } defer s.containerStore.stopWriting() containers, err := s.containerStore.Containers() if err != nil { return nil, nil, unlock, err } for _, container := range containers { if container.LayerID == parent { return nil, nil, unlock, ErrParentIsContainer } } if !options.HostUIDMapping && len(options.UIDMap) == 0 { uidMap = parentLayer.UIDMap } if !options.HostGIDMapping && len(options.GIDMap) == 0 { gidMap = parentLayer.GIDMap } } else { if !options.HostUIDMapping && len(options.UIDMap) == 0 { uidMap = s.uidMap } if !options.HostGIDMapping && len(options.GIDMap) == 0 { gidMap = s.gidMap } } if s.canUseShifting(uidMap, gidMap) { options.IDMappingOptions = types.IDMappingOptions{HostUIDMapping: true, HostGIDMapping: true, UIDMap: nil, GIDMap: nil} } else { options.IDMappingOptions = types.IDMappingOptions{ HostUIDMapping: options.HostUIDMapping, HostGIDMapping: options.HostGIDMapping, UIDMap: copySlicePreferringNil(uidMap), GIDMap: copySlicePreferringNil(gidMap), } } return &options, parentLayer, unlock, nil } func (s *store) PutLayer(id, parent string, names []string, mountLabel string, writeable bool, lOptions *LayerOptions, diff io.Reader) (*Layer, int64, error) { rlstore, rlstores, err := s.bothLayerStoreKinds() if err != nil { return nil, -1, err } var ( contents *layerCreationContents options *LayerOptions parentLayer *Layer ) if diff != nil { m := rlstore.newMaybeStagedLayerExtraction(diff) defer func() { if err := m.cleanup(); err != nil { logrus.Errorf("Error cleaning up temporary directories: %v", err) } }() // driver can do unlocked staging so do that without holding the layer lock // Special case we only support it when no mount label is used. c/image doesn't set it for layers // and the overlay driver doesn't use it for extract today so it would be safe even when set but // that is not exactly obvious and if someone would implement the ApplyDiffStaging interface for // another driver that may be no longer true. So for now simply fall back to the locked extract path // to ensure we don't cause any weird issues here. if m.staging != nil && mountLabel == "" { // func so we have a scope for defer, we don't want to hold the lock for stageWithUnlockedStore() layer, err := func() (*Layer, error) { if err := rlstore.startWriting(); err != nil { return nil, err } defer rlstore.stopWriting() if layer, err := rlstore.checkIdOrNameConflict(id, names); err != nil { return layer, err } var unlockLayerStores func() options, parentLayer, unlockLayerStores, err = populateLayerOptions(s, rlstore, rlstores, parent, lOptions) unlockLayerStores() return nil, err }() if err != nil { return layer, -1, err } // make sure to use the resolved full ID if there is a parent if parentLayer != nil { parent = parentLayer.ID } if err := rlstore.stageWithUnlockedStore(m, parent, options); err != nil { return nil, -1, err } } contents = &layerCreationContents{ stagedLayerExtraction: m, } } if err := rlstore.startWriting(); err != nil { return nil, -1, err } defer rlstore.stopWriting() if options == nil { var unlockLayerStores func() options, parentLayer, unlockLayerStores, err = populateLayerOptions(s, rlstore, rlstores, parent, lOptions) defer unlockLayerStores() if err != nil { return nil, -1, err } } else if parent != "" { // We used the staged extraction without holding the lock. // Check again that the parent layer is still valid and exists. freshLayer, unlockLayerStores, err := getParentLayer(rlstore, rlstores, parent) defer unlockLayerStores() if err != nil { return nil, -1, err } // In populateLayerOptions() we get the ID mappings in order to extract correctly, ensure the freshly // looked up parent Layer still has the same mappings to prevent silent UID/GID corruption. if !slices.Equal(freshLayer.UIDMap, parentLayer.UIDMap) || !slices.Equal(freshLayer.GIDMap, parentLayer.GIDMap) { // Fatal problem. Mappings changed so the parent must be considered different now. // Since we consumed the diff there is no we to recover, return error to caller. The caller would need to retry. // How likely is that and would need to return a special error so c/image could do the retries? return nil, -1, fmt.Errorf("error during staged layer apply, parent layer %q changed id mappings while the content was extracted, must retry layer creation", parent) } } return rlstore.create(id, parentLayer, names, mountLabel, nil, options, writeable, contents) } func (s *store) CreateLayer(id, parent string, names []string, mountLabel string, writeable bool, options *LayerOptions) (*Layer, error) { layer, _, err := s.PutLayer(id, parent, names, mountLabel, writeable, options, nil) return layer, err } func (s *store) CreateImage(id string, names []string, layer, metadata string, iOptions *ImageOptions) (*Image, error) { if layer != "" { layerStores, err := s.allLayerStores() if err != nil { return nil, err } var ilayer *Layer for _, s := range layerStores { store := s if err := store.startReading(); err != nil { return nil, err } defer store.stopReading() ilayer, err = store.Get(layer) if err == nil { break } } if ilayer == nil { return nil, ErrLayerUnknown } layer = ilayer.ID } return writeToImageStore(s, func() (*Image, error) { var options ImageOptions var namesToAddAfterCreating []string // Check if the ID refers to an image in a read-only store -- we want // to allow images in read-only stores to have their names changed, so // if we find one, merge the new values in with what we know about the // image that's already there. if id != "" { for _, is := range s.roImageStores { store := is if err := store.startReading(); err != nil { return nil, err } defer store.stopReading() if i, err := store.Get(id); err == nil { // set information about this image in "options" options = ImageOptions{ Metadata: i.Metadata, CreationDate: i.Created, Digest: i.Digest, Digests: copySlicePreferringNil(i.Digests), NamesHistory: copySlicePreferringNil(i.NamesHistory), } for _, key := range i.BigDataNames { data, err := store.BigData(id, key) if err != nil { return nil, err } dataDigest, err := store.BigDataDigest(id, key) if err != nil { return nil, err } options.BigData = append(options.BigData, ImageBigDataOption{ Key: key, Data: data, Digest: dataDigest, }) } namesToAddAfterCreating = dedupeStrings(slices.Concat(i.Names, names)) break } } } // merge any passed-in options into "options" as best we can if iOptions != nil { if !iOptions.CreationDate.IsZero() { options.CreationDate = iOptions.CreationDate } if iOptions.Digest != "" { options.Digest = iOptions.Digest } options.Digests = append(options.Digests, iOptions.Digests...) if iOptions.Metadata != "" { options.Metadata = iOptions.Metadata } options.BigData = append(options.BigData, copyImageBigDataOptionSlice(iOptions.BigData)...) options.NamesHistory = append(options.NamesHistory, iOptions.NamesHistory...) if options.Flags == nil { options.Flags = make(map[string]any) } maps.Copy(options.Flags, iOptions.Flags) } if options.CreationDate.IsZero() { options.CreationDate = time.Now().UTC() } if metadata != "" { options.Metadata = metadata } res, err := s.imageStore.create(id, names, layer, options) if err == nil && len(namesToAddAfterCreating) > 0 { // set any names we pulled up from an additional image store, now that we won't be // triggering a duplicate names error err = s.imageStore.updateNames(res.ID, namesToAddAfterCreating, addNames) } return res, err }) } // imageTopLayerForMapping locates the layer that can take the place of the // image's top layer as the shared parent layer for a one or more containers // which are using ID mappings. // On entry: // - ristore must be locked EITHER for reading or writing // - s.imageStore must be locked for writing; it might be identical to ristore. // - rlstore must be locked for writing // - lstores must all be locked for reading func (s *store) imageTopLayerForMapping(image *Image, ristore roImageStore, rlstore rwLayerStore, lstores []roLayerStore, options types.IDMappingOptions) (*Layer, error) { layerMatchesMappingOptions := func(layer *Layer, options types.IDMappingOptions) bool { // If the driver supports shifting and the layer has no mappings, we can use it. if s.canUseShifting(options.UIDMap, options.GIDMap) && len(layer.UIDMap) == 0 && len(layer.GIDMap) == 0 { return true } // If we want host mapping, and the layer uses mappings, it's not the best match. if options.HostUIDMapping && len(layer.UIDMap) != 0 { return false } if options.HostGIDMapping && len(layer.GIDMap) != 0 { return false } // Compare the maps. return reflect.DeepEqual(layer.UIDMap, options.UIDMap) && reflect.DeepEqual(layer.GIDMap, options.GIDMap) } var layer, parentLayer *Layer allStores := append([]roLayerStore{rlstore}, lstores...) // Locate the image's top layer and its parent, if it has one. createMappedLayer := ristore == s.imageStore for _, s := range allStores { store := s // Walk the top layer list. for _, candidate := range append([]string{image.TopLayer}, image.MappedTopLayers...) { if cLayer, err := store.Get(candidate); err == nil { // We want the layer's parent, too, if it has one. var cParentLayer *Layer if cLayer.Parent != "" { // Its parent should be in one of the stores, somewhere. for _, ps := range allStores { if cParentLayer, err = ps.Get(cLayer.Parent); err == nil { break } } if cParentLayer == nil { continue } } // If the layer matches the desired mappings, it's a perfect match, // so we're actually done here. if layerMatchesMappingOptions(cLayer, options) { return cLayer, nil } // Record the first one that we found, even if it's not ideal, so that // we have a starting point. if layer == nil { layer = cLayer parentLayer = cParentLayer if store != rlstore { // The layer is in another store, so we cannot // create a mapped version of it to the image. createMappedLayer = false } } } } } if layer == nil { return nil, ErrLayerUnknown } // The top layer's mappings don't match the ones we want, but it's in a read-only // image store, so we can't create and add a mapped copy of the layer to the image. // We'll have to do the mapping for the container itself, elsewhere. if !createMappedLayer { return layer, nil } // The top layer's mappings don't match the ones we want, and it's in an image store // that lets us edit image metadata, so create a duplicate of the layer with the desired // mappings, and register it as an alternate top layer in the image. var layerOptions LayerOptions if s.canUseShifting(options.UIDMap, options.GIDMap) { layerOptions.IDMappingOptions = types.IDMappingOptions{ HostUIDMapping: true, HostGIDMapping: true, UIDMap: nil, GIDMap: nil, } } else { layerOptions.IDMappingOptions = types.IDMappingOptions{ HostUIDMapping: options.HostUIDMapping, HostGIDMapping: options.HostGIDMapping, UIDMap: copySlicePreferringNil(options.UIDMap), GIDMap: copySlicePreferringNil(options.GIDMap), } } layerOptions.TemplateLayer = layer.ID mappedLayer, _, err := rlstore.create("", parentLayer, nil, layer.MountLabel, nil, &layerOptions, false, nil) if err != nil { return nil, fmt.Errorf("creating an ID-mapped copy of layer %q: %w", layer.ID, err) } // By construction, createMappedLayer can only be true if ristore == s.imageStore. if err = s.imageStore.addMappedTopLayer(image.ID, mappedLayer.ID); err != nil { if err2 := rlstore.deleteWhileHoldingLock(mappedLayer.ID); err2 != nil { err = fmt.Errorf("deleting layer %q: %v: %w", mappedLayer.ID, err2, err) } return nil, fmt.Errorf("registering ID-mapped layer with image %q: %w", image.ID, err) } return mappedLayer, nil } func (s *store) CreateContainer(id string, names []string, image, layer, metadata string, cOptions *ContainerOptions) (*Container, error) { var options ContainerOptions if cOptions != nil { options = *cOptions options.IDMappingOptions.UIDMap = copySlicePreferringNil(cOptions.IDMappingOptions.UIDMap) options.IDMappingOptions.GIDMap = copySlicePreferringNil(cOptions.IDMappingOptions.GIDMap) options.LabelOpts = copySlicePreferringNil(cOptions.LabelOpts) options.Flags = copyMapPreferringNil(cOptions.Flags) options.MountOpts = copySlicePreferringNil(cOptions.MountOpts) options.StorageOpt = copyMapPreferringNil(cOptions.StorageOpt) options.BigData = copyContainerBigDataOptionSlice(cOptions.BigData) } if options.HostUIDMapping { options.UIDMap = nil } if options.HostGIDMapping { options.GIDMap = nil } options.Metadata = metadata rlstore, lstores, err := s.bothLayerStoreKinds() // lstores will be locked read-only if image != "" if err != nil { return nil, err } var imageTopLayer *Layer imageID := "" if options.AutoUserNs || options.UIDMap != nil || options.GIDMap != nil { // Prevent multiple instances to retrieve the same range when AutoUserNs // are used. // It doesn't prevent containers that specify an explicit mapping to overlap // with AutoUserNs. s.usernsLock.Lock() defer s.usernsLock.Unlock() } var imageHomeStore roImageStore // Set if image != "" // s.imageStore is locked read-write, if image != "" // s.roImageStores are NOT NECESSARILY ALL locked read-only if image != "" var cimage *Image // Set if image != "" if image != "" { if err := rlstore.startWriting(); err != nil { return nil, err } defer rlstore.stopWriting() for _, s := range lstores { store := s if err := store.startReading(); err != nil { return nil, err } defer store.stopReading() } if err := s.imageStore.startWriting(); err != nil { return nil, err } defer s.imageStore.stopWriting() cimage, err = s.imageStore.Get(image) if err == nil { imageHomeStore = s.imageStore } else { for _, s := range s.roImageStores { store := s if err := store.startReading(); err != nil { return nil, err } defer store.stopReading() cimage, err = store.Get(image) if err == nil { imageHomeStore = store break } } } if cimage == nil { return nil, fmt.Errorf("locating image with ID %q: %w", image, ErrImageUnknown) } imageID = cimage.ID } if options.AutoUserNs { var err error options.UIDMap, options.GIDMap, err = s.getAutoUserNS(&options.AutoUserNsOpts, cimage, rlstore, lstores) if err != nil { return nil, err } } uidMap := options.UIDMap gidMap := options.GIDMap idMappingsOptions := options.IDMappingOptions if image != "" { if cimage.TopLayer != "" { ilayer, err := s.imageTopLayerForMapping(cimage, imageHomeStore, rlstore, lstores, idMappingsOptions) if err != nil { return nil, err } imageTopLayer = ilayer if !options.HostUIDMapping && len(options.UIDMap) == 0 { uidMap = ilayer.UIDMap } if !options.HostGIDMapping && len(options.GIDMap) == 0 { gidMap = ilayer.GIDMap } } } else { if err := rlstore.startWriting(); err != nil { return nil, err } defer rlstore.stopWriting() if !options.HostUIDMapping && len(options.UIDMap) == 0 { uidMap = s.uidMap } if !options.HostGIDMapping && len(options.GIDMap) == 0 { gidMap = s.gidMap } } layerOptions := &LayerOptions{ // Normally layers for containers are volatile only if the container is. // But in transient store mode, all container layers are volatile. Volatile: options.Volatile || s.transientStore, } if s.canUseShifting(uidMap, gidMap) { layerOptions.IDMappingOptions = types.IDMappingOptions{ HostUIDMapping: true, HostGIDMapping: true, UIDMap: nil, GIDMap: nil, } } else { layerOptions.IDMappingOptions = types.IDMappingOptions{ HostUIDMapping: idMappingsOptions.HostUIDMapping, HostGIDMapping: idMappingsOptions.HostGIDMapping, UIDMap: copySlicePreferringNil(uidMap), GIDMap: copySlicePreferringNil(gidMap), } } if options.Flags == nil { options.Flags = make(map[string]any) } plabel, _ := options.Flags[processLabelFlag].(string) mlabel, _ := options.Flags[mountLabelFlag].(string) if (plabel == "" && mlabel != "") || (plabel != "" && mlabel == "") { return nil, errors.New("ProcessLabel and Mountlabel must either not be specified or both specified") } if plabel == "" { processLabel, mountLabel, err := label.InitLabels(options.LabelOpts) if err != nil { return nil, err } mlabel = mountLabel options.Flags[processLabelFlag] = processLabel options.Flags[mountLabelFlag] = mountLabel } clayer, _, err := rlstore.create(layer, imageTopLayer, nil, mlabel, options.StorageOpt, layerOptions, true, nil) if err != nil { return nil, err } layer = clayer.ID // Normally only `--rm` containers are volatile, but in transient store mode all containers are volatile if s.transientStore { options.Volatile = true } return writeToContainerStore(s, func() (*Container, error) { options.IDMappingOptions = types.IDMappingOptions{ HostUIDMapping: len(options.UIDMap) == 0, HostGIDMapping: len(options.GIDMap) == 0, UIDMap: copySlicePreferringNil(options.UIDMap), GIDMap: copySlicePreferringNil(options.GIDMap), } container, err := s.containerStore.create(id, names, imageID, layer, &options) if err != nil || container == nil { if err2 := rlstore.deleteWhileHoldingLock(layer); err2 != nil { if err == nil { err = fmt.Errorf("deleting layer %#v: %w", layer, err2) } else { logrus.Errorf("While recovering from a failure to create a container, error deleting layer %#v: %v", layer, err2) } } } return container, err }) } func (s *store) SetMetadata(id, metadata string) error { return s.writeToAllStores(func(rlstore rwLayerStore) error { if rlstore.Exists(id) { return rlstore.SetMetadata(id, metadata) } if s.imageStore.Exists(id) { return s.imageStore.SetMetadata(id, metadata) } if s.containerStore.Exists(id) { return s.containerStore.SetMetadata(id, metadata) } return ErrNotAnID }) } func (s *store) Metadata(id string) (string, error) { if res, done, err := readAllLayerStores(s, func(store roLayerStore) (string, bool, error) { if store.Exists(id) { res, err := store.Metadata(id) return res, true, err } return "", false, nil }); done { return res, err } if res, done, err := readAllImageStores(s, func(store roImageStore) (string, bool, error) { if store.Exists(id) { res, err := store.Metadata(id) return res, true, err } return "", false, nil }); done { return res, err } if res, done, err := readContainerStore(s, func() (string, bool, error) { if s.containerStore.Exists(id) { res, err := s.containerStore.Metadata(id) return res, true, err } return "", false, nil }); done { return res, err } return "", ErrNotAnID } func (s *store) ListImageBigData(id string) ([]string, error) { if res, done, err := readAllImageStores(s, func(store roImageStore) ([]string, bool, error) { bigDataNames, err := store.BigDataNames(id) if err == nil { return bigDataNames, true, nil } return nil, false, nil }); done { return res, err } return nil, fmt.Errorf("locating image with ID %q: %w", id, ErrImageUnknown) } func (s *store) ImageBigDataSize(id, key string) (int64, error) { if res, done, err := readAllImageStores(s, func(store roImageStore) (int64, bool, error) { size, err := store.BigDataSize(id, key) if err == nil { return size, true, nil } return -1, false, nil }); done { if err != nil { return -1, err } return res, nil } return -1, ErrSizeUnknown } func (s *store) ImageBigDataDigest(id, key string) (digest.Digest, error) { if res, done, err := readAllImageStores(s, func(ristore roImageStore) (digest.Digest, bool, error) { d, err := ristore.BigDataDigest(id, key) if err == nil && d.Validate() == nil { return d, true, nil } return "", false, nil }); done { return res, err } return "", ErrDigestUnknown } func (s *store) ImageBigData(id, key string) ([]byte, error) { foundImage := false if res, done, err := readAllImageStores(s, func(store roImageStore) ([]byte, bool, error) { data, err := store.BigData(id, key) if err == nil { return data, true, nil } if store.Exists(id) { foundImage = true } return nil, false, nil }); done { return res, err } if foundImage { return nil, fmt.Errorf("locating item named %q for image with ID %q (consider removing the image to resolve the issue): %w", key, id, os.ErrNotExist) } return nil, fmt.Errorf("locating image with ID %q: %w", id, ErrImageUnknown) } // ListLayerBigData retrieves a list of the (possibly large) chunks of // named data associated with an layer. func (s *store) ListLayerBigData(id string) ([]string, error) { foundLayer := false if res, done, err := readAllLayerStores(s, func(store roLayerStore) ([]string, bool, error) { data, err := store.BigDataNames(id) if err == nil { return data, true, nil } if store.Exists(id) { foundLayer = true } return nil, false, nil }); done { return res, err } if foundLayer { return nil, fmt.Errorf("locating big data for layer with ID %q: %w", id, os.ErrNotExist) } return nil, fmt.Errorf("locating layer with ID %q: %w", id, ErrLayerUnknown) } // LayerBigData retrieves a (possibly large) chunk of named data // associated with a layer. func (s *store) LayerBigData(id, key string) (io.ReadCloser, error) { foundLayer := false if res, done, err := readAllLayerStores(s, func(store roLayerStore) (io.ReadCloser, bool, error) { data, err := store.BigData(id, key) if err == nil { return data, true, nil } if store.Exists(id) { foundLayer = true } return nil, false, nil }); done { return res, err } if foundLayer { return nil, fmt.Errorf("locating item named %q for layer with ID %q: %w", key, id, os.ErrNotExist) } return nil, fmt.Errorf("locating layer with ID %q: %w", id, ErrLayerUnknown) } // SetLayerBigData stores a (possibly large) chunk of named data // associated with a layer. func (s *store) SetLayerBigData(id, key string, data io.Reader) error { _, err := writeToLayerStore(s, func(store rwLayerStore) (struct{}, error) { return struct{}{}, store.SetBigData(id, key, data) }) return err } func (s *store) SetImageBigData(id, key string, data []byte, digestManifest func([]byte) (digest.Digest, error)) error { _, err := writeToImageStore(s, func() (struct{}, error) { return struct{}{}, s.imageStore.SetBigData(id, key, data, digestManifest) }) return err } func (s *store) ImageSize(id string) (int64, error) { layerStores, err := s.allLayerStores() if err != nil { return -1, err } for _, s := range layerStores { store := s if err := store.startReading(); err != nil { return -1, err } defer store.stopReading() } // Look for the image's record. var imageStore roBigDataStore var image *Image for _, s := range s.allImageStores() { store := s if err := store.startReading(); err != nil { return -1, err } defer store.stopReading() if image, err = store.Get(id); err == nil { imageStore = store break } } if image == nil { return -1, fmt.Errorf("locating image with ID %q: %w", id, ErrImageUnknown) } // Start with a list of the image's top layers, if it has any. queue := make(map[string]struct{}) for _, layerID := range append([]string{image.TopLayer}, image.MappedTopLayers...) { if layerID != "" { queue[layerID] = struct{}{} } } visited := make(map[string]struct{}) // Walk all of the layers. var size int64 for len(visited) < len(queue) { for layerID := range queue { // Visit each layer only once. if _, ok := visited[layerID]; ok { continue } visited[layerID] = struct{}{} // Look for the layer and the store that knows about it. var layerStore roLayerStore var layer *Layer for _, store := range layerStores { if layer, err = store.Get(layerID); err == nil { layerStore = store break } } if layer == nil { return -1, fmt.Errorf("locating layer with ID %q: %w", layerID, ErrLayerUnknown) } // The UncompressedSize is only valid if there's a digest to go with it. n := layer.UncompressedSize if layer.UncompressedDigest == "" || n == -1 { // Compute the size. n, err = layerStore.DiffSize("", layer.ID) if err != nil { return -1, fmt.Errorf("size/digest of layer with ID %q could not be calculated: %w", layerID, err) } } // Count this layer. size += n // Make a note to visit the layer's parent if we haven't already. if layer.Parent != "" { queue[layer.Parent] = struct{}{} } } } // Count big data items. names, err := imageStore.BigDataNames(id) if err != nil { return -1, fmt.Errorf("reading list of big data items for image %q: %w", id, err) } for _, name := range names { n, err := imageStore.BigDataSize(id, name) if err != nil { return -1, fmt.Errorf("reading size of big data item %q for image %q: %w", name, id, err) } size += n } return size, nil } func (s *store) ContainerSize(id string) (int64, error) { layerStores, err := s.allLayerStores() if err != nil { return -1, err } for _, s := range layerStores { store := s if err := store.startReading(); err != nil { return -1, err } defer store.stopReading() } // Get the location of the container directory and container run directory. // Do it before we lock the container store because they do, too. cdir, err := s.ContainerDirectory(id) if err != nil { return -1, err } rdir, err := s.ContainerRunDirectory(id) if err != nil { return -1, err } return writeToContainerStore(s, func() (int64, error) { // Yes, s.containerStore.BigDataSize requires a write lock. // Read the container record. container, err := s.containerStore.Get(id) if err != nil { return -1, err } // Read the container's layer's size. var layer *Layer var size int64 for _, store := range layerStores { if layer, err = store.Get(container.LayerID); err == nil { size, err = store.DiffSize("", layer.ID) if err != nil { return -1, fmt.Errorf("determining size of layer with ID %q: %w", layer.ID, err) } break } } if layer == nil { return -1, fmt.Errorf("locating layer with ID %q: %w", container.LayerID, ErrLayerUnknown) } // Count big data items. names, err := s.containerStore.BigDataNames(id) if err != nil { return -1, fmt.Errorf("reading list of big data items for container %q: %w", container.ID, err) } for _, name := range names { n, err := s.containerStore.BigDataSize(id, name) if err != nil { return -1, fmt.Errorf("reading size of big data item %q for container %q: %w", name, id, err) } size += n } // Count the size of our container directory and container run directory. n, err := directory.Size(cdir) if err != nil { return -1, err } size += n n, err = directory.Size(rdir) if err != nil { return -1, err } size += n return size, nil }) } func (s *store) ListContainerBigData(id string) ([]string, error) { res, _, err := readContainerStore(s, func() ([]string, bool, error) { res, err := s.containerStore.BigDataNames(id) return res, true, err }) return res, err } func (s *store) ContainerBigDataSize(id, key string) (int64, error) { return writeToContainerStore(s, func() (int64, error) { // Yes, BigDataSize requires a write lock. return s.containerStore.BigDataSize(id, key) }) } func (s *store) ContainerBigDataDigest(id, key string) (digest.Digest, error) { return writeToContainerStore(s, func() (digest.Digest, error) { // Yes, BigDataDigest requires a write lock. return s.containerStore.BigDataDigest(id, key) }) } func (s *store) ContainerBigData(id, key string) ([]byte, error) { res, _, err := readContainerStore(s, func() ([]byte, bool, error) { res, err := s.containerStore.BigData(id, key) return res, true, err }) return res, err } func (s *store) SetContainerBigData(id, key string, data []byte) error { _, err := writeToContainerStore(s, func() (struct{}, error) { return struct{}{}, s.containerStore.SetBigData(id, key, data) }) return err } func (s *store) Exists(id string) bool { found, _, err := readAllLayerStores(s, func(store roLayerStore) (bool, bool, error) { if store.Exists(id) { return true, true, nil } return false, false, nil }) if err != nil { return false } if found { return true } found, _, err = readAllImageStores(s, func(store roImageStore) (bool, bool, error) { if store.Exists(id) { return true, true, nil } return false, false, nil }) if err != nil { return false } if found { return true } found, _, err = readContainerStore(s, func() (bool, bool, error) { return s.containerStore.Exists(id), true, nil }) if err != nil { return false } return found } func dedupeStrings(names []string) []string { seen := make(map[string]struct{}) deduped := make([]string, 0, len(names)) for _, name := range names { if _, wasSeen := seen[name]; !wasSeen { seen[name] = struct{}{} deduped = append(deduped, name) } } return deduped } func dedupeDigests(digests []digest.Digest) []digest.Digest { seen := make(map[digest.Digest]struct{}) deduped := make([]digest.Digest, 0, len(digests)) for _, d := range digests { if _, wasSeen := seen[d]; !wasSeen { seen[d] = struct{}{} deduped = append(deduped, d) } } return deduped } // Deprecated: Prone to race conditions, suggested alternatives are `AddNames` and `RemoveNames`. func (s *store) SetNames(id string, names []string) error { return s.updateNames(id, names, setNames) } func (s *store) AddNames(id string, names []string) error { return s.updateNames(id, names, addNames) } func (s *store) RemoveNames(id string, names []string) error { return s.updateNames(id, names, removeNames) } func (s *store) updateNames(id string, names []string, op updateNameOperation) error { deduped := dedupeStrings(names) if found, err := writeToLayerStore(s, func(rlstore rwLayerStore) (bool, error) { if !rlstore.Exists(id) { return false, nil } return true, rlstore.updateNames(id, deduped, op) }); err != nil || found { return err } if err := s.imageStore.startWriting(); err != nil { return err } defer s.imageStore.stopWriting() if s.imageStore.Exists(id) { return s.imageStore.updateNames(id, deduped, op) } // Check if the id refers to a read-only image store -- we want to allow images in // read-only stores to have their names changed. for _, is := range s.roImageStores { store := is if err := store.startReading(); err != nil { return err } defer store.stopReading() if i, err := store.Get(id); err == nil { // "pull up" the image so that we can change its names list options := ImageOptions{ CreationDate: i.Created, Digest: i.Digest, Digests: copySlicePreferringNil(i.Digests), Metadata: i.Metadata, NamesHistory: copySlicePreferringNil(i.NamesHistory), Flags: copyMapPreferringNil(i.Flags), } for _, key := range i.BigDataNames { data, err := store.BigData(id, key) if err != nil { return err } dataDigest, err := store.BigDataDigest(id, key) if err != nil { return err } options.BigData = append(options.BigData, ImageBigDataOption{ Key: key, Data: data, Digest: dataDigest, }) } _, err = s.imageStore.create(id, i.Names, i.TopLayer, options) if err != nil { return err } // now make the changes to the writeable image record's names list return s.imageStore.updateNames(id, deduped, op) } } if found, err := writeToContainerStore(s, func() (bool, error) { if !s.containerStore.Exists(id) { return false, nil } return true, s.containerStore.updateNames(id, deduped, op) }); err != nil || found { return err } return ErrLayerUnknown } func (s *store) Names(id string) ([]string, error) { if res, done, err := readAllLayerStores(s, func(store roLayerStore) ([]string, bool, error) { if l, err := store.Get(id); l != nil && err == nil { return l.Names, true, nil } return nil, false, nil }); done { return res, err } if res, done, err := readAllImageStores(s, func(store roImageStore) ([]string, bool, error) { if i, err := store.Get(id); i != nil && err == nil { return i.Names, true, nil } return nil, false, nil }); done { return res, err } if res, done, err := readContainerStore(s, func() ([]string, bool, error) { if c, err := s.containerStore.Get(id); c != nil && err == nil { return c.Names, true, nil } return nil, false, nil }); done { return res, err } return nil, ErrLayerUnknown } func (s *store) Lookup(name string) (string, error) { if res, done, err := readAllLayerStores(s, func(store roLayerStore) (string, bool, error) { if l, err := store.Get(name); l != nil && err == nil { return l.ID, true, nil } return "", false, nil }); done { return res, err } if res, done, err := readAllImageStores(s, func(store roImageStore) (string, bool, error) { if i, err := store.Get(name); i != nil && err == nil { return i.ID, true, nil } return "", false, nil }); done { return res, err } if res, done, err := readContainerStore(s, func() (string, bool, error) { if c, err := s.containerStore.Get(name); c != nil && err == nil { return c.ID, true, nil } return "", false, nil }); done { return res, err } return "", ErrLayerUnknown } func (s *store) DeleteLayer(id string) (retErr error) { cleanupFunctions := []tempdir.CleanupTempDirFunc{} defer func() { if cleanupErr := tempdir.CleanupTemporaryDirectories(cleanupFunctions...); cleanupErr != nil { retErr = errors.Join(cleanupErr, retErr) } }() return s.writeToAllStores(func(rlstore rwLayerStore) error { if rlstore.Exists(id) { if l, err := rlstore.Get(id); err != nil { id = l.ID } layers, err := rlstore.Layers() if err != nil { return err } for _, layer := range layers { if layer.Parent == id { return fmt.Errorf("used by layer %v: %w", layer.ID, ErrLayerHasChildren) } } images, err := s.imageStore.Images() if err != nil { return err } for _, image := range images { if image.TopLayer == id { return fmt.Errorf("layer %v used by image %v: %w", id, image.ID, ErrLayerUsedByImage) } } containers, err := s.containerStore.Containers() if err != nil { return err } for _, container := range containers { if container.LayerID == id { return fmt.Errorf("layer %v used by container %v: %w", id, container.ID, ErrLayerUsedByContainer) } } cf, err := rlstore.deferredDelete(id) cleanupFunctions = append(cleanupFunctions, cf...) if err != nil { return fmt.Errorf("delete layer %v: %w", id, err) } for _, image := range images { if stringutils.InSlice(image.MappedTopLayers, id) { if err = s.imageStore.removeMappedTopLayer(image.ID, id); err != nil { return fmt.Errorf("remove mapped top layer %v from image %v: %w", id, image.ID, err) } } } return nil } return ErrNotALayer }) } func (s *store) DeleteImage(id string, commit bool) (layers []string, retErr error) { layersToRemove := []string{} cleanupFunctions := []tempdir.CleanupTempDirFunc{} defer func() { if cleanupErr := tempdir.CleanupTemporaryDirectories(cleanupFunctions...); cleanupErr != nil { retErr = errors.Join(cleanupErr, retErr) } }() if err := s.writeToAllStores(func(rlstore rwLayerStore) error { // Delete image from all available imagestores configured to be used. imageFound := false for _, is := range s.rwImageStores { if is != s.imageStore { // This is an additional writeable image store // so we must perform lock if err := is.startWriting(); err != nil { return err } defer is.stopWriting() } if !is.Exists(id) { continue } imageFound = true image, err := is.Get(id) if err != nil { return err } id = image.ID containers, err := s.containerStore.Containers() if err != nil { return err } aContainerByImage := make(map[string]string) for _, container := range containers { aContainerByImage[container.ImageID] = container.ID } if container, ok := aContainerByImage[id]; ok { return fmt.Errorf("image used by %v: %w", container, ErrImageUsedByContainer) } images, err := is.Images() if err != nil { return err } layers, err := rlstore.Layers() if err != nil { return err } childrenByParent := make(map[string][]string) for _, layer := range layers { childrenByParent[layer.Parent] = append(childrenByParent[layer.Parent], layer.ID) } otherImagesTopLayers := make(map[string]struct{}) for _, img := range images { if img.ID != id { otherImagesTopLayers[img.TopLayer] = struct{}{} for _, layerID := range img.MappedTopLayers { otherImagesTopLayers[layerID] = struct{}{} } } } if commit { if err = is.Delete(id); err != nil { return err } } layer := image.TopLayer layersToRemoveMap := make(map[string]struct{}) layersToRemove = append(layersToRemove, image.MappedTopLayers...) for _, mappedTopLayer := range image.MappedTopLayers { layersToRemoveMap[mappedTopLayer] = struct{}{} } for layer != "" { if s.containerStore.Exists(layer) { break } if _, used := otherImagesTopLayers[layer]; used { break } parent := "" if l, err := rlstore.Get(layer); err == nil { parent = l.Parent } hasChildrenNotBeingRemoved := func() bool { layersToCheck := []string{layer} if layer == image.TopLayer { layersToCheck = append(layersToCheck, image.MappedTopLayers...) } for _, layer := range layersToCheck { if childList := childrenByParent[layer]; len(childList) > 0 { for _, child := range childList { if _, childIsSlatedForRemoval := layersToRemoveMap[child]; childIsSlatedForRemoval { continue } return true } } } return false } if hasChildrenNotBeingRemoved() { break } layersToRemove = append(layersToRemove, layer) layersToRemoveMap[layer] = struct{}{} layer = parent } } if !imageFound { return ErrNotAnImage } if commit { for _, layer := range layersToRemove { cf, err := rlstore.deferredDelete(layer) cleanupFunctions = append(cleanupFunctions, cf...) if err != nil { return err } } } return nil }); err != nil { return nil, err } return layersToRemove, nil } func (s *store) DeleteContainer(id string) (retErr error) { cleanupFunctions := []tempdir.CleanupTempDirFunc{} defer func() { if cleanupErr := tempdir.CleanupTemporaryDirectories(cleanupFunctions...); cleanupErr != nil { retErr = errors.Join(cleanupErr, retErr) } }() return s.writeToAllStores(func(rlstore rwLayerStore) error { if !s.containerStore.Exists(id) { return ErrNotAContainer } container, err := s.containerStore.Get(id) if err != nil { return ErrNotAContainer } // delete the layer first, separately, so that if we get an // error while trying to do so, we don't go ahead and delete // the container record that refers to it, effectively losing // track of it if rlstore.Exists(container.LayerID) { cf, err := rlstore.deferredDelete(container.LayerID) cleanupFunctions = append(cleanupFunctions, cf...) if err != nil { return err } } var wg errgroup.Group middleDir := s.graphDriverName + "-containers" wg.Go(func() error { gcpath := filepath.Join(s.GraphRoot(), middleDir, container.ID) return system.EnsureRemoveAll(gcpath) }) wg.Go(func() error { rcpath := filepath.Join(s.RunRoot(), middleDir, container.ID) return system.EnsureRemoveAll(rcpath) }) if multierr := wg.Wait(); multierr != nil { return multierr } return s.containerStore.Delete(id) }) } func (s *store) Delete(id string) (retErr error) { cleanupFunctions := []tempdir.CleanupTempDirFunc{} defer func() { if cleanupErr := tempdir.CleanupTemporaryDirectories(cleanupFunctions...); cleanupErr != nil { retErr = errors.Join(cleanupErr, retErr) } }() return s.writeToAllStores(func(rlstore rwLayerStore) error { if s.containerStore.Exists(id) { if container, err := s.containerStore.Get(id); err == nil { if rlstore.Exists(container.LayerID) { cf, err := rlstore.deferredDelete(container.LayerID) cleanupFunctions = append(cleanupFunctions, cf...) if err != nil { return err } if err = s.containerStore.Delete(id); err != nil { return err } middleDir := s.graphDriverName + "-containers" gcpath := filepath.Join(s.GraphRoot(), middleDir, container.ID, "userdata") if err = os.RemoveAll(gcpath); err != nil { return err } rcpath := filepath.Join(s.RunRoot(), middleDir, container.ID, "userdata") if err = os.RemoveAll(rcpath); err != nil { return err } return nil } return ErrNotALayer } } if s.imageStore.Exists(id) { return s.imageStore.Delete(id) } if rlstore.Exists(id) { cf, err := rlstore.deferredDelete(id) cleanupFunctions = append(cleanupFunctions, cf...) return err } return ErrLayerUnknown }) } func (s *store) Wipe() error { return s.writeToAllStores(func(rlstore rwLayerStore) error { if err := s.containerStore.Wipe(); err != nil { return err } if err := s.imageStore.Wipe(); err != nil { return err } return rlstore.Wipe() }) } func (s *store) Status() ([][2]string, error) { rlstore, err := s.getLayerStore() if err != nil { return nil, err } return rlstore.Status() } //go:embed VERSION var storageVersion string func (s *store) Version() ([][2]string, error) { if trimmedVersion := strings.TrimSpace(storageVersion); trimmedVersion != "" { return [][2]string{{"Version", trimmedVersion}}, nil } return [][2]string{}, nil } func (s *store) MountImage(id string, mountOpts []string, mountLabel string) (string, error) { if err := validateMountOptions(mountOpts); err != nil { return "", err } // We need to make sure the home mount is present when the Mount is done, which happens by possibly reinitializing the graph driver // in startUsingGraphDriver(). if err := s.startUsingGraphDriver(); err != nil { return "", err } defer s.stopUsingGraphDriver() rlstore, lstores, err := s.bothLayerStoreKindsLocked() if err != nil { return "", err } var imageHomeStore roImageStore if err := rlstore.startWriting(); err != nil { return "", err } defer rlstore.stopWriting() for _, s := range lstores { if err := s.startReading(); err != nil { return "", err } defer s.stopReading() } if err := s.imageStore.startWriting(); err != nil { return "", err } defer s.imageStore.stopWriting() cimage, err := s.imageStore.Get(id) if err == nil { imageHomeStore = s.imageStore } else { for _, s := range s.roImageStores { if err := s.startReading(); err != nil { return "", err } defer s.stopReading() cimage, err = s.Get(id) if err == nil { imageHomeStore = s break } } } if cimage == nil { return "", fmt.Errorf("locating image with ID %q: %w", id, ErrImageUnknown) } idmappingsOpts := types.IDMappingOptions{ HostUIDMapping: true, HostGIDMapping: true, } ilayer, err := s.imageTopLayerForMapping(cimage, imageHomeStore, rlstore, lstores, idmappingsOpts) if err != nil { return "", err } if len(ilayer.UIDMap) > 0 || len(ilayer.GIDMap) > 0 { return "", fmt.Errorf("cannot create an image with canonical UID/GID mappings in a read-only store") } options := drivers.MountOpts{ MountLabel: mountLabel, Options: append(mountOpts, "ro"), } return rlstore.Mount(ilayer.ID, options) } func (s *store) Mount(id, mountLabel string) (string, error) { options := drivers.MountOpts{ MountLabel: mountLabel, } // check if `id` is a container, then grab the LayerID, uidmap and gidmap, along with // otherwise we assume the id is a LayerID and attempt to mount it. if container, err := s.Container(id); err == nil { id = container.LayerID options.UidMaps = container.UIDMap options.GidMaps = container.GIDMap options.Options = container.MountOpts() if !s.disableVolatile { if v, found := container.Flags[volatileFlag]; found { if b, ok := v.(bool); ok { options.Volatile = b } } } } // We need to make sure the home mount is present when the Mount is done, which happens by possibly reinitializing the graph driver // in startUsingGraphDriver(). if err := s.startUsingGraphDriver(); err != nil { return "", err } defer s.stopUsingGraphDriver() rlstore, lstores, err := s.bothLayerStoreKindsLocked() if err != nil { return "", err } if options.UidMaps != nil || options.GidMaps != nil { options.DisableShifting = !s.canUseShifting(options.UidMaps, options.GidMaps) } if err := rlstore.startWriting(); err != nil { return "", err } defer rlstore.stopWriting() if rlstore.Exists(id) { return rlstore.Mount(id, options) } // check if the layer is in a read-only store, and return a better error message for _, store := range lstores { if err := store.startReading(); err != nil { return "", err } exists := store.Exists(id) store.stopReading() if exists { return "", fmt.Errorf("mounting read/only store images is not allowed: %w", ErrStoreIsReadOnly) } } return "", ErrLayerUnknown } func (s *store) Mounted(id string) (int, error) { if layerID, err := s.ContainerLayerID(id); err == nil { id = layerID } rlstore, err := s.getLayerStore() if err != nil { return 0, err } if err := rlstore.startReading(); err != nil { return 0, err } defer rlstore.stopReading() return rlstore.Mounted(id) } func (s *store) UnmountImage(id string, force bool) (bool, error) { img, err := s.Image(id) if err != nil { return false, err } return writeToLayerStore(s, func(lstore rwLayerStore) (bool, error) { for _, layerID := range img.MappedTopLayers { l, err := lstore.Get(layerID) if err != nil { if err == ErrLayerUnknown { continue } return false, err } // check if the layer with the canonical mapping is in the mapped top layers if len(l.UIDMap) == 0 && len(l.GIDMap) == 0 { return lstore.unmount(l.ID, force, false) } } return lstore.unmount(img.TopLayer, force, false) }) } func (s *store) Unmount(id string, force bool) (bool, error) { if layerID, err := s.ContainerLayerID(id); err == nil { id = layerID } return writeToLayerStore(s, func(rlstore rwLayerStore) (bool, error) { if rlstore.Exists(id) { return rlstore.unmount(id, force, false) } return false, ErrLayerUnknown }) } func (s *store) Changes(from, to string) ([]archive.Change, error) { // NaiveDiff could cause mounts to happen without a lock, so be safe // and treat the .Diff operation as a Mount. // We need to make sure the home mount is present when the Mount is done, which happens by possibly reinitializing the graph driver // in startUsingGraphDriver(). if err := s.startUsingGraphDriver(); err != nil { return nil, err } defer s.stopUsingGraphDriver() rlstore, lstores, err := s.bothLayerStoreKindsLocked() if err != nil { return nil, err } // While the general rules require the layer store to only be locked RO (apart from known LOCKING BUGs) // the overlay driver requires the primary layer store to be locked RW; see // drivers/overlay.Driver.getMergedDir. if err := rlstore.startWriting(); err != nil { return nil, err } if rlstore.Exists(to) { res, err := rlstore.Changes(from, to) rlstore.stopWriting() return res, err } rlstore.stopWriting() for _, s := range lstores { store := s if err := store.startReading(); err != nil { return nil, err } if store.Exists(to) { res, err := store.Changes(from, to) store.stopReading() return res, err } store.stopReading() } return nil, ErrLayerUnknown } func (s *store) DiffSize(from, to string) (int64, error) { if res, done, err := readAllLayerStores(s, func(store roLayerStore) (int64, bool, error) { if store.Exists(to) { res, err := store.DiffSize(from, to) return res, true, err } return -1, false, nil }); done { if err != nil { return -1, err } return res, nil } return -1, ErrLayerUnknown } func (s *store) Diff(from, to string, options *DiffOptions) (io.ReadCloser, error) { // NaiveDiff could cause mounts to happen without a lock, so be safe // and treat the .Diff operation as a Mount. // We need to make sure the home mount is present when the Mount is done, which happens by possibly reinitializing the graph driver // in startUsingGraphDriver(). if err := s.startUsingGraphDriver(); err != nil { return nil, err } defer s.stopUsingGraphDriver() rlstore, lstores, err := s.bothLayerStoreKindsLocked() if err != nil { return nil, err } // While the general rules require the layer store to only be locked RO (apart from known LOCKING BUGs) // the overlay driver requires the primary layer store to be locked RW; see // drivers/overlay.Driver.getMergedDir. if err := rlstore.startWriting(); err != nil { return nil, err } if rlstore.Exists(to) { rc, err := rlstore.Diff(from, to, options) if rc != nil && err == nil { wrapped := ioutils.NewReadCloserWrapper(rc, func() error { err := rc.Close() rlstore.stopWriting() return err }) return wrapped, nil } rlstore.stopWriting() return rc, err } rlstore.stopWriting() for _, s := range lstores { store := s if err := store.startReading(); err != nil { return nil, err } if store.Exists(to) { rc, err := store.Diff(from, to, options) if rc != nil && err == nil { wrapped := ioutils.NewReadCloserWrapper(rc, func() error { err := rc.Close() store.stopReading() return err }) return wrapped, nil } store.stopReading() return rc, err } store.stopReading() } return nil, ErrLayerUnknown } func (s *store) ApplyStagedLayer(args ApplyStagedLayerOptions) (*Layer, error) { defer func() { if args.DiffOutput.TarSplit != nil { args.DiffOutput.TarSplit.Close() args.DiffOutput.TarSplit = nil } }() rlstore, rlstores, err := s.bothLayerStoreKinds() if err != nil { return nil, err } if err := rlstore.startWriting(); err != nil { return nil, err } defer rlstore.stopWriting() layer, err := rlstore.Get(args.ID) if err != nil && !errors.Is(err, ErrLayerUnknown) { return layer, err } if err == nil { // This code path exists only for cmd/containers/storage.applyDiffUsingStagingDirectory; we have tests that // assume layer creation and applying a staged layer are separate steps. Production pull code always uses the // other path, where layer creation is atomic. return layer, rlstore.applyDiffFromStagingDirectory(args.ID, args.DiffOutput, args.DiffOptions) } // if the layer doesn't exist yet, try to create it. contents := layerCreationContents{ DiffOutput: args.DiffOutput, DiffOptions: args.DiffOptions, } options, parentLayer, unlockLayerStores, err := populateLayerOptions(s, rlstore, rlstores, args.ParentLayer, args.LayerOptions) defer unlockLayerStores() if err != nil { return nil, err } layer, _, err = rlstore.create(args.ID, parentLayer, args.Names, args.MountLabel, nil, options, args.Writeable, &contents) return layer, err } func (s *store) CleanupStagedLayer(diffOutput *drivers.DriverWithDifferOutput) error { if diffOutput.TarSplit != nil { diffOutput.TarSplit.Close() diffOutput.TarSplit = nil } _, err := writeToLayerStore(s, func(rlstore rwLayerStore) (struct{}, error) { return struct{}{}, rlstore.CleanupStagingDirectory(diffOutput.Target) }) return err } func (s *store) PrepareStagedLayer(options *drivers.ApplyDiffWithDifferOpts, differ drivers.Differ) (*drivers.DriverWithDifferOutput, error) { rlstore, err := s.getLayerStore() if err != nil { return nil, err } return rlstore.applyDiffWithDifferNoLock(options, differ) } func (s *store) DifferTarget(id string) (string, error) { return writeToLayerStore(s, func(rlstore rwLayerStore) (string, error) { if rlstore.Exists(id) { return rlstore.DifferTarget(id) } return "", ErrLayerUnknown }) } func (s *store) ApplyDiff(to string, diff io.Reader) (int64, error) { return writeToLayerStore(s, func(rlstore rwLayerStore) (int64, error) { if rlstore.Exists(to) { return rlstore.ApplyDiff(to, diff) } return -1, ErrLayerUnknown }) } func (s *store) layersByMappedDigest(m func(roLayerStore, digest.Digest) ([]Layer, error), d digest.Digest) ([]Layer, error) { var layers []Layer if _, _, err := readAllLayerStores(s, func(store roLayerStore) (struct{}, bool, error) { storeLayers, err := m(store, d) if err != nil { if !errors.Is(err, ErrLayerUnknown) { return struct{}{}, true, err } return struct{}{}, false, nil } layers = append(layers, storeLayers...) return struct{}{}, false, nil }); err != nil { return nil, err } if len(layers) == 0 { return nil, ErrLayerUnknown } return layers, nil } func (s *store) LayersByCompressedDigest(d digest.Digest) ([]Layer, error) { if err := d.Validate(); err != nil { return nil, fmt.Errorf("looking for compressed layers matching digest %q: %w", d, err) } return s.layersByMappedDigest(func(r roLayerStore, d digest.Digest) ([]Layer, error) { return r.LayersByCompressedDigest(d) }, d) } func (s *store) LayersByUncompressedDigest(d digest.Digest) ([]Layer, error) { if err := d.Validate(); err != nil { return nil, fmt.Errorf("looking for layers matching digest %q: %w", d, err) } return s.layersByMappedDigest(func(r roLayerStore, d digest.Digest) ([]Layer, error) { return r.LayersByUncompressedDigest(d) }, d) } func (s *store) LayersByTOCDigest(d digest.Digest) ([]Layer, error) { if err := d.Validate(); err != nil { return nil, fmt.Errorf("looking for TOC matching digest %q: %w", d, err) } return s.layersByMappedDigest(func(r roLayerStore, d digest.Digest) ([]Layer, error) { return r.LayersByTOCDigest(d) }, d) } func (s *store) LayerSize(id string) (int64, error) { if res, done, err := readAllLayerStores(s, func(store roLayerStore) (int64, bool, error) { if store.Exists(id) { res, err := store.Size(id) return res, true, err } return -1, false, nil }); done { if err != nil { return -1, err } return res, nil } return -1, ErrLayerUnknown } func (s *store) LayerParentOwners(id string) ([]int, []int, error) { rlstore, err := s.getLayerStore() if err != nil { return nil, nil, err } if err := rlstore.startReading(); err != nil { return nil, nil, err } defer rlstore.stopReading() if rlstore.Exists(id) { return rlstore.ParentOwners(id) } return nil, nil, ErrLayerUnknown } func (s *store) ContainerParentOwners(id string) ([]int, []int, error) { rlstore, err := s.getLayerStore() if err != nil { return nil, nil, err } if err := rlstore.startReading(); err != nil { return nil, nil, err } defer rlstore.stopReading() if err := s.containerStore.startReading(); err != nil { return nil, nil, err } defer s.containerStore.stopReading() container, err := s.containerStore.Get(id) if err != nil { return nil, nil, err } if rlstore.Exists(container.LayerID) { return rlstore.ParentOwners(container.LayerID) } return nil, nil, ErrLayerUnknown } func (s *store) Layers() ([]Layer, error) { var layers []Layer if _, done, err := readAllLayerStores(s, func(store roLayerStore) (struct{}, bool, error) { storeLayers, err := store.Layers() if err != nil { return struct{}{}, true, err } layers = append(layers, storeLayers...) return struct{}{}, false, nil }); done { return nil, err } return layers, nil } func (s *store) Images() ([]Image, error) { var images []Image if _, _, err := readAllImageStores(s, func(store roImageStore) (struct{}, bool, error) { storeImages, err := store.Images() if err != nil { return struct{}{}, true, err } images = append(images, storeImages...) return struct{}{}, false, nil }); err != nil { return nil, err } return images, nil } func (s *store) Containers() ([]Container, error) { res, _, err := readContainerStore(s, func() ([]Container, bool, error) { res, err := s.containerStore.Containers() return res, true, err }) return res, err } func (s *store) Layer(id string) (*Layer, error) { if res, done, err := readAllLayerStores(s, func(store roLayerStore) (*Layer, bool, error) { layer, err := store.Get(id) if err == nil { return layer, true, nil } return nil, false, nil }); done { return res, err } return nil, ErrLayerUnknown } func (s *store) LookupAdditionalLayer(tocDigest digest.Digest, imageref string) (AdditionalLayer, error) { var adriver drivers.AdditionalLayerStoreDriver if err := func() error { // A scope for defer if err := s.startUsingGraphDriver(); err != nil { return err } defer s.stopUsingGraphDriver() a, ok := s.graphDriver.(drivers.AdditionalLayerStoreDriver) if !ok { return ErrLayerUnknown } adriver = a return nil }(); err != nil { return nil, err } al, err := adriver.LookupAdditionalLayer(tocDigest, imageref) if err != nil { if errors.Is(err, drivers.ErrLayerUnknown) { return nil, ErrLayerUnknown } return nil, err } info, err := al.Info() if err != nil { return nil, err } defer info.Close() var layer Layer if err := json.NewDecoder(info).Decode(&layer); err != nil { return nil, err } return &additionalLayer{&layer, al, s}, nil } type additionalLayer struct { layer *Layer handler drivers.AdditionalLayer s *store } func (al *additionalLayer) TOCDigest() digest.Digest { return al.layer.TOCDigest } func (al *additionalLayer) CompressedSize() int64 { return al.layer.CompressedSize } func (al *additionalLayer) PutAs(id, parent string, names []string) (*Layer, error) { rlstore, rlstores, err := al.s.bothLayerStoreKinds() if err != nil { return nil, err } if err := rlstore.startWriting(); err != nil { return nil, err } defer rlstore.stopWriting() var parentLayer *Layer if parent != "" { for _, lstore := range append([]roLayerStore{rlstore}, rlstores...) { if lstore != rlstore { if err := lstore.startReading(); err != nil { return nil, err } defer lstore.stopReading() } parentLayer, err = lstore.Get(parent) if err == nil { break } } if parentLayer == nil { return nil, ErrLayerUnknown } } return rlstore.PutAdditionalLayer(id, parentLayer, names, al.handler) } func (al *additionalLayer) Release() { al.handler.Release() } func (s *store) Image(id string) (*Image, error) { if res, done, err := readAllImageStores(s, func(store roImageStore) (*Image, bool, error) { image, err := store.Get(id) if err == nil { if store != s.imageStore { // found it in a read-only store - readAllImageStores() still has the writeable store locked for reading if _, localErr := s.imageStore.Get(image.ID); localErr == nil { // if the lookup key was a name, and we found the image in a read-only // store, but we have an entry with the same ID in the read-write store, // then the name was removed when we duplicated the image's // record into writable storage, so we should ignore this entry return nil, false, nil } } return image, true, nil } return nil, false, nil }); done { return res, err } return nil, fmt.Errorf("locating image with ID %q: %w", id, ErrImageUnknown) } func (s *store) ImagesByTopLayer(id string) ([]*Image, error) { layer, err := s.Layer(id) if err != nil { return nil, err } images := []*Image{} if _, _, err := readAllImageStores(s, func(store roImageStore) (struct{}, bool, error) { imageList, err := store.Images() if err != nil { return struct{}{}, true, err } for _, image := range imageList { if image.TopLayer == layer.ID || stringutils.InSlice(image.MappedTopLayers, layer.ID) { images = append(images, &image) } } return struct{}{}, false, nil }); err != nil { return nil, err } return images, nil } func (s *store) ImagesByDigest(d digest.Digest) ([]*Image, error) { images := []*Image{} if _, _, err := readAllImageStores(s, func(store roImageStore) (struct{}, bool, error) { imageList, err := store.ByDigest(d) if err != nil && !errors.Is(err, ErrImageUnknown) { return struct{}{}, true, err } images = append(images, imageList...) return struct{}{}, false, nil }); err != nil { return nil, err } return images, nil } func (s *store) Container(id string) (*Container, error) { res, _, err := readContainerStore(s, func() (*Container, bool, error) { res, err := s.containerStore.Get(id) return res, true, err }) return res, err } func (s *store) ContainerLayerID(id string) (string, error) { container, _, err := readContainerStore(s, func() (*Container, bool, error) { res, err := s.containerStore.Get(id) return res, true, err }) if err != nil { return "", err } return container.LayerID, nil } func (s *store) ContainerByLayer(id string) (*Container, error) { layer, err := s.Layer(id) if err != nil { return nil, err } containerList, _, err := readContainerStore(s, func() ([]Container, bool, error) { res, err := s.containerStore.Containers() return res, true, err }) if err != nil { return nil, err } for _, container := range containerList { if container.LayerID == layer.ID { return &container, nil } } return nil, ErrContainerUnknown } func (s *store) ImageDirectory(id string) (string, error) { foundImage := false if res, done, err := readAllImageStores(s, func(store roImageStore) (string, bool, error) { if store.Exists(id) { foundImage = true } middleDir := s.graphDriverName + "-images" gipath := filepath.Join(s.GraphRoot(), middleDir, id, "userdata") if err := os.MkdirAll(gipath, 0o700); err != nil { return "", true, err } return gipath, true, nil }); done { return res, err } if foundImage { return "", fmt.Errorf("locating image with ID %q (consider removing the image to resolve the issue): %w", id, os.ErrNotExist) } return "", fmt.Errorf("locating image with ID %q: %w", id, ErrImageUnknown) } func (s *store) ContainerDirectory(id string) (string, error) { res, _, err := readContainerStore(s, func() (string, bool, error) { id, err := s.containerStore.Lookup(id) if err != nil { return "", true, err } middleDir := s.graphDriverName + "-containers" gcpath := filepath.Join(s.GraphRoot(), middleDir, id, "userdata") if err := os.MkdirAll(gcpath, 0o700); err != nil { return "", true, err } return gcpath, true, nil }) return res, err } func (s *store) ImageRunDirectory(id string) (string, error) { foundImage := false if res, done, err := readAllImageStores(s, func(store roImageStore) (string, bool, error) { if store.Exists(id) { foundImage = true } middleDir := s.graphDriverName + "-images" rcpath := filepath.Join(s.RunRoot(), middleDir, id, "userdata") if err := os.MkdirAll(rcpath, 0o700); err != nil { return "", true, err } return rcpath, true, nil }); done { return res, err } if foundImage { return "", fmt.Errorf("locating image with ID %q (consider removing the image to resolve the issue): %w", id, os.ErrNotExist) } return "", fmt.Errorf("locating image with ID %q: %w", id, ErrImageUnknown) } func (s *store) ContainerRunDirectory(id string) (string, error) { res, _, err := readContainerStore(s, func() (string, bool, error) { id, err := s.containerStore.Lookup(id) if err != nil { return "", true, err } middleDir := s.graphDriverName + "-containers" rcpath := filepath.Join(s.RunRoot(), middleDir, id, "userdata") if err := os.MkdirAll(rcpath, 0o700); err != nil { return "", true, err } return rcpath, true, nil }) return res, err } func (s *store) SetContainerDirectoryFile(id, file string, data []byte) error { dir, err := s.ContainerDirectory(id) if err != nil { return err } err = os.MkdirAll(filepath.Dir(filepath.Join(dir, file)), 0o700) if err != nil { return err } return ioutils.AtomicWriteFile(filepath.Join(dir, file), data, 0o600) } func (s *store) FromContainerDirectory(id, file string) ([]byte, error) { dir, err := s.ContainerDirectory(id) if err != nil { return nil, err } return os.ReadFile(filepath.Join(dir, file)) } func (s *store) SetContainerRunDirectoryFile(id, file string, data []byte) error { dir, err := s.ContainerRunDirectory(id) if err != nil { return err } err = os.MkdirAll(filepath.Dir(filepath.Join(dir, file)), 0o700) if err != nil { return err } return ioutils.AtomicWriteFile(filepath.Join(dir, file), data, 0o600) } func (s *store) FromContainerRunDirectory(id, file string) ([]byte, error) { dir, err := s.ContainerRunDirectory(id) if err != nil { return nil, err } return os.ReadFile(filepath.Join(dir, file)) } func (s *store) Shutdown(force bool) ([]string, error) { mounted := []string{} if err := s.startUsingGraphDriver(); err != nil { return mounted, err } defer s.stopUsingGraphDriver() rlstore, err := s.getLayerStoreLocked() if err != nil { return mounted, err } if err := rlstore.startWriting(); err != nil { return nil, err } defer rlstore.stopWriting() layers, err := rlstore.Layers() if err != nil { return mounted, err } for _, layer := range layers { if layer.MountCount == 0 { continue } mounted = append(mounted, layer.ID) if force { for { _, err2 := rlstore.unmount(layer.ID, force, true) if err2 == ErrLayerNotMounted { break } if err2 != nil { if err == nil { err = err2 } break } } } } if len(mounted) > 0 && err == nil { err = fmt.Errorf("a layer is mounted: %w", ErrLayerUsedByContainer) } if err == nil { // We don’t retain the lastWrite value, and treat this update as if someone else did the .Cleanup(), // so that we reload after a .Shutdown() the same way other processes would. // Shutdown() is basically an error path, so reliability is more important than performance. if _, err2 := s.graphLock.RecordWrite(); err2 != nil { err = fmt.Errorf("graphLock.RecordWrite failed: %w", err2) } // Do the Cleanup() only after we are sure that the change was recorded with RecordWrite(), so that // the next user picks it. if err == nil { err = s.graphDriver.Cleanup() } } return mounted, err } // Convert a BigData key name into an acceptable file name. func makeBigDataBaseName(key string) string { reader := strings.NewReader(key) for reader.Len() > 0 { ch, size, err := reader.ReadRune() if err != nil || size != 1 { break } if ch != '.' && (ch < '0' || ch > '9') && (ch < 'a' || ch > 'z') { break } } if reader.Len() > 0 { return "=" + base64.StdEncoding.EncodeToString([]byte(key)) } return key } func stringSliceWithoutValue(slice []string, value string) []string { return slices.DeleteFunc(slices.Clone(slice), func(v string) bool { return v == value }) } // copySlicePreferringNil returns a copy of the slice. // If s is empty, a nil is returned. func copySlicePreferringNil[S ~[]E, E any](s S) S { if len(s) == 0 { return nil } return slices.Clone(s) } // copyMapPreferringNil returns a shallow clone of map m. // If m is empty, a nil is returned. // // (As of, e.g., Go 1.23, maps.Clone preserves nil, but that’s not a documented promise; // and this function turns even non-nil empty maps into nil.) func copyMapPreferringNil[K comparable, V any](m map[K]V) map[K]V { if len(m) == 0 { return nil } return maps.Clone(m) } // newMapFrom returns a shallow clone of map m. // If m is empty, an empty map is allocated and returned. func newMapFrom[K comparable, V any](m map[K]V) map[K]V { if len(m) == 0 { return make(map[K]V, 0) } return maps.Clone(m) } func copyImageBigDataOptionSlice(slice []ImageBigDataOption) []ImageBigDataOption { ret := make([]ImageBigDataOption, len(slice)) for i := range slice { ret[i].Key = slice[i].Key ret[i].Data = slices.Clone(slice[i].Data) ret[i].Digest = slice[i].Digest } return ret } func copyContainerBigDataOptionSlice(slice []ContainerBigDataOption) []ContainerBigDataOption { ret := make([]ContainerBigDataOption, len(slice)) for i := range slice { ret[i].Key = slice[i].Key ret[i].Data = slices.Clone(slice[i].Data) } return ret } // AutoUserNsMinSize is the minimum size for automatically created user namespaces const AutoUserNsMinSize = 1024 // AutoUserNsMaxSize is the maximum size for automatically created user namespaces const AutoUserNsMaxSize = 65536 // RootAutoUserNsUser is the default user used for root containers when automatically // creating a user namespace. const RootAutoUserNsUser = "containers" // SetDefaultConfigFilePath sets the default configuration to the specified path, and loads the file. // Deprecated: Use types.SetDefaultConfigFilePath, which can return an error. func SetDefaultConfigFilePath(path string) { _ = types.SetDefaultConfigFilePath(path) } // DefaultConfigFile returns the path to the storage config file used func DefaultConfigFile() (string, error) { return types.DefaultConfigFile() } // ReloadConfigurationFile parses the specified configuration file and overrides // the configuration in storeOptions. // Deprecated: Use types.ReloadConfigurationFile, which can return an error. func ReloadConfigurationFile(configFile string, storeOptions *types.StoreOptions) { _ = types.ReloadConfigurationFile(configFile, storeOptions) } // GetDefaultMountOptions returns the default mountoptions defined in container/storage func GetDefaultMountOptions() ([]string, error) { defaultStoreOptions, err := types.Options() if err != nil { return nil, err } return GetMountOptions(defaultStoreOptions.GraphDriverName, defaultStoreOptions.GraphDriverOptions) } // GetMountOptions returns the mountoptions for the specified driver and graphDriverOptions func GetMountOptions(driver string, graphDriverOptions []string) ([]string, error) { mountOpts := []string{ ".mountopt", fmt.Sprintf("%s.mountopt", driver), } for _, option := range graphDriverOptions { key, val, err := parsers.ParseKeyValueOpt(option) if err != nil { return nil, err } key = strings.ToLower(key) if slices.Contains(mountOpts, key) { return strings.Split(val, ","), nil } } return nil, nil } // Free removes the store from the list of stores func (s *store) Free() { if i := slices.Index(stores, s); i != -1 { stores = slices.Delete(stores, i, i+1) } } // Tries to clean up old unreferenced container leftovers. returns the first error // but continues as far as it can func (s *store) GarbageCollect() error { _, firstErr := writeToContainerStore(s, func() (struct{}, error) { return struct{}{}, s.containerStore.GarbageCollect() }) _, moreErr := writeToImageStore(s, func() (struct{}, error) { return struct{}{}, s.imageStore.GarbageCollect() }) if firstErr == nil { firstErr = moreErr } _, moreErr = writeToLayerStore(s, func(rlstore rwLayerStore) (struct{}, error) { return struct{}{}, rlstore.GarbageCollect() }) if firstErr == nil { firstErr = moreErr } return firstErr } // List returns a MultiListResult structure that contains layer, image, or container // extracts according to the values in MultiListOptions. func (s *store) MultiList(options MultiListOptions) (MultiListResult, error) { // TODO: Possible optimization: Deduplicate content from multiple stores. out := MultiListResult{} if options.Layers { layerStores, err := s.allLayerStores() if err != nil { return MultiListResult{}, err } for _, roStore := range layerStores { if err := roStore.startReading(); err != nil { return MultiListResult{}, err } defer roStore.stopReading() layers, err := roStore.Layers() if err != nil { return MultiListResult{}, err } out.Layers = append(out.Layers, layers...) } } if options.Images { for _, roStore := range s.allImageStores() { if err := roStore.startReading(); err != nil { return MultiListResult{}, err } defer roStore.stopReading() images, err := roStore.Images() if err != nil { return MultiListResult{}, err } out.Images = append(out.Images, images...) } } if options.Containers { containers, _, err := readContainerStore(s, func() ([]Container, bool, error) { res, err := s.containerStore.Containers() return res, true, err }) if err != nil { return MultiListResult{}, err } out.Containers = append(out.Containers, containers...) } return out, nil } // Dedup deduplicates layers in the store. func (s *store) Dedup(req DedupArgs) (drivers.DedupResult, error) { imgs, err := s.Images() if err != nil { return drivers.DedupResult{}, err } var topLayers []string for _, i := range imgs { topLayers = append(topLayers, i.TopLayer) topLayers = append(topLayers, i.MappedTopLayers...) } return writeToLayerStore(s, func(rlstore rwLayerStore) (drivers.DedupResult, error) { layers := make(map[string]struct{}) for _, i := range topLayers { cur := i for cur != "" { if _, visited := layers[cur]; visited { break } l, err := rlstore.Get(cur) if err != nil { if err == ErrLayerUnknown { break } return drivers.DedupResult{}, err } layers[cur] = struct{}{} cur = l.Parent } } r := drivers.DedupArgs{ Options: req.Options, } for l := range layers { r.Layers = append(r.Layers, l) } return rlstore.dedup(r) }) } ================================================ FILE: vendor/go.podman.io/storage/types/default_override_test.conf ================================================ [storage] # Default Storage Driver driver = "" # Primary Read/Write location of container storage graphroot = "environment_override_graphroot" # Storage path for rootless users # rootless_storage_path = "environment_override_rootless_storage_path" ================================================ FILE: vendor/go.podman.io/storage/types/errors.go ================================================ package types import ( "errors" ) var ( // ErrContainerUnknown indicates that there was no container with the specified name or ID. ErrContainerUnknown = errors.New("container not known") // ErrDigestUnknown indicates that we were unable to compute the digest of a specified item. ErrDigestUnknown = errors.New("could not compute digest of item") // ErrDuplicateID indicates that an ID which is to be assigned to a new item is already being used. ErrDuplicateID = errors.New("that ID is already in use") // ErrDuplicateImageNames indicates that the read-only store uses the same name for multiple images. ErrDuplicateImageNames = errors.New("read-only image store assigns the same name to multiple images") // ErrDuplicateLayerNames indicates that the read-only store uses the same name for multiple layers. ErrDuplicateLayerNames = errors.New("read-only layer store assigns the same name to multiple layers") // ErrDuplicateName indicates that a name which is to be assigned to a new item is already being used. ErrDuplicateName = errors.New("that name is already in use") // ErrImageUnknown indicates that there was no image with the specified name or ID. ErrImageUnknown = errors.New("image not known") // ErrImageUsedByContainer is returned when the caller attempts to delete an image that is a container's image. ErrImageUsedByContainer = errors.New("image is in use by a container") // ErrIncompleteOptions is returned when the caller attempts to initialize a Store without providing required information. ErrIncompleteOptions = errors.New("missing necessary StoreOptions") // ErrInvalidBigDataName indicates that the name for a big data item is not acceptable; it may be empty. ErrInvalidBigDataName = errors.New("not a valid name for a big data item") // ErrLayerHasChildren is returned when the caller attempts to delete a layer that has children. ErrLayerHasChildren = errors.New("layer has children") // ErrLayerNotMounted is returned when the requested information can only be computed for a mounted layer, and the layer is not mounted. ErrLayerNotMounted = errors.New("layer is not mounted") // ErrLayerUnknown indicates that there was no layer with the specified name or ID. ErrLayerUnknown = errors.New("layer not known") // ErrLayerUsedByContainer is returned when the caller attempts to delete a layer that is a container's layer. ErrLayerUsedByContainer = errors.New("layer is in use by a container") // ErrLayerUsedByImage is returned when the caller attempts to delete a layer that is an image's top layer. ErrLayerUsedByImage = errors.New("layer is in use by an image") // ErrLoadError indicates that there was an initialization error. ErrLoadError = errors.New("error loading storage metadata") // ErrNotAContainer is returned when the caller attempts to delete a container that isn't a container. ErrNotAContainer = errors.New("identifier is not a container") // ErrNotALayer is returned when the caller attempts to delete a layer that isn't a layer. ErrNotALayer = errors.New("identifier is not a layer") // ErrNotAnID is returned when the caller attempts to read or write metadata from an item that doesn't exist. ErrNotAnID = errors.New("identifier is not a layer, image, or container") // ErrNotAnImage is returned when the caller attempts to delete an image that isn't an image. ErrNotAnImage = errors.New("identifier is not an image") // ErrParentIsContainer is returned when a caller attempts to create a layer as a child of a container's layer. ErrParentIsContainer = errors.New("would-be parent layer is a container") // ErrParentUnknown indicates that we didn't record the ID of the parent of the specified layer. ErrParentUnknown = errors.New("parent of layer not known") // ErrSizeUnknown is returned when the caller asks for the size of a big data item, but the Store couldn't determine the answer. ErrSizeUnknown = errors.New("size is not known") // ErrStoreIsReadOnly is returned when the caller makes a call to a read-only store that would require modifying its contents. ErrStoreIsReadOnly = errors.New("called a write method on a read-only store") // ErrNotSupported is returned when the requested functionality is not supported. ErrNotSupported = errors.New("not supported") // ErrInvalidMappings is returned when the specified mappings are invalid. ErrInvalidMappings = errors.New("invalid mappings specified") // ErrNoAvailableIDs is returned when there are not enough unused IDS within the user namespace. ErrNoAvailableIDs = errors.New("not enough unused IDs in user namespace") // ErrLayerUnaccounted describes a layer that is present in the lower-level storage driver, // but which is not known to or managed by the higher-level driver-agnostic logic. ErrLayerUnaccounted = errors.New("layer in lower level storage driver not accounted for") // ErrLayerUnreferenced describes a layer which is not used by any image or container. ErrLayerUnreferenced = errors.New("layer not referenced by any images or containers") // ErrLayerIncorrectContentDigest describes a layer for which the contents of one or more // files which were added in the layer appear to have changed. It may instead look like an // unnamed "file integrity checksum failed" error. ErrLayerIncorrectContentDigest = errors.New("layer content incorrect digest") // ErrLayerIncorrectContentSize describes a layer for which regenerating the diff that was // used to populate the layer produced a diff of a different size. We check the digest // first, so it's highly unlikely you'll ever see this error. ErrLayerIncorrectContentSize = errors.New("layer content incorrect size") // ErrLayerContentModified describes a layer which contains contents which should not be // there, or for which ownership/permissions/dates have been changed. ErrLayerContentModified = errors.New("layer content modified") // ErrLayerDataMissing describes a layer which is missing a big data item. ErrLayerDataMissing = errors.New("layer data item is missing") // ErrLayerMissing describes a layer which is the missing parent of a layer. ErrLayerMissing = errors.New("layer is missing") // ErrImageLayerMissing describes an image which claims to have a layer that we don't know // about. ErrImageLayerMissing = errors.New("image layer is missing") // ErrImageDataMissing describes an image which is missing a big data item. ErrImageDataMissing = errors.New("image data item is missing") // ErrImageDataIncorrectSize describes an image which has a big data item which looks like // its size has changed, likely because it's been modified somehow. ErrImageDataIncorrectSize = errors.New("image data item has incorrect size") // ErrContainerImageMissing describes a container which claims to be based on an image that // we don't know about. ErrContainerImageMissing = errors.New("image missing") // ErrContainerDataMissing describes a container which is missing a big data item. ErrContainerDataMissing = errors.New("container data item is missing") // ErrContainerDataIncorrectSize describes a container which has a big data item which looks // like its size has changed, likely because it's been modified somehow. ErrContainerDataIncorrectSize = errors.New("container data item has incorrect size") ) ================================================ FILE: vendor/go.podman.io/storage/types/idmappings.go ================================================ package types import ( "fmt" "os" "go.podman.io/storage/pkg/idtools" ) // AutoUserNsOptions defines how to automatically create a user namespace. type AutoUserNsOptions struct { // Size defines the size for the user namespace. If it is set to a // value bigger than 0, the user namespace will have exactly this size. // If it is not set, some heuristics will be used to find its size. Size uint32 // InitialSize defines the minimum size for the user namespace. // The created user namespace will have at least this size. InitialSize uint32 // PasswdFile to use if the container uses a volume. PasswdFile string // GroupFile to use if the container uses a volume. GroupFile string // AdditionalUIDMappings specified additional UID mappings to include in // the generated user namespace. AdditionalUIDMappings []idtools.IDMap // AdditionalGIDMappings specified additional GID mappings to include in // the generated user namespace. AdditionalGIDMappings []idtools.IDMap } // IDMappingOptions are used for specifying how ID mapping should be set up for // a layer or container. type IDMappingOptions struct { // UIDMap and GIDMap are used for setting up a layer's root filesystem // for use inside of a user namespace where ID mapping is being used. // If HostUIDMapping/HostGIDMapping is true, no mapping of the // respective type will be used. Otherwise, if UIDMap and/or GIDMap // contain at least one mapping, one or both will be used. By default, // if neither of those conditions apply, if the layer has a parent // layer, the parent layer's mapping will be used, and if it does not // have a parent layer, the mapping which was passed to the Store // object when it was initialized will be used. HostUIDMapping bool HostGIDMapping bool UIDMap []idtools.IDMap GIDMap []idtools.IDMap AutoUserNs bool AutoUserNsOpts AutoUserNsOptions } // ParseIDMapping takes idmappings and subuid and subgid maps and returns a storage mapping func ParseIDMapping(UIDMapSlice, GIDMapSlice []string, subUIDMap, subGIDMap string) (*IDMappingOptions, error) { options := IDMappingOptions{ HostUIDMapping: true, HostGIDMapping: true, } if subGIDMap == "" && subUIDMap != "" { subGIDMap = subUIDMap } if subUIDMap == "" && subGIDMap != "" { subUIDMap = subGIDMap } if len(GIDMapSlice) == 0 && len(UIDMapSlice) != 0 { GIDMapSlice = UIDMapSlice } if len(UIDMapSlice) == 0 && len(GIDMapSlice) != 0 { UIDMapSlice = GIDMapSlice } if len(UIDMapSlice) == 0 && subUIDMap == "" && os.Getuid() != 0 { UIDMapSlice = []string{fmt.Sprintf("0:%d:1", os.Getuid())} } if len(GIDMapSlice) == 0 && subGIDMap == "" && os.Getuid() != 0 { GIDMapSlice = []string{fmt.Sprintf("0:%d:1", os.Getgid())} } if subUIDMap != "" && subGIDMap != "" { mappings, err := idtools.NewIDMappings(subUIDMap, subGIDMap) if err != nil { return nil, fmt.Errorf("failed to create NewIDMappings for uidmap=%s gidmap=%s: %w", subUIDMap, subGIDMap, err) } options.UIDMap = mappings.UIDs() options.GIDMap = mappings.GIDs() } parsedUIDMap, err := idtools.ParseIDMap(UIDMapSlice, "UID") if err != nil { return nil, fmt.Errorf("failed to create ParseUIDMap UID=%s: %w", UIDMapSlice, err) } parsedGIDMap, err := idtools.ParseIDMap(GIDMapSlice, "GID") if err != nil { return nil, fmt.Errorf("failed to create ParseGIDMap GID=%s: %w", UIDMapSlice, err) } options.UIDMap = append(options.UIDMap, parsedUIDMap...) options.GIDMap = append(options.GIDMap, parsedGIDMap...) if len(options.UIDMap) > 0 { options.HostUIDMapping = false } if len(options.GIDMap) > 0 { options.HostGIDMapping = false } return &options, nil } ================================================ FILE: vendor/go.podman.io/storage/types/options.go ================================================ package types import ( "errors" "fmt" "os" "path/filepath" "slices" "strings" "sync" "time" "github.com/BurntSushi/toml" "github.com/sirupsen/logrus" cfg "go.podman.io/storage/pkg/config" "go.podman.io/storage/pkg/fileutils" "go.podman.io/storage/pkg/homedir" "go.podman.io/storage/pkg/idtools" "go.podman.io/storage/pkg/unshare" ) // TOML-friendly explicit tables used for conversions. type TomlConfig struct { Storage struct { Driver string `toml:"driver,omitempty"` DriverPriority []string `toml:"driver_priority,omitempty"` RunRoot string `toml:"runroot,omitempty"` ImageStore string `toml:"imagestore,omitempty"` GraphRoot string `toml:"graphroot,omitempty"` RootlessStoragePath string `toml:"rootless_storage_path,omitempty"` TransientStore bool `toml:"transient_store,omitempty"` Options cfg.OptionsConfig `toml:"options,omitempty"` } `toml:"storage"` } const ( overlayDriver = "overlay" overlay2 = "overlay2" storageConfEnv = "CONTAINERS_STORAGE_CONF" ) var ( defaultStoreOptionsOnce sync.Once loadDefaultStoreOptionsErr error once sync.Once storeOptions StoreOptions storeError error defaultConfigFileSet bool // defaultConfigFile path to the system wide storage.conf file defaultConfigFile = SystemConfigFile // DefaultStoreOptions is a reasonable default set of options. defaultStoreOptions StoreOptions ) func loadDefaultStoreOptions() { defaultStoreOptions.GraphDriverName = "" setDefaults := func() { // reload could set values to empty for run and graph root if config does not contains anything if defaultStoreOptions.RunRoot == "" { defaultStoreOptions.RunRoot = defaultRunRoot } if defaultStoreOptions.GraphRoot == "" { defaultStoreOptions.GraphRoot = defaultGraphRoot } } setDefaults() if path, ok := os.LookupEnv(storageConfEnv); ok { defaultOverrideConfigFile = path if err := ReloadConfigurationFileIfNeeded(path, &defaultStoreOptions); err != nil { loadDefaultStoreOptionsErr = err return } setDefaults() return } if path, ok := os.LookupEnv("XDG_CONFIG_HOME"); ok { homeConfigFile := filepath.Join(path, "containers", "storage.conf") if err := fileutils.Exists(homeConfigFile); err == nil { // user storage.conf in XDG_CONFIG_HOME if it exists defaultOverrideConfigFile = homeConfigFile } else { if !os.IsNotExist(err) { loadDefaultStoreOptionsErr = err return } } } err := fileutils.Exists(defaultOverrideConfigFile) if err == nil { // The DefaultConfigFile() function returns the path // of the used storage.conf file, by returning defaultConfigFile // If override exists containers/storage uses it by default. defaultConfigFile = defaultOverrideConfigFile if err := ReloadConfigurationFileIfNeeded(defaultOverrideConfigFile, &defaultStoreOptions); err != nil { loadDefaultStoreOptionsErr = err return } setDefaults() return } if !os.IsNotExist(err) { logrus.Warningf("Attempting to use %s, %v", defaultConfigFile, err) } if err := ReloadConfigurationFileIfNeeded(defaultConfigFile, &defaultStoreOptions); err != nil && !errors.Is(err, os.ErrNotExist) { loadDefaultStoreOptionsErr = err return } setDefaults() } // loadStoreOptions returns the default storage ops for containers func loadStoreOptions() (StoreOptions, error) { storageConf, err := DefaultConfigFile() if err != nil { return defaultStoreOptions, err } return loadStoreOptionsFromConfFile(storageConf) } // usePerUserStorage returns whether the user private storage must be used. // We cannot simply use the unshare.IsRootless() condition, because // that checks only if the current process needs a user namespace to // work and it would break cases where the process is already created // in a user namespace (e.g. nested Podman/Buildah) and the desired // behavior is to use system paths instead of user private paths. func usePerUserStorage() bool { return unshare.IsRootless() && unshare.GetRootlessUID() != 0 } // loadStoreOptionsFromConfFile is an internal implementation detail of DefaultStoreOptions to allow testing. // Everyone but the tests this is intended for should only call loadStoreOptions, never this function. func loadStoreOptionsFromConfFile(storageConf string) (StoreOptions, error) { var ( defaultRootlessRunRoot string defaultRootlessGraphRoot string err error ) defaultStoreOptionsOnce.Do(loadDefaultStoreOptions) if loadDefaultStoreOptionsErr != nil { return StoreOptions{}, loadDefaultStoreOptionsErr } storageOpts := defaultStoreOptions if usePerUserStorage() { storageOpts, err = getRootlessStorageOpts(storageOpts) if err != nil { return storageOpts, err } } err = fileutils.Exists(storageConf) if err != nil && !os.IsNotExist(err) { return storageOpts, err } if err == nil && !defaultConfigFileSet { defaultRootlessRunRoot = storageOpts.RunRoot defaultRootlessGraphRoot = storageOpts.GraphRoot storageOpts = StoreOptions{} reloadConfigurationFileIfNeeded(storageConf, &storageOpts) // If the file did not specify a graphroot or runroot, // set sane defaults so we don't try and use root-owned // directories if storageOpts.RunRoot == "" { storageOpts.RunRoot = defaultRootlessRunRoot } if storageOpts.GraphRoot == "" { if storageOpts.RootlessStoragePath != "" { storageOpts.GraphRoot = storageOpts.RootlessStoragePath } else { storageOpts.GraphRoot = defaultRootlessGraphRoot } } } if storageOpts.RunRoot == "" { return storageOpts, fmt.Errorf("runroot must be set") } rootlessUID := unshare.GetRootlessUID() runRoot, err := expandEnvPath(storageOpts.RunRoot, rootlessUID) if err != nil { return storageOpts, err } storageOpts.RunRoot = runRoot if storageOpts.GraphRoot == "" { return storageOpts, fmt.Errorf("graphroot must be set") } graphRoot, err := expandEnvPath(storageOpts.GraphRoot, rootlessUID) if err != nil { return storageOpts, err } storageOpts.GraphRoot = graphRoot if storageOpts.RootlessStoragePath != "" { storagePath, err := expandEnvPath(storageOpts.RootlessStoragePath, rootlessUID) if err != nil { return storageOpts, err } storageOpts.RootlessStoragePath = storagePath } if storageOpts.ImageStore != "" && storageOpts.ImageStore == storageOpts.GraphRoot { return storageOpts, fmt.Errorf("imagestore %s must either be not set or be a different than graphroot", storageOpts.ImageStore) } return storageOpts, nil } // UpdateOptions should be called iff container engine received a SIGHUP, // otherwise use DefaultStoreOptions func UpdateStoreOptions() (StoreOptions, error) { storeOptions, storeError = loadStoreOptions() return storeOptions, storeError } // DefaultStoreOptions returns the default storage ops for containers func DefaultStoreOptions() (StoreOptions, error) { once.Do(func() { storeOptions, storeError = loadStoreOptions() }) return storeOptions, storeError } // StoreOptions is used for passing initialization options to GetStore(), for // initializing a Store object and the underlying storage that it controls. type StoreOptions struct { // RunRoot is the filesystem path under which we can store run-time // information, such as the locations of active mount points, that we // want to lose if the host is rebooted. RunRoot string `json:"runroot,omitempty"` // GraphRoot is the filesystem path under which we will store the // contents of layers, images, and containers. GraphRoot string `json:"root,omitempty"` // Image Store is the alternate location of image store if a location // separate from the container store is required. ImageStore string `json:"imagestore,omitempty"` // RootlessStoragePath is the storage path for rootless users // default $HOME/.local/share/containers/storage RootlessStoragePath string `toml:"rootless_storage_path"` // If the driver is not specified, the best suited driver will be picked // either from GraphDriverPriority, if specified, or from the platform // dependent priority list (in that order). GraphDriverName string `json:"driver,omitempty"` // GraphDriverPriority is a list of storage drivers that will be tried // to initialize the Store for a given RunRoot and GraphRoot unless a // GraphDriverName is set. // This list can be used to define a custom order in which the drivers // will be tried. GraphDriverPriority []string `json:"driver-priority,omitempty"` // GraphDriverOptions are driver-specific options. GraphDriverOptions []string `json:"driver-options,omitempty"` // UIDMap and GIDMap are used for setting up a container's root filesystem // for use inside of a user namespace where UID mapping is being used. UIDMap []idtools.IDMap `json:"uidmap,omitempty"` GIDMap []idtools.IDMap `json:"gidmap,omitempty"` // RootAutoNsUser is the user used to pick a subrange when automatically setting // a user namespace for the root user. RootAutoNsUser string `json:"root_auto_ns_user,omitempty"` // AutoNsMinSize is the minimum size for an automatic user namespace. AutoNsMinSize uint32 `json:"auto_userns_min_size,omitempty"` // AutoNsMaxSize is the maximum size for an automatic user namespace. AutoNsMaxSize uint32 `json:"auto_userns_max_size,omitempty"` // PullOptions specifies options to be handed to pull managers // This API is experimental and can be changed without bumping the major version number. PullOptions map[string]string `toml:"pull_options"` // DisableVolatile doesn't allow volatile mounts when it is set. DisableVolatile bool `json:"disable-volatile,omitempty"` // If transient, don't persist containers over boot (stores db in runroot) TransientStore bool `json:"transient_store,omitempty"` } // isRootlessDriver returns true if the given storage driver is valid for containers running as non root func isRootlessDriver(driver string) bool { validDrivers := map[string]bool{ "btrfs": true, "overlay": true, "overlay2": true, "vfs": true, } return validDrivers[driver] } // getRootlessStorageOpts returns the storage opts for containers running as non root func getRootlessStorageOpts(systemOpts StoreOptions) (StoreOptions, error) { var opts StoreOptions rootlessUID := unshare.GetRootlessUID() dataDir, err := homedir.GetDataHome() if err != nil { return opts, err } rootlessRuntime, err := homedir.GetRuntimeDir() if err != nil { return opts, err } opts.RunRoot = filepath.Join(rootlessRuntime, "containers") if err := os.MkdirAll(opts.RunRoot, 0o700); err != nil { return opts, fmt.Errorf("unable to make rootless runtime: %w", err) } opts.PullOptions = systemOpts.PullOptions if systemOpts.RootlessStoragePath != "" { opts.GraphRoot, err = expandEnvPath(systemOpts.RootlessStoragePath, rootlessUID) if err != nil { return opts, err } } else { opts.GraphRoot = filepath.Join(dataDir, "containers", "storage") } if driver := systemOpts.GraphDriverName; isRootlessDriver(driver) { opts.GraphDriverName = driver } if driver := os.Getenv("STORAGE_DRIVER"); driver != "" { opts.GraphDriverName = driver } if opts.GraphDriverName == overlay2 { logrus.Warnf("Switching default driver from overlay2 to the equivalent overlay driver") opts.GraphDriverName = overlayDriver } // If the configuration file was explicitly set, then copy all the options // present. if defaultConfigFileSet { opts.GraphDriverOptions = systemOpts.GraphDriverOptions opts.ImageStore = systemOpts.ImageStore } else if opts.GraphDriverName == overlayDriver { for _, o := range systemOpts.GraphDriverOptions { if strings.Contains(o, "ignore_chown_errors") { opts.GraphDriverOptions = append(opts.GraphDriverOptions, o) break } } } if opts.GraphDriverName == "" { if len(systemOpts.GraphDriverPriority) == 0 { dirEntries, err := os.ReadDir(opts.GraphRoot) if err == nil { for _, entry := range dirEntries { if name, ok := strings.CutSuffix(entry.Name(), "-images"); ok { opts.GraphDriverName = name break } } } if opts.GraphDriverName == "" { if canUseRootlessOverlay() { opts.GraphDriverName = overlayDriver } else { opts.GraphDriverName = "vfs" } } } else { opts.GraphDriverPriority = systemOpts.GraphDriverPriority } } if os.Getenv("STORAGE_OPTS") != "" { opts.GraphDriverOptions = slices.AppendSeq(opts.GraphDriverOptions, strings.SplitSeq(os.Getenv("STORAGE_OPTS"), ",")) } return opts, nil } var prevReloadConfig = struct { storeOptions *StoreOptions mod time.Time mutex sync.Mutex configFile string }{} // SetDefaultConfigFilePath sets the default configuration to the specified path func SetDefaultConfigFilePath(path string) error { defaultConfigFile = path defaultConfigFileSet = true return ReloadConfigurationFileIfNeeded(defaultConfigFile, &defaultStoreOptions) } func ReloadConfigurationFileIfNeeded(configFile string, storeOptions *StoreOptions) error { prevReloadConfig.mutex.Lock() defer prevReloadConfig.mutex.Unlock() fi, err := os.Stat(configFile) if err != nil { return err } mtime := fi.ModTime() if prevReloadConfig.storeOptions != nil && mtime.Equal(prevReloadConfig.mod) && prevReloadConfig.configFile == configFile { *storeOptions = *prevReloadConfig.storeOptions return nil } if err := ReloadConfigurationFile(configFile, storeOptions); err != nil { return err } cOptions := *storeOptions prevReloadConfig.storeOptions = &cOptions prevReloadConfig.mod = mtime prevReloadConfig.configFile = configFile return nil } // ReloadConfigurationFile parses the specified configuration file and overrides // the configuration in storeOptions. func ReloadConfigurationFile(configFile string, storeOptions *StoreOptions) error { config := new(TomlConfig) meta, err := toml.DecodeFile(configFile, &config) if err == nil { keys := meta.Undecoded() if len(keys) > 0 { logrus.Warningf("Failed to decode the keys %q from %q", keys, configFile) } } else { if !os.IsNotExist(err) { logrus.Warningf("Failed to read %s %v\n", configFile, err.Error()) return err } } // Clear storeOptions of previous settings *storeOptions = StoreOptions{} if config.Storage.Driver != "" { storeOptions.GraphDriverName = config.Storage.Driver } if os.Getenv("STORAGE_DRIVER") != "" { config.Storage.Driver = os.Getenv("STORAGE_DRIVER") storeOptions.GraphDriverName = config.Storage.Driver } if storeOptions.GraphDriverName == overlay2 { logrus.Warnf("Switching default driver from overlay2 to the equivalent overlay driver") storeOptions.GraphDriverName = overlayDriver } storeOptions.GraphDriverPriority = config.Storage.DriverPriority if storeOptions.GraphDriverName == "" && len(storeOptions.GraphDriverPriority) == 0 { logrus.Warnf("The storage 'driver' option should be set in %s. A driver was picked automatically.", configFile) } if config.Storage.RunRoot != "" { storeOptions.RunRoot = config.Storage.RunRoot } if config.Storage.GraphRoot != "" { storeOptions.GraphRoot = config.Storage.GraphRoot } if config.Storage.ImageStore != "" { storeOptions.ImageStore = config.Storage.ImageStore } if config.Storage.RootlessStoragePath != "" { storeOptions.RootlessStoragePath = config.Storage.RootlessStoragePath } for _, s := range config.Storage.Options.AdditionalImageStores { storeOptions.GraphDriverOptions = append(storeOptions.GraphDriverOptions, fmt.Sprintf("%s.imagestore=%s", config.Storage.Driver, s)) } for _, s := range config.Storage.Options.AdditionalLayerStores { storeOptions.GraphDriverOptions = append(storeOptions.GraphDriverOptions, fmt.Sprintf("%s.additionallayerstore=%s", config.Storage.Driver, s)) } if config.Storage.Options.Size != "" { storeOptions.GraphDriverOptions = append(storeOptions.GraphDriverOptions, fmt.Sprintf("%s.size=%s", config.Storage.Driver, config.Storage.Options.Size)) } if config.Storage.Options.MountProgram != "" { storeOptions.GraphDriverOptions = append(storeOptions.GraphDriverOptions, fmt.Sprintf("%s.mount_program=%s", config.Storage.Driver, config.Storage.Options.MountProgram)) } if config.Storage.Options.SkipMountHome != "" { storeOptions.GraphDriverOptions = append(storeOptions.GraphDriverOptions, fmt.Sprintf("%s.skip_mount_home=%s", config.Storage.Driver, config.Storage.Options.SkipMountHome)) } if config.Storage.Options.IgnoreChownErrors != "" { storeOptions.GraphDriverOptions = append(storeOptions.GraphDriverOptions, fmt.Sprintf("%s.ignore_chown_errors=%s", config.Storage.Driver, config.Storage.Options.IgnoreChownErrors)) } if config.Storage.Options.ForceMask != 0 { storeOptions.GraphDriverOptions = append(storeOptions.GraphDriverOptions, fmt.Sprintf("%s.force_mask=%o", config.Storage.Driver, config.Storage.Options.ForceMask)) } if config.Storage.Options.MountOpt != "" { storeOptions.GraphDriverOptions = append(storeOptions.GraphDriverOptions, fmt.Sprintf("%s.mountopt=%s", config.Storage.Driver, config.Storage.Options.MountOpt)) } storeOptions.RootAutoNsUser = config.Storage.Options.RootAutoUsernsUser if config.Storage.Options.AutoUsernsMinSize > 0 { storeOptions.AutoNsMinSize = config.Storage.Options.AutoUsernsMinSize } if config.Storage.Options.AutoUsernsMaxSize > 0 { storeOptions.AutoNsMaxSize = config.Storage.Options.AutoUsernsMaxSize } if config.Storage.Options.PullOptions != nil { storeOptions.PullOptions = config.Storage.Options.PullOptions } storeOptions.DisableVolatile = config.Storage.Options.DisableVolatile storeOptions.TransientStore = config.Storage.TransientStore storeOptions.GraphDriverOptions = append(storeOptions.GraphDriverOptions, cfg.GetGraphDriverOptions(storeOptions.GraphDriverName, config.Storage.Options)...) if opts, ok := os.LookupEnv("STORAGE_OPTS"); ok { storeOptions.GraphDriverOptions = strings.Split(opts, ",") } if len(storeOptions.GraphDriverOptions) == 1 && storeOptions.GraphDriverOptions[0] == "" { storeOptions.GraphDriverOptions = nil } return nil } func Options() (StoreOptions, error) { defaultStoreOptionsOnce.Do(loadDefaultStoreOptions) return defaultStoreOptions, loadDefaultStoreOptionsErr } // Save overwrites the tomlConfig in storage.conf with the given conf func Save(conf TomlConfig) error { configFile, err := DefaultConfigFile() if err != nil { return err } if err = os.Remove(configFile); !os.IsNotExist(err) && err != nil { return err } f, err := os.Create(configFile) if err != nil { return err } return toml.NewEncoder(f).Encode(conf) } // StorageConfig is used to retrieve the storage.conf toml in order to overwrite it func StorageConfig() (*TomlConfig, error) { config := new(TomlConfig) configFile, err := DefaultConfigFile() if err != nil { return nil, err } _, err = toml.DecodeFile(configFile, &config) if err != nil { return nil, err } return config, nil } ================================================ FILE: vendor/go.podman.io/storage/types/options_bsd.go ================================================ //go:build freebsd || netbsd package types const ( // these are default path for run and graph root for rootful users // for rootless path is constructed via getRootlessStorageOpts defaultRunRoot string = "/var/run/containers/storage" defaultGraphRoot string = "/var/db/containers/storage" SystemConfigFile = "/usr/local/share/containers/storage.conf" ) // defaultConfigFile path to the system wide storage.conf file var ( defaultOverrideConfigFile = "/usr/local/etc/containers/storage.conf" ) // canUseRootlessOverlay returns true if the overlay driver can be used for rootless containers func canUseRootlessOverlay() bool { return false } ================================================ FILE: vendor/go.podman.io/storage/types/options_darwin.go ================================================ package types const ( // these are default path for run and graph root for rootful users // for rootless path is constructed via getRootlessStorageOpts defaultRunRoot string = "/run/containers/storage" defaultGraphRoot string = "/var/lib/containers/storage" SystemConfigFile = "/usr/share/containers/storage.conf" ) var defaultOverrideConfigFile = "/etc/containers/storage.conf" // canUseRootlessOverlay returns true if the overlay driver can be used for rootless containers func canUseRootlessOverlay() bool { return false } ================================================ FILE: vendor/go.podman.io/storage/types/options_linux.go ================================================ package types import ( "os/exec" "strconv" "strings" "golang.org/x/sys/unix" ) const ( // these are default path for run and graph root for rootful users // for rootless path is constructed via getRootlessStorageOpts defaultRunRoot string = "/run/containers/storage" defaultGraphRoot string = "/var/lib/containers/storage" SystemConfigFile = "/usr/share/containers/storage.conf" ) // defaultConfigFile path to the system wide storage.conf file var ( defaultOverrideConfigFile = "/etc/containers/storage.conf" ) // canUseRootlessOverlay returns true if the overlay driver can be used for rootless containers func canUseRootlessOverlay() bool { // we check first for fuse-overlayfs since it is cheaper. if path, _ := exec.LookPath("fuse-overlayfs"); path != "" { return true } // We cannot use overlay.SupportsNativeOverlay since canUseRootlessOverlay is called by Podman // before we enter the user namespace and the driver we pick here is written in the podman database. // Checking the kernel version is usually not a good idea since the feature could be back-ported, e.g. RHEL // but this is just an heuristic and on RHEL we always install the storage.conf file. // native overlay for rootless was added upstream in 5.13 (at least the first version that we support), so check // that the kernel is >= 5.13. var uts unix.Utsname if err := unix.Uname(&uts); err == nil { parts := strings.Split(string(uts.Release[:]), ".") major, _ := strconv.Atoi(parts[0]) if major >= 6 { return true } if major == 5 && len(parts) > 1 { minor, _ := strconv.Atoi(parts[1]) if minor >= 13 { return true } } } return false } ================================================ FILE: vendor/go.podman.io/storage/types/options_windows.go ================================================ package types const ( // these are default path for run and graph root for rootful users // for rootless path is constructed via getRootlessStorageOpts defaultRunRoot string = "/run/containers/storage" defaultGraphRoot string = "/var/lib/containers/storage" SystemConfigFile = "/usr/share/containers/storage.conf" ) // defaultConfigFile path to the system wide storage.conf file var ( defaultOverrideConfigFile = "/etc/containers/storage.conf" ) // canUseRootlessOverlay returns true if the overlay driver can be used for rootless containers func canUseRootlessOverlay() bool { return false } ================================================ FILE: vendor/go.podman.io/storage/types/storage_broken.conf ================================================ # This file is is a TEST configuration file for all tools # that use the containers/storage library. # See man 5 containers-storage.conf for more information # The "container storage" table contains all of the server options. foo = "bar" [storage] # Default Storage Driver driver = "" # Temporary storage location runroot = "/run/containers/test" [storage.options] # Primary Read/Write location of container storage graphroot = "/var/lib/containers/storage" ================================================ FILE: vendor/go.podman.io/storage/types/storage_test.conf ================================================ # This file is is a TEST configuration file for all tools # that use the containers/storage library. # See man 5 containers-storage.conf for more information # The "container storage" table contains all of the server options. [storage] # Default Storage Driver driver = "" # Temporary storage location runroot = "$HOME/$UID/containers/storage" # Primary Read/Write location of container storage graphroot = "$HOME/$UID/containers/storage" # Storage path for rootless users # rootless_storage_path = "$HOME/$UID/containers/storage" [storage.options] # Storage options to be passed to underlying storage drivers # AdditionalImageStores is used to pass paths to additional Read/Only image stores # Must be comma separated list. additionalimagestores = [ ] [storage.options.overlay] # mountopt specifies comma separated list of extra mount options mountopt = "nodev" ================================================ FILE: vendor/go.podman.io/storage/types/utils.go ================================================ package types import ( "errors" "os" "path/filepath" "strconv" "strings" "github.com/sirupsen/logrus" "go.podman.io/storage/pkg/fileutils" "go.podman.io/storage/pkg/homedir" ) func expandEnvPath(path string, rootlessUID int) (string, error) { var err error path = strings.ReplaceAll(path, "$UID", strconv.Itoa(rootlessUID)) path = os.ExpandEnv(path) newpath, err := filepath.EvalSymlinks(path) if err != nil { newpath = filepath.Clean(path) } return newpath, nil } func DefaultConfigFile() (string, error) { if defaultConfigFileSet { return defaultConfigFile, nil } if path, ok := os.LookupEnv(storageConfEnv); ok { return path, nil } if !usePerUserStorage() { if err := fileutils.Exists(defaultOverrideConfigFile); err == nil { return defaultOverrideConfigFile, nil } return defaultConfigFile, nil } if configHome := os.Getenv("XDG_CONFIG_HOME"); configHome != "" { return filepath.Join(configHome, "containers/storage.conf"), nil } home := homedir.Get() if home == "" { return "", errors.New("cannot determine user's homedir") } return filepath.Join(home, ".config/containers/storage.conf"), nil } func reloadConfigurationFileIfNeeded(configFile string, storeOptions *StoreOptions) { prevReloadConfig.mutex.Lock() defer prevReloadConfig.mutex.Unlock() fi, err := os.Stat(configFile) if err != nil { if !os.IsNotExist(err) { logrus.Warningf("Failed to read %s %v\n", configFile, err.Error()) } return } mtime := fi.ModTime() if prevReloadConfig.storeOptions != nil && mtime.Equal(prevReloadConfig.mod) && prevReloadConfig.configFile == configFile { *storeOptions = *prevReloadConfig.storeOptions return } if err := ReloadConfigurationFile(configFile, storeOptions); err != nil { logrus.Warningf("Failed to reload %q %v\n", configFile, err) return } prevReloadConfig.storeOptions = storeOptions prevReloadConfig.mod = mtime prevReloadConfig.configFile = configFile } ================================================ FILE: vendor/go.podman.io/storage/userns.go ================================================ //go:build linux package storage import ( "fmt" "os" "os/user" "strconv" pathrs "github.com/cyphar/filepath-securejoin/pathrs-lite" libcontainerUser "github.com/moby/sys/user" "github.com/sirupsen/logrus" drivers "go.podman.io/storage/drivers" "go.podman.io/storage/pkg/idtools" "go.podman.io/storage/pkg/unshare" "go.podman.io/storage/types" "golang.org/x/sys/unix" ) // getAdditionalSubIDs looks up the additional IDs configured for // the specified user. // The argument USERNAME is ignored for rootless users, as it is not // possible to use an arbitrary entry in /etc/sub*id. // Differently, if the username is not specified for root users, a // default name is used. func getAdditionalSubIDs(username string) (*idSet, *idSet, error) { var uids, gids *idSet if unshare.IsRootless() { username = os.Getenv("USER") if username == "" { var id string if os.Geteuid() == 0 { id = strconv.Itoa(unshare.GetRootlessUID()) } else { id = strconv.Itoa(os.Geteuid()) } userID, err := user.LookupId(id) if err == nil { username = userID.Username } } } else if username == "" { username = RootAutoUserNsUser } mappings, err := idtools.NewIDMappings(username, username) if err != nil { logrus.Errorf("Cannot find mappings for user %q: %v", username, err) } else { uids = getHostIDs(mappings.UIDs()) gids = getHostIDs(mappings.GIDs()) } return uids, gids, nil } // getAvailableIDs returns the list of ranges that are usable by the current user. // When running as root, it looks up the additional IDs assigned to the specified user. // When running as rootless, the mappings assigned to the unprivileged user are converted // to the IDs inside of the initial rootless user namespace. func (s *store) getAvailableIDs() (*idSet, *idSet, error) { if s.additionalUIDs == nil { uids, gids, err := getAdditionalSubIDs(s.autoUsernsUser) if err != nil { return nil, nil, err } // Store the result so we don't need to look it up again next time s.additionalUIDs, s.additionalGIDs = uids, gids } if !unshare.IsRootless() { // No mapping to inner namespace needed return s.additionalUIDs, s.additionalGIDs, nil } // We are already inside of the rootless user namespace. // We need to remap the configured mappings to what is available // inside of the rootless userns. u := newIDSet([]interval{{start: 1, end: s.additionalUIDs.size() + 1}}) g := newIDSet([]interval{{start: 1, end: s.additionalGIDs.size() + 1}}) return u, g, nil } // nobodyUser returns the UID and GID of the "nobody" user. Hardcode its value // for simplicity. const nobodyUser = 65534 // parseMountedFiles returns the maximum UID and GID found in the /etc/passwd and // /etc/group files. func parseMountedFiles(containerMount, passwdFile, groupFile string) uint32 { var ( passwd *os.File group *os.File size int err error ) if passwdFile == "" { passwd, err = secureOpen(containerMount, "/etc/passwd") } else { // User-specified override from a volume. Will not be in // container root. passwd, err = os.Open(passwdFile) } if err == nil { defer passwd.Close() users, err := libcontainerUser.ParsePasswd(passwd) if err == nil { for _, u := range users { // Skip the "nobody" user otherwise we end up with 65536 // ids with most images if u.Name == "nobody" || u.Name == "nogroup" { continue } if u.Uid > size && u.Uid != nobodyUser { size = u.Uid + 1 } if u.Gid > size && u.Gid != nobodyUser { size = u.Gid + 1 } } } } if groupFile == "" { group, err = secureOpen(containerMount, "/etc/group") } else { // User-specified override from a volume. Will not be in // container root. group, err = os.Open(groupFile) } if err == nil { defer group.Close() groups, err := libcontainerUser.ParseGroup(group) if err == nil { for _, g := range groups { if g.Name == "nobody" || g.Name == "nogroup" { continue } if g.Gid > size && g.Gid != nobodyUser { size = g.Gid + 1 } } } } return uint32(size) } // getMaxSizeFromImage returns the maximum ID used by the specified image. // On entry, rlstore must be locked for writing, and lstores must be locked for reading. func (s *store) getMaxSizeFromImage(image *Image, rlstore rwLayerStore, lstores []roLayerStore, passwdFile, groupFile string) (_ uint32, retErr error) { layerStores := append([]roLayerStore{rlstore}, lstores...) size := uint32(0) var topLayer *Layer layerName := image.TopLayer outer: for { for _, ls := range layerStores { layer, err := ls.Get(layerName) if err != nil { continue } if image.TopLayer == layerName { topLayer = layer } for _, uid := range layer.UIDs { if uid >= size { size = uid + 1 } } for _, gid := range layer.GIDs { if gid >= size { size = gid + 1 } } layerName = layer.Parent if layerName == "" { break outer } continue outer } return 0, fmt.Errorf("cannot find layer %q", layerName) } layerOptions := &LayerOptions{ IDMappingOptions: types.IDMappingOptions{ HostUIDMapping: true, HostGIDMapping: true, UIDMap: nil, GIDMap: nil, }, } // We need to create a temporary layer so we can mount it and lookup the // maximum IDs used. clayer, _, err := rlstore.create("", topLayer, nil, "", nil, layerOptions, false, nil) if err != nil { return 0, err } defer func() { if err2 := rlstore.deleteWhileHoldingLock(clayer.ID); err2 != nil { if retErr == nil { retErr = fmt.Errorf("deleting temporary layer %#v: %w", clayer.ID, err2) } else { logrus.Errorf("Error deleting temporary layer %#v: %v", clayer.ID, err2) } } }() mountOptions := drivers.MountOpts{ MountLabel: "", UidMaps: nil, GidMaps: nil, Options: nil, } mountpoint, err := rlstore.Mount(clayer.ID, mountOptions) if err != nil { return 0, err } defer func() { if _, err2 := rlstore.unmount(clayer.ID, true, false); err2 != nil { if retErr == nil { retErr = fmt.Errorf("unmounting temporary layer %#v: %w", clayer.ID, err2) } else { logrus.Errorf("Error unmounting temporary layer %#v: %v", clayer.ID, err2) } } }() userFilesSize := parseMountedFiles(mountpoint, passwdFile, groupFile) if userFilesSize > size { size = userFilesSize } return size, nil } // getAutoUserNS creates an automatic user namespace // If image != nil, On entry, rlstore must be locked for writing, and lstores must be locked for reading. func (s *store) getAutoUserNS(options *types.AutoUserNsOptions, image *Image, rlstore rwLayerStore, lstores []roLayerStore) ([]idtools.IDMap, []idtools.IDMap, error) { requestedSize := uint32(0) initialSize := uint32(1) if options.Size > 0 { requestedSize = options.Size } if options.InitialSize > 0 { initialSize = options.InitialSize } availableUIDs, availableGIDs, err := s.getAvailableIDs() if err != nil { return nil, nil, fmt.Errorf("cannot read mappings: %w", err) } // Look at every container that is using a user namespace and store // the intervals that are already used. containers, err := s.Containers() if err != nil { return nil, nil, err } var usedUIDs, usedGIDs []idtools.IDMap for _, c := range containers { usedUIDs = append(usedUIDs, c.UIDMap...) usedGIDs = append(usedGIDs, c.GIDMap...) } size := requestedSize // If there is no requestedSize, lookup the maximum used IDs in the layers // metadata. Make sure the size is at least s.autoNsMinSize and it is not // bigger than s.autoNsMaxSize. // This is a best effort heuristic. if requestedSize == 0 { size = max(s.autoNsMinSize, initialSize) if image != nil { sizeFromImage, err := s.getMaxSizeFromImage(image, rlstore, lstores, options.PasswdFile, options.GroupFile) if err != nil { return nil, nil, err } if sizeFromImage > size { size = sizeFromImage } } if s.autoNsMaxSize > 0 && size > s.autoNsMaxSize { return nil, nil, fmt.Errorf("the container needs a user namespace with size %v that is bigger than the maximum value allowed with userns=auto %v", size, s.autoNsMaxSize) } } return getAutoUserNSIDMappings( int(size), availableUIDs, availableGIDs, usedUIDs, usedGIDs, options.AdditionalUIDMappings, options.AdditionalGIDMappings, ) } // getAutoUserNSIDMappings computes the user/group id mappings for the automatic user namespace. func getAutoUserNSIDMappings( size int, availableUIDs, availableGIDs *idSet, usedUIDMappings, usedGIDMappings, additionalUIDMappings, additionalGIDMappings []idtools.IDMap, ) ([]idtools.IDMap, []idtools.IDMap, error) { usedUIDs := getHostIDs(append(usedUIDMappings, additionalUIDMappings...)) usedGIDs := getHostIDs(append(usedGIDMappings, additionalGIDMappings...)) // Exclude additional uids and gids from requested range. targetIDs := newIDSet([]interval{{start: 0, end: size}}) requestedContainerUIDs := targetIDs.subtract(getContainerIDs(additionalUIDMappings)) requestedContainerGIDs := targetIDs.subtract(getContainerIDs(additionalGIDMappings)) // Make sure the specified additional IDs are not used as part of the automatic // mapping availableUIDs, err := availableUIDs.subtract(usedUIDs).findAvailable(requestedContainerUIDs.size()) if err != nil { return nil, nil, err } availableGIDs, err = availableGIDs.subtract(usedGIDs).findAvailable(requestedContainerGIDs.size()) if err != nil { return nil, nil, err } uidMap := append(availableUIDs.zip(requestedContainerUIDs), additionalUIDMappings...) gidMap := append(availableGIDs.zip(requestedContainerGIDs), additionalGIDMappings...) return uidMap, gidMap, nil } // Securely open (read-only) a file in a container mount. func secureOpen(containerMount, file string) (*os.File, error) { tmpFile, err := pathrs.OpenInRoot(containerMount, file) if err != nil { return nil, err } defer tmpFile.Close() return pathrs.Reopen(tmpFile, unix.O_RDONLY) } ================================================ FILE: vendor/go.podman.io/storage/userns_unsupported.go ================================================ //go:build !linux package storage import ( "errors" "go.podman.io/storage/pkg/idtools" "go.podman.io/storage/types" ) func (s *store) getAutoUserNS(_ *types.AutoUserNsOptions, _ *Image, _ rwLayerStore, _ []roLayerStore) ([]idtools.IDMap, []idtools.IDMap, error) { return nil, nil, errors.New("user namespaces are not supported on this platform") } ================================================ FILE: vendor/go.podman.io/storage/utils.go ================================================ package storage import ( "fmt" "slices" "go.podman.io/storage/types" ) // ParseIDMapping takes idmappings and subuid and subgid maps and returns a storage mapping func ParseIDMapping(UIDMapSlice, GIDMapSlice []string, subUIDMap, subGIDMap string) (*types.IDMappingOptions, error) { return types.ParseIDMapping(UIDMapSlice, GIDMapSlice, subUIDMap, subGIDMap) } // DefaultStoreOptions returns the default storage options for containers func DefaultStoreOptions() (types.StoreOptions, error) { return types.DefaultStoreOptions() } func validateMountOptions(mountOptions []string) error { var Empty struct{} // Add invalid options for ImageMount() here. invalidOptions := map[string]struct{}{ "rw": Empty, } for _, opt := range mountOptions { if _, ok := invalidOptions[opt]; ok { return fmt.Errorf(" %q option not supported", opt) } } return nil } func applyNameOperation(oldNames []string, opParameters []string, op updateNameOperation) ([]string, error) { var result []string switch op { case setNames: // ignore all old names and just return new names result = opParameters case removeNames: // remove given names from old names result = make([]string, 0, len(oldNames)) for _, name := range oldNames { if !slices.Contains(opParameters, name) { result = append(result, name) } } case addNames: result = slices.Concat(opParameters, oldNames) default: return result, errInvalidUpdateNameOperation } return dedupeStrings(result), nil } ================================================ FILE: vendor/golang.org/x/crypto/LICENSE ================================================ Copyright 2009 The Go Authors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: vendor/golang.org/x/crypto/PATENTS ================================================ Additional IP Rights Grant (Patents) "This implementation" means the copyrightable works distributed by Google as part of the Go project. Google hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, transfer and otherwise run, modify and propagate the contents of this implementation of Go, where such license applies only to those patent claims, both currently owned or controlled by Google and acquired in the future, licensable by Google that are necessarily infringed by this implementation of Go. This grant does not include claims that would be infringed only as a consequence of further modification of this implementation. If you or your agent or exclusive licensee institute or order or agree to the institution of patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that this implementation of Go or any code incorporated within this implementation of Go constitutes direct or contributory patent infringement, or inducement of patent infringement, then any patent rights granted to you under this License for this implementation of Go shall terminate as of the date such litigation is filed. ================================================ FILE: vendor/golang.org/x/crypto/cast5/cast5.go ================================================ // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package cast5 implements CAST5, as defined in RFC 2144. // // CAST5 is a legacy cipher and its short block size makes it vulnerable to // birthday bound attacks (see https://sweet32.info). It should only be used // where compatibility with legacy systems, not security, is the goal. // // Deprecated: any new system should use AES (from crypto/aes, if necessary in // an AEAD mode like crypto/cipher.NewGCM) or XChaCha20-Poly1305 (from // golang.org/x/crypto/chacha20poly1305). package cast5 import ( "errors" "math/bits" ) const BlockSize = 8 const KeySize = 16 type Cipher struct { masking [16]uint32 rotate [16]uint8 } func NewCipher(key []byte) (c *Cipher, err error) { if len(key) != KeySize { return nil, errors.New("CAST5: keys must be 16 bytes") } c = new(Cipher) c.keySchedule(key) return } func (c *Cipher) BlockSize() int { return BlockSize } func (c *Cipher) Encrypt(dst, src []byte) { l := uint32(src[0])<<24 | uint32(src[1])<<16 | uint32(src[2])<<8 | uint32(src[3]) r := uint32(src[4])<<24 | uint32(src[5])<<16 | uint32(src[6])<<8 | uint32(src[7]) l, r = r, l^f1(r, c.masking[0], c.rotate[0]) l, r = r, l^f2(r, c.masking[1], c.rotate[1]) l, r = r, l^f3(r, c.masking[2], c.rotate[2]) l, r = r, l^f1(r, c.masking[3], c.rotate[3]) l, r = r, l^f2(r, c.masking[4], c.rotate[4]) l, r = r, l^f3(r, c.masking[5], c.rotate[5]) l, r = r, l^f1(r, c.masking[6], c.rotate[6]) l, r = r, l^f2(r, c.masking[7], c.rotate[7]) l, r = r, l^f3(r, c.masking[8], c.rotate[8]) l, r = r, l^f1(r, c.masking[9], c.rotate[9]) l, r = r, l^f2(r, c.masking[10], c.rotate[10]) l, r = r, l^f3(r, c.masking[11], c.rotate[11]) l, r = r, l^f1(r, c.masking[12], c.rotate[12]) l, r = r, l^f2(r, c.masking[13], c.rotate[13]) l, r = r, l^f3(r, c.masking[14], c.rotate[14]) l, r = r, l^f1(r, c.masking[15], c.rotate[15]) dst[0] = uint8(r >> 24) dst[1] = uint8(r >> 16) dst[2] = uint8(r >> 8) dst[3] = uint8(r) dst[4] = uint8(l >> 24) dst[5] = uint8(l >> 16) dst[6] = uint8(l >> 8) dst[7] = uint8(l) } func (c *Cipher) Decrypt(dst, src []byte) { l := uint32(src[0])<<24 | uint32(src[1])<<16 | uint32(src[2])<<8 | uint32(src[3]) r := uint32(src[4])<<24 | uint32(src[5])<<16 | uint32(src[6])<<8 | uint32(src[7]) l, r = r, l^f1(r, c.masking[15], c.rotate[15]) l, r = r, l^f3(r, c.masking[14], c.rotate[14]) l, r = r, l^f2(r, c.masking[13], c.rotate[13]) l, r = r, l^f1(r, c.masking[12], c.rotate[12]) l, r = r, l^f3(r, c.masking[11], c.rotate[11]) l, r = r, l^f2(r, c.masking[10], c.rotate[10]) l, r = r, l^f1(r, c.masking[9], c.rotate[9]) l, r = r, l^f3(r, c.masking[8], c.rotate[8]) l, r = r, l^f2(r, c.masking[7], c.rotate[7]) l, r = r, l^f1(r, c.masking[6], c.rotate[6]) l, r = r, l^f3(r, c.masking[5], c.rotate[5]) l, r = r, l^f2(r, c.masking[4], c.rotate[4]) l, r = r, l^f1(r, c.masking[3], c.rotate[3]) l, r = r, l^f3(r, c.masking[2], c.rotate[2]) l, r = r, l^f2(r, c.masking[1], c.rotate[1]) l, r = r, l^f1(r, c.masking[0], c.rotate[0]) dst[0] = uint8(r >> 24) dst[1] = uint8(r >> 16) dst[2] = uint8(r >> 8) dst[3] = uint8(r) dst[4] = uint8(l >> 24) dst[5] = uint8(l >> 16) dst[6] = uint8(l >> 8) dst[7] = uint8(l) } type keyScheduleA [4][7]uint8 type keyScheduleB [4][5]uint8 // keyScheduleRound contains the magic values for a round of the key schedule. // The keyScheduleA deals with the lines like: // z0z1z2z3 = x0x1x2x3 ^ S5[xD] ^ S6[xF] ^ S7[xC] ^ S8[xE] ^ S7[x8] // Conceptually, both x and z are in the same array, x first. The first // element describes which word of this array gets written to and the // second, which word gets read. So, for the line above, it's "4, 0", because // it's writing to the first word of z, which, being after x, is word 4, and // reading from the first word of x: word 0. // // Next are the indexes into the S-boxes. Now the array is treated as bytes. So // "xD" is 0xd. The first byte of z is written as "16 + 0", just to be clear // that it's z that we're indexing. // // keyScheduleB deals with lines like: // K1 = S5[z8] ^ S6[z9] ^ S7[z7] ^ S8[z6] ^ S5[z2] // "K1" is ignored because key words are always written in order. So the five // elements are the S-box indexes. They use the same form as in keyScheduleA, // above. type keyScheduleRound struct{} type keySchedule []keyScheduleRound var schedule = []struct { a keyScheduleA b keyScheduleB }{ { keyScheduleA{ {4, 0, 0xd, 0xf, 0xc, 0xe, 0x8}, {5, 2, 16 + 0, 16 + 2, 16 + 1, 16 + 3, 0xa}, {6, 3, 16 + 7, 16 + 6, 16 + 5, 16 + 4, 9}, {7, 1, 16 + 0xa, 16 + 9, 16 + 0xb, 16 + 8, 0xb}, }, keyScheduleB{ {16 + 8, 16 + 9, 16 + 7, 16 + 6, 16 + 2}, {16 + 0xa, 16 + 0xb, 16 + 5, 16 + 4, 16 + 6}, {16 + 0xc, 16 + 0xd, 16 + 3, 16 + 2, 16 + 9}, {16 + 0xe, 16 + 0xf, 16 + 1, 16 + 0, 16 + 0xc}, }, }, { keyScheduleA{ {0, 6, 16 + 5, 16 + 7, 16 + 4, 16 + 6, 16 + 0}, {1, 4, 0, 2, 1, 3, 16 + 2}, {2, 5, 7, 6, 5, 4, 16 + 1}, {3, 7, 0xa, 9, 0xb, 8, 16 + 3}, }, keyScheduleB{ {3, 2, 0xc, 0xd, 8}, {1, 0, 0xe, 0xf, 0xd}, {7, 6, 8, 9, 3}, {5, 4, 0xa, 0xb, 7}, }, }, { keyScheduleA{ {4, 0, 0xd, 0xf, 0xc, 0xe, 8}, {5, 2, 16 + 0, 16 + 2, 16 + 1, 16 + 3, 0xa}, {6, 3, 16 + 7, 16 + 6, 16 + 5, 16 + 4, 9}, {7, 1, 16 + 0xa, 16 + 9, 16 + 0xb, 16 + 8, 0xb}, }, keyScheduleB{ {16 + 3, 16 + 2, 16 + 0xc, 16 + 0xd, 16 + 9}, {16 + 1, 16 + 0, 16 + 0xe, 16 + 0xf, 16 + 0xc}, {16 + 7, 16 + 6, 16 + 8, 16 + 9, 16 + 2}, {16 + 5, 16 + 4, 16 + 0xa, 16 + 0xb, 16 + 6}, }, }, { keyScheduleA{ {0, 6, 16 + 5, 16 + 7, 16 + 4, 16 + 6, 16 + 0}, {1, 4, 0, 2, 1, 3, 16 + 2}, {2, 5, 7, 6, 5, 4, 16 + 1}, {3, 7, 0xa, 9, 0xb, 8, 16 + 3}, }, keyScheduleB{ {8, 9, 7, 6, 3}, {0xa, 0xb, 5, 4, 7}, {0xc, 0xd, 3, 2, 8}, {0xe, 0xf, 1, 0, 0xd}, }, }, } func (c *Cipher) keySchedule(in []byte) { var t [8]uint32 var k [32]uint32 for i := 0; i < 4; i++ { j := i * 4 t[i] = uint32(in[j])<<24 | uint32(in[j+1])<<16 | uint32(in[j+2])<<8 | uint32(in[j+3]) } x := []byte{6, 7, 4, 5} ki := 0 for half := 0; half < 2; half++ { for _, round := range schedule { for j := 0; j < 4; j++ { var a [7]uint8 copy(a[:], round.a[j][:]) w := t[a[1]] w ^= sBox[4][(t[a[2]>>2]>>(24-8*(a[2]&3)))&0xff] w ^= sBox[5][(t[a[3]>>2]>>(24-8*(a[3]&3)))&0xff] w ^= sBox[6][(t[a[4]>>2]>>(24-8*(a[4]&3)))&0xff] w ^= sBox[7][(t[a[5]>>2]>>(24-8*(a[5]&3)))&0xff] w ^= sBox[x[j]][(t[a[6]>>2]>>(24-8*(a[6]&3)))&0xff] t[a[0]] = w } for j := 0; j < 4; j++ { var b [5]uint8 copy(b[:], round.b[j][:]) w := sBox[4][(t[b[0]>>2]>>(24-8*(b[0]&3)))&0xff] w ^= sBox[5][(t[b[1]>>2]>>(24-8*(b[1]&3)))&0xff] w ^= sBox[6][(t[b[2]>>2]>>(24-8*(b[2]&3)))&0xff] w ^= sBox[7][(t[b[3]>>2]>>(24-8*(b[3]&3)))&0xff] w ^= sBox[4+j][(t[b[4]>>2]>>(24-8*(b[4]&3)))&0xff] k[ki] = w ki++ } } } for i := 0; i < 16; i++ { c.masking[i] = k[i] c.rotate[i] = uint8(k[16+i] & 0x1f) } } // These are the three 'f' functions. See RFC 2144, section 2.2. func f1(d, m uint32, r uint8) uint32 { t := m + d I := bits.RotateLeft32(t, int(r)) return ((sBox[0][I>>24] ^ sBox[1][(I>>16)&0xff]) - sBox[2][(I>>8)&0xff]) + sBox[3][I&0xff] } func f2(d, m uint32, r uint8) uint32 { t := m ^ d I := bits.RotateLeft32(t, int(r)) return ((sBox[0][I>>24] - sBox[1][(I>>16)&0xff]) + sBox[2][(I>>8)&0xff]) ^ sBox[3][I&0xff] } func f3(d, m uint32, r uint8) uint32 { t := m - d I := bits.RotateLeft32(t, int(r)) return ((sBox[0][I>>24] + sBox[1][(I>>16)&0xff]) ^ sBox[2][(I>>8)&0xff]) - sBox[3][I&0xff] } var sBox = [8][256]uint32{ { 0x30fb40d4, 0x9fa0ff0b, 0x6beccd2f, 0x3f258c7a, 0x1e213f2f, 0x9c004dd3, 0x6003e540, 0xcf9fc949, 0xbfd4af27, 0x88bbbdb5, 0xe2034090, 0x98d09675, 0x6e63a0e0, 0x15c361d2, 0xc2e7661d, 0x22d4ff8e, 0x28683b6f, 0xc07fd059, 0xff2379c8, 0x775f50e2, 0x43c340d3, 0xdf2f8656, 0x887ca41a, 0xa2d2bd2d, 0xa1c9e0d6, 0x346c4819, 0x61b76d87, 0x22540f2f, 0x2abe32e1, 0xaa54166b, 0x22568e3a, 0xa2d341d0, 0x66db40c8, 0xa784392f, 0x004dff2f, 0x2db9d2de, 0x97943fac, 0x4a97c1d8, 0x527644b7, 0xb5f437a7, 0xb82cbaef, 0xd751d159, 0x6ff7f0ed, 0x5a097a1f, 0x827b68d0, 0x90ecf52e, 0x22b0c054, 0xbc8e5935, 0x4b6d2f7f, 0x50bb64a2, 0xd2664910, 0xbee5812d, 0xb7332290, 0xe93b159f, 0xb48ee411, 0x4bff345d, 0xfd45c240, 0xad31973f, 0xc4f6d02e, 0x55fc8165, 0xd5b1caad, 0xa1ac2dae, 0xa2d4b76d, 0xc19b0c50, 0x882240f2, 0x0c6e4f38, 0xa4e4bfd7, 0x4f5ba272, 0x564c1d2f, 0xc59c5319, 0xb949e354, 0xb04669fe, 0xb1b6ab8a, 0xc71358dd, 0x6385c545, 0x110f935d, 0x57538ad5, 0x6a390493, 0xe63d37e0, 0x2a54f6b3, 0x3a787d5f, 0x6276a0b5, 0x19a6fcdf, 0x7a42206a, 0x29f9d4d5, 0xf61b1891, 0xbb72275e, 0xaa508167, 0x38901091, 0xc6b505eb, 0x84c7cb8c, 0x2ad75a0f, 0x874a1427, 0xa2d1936b, 0x2ad286af, 0xaa56d291, 0xd7894360, 0x425c750d, 0x93b39e26, 0x187184c9, 0x6c00b32d, 0x73e2bb14, 0xa0bebc3c, 0x54623779, 0x64459eab, 0x3f328b82, 0x7718cf82, 0x59a2cea6, 0x04ee002e, 0x89fe78e6, 0x3fab0950, 0x325ff6c2, 0x81383f05, 0x6963c5c8, 0x76cb5ad6, 0xd49974c9, 0xca180dcf, 0x380782d5, 0xc7fa5cf6, 0x8ac31511, 0x35e79e13, 0x47da91d0, 0xf40f9086, 0xa7e2419e, 0x31366241, 0x051ef495, 0xaa573b04, 0x4a805d8d, 0x548300d0, 0x00322a3c, 0xbf64cddf, 0xba57a68e, 0x75c6372b, 0x50afd341, 0xa7c13275, 0x915a0bf5, 0x6b54bfab, 0x2b0b1426, 0xab4cc9d7, 0x449ccd82, 0xf7fbf265, 0xab85c5f3, 0x1b55db94, 0xaad4e324, 0xcfa4bd3f, 0x2deaa3e2, 0x9e204d02, 0xc8bd25ac, 0xeadf55b3, 0xd5bd9e98, 0xe31231b2, 0x2ad5ad6c, 0x954329de, 0xadbe4528, 0xd8710f69, 0xaa51c90f, 0xaa786bf6, 0x22513f1e, 0xaa51a79b, 0x2ad344cc, 0x7b5a41f0, 0xd37cfbad, 0x1b069505, 0x41ece491, 0xb4c332e6, 0x032268d4, 0xc9600acc, 0xce387e6d, 0xbf6bb16c, 0x6a70fb78, 0x0d03d9c9, 0xd4df39de, 0xe01063da, 0x4736f464, 0x5ad328d8, 0xb347cc96, 0x75bb0fc3, 0x98511bfb, 0x4ffbcc35, 0xb58bcf6a, 0xe11f0abc, 0xbfc5fe4a, 0xa70aec10, 0xac39570a, 0x3f04442f, 0x6188b153, 0xe0397a2e, 0x5727cb79, 0x9ceb418f, 0x1cacd68d, 0x2ad37c96, 0x0175cb9d, 0xc69dff09, 0xc75b65f0, 0xd9db40d8, 0xec0e7779, 0x4744ead4, 0xb11c3274, 0xdd24cb9e, 0x7e1c54bd, 0xf01144f9, 0xd2240eb1, 0x9675b3fd, 0xa3ac3755, 0xd47c27af, 0x51c85f4d, 0x56907596, 0xa5bb15e6, 0x580304f0, 0xca042cf1, 0x011a37ea, 0x8dbfaadb, 0x35ba3e4a, 0x3526ffa0, 0xc37b4d09, 0xbc306ed9, 0x98a52666, 0x5648f725, 0xff5e569d, 0x0ced63d0, 0x7c63b2cf, 0x700b45e1, 0xd5ea50f1, 0x85a92872, 0xaf1fbda7, 0xd4234870, 0xa7870bf3, 0x2d3b4d79, 0x42e04198, 0x0cd0ede7, 0x26470db8, 0xf881814c, 0x474d6ad7, 0x7c0c5e5c, 0xd1231959, 0x381b7298, 0xf5d2f4db, 0xab838653, 0x6e2f1e23, 0x83719c9e, 0xbd91e046, 0x9a56456e, 0xdc39200c, 0x20c8c571, 0x962bda1c, 0xe1e696ff, 0xb141ab08, 0x7cca89b9, 0x1a69e783, 0x02cc4843, 0xa2f7c579, 0x429ef47d, 0x427b169c, 0x5ac9f049, 0xdd8f0f00, 0x5c8165bf, }, { 0x1f201094, 0xef0ba75b, 0x69e3cf7e, 0x393f4380, 0xfe61cf7a, 0xeec5207a, 0x55889c94, 0x72fc0651, 0xada7ef79, 0x4e1d7235, 0xd55a63ce, 0xde0436ba, 0x99c430ef, 0x5f0c0794, 0x18dcdb7d, 0xa1d6eff3, 0xa0b52f7b, 0x59e83605, 0xee15b094, 0xe9ffd909, 0xdc440086, 0xef944459, 0xba83ccb3, 0xe0c3cdfb, 0xd1da4181, 0x3b092ab1, 0xf997f1c1, 0xa5e6cf7b, 0x01420ddb, 0xe4e7ef5b, 0x25a1ff41, 0xe180f806, 0x1fc41080, 0x179bee7a, 0xd37ac6a9, 0xfe5830a4, 0x98de8b7f, 0x77e83f4e, 0x79929269, 0x24fa9f7b, 0xe113c85b, 0xacc40083, 0xd7503525, 0xf7ea615f, 0x62143154, 0x0d554b63, 0x5d681121, 0xc866c359, 0x3d63cf73, 0xcee234c0, 0xd4d87e87, 0x5c672b21, 0x071f6181, 0x39f7627f, 0x361e3084, 0xe4eb573b, 0x602f64a4, 0xd63acd9c, 0x1bbc4635, 0x9e81032d, 0x2701f50c, 0x99847ab4, 0xa0e3df79, 0xba6cf38c, 0x10843094, 0x2537a95e, 0xf46f6ffe, 0xa1ff3b1f, 0x208cfb6a, 0x8f458c74, 0xd9e0a227, 0x4ec73a34, 0xfc884f69, 0x3e4de8df, 0xef0e0088, 0x3559648d, 0x8a45388c, 0x1d804366, 0x721d9bfd, 0xa58684bb, 0xe8256333, 0x844e8212, 0x128d8098, 0xfed33fb4, 0xce280ae1, 0x27e19ba5, 0xd5a6c252, 0xe49754bd, 0xc5d655dd, 0xeb667064, 0x77840b4d, 0xa1b6a801, 0x84db26a9, 0xe0b56714, 0x21f043b7, 0xe5d05860, 0x54f03084, 0x066ff472, 0xa31aa153, 0xdadc4755, 0xb5625dbf, 0x68561be6, 0x83ca6b94, 0x2d6ed23b, 0xeccf01db, 0xa6d3d0ba, 0xb6803d5c, 0xaf77a709, 0x33b4a34c, 0x397bc8d6, 0x5ee22b95, 0x5f0e5304, 0x81ed6f61, 0x20e74364, 0xb45e1378, 0xde18639b, 0x881ca122, 0xb96726d1, 0x8049a7e8, 0x22b7da7b, 0x5e552d25, 0x5272d237, 0x79d2951c, 0xc60d894c, 0x488cb402, 0x1ba4fe5b, 0xa4b09f6b, 0x1ca815cf, 0xa20c3005, 0x8871df63, 0xb9de2fcb, 0x0cc6c9e9, 0x0beeff53, 0xe3214517, 0xb4542835, 0x9f63293c, 0xee41e729, 0x6e1d2d7c, 0x50045286, 0x1e6685f3, 0xf33401c6, 0x30a22c95, 0x31a70850, 0x60930f13, 0x73f98417, 0xa1269859, 0xec645c44, 0x52c877a9, 0xcdff33a6, 0xa02b1741, 0x7cbad9a2, 0x2180036f, 0x50d99c08, 0xcb3f4861, 0xc26bd765, 0x64a3f6ab, 0x80342676, 0x25a75e7b, 0xe4e6d1fc, 0x20c710e6, 0xcdf0b680, 0x17844d3b, 0x31eef84d, 0x7e0824e4, 0x2ccb49eb, 0x846a3bae, 0x8ff77888, 0xee5d60f6, 0x7af75673, 0x2fdd5cdb, 0xa11631c1, 0x30f66f43, 0xb3faec54, 0x157fd7fa, 0xef8579cc, 0xd152de58, 0xdb2ffd5e, 0x8f32ce19, 0x306af97a, 0x02f03ef8, 0x99319ad5, 0xc242fa0f, 0xa7e3ebb0, 0xc68e4906, 0xb8da230c, 0x80823028, 0xdcdef3c8, 0xd35fb171, 0x088a1bc8, 0xbec0c560, 0x61a3c9e8, 0xbca8f54d, 0xc72feffa, 0x22822e99, 0x82c570b4, 0xd8d94e89, 0x8b1c34bc, 0x301e16e6, 0x273be979, 0xb0ffeaa6, 0x61d9b8c6, 0x00b24869, 0xb7ffce3f, 0x08dc283b, 0x43daf65a, 0xf7e19798, 0x7619b72f, 0x8f1c9ba4, 0xdc8637a0, 0x16a7d3b1, 0x9fc393b7, 0xa7136eeb, 0xc6bcc63e, 0x1a513742, 0xef6828bc, 0x520365d6, 0x2d6a77ab, 0x3527ed4b, 0x821fd216, 0x095c6e2e, 0xdb92f2fb, 0x5eea29cb, 0x145892f5, 0x91584f7f, 0x5483697b, 0x2667a8cc, 0x85196048, 0x8c4bacea, 0x833860d4, 0x0d23e0f9, 0x6c387e8a, 0x0ae6d249, 0xb284600c, 0xd835731d, 0xdcb1c647, 0xac4c56ea, 0x3ebd81b3, 0x230eabb0, 0x6438bc87, 0xf0b5b1fa, 0x8f5ea2b3, 0xfc184642, 0x0a036b7a, 0x4fb089bd, 0x649da589, 0xa345415e, 0x5c038323, 0x3e5d3bb9, 0x43d79572, 0x7e6dd07c, 0x06dfdf1e, 0x6c6cc4ef, 0x7160a539, 0x73bfbe70, 0x83877605, 0x4523ecf1, }, { 0x8defc240, 0x25fa5d9f, 0xeb903dbf, 0xe810c907, 0x47607fff, 0x369fe44b, 0x8c1fc644, 0xaececa90, 0xbeb1f9bf, 0xeefbcaea, 0xe8cf1950, 0x51df07ae, 0x920e8806, 0xf0ad0548, 0xe13c8d83, 0x927010d5, 0x11107d9f, 0x07647db9, 0xb2e3e4d4, 0x3d4f285e, 0xb9afa820, 0xfade82e0, 0xa067268b, 0x8272792e, 0x553fb2c0, 0x489ae22b, 0xd4ef9794, 0x125e3fbc, 0x21fffcee, 0x825b1bfd, 0x9255c5ed, 0x1257a240, 0x4e1a8302, 0xbae07fff, 0x528246e7, 0x8e57140e, 0x3373f7bf, 0x8c9f8188, 0xa6fc4ee8, 0xc982b5a5, 0xa8c01db7, 0x579fc264, 0x67094f31, 0xf2bd3f5f, 0x40fff7c1, 0x1fb78dfc, 0x8e6bd2c1, 0x437be59b, 0x99b03dbf, 0xb5dbc64b, 0x638dc0e6, 0x55819d99, 0xa197c81c, 0x4a012d6e, 0xc5884a28, 0xccc36f71, 0xb843c213, 0x6c0743f1, 0x8309893c, 0x0feddd5f, 0x2f7fe850, 0xd7c07f7e, 0x02507fbf, 0x5afb9a04, 0xa747d2d0, 0x1651192e, 0xaf70bf3e, 0x58c31380, 0x5f98302e, 0x727cc3c4, 0x0a0fb402, 0x0f7fef82, 0x8c96fdad, 0x5d2c2aae, 0x8ee99a49, 0x50da88b8, 0x8427f4a0, 0x1eac5790, 0x796fb449, 0x8252dc15, 0xefbd7d9b, 0xa672597d, 0xada840d8, 0x45f54504, 0xfa5d7403, 0xe83ec305, 0x4f91751a, 0x925669c2, 0x23efe941, 0xa903f12e, 0x60270df2, 0x0276e4b6, 0x94fd6574, 0x927985b2, 0x8276dbcb, 0x02778176, 0xf8af918d, 0x4e48f79e, 0x8f616ddf, 0xe29d840e, 0x842f7d83, 0x340ce5c8, 0x96bbb682, 0x93b4b148, 0xef303cab, 0x984faf28, 0x779faf9b, 0x92dc560d, 0x224d1e20, 0x8437aa88, 0x7d29dc96, 0x2756d3dc, 0x8b907cee, 0xb51fd240, 0xe7c07ce3, 0xe566b4a1, 0xc3e9615e, 0x3cf8209d, 0x6094d1e3, 0xcd9ca341, 0x5c76460e, 0x00ea983b, 0xd4d67881, 0xfd47572c, 0xf76cedd9, 0xbda8229c, 0x127dadaa, 0x438a074e, 0x1f97c090, 0x081bdb8a, 0x93a07ebe, 0xb938ca15, 0x97b03cff, 0x3dc2c0f8, 0x8d1ab2ec, 0x64380e51, 0x68cc7bfb, 0xd90f2788, 0x12490181, 0x5de5ffd4, 0xdd7ef86a, 0x76a2e214, 0xb9a40368, 0x925d958f, 0x4b39fffa, 0xba39aee9, 0xa4ffd30b, 0xfaf7933b, 0x6d498623, 0x193cbcfa, 0x27627545, 0x825cf47a, 0x61bd8ba0, 0xd11e42d1, 0xcead04f4, 0x127ea392, 0x10428db7, 0x8272a972, 0x9270c4a8, 0x127de50b, 0x285ba1c8, 0x3c62f44f, 0x35c0eaa5, 0xe805d231, 0x428929fb, 0xb4fcdf82, 0x4fb66a53, 0x0e7dc15b, 0x1f081fab, 0x108618ae, 0xfcfd086d, 0xf9ff2889, 0x694bcc11, 0x236a5cae, 0x12deca4d, 0x2c3f8cc5, 0xd2d02dfe, 0xf8ef5896, 0xe4cf52da, 0x95155b67, 0x494a488c, 0xb9b6a80c, 0x5c8f82bc, 0x89d36b45, 0x3a609437, 0xec00c9a9, 0x44715253, 0x0a874b49, 0xd773bc40, 0x7c34671c, 0x02717ef6, 0x4feb5536, 0xa2d02fff, 0xd2bf60c4, 0xd43f03c0, 0x50b4ef6d, 0x07478cd1, 0x006e1888, 0xa2e53f55, 0xb9e6d4bc, 0xa2048016, 0x97573833, 0xd7207d67, 0xde0f8f3d, 0x72f87b33, 0xabcc4f33, 0x7688c55d, 0x7b00a6b0, 0x947b0001, 0x570075d2, 0xf9bb88f8, 0x8942019e, 0x4264a5ff, 0x856302e0, 0x72dbd92b, 0xee971b69, 0x6ea22fde, 0x5f08ae2b, 0xaf7a616d, 0xe5c98767, 0xcf1febd2, 0x61efc8c2, 0xf1ac2571, 0xcc8239c2, 0x67214cb8, 0xb1e583d1, 0xb7dc3e62, 0x7f10bdce, 0xf90a5c38, 0x0ff0443d, 0x606e6dc6, 0x60543a49, 0x5727c148, 0x2be98a1d, 0x8ab41738, 0x20e1be24, 0xaf96da0f, 0x68458425, 0x99833be5, 0x600d457d, 0x282f9350, 0x8334b362, 0xd91d1120, 0x2b6d8da0, 0x642b1e31, 0x9c305a00, 0x52bce688, 0x1b03588a, 0xf7baefd5, 0x4142ed9c, 0xa4315c11, 0x83323ec5, 0xdfef4636, 0xa133c501, 0xe9d3531c, 0xee353783, }, { 0x9db30420, 0x1fb6e9de, 0xa7be7bef, 0xd273a298, 0x4a4f7bdb, 0x64ad8c57, 0x85510443, 0xfa020ed1, 0x7e287aff, 0xe60fb663, 0x095f35a1, 0x79ebf120, 0xfd059d43, 0x6497b7b1, 0xf3641f63, 0x241e4adf, 0x28147f5f, 0x4fa2b8cd, 0xc9430040, 0x0cc32220, 0xfdd30b30, 0xc0a5374f, 0x1d2d00d9, 0x24147b15, 0xee4d111a, 0x0fca5167, 0x71ff904c, 0x2d195ffe, 0x1a05645f, 0x0c13fefe, 0x081b08ca, 0x05170121, 0x80530100, 0xe83e5efe, 0xac9af4f8, 0x7fe72701, 0xd2b8ee5f, 0x06df4261, 0xbb9e9b8a, 0x7293ea25, 0xce84ffdf, 0xf5718801, 0x3dd64b04, 0xa26f263b, 0x7ed48400, 0x547eebe6, 0x446d4ca0, 0x6cf3d6f5, 0x2649abdf, 0xaea0c7f5, 0x36338cc1, 0x503f7e93, 0xd3772061, 0x11b638e1, 0x72500e03, 0xf80eb2bb, 0xabe0502e, 0xec8d77de, 0x57971e81, 0xe14f6746, 0xc9335400, 0x6920318f, 0x081dbb99, 0xffc304a5, 0x4d351805, 0x7f3d5ce3, 0xa6c866c6, 0x5d5bcca9, 0xdaec6fea, 0x9f926f91, 0x9f46222f, 0x3991467d, 0xa5bf6d8e, 0x1143c44f, 0x43958302, 0xd0214eeb, 0x022083b8, 0x3fb6180c, 0x18f8931e, 0x281658e6, 0x26486e3e, 0x8bd78a70, 0x7477e4c1, 0xb506e07c, 0xf32d0a25, 0x79098b02, 0xe4eabb81, 0x28123b23, 0x69dead38, 0x1574ca16, 0xdf871b62, 0x211c40b7, 0xa51a9ef9, 0x0014377b, 0x041e8ac8, 0x09114003, 0xbd59e4d2, 0xe3d156d5, 0x4fe876d5, 0x2f91a340, 0x557be8de, 0x00eae4a7, 0x0ce5c2ec, 0x4db4bba6, 0xe756bdff, 0xdd3369ac, 0xec17b035, 0x06572327, 0x99afc8b0, 0x56c8c391, 0x6b65811c, 0x5e146119, 0x6e85cb75, 0xbe07c002, 0xc2325577, 0x893ff4ec, 0x5bbfc92d, 0xd0ec3b25, 0xb7801ab7, 0x8d6d3b24, 0x20c763ef, 0xc366a5fc, 0x9c382880, 0x0ace3205, 0xaac9548a, 0xeca1d7c7, 0x041afa32, 0x1d16625a, 0x6701902c, 0x9b757a54, 0x31d477f7, 0x9126b031, 0x36cc6fdb, 0xc70b8b46, 0xd9e66a48, 0x56e55a79, 0x026a4ceb, 0x52437eff, 0x2f8f76b4, 0x0df980a5, 0x8674cde3, 0xedda04eb, 0x17a9be04, 0x2c18f4df, 0xb7747f9d, 0xab2af7b4, 0xefc34d20, 0x2e096b7c, 0x1741a254, 0xe5b6a035, 0x213d42f6, 0x2c1c7c26, 0x61c2f50f, 0x6552daf9, 0xd2c231f8, 0x25130f69, 0xd8167fa2, 0x0418f2c8, 0x001a96a6, 0x0d1526ab, 0x63315c21, 0x5e0a72ec, 0x49bafefd, 0x187908d9, 0x8d0dbd86, 0x311170a7, 0x3e9b640c, 0xcc3e10d7, 0xd5cad3b6, 0x0caec388, 0xf73001e1, 0x6c728aff, 0x71eae2a1, 0x1f9af36e, 0xcfcbd12f, 0xc1de8417, 0xac07be6b, 0xcb44a1d8, 0x8b9b0f56, 0x013988c3, 0xb1c52fca, 0xb4be31cd, 0xd8782806, 0x12a3a4e2, 0x6f7de532, 0x58fd7eb6, 0xd01ee900, 0x24adffc2, 0xf4990fc5, 0x9711aac5, 0x001d7b95, 0x82e5e7d2, 0x109873f6, 0x00613096, 0xc32d9521, 0xada121ff, 0x29908415, 0x7fbb977f, 0xaf9eb3db, 0x29c9ed2a, 0x5ce2a465, 0xa730f32c, 0xd0aa3fe8, 0x8a5cc091, 0xd49e2ce7, 0x0ce454a9, 0xd60acd86, 0x015f1919, 0x77079103, 0xdea03af6, 0x78a8565e, 0xdee356df, 0x21f05cbe, 0x8b75e387, 0xb3c50651, 0xb8a5c3ef, 0xd8eeb6d2, 0xe523be77, 0xc2154529, 0x2f69efdf, 0xafe67afb, 0xf470c4b2, 0xf3e0eb5b, 0xd6cc9876, 0x39e4460c, 0x1fda8538, 0x1987832f, 0xca007367, 0xa99144f8, 0x296b299e, 0x492fc295, 0x9266beab, 0xb5676e69, 0x9bd3ddda, 0xdf7e052f, 0xdb25701c, 0x1b5e51ee, 0xf65324e6, 0x6afce36c, 0x0316cc04, 0x8644213e, 0xb7dc59d0, 0x7965291f, 0xccd6fd43, 0x41823979, 0x932bcdf6, 0xb657c34d, 0x4edfd282, 0x7ae5290c, 0x3cb9536b, 0x851e20fe, 0x9833557e, 0x13ecf0b0, 0xd3ffb372, 0x3f85c5c1, 0x0aef7ed2, }, { 0x7ec90c04, 0x2c6e74b9, 0x9b0e66df, 0xa6337911, 0xb86a7fff, 0x1dd358f5, 0x44dd9d44, 0x1731167f, 0x08fbf1fa, 0xe7f511cc, 0xd2051b00, 0x735aba00, 0x2ab722d8, 0x386381cb, 0xacf6243a, 0x69befd7a, 0xe6a2e77f, 0xf0c720cd, 0xc4494816, 0xccf5c180, 0x38851640, 0x15b0a848, 0xe68b18cb, 0x4caadeff, 0x5f480a01, 0x0412b2aa, 0x259814fc, 0x41d0efe2, 0x4e40b48d, 0x248eb6fb, 0x8dba1cfe, 0x41a99b02, 0x1a550a04, 0xba8f65cb, 0x7251f4e7, 0x95a51725, 0xc106ecd7, 0x97a5980a, 0xc539b9aa, 0x4d79fe6a, 0xf2f3f763, 0x68af8040, 0xed0c9e56, 0x11b4958b, 0xe1eb5a88, 0x8709e6b0, 0xd7e07156, 0x4e29fea7, 0x6366e52d, 0x02d1c000, 0xc4ac8e05, 0x9377f571, 0x0c05372a, 0x578535f2, 0x2261be02, 0xd642a0c9, 0xdf13a280, 0x74b55bd2, 0x682199c0, 0xd421e5ec, 0x53fb3ce8, 0xc8adedb3, 0x28a87fc9, 0x3d959981, 0x5c1ff900, 0xfe38d399, 0x0c4eff0b, 0x062407ea, 0xaa2f4fb1, 0x4fb96976, 0x90c79505, 0xb0a8a774, 0xef55a1ff, 0xe59ca2c2, 0xa6b62d27, 0xe66a4263, 0xdf65001f, 0x0ec50966, 0xdfdd55bc, 0x29de0655, 0x911e739a, 0x17af8975, 0x32c7911c, 0x89f89468, 0x0d01e980, 0x524755f4, 0x03b63cc9, 0x0cc844b2, 0xbcf3f0aa, 0x87ac36e9, 0xe53a7426, 0x01b3d82b, 0x1a9e7449, 0x64ee2d7e, 0xcddbb1da, 0x01c94910, 0xb868bf80, 0x0d26f3fd, 0x9342ede7, 0x04a5c284, 0x636737b6, 0x50f5b616, 0xf24766e3, 0x8eca36c1, 0x136e05db, 0xfef18391, 0xfb887a37, 0xd6e7f7d4, 0xc7fb7dc9, 0x3063fcdf, 0xb6f589de, 0xec2941da, 0x26e46695, 0xb7566419, 0xf654efc5, 0xd08d58b7, 0x48925401, 0xc1bacb7f, 0xe5ff550f, 0xb6083049, 0x5bb5d0e8, 0x87d72e5a, 0xab6a6ee1, 0x223a66ce, 0xc62bf3cd, 0x9e0885f9, 0x68cb3e47, 0x086c010f, 0xa21de820, 0xd18b69de, 0xf3f65777, 0xfa02c3f6, 0x407edac3, 0xcbb3d550, 0x1793084d, 0xb0d70eba, 0x0ab378d5, 0xd951fb0c, 0xded7da56, 0x4124bbe4, 0x94ca0b56, 0x0f5755d1, 0xe0e1e56e, 0x6184b5be, 0x580a249f, 0x94f74bc0, 0xe327888e, 0x9f7b5561, 0xc3dc0280, 0x05687715, 0x646c6bd7, 0x44904db3, 0x66b4f0a3, 0xc0f1648a, 0x697ed5af, 0x49e92ff6, 0x309e374f, 0x2cb6356a, 0x85808573, 0x4991f840, 0x76f0ae02, 0x083be84d, 0x28421c9a, 0x44489406, 0x736e4cb8, 0xc1092910, 0x8bc95fc6, 0x7d869cf4, 0x134f616f, 0x2e77118d, 0xb31b2be1, 0xaa90b472, 0x3ca5d717, 0x7d161bba, 0x9cad9010, 0xaf462ba2, 0x9fe459d2, 0x45d34559, 0xd9f2da13, 0xdbc65487, 0xf3e4f94e, 0x176d486f, 0x097c13ea, 0x631da5c7, 0x445f7382, 0x175683f4, 0xcdc66a97, 0x70be0288, 0xb3cdcf72, 0x6e5dd2f3, 0x20936079, 0x459b80a5, 0xbe60e2db, 0xa9c23101, 0xeba5315c, 0x224e42f2, 0x1c5c1572, 0xf6721b2c, 0x1ad2fff3, 0x8c25404e, 0x324ed72f, 0x4067b7fd, 0x0523138e, 0x5ca3bc78, 0xdc0fd66e, 0x75922283, 0x784d6b17, 0x58ebb16e, 0x44094f85, 0x3f481d87, 0xfcfeae7b, 0x77b5ff76, 0x8c2302bf, 0xaaf47556, 0x5f46b02a, 0x2b092801, 0x3d38f5f7, 0x0ca81f36, 0x52af4a8a, 0x66d5e7c0, 0xdf3b0874, 0x95055110, 0x1b5ad7a8, 0xf61ed5ad, 0x6cf6e479, 0x20758184, 0xd0cefa65, 0x88f7be58, 0x4a046826, 0x0ff6f8f3, 0xa09c7f70, 0x5346aba0, 0x5ce96c28, 0xe176eda3, 0x6bac307f, 0x376829d2, 0x85360fa9, 0x17e3fe2a, 0x24b79767, 0xf5a96b20, 0xd6cd2595, 0x68ff1ebf, 0x7555442c, 0xf19f06be, 0xf9e0659a, 0xeeb9491d, 0x34010718, 0xbb30cab8, 0xe822fe15, 0x88570983, 0x750e6249, 0xda627e55, 0x5e76ffa8, 0xb1534546, 0x6d47de08, 0xefe9e7d4, }, { 0xf6fa8f9d, 0x2cac6ce1, 0x4ca34867, 0xe2337f7c, 0x95db08e7, 0x016843b4, 0xeced5cbc, 0x325553ac, 0xbf9f0960, 0xdfa1e2ed, 0x83f0579d, 0x63ed86b9, 0x1ab6a6b8, 0xde5ebe39, 0xf38ff732, 0x8989b138, 0x33f14961, 0xc01937bd, 0xf506c6da, 0xe4625e7e, 0xa308ea99, 0x4e23e33c, 0x79cbd7cc, 0x48a14367, 0xa3149619, 0xfec94bd5, 0xa114174a, 0xeaa01866, 0xa084db2d, 0x09a8486f, 0xa888614a, 0x2900af98, 0x01665991, 0xe1992863, 0xc8f30c60, 0x2e78ef3c, 0xd0d51932, 0xcf0fec14, 0xf7ca07d2, 0xd0a82072, 0xfd41197e, 0x9305a6b0, 0xe86be3da, 0x74bed3cd, 0x372da53c, 0x4c7f4448, 0xdab5d440, 0x6dba0ec3, 0x083919a7, 0x9fbaeed9, 0x49dbcfb0, 0x4e670c53, 0x5c3d9c01, 0x64bdb941, 0x2c0e636a, 0xba7dd9cd, 0xea6f7388, 0xe70bc762, 0x35f29adb, 0x5c4cdd8d, 0xf0d48d8c, 0xb88153e2, 0x08a19866, 0x1ae2eac8, 0x284caf89, 0xaa928223, 0x9334be53, 0x3b3a21bf, 0x16434be3, 0x9aea3906, 0xefe8c36e, 0xf890cdd9, 0x80226dae, 0xc340a4a3, 0xdf7e9c09, 0xa694a807, 0x5b7c5ecc, 0x221db3a6, 0x9a69a02f, 0x68818a54, 0xceb2296f, 0x53c0843a, 0xfe893655, 0x25bfe68a, 0xb4628abc, 0xcf222ebf, 0x25ac6f48, 0xa9a99387, 0x53bddb65, 0xe76ffbe7, 0xe967fd78, 0x0ba93563, 0x8e342bc1, 0xe8a11be9, 0x4980740d, 0xc8087dfc, 0x8de4bf99, 0xa11101a0, 0x7fd37975, 0xda5a26c0, 0xe81f994f, 0x9528cd89, 0xfd339fed, 0xb87834bf, 0x5f04456d, 0x22258698, 0xc9c4c83b, 0x2dc156be, 0x4f628daa, 0x57f55ec5, 0xe2220abe, 0xd2916ebf, 0x4ec75b95, 0x24f2c3c0, 0x42d15d99, 0xcd0d7fa0, 0x7b6e27ff, 0xa8dc8af0, 0x7345c106, 0xf41e232f, 0x35162386, 0xe6ea8926, 0x3333b094, 0x157ec6f2, 0x372b74af, 0x692573e4, 0xe9a9d848, 0xf3160289, 0x3a62ef1d, 0xa787e238, 0xf3a5f676, 0x74364853, 0x20951063, 0x4576698d, 0xb6fad407, 0x592af950, 0x36f73523, 0x4cfb6e87, 0x7da4cec0, 0x6c152daa, 0xcb0396a8, 0xc50dfe5d, 0xfcd707ab, 0x0921c42f, 0x89dff0bb, 0x5fe2be78, 0x448f4f33, 0x754613c9, 0x2b05d08d, 0x48b9d585, 0xdc049441, 0xc8098f9b, 0x7dede786, 0xc39a3373, 0x42410005, 0x6a091751, 0x0ef3c8a6, 0x890072d6, 0x28207682, 0xa9a9f7be, 0xbf32679d, 0xd45b5b75, 0xb353fd00, 0xcbb0e358, 0x830f220a, 0x1f8fb214, 0xd372cf08, 0xcc3c4a13, 0x8cf63166, 0x061c87be, 0x88c98f88, 0x6062e397, 0x47cf8e7a, 0xb6c85283, 0x3cc2acfb, 0x3fc06976, 0x4e8f0252, 0x64d8314d, 0xda3870e3, 0x1e665459, 0xc10908f0, 0x513021a5, 0x6c5b68b7, 0x822f8aa0, 0x3007cd3e, 0x74719eef, 0xdc872681, 0x073340d4, 0x7e432fd9, 0x0c5ec241, 0x8809286c, 0xf592d891, 0x08a930f6, 0x957ef305, 0xb7fbffbd, 0xc266e96f, 0x6fe4ac98, 0xb173ecc0, 0xbc60b42a, 0x953498da, 0xfba1ae12, 0x2d4bd736, 0x0f25faab, 0xa4f3fceb, 0xe2969123, 0x257f0c3d, 0x9348af49, 0x361400bc, 0xe8816f4a, 0x3814f200, 0xa3f94043, 0x9c7a54c2, 0xbc704f57, 0xda41e7f9, 0xc25ad33a, 0x54f4a084, 0xb17f5505, 0x59357cbe, 0xedbd15c8, 0x7f97c5ab, 0xba5ac7b5, 0xb6f6deaf, 0x3a479c3a, 0x5302da25, 0x653d7e6a, 0x54268d49, 0x51a477ea, 0x5017d55b, 0xd7d25d88, 0x44136c76, 0x0404a8c8, 0xb8e5a121, 0xb81a928a, 0x60ed5869, 0x97c55b96, 0xeaec991b, 0x29935913, 0x01fdb7f1, 0x088e8dfa, 0x9ab6f6f5, 0x3b4cbf9f, 0x4a5de3ab, 0xe6051d35, 0xa0e1d855, 0xd36b4cf1, 0xf544edeb, 0xb0e93524, 0xbebb8fbd, 0xa2d762cf, 0x49c92f54, 0x38b5f331, 0x7128a454, 0x48392905, 0xa65b1db8, 0x851c97bd, 0xd675cf2f, }, { 0x85e04019, 0x332bf567, 0x662dbfff, 0xcfc65693, 0x2a8d7f6f, 0xab9bc912, 0xde6008a1, 0x2028da1f, 0x0227bce7, 0x4d642916, 0x18fac300, 0x50f18b82, 0x2cb2cb11, 0xb232e75c, 0x4b3695f2, 0xb28707de, 0xa05fbcf6, 0xcd4181e9, 0xe150210c, 0xe24ef1bd, 0xb168c381, 0xfde4e789, 0x5c79b0d8, 0x1e8bfd43, 0x4d495001, 0x38be4341, 0x913cee1d, 0x92a79c3f, 0x089766be, 0xbaeeadf4, 0x1286becf, 0xb6eacb19, 0x2660c200, 0x7565bde4, 0x64241f7a, 0x8248dca9, 0xc3b3ad66, 0x28136086, 0x0bd8dfa8, 0x356d1cf2, 0x107789be, 0xb3b2e9ce, 0x0502aa8f, 0x0bc0351e, 0x166bf52a, 0xeb12ff82, 0xe3486911, 0xd34d7516, 0x4e7b3aff, 0x5f43671b, 0x9cf6e037, 0x4981ac83, 0x334266ce, 0x8c9341b7, 0xd0d854c0, 0xcb3a6c88, 0x47bc2829, 0x4725ba37, 0xa66ad22b, 0x7ad61f1e, 0x0c5cbafa, 0x4437f107, 0xb6e79962, 0x42d2d816, 0x0a961288, 0xe1a5c06e, 0x13749e67, 0x72fc081a, 0xb1d139f7, 0xf9583745, 0xcf19df58, 0xbec3f756, 0xc06eba30, 0x07211b24, 0x45c28829, 0xc95e317f, 0xbc8ec511, 0x38bc46e9, 0xc6e6fa14, 0xbae8584a, 0xad4ebc46, 0x468f508b, 0x7829435f, 0xf124183b, 0x821dba9f, 0xaff60ff4, 0xea2c4e6d, 0x16e39264, 0x92544a8b, 0x009b4fc3, 0xaba68ced, 0x9ac96f78, 0x06a5b79a, 0xb2856e6e, 0x1aec3ca9, 0xbe838688, 0x0e0804e9, 0x55f1be56, 0xe7e5363b, 0xb3a1f25d, 0xf7debb85, 0x61fe033c, 0x16746233, 0x3c034c28, 0xda6d0c74, 0x79aac56c, 0x3ce4e1ad, 0x51f0c802, 0x98f8f35a, 0x1626a49f, 0xeed82b29, 0x1d382fe3, 0x0c4fb99a, 0xbb325778, 0x3ec6d97b, 0x6e77a6a9, 0xcb658b5c, 0xd45230c7, 0x2bd1408b, 0x60c03eb7, 0xb9068d78, 0xa33754f4, 0xf430c87d, 0xc8a71302, 0xb96d8c32, 0xebd4e7be, 0xbe8b9d2d, 0x7979fb06, 0xe7225308, 0x8b75cf77, 0x11ef8da4, 0xe083c858, 0x8d6b786f, 0x5a6317a6, 0xfa5cf7a0, 0x5dda0033, 0xf28ebfb0, 0xf5b9c310, 0xa0eac280, 0x08b9767a, 0xa3d9d2b0, 0x79d34217, 0x021a718d, 0x9ac6336a, 0x2711fd60, 0x438050e3, 0x069908a8, 0x3d7fedc4, 0x826d2bef, 0x4eeb8476, 0x488dcf25, 0x36c9d566, 0x28e74e41, 0xc2610aca, 0x3d49a9cf, 0xbae3b9df, 0xb65f8de6, 0x92aeaf64, 0x3ac7d5e6, 0x9ea80509, 0xf22b017d, 0xa4173f70, 0xdd1e16c3, 0x15e0d7f9, 0x50b1b887, 0x2b9f4fd5, 0x625aba82, 0x6a017962, 0x2ec01b9c, 0x15488aa9, 0xd716e740, 0x40055a2c, 0x93d29a22, 0xe32dbf9a, 0x058745b9, 0x3453dc1e, 0xd699296e, 0x496cff6f, 0x1c9f4986, 0xdfe2ed07, 0xb87242d1, 0x19de7eae, 0x053e561a, 0x15ad6f8c, 0x66626c1c, 0x7154c24c, 0xea082b2a, 0x93eb2939, 0x17dcb0f0, 0x58d4f2ae, 0x9ea294fb, 0x52cf564c, 0x9883fe66, 0x2ec40581, 0x763953c3, 0x01d6692e, 0xd3a0c108, 0xa1e7160e, 0xe4f2dfa6, 0x693ed285, 0x74904698, 0x4c2b0edd, 0x4f757656, 0x5d393378, 0xa132234f, 0x3d321c5d, 0xc3f5e194, 0x4b269301, 0xc79f022f, 0x3c997e7e, 0x5e4f9504, 0x3ffafbbd, 0x76f7ad0e, 0x296693f4, 0x3d1fce6f, 0xc61e45be, 0xd3b5ab34, 0xf72bf9b7, 0x1b0434c0, 0x4e72b567, 0x5592a33d, 0xb5229301, 0xcfd2a87f, 0x60aeb767, 0x1814386b, 0x30bcc33d, 0x38a0c07d, 0xfd1606f2, 0xc363519b, 0x589dd390, 0x5479f8e6, 0x1cb8d647, 0x97fd61a9, 0xea7759f4, 0x2d57539d, 0x569a58cf, 0xe84e63ad, 0x462e1b78, 0x6580f87e, 0xf3817914, 0x91da55f4, 0x40a230f3, 0xd1988f35, 0xb6e318d2, 0x3ffa50bc, 0x3d40f021, 0xc3c0bdae, 0x4958c24c, 0x518f36b2, 0x84b1d370, 0x0fedce83, 0x878ddada, 0xf2a279c7, 0x94e01be8, 0x90716f4b, 0x954b8aa3, }, { 0xe216300d, 0xbbddfffc, 0xa7ebdabd, 0x35648095, 0x7789f8b7, 0xe6c1121b, 0x0e241600, 0x052ce8b5, 0x11a9cfb0, 0xe5952f11, 0xece7990a, 0x9386d174, 0x2a42931c, 0x76e38111, 0xb12def3a, 0x37ddddfc, 0xde9adeb1, 0x0a0cc32c, 0xbe197029, 0x84a00940, 0xbb243a0f, 0xb4d137cf, 0xb44e79f0, 0x049eedfd, 0x0b15a15d, 0x480d3168, 0x8bbbde5a, 0x669ded42, 0xc7ece831, 0x3f8f95e7, 0x72df191b, 0x7580330d, 0x94074251, 0x5c7dcdfa, 0xabbe6d63, 0xaa402164, 0xb301d40a, 0x02e7d1ca, 0x53571dae, 0x7a3182a2, 0x12a8ddec, 0xfdaa335d, 0x176f43e8, 0x71fb46d4, 0x38129022, 0xce949ad4, 0xb84769ad, 0x965bd862, 0x82f3d055, 0x66fb9767, 0x15b80b4e, 0x1d5b47a0, 0x4cfde06f, 0xc28ec4b8, 0x57e8726e, 0x647a78fc, 0x99865d44, 0x608bd593, 0x6c200e03, 0x39dc5ff6, 0x5d0b00a3, 0xae63aff2, 0x7e8bd632, 0x70108c0c, 0xbbd35049, 0x2998df04, 0x980cf42a, 0x9b6df491, 0x9e7edd53, 0x06918548, 0x58cb7e07, 0x3b74ef2e, 0x522fffb1, 0xd24708cc, 0x1c7e27cd, 0xa4eb215b, 0x3cf1d2e2, 0x19b47a38, 0x424f7618, 0x35856039, 0x9d17dee7, 0x27eb35e6, 0xc9aff67b, 0x36baf5b8, 0x09c467cd, 0xc18910b1, 0xe11dbf7b, 0x06cd1af8, 0x7170c608, 0x2d5e3354, 0xd4de495a, 0x64c6d006, 0xbcc0c62c, 0x3dd00db3, 0x708f8f34, 0x77d51b42, 0x264f620f, 0x24b8d2bf, 0x15c1b79e, 0x46a52564, 0xf8d7e54e, 0x3e378160, 0x7895cda5, 0x859c15a5, 0xe6459788, 0xc37bc75f, 0xdb07ba0c, 0x0676a3ab, 0x7f229b1e, 0x31842e7b, 0x24259fd7, 0xf8bef472, 0x835ffcb8, 0x6df4c1f2, 0x96f5b195, 0xfd0af0fc, 0xb0fe134c, 0xe2506d3d, 0x4f9b12ea, 0xf215f225, 0xa223736f, 0x9fb4c428, 0x25d04979, 0x34c713f8, 0xc4618187, 0xea7a6e98, 0x7cd16efc, 0x1436876c, 0xf1544107, 0xbedeee14, 0x56e9af27, 0xa04aa441, 0x3cf7c899, 0x92ecbae6, 0xdd67016d, 0x151682eb, 0xa842eedf, 0xfdba60b4, 0xf1907b75, 0x20e3030f, 0x24d8c29e, 0xe139673b, 0xefa63fb8, 0x71873054, 0xb6f2cf3b, 0x9f326442, 0xcb15a4cc, 0xb01a4504, 0xf1e47d8d, 0x844a1be5, 0xbae7dfdc, 0x42cbda70, 0xcd7dae0a, 0x57e85b7a, 0xd53f5af6, 0x20cf4d8c, 0xcea4d428, 0x79d130a4, 0x3486ebfb, 0x33d3cddc, 0x77853b53, 0x37effcb5, 0xc5068778, 0xe580b3e6, 0x4e68b8f4, 0xc5c8b37e, 0x0d809ea2, 0x398feb7c, 0x132a4f94, 0x43b7950e, 0x2fee7d1c, 0x223613bd, 0xdd06caa2, 0x37df932b, 0xc4248289, 0xacf3ebc3, 0x5715f6b7, 0xef3478dd, 0xf267616f, 0xc148cbe4, 0x9052815e, 0x5e410fab, 0xb48a2465, 0x2eda7fa4, 0xe87b40e4, 0xe98ea084, 0x5889e9e1, 0xefd390fc, 0xdd07d35b, 0xdb485694, 0x38d7e5b2, 0x57720101, 0x730edebc, 0x5b643113, 0x94917e4f, 0x503c2fba, 0x646f1282, 0x7523d24a, 0xe0779695, 0xf9c17a8f, 0x7a5b2121, 0xd187b896, 0x29263a4d, 0xba510cdf, 0x81f47c9f, 0xad1163ed, 0xea7b5965, 0x1a00726e, 0x11403092, 0x00da6d77, 0x4a0cdd61, 0xad1f4603, 0x605bdfb0, 0x9eedc364, 0x22ebe6a8, 0xcee7d28a, 0xa0e736a0, 0x5564a6b9, 0x10853209, 0xc7eb8f37, 0x2de705ca, 0x8951570f, 0xdf09822b, 0xbd691a6c, 0xaa12e4f2, 0x87451c0f, 0xe0f6a27a, 0x3ada4819, 0x4cf1764f, 0x0d771c2b, 0x67cdb156, 0x350d8384, 0x5938fa0f, 0x42399ef3, 0x36997b07, 0x0e84093d, 0x4aa93e61, 0x8360d87b, 0x1fa98b0c, 0x1149382c, 0xe97625a5, 0x0614d1b7, 0x0e25244b, 0x0c768347, 0x589e8d82, 0x0d2059d1, 0xa466bb1e, 0xf8da0a82, 0x04f19130, 0xba6e4ec0, 0x99265164, 0x1ee7230d, 0x50b2ad80, 0xeaee6801, 0x8db2a283, 0xea8bf59e, }, } ================================================ FILE: vendor/golang.org/x/crypto/cryptobyte/asn1/asn1.go ================================================ // Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package asn1 contains supporting types for parsing and building ASN.1 // messages with the cryptobyte package. package asn1 // Tag represents an ASN.1 identifier octet, consisting of a tag number // (indicating a type) and class (such as context-specific or constructed). // // Methods in the cryptobyte package only support the low-tag-number form, i.e. // a single identifier octet with bits 7-8 encoding the class and bits 1-6 // encoding the tag number. type Tag uint8 const ( classConstructed = 0x20 classContextSpecific = 0x80 ) // Constructed returns t with the constructed class bit set. func (t Tag) Constructed() Tag { return t | classConstructed } // ContextSpecific returns t with the context-specific class bit set. func (t Tag) ContextSpecific() Tag { return t | classContextSpecific } // The following is a list of standard tag and class combinations. const ( BOOLEAN = Tag(1) INTEGER = Tag(2) BIT_STRING = Tag(3) OCTET_STRING = Tag(4) NULL = Tag(5) OBJECT_IDENTIFIER = Tag(6) ENUM = Tag(10) UTF8String = Tag(12) SEQUENCE = Tag(16 | classConstructed) SET = Tag(17 | classConstructed) PrintableString = Tag(19) T61String = Tag(20) IA5String = Tag(22) UTCTime = Tag(23) GeneralizedTime = Tag(24) GeneralString = Tag(27) ) ================================================ FILE: vendor/golang.org/x/crypto/cryptobyte/asn1.go ================================================ // Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cryptobyte import ( encoding_asn1 "encoding/asn1" "fmt" "math/big" "reflect" "time" "golang.org/x/crypto/cryptobyte/asn1" ) // This file contains ASN.1-related methods for String and Builder. // Builder // AddASN1Int64 appends a DER-encoded ASN.1 INTEGER. func (b *Builder) AddASN1Int64(v int64) { b.addASN1Signed(asn1.INTEGER, v) } // AddASN1Int64WithTag appends a DER-encoded ASN.1 INTEGER with the // given tag. func (b *Builder) AddASN1Int64WithTag(v int64, tag asn1.Tag) { b.addASN1Signed(tag, v) } // AddASN1Enum appends a DER-encoded ASN.1 ENUMERATION. func (b *Builder) AddASN1Enum(v int64) { b.addASN1Signed(asn1.ENUM, v) } func (b *Builder) addASN1Signed(tag asn1.Tag, v int64) { b.AddASN1(tag, func(c *Builder) { length := 1 for i := v; i >= 0x80 || i < -0x80; i >>= 8 { length++ } for ; length > 0; length-- { i := v >> uint((length-1)*8) & 0xff c.AddUint8(uint8(i)) } }) } // AddASN1Uint64 appends a DER-encoded ASN.1 INTEGER. func (b *Builder) AddASN1Uint64(v uint64) { b.AddASN1(asn1.INTEGER, func(c *Builder) { length := 1 for i := v; i >= 0x80; i >>= 8 { length++ } for ; length > 0; length-- { i := v >> uint((length-1)*8) & 0xff c.AddUint8(uint8(i)) } }) } // AddASN1BigInt appends a DER-encoded ASN.1 INTEGER. func (b *Builder) AddASN1BigInt(n *big.Int) { if b.err != nil { return } b.AddASN1(asn1.INTEGER, func(c *Builder) { if n.Sign() < 0 { // A negative number has to be converted to two's-complement form. So we // invert and subtract 1. If the most-significant-bit isn't set then // we'll need to pad the beginning with 0xff in order to keep the number // negative. nMinus1 := new(big.Int).Neg(n) nMinus1.Sub(nMinus1, bigOne) bytes := nMinus1.Bytes() for i := range bytes { bytes[i] ^= 0xff } if len(bytes) == 0 || bytes[0]&0x80 == 0 { c.add(0xff) } c.add(bytes...) } else if n.Sign() == 0 { c.add(0) } else { bytes := n.Bytes() if bytes[0]&0x80 != 0 { c.add(0) } c.add(bytes...) } }) } // AddASN1OctetString appends a DER-encoded ASN.1 OCTET STRING. func (b *Builder) AddASN1OctetString(bytes []byte) { b.AddASN1(asn1.OCTET_STRING, func(c *Builder) { c.AddBytes(bytes) }) } const generalizedTimeFormatStr = "20060102150405Z0700" // AddASN1GeneralizedTime appends a DER-encoded ASN.1 GENERALIZEDTIME. func (b *Builder) AddASN1GeneralizedTime(t time.Time) { if t.Year() < 0 || t.Year() > 9999 { b.err = fmt.Errorf("cryptobyte: cannot represent %v as a GeneralizedTime", t) return } b.AddASN1(asn1.GeneralizedTime, func(c *Builder) { c.AddBytes([]byte(t.Format(generalizedTimeFormatStr))) }) } // AddASN1UTCTime appends a DER-encoded ASN.1 UTCTime. func (b *Builder) AddASN1UTCTime(t time.Time) { b.AddASN1(asn1.UTCTime, func(c *Builder) { // As utilized by the X.509 profile, UTCTime can only // represent the years 1950 through 2049. if t.Year() < 1950 || t.Year() >= 2050 { b.err = fmt.Errorf("cryptobyte: cannot represent %v as a UTCTime", t) return } c.AddBytes([]byte(t.Format(defaultUTCTimeFormatStr))) }) } // AddASN1BitString appends a DER-encoded ASN.1 BIT STRING. This does not // support BIT STRINGs that are not a whole number of bytes. func (b *Builder) AddASN1BitString(data []byte) { b.AddASN1(asn1.BIT_STRING, func(b *Builder) { b.AddUint8(0) b.AddBytes(data) }) } func (b *Builder) addBase128Int(n int64) { var length int if n == 0 { length = 1 } else { for i := n; i > 0; i >>= 7 { length++ } } for i := length - 1; i >= 0; i-- { o := byte(n >> uint(i*7)) o &= 0x7f if i != 0 { o |= 0x80 } b.add(o) } } func isValidOID(oid encoding_asn1.ObjectIdentifier) bool { if len(oid) < 2 { return false } if oid[0] > 2 || (oid[0] <= 1 && oid[1] >= 40) { return false } for _, v := range oid { if v < 0 { return false } } return true } func (b *Builder) AddASN1ObjectIdentifier(oid encoding_asn1.ObjectIdentifier) { b.AddASN1(asn1.OBJECT_IDENTIFIER, func(b *Builder) { if !isValidOID(oid) { b.err = fmt.Errorf("cryptobyte: invalid OID: %v", oid) return } b.addBase128Int(int64(oid[0])*40 + int64(oid[1])) for _, v := range oid[2:] { b.addBase128Int(int64(v)) } }) } func (b *Builder) AddASN1Boolean(v bool) { b.AddASN1(asn1.BOOLEAN, func(b *Builder) { if v { b.AddUint8(0xff) } else { b.AddUint8(0) } }) } func (b *Builder) AddASN1NULL() { b.add(uint8(asn1.NULL), 0) } // MarshalASN1 calls encoding_asn1.Marshal on its input and appends the result if // successful or records an error if one occurred. func (b *Builder) MarshalASN1(v interface{}) { // NOTE(martinkr): This is somewhat of a hack to allow propagation of // encoding_asn1.Marshal errors into Builder.err. N.B. if you call MarshalASN1 with a // value embedded into a struct, its tag information is lost. if b.err != nil { return } bytes, err := encoding_asn1.Marshal(v) if err != nil { b.err = err return } b.AddBytes(bytes) } // AddASN1 appends an ASN.1 object. The object is prefixed with the given tag. // Tags greater than 30 are not supported and result in an error (i.e. // low-tag-number form only). The child builder passed to the // BuilderContinuation can be used to build the content of the ASN.1 object. func (b *Builder) AddASN1(tag asn1.Tag, f BuilderContinuation) { if b.err != nil { return } // Identifiers with the low five bits set indicate high-tag-number format // (two or more octets), which we don't support. if tag&0x1f == 0x1f { b.err = fmt.Errorf("cryptobyte: high-tag number identifier octets not supported: 0x%x", tag) return } b.AddUint8(uint8(tag)) b.addLengthPrefixed(1, true, f) } // String // ReadASN1Boolean decodes an ASN.1 BOOLEAN and converts it to a boolean // representation into out and advances. It reports whether the read // was successful. func (s *String) ReadASN1Boolean(out *bool) bool { var bytes String if !s.ReadASN1(&bytes, asn1.BOOLEAN) || len(bytes) != 1 { return false } switch bytes[0] { case 0: *out = false case 0xff: *out = true default: return false } return true } // ReadASN1Integer decodes an ASN.1 INTEGER into out and advances. If out does // not point to an integer, to a big.Int, or to a []byte it panics. Only // positive and zero values can be decoded into []byte, and they are returned as // big-endian binary values that share memory with s. Positive values will have // no leading zeroes, and zero will be returned as a single zero byte. // ReadASN1Integer reports whether the read was successful. func (s *String) ReadASN1Integer(out interface{}) bool { switch out := out.(type) { case *int, *int8, *int16, *int32, *int64: var i int64 if !s.readASN1Int64(&i) || reflect.ValueOf(out).Elem().OverflowInt(i) { return false } reflect.ValueOf(out).Elem().SetInt(i) return true case *uint, *uint8, *uint16, *uint32, *uint64: var u uint64 if !s.readASN1Uint64(&u) || reflect.ValueOf(out).Elem().OverflowUint(u) { return false } reflect.ValueOf(out).Elem().SetUint(u) return true case *big.Int: return s.readASN1BigInt(out) case *[]byte: return s.readASN1Bytes(out) default: panic("out does not point to an integer type") } } func checkASN1Integer(bytes []byte) bool { if len(bytes) == 0 { // An INTEGER is encoded with at least one octet. return false } if len(bytes) == 1 { return true } if bytes[0] == 0 && bytes[1]&0x80 == 0 || bytes[0] == 0xff && bytes[1]&0x80 == 0x80 { // Value is not minimally encoded. return false } return true } var bigOne = big.NewInt(1) func (s *String) readASN1BigInt(out *big.Int) bool { var bytes String if !s.ReadASN1(&bytes, asn1.INTEGER) || !checkASN1Integer(bytes) { return false } if bytes[0]&0x80 == 0x80 { // Negative number. neg := make([]byte, len(bytes)) for i, b := range bytes { neg[i] = ^b } out.SetBytes(neg) out.Add(out, bigOne) out.Neg(out) } else { out.SetBytes(bytes) } return true } func (s *String) readASN1Bytes(out *[]byte) bool { var bytes String if !s.ReadASN1(&bytes, asn1.INTEGER) || !checkASN1Integer(bytes) { return false } if bytes[0]&0x80 == 0x80 { return false } for len(bytes) > 1 && bytes[0] == 0 { bytes = bytes[1:] } *out = bytes return true } func (s *String) readASN1Int64(out *int64) bool { var bytes String if !s.ReadASN1(&bytes, asn1.INTEGER) || !checkASN1Integer(bytes) || !asn1Signed(out, bytes) { return false } return true } func asn1Signed(out *int64, n []byte) bool { length := len(n) if length > 8 { return false } for i := 0; i < length; i++ { *out <<= 8 *out |= int64(n[i]) } // Shift up and down in order to sign extend the result. *out <<= 64 - uint8(length)*8 *out >>= 64 - uint8(length)*8 return true } func (s *String) readASN1Uint64(out *uint64) bool { var bytes String if !s.ReadASN1(&bytes, asn1.INTEGER) || !checkASN1Integer(bytes) || !asn1Unsigned(out, bytes) { return false } return true } func asn1Unsigned(out *uint64, n []byte) bool { length := len(n) if length > 9 || length == 9 && n[0] != 0 { // Too large for uint64. return false } if n[0]&0x80 != 0 { // Negative number. return false } for i := 0; i < length; i++ { *out <<= 8 *out |= uint64(n[i]) } return true } // ReadASN1Int64WithTag decodes an ASN.1 INTEGER with the given tag into out // and advances. It reports whether the read was successful and resulted in a // value that can be represented in an int64. func (s *String) ReadASN1Int64WithTag(out *int64, tag asn1.Tag) bool { var bytes String return s.ReadASN1(&bytes, tag) && checkASN1Integer(bytes) && asn1Signed(out, bytes) } // ReadASN1Enum decodes an ASN.1 ENUMERATION into out and advances. It reports // whether the read was successful. func (s *String) ReadASN1Enum(out *int) bool { var bytes String var i int64 if !s.ReadASN1(&bytes, asn1.ENUM) || !checkASN1Integer(bytes) || !asn1Signed(&i, bytes) { return false } if int64(int(i)) != i { return false } *out = int(i) return true } func (s *String) readBase128Int(out *int) bool { ret := 0 for i := 0; len(*s) > 0; i++ { if i == 5 { return false } // Avoid overflowing int on a 32-bit platform. // We don't want different behavior based on the architecture. if ret >= 1<<(31-7) { return false } ret <<= 7 b := s.read(1)[0] // ITU-T X.690, section 8.19.2: // The subidentifier shall be encoded in the fewest possible octets, // that is, the leading octet of the subidentifier shall not have the value 0x80. if i == 0 && b == 0x80 { return false } ret |= int(b & 0x7f) if b&0x80 == 0 { *out = ret return true } } return false // truncated } // ReadASN1ObjectIdentifier decodes an ASN.1 OBJECT IDENTIFIER into out and // advances. It reports whether the read was successful. func (s *String) ReadASN1ObjectIdentifier(out *encoding_asn1.ObjectIdentifier) bool { var bytes String if !s.ReadASN1(&bytes, asn1.OBJECT_IDENTIFIER) || len(bytes) == 0 { return false } // In the worst case, we get two elements from the first byte (which is // encoded differently) and then every varint is a single byte long. components := make([]int, len(bytes)+1) // The first varint is 40*value1 + value2: // According to this packing, value1 can take the values 0, 1 and 2 only. // When value1 = 0 or value1 = 1, then value2 is <= 39. When value1 = 2, // then there are no restrictions on value2. var v int if !bytes.readBase128Int(&v) { return false } if v < 80 { components[0] = v / 40 components[1] = v % 40 } else { components[0] = 2 components[1] = v - 80 } i := 2 for ; len(bytes) > 0; i++ { if !bytes.readBase128Int(&v) { return false } components[i] = v } *out = components[:i] return true } // ReadASN1GeneralizedTime decodes an ASN.1 GENERALIZEDTIME into out and // advances. It reports whether the read was successful. func (s *String) ReadASN1GeneralizedTime(out *time.Time) bool { var bytes String if !s.ReadASN1(&bytes, asn1.GeneralizedTime) { return false } t := string(bytes) res, err := time.Parse(generalizedTimeFormatStr, t) if err != nil { return false } if serialized := res.Format(generalizedTimeFormatStr); serialized != t { return false } *out = res return true } const defaultUTCTimeFormatStr = "060102150405Z0700" // ReadASN1UTCTime decodes an ASN.1 UTCTime into out and advances. // It reports whether the read was successful. func (s *String) ReadASN1UTCTime(out *time.Time) bool { var bytes String if !s.ReadASN1(&bytes, asn1.UTCTime) { return false } t := string(bytes) formatStr := defaultUTCTimeFormatStr var err error res, err := time.Parse(formatStr, t) if err != nil { // Fallback to minute precision if we can't parse second // precision. If we are following X.509 or X.690 we shouldn't // support this, but we do. formatStr = "0601021504Z0700" res, err = time.Parse(formatStr, t) } if err != nil { return false } if serialized := res.Format(formatStr); serialized != t { return false } if res.Year() >= 2050 { // UTCTime interprets the low order digits 50-99 as 1950-99. // This only applies to its use in the X.509 profile. // See https://tools.ietf.org/html/rfc5280#section-4.1.2.5.1 res = res.AddDate(-100, 0, 0) } *out = res return true } // ReadASN1BitString decodes an ASN.1 BIT STRING into out and advances. // It reports whether the read was successful. func (s *String) ReadASN1BitString(out *encoding_asn1.BitString) bool { var bytes String if !s.ReadASN1(&bytes, asn1.BIT_STRING) || len(bytes) == 0 || len(bytes)*8/8 != len(bytes) { return false } paddingBits := bytes[0] bytes = bytes[1:] if paddingBits > 7 || len(bytes) == 0 && paddingBits != 0 || len(bytes) > 0 && bytes[len(bytes)-1]&(1< 4 || len(*s) < int(2+lenLen) { return false } lenBytes := String((*s)[2 : 2+lenLen]) if !lenBytes.readUnsigned(&len32, int(lenLen)) { return false } // ITU-T X.690 section 10.1 (DER length forms) requires encoding the length // with the minimum number of octets. if len32 < 128 { // Length should have used short-form encoding. return false } if len32>>((lenLen-1)*8) == 0 { // Leading octet is 0. Length should have been at least one byte shorter. return false } headerLen = 2 + uint32(lenLen) if headerLen+len32 < len32 { // Overflow. return false } length = headerLen + len32 } if int(length) < 0 || !s.ReadBytes((*[]byte)(out), int(length)) { return false } if skipHeader && !out.Skip(int(headerLen)) { panic("cryptobyte: internal error") } return true } ================================================ FILE: vendor/golang.org/x/crypto/cryptobyte/builder.go ================================================ // Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cryptobyte import ( "errors" "fmt" ) // A Builder builds byte strings from fixed-length and length-prefixed values. // Builders either allocate space as needed, or are ‘fixed’, which means that // they write into a given buffer and produce an error if it's exhausted. // // The zero value is a usable Builder that allocates space as needed. // // Simple values are marshaled and appended to a Builder using methods on the // Builder. Length-prefixed values are marshaled by providing a // BuilderContinuation, which is a function that writes the inner contents of // the value to a given Builder. See the documentation for BuilderContinuation // for details. type Builder struct { err error result []byte fixedSize bool child *Builder offset int pendingLenLen int pendingIsASN1 bool inContinuation *bool } // NewBuilder creates a Builder that appends its output to the given buffer. // Like append(), the slice will be reallocated if its capacity is exceeded. // Use Bytes to get the final buffer. func NewBuilder(buffer []byte) *Builder { return &Builder{ result: buffer, } } // NewFixedBuilder creates a Builder that appends its output into the given // buffer. This builder does not reallocate the output buffer. Writes that // would exceed the buffer's capacity are treated as an error. func NewFixedBuilder(buffer []byte) *Builder { return &Builder{ result: buffer, fixedSize: true, } } // SetError sets the value to be returned as the error from Bytes. Writes // performed after calling SetError are ignored. func (b *Builder) SetError(err error) { b.err = err } // Bytes returns the bytes written by the builder or an error if one has // occurred during building. func (b *Builder) Bytes() ([]byte, error) { if b.err != nil { return nil, b.err } return b.result[b.offset:], nil } // BytesOrPanic returns the bytes written by the builder or panics if an error // has occurred during building. func (b *Builder) BytesOrPanic() []byte { if b.err != nil { panic(b.err) } return b.result[b.offset:] } // AddUint8 appends an 8-bit value to the byte string. func (b *Builder) AddUint8(v uint8) { b.add(byte(v)) } // AddUint16 appends a big-endian, 16-bit value to the byte string. func (b *Builder) AddUint16(v uint16) { b.add(byte(v>>8), byte(v)) } // AddUint24 appends a big-endian, 24-bit value to the byte string. The highest // byte of the 32-bit input value is silently truncated. func (b *Builder) AddUint24(v uint32) { b.add(byte(v>>16), byte(v>>8), byte(v)) } // AddUint32 appends a big-endian, 32-bit value to the byte string. func (b *Builder) AddUint32(v uint32) { b.add(byte(v>>24), byte(v>>16), byte(v>>8), byte(v)) } // AddUint48 appends a big-endian, 48-bit value to the byte string. func (b *Builder) AddUint48(v uint64) { b.add(byte(v>>40), byte(v>>32), byte(v>>24), byte(v>>16), byte(v>>8), byte(v)) } // AddUint64 appends a big-endian, 64-bit value to the byte string. func (b *Builder) AddUint64(v uint64) { b.add(byte(v>>56), byte(v>>48), byte(v>>40), byte(v>>32), byte(v>>24), byte(v>>16), byte(v>>8), byte(v)) } // AddBytes appends a sequence of bytes to the byte string. func (b *Builder) AddBytes(v []byte) { b.add(v...) } // BuilderContinuation is a continuation-passing interface for building // length-prefixed byte sequences. Builder methods for length-prefixed // sequences (AddUint8LengthPrefixed etc) will invoke the BuilderContinuation // supplied to them. The child builder passed to the continuation can be used // to build the content of the length-prefixed sequence. For example: // // parent := cryptobyte.NewBuilder() // parent.AddUint8LengthPrefixed(func (child *Builder) { // child.AddUint8(42) // child.AddUint8LengthPrefixed(func (grandchild *Builder) { // grandchild.AddUint8(5) // }) // }) // // It is an error to write more bytes to the child than allowed by the reserved // length prefix. After the continuation returns, the child must be considered // invalid, i.e. users must not store any copies or references of the child // that outlive the continuation. // // If the continuation panics with a value of type BuildError then the inner // error will be returned as the error from Bytes. If the child panics // otherwise then Bytes will repanic with the same value. type BuilderContinuation func(child *Builder) // BuildError wraps an error. If a BuilderContinuation panics with this value, // the panic will be recovered and the inner error will be returned from // Builder.Bytes. type BuildError struct { Err error } // AddUint8LengthPrefixed adds a 8-bit length-prefixed byte sequence. func (b *Builder) AddUint8LengthPrefixed(f BuilderContinuation) { b.addLengthPrefixed(1, false, f) } // AddUint16LengthPrefixed adds a big-endian, 16-bit length-prefixed byte sequence. func (b *Builder) AddUint16LengthPrefixed(f BuilderContinuation) { b.addLengthPrefixed(2, false, f) } // AddUint24LengthPrefixed adds a big-endian, 24-bit length-prefixed byte sequence. func (b *Builder) AddUint24LengthPrefixed(f BuilderContinuation) { b.addLengthPrefixed(3, false, f) } // AddUint32LengthPrefixed adds a big-endian, 32-bit length-prefixed byte sequence. func (b *Builder) AddUint32LengthPrefixed(f BuilderContinuation) { b.addLengthPrefixed(4, false, f) } func (b *Builder) callContinuation(f BuilderContinuation, arg *Builder) { if !*b.inContinuation { *b.inContinuation = true defer func() { *b.inContinuation = false r := recover() if r == nil { return } if buildError, ok := r.(BuildError); ok { b.err = buildError.Err } else { panic(r) } }() } f(arg) } func (b *Builder) addLengthPrefixed(lenLen int, isASN1 bool, f BuilderContinuation) { // Subsequent writes can be ignored if the builder has encountered an error. if b.err != nil { return } offset := len(b.result) b.add(make([]byte, lenLen)...) if b.inContinuation == nil { b.inContinuation = new(bool) } b.child = &Builder{ result: b.result, fixedSize: b.fixedSize, offset: offset, pendingLenLen: lenLen, pendingIsASN1: isASN1, inContinuation: b.inContinuation, } b.callContinuation(f, b.child) b.flushChild() if b.child != nil { panic("cryptobyte: internal error") } } func (b *Builder) flushChild() { if b.child == nil { return } b.child.flushChild() child := b.child b.child = nil if child.err != nil { b.err = child.err return } length := len(child.result) - child.pendingLenLen - child.offset if length < 0 { panic("cryptobyte: internal error") // result unexpectedly shrunk } if child.pendingIsASN1 { // For ASN.1, we reserved a single byte for the length. If that turned out // to be incorrect, we have to move the contents along in order to make // space. if child.pendingLenLen != 1 { panic("cryptobyte: internal error") } var lenLen, lenByte uint8 if int64(length) > 0xfffffffe { b.err = errors.New("pending ASN.1 child too long") return } else if length > 0xffffff { lenLen = 5 lenByte = 0x80 | 4 } else if length > 0xffff { lenLen = 4 lenByte = 0x80 | 3 } else if length > 0xff { lenLen = 3 lenByte = 0x80 | 2 } else if length > 0x7f { lenLen = 2 lenByte = 0x80 | 1 } else { lenLen = 1 lenByte = uint8(length) length = 0 } // Insert the initial length byte, make space for successive length bytes, // and adjust the offset. child.result[child.offset] = lenByte extraBytes := int(lenLen - 1) if extraBytes != 0 { child.add(make([]byte, extraBytes)...) childStart := child.offset + child.pendingLenLen copy(child.result[childStart+extraBytes:], child.result[childStart:]) } child.offset++ child.pendingLenLen = extraBytes } l := length for i := child.pendingLenLen - 1; i >= 0; i-- { child.result[child.offset+i] = uint8(l) l >>= 8 } if l != 0 { b.err = fmt.Errorf("cryptobyte: pending child length %d exceeds %d-byte length prefix", length, child.pendingLenLen) return } if b.fixedSize && &b.result[0] != &child.result[0] { panic("cryptobyte: BuilderContinuation reallocated a fixed-size buffer") } b.result = child.result } func (b *Builder) add(bytes ...byte) { if b.err != nil { return } if b.child != nil { panic("cryptobyte: attempted write while child is pending") } if len(b.result)+len(bytes) < len(bytes) { b.err = errors.New("cryptobyte: length overflow") } if b.fixedSize && len(b.result)+len(bytes) > cap(b.result) { b.err = errors.New("cryptobyte: Builder is exceeding its fixed-size buffer") return } b.result = append(b.result, bytes...) } // Unwrite rolls back non-negative n bytes written directly to the Builder. // An attempt by a child builder passed to a continuation to unwrite bytes // from its parent will panic. func (b *Builder) Unwrite(n int) { if b.err != nil { return } if b.child != nil { panic("cryptobyte: attempted unwrite while child is pending") } length := len(b.result) - b.pendingLenLen - b.offset if length < 0 { panic("cryptobyte: internal error") } if n < 0 { panic("cryptobyte: attempted to unwrite negative number of bytes") } if n > length { panic("cryptobyte: attempted to unwrite more than was written") } b.result = b.result[:len(b.result)-n] } // A MarshalingValue marshals itself into a Builder. type MarshalingValue interface { // Marshal is called by Builder.AddValue. It receives a pointer to a builder // to marshal itself into. It may return an error that occurred during // marshaling, such as unset or invalid values. Marshal(b *Builder) error } // AddValue calls Marshal on v, passing a pointer to the builder to append to. // If Marshal returns an error, it is set on the Builder so that subsequent // appends don't have an effect. func (b *Builder) AddValue(v MarshalingValue) { err := v.Marshal(b) if err != nil { b.err = err } } ================================================ FILE: vendor/golang.org/x/crypto/cryptobyte/string.go ================================================ // Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package cryptobyte contains types that help with parsing and constructing // length-prefixed, binary messages, including ASN.1 DER. (The asn1 subpackage // contains useful ASN.1 constants.) // // The String type is for parsing. It wraps a []byte slice and provides helper // functions for consuming structures, value by value. // // The Builder type is for constructing messages. It providers helper functions // for appending values and also for appending length-prefixed submessages – // without having to worry about calculating the length prefix ahead of time. // // See the documentation and examples for the Builder and String types to get // started. package cryptobyte // String represents a string of bytes. It provides methods for parsing // fixed-length and length-prefixed values from it. type String []byte // read advances a String by n bytes and returns them. If less than n bytes // remain, it returns nil. func (s *String) read(n int) []byte { if len(*s) < n || n < 0 { return nil } v := (*s)[:n] *s = (*s)[n:] return v } // Skip advances the String by n byte and reports whether it was successful. func (s *String) Skip(n int) bool { return s.read(n) != nil } // ReadUint8 decodes an 8-bit value into out and advances over it. // It reports whether the read was successful. func (s *String) ReadUint8(out *uint8) bool { v := s.read(1) if v == nil { return false } *out = uint8(v[0]) return true } // ReadUint16 decodes a big-endian, 16-bit value into out and advances over it. // It reports whether the read was successful. func (s *String) ReadUint16(out *uint16) bool { v := s.read(2) if v == nil { return false } *out = uint16(v[0])<<8 | uint16(v[1]) return true } // ReadUint24 decodes a big-endian, 24-bit value into out and advances over it. // It reports whether the read was successful. func (s *String) ReadUint24(out *uint32) bool { v := s.read(3) if v == nil { return false } *out = uint32(v[0])<<16 | uint32(v[1])<<8 | uint32(v[2]) return true } // ReadUint32 decodes a big-endian, 32-bit value into out and advances over it. // It reports whether the read was successful. func (s *String) ReadUint32(out *uint32) bool { v := s.read(4) if v == nil { return false } *out = uint32(v[0])<<24 | uint32(v[1])<<16 | uint32(v[2])<<8 | uint32(v[3]) return true } // ReadUint48 decodes a big-endian, 48-bit value into out and advances over it. // It reports whether the read was successful. func (s *String) ReadUint48(out *uint64) bool { v := s.read(6) if v == nil { return false } *out = uint64(v[0])<<40 | uint64(v[1])<<32 | uint64(v[2])<<24 | uint64(v[3])<<16 | uint64(v[4])<<8 | uint64(v[5]) return true } // ReadUint64 decodes a big-endian, 64-bit value into out and advances over it. // It reports whether the read was successful. func (s *String) ReadUint64(out *uint64) bool { v := s.read(8) if v == nil { return false } *out = uint64(v[0])<<56 | uint64(v[1])<<48 | uint64(v[2])<<40 | uint64(v[3])<<32 | uint64(v[4])<<24 | uint64(v[5])<<16 | uint64(v[6])<<8 | uint64(v[7]) return true } func (s *String) readUnsigned(out *uint32, length int) bool { v := s.read(length) if v == nil { return false } var result uint32 for i := 0; i < length; i++ { result <<= 8 result |= uint32(v[i]) } *out = result return true } func (s *String) readLengthPrefixed(lenLen int, outChild *String) bool { lenBytes := s.read(lenLen) if lenBytes == nil { return false } var length uint32 for _, b := range lenBytes { length = length << 8 length = length | uint32(b) } v := s.read(int(length)) if v == nil { return false } *outChild = v return true } // ReadUint8LengthPrefixed reads the content of an 8-bit length-prefixed value // into out and advances over it. It reports whether the read was successful. func (s *String) ReadUint8LengthPrefixed(out *String) bool { return s.readLengthPrefixed(1, out) } // ReadUint16LengthPrefixed reads the content of a big-endian, 16-bit // length-prefixed value into out and advances over it. It reports whether the // read was successful. func (s *String) ReadUint16LengthPrefixed(out *String) bool { return s.readLengthPrefixed(2, out) } // ReadUint24LengthPrefixed reads the content of a big-endian, 24-bit // length-prefixed value into out and advances over it. It reports whether // the read was successful. func (s *String) ReadUint24LengthPrefixed(out *String) bool { return s.readLengthPrefixed(3, out) } // ReadBytes reads n bytes into out and advances over them. It reports // whether the read was successful. func (s *String) ReadBytes(out *[]byte, n int) bool { v := s.read(n) if v == nil { return false } *out = v return true } // CopyBytes copies len(out) bytes into out and advances over them. It reports // whether the copy operation was successful func (s *String) CopyBytes(out []byte) bool { n := len(out) v := s.read(n) if v == nil { return false } return copy(out, v) == n } // Empty reports whether the string does not contain any bytes. func (s String) Empty() bool { return len(s) == 0 } ================================================ FILE: vendor/golang.org/x/crypto/internal/alias/alias.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build !purego // Package alias implements memory aliasing tests. package alias import "unsafe" // AnyOverlap reports whether x and y share memory at any (not necessarily // corresponding) index. The memory beyond the slice length is ignored. func AnyOverlap(x, y []byte) bool { return len(x) > 0 && len(y) > 0 && uintptr(unsafe.Pointer(&x[0])) <= uintptr(unsafe.Pointer(&y[len(y)-1])) && uintptr(unsafe.Pointer(&y[0])) <= uintptr(unsafe.Pointer(&x[len(x)-1])) } // InexactOverlap reports whether x and y share memory at any non-corresponding // index. The memory beyond the slice length is ignored. Note that x and y can // have different lengths and still not have any inexact overlap. // // InexactOverlap can be used to implement the requirements of the crypto/cipher // AEAD, Block, BlockMode and Stream interfaces. func InexactOverlap(x, y []byte) bool { if len(x) == 0 || len(y) == 0 || &x[0] == &y[0] { return false } return AnyOverlap(x, y) } ================================================ FILE: vendor/golang.org/x/crypto/internal/alias/alias_purego.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build purego // Package alias implements memory aliasing tests. package alias // This is the Google App Engine standard variant based on reflect // because the unsafe package and cgo are disallowed. import "reflect" // AnyOverlap reports whether x and y share memory at any (not necessarily // corresponding) index. The memory beyond the slice length is ignored. func AnyOverlap(x, y []byte) bool { return len(x) > 0 && len(y) > 0 && reflect.ValueOf(&x[0]).Pointer() <= reflect.ValueOf(&y[len(y)-1]).Pointer() && reflect.ValueOf(&y[0]).Pointer() <= reflect.ValueOf(&x[len(x)-1]).Pointer() } // InexactOverlap reports whether x and y share memory at any non-corresponding // index. The memory beyond the slice length is ignored. Note that x and y can // have different lengths and still not have any inexact overlap. // // InexactOverlap can be used to implement the requirements of the crypto/cipher // AEAD, Block, BlockMode and Stream interfaces. func InexactOverlap(x, y []byte) bool { if len(x) == 0 || len(y) == 0 || &x[0] == &y[0] { return false } return AnyOverlap(x, y) } ================================================ FILE: vendor/golang.org/x/crypto/internal/poly1305/mac_noasm.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build (!amd64 && !loong64 && !ppc64le && !ppc64 && !s390x) || !gc || purego package poly1305 type mac struct{ macGeneric } ================================================ FILE: vendor/golang.org/x/crypto/internal/poly1305/poly1305.go ================================================ // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package poly1305 implements Poly1305 one-time message authentication code as // specified in https://cr.yp.to/mac/poly1305-20050329.pdf. // // Poly1305 is a fast, one-time authentication function. It is infeasible for an // attacker to generate an authenticator for a message without the key. However, a // key must only be used for a single message. Authenticating two different // messages with the same key allows an attacker to forge authenticators for other // messages with the same key. // // Poly1305 was originally coupled with AES in order to make Poly1305-AES. AES was // used with a fixed key in order to generate one-time keys from an nonce. // However, in this package AES isn't used and the one-time key is specified // directly. package poly1305 import "crypto/subtle" // TagSize is the size, in bytes, of a poly1305 authenticator. const TagSize = 16 // Sum generates an authenticator for msg using a one-time key and puts the // 16-byte result into out. Authenticating two different messages with the same // key allows an attacker to forge messages at will. func Sum(out *[16]byte, m []byte, key *[32]byte) { h := New(key) h.Write(m) h.Sum(out[:0]) } // Verify returns true if mac is a valid authenticator for m with the given key. func Verify(mac *[16]byte, m []byte, key *[32]byte) bool { var tmp [16]byte Sum(&tmp, m, key) return subtle.ConstantTimeCompare(tmp[:], mac[:]) == 1 } // New returns a new MAC computing an authentication // tag of all data written to it with the given key. // This allows writing the message progressively instead // of passing it as a single slice. Common users should use // the Sum function instead. // // The key must be unique for each message, as authenticating // two different messages with the same key allows an attacker // to forge messages at will. func New(key *[32]byte) *MAC { m := &MAC{} initialize(key, &m.macState) return m } // MAC is an io.Writer computing an authentication tag // of the data written to it. // // MAC cannot be used like common hash.Hash implementations, // because using a poly1305 key twice breaks its security. // Therefore writing data to a running MAC after calling // Sum or Verify causes it to panic. type MAC struct { mac // platform-dependent implementation finalized bool } // Size returns the number of bytes Sum will return. func (h *MAC) Size() int { return TagSize } // Write adds more data to the running message authentication code. // It never returns an error. // // It must not be called after the first call of Sum or Verify. func (h *MAC) Write(p []byte) (n int, err error) { if h.finalized { panic("poly1305: write to MAC after Sum or Verify") } return h.mac.Write(p) } // Sum computes the authenticator of all data written to the // message authentication code. func (h *MAC) Sum(b []byte) []byte { var mac [TagSize]byte h.mac.Sum(&mac) h.finalized = true return append(b, mac[:]...) } // Verify returns whether the authenticator of all data written to // the message authentication code matches the expected value. func (h *MAC) Verify(expected []byte) bool { var mac [TagSize]byte h.mac.Sum(&mac) h.finalized = true return subtle.ConstantTimeCompare(expected, mac[:]) == 1 } ================================================ FILE: vendor/golang.org/x/crypto/internal/poly1305/sum_amd64.s ================================================ // Code generated by command: go run sum_amd64_asm.go -out ../sum_amd64.s -pkg poly1305. DO NOT EDIT. //go:build gc && !purego // func update(state *macState, msg []byte) TEXT ·update(SB), $0-32 MOVQ state+0(FP), DI MOVQ msg_base+8(FP), SI MOVQ msg_len+16(FP), R15 MOVQ (DI), R8 MOVQ 8(DI), R9 MOVQ 16(DI), R10 MOVQ 24(DI), R11 MOVQ 32(DI), R12 CMPQ R15, $0x10 JB bytes_between_0_and_15 loop: ADDQ (SI), R8 ADCQ 8(SI), R9 ADCQ $0x01, R10 LEAQ 16(SI), SI multiply: MOVQ R11, AX MULQ R8 MOVQ AX, BX MOVQ DX, CX MOVQ R11, AX MULQ R9 ADDQ AX, CX ADCQ $0x00, DX MOVQ R11, R13 IMULQ R10, R13 ADDQ DX, R13 MOVQ R12, AX MULQ R8 ADDQ AX, CX ADCQ $0x00, DX MOVQ DX, R8 MOVQ R12, R14 IMULQ R10, R14 MOVQ R12, AX MULQ R9 ADDQ AX, R13 ADCQ DX, R14 ADDQ R8, R13 ADCQ $0x00, R14 MOVQ BX, R8 MOVQ CX, R9 MOVQ R13, R10 ANDQ $0x03, R10 MOVQ R13, BX ANDQ $-4, BX ADDQ BX, R8 ADCQ R14, R9 ADCQ $0x00, R10 SHRQ $0x02, R14, R13 SHRQ $0x02, R14 ADDQ R13, R8 ADCQ R14, R9 ADCQ $0x00, R10 SUBQ $0x10, R15 CMPQ R15, $0x10 JAE loop bytes_between_0_and_15: TESTQ R15, R15 JZ done MOVQ $0x00000001, BX XORQ CX, CX XORQ R13, R13 ADDQ R15, SI flush_buffer: SHLQ $0x08, BX, CX SHLQ $0x08, BX MOVB -1(SI), R13 XORQ R13, BX DECQ SI DECQ R15 JNZ flush_buffer ADDQ BX, R8 ADCQ CX, R9 ADCQ $0x00, R10 MOVQ $0x00000010, R15 JMP multiply done: MOVQ R8, (DI) MOVQ R9, 8(DI) MOVQ R10, 16(DI) RET ================================================ FILE: vendor/golang.org/x/crypto/internal/poly1305/sum_asm.go ================================================ // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build gc && !purego && (amd64 || loong64 || ppc64 || ppc64le) package poly1305 //go:noescape func update(state *macState, msg []byte) // mac is a wrapper for macGeneric that redirects calls that would have gone to // updateGeneric to update. // // Its Write and Sum methods are otherwise identical to the macGeneric ones, but // using function pointers would carry a major performance cost. type mac struct{ macGeneric } func (h *mac) Write(p []byte) (int, error) { nn := len(p) if h.offset > 0 { n := copy(h.buffer[h.offset:], p) if h.offset+n < TagSize { h.offset += n return nn, nil } p = p[n:] h.offset = 0 update(&h.macState, h.buffer[:]) } if n := len(p) - (len(p) % TagSize); n > 0 { update(&h.macState, p[:n]) p = p[n:] } if len(p) > 0 { h.offset += copy(h.buffer[h.offset:], p) } return nn, nil } func (h *mac) Sum(out *[16]byte) { state := h.macState if h.offset > 0 { update(&state, h.buffer[:h.offset]) } finalize(out, &state.h, &state.s) } ================================================ FILE: vendor/golang.org/x/crypto/internal/poly1305/sum_generic.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This file provides the generic implementation of Sum and MAC. Other files // might provide optimized assembly implementations of some of this code. package poly1305 import ( "encoding/binary" "math/bits" ) // Poly1305 [RFC 7539] is a relatively simple algorithm: the authentication tag // for a 64 bytes message is approximately // // s + m[0:16] * r⁴ + m[16:32] * r³ + m[32:48] * r² + m[48:64] * r mod 2¹³⁰ - 5 // // for some secret r and s. It can be computed sequentially like // // for len(msg) > 0: // h += read(msg, 16) // h *= r // h %= 2¹³⁰ - 5 // return h + s // // All the complexity is about doing performant constant-time math on numbers // larger than any available numeric type. func sumGeneric(out *[TagSize]byte, msg []byte, key *[32]byte) { h := newMACGeneric(key) h.Write(msg) h.Sum(out) } func newMACGeneric(key *[32]byte) macGeneric { m := macGeneric{} initialize(key, &m.macState) return m } // macState holds numbers in saturated 64-bit little-endian limbs. That is, // the value of [x0, x1, x2] is x[0] + x[1] * 2⁶⁴ + x[2] * 2¹²⁸. type macState struct { // h is the main accumulator. It is to be interpreted modulo 2¹³⁰ - 5, but // can grow larger during and after rounds. It must, however, remain below // 2 * (2¹³⁰ - 5). h [3]uint64 // r and s are the private key components. r [2]uint64 s [2]uint64 } type macGeneric struct { macState buffer [TagSize]byte offset int } // Write splits the incoming message into TagSize chunks, and passes them to // update. It buffers incomplete chunks. func (h *macGeneric) Write(p []byte) (int, error) { nn := len(p) if h.offset > 0 { n := copy(h.buffer[h.offset:], p) if h.offset+n < TagSize { h.offset += n return nn, nil } p = p[n:] h.offset = 0 updateGeneric(&h.macState, h.buffer[:]) } if n := len(p) - (len(p) % TagSize); n > 0 { updateGeneric(&h.macState, p[:n]) p = p[n:] } if len(p) > 0 { h.offset += copy(h.buffer[h.offset:], p) } return nn, nil } // Sum flushes the last incomplete chunk from the buffer, if any, and generates // the MAC output. It does not modify its state, in order to allow for multiple // calls to Sum, even if no Write is allowed after Sum. func (h *macGeneric) Sum(out *[TagSize]byte) { state := h.macState if h.offset > 0 { updateGeneric(&state, h.buffer[:h.offset]) } finalize(out, &state.h, &state.s) } // [rMask0, rMask1] is the specified Poly1305 clamping mask in little-endian. It // clears some bits of the secret coefficient to make it possible to implement // multiplication more efficiently. const ( rMask0 = 0x0FFFFFFC0FFFFFFF rMask1 = 0x0FFFFFFC0FFFFFFC ) // initialize loads the 256-bit key into the two 128-bit secret values r and s. func initialize(key *[32]byte, m *macState) { m.r[0] = binary.LittleEndian.Uint64(key[0:8]) & rMask0 m.r[1] = binary.LittleEndian.Uint64(key[8:16]) & rMask1 m.s[0] = binary.LittleEndian.Uint64(key[16:24]) m.s[1] = binary.LittleEndian.Uint64(key[24:32]) } // uint128 holds a 128-bit number as two 64-bit limbs, for use with the // bits.Mul64 and bits.Add64 intrinsics. type uint128 struct { lo, hi uint64 } func mul64(a, b uint64) uint128 { hi, lo := bits.Mul64(a, b) return uint128{lo, hi} } func add128(a, b uint128) uint128 { lo, c := bits.Add64(a.lo, b.lo, 0) hi, c := bits.Add64(a.hi, b.hi, c) if c != 0 { panic("poly1305: unexpected overflow") } return uint128{lo, hi} } func shiftRightBy2(a uint128) uint128 { a.lo = a.lo>>2 | (a.hi&3)<<62 a.hi = a.hi >> 2 return a } // updateGeneric absorbs msg into the state.h accumulator. For each chunk m of // 128 bits of message, it computes // // h₊ = (h + m) * r mod 2¹³⁰ - 5 // // If the msg length is not a multiple of TagSize, it assumes the last // incomplete chunk is the final one. func updateGeneric(state *macState, msg []byte) { h0, h1, h2 := state.h[0], state.h[1], state.h[2] r0, r1 := state.r[0], state.r[1] for len(msg) > 0 { var c uint64 // For the first step, h + m, we use a chain of bits.Add64 intrinsics. // The resulting value of h might exceed 2¹³⁰ - 5, but will be partially // reduced at the end of the multiplication below. // // The spec requires us to set a bit just above the message size, not to // hide leading zeroes. For full chunks, that's 1 << 128, so we can just // add 1 to the most significant (2¹²⁸) limb, h2. if len(msg) >= TagSize { h0, c = bits.Add64(h0, binary.LittleEndian.Uint64(msg[0:8]), 0) h1, c = bits.Add64(h1, binary.LittleEndian.Uint64(msg[8:16]), c) h2 += c + 1 msg = msg[TagSize:] } else { var buf [TagSize]byte copy(buf[:], msg) buf[len(msg)] = 1 h0, c = bits.Add64(h0, binary.LittleEndian.Uint64(buf[0:8]), 0) h1, c = bits.Add64(h1, binary.LittleEndian.Uint64(buf[8:16]), c) h2 += c msg = nil } // Multiplication of big number limbs is similar to elementary school // columnar multiplication. Instead of digits, there are 64-bit limbs. // // We are multiplying a 3 limbs number, h, by a 2 limbs number, r. // // h2 h1 h0 x // r1 r0 = // ---------------- // h2r0 h1r0 h0r0 <-- individual 128-bit products // + h2r1 h1r1 h0r1 // ------------------------ // m3 m2 m1 m0 <-- result in 128-bit overlapping limbs // ------------------------ // m3.hi m2.hi m1.hi m0.hi <-- carry propagation // + m3.lo m2.lo m1.lo m0.lo // ------------------------------- // t4 t3 t2 t1 t0 <-- final result in 64-bit limbs // // The main difference from pen-and-paper multiplication is that we do // carry propagation in a separate step, as if we wrote two digit sums // at first (the 128-bit limbs), and then carried the tens all at once. h0r0 := mul64(h0, r0) h1r0 := mul64(h1, r0) h2r0 := mul64(h2, r0) h0r1 := mul64(h0, r1) h1r1 := mul64(h1, r1) h2r1 := mul64(h2, r1) // Since h2 is known to be at most 7 (5 + 1 + 1), and r0 and r1 have their // top 4 bits cleared by rMask{0,1}, we know that their product is not going // to overflow 64 bits, so we can ignore the high part of the products. // // This also means that the product doesn't have a fifth limb (t4). if h2r0.hi != 0 { panic("poly1305: unexpected overflow") } if h2r1.hi != 0 { panic("poly1305: unexpected overflow") } m0 := h0r0 m1 := add128(h1r0, h0r1) // These two additions don't overflow thanks again m2 := add128(h2r0, h1r1) // to the 4 masked bits at the top of r0 and r1. m3 := h2r1 t0 := m0.lo t1, c := bits.Add64(m1.lo, m0.hi, 0) t2, c := bits.Add64(m2.lo, m1.hi, c) t3, _ := bits.Add64(m3.lo, m2.hi, c) // Now we have the result as 4 64-bit limbs, and we need to reduce it // modulo 2¹³⁰ - 5. The special shape of this Crandall prime lets us do // a cheap partial reduction according to the reduction identity // // c * 2¹³⁰ + n = c * 5 + n mod 2¹³⁰ - 5 // // because 2¹³⁰ = 5 mod 2¹³⁰ - 5. Partial reduction since the result is // likely to be larger than 2¹³⁰ - 5, but still small enough to fit the // assumptions we make about h in the rest of the code. // // See also https://speakerdeck.com/gtank/engineering-prime-numbers?slide=23 // We split the final result at the 2¹³⁰ mark into h and cc, the carry. // Note that the carry bits are effectively shifted left by 2, in other // words, cc = c * 4 for the c in the reduction identity. h0, h1, h2 = t0, t1, t2&maskLow2Bits cc := uint128{t2 & maskNotLow2Bits, t3} // To add c * 5 to h, we first add cc = c * 4, and then add (cc >> 2) = c. h0, c = bits.Add64(h0, cc.lo, 0) h1, c = bits.Add64(h1, cc.hi, c) h2 += c cc = shiftRightBy2(cc) h0, c = bits.Add64(h0, cc.lo, 0) h1, c = bits.Add64(h1, cc.hi, c) h2 += c // h2 is at most 3 + 1 + 1 = 5, making the whole of h at most // // 5 * 2¹²⁸ + (2¹²⁸ - 1) = 6 * 2¹²⁸ - 1 } state.h[0], state.h[1], state.h[2] = h0, h1, h2 } const ( maskLow2Bits uint64 = 0x0000000000000003 maskNotLow2Bits uint64 = ^maskLow2Bits ) // select64 returns x if v == 1 and y if v == 0, in constant time. func select64(v, x, y uint64) uint64 { return ^(v-1)&x | (v-1)&y } // [p0, p1, p2] is 2¹³⁰ - 5 in little endian order. const ( p0 = 0xFFFFFFFFFFFFFFFB p1 = 0xFFFFFFFFFFFFFFFF p2 = 0x0000000000000003 ) // finalize completes the modular reduction of h and computes // // out = h + s mod 2¹²⁸ func finalize(out *[TagSize]byte, h *[3]uint64, s *[2]uint64) { h0, h1, h2 := h[0], h[1], h[2] // After the partial reduction in updateGeneric, h might be more than // 2¹³⁰ - 5, but will be less than 2 * (2¹³⁰ - 5). To complete the reduction // in constant time, we compute t = h - (2¹³⁰ - 5), and select h as the // result if the subtraction underflows, and t otherwise. hMinusP0, b := bits.Sub64(h0, p0, 0) hMinusP1, b := bits.Sub64(h1, p1, b) _, b = bits.Sub64(h2, p2, b) // h = h if h < p else h - p h0 = select64(b, h0, hMinusP0) h1 = select64(b, h1, hMinusP1) // Finally, we compute the last Poly1305 step // // tag = h + s mod 2¹²⁸ // // by just doing a wide addition with the 128 low bits of h and discarding // the overflow. h0, c := bits.Add64(h0, s[0], 0) h1, _ = bits.Add64(h1, s[1], c) binary.LittleEndian.PutUint64(out[0:8], h0) binary.LittleEndian.PutUint64(out[8:16], h1) } ================================================ FILE: vendor/golang.org/x/crypto/internal/poly1305/sum_loong64.s ================================================ // Copyright 2025 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build gc && !purego // func update(state *macState, msg []byte) TEXT ·update(SB), $0-32 MOVV state+0(FP), R4 MOVV msg_base+8(FP), R5 MOVV msg_len+16(FP), R6 MOVV $0x10, R7 MOVV (R4), R8 // h0 MOVV 8(R4), R9 // h1 MOVV 16(R4), R10 // h2 MOVV 24(R4), R11 // r0 MOVV 32(R4), R12 // r1 BLT R6, R7, bytes_between_0_and_15 loop: MOVV (R5), R14 // msg[0:8] MOVV 8(R5), R16 // msg[8:16] ADDV R14, R8, R8 // h0 (x1 + y1 = z1', if z1' < x1 then z1' overflow) ADDV R16, R9, R27 SGTU R14, R8, R24 // h0.carry SGTU R9, R27, R28 ADDV R27, R24, R9 // h1 SGTU R27, R9, R24 OR R24, R28, R24 // h1.carry ADDV $0x01, R24, R24 ADDV R10, R24, R10 // h2 ADDV $16, R5, R5 // msg = msg[16:] multiply: MULV R8, R11, R14 // h0r0.lo MULHVU R8, R11, R15 // h0r0.hi MULV R9, R11, R13 // h1r0.lo MULHVU R9, R11, R16 // h1r0.hi ADDV R13, R15, R15 SGTU R13, R15, R24 ADDV R24, R16, R16 MULV R10, R11, R25 ADDV R16, R25, R25 MULV R8, R12, R13 // h0r1.lo MULHVU R8, R12, R16 // h0r1.hi ADDV R13, R15, R15 SGTU R13, R15, R24 ADDV R24, R16, R16 MOVV R16, R8 MULV R10, R12, R26 // h2r1 MULV R9, R12, R13 // h1r1.lo MULHVU R9, R12, R16 // h1r1.hi ADDV R13, R25, R25 ADDV R16, R26, R27 SGTU R13, R25, R24 ADDV R27, R24, R26 ADDV R8, R25, R25 SGTU R8, R25, R24 ADDV R24, R26, R26 AND $3, R25, R10 AND $-4, R25, R17 ADDV R17, R14, R8 ADDV R26, R15, R27 SGTU R17, R8, R24 SGTU R26, R27, R28 ADDV R27, R24, R9 SGTU R27, R9, R24 OR R24, R28, R24 ADDV R24, R10, R10 SLLV $62, R26, R27 SRLV $2, R25, R28 SRLV $2, R26, R26 OR R27, R28, R25 ADDV R25, R8, R8 ADDV R26, R9, R27 SGTU R25, R8, R24 SGTU R26, R27, R28 ADDV R27, R24, R9 SGTU R27, R9, R24 OR R24, R28, R24 ADDV R24, R10, R10 SUBV $16, R6, R6 BGE R6, R7, loop bytes_between_0_and_15: BEQ R6, R0, done MOVV $1, R14 XOR R15, R15 ADDV R6, R5, R5 flush_buffer: MOVBU -1(R5), R25 SRLV $56, R14, R24 SLLV $8, R15, R28 SLLV $8, R14, R14 OR R24, R28, R15 XOR R25, R14, R14 SUBV $1, R6, R6 SUBV $1, R5, R5 BNE R6, R0, flush_buffer ADDV R14, R8, R8 SGTU R14, R8, R24 ADDV R15, R9, R27 SGTU R15, R27, R28 ADDV R27, R24, R9 SGTU R27, R9, R24 OR R24, R28, R24 ADDV R10, R24, R10 MOVV $16, R6 JMP multiply done: MOVV R8, (R4) MOVV R9, 8(R4) MOVV R10, 16(R4) RET ================================================ FILE: vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64x.s ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build gc && !purego && (ppc64 || ppc64le) #include "textflag.h" // This was ported from the amd64 implementation. #ifdef GOARCH_ppc64le #define LE_MOVD MOVD #define LE_MOVWZ MOVWZ #define LE_MOVHZ MOVHZ #else #define LE_MOVD MOVDBR #define LE_MOVWZ MOVWBR #define LE_MOVHZ MOVHBR #endif #define POLY1305_ADD(msg, h0, h1, h2, t0, t1, t2) \ LE_MOVD (msg)( R0), t0; \ LE_MOVD (msg)(R24), t1; \ MOVD $1, t2; \ ADDC t0, h0, h0; \ ADDE t1, h1, h1; \ ADDE t2, h2; \ ADD $16, msg #define POLY1305_MUL(h0, h1, h2, r0, r1, t0, t1, t2, t3, t4, t5) \ MULLD r0, h0, t0; \ MULHDU r0, h0, t1; \ MULLD r0, h1, t4; \ MULHDU r0, h1, t5; \ ADDC t4, t1, t1; \ MULLD r0, h2, t2; \ MULHDU r1, h0, t4; \ MULLD r1, h0, h0; \ ADDE t5, t2, t2; \ ADDC h0, t1, t1; \ MULLD h2, r1, t3; \ ADDZE t4, h0; \ MULHDU r1, h1, t5; \ MULLD r1, h1, t4; \ ADDC t4, t2, t2; \ ADDE t5, t3, t3; \ ADDC h0, t2, t2; \ MOVD $-4, t4; \ ADDZE t3; \ RLDICL $0, t2, $62, h2; \ AND t2, t4, h0; \ ADDC t0, h0, h0; \ ADDE t3, t1, h1; \ SLD $62, t3, t4; \ SRD $2, t2; \ ADDZE h2; \ OR t4, t2, t2; \ SRD $2, t3; \ ADDC t2, h0, h0; \ ADDE t3, h1, h1; \ ADDZE h2 // func update(state *[7]uint64, msg []byte) TEXT ·update(SB), $0-32 MOVD state+0(FP), R3 MOVD msg_base+8(FP), R4 MOVD msg_len+16(FP), R5 MOVD 0(R3), R8 // h0 MOVD 8(R3), R9 // h1 MOVD 16(R3), R10 // h2 MOVD 24(R3), R11 // r0 MOVD 32(R3), R12 // r1 MOVD $8, R24 CMP R5, $16 BLT bytes_between_0_and_15 loop: POLY1305_ADD(R4, R8, R9, R10, R20, R21, R22) PCALIGN $16 multiply: POLY1305_MUL(R8, R9, R10, R11, R12, R16, R17, R18, R14, R20, R21) ADD $-16, R5 CMP R5, $16 BGE loop bytes_between_0_and_15: CMP R5, $0 BEQ done MOVD $0, R16 // h0 MOVD $0, R17 // h1 flush_buffer: CMP R5, $8 BLE just1 MOVD $8, R21 SUB R21, R5, R21 // Greater than 8 -- load the rightmost remaining bytes in msg // and put into R17 (h1) LE_MOVD (R4)(R21), R17 MOVD $16, R22 // Find the offset to those bytes SUB R5, R22, R22 SLD $3, R22 // Shift to get only the bytes in msg SRD R22, R17, R17 // Put 1 at high end MOVD $1, R23 SLD $3, R21 SLD R21, R23, R23 OR R23, R17, R17 // Remainder is 8 MOVD $8, R5 just1: CMP R5, $8 BLT less8 // Exactly 8 LE_MOVD (R4), R16 CMP R17, $0 // Check if we've already set R17; if not // set 1 to indicate end of msg. BNE carry MOVD $1, R17 BR carry less8: MOVD $0, R16 // h0 MOVD $0, R22 // shift count CMP R5, $4 BLT less4 LE_MOVWZ (R4), R16 ADD $4, R4 ADD $-4, R5 MOVD $32, R22 less4: CMP R5, $2 BLT less2 LE_MOVHZ (R4), R21 SLD R22, R21, R21 OR R16, R21, R16 ADD $16, R22 ADD $-2, R5 ADD $2, R4 less2: CMP R5, $0 BEQ insert1 MOVBZ (R4), R21 SLD R22, R21, R21 OR R16, R21, R16 ADD $8, R22 insert1: // Insert 1 at end of msg MOVD $1, R21 SLD R22, R21, R21 OR R16, R21, R16 carry: // Add new values to h0, h1, h2 ADDC R16, R8 ADDE R17, R9 ADDZE R10, R10 MOVD $16, R5 ADD R5, R4 BR multiply done: // Save h0, h1, h2 in state MOVD R8, 0(R3) MOVD R9, 8(R3) MOVD R10, 16(R3) RET ================================================ FILE: vendor/golang.org/x/crypto/internal/poly1305/sum_s390x.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build gc && !purego package poly1305 import ( "golang.org/x/sys/cpu" ) // updateVX is an assembly implementation of Poly1305 that uses vector // instructions. It must only be called if the vector facility (vx) is // available. // //go:noescape func updateVX(state *macState, msg []byte) // mac is a replacement for macGeneric that uses a larger buffer and redirects // calls that would have gone to updateGeneric to updateVX if the vector // facility is installed. // // A larger buffer is required for good performance because the vector // implementation has a higher fixed cost per call than the generic // implementation. type mac struct { macState buffer [16 * TagSize]byte // size must be a multiple of block size (16) offset int } func (h *mac) Write(p []byte) (int, error) { nn := len(p) if h.offset > 0 { n := copy(h.buffer[h.offset:], p) if h.offset+n < len(h.buffer) { h.offset += n return nn, nil } p = p[n:] h.offset = 0 if cpu.S390X.HasVX { updateVX(&h.macState, h.buffer[:]) } else { updateGeneric(&h.macState, h.buffer[:]) } } tail := len(p) % len(h.buffer) // number of bytes to copy into buffer body := len(p) - tail // number of bytes to process now if body > 0 { if cpu.S390X.HasVX { updateVX(&h.macState, p[:body]) } else { updateGeneric(&h.macState, p[:body]) } } h.offset = copy(h.buffer[:], p[body:]) // copy tail bytes - can be 0 return nn, nil } func (h *mac) Sum(out *[TagSize]byte) { state := h.macState remainder := h.buffer[:h.offset] // Use the generic implementation if we have 2 or fewer blocks left // to sum. The vector implementation has a higher startup time. if cpu.S390X.HasVX && len(remainder) > 2*TagSize { updateVX(&state, remainder) } else if len(remainder) > 0 { updateGeneric(&state, remainder) } finalize(out, &state.h, &state.s) } ================================================ FILE: vendor/golang.org/x/crypto/internal/poly1305/sum_s390x.s ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build gc && !purego #include "textflag.h" // This implementation of Poly1305 uses the vector facility (vx) // to process up to 2 blocks (32 bytes) per iteration using an // algorithm based on the one described in: // // NEON crypto, Daniel J. Bernstein & Peter Schwabe // https://cryptojedi.org/papers/neoncrypto-20120320.pdf // // This algorithm uses 5 26-bit limbs to represent a 130-bit // value. These limbs are, for the most part, zero extended and // placed into 64-bit vector register elements. Each vector // register is 128-bits wide and so holds 2 of these elements. // Using 26-bit limbs allows us plenty of headroom to accommodate // accumulations before and after multiplication without // overflowing either 32-bits (before multiplication) or 64-bits // (after multiplication). // // In order to parallelise the operations required to calculate // the sum we use two separate accumulators and then sum those // in an extra final step. For compatibility with the generic // implementation we perform this summation at the end of every // updateVX call. // // To use two accumulators we must multiply the message blocks // by r² rather than r. Only the final message block should be // multiplied by r. // // Example: // // We want to calculate the sum (h) for a 64 byte message (m): // // h = m[0:16]r⁴ + m[16:32]r³ + m[32:48]r² + m[48:64]r // // To do this we split the calculation into the even indices // and odd indices of the message. These form our SIMD 'lanes': // // h = m[ 0:16]r⁴ + m[32:48]r² + <- lane 0 // m[16:32]r³ + m[48:64]r <- lane 1 // // To calculate this iteratively we refactor so that both lanes // are written in terms of r² and r: // // h = (m[ 0:16]r² + m[32:48])r² + <- lane 0 // (m[16:32]r² + m[48:64])r <- lane 1 // ^ ^ // | coefficients for second iteration // coefficients for first iteration // // So in this case we would have two iterations. In the first // both lanes are multiplied by r². In the second only the // first lane is multiplied by r² and the second lane is // instead multiplied by r. This gives use the odd and even // powers of r that we need from the original equation. // // Notation: // // h - accumulator // r - key // m - message // // [a, b] - SIMD register holding two 64-bit values // [a, b, c, d] - SIMD register holding four 32-bit values // xᵢ[n] - limb n of variable x with bit width i // // Limbs are expressed in little endian order, so for 26-bit // limbs x₂₆[4] will be the most significant limb and x₂₆[0] // will be the least significant limb. // masking constants #define MOD24 V0 // [0x0000000000ffffff, 0x0000000000ffffff] - mask low 24-bits #define MOD26 V1 // [0x0000000003ffffff, 0x0000000003ffffff] - mask low 26-bits // expansion constants (see EXPAND macro) #define EX0 V2 #define EX1 V3 #define EX2 V4 // key (r², r or 1 depending on context) #define R_0 V5 #define R_1 V6 #define R_2 V7 #define R_3 V8 #define R_4 V9 // precalculated coefficients (5r², 5r or 0 depending on context) #define R5_1 V10 #define R5_2 V11 #define R5_3 V12 #define R5_4 V13 // message block (m) #define M_0 V14 #define M_1 V15 #define M_2 V16 #define M_3 V17 #define M_4 V18 // accumulator (h) #define H_0 V19 #define H_1 V20 #define H_2 V21 #define H_3 V22 #define H_4 V23 // temporary registers (for short-lived values) #define T_0 V24 #define T_1 V25 #define T_2 V26 #define T_3 V27 #define T_4 V28 GLOBL ·constants<>(SB), RODATA, $0x30 // EX0 DATA ·constants<>+0x00(SB)/8, $0x0006050403020100 DATA ·constants<>+0x08(SB)/8, $0x1016151413121110 // EX1 DATA ·constants<>+0x10(SB)/8, $0x060c0b0a09080706 DATA ·constants<>+0x18(SB)/8, $0x161c1b1a19181716 // EX2 DATA ·constants<>+0x20(SB)/8, $0x0d0d0d0d0d0f0e0d DATA ·constants<>+0x28(SB)/8, $0x1d1d1d1d1d1f1e1d // MULTIPLY multiplies each lane of f and g, partially reduced // modulo 2¹³⁰ - 5. The result, h, consists of partial products // in each lane that need to be reduced further to produce the // final result. // // h₁₃₀ = (f₁₃₀g₁₃₀) % 2¹³⁰ + (5f₁₃₀g₁₃₀) / 2¹³⁰ // // Note that the multiplication by 5 of the high bits is // achieved by precalculating the multiplication of four of the // g coefficients by 5. These are g51-g54. #define MULTIPLY(f0, f1, f2, f3, f4, g0, g1, g2, g3, g4, g51, g52, g53, g54, h0, h1, h2, h3, h4) \ VMLOF f0, g0, h0 \ VMLOF f0, g3, h3 \ VMLOF f0, g1, h1 \ VMLOF f0, g4, h4 \ VMLOF f0, g2, h2 \ VMLOF f1, g54, T_0 \ VMLOF f1, g2, T_3 \ VMLOF f1, g0, T_1 \ VMLOF f1, g3, T_4 \ VMLOF f1, g1, T_2 \ VMALOF f2, g53, h0, h0 \ VMALOF f2, g1, h3, h3 \ VMALOF f2, g54, h1, h1 \ VMALOF f2, g2, h4, h4 \ VMALOF f2, g0, h2, h2 \ VMALOF f3, g52, T_0, T_0 \ VMALOF f3, g0, T_3, T_3 \ VMALOF f3, g53, T_1, T_1 \ VMALOF f3, g1, T_4, T_4 \ VMALOF f3, g54, T_2, T_2 \ VMALOF f4, g51, h0, h0 \ VMALOF f4, g54, h3, h3 \ VMALOF f4, g52, h1, h1 \ VMALOF f4, g0, h4, h4 \ VMALOF f4, g53, h2, h2 \ VAG T_0, h0, h0 \ VAG T_3, h3, h3 \ VAG T_1, h1, h1 \ VAG T_4, h4, h4 \ VAG T_2, h2, h2 // REDUCE performs the following carry operations in four // stages, as specified in Bernstein & Schwabe: // // 1: h₂₆[0]->h₂₆[1] h₂₆[3]->h₂₆[4] // 2: h₂₆[1]->h₂₆[2] h₂₆[4]->h₂₆[0] // 3: h₂₆[0]->h₂₆[1] h₂₆[2]->h₂₆[3] // 4: h₂₆[3]->h₂₆[4] // // The result is that all of the limbs are limited to 26-bits // except for h₂₆[1] and h₂₆[4] which are limited to 27-bits. // // Note that although each limb is aligned at 26-bit intervals // they may contain values that exceed 2²⁶ - 1, hence the need // to carry the excess bits in each limb. #define REDUCE(h0, h1, h2, h3, h4) \ VESRLG $26, h0, T_0 \ VESRLG $26, h3, T_1 \ VN MOD26, h0, h0 \ VN MOD26, h3, h3 \ VAG T_0, h1, h1 \ VAG T_1, h4, h4 \ VESRLG $26, h1, T_2 \ VESRLG $26, h4, T_3 \ VN MOD26, h1, h1 \ VN MOD26, h4, h4 \ VESLG $2, T_3, T_4 \ VAG T_3, T_4, T_4 \ VAG T_2, h2, h2 \ VAG T_4, h0, h0 \ VESRLG $26, h2, T_0 \ VESRLG $26, h0, T_1 \ VN MOD26, h2, h2 \ VN MOD26, h0, h0 \ VAG T_0, h3, h3 \ VAG T_1, h1, h1 \ VESRLG $26, h3, T_2 \ VN MOD26, h3, h3 \ VAG T_2, h4, h4 // EXPAND splits the 128-bit little-endian values in0 and in1 // into 26-bit big-endian limbs and places the results into // the first and second lane of d₂₆[0:4] respectively. // // The EX0, EX1 and EX2 constants are arrays of byte indices // for permutation. The permutation both reverses the bytes // in the input and ensures the bytes are copied into the // destination limb ready to be shifted into their final // position. #define EXPAND(in0, in1, d0, d1, d2, d3, d4) \ VPERM in0, in1, EX0, d0 \ VPERM in0, in1, EX1, d2 \ VPERM in0, in1, EX2, d4 \ VESRLG $26, d0, d1 \ VESRLG $30, d2, d3 \ VESRLG $4, d2, d2 \ VN MOD26, d0, d0 \ // [in0₂₆[0], in1₂₆[0]] VN MOD26, d3, d3 \ // [in0₂₆[3], in1₂₆[3]] VN MOD26, d1, d1 \ // [in0₂₆[1], in1₂₆[1]] VN MOD24, d4, d4 \ // [in0₂₆[4], in1₂₆[4]] VN MOD26, d2, d2 // [in0₂₆[2], in1₂₆[2]] // func updateVX(state *macState, msg []byte) TEXT ·updateVX(SB), NOSPLIT, $0 MOVD state+0(FP), R1 LMG msg+8(FP), R2, R3 // R2=msg_base, R3=msg_len // load EX0, EX1 and EX2 MOVD $·constants<>(SB), R5 VLM (R5), EX0, EX2 // generate masks VGMG $(64-24), $63, MOD24 // [0x00ffffff, 0x00ffffff] VGMG $(64-26), $63, MOD26 // [0x03ffffff, 0x03ffffff] // load h (accumulator) and r (key) from state VZERO T_1 // [0, 0] VL 0(R1), T_0 // [h₆₄[0], h₆₄[1]] VLEG $0, 16(R1), T_1 // [h₆₄[2], 0] VL 24(R1), T_2 // [r₆₄[0], r₆₄[1]] VPDI $0, T_0, T_2, T_3 // [h₆₄[0], r₆₄[0]] VPDI $5, T_0, T_2, T_4 // [h₆₄[1], r₆₄[1]] // unpack h and r into 26-bit limbs // note: h₆₄[2] may have the low 3 bits set, so h₂₆[4] is a 27-bit value VN MOD26, T_3, H_0 // [h₂₆[0], r₂₆[0]] VZERO H_1 // [0, 0] VZERO H_3 // [0, 0] VGMG $(64-12-14), $(63-12), T_0 // [0x03fff000, 0x03fff000] - 26-bit mask with low 12 bits masked out VESLG $24, T_1, T_1 // [h₆₄[2]<<24, 0] VERIMG $-26&63, T_3, MOD26, H_1 // [h₂₆[1], r₂₆[1]] VESRLG $+52&63, T_3, H_2 // [h₂₆[2], r₂₆[2]] - low 12 bits only VERIMG $-14&63, T_4, MOD26, H_3 // [h₂₆[1], r₂₆[1]] VESRLG $40, T_4, H_4 // [h₂₆[4], r₂₆[4]] - low 24 bits only VERIMG $+12&63, T_4, T_0, H_2 // [h₂₆[2], r₂₆[2]] - complete VO T_1, H_4, H_4 // [h₂₆[4], r₂₆[4]] - complete // replicate r across all 4 vector elements VREPF $3, H_0, R_0 // [r₂₆[0], r₂₆[0], r₂₆[0], r₂₆[0]] VREPF $3, H_1, R_1 // [r₂₆[1], r₂₆[1], r₂₆[1], r₂₆[1]] VREPF $3, H_2, R_2 // [r₂₆[2], r₂₆[2], r₂₆[2], r₂₆[2]] VREPF $3, H_3, R_3 // [r₂₆[3], r₂₆[3], r₂₆[3], r₂₆[3]] VREPF $3, H_4, R_4 // [r₂₆[4], r₂₆[4], r₂₆[4], r₂₆[4]] // zero out lane 1 of h VLEIG $1, $0, H_0 // [h₂₆[0], 0] VLEIG $1, $0, H_1 // [h₂₆[1], 0] VLEIG $1, $0, H_2 // [h₂₆[2], 0] VLEIG $1, $0, H_3 // [h₂₆[3], 0] VLEIG $1, $0, H_4 // [h₂₆[4], 0] // calculate 5r (ignore least significant limb) VREPIF $5, T_0 VMLF T_0, R_1, R5_1 // [5r₂₆[1], 5r₂₆[1], 5r₂₆[1], 5r₂₆[1]] VMLF T_0, R_2, R5_2 // [5r₂₆[2], 5r₂₆[2], 5r₂₆[2], 5r₂₆[2]] VMLF T_0, R_3, R5_3 // [5r₂₆[3], 5r₂₆[3], 5r₂₆[3], 5r₂₆[3]] VMLF T_0, R_4, R5_4 // [5r₂₆[4], 5r₂₆[4], 5r₂₆[4], 5r₂₆[4]] // skip r² calculation if we are only calculating one block CMPBLE R3, $16, skip // calculate r² MULTIPLY(R_0, R_1, R_2, R_3, R_4, R_0, R_1, R_2, R_3, R_4, R5_1, R5_2, R5_3, R5_4, M_0, M_1, M_2, M_3, M_4) REDUCE(M_0, M_1, M_2, M_3, M_4) VGBM $0x0f0f, T_0 VERIMG $0, M_0, T_0, R_0 // [r₂₆[0], r²₂₆[0], r₂₆[0], r²₂₆[0]] VERIMG $0, M_1, T_0, R_1 // [r₂₆[1], r²₂₆[1], r₂₆[1], r²₂₆[1]] VERIMG $0, M_2, T_0, R_2 // [r₂₆[2], r²₂₆[2], r₂₆[2], r²₂₆[2]] VERIMG $0, M_3, T_0, R_3 // [r₂₆[3], r²₂₆[3], r₂₆[3], r²₂₆[3]] VERIMG $0, M_4, T_0, R_4 // [r₂₆[4], r²₂₆[4], r₂₆[4], r²₂₆[4]] // calculate 5r² (ignore least significant limb) VREPIF $5, T_0 VMLF T_0, R_1, R5_1 // [5r₂₆[1], 5r²₂₆[1], 5r₂₆[1], 5r²₂₆[1]] VMLF T_0, R_2, R5_2 // [5r₂₆[2], 5r²₂₆[2], 5r₂₆[2], 5r²₂₆[2]] VMLF T_0, R_3, R5_3 // [5r₂₆[3], 5r²₂₆[3], 5r₂₆[3], 5r²₂₆[3]] VMLF T_0, R_4, R5_4 // [5r₂₆[4], 5r²₂₆[4], 5r₂₆[4], 5r²₂₆[4]] loop: CMPBLE R3, $32, b2 // 2 or fewer blocks remaining, need to change key coefficients // load next 2 blocks from message VLM (R2), T_0, T_1 // update message slice SUB $32, R3 MOVD $32(R2), R2 // unpack message blocks into 26-bit big-endian limbs EXPAND(T_0, T_1, M_0, M_1, M_2, M_3, M_4) // add 2¹²⁸ to each message block value VLEIB $4, $1, M_4 VLEIB $12, $1, M_4 multiply: // accumulate the incoming message VAG H_0, M_0, M_0 VAG H_3, M_3, M_3 VAG H_1, M_1, M_1 VAG H_4, M_4, M_4 VAG H_2, M_2, M_2 // multiply the accumulator by the key coefficient MULTIPLY(M_0, M_1, M_2, M_3, M_4, R_0, R_1, R_2, R_3, R_4, R5_1, R5_2, R5_3, R5_4, H_0, H_1, H_2, H_3, H_4) // carry and partially reduce the partial products REDUCE(H_0, H_1, H_2, H_3, H_4) CMPBNE R3, $0, loop finish: // sum lane 0 and lane 1 and put the result in lane 1 VZERO T_0 VSUMQG H_0, T_0, H_0 VSUMQG H_3, T_0, H_3 VSUMQG H_1, T_0, H_1 VSUMQG H_4, T_0, H_4 VSUMQG H_2, T_0, H_2 // reduce again after summation // TODO(mundaym): there might be a more efficient way to do this // now that we only have 1 active lane. For example, we could // simultaneously pack the values as we reduce them. REDUCE(H_0, H_1, H_2, H_3, H_4) // carry h[1] through to h[4] so that only h[4] can exceed 2²⁶ - 1 // TODO(mundaym): in testing this final carry was unnecessary. // Needs a proof before it can be removed though. VESRLG $26, H_1, T_1 VN MOD26, H_1, H_1 VAQ T_1, H_2, H_2 VESRLG $26, H_2, T_2 VN MOD26, H_2, H_2 VAQ T_2, H_3, H_3 VESRLG $26, H_3, T_3 VN MOD26, H_3, H_3 VAQ T_3, H_4, H_4 // h is now < 2(2¹³⁰ - 5) // Pack each lane in h₂₆[0:4] into h₁₂₈[0:1]. VESLG $26, H_1, H_1 VESLG $26, H_3, H_3 VO H_0, H_1, H_0 VO H_2, H_3, H_2 VESLG $4, H_2, H_2 VLEIB $7, $48, H_1 VSLB H_1, H_2, H_2 VO H_0, H_2, H_0 VLEIB $7, $104, H_1 VSLB H_1, H_4, H_3 VO H_3, H_0, H_0 VLEIB $7, $24, H_1 VSRLB H_1, H_4, H_1 // update state VSTEG $1, H_0, 0(R1) VSTEG $0, H_0, 8(R1) VSTEG $1, H_1, 16(R1) RET b2: // 2 or fewer blocks remaining CMPBLE R3, $16, b1 // Load the 2 remaining blocks (17-32 bytes remaining). MOVD $-17(R3), R0 // index of final byte to load modulo 16 VL (R2), T_0 // load full 16 byte block VLL R0, 16(R2), T_1 // load final (possibly partial) block and pad with zeros to 16 bytes // The Poly1305 algorithm requires that a 1 bit be appended to // each message block. If the final block is less than 16 bytes // long then it is easiest to insert the 1 before the message // block is split into 26-bit limbs. If, on the other hand, the // final message block is 16 bytes long then we append the 1 bit // after expansion as normal. MOVBZ $1, R0 MOVD $-16(R3), R3 // index of byte in last block to insert 1 at (could be 16) CMPBEQ R3, $16, 2(PC) // skip the insertion if the final block is 16 bytes long VLVGB R3, R0, T_1 // insert 1 into the byte at index R3 // Split both blocks into 26-bit limbs in the appropriate lanes. EXPAND(T_0, T_1, M_0, M_1, M_2, M_3, M_4) // Append a 1 byte to the end of the second to last block. VLEIB $4, $1, M_4 // Append a 1 byte to the end of the last block only if it is a // full 16 byte block. CMPBNE R3, $16, 2(PC) VLEIB $12, $1, M_4 // Finally, set up the coefficients for the final multiplication. // We have previously saved r and 5r in the 32-bit even indexes // of the R_[0-4] and R5_[1-4] coefficient registers. // // We want lane 0 to be multiplied by r² so that can be kept the // same. We want lane 1 to be multiplied by r so we need to move // the saved r value into the 32-bit odd index in lane 1 by // rotating the 64-bit lane by 32. VGBM $0x00ff, T_0 // [0, 0xffffffffffffffff] - mask lane 1 only VERIMG $32, R_0, T_0, R_0 // [_, r²₂₆[0], _, r₂₆[0]] VERIMG $32, R_1, T_0, R_1 // [_, r²₂₆[1], _, r₂₆[1]] VERIMG $32, R_2, T_0, R_2 // [_, r²₂₆[2], _, r₂₆[2]] VERIMG $32, R_3, T_0, R_3 // [_, r²₂₆[3], _, r₂₆[3]] VERIMG $32, R_4, T_0, R_4 // [_, r²₂₆[4], _, r₂₆[4]] VERIMG $32, R5_1, T_0, R5_1 // [_, 5r²₂₆[1], _, 5r₂₆[1]] VERIMG $32, R5_2, T_0, R5_2 // [_, 5r²₂₆[2], _, 5r₂₆[2]] VERIMG $32, R5_3, T_0, R5_3 // [_, 5r²₂₆[3], _, 5r₂₆[3]] VERIMG $32, R5_4, T_0, R5_4 // [_, 5r²₂₆[4], _, 5r₂₆[4]] MOVD $0, R3 BR multiply skip: CMPBEQ R3, $0, finish b1: // 1 block remaining // Load the final block (1-16 bytes). This will be placed into // lane 0. MOVD $-1(R3), R0 VLL R0, (R2), T_0 // pad to 16 bytes with zeros // The Poly1305 algorithm requires that a 1 bit be appended to // each message block. If the final block is less than 16 bytes // long then it is easiest to insert the 1 before the message // block is split into 26-bit limbs. If, on the other hand, the // final message block is 16 bytes long then we append the 1 bit // after expansion as normal. MOVBZ $1, R0 CMPBEQ R3, $16, 2(PC) VLVGB R3, R0, T_0 // Set the message block in lane 1 to the value 0 so that it // can be accumulated without affecting the final result. VZERO T_1 // Split the final message block into 26-bit limbs in lane 0. // Lane 1 will be contain 0. EXPAND(T_0, T_1, M_0, M_1, M_2, M_3, M_4) // Append a 1 byte to the end of the last block only if it is a // full 16 byte block. CMPBNE R3, $16, 2(PC) VLEIB $4, $1, M_4 // We have previously saved r and 5r in the 32-bit even indexes // of the R_[0-4] and R5_[1-4] coefficient registers. // // We want lane 0 to be multiplied by r so we need to move the // saved r value into the 32-bit odd index in lane 0. We want // lane 1 to be set to the value 1. This makes multiplication // a no-op. We do this by setting lane 1 in every register to 0 // and then just setting the 32-bit index 3 in R_0 to 1. VZERO T_0 MOVD $0, R0 MOVD $0x10111213, R12 VLVGP R12, R0, T_1 // [_, 0x10111213, _, 0x00000000] VPERM T_0, R_0, T_1, R_0 // [_, r₂₆[0], _, 0] VPERM T_0, R_1, T_1, R_1 // [_, r₂₆[1], _, 0] VPERM T_0, R_2, T_1, R_2 // [_, r₂₆[2], _, 0] VPERM T_0, R_3, T_1, R_3 // [_, r₂₆[3], _, 0] VPERM T_0, R_4, T_1, R_4 // [_, r₂₆[4], _, 0] VPERM T_0, R5_1, T_1, R5_1 // [_, 5r₂₆[1], _, 0] VPERM T_0, R5_2, T_1, R5_2 // [_, 5r₂₆[2], _, 0] VPERM T_0, R5_3, T_1, R5_3 // [_, 5r₂₆[3], _, 0] VPERM T_0, R5_4, T_1, R5_4 // [_, 5r₂₆[4], _, 0] // Set the value of lane 1 to be 1. VLEIF $3, $1, R_0 // [_, r₂₆[0], _, 1] MOVD $0, R3 BR multiply ================================================ FILE: vendor/golang.org/x/crypto/nacl/secretbox/secretbox.go ================================================ // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Package secretbox encrypts and authenticates small messages. Secretbox uses XSalsa20 and Poly1305 to encrypt and authenticate messages with secret-key cryptography. The length of messages is not hidden. It is the caller's responsibility to ensure the uniqueness of nonces—for example, by using nonce 1 for the first message, nonce 2 for the second message, etc. Nonces are long enough that randomly generated nonces have negligible risk of collision. Messages should be small because: 1. The whole message needs to be held in memory to be processed. 2. Using large messages pressures implementations on small machines to decrypt and process plaintext before authenticating it. This is very dangerous, and this API does not allow it, but a protocol that uses excessive message sizes might present some implementations with no other choice. 3. Fixed overheads will be sufficiently amortised by messages as small as 8KB. 4. Performance may be improved by working with messages that fit into data caches. Thus large amounts of data should be chunked so that each message is small. (Each message still needs a unique nonce.) If in doubt, 16KB is a reasonable chunk size. This package is interoperable with NaCl: https://nacl.cr.yp.to/secretbox.html. */ package secretbox import ( "golang.org/x/crypto/internal/alias" "golang.org/x/crypto/internal/poly1305" "golang.org/x/crypto/salsa20/salsa" ) // Overhead is the number of bytes of overhead when boxing a message. const Overhead = poly1305.TagSize // setup produces a sub-key and Salsa20 counter given a nonce and key. func setup(subKey *[32]byte, counter *[16]byte, nonce *[24]byte, key *[32]byte) { // We use XSalsa20 for encryption so first we need to generate a // key and nonce with HSalsa20. var hNonce [16]byte copy(hNonce[:], nonce[:]) salsa.HSalsa20(subKey, &hNonce, key, &salsa.Sigma) // The final 8 bytes of the original nonce form the new nonce. copy(counter[:], nonce[16:]) } // sliceForAppend takes a slice and a requested number of bytes. It returns a // slice with the contents of the given slice followed by that many bytes and a // second slice that aliases into it and contains only the extra bytes. If the // original slice has sufficient capacity then no allocation is performed. func sliceForAppend(in []byte, n int) (head, tail []byte) { if total := len(in) + n; cap(in) >= total { head = in[:total] } else { head = make([]byte, total) copy(head, in) } tail = head[len(in):] return } // Seal appends an encrypted and authenticated copy of message to out, which // must not overlap message. The key and nonce pair must be unique for each // distinct message and the output will be Overhead bytes longer than message. func Seal(out, message []byte, nonce *[24]byte, key *[32]byte) []byte { var subKey [32]byte var counter [16]byte setup(&subKey, &counter, nonce, key) // The Poly1305 key is generated by encrypting 32 bytes of zeros. Since // Salsa20 works with 64-byte blocks, we also generate 32 bytes of // keystream as a side effect. var firstBlock [64]byte salsa.XORKeyStream(firstBlock[:], firstBlock[:], &counter, &subKey) var poly1305Key [32]byte copy(poly1305Key[:], firstBlock[:]) ret, out := sliceForAppend(out, len(message)+poly1305.TagSize) if alias.AnyOverlap(out, message) { panic("nacl: invalid buffer overlap") } // We XOR up to 32 bytes of message with the keystream generated from // the first block. firstMessageBlock := message if len(firstMessageBlock) > 32 { firstMessageBlock = firstMessageBlock[:32] } tagOut := out out = out[poly1305.TagSize:] for i, x := range firstMessageBlock { out[i] = firstBlock[32+i] ^ x } message = message[len(firstMessageBlock):] ciphertext := out out = out[len(firstMessageBlock):] // Now encrypt the rest. counter[8] = 1 salsa.XORKeyStream(out, message, &counter, &subKey) var tag [poly1305.TagSize]byte poly1305.Sum(&tag, ciphertext, &poly1305Key) copy(tagOut, tag[:]) return ret } // Open authenticates and decrypts a box produced by Seal and appends the // message to out, which must not overlap box. The output will be Overhead // bytes smaller than box. func Open(out, box []byte, nonce *[24]byte, key *[32]byte) ([]byte, bool) { if len(box) < Overhead { return nil, false } var subKey [32]byte var counter [16]byte setup(&subKey, &counter, nonce, key) // The Poly1305 key is generated by encrypting 32 bytes of zeros. Since // Salsa20 works with 64-byte blocks, we also generate 32 bytes of // keystream as a side effect. var firstBlock [64]byte salsa.XORKeyStream(firstBlock[:], firstBlock[:], &counter, &subKey) var poly1305Key [32]byte copy(poly1305Key[:], firstBlock[:]) var tag [poly1305.TagSize]byte copy(tag[:], box) if !poly1305.Verify(&tag, box[poly1305.TagSize:], &poly1305Key) { return nil, false } ret, out := sliceForAppend(out, len(box)-Overhead) if alias.AnyOverlap(out, box) { panic("nacl: invalid buffer overlap") } // We XOR up to 32 bytes of box with the keystream generated from // the first block. box = box[Overhead:] firstMessageBlock := box if len(firstMessageBlock) > 32 { firstMessageBlock = firstMessageBlock[:32] } for i, x := range firstMessageBlock { out[i] = firstBlock[32+i] ^ x } box = box[len(firstMessageBlock):] out = out[len(firstMessageBlock):] // Now decrypt the rest. counter[8] = 1 salsa.XORKeyStream(out, box, &counter, &subKey) return ret, true } ================================================ FILE: vendor/golang.org/x/crypto/openpgp/armor/armor.go ================================================ // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package armor implements OpenPGP ASCII Armor, see RFC 4880. OpenPGP Armor is // very similar to PEM except that it has an additional CRC checksum. // // Deprecated: this package is unmaintained except for security fixes. New // applications should consider a more focused, modern alternative to OpenPGP // for their specific task. If you are required to interoperate with OpenPGP // systems and need a maintained package, consider a community fork. // See https://golang.org/issue/44226. package armor import ( "bufio" "bytes" "encoding/base64" "io" "golang.org/x/crypto/openpgp/errors" ) // A Block represents an OpenPGP armored structure. // // The encoded form is: // // -----BEGIN Type----- // Headers // // base64-encoded Bytes // '=' base64 encoded checksum // -----END Type----- // // where Headers is a possibly empty sequence of Key: Value lines. // // Since the armored data can be very large, this package presents a streaming // interface. type Block struct { Type string // The type, taken from the preamble (i.e. "PGP SIGNATURE"). Header map[string]string // Optional headers. Body io.Reader // A Reader from which the contents can be read lReader lineReader oReader openpgpReader } var ArmorCorrupt error = errors.StructuralError("armor invalid") const crc24Init = 0xb704ce const crc24Poly = 0x1864cfb const crc24Mask = 0xffffff // crc24 calculates the OpenPGP checksum as specified in RFC 4880, section 6.1 func crc24(crc uint32, d []byte) uint32 { for _, b := range d { crc ^= uint32(b) << 16 for i := 0; i < 8; i++ { crc <<= 1 if crc&0x1000000 != 0 { crc ^= crc24Poly } } } return crc } var armorStart = []byte("-----BEGIN ") var armorEnd = []byte("-----END ") var armorEndOfLine = []byte("-----") // lineReader wraps a line based reader. It watches for the end of an armor // block and records the expected CRC value. type lineReader struct { in *bufio.Reader buf []byte eof bool crc uint32 crcSet bool } func (l *lineReader) Read(p []byte) (n int, err error) { if l.eof { return 0, io.EOF } if len(l.buf) > 0 { n = copy(p, l.buf) l.buf = l.buf[n:] return } line, isPrefix, err := l.in.ReadLine() if err != nil { return } if isPrefix { return 0, ArmorCorrupt } if bytes.HasPrefix(line, armorEnd) { l.eof = true return 0, io.EOF } if len(line) == 5 && line[0] == '=' { // This is the checksum line var expectedBytes [3]byte var m int m, err = base64.StdEncoding.Decode(expectedBytes[0:], line[1:]) if m != 3 || err != nil { return } l.crc = uint32(expectedBytes[0])<<16 | uint32(expectedBytes[1])<<8 | uint32(expectedBytes[2]) line, _, err = l.in.ReadLine() if err != nil && err != io.EOF { return } if !bytes.HasPrefix(line, armorEnd) { return 0, ArmorCorrupt } l.eof = true l.crcSet = true return 0, io.EOF } if len(line) > 96 { return 0, ArmorCorrupt } n = copy(p, line) bytesToSave := len(line) - n if bytesToSave > 0 { if cap(l.buf) < bytesToSave { l.buf = make([]byte, 0, bytesToSave) } l.buf = l.buf[0:bytesToSave] copy(l.buf, line[n:]) } return } // openpgpReader passes Read calls to the underlying base64 decoder, but keeps // a running CRC of the resulting data and checks the CRC against the value // found by the lineReader at EOF. type openpgpReader struct { lReader *lineReader b64Reader io.Reader currentCRC uint32 } func (r *openpgpReader) Read(p []byte) (n int, err error) { n, err = r.b64Reader.Read(p) r.currentCRC = crc24(r.currentCRC, p[:n]) if err == io.EOF && r.lReader.crcSet && r.lReader.crc != r.currentCRC&crc24Mask { return 0, ArmorCorrupt } return } // Decode reads a PGP armored block from the given Reader. It will ignore // leading garbage. If it doesn't find a block, it will return nil, io.EOF. The // given Reader is not usable after calling this function: an arbitrary amount // of data may have been read past the end of the block. func Decode(in io.Reader) (p *Block, err error) { r := bufio.NewReaderSize(in, 100) var line []byte ignoreNext := false TryNextBlock: p = nil // Skip leading garbage for { ignoreThis := ignoreNext line, ignoreNext, err = r.ReadLine() if err != nil { return } if ignoreNext || ignoreThis { continue } line = bytes.TrimSpace(line) if len(line) > len(armorStart)+len(armorEndOfLine) && bytes.HasPrefix(line, armorStart) { break } } p = new(Block) p.Type = string(line[len(armorStart) : len(line)-len(armorEndOfLine)]) p.Header = make(map[string]string) nextIsContinuation := false var lastKey string // Read headers for { isContinuation := nextIsContinuation line, nextIsContinuation, err = r.ReadLine() if err != nil { p = nil return } if isContinuation { p.Header[lastKey] += string(line) continue } line = bytes.TrimSpace(line) if len(line) == 0 { break } i := bytes.Index(line, []byte(": ")) if i == -1 { goto TryNextBlock } lastKey = string(line[:i]) p.Header[lastKey] = string(line[i+2:]) } p.lReader.in = r p.oReader.currentCRC = crc24Init p.oReader.lReader = &p.lReader p.oReader.b64Reader = base64.NewDecoder(base64.StdEncoding, &p.lReader) p.Body = &p.oReader return } ================================================ FILE: vendor/golang.org/x/crypto/openpgp/armor/encode.go ================================================ // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package armor import ( "encoding/base64" "io" ) var armorHeaderSep = []byte(": ") var blockEnd = []byte("\n=") var newline = []byte("\n") var armorEndOfLineOut = []byte("-----\n") // writeSlices writes its arguments to the given Writer. func writeSlices(out io.Writer, slices ...[]byte) (err error) { for _, s := range slices { _, err = out.Write(s) if err != nil { return err } } return } // lineBreaker breaks data across several lines, all of the same byte length // (except possibly the last). Lines are broken with a single '\n'. type lineBreaker struct { lineLength int line []byte used int out io.Writer haveWritten bool } func newLineBreaker(out io.Writer, lineLength int) *lineBreaker { return &lineBreaker{ lineLength: lineLength, line: make([]byte, lineLength), used: 0, out: out, } } func (l *lineBreaker) Write(b []byte) (n int, err error) { n = len(b) if n == 0 { return } if l.used == 0 && l.haveWritten { _, err = l.out.Write([]byte{'\n'}) if err != nil { return } } if l.used+len(b) < l.lineLength { l.used += copy(l.line[l.used:], b) return } l.haveWritten = true _, err = l.out.Write(l.line[0:l.used]) if err != nil { return } excess := l.lineLength - l.used l.used = 0 _, err = l.out.Write(b[0:excess]) if err != nil { return } _, err = l.Write(b[excess:]) return } func (l *lineBreaker) Close() (err error) { if l.used > 0 { _, err = l.out.Write(l.line[0:l.used]) if err != nil { return } } return } // encoding keeps track of a running CRC24 over the data which has been written // to it and outputs a OpenPGP checksum when closed, followed by an armor // trailer. // // It's built into a stack of io.Writers: // // encoding -> base64 encoder -> lineBreaker -> out type encoding struct { out io.Writer breaker *lineBreaker b64 io.WriteCloser crc uint32 blockType []byte } func (e *encoding) Write(data []byte) (n int, err error) { e.crc = crc24(e.crc, data) return e.b64.Write(data) } func (e *encoding) Close() (err error) { err = e.b64.Close() if err != nil { return } e.breaker.Close() var checksumBytes [3]byte checksumBytes[0] = byte(e.crc >> 16) checksumBytes[1] = byte(e.crc >> 8) checksumBytes[2] = byte(e.crc) var b64ChecksumBytes [4]byte base64.StdEncoding.Encode(b64ChecksumBytes[:], checksumBytes[:]) return writeSlices(e.out, blockEnd, b64ChecksumBytes[:], newline, armorEnd, e.blockType, armorEndOfLine) } // Encode returns a WriteCloser which will encode the data written to it in // OpenPGP armor. func Encode(out io.Writer, blockType string, headers map[string]string) (w io.WriteCloser, err error) { bType := []byte(blockType) err = writeSlices(out, armorStart, bType, armorEndOfLineOut) if err != nil { return } for k, v := range headers { err = writeSlices(out, []byte(k), armorHeaderSep, []byte(v), newline) if err != nil { return } } _, err = out.Write(newline) if err != nil { return } e := &encoding{ out: out, breaker: newLineBreaker(out, 64), crc: crc24Init, blockType: bType, } e.b64 = base64.NewEncoder(base64.StdEncoding, e.breaker) return e, nil } ================================================ FILE: vendor/golang.org/x/crypto/openpgp/canonical_text.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package openpgp import "hash" // NewCanonicalTextHash reformats text written to it into the canonical // form and then applies the hash h. See RFC 4880, section 5.2.1. func NewCanonicalTextHash(h hash.Hash) hash.Hash { return &canonicalTextHash{h, 0} } type canonicalTextHash struct { h hash.Hash s int } var newline = []byte{'\r', '\n'} func (cth *canonicalTextHash) Write(buf []byte) (int, error) { start := 0 for i, c := range buf { switch cth.s { case 0: if c == '\r' { cth.s = 1 } else if c == '\n' { cth.h.Write(buf[start:i]) cth.h.Write(newline) start = i + 1 } case 1: cth.s = 0 } } cth.h.Write(buf[start:]) return len(buf), nil } func (cth *canonicalTextHash) Sum(in []byte) []byte { return cth.h.Sum(in) } func (cth *canonicalTextHash) Reset() { cth.h.Reset() cth.s = 0 } func (cth *canonicalTextHash) Size() int { return cth.h.Size() } func (cth *canonicalTextHash) BlockSize() int { return cth.h.BlockSize() } ================================================ FILE: vendor/golang.org/x/crypto/openpgp/elgamal/elgamal.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package elgamal implements ElGamal encryption, suitable for OpenPGP, // as specified in "A Public-Key Cryptosystem and a Signature Scheme Based on // Discrete Logarithms," IEEE Transactions on Information Theory, v. IT-31, // n. 4, 1985, pp. 469-472. // // This form of ElGamal embeds PKCS#1 v1.5 padding, which may make it // unsuitable for other protocols. RSA should be used in preference in any // case. // // Deprecated: this package was only provided to support ElGamal encryption in // OpenPGP. The golang.org/x/crypto/openpgp package is now deprecated (see // https://golang.org/issue/44226), and ElGamal in the OpenPGP ecosystem has // compatibility and security issues (see https://eprint.iacr.org/2021/923). // Moreover, this package doesn't protect against side-channel attacks. package elgamal import ( "crypto/rand" "crypto/subtle" "errors" "io" "math/big" ) // PublicKey represents an ElGamal public key. type PublicKey struct { G, P, Y *big.Int } // PrivateKey represents an ElGamal private key. type PrivateKey struct { PublicKey X *big.Int } // Encrypt encrypts the given message to the given public key. The result is a // pair of integers. Errors can result from reading random, or because msg is // too large to be encrypted to the public key. func Encrypt(random io.Reader, pub *PublicKey, msg []byte) (c1, c2 *big.Int, err error) { pLen := (pub.P.BitLen() + 7) / 8 if len(msg) > pLen-11 { err = errors.New("elgamal: message too long") return } // EM = 0x02 || PS || 0x00 || M em := make([]byte, pLen-1) em[0] = 2 ps, mm := em[1:len(em)-len(msg)-1], em[len(em)-len(msg):] err = nonZeroRandomBytes(ps, random) if err != nil { return } em[len(em)-len(msg)-1] = 0 copy(mm, msg) m := new(big.Int).SetBytes(em) k, err := rand.Int(random, pub.P) if err != nil { return } c1 = new(big.Int).Exp(pub.G, k, pub.P) s := new(big.Int).Exp(pub.Y, k, pub.P) c2 = s.Mul(s, m) c2.Mod(c2, pub.P) return } // Decrypt takes two integers, resulting from an ElGamal encryption, and // returns the plaintext of the message. An error can result only if the // ciphertext is invalid. Users should keep in mind that this is a padding // oracle and thus, if exposed to an adaptive chosen ciphertext attack, can // be used to break the cryptosystem. See “Chosen Ciphertext Attacks // Against Protocols Based on the RSA Encryption Standard PKCS #1”, Daniel // Bleichenbacher, Advances in Cryptology (Crypto '98), func Decrypt(priv *PrivateKey, c1, c2 *big.Int) (msg []byte, err error) { s := new(big.Int).Exp(c1, priv.X, priv.P) if s.ModInverse(s, priv.P) == nil { return nil, errors.New("elgamal: invalid private key") } s.Mul(s, c2) s.Mod(s, priv.P) em := s.Bytes() firstByteIsTwo := subtle.ConstantTimeByteEq(em[0], 2) // The remainder of the plaintext must be a string of non-zero random // octets, followed by a 0, followed by the message. // lookingForIndex: 1 iff we are still looking for the zero. // index: the offset of the first zero byte. var lookingForIndex, index int lookingForIndex = 1 for i := 1; i < len(em); i++ { equals0 := subtle.ConstantTimeByteEq(em[i], 0) index = subtle.ConstantTimeSelect(lookingForIndex&equals0, i, index) lookingForIndex = subtle.ConstantTimeSelect(equals0, 0, lookingForIndex) } if firstByteIsTwo != 1 || lookingForIndex != 0 || index < 9 { return nil, errors.New("elgamal: decryption error") } return em[index+1:], nil } // nonZeroRandomBytes fills the given slice with non-zero random octets. func nonZeroRandomBytes(s []byte, rand io.Reader) (err error) { _, err = io.ReadFull(rand, s) if err != nil { return } for i := 0; i < len(s); i++ { for s[i] == 0 { _, err = io.ReadFull(rand, s[i:i+1]) if err != nil { return } } } return } ================================================ FILE: vendor/golang.org/x/crypto/openpgp/errors/errors.go ================================================ // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package errors contains common error types for the OpenPGP packages. // // Deprecated: this package is unmaintained except for security fixes. New // applications should consider a more focused, modern alternative to OpenPGP // for their specific task. If you are required to interoperate with OpenPGP // systems and need a maintained package, consider a community fork. // See https://golang.org/issue/44226. package errors import ( "strconv" ) // A StructuralError is returned when OpenPGP data is found to be syntactically // invalid. type StructuralError string func (s StructuralError) Error() string { return "openpgp: invalid data: " + string(s) } // UnsupportedError indicates that, although the OpenPGP data is valid, it // makes use of currently unimplemented features. type UnsupportedError string func (s UnsupportedError) Error() string { return "openpgp: unsupported feature: " + string(s) } // InvalidArgumentError indicates that the caller is in error and passed an // incorrect value. type InvalidArgumentError string func (i InvalidArgumentError) Error() string { return "openpgp: invalid argument: " + string(i) } // SignatureError indicates that a syntactically valid signature failed to // validate. type SignatureError string func (b SignatureError) Error() string { return "openpgp: invalid signature: " + string(b) } type keyIncorrectError int func (ki keyIncorrectError) Error() string { return "openpgp: incorrect key" } var ErrKeyIncorrect error = keyIncorrectError(0) type unknownIssuerError int func (unknownIssuerError) Error() string { return "openpgp: signature made by unknown entity" } var ErrUnknownIssuer error = unknownIssuerError(0) type keyRevokedError int func (keyRevokedError) Error() string { return "openpgp: signature made by revoked key" } var ErrKeyRevoked error = keyRevokedError(0) type UnknownPacketTypeError uint8 func (upte UnknownPacketTypeError) Error() string { return "openpgp: unknown packet type: " + strconv.Itoa(int(upte)) } ================================================ FILE: vendor/golang.org/x/crypto/openpgp/keys.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package openpgp import ( "crypto/rsa" "io" "time" "golang.org/x/crypto/openpgp/armor" "golang.org/x/crypto/openpgp/errors" "golang.org/x/crypto/openpgp/packet" ) // PublicKeyType is the armor type for a PGP public key. var PublicKeyType = "PGP PUBLIC KEY BLOCK" // PrivateKeyType is the armor type for a PGP private key. var PrivateKeyType = "PGP PRIVATE KEY BLOCK" // An Entity represents the components of an OpenPGP key: a primary public key // (which must be a signing key), one or more identities claimed by that key, // and zero or more subkeys, which may be encryption keys. type Entity struct { PrimaryKey *packet.PublicKey PrivateKey *packet.PrivateKey Identities map[string]*Identity // indexed by Identity.Name Revocations []*packet.Signature Subkeys []Subkey } // An Identity represents an identity claimed by an Entity and zero or more // assertions by other entities about that claim. type Identity struct { Name string // by convention, has the form "Full Name (comment) " UserId *packet.UserId SelfSignature *packet.Signature Signatures []*packet.Signature } // A Subkey is an additional public key in an Entity. Subkeys can be used for // encryption. type Subkey struct { PublicKey *packet.PublicKey PrivateKey *packet.PrivateKey Sig *packet.Signature } // A Key identifies a specific public key in an Entity. This is either the // Entity's primary key or a subkey. type Key struct { Entity *Entity PublicKey *packet.PublicKey PrivateKey *packet.PrivateKey SelfSignature *packet.Signature } // A KeyRing provides access to public and private keys. type KeyRing interface { // KeysById returns the set of keys that have the given key id. KeysById(id uint64) []Key // KeysByIdUsage returns the set of keys with the given id // that also meet the key usage given by requiredUsage. // The requiredUsage is expressed as the bitwise-OR of // packet.KeyFlag* values. KeysByIdUsage(id uint64, requiredUsage byte) []Key // DecryptionKeys returns all private keys that are valid for // decryption. DecryptionKeys() []Key } // primaryIdentity returns the Identity marked as primary or the first identity // if none are so marked. func (e *Entity) primaryIdentity() *Identity { var firstIdentity *Identity for _, ident := range e.Identities { if firstIdentity == nil { firstIdentity = ident } if ident.SelfSignature.IsPrimaryId != nil && *ident.SelfSignature.IsPrimaryId { return ident } } return firstIdentity } // encryptionKey returns the best candidate Key for encrypting a message to the // given Entity. func (e *Entity) encryptionKey(now time.Time) (Key, bool) { candidateSubkey := -1 // Iterate the keys to find the newest key var maxTime time.Time for i, subkey := range e.Subkeys { if subkey.Sig.FlagsValid && subkey.Sig.FlagEncryptCommunications && subkey.PublicKey.PubKeyAlgo.CanEncrypt() && !subkey.Sig.KeyExpired(now) && (maxTime.IsZero() || subkey.Sig.CreationTime.After(maxTime)) { candidateSubkey = i maxTime = subkey.Sig.CreationTime } } if candidateSubkey != -1 { subkey := e.Subkeys[candidateSubkey] return Key{e, subkey.PublicKey, subkey.PrivateKey, subkey.Sig}, true } // If we don't have any candidate subkeys for encryption and // the primary key doesn't have any usage metadata then we // assume that the primary key is ok. Or, if the primary key is // marked as ok to encrypt to, then we can obviously use it. i := e.primaryIdentity() if !i.SelfSignature.FlagsValid || i.SelfSignature.FlagEncryptCommunications && e.PrimaryKey.PubKeyAlgo.CanEncrypt() && !i.SelfSignature.KeyExpired(now) { return Key{e, e.PrimaryKey, e.PrivateKey, i.SelfSignature}, true } // This Entity appears to be signing only. return Key{}, false } // signingKey return the best candidate Key for signing a message with this // Entity. func (e *Entity) signingKey(now time.Time) (Key, bool) { candidateSubkey := -1 for i, subkey := range e.Subkeys { if subkey.Sig.FlagsValid && subkey.Sig.FlagSign && subkey.PublicKey.PubKeyAlgo.CanSign() && !subkey.Sig.KeyExpired(now) { candidateSubkey = i break } } if candidateSubkey != -1 { subkey := e.Subkeys[candidateSubkey] return Key{e, subkey.PublicKey, subkey.PrivateKey, subkey.Sig}, true } // If we have no candidate subkey then we assume that it's ok to sign // with the primary key. i := e.primaryIdentity() if !i.SelfSignature.FlagsValid || i.SelfSignature.FlagSign && !i.SelfSignature.KeyExpired(now) { return Key{e, e.PrimaryKey, e.PrivateKey, i.SelfSignature}, true } return Key{}, false } // An EntityList contains one or more Entities. type EntityList []*Entity // KeysById returns the set of keys that have the given key id. func (el EntityList) KeysById(id uint64) (keys []Key) { for _, e := range el { if e.PrimaryKey.KeyId == id { var selfSig *packet.Signature for _, ident := range e.Identities { if selfSig == nil { selfSig = ident.SelfSignature } else if ident.SelfSignature.IsPrimaryId != nil && *ident.SelfSignature.IsPrimaryId { selfSig = ident.SelfSignature break } } keys = append(keys, Key{e, e.PrimaryKey, e.PrivateKey, selfSig}) } for _, subKey := range e.Subkeys { if subKey.PublicKey.KeyId == id { keys = append(keys, Key{e, subKey.PublicKey, subKey.PrivateKey, subKey.Sig}) } } } return } // KeysByIdUsage returns the set of keys with the given id that also meet // the key usage given by requiredUsage. The requiredUsage is expressed as // the bitwise-OR of packet.KeyFlag* values. func (el EntityList) KeysByIdUsage(id uint64, requiredUsage byte) (keys []Key) { for _, key := range el.KeysById(id) { if len(key.Entity.Revocations) > 0 { continue } if key.SelfSignature.RevocationReason != nil { continue } if key.SelfSignature.FlagsValid && requiredUsage != 0 { var usage byte if key.SelfSignature.FlagCertify { usage |= packet.KeyFlagCertify } if key.SelfSignature.FlagSign { usage |= packet.KeyFlagSign } if key.SelfSignature.FlagEncryptCommunications { usage |= packet.KeyFlagEncryptCommunications } if key.SelfSignature.FlagEncryptStorage { usage |= packet.KeyFlagEncryptStorage } if usage&requiredUsage != requiredUsage { continue } } keys = append(keys, key) } return } // DecryptionKeys returns all private keys that are valid for decryption. func (el EntityList) DecryptionKeys() (keys []Key) { for _, e := range el { for _, subKey := range e.Subkeys { if subKey.PrivateKey != nil && (!subKey.Sig.FlagsValid || subKey.Sig.FlagEncryptStorage || subKey.Sig.FlagEncryptCommunications) { keys = append(keys, Key{e, subKey.PublicKey, subKey.PrivateKey, subKey.Sig}) } } } return } // ReadArmoredKeyRing reads one or more public/private keys from an armor keyring file. func ReadArmoredKeyRing(r io.Reader) (EntityList, error) { block, err := armor.Decode(r) if err == io.EOF { return nil, errors.InvalidArgumentError("no armored data found") } if err != nil { return nil, err } if block.Type != PublicKeyType && block.Type != PrivateKeyType { return nil, errors.InvalidArgumentError("expected public or private key block, got: " + block.Type) } return ReadKeyRing(block.Body) } // ReadKeyRing reads one or more public/private keys. Unsupported keys are // ignored as long as at least a single valid key is found. func ReadKeyRing(r io.Reader) (el EntityList, err error) { packets := packet.NewReader(r) var lastUnsupportedError error for { var e *Entity e, err = ReadEntity(packets) if err != nil { // TODO: warn about skipped unsupported/unreadable keys if _, ok := err.(errors.UnsupportedError); ok { lastUnsupportedError = err err = readToNextPublicKey(packets) } else if _, ok := err.(errors.StructuralError); ok { // Skip unreadable, badly-formatted keys lastUnsupportedError = err err = readToNextPublicKey(packets) } if err == io.EOF { err = nil break } if err != nil { el = nil break } } else { el = append(el, e) } } if len(el) == 0 && err == nil { err = lastUnsupportedError } return } // readToNextPublicKey reads packets until the start of the entity and leaves // the first packet of the new entity in the Reader. func readToNextPublicKey(packets *packet.Reader) (err error) { var p packet.Packet for { p, err = packets.Next() if err == io.EOF { return } else if err != nil { if _, ok := err.(errors.UnsupportedError); ok { err = nil continue } return } if pk, ok := p.(*packet.PublicKey); ok && !pk.IsSubkey { packets.Unread(p) return } } } // ReadEntity reads an entity (public key, identities, subkeys etc) from the // given Reader. func ReadEntity(packets *packet.Reader) (*Entity, error) { e := new(Entity) e.Identities = make(map[string]*Identity) p, err := packets.Next() if err != nil { return nil, err } var ok bool if e.PrimaryKey, ok = p.(*packet.PublicKey); !ok { if e.PrivateKey, ok = p.(*packet.PrivateKey); !ok { packets.Unread(p) return nil, errors.StructuralError("first packet was not a public/private key") } e.PrimaryKey = &e.PrivateKey.PublicKey } if !e.PrimaryKey.PubKeyAlgo.CanSign() { return nil, errors.StructuralError("primary key cannot be used for signatures") } var revocations []*packet.Signature EachPacket: for { p, err := packets.Next() if err == io.EOF { break } else if err != nil { return nil, err } switch pkt := p.(type) { case *packet.UserId: if err := addUserID(e, packets, pkt); err != nil { return nil, err } case *packet.Signature: if pkt.SigType == packet.SigTypeKeyRevocation { revocations = append(revocations, pkt) } else if pkt.SigType == packet.SigTypeDirectSignature { // TODO: RFC4880 5.2.1 permits signatures // directly on keys (eg. to bind additional // revocation keys). } // Else, ignoring the signature as it does not follow anything // we would know to attach it to. case *packet.PrivateKey: if pkt.IsSubkey == false { packets.Unread(p) break EachPacket } err = addSubkey(e, packets, &pkt.PublicKey, pkt) if err != nil { return nil, err } case *packet.PublicKey: if pkt.IsSubkey == false { packets.Unread(p) break EachPacket } err = addSubkey(e, packets, pkt, nil) if err != nil { return nil, err } default: // we ignore unknown packets } } if len(e.Identities) == 0 { return nil, errors.StructuralError("entity without any identities") } for _, revocation := range revocations { err = e.PrimaryKey.VerifyRevocationSignature(revocation) if err == nil { e.Revocations = append(e.Revocations, revocation) } else { // TODO: RFC 4880 5.2.3.15 defines revocation keys. return nil, errors.StructuralError("revocation signature signed by alternate key") } } return e, nil } func addUserID(e *Entity, packets *packet.Reader, pkt *packet.UserId) error { // Make a new Identity object, that we might wind up throwing away. // We'll only add it if we get a valid self-signature over this // userID. identity := new(Identity) identity.Name = pkt.Id identity.UserId = pkt for { p, err := packets.Next() if err == io.EOF { break } else if err != nil { return err } sig, ok := p.(*packet.Signature) if !ok { packets.Unread(p) break } if (sig.SigType == packet.SigTypePositiveCert || sig.SigType == packet.SigTypeGenericCert) && sig.IssuerKeyId != nil && *sig.IssuerKeyId == e.PrimaryKey.KeyId { if err = e.PrimaryKey.VerifyUserIdSignature(pkt.Id, e.PrimaryKey, sig); err != nil { return errors.StructuralError("user ID self-signature invalid: " + err.Error()) } identity.SelfSignature = sig e.Identities[pkt.Id] = identity } else { identity.Signatures = append(identity.Signatures, sig) } } return nil } func addSubkey(e *Entity, packets *packet.Reader, pub *packet.PublicKey, priv *packet.PrivateKey) error { var subKey Subkey subKey.PublicKey = pub subKey.PrivateKey = priv for { p, err := packets.Next() if err == io.EOF { break } else if err != nil { return errors.StructuralError("subkey signature invalid: " + err.Error()) } sig, ok := p.(*packet.Signature) if !ok { packets.Unread(p) break } if sig.SigType != packet.SigTypeSubkeyBinding && sig.SigType != packet.SigTypeSubkeyRevocation { return errors.StructuralError("subkey signature with wrong type") } if err := e.PrimaryKey.VerifyKeySignature(subKey.PublicKey, sig); err != nil { return errors.StructuralError("subkey signature invalid: " + err.Error()) } switch sig.SigType { case packet.SigTypeSubkeyRevocation: subKey.Sig = sig case packet.SigTypeSubkeyBinding: if shouldReplaceSubkeySig(subKey.Sig, sig) { subKey.Sig = sig } } } if subKey.Sig == nil { return errors.StructuralError("subkey packet not followed by signature") } e.Subkeys = append(e.Subkeys, subKey) return nil } func shouldReplaceSubkeySig(existingSig, potentialNewSig *packet.Signature) bool { if potentialNewSig == nil { return false } if existingSig == nil { return true } if existingSig.SigType == packet.SigTypeSubkeyRevocation { return false // never override a revocation signature } return potentialNewSig.CreationTime.After(existingSig.CreationTime) } const defaultRSAKeyBits = 2048 // NewEntity returns an Entity that contains a fresh RSA/RSA keypair with a // single identity composed of the given full name, comment and email, any of // which may be empty but must not contain any of "()<>\x00". // If config is nil, sensible defaults will be used. func NewEntity(name, comment, email string, config *packet.Config) (*Entity, error) { creationTime := config.Now() bits := defaultRSAKeyBits if config != nil && config.RSABits != 0 { bits = config.RSABits } uid := packet.NewUserId(name, comment, email) if uid == nil { return nil, errors.InvalidArgumentError("user id field contained invalid characters") } signingPriv, err := rsa.GenerateKey(config.Random(), bits) if err != nil { return nil, err } encryptingPriv, err := rsa.GenerateKey(config.Random(), bits) if err != nil { return nil, err } e := &Entity{ PrimaryKey: packet.NewRSAPublicKey(creationTime, &signingPriv.PublicKey), PrivateKey: packet.NewRSAPrivateKey(creationTime, signingPriv), Identities: make(map[string]*Identity), } isPrimaryId := true e.Identities[uid.Id] = &Identity{ Name: uid.Id, UserId: uid, SelfSignature: &packet.Signature{ CreationTime: creationTime, SigType: packet.SigTypePositiveCert, PubKeyAlgo: packet.PubKeyAlgoRSA, Hash: config.Hash(), IsPrimaryId: &isPrimaryId, FlagsValid: true, FlagSign: true, FlagCertify: true, IssuerKeyId: &e.PrimaryKey.KeyId, }, } err = e.Identities[uid.Id].SelfSignature.SignUserId(uid.Id, e.PrimaryKey, e.PrivateKey, config) if err != nil { return nil, err } // If the user passes in a DefaultHash via packet.Config, // set the PreferredHash for the SelfSignature. if config != nil && config.DefaultHash != 0 { e.Identities[uid.Id].SelfSignature.PreferredHash = []uint8{hashToHashId(config.DefaultHash)} } // Likewise for DefaultCipher. if config != nil && config.DefaultCipher != 0 { e.Identities[uid.Id].SelfSignature.PreferredSymmetric = []uint8{uint8(config.DefaultCipher)} } e.Subkeys = make([]Subkey, 1) e.Subkeys[0] = Subkey{ PublicKey: packet.NewRSAPublicKey(creationTime, &encryptingPriv.PublicKey), PrivateKey: packet.NewRSAPrivateKey(creationTime, encryptingPriv), Sig: &packet.Signature{ CreationTime: creationTime, SigType: packet.SigTypeSubkeyBinding, PubKeyAlgo: packet.PubKeyAlgoRSA, Hash: config.Hash(), FlagsValid: true, FlagEncryptStorage: true, FlagEncryptCommunications: true, IssuerKeyId: &e.PrimaryKey.KeyId, }, } e.Subkeys[0].PublicKey.IsSubkey = true e.Subkeys[0].PrivateKey.IsSubkey = true err = e.Subkeys[0].Sig.SignKey(e.Subkeys[0].PublicKey, e.PrivateKey, config) if err != nil { return nil, err } return e, nil } // SerializePrivate serializes an Entity, including private key material, but // excluding signatures from other entities, to the given Writer. // Identities and subkeys are re-signed in case they changed since NewEntry. // If config is nil, sensible defaults will be used. func (e *Entity) SerializePrivate(w io.Writer, config *packet.Config) (err error) { err = e.PrivateKey.Serialize(w) if err != nil { return } for _, ident := range e.Identities { err = ident.UserId.Serialize(w) if err != nil { return } err = ident.SelfSignature.SignUserId(ident.UserId.Id, e.PrimaryKey, e.PrivateKey, config) if err != nil { return } err = ident.SelfSignature.Serialize(w) if err != nil { return } } for _, subkey := range e.Subkeys { err = subkey.PrivateKey.Serialize(w) if err != nil { return } err = subkey.Sig.SignKey(subkey.PublicKey, e.PrivateKey, config) if err != nil { return } err = subkey.Sig.Serialize(w) if err != nil { return } } return nil } // Serialize writes the public part of the given Entity to w, including // signatures from other entities. No private key material will be output. func (e *Entity) Serialize(w io.Writer) error { err := e.PrimaryKey.Serialize(w) if err != nil { return err } for _, ident := range e.Identities { err = ident.UserId.Serialize(w) if err != nil { return err } err = ident.SelfSignature.Serialize(w) if err != nil { return err } for _, sig := range ident.Signatures { err = sig.Serialize(w) if err != nil { return err } } } for _, subkey := range e.Subkeys { err = subkey.PublicKey.Serialize(w) if err != nil { return err } err = subkey.Sig.Serialize(w) if err != nil { return err } } return nil } // SignIdentity adds a signature to e, from signer, attesting that identity is // associated with e. The provided identity must already be an element of // e.Identities and the private key of signer must have been decrypted if // necessary. // If config is nil, sensible defaults will be used. func (e *Entity) SignIdentity(identity string, signer *Entity, config *packet.Config) error { if signer.PrivateKey == nil { return errors.InvalidArgumentError("signing Entity must have a private key") } if signer.PrivateKey.Encrypted { return errors.InvalidArgumentError("signing Entity's private key must be decrypted") } ident, ok := e.Identities[identity] if !ok { return errors.InvalidArgumentError("given identity string not found in Entity") } sig := &packet.Signature{ SigType: packet.SigTypeGenericCert, PubKeyAlgo: signer.PrivateKey.PubKeyAlgo, Hash: config.Hash(), CreationTime: config.Now(), IssuerKeyId: &signer.PrivateKey.KeyId, } if err := sig.SignUserId(identity, e.PrimaryKey, signer.PrivateKey, config); err != nil { return err } ident.Signatures = append(ident.Signatures, sig) return nil } ================================================ FILE: vendor/golang.org/x/crypto/openpgp/packet/compressed.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package packet import ( "compress/bzip2" "compress/flate" "compress/zlib" "golang.org/x/crypto/openpgp/errors" "io" "strconv" ) // Compressed represents a compressed OpenPGP packet. The decompressed contents // will contain more OpenPGP packets. See RFC 4880, section 5.6. type Compressed struct { Body io.Reader } const ( NoCompression = flate.NoCompression BestSpeed = flate.BestSpeed BestCompression = flate.BestCompression DefaultCompression = flate.DefaultCompression ) // CompressionConfig contains compressor configuration settings. type CompressionConfig struct { // Level is the compression level to use. It must be set to // between -1 and 9, with -1 causing the compressor to use the // default compression level, 0 causing the compressor to use // no compression and 1 to 9 representing increasing (better, // slower) compression levels. If Level is less than -1 or // more then 9, a non-nil error will be returned during // encryption. See the constants above for convenient common // settings for Level. Level int } func (c *Compressed) parse(r io.Reader) error { var buf [1]byte _, err := readFull(r, buf[:]) if err != nil { return err } switch buf[0] { case 1: c.Body = flate.NewReader(r) case 2: c.Body, err = zlib.NewReader(r) case 3: c.Body = bzip2.NewReader(r) default: err = errors.UnsupportedError("unknown compression algorithm: " + strconv.Itoa(int(buf[0]))) } return err } // compressedWriteCloser represents the serialized compression stream // header and the compressor. Its Close() method ensures that both the // compressor and serialized stream header are closed. Its Write() // method writes to the compressor. type compressedWriteCloser struct { sh io.Closer // Stream Header c io.WriteCloser // Compressor } func (cwc compressedWriteCloser) Write(p []byte) (int, error) { return cwc.c.Write(p) } func (cwc compressedWriteCloser) Close() (err error) { err = cwc.c.Close() if err != nil { return err } return cwc.sh.Close() } // SerializeCompressed serializes a compressed data packet to w and // returns a WriteCloser to which the literal data packets themselves // can be written and which MUST be closed on completion. If cc is // nil, sensible defaults will be used to configure the compression // algorithm. func SerializeCompressed(w io.WriteCloser, algo CompressionAlgo, cc *CompressionConfig) (literaldata io.WriteCloser, err error) { compressed, err := serializeStreamHeader(w, packetTypeCompressed) if err != nil { return } _, err = compressed.Write([]byte{uint8(algo)}) if err != nil { return } level := DefaultCompression if cc != nil { level = cc.Level } var compressor io.WriteCloser switch algo { case CompressionZIP: compressor, err = flate.NewWriter(compressed, level) case CompressionZLIB: compressor, err = zlib.NewWriterLevel(compressed, level) default: s := strconv.Itoa(int(algo)) err = errors.UnsupportedError("Unsupported compression algorithm: " + s) } if err != nil { return } literaldata = compressedWriteCloser{compressed, compressor} return } ================================================ FILE: vendor/golang.org/x/crypto/openpgp/packet/config.go ================================================ // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package packet import ( "crypto" "crypto/rand" "io" "time" ) // Config collects a number of parameters along with sensible defaults. // A nil *Config is valid and results in all default values. type Config struct { // Rand provides the source of entropy. // If nil, the crypto/rand Reader is used. Rand io.Reader // DefaultHash is the default hash function to be used. // If zero, SHA-256 is used. DefaultHash crypto.Hash // DefaultCipher is the cipher to be used. // If zero, AES-128 is used. DefaultCipher CipherFunction // Time returns the current time as the number of seconds since the // epoch. If Time is nil, time.Now is used. Time func() time.Time // DefaultCompressionAlgo is the compression algorithm to be // applied to the plaintext before encryption. If zero, no // compression is done. DefaultCompressionAlgo CompressionAlgo // CompressionConfig configures the compression settings. CompressionConfig *CompressionConfig // S2KCount is only used for symmetric encryption. It // determines the strength of the passphrase stretching when // the said passphrase is hashed to produce a key. S2KCount // should be between 1024 and 65011712, inclusive. If Config // is nil or S2KCount is 0, the value 65536 used. Not all // values in the above range can be represented. S2KCount will // be rounded up to the next representable value if it cannot // be encoded exactly. When set, it is strongly encrouraged to // use a value that is at least 65536. See RFC 4880 Section // 3.7.1.3. S2KCount int // RSABits is the number of bits in new RSA keys made with NewEntity. // If zero, then 2048 bit keys are created. RSABits int } func (c *Config) Random() io.Reader { if c == nil || c.Rand == nil { return rand.Reader } return c.Rand } func (c *Config) Hash() crypto.Hash { if c == nil || uint(c.DefaultHash) == 0 { return crypto.SHA256 } return c.DefaultHash } func (c *Config) Cipher() CipherFunction { if c == nil || uint8(c.DefaultCipher) == 0 { return CipherAES128 } return c.DefaultCipher } func (c *Config) Now() time.Time { if c == nil || c.Time == nil { return time.Now() } return c.Time() } func (c *Config) Compression() CompressionAlgo { if c == nil { return CompressionNone } return c.DefaultCompressionAlgo } func (c *Config) PasswordHashIterations() int { if c == nil || c.S2KCount == 0 { return 0 } return c.S2KCount } ================================================ FILE: vendor/golang.org/x/crypto/openpgp/packet/encrypted_key.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package packet import ( "crypto" "crypto/rsa" "encoding/binary" "io" "math/big" "strconv" "golang.org/x/crypto/openpgp/elgamal" "golang.org/x/crypto/openpgp/errors" ) const encryptedKeyVersion = 3 // EncryptedKey represents a public-key encrypted session key. See RFC 4880, // section 5.1. type EncryptedKey struct { KeyId uint64 Algo PublicKeyAlgorithm CipherFunc CipherFunction // only valid after a successful Decrypt Key []byte // only valid after a successful Decrypt encryptedMPI1, encryptedMPI2 parsedMPI } func (e *EncryptedKey) parse(r io.Reader) (err error) { var buf [10]byte _, err = readFull(r, buf[:]) if err != nil { return } if buf[0] != encryptedKeyVersion { return errors.UnsupportedError("unknown EncryptedKey version " + strconv.Itoa(int(buf[0]))) } e.KeyId = binary.BigEndian.Uint64(buf[1:9]) e.Algo = PublicKeyAlgorithm(buf[9]) switch e.Algo { case PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly: e.encryptedMPI1.bytes, e.encryptedMPI1.bitLength, err = readMPI(r) if err != nil { return } case PubKeyAlgoElGamal: e.encryptedMPI1.bytes, e.encryptedMPI1.bitLength, err = readMPI(r) if err != nil { return } e.encryptedMPI2.bytes, e.encryptedMPI2.bitLength, err = readMPI(r) if err != nil { return } } _, err = consumeAll(r) return } func checksumKeyMaterial(key []byte) uint16 { var checksum uint16 for _, v := range key { checksum += uint16(v) } return checksum } // Decrypt decrypts an encrypted session key with the given private key. The // private key must have been decrypted first. // If config is nil, sensible defaults will be used. func (e *EncryptedKey) Decrypt(priv *PrivateKey, config *Config) error { var err error var b []byte // TODO(agl): use session key decryption routines here to avoid // padding oracle attacks. switch priv.PubKeyAlgo { case PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly: // Supports both *rsa.PrivateKey and crypto.Decrypter k := priv.PrivateKey.(crypto.Decrypter) b, err = k.Decrypt(config.Random(), padToKeySize(k.Public().(*rsa.PublicKey), e.encryptedMPI1.bytes), nil) case PubKeyAlgoElGamal: c1 := new(big.Int).SetBytes(e.encryptedMPI1.bytes) c2 := new(big.Int).SetBytes(e.encryptedMPI2.bytes) b, err = elgamal.Decrypt(priv.PrivateKey.(*elgamal.PrivateKey), c1, c2) default: err = errors.InvalidArgumentError("cannot decrypted encrypted session key with private key of type " + strconv.Itoa(int(priv.PubKeyAlgo))) } if err != nil { return err } e.CipherFunc = CipherFunction(b[0]) e.Key = b[1 : len(b)-2] expectedChecksum := uint16(b[len(b)-2])<<8 | uint16(b[len(b)-1]) checksum := checksumKeyMaterial(e.Key) if checksum != expectedChecksum { return errors.StructuralError("EncryptedKey checksum incorrect") } return nil } // Serialize writes the encrypted key packet, e, to w. func (e *EncryptedKey) Serialize(w io.Writer) error { var mpiLen int switch e.Algo { case PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly: mpiLen = 2 + len(e.encryptedMPI1.bytes) case PubKeyAlgoElGamal: mpiLen = 2 + len(e.encryptedMPI1.bytes) + 2 + len(e.encryptedMPI2.bytes) default: return errors.InvalidArgumentError("don't know how to serialize encrypted key type " + strconv.Itoa(int(e.Algo))) } serializeHeader(w, packetTypeEncryptedKey, 1 /* version */ +8 /* key id */ +1 /* algo */ +mpiLen) w.Write([]byte{encryptedKeyVersion}) binary.Write(w, binary.BigEndian, e.KeyId) w.Write([]byte{byte(e.Algo)}) switch e.Algo { case PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly: writeMPIs(w, e.encryptedMPI1) case PubKeyAlgoElGamal: writeMPIs(w, e.encryptedMPI1, e.encryptedMPI2) default: panic("internal error") } return nil } // SerializeEncryptedKey serializes an encrypted key packet to w that contains // key, encrypted to pub. // If config is nil, sensible defaults will be used. func SerializeEncryptedKey(w io.Writer, pub *PublicKey, cipherFunc CipherFunction, key []byte, config *Config) error { var buf [10]byte buf[0] = encryptedKeyVersion binary.BigEndian.PutUint64(buf[1:9], pub.KeyId) buf[9] = byte(pub.PubKeyAlgo) keyBlock := make([]byte, 1 /* cipher type */ +len(key)+2 /* checksum */) keyBlock[0] = byte(cipherFunc) copy(keyBlock[1:], key) checksum := checksumKeyMaterial(key) keyBlock[1+len(key)] = byte(checksum >> 8) keyBlock[1+len(key)+1] = byte(checksum) switch pub.PubKeyAlgo { case PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly: return serializeEncryptedKeyRSA(w, config.Random(), buf, pub.PublicKey.(*rsa.PublicKey), keyBlock) case PubKeyAlgoElGamal: return serializeEncryptedKeyElGamal(w, config.Random(), buf, pub.PublicKey.(*elgamal.PublicKey), keyBlock) case PubKeyAlgoDSA, PubKeyAlgoRSASignOnly: return errors.InvalidArgumentError("cannot encrypt to public key of type " + strconv.Itoa(int(pub.PubKeyAlgo))) } return errors.UnsupportedError("encrypting a key to public key of type " + strconv.Itoa(int(pub.PubKeyAlgo))) } func serializeEncryptedKeyRSA(w io.Writer, rand io.Reader, header [10]byte, pub *rsa.PublicKey, keyBlock []byte) error { cipherText, err := rsa.EncryptPKCS1v15(rand, pub, keyBlock) if err != nil { return errors.InvalidArgumentError("RSA encryption failed: " + err.Error()) } packetLen := 10 /* header length */ + 2 /* mpi size */ + len(cipherText) err = serializeHeader(w, packetTypeEncryptedKey, packetLen) if err != nil { return err } _, err = w.Write(header[:]) if err != nil { return err } return writeMPI(w, 8*uint16(len(cipherText)), cipherText) } func serializeEncryptedKeyElGamal(w io.Writer, rand io.Reader, header [10]byte, pub *elgamal.PublicKey, keyBlock []byte) error { c1, c2, err := elgamal.Encrypt(rand, pub, keyBlock) if err != nil { return errors.InvalidArgumentError("ElGamal encryption failed: " + err.Error()) } packetLen := 10 /* header length */ packetLen += 2 /* mpi size */ + (c1.BitLen()+7)/8 packetLen += 2 /* mpi size */ + (c2.BitLen()+7)/8 err = serializeHeader(w, packetTypeEncryptedKey, packetLen) if err != nil { return err } _, err = w.Write(header[:]) if err != nil { return err } err = writeBig(w, c1) if err != nil { return err } return writeBig(w, c2) } ================================================ FILE: vendor/golang.org/x/crypto/openpgp/packet/literal.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package packet import ( "encoding/binary" "io" ) // LiteralData represents an encrypted file. See RFC 4880, section 5.9. type LiteralData struct { IsBinary bool FileName string Time uint32 // Unix epoch time. Either creation time or modification time. 0 means undefined. Body io.Reader } // ForEyesOnly returns whether the contents of the LiteralData have been marked // as especially sensitive. func (l *LiteralData) ForEyesOnly() bool { return l.FileName == "_CONSOLE" } func (l *LiteralData) parse(r io.Reader) (err error) { var buf [256]byte _, err = readFull(r, buf[:2]) if err != nil { return } l.IsBinary = buf[0] == 'b' fileNameLen := int(buf[1]) _, err = readFull(r, buf[:fileNameLen]) if err != nil { return } l.FileName = string(buf[:fileNameLen]) _, err = readFull(r, buf[:4]) if err != nil { return } l.Time = binary.BigEndian.Uint32(buf[:4]) l.Body = r return } // SerializeLiteral serializes a literal data packet to w and returns a // WriteCloser to which the data itself can be written and which MUST be closed // on completion. The fileName is truncated to 255 bytes. func SerializeLiteral(w io.WriteCloser, isBinary bool, fileName string, time uint32) (plaintext io.WriteCloser, err error) { var buf [4]byte buf[0] = 't' if isBinary { buf[0] = 'b' } if len(fileName) > 255 { fileName = fileName[:255] } buf[1] = byte(len(fileName)) inner, err := serializeStreamHeader(w, packetTypeLiteralData) if err != nil { return } _, err = inner.Write(buf[:2]) if err != nil { return } _, err = inner.Write([]byte(fileName)) if err != nil { return } binary.BigEndian.PutUint32(buf[:], time) _, err = inner.Write(buf[:]) if err != nil { return } plaintext = inner return } ================================================ FILE: vendor/golang.org/x/crypto/openpgp/packet/ocfb.go ================================================ // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // OpenPGP CFB Mode. http://tools.ietf.org/html/rfc4880#section-13.9 package packet import ( "crypto/cipher" ) type ocfbEncrypter struct { b cipher.Block fre []byte outUsed int } // An OCFBResyncOption determines if the "resynchronization step" of OCFB is // performed. type OCFBResyncOption bool const ( OCFBResync OCFBResyncOption = true OCFBNoResync OCFBResyncOption = false ) // NewOCFBEncrypter returns a cipher.Stream which encrypts data with OpenPGP's // cipher feedback mode using the given cipher.Block, and an initial amount of // ciphertext. randData must be random bytes and be the same length as the // cipher.Block's block size. Resync determines if the "resynchronization step" // from RFC 4880, 13.9 step 7 is performed. Different parts of OpenPGP vary on // this point. func NewOCFBEncrypter(block cipher.Block, randData []byte, resync OCFBResyncOption) (cipher.Stream, []byte) { blockSize := block.BlockSize() if len(randData) != blockSize { return nil, nil } x := &ocfbEncrypter{ b: block, fre: make([]byte, blockSize), outUsed: 0, } prefix := make([]byte, blockSize+2) block.Encrypt(x.fre, x.fre) for i := 0; i < blockSize; i++ { prefix[i] = randData[i] ^ x.fre[i] } block.Encrypt(x.fre, prefix[:blockSize]) prefix[blockSize] = x.fre[0] ^ randData[blockSize-2] prefix[blockSize+1] = x.fre[1] ^ randData[blockSize-1] if resync { block.Encrypt(x.fre, prefix[2:]) } else { x.fre[0] = prefix[blockSize] x.fre[1] = prefix[blockSize+1] x.outUsed = 2 } return x, prefix } func (x *ocfbEncrypter) XORKeyStream(dst, src []byte) { for i := 0; i < len(src); i++ { if x.outUsed == len(x.fre) { x.b.Encrypt(x.fre, x.fre) x.outUsed = 0 } x.fre[x.outUsed] ^= src[i] dst[i] = x.fre[x.outUsed] x.outUsed++ } } type ocfbDecrypter struct { b cipher.Block fre []byte outUsed int } // NewOCFBDecrypter returns a cipher.Stream which decrypts data with OpenPGP's // cipher feedback mode using the given cipher.Block. Prefix must be the first // blockSize + 2 bytes of the ciphertext, where blockSize is the cipher.Block's // block size. If an incorrect key is detected then nil is returned. On // successful exit, blockSize+2 bytes of decrypted data are written into // prefix. Resync determines if the "resynchronization step" from RFC 4880, // 13.9 step 7 is performed. Different parts of OpenPGP vary on this point. func NewOCFBDecrypter(block cipher.Block, prefix []byte, resync OCFBResyncOption) cipher.Stream { blockSize := block.BlockSize() if len(prefix) != blockSize+2 { return nil } x := &ocfbDecrypter{ b: block, fre: make([]byte, blockSize), outUsed: 0, } prefixCopy := make([]byte, len(prefix)) copy(prefixCopy, prefix) block.Encrypt(x.fre, x.fre) for i := 0; i < blockSize; i++ { prefixCopy[i] ^= x.fre[i] } block.Encrypt(x.fre, prefix[:blockSize]) prefixCopy[blockSize] ^= x.fre[0] prefixCopy[blockSize+1] ^= x.fre[1] if prefixCopy[blockSize-2] != prefixCopy[blockSize] || prefixCopy[blockSize-1] != prefixCopy[blockSize+1] { return nil } if resync { block.Encrypt(x.fre, prefix[2:]) } else { x.fre[0] = prefix[blockSize] x.fre[1] = prefix[blockSize+1] x.outUsed = 2 } copy(prefix, prefixCopy) return x } func (x *ocfbDecrypter) XORKeyStream(dst, src []byte) { for i := 0; i < len(src); i++ { if x.outUsed == len(x.fre) { x.b.Encrypt(x.fre, x.fre) x.outUsed = 0 } c := src[i] dst[i] = x.fre[x.outUsed] ^ src[i] x.fre[x.outUsed] = c x.outUsed++ } } ================================================ FILE: vendor/golang.org/x/crypto/openpgp/packet/one_pass_signature.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package packet import ( "crypto" "encoding/binary" "golang.org/x/crypto/openpgp/errors" "golang.org/x/crypto/openpgp/s2k" "io" "strconv" ) // OnePassSignature represents a one-pass signature packet. See RFC 4880, // section 5.4. type OnePassSignature struct { SigType SignatureType Hash crypto.Hash PubKeyAlgo PublicKeyAlgorithm KeyId uint64 IsLast bool } const onePassSignatureVersion = 3 func (ops *OnePassSignature) parse(r io.Reader) (err error) { var buf [13]byte _, err = readFull(r, buf[:]) if err != nil { return } if buf[0] != onePassSignatureVersion { err = errors.UnsupportedError("one-pass-signature packet version " + strconv.Itoa(int(buf[0]))) } var ok bool ops.Hash, ok = s2k.HashIdToHash(buf[2]) if !ok { return errors.UnsupportedError("hash function: " + strconv.Itoa(int(buf[2]))) } ops.SigType = SignatureType(buf[1]) ops.PubKeyAlgo = PublicKeyAlgorithm(buf[3]) ops.KeyId = binary.BigEndian.Uint64(buf[4:12]) ops.IsLast = buf[12] != 0 return } // Serialize marshals the given OnePassSignature to w. func (ops *OnePassSignature) Serialize(w io.Writer) error { var buf [13]byte buf[0] = onePassSignatureVersion buf[1] = uint8(ops.SigType) var ok bool buf[2], ok = s2k.HashToHashId(ops.Hash) if !ok { return errors.UnsupportedError("hash type: " + strconv.Itoa(int(ops.Hash))) } buf[3] = uint8(ops.PubKeyAlgo) binary.BigEndian.PutUint64(buf[4:12], ops.KeyId) if ops.IsLast { buf[12] = 1 } if err := serializeHeader(w, packetTypeOnePassSignature, len(buf)); err != nil { return err } _, err := w.Write(buf[:]) return err } ================================================ FILE: vendor/golang.org/x/crypto/openpgp/packet/opaque.go ================================================ // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package packet import ( "bytes" "io" "golang.org/x/crypto/openpgp/errors" ) // OpaquePacket represents an OpenPGP packet as raw, unparsed data. This is // useful for splitting and storing the original packet contents separately, // handling unsupported packet types or accessing parts of the packet not yet // implemented by this package. type OpaquePacket struct { // Packet type Tag uint8 // Reason why the packet was parsed opaquely Reason error // Binary contents of the packet data Contents []byte } func (op *OpaquePacket) parse(r io.Reader) (err error) { op.Contents, err = io.ReadAll(r) return } // Serialize marshals the packet to a writer in its original form, including // the packet header. func (op *OpaquePacket) Serialize(w io.Writer) (err error) { err = serializeHeader(w, packetType(op.Tag), len(op.Contents)) if err == nil { _, err = w.Write(op.Contents) } return } // Parse attempts to parse the opaque contents into a structure supported by // this package. If the packet is not known then the result will be another // OpaquePacket. func (op *OpaquePacket) Parse() (p Packet, err error) { hdr := bytes.NewBuffer(nil) err = serializeHeader(hdr, packetType(op.Tag), len(op.Contents)) if err != nil { op.Reason = err return op, err } p, err = Read(io.MultiReader(hdr, bytes.NewBuffer(op.Contents))) if err != nil { op.Reason = err p = op } return } // OpaqueReader reads OpaquePackets from an io.Reader. type OpaqueReader struct { r io.Reader } func NewOpaqueReader(r io.Reader) *OpaqueReader { return &OpaqueReader{r: r} } // Read the next OpaquePacket. func (or *OpaqueReader) Next() (op *OpaquePacket, err error) { tag, _, contents, err := readHeader(or.r) if err != nil { return } op = &OpaquePacket{Tag: uint8(tag), Reason: err} err = op.parse(contents) if err != nil { consumeAll(contents) } return } // OpaqueSubpacket represents an unparsed OpenPGP subpacket, // as found in signature and user attribute packets. type OpaqueSubpacket struct { SubType uint8 Contents []byte } // OpaqueSubpackets extracts opaque, unparsed OpenPGP subpackets from // their byte representation. func OpaqueSubpackets(contents []byte) (result []*OpaqueSubpacket, err error) { var ( subHeaderLen int subPacket *OpaqueSubpacket ) for len(contents) > 0 { subHeaderLen, subPacket, err = nextSubpacket(contents) if err != nil { break } result = append(result, subPacket) contents = contents[subHeaderLen+len(subPacket.Contents):] } return } func nextSubpacket(contents []byte) (subHeaderLen int, subPacket *OpaqueSubpacket, err error) { // RFC 4880, section 5.2.3.1 var subLen uint32 if len(contents) < 1 { goto Truncated } subPacket = &OpaqueSubpacket{} switch { case contents[0] < 192: subHeaderLen = 2 // 1 length byte, 1 subtype byte if len(contents) < subHeaderLen { goto Truncated } subLen = uint32(contents[0]) contents = contents[1:] case contents[0] < 255: subHeaderLen = 3 // 2 length bytes, 1 subtype if len(contents) < subHeaderLen { goto Truncated } subLen = uint32(contents[0]-192)<<8 + uint32(contents[1]) + 192 contents = contents[2:] default: subHeaderLen = 6 // 5 length bytes, 1 subtype if len(contents) < subHeaderLen { goto Truncated } subLen = uint32(contents[1])<<24 | uint32(contents[2])<<16 | uint32(contents[3])<<8 | uint32(contents[4]) contents = contents[5:] } if subLen > uint32(len(contents)) || subLen == 0 { goto Truncated } subPacket.SubType = contents[0] subPacket.Contents = contents[1:subLen] return Truncated: err = errors.StructuralError("subpacket truncated") return } func (osp *OpaqueSubpacket) Serialize(w io.Writer) (err error) { buf := make([]byte, 6) n := serializeSubpacketLength(buf, len(osp.Contents)+1) buf[n] = osp.SubType if _, err = w.Write(buf[:n+1]); err != nil { return } _, err = w.Write(osp.Contents) return } ================================================ FILE: vendor/golang.org/x/crypto/openpgp/packet/packet.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package packet implements parsing and serialization of OpenPGP packets, as // specified in RFC 4880. // // Deprecated: this package is unmaintained except for security fixes. New // applications should consider a more focused, modern alternative to OpenPGP // for their specific task. If you are required to interoperate with OpenPGP // systems and need a maintained package, consider a community fork. // See https://golang.org/issue/44226. package packet import ( "bufio" "crypto/aes" "crypto/cipher" "crypto/des" "crypto/rsa" "io" "math/big" "math/bits" "golang.org/x/crypto/cast5" "golang.org/x/crypto/openpgp/errors" ) // readFull is the same as io.ReadFull except that reading zero bytes returns // ErrUnexpectedEOF rather than EOF. func readFull(r io.Reader, buf []byte) (n int, err error) { n, err = io.ReadFull(r, buf) if err == io.EOF { err = io.ErrUnexpectedEOF } return } // readLength reads an OpenPGP length from r. See RFC 4880, section 4.2.2. func readLength(r io.Reader) (length int64, isPartial bool, err error) { var buf [4]byte _, err = readFull(r, buf[:1]) if err != nil { return } switch { case buf[0] < 192: length = int64(buf[0]) case buf[0] < 224: length = int64(buf[0]-192) << 8 _, err = readFull(r, buf[0:1]) if err != nil { return } length += int64(buf[0]) + 192 case buf[0] < 255: length = int64(1) << (buf[0] & 0x1f) isPartial = true default: _, err = readFull(r, buf[0:4]) if err != nil { return } length = int64(buf[0])<<24 | int64(buf[1])<<16 | int64(buf[2])<<8 | int64(buf[3]) } return } // partialLengthReader wraps an io.Reader and handles OpenPGP partial lengths. // The continuation lengths are parsed and removed from the stream and EOF is // returned at the end of the packet. See RFC 4880, section 4.2.2.4. type partialLengthReader struct { r io.Reader remaining int64 isPartial bool } func (r *partialLengthReader) Read(p []byte) (n int, err error) { for r.remaining == 0 { if !r.isPartial { return 0, io.EOF } r.remaining, r.isPartial, err = readLength(r.r) if err != nil { return 0, err } } toRead := int64(len(p)) if toRead > r.remaining { toRead = r.remaining } n, err = r.r.Read(p[:int(toRead)]) r.remaining -= int64(n) if n < int(toRead) && err == io.EOF { err = io.ErrUnexpectedEOF } return } // partialLengthWriter writes a stream of data using OpenPGP partial lengths. // See RFC 4880, section 4.2.2.4. type partialLengthWriter struct { w io.WriteCloser lengthByte [1]byte sentFirst bool buf []byte } // RFC 4880 4.2.2.4: the first partial length MUST be at least 512 octets long. const minFirstPartialWrite = 512 func (w *partialLengthWriter) Write(p []byte) (n int, err error) { off := 0 if !w.sentFirst { if len(w.buf) > 0 || len(p) < minFirstPartialWrite { off = len(w.buf) w.buf = append(w.buf, p...) if len(w.buf) < minFirstPartialWrite { return len(p), nil } p = w.buf w.buf = nil } w.sentFirst = true } power := uint8(30) for len(p) > 0 { l := 1 << power if len(p) < l { power = uint8(bits.Len32(uint32(len(p)))) - 1 l = 1 << power } w.lengthByte[0] = 224 + power _, err = w.w.Write(w.lengthByte[:]) if err == nil { var m int m, err = w.w.Write(p[:l]) n += m } if err != nil { if n < off { return 0, err } return n - off, err } p = p[l:] } return n - off, nil } func (w *partialLengthWriter) Close() error { if len(w.buf) > 0 { // In this case we can't send a 512 byte packet. // Just send what we have. p := w.buf w.sentFirst = true w.buf = nil if _, err := w.Write(p); err != nil { return err } } w.lengthByte[0] = 0 _, err := w.w.Write(w.lengthByte[:]) if err != nil { return err } return w.w.Close() } // A spanReader is an io.LimitReader, but it returns ErrUnexpectedEOF if the // underlying Reader returns EOF before the limit has been reached. type spanReader struct { r io.Reader n int64 } func (l *spanReader) Read(p []byte) (n int, err error) { if l.n <= 0 { return 0, io.EOF } if int64(len(p)) > l.n { p = p[0:l.n] } n, err = l.r.Read(p) l.n -= int64(n) if l.n > 0 && err == io.EOF { err = io.ErrUnexpectedEOF } return } // readHeader parses a packet header and returns an io.Reader which will return // the contents of the packet. See RFC 4880, section 4.2. func readHeader(r io.Reader) (tag packetType, length int64, contents io.Reader, err error) { var buf [4]byte _, err = io.ReadFull(r, buf[:1]) if err != nil { return } if buf[0]&0x80 == 0 { err = errors.StructuralError("tag byte does not have MSB set") return } if buf[0]&0x40 == 0 { // Old format packet tag = packetType((buf[0] & 0x3f) >> 2) lengthType := buf[0] & 3 if lengthType == 3 { length = -1 contents = r return } lengthBytes := 1 << lengthType _, err = readFull(r, buf[0:lengthBytes]) if err != nil { return } for i := 0; i < lengthBytes; i++ { length <<= 8 length |= int64(buf[i]) } contents = &spanReader{r, length} return } // New format packet tag = packetType(buf[0] & 0x3f) length, isPartial, err := readLength(r) if err != nil { return } if isPartial { contents = &partialLengthReader{ remaining: length, isPartial: true, r: r, } length = -1 } else { contents = &spanReader{r, length} } return } // serializeHeader writes an OpenPGP packet header to w. See RFC 4880, section // 4.2. func serializeHeader(w io.Writer, ptype packetType, length int) (err error) { var buf [6]byte var n int buf[0] = 0x80 | 0x40 | byte(ptype) if length < 192 { buf[1] = byte(length) n = 2 } else if length < 8384 { length -= 192 buf[1] = 192 + byte(length>>8) buf[2] = byte(length) n = 3 } else { buf[1] = 255 buf[2] = byte(length >> 24) buf[3] = byte(length >> 16) buf[4] = byte(length >> 8) buf[5] = byte(length) n = 6 } _, err = w.Write(buf[:n]) return } // serializeStreamHeader writes an OpenPGP packet header to w where the // length of the packet is unknown. It returns a io.WriteCloser which can be // used to write the contents of the packet. See RFC 4880, section 4.2. func serializeStreamHeader(w io.WriteCloser, ptype packetType) (out io.WriteCloser, err error) { var buf [1]byte buf[0] = 0x80 | 0x40 | byte(ptype) _, err = w.Write(buf[:]) if err != nil { return } out = &partialLengthWriter{w: w} return } // Packet represents an OpenPGP packet. Users are expected to try casting // instances of this interface to specific packet types. type Packet interface { parse(io.Reader) error } // consumeAll reads from the given Reader until error, returning the number of // bytes read. func consumeAll(r io.Reader) (n int64, err error) { var m int var buf [1024]byte for { m, err = r.Read(buf[:]) n += int64(m) if err == io.EOF { err = nil return } if err != nil { return } } } // packetType represents the numeric ids of the different OpenPGP packet types. See // http://www.iana.org/assignments/pgp-parameters/pgp-parameters.xhtml#pgp-parameters-2 type packetType uint8 const ( packetTypeEncryptedKey packetType = 1 packetTypeSignature packetType = 2 packetTypeSymmetricKeyEncrypted packetType = 3 packetTypeOnePassSignature packetType = 4 packetTypePrivateKey packetType = 5 packetTypePublicKey packetType = 6 packetTypePrivateSubkey packetType = 7 packetTypeCompressed packetType = 8 packetTypeSymmetricallyEncrypted packetType = 9 packetTypeLiteralData packetType = 11 packetTypeUserId packetType = 13 packetTypePublicSubkey packetType = 14 packetTypeUserAttribute packetType = 17 packetTypeSymmetricallyEncryptedMDC packetType = 18 ) // peekVersion detects the version of a public key packet about to // be read. A bufio.Reader at the original position of the io.Reader // is returned. func peekVersion(r io.Reader) (bufr *bufio.Reader, ver byte, err error) { bufr = bufio.NewReader(r) var verBuf []byte if verBuf, err = bufr.Peek(1); err != nil { return } ver = verBuf[0] return } // Read reads a single OpenPGP packet from the given io.Reader. If there is an // error parsing a packet, the whole packet is consumed from the input. func Read(r io.Reader) (p Packet, err error) { tag, _, contents, err := readHeader(r) if err != nil { return } switch tag { case packetTypeEncryptedKey: p = new(EncryptedKey) case packetTypeSignature: var version byte // Detect signature version if contents, version, err = peekVersion(contents); err != nil { return } if version < 4 { p = new(SignatureV3) } else { p = new(Signature) } case packetTypeSymmetricKeyEncrypted: p = new(SymmetricKeyEncrypted) case packetTypeOnePassSignature: p = new(OnePassSignature) case packetTypePrivateKey, packetTypePrivateSubkey: pk := new(PrivateKey) if tag == packetTypePrivateSubkey { pk.IsSubkey = true } p = pk case packetTypePublicKey, packetTypePublicSubkey: var version byte if contents, version, err = peekVersion(contents); err != nil { return } isSubkey := tag == packetTypePublicSubkey if version < 4 { p = &PublicKeyV3{IsSubkey: isSubkey} } else { p = &PublicKey{IsSubkey: isSubkey} } case packetTypeCompressed: p = new(Compressed) case packetTypeSymmetricallyEncrypted: p = new(SymmetricallyEncrypted) case packetTypeLiteralData: p = new(LiteralData) case packetTypeUserId: p = new(UserId) case packetTypeUserAttribute: p = new(UserAttribute) case packetTypeSymmetricallyEncryptedMDC: se := new(SymmetricallyEncrypted) se.MDC = true p = se default: err = errors.UnknownPacketTypeError(tag) } if p != nil { err = p.parse(contents) } if err != nil { consumeAll(contents) } return } // SignatureType represents the different semantic meanings of an OpenPGP // signature. See RFC 4880, section 5.2.1. type SignatureType uint8 const ( SigTypeBinary SignatureType = 0 SigTypeText = 1 SigTypeGenericCert = 0x10 SigTypePersonaCert = 0x11 SigTypeCasualCert = 0x12 SigTypePositiveCert = 0x13 SigTypeSubkeyBinding = 0x18 SigTypePrimaryKeyBinding = 0x19 SigTypeDirectSignature = 0x1F SigTypeKeyRevocation = 0x20 SigTypeSubkeyRevocation = 0x28 ) // PublicKeyAlgorithm represents the different public key system specified for // OpenPGP. See // http://www.iana.org/assignments/pgp-parameters/pgp-parameters.xhtml#pgp-parameters-12 type PublicKeyAlgorithm uint8 const ( PubKeyAlgoRSA PublicKeyAlgorithm = 1 PubKeyAlgoElGamal PublicKeyAlgorithm = 16 PubKeyAlgoDSA PublicKeyAlgorithm = 17 // RFC 6637, Section 5. PubKeyAlgoECDH PublicKeyAlgorithm = 18 PubKeyAlgoECDSA PublicKeyAlgorithm = 19 // Deprecated in RFC 4880, Section 13.5. Use key flags instead. PubKeyAlgoRSAEncryptOnly PublicKeyAlgorithm = 2 PubKeyAlgoRSASignOnly PublicKeyAlgorithm = 3 ) // CanEncrypt returns true if it's possible to encrypt a message to a public // key of the given type. func (pka PublicKeyAlgorithm) CanEncrypt() bool { switch pka { case PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly, PubKeyAlgoElGamal: return true } return false } // CanSign returns true if it's possible for a public key of the given type to // sign a message. func (pka PublicKeyAlgorithm) CanSign() bool { switch pka { case PubKeyAlgoRSA, PubKeyAlgoRSASignOnly, PubKeyAlgoDSA, PubKeyAlgoECDSA: return true } return false } // CipherFunction represents the different block ciphers specified for OpenPGP. See // http://www.iana.org/assignments/pgp-parameters/pgp-parameters.xhtml#pgp-parameters-13 type CipherFunction uint8 const ( Cipher3DES CipherFunction = 2 CipherCAST5 CipherFunction = 3 CipherAES128 CipherFunction = 7 CipherAES192 CipherFunction = 8 CipherAES256 CipherFunction = 9 ) // KeySize returns the key size, in bytes, of cipher. func (cipher CipherFunction) KeySize() int { switch cipher { case Cipher3DES: return 24 case CipherCAST5: return cast5.KeySize case CipherAES128: return 16 case CipherAES192: return 24 case CipherAES256: return 32 } return 0 } // blockSize returns the block size, in bytes, of cipher. func (cipher CipherFunction) blockSize() int { switch cipher { case Cipher3DES: return des.BlockSize case CipherCAST5: return 8 case CipherAES128, CipherAES192, CipherAES256: return 16 } return 0 } // new returns a fresh instance of the given cipher. func (cipher CipherFunction) new(key []byte) (block cipher.Block) { switch cipher { case Cipher3DES: block, _ = des.NewTripleDESCipher(key) case CipherCAST5: block, _ = cast5.NewCipher(key) case CipherAES128, CipherAES192, CipherAES256: block, _ = aes.NewCipher(key) } return } // readMPI reads a big integer from r. The bit length returned is the bit // length that was specified in r. This is preserved so that the integer can be // reserialized exactly. func readMPI(r io.Reader) (mpi []byte, bitLength uint16, err error) { var buf [2]byte _, err = readFull(r, buf[0:]) if err != nil { return } bitLength = uint16(buf[0])<<8 | uint16(buf[1]) numBytes := (int(bitLength) + 7) / 8 mpi = make([]byte, numBytes) _, err = readFull(r, mpi) // According to RFC 4880 3.2. we should check that the MPI has no leading // zeroes (at least when not an encrypted MPI?), but this implementation // does generate leading zeroes, so we keep accepting them. return } // writeMPI serializes a big integer to w. func writeMPI(w io.Writer, bitLength uint16, mpiBytes []byte) (err error) { // Note that we can produce leading zeroes, in violation of RFC 4880 3.2. // Implementations seem to be tolerant of them, and stripping them would // make it complex to guarantee matching re-serialization. _, err = w.Write([]byte{byte(bitLength >> 8), byte(bitLength)}) if err == nil { _, err = w.Write(mpiBytes) } return } // writeBig serializes a *big.Int to w. func writeBig(w io.Writer, i *big.Int) error { return writeMPI(w, uint16(i.BitLen()), i.Bytes()) } // padToKeySize left-pads a MPI with zeroes to match the length of the // specified RSA public. func padToKeySize(pub *rsa.PublicKey, b []byte) []byte { k := (pub.N.BitLen() + 7) / 8 if len(b) >= k { return b } bb := make([]byte, k) copy(bb[len(bb)-len(b):], b) return bb } // CompressionAlgo Represents the different compression algorithms // supported by OpenPGP (except for BZIP2, which is not currently // supported). See Section 9.3 of RFC 4880. type CompressionAlgo uint8 const ( CompressionNone CompressionAlgo = 0 CompressionZIP CompressionAlgo = 1 CompressionZLIB CompressionAlgo = 2 ) ================================================ FILE: vendor/golang.org/x/crypto/openpgp/packet/private_key.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package packet import ( "bytes" "crypto" "crypto/cipher" "crypto/dsa" "crypto/ecdsa" "crypto/rsa" "crypto/sha1" "io" "math/big" "strconv" "time" "golang.org/x/crypto/openpgp/elgamal" "golang.org/x/crypto/openpgp/errors" "golang.org/x/crypto/openpgp/s2k" ) // PrivateKey represents a possibly encrypted private key. See RFC 4880, // section 5.5.3. type PrivateKey struct { PublicKey Encrypted bool // if true then the private key is unavailable until Decrypt has been called. encryptedData []byte cipher CipherFunction s2k func(out, in []byte) PrivateKey interface{} // An *{rsa|dsa|ecdsa}.PrivateKey or crypto.Signer/crypto.Decrypter (Decryptor RSA only). sha1Checksum bool iv []byte } func NewRSAPrivateKey(creationTime time.Time, priv *rsa.PrivateKey) *PrivateKey { pk := new(PrivateKey) pk.PublicKey = *NewRSAPublicKey(creationTime, &priv.PublicKey) pk.PrivateKey = priv return pk } func NewDSAPrivateKey(creationTime time.Time, priv *dsa.PrivateKey) *PrivateKey { pk := new(PrivateKey) pk.PublicKey = *NewDSAPublicKey(creationTime, &priv.PublicKey) pk.PrivateKey = priv return pk } func NewElGamalPrivateKey(creationTime time.Time, priv *elgamal.PrivateKey) *PrivateKey { pk := new(PrivateKey) pk.PublicKey = *NewElGamalPublicKey(creationTime, &priv.PublicKey) pk.PrivateKey = priv return pk } func NewECDSAPrivateKey(creationTime time.Time, priv *ecdsa.PrivateKey) *PrivateKey { pk := new(PrivateKey) pk.PublicKey = *NewECDSAPublicKey(creationTime, &priv.PublicKey) pk.PrivateKey = priv return pk } // NewSignerPrivateKey creates a PrivateKey from a crypto.Signer that // implements RSA or ECDSA. func NewSignerPrivateKey(creationTime time.Time, signer crypto.Signer) *PrivateKey { pk := new(PrivateKey) // In general, the public Keys should be used as pointers. We still // type-switch on the values, for backwards-compatibility. switch pubkey := signer.Public().(type) { case *rsa.PublicKey: pk.PublicKey = *NewRSAPublicKey(creationTime, pubkey) case rsa.PublicKey: pk.PublicKey = *NewRSAPublicKey(creationTime, &pubkey) case *ecdsa.PublicKey: pk.PublicKey = *NewECDSAPublicKey(creationTime, pubkey) case ecdsa.PublicKey: pk.PublicKey = *NewECDSAPublicKey(creationTime, &pubkey) default: panic("openpgp: unknown crypto.Signer type in NewSignerPrivateKey") } pk.PrivateKey = signer return pk } func (pk *PrivateKey) parse(r io.Reader) (err error) { err = (&pk.PublicKey).parse(r) if err != nil { return } var buf [1]byte _, err = readFull(r, buf[:]) if err != nil { return } s2kType := buf[0] switch s2kType { case 0: pk.s2k = nil pk.Encrypted = false case 254, 255: _, err = readFull(r, buf[:]) if err != nil { return } pk.cipher = CipherFunction(buf[0]) pk.Encrypted = true pk.s2k, err = s2k.Parse(r) if err != nil { return } if s2kType == 254 { pk.sha1Checksum = true } default: return errors.UnsupportedError("deprecated s2k function in private key") } if pk.Encrypted { blockSize := pk.cipher.blockSize() if blockSize == 0 { return errors.UnsupportedError("unsupported cipher in private key: " + strconv.Itoa(int(pk.cipher))) } pk.iv = make([]byte, blockSize) _, err = readFull(r, pk.iv) if err != nil { return } } pk.encryptedData, err = io.ReadAll(r) if err != nil { return } if !pk.Encrypted { return pk.parsePrivateKey(pk.encryptedData) } return } func mod64kHash(d []byte) uint16 { var h uint16 for _, b := range d { h += uint16(b) } return h } func (pk *PrivateKey) Serialize(w io.Writer) (err error) { // TODO(agl): support encrypted private keys buf := bytes.NewBuffer(nil) err = pk.PublicKey.serializeWithoutHeaders(buf) if err != nil { return } buf.WriteByte(0 /* no encryption */) privateKeyBuf := bytes.NewBuffer(nil) switch priv := pk.PrivateKey.(type) { case *rsa.PrivateKey: err = serializeRSAPrivateKey(privateKeyBuf, priv) case *dsa.PrivateKey: err = serializeDSAPrivateKey(privateKeyBuf, priv) case *elgamal.PrivateKey: err = serializeElGamalPrivateKey(privateKeyBuf, priv) case *ecdsa.PrivateKey: err = serializeECDSAPrivateKey(privateKeyBuf, priv) default: err = errors.InvalidArgumentError("unknown private key type") } if err != nil { return } ptype := packetTypePrivateKey contents := buf.Bytes() privateKeyBytes := privateKeyBuf.Bytes() if pk.IsSubkey { ptype = packetTypePrivateSubkey } err = serializeHeader(w, ptype, len(contents)+len(privateKeyBytes)+2) if err != nil { return } _, err = w.Write(contents) if err != nil { return } _, err = w.Write(privateKeyBytes) if err != nil { return } checksum := mod64kHash(privateKeyBytes) var checksumBytes [2]byte checksumBytes[0] = byte(checksum >> 8) checksumBytes[1] = byte(checksum) _, err = w.Write(checksumBytes[:]) return } func serializeRSAPrivateKey(w io.Writer, priv *rsa.PrivateKey) error { err := writeBig(w, priv.D) if err != nil { return err } err = writeBig(w, priv.Primes[1]) if err != nil { return err } err = writeBig(w, priv.Primes[0]) if err != nil { return err } return writeBig(w, priv.Precomputed.Qinv) } func serializeDSAPrivateKey(w io.Writer, priv *dsa.PrivateKey) error { return writeBig(w, priv.X) } func serializeElGamalPrivateKey(w io.Writer, priv *elgamal.PrivateKey) error { return writeBig(w, priv.X) } func serializeECDSAPrivateKey(w io.Writer, priv *ecdsa.PrivateKey) error { return writeBig(w, priv.D) } // Decrypt decrypts an encrypted private key using a passphrase. func (pk *PrivateKey) Decrypt(passphrase []byte) error { if !pk.Encrypted { return nil } key := make([]byte, pk.cipher.KeySize()) pk.s2k(key, passphrase) block := pk.cipher.new(key) cfb := cipher.NewCFBDecrypter(block, pk.iv) data := make([]byte, len(pk.encryptedData)) cfb.XORKeyStream(data, pk.encryptedData) if pk.sha1Checksum { if len(data) < sha1.Size { return errors.StructuralError("truncated private key data") } h := sha1.New() h.Write(data[:len(data)-sha1.Size]) sum := h.Sum(nil) if !bytes.Equal(sum, data[len(data)-sha1.Size:]) { return errors.StructuralError("private key checksum failure") } data = data[:len(data)-sha1.Size] } else { if len(data) < 2 { return errors.StructuralError("truncated private key data") } var sum uint16 for i := 0; i < len(data)-2; i++ { sum += uint16(data[i]) } if data[len(data)-2] != uint8(sum>>8) || data[len(data)-1] != uint8(sum) { return errors.StructuralError("private key checksum failure") } data = data[:len(data)-2] } return pk.parsePrivateKey(data) } func (pk *PrivateKey) parsePrivateKey(data []byte) (err error) { switch pk.PublicKey.PubKeyAlgo { case PubKeyAlgoRSA, PubKeyAlgoRSASignOnly, PubKeyAlgoRSAEncryptOnly: return pk.parseRSAPrivateKey(data) case PubKeyAlgoDSA: return pk.parseDSAPrivateKey(data) case PubKeyAlgoElGamal: return pk.parseElGamalPrivateKey(data) case PubKeyAlgoECDSA: return pk.parseECDSAPrivateKey(data) } panic("impossible") } func (pk *PrivateKey) parseRSAPrivateKey(data []byte) (err error) { rsaPub := pk.PublicKey.PublicKey.(*rsa.PublicKey) rsaPriv := new(rsa.PrivateKey) rsaPriv.PublicKey = *rsaPub buf := bytes.NewBuffer(data) d, _, err := readMPI(buf) if err != nil { return } p, _, err := readMPI(buf) if err != nil { return } q, _, err := readMPI(buf) if err != nil { return } rsaPriv.D = new(big.Int).SetBytes(d) rsaPriv.Primes = make([]*big.Int, 2) rsaPriv.Primes[0] = new(big.Int).SetBytes(p) rsaPriv.Primes[1] = new(big.Int).SetBytes(q) if err := rsaPriv.Validate(); err != nil { return err } rsaPriv.Precompute() pk.PrivateKey = rsaPriv pk.Encrypted = false pk.encryptedData = nil return nil } func (pk *PrivateKey) parseDSAPrivateKey(data []byte) (err error) { dsaPub := pk.PublicKey.PublicKey.(*dsa.PublicKey) dsaPriv := new(dsa.PrivateKey) dsaPriv.PublicKey = *dsaPub buf := bytes.NewBuffer(data) x, _, err := readMPI(buf) if err != nil { return } dsaPriv.X = new(big.Int).SetBytes(x) pk.PrivateKey = dsaPriv pk.Encrypted = false pk.encryptedData = nil return nil } func (pk *PrivateKey) parseElGamalPrivateKey(data []byte) (err error) { pub := pk.PublicKey.PublicKey.(*elgamal.PublicKey) priv := new(elgamal.PrivateKey) priv.PublicKey = *pub buf := bytes.NewBuffer(data) x, _, err := readMPI(buf) if err != nil { return } priv.X = new(big.Int).SetBytes(x) pk.PrivateKey = priv pk.Encrypted = false pk.encryptedData = nil return nil } func (pk *PrivateKey) parseECDSAPrivateKey(data []byte) (err error) { ecdsaPub := pk.PublicKey.PublicKey.(*ecdsa.PublicKey) buf := bytes.NewBuffer(data) d, _, err := readMPI(buf) if err != nil { return } pk.PrivateKey = &ecdsa.PrivateKey{ PublicKey: *ecdsaPub, D: new(big.Int).SetBytes(d), } pk.Encrypted = false pk.encryptedData = nil return nil } ================================================ FILE: vendor/golang.org/x/crypto/openpgp/packet/public_key.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package packet import ( "bytes" "crypto" "crypto/dsa" "crypto/ecdsa" "crypto/elliptic" "crypto/rsa" "crypto/sha1" _ "crypto/sha256" _ "crypto/sha512" "encoding/binary" "fmt" "hash" "io" "math/big" "strconv" "time" "golang.org/x/crypto/openpgp/elgamal" "golang.org/x/crypto/openpgp/errors" ) var ( // NIST curve P-256 oidCurveP256 []byte = []byte{0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01, 0x07} // NIST curve P-384 oidCurveP384 []byte = []byte{0x2B, 0x81, 0x04, 0x00, 0x22} // NIST curve P-521 oidCurveP521 []byte = []byte{0x2B, 0x81, 0x04, 0x00, 0x23} ) const maxOIDLength = 8 // ecdsaKey stores the algorithm-specific fields for ECDSA keys. // as defined in RFC 6637, Section 9. type ecdsaKey struct { // oid contains the OID byte sequence identifying the elliptic curve used oid []byte // p contains the elliptic curve point that represents the public key p parsedMPI } // parseOID reads the OID for the curve as defined in RFC 6637, Section 9. func parseOID(r io.Reader) (oid []byte, err error) { buf := make([]byte, maxOIDLength) if _, err = readFull(r, buf[:1]); err != nil { return } oidLen := buf[0] if int(oidLen) > len(buf) { err = errors.UnsupportedError("invalid oid length: " + strconv.Itoa(int(oidLen))) return } oid = buf[:oidLen] _, err = readFull(r, oid) return } func (f *ecdsaKey) parse(r io.Reader) (err error) { if f.oid, err = parseOID(r); err != nil { return err } f.p.bytes, f.p.bitLength, err = readMPI(r) return } func (f *ecdsaKey) serialize(w io.Writer) (err error) { buf := make([]byte, maxOIDLength+1) buf[0] = byte(len(f.oid)) copy(buf[1:], f.oid) if _, err = w.Write(buf[:len(f.oid)+1]); err != nil { return } return writeMPIs(w, f.p) } func (f *ecdsaKey) newECDSA() (*ecdsa.PublicKey, error) { var c elliptic.Curve if bytes.Equal(f.oid, oidCurveP256) { c = elliptic.P256() } else if bytes.Equal(f.oid, oidCurveP384) { c = elliptic.P384() } else if bytes.Equal(f.oid, oidCurveP521) { c = elliptic.P521() } else { return nil, errors.UnsupportedError(fmt.Sprintf("unsupported oid: %x", f.oid)) } x, y := elliptic.Unmarshal(c, f.p.bytes) if x == nil { return nil, errors.UnsupportedError("failed to parse EC point") } return &ecdsa.PublicKey{Curve: c, X: x, Y: y}, nil } func (f *ecdsaKey) byteLen() int { return 1 + len(f.oid) + 2 + len(f.p.bytes) } type kdfHashFunction byte type kdfAlgorithm byte // ecdhKdf stores key derivation function parameters // used for ECDH encryption. See RFC 6637, Section 9. type ecdhKdf struct { KdfHash kdfHashFunction KdfAlgo kdfAlgorithm } func (f *ecdhKdf) parse(r io.Reader) (err error) { buf := make([]byte, 1) if _, err = readFull(r, buf); err != nil { return } kdfLen := int(buf[0]) if kdfLen < 3 { return errors.UnsupportedError("Unsupported ECDH KDF length: " + strconv.Itoa(kdfLen)) } buf = make([]byte, kdfLen) if _, err = readFull(r, buf); err != nil { return } reserved := int(buf[0]) f.KdfHash = kdfHashFunction(buf[1]) f.KdfAlgo = kdfAlgorithm(buf[2]) if reserved != 0x01 { return errors.UnsupportedError("Unsupported KDF reserved field: " + strconv.Itoa(reserved)) } return } func (f *ecdhKdf) serialize(w io.Writer) (err error) { buf := make([]byte, 4) // See RFC 6637, Section 9, Algorithm-Specific Fields for ECDH keys. buf[0] = byte(0x03) // Length of the following fields buf[1] = byte(0x01) // Reserved for future extensions, must be 1 for now buf[2] = byte(f.KdfHash) buf[3] = byte(f.KdfAlgo) _, err = w.Write(buf[:]) return } func (f *ecdhKdf) byteLen() int { return 4 } // PublicKey represents an OpenPGP public key. See RFC 4880, section 5.5.2. type PublicKey struct { CreationTime time.Time PubKeyAlgo PublicKeyAlgorithm PublicKey interface{} // *rsa.PublicKey, *dsa.PublicKey or *ecdsa.PublicKey Fingerprint [20]byte KeyId uint64 IsSubkey bool n, e, p, q, g, y parsedMPI // RFC 6637 fields ec *ecdsaKey ecdh *ecdhKdf } // signingKey provides a convenient abstraction over signature verification // for v3 and v4 public keys. type signingKey interface { SerializeSignaturePrefix(io.Writer) serializeWithoutHeaders(io.Writer) error } func fromBig(n *big.Int) parsedMPI { return parsedMPI{ bytes: n.Bytes(), bitLength: uint16(n.BitLen()), } } // NewRSAPublicKey returns a PublicKey that wraps the given rsa.PublicKey. func NewRSAPublicKey(creationTime time.Time, pub *rsa.PublicKey) *PublicKey { pk := &PublicKey{ CreationTime: creationTime, PubKeyAlgo: PubKeyAlgoRSA, PublicKey: pub, n: fromBig(pub.N), e: fromBig(big.NewInt(int64(pub.E))), } pk.setFingerPrintAndKeyId() return pk } // NewDSAPublicKey returns a PublicKey that wraps the given dsa.PublicKey. func NewDSAPublicKey(creationTime time.Time, pub *dsa.PublicKey) *PublicKey { pk := &PublicKey{ CreationTime: creationTime, PubKeyAlgo: PubKeyAlgoDSA, PublicKey: pub, p: fromBig(pub.P), q: fromBig(pub.Q), g: fromBig(pub.G), y: fromBig(pub.Y), } pk.setFingerPrintAndKeyId() return pk } // NewElGamalPublicKey returns a PublicKey that wraps the given elgamal.PublicKey. func NewElGamalPublicKey(creationTime time.Time, pub *elgamal.PublicKey) *PublicKey { pk := &PublicKey{ CreationTime: creationTime, PubKeyAlgo: PubKeyAlgoElGamal, PublicKey: pub, p: fromBig(pub.P), g: fromBig(pub.G), y: fromBig(pub.Y), } pk.setFingerPrintAndKeyId() return pk } func NewECDSAPublicKey(creationTime time.Time, pub *ecdsa.PublicKey) *PublicKey { pk := &PublicKey{ CreationTime: creationTime, PubKeyAlgo: PubKeyAlgoECDSA, PublicKey: pub, ec: new(ecdsaKey), } switch pub.Curve { case elliptic.P256(): pk.ec.oid = oidCurveP256 case elliptic.P384(): pk.ec.oid = oidCurveP384 case elliptic.P521(): pk.ec.oid = oidCurveP521 default: panic("unknown elliptic curve") } pk.ec.p.bytes = elliptic.Marshal(pub.Curve, pub.X, pub.Y) // The bit length is 3 (for the 0x04 specifying an uncompressed key) // plus two field elements (for x and y), which are rounded up to the // nearest byte. See https://tools.ietf.org/html/rfc6637#section-6 fieldBytes := (pub.Curve.Params().BitSize + 7) & ^7 pk.ec.p.bitLength = uint16(3 + fieldBytes + fieldBytes) pk.setFingerPrintAndKeyId() return pk } func (pk *PublicKey) parse(r io.Reader) (err error) { // RFC 4880, section 5.5.2 var buf [6]byte _, err = readFull(r, buf[:]) if err != nil { return } if buf[0] != 4 { return errors.UnsupportedError("public key version") } pk.CreationTime = time.Unix(int64(uint32(buf[1])<<24|uint32(buf[2])<<16|uint32(buf[3])<<8|uint32(buf[4])), 0) pk.PubKeyAlgo = PublicKeyAlgorithm(buf[5]) switch pk.PubKeyAlgo { case PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly, PubKeyAlgoRSASignOnly: err = pk.parseRSA(r) case PubKeyAlgoDSA: err = pk.parseDSA(r) case PubKeyAlgoElGamal: err = pk.parseElGamal(r) case PubKeyAlgoECDSA: pk.ec = new(ecdsaKey) if err = pk.ec.parse(r); err != nil { return err } pk.PublicKey, err = pk.ec.newECDSA() case PubKeyAlgoECDH: pk.ec = new(ecdsaKey) if err = pk.ec.parse(r); err != nil { return } pk.ecdh = new(ecdhKdf) if err = pk.ecdh.parse(r); err != nil { return } // The ECDH key is stored in an ecdsa.PublicKey for convenience. pk.PublicKey, err = pk.ec.newECDSA() default: err = errors.UnsupportedError("public key type: " + strconv.Itoa(int(pk.PubKeyAlgo))) } if err != nil { return } pk.setFingerPrintAndKeyId() return } func (pk *PublicKey) setFingerPrintAndKeyId() { // RFC 4880, section 12.2 fingerPrint := sha1.New() pk.SerializeSignaturePrefix(fingerPrint) pk.serializeWithoutHeaders(fingerPrint) copy(pk.Fingerprint[:], fingerPrint.Sum(nil)) pk.KeyId = binary.BigEndian.Uint64(pk.Fingerprint[12:20]) } // parseRSA parses RSA public key material from the given Reader. See RFC 4880, // section 5.5.2. func (pk *PublicKey) parseRSA(r io.Reader) (err error) { pk.n.bytes, pk.n.bitLength, err = readMPI(r) if err != nil { return } pk.e.bytes, pk.e.bitLength, err = readMPI(r) if err != nil { return } if len(pk.e.bytes) > 3 { err = errors.UnsupportedError("large public exponent") return } rsa := &rsa.PublicKey{ N: new(big.Int).SetBytes(pk.n.bytes), E: 0, } for i := 0; i < len(pk.e.bytes); i++ { rsa.E <<= 8 rsa.E |= int(pk.e.bytes[i]) } pk.PublicKey = rsa return } // parseDSA parses DSA public key material from the given Reader. See RFC 4880, // section 5.5.2. func (pk *PublicKey) parseDSA(r io.Reader) (err error) { pk.p.bytes, pk.p.bitLength, err = readMPI(r) if err != nil { return } pk.q.bytes, pk.q.bitLength, err = readMPI(r) if err != nil { return } pk.g.bytes, pk.g.bitLength, err = readMPI(r) if err != nil { return } pk.y.bytes, pk.y.bitLength, err = readMPI(r) if err != nil { return } dsa := new(dsa.PublicKey) dsa.P = new(big.Int).SetBytes(pk.p.bytes) dsa.Q = new(big.Int).SetBytes(pk.q.bytes) dsa.G = new(big.Int).SetBytes(pk.g.bytes) dsa.Y = new(big.Int).SetBytes(pk.y.bytes) pk.PublicKey = dsa return } // parseElGamal parses ElGamal public key material from the given Reader. See // RFC 4880, section 5.5.2. func (pk *PublicKey) parseElGamal(r io.Reader) (err error) { pk.p.bytes, pk.p.bitLength, err = readMPI(r) if err != nil { return } pk.g.bytes, pk.g.bitLength, err = readMPI(r) if err != nil { return } pk.y.bytes, pk.y.bitLength, err = readMPI(r) if err != nil { return } elgamal := new(elgamal.PublicKey) elgamal.P = new(big.Int).SetBytes(pk.p.bytes) elgamal.G = new(big.Int).SetBytes(pk.g.bytes) elgamal.Y = new(big.Int).SetBytes(pk.y.bytes) pk.PublicKey = elgamal return } // SerializeSignaturePrefix writes the prefix for this public key to the given Writer. // The prefix is used when calculating a signature over this public key. See // RFC 4880, section 5.2.4. func (pk *PublicKey) SerializeSignaturePrefix(h io.Writer) { var pLength uint16 switch pk.PubKeyAlgo { case PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly, PubKeyAlgoRSASignOnly: pLength += 2 + uint16(len(pk.n.bytes)) pLength += 2 + uint16(len(pk.e.bytes)) case PubKeyAlgoDSA: pLength += 2 + uint16(len(pk.p.bytes)) pLength += 2 + uint16(len(pk.q.bytes)) pLength += 2 + uint16(len(pk.g.bytes)) pLength += 2 + uint16(len(pk.y.bytes)) case PubKeyAlgoElGamal: pLength += 2 + uint16(len(pk.p.bytes)) pLength += 2 + uint16(len(pk.g.bytes)) pLength += 2 + uint16(len(pk.y.bytes)) case PubKeyAlgoECDSA: pLength += uint16(pk.ec.byteLen()) case PubKeyAlgoECDH: pLength += uint16(pk.ec.byteLen()) pLength += uint16(pk.ecdh.byteLen()) default: panic("unknown public key algorithm") } pLength += 6 h.Write([]byte{0x99, byte(pLength >> 8), byte(pLength)}) return } func (pk *PublicKey) Serialize(w io.Writer) (err error) { length := 6 // 6 byte header switch pk.PubKeyAlgo { case PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly, PubKeyAlgoRSASignOnly: length += 2 + len(pk.n.bytes) length += 2 + len(pk.e.bytes) case PubKeyAlgoDSA: length += 2 + len(pk.p.bytes) length += 2 + len(pk.q.bytes) length += 2 + len(pk.g.bytes) length += 2 + len(pk.y.bytes) case PubKeyAlgoElGamal: length += 2 + len(pk.p.bytes) length += 2 + len(pk.g.bytes) length += 2 + len(pk.y.bytes) case PubKeyAlgoECDSA: length += pk.ec.byteLen() case PubKeyAlgoECDH: length += pk.ec.byteLen() length += pk.ecdh.byteLen() default: panic("unknown public key algorithm") } packetType := packetTypePublicKey if pk.IsSubkey { packetType = packetTypePublicSubkey } err = serializeHeader(w, packetType, length) if err != nil { return } return pk.serializeWithoutHeaders(w) } // serializeWithoutHeaders marshals the PublicKey to w in the form of an // OpenPGP public key packet, not including the packet header. func (pk *PublicKey) serializeWithoutHeaders(w io.Writer) (err error) { var buf [6]byte buf[0] = 4 t := uint32(pk.CreationTime.Unix()) buf[1] = byte(t >> 24) buf[2] = byte(t >> 16) buf[3] = byte(t >> 8) buf[4] = byte(t) buf[5] = byte(pk.PubKeyAlgo) _, err = w.Write(buf[:]) if err != nil { return } switch pk.PubKeyAlgo { case PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly, PubKeyAlgoRSASignOnly: return writeMPIs(w, pk.n, pk.e) case PubKeyAlgoDSA: return writeMPIs(w, pk.p, pk.q, pk.g, pk.y) case PubKeyAlgoElGamal: return writeMPIs(w, pk.p, pk.g, pk.y) case PubKeyAlgoECDSA: return pk.ec.serialize(w) case PubKeyAlgoECDH: if err = pk.ec.serialize(w); err != nil { return } return pk.ecdh.serialize(w) } return errors.InvalidArgumentError("bad public-key algorithm") } // CanSign returns true iff this public key can generate signatures func (pk *PublicKey) CanSign() bool { return pk.PubKeyAlgo != PubKeyAlgoRSAEncryptOnly && pk.PubKeyAlgo != PubKeyAlgoElGamal } // VerifySignature returns nil iff sig is a valid signature, made by this // public key, of the data hashed into signed. signed is mutated by this call. func (pk *PublicKey) VerifySignature(signed hash.Hash, sig *Signature) (err error) { if !pk.CanSign() { return errors.InvalidArgumentError("public key cannot generate signatures") } signed.Write(sig.HashSuffix) hashBytes := signed.Sum(nil) if hashBytes[0] != sig.HashTag[0] || hashBytes[1] != sig.HashTag[1] { return errors.SignatureError("hash tag doesn't match") } if pk.PubKeyAlgo != sig.PubKeyAlgo { return errors.InvalidArgumentError("public key and signature use different algorithms") } switch pk.PubKeyAlgo { case PubKeyAlgoRSA, PubKeyAlgoRSASignOnly: rsaPublicKey, _ := pk.PublicKey.(*rsa.PublicKey) err = rsa.VerifyPKCS1v15(rsaPublicKey, sig.Hash, hashBytes, padToKeySize(rsaPublicKey, sig.RSASignature.bytes)) if err != nil { return errors.SignatureError("RSA verification failure") } return nil case PubKeyAlgoDSA: dsaPublicKey, _ := pk.PublicKey.(*dsa.PublicKey) // Need to truncate hashBytes to match FIPS 186-3 section 4.6. subgroupSize := (dsaPublicKey.Q.BitLen() + 7) / 8 if len(hashBytes) > subgroupSize { hashBytes = hashBytes[:subgroupSize] } if !dsa.Verify(dsaPublicKey, hashBytes, new(big.Int).SetBytes(sig.DSASigR.bytes), new(big.Int).SetBytes(sig.DSASigS.bytes)) { return errors.SignatureError("DSA verification failure") } return nil case PubKeyAlgoECDSA: ecdsaPublicKey := pk.PublicKey.(*ecdsa.PublicKey) if !ecdsa.Verify(ecdsaPublicKey, hashBytes, new(big.Int).SetBytes(sig.ECDSASigR.bytes), new(big.Int).SetBytes(sig.ECDSASigS.bytes)) { return errors.SignatureError("ECDSA verification failure") } return nil default: return errors.SignatureError("Unsupported public key algorithm used in signature") } } // VerifySignatureV3 returns nil iff sig is a valid signature, made by this // public key, of the data hashed into signed. signed is mutated by this call. func (pk *PublicKey) VerifySignatureV3(signed hash.Hash, sig *SignatureV3) (err error) { if !pk.CanSign() { return errors.InvalidArgumentError("public key cannot generate signatures") } suffix := make([]byte, 5) suffix[0] = byte(sig.SigType) binary.BigEndian.PutUint32(suffix[1:], uint32(sig.CreationTime.Unix())) signed.Write(suffix) hashBytes := signed.Sum(nil) if hashBytes[0] != sig.HashTag[0] || hashBytes[1] != sig.HashTag[1] { return errors.SignatureError("hash tag doesn't match") } if pk.PubKeyAlgo != sig.PubKeyAlgo { return errors.InvalidArgumentError("public key and signature use different algorithms") } switch pk.PubKeyAlgo { case PubKeyAlgoRSA, PubKeyAlgoRSASignOnly: rsaPublicKey := pk.PublicKey.(*rsa.PublicKey) if err = rsa.VerifyPKCS1v15(rsaPublicKey, sig.Hash, hashBytes, padToKeySize(rsaPublicKey, sig.RSASignature.bytes)); err != nil { return errors.SignatureError("RSA verification failure") } return case PubKeyAlgoDSA: dsaPublicKey := pk.PublicKey.(*dsa.PublicKey) // Need to truncate hashBytes to match FIPS 186-3 section 4.6. subgroupSize := (dsaPublicKey.Q.BitLen() + 7) / 8 if len(hashBytes) > subgroupSize { hashBytes = hashBytes[:subgroupSize] } if !dsa.Verify(dsaPublicKey, hashBytes, new(big.Int).SetBytes(sig.DSASigR.bytes), new(big.Int).SetBytes(sig.DSASigS.bytes)) { return errors.SignatureError("DSA verification failure") } return nil default: panic("shouldn't happen") } } // keySignatureHash returns a Hash of the message that needs to be signed for // pk to assert a subkey relationship to signed. func keySignatureHash(pk, signed signingKey, hashFunc crypto.Hash) (h hash.Hash, err error) { if !hashFunc.Available() { return nil, errors.UnsupportedError("hash function") } h = hashFunc.New() // RFC 4880, section 5.2.4 pk.SerializeSignaturePrefix(h) pk.serializeWithoutHeaders(h) signed.SerializeSignaturePrefix(h) signed.serializeWithoutHeaders(h) return } // VerifyKeySignature returns nil iff sig is a valid signature, made by this // public key, of signed. func (pk *PublicKey) VerifyKeySignature(signed *PublicKey, sig *Signature) error { h, err := keySignatureHash(pk, signed, sig.Hash) if err != nil { return err } if err = pk.VerifySignature(h, sig); err != nil { return err } if sig.FlagSign { // Signing subkeys must be cross-signed. See // https://www.gnupg.org/faq/subkey-cross-certify.html. if sig.EmbeddedSignature == nil { return errors.StructuralError("signing subkey is missing cross-signature") } // Verify the cross-signature. This is calculated over the same // data as the main signature, so we cannot just recursively // call signed.VerifyKeySignature(...) if h, err = keySignatureHash(pk, signed, sig.EmbeddedSignature.Hash); err != nil { return errors.StructuralError("error while hashing for cross-signature: " + err.Error()) } if err := signed.VerifySignature(h, sig.EmbeddedSignature); err != nil { return errors.StructuralError("error while verifying cross-signature: " + err.Error()) } } return nil } func keyRevocationHash(pk signingKey, hashFunc crypto.Hash) (h hash.Hash, err error) { if !hashFunc.Available() { return nil, errors.UnsupportedError("hash function") } h = hashFunc.New() // RFC 4880, section 5.2.4 pk.SerializeSignaturePrefix(h) pk.serializeWithoutHeaders(h) return } // VerifyRevocationSignature returns nil iff sig is a valid signature, made by this // public key. func (pk *PublicKey) VerifyRevocationSignature(sig *Signature) (err error) { h, err := keyRevocationHash(pk, sig.Hash) if err != nil { return err } return pk.VerifySignature(h, sig) } // userIdSignatureHash returns a Hash of the message that needs to be signed // to assert that pk is a valid key for id. func userIdSignatureHash(id string, pk *PublicKey, hashFunc crypto.Hash) (h hash.Hash, err error) { if !hashFunc.Available() { return nil, errors.UnsupportedError("hash function") } h = hashFunc.New() // RFC 4880, section 5.2.4 pk.SerializeSignaturePrefix(h) pk.serializeWithoutHeaders(h) var buf [5]byte buf[0] = 0xb4 buf[1] = byte(len(id) >> 24) buf[2] = byte(len(id) >> 16) buf[3] = byte(len(id) >> 8) buf[4] = byte(len(id)) h.Write(buf[:]) h.Write([]byte(id)) return } // VerifyUserIdSignature returns nil iff sig is a valid signature, made by this // public key, that id is the identity of pub. func (pk *PublicKey) VerifyUserIdSignature(id string, pub *PublicKey, sig *Signature) (err error) { h, err := userIdSignatureHash(id, pub, sig.Hash) if err != nil { return err } return pk.VerifySignature(h, sig) } // VerifyUserIdSignatureV3 returns nil iff sig is a valid signature, made by this // public key, that id is the identity of pub. func (pk *PublicKey) VerifyUserIdSignatureV3(id string, pub *PublicKey, sig *SignatureV3) (err error) { h, err := userIdSignatureV3Hash(id, pub, sig.Hash) if err != nil { return err } return pk.VerifySignatureV3(h, sig) } // KeyIdString returns the public key's fingerprint in capital hex // (e.g. "6C7EE1B8621CC013"). func (pk *PublicKey) KeyIdString() string { return fmt.Sprintf("%X", pk.Fingerprint[12:20]) } // KeyIdShortString returns the short form of public key's fingerprint // in capital hex, as shown by gpg --list-keys (e.g. "621CC013"). func (pk *PublicKey) KeyIdShortString() string { return fmt.Sprintf("%X", pk.Fingerprint[16:20]) } // A parsedMPI is used to store the contents of a big integer, along with the // bit length that was specified in the original input. This allows the MPI to // be reserialized exactly. type parsedMPI struct { bytes []byte bitLength uint16 } // writeMPIs is a utility function for serializing several big integers to the // given Writer. func writeMPIs(w io.Writer, mpis ...parsedMPI) (err error) { for _, mpi := range mpis { err = writeMPI(w, mpi.bitLength, mpi.bytes) if err != nil { return } } return } // BitLength returns the bit length for the given public key. func (pk *PublicKey) BitLength() (bitLength uint16, err error) { switch pk.PubKeyAlgo { case PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly, PubKeyAlgoRSASignOnly: bitLength = pk.n.bitLength case PubKeyAlgoDSA: bitLength = pk.p.bitLength case PubKeyAlgoElGamal: bitLength = pk.p.bitLength default: err = errors.InvalidArgumentError("bad public-key algorithm") } return } ================================================ FILE: vendor/golang.org/x/crypto/openpgp/packet/public_key_v3.go ================================================ // Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package packet import ( "crypto" "crypto/md5" "crypto/rsa" "encoding/binary" "fmt" "hash" "io" "math/big" "strconv" "time" "golang.org/x/crypto/openpgp/errors" ) // PublicKeyV3 represents older, version 3 public keys. These keys are less secure and // should not be used for signing or encrypting. They are supported here only for // parsing version 3 key material and validating signatures. // See RFC 4880, section 5.5.2. type PublicKeyV3 struct { CreationTime time.Time DaysToExpire uint16 PubKeyAlgo PublicKeyAlgorithm PublicKey *rsa.PublicKey Fingerprint [16]byte KeyId uint64 IsSubkey bool n, e parsedMPI } // newRSAPublicKeyV3 returns a PublicKey that wraps the given rsa.PublicKey. // Included here for testing purposes only. RFC 4880, section 5.5.2: // "an implementation MUST NOT generate a V3 key, but MAY accept it." func newRSAPublicKeyV3(creationTime time.Time, pub *rsa.PublicKey) *PublicKeyV3 { pk := &PublicKeyV3{ CreationTime: creationTime, PublicKey: pub, n: fromBig(pub.N), e: fromBig(big.NewInt(int64(pub.E))), } pk.setFingerPrintAndKeyId() return pk } func (pk *PublicKeyV3) parse(r io.Reader) (err error) { // RFC 4880, section 5.5.2 var buf [8]byte if _, err = readFull(r, buf[:]); err != nil { return } if buf[0] < 2 || buf[0] > 3 { return errors.UnsupportedError("public key version") } pk.CreationTime = time.Unix(int64(uint32(buf[1])<<24|uint32(buf[2])<<16|uint32(buf[3])<<8|uint32(buf[4])), 0) pk.DaysToExpire = binary.BigEndian.Uint16(buf[5:7]) pk.PubKeyAlgo = PublicKeyAlgorithm(buf[7]) switch pk.PubKeyAlgo { case PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly, PubKeyAlgoRSASignOnly: err = pk.parseRSA(r) default: err = errors.UnsupportedError("public key type: " + strconv.Itoa(int(pk.PubKeyAlgo))) } if err != nil { return } pk.setFingerPrintAndKeyId() return } func (pk *PublicKeyV3) setFingerPrintAndKeyId() { // RFC 4880, section 12.2 fingerPrint := md5.New() fingerPrint.Write(pk.n.bytes) fingerPrint.Write(pk.e.bytes) fingerPrint.Sum(pk.Fingerprint[:0]) pk.KeyId = binary.BigEndian.Uint64(pk.n.bytes[len(pk.n.bytes)-8:]) } // parseRSA parses RSA public key material from the given Reader. See RFC 4880, // section 5.5.2. func (pk *PublicKeyV3) parseRSA(r io.Reader) (err error) { if pk.n.bytes, pk.n.bitLength, err = readMPI(r); err != nil { return } if pk.e.bytes, pk.e.bitLength, err = readMPI(r); err != nil { return } // RFC 4880 Section 12.2 requires the low 8 bytes of the // modulus to form the key id. if len(pk.n.bytes) < 8 { return errors.StructuralError("v3 public key modulus is too short") } if len(pk.e.bytes) > 3 { err = errors.UnsupportedError("large public exponent") return } rsa := &rsa.PublicKey{N: new(big.Int).SetBytes(pk.n.bytes)} for i := 0; i < len(pk.e.bytes); i++ { rsa.E <<= 8 rsa.E |= int(pk.e.bytes[i]) } pk.PublicKey = rsa return } // SerializeSignaturePrefix writes the prefix for this public key to the given Writer. // The prefix is used when calculating a signature over this public key. See // RFC 4880, section 5.2.4. func (pk *PublicKeyV3) SerializeSignaturePrefix(w io.Writer) { var pLength uint16 switch pk.PubKeyAlgo { case PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly, PubKeyAlgoRSASignOnly: pLength += 2 + uint16(len(pk.n.bytes)) pLength += 2 + uint16(len(pk.e.bytes)) default: panic("unknown public key algorithm") } pLength += 6 w.Write([]byte{0x99, byte(pLength >> 8), byte(pLength)}) return } func (pk *PublicKeyV3) Serialize(w io.Writer) (err error) { length := 8 // 8 byte header switch pk.PubKeyAlgo { case PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly, PubKeyAlgoRSASignOnly: length += 2 + len(pk.n.bytes) length += 2 + len(pk.e.bytes) default: panic("unknown public key algorithm") } packetType := packetTypePublicKey if pk.IsSubkey { packetType = packetTypePublicSubkey } if err = serializeHeader(w, packetType, length); err != nil { return } return pk.serializeWithoutHeaders(w) } // serializeWithoutHeaders marshals the PublicKey to w in the form of an // OpenPGP public key packet, not including the packet header. func (pk *PublicKeyV3) serializeWithoutHeaders(w io.Writer) (err error) { var buf [8]byte // Version 3 buf[0] = 3 // Creation time t := uint32(pk.CreationTime.Unix()) buf[1] = byte(t >> 24) buf[2] = byte(t >> 16) buf[3] = byte(t >> 8) buf[4] = byte(t) // Days to expire buf[5] = byte(pk.DaysToExpire >> 8) buf[6] = byte(pk.DaysToExpire) // Public key algorithm buf[7] = byte(pk.PubKeyAlgo) if _, err = w.Write(buf[:]); err != nil { return } switch pk.PubKeyAlgo { case PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly, PubKeyAlgoRSASignOnly: return writeMPIs(w, pk.n, pk.e) } return errors.InvalidArgumentError("bad public-key algorithm") } // CanSign returns true iff this public key can generate signatures func (pk *PublicKeyV3) CanSign() bool { return pk.PubKeyAlgo != PubKeyAlgoRSAEncryptOnly } // VerifySignatureV3 returns nil iff sig is a valid signature, made by this // public key, of the data hashed into signed. signed is mutated by this call. func (pk *PublicKeyV3) VerifySignatureV3(signed hash.Hash, sig *SignatureV3) (err error) { if !pk.CanSign() { return errors.InvalidArgumentError("public key cannot generate signatures") } suffix := make([]byte, 5) suffix[0] = byte(sig.SigType) binary.BigEndian.PutUint32(suffix[1:], uint32(sig.CreationTime.Unix())) signed.Write(suffix) hashBytes := signed.Sum(nil) if hashBytes[0] != sig.HashTag[0] || hashBytes[1] != sig.HashTag[1] { return errors.SignatureError("hash tag doesn't match") } if pk.PubKeyAlgo != sig.PubKeyAlgo { return errors.InvalidArgumentError("public key and signature use different algorithms") } switch pk.PubKeyAlgo { case PubKeyAlgoRSA, PubKeyAlgoRSASignOnly: if err = rsa.VerifyPKCS1v15(pk.PublicKey, sig.Hash, hashBytes, sig.RSASignature.bytes); err != nil { return errors.SignatureError("RSA verification failure") } return default: // V3 public keys only support RSA. panic("shouldn't happen") } } // VerifyUserIdSignatureV3 returns nil iff sig is a valid signature, made by this // public key, that id is the identity of pub. func (pk *PublicKeyV3) VerifyUserIdSignatureV3(id string, pub *PublicKeyV3, sig *SignatureV3) (err error) { h, err := userIdSignatureV3Hash(id, pk, sig.Hash) if err != nil { return err } return pk.VerifySignatureV3(h, sig) } // VerifyKeySignatureV3 returns nil iff sig is a valid signature, made by this // public key, of signed. func (pk *PublicKeyV3) VerifyKeySignatureV3(signed *PublicKeyV3, sig *SignatureV3) (err error) { h, err := keySignatureHash(pk, signed, sig.Hash) if err != nil { return err } return pk.VerifySignatureV3(h, sig) } // userIdSignatureV3Hash returns a Hash of the message that needs to be signed // to assert that pk is a valid key for id. func userIdSignatureV3Hash(id string, pk signingKey, hfn crypto.Hash) (h hash.Hash, err error) { if !hfn.Available() { return nil, errors.UnsupportedError("hash function") } h = hfn.New() // RFC 4880, section 5.2.4 pk.SerializeSignaturePrefix(h) pk.serializeWithoutHeaders(h) h.Write([]byte(id)) return } // KeyIdString returns the public key's fingerprint in capital hex // (e.g. "6C7EE1B8621CC013"). func (pk *PublicKeyV3) KeyIdString() string { return fmt.Sprintf("%X", pk.KeyId) } // KeyIdShortString returns the short form of public key's fingerprint // in capital hex, as shown by gpg --list-keys (e.g. "621CC013"). func (pk *PublicKeyV3) KeyIdShortString() string { return fmt.Sprintf("%X", pk.KeyId&0xFFFFFFFF) } // BitLength returns the bit length for the given public key. func (pk *PublicKeyV3) BitLength() (bitLength uint16, err error) { switch pk.PubKeyAlgo { case PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly, PubKeyAlgoRSASignOnly: bitLength = pk.n.bitLength default: err = errors.InvalidArgumentError("bad public-key algorithm") } return } ================================================ FILE: vendor/golang.org/x/crypto/openpgp/packet/reader.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package packet import ( "golang.org/x/crypto/openpgp/errors" "io" ) // Reader reads packets from an io.Reader and allows packets to be 'unread' so // that they result from the next call to Next. type Reader struct { q []Packet readers []io.Reader } // New io.Readers are pushed when a compressed or encrypted packet is processed // and recursively treated as a new source of packets. However, a carefully // crafted packet can trigger an infinite recursive sequence of packets. See // http://mumble.net/~campbell/misc/pgp-quine // https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2013-4402 // This constant limits the number of recursive packets that may be pushed. const maxReaders = 32 // Next returns the most recently unread Packet, or reads another packet from // the top-most io.Reader. Unknown packet types are skipped. func (r *Reader) Next() (p Packet, err error) { if len(r.q) > 0 { p = r.q[len(r.q)-1] r.q = r.q[:len(r.q)-1] return } for len(r.readers) > 0 { p, err = Read(r.readers[len(r.readers)-1]) if err == nil { return } if err == io.EOF { r.readers = r.readers[:len(r.readers)-1] continue } if _, ok := err.(errors.UnknownPacketTypeError); !ok { return nil, err } } return nil, io.EOF } // Push causes the Reader to start reading from a new io.Reader. When an EOF // error is seen from the new io.Reader, it is popped and the Reader continues // to read from the next most recent io.Reader. Push returns a StructuralError // if pushing the reader would exceed the maximum recursion level, otherwise it // returns nil. func (r *Reader) Push(reader io.Reader) (err error) { if len(r.readers) >= maxReaders { return errors.StructuralError("too many layers of packets") } r.readers = append(r.readers, reader) return nil } // Unread causes the given Packet to be returned from the next call to Next. func (r *Reader) Unread(p Packet) { r.q = append(r.q, p) } func NewReader(r io.Reader) *Reader { return &Reader{ q: nil, readers: []io.Reader{r}, } } ================================================ FILE: vendor/golang.org/x/crypto/openpgp/packet/signature.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package packet import ( "bytes" "crypto" "crypto/dsa" "crypto/ecdsa" "encoding/asn1" "encoding/binary" "hash" "io" "math/big" "strconv" "time" "golang.org/x/crypto/openpgp/errors" "golang.org/x/crypto/openpgp/s2k" ) const ( // See RFC 4880, section 5.2.3.21 for details. KeyFlagCertify = 1 << iota KeyFlagSign KeyFlagEncryptCommunications KeyFlagEncryptStorage ) // Signature represents a signature. See RFC 4880, section 5.2. type Signature struct { SigType SignatureType PubKeyAlgo PublicKeyAlgorithm Hash crypto.Hash // HashSuffix is extra data that is hashed in after the signed data. HashSuffix []byte // HashTag contains the first two bytes of the hash for fast rejection // of bad signed data. HashTag [2]byte CreationTime time.Time RSASignature parsedMPI DSASigR, DSASigS parsedMPI ECDSASigR, ECDSASigS parsedMPI // rawSubpackets contains the unparsed subpackets, in order. rawSubpackets []outputSubpacket // The following are optional so are nil when not included in the // signature. SigLifetimeSecs, KeyLifetimeSecs *uint32 PreferredSymmetric, PreferredHash, PreferredCompression []uint8 IssuerKeyId *uint64 IsPrimaryId *bool // FlagsValid is set if any flags were given. See RFC 4880, section // 5.2.3.21 for details. FlagsValid bool FlagCertify, FlagSign, FlagEncryptCommunications, FlagEncryptStorage bool // RevocationReason is set if this signature has been revoked. // See RFC 4880, section 5.2.3.23 for details. RevocationReason *uint8 RevocationReasonText string // MDC is set if this signature has a feature packet that indicates // support for MDC subpackets. MDC bool // EmbeddedSignature, if non-nil, is a signature of the parent key, by // this key. This prevents an attacker from claiming another's signing // subkey as their own. EmbeddedSignature *Signature outSubpackets []outputSubpacket } func (sig *Signature) parse(r io.Reader) (err error) { // RFC 4880, section 5.2.3 var buf [5]byte _, err = readFull(r, buf[:1]) if err != nil { return } if buf[0] != 4 { err = errors.UnsupportedError("signature packet version " + strconv.Itoa(int(buf[0]))) return } _, err = readFull(r, buf[:5]) if err != nil { return } sig.SigType = SignatureType(buf[0]) sig.PubKeyAlgo = PublicKeyAlgorithm(buf[1]) switch sig.PubKeyAlgo { case PubKeyAlgoRSA, PubKeyAlgoRSASignOnly, PubKeyAlgoDSA, PubKeyAlgoECDSA: default: err = errors.UnsupportedError("public key algorithm " + strconv.Itoa(int(sig.PubKeyAlgo))) return } var ok bool sig.Hash, ok = s2k.HashIdToHash(buf[2]) if !ok { return errors.UnsupportedError("hash function " + strconv.Itoa(int(buf[2]))) } hashedSubpacketsLength := int(buf[3])<<8 | int(buf[4]) l := 6 + hashedSubpacketsLength sig.HashSuffix = make([]byte, l+6) sig.HashSuffix[0] = 4 copy(sig.HashSuffix[1:], buf[:5]) hashedSubpackets := sig.HashSuffix[6:l] _, err = readFull(r, hashedSubpackets) if err != nil { return } // See RFC 4880, section 5.2.4 trailer := sig.HashSuffix[l:] trailer[0] = 4 trailer[1] = 0xff trailer[2] = uint8(l >> 24) trailer[3] = uint8(l >> 16) trailer[4] = uint8(l >> 8) trailer[5] = uint8(l) err = parseSignatureSubpackets(sig, hashedSubpackets, true) if err != nil { return } _, err = readFull(r, buf[:2]) if err != nil { return } unhashedSubpacketsLength := int(buf[0])<<8 | int(buf[1]) unhashedSubpackets := make([]byte, unhashedSubpacketsLength) _, err = readFull(r, unhashedSubpackets) if err != nil { return } err = parseSignatureSubpackets(sig, unhashedSubpackets, false) if err != nil { return } _, err = readFull(r, sig.HashTag[:2]) if err != nil { return } switch sig.PubKeyAlgo { case PubKeyAlgoRSA, PubKeyAlgoRSASignOnly: sig.RSASignature.bytes, sig.RSASignature.bitLength, err = readMPI(r) case PubKeyAlgoDSA: sig.DSASigR.bytes, sig.DSASigR.bitLength, err = readMPI(r) if err == nil { sig.DSASigS.bytes, sig.DSASigS.bitLength, err = readMPI(r) } case PubKeyAlgoECDSA: sig.ECDSASigR.bytes, sig.ECDSASigR.bitLength, err = readMPI(r) if err == nil { sig.ECDSASigS.bytes, sig.ECDSASigS.bitLength, err = readMPI(r) } default: panic("unreachable") } return } // parseSignatureSubpackets parses subpackets of the main signature packet. See // RFC 4880, section 5.2.3.1. func parseSignatureSubpackets(sig *Signature, subpackets []byte, isHashed bool) (err error) { for len(subpackets) > 0 { subpackets, err = parseSignatureSubpacket(sig, subpackets, isHashed) if err != nil { return } } if sig.CreationTime.IsZero() { err = errors.StructuralError("no creation time in signature") } return } type signatureSubpacketType uint8 const ( creationTimeSubpacket signatureSubpacketType = 2 signatureExpirationSubpacket signatureSubpacketType = 3 keyExpirationSubpacket signatureSubpacketType = 9 prefSymmetricAlgosSubpacket signatureSubpacketType = 11 issuerSubpacket signatureSubpacketType = 16 prefHashAlgosSubpacket signatureSubpacketType = 21 prefCompressionSubpacket signatureSubpacketType = 22 primaryUserIdSubpacket signatureSubpacketType = 25 keyFlagsSubpacket signatureSubpacketType = 27 reasonForRevocationSubpacket signatureSubpacketType = 29 featuresSubpacket signatureSubpacketType = 30 embeddedSignatureSubpacket signatureSubpacketType = 32 ) // parseSignatureSubpacket parses a single subpacket. len(subpacket) is >= 1. func parseSignatureSubpacket(sig *Signature, subpacket []byte, isHashed bool) (rest []byte, err error) { // RFC 4880, section 5.2.3.1 var ( length uint32 packetType signatureSubpacketType isCritical bool ) switch { case subpacket[0] < 192: length = uint32(subpacket[0]) subpacket = subpacket[1:] case subpacket[0] < 255: if len(subpacket) < 2 { goto Truncated } length = uint32(subpacket[0]-192)<<8 + uint32(subpacket[1]) + 192 subpacket = subpacket[2:] default: if len(subpacket) < 5 { goto Truncated } length = uint32(subpacket[1])<<24 | uint32(subpacket[2])<<16 | uint32(subpacket[3])<<8 | uint32(subpacket[4]) subpacket = subpacket[5:] } if length > uint32(len(subpacket)) { goto Truncated } rest = subpacket[length:] subpacket = subpacket[:length] if len(subpacket) == 0 { err = errors.StructuralError("zero length signature subpacket") return } packetType = signatureSubpacketType(subpacket[0] & 0x7f) isCritical = subpacket[0]&0x80 == 0x80 subpacket = subpacket[1:] sig.rawSubpackets = append(sig.rawSubpackets, outputSubpacket{isHashed, packetType, isCritical, subpacket}) switch packetType { case creationTimeSubpacket: if !isHashed { err = errors.StructuralError("signature creation time in non-hashed area") return } if len(subpacket) != 4 { err = errors.StructuralError("signature creation time not four bytes") return } t := binary.BigEndian.Uint32(subpacket) sig.CreationTime = time.Unix(int64(t), 0) case signatureExpirationSubpacket: // Signature expiration time, section 5.2.3.10 if !isHashed { return } if len(subpacket) != 4 { err = errors.StructuralError("expiration subpacket with bad length") return } sig.SigLifetimeSecs = new(uint32) *sig.SigLifetimeSecs = binary.BigEndian.Uint32(subpacket) case keyExpirationSubpacket: // Key expiration time, section 5.2.3.6 if !isHashed { return } if len(subpacket) != 4 { err = errors.StructuralError("key expiration subpacket with bad length") return } sig.KeyLifetimeSecs = new(uint32) *sig.KeyLifetimeSecs = binary.BigEndian.Uint32(subpacket) case prefSymmetricAlgosSubpacket: // Preferred symmetric algorithms, section 5.2.3.7 if !isHashed { return } sig.PreferredSymmetric = make([]byte, len(subpacket)) copy(sig.PreferredSymmetric, subpacket) case issuerSubpacket: // Issuer, section 5.2.3.5 if len(subpacket) != 8 { err = errors.StructuralError("issuer subpacket with bad length") return } sig.IssuerKeyId = new(uint64) *sig.IssuerKeyId = binary.BigEndian.Uint64(subpacket) case prefHashAlgosSubpacket: // Preferred hash algorithms, section 5.2.3.8 if !isHashed { return } sig.PreferredHash = make([]byte, len(subpacket)) copy(sig.PreferredHash, subpacket) case prefCompressionSubpacket: // Preferred compression algorithms, section 5.2.3.9 if !isHashed { return } sig.PreferredCompression = make([]byte, len(subpacket)) copy(sig.PreferredCompression, subpacket) case primaryUserIdSubpacket: // Primary User ID, section 5.2.3.19 if !isHashed { return } if len(subpacket) != 1 { err = errors.StructuralError("primary user id subpacket with bad length") return } sig.IsPrimaryId = new(bool) if subpacket[0] > 0 { *sig.IsPrimaryId = true } case keyFlagsSubpacket: // Key flags, section 5.2.3.21 if !isHashed { return } if len(subpacket) == 0 { err = errors.StructuralError("empty key flags subpacket") return } sig.FlagsValid = true if subpacket[0]&KeyFlagCertify != 0 { sig.FlagCertify = true } if subpacket[0]&KeyFlagSign != 0 { sig.FlagSign = true } if subpacket[0]&KeyFlagEncryptCommunications != 0 { sig.FlagEncryptCommunications = true } if subpacket[0]&KeyFlagEncryptStorage != 0 { sig.FlagEncryptStorage = true } case reasonForRevocationSubpacket: // Reason For Revocation, section 5.2.3.23 if !isHashed { return } if len(subpacket) == 0 { err = errors.StructuralError("empty revocation reason subpacket") return } sig.RevocationReason = new(uint8) *sig.RevocationReason = subpacket[0] sig.RevocationReasonText = string(subpacket[1:]) case featuresSubpacket: // Features subpacket, section 5.2.3.24 specifies a very general // mechanism for OpenPGP implementations to signal support for new // features. In practice, the subpacket is used exclusively to // indicate support for MDC-protected encryption. sig.MDC = len(subpacket) >= 1 && subpacket[0]&1 == 1 case embeddedSignatureSubpacket: // Only usage is in signatures that cross-certify // signing subkeys. section 5.2.3.26 describes the // format, with its usage described in section 11.1 if sig.EmbeddedSignature != nil { err = errors.StructuralError("Cannot have multiple embedded signatures") return } sig.EmbeddedSignature = new(Signature) // Embedded signatures are required to be v4 signatures see // section 12.1. However, we only parse v4 signatures in this // file anyway. if err := sig.EmbeddedSignature.parse(bytes.NewBuffer(subpacket)); err != nil { return nil, err } if sigType := sig.EmbeddedSignature.SigType; sigType != SigTypePrimaryKeyBinding { return nil, errors.StructuralError("cross-signature has unexpected type " + strconv.Itoa(int(sigType))) } default: if isCritical { err = errors.UnsupportedError("unknown critical signature subpacket type " + strconv.Itoa(int(packetType))) return } } return Truncated: err = errors.StructuralError("signature subpacket truncated") return } // subpacketLengthLength returns the length, in bytes, of an encoded length value. func subpacketLengthLength(length int) int { if length < 192 { return 1 } if length < 16320 { return 2 } return 5 } // serializeSubpacketLength marshals the given length into to. func serializeSubpacketLength(to []byte, length int) int { // RFC 4880, Section 4.2.2. if length < 192 { to[0] = byte(length) return 1 } if length < 16320 { length -= 192 to[0] = byte((length >> 8) + 192) to[1] = byte(length) return 2 } to[0] = 255 to[1] = byte(length >> 24) to[2] = byte(length >> 16) to[3] = byte(length >> 8) to[4] = byte(length) return 5 } // subpacketsLength returns the serialized length, in bytes, of the given // subpackets. func subpacketsLength(subpackets []outputSubpacket, hashed bool) (length int) { for _, subpacket := range subpackets { if subpacket.hashed == hashed { length += subpacketLengthLength(len(subpacket.contents) + 1) length += 1 // type byte length += len(subpacket.contents) } } return } // serializeSubpackets marshals the given subpackets into to. func serializeSubpackets(to []byte, subpackets []outputSubpacket, hashed bool) { for _, subpacket := range subpackets { if subpacket.hashed == hashed { n := serializeSubpacketLength(to, len(subpacket.contents)+1) to[n] = byte(subpacket.subpacketType) to = to[1+n:] n = copy(to, subpacket.contents) to = to[n:] } } return } // KeyExpired returns whether sig is a self-signature of a key that has // expired. func (sig *Signature) KeyExpired(currentTime time.Time) bool { if sig.KeyLifetimeSecs == nil { return false } expiry := sig.CreationTime.Add(time.Duration(*sig.KeyLifetimeSecs) * time.Second) return currentTime.After(expiry) } // buildHashSuffix constructs the HashSuffix member of sig in preparation for signing. func (sig *Signature) buildHashSuffix() (err error) { hashedSubpacketsLen := subpacketsLength(sig.outSubpackets, true) var ok bool l := 6 + hashedSubpacketsLen sig.HashSuffix = make([]byte, l+6) sig.HashSuffix[0] = 4 sig.HashSuffix[1] = uint8(sig.SigType) sig.HashSuffix[2] = uint8(sig.PubKeyAlgo) sig.HashSuffix[3], ok = s2k.HashToHashId(sig.Hash) if !ok { sig.HashSuffix = nil return errors.InvalidArgumentError("hash cannot be represented in OpenPGP: " + strconv.Itoa(int(sig.Hash))) } sig.HashSuffix[4] = byte(hashedSubpacketsLen >> 8) sig.HashSuffix[5] = byte(hashedSubpacketsLen) serializeSubpackets(sig.HashSuffix[6:l], sig.outSubpackets, true) trailer := sig.HashSuffix[l:] trailer[0] = 4 trailer[1] = 0xff trailer[2] = byte(l >> 24) trailer[3] = byte(l >> 16) trailer[4] = byte(l >> 8) trailer[5] = byte(l) return } func (sig *Signature) signPrepareHash(h hash.Hash) (digest []byte, err error) { err = sig.buildHashSuffix() if err != nil { return } h.Write(sig.HashSuffix) digest = h.Sum(nil) copy(sig.HashTag[:], digest) return } // Sign signs a message with a private key. The hash, h, must contain // the hash of the message to be signed and will be mutated by this function. // On success, the signature is stored in sig. Call Serialize to write it out. // If config is nil, sensible defaults will be used. func (sig *Signature) Sign(h hash.Hash, priv *PrivateKey, config *Config) (err error) { sig.outSubpackets = sig.buildSubpackets() digest, err := sig.signPrepareHash(h) if err != nil { return } switch priv.PubKeyAlgo { case PubKeyAlgoRSA, PubKeyAlgoRSASignOnly: // supports both *rsa.PrivateKey and crypto.Signer sig.RSASignature.bytes, err = priv.PrivateKey.(crypto.Signer).Sign(config.Random(), digest, sig.Hash) sig.RSASignature.bitLength = uint16(8 * len(sig.RSASignature.bytes)) case PubKeyAlgoDSA: dsaPriv := priv.PrivateKey.(*dsa.PrivateKey) // Need to truncate hashBytes to match FIPS 186-3 section 4.6. subgroupSize := (dsaPriv.Q.BitLen() + 7) / 8 if len(digest) > subgroupSize { digest = digest[:subgroupSize] } r, s, err := dsa.Sign(config.Random(), dsaPriv, digest) if err == nil { sig.DSASigR.bytes = r.Bytes() sig.DSASigR.bitLength = uint16(8 * len(sig.DSASigR.bytes)) sig.DSASigS.bytes = s.Bytes() sig.DSASigS.bitLength = uint16(8 * len(sig.DSASigS.bytes)) } case PubKeyAlgoECDSA: var r, s *big.Int if pk, ok := priv.PrivateKey.(*ecdsa.PrivateKey); ok { // direct support, avoid asn1 wrapping/unwrapping r, s, err = ecdsa.Sign(config.Random(), pk, digest) } else { var b []byte b, err = priv.PrivateKey.(crypto.Signer).Sign(config.Random(), digest, sig.Hash) if err == nil { r, s, err = unwrapECDSASig(b) } } if err == nil { sig.ECDSASigR = fromBig(r) sig.ECDSASigS = fromBig(s) } default: err = errors.UnsupportedError("public key algorithm: " + strconv.Itoa(int(sig.PubKeyAlgo))) } return } // unwrapECDSASig parses the two integer components of an ASN.1-encoded ECDSA // signature. func unwrapECDSASig(b []byte) (r, s *big.Int, err error) { var ecsdaSig struct { R, S *big.Int } _, err = asn1.Unmarshal(b, &ecsdaSig) if err != nil { return } return ecsdaSig.R, ecsdaSig.S, nil } // SignUserId computes a signature from priv, asserting that pub is a valid // key for the identity id. On success, the signature is stored in sig. Call // Serialize to write it out. // If config is nil, sensible defaults will be used. func (sig *Signature) SignUserId(id string, pub *PublicKey, priv *PrivateKey, config *Config) error { h, err := userIdSignatureHash(id, pub, sig.Hash) if err != nil { return err } return sig.Sign(h, priv, config) } // SignKey computes a signature from priv, asserting that pub is a subkey. On // success, the signature is stored in sig. Call Serialize to write it out. // If config is nil, sensible defaults will be used. func (sig *Signature) SignKey(pub *PublicKey, priv *PrivateKey, config *Config) error { h, err := keySignatureHash(&priv.PublicKey, pub, sig.Hash) if err != nil { return err } return sig.Sign(h, priv, config) } // Serialize marshals sig to w. Sign, SignUserId or SignKey must have been // called first. func (sig *Signature) Serialize(w io.Writer) (err error) { if len(sig.outSubpackets) == 0 { sig.outSubpackets = sig.rawSubpackets } if sig.RSASignature.bytes == nil && sig.DSASigR.bytes == nil && sig.ECDSASigR.bytes == nil { return errors.InvalidArgumentError("Signature: need to call Sign, SignUserId or SignKey before Serialize") } sigLength := 0 switch sig.PubKeyAlgo { case PubKeyAlgoRSA, PubKeyAlgoRSASignOnly: sigLength = 2 + len(sig.RSASignature.bytes) case PubKeyAlgoDSA: sigLength = 2 + len(sig.DSASigR.bytes) sigLength += 2 + len(sig.DSASigS.bytes) case PubKeyAlgoECDSA: sigLength = 2 + len(sig.ECDSASigR.bytes) sigLength += 2 + len(sig.ECDSASigS.bytes) default: panic("impossible") } unhashedSubpacketsLen := subpacketsLength(sig.outSubpackets, false) length := len(sig.HashSuffix) - 6 /* trailer not included */ + 2 /* length of unhashed subpackets */ + unhashedSubpacketsLen + 2 /* hash tag */ + sigLength err = serializeHeader(w, packetTypeSignature, length) if err != nil { return } _, err = w.Write(sig.HashSuffix[:len(sig.HashSuffix)-6]) if err != nil { return } unhashedSubpackets := make([]byte, 2+unhashedSubpacketsLen) unhashedSubpackets[0] = byte(unhashedSubpacketsLen >> 8) unhashedSubpackets[1] = byte(unhashedSubpacketsLen) serializeSubpackets(unhashedSubpackets[2:], sig.outSubpackets, false) _, err = w.Write(unhashedSubpackets) if err != nil { return } _, err = w.Write(sig.HashTag[:]) if err != nil { return } switch sig.PubKeyAlgo { case PubKeyAlgoRSA, PubKeyAlgoRSASignOnly: err = writeMPIs(w, sig.RSASignature) case PubKeyAlgoDSA: err = writeMPIs(w, sig.DSASigR, sig.DSASigS) case PubKeyAlgoECDSA: err = writeMPIs(w, sig.ECDSASigR, sig.ECDSASigS) default: panic("impossible") } return } // outputSubpacket represents a subpacket to be marshaled. type outputSubpacket struct { hashed bool // true if this subpacket is in the hashed area. subpacketType signatureSubpacketType isCritical bool contents []byte } func (sig *Signature) buildSubpackets() (subpackets []outputSubpacket) { creationTime := make([]byte, 4) binary.BigEndian.PutUint32(creationTime, uint32(sig.CreationTime.Unix())) subpackets = append(subpackets, outputSubpacket{true, creationTimeSubpacket, false, creationTime}) if sig.IssuerKeyId != nil { keyId := make([]byte, 8) binary.BigEndian.PutUint64(keyId, *sig.IssuerKeyId) subpackets = append(subpackets, outputSubpacket{true, issuerSubpacket, false, keyId}) } if sig.SigLifetimeSecs != nil && *sig.SigLifetimeSecs != 0 { sigLifetime := make([]byte, 4) binary.BigEndian.PutUint32(sigLifetime, *sig.SigLifetimeSecs) subpackets = append(subpackets, outputSubpacket{true, signatureExpirationSubpacket, true, sigLifetime}) } // Key flags may only appear in self-signatures or certification signatures. if sig.FlagsValid { var flags byte if sig.FlagCertify { flags |= KeyFlagCertify } if sig.FlagSign { flags |= KeyFlagSign } if sig.FlagEncryptCommunications { flags |= KeyFlagEncryptCommunications } if sig.FlagEncryptStorage { flags |= KeyFlagEncryptStorage } subpackets = append(subpackets, outputSubpacket{true, keyFlagsSubpacket, false, []byte{flags}}) } // The following subpackets may only appear in self-signatures if sig.KeyLifetimeSecs != nil && *sig.KeyLifetimeSecs != 0 { keyLifetime := make([]byte, 4) binary.BigEndian.PutUint32(keyLifetime, *sig.KeyLifetimeSecs) subpackets = append(subpackets, outputSubpacket{true, keyExpirationSubpacket, true, keyLifetime}) } if sig.IsPrimaryId != nil && *sig.IsPrimaryId { subpackets = append(subpackets, outputSubpacket{true, primaryUserIdSubpacket, false, []byte{1}}) } if len(sig.PreferredSymmetric) > 0 { subpackets = append(subpackets, outputSubpacket{true, prefSymmetricAlgosSubpacket, false, sig.PreferredSymmetric}) } if len(sig.PreferredHash) > 0 { subpackets = append(subpackets, outputSubpacket{true, prefHashAlgosSubpacket, false, sig.PreferredHash}) } if len(sig.PreferredCompression) > 0 { subpackets = append(subpackets, outputSubpacket{true, prefCompressionSubpacket, false, sig.PreferredCompression}) } return } ================================================ FILE: vendor/golang.org/x/crypto/openpgp/packet/signature_v3.go ================================================ // Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package packet import ( "crypto" "encoding/binary" "fmt" "io" "strconv" "time" "golang.org/x/crypto/openpgp/errors" "golang.org/x/crypto/openpgp/s2k" ) // SignatureV3 represents older version 3 signatures. These signatures are less secure // than version 4 and should not be used to create new signatures. They are included // here for backwards compatibility to read and validate with older key material. // See RFC 4880, section 5.2.2. type SignatureV3 struct { SigType SignatureType CreationTime time.Time IssuerKeyId uint64 PubKeyAlgo PublicKeyAlgorithm Hash crypto.Hash HashTag [2]byte RSASignature parsedMPI DSASigR, DSASigS parsedMPI } func (sig *SignatureV3) parse(r io.Reader) (err error) { // RFC 4880, section 5.2.2 var buf [8]byte if _, err = readFull(r, buf[:1]); err != nil { return } if buf[0] < 2 || buf[0] > 3 { err = errors.UnsupportedError("signature packet version " + strconv.Itoa(int(buf[0]))) return } if _, err = readFull(r, buf[:1]); err != nil { return } if buf[0] != 5 { err = errors.UnsupportedError( "invalid hashed material length " + strconv.Itoa(int(buf[0]))) return } // Read hashed material: signature type + creation time if _, err = readFull(r, buf[:5]); err != nil { return } sig.SigType = SignatureType(buf[0]) t := binary.BigEndian.Uint32(buf[1:5]) sig.CreationTime = time.Unix(int64(t), 0) // Eight-octet Key ID of signer. if _, err = readFull(r, buf[:8]); err != nil { return } sig.IssuerKeyId = binary.BigEndian.Uint64(buf[:]) // Public-key and hash algorithm if _, err = readFull(r, buf[:2]); err != nil { return } sig.PubKeyAlgo = PublicKeyAlgorithm(buf[0]) switch sig.PubKeyAlgo { case PubKeyAlgoRSA, PubKeyAlgoRSASignOnly, PubKeyAlgoDSA: default: err = errors.UnsupportedError("public key algorithm " + strconv.Itoa(int(sig.PubKeyAlgo))) return } var ok bool if sig.Hash, ok = s2k.HashIdToHash(buf[1]); !ok { return errors.UnsupportedError("hash function " + strconv.Itoa(int(buf[2]))) } // Two-octet field holding left 16 bits of signed hash value. if _, err = readFull(r, sig.HashTag[:2]); err != nil { return } switch sig.PubKeyAlgo { case PubKeyAlgoRSA, PubKeyAlgoRSASignOnly: sig.RSASignature.bytes, sig.RSASignature.bitLength, err = readMPI(r) case PubKeyAlgoDSA: if sig.DSASigR.bytes, sig.DSASigR.bitLength, err = readMPI(r); err != nil { return } sig.DSASigS.bytes, sig.DSASigS.bitLength, err = readMPI(r) default: panic("unreachable") } return } // Serialize marshals sig to w. Sign, SignUserId or SignKey must have been // called first. func (sig *SignatureV3) Serialize(w io.Writer) (err error) { buf := make([]byte, 8) // Write the sig type and creation time buf[0] = byte(sig.SigType) binary.BigEndian.PutUint32(buf[1:5], uint32(sig.CreationTime.Unix())) if _, err = w.Write(buf[:5]); err != nil { return } // Write the issuer long key ID binary.BigEndian.PutUint64(buf[:8], sig.IssuerKeyId) if _, err = w.Write(buf[:8]); err != nil { return } // Write public key algorithm, hash ID, and hash value buf[0] = byte(sig.PubKeyAlgo) hashId, ok := s2k.HashToHashId(sig.Hash) if !ok { return errors.UnsupportedError(fmt.Sprintf("hash function %v", sig.Hash)) } buf[1] = hashId copy(buf[2:4], sig.HashTag[:]) if _, err = w.Write(buf[:4]); err != nil { return } if sig.RSASignature.bytes == nil && sig.DSASigR.bytes == nil { return errors.InvalidArgumentError("Signature: need to call Sign, SignUserId or SignKey before Serialize") } switch sig.PubKeyAlgo { case PubKeyAlgoRSA, PubKeyAlgoRSASignOnly: err = writeMPIs(w, sig.RSASignature) case PubKeyAlgoDSA: err = writeMPIs(w, sig.DSASigR, sig.DSASigS) default: panic("impossible") } return } ================================================ FILE: vendor/golang.org/x/crypto/openpgp/packet/symmetric_key_encrypted.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package packet import ( "bytes" "crypto/cipher" "io" "strconv" "golang.org/x/crypto/openpgp/errors" "golang.org/x/crypto/openpgp/s2k" ) // This is the largest session key that we'll support. Since no 512-bit cipher // has even been seriously used, this is comfortably large. const maxSessionKeySizeInBytes = 64 // SymmetricKeyEncrypted represents a passphrase protected session key. See RFC // 4880, section 5.3. type SymmetricKeyEncrypted struct { CipherFunc CipherFunction s2k func(out, in []byte) encryptedKey []byte } const symmetricKeyEncryptedVersion = 4 func (ske *SymmetricKeyEncrypted) parse(r io.Reader) error { // RFC 4880, section 5.3. var buf [2]byte if _, err := readFull(r, buf[:]); err != nil { return err } if buf[0] != symmetricKeyEncryptedVersion { return errors.UnsupportedError("SymmetricKeyEncrypted version") } ske.CipherFunc = CipherFunction(buf[1]) if ske.CipherFunc.KeySize() == 0 { return errors.UnsupportedError("unknown cipher: " + strconv.Itoa(int(buf[1]))) } var err error ske.s2k, err = s2k.Parse(r) if err != nil { return err } encryptedKey := make([]byte, maxSessionKeySizeInBytes) // The session key may follow. We just have to try and read to find // out. If it exists then we limit it to maxSessionKeySizeInBytes. n, err := readFull(r, encryptedKey) if err != nil && err != io.ErrUnexpectedEOF { return err } if n != 0 { if n == maxSessionKeySizeInBytes { return errors.UnsupportedError("oversized encrypted session key") } ske.encryptedKey = encryptedKey[:n] } return nil } // Decrypt attempts to decrypt an encrypted session key and returns the key and // the cipher to use when decrypting a subsequent Symmetrically Encrypted Data // packet. func (ske *SymmetricKeyEncrypted) Decrypt(passphrase []byte) ([]byte, CipherFunction, error) { key := make([]byte, ske.CipherFunc.KeySize()) ske.s2k(key, passphrase) if len(ske.encryptedKey) == 0 { return key, ske.CipherFunc, nil } // the IV is all zeros iv := make([]byte, ske.CipherFunc.blockSize()) c := cipher.NewCFBDecrypter(ske.CipherFunc.new(key), iv) plaintextKey := make([]byte, len(ske.encryptedKey)) c.XORKeyStream(plaintextKey, ske.encryptedKey) cipherFunc := CipherFunction(plaintextKey[0]) if cipherFunc.blockSize() == 0 { return nil, ske.CipherFunc, errors.UnsupportedError("unknown cipher: " + strconv.Itoa(int(cipherFunc))) } plaintextKey = plaintextKey[1:] if l, cipherKeySize := len(plaintextKey), cipherFunc.KeySize(); l != cipherFunc.KeySize() { return nil, cipherFunc, errors.StructuralError("length of decrypted key (" + strconv.Itoa(l) + ") " + "not equal to cipher keysize (" + strconv.Itoa(cipherKeySize) + ")") } return plaintextKey, cipherFunc, nil } // SerializeSymmetricKeyEncrypted serializes a symmetric key packet to w. The // packet contains a random session key, encrypted by a key derived from the // given passphrase. The session key is returned and must be passed to // SerializeSymmetricallyEncrypted. // If config is nil, sensible defaults will be used. func SerializeSymmetricKeyEncrypted(w io.Writer, passphrase []byte, config *Config) (key []byte, err error) { cipherFunc := config.Cipher() keySize := cipherFunc.KeySize() if keySize == 0 { return nil, errors.UnsupportedError("unknown cipher: " + strconv.Itoa(int(cipherFunc))) } s2kBuf := new(bytes.Buffer) keyEncryptingKey := make([]byte, keySize) // s2k.Serialize salts and stretches the passphrase, and writes the // resulting key to keyEncryptingKey and the s2k descriptor to s2kBuf. err = s2k.Serialize(s2kBuf, keyEncryptingKey, config.Random(), passphrase, &s2k.Config{Hash: config.Hash(), S2KCount: config.PasswordHashIterations()}) if err != nil { return } s2kBytes := s2kBuf.Bytes() packetLength := 2 /* header */ + len(s2kBytes) + 1 /* cipher type */ + keySize err = serializeHeader(w, packetTypeSymmetricKeyEncrypted, packetLength) if err != nil { return } var buf [2]byte buf[0] = symmetricKeyEncryptedVersion buf[1] = byte(cipherFunc) _, err = w.Write(buf[:]) if err != nil { return } _, err = w.Write(s2kBytes) if err != nil { return } sessionKey := make([]byte, keySize) _, err = io.ReadFull(config.Random(), sessionKey) if err != nil { return } iv := make([]byte, cipherFunc.blockSize()) c := cipher.NewCFBEncrypter(cipherFunc.new(keyEncryptingKey), iv) encryptedCipherAndKey := make([]byte, keySize+1) c.XORKeyStream(encryptedCipherAndKey, buf[1:]) c.XORKeyStream(encryptedCipherAndKey[1:], sessionKey) _, err = w.Write(encryptedCipherAndKey) if err != nil { return } key = sessionKey return } ================================================ FILE: vendor/golang.org/x/crypto/openpgp/packet/symmetrically_encrypted.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package packet import ( "crypto/cipher" "crypto/sha1" "crypto/subtle" "golang.org/x/crypto/openpgp/errors" "hash" "io" "strconv" ) // SymmetricallyEncrypted represents a symmetrically encrypted byte string. The // encrypted contents will consist of more OpenPGP packets. See RFC 4880, // sections 5.7 and 5.13. type SymmetricallyEncrypted struct { MDC bool // true iff this is a type 18 packet and thus has an embedded MAC. contents io.Reader prefix []byte } const symmetricallyEncryptedVersion = 1 func (se *SymmetricallyEncrypted) parse(r io.Reader) error { if se.MDC { // See RFC 4880, section 5.13. var buf [1]byte _, err := readFull(r, buf[:]) if err != nil { return err } if buf[0] != symmetricallyEncryptedVersion { return errors.UnsupportedError("unknown SymmetricallyEncrypted version") } } se.contents = r return nil } // Decrypt returns a ReadCloser, from which the decrypted contents of the // packet can be read. An incorrect key can, with high probability, be detected // immediately and this will result in a KeyIncorrect error being returned. func (se *SymmetricallyEncrypted) Decrypt(c CipherFunction, key []byte) (io.ReadCloser, error) { keySize := c.KeySize() if keySize == 0 { return nil, errors.UnsupportedError("unknown cipher: " + strconv.Itoa(int(c))) } if len(key) != keySize { return nil, errors.InvalidArgumentError("SymmetricallyEncrypted: incorrect key length") } if se.prefix == nil { se.prefix = make([]byte, c.blockSize()+2) _, err := readFull(se.contents, se.prefix) if err != nil { return nil, err } } else if len(se.prefix) != c.blockSize()+2 { return nil, errors.InvalidArgumentError("can't try ciphers with different block lengths") } ocfbResync := OCFBResync if se.MDC { // MDC packets use a different form of OCFB mode. ocfbResync = OCFBNoResync } s := NewOCFBDecrypter(c.new(key), se.prefix, ocfbResync) if s == nil { return nil, errors.ErrKeyIncorrect } plaintext := cipher.StreamReader{S: s, R: se.contents} if se.MDC { // MDC packets have an embedded hash that we need to check. h := sha1.New() h.Write(se.prefix) return &seMDCReader{in: plaintext, h: h}, nil } // Otherwise, we just need to wrap plaintext so that it's a valid ReadCloser. return seReader{plaintext}, nil } // seReader wraps an io.Reader with a no-op Close method. type seReader struct { in io.Reader } func (ser seReader) Read(buf []byte) (int, error) { return ser.in.Read(buf) } func (ser seReader) Close() error { return nil } const mdcTrailerSize = 1 /* tag byte */ + 1 /* length byte */ + sha1.Size // An seMDCReader wraps an io.Reader, maintains a running hash and keeps hold // of the most recent 22 bytes (mdcTrailerSize). Upon EOF, those bytes form an // MDC packet containing a hash of the previous contents which is checked // against the running hash. See RFC 4880, section 5.13. type seMDCReader struct { in io.Reader h hash.Hash trailer [mdcTrailerSize]byte scratch [mdcTrailerSize]byte trailerUsed int error bool eof bool } func (ser *seMDCReader) Read(buf []byte) (n int, err error) { if ser.error { err = io.ErrUnexpectedEOF return } if ser.eof { err = io.EOF return } // If we haven't yet filled the trailer buffer then we must do that // first. for ser.trailerUsed < mdcTrailerSize { n, err = ser.in.Read(ser.trailer[ser.trailerUsed:]) ser.trailerUsed += n if err == io.EOF { if ser.trailerUsed != mdcTrailerSize { n = 0 err = io.ErrUnexpectedEOF ser.error = true return } ser.eof = true n = 0 return } if err != nil { n = 0 return } } // If it's a short read then we read into a temporary buffer and shift // the data into the caller's buffer. if len(buf) <= mdcTrailerSize { n, err = readFull(ser.in, ser.scratch[:len(buf)]) copy(buf, ser.trailer[:n]) ser.h.Write(buf[:n]) copy(ser.trailer[:], ser.trailer[n:]) copy(ser.trailer[mdcTrailerSize-n:], ser.scratch[:]) if n < len(buf) { ser.eof = true err = io.EOF } return } n, err = ser.in.Read(buf[mdcTrailerSize:]) copy(buf, ser.trailer[:]) ser.h.Write(buf[:n]) copy(ser.trailer[:], buf[n:]) if err == io.EOF { ser.eof = true } return } // This is a new-format packet tag byte for a type 19 (MDC) packet. const mdcPacketTagByte = byte(0x80) | 0x40 | 19 func (ser *seMDCReader) Close() error { if ser.error { return errors.SignatureError("error during reading") } for !ser.eof { // We haven't seen EOF so we need to read to the end var buf [1024]byte _, err := ser.Read(buf[:]) if err == io.EOF { break } if err != nil { return errors.SignatureError("error during reading") } } if ser.trailer[0] != mdcPacketTagByte || ser.trailer[1] != sha1.Size { return errors.SignatureError("MDC packet not found") } ser.h.Write(ser.trailer[:2]) final := ser.h.Sum(nil) if subtle.ConstantTimeCompare(final, ser.trailer[2:]) != 1 { return errors.SignatureError("hash mismatch") } return nil } // An seMDCWriter writes through to an io.WriteCloser while maintains a running // hash of the data written. On close, it emits an MDC packet containing the // running hash. type seMDCWriter struct { w io.WriteCloser h hash.Hash } func (w *seMDCWriter) Write(buf []byte) (n int, err error) { w.h.Write(buf) return w.w.Write(buf) } func (w *seMDCWriter) Close() (err error) { var buf [mdcTrailerSize]byte buf[0] = mdcPacketTagByte buf[1] = sha1.Size w.h.Write(buf[:2]) digest := w.h.Sum(nil) copy(buf[2:], digest) _, err = w.w.Write(buf[:]) if err != nil { return } return w.w.Close() } // noOpCloser is like an io.NopCloser, but for an io.Writer. type noOpCloser struct { w io.Writer } func (c noOpCloser) Write(data []byte) (n int, err error) { return c.w.Write(data) } func (c noOpCloser) Close() error { return nil } // SerializeSymmetricallyEncrypted serializes a symmetrically encrypted packet // to w and returns a WriteCloser to which the to-be-encrypted packets can be // written. // If config is nil, sensible defaults will be used. func SerializeSymmetricallyEncrypted(w io.Writer, c CipherFunction, key []byte, config *Config) (contents io.WriteCloser, err error) { if c.KeySize() != len(key) { return nil, errors.InvalidArgumentError("SymmetricallyEncrypted.Serialize: bad key length") } writeCloser := noOpCloser{w} ciphertext, err := serializeStreamHeader(writeCloser, packetTypeSymmetricallyEncryptedMDC) if err != nil { return } _, err = ciphertext.Write([]byte{symmetricallyEncryptedVersion}) if err != nil { return } block := c.new(key) blockSize := block.BlockSize() iv := make([]byte, blockSize) _, err = config.Random().Read(iv) if err != nil { return } s, prefix := NewOCFBEncrypter(block, iv, OCFBNoResync) _, err = ciphertext.Write(prefix) if err != nil { return } plaintext := cipher.StreamWriter{S: s, W: ciphertext} h := sha1.New() h.Write(iv) h.Write(iv[blockSize-2:]) contents = &seMDCWriter{w: plaintext, h: h} return } ================================================ FILE: vendor/golang.org/x/crypto/openpgp/packet/userattribute.go ================================================ // Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package packet import ( "bytes" "image" "image/jpeg" "io" ) const UserAttrImageSubpacket = 1 // UserAttribute is capable of storing other types of data about a user // beyond name, email and a text comment. In practice, user attributes are typically used // to store a signed thumbnail photo JPEG image of the user. // See RFC 4880, section 5.12. type UserAttribute struct { Contents []*OpaqueSubpacket } // NewUserAttributePhoto creates a user attribute packet // containing the given images. func NewUserAttributePhoto(photos ...image.Image) (uat *UserAttribute, err error) { uat = new(UserAttribute) for _, photo := range photos { var buf bytes.Buffer // RFC 4880, Section 5.12.1. data := []byte{ 0x10, 0x00, // Little-endian image header length (16 bytes) 0x01, // Image header version 1 0x01, // JPEG 0, 0, 0, 0, // 12 reserved octets, must be all zero. 0, 0, 0, 0, 0, 0, 0, 0} if _, err = buf.Write(data); err != nil { return } if err = jpeg.Encode(&buf, photo, nil); err != nil { return } uat.Contents = append(uat.Contents, &OpaqueSubpacket{ SubType: UserAttrImageSubpacket, Contents: buf.Bytes()}) } return } // NewUserAttribute creates a new user attribute packet containing the given subpackets. func NewUserAttribute(contents ...*OpaqueSubpacket) *UserAttribute { return &UserAttribute{Contents: contents} } func (uat *UserAttribute) parse(r io.Reader) (err error) { // RFC 4880, section 5.13 b, err := io.ReadAll(r) if err != nil { return } uat.Contents, err = OpaqueSubpackets(b) return } // Serialize marshals the user attribute to w in the form of an OpenPGP packet, including // header. func (uat *UserAttribute) Serialize(w io.Writer) (err error) { var buf bytes.Buffer for _, sp := range uat.Contents { sp.Serialize(&buf) } if err = serializeHeader(w, packetTypeUserAttribute, buf.Len()); err != nil { return err } _, err = w.Write(buf.Bytes()) return } // ImageData returns zero or more byte slices, each containing // JPEG File Interchange Format (JFIF), for each photo in the // user attribute packet. func (uat *UserAttribute) ImageData() (imageData [][]byte) { for _, sp := range uat.Contents { if sp.SubType == UserAttrImageSubpacket && len(sp.Contents) > 16 { imageData = append(imageData, sp.Contents[16:]) } } return } ================================================ FILE: vendor/golang.org/x/crypto/openpgp/packet/userid.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package packet import ( "io" "strings" ) // UserId contains text that is intended to represent the name and email // address of the key holder. See RFC 4880, section 5.11. By convention, this // takes the form "Full Name (Comment) " type UserId struct { Id string // By convention, this takes the form "Full Name (Comment) " which is split out in the fields below. Name, Comment, Email string } func hasInvalidCharacters(s string) bool { for _, c := range s { switch c { case '(', ')', '<', '>', 0: return true } } return false } // NewUserId returns a UserId or nil if any of the arguments contain invalid // characters. The invalid characters are '\x00', '(', ')', '<' and '>' func NewUserId(name, comment, email string) *UserId { // RFC 4880 doesn't deal with the structure of userid strings; the // name, comment and email form is just a convention. However, there's // no convention about escaping the metacharacters and GPG just refuses // to create user ids where, say, the name contains a '('. We mirror // this behaviour. if hasInvalidCharacters(name) || hasInvalidCharacters(comment) || hasInvalidCharacters(email) { return nil } uid := new(UserId) uid.Name, uid.Comment, uid.Email = name, comment, email uid.Id = name if len(comment) > 0 { if len(uid.Id) > 0 { uid.Id += " " } uid.Id += "(" uid.Id += comment uid.Id += ")" } if len(email) > 0 { if len(uid.Id) > 0 { uid.Id += " " } uid.Id += "<" uid.Id += email uid.Id += ">" } return uid } func (uid *UserId) parse(r io.Reader) (err error) { // RFC 4880, section 5.11 b, err := io.ReadAll(r) if err != nil { return } uid.Id = string(b) uid.Name, uid.Comment, uid.Email = parseUserId(uid.Id) return } // Serialize marshals uid to w in the form of an OpenPGP packet, including // header. func (uid *UserId) Serialize(w io.Writer) error { err := serializeHeader(w, packetTypeUserId, len(uid.Id)) if err != nil { return err } _, err = w.Write([]byte(uid.Id)) return err } // parseUserId extracts the name, comment and email from a user id string that // is formatted as "Full Name (Comment) ". func parseUserId(id string) (name, comment, email string) { var n, c, e struct { start, end int } var state int for offset, rune := range id { switch state { case 0: // Entering name n.start = offset state = 1 fallthrough case 1: // In name if rune == '(' { state = 2 n.end = offset } else if rune == '<' { state = 5 n.end = offset } case 2: // Entering comment c.start = offset state = 3 fallthrough case 3: // In comment if rune == ')' { state = 4 c.end = offset } case 4: // Between comment and email if rune == '<' { state = 5 } case 5: // Entering email e.start = offset state = 6 fallthrough case 6: // In email if rune == '>' { state = 7 e.end = offset } default: // After email } } switch state { case 1: // ended in the name n.end = len(id) case 3: // ended in comment c.end = len(id) case 6: // ended in email e.end = len(id) } name = strings.TrimSpace(id[n.start:n.end]) comment = strings.TrimSpace(id[c.start:c.end]) email = strings.TrimSpace(id[e.start:e.end]) return } ================================================ FILE: vendor/golang.org/x/crypto/openpgp/read.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package openpgp implements high level operations on OpenPGP messages. // // Deprecated: this package is unmaintained except for security fixes. New // applications should consider a more focused, modern alternative to OpenPGP // for their specific task. If you are required to interoperate with OpenPGP // systems and need a maintained package, consider a community fork. // See https://golang.org/issue/44226. package openpgp import ( "crypto" _ "crypto/sha256" "hash" "io" "strconv" "golang.org/x/crypto/openpgp/armor" "golang.org/x/crypto/openpgp/errors" "golang.org/x/crypto/openpgp/packet" ) // SignatureType is the armor type for a PGP signature. var SignatureType = "PGP SIGNATURE" // readArmored reads an armored block with the given type. func readArmored(r io.Reader, expectedType string) (body io.Reader, err error) { block, err := armor.Decode(r) if err != nil { return } if block.Type != expectedType { return nil, errors.InvalidArgumentError("expected '" + expectedType + "', got: " + block.Type) } return block.Body, nil } // MessageDetails contains the result of parsing an OpenPGP encrypted and/or // signed message. type MessageDetails struct { IsEncrypted bool // true if the message was encrypted. EncryptedToKeyIds []uint64 // the list of recipient key ids. IsSymmetricallyEncrypted bool // true if a passphrase could have decrypted the message. DecryptedWith Key // the private key used to decrypt the message, if any. IsSigned bool // true if the message is signed. SignedByKeyId uint64 // the key id of the signer, if any. SignedBy *Key // the key of the signer, if available. LiteralData *packet.LiteralData // the metadata of the contents UnverifiedBody io.Reader // the contents of the message. // If IsSigned is true and SignedBy is non-zero then the signature will // be verified as UnverifiedBody is read. The signature cannot be // checked until the whole of UnverifiedBody is read so UnverifiedBody // must be consumed until EOF before the data can be trusted. Even if a // message isn't signed (or the signer is unknown) the data may contain // an authentication code that is only checked once UnverifiedBody has // been consumed. Once EOF has been seen, the following fields are // valid. (An authentication code failure is reported as a // SignatureError error when reading from UnverifiedBody.) SignatureError error // nil if the signature is good. Signature *packet.Signature // the signature packet itself, if v4 (default) SignatureV3 *packet.SignatureV3 // the signature packet if it is a v2 or v3 signature decrypted io.ReadCloser } // A PromptFunction is used as a callback by functions that may need to decrypt // a private key, or prompt for a passphrase. It is called with a list of // acceptable, encrypted private keys and a boolean that indicates whether a // passphrase is usable. It should either decrypt a private key or return a // passphrase to try. If the decrypted private key or given passphrase isn't // correct, the function will be called again, forever. Any error returned will // be passed up. type PromptFunction func(keys []Key, symmetric bool) ([]byte, error) // A keyEnvelopePair is used to store a private key with the envelope that // contains a symmetric key, encrypted with that key. type keyEnvelopePair struct { key Key encryptedKey *packet.EncryptedKey } // ReadMessage parses an OpenPGP message that may be signed and/or encrypted. // The given KeyRing should contain both public keys (for signature // verification) and, possibly encrypted, private keys for decrypting. // If config is nil, sensible defaults will be used. func ReadMessage(r io.Reader, keyring KeyRing, prompt PromptFunction, config *packet.Config) (md *MessageDetails, err error) { var p packet.Packet var symKeys []*packet.SymmetricKeyEncrypted var pubKeys []keyEnvelopePair var se *packet.SymmetricallyEncrypted packets := packet.NewReader(r) md = new(MessageDetails) md.IsEncrypted = true // The message, if encrypted, starts with a number of packets // containing an encrypted decryption key. The decryption key is either // encrypted to a public key, or with a passphrase. This loop // collects these packets. ParsePackets: for { p, err = packets.Next() if err != nil { return nil, err } switch p := p.(type) { case *packet.SymmetricKeyEncrypted: // This packet contains the decryption key encrypted with a passphrase. md.IsSymmetricallyEncrypted = true symKeys = append(symKeys, p) case *packet.EncryptedKey: // This packet contains the decryption key encrypted to a public key. md.EncryptedToKeyIds = append(md.EncryptedToKeyIds, p.KeyId) switch p.Algo { case packet.PubKeyAlgoRSA, packet.PubKeyAlgoRSAEncryptOnly, packet.PubKeyAlgoElGamal: break default: continue } var keys []Key if p.KeyId == 0 { keys = keyring.DecryptionKeys() } else { keys = keyring.KeysById(p.KeyId) } for _, k := range keys { pubKeys = append(pubKeys, keyEnvelopePair{k, p}) } case *packet.SymmetricallyEncrypted: se = p break ParsePackets case *packet.Compressed, *packet.LiteralData, *packet.OnePassSignature: // This message isn't encrypted. if len(symKeys) != 0 || len(pubKeys) != 0 { return nil, errors.StructuralError("key material not followed by encrypted message") } packets.Unread(p) return readSignedMessage(packets, nil, keyring) } } var candidates []Key var decrypted io.ReadCloser // Now that we have the list of encrypted keys we need to decrypt at // least one of them or, if we cannot, we need to call the prompt // function so that it can decrypt a key or give us a passphrase. FindKey: for { // See if any of the keys already have a private key available candidates = candidates[:0] candidateFingerprints := make(map[string]bool) for _, pk := range pubKeys { if pk.key.PrivateKey == nil { continue } if !pk.key.PrivateKey.Encrypted { if len(pk.encryptedKey.Key) == 0 { pk.encryptedKey.Decrypt(pk.key.PrivateKey, config) } if len(pk.encryptedKey.Key) == 0 { continue } decrypted, err = se.Decrypt(pk.encryptedKey.CipherFunc, pk.encryptedKey.Key) if err != nil && err != errors.ErrKeyIncorrect { return nil, err } if decrypted != nil { md.DecryptedWith = pk.key break FindKey } } else { fpr := string(pk.key.PublicKey.Fingerprint[:]) if v := candidateFingerprints[fpr]; v { continue } candidates = append(candidates, pk.key) candidateFingerprints[fpr] = true } } if len(candidates) == 0 && len(symKeys) == 0 { return nil, errors.ErrKeyIncorrect } if prompt == nil { return nil, errors.ErrKeyIncorrect } passphrase, err := prompt(candidates, len(symKeys) != 0) if err != nil { return nil, err } // Try the symmetric passphrase first if len(symKeys) != 0 && passphrase != nil { for _, s := range symKeys { key, cipherFunc, err := s.Decrypt(passphrase) if err == nil { decrypted, err = se.Decrypt(cipherFunc, key) if err != nil && err != errors.ErrKeyIncorrect { return nil, err } if decrypted != nil { break FindKey } } } } } md.decrypted = decrypted if err := packets.Push(decrypted); err != nil { return nil, err } return readSignedMessage(packets, md, keyring) } // readSignedMessage reads a possibly signed message if mdin is non-zero then // that structure is updated and returned. Otherwise a fresh MessageDetails is // used. func readSignedMessage(packets *packet.Reader, mdin *MessageDetails, keyring KeyRing) (md *MessageDetails, err error) { if mdin == nil { mdin = new(MessageDetails) } md = mdin var p packet.Packet var h hash.Hash var wrappedHash hash.Hash FindLiteralData: for { p, err = packets.Next() if err != nil { return nil, err } switch p := p.(type) { case *packet.Compressed: if err := packets.Push(p.Body); err != nil { return nil, err } case *packet.OnePassSignature: if !p.IsLast { return nil, errors.UnsupportedError("nested signatures") } h, wrappedHash, err = hashForSignature(p.Hash, p.SigType) if err != nil { md = nil return } md.IsSigned = true md.SignedByKeyId = p.KeyId keys := keyring.KeysByIdUsage(p.KeyId, packet.KeyFlagSign) if len(keys) > 0 { md.SignedBy = &keys[0] } case *packet.LiteralData: md.LiteralData = p break FindLiteralData } } if md.SignedBy != nil { md.UnverifiedBody = &signatureCheckReader{packets, h, wrappedHash, md} } else if md.decrypted != nil { md.UnverifiedBody = checkReader{md} } else { md.UnverifiedBody = md.LiteralData.Body } return md, nil } // hashForSignature returns a pair of hashes that can be used to verify a // signature. The signature may specify that the contents of the signed message // should be preprocessed (i.e. to normalize line endings). Thus this function // returns two hashes. The second should be used to hash the message itself and // performs any needed preprocessing. func hashForSignature(hashId crypto.Hash, sigType packet.SignatureType) (hash.Hash, hash.Hash, error) { if !hashId.Available() { return nil, nil, errors.UnsupportedError("hash not available: " + strconv.Itoa(int(hashId))) } h := hashId.New() switch sigType { case packet.SigTypeBinary: return h, h, nil case packet.SigTypeText: return h, NewCanonicalTextHash(h), nil } return nil, nil, errors.UnsupportedError("unsupported signature type: " + strconv.Itoa(int(sigType))) } // checkReader wraps an io.Reader from a LiteralData packet. When it sees EOF // it closes the ReadCloser from any SymmetricallyEncrypted packet to trigger // MDC checks. type checkReader struct { md *MessageDetails } func (cr checkReader) Read(buf []byte) (n int, err error) { n, err = cr.md.LiteralData.Body.Read(buf) if err == io.EOF { mdcErr := cr.md.decrypted.Close() if mdcErr != nil { err = mdcErr } } return } // signatureCheckReader wraps an io.Reader from a LiteralData packet and hashes // the data as it is read. When it sees an EOF from the underlying io.Reader // it parses and checks a trailing Signature packet and triggers any MDC checks. type signatureCheckReader struct { packets *packet.Reader h, wrappedHash hash.Hash md *MessageDetails } func (scr *signatureCheckReader) Read(buf []byte) (n int, err error) { n, err = scr.md.LiteralData.Body.Read(buf) scr.wrappedHash.Write(buf[:n]) if err == io.EOF { var p packet.Packet p, scr.md.SignatureError = scr.packets.Next() if scr.md.SignatureError != nil { return } var ok bool if scr.md.Signature, ok = p.(*packet.Signature); ok { scr.md.SignatureError = scr.md.SignedBy.PublicKey.VerifySignature(scr.h, scr.md.Signature) } else if scr.md.SignatureV3, ok = p.(*packet.SignatureV3); ok { scr.md.SignatureError = scr.md.SignedBy.PublicKey.VerifySignatureV3(scr.h, scr.md.SignatureV3) } else { scr.md.SignatureError = errors.StructuralError("LiteralData not followed by Signature") return } // The SymmetricallyEncrypted packet, if any, might have an // unsigned hash of its own. In order to check this we need to // close that Reader. if scr.md.decrypted != nil { mdcErr := scr.md.decrypted.Close() if mdcErr != nil { err = mdcErr } } } return } // CheckDetachedSignature takes a signed file and a detached signature and // returns the signer if the signature is valid. If the signer isn't known, // ErrUnknownIssuer is returned. func CheckDetachedSignature(keyring KeyRing, signed, signature io.Reader) (signer *Entity, err error) { var issuerKeyId uint64 var hashFunc crypto.Hash var sigType packet.SignatureType var keys []Key var p packet.Packet packets := packet.NewReader(signature) for { p, err = packets.Next() if err == io.EOF { return nil, errors.ErrUnknownIssuer } if err != nil { return nil, err } switch sig := p.(type) { case *packet.Signature: if sig.IssuerKeyId == nil { return nil, errors.StructuralError("signature doesn't have an issuer") } issuerKeyId = *sig.IssuerKeyId hashFunc = sig.Hash sigType = sig.SigType case *packet.SignatureV3: issuerKeyId = sig.IssuerKeyId hashFunc = sig.Hash sigType = sig.SigType default: return nil, errors.StructuralError("non signature packet found") } keys = keyring.KeysByIdUsage(issuerKeyId, packet.KeyFlagSign) if len(keys) > 0 { break } } if len(keys) == 0 { panic("unreachable") } h, wrappedHash, err := hashForSignature(hashFunc, sigType) if err != nil { return nil, err } if _, err := io.Copy(wrappedHash, signed); err != nil && err != io.EOF { return nil, err } for _, key := range keys { switch sig := p.(type) { case *packet.Signature: err = key.PublicKey.VerifySignature(h, sig) case *packet.SignatureV3: err = key.PublicKey.VerifySignatureV3(h, sig) default: panic("unreachable") } if err == nil { return key.Entity, nil } } return nil, err } // CheckArmoredDetachedSignature performs the same actions as // CheckDetachedSignature but expects the signature to be armored. func CheckArmoredDetachedSignature(keyring KeyRing, signed, signature io.Reader) (signer *Entity, err error) { body, err := readArmored(signature, SignatureType) if err != nil { return } return CheckDetachedSignature(keyring, signed, body) } ================================================ FILE: vendor/golang.org/x/crypto/openpgp/s2k/s2k.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package s2k implements the various OpenPGP string-to-key transforms as // specified in RFC 4800 section 3.7.1. // // Deprecated: this package is unmaintained except for security fixes. New // applications should consider a more focused, modern alternative to OpenPGP // for their specific task. If you are required to interoperate with OpenPGP // systems and need a maintained package, consider a community fork. // See https://golang.org/issue/44226. package s2k import ( "crypto" "hash" "io" "strconv" "golang.org/x/crypto/openpgp/errors" ) // Config collects configuration parameters for s2k key-stretching // transformatioms. A nil *Config is valid and results in all default // values. Currently, Config is used only by the Serialize function in // this package. type Config struct { // Hash is the default hash function to be used. If // nil, SHA1 is used. Hash crypto.Hash // S2KCount is only used for symmetric encryption. It // determines the strength of the passphrase stretching when // the said passphrase is hashed to produce a key. S2KCount // should be between 1024 and 65011712, inclusive. If Config // is nil or S2KCount is 0, the value 65536 used. Not all // values in the above range can be represented. S2KCount will // be rounded up to the next representable value if it cannot // be encoded exactly. When set, it is strongly encrouraged to // use a value that is at least 65536. See RFC 4880 Section // 3.7.1.3. S2KCount int } func (c *Config) hash() crypto.Hash { if c == nil || uint(c.Hash) == 0 { // SHA1 is the historical default in this package. return crypto.SHA1 } return c.Hash } func (c *Config) encodedCount() uint8 { if c == nil || c.S2KCount == 0 { return 96 // The common case. Corresponding to 65536 } i := c.S2KCount switch { // Behave like GPG. Should we make 65536 the lowest value used? case i < 1024: i = 1024 case i > 65011712: i = 65011712 } return encodeCount(i) } // encodeCount converts an iterative "count" in the range 1024 to // 65011712, inclusive, to an encoded count. The return value is the // octet that is actually stored in the GPG file. encodeCount panics // if i is not in the above range (encodedCount above takes care to // pass i in the correct range). See RFC 4880 Section 3.7.7.1. func encodeCount(i int) uint8 { if i < 1024 || i > 65011712 { panic("count arg i outside the required range") } for encoded := 0; encoded < 256; encoded++ { count := decodeCount(uint8(encoded)) if count >= i { return uint8(encoded) } } return 255 } // decodeCount returns the s2k mode 3 iterative "count" corresponding to // the encoded octet c. func decodeCount(c uint8) int { return (16 + int(c&15)) << (uint32(c>>4) + 6) } // Simple writes to out the result of computing the Simple S2K function (RFC // 4880, section 3.7.1.1) using the given hash and input passphrase. func Simple(out []byte, h hash.Hash, in []byte) { Salted(out, h, in, nil) } var zero [1]byte // Salted writes to out the result of computing the Salted S2K function (RFC // 4880, section 3.7.1.2) using the given hash, input passphrase and salt. func Salted(out []byte, h hash.Hash, in []byte, salt []byte) { done := 0 var digest []byte for i := 0; done < len(out); i++ { h.Reset() for j := 0; j < i; j++ { h.Write(zero[:]) } h.Write(salt) h.Write(in) digest = h.Sum(digest[:0]) n := copy(out[done:], digest) done += n } } // Iterated writes to out the result of computing the Iterated and Salted S2K // function (RFC 4880, section 3.7.1.3) using the given hash, input passphrase, // salt and iteration count. func Iterated(out []byte, h hash.Hash, in []byte, salt []byte, count int) { combined := make([]byte, len(in)+len(salt)) copy(combined, salt) copy(combined[len(salt):], in) if count < len(combined) { count = len(combined) } done := 0 var digest []byte for i := 0; done < len(out); i++ { h.Reset() for j := 0; j < i; j++ { h.Write(zero[:]) } written := 0 for written < count { if written+len(combined) > count { todo := count - written h.Write(combined[:todo]) written = count } else { h.Write(combined) written += len(combined) } } digest = h.Sum(digest[:0]) n := copy(out[done:], digest) done += n } } // Parse reads a binary specification for a string-to-key transformation from r // and returns a function which performs that transform. func Parse(r io.Reader) (f func(out, in []byte), err error) { var buf [9]byte _, err = io.ReadFull(r, buf[:2]) if err != nil { return } hash, ok := HashIdToHash(buf[1]) if !ok { return nil, errors.UnsupportedError("hash for S2K function: " + strconv.Itoa(int(buf[1]))) } if !hash.Available() { return nil, errors.UnsupportedError("hash not available: " + strconv.Itoa(int(hash))) } h := hash.New() switch buf[0] { case 0: f := func(out, in []byte) { Simple(out, h, in) } return f, nil case 1: _, err = io.ReadFull(r, buf[:8]) if err != nil { return } f := func(out, in []byte) { Salted(out, h, in, buf[:8]) } return f, nil case 3: _, err = io.ReadFull(r, buf[:9]) if err != nil { return } count := decodeCount(buf[8]) f := func(out, in []byte) { Iterated(out, h, in, buf[:8], count) } return f, nil } return nil, errors.UnsupportedError("S2K function") } // Serialize salts and stretches the given passphrase and writes the // resulting key into key. It also serializes an S2K descriptor to // w. The key stretching can be configured with c, which may be // nil. In that case, sensible defaults will be used. func Serialize(w io.Writer, key []byte, rand io.Reader, passphrase []byte, c *Config) error { var buf [11]byte buf[0] = 3 /* iterated and salted */ buf[1], _ = HashToHashId(c.hash()) salt := buf[2:10] if _, err := io.ReadFull(rand, salt); err != nil { return err } encodedCount := c.encodedCount() count := decodeCount(encodedCount) buf[10] = encodedCount if _, err := w.Write(buf[:]); err != nil { return err } Iterated(key, c.hash().New(), passphrase, salt, count) return nil } // hashToHashIdMapping contains pairs relating OpenPGP's hash identifier with // Go's crypto.Hash type. See RFC 4880, section 9.4. var hashToHashIdMapping = []struct { id byte hash crypto.Hash name string }{ {1, crypto.MD5, "MD5"}, {2, crypto.SHA1, "SHA1"}, {3, crypto.RIPEMD160, "RIPEMD160"}, {8, crypto.SHA256, "SHA256"}, {9, crypto.SHA384, "SHA384"}, {10, crypto.SHA512, "SHA512"}, {11, crypto.SHA224, "SHA224"}, } // HashIdToHash returns a crypto.Hash which corresponds to the given OpenPGP // hash id. func HashIdToHash(id byte) (h crypto.Hash, ok bool) { for _, m := range hashToHashIdMapping { if m.id == id { return m.hash, true } } return 0, false } // HashIdToString returns the name of the hash function corresponding to the // given OpenPGP hash id. func HashIdToString(id byte) (name string, ok bool) { for _, m := range hashToHashIdMapping { if m.id == id { return m.name, true } } return "", false } // HashToHashId returns an OpenPGP hash id which corresponds the given Hash. func HashToHashId(h crypto.Hash) (id byte, ok bool) { for _, m := range hashToHashIdMapping { if m.hash == h { return m.id, true } } return 0, false } ================================================ FILE: vendor/golang.org/x/crypto/openpgp/write.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package openpgp import ( "crypto" "hash" "io" "strconv" "time" "golang.org/x/crypto/openpgp/armor" "golang.org/x/crypto/openpgp/errors" "golang.org/x/crypto/openpgp/packet" "golang.org/x/crypto/openpgp/s2k" ) // DetachSign signs message with the private key from signer (which must // already have been decrypted) and writes the signature to w. // If config is nil, sensible defaults will be used. func DetachSign(w io.Writer, signer *Entity, message io.Reader, config *packet.Config) error { return detachSign(w, signer, message, packet.SigTypeBinary, config) } // ArmoredDetachSign signs message with the private key from signer (which // must already have been decrypted) and writes an armored signature to w. // If config is nil, sensible defaults will be used. func ArmoredDetachSign(w io.Writer, signer *Entity, message io.Reader, config *packet.Config) (err error) { return armoredDetachSign(w, signer, message, packet.SigTypeBinary, config) } // DetachSignText signs message (after canonicalising the line endings) with // the private key from signer (which must already have been decrypted) and // writes the signature to w. // If config is nil, sensible defaults will be used. func DetachSignText(w io.Writer, signer *Entity, message io.Reader, config *packet.Config) error { return detachSign(w, signer, message, packet.SigTypeText, config) } // ArmoredDetachSignText signs message (after canonicalising the line endings) // with the private key from signer (which must already have been decrypted) // and writes an armored signature to w. // If config is nil, sensible defaults will be used. func ArmoredDetachSignText(w io.Writer, signer *Entity, message io.Reader, config *packet.Config) error { return armoredDetachSign(w, signer, message, packet.SigTypeText, config) } func armoredDetachSign(w io.Writer, signer *Entity, message io.Reader, sigType packet.SignatureType, config *packet.Config) (err error) { out, err := armor.Encode(w, SignatureType, nil) if err != nil { return } err = detachSign(out, signer, message, sigType, config) if err != nil { return } return out.Close() } func detachSign(w io.Writer, signer *Entity, message io.Reader, sigType packet.SignatureType, config *packet.Config) (err error) { if signer.PrivateKey == nil { return errors.InvalidArgumentError("signing key doesn't have a private key") } if signer.PrivateKey.Encrypted { return errors.InvalidArgumentError("signing key is encrypted") } sig := new(packet.Signature) sig.SigType = sigType sig.PubKeyAlgo = signer.PrivateKey.PubKeyAlgo sig.Hash = config.Hash() sig.CreationTime = config.Now() sig.IssuerKeyId = &signer.PrivateKey.KeyId h, wrappedHash, err := hashForSignature(sig.Hash, sig.SigType) if err != nil { return } io.Copy(wrappedHash, message) err = sig.Sign(h, signer.PrivateKey, config) if err != nil { return } return sig.Serialize(w) } // FileHints contains metadata about encrypted files. This metadata is, itself, // encrypted. type FileHints struct { // IsBinary can be set to hint that the contents are binary data. IsBinary bool // FileName hints at the name of the file that should be written. It's // truncated to 255 bytes if longer. It may be empty to suggest that the // file should not be written to disk. It may be equal to "_CONSOLE" to // suggest the data should not be written to disk. FileName string // ModTime contains the modification time of the file, or the zero time if not applicable. ModTime time.Time } // SymmetricallyEncrypt acts like gpg -c: it encrypts a file with a passphrase. // The resulting WriteCloser must be closed after the contents of the file have // been written. // If config is nil, sensible defaults will be used. func SymmetricallyEncrypt(ciphertext io.Writer, passphrase []byte, hints *FileHints, config *packet.Config) (plaintext io.WriteCloser, err error) { if hints == nil { hints = &FileHints{} } key, err := packet.SerializeSymmetricKeyEncrypted(ciphertext, passphrase, config) if err != nil { return } w, err := packet.SerializeSymmetricallyEncrypted(ciphertext, config.Cipher(), key, config) if err != nil { return } literaldata := w if algo := config.Compression(); algo != packet.CompressionNone { var compConfig *packet.CompressionConfig if config != nil { compConfig = config.CompressionConfig } literaldata, err = packet.SerializeCompressed(w, algo, compConfig) if err != nil { return } } var epochSeconds uint32 if !hints.ModTime.IsZero() { epochSeconds = uint32(hints.ModTime.Unix()) } return packet.SerializeLiteral(literaldata, hints.IsBinary, hints.FileName, epochSeconds) } // intersectPreferences mutates and returns a prefix of a that contains only // the values in the intersection of a and b. The order of a is preserved. func intersectPreferences(a []uint8, b []uint8) (intersection []uint8) { var j int for _, v := range a { for _, v2 := range b { if v == v2 { a[j] = v j++ break } } } return a[:j] } func hashToHashId(h crypto.Hash) uint8 { v, ok := s2k.HashToHashId(h) if !ok { panic("tried to convert unknown hash") } return v } // writeAndSign writes the data as a payload package and, optionally, signs // it. hints contains optional information, that is also encrypted, // that aids the recipients in processing the message. The resulting // WriteCloser must be closed after the contents of the file have been // written. If config is nil, sensible defaults will be used. func writeAndSign(payload io.WriteCloser, candidateHashes []uint8, signed *Entity, hints *FileHints, config *packet.Config) (plaintext io.WriteCloser, err error) { var signer *packet.PrivateKey if signed != nil { signKey, ok := signed.signingKey(config.Now()) if !ok { return nil, errors.InvalidArgumentError("no valid signing keys") } signer = signKey.PrivateKey if signer == nil { return nil, errors.InvalidArgumentError("no private key in signing key") } if signer.Encrypted { return nil, errors.InvalidArgumentError("signing key must be decrypted") } } var hash crypto.Hash for _, hashId := range candidateHashes { if h, ok := s2k.HashIdToHash(hashId); ok && h.Available() { hash = h break } } // If the hash specified by config is a candidate, we'll use that. if configuredHash := config.Hash(); configuredHash.Available() { for _, hashId := range candidateHashes { if h, ok := s2k.HashIdToHash(hashId); ok && h == configuredHash { hash = h break } } } if hash == 0 { hashId := candidateHashes[0] name, ok := s2k.HashIdToString(hashId) if !ok { name = "#" + strconv.Itoa(int(hashId)) } return nil, errors.InvalidArgumentError("cannot encrypt because no candidate hash functions are compiled in. (Wanted " + name + " in this case.)") } if signer != nil { ops := &packet.OnePassSignature{ SigType: packet.SigTypeBinary, Hash: hash, PubKeyAlgo: signer.PubKeyAlgo, KeyId: signer.KeyId, IsLast: true, } if err := ops.Serialize(payload); err != nil { return nil, err } } if hints == nil { hints = &FileHints{} } w := payload if signer != nil { // If we need to write a signature packet after the literal // data then we need to stop literalData from closing // encryptedData. w = noOpCloser{w} } var epochSeconds uint32 if !hints.ModTime.IsZero() { epochSeconds = uint32(hints.ModTime.Unix()) } literalData, err := packet.SerializeLiteral(w, hints.IsBinary, hints.FileName, epochSeconds) if err != nil { return nil, err } if signer != nil { return signatureWriter{payload, literalData, hash, hash.New(), signer, config}, nil } return literalData, nil } // Encrypt encrypts a message to a number of recipients and, optionally, signs // it. hints contains optional information, that is also encrypted, that aids // the recipients in processing the message. The resulting WriteCloser must // be closed after the contents of the file have been written. // If config is nil, sensible defaults will be used. func Encrypt(ciphertext io.Writer, to []*Entity, signed *Entity, hints *FileHints, config *packet.Config) (plaintext io.WriteCloser, err error) { if len(to) == 0 { return nil, errors.InvalidArgumentError("no encryption recipient provided") } // These are the possible ciphers that we'll use for the message. candidateCiphers := []uint8{ uint8(packet.CipherAES128), uint8(packet.CipherAES256), uint8(packet.CipherCAST5), } // These are the possible hash functions that we'll use for the signature. candidateHashes := []uint8{ hashToHashId(crypto.SHA256), hashToHashId(crypto.SHA384), hashToHashId(crypto.SHA512), hashToHashId(crypto.SHA1), hashToHashId(crypto.RIPEMD160), } // In the event that a recipient doesn't specify any supported ciphers // or hash functions, these are the ones that we assume that every // implementation supports. defaultCiphers := candidateCiphers[len(candidateCiphers)-1:] defaultHashes := candidateHashes[len(candidateHashes)-1:] encryptKeys := make([]Key, len(to)) for i := range to { var ok bool encryptKeys[i], ok = to[i].encryptionKey(config.Now()) if !ok { return nil, errors.InvalidArgumentError("cannot encrypt a message to key id " + strconv.FormatUint(to[i].PrimaryKey.KeyId, 16) + " because it has no encryption keys") } sig := to[i].primaryIdentity().SelfSignature preferredSymmetric := sig.PreferredSymmetric if len(preferredSymmetric) == 0 { preferredSymmetric = defaultCiphers } preferredHashes := sig.PreferredHash if len(preferredHashes) == 0 { preferredHashes = defaultHashes } candidateCiphers = intersectPreferences(candidateCiphers, preferredSymmetric) candidateHashes = intersectPreferences(candidateHashes, preferredHashes) } if len(candidateCiphers) == 0 || len(candidateHashes) == 0 { return nil, errors.InvalidArgumentError("cannot encrypt because recipient set shares no common algorithms") } cipher := packet.CipherFunction(candidateCiphers[0]) // If the cipher specified by config is a candidate, we'll use that. configuredCipher := config.Cipher() for _, c := range candidateCiphers { cipherFunc := packet.CipherFunction(c) if cipherFunc == configuredCipher { cipher = cipherFunc break } } symKey := make([]byte, cipher.KeySize()) if _, err := io.ReadFull(config.Random(), symKey); err != nil { return nil, err } for _, key := range encryptKeys { if err := packet.SerializeEncryptedKey(ciphertext, key.PublicKey, cipher, symKey, config); err != nil { return nil, err } } payload, err := packet.SerializeSymmetricallyEncrypted(ciphertext, cipher, symKey, config) if err != nil { return } return writeAndSign(payload, candidateHashes, signed, hints, config) } // Sign signs a message. The resulting WriteCloser must be closed after the // contents of the file have been written. hints contains optional information // that aids the recipients in processing the message. // If config is nil, sensible defaults will be used. func Sign(output io.Writer, signed *Entity, hints *FileHints, config *packet.Config) (input io.WriteCloser, err error) { if signed == nil { return nil, errors.InvalidArgumentError("no signer provided") } // These are the possible hash functions that we'll use for the signature. candidateHashes := []uint8{ hashToHashId(crypto.SHA256), hashToHashId(crypto.SHA384), hashToHashId(crypto.SHA512), hashToHashId(crypto.SHA1), hashToHashId(crypto.RIPEMD160), } defaultHashes := candidateHashes[len(candidateHashes)-1:] preferredHashes := signed.primaryIdentity().SelfSignature.PreferredHash if len(preferredHashes) == 0 { preferredHashes = defaultHashes } candidateHashes = intersectPreferences(candidateHashes, preferredHashes) return writeAndSign(noOpCloser{output}, candidateHashes, signed, hints, config) } // signatureWriter hashes the contents of a message while passing it along to // literalData. When closed, it closes literalData, writes a signature packet // to encryptedData and then also closes encryptedData. type signatureWriter struct { encryptedData io.WriteCloser literalData io.WriteCloser hashType crypto.Hash h hash.Hash signer *packet.PrivateKey config *packet.Config } func (s signatureWriter) Write(data []byte) (int, error) { s.h.Write(data) return s.literalData.Write(data) } func (s signatureWriter) Close() error { sig := &packet.Signature{ SigType: packet.SigTypeBinary, PubKeyAlgo: s.signer.PubKeyAlgo, Hash: s.hashType, CreationTime: s.config.Now(), IssuerKeyId: &s.signer.KeyId, } if err := sig.Sign(s.h, s.signer, s.config); err != nil { return err } if err := s.literalData.Close(); err != nil { return err } if err := sig.Serialize(s.encryptedData); err != nil { return err } return s.encryptedData.Close() } // noOpCloser is like an io.NopCloser, but for an io.Writer. // TODO: we have two of these in OpenPGP packages alone. This probably needs // to be promoted somewhere more common. type noOpCloser struct { w io.Writer } func (c noOpCloser) Write(data []byte) (n int, err error) { return c.w.Write(data) } func (c noOpCloser) Close() error { return nil } ================================================ FILE: vendor/golang.org/x/crypto/pbkdf2/pbkdf2.go ================================================ // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Package pbkdf2 implements the key derivation function PBKDF2 as defined in RFC 2898 / PKCS #5 v2.0. A key derivation function is useful when encrypting data based on a password or any other not-fully-random data. It uses a pseudorandom function to derive a secure encryption key based on the password. While v2.0 of the standard defines only one pseudorandom function to use, HMAC-SHA1, the drafted v2.1 specification allows use of all five FIPS Approved Hash Functions SHA-1, SHA-224, SHA-256, SHA-384 and SHA-512 for HMAC. To choose, you can pass the `New` functions from the different SHA packages to pbkdf2.Key. */ package pbkdf2 import ( "crypto/hmac" "hash" ) // Key derives a key from the password, salt and iteration count, returning a // []byte of length keylen that can be used as cryptographic key. The key is // derived based on the method described as PBKDF2 with the HMAC variant using // the supplied hash function. // // For example, to use a HMAC-SHA-1 based PBKDF2 key derivation function, you // can get a derived key for e.g. AES-256 (which needs a 32-byte key) by // doing: // // dk := pbkdf2.Key([]byte("some password"), salt, 4096, 32, sha1.New) // // Remember to get a good random salt. At least 8 bytes is recommended by the // RFC. // // Using a higher iteration count will increase the cost of an exhaustive // search but will also make derivation proportionally slower. func Key(password, salt []byte, iter, keyLen int, h func() hash.Hash) []byte { prf := hmac.New(h, password) hashLen := prf.Size() numBlocks := (keyLen + hashLen - 1) / hashLen var buf [4]byte dk := make([]byte, 0, numBlocks*hashLen) U := make([]byte, hashLen) for block := 1; block <= numBlocks; block++ { // N.B.: || means concatenation, ^ means XOR // for each block T_i = U_1 ^ U_2 ^ ... ^ U_iter // U_1 = PRF(password, salt || uint(i)) prf.Reset() prf.Write(salt) buf[0] = byte(block >> 24) buf[1] = byte(block >> 16) buf[2] = byte(block >> 8) buf[3] = byte(block) prf.Write(buf[:4]) dk = prf.Sum(dk) T := dk[len(dk)-hashLen:] copy(U, T) // U_n = PRF(password, U_(n-1)) for n := 2; n <= iter; n++ { prf.Reset() prf.Write(U) U = U[:0] U = prf.Sum(U) for x := range U { T[x] ^= U[x] } } } return dk[:keyLen] } ================================================ FILE: vendor/golang.org/x/crypto/salsa20/salsa/hsalsa20.go ================================================ // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package salsa provides low-level access to functions in the Salsa family. // // Deprecated: this package exposes unsafe low-level operations. New applications // should consider using the AEAD construction in golang.org/x/crypto/chacha20poly1305 // instead. Existing users should migrate to golang.org/x/crypto/salsa20. package salsa import "math/bits" // Sigma is the Salsa20 constant for 256-bit keys. var Sigma = [16]byte{'e', 'x', 'p', 'a', 'n', 'd', ' ', '3', '2', '-', 'b', 'y', 't', 'e', ' ', 'k'} // HSalsa20 applies the HSalsa20 core function to a 16-byte input in, 32-byte // key k, and 16-byte constant c, and puts the result into the 32-byte array // out. func HSalsa20(out *[32]byte, in *[16]byte, k *[32]byte, c *[16]byte) { x0 := uint32(c[0]) | uint32(c[1])<<8 | uint32(c[2])<<16 | uint32(c[3])<<24 x1 := uint32(k[0]) | uint32(k[1])<<8 | uint32(k[2])<<16 | uint32(k[3])<<24 x2 := uint32(k[4]) | uint32(k[5])<<8 | uint32(k[6])<<16 | uint32(k[7])<<24 x3 := uint32(k[8]) | uint32(k[9])<<8 | uint32(k[10])<<16 | uint32(k[11])<<24 x4 := uint32(k[12]) | uint32(k[13])<<8 | uint32(k[14])<<16 | uint32(k[15])<<24 x5 := uint32(c[4]) | uint32(c[5])<<8 | uint32(c[6])<<16 | uint32(c[7])<<24 x6 := uint32(in[0]) | uint32(in[1])<<8 | uint32(in[2])<<16 | uint32(in[3])<<24 x7 := uint32(in[4]) | uint32(in[5])<<8 | uint32(in[6])<<16 | uint32(in[7])<<24 x8 := uint32(in[8]) | uint32(in[9])<<8 | uint32(in[10])<<16 | uint32(in[11])<<24 x9 := uint32(in[12]) | uint32(in[13])<<8 | uint32(in[14])<<16 | uint32(in[15])<<24 x10 := uint32(c[8]) | uint32(c[9])<<8 | uint32(c[10])<<16 | uint32(c[11])<<24 x11 := uint32(k[16]) | uint32(k[17])<<8 | uint32(k[18])<<16 | uint32(k[19])<<24 x12 := uint32(k[20]) | uint32(k[21])<<8 | uint32(k[22])<<16 | uint32(k[23])<<24 x13 := uint32(k[24]) | uint32(k[25])<<8 | uint32(k[26])<<16 | uint32(k[27])<<24 x14 := uint32(k[28]) | uint32(k[29])<<8 | uint32(k[30])<<16 | uint32(k[31])<<24 x15 := uint32(c[12]) | uint32(c[13])<<8 | uint32(c[14])<<16 | uint32(c[15])<<24 for i := 0; i < 20; i += 2 { u := x0 + x12 x4 ^= bits.RotateLeft32(u, 7) u = x4 + x0 x8 ^= bits.RotateLeft32(u, 9) u = x8 + x4 x12 ^= bits.RotateLeft32(u, 13) u = x12 + x8 x0 ^= bits.RotateLeft32(u, 18) u = x5 + x1 x9 ^= bits.RotateLeft32(u, 7) u = x9 + x5 x13 ^= bits.RotateLeft32(u, 9) u = x13 + x9 x1 ^= bits.RotateLeft32(u, 13) u = x1 + x13 x5 ^= bits.RotateLeft32(u, 18) u = x10 + x6 x14 ^= bits.RotateLeft32(u, 7) u = x14 + x10 x2 ^= bits.RotateLeft32(u, 9) u = x2 + x14 x6 ^= bits.RotateLeft32(u, 13) u = x6 + x2 x10 ^= bits.RotateLeft32(u, 18) u = x15 + x11 x3 ^= bits.RotateLeft32(u, 7) u = x3 + x15 x7 ^= bits.RotateLeft32(u, 9) u = x7 + x3 x11 ^= bits.RotateLeft32(u, 13) u = x11 + x7 x15 ^= bits.RotateLeft32(u, 18) u = x0 + x3 x1 ^= bits.RotateLeft32(u, 7) u = x1 + x0 x2 ^= bits.RotateLeft32(u, 9) u = x2 + x1 x3 ^= bits.RotateLeft32(u, 13) u = x3 + x2 x0 ^= bits.RotateLeft32(u, 18) u = x5 + x4 x6 ^= bits.RotateLeft32(u, 7) u = x6 + x5 x7 ^= bits.RotateLeft32(u, 9) u = x7 + x6 x4 ^= bits.RotateLeft32(u, 13) u = x4 + x7 x5 ^= bits.RotateLeft32(u, 18) u = x10 + x9 x11 ^= bits.RotateLeft32(u, 7) u = x11 + x10 x8 ^= bits.RotateLeft32(u, 9) u = x8 + x11 x9 ^= bits.RotateLeft32(u, 13) u = x9 + x8 x10 ^= bits.RotateLeft32(u, 18) u = x15 + x14 x12 ^= bits.RotateLeft32(u, 7) u = x12 + x15 x13 ^= bits.RotateLeft32(u, 9) u = x13 + x12 x14 ^= bits.RotateLeft32(u, 13) u = x14 + x13 x15 ^= bits.RotateLeft32(u, 18) } out[0] = byte(x0) out[1] = byte(x0 >> 8) out[2] = byte(x0 >> 16) out[3] = byte(x0 >> 24) out[4] = byte(x5) out[5] = byte(x5 >> 8) out[6] = byte(x5 >> 16) out[7] = byte(x5 >> 24) out[8] = byte(x10) out[9] = byte(x10 >> 8) out[10] = byte(x10 >> 16) out[11] = byte(x10 >> 24) out[12] = byte(x15) out[13] = byte(x15 >> 8) out[14] = byte(x15 >> 16) out[15] = byte(x15 >> 24) out[16] = byte(x6) out[17] = byte(x6 >> 8) out[18] = byte(x6 >> 16) out[19] = byte(x6 >> 24) out[20] = byte(x7) out[21] = byte(x7 >> 8) out[22] = byte(x7 >> 16) out[23] = byte(x7 >> 24) out[24] = byte(x8) out[25] = byte(x8 >> 8) out[26] = byte(x8 >> 16) out[27] = byte(x8 >> 24) out[28] = byte(x9) out[29] = byte(x9 >> 8) out[30] = byte(x9 >> 16) out[31] = byte(x9 >> 24) } ================================================ FILE: vendor/golang.org/x/crypto/salsa20/salsa/salsa208.go ================================================ // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package salsa import "math/bits" // Core208 applies the Salsa20/8 core function to the 64-byte array in and puts // the result into the 64-byte array out. The input and output may be the same array. func Core208(out *[64]byte, in *[64]byte) { j0 := uint32(in[0]) | uint32(in[1])<<8 | uint32(in[2])<<16 | uint32(in[3])<<24 j1 := uint32(in[4]) | uint32(in[5])<<8 | uint32(in[6])<<16 | uint32(in[7])<<24 j2 := uint32(in[8]) | uint32(in[9])<<8 | uint32(in[10])<<16 | uint32(in[11])<<24 j3 := uint32(in[12]) | uint32(in[13])<<8 | uint32(in[14])<<16 | uint32(in[15])<<24 j4 := uint32(in[16]) | uint32(in[17])<<8 | uint32(in[18])<<16 | uint32(in[19])<<24 j5 := uint32(in[20]) | uint32(in[21])<<8 | uint32(in[22])<<16 | uint32(in[23])<<24 j6 := uint32(in[24]) | uint32(in[25])<<8 | uint32(in[26])<<16 | uint32(in[27])<<24 j7 := uint32(in[28]) | uint32(in[29])<<8 | uint32(in[30])<<16 | uint32(in[31])<<24 j8 := uint32(in[32]) | uint32(in[33])<<8 | uint32(in[34])<<16 | uint32(in[35])<<24 j9 := uint32(in[36]) | uint32(in[37])<<8 | uint32(in[38])<<16 | uint32(in[39])<<24 j10 := uint32(in[40]) | uint32(in[41])<<8 | uint32(in[42])<<16 | uint32(in[43])<<24 j11 := uint32(in[44]) | uint32(in[45])<<8 | uint32(in[46])<<16 | uint32(in[47])<<24 j12 := uint32(in[48]) | uint32(in[49])<<8 | uint32(in[50])<<16 | uint32(in[51])<<24 j13 := uint32(in[52]) | uint32(in[53])<<8 | uint32(in[54])<<16 | uint32(in[55])<<24 j14 := uint32(in[56]) | uint32(in[57])<<8 | uint32(in[58])<<16 | uint32(in[59])<<24 j15 := uint32(in[60]) | uint32(in[61])<<8 | uint32(in[62])<<16 | uint32(in[63])<<24 x0, x1, x2, x3, x4, x5, x6, x7, x8 := j0, j1, j2, j3, j4, j5, j6, j7, j8 x9, x10, x11, x12, x13, x14, x15 := j9, j10, j11, j12, j13, j14, j15 for i := 0; i < 8; i += 2 { u := x0 + x12 x4 ^= bits.RotateLeft32(u, 7) u = x4 + x0 x8 ^= bits.RotateLeft32(u, 9) u = x8 + x4 x12 ^= bits.RotateLeft32(u, 13) u = x12 + x8 x0 ^= bits.RotateLeft32(u, 18) u = x5 + x1 x9 ^= bits.RotateLeft32(u, 7) u = x9 + x5 x13 ^= bits.RotateLeft32(u, 9) u = x13 + x9 x1 ^= bits.RotateLeft32(u, 13) u = x1 + x13 x5 ^= bits.RotateLeft32(u, 18) u = x10 + x6 x14 ^= bits.RotateLeft32(u, 7) u = x14 + x10 x2 ^= bits.RotateLeft32(u, 9) u = x2 + x14 x6 ^= bits.RotateLeft32(u, 13) u = x6 + x2 x10 ^= bits.RotateLeft32(u, 18) u = x15 + x11 x3 ^= bits.RotateLeft32(u, 7) u = x3 + x15 x7 ^= bits.RotateLeft32(u, 9) u = x7 + x3 x11 ^= bits.RotateLeft32(u, 13) u = x11 + x7 x15 ^= bits.RotateLeft32(u, 18) u = x0 + x3 x1 ^= bits.RotateLeft32(u, 7) u = x1 + x0 x2 ^= bits.RotateLeft32(u, 9) u = x2 + x1 x3 ^= bits.RotateLeft32(u, 13) u = x3 + x2 x0 ^= bits.RotateLeft32(u, 18) u = x5 + x4 x6 ^= bits.RotateLeft32(u, 7) u = x6 + x5 x7 ^= bits.RotateLeft32(u, 9) u = x7 + x6 x4 ^= bits.RotateLeft32(u, 13) u = x4 + x7 x5 ^= bits.RotateLeft32(u, 18) u = x10 + x9 x11 ^= bits.RotateLeft32(u, 7) u = x11 + x10 x8 ^= bits.RotateLeft32(u, 9) u = x8 + x11 x9 ^= bits.RotateLeft32(u, 13) u = x9 + x8 x10 ^= bits.RotateLeft32(u, 18) u = x15 + x14 x12 ^= bits.RotateLeft32(u, 7) u = x12 + x15 x13 ^= bits.RotateLeft32(u, 9) u = x13 + x12 x14 ^= bits.RotateLeft32(u, 13) u = x14 + x13 x15 ^= bits.RotateLeft32(u, 18) } x0 += j0 x1 += j1 x2 += j2 x3 += j3 x4 += j4 x5 += j5 x6 += j6 x7 += j7 x8 += j8 x9 += j9 x10 += j10 x11 += j11 x12 += j12 x13 += j13 x14 += j14 x15 += j15 out[0] = byte(x0) out[1] = byte(x0 >> 8) out[2] = byte(x0 >> 16) out[3] = byte(x0 >> 24) out[4] = byte(x1) out[5] = byte(x1 >> 8) out[6] = byte(x1 >> 16) out[7] = byte(x1 >> 24) out[8] = byte(x2) out[9] = byte(x2 >> 8) out[10] = byte(x2 >> 16) out[11] = byte(x2 >> 24) out[12] = byte(x3) out[13] = byte(x3 >> 8) out[14] = byte(x3 >> 16) out[15] = byte(x3 >> 24) out[16] = byte(x4) out[17] = byte(x4 >> 8) out[18] = byte(x4 >> 16) out[19] = byte(x4 >> 24) out[20] = byte(x5) out[21] = byte(x5 >> 8) out[22] = byte(x5 >> 16) out[23] = byte(x5 >> 24) out[24] = byte(x6) out[25] = byte(x6 >> 8) out[26] = byte(x6 >> 16) out[27] = byte(x6 >> 24) out[28] = byte(x7) out[29] = byte(x7 >> 8) out[30] = byte(x7 >> 16) out[31] = byte(x7 >> 24) out[32] = byte(x8) out[33] = byte(x8 >> 8) out[34] = byte(x8 >> 16) out[35] = byte(x8 >> 24) out[36] = byte(x9) out[37] = byte(x9 >> 8) out[38] = byte(x9 >> 16) out[39] = byte(x9 >> 24) out[40] = byte(x10) out[41] = byte(x10 >> 8) out[42] = byte(x10 >> 16) out[43] = byte(x10 >> 24) out[44] = byte(x11) out[45] = byte(x11 >> 8) out[46] = byte(x11 >> 16) out[47] = byte(x11 >> 24) out[48] = byte(x12) out[49] = byte(x12 >> 8) out[50] = byte(x12 >> 16) out[51] = byte(x12 >> 24) out[52] = byte(x13) out[53] = byte(x13 >> 8) out[54] = byte(x13 >> 16) out[55] = byte(x13 >> 24) out[56] = byte(x14) out[57] = byte(x14 >> 8) out[58] = byte(x14 >> 16) out[59] = byte(x14 >> 24) out[60] = byte(x15) out[61] = byte(x15 >> 8) out[62] = byte(x15 >> 16) out[63] = byte(x15 >> 24) } ================================================ FILE: vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.go ================================================ // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build amd64 && !purego && gc package salsa //go:noescape // salsa2020XORKeyStream is implemented in salsa20_amd64.s. func salsa2020XORKeyStream(out, in *byte, n uint64, nonce, key *byte) // XORKeyStream crypts bytes from in to out using the given key and counters. // In and out must overlap entirely or not at all. Counter // contains the raw salsa20 counter bytes (both nonce and block counter). func XORKeyStream(out, in []byte, counter *[16]byte, key *[32]byte) { if len(in) == 0 { return } _ = out[len(in)-1] salsa2020XORKeyStream(&out[0], &in[0], uint64(len(in)), &counter[0], &key[0]) } ================================================ FILE: vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.s ================================================ // Code generated by command: go run salsa20_amd64_asm.go -out ../salsa20_amd64.s -pkg salsa. DO NOT EDIT. //go:build amd64 && !purego && gc // func salsa2020XORKeyStream(out *byte, in *byte, n uint64, nonce *byte, key *byte) // Requires: SSE2 TEXT ·salsa2020XORKeyStream(SB), $456-40 // This needs up to 64 bytes at 360(R12); hence the non-obvious frame size. MOVQ out+0(FP), DI MOVQ in+8(FP), SI MOVQ n+16(FP), DX MOVQ nonce+24(FP), CX MOVQ key+32(FP), R8 MOVQ SP, R12 ADDQ $0x1f, R12 ANDQ $-32, R12 MOVQ DX, R9 MOVQ CX, DX MOVQ R8, R10 CMPQ R9, $0x00 JBE DONE MOVL 20(R10), CX MOVL (R10), R8 MOVL (DX), AX MOVL 16(R10), R11 MOVL CX, (R12) MOVL R8, 4(R12) MOVL AX, 8(R12) MOVL R11, 12(R12) MOVL 8(DX), CX MOVL 24(R10), R8 MOVL 4(R10), AX MOVL 4(DX), R11 MOVL CX, 16(R12) MOVL R8, 20(R12) MOVL AX, 24(R12) MOVL R11, 28(R12) MOVL 12(DX), CX MOVL 12(R10), DX MOVL 28(R10), R8 MOVL 8(R10), AX MOVL DX, 32(R12) MOVL CX, 36(R12) MOVL R8, 40(R12) MOVL AX, 44(R12) MOVQ $0x61707865, DX MOVQ $0x3320646e, CX MOVQ $0x79622d32, R8 MOVQ $0x6b206574, AX MOVL DX, 48(R12) MOVL CX, 52(R12) MOVL R8, 56(R12) MOVL AX, 60(R12) CMPQ R9, $0x00000100 JB BYTESBETWEEN1AND255 MOVOA 48(R12), X0 PSHUFL $0x55, X0, X1 PSHUFL $0xaa, X0, X2 PSHUFL $0xff, X0, X3 PSHUFL $0x00, X0, X0 MOVOA X1, 64(R12) MOVOA X2, 80(R12) MOVOA X3, 96(R12) MOVOA X0, 112(R12) MOVOA (R12), X0 PSHUFL $0xaa, X0, X1 PSHUFL $0xff, X0, X2 PSHUFL $0x00, X0, X3 PSHUFL $0x55, X0, X0 MOVOA X1, 128(R12) MOVOA X2, 144(R12) MOVOA X3, 160(R12) MOVOA X0, 176(R12) MOVOA 16(R12), X0 PSHUFL $0xff, X0, X1 PSHUFL $0x55, X0, X2 PSHUFL $0xaa, X0, X0 MOVOA X1, 192(R12) MOVOA X2, 208(R12) MOVOA X0, 224(R12) MOVOA 32(R12), X0 PSHUFL $0x00, X0, X1 PSHUFL $0xaa, X0, X2 PSHUFL $0xff, X0, X0 MOVOA X1, 240(R12) MOVOA X2, 256(R12) MOVOA X0, 272(R12) BYTESATLEAST256: MOVL 16(R12), DX MOVL 36(R12), CX MOVL DX, 288(R12) MOVL CX, 304(R12) SHLQ $0x20, CX ADDQ CX, DX ADDQ $0x01, DX MOVQ DX, CX SHRQ $0x20, CX MOVL DX, 292(R12) MOVL CX, 308(R12) ADDQ $0x01, DX MOVQ DX, CX SHRQ $0x20, CX MOVL DX, 296(R12) MOVL CX, 312(R12) ADDQ $0x01, DX MOVQ DX, CX SHRQ $0x20, CX MOVL DX, 300(R12) MOVL CX, 316(R12) ADDQ $0x01, DX MOVQ DX, CX SHRQ $0x20, CX MOVL DX, 16(R12) MOVL CX, 36(R12) MOVQ R9, 352(R12) MOVQ $0x00000014, DX MOVOA 64(R12), X0 MOVOA 80(R12), X1 MOVOA 96(R12), X2 MOVOA 256(R12), X3 MOVOA 272(R12), X4 MOVOA 128(R12), X5 MOVOA 144(R12), X6 MOVOA 176(R12), X7 MOVOA 192(R12), X8 MOVOA 208(R12), X9 MOVOA 224(R12), X10 MOVOA 304(R12), X11 MOVOA 112(R12), X12 MOVOA 160(R12), X13 MOVOA 240(R12), X14 MOVOA 288(R12), X15 MAINLOOP1: MOVOA X1, 320(R12) MOVOA X2, 336(R12) MOVOA X13, X1 PADDL X12, X1 MOVOA X1, X2 PSLLL $0x07, X1 PXOR X1, X14 PSRLL $0x19, X2 PXOR X2, X14 MOVOA X7, X1 PADDL X0, X1 MOVOA X1, X2 PSLLL $0x07, X1 PXOR X1, X11 PSRLL $0x19, X2 PXOR X2, X11 MOVOA X12, X1 PADDL X14, X1 MOVOA X1, X2 PSLLL $0x09, X1 PXOR X1, X15 PSRLL $0x17, X2 PXOR X2, X15 MOVOA X0, X1 PADDL X11, X1 MOVOA X1, X2 PSLLL $0x09, X1 PXOR X1, X9 PSRLL $0x17, X2 PXOR X2, X9 MOVOA X14, X1 PADDL X15, X1 MOVOA X1, X2 PSLLL $0x0d, X1 PXOR X1, X13 PSRLL $0x13, X2 PXOR X2, X13 MOVOA X11, X1 PADDL X9, X1 MOVOA X1, X2 PSLLL $0x0d, X1 PXOR X1, X7 PSRLL $0x13, X2 PXOR X2, X7 MOVOA X15, X1 PADDL X13, X1 MOVOA X1, X2 PSLLL $0x12, X1 PXOR X1, X12 PSRLL $0x0e, X2 PXOR X2, X12 MOVOA 320(R12), X1 MOVOA X12, 320(R12) MOVOA X9, X2 PADDL X7, X2 MOVOA X2, X12 PSLLL $0x12, X2 PXOR X2, X0 PSRLL $0x0e, X12 PXOR X12, X0 MOVOA X5, X2 PADDL X1, X2 MOVOA X2, X12 PSLLL $0x07, X2 PXOR X2, X3 PSRLL $0x19, X12 PXOR X12, X3 MOVOA 336(R12), X2 MOVOA X0, 336(R12) MOVOA X6, X0 PADDL X2, X0 MOVOA X0, X12 PSLLL $0x07, X0 PXOR X0, X4 PSRLL $0x19, X12 PXOR X12, X4 MOVOA X1, X0 PADDL X3, X0 MOVOA X0, X12 PSLLL $0x09, X0 PXOR X0, X10 PSRLL $0x17, X12 PXOR X12, X10 MOVOA X2, X0 PADDL X4, X0 MOVOA X0, X12 PSLLL $0x09, X0 PXOR X0, X8 PSRLL $0x17, X12 PXOR X12, X8 MOVOA X3, X0 PADDL X10, X0 MOVOA X0, X12 PSLLL $0x0d, X0 PXOR X0, X5 PSRLL $0x13, X12 PXOR X12, X5 MOVOA X4, X0 PADDL X8, X0 MOVOA X0, X12 PSLLL $0x0d, X0 PXOR X0, X6 PSRLL $0x13, X12 PXOR X12, X6 MOVOA X10, X0 PADDL X5, X0 MOVOA X0, X12 PSLLL $0x12, X0 PXOR X0, X1 PSRLL $0x0e, X12 PXOR X12, X1 MOVOA 320(R12), X0 MOVOA X1, 320(R12) MOVOA X4, X1 PADDL X0, X1 MOVOA X1, X12 PSLLL $0x07, X1 PXOR X1, X7 PSRLL $0x19, X12 PXOR X12, X7 MOVOA X8, X1 PADDL X6, X1 MOVOA X1, X12 PSLLL $0x12, X1 PXOR X1, X2 PSRLL $0x0e, X12 PXOR X12, X2 MOVOA 336(R12), X12 MOVOA X2, 336(R12) MOVOA X14, X1 PADDL X12, X1 MOVOA X1, X2 PSLLL $0x07, X1 PXOR X1, X5 PSRLL $0x19, X2 PXOR X2, X5 MOVOA X0, X1 PADDL X7, X1 MOVOA X1, X2 PSLLL $0x09, X1 PXOR X1, X10 PSRLL $0x17, X2 PXOR X2, X10 MOVOA X12, X1 PADDL X5, X1 MOVOA X1, X2 PSLLL $0x09, X1 PXOR X1, X8 PSRLL $0x17, X2 PXOR X2, X8 MOVOA X7, X1 PADDL X10, X1 MOVOA X1, X2 PSLLL $0x0d, X1 PXOR X1, X4 PSRLL $0x13, X2 PXOR X2, X4 MOVOA X5, X1 PADDL X8, X1 MOVOA X1, X2 PSLLL $0x0d, X1 PXOR X1, X14 PSRLL $0x13, X2 PXOR X2, X14 MOVOA X10, X1 PADDL X4, X1 MOVOA X1, X2 PSLLL $0x12, X1 PXOR X1, X0 PSRLL $0x0e, X2 PXOR X2, X0 MOVOA 320(R12), X1 MOVOA X0, 320(R12) MOVOA X8, X0 PADDL X14, X0 MOVOA X0, X2 PSLLL $0x12, X0 PXOR X0, X12 PSRLL $0x0e, X2 PXOR X2, X12 MOVOA X11, X0 PADDL X1, X0 MOVOA X0, X2 PSLLL $0x07, X0 PXOR X0, X6 PSRLL $0x19, X2 PXOR X2, X6 MOVOA 336(R12), X2 MOVOA X12, 336(R12) MOVOA X3, X0 PADDL X2, X0 MOVOA X0, X12 PSLLL $0x07, X0 PXOR X0, X13 PSRLL $0x19, X12 PXOR X12, X13 MOVOA X1, X0 PADDL X6, X0 MOVOA X0, X12 PSLLL $0x09, X0 PXOR X0, X15 PSRLL $0x17, X12 PXOR X12, X15 MOVOA X2, X0 PADDL X13, X0 MOVOA X0, X12 PSLLL $0x09, X0 PXOR X0, X9 PSRLL $0x17, X12 PXOR X12, X9 MOVOA X6, X0 PADDL X15, X0 MOVOA X0, X12 PSLLL $0x0d, X0 PXOR X0, X11 PSRLL $0x13, X12 PXOR X12, X11 MOVOA X13, X0 PADDL X9, X0 MOVOA X0, X12 PSLLL $0x0d, X0 PXOR X0, X3 PSRLL $0x13, X12 PXOR X12, X3 MOVOA X15, X0 PADDL X11, X0 MOVOA X0, X12 PSLLL $0x12, X0 PXOR X0, X1 PSRLL $0x0e, X12 PXOR X12, X1 MOVOA X9, X0 PADDL X3, X0 MOVOA X0, X12 PSLLL $0x12, X0 PXOR X0, X2 PSRLL $0x0e, X12 PXOR X12, X2 MOVOA 320(R12), X12 MOVOA 336(R12), X0 SUBQ $0x02, DX JA MAINLOOP1 PADDL 112(R12), X12 PADDL 176(R12), X7 PADDL 224(R12), X10 PADDL 272(R12), X4 MOVD X12, DX MOVD X7, CX MOVD X10, R8 MOVD X4, R9 PSHUFL $0x39, X12, X12 PSHUFL $0x39, X7, X7 PSHUFL $0x39, X10, X10 PSHUFL $0x39, X4, X4 XORL (SI), DX XORL 4(SI), CX XORL 8(SI), R8 XORL 12(SI), R9 MOVL DX, (DI) MOVL CX, 4(DI) MOVL R8, 8(DI) MOVL R9, 12(DI) MOVD X12, DX MOVD X7, CX MOVD X10, R8 MOVD X4, R9 PSHUFL $0x39, X12, X12 PSHUFL $0x39, X7, X7 PSHUFL $0x39, X10, X10 PSHUFL $0x39, X4, X4 XORL 64(SI), DX XORL 68(SI), CX XORL 72(SI), R8 XORL 76(SI), R9 MOVL DX, 64(DI) MOVL CX, 68(DI) MOVL R8, 72(DI) MOVL R9, 76(DI) MOVD X12, DX MOVD X7, CX MOVD X10, R8 MOVD X4, R9 PSHUFL $0x39, X12, X12 PSHUFL $0x39, X7, X7 PSHUFL $0x39, X10, X10 PSHUFL $0x39, X4, X4 XORL 128(SI), DX XORL 132(SI), CX XORL 136(SI), R8 XORL 140(SI), R9 MOVL DX, 128(DI) MOVL CX, 132(DI) MOVL R8, 136(DI) MOVL R9, 140(DI) MOVD X12, DX MOVD X7, CX MOVD X10, R8 MOVD X4, R9 XORL 192(SI), DX XORL 196(SI), CX XORL 200(SI), R8 XORL 204(SI), R9 MOVL DX, 192(DI) MOVL CX, 196(DI) MOVL R8, 200(DI) MOVL R9, 204(DI) PADDL 240(R12), X14 PADDL 64(R12), X0 PADDL 128(R12), X5 PADDL 192(R12), X8 MOVD X14, DX MOVD X0, CX MOVD X5, R8 MOVD X8, R9 PSHUFL $0x39, X14, X14 PSHUFL $0x39, X0, X0 PSHUFL $0x39, X5, X5 PSHUFL $0x39, X8, X8 XORL 16(SI), DX XORL 20(SI), CX XORL 24(SI), R8 XORL 28(SI), R9 MOVL DX, 16(DI) MOVL CX, 20(DI) MOVL R8, 24(DI) MOVL R9, 28(DI) MOVD X14, DX MOVD X0, CX MOVD X5, R8 MOVD X8, R9 PSHUFL $0x39, X14, X14 PSHUFL $0x39, X0, X0 PSHUFL $0x39, X5, X5 PSHUFL $0x39, X8, X8 XORL 80(SI), DX XORL 84(SI), CX XORL 88(SI), R8 XORL 92(SI), R9 MOVL DX, 80(DI) MOVL CX, 84(DI) MOVL R8, 88(DI) MOVL R9, 92(DI) MOVD X14, DX MOVD X0, CX MOVD X5, R8 MOVD X8, R9 PSHUFL $0x39, X14, X14 PSHUFL $0x39, X0, X0 PSHUFL $0x39, X5, X5 PSHUFL $0x39, X8, X8 XORL 144(SI), DX XORL 148(SI), CX XORL 152(SI), R8 XORL 156(SI), R9 MOVL DX, 144(DI) MOVL CX, 148(DI) MOVL R8, 152(DI) MOVL R9, 156(DI) MOVD X14, DX MOVD X0, CX MOVD X5, R8 MOVD X8, R9 XORL 208(SI), DX XORL 212(SI), CX XORL 216(SI), R8 XORL 220(SI), R9 MOVL DX, 208(DI) MOVL CX, 212(DI) MOVL R8, 216(DI) MOVL R9, 220(DI) PADDL 288(R12), X15 PADDL 304(R12), X11 PADDL 80(R12), X1 PADDL 144(R12), X6 MOVD X15, DX MOVD X11, CX MOVD X1, R8 MOVD X6, R9 PSHUFL $0x39, X15, X15 PSHUFL $0x39, X11, X11 PSHUFL $0x39, X1, X1 PSHUFL $0x39, X6, X6 XORL 32(SI), DX XORL 36(SI), CX XORL 40(SI), R8 XORL 44(SI), R9 MOVL DX, 32(DI) MOVL CX, 36(DI) MOVL R8, 40(DI) MOVL R9, 44(DI) MOVD X15, DX MOVD X11, CX MOVD X1, R8 MOVD X6, R9 PSHUFL $0x39, X15, X15 PSHUFL $0x39, X11, X11 PSHUFL $0x39, X1, X1 PSHUFL $0x39, X6, X6 XORL 96(SI), DX XORL 100(SI), CX XORL 104(SI), R8 XORL 108(SI), R9 MOVL DX, 96(DI) MOVL CX, 100(DI) MOVL R8, 104(DI) MOVL R9, 108(DI) MOVD X15, DX MOVD X11, CX MOVD X1, R8 MOVD X6, R9 PSHUFL $0x39, X15, X15 PSHUFL $0x39, X11, X11 PSHUFL $0x39, X1, X1 PSHUFL $0x39, X6, X6 XORL 160(SI), DX XORL 164(SI), CX XORL 168(SI), R8 XORL 172(SI), R9 MOVL DX, 160(DI) MOVL CX, 164(DI) MOVL R8, 168(DI) MOVL R9, 172(DI) MOVD X15, DX MOVD X11, CX MOVD X1, R8 MOVD X6, R9 XORL 224(SI), DX XORL 228(SI), CX XORL 232(SI), R8 XORL 236(SI), R9 MOVL DX, 224(DI) MOVL CX, 228(DI) MOVL R8, 232(DI) MOVL R9, 236(DI) PADDL 160(R12), X13 PADDL 208(R12), X9 PADDL 256(R12), X3 PADDL 96(R12), X2 MOVD X13, DX MOVD X9, CX MOVD X3, R8 MOVD X2, R9 PSHUFL $0x39, X13, X13 PSHUFL $0x39, X9, X9 PSHUFL $0x39, X3, X3 PSHUFL $0x39, X2, X2 XORL 48(SI), DX XORL 52(SI), CX XORL 56(SI), R8 XORL 60(SI), R9 MOVL DX, 48(DI) MOVL CX, 52(DI) MOVL R8, 56(DI) MOVL R9, 60(DI) MOVD X13, DX MOVD X9, CX MOVD X3, R8 MOVD X2, R9 PSHUFL $0x39, X13, X13 PSHUFL $0x39, X9, X9 PSHUFL $0x39, X3, X3 PSHUFL $0x39, X2, X2 XORL 112(SI), DX XORL 116(SI), CX XORL 120(SI), R8 XORL 124(SI), R9 MOVL DX, 112(DI) MOVL CX, 116(DI) MOVL R8, 120(DI) MOVL R9, 124(DI) MOVD X13, DX MOVD X9, CX MOVD X3, R8 MOVD X2, R9 PSHUFL $0x39, X13, X13 PSHUFL $0x39, X9, X9 PSHUFL $0x39, X3, X3 PSHUFL $0x39, X2, X2 XORL 176(SI), DX XORL 180(SI), CX XORL 184(SI), R8 XORL 188(SI), R9 MOVL DX, 176(DI) MOVL CX, 180(DI) MOVL R8, 184(DI) MOVL R9, 188(DI) MOVD X13, DX MOVD X9, CX MOVD X3, R8 MOVD X2, R9 XORL 240(SI), DX XORL 244(SI), CX XORL 248(SI), R8 XORL 252(SI), R9 MOVL DX, 240(DI) MOVL CX, 244(DI) MOVL R8, 248(DI) MOVL R9, 252(DI) MOVQ 352(R12), R9 SUBQ $0x00000100, R9 ADDQ $0x00000100, SI ADDQ $0x00000100, DI CMPQ R9, $0x00000100 JAE BYTESATLEAST256 CMPQ R9, $0x00 JBE DONE BYTESBETWEEN1AND255: CMPQ R9, $0x40 JAE NOCOPY MOVQ DI, DX LEAQ 360(R12), DI MOVQ R9, CX REP; MOVSB LEAQ 360(R12), DI LEAQ 360(R12), SI NOCOPY: MOVQ R9, 352(R12) MOVOA 48(R12), X0 MOVOA (R12), X1 MOVOA 16(R12), X2 MOVOA 32(R12), X3 MOVOA X1, X4 MOVQ $0x00000014, CX MAINLOOP2: PADDL X0, X4 MOVOA X0, X5 MOVOA X4, X6 PSLLL $0x07, X4 PSRLL $0x19, X6 PXOR X4, X3 PXOR X6, X3 PADDL X3, X5 MOVOA X3, X4 MOVOA X5, X6 PSLLL $0x09, X5 PSRLL $0x17, X6 PXOR X5, X2 PSHUFL $0x93, X3, X3 PXOR X6, X2 PADDL X2, X4 MOVOA X2, X5 MOVOA X4, X6 PSLLL $0x0d, X4 PSRLL $0x13, X6 PXOR X4, X1 PSHUFL $0x4e, X2, X2 PXOR X6, X1 PADDL X1, X5 MOVOA X3, X4 MOVOA X5, X6 PSLLL $0x12, X5 PSRLL $0x0e, X6 PXOR X5, X0 PSHUFL $0x39, X1, X1 PXOR X6, X0 PADDL X0, X4 MOVOA X0, X5 MOVOA X4, X6 PSLLL $0x07, X4 PSRLL $0x19, X6 PXOR X4, X1 PXOR X6, X1 PADDL X1, X5 MOVOA X1, X4 MOVOA X5, X6 PSLLL $0x09, X5 PSRLL $0x17, X6 PXOR X5, X2 PSHUFL $0x93, X1, X1 PXOR X6, X2 PADDL X2, X4 MOVOA X2, X5 MOVOA X4, X6 PSLLL $0x0d, X4 PSRLL $0x13, X6 PXOR X4, X3 PSHUFL $0x4e, X2, X2 PXOR X6, X3 PADDL X3, X5 MOVOA X1, X4 MOVOA X5, X6 PSLLL $0x12, X5 PSRLL $0x0e, X6 PXOR X5, X0 PSHUFL $0x39, X3, X3 PXOR X6, X0 PADDL X0, X4 MOVOA X0, X5 MOVOA X4, X6 PSLLL $0x07, X4 PSRLL $0x19, X6 PXOR X4, X3 PXOR X6, X3 PADDL X3, X5 MOVOA X3, X4 MOVOA X5, X6 PSLLL $0x09, X5 PSRLL $0x17, X6 PXOR X5, X2 PSHUFL $0x93, X3, X3 PXOR X6, X2 PADDL X2, X4 MOVOA X2, X5 MOVOA X4, X6 PSLLL $0x0d, X4 PSRLL $0x13, X6 PXOR X4, X1 PSHUFL $0x4e, X2, X2 PXOR X6, X1 PADDL X1, X5 MOVOA X3, X4 MOVOA X5, X6 PSLLL $0x12, X5 PSRLL $0x0e, X6 PXOR X5, X0 PSHUFL $0x39, X1, X1 PXOR X6, X0 PADDL X0, X4 MOVOA X0, X5 MOVOA X4, X6 PSLLL $0x07, X4 PSRLL $0x19, X6 PXOR X4, X1 PXOR X6, X1 PADDL X1, X5 MOVOA X1, X4 MOVOA X5, X6 PSLLL $0x09, X5 PSRLL $0x17, X6 PXOR X5, X2 PSHUFL $0x93, X1, X1 PXOR X6, X2 PADDL X2, X4 MOVOA X2, X5 MOVOA X4, X6 PSLLL $0x0d, X4 PSRLL $0x13, X6 PXOR X4, X3 PSHUFL $0x4e, X2, X2 PXOR X6, X3 SUBQ $0x04, CX PADDL X3, X5 MOVOA X1, X4 MOVOA X5, X6 PSLLL $0x12, X5 PXOR X7, X7 PSRLL $0x0e, X6 PXOR X5, X0 PSHUFL $0x39, X3, X3 PXOR X6, X0 JA MAINLOOP2 PADDL 48(R12), X0 PADDL (R12), X1 PADDL 16(R12), X2 PADDL 32(R12), X3 MOVD X0, CX MOVD X1, R8 MOVD X2, R9 MOVD X3, AX PSHUFL $0x39, X0, X0 PSHUFL $0x39, X1, X1 PSHUFL $0x39, X2, X2 PSHUFL $0x39, X3, X3 XORL (SI), CX XORL 48(SI), R8 XORL 32(SI), R9 XORL 16(SI), AX MOVL CX, (DI) MOVL R8, 48(DI) MOVL R9, 32(DI) MOVL AX, 16(DI) MOVD X0, CX MOVD X1, R8 MOVD X2, R9 MOVD X3, AX PSHUFL $0x39, X0, X0 PSHUFL $0x39, X1, X1 PSHUFL $0x39, X2, X2 PSHUFL $0x39, X3, X3 XORL 20(SI), CX XORL 4(SI), R8 XORL 52(SI), R9 XORL 36(SI), AX MOVL CX, 20(DI) MOVL R8, 4(DI) MOVL R9, 52(DI) MOVL AX, 36(DI) MOVD X0, CX MOVD X1, R8 MOVD X2, R9 MOVD X3, AX PSHUFL $0x39, X0, X0 PSHUFL $0x39, X1, X1 PSHUFL $0x39, X2, X2 PSHUFL $0x39, X3, X3 XORL 40(SI), CX XORL 24(SI), R8 XORL 8(SI), R9 XORL 56(SI), AX MOVL CX, 40(DI) MOVL R8, 24(DI) MOVL R9, 8(DI) MOVL AX, 56(DI) MOVD X0, CX MOVD X1, R8 MOVD X2, R9 MOVD X3, AX XORL 60(SI), CX XORL 44(SI), R8 XORL 28(SI), R9 XORL 12(SI), AX MOVL CX, 60(DI) MOVL R8, 44(DI) MOVL R9, 28(DI) MOVL AX, 12(DI) MOVQ 352(R12), R9 MOVL 16(R12), CX MOVL 36(R12), R8 ADDQ $0x01, CX SHLQ $0x20, R8 ADDQ R8, CX MOVQ CX, R8 SHRQ $0x20, R8 MOVL CX, 16(R12) MOVL R8, 36(R12) CMPQ R9, $0x40 JA BYTESATLEAST65 JAE BYTESATLEAST64 MOVQ DI, SI MOVQ DX, DI MOVQ R9, CX REP; MOVSB BYTESATLEAST64: DONE: RET BYTESATLEAST65: SUBQ $0x40, R9 ADDQ $0x40, DI ADDQ $0x40, SI JMP BYTESBETWEEN1AND255 ================================================ FILE: vendor/golang.org/x/crypto/salsa20/salsa/salsa20_noasm.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build !amd64 || purego || !gc package salsa // XORKeyStream crypts bytes from in to out using the given key and counters. // In and out must overlap entirely or not at all. Counter // contains the raw salsa20 counter bytes (both nonce and block counter). func XORKeyStream(out, in []byte, counter *[16]byte, key *[32]byte) { genericXORKeyStream(out, in, counter, key) } ================================================ FILE: vendor/golang.org/x/crypto/salsa20/salsa/salsa20_ref.go ================================================ // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package salsa import "math/bits" const rounds = 20 // core applies the Salsa20 core function to 16-byte input in, 32-byte key k, // and 16-byte constant c, and puts the result into 64-byte array out. func core(out *[64]byte, in *[16]byte, k *[32]byte, c *[16]byte) { j0 := uint32(c[0]) | uint32(c[1])<<8 | uint32(c[2])<<16 | uint32(c[3])<<24 j1 := uint32(k[0]) | uint32(k[1])<<8 | uint32(k[2])<<16 | uint32(k[3])<<24 j2 := uint32(k[4]) | uint32(k[5])<<8 | uint32(k[6])<<16 | uint32(k[7])<<24 j3 := uint32(k[8]) | uint32(k[9])<<8 | uint32(k[10])<<16 | uint32(k[11])<<24 j4 := uint32(k[12]) | uint32(k[13])<<8 | uint32(k[14])<<16 | uint32(k[15])<<24 j5 := uint32(c[4]) | uint32(c[5])<<8 | uint32(c[6])<<16 | uint32(c[7])<<24 j6 := uint32(in[0]) | uint32(in[1])<<8 | uint32(in[2])<<16 | uint32(in[3])<<24 j7 := uint32(in[4]) | uint32(in[5])<<8 | uint32(in[6])<<16 | uint32(in[7])<<24 j8 := uint32(in[8]) | uint32(in[9])<<8 | uint32(in[10])<<16 | uint32(in[11])<<24 j9 := uint32(in[12]) | uint32(in[13])<<8 | uint32(in[14])<<16 | uint32(in[15])<<24 j10 := uint32(c[8]) | uint32(c[9])<<8 | uint32(c[10])<<16 | uint32(c[11])<<24 j11 := uint32(k[16]) | uint32(k[17])<<8 | uint32(k[18])<<16 | uint32(k[19])<<24 j12 := uint32(k[20]) | uint32(k[21])<<8 | uint32(k[22])<<16 | uint32(k[23])<<24 j13 := uint32(k[24]) | uint32(k[25])<<8 | uint32(k[26])<<16 | uint32(k[27])<<24 j14 := uint32(k[28]) | uint32(k[29])<<8 | uint32(k[30])<<16 | uint32(k[31])<<24 j15 := uint32(c[12]) | uint32(c[13])<<8 | uint32(c[14])<<16 | uint32(c[15])<<24 x0, x1, x2, x3, x4, x5, x6, x7, x8 := j0, j1, j2, j3, j4, j5, j6, j7, j8 x9, x10, x11, x12, x13, x14, x15 := j9, j10, j11, j12, j13, j14, j15 for i := 0; i < rounds; i += 2 { u := x0 + x12 x4 ^= bits.RotateLeft32(u, 7) u = x4 + x0 x8 ^= bits.RotateLeft32(u, 9) u = x8 + x4 x12 ^= bits.RotateLeft32(u, 13) u = x12 + x8 x0 ^= bits.RotateLeft32(u, 18) u = x5 + x1 x9 ^= bits.RotateLeft32(u, 7) u = x9 + x5 x13 ^= bits.RotateLeft32(u, 9) u = x13 + x9 x1 ^= bits.RotateLeft32(u, 13) u = x1 + x13 x5 ^= bits.RotateLeft32(u, 18) u = x10 + x6 x14 ^= bits.RotateLeft32(u, 7) u = x14 + x10 x2 ^= bits.RotateLeft32(u, 9) u = x2 + x14 x6 ^= bits.RotateLeft32(u, 13) u = x6 + x2 x10 ^= bits.RotateLeft32(u, 18) u = x15 + x11 x3 ^= bits.RotateLeft32(u, 7) u = x3 + x15 x7 ^= bits.RotateLeft32(u, 9) u = x7 + x3 x11 ^= bits.RotateLeft32(u, 13) u = x11 + x7 x15 ^= bits.RotateLeft32(u, 18) u = x0 + x3 x1 ^= bits.RotateLeft32(u, 7) u = x1 + x0 x2 ^= bits.RotateLeft32(u, 9) u = x2 + x1 x3 ^= bits.RotateLeft32(u, 13) u = x3 + x2 x0 ^= bits.RotateLeft32(u, 18) u = x5 + x4 x6 ^= bits.RotateLeft32(u, 7) u = x6 + x5 x7 ^= bits.RotateLeft32(u, 9) u = x7 + x6 x4 ^= bits.RotateLeft32(u, 13) u = x4 + x7 x5 ^= bits.RotateLeft32(u, 18) u = x10 + x9 x11 ^= bits.RotateLeft32(u, 7) u = x11 + x10 x8 ^= bits.RotateLeft32(u, 9) u = x8 + x11 x9 ^= bits.RotateLeft32(u, 13) u = x9 + x8 x10 ^= bits.RotateLeft32(u, 18) u = x15 + x14 x12 ^= bits.RotateLeft32(u, 7) u = x12 + x15 x13 ^= bits.RotateLeft32(u, 9) u = x13 + x12 x14 ^= bits.RotateLeft32(u, 13) u = x14 + x13 x15 ^= bits.RotateLeft32(u, 18) } x0 += j0 x1 += j1 x2 += j2 x3 += j3 x4 += j4 x5 += j5 x6 += j6 x7 += j7 x8 += j8 x9 += j9 x10 += j10 x11 += j11 x12 += j12 x13 += j13 x14 += j14 x15 += j15 out[0] = byte(x0) out[1] = byte(x0 >> 8) out[2] = byte(x0 >> 16) out[3] = byte(x0 >> 24) out[4] = byte(x1) out[5] = byte(x1 >> 8) out[6] = byte(x1 >> 16) out[7] = byte(x1 >> 24) out[8] = byte(x2) out[9] = byte(x2 >> 8) out[10] = byte(x2 >> 16) out[11] = byte(x2 >> 24) out[12] = byte(x3) out[13] = byte(x3 >> 8) out[14] = byte(x3 >> 16) out[15] = byte(x3 >> 24) out[16] = byte(x4) out[17] = byte(x4 >> 8) out[18] = byte(x4 >> 16) out[19] = byte(x4 >> 24) out[20] = byte(x5) out[21] = byte(x5 >> 8) out[22] = byte(x5 >> 16) out[23] = byte(x5 >> 24) out[24] = byte(x6) out[25] = byte(x6 >> 8) out[26] = byte(x6 >> 16) out[27] = byte(x6 >> 24) out[28] = byte(x7) out[29] = byte(x7 >> 8) out[30] = byte(x7 >> 16) out[31] = byte(x7 >> 24) out[32] = byte(x8) out[33] = byte(x8 >> 8) out[34] = byte(x8 >> 16) out[35] = byte(x8 >> 24) out[36] = byte(x9) out[37] = byte(x9 >> 8) out[38] = byte(x9 >> 16) out[39] = byte(x9 >> 24) out[40] = byte(x10) out[41] = byte(x10 >> 8) out[42] = byte(x10 >> 16) out[43] = byte(x10 >> 24) out[44] = byte(x11) out[45] = byte(x11 >> 8) out[46] = byte(x11 >> 16) out[47] = byte(x11 >> 24) out[48] = byte(x12) out[49] = byte(x12 >> 8) out[50] = byte(x12 >> 16) out[51] = byte(x12 >> 24) out[52] = byte(x13) out[53] = byte(x13 >> 8) out[54] = byte(x13 >> 16) out[55] = byte(x13 >> 24) out[56] = byte(x14) out[57] = byte(x14 >> 8) out[58] = byte(x14 >> 16) out[59] = byte(x14 >> 24) out[60] = byte(x15) out[61] = byte(x15 >> 8) out[62] = byte(x15 >> 16) out[63] = byte(x15 >> 24) } // genericXORKeyStream is the generic implementation of XORKeyStream to be used // when no assembly implementation is available. func genericXORKeyStream(out, in []byte, counter *[16]byte, key *[32]byte) { var block [64]byte var counterCopy [16]byte copy(counterCopy[:], counter[:]) for len(in) >= 64 { core(&block, &counterCopy, key, &Sigma) for i, x := range block { out[i] = in[i] ^ x } u := uint32(1) for i := 8; i < 16; i++ { u += uint32(counterCopy[i]) counterCopy[i] = byte(u) u >>= 8 } in = in[64:] out = out[64:] } if len(in) > 0 { core(&block, &counterCopy, key, &Sigma) for i, v := range in { out[i] = v ^ block[i] } } } ================================================ FILE: vendor/golang.org/x/crypto/scrypt/scrypt.go ================================================ // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package scrypt implements the scrypt key derivation function as defined in // Colin Percival's paper "Stronger Key Derivation via Sequential Memory-Hard // Functions" (https://www.tarsnap.com/scrypt/scrypt.pdf). package scrypt import ( "crypto/sha256" "encoding/binary" "errors" "math/bits" "golang.org/x/crypto/pbkdf2" ) const maxInt = int(^uint(0) >> 1) // blockCopy copies n numbers from src into dst. func blockCopy(dst, src []uint32, n int) { copy(dst, src[:n]) } // blockXOR XORs numbers from dst with n numbers from src. func blockXOR(dst, src []uint32, n int) { for i, v := range src[:n] { dst[i] ^= v } } // salsaXOR applies Salsa20/8 to the XOR of 16 numbers from tmp and in, // and puts the result into both tmp and out. func salsaXOR(tmp *[16]uint32, in, out []uint32) { w0 := tmp[0] ^ in[0] w1 := tmp[1] ^ in[1] w2 := tmp[2] ^ in[2] w3 := tmp[3] ^ in[3] w4 := tmp[4] ^ in[4] w5 := tmp[5] ^ in[5] w6 := tmp[6] ^ in[6] w7 := tmp[7] ^ in[7] w8 := tmp[8] ^ in[8] w9 := tmp[9] ^ in[9] w10 := tmp[10] ^ in[10] w11 := tmp[11] ^ in[11] w12 := tmp[12] ^ in[12] w13 := tmp[13] ^ in[13] w14 := tmp[14] ^ in[14] w15 := tmp[15] ^ in[15] x0, x1, x2, x3, x4, x5, x6, x7, x8 := w0, w1, w2, w3, w4, w5, w6, w7, w8 x9, x10, x11, x12, x13, x14, x15 := w9, w10, w11, w12, w13, w14, w15 for i := 0; i < 8; i += 2 { x4 ^= bits.RotateLeft32(x0+x12, 7) x8 ^= bits.RotateLeft32(x4+x0, 9) x12 ^= bits.RotateLeft32(x8+x4, 13) x0 ^= bits.RotateLeft32(x12+x8, 18) x9 ^= bits.RotateLeft32(x5+x1, 7) x13 ^= bits.RotateLeft32(x9+x5, 9) x1 ^= bits.RotateLeft32(x13+x9, 13) x5 ^= bits.RotateLeft32(x1+x13, 18) x14 ^= bits.RotateLeft32(x10+x6, 7) x2 ^= bits.RotateLeft32(x14+x10, 9) x6 ^= bits.RotateLeft32(x2+x14, 13) x10 ^= bits.RotateLeft32(x6+x2, 18) x3 ^= bits.RotateLeft32(x15+x11, 7) x7 ^= bits.RotateLeft32(x3+x15, 9) x11 ^= bits.RotateLeft32(x7+x3, 13) x15 ^= bits.RotateLeft32(x11+x7, 18) x1 ^= bits.RotateLeft32(x0+x3, 7) x2 ^= bits.RotateLeft32(x1+x0, 9) x3 ^= bits.RotateLeft32(x2+x1, 13) x0 ^= bits.RotateLeft32(x3+x2, 18) x6 ^= bits.RotateLeft32(x5+x4, 7) x7 ^= bits.RotateLeft32(x6+x5, 9) x4 ^= bits.RotateLeft32(x7+x6, 13) x5 ^= bits.RotateLeft32(x4+x7, 18) x11 ^= bits.RotateLeft32(x10+x9, 7) x8 ^= bits.RotateLeft32(x11+x10, 9) x9 ^= bits.RotateLeft32(x8+x11, 13) x10 ^= bits.RotateLeft32(x9+x8, 18) x12 ^= bits.RotateLeft32(x15+x14, 7) x13 ^= bits.RotateLeft32(x12+x15, 9) x14 ^= bits.RotateLeft32(x13+x12, 13) x15 ^= bits.RotateLeft32(x14+x13, 18) } x0 += w0 x1 += w1 x2 += w2 x3 += w3 x4 += w4 x5 += w5 x6 += w6 x7 += w7 x8 += w8 x9 += w9 x10 += w10 x11 += w11 x12 += w12 x13 += w13 x14 += w14 x15 += w15 out[0], tmp[0] = x0, x0 out[1], tmp[1] = x1, x1 out[2], tmp[2] = x2, x2 out[3], tmp[3] = x3, x3 out[4], tmp[4] = x4, x4 out[5], tmp[5] = x5, x5 out[6], tmp[6] = x6, x6 out[7], tmp[7] = x7, x7 out[8], tmp[8] = x8, x8 out[9], tmp[9] = x9, x9 out[10], tmp[10] = x10, x10 out[11], tmp[11] = x11, x11 out[12], tmp[12] = x12, x12 out[13], tmp[13] = x13, x13 out[14], tmp[14] = x14, x14 out[15], tmp[15] = x15, x15 } func blockMix(tmp *[16]uint32, in, out []uint32, r int) { blockCopy(tmp[:], in[(2*r-1)*16:], 16) for i := 0; i < 2*r; i += 2 { salsaXOR(tmp, in[i*16:], out[i*8:]) salsaXOR(tmp, in[i*16+16:], out[i*8+r*16:]) } } func integer(b []uint32, r int) uint64 { j := (2*r - 1) * 16 return uint64(b[j]) | uint64(b[j+1])<<32 } func smix(b []byte, r, N int, v, xy []uint32) { var tmp [16]uint32 R := 32 * r x := xy y := xy[R:] j := 0 for i := 0; i < R; i++ { x[i] = binary.LittleEndian.Uint32(b[j:]) j += 4 } for i := 0; i < N; i += 2 { blockCopy(v[i*R:], x, R) blockMix(&tmp, x, y, r) blockCopy(v[(i+1)*R:], y, R) blockMix(&tmp, y, x, r) } for i := 0; i < N; i += 2 { j := int(integer(x, r) & uint64(N-1)) blockXOR(x, v[j*R:], R) blockMix(&tmp, x, y, r) j = int(integer(y, r) & uint64(N-1)) blockXOR(y, v[j*R:], R) blockMix(&tmp, y, x, r) } j = 0 for _, v := range x[:R] { binary.LittleEndian.PutUint32(b[j:], v) j += 4 } } // Key derives a key from the password, salt, and cost parameters, returning // a byte slice of length keyLen that can be used as cryptographic key. // // N is a CPU/memory cost parameter, which must be a power of two greater than 1. // r and p must satisfy r * p < 2³⁰. If the parameters do not satisfy the // limits, the function returns a nil byte slice and an error. // // For example, you can get a derived key for e.g. AES-256 (which needs a // 32-byte key) by doing: // // dk, err := scrypt.Key([]byte("some password"), salt, 32768, 8, 1, 32) // // The recommended parameters for interactive logins as of 2017 are N=32768, r=8 // and p=1. The parameters N, r, and p should be increased as memory latency and // CPU parallelism increases; consider setting N to the highest power of 2 you // can derive within 100 milliseconds. Remember to get a good random salt. func Key(password, salt []byte, N, r, p, keyLen int) ([]byte, error) { if N <= 1 || N&(N-1) != 0 { return nil, errors.New("scrypt: N must be > 1 and a power of 2") } if r <= 0 || p <= 0 { return nil, errors.New("scrypt: parameters must be > 0") } if uint64(r)*uint64(p) >= 1<<30 || r > maxInt/128/p || r > maxInt/256 || N > maxInt/128/r { return nil, errors.New("scrypt: parameters are too large") } xy := make([]uint32, 64*r) v := make([]uint32, 32*N*r) b := pbkdf2.Key(password, salt, 1, p*128*r, sha256.New) for i := 0; i < p; i++ { smix(b[i*128*r:], r, N, v, xy) } return pbkdf2.Key(password, b, 1, keyLen, sha256.New), nil } ================================================ FILE: vendor/golang.org/x/net/LICENSE ================================================ Copyright 2009 The Go Authors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: vendor/golang.org/x/net/PATENTS ================================================ Additional IP Rights Grant (Patents) "This implementation" means the copyrightable works distributed by Google as part of the Go project. Google hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, transfer and otherwise run, modify and propagate the contents of this implementation of Go, where such license applies only to those patent claims, both currently owned or controlled by Google and acquired in the future, licensable by Google that are necessarily infringed by this implementation of Go. This grant does not include claims that would be infringed only as a consequence of further modification of this implementation. If you or your agent or exclusive licensee institute or order or agree to the institution of patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that this implementation of Go or any code incorporated within this implementation of Go constitutes direct or contributory patent infringement, or inducement of patent infringement, then any patent rights granted to you under this License for this implementation of Go shall terminate as of the date such litigation is filed. ================================================ FILE: vendor/golang.org/x/net/http/httpguts/guts.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package httpguts provides functions implementing various details // of the HTTP specification. // // This package is shared by the standard library (which vendors it) // and x/net/http2. It comes with no API stability promise. package httpguts import ( "net/textproto" "strings" ) // ValidTrailerHeader reports whether name is a valid header field name to appear // in trailers. // See RFC 7230, Section 4.1.2 func ValidTrailerHeader(name string) bool { name = textproto.CanonicalMIMEHeaderKey(name) if strings.HasPrefix(name, "If-") || badTrailer[name] { return false } return true } var badTrailer = map[string]bool{ "Authorization": true, "Cache-Control": true, "Connection": true, "Content-Encoding": true, "Content-Length": true, "Content-Range": true, "Content-Type": true, "Expect": true, "Host": true, "Keep-Alive": true, "Max-Forwards": true, "Pragma": true, "Proxy-Authenticate": true, "Proxy-Authorization": true, "Proxy-Connection": true, "Range": true, "Realm": true, "Te": true, "Trailer": true, "Transfer-Encoding": true, "Www-Authenticate": true, } ================================================ FILE: vendor/golang.org/x/net/http/httpguts/httplex.go ================================================ // Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package httpguts import ( "net" "strings" "unicode/utf8" "golang.org/x/net/idna" ) var isTokenTable = [256]bool{ '!': true, '#': true, '$': true, '%': true, '&': true, '\'': true, '*': true, '+': true, '-': true, '.': true, '0': true, '1': true, '2': true, '3': true, '4': true, '5': true, '6': true, '7': true, '8': true, '9': true, 'A': true, 'B': true, 'C': true, 'D': true, 'E': true, 'F': true, 'G': true, 'H': true, 'I': true, 'J': true, 'K': true, 'L': true, 'M': true, 'N': true, 'O': true, 'P': true, 'Q': true, 'R': true, 'S': true, 'T': true, 'U': true, 'W': true, 'V': true, 'X': true, 'Y': true, 'Z': true, '^': true, '_': true, '`': true, 'a': true, 'b': true, 'c': true, 'd': true, 'e': true, 'f': true, 'g': true, 'h': true, 'i': true, 'j': true, 'k': true, 'l': true, 'm': true, 'n': true, 'o': true, 'p': true, 'q': true, 'r': true, 's': true, 't': true, 'u': true, 'v': true, 'w': true, 'x': true, 'y': true, 'z': true, '|': true, '~': true, } func IsTokenRune(r rune) bool { return r < utf8.RuneSelf && isTokenTable[byte(r)] } // HeaderValuesContainsToken reports whether any string in values // contains the provided token, ASCII case-insensitively. func HeaderValuesContainsToken(values []string, token string) bool { for _, v := range values { if headerValueContainsToken(v, token) { return true } } return false } // isOWS reports whether b is an optional whitespace byte, as defined // by RFC 7230 section 3.2.3. func isOWS(b byte) bool { return b == ' ' || b == '\t' } // trimOWS returns x with all optional whitespace removes from the // beginning and end. func trimOWS(x string) string { // TODO: consider using strings.Trim(x, " \t") instead, // if and when it's fast enough. See issue 10292. // But this ASCII-only code will probably always beat UTF-8 // aware code. for len(x) > 0 && isOWS(x[0]) { x = x[1:] } for len(x) > 0 && isOWS(x[len(x)-1]) { x = x[:len(x)-1] } return x } // headerValueContainsToken reports whether v (assumed to be a // 0#element, in the ABNF extension described in RFC 7230 section 7) // contains token amongst its comma-separated tokens, ASCII // case-insensitively. func headerValueContainsToken(v string, token string) bool { for comma := strings.IndexByte(v, ','); comma != -1; comma = strings.IndexByte(v, ',') { if tokenEqual(trimOWS(v[:comma]), token) { return true } v = v[comma+1:] } return tokenEqual(trimOWS(v), token) } // lowerASCII returns the ASCII lowercase version of b. func lowerASCII(b byte) byte { if 'A' <= b && b <= 'Z' { return b + ('a' - 'A') } return b } // tokenEqual reports whether t1 and t2 are equal, ASCII case-insensitively. func tokenEqual(t1, t2 string) bool { if len(t1) != len(t2) { return false } for i, b := range t1 { if b >= utf8.RuneSelf { // No UTF-8 or non-ASCII allowed in tokens. return false } if lowerASCII(byte(b)) != lowerASCII(t2[i]) { return false } } return true } // isLWS reports whether b is linear white space, according // to http://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html#sec2.2 // // LWS = [CRLF] 1*( SP | HT ) func isLWS(b byte) bool { return b == ' ' || b == '\t' } // isCTL reports whether b is a control byte, according // to http://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html#sec2.2 // // CTL = func isCTL(b byte) bool { const del = 0x7f // a CTL return b < ' ' || b == del } // ValidHeaderFieldName reports whether v is a valid HTTP/1.x header name. // HTTP/2 imposes the additional restriction that uppercase ASCII // letters are not allowed. // // RFC 7230 says: // // header-field = field-name ":" OWS field-value OWS // field-name = token // token = 1*tchar // tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" / "+" / "-" / "." / // "^" / "_" / "`" / "|" / "~" / DIGIT / ALPHA func ValidHeaderFieldName(v string) bool { if len(v) == 0 { return false } for i := 0; i < len(v); i++ { if !isTokenTable[v[i]] { return false } } return true } // ValidHostHeader reports whether h is a valid host header. func ValidHostHeader(h string) bool { // The latest spec is actually this: // // http://tools.ietf.org/html/rfc7230#section-5.4 // Host = uri-host [ ":" port ] // // Where uri-host is: // http://tools.ietf.org/html/rfc3986#section-3.2.2 // // But we're going to be much more lenient for now and just // search for any byte that's not a valid byte in any of those // expressions. for i := 0; i < len(h); i++ { if !validHostByte[h[i]] { return false } } return true } // See the validHostHeader comment. var validHostByte = [256]bool{ '0': true, '1': true, '2': true, '3': true, '4': true, '5': true, '6': true, '7': true, '8': true, '9': true, 'a': true, 'b': true, 'c': true, 'd': true, 'e': true, 'f': true, 'g': true, 'h': true, 'i': true, 'j': true, 'k': true, 'l': true, 'm': true, 'n': true, 'o': true, 'p': true, 'q': true, 'r': true, 's': true, 't': true, 'u': true, 'v': true, 'w': true, 'x': true, 'y': true, 'z': true, 'A': true, 'B': true, 'C': true, 'D': true, 'E': true, 'F': true, 'G': true, 'H': true, 'I': true, 'J': true, 'K': true, 'L': true, 'M': true, 'N': true, 'O': true, 'P': true, 'Q': true, 'R': true, 'S': true, 'T': true, 'U': true, 'V': true, 'W': true, 'X': true, 'Y': true, 'Z': true, '!': true, // sub-delims '$': true, // sub-delims '%': true, // pct-encoded (and used in IPv6 zones) '&': true, // sub-delims '(': true, // sub-delims ')': true, // sub-delims '*': true, // sub-delims '+': true, // sub-delims ',': true, // sub-delims '-': true, // unreserved '.': true, // unreserved ':': true, // IPv6address + Host expression's optional port ';': true, // sub-delims '=': true, // sub-delims '[': true, '\'': true, // sub-delims ']': true, '_': true, // unreserved '~': true, // unreserved } // ValidHeaderFieldValue reports whether v is a valid "field-value" according to // http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2 : // // message-header = field-name ":" [ field-value ] // field-value = *( field-content | LWS ) // field-content = // // http://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html#sec2.2 : // // TEXT = // LWS = [CRLF] 1*( SP | HT ) // CTL = // // RFC 7230 says: // // field-value = *( field-content / obs-fold ) // obj-fold = N/A to http2, and deprecated // field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ] // field-vchar = VCHAR / obs-text // obs-text = %x80-FF // VCHAR = "any visible [USASCII] character" // // http2 further says: "Similarly, HTTP/2 allows header field values // that are not valid. While most of the values that can be encoded // will not alter header field parsing, carriage return (CR, ASCII // 0xd), line feed (LF, ASCII 0xa), and the zero character (NUL, ASCII // 0x0) might be exploited by an attacker if they are translated // verbatim. Any request or response that contains a character not // permitted in a header field value MUST be treated as malformed // (Section 8.1.2.6). Valid characters are defined by the // field-content ABNF rule in Section 3.2 of [RFC7230]." // // This function does not (yet?) properly handle the rejection of // strings that begin or end with SP or HTAB. func ValidHeaderFieldValue(v string) bool { for i := 0; i < len(v); i++ { b := v[i] if isCTL(b) && !isLWS(b) { return false } } return true } func isASCII(s string) bool { for i := 0; i < len(s); i++ { if s[i] >= utf8.RuneSelf { return false } } return true } // PunycodeHostPort returns the IDNA Punycode version // of the provided "host" or "host:port" string. func PunycodeHostPort(v string) (string, error) { if isASCII(v) { return v, nil } host, port, err := net.SplitHostPort(v) if err != nil { // The input 'v' argument was just a "host" argument, // without a port. This error should not be returned // to the caller. host = v port = "" } host, err = idna.ToASCII(host) if err != nil { // Non-UTF-8? Not representable in Punycode, in any // case. return "", err } if port == "" { return host, nil } return net.JoinHostPort(host, port), nil } ================================================ FILE: vendor/golang.org/x/net/http2/.gitignore ================================================ *~ h2i/h2i ================================================ FILE: vendor/golang.org/x/net/http2/ascii.go ================================================ // Copyright 2021 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package http2 import "strings" // The HTTP protocols are defined in terms of ASCII, not Unicode. This file // contains helper functions which may use Unicode-aware functions which would // otherwise be unsafe and could introduce vulnerabilities if used improperly. // asciiEqualFold is strings.EqualFold, ASCII only. It reports whether s and t // are equal, ASCII-case-insensitively. func asciiEqualFold(s, t string) bool { if len(s) != len(t) { return false } for i := 0; i < len(s); i++ { if lower(s[i]) != lower(t[i]) { return false } } return true } // lower returns the ASCII lowercase version of b. func lower(b byte) byte { if 'A' <= b && b <= 'Z' { return b + ('a' - 'A') } return b } // isASCIIPrint returns whether s is ASCII and printable according to // https://tools.ietf.org/html/rfc20#section-4.2. func isASCIIPrint(s string) bool { for i := 0; i < len(s); i++ { if s[i] < ' ' || s[i] > '~' { return false } } return true } // asciiToLower returns the lowercase version of s if s is ASCII and printable, // and whether or not it was. func asciiToLower(s string) (lower string, ok bool) { if !isASCIIPrint(s) { return "", false } return strings.ToLower(s), true } ================================================ FILE: vendor/golang.org/x/net/http2/ciphers.go ================================================ // Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package http2 // A list of the possible cipher suite ids. Taken from // https://www.iana.org/assignments/tls-parameters/tls-parameters.txt const ( cipher_TLS_NULL_WITH_NULL_NULL uint16 = 0x0000 cipher_TLS_RSA_WITH_NULL_MD5 uint16 = 0x0001 cipher_TLS_RSA_WITH_NULL_SHA uint16 = 0x0002 cipher_TLS_RSA_EXPORT_WITH_RC4_40_MD5 uint16 = 0x0003 cipher_TLS_RSA_WITH_RC4_128_MD5 uint16 = 0x0004 cipher_TLS_RSA_WITH_RC4_128_SHA uint16 = 0x0005 cipher_TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5 uint16 = 0x0006 cipher_TLS_RSA_WITH_IDEA_CBC_SHA uint16 = 0x0007 cipher_TLS_RSA_EXPORT_WITH_DES40_CBC_SHA uint16 = 0x0008 cipher_TLS_RSA_WITH_DES_CBC_SHA uint16 = 0x0009 cipher_TLS_RSA_WITH_3DES_EDE_CBC_SHA uint16 = 0x000A cipher_TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA uint16 = 0x000B cipher_TLS_DH_DSS_WITH_DES_CBC_SHA uint16 = 0x000C cipher_TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA uint16 = 0x000D cipher_TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA uint16 = 0x000E cipher_TLS_DH_RSA_WITH_DES_CBC_SHA uint16 = 0x000F cipher_TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA uint16 = 0x0010 cipher_TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA uint16 = 0x0011 cipher_TLS_DHE_DSS_WITH_DES_CBC_SHA uint16 = 0x0012 cipher_TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA uint16 = 0x0013 cipher_TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA uint16 = 0x0014 cipher_TLS_DHE_RSA_WITH_DES_CBC_SHA uint16 = 0x0015 cipher_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA uint16 = 0x0016 cipher_TLS_DH_anon_EXPORT_WITH_RC4_40_MD5 uint16 = 0x0017 cipher_TLS_DH_anon_WITH_RC4_128_MD5 uint16 = 0x0018 cipher_TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA uint16 = 0x0019 cipher_TLS_DH_anon_WITH_DES_CBC_SHA uint16 = 0x001A cipher_TLS_DH_anon_WITH_3DES_EDE_CBC_SHA uint16 = 0x001B // Reserved uint16 = 0x001C-1D cipher_TLS_KRB5_WITH_DES_CBC_SHA uint16 = 0x001E cipher_TLS_KRB5_WITH_3DES_EDE_CBC_SHA uint16 = 0x001F cipher_TLS_KRB5_WITH_RC4_128_SHA uint16 = 0x0020 cipher_TLS_KRB5_WITH_IDEA_CBC_SHA uint16 = 0x0021 cipher_TLS_KRB5_WITH_DES_CBC_MD5 uint16 = 0x0022 cipher_TLS_KRB5_WITH_3DES_EDE_CBC_MD5 uint16 = 0x0023 cipher_TLS_KRB5_WITH_RC4_128_MD5 uint16 = 0x0024 cipher_TLS_KRB5_WITH_IDEA_CBC_MD5 uint16 = 0x0025 cipher_TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA uint16 = 0x0026 cipher_TLS_KRB5_EXPORT_WITH_RC2_CBC_40_SHA uint16 = 0x0027 cipher_TLS_KRB5_EXPORT_WITH_RC4_40_SHA uint16 = 0x0028 cipher_TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5 uint16 = 0x0029 cipher_TLS_KRB5_EXPORT_WITH_RC2_CBC_40_MD5 uint16 = 0x002A cipher_TLS_KRB5_EXPORT_WITH_RC4_40_MD5 uint16 = 0x002B cipher_TLS_PSK_WITH_NULL_SHA uint16 = 0x002C cipher_TLS_DHE_PSK_WITH_NULL_SHA uint16 = 0x002D cipher_TLS_RSA_PSK_WITH_NULL_SHA uint16 = 0x002E cipher_TLS_RSA_WITH_AES_128_CBC_SHA uint16 = 0x002F cipher_TLS_DH_DSS_WITH_AES_128_CBC_SHA uint16 = 0x0030 cipher_TLS_DH_RSA_WITH_AES_128_CBC_SHA uint16 = 0x0031 cipher_TLS_DHE_DSS_WITH_AES_128_CBC_SHA uint16 = 0x0032 cipher_TLS_DHE_RSA_WITH_AES_128_CBC_SHA uint16 = 0x0033 cipher_TLS_DH_anon_WITH_AES_128_CBC_SHA uint16 = 0x0034 cipher_TLS_RSA_WITH_AES_256_CBC_SHA uint16 = 0x0035 cipher_TLS_DH_DSS_WITH_AES_256_CBC_SHA uint16 = 0x0036 cipher_TLS_DH_RSA_WITH_AES_256_CBC_SHA uint16 = 0x0037 cipher_TLS_DHE_DSS_WITH_AES_256_CBC_SHA uint16 = 0x0038 cipher_TLS_DHE_RSA_WITH_AES_256_CBC_SHA uint16 = 0x0039 cipher_TLS_DH_anon_WITH_AES_256_CBC_SHA uint16 = 0x003A cipher_TLS_RSA_WITH_NULL_SHA256 uint16 = 0x003B cipher_TLS_RSA_WITH_AES_128_CBC_SHA256 uint16 = 0x003C cipher_TLS_RSA_WITH_AES_256_CBC_SHA256 uint16 = 0x003D cipher_TLS_DH_DSS_WITH_AES_128_CBC_SHA256 uint16 = 0x003E cipher_TLS_DH_RSA_WITH_AES_128_CBC_SHA256 uint16 = 0x003F cipher_TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 uint16 = 0x0040 cipher_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA uint16 = 0x0041 cipher_TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA uint16 = 0x0042 cipher_TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA uint16 = 0x0043 cipher_TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA uint16 = 0x0044 cipher_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA uint16 = 0x0045 cipher_TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA uint16 = 0x0046 // Reserved uint16 = 0x0047-4F // Reserved uint16 = 0x0050-58 // Reserved uint16 = 0x0059-5C // Unassigned uint16 = 0x005D-5F // Reserved uint16 = 0x0060-66 cipher_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 uint16 = 0x0067 cipher_TLS_DH_DSS_WITH_AES_256_CBC_SHA256 uint16 = 0x0068 cipher_TLS_DH_RSA_WITH_AES_256_CBC_SHA256 uint16 = 0x0069 cipher_TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 uint16 = 0x006A cipher_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 uint16 = 0x006B cipher_TLS_DH_anon_WITH_AES_128_CBC_SHA256 uint16 = 0x006C cipher_TLS_DH_anon_WITH_AES_256_CBC_SHA256 uint16 = 0x006D // Unassigned uint16 = 0x006E-83 cipher_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA uint16 = 0x0084 cipher_TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA uint16 = 0x0085 cipher_TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA uint16 = 0x0086 cipher_TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA uint16 = 0x0087 cipher_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA uint16 = 0x0088 cipher_TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA uint16 = 0x0089 cipher_TLS_PSK_WITH_RC4_128_SHA uint16 = 0x008A cipher_TLS_PSK_WITH_3DES_EDE_CBC_SHA uint16 = 0x008B cipher_TLS_PSK_WITH_AES_128_CBC_SHA uint16 = 0x008C cipher_TLS_PSK_WITH_AES_256_CBC_SHA uint16 = 0x008D cipher_TLS_DHE_PSK_WITH_RC4_128_SHA uint16 = 0x008E cipher_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA uint16 = 0x008F cipher_TLS_DHE_PSK_WITH_AES_128_CBC_SHA uint16 = 0x0090 cipher_TLS_DHE_PSK_WITH_AES_256_CBC_SHA uint16 = 0x0091 cipher_TLS_RSA_PSK_WITH_RC4_128_SHA uint16 = 0x0092 cipher_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA uint16 = 0x0093 cipher_TLS_RSA_PSK_WITH_AES_128_CBC_SHA uint16 = 0x0094 cipher_TLS_RSA_PSK_WITH_AES_256_CBC_SHA uint16 = 0x0095 cipher_TLS_RSA_WITH_SEED_CBC_SHA uint16 = 0x0096 cipher_TLS_DH_DSS_WITH_SEED_CBC_SHA uint16 = 0x0097 cipher_TLS_DH_RSA_WITH_SEED_CBC_SHA uint16 = 0x0098 cipher_TLS_DHE_DSS_WITH_SEED_CBC_SHA uint16 = 0x0099 cipher_TLS_DHE_RSA_WITH_SEED_CBC_SHA uint16 = 0x009A cipher_TLS_DH_anon_WITH_SEED_CBC_SHA uint16 = 0x009B cipher_TLS_RSA_WITH_AES_128_GCM_SHA256 uint16 = 0x009C cipher_TLS_RSA_WITH_AES_256_GCM_SHA384 uint16 = 0x009D cipher_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 uint16 = 0x009E cipher_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 uint16 = 0x009F cipher_TLS_DH_RSA_WITH_AES_128_GCM_SHA256 uint16 = 0x00A0 cipher_TLS_DH_RSA_WITH_AES_256_GCM_SHA384 uint16 = 0x00A1 cipher_TLS_DHE_DSS_WITH_AES_128_GCM_SHA256 uint16 = 0x00A2 cipher_TLS_DHE_DSS_WITH_AES_256_GCM_SHA384 uint16 = 0x00A3 cipher_TLS_DH_DSS_WITH_AES_128_GCM_SHA256 uint16 = 0x00A4 cipher_TLS_DH_DSS_WITH_AES_256_GCM_SHA384 uint16 = 0x00A5 cipher_TLS_DH_anon_WITH_AES_128_GCM_SHA256 uint16 = 0x00A6 cipher_TLS_DH_anon_WITH_AES_256_GCM_SHA384 uint16 = 0x00A7 cipher_TLS_PSK_WITH_AES_128_GCM_SHA256 uint16 = 0x00A8 cipher_TLS_PSK_WITH_AES_256_GCM_SHA384 uint16 = 0x00A9 cipher_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 uint16 = 0x00AA cipher_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 uint16 = 0x00AB cipher_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 uint16 = 0x00AC cipher_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384 uint16 = 0x00AD cipher_TLS_PSK_WITH_AES_128_CBC_SHA256 uint16 = 0x00AE cipher_TLS_PSK_WITH_AES_256_CBC_SHA384 uint16 = 0x00AF cipher_TLS_PSK_WITH_NULL_SHA256 uint16 = 0x00B0 cipher_TLS_PSK_WITH_NULL_SHA384 uint16 = 0x00B1 cipher_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 uint16 = 0x00B2 cipher_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 uint16 = 0x00B3 cipher_TLS_DHE_PSK_WITH_NULL_SHA256 uint16 = 0x00B4 cipher_TLS_DHE_PSK_WITH_NULL_SHA384 uint16 = 0x00B5 cipher_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 uint16 = 0x00B6 cipher_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 uint16 = 0x00B7 cipher_TLS_RSA_PSK_WITH_NULL_SHA256 uint16 = 0x00B8 cipher_TLS_RSA_PSK_WITH_NULL_SHA384 uint16 = 0x00B9 cipher_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256 uint16 = 0x00BA cipher_TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256 uint16 = 0x00BB cipher_TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA256 uint16 = 0x00BC cipher_TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256 uint16 = 0x00BD cipher_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 uint16 = 0x00BE cipher_TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA256 uint16 = 0x00BF cipher_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256 uint16 = 0x00C0 cipher_TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256 uint16 = 0x00C1 cipher_TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256 uint16 = 0x00C2 cipher_TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256 uint16 = 0x00C3 cipher_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 uint16 = 0x00C4 cipher_TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA256 uint16 = 0x00C5 // Unassigned uint16 = 0x00C6-FE cipher_TLS_EMPTY_RENEGOTIATION_INFO_SCSV uint16 = 0x00FF // Unassigned uint16 = 0x01-55,* cipher_TLS_FALLBACK_SCSV uint16 = 0x5600 // Unassigned uint16 = 0x5601 - 0xC000 cipher_TLS_ECDH_ECDSA_WITH_NULL_SHA uint16 = 0xC001 cipher_TLS_ECDH_ECDSA_WITH_RC4_128_SHA uint16 = 0xC002 cipher_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA uint16 = 0xC003 cipher_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA uint16 = 0xC004 cipher_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA uint16 = 0xC005 cipher_TLS_ECDHE_ECDSA_WITH_NULL_SHA uint16 = 0xC006 cipher_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA uint16 = 0xC007 cipher_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA uint16 = 0xC008 cipher_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA uint16 = 0xC009 cipher_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA uint16 = 0xC00A cipher_TLS_ECDH_RSA_WITH_NULL_SHA uint16 = 0xC00B cipher_TLS_ECDH_RSA_WITH_RC4_128_SHA uint16 = 0xC00C cipher_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA uint16 = 0xC00D cipher_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA uint16 = 0xC00E cipher_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA uint16 = 0xC00F cipher_TLS_ECDHE_RSA_WITH_NULL_SHA uint16 = 0xC010 cipher_TLS_ECDHE_RSA_WITH_RC4_128_SHA uint16 = 0xC011 cipher_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA uint16 = 0xC012 cipher_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA uint16 = 0xC013 cipher_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA uint16 = 0xC014 cipher_TLS_ECDH_anon_WITH_NULL_SHA uint16 = 0xC015 cipher_TLS_ECDH_anon_WITH_RC4_128_SHA uint16 = 0xC016 cipher_TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA uint16 = 0xC017 cipher_TLS_ECDH_anon_WITH_AES_128_CBC_SHA uint16 = 0xC018 cipher_TLS_ECDH_anon_WITH_AES_256_CBC_SHA uint16 = 0xC019 cipher_TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA uint16 = 0xC01A cipher_TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA uint16 = 0xC01B cipher_TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA uint16 = 0xC01C cipher_TLS_SRP_SHA_WITH_AES_128_CBC_SHA uint16 = 0xC01D cipher_TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA uint16 = 0xC01E cipher_TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA uint16 = 0xC01F cipher_TLS_SRP_SHA_WITH_AES_256_CBC_SHA uint16 = 0xC020 cipher_TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA uint16 = 0xC021 cipher_TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA uint16 = 0xC022 cipher_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 uint16 = 0xC023 cipher_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 uint16 = 0xC024 cipher_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 uint16 = 0xC025 cipher_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 uint16 = 0xC026 cipher_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 uint16 = 0xC027 cipher_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 uint16 = 0xC028 cipher_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 uint16 = 0xC029 cipher_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 uint16 = 0xC02A cipher_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 uint16 = 0xC02B cipher_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 uint16 = 0xC02C cipher_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 uint16 = 0xC02D cipher_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 uint16 = 0xC02E cipher_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 uint16 = 0xC02F cipher_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 uint16 = 0xC030 cipher_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 uint16 = 0xC031 cipher_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 uint16 = 0xC032 cipher_TLS_ECDHE_PSK_WITH_RC4_128_SHA uint16 = 0xC033 cipher_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA uint16 = 0xC034 cipher_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA uint16 = 0xC035 cipher_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA uint16 = 0xC036 cipher_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 uint16 = 0xC037 cipher_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384 uint16 = 0xC038 cipher_TLS_ECDHE_PSK_WITH_NULL_SHA uint16 = 0xC039 cipher_TLS_ECDHE_PSK_WITH_NULL_SHA256 uint16 = 0xC03A cipher_TLS_ECDHE_PSK_WITH_NULL_SHA384 uint16 = 0xC03B cipher_TLS_RSA_WITH_ARIA_128_CBC_SHA256 uint16 = 0xC03C cipher_TLS_RSA_WITH_ARIA_256_CBC_SHA384 uint16 = 0xC03D cipher_TLS_DH_DSS_WITH_ARIA_128_CBC_SHA256 uint16 = 0xC03E cipher_TLS_DH_DSS_WITH_ARIA_256_CBC_SHA384 uint16 = 0xC03F cipher_TLS_DH_RSA_WITH_ARIA_128_CBC_SHA256 uint16 = 0xC040 cipher_TLS_DH_RSA_WITH_ARIA_256_CBC_SHA384 uint16 = 0xC041 cipher_TLS_DHE_DSS_WITH_ARIA_128_CBC_SHA256 uint16 = 0xC042 cipher_TLS_DHE_DSS_WITH_ARIA_256_CBC_SHA384 uint16 = 0xC043 cipher_TLS_DHE_RSA_WITH_ARIA_128_CBC_SHA256 uint16 = 0xC044 cipher_TLS_DHE_RSA_WITH_ARIA_256_CBC_SHA384 uint16 = 0xC045 cipher_TLS_DH_anon_WITH_ARIA_128_CBC_SHA256 uint16 = 0xC046 cipher_TLS_DH_anon_WITH_ARIA_256_CBC_SHA384 uint16 = 0xC047 cipher_TLS_ECDHE_ECDSA_WITH_ARIA_128_CBC_SHA256 uint16 = 0xC048 cipher_TLS_ECDHE_ECDSA_WITH_ARIA_256_CBC_SHA384 uint16 = 0xC049 cipher_TLS_ECDH_ECDSA_WITH_ARIA_128_CBC_SHA256 uint16 = 0xC04A cipher_TLS_ECDH_ECDSA_WITH_ARIA_256_CBC_SHA384 uint16 = 0xC04B cipher_TLS_ECDHE_RSA_WITH_ARIA_128_CBC_SHA256 uint16 = 0xC04C cipher_TLS_ECDHE_RSA_WITH_ARIA_256_CBC_SHA384 uint16 = 0xC04D cipher_TLS_ECDH_RSA_WITH_ARIA_128_CBC_SHA256 uint16 = 0xC04E cipher_TLS_ECDH_RSA_WITH_ARIA_256_CBC_SHA384 uint16 = 0xC04F cipher_TLS_RSA_WITH_ARIA_128_GCM_SHA256 uint16 = 0xC050 cipher_TLS_RSA_WITH_ARIA_256_GCM_SHA384 uint16 = 0xC051 cipher_TLS_DHE_RSA_WITH_ARIA_128_GCM_SHA256 uint16 = 0xC052 cipher_TLS_DHE_RSA_WITH_ARIA_256_GCM_SHA384 uint16 = 0xC053 cipher_TLS_DH_RSA_WITH_ARIA_128_GCM_SHA256 uint16 = 0xC054 cipher_TLS_DH_RSA_WITH_ARIA_256_GCM_SHA384 uint16 = 0xC055 cipher_TLS_DHE_DSS_WITH_ARIA_128_GCM_SHA256 uint16 = 0xC056 cipher_TLS_DHE_DSS_WITH_ARIA_256_GCM_SHA384 uint16 = 0xC057 cipher_TLS_DH_DSS_WITH_ARIA_128_GCM_SHA256 uint16 = 0xC058 cipher_TLS_DH_DSS_WITH_ARIA_256_GCM_SHA384 uint16 = 0xC059 cipher_TLS_DH_anon_WITH_ARIA_128_GCM_SHA256 uint16 = 0xC05A cipher_TLS_DH_anon_WITH_ARIA_256_GCM_SHA384 uint16 = 0xC05B cipher_TLS_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256 uint16 = 0xC05C cipher_TLS_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384 uint16 = 0xC05D cipher_TLS_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256 uint16 = 0xC05E cipher_TLS_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384 uint16 = 0xC05F cipher_TLS_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256 uint16 = 0xC060 cipher_TLS_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384 uint16 = 0xC061 cipher_TLS_ECDH_RSA_WITH_ARIA_128_GCM_SHA256 uint16 = 0xC062 cipher_TLS_ECDH_RSA_WITH_ARIA_256_GCM_SHA384 uint16 = 0xC063 cipher_TLS_PSK_WITH_ARIA_128_CBC_SHA256 uint16 = 0xC064 cipher_TLS_PSK_WITH_ARIA_256_CBC_SHA384 uint16 = 0xC065 cipher_TLS_DHE_PSK_WITH_ARIA_128_CBC_SHA256 uint16 = 0xC066 cipher_TLS_DHE_PSK_WITH_ARIA_256_CBC_SHA384 uint16 = 0xC067 cipher_TLS_RSA_PSK_WITH_ARIA_128_CBC_SHA256 uint16 = 0xC068 cipher_TLS_RSA_PSK_WITH_ARIA_256_CBC_SHA384 uint16 = 0xC069 cipher_TLS_PSK_WITH_ARIA_128_GCM_SHA256 uint16 = 0xC06A cipher_TLS_PSK_WITH_ARIA_256_GCM_SHA384 uint16 = 0xC06B cipher_TLS_DHE_PSK_WITH_ARIA_128_GCM_SHA256 uint16 = 0xC06C cipher_TLS_DHE_PSK_WITH_ARIA_256_GCM_SHA384 uint16 = 0xC06D cipher_TLS_RSA_PSK_WITH_ARIA_128_GCM_SHA256 uint16 = 0xC06E cipher_TLS_RSA_PSK_WITH_ARIA_256_GCM_SHA384 uint16 = 0xC06F cipher_TLS_ECDHE_PSK_WITH_ARIA_128_CBC_SHA256 uint16 = 0xC070 cipher_TLS_ECDHE_PSK_WITH_ARIA_256_CBC_SHA384 uint16 = 0xC071 cipher_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 uint16 = 0xC072 cipher_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 uint16 = 0xC073 cipher_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 uint16 = 0xC074 cipher_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 uint16 = 0xC075 cipher_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 uint16 = 0xC076 cipher_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384 uint16 = 0xC077 cipher_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256 uint16 = 0xC078 cipher_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384 uint16 = 0xC079 cipher_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256 uint16 = 0xC07A cipher_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384 uint16 = 0xC07B cipher_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 uint16 = 0xC07C cipher_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 uint16 = 0xC07D cipher_TLS_DH_RSA_WITH_CAMELLIA_128_GCM_SHA256 uint16 = 0xC07E cipher_TLS_DH_RSA_WITH_CAMELLIA_256_GCM_SHA384 uint16 = 0xC07F cipher_TLS_DHE_DSS_WITH_CAMELLIA_128_GCM_SHA256 uint16 = 0xC080 cipher_TLS_DHE_DSS_WITH_CAMELLIA_256_GCM_SHA384 uint16 = 0xC081 cipher_TLS_DH_DSS_WITH_CAMELLIA_128_GCM_SHA256 uint16 = 0xC082 cipher_TLS_DH_DSS_WITH_CAMELLIA_256_GCM_SHA384 uint16 = 0xC083 cipher_TLS_DH_anon_WITH_CAMELLIA_128_GCM_SHA256 uint16 = 0xC084 cipher_TLS_DH_anon_WITH_CAMELLIA_256_GCM_SHA384 uint16 = 0xC085 cipher_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 uint16 = 0xC086 cipher_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 uint16 = 0xC087 cipher_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 uint16 = 0xC088 cipher_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 uint16 = 0xC089 cipher_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 uint16 = 0xC08A cipher_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 uint16 = 0xC08B cipher_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 uint16 = 0xC08C cipher_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 uint16 = 0xC08D cipher_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 uint16 = 0xC08E cipher_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384 uint16 = 0xC08F cipher_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256 uint16 = 0xC090 cipher_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384 uint16 = 0xC091 cipher_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256 uint16 = 0xC092 cipher_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384 uint16 = 0xC093 cipher_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 uint16 = 0xC094 cipher_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384 uint16 = 0xC095 cipher_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 uint16 = 0xC096 cipher_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 uint16 = 0xC097 cipher_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 uint16 = 0xC098 cipher_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384 uint16 = 0xC099 cipher_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 uint16 = 0xC09A cipher_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 uint16 = 0xC09B cipher_TLS_RSA_WITH_AES_128_CCM uint16 = 0xC09C cipher_TLS_RSA_WITH_AES_256_CCM uint16 = 0xC09D cipher_TLS_DHE_RSA_WITH_AES_128_CCM uint16 = 0xC09E cipher_TLS_DHE_RSA_WITH_AES_256_CCM uint16 = 0xC09F cipher_TLS_RSA_WITH_AES_128_CCM_8 uint16 = 0xC0A0 cipher_TLS_RSA_WITH_AES_256_CCM_8 uint16 = 0xC0A1 cipher_TLS_DHE_RSA_WITH_AES_128_CCM_8 uint16 = 0xC0A2 cipher_TLS_DHE_RSA_WITH_AES_256_CCM_8 uint16 = 0xC0A3 cipher_TLS_PSK_WITH_AES_128_CCM uint16 = 0xC0A4 cipher_TLS_PSK_WITH_AES_256_CCM uint16 = 0xC0A5 cipher_TLS_DHE_PSK_WITH_AES_128_CCM uint16 = 0xC0A6 cipher_TLS_DHE_PSK_WITH_AES_256_CCM uint16 = 0xC0A7 cipher_TLS_PSK_WITH_AES_128_CCM_8 uint16 = 0xC0A8 cipher_TLS_PSK_WITH_AES_256_CCM_8 uint16 = 0xC0A9 cipher_TLS_PSK_DHE_WITH_AES_128_CCM_8 uint16 = 0xC0AA cipher_TLS_PSK_DHE_WITH_AES_256_CCM_8 uint16 = 0xC0AB cipher_TLS_ECDHE_ECDSA_WITH_AES_128_CCM uint16 = 0xC0AC cipher_TLS_ECDHE_ECDSA_WITH_AES_256_CCM uint16 = 0xC0AD cipher_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 uint16 = 0xC0AE cipher_TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8 uint16 = 0xC0AF // Unassigned uint16 = 0xC0B0-FF // Unassigned uint16 = 0xC1-CB,* // Unassigned uint16 = 0xCC00-A7 cipher_TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 uint16 = 0xCCA8 cipher_TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 uint16 = 0xCCA9 cipher_TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256 uint16 = 0xCCAA cipher_TLS_PSK_WITH_CHACHA20_POLY1305_SHA256 uint16 = 0xCCAB cipher_TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256 uint16 = 0xCCAC cipher_TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256 uint16 = 0xCCAD cipher_TLS_RSA_PSK_WITH_CHACHA20_POLY1305_SHA256 uint16 = 0xCCAE ) // isBadCipher reports whether the cipher is blacklisted by the HTTP/2 spec. // References: // https://tools.ietf.org/html/rfc7540#appendix-A // Reject cipher suites from Appendix A. // "This list includes those cipher suites that do not // offer an ephemeral key exchange and those that are // based on the TLS null, stream or block cipher type" func isBadCipher(cipher uint16) bool { switch cipher { case cipher_TLS_NULL_WITH_NULL_NULL, cipher_TLS_RSA_WITH_NULL_MD5, cipher_TLS_RSA_WITH_NULL_SHA, cipher_TLS_RSA_EXPORT_WITH_RC4_40_MD5, cipher_TLS_RSA_WITH_RC4_128_MD5, cipher_TLS_RSA_WITH_RC4_128_SHA, cipher_TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5, cipher_TLS_RSA_WITH_IDEA_CBC_SHA, cipher_TLS_RSA_EXPORT_WITH_DES40_CBC_SHA, cipher_TLS_RSA_WITH_DES_CBC_SHA, cipher_TLS_RSA_WITH_3DES_EDE_CBC_SHA, cipher_TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA, cipher_TLS_DH_DSS_WITH_DES_CBC_SHA, cipher_TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA, cipher_TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA, cipher_TLS_DH_RSA_WITH_DES_CBC_SHA, cipher_TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA, cipher_TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA, cipher_TLS_DHE_DSS_WITH_DES_CBC_SHA, cipher_TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA, cipher_TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA, cipher_TLS_DHE_RSA_WITH_DES_CBC_SHA, cipher_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA, cipher_TLS_DH_anon_EXPORT_WITH_RC4_40_MD5, cipher_TLS_DH_anon_WITH_RC4_128_MD5, cipher_TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA, cipher_TLS_DH_anon_WITH_DES_CBC_SHA, cipher_TLS_DH_anon_WITH_3DES_EDE_CBC_SHA, cipher_TLS_KRB5_WITH_DES_CBC_SHA, cipher_TLS_KRB5_WITH_3DES_EDE_CBC_SHA, cipher_TLS_KRB5_WITH_RC4_128_SHA, cipher_TLS_KRB5_WITH_IDEA_CBC_SHA, cipher_TLS_KRB5_WITH_DES_CBC_MD5, cipher_TLS_KRB5_WITH_3DES_EDE_CBC_MD5, cipher_TLS_KRB5_WITH_RC4_128_MD5, cipher_TLS_KRB5_WITH_IDEA_CBC_MD5, cipher_TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA, cipher_TLS_KRB5_EXPORT_WITH_RC2_CBC_40_SHA, cipher_TLS_KRB5_EXPORT_WITH_RC4_40_SHA, cipher_TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5, cipher_TLS_KRB5_EXPORT_WITH_RC2_CBC_40_MD5, cipher_TLS_KRB5_EXPORT_WITH_RC4_40_MD5, cipher_TLS_PSK_WITH_NULL_SHA, cipher_TLS_DHE_PSK_WITH_NULL_SHA, cipher_TLS_RSA_PSK_WITH_NULL_SHA, cipher_TLS_RSA_WITH_AES_128_CBC_SHA, cipher_TLS_DH_DSS_WITH_AES_128_CBC_SHA, cipher_TLS_DH_RSA_WITH_AES_128_CBC_SHA, cipher_TLS_DHE_DSS_WITH_AES_128_CBC_SHA, cipher_TLS_DHE_RSA_WITH_AES_128_CBC_SHA, cipher_TLS_DH_anon_WITH_AES_128_CBC_SHA, cipher_TLS_RSA_WITH_AES_256_CBC_SHA, cipher_TLS_DH_DSS_WITH_AES_256_CBC_SHA, cipher_TLS_DH_RSA_WITH_AES_256_CBC_SHA, cipher_TLS_DHE_DSS_WITH_AES_256_CBC_SHA, cipher_TLS_DHE_RSA_WITH_AES_256_CBC_SHA, cipher_TLS_DH_anon_WITH_AES_256_CBC_SHA, cipher_TLS_RSA_WITH_NULL_SHA256, cipher_TLS_RSA_WITH_AES_128_CBC_SHA256, cipher_TLS_RSA_WITH_AES_256_CBC_SHA256, cipher_TLS_DH_DSS_WITH_AES_128_CBC_SHA256, cipher_TLS_DH_RSA_WITH_AES_128_CBC_SHA256, cipher_TLS_DHE_DSS_WITH_AES_128_CBC_SHA256, cipher_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA, cipher_TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA, cipher_TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA, cipher_TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA, cipher_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA, cipher_TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA, cipher_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, cipher_TLS_DH_DSS_WITH_AES_256_CBC_SHA256, cipher_TLS_DH_RSA_WITH_AES_256_CBC_SHA256, cipher_TLS_DHE_DSS_WITH_AES_256_CBC_SHA256, cipher_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256, cipher_TLS_DH_anon_WITH_AES_128_CBC_SHA256, cipher_TLS_DH_anon_WITH_AES_256_CBC_SHA256, cipher_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA, cipher_TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA, cipher_TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA, cipher_TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA, cipher_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA, cipher_TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA, cipher_TLS_PSK_WITH_RC4_128_SHA, cipher_TLS_PSK_WITH_3DES_EDE_CBC_SHA, cipher_TLS_PSK_WITH_AES_128_CBC_SHA, cipher_TLS_PSK_WITH_AES_256_CBC_SHA, cipher_TLS_DHE_PSK_WITH_RC4_128_SHA, cipher_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA, cipher_TLS_DHE_PSK_WITH_AES_128_CBC_SHA, cipher_TLS_DHE_PSK_WITH_AES_256_CBC_SHA, cipher_TLS_RSA_PSK_WITH_RC4_128_SHA, cipher_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA, cipher_TLS_RSA_PSK_WITH_AES_128_CBC_SHA, cipher_TLS_RSA_PSK_WITH_AES_256_CBC_SHA, cipher_TLS_RSA_WITH_SEED_CBC_SHA, cipher_TLS_DH_DSS_WITH_SEED_CBC_SHA, cipher_TLS_DH_RSA_WITH_SEED_CBC_SHA, cipher_TLS_DHE_DSS_WITH_SEED_CBC_SHA, cipher_TLS_DHE_RSA_WITH_SEED_CBC_SHA, cipher_TLS_DH_anon_WITH_SEED_CBC_SHA, cipher_TLS_RSA_WITH_AES_128_GCM_SHA256, cipher_TLS_RSA_WITH_AES_256_GCM_SHA384, cipher_TLS_DH_RSA_WITH_AES_128_GCM_SHA256, cipher_TLS_DH_RSA_WITH_AES_256_GCM_SHA384, cipher_TLS_DH_DSS_WITH_AES_128_GCM_SHA256, cipher_TLS_DH_DSS_WITH_AES_256_GCM_SHA384, cipher_TLS_DH_anon_WITH_AES_128_GCM_SHA256, cipher_TLS_DH_anon_WITH_AES_256_GCM_SHA384, cipher_TLS_PSK_WITH_AES_128_GCM_SHA256, cipher_TLS_PSK_WITH_AES_256_GCM_SHA384, cipher_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256, cipher_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384, cipher_TLS_PSK_WITH_AES_128_CBC_SHA256, cipher_TLS_PSK_WITH_AES_256_CBC_SHA384, cipher_TLS_PSK_WITH_NULL_SHA256, cipher_TLS_PSK_WITH_NULL_SHA384, cipher_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256, cipher_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384, cipher_TLS_DHE_PSK_WITH_NULL_SHA256, cipher_TLS_DHE_PSK_WITH_NULL_SHA384, cipher_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256, cipher_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384, cipher_TLS_RSA_PSK_WITH_NULL_SHA256, cipher_TLS_RSA_PSK_WITH_NULL_SHA384, cipher_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256, cipher_TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256, cipher_TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA256, cipher_TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256, cipher_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256, cipher_TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA256, cipher_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256, cipher_TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256, cipher_TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256, cipher_TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256, cipher_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256, cipher_TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA256, cipher_TLS_EMPTY_RENEGOTIATION_INFO_SCSV, cipher_TLS_ECDH_ECDSA_WITH_NULL_SHA, cipher_TLS_ECDH_ECDSA_WITH_RC4_128_SHA, cipher_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA, cipher_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, cipher_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, cipher_TLS_ECDHE_ECDSA_WITH_NULL_SHA, cipher_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, cipher_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA, cipher_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, cipher_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, cipher_TLS_ECDH_RSA_WITH_NULL_SHA, cipher_TLS_ECDH_RSA_WITH_RC4_128_SHA, cipher_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA, cipher_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, cipher_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, cipher_TLS_ECDHE_RSA_WITH_NULL_SHA, cipher_TLS_ECDHE_RSA_WITH_RC4_128_SHA, cipher_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, cipher_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, cipher_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, cipher_TLS_ECDH_anon_WITH_NULL_SHA, cipher_TLS_ECDH_anon_WITH_RC4_128_SHA, cipher_TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA, cipher_TLS_ECDH_anon_WITH_AES_128_CBC_SHA, cipher_TLS_ECDH_anon_WITH_AES_256_CBC_SHA, cipher_TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA, cipher_TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA, cipher_TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA, cipher_TLS_SRP_SHA_WITH_AES_128_CBC_SHA, cipher_TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA, cipher_TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA, cipher_TLS_SRP_SHA_WITH_AES_256_CBC_SHA, cipher_TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA, cipher_TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA, cipher_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, cipher_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, cipher_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256, cipher_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384, cipher_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, cipher_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, cipher_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256, cipher_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384, cipher_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256, cipher_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384, cipher_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256, cipher_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384, cipher_TLS_ECDHE_PSK_WITH_RC4_128_SHA, cipher_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA, cipher_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA, cipher_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA, cipher_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256, cipher_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384, cipher_TLS_ECDHE_PSK_WITH_NULL_SHA, cipher_TLS_ECDHE_PSK_WITH_NULL_SHA256, cipher_TLS_ECDHE_PSK_WITH_NULL_SHA384, cipher_TLS_RSA_WITH_ARIA_128_CBC_SHA256, cipher_TLS_RSA_WITH_ARIA_256_CBC_SHA384, cipher_TLS_DH_DSS_WITH_ARIA_128_CBC_SHA256, cipher_TLS_DH_DSS_WITH_ARIA_256_CBC_SHA384, cipher_TLS_DH_RSA_WITH_ARIA_128_CBC_SHA256, cipher_TLS_DH_RSA_WITH_ARIA_256_CBC_SHA384, cipher_TLS_DHE_DSS_WITH_ARIA_128_CBC_SHA256, cipher_TLS_DHE_DSS_WITH_ARIA_256_CBC_SHA384, cipher_TLS_DHE_RSA_WITH_ARIA_128_CBC_SHA256, cipher_TLS_DHE_RSA_WITH_ARIA_256_CBC_SHA384, cipher_TLS_DH_anon_WITH_ARIA_128_CBC_SHA256, cipher_TLS_DH_anon_WITH_ARIA_256_CBC_SHA384, cipher_TLS_ECDHE_ECDSA_WITH_ARIA_128_CBC_SHA256, cipher_TLS_ECDHE_ECDSA_WITH_ARIA_256_CBC_SHA384, cipher_TLS_ECDH_ECDSA_WITH_ARIA_128_CBC_SHA256, cipher_TLS_ECDH_ECDSA_WITH_ARIA_256_CBC_SHA384, cipher_TLS_ECDHE_RSA_WITH_ARIA_128_CBC_SHA256, cipher_TLS_ECDHE_RSA_WITH_ARIA_256_CBC_SHA384, cipher_TLS_ECDH_RSA_WITH_ARIA_128_CBC_SHA256, cipher_TLS_ECDH_RSA_WITH_ARIA_256_CBC_SHA384, cipher_TLS_RSA_WITH_ARIA_128_GCM_SHA256, cipher_TLS_RSA_WITH_ARIA_256_GCM_SHA384, cipher_TLS_DH_RSA_WITH_ARIA_128_GCM_SHA256, cipher_TLS_DH_RSA_WITH_ARIA_256_GCM_SHA384, cipher_TLS_DH_DSS_WITH_ARIA_128_GCM_SHA256, cipher_TLS_DH_DSS_WITH_ARIA_256_GCM_SHA384, cipher_TLS_DH_anon_WITH_ARIA_128_GCM_SHA256, cipher_TLS_DH_anon_WITH_ARIA_256_GCM_SHA384, cipher_TLS_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256, cipher_TLS_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384, cipher_TLS_ECDH_RSA_WITH_ARIA_128_GCM_SHA256, cipher_TLS_ECDH_RSA_WITH_ARIA_256_GCM_SHA384, cipher_TLS_PSK_WITH_ARIA_128_CBC_SHA256, cipher_TLS_PSK_WITH_ARIA_256_CBC_SHA384, cipher_TLS_DHE_PSK_WITH_ARIA_128_CBC_SHA256, cipher_TLS_DHE_PSK_WITH_ARIA_256_CBC_SHA384, cipher_TLS_RSA_PSK_WITH_ARIA_128_CBC_SHA256, cipher_TLS_RSA_PSK_WITH_ARIA_256_CBC_SHA384, cipher_TLS_PSK_WITH_ARIA_128_GCM_SHA256, cipher_TLS_PSK_WITH_ARIA_256_GCM_SHA384, cipher_TLS_RSA_PSK_WITH_ARIA_128_GCM_SHA256, cipher_TLS_RSA_PSK_WITH_ARIA_256_GCM_SHA384, cipher_TLS_ECDHE_PSK_WITH_ARIA_128_CBC_SHA256, cipher_TLS_ECDHE_PSK_WITH_ARIA_256_CBC_SHA384, cipher_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256, cipher_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384, cipher_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256, cipher_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384, cipher_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256, cipher_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384, cipher_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256, cipher_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384, cipher_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256, cipher_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384, cipher_TLS_DH_RSA_WITH_CAMELLIA_128_GCM_SHA256, cipher_TLS_DH_RSA_WITH_CAMELLIA_256_GCM_SHA384, cipher_TLS_DH_DSS_WITH_CAMELLIA_128_GCM_SHA256, cipher_TLS_DH_DSS_WITH_CAMELLIA_256_GCM_SHA384, cipher_TLS_DH_anon_WITH_CAMELLIA_128_GCM_SHA256, cipher_TLS_DH_anon_WITH_CAMELLIA_256_GCM_SHA384, cipher_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256, cipher_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384, cipher_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256, cipher_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384, cipher_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256, cipher_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384, cipher_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256, cipher_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384, cipher_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256, cipher_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384, cipher_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256, cipher_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384, cipher_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256, cipher_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384, cipher_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256, cipher_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384, cipher_TLS_RSA_WITH_AES_128_CCM, cipher_TLS_RSA_WITH_AES_256_CCM, cipher_TLS_RSA_WITH_AES_128_CCM_8, cipher_TLS_RSA_WITH_AES_256_CCM_8, cipher_TLS_PSK_WITH_AES_128_CCM, cipher_TLS_PSK_WITH_AES_256_CCM, cipher_TLS_PSK_WITH_AES_128_CCM_8, cipher_TLS_PSK_WITH_AES_256_CCM_8: return true default: return false } } ================================================ FILE: vendor/golang.org/x/net/http2/client_conn_pool.go ================================================ // Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Transport code's client connection pooling. package http2 import ( "context" "errors" "net" "net/http" "sync" ) // ClientConnPool manages a pool of HTTP/2 client connections. type ClientConnPool interface { // GetClientConn returns a specific HTTP/2 connection (usually // a TLS-TCP connection) to an HTTP/2 server. On success, the // returned ClientConn accounts for the upcoming RoundTrip // call, so the caller should not omit it. If the caller needs // to, ClientConn.RoundTrip can be called with a bogus // new(http.Request) to release the stream reservation. GetClientConn(req *http.Request, addr string) (*ClientConn, error) MarkDead(*ClientConn) } // clientConnPoolIdleCloser is the interface implemented by ClientConnPool // implementations which can close their idle connections. type clientConnPoolIdleCloser interface { ClientConnPool closeIdleConnections() } var ( _ clientConnPoolIdleCloser = (*clientConnPool)(nil) _ clientConnPoolIdleCloser = noDialClientConnPool{} ) // TODO: use singleflight for dialing and addConnCalls? type clientConnPool struct { t *Transport mu sync.Mutex // TODO: maybe switch to RWMutex // TODO: add support for sharing conns based on cert names // (e.g. share conn for googleapis.com and appspot.com) conns map[string][]*ClientConn // key is host:port dialing map[string]*dialCall // currently in-flight dials keys map[*ClientConn][]string addConnCalls map[string]*addConnCall // in-flight addConnIfNeeded calls } func (p *clientConnPool) GetClientConn(req *http.Request, addr string) (*ClientConn, error) { return p.getClientConn(req, addr, dialOnMiss) } const ( dialOnMiss = true noDialOnMiss = false ) func (p *clientConnPool) getClientConn(req *http.Request, addr string, dialOnMiss bool) (*ClientConn, error) { // TODO(dneil): Dial a new connection when t.DisableKeepAlives is set? if isConnectionCloseRequest(req) && dialOnMiss { // It gets its own connection. traceGetConn(req, addr) const singleUse = true cc, err := p.t.dialClientConn(req.Context(), addr, singleUse) if err != nil { return nil, err } return cc, nil } for { p.mu.Lock() for _, cc := range p.conns[addr] { if cc.ReserveNewRequest() { // When a connection is presented to us by the net/http package, // the GetConn hook has already been called. // Don't call it a second time here. if !cc.getConnCalled { traceGetConn(req, addr) } cc.getConnCalled = false p.mu.Unlock() return cc, nil } } if !dialOnMiss { p.mu.Unlock() return nil, ErrNoCachedConn } traceGetConn(req, addr) call := p.getStartDialLocked(req.Context(), addr) p.mu.Unlock() <-call.done if shouldRetryDial(call, req) { continue } cc, err := call.res, call.err if err != nil { return nil, err } if cc.ReserveNewRequest() { return cc, nil } } } // dialCall is an in-flight Transport dial call to a host. type dialCall struct { _ incomparable p *clientConnPool // the context associated with the request // that created this dialCall ctx context.Context done chan struct{} // closed when done res *ClientConn // valid after done is closed err error // valid after done is closed } // requires p.mu is held. func (p *clientConnPool) getStartDialLocked(ctx context.Context, addr string) *dialCall { if call, ok := p.dialing[addr]; ok { // A dial is already in-flight. Don't start another. return call } call := &dialCall{p: p, done: make(chan struct{}), ctx: ctx} if p.dialing == nil { p.dialing = make(map[string]*dialCall) } p.dialing[addr] = call go call.dial(call.ctx, addr) return call } // run in its own goroutine. func (c *dialCall) dial(ctx context.Context, addr string) { const singleUse = false // shared conn c.res, c.err = c.p.t.dialClientConn(ctx, addr, singleUse) c.p.mu.Lock() delete(c.p.dialing, addr) if c.err == nil { c.p.addConnLocked(addr, c.res) } c.p.mu.Unlock() close(c.done) } // addConnIfNeeded makes a NewClientConn out of c if a connection for key doesn't // already exist. It coalesces concurrent calls with the same key. // This is used by the http1 Transport code when it creates a new connection. Because // the http1 Transport doesn't de-dup TCP dials to outbound hosts (because it doesn't know // the protocol), it can get into a situation where it has multiple TLS connections. // This code decides which ones live or die. // The return value used is whether c was used. // c is never closed. func (p *clientConnPool) addConnIfNeeded(key string, t *Transport, c net.Conn) (used bool, err error) { p.mu.Lock() for _, cc := range p.conns[key] { if cc.CanTakeNewRequest() { p.mu.Unlock() return false, nil } } call, dup := p.addConnCalls[key] if !dup { if p.addConnCalls == nil { p.addConnCalls = make(map[string]*addConnCall) } call = &addConnCall{ p: p, done: make(chan struct{}), } p.addConnCalls[key] = call go call.run(t, key, c) } p.mu.Unlock() <-call.done if call.err != nil { return false, call.err } return !dup, nil } type addConnCall struct { _ incomparable p *clientConnPool done chan struct{} // closed when done err error } func (c *addConnCall) run(t *Transport, key string, nc net.Conn) { cc, err := t.NewClientConn(nc) p := c.p p.mu.Lock() if err != nil { c.err = err } else { cc.getConnCalled = true // already called by the net/http package p.addConnLocked(key, cc) } delete(p.addConnCalls, key) p.mu.Unlock() close(c.done) } // p.mu must be held func (p *clientConnPool) addConnLocked(key string, cc *ClientConn) { for _, v := range p.conns[key] { if v == cc { return } } if p.conns == nil { p.conns = make(map[string][]*ClientConn) } if p.keys == nil { p.keys = make(map[*ClientConn][]string) } p.conns[key] = append(p.conns[key], cc) p.keys[cc] = append(p.keys[cc], key) } func (p *clientConnPool) MarkDead(cc *ClientConn) { p.mu.Lock() defer p.mu.Unlock() for _, key := range p.keys[cc] { vv, ok := p.conns[key] if !ok { continue } newList := filterOutClientConn(vv, cc) if len(newList) > 0 { p.conns[key] = newList } else { delete(p.conns, key) } } delete(p.keys, cc) } func (p *clientConnPool) closeIdleConnections() { p.mu.Lock() defer p.mu.Unlock() // TODO: don't close a cc if it was just added to the pool // milliseconds ago and has never been used. There's currently // a small race window with the HTTP/1 Transport's integration // where it can add an idle conn just before using it, and // somebody else can concurrently call CloseIdleConns and // break some caller's RoundTrip. for _, vv := range p.conns { for _, cc := range vv { cc.closeIfIdle() } } } func filterOutClientConn(in []*ClientConn, exclude *ClientConn) []*ClientConn { out := in[:0] for _, v := range in { if v != exclude { out = append(out, v) } } // If we filtered it out, zero out the last item to prevent // the GC from seeing it. if len(in) != len(out) { in[len(in)-1] = nil } return out } // noDialClientConnPool is an implementation of http2.ClientConnPool // which never dials. We let the HTTP/1.1 client dial and use its TLS // connection instead. type noDialClientConnPool struct{ *clientConnPool } func (p noDialClientConnPool) GetClientConn(req *http.Request, addr string) (*ClientConn, error) { return p.getClientConn(req, addr, noDialOnMiss) } // shouldRetryDial reports whether the current request should // retry dialing after the call finished unsuccessfully, for example // if the dial was canceled because of a context cancellation or // deadline expiry. func shouldRetryDial(call *dialCall, req *http.Request) bool { if call.err == nil { // No error, no need to retry return false } if call.ctx == req.Context() { // If the call has the same context as the request, the dial // should not be retried, since any cancellation will have come // from this request. return false } if !errors.Is(call.err, context.Canceled) && !errors.Is(call.err, context.DeadlineExceeded) { // If the call error is not because of a context cancellation or a deadline expiry, // the dial should not be retried. return false } // Only retry if the error is a context cancellation error or deadline expiry // and the context associated with the call was canceled or expired. return call.ctx.Err() != nil } ================================================ FILE: vendor/golang.org/x/net/http2/client_priority_go126.go ================================================ // Copyright 2026 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build !go1.27 package http2 import "net/http" // Support for go.dev/issue/75500 is added in Go 1.27. In case anyone uses // x/net with versions before Go 1.27, we return true here so that their write // scheduler will still be the round-robin write scheduler rather than the RFC // 9218 write scheduler. That way, older users of Go will not see a sudden // change of behavior just from importing x/net. // // TODO(nsh): remove this file after x/net go.mod is at Go 1.27. func clientPriorityDisabled(_ *http.Server) bool { return true } ================================================ FILE: vendor/golang.org/x/net/http2/client_priority_go127.go ================================================ // Copyright 2026 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build go1.27 package http2 import "net/http" func clientPriorityDisabled(s *http.Server) bool { return s.DisableClientPriority } ================================================ FILE: vendor/golang.org/x/net/http2/config.go ================================================ // Copyright 2024 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package http2 import ( "math" "net/http" "time" ) // http2Config is a package-internal version of net/http.HTTP2Config. // // http.HTTP2Config was added in Go 1.24. // When running with a version of net/http that includes HTTP2Config, // we merge the configuration with the fields in Transport or Server // to produce an http2Config. // // Zero valued fields in http2Config are interpreted as in the // net/http.HTTPConfig documentation. // // Precedence order for reconciling configurations is: // // - Use the net/http.{Server,Transport}.HTTP2Config value, when non-zero. // - Otherwise use the http2.{Server.Transport} value. // - If the resulting value is zero or out of range, use a default. type http2Config struct { MaxConcurrentStreams uint32 StrictMaxConcurrentRequests bool MaxDecoderHeaderTableSize uint32 MaxEncoderHeaderTableSize uint32 MaxReadFrameSize uint32 MaxUploadBufferPerConnection int32 MaxUploadBufferPerStream int32 SendPingTimeout time.Duration PingTimeout time.Duration WriteByteTimeout time.Duration PermitProhibitedCipherSuites bool CountError func(errType string) } // configFromServer merges configuration settings from // net/http.Server.HTTP2Config and http2.Server. func configFromServer(h1 *http.Server, h2 *Server) http2Config { conf := http2Config{ MaxConcurrentStreams: h2.MaxConcurrentStreams, MaxEncoderHeaderTableSize: h2.MaxEncoderHeaderTableSize, MaxDecoderHeaderTableSize: h2.MaxDecoderHeaderTableSize, MaxReadFrameSize: h2.MaxReadFrameSize, MaxUploadBufferPerConnection: h2.MaxUploadBufferPerConnection, MaxUploadBufferPerStream: h2.MaxUploadBufferPerStream, SendPingTimeout: h2.ReadIdleTimeout, PingTimeout: h2.PingTimeout, WriteByteTimeout: h2.WriteByteTimeout, PermitProhibitedCipherSuites: h2.PermitProhibitedCipherSuites, CountError: h2.CountError, } fillNetHTTPConfig(&conf, h1.HTTP2) setConfigDefaults(&conf, true) return conf } // configFromTransport merges configuration settings from h2 and h2.t1.HTTP2 // (the net/http Transport). func configFromTransport(h2 *Transport) http2Config { conf := http2Config{ StrictMaxConcurrentRequests: h2.StrictMaxConcurrentStreams, MaxEncoderHeaderTableSize: h2.MaxEncoderHeaderTableSize, MaxDecoderHeaderTableSize: h2.MaxDecoderHeaderTableSize, MaxReadFrameSize: h2.MaxReadFrameSize, SendPingTimeout: h2.ReadIdleTimeout, PingTimeout: h2.PingTimeout, WriteByteTimeout: h2.WriteByteTimeout, } // Unlike most config fields, where out-of-range values revert to the default, // Transport.MaxReadFrameSize clips. if conf.MaxReadFrameSize < minMaxFrameSize { conf.MaxReadFrameSize = minMaxFrameSize } else if conf.MaxReadFrameSize > maxFrameSize { conf.MaxReadFrameSize = maxFrameSize } if h2.t1 != nil { fillNetHTTPConfig(&conf, h2.t1.HTTP2) } setConfigDefaults(&conf, false) return conf } func setDefault[T ~int | ~int32 | ~uint32 | ~int64](v *T, minval, maxval, defval T) { if *v < minval || *v > maxval { *v = defval } } func setConfigDefaults(conf *http2Config, server bool) { setDefault(&conf.MaxConcurrentStreams, 1, math.MaxUint32, defaultMaxStreams) setDefault(&conf.MaxEncoderHeaderTableSize, 1, math.MaxUint32, initialHeaderTableSize) setDefault(&conf.MaxDecoderHeaderTableSize, 1, math.MaxUint32, initialHeaderTableSize) if server { setDefault(&conf.MaxUploadBufferPerConnection, initialWindowSize, math.MaxInt32, 1<<20) } else { setDefault(&conf.MaxUploadBufferPerConnection, initialWindowSize, math.MaxInt32, transportDefaultConnFlow) } if server { setDefault(&conf.MaxUploadBufferPerStream, 1, math.MaxInt32, 1<<20) } else { setDefault(&conf.MaxUploadBufferPerStream, 1, math.MaxInt32, transportDefaultStreamFlow) } setDefault(&conf.MaxReadFrameSize, minMaxFrameSize, maxFrameSize, defaultMaxReadFrameSize) setDefault(&conf.PingTimeout, 1, math.MaxInt64, 15*time.Second) } // adjustHTTP1MaxHeaderSize converts a limit in bytes on the size of an HTTP/1 header // to an HTTP/2 MAX_HEADER_LIST_SIZE value. func adjustHTTP1MaxHeaderSize(n int64) int64 { // http2's count is in a slightly different unit and includes 32 bytes per pair. // So, take the net/http.Server value and pad it up a bit, assuming 10 headers. const perFieldOverhead = 32 // per http2 spec const typicalHeaders = 10 // conservative return n + typicalHeaders*perFieldOverhead } func fillNetHTTPConfig(conf *http2Config, h2 *http.HTTP2Config) { if h2 == nil { return } if h2.MaxConcurrentStreams != 0 { conf.MaxConcurrentStreams = uint32(h2.MaxConcurrentStreams) } if http2ConfigStrictMaxConcurrentRequests(h2) { conf.StrictMaxConcurrentRequests = true } if h2.MaxEncoderHeaderTableSize != 0 { conf.MaxEncoderHeaderTableSize = uint32(h2.MaxEncoderHeaderTableSize) } if h2.MaxDecoderHeaderTableSize != 0 { conf.MaxDecoderHeaderTableSize = uint32(h2.MaxDecoderHeaderTableSize) } if h2.MaxConcurrentStreams != 0 { conf.MaxConcurrentStreams = uint32(h2.MaxConcurrentStreams) } if h2.MaxReadFrameSize != 0 { conf.MaxReadFrameSize = uint32(h2.MaxReadFrameSize) } if h2.MaxReceiveBufferPerConnection != 0 { conf.MaxUploadBufferPerConnection = int32(h2.MaxReceiveBufferPerConnection) } if h2.MaxReceiveBufferPerStream != 0 { conf.MaxUploadBufferPerStream = int32(h2.MaxReceiveBufferPerStream) } if h2.SendPingTimeout != 0 { conf.SendPingTimeout = h2.SendPingTimeout } if h2.PingTimeout != 0 { conf.PingTimeout = h2.PingTimeout } if h2.WriteByteTimeout != 0 { conf.WriteByteTimeout = h2.WriteByteTimeout } if h2.PermitProhibitedCipherSuites { conf.PermitProhibitedCipherSuites = true } if h2.CountError != nil { conf.CountError = h2.CountError } } ================================================ FILE: vendor/golang.org/x/net/http2/config_go125.go ================================================ // Copyright 2025 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build !go1.26 package http2 import ( "net/http" ) func http2ConfigStrictMaxConcurrentRequests(h2 *http.HTTP2Config) bool { return false } ================================================ FILE: vendor/golang.org/x/net/http2/config_go126.go ================================================ // Copyright 2025 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build go1.26 package http2 import ( "net/http" ) func http2ConfigStrictMaxConcurrentRequests(h2 *http.HTTP2Config) bool { return h2.StrictMaxConcurrentRequests } ================================================ FILE: vendor/golang.org/x/net/http2/databuffer.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package http2 import ( "errors" "fmt" "sync" ) // Buffer chunks are allocated from a pool to reduce pressure on GC. // The maximum wasted space per dataBuffer is 2x the largest size class, // which happens when the dataBuffer has multiple chunks and there is // one unread byte in both the first and last chunks. We use a few size // classes to minimize overheads for servers that typically receive very // small request bodies. // // TODO: Benchmark to determine if the pools are necessary. The GC may have // improved enough that we can instead allocate chunks like this: // make([]byte, max(16<<10, expectedBytesRemaining)) var dataChunkPools = [...]sync.Pool{ {New: func() interface{} { return new([1 << 10]byte) }}, {New: func() interface{} { return new([2 << 10]byte) }}, {New: func() interface{} { return new([4 << 10]byte) }}, {New: func() interface{} { return new([8 << 10]byte) }}, {New: func() interface{} { return new([16 << 10]byte) }}, } func getDataBufferChunk(size int64) []byte { switch { case size <= 1<<10: return dataChunkPools[0].Get().(*[1 << 10]byte)[:] case size <= 2<<10: return dataChunkPools[1].Get().(*[2 << 10]byte)[:] case size <= 4<<10: return dataChunkPools[2].Get().(*[4 << 10]byte)[:] case size <= 8<<10: return dataChunkPools[3].Get().(*[8 << 10]byte)[:] default: return dataChunkPools[4].Get().(*[16 << 10]byte)[:] } } func putDataBufferChunk(p []byte) { switch len(p) { case 1 << 10: dataChunkPools[0].Put((*[1 << 10]byte)(p)) case 2 << 10: dataChunkPools[1].Put((*[2 << 10]byte)(p)) case 4 << 10: dataChunkPools[2].Put((*[4 << 10]byte)(p)) case 8 << 10: dataChunkPools[3].Put((*[8 << 10]byte)(p)) case 16 << 10: dataChunkPools[4].Put((*[16 << 10]byte)(p)) default: panic(fmt.Sprintf("unexpected buffer len=%v", len(p))) } } // dataBuffer is an io.ReadWriter backed by a list of data chunks. // Each dataBuffer is used to read DATA frames on a single stream. // The buffer is divided into chunks so the server can limit the // total memory used by a single connection without limiting the // request body size on any single stream. type dataBuffer struct { chunks [][]byte r int // next byte to read is chunks[0][r] w int // next byte to write is chunks[len(chunks)-1][w] size int // total buffered bytes expected int64 // we expect at least this many bytes in future Write calls (ignored if <= 0) } var errReadEmpty = errors.New("read from empty dataBuffer") // Read copies bytes from the buffer into p. // It is an error to read when no data is available. func (b *dataBuffer) Read(p []byte) (int, error) { if b.size == 0 { return 0, errReadEmpty } var ntotal int for len(p) > 0 && b.size > 0 { readFrom := b.bytesFromFirstChunk() n := copy(p, readFrom) p = p[n:] ntotal += n b.r += n b.size -= n // If the first chunk has been consumed, advance to the next chunk. if b.r == len(b.chunks[0]) { putDataBufferChunk(b.chunks[0]) end := len(b.chunks) - 1 copy(b.chunks[:end], b.chunks[1:]) b.chunks[end] = nil b.chunks = b.chunks[:end] b.r = 0 } } return ntotal, nil } func (b *dataBuffer) bytesFromFirstChunk() []byte { if len(b.chunks) == 1 { return b.chunks[0][b.r:b.w] } return b.chunks[0][b.r:] } // Len returns the number of bytes of the unread portion of the buffer. func (b *dataBuffer) Len() int { return b.size } // Write appends p to the buffer. func (b *dataBuffer) Write(p []byte) (int, error) { ntotal := len(p) for len(p) > 0 { // If the last chunk is empty, allocate a new chunk. Try to allocate // enough to fully copy p plus any additional bytes we expect to // receive. However, this may allocate less than len(p). want := int64(len(p)) if b.expected > want { want = b.expected } chunk := b.lastChunkOrAlloc(want) n := copy(chunk[b.w:], p) p = p[n:] b.w += n b.size += n b.expected -= int64(n) } return ntotal, nil } func (b *dataBuffer) lastChunkOrAlloc(want int64) []byte { if len(b.chunks) != 0 { last := b.chunks[len(b.chunks)-1] if b.w < len(last) { return last } } chunk := getDataBufferChunk(want) b.chunks = append(b.chunks, chunk) b.w = 0 return chunk } ================================================ FILE: vendor/golang.org/x/net/http2/errors.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package http2 import ( "errors" "fmt" ) // An ErrCode is an unsigned 32-bit error code as defined in the HTTP/2 spec. type ErrCode uint32 const ( ErrCodeNo ErrCode = 0x0 ErrCodeProtocol ErrCode = 0x1 ErrCodeInternal ErrCode = 0x2 ErrCodeFlowControl ErrCode = 0x3 ErrCodeSettingsTimeout ErrCode = 0x4 ErrCodeStreamClosed ErrCode = 0x5 ErrCodeFrameSize ErrCode = 0x6 ErrCodeRefusedStream ErrCode = 0x7 ErrCodeCancel ErrCode = 0x8 ErrCodeCompression ErrCode = 0x9 ErrCodeConnect ErrCode = 0xa ErrCodeEnhanceYourCalm ErrCode = 0xb ErrCodeInadequateSecurity ErrCode = 0xc ErrCodeHTTP11Required ErrCode = 0xd ) var errCodeName = map[ErrCode]string{ ErrCodeNo: "NO_ERROR", ErrCodeProtocol: "PROTOCOL_ERROR", ErrCodeInternal: "INTERNAL_ERROR", ErrCodeFlowControl: "FLOW_CONTROL_ERROR", ErrCodeSettingsTimeout: "SETTINGS_TIMEOUT", ErrCodeStreamClosed: "STREAM_CLOSED", ErrCodeFrameSize: "FRAME_SIZE_ERROR", ErrCodeRefusedStream: "REFUSED_STREAM", ErrCodeCancel: "CANCEL", ErrCodeCompression: "COMPRESSION_ERROR", ErrCodeConnect: "CONNECT_ERROR", ErrCodeEnhanceYourCalm: "ENHANCE_YOUR_CALM", ErrCodeInadequateSecurity: "INADEQUATE_SECURITY", ErrCodeHTTP11Required: "HTTP_1_1_REQUIRED", } func (e ErrCode) String() string { if s, ok := errCodeName[e]; ok { return s } return fmt.Sprintf("unknown error code 0x%x", uint32(e)) } func (e ErrCode) stringToken() string { if s, ok := errCodeName[e]; ok { return s } return fmt.Sprintf("ERR_UNKNOWN_%d", uint32(e)) } // ConnectionError is an error that results in the termination of the // entire connection. type ConnectionError ErrCode func (e ConnectionError) Error() string { return fmt.Sprintf("connection error: %s", ErrCode(e)) } // StreamError is an error that only affects one stream within an // HTTP/2 connection. type StreamError struct { StreamID uint32 Code ErrCode Cause error // optional additional detail } // errFromPeer is a sentinel error value for StreamError.Cause to // indicate that the StreamError was sent from the peer over the wire // and wasn't locally generated in the Transport. var errFromPeer = errors.New("received from peer") func streamError(id uint32, code ErrCode) StreamError { return StreamError{StreamID: id, Code: code} } func (e StreamError) Error() string { if e.Cause != nil { return fmt.Sprintf("stream error: stream ID %d; %v; %v", e.StreamID, e.Code, e.Cause) } return fmt.Sprintf("stream error: stream ID %d; %v", e.StreamID, e.Code) } // 6.9.1 The Flow Control Window // "If a sender receives a WINDOW_UPDATE that causes a flow control // window to exceed this maximum it MUST terminate either the stream // or the connection, as appropriate. For streams, [...]; for the // connection, a GOAWAY frame with a FLOW_CONTROL_ERROR code." type goAwayFlowError struct{} func (goAwayFlowError) Error() string { return "connection exceeded flow control window size" } // connError represents an HTTP/2 ConnectionError error code, along // with a string (for debugging) explaining why. // // Errors of this type are only returned by the frame parser functions // and converted into ConnectionError(Code), after stashing away // the Reason into the Framer's errDetail field, accessible via // the (*Framer).ErrorDetail method. type connError struct { Code ErrCode // the ConnectionError error code Reason string // additional reason } func (e connError) Error() string { return fmt.Sprintf("http2: connection error: %v: %v", e.Code, e.Reason) } type pseudoHeaderError string func (e pseudoHeaderError) Error() string { return fmt.Sprintf("invalid pseudo-header %q", string(e)) } type duplicatePseudoHeaderError string func (e duplicatePseudoHeaderError) Error() string { return fmt.Sprintf("duplicate pseudo-header %q", string(e)) } type headerFieldNameError string func (e headerFieldNameError) Error() string { return fmt.Sprintf("invalid header field name %q", string(e)) } type headerFieldValueError string func (e headerFieldValueError) Error() string { return fmt.Sprintf("invalid header field value for %q", string(e)) } var ( errMixPseudoHeaderTypes = errors.New("mix of request and response pseudo headers") errPseudoAfterRegular = errors.New("pseudo header field after regular") ) ================================================ FILE: vendor/golang.org/x/net/http2/flow.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Flow control package http2 // inflowMinRefresh is the minimum number of bytes we'll send for a // flow control window update. const inflowMinRefresh = 4 << 10 // inflow accounts for an inbound flow control window. // It tracks both the latest window sent to the peer (used for enforcement) // and the accumulated unsent window. type inflow struct { avail int32 unsent int32 } // init sets the initial window. func (f *inflow) init(n int32) { f.avail = n } // add adds n bytes to the window, with a maximum window size of max, // indicating that the peer can now send us more data. // For example, the user read from a {Request,Response} body and consumed // some of the buffered data, so the peer can now send more. // It returns the number of bytes to send in a WINDOW_UPDATE frame to the peer. // Window updates are accumulated and sent when the unsent capacity // is at least inflowMinRefresh or will at least double the peer's available window. func (f *inflow) add(n int) (connAdd int32) { if n < 0 { panic("negative update") } unsent := int64(f.unsent) + int64(n) // "A sender MUST NOT allow a flow-control window to exceed 2^31-1 octets." // RFC 7540 Section 6.9.1. const maxWindow = 1<<31 - 1 if unsent+int64(f.avail) > maxWindow { panic("flow control update exceeds maximum window size") } f.unsent = int32(unsent) if f.unsent < inflowMinRefresh && f.unsent < f.avail { // If there aren't at least inflowMinRefresh bytes of window to send, // and this update won't at least double the window, buffer the update for later. return 0 } f.avail += f.unsent f.unsent = 0 return int32(unsent) } // take attempts to take n bytes from the peer's flow control window. // It reports whether the window has available capacity. func (f *inflow) take(n uint32) bool { if n > uint32(f.avail) { return false } f.avail -= int32(n) return true } // takeInflows attempts to take n bytes from two inflows, // typically connection-level and stream-level flows. // It reports whether both windows have available capacity. func takeInflows(f1, f2 *inflow, n uint32) bool { if n > uint32(f1.avail) || n > uint32(f2.avail) { return false } f1.avail -= int32(n) f2.avail -= int32(n) return true } // outflow is the outbound flow control window's size. type outflow struct { _ incomparable // n is the number of DATA bytes we're allowed to send. // An outflow is kept both on a conn and a per-stream. n int32 // conn points to the shared connection-level outflow that is // shared by all streams on that conn. It is nil for the outflow // that's on the conn directly. conn *outflow } func (f *outflow) setConnFlow(cf *outflow) { f.conn = cf } func (f *outflow) available() int32 { n := f.n if f.conn != nil && f.conn.n < n { n = f.conn.n } return n } func (f *outflow) take(n int32) { if n > f.available() { panic("internal error: took too much") } f.n -= n if f.conn != nil { f.conn.n -= n } } // add adds n bytes (positive or negative) to the flow control window. // It returns false if the sum would exceed 2^31-1. func (f *outflow) add(n int32) bool { sum := f.n + n if (sum > n) == (f.n > 0) { f.n = sum return true } return false } ================================================ FILE: vendor/golang.org/x/net/http2/frame.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package http2 import ( "bytes" "encoding/binary" "errors" "fmt" "io" "log" "slices" "strings" "sync" "golang.org/x/net/http/httpguts" "golang.org/x/net/http2/hpack" "golang.org/x/net/internal/httpsfv" ) const frameHeaderLen = 9 var padZeros = make([]byte, 255) // zeros for padding // A FrameType is a registered frame type as defined in // https://httpwg.org/specs/rfc7540.html#rfc.section.11.2 and other future // RFCs. type FrameType uint8 const ( FrameData FrameType = 0x0 FrameHeaders FrameType = 0x1 FramePriority FrameType = 0x2 FrameRSTStream FrameType = 0x3 FrameSettings FrameType = 0x4 FramePushPromise FrameType = 0x5 FramePing FrameType = 0x6 FrameGoAway FrameType = 0x7 FrameWindowUpdate FrameType = 0x8 FrameContinuation FrameType = 0x9 FramePriorityUpdate FrameType = 0x10 ) var frameNames = [...]string{ FrameData: "DATA", FrameHeaders: "HEADERS", FramePriority: "PRIORITY", FrameRSTStream: "RST_STREAM", FrameSettings: "SETTINGS", FramePushPromise: "PUSH_PROMISE", FramePing: "PING", FrameGoAway: "GOAWAY", FrameWindowUpdate: "WINDOW_UPDATE", FrameContinuation: "CONTINUATION", FramePriorityUpdate: "PRIORITY_UPDATE", } func (t FrameType) String() string { if int(t) < len(frameNames) { return frameNames[t] } return fmt.Sprintf("UNKNOWN_FRAME_TYPE_%d", t) } // Flags is a bitmask of HTTP/2 flags. // The meaning of flags varies depending on the frame type. type Flags uint8 // Has reports whether f contains all (0 or more) flags in v. func (f Flags) Has(v Flags) bool { return (f & v) == v } // Frame-specific FrameHeader flag bits. const ( // Data Frame FlagDataEndStream Flags = 0x1 FlagDataPadded Flags = 0x8 // Headers Frame FlagHeadersEndStream Flags = 0x1 FlagHeadersEndHeaders Flags = 0x4 FlagHeadersPadded Flags = 0x8 FlagHeadersPriority Flags = 0x20 // Settings Frame FlagSettingsAck Flags = 0x1 // Ping Frame FlagPingAck Flags = 0x1 // Continuation Frame FlagContinuationEndHeaders Flags = 0x4 FlagPushPromiseEndHeaders Flags = 0x4 FlagPushPromisePadded Flags = 0x8 ) var flagName = map[FrameType]map[Flags]string{ FrameData: { FlagDataEndStream: "END_STREAM", FlagDataPadded: "PADDED", }, FrameHeaders: { FlagHeadersEndStream: "END_STREAM", FlagHeadersEndHeaders: "END_HEADERS", FlagHeadersPadded: "PADDED", FlagHeadersPriority: "PRIORITY", }, FrameSettings: { FlagSettingsAck: "ACK", }, FramePing: { FlagPingAck: "ACK", }, FrameContinuation: { FlagContinuationEndHeaders: "END_HEADERS", }, FramePushPromise: { FlagPushPromiseEndHeaders: "END_HEADERS", FlagPushPromisePadded: "PADDED", }, } // a frameParser parses a frame given its FrameHeader and payload // bytes. The length of payload will always equal fh.Length (which // might be 0). type frameParser func(fc *frameCache, fh FrameHeader, countError func(string), payload []byte) (Frame, error) var frameParsers = [...]frameParser{ FrameData: parseDataFrame, FrameHeaders: parseHeadersFrame, FramePriority: parsePriorityFrame, FrameRSTStream: parseRSTStreamFrame, FrameSettings: parseSettingsFrame, FramePushPromise: parsePushPromise, FramePing: parsePingFrame, FrameGoAway: parseGoAwayFrame, FrameWindowUpdate: parseWindowUpdateFrame, FrameContinuation: parseContinuationFrame, FramePriorityUpdate: parsePriorityUpdateFrame, } func typeFrameParser(t FrameType) frameParser { if int(t) < len(frameParsers) { if f := frameParsers[t]; f != nil { return f } } return parseUnknownFrame } // A FrameHeader is the 9 byte header of all HTTP/2 frames. // // See https://httpwg.org/specs/rfc7540.html#FrameHeader type FrameHeader struct { valid bool // caller can access []byte fields in the Frame // Type is the 1 byte frame type. There are ten standard frame // types, but extension frame types may be written by WriteRawFrame // and will be returned by ReadFrame (as UnknownFrame). Type FrameType // Flags are the 1 byte of 8 potential bit flags per frame. // They are specific to the frame type. Flags Flags // Length is the length of the frame, not including the 9 byte header. // The maximum size is one byte less than 16MB (uint24), but only // frames up to 16KB are allowed without peer agreement. Length uint32 // StreamID is which stream this frame is for. Certain frames // are not stream-specific, in which case this field is 0. StreamID uint32 } // Header returns h. It exists so FrameHeaders can be embedded in other // specific frame types and implement the Frame interface. func (h FrameHeader) Header() FrameHeader { return h } func (h FrameHeader) String() string { var buf bytes.Buffer buf.WriteString("[FrameHeader ") h.writeDebug(&buf) buf.WriteByte(']') return buf.String() } func (h FrameHeader) writeDebug(buf *bytes.Buffer) { buf.WriteString(h.Type.String()) if h.Flags != 0 { buf.WriteString(" flags=") set := 0 for i := uint8(0); i < 8; i++ { if h.Flags&(1< 1 { buf.WriteByte('|') } name := flagName[h.Type][Flags(1<>24), byte(streamID>>16), byte(streamID>>8), byte(streamID)) } func (f *Framer) endWrite() error { // Now that we know the final size, fill in the FrameHeader in // the space previously reserved for it. Abuse append. length := len(f.wbuf) - frameHeaderLen if length >= (1 << 24) { return ErrFrameTooLarge } _ = append(f.wbuf[:0], byte(length>>16), byte(length>>8), byte(length)) if f.logWrites { f.logWrite() } n, err := f.w.Write(f.wbuf) if err == nil && n != len(f.wbuf) { err = io.ErrShortWrite } return err } func (f *Framer) logWrite() { if f.debugFramer == nil { f.debugFramerBuf = new(bytes.Buffer) f.debugFramer = NewFramer(nil, f.debugFramerBuf) f.debugFramer.logReads = false // we log it ourselves, saying "wrote" below // Let us read anything, even if we accidentally wrote it // in the wrong order: f.debugFramer.AllowIllegalReads = true } f.debugFramerBuf.Write(f.wbuf) fr, err := f.debugFramer.ReadFrame() if err != nil { f.debugWriteLoggerf("http2: Framer %p: failed to decode just-written frame", f) return } f.debugWriteLoggerf("http2: Framer %p: wrote %v", f, summarizeFrame(fr)) } func (f *Framer) writeByte(v byte) { f.wbuf = append(f.wbuf, v) } func (f *Framer) writeBytes(v []byte) { f.wbuf = append(f.wbuf, v...) } func (f *Framer) writeUint16(v uint16) { f.wbuf = append(f.wbuf, byte(v>>8), byte(v)) } func (f *Framer) writeUint32(v uint32) { f.wbuf = append(f.wbuf, byte(v>>24), byte(v>>16), byte(v>>8), byte(v)) } const ( minMaxFrameSize = 1 << 14 maxFrameSize = 1<<24 - 1 ) // SetReuseFrames allows the Framer to reuse Frames. // If called on a Framer, Frames returned by calls to ReadFrame are only // valid until the next call to ReadFrame. func (fr *Framer) SetReuseFrames() { if fr.frameCache != nil { return } fr.frameCache = &frameCache{} } type frameCache struct { dataFrame DataFrame } func (fc *frameCache) getDataFrame() *DataFrame { if fc == nil { return &DataFrame{} } return &fc.dataFrame } // NewFramer returns a Framer that writes frames to w and reads them from r. func NewFramer(w io.Writer, r io.Reader) *Framer { fr := &Framer{ w: w, r: r, countError: func(string) {}, logReads: logFrameReads, logWrites: logFrameWrites, debugReadLoggerf: log.Printf, debugWriteLoggerf: log.Printf, } fr.getReadBuf = func(size uint32) []byte { if cap(fr.readBuf) >= int(size) { return fr.readBuf[:size] } fr.readBuf = make([]byte, size) return fr.readBuf } fr.SetMaxReadFrameSize(maxFrameSize) return fr } // SetMaxReadFrameSize sets the maximum size of a frame // that will be read by a subsequent call to ReadFrame. // It is the caller's responsibility to advertise this // limit with a SETTINGS frame. func (fr *Framer) SetMaxReadFrameSize(v uint32) { if v > maxFrameSize { v = maxFrameSize } fr.maxReadSize = v } // ErrorDetail returns a more detailed error of the last error // returned by Framer.ReadFrame. For instance, if ReadFrame // returns a StreamError with code PROTOCOL_ERROR, ErrorDetail // will say exactly what was invalid. ErrorDetail is not guaranteed // to return a non-nil value and like the rest of the http2 package, // its return value is not protected by an API compatibility promise. // ErrorDetail is reset after the next call to ReadFrame. func (fr *Framer) ErrorDetail() error { return fr.errDetail } // ErrFrameTooLarge is returned from Framer.ReadFrame when the peer // sends a frame that is larger than declared with SetMaxReadFrameSize. var ErrFrameTooLarge = errors.New("http2: frame too large") // terminalReadFrameError reports whether err is an unrecoverable // error from ReadFrame and no other frames should be read. func terminalReadFrameError(err error) bool { if _, ok := err.(StreamError); ok { return false } return err != nil } // ReadFrameHeader reads the header of the next frame. // It reads the 9-byte fixed frame header, and does not read any portion of the // frame payload. The caller is responsible for consuming the payload, either // with ReadFrameForHeader or directly from the Framer's io.Reader. // // If the frame is larger than previously set with SetMaxReadFrameSize, it // returns the frame header and ErrFrameTooLarge. // // If the returned FrameHeader.StreamID is non-zero, it indicates the stream // responsible for the error. func (fr *Framer) ReadFrameHeader() (FrameHeader, error) { fr.errDetail = nil fh, err := readFrameHeader(fr.headerBuf[:], fr.r) if err != nil { return fh, err } if fh.Length > fr.maxReadSize { if fh == invalidHTTP1LookingFrameHeader() { return fh, fmt.Errorf("http2: failed reading the frame payload: %w, note that the frame header looked like an HTTP/1.1 header", ErrFrameTooLarge) } return fh, ErrFrameTooLarge } if err := fr.checkFrameOrder(fh); err != nil { return fh, err } return fh, nil } // ReadFrameForHeader reads the payload for the frame with the given FrameHeader. // // It behaves identically to ReadFrame, other than not checking the maximum // frame size. func (fr *Framer) ReadFrameForHeader(fh FrameHeader) (Frame, error) { if fr.lastFrame != nil { fr.lastFrame.invalidate() } payload := fr.getReadBuf(fh.Length) if _, err := io.ReadFull(fr.r, payload); err != nil { if fh == invalidHTTP1LookingFrameHeader() { return nil, fmt.Errorf("http2: failed reading the frame payload: %w, note that the frame header looked like an HTTP/1.1 header", err) } return nil, err } f, err := typeFrameParser(fh.Type)(fr.frameCache, fh, fr.countError, payload) if err != nil { if ce, ok := err.(connError); ok { return nil, fr.connError(ce.Code, ce.Reason) } return nil, err } fr.lastFrame = f if fr.logReads { fr.debugReadLoggerf("http2: Framer %p: read %v", fr, summarizeFrame(f)) } if fh.Type == FrameHeaders && fr.ReadMetaHeaders != nil { return fr.readMetaFrame(f.(*HeadersFrame)) } return f, nil } // ReadFrame reads a single frame. The returned Frame is only valid // until the next call to ReadFrame or ReadFrameBodyForHeader. // // If the frame is larger than previously set with SetMaxReadFrameSize, the // returned error is ErrFrameTooLarge. Other errors may be of type // ConnectionError, StreamError, or anything else from the underlying // reader. // // If ReadFrame returns an error and a non-nil Frame, the Frame's StreamID // indicates the stream responsible for the error. func (fr *Framer) ReadFrame() (Frame, error) { fh, err := fr.ReadFrameHeader() if err != nil { return nil, err } return fr.ReadFrameForHeader(fh) } // connError returns ConnectionError(code) but first // stashes away a public reason to the caller can optionally relay it // to the peer before hanging up on them. This might help others debug // their implementations. func (fr *Framer) connError(code ErrCode, reason string) error { fr.errDetail = errors.New(reason) return ConnectionError(code) } // checkFrameOrder reports an error if f is an invalid frame to return // next from ReadFrame. Mostly it checks whether HEADERS and // CONTINUATION frames are contiguous. func (fr *Framer) checkFrameOrder(fh FrameHeader) error { lastType := fr.lastFrameType fr.lastFrameType = fh.Type if fr.AllowIllegalReads { return nil } if fr.lastHeaderStream != 0 { if fh.Type != FrameContinuation { return fr.connError(ErrCodeProtocol, fmt.Sprintf("got %s for stream %d; expected CONTINUATION following %s for stream %d", fh.Type, fh.StreamID, lastType, fr.lastHeaderStream)) } if fh.StreamID != fr.lastHeaderStream { return fr.connError(ErrCodeProtocol, fmt.Sprintf("got CONTINUATION for stream %d; expected stream %d", fh.StreamID, fr.lastHeaderStream)) } } else if fh.Type == FrameContinuation { return fr.connError(ErrCodeProtocol, fmt.Sprintf("unexpected CONTINUATION for stream %d", fh.StreamID)) } switch fh.Type { case FrameHeaders, FrameContinuation: if fh.Flags.Has(FlagHeadersEndHeaders) { fr.lastHeaderStream = 0 } else { fr.lastHeaderStream = fh.StreamID } } return nil } // A DataFrame conveys arbitrary, variable-length sequences of octets // associated with a stream. // See https://httpwg.org/specs/rfc7540.html#rfc.section.6.1 type DataFrame struct { FrameHeader data []byte } func (f *DataFrame) StreamEnded() bool { return f.FrameHeader.Flags.Has(FlagDataEndStream) } // Data returns the frame's data octets, not including any padding // size byte or padding suffix bytes. // The caller must not retain the returned memory past the next // call to ReadFrame. func (f *DataFrame) Data() []byte { f.checkValid() return f.data } func parseDataFrame(fc *frameCache, fh FrameHeader, countError func(string), payload []byte) (Frame, error) { if fh.StreamID == 0 { // DATA frames MUST be associated with a stream. If a // DATA frame is received whose stream identifier // field is 0x0, the recipient MUST respond with a // connection error (Section 5.4.1) of type // PROTOCOL_ERROR. countError("frame_data_stream_0") return nil, connError{ErrCodeProtocol, "DATA frame with stream ID 0"} } f := fc.getDataFrame() f.FrameHeader = fh var padSize byte if fh.Flags.Has(FlagDataPadded) { var err error payload, padSize, err = readByte(payload) if err != nil { countError("frame_data_pad_byte_short") return nil, err } } if int(padSize) > len(payload) { // If the length of the padding is greater than the // length of the frame payload, the recipient MUST // treat this as a connection error. // Filed: https://github.com/http2/http2-spec/issues/610 countError("frame_data_pad_too_big") return nil, connError{ErrCodeProtocol, "pad size larger than data payload"} } f.data = payload[:len(payload)-int(padSize)] return f, nil } var ( errStreamID = errors.New("invalid stream ID") errDepStreamID = errors.New("invalid dependent stream ID") errPadLength = errors.New("pad length too large") errPadBytes = errors.New("padding bytes must all be zeros unless AllowIllegalWrites is enabled") ) func validStreamIDOrZero(streamID uint32) bool { return streamID&(1<<31) == 0 } func validStreamID(streamID uint32) bool { return streamID != 0 && streamID&(1<<31) == 0 } // WriteData writes a DATA frame. // // It will perform exactly one Write to the underlying Writer. // It is the caller's responsibility not to violate the maximum frame size // and to not call other Write methods concurrently. func (f *Framer) WriteData(streamID uint32, endStream bool, data []byte) error { return f.WriteDataPadded(streamID, endStream, data, nil) } // WriteDataPadded writes a DATA frame with optional padding. // // If pad is nil, the padding bit is not sent. // The length of pad must not exceed 255 bytes. // The bytes of pad must all be zero, unless f.AllowIllegalWrites is set. // // It will perform exactly one Write to the underlying Writer. // It is the caller's responsibility not to violate the maximum frame size // and to not call other Write methods concurrently. func (f *Framer) WriteDataPadded(streamID uint32, endStream bool, data, pad []byte) error { if err := f.startWriteDataPadded(streamID, endStream, data, pad); err != nil { return err } return f.endWrite() } // startWriteDataPadded is WriteDataPadded, but only writes the frame to the Framer's internal buffer. // The caller should call endWrite to flush the frame to the underlying writer. func (f *Framer) startWriteDataPadded(streamID uint32, endStream bool, data, pad []byte) error { if !validStreamID(streamID) && !f.AllowIllegalWrites { return errStreamID } if len(pad) > 0 { if len(pad) > 255 { return errPadLength } if !f.AllowIllegalWrites { for _, b := range pad { if b != 0 { // "Padding octets MUST be set to zero when sending." return errPadBytes } } } } var flags Flags if endStream { flags |= FlagDataEndStream } if pad != nil { flags |= FlagDataPadded } f.startWrite(FrameData, flags, streamID) if pad != nil { f.wbuf = append(f.wbuf, byte(len(pad))) } f.wbuf = append(f.wbuf, data...) f.wbuf = append(f.wbuf, pad...) return nil } // A SettingsFrame conveys configuration parameters that affect how // endpoints communicate, such as preferences and constraints on peer // behavior. // // See https://httpwg.org/specs/rfc7540.html#SETTINGS type SettingsFrame struct { FrameHeader p []byte } func parseSettingsFrame(_ *frameCache, fh FrameHeader, countError func(string), p []byte) (Frame, error) { if fh.Flags.Has(FlagSettingsAck) && fh.Length > 0 { // When this (ACK 0x1) bit is set, the payload of the // SETTINGS frame MUST be empty. Receipt of a // SETTINGS frame with the ACK flag set and a length // field value other than 0 MUST be treated as a // connection error (Section 5.4.1) of type // FRAME_SIZE_ERROR. countError("frame_settings_ack_with_length") return nil, ConnectionError(ErrCodeFrameSize) } if fh.StreamID != 0 { // SETTINGS frames always apply to a connection, // never a single stream. The stream identifier for a // SETTINGS frame MUST be zero (0x0). If an endpoint // receives a SETTINGS frame whose stream identifier // field is anything other than 0x0, the endpoint MUST // respond with a connection error (Section 5.4.1) of // type PROTOCOL_ERROR. countError("frame_settings_has_stream") return nil, ConnectionError(ErrCodeProtocol) } if len(p)%6 != 0 { countError("frame_settings_mod_6") // Expecting even number of 6 byte settings. return nil, ConnectionError(ErrCodeFrameSize) } f := &SettingsFrame{FrameHeader: fh, p: p} if v, ok := f.Value(SettingInitialWindowSize); ok && v > (1<<31)-1 { countError("frame_settings_window_size_too_big") // Values above the maximum flow control window size of 2^31 - 1 MUST // be treated as a connection error (Section 5.4.1) of type // FLOW_CONTROL_ERROR. return nil, ConnectionError(ErrCodeFlowControl) } return f, nil } func (f *SettingsFrame) IsAck() bool { return f.FrameHeader.Flags.Has(FlagSettingsAck) } func (f *SettingsFrame) Value(id SettingID) (v uint32, ok bool) { f.checkValid() for i := 0; i < f.NumSettings(); i++ { if s := f.Setting(i); s.ID == id { return s.Val, true } } return 0, false } // Setting returns the setting from the frame at the given 0-based index. // The index must be >= 0 and less than f.NumSettings(). func (f *SettingsFrame) Setting(i int) Setting { buf := f.p return Setting{ ID: SettingID(binary.BigEndian.Uint16(buf[i*6 : i*6+2])), Val: binary.BigEndian.Uint32(buf[i*6+2 : i*6+6]), } } func (f *SettingsFrame) NumSettings() int { return len(f.p) / 6 } // HasDuplicates reports whether f contains any duplicate setting IDs. func (f *SettingsFrame) HasDuplicates() bool { num := f.NumSettings() if num == 0 { return false } // If it's small enough (the common case), just do the n^2 // thing and avoid a map allocation. if num < 10 { for i := 0; i < num; i++ { idi := f.Setting(i).ID for j := i + 1; j < num; j++ { idj := f.Setting(j).ID if idi == idj { return true } } } return false } seen := map[SettingID]bool{} for i := 0; i < num; i++ { id := f.Setting(i).ID if seen[id] { return true } seen[id] = true } return false } // ForeachSetting runs fn for each setting. // It stops and returns the first error. func (f *SettingsFrame) ForeachSetting(fn func(Setting) error) error { f.checkValid() for i := 0; i < f.NumSettings(); i++ { if err := fn(f.Setting(i)); err != nil { return err } } return nil } // WriteSettings writes a SETTINGS frame with zero or more settings // specified and the ACK bit not set. // // It will perform exactly one Write to the underlying Writer. // It is the caller's responsibility to not call other Write methods concurrently. func (f *Framer) WriteSettings(settings ...Setting) error { f.startWrite(FrameSettings, 0, 0) for _, s := range settings { f.writeUint16(uint16(s.ID)) f.writeUint32(s.Val) } return f.endWrite() } // WriteSettingsAck writes an empty SETTINGS frame with the ACK bit set. // // It will perform exactly one Write to the underlying Writer. // It is the caller's responsibility to not call other Write methods concurrently. func (f *Framer) WriteSettingsAck() error { f.startWrite(FrameSettings, FlagSettingsAck, 0) return f.endWrite() } // A PingFrame is a mechanism for measuring a minimal round trip time // from the sender, as well as determining whether an idle connection // is still functional. // See https://httpwg.org/specs/rfc7540.html#rfc.section.6.7 type PingFrame struct { FrameHeader Data [8]byte } func (f *PingFrame) IsAck() bool { return f.Flags.Has(FlagPingAck) } func parsePingFrame(_ *frameCache, fh FrameHeader, countError func(string), payload []byte) (Frame, error) { if len(payload) != 8 { countError("frame_ping_length") return nil, ConnectionError(ErrCodeFrameSize) } if fh.StreamID != 0 { countError("frame_ping_has_stream") return nil, ConnectionError(ErrCodeProtocol) } f := &PingFrame{FrameHeader: fh} copy(f.Data[:], payload) return f, nil } func (f *Framer) WritePing(ack bool, data [8]byte) error { var flags Flags if ack { flags = FlagPingAck } f.startWrite(FramePing, flags, 0) f.writeBytes(data[:]) return f.endWrite() } // A GoAwayFrame informs the remote peer to stop creating streams on this connection. // See https://httpwg.org/specs/rfc7540.html#rfc.section.6.8 type GoAwayFrame struct { FrameHeader LastStreamID uint32 ErrCode ErrCode debugData []byte } // DebugData returns any debug data in the GOAWAY frame. Its contents // are not defined. // The caller must not retain the returned memory past the next // call to ReadFrame. func (f *GoAwayFrame) DebugData() []byte { f.checkValid() return f.debugData } func parseGoAwayFrame(_ *frameCache, fh FrameHeader, countError func(string), p []byte) (Frame, error) { if fh.StreamID != 0 { countError("frame_goaway_has_stream") return nil, ConnectionError(ErrCodeProtocol) } if len(p) < 8 { countError("frame_goaway_short") return nil, ConnectionError(ErrCodeFrameSize) } return &GoAwayFrame{ FrameHeader: fh, LastStreamID: binary.BigEndian.Uint32(p[:4]) & (1<<31 - 1), ErrCode: ErrCode(binary.BigEndian.Uint32(p[4:8])), debugData: p[8:], }, nil } func (f *Framer) WriteGoAway(maxStreamID uint32, code ErrCode, debugData []byte) error { f.startWrite(FrameGoAway, 0, 0) f.writeUint32(maxStreamID & (1<<31 - 1)) f.writeUint32(uint32(code)) f.writeBytes(debugData) return f.endWrite() } // An UnknownFrame is the frame type returned when the frame type is unknown // or no specific frame type parser exists. type UnknownFrame struct { FrameHeader p []byte } // Payload returns the frame's payload (after the header). It is not // valid to call this method after a subsequent call to // Framer.ReadFrame, nor is it valid to retain the returned slice. // The memory is owned by the Framer and is invalidated when the next // frame is read. func (f *UnknownFrame) Payload() []byte { f.checkValid() return f.p } func parseUnknownFrame(_ *frameCache, fh FrameHeader, countError func(string), p []byte) (Frame, error) { return &UnknownFrame{fh, p}, nil } // A WindowUpdateFrame is used to implement flow control. // See https://httpwg.org/specs/rfc7540.html#rfc.section.6.9 type WindowUpdateFrame struct { FrameHeader Increment uint32 // never read with high bit set } func parseWindowUpdateFrame(_ *frameCache, fh FrameHeader, countError func(string), p []byte) (Frame, error) { if len(p) != 4 { countError("frame_windowupdate_bad_len") return nil, ConnectionError(ErrCodeFrameSize) } inc := binary.BigEndian.Uint32(p[:4]) & 0x7fffffff // mask off high reserved bit if inc == 0 { // A receiver MUST treat the receipt of a // WINDOW_UPDATE frame with an flow control window // increment of 0 as a stream error (Section 5.4.2) of // type PROTOCOL_ERROR; errors on the connection flow // control window MUST be treated as a connection // error (Section 5.4.1). if fh.StreamID == 0 { countError("frame_windowupdate_zero_inc_conn") return nil, ConnectionError(ErrCodeProtocol) } countError("frame_windowupdate_zero_inc_stream") return nil, streamError(fh.StreamID, ErrCodeProtocol) } return &WindowUpdateFrame{ FrameHeader: fh, Increment: inc, }, nil } // WriteWindowUpdate writes a WINDOW_UPDATE frame. // The increment value must be between 1 and 2,147,483,647, inclusive. // If the Stream ID is zero, the window update applies to the // connection as a whole. func (f *Framer) WriteWindowUpdate(streamID, incr uint32) error { // "The legal range for the increment to the flow control window is 1 to 2^31-1 (2,147,483,647) octets." if (incr < 1 || incr > 2147483647) && !f.AllowIllegalWrites { return errors.New("illegal window increment value") } f.startWrite(FrameWindowUpdate, 0, streamID) f.writeUint32(incr) return f.endWrite() } // A HeadersFrame is used to open a stream and additionally carries a // header block fragment. type HeadersFrame struct { FrameHeader // Priority is set if FlagHeadersPriority is set in the FrameHeader. Priority PriorityParam headerFragBuf []byte // not owned } func (f *HeadersFrame) HeaderBlockFragment() []byte { f.checkValid() return f.headerFragBuf } func (f *HeadersFrame) HeadersEnded() bool { return f.FrameHeader.Flags.Has(FlagHeadersEndHeaders) } func (f *HeadersFrame) StreamEnded() bool { return f.FrameHeader.Flags.Has(FlagHeadersEndStream) } func (f *HeadersFrame) HasPriority() bool { return f.FrameHeader.Flags.Has(FlagHeadersPriority) } func parseHeadersFrame(_ *frameCache, fh FrameHeader, countError func(string), p []byte) (_ Frame, err error) { hf := &HeadersFrame{ FrameHeader: fh, } if fh.StreamID == 0 { // HEADERS frames MUST be associated with a stream. If a HEADERS frame // is received whose stream identifier field is 0x0, the recipient MUST // respond with a connection error (Section 5.4.1) of type // PROTOCOL_ERROR. countError("frame_headers_zero_stream") return nil, connError{ErrCodeProtocol, "HEADERS frame with stream ID 0"} } var padLength uint8 if fh.Flags.Has(FlagHeadersPadded) { if p, padLength, err = readByte(p); err != nil { countError("frame_headers_pad_short") return } } if fh.Flags.Has(FlagHeadersPriority) { var v uint32 p, v, err = readUint32(p) if err != nil { countError("frame_headers_prio_short") return nil, err } hf.Priority.StreamDep = v & 0x7fffffff hf.Priority.Exclusive = (v != hf.Priority.StreamDep) // high bit was set p, hf.Priority.Weight, err = readByte(p) if err != nil { countError("frame_headers_prio_weight_short") return nil, err } } if len(p)-int(padLength) < 0 { countError("frame_headers_pad_too_big") return nil, streamError(fh.StreamID, ErrCodeProtocol) } hf.headerFragBuf = p[:len(p)-int(padLength)] return hf, nil } // HeadersFrameParam are the parameters for writing a HEADERS frame. type HeadersFrameParam struct { // StreamID is the required Stream ID to initiate. StreamID uint32 // BlockFragment is part (or all) of a Header Block. BlockFragment []byte // EndStream indicates that the header block is the last that // the endpoint will send for the identified stream. Setting // this flag causes the stream to enter one of "half closed" // states. EndStream bool // EndHeaders indicates that this frame contains an entire // header block and is not followed by any // CONTINUATION frames. EndHeaders bool // PadLength is the optional number of bytes of zeros to add // to this frame. PadLength uint8 // Priority, if non-zero, includes stream priority information // in the HEADER frame. Priority PriorityParam } // WriteHeaders writes a single HEADERS frame. // // This is a low-level header writing method. Encoding headers and // splitting them into any necessary CONTINUATION frames is handled // elsewhere. // // It will perform exactly one Write to the underlying Writer. // It is the caller's responsibility to not call other Write methods concurrently. func (f *Framer) WriteHeaders(p HeadersFrameParam) error { if !validStreamID(p.StreamID) && !f.AllowIllegalWrites { return errStreamID } var flags Flags if p.PadLength != 0 { flags |= FlagHeadersPadded } if p.EndStream { flags |= FlagHeadersEndStream } if p.EndHeaders { flags |= FlagHeadersEndHeaders } if !p.Priority.IsZero() { flags |= FlagHeadersPriority } f.startWrite(FrameHeaders, flags, p.StreamID) if p.PadLength != 0 { f.writeByte(p.PadLength) } if !p.Priority.IsZero() { v := p.Priority.StreamDep if !validStreamIDOrZero(v) && !f.AllowIllegalWrites { return errDepStreamID } if p.Priority.Exclusive { v |= 1 << 31 } f.writeUint32(v) f.writeByte(p.Priority.Weight) } f.wbuf = append(f.wbuf, p.BlockFragment...) f.wbuf = append(f.wbuf, padZeros[:p.PadLength]...) return f.endWrite() } // A PriorityFrame specifies the sender-advised priority of a stream. // See https://httpwg.org/specs/rfc7540.html#rfc.section.6.3 type PriorityFrame struct { FrameHeader PriorityParam } // defaultRFC9218Priority determines what priority we should use as the default // value. // // According to RFC 9218, by default, streams should be given an urgency of 3 // and should be non-incremental. However, making streams non-incremental by // default would be a huge change to our historical behavior where we would // round-robin writes across streams. When streams are non-incremental, we // would process streams of the same urgency one-by-one to completion instead. // // To avoid such a sudden change which might break some HTTP/2 users, this // function allows the caller to specify whether they can actually use the // default value as specified in RFC 9218. If not, this function will return a // priority value where streams are incremental by default instead: effectively // a round-robin between stream of the same urgency. // // As an example, a server might not be able to use the RFC 9218 default value // when it's not sure that the client it is serving is aware of RFC 9218. func defaultRFC9218Priority(canUseDefault bool) PriorityParam { if canUseDefault { return PriorityParam{ urgency: 3, incremental: 0, } } return PriorityParam{ urgency: 3, incremental: 1, } } // Note that HTTP/2 has had two different prioritization schemes, and // PriorityParam struct below is a superset of both schemes. The exported // symbols are from RFC 7540 and the non-exported ones are from RFC 9218. // PriorityParam are the stream prioritization parameters. type PriorityParam struct { // StreamDep is a 31-bit stream identifier for the // stream that this stream depends on. Zero means no // dependency. StreamDep uint32 // Exclusive is whether the dependency is exclusive. Exclusive bool // Weight is the stream's zero-indexed weight. It should be // set together with StreamDep, or neither should be set. Per // the spec, "Add one to the value to obtain a weight between // 1 and 256." Weight uint8 // "The urgency (u) parameter value is Integer (see Section 3.3.1 of // [STRUCTURED-FIELDS]), between 0 and 7 inclusive, in descending order of // priority. The default is 3." urgency uint8 // "The incremental (i) parameter value is Boolean (see Section 3.3.6 of // [STRUCTURED-FIELDS]). It indicates if an HTTP response can be processed // incrementally, i.e., provide some meaningful output as chunks of the // response arrive." // // We use uint8 (i.e. 0 is false, 1 is true) instead of bool so we can // avoid unnecessary type conversions and because either type takes 1 byte. incremental uint8 } func (p PriorityParam) IsZero() bool { return p == PriorityParam{} } func parsePriorityFrame(_ *frameCache, fh FrameHeader, countError func(string), payload []byte) (Frame, error) { if fh.StreamID == 0 { countError("frame_priority_zero_stream") return nil, connError{ErrCodeProtocol, "PRIORITY frame with stream ID 0"} } if len(payload) != 5 { countError("frame_priority_bad_length") return nil, connError{ErrCodeFrameSize, fmt.Sprintf("PRIORITY frame payload size was %d; want 5", len(payload))} } v := binary.BigEndian.Uint32(payload[:4]) streamID := v & 0x7fffffff // mask off high bit return &PriorityFrame{ FrameHeader: fh, PriorityParam: PriorityParam{ Weight: payload[4], StreamDep: streamID, Exclusive: streamID != v, // was high bit set? }, }, nil } // WritePriority writes a PRIORITY frame. // // It will perform exactly one Write to the underlying Writer. // It is the caller's responsibility to not call other Write methods concurrently. func (f *Framer) WritePriority(streamID uint32, p PriorityParam) error { if !validStreamID(streamID) && !f.AllowIllegalWrites { return errStreamID } if !validStreamIDOrZero(p.StreamDep) { return errDepStreamID } f.startWrite(FramePriority, 0, streamID) v := p.StreamDep if p.Exclusive { v |= 1 << 31 } f.writeUint32(v) f.writeByte(p.Weight) return f.endWrite() } // PriorityUpdateFrame is a PRIORITY_UPDATE frame as described in // https://www.rfc-editor.org/rfc/rfc9218.html#name-the-priority_update-frame. type PriorityUpdateFrame struct { FrameHeader Priority string PrioritizedStreamID uint32 } func parseRFC9218Priority(s string, canUseDefault bool) (p PriorityParam, ok bool) { p = defaultRFC9218Priority(canUseDefault) ok = httpsfv.ParseDictionary(s, func(key, val, _ string) { switch key { case "u": if u, ok := httpsfv.ParseInteger(val); ok && u >= 0 && u <= 7 { p.urgency = uint8(u) } case "i": if i, ok := httpsfv.ParseBoolean(val); ok { if i { p.incremental = 1 } else { p.incremental = 0 } } } }) if !ok { return defaultRFC9218Priority(canUseDefault), ok } return p, true } func parsePriorityUpdateFrame(_ *frameCache, fh FrameHeader, countError func(string), payload []byte) (Frame, error) { if fh.StreamID != 0 { countError("frame_priority_update_non_zero_stream") return nil, connError{ErrCodeProtocol, "PRIORITY_UPDATE frame with non-zero stream ID"} } if len(payload) < 4 { countError("frame_priority_update_bad_length") return nil, connError{ErrCodeFrameSize, fmt.Sprintf("PRIORITY_UPDATE frame payload size was %d; want at least 4", len(payload))} } v := binary.BigEndian.Uint32(payload[:4]) streamID := v & 0x7fffffff // mask off high bit if streamID == 0 { countError("frame_priority_update_prioritizing_zero_stream") return nil, connError{ErrCodeProtocol, "PRIORITY_UPDATE frame with prioritized stream ID of zero"} } return &PriorityUpdateFrame{ FrameHeader: fh, PrioritizedStreamID: streamID, Priority: string(payload[4:]), }, nil } // WritePriorityUpdate writes a PRIORITY_UPDATE frame. // // It will perform exactly one Write to the underlying Writer. // It is the caller's responsibility to not call other Write methods concurrently. func (f *Framer) WritePriorityUpdate(streamID uint32, priority string) error { if !validStreamID(streamID) && !f.AllowIllegalWrites { return errStreamID } f.startWrite(FramePriorityUpdate, 0, 0) f.writeUint32(streamID) f.writeBytes([]byte(priority)) return f.endWrite() } // A RSTStreamFrame allows for abnormal termination of a stream. // See https://httpwg.org/specs/rfc7540.html#rfc.section.6.4 type RSTStreamFrame struct { FrameHeader ErrCode ErrCode } func parseRSTStreamFrame(_ *frameCache, fh FrameHeader, countError func(string), p []byte) (Frame, error) { if len(p) != 4 { countError("frame_rststream_bad_len") return nil, ConnectionError(ErrCodeFrameSize) } if fh.StreamID == 0 { countError("frame_rststream_zero_stream") return nil, ConnectionError(ErrCodeProtocol) } return &RSTStreamFrame{fh, ErrCode(binary.BigEndian.Uint32(p[:4]))}, nil } // WriteRSTStream writes a RST_STREAM frame. // // It will perform exactly one Write to the underlying Writer. // It is the caller's responsibility to not call other Write methods concurrently. func (f *Framer) WriteRSTStream(streamID uint32, code ErrCode) error { if !validStreamID(streamID) && !f.AllowIllegalWrites { return errStreamID } f.startWrite(FrameRSTStream, 0, streamID) f.writeUint32(uint32(code)) return f.endWrite() } // A ContinuationFrame is used to continue a sequence of header block fragments. // See https://httpwg.org/specs/rfc7540.html#rfc.section.6.10 type ContinuationFrame struct { FrameHeader headerFragBuf []byte } func parseContinuationFrame(_ *frameCache, fh FrameHeader, countError func(string), p []byte) (Frame, error) { if fh.StreamID == 0 { countError("frame_continuation_zero_stream") return nil, connError{ErrCodeProtocol, "CONTINUATION frame with stream ID 0"} } return &ContinuationFrame{fh, p}, nil } func (f *ContinuationFrame) HeaderBlockFragment() []byte { f.checkValid() return f.headerFragBuf } func (f *ContinuationFrame) HeadersEnded() bool { return f.FrameHeader.Flags.Has(FlagContinuationEndHeaders) } // WriteContinuation writes a CONTINUATION frame. // // It will perform exactly one Write to the underlying Writer. // It is the caller's responsibility to not call other Write methods concurrently. func (f *Framer) WriteContinuation(streamID uint32, endHeaders bool, headerBlockFragment []byte) error { if !validStreamID(streamID) && !f.AllowIllegalWrites { return errStreamID } var flags Flags if endHeaders { flags |= FlagContinuationEndHeaders } f.startWrite(FrameContinuation, flags, streamID) f.wbuf = append(f.wbuf, headerBlockFragment...) return f.endWrite() } // A PushPromiseFrame is used to initiate a server stream. // See https://httpwg.org/specs/rfc7540.html#rfc.section.6.6 type PushPromiseFrame struct { FrameHeader PromiseID uint32 headerFragBuf []byte // not owned } func (f *PushPromiseFrame) HeaderBlockFragment() []byte { f.checkValid() return f.headerFragBuf } func (f *PushPromiseFrame) HeadersEnded() bool { return f.FrameHeader.Flags.Has(FlagPushPromiseEndHeaders) } func parsePushPromise(_ *frameCache, fh FrameHeader, countError func(string), p []byte) (_ Frame, err error) { pp := &PushPromiseFrame{ FrameHeader: fh, } if pp.StreamID == 0 { // PUSH_PROMISE frames MUST be associated with an existing, // peer-initiated stream. The stream identifier of a // PUSH_PROMISE frame indicates the stream it is associated // with. If the stream identifier field specifies the value // 0x0, a recipient MUST respond with a connection error // (Section 5.4.1) of type PROTOCOL_ERROR. countError("frame_pushpromise_zero_stream") return nil, ConnectionError(ErrCodeProtocol) } // The PUSH_PROMISE frame includes optional padding. // Padding fields and flags are identical to those defined for DATA frames var padLength uint8 if fh.Flags.Has(FlagPushPromisePadded) { if p, padLength, err = readByte(p); err != nil { countError("frame_pushpromise_pad_short") return } } p, pp.PromiseID, err = readUint32(p) if err != nil { countError("frame_pushpromise_promiseid_short") return } pp.PromiseID = pp.PromiseID & (1<<31 - 1) if int(padLength) > len(p) { // like the DATA frame, error out if padding is longer than the body. countError("frame_pushpromise_pad_too_big") return nil, ConnectionError(ErrCodeProtocol) } pp.headerFragBuf = p[:len(p)-int(padLength)] return pp, nil } // PushPromiseParam are the parameters for writing a PUSH_PROMISE frame. type PushPromiseParam struct { // StreamID is the required Stream ID to initiate. StreamID uint32 // PromiseID is the required Stream ID which this // Push Promises PromiseID uint32 // BlockFragment is part (or all) of a Header Block. BlockFragment []byte // EndHeaders indicates that this frame contains an entire // header block and is not followed by any // CONTINUATION frames. EndHeaders bool // PadLength is the optional number of bytes of zeros to add // to this frame. PadLength uint8 } // WritePushPromise writes a single PushPromise Frame. // // As with Header Frames, This is the low level call for writing // individual frames. Continuation frames are handled elsewhere. // // It will perform exactly one Write to the underlying Writer. // It is the caller's responsibility to not call other Write methods concurrently. func (f *Framer) WritePushPromise(p PushPromiseParam) error { if !validStreamID(p.StreamID) && !f.AllowIllegalWrites { return errStreamID } var flags Flags if p.PadLength != 0 { flags |= FlagPushPromisePadded } if p.EndHeaders { flags |= FlagPushPromiseEndHeaders } f.startWrite(FramePushPromise, flags, p.StreamID) if p.PadLength != 0 { f.writeByte(p.PadLength) } if !validStreamID(p.PromiseID) && !f.AllowIllegalWrites { return errStreamID } f.writeUint32(p.PromiseID) f.wbuf = append(f.wbuf, p.BlockFragment...) f.wbuf = append(f.wbuf, padZeros[:p.PadLength]...) return f.endWrite() } // WriteRawFrame writes a raw frame. This can be used to write // extension frames unknown to this package. func (f *Framer) WriteRawFrame(t FrameType, flags Flags, streamID uint32, payload []byte) error { f.startWrite(t, flags, streamID) f.writeBytes(payload) return f.endWrite() } func readByte(p []byte) (remain []byte, b byte, err error) { if len(p) == 0 { return nil, 0, io.ErrUnexpectedEOF } return p[1:], p[0], nil } func readUint32(p []byte) (remain []byte, v uint32, err error) { if len(p) < 4 { return nil, 0, io.ErrUnexpectedEOF } return p[4:], binary.BigEndian.Uint32(p[:4]), nil } type streamEnder interface { StreamEnded() bool } type headersEnder interface { HeadersEnded() bool } type headersOrContinuation interface { headersEnder HeaderBlockFragment() []byte } // A MetaHeadersFrame is the representation of one HEADERS frame and // zero or more contiguous CONTINUATION frames and the decoding of // their HPACK-encoded contents. // // This type of frame does not appear on the wire and is only returned // by the Framer when Framer.ReadMetaHeaders is set. type MetaHeadersFrame struct { *HeadersFrame // Fields are the fields contained in the HEADERS and // CONTINUATION frames. The underlying slice is owned by the // Framer and must not be retained after the next call to // ReadFrame. // // Fields are guaranteed to be in the correct http2 order and // not have unknown pseudo header fields or invalid header // field names or values. Required pseudo header fields may be // missing, however. Use the MetaHeadersFrame.Pseudo accessor // method access pseudo headers. Fields []hpack.HeaderField // Truncated is whether the max header list size limit was hit // and Fields is incomplete. The hpack decoder state is still // valid, however. Truncated bool } // PseudoValue returns the given pseudo header field's value. // The provided pseudo field should not contain the leading colon. func (mh *MetaHeadersFrame) PseudoValue(pseudo string) string { for _, hf := range mh.Fields { if !hf.IsPseudo() { return "" } if hf.Name[1:] == pseudo { return hf.Value } } return "" } // RegularFields returns the regular (non-pseudo) header fields of mh. // The caller does not own the returned slice. func (mh *MetaHeadersFrame) RegularFields() []hpack.HeaderField { for i, hf := range mh.Fields { if !hf.IsPseudo() { return mh.Fields[i:] } } return nil } // PseudoFields returns the pseudo header fields of mh. // The caller does not own the returned slice. func (mh *MetaHeadersFrame) PseudoFields() []hpack.HeaderField { for i, hf := range mh.Fields { if !hf.IsPseudo() { return mh.Fields[:i] } } return mh.Fields } func (mh *MetaHeadersFrame) rfc9218Priority(priorityAware bool) (p PriorityParam, priorityAwareAfter, hasIntermediary bool) { var s string for _, field := range mh.Fields { if field.Name == "priority" { s = field.Value priorityAware = true } if slices.Contains([]string{"via", "forwarded", "x-forwarded-for"}, field.Name) { hasIntermediary = true } } // No need to check for ok. parseRFC9218Priority will return a default // value if there is no priority field or if the field cannot be parsed. p, _ = parseRFC9218Priority(s, priorityAware && !hasIntermediary) return p, priorityAware, hasIntermediary } func (mh *MetaHeadersFrame) checkPseudos() error { var isRequest, isResponse bool pf := mh.PseudoFields() for i, hf := range pf { switch hf.Name { case ":method", ":path", ":scheme", ":authority", ":protocol": isRequest = true case ":status": isResponse = true default: return pseudoHeaderError(hf.Name) } // Check for duplicates. // This would be a bad algorithm, but N is 5. // And this doesn't allocate. for _, hf2 := range pf[:i] { if hf.Name == hf2.Name { return duplicatePseudoHeaderError(hf.Name) } } } if isRequest && isResponse { return errMixPseudoHeaderTypes } return nil } func (fr *Framer) maxHeaderStringLen() int { v := int(fr.maxHeaderListSize()) if v < 0 { // If maxHeaderListSize overflows an int, use no limit (0). return 0 } return v } // readMetaFrame returns 0 or more CONTINUATION frames from fr and // merge them into the provided hf and returns a MetaHeadersFrame // with the decoded hpack values. func (fr *Framer) readMetaFrame(hf *HeadersFrame) (Frame, error) { if fr.AllowIllegalReads { return nil, errors.New("illegal use of AllowIllegalReads with ReadMetaHeaders") } mh := &MetaHeadersFrame{ HeadersFrame: hf, } var remainSize = fr.maxHeaderListSize() var sawRegular bool var invalid error // pseudo header field errors hdec := fr.ReadMetaHeaders hdec.SetEmitEnabled(true) hdec.SetMaxStringLength(fr.maxHeaderStringLen()) hdec.SetEmitFunc(func(hf hpack.HeaderField) { if VerboseLogs && fr.logReads { fr.debugReadLoggerf("http2: decoded hpack field %+v", hf) } if !httpguts.ValidHeaderFieldValue(hf.Value) { // Don't include the value in the error, because it may be sensitive. invalid = headerFieldValueError(hf.Name) } isPseudo := strings.HasPrefix(hf.Name, ":") if isPseudo { if sawRegular { invalid = errPseudoAfterRegular } } else { sawRegular = true if !validWireHeaderFieldName(hf.Name) { invalid = headerFieldNameError(hf.Name) } } if invalid != nil { hdec.SetEmitEnabled(false) return } size := hf.Size() if size > remainSize { hdec.SetEmitEnabled(false) mh.Truncated = true remainSize = 0 return } remainSize -= size mh.Fields = append(mh.Fields, hf) }) // Lose reference to MetaHeadersFrame: defer hdec.SetEmitFunc(func(hf hpack.HeaderField) {}) var hc headersOrContinuation = hf for { frag := hc.HeaderBlockFragment() // Avoid parsing large amounts of headers that we will then discard. // If the sender exceeds the max header list size by too much, // skip parsing the fragment and close the connection. // // "Too much" is either any CONTINUATION frame after we've already // exceeded the max header list size (in which case remainSize is 0), // or a frame whose encoded size is more than twice the remaining // header list bytes we're willing to accept. if int64(len(frag)) > int64(2*remainSize) { if VerboseLogs { log.Printf("http2: header list too large") } // It would be nice to send a RST_STREAM before sending the GOAWAY, // but the structure of the server's frame writer makes this difficult. return mh, ConnectionError(ErrCodeProtocol) } // Also close the connection after any CONTINUATION frame following an // invalid header, since we stop tracking the size of the headers after // an invalid one. if invalid != nil { if VerboseLogs { log.Printf("http2: invalid header: %v", invalid) } // It would be nice to send a RST_STREAM before sending the GOAWAY, // but the structure of the server's frame writer makes this difficult. return mh, ConnectionError(ErrCodeProtocol) } if _, err := hdec.Write(frag); err != nil { return mh, ConnectionError(ErrCodeCompression) } if hc.HeadersEnded() { break } if f, err := fr.ReadFrame(); err != nil { return nil, err } else { hc = f.(*ContinuationFrame) // guaranteed by checkFrameOrder } } mh.HeadersFrame.headerFragBuf = nil mh.HeadersFrame.invalidate() if err := hdec.Close(); err != nil { return mh, ConnectionError(ErrCodeCompression) } if invalid != nil { fr.errDetail = invalid if VerboseLogs { log.Printf("http2: invalid header: %v", invalid) } return nil, StreamError{mh.StreamID, ErrCodeProtocol, invalid} } if err := mh.checkPseudos(); err != nil { fr.errDetail = err if VerboseLogs { log.Printf("http2: invalid pseudo headers: %v", err) } return nil, StreamError{mh.StreamID, ErrCodeProtocol, err} } return mh, nil } func summarizeFrame(f Frame) string { var buf bytes.Buffer f.Header().writeDebug(&buf) switch f := f.(type) { case *SettingsFrame: n := 0 f.ForeachSetting(func(s Setting) error { n++ if n == 1 { buf.WriteString(", settings:") } fmt.Fprintf(&buf, " %v=%v,", s.ID, s.Val) return nil }) if n > 0 { buf.Truncate(buf.Len() - 1) // remove trailing comma } case *DataFrame: data := f.Data() const max = 256 if len(data) > max { data = data[:max] } fmt.Fprintf(&buf, " data=%q", data) if len(f.Data()) > max { fmt.Fprintf(&buf, " (%d bytes omitted)", len(f.Data())-max) } case *WindowUpdateFrame: if f.StreamID == 0 { buf.WriteString(" (conn)") } fmt.Fprintf(&buf, " incr=%v", f.Increment) case *PingFrame: fmt.Fprintf(&buf, " ping=%q", f.Data[:]) case *GoAwayFrame: fmt.Fprintf(&buf, " LastStreamID=%v ErrCode=%v Debug=%q", f.LastStreamID, f.ErrCode, f.debugData) case *RSTStreamFrame: fmt.Fprintf(&buf, " ErrCode=%v", f.ErrCode) } return buf.String() } ================================================ FILE: vendor/golang.org/x/net/http2/gotrack.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Defensive debug-only utility to track that functions run on the // goroutine that they're supposed to. package http2 import ( "bytes" "errors" "fmt" "os" "runtime" "strconv" "sync" "sync/atomic" ) var DebugGoroutines = os.Getenv("DEBUG_HTTP2_GOROUTINES") == "1" // Setting DebugGoroutines to false during a test to disable goroutine debugging // results in race detector complaints when a test leaves goroutines running before // returning. Tests shouldn't do this, of course, but when they do it generally shows // up as infrequent, hard-to-debug flakes. (See #66519.) // // Disable goroutine debugging during individual tests with an atomic bool. // (Note that it's safe to enable/disable debugging mid-test, so the actual race condition // here is harmless.) var disableDebugGoroutines atomic.Bool type goroutineLock uint64 func newGoroutineLock() goroutineLock { if !DebugGoroutines || disableDebugGoroutines.Load() { return 0 } return goroutineLock(curGoroutineID()) } func (g goroutineLock) check() { if !DebugGoroutines || disableDebugGoroutines.Load() { return } if curGoroutineID() != uint64(g) { panic("running on the wrong goroutine") } } func (g goroutineLock) checkNotOn() { if !DebugGoroutines || disableDebugGoroutines.Load() { return } if curGoroutineID() == uint64(g) { panic("running on the wrong goroutine") } } var goroutineSpace = []byte("goroutine ") func curGoroutineID() uint64 { bp := littleBuf.Get().(*[]byte) defer littleBuf.Put(bp) b := *bp b = b[:runtime.Stack(b, false)] // Parse the 4707 out of "goroutine 4707 [" b = bytes.TrimPrefix(b, goroutineSpace) i := bytes.IndexByte(b, ' ') if i < 0 { panic(fmt.Sprintf("No space found in %q", b)) } b = b[:i] n, err := parseUintBytes(b, 10, 64) if err != nil { panic(fmt.Sprintf("Failed to parse goroutine ID out of %q: %v", b, err)) } return n } var littleBuf = sync.Pool{ New: func() interface{} { buf := make([]byte, 64) return &buf }, } // parseUintBytes is like strconv.ParseUint, but using a []byte. func parseUintBytes(s []byte, base int, bitSize int) (n uint64, err error) { var cutoff, maxVal uint64 if bitSize == 0 { bitSize = int(strconv.IntSize) } s0 := s switch { case len(s) < 1: err = strconv.ErrSyntax goto Error case 2 <= base && base <= 36: // valid base; nothing to do case base == 0: // Look for octal, hex prefix. switch { case s[0] == '0' && len(s) > 1 && (s[1] == 'x' || s[1] == 'X'): base = 16 s = s[2:] if len(s) < 1 { err = strconv.ErrSyntax goto Error } case s[0] == '0': base = 8 default: base = 10 } default: err = errors.New("invalid base " + strconv.Itoa(base)) goto Error } n = 0 cutoff = cutoff64(base) maxVal = 1<= base { n = 0 err = strconv.ErrSyntax goto Error } if n >= cutoff { // n*base overflows n = 1<<64 - 1 err = strconv.ErrRange goto Error } n *= uint64(base) n1 := n + uint64(v) if n1 < n || n1 > maxVal { // n+v overflows n = 1<<64 - 1 err = strconv.ErrRange goto Error } n = n1 } return n, nil Error: return n, &strconv.NumError{Func: "ParseUint", Num: string(s0), Err: err} } // Return the first number n such that n*base >= 1<<64. func cutoff64(base int) uint64 { if base < 2 { return 0 } return (1<<64-1)/uint64(base) + 1 } ================================================ FILE: vendor/golang.org/x/net/http2/hpack/encode.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package hpack import ( "io" ) const ( uint32Max = ^uint32(0) initialHeaderTableSize = 4096 ) type Encoder struct { dynTab dynamicTable // minSize is the minimum table size set by // SetMaxDynamicTableSize after the previous Header Table Size // Update. minSize uint32 // maxSizeLimit is the maximum table size this encoder // supports. This will protect the encoder from too large // size. maxSizeLimit uint32 // tableSizeUpdate indicates whether "Header Table Size // Update" is required. tableSizeUpdate bool w io.Writer buf []byte } // NewEncoder returns a new Encoder which performs HPACK encoding. An // encoded data is written to w. func NewEncoder(w io.Writer) *Encoder { e := &Encoder{ minSize: uint32Max, maxSizeLimit: initialHeaderTableSize, tableSizeUpdate: false, w: w, } e.dynTab.table.init() e.dynTab.setMaxSize(initialHeaderTableSize) return e } // WriteField encodes f into a single Write to e's underlying Writer. // This function may also produce bytes for "Header Table Size Update" // if necessary. If produced, it is done before encoding f. func (e *Encoder) WriteField(f HeaderField) error { e.buf = e.buf[:0] if e.tableSizeUpdate { e.tableSizeUpdate = false if e.minSize < e.dynTab.maxSize { e.buf = appendTableSize(e.buf, e.minSize) } e.minSize = uint32Max e.buf = appendTableSize(e.buf, e.dynTab.maxSize) } idx, nameValueMatch := e.searchTable(f) if nameValueMatch { e.buf = appendIndexed(e.buf, idx) } else { indexing := e.shouldIndex(f) if indexing { e.dynTab.add(f) } if idx == 0 { e.buf = appendNewName(e.buf, f, indexing) } else { e.buf = appendIndexedName(e.buf, f, idx, indexing) } } n, err := e.w.Write(e.buf) if err == nil && n != len(e.buf) { err = io.ErrShortWrite } return err } // searchTable searches f in both stable and dynamic header tables. // The static header table is searched first. Only when there is no // exact match for both name and value, the dynamic header table is // then searched. If there is no match, i is 0. If both name and value // match, i is the matched index and nameValueMatch becomes true. If // only name matches, i points to that index and nameValueMatch // becomes false. func (e *Encoder) searchTable(f HeaderField) (i uint64, nameValueMatch bool) { i, nameValueMatch = staticTable.search(f) if nameValueMatch { return i, true } j, nameValueMatch := e.dynTab.table.search(f) if nameValueMatch || (i == 0 && j != 0) { return j + uint64(staticTable.len()), nameValueMatch } return i, false } // SetMaxDynamicTableSize changes the dynamic header table size to v. // The actual size is bounded by the value passed to // SetMaxDynamicTableSizeLimit. func (e *Encoder) SetMaxDynamicTableSize(v uint32) { if v > e.maxSizeLimit { v = e.maxSizeLimit } if v < e.minSize { e.minSize = v } e.tableSizeUpdate = true e.dynTab.setMaxSize(v) } // MaxDynamicTableSize returns the current dynamic header table size. func (e *Encoder) MaxDynamicTableSize() (v uint32) { return e.dynTab.maxSize } // SetMaxDynamicTableSizeLimit changes the maximum value that can be // specified in SetMaxDynamicTableSize to v. By default, it is set to // 4096, which is the same size of the default dynamic header table // size described in HPACK specification. If the current maximum // dynamic header table size is strictly greater than v, "Header Table // Size Update" will be done in the next WriteField call and the // maximum dynamic header table size is truncated to v. func (e *Encoder) SetMaxDynamicTableSizeLimit(v uint32) { e.maxSizeLimit = v if e.dynTab.maxSize > v { e.tableSizeUpdate = true e.dynTab.setMaxSize(v) } } // shouldIndex reports whether f should be indexed. func (e *Encoder) shouldIndex(f HeaderField) bool { return !f.Sensitive && f.Size() <= e.dynTab.maxSize } // appendIndexed appends index i, as encoded in "Indexed Header Field" // representation, to dst and returns the extended buffer. func appendIndexed(dst []byte, i uint64) []byte { first := len(dst) dst = appendVarInt(dst, 7, i) dst[first] |= 0x80 return dst } // appendNewName appends f, as encoded in one of "Literal Header field // - New Name" representation variants, to dst and returns the // extended buffer. // // If f.Sensitive is true, "Never Indexed" representation is used. If // f.Sensitive is false and indexing is true, "Incremental Indexing" // representation is used. func appendNewName(dst []byte, f HeaderField, indexing bool) []byte { dst = append(dst, encodeTypeByte(indexing, f.Sensitive)) dst = appendHpackString(dst, f.Name) return appendHpackString(dst, f.Value) } // appendIndexedName appends f and index i referring indexed name // entry, as encoded in one of "Literal Header field - Indexed Name" // representation variants, to dst and returns the extended buffer. // // If f.Sensitive is true, "Never Indexed" representation is used. If // f.Sensitive is false and indexing is true, "Incremental Indexing" // representation is used. func appendIndexedName(dst []byte, f HeaderField, i uint64, indexing bool) []byte { first := len(dst) var n byte if indexing { n = 6 } else { n = 4 } dst = appendVarInt(dst, n, i) dst[first] |= encodeTypeByte(indexing, f.Sensitive) return appendHpackString(dst, f.Value) } // appendTableSize appends v, as encoded in "Header Table Size Update" // representation, to dst and returns the extended buffer. func appendTableSize(dst []byte, v uint32) []byte { first := len(dst) dst = appendVarInt(dst, 5, uint64(v)) dst[first] |= 0x20 return dst } // appendVarInt appends i, as encoded in variable integer form using n // bit prefix, to dst and returns the extended buffer. // // See // https://httpwg.org/specs/rfc7541.html#integer.representation func appendVarInt(dst []byte, n byte, i uint64) []byte { k := uint64((1 << n) - 1) if i < k { return append(dst, byte(i)) } dst = append(dst, byte(k)) i -= k for ; i >= 128; i >>= 7 { dst = append(dst, byte(0x80|(i&0x7f))) } return append(dst, byte(i)) } // appendHpackString appends s, as encoded in "String Literal" // representation, to dst and returns the extended buffer. // // s will be encoded in Huffman codes only when it produces strictly // shorter byte string. func appendHpackString(dst []byte, s string) []byte { huffmanLength := HuffmanEncodeLength(s) if huffmanLength < uint64(len(s)) { first := len(dst) dst = appendVarInt(dst, 7, huffmanLength) dst = AppendHuffmanString(dst, s) dst[first] |= 0x80 } else { dst = appendVarInt(dst, 7, uint64(len(s))) dst = append(dst, s...) } return dst } // encodeTypeByte returns type byte. If sensitive is true, type byte // for "Never Indexed" representation is returned. If sensitive is // false and indexing is true, type byte for "Incremental Indexing" // representation is returned. Otherwise, type byte for "Without // Indexing" is returned. func encodeTypeByte(indexing, sensitive bool) byte { if sensitive { return 0x10 } if indexing { return 0x40 } return 0 } ================================================ FILE: vendor/golang.org/x/net/http2/hpack/hpack.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package hpack implements HPACK, a compression format for // efficiently representing HTTP header fields in the context of HTTP/2. // // See http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-09 package hpack import ( "bytes" "errors" "fmt" ) // A DecodingError is something the spec defines as a decoding error. type DecodingError struct { Err error } func (de DecodingError) Error() string { return fmt.Sprintf("decoding error: %v", de.Err) } // An InvalidIndexError is returned when an encoder references a table // entry before the static table or after the end of the dynamic table. type InvalidIndexError int func (e InvalidIndexError) Error() string { return fmt.Sprintf("invalid indexed representation index %d", int(e)) } // A HeaderField is a name-value pair. Both the name and value are // treated as opaque sequences of octets. type HeaderField struct { Name, Value string // Sensitive means that this header field should never be // indexed. Sensitive bool } // IsPseudo reports whether the header field is an http2 pseudo header. // That is, it reports whether it starts with a colon. // It is not otherwise guaranteed to be a valid pseudo header field, // though. func (hf HeaderField) IsPseudo() bool { return len(hf.Name) != 0 && hf.Name[0] == ':' } func (hf HeaderField) String() string { var suffix string if hf.Sensitive { suffix = " (sensitive)" } return fmt.Sprintf("header field %q = %q%s", hf.Name, hf.Value, suffix) } // Size returns the size of an entry per RFC 7541 section 4.1. func (hf HeaderField) Size() uint32 { // https://httpwg.org/specs/rfc7541.html#rfc.section.4.1 // "The size of the dynamic table is the sum of the size of // its entries. The size of an entry is the sum of its name's // length in octets (as defined in Section 5.2), its value's // length in octets (see Section 5.2), plus 32. The size of // an entry is calculated using the length of the name and // value without any Huffman encoding applied." // This can overflow if somebody makes a large HeaderField // Name and/or Value by hand, but we don't care, because that // won't happen on the wire because the encoding doesn't allow // it. return uint32(len(hf.Name) + len(hf.Value) + 32) } // A Decoder is the decoding context for incremental processing of // header blocks. type Decoder struct { dynTab dynamicTable emit func(f HeaderField) emitEnabled bool // whether calls to emit are enabled maxStrLen int // 0 means unlimited // buf is the unparsed buffer. It's only written to // saveBuf if it was truncated in the middle of a header // block. Because it's usually not owned, we can only // process it under Write. buf []byte // not owned; only valid during Write // saveBuf is previous data passed to Write which we weren't able // to fully parse before. Unlike buf, we own this data. saveBuf bytes.Buffer firstField bool // processing the first field of the header block } // NewDecoder returns a new decoder with the provided maximum dynamic // table size. The emitFunc will be called for each valid field // parsed, in the same goroutine as calls to Write, before Write returns. func NewDecoder(maxDynamicTableSize uint32, emitFunc func(f HeaderField)) *Decoder { d := &Decoder{ emit: emitFunc, emitEnabled: true, firstField: true, } d.dynTab.table.init() d.dynTab.allowedMaxSize = maxDynamicTableSize d.dynTab.setMaxSize(maxDynamicTableSize) return d } // ErrStringLength is returned by Decoder.Write when the max string length // (as configured by Decoder.SetMaxStringLength) would be violated. var ErrStringLength = errors.New("hpack: string too long") // SetMaxStringLength sets the maximum size of a HeaderField name or // value string. If a string exceeds this length (even after any // decompression), Write will return ErrStringLength. // A value of 0 means unlimited and is the default from NewDecoder. func (d *Decoder) SetMaxStringLength(n int) { d.maxStrLen = n } // SetEmitFunc changes the callback used when new header fields // are decoded. // It must be non-nil. It does not affect EmitEnabled. func (d *Decoder) SetEmitFunc(emitFunc func(f HeaderField)) { d.emit = emitFunc } // SetEmitEnabled controls whether the emitFunc provided to NewDecoder // should be called. The default is true. // // This facility exists to let servers enforce MAX_HEADER_LIST_SIZE // while still decoding and keeping in-sync with decoder state, but // without doing unnecessary decompression or generating unnecessary // garbage for header fields past the limit. func (d *Decoder) SetEmitEnabled(v bool) { d.emitEnabled = v } // EmitEnabled reports whether calls to the emitFunc provided to NewDecoder // are currently enabled. The default is true. func (d *Decoder) EmitEnabled() bool { return d.emitEnabled } // TODO: add method *Decoder.Reset(maxSize, emitFunc) to let callers re-use Decoders and their // underlying buffers for garbage reasons. func (d *Decoder) SetMaxDynamicTableSize(v uint32) { d.dynTab.setMaxSize(v) } // SetAllowedMaxDynamicTableSize sets the upper bound that the encoded // stream (via dynamic table size updates) may set the maximum size // to. func (d *Decoder) SetAllowedMaxDynamicTableSize(v uint32) { d.dynTab.allowedMaxSize = v } type dynamicTable struct { // https://httpwg.org/specs/rfc7541.html#rfc.section.2.3.2 table headerFieldTable size uint32 // in bytes maxSize uint32 // current maxSize allowedMaxSize uint32 // maxSize may go up to this, inclusive } func (dt *dynamicTable) setMaxSize(v uint32) { dt.maxSize = v dt.evict() } func (dt *dynamicTable) add(f HeaderField) { dt.table.addEntry(f) dt.size += f.Size() dt.evict() } // If we're too big, evict old stuff. func (dt *dynamicTable) evict() { var n int for dt.size > dt.maxSize && n < dt.table.len() { dt.size -= dt.table.ents[n].Size() n++ } dt.table.evictOldest(n) } func (d *Decoder) maxTableIndex() int { // This should never overflow. RFC 7540 Section 6.5.2 limits the size of // the dynamic table to 2^32 bytes, where each entry will occupy more than // one byte. Further, the staticTable has a fixed, small length. return d.dynTab.table.len() + staticTable.len() } func (d *Decoder) at(i uint64) (hf HeaderField, ok bool) { // See Section 2.3.3. if i == 0 { return } if i <= uint64(staticTable.len()) { return staticTable.ents[i-1], true } if i > uint64(d.maxTableIndex()) { return } // In the dynamic table, newer entries have lower indices. // However, dt.ents[0] is the oldest entry. Hence, dt.ents is // the reversed dynamic table. dt := d.dynTab.table return dt.ents[dt.len()-(int(i)-staticTable.len())], true } // DecodeFull decodes an entire block. // // TODO: remove this method and make it incremental later? This is // easier for debugging now. func (d *Decoder) DecodeFull(p []byte) ([]HeaderField, error) { var hf []HeaderField saveFunc := d.emit defer func() { d.emit = saveFunc }() d.emit = func(f HeaderField) { hf = append(hf, f) } if _, err := d.Write(p); err != nil { return nil, err } if err := d.Close(); err != nil { return nil, err } return hf, nil } // Close declares that the decoding is complete and resets the Decoder // to be reused again for a new header block. If there is any remaining // data in the decoder's buffer, Close returns an error. func (d *Decoder) Close() error { if d.saveBuf.Len() > 0 { d.saveBuf.Reset() return DecodingError{errors.New("truncated headers")} } d.firstField = true return nil } func (d *Decoder) Write(p []byte) (n int, err error) { if len(p) == 0 { // Prevent state machine CPU attacks (making us redo // work up to the point of finding out we don't have // enough data) return } // Only copy the data if we have to. Optimistically assume // that p will contain a complete header block. if d.saveBuf.Len() == 0 { d.buf = p } else { d.saveBuf.Write(p) d.buf = d.saveBuf.Bytes() d.saveBuf.Reset() } for len(d.buf) > 0 { err = d.parseHeaderFieldRepr() if err == errNeedMore { // Extra paranoia, making sure saveBuf won't // get too large. All the varint and string // reading code earlier should already catch // overlong things and return ErrStringLength, // but keep this as a last resort. const varIntOverhead = 8 // conservative if d.maxStrLen != 0 && int64(len(d.buf)) > 2*(int64(d.maxStrLen)+varIntOverhead) { return 0, ErrStringLength } d.saveBuf.Write(d.buf) return len(p), nil } d.firstField = false if err != nil { break } } return len(p), err } // errNeedMore is an internal sentinel error value that means the // buffer is truncated and we need to read more data before we can // continue parsing. var errNeedMore = errors.New("need more data") type indexType int const ( indexedTrue indexType = iota indexedFalse indexedNever ) func (v indexType) indexed() bool { return v == indexedTrue } func (v indexType) sensitive() bool { return v == indexedNever } // returns errNeedMore if there isn't enough data available. // any other error is fatal. // consumes d.buf iff it returns nil. // precondition: must be called with len(d.buf) > 0 func (d *Decoder) parseHeaderFieldRepr() error { b := d.buf[0] switch { case b&128 != 0: // Indexed representation. // High bit set? // https://httpwg.org/specs/rfc7541.html#rfc.section.6.1 return d.parseFieldIndexed() case b&192 == 64: // 6.2.1 Literal Header Field with Incremental Indexing // 0b10xxxxxx: top two bits are 10 // https://httpwg.org/specs/rfc7541.html#rfc.section.6.2.1 return d.parseFieldLiteral(6, indexedTrue) case b&240 == 0: // 6.2.2 Literal Header Field without Indexing // 0b0000xxxx: top four bits are 0000 // https://httpwg.org/specs/rfc7541.html#rfc.section.6.2.2 return d.parseFieldLiteral(4, indexedFalse) case b&240 == 16: // 6.2.3 Literal Header Field never Indexed // 0b0001xxxx: top four bits are 0001 // https://httpwg.org/specs/rfc7541.html#rfc.section.6.2.3 return d.parseFieldLiteral(4, indexedNever) case b&224 == 32: // 6.3 Dynamic Table Size Update // Top three bits are '001'. // https://httpwg.org/specs/rfc7541.html#rfc.section.6.3 return d.parseDynamicTableSizeUpdate() } return DecodingError{errors.New("invalid encoding")} } // (same invariants and behavior as parseHeaderFieldRepr) func (d *Decoder) parseFieldIndexed() error { buf := d.buf idx, buf, err := readVarInt(7, buf) if err != nil { return err } hf, ok := d.at(idx) if !ok { return DecodingError{InvalidIndexError(idx)} } d.buf = buf return d.callEmit(HeaderField{Name: hf.Name, Value: hf.Value}) } // (same invariants and behavior as parseHeaderFieldRepr) func (d *Decoder) parseFieldLiteral(n uint8, it indexType) error { buf := d.buf nameIdx, buf, err := readVarInt(n, buf) if err != nil { return err } var hf HeaderField wantStr := d.emitEnabled || it.indexed() var undecodedName undecodedString if nameIdx > 0 { ihf, ok := d.at(nameIdx) if !ok { return DecodingError{InvalidIndexError(nameIdx)} } hf.Name = ihf.Name } else { undecodedName, buf, err = d.readString(buf) if err != nil { return err } } undecodedValue, buf, err := d.readString(buf) if err != nil { return err } if wantStr { if nameIdx <= 0 { hf.Name, err = d.decodeString(undecodedName) if err != nil { return err } } hf.Value, err = d.decodeString(undecodedValue) if err != nil { return err } } d.buf = buf if it.indexed() { d.dynTab.add(hf) } hf.Sensitive = it.sensitive() return d.callEmit(hf) } func (d *Decoder) callEmit(hf HeaderField) error { if d.maxStrLen != 0 { if len(hf.Name) > d.maxStrLen || len(hf.Value) > d.maxStrLen { return ErrStringLength } } if d.emitEnabled { d.emit(hf) } return nil } // (same invariants and behavior as parseHeaderFieldRepr) func (d *Decoder) parseDynamicTableSizeUpdate() error { // RFC 7541, sec 4.2: This dynamic table size update MUST occur at the // beginning of the first header block following the change to the dynamic table size. if !d.firstField && d.dynTab.size > 0 { return DecodingError{errors.New("dynamic table size update MUST occur at the beginning of a header block")} } buf := d.buf size, buf, err := readVarInt(5, buf) if err != nil { return err } if size > uint64(d.dynTab.allowedMaxSize) { return DecodingError{errors.New("dynamic table size update too large")} } d.dynTab.setMaxSize(uint32(size)) d.buf = buf return nil } var errVarintOverflow = DecodingError{errors.New("varint integer overflow")} // readVarInt reads an unsigned variable length integer off the // beginning of p. n is the parameter as described in // https://httpwg.org/specs/rfc7541.html#rfc.section.5.1. // // n must always be between 1 and 8. // // The returned remain buffer is either a smaller suffix of p, or err != nil. // The error is errNeedMore if p doesn't contain a complete integer. func readVarInt(n byte, p []byte) (i uint64, remain []byte, err error) { if n < 1 || n > 8 { panic("bad n") } if len(p) == 0 { return 0, p, errNeedMore } i = uint64(p[0]) if n < 8 { i &= (1 << uint64(n)) - 1 } if i < (1< 0 { b := p[0] p = p[1:] i += uint64(b&127) << m if b&128 == 0 { return i, p, nil } m += 7 if m >= 63 { // TODO: proper overflow check. making this up. return 0, origP, errVarintOverflow } } return 0, origP, errNeedMore } // readString reads an hpack string from p. // // It returns a reference to the encoded string data to permit deferring decode costs // until after the caller verifies all data is present. func (d *Decoder) readString(p []byte) (u undecodedString, remain []byte, err error) { if len(p) == 0 { return u, p, errNeedMore } isHuff := p[0]&128 != 0 strLen, p, err := readVarInt(7, p) if err != nil { return u, p, err } if d.maxStrLen != 0 && strLen > uint64(d.maxStrLen) { // Returning an error here means Huffman decoding errors // for non-indexed strings past the maximum string length // are ignored, but the server is returning an error anyway // and because the string is not indexed the error will not // affect the decoding state. return u, nil, ErrStringLength } if uint64(len(p)) < strLen { return u, p, errNeedMore } u.isHuff = isHuff u.b = p[:strLen] return u, p[strLen:], nil } type undecodedString struct { isHuff bool b []byte } func (d *Decoder) decodeString(u undecodedString) (string, error) { if !u.isHuff { return string(u.b), nil } buf := bufPool.Get().(*bytes.Buffer) buf.Reset() // don't trust others var s string err := huffmanDecode(buf, d.maxStrLen, u.b) if err == nil { s = buf.String() } buf.Reset() // be nice to GC bufPool.Put(buf) return s, err } ================================================ FILE: vendor/golang.org/x/net/http2/hpack/huffman.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package hpack import ( "bytes" "errors" "io" "sync" ) var bufPool = sync.Pool{ New: func() interface{} { return new(bytes.Buffer) }, } // HuffmanDecode decodes the string in v and writes the expanded // result to w, returning the number of bytes written to w and the // Write call's return value. At most one Write call is made. func HuffmanDecode(w io.Writer, v []byte) (int, error) { buf := bufPool.Get().(*bytes.Buffer) buf.Reset() defer bufPool.Put(buf) if err := huffmanDecode(buf, 0, v); err != nil { return 0, err } return w.Write(buf.Bytes()) } // HuffmanDecodeToString decodes the string in v. func HuffmanDecodeToString(v []byte) (string, error) { buf := bufPool.Get().(*bytes.Buffer) buf.Reset() defer bufPool.Put(buf) if err := huffmanDecode(buf, 0, v); err != nil { return "", err } return buf.String(), nil } // ErrInvalidHuffman is returned for errors found decoding // Huffman-encoded strings. var ErrInvalidHuffman = errors.New("hpack: invalid Huffman-encoded data") // huffmanDecode decodes v to buf. // If maxLen is greater than 0, attempts to write more to buf than // maxLen bytes will return ErrStringLength. func huffmanDecode(buf *bytes.Buffer, maxLen int, v []byte) error { rootHuffmanNode := getRootHuffmanNode() n := rootHuffmanNode // cur is the bit buffer that has not been fed into n. // cbits is the number of low order bits in cur that are valid. // sbits is the number of bits of the symbol prefix being decoded. cur, cbits, sbits := uint(0), uint8(0), uint8(0) for _, b := range v { cur = cur<<8 | uint(b) cbits += 8 sbits += 8 for cbits >= 8 { idx := byte(cur >> (cbits - 8)) n = n.children[idx] if n == nil { return ErrInvalidHuffman } if n.children == nil { if maxLen != 0 && buf.Len() == maxLen { return ErrStringLength } buf.WriteByte(n.sym) cbits -= n.codeLen n = rootHuffmanNode sbits = cbits } else { cbits -= 8 } } } for cbits > 0 { n = n.children[byte(cur<<(8-cbits))] if n == nil { return ErrInvalidHuffman } if n.children != nil || n.codeLen > cbits { break } if maxLen != 0 && buf.Len() == maxLen { return ErrStringLength } buf.WriteByte(n.sym) cbits -= n.codeLen n = rootHuffmanNode sbits = cbits } if sbits > 7 { // Either there was an incomplete symbol, or overlong padding. // Both are decoding errors per RFC 7541 section 5.2. return ErrInvalidHuffman } if mask := uint(1< 8 { codeLen -= 8 i := uint8(code >> codeLen) if cur.children[i] == nil { cur.children[i] = newInternalNode() } cur = cur.children[i] } shift := 8 - codeLen start, end := int(uint8(code<= 32 { n %= 32 // Normally would be -= 32 but %= 32 informs compiler 0 <= n <= 31 for upcoming shift y := uint32(x >> n) // Compiler doesn't combine memory writes if y isn't uint32 dst = append(dst, byte(y>>24), byte(y>>16), byte(y>>8), byte(y)) } } // Add padding bits if necessary if over := n % 8; over > 0 { const ( eosCode = 0x3fffffff eosNBits = 30 eosPadByte = eosCode >> (eosNBits - 8) ) pad := 8 - over x = (x << pad) | (eosPadByte >> over) n += pad // 8 now divides into n exactly } // n in (0, 8, 16, 24, 32) switch n / 8 { case 0: return dst case 1: return append(dst, byte(x)) case 2: y := uint16(x) return append(dst, byte(y>>8), byte(y)) case 3: y := uint16(x >> 8) return append(dst, byte(y>>8), byte(y), byte(x)) } // case 4: y := uint32(x) return append(dst, byte(y>>24), byte(y>>16), byte(y>>8), byte(y)) } // HuffmanEncodeLength returns the number of bytes required to encode // s in Huffman codes. The result is round up to byte boundary. func HuffmanEncodeLength(s string) uint64 { n := uint64(0) for i := 0; i < len(s); i++ { n += uint64(huffmanCodeLen[s[i]]) } return (n + 7) / 8 } ================================================ FILE: vendor/golang.org/x/net/http2/hpack/static_table.go ================================================ // go generate gen.go // Code generated by the command above; DO NOT EDIT. package hpack var staticTable = &headerFieldTable{ evictCount: 0, byName: map[string]uint64{ ":authority": 1, ":method": 3, ":path": 5, ":scheme": 7, ":status": 14, "accept-charset": 15, "accept-encoding": 16, "accept-language": 17, "accept-ranges": 18, "accept": 19, "access-control-allow-origin": 20, "age": 21, "allow": 22, "authorization": 23, "cache-control": 24, "content-disposition": 25, "content-encoding": 26, "content-language": 27, "content-length": 28, "content-location": 29, "content-range": 30, "content-type": 31, "cookie": 32, "date": 33, "etag": 34, "expect": 35, "expires": 36, "from": 37, "host": 38, "if-match": 39, "if-modified-since": 40, "if-none-match": 41, "if-range": 42, "if-unmodified-since": 43, "last-modified": 44, "link": 45, "location": 46, "max-forwards": 47, "proxy-authenticate": 48, "proxy-authorization": 49, "range": 50, "referer": 51, "refresh": 52, "retry-after": 53, "server": 54, "set-cookie": 55, "strict-transport-security": 56, "transfer-encoding": 57, "user-agent": 58, "vary": 59, "via": 60, "www-authenticate": 61, }, byNameValue: map[pairNameValue]uint64{ {name: ":authority", value: ""}: 1, {name: ":method", value: "GET"}: 2, {name: ":method", value: "POST"}: 3, {name: ":path", value: "/"}: 4, {name: ":path", value: "/index.html"}: 5, {name: ":scheme", value: "http"}: 6, {name: ":scheme", value: "https"}: 7, {name: ":status", value: "200"}: 8, {name: ":status", value: "204"}: 9, {name: ":status", value: "206"}: 10, {name: ":status", value: "304"}: 11, {name: ":status", value: "400"}: 12, {name: ":status", value: "404"}: 13, {name: ":status", value: "500"}: 14, {name: "accept-charset", value: ""}: 15, {name: "accept-encoding", value: "gzip, deflate"}: 16, {name: "accept-language", value: ""}: 17, {name: "accept-ranges", value: ""}: 18, {name: "accept", value: ""}: 19, {name: "access-control-allow-origin", value: ""}: 20, {name: "age", value: ""}: 21, {name: "allow", value: ""}: 22, {name: "authorization", value: ""}: 23, {name: "cache-control", value: ""}: 24, {name: "content-disposition", value: ""}: 25, {name: "content-encoding", value: ""}: 26, {name: "content-language", value: ""}: 27, {name: "content-length", value: ""}: 28, {name: "content-location", value: ""}: 29, {name: "content-range", value: ""}: 30, {name: "content-type", value: ""}: 31, {name: "cookie", value: ""}: 32, {name: "date", value: ""}: 33, {name: "etag", value: ""}: 34, {name: "expect", value: ""}: 35, {name: "expires", value: ""}: 36, {name: "from", value: ""}: 37, {name: "host", value: ""}: 38, {name: "if-match", value: ""}: 39, {name: "if-modified-since", value: ""}: 40, {name: "if-none-match", value: ""}: 41, {name: "if-range", value: ""}: 42, {name: "if-unmodified-since", value: ""}: 43, {name: "last-modified", value: ""}: 44, {name: "link", value: ""}: 45, {name: "location", value: ""}: 46, {name: "max-forwards", value: ""}: 47, {name: "proxy-authenticate", value: ""}: 48, {name: "proxy-authorization", value: ""}: 49, {name: "range", value: ""}: 50, {name: "referer", value: ""}: 51, {name: "refresh", value: ""}: 52, {name: "retry-after", value: ""}: 53, {name: "server", value: ""}: 54, {name: "set-cookie", value: ""}: 55, {name: "strict-transport-security", value: ""}: 56, {name: "transfer-encoding", value: ""}: 57, {name: "user-agent", value: ""}: 58, {name: "vary", value: ""}: 59, {name: "via", value: ""}: 60, {name: "www-authenticate", value: ""}: 61, }, ents: []HeaderField{ {Name: ":authority", Value: "", Sensitive: false}, {Name: ":method", Value: "GET", Sensitive: false}, {Name: ":method", Value: "POST", Sensitive: false}, {Name: ":path", Value: "/", Sensitive: false}, {Name: ":path", Value: "/index.html", Sensitive: false}, {Name: ":scheme", Value: "http", Sensitive: false}, {Name: ":scheme", Value: "https", Sensitive: false}, {Name: ":status", Value: "200", Sensitive: false}, {Name: ":status", Value: "204", Sensitive: false}, {Name: ":status", Value: "206", Sensitive: false}, {Name: ":status", Value: "304", Sensitive: false}, {Name: ":status", Value: "400", Sensitive: false}, {Name: ":status", Value: "404", Sensitive: false}, {Name: ":status", Value: "500", Sensitive: false}, {Name: "accept-charset", Value: "", Sensitive: false}, {Name: "accept-encoding", Value: "gzip, deflate", Sensitive: false}, {Name: "accept-language", Value: "", Sensitive: false}, {Name: "accept-ranges", Value: "", Sensitive: false}, {Name: "accept", Value: "", Sensitive: false}, {Name: "access-control-allow-origin", Value: "", Sensitive: false}, {Name: "age", Value: "", Sensitive: false}, {Name: "allow", Value: "", Sensitive: false}, {Name: "authorization", Value: "", Sensitive: false}, {Name: "cache-control", Value: "", Sensitive: false}, {Name: "content-disposition", Value: "", Sensitive: false}, {Name: "content-encoding", Value: "", Sensitive: false}, {Name: "content-language", Value: "", Sensitive: false}, {Name: "content-length", Value: "", Sensitive: false}, {Name: "content-location", Value: "", Sensitive: false}, {Name: "content-range", Value: "", Sensitive: false}, {Name: "content-type", Value: "", Sensitive: false}, {Name: "cookie", Value: "", Sensitive: false}, {Name: "date", Value: "", Sensitive: false}, {Name: "etag", Value: "", Sensitive: false}, {Name: "expect", Value: "", Sensitive: false}, {Name: "expires", Value: "", Sensitive: false}, {Name: "from", Value: "", Sensitive: false}, {Name: "host", Value: "", Sensitive: false}, {Name: "if-match", Value: "", Sensitive: false}, {Name: "if-modified-since", Value: "", Sensitive: false}, {Name: "if-none-match", Value: "", Sensitive: false}, {Name: "if-range", Value: "", Sensitive: false}, {Name: "if-unmodified-since", Value: "", Sensitive: false}, {Name: "last-modified", Value: "", Sensitive: false}, {Name: "link", Value: "", Sensitive: false}, {Name: "location", Value: "", Sensitive: false}, {Name: "max-forwards", Value: "", Sensitive: false}, {Name: "proxy-authenticate", Value: "", Sensitive: false}, {Name: "proxy-authorization", Value: "", Sensitive: false}, {Name: "range", Value: "", Sensitive: false}, {Name: "referer", Value: "", Sensitive: false}, {Name: "refresh", Value: "", Sensitive: false}, {Name: "retry-after", Value: "", Sensitive: false}, {Name: "server", Value: "", Sensitive: false}, {Name: "set-cookie", Value: "", Sensitive: false}, {Name: "strict-transport-security", Value: "", Sensitive: false}, {Name: "transfer-encoding", Value: "", Sensitive: false}, {Name: "user-agent", Value: "", Sensitive: false}, {Name: "vary", Value: "", Sensitive: false}, {Name: "via", Value: "", Sensitive: false}, {Name: "www-authenticate", Value: "", Sensitive: false}, }, } ================================================ FILE: vendor/golang.org/x/net/http2/hpack/tables.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package hpack import ( "fmt" ) // headerFieldTable implements a list of HeaderFields. // This is used to implement the static and dynamic tables. type headerFieldTable struct { // For static tables, entries are never evicted. // // For dynamic tables, entries are evicted from ents[0] and added to the end. // Each entry has a unique id that starts at one and increments for each // entry that is added. This unique id is stable across evictions, meaning // it can be used as a pointer to a specific entry. As in hpack, unique ids // are 1-based. The unique id for ents[k] is k + evictCount + 1. // // Zero is not a valid unique id. // // evictCount should not overflow in any remotely practical situation. In // practice, we will have one dynamic table per HTTP/2 connection. If we // assume a very powerful server that handles 1M QPS per connection and each // request adds (then evicts) 100 entries from the table, it would still take // 2M years for evictCount to overflow. ents []HeaderField evictCount uint64 // byName maps a HeaderField name to the unique id of the newest entry with // the same name. See above for a definition of "unique id". byName map[string]uint64 // byNameValue maps a HeaderField name/value pair to the unique id of the newest // entry with the same name and value. See above for a definition of "unique id". byNameValue map[pairNameValue]uint64 } type pairNameValue struct { name, value string } func (t *headerFieldTable) init() { t.byName = make(map[string]uint64) t.byNameValue = make(map[pairNameValue]uint64) } // len reports the number of entries in the table. func (t *headerFieldTable) len() int { return len(t.ents) } // addEntry adds a new entry. func (t *headerFieldTable) addEntry(f HeaderField) { id := uint64(t.len()) + t.evictCount + 1 t.byName[f.Name] = id t.byNameValue[pairNameValue{f.Name, f.Value}] = id t.ents = append(t.ents, f) } // evictOldest evicts the n oldest entries in the table. func (t *headerFieldTable) evictOldest(n int) { if n > t.len() { panic(fmt.Sprintf("evictOldest(%v) on table with %v entries", n, t.len())) } for k := 0; k < n; k++ { f := t.ents[k] id := t.evictCount + uint64(k) + 1 if t.byName[f.Name] == id { delete(t.byName, f.Name) } if p := (pairNameValue{f.Name, f.Value}); t.byNameValue[p] == id { delete(t.byNameValue, p) } } copy(t.ents, t.ents[n:]) for k := t.len() - n; k < t.len(); k++ { t.ents[k] = HeaderField{} // so strings can be garbage collected } t.ents = t.ents[:t.len()-n] if t.evictCount+uint64(n) < t.evictCount { panic("evictCount overflow") } t.evictCount += uint64(n) } // search finds f in the table. If there is no match, i is 0. // If both name and value match, i is the matched index and nameValueMatch // becomes true. If only name matches, i points to that index and // nameValueMatch becomes false. // // The returned index is a 1-based HPACK index. For dynamic tables, HPACK says // that index 1 should be the newest entry, but t.ents[0] is the oldest entry, // meaning t.ents is reversed for dynamic tables. Hence, when t is a dynamic // table, the return value i actually refers to the entry t.ents[t.len()-i]. // // All tables are assumed to be a dynamic tables except for the global staticTable. // // See Section 2.3.3. func (t *headerFieldTable) search(f HeaderField) (i uint64, nameValueMatch bool) { if !f.Sensitive { if id := t.byNameValue[pairNameValue{f.Name, f.Value}]; id != 0 { return t.idToIndex(id), true } } if id := t.byName[f.Name]; id != 0 { return t.idToIndex(id), false } return 0, false } // idToIndex converts a unique id to an HPACK index. // See Section 2.3.3. func (t *headerFieldTable) idToIndex(id uint64) uint64 { if id <= t.evictCount { panic(fmt.Sprintf("id (%v) <= evictCount (%v)", id, t.evictCount)) } k := id - t.evictCount - 1 // convert id to an index t.ents[k] if t != staticTable { return uint64(t.len()) - k // dynamic table } return k + 1 } var huffmanCodes = [256]uint32{ 0x1ff8, 0x7fffd8, 0xfffffe2, 0xfffffe3, 0xfffffe4, 0xfffffe5, 0xfffffe6, 0xfffffe7, 0xfffffe8, 0xffffea, 0x3ffffffc, 0xfffffe9, 0xfffffea, 0x3ffffffd, 0xfffffeb, 0xfffffec, 0xfffffed, 0xfffffee, 0xfffffef, 0xffffff0, 0xffffff1, 0xffffff2, 0x3ffffffe, 0xffffff3, 0xffffff4, 0xffffff5, 0xffffff6, 0xffffff7, 0xffffff8, 0xffffff9, 0xffffffa, 0xffffffb, 0x14, 0x3f8, 0x3f9, 0xffa, 0x1ff9, 0x15, 0xf8, 0x7fa, 0x3fa, 0x3fb, 0xf9, 0x7fb, 0xfa, 0x16, 0x17, 0x18, 0x0, 0x1, 0x2, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x5c, 0xfb, 0x7ffc, 0x20, 0xffb, 0x3fc, 0x1ffa, 0x21, 0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0xfc, 0x73, 0xfd, 0x1ffb, 0x7fff0, 0x1ffc, 0x3ffc, 0x22, 0x7ffd, 0x3, 0x23, 0x4, 0x24, 0x5, 0x25, 0x26, 0x27, 0x6, 0x74, 0x75, 0x28, 0x29, 0x2a, 0x7, 0x2b, 0x76, 0x2c, 0x8, 0x9, 0x2d, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7ffe, 0x7fc, 0x3ffd, 0x1ffd, 0xffffffc, 0xfffe6, 0x3fffd2, 0xfffe7, 0xfffe8, 0x3fffd3, 0x3fffd4, 0x3fffd5, 0x7fffd9, 0x3fffd6, 0x7fffda, 0x7fffdb, 0x7fffdc, 0x7fffdd, 0x7fffde, 0xffffeb, 0x7fffdf, 0xffffec, 0xffffed, 0x3fffd7, 0x7fffe0, 0xffffee, 0x7fffe1, 0x7fffe2, 0x7fffe3, 0x7fffe4, 0x1fffdc, 0x3fffd8, 0x7fffe5, 0x3fffd9, 0x7fffe6, 0x7fffe7, 0xffffef, 0x3fffda, 0x1fffdd, 0xfffe9, 0x3fffdb, 0x3fffdc, 0x7fffe8, 0x7fffe9, 0x1fffde, 0x7fffea, 0x3fffdd, 0x3fffde, 0xfffff0, 0x1fffdf, 0x3fffdf, 0x7fffeb, 0x7fffec, 0x1fffe0, 0x1fffe1, 0x3fffe0, 0x1fffe2, 0x7fffed, 0x3fffe1, 0x7fffee, 0x7fffef, 0xfffea, 0x3fffe2, 0x3fffe3, 0x3fffe4, 0x7ffff0, 0x3fffe5, 0x3fffe6, 0x7ffff1, 0x3ffffe0, 0x3ffffe1, 0xfffeb, 0x7fff1, 0x3fffe7, 0x7ffff2, 0x3fffe8, 0x1ffffec, 0x3ffffe2, 0x3ffffe3, 0x3ffffe4, 0x7ffffde, 0x7ffffdf, 0x3ffffe5, 0xfffff1, 0x1ffffed, 0x7fff2, 0x1fffe3, 0x3ffffe6, 0x7ffffe0, 0x7ffffe1, 0x3ffffe7, 0x7ffffe2, 0xfffff2, 0x1fffe4, 0x1fffe5, 0x3ffffe8, 0x3ffffe9, 0xffffffd, 0x7ffffe3, 0x7ffffe4, 0x7ffffe5, 0xfffec, 0xfffff3, 0xfffed, 0x1fffe6, 0x3fffe9, 0x1fffe7, 0x1fffe8, 0x7ffff3, 0x3fffea, 0x3fffeb, 0x1ffffee, 0x1ffffef, 0xfffff4, 0xfffff5, 0x3ffffea, 0x7ffff4, 0x3ffffeb, 0x7ffffe6, 0x3ffffec, 0x3ffffed, 0x7ffffe7, 0x7ffffe8, 0x7ffffe9, 0x7ffffea, 0x7ffffeb, 0xffffffe, 0x7ffffec, 0x7ffffed, 0x7ffffee, 0x7ffffef, 0x7fffff0, 0x3ffffee, } var huffmanCodeLen = [256]uint8{ 13, 23, 28, 28, 28, 28, 28, 28, 28, 24, 30, 28, 28, 30, 28, 28, 28, 28, 28, 28, 28, 28, 30, 28, 28, 28, 28, 28, 28, 28, 28, 28, 6, 10, 10, 12, 13, 6, 8, 11, 10, 10, 8, 11, 8, 6, 6, 6, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 7, 8, 15, 6, 12, 10, 13, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 7, 8, 13, 19, 13, 14, 6, 15, 5, 6, 5, 6, 5, 6, 6, 6, 5, 7, 7, 6, 6, 6, 5, 6, 7, 6, 5, 5, 6, 7, 7, 7, 7, 7, 15, 11, 14, 13, 28, 20, 22, 20, 20, 22, 22, 22, 23, 22, 23, 23, 23, 23, 23, 24, 23, 24, 24, 22, 23, 24, 23, 23, 23, 23, 21, 22, 23, 22, 23, 23, 24, 22, 21, 20, 22, 22, 23, 23, 21, 23, 22, 22, 24, 21, 22, 23, 23, 21, 21, 22, 21, 23, 22, 23, 23, 20, 22, 22, 22, 23, 22, 22, 23, 26, 26, 20, 19, 22, 23, 22, 25, 26, 26, 26, 27, 27, 26, 24, 25, 19, 21, 26, 27, 27, 26, 27, 24, 21, 21, 26, 26, 28, 27, 27, 27, 20, 24, 20, 21, 22, 21, 21, 23, 22, 22, 25, 25, 24, 24, 26, 23, 26, 27, 26, 26, 27, 27, 27, 27, 27, 28, 27, 27, 27, 27, 27, 26, } ================================================ FILE: vendor/golang.org/x/net/http2/http2.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package http2 implements the HTTP/2 protocol. // // This package is low-level and intended to be used directly by very // few people. Most users will use it indirectly through the automatic // use by the net/http package (from Go 1.6 and later). // For use in earlier Go versions see ConfigureServer. (Transport support // requires Go 1.6 or later) // // See https://http2.github.io/ for more information on HTTP/2. package http2 // import "golang.org/x/net/http2" import ( "bufio" "crypto/tls" "errors" "fmt" "net" "net/http" "os" "sort" "strconv" "strings" "sync" "time" "golang.org/x/net/http/httpguts" ) var ( VerboseLogs bool logFrameWrites bool logFrameReads bool // Enabling extended CONNECT by causes browsers to attempt to use // WebSockets-over-HTTP/2. This results in problems when the server's websocket // package doesn't support extended CONNECT. // // Disable extended CONNECT by default for now. // // Issue #71128. disableExtendedConnectProtocol = true ) func init() { e := os.Getenv("GODEBUG") if strings.Contains(e, "http2debug=1") { VerboseLogs = true } if strings.Contains(e, "http2debug=2") { VerboseLogs = true logFrameWrites = true logFrameReads = true } if strings.Contains(e, "http2xconnect=1") { disableExtendedConnectProtocol = false } } const ( // ClientPreface is the string that must be sent by new // connections from clients. ClientPreface = "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n" // SETTINGS_MAX_FRAME_SIZE default // https://httpwg.org/specs/rfc7540.html#rfc.section.6.5.2 initialMaxFrameSize = 16384 // NextProtoTLS is the NPN/ALPN protocol negotiated during // HTTP/2's TLS setup. NextProtoTLS = "h2" // https://httpwg.org/specs/rfc7540.html#SettingValues initialHeaderTableSize = 4096 initialWindowSize = 65535 // 6.9.2 Initial Flow Control Window Size defaultMaxReadFrameSize = 1 << 20 ) var ( clientPreface = []byte(ClientPreface) ) type streamState int // HTTP/2 stream states. // // See http://tools.ietf.org/html/rfc7540#section-5.1. // // For simplicity, the server code merges "reserved (local)" into // "half-closed (remote)". This is one less state transition to track. // The only downside is that we send PUSH_PROMISEs slightly less // liberally than allowable. More discussion here: // https://lists.w3.org/Archives/Public/ietf-http-wg/2016JulSep/0599.html // // "reserved (remote)" is omitted since the client code does not // support server push. const ( stateIdle streamState = iota stateOpen stateHalfClosedLocal stateHalfClosedRemote stateClosed ) var stateName = [...]string{ stateIdle: "Idle", stateOpen: "Open", stateHalfClosedLocal: "HalfClosedLocal", stateHalfClosedRemote: "HalfClosedRemote", stateClosed: "Closed", } func (st streamState) String() string { return stateName[st] } // Setting is a setting parameter: which setting it is, and its value. type Setting struct { // ID is which setting is being set. // See https://httpwg.org/specs/rfc7540.html#SettingFormat ID SettingID // Val is the value. Val uint32 } func (s Setting) String() string { return fmt.Sprintf("[%v = %d]", s.ID, s.Val) } // Valid reports whether the setting is valid. func (s Setting) Valid() error { // Limits and error codes from 6.5.2 Defined SETTINGS Parameters switch s.ID { case SettingEnablePush: if s.Val != 1 && s.Val != 0 { return ConnectionError(ErrCodeProtocol) } case SettingInitialWindowSize: if s.Val > 1<<31-1 { return ConnectionError(ErrCodeFlowControl) } case SettingMaxFrameSize: if s.Val < 16384 || s.Val > 1<<24-1 { return ConnectionError(ErrCodeProtocol) } case SettingEnableConnectProtocol: if s.Val != 1 && s.Val != 0 { return ConnectionError(ErrCodeProtocol) } } return nil } // A SettingID is an HTTP/2 setting as defined in // https://httpwg.org/specs/rfc7540.html#iana-settings type SettingID uint16 const ( SettingHeaderTableSize SettingID = 0x1 SettingEnablePush SettingID = 0x2 SettingMaxConcurrentStreams SettingID = 0x3 SettingInitialWindowSize SettingID = 0x4 SettingMaxFrameSize SettingID = 0x5 SettingMaxHeaderListSize SettingID = 0x6 SettingEnableConnectProtocol SettingID = 0x8 SettingNoRFC7540Priorities SettingID = 0x9 ) var settingName = map[SettingID]string{ SettingHeaderTableSize: "HEADER_TABLE_SIZE", SettingEnablePush: "ENABLE_PUSH", SettingMaxConcurrentStreams: "MAX_CONCURRENT_STREAMS", SettingInitialWindowSize: "INITIAL_WINDOW_SIZE", SettingMaxFrameSize: "MAX_FRAME_SIZE", SettingMaxHeaderListSize: "MAX_HEADER_LIST_SIZE", SettingEnableConnectProtocol: "ENABLE_CONNECT_PROTOCOL", SettingNoRFC7540Priorities: "NO_RFC7540_PRIORITIES", } func (s SettingID) String() string { if v, ok := settingName[s]; ok { return v } return fmt.Sprintf("UNKNOWN_SETTING_%d", uint16(s)) } // validWireHeaderFieldName reports whether v is a valid header field // name (key). See httpguts.ValidHeaderName for the base rules. // // Further, http2 says: // // "Just as in HTTP/1.x, header field names are strings of ASCII // characters that are compared in a case-insensitive // fashion. However, header field names MUST be converted to // lowercase prior to their encoding in HTTP/2. " func validWireHeaderFieldName(v string) bool { if len(v) == 0 { return false } for _, r := range v { if !httpguts.IsTokenRune(r) { return false } if 'A' <= r && r <= 'Z' { return false } } return true } func httpCodeString(code int) string { switch code { case 200: return "200" case 404: return "404" } return strconv.Itoa(code) } // from pkg io type stringWriter interface { WriteString(s string) (n int, err error) } // A closeWaiter is like a sync.WaitGroup but only goes 1 to 0 (open to closed). type closeWaiter chan struct{} // Init makes a closeWaiter usable. // It exists because so a closeWaiter value can be placed inside a // larger struct and have the Mutex and Cond's memory in the same // allocation. func (cw *closeWaiter) Init() { *cw = make(chan struct{}) } // Close marks the closeWaiter as closed and unblocks any waiters. func (cw closeWaiter) Close() { close(cw) } // Wait waits for the closeWaiter to become closed. func (cw closeWaiter) Wait() { <-cw } // bufferedWriter is a buffered writer that writes to w. // Its buffered writer is lazily allocated as needed, to minimize // idle memory usage with many connections. type bufferedWriter struct { _ incomparable conn net.Conn // immutable bw *bufio.Writer // non-nil when data is buffered byteTimeout time.Duration // immutable, WriteByteTimeout } func newBufferedWriter(conn net.Conn, timeout time.Duration) *bufferedWriter { return &bufferedWriter{ conn: conn, byteTimeout: timeout, } } // bufWriterPoolBufferSize is the size of bufio.Writer's // buffers created using bufWriterPool. // // TODO: pick a less arbitrary value? this is a bit under // (3 x typical 1500 byte MTU) at least. Other than that, // not much thought went into it. const bufWriterPoolBufferSize = 4 << 10 var bufWriterPool = sync.Pool{ New: func() interface{} { return bufio.NewWriterSize(nil, bufWriterPoolBufferSize) }, } func (w *bufferedWriter) Available() int { if w.bw == nil { return bufWriterPoolBufferSize } return w.bw.Available() } func (w *bufferedWriter) Write(p []byte) (n int, err error) { if w.bw == nil { bw := bufWriterPool.Get().(*bufio.Writer) bw.Reset((*bufferedWriterTimeoutWriter)(w)) w.bw = bw } return w.bw.Write(p) } func (w *bufferedWriter) Flush() error { bw := w.bw if bw == nil { return nil } err := bw.Flush() bw.Reset(nil) bufWriterPool.Put(bw) w.bw = nil return err } type bufferedWriterTimeoutWriter bufferedWriter func (w *bufferedWriterTimeoutWriter) Write(p []byte) (n int, err error) { return writeWithByteTimeout(w.conn, w.byteTimeout, p) } // writeWithByteTimeout writes to conn. // If more than timeout passes without any bytes being written to the connection, // the write fails. func writeWithByteTimeout(conn net.Conn, timeout time.Duration, p []byte) (n int, err error) { if timeout <= 0 { return conn.Write(p) } for { conn.SetWriteDeadline(time.Now().Add(timeout)) nn, err := conn.Write(p[n:]) n += nn if n == len(p) || nn == 0 || !errors.Is(err, os.ErrDeadlineExceeded) { // Either we finished the write, made no progress, or hit the deadline. // Whichever it is, we're done now. conn.SetWriteDeadline(time.Time{}) return n, err } } } func mustUint31(v int32) uint32 { if v < 0 || v > 2147483647 { panic("out of range") } return uint32(v) } // bodyAllowedForStatus reports whether a given response status code // permits a body. See RFC 7230, section 3.3. func bodyAllowedForStatus(status int) bool { switch { case status >= 100 && status <= 199: return false case status == 204: return false case status == 304: return false } return true } type httpError struct { _ incomparable msg string timeout bool } func (e *httpError) Error() string { return e.msg } func (e *httpError) Timeout() bool { return e.timeout } func (e *httpError) Temporary() bool { return true } var errTimeout error = &httpError{msg: "http2: timeout awaiting response headers", timeout: true} type connectionStater interface { ConnectionState() tls.ConnectionState } var sorterPool = sync.Pool{New: func() interface{} { return new(sorter) }} type sorter struct { v []string // owned by sorter } func (s *sorter) Len() int { return len(s.v) } func (s *sorter) Swap(i, j int) { s.v[i], s.v[j] = s.v[j], s.v[i] } func (s *sorter) Less(i, j int) bool { return s.v[i] < s.v[j] } // Keys returns the sorted keys of h. // // The returned slice is only valid until s used again or returned to // its pool. func (s *sorter) Keys(h http.Header) []string { keys := s.v[:0] for k := range h { keys = append(keys, k) } s.v = keys sort.Sort(s) return keys } func (s *sorter) SortStrings(ss []string) { // Our sorter works on s.v, which sorter owns, so // stash it away while we sort the user's buffer. save := s.v s.v = ss sort.Sort(s) s.v = save } // incomparable is a zero-width, non-comparable type. Adding it to a struct // makes that struct also non-comparable, and generally doesn't add // any size (as long as it's first). type incomparable [0]func() ================================================ FILE: vendor/golang.org/x/net/http2/pipe.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package http2 import ( "errors" "io" "sync" ) // pipe is a goroutine-safe io.Reader/io.Writer pair. It's like // io.Pipe except there are no PipeReader/PipeWriter halves, and the // underlying buffer is an interface. (io.Pipe is always unbuffered) type pipe struct { mu sync.Mutex c sync.Cond // c.L lazily initialized to &p.mu b pipeBuffer // nil when done reading unread int // bytes unread when done err error // read error once empty. non-nil means closed. breakErr error // immediate read error (caller doesn't see rest of b) donec chan struct{} // closed on error readFn func() // optional code to run in Read before error } type pipeBuffer interface { Len() int io.Writer io.Reader } // setBuffer initializes the pipe buffer. // It has no effect if the pipe is already closed. func (p *pipe) setBuffer(b pipeBuffer) { p.mu.Lock() defer p.mu.Unlock() if p.err != nil || p.breakErr != nil { return } p.b = b } func (p *pipe) Len() int { p.mu.Lock() defer p.mu.Unlock() if p.b == nil { return p.unread } return p.b.Len() } // Read waits until data is available and copies bytes // from the buffer into p. func (p *pipe) Read(d []byte) (n int, err error) { p.mu.Lock() defer p.mu.Unlock() if p.c.L == nil { p.c.L = &p.mu } for { if p.breakErr != nil { return 0, p.breakErr } if p.b != nil && p.b.Len() > 0 { return p.b.Read(d) } if p.err != nil { if p.readFn != nil { p.readFn() // e.g. copy trailers p.readFn = nil // not sticky like p.err } p.b = nil return 0, p.err } p.c.Wait() } } var ( errClosedPipeWrite = errors.New("write on closed buffer") errUninitializedPipeWrite = errors.New("write on uninitialized buffer") ) // Write copies bytes from p into the buffer and wakes a reader. // It is an error to write more data than the buffer can hold. func (p *pipe) Write(d []byte) (n int, err error) { p.mu.Lock() defer p.mu.Unlock() if p.c.L == nil { p.c.L = &p.mu } defer p.c.Signal() if p.err != nil || p.breakErr != nil { return 0, errClosedPipeWrite } // pipe.setBuffer is never invoked, leaving the buffer uninitialized. // We shouldn't try to write to an uninitialized pipe, // but returning an error is better than panicking. if p.b == nil { return 0, errUninitializedPipeWrite } return p.b.Write(d) } // CloseWithError causes the next Read (waking up a current blocked // Read if needed) to return the provided err after all data has been // read. // // The error must be non-nil. func (p *pipe) CloseWithError(err error) { p.closeWithError(&p.err, err, nil) } // BreakWithError causes the next Read (waking up a current blocked // Read if needed) to return the provided err immediately, without // waiting for unread data. func (p *pipe) BreakWithError(err error) { p.closeWithError(&p.breakErr, err, nil) } // closeWithErrorAndCode is like CloseWithError but also sets some code to run // in the caller's goroutine before returning the error. func (p *pipe) closeWithErrorAndCode(err error, fn func()) { p.closeWithError(&p.err, err, fn) } func (p *pipe) closeWithError(dst *error, err error, fn func()) { if err == nil { panic("err must be non-nil") } p.mu.Lock() defer p.mu.Unlock() if p.c.L == nil { p.c.L = &p.mu } defer p.c.Signal() if *dst != nil { // Already been done. return } p.readFn = fn if dst == &p.breakErr { if p.b != nil { p.unread += p.b.Len() } p.b = nil } *dst = err p.closeDoneLocked() } // requires p.mu be held. func (p *pipe) closeDoneLocked() { if p.donec == nil { return } // Close if unclosed. This isn't racy since we always // hold p.mu while closing. select { case <-p.donec: default: close(p.donec) } } // Err returns the error (if any) first set by BreakWithError or CloseWithError. func (p *pipe) Err() error { p.mu.Lock() defer p.mu.Unlock() if p.breakErr != nil { return p.breakErr } return p.err } // Done returns a channel which is closed if and when this pipe is closed // with CloseWithError. func (p *pipe) Done() <-chan struct{} { p.mu.Lock() defer p.mu.Unlock() if p.donec == nil { p.donec = make(chan struct{}) if p.err != nil || p.breakErr != nil { // Already hit an error. p.closeDoneLocked() } } return p.donec } ================================================ FILE: vendor/golang.org/x/net/http2/server.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // TODO: turn off the serve goroutine when idle, so // an idle conn only has the readFrames goroutine active. (which could // also be optimized probably to pin less memory in crypto/tls). This // would involve tracking when the serve goroutine is active (atomic // int32 read/CAS probably?) and starting it up when frames arrive, // and shutting it down when all handlers exit. the occasional PING // packets could use time.AfterFunc to call sc.wakeStartServeLoop() // (which is a no-op if already running) and then queue the PING write // as normal. The serve loop would then exit in most cases (if no // Handlers running) and not be woken up again until the PING packet // returns. // TODO (maybe): add a mechanism for Handlers to going into // half-closed-local mode (rw.(io.Closer) test?) but not exit their // handler, and continue to be able to read from the // Request.Body. This would be a somewhat semantic change from HTTP/1 // (or at least what we expose in net/http), so I'd probably want to // add it there too. For now, this package says that returning from // the Handler ServeHTTP function means you're both done reading and // done writing, without a way to stop just one or the other. package http2 import ( "bufio" "bytes" "context" "crypto/rand" "crypto/tls" "errors" "fmt" "io" "log" "math" "net" "net/http" "net/textproto" "net/url" "os" "reflect" "runtime" "strconv" "strings" "sync" "time" "golang.org/x/net/http/httpguts" "golang.org/x/net/http2/hpack" "golang.org/x/net/internal/httpcommon" ) const ( prefaceTimeout = 10 * time.Second firstSettingsTimeout = 2 * time.Second // should be in-flight with preface anyway handlerChunkWriteSize = 4 << 10 defaultMaxStreams = 250 // TODO: make this 100 as the GFE seems to? // maxQueuedControlFrames is the maximum number of control frames like // SETTINGS, PING and RST_STREAM that will be queued for writing before // the connection is closed to prevent memory exhaustion attacks. maxQueuedControlFrames = 10000 ) var ( errClientDisconnected = errors.New("client disconnected") errClosedBody = errors.New("body closed by handler") errHandlerComplete = errors.New("http2: request body closed due to handler exiting") errStreamClosed = errors.New("http2: stream closed") ) var responseWriterStatePool = sync.Pool{ New: func() interface{} { rws := &responseWriterState{} rws.bw = bufio.NewWriterSize(chunkWriter{rws}, handlerChunkWriteSize) return rws }, } // Test hooks. var ( testHookOnConn func() testHookGetServerConn func(*serverConn) testHookOnPanicMu *sync.Mutex // nil except in tests testHookOnPanic func(sc *serverConn, panicVal interface{}) (rePanic bool) ) // Server is an HTTP/2 server. type Server struct { // MaxHandlers limits the number of http.Handler ServeHTTP goroutines // which may run at a time over all connections. // Negative or zero no limit. // TODO: implement MaxHandlers int // MaxConcurrentStreams optionally specifies the number of // concurrent streams that each client may have open at a // time. This is unrelated to the number of http.Handler goroutines // which may be active globally, which is MaxHandlers. // If zero, MaxConcurrentStreams defaults to at least 100, per // the HTTP/2 spec's recommendations. MaxConcurrentStreams uint32 // MaxDecoderHeaderTableSize optionally specifies the http2 // SETTINGS_HEADER_TABLE_SIZE to send in the initial settings frame. It // informs the remote endpoint of the maximum size of the header compression // table used to decode header blocks, in octets. If zero, the default value // of 4096 is used. MaxDecoderHeaderTableSize uint32 // MaxEncoderHeaderTableSize optionally specifies an upper limit for the // header compression table used for encoding request headers. Received // SETTINGS_HEADER_TABLE_SIZE settings are capped at this limit. If zero, // the default value of 4096 is used. MaxEncoderHeaderTableSize uint32 // MaxReadFrameSize optionally specifies the largest frame // this server is willing to read. A valid value is between // 16k and 16M, inclusive. If zero or otherwise invalid, a // default value is used. MaxReadFrameSize uint32 // PermitProhibitedCipherSuites, if true, permits the use of // cipher suites prohibited by the HTTP/2 spec. PermitProhibitedCipherSuites bool // IdleTimeout specifies how long until idle clients should be // closed with a GOAWAY frame. PING frames are not considered // activity for the purposes of IdleTimeout. // If zero or negative, there is no timeout. IdleTimeout time.Duration // ReadIdleTimeout is the timeout after which a health check using a ping // frame will be carried out if no frame is received on the connection. // If zero, no health check is performed. ReadIdleTimeout time.Duration // PingTimeout is the timeout after which the connection will be closed // if a response to a ping is not received. // If zero, a default of 15 seconds is used. PingTimeout time.Duration // WriteByteTimeout is the timeout after which a connection will be // closed if no data can be written to it. The timeout begins when data is // available to write, and is extended whenever any bytes are written. // If zero or negative, there is no timeout. WriteByteTimeout time.Duration // MaxUploadBufferPerConnection is the size of the initial flow // control window for each connections. The HTTP/2 spec does not // allow this to be smaller than 65535 or larger than 2^32-1. // If the value is outside this range, a default value will be // used instead. MaxUploadBufferPerConnection int32 // MaxUploadBufferPerStream is the size of the initial flow control // window for each stream. The HTTP/2 spec does not allow this to // be larger than 2^32-1. If the value is zero or larger than the // maximum, a default value will be used instead. MaxUploadBufferPerStream int32 // NewWriteScheduler constructs a write scheduler for a connection. // If nil, a default scheduler is chosen. NewWriteScheduler func() WriteScheduler // CountError, if non-nil, is called on HTTP/2 server errors. // It's intended to increment a metric for monitoring, such // as an expvar or Prometheus metric. // The errType consists of only ASCII word characters. CountError func(errType string) // Internal state. This is a pointer (rather than embedded directly) // so that we don't embed a Mutex in this struct, which will make the // struct non-copyable, which might break some callers. state *serverInternalState } type serverInternalState struct { mu sync.Mutex activeConns map[*serverConn]struct{} // Pool of error channels. This is per-Server rather than global // because channels can't be reused across synctest bubbles. errChanPool sync.Pool } func (s *serverInternalState) registerConn(sc *serverConn) { if s == nil { return // if the Server was used without calling ConfigureServer } s.mu.Lock() s.activeConns[sc] = struct{}{} s.mu.Unlock() } func (s *serverInternalState) unregisterConn(sc *serverConn) { if s == nil { return // if the Server was used without calling ConfigureServer } s.mu.Lock() delete(s.activeConns, sc) s.mu.Unlock() } func (s *serverInternalState) startGracefulShutdown() { if s == nil { return // if the Server was used without calling ConfigureServer } s.mu.Lock() for sc := range s.activeConns { sc.startGracefulShutdown() } s.mu.Unlock() } // Global error channel pool used for uninitialized Servers. // We use a per-Server pool when possible to avoid using channels across synctest bubbles. var errChanPool = sync.Pool{ New: func() any { return make(chan error, 1) }, } func (s *serverInternalState) getErrChan() chan error { if s == nil { return errChanPool.Get().(chan error) // Server used without calling ConfigureServer } return s.errChanPool.Get().(chan error) } func (s *serverInternalState) putErrChan(ch chan error) { if s == nil { errChanPool.Put(ch) // Server used without calling ConfigureServer return } s.errChanPool.Put(ch) } // ConfigureServer adds HTTP/2 support to a net/http Server. // // The configuration conf may be nil. // // ConfigureServer must be called before s begins serving. func ConfigureServer(s *http.Server, conf *Server) error { if s == nil { panic("nil *http.Server") } if conf == nil { conf = new(Server) } conf.state = &serverInternalState{ activeConns: make(map[*serverConn]struct{}), errChanPool: sync.Pool{New: func() any { return make(chan error, 1) }}, } if h1, h2 := s, conf; h2.IdleTimeout == 0 { if h1.IdleTimeout != 0 { h2.IdleTimeout = h1.IdleTimeout } else { h2.IdleTimeout = h1.ReadTimeout } } s.RegisterOnShutdown(conf.state.startGracefulShutdown) if s.TLSConfig == nil { s.TLSConfig = new(tls.Config) } else if s.TLSConfig.CipherSuites != nil && s.TLSConfig.MinVersion < tls.VersionTLS13 { // If they already provided a TLS 1.0–1.2 CipherSuite list, return an // error if it is missing ECDHE_RSA_WITH_AES_128_GCM_SHA256 or // ECDHE_ECDSA_WITH_AES_128_GCM_SHA256. haveRequired := false for _, cs := range s.TLSConfig.CipherSuites { switch cs { case tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, // Alternative MTI cipher to not discourage ECDSA-only servers. // See http://golang.org/cl/30721 for further information. tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256: haveRequired = true } } if !haveRequired { return fmt.Errorf("http2: TLSConfig.CipherSuites is missing an HTTP/2-required AES_128_GCM_SHA256 cipher (need at least one of TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 or TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256)") } } // Note: not setting MinVersion to tls.VersionTLS12, // as we don't want to interfere with HTTP/1.1 traffic // on the user's server. We enforce TLS 1.2 later once // we accept a connection. Ideally this should be done // during next-proto selection, but using TLS <1.2 with // HTTP/2 is still the client's bug. s.TLSConfig.PreferServerCipherSuites = true if !strSliceContains(s.TLSConfig.NextProtos, NextProtoTLS) { s.TLSConfig.NextProtos = append(s.TLSConfig.NextProtos, NextProtoTLS) } if !strSliceContains(s.TLSConfig.NextProtos, "http/1.1") { s.TLSConfig.NextProtos = append(s.TLSConfig.NextProtos, "http/1.1") } if s.TLSNextProto == nil { s.TLSNextProto = map[string]func(*http.Server, *tls.Conn, http.Handler){} } protoHandler := func(hs *http.Server, c net.Conn, h http.Handler, sawClientPreface bool) { if testHookOnConn != nil { testHookOnConn() } // The TLSNextProto interface predates contexts, so // the net/http package passes down its per-connection // base context via an exported but unadvertised // method on the Handler. This is for internal // net/http<=>http2 use only. var ctx context.Context type baseContexter interface { BaseContext() context.Context } if bc, ok := h.(baseContexter); ok { ctx = bc.BaseContext() } conf.ServeConn(c, &ServeConnOpts{ Context: ctx, Handler: h, BaseConfig: hs, SawClientPreface: sawClientPreface, }) } s.TLSNextProto[NextProtoTLS] = func(hs *http.Server, c *tls.Conn, h http.Handler) { protoHandler(hs, c, h, false) } // The "unencrypted_http2" TLSNextProto key is used to pass off non-TLS HTTP/2 conns. // // A connection passed in this method has already had the HTTP/2 preface read from it. s.TLSNextProto[nextProtoUnencryptedHTTP2] = func(hs *http.Server, c *tls.Conn, h http.Handler) { nc, err := unencryptedNetConnFromTLSConn(c) if err != nil { if lg := hs.ErrorLog; lg != nil { lg.Print(err) } else { log.Print(err) } go c.Close() return } protoHandler(hs, nc, h, true) } return nil } // ServeConnOpts are options for the Server.ServeConn method. type ServeConnOpts struct { // Context is the base context to use. // If nil, context.Background is used. Context context.Context // BaseConfig optionally sets the base configuration // for values. If nil, defaults are used. BaseConfig *http.Server // Handler specifies which handler to use for processing // requests. If nil, BaseConfig.Handler is used. If BaseConfig // or BaseConfig.Handler is nil, http.DefaultServeMux is used. Handler http.Handler // UpgradeRequest is an initial request received on a connection // undergoing an h2c upgrade. The request body must have been // completely read from the connection before calling ServeConn, // and the 101 Switching Protocols response written. UpgradeRequest *http.Request // Settings is the decoded contents of the HTTP2-Settings header // in an h2c upgrade request. Settings []byte // SawClientPreface is set if the HTTP/2 connection preface // has already been read from the connection. SawClientPreface bool } func (o *ServeConnOpts) context() context.Context { if o != nil && o.Context != nil { return o.Context } return context.Background() } func (o *ServeConnOpts) baseConfig() *http.Server { if o != nil && o.BaseConfig != nil { return o.BaseConfig } return new(http.Server) } func (o *ServeConnOpts) handler() http.Handler { if o != nil { if o.Handler != nil { return o.Handler } if o.BaseConfig != nil && o.BaseConfig.Handler != nil { return o.BaseConfig.Handler } } return http.DefaultServeMux } // ServeConn serves HTTP/2 requests on the provided connection and // blocks until the connection is no longer readable. // // ServeConn starts speaking HTTP/2 assuming that c has not had any // reads or writes. It writes its initial settings frame and expects // to be able to read the preface and settings frame from the // client. If c has a ConnectionState method like a *tls.Conn, the // ConnectionState is used to verify the TLS ciphersuite and to set // the Request.TLS field in Handlers. // // ServeConn does not support h2c by itself. Any h2c support must be // implemented in terms of providing a suitably-behaving net.Conn. // // The opts parameter is optional. If nil, default values are used. func (s *Server) ServeConn(c net.Conn, opts *ServeConnOpts) { if opts == nil { opts = &ServeConnOpts{} } s.serveConn(c, opts, nil) } func (s *Server) serveConn(c net.Conn, opts *ServeConnOpts, newf func(*serverConn)) { baseCtx, cancel := serverConnBaseContext(c, opts) defer cancel() http1srv := opts.baseConfig() conf := configFromServer(http1srv, s) sc := &serverConn{ srv: s, hs: http1srv, conn: c, baseCtx: baseCtx, remoteAddrStr: c.RemoteAddr().String(), bw: newBufferedWriter(c, conf.WriteByteTimeout), handler: opts.handler(), streams: make(map[uint32]*stream), readFrameCh: make(chan readFrameResult), wantWriteFrameCh: make(chan FrameWriteRequest, 8), serveMsgCh: make(chan interface{}, 8), wroteFrameCh: make(chan frameWriteResult, 1), // buffered; one send in writeFrameAsync bodyReadCh: make(chan bodyReadMsg), // buffering doesn't matter either way doneServing: make(chan struct{}), clientMaxStreams: math.MaxUint32, // Section 6.5.2: "Initially, there is no limit to this value" advMaxStreams: conf.MaxConcurrentStreams, initialStreamSendWindowSize: initialWindowSize, initialStreamRecvWindowSize: conf.MaxUploadBufferPerStream, maxFrameSize: initialMaxFrameSize, pingTimeout: conf.PingTimeout, countErrorFunc: conf.CountError, serveG: newGoroutineLock(), pushEnabled: true, sawClientPreface: opts.SawClientPreface, } if newf != nil { newf(sc) } s.state.registerConn(sc) defer s.state.unregisterConn(sc) // The net/http package sets the write deadline from the // http.Server.WriteTimeout during the TLS handshake, but then // passes the connection off to us with the deadline already set. // Write deadlines are set per stream in serverConn.newStream. // Disarm the net.Conn write deadline here. if sc.hs.WriteTimeout > 0 { sc.conn.SetWriteDeadline(time.Time{}) } switch { case s.NewWriteScheduler != nil: sc.writeSched = s.NewWriteScheduler() case clientPriorityDisabled(http1srv): sc.writeSched = newRoundRobinWriteScheduler() default: sc.writeSched = newPriorityWriteSchedulerRFC9218() } // These start at the RFC-specified defaults. If there is a higher // configured value for inflow, that will be updated when we send a // WINDOW_UPDATE shortly after sending SETTINGS. sc.flow.add(initialWindowSize) sc.inflow.init(initialWindowSize) sc.hpackEncoder = hpack.NewEncoder(&sc.headerWriteBuf) sc.hpackEncoder.SetMaxDynamicTableSizeLimit(conf.MaxEncoderHeaderTableSize) fr := NewFramer(sc.bw, c) if conf.CountError != nil { fr.countError = conf.CountError } fr.ReadMetaHeaders = hpack.NewDecoder(conf.MaxDecoderHeaderTableSize, nil) fr.MaxHeaderListSize = sc.maxHeaderListSize() fr.SetMaxReadFrameSize(conf.MaxReadFrameSize) sc.framer = fr if tc, ok := c.(connectionStater); ok { sc.tlsState = new(tls.ConnectionState) *sc.tlsState = tc.ConnectionState() // 9.2 Use of TLS Features // An implementation of HTTP/2 over TLS MUST use TLS // 1.2 or higher with the restrictions on feature set // and cipher suite described in this section. Due to // implementation limitations, it might not be // possible to fail TLS negotiation. An endpoint MUST // immediately terminate an HTTP/2 connection that // does not meet the TLS requirements described in // this section with a connection error (Section // 5.4.1) of type INADEQUATE_SECURITY. if sc.tlsState.Version < tls.VersionTLS12 { sc.rejectConn(ErrCodeInadequateSecurity, "TLS version too low") return } if sc.tlsState.ServerName == "" { // Client must use SNI, but we don't enforce that anymore, // since it was causing problems when connecting to bare IP // addresses during development. // // TODO: optionally enforce? Or enforce at the time we receive // a new request, and verify the ServerName matches the :authority? // But that precludes proxy situations, perhaps. // // So for now, do nothing here again. } if !conf.PermitProhibitedCipherSuites && isBadCipher(sc.tlsState.CipherSuite) { // "Endpoints MAY choose to generate a connection error // (Section 5.4.1) of type INADEQUATE_SECURITY if one of // the prohibited cipher suites are negotiated." // // We choose that. In my opinion, the spec is weak // here. It also says both parties must support at least // TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 so there's no // excuses here. If we really must, we could allow an // "AllowInsecureWeakCiphers" option on the server later. // Let's see how it plays out first. sc.rejectConn(ErrCodeInadequateSecurity, fmt.Sprintf("Prohibited TLS 1.2 Cipher Suite: %x", sc.tlsState.CipherSuite)) return } } if opts.Settings != nil { fr := &SettingsFrame{ FrameHeader: FrameHeader{valid: true}, p: opts.Settings, } if err := fr.ForeachSetting(sc.processSetting); err != nil { sc.rejectConn(ErrCodeProtocol, "invalid settings") return } opts.Settings = nil } if hook := testHookGetServerConn; hook != nil { hook(sc) } if opts.UpgradeRequest != nil { sc.upgradeRequest(opts.UpgradeRequest) opts.UpgradeRequest = nil } sc.serve(conf) } func serverConnBaseContext(c net.Conn, opts *ServeConnOpts) (ctx context.Context, cancel func()) { ctx, cancel = context.WithCancel(opts.context()) ctx = context.WithValue(ctx, http.LocalAddrContextKey, c.LocalAddr()) if hs := opts.baseConfig(); hs != nil { ctx = context.WithValue(ctx, http.ServerContextKey, hs) } return } func (sc *serverConn) rejectConn(err ErrCode, debug string) { sc.vlogf("http2: server rejecting conn: %v, %s", err, debug) // ignoring errors. hanging up anyway. sc.framer.WriteGoAway(0, err, []byte(debug)) sc.bw.Flush() sc.conn.Close() } type serverConn struct { // Immutable: srv *Server hs *http.Server conn net.Conn bw *bufferedWriter // writing to conn handler http.Handler baseCtx context.Context framer *Framer doneServing chan struct{} // closed when serverConn.serve ends readFrameCh chan readFrameResult // written by serverConn.readFrames wantWriteFrameCh chan FrameWriteRequest // from handlers -> serve wroteFrameCh chan frameWriteResult // from writeFrameAsync -> serve, tickles more frame writes bodyReadCh chan bodyReadMsg // from handlers -> serve serveMsgCh chan interface{} // misc messages & code to send to / run on the serve loop flow outflow // conn-wide (not stream-specific) outbound flow control inflow inflow // conn-wide inbound flow control tlsState *tls.ConnectionState // shared by all handlers, like net/http remoteAddrStr string writeSched WriteScheduler countErrorFunc func(errType string) // Everything following is owned by the serve loop; use serveG.check(): serveG goroutineLock // used to verify funcs are on serve() pushEnabled bool sawClientPreface bool // preface has already been read, used in h2c upgrade sawFirstSettings bool // got the initial SETTINGS frame after the preface needToSendSettingsAck bool unackedSettings int // how many SETTINGS have we sent without ACKs? queuedControlFrames int // control frames in the writeSched queue clientMaxStreams uint32 // SETTINGS_MAX_CONCURRENT_STREAMS from client (our PUSH_PROMISE limit) advMaxStreams uint32 // our SETTINGS_MAX_CONCURRENT_STREAMS advertised the client curClientStreams uint32 // number of open streams initiated by the client curPushedStreams uint32 // number of open streams initiated by server push curHandlers uint32 // number of running handler goroutines maxClientStreamID uint32 // max ever seen from client (odd), or 0 if there have been no client requests maxPushPromiseID uint32 // ID of the last push promise (even), or 0 if there have been no pushes streams map[uint32]*stream unstartedHandlers []unstartedHandler initialStreamSendWindowSize int32 initialStreamRecvWindowSize int32 maxFrameSize int32 peerMaxHeaderListSize uint32 // zero means unknown (default) canonHeader map[string]string // http2-lower-case -> Go-Canonical-Case canonHeaderKeysSize int // canonHeader keys size in bytes writingFrame bool // started writing a frame (on serve goroutine or separate) writingFrameAsync bool // started a frame on its own goroutine but haven't heard back on wroteFrameCh needsFrameFlush bool // last frame write wasn't a flush inGoAway bool // we've started to or sent GOAWAY inFrameScheduleLoop bool // whether we're in the scheduleFrameWrite loop needToSendGoAway bool // we need to schedule a GOAWAY frame write pingSent bool sentPingData [8]byte goAwayCode ErrCode shutdownTimer *time.Timer // nil until used idleTimer *time.Timer // nil if unused readIdleTimeout time.Duration pingTimeout time.Duration readIdleTimer *time.Timer // nil if unused // Owned by the writeFrameAsync goroutine: headerWriteBuf bytes.Buffer hpackEncoder *hpack.Encoder // Used by startGracefulShutdown. shutdownOnce sync.Once // Used for RFC 9218 prioritization. hasIntermediary bool // connection is done via an intermediary / proxy priorityAware bool // the client has sent priority signal, meaning that it is aware of it. } func (sc *serverConn) writeSchedIgnoresRFC7540() bool { switch sc.writeSched.(type) { case *priorityWriteSchedulerRFC9218: return true case *randomWriteScheduler: return true case *roundRobinWriteScheduler: return true default: return false } } func (sc *serverConn) maxHeaderListSize() uint32 { n := sc.hs.MaxHeaderBytes if n <= 0 { n = http.DefaultMaxHeaderBytes } return uint32(adjustHTTP1MaxHeaderSize(int64(n))) } func (sc *serverConn) curOpenStreams() uint32 { sc.serveG.check() return sc.curClientStreams + sc.curPushedStreams } // stream represents a stream. This is the minimal metadata needed by // the serve goroutine. Most of the actual stream state is owned by // the http.Handler's goroutine in the responseWriter. Because the // responseWriter's responseWriterState is recycled at the end of a // handler, this struct intentionally has no pointer to the // *responseWriter{,State} itself, as the Handler ending nils out the // responseWriter's state field. type stream struct { // immutable: sc *serverConn id uint32 body *pipe // non-nil if expecting DATA frames cw closeWaiter // closed wait stream transitions to closed state ctx context.Context cancelCtx func() // owned by serverConn's serve loop: bodyBytes int64 // body bytes seen so far declBodyBytes int64 // or -1 if undeclared flow outflow // limits writing from Handler to client inflow inflow // what the client is allowed to POST/etc to us state streamState resetQueued bool // RST_STREAM queued for write; set by sc.resetStream gotTrailerHeader bool // HEADER frame for trailers was seen wroteHeaders bool // whether we wrote headers (not status 100) readDeadline *time.Timer // nil if unused writeDeadline *time.Timer // nil if unused closeErr error // set before cw is closed trailer http.Header // accumulated trailers reqTrailer http.Header // handler's Request.Trailer } func (sc *serverConn) Framer() *Framer { return sc.framer } func (sc *serverConn) CloseConn() error { return sc.conn.Close() } func (sc *serverConn) Flush() error { return sc.bw.Flush() } func (sc *serverConn) HeaderEncoder() (*hpack.Encoder, *bytes.Buffer) { return sc.hpackEncoder, &sc.headerWriteBuf } func (sc *serverConn) state(streamID uint32) (streamState, *stream) { sc.serveG.check() // http://tools.ietf.org/html/rfc7540#section-5.1 if st, ok := sc.streams[streamID]; ok { return st.state, st } // "The first use of a new stream identifier implicitly closes all // streams in the "idle" state that might have been initiated by // that peer with a lower-valued stream identifier. For example, if // a client sends a HEADERS frame on stream 7 without ever sending a // frame on stream 5, then stream 5 transitions to the "closed" // state when the first frame for stream 7 is sent or received." if streamID%2 == 1 { if streamID <= sc.maxClientStreamID { return stateClosed, nil } } else { if streamID <= sc.maxPushPromiseID { return stateClosed, nil } } return stateIdle, nil } // setConnState calls the net/http ConnState hook for this connection, if configured. // Note that the net/http package does StateNew and StateClosed for us. // There is currently no plan for StateHijacked or hijacking HTTP/2 connections. func (sc *serverConn) setConnState(state http.ConnState) { if sc.hs.ConnState != nil { sc.hs.ConnState(sc.conn, state) } } func (sc *serverConn) vlogf(format string, args ...interface{}) { if VerboseLogs { sc.logf(format, args...) } } func (sc *serverConn) logf(format string, args ...interface{}) { if lg := sc.hs.ErrorLog; lg != nil { lg.Printf(format, args...) } else { log.Printf(format, args...) } } // errno returns v's underlying uintptr, else 0. // // TODO: remove this helper function once http2 can use build // tags. See comment in isClosedConnError. func errno(v error) uintptr { if rv := reflect.ValueOf(v); rv.Kind() == reflect.Uintptr { return uintptr(rv.Uint()) } return 0 } // isClosedConnError reports whether err is an error from use of a closed // network connection. func isClosedConnError(err error) bool { if err == nil { return false } if errors.Is(err, net.ErrClosed) { return true } // TODO(bradfitz): x/tools/cmd/bundle doesn't really support // build tags, so I can't make an http2_windows.go file with // Windows-specific stuff. Fix that and move this, once we // have a way to bundle this into std's net/http somehow. if runtime.GOOS == "windows" { if oe, ok := err.(*net.OpError); ok && oe.Op == "read" { if se, ok := oe.Err.(*os.SyscallError); ok && se.Syscall == "wsarecv" { const WSAECONNABORTED = 10053 const WSAECONNRESET = 10054 if n := errno(se.Err); n == WSAECONNRESET || n == WSAECONNABORTED { return true } } } } return false } func (sc *serverConn) condlogf(err error, format string, args ...interface{}) { if err == nil { return } if err == io.EOF || err == io.ErrUnexpectedEOF || isClosedConnError(err) || err == errPrefaceTimeout { // Boring, expected errors. sc.vlogf(format, args...) } else { sc.logf(format, args...) } } // maxCachedCanonicalHeadersKeysSize is an arbitrarily-chosen limit on the size // of the entries in the canonHeader cache. // This should be larger than the size of unique, uncommon header keys likely to // be sent by the peer, while not so high as to permit unreasonable memory usage // if the peer sends an unbounded number of unique header keys. const maxCachedCanonicalHeadersKeysSize = 2048 func (sc *serverConn) canonicalHeader(v string) string { sc.serveG.check() cv, ok := httpcommon.CachedCanonicalHeader(v) if ok { return cv } cv, ok = sc.canonHeader[v] if ok { return cv } if sc.canonHeader == nil { sc.canonHeader = make(map[string]string) } cv = http.CanonicalHeaderKey(v) size := 100 + len(v)*2 // 100 bytes of map overhead + key + value if sc.canonHeaderKeysSize+size <= maxCachedCanonicalHeadersKeysSize { sc.canonHeader[v] = cv sc.canonHeaderKeysSize += size } return cv } type readFrameResult struct { f Frame // valid until readMore is called err error // readMore should be called once the consumer no longer needs or // retains f. After readMore, f is invalid and more frames can be // read. readMore func() } // readFrames is the loop that reads incoming frames. // It takes care to only read one frame at a time, blocking until the // consumer is done with the frame. // It's run on its own goroutine. func (sc *serverConn) readFrames() { gate := make(chan struct{}) gateDone := func() { gate <- struct{}{} } for { f, err := sc.framer.ReadFrame() select { case sc.readFrameCh <- readFrameResult{f, err, gateDone}: case <-sc.doneServing: return } select { case <-gate: case <-sc.doneServing: return } if terminalReadFrameError(err) { return } } } // frameWriteResult is the message passed from writeFrameAsync to the serve goroutine. type frameWriteResult struct { _ incomparable wr FrameWriteRequest // what was written (or attempted) err error // result of the writeFrame call } // writeFrameAsync runs in its own goroutine and writes a single frame // and then reports when it's done. // At most one goroutine can be running writeFrameAsync at a time per // serverConn. func (sc *serverConn) writeFrameAsync(wr FrameWriteRequest, wd *writeData) { var err error if wd == nil { err = wr.write.writeFrame(sc) } else { err = sc.framer.endWrite() } sc.wroteFrameCh <- frameWriteResult{wr: wr, err: err} } func (sc *serverConn) closeAllStreamsOnConnClose() { sc.serveG.check() for _, st := range sc.streams { sc.closeStream(st, errClientDisconnected) } } func (sc *serverConn) stopShutdownTimer() { sc.serveG.check() if t := sc.shutdownTimer; t != nil { t.Stop() } } func (sc *serverConn) notePanic() { // Note: this is for serverConn.serve panicking, not http.Handler code. if testHookOnPanicMu != nil { testHookOnPanicMu.Lock() defer testHookOnPanicMu.Unlock() } if testHookOnPanic != nil { if e := recover(); e != nil { if testHookOnPanic(sc, e) { panic(e) } } } } func (sc *serverConn) serve(conf http2Config) { sc.serveG.check() defer sc.notePanic() defer sc.conn.Close() defer sc.closeAllStreamsOnConnClose() defer sc.stopShutdownTimer() defer close(sc.doneServing) // unblocks handlers trying to send if VerboseLogs { sc.vlogf("http2: server connection from %v on %p", sc.conn.RemoteAddr(), sc.hs) } settings := writeSettings{ {SettingMaxFrameSize, conf.MaxReadFrameSize}, {SettingMaxConcurrentStreams, sc.advMaxStreams}, {SettingMaxHeaderListSize, sc.maxHeaderListSize()}, {SettingHeaderTableSize, conf.MaxDecoderHeaderTableSize}, {SettingInitialWindowSize, uint32(sc.initialStreamRecvWindowSize)}, } if !disableExtendedConnectProtocol { settings = append(settings, Setting{SettingEnableConnectProtocol, 1}) } if sc.writeSchedIgnoresRFC7540() { settings = append(settings, Setting{SettingNoRFC7540Priorities, 1}) } sc.writeFrame(FrameWriteRequest{ write: settings, }) sc.unackedSettings++ // Each connection starts with initialWindowSize inflow tokens. // If a higher value is configured, we add more tokens. if diff := conf.MaxUploadBufferPerConnection - initialWindowSize; diff > 0 { sc.sendWindowUpdate(nil, int(diff)) } if err := sc.readPreface(); err != nil { sc.condlogf(err, "http2: server: error reading preface from client %v: %v", sc.conn.RemoteAddr(), err) return } // Now that we've got the preface, get us out of the // "StateNew" state. We can't go directly to idle, though. // Active means we read some data and anticipate a request. We'll // do another Active when we get a HEADERS frame. sc.setConnState(http.StateActive) sc.setConnState(http.StateIdle) if sc.srv.IdleTimeout > 0 { sc.idleTimer = time.AfterFunc(sc.srv.IdleTimeout, sc.onIdleTimer) defer sc.idleTimer.Stop() } if conf.SendPingTimeout > 0 { sc.readIdleTimeout = conf.SendPingTimeout sc.readIdleTimer = time.AfterFunc(conf.SendPingTimeout, sc.onReadIdleTimer) defer sc.readIdleTimer.Stop() } go sc.readFrames() // closed by defer sc.conn.Close above settingsTimer := time.AfterFunc(firstSettingsTimeout, sc.onSettingsTimer) defer settingsTimer.Stop() lastFrameTime := time.Now() loopNum := 0 for { loopNum++ select { case wr := <-sc.wantWriteFrameCh: if se, ok := wr.write.(StreamError); ok { sc.resetStream(se) break } sc.writeFrame(wr) case res := <-sc.wroteFrameCh: sc.wroteFrame(res) case res := <-sc.readFrameCh: lastFrameTime = time.Now() // Process any written frames before reading new frames from the client since a // written frame could have triggered a new stream to be started. if sc.writingFrameAsync { select { case wroteRes := <-sc.wroteFrameCh: sc.wroteFrame(wroteRes) default: } } if !sc.processFrameFromReader(res) { return } res.readMore() if settingsTimer != nil { settingsTimer.Stop() settingsTimer = nil } case m := <-sc.bodyReadCh: sc.noteBodyRead(m.st, m.n) case msg := <-sc.serveMsgCh: switch v := msg.(type) { case func(int): v(loopNum) // for testing case *serverMessage: switch v { case settingsTimerMsg: sc.logf("timeout waiting for SETTINGS frames from %v", sc.conn.RemoteAddr()) return case idleTimerMsg: sc.vlogf("connection is idle") sc.goAway(ErrCodeNo) case readIdleTimerMsg: sc.handlePingTimer(lastFrameTime) case shutdownTimerMsg: sc.vlogf("GOAWAY close timer fired; closing conn from %v", sc.conn.RemoteAddr()) return case gracefulShutdownMsg: sc.startGracefulShutdownInternal() case handlerDoneMsg: sc.handlerDone() default: panic("unknown timer") } case *startPushRequest: sc.startPush(v) case func(*serverConn): v(sc) default: panic(fmt.Sprintf("unexpected type %T", v)) } } // If the peer is causing us to generate a lot of control frames, // but not reading them from us, assume they are trying to make us // run out of memory. if sc.queuedControlFrames > maxQueuedControlFrames { sc.vlogf("http2: too many control frames in send queue, closing connection") return } // Start the shutdown timer after sending a GOAWAY. When sending GOAWAY // with no error code (graceful shutdown), don't start the timer until // all open streams have been completed. sentGoAway := sc.inGoAway && !sc.needToSendGoAway && !sc.writingFrame gracefulShutdownComplete := sc.goAwayCode == ErrCodeNo && sc.curOpenStreams() == 0 if sentGoAway && sc.shutdownTimer == nil && (sc.goAwayCode != ErrCodeNo || gracefulShutdownComplete) { sc.shutDownIn(goAwayTimeout) } } } func (sc *serverConn) handlePingTimer(lastFrameReadTime time.Time) { if sc.pingSent { sc.logf("timeout waiting for PING response") if f := sc.countErrorFunc; f != nil { f("conn_close_lost_ping") } sc.conn.Close() return } pingAt := lastFrameReadTime.Add(sc.readIdleTimeout) now := time.Now() if pingAt.After(now) { // We received frames since arming the ping timer. // Reset it for the next possible timeout. sc.readIdleTimer.Reset(pingAt.Sub(now)) return } sc.pingSent = true // Ignore crypto/rand.Read errors: It generally can't fail, and worse case if it does // is we send a PING frame containing 0s. _, _ = rand.Read(sc.sentPingData[:]) sc.writeFrame(FrameWriteRequest{ write: &writePing{data: sc.sentPingData}, }) sc.readIdleTimer.Reset(sc.pingTimeout) } type serverMessage int // Message values sent to serveMsgCh. var ( settingsTimerMsg = new(serverMessage) idleTimerMsg = new(serverMessage) readIdleTimerMsg = new(serverMessage) shutdownTimerMsg = new(serverMessage) gracefulShutdownMsg = new(serverMessage) handlerDoneMsg = new(serverMessage) ) func (sc *serverConn) onSettingsTimer() { sc.sendServeMsg(settingsTimerMsg) } func (sc *serverConn) onIdleTimer() { sc.sendServeMsg(idleTimerMsg) } func (sc *serverConn) onReadIdleTimer() { sc.sendServeMsg(readIdleTimerMsg) } func (sc *serverConn) onShutdownTimer() { sc.sendServeMsg(shutdownTimerMsg) } func (sc *serverConn) sendServeMsg(msg interface{}) { sc.serveG.checkNotOn() // NOT select { case sc.serveMsgCh <- msg: case <-sc.doneServing: } } var errPrefaceTimeout = errors.New("timeout waiting for client preface") // readPreface reads the ClientPreface greeting from the peer or // returns errPrefaceTimeout on timeout, or an error if the greeting // is invalid. func (sc *serverConn) readPreface() error { if sc.sawClientPreface { return nil } errc := make(chan error, 1) go func() { // Read the client preface buf := make([]byte, len(ClientPreface)) if _, err := io.ReadFull(sc.conn, buf); err != nil { errc <- err } else if !bytes.Equal(buf, clientPreface) { errc <- fmt.Errorf("bogus greeting %q", buf) } else { errc <- nil } }() timer := time.NewTimer(prefaceTimeout) // TODO: configurable on *Server? defer timer.Stop() select { case <-timer.C: return errPrefaceTimeout case err := <-errc: if err == nil { if VerboseLogs { sc.vlogf("http2: server: client %v said hello", sc.conn.RemoteAddr()) } } return err } } var writeDataPool = sync.Pool{ New: func() interface{} { return new(writeData) }, } // writeDataFromHandler writes DATA response frames from a handler on // the given stream. func (sc *serverConn) writeDataFromHandler(stream *stream, data []byte, endStream bool) error { ch := sc.srv.state.getErrChan() writeArg := writeDataPool.Get().(*writeData) *writeArg = writeData{stream.id, data, endStream} err := sc.writeFrameFromHandler(FrameWriteRequest{ write: writeArg, stream: stream, done: ch, }) if err != nil { return err } var frameWriteDone bool // the frame write is done (successfully or not) select { case err = <-ch: frameWriteDone = true case <-sc.doneServing: return errClientDisconnected case <-stream.cw: // If both ch and stream.cw were ready (as might // happen on the final Write after an http.Handler // ends), prefer the write result. Otherwise this // might just be us successfully closing the stream. // The writeFrameAsync and serve goroutines guarantee // that the ch send will happen before the stream.cw // close. select { case err = <-ch: frameWriteDone = true default: return errStreamClosed } } sc.srv.state.putErrChan(ch) if frameWriteDone { writeDataPool.Put(writeArg) } return err } // writeFrameFromHandler sends wr to sc.wantWriteFrameCh, but aborts // if the connection has gone away. // // This must not be run from the serve goroutine itself, else it might // deadlock writing to sc.wantWriteFrameCh (which is only mildly // buffered and is read by serve itself). If you're on the serve // goroutine, call writeFrame instead. func (sc *serverConn) writeFrameFromHandler(wr FrameWriteRequest) error { sc.serveG.checkNotOn() // NOT select { case sc.wantWriteFrameCh <- wr: return nil case <-sc.doneServing: // Serve loop is gone. // Client has closed their connection to the server. return errClientDisconnected } } // writeFrame schedules a frame to write and sends it if there's nothing // already being written. // // There is no pushback here (the serve goroutine never blocks). It's // the http.Handlers that block, waiting for their previous frames to // make it onto the wire // // If you're not on the serve goroutine, use writeFrameFromHandler instead. func (sc *serverConn) writeFrame(wr FrameWriteRequest) { sc.serveG.check() // If true, wr will not be written and wr.done will not be signaled. var ignoreWrite bool // We are not allowed to write frames on closed streams. RFC 7540 Section // 5.1.1 says: "An endpoint MUST NOT send frames other than PRIORITY on // a closed stream." Our server never sends PRIORITY, so that exception // does not apply. // // The serverConn might close an open stream while the stream's handler // is still running. For example, the server might close a stream when it // receives bad data from the client. If this happens, the handler might // attempt to write a frame after the stream has been closed (since the // handler hasn't yet been notified of the close). In this case, we simply // ignore the frame. The handler will notice that the stream is closed when // it waits for the frame to be written. // // As an exception to this rule, we allow sending RST_STREAM after close. // This allows us to immediately reject new streams without tracking any // state for those streams (except for the queued RST_STREAM frame). This // may result in duplicate RST_STREAMs in some cases, but the client should // ignore those. if wr.StreamID() != 0 { _, isReset := wr.write.(StreamError) if state, _ := sc.state(wr.StreamID()); state == stateClosed && !isReset { ignoreWrite = true } } // Don't send a 100-continue response if we've already sent headers. // See golang.org/issue/14030. switch wr.write.(type) { case *writeResHeaders: wr.stream.wroteHeaders = true case write100ContinueHeadersFrame: if wr.stream.wroteHeaders { // We do not need to notify wr.done because this frame is // never written with wr.done != nil. if wr.done != nil { panic("wr.done != nil for write100ContinueHeadersFrame") } ignoreWrite = true } } if !ignoreWrite { if wr.isControl() { sc.queuedControlFrames++ // For extra safety, detect wraparounds, which should not happen, // and pull the plug. if sc.queuedControlFrames < 0 { sc.conn.Close() } } sc.writeSched.Push(wr) } sc.scheduleFrameWrite() } // startFrameWrite starts a goroutine to write wr (in a separate // goroutine since that might block on the network), and updates the // serve goroutine's state about the world, updated from info in wr. func (sc *serverConn) startFrameWrite(wr FrameWriteRequest) { sc.serveG.check() if sc.writingFrame { panic("internal error: can only be writing one frame at a time") } st := wr.stream if st != nil { switch st.state { case stateHalfClosedLocal: switch wr.write.(type) { case StreamError, handlerPanicRST, writeWindowUpdate: // RFC 7540 Section 5.1 allows sending RST_STREAM, PRIORITY, and WINDOW_UPDATE // in this state. (We never send PRIORITY from the server, so that is not checked.) default: panic(fmt.Sprintf("internal error: attempt to send frame on a half-closed-local stream: %v", wr)) } case stateClosed: panic(fmt.Sprintf("internal error: attempt to send frame on a closed stream: %v", wr)) } } if wpp, ok := wr.write.(*writePushPromise); ok { var err error wpp.promisedID, err = wpp.allocatePromisedID() if err != nil { sc.writingFrameAsync = false wr.replyToWriter(err) return } } sc.writingFrame = true sc.needsFrameFlush = true if wr.write.staysWithinBuffer(sc.bw.Available()) { sc.writingFrameAsync = false err := wr.write.writeFrame(sc) sc.wroteFrame(frameWriteResult{wr: wr, err: err}) } else if wd, ok := wr.write.(*writeData); ok { // Encode the frame in the serve goroutine, to ensure we don't have // any lingering asynchronous references to data passed to Write. // See https://go.dev/issue/58446. sc.framer.startWriteDataPadded(wd.streamID, wd.endStream, wd.p, nil) sc.writingFrameAsync = true go sc.writeFrameAsync(wr, wd) } else { sc.writingFrameAsync = true go sc.writeFrameAsync(wr, nil) } } // errHandlerPanicked is the error given to any callers blocked in a read from // Request.Body when the main goroutine panics. Since most handlers read in the // main ServeHTTP goroutine, this will show up rarely. var errHandlerPanicked = errors.New("http2: handler panicked") // wroteFrame is called on the serve goroutine with the result of // whatever happened on writeFrameAsync. func (sc *serverConn) wroteFrame(res frameWriteResult) { sc.serveG.check() if !sc.writingFrame { panic("internal error: expected to be already writing a frame") } sc.writingFrame = false sc.writingFrameAsync = false if res.err != nil { sc.conn.Close() } wr := res.wr if writeEndsStream(wr.write) { st := wr.stream if st == nil { panic("internal error: expecting non-nil stream") } switch st.state { case stateOpen: // Here we would go to stateHalfClosedLocal in // theory, but since our handler is done and // the net/http package provides no mechanism // for closing a ResponseWriter while still // reading data (see possible TODO at top of // this file), we go into closed state here // anyway, after telling the peer we're // hanging up on them. We'll transition to // stateClosed after the RST_STREAM frame is // written. st.state = stateHalfClosedLocal // Section 8.1: a server MAY request that the client abort // transmission of a request without error by sending a // RST_STREAM with an error code of NO_ERROR after sending // a complete response. sc.resetStream(streamError(st.id, ErrCodeNo)) case stateHalfClosedRemote: sc.closeStream(st, errHandlerComplete) } } else { switch v := wr.write.(type) { case StreamError: // st may be unknown if the RST_STREAM was generated to reject bad input. if st, ok := sc.streams[v.StreamID]; ok { sc.closeStream(st, v) } case handlerPanicRST: sc.closeStream(wr.stream, errHandlerPanicked) } } // Reply (if requested) to unblock the ServeHTTP goroutine. wr.replyToWriter(res.err) sc.scheduleFrameWrite() } // scheduleFrameWrite tickles the frame writing scheduler. // // If a frame is already being written, nothing happens. This will be called again // when the frame is done being written. // // If a frame isn't being written and we need to send one, the best frame // to send is selected by writeSched. // // If a frame isn't being written and there's nothing else to send, we // flush the write buffer. func (sc *serverConn) scheduleFrameWrite() { sc.serveG.check() if sc.writingFrame || sc.inFrameScheduleLoop { return } sc.inFrameScheduleLoop = true for !sc.writingFrameAsync { if sc.needToSendGoAway { sc.needToSendGoAway = false sc.startFrameWrite(FrameWriteRequest{ write: &writeGoAway{ maxStreamID: sc.maxClientStreamID, code: sc.goAwayCode, }, }) continue } if sc.needToSendSettingsAck { sc.needToSendSettingsAck = false sc.startFrameWrite(FrameWriteRequest{write: writeSettingsAck{}}) continue } if !sc.inGoAway || sc.goAwayCode == ErrCodeNo { if wr, ok := sc.writeSched.Pop(); ok { if wr.isControl() { sc.queuedControlFrames-- } sc.startFrameWrite(wr) continue } } if sc.needsFrameFlush { sc.startFrameWrite(FrameWriteRequest{write: flushFrameWriter{}}) sc.needsFrameFlush = false // after startFrameWrite, since it sets this true continue } break } sc.inFrameScheduleLoop = false } // startGracefulShutdown gracefully shuts down a connection. This // sends GOAWAY with ErrCodeNo to tell the client we're gracefully // shutting down. The connection isn't closed until all current // streams are done. // // startGracefulShutdown returns immediately; it does not wait until // the connection has shut down. func (sc *serverConn) startGracefulShutdown() { sc.serveG.checkNotOn() // NOT sc.shutdownOnce.Do(func() { sc.sendServeMsg(gracefulShutdownMsg) }) } // After sending GOAWAY with an error code (non-graceful shutdown), the // connection will close after goAwayTimeout. // // If we close the connection immediately after sending GOAWAY, there may // be unsent data in our kernel receive buffer, which will cause the kernel // to send a TCP RST on close() instead of a FIN. This RST will abort the // connection immediately, whether or not the client had received the GOAWAY. // // Ideally we should delay for at least 1 RTT + epsilon so the client has // a chance to read the GOAWAY and stop sending messages. Measuring RTT // is hard, so we approximate with 1 second. See golang.org/issue/18701. // // This is a var so it can be shorter in tests, where all requests uses the // loopback interface making the expected RTT very small. // // TODO: configurable? var goAwayTimeout = 1 * time.Second func (sc *serverConn) startGracefulShutdownInternal() { sc.goAway(ErrCodeNo) } func (sc *serverConn) goAway(code ErrCode) { sc.serveG.check() if sc.inGoAway { if sc.goAwayCode == ErrCodeNo { sc.goAwayCode = code } return } sc.inGoAway = true sc.needToSendGoAway = true sc.goAwayCode = code sc.scheduleFrameWrite() } func (sc *serverConn) shutDownIn(d time.Duration) { sc.serveG.check() sc.shutdownTimer = time.AfterFunc(d, sc.onShutdownTimer) } func (sc *serverConn) resetStream(se StreamError) { sc.serveG.check() sc.writeFrame(FrameWriteRequest{write: se}) if st, ok := sc.streams[se.StreamID]; ok { st.resetQueued = true } } // processFrameFromReader processes the serve loop's read from readFrameCh from the // frame-reading goroutine. // processFrameFromReader returns whether the connection should be kept open. func (sc *serverConn) processFrameFromReader(res readFrameResult) bool { sc.serveG.check() err := res.err if err != nil { if err == ErrFrameTooLarge { sc.goAway(ErrCodeFrameSize) return true // goAway will close the loop } clientGone := err == io.EOF || err == io.ErrUnexpectedEOF || isClosedConnError(err) if clientGone { // TODO: could we also get into this state if // the peer does a half close // (e.g. CloseWrite) because they're done // sending frames but they're still wanting // our open replies? Investigate. // TODO: add CloseWrite to crypto/tls.Conn first // so we have a way to test this? I suppose // just for testing we could have a non-TLS mode. return false } } else { f := res.f if VerboseLogs { sc.vlogf("http2: server read frame %v", summarizeFrame(f)) } err = sc.processFrame(f) if err == nil { return true } } switch ev := err.(type) { case StreamError: sc.resetStream(ev) return true case goAwayFlowError: sc.goAway(ErrCodeFlowControl) return true case ConnectionError: if res.f != nil { if id := res.f.Header().StreamID; id > sc.maxClientStreamID { sc.maxClientStreamID = id } } sc.logf("http2: server connection error from %v: %v", sc.conn.RemoteAddr(), ev) sc.goAway(ErrCode(ev)) return true // goAway will handle shutdown default: if res.err != nil { sc.vlogf("http2: server closing client connection; error reading frame from client %s: %v", sc.conn.RemoteAddr(), err) } else { sc.logf("http2: server closing client connection: %v", err) } return false } } func (sc *serverConn) processFrame(f Frame) error { sc.serveG.check() // First frame received must be SETTINGS. if !sc.sawFirstSettings { if _, ok := f.(*SettingsFrame); !ok { return sc.countError("first_settings", ConnectionError(ErrCodeProtocol)) } sc.sawFirstSettings = true } // Discard frames for streams initiated after the identified last // stream sent in a GOAWAY, or all frames after sending an error. // We still need to return connection-level flow control for DATA frames. // RFC 9113 Section 6.8. if sc.inGoAway && (sc.goAwayCode != ErrCodeNo || f.Header().StreamID > sc.maxClientStreamID) { if f, ok := f.(*DataFrame); ok { if !sc.inflow.take(f.Length) { return sc.countError("data_flow", streamError(f.Header().StreamID, ErrCodeFlowControl)) } sc.sendWindowUpdate(nil, int(f.Length)) // conn-level } return nil } switch f := f.(type) { case *SettingsFrame: return sc.processSettings(f) case *MetaHeadersFrame: return sc.processHeaders(f) case *WindowUpdateFrame: return sc.processWindowUpdate(f) case *PingFrame: return sc.processPing(f) case *DataFrame: return sc.processData(f) case *RSTStreamFrame: return sc.processResetStream(f) case *PriorityFrame: return sc.processPriority(f) case *GoAwayFrame: return sc.processGoAway(f) case *PushPromiseFrame: // A client cannot push. Thus, servers MUST treat the receipt of a PUSH_PROMISE // frame as a connection error (Section 5.4.1) of type PROTOCOL_ERROR. return sc.countError("push_promise", ConnectionError(ErrCodeProtocol)) case *PriorityUpdateFrame: return sc.processPriorityUpdate(f) default: sc.vlogf("http2: server ignoring frame: %v", f.Header()) return nil } } func (sc *serverConn) processPing(f *PingFrame) error { sc.serveG.check() if f.IsAck() { if sc.pingSent && sc.sentPingData == f.Data { // This is a response to a PING we sent. sc.pingSent = false sc.readIdleTimer.Reset(sc.readIdleTimeout) } // 6.7 PING: " An endpoint MUST NOT respond to PING frames // containing this flag." return nil } if f.StreamID != 0 { // "PING frames are not associated with any individual // stream. If a PING frame is received with a stream // identifier field value other than 0x0, the recipient MUST // respond with a connection error (Section 5.4.1) of type // PROTOCOL_ERROR." return sc.countError("ping_on_stream", ConnectionError(ErrCodeProtocol)) } sc.writeFrame(FrameWriteRequest{write: writePingAck{f}}) return nil } func (sc *serverConn) processWindowUpdate(f *WindowUpdateFrame) error { sc.serveG.check() switch { case f.StreamID != 0: // stream-level flow control state, st := sc.state(f.StreamID) if state == stateIdle { // Section 5.1: "Receiving any frame other than HEADERS // or PRIORITY on a stream in this state MUST be // treated as a connection error (Section 5.4.1) of // type PROTOCOL_ERROR." return sc.countError("stream_idle", ConnectionError(ErrCodeProtocol)) } if st == nil { // "WINDOW_UPDATE can be sent by a peer that has sent a // frame bearing the END_STREAM flag. This means that a // receiver could receive a WINDOW_UPDATE frame on a "half // closed (remote)" or "closed" stream. A receiver MUST // NOT treat this as an error, see Section 5.1." return nil } if !st.flow.add(int32(f.Increment)) { return sc.countError("bad_flow", streamError(f.StreamID, ErrCodeFlowControl)) } default: // connection-level flow control if !sc.flow.add(int32(f.Increment)) { return goAwayFlowError{} } } sc.scheduleFrameWrite() return nil } func (sc *serverConn) processResetStream(f *RSTStreamFrame) error { sc.serveG.check() state, st := sc.state(f.StreamID) if state == stateIdle { // 6.4 "RST_STREAM frames MUST NOT be sent for a // stream in the "idle" state. If a RST_STREAM frame // identifying an idle stream is received, the // recipient MUST treat this as a connection error // (Section 5.4.1) of type PROTOCOL_ERROR. return sc.countError("reset_idle_stream", ConnectionError(ErrCodeProtocol)) } if st != nil { st.cancelCtx() sc.closeStream(st, streamError(f.StreamID, f.ErrCode)) } return nil } func (sc *serverConn) closeStream(st *stream, err error) { sc.serveG.check() if st.state == stateIdle || st.state == stateClosed { panic(fmt.Sprintf("invariant; can't close stream in state %v", st.state)) } st.state = stateClosed if st.readDeadline != nil { st.readDeadline.Stop() } if st.writeDeadline != nil { st.writeDeadline.Stop() } if st.isPushed() { sc.curPushedStreams-- } else { sc.curClientStreams-- } delete(sc.streams, st.id) if len(sc.streams) == 0 { sc.setConnState(http.StateIdle) if sc.srv.IdleTimeout > 0 && sc.idleTimer != nil { sc.idleTimer.Reset(sc.srv.IdleTimeout) } if h1ServerKeepAlivesDisabled(sc.hs) { sc.startGracefulShutdownInternal() } } if p := st.body; p != nil { // Return any buffered unread bytes worth of conn-level flow control. // See golang.org/issue/16481 sc.sendWindowUpdate(nil, p.Len()) p.CloseWithError(err) } if e, ok := err.(StreamError); ok { if e.Cause != nil { err = e.Cause } else { err = errStreamClosed } } st.closeErr = err st.cancelCtx() st.cw.Close() // signals Handler's CloseNotifier, unblocks writes, etc sc.writeSched.CloseStream(st.id) } func (sc *serverConn) processSettings(f *SettingsFrame) error { sc.serveG.check() if f.IsAck() { sc.unackedSettings-- if sc.unackedSettings < 0 { // Why is the peer ACKing settings we never sent? // The spec doesn't mention this case, but // hang up on them anyway. return sc.countError("ack_mystery", ConnectionError(ErrCodeProtocol)) } return nil } if f.NumSettings() > 100 || f.HasDuplicates() { // This isn't actually in the spec, but hang up on // suspiciously large settings frames or those with // duplicate entries. return sc.countError("settings_big_or_dups", ConnectionError(ErrCodeProtocol)) } if err := f.ForeachSetting(sc.processSetting); err != nil { return err } // TODO: judging by RFC 7540, Section 6.5.3 each SETTINGS frame should be // acknowledged individually, even if multiple are received before the ACK. sc.needToSendSettingsAck = true sc.scheduleFrameWrite() return nil } func (sc *serverConn) processSetting(s Setting) error { sc.serveG.check() if err := s.Valid(); err != nil { return err } if VerboseLogs { sc.vlogf("http2: server processing setting %v", s) } switch s.ID { case SettingHeaderTableSize: sc.hpackEncoder.SetMaxDynamicTableSize(s.Val) case SettingEnablePush: sc.pushEnabled = s.Val != 0 case SettingMaxConcurrentStreams: sc.clientMaxStreams = s.Val case SettingInitialWindowSize: return sc.processSettingInitialWindowSize(s.Val) case SettingMaxFrameSize: sc.maxFrameSize = int32(s.Val) // the maximum valid s.Val is < 2^31 case SettingMaxHeaderListSize: sc.peerMaxHeaderListSize = s.Val case SettingEnableConnectProtocol: // Receipt of this parameter by a server does not // have any impact case SettingNoRFC7540Priorities: if s.Val > 1 { return ConnectionError(ErrCodeProtocol) } default: // Unknown setting: "An endpoint that receives a SETTINGS // frame with any unknown or unsupported identifier MUST // ignore that setting." if VerboseLogs { sc.vlogf("http2: server ignoring unknown setting %v", s) } } return nil } func (sc *serverConn) processSettingInitialWindowSize(val uint32) error { sc.serveG.check() // Note: val already validated to be within range by // processSetting's Valid call. // "A SETTINGS frame can alter the initial flow control window // size for all current streams. When the value of // SETTINGS_INITIAL_WINDOW_SIZE changes, a receiver MUST // adjust the size of all stream flow control windows that it // maintains by the difference between the new value and the // old value." old := sc.initialStreamSendWindowSize sc.initialStreamSendWindowSize = int32(val) growth := int32(val) - old // may be negative for _, st := range sc.streams { if !st.flow.add(growth) { // 6.9.2 Initial Flow Control Window Size // "An endpoint MUST treat a change to // SETTINGS_INITIAL_WINDOW_SIZE that causes any flow // control window to exceed the maximum size as a // connection error (Section 5.4.1) of type // FLOW_CONTROL_ERROR." return sc.countError("setting_win_size", ConnectionError(ErrCodeFlowControl)) } } return nil } func (sc *serverConn) processData(f *DataFrame) error { sc.serveG.check() id := f.Header().StreamID data := f.Data() state, st := sc.state(id) if id == 0 || state == stateIdle { // Section 6.1: "DATA frames MUST be associated with a // stream. If a DATA frame is received whose stream // identifier field is 0x0, the recipient MUST respond // with a connection error (Section 5.4.1) of type // PROTOCOL_ERROR." // // Section 5.1: "Receiving any frame other than HEADERS // or PRIORITY on a stream in this state MUST be // treated as a connection error (Section 5.4.1) of // type PROTOCOL_ERROR." return sc.countError("data_on_idle", ConnectionError(ErrCodeProtocol)) } // "If a DATA frame is received whose stream is not in "open" // or "half closed (local)" state, the recipient MUST respond // with a stream error (Section 5.4.2) of type STREAM_CLOSED." if st == nil || state != stateOpen || st.gotTrailerHeader || st.resetQueued { // This includes sending a RST_STREAM if the stream is // in stateHalfClosedLocal (which currently means that // the http.Handler returned, so it's done reading & // done writing). Try to stop the client from sending // more DATA. // But still enforce their connection-level flow control, // and return any flow control bytes since we're not going // to consume them. if !sc.inflow.take(f.Length) { return sc.countError("data_flow", streamError(id, ErrCodeFlowControl)) } sc.sendWindowUpdate(nil, int(f.Length)) // conn-level if st != nil && st.resetQueued { // Already have a stream error in flight. Don't send another. return nil } return sc.countError("closed", streamError(id, ErrCodeStreamClosed)) } if st.body == nil { panic("internal error: should have a body in this state") } // Sender sending more than they'd declared? if st.declBodyBytes != -1 && st.bodyBytes+int64(len(data)) > st.declBodyBytes { if !sc.inflow.take(f.Length) { return sc.countError("data_flow", streamError(id, ErrCodeFlowControl)) } sc.sendWindowUpdate(nil, int(f.Length)) // conn-level st.body.CloseWithError(fmt.Errorf("sender tried to send more than declared Content-Length of %d bytes", st.declBodyBytes)) // RFC 7540, sec 8.1.2.6: A request or response is also malformed if the // value of a content-length header field does not equal the sum of the // DATA frame payload lengths that form the body. return sc.countError("send_too_much", streamError(id, ErrCodeProtocol)) } if f.Length > 0 { // Check whether the client has flow control quota. if !takeInflows(&sc.inflow, &st.inflow, f.Length) { return sc.countError("flow_on_data_length", streamError(id, ErrCodeFlowControl)) } if len(data) > 0 { st.bodyBytes += int64(len(data)) wrote, err := st.body.Write(data) if err != nil { // The handler has closed the request body. // Return the connection-level flow control for the discarded data, // but not the stream-level flow control. sc.sendWindowUpdate(nil, int(f.Length)-wrote) return nil } if wrote != len(data) { panic("internal error: bad Writer") } } // Return any padded flow control now, since we won't // refund it later on body reads. // Call sendWindowUpdate even if there is no padding, // to return buffered flow control credit if the sent // window has shrunk. pad := int32(f.Length) - int32(len(data)) sc.sendWindowUpdate32(nil, pad) sc.sendWindowUpdate32(st, pad) } if f.StreamEnded() { st.endStream() } return nil } func (sc *serverConn) processGoAway(f *GoAwayFrame) error { sc.serveG.check() if f.ErrCode != ErrCodeNo { sc.logf("http2: received GOAWAY %+v, starting graceful shutdown", f) } else { sc.vlogf("http2: received GOAWAY %+v, starting graceful shutdown", f) } sc.startGracefulShutdownInternal() // http://tools.ietf.org/html/rfc7540#section-6.8 // We should not create any new streams, which means we should disable push. sc.pushEnabled = false return nil } // isPushed reports whether the stream is server-initiated. func (st *stream) isPushed() bool { return st.id%2 == 0 } // endStream closes a Request.Body's pipe. It is called when a DATA // frame says a request body is over (or after trailers). func (st *stream) endStream() { sc := st.sc sc.serveG.check() if st.declBodyBytes != -1 && st.declBodyBytes != st.bodyBytes { st.body.CloseWithError(fmt.Errorf("request declared a Content-Length of %d but only wrote %d bytes", st.declBodyBytes, st.bodyBytes)) } else { st.body.closeWithErrorAndCode(io.EOF, st.copyTrailersToHandlerRequest) st.body.CloseWithError(io.EOF) } st.state = stateHalfClosedRemote } // copyTrailersToHandlerRequest is run in the Handler's goroutine in // its Request.Body.Read just before it gets io.EOF. func (st *stream) copyTrailersToHandlerRequest() { for k, vv := range st.trailer { if _, ok := st.reqTrailer[k]; ok { // Only copy it over it was pre-declared. st.reqTrailer[k] = vv } } } // onReadTimeout is run on its own goroutine (from time.AfterFunc) // when the stream's ReadTimeout has fired. func (st *stream) onReadTimeout() { if st.body != nil { // Wrap the ErrDeadlineExceeded to avoid callers depending on us // returning the bare error. st.body.CloseWithError(fmt.Errorf("%w", os.ErrDeadlineExceeded)) } } // onWriteTimeout is run on its own goroutine (from time.AfterFunc) // when the stream's WriteTimeout has fired. func (st *stream) onWriteTimeout() { st.sc.writeFrameFromHandler(FrameWriteRequest{write: StreamError{ StreamID: st.id, Code: ErrCodeInternal, Cause: os.ErrDeadlineExceeded, }}) } func (sc *serverConn) processHeaders(f *MetaHeadersFrame) error { sc.serveG.check() id := f.StreamID // http://tools.ietf.org/html/rfc7540#section-5.1.1 // Streams initiated by a client MUST use odd-numbered stream // identifiers. [...] An endpoint that receives an unexpected // stream identifier MUST respond with a connection error // (Section 5.4.1) of type PROTOCOL_ERROR. if id%2 != 1 { return sc.countError("headers_even", ConnectionError(ErrCodeProtocol)) } // A HEADERS frame can be used to create a new stream or // send a trailer for an open one. If we already have a stream // open, let it process its own HEADERS frame (trailers at this // point, if it's valid). if st := sc.streams[f.StreamID]; st != nil { if st.resetQueued { // We're sending RST_STREAM to close the stream, so don't bother // processing this frame. return nil } // RFC 7540, sec 5.1: If an endpoint receives additional frames, other than // WINDOW_UPDATE, PRIORITY, or RST_STREAM, for a stream that is in // this state, it MUST respond with a stream error (Section 5.4.2) of // type STREAM_CLOSED. if st.state == stateHalfClosedRemote { return sc.countError("headers_half_closed", streamError(id, ErrCodeStreamClosed)) } return st.processTrailerHeaders(f) } // [...] The identifier of a newly established stream MUST be // numerically greater than all streams that the initiating // endpoint has opened or reserved. [...] An endpoint that // receives an unexpected stream identifier MUST respond with // a connection error (Section 5.4.1) of type PROTOCOL_ERROR. if id <= sc.maxClientStreamID { return sc.countError("stream_went_down", ConnectionError(ErrCodeProtocol)) } sc.maxClientStreamID = id if sc.idleTimer != nil { sc.idleTimer.Stop() } // http://tools.ietf.org/html/rfc7540#section-5.1.2 // [...] Endpoints MUST NOT exceed the limit set by their peer. An // endpoint that receives a HEADERS frame that causes their // advertised concurrent stream limit to be exceeded MUST treat // this as a stream error (Section 5.4.2) of type PROTOCOL_ERROR // or REFUSED_STREAM. if sc.curClientStreams+1 > sc.advMaxStreams { if sc.unackedSettings == 0 { // They should know better. return sc.countError("over_max_streams", streamError(id, ErrCodeProtocol)) } // Assume it's a network race, where they just haven't // received our last SETTINGS update. But actually // this can't happen yet, because we don't yet provide // a way for users to adjust server parameters at // runtime. return sc.countError("over_max_streams_race", streamError(id, ErrCodeRefusedStream)) } initialState := stateOpen if f.StreamEnded() { initialState = stateHalfClosedRemote } // We are handling two special cases here: // 1. When a request is sent via an intermediary, we force priority to be // u=3,i. This is essentially a round-robin behavior, and is done to ensure // fairness between, for example, multiple clients using the same proxy. // 2. Until a client has shown that it is aware of RFC 9218, we make its // streams non-incremental by default. This is done to preserve the // historical behavior of handling streams in a round-robin manner, rather // than one-by-one to completion. initialPriority := defaultRFC9218Priority(sc.priorityAware && !sc.hasIntermediary) if _, ok := sc.writeSched.(*priorityWriteSchedulerRFC9218); ok && !sc.hasIntermediary { headerPriority, priorityAware, hasIntermediary := f.rfc9218Priority(sc.priorityAware) initialPriority = headerPriority sc.hasIntermediary = hasIntermediary if priorityAware { sc.priorityAware = true } } st := sc.newStream(id, 0, initialState, initialPriority) if f.HasPriority() { if err := sc.checkPriority(f.StreamID, f.Priority); err != nil { return err } if !sc.writeSchedIgnoresRFC7540() { sc.writeSched.AdjustStream(st.id, f.Priority) } } rw, req, err := sc.newWriterAndRequest(st, f) if err != nil { return err } st.reqTrailer = req.Trailer if st.reqTrailer != nil { st.trailer = make(http.Header) } st.body = req.Body.(*requestBody).pipe // may be nil st.declBodyBytes = req.ContentLength handler := sc.handler.ServeHTTP if f.Truncated { // Their header list was too long. Send a 431 error. handler = handleHeaderListTooLong } else if err := checkValidHTTP2RequestHeaders(req.Header); err != nil { handler = new400Handler(err) } // The net/http package sets the read deadline from the // http.Server.ReadTimeout during the TLS handshake, but then // passes the connection off to us with the deadline already // set. Disarm it here after the request headers are read, // similar to how the http1 server works. Here it's // technically more like the http1 Server's ReadHeaderTimeout // (in Go 1.8), though. That's a more sane option anyway. if sc.hs.ReadTimeout > 0 { sc.conn.SetReadDeadline(time.Time{}) st.readDeadline = time.AfterFunc(sc.hs.ReadTimeout, st.onReadTimeout) } return sc.scheduleHandler(id, rw, req, handler) } func (sc *serverConn) upgradeRequest(req *http.Request) { sc.serveG.check() id := uint32(1) sc.maxClientStreamID = id st := sc.newStream(id, 0, stateHalfClosedRemote, defaultRFC9218Priority(sc.priorityAware && !sc.hasIntermediary)) st.reqTrailer = req.Trailer if st.reqTrailer != nil { st.trailer = make(http.Header) } rw := sc.newResponseWriter(st, req) // Disable any read deadline set by the net/http package // prior to the upgrade. if sc.hs.ReadTimeout > 0 { sc.conn.SetReadDeadline(time.Time{}) } // This is the first request on the connection, // so start the handler directly rather than going // through scheduleHandler. sc.curHandlers++ go sc.runHandler(rw, req, sc.handler.ServeHTTP) } func (st *stream) processTrailerHeaders(f *MetaHeadersFrame) error { sc := st.sc sc.serveG.check() if st.gotTrailerHeader { return sc.countError("dup_trailers", ConnectionError(ErrCodeProtocol)) } st.gotTrailerHeader = true if !f.StreamEnded() { return sc.countError("trailers_not_ended", streamError(st.id, ErrCodeProtocol)) } if len(f.PseudoFields()) > 0 { return sc.countError("trailers_pseudo", streamError(st.id, ErrCodeProtocol)) } if st.trailer != nil { for _, hf := range f.RegularFields() { key := sc.canonicalHeader(hf.Name) if !httpguts.ValidTrailerHeader(key) { // TODO: send more details to the peer somehow. But http2 has // no way to send debug data at a stream level. Discuss with // HTTP folk. return sc.countError("trailers_bogus", streamError(st.id, ErrCodeProtocol)) } st.trailer[key] = append(st.trailer[key], hf.Value) } } st.endStream() return nil } func (sc *serverConn) checkPriority(streamID uint32, p PriorityParam) error { if streamID == p.StreamDep { // Section 5.3.1: "A stream cannot depend on itself. An endpoint MUST treat // this as a stream error (Section 5.4.2) of type PROTOCOL_ERROR." // Section 5.3.3 says that a stream can depend on one of its dependencies, // so it's only self-dependencies that are forbidden. return sc.countError("priority", streamError(streamID, ErrCodeProtocol)) } return nil } func (sc *serverConn) processPriority(f *PriorityFrame) error { if err := sc.checkPriority(f.StreamID, f.PriorityParam); err != nil { return err } // We need to avoid calling AdjustStream when using the RFC 9218 write // scheduler. Otherwise, incremental's zero value in PriorityParam will // unexpectedly make all streams non-incremental. This causes us to process // streams one-by-one to completion rather than doing it in a round-robin // manner (the historical behavior), which might be unexpected to users. if sc.writeSchedIgnoresRFC7540() { return nil } sc.writeSched.AdjustStream(f.StreamID, f.PriorityParam) return nil } func (sc *serverConn) processPriorityUpdate(f *PriorityUpdateFrame) error { sc.priorityAware = true if _, ok := sc.writeSched.(*priorityWriteSchedulerRFC9218); !ok { return nil } p, ok := parseRFC9218Priority(f.Priority, sc.priorityAware) if !ok { return sc.countError("unparsable_priority_update", streamError(f.PrioritizedStreamID, ErrCodeProtocol)) } sc.writeSched.AdjustStream(f.PrioritizedStreamID, p) return nil } func (sc *serverConn) newStream(id, pusherID uint32, state streamState, priority PriorityParam) *stream { sc.serveG.check() if id == 0 { panic("internal error: cannot create stream with id 0") } ctx, cancelCtx := context.WithCancel(sc.baseCtx) st := &stream{ sc: sc, id: id, state: state, ctx: ctx, cancelCtx: cancelCtx, } st.cw.Init() st.flow.conn = &sc.flow // link to conn-level counter st.flow.add(sc.initialStreamSendWindowSize) st.inflow.init(sc.initialStreamRecvWindowSize) if sc.hs.WriteTimeout > 0 { st.writeDeadline = time.AfterFunc(sc.hs.WriteTimeout, st.onWriteTimeout) } sc.streams[id] = st sc.writeSched.OpenStream(st.id, OpenStreamOptions{PusherID: pusherID, priority: priority}) if st.isPushed() { sc.curPushedStreams++ } else { sc.curClientStreams++ } if sc.curOpenStreams() == 1 { sc.setConnState(http.StateActive) } return st } func (sc *serverConn) newWriterAndRequest(st *stream, f *MetaHeadersFrame) (*responseWriter, *http.Request, error) { sc.serveG.check() rp := httpcommon.ServerRequestParam{ Method: f.PseudoValue("method"), Scheme: f.PseudoValue("scheme"), Authority: f.PseudoValue("authority"), Path: f.PseudoValue("path"), Protocol: f.PseudoValue("protocol"), } // extended connect is disabled, so we should not see :protocol if disableExtendedConnectProtocol && rp.Protocol != "" { return nil, nil, sc.countError("bad_connect", streamError(f.StreamID, ErrCodeProtocol)) } isConnect := rp.Method == "CONNECT" if isConnect { if rp.Protocol == "" && (rp.Path != "" || rp.Scheme != "" || rp.Authority == "") { return nil, nil, sc.countError("bad_connect", streamError(f.StreamID, ErrCodeProtocol)) } } else if rp.Method == "" || rp.Path == "" || (rp.Scheme != "https" && rp.Scheme != "http") { // See 8.1.2.6 Malformed Requests and Responses: // // Malformed requests or responses that are detected // MUST be treated as a stream error (Section 5.4.2) // of type PROTOCOL_ERROR." // // 8.1.2.3 Request Pseudo-Header Fields // "All HTTP/2 requests MUST include exactly one valid // value for the :method, :scheme, and :path // pseudo-header fields" return nil, nil, sc.countError("bad_path_method", streamError(f.StreamID, ErrCodeProtocol)) } header := make(http.Header) rp.Header = header for _, hf := range f.RegularFields() { header.Add(sc.canonicalHeader(hf.Name), hf.Value) } if rp.Authority == "" { rp.Authority = header.Get("Host") } if rp.Protocol != "" { header.Set(":protocol", rp.Protocol) } rw, req, err := sc.newWriterAndRequestNoBody(st, rp) if err != nil { return nil, nil, err } bodyOpen := !f.StreamEnded() if bodyOpen { if vv, ok := rp.Header["Content-Length"]; ok { if cl, err := strconv.ParseUint(vv[0], 10, 63); err == nil { req.ContentLength = int64(cl) } else { req.ContentLength = 0 } } else { req.ContentLength = -1 } req.Body.(*requestBody).pipe = &pipe{ b: &dataBuffer{expected: req.ContentLength}, } } return rw, req, nil } func (sc *serverConn) newWriterAndRequestNoBody(st *stream, rp httpcommon.ServerRequestParam) (*responseWriter, *http.Request, error) { sc.serveG.check() var tlsState *tls.ConnectionState // nil if not scheme https if rp.Scheme == "https" { tlsState = sc.tlsState } res := httpcommon.NewServerRequest(rp) if res.InvalidReason != "" { return nil, nil, sc.countError(res.InvalidReason, streamError(st.id, ErrCodeProtocol)) } body := &requestBody{ conn: sc, stream: st, needsContinue: res.NeedsContinue, } req := (&http.Request{ Method: rp.Method, URL: res.URL, RemoteAddr: sc.remoteAddrStr, Header: rp.Header, RequestURI: res.RequestURI, Proto: "HTTP/2.0", ProtoMajor: 2, ProtoMinor: 0, TLS: tlsState, Host: rp.Authority, Body: body, Trailer: res.Trailer, }).WithContext(st.ctx) rw := sc.newResponseWriter(st, req) return rw, req, nil } func (sc *serverConn) newResponseWriter(st *stream, req *http.Request) *responseWriter { rws := responseWriterStatePool.Get().(*responseWriterState) bwSave := rws.bw *rws = responseWriterState{} // zero all the fields rws.conn = sc rws.bw = bwSave rws.bw.Reset(chunkWriter{rws}) rws.stream = st rws.req = req return &responseWriter{rws: rws} } type unstartedHandler struct { streamID uint32 rw *responseWriter req *http.Request handler func(http.ResponseWriter, *http.Request) } // scheduleHandler starts a handler goroutine, // or schedules one to start as soon as an existing handler finishes. func (sc *serverConn) scheduleHandler(streamID uint32, rw *responseWriter, req *http.Request, handler func(http.ResponseWriter, *http.Request)) error { sc.serveG.check() maxHandlers := sc.advMaxStreams if sc.curHandlers < maxHandlers { sc.curHandlers++ go sc.runHandler(rw, req, handler) return nil } if len(sc.unstartedHandlers) > int(4*sc.advMaxStreams) { return sc.countError("too_many_early_resets", ConnectionError(ErrCodeEnhanceYourCalm)) } sc.unstartedHandlers = append(sc.unstartedHandlers, unstartedHandler{ streamID: streamID, rw: rw, req: req, handler: handler, }) return nil } func (sc *serverConn) handlerDone() { sc.serveG.check() sc.curHandlers-- i := 0 maxHandlers := sc.advMaxStreams for ; i < len(sc.unstartedHandlers); i++ { u := sc.unstartedHandlers[i] if sc.streams[u.streamID] == nil { // This stream was reset before its goroutine had a chance to start. continue } if sc.curHandlers >= maxHandlers { break } sc.curHandlers++ go sc.runHandler(u.rw, u.req, u.handler) sc.unstartedHandlers[i] = unstartedHandler{} // don't retain references } sc.unstartedHandlers = sc.unstartedHandlers[i:] if len(sc.unstartedHandlers) == 0 { sc.unstartedHandlers = nil } } // Run on its own goroutine. func (sc *serverConn) runHandler(rw *responseWriter, req *http.Request, handler func(http.ResponseWriter, *http.Request)) { defer sc.sendServeMsg(handlerDoneMsg) didPanic := true defer func() { rw.rws.stream.cancelCtx() if req.MultipartForm != nil { req.MultipartForm.RemoveAll() } if didPanic { e := recover() sc.writeFrameFromHandler(FrameWriteRequest{ write: handlerPanicRST{rw.rws.stream.id}, stream: rw.rws.stream, }) // Same as net/http: if e != nil && e != http.ErrAbortHandler { const size = 64 << 10 buf := make([]byte, size) buf = buf[:runtime.Stack(buf, false)] sc.logf("http2: panic serving %v: %v\n%s", sc.conn.RemoteAddr(), e, buf) } return } rw.handlerDone() }() handler(rw, req) didPanic = false } func handleHeaderListTooLong(w http.ResponseWriter, r *http.Request) { // 10.5.1 Limits on Header Block Size: // .. "A server that receives a larger header block than it is // willing to handle can send an HTTP 431 (Request Header Fields Too // Large) status code" const statusRequestHeaderFieldsTooLarge = 431 // only in Go 1.6+ w.WriteHeader(statusRequestHeaderFieldsTooLarge) io.WriteString(w, "

HTTP Error 431

Request Header Field(s) Too Large

") } // called from handler goroutines. // h may be nil. func (sc *serverConn) writeHeaders(st *stream, headerData *writeResHeaders) error { sc.serveG.checkNotOn() // NOT on var errc chan error if headerData.h != nil { // If there's a header map (which we don't own), so we have to block on // waiting for this frame to be written, so an http.Flush mid-handler // writes out the correct value of keys, before a handler later potentially // mutates it. errc = sc.srv.state.getErrChan() } if err := sc.writeFrameFromHandler(FrameWriteRequest{ write: headerData, stream: st, done: errc, }); err != nil { return err } if errc != nil { select { case err := <-errc: sc.srv.state.putErrChan(errc) return err case <-sc.doneServing: return errClientDisconnected case <-st.cw: return errStreamClosed } } return nil } // called from handler goroutines. func (sc *serverConn) write100ContinueHeaders(st *stream) { sc.writeFrameFromHandler(FrameWriteRequest{ write: write100ContinueHeadersFrame{st.id}, stream: st, }) } // A bodyReadMsg tells the server loop that the http.Handler read n // bytes of the DATA from the client on the given stream. type bodyReadMsg struct { st *stream n int } // called from handler goroutines. // Notes that the handler for the given stream ID read n bytes of its body // and schedules flow control tokens to be sent. func (sc *serverConn) noteBodyReadFromHandler(st *stream, n int, err error) { sc.serveG.checkNotOn() // NOT on if n > 0 { select { case sc.bodyReadCh <- bodyReadMsg{st, n}: case <-sc.doneServing: } } } func (sc *serverConn) noteBodyRead(st *stream, n int) { sc.serveG.check() sc.sendWindowUpdate(nil, n) // conn-level if st.state != stateHalfClosedRemote && st.state != stateClosed { // Don't send this WINDOW_UPDATE if the stream is closed // remotely. sc.sendWindowUpdate(st, n) } } // st may be nil for conn-level func (sc *serverConn) sendWindowUpdate32(st *stream, n int32) { sc.sendWindowUpdate(st, int(n)) } // st may be nil for conn-level func (sc *serverConn) sendWindowUpdate(st *stream, n int) { sc.serveG.check() var streamID uint32 var send int32 if st == nil { send = sc.inflow.add(n) } else { streamID = st.id send = st.inflow.add(n) } if send == 0 { return } sc.writeFrame(FrameWriteRequest{ write: writeWindowUpdate{streamID: streamID, n: uint32(send)}, stream: st, }) } // requestBody is the Handler's Request.Body type. // Read and Close may be called concurrently. type requestBody struct { _ incomparable stream *stream conn *serverConn closeOnce sync.Once // for use by Close only sawEOF bool // for use by Read only pipe *pipe // non-nil if we have an HTTP entity message body needsContinue bool // need to send a 100-continue } func (b *requestBody) Close() error { b.closeOnce.Do(func() { if b.pipe != nil { b.pipe.BreakWithError(errClosedBody) } }) return nil } func (b *requestBody) Read(p []byte) (n int, err error) { if b.needsContinue { b.needsContinue = false b.conn.write100ContinueHeaders(b.stream) } if b.pipe == nil || b.sawEOF { return 0, io.EOF } n, err = b.pipe.Read(p) if err == io.EOF { b.sawEOF = true } if b.conn == nil { return } b.conn.noteBodyReadFromHandler(b.stream, n, err) return } // responseWriter is the http.ResponseWriter implementation. It's // intentionally small (1 pointer wide) to minimize garbage. The // responseWriterState pointer inside is zeroed at the end of a // request (in handlerDone) and calls on the responseWriter thereafter // simply crash (caller's mistake), but the much larger responseWriterState // and buffers are reused between multiple requests. type responseWriter struct { rws *responseWriterState } // Optional http.ResponseWriter interfaces implemented. var ( _ http.CloseNotifier = (*responseWriter)(nil) _ http.Flusher = (*responseWriter)(nil) _ stringWriter = (*responseWriter)(nil) ) type responseWriterState struct { // immutable within a request: stream *stream req *http.Request conn *serverConn // TODO: adjust buffer writing sizes based on server config, frame size updates from peer, etc bw *bufio.Writer // writing to a chunkWriter{this *responseWriterState} // mutated by http.Handler goroutine: handlerHeader http.Header // nil until called snapHeader http.Header // snapshot of handlerHeader at WriteHeader time trailers []string // set in writeChunk status int // status code passed to WriteHeader wroteHeader bool // WriteHeader called (explicitly or implicitly). Not necessarily sent to user yet. sentHeader bool // have we sent the header frame? handlerDone bool // handler has finished sentContentLen int64 // non-zero if handler set a Content-Length header wroteBytes int64 closeNotifierMu sync.Mutex // guards closeNotifierCh closeNotifierCh chan bool // nil until first used } type chunkWriter struct{ rws *responseWriterState } func (cw chunkWriter) Write(p []byte) (n int, err error) { n, err = cw.rws.writeChunk(p) if err == errStreamClosed { // If writing failed because the stream has been closed, // return the reason it was closed. err = cw.rws.stream.closeErr } return n, err } func (rws *responseWriterState) hasTrailers() bool { return len(rws.trailers) > 0 } func (rws *responseWriterState) hasNonemptyTrailers() bool { for _, trailer := range rws.trailers { if _, ok := rws.handlerHeader[trailer]; ok { return true } } return false } // declareTrailer is called for each Trailer header when the // response header is written. It notes that a header will need to be // written in the trailers at the end of the response. func (rws *responseWriterState) declareTrailer(k string) { k = http.CanonicalHeaderKey(k) if !httpguts.ValidTrailerHeader(k) { // Forbidden by RFC 7230, section 4.1.2. rws.conn.logf("ignoring invalid trailer %q", k) return } if !strSliceContains(rws.trailers, k) { rws.trailers = append(rws.trailers, k) } } // writeChunk writes chunks from the bufio.Writer. But because // bufio.Writer may bypass its chunking, sometimes p may be // arbitrarily large. // // writeChunk is also responsible (on the first chunk) for sending the // HEADER response. func (rws *responseWriterState) writeChunk(p []byte) (n int, err error) { if !rws.wroteHeader { rws.writeHeader(200) } if rws.handlerDone { rws.promoteUndeclaredTrailers() } isHeadResp := rws.req.Method == "HEAD" if !rws.sentHeader { rws.sentHeader = true var ctype, clen string if clen = rws.snapHeader.Get("Content-Length"); clen != "" { rws.snapHeader.Del("Content-Length") if cl, err := strconv.ParseUint(clen, 10, 63); err == nil { rws.sentContentLen = int64(cl) } else { clen = "" } } _, hasContentLength := rws.snapHeader["Content-Length"] if !hasContentLength && clen == "" && rws.handlerDone && bodyAllowedForStatus(rws.status) && (len(p) > 0 || !isHeadResp) { clen = strconv.Itoa(len(p)) } _, hasContentType := rws.snapHeader["Content-Type"] // If the Content-Encoding is non-blank, we shouldn't // sniff the body. See Issue golang.org/issue/31753. ce := rws.snapHeader.Get("Content-Encoding") hasCE := len(ce) > 0 if !hasCE && !hasContentType && bodyAllowedForStatus(rws.status) && len(p) > 0 { ctype = http.DetectContentType(p) } var date string if _, ok := rws.snapHeader["Date"]; !ok { // TODO(bradfitz): be faster here, like net/http? measure. date = time.Now().UTC().Format(http.TimeFormat) } for _, v := range rws.snapHeader["Trailer"] { foreachHeaderElement(v, rws.declareTrailer) } // "Connection" headers aren't allowed in HTTP/2 (RFC 7540, 8.1.2.2), // but respect "Connection" == "close" to mean sending a GOAWAY and tearing // down the TCP connection when idle, like we do for HTTP/1. // TODO: remove more Connection-specific header fields here, in addition // to "Connection". if _, ok := rws.snapHeader["Connection"]; ok { v := rws.snapHeader.Get("Connection") delete(rws.snapHeader, "Connection") if v == "close" { rws.conn.startGracefulShutdown() } } endStream := (rws.handlerDone && !rws.hasTrailers() && len(p) == 0) || isHeadResp err = rws.conn.writeHeaders(rws.stream, &writeResHeaders{ streamID: rws.stream.id, httpResCode: rws.status, h: rws.snapHeader, endStream: endStream, contentType: ctype, contentLength: clen, date: date, }) if err != nil { return 0, err } if endStream { return 0, nil } } if isHeadResp { return len(p), nil } if len(p) == 0 && !rws.handlerDone { return 0, nil } // only send trailers if they have actually been defined by the // server handler. hasNonemptyTrailers := rws.hasNonemptyTrailers() endStream := rws.handlerDone && !hasNonemptyTrailers if len(p) > 0 || endStream { // only send a 0 byte DATA frame if we're ending the stream. if err := rws.conn.writeDataFromHandler(rws.stream, p, endStream); err != nil { return 0, err } } if rws.handlerDone && hasNonemptyTrailers { err = rws.conn.writeHeaders(rws.stream, &writeResHeaders{ streamID: rws.stream.id, h: rws.handlerHeader, trailers: rws.trailers, endStream: true, }) return len(p), err } return len(p), nil } // TrailerPrefix is a magic prefix for ResponseWriter.Header map keys // that, if present, signals that the map entry is actually for // the response trailers, and not the response headers. The prefix // is stripped after the ServeHTTP call finishes and the values are // sent in the trailers. // // This mechanism is intended only for trailers that are not known // prior to the headers being written. If the set of trailers is fixed // or known before the header is written, the normal Go trailers mechanism // is preferred: // // https://golang.org/pkg/net/http/#ResponseWriter // https://golang.org/pkg/net/http/#example_ResponseWriter_trailers const TrailerPrefix = "Trailer:" // promoteUndeclaredTrailers permits http.Handlers to set trailers // after the header has already been flushed. Because the Go // ResponseWriter interface has no way to set Trailers (only the // Header), and because we didn't want to expand the ResponseWriter // interface, and because nobody used trailers, and because RFC 7230 // says you SHOULD (but not must) predeclare any trailers in the // header, the official ResponseWriter rules said trailers in Go must // be predeclared, and then we reuse the same ResponseWriter.Header() // map to mean both Headers and Trailers. When it's time to write the // Trailers, we pick out the fields of Headers that were declared as // trailers. That worked for a while, until we found the first major // user of Trailers in the wild: gRPC (using them only over http2), // and gRPC libraries permit setting trailers mid-stream without // predeclaring them. So: change of plans. We still permit the old // way, but we also permit this hack: if a Header() key begins with // "Trailer:", the suffix of that key is a Trailer. Because ':' is an // invalid token byte anyway, there is no ambiguity. (And it's already // filtered out) It's mildly hacky, but not terrible. // // This method runs after the Handler is done and promotes any Header // fields to be trailers. func (rws *responseWriterState) promoteUndeclaredTrailers() { for k, vv := range rws.handlerHeader { if !strings.HasPrefix(k, TrailerPrefix) { continue } trailerKey := strings.TrimPrefix(k, TrailerPrefix) rws.declareTrailer(trailerKey) rws.handlerHeader[http.CanonicalHeaderKey(trailerKey)] = vv } if len(rws.trailers) > 1 { sorter := sorterPool.Get().(*sorter) sorter.SortStrings(rws.trailers) sorterPool.Put(sorter) } } func (w *responseWriter) SetReadDeadline(deadline time.Time) error { st := w.rws.stream if !deadline.IsZero() && deadline.Before(time.Now()) { // If we're setting a deadline in the past, reset the stream immediately // so writes after SetWriteDeadline returns will fail. st.onReadTimeout() return nil } w.rws.conn.sendServeMsg(func(sc *serverConn) { if st.readDeadline != nil { if !st.readDeadline.Stop() { // Deadline already exceeded, or stream has been closed. return } } if deadline.IsZero() { st.readDeadline = nil } else if st.readDeadline == nil { st.readDeadline = time.AfterFunc(deadline.Sub(time.Now()), st.onReadTimeout) } else { st.readDeadline.Reset(deadline.Sub(time.Now())) } }) return nil } func (w *responseWriter) SetWriteDeadline(deadline time.Time) error { st := w.rws.stream if !deadline.IsZero() && deadline.Before(time.Now()) { // If we're setting a deadline in the past, reset the stream immediately // so writes after SetWriteDeadline returns will fail. st.onWriteTimeout() return nil } w.rws.conn.sendServeMsg(func(sc *serverConn) { if st.writeDeadline != nil { if !st.writeDeadline.Stop() { // Deadline already exceeded, or stream has been closed. return } } if deadline.IsZero() { st.writeDeadline = nil } else if st.writeDeadline == nil { st.writeDeadline = time.AfterFunc(deadline.Sub(time.Now()), st.onWriteTimeout) } else { st.writeDeadline.Reset(deadline.Sub(time.Now())) } }) return nil } func (w *responseWriter) EnableFullDuplex() error { // We always support full duplex responses, so this is a no-op. return nil } func (w *responseWriter) Flush() { w.FlushError() } func (w *responseWriter) FlushError() error { rws := w.rws if rws == nil { panic("Header called after Handler finished") } var err error if rws.bw.Buffered() > 0 { err = rws.bw.Flush() } else { // The bufio.Writer won't call chunkWriter.Write // (writeChunk with zero bytes), so we have to do it // ourselves to force the HTTP response header and/or // final DATA frame (with END_STREAM) to be sent. _, err = chunkWriter{rws}.Write(nil) if err == nil { select { case <-rws.stream.cw: err = rws.stream.closeErr default: } } } return err } func (w *responseWriter) CloseNotify() <-chan bool { rws := w.rws if rws == nil { panic("CloseNotify called after Handler finished") } rws.closeNotifierMu.Lock() ch := rws.closeNotifierCh if ch == nil { ch = make(chan bool, 1) rws.closeNotifierCh = ch cw := rws.stream.cw go func() { cw.Wait() // wait for close ch <- true }() } rws.closeNotifierMu.Unlock() return ch } func (w *responseWriter) Header() http.Header { rws := w.rws if rws == nil { panic("Header called after Handler finished") } if rws.handlerHeader == nil { rws.handlerHeader = make(http.Header) } return rws.handlerHeader } // checkWriteHeaderCode is a copy of net/http's checkWriteHeaderCode. func checkWriteHeaderCode(code int) { // Issue 22880: require valid WriteHeader status codes. // For now we only enforce that it's three digits. // In the future we might block things over 599 (600 and above aren't defined // at http://httpwg.org/specs/rfc7231.html#status.codes). // But for now any three digits. // // We used to send "HTTP/1.1 000 0" on the wire in responses but there's // no equivalent bogus thing we can realistically send in HTTP/2, // so we'll consistently panic instead and help people find their bugs // early. (We can't return an error from WriteHeader even if we wanted to.) if code < 100 || code > 999 { panic(fmt.Sprintf("invalid WriteHeader code %v", code)) } } func (w *responseWriter) WriteHeader(code int) { rws := w.rws if rws == nil { panic("WriteHeader called after Handler finished") } rws.writeHeader(code) } func (rws *responseWriterState) writeHeader(code int) { if rws.wroteHeader { return } checkWriteHeaderCode(code) // Handle informational headers if code >= 100 && code <= 199 { // Per RFC 8297 we must not clear the current header map h := rws.handlerHeader _, cl := h["Content-Length"] _, te := h["Transfer-Encoding"] if cl || te { h = h.Clone() h.Del("Content-Length") h.Del("Transfer-Encoding") } rws.conn.writeHeaders(rws.stream, &writeResHeaders{ streamID: rws.stream.id, httpResCode: code, h: h, endStream: rws.handlerDone && !rws.hasTrailers(), }) return } rws.wroteHeader = true rws.status = code if len(rws.handlerHeader) > 0 { rws.snapHeader = cloneHeader(rws.handlerHeader) } } func cloneHeader(h http.Header) http.Header { h2 := make(http.Header, len(h)) for k, vv := range h { vv2 := make([]string, len(vv)) copy(vv2, vv) h2[k] = vv2 } return h2 } // The Life Of A Write is like this: // // * Handler calls w.Write or w.WriteString -> // * -> rws.bw (*bufio.Writer) -> // * (Handler might call Flush) // * -> chunkWriter{rws} // * -> responseWriterState.writeChunk(p []byte) // * -> responseWriterState.writeChunk (most of the magic; see comment there) func (w *responseWriter) Write(p []byte) (n int, err error) { return w.write(len(p), p, "") } func (w *responseWriter) WriteString(s string) (n int, err error) { return w.write(len(s), nil, s) } // either dataB or dataS is non-zero. func (w *responseWriter) write(lenData int, dataB []byte, dataS string) (n int, err error) { rws := w.rws if rws == nil { panic("Write called after Handler finished") } if !rws.wroteHeader { w.WriteHeader(200) } if !bodyAllowedForStatus(rws.status) { return 0, http.ErrBodyNotAllowed } rws.wroteBytes += int64(len(dataB)) + int64(len(dataS)) // only one can be set if rws.sentContentLen != 0 && rws.wroteBytes > rws.sentContentLen { // TODO: send a RST_STREAM return 0, errors.New("http2: handler wrote more than declared Content-Length") } if dataB != nil { return rws.bw.Write(dataB) } else { return rws.bw.WriteString(dataS) } } func (w *responseWriter) handlerDone() { rws := w.rws rws.handlerDone = true w.Flush() w.rws = nil responseWriterStatePool.Put(rws) } // Push errors. var ( ErrRecursivePush = errors.New("http2: recursive push not allowed") ErrPushLimitReached = errors.New("http2: push would exceed peer's SETTINGS_MAX_CONCURRENT_STREAMS") ) var _ http.Pusher = (*responseWriter)(nil) func (w *responseWriter) Push(target string, opts *http.PushOptions) error { st := w.rws.stream sc := st.sc sc.serveG.checkNotOn() // No recursive pushes: "PUSH_PROMISE frames MUST only be sent on a peer-initiated stream." // http://tools.ietf.org/html/rfc7540#section-6.6 if st.isPushed() { return ErrRecursivePush } if opts == nil { opts = new(http.PushOptions) } // Default options. if opts.Method == "" { opts.Method = "GET" } if opts.Header == nil { opts.Header = http.Header{} } wantScheme := "http" if w.rws.req.TLS != nil { wantScheme = "https" } // Validate the request. u, err := url.Parse(target) if err != nil { return err } if u.Scheme == "" { if !strings.HasPrefix(target, "/") { return fmt.Errorf("target must be an absolute URL or an absolute path: %q", target) } u.Scheme = wantScheme u.Host = w.rws.req.Host } else { if u.Scheme != wantScheme { return fmt.Errorf("cannot push URL with scheme %q from request with scheme %q", u.Scheme, wantScheme) } if u.Host == "" { return errors.New("URL must have a host") } } for k := range opts.Header { if strings.HasPrefix(k, ":") { return fmt.Errorf("promised request headers cannot include pseudo header %q", k) } // These headers are meaningful only if the request has a body, // but PUSH_PROMISE requests cannot have a body. // http://tools.ietf.org/html/rfc7540#section-8.2 // Also disallow Host, since the promised URL must be absolute. if asciiEqualFold(k, "content-length") || asciiEqualFold(k, "content-encoding") || asciiEqualFold(k, "trailer") || asciiEqualFold(k, "te") || asciiEqualFold(k, "expect") || asciiEqualFold(k, "host") { return fmt.Errorf("promised request headers cannot include %q", k) } } if err := checkValidHTTP2RequestHeaders(opts.Header); err != nil { return err } // The RFC effectively limits promised requests to GET and HEAD: // "Promised requests MUST be cacheable [GET, HEAD, or POST], and MUST be safe [GET or HEAD]" // http://tools.ietf.org/html/rfc7540#section-8.2 if opts.Method != "GET" && opts.Method != "HEAD" { return fmt.Errorf("method %q must be GET or HEAD", opts.Method) } msg := &startPushRequest{ parent: st, method: opts.Method, url: u, header: cloneHeader(opts.Header), done: sc.srv.state.getErrChan(), } select { case <-sc.doneServing: return errClientDisconnected case <-st.cw: return errStreamClosed case sc.serveMsgCh <- msg: } select { case <-sc.doneServing: return errClientDisconnected case <-st.cw: return errStreamClosed case err := <-msg.done: sc.srv.state.putErrChan(msg.done) return err } } type startPushRequest struct { parent *stream method string url *url.URL header http.Header done chan error } func (sc *serverConn) startPush(msg *startPushRequest) { sc.serveG.check() // http://tools.ietf.org/html/rfc7540#section-6.6. // PUSH_PROMISE frames MUST only be sent on a peer-initiated stream that // is in either the "open" or "half-closed (remote)" state. if msg.parent.state != stateOpen && msg.parent.state != stateHalfClosedRemote { // responseWriter.Push checks that the stream is peer-initiated. msg.done <- errStreamClosed return } // http://tools.ietf.org/html/rfc7540#section-6.6. if !sc.pushEnabled { msg.done <- http.ErrNotSupported return } // PUSH_PROMISE frames must be sent in increasing order by stream ID, so // we allocate an ID for the promised stream lazily, when the PUSH_PROMISE // is written. Once the ID is allocated, we start the request handler. allocatePromisedID := func() (uint32, error) { sc.serveG.check() // Check this again, just in case. Technically, we might have received // an updated SETTINGS by the time we got around to writing this frame. if !sc.pushEnabled { return 0, http.ErrNotSupported } // http://tools.ietf.org/html/rfc7540#section-6.5.2. if sc.curPushedStreams+1 > sc.clientMaxStreams { return 0, ErrPushLimitReached } // http://tools.ietf.org/html/rfc7540#section-5.1.1. // Streams initiated by the server MUST use even-numbered identifiers. // A server that is unable to establish a new stream identifier can send a GOAWAY // frame so that the client is forced to open a new connection for new streams. if sc.maxPushPromiseID+2 >= 1<<31 { sc.startGracefulShutdownInternal() return 0, ErrPushLimitReached } sc.maxPushPromiseID += 2 promisedID := sc.maxPushPromiseID // http://tools.ietf.org/html/rfc7540#section-8.2. // Strictly speaking, the new stream should start in "reserved (local)", then // transition to "half closed (remote)" after sending the initial HEADERS, but // we start in "half closed (remote)" for simplicity. // See further comments at the definition of stateHalfClosedRemote. promised := sc.newStream(promisedID, msg.parent.id, stateHalfClosedRemote, defaultRFC9218Priority(sc.priorityAware && !sc.hasIntermediary)) rw, req, err := sc.newWriterAndRequestNoBody(promised, httpcommon.ServerRequestParam{ Method: msg.method, Scheme: msg.url.Scheme, Authority: msg.url.Host, Path: msg.url.RequestURI(), Header: cloneHeader(msg.header), // clone since handler runs concurrently with writing the PUSH_PROMISE }) if err != nil { // Should not happen, since we've already validated msg.url. panic(fmt.Sprintf("newWriterAndRequestNoBody(%+v): %v", msg.url, err)) } sc.curHandlers++ go sc.runHandler(rw, req, sc.handler.ServeHTTP) return promisedID, nil } sc.writeFrame(FrameWriteRequest{ write: &writePushPromise{ streamID: msg.parent.id, method: msg.method, url: msg.url, h: msg.header, allocatePromisedID: allocatePromisedID, }, stream: msg.parent, done: msg.done, }) } // foreachHeaderElement splits v according to the "#rule" construction // in RFC 7230 section 7 and calls fn for each non-empty element. func foreachHeaderElement(v string, fn func(string)) { v = textproto.TrimString(v) if v == "" { return } if !strings.Contains(v, ",") { fn(v) return } for _, f := range strings.Split(v, ",") { if f = textproto.TrimString(f); f != "" { fn(f) } } } // From http://httpwg.org/specs/rfc7540.html#rfc.section.8.1.2.2 var connHeaders = []string{ "Connection", "Keep-Alive", "Proxy-Connection", "Transfer-Encoding", "Upgrade", } // checkValidHTTP2RequestHeaders checks whether h is a valid HTTP/2 request, // per RFC 7540 Section 8.1.2.2. // The returned error is reported to users. func checkValidHTTP2RequestHeaders(h http.Header) error { for _, k := range connHeaders { if _, ok := h[k]; ok { return fmt.Errorf("request header %q is not valid in HTTP/2", k) } } te := h["Te"] if len(te) > 0 && (len(te) > 1 || (te[0] != "trailers" && te[0] != "")) { return errors.New(`request header "TE" may only be "trailers" in HTTP/2`) } return nil } func new400Handler(err error) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { http.Error(w, err.Error(), http.StatusBadRequest) } } // h1ServerKeepAlivesDisabled reports whether hs has its keep-alives // disabled. See comments on h1ServerShutdownChan above for why // the code is written this way. func h1ServerKeepAlivesDisabled(hs *http.Server) bool { var x interface{} = hs type I interface { doKeepAlives() bool } if hs, ok := x.(I); ok { return !hs.doKeepAlives() } return false } func (sc *serverConn) countError(name string, err error) error { if sc == nil || sc.srv == nil { return err } f := sc.countErrorFunc if f == nil { return err } var typ string var code ErrCode switch e := err.(type) { case ConnectionError: typ = "conn" code = ErrCode(e) case StreamError: typ = "stream" code = ErrCode(e.Code) default: return err } codeStr := errCodeName[code] if codeStr == "" { codeStr = strconv.Itoa(int(code)) } f(fmt.Sprintf("%s_%s_%s", typ, codeStr, name)) return err } ================================================ FILE: vendor/golang.org/x/net/http2/transport.go ================================================ // Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Transport code. package http2 import ( "bufio" "bytes" "compress/flate" "compress/gzip" "context" "crypto/rand" "crypto/tls" "errors" "fmt" "io" "io/fs" "log" "math" "math/bits" mathrand "math/rand" "net" "net/http" "net/http/httptrace" "net/textproto" "strconv" "strings" "sync" "sync/atomic" "time" "golang.org/x/net/http/httpguts" "golang.org/x/net/http2/hpack" "golang.org/x/net/idna" "golang.org/x/net/internal/httpcommon" ) const ( // transportDefaultConnFlow is how many connection-level flow control // tokens we give the server at start-up, past the default 64k. transportDefaultConnFlow = 1 << 30 // transportDefaultStreamFlow is how many stream-level flow // control tokens we announce to the peer, and how many bytes // we buffer per stream. transportDefaultStreamFlow = 4 << 20 defaultUserAgent = "Go-http-client/2.0" // initialMaxConcurrentStreams is a connections maxConcurrentStreams until // it's received servers initial SETTINGS frame, which corresponds with the // spec's minimum recommended value. initialMaxConcurrentStreams = 100 // defaultMaxConcurrentStreams is a connections default maxConcurrentStreams // if the server doesn't include one in its initial SETTINGS frame. defaultMaxConcurrentStreams = 1000 ) // Transport is an HTTP/2 Transport. // // A Transport internally caches connections to servers. It is safe // for concurrent use by multiple goroutines. type Transport struct { // DialTLSContext specifies an optional dial function with context for // creating TLS connections for requests. // // If DialTLSContext and DialTLS is nil, tls.Dial is used. // // If the returned net.Conn has a ConnectionState method like tls.Conn, // it will be used to set http.Response.TLS. DialTLSContext func(ctx context.Context, network, addr string, cfg *tls.Config) (net.Conn, error) // DialTLS specifies an optional dial function for creating // TLS connections for requests. // // If DialTLSContext and DialTLS is nil, tls.Dial is used. // // Deprecated: Use DialTLSContext instead, which allows the transport // to cancel dials as soon as they are no longer needed. // If both are set, DialTLSContext takes priority. DialTLS func(network, addr string, cfg *tls.Config) (net.Conn, error) // TLSClientConfig specifies the TLS configuration to use with // tls.Client. If nil, the default configuration is used. TLSClientConfig *tls.Config // ConnPool optionally specifies an alternate connection pool to use. // If nil, the default is used. ConnPool ClientConnPool // DisableCompression, if true, prevents the Transport from // requesting compression with an "Accept-Encoding: gzip" // request header when the Request contains no existing // Accept-Encoding value. If the Transport requests gzip on // its own and gets a gzipped response, it's transparently // decoded in the Response.Body. However, if the user // explicitly requested gzip it is not automatically // uncompressed. DisableCompression bool // AllowHTTP, if true, permits HTTP/2 requests using the insecure, // plain-text "http" scheme. Note that this does not enable h2c support. AllowHTTP bool // MaxHeaderListSize is the http2 SETTINGS_MAX_HEADER_LIST_SIZE to // send in the initial settings frame. It is how many bytes // of response headers are allowed. Unlike the http2 spec, zero here // means to use a default limit (currently 10MB). If you actually // want to advertise an unlimited value to the peer, Transport // interprets the highest possible value here (0xffffffff or 1<<32-1) // to mean no limit. MaxHeaderListSize uint32 // MaxReadFrameSize is the http2 SETTINGS_MAX_FRAME_SIZE to send in the // initial settings frame. It is the size in bytes of the largest frame // payload that the sender is willing to receive. If 0, no setting is // sent, and the value is provided by the peer, which should be 16384 // according to the spec: // https://datatracker.ietf.org/doc/html/rfc7540#section-6.5.2. // Values are bounded in the range 16k to 16M. MaxReadFrameSize uint32 // MaxDecoderHeaderTableSize optionally specifies the http2 // SETTINGS_HEADER_TABLE_SIZE to send in the initial settings frame. It // informs the remote endpoint of the maximum size of the header compression // table used to decode header blocks, in octets. If zero, the default value // of 4096 is used. MaxDecoderHeaderTableSize uint32 // MaxEncoderHeaderTableSize optionally specifies an upper limit for the // header compression table used for encoding request headers. Received // SETTINGS_HEADER_TABLE_SIZE settings are capped at this limit. If zero, // the default value of 4096 is used. MaxEncoderHeaderTableSize uint32 // StrictMaxConcurrentStreams controls whether the server's // SETTINGS_MAX_CONCURRENT_STREAMS should be respected // globally. If false, new TCP connections are created to the // server as needed to keep each under the per-connection // SETTINGS_MAX_CONCURRENT_STREAMS limit. If true, the // server's SETTINGS_MAX_CONCURRENT_STREAMS is interpreted as // a global limit and callers of RoundTrip block when needed, // waiting for their turn. StrictMaxConcurrentStreams bool // IdleConnTimeout is the maximum amount of time an idle // (keep-alive) connection will remain idle before closing // itself. // Zero means no limit. IdleConnTimeout time.Duration // ReadIdleTimeout is the timeout after which a health check using ping // frame will be carried out if no frame is received on the connection. // Note that a ping response will is considered a received frame, so if // there is no other traffic on the connection, the health check will // be performed every ReadIdleTimeout interval. // If zero, no health check is performed. ReadIdleTimeout time.Duration // PingTimeout is the timeout after which the connection will be closed // if a response to Ping is not received. // Defaults to 15s. PingTimeout time.Duration // WriteByteTimeout is the timeout after which the connection will be // closed no data can be written to it. The timeout begins when data is // available to write, and is extended whenever any bytes are written. WriteByteTimeout time.Duration // CountError, if non-nil, is called on HTTP/2 transport errors. // It's intended to increment a metric for monitoring, such // as an expvar or Prometheus metric. // The errType consists of only ASCII word characters. CountError func(errType string) // t1, if non-nil, is the standard library Transport using // this transport. Its settings are used (but not its // RoundTrip method, etc). t1 *http.Transport connPoolOnce sync.Once connPoolOrDef ClientConnPool // non-nil version of ConnPool *transportTestHooks } // Hook points used for testing. // Outside of tests, t.transportTestHooks is nil and these all have minimal implementations. // Inside tests, see the testSyncHooks function docs. type transportTestHooks struct { newclientconn func(*ClientConn) } func (t *Transport) maxHeaderListSize() uint32 { n := int64(t.MaxHeaderListSize) if t.t1 != nil && t.t1.MaxResponseHeaderBytes != 0 { n = t.t1.MaxResponseHeaderBytes if n > 0 { n = adjustHTTP1MaxHeaderSize(n) } } if n <= 0 { return 10 << 20 } if n >= 0xffffffff { return 0 } return uint32(n) } func (t *Transport) disableCompression() bool { return t.DisableCompression || (t.t1 != nil && t.t1.DisableCompression) } // ConfigureTransport configures a net/http HTTP/1 Transport to use HTTP/2. // It returns an error if t1 has already been HTTP/2-enabled. // // Use ConfigureTransports instead to configure the HTTP/2 Transport. func ConfigureTransport(t1 *http.Transport) error { _, err := ConfigureTransports(t1) return err } // ConfigureTransports configures a net/http HTTP/1 Transport to use HTTP/2. // It returns a new HTTP/2 Transport for further configuration. // It returns an error if t1 has already been HTTP/2-enabled. func ConfigureTransports(t1 *http.Transport) (*Transport, error) { return configureTransports(t1) } func configureTransports(t1 *http.Transport) (*Transport, error) { connPool := new(clientConnPool) t2 := &Transport{ ConnPool: noDialClientConnPool{connPool}, t1: t1, } connPool.t = t2 if err := registerHTTPSProtocol(t1, noDialH2RoundTripper{t2}); err != nil { return nil, err } if t1.TLSClientConfig == nil { t1.TLSClientConfig = new(tls.Config) } if !strSliceContains(t1.TLSClientConfig.NextProtos, "h2") { t1.TLSClientConfig.NextProtos = append([]string{"h2"}, t1.TLSClientConfig.NextProtos...) } if !strSliceContains(t1.TLSClientConfig.NextProtos, "http/1.1") { t1.TLSClientConfig.NextProtos = append(t1.TLSClientConfig.NextProtos, "http/1.1") } upgradeFn := func(scheme, authority string, c net.Conn) http.RoundTripper { addr := authorityAddr(scheme, authority) if used, err := connPool.addConnIfNeeded(addr, t2, c); err != nil { go c.Close() return erringRoundTripper{err} } else if !used { // Turns out we don't need this c. // For example, two goroutines made requests to the same host // at the same time, both kicking off TCP dials. (since protocol // was unknown) go c.Close() } if scheme == "http" { return (*unencryptedTransport)(t2) } return t2 } if t1.TLSNextProto == nil { t1.TLSNextProto = make(map[string]func(string, *tls.Conn) http.RoundTripper) } t1.TLSNextProto[NextProtoTLS] = func(authority string, c *tls.Conn) http.RoundTripper { return upgradeFn("https", authority, c) } // The "unencrypted_http2" TLSNextProto key is used to pass off non-TLS HTTP/2 conns. t1.TLSNextProto[nextProtoUnencryptedHTTP2] = func(authority string, c *tls.Conn) http.RoundTripper { nc, err := unencryptedNetConnFromTLSConn(c) if err != nil { go c.Close() return erringRoundTripper{err} } return upgradeFn("http", authority, nc) } return t2, nil } // unencryptedTransport is a Transport with a RoundTrip method that // always permits http:// URLs. type unencryptedTransport Transport func (t *unencryptedTransport) RoundTrip(req *http.Request) (*http.Response, error) { return (*Transport)(t).RoundTripOpt(req, RoundTripOpt{allowHTTP: true}) } func (t *Transport) connPool() ClientConnPool { t.connPoolOnce.Do(t.initConnPool) return t.connPoolOrDef } func (t *Transport) initConnPool() { if t.ConnPool != nil { t.connPoolOrDef = t.ConnPool } else { t.connPoolOrDef = &clientConnPool{t: t} } } // ClientConn is the state of a single HTTP/2 client connection to an // HTTP/2 server. type ClientConn struct { t *Transport tconn net.Conn // usually *tls.Conn, except specialized impls tlsState *tls.ConnectionState // nil only for specialized impls atomicReused uint32 // whether conn is being reused; atomic singleUse bool // whether being used for a single http.Request getConnCalled bool // used by clientConnPool // readLoop goroutine fields: readerDone chan struct{} // closed on error readerErr error // set before readerDone is closed idleTimeout time.Duration // or 0 for never idleTimer *time.Timer mu sync.Mutex // guards following cond *sync.Cond // hold mu; broadcast on flow/closed changes flow outflow // our conn-level flow control quota (cs.outflow is per stream) inflow inflow // peer's conn-level flow control doNotReuse bool // whether conn is marked to not be reused for any future requests closing bool closed bool closedOnIdle bool // true if conn was closed for idleness seenSettings bool // true if we've seen a settings frame, false otherwise seenSettingsChan chan struct{} // closed when seenSettings is true or frame reading fails wantSettingsAck bool // we sent a SETTINGS frame and haven't heard back goAway *GoAwayFrame // if non-nil, the GoAwayFrame we received goAwayDebug string // goAway frame's debug data, retained as a string streams map[uint32]*clientStream // client-initiated streamsReserved int // incr by ReserveNewRequest; decr on RoundTrip nextStreamID uint32 pendingRequests int // requests blocked and waiting to be sent because len(streams) == maxConcurrentStreams pings map[[8]byte]chan struct{} // in flight ping data to notification channel br *bufio.Reader lastActive time.Time lastIdle time.Time // time last idle // Settings from peer: (also guarded by wmu) maxFrameSize uint32 maxConcurrentStreams uint32 peerMaxHeaderListSize uint64 peerMaxHeaderTableSize uint32 initialWindowSize uint32 initialStreamRecvWindowSize int32 readIdleTimeout time.Duration pingTimeout time.Duration extendedConnectAllowed bool strictMaxConcurrentStreams bool // rstStreamPingsBlocked works around an unfortunate gRPC behavior. // gRPC strictly limits the number of PING frames that it will receive. // The default is two pings per two hours, but the limit resets every time // the gRPC endpoint sends a HEADERS or DATA frame. See golang/go#70575. // // rstStreamPingsBlocked is set after receiving a response to a PING frame // bundled with an RST_STREAM (see pendingResets below), and cleared after // receiving a HEADERS or DATA frame. rstStreamPingsBlocked bool // pendingResets is the number of RST_STREAM frames we have sent to the peer, // without confirming that the peer has received them. When we send a RST_STREAM, // we bundle it with a PING frame, unless a PING is already in flight. We count // the reset stream against the connection's concurrency limit until we get // a PING response. This limits the number of requests we'll try to send to a // completely unresponsive connection. pendingResets int // readBeforeStreamID is the smallest stream ID that has not been followed by // a frame read from the peer. We use this to determine when a request may // have been sent to a completely unresponsive connection: // If the request ID is less than readBeforeStreamID, then we have had some // indication of life on the connection since sending the request. readBeforeStreamID uint32 // reqHeaderMu is a 1-element semaphore channel controlling access to sending new requests. // Write to reqHeaderMu to lock it, read from it to unlock. // Lock reqmu BEFORE mu or wmu. reqHeaderMu chan struct{} // internalStateHook reports state changes back to the net/http.ClientConn. // Note that this is different from the user state hook registered by // net/http.ClientConn.SetStateHook: The internal hook calls ClientConn, // which calls the user hook. internalStateHook func() // wmu is held while writing. // Acquire BEFORE mu when holding both, to avoid blocking mu on network writes. // Only acquire both at the same time when changing peer settings. wmu sync.Mutex bw *bufio.Writer fr *Framer werr error // first write error that has occurred hbuf bytes.Buffer // HPACK encoder writes into this henc *hpack.Encoder } // clientStream is the state for a single HTTP/2 stream. One of these // is created for each Transport.RoundTrip call. type clientStream struct { cc *ClientConn // Fields of Request that we may access even after the response body is closed. ctx context.Context reqCancel <-chan struct{} trace *httptrace.ClientTrace // or nil ID uint32 bufPipe pipe // buffered pipe with the flow-controlled response payload requestedGzip bool isHead bool abortOnce sync.Once abort chan struct{} // closed to signal stream should end immediately abortErr error // set if abort is closed peerClosed chan struct{} // closed when the peer sends an END_STREAM flag donec chan struct{} // closed after the stream is in the closed state on100 chan struct{} // buffered; written to if a 100 is received respHeaderRecv chan struct{} // closed when headers are received res *http.Response // set if respHeaderRecv is closed flow outflow // guarded by cc.mu inflow inflow // guarded by cc.mu bytesRemain int64 // -1 means unknown; owned by transportResponseBody.Read readErr error // sticky read error; owned by transportResponseBody.Read reqBody io.ReadCloser reqBodyContentLength int64 // -1 means unknown reqBodyClosed chan struct{} // guarded by cc.mu; non-nil on Close, closed when done // owned by writeRequest: sentEndStream bool // sent an END_STREAM flag to the peer sentHeaders bool // owned by clientConnReadLoop: firstByte bool // got the first response byte pastHeaders bool // got first MetaHeadersFrame (actual headers) pastTrailers bool // got optional second MetaHeadersFrame (trailers) readClosed bool // peer sent an END_STREAM flag readAborted bool // read loop reset the stream totalHeaderSize int64 // total size of 1xx headers seen trailer http.Header // accumulated trailers resTrailer *http.Header // client's Response.Trailer } var got1xxFuncForTests func(int, textproto.MIMEHeader) error // get1xxTraceFunc returns the value of request's httptrace.ClientTrace.Got1xxResponse func, // if any. It returns nil if not set or if the Go version is too old. func (cs *clientStream) get1xxTraceFunc() func(int, textproto.MIMEHeader) error { if fn := got1xxFuncForTests; fn != nil { return fn } return traceGot1xxResponseFunc(cs.trace) } func (cs *clientStream) abortStream(err error) { cs.cc.mu.Lock() defer cs.cc.mu.Unlock() cs.abortStreamLocked(err) } func (cs *clientStream) abortStreamLocked(err error) { cs.abortOnce.Do(func() { cs.abortErr = err close(cs.abort) }) if cs.reqBody != nil { cs.closeReqBodyLocked() } // TODO(dneil): Clean up tests where cs.cc.cond is nil. if cs.cc.cond != nil { // Wake up writeRequestBody if it is waiting on flow control. cs.cc.cond.Broadcast() } } func (cs *clientStream) abortRequestBodyWrite() { cc := cs.cc cc.mu.Lock() defer cc.mu.Unlock() if cs.reqBody != nil && cs.reqBodyClosed == nil { cs.closeReqBodyLocked() cc.cond.Broadcast() } } func (cs *clientStream) closeReqBodyLocked() { if cs.reqBodyClosed != nil { return } cs.reqBodyClosed = make(chan struct{}) reqBodyClosed := cs.reqBodyClosed go func() { cs.reqBody.Close() close(reqBodyClosed) }() } type stickyErrWriter struct { conn net.Conn timeout time.Duration err *error } func (sew stickyErrWriter) Write(p []byte) (n int, err error) { if *sew.err != nil { return 0, *sew.err } n, err = writeWithByteTimeout(sew.conn, sew.timeout, p) *sew.err = err return n, err } // noCachedConnError is the concrete type of ErrNoCachedConn, which // needs to be detected by net/http regardless of whether it's its // bundled version (in h2_bundle.go with a rewritten type name) or // from a user's x/net/http2. As such, as it has a unique method name // (IsHTTP2NoCachedConnError) that net/http sniffs for via func // isNoCachedConnError. type noCachedConnError struct{} func (noCachedConnError) IsHTTP2NoCachedConnError() {} func (noCachedConnError) Error() string { return "http2: no cached connection was available" } // isNoCachedConnError reports whether err is of type noCachedConnError // or its equivalent renamed type in net/http2's h2_bundle.go. Both types // may coexist in the same running program. func isNoCachedConnError(err error) bool { _, ok := err.(interface{ IsHTTP2NoCachedConnError() }) return ok } var ErrNoCachedConn error = noCachedConnError{} // RoundTripOpt are options for the Transport.RoundTripOpt method. type RoundTripOpt struct { // OnlyCachedConn controls whether RoundTripOpt may // create a new TCP connection. If set true and // no cached connection is available, RoundTripOpt // will return ErrNoCachedConn. OnlyCachedConn bool allowHTTP bool // allow http:// URLs } func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) { return t.RoundTripOpt(req, RoundTripOpt{}) } // authorityAddr returns a given authority (a host/IP, or host:port / ip:port) // and returns a host:port. The port 443 is added if needed. func authorityAddr(scheme string, authority string) (addr string) { host, port, err := net.SplitHostPort(authority) if err != nil { // authority didn't have a port host = authority port = "" } if port == "" { // authority's port was empty port = "443" if scheme == "http" { port = "80" } } if a, err := idna.ToASCII(host); err == nil { host = a } // IPv6 address literal, without a port: if strings.HasPrefix(host, "[") && strings.HasSuffix(host, "]") { return host + ":" + port } return net.JoinHostPort(host, port) } // RoundTripOpt is like RoundTrip, but takes options. func (t *Transport) RoundTripOpt(req *http.Request, opt RoundTripOpt) (*http.Response, error) { switch req.URL.Scheme { case "https": // Always okay. case "http": if !t.AllowHTTP && !opt.allowHTTP { return nil, errors.New("http2: unencrypted HTTP/2 not enabled") } default: return nil, errors.New("http2: unsupported scheme") } addr := authorityAddr(req.URL.Scheme, req.URL.Host) for retry := 0; ; retry++ { cc, err := t.connPool().GetClientConn(req, addr) if err != nil { t.vlogf("http2: Transport failed to get client conn for %s: %v", addr, err) return nil, err } reused := !atomic.CompareAndSwapUint32(&cc.atomicReused, 0, 1) traceGotConn(req, cc, reused) res, err := cc.RoundTrip(req) if err != nil && retry <= 6 { roundTripErr := err if req, err = shouldRetryRequest(req, err); err == nil { // After the first retry, do exponential backoff with 10% jitter. if retry == 0 { t.vlogf("RoundTrip retrying after failure: %v", roundTripErr) continue } backoff := float64(uint(1) << (uint(retry) - 1)) backoff += backoff * (0.1 * mathrand.Float64()) d := time.Second * time.Duration(backoff) tm := time.NewTimer(d) select { case <-tm.C: t.vlogf("RoundTrip retrying after failure: %v", roundTripErr) continue case <-req.Context().Done(): tm.Stop() err = req.Context().Err() } } } if err == errClientConnNotEstablished { // This ClientConn was created recently, // this is the first request to use it, // and the connection is closed and not usable. // // In this state, cc.idleTimer will remove the conn from the pool // when it fires. Stop the timer and remove it here so future requests // won't try to use this connection. // // If the timer has already fired and we're racing it, the redundant // call to MarkDead is harmless. if cc.idleTimer != nil { cc.idleTimer.Stop() } t.connPool().MarkDead(cc) } if err != nil { t.vlogf("RoundTrip failure: %v", err) return nil, err } return res, nil } } // CloseIdleConnections closes any connections which were previously // connected from previous requests but are now sitting idle. // It does not interrupt any connections currently in use. func (t *Transport) CloseIdleConnections() { if cp, ok := t.connPool().(clientConnPoolIdleCloser); ok { cp.closeIdleConnections() } } var ( errClientConnClosed = errors.New("http2: client conn is closed") errClientConnUnusable = errors.New("http2: client conn not usable") errClientConnNotEstablished = errors.New("http2: client conn could not be established") errClientConnGotGoAway = errors.New("http2: Transport received Server's graceful shutdown GOAWAY") errClientConnForceClosed = errors.New("http2: client connection force closed via ClientConn.Close") ) // shouldRetryRequest is called by RoundTrip when a request fails to get // response headers. It is always called with a non-nil error. // It returns either a request to retry (either the same request, or a // modified clone), or an error if the request can't be replayed. func shouldRetryRequest(req *http.Request, err error) (*http.Request, error) { if !canRetryError(err) { return nil, err } // If the Body is nil (or http.NoBody), it's safe to reuse // this request and its Body. if req.Body == nil || req.Body == http.NoBody { return req, nil } // If the request body can be reset back to its original // state via the optional req.GetBody, do that. if req.GetBody != nil { body, err := req.GetBody() if err != nil { return nil, err } newReq := *req newReq.Body = body return &newReq, nil } // The Request.Body can't reset back to the beginning, but we // don't seem to have started to read from it yet, so reuse // the request directly. if err == errClientConnUnusable { return req, nil } return nil, fmt.Errorf("http2: Transport: cannot retry err [%v] after Request.Body was written; define Request.GetBody to avoid this error", err) } func canRetryError(err error) bool { if err == errClientConnUnusable || err == errClientConnGotGoAway { return true } if se, ok := err.(StreamError); ok { if se.Code == ErrCodeProtocol && se.Cause == errFromPeer { // See golang/go#47635, golang/go#42777 return true } return se.Code == ErrCodeRefusedStream } return false } func (t *Transport) dialClientConn(ctx context.Context, addr string, singleUse bool) (*ClientConn, error) { if t.transportTestHooks != nil { return t.newClientConn(nil, singleUse, nil) } host, _, err := net.SplitHostPort(addr) if err != nil { return nil, err } tconn, err := t.dialTLS(ctx, "tcp", addr, t.newTLSConfig(host)) if err != nil { return nil, err } return t.newClientConn(tconn, singleUse, nil) } func (t *Transport) newTLSConfig(host string) *tls.Config { cfg := new(tls.Config) if t.TLSClientConfig != nil { *cfg = *t.TLSClientConfig.Clone() } if !strSliceContains(cfg.NextProtos, NextProtoTLS) { cfg.NextProtos = append([]string{NextProtoTLS}, cfg.NextProtos...) } if cfg.ServerName == "" { cfg.ServerName = host } return cfg } func (t *Transport) dialTLS(ctx context.Context, network, addr string, tlsCfg *tls.Config) (net.Conn, error) { if t.DialTLSContext != nil { return t.DialTLSContext(ctx, network, addr, tlsCfg) } else if t.DialTLS != nil { return t.DialTLS(network, addr, tlsCfg) } tlsCn, err := t.dialTLSWithContext(ctx, network, addr, tlsCfg) if err != nil { return nil, err } state := tlsCn.ConnectionState() if p := state.NegotiatedProtocol; p != NextProtoTLS { return nil, fmt.Errorf("http2: unexpected ALPN protocol %q; want %q", p, NextProtoTLS) } if !state.NegotiatedProtocolIsMutual { return nil, errors.New("http2: could not negotiate protocol mutually") } return tlsCn, nil } // disableKeepAlives reports whether connections should be closed as // soon as possible after handling the first request. func (t *Transport) disableKeepAlives() bool { return t.t1 != nil && t.t1.DisableKeepAlives } func (t *Transport) expectContinueTimeout() time.Duration { if t.t1 == nil { return 0 } return t.t1.ExpectContinueTimeout } func (t *Transport) NewClientConn(c net.Conn) (*ClientConn, error) { return t.newClientConn(c, t.disableKeepAlives(), nil) } func (t *Transport) newClientConn(c net.Conn, singleUse bool, internalStateHook func()) (*ClientConn, error) { conf := configFromTransport(t) cc := &ClientConn{ t: t, tconn: c, readerDone: make(chan struct{}), nextStreamID: 1, maxFrameSize: 16 << 10, // spec default initialWindowSize: 65535, // spec default initialStreamRecvWindowSize: conf.MaxUploadBufferPerStream, maxConcurrentStreams: initialMaxConcurrentStreams, // "infinite", per spec. Use a smaller value until we have received server settings. strictMaxConcurrentStreams: conf.StrictMaxConcurrentRequests, peerMaxHeaderListSize: 0xffffffffffffffff, // "infinite", per spec. Use 2^64-1 instead. streams: make(map[uint32]*clientStream), singleUse: singleUse, seenSettingsChan: make(chan struct{}), wantSettingsAck: true, readIdleTimeout: conf.SendPingTimeout, pingTimeout: conf.PingTimeout, pings: make(map[[8]byte]chan struct{}), reqHeaderMu: make(chan struct{}, 1), lastActive: time.Now(), internalStateHook: internalStateHook, } if t.transportTestHooks != nil { t.transportTestHooks.newclientconn(cc) c = cc.tconn } if VerboseLogs { t.vlogf("http2: Transport creating client conn %p to %v", cc, c.RemoteAddr()) } cc.cond = sync.NewCond(&cc.mu) cc.flow.add(int32(initialWindowSize)) // TODO: adjust this writer size to account for frame size + // MTU + crypto/tls record padding. cc.bw = bufio.NewWriter(stickyErrWriter{ conn: c, timeout: conf.WriteByteTimeout, err: &cc.werr, }) cc.br = bufio.NewReader(c) cc.fr = NewFramer(cc.bw, cc.br) cc.fr.SetMaxReadFrameSize(conf.MaxReadFrameSize) if t.CountError != nil { cc.fr.countError = t.CountError } maxHeaderTableSize := conf.MaxDecoderHeaderTableSize cc.fr.ReadMetaHeaders = hpack.NewDecoder(maxHeaderTableSize, nil) cc.fr.MaxHeaderListSize = t.maxHeaderListSize() cc.henc = hpack.NewEncoder(&cc.hbuf) cc.henc.SetMaxDynamicTableSizeLimit(conf.MaxEncoderHeaderTableSize) cc.peerMaxHeaderTableSize = initialHeaderTableSize if cs, ok := c.(connectionStater); ok { state := cs.ConnectionState() cc.tlsState = &state } initialSettings := []Setting{ {ID: SettingEnablePush, Val: 0}, {ID: SettingInitialWindowSize, Val: uint32(cc.initialStreamRecvWindowSize)}, } initialSettings = append(initialSettings, Setting{ID: SettingMaxFrameSize, Val: conf.MaxReadFrameSize}) if max := t.maxHeaderListSize(); max != 0 { initialSettings = append(initialSettings, Setting{ID: SettingMaxHeaderListSize, Val: max}) } if maxHeaderTableSize != initialHeaderTableSize { initialSettings = append(initialSettings, Setting{ID: SettingHeaderTableSize, Val: maxHeaderTableSize}) } cc.bw.Write(clientPreface) cc.fr.WriteSettings(initialSettings...) cc.fr.WriteWindowUpdate(0, uint32(conf.MaxUploadBufferPerConnection)) cc.inflow.init(conf.MaxUploadBufferPerConnection + initialWindowSize) cc.bw.Flush() if cc.werr != nil { cc.Close() return nil, cc.werr } // Start the idle timer after the connection is fully initialized. if d := t.idleConnTimeout(); d != 0 { cc.idleTimeout = d cc.idleTimer = time.AfterFunc(d, cc.onIdleTimeout) } go cc.readLoop() return cc, nil } func (cc *ClientConn) healthCheck() { pingTimeout := cc.pingTimeout // We don't need to periodically ping in the health check, because the readLoop of ClientConn will // trigger the healthCheck again if there is no frame received. ctx, cancel := context.WithTimeout(context.Background(), pingTimeout) defer cancel() cc.vlogf("http2: Transport sending health check") err := cc.Ping(ctx) if err != nil { cc.vlogf("http2: Transport health check failure: %v", err) cc.closeForLostPing() } else { cc.vlogf("http2: Transport health check success") } } // SetDoNotReuse marks cc as not reusable for future HTTP requests. func (cc *ClientConn) SetDoNotReuse() { cc.mu.Lock() defer cc.mu.Unlock() cc.doNotReuse = true } func (cc *ClientConn) setGoAway(f *GoAwayFrame) { cc.mu.Lock() defer cc.mu.Unlock() old := cc.goAway cc.goAway = f // Merge the previous and current GoAway error frames. if cc.goAwayDebug == "" { cc.goAwayDebug = string(f.DebugData()) } if old != nil && old.ErrCode != ErrCodeNo { cc.goAway.ErrCode = old.ErrCode } last := f.LastStreamID for streamID, cs := range cc.streams { if streamID <= last { // The server's GOAWAY indicates that it received this stream. // It will either finish processing it, or close the connection // without doing so. Either way, leave the stream alone for now. continue } if streamID == 1 && cc.goAway.ErrCode != ErrCodeNo { // Don't retry the first stream on a connection if we get a non-NO error. // If the server is sending an error on a new connection, // retrying the request on a new one probably isn't going to work. cs.abortStreamLocked(fmt.Errorf("http2: Transport received GOAWAY from server ErrCode:%v", cc.goAway.ErrCode)) } else { // Aborting the stream with errClentConnGotGoAway indicates that // the request should be retried on a new connection. cs.abortStreamLocked(errClientConnGotGoAway) } } } // CanTakeNewRequest reports whether the connection can take a new request, // meaning it has not been closed or received or sent a GOAWAY. // // If the caller is going to immediately make a new request on this // connection, use ReserveNewRequest instead. func (cc *ClientConn) CanTakeNewRequest() bool { cc.mu.Lock() defer cc.mu.Unlock() return cc.canTakeNewRequestLocked() } // ReserveNewRequest is like CanTakeNewRequest but also reserves a // concurrent stream in cc. The reservation is decremented on the // next call to RoundTrip. func (cc *ClientConn) ReserveNewRequest() bool { cc.mu.Lock() defer cc.mu.Unlock() if st := cc.idleStateLocked(); !st.canTakeNewRequest { return false } cc.streamsReserved++ return true } // ClientConnState describes the state of a ClientConn. type ClientConnState struct { // Closed is whether the connection is closed. Closed bool // Closing is whether the connection is in the process of // closing. It may be closing due to shutdown, being a // single-use connection, being marked as DoNotReuse, or // having received a GOAWAY frame. Closing bool // StreamsActive is how many streams are active. StreamsActive int // StreamsReserved is how many streams have been reserved via // ClientConn.ReserveNewRequest. StreamsReserved int // StreamsPending is how many requests have been sent in excess // of the peer's advertised MaxConcurrentStreams setting and // are waiting for other streams to complete. StreamsPending int // MaxConcurrentStreams is how many concurrent streams the // peer advertised as acceptable. Zero means no SETTINGS // frame has been received yet. MaxConcurrentStreams uint32 // LastIdle, if non-zero, is when the connection last // transitioned to idle state. LastIdle time.Time } // State returns a snapshot of cc's state. func (cc *ClientConn) State() ClientConnState { cc.wmu.Lock() maxConcurrent := cc.maxConcurrentStreams if !cc.seenSettings { maxConcurrent = 0 } cc.wmu.Unlock() cc.mu.Lock() defer cc.mu.Unlock() return ClientConnState{ Closed: cc.closed, Closing: cc.closing || cc.singleUse || cc.doNotReuse || cc.goAway != nil, StreamsActive: len(cc.streams) + cc.pendingResets, StreamsReserved: cc.streamsReserved, StreamsPending: cc.pendingRequests, LastIdle: cc.lastIdle, MaxConcurrentStreams: maxConcurrent, } } // clientConnIdleState describes the suitability of a client // connection to initiate a new RoundTrip request. type clientConnIdleState struct { canTakeNewRequest bool } func (cc *ClientConn) idleState() clientConnIdleState { cc.mu.Lock() defer cc.mu.Unlock() return cc.idleStateLocked() } func (cc *ClientConn) idleStateLocked() (st clientConnIdleState) { if cc.singleUse && cc.nextStreamID > 1 { return } var maxConcurrentOkay bool if cc.strictMaxConcurrentStreams { // We'll tell the caller we can take a new request to // prevent the caller from dialing a new TCP // connection, but then we'll block later before // writing it. maxConcurrentOkay = true } else { // We can take a new request if the total of // - active streams; // - reservation slots for new streams; and // - streams for which we have sent a RST_STREAM and a PING, // but received no subsequent frame // is less than the concurrency limit. maxConcurrentOkay = cc.currentRequestCountLocked() < int(cc.maxConcurrentStreams) } st.canTakeNewRequest = maxConcurrentOkay && cc.isUsableLocked() // If this connection has never been used for a request and is closed, // then let it take a request (which will fail). // If the conn was closed for idleness, we're racing the idle timer; // don't try to use the conn. (Issue #70515.) // // This avoids a situation where an error early in a connection's lifetime // goes unreported. if cc.nextStreamID == 1 && cc.streamsReserved == 0 && cc.closed && !cc.closedOnIdle { st.canTakeNewRequest = true } return } func (cc *ClientConn) isUsableLocked() bool { return cc.goAway == nil && !cc.closed && !cc.closing && !cc.doNotReuse && int64(cc.nextStreamID)+2*int64(cc.pendingRequests) < math.MaxInt32 && !cc.tooIdleLocked() } // canReserveLocked reports whether a net/http.ClientConn can reserve a slot on this conn. // // This follows slightly different rules than clientConnIdleState.canTakeNewRequest. // We only permit reservations up to the conn's concurrency limit. // This differs from ClientConn.ReserveNewRequest, which permits reservations // past the limit when StrictMaxConcurrentStreams is set. func (cc *ClientConn) canReserveLocked() bool { if cc.currentRequestCountLocked() >= int(cc.maxConcurrentStreams) { return false } if !cc.isUsableLocked() { return false } return true } // currentRequestCountLocked reports the number of concurrency slots currently in use, // including active streams, reserved slots, and reset streams waiting for acknowledgement. func (cc *ClientConn) currentRequestCountLocked() int { return len(cc.streams) + cc.streamsReserved + cc.pendingResets } func (cc *ClientConn) canTakeNewRequestLocked() bool { st := cc.idleStateLocked() return st.canTakeNewRequest } // availableLocked reports the number of concurrency slots available. func (cc *ClientConn) availableLocked() int { if !cc.canTakeNewRequestLocked() { return 0 } return max(0, int(cc.maxConcurrentStreams)-cc.currentRequestCountLocked()) } // tooIdleLocked reports whether this connection has been been sitting idle // for too much wall time. func (cc *ClientConn) tooIdleLocked() bool { // The Round(0) strips the monontonic clock reading so the // times are compared based on their wall time. We don't want // to reuse a connection that's been sitting idle during // VM/laptop suspend if monotonic time was also frozen. return cc.idleTimeout != 0 && !cc.lastIdle.IsZero() && time.Since(cc.lastIdle.Round(0)) > cc.idleTimeout } // onIdleTimeout is called from a time.AfterFunc goroutine. It will // only be called when we're idle, but because we're coming from a new // goroutine, there could be a new request coming in at the same time, // so this simply calls the synchronized closeIfIdle to shut down this // connection. The timer could just call closeIfIdle, but this is more // clear. func (cc *ClientConn) onIdleTimeout() { cc.closeIfIdle() } func (cc *ClientConn) closeConn() { t := time.AfterFunc(250*time.Millisecond, cc.forceCloseConn) defer t.Stop() cc.tconn.Close() cc.maybeCallStateHook() } // A tls.Conn.Close can hang for a long time if the peer is unresponsive. // Try to shut it down more aggressively. func (cc *ClientConn) forceCloseConn() { tc, ok := cc.tconn.(*tls.Conn) if !ok { return } if nc := tc.NetConn(); nc != nil { nc.Close() } } func (cc *ClientConn) closeIfIdle() { cc.mu.Lock() if len(cc.streams) > 0 || cc.streamsReserved > 0 { cc.mu.Unlock() return } cc.closed = true cc.closedOnIdle = true nextID := cc.nextStreamID // TODO: do clients send GOAWAY too? maybe? Just Close: cc.mu.Unlock() if VerboseLogs { cc.vlogf("http2: Transport closing idle conn %p (forSingleUse=%v, maxStream=%v)", cc, cc.singleUse, nextID-2) } cc.closeConn() } func (cc *ClientConn) isDoNotReuseAndIdle() bool { cc.mu.Lock() defer cc.mu.Unlock() return cc.doNotReuse && len(cc.streams) == 0 } var shutdownEnterWaitStateHook = func() {} // Shutdown gracefully closes the client connection, waiting for running streams to complete. func (cc *ClientConn) Shutdown(ctx context.Context) error { if err := cc.sendGoAway(); err != nil { return err } // Wait for all in-flight streams to complete or connection to close done := make(chan struct{}) cancelled := false // guarded by cc.mu go func() { cc.mu.Lock() defer cc.mu.Unlock() for { if len(cc.streams) == 0 || cc.closed { cc.closed = true close(done) break } if cancelled { break } cc.cond.Wait() } }() shutdownEnterWaitStateHook() select { case <-done: cc.closeConn() return nil case <-ctx.Done(): cc.mu.Lock() // Free the goroutine above cancelled = true cc.cond.Broadcast() cc.mu.Unlock() return ctx.Err() } } func (cc *ClientConn) sendGoAway() error { cc.mu.Lock() closing := cc.closing cc.closing = true maxStreamID := cc.nextStreamID cc.mu.Unlock() if closing { // GOAWAY sent already return nil } cc.wmu.Lock() defer cc.wmu.Unlock() // Send a graceful shutdown frame to server if err := cc.fr.WriteGoAway(maxStreamID, ErrCodeNo, nil); err != nil { return err } if err := cc.bw.Flush(); err != nil { return err } // Prevent new requests return nil } // closes the client connection immediately. In-flight requests are interrupted. // err is sent to streams. func (cc *ClientConn) closeForError(err error) { cc.mu.Lock() cc.closed = true for _, cs := range cc.streams { cs.abortStreamLocked(err) } cc.cond.Broadcast() cc.mu.Unlock() cc.closeConn() } // Close closes the client connection immediately. // // In-flight requests are interrupted. For a graceful shutdown, use Shutdown instead. func (cc *ClientConn) Close() error { cc.closeForError(errClientConnForceClosed) return nil } // closes the client connection immediately. In-flight requests are interrupted. func (cc *ClientConn) closeForLostPing() { err := errors.New("http2: client connection lost") if f := cc.t.CountError; f != nil { f("conn_close_lost_ping") } cc.closeForError(err) } // errRequestCanceled is a copy of net/http's errRequestCanceled because it's not // exported. At least they'll be DeepEqual for h1-vs-h2 comparisons tests. var errRequestCanceled = errors.New("net/http: request canceled") func (cc *ClientConn) responseHeaderTimeout() time.Duration { if cc.t.t1 != nil { return cc.t.t1.ResponseHeaderTimeout } // No way to do this (yet?) with just an http2.Transport. Probably // no need. Request.Cancel this is the new way. We only need to support // this for compatibility with the old http.Transport fields when // we're doing transparent http2. return 0 } // actualContentLength returns a sanitized version of // req.ContentLength, where 0 actually means zero (not unknown) and -1 // means unknown. func actualContentLength(req *http.Request) int64 { if req.Body == nil || req.Body == http.NoBody { return 0 } if req.ContentLength != 0 { return req.ContentLength } return -1 } func (cc *ClientConn) decrStreamReservations() { cc.mu.Lock() defer cc.mu.Unlock() cc.decrStreamReservationsLocked() } func (cc *ClientConn) decrStreamReservationsLocked() { if cc.streamsReserved > 0 { cc.streamsReserved-- } } func (cc *ClientConn) RoundTrip(req *http.Request) (*http.Response, error) { return cc.roundTrip(req, nil) } func (cc *ClientConn) roundTrip(req *http.Request, streamf func(*clientStream)) (*http.Response, error) { ctx := req.Context() cs := &clientStream{ cc: cc, ctx: ctx, reqCancel: req.Cancel, isHead: req.Method == "HEAD", reqBody: req.Body, reqBodyContentLength: actualContentLength(req), trace: httptrace.ContextClientTrace(ctx), peerClosed: make(chan struct{}), abort: make(chan struct{}), respHeaderRecv: make(chan struct{}), donec: make(chan struct{}), } cs.requestedGzip = httpcommon.IsRequestGzip(req.Method, req.Header, cc.t.disableCompression()) go cs.doRequest(req, streamf) waitDone := func() error { select { case <-cs.donec: return nil case <-ctx.Done(): return ctx.Err() case <-cs.reqCancel: return errRequestCanceled } } handleResponseHeaders := func() (*http.Response, error) { res := cs.res if res.StatusCode > 299 { // On error or status code 3xx, 4xx, 5xx, etc abort any // ongoing write, assuming that the server doesn't care // about our request body. If the server replied with 1xx or // 2xx, however, then assume the server DOES potentially // want our body (e.g. full-duplex streaming: // golang.org/issue/13444). If it turns out the server // doesn't, they'll RST_STREAM us soon enough. This is a // heuristic to avoid adding knobs to Transport. Hopefully // we can keep it. cs.abortRequestBodyWrite() } res.Request = req res.TLS = cc.tlsState if res.Body == noBody && actualContentLength(req) == 0 { // If there isn't a request or response body still being // written, then wait for the stream to be closed before // RoundTrip returns. if err := waitDone(); err != nil { return nil, err } } return res, nil } cancelRequest := func(cs *clientStream, err error) error { cs.cc.mu.Lock() bodyClosed := cs.reqBodyClosed cs.cc.mu.Unlock() // Wait for the request body to be closed. // // If nothing closed the body before now, abortStreamLocked // will have started a goroutine to close it. // // Closing the body before returning avoids a race condition // with net/http checking its readTrackingBody to see if the // body was read from or closed. See golang/go#60041. // // The body is closed in a separate goroutine without the // connection mutex held, but dropping the mutex before waiting // will keep us from holding it indefinitely if the body // close is slow for some reason. if bodyClosed != nil { <-bodyClosed } return err } for { select { case <-cs.respHeaderRecv: return handleResponseHeaders() case <-cs.abort: select { case <-cs.respHeaderRecv: // If both cs.respHeaderRecv and cs.abort are signaling, // pick respHeaderRecv. The server probably wrote the // response and immediately reset the stream. // golang.org/issue/49645 return handleResponseHeaders() default: waitDone() return nil, cs.abortErr } case <-ctx.Done(): err := ctx.Err() cs.abortStream(err) return nil, cancelRequest(cs, err) case <-cs.reqCancel: cs.abortStream(errRequestCanceled) return nil, cancelRequest(cs, errRequestCanceled) } } } // doRequest runs for the duration of the request lifetime. // // It sends the request and performs post-request cleanup (closing Request.Body, etc.). func (cs *clientStream) doRequest(req *http.Request, streamf func(*clientStream)) { err := cs.writeRequest(req, streamf) cs.cleanupWriteRequest(err) } var errExtendedConnectNotSupported = errors.New("net/http: extended connect not supported by peer") // writeRequest sends a request. // // It returns nil after the request is written, the response read, // and the request stream is half-closed by the peer. // // It returns non-nil if the request ends otherwise. // If the returned error is StreamError, the error Code may be used in resetting the stream. func (cs *clientStream) writeRequest(req *http.Request, streamf func(*clientStream)) (err error) { cc := cs.cc ctx := cs.ctx // wait for setting frames to be received, a server can change this value later, // but we just wait for the first settings frame var isExtendedConnect bool if req.Method == "CONNECT" && req.Header.Get(":protocol") != "" { isExtendedConnect = true } // Acquire the new-request lock by writing to reqHeaderMu. // This lock guards the critical section covering allocating a new stream ID // (requires mu) and creating the stream (requires wmu). if cc.reqHeaderMu == nil { panic("RoundTrip on uninitialized ClientConn") // for tests } if isExtendedConnect { select { case <-cs.reqCancel: return errRequestCanceled case <-ctx.Done(): return ctx.Err() case <-cc.seenSettingsChan: if !cc.extendedConnectAllowed { return errExtendedConnectNotSupported } } } select { case cc.reqHeaderMu <- struct{}{}: case <-cs.reqCancel: return errRequestCanceled case <-ctx.Done(): return ctx.Err() } cc.mu.Lock() if cc.idleTimer != nil { cc.idleTimer.Stop() } cc.decrStreamReservationsLocked() if err := cc.awaitOpenSlotForStreamLocked(cs); err != nil { cc.mu.Unlock() <-cc.reqHeaderMu return err } cc.addStreamLocked(cs) // assigns stream ID if isConnectionCloseRequest(req) { cc.doNotReuse = true } cc.mu.Unlock() if streamf != nil { streamf(cs) } continueTimeout := cc.t.expectContinueTimeout() if continueTimeout != 0 { if !httpguts.HeaderValuesContainsToken(req.Header["Expect"], "100-continue") { continueTimeout = 0 } else { cs.on100 = make(chan struct{}, 1) } } // Past this point (where we send request headers), it is possible for // RoundTrip to return successfully. Since the RoundTrip contract permits // the caller to "mutate or reuse" the Request after closing the Response's Body, // we must take care when referencing the Request from here on. err = cs.encodeAndWriteHeaders(req) <-cc.reqHeaderMu if err != nil { return err } hasBody := cs.reqBodyContentLength != 0 if !hasBody { cs.sentEndStream = true } else { if continueTimeout != 0 { traceWait100Continue(cs.trace) timer := time.NewTimer(continueTimeout) select { case <-timer.C: err = nil case <-cs.on100: err = nil case <-cs.abort: err = cs.abortErr case <-ctx.Done(): err = ctx.Err() case <-cs.reqCancel: err = errRequestCanceled } timer.Stop() if err != nil { traceWroteRequest(cs.trace, err) return err } } if err = cs.writeRequestBody(req); err != nil { if err != errStopReqBodyWrite { traceWroteRequest(cs.trace, err) return err } } else { cs.sentEndStream = true } } traceWroteRequest(cs.trace, err) var respHeaderTimer <-chan time.Time var respHeaderRecv chan struct{} if d := cc.responseHeaderTimeout(); d != 0 { timer := time.NewTimer(d) defer timer.Stop() respHeaderTimer = timer.C respHeaderRecv = cs.respHeaderRecv } // Wait until the peer half-closes its end of the stream, // or until the request is aborted (via context, error, or otherwise), // whichever comes first. for { select { case <-cs.peerClosed: return nil case <-respHeaderTimer: return errTimeout case <-respHeaderRecv: respHeaderRecv = nil respHeaderTimer = nil // keep waiting for END_STREAM case <-cs.abort: return cs.abortErr case <-ctx.Done(): return ctx.Err() case <-cs.reqCancel: return errRequestCanceled } } } func (cs *clientStream) encodeAndWriteHeaders(req *http.Request) error { cc := cs.cc ctx := cs.ctx cc.wmu.Lock() defer cc.wmu.Unlock() // If the request was canceled while waiting for cc.mu, just quit. select { case <-cs.abort: return cs.abortErr case <-ctx.Done(): return ctx.Err() case <-cs.reqCancel: return errRequestCanceled default: } // Encode headers. // // we send: HEADERS{1}, CONTINUATION{0,} + DATA{0,} (DATA is // sent by writeRequestBody below, along with any Trailers, // again in form HEADERS{1}, CONTINUATION{0,}) cc.hbuf.Reset() res, err := encodeRequestHeaders(req, cs.requestedGzip, cc.peerMaxHeaderListSize, func(name, value string) { cc.writeHeader(name, value) }) if err != nil { return fmt.Errorf("http2: %w", err) } hdrs := cc.hbuf.Bytes() // Write the request. endStream := !res.HasBody && !res.HasTrailers cs.sentHeaders = true err = cc.writeHeaders(cs.ID, endStream, int(cc.maxFrameSize), hdrs) traceWroteHeaders(cs.trace) return err } func encodeRequestHeaders(req *http.Request, addGzipHeader bool, peerMaxHeaderListSize uint64, headerf func(name, value string)) (httpcommon.EncodeHeadersResult, error) { return httpcommon.EncodeHeaders(req.Context(), httpcommon.EncodeHeadersParam{ Request: httpcommon.Request{ Header: req.Header, Trailer: req.Trailer, URL: req.URL, Host: req.Host, Method: req.Method, ActualContentLength: actualContentLength(req), }, AddGzipHeader: addGzipHeader, PeerMaxHeaderListSize: peerMaxHeaderListSize, DefaultUserAgent: defaultUserAgent, }, headerf) } // cleanupWriteRequest performs post-request tasks. // // If err (the result of writeRequest) is non-nil and the stream is not closed, // cleanupWriteRequest will send a reset to the peer. func (cs *clientStream) cleanupWriteRequest(err error) { cc := cs.cc if cs.ID == 0 { // We were canceled before creating the stream, so return our reservation. cc.decrStreamReservations() } // TODO: write h12Compare test showing whether // Request.Body is closed by the Transport, // and in multiple cases: server replies <=299 and >299 // while still writing request body cc.mu.Lock() mustCloseBody := false if cs.reqBody != nil && cs.reqBodyClosed == nil { mustCloseBody = true cs.reqBodyClosed = make(chan struct{}) } bodyClosed := cs.reqBodyClosed closeOnIdle := cc.singleUse || cc.doNotReuse || cc.t.disableKeepAlives() || cc.goAway != nil // Have we read any frames from the connection since sending this request? readSinceStream := cc.readBeforeStreamID > cs.ID cc.mu.Unlock() if mustCloseBody { cs.reqBody.Close() close(bodyClosed) } if bodyClosed != nil { <-bodyClosed } if err != nil && cs.sentEndStream { // If the connection is closed immediately after the response is read, // we may be aborted before finishing up here. If the stream was closed // cleanly on both sides, there is no error. select { case <-cs.peerClosed: err = nil default: } } if err != nil { cs.abortStream(err) // possibly redundant, but harmless if cs.sentHeaders { if se, ok := err.(StreamError); ok { if se.Cause != errFromPeer { cc.writeStreamReset(cs.ID, se.Code, false, err) } } else { // We're cancelling an in-flight request. // // This could be due to the server becoming unresponsive. // To avoid sending too many requests on a dead connection, // if we haven't read any frames from the connection since // sending this request, we let it continue to consume // a concurrency slot until we can confirm the server is // still responding. // We do this by sending a PING frame along with the RST_STREAM // (unless a ping is already in flight). // // For simplicity, we don't bother tracking the PING payload: // We reset cc.pendingResets any time we receive a PING ACK. // // We skip this if the conn is going to be closed on idle, // because it's short lived and will probably be closed before // we get the ping response. ping := false if !closeOnIdle && !readSinceStream { cc.mu.Lock() // rstStreamPingsBlocked works around a gRPC behavior: // see comment on the field for details. if !cc.rstStreamPingsBlocked { if cc.pendingResets == 0 { ping = true } cc.pendingResets++ } cc.mu.Unlock() } cc.writeStreamReset(cs.ID, ErrCodeCancel, ping, err) } } cs.bufPipe.CloseWithError(err) // no-op if already closed } else { if cs.sentHeaders && !cs.sentEndStream { cc.writeStreamReset(cs.ID, ErrCodeNo, false, nil) } cs.bufPipe.CloseWithError(errRequestCanceled) } if cs.ID != 0 { cc.forgetStreamID(cs.ID) } cc.wmu.Lock() werr := cc.werr cc.wmu.Unlock() if werr != nil { cc.Close() } close(cs.donec) cc.maybeCallStateHook() } // awaitOpenSlotForStreamLocked waits until len(streams) < maxConcurrentStreams. // Must hold cc.mu. func (cc *ClientConn) awaitOpenSlotForStreamLocked(cs *clientStream) error { for { if cc.closed && cc.nextStreamID == 1 && cc.streamsReserved == 0 { // This is the very first request sent to this connection. // Return a fatal error which aborts the retry loop. return errClientConnNotEstablished } cc.lastActive = time.Now() if cc.closed || !cc.canTakeNewRequestLocked() { return errClientConnUnusable } cc.lastIdle = time.Time{} if cc.currentRequestCountLocked() < int(cc.maxConcurrentStreams) { return nil } cc.pendingRequests++ cc.cond.Wait() cc.pendingRequests-- select { case <-cs.abort: return cs.abortErr default: } } } // requires cc.wmu be held func (cc *ClientConn) writeHeaders(streamID uint32, endStream bool, maxFrameSize int, hdrs []byte) error { first := true // first frame written (HEADERS is first, then CONTINUATION) for len(hdrs) > 0 && cc.werr == nil { chunk := hdrs if len(chunk) > maxFrameSize { chunk = chunk[:maxFrameSize] } hdrs = hdrs[len(chunk):] endHeaders := len(hdrs) == 0 if first { cc.fr.WriteHeaders(HeadersFrameParam{ StreamID: streamID, BlockFragment: chunk, EndStream: endStream, EndHeaders: endHeaders, }) first = false } else { cc.fr.WriteContinuation(streamID, endHeaders, chunk) } } cc.bw.Flush() return cc.werr } // internal error values; they don't escape to callers var ( // abort request body write; don't send cancel errStopReqBodyWrite = errors.New("http2: aborting request body write") // abort request body write, but send stream reset of cancel. errStopReqBodyWriteAndCancel = errors.New("http2: canceling request") errReqBodyTooLong = errors.New("http2: request body larger than specified content length") ) // frameScratchBufferLen returns the length of a buffer to use for // outgoing request bodies to read/write to/from. // // It returns max(1, min(peer's advertised max frame size, // Request.ContentLength+1, 512KB)). func (cs *clientStream) frameScratchBufferLen(maxFrameSize int) int { const max = 512 << 10 n := int64(maxFrameSize) if n > max { n = max } if cl := cs.reqBodyContentLength; cl != -1 && cl+1 < n { // Add an extra byte past the declared content-length to // give the caller's Request.Body io.Reader a chance to // give us more bytes than they declared, so we can catch it // early. n = cl + 1 } if n < 1 { return 1 } return int(n) // doesn't truncate; max is 512K } // Seven bufPools manage different frame sizes. This helps to avoid scenarios where long-running // streaming requests using small frame sizes occupy large buffers initially allocated for prior // requests needing big buffers. The size ranges are as follows: // {0 KB, 16 KB], {16 KB, 32 KB], {32 KB, 64 KB], {64 KB, 128 KB], {128 KB, 256 KB], // {256 KB, 512 KB], {512 KB, infinity} // In practice, the maximum scratch buffer size should not exceed 512 KB due to // frameScratchBufferLen(maxFrameSize), thus the "infinity pool" should never be used. // It exists mainly as a safety measure, for potential future increases in max buffer size. var bufPools [7]sync.Pool // of *[]byte func bufPoolIndex(size int) int { if size <= 16384 { return 0 } size -= 1 bits := bits.Len(uint(size)) index := bits - 14 if index >= len(bufPools) { return len(bufPools) - 1 } return index } func (cs *clientStream) writeRequestBody(req *http.Request) (err error) { cc := cs.cc body := cs.reqBody sentEnd := false // whether we sent the final DATA frame w/ END_STREAM hasTrailers := req.Trailer != nil remainLen := cs.reqBodyContentLength hasContentLen := remainLen != -1 cc.mu.Lock() maxFrameSize := int(cc.maxFrameSize) cc.mu.Unlock() // Scratch buffer for reading into & writing from. scratchLen := cs.frameScratchBufferLen(maxFrameSize) var buf []byte index := bufPoolIndex(scratchLen) if bp, ok := bufPools[index].Get().(*[]byte); ok && len(*bp) >= scratchLen { defer bufPools[index].Put(bp) buf = *bp } else { buf = make([]byte, scratchLen) defer bufPools[index].Put(&buf) } var sawEOF bool for !sawEOF { n, err := body.Read(buf) if hasContentLen { remainLen -= int64(n) if remainLen == 0 && err == nil { // The request body's Content-Length was predeclared and // we just finished reading it all, but the underlying io.Reader // returned the final chunk with a nil error (which is one of // the two valid things a Reader can do at EOF). Because we'd prefer // to send the END_STREAM bit early, double-check that we're actually // at EOF. Subsequent reads should return (0, EOF) at this point. // If either value is different, we return an error in one of two ways below. var scratch [1]byte var n1 int n1, err = body.Read(scratch[:]) remainLen -= int64(n1) } if remainLen < 0 { err = errReqBodyTooLong return err } } if err != nil { cc.mu.Lock() bodyClosed := cs.reqBodyClosed != nil cc.mu.Unlock() switch { case bodyClosed: return errStopReqBodyWrite case err == io.EOF: sawEOF = true err = nil default: return err } } remain := buf[:n] for len(remain) > 0 && err == nil { var allowed int32 allowed, err = cs.awaitFlowControl(len(remain)) if err != nil { return err } cc.wmu.Lock() data := remain[:allowed] remain = remain[allowed:] sentEnd = sawEOF && len(remain) == 0 && !hasTrailers err = cc.fr.WriteData(cs.ID, sentEnd, data) if err == nil { // TODO(bradfitz): this flush is for latency, not bandwidth. // Most requests won't need this. Make this opt-in or // opt-out? Use some heuristic on the body type? Nagel-like // timers? Based on 'n'? Only last chunk of this for loop, // unless flow control tokens are low? For now, always. // If we change this, see comment below. err = cc.bw.Flush() } cc.wmu.Unlock() } if err != nil { return err } } if sentEnd { // Already sent END_STREAM (which implies we have no // trailers) and flushed, because currently all // WriteData frames above get a flush. So we're done. return nil } // Since the RoundTrip contract permits the caller to "mutate or reuse" // a request after the Response's Body is closed, verify that this hasn't // happened before accessing the trailers. cc.mu.Lock() trailer := req.Trailer err = cs.abortErr cc.mu.Unlock() if err != nil { return err } cc.wmu.Lock() defer cc.wmu.Unlock() var trls []byte if len(trailer) > 0 { trls, err = cc.encodeTrailers(trailer) if err != nil { return err } } // Two ways to send END_STREAM: either with trailers, or // with an empty DATA frame. if len(trls) > 0 { err = cc.writeHeaders(cs.ID, true, maxFrameSize, trls) } else { err = cc.fr.WriteData(cs.ID, true, nil) } if ferr := cc.bw.Flush(); ferr != nil && err == nil { err = ferr } return err } // awaitFlowControl waits for [1, min(maxBytes, cc.cs.maxFrameSize)] flow // control tokens from the server. // It returns either the non-zero number of tokens taken or an error // if the stream is dead. func (cs *clientStream) awaitFlowControl(maxBytes int) (taken int32, err error) { cc := cs.cc ctx := cs.ctx cc.mu.Lock() defer cc.mu.Unlock() for { if cc.closed { return 0, errClientConnClosed } if cs.reqBodyClosed != nil { return 0, errStopReqBodyWrite } select { case <-cs.abort: return 0, cs.abortErr case <-ctx.Done(): return 0, ctx.Err() case <-cs.reqCancel: return 0, errRequestCanceled default: } if a := cs.flow.available(); a > 0 { take := a if int(take) > maxBytes { take = int32(maxBytes) // can't truncate int; take is int32 } if take > int32(cc.maxFrameSize) { take = int32(cc.maxFrameSize) } cs.flow.take(take) return take, nil } cc.cond.Wait() } } // requires cc.wmu be held. func (cc *ClientConn) encodeTrailers(trailer http.Header) ([]byte, error) { cc.hbuf.Reset() hlSize := uint64(0) for k, vv := range trailer { for _, v := range vv { hf := hpack.HeaderField{Name: k, Value: v} hlSize += uint64(hf.Size()) } } if hlSize > cc.peerMaxHeaderListSize { return nil, errRequestHeaderListSize } for k, vv := range trailer { lowKey, ascii := httpcommon.LowerHeader(k) if !ascii { // Skip writing invalid headers. Per RFC 7540, Section 8.1.2, header // field names have to be ASCII characters (just as in HTTP/1.x). continue } // Transfer-Encoding, etc.. have already been filtered at the // start of RoundTrip for _, v := range vv { cc.writeHeader(lowKey, v) } } return cc.hbuf.Bytes(), nil } func (cc *ClientConn) writeHeader(name, value string) { if VerboseLogs { log.Printf("http2: Transport encoding header %q = %q", name, value) } cc.henc.WriteField(hpack.HeaderField{Name: name, Value: value}) } type resAndError struct { _ incomparable res *http.Response err error } // requires cc.mu be held. func (cc *ClientConn) addStreamLocked(cs *clientStream) { cs.flow.add(int32(cc.initialWindowSize)) cs.flow.setConnFlow(&cc.flow) cs.inflow.init(cc.initialStreamRecvWindowSize) cs.ID = cc.nextStreamID cc.nextStreamID += 2 cc.streams[cs.ID] = cs if cs.ID == 0 { panic("assigned stream ID 0") } } func (cc *ClientConn) forgetStreamID(id uint32) { cc.mu.Lock() slen := len(cc.streams) delete(cc.streams, id) if len(cc.streams) != slen-1 { panic("forgetting unknown stream id") } cc.lastActive = time.Now() if len(cc.streams) == 0 && cc.idleTimer != nil { cc.idleTimer.Reset(cc.idleTimeout) cc.lastIdle = time.Now() } // Wake up writeRequestBody via clientStream.awaitFlowControl and // wake up RoundTrip if there is a pending request. cc.cond.Broadcast() closeOnIdle := cc.singleUse || cc.doNotReuse || cc.t.disableKeepAlives() || cc.goAway != nil if closeOnIdle && cc.streamsReserved == 0 && len(cc.streams) == 0 { if VerboseLogs { cc.vlogf("http2: Transport closing idle conn %p (forSingleUse=%v, maxStream=%v)", cc, cc.singleUse, cc.nextStreamID-2) } cc.closed = true defer cc.closeConn() } cc.mu.Unlock() } // clientConnReadLoop is the state owned by the clientConn's frame-reading readLoop. type clientConnReadLoop struct { _ incomparable cc *ClientConn } // readLoop runs in its own goroutine and reads and dispatches frames. func (cc *ClientConn) readLoop() { rl := &clientConnReadLoop{cc: cc} defer rl.cleanup() cc.readerErr = rl.run() if ce, ok := cc.readerErr.(ConnectionError); ok { cc.wmu.Lock() cc.fr.WriteGoAway(0, ErrCode(ce), nil) cc.wmu.Unlock() } } // GoAwayError is returned by the Transport when the server closes the // TCP connection after sending a GOAWAY frame. type GoAwayError struct { LastStreamID uint32 ErrCode ErrCode DebugData string } func (e GoAwayError) Error() string { return fmt.Sprintf("http2: server sent GOAWAY and closed the connection; LastStreamID=%v, ErrCode=%v, debug=%q", e.LastStreamID, e.ErrCode, e.DebugData) } func isEOFOrNetReadError(err error) bool { if err == io.EOF { return true } ne, ok := err.(*net.OpError) return ok && ne.Op == "read" } func (rl *clientConnReadLoop) cleanup() { cc := rl.cc defer cc.closeConn() defer close(cc.readerDone) if cc.idleTimer != nil { cc.idleTimer.Stop() } // Close any response bodies if the server closes prematurely. // TODO: also do this if we've written the headers but not // gotten a response yet. err := cc.readerErr cc.mu.Lock() if cc.goAway != nil && isEOFOrNetReadError(err) { err = GoAwayError{ LastStreamID: cc.goAway.LastStreamID, ErrCode: cc.goAway.ErrCode, DebugData: cc.goAwayDebug, } } else if err == io.EOF { err = io.ErrUnexpectedEOF } cc.closed = true // If the connection has never been used, and has been open for only a short time, // leave it in the connection pool for a little while. // // This avoids a situation where new connections are constantly created, // added to the pool, fail, and are removed from the pool, without any error // being surfaced to the user. unusedWaitTime := 5 * time.Second if cc.idleTimeout > 0 && unusedWaitTime > cc.idleTimeout { unusedWaitTime = cc.idleTimeout } idleTime := time.Now().Sub(cc.lastActive) if atomic.LoadUint32(&cc.atomicReused) == 0 && idleTime < unusedWaitTime && !cc.closedOnIdle { cc.idleTimer = time.AfterFunc(unusedWaitTime-idleTime, func() { cc.t.connPool().MarkDead(cc) }) } else { cc.mu.Unlock() // avoid any deadlocks in MarkDead cc.t.connPool().MarkDead(cc) cc.mu.Lock() } for _, cs := range cc.streams { select { case <-cs.peerClosed: // The server closed the stream before closing the conn, // so no need to interrupt it. default: cs.abortStreamLocked(err) } } cc.cond.Broadcast() cc.mu.Unlock() if !cc.seenSettings { // If we have a pending request that wants extended CONNECT, // let it continue and fail with the connection error. cc.extendedConnectAllowed = true close(cc.seenSettingsChan) } } // countReadFrameError calls Transport.CountError with a string // representing err. func (cc *ClientConn) countReadFrameError(err error) { f := cc.t.CountError if f == nil || err == nil { return } if ce, ok := err.(ConnectionError); ok { errCode := ErrCode(ce) f(fmt.Sprintf("read_frame_conn_error_%s", errCode.stringToken())) return } if errors.Is(err, io.EOF) { f("read_frame_eof") return } if errors.Is(err, io.ErrUnexpectedEOF) { f("read_frame_unexpected_eof") return } if errors.Is(err, ErrFrameTooLarge) { f("read_frame_too_large") return } f("read_frame_other") } func (rl *clientConnReadLoop) run() error { cc := rl.cc gotSettings := false readIdleTimeout := cc.readIdleTimeout var t *time.Timer if readIdleTimeout != 0 { t = time.AfterFunc(readIdleTimeout, cc.healthCheck) } for { f, err := cc.fr.ReadFrame() if t != nil { t.Reset(readIdleTimeout) } if err != nil { cc.vlogf("http2: Transport readFrame error on conn %p: (%T) %v", cc, err, err) } if se, ok := err.(StreamError); ok { if cs := rl.streamByID(se.StreamID, notHeaderOrDataFrame); cs != nil { if se.Cause == nil { se.Cause = cc.fr.errDetail } rl.endStreamError(cs, se) } continue } else if err != nil { cc.countReadFrameError(err) return err } if VerboseLogs { cc.vlogf("http2: Transport received %s", summarizeFrame(f)) } if !gotSettings { if _, ok := f.(*SettingsFrame); !ok { cc.logf("protocol error: received %T before a SETTINGS frame", f) return ConnectionError(ErrCodeProtocol) } gotSettings = true } switch f := f.(type) { case *MetaHeadersFrame: err = rl.processHeaders(f) case *DataFrame: err = rl.processData(f) case *GoAwayFrame: err = rl.processGoAway(f) case *RSTStreamFrame: err = rl.processResetStream(f) case *SettingsFrame: err = rl.processSettings(f) case *PushPromiseFrame: err = rl.processPushPromise(f) case *WindowUpdateFrame: err = rl.processWindowUpdate(f) case *PingFrame: err = rl.processPing(f) default: cc.logf("Transport: unhandled response frame type %T", f) } if err != nil { if VerboseLogs { cc.vlogf("http2: Transport conn %p received error from processing frame %v: %v", cc, summarizeFrame(f), err) } return err } } } func (rl *clientConnReadLoop) processHeaders(f *MetaHeadersFrame) error { cs := rl.streamByID(f.StreamID, headerOrDataFrame) if cs == nil { // We'd get here if we canceled a request while the // server had its response still in flight. So if this // was just something we canceled, ignore it. return nil } if cs.readClosed { rl.endStreamError(cs, StreamError{ StreamID: f.StreamID, Code: ErrCodeProtocol, Cause: errors.New("protocol error: headers after END_STREAM"), }) return nil } if !cs.firstByte { if cs.trace != nil { // TODO(bradfitz): move first response byte earlier, // when we first read the 9 byte header, not waiting // until all the HEADERS+CONTINUATION frames have been // merged. This works for now. traceFirstResponseByte(cs.trace) } cs.firstByte = true } if !cs.pastHeaders { cs.pastHeaders = true } else { return rl.processTrailers(cs, f) } res, err := rl.handleResponse(cs, f) if err != nil { if _, ok := err.(ConnectionError); ok { return err } // Any other error type is a stream error. rl.endStreamError(cs, StreamError{ StreamID: f.StreamID, Code: ErrCodeProtocol, Cause: err, }) return nil // return nil from process* funcs to keep conn alive } if res == nil { // (nil, nil) special case. See handleResponse docs. return nil } cs.resTrailer = &res.Trailer cs.res = res close(cs.respHeaderRecv) if f.StreamEnded() { rl.endStream(cs) } return nil } // may return error types nil, or ConnectionError. Any other error value // is a StreamError of type ErrCodeProtocol. The returned error in that case // is the detail. // // As a special case, handleResponse may return (nil, nil) to skip the // frame (currently only used for 1xx responses). func (rl *clientConnReadLoop) handleResponse(cs *clientStream, f *MetaHeadersFrame) (*http.Response, error) { if f.Truncated { return nil, errResponseHeaderListSize } status := f.PseudoValue("status") if status == "" { return nil, errors.New("malformed response from server: missing status pseudo header") } statusCode, err := strconv.Atoi(status) if err != nil { return nil, errors.New("malformed response from server: malformed non-numeric status pseudo header") } regularFields := f.RegularFields() strs := make([]string, len(regularFields)) header := make(http.Header, len(regularFields)) res := &http.Response{ Proto: "HTTP/2.0", ProtoMajor: 2, Header: header, StatusCode: statusCode, Status: status + " " + http.StatusText(statusCode), } for _, hf := range regularFields { key := httpcommon.CanonicalHeader(hf.Name) if key == "Trailer" { t := res.Trailer if t == nil { t = make(http.Header) res.Trailer = t } foreachHeaderElement(hf.Value, func(v string) { t[httpcommon.CanonicalHeader(v)] = nil }) } else { vv := header[key] if vv == nil && len(strs) > 0 { // More than likely this will be a single-element key. // Most headers aren't multi-valued. // Set the capacity on strs[0] to 1, so any future append // won't extend the slice into the other strings. vv, strs = strs[:1:1], strs[1:] vv[0] = hf.Value header[key] = vv } else { header[key] = append(vv, hf.Value) } } } if statusCode >= 100 && statusCode <= 199 { if f.StreamEnded() { return nil, errors.New("1xx informational response with END_STREAM flag") } if fn := cs.get1xxTraceFunc(); fn != nil { // If the 1xx response is being delivered to the user, // then they're responsible for limiting the number // of responses. if err := fn(statusCode, textproto.MIMEHeader(header)); err != nil { return nil, err } } else { // If the user didn't examine the 1xx response, then we // limit the size of all 1xx headers. // // This differs a bit from the HTTP/1 implementation, which // limits the size of all 1xx headers plus the final response. // Use the larger limit of MaxHeaderListSize and // net/http.Transport.MaxResponseHeaderBytes. limit := int64(cs.cc.t.maxHeaderListSize()) if t1 := cs.cc.t.t1; t1 != nil && t1.MaxResponseHeaderBytes > limit { limit = t1.MaxResponseHeaderBytes } for _, h := range f.Fields { cs.totalHeaderSize += int64(h.Size()) } if cs.totalHeaderSize > limit { if VerboseLogs { log.Printf("http2: 1xx informational responses too large") } return nil, errors.New("header list too large") } } if statusCode == 100 { traceGot100Continue(cs.trace) select { case cs.on100 <- struct{}{}: default: } } cs.pastHeaders = false // do it all again return nil, nil } res.ContentLength = -1 if clens := res.Header["Content-Length"]; len(clens) == 1 { if cl, err := strconv.ParseUint(clens[0], 10, 63); err == nil { res.ContentLength = int64(cl) } else { // TODO: care? unlike http/1, it won't mess up our framing, so it's // more safe smuggling-wise to ignore. } } else if len(clens) > 1 { // TODO: care? unlike http/1, it won't mess up our framing, so it's // more safe smuggling-wise to ignore. } else if f.StreamEnded() && !cs.isHead { res.ContentLength = 0 } if cs.isHead { res.Body = noBody return res, nil } if f.StreamEnded() { if res.ContentLength > 0 { res.Body = missingBody{} } else { res.Body = noBody } return res, nil } cs.bufPipe.setBuffer(&dataBuffer{expected: res.ContentLength}) cs.bytesRemain = res.ContentLength res.Body = transportResponseBody{cs} if cs.requestedGzip && asciiEqualFold(res.Header.Get("Content-Encoding"), "gzip") { res.Header.Del("Content-Encoding") res.Header.Del("Content-Length") res.ContentLength = -1 res.Body = &gzipReader{body: res.Body} res.Uncompressed = true } return res, nil } func (rl *clientConnReadLoop) processTrailers(cs *clientStream, f *MetaHeadersFrame) error { if cs.pastTrailers { // Too many HEADERS frames for this stream. return ConnectionError(ErrCodeProtocol) } cs.pastTrailers = true if !f.StreamEnded() { // We expect that any headers for trailers also // has END_STREAM. return ConnectionError(ErrCodeProtocol) } if len(f.PseudoFields()) > 0 { // No pseudo header fields are defined for trailers. // TODO: ConnectionError might be overly harsh? Check. return ConnectionError(ErrCodeProtocol) } trailer := make(http.Header) for _, hf := range f.RegularFields() { key := httpcommon.CanonicalHeader(hf.Name) trailer[key] = append(trailer[key], hf.Value) } cs.trailer = trailer rl.endStream(cs) return nil } // transportResponseBody is the concrete type of Transport.RoundTrip's // Response.Body. It is an io.ReadCloser. type transportResponseBody struct { cs *clientStream } func (b transportResponseBody) Read(p []byte) (n int, err error) { cs := b.cs cc := cs.cc if cs.readErr != nil { return 0, cs.readErr } n, err = b.cs.bufPipe.Read(p) if cs.bytesRemain != -1 { if int64(n) > cs.bytesRemain { n = int(cs.bytesRemain) if err == nil { err = errors.New("net/http: server replied with more than declared Content-Length; truncated") cs.abortStream(err) } cs.readErr = err return int(cs.bytesRemain), err } cs.bytesRemain -= int64(n) if err == io.EOF && cs.bytesRemain > 0 { err = io.ErrUnexpectedEOF cs.readErr = err return n, err } } if n == 0 { // No flow control tokens to send back. return } cc.mu.Lock() connAdd := cc.inflow.add(n) var streamAdd int32 if err == nil { // No need to refresh if the stream is over or failed. streamAdd = cs.inflow.add(n) } cc.mu.Unlock() if connAdd != 0 || streamAdd != 0 { cc.wmu.Lock() defer cc.wmu.Unlock() if connAdd != 0 { cc.fr.WriteWindowUpdate(0, mustUint31(connAdd)) } if streamAdd != 0 { cc.fr.WriteWindowUpdate(cs.ID, mustUint31(streamAdd)) } cc.bw.Flush() } return } var errClosedResponseBody = errors.New("http2: response body closed") func (b transportResponseBody) Close() error { cs := b.cs cc := cs.cc cs.bufPipe.BreakWithError(errClosedResponseBody) cs.abortStream(errClosedResponseBody) unread := cs.bufPipe.Len() if unread > 0 { cc.mu.Lock() // Return connection-level flow control. connAdd := cc.inflow.add(unread) cc.mu.Unlock() // TODO(dneil): Acquiring this mutex can block indefinitely. // Move flow control return to a goroutine? cc.wmu.Lock() // Return connection-level flow control. if connAdd > 0 { cc.fr.WriteWindowUpdate(0, uint32(connAdd)) } cc.bw.Flush() cc.wmu.Unlock() } select { case <-cs.donec: case <-cs.ctx.Done(): // See golang/go#49366: The net/http package can cancel the // request context after the response body is fully read. // Don't treat this as an error. return nil case <-cs.reqCancel: return errRequestCanceled } return nil } func (rl *clientConnReadLoop) processData(f *DataFrame) error { cc := rl.cc cs := rl.streamByID(f.StreamID, headerOrDataFrame) data := f.Data() if cs == nil { cc.mu.Lock() neverSent := cc.nextStreamID cc.mu.Unlock() if f.StreamID >= neverSent { // We never asked for this. cc.logf("http2: Transport received unsolicited DATA frame; closing connection") return ConnectionError(ErrCodeProtocol) } // We probably did ask for this, but canceled. Just ignore it. // TODO: be stricter here? only silently ignore things which // we canceled, but not things which were closed normally // by the peer? Tough without accumulating too much state. // But at least return their flow control: if f.Length > 0 { cc.mu.Lock() ok := cc.inflow.take(f.Length) connAdd := cc.inflow.add(int(f.Length)) cc.mu.Unlock() if !ok { return ConnectionError(ErrCodeFlowControl) } if connAdd > 0 { cc.wmu.Lock() cc.fr.WriteWindowUpdate(0, uint32(connAdd)) cc.bw.Flush() cc.wmu.Unlock() } } return nil } if cs.readClosed { cc.logf("protocol error: received DATA after END_STREAM") rl.endStreamError(cs, StreamError{ StreamID: f.StreamID, Code: ErrCodeProtocol, }) return nil } if !cs.pastHeaders { cc.logf("protocol error: received DATA before a HEADERS frame") rl.endStreamError(cs, StreamError{ StreamID: f.StreamID, Code: ErrCodeProtocol, }) return nil } if f.Length > 0 { if cs.isHead && len(data) > 0 { cc.logf("protocol error: received DATA on a HEAD request") rl.endStreamError(cs, StreamError{ StreamID: f.StreamID, Code: ErrCodeProtocol, }) return nil } // Check connection-level flow control. cc.mu.Lock() if !takeInflows(&cc.inflow, &cs.inflow, f.Length) { cc.mu.Unlock() return ConnectionError(ErrCodeFlowControl) } // Return any padded flow control now, since we won't // refund it later on body reads. var refund int if pad := int(f.Length) - len(data); pad > 0 { refund += pad } didReset := false var err error if len(data) > 0 { if _, err = cs.bufPipe.Write(data); err != nil { // Return len(data) now if the stream is already closed, // since data will never be read. didReset = true refund += len(data) } } sendConn := cc.inflow.add(refund) var sendStream int32 if !didReset { sendStream = cs.inflow.add(refund) } cc.mu.Unlock() if sendConn > 0 || sendStream > 0 { cc.wmu.Lock() if sendConn > 0 { cc.fr.WriteWindowUpdate(0, uint32(sendConn)) } if sendStream > 0 { cc.fr.WriteWindowUpdate(cs.ID, uint32(sendStream)) } cc.bw.Flush() cc.wmu.Unlock() } if err != nil { rl.endStreamError(cs, err) return nil } } if f.StreamEnded() { rl.endStream(cs) } return nil } func (rl *clientConnReadLoop) endStream(cs *clientStream) { // TODO: check that any declared content-length matches, like // server.go's (*stream).endStream method. if !cs.readClosed { cs.readClosed = true // Close cs.bufPipe and cs.peerClosed with cc.mu held to avoid a // race condition: The caller can read io.EOF from Response.Body // and close the body before we close cs.peerClosed, causing // cleanupWriteRequest to send a RST_STREAM. rl.cc.mu.Lock() defer rl.cc.mu.Unlock() cs.bufPipe.closeWithErrorAndCode(io.EOF, cs.copyTrailers) close(cs.peerClosed) } } func (rl *clientConnReadLoop) endStreamError(cs *clientStream, err error) { cs.readAborted = true cs.abortStream(err) } func (rl *clientConnReadLoop) endStreamErrorLocked(cs *clientStream, err error) { cs.readAborted = true cs.abortStreamLocked(err) } // Constants passed to streamByID for documentation purposes. const ( headerOrDataFrame = true notHeaderOrDataFrame = false ) // streamByID returns the stream with the given id, or nil if no stream has that id. // If headerOrData is true, it clears rst.StreamPingsBlocked. func (rl *clientConnReadLoop) streamByID(id uint32, headerOrData bool) *clientStream { rl.cc.mu.Lock() defer rl.cc.mu.Unlock() if headerOrData { // Work around an unfortunate gRPC behavior. // See comment on ClientConn.rstStreamPingsBlocked for details. rl.cc.rstStreamPingsBlocked = false } rl.cc.readBeforeStreamID = rl.cc.nextStreamID cs := rl.cc.streams[id] if cs != nil && !cs.readAborted { return cs } return nil } func (cs *clientStream) copyTrailers() { for k, vv := range cs.trailer { t := cs.resTrailer if *t == nil { *t = make(http.Header) } (*t)[k] = vv } } func (rl *clientConnReadLoop) processGoAway(f *GoAwayFrame) error { cc := rl.cc cc.t.connPool().MarkDead(cc) if f.ErrCode != 0 { // TODO: deal with GOAWAY more. particularly the error code cc.vlogf("transport got GOAWAY with error code = %v", f.ErrCode) if fn := cc.t.CountError; fn != nil { fn("recv_goaway_" + f.ErrCode.stringToken()) } } cc.setGoAway(f) return nil } func (rl *clientConnReadLoop) processSettings(f *SettingsFrame) error { cc := rl.cc // Locking both mu and wmu here allows frame encoding to read settings with only wmu held. // Acquiring wmu when f.IsAck() is unnecessary, but convenient and mostly harmless. cc.wmu.Lock() defer cc.wmu.Unlock() if err := rl.processSettingsNoWrite(f); err != nil { return err } if !f.IsAck() { cc.fr.WriteSettingsAck() cc.bw.Flush() } return nil } func (rl *clientConnReadLoop) processSettingsNoWrite(f *SettingsFrame) error { cc := rl.cc defer cc.maybeCallStateHook() cc.mu.Lock() defer cc.mu.Unlock() if f.IsAck() { if cc.wantSettingsAck { cc.wantSettingsAck = false return nil } return ConnectionError(ErrCodeProtocol) } var seenMaxConcurrentStreams bool err := f.ForeachSetting(func(s Setting) error { switch s.ID { case SettingMaxFrameSize: cc.maxFrameSize = s.Val case SettingMaxConcurrentStreams: cc.maxConcurrentStreams = s.Val seenMaxConcurrentStreams = true case SettingMaxHeaderListSize: cc.peerMaxHeaderListSize = uint64(s.Val) case SettingInitialWindowSize: // Values above the maximum flow-control // window size of 2^31-1 MUST be treated as a // connection error (Section 5.4.1) of type // FLOW_CONTROL_ERROR. if s.Val > math.MaxInt32 { return ConnectionError(ErrCodeFlowControl) } // Adjust flow control of currently-open // frames by the difference of the old initial // window size and this one. delta := int32(s.Val) - int32(cc.initialWindowSize) for _, cs := range cc.streams { cs.flow.add(delta) } cc.cond.Broadcast() cc.initialWindowSize = s.Val case SettingHeaderTableSize: cc.henc.SetMaxDynamicTableSize(s.Val) cc.peerMaxHeaderTableSize = s.Val case SettingEnableConnectProtocol: if err := s.Valid(); err != nil { return err } // If the peer wants to send us SETTINGS_ENABLE_CONNECT_PROTOCOL, // we require that it do so in the first SETTINGS frame. // // When we attempt to use extended CONNECT, we wait for the first // SETTINGS frame to see if the server supports it. If we let the // server enable the feature with a later SETTINGS frame, then // users will see inconsistent results depending on whether we've // seen that frame or not. if !cc.seenSettings { cc.extendedConnectAllowed = s.Val == 1 } default: cc.vlogf("Unhandled Setting: %v", s) } return nil }) if err != nil { return err } if !cc.seenSettings { if !seenMaxConcurrentStreams { // This was the servers initial SETTINGS frame and it // didn't contain a MAX_CONCURRENT_STREAMS field so // increase the number of concurrent streams this // connection can establish to our default. cc.maxConcurrentStreams = defaultMaxConcurrentStreams } close(cc.seenSettingsChan) cc.seenSettings = true } return nil } func (rl *clientConnReadLoop) processWindowUpdate(f *WindowUpdateFrame) error { cc := rl.cc cs := rl.streamByID(f.StreamID, notHeaderOrDataFrame) if f.StreamID != 0 && cs == nil { return nil } cc.mu.Lock() defer cc.mu.Unlock() fl := &cc.flow if cs != nil { fl = &cs.flow } if !fl.add(int32(f.Increment)) { // For stream, the sender sends RST_STREAM with an error code of FLOW_CONTROL_ERROR if cs != nil { rl.endStreamErrorLocked(cs, StreamError{ StreamID: f.StreamID, Code: ErrCodeFlowControl, }) return nil } return ConnectionError(ErrCodeFlowControl) } cc.cond.Broadcast() return nil } func (rl *clientConnReadLoop) processResetStream(f *RSTStreamFrame) error { cs := rl.streamByID(f.StreamID, notHeaderOrDataFrame) if cs == nil { // TODO: return error if server tries to RST_STREAM an idle stream return nil } serr := streamError(cs.ID, f.ErrCode) serr.Cause = errFromPeer if f.ErrCode == ErrCodeProtocol { rl.cc.SetDoNotReuse() } if fn := cs.cc.t.CountError; fn != nil { fn("recv_rststream_" + f.ErrCode.stringToken()) } cs.abortStream(serr) cs.bufPipe.CloseWithError(serr) return nil } // Ping sends a PING frame to the server and waits for the ack. func (cc *ClientConn) Ping(ctx context.Context) error { c := make(chan struct{}) // Generate a random payload var p [8]byte for { if _, err := rand.Read(p[:]); err != nil { return err } cc.mu.Lock() // check for dup before insert if _, found := cc.pings[p]; !found { cc.pings[p] = c cc.mu.Unlock() break } cc.mu.Unlock() } var pingError error errc := make(chan struct{}) go func() { cc.wmu.Lock() defer cc.wmu.Unlock() if pingError = cc.fr.WritePing(false, p); pingError != nil { close(errc) return } if pingError = cc.bw.Flush(); pingError != nil { close(errc) return } }() select { case <-c: return nil case <-errc: return pingError case <-ctx.Done(): return ctx.Err() case <-cc.readerDone: // connection closed return cc.readerErr } } func (rl *clientConnReadLoop) processPing(f *PingFrame) error { if f.IsAck() { cc := rl.cc defer cc.maybeCallStateHook() cc.mu.Lock() defer cc.mu.Unlock() // If ack, notify listener if any if c, ok := cc.pings[f.Data]; ok { close(c) delete(cc.pings, f.Data) } if cc.pendingResets > 0 { // See clientStream.cleanupWriteRequest. cc.pendingResets = 0 cc.rstStreamPingsBlocked = true cc.cond.Broadcast() } return nil } cc := rl.cc cc.wmu.Lock() defer cc.wmu.Unlock() if err := cc.fr.WritePing(true, f.Data); err != nil { return err } return cc.bw.Flush() } func (rl *clientConnReadLoop) processPushPromise(f *PushPromiseFrame) error { // We told the peer we don't want them. // Spec says: // "PUSH_PROMISE MUST NOT be sent if the SETTINGS_ENABLE_PUSH // setting of the peer endpoint is set to 0. An endpoint that // has set this setting and has received acknowledgement MUST // treat the receipt of a PUSH_PROMISE frame as a connection // error (Section 5.4.1) of type PROTOCOL_ERROR." return ConnectionError(ErrCodeProtocol) } // writeStreamReset sends a RST_STREAM frame. // When ping is true, it also sends a PING frame with a random payload. func (cc *ClientConn) writeStreamReset(streamID uint32, code ErrCode, ping bool, err error) { // TODO: map err to more interesting error codes, once the // HTTP community comes up with some. But currently for // RST_STREAM there's no equivalent to GOAWAY frame's debug // data, and the error codes are all pretty vague ("cancel"). cc.wmu.Lock() cc.fr.WriteRSTStream(streamID, code) if ping { var payload [8]byte rand.Read(payload[:]) cc.fr.WritePing(false, payload) } cc.bw.Flush() cc.wmu.Unlock() } var ( errResponseHeaderListSize = errors.New("http2: response header list larger than advertised limit") errRequestHeaderListSize = httpcommon.ErrRequestHeaderListSize ) func (cc *ClientConn) logf(format string, args ...interface{}) { cc.t.logf(format, args...) } func (cc *ClientConn) vlogf(format string, args ...interface{}) { cc.t.vlogf(format, args...) } func (t *Transport) vlogf(format string, args ...interface{}) { if VerboseLogs { t.logf(format, args...) } } func (t *Transport) logf(format string, args ...interface{}) { log.Printf(format, args...) } var noBody io.ReadCloser = noBodyReader{} type noBodyReader struct{} func (noBodyReader) Close() error { return nil } func (noBodyReader) Read([]byte) (int, error) { return 0, io.EOF } type missingBody struct{} func (missingBody) Close() error { return nil } func (missingBody) Read([]byte) (int, error) { return 0, io.ErrUnexpectedEOF } func strSliceContains(ss []string, s string) bool { for _, v := range ss { if v == s { return true } } return false } type erringRoundTripper struct{ err error } func (rt erringRoundTripper) RoundTripErr() error { return rt.err } func (rt erringRoundTripper) RoundTrip(*http.Request) (*http.Response, error) { return nil, rt.err } var errConcurrentReadOnResBody = errors.New("http2: concurrent read on response body") // gzipReader wraps a response body so it can lazily // get gzip.Reader from the pool on the first call to Read. // After Close is called it puts gzip.Reader to the pool immediately // if there is no Read in progress or later when Read completes. type gzipReader struct { _ incomparable body io.ReadCloser // underlying Response.Body mu sync.Mutex // guards zr and zerr zr *gzip.Reader // stores gzip reader from the pool between reads zerr error // sticky gzip reader init error or sentinel value to detect concurrent read and read after close } type eofReader struct{} func (eofReader) Read([]byte) (int, error) { return 0, io.EOF } func (eofReader) ReadByte() (byte, error) { return 0, io.EOF } var gzipPool = sync.Pool{New: func() any { return new(gzip.Reader) }} // gzipPoolGet gets a gzip.Reader from the pool and resets it to read from r. func gzipPoolGet(r io.Reader) (*gzip.Reader, error) { zr := gzipPool.Get().(*gzip.Reader) if err := zr.Reset(r); err != nil { gzipPoolPut(zr) return nil, err } return zr, nil } // gzipPoolPut puts a gzip.Reader back into the pool. func gzipPoolPut(zr *gzip.Reader) { // Reset will allocate bufio.Reader if we pass it anything // other than a flate.Reader, so ensure that it's getting one. var r flate.Reader = eofReader{} zr.Reset(r) gzipPool.Put(zr) } // acquire returns a gzip.Reader for reading response body. // The reader must be released after use. func (gz *gzipReader) acquire() (*gzip.Reader, error) { gz.mu.Lock() defer gz.mu.Unlock() if gz.zerr != nil { return nil, gz.zerr } if gz.zr == nil { gz.zr, gz.zerr = gzipPoolGet(gz.body) if gz.zerr != nil { return nil, gz.zerr } } ret := gz.zr gz.zr, gz.zerr = nil, errConcurrentReadOnResBody return ret, nil } // release returns the gzip.Reader to the pool if Close was called during Read. func (gz *gzipReader) release(zr *gzip.Reader) { gz.mu.Lock() defer gz.mu.Unlock() if gz.zerr == errConcurrentReadOnResBody { gz.zr, gz.zerr = zr, nil } else { // fs.ErrClosed gzipPoolPut(zr) } } // close returns the gzip.Reader to the pool immediately or // signals release to do so after Read completes. func (gz *gzipReader) close() { gz.mu.Lock() defer gz.mu.Unlock() if gz.zerr == nil && gz.zr != nil { gzipPoolPut(gz.zr) gz.zr = nil } gz.zerr = fs.ErrClosed } func (gz *gzipReader) Read(p []byte) (n int, err error) { zr, err := gz.acquire() if err != nil { return 0, err } defer gz.release(zr) return zr.Read(p) } func (gz *gzipReader) Close() error { gz.close() return gz.body.Close() } type errorReader struct{ err error } func (r errorReader) Read(p []byte) (int, error) { return 0, r.err } // isConnectionCloseRequest reports whether req should use its own // connection for a single request and then close the connection. func isConnectionCloseRequest(req *http.Request) bool { return req.Close || httpguts.HeaderValuesContainsToken(req.Header["Connection"], "close") } // registerHTTPSProtocol calls Transport.RegisterProtocol but // converting panics into errors. func registerHTTPSProtocol(t *http.Transport, rt noDialH2RoundTripper) (err error) { defer func() { if e := recover(); e != nil { err = fmt.Errorf("%v", e) } }() t.RegisterProtocol("https", rt) return nil } // noDialH2RoundTripper is a RoundTripper which only tries to complete the request // if there's already a cached connection to the host. // (The field is exported so it can be accessed via reflect from net/http; tested // by TestNoDialH2RoundTripperType) // // A noDialH2RoundTripper is registered with http1.Transport.RegisterProtocol, // and the http1.Transport can use type assertions to call non-RoundTrip methods on it. // This lets us expose, for example, NewClientConn to net/http. type noDialH2RoundTripper struct{ *Transport } func (rt noDialH2RoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { res, err := rt.Transport.RoundTrip(req) if isNoCachedConnError(err) { return nil, http.ErrSkipAltProtocol } return res, err } func (rt noDialH2RoundTripper) NewClientConn(conn net.Conn, internalStateHook func()) (http.RoundTripper, error) { tr := rt.Transport cc, err := tr.newClientConn(conn, tr.disableKeepAlives(), internalStateHook) if err != nil { return nil, err } // RoundTrip should block when the conn is at its concurrency limit, // not return an error. Setting strictMaxConcurrentStreams enables this. cc.strictMaxConcurrentStreams = true return netHTTPClientConn{cc}, nil } // netHTTPClientConn wraps ClientConn and implements the interface net/http expects from // the RoundTripper returned by NewClientConn. type netHTTPClientConn struct { cc *ClientConn } func (cc netHTTPClientConn) RoundTrip(req *http.Request) (*http.Response, error) { return cc.cc.RoundTrip(req) } func (cc netHTTPClientConn) Close() error { return cc.cc.Close() } func (cc netHTTPClientConn) Err() error { cc.cc.mu.Lock() defer cc.cc.mu.Unlock() if cc.cc.closed { return errors.New("connection closed") } return nil } func (cc netHTTPClientConn) Reserve() error { defer cc.cc.maybeCallStateHook() cc.cc.mu.Lock() defer cc.cc.mu.Unlock() if !cc.cc.canReserveLocked() { return errors.New("connection is unavailable") } cc.cc.streamsReserved++ return nil } func (cc netHTTPClientConn) Release() { defer cc.cc.maybeCallStateHook() cc.cc.mu.Lock() defer cc.cc.mu.Unlock() // We don't complain if streamsReserved is 0. // // This is consistent with RoundTrip: both Release and RoundTrip will // consume a reservation iff one exists. if cc.cc.streamsReserved > 0 { cc.cc.streamsReserved-- } } func (cc netHTTPClientConn) Available() int { cc.cc.mu.Lock() defer cc.cc.mu.Unlock() return cc.cc.availableLocked() } func (cc netHTTPClientConn) InFlight() int { cc.cc.mu.Lock() defer cc.cc.mu.Unlock() return cc.cc.currentRequestCountLocked() } func (cc *ClientConn) maybeCallStateHook() { if cc.internalStateHook != nil { cc.internalStateHook() } } func (t *Transport) idleConnTimeout() time.Duration { // to keep things backwards compatible, we use non-zero values of // IdleConnTimeout, followed by using the IdleConnTimeout on the underlying // http1 transport, followed by 0 if t.IdleConnTimeout != 0 { return t.IdleConnTimeout } if t.t1 != nil { return t.t1.IdleConnTimeout } return 0 } func traceGetConn(req *http.Request, hostPort string) { trace := httptrace.ContextClientTrace(req.Context()) if trace == nil || trace.GetConn == nil { return } trace.GetConn(hostPort) } func traceGotConn(req *http.Request, cc *ClientConn, reused bool) { trace := httptrace.ContextClientTrace(req.Context()) if trace == nil || trace.GotConn == nil { return } ci := httptrace.GotConnInfo{Conn: cc.tconn} ci.Reused = reused cc.mu.Lock() ci.WasIdle = len(cc.streams) == 0 && reused if ci.WasIdle && !cc.lastActive.IsZero() { ci.IdleTime = time.Since(cc.lastActive) } cc.mu.Unlock() trace.GotConn(ci) } func traceWroteHeaders(trace *httptrace.ClientTrace) { if trace != nil && trace.WroteHeaders != nil { trace.WroteHeaders() } } func traceGot100Continue(trace *httptrace.ClientTrace) { if trace != nil && trace.Got100Continue != nil { trace.Got100Continue() } } func traceWait100Continue(trace *httptrace.ClientTrace) { if trace != nil && trace.Wait100Continue != nil { trace.Wait100Continue() } } func traceWroteRequest(trace *httptrace.ClientTrace, err error) { if trace != nil && trace.WroteRequest != nil { trace.WroteRequest(httptrace.WroteRequestInfo{Err: err}) } } func traceFirstResponseByte(trace *httptrace.ClientTrace) { if trace != nil && trace.GotFirstResponseByte != nil { trace.GotFirstResponseByte() } } func traceGot1xxResponseFunc(trace *httptrace.ClientTrace) func(int, textproto.MIMEHeader) error { if trace != nil { return trace.Got1xxResponse } return nil } // dialTLSWithContext uses tls.Dialer, added in Go 1.15, to open a TLS // connection. func (t *Transport) dialTLSWithContext(ctx context.Context, network, addr string, cfg *tls.Config) (*tls.Conn, error) { dialer := &tls.Dialer{ Config: cfg, } cn, err := dialer.DialContext(ctx, network, addr) if err != nil { return nil, err } tlsCn := cn.(*tls.Conn) // DialContext comment promises this will always succeed return tlsCn, nil } ================================================ FILE: vendor/golang.org/x/net/http2/unencrypted.go ================================================ // Copyright 2024 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package http2 import ( "crypto/tls" "errors" "net" ) const nextProtoUnencryptedHTTP2 = "unencrypted_http2" // unencryptedNetConnFromTLSConn retrieves a net.Conn wrapped in a *tls.Conn. // // TLSNextProto functions accept a *tls.Conn. // // When passing an unencrypted HTTP/2 connection to a TLSNextProto function, // we pass a *tls.Conn with an underlying net.Conn containing the unencrypted connection. // To be extra careful about mistakes (accidentally dropping TLS encryption in a place // where we want it), the tls.Conn contains a net.Conn with an UnencryptedNetConn method // that returns the actual connection we want to use. func unencryptedNetConnFromTLSConn(tc *tls.Conn) (net.Conn, error) { conner, ok := tc.NetConn().(interface { UnencryptedNetConn() net.Conn }) if !ok { return nil, errors.New("http2: TLS conn unexpectedly found in unencrypted handoff") } return conner.UnencryptedNetConn(), nil } ================================================ FILE: vendor/golang.org/x/net/http2/write.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package http2 import ( "bytes" "fmt" "log" "net/http" "net/url" "golang.org/x/net/http/httpguts" "golang.org/x/net/http2/hpack" "golang.org/x/net/internal/httpcommon" ) // writeFramer is implemented by any type that is used to write frames. type writeFramer interface { writeFrame(writeContext) error // staysWithinBuffer reports whether this writer promises that // it will only write less than or equal to size bytes, and it // won't Flush the write context. staysWithinBuffer(size int) bool } // writeContext is the interface needed by the various frame writer // types below. All the writeFrame methods below are scheduled via the // frame writing scheduler (see writeScheduler in writesched.go). // // This interface is implemented by *serverConn. // // TODO: decide whether to a) use this in the client code (which didn't // end up using this yet, because it has a simpler design, not // currently implementing priorities), or b) delete this and // make the server code a bit more concrete. type writeContext interface { Framer() *Framer Flush() error CloseConn() error // HeaderEncoder returns an HPACK encoder that writes to the // returned buffer. HeaderEncoder() (*hpack.Encoder, *bytes.Buffer) } // writeEndsStream reports whether w writes a frame that will transition // the stream to a half-closed local state. This returns false for RST_STREAM, // which closes the entire stream (not just the local half). func writeEndsStream(w writeFramer) bool { switch v := w.(type) { case *writeData: return v.endStream case *writeResHeaders: return v.endStream case nil: // This can only happen if the caller reuses w after it's // been intentionally nil'ed out to prevent use. Keep this // here to catch future refactoring breaking it. panic("writeEndsStream called on nil writeFramer") } return false } type flushFrameWriter struct{} func (flushFrameWriter) writeFrame(ctx writeContext) error { return ctx.Flush() } func (flushFrameWriter) staysWithinBuffer(max int) bool { return false } type writeSettings []Setting func (s writeSettings) staysWithinBuffer(max int) bool { const settingSize = 6 // uint16 + uint32 return frameHeaderLen+settingSize*len(s) <= max } func (s writeSettings) writeFrame(ctx writeContext) error { return ctx.Framer().WriteSettings([]Setting(s)...) } type writeGoAway struct { maxStreamID uint32 code ErrCode } func (p *writeGoAway) writeFrame(ctx writeContext) error { err := ctx.Framer().WriteGoAway(p.maxStreamID, p.code, nil) ctx.Flush() // ignore error: we're hanging up on them anyway return err } func (*writeGoAway) staysWithinBuffer(max int) bool { return false } // flushes type writeData struct { streamID uint32 p []byte endStream bool } func (w *writeData) String() string { return fmt.Sprintf("writeData(stream=%d, p=%d, endStream=%v)", w.streamID, len(w.p), w.endStream) } func (w *writeData) writeFrame(ctx writeContext) error { return ctx.Framer().WriteData(w.streamID, w.endStream, w.p) } func (w *writeData) staysWithinBuffer(max int) bool { return frameHeaderLen+len(w.p) <= max } // handlerPanicRST is the message sent from handler goroutines when // the handler panics. type handlerPanicRST struct { StreamID uint32 } func (hp handlerPanicRST) writeFrame(ctx writeContext) error { return ctx.Framer().WriteRSTStream(hp.StreamID, ErrCodeInternal) } func (hp handlerPanicRST) staysWithinBuffer(max int) bool { return frameHeaderLen+4 <= max } func (se StreamError) writeFrame(ctx writeContext) error { return ctx.Framer().WriteRSTStream(se.StreamID, se.Code) } func (se StreamError) staysWithinBuffer(max int) bool { return frameHeaderLen+4 <= max } type writePing struct { data [8]byte } func (w writePing) writeFrame(ctx writeContext) error { return ctx.Framer().WritePing(false, w.data) } func (w writePing) staysWithinBuffer(max int) bool { return frameHeaderLen+len(w.data) <= max } type writePingAck struct{ pf *PingFrame } func (w writePingAck) writeFrame(ctx writeContext) error { return ctx.Framer().WritePing(true, w.pf.Data) } func (w writePingAck) staysWithinBuffer(max int) bool { return frameHeaderLen+len(w.pf.Data) <= max } type writeSettingsAck struct{} func (writeSettingsAck) writeFrame(ctx writeContext) error { return ctx.Framer().WriteSettingsAck() } func (writeSettingsAck) staysWithinBuffer(max int) bool { return frameHeaderLen <= max } // splitHeaderBlock splits headerBlock into fragments so that each fragment fits // in a single frame, then calls fn for each fragment. firstFrag/lastFrag are true // for the first/last fragment, respectively. func splitHeaderBlock(ctx writeContext, headerBlock []byte, fn func(ctx writeContext, frag []byte, firstFrag, lastFrag bool) error) error { // For now we're lazy and just pick the minimum MAX_FRAME_SIZE // that all peers must support (16KB). Later we could care // more and send larger frames if the peer advertised it, but // there's little point. Most headers are small anyway (so we // generally won't have CONTINUATION frames), and extra frames // only waste 9 bytes anyway. const maxFrameSize = 16384 first := true for len(headerBlock) > 0 { frag := headerBlock if len(frag) > maxFrameSize { frag = frag[:maxFrameSize] } headerBlock = headerBlock[len(frag):] if err := fn(ctx, frag, first, len(headerBlock) == 0); err != nil { return err } first = false } return nil } // writeResHeaders is a request to write a HEADERS and 0+ CONTINUATION frames // for HTTP response headers or trailers from a server handler. type writeResHeaders struct { streamID uint32 httpResCode int // 0 means no ":status" line h http.Header // may be nil trailers []string // if non-nil, which keys of h to write. nil means all. endStream bool date string contentType string contentLength string } func encKV(enc *hpack.Encoder, k, v string) { if VerboseLogs { log.Printf("http2: server encoding header %q = %q", k, v) } enc.WriteField(hpack.HeaderField{Name: k, Value: v}) } func (w *writeResHeaders) staysWithinBuffer(max int) bool { // TODO: this is a common one. It'd be nice to return true // here and get into the fast path if we could be clever and // calculate the size fast enough, or at least a conservative // upper bound that usually fires. (Maybe if w.h and // w.trailers are nil, so we don't need to enumerate it.) // Otherwise I'm afraid that just calculating the length to // answer this question would be slower than the ~2µs benefit. return false } func (w *writeResHeaders) writeFrame(ctx writeContext) error { enc, buf := ctx.HeaderEncoder() buf.Reset() if w.httpResCode != 0 { encKV(enc, ":status", httpCodeString(w.httpResCode)) } encodeHeaders(enc, w.h, w.trailers) if w.contentType != "" { encKV(enc, "content-type", w.contentType) } if w.contentLength != "" { encKV(enc, "content-length", w.contentLength) } if w.date != "" { encKV(enc, "date", w.date) } headerBlock := buf.Bytes() if len(headerBlock) == 0 && w.trailers == nil { panic("unexpected empty hpack") } return splitHeaderBlock(ctx, headerBlock, w.writeHeaderBlock) } func (w *writeResHeaders) writeHeaderBlock(ctx writeContext, frag []byte, firstFrag, lastFrag bool) error { if firstFrag { return ctx.Framer().WriteHeaders(HeadersFrameParam{ StreamID: w.streamID, BlockFragment: frag, EndStream: w.endStream, EndHeaders: lastFrag, }) } else { return ctx.Framer().WriteContinuation(w.streamID, lastFrag, frag) } } // writePushPromise is a request to write a PUSH_PROMISE and 0+ CONTINUATION frames. type writePushPromise struct { streamID uint32 // pusher stream method string // for :method url *url.URL // for :scheme, :authority, :path h http.Header // Creates an ID for a pushed stream. This runs on serveG just before // the frame is written. The returned ID is copied to promisedID. allocatePromisedID func() (uint32, error) promisedID uint32 } func (w *writePushPromise) staysWithinBuffer(max int) bool { // TODO: see writeResHeaders.staysWithinBuffer return false } func (w *writePushPromise) writeFrame(ctx writeContext) error { enc, buf := ctx.HeaderEncoder() buf.Reset() encKV(enc, ":method", w.method) encKV(enc, ":scheme", w.url.Scheme) encKV(enc, ":authority", w.url.Host) encKV(enc, ":path", w.url.RequestURI()) encodeHeaders(enc, w.h, nil) headerBlock := buf.Bytes() if len(headerBlock) == 0 { panic("unexpected empty hpack") } return splitHeaderBlock(ctx, headerBlock, w.writeHeaderBlock) } func (w *writePushPromise) writeHeaderBlock(ctx writeContext, frag []byte, firstFrag, lastFrag bool) error { if firstFrag { return ctx.Framer().WritePushPromise(PushPromiseParam{ StreamID: w.streamID, PromiseID: w.promisedID, BlockFragment: frag, EndHeaders: lastFrag, }) } else { return ctx.Framer().WriteContinuation(w.streamID, lastFrag, frag) } } type write100ContinueHeadersFrame struct { streamID uint32 } func (w write100ContinueHeadersFrame) writeFrame(ctx writeContext) error { enc, buf := ctx.HeaderEncoder() buf.Reset() encKV(enc, ":status", "100") return ctx.Framer().WriteHeaders(HeadersFrameParam{ StreamID: w.streamID, BlockFragment: buf.Bytes(), EndStream: false, EndHeaders: true, }) } func (w write100ContinueHeadersFrame) staysWithinBuffer(max int) bool { // Sloppy but conservative: return 9+2*(len(":status")+len("100")) <= max } type writeWindowUpdate struct { streamID uint32 // or 0 for conn-level n uint32 } func (wu writeWindowUpdate) staysWithinBuffer(max int) bool { return frameHeaderLen+4 <= max } func (wu writeWindowUpdate) writeFrame(ctx writeContext) error { return ctx.Framer().WriteWindowUpdate(wu.streamID, wu.n) } // encodeHeaders encodes an http.Header. If keys is not nil, then (k, h[k]) // is encoded only if k is in keys. func encodeHeaders(enc *hpack.Encoder, h http.Header, keys []string) { if keys == nil { sorter := sorterPool.Get().(*sorter) // Using defer here, since the returned keys from the // sorter.Keys method is only valid until the sorter // is returned: defer sorterPool.Put(sorter) keys = sorter.Keys(h) } for _, k := range keys { vv := h[k] k, ascii := httpcommon.LowerHeader(k) if !ascii { // Skip writing invalid headers. Per RFC 7540, Section 8.1.2, header // field names have to be ASCII characters (just as in HTTP/1.x). continue } if !validWireHeaderFieldName(k) { // Skip it as backup paranoia. Per // golang.org/issue/14048, these should // already be rejected at a higher level. continue } isTE := k == "transfer-encoding" for _, v := range vv { if !httpguts.ValidHeaderFieldValue(v) { // TODO: return an error? golang.org/issue/14048 // For now just omit it. continue } // TODO: more of "8.1.2.2 Connection-Specific Header Fields" if isTE && v != "trailers" { continue } encKV(enc, k, v) } } } ================================================ FILE: vendor/golang.org/x/net/http2/writesched.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package http2 import "fmt" // WriteScheduler is the interface implemented by HTTP/2 write schedulers. // Methods are never called concurrently. type WriteScheduler interface { // OpenStream opens a new stream in the write scheduler. // It is illegal to call this with streamID=0 or with a streamID that is // already open -- the call may panic. OpenStream(streamID uint32, options OpenStreamOptions) // CloseStream closes a stream in the write scheduler. Any frames queued on // this stream should be discarded. It is illegal to call this on a stream // that is not open -- the call may panic. CloseStream(streamID uint32) // AdjustStream adjusts the priority of the given stream. This may be called // on a stream that has not yet been opened or has been closed. Note that // RFC 7540 allows PRIORITY frames to be sent on streams in any state. See: // https://tools.ietf.org/html/rfc7540#section-5.1 AdjustStream(streamID uint32, priority PriorityParam) // Push queues a frame in the scheduler. In most cases, this will not be // called with wr.StreamID()!=0 unless that stream is currently open. The one // exception is RST_STREAM frames, which may be sent on idle or closed streams. Push(wr FrameWriteRequest) // Pop dequeues the next frame to write. Returns false if no frames can // be written. Frames with a given wr.StreamID() are Pop'd in the same // order they are Push'd, except RST_STREAM frames. No frames should be // discarded except by CloseStream. Pop() (wr FrameWriteRequest, ok bool) } // OpenStreamOptions specifies extra options for WriteScheduler.OpenStream. type OpenStreamOptions struct { // PusherID is zero if the stream was initiated by the client. Otherwise, // PusherID names the stream that pushed the newly opened stream. PusherID uint32 // priority is used to set the priority of the newly opened stream. priority PriorityParam } // FrameWriteRequest is a request to write a frame. type FrameWriteRequest struct { // write is the interface value that does the writing, once the // WriteScheduler has selected this frame to write. The write // functions are all defined in write.go. write writeFramer // stream is the stream on which this frame will be written. // nil for non-stream frames like PING and SETTINGS. // nil for RST_STREAM streams, which use the StreamError.StreamID field instead. stream *stream // done, if non-nil, must be a buffered channel with space for // 1 message and is sent the return value from write (or an // earlier error) when the frame has been written. done chan error } // StreamID returns the id of the stream this frame will be written to. // 0 is used for non-stream frames such as PING and SETTINGS. func (wr FrameWriteRequest) StreamID() uint32 { if wr.stream == nil { if se, ok := wr.write.(StreamError); ok { // (*serverConn).resetStream doesn't set // stream because it doesn't necessarily have // one. So special case this type of write // message. return se.StreamID } return 0 } return wr.stream.id } // isControl reports whether wr is a control frame for MaxQueuedControlFrames // purposes. That includes non-stream frames and RST_STREAM frames. func (wr FrameWriteRequest) isControl() bool { return wr.stream == nil } // DataSize returns the number of flow control bytes that must be consumed // to write this entire frame. This is 0 for non-DATA frames. func (wr FrameWriteRequest) DataSize() int { if wd, ok := wr.write.(*writeData); ok { return len(wd.p) } return 0 } // Consume consumes min(n, available) bytes from this frame, where available // is the number of flow control bytes available on the stream. Consume returns // 0, 1, or 2 frames, where the integer return value gives the number of frames // returned. // // If flow control prevents consuming any bytes, this returns (_, _, 0). If // the entire frame was consumed, this returns (wr, _, 1). Otherwise, this // returns (consumed, rest, 2), where 'consumed' contains the consumed bytes and // 'rest' contains the remaining bytes. The consumed bytes are deducted from the // underlying stream's flow control budget. func (wr FrameWriteRequest) Consume(n int32) (FrameWriteRequest, FrameWriteRequest, int) { var empty FrameWriteRequest // Non-DATA frames are always consumed whole. wd, ok := wr.write.(*writeData) if !ok || len(wd.p) == 0 { return wr, empty, 1 } // Might need to split after applying limits. allowed := wr.stream.flow.available() if n < allowed { allowed = n } if wr.stream.sc.maxFrameSize < allowed { allowed = wr.stream.sc.maxFrameSize } if allowed <= 0 { return empty, empty, 0 } if len(wd.p) > int(allowed) { wr.stream.flow.take(allowed) consumed := FrameWriteRequest{ stream: wr.stream, write: &writeData{ streamID: wd.streamID, p: wd.p[:allowed], // Even if the original had endStream set, there // are bytes remaining because len(wd.p) > allowed, // so we know endStream is false. endStream: false, }, // Our caller is blocking on the final DATA frame, not // this intermediate frame, so no need to wait. done: nil, } rest := FrameWriteRequest{ stream: wr.stream, write: &writeData{ streamID: wd.streamID, p: wd.p[allowed:], endStream: wd.endStream, }, done: wr.done, } return consumed, rest, 2 } // The frame is consumed whole. // NB: This cast cannot overflow because allowed is <= math.MaxInt32. wr.stream.flow.take(int32(len(wd.p))) return wr, empty, 1 } // String is for debugging only. func (wr FrameWriteRequest) String() string { var des string if s, ok := wr.write.(fmt.Stringer); ok { des = s.String() } else { des = fmt.Sprintf("%T", wr.write) } return fmt.Sprintf("[FrameWriteRequest stream=%d, ch=%v, writer=%v]", wr.StreamID(), wr.done != nil, des) } // replyToWriter sends err to wr.done and panics if the send must block // This does nothing if wr.done is nil. func (wr *FrameWriteRequest) replyToWriter(err error) { if wr.done == nil { return } select { case wr.done <- err: default: panic(fmt.Sprintf("unbuffered done channel passed in for type %T", wr.write)) } wr.write = nil // prevent use (assume it's tainted after wr.done send) } // writeQueue is used by implementations of WriteScheduler. // // Each writeQueue contains a queue of FrameWriteRequests, meant to store all // FrameWriteRequests associated with a given stream. This is implemented as a // two-stage queue: currQueue[currPos:] and nextQueue. Removing an item is done // by incrementing currPos of currQueue. Adding an item is done by appending it // to the nextQueue. If currQueue is empty when trying to remove an item, we // can swap currQueue and nextQueue to remedy the situation. // This two-stage queue is analogous to the use of two lists in Okasaki's // purely functional queue but without the overhead of reversing the list when // swapping stages. // // writeQueue also contains prev and next, this can be used by implementations // of WriteScheduler to construct data structures that represent the order of // writing between different streams (e.g. circular linked list). type writeQueue struct { currQueue []FrameWriteRequest nextQueue []FrameWriteRequest currPos int prev, next *writeQueue } func (q *writeQueue) empty() bool { return (len(q.currQueue) - q.currPos + len(q.nextQueue)) == 0 } func (q *writeQueue) push(wr FrameWriteRequest) { q.nextQueue = append(q.nextQueue, wr) } func (q *writeQueue) shift() FrameWriteRequest { if q.empty() { panic("invalid use of queue") } if q.currPos >= len(q.currQueue) { q.currQueue, q.currPos, q.nextQueue = q.nextQueue, 0, q.currQueue[:0] } wr := q.currQueue[q.currPos] q.currQueue[q.currPos] = FrameWriteRequest{} q.currPos++ return wr } func (q *writeQueue) peek() *FrameWriteRequest { if q.currPos < len(q.currQueue) { return &q.currQueue[q.currPos] } if len(q.nextQueue) > 0 { return &q.nextQueue[0] } return nil } // consume consumes up to n bytes from q.s[0]. If the frame is // entirely consumed, it is removed from the queue. If the frame // is partially consumed, the frame is kept with the consumed // bytes removed. Returns true iff any bytes were consumed. func (q *writeQueue) consume(n int32) (FrameWriteRequest, bool) { if q.empty() { return FrameWriteRequest{}, false } consumed, rest, numresult := q.peek().Consume(n) switch numresult { case 0: return FrameWriteRequest{}, false case 1: q.shift() case 2: *q.peek() = rest } return consumed, true } type writeQueuePool []*writeQueue // put inserts an unused writeQueue into the pool. func (p *writeQueuePool) put(q *writeQueue) { for i := range q.currQueue { q.currQueue[i] = FrameWriteRequest{} } for i := range q.nextQueue { q.nextQueue[i] = FrameWriteRequest{} } q.currQueue = q.currQueue[:0] q.nextQueue = q.nextQueue[:0] q.currPos = 0 *p = append(*p, q) } // get returns an empty writeQueue. func (p *writeQueuePool) get() *writeQueue { ln := len(*p) if ln == 0 { return new(writeQueue) } x := ln - 1 q := (*p)[x] (*p)[x] = nil *p = (*p)[:x] return q } ================================================ FILE: vendor/golang.org/x/net/http2/writesched_priority_rfc7540.go ================================================ // Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package http2 import ( "fmt" "math" "sort" ) // RFC 7540, Section 5.3.5: the default weight is 16. const priorityDefaultWeightRFC7540 = 15 // 16 = 15 + 1 // PriorityWriteSchedulerConfig configures a priorityWriteScheduler. type PriorityWriteSchedulerConfig struct { // MaxClosedNodesInTree controls the maximum number of closed streams to // retain in the priority tree. Setting this to zero saves a small amount // of memory at the cost of performance. // // See RFC 7540, Section 5.3.4: // "It is possible for a stream to become closed while prioritization // information ... is in transit. ... This potentially creates suboptimal // prioritization, since the stream could be given a priority that is // different from what is intended. To avoid these problems, an endpoint // SHOULD retain stream prioritization state for a period after streams // become closed. The longer state is retained, the lower the chance that // streams are assigned incorrect or default priority values." MaxClosedNodesInTree int // MaxIdleNodesInTree controls the maximum number of idle streams to // retain in the priority tree. Setting this to zero saves a small amount // of memory at the cost of performance. // // See RFC 7540, Section 5.3.4: // Similarly, streams that are in the "idle" state can be assigned // priority or become a parent of other streams. This allows for the // creation of a grouping node in the dependency tree, which enables // more flexible expressions of priority. Idle streams begin with a // default priority (Section 5.3.5). MaxIdleNodesInTree int // ThrottleOutOfOrderWrites enables write throttling to help ensure that // data is delivered in priority order. This works around a race where // stream B depends on stream A and both streams are about to call Write // to queue DATA frames. If B wins the race, a naive scheduler would eagerly // write as much data from B as possible, but this is suboptimal because A // is a higher-priority stream. With throttling enabled, we write a small // amount of data from B to minimize the amount of bandwidth that B can // steal from A. ThrottleOutOfOrderWrites bool } // NewPriorityWriteScheduler constructs a WriteScheduler that schedules // frames by following HTTP/2 priorities as described in RFC 7540 Section 5.3. // If cfg is nil, default options are used. func NewPriorityWriteScheduler(cfg *PriorityWriteSchedulerConfig) WriteScheduler { return newPriorityWriteSchedulerRFC7540(cfg) } func newPriorityWriteSchedulerRFC7540(cfg *PriorityWriteSchedulerConfig) WriteScheduler { if cfg == nil { // For justification of these defaults, see: // https://docs.google.com/document/d/1oLhNg1skaWD4_DtaoCxdSRN5erEXrH-KnLrMwEpOtFY cfg = &PriorityWriteSchedulerConfig{ MaxClosedNodesInTree: 10, MaxIdleNodesInTree: 10, ThrottleOutOfOrderWrites: false, } } ws := &priorityWriteSchedulerRFC7540{ nodes: make(map[uint32]*priorityNodeRFC7540), maxClosedNodesInTree: cfg.MaxClosedNodesInTree, maxIdleNodesInTree: cfg.MaxIdleNodesInTree, enableWriteThrottle: cfg.ThrottleOutOfOrderWrites, } ws.nodes[0] = &ws.root if cfg.ThrottleOutOfOrderWrites { ws.writeThrottleLimit = 1024 } else { ws.writeThrottleLimit = math.MaxInt32 } return ws } type priorityNodeStateRFC7540 int const ( priorityNodeOpenRFC7540 priorityNodeStateRFC7540 = iota priorityNodeClosedRFC7540 priorityNodeIdleRFC7540 ) // priorityNodeRFC7540 is a node in an HTTP/2 priority tree. // Each node is associated with a single stream ID. // See RFC 7540, Section 5.3. type priorityNodeRFC7540 struct { q writeQueue // queue of pending frames to write id uint32 // id of the stream, or 0 for the root of the tree weight uint8 // the actual weight is weight+1, so the value is in [1,256] state priorityNodeStateRFC7540 // open | closed | idle bytes int64 // number of bytes written by this node, or 0 if closed subtreeBytes int64 // sum(node.bytes) of all nodes in this subtree // These links form the priority tree. parent *priorityNodeRFC7540 kids *priorityNodeRFC7540 // start of the kids list prev, next *priorityNodeRFC7540 // doubly-linked list of siblings } func (n *priorityNodeRFC7540) setParent(parent *priorityNodeRFC7540) { if n == parent { panic("setParent to self") } if n.parent == parent { return } // Unlink from current parent. if parent := n.parent; parent != nil { if n.prev == nil { parent.kids = n.next } else { n.prev.next = n.next } if n.next != nil { n.next.prev = n.prev } } // Link to new parent. // If parent=nil, remove n from the tree. // Always insert at the head of parent.kids (this is assumed by walkReadyInOrder). n.parent = parent if parent == nil { n.next = nil n.prev = nil } else { n.next = parent.kids n.prev = nil if n.next != nil { n.next.prev = n } parent.kids = n } } func (n *priorityNodeRFC7540) addBytes(b int64) { n.bytes += b for ; n != nil; n = n.parent { n.subtreeBytes += b } } // walkReadyInOrder iterates over the tree in priority order, calling f for each node // with a non-empty write queue. When f returns true, this function returns true and the // walk halts. tmp is used as scratch space for sorting. // // f(n, openParent) takes two arguments: the node to visit, n, and a bool that is true // if any ancestor p of n is still open (ignoring the root node). func (n *priorityNodeRFC7540) walkReadyInOrder(openParent bool, tmp *[]*priorityNodeRFC7540, f func(*priorityNodeRFC7540, bool) bool) bool { if !n.q.empty() && f(n, openParent) { return true } if n.kids == nil { return false } // Don't consider the root "open" when updating openParent since // we can't send data frames on the root stream (only control frames). if n.id != 0 { openParent = openParent || (n.state == priorityNodeOpenRFC7540) } // Common case: only one kid or all kids have the same weight. // Some clients don't use weights; other clients (like web browsers) // use mostly-linear priority trees. w := n.kids.weight needSort := false for k := n.kids.next; k != nil; k = k.next { if k.weight != w { needSort = true break } } if !needSort { for k := n.kids; k != nil; k = k.next { if k.walkReadyInOrder(openParent, tmp, f) { return true } } return false } // Uncommon case: sort the child nodes. We remove the kids from the parent, // then re-insert after sorting so we can reuse tmp for future sort calls. *tmp = (*tmp)[:0] for n.kids != nil { *tmp = append(*tmp, n.kids) n.kids.setParent(nil) } sort.Sort(sortPriorityNodeSiblingsRFC7540(*tmp)) for i := len(*tmp) - 1; i >= 0; i-- { (*tmp)[i].setParent(n) // setParent inserts at the head of n.kids } for k := n.kids; k != nil; k = k.next { if k.walkReadyInOrder(openParent, tmp, f) { return true } } return false } type sortPriorityNodeSiblingsRFC7540 []*priorityNodeRFC7540 func (z sortPriorityNodeSiblingsRFC7540) Len() int { return len(z) } func (z sortPriorityNodeSiblingsRFC7540) Swap(i, k int) { z[i], z[k] = z[k], z[i] } func (z sortPriorityNodeSiblingsRFC7540) Less(i, k int) bool { // Prefer the subtree that has sent fewer bytes relative to its weight. // See sections 5.3.2 and 5.3.4. wi, bi := float64(z[i].weight)+1, float64(z[i].subtreeBytes) wk, bk := float64(z[k].weight)+1, float64(z[k].subtreeBytes) if bi == 0 && bk == 0 { return wi >= wk } if bk == 0 { return false } return bi/bk <= wi/wk } type priorityWriteSchedulerRFC7540 struct { // root is the root of the priority tree, where root.id = 0. // The root queues control frames that are not associated with any stream. root priorityNodeRFC7540 // nodes maps stream ids to priority tree nodes. nodes map[uint32]*priorityNodeRFC7540 // maxID is the maximum stream id in nodes. maxID uint32 // lists of nodes that have been closed or are idle, but are kept in // the tree for improved prioritization. When the lengths exceed either // maxClosedNodesInTree or maxIdleNodesInTree, old nodes are discarded. closedNodes, idleNodes []*priorityNodeRFC7540 // From the config. maxClosedNodesInTree int maxIdleNodesInTree int writeThrottleLimit int32 enableWriteThrottle bool // tmp is scratch space for priorityNode.walkReadyInOrder to reduce allocations. tmp []*priorityNodeRFC7540 // pool of empty queues for reuse. queuePool writeQueuePool } func (ws *priorityWriteSchedulerRFC7540) OpenStream(streamID uint32, options OpenStreamOptions) { // The stream may be currently idle but cannot be opened or closed. if curr := ws.nodes[streamID]; curr != nil { if curr.state != priorityNodeIdleRFC7540 { panic(fmt.Sprintf("stream %d already opened", streamID)) } curr.state = priorityNodeOpenRFC7540 return } // RFC 7540, Section 5.3.5: // "All streams are initially assigned a non-exclusive dependency on stream 0x0. // Pushed streams initially depend on their associated stream. In both cases, // streams are assigned a default weight of 16." parent := ws.nodes[options.PusherID] if parent == nil { parent = &ws.root } n := &priorityNodeRFC7540{ q: *ws.queuePool.get(), id: streamID, weight: priorityDefaultWeightRFC7540, state: priorityNodeOpenRFC7540, } n.setParent(parent) ws.nodes[streamID] = n if streamID > ws.maxID { ws.maxID = streamID } } func (ws *priorityWriteSchedulerRFC7540) CloseStream(streamID uint32) { if streamID == 0 { panic("violation of WriteScheduler interface: cannot close stream 0") } if ws.nodes[streamID] == nil { panic(fmt.Sprintf("violation of WriteScheduler interface: unknown stream %d", streamID)) } if ws.nodes[streamID].state != priorityNodeOpenRFC7540 { panic(fmt.Sprintf("violation of WriteScheduler interface: stream %d already closed", streamID)) } n := ws.nodes[streamID] n.state = priorityNodeClosedRFC7540 n.addBytes(-n.bytes) q := n.q ws.queuePool.put(&q) if ws.maxClosedNodesInTree > 0 { ws.addClosedOrIdleNode(&ws.closedNodes, ws.maxClosedNodesInTree, n) } else { ws.removeNode(n) } } func (ws *priorityWriteSchedulerRFC7540) AdjustStream(streamID uint32, priority PriorityParam) { if streamID == 0 { panic("adjustPriority on root") } // If streamID does not exist, there are two cases: // - A closed stream that has been removed (this will have ID <= maxID) // - An idle stream that is being used for "grouping" (this will have ID > maxID) n := ws.nodes[streamID] if n == nil { if streamID <= ws.maxID || ws.maxIdleNodesInTree == 0 { return } ws.maxID = streamID n = &priorityNodeRFC7540{ q: *ws.queuePool.get(), id: streamID, weight: priorityDefaultWeightRFC7540, state: priorityNodeIdleRFC7540, } n.setParent(&ws.root) ws.nodes[streamID] = n ws.addClosedOrIdleNode(&ws.idleNodes, ws.maxIdleNodesInTree, n) } // Section 5.3.1: A dependency on a stream that is not currently in the tree // results in that stream being given a default priority (Section 5.3.5). parent := ws.nodes[priority.StreamDep] if parent == nil { n.setParent(&ws.root) n.weight = priorityDefaultWeightRFC7540 return } // Ignore if the client tries to make a node its own parent. if n == parent { return } // Section 5.3.3: // "If a stream is made dependent on one of its own dependencies, the // formerly dependent stream is first moved to be dependent on the // reprioritized stream's previous parent. The moved dependency retains // its weight." // // That is: if parent depends on n, move parent to depend on n.parent. for x := parent.parent; x != nil; x = x.parent { if x == n { parent.setParent(n.parent) break } } // Section 5.3.3: The exclusive flag causes the stream to become the sole // dependency of its parent stream, causing other dependencies to become // dependent on the exclusive stream. if priority.Exclusive { k := parent.kids for k != nil { next := k.next if k != n { k.setParent(n) } k = next } } n.setParent(parent) n.weight = priority.Weight } func (ws *priorityWriteSchedulerRFC7540) Push(wr FrameWriteRequest) { var n *priorityNodeRFC7540 if wr.isControl() { n = &ws.root } else { id := wr.StreamID() n = ws.nodes[id] if n == nil { // id is an idle or closed stream. wr should not be a HEADERS or // DATA frame. In other case, we push wr onto the root, rather // than creating a new priorityNode. if wr.DataSize() > 0 { panic("add DATA on non-open stream") } n = &ws.root } } n.q.push(wr) } func (ws *priorityWriteSchedulerRFC7540) Pop() (wr FrameWriteRequest, ok bool) { ws.root.walkReadyInOrder(false, &ws.tmp, func(n *priorityNodeRFC7540, openParent bool) bool { limit := int32(math.MaxInt32) if openParent { limit = ws.writeThrottleLimit } wr, ok = n.q.consume(limit) if !ok { return false } n.addBytes(int64(wr.DataSize())) // If B depends on A and B continuously has data available but A // does not, gradually increase the throttling limit to allow B to // steal more and more bandwidth from A. if openParent { ws.writeThrottleLimit += 1024 if ws.writeThrottleLimit < 0 { ws.writeThrottleLimit = math.MaxInt32 } } else if ws.enableWriteThrottle { ws.writeThrottleLimit = 1024 } return true }) return wr, ok } func (ws *priorityWriteSchedulerRFC7540) addClosedOrIdleNode(list *[]*priorityNodeRFC7540, maxSize int, n *priorityNodeRFC7540) { if maxSize == 0 { return } if len(*list) == maxSize { // Remove the oldest node, then shift left. ws.removeNode((*list)[0]) x := (*list)[1:] copy(*list, x) *list = (*list)[:len(x)] } *list = append(*list, n) } func (ws *priorityWriteSchedulerRFC7540) removeNode(n *priorityNodeRFC7540) { for n.kids != nil { n.kids.setParent(n.parent) } n.setParent(nil) delete(ws.nodes, n.id) } ================================================ FILE: vendor/golang.org/x/net/http2/writesched_priority_rfc9218.go ================================================ // Copyright 2025 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package http2 import ( "fmt" "math" ) type streamMetadata struct { location *writeQueue priority PriorityParam } type priorityWriteSchedulerRFC9218 struct { // control contains control frames (SETTINGS, PING, etc.). control writeQueue // heads contain the head of a circular list of streams. // We put these heads within a nested array that represents urgency and // incremental, as defined in // https://www.rfc-editor.org/rfc/rfc9218.html#name-priority-parameters. // 8 represents u=0 up to u=7, and 2 represents i=false and i=true. heads [8][2]*writeQueue // streams contains a mapping between each stream ID and their metadata, so // we can quickly locate them when needing to, for example, adjust their // priority. streams map[uint32]streamMetadata // queuePool are empty queues for reuse. queuePool writeQueuePool // prioritizeIncremental is used to determine whether we should prioritize // incremental streams or not, when urgency is the same in a given Pop() // call. prioritizeIncremental bool // priorityUpdateBuf is used to buffer the most recent PRIORITY_UPDATE we // receive per https://www.rfc-editor.org/rfc/rfc9218.html#name-the-priority_update-frame. priorityUpdateBuf struct { // streamID being 0 means that the buffer is empty. This is a safe // assumption as PRIORITY_UPDATE for stream 0 is a PROTOCOL_ERROR. streamID uint32 priority PriorityParam } } func newPriorityWriteSchedulerRFC9218() WriteScheduler { ws := &priorityWriteSchedulerRFC9218{ streams: make(map[uint32]streamMetadata), } return ws } func (ws *priorityWriteSchedulerRFC9218) OpenStream(streamID uint32, opt OpenStreamOptions) { if ws.streams[streamID].location != nil { panic(fmt.Errorf("stream %d already opened", streamID)) } if streamID == ws.priorityUpdateBuf.streamID { ws.priorityUpdateBuf.streamID = 0 opt.priority = ws.priorityUpdateBuf.priority } q := ws.queuePool.get() ws.streams[streamID] = streamMetadata{ location: q, priority: opt.priority, } u, i := opt.priority.urgency, opt.priority.incremental if ws.heads[u][i] == nil { ws.heads[u][i] = q q.next = q q.prev = q } else { // Queues are stored in a ring. // Insert the new stream before ws.head, putting it at the end of the list. q.prev = ws.heads[u][i].prev q.next = ws.heads[u][i] q.prev.next = q q.next.prev = q } } func (ws *priorityWriteSchedulerRFC9218) CloseStream(streamID uint32) { metadata := ws.streams[streamID] q, u, i := metadata.location, metadata.priority.urgency, metadata.priority.incremental if q == nil { return } if q.next == q { // This was the only open stream. ws.heads[u][i] = nil } else { q.prev.next = q.next q.next.prev = q.prev if ws.heads[u][i] == q { ws.heads[u][i] = q.next } } delete(ws.streams, streamID) ws.queuePool.put(q) } func (ws *priorityWriteSchedulerRFC9218) AdjustStream(streamID uint32, priority PriorityParam) { metadata := ws.streams[streamID] q, u, i := metadata.location, metadata.priority.urgency, metadata.priority.incremental if q == nil { ws.priorityUpdateBuf.streamID = streamID ws.priorityUpdateBuf.priority = priority return } // Remove stream from current location. if q.next == q { // This was the only open stream. ws.heads[u][i] = nil } else { q.prev.next = q.next q.next.prev = q.prev if ws.heads[u][i] == q { ws.heads[u][i] = q.next } } // Insert stream to the new queue. u, i = priority.urgency, priority.incremental if ws.heads[u][i] == nil { ws.heads[u][i] = q q.next = q q.prev = q } else { // Queues are stored in a ring. // Insert the new stream before ws.head, putting it at the end of the list. q.prev = ws.heads[u][i].prev q.next = ws.heads[u][i] q.prev.next = q q.next.prev = q } // Update the metadata. ws.streams[streamID] = streamMetadata{ location: q, priority: priority, } } func (ws *priorityWriteSchedulerRFC9218) Push(wr FrameWriteRequest) { if wr.isControl() { ws.control.push(wr) return } q := ws.streams[wr.StreamID()].location if q == nil { // This is a closed stream. // wr should not be a HEADERS or DATA frame. // We push the request onto the control queue. if wr.DataSize() > 0 { panic("add DATA on non-open stream") } ws.control.push(wr) return } q.push(wr) } func (ws *priorityWriteSchedulerRFC9218) Pop() (FrameWriteRequest, bool) { // Control and RST_STREAM frames first. if !ws.control.empty() { return ws.control.shift(), true } // On the next Pop(), we want to prioritize incremental if we prioritized // non-incremental request of the same urgency this time. Vice-versa. // i.e. when there are incremental and non-incremental requests at the same // priority, we give 50% of our bandwidth to the incremental ones in // aggregate and 50% to the first non-incremental one (since // non-incremental streams do not use round-robin writes). ws.prioritizeIncremental = !ws.prioritizeIncremental // Always prioritize lowest u (i.e. highest urgency level). for u := range ws.heads { for i := range ws.heads[u] { // When we want to prioritize incremental, we try to pop i=true // first before i=false when u is the same. if ws.prioritizeIncremental { i = (i + 1) % 2 } q := ws.heads[u][i] if q == nil { continue } for { if wr, ok := q.consume(math.MaxInt32); ok { if i == 1 { // For incremental streams, we update head to q.next so // we can round-robin between multiple streams that can // immediately benefit from partial writes. ws.heads[u][i] = q.next } else { // For non-incremental streams, we try to finish one to // completion rather than doing round-robin. However, // we update head here so that if q.consume() is !ok // (e.g. the stream has no more frame to consume), head // is updated to the next q that has frames to consume // on future iterations. This way, we do not prioritize // writing to unavailable stream on next Pop() calls, // preventing head-of-line blocking. ws.heads[u][i] = q } return wr, true } q = q.next if q == ws.heads[u][i] { break } } } } return FrameWriteRequest{}, false } ================================================ FILE: vendor/golang.org/x/net/http2/writesched_random.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package http2 import "math" // NewRandomWriteScheduler constructs a WriteScheduler that ignores HTTP/2 // priorities. Control frames like SETTINGS and PING are written before DATA // frames, but if no control frames are queued and multiple streams have queued // HEADERS or DATA frames, Pop selects a ready stream arbitrarily. func NewRandomWriteScheduler() WriteScheduler { return &randomWriteScheduler{sq: make(map[uint32]*writeQueue)} } type randomWriteScheduler struct { // zero are frames not associated with a specific stream. zero writeQueue // sq contains the stream-specific queues, keyed by stream ID. // When a stream is idle, closed, or emptied, it's deleted // from the map. sq map[uint32]*writeQueue // pool of empty queues for reuse. queuePool writeQueuePool } func (ws *randomWriteScheduler) OpenStream(streamID uint32, options OpenStreamOptions) { // no-op: idle streams are not tracked } func (ws *randomWriteScheduler) CloseStream(streamID uint32) { q, ok := ws.sq[streamID] if !ok { return } delete(ws.sq, streamID) ws.queuePool.put(q) } func (ws *randomWriteScheduler) AdjustStream(streamID uint32, priority PriorityParam) { // no-op: priorities are ignored } func (ws *randomWriteScheduler) Push(wr FrameWriteRequest) { if wr.isControl() { ws.zero.push(wr) return } id := wr.StreamID() q, ok := ws.sq[id] if !ok { q = ws.queuePool.get() ws.sq[id] = q } q.push(wr) } func (ws *randomWriteScheduler) Pop() (FrameWriteRequest, bool) { // Control and RST_STREAM frames first. if !ws.zero.empty() { return ws.zero.shift(), true } // Iterate over all non-idle streams until finding one that can be consumed. for streamID, q := range ws.sq { if wr, ok := q.consume(math.MaxInt32); ok { if q.empty() { delete(ws.sq, streamID) ws.queuePool.put(q) } return wr, true } } return FrameWriteRequest{}, false } ================================================ FILE: vendor/golang.org/x/net/http2/writesched_roundrobin.go ================================================ // Copyright 2023 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package http2 import ( "fmt" "math" ) type roundRobinWriteScheduler struct { // control contains control frames (SETTINGS, PING, etc.). control writeQueue // streams maps stream ID to a queue. streams map[uint32]*writeQueue // stream queues are stored in a circular linked list. // head is the next stream to write, or nil if there are no streams open. head *writeQueue // pool of empty queues for reuse. queuePool writeQueuePool } // newRoundRobinWriteScheduler constructs a new write scheduler. // The round robin scheduler prioritizes control frames // like SETTINGS and PING over DATA frames. // When there are no control frames to send, it performs a round-robin // selection from the ready streams. func newRoundRobinWriteScheduler() WriteScheduler { ws := &roundRobinWriteScheduler{ streams: make(map[uint32]*writeQueue), } return ws } func (ws *roundRobinWriteScheduler) OpenStream(streamID uint32, options OpenStreamOptions) { if ws.streams[streamID] != nil { panic(fmt.Errorf("stream %d already opened", streamID)) } q := ws.queuePool.get() ws.streams[streamID] = q if ws.head == nil { ws.head = q q.next = q q.prev = q } else { // Queues are stored in a ring. // Insert the new stream before ws.head, putting it at the end of the list. q.prev = ws.head.prev q.next = ws.head q.prev.next = q q.next.prev = q } } func (ws *roundRobinWriteScheduler) CloseStream(streamID uint32) { q := ws.streams[streamID] if q == nil { return } if q.next == q { // This was the only open stream. ws.head = nil } else { q.prev.next = q.next q.next.prev = q.prev if ws.head == q { ws.head = q.next } } delete(ws.streams, streamID) ws.queuePool.put(q) } func (ws *roundRobinWriteScheduler) AdjustStream(streamID uint32, priority PriorityParam) {} func (ws *roundRobinWriteScheduler) Push(wr FrameWriteRequest) { if wr.isControl() { ws.control.push(wr) return } q := ws.streams[wr.StreamID()] if q == nil { // This is a closed stream. // wr should not be a HEADERS or DATA frame. // We push the request onto the control queue. if wr.DataSize() > 0 { panic("add DATA on non-open stream") } ws.control.push(wr) return } q.push(wr) } func (ws *roundRobinWriteScheduler) Pop() (FrameWriteRequest, bool) { // Control and RST_STREAM frames first. if !ws.control.empty() { return ws.control.shift(), true } if ws.head == nil { return FrameWriteRequest{}, false } q := ws.head for { if wr, ok := q.consume(math.MaxInt32); ok { ws.head = q.next return wr, true } q = q.next if q == ws.head { break } } return FrameWriteRequest{}, false } ================================================ FILE: vendor/golang.org/x/net/idna/go118.go ================================================ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. // Copyright 2021 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build go1.18 package idna // Transitional processing is disabled by default in Go 1.18. // https://golang.org/issue/47510 const transitionalLookup = false ================================================ FILE: vendor/golang.org/x/net/idna/idna10.0.0.go ================================================ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. // Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build go1.10 // Package idna implements IDNA2008 using the compatibility processing // defined by UTS (Unicode Technical Standard) #46, which defines a standard to // deal with the transition from IDNA2003. // // IDNA2008 (Internationalized Domain Names for Applications), is defined in RFC // 5890, RFC 5891, RFC 5892, RFC 5893 and RFC 5894. // UTS #46 is defined in https://www.unicode.org/reports/tr46. // See https://unicode.org/cldr/utility/idna.jsp for a visualization of the // differences between these two standards. package idna // import "golang.org/x/net/idna" import ( "fmt" "strings" "unicode/utf8" "golang.org/x/text/secure/bidirule" "golang.org/x/text/unicode/bidi" "golang.org/x/text/unicode/norm" ) // NOTE: Unlike common practice in Go APIs, the functions will return a // sanitized domain name in case of errors. Browsers sometimes use a partially // evaluated string as lookup. // TODO: the current error handling is, in my opinion, the least opinionated. // Other strategies are also viable, though: // Option 1) Return an empty string in case of error, but allow the user to // specify explicitly which errors to ignore. // Option 2) Return the partially evaluated string if it is itself a valid // string, otherwise return the empty string in case of error. // Option 3) Option 1 and 2. // Option 4) Always return an empty string for now and implement Option 1 as // needed, and document that the return string may not be empty in case of // error in the future. // I think Option 1 is best, but it is quite opinionated. // ToASCII is a wrapper for Punycode.ToASCII. func ToASCII(s string) (string, error) { return Punycode.process(s, true) } // ToUnicode is a wrapper for Punycode.ToUnicode. func ToUnicode(s string) (string, error) { return Punycode.process(s, false) } // An Option configures a Profile at creation time. type Option func(*options) // Transitional sets a Profile to use the Transitional mapping as defined in UTS // #46. This will cause, for example, "ß" to be mapped to "ss". Using the // transitional mapping provides a compromise between IDNA2003 and IDNA2008 // compatibility. It is used by some browsers when resolving domain names. This // option is only meaningful if combined with MapForLookup. func Transitional(transitional bool) Option { return func(o *options) { o.transitional = transitional } } // VerifyDNSLength sets whether a Profile should fail if any of the IDN parts // are longer than allowed by the RFC. // // This option corresponds to the VerifyDnsLength flag in UTS #46. func VerifyDNSLength(verify bool) Option { return func(o *options) { o.verifyDNSLength = verify } } // RemoveLeadingDots removes leading label separators. Leading runes that map to // dots, such as U+3002 IDEOGRAPHIC FULL STOP, are removed as well. func RemoveLeadingDots(remove bool) Option { return func(o *options) { o.removeLeadingDots = remove } } // ValidateLabels sets whether to check the mandatory label validation criteria // as defined in Section 5.4 of RFC 5891. This includes testing for correct use // of hyphens ('-'), normalization, validity of runes, and the context rules. // In particular, ValidateLabels also sets the CheckHyphens and CheckJoiners flags // in UTS #46. func ValidateLabels(enable bool) Option { return func(o *options) { // Don't override existing mappings, but set one that at least checks // normalization if it is not set. if o.mapping == nil && enable { o.mapping = normalize } o.trie = trie o.checkJoiners = enable o.checkHyphens = enable if enable { o.fromPuny = validateFromPunycode } else { o.fromPuny = nil } } } // CheckHyphens sets whether to check for correct use of hyphens ('-') in // labels. Most web browsers do not have this option set, since labels such as // "r3---sn-apo3qvuoxuxbt-j5pe" are in common use. // // This option corresponds to the CheckHyphens flag in UTS #46. func CheckHyphens(enable bool) Option { return func(o *options) { o.checkHyphens = enable } } // CheckJoiners sets whether to check the ContextJ rules as defined in Appendix // A of RFC 5892, concerning the use of joiner runes. // // This option corresponds to the CheckJoiners flag in UTS #46. func CheckJoiners(enable bool) Option { return func(o *options) { o.trie = trie o.checkJoiners = enable } } // StrictDomainName limits the set of permissible ASCII characters to those // allowed in domain names as defined in RFC 1034 (A-Z, a-z, 0-9 and the // hyphen). This is set by default for MapForLookup and ValidateForRegistration, // but is only useful if ValidateLabels is set. // // This option is useful, for instance, for browsers that allow characters // outside this range, for example a '_' (U+005F LOW LINE). See // http://www.rfc-editor.org/std/std3.txt for more details. // // This option corresponds to the UseSTD3ASCIIRules flag in UTS #46. func StrictDomainName(use bool) Option { return func(o *options) { o.useSTD3Rules = use } } // NOTE: the following options pull in tables. The tables should not be linked // in as long as the options are not used. // BidiRule enables the Bidi rule as defined in RFC 5893. Any application // that relies on proper validation of labels should include this rule. // // This option corresponds to the CheckBidi flag in UTS #46. func BidiRule() Option { return func(o *options) { o.bidirule = bidirule.ValidString } } // ValidateForRegistration sets validation options to verify that a given IDN is // properly formatted for registration as defined by Section 4 of RFC 5891. func ValidateForRegistration() Option { return func(o *options) { o.mapping = validateRegistration StrictDomainName(true)(o) ValidateLabels(true)(o) VerifyDNSLength(true)(o) BidiRule()(o) } } // MapForLookup sets validation and mapping options such that a given IDN is // transformed for domain name lookup according to the requirements set out in // Section 5 of RFC 5891. The mappings follow the recommendations of RFC 5894, // RFC 5895 and UTS 46. It does not add the Bidi Rule. Use the BidiRule option // to add this check. // // The mappings include normalization and mapping case, width and other // compatibility mappings. func MapForLookup() Option { return func(o *options) { o.mapping = validateAndMap StrictDomainName(true)(o) ValidateLabels(true)(o) } } type options struct { transitional bool useSTD3Rules bool checkHyphens bool checkJoiners bool verifyDNSLength bool removeLeadingDots bool trie *idnaTrie // fromPuny calls validation rules when converting A-labels to U-labels. fromPuny func(p *Profile, s string) error // mapping implements a validation and mapping step as defined in RFC 5895 // or UTS 46, tailored to, for example, domain registration or lookup. mapping func(p *Profile, s string) (mapped string, isBidi bool, err error) // bidirule, if specified, checks whether s conforms to the Bidi Rule // defined in RFC 5893. bidirule func(s string) bool } // A Profile defines the configuration of an IDNA mapper. type Profile struct { options } func apply(o *options, opts []Option) { for _, f := range opts { f(o) } } // New creates a new Profile. // // With no options, the returned Profile is the most permissive and equals the // Punycode Profile. Options can be passed to further restrict the Profile. The // MapForLookup and ValidateForRegistration options set a collection of options, // for lookup and registration purposes respectively, which can be tailored by // adding more fine-grained options, where later options override earlier // options. func New(o ...Option) *Profile { p := &Profile{} apply(&p.options, o) return p } // ToASCII converts a domain or domain label to its ASCII form. For example, // ToASCII("bücher.example.com") is "xn--bcher-kva.example.com", and // ToASCII("golang") is "golang". If an error is encountered it will return // an error and a (partially) processed result. func (p *Profile) ToASCII(s string) (string, error) { return p.process(s, true) } // ToUnicode converts a domain or domain label to its Unicode form. For example, // ToUnicode("xn--bcher-kva.example.com") is "bücher.example.com", and // ToUnicode("golang") is "golang". If an error is encountered it will return // an error and a (partially) processed result. func (p *Profile) ToUnicode(s string) (string, error) { pp := *p pp.transitional = false return pp.process(s, false) } // String reports a string with a description of the profile for debugging // purposes. The string format may change with different versions. func (p *Profile) String() string { s := "" if p.transitional { s = "Transitional" } else { s = "NonTransitional" } if p.useSTD3Rules { s += ":UseSTD3Rules" } if p.checkHyphens { s += ":CheckHyphens" } if p.checkJoiners { s += ":CheckJoiners" } if p.verifyDNSLength { s += ":VerifyDNSLength" } return s } var ( // Punycode is a Profile that does raw punycode processing with a minimum // of validation. Punycode *Profile = punycode // Lookup is the recommended profile for looking up domain names, according // to Section 5 of RFC 5891. The exact configuration of this profile may // change over time. Lookup *Profile = lookup // Display is the recommended profile for displaying domain names. // The configuration of this profile may change over time. Display *Profile = display // Registration is the recommended profile for checking whether a given // IDN is valid for registration, according to Section 4 of RFC 5891. Registration *Profile = registration punycode = &Profile{} lookup = &Profile{options{ transitional: transitionalLookup, useSTD3Rules: true, checkHyphens: true, checkJoiners: true, trie: trie, fromPuny: validateFromPunycode, mapping: validateAndMap, bidirule: bidirule.ValidString, }} display = &Profile{options{ useSTD3Rules: true, checkHyphens: true, checkJoiners: true, trie: trie, fromPuny: validateFromPunycode, mapping: validateAndMap, bidirule: bidirule.ValidString, }} registration = &Profile{options{ useSTD3Rules: true, verifyDNSLength: true, checkHyphens: true, checkJoiners: true, trie: trie, fromPuny: validateFromPunycode, mapping: validateRegistration, bidirule: bidirule.ValidString, }} // TODO: profiles // Register: recommended for approving domain names: don't do any mappings // but rather reject on invalid input. Bundle or block deviation characters. ) type labelError struct{ label, code_ string } func (e labelError) code() string { return e.code_ } func (e labelError) Error() string { return fmt.Sprintf("idna: invalid label %q", e.label) } type runeError rune func (e runeError) code() string { return "P1" } func (e runeError) Error() string { return fmt.Sprintf("idna: disallowed rune %U", e) } // process implements the algorithm described in section 4 of UTS #46, // see https://www.unicode.org/reports/tr46. func (p *Profile) process(s string, toASCII bool) (string, error) { var err error var isBidi bool if p.mapping != nil { s, isBidi, err = p.mapping(p, s) } // Remove leading empty labels. if p.removeLeadingDots { for ; len(s) > 0 && s[0] == '.'; s = s[1:] { } } // TODO: allow for a quick check of the tables data. // It seems like we should only create this error on ToASCII, but the // UTS 46 conformance tests suggests we should always check this. if err == nil && p.verifyDNSLength && s == "" { err = &labelError{s, "A4"} } labels := labelIter{orig: s} for ; !labels.done(); labels.next() { label := labels.label() if label == "" { // Empty labels are not okay. The label iterator skips the last // label if it is empty. if err == nil && p.verifyDNSLength { err = &labelError{s, "A4"} } continue } if strings.HasPrefix(label, acePrefix) { u, err2 := decode(label[len(acePrefix):]) if err2 != nil { if err == nil { err = err2 } // Spec says keep the old label. continue } isBidi = isBidi || bidirule.DirectionString(u) != bidi.LeftToRight labels.set(u) if err == nil && p.fromPuny != nil { err = p.fromPuny(p, u) } if err == nil { // This should be called on NonTransitional, according to the // spec, but that currently does not have any effect. Use the // original profile to preserve options. err = p.validateLabel(u) } } else if err == nil { err = p.validateLabel(label) } } if isBidi && p.bidirule != nil && err == nil { for labels.reset(); !labels.done(); labels.next() { if !p.bidirule(labels.label()) { err = &labelError{s, "B"} break } } } if toASCII { for labels.reset(); !labels.done(); labels.next() { label := labels.label() if !ascii(label) { a, err2 := encode(acePrefix, label) if err == nil { err = err2 } label = a labels.set(a) } n := len(label) if p.verifyDNSLength && err == nil && (n == 0 || n > 63) { err = &labelError{label, "A4"} } } } s = labels.result() if toASCII && p.verifyDNSLength && err == nil { // Compute the length of the domain name minus the root label and its dot. n := len(s) if n > 0 && s[n-1] == '.' { n-- } if len(s) < 1 || n > 253 { err = &labelError{s, "A4"} } } return s, err } func normalize(p *Profile, s string) (mapped string, isBidi bool, err error) { // TODO: consider first doing a quick check to see if any of these checks // need to be done. This will make it slower in the general case, but // faster in the common case. mapped = norm.NFC.String(s) isBidi = bidirule.DirectionString(mapped) == bidi.RightToLeft return mapped, isBidi, nil } func validateRegistration(p *Profile, s string) (idem string, bidi bool, err error) { // TODO: filter need for normalization in loop below. if !norm.NFC.IsNormalString(s) { return s, false, &labelError{s, "V1"} } for i := 0; i < len(s); { v, sz := trie.lookupString(s[i:]) if sz == 0 { return s, bidi, runeError(utf8.RuneError) } bidi = bidi || info(v).isBidi(s[i:]) // Copy bytes not copied so far. switch p.simplify(info(v).category()) { // TODO: handle the NV8 defined in the Unicode idna data set to allow // for strict conformance to IDNA2008. case valid, deviation: case disallowed, mapped, unknown, ignored: r, _ := utf8.DecodeRuneInString(s[i:]) return s, bidi, runeError(r) } i += sz } return s, bidi, nil } func (c info) isBidi(s string) bool { if !c.isMapped() { return c&attributesMask == rtl } // TODO: also store bidi info for mapped data. This is possible, but a bit // cumbersome and not for the common case. p, _ := bidi.LookupString(s) switch p.Class() { case bidi.R, bidi.AL, bidi.AN: return true } return false } func validateAndMap(p *Profile, s string) (vm string, bidi bool, err error) { var ( b []byte k int ) // combinedInfoBits contains the or-ed bits of all runes. We use this // to derive the mayNeedNorm bit later. This may trigger normalization // overeagerly, but it will not do so in the common case. The end result // is another 10% saving on BenchmarkProfile for the common case. var combinedInfoBits info for i := 0; i < len(s); { v, sz := trie.lookupString(s[i:]) if sz == 0 { b = append(b, s[k:i]...) b = append(b, "\ufffd"...) k = len(s) if err == nil { err = runeError(utf8.RuneError) } break } combinedInfoBits |= info(v) bidi = bidi || info(v).isBidi(s[i:]) start := i i += sz // Copy bytes not copied so far. switch p.simplify(info(v).category()) { case valid: continue case disallowed: if err == nil { r, _ := utf8.DecodeRuneInString(s[start:]) err = runeError(r) } continue case mapped, deviation: b = append(b, s[k:start]...) b = info(v).appendMapping(b, s[start:i]) case ignored: b = append(b, s[k:start]...) // drop the rune case unknown: b = append(b, s[k:start]...) b = append(b, "\ufffd"...) } k = i } if k == 0 { // No changes so far. if combinedInfoBits&mayNeedNorm != 0 { s = norm.NFC.String(s) } } else { b = append(b, s[k:]...) if norm.NFC.QuickSpan(b) != len(b) { b = norm.NFC.Bytes(b) } // TODO: the punycode converters require strings as input. s = string(b) } return s, bidi, err } // A labelIter allows iterating over domain name labels. type labelIter struct { orig string slice []string curStart int curEnd int i int } func (l *labelIter) reset() { l.curStart = 0 l.curEnd = 0 l.i = 0 } func (l *labelIter) done() bool { return l.curStart >= len(l.orig) } func (l *labelIter) result() string { if l.slice != nil { return strings.Join(l.slice, ".") } return l.orig } func (l *labelIter) label() string { if l.slice != nil { return l.slice[l.i] } p := strings.IndexByte(l.orig[l.curStart:], '.') l.curEnd = l.curStart + p if p == -1 { l.curEnd = len(l.orig) } return l.orig[l.curStart:l.curEnd] } // next sets the value to the next label. It skips the last label if it is empty. func (l *labelIter) next() { l.i++ if l.slice != nil { if l.i >= len(l.slice) || l.i == len(l.slice)-1 && l.slice[l.i] == "" { l.curStart = len(l.orig) } } else { l.curStart = l.curEnd + 1 if l.curStart == len(l.orig)-1 && l.orig[l.curStart] == '.' { l.curStart = len(l.orig) } } } func (l *labelIter) set(s string) { if l.slice == nil { l.slice = strings.Split(l.orig, ".") } l.slice[l.i] = s } // acePrefix is the ASCII Compatible Encoding prefix. const acePrefix = "xn--" func (p *Profile) simplify(cat category) category { switch cat { case disallowedSTD3Mapped: if p.useSTD3Rules { cat = disallowed } else { cat = mapped } case disallowedSTD3Valid: if p.useSTD3Rules { cat = disallowed } else { cat = valid } case deviation: if !p.transitional { cat = valid } case validNV8, validXV8: // TODO: handle V2008 cat = valid } return cat } func validateFromPunycode(p *Profile, s string) error { if !norm.NFC.IsNormalString(s) { return &labelError{s, "V1"} } // TODO: detect whether string may have to be normalized in the following // loop. for i := 0; i < len(s); { v, sz := trie.lookupString(s[i:]) if sz == 0 { return runeError(utf8.RuneError) } if c := p.simplify(info(v).category()); c != valid && c != deviation { return &labelError{s, "V6"} } i += sz } return nil } const ( zwnj = "\u200c" zwj = "\u200d" ) type joinState int8 const ( stateStart joinState = iota stateVirama stateBefore stateBeforeVirama stateAfter stateFAIL ) var joinStates = [][numJoinTypes]joinState{ stateStart: { joiningL: stateBefore, joiningD: stateBefore, joinZWNJ: stateFAIL, joinZWJ: stateFAIL, joinVirama: stateVirama, }, stateVirama: { joiningL: stateBefore, joiningD: stateBefore, }, stateBefore: { joiningL: stateBefore, joiningD: stateBefore, joiningT: stateBefore, joinZWNJ: stateAfter, joinZWJ: stateFAIL, joinVirama: stateBeforeVirama, }, stateBeforeVirama: { joiningL: stateBefore, joiningD: stateBefore, joiningT: stateBefore, }, stateAfter: { joiningL: stateFAIL, joiningD: stateBefore, joiningT: stateAfter, joiningR: stateStart, joinZWNJ: stateFAIL, joinZWJ: stateFAIL, joinVirama: stateAfter, // no-op as we can't accept joiners here }, stateFAIL: { 0: stateFAIL, joiningL: stateFAIL, joiningD: stateFAIL, joiningT: stateFAIL, joiningR: stateFAIL, joinZWNJ: stateFAIL, joinZWJ: stateFAIL, joinVirama: stateFAIL, }, } // validateLabel validates the criteria from Section 4.1. Item 1, 4, and 6 are // already implicitly satisfied by the overall implementation. func (p *Profile) validateLabel(s string) (err error) { if s == "" { if p.verifyDNSLength { return &labelError{s, "A4"} } return nil } if p.checkHyphens { if len(s) > 4 && s[2] == '-' && s[3] == '-' { return &labelError{s, "V2"} } if s[0] == '-' || s[len(s)-1] == '-' { return &labelError{s, "V3"} } } if !p.checkJoiners { return nil } trie := p.trie // p.checkJoiners is only set if trie is set. // TODO: merge the use of this in the trie. v, sz := trie.lookupString(s) x := info(v) if x.isModifier() { return &labelError{s, "V5"} } // Quickly return in the absence of zero-width (non) joiners. if strings.Index(s, zwj) == -1 && strings.Index(s, zwnj) == -1 { return nil } st := stateStart for i := 0; ; { jt := x.joinType() if s[i:i+sz] == zwj { jt = joinZWJ } else if s[i:i+sz] == zwnj { jt = joinZWNJ } st = joinStates[st][jt] if x.isViramaModifier() { st = joinStates[st][joinVirama] } if i += sz; i == len(s) { break } v, sz = trie.lookupString(s[i:]) x = info(v) } if st == stateFAIL || st == stateAfter { return &labelError{s, "C"} } return nil } func ascii(s string) bool { for i := 0; i < len(s); i++ { if s[i] >= utf8.RuneSelf { return false } } return true } ================================================ FILE: vendor/golang.org/x/net/idna/idna9.0.0.go ================================================ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. // Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build !go1.10 // Package idna implements IDNA2008 using the compatibility processing // defined by UTS (Unicode Technical Standard) #46, which defines a standard to // deal with the transition from IDNA2003. // // IDNA2008 (Internationalized Domain Names for Applications), is defined in RFC // 5890, RFC 5891, RFC 5892, RFC 5893 and RFC 5894. // UTS #46 is defined in https://www.unicode.org/reports/tr46. // See https://unicode.org/cldr/utility/idna.jsp for a visualization of the // differences between these two standards. package idna // import "golang.org/x/net/idna" import ( "fmt" "strings" "unicode/utf8" "golang.org/x/text/secure/bidirule" "golang.org/x/text/unicode/norm" ) // NOTE: Unlike common practice in Go APIs, the functions will return a // sanitized domain name in case of errors. Browsers sometimes use a partially // evaluated string as lookup. // TODO: the current error handling is, in my opinion, the least opinionated. // Other strategies are also viable, though: // Option 1) Return an empty string in case of error, but allow the user to // specify explicitly which errors to ignore. // Option 2) Return the partially evaluated string if it is itself a valid // string, otherwise return the empty string in case of error. // Option 3) Option 1 and 2. // Option 4) Always return an empty string for now and implement Option 1 as // needed, and document that the return string may not be empty in case of // error in the future. // I think Option 1 is best, but it is quite opinionated. // ToASCII is a wrapper for Punycode.ToASCII. func ToASCII(s string) (string, error) { return Punycode.process(s, true) } // ToUnicode is a wrapper for Punycode.ToUnicode. func ToUnicode(s string) (string, error) { return Punycode.process(s, false) } // An Option configures a Profile at creation time. type Option func(*options) // Transitional sets a Profile to use the Transitional mapping as defined in UTS // #46. This will cause, for example, "ß" to be mapped to "ss". Using the // transitional mapping provides a compromise between IDNA2003 and IDNA2008 // compatibility. It is used by some browsers when resolving domain names. This // option is only meaningful if combined with MapForLookup. func Transitional(transitional bool) Option { return func(o *options) { o.transitional = transitional } } // VerifyDNSLength sets whether a Profile should fail if any of the IDN parts // are longer than allowed by the RFC. // // This option corresponds to the VerifyDnsLength flag in UTS #46. func VerifyDNSLength(verify bool) Option { return func(o *options) { o.verifyDNSLength = verify } } // RemoveLeadingDots removes leading label separators. Leading runes that map to // dots, such as U+3002 IDEOGRAPHIC FULL STOP, are removed as well. func RemoveLeadingDots(remove bool) Option { return func(o *options) { o.removeLeadingDots = remove } } // ValidateLabels sets whether to check the mandatory label validation criteria // as defined in Section 5.4 of RFC 5891. This includes testing for correct use // of hyphens ('-'), normalization, validity of runes, and the context rules. // In particular, ValidateLabels also sets the CheckHyphens and CheckJoiners flags // in UTS #46. func ValidateLabels(enable bool) Option { return func(o *options) { // Don't override existing mappings, but set one that at least checks // normalization if it is not set. if o.mapping == nil && enable { o.mapping = normalize } o.trie = trie o.checkJoiners = enable o.checkHyphens = enable if enable { o.fromPuny = validateFromPunycode } else { o.fromPuny = nil } } } // CheckHyphens sets whether to check for correct use of hyphens ('-') in // labels. Most web browsers do not have this option set, since labels such as // "r3---sn-apo3qvuoxuxbt-j5pe" are in common use. // // This option corresponds to the CheckHyphens flag in UTS #46. func CheckHyphens(enable bool) Option { return func(o *options) { o.checkHyphens = enable } } // CheckJoiners sets whether to check the ContextJ rules as defined in Appendix // A of RFC 5892, concerning the use of joiner runes. // // This option corresponds to the CheckJoiners flag in UTS #46. func CheckJoiners(enable bool) Option { return func(o *options) { o.trie = trie o.checkJoiners = enable } } // StrictDomainName limits the set of permissible ASCII characters to those // allowed in domain names as defined in RFC 1034 (A-Z, a-z, 0-9 and the // hyphen). This is set by default for MapForLookup and ValidateForRegistration, // but is only useful if ValidateLabels is set. // // This option is useful, for instance, for browsers that allow characters // outside this range, for example a '_' (U+005F LOW LINE). See // http://www.rfc-editor.org/std/std3.txt for more details. // // This option corresponds to the UseSTD3ASCIIRules flag in UTS #46. func StrictDomainName(use bool) Option { return func(o *options) { o.useSTD3Rules = use } } // NOTE: the following options pull in tables. The tables should not be linked // in as long as the options are not used. // BidiRule enables the Bidi rule as defined in RFC 5893. Any application // that relies on proper validation of labels should include this rule. // // This option corresponds to the CheckBidi flag in UTS #46. func BidiRule() Option { return func(o *options) { o.bidirule = bidirule.ValidString } } // ValidateForRegistration sets validation options to verify that a given IDN is // properly formatted for registration as defined by Section 4 of RFC 5891. func ValidateForRegistration() Option { return func(o *options) { o.mapping = validateRegistration StrictDomainName(true)(o) ValidateLabels(true)(o) VerifyDNSLength(true)(o) BidiRule()(o) } } // MapForLookup sets validation and mapping options such that a given IDN is // transformed for domain name lookup according to the requirements set out in // Section 5 of RFC 5891. The mappings follow the recommendations of RFC 5894, // RFC 5895 and UTS 46. It does not add the Bidi Rule. Use the BidiRule option // to add this check. // // The mappings include normalization and mapping case, width and other // compatibility mappings. func MapForLookup() Option { return func(o *options) { o.mapping = validateAndMap StrictDomainName(true)(o) ValidateLabels(true)(o) RemoveLeadingDots(true)(o) } } type options struct { transitional bool useSTD3Rules bool checkHyphens bool checkJoiners bool verifyDNSLength bool removeLeadingDots bool trie *idnaTrie // fromPuny calls validation rules when converting A-labels to U-labels. fromPuny func(p *Profile, s string) error // mapping implements a validation and mapping step as defined in RFC 5895 // or UTS 46, tailored to, for example, domain registration or lookup. mapping func(p *Profile, s string) (string, error) // bidirule, if specified, checks whether s conforms to the Bidi Rule // defined in RFC 5893. bidirule func(s string) bool } // A Profile defines the configuration of a IDNA mapper. type Profile struct { options } func apply(o *options, opts []Option) { for _, f := range opts { f(o) } } // New creates a new Profile. // // With no options, the returned Profile is the most permissive and equals the // Punycode Profile. Options can be passed to further restrict the Profile. The // MapForLookup and ValidateForRegistration options set a collection of options, // for lookup and registration purposes respectively, which can be tailored by // adding more fine-grained options, where later options override earlier // options. func New(o ...Option) *Profile { p := &Profile{} apply(&p.options, o) return p } // ToASCII converts a domain or domain label to its ASCII form. For example, // ToASCII("bücher.example.com") is "xn--bcher-kva.example.com", and // ToASCII("golang") is "golang". If an error is encountered it will return // an error and a (partially) processed result. func (p *Profile) ToASCII(s string) (string, error) { return p.process(s, true) } // ToUnicode converts a domain or domain label to its Unicode form. For example, // ToUnicode("xn--bcher-kva.example.com") is "bücher.example.com", and // ToUnicode("golang") is "golang". If an error is encountered it will return // an error and a (partially) processed result. func (p *Profile) ToUnicode(s string) (string, error) { pp := *p pp.transitional = false return pp.process(s, false) } // String reports a string with a description of the profile for debugging // purposes. The string format may change with different versions. func (p *Profile) String() string { s := "" if p.transitional { s = "Transitional" } else { s = "NonTransitional" } if p.useSTD3Rules { s += ":UseSTD3Rules" } if p.checkHyphens { s += ":CheckHyphens" } if p.checkJoiners { s += ":CheckJoiners" } if p.verifyDNSLength { s += ":VerifyDNSLength" } return s } var ( // Punycode is a Profile that does raw punycode processing with a minimum // of validation. Punycode *Profile = punycode // Lookup is the recommended profile for looking up domain names, according // to Section 5 of RFC 5891. The exact configuration of this profile may // change over time. Lookup *Profile = lookup // Display is the recommended profile for displaying domain names. // The configuration of this profile may change over time. Display *Profile = display // Registration is the recommended profile for checking whether a given // IDN is valid for registration, according to Section 4 of RFC 5891. Registration *Profile = registration punycode = &Profile{} lookup = &Profile{options{ transitional: true, removeLeadingDots: true, useSTD3Rules: true, checkHyphens: true, checkJoiners: true, trie: trie, fromPuny: validateFromPunycode, mapping: validateAndMap, bidirule: bidirule.ValidString, }} display = &Profile{options{ useSTD3Rules: true, removeLeadingDots: true, checkHyphens: true, checkJoiners: true, trie: trie, fromPuny: validateFromPunycode, mapping: validateAndMap, bidirule: bidirule.ValidString, }} registration = &Profile{options{ useSTD3Rules: true, verifyDNSLength: true, checkHyphens: true, checkJoiners: true, trie: trie, fromPuny: validateFromPunycode, mapping: validateRegistration, bidirule: bidirule.ValidString, }} // TODO: profiles // Register: recommended for approving domain names: don't do any mappings // but rather reject on invalid input. Bundle or block deviation characters. ) type labelError struct{ label, code_ string } func (e labelError) code() string { return e.code_ } func (e labelError) Error() string { return fmt.Sprintf("idna: invalid label %q", e.label) } type runeError rune func (e runeError) code() string { return "P1" } func (e runeError) Error() string { return fmt.Sprintf("idna: disallowed rune %U", e) } // process implements the algorithm described in section 4 of UTS #46, // see https://www.unicode.org/reports/tr46. func (p *Profile) process(s string, toASCII bool) (string, error) { var err error if p.mapping != nil { s, err = p.mapping(p, s) } // Remove leading empty labels. if p.removeLeadingDots { for ; len(s) > 0 && s[0] == '.'; s = s[1:] { } } // It seems like we should only create this error on ToASCII, but the // UTS 46 conformance tests suggests we should always check this. if err == nil && p.verifyDNSLength && s == "" { err = &labelError{s, "A4"} } labels := labelIter{orig: s} for ; !labels.done(); labels.next() { label := labels.label() if label == "" { // Empty labels are not okay. The label iterator skips the last // label if it is empty. if err == nil && p.verifyDNSLength { err = &labelError{s, "A4"} } continue } if strings.HasPrefix(label, acePrefix) { u, err2 := decode(label[len(acePrefix):]) if err2 != nil { if err == nil { err = err2 } // Spec says keep the old label. continue } labels.set(u) if err == nil && p.fromPuny != nil { err = p.fromPuny(p, u) } if err == nil { // This should be called on NonTransitional, according to the // spec, but that currently does not have any effect. Use the // original profile to preserve options. err = p.validateLabel(u) } } else if err == nil { err = p.validateLabel(label) } } if toASCII { for labels.reset(); !labels.done(); labels.next() { label := labels.label() if !ascii(label) { a, err2 := encode(acePrefix, label) if err == nil { err = err2 } label = a labels.set(a) } n := len(label) if p.verifyDNSLength && err == nil && (n == 0 || n > 63) { err = &labelError{label, "A4"} } } } s = labels.result() if toASCII && p.verifyDNSLength && err == nil { // Compute the length of the domain name minus the root label and its dot. n := len(s) if n > 0 && s[n-1] == '.' { n-- } if len(s) < 1 || n > 253 { err = &labelError{s, "A4"} } } return s, err } func normalize(p *Profile, s string) (string, error) { return norm.NFC.String(s), nil } func validateRegistration(p *Profile, s string) (string, error) { if !norm.NFC.IsNormalString(s) { return s, &labelError{s, "V1"} } for i := 0; i < len(s); { v, sz := trie.lookupString(s[i:]) // Copy bytes not copied so far. switch p.simplify(info(v).category()) { // TODO: handle the NV8 defined in the Unicode idna data set to allow // for strict conformance to IDNA2008. case valid, deviation: case disallowed, mapped, unknown, ignored: r, _ := utf8.DecodeRuneInString(s[i:]) return s, runeError(r) } i += sz } return s, nil } func validateAndMap(p *Profile, s string) (string, error) { var ( err error b []byte k int ) for i := 0; i < len(s); { v, sz := trie.lookupString(s[i:]) start := i i += sz // Copy bytes not copied so far. switch p.simplify(info(v).category()) { case valid: continue case disallowed: if err == nil { r, _ := utf8.DecodeRuneInString(s[start:]) err = runeError(r) } continue case mapped, deviation: b = append(b, s[k:start]...) b = info(v).appendMapping(b, s[start:i]) case ignored: b = append(b, s[k:start]...) // drop the rune case unknown: b = append(b, s[k:start]...) b = append(b, "\ufffd"...) } k = i } if k == 0 { // No changes so far. s = norm.NFC.String(s) } else { b = append(b, s[k:]...) if norm.NFC.QuickSpan(b) != len(b) { b = norm.NFC.Bytes(b) } // TODO: the punycode converters require strings as input. s = string(b) } return s, err } // A labelIter allows iterating over domain name labels. type labelIter struct { orig string slice []string curStart int curEnd int i int } func (l *labelIter) reset() { l.curStart = 0 l.curEnd = 0 l.i = 0 } func (l *labelIter) done() bool { return l.curStart >= len(l.orig) } func (l *labelIter) result() string { if l.slice != nil { return strings.Join(l.slice, ".") } return l.orig } func (l *labelIter) label() string { if l.slice != nil { return l.slice[l.i] } p := strings.IndexByte(l.orig[l.curStart:], '.') l.curEnd = l.curStart + p if p == -1 { l.curEnd = len(l.orig) } return l.orig[l.curStart:l.curEnd] } // next sets the value to the next label. It skips the last label if it is empty. func (l *labelIter) next() { l.i++ if l.slice != nil { if l.i >= len(l.slice) || l.i == len(l.slice)-1 && l.slice[l.i] == "" { l.curStart = len(l.orig) } } else { l.curStart = l.curEnd + 1 if l.curStart == len(l.orig)-1 && l.orig[l.curStart] == '.' { l.curStart = len(l.orig) } } } func (l *labelIter) set(s string) { if l.slice == nil { l.slice = strings.Split(l.orig, ".") } l.slice[l.i] = s } // acePrefix is the ASCII Compatible Encoding prefix. const acePrefix = "xn--" func (p *Profile) simplify(cat category) category { switch cat { case disallowedSTD3Mapped: if p.useSTD3Rules { cat = disallowed } else { cat = mapped } case disallowedSTD3Valid: if p.useSTD3Rules { cat = disallowed } else { cat = valid } case deviation: if !p.transitional { cat = valid } case validNV8, validXV8: // TODO: handle V2008 cat = valid } return cat } func validateFromPunycode(p *Profile, s string) error { if !norm.NFC.IsNormalString(s) { return &labelError{s, "V1"} } for i := 0; i < len(s); { v, sz := trie.lookupString(s[i:]) if c := p.simplify(info(v).category()); c != valid && c != deviation { return &labelError{s, "V6"} } i += sz } return nil } const ( zwnj = "\u200c" zwj = "\u200d" ) type joinState int8 const ( stateStart joinState = iota stateVirama stateBefore stateBeforeVirama stateAfter stateFAIL ) var joinStates = [][numJoinTypes]joinState{ stateStart: { joiningL: stateBefore, joiningD: stateBefore, joinZWNJ: stateFAIL, joinZWJ: stateFAIL, joinVirama: stateVirama, }, stateVirama: { joiningL: stateBefore, joiningD: stateBefore, }, stateBefore: { joiningL: stateBefore, joiningD: stateBefore, joiningT: stateBefore, joinZWNJ: stateAfter, joinZWJ: stateFAIL, joinVirama: stateBeforeVirama, }, stateBeforeVirama: { joiningL: stateBefore, joiningD: stateBefore, joiningT: stateBefore, }, stateAfter: { joiningL: stateFAIL, joiningD: stateBefore, joiningT: stateAfter, joiningR: stateStart, joinZWNJ: stateFAIL, joinZWJ: stateFAIL, joinVirama: stateAfter, // no-op as we can't accept joiners here }, stateFAIL: { 0: stateFAIL, joiningL: stateFAIL, joiningD: stateFAIL, joiningT: stateFAIL, joiningR: stateFAIL, joinZWNJ: stateFAIL, joinZWJ: stateFAIL, joinVirama: stateFAIL, }, } // validateLabel validates the criteria from Section 4.1. Item 1, 4, and 6 are // already implicitly satisfied by the overall implementation. func (p *Profile) validateLabel(s string) error { if s == "" { if p.verifyDNSLength { return &labelError{s, "A4"} } return nil } if p.bidirule != nil && !p.bidirule(s) { return &labelError{s, "B"} } if p.checkHyphens { if len(s) > 4 && s[2] == '-' && s[3] == '-' { return &labelError{s, "V2"} } if s[0] == '-' || s[len(s)-1] == '-' { return &labelError{s, "V3"} } } if !p.checkJoiners { return nil } trie := p.trie // p.checkJoiners is only set if trie is set. // TODO: merge the use of this in the trie. v, sz := trie.lookupString(s) x := info(v) if x.isModifier() { return &labelError{s, "V5"} } // Quickly return in the absence of zero-width (non) joiners. if strings.Index(s, zwj) == -1 && strings.Index(s, zwnj) == -1 { return nil } st := stateStart for i := 0; ; { jt := x.joinType() if s[i:i+sz] == zwj { jt = joinZWJ } else if s[i:i+sz] == zwnj { jt = joinZWNJ } st = joinStates[st][jt] if x.isViramaModifier() { st = joinStates[st][joinVirama] } if i += sz; i == len(s) { break } v, sz = trie.lookupString(s[i:]) x = info(v) } if st == stateFAIL || st == stateAfter { return &labelError{s, "C"} } return nil } func ascii(s string) bool { for i := 0; i < len(s); i++ { if s[i] >= utf8.RuneSelf { return false } } return true } ================================================ FILE: vendor/golang.org/x/net/idna/pre_go118.go ================================================ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. // Copyright 2021 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build !go1.18 package idna const transitionalLookup = true ================================================ FILE: vendor/golang.org/x/net/idna/punycode.go ================================================ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. // Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package idna // This file implements the Punycode algorithm from RFC 3492. import ( "math" "strings" "unicode/utf8" ) // These parameter values are specified in section 5. // // All computation is done with int32s, so that overflow behavior is identical // regardless of whether int is 32-bit or 64-bit. const ( base int32 = 36 damp int32 = 700 initialBias int32 = 72 initialN int32 = 128 skew int32 = 38 tmax int32 = 26 tmin int32 = 1 ) func punyError(s string) error { return &labelError{s, "A3"} } // decode decodes a string as specified in section 6.2. func decode(encoded string) (string, error) { if encoded == "" { return "", nil } pos := 1 + strings.LastIndex(encoded, "-") if pos == 1 { return "", punyError(encoded) } if pos == len(encoded) { return encoded[:len(encoded)-1], nil } output := make([]rune, 0, len(encoded)) if pos != 0 { for _, r := range encoded[:pos-1] { output = append(output, r) } } i, n, bias := int32(0), initialN, initialBias overflow := false for pos < len(encoded) { oldI, w := i, int32(1) for k := base; ; k += base { if pos == len(encoded) { return "", punyError(encoded) } digit, ok := decodeDigit(encoded[pos]) if !ok { return "", punyError(encoded) } pos++ i, overflow = madd(i, digit, w) if overflow { return "", punyError(encoded) } t := k - bias if k <= bias { t = tmin } else if k >= bias+tmax { t = tmax } if digit < t { break } w, overflow = madd(0, w, base-t) if overflow { return "", punyError(encoded) } } if len(output) >= 1024 { return "", punyError(encoded) } x := int32(len(output) + 1) bias = adapt(i-oldI, x, oldI == 0) n += i / x i %= x if n < 0 || n > utf8.MaxRune { return "", punyError(encoded) } output = append(output, 0) copy(output[i+1:], output[i:]) output[i] = n i++ } return string(output), nil } // encode encodes a string as specified in section 6.3 and prepends prefix to // the result. // // The "while h < length(input)" line in the specification becomes "for // remaining != 0" in the Go code, because len(s) in Go is in bytes, not runes. func encode(prefix, s string) (string, error) { output := make([]byte, len(prefix), len(prefix)+1+2*len(s)) copy(output, prefix) delta, n, bias := int32(0), initialN, initialBias b, remaining := int32(0), int32(0) for _, r := range s { if r < 0x80 { b++ output = append(output, byte(r)) } else { remaining++ } } h := b if b > 0 { output = append(output, '-') } overflow := false for remaining != 0 { m := int32(0x7fffffff) for _, r := range s { if m > r && r >= n { m = r } } delta, overflow = madd(delta, m-n, h+1) if overflow { return "", punyError(s) } n = m for _, r := range s { if r < n { delta++ if delta < 0 { return "", punyError(s) } continue } if r > n { continue } q := delta for k := base; ; k += base { t := k - bias if k <= bias { t = tmin } else if k >= bias+tmax { t = tmax } if q < t { break } output = append(output, encodeDigit(t+(q-t)%(base-t))) q = (q - t) / (base - t) } output = append(output, encodeDigit(q)) bias = adapt(delta, h+1, h == b) delta = 0 h++ remaining-- } delta++ n++ } return string(output), nil } // madd computes a + (b * c), detecting overflow. func madd(a, b, c int32) (next int32, overflow bool) { p := int64(b) * int64(c) if p > math.MaxInt32-int64(a) { return 0, true } return a + int32(p), false } func decodeDigit(x byte) (digit int32, ok bool) { switch { case '0' <= x && x <= '9': return int32(x - ('0' - 26)), true case 'A' <= x && x <= 'Z': return int32(x - 'A'), true case 'a' <= x && x <= 'z': return int32(x - 'a'), true } return 0, false } func encodeDigit(digit int32) byte { switch { case 0 <= digit && digit < 26: return byte(digit + 'a') case 26 <= digit && digit < 36: return byte(digit + ('0' - 26)) } panic("idna: internal error in punycode encoding") } // adapt is the bias adaptation function specified in section 6.1. func adapt(delta, numPoints int32, firstTime bool) int32 { if firstTime { delta /= damp } else { delta /= 2 } delta += delta / numPoints k := int32(0) for delta > ((base-tmin)*tmax)/2 { delta /= base - tmin k += base } return k + (base-tmin+1)*delta/(delta+skew) } ================================================ FILE: vendor/golang.org/x/net/idna/tables10.0.0.go ================================================ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. //go:build go1.10 && !go1.13 package idna // UnicodeVersion is the Unicode version from which the tables in this package are derived. const UnicodeVersion = "10.0.0" var mappings string = "" + // Size: 8175 bytes "\x00\x01 \x03 ̈\x01a\x03 ̄\x012\x013\x03 ́\x03 ̧\x011\x01o\x051⁄4\x051⁄2" + "\x053⁄4\x03i̇\x03l·\x03ʼn\x01s\x03dž\x03ⱥ\x03ⱦ\x01h\x01j\x01r\x01w\x01y" + "\x03 ̆\x03 ̇\x03 ̊\x03 ̨\x03 ̃\x03 ̋\x01l\x01x\x04̈́\x03 ι\x01;\x05 ̈́" + "\x04եւ\x04اٴ\x04وٴ\x04ۇٴ\x04يٴ\x06क़\x06ख़\x06ग़\x06ज़\x06ड़\x06ढ़\x06फ़" + "\x06य़\x06ড়\x06ঢ়\x06য়\x06ਲ਼\x06ਸ਼\x06ਖ਼\x06ਗ਼\x06ਜ਼\x06ਫ਼\x06ଡ଼\x06ଢ଼" + "\x06ํา\x06ໍາ\x06ຫນ\x06ຫມ\x06གྷ\x06ཌྷ\x06དྷ\x06བྷ\x06ཛྷ\x06ཀྵ\x06ཱི\x06ཱུ" + "\x06ྲྀ\x09ྲཱྀ\x06ླྀ\x09ླཱྀ\x06ཱྀ\x06ྒྷ\x06ྜྷ\x06ྡྷ\x06ྦྷ\x06ྫྷ\x06ྐྵ\x02" + "в\x02д\x02о\x02с\x02т\x02ъ\x02ѣ\x02æ\x01b\x01d\x01e\x02ǝ\x01g\x01i\x01k" + "\x01m\x01n\x02ȣ\x01p\x01t\x01u\x02ɐ\x02ɑ\x02ə\x02ɛ\x02ɜ\x02ŋ\x02ɔ\x02ɯ" + "\x01v\x02β\x02γ\x02δ\x02φ\x02χ\x02ρ\x02н\x02ɒ\x01c\x02ɕ\x02ð\x01f\x02ɟ" + "\x02ɡ\x02ɥ\x02ɨ\x02ɩ\x02ɪ\x02ʝ\x02ɭ\x02ʟ\x02ɱ\x02ɰ\x02ɲ\x02ɳ\x02ɴ\x02ɵ" + "\x02ɸ\x02ʂ\x02ʃ\x02ƫ\x02ʉ\x02ʊ\x02ʋ\x02ʌ\x01z\x02ʐ\x02ʑ\x02ʒ\x02θ\x02ss" + "\x02ά\x02έ\x02ή\x02ί\x02ό\x02ύ\x02ώ\x05ἀι\x05ἁι\x05ἂι\x05ἃι\x05ἄι\x05ἅι" + "\x05ἆι\x05ἇι\x05ἠι\x05ἡι\x05ἢι\x05ἣι\x05ἤι\x05ἥι\x05ἦι\x05ἧι\x05ὠι\x05ὡι" + "\x05ὢι\x05ὣι\x05ὤι\x05ὥι\x05ὦι\x05ὧι\x05ὰι\x04αι\x04άι\x05ᾶι\x02ι\x05 ̈͂" + "\x05ὴι\x04ηι\x04ήι\x05ῆι\x05 ̓̀\x05 ̓́\x05 ̓͂\x02ΐ\x05 ̔̀\x05 ̔́\x05 ̔͂" + "\x02ΰ\x05 ̈̀\x01`\x05ὼι\x04ωι\x04ώι\x05ῶι\x06′′\x09′′′\x06‵‵\x09‵‵‵\x02!" + "!\x02??\x02?!\x02!?\x0c′′′′\x010\x014\x015\x016\x017\x018\x019\x01+\x01=" + "\x01(\x01)\x02rs\x02ħ\x02no\x01q\x02sm\x02tm\x02ω\x02å\x02א\x02ב\x02ג" + "\x02ד\x02π\x051⁄7\x051⁄9\x061⁄10\x051⁄3\x052⁄3\x051⁄5\x052⁄5\x053⁄5\x054" + "⁄5\x051⁄6\x055⁄6\x051⁄8\x053⁄8\x055⁄8\x057⁄8\x041⁄\x02ii\x02iv\x02vi" + "\x04viii\x02ix\x02xi\x050⁄3\x06∫∫\x09∫∫∫\x06∮∮\x09∮∮∮\x0210\x0211\x0212" + "\x0213\x0214\x0215\x0216\x0217\x0218\x0219\x0220\x04(10)\x04(11)\x04(12)" + "\x04(13)\x04(14)\x04(15)\x04(16)\x04(17)\x04(18)\x04(19)\x04(20)\x0c∫∫∫∫" + "\x02==\x05⫝̸\x02ɫ\x02ɽ\x02ȿ\x02ɀ\x01.\x04 ゙\x04 ゚\x06より\x06コト\x05(ᄀ)\x05" + "(ᄂ)\x05(ᄃ)\x05(ᄅ)\x05(ᄆ)\x05(ᄇ)\x05(ᄉ)\x05(ᄋ)\x05(ᄌ)\x05(ᄎ)\x05(ᄏ)\x05(ᄐ" + ")\x05(ᄑ)\x05(ᄒ)\x05(가)\x05(나)\x05(다)\x05(라)\x05(마)\x05(바)\x05(사)\x05(아)" + "\x05(자)\x05(차)\x05(카)\x05(타)\x05(파)\x05(하)\x05(주)\x08(오전)\x08(오후)\x05(一)" + "\x05(二)\x05(三)\x05(四)\x05(五)\x05(六)\x05(七)\x05(八)\x05(九)\x05(十)\x05(月)" + "\x05(火)\x05(水)\x05(木)\x05(金)\x05(土)\x05(日)\x05(株)\x05(有)\x05(社)\x05(名)" + "\x05(特)\x05(財)\x05(祝)\x05(労)\x05(代)\x05(呼)\x05(学)\x05(監)\x05(企)\x05(資)" + "\x05(協)\x05(祭)\x05(休)\x05(自)\x05(至)\x0221\x0222\x0223\x0224\x0225\x0226" + "\x0227\x0228\x0229\x0230\x0231\x0232\x0233\x0234\x0235\x06참고\x06주의\x0236" + "\x0237\x0238\x0239\x0240\x0241\x0242\x0243\x0244\x0245\x0246\x0247\x0248" + "\x0249\x0250\x041月\x042月\x043月\x044月\x045月\x046月\x047月\x048月\x049月\x0510" + "月\x0511月\x0512月\x02hg\x02ev\x0cアパート\x0cアルファ\x0cアンペア\x09アール\x0cイニング\x09" + "インチ\x09ウォン\x0fエスクード\x0cエーカー\x09オンス\x09オーム\x09カイリ\x0cカラット\x0cカロリー\x09ガロ" + "ン\x09ガンマ\x06ギガ\x09ギニー\x0cキュリー\x0cギルダー\x06キロ\x0fキログラム\x12キロメートル\x0fキロワッ" + "ト\x09グラム\x0fグラムトン\x0fクルゼイロ\x0cクローネ\x09ケース\x09コルナ\x09コーポ\x0cサイクル\x0fサンチ" + "ーム\x0cシリング\x09センチ\x09セント\x09ダース\x06デシ\x06ドル\x06トン\x06ナノ\x09ノット\x09ハイツ" + "\x0fパーセント\x09パーツ\x0cバーレル\x0fピアストル\x09ピクル\x06ピコ\x06ビル\x0fファラッド\x0cフィート" + "\x0fブッシェル\x09フラン\x0fヘクタール\x06ペソ\x09ペニヒ\x09ヘルツ\x09ペンス\x09ページ\x09ベータ\x0cポイ" + "ント\x09ボルト\x06ホン\x09ポンド\x09ホール\x09ホーン\x0cマイクロ\x09マイル\x09マッハ\x09マルク\x0fマ" + "ンション\x0cミクロン\x06ミリ\x0fミリバール\x06メガ\x0cメガトン\x0cメートル\x09ヤード\x09ヤール\x09ユアン" + "\x0cリットル\x06リラ\x09ルピー\x0cルーブル\x06レム\x0fレントゲン\x09ワット\x040点\x041点\x042点" + "\x043点\x044点\x045点\x046点\x047点\x048点\x049点\x0510点\x0511点\x0512点\x0513点" + "\x0514点\x0515点\x0516点\x0517点\x0518点\x0519点\x0520点\x0521点\x0522点\x0523点" + "\x0524点\x02da\x02au\x02ov\x02pc\x02dm\x02iu\x06平成\x06昭和\x06大正\x06明治\x0c株" + "式会社\x02pa\x02na\x02ma\x02ka\x02kb\x02mb\x02gb\x04kcal\x02pf\x02nf\x02m" + "g\x02kg\x02hz\x02ml\x02dl\x02kl\x02fm\x02nm\x02mm\x02cm\x02km\x02m2\x02m" + "3\x05m∕s\x06m∕s2\x07rad∕s\x08rad∕s2\x02ps\x02ns\x02ms\x02pv\x02nv\x02mv" + "\x02kv\x02pw\x02nw\x02mw\x02kw\x02bq\x02cc\x02cd\x06c∕kg\x02db\x02gy\x02" + "ha\x02hp\x02in\x02kk\x02kt\x02lm\x02ln\x02lx\x02ph\x02pr\x02sr\x02sv\x02" + "wb\x05v∕m\x05a∕m\x041日\x042日\x043日\x044日\x045日\x046日\x047日\x048日\x049日" + "\x0510日\x0511日\x0512日\x0513日\x0514日\x0515日\x0516日\x0517日\x0518日\x0519日" + "\x0520日\x0521日\x0522日\x0523日\x0524日\x0525日\x0526日\x0527日\x0528日\x0529日" + "\x0530日\x0531日\x02ь\x02ɦ\x02ɬ\x02ʞ\x02ʇ\x02œ\x04𤋮\x04𢡊\x04𢡄\x04𣏕\x04𥉉" + "\x04𥳐\x04𧻓\x02ff\x02fi\x02fl\x02st\x04մն\x04մե\x04մի\x04վն\x04մխ\x04יִ" + "\x04ײַ\x02ע\x02ה\x02כ\x02ל\x02ם\x02ר\x02ת\x04שׁ\x04שׂ\x06שּׁ\x06שּׂ\x04א" + "ַ\x04אָ\x04אּ\x04בּ\x04גּ\x04דּ\x04הּ\x04וּ\x04זּ\x04טּ\x04יּ\x04ךּ\x04" + "כּ\x04לּ\x04מּ\x04נּ\x04סּ\x04ףּ\x04פּ\x04צּ\x04קּ\x04רּ\x04שּ\x04תּ" + "\x04וֹ\x04בֿ\x04כֿ\x04פֿ\x04אל\x02ٱ\x02ٻ\x02پ\x02ڀ\x02ٺ\x02ٿ\x02ٹ\x02ڤ" + "\x02ڦ\x02ڄ\x02ڃ\x02چ\x02ڇ\x02ڍ\x02ڌ\x02ڎ\x02ڈ\x02ژ\x02ڑ\x02ک\x02گ\x02ڳ" + "\x02ڱ\x02ں\x02ڻ\x02ۀ\x02ہ\x02ھ\x02ے\x02ۓ\x02ڭ\x02ۇ\x02ۆ\x02ۈ\x02ۋ\x02ۅ" + "\x02ۉ\x02ې\x02ى\x04ئا\x04ئە\x04ئو\x04ئۇ\x04ئۆ\x04ئۈ\x04ئې\x04ئى\x02ی\x04" + "ئج\x04ئح\x04ئم\x04ئي\x04بج\x04بح\x04بخ\x04بم\x04بى\x04بي\x04تج\x04تح" + "\x04تخ\x04تم\x04تى\x04تي\x04ثج\x04ثم\x04ثى\x04ثي\x04جح\x04جم\x04حج\x04حم" + "\x04خج\x04خح\x04خم\x04سج\x04سح\x04سخ\x04سم\x04صح\x04صم\x04ضج\x04ضح\x04ضخ" + "\x04ضم\x04طح\x04طم\x04ظم\x04عج\x04عم\x04غج\x04غم\x04فج\x04فح\x04فخ\x04فم" + "\x04فى\x04في\x04قح\x04قم\x04قى\x04قي\x04كا\x04كج\x04كح\x04كخ\x04كل\x04كم" + "\x04كى\x04كي\x04لج\x04لح\x04لخ\x04لم\x04لى\x04لي\x04مج\x04مح\x04مخ\x04مم" + "\x04مى\x04مي\x04نج\x04نح\x04نخ\x04نم\x04نى\x04ني\x04هج\x04هم\x04هى\x04هي" + "\x04يج\x04يح\x04يخ\x04يم\x04يى\x04يي\x04ذٰ\x04رٰ\x04ىٰ\x05 ٌّ\x05 ٍّ\x05" + " َّ\x05 ُّ\x05 ِّ\x05 ّٰ\x04ئر\x04ئز\x04ئن\x04بر\x04بز\x04بن\x04تر\x04تز" + "\x04تن\x04ثر\x04ثز\x04ثن\x04ما\x04نر\x04نز\x04نن\x04ير\x04يز\x04ين\x04ئخ" + "\x04ئه\x04به\x04ته\x04صخ\x04له\x04نه\x04هٰ\x04يه\x04ثه\x04سه\x04شم\x04شه" + "\x06ـَّ\x06ـُّ\x06ـِّ\x04طى\x04طي\x04عى\x04عي\x04غى\x04غي\x04سى\x04سي" + "\x04شى\x04شي\x04حى\x04حي\x04جى\x04جي\x04خى\x04خي\x04صى\x04صي\x04ضى\x04ضي" + "\x04شج\x04شح\x04شخ\x04شر\x04سر\x04صر\x04ضر\x04اً\x06تجم\x06تحج\x06تحم" + "\x06تخم\x06تمج\x06تمح\x06تمخ\x06جمح\x06حمي\x06حمى\x06سحج\x06سجح\x06سجى" + "\x06سمح\x06سمج\x06سمم\x06صحح\x06صمم\x06شحم\x06شجي\x06شمخ\x06شمم\x06ضحى" + "\x06ضخم\x06طمح\x06طمم\x06طمي\x06عجم\x06عمم\x06عمى\x06غمم\x06غمي\x06غمى" + "\x06فخم\x06قمح\x06قمم\x06لحم\x06لحي\x06لحى\x06لجج\x06لخم\x06لمح\x06محج" + "\x06محم\x06محي\x06مجح\x06مجم\x06مخج\x06مخم\x06مجخ\x06همج\x06همم\x06نحم" + "\x06نحى\x06نجم\x06نجى\x06نمي\x06نمى\x06يمم\x06بخي\x06تجي\x06تجى\x06تخي" + "\x06تخى\x06تمي\x06تمى\x06جمي\x06جحى\x06جمى\x06سخى\x06صحي\x06شحي\x06ضحي" + "\x06لجي\x06لمي\x06يحي\x06يجي\x06يمي\x06ممي\x06قمي\x06نحي\x06عمي\x06كمي" + "\x06نجح\x06مخي\x06لجم\x06كمم\x06جحي\x06حجي\x06مجي\x06فمي\x06بحي\x06سخي" + "\x06نجي\x06صلے\x06قلے\x08الله\x08اكبر\x08محمد\x08صلعم\x08رسول\x08عليه" + "\x08وسلم\x06صلى!صلى الله عليه وسلم\x0fجل جلاله\x08ریال\x01,\x01:\x01!" + "\x01?\x01_\x01{\x01}\x01[\x01]\x01#\x01&\x01*\x01-\x01<\x01>\x01\\\x01$" + "\x01%\x01@\x04ـً\x04ـَ\x04ـُ\x04ـِ\x04ـّ\x04ـْ\x02ء\x02آ\x02أ\x02ؤ\x02إ" + "\x02ئ\x02ا\x02ب\x02ة\x02ت\x02ث\x02ج\x02ح\x02خ\x02د\x02ذ\x02ر\x02ز\x02س" + "\x02ش\x02ص\x02ض\x02ط\x02ظ\x02ع\x02غ\x02ف\x02ق\x02ك\x02ل\x02م\x02ن\x02ه" + "\x02و\x02ي\x04لآ\x04لأ\x04لإ\x04لا\x01\x22\x01'\x01/\x01^\x01|\x01~\x02¢" + "\x02£\x02¬\x02¦\x02¥\x08𝅗𝅥\x08𝅘𝅥\x0c𝅘𝅥𝅮\x0c𝅘𝅥𝅯\x0c𝅘𝅥𝅰\x0c𝅘𝅥𝅱\x0c𝅘𝅥𝅲\x08𝆹" + "𝅥\x08𝆺𝅥\x0c𝆹𝅥𝅮\x0c𝆺𝅥𝅮\x0c𝆹𝅥𝅯\x0c𝆺𝅥𝅯\x02ı\x02ȷ\x02α\x02ε\x02ζ\x02η\x02" + "κ\x02λ\x02μ\x02ν\x02ξ\x02ο\x02σ\x02τ\x02υ\x02ψ\x03∇\x03∂\x02ϝ\x02ٮ\x02ڡ" + "\x02ٯ\x020,\x021,\x022,\x023,\x024,\x025,\x026,\x027,\x028,\x029,\x03(a)" + "\x03(b)\x03(c)\x03(d)\x03(e)\x03(f)\x03(g)\x03(h)\x03(i)\x03(j)\x03(k)" + "\x03(l)\x03(m)\x03(n)\x03(o)\x03(p)\x03(q)\x03(r)\x03(s)\x03(t)\x03(u)" + "\x03(v)\x03(w)\x03(x)\x03(y)\x03(z)\x07〔s〕\x02wz\x02hv\x02sd\x03ppv\x02w" + "c\x02mc\x02md\x02dj\x06ほか\x06ココ\x03サ\x03手\x03字\x03双\x03デ\x03二\x03多\x03解" + "\x03天\x03交\x03映\x03無\x03料\x03前\x03後\x03再\x03新\x03初\x03終\x03生\x03販\x03声" + "\x03吹\x03演\x03投\x03捕\x03一\x03三\x03遊\x03左\x03中\x03右\x03指\x03走\x03打\x03禁" + "\x03空\x03合\x03満\x03有\x03月\x03申\x03割\x03営\x03配\x09〔本〕\x09〔三〕\x09〔二〕\x09〔安" + "〕\x09〔点〕\x09〔打〕\x09〔盗〕\x09〔勝〕\x09〔敗〕\x03得\x03可\x03丽\x03丸\x03乁\x03你\x03" + "侮\x03侻\x03倂\x03偺\x03備\x03僧\x03像\x03㒞\x03免\x03兔\x03兤\x03具\x03㒹\x03內\x03" + "冗\x03冤\x03仌\x03冬\x03况\x03凵\x03刃\x03㓟\x03刻\x03剆\x03剷\x03㔕\x03勇\x03勉\x03" + "勤\x03勺\x03包\x03匆\x03北\x03卉\x03卑\x03博\x03即\x03卽\x03卿\x03灰\x03及\x03叟\x03" + "叫\x03叱\x03吆\x03咞\x03吸\x03呈\x03周\x03咢\x03哶\x03唐\x03啓\x03啣\x03善\x03喙\x03" + "喫\x03喳\x03嗂\x03圖\x03嘆\x03圗\x03噑\x03噴\x03切\x03壮\x03城\x03埴\x03堍\x03型\x03" + "堲\x03報\x03墬\x03売\x03壷\x03夆\x03夢\x03奢\x03姬\x03娛\x03娧\x03姘\x03婦\x03㛮\x03" + "嬈\x03嬾\x03寃\x03寘\x03寧\x03寳\x03寿\x03将\x03尢\x03㞁\x03屠\x03屮\x03峀\x03岍\x03" + "嵃\x03嵮\x03嵫\x03嵼\x03巡\x03巢\x03㠯\x03巽\x03帨\x03帽\x03幩\x03㡢\x03㡼\x03庰\x03" + "庳\x03庶\x03廊\x03廾\x03舁\x03弢\x03㣇\x03形\x03彫\x03㣣\x03徚\x03忍\x03志\x03忹\x03" + "悁\x03㤺\x03㤜\x03悔\x03惇\x03慈\x03慌\x03慎\x03慺\x03憎\x03憲\x03憤\x03憯\x03懞\x03" + "懲\x03懶\x03成\x03戛\x03扝\x03抱\x03拔\x03捐\x03挽\x03拼\x03捨\x03掃\x03揤\x03搢\x03" + "揅\x03掩\x03㨮\x03摩\x03摾\x03撝\x03摷\x03㩬\x03敏\x03敬\x03旣\x03書\x03晉\x03㬙\x03" + "暑\x03㬈\x03㫤\x03冒\x03冕\x03最\x03暜\x03肭\x03䏙\x03朗\x03望\x03朡\x03杞\x03杓\x03" + "㭉\x03柺\x03枅\x03桒\x03梅\x03梎\x03栟\x03椔\x03㮝\x03楂\x03榣\x03槪\x03檨\x03櫛\x03" + "㰘\x03次\x03歔\x03㱎\x03歲\x03殟\x03殺\x03殻\x03汎\x03沿\x03泍\x03汧\x03洖\x03派\x03" + "海\x03流\x03浩\x03浸\x03涅\x03洴\x03港\x03湮\x03㴳\x03滋\x03滇\x03淹\x03潮\x03濆\x03" + "瀹\x03瀞\x03瀛\x03㶖\x03灊\x03災\x03灷\x03炭\x03煅\x03熜\x03爨\x03爵\x03牐\x03犀\x03" + "犕\x03獺\x03王\x03㺬\x03玥\x03㺸\x03瑇\x03瑜\x03瑱\x03璅\x03瓊\x03㼛\x03甤\x03甾\x03" + "異\x03瘐\x03㿼\x03䀈\x03直\x03眞\x03真\x03睊\x03䀹\x03瞋\x03䁆\x03䂖\x03硎\x03碌\x03" + "磌\x03䃣\x03祖\x03福\x03秫\x03䄯\x03穀\x03穊\x03穏\x03䈂\x03篆\x03築\x03䈧\x03糒\x03" + "䊠\x03糨\x03糣\x03紀\x03絣\x03䌁\x03緇\x03縂\x03繅\x03䌴\x03䍙\x03罺\x03羕\x03翺\x03" + "者\x03聠\x03聰\x03䏕\x03育\x03脃\x03䐋\x03脾\x03媵\x03舄\x03辞\x03䑫\x03芑\x03芋\x03" + "芝\x03劳\x03花\x03芳\x03芽\x03苦\x03若\x03茝\x03荣\x03莭\x03茣\x03莽\x03菧\x03著\x03" + "荓\x03菊\x03菌\x03菜\x03䔫\x03蓱\x03蓳\x03蔖\x03蕤\x03䕝\x03䕡\x03䕫\x03虐\x03虜\x03" + "虧\x03虩\x03蚩\x03蚈\x03蜎\x03蛢\x03蝹\x03蜨\x03蝫\x03螆\x03蟡\x03蠁\x03䗹\x03衠\x03" + "衣\x03裗\x03裞\x03䘵\x03裺\x03㒻\x03䚾\x03䛇\x03誠\x03諭\x03變\x03豕\x03貫\x03賁\x03" + "贛\x03起\x03跋\x03趼\x03跰\x03軔\x03輸\x03邔\x03郱\x03鄑\x03鄛\x03鈸\x03鋗\x03鋘\x03" + "鉼\x03鏹\x03鐕\x03開\x03䦕\x03閷\x03䧦\x03雃\x03嶲\x03霣\x03䩮\x03䩶\x03韠\x03䪲\x03" + "頋\x03頩\x03飢\x03䬳\x03餩\x03馧\x03駂\x03駾\x03䯎\x03鬒\x03鱀\x03鳽\x03䳎\x03䳭\x03" + "鵧\x03䳸\x03麻\x03䵖\x03黹\x03黾\x03鼅\x03鼏\x03鼖\x03鼻" var xorData string = "" + // Size: 4855 bytes "\x02\x0c\x09\x02\xb0\xec\x02\xad\xd8\x02\xad\xd9\x02\x06\x07\x02\x0f\x12" + "\x02\x0f\x1f\x02\x0f\x1d\x02\x01\x13\x02\x0f\x16\x02\x0f\x0b\x02\x0f3" + "\x02\x0f7\x02\x0f?\x02\x0f/\x02\x0f*\x02\x0c&\x02\x0c*\x02\x0c;\x02\x0c9" + "\x02\x0c%\x02\xab\xed\x02\xab\xe2\x02\xab\xe3\x02\xa9\xe0\x02\xa9\xe1" + "\x02\xa9\xe6\x02\xa3\xcb\x02\xa3\xc8\x02\xa3\xc9\x02\x01#\x02\x01\x08" + "\x02\x0e>\x02\x0e'\x02\x0f\x03\x02\x03\x0d\x02\x03\x09\x02\x03\x17\x02" + "\x03\x0e\x02\x02\x03\x02\x011\x02\x01\x00\x02\x01\x10\x02\x03<\x02\x07" + "\x0d\x02\x02\x0c\x02\x0c0\x02\x01\x03\x02\x01\x01\x02\x01 \x02\x01\x22" + "\x02\x01)\x02\x01\x0a\x02\x01\x0c\x02\x02\x06\x02\x02\x02\x02\x03\x10" + "\x03\x037 \x03\x0b+\x03\x02\x01\x04\x02\x01\x02\x02\x019\x02\x03\x1c\x02" + "\x02$\x03\x80p$\x02\x03:\x02\x03\x0a\x03\xc1r.\x03\xc1r,\x03\xc1r\x02" + "\x02\x02:\x02\x02>\x02\x02,\x02\x02\x10\x02\x02\x00\x03\xc1s<\x03\xc1s*" + "\x03\xc2L$\x03\xc2L;\x02\x09)\x02\x0a\x19\x03\x83\xab\xe3\x03\x83\xab" + "\xf2\x03 4\xe0\x03\x81\xab\xea\x03\x81\xab\xf3\x03 4\xef\x03\x96\xe1\xcd" + "\x03\x84\xe5\xc3\x02\x0d\x11\x03\x8b\xec\xcb\x03\x94\xec\xcf\x03\x9a\xec" + "\xc2\x03\x8b\xec\xdb\x03\x94\xec\xdf\x03\x9a\xec\xd2\x03\x01\x0c!\x03" + "\x01\x0c#\x03ʠ\x9d\x03ʣ\x9c\x03ʢ\x9f\x03ʥ\x9e\x03ʤ\x91\x03ʧ\x90\x03ʦ\x93" + "\x03ʩ\x92\x03ʨ\x95\x03\xca\xf3\xb5\x03\xca\xf0\xb4\x03\xca\xf1\xb7\x03" + "\xca\xf6\xb6\x03\xca\xf7\x89\x03\xca\xf4\x88\x03\xca\xf5\x8b\x03\xca\xfa" + "\x8a\x03\xca\xfb\x8d\x03\xca\xf8\x8c\x03\xca\xf9\x8f\x03\xca\xfe\x8e\x03" + "\xca\xff\x81\x03\xca\xfc\x80\x03\xca\xfd\x83\x03\xca\xe2\x82\x03\xca\xe3" + "\x85\x03\xca\xe0\x84\x03\xca\xe1\x87\x03\xca\xe6\x86\x03\xca\xe7\x99\x03" + "\xca\xe4\x98\x03\xca\xe5\x9b\x03\xca\xea\x9a\x03\xca\xeb\x9d\x03\xca\xe8" + "\x9c\x03ؓ\x89\x03ߔ\x8b\x02\x010\x03\x03\x04\x1e\x03\x04\x15\x12\x03\x0b" + "\x05,\x03\x06\x04\x00\x03\x06\x04)\x03\x06\x044\x03\x06\x04<\x03\x06\x05" + "\x1d\x03\x06\x06\x00\x03\x06\x06\x0a\x03\x06\x06'\x03\x06\x062\x03\x0786" + "\x03\x079/\x03\x079 \x03\x07:\x0e\x03\x07:\x1b\x03\x07:%\x03\x07;/\x03" + "\x07;%\x03\x074\x11\x03\x076\x09\x03\x077*\x03\x070\x01\x03\x070\x0f\x03" + "\x070.\x03\x071\x16\x03\x071\x04\x03\x0710\x03\x072\x18\x03\x072-\x03" + "\x073\x14\x03\x073>\x03\x07'\x09\x03\x07 \x00\x03\x07\x1f\x0b\x03\x07" + "\x18#\x03\x07\x18(\x03\x07\x186\x03\x07\x18\x03\x03\x07\x19\x16\x03\x07" + "\x116\x03\x07\x12'\x03\x07\x13\x10\x03\x07\x0c&\x03\x07\x0c\x08\x03\x07" + "\x0c\x13\x03\x07\x0d\x02\x03\x07\x0d\x1c\x03\x07\x0b5\x03\x07\x0b\x0a" + "\x03\x07\x0b\x01\x03\x07\x0b\x0f\x03\x07\x05\x00\x03\x07\x05\x09\x03\x07" + "\x05\x0b\x03\x07\x07\x01\x03\x07\x07\x08\x03\x07\x00<\x03\x07\x00+\x03" + "\x07\x01)\x03\x07\x01\x1b\x03\x07\x01\x08\x03\x07\x03?\x03\x0445\x03\x04" + "4\x08\x03\x0454\x03\x04)/\x03\x04)5\x03\x04+\x05\x03\x04+\x14\x03\x04+ " + "\x03\x04+<\x03\x04*&\x03\x04*\x22\x03\x04&8\x03\x04!\x01\x03\x04!\x22" + "\x03\x04\x11+\x03\x04\x10.\x03\x04\x104\x03\x04\x13=\x03\x04\x12\x04\x03" + "\x04\x12\x0a\x03\x04\x0d\x1d\x03\x04\x0d\x07\x03\x04\x0d \x03\x05<>\x03" + "\x055<\x03\x055!\x03\x055#\x03\x055&\x03\x054\x1d\x03\x054\x02\x03\x054" + "\x07\x03\x0571\x03\x053\x1a\x03\x053\x16\x03\x05.<\x03\x05.\x07\x03\x05)" + ":\x03\x05)<\x03\x05)\x0c\x03\x05)\x15\x03\x05+-\x03\x05+5\x03\x05$\x1e" + "\x03\x05$\x14\x03\x05'\x04\x03\x05'\x14\x03\x05&\x02\x03\x05\x226\x03" + "\x05\x22\x0c\x03\x05\x22\x1c\x03\x05\x19\x0a\x03\x05\x1b\x09\x03\x05\x1b" + "\x0c\x03\x05\x14\x07\x03\x05\x16?\x03\x05\x16\x0c\x03\x05\x0c\x05\x03" + "\x05\x0e\x0f\x03\x05\x01\x0e\x03\x05\x00(\x03\x05\x030\x03\x05\x03\x06" + "\x03\x0a==\x03\x0a=1\x03\x0a=,\x03\x0a=\x0c\x03\x0a??\x03\x0a<\x08\x03" + "\x0a9!\x03\x0a9)\x03\x0a97\x03\x0a99\x03\x0a6\x0a\x03\x0a6\x1c\x03\x0a6" + "\x17\x03\x0a7'\x03\x0a78\x03\x0a73\x03\x0a'\x01\x03\x0a'&\x03\x0a\x1f" + "\x0e\x03\x0a\x1f\x03\x03\x0a\x1f3\x03\x0a\x1b/\x03\x0a\x18\x19\x03\x0a" + "\x19\x01\x03\x0a\x16\x14\x03\x0a\x0e\x22\x03\x0a\x0f\x10\x03\x0a\x0f\x02" + "\x03\x0a\x0f \x03\x0a\x0c\x04\x03\x0a\x0b>\x03\x0a\x0b+\x03\x0a\x08/\x03" + "\x0a\x046\x03\x0a\x05\x14\x03\x0a\x00\x04\x03\x0a\x00\x10\x03\x0a\x00" + "\x14\x03\x0b<3\x03\x0b;*\x03\x0b9\x22\x03\x0b9)\x03\x0b97\x03\x0b+\x10" + "\x03\x0b((\x03\x0b&5\x03\x0b$\x1c\x03\x0b$\x12\x03\x0b%\x04\x03\x0b#<" + "\x03\x0b#0\x03\x0b#\x0d\x03\x0b#\x19\x03\x0b!:\x03\x0b!\x1f\x03\x0b!\x00" + "\x03\x0b\x1e5\x03\x0b\x1c\x1d\x03\x0b\x1d-\x03\x0b\x1d(\x03\x0b\x18.\x03" + "\x0b\x18 \x03\x0b\x18\x16\x03\x0b\x14\x13\x03\x0b\x15$\x03\x0b\x15\x22" + "\x03\x0b\x12\x1b\x03\x0b\x12\x10\x03\x0b\x132\x03\x0b\x13=\x03\x0b\x12" + "\x18\x03\x0b\x0c&\x03\x0b\x061\x03\x0b\x06:\x03\x0b\x05#\x03\x0b\x05<" + "\x03\x0b\x04\x0b\x03\x0b\x04\x04\x03\x0b\x04\x1b\x03\x0b\x042\x03\x0b" + "\x041\x03\x0b\x03\x03\x03\x0b\x03\x1d\x03\x0b\x03/\x03\x0b\x03+\x03\x0b" + "\x02\x1b\x03\x0b\x02\x00\x03\x0b\x01\x1e\x03\x0b\x01\x08\x03\x0b\x015" + "\x03\x06\x0d9\x03\x06\x0d=\x03\x06\x0d?\x03\x02\x001\x03\x02\x003\x03" + "\x02\x02\x19\x03\x02\x006\x03\x02\x02\x1b\x03\x02\x004\x03\x02\x00<\x03" + "\x02\x02\x0a\x03\x02\x02\x0e\x03\x02\x01\x1a\x03\x02\x01\x07\x03\x02\x01" + "\x05\x03\x02\x01\x0b\x03\x02\x01%\x03\x02\x01\x0c\x03\x02\x01\x04\x03" + "\x02\x01\x1c\x03\x02\x00.\x03\x02\x002\x03\x02\x00>\x03\x02\x00\x12\x03" + "\x02\x00\x16\x03\x02\x011\x03\x02\x013\x03\x02\x02 \x03\x02\x02%\x03\x02" + "\x02$\x03\x02\x028\x03\x02\x02;\x03\x02\x024\x03\x02\x012\x03\x02\x022" + "\x03\x02\x02/\x03\x02\x01,\x03\x02\x01\x13\x03\x02\x01\x16\x03\x02\x01" + "\x11\x03\x02\x01\x1e\x03\x02\x01\x15\x03\x02\x01\x17\x03\x02\x01\x0f\x03" + "\x02\x01\x08\x03\x02\x00?\x03\x02\x03\x07\x03\x02\x03\x0d\x03\x02\x03" + "\x13\x03\x02\x03\x1d\x03\x02\x03\x1f\x03\x02\x00\x03\x03\x02\x00\x0d\x03" + "\x02\x00\x01\x03\x02\x00\x1b\x03\x02\x00\x19\x03\x02\x00\x18\x03\x02\x00" + "\x13\x03\x02\x00/\x03\x07>\x12\x03\x07<\x1f\x03\x07>\x1d\x03\x06\x1d\x0e" + "\x03\x07>\x1c\x03\x07>:\x03\x07>\x13\x03\x04\x12+\x03\x07?\x03\x03\x07>" + "\x02\x03\x06\x224\x03\x06\x1a.\x03\x07<%\x03\x06\x1c\x0b\x03\x0609\x03" + "\x05\x1f\x01\x03\x04'\x08\x03\x93\xfd\xf5\x03\x02\x0d \x03\x02\x0d#\x03" + "\x02\x0d!\x03\x02\x0d&\x03\x02\x0d\x22\x03\x02\x0d/\x03\x02\x0d,\x03\x02" + "\x0d$\x03\x02\x0d'\x03\x02\x0d%\x03\x02\x0d;\x03\x02\x0d=\x03\x02\x0d?" + "\x03\x099.\x03\x08\x0b7\x03\x08\x02\x14\x03\x08\x14\x0d\x03\x08.:\x03" + "\x089'\x03\x0f\x0b\x18\x03\x0f\x1c1\x03\x0f\x17&\x03\x0f9\x1f\x03\x0f0" + "\x0c\x03\x0e\x0a9\x03\x0e\x056\x03\x0e\x1c#\x03\x0f\x13\x0e\x03\x072\x00" + "\x03\x070\x0d\x03\x072\x0b\x03\x06\x11\x18\x03\x070\x10\x03\x06\x0f(\x03" + "\x072\x05\x03\x06\x0f,\x03\x073\x15\x03\x06\x07\x08\x03\x05\x16\x02\x03" + "\x04\x0b \x03\x05:8\x03\x05\x16%\x03\x0a\x0d\x1f\x03\x06\x16\x10\x03\x05" + "\x1d5\x03\x05*;\x03\x05\x16\x1b\x03\x04.-\x03\x06\x1a\x19\x03\x04\x03," + "\x03\x0b87\x03\x04/\x0a\x03\x06\x00,\x03\x04-\x01\x03\x04\x1e-\x03\x06/(" + "\x03\x0a\x0b5\x03\x06\x0e7\x03\x06\x07.\x03\x0597\x03\x0a*%\x03\x0760" + "\x03\x06\x0c;\x03\x05'\x00\x03\x072.\x03\x072\x08\x03\x06=\x01\x03\x06" + "\x05\x1b\x03\x06\x06\x12\x03\x06$=\x03\x06'\x0d\x03\x04\x11\x0f\x03\x076" + ",\x03\x06\x07;\x03\x06.,\x03\x86\xf9\xea\x03\x8f\xff\xeb\x02\x092\x02" + "\x095\x02\x094\x02\x09;\x02\x09>\x02\x098\x02\x09*\x02\x09/\x02\x09,\x02" + "\x09%\x02\x09&\x02\x09#\x02\x09 \x02\x08!\x02\x08%\x02\x08$\x02\x08+\x02" + "\x08.\x02\x08*\x02\x08&\x02\x088\x02\x08>\x02\x084\x02\x086\x02\x080\x02" + "\x08\x10\x02\x08\x17\x02\x08\x12\x02\x08\x1d\x02\x08\x1f\x02\x08\x13\x02" + "\x08\x15\x02\x08\x14\x02\x08\x0c\x03\x8b\xfd\xd0\x03\x81\xec\xc6\x03\x87" + "\xe0\x8a\x03-2\xe3\x03\x80\xef\xe4\x03-2\xea\x03\x88\xe6\xeb\x03\x8e\xe6" + "\xe8\x03\x84\xe6\xe9\x03\x97\xe6\xee\x03-2\xf9\x03-2\xf6\x03\x8e\xe3\xad" + "\x03\x80\xe3\x92\x03\x88\xe3\x90\x03\x8e\xe3\x90\x03\x80\xe3\x97\x03\x88" + "\xe3\x95\x03\x88\xfe\xcb\x03\x8e\xfe\xca\x03\x84\xfe\xcd\x03\x91\xef\xc9" + "\x03-2\xc1\x03-2\xc0\x03-2\xcb\x03\x88@\x09\x03\x8e@\x08\x03\x8f\xe0\xf5" + "\x03\x8e\xe6\xf9\x03\x8e\xe0\xfa\x03\x93\xff\xf4\x03\x84\xee\xd3\x03\x0b" + "(\x04\x023 \x021;\x02\x01*\x03\x0b#\x10\x03\x0b 0\x03\x0b!\x10\x03\x0b!0" + "\x03\x07\x15\x08\x03\x09?5\x03\x07\x1f\x08\x03\x07\x17\x0b\x03\x09\x1f" + "\x15\x03\x0b\x1c7\x03\x0a+#\x03\x06\x1a\x1b\x03\x06\x1a\x14\x03\x0a\x01" + "\x18\x03\x06#\x1b\x03\x0a2\x0c\x03\x0a\x01\x04\x03\x09#;\x03\x08='\x03" + "\x08\x1a\x0a\x03\x07\x03\x0a\x111\x03\x09\x1b\x09\x03\x073.\x03\x07\x01\x00" + "\x03\x09/,\x03\x07#>\x03\x07\x048\x03\x0a\x1f\x22\x03\x098>\x03\x09\x11" + "\x00\x03\x08/\x17\x03\x06'\x22\x03\x0b\x1a+\x03\x0a\x22\x19\x03\x0a/1" + "\x03\x0974\x03\x09\x0f\x22\x03\x08,\x22\x03\x08?\x14\x03\x07$5\x03\x07<3" + "\x03\x07=*\x03\x07\x13\x18\x03\x068\x0a\x03\x06\x09\x16\x03\x06\x13\x00" + "\x03\x08\x067\x03\x08\x01\x03\x03\x08\x12\x1d\x03\x07+7\x03\x06(;\x03" + "\x06\x1c?\x03\x07\x0e\x17\x03\x0a\x06\x1d\x03\x0a\x19\x07\x03\x08\x14$" + "\x03\x07$;\x03\x08,$\x03\x08\x06\x0d\x03\x07\x16\x0a\x03\x06>>\x03\x0a" + "\x06\x12\x03\x0a\x14)\x03\x09\x0d\x1f\x03\x09\x12\x17\x03\x09\x19\x01" + "\x03\x08\x11 \x03\x08\x1d'\x03\x06<\x1a\x03\x0a.\x00\x03\x07'\x18\x03" + "\x0a\x22\x08\x03\x08\x0d\x0a\x03\x08\x13)\x03\x07*)\x03\x06<,\x03\x07" + "\x0b\x1a\x03\x09.\x14\x03\x09\x0d\x1e\x03\x07\x0e#\x03\x0b\x1d'\x03\x0a" + "\x0a8\x03\x09%2\x03\x08+&\x03\x080\x12\x03\x0a)4\x03\x08\x06\x1f\x03\x0b" + "\x1b\x1a\x03\x0a\x1b\x0f\x03\x0b\x1d*\x03\x09\x16$\x03\x090\x11\x03\x08" + "\x11\x08\x03\x0a*(\x03\x0a\x042\x03\x089,\x03\x074'\x03\x07\x0f\x05\x03" + "\x09\x0b\x0a\x03\x07\x1b\x01\x03\x09\x17:\x03\x09.\x0d\x03\x07.\x11\x03" + "\x09+\x15\x03\x080\x13\x03\x0b\x1f\x19\x03\x0a \x11\x03\x0a\x220\x03\x09" + "\x07;\x03\x08\x16\x1c\x03\x07,\x13\x03\x07\x0e/\x03\x06\x221\x03\x0a." + "\x0a\x03\x0a7\x02\x03\x0a\x032\x03\x0a\x1d.\x03\x091\x06\x03\x09\x19:" + "\x03\x08\x02/\x03\x060+\x03\x06\x0f-\x03\x06\x1c\x1f\x03\x06\x1d\x07\x03" + "\x0a,\x11\x03\x09=\x0d\x03\x09\x0b;\x03\x07\x1b/\x03\x0a\x1f:\x03\x09 " + "\x1f\x03\x09.\x10\x03\x094\x0b\x03\x09\x1a1\x03\x08#\x1a\x03\x084\x1d" + "\x03\x08\x01\x1f\x03\x08\x11\x22\x03\x07'8\x03\x07\x1a>\x03\x0757\x03" + "\x06&9\x03\x06+\x11\x03\x0a.\x0b\x03\x0a,>\x03\x0a4#\x03\x08%\x17\x03" + "\x07\x05\x22\x03\x07\x0c\x0b\x03\x0a\x1d+\x03\x0a\x19\x16\x03\x09+\x1f" + "\x03\x09\x08\x0b\x03\x08\x16\x18\x03\x08+\x12\x03\x0b\x1d\x0c\x03\x0a=" + "\x10\x03\x0a\x09\x0d\x03\x0a\x10\x11\x03\x09&0\x03\x08(\x1f\x03\x087\x07" + "\x03\x08\x185\x03\x07'6\x03\x06.\x05\x03\x06=\x04\x03\x06;;\x03\x06\x06," + "\x03\x0b\x18>\x03\x08\x00\x18\x03\x06 \x03\x03\x06<\x00\x03\x09%\x18\x03" + "\x0b\x1c<\x03\x0a%!\x03\x0a\x09\x12\x03\x0a\x16\x02\x03\x090'\x03\x09" + "\x0e=\x03\x08 \x0e\x03\x08>\x03\x03\x074>\x03\x06&?\x03\x06\x19\x09\x03" + "\x06?(\x03\x0a-\x0e\x03\x09:3\x03\x098:\x03\x09\x12\x0b\x03\x09\x1d\x17" + "\x03\x087\x05\x03\x082\x14\x03\x08\x06%\x03\x08\x13\x1f\x03\x06\x06\x0e" + "\x03\x0a\x22<\x03\x09/<\x03\x06>+\x03\x0a'?\x03\x0a\x13\x0c\x03\x09\x10<" + "\x03\x07\x1b=\x03\x0a\x19\x13\x03\x09\x22\x1d\x03\x09\x07\x0d\x03\x08)" + "\x1c\x03\x06=\x1a\x03\x0a/4\x03\x0a7\x11\x03\x0a\x16:\x03\x09?3\x03\x09:" + "/\x03\x09\x05\x0a\x03\x09\x14\x06\x03\x087\x22\x03\x080\x07\x03\x08\x1a" + "\x1f\x03\x07\x04(\x03\x07\x04\x09\x03\x06 %\x03\x06<\x08\x03\x0a+\x14" + "\x03\x09\x1d\x16\x03\x0a70\x03\x08 >\x03\x0857\x03\x070\x0a\x03\x06=\x12" + "\x03\x06\x16%\x03\x06\x1d,\x03\x099#\x03\x09\x10>\x03\x07 \x1e\x03\x08" + "\x0c<\x03\x08\x0b\x18\x03\x08\x15+\x03\x08,:\x03\x08%\x22\x03\x07\x0a$" + "\x03\x0b\x1c=\x03\x07+\x08\x03\x0a/\x05\x03\x0a \x07\x03\x0a\x12'\x03" + "\x09#\x11\x03\x08\x1b\x15\x03\x0a\x06\x01\x03\x09\x1c\x1b\x03\x0922\x03" + "\x07\x14<\x03\x07\x09\x04\x03\x061\x04\x03\x07\x0e\x01\x03\x0a\x13\x18" + "\x03\x0a-\x0c\x03\x0a?\x0d\x03\x0a\x09\x0a\x03\x091&\x03\x0a/\x0b\x03" + "\x08$<\x03\x083\x1d\x03\x08\x0c$\x03\x08\x0d\x07\x03\x08\x0d?\x03\x08" + "\x0e\x14\x03\x065\x0a\x03\x08\x1a#\x03\x08\x16#\x03\x0702\x03\x07\x03" + "\x1a\x03\x06(\x1d\x03\x06+\x1b\x03\x06\x0b\x05\x03\x06\x0b\x17\x03\x06" + "\x0c\x04\x03\x06\x1e\x19\x03\x06+0\x03\x062\x18\x03\x0b\x16\x1e\x03\x0a+" + "\x16\x03\x0a-?\x03\x0a#:\x03\x0a#\x10\x03\x0a%$\x03\x0a>+\x03\x0a01\x03" + "\x0a1\x10\x03\x0a\x099\x03\x0a\x0a\x12\x03\x0a\x19\x1f\x03\x0a\x19\x12" + "\x03\x09*)\x03\x09-\x16\x03\x09.1\x03\x09.2\x03\x09<\x0e\x03\x09> \x03" + "\x093\x12\x03\x09\x0b\x01\x03\x09\x1c2\x03\x09\x11\x1c\x03\x09\x15%\x03" + "\x08,&\x03\x08!\x22\x03\x089(\x03\x08\x0b\x1a\x03\x08\x0d2\x03\x08\x0c" + "\x04\x03\x08\x0c\x06\x03\x08\x0c\x1f\x03\x08\x0c\x0c\x03\x08\x0f\x1f\x03" + "\x08\x0f\x1d\x03\x08\x00\x14\x03\x08\x03\x14\x03\x08\x06\x16\x03\x08\x1e" + "#\x03\x08\x11\x11\x03\x08\x10\x18\x03\x08\x14(\x03\x07)\x1e\x03\x07.1" + "\x03\x07 $\x03\x07 '\x03\x078\x08\x03\x07\x0d0\x03\x07\x0f7\x03\x07\x05#" + "\x03\x07\x05\x1a\x03\x07\x1a7\x03\x07\x1d-\x03\x07\x17\x10\x03\x06)\x1f" + "\x03\x062\x0b\x03\x066\x16\x03\x06\x09\x11\x03\x09(\x1e\x03\x07!5\x03" + "\x0b\x11\x16\x03\x0a/\x04\x03\x0a,\x1a\x03\x0b\x173\x03\x0a,1\x03\x0a/5" + "\x03\x0a\x221\x03\x0a\x22\x0d\x03\x0a?%\x03\x0a<,\x03\x0a?#\x03\x0a>\x19" + "\x03\x0a\x08&\x03\x0a\x0b\x0e\x03\x0a\x0c:\x03\x0a\x0c+\x03\x0a\x03\x22" + "\x03\x0a\x06)\x03\x0a\x11\x10\x03\x0a\x11\x1a\x03\x0a\x17-\x03\x0a\x14(" + "\x03\x09)\x1e\x03\x09/\x09\x03\x09.\x00\x03\x09,\x07\x03\x09/*\x03\x09-9" + "\x03\x09\x228\x03\x09%\x09\x03\x09:\x12\x03\x09;\x1d\x03\x09?\x06\x03" + "\x093%\x03\x096\x05\x03\x096\x08\x03\x097\x02\x03\x09\x07,\x03\x09\x04," + "\x03\x09\x1f\x16\x03\x09\x11\x03\x03\x09\x11\x12\x03\x09\x168\x03\x08*" + "\x05\x03\x08/2\x03\x084:\x03\x08\x22+\x03\x08 0\x03\x08&\x0a\x03\x08;" + "\x10\x03\x08>$\x03\x08>\x18\x03\x0829\x03\x082:\x03\x081,\x03\x081<\x03" + "\x081\x1c\x03\x087#\x03\x087*\x03\x08\x09'\x03\x08\x00\x1d\x03\x08\x05-" + "\x03\x08\x1f4\x03\x08\x1d\x04\x03\x08\x16\x0f\x03\x07*7\x03\x07'!\x03" + "\x07%\x1b\x03\x077\x0c\x03\x07\x0c1\x03\x07\x0c.\x03\x07\x00\x06\x03\x07" + "\x01\x02\x03\x07\x010\x03\x07\x06=\x03\x07\x01\x03\x03\x07\x01\x13\x03" + "\x07\x06\x06\x03\x07\x05\x0a\x03\x07\x1f\x09\x03\x07\x17:\x03\x06*1\x03" + "\x06-\x1d\x03\x06\x223\x03\x062:\x03\x060$\x03\x066\x1e\x03\x064\x12\x03" + "\x0645\x03\x06\x0b\x00\x03\x06\x0b7\x03\x06\x07\x1f\x03\x06\x15\x12\x03" + "\x0c\x05\x0f\x03\x0b+\x0b\x03\x0b+-\x03\x06\x16\x1b\x03\x06\x15\x17\x03" + "\x89\xca\xea\x03\x89\xca\xe8\x03\x0c8\x10\x03\x0c8\x01\x03\x0c8\x0f\x03" + "\x0d8%\x03\x0d8!\x03\x0c8-\x03\x0c8/\x03\x0c8+\x03\x0c87\x03\x0c85\x03" + "\x0c9\x09\x03\x0c9\x0d\x03\x0c9\x0f\x03\x0c9\x0b\x03\xcfu\x0c\x03\xcfu" + "\x0f\x03\xcfu\x0e\x03\xcfu\x09\x03\x0c9\x10\x03\x0d9\x0c\x03\xcf`;\x03" + "\xcf`>\x03\xcf`9\x03\xcf`8\x03\xcf`7\x03\xcf`*\x03\xcf`-\x03\xcf`,\x03" + "\x0d\x1b\x1a\x03\x0d\x1b&\x03\x0c=.\x03\x0c=%\x03\x0c>\x1e\x03\x0c>\x14" + "\x03\x0c?\x06\x03\x0c?\x0b\x03\x0c?\x0c\x03\x0c?\x0d\x03\x0c?\x02\x03" + "\x0c>\x0f\x03\x0c>\x08\x03\x0c>\x09\x03\x0c>,\x03\x0c>\x0c\x03\x0c?\x13" + "\x03\x0c?\x16\x03\x0c?\x15\x03\x0c?\x1c\x03\x0c?\x1f\x03\x0c?\x1d\x03" + "\x0c?\x1a\x03\x0c?\x17\x03\x0c?\x08\x03\x0c?\x09\x03\x0c?\x0e\x03\x0c?" + "\x04\x03\x0c?\x05\x03\x0c" + "\x03\x0c=2\x03\x0c=6\x03\x0c<\x07\x03\x0c<\x05\x03\x0e:!\x03\x0e:#\x03" + "\x0e8\x09\x03\x0e:&\x03\x0e8\x0b\x03\x0e:$\x03\x0e:,\x03\x0e8\x1a\x03" + "\x0e8\x1e\x03\x0e:*\x03\x0e:7\x03\x0e:5\x03\x0e:;\x03\x0e:\x15\x03\x0e:<" + "\x03\x0e:4\x03\x0e:'\x03\x0e:-\x03\x0e:%\x03\x0e:?\x03\x0e:=\x03\x0e:)" + "\x03\x0e:/\x03\xcfs'\x03\x0d=\x0f\x03\x0d+*\x03\x0d99\x03\x0d9;\x03\x0d9" + "?\x03\x0d)\x0d\x03\x0d(%\x02\x01\x18\x02\x01(\x02\x01\x1e\x03\x0f$!\x03" + "\x0f87\x03\x0f4\x0e\x03\x0f5\x1d\x03\x06'\x03\x03\x0f\x08\x18\x03\x0f" + "\x0d\x1b\x03\x0e2=\x03\x0e;\x08\x03\x0e:\x0b\x03\x0e\x06$\x03\x0e\x0d)" + "\x03\x0e\x16\x1f\x03\x0e\x16\x1b\x03\x0d$\x0a\x03\x05,\x1d\x03\x0d. \x03" + "\x0d.#\x03\x0c(/\x03\x09%\x02\x03\x0d90\x03\x0d\x0e4\x03\x0d\x0d\x0f\x03" + "\x0c#\x00\x03\x0c,\x1e\x03\x0c2\x0e\x03\x0c\x01\x17\x03\x0c\x09:\x03\x0e" + "\x173\x03\x0c\x08\x03\x03\x0c\x11\x07\x03\x0c\x10\x18\x03\x0c\x1f\x1c" + "\x03\x0c\x19\x0e\x03\x0c\x1a\x1f\x03\x0f0>\x03\x0b->\x03\x0b<+\x03\x0b8" + "\x13\x03\x0b\x043\x03\x0b\x14\x03\x03\x0b\x16%\x03\x0d\x22&\x03\x0b\x1a" + "\x1a\x03\x0b\x1a\x04\x03\x0a%9\x03\x0a&2\x03\x0a&0\x03\x0a!\x1a\x03\x0a!" + "7\x03\x0a5\x10\x03\x0a=4\x03\x0a?\x0e\x03\x0a>\x10\x03\x0a\x00 \x03\x0a" + "\x0f:\x03\x0a\x0f9\x03\x0a\x0b\x0a\x03\x0a\x17%\x03\x0a\x1b-\x03\x09-" + "\x1a\x03\x09,4\x03\x09.,\x03\x09)\x09\x03\x096!\x03\x091\x1f\x03\x093" + "\x16\x03\x0c+\x1f\x03\x098 \x03\x098=\x03\x0c(\x1a\x03\x0c(\x16\x03\x09" + "\x0a+\x03\x09\x16\x12\x03\x09\x13\x0e\x03\x09\x153\x03\x08)!\x03\x09\x1a" + "\x01\x03\x09\x18\x01\x03\x08%#\x03\x08>\x22\x03\x08\x05%\x03\x08\x02*" + "\x03\x08\x15;\x03\x08\x1b7\x03\x0f\x07\x1d\x03\x0f\x04\x03\x03\x070\x0c" + "\x03\x07;\x0b\x03\x07\x08\x17\x03\x07\x12\x06\x03\x06/-\x03\x0671\x03" + "\x065+\x03\x06>7\x03\x06\x049\x03\x05+\x1e\x03\x05,\x17\x03\x05 \x1d\x03" + "\x05\x22\x05\x03\x050\x1d" // lookup returns the trie value for the first UTF-8 encoding in s and // the width in bytes of this encoding. The size will be 0 if s does not // hold enough bytes to complete the encoding. len(s) must be greater than 0. func (t *idnaTrie) lookup(s []byte) (v uint16, sz int) { c0 := s[0] switch { case c0 < 0x80: // is ASCII return idnaValues[c0], 1 case c0 < 0xC2: return 0, 1 // Illegal UTF-8: not a starter, not ASCII. case c0 < 0xE0: // 2-byte UTF-8 if len(s) < 2 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c1), 2 case c0 < 0xF0: // 3-byte UTF-8 if len(s) < 3 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = idnaIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c2), 3 case c0 < 0xF8: // 4-byte UTF-8 if len(s) < 4 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = idnaIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } o = uint32(i)<<6 + uint32(c2) i = idnaIndex[o] c3 := s[3] if c3 < 0x80 || 0xC0 <= c3 { return 0, 3 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c3), 4 } // Illegal rune return 0, 1 } // lookupUnsafe returns the trie value for the first UTF-8 encoding in s. // s must start with a full and valid UTF-8 encoded rune. func (t *idnaTrie) lookupUnsafe(s []byte) uint16 { c0 := s[0] if c0 < 0x80 { // is ASCII return idnaValues[c0] } i := idnaIndex[c0] if c0 < 0xE0 { // 2-byte UTF-8 return t.lookupValue(uint32(i), s[1]) } i = idnaIndex[uint32(i)<<6+uint32(s[1])] if c0 < 0xF0 { // 3-byte UTF-8 return t.lookupValue(uint32(i), s[2]) } i = idnaIndex[uint32(i)<<6+uint32(s[2])] if c0 < 0xF8 { // 4-byte UTF-8 return t.lookupValue(uint32(i), s[3]) } return 0 } // lookupString returns the trie value for the first UTF-8 encoding in s and // the width in bytes of this encoding. The size will be 0 if s does not // hold enough bytes to complete the encoding. len(s) must be greater than 0. func (t *idnaTrie) lookupString(s string) (v uint16, sz int) { c0 := s[0] switch { case c0 < 0x80: // is ASCII return idnaValues[c0], 1 case c0 < 0xC2: return 0, 1 // Illegal UTF-8: not a starter, not ASCII. case c0 < 0xE0: // 2-byte UTF-8 if len(s) < 2 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c1), 2 case c0 < 0xF0: // 3-byte UTF-8 if len(s) < 3 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = idnaIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c2), 3 case c0 < 0xF8: // 4-byte UTF-8 if len(s) < 4 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = idnaIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } o = uint32(i)<<6 + uint32(c2) i = idnaIndex[o] c3 := s[3] if c3 < 0x80 || 0xC0 <= c3 { return 0, 3 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c3), 4 } // Illegal rune return 0, 1 } // lookupStringUnsafe returns the trie value for the first UTF-8 encoding in s. // s must start with a full and valid UTF-8 encoded rune. func (t *idnaTrie) lookupStringUnsafe(s string) uint16 { c0 := s[0] if c0 < 0x80 { // is ASCII return idnaValues[c0] } i := idnaIndex[c0] if c0 < 0xE0 { // 2-byte UTF-8 return t.lookupValue(uint32(i), s[1]) } i = idnaIndex[uint32(i)<<6+uint32(s[1])] if c0 < 0xF0 { // 3-byte UTF-8 return t.lookupValue(uint32(i), s[2]) } i = idnaIndex[uint32(i)<<6+uint32(s[2])] if c0 < 0xF8 { // 4-byte UTF-8 return t.lookupValue(uint32(i), s[3]) } return 0 } // idnaTrie. Total size: 29052 bytes (28.37 KiB). Checksum: ef06e7ecc26f36dd. type idnaTrie struct{} func newIdnaTrie(i int) *idnaTrie { return &idnaTrie{} } // lookupValue determines the type of block n and looks up the value for b. func (t *idnaTrie) lookupValue(n uint32, b byte) uint16 { switch { case n < 125: return uint16(idnaValues[n<<6+uint32(b)]) default: n -= 125 return uint16(idnaSparse.lookup(n, b)) } } // idnaValues: 127 blocks, 8128 entries, 16256 bytes // The third block is the zero block. var idnaValues = [8128]uint16{ // Block 0x0, offset 0x0 0x00: 0x0080, 0x01: 0x0080, 0x02: 0x0080, 0x03: 0x0080, 0x04: 0x0080, 0x05: 0x0080, 0x06: 0x0080, 0x07: 0x0080, 0x08: 0x0080, 0x09: 0x0080, 0x0a: 0x0080, 0x0b: 0x0080, 0x0c: 0x0080, 0x0d: 0x0080, 0x0e: 0x0080, 0x0f: 0x0080, 0x10: 0x0080, 0x11: 0x0080, 0x12: 0x0080, 0x13: 0x0080, 0x14: 0x0080, 0x15: 0x0080, 0x16: 0x0080, 0x17: 0x0080, 0x18: 0x0080, 0x19: 0x0080, 0x1a: 0x0080, 0x1b: 0x0080, 0x1c: 0x0080, 0x1d: 0x0080, 0x1e: 0x0080, 0x1f: 0x0080, 0x20: 0x0080, 0x21: 0x0080, 0x22: 0x0080, 0x23: 0x0080, 0x24: 0x0080, 0x25: 0x0080, 0x26: 0x0080, 0x27: 0x0080, 0x28: 0x0080, 0x29: 0x0080, 0x2a: 0x0080, 0x2b: 0x0080, 0x2c: 0x0080, 0x2d: 0x0008, 0x2e: 0x0008, 0x2f: 0x0080, 0x30: 0x0008, 0x31: 0x0008, 0x32: 0x0008, 0x33: 0x0008, 0x34: 0x0008, 0x35: 0x0008, 0x36: 0x0008, 0x37: 0x0008, 0x38: 0x0008, 0x39: 0x0008, 0x3a: 0x0080, 0x3b: 0x0080, 0x3c: 0x0080, 0x3d: 0x0080, 0x3e: 0x0080, 0x3f: 0x0080, // Block 0x1, offset 0x40 0x40: 0x0080, 0x41: 0xe105, 0x42: 0xe105, 0x43: 0xe105, 0x44: 0xe105, 0x45: 0xe105, 0x46: 0xe105, 0x47: 0xe105, 0x48: 0xe105, 0x49: 0xe105, 0x4a: 0xe105, 0x4b: 0xe105, 0x4c: 0xe105, 0x4d: 0xe105, 0x4e: 0xe105, 0x4f: 0xe105, 0x50: 0xe105, 0x51: 0xe105, 0x52: 0xe105, 0x53: 0xe105, 0x54: 0xe105, 0x55: 0xe105, 0x56: 0xe105, 0x57: 0xe105, 0x58: 0xe105, 0x59: 0xe105, 0x5a: 0xe105, 0x5b: 0x0080, 0x5c: 0x0080, 0x5d: 0x0080, 0x5e: 0x0080, 0x5f: 0x0080, 0x60: 0x0080, 0x61: 0x0008, 0x62: 0x0008, 0x63: 0x0008, 0x64: 0x0008, 0x65: 0x0008, 0x66: 0x0008, 0x67: 0x0008, 0x68: 0x0008, 0x69: 0x0008, 0x6a: 0x0008, 0x6b: 0x0008, 0x6c: 0x0008, 0x6d: 0x0008, 0x6e: 0x0008, 0x6f: 0x0008, 0x70: 0x0008, 0x71: 0x0008, 0x72: 0x0008, 0x73: 0x0008, 0x74: 0x0008, 0x75: 0x0008, 0x76: 0x0008, 0x77: 0x0008, 0x78: 0x0008, 0x79: 0x0008, 0x7a: 0x0008, 0x7b: 0x0080, 0x7c: 0x0080, 0x7d: 0x0080, 0x7e: 0x0080, 0x7f: 0x0080, // Block 0x2, offset 0x80 // Block 0x3, offset 0xc0 0xc0: 0x0040, 0xc1: 0x0040, 0xc2: 0x0040, 0xc3: 0x0040, 0xc4: 0x0040, 0xc5: 0x0040, 0xc6: 0x0040, 0xc7: 0x0040, 0xc8: 0x0040, 0xc9: 0x0040, 0xca: 0x0040, 0xcb: 0x0040, 0xcc: 0x0040, 0xcd: 0x0040, 0xce: 0x0040, 0xcf: 0x0040, 0xd0: 0x0040, 0xd1: 0x0040, 0xd2: 0x0040, 0xd3: 0x0040, 0xd4: 0x0040, 0xd5: 0x0040, 0xd6: 0x0040, 0xd7: 0x0040, 0xd8: 0x0040, 0xd9: 0x0040, 0xda: 0x0040, 0xdb: 0x0040, 0xdc: 0x0040, 0xdd: 0x0040, 0xde: 0x0040, 0xdf: 0x0040, 0xe0: 0x000a, 0xe1: 0x0018, 0xe2: 0x0018, 0xe3: 0x0018, 0xe4: 0x0018, 0xe5: 0x0018, 0xe6: 0x0018, 0xe7: 0x0018, 0xe8: 0x001a, 0xe9: 0x0018, 0xea: 0x0039, 0xeb: 0x0018, 0xec: 0x0018, 0xed: 0x03c0, 0xee: 0x0018, 0xef: 0x004a, 0xf0: 0x0018, 0xf1: 0x0018, 0xf2: 0x0069, 0xf3: 0x0079, 0xf4: 0x008a, 0xf5: 0x0005, 0xf6: 0x0018, 0xf7: 0x0008, 0xf8: 0x00aa, 0xf9: 0x00c9, 0xfa: 0x00d9, 0xfb: 0x0018, 0xfc: 0x00e9, 0xfd: 0x0119, 0xfe: 0x0149, 0xff: 0x0018, // Block 0x4, offset 0x100 0x100: 0xe00d, 0x101: 0x0008, 0x102: 0xe00d, 0x103: 0x0008, 0x104: 0xe00d, 0x105: 0x0008, 0x106: 0xe00d, 0x107: 0x0008, 0x108: 0xe00d, 0x109: 0x0008, 0x10a: 0xe00d, 0x10b: 0x0008, 0x10c: 0xe00d, 0x10d: 0x0008, 0x10e: 0xe00d, 0x10f: 0x0008, 0x110: 0xe00d, 0x111: 0x0008, 0x112: 0xe00d, 0x113: 0x0008, 0x114: 0xe00d, 0x115: 0x0008, 0x116: 0xe00d, 0x117: 0x0008, 0x118: 0xe00d, 0x119: 0x0008, 0x11a: 0xe00d, 0x11b: 0x0008, 0x11c: 0xe00d, 0x11d: 0x0008, 0x11e: 0xe00d, 0x11f: 0x0008, 0x120: 0xe00d, 0x121: 0x0008, 0x122: 0xe00d, 0x123: 0x0008, 0x124: 0xe00d, 0x125: 0x0008, 0x126: 0xe00d, 0x127: 0x0008, 0x128: 0xe00d, 0x129: 0x0008, 0x12a: 0xe00d, 0x12b: 0x0008, 0x12c: 0xe00d, 0x12d: 0x0008, 0x12e: 0xe00d, 0x12f: 0x0008, 0x130: 0x0179, 0x131: 0x0008, 0x132: 0x0035, 0x133: 0x004d, 0x134: 0xe00d, 0x135: 0x0008, 0x136: 0xe00d, 0x137: 0x0008, 0x138: 0x0008, 0x139: 0xe01d, 0x13a: 0x0008, 0x13b: 0xe03d, 0x13c: 0x0008, 0x13d: 0xe01d, 0x13e: 0x0008, 0x13f: 0x0199, // Block 0x5, offset 0x140 0x140: 0x0199, 0x141: 0xe01d, 0x142: 0x0008, 0x143: 0xe03d, 0x144: 0x0008, 0x145: 0xe01d, 0x146: 0x0008, 0x147: 0xe07d, 0x148: 0x0008, 0x149: 0x01b9, 0x14a: 0xe00d, 0x14b: 0x0008, 0x14c: 0xe00d, 0x14d: 0x0008, 0x14e: 0xe00d, 0x14f: 0x0008, 0x150: 0xe00d, 0x151: 0x0008, 0x152: 0xe00d, 0x153: 0x0008, 0x154: 0xe00d, 0x155: 0x0008, 0x156: 0xe00d, 0x157: 0x0008, 0x158: 0xe00d, 0x159: 0x0008, 0x15a: 0xe00d, 0x15b: 0x0008, 0x15c: 0xe00d, 0x15d: 0x0008, 0x15e: 0xe00d, 0x15f: 0x0008, 0x160: 0xe00d, 0x161: 0x0008, 0x162: 0xe00d, 0x163: 0x0008, 0x164: 0xe00d, 0x165: 0x0008, 0x166: 0xe00d, 0x167: 0x0008, 0x168: 0xe00d, 0x169: 0x0008, 0x16a: 0xe00d, 0x16b: 0x0008, 0x16c: 0xe00d, 0x16d: 0x0008, 0x16e: 0xe00d, 0x16f: 0x0008, 0x170: 0xe00d, 0x171: 0x0008, 0x172: 0xe00d, 0x173: 0x0008, 0x174: 0xe00d, 0x175: 0x0008, 0x176: 0xe00d, 0x177: 0x0008, 0x178: 0x0065, 0x179: 0xe01d, 0x17a: 0x0008, 0x17b: 0xe03d, 0x17c: 0x0008, 0x17d: 0xe01d, 0x17e: 0x0008, 0x17f: 0x01d9, // Block 0x6, offset 0x180 0x180: 0x0008, 0x181: 0x007d, 0x182: 0xe00d, 0x183: 0x0008, 0x184: 0xe00d, 0x185: 0x0008, 0x186: 0x007d, 0x187: 0xe07d, 0x188: 0x0008, 0x189: 0x0095, 0x18a: 0x00ad, 0x18b: 0xe03d, 0x18c: 0x0008, 0x18d: 0x0008, 0x18e: 0x00c5, 0x18f: 0x00dd, 0x190: 0x00f5, 0x191: 0xe01d, 0x192: 0x0008, 0x193: 0x010d, 0x194: 0x0125, 0x195: 0x0008, 0x196: 0x013d, 0x197: 0x013d, 0x198: 0xe00d, 0x199: 0x0008, 0x19a: 0x0008, 0x19b: 0x0008, 0x19c: 0x010d, 0x19d: 0x0155, 0x19e: 0x0008, 0x19f: 0x016d, 0x1a0: 0xe00d, 0x1a1: 0x0008, 0x1a2: 0xe00d, 0x1a3: 0x0008, 0x1a4: 0xe00d, 0x1a5: 0x0008, 0x1a6: 0x0185, 0x1a7: 0xe07d, 0x1a8: 0x0008, 0x1a9: 0x019d, 0x1aa: 0x0008, 0x1ab: 0x0008, 0x1ac: 0xe00d, 0x1ad: 0x0008, 0x1ae: 0x0185, 0x1af: 0xe0fd, 0x1b0: 0x0008, 0x1b1: 0x01b5, 0x1b2: 0x01cd, 0x1b3: 0xe03d, 0x1b4: 0x0008, 0x1b5: 0xe01d, 0x1b6: 0x0008, 0x1b7: 0x01e5, 0x1b8: 0xe00d, 0x1b9: 0x0008, 0x1ba: 0x0008, 0x1bb: 0x0008, 0x1bc: 0xe00d, 0x1bd: 0x0008, 0x1be: 0x0008, 0x1bf: 0x0008, // Block 0x7, offset 0x1c0 0x1c0: 0x0008, 0x1c1: 0x0008, 0x1c2: 0x0008, 0x1c3: 0x0008, 0x1c4: 0x01e9, 0x1c5: 0x01e9, 0x1c6: 0x01e9, 0x1c7: 0x01fd, 0x1c8: 0x0215, 0x1c9: 0x022d, 0x1ca: 0x0245, 0x1cb: 0x025d, 0x1cc: 0x0275, 0x1cd: 0xe01d, 0x1ce: 0x0008, 0x1cf: 0xe0fd, 0x1d0: 0x0008, 0x1d1: 0xe01d, 0x1d2: 0x0008, 0x1d3: 0xe03d, 0x1d4: 0x0008, 0x1d5: 0xe01d, 0x1d6: 0x0008, 0x1d7: 0xe07d, 0x1d8: 0x0008, 0x1d9: 0xe01d, 0x1da: 0x0008, 0x1db: 0xe03d, 0x1dc: 0x0008, 0x1dd: 0x0008, 0x1de: 0xe00d, 0x1df: 0x0008, 0x1e0: 0xe00d, 0x1e1: 0x0008, 0x1e2: 0xe00d, 0x1e3: 0x0008, 0x1e4: 0xe00d, 0x1e5: 0x0008, 0x1e6: 0xe00d, 0x1e7: 0x0008, 0x1e8: 0xe00d, 0x1e9: 0x0008, 0x1ea: 0xe00d, 0x1eb: 0x0008, 0x1ec: 0xe00d, 0x1ed: 0x0008, 0x1ee: 0xe00d, 0x1ef: 0x0008, 0x1f0: 0x0008, 0x1f1: 0x028d, 0x1f2: 0x02a5, 0x1f3: 0x02bd, 0x1f4: 0xe00d, 0x1f5: 0x0008, 0x1f6: 0x02d5, 0x1f7: 0x02ed, 0x1f8: 0xe00d, 0x1f9: 0x0008, 0x1fa: 0xe00d, 0x1fb: 0x0008, 0x1fc: 0xe00d, 0x1fd: 0x0008, 0x1fe: 0xe00d, 0x1ff: 0x0008, // Block 0x8, offset 0x200 0x200: 0xe00d, 0x201: 0x0008, 0x202: 0xe00d, 0x203: 0x0008, 0x204: 0xe00d, 0x205: 0x0008, 0x206: 0xe00d, 0x207: 0x0008, 0x208: 0xe00d, 0x209: 0x0008, 0x20a: 0xe00d, 0x20b: 0x0008, 0x20c: 0xe00d, 0x20d: 0x0008, 0x20e: 0xe00d, 0x20f: 0x0008, 0x210: 0xe00d, 0x211: 0x0008, 0x212: 0xe00d, 0x213: 0x0008, 0x214: 0xe00d, 0x215: 0x0008, 0x216: 0xe00d, 0x217: 0x0008, 0x218: 0xe00d, 0x219: 0x0008, 0x21a: 0xe00d, 0x21b: 0x0008, 0x21c: 0xe00d, 0x21d: 0x0008, 0x21e: 0xe00d, 0x21f: 0x0008, 0x220: 0x0305, 0x221: 0x0008, 0x222: 0xe00d, 0x223: 0x0008, 0x224: 0xe00d, 0x225: 0x0008, 0x226: 0xe00d, 0x227: 0x0008, 0x228: 0xe00d, 0x229: 0x0008, 0x22a: 0xe00d, 0x22b: 0x0008, 0x22c: 0xe00d, 0x22d: 0x0008, 0x22e: 0xe00d, 0x22f: 0x0008, 0x230: 0xe00d, 0x231: 0x0008, 0x232: 0xe00d, 0x233: 0x0008, 0x234: 0x0008, 0x235: 0x0008, 0x236: 0x0008, 0x237: 0x0008, 0x238: 0x0008, 0x239: 0x0008, 0x23a: 0x0209, 0x23b: 0xe03d, 0x23c: 0x0008, 0x23d: 0x031d, 0x23e: 0x0229, 0x23f: 0x0008, // Block 0x9, offset 0x240 0x240: 0x0008, 0x241: 0x0008, 0x242: 0x0018, 0x243: 0x0018, 0x244: 0x0018, 0x245: 0x0018, 0x246: 0x0008, 0x247: 0x0008, 0x248: 0x0008, 0x249: 0x0008, 0x24a: 0x0008, 0x24b: 0x0008, 0x24c: 0x0008, 0x24d: 0x0008, 0x24e: 0x0008, 0x24f: 0x0008, 0x250: 0x0008, 0x251: 0x0008, 0x252: 0x0018, 0x253: 0x0018, 0x254: 0x0018, 0x255: 0x0018, 0x256: 0x0018, 0x257: 0x0018, 0x258: 0x029a, 0x259: 0x02ba, 0x25a: 0x02da, 0x25b: 0x02fa, 0x25c: 0x031a, 0x25d: 0x033a, 0x25e: 0x0018, 0x25f: 0x0018, 0x260: 0x03ad, 0x261: 0x0359, 0x262: 0x01d9, 0x263: 0x0369, 0x264: 0x03c5, 0x265: 0x0018, 0x266: 0x0018, 0x267: 0x0018, 0x268: 0x0018, 0x269: 0x0018, 0x26a: 0x0018, 0x26b: 0x0018, 0x26c: 0x0008, 0x26d: 0x0018, 0x26e: 0x0008, 0x26f: 0x0018, 0x270: 0x0018, 0x271: 0x0018, 0x272: 0x0018, 0x273: 0x0018, 0x274: 0x0018, 0x275: 0x0018, 0x276: 0x0018, 0x277: 0x0018, 0x278: 0x0018, 0x279: 0x0018, 0x27a: 0x0018, 0x27b: 0x0018, 0x27c: 0x0018, 0x27d: 0x0018, 0x27e: 0x0018, 0x27f: 0x0018, // Block 0xa, offset 0x280 0x280: 0x03dd, 0x281: 0x03dd, 0x282: 0x3308, 0x283: 0x03f5, 0x284: 0x0379, 0x285: 0x040d, 0x286: 0x3308, 0x287: 0x3308, 0x288: 0x3308, 0x289: 0x3308, 0x28a: 0x3308, 0x28b: 0x3308, 0x28c: 0x3308, 0x28d: 0x3308, 0x28e: 0x3308, 0x28f: 0x33c0, 0x290: 0x3308, 0x291: 0x3308, 0x292: 0x3308, 0x293: 0x3308, 0x294: 0x3308, 0x295: 0x3308, 0x296: 0x3308, 0x297: 0x3308, 0x298: 0x3308, 0x299: 0x3308, 0x29a: 0x3308, 0x29b: 0x3308, 0x29c: 0x3308, 0x29d: 0x3308, 0x29e: 0x3308, 0x29f: 0x3308, 0x2a0: 0x3308, 0x2a1: 0x3308, 0x2a2: 0x3308, 0x2a3: 0x3308, 0x2a4: 0x3308, 0x2a5: 0x3308, 0x2a6: 0x3308, 0x2a7: 0x3308, 0x2a8: 0x3308, 0x2a9: 0x3308, 0x2aa: 0x3308, 0x2ab: 0x3308, 0x2ac: 0x3308, 0x2ad: 0x3308, 0x2ae: 0x3308, 0x2af: 0x3308, 0x2b0: 0xe00d, 0x2b1: 0x0008, 0x2b2: 0xe00d, 0x2b3: 0x0008, 0x2b4: 0x0425, 0x2b5: 0x0008, 0x2b6: 0xe00d, 0x2b7: 0x0008, 0x2b8: 0x0040, 0x2b9: 0x0040, 0x2ba: 0x03a2, 0x2bb: 0x0008, 0x2bc: 0x0008, 0x2bd: 0x0008, 0x2be: 0x03c2, 0x2bf: 0x043d, // Block 0xb, offset 0x2c0 0x2c0: 0x0040, 0x2c1: 0x0040, 0x2c2: 0x0040, 0x2c3: 0x0040, 0x2c4: 0x008a, 0x2c5: 0x03d2, 0x2c6: 0xe155, 0x2c7: 0x0455, 0x2c8: 0xe12d, 0x2c9: 0xe13d, 0x2ca: 0xe12d, 0x2cb: 0x0040, 0x2cc: 0x03dd, 0x2cd: 0x0040, 0x2ce: 0x046d, 0x2cf: 0x0485, 0x2d0: 0x0008, 0x2d1: 0xe105, 0x2d2: 0xe105, 0x2d3: 0xe105, 0x2d4: 0xe105, 0x2d5: 0xe105, 0x2d6: 0xe105, 0x2d7: 0xe105, 0x2d8: 0xe105, 0x2d9: 0xe105, 0x2da: 0xe105, 0x2db: 0xe105, 0x2dc: 0xe105, 0x2dd: 0xe105, 0x2de: 0xe105, 0x2df: 0xe105, 0x2e0: 0x049d, 0x2e1: 0x049d, 0x2e2: 0x0040, 0x2e3: 0x049d, 0x2e4: 0x049d, 0x2e5: 0x049d, 0x2e6: 0x049d, 0x2e7: 0x049d, 0x2e8: 0x049d, 0x2e9: 0x049d, 0x2ea: 0x049d, 0x2eb: 0x049d, 0x2ec: 0x0008, 0x2ed: 0x0008, 0x2ee: 0x0008, 0x2ef: 0x0008, 0x2f0: 0x0008, 0x2f1: 0x0008, 0x2f2: 0x0008, 0x2f3: 0x0008, 0x2f4: 0x0008, 0x2f5: 0x0008, 0x2f6: 0x0008, 0x2f7: 0x0008, 0x2f8: 0x0008, 0x2f9: 0x0008, 0x2fa: 0x0008, 0x2fb: 0x0008, 0x2fc: 0x0008, 0x2fd: 0x0008, 0x2fe: 0x0008, 0x2ff: 0x0008, // Block 0xc, offset 0x300 0x300: 0x0008, 0x301: 0x0008, 0x302: 0xe00f, 0x303: 0x0008, 0x304: 0x0008, 0x305: 0x0008, 0x306: 0x0008, 0x307: 0x0008, 0x308: 0x0008, 0x309: 0x0008, 0x30a: 0x0008, 0x30b: 0x0008, 0x30c: 0x0008, 0x30d: 0x0008, 0x30e: 0x0008, 0x30f: 0xe0c5, 0x310: 0x04b5, 0x311: 0x04cd, 0x312: 0xe0bd, 0x313: 0xe0f5, 0x314: 0xe0fd, 0x315: 0xe09d, 0x316: 0xe0b5, 0x317: 0x0008, 0x318: 0xe00d, 0x319: 0x0008, 0x31a: 0xe00d, 0x31b: 0x0008, 0x31c: 0xe00d, 0x31d: 0x0008, 0x31e: 0xe00d, 0x31f: 0x0008, 0x320: 0xe00d, 0x321: 0x0008, 0x322: 0xe00d, 0x323: 0x0008, 0x324: 0xe00d, 0x325: 0x0008, 0x326: 0xe00d, 0x327: 0x0008, 0x328: 0xe00d, 0x329: 0x0008, 0x32a: 0xe00d, 0x32b: 0x0008, 0x32c: 0xe00d, 0x32d: 0x0008, 0x32e: 0xe00d, 0x32f: 0x0008, 0x330: 0x04e5, 0x331: 0xe185, 0x332: 0xe18d, 0x333: 0x0008, 0x334: 0x04fd, 0x335: 0x03dd, 0x336: 0x0018, 0x337: 0xe07d, 0x338: 0x0008, 0x339: 0xe1d5, 0x33a: 0xe00d, 0x33b: 0x0008, 0x33c: 0x0008, 0x33d: 0x0515, 0x33e: 0x052d, 0x33f: 0x052d, // Block 0xd, offset 0x340 0x340: 0x0008, 0x341: 0x0008, 0x342: 0x0008, 0x343: 0x0008, 0x344: 0x0008, 0x345: 0x0008, 0x346: 0x0008, 0x347: 0x0008, 0x348: 0x0008, 0x349: 0x0008, 0x34a: 0x0008, 0x34b: 0x0008, 0x34c: 0x0008, 0x34d: 0x0008, 0x34e: 0x0008, 0x34f: 0x0008, 0x350: 0x0008, 0x351: 0x0008, 0x352: 0x0008, 0x353: 0x0008, 0x354: 0x0008, 0x355: 0x0008, 0x356: 0x0008, 0x357: 0x0008, 0x358: 0x0008, 0x359: 0x0008, 0x35a: 0x0008, 0x35b: 0x0008, 0x35c: 0x0008, 0x35d: 0x0008, 0x35e: 0x0008, 0x35f: 0x0008, 0x360: 0xe00d, 0x361: 0x0008, 0x362: 0xe00d, 0x363: 0x0008, 0x364: 0xe00d, 0x365: 0x0008, 0x366: 0xe00d, 0x367: 0x0008, 0x368: 0xe00d, 0x369: 0x0008, 0x36a: 0xe00d, 0x36b: 0x0008, 0x36c: 0xe00d, 0x36d: 0x0008, 0x36e: 0xe00d, 0x36f: 0x0008, 0x370: 0xe00d, 0x371: 0x0008, 0x372: 0xe00d, 0x373: 0x0008, 0x374: 0xe00d, 0x375: 0x0008, 0x376: 0xe00d, 0x377: 0x0008, 0x378: 0xe00d, 0x379: 0x0008, 0x37a: 0xe00d, 0x37b: 0x0008, 0x37c: 0xe00d, 0x37d: 0x0008, 0x37e: 0xe00d, 0x37f: 0x0008, // Block 0xe, offset 0x380 0x380: 0xe00d, 0x381: 0x0008, 0x382: 0x0018, 0x383: 0x3308, 0x384: 0x3308, 0x385: 0x3308, 0x386: 0x3308, 0x387: 0x3308, 0x388: 0x3318, 0x389: 0x3318, 0x38a: 0xe00d, 0x38b: 0x0008, 0x38c: 0xe00d, 0x38d: 0x0008, 0x38e: 0xe00d, 0x38f: 0x0008, 0x390: 0xe00d, 0x391: 0x0008, 0x392: 0xe00d, 0x393: 0x0008, 0x394: 0xe00d, 0x395: 0x0008, 0x396: 0xe00d, 0x397: 0x0008, 0x398: 0xe00d, 0x399: 0x0008, 0x39a: 0xe00d, 0x39b: 0x0008, 0x39c: 0xe00d, 0x39d: 0x0008, 0x39e: 0xe00d, 0x39f: 0x0008, 0x3a0: 0xe00d, 0x3a1: 0x0008, 0x3a2: 0xe00d, 0x3a3: 0x0008, 0x3a4: 0xe00d, 0x3a5: 0x0008, 0x3a6: 0xe00d, 0x3a7: 0x0008, 0x3a8: 0xe00d, 0x3a9: 0x0008, 0x3aa: 0xe00d, 0x3ab: 0x0008, 0x3ac: 0xe00d, 0x3ad: 0x0008, 0x3ae: 0xe00d, 0x3af: 0x0008, 0x3b0: 0xe00d, 0x3b1: 0x0008, 0x3b2: 0xe00d, 0x3b3: 0x0008, 0x3b4: 0xe00d, 0x3b5: 0x0008, 0x3b6: 0xe00d, 0x3b7: 0x0008, 0x3b8: 0xe00d, 0x3b9: 0x0008, 0x3ba: 0xe00d, 0x3bb: 0x0008, 0x3bc: 0xe00d, 0x3bd: 0x0008, 0x3be: 0xe00d, 0x3bf: 0x0008, // Block 0xf, offset 0x3c0 0x3c0: 0x0040, 0x3c1: 0xe01d, 0x3c2: 0x0008, 0x3c3: 0xe03d, 0x3c4: 0x0008, 0x3c5: 0xe01d, 0x3c6: 0x0008, 0x3c7: 0xe07d, 0x3c8: 0x0008, 0x3c9: 0xe01d, 0x3ca: 0x0008, 0x3cb: 0xe03d, 0x3cc: 0x0008, 0x3cd: 0xe01d, 0x3ce: 0x0008, 0x3cf: 0x0008, 0x3d0: 0xe00d, 0x3d1: 0x0008, 0x3d2: 0xe00d, 0x3d3: 0x0008, 0x3d4: 0xe00d, 0x3d5: 0x0008, 0x3d6: 0xe00d, 0x3d7: 0x0008, 0x3d8: 0xe00d, 0x3d9: 0x0008, 0x3da: 0xe00d, 0x3db: 0x0008, 0x3dc: 0xe00d, 0x3dd: 0x0008, 0x3de: 0xe00d, 0x3df: 0x0008, 0x3e0: 0xe00d, 0x3e1: 0x0008, 0x3e2: 0xe00d, 0x3e3: 0x0008, 0x3e4: 0xe00d, 0x3e5: 0x0008, 0x3e6: 0xe00d, 0x3e7: 0x0008, 0x3e8: 0xe00d, 0x3e9: 0x0008, 0x3ea: 0xe00d, 0x3eb: 0x0008, 0x3ec: 0xe00d, 0x3ed: 0x0008, 0x3ee: 0xe00d, 0x3ef: 0x0008, 0x3f0: 0xe00d, 0x3f1: 0x0008, 0x3f2: 0xe00d, 0x3f3: 0x0008, 0x3f4: 0xe00d, 0x3f5: 0x0008, 0x3f6: 0xe00d, 0x3f7: 0x0008, 0x3f8: 0xe00d, 0x3f9: 0x0008, 0x3fa: 0xe00d, 0x3fb: 0x0008, 0x3fc: 0xe00d, 0x3fd: 0x0008, 0x3fe: 0xe00d, 0x3ff: 0x0008, // Block 0x10, offset 0x400 0x400: 0xe00d, 0x401: 0x0008, 0x402: 0xe00d, 0x403: 0x0008, 0x404: 0xe00d, 0x405: 0x0008, 0x406: 0xe00d, 0x407: 0x0008, 0x408: 0xe00d, 0x409: 0x0008, 0x40a: 0xe00d, 0x40b: 0x0008, 0x40c: 0xe00d, 0x40d: 0x0008, 0x40e: 0xe00d, 0x40f: 0x0008, 0x410: 0xe00d, 0x411: 0x0008, 0x412: 0xe00d, 0x413: 0x0008, 0x414: 0xe00d, 0x415: 0x0008, 0x416: 0xe00d, 0x417: 0x0008, 0x418: 0xe00d, 0x419: 0x0008, 0x41a: 0xe00d, 0x41b: 0x0008, 0x41c: 0xe00d, 0x41d: 0x0008, 0x41e: 0xe00d, 0x41f: 0x0008, 0x420: 0xe00d, 0x421: 0x0008, 0x422: 0xe00d, 0x423: 0x0008, 0x424: 0xe00d, 0x425: 0x0008, 0x426: 0xe00d, 0x427: 0x0008, 0x428: 0xe00d, 0x429: 0x0008, 0x42a: 0xe00d, 0x42b: 0x0008, 0x42c: 0xe00d, 0x42d: 0x0008, 0x42e: 0xe00d, 0x42f: 0x0008, 0x430: 0x0040, 0x431: 0x03f5, 0x432: 0x03f5, 0x433: 0x03f5, 0x434: 0x03f5, 0x435: 0x03f5, 0x436: 0x03f5, 0x437: 0x03f5, 0x438: 0x03f5, 0x439: 0x03f5, 0x43a: 0x03f5, 0x43b: 0x03f5, 0x43c: 0x03f5, 0x43d: 0x03f5, 0x43e: 0x03f5, 0x43f: 0x03f5, // Block 0x11, offset 0x440 0x440: 0x0840, 0x441: 0x0840, 0x442: 0x0840, 0x443: 0x0840, 0x444: 0x0840, 0x445: 0x0840, 0x446: 0x0018, 0x447: 0x0018, 0x448: 0x0818, 0x449: 0x0018, 0x44a: 0x0018, 0x44b: 0x0818, 0x44c: 0x0018, 0x44d: 0x0818, 0x44e: 0x0018, 0x44f: 0x0018, 0x450: 0x3308, 0x451: 0x3308, 0x452: 0x3308, 0x453: 0x3308, 0x454: 0x3308, 0x455: 0x3308, 0x456: 0x3308, 0x457: 0x3308, 0x458: 0x3308, 0x459: 0x3308, 0x45a: 0x3308, 0x45b: 0x0818, 0x45c: 0x0b40, 0x45d: 0x0040, 0x45e: 0x0818, 0x45f: 0x0818, 0x460: 0x0a08, 0x461: 0x0808, 0x462: 0x0c08, 0x463: 0x0c08, 0x464: 0x0c08, 0x465: 0x0c08, 0x466: 0x0a08, 0x467: 0x0c08, 0x468: 0x0a08, 0x469: 0x0c08, 0x46a: 0x0a08, 0x46b: 0x0a08, 0x46c: 0x0a08, 0x46d: 0x0a08, 0x46e: 0x0a08, 0x46f: 0x0c08, 0x470: 0x0c08, 0x471: 0x0c08, 0x472: 0x0c08, 0x473: 0x0a08, 0x474: 0x0a08, 0x475: 0x0a08, 0x476: 0x0a08, 0x477: 0x0a08, 0x478: 0x0a08, 0x479: 0x0a08, 0x47a: 0x0a08, 0x47b: 0x0a08, 0x47c: 0x0a08, 0x47d: 0x0a08, 0x47e: 0x0a08, 0x47f: 0x0a08, // Block 0x12, offset 0x480 0x480: 0x0818, 0x481: 0x0a08, 0x482: 0x0a08, 0x483: 0x0a08, 0x484: 0x0a08, 0x485: 0x0a08, 0x486: 0x0a08, 0x487: 0x0a08, 0x488: 0x0c08, 0x489: 0x0a08, 0x48a: 0x0a08, 0x48b: 0x3308, 0x48c: 0x3308, 0x48d: 0x3308, 0x48e: 0x3308, 0x48f: 0x3308, 0x490: 0x3308, 0x491: 0x3308, 0x492: 0x3308, 0x493: 0x3308, 0x494: 0x3308, 0x495: 0x3308, 0x496: 0x3308, 0x497: 0x3308, 0x498: 0x3308, 0x499: 0x3308, 0x49a: 0x3308, 0x49b: 0x3308, 0x49c: 0x3308, 0x49d: 0x3308, 0x49e: 0x3308, 0x49f: 0x3308, 0x4a0: 0x0808, 0x4a1: 0x0808, 0x4a2: 0x0808, 0x4a3: 0x0808, 0x4a4: 0x0808, 0x4a5: 0x0808, 0x4a6: 0x0808, 0x4a7: 0x0808, 0x4a8: 0x0808, 0x4a9: 0x0808, 0x4aa: 0x0018, 0x4ab: 0x0818, 0x4ac: 0x0818, 0x4ad: 0x0818, 0x4ae: 0x0a08, 0x4af: 0x0a08, 0x4b0: 0x3308, 0x4b1: 0x0c08, 0x4b2: 0x0c08, 0x4b3: 0x0c08, 0x4b4: 0x0808, 0x4b5: 0x0429, 0x4b6: 0x0451, 0x4b7: 0x0479, 0x4b8: 0x04a1, 0x4b9: 0x0a08, 0x4ba: 0x0a08, 0x4bb: 0x0a08, 0x4bc: 0x0a08, 0x4bd: 0x0a08, 0x4be: 0x0a08, 0x4bf: 0x0a08, // Block 0x13, offset 0x4c0 0x4c0: 0x0c08, 0x4c1: 0x0a08, 0x4c2: 0x0a08, 0x4c3: 0x0c08, 0x4c4: 0x0c08, 0x4c5: 0x0c08, 0x4c6: 0x0c08, 0x4c7: 0x0c08, 0x4c8: 0x0c08, 0x4c9: 0x0c08, 0x4ca: 0x0c08, 0x4cb: 0x0c08, 0x4cc: 0x0a08, 0x4cd: 0x0c08, 0x4ce: 0x0a08, 0x4cf: 0x0c08, 0x4d0: 0x0a08, 0x4d1: 0x0a08, 0x4d2: 0x0c08, 0x4d3: 0x0c08, 0x4d4: 0x0818, 0x4d5: 0x0c08, 0x4d6: 0x3308, 0x4d7: 0x3308, 0x4d8: 0x3308, 0x4d9: 0x3308, 0x4da: 0x3308, 0x4db: 0x3308, 0x4dc: 0x3308, 0x4dd: 0x0840, 0x4de: 0x0018, 0x4df: 0x3308, 0x4e0: 0x3308, 0x4e1: 0x3308, 0x4e2: 0x3308, 0x4e3: 0x3308, 0x4e4: 0x3308, 0x4e5: 0x0808, 0x4e6: 0x0808, 0x4e7: 0x3308, 0x4e8: 0x3308, 0x4e9: 0x0018, 0x4ea: 0x3308, 0x4eb: 0x3308, 0x4ec: 0x3308, 0x4ed: 0x3308, 0x4ee: 0x0c08, 0x4ef: 0x0c08, 0x4f0: 0x0008, 0x4f1: 0x0008, 0x4f2: 0x0008, 0x4f3: 0x0008, 0x4f4: 0x0008, 0x4f5: 0x0008, 0x4f6: 0x0008, 0x4f7: 0x0008, 0x4f8: 0x0008, 0x4f9: 0x0008, 0x4fa: 0x0a08, 0x4fb: 0x0a08, 0x4fc: 0x0a08, 0x4fd: 0x0808, 0x4fe: 0x0808, 0x4ff: 0x0a08, // Block 0x14, offset 0x500 0x500: 0x0818, 0x501: 0x0818, 0x502: 0x0818, 0x503: 0x0818, 0x504: 0x0818, 0x505: 0x0818, 0x506: 0x0818, 0x507: 0x0818, 0x508: 0x0818, 0x509: 0x0818, 0x50a: 0x0818, 0x50b: 0x0818, 0x50c: 0x0818, 0x50d: 0x0818, 0x50e: 0x0040, 0x50f: 0x0b40, 0x510: 0x0c08, 0x511: 0x3308, 0x512: 0x0a08, 0x513: 0x0a08, 0x514: 0x0a08, 0x515: 0x0c08, 0x516: 0x0c08, 0x517: 0x0c08, 0x518: 0x0c08, 0x519: 0x0c08, 0x51a: 0x0a08, 0x51b: 0x0a08, 0x51c: 0x0a08, 0x51d: 0x0a08, 0x51e: 0x0c08, 0x51f: 0x0a08, 0x520: 0x0a08, 0x521: 0x0a08, 0x522: 0x0a08, 0x523: 0x0a08, 0x524: 0x0a08, 0x525: 0x0a08, 0x526: 0x0a08, 0x527: 0x0a08, 0x528: 0x0c08, 0x529: 0x0a08, 0x52a: 0x0c08, 0x52b: 0x0a08, 0x52c: 0x0c08, 0x52d: 0x0a08, 0x52e: 0x0a08, 0x52f: 0x0c08, 0x530: 0x3308, 0x531: 0x3308, 0x532: 0x3308, 0x533: 0x3308, 0x534: 0x3308, 0x535: 0x3308, 0x536: 0x3308, 0x537: 0x3308, 0x538: 0x3308, 0x539: 0x3308, 0x53a: 0x3308, 0x53b: 0x3308, 0x53c: 0x3308, 0x53d: 0x3308, 0x53e: 0x3308, 0x53f: 0x3308, // Block 0x15, offset 0x540 0x540: 0x0c08, 0x541: 0x0a08, 0x542: 0x0a08, 0x543: 0x0a08, 0x544: 0x0a08, 0x545: 0x0a08, 0x546: 0x0c08, 0x547: 0x0c08, 0x548: 0x0a08, 0x549: 0x0c08, 0x54a: 0x0a08, 0x54b: 0x0a08, 0x54c: 0x0a08, 0x54d: 0x0a08, 0x54e: 0x0a08, 0x54f: 0x0a08, 0x550: 0x0a08, 0x551: 0x0a08, 0x552: 0x0a08, 0x553: 0x0a08, 0x554: 0x0c08, 0x555: 0x0a08, 0x556: 0x0808, 0x557: 0x0808, 0x558: 0x0808, 0x559: 0x3308, 0x55a: 0x3308, 0x55b: 0x3308, 0x55c: 0x0040, 0x55d: 0x0040, 0x55e: 0x0818, 0x55f: 0x0040, 0x560: 0x0a08, 0x561: 0x0808, 0x562: 0x0a08, 0x563: 0x0a08, 0x564: 0x0a08, 0x565: 0x0a08, 0x566: 0x0808, 0x567: 0x0c08, 0x568: 0x0a08, 0x569: 0x0c08, 0x56a: 0x0c08, 0x56b: 0x0040, 0x56c: 0x0040, 0x56d: 0x0040, 0x56e: 0x0040, 0x56f: 0x0040, 0x570: 0x0040, 0x571: 0x0040, 0x572: 0x0040, 0x573: 0x0040, 0x574: 0x0040, 0x575: 0x0040, 0x576: 0x0040, 0x577: 0x0040, 0x578: 0x0040, 0x579: 0x0040, 0x57a: 0x0040, 0x57b: 0x0040, 0x57c: 0x0040, 0x57d: 0x0040, 0x57e: 0x0040, 0x57f: 0x0040, // Block 0x16, offset 0x580 0x580: 0x3008, 0x581: 0x3308, 0x582: 0x3308, 0x583: 0x3308, 0x584: 0x3308, 0x585: 0x3308, 0x586: 0x3308, 0x587: 0x3308, 0x588: 0x3308, 0x589: 0x3008, 0x58a: 0x3008, 0x58b: 0x3008, 0x58c: 0x3008, 0x58d: 0x3b08, 0x58e: 0x3008, 0x58f: 0x3008, 0x590: 0x0008, 0x591: 0x3308, 0x592: 0x3308, 0x593: 0x3308, 0x594: 0x3308, 0x595: 0x3308, 0x596: 0x3308, 0x597: 0x3308, 0x598: 0x04c9, 0x599: 0x0501, 0x59a: 0x0539, 0x59b: 0x0571, 0x59c: 0x05a9, 0x59d: 0x05e1, 0x59e: 0x0619, 0x59f: 0x0651, 0x5a0: 0x0008, 0x5a1: 0x0008, 0x5a2: 0x3308, 0x5a3: 0x3308, 0x5a4: 0x0018, 0x5a5: 0x0018, 0x5a6: 0x0008, 0x5a7: 0x0008, 0x5a8: 0x0008, 0x5a9: 0x0008, 0x5aa: 0x0008, 0x5ab: 0x0008, 0x5ac: 0x0008, 0x5ad: 0x0008, 0x5ae: 0x0008, 0x5af: 0x0008, 0x5b0: 0x0018, 0x5b1: 0x0008, 0x5b2: 0x0008, 0x5b3: 0x0008, 0x5b4: 0x0008, 0x5b5: 0x0008, 0x5b6: 0x0008, 0x5b7: 0x0008, 0x5b8: 0x0008, 0x5b9: 0x0008, 0x5ba: 0x0008, 0x5bb: 0x0008, 0x5bc: 0x0008, 0x5bd: 0x0008, 0x5be: 0x0008, 0x5bf: 0x0008, // Block 0x17, offset 0x5c0 0x5c0: 0x0008, 0x5c1: 0x3308, 0x5c2: 0x3008, 0x5c3: 0x3008, 0x5c4: 0x0040, 0x5c5: 0x0008, 0x5c6: 0x0008, 0x5c7: 0x0008, 0x5c8: 0x0008, 0x5c9: 0x0008, 0x5ca: 0x0008, 0x5cb: 0x0008, 0x5cc: 0x0008, 0x5cd: 0x0040, 0x5ce: 0x0040, 0x5cf: 0x0008, 0x5d0: 0x0008, 0x5d1: 0x0040, 0x5d2: 0x0040, 0x5d3: 0x0008, 0x5d4: 0x0008, 0x5d5: 0x0008, 0x5d6: 0x0008, 0x5d7: 0x0008, 0x5d8: 0x0008, 0x5d9: 0x0008, 0x5da: 0x0008, 0x5db: 0x0008, 0x5dc: 0x0008, 0x5dd: 0x0008, 0x5de: 0x0008, 0x5df: 0x0008, 0x5e0: 0x0008, 0x5e1: 0x0008, 0x5e2: 0x0008, 0x5e3: 0x0008, 0x5e4: 0x0008, 0x5e5: 0x0008, 0x5e6: 0x0008, 0x5e7: 0x0008, 0x5e8: 0x0008, 0x5e9: 0x0040, 0x5ea: 0x0008, 0x5eb: 0x0008, 0x5ec: 0x0008, 0x5ed: 0x0008, 0x5ee: 0x0008, 0x5ef: 0x0008, 0x5f0: 0x0008, 0x5f1: 0x0040, 0x5f2: 0x0008, 0x5f3: 0x0040, 0x5f4: 0x0040, 0x5f5: 0x0040, 0x5f6: 0x0008, 0x5f7: 0x0008, 0x5f8: 0x0008, 0x5f9: 0x0008, 0x5fa: 0x0040, 0x5fb: 0x0040, 0x5fc: 0x3308, 0x5fd: 0x0008, 0x5fe: 0x3008, 0x5ff: 0x3008, // Block 0x18, offset 0x600 0x600: 0x3008, 0x601: 0x3308, 0x602: 0x3308, 0x603: 0x3308, 0x604: 0x3308, 0x605: 0x0040, 0x606: 0x0040, 0x607: 0x3008, 0x608: 0x3008, 0x609: 0x0040, 0x60a: 0x0040, 0x60b: 0x3008, 0x60c: 0x3008, 0x60d: 0x3b08, 0x60e: 0x0008, 0x60f: 0x0040, 0x610: 0x0040, 0x611: 0x0040, 0x612: 0x0040, 0x613: 0x0040, 0x614: 0x0040, 0x615: 0x0040, 0x616: 0x0040, 0x617: 0x3008, 0x618: 0x0040, 0x619: 0x0040, 0x61a: 0x0040, 0x61b: 0x0040, 0x61c: 0x0689, 0x61d: 0x06c1, 0x61e: 0x0040, 0x61f: 0x06f9, 0x620: 0x0008, 0x621: 0x0008, 0x622: 0x3308, 0x623: 0x3308, 0x624: 0x0040, 0x625: 0x0040, 0x626: 0x0008, 0x627: 0x0008, 0x628: 0x0008, 0x629: 0x0008, 0x62a: 0x0008, 0x62b: 0x0008, 0x62c: 0x0008, 0x62d: 0x0008, 0x62e: 0x0008, 0x62f: 0x0008, 0x630: 0x0008, 0x631: 0x0008, 0x632: 0x0018, 0x633: 0x0018, 0x634: 0x0018, 0x635: 0x0018, 0x636: 0x0018, 0x637: 0x0018, 0x638: 0x0018, 0x639: 0x0018, 0x63a: 0x0018, 0x63b: 0x0018, 0x63c: 0x0008, 0x63d: 0x0018, 0x63e: 0x0040, 0x63f: 0x0040, // Block 0x19, offset 0x640 0x640: 0x0040, 0x641: 0x3308, 0x642: 0x3308, 0x643: 0x3008, 0x644: 0x0040, 0x645: 0x0008, 0x646: 0x0008, 0x647: 0x0008, 0x648: 0x0008, 0x649: 0x0008, 0x64a: 0x0008, 0x64b: 0x0040, 0x64c: 0x0040, 0x64d: 0x0040, 0x64e: 0x0040, 0x64f: 0x0008, 0x650: 0x0008, 0x651: 0x0040, 0x652: 0x0040, 0x653: 0x0008, 0x654: 0x0008, 0x655: 0x0008, 0x656: 0x0008, 0x657: 0x0008, 0x658: 0x0008, 0x659: 0x0008, 0x65a: 0x0008, 0x65b: 0x0008, 0x65c: 0x0008, 0x65d: 0x0008, 0x65e: 0x0008, 0x65f: 0x0008, 0x660: 0x0008, 0x661: 0x0008, 0x662: 0x0008, 0x663: 0x0008, 0x664: 0x0008, 0x665: 0x0008, 0x666: 0x0008, 0x667: 0x0008, 0x668: 0x0008, 0x669: 0x0040, 0x66a: 0x0008, 0x66b: 0x0008, 0x66c: 0x0008, 0x66d: 0x0008, 0x66e: 0x0008, 0x66f: 0x0008, 0x670: 0x0008, 0x671: 0x0040, 0x672: 0x0008, 0x673: 0x0731, 0x674: 0x0040, 0x675: 0x0008, 0x676: 0x0769, 0x677: 0x0040, 0x678: 0x0008, 0x679: 0x0008, 0x67a: 0x0040, 0x67b: 0x0040, 0x67c: 0x3308, 0x67d: 0x0040, 0x67e: 0x3008, 0x67f: 0x3008, // Block 0x1a, offset 0x680 0x680: 0x3008, 0x681: 0x3308, 0x682: 0x3308, 0x683: 0x0040, 0x684: 0x0040, 0x685: 0x0040, 0x686: 0x0040, 0x687: 0x3308, 0x688: 0x3308, 0x689: 0x0040, 0x68a: 0x0040, 0x68b: 0x3308, 0x68c: 0x3308, 0x68d: 0x3b08, 0x68e: 0x0040, 0x68f: 0x0040, 0x690: 0x0040, 0x691: 0x3308, 0x692: 0x0040, 0x693: 0x0040, 0x694: 0x0040, 0x695: 0x0040, 0x696: 0x0040, 0x697: 0x0040, 0x698: 0x0040, 0x699: 0x07a1, 0x69a: 0x07d9, 0x69b: 0x0811, 0x69c: 0x0008, 0x69d: 0x0040, 0x69e: 0x0849, 0x69f: 0x0040, 0x6a0: 0x0040, 0x6a1: 0x0040, 0x6a2: 0x0040, 0x6a3: 0x0040, 0x6a4: 0x0040, 0x6a5: 0x0040, 0x6a6: 0x0008, 0x6a7: 0x0008, 0x6a8: 0x0008, 0x6a9: 0x0008, 0x6aa: 0x0008, 0x6ab: 0x0008, 0x6ac: 0x0008, 0x6ad: 0x0008, 0x6ae: 0x0008, 0x6af: 0x0008, 0x6b0: 0x3308, 0x6b1: 0x3308, 0x6b2: 0x0008, 0x6b3: 0x0008, 0x6b4: 0x0008, 0x6b5: 0x3308, 0x6b6: 0x0040, 0x6b7: 0x0040, 0x6b8: 0x0040, 0x6b9: 0x0040, 0x6ba: 0x0040, 0x6bb: 0x0040, 0x6bc: 0x0040, 0x6bd: 0x0040, 0x6be: 0x0040, 0x6bf: 0x0040, // Block 0x1b, offset 0x6c0 0x6c0: 0x0040, 0x6c1: 0x3308, 0x6c2: 0x3308, 0x6c3: 0x3008, 0x6c4: 0x0040, 0x6c5: 0x0008, 0x6c6: 0x0008, 0x6c7: 0x0008, 0x6c8: 0x0008, 0x6c9: 0x0008, 0x6ca: 0x0008, 0x6cb: 0x0008, 0x6cc: 0x0008, 0x6cd: 0x0008, 0x6ce: 0x0040, 0x6cf: 0x0008, 0x6d0: 0x0008, 0x6d1: 0x0008, 0x6d2: 0x0040, 0x6d3: 0x0008, 0x6d4: 0x0008, 0x6d5: 0x0008, 0x6d6: 0x0008, 0x6d7: 0x0008, 0x6d8: 0x0008, 0x6d9: 0x0008, 0x6da: 0x0008, 0x6db: 0x0008, 0x6dc: 0x0008, 0x6dd: 0x0008, 0x6de: 0x0008, 0x6df: 0x0008, 0x6e0: 0x0008, 0x6e1: 0x0008, 0x6e2: 0x0008, 0x6e3: 0x0008, 0x6e4: 0x0008, 0x6e5: 0x0008, 0x6e6: 0x0008, 0x6e7: 0x0008, 0x6e8: 0x0008, 0x6e9: 0x0040, 0x6ea: 0x0008, 0x6eb: 0x0008, 0x6ec: 0x0008, 0x6ed: 0x0008, 0x6ee: 0x0008, 0x6ef: 0x0008, 0x6f0: 0x0008, 0x6f1: 0x0040, 0x6f2: 0x0008, 0x6f3: 0x0008, 0x6f4: 0x0040, 0x6f5: 0x0008, 0x6f6: 0x0008, 0x6f7: 0x0008, 0x6f8: 0x0008, 0x6f9: 0x0008, 0x6fa: 0x0040, 0x6fb: 0x0040, 0x6fc: 0x3308, 0x6fd: 0x0008, 0x6fe: 0x3008, 0x6ff: 0x3008, // Block 0x1c, offset 0x700 0x700: 0x3008, 0x701: 0x3308, 0x702: 0x3308, 0x703: 0x3308, 0x704: 0x3308, 0x705: 0x3308, 0x706: 0x0040, 0x707: 0x3308, 0x708: 0x3308, 0x709: 0x3008, 0x70a: 0x0040, 0x70b: 0x3008, 0x70c: 0x3008, 0x70d: 0x3b08, 0x70e: 0x0040, 0x70f: 0x0040, 0x710: 0x0008, 0x711: 0x0040, 0x712: 0x0040, 0x713: 0x0040, 0x714: 0x0040, 0x715: 0x0040, 0x716: 0x0040, 0x717: 0x0040, 0x718: 0x0040, 0x719: 0x0040, 0x71a: 0x0040, 0x71b: 0x0040, 0x71c: 0x0040, 0x71d: 0x0040, 0x71e: 0x0040, 0x71f: 0x0040, 0x720: 0x0008, 0x721: 0x0008, 0x722: 0x3308, 0x723: 0x3308, 0x724: 0x0040, 0x725: 0x0040, 0x726: 0x0008, 0x727: 0x0008, 0x728: 0x0008, 0x729: 0x0008, 0x72a: 0x0008, 0x72b: 0x0008, 0x72c: 0x0008, 0x72d: 0x0008, 0x72e: 0x0008, 0x72f: 0x0008, 0x730: 0x0018, 0x731: 0x0018, 0x732: 0x0040, 0x733: 0x0040, 0x734: 0x0040, 0x735: 0x0040, 0x736: 0x0040, 0x737: 0x0040, 0x738: 0x0040, 0x739: 0x0008, 0x73a: 0x3308, 0x73b: 0x3308, 0x73c: 0x3308, 0x73d: 0x3308, 0x73e: 0x3308, 0x73f: 0x3308, // Block 0x1d, offset 0x740 0x740: 0x0040, 0x741: 0x3308, 0x742: 0x3008, 0x743: 0x3008, 0x744: 0x0040, 0x745: 0x0008, 0x746: 0x0008, 0x747: 0x0008, 0x748: 0x0008, 0x749: 0x0008, 0x74a: 0x0008, 0x74b: 0x0008, 0x74c: 0x0008, 0x74d: 0x0040, 0x74e: 0x0040, 0x74f: 0x0008, 0x750: 0x0008, 0x751: 0x0040, 0x752: 0x0040, 0x753: 0x0008, 0x754: 0x0008, 0x755: 0x0008, 0x756: 0x0008, 0x757: 0x0008, 0x758: 0x0008, 0x759: 0x0008, 0x75a: 0x0008, 0x75b: 0x0008, 0x75c: 0x0008, 0x75d: 0x0008, 0x75e: 0x0008, 0x75f: 0x0008, 0x760: 0x0008, 0x761: 0x0008, 0x762: 0x0008, 0x763: 0x0008, 0x764: 0x0008, 0x765: 0x0008, 0x766: 0x0008, 0x767: 0x0008, 0x768: 0x0008, 0x769: 0x0040, 0x76a: 0x0008, 0x76b: 0x0008, 0x76c: 0x0008, 0x76d: 0x0008, 0x76e: 0x0008, 0x76f: 0x0008, 0x770: 0x0008, 0x771: 0x0040, 0x772: 0x0008, 0x773: 0x0008, 0x774: 0x0040, 0x775: 0x0008, 0x776: 0x0008, 0x777: 0x0008, 0x778: 0x0008, 0x779: 0x0008, 0x77a: 0x0040, 0x77b: 0x0040, 0x77c: 0x3308, 0x77d: 0x0008, 0x77e: 0x3008, 0x77f: 0x3308, // Block 0x1e, offset 0x780 0x780: 0x3008, 0x781: 0x3308, 0x782: 0x3308, 0x783: 0x3308, 0x784: 0x3308, 0x785: 0x0040, 0x786: 0x0040, 0x787: 0x3008, 0x788: 0x3008, 0x789: 0x0040, 0x78a: 0x0040, 0x78b: 0x3008, 0x78c: 0x3008, 0x78d: 0x3b08, 0x78e: 0x0040, 0x78f: 0x0040, 0x790: 0x0040, 0x791: 0x0040, 0x792: 0x0040, 0x793: 0x0040, 0x794: 0x0040, 0x795: 0x0040, 0x796: 0x3308, 0x797: 0x3008, 0x798: 0x0040, 0x799: 0x0040, 0x79a: 0x0040, 0x79b: 0x0040, 0x79c: 0x0881, 0x79d: 0x08b9, 0x79e: 0x0040, 0x79f: 0x0008, 0x7a0: 0x0008, 0x7a1: 0x0008, 0x7a2: 0x3308, 0x7a3: 0x3308, 0x7a4: 0x0040, 0x7a5: 0x0040, 0x7a6: 0x0008, 0x7a7: 0x0008, 0x7a8: 0x0008, 0x7a9: 0x0008, 0x7aa: 0x0008, 0x7ab: 0x0008, 0x7ac: 0x0008, 0x7ad: 0x0008, 0x7ae: 0x0008, 0x7af: 0x0008, 0x7b0: 0x0018, 0x7b1: 0x0008, 0x7b2: 0x0018, 0x7b3: 0x0018, 0x7b4: 0x0018, 0x7b5: 0x0018, 0x7b6: 0x0018, 0x7b7: 0x0018, 0x7b8: 0x0040, 0x7b9: 0x0040, 0x7ba: 0x0040, 0x7bb: 0x0040, 0x7bc: 0x0040, 0x7bd: 0x0040, 0x7be: 0x0040, 0x7bf: 0x0040, // Block 0x1f, offset 0x7c0 0x7c0: 0x0040, 0x7c1: 0x0040, 0x7c2: 0x3308, 0x7c3: 0x0008, 0x7c4: 0x0040, 0x7c5: 0x0008, 0x7c6: 0x0008, 0x7c7: 0x0008, 0x7c8: 0x0008, 0x7c9: 0x0008, 0x7ca: 0x0008, 0x7cb: 0x0040, 0x7cc: 0x0040, 0x7cd: 0x0040, 0x7ce: 0x0008, 0x7cf: 0x0008, 0x7d0: 0x0008, 0x7d1: 0x0040, 0x7d2: 0x0008, 0x7d3: 0x0008, 0x7d4: 0x0008, 0x7d5: 0x0008, 0x7d6: 0x0040, 0x7d7: 0x0040, 0x7d8: 0x0040, 0x7d9: 0x0008, 0x7da: 0x0008, 0x7db: 0x0040, 0x7dc: 0x0008, 0x7dd: 0x0040, 0x7de: 0x0008, 0x7df: 0x0008, 0x7e0: 0x0040, 0x7e1: 0x0040, 0x7e2: 0x0040, 0x7e3: 0x0008, 0x7e4: 0x0008, 0x7e5: 0x0040, 0x7e6: 0x0040, 0x7e7: 0x0040, 0x7e8: 0x0008, 0x7e9: 0x0008, 0x7ea: 0x0008, 0x7eb: 0x0040, 0x7ec: 0x0040, 0x7ed: 0x0040, 0x7ee: 0x0008, 0x7ef: 0x0008, 0x7f0: 0x0008, 0x7f1: 0x0008, 0x7f2: 0x0008, 0x7f3: 0x0008, 0x7f4: 0x0008, 0x7f5: 0x0008, 0x7f6: 0x0008, 0x7f7: 0x0008, 0x7f8: 0x0008, 0x7f9: 0x0008, 0x7fa: 0x0040, 0x7fb: 0x0040, 0x7fc: 0x0040, 0x7fd: 0x0040, 0x7fe: 0x3008, 0x7ff: 0x3008, // Block 0x20, offset 0x800 0x800: 0x3308, 0x801: 0x3008, 0x802: 0x3008, 0x803: 0x3008, 0x804: 0x3008, 0x805: 0x0040, 0x806: 0x3308, 0x807: 0x3308, 0x808: 0x3308, 0x809: 0x0040, 0x80a: 0x3308, 0x80b: 0x3308, 0x80c: 0x3308, 0x80d: 0x3b08, 0x80e: 0x0040, 0x80f: 0x0040, 0x810: 0x0040, 0x811: 0x0040, 0x812: 0x0040, 0x813: 0x0040, 0x814: 0x0040, 0x815: 0x3308, 0x816: 0x3308, 0x817: 0x0040, 0x818: 0x0008, 0x819: 0x0008, 0x81a: 0x0008, 0x81b: 0x0040, 0x81c: 0x0040, 0x81d: 0x0040, 0x81e: 0x0040, 0x81f: 0x0040, 0x820: 0x0008, 0x821: 0x0008, 0x822: 0x3308, 0x823: 0x3308, 0x824: 0x0040, 0x825: 0x0040, 0x826: 0x0008, 0x827: 0x0008, 0x828: 0x0008, 0x829: 0x0008, 0x82a: 0x0008, 0x82b: 0x0008, 0x82c: 0x0008, 0x82d: 0x0008, 0x82e: 0x0008, 0x82f: 0x0008, 0x830: 0x0040, 0x831: 0x0040, 0x832: 0x0040, 0x833: 0x0040, 0x834: 0x0040, 0x835: 0x0040, 0x836: 0x0040, 0x837: 0x0040, 0x838: 0x0018, 0x839: 0x0018, 0x83a: 0x0018, 0x83b: 0x0018, 0x83c: 0x0018, 0x83d: 0x0018, 0x83e: 0x0018, 0x83f: 0x0018, // Block 0x21, offset 0x840 0x840: 0x0008, 0x841: 0x3308, 0x842: 0x3008, 0x843: 0x3008, 0x844: 0x0040, 0x845: 0x0008, 0x846: 0x0008, 0x847: 0x0008, 0x848: 0x0008, 0x849: 0x0008, 0x84a: 0x0008, 0x84b: 0x0008, 0x84c: 0x0008, 0x84d: 0x0040, 0x84e: 0x0008, 0x84f: 0x0008, 0x850: 0x0008, 0x851: 0x0040, 0x852: 0x0008, 0x853: 0x0008, 0x854: 0x0008, 0x855: 0x0008, 0x856: 0x0008, 0x857: 0x0008, 0x858: 0x0008, 0x859: 0x0008, 0x85a: 0x0008, 0x85b: 0x0008, 0x85c: 0x0008, 0x85d: 0x0008, 0x85e: 0x0008, 0x85f: 0x0008, 0x860: 0x0008, 0x861: 0x0008, 0x862: 0x0008, 0x863: 0x0008, 0x864: 0x0008, 0x865: 0x0008, 0x866: 0x0008, 0x867: 0x0008, 0x868: 0x0008, 0x869: 0x0040, 0x86a: 0x0008, 0x86b: 0x0008, 0x86c: 0x0008, 0x86d: 0x0008, 0x86e: 0x0008, 0x86f: 0x0008, 0x870: 0x0008, 0x871: 0x0008, 0x872: 0x0008, 0x873: 0x0008, 0x874: 0x0040, 0x875: 0x0008, 0x876: 0x0008, 0x877: 0x0008, 0x878: 0x0008, 0x879: 0x0008, 0x87a: 0x0040, 0x87b: 0x0040, 0x87c: 0x3308, 0x87d: 0x0008, 0x87e: 0x3008, 0x87f: 0x3308, // Block 0x22, offset 0x880 0x880: 0x3008, 0x881: 0x3008, 0x882: 0x3008, 0x883: 0x3008, 0x884: 0x3008, 0x885: 0x0040, 0x886: 0x3308, 0x887: 0x3008, 0x888: 0x3008, 0x889: 0x0040, 0x88a: 0x3008, 0x88b: 0x3008, 0x88c: 0x3308, 0x88d: 0x3b08, 0x88e: 0x0040, 0x88f: 0x0040, 0x890: 0x0040, 0x891: 0x0040, 0x892: 0x0040, 0x893: 0x0040, 0x894: 0x0040, 0x895: 0x3008, 0x896: 0x3008, 0x897: 0x0040, 0x898: 0x0040, 0x899: 0x0040, 0x89a: 0x0040, 0x89b: 0x0040, 0x89c: 0x0040, 0x89d: 0x0040, 0x89e: 0x0008, 0x89f: 0x0040, 0x8a0: 0x0008, 0x8a1: 0x0008, 0x8a2: 0x3308, 0x8a3: 0x3308, 0x8a4: 0x0040, 0x8a5: 0x0040, 0x8a6: 0x0008, 0x8a7: 0x0008, 0x8a8: 0x0008, 0x8a9: 0x0008, 0x8aa: 0x0008, 0x8ab: 0x0008, 0x8ac: 0x0008, 0x8ad: 0x0008, 0x8ae: 0x0008, 0x8af: 0x0008, 0x8b0: 0x0040, 0x8b1: 0x0008, 0x8b2: 0x0008, 0x8b3: 0x0040, 0x8b4: 0x0040, 0x8b5: 0x0040, 0x8b6: 0x0040, 0x8b7: 0x0040, 0x8b8: 0x0040, 0x8b9: 0x0040, 0x8ba: 0x0040, 0x8bb: 0x0040, 0x8bc: 0x0040, 0x8bd: 0x0040, 0x8be: 0x0040, 0x8bf: 0x0040, // Block 0x23, offset 0x8c0 0x8c0: 0x3008, 0x8c1: 0x3308, 0x8c2: 0x3308, 0x8c3: 0x3308, 0x8c4: 0x3308, 0x8c5: 0x0040, 0x8c6: 0x3008, 0x8c7: 0x3008, 0x8c8: 0x3008, 0x8c9: 0x0040, 0x8ca: 0x3008, 0x8cb: 0x3008, 0x8cc: 0x3008, 0x8cd: 0x3b08, 0x8ce: 0x0008, 0x8cf: 0x0018, 0x8d0: 0x0040, 0x8d1: 0x0040, 0x8d2: 0x0040, 0x8d3: 0x0040, 0x8d4: 0x0008, 0x8d5: 0x0008, 0x8d6: 0x0008, 0x8d7: 0x3008, 0x8d8: 0x0018, 0x8d9: 0x0018, 0x8da: 0x0018, 0x8db: 0x0018, 0x8dc: 0x0018, 0x8dd: 0x0018, 0x8de: 0x0018, 0x8df: 0x0008, 0x8e0: 0x0008, 0x8e1: 0x0008, 0x8e2: 0x3308, 0x8e3: 0x3308, 0x8e4: 0x0040, 0x8e5: 0x0040, 0x8e6: 0x0008, 0x8e7: 0x0008, 0x8e8: 0x0008, 0x8e9: 0x0008, 0x8ea: 0x0008, 0x8eb: 0x0008, 0x8ec: 0x0008, 0x8ed: 0x0008, 0x8ee: 0x0008, 0x8ef: 0x0008, 0x8f0: 0x0018, 0x8f1: 0x0018, 0x8f2: 0x0018, 0x8f3: 0x0018, 0x8f4: 0x0018, 0x8f5: 0x0018, 0x8f6: 0x0018, 0x8f7: 0x0018, 0x8f8: 0x0018, 0x8f9: 0x0018, 0x8fa: 0x0008, 0x8fb: 0x0008, 0x8fc: 0x0008, 0x8fd: 0x0008, 0x8fe: 0x0008, 0x8ff: 0x0008, // Block 0x24, offset 0x900 0x900: 0x0040, 0x901: 0x0008, 0x902: 0x0008, 0x903: 0x0040, 0x904: 0x0008, 0x905: 0x0040, 0x906: 0x0040, 0x907: 0x0008, 0x908: 0x0008, 0x909: 0x0040, 0x90a: 0x0008, 0x90b: 0x0040, 0x90c: 0x0040, 0x90d: 0x0008, 0x90e: 0x0040, 0x90f: 0x0040, 0x910: 0x0040, 0x911: 0x0040, 0x912: 0x0040, 0x913: 0x0040, 0x914: 0x0008, 0x915: 0x0008, 0x916: 0x0008, 0x917: 0x0008, 0x918: 0x0040, 0x919: 0x0008, 0x91a: 0x0008, 0x91b: 0x0008, 0x91c: 0x0008, 0x91d: 0x0008, 0x91e: 0x0008, 0x91f: 0x0008, 0x920: 0x0040, 0x921: 0x0008, 0x922: 0x0008, 0x923: 0x0008, 0x924: 0x0040, 0x925: 0x0008, 0x926: 0x0040, 0x927: 0x0008, 0x928: 0x0040, 0x929: 0x0040, 0x92a: 0x0008, 0x92b: 0x0008, 0x92c: 0x0040, 0x92d: 0x0008, 0x92e: 0x0008, 0x92f: 0x0008, 0x930: 0x0008, 0x931: 0x3308, 0x932: 0x0008, 0x933: 0x0929, 0x934: 0x3308, 0x935: 0x3308, 0x936: 0x3308, 0x937: 0x3308, 0x938: 0x3308, 0x939: 0x3308, 0x93a: 0x0040, 0x93b: 0x3308, 0x93c: 0x3308, 0x93d: 0x0008, 0x93e: 0x0040, 0x93f: 0x0040, // Block 0x25, offset 0x940 0x940: 0x0008, 0x941: 0x0008, 0x942: 0x0008, 0x943: 0x09d1, 0x944: 0x0008, 0x945: 0x0008, 0x946: 0x0008, 0x947: 0x0008, 0x948: 0x0040, 0x949: 0x0008, 0x94a: 0x0008, 0x94b: 0x0008, 0x94c: 0x0008, 0x94d: 0x0a09, 0x94e: 0x0008, 0x94f: 0x0008, 0x950: 0x0008, 0x951: 0x0008, 0x952: 0x0a41, 0x953: 0x0008, 0x954: 0x0008, 0x955: 0x0008, 0x956: 0x0008, 0x957: 0x0a79, 0x958: 0x0008, 0x959: 0x0008, 0x95a: 0x0008, 0x95b: 0x0008, 0x95c: 0x0ab1, 0x95d: 0x0008, 0x95e: 0x0008, 0x95f: 0x0008, 0x960: 0x0008, 0x961: 0x0008, 0x962: 0x0008, 0x963: 0x0008, 0x964: 0x0008, 0x965: 0x0008, 0x966: 0x0008, 0x967: 0x0008, 0x968: 0x0008, 0x969: 0x0ae9, 0x96a: 0x0008, 0x96b: 0x0008, 0x96c: 0x0008, 0x96d: 0x0040, 0x96e: 0x0040, 0x96f: 0x0040, 0x970: 0x0040, 0x971: 0x3308, 0x972: 0x3308, 0x973: 0x0b21, 0x974: 0x3308, 0x975: 0x0b59, 0x976: 0x0b91, 0x977: 0x0bc9, 0x978: 0x0c19, 0x979: 0x0c51, 0x97a: 0x3308, 0x97b: 0x3308, 0x97c: 0x3308, 0x97d: 0x3308, 0x97e: 0x3308, 0x97f: 0x3008, // Block 0x26, offset 0x980 0x980: 0x3308, 0x981: 0x0ca1, 0x982: 0x3308, 0x983: 0x3308, 0x984: 0x3b08, 0x985: 0x0018, 0x986: 0x3308, 0x987: 0x3308, 0x988: 0x0008, 0x989: 0x0008, 0x98a: 0x0008, 0x98b: 0x0008, 0x98c: 0x0008, 0x98d: 0x3308, 0x98e: 0x3308, 0x98f: 0x3308, 0x990: 0x3308, 0x991: 0x3308, 0x992: 0x3308, 0x993: 0x0cd9, 0x994: 0x3308, 0x995: 0x3308, 0x996: 0x3308, 0x997: 0x3308, 0x998: 0x0040, 0x999: 0x3308, 0x99a: 0x3308, 0x99b: 0x3308, 0x99c: 0x3308, 0x99d: 0x0d11, 0x99e: 0x3308, 0x99f: 0x3308, 0x9a0: 0x3308, 0x9a1: 0x3308, 0x9a2: 0x0d49, 0x9a3: 0x3308, 0x9a4: 0x3308, 0x9a5: 0x3308, 0x9a6: 0x3308, 0x9a7: 0x0d81, 0x9a8: 0x3308, 0x9a9: 0x3308, 0x9aa: 0x3308, 0x9ab: 0x3308, 0x9ac: 0x0db9, 0x9ad: 0x3308, 0x9ae: 0x3308, 0x9af: 0x3308, 0x9b0: 0x3308, 0x9b1: 0x3308, 0x9b2: 0x3308, 0x9b3: 0x3308, 0x9b4: 0x3308, 0x9b5: 0x3308, 0x9b6: 0x3308, 0x9b7: 0x3308, 0x9b8: 0x3308, 0x9b9: 0x0df1, 0x9ba: 0x3308, 0x9bb: 0x3308, 0x9bc: 0x3308, 0x9bd: 0x0040, 0x9be: 0x0018, 0x9bf: 0x0018, // Block 0x27, offset 0x9c0 0x9c0: 0x0008, 0x9c1: 0x0008, 0x9c2: 0x0008, 0x9c3: 0x0008, 0x9c4: 0x0008, 0x9c5: 0x0008, 0x9c6: 0x0008, 0x9c7: 0x0008, 0x9c8: 0x0008, 0x9c9: 0x0008, 0x9ca: 0x0008, 0x9cb: 0x0008, 0x9cc: 0x0008, 0x9cd: 0x0008, 0x9ce: 0x0008, 0x9cf: 0x0008, 0x9d0: 0x0008, 0x9d1: 0x0008, 0x9d2: 0x0008, 0x9d3: 0x0008, 0x9d4: 0x0008, 0x9d5: 0x0008, 0x9d6: 0x0008, 0x9d7: 0x0008, 0x9d8: 0x0008, 0x9d9: 0x0008, 0x9da: 0x0008, 0x9db: 0x0008, 0x9dc: 0x0008, 0x9dd: 0x0008, 0x9de: 0x0008, 0x9df: 0x0008, 0x9e0: 0x0008, 0x9e1: 0x0008, 0x9e2: 0x0008, 0x9e3: 0x0008, 0x9e4: 0x0008, 0x9e5: 0x0008, 0x9e6: 0x0008, 0x9e7: 0x0008, 0x9e8: 0x0008, 0x9e9: 0x0008, 0x9ea: 0x0008, 0x9eb: 0x0008, 0x9ec: 0x0039, 0x9ed: 0x0ed1, 0x9ee: 0x0ee9, 0x9ef: 0x0008, 0x9f0: 0x0ef9, 0x9f1: 0x0f09, 0x9f2: 0x0f19, 0x9f3: 0x0f31, 0x9f4: 0x0249, 0x9f5: 0x0f41, 0x9f6: 0x0259, 0x9f7: 0x0f51, 0x9f8: 0x0359, 0x9f9: 0x0f61, 0x9fa: 0x0f71, 0x9fb: 0x0008, 0x9fc: 0x00d9, 0x9fd: 0x0f81, 0x9fe: 0x0f99, 0x9ff: 0x0269, // Block 0x28, offset 0xa00 0xa00: 0x0fa9, 0xa01: 0x0fb9, 0xa02: 0x0279, 0xa03: 0x0039, 0xa04: 0x0fc9, 0xa05: 0x0fe1, 0xa06: 0x059d, 0xa07: 0x0ee9, 0xa08: 0x0ef9, 0xa09: 0x0f09, 0xa0a: 0x0ff9, 0xa0b: 0x1011, 0xa0c: 0x1029, 0xa0d: 0x0f31, 0xa0e: 0x0008, 0xa0f: 0x0f51, 0xa10: 0x0f61, 0xa11: 0x1041, 0xa12: 0x00d9, 0xa13: 0x1059, 0xa14: 0x05b5, 0xa15: 0x05b5, 0xa16: 0x0f99, 0xa17: 0x0fa9, 0xa18: 0x0fb9, 0xa19: 0x059d, 0xa1a: 0x1071, 0xa1b: 0x1089, 0xa1c: 0x05cd, 0xa1d: 0x1099, 0xa1e: 0x10b1, 0xa1f: 0x10c9, 0xa20: 0x10e1, 0xa21: 0x10f9, 0xa22: 0x0f41, 0xa23: 0x0269, 0xa24: 0x0fb9, 0xa25: 0x1089, 0xa26: 0x1099, 0xa27: 0x10b1, 0xa28: 0x1111, 0xa29: 0x10e1, 0xa2a: 0x10f9, 0xa2b: 0x0008, 0xa2c: 0x0008, 0xa2d: 0x0008, 0xa2e: 0x0008, 0xa2f: 0x0008, 0xa30: 0x0008, 0xa31: 0x0008, 0xa32: 0x0008, 0xa33: 0x0008, 0xa34: 0x0008, 0xa35: 0x0008, 0xa36: 0x0008, 0xa37: 0x0008, 0xa38: 0x1129, 0xa39: 0x0008, 0xa3a: 0x0008, 0xa3b: 0x0008, 0xa3c: 0x0008, 0xa3d: 0x0008, 0xa3e: 0x0008, 0xa3f: 0x0008, // Block 0x29, offset 0xa40 0xa40: 0x0008, 0xa41: 0x0008, 0xa42: 0x0008, 0xa43: 0x0008, 0xa44: 0x0008, 0xa45: 0x0008, 0xa46: 0x0008, 0xa47: 0x0008, 0xa48: 0x0008, 0xa49: 0x0008, 0xa4a: 0x0008, 0xa4b: 0x0008, 0xa4c: 0x0008, 0xa4d: 0x0008, 0xa4e: 0x0008, 0xa4f: 0x0008, 0xa50: 0x0008, 0xa51: 0x0008, 0xa52: 0x0008, 0xa53: 0x0008, 0xa54: 0x0008, 0xa55: 0x0008, 0xa56: 0x0008, 0xa57: 0x0008, 0xa58: 0x0008, 0xa59: 0x0008, 0xa5a: 0x0008, 0xa5b: 0x1141, 0xa5c: 0x1159, 0xa5d: 0x1169, 0xa5e: 0x1181, 0xa5f: 0x1029, 0xa60: 0x1199, 0xa61: 0x11a9, 0xa62: 0x11c1, 0xa63: 0x11d9, 0xa64: 0x11f1, 0xa65: 0x1209, 0xa66: 0x1221, 0xa67: 0x05e5, 0xa68: 0x1239, 0xa69: 0x1251, 0xa6a: 0xe17d, 0xa6b: 0x1269, 0xa6c: 0x1281, 0xa6d: 0x1299, 0xa6e: 0x12b1, 0xa6f: 0x12c9, 0xa70: 0x12e1, 0xa71: 0x12f9, 0xa72: 0x1311, 0xa73: 0x1329, 0xa74: 0x1341, 0xa75: 0x1359, 0xa76: 0x1371, 0xa77: 0x1389, 0xa78: 0x05fd, 0xa79: 0x13a1, 0xa7a: 0x13b9, 0xa7b: 0x13d1, 0xa7c: 0x13e1, 0xa7d: 0x13f9, 0xa7e: 0x1411, 0xa7f: 0x1429, // Block 0x2a, offset 0xa80 0xa80: 0xe00d, 0xa81: 0x0008, 0xa82: 0xe00d, 0xa83: 0x0008, 0xa84: 0xe00d, 0xa85: 0x0008, 0xa86: 0xe00d, 0xa87: 0x0008, 0xa88: 0xe00d, 0xa89: 0x0008, 0xa8a: 0xe00d, 0xa8b: 0x0008, 0xa8c: 0xe00d, 0xa8d: 0x0008, 0xa8e: 0xe00d, 0xa8f: 0x0008, 0xa90: 0xe00d, 0xa91: 0x0008, 0xa92: 0xe00d, 0xa93: 0x0008, 0xa94: 0xe00d, 0xa95: 0x0008, 0xa96: 0xe00d, 0xa97: 0x0008, 0xa98: 0xe00d, 0xa99: 0x0008, 0xa9a: 0xe00d, 0xa9b: 0x0008, 0xa9c: 0xe00d, 0xa9d: 0x0008, 0xa9e: 0xe00d, 0xa9f: 0x0008, 0xaa0: 0xe00d, 0xaa1: 0x0008, 0xaa2: 0xe00d, 0xaa3: 0x0008, 0xaa4: 0xe00d, 0xaa5: 0x0008, 0xaa6: 0xe00d, 0xaa7: 0x0008, 0xaa8: 0xe00d, 0xaa9: 0x0008, 0xaaa: 0xe00d, 0xaab: 0x0008, 0xaac: 0xe00d, 0xaad: 0x0008, 0xaae: 0xe00d, 0xaaf: 0x0008, 0xab0: 0xe00d, 0xab1: 0x0008, 0xab2: 0xe00d, 0xab3: 0x0008, 0xab4: 0xe00d, 0xab5: 0x0008, 0xab6: 0xe00d, 0xab7: 0x0008, 0xab8: 0xe00d, 0xab9: 0x0008, 0xaba: 0xe00d, 0xabb: 0x0008, 0xabc: 0xe00d, 0xabd: 0x0008, 0xabe: 0xe00d, 0xabf: 0x0008, // Block 0x2b, offset 0xac0 0xac0: 0xe00d, 0xac1: 0x0008, 0xac2: 0xe00d, 0xac3: 0x0008, 0xac4: 0xe00d, 0xac5: 0x0008, 0xac6: 0xe00d, 0xac7: 0x0008, 0xac8: 0xe00d, 0xac9: 0x0008, 0xaca: 0xe00d, 0xacb: 0x0008, 0xacc: 0xe00d, 0xacd: 0x0008, 0xace: 0xe00d, 0xacf: 0x0008, 0xad0: 0xe00d, 0xad1: 0x0008, 0xad2: 0xe00d, 0xad3: 0x0008, 0xad4: 0xe00d, 0xad5: 0x0008, 0xad6: 0x0008, 0xad7: 0x0008, 0xad8: 0x0008, 0xad9: 0x0008, 0xada: 0x0615, 0xadb: 0x0635, 0xadc: 0x0008, 0xadd: 0x0008, 0xade: 0x1441, 0xadf: 0x0008, 0xae0: 0xe00d, 0xae1: 0x0008, 0xae2: 0xe00d, 0xae3: 0x0008, 0xae4: 0xe00d, 0xae5: 0x0008, 0xae6: 0xe00d, 0xae7: 0x0008, 0xae8: 0xe00d, 0xae9: 0x0008, 0xaea: 0xe00d, 0xaeb: 0x0008, 0xaec: 0xe00d, 0xaed: 0x0008, 0xaee: 0xe00d, 0xaef: 0x0008, 0xaf0: 0xe00d, 0xaf1: 0x0008, 0xaf2: 0xe00d, 0xaf3: 0x0008, 0xaf4: 0xe00d, 0xaf5: 0x0008, 0xaf6: 0xe00d, 0xaf7: 0x0008, 0xaf8: 0xe00d, 0xaf9: 0x0008, 0xafa: 0xe00d, 0xafb: 0x0008, 0xafc: 0xe00d, 0xafd: 0x0008, 0xafe: 0xe00d, 0xaff: 0x0008, // Block 0x2c, offset 0xb00 0xb00: 0x0008, 0xb01: 0x0008, 0xb02: 0x0008, 0xb03: 0x0008, 0xb04: 0x0008, 0xb05: 0x0008, 0xb06: 0x0040, 0xb07: 0x0040, 0xb08: 0xe045, 0xb09: 0xe045, 0xb0a: 0xe045, 0xb0b: 0xe045, 0xb0c: 0xe045, 0xb0d: 0xe045, 0xb0e: 0x0040, 0xb0f: 0x0040, 0xb10: 0x0008, 0xb11: 0x0008, 0xb12: 0x0008, 0xb13: 0x0008, 0xb14: 0x0008, 0xb15: 0x0008, 0xb16: 0x0008, 0xb17: 0x0008, 0xb18: 0x0040, 0xb19: 0xe045, 0xb1a: 0x0040, 0xb1b: 0xe045, 0xb1c: 0x0040, 0xb1d: 0xe045, 0xb1e: 0x0040, 0xb1f: 0xe045, 0xb20: 0x0008, 0xb21: 0x0008, 0xb22: 0x0008, 0xb23: 0x0008, 0xb24: 0x0008, 0xb25: 0x0008, 0xb26: 0x0008, 0xb27: 0x0008, 0xb28: 0xe045, 0xb29: 0xe045, 0xb2a: 0xe045, 0xb2b: 0xe045, 0xb2c: 0xe045, 0xb2d: 0xe045, 0xb2e: 0xe045, 0xb2f: 0xe045, 0xb30: 0x0008, 0xb31: 0x1459, 0xb32: 0x0008, 0xb33: 0x1471, 0xb34: 0x0008, 0xb35: 0x1489, 0xb36: 0x0008, 0xb37: 0x14a1, 0xb38: 0x0008, 0xb39: 0x14b9, 0xb3a: 0x0008, 0xb3b: 0x14d1, 0xb3c: 0x0008, 0xb3d: 0x14e9, 0xb3e: 0x0040, 0xb3f: 0x0040, // Block 0x2d, offset 0xb40 0xb40: 0x1501, 0xb41: 0x1531, 0xb42: 0x1561, 0xb43: 0x1591, 0xb44: 0x15c1, 0xb45: 0x15f1, 0xb46: 0x1621, 0xb47: 0x1651, 0xb48: 0x1501, 0xb49: 0x1531, 0xb4a: 0x1561, 0xb4b: 0x1591, 0xb4c: 0x15c1, 0xb4d: 0x15f1, 0xb4e: 0x1621, 0xb4f: 0x1651, 0xb50: 0x1681, 0xb51: 0x16b1, 0xb52: 0x16e1, 0xb53: 0x1711, 0xb54: 0x1741, 0xb55: 0x1771, 0xb56: 0x17a1, 0xb57: 0x17d1, 0xb58: 0x1681, 0xb59: 0x16b1, 0xb5a: 0x16e1, 0xb5b: 0x1711, 0xb5c: 0x1741, 0xb5d: 0x1771, 0xb5e: 0x17a1, 0xb5f: 0x17d1, 0xb60: 0x1801, 0xb61: 0x1831, 0xb62: 0x1861, 0xb63: 0x1891, 0xb64: 0x18c1, 0xb65: 0x18f1, 0xb66: 0x1921, 0xb67: 0x1951, 0xb68: 0x1801, 0xb69: 0x1831, 0xb6a: 0x1861, 0xb6b: 0x1891, 0xb6c: 0x18c1, 0xb6d: 0x18f1, 0xb6e: 0x1921, 0xb6f: 0x1951, 0xb70: 0x0008, 0xb71: 0x0008, 0xb72: 0x1981, 0xb73: 0x19b1, 0xb74: 0x19d9, 0xb75: 0x0040, 0xb76: 0x0008, 0xb77: 0x1a01, 0xb78: 0xe045, 0xb79: 0xe045, 0xb7a: 0x064d, 0xb7b: 0x1459, 0xb7c: 0x19b1, 0xb7d: 0x0666, 0xb7e: 0x1a31, 0xb7f: 0x0686, // Block 0x2e, offset 0xb80 0xb80: 0x06a6, 0xb81: 0x1a4a, 0xb82: 0x1a79, 0xb83: 0x1aa9, 0xb84: 0x1ad1, 0xb85: 0x0040, 0xb86: 0x0008, 0xb87: 0x1af9, 0xb88: 0x06c5, 0xb89: 0x1471, 0xb8a: 0x06dd, 0xb8b: 0x1489, 0xb8c: 0x1aa9, 0xb8d: 0x1b2a, 0xb8e: 0x1b5a, 0xb8f: 0x1b8a, 0xb90: 0x0008, 0xb91: 0x0008, 0xb92: 0x0008, 0xb93: 0x1bb9, 0xb94: 0x0040, 0xb95: 0x0040, 0xb96: 0x0008, 0xb97: 0x0008, 0xb98: 0xe045, 0xb99: 0xe045, 0xb9a: 0x06f5, 0xb9b: 0x14a1, 0xb9c: 0x0040, 0xb9d: 0x1bd2, 0xb9e: 0x1c02, 0xb9f: 0x1c32, 0xba0: 0x0008, 0xba1: 0x0008, 0xba2: 0x0008, 0xba3: 0x1c61, 0xba4: 0x0008, 0xba5: 0x0008, 0xba6: 0x0008, 0xba7: 0x0008, 0xba8: 0xe045, 0xba9: 0xe045, 0xbaa: 0x070d, 0xbab: 0x14d1, 0xbac: 0xe04d, 0xbad: 0x1c7a, 0xbae: 0x03d2, 0xbaf: 0x1caa, 0xbb0: 0x0040, 0xbb1: 0x0040, 0xbb2: 0x1cb9, 0xbb3: 0x1ce9, 0xbb4: 0x1d11, 0xbb5: 0x0040, 0xbb6: 0x0008, 0xbb7: 0x1d39, 0xbb8: 0x0725, 0xbb9: 0x14b9, 0xbba: 0x0515, 0xbbb: 0x14e9, 0xbbc: 0x1ce9, 0xbbd: 0x073e, 0xbbe: 0x075e, 0xbbf: 0x0040, // Block 0x2f, offset 0xbc0 0xbc0: 0x000a, 0xbc1: 0x000a, 0xbc2: 0x000a, 0xbc3: 0x000a, 0xbc4: 0x000a, 0xbc5: 0x000a, 0xbc6: 0x000a, 0xbc7: 0x000a, 0xbc8: 0x000a, 0xbc9: 0x000a, 0xbca: 0x000a, 0xbcb: 0x03c0, 0xbcc: 0x0003, 0xbcd: 0x0003, 0xbce: 0x0340, 0xbcf: 0x0b40, 0xbd0: 0x0018, 0xbd1: 0xe00d, 0xbd2: 0x0018, 0xbd3: 0x0018, 0xbd4: 0x0018, 0xbd5: 0x0018, 0xbd6: 0x0018, 0xbd7: 0x077e, 0xbd8: 0x0018, 0xbd9: 0x0018, 0xbda: 0x0018, 0xbdb: 0x0018, 0xbdc: 0x0018, 0xbdd: 0x0018, 0xbde: 0x0018, 0xbdf: 0x0018, 0xbe0: 0x0018, 0xbe1: 0x0018, 0xbe2: 0x0018, 0xbe3: 0x0018, 0xbe4: 0x0040, 0xbe5: 0x0040, 0xbe6: 0x0040, 0xbe7: 0x0018, 0xbe8: 0x0040, 0xbe9: 0x0040, 0xbea: 0x0340, 0xbeb: 0x0340, 0xbec: 0x0340, 0xbed: 0x0340, 0xbee: 0x0340, 0xbef: 0x000a, 0xbf0: 0x0018, 0xbf1: 0x0018, 0xbf2: 0x0018, 0xbf3: 0x1d69, 0xbf4: 0x1da1, 0xbf5: 0x0018, 0xbf6: 0x1df1, 0xbf7: 0x1e29, 0xbf8: 0x0018, 0xbf9: 0x0018, 0xbfa: 0x0018, 0xbfb: 0x0018, 0xbfc: 0x1e7a, 0xbfd: 0x0018, 0xbfe: 0x079e, 0xbff: 0x0018, // Block 0x30, offset 0xc00 0xc00: 0x0018, 0xc01: 0x0018, 0xc02: 0x0018, 0xc03: 0x0018, 0xc04: 0x0018, 0xc05: 0x0018, 0xc06: 0x0018, 0xc07: 0x1e92, 0xc08: 0x1eaa, 0xc09: 0x1ec2, 0xc0a: 0x0018, 0xc0b: 0x0018, 0xc0c: 0x0018, 0xc0d: 0x0018, 0xc0e: 0x0018, 0xc0f: 0x0018, 0xc10: 0x0018, 0xc11: 0x0018, 0xc12: 0x0018, 0xc13: 0x0018, 0xc14: 0x0018, 0xc15: 0x0018, 0xc16: 0x0018, 0xc17: 0x1ed9, 0xc18: 0x0018, 0xc19: 0x0018, 0xc1a: 0x0018, 0xc1b: 0x0018, 0xc1c: 0x0018, 0xc1d: 0x0018, 0xc1e: 0x0018, 0xc1f: 0x000a, 0xc20: 0x03c0, 0xc21: 0x0340, 0xc22: 0x0340, 0xc23: 0x0340, 0xc24: 0x03c0, 0xc25: 0x0040, 0xc26: 0x0040, 0xc27: 0x0040, 0xc28: 0x0040, 0xc29: 0x0040, 0xc2a: 0x0340, 0xc2b: 0x0340, 0xc2c: 0x0340, 0xc2d: 0x0340, 0xc2e: 0x0340, 0xc2f: 0x0340, 0xc30: 0x1f41, 0xc31: 0x0f41, 0xc32: 0x0040, 0xc33: 0x0040, 0xc34: 0x1f51, 0xc35: 0x1f61, 0xc36: 0x1f71, 0xc37: 0x1f81, 0xc38: 0x1f91, 0xc39: 0x1fa1, 0xc3a: 0x1fb2, 0xc3b: 0x07bd, 0xc3c: 0x1fc2, 0xc3d: 0x1fd2, 0xc3e: 0x1fe2, 0xc3f: 0x0f71, // Block 0x31, offset 0xc40 0xc40: 0x1f41, 0xc41: 0x00c9, 0xc42: 0x0069, 0xc43: 0x0079, 0xc44: 0x1f51, 0xc45: 0x1f61, 0xc46: 0x1f71, 0xc47: 0x1f81, 0xc48: 0x1f91, 0xc49: 0x1fa1, 0xc4a: 0x1fb2, 0xc4b: 0x07d5, 0xc4c: 0x1fc2, 0xc4d: 0x1fd2, 0xc4e: 0x1fe2, 0xc4f: 0x0040, 0xc50: 0x0039, 0xc51: 0x0f09, 0xc52: 0x00d9, 0xc53: 0x0369, 0xc54: 0x0ff9, 0xc55: 0x0249, 0xc56: 0x0f51, 0xc57: 0x0359, 0xc58: 0x0f61, 0xc59: 0x0f71, 0xc5a: 0x0f99, 0xc5b: 0x01d9, 0xc5c: 0x0fa9, 0xc5d: 0x0040, 0xc5e: 0x0040, 0xc5f: 0x0040, 0xc60: 0x0018, 0xc61: 0x0018, 0xc62: 0x0018, 0xc63: 0x0018, 0xc64: 0x0018, 0xc65: 0x0018, 0xc66: 0x0018, 0xc67: 0x0018, 0xc68: 0x1ff1, 0xc69: 0x0018, 0xc6a: 0x0018, 0xc6b: 0x0018, 0xc6c: 0x0018, 0xc6d: 0x0018, 0xc6e: 0x0018, 0xc6f: 0x0018, 0xc70: 0x0018, 0xc71: 0x0018, 0xc72: 0x0018, 0xc73: 0x0018, 0xc74: 0x0018, 0xc75: 0x0018, 0xc76: 0x0018, 0xc77: 0x0018, 0xc78: 0x0018, 0xc79: 0x0018, 0xc7a: 0x0018, 0xc7b: 0x0018, 0xc7c: 0x0018, 0xc7d: 0x0018, 0xc7e: 0x0018, 0xc7f: 0x0018, // Block 0x32, offset 0xc80 0xc80: 0x07ee, 0xc81: 0x080e, 0xc82: 0x1159, 0xc83: 0x082d, 0xc84: 0x0018, 0xc85: 0x084e, 0xc86: 0x086e, 0xc87: 0x1011, 0xc88: 0x0018, 0xc89: 0x088d, 0xc8a: 0x0f31, 0xc8b: 0x0249, 0xc8c: 0x0249, 0xc8d: 0x0249, 0xc8e: 0x0249, 0xc8f: 0x2009, 0xc90: 0x0f41, 0xc91: 0x0f41, 0xc92: 0x0359, 0xc93: 0x0359, 0xc94: 0x0018, 0xc95: 0x0f71, 0xc96: 0x2021, 0xc97: 0x0018, 0xc98: 0x0018, 0xc99: 0x0f99, 0xc9a: 0x2039, 0xc9b: 0x0269, 0xc9c: 0x0269, 0xc9d: 0x0269, 0xc9e: 0x0018, 0xc9f: 0x0018, 0xca0: 0x2049, 0xca1: 0x08ad, 0xca2: 0x2061, 0xca3: 0x0018, 0xca4: 0x13d1, 0xca5: 0x0018, 0xca6: 0x2079, 0xca7: 0x0018, 0xca8: 0x13d1, 0xca9: 0x0018, 0xcaa: 0x0f51, 0xcab: 0x2091, 0xcac: 0x0ee9, 0xcad: 0x1159, 0xcae: 0x0018, 0xcaf: 0x0f09, 0xcb0: 0x0f09, 0xcb1: 0x1199, 0xcb2: 0x0040, 0xcb3: 0x0f61, 0xcb4: 0x00d9, 0xcb5: 0x20a9, 0xcb6: 0x20c1, 0xcb7: 0x20d9, 0xcb8: 0x20f1, 0xcb9: 0x0f41, 0xcba: 0x0018, 0xcbb: 0x08cd, 0xcbc: 0x2109, 0xcbd: 0x10b1, 0xcbe: 0x10b1, 0xcbf: 0x2109, // Block 0x33, offset 0xcc0 0xcc0: 0x08ed, 0xcc1: 0x0018, 0xcc2: 0x0018, 0xcc3: 0x0018, 0xcc4: 0x0018, 0xcc5: 0x0ef9, 0xcc6: 0x0ef9, 0xcc7: 0x0f09, 0xcc8: 0x0f41, 0xcc9: 0x0259, 0xcca: 0x0018, 0xccb: 0x0018, 0xccc: 0x0018, 0xccd: 0x0018, 0xcce: 0x0008, 0xccf: 0x0018, 0xcd0: 0x2121, 0xcd1: 0x2151, 0xcd2: 0x2181, 0xcd3: 0x21b9, 0xcd4: 0x21e9, 0xcd5: 0x2219, 0xcd6: 0x2249, 0xcd7: 0x2279, 0xcd8: 0x22a9, 0xcd9: 0x22d9, 0xcda: 0x2309, 0xcdb: 0x2339, 0xcdc: 0x2369, 0xcdd: 0x2399, 0xcde: 0x23c9, 0xcdf: 0x23f9, 0xce0: 0x0f41, 0xce1: 0x2421, 0xce2: 0x0905, 0xce3: 0x2439, 0xce4: 0x1089, 0xce5: 0x2451, 0xce6: 0x0925, 0xce7: 0x2469, 0xce8: 0x2491, 0xce9: 0x0369, 0xcea: 0x24a9, 0xceb: 0x0945, 0xcec: 0x0359, 0xced: 0x1159, 0xcee: 0x0ef9, 0xcef: 0x0f61, 0xcf0: 0x0f41, 0xcf1: 0x2421, 0xcf2: 0x0965, 0xcf3: 0x2439, 0xcf4: 0x1089, 0xcf5: 0x2451, 0xcf6: 0x0985, 0xcf7: 0x2469, 0xcf8: 0x2491, 0xcf9: 0x0369, 0xcfa: 0x24a9, 0xcfb: 0x09a5, 0xcfc: 0x0359, 0xcfd: 0x1159, 0xcfe: 0x0ef9, 0xcff: 0x0f61, // Block 0x34, offset 0xd00 0xd00: 0x0018, 0xd01: 0x0018, 0xd02: 0x0018, 0xd03: 0x0018, 0xd04: 0x0018, 0xd05: 0x0018, 0xd06: 0x0018, 0xd07: 0x0018, 0xd08: 0x0018, 0xd09: 0x0018, 0xd0a: 0x0018, 0xd0b: 0x0040, 0xd0c: 0x0040, 0xd0d: 0x0040, 0xd0e: 0x0040, 0xd0f: 0x0040, 0xd10: 0x0040, 0xd11: 0x0040, 0xd12: 0x0040, 0xd13: 0x0040, 0xd14: 0x0040, 0xd15: 0x0040, 0xd16: 0x0040, 0xd17: 0x0040, 0xd18: 0x0040, 0xd19: 0x0040, 0xd1a: 0x0040, 0xd1b: 0x0040, 0xd1c: 0x0040, 0xd1d: 0x0040, 0xd1e: 0x0040, 0xd1f: 0x0040, 0xd20: 0x00c9, 0xd21: 0x0069, 0xd22: 0x0079, 0xd23: 0x1f51, 0xd24: 0x1f61, 0xd25: 0x1f71, 0xd26: 0x1f81, 0xd27: 0x1f91, 0xd28: 0x1fa1, 0xd29: 0x2601, 0xd2a: 0x2619, 0xd2b: 0x2631, 0xd2c: 0x2649, 0xd2d: 0x2661, 0xd2e: 0x2679, 0xd2f: 0x2691, 0xd30: 0x26a9, 0xd31: 0x26c1, 0xd32: 0x26d9, 0xd33: 0x26f1, 0xd34: 0x0a06, 0xd35: 0x0a26, 0xd36: 0x0a46, 0xd37: 0x0a66, 0xd38: 0x0a86, 0xd39: 0x0aa6, 0xd3a: 0x0ac6, 0xd3b: 0x0ae6, 0xd3c: 0x0b06, 0xd3d: 0x270a, 0xd3e: 0x2732, 0xd3f: 0x275a, // Block 0x35, offset 0xd40 0xd40: 0x2782, 0xd41: 0x27aa, 0xd42: 0x27d2, 0xd43: 0x27fa, 0xd44: 0x2822, 0xd45: 0x284a, 0xd46: 0x2872, 0xd47: 0x289a, 0xd48: 0x0040, 0xd49: 0x0040, 0xd4a: 0x0040, 0xd4b: 0x0040, 0xd4c: 0x0040, 0xd4d: 0x0040, 0xd4e: 0x0040, 0xd4f: 0x0040, 0xd50: 0x0040, 0xd51: 0x0040, 0xd52: 0x0040, 0xd53: 0x0040, 0xd54: 0x0040, 0xd55: 0x0040, 0xd56: 0x0040, 0xd57: 0x0040, 0xd58: 0x0040, 0xd59: 0x0040, 0xd5a: 0x0040, 0xd5b: 0x0040, 0xd5c: 0x0b26, 0xd5d: 0x0b46, 0xd5e: 0x0b66, 0xd5f: 0x0b86, 0xd60: 0x0ba6, 0xd61: 0x0bc6, 0xd62: 0x0be6, 0xd63: 0x0c06, 0xd64: 0x0c26, 0xd65: 0x0c46, 0xd66: 0x0c66, 0xd67: 0x0c86, 0xd68: 0x0ca6, 0xd69: 0x0cc6, 0xd6a: 0x0ce6, 0xd6b: 0x0d06, 0xd6c: 0x0d26, 0xd6d: 0x0d46, 0xd6e: 0x0d66, 0xd6f: 0x0d86, 0xd70: 0x0da6, 0xd71: 0x0dc6, 0xd72: 0x0de6, 0xd73: 0x0e06, 0xd74: 0x0e26, 0xd75: 0x0e46, 0xd76: 0x0039, 0xd77: 0x0ee9, 0xd78: 0x1159, 0xd79: 0x0ef9, 0xd7a: 0x0f09, 0xd7b: 0x1199, 0xd7c: 0x0f31, 0xd7d: 0x0249, 0xd7e: 0x0f41, 0xd7f: 0x0259, // Block 0x36, offset 0xd80 0xd80: 0x0f51, 0xd81: 0x0359, 0xd82: 0x0f61, 0xd83: 0x0f71, 0xd84: 0x00d9, 0xd85: 0x0f99, 0xd86: 0x2039, 0xd87: 0x0269, 0xd88: 0x01d9, 0xd89: 0x0fa9, 0xd8a: 0x0fb9, 0xd8b: 0x1089, 0xd8c: 0x0279, 0xd8d: 0x0369, 0xd8e: 0x0289, 0xd8f: 0x13d1, 0xd90: 0x0039, 0xd91: 0x0ee9, 0xd92: 0x1159, 0xd93: 0x0ef9, 0xd94: 0x0f09, 0xd95: 0x1199, 0xd96: 0x0f31, 0xd97: 0x0249, 0xd98: 0x0f41, 0xd99: 0x0259, 0xd9a: 0x0f51, 0xd9b: 0x0359, 0xd9c: 0x0f61, 0xd9d: 0x0f71, 0xd9e: 0x00d9, 0xd9f: 0x0f99, 0xda0: 0x2039, 0xda1: 0x0269, 0xda2: 0x01d9, 0xda3: 0x0fa9, 0xda4: 0x0fb9, 0xda5: 0x1089, 0xda6: 0x0279, 0xda7: 0x0369, 0xda8: 0x0289, 0xda9: 0x13d1, 0xdaa: 0x1f41, 0xdab: 0x0018, 0xdac: 0x0018, 0xdad: 0x0018, 0xdae: 0x0018, 0xdaf: 0x0018, 0xdb0: 0x0018, 0xdb1: 0x0018, 0xdb2: 0x0018, 0xdb3: 0x0018, 0xdb4: 0x0018, 0xdb5: 0x0018, 0xdb6: 0x0018, 0xdb7: 0x0018, 0xdb8: 0x0018, 0xdb9: 0x0018, 0xdba: 0x0018, 0xdbb: 0x0018, 0xdbc: 0x0018, 0xdbd: 0x0018, 0xdbe: 0x0018, 0xdbf: 0x0018, // Block 0x37, offset 0xdc0 0xdc0: 0x0008, 0xdc1: 0x0008, 0xdc2: 0x0008, 0xdc3: 0x0008, 0xdc4: 0x0008, 0xdc5: 0x0008, 0xdc6: 0x0008, 0xdc7: 0x0008, 0xdc8: 0x0008, 0xdc9: 0x0008, 0xdca: 0x0008, 0xdcb: 0x0008, 0xdcc: 0x0008, 0xdcd: 0x0008, 0xdce: 0x0008, 0xdcf: 0x0008, 0xdd0: 0x0008, 0xdd1: 0x0008, 0xdd2: 0x0008, 0xdd3: 0x0008, 0xdd4: 0x0008, 0xdd5: 0x0008, 0xdd6: 0x0008, 0xdd7: 0x0008, 0xdd8: 0x0008, 0xdd9: 0x0008, 0xdda: 0x0008, 0xddb: 0x0008, 0xddc: 0x0008, 0xddd: 0x0008, 0xdde: 0x0008, 0xddf: 0x0040, 0xde0: 0xe00d, 0xde1: 0x0008, 0xde2: 0x2971, 0xde3: 0x0ebd, 0xde4: 0x2989, 0xde5: 0x0008, 0xde6: 0x0008, 0xde7: 0xe07d, 0xde8: 0x0008, 0xde9: 0xe01d, 0xdea: 0x0008, 0xdeb: 0xe03d, 0xdec: 0x0008, 0xded: 0x0fe1, 0xdee: 0x1281, 0xdef: 0x0fc9, 0xdf0: 0x1141, 0xdf1: 0x0008, 0xdf2: 0xe00d, 0xdf3: 0x0008, 0xdf4: 0x0008, 0xdf5: 0xe01d, 0xdf6: 0x0008, 0xdf7: 0x0008, 0xdf8: 0x0008, 0xdf9: 0x0008, 0xdfa: 0x0008, 0xdfb: 0x0008, 0xdfc: 0x0259, 0xdfd: 0x1089, 0xdfe: 0x29a1, 0xdff: 0x29b9, // Block 0x38, offset 0xe00 0xe00: 0xe00d, 0xe01: 0x0008, 0xe02: 0xe00d, 0xe03: 0x0008, 0xe04: 0xe00d, 0xe05: 0x0008, 0xe06: 0xe00d, 0xe07: 0x0008, 0xe08: 0xe00d, 0xe09: 0x0008, 0xe0a: 0xe00d, 0xe0b: 0x0008, 0xe0c: 0xe00d, 0xe0d: 0x0008, 0xe0e: 0xe00d, 0xe0f: 0x0008, 0xe10: 0xe00d, 0xe11: 0x0008, 0xe12: 0xe00d, 0xe13: 0x0008, 0xe14: 0xe00d, 0xe15: 0x0008, 0xe16: 0xe00d, 0xe17: 0x0008, 0xe18: 0xe00d, 0xe19: 0x0008, 0xe1a: 0xe00d, 0xe1b: 0x0008, 0xe1c: 0xe00d, 0xe1d: 0x0008, 0xe1e: 0xe00d, 0xe1f: 0x0008, 0xe20: 0xe00d, 0xe21: 0x0008, 0xe22: 0xe00d, 0xe23: 0x0008, 0xe24: 0x0008, 0xe25: 0x0018, 0xe26: 0x0018, 0xe27: 0x0018, 0xe28: 0x0018, 0xe29: 0x0018, 0xe2a: 0x0018, 0xe2b: 0xe03d, 0xe2c: 0x0008, 0xe2d: 0xe01d, 0xe2e: 0x0008, 0xe2f: 0x3308, 0xe30: 0x3308, 0xe31: 0x3308, 0xe32: 0xe00d, 0xe33: 0x0008, 0xe34: 0x0040, 0xe35: 0x0040, 0xe36: 0x0040, 0xe37: 0x0040, 0xe38: 0x0040, 0xe39: 0x0018, 0xe3a: 0x0018, 0xe3b: 0x0018, 0xe3c: 0x0018, 0xe3d: 0x0018, 0xe3e: 0x0018, 0xe3f: 0x0018, // Block 0x39, offset 0xe40 0xe40: 0x26fd, 0xe41: 0x271d, 0xe42: 0x273d, 0xe43: 0x275d, 0xe44: 0x277d, 0xe45: 0x279d, 0xe46: 0x27bd, 0xe47: 0x27dd, 0xe48: 0x27fd, 0xe49: 0x281d, 0xe4a: 0x283d, 0xe4b: 0x285d, 0xe4c: 0x287d, 0xe4d: 0x289d, 0xe4e: 0x28bd, 0xe4f: 0x28dd, 0xe50: 0x28fd, 0xe51: 0x291d, 0xe52: 0x293d, 0xe53: 0x295d, 0xe54: 0x297d, 0xe55: 0x299d, 0xe56: 0x0040, 0xe57: 0x0040, 0xe58: 0x0040, 0xe59: 0x0040, 0xe5a: 0x0040, 0xe5b: 0x0040, 0xe5c: 0x0040, 0xe5d: 0x0040, 0xe5e: 0x0040, 0xe5f: 0x0040, 0xe60: 0x0040, 0xe61: 0x0040, 0xe62: 0x0040, 0xe63: 0x0040, 0xe64: 0x0040, 0xe65: 0x0040, 0xe66: 0x0040, 0xe67: 0x0040, 0xe68: 0x0040, 0xe69: 0x0040, 0xe6a: 0x0040, 0xe6b: 0x0040, 0xe6c: 0x0040, 0xe6d: 0x0040, 0xe6e: 0x0040, 0xe6f: 0x0040, 0xe70: 0x0040, 0xe71: 0x0040, 0xe72: 0x0040, 0xe73: 0x0040, 0xe74: 0x0040, 0xe75: 0x0040, 0xe76: 0x0040, 0xe77: 0x0040, 0xe78: 0x0040, 0xe79: 0x0040, 0xe7a: 0x0040, 0xe7b: 0x0040, 0xe7c: 0x0040, 0xe7d: 0x0040, 0xe7e: 0x0040, 0xe7f: 0x0040, // Block 0x3a, offset 0xe80 0xe80: 0x000a, 0xe81: 0x0018, 0xe82: 0x29d1, 0xe83: 0x0018, 0xe84: 0x0018, 0xe85: 0x0008, 0xe86: 0x0008, 0xe87: 0x0008, 0xe88: 0x0018, 0xe89: 0x0018, 0xe8a: 0x0018, 0xe8b: 0x0018, 0xe8c: 0x0018, 0xe8d: 0x0018, 0xe8e: 0x0018, 0xe8f: 0x0018, 0xe90: 0x0018, 0xe91: 0x0018, 0xe92: 0x0018, 0xe93: 0x0018, 0xe94: 0x0018, 0xe95: 0x0018, 0xe96: 0x0018, 0xe97: 0x0018, 0xe98: 0x0018, 0xe99: 0x0018, 0xe9a: 0x0018, 0xe9b: 0x0018, 0xe9c: 0x0018, 0xe9d: 0x0018, 0xe9e: 0x0018, 0xe9f: 0x0018, 0xea0: 0x0018, 0xea1: 0x0018, 0xea2: 0x0018, 0xea3: 0x0018, 0xea4: 0x0018, 0xea5: 0x0018, 0xea6: 0x0018, 0xea7: 0x0018, 0xea8: 0x0018, 0xea9: 0x0018, 0xeaa: 0x3308, 0xeab: 0x3308, 0xeac: 0x3308, 0xead: 0x3308, 0xeae: 0x3018, 0xeaf: 0x3018, 0xeb0: 0x0018, 0xeb1: 0x0018, 0xeb2: 0x0018, 0xeb3: 0x0018, 0xeb4: 0x0018, 0xeb5: 0x0018, 0xeb6: 0xe125, 0xeb7: 0x0018, 0xeb8: 0x29bd, 0xeb9: 0x29dd, 0xeba: 0x29fd, 0xebb: 0x0018, 0xebc: 0x0008, 0xebd: 0x0018, 0xebe: 0x0018, 0xebf: 0x0018, // Block 0x3b, offset 0xec0 0xec0: 0x2b3d, 0xec1: 0x2b5d, 0xec2: 0x2b7d, 0xec3: 0x2b9d, 0xec4: 0x2bbd, 0xec5: 0x2bdd, 0xec6: 0x2bdd, 0xec7: 0x2bdd, 0xec8: 0x2bfd, 0xec9: 0x2bfd, 0xeca: 0x2bfd, 0xecb: 0x2bfd, 0xecc: 0x2c1d, 0xecd: 0x2c1d, 0xece: 0x2c1d, 0xecf: 0x2c3d, 0xed0: 0x2c5d, 0xed1: 0x2c5d, 0xed2: 0x2a7d, 0xed3: 0x2a7d, 0xed4: 0x2c5d, 0xed5: 0x2c5d, 0xed6: 0x2c7d, 0xed7: 0x2c7d, 0xed8: 0x2c5d, 0xed9: 0x2c5d, 0xeda: 0x2a7d, 0xedb: 0x2a7d, 0xedc: 0x2c5d, 0xedd: 0x2c5d, 0xede: 0x2c3d, 0xedf: 0x2c3d, 0xee0: 0x2c9d, 0xee1: 0x2c9d, 0xee2: 0x2cbd, 0xee3: 0x2cbd, 0xee4: 0x0040, 0xee5: 0x2cdd, 0xee6: 0x2cfd, 0xee7: 0x2d1d, 0xee8: 0x2d1d, 0xee9: 0x2d3d, 0xeea: 0x2d5d, 0xeeb: 0x2d7d, 0xeec: 0x2d9d, 0xeed: 0x2dbd, 0xeee: 0x2ddd, 0xeef: 0x2dfd, 0xef0: 0x2e1d, 0xef1: 0x2e3d, 0xef2: 0x2e3d, 0xef3: 0x2e5d, 0xef4: 0x2e7d, 0xef5: 0x2e7d, 0xef6: 0x2e9d, 0xef7: 0x2ebd, 0xef8: 0x2e5d, 0xef9: 0x2edd, 0xefa: 0x2efd, 0xefb: 0x2edd, 0xefc: 0x2e5d, 0xefd: 0x2f1d, 0xefe: 0x2f3d, 0xeff: 0x2f5d, // Block 0x3c, offset 0xf00 0xf00: 0x2f7d, 0xf01: 0x2f9d, 0xf02: 0x2cfd, 0xf03: 0x2cdd, 0xf04: 0x2fbd, 0xf05: 0x2fdd, 0xf06: 0x2ffd, 0xf07: 0x301d, 0xf08: 0x303d, 0xf09: 0x305d, 0xf0a: 0x307d, 0xf0b: 0x309d, 0xf0c: 0x30bd, 0xf0d: 0x30dd, 0xf0e: 0x30fd, 0xf0f: 0x0040, 0xf10: 0x0018, 0xf11: 0x0018, 0xf12: 0x311d, 0xf13: 0x313d, 0xf14: 0x315d, 0xf15: 0x317d, 0xf16: 0x319d, 0xf17: 0x31bd, 0xf18: 0x31dd, 0xf19: 0x31fd, 0xf1a: 0x321d, 0xf1b: 0x323d, 0xf1c: 0x315d, 0xf1d: 0x325d, 0xf1e: 0x327d, 0xf1f: 0x329d, 0xf20: 0x0008, 0xf21: 0x0008, 0xf22: 0x0008, 0xf23: 0x0008, 0xf24: 0x0008, 0xf25: 0x0008, 0xf26: 0x0008, 0xf27: 0x0008, 0xf28: 0x0008, 0xf29: 0x0008, 0xf2a: 0x0008, 0xf2b: 0x0008, 0xf2c: 0x0008, 0xf2d: 0x0008, 0xf2e: 0x0008, 0xf2f: 0x0008, 0xf30: 0x0008, 0xf31: 0x0008, 0xf32: 0x0008, 0xf33: 0x0008, 0xf34: 0x0008, 0xf35: 0x0008, 0xf36: 0x0008, 0xf37: 0x0008, 0xf38: 0x0008, 0xf39: 0x0008, 0xf3a: 0x0008, 0xf3b: 0x0040, 0xf3c: 0x0040, 0xf3d: 0x0040, 0xf3e: 0x0040, 0xf3f: 0x0040, // Block 0x3d, offset 0xf40 0xf40: 0x36a2, 0xf41: 0x36d2, 0xf42: 0x3702, 0xf43: 0x3732, 0xf44: 0x32bd, 0xf45: 0x32dd, 0xf46: 0x32fd, 0xf47: 0x331d, 0xf48: 0x0018, 0xf49: 0x0018, 0xf4a: 0x0018, 0xf4b: 0x0018, 0xf4c: 0x0018, 0xf4d: 0x0018, 0xf4e: 0x0018, 0xf4f: 0x0018, 0xf50: 0x333d, 0xf51: 0x3761, 0xf52: 0x3779, 0xf53: 0x3791, 0xf54: 0x37a9, 0xf55: 0x37c1, 0xf56: 0x37d9, 0xf57: 0x37f1, 0xf58: 0x3809, 0xf59: 0x3821, 0xf5a: 0x3839, 0xf5b: 0x3851, 0xf5c: 0x3869, 0xf5d: 0x3881, 0xf5e: 0x3899, 0xf5f: 0x38b1, 0xf60: 0x335d, 0xf61: 0x337d, 0xf62: 0x339d, 0xf63: 0x33bd, 0xf64: 0x33dd, 0xf65: 0x33dd, 0xf66: 0x33fd, 0xf67: 0x341d, 0xf68: 0x343d, 0xf69: 0x345d, 0xf6a: 0x347d, 0xf6b: 0x349d, 0xf6c: 0x34bd, 0xf6d: 0x34dd, 0xf6e: 0x34fd, 0xf6f: 0x351d, 0xf70: 0x353d, 0xf71: 0x355d, 0xf72: 0x357d, 0xf73: 0x359d, 0xf74: 0x35bd, 0xf75: 0x35dd, 0xf76: 0x35fd, 0xf77: 0x361d, 0xf78: 0x363d, 0xf79: 0x365d, 0xf7a: 0x367d, 0xf7b: 0x369d, 0xf7c: 0x38c9, 0xf7d: 0x3901, 0xf7e: 0x36bd, 0xf7f: 0x0018, // Block 0x3e, offset 0xf80 0xf80: 0x36dd, 0xf81: 0x36fd, 0xf82: 0x371d, 0xf83: 0x373d, 0xf84: 0x375d, 0xf85: 0x377d, 0xf86: 0x379d, 0xf87: 0x37bd, 0xf88: 0x37dd, 0xf89: 0x37fd, 0xf8a: 0x381d, 0xf8b: 0x383d, 0xf8c: 0x385d, 0xf8d: 0x387d, 0xf8e: 0x389d, 0xf8f: 0x38bd, 0xf90: 0x38dd, 0xf91: 0x38fd, 0xf92: 0x391d, 0xf93: 0x393d, 0xf94: 0x395d, 0xf95: 0x397d, 0xf96: 0x399d, 0xf97: 0x39bd, 0xf98: 0x39dd, 0xf99: 0x39fd, 0xf9a: 0x3a1d, 0xf9b: 0x3a3d, 0xf9c: 0x3a5d, 0xf9d: 0x3a7d, 0xf9e: 0x3a9d, 0xf9f: 0x3abd, 0xfa0: 0x3add, 0xfa1: 0x3afd, 0xfa2: 0x3b1d, 0xfa3: 0x3b3d, 0xfa4: 0x3b5d, 0xfa5: 0x3b7d, 0xfa6: 0x127d, 0xfa7: 0x3b9d, 0xfa8: 0x3bbd, 0xfa9: 0x3bdd, 0xfaa: 0x3bfd, 0xfab: 0x3c1d, 0xfac: 0x3c3d, 0xfad: 0x3c5d, 0xfae: 0x239d, 0xfaf: 0x3c7d, 0xfb0: 0x3c9d, 0xfb1: 0x3939, 0xfb2: 0x3951, 0xfb3: 0x3969, 0xfb4: 0x3981, 0xfb5: 0x3999, 0xfb6: 0x39b1, 0xfb7: 0x39c9, 0xfb8: 0x39e1, 0xfb9: 0x39f9, 0xfba: 0x3a11, 0xfbb: 0x3a29, 0xfbc: 0x3a41, 0xfbd: 0x3a59, 0xfbe: 0x3a71, 0xfbf: 0x3a89, // Block 0x3f, offset 0xfc0 0xfc0: 0x3aa1, 0xfc1: 0x3ac9, 0xfc2: 0x3af1, 0xfc3: 0x3b19, 0xfc4: 0x3b41, 0xfc5: 0x3b69, 0xfc6: 0x3b91, 0xfc7: 0x3bb9, 0xfc8: 0x3be1, 0xfc9: 0x3c09, 0xfca: 0x3c39, 0xfcb: 0x3c69, 0xfcc: 0x3c99, 0xfcd: 0x3cbd, 0xfce: 0x3cb1, 0xfcf: 0x3cdd, 0xfd0: 0x3cfd, 0xfd1: 0x3d15, 0xfd2: 0x3d2d, 0xfd3: 0x3d45, 0xfd4: 0x3d5d, 0xfd5: 0x3d5d, 0xfd6: 0x3d45, 0xfd7: 0x3d75, 0xfd8: 0x07bd, 0xfd9: 0x3d8d, 0xfda: 0x3da5, 0xfdb: 0x3dbd, 0xfdc: 0x3dd5, 0xfdd: 0x3ded, 0xfde: 0x3e05, 0xfdf: 0x3e1d, 0xfe0: 0x3e35, 0xfe1: 0x3e4d, 0xfe2: 0x3e65, 0xfe3: 0x3e7d, 0xfe4: 0x3e95, 0xfe5: 0x3e95, 0xfe6: 0x3ead, 0xfe7: 0x3ead, 0xfe8: 0x3ec5, 0xfe9: 0x3ec5, 0xfea: 0x3edd, 0xfeb: 0x3ef5, 0xfec: 0x3f0d, 0xfed: 0x3f25, 0xfee: 0x3f3d, 0xfef: 0x3f3d, 0xff0: 0x3f55, 0xff1: 0x3f55, 0xff2: 0x3f55, 0xff3: 0x3f6d, 0xff4: 0x3f85, 0xff5: 0x3f9d, 0xff6: 0x3fb5, 0xff7: 0x3f9d, 0xff8: 0x3fcd, 0xff9: 0x3fe5, 0xffa: 0x3f6d, 0xffb: 0x3ffd, 0xffc: 0x4015, 0xffd: 0x4015, 0xffe: 0x4015, 0xfff: 0x0040, // Block 0x40, offset 0x1000 0x1000: 0x3cc9, 0x1001: 0x3d31, 0x1002: 0x3d99, 0x1003: 0x3e01, 0x1004: 0x3e51, 0x1005: 0x3eb9, 0x1006: 0x3f09, 0x1007: 0x3f59, 0x1008: 0x3fd9, 0x1009: 0x4041, 0x100a: 0x4091, 0x100b: 0x40e1, 0x100c: 0x4131, 0x100d: 0x4199, 0x100e: 0x4201, 0x100f: 0x4251, 0x1010: 0x42a1, 0x1011: 0x42d9, 0x1012: 0x4329, 0x1013: 0x4391, 0x1014: 0x43f9, 0x1015: 0x4431, 0x1016: 0x44b1, 0x1017: 0x4549, 0x1018: 0x45c9, 0x1019: 0x4619, 0x101a: 0x4699, 0x101b: 0x4719, 0x101c: 0x4781, 0x101d: 0x47d1, 0x101e: 0x4821, 0x101f: 0x4871, 0x1020: 0x48d9, 0x1021: 0x4959, 0x1022: 0x49c1, 0x1023: 0x4a11, 0x1024: 0x4a61, 0x1025: 0x4ab1, 0x1026: 0x4ae9, 0x1027: 0x4b21, 0x1028: 0x4b59, 0x1029: 0x4b91, 0x102a: 0x4be1, 0x102b: 0x4c31, 0x102c: 0x4cb1, 0x102d: 0x4d01, 0x102e: 0x4d69, 0x102f: 0x4de9, 0x1030: 0x4e39, 0x1031: 0x4e71, 0x1032: 0x4ea9, 0x1033: 0x4f29, 0x1034: 0x4f91, 0x1035: 0x5011, 0x1036: 0x5061, 0x1037: 0x50e1, 0x1038: 0x5119, 0x1039: 0x5169, 0x103a: 0x51b9, 0x103b: 0x5209, 0x103c: 0x5259, 0x103d: 0x52a9, 0x103e: 0x5311, 0x103f: 0x5361, // Block 0x41, offset 0x1040 0x1040: 0x5399, 0x1041: 0x53e9, 0x1042: 0x5439, 0x1043: 0x5489, 0x1044: 0x54f1, 0x1045: 0x5541, 0x1046: 0x5591, 0x1047: 0x55e1, 0x1048: 0x5661, 0x1049: 0x56c9, 0x104a: 0x5701, 0x104b: 0x5781, 0x104c: 0x57b9, 0x104d: 0x5821, 0x104e: 0x5889, 0x104f: 0x58d9, 0x1050: 0x5929, 0x1051: 0x5979, 0x1052: 0x59e1, 0x1053: 0x5a19, 0x1054: 0x5a69, 0x1055: 0x5ad1, 0x1056: 0x5b09, 0x1057: 0x5b89, 0x1058: 0x5bd9, 0x1059: 0x5c01, 0x105a: 0x5c29, 0x105b: 0x5c51, 0x105c: 0x5c79, 0x105d: 0x5ca1, 0x105e: 0x5cc9, 0x105f: 0x5cf1, 0x1060: 0x5d19, 0x1061: 0x5d41, 0x1062: 0x5d69, 0x1063: 0x5d99, 0x1064: 0x5dc9, 0x1065: 0x5df9, 0x1066: 0x5e29, 0x1067: 0x5e59, 0x1068: 0x5e89, 0x1069: 0x5eb9, 0x106a: 0x5ee9, 0x106b: 0x5f19, 0x106c: 0x5f49, 0x106d: 0x5f79, 0x106e: 0x5fa9, 0x106f: 0x5fd9, 0x1070: 0x6009, 0x1071: 0x402d, 0x1072: 0x6039, 0x1073: 0x6051, 0x1074: 0x404d, 0x1075: 0x6069, 0x1076: 0x6081, 0x1077: 0x6099, 0x1078: 0x406d, 0x1079: 0x406d, 0x107a: 0x60b1, 0x107b: 0x60c9, 0x107c: 0x6101, 0x107d: 0x6139, 0x107e: 0x6171, 0x107f: 0x61a9, // Block 0x42, offset 0x1080 0x1080: 0x6211, 0x1081: 0x6229, 0x1082: 0x408d, 0x1083: 0x6241, 0x1084: 0x6259, 0x1085: 0x6271, 0x1086: 0x6289, 0x1087: 0x62a1, 0x1088: 0x40ad, 0x1089: 0x62b9, 0x108a: 0x62e1, 0x108b: 0x62f9, 0x108c: 0x40cd, 0x108d: 0x40cd, 0x108e: 0x6311, 0x108f: 0x6329, 0x1090: 0x6341, 0x1091: 0x40ed, 0x1092: 0x410d, 0x1093: 0x412d, 0x1094: 0x414d, 0x1095: 0x416d, 0x1096: 0x6359, 0x1097: 0x6371, 0x1098: 0x6389, 0x1099: 0x63a1, 0x109a: 0x63b9, 0x109b: 0x418d, 0x109c: 0x63d1, 0x109d: 0x63e9, 0x109e: 0x6401, 0x109f: 0x41ad, 0x10a0: 0x41cd, 0x10a1: 0x6419, 0x10a2: 0x41ed, 0x10a3: 0x420d, 0x10a4: 0x422d, 0x10a5: 0x6431, 0x10a6: 0x424d, 0x10a7: 0x6449, 0x10a8: 0x6479, 0x10a9: 0x6211, 0x10aa: 0x426d, 0x10ab: 0x428d, 0x10ac: 0x42ad, 0x10ad: 0x42cd, 0x10ae: 0x64b1, 0x10af: 0x64f1, 0x10b0: 0x6539, 0x10b1: 0x6551, 0x10b2: 0x42ed, 0x10b3: 0x6569, 0x10b4: 0x6581, 0x10b5: 0x6599, 0x10b6: 0x430d, 0x10b7: 0x65b1, 0x10b8: 0x65c9, 0x10b9: 0x65b1, 0x10ba: 0x65e1, 0x10bb: 0x65f9, 0x10bc: 0x432d, 0x10bd: 0x6611, 0x10be: 0x6629, 0x10bf: 0x6611, // Block 0x43, offset 0x10c0 0x10c0: 0x434d, 0x10c1: 0x436d, 0x10c2: 0x0040, 0x10c3: 0x6641, 0x10c4: 0x6659, 0x10c5: 0x6671, 0x10c6: 0x6689, 0x10c7: 0x0040, 0x10c8: 0x66c1, 0x10c9: 0x66d9, 0x10ca: 0x66f1, 0x10cb: 0x6709, 0x10cc: 0x6721, 0x10cd: 0x6739, 0x10ce: 0x6401, 0x10cf: 0x6751, 0x10d0: 0x6769, 0x10d1: 0x6781, 0x10d2: 0x438d, 0x10d3: 0x6799, 0x10d4: 0x6289, 0x10d5: 0x43ad, 0x10d6: 0x43cd, 0x10d7: 0x67b1, 0x10d8: 0x0040, 0x10d9: 0x43ed, 0x10da: 0x67c9, 0x10db: 0x67e1, 0x10dc: 0x67f9, 0x10dd: 0x6811, 0x10de: 0x6829, 0x10df: 0x6859, 0x10e0: 0x6889, 0x10e1: 0x68b1, 0x10e2: 0x68d9, 0x10e3: 0x6901, 0x10e4: 0x6929, 0x10e5: 0x6951, 0x10e6: 0x6979, 0x10e7: 0x69a1, 0x10e8: 0x69c9, 0x10e9: 0x69f1, 0x10ea: 0x6a21, 0x10eb: 0x6a51, 0x10ec: 0x6a81, 0x10ed: 0x6ab1, 0x10ee: 0x6ae1, 0x10ef: 0x6b11, 0x10f0: 0x6b41, 0x10f1: 0x6b71, 0x10f2: 0x6ba1, 0x10f3: 0x6bd1, 0x10f4: 0x6c01, 0x10f5: 0x6c31, 0x10f6: 0x6c61, 0x10f7: 0x6c91, 0x10f8: 0x6cc1, 0x10f9: 0x6cf1, 0x10fa: 0x6d21, 0x10fb: 0x6d51, 0x10fc: 0x6d81, 0x10fd: 0x6db1, 0x10fe: 0x6de1, 0x10ff: 0x440d, // Block 0x44, offset 0x1100 0x1100: 0xe00d, 0x1101: 0x0008, 0x1102: 0xe00d, 0x1103: 0x0008, 0x1104: 0xe00d, 0x1105: 0x0008, 0x1106: 0xe00d, 0x1107: 0x0008, 0x1108: 0xe00d, 0x1109: 0x0008, 0x110a: 0xe00d, 0x110b: 0x0008, 0x110c: 0xe00d, 0x110d: 0x0008, 0x110e: 0xe00d, 0x110f: 0x0008, 0x1110: 0xe00d, 0x1111: 0x0008, 0x1112: 0xe00d, 0x1113: 0x0008, 0x1114: 0xe00d, 0x1115: 0x0008, 0x1116: 0xe00d, 0x1117: 0x0008, 0x1118: 0xe00d, 0x1119: 0x0008, 0x111a: 0xe00d, 0x111b: 0x0008, 0x111c: 0xe00d, 0x111d: 0x0008, 0x111e: 0xe00d, 0x111f: 0x0008, 0x1120: 0xe00d, 0x1121: 0x0008, 0x1122: 0xe00d, 0x1123: 0x0008, 0x1124: 0xe00d, 0x1125: 0x0008, 0x1126: 0xe00d, 0x1127: 0x0008, 0x1128: 0xe00d, 0x1129: 0x0008, 0x112a: 0xe00d, 0x112b: 0x0008, 0x112c: 0xe00d, 0x112d: 0x0008, 0x112e: 0x0008, 0x112f: 0x3308, 0x1130: 0x3318, 0x1131: 0x3318, 0x1132: 0x3318, 0x1133: 0x0018, 0x1134: 0x3308, 0x1135: 0x3308, 0x1136: 0x3308, 0x1137: 0x3308, 0x1138: 0x3308, 0x1139: 0x3308, 0x113a: 0x3308, 0x113b: 0x3308, 0x113c: 0x3308, 0x113d: 0x3308, 0x113e: 0x0018, 0x113f: 0x0008, // Block 0x45, offset 0x1140 0x1140: 0xe00d, 0x1141: 0x0008, 0x1142: 0xe00d, 0x1143: 0x0008, 0x1144: 0xe00d, 0x1145: 0x0008, 0x1146: 0xe00d, 0x1147: 0x0008, 0x1148: 0xe00d, 0x1149: 0x0008, 0x114a: 0xe00d, 0x114b: 0x0008, 0x114c: 0xe00d, 0x114d: 0x0008, 0x114e: 0xe00d, 0x114f: 0x0008, 0x1150: 0xe00d, 0x1151: 0x0008, 0x1152: 0xe00d, 0x1153: 0x0008, 0x1154: 0xe00d, 0x1155: 0x0008, 0x1156: 0xe00d, 0x1157: 0x0008, 0x1158: 0xe00d, 0x1159: 0x0008, 0x115a: 0xe00d, 0x115b: 0x0008, 0x115c: 0x0ea1, 0x115d: 0x6e11, 0x115e: 0x3308, 0x115f: 0x3308, 0x1160: 0x0008, 0x1161: 0x0008, 0x1162: 0x0008, 0x1163: 0x0008, 0x1164: 0x0008, 0x1165: 0x0008, 0x1166: 0x0008, 0x1167: 0x0008, 0x1168: 0x0008, 0x1169: 0x0008, 0x116a: 0x0008, 0x116b: 0x0008, 0x116c: 0x0008, 0x116d: 0x0008, 0x116e: 0x0008, 0x116f: 0x0008, 0x1170: 0x0008, 0x1171: 0x0008, 0x1172: 0x0008, 0x1173: 0x0008, 0x1174: 0x0008, 0x1175: 0x0008, 0x1176: 0x0008, 0x1177: 0x0008, 0x1178: 0x0008, 0x1179: 0x0008, 0x117a: 0x0008, 0x117b: 0x0008, 0x117c: 0x0008, 0x117d: 0x0008, 0x117e: 0x0008, 0x117f: 0x0008, // Block 0x46, offset 0x1180 0x1180: 0x0018, 0x1181: 0x0018, 0x1182: 0x0018, 0x1183: 0x0018, 0x1184: 0x0018, 0x1185: 0x0018, 0x1186: 0x0018, 0x1187: 0x0018, 0x1188: 0x0018, 0x1189: 0x0018, 0x118a: 0x0018, 0x118b: 0x0018, 0x118c: 0x0018, 0x118d: 0x0018, 0x118e: 0x0018, 0x118f: 0x0018, 0x1190: 0x0018, 0x1191: 0x0018, 0x1192: 0x0018, 0x1193: 0x0018, 0x1194: 0x0018, 0x1195: 0x0018, 0x1196: 0x0018, 0x1197: 0x0008, 0x1198: 0x0008, 0x1199: 0x0008, 0x119a: 0x0008, 0x119b: 0x0008, 0x119c: 0x0008, 0x119d: 0x0008, 0x119e: 0x0008, 0x119f: 0x0008, 0x11a0: 0x0018, 0x11a1: 0x0018, 0x11a2: 0xe00d, 0x11a3: 0x0008, 0x11a4: 0xe00d, 0x11a5: 0x0008, 0x11a6: 0xe00d, 0x11a7: 0x0008, 0x11a8: 0xe00d, 0x11a9: 0x0008, 0x11aa: 0xe00d, 0x11ab: 0x0008, 0x11ac: 0xe00d, 0x11ad: 0x0008, 0x11ae: 0xe00d, 0x11af: 0x0008, 0x11b0: 0x0008, 0x11b1: 0x0008, 0x11b2: 0xe00d, 0x11b3: 0x0008, 0x11b4: 0xe00d, 0x11b5: 0x0008, 0x11b6: 0xe00d, 0x11b7: 0x0008, 0x11b8: 0xe00d, 0x11b9: 0x0008, 0x11ba: 0xe00d, 0x11bb: 0x0008, 0x11bc: 0xe00d, 0x11bd: 0x0008, 0x11be: 0xe00d, 0x11bf: 0x0008, // Block 0x47, offset 0x11c0 0x11c0: 0xe00d, 0x11c1: 0x0008, 0x11c2: 0xe00d, 0x11c3: 0x0008, 0x11c4: 0xe00d, 0x11c5: 0x0008, 0x11c6: 0xe00d, 0x11c7: 0x0008, 0x11c8: 0xe00d, 0x11c9: 0x0008, 0x11ca: 0xe00d, 0x11cb: 0x0008, 0x11cc: 0xe00d, 0x11cd: 0x0008, 0x11ce: 0xe00d, 0x11cf: 0x0008, 0x11d0: 0xe00d, 0x11d1: 0x0008, 0x11d2: 0xe00d, 0x11d3: 0x0008, 0x11d4: 0xe00d, 0x11d5: 0x0008, 0x11d6: 0xe00d, 0x11d7: 0x0008, 0x11d8: 0xe00d, 0x11d9: 0x0008, 0x11da: 0xe00d, 0x11db: 0x0008, 0x11dc: 0xe00d, 0x11dd: 0x0008, 0x11de: 0xe00d, 0x11df: 0x0008, 0x11e0: 0xe00d, 0x11e1: 0x0008, 0x11e2: 0xe00d, 0x11e3: 0x0008, 0x11e4: 0xe00d, 0x11e5: 0x0008, 0x11e6: 0xe00d, 0x11e7: 0x0008, 0x11e8: 0xe00d, 0x11e9: 0x0008, 0x11ea: 0xe00d, 0x11eb: 0x0008, 0x11ec: 0xe00d, 0x11ed: 0x0008, 0x11ee: 0xe00d, 0x11ef: 0x0008, 0x11f0: 0xe0fd, 0x11f1: 0x0008, 0x11f2: 0x0008, 0x11f3: 0x0008, 0x11f4: 0x0008, 0x11f5: 0x0008, 0x11f6: 0x0008, 0x11f7: 0x0008, 0x11f8: 0x0008, 0x11f9: 0xe01d, 0x11fa: 0x0008, 0x11fb: 0xe03d, 0x11fc: 0x0008, 0x11fd: 0x442d, 0x11fe: 0xe00d, 0x11ff: 0x0008, // Block 0x48, offset 0x1200 0x1200: 0xe00d, 0x1201: 0x0008, 0x1202: 0xe00d, 0x1203: 0x0008, 0x1204: 0xe00d, 0x1205: 0x0008, 0x1206: 0xe00d, 0x1207: 0x0008, 0x1208: 0x0008, 0x1209: 0x0018, 0x120a: 0x0018, 0x120b: 0xe03d, 0x120c: 0x0008, 0x120d: 0x11d9, 0x120e: 0x0008, 0x120f: 0x0008, 0x1210: 0xe00d, 0x1211: 0x0008, 0x1212: 0xe00d, 0x1213: 0x0008, 0x1214: 0x0008, 0x1215: 0x0008, 0x1216: 0xe00d, 0x1217: 0x0008, 0x1218: 0xe00d, 0x1219: 0x0008, 0x121a: 0xe00d, 0x121b: 0x0008, 0x121c: 0xe00d, 0x121d: 0x0008, 0x121e: 0xe00d, 0x121f: 0x0008, 0x1220: 0xe00d, 0x1221: 0x0008, 0x1222: 0xe00d, 0x1223: 0x0008, 0x1224: 0xe00d, 0x1225: 0x0008, 0x1226: 0xe00d, 0x1227: 0x0008, 0x1228: 0xe00d, 0x1229: 0x0008, 0x122a: 0x6e29, 0x122b: 0x1029, 0x122c: 0x11c1, 0x122d: 0x6e41, 0x122e: 0x1221, 0x122f: 0x0040, 0x1230: 0x6e59, 0x1231: 0x6e71, 0x1232: 0x1239, 0x1233: 0x444d, 0x1234: 0xe00d, 0x1235: 0x0008, 0x1236: 0xe00d, 0x1237: 0x0008, 0x1238: 0x0040, 0x1239: 0x0040, 0x123a: 0x0040, 0x123b: 0x0040, 0x123c: 0x0040, 0x123d: 0x0040, 0x123e: 0x0040, 0x123f: 0x0040, // Block 0x49, offset 0x1240 0x1240: 0x64d5, 0x1241: 0x64f5, 0x1242: 0x6515, 0x1243: 0x6535, 0x1244: 0x6555, 0x1245: 0x6575, 0x1246: 0x6595, 0x1247: 0x65b5, 0x1248: 0x65d5, 0x1249: 0x65f5, 0x124a: 0x6615, 0x124b: 0x6635, 0x124c: 0x6655, 0x124d: 0x6675, 0x124e: 0x0008, 0x124f: 0x0008, 0x1250: 0x6695, 0x1251: 0x0008, 0x1252: 0x66b5, 0x1253: 0x0008, 0x1254: 0x0008, 0x1255: 0x66d5, 0x1256: 0x66f5, 0x1257: 0x6715, 0x1258: 0x6735, 0x1259: 0x6755, 0x125a: 0x6775, 0x125b: 0x6795, 0x125c: 0x67b5, 0x125d: 0x67d5, 0x125e: 0x67f5, 0x125f: 0x0008, 0x1260: 0x6815, 0x1261: 0x0008, 0x1262: 0x6835, 0x1263: 0x0008, 0x1264: 0x0008, 0x1265: 0x6855, 0x1266: 0x6875, 0x1267: 0x0008, 0x1268: 0x0008, 0x1269: 0x0008, 0x126a: 0x6895, 0x126b: 0x68b5, 0x126c: 0x68d5, 0x126d: 0x68f5, 0x126e: 0x6915, 0x126f: 0x6935, 0x1270: 0x6955, 0x1271: 0x6975, 0x1272: 0x6995, 0x1273: 0x69b5, 0x1274: 0x69d5, 0x1275: 0x69f5, 0x1276: 0x6a15, 0x1277: 0x6a35, 0x1278: 0x6a55, 0x1279: 0x6a75, 0x127a: 0x6a95, 0x127b: 0x6ab5, 0x127c: 0x6ad5, 0x127d: 0x6af5, 0x127e: 0x6b15, 0x127f: 0x6b35, // Block 0x4a, offset 0x1280 0x1280: 0x7a95, 0x1281: 0x7ab5, 0x1282: 0x7ad5, 0x1283: 0x7af5, 0x1284: 0x7b15, 0x1285: 0x7b35, 0x1286: 0x7b55, 0x1287: 0x7b75, 0x1288: 0x7b95, 0x1289: 0x7bb5, 0x128a: 0x7bd5, 0x128b: 0x7bf5, 0x128c: 0x7c15, 0x128d: 0x7c35, 0x128e: 0x7c55, 0x128f: 0x6ec9, 0x1290: 0x6ef1, 0x1291: 0x6f19, 0x1292: 0x7c75, 0x1293: 0x7c95, 0x1294: 0x7cb5, 0x1295: 0x6f41, 0x1296: 0x6f69, 0x1297: 0x6f91, 0x1298: 0x7cd5, 0x1299: 0x7cf5, 0x129a: 0x0040, 0x129b: 0x0040, 0x129c: 0x0040, 0x129d: 0x0040, 0x129e: 0x0040, 0x129f: 0x0040, 0x12a0: 0x0040, 0x12a1: 0x0040, 0x12a2: 0x0040, 0x12a3: 0x0040, 0x12a4: 0x0040, 0x12a5: 0x0040, 0x12a6: 0x0040, 0x12a7: 0x0040, 0x12a8: 0x0040, 0x12a9: 0x0040, 0x12aa: 0x0040, 0x12ab: 0x0040, 0x12ac: 0x0040, 0x12ad: 0x0040, 0x12ae: 0x0040, 0x12af: 0x0040, 0x12b0: 0x0040, 0x12b1: 0x0040, 0x12b2: 0x0040, 0x12b3: 0x0040, 0x12b4: 0x0040, 0x12b5: 0x0040, 0x12b6: 0x0040, 0x12b7: 0x0040, 0x12b8: 0x0040, 0x12b9: 0x0040, 0x12ba: 0x0040, 0x12bb: 0x0040, 0x12bc: 0x0040, 0x12bd: 0x0040, 0x12be: 0x0040, 0x12bf: 0x0040, // Block 0x4b, offset 0x12c0 0x12c0: 0x6fb9, 0x12c1: 0x6fd1, 0x12c2: 0x6fe9, 0x12c3: 0x7d15, 0x12c4: 0x7d35, 0x12c5: 0x7001, 0x12c6: 0x7001, 0x12c7: 0x0040, 0x12c8: 0x0040, 0x12c9: 0x0040, 0x12ca: 0x0040, 0x12cb: 0x0040, 0x12cc: 0x0040, 0x12cd: 0x0040, 0x12ce: 0x0040, 0x12cf: 0x0040, 0x12d0: 0x0040, 0x12d1: 0x0040, 0x12d2: 0x0040, 0x12d3: 0x7019, 0x12d4: 0x7041, 0x12d5: 0x7069, 0x12d6: 0x7091, 0x12d7: 0x70b9, 0x12d8: 0x0040, 0x12d9: 0x0040, 0x12da: 0x0040, 0x12db: 0x0040, 0x12dc: 0x0040, 0x12dd: 0x70e1, 0x12de: 0x3308, 0x12df: 0x7109, 0x12e0: 0x7131, 0x12e1: 0x20a9, 0x12e2: 0x20f1, 0x12e3: 0x7149, 0x12e4: 0x7161, 0x12e5: 0x7179, 0x12e6: 0x7191, 0x12e7: 0x71a9, 0x12e8: 0x71c1, 0x12e9: 0x1fb2, 0x12ea: 0x71d9, 0x12eb: 0x7201, 0x12ec: 0x7229, 0x12ed: 0x7261, 0x12ee: 0x7299, 0x12ef: 0x72c1, 0x12f0: 0x72e9, 0x12f1: 0x7311, 0x12f2: 0x7339, 0x12f3: 0x7361, 0x12f4: 0x7389, 0x12f5: 0x73b1, 0x12f6: 0x73d9, 0x12f7: 0x0040, 0x12f8: 0x7401, 0x12f9: 0x7429, 0x12fa: 0x7451, 0x12fb: 0x7479, 0x12fc: 0x74a1, 0x12fd: 0x0040, 0x12fe: 0x74c9, 0x12ff: 0x0040, // Block 0x4c, offset 0x1300 0x1300: 0x74f1, 0x1301: 0x7519, 0x1302: 0x0040, 0x1303: 0x7541, 0x1304: 0x7569, 0x1305: 0x0040, 0x1306: 0x7591, 0x1307: 0x75b9, 0x1308: 0x75e1, 0x1309: 0x7609, 0x130a: 0x7631, 0x130b: 0x7659, 0x130c: 0x7681, 0x130d: 0x76a9, 0x130e: 0x76d1, 0x130f: 0x76f9, 0x1310: 0x7721, 0x1311: 0x7721, 0x1312: 0x7739, 0x1313: 0x7739, 0x1314: 0x7739, 0x1315: 0x7739, 0x1316: 0x7751, 0x1317: 0x7751, 0x1318: 0x7751, 0x1319: 0x7751, 0x131a: 0x7769, 0x131b: 0x7769, 0x131c: 0x7769, 0x131d: 0x7769, 0x131e: 0x7781, 0x131f: 0x7781, 0x1320: 0x7781, 0x1321: 0x7781, 0x1322: 0x7799, 0x1323: 0x7799, 0x1324: 0x7799, 0x1325: 0x7799, 0x1326: 0x77b1, 0x1327: 0x77b1, 0x1328: 0x77b1, 0x1329: 0x77b1, 0x132a: 0x77c9, 0x132b: 0x77c9, 0x132c: 0x77c9, 0x132d: 0x77c9, 0x132e: 0x77e1, 0x132f: 0x77e1, 0x1330: 0x77e1, 0x1331: 0x77e1, 0x1332: 0x77f9, 0x1333: 0x77f9, 0x1334: 0x77f9, 0x1335: 0x77f9, 0x1336: 0x7811, 0x1337: 0x7811, 0x1338: 0x7811, 0x1339: 0x7811, 0x133a: 0x7829, 0x133b: 0x7829, 0x133c: 0x7829, 0x133d: 0x7829, 0x133e: 0x7841, 0x133f: 0x7841, // Block 0x4d, offset 0x1340 0x1340: 0x7841, 0x1341: 0x7841, 0x1342: 0x7859, 0x1343: 0x7859, 0x1344: 0x7871, 0x1345: 0x7871, 0x1346: 0x7889, 0x1347: 0x7889, 0x1348: 0x78a1, 0x1349: 0x78a1, 0x134a: 0x78b9, 0x134b: 0x78b9, 0x134c: 0x78d1, 0x134d: 0x78d1, 0x134e: 0x78e9, 0x134f: 0x78e9, 0x1350: 0x78e9, 0x1351: 0x78e9, 0x1352: 0x7901, 0x1353: 0x7901, 0x1354: 0x7901, 0x1355: 0x7901, 0x1356: 0x7919, 0x1357: 0x7919, 0x1358: 0x7919, 0x1359: 0x7919, 0x135a: 0x7931, 0x135b: 0x7931, 0x135c: 0x7931, 0x135d: 0x7931, 0x135e: 0x7949, 0x135f: 0x7949, 0x1360: 0x7961, 0x1361: 0x7961, 0x1362: 0x7961, 0x1363: 0x7961, 0x1364: 0x7979, 0x1365: 0x7979, 0x1366: 0x7991, 0x1367: 0x7991, 0x1368: 0x7991, 0x1369: 0x7991, 0x136a: 0x79a9, 0x136b: 0x79a9, 0x136c: 0x79a9, 0x136d: 0x79a9, 0x136e: 0x79c1, 0x136f: 0x79c1, 0x1370: 0x79d9, 0x1371: 0x79d9, 0x1372: 0x0818, 0x1373: 0x0818, 0x1374: 0x0818, 0x1375: 0x0818, 0x1376: 0x0818, 0x1377: 0x0818, 0x1378: 0x0818, 0x1379: 0x0818, 0x137a: 0x0818, 0x137b: 0x0818, 0x137c: 0x0818, 0x137d: 0x0818, 0x137e: 0x0818, 0x137f: 0x0818, // Block 0x4e, offset 0x1380 0x1380: 0x0818, 0x1381: 0x0818, 0x1382: 0x0040, 0x1383: 0x0040, 0x1384: 0x0040, 0x1385: 0x0040, 0x1386: 0x0040, 0x1387: 0x0040, 0x1388: 0x0040, 0x1389: 0x0040, 0x138a: 0x0040, 0x138b: 0x0040, 0x138c: 0x0040, 0x138d: 0x0040, 0x138e: 0x0040, 0x138f: 0x0040, 0x1390: 0x0040, 0x1391: 0x0040, 0x1392: 0x0040, 0x1393: 0x79f1, 0x1394: 0x79f1, 0x1395: 0x79f1, 0x1396: 0x79f1, 0x1397: 0x7a09, 0x1398: 0x7a09, 0x1399: 0x7a21, 0x139a: 0x7a21, 0x139b: 0x7a39, 0x139c: 0x7a39, 0x139d: 0x0479, 0x139e: 0x7a51, 0x139f: 0x7a51, 0x13a0: 0x7a69, 0x13a1: 0x7a69, 0x13a2: 0x7a81, 0x13a3: 0x7a81, 0x13a4: 0x7a99, 0x13a5: 0x7a99, 0x13a6: 0x7a99, 0x13a7: 0x7a99, 0x13a8: 0x7ab1, 0x13a9: 0x7ab1, 0x13aa: 0x7ac9, 0x13ab: 0x7ac9, 0x13ac: 0x7af1, 0x13ad: 0x7af1, 0x13ae: 0x7b19, 0x13af: 0x7b19, 0x13b0: 0x7b41, 0x13b1: 0x7b41, 0x13b2: 0x7b69, 0x13b3: 0x7b69, 0x13b4: 0x7b91, 0x13b5: 0x7b91, 0x13b6: 0x7bb9, 0x13b7: 0x7bb9, 0x13b8: 0x7bb9, 0x13b9: 0x7be1, 0x13ba: 0x7be1, 0x13bb: 0x7be1, 0x13bc: 0x7c09, 0x13bd: 0x7c09, 0x13be: 0x7c09, 0x13bf: 0x7c09, // Block 0x4f, offset 0x13c0 0x13c0: 0x85f9, 0x13c1: 0x8621, 0x13c2: 0x8649, 0x13c3: 0x8671, 0x13c4: 0x8699, 0x13c5: 0x86c1, 0x13c6: 0x86e9, 0x13c7: 0x8711, 0x13c8: 0x8739, 0x13c9: 0x8761, 0x13ca: 0x8789, 0x13cb: 0x87b1, 0x13cc: 0x87d9, 0x13cd: 0x8801, 0x13ce: 0x8829, 0x13cf: 0x8851, 0x13d0: 0x8879, 0x13d1: 0x88a1, 0x13d2: 0x88c9, 0x13d3: 0x88f1, 0x13d4: 0x8919, 0x13d5: 0x8941, 0x13d6: 0x8969, 0x13d7: 0x8991, 0x13d8: 0x89b9, 0x13d9: 0x89e1, 0x13da: 0x8a09, 0x13db: 0x8a31, 0x13dc: 0x8a59, 0x13dd: 0x8a81, 0x13de: 0x8aaa, 0x13df: 0x8ada, 0x13e0: 0x8b0a, 0x13e1: 0x8b3a, 0x13e2: 0x8b6a, 0x13e3: 0x8b9a, 0x13e4: 0x8bc9, 0x13e5: 0x8bf1, 0x13e6: 0x7c71, 0x13e7: 0x8c19, 0x13e8: 0x7be1, 0x13e9: 0x7c99, 0x13ea: 0x8c41, 0x13eb: 0x8c69, 0x13ec: 0x7d39, 0x13ed: 0x8c91, 0x13ee: 0x7d61, 0x13ef: 0x7d89, 0x13f0: 0x8cb9, 0x13f1: 0x8ce1, 0x13f2: 0x7e29, 0x13f3: 0x8d09, 0x13f4: 0x7e51, 0x13f5: 0x7e79, 0x13f6: 0x8d31, 0x13f7: 0x8d59, 0x13f8: 0x7ec9, 0x13f9: 0x8d81, 0x13fa: 0x7ef1, 0x13fb: 0x7f19, 0x13fc: 0x83a1, 0x13fd: 0x83c9, 0x13fe: 0x8441, 0x13ff: 0x8469, // Block 0x50, offset 0x1400 0x1400: 0x8491, 0x1401: 0x8531, 0x1402: 0x8559, 0x1403: 0x8581, 0x1404: 0x85a9, 0x1405: 0x8649, 0x1406: 0x8671, 0x1407: 0x8699, 0x1408: 0x8da9, 0x1409: 0x8739, 0x140a: 0x8dd1, 0x140b: 0x8df9, 0x140c: 0x8829, 0x140d: 0x8e21, 0x140e: 0x8851, 0x140f: 0x8879, 0x1410: 0x8a81, 0x1411: 0x8e49, 0x1412: 0x8e71, 0x1413: 0x89b9, 0x1414: 0x8e99, 0x1415: 0x89e1, 0x1416: 0x8a09, 0x1417: 0x7c21, 0x1418: 0x7c49, 0x1419: 0x8ec1, 0x141a: 0x7c71, 0x141b: 0x8ee9, 0x141c: 0x7cc1, 0x141d: 0x7ce9, 0x141e: 0x7d11, 0x141f: 0x7d39, 0x1420: 0x8f11, 0x1421: 0x7db1, 0x1422: 0x7dd9, 0x1423: 0x7e01, 0x1424: 0x7e29, 0x1425: 0x8f39, 0x1426: 0x7ec9, 0x1427: 0x7f41, 0x1428: 0x7f69, 0x1429: 0x7f91, 0x142a: 0x7fb9, 0x142b: 0x7fe1, 0x142c: 0x8031, 0x142d: 0x8059, 0x142e: 0x8081, 0x142f: 0x80a9, 0x1430: 0x80d1, 0x1431: 0x80f9, 0x1432: 0x8f61, 0x1433: 0x8121, 0x1434: 0x8149, 0x1435: 0x8171, 0x1436: 0x8199, 0x1437: 0x81c1, 0x1438: 0x81e9, 0x1439: 0x8239, 0x143a: 0x8261, 0x143b: 0x8289, 0x143c: 0x82b1, 0x143d: 0x82d9, 0x143e: 0x8301, 0x143f: 0x8329, // Block 0x51, offset 0x1440 0x1440: 0x8351, 0x1441: 0x8379, 0x1442: 0x83f1, 0x1443: 0x8419, 0x1444: 0x84b9, 0x1445: 0x84e1, 0x1446: 0x8509, 0x1447: 0x8531, 0x1448: 0x8559, 0x1449: 0x85d1, 0x144a: 0x85f9, 0x144b: 0x8621, 0x144c: 0x8649, 0x144d: 0x8f89, 0x144e: 0x86c1, 0x144f: 0x86e9, 0x1450: 0x8711, 0x1451: 0x8739, 0x1452: 0x87b1, 0x1453: 0x87d9, 0x1454: 0x8801, 0x1455: 0x8829, 0x1456: 0x8fb1, 0x1457: 0x88a1, 0x1458: 0x88c9, 0x1459: 0x8fd9, 0x145a: 0x8941, 0x145b: 0x8969, 0x145c: 0x8991, 0x145d: 0x89b9, 0x145e: 0x9001, 0x145f: 0x7c71, 0x1460: 0x8ee9, 0x1461: 0x7d39, 0x1462: 0x8f11, 0x1463: 0x7e29, 0x1464: 0x8f39, 0x1465: 0x7ec9, 0x1466: 0x9029, 0x1467: 0x80d1, 0x1468: 0x9051, 0x1469: 0x9079, 0x146a: 0x90a1, 0x146b: 0x8531, 0x146c: 0x8559, 0x146d: 0x8649, 0x146e: 0x8829, 0x146f: 0x8fb1, 0x1470: 0x89b9, 0x1471: 0x9001, 0x1472: 0x90c9, 0x1473: 0x9101, 0x1474: 0x9139, 0x1475: 0x9171, 0x1476: 0x9199, 0x1477: 0x91c1, 0x1478: 0x91e9, 0x1479: 0x9211, 0x147a: 0x9239, 0x147b: 0x9261, 0x147c: 0x9289, 0x147d: 0x92b1, 0x147e: 0x92d9, 0x147f: 0x9301, // Block 0x52, offset 0x1480 0x1480: 0x9329, 0x1481: 0x9351, 0x1482: 0x9379, 0x1483: 0x93a1, 0x1484: 0x93c9, 0x1485: 0x93f1, 0x1486: 0x9419, 0x1487: 0x9441, 0x1488: 0x9469, 0x1489: 0x9491, 0x148a: 0x94b9, 0x148b: 0x94e1, 0x148c: 0x9079, 0x148d: 0x9509, 0x148e: 0x9531, 0x148f: 0x9559, 0x1490: 0x9581, 0x1491: 0x9171, 0x1492: 0x9199, 0x1493: 0x91c1, 0x1494: 0x91e9, 0x1495: 0x9211, 0x1496: 0x9239, 0x1497: 0x9261, 0x1498: 0x9289, 0x1499: 0x92b1, 0x149a: 0x92d9, 0x149b: 0x9301, 0x149c: 0x9329, 0x149d: 0x9351, 0x149e: 0x9379, 0x149f: 0x93a1, 0x14a0: 0x93c9, 0x14a1: 0x93f1, 0x14a2: 0x9419, 0x14a3: 0x9441, 0x14a4: 0x9469, 0x14a5: 0x9491, 0x14a6: 0x94b9, 0x14a7: 0x94e1, 0x14a8: 0x9079, 0x14a9: 0x9509, 0x14aa: 0x9531, 0x14ab: 0x9559, 0x14ac: 0x9581, 0x14ad: 0x9491, 0x14ae: 0x94b9, 0x14af: 0x94e1, 0x14b0: 0x9079, 0x14b1: 0x9051, 0x14b2: 0x90a1, 0x14b3: 0x8211, 0x14b4: 0x8059, 0x14b5: 0x8081, 0x14b6: 0x80a9, 0x14b7: 0x9491, 0x14b8: 0x94b9, 0x14b9: 0x94e1, 0x14ba: 0x8211, 0x14bb: 0x8239, 0x14bc: 0x95a9, 0x14bd: 0x95a9, 0x14be: 0x0018, 0x14bf: 0x0018, // Block 0x53, offset 0x14c0 0x14c0: 0x0040, 0x14c1: 0x0040, 0x14c2: 0x0040, 0x14c3: 0x0040, 0x14c4: 0x0040, 0x14c5: 0x0040, 0x14c6: 0x0040, 0x14c7: 0x0040, 0x14c8: 0x0040, 0x14c9: 0x0040, 0x14ca: 0x0040, 0x14cb: 0x0040, 0x14cc: 0x0040, 0x14cd: 0x0040, 0x14ce: 0x0040, 0x14cf: 0x0040, 0x14d0: 0x95d1, 0x14d1: 0x9609, 0x14d2: 0x9609, 0x14d3: 0x9641, 0x14d4: 0x9679, 0x14d5: 0x96b1, 0x14d6: 0x96e9, 0x14d7: 0x9721, 0x14d8: 0x9759, 0x14d9: 0x9759, 0x14da: 0x9791, 0x14db: 0x97c9, 0x14dc: 0x9801, 0x14dd: 0x9839, 0x14de: 0x9871, 0x14df: 0x98a9, 0x14e0: 0x98a9, 0x14e1: 0x98e1, 0x14e2: 0x9919, 0x14e3: 0x9919, 0x14e4: 0x9951, 0x14e5: 0x9951, 0x14e6: 0x9989, 0x14e7: 0x99c1, 0x14e8: 0x99c1, 0x14e9: 0x99f9, 0x14ea: 0x9a31, 0x14eb: 0x9a31, 0x14ec: 0x9a69, 0x14ed: 0x9a69, 0x14ee: 0x9aa1, 0x14ef: 0x9ad9, 0x14f0: 0x9ad9, 0x14f1: 0x9b11, 0x14f2: 0x9b11, 0x14f3: 0x9b49, 0x14f4: 0x9b81, 0x14f5: 0x9bb9, 0x14f6: 0x9bf1, 0x14f7: 0x9bf1, 0x14f8: 0x9c29, 0x14f9: 0x9c61, 0x14fa: 0x9c99, 0x14fb: 0x9cd1, 0x14fc: 0x9d09, 0x14fd: 0x9d09, 0x14fe: 0x9d41, 0x14ff: 0x9d79, // Block 0x54, offset 0x1500 0x1500: 0xa949, 0x1501: 0xa981, 0x1502: 0xa9b9, 0x1503: 0xa8a1, 0x1504: 0x9bb9, 0x1505: 0x9989, 0x1506: 0xa9f1, 0x1507: 0xaa29, 0x1508: 0x0040, 0x1509: 0x0040, 0x150a: 0x0040, 0x150b: 0x0040, 0x150c: 0x0040, 0x150d: 0x0040, 0x150e: 0x0040, 0x150f: 0x0040, 0x1510: 0x0040, 0x1511: 0x0040, 0x1512: 0x0040, 0x1513: 0x0040, 0x1514: 0x0040, 0x1515: 0x0040, 0x1516: 0x0040, 0x1517: 0x0040, 0x1518: 0x0040, 0x1519: 0x0040, 0x151a: 0x0040, 0x151b: 0x0040, 0x151c: 0x0040, 0x151d: 0x0040, 0x151e: 0x0040, 0x151f: 0x0040, 0x1520: 0x0040, 0x1521: 0x0040, 0x1522: 0x0040, 0x1523: 0x0040, 0x1524: 0x0040, 0x1525: 0x0040, 0x1526: 0x0040, 0x1527: 0x0040, 0x1528: 0x0040, 0x1529: 0x0040, 0x152a: 0x0040, 0x152b: 0x0040, 0x152c: 0x0040, 0x152d: 0x0040, 0x152e: 0x0040, 0x152f: 0x0040, 0x1530: 0xaa61, 0x1531: 0xaa99, 0x1532: 0xaad1, 0x1533: 0xab19, 0x1534: 0xab61, 0x1535: 0xaba9, 0x1536: 0xabf1, 0x1537: 0xac39, 0x1538: 0xac81, 0x1539: 0xacc9, 0x153a: 0xad02, 0x153b: 0xae12, 0x153c: 0xae91, 0x153d: 0x0018, 0x153e: 0x0040, 0x153f: 0x0040, // Block 0x55, offset 0x1540 0x1540: 0x33c0, 0x1541: 0x33c0, 0x1542: 0x33c0, 0x1543: 0x33c0, 0x1544: 0x33c0, 0x1545: 0x33c0, 0x1546: 0x33c0, 0x1547: 0x33c0, 0x1548: 0x33c0, 0x1549: 0x33c0, 0x154a: 0x33c0, 0x154b: 0x33c0, 0x154c: 0x33c0, 0x154d: 0x33c0, 0x154e: 0x33c0, 0x154f: 0x33c0, 0x1550: 0xaeda, 0x1551: 0x7d55, 0x1552: 0x0040, 0x1553: 0xaeea, 0x1554: 0x03c2, 0x1555: 0xaefa, 0x1556: 0xaf0a, 0x1557: 0x7d75, 0x1558: 0x7d95, 0x1559: 0x0040, 0x155a: 0x0040, 0x155b: 0x0040, 0x155c: 0x0040, 0x155d: 0x0040, 0x155e: 0x0040, 0x155f: 0x0040, 0x1560: 0x3308, 0x1561: 0x3308, 0x1562: 0x3308, 0x1563: 0x3308, 0x1564: 0x3308, 0x1565: 0x3308, 0x1566: 0x3308, 0x1567: 0x3308, 0x1568: 0x3308, 0x1569: 0x3308, 0x156a: 0x3308, 0x156b: 0x3308, 0x156c: 0x3308, 0x156d: 0x3308, 0x156e: 0x3308, 0x156f: 0x3308, 0x1570: 0x0040, 0x1571: 0x7db5, 0x1572: 0x7dd5, 0x1573: 0xaf1a, 0x1574: 0xaf1a, 0x1575: 0x1fd2, 0x1576: 0x1fe2, 0x1577: 0xaf2a, 0x1578: 0xaf3a, 0x1579: 0x7df5, 0x157a: 0x7e15, 0x157b: 0x7e35, 0x157c: 0x7df5, 0x157d: 0x7e55, 0x157e: 0x7e75, 0x157f: 0x7e55, // Block 0x56, offset 0x1580 0x1580: 0x7e95, 0x1581: 0x7eb5, 0x1582: 0x7ed5, 0x1583: 0x7eb5, 0x1584: 0x7ef5, 0x1585: 0x0018, 0x1586: 0x0018, 0x1587: 0xaf4a, 0x1588: 0xaf5a, 0x1589: 0x7f16, 0x158a: 0x7f36, 0x158b: 0x7f56, 0x158c: 0x7f76, 0x158d: 0xaf1a, 0x158e: 0xaf1a, 0x158f: 0xaf1a, 0x1590: 0xaeda, 0x1591: 0x7f95, 0x1592: 0x0040, 0x1593: 0x0040, 0x1594: 0x03c2, 0x1595: 0xaeea, 0x1596: 0xaf0a, 0x1597: 0xaefa, 0x1598: 0x7fb5, 0x1599: 0x1fd2, 0x159a: 0x1fe2, 0x159b: 0xaf2a, 0x159c: 0xaf3a, 0x159d: 0x7e95, 0x159e: 0x7ef5, 0x159f: 0xaf6a, 0x15a0: 0xaf7a, 0x15a1: 0xaf8a, 0x15a2: 0x1fb2, 0x15a3: 0xaf99, 0x15a4: 0xafaa, 0x15a5: 0xafba, 0x15a6: 0x1fc2, 0x15a7: 0x0040, 0x15a8: 0xafca, 0x15a9: 0xafda, 0x15aa: 0xafea, 0x15ab: 0xaffa, 0x15ac: 0x0040, 0x15ad: 0x0040, 0x15ae: 0x0040, 0x15af: 0x0040, 0x15b0: 0x7fd6, 0x15b1: 0xb009, 0x15b2: 0x7ff6, 0x15b3: 0x0808, 0x15b4: 0x8016, 0x15b5: 0x0040, 0x15b6: 0x8036, 0x15b7: 0xb031, 0x15b8: 0x8056, 0x15b9: 0xb059, 0x15ba: 0x8076, 0x15bb: 0xb081, 0x15bc: 0x8096, 0x15bd: 0xb0a9, 0x15be: 0x80b6, 0x15bf: 0xb0d1, // Block 0x57, offset 0x15c0 0x15c0: 0xb0f9, 0x15c1: 0xb111, 0x15c2: 0xb111, 0x15c3: 0xb129, 0x15c4: 0xb129, 0x15c5: 0xb141, 0x15c6: 0xb141, 0x15c7: 0xb159, 0x15c8: 0xb159, 0x15c9: 0xb171, 0x15ca: 0xb171, 0x15cb: 0xb171, 0x15cc: 0xb171, 0x15cd: 0xb189, 0x15ce: 0xb189, 0x15cf: 0xb1a1, 0x15d0: 0xb1a1, 0x15d1: 0xb1a1, 0x15d2: 0xb1a1, 0x15d3: 0xb1b9, 0x15d4: 0xb1b9, 0x15d5: 0xb1d1, 0x15d6: 0xb1d1, 0x15d7: 0xb1d1, 0x15d8: 0xb1d1, 0x15d9: 0xb1e9, 0x15da: 0xb1e9, 0x15db: 0xb1e9, 0x15dc: 0xb1e9, 0x15dd: 0xb201, 0x15de: 0xb201, 0x15df: 0xb201, 0x15e0: 0xb201, 0x15e1: 0xb219, 0x15e2: 0xb219, 0x15e3: 0xb219, 0x15e4: 0xb219, 0x15e5: 0xb231, 0x15e6: 0xb231, 0x15e7: 0xb231, 0x15e8: 0xb231, 0x15e9: 0xb249, 0x15ea: 0xb249, 0x15eb: 0xb261, 0x15ec: 0xb261, 0x15ed: 0xb279, 0x15ee: 0xb279, 0x15ef: 0xb291, 0x15f0: 0xb291, 0x15f1: 0xb2a9, 0x15f2: 0xb2a9, 0x15f3: 0xb2a9, 0x15f4: 0xb2a9, 0x15f5: 0xb2c1, 0x15f6: 0xb2c1, 0x15f7: 0xb2c1, 0x15f8: 0xb2c1, 0x15f9: 0xb2d9, 0x15fa: 0xb2d9, 0x15fb: 0xb2d9, 0x15fc: 0xb2d9, 0x15fd: 0xb2f1, 0x15fe: 0xb2f1, 0x15ff: 0xb2f1, // Block 0x58, offset 0x1600 0x1600: 0xb2f1, 0x1601: 0xb309, 0x1602: 0xb309, 0x1603: 0xb309, 0x1604: 0xb309, 0x1605: 0xb321, 0x1606: 0xb321, 0x1607: 0xb321, 0x1608: 0xb321, 0x1609: 0xb339, 0x160a: 0xb339, 0x160b: 0xb339, 0x160c: 0xb339, 0x160d: 0xb351, 0x160e: 0xb351, 0x160f: 0xb351, 0x1610: 0xb351, 0x1611: 0xb369, 0x1612: 0xb369, 0x1613: 0xb369, 0x1614: 0xb369, 0x1615: 0xb381, 0x1616: 0xb381, 0x1617: 0xb381, 0x1618: 0xb381, 0x1619: 0xb399, 0x161a: 0xb399, 0x161b: 0xb399, 0x161c: 0xb399, 0x161d: 0xb3b1, 0x161e: 0xb3b1, 0x161f: 0xb3b1, 0x1620: 0xb3b1, 0x1621: 0xb3c9, 0x1622: 0xb3c9, 0x1623: 0xb3c9, 0x1624: 0xb3c9, 0x1625: 0xb3e1, 0x1626: 0xb3e1, 0x1627: 0xb3e1, 0x1628: 0xb3e1, 0x1629: 0xb3f9, 0x162a: 0xb3f9, 0x162b: 0xb3f9, 0x162c: 0xb3f9, 0x162d: 0xb411, 0x162e: 0xb411, 0x162f: 0x7ab1, 0x1630: 0x7ab1, 0x1631: 0xb429, 0x1632: 0xb429, 0x1633: 0xb429, 0x1634: 0xb429, 0x1635: 0xb441, 0x1636: 0xb441, 0x1637: 0xb469, 0x1638: 0xb469, 0x1639: 0xb491, 0x163a: 0xb491, 0x163b: 0xb4b9, 0x163c: 0xb4b9, 0x163d: 0x0040, 0x163e: 0x0040, 0x163f: 0x03c0, // Block 0x59, offset 0x1640 0x1640: 0x0040, 0x1641: 0xaefa, 0x1642: 0xb4e2, 0x1643: 0xaf6a, 0x1644: 0xafda, 0x1645: 0xafea, 0x1646: 0xaf7a, 0x1647: 0xb4f2, 0x1648: 0x1fd2, 0x1649: 0x1fe2, 0x164a: 0xaf8a, 0x164b: 0x1fb2, 0x164c: 0xaeda, 0x164d: 0xaf99, 0x164e: 0x29d1, 0x164f: 0xb502, 0x1650: 0x1f41, 0x1651: 0x00c9, 0x1652: 0x0069, 0x1653: 0x0079, 0x1654: 0x1f51, 0x1655: 0x1f61, 0x1656: 0x1f71, 0x1657: 0x1f81, 0x1658: 0x1f91, 0x1659: 0x1fa1, 0x165a: 0xaeea, 0x165b: 0x03c2, 0x165c: 0xafaa, 0x165d: 0x1fc2, 0x165e: 0xafba, 0x165f: 0xaf0a, 0x1660: 0xaffa, 0x1661: 0x0039, 0x1662: 0x0ee9, 0x1663: 0x1159, 0x1664: 0x0ef9, 0x1665: 0x0f09, 0x1666: 0x1199, 0x1667: 0x0f31, 0x1668: 0x0249, 0x1669: 0x0f41, 0x166a: 0x0259, 0x166b: 0x0f51, 0x166c: 0x0359, 0x166d: 0x0f61, 0x166e: 0x0f71, 0x166f: 0x00d9, 0x1670: 0x0f99, 0x1671: 0x2039, 0x1672: 0x0269, 0x1673: 0x01d9, 0x1674: 0x0fa9, 0x1675: 0x0fb9, 0x1676: 0x1089, 0x1677: 0x0279, 0x1678: 0x0369, 0x1679: 0x0289, 0x167a: 0x13d1, 0x167b: 0xaf4a, 0x167c: 0xafca, 0x167d: 0xaf5a, 0x167e: 0xb512, 0x167f: 0xaf1a, // Block 0x5a, offset 0x1680 0x1680: 0x1caa, 0x1681: 0x0039, 0x1682: 0x0ee9, 0x1683: 0x1159, 0x1684: 0x0ef9, 0x1685: 0x0f09, 0x1686: 0x1199, 0x1687: 0x0f31, 0x1688: 0x0249, 0x1689: 0x0f41, 0x168a: 0x0259, 0x168b: 0x0f51, 0x168c: 0x0359, 0x168d: 0x0f61, 0x168e: 0x0f71, 0x168f: 0x00d9, 0x1690: 0x0f99, 0x1691: 0x2039, 0x1692: 0x0269, 0x1693: 0x01d9, 0x1694: 0x0fa9, 0x1695: 0x0fb9, 0x1696: 0x1089, 0x1697: 0x0279, 0x1698: 0x0369, 0x1699: 0x0289, 0x169a: 0x13d1, 0x169b: 0xaf2a, 0x169c: 0xb522, 0x169d: 0xaf3a, 0x169e: 0xb532, 0x169f: 0x80d5, 0x16a0: 0x80f5, 0x16a1: 0x29d1, 0x16a2: 0x8115, 0x16a3: 0x8115, 0x16a4: 0x8135, 0x16a5: 0x8155, 0x16a6: 0x8175, 0x16a7: 0x8195, 0x16a8: 0x81b5, 0x16a9: 0x81d5, 0x16aa: 0x81f5, 0x16ab: 0x8215, 0x16ac: 0x8235, 0x16ad: 0x8255, 0x16ae: 0x8275, 0x16af: 0x8295, 0x16b0: 0x82b5, 0x16b1: 0x82d5, 0x16b2: 0x82f5, 0x16b3: 0x8315, 0x16b4: 0x8335, 0x16b5: 0x8355, 0x16b6: 0x8375, 0x16b7: 0x8395, 0x16b8: 0x83b5, 0x16b9: 0x83d5, 0x16ba: 0x83f5, 0x16bb: 0x8415, 0x16bc: 0x81b5, 0x16bd: 0x8435, 0x16be: 0x8455, 0x16bf: 0x8215, // Block 0x5b, offset 0x16c0 0x16c0: 0x8475, 0x16c1: 0x8495, 0x16c2: 0x84b5, 0x16c3: 0x84d5, 0x16c4: 0x84f5, 0x16c5: 0x8515, 0x16c6: 0x8535, 0x16c7: 0x8555, 0x16c8: 0x84d5, 0x16c9: 0x8575, 0x16ca: 0x84d5, 0x16cb: 0x8595, 0x16cc: 0x8595, 0x16cd: 0x85b5, 0x16ce: 0x85b5, 0x16cf: 0x85d5, 0x16d0: 0x8515, 0x16d1: 0x85f5, 0x16d2: 0x8615, 0x16d3: 0x85f5, 0x16d4: 0x8635, 0x16d5: 0x8615, 0x16d6: 0x8655, 0x16d7: 0x8655, 0x16d8: 0x8675, 0x16d9: 0x8675, 0x16da: 0x8695, 0x16db: 0x8695, 0x16dc: 0x8615, 0x16dd: 0x8115, 0x16de: 0x86b5, 0x16df: 0x86d5, 0x16e0: 0x0040, 0x16e1: 0x86f5, 0x16e2: 0x8715, 0x16e3: 0x8735, 0x16e4: 0x8755, 0x16e5: 0x8735, 0x16e6: 0x8775, 0x16e7: 0x8795, 0x16e8: 0x87b5, 0x16e9: 0x87b5, 0x16ea: 0x87d5, 0x16eb: 0x87d5, 0x16ec: 0x87f5, 0x16ed: 0x87f5, 0x16ee: 0x87d5, 0x16ef: 0x87d5, 0x16f0: 0x8815, 0x16f1: 0x8835, 0x16f2: 0x8855, 0x16f3: 0x8875, 0x16f4: 0x8895, 0x16f5: 0x88b5, 0x16f6: 0x88b5, 0x16f7: 0x88b5, 0x16f8: 0x88d5, 0x16f9: 0x88d5, 0x16fa: 0x88d5, 0x16fb: 0x88d5, 0x16fc: 0x87b5, 0x16fd: 0x87b5, 0x16fe: 0x87b5, 0x16ff: 0x0040, // Block 0x5c, offset 0x1700 0x1700: 0x0040, 0x1701: 0x0040, 0x1702: 0x8715, 0x1703: 0x86f5, 0x1704: 0x88f5, 0x1705: 0x86f5, 0x1706: 0x8715, 0x1707: 0x86f5, 0x1708: 0x0040, 0x1709: 0x0040, 0x170a: 0x8915, 0x170b: 0x8715, 0x170c: 0x8935, 0x170d: 0x88f5, 0x170e: 0x8935, 0x170f: 0x8715, 0x1710: 0x0040, 0x1711: 0x0040, 0x1712: 0x8955, 0x1713: 0x8975, 0x1714: 0x8875, 0x1715: 0x8935, 0x1716: 0x88f5, 0x1717: 0x8935, 0x1718: 0x0040, 0x1719: 0x0040, 0x171a: 0x8995, 0x171b: 0x89b5, 0x171c: 0x8995, 0x171d: 0x0040, 0x171e: 0x0040, 0x171f: 0x0040, 0x1720: 0xb541, 0x1721: 0xb559, 0x1722: 0xb571, 0x1723: 0x89d6, 0x1724: 0xb589, 0x1725: 0xb5a1, 0x1726: 0x89f5, 0x1727: 0x0040, 0x1728: 0x8a15, 0x1729: 0x8a35, 0x172a: 0x8a55, 0x172b: 0x8a35, 0x172c: 0x8a75, 0x172d: 0x8a95, 0x172e: 0x8ab5, 0x172f: 0x0040, 0x1730: 0x0040, 0x1731: 0x0040, 0x1732: 0x0040, 0x1733: 0x0040, 0x1734: 0x0040, 0x1735: 0x0040, 0x1736: 0x0040, 0x1737: 0x0040, 0x1738: 0x0040, 0x1739: 0x0340, 0x173a: 0x0340, 0x173b: 0x0340, 0x173c: 0x0040, 0x173d: 0x0040, 0x173e: 0x0040, 0x173f: 0x0040, // Block 0x5d, offset 0x1740 0x1740: 0x0a08, 0x1741: 0x0a08, 0x1742: 0x0a08, 0x1743: 0x0a08, 0x1744: 0x0a08, 0x1745: 0x0c08, 0x1746: 0x0808, 0x1747: 0x0c08, 0x1748: 0x0818, 0x1749: 0x0c08, 0x174a: 0x0c08, 0x174b: 0x0808, 0x174c: 0x0808, 0x174d: 0x0908, 0x174e: 0x0c08, 0x174f: 0x0c08, 0x1750: 0x0c08, 0x1751: 0x0c08, 0x1752: 0x0c08, 0x1753: 0x0a08, 0x1754: 0x0a08, 0x1755: 0x0a08, 0x1756: 0x0a08, 0x1757: 0x0908, 0x1758: 0x0a08, 0x1759: 0x0a08, 0x175a: 0x0a08, 0x175b: 0x0a08, 0x175c: 0x0a08, 0x175d: 0x0c08, 0x175e: 0x0a08, 0x175f: 0x0a08, 0x1760: 0x0a08, 0x1761: 0x0c08, 0x1762: 0x0808, 0x1763: 0x0808, 0x1764: 0x0c08, 0x1765: 0x3308, 0x1766: 0x3308, 0x1767: 0x0040, 0x1768: 0x0040, 0x1769: 0x0040, 0x176a: 0x0040, 0x176b: 0x0a18, 0x176c: 0x0a18, 0x176d: 0x0a18, 0x176e: 0x0a18, 0x176f: 0x0c18, 0x1770: 0x0818, 0x1771: 0x0818, 0x1772: 0x0818, 0x1773: 0x0818, 0x1774: 0x0818, 0x1775: 0x0818, 0x1776: 0x0818, 0x1777: 0x0040, 0x1778: 0x0040, 0x1779: 0x0040, 0x177a: 0x0040, 0x177b: 0x0040, 0x177c: 0x0040, 0x177d: 0x0040, 0x177e: 0x0040, 0x177f: 0x0040, // Block 0x5e, offset 0x1780 0x1780: 0x0a08, 0x1781: 0x0c08, 0x1782: 0x0a08, 0x1783: 0x0c08, 0x1784: 0x0c08, 0x1785: 0x0c08, 0x1786: 0x0a08, 0x1787: 0x0a08, 0x1788: 0x0a08, 0x1789: 0x0c08, 0x178a: 0x0a08, 0x178b: 0x0a08, 0x178c: 0x0c08, 0x178d: 0x0a08, 0x178e: 0x0c08, 0x178f: 0x0c08, 0x1790: 0x0a08, 0x1791: 0x0c08, 0x1792: 0x0040, 0x1793: 0x0040, 0x1794: 0x0040, 0x1795: 0x0040, 0x1796: 0x0040, 0x1797: 0x0040, 0x1798: 0x0040, 0x1799: 0x0818, 0x179a: 0x0818, 0x179b: 0x0818, 0x179c: 0x0818, 0x179d: 0x0040, 0x179e: 0x0040, 0x179f: 0x0040, 0x17a0: 0x0040, 0x17a1: 0x0040, 0x17a2: 0x0040, 0x17a3: 0x0040, 0x17a4: 0x0040, 0x17a5: 0x0040, 0x17a6: 0x0040, 0x17a7: 0x0040, 0x17a8: 0x0040, 0x17a9: 0x0c18, 0x17aa: 0x0c18, 0x17ab: 0x0c18, 0x17ac: 0x0c18, 0x17ad: 0x0a18, 0x17ae: 0x0a18, 0x17af: 0x0818, 0x17b0: 0x0040, 0x17b1: 0x0040, 0x17b2: 0x0040, 0x17b3: 0x0040, 0x17b4: 0x0040, 0x17b5: 0x0040, 0x17b6: 0x0040, 0x17b7: 0x0040, 0x17b8: 0x0040, 0x17b9: 0x0040, 0x17ba: 0x0040, 0x17bb: 0x0040, 0x17bc: 0x0040, 0x17bd: 0x0040, 0x17be: 0x0040, 0x17bf: 0x0040, // Block 0x5f, offset 0x17c0 0x17c0: 0x3308, 0x17c1: 0x3308, 0x17c2: 0x3008, 0x17c3: 0x3008, 0x17c4: 0x0040, 0x17c5: 0x0008, 0x17c6: 0x0008, 0x17c7: 0x0008, 0x17c8: 0x0008, 0x17c9: 0x0008, 0x17ca: 0x0008, 0x17cb: 0x0008, 0x17cc: 0x0008, 0x17cd: 0x0040, 0x17ce: 0x0040, 0x17cf: 0x0008, 0x17d0: 0x0008, 0x17d1: 0x0040, 0x17d2: 0x0040, 0x17d3: 0x0008, 0x17d4: 0x0008, 0x17d5: 0x0008, 0x17d6: 0x0008, 0x17d7: 0x0008, 0x17d8: 0x0008, 0x17d9: 0x0008, 0x17da: 0x0008, 0x17db: 0x0008, 0x17dc: 0x0008, 0x17dd: 0x0008, 0x17de: 0x0008, 0x17df: 0x0008, 0x17e0: 0x0008, 0x17e1: 0x0008, 0x17e2: 0x0008, 0x17e3: 0x0008, 0x17e4: 0x0008, 0x17e5: 0x0008, 0x17e6: 0x0008, 0x17e7: 0x0008, 0x17e8: 0x0008, 0x17e9: 0x0040, 0x17ea: 0x0008, 0x17eb: 0x0008, 0x17ec: 0x0008, 0x17ed: 0x0008, 0x17ee: 0x0008, 0x17ef: 0x0008, 0x17f0: 0x0008, 0x17f1: 0x0040, 0x17f2: 0x0008, 0x17f3: 0x0008, 0x17f4: 0x0040, 0x17f5: 0x0008, 0x17f6: 0x0008, 0x17f7: 0x0008, 0x17f8: 0x0008, 0x17f9: 0x0008, 0x17fa: 0x0040, 0x17fb: 0x0040, 0x17fc: 0x3308, 0x17fd: 0x0008, 0x17fe: 0x3008, 0x17ff: 0x3008, // Block 0x60, offset 0x1800 0x1800: 0x3308, 0x1801: 0x3008, 0x1802: 0x3008, 0x1803: 0x3008, 0x1804: 0x3008, 0x1805: 0x0040, 0x1806: 0x0040, 0x1807: 0x3008, 0x1808: 0x3008, 0x1809: 0x0040, 0x180a: 0x0040, 0x180b: 0x3008, 0x180c: 0x3008, 0x180d: 0x3808, 0x180e: 0x0040, 0x180f: 0x0040, 0x1810: 0x0008, 0x1811: 0x0040, 0x1812: 0x0040, 0x1813: 0x0040, 0x1814: 0x0040, 0x1815: 0x0040, 0x1816: 0x0040, 0x1817: 0x3008, 0x1818: 0x0040, 0x1819: 0x0040, 0x181a: 0x0040, 0x181b: 0x0040, 0x181c: 0x0040, 0x181d: 0x0008, 0x181e: 0x0008, 0x181f: 0x0008, 0x1820: 0x0008, 0x1821: 0x0008, 0x1822: 0x3008, 0x1823: 0x3008, 0x1824: 0x0040, 0x1825: 0x0040, 0x1826: 0x3308, 0x1827: 0x3308, 0x1828: 0x3308, 0x1829: 0x3308, 0x182a: 0x3308, 0x182b: 0x3308, 0x182c: 0x3308, 0x182d: 0x0040, 0x182e: 0x0040, 0x182f: 0x0040, 0x1830: 0x3308, 0x1831: 0x3308, 0x1832: 0x3308, 0x1833: 0x3308, 0x1834: 0x3308, 0x1835: 0x0040, 0x1836: 0x0040, 0x1837: 0x0040, 0x1838: 0x0040, 0x1839: 0x0040, 0x183a: 0x0040, 0x183b: 0x0040, 0x183c: 0x0040, 0x183d: 0x0040, 0x183e: 0x0040, 0x183f: 0x0040, // Block 0x61, offset 0x1840 0x1840: 0x0039, 0x1841: 0x0ee9, 0x1842: 0x1159, 0x1843: 0x0ef9, 0x1844: 0x0f09, 0x1845: 0x1199, 0x1846: 0x0f31, 0x1847: 0x0249, 0x1848: 0x0f41, 0x1849: 0x0259, 0x184a: 0x0f51, 0x184b: 0x0359, 0x184c: 0x0f61, 0x184d: 0x0f71, 0x184e: 0x00d9, 0x184f: 0x0f99, 0x1850: 0x2039, 0x1851: 0x0269, 0x1852: 0x01d9, 0x1853: 0x0fa9, 0x1854: 0x0fb9, 0x1855: 0x1089, 0x1856: 0x0279, 0x1857: 0x0369, 0x1858: 0x0289, 0x1859: 0x13d1, 0x185a: 0x0039, 0x185b: 0x0ee9, 0x185c: 0x1159, 0x185d: 0x0ef9, 0x185e: 0x0f09, 0x185f: 0x1199, 0x1860: 0x0f31, 0x1861: 0x0249, 0x1862: 0x0f41, 0x1863: 0x0259, 0x1864: 0x0f51, 0x1865: 0x0359, 0x1866: 0x0f61, 0x1867: 0x0f71, 0x1868: 0x00d9, 0x1869: 0x0f99, 0x186a: 0x2039, 0x186b: 0x0269, 0x186c: 0x01d9, 0x186d: 0x0fa9, 0x186e: 0x0fb9, 0x186f: 0x1089, 0x1870: 0x0279, 0x1871: 0x0369, 0x1872: 0x0289, 0x1873: 0x13d1, 0x1874: 0x0039, 0x1875: 0x0ee9, 0x1876: 0x1159, 0x1877: 0x0ef9, 0x1878: 0x0f09, 0x1879: 0x1199, 0x187a: 0x0f31, 0x187b: 0x0249, 0x187c: 0x0f41, 0x187d: 0x0259, 0x187e: 0x0f51, 0x187f: 0x0359, // Block 0x62, offset 0x1880 0x1880: 0x0f61, 0x1881: 0x0f71, 0x1882: 0x00d9, 0x1883: 0x0f99, 0x1884: 0x2039, 0x1885: 0x0269, 0x1886: 0x01d9, 0x1887: 0x0fa9, 0x1888: 0x0fb9, 0x1889: 0x1089, 0x188a: 0x0279, 0x188b: 0x0369, 0x188c: 0x0289, 0x188d: 0x13d1, 0x188e: 0x0039, 0x188f: 0x0ee9, 0x1890: 0x1159, 0x1891: 0x0ef9, 0x1892: 0x0f09, 0x1893: 0x1199, 0x1894: 0x0f31, 0x1895: 0x0040, 0x1896: 0x0f41, 0x1897: 0x0259, 0x1898: 0x0f51, 0x1899: 0x0359, 0x189a: 0x0f61, 0x189b: 0x0f71, 0x189c: 0x00d9, 0x189d: 0x0f99, 0x189e: 0x2039, 0x189f: 0x0269, 0x18a0: 0x01d9, 0x18a1: 0x0fa9, 0x18a2: 0x0fb9, 0x18a3: 0x1089, 0x18a4: 0x0279, 0x18a5: 0x0369, 0x18a6: 0x0289, 0x18a7: 0x13d1, 0x18a8: 0x0039, 0x18a9: 0x0ee9, 0x18aa: 0x1159, 0x18ab: 0x0ef9, 0x18ac: 0x0f09, 0x18ad: 0x1199, 0x18ae: 0x0f31, 0x18af: 0x0249, 0x18b0: 0x0f41, 0x18b1: 0x0259, 0x18b2: 0x0f51, 0x18b3: 0x0359, 0x18b4: 0x0f61, 0x18b5: 0x0f71, 0x18b6: 0x00d9, 0x18b7: 0x0f99, 0x18b8: 0x2039, 0x18b9: 0x0269, 0x18ba: 0x01d9, 0x18bb: 0x0fa9, 0x18bc: 0x0fb9, 0x18bd: 0x1089, 0x18be: 0x0279, 0x18bf: 0x0369, // Block 0x63, offset 0x18c0 0x18c0: 0x0289, 0x18c1: 0x13d1, 0x18c2: 0x0039, 0x18c3: 0x0ee9, 0x18c4: 0x1159, 0x18c5: 0x0ef9, 0x18c6: 0x0f09, 0x18c7: 0x1199, 0x18c8: 0x0f31, 0x18c9: 0x0249, 0x18ca: 0x0f41, 0x18cb: 0x0259, 0x18cc: 0x0f51, 0x18cd: 0x0359, 0x18ce: 0x0f61, 0x18cf: 0x0f71, 0x18d0: 0x00d9, 0x18d1: 0x0f99, 0x18d2: 0x2039, 0x18d3: 0x0269, 0x18d4: 0x01d9, 0x18d5: 0x0fa9, 0x18d6: 0x0fb9, 0x18d7: 0x1089, 0x18d8: 0x0279, 0x18d9: 0x0369, 0x18da: 0x0289, 0x18db: 0x13d1, 0x18dc: 0x0039, 0x18dd: 0x0040, 0x18de: 0x1159, 0x18df: 0x0ef9, 0x18e0: 0x0040, 0x18e1: 0x0040, 0x18e2: 0x0f31, 0x18e3: 0x0040, 0x18e4: 0x0040, 0x18e5: 0x0259, 0x18e6: 0x0f51, 0x18e7: 0x0040, 0x18e8: 0x0040, 0x18e9: 0x0f71, 0x18ea: 0x00d9, 0x18eb: 0x0f99, 0x18ec: 0x2039, 0x18ed: 0x0040, 0x18ee: 0x01d9, 0x18ef: 0x0fa9, 0x18f0: 0x0fb9, 0x18f1: 0x1089, 0x18f2: 0x0279, 0x18f3: 0x0369, 0x18f4: 0x0289, 0x18f5: 0x13d1, 0x18f6: 0x0039, 0x18f7: 0x0ee9, 0x18f8: 0x1159, 0x18f9: 0x0ef9, 0x18fa: 0x0040, 0x18fb: 0x1199, 0x18fc: 0x0040, 0x18fd: 0x0249, 0x18fe: 0x0f41, 0x18ff: 0x0259, // Block 0x64, offset 0x1900 0x1900: 0x0f51, 0x1901: 0x0359, 0x1902: 0x0f61, 0x1903: 0x0f71, 0x1904: 0x0040, 0x1905: 0x0f99, 0x1906: 0x2039, 0x1907: 0x0269, 0x1908: 0x01d9, 0x1909: 0x0fa9, 0x190a: 0x0fb9, 0x190b: 0x1089, 0x190c: 0x0279, 0x190d: 0x0369, 0x190e: 0x0289, 0x190f: 0x13d1, 0x1910: 0x0039, 0x1911: 0x0ee9, 0x1912: 0x1159, 0x1913: 0x0ef9, 0x1914: 0x0f09, 0x1915: 0x1199, 0x1916: 0x0f31, 0x1917: 0x0249, 0x1918: 0x0f41, 0x1919: 0x0259, 0x191a: 0x0f51, 0x191b: 0x0359, 0x191c: 0x0f61, 0x191d: 0x0f71, 0x191e: 0x00d9, 0x191f: 0x0f99, 0x1920: 0x2039, 0x1921: 0x0269, 0x1922: 0x01d9, 0x1923: 0x0fa9, 0x1924: 0x0fb9, 0x1925: 0x1089, 0x1926: 0x0279, 0x1927: 0x0369, 0x1928: 0x0289, 0x1929: 0x13d1, 0x192a: 0x0039, 0x192b: 0x0ee9, 0x192c: 0x1159, 0x192d: 0x0ef9, 0x192e: 0x0f09, 0x192f: 0x1199, 0x1930: 0x0f31, 0x1931: 0x0249, 0x1932: 0x0f41, 0x1933: 0x0259, 0x1934: 0x0f51, 0x1935: 0x0359, 0x1936: 0x0f61, 0x1937: 0x0f71, 0x1938: 0x00d9, 0x1939: 0x0f99, 0x193a: 0x2039, 0x193b: 0x0269, 0x193c: 0x01d9, 0x193d: 0x0fa9, 0x193e: 0x0fb9, 0x193f: 0x1089, // Block 0x65, offset 0x1940 0x1940: 0x0279, 0x1941: 0x0369, 0x1942: 0x0289, 0x1943: 0x13d1, 0x1944: 0x0039, 0x1945: 0x0ee9, 0x1946: 0x0040, 0x1947: 0x0ef9, 0x1948: 0x0f09, 0x1949: 0x1199, 0x194a: 0x0f31, 0x194b: 0x0040, 0x194c: 0x0040, 0x194d: 0x0259, 0x194e: 0x0f51, 0x194f: 0x0359, 0x1950: 0x0f61, 0x1951: 0x0f71, 0x1952: 0x00d9, 0x1953: 0x0f99, 0x1954: 0x2039, 0x1955: 0x0040, 0x1956: 0x01d9, 0x1957: 0x0fa9, 0x1958: 0x0fb9, 0x1959: 0x1089, 0x195a: 0x0279, 0x195b: 0x0369, 0x195c: 0x0289, 0x195d: 0x0040, 0x195e: 0x0039, 0x195f: 0x0ee9, 0x1960: 0x1159, 0x1961: 0x0ef9, 0x1962: 0x0f09, 0x1963: 0x1199, 0x1964: 0x0f31, 0x1965: 0x0249, 0x1966: 0x0f41, 0x1967: 0x0259, 0x1968: 0x0f51, 0x1969: 0x0359, 0x196a: 0x0f61, 0x196b: 0x0f71, 0x196c: 0x00d9, 0x196d: 0x0f99, 0x196e: 0x2039, 0x196f: 0x0269, 0x1970: 0x01d9, 0x1971: 0x0fa9, 0x1972: 0x0fb9, 0x1973: 0x1089, 0x1974: 0x0279, 0x1975: 0x0369, 0x1976: 0x0289, 0x1977: 0x13d1, 0x1978: 0x0039, 0x1979: 0x0ee9, 0x197a: 0x0040, 0x197b: 0x0ef9, 0x197c: 0x0f09, 0x197d: 0x1199, 0x197e: 0x0f31, 0x197f: 0x0040, // Block 0x66, offset 0x1980 0x1980: 0x0f41, 0x1981: 0x0259, 0x1982: 0x0f51, 0x1983: 0x0359, 0x1984: 0x0f61, 0x1985: 0x0040, 0x1986: 0x00d9, 0x1987: 0x0040, 0x1988: 0x0040, 0x1989: 0x0040, 0x198a: 0x01d9, 0x198b: 0x0fa9, 0x198c: 0x0fb9, 0x198d: 0x1089, 0x198e: 0x0279, 0x198f: 0x0369, 0x1990: 0x0289, 0x1991: 0x0040, 0x1992: 0x0039, 0x1993: 0x0ee9, 0x1994: 0x1159, 0x1995: 0x0ef9, 0x1996: 0x0f09, 0x1997: 0x1199, 0x1998: 0x0f31, 0x1999: 0x0249, 0x199a: 0x0f41, 0x199b: 0x0259, 0x199c: 0x0f51, 0x199d: 0x0359, 0x199e: 0x0f61, 0x199f: 0x0f71, 0x19a0: 0x00d9, 0x19a1: 0x0f99, 0x19a2: 0x2039, 0x19a3: 0x0269, 0x19a4: 0x01d9, 0x19a5: 0x0fa9, 0x19a6: 0x0fb9, 0x19a7: 0x1089, 0x19a8: 0x0279, 0x19a9: 0x0369, 0x19aa: 0x0289, 0x19ab: 0x13d1, 0x19ac: 0x0039, 0x19ad: 0x0ee9, 0x19ae: 0x1159, 0x19af: 0x0ef9, 0x19b0: 0x0f09, 0x19b1: 0x1199, 0x19b2: 0x0f31, 0x19b3: 0x0249, 0x19b4: 0x0f41, 0x19b5: 0x0259, 0x19b6: 0x0f51, 0x19b7: 0x0359, 0x19b8: 0x0f61, 0x19b9: 0x0f71, 0x19ba: 0x00d9, 0x19bb: 0x0f99, 0x19bc: 0x2039, 0x19bd: 0x0269, 0x19be: 0x01d9, 0x19bf: 0x0fa9, // Block 0x67, offset 0x19c0 0x19c0: 0x0fb9, 0x19c1: 0x1089, 0x19c2: 0x0279, 0x19c3: 0x0369, 0x19c4: 0x0289, 0x19c5: 0x13d1, 0x19c6: 0x0039, 0x19c7: 0x0ee9, 0x19c8: 0x1159, 0x19c9: 0x0ef9, 0x19ca: 0x0f09, 0x19cb: 0x1199, 0x19cc: 0x0f31, 0x19cd: 0x0249, 0x19ce: 0x0f41, 0x19cf: 0x0259, 0x19d0: 0x0f51, 0x19d1: 0x0359, 0x19d2: 0x0f61, 0x19d3: 0x0f71, 0x19d4: 0x00d9, 0x19d5: 0x0f99, 0x19d6: 0x2039, 0x19d7: 0x0269, 0x19d8: 0x01d9, 0x19d9: 0x0fa9, 0x19da: 0x0fb9, 0x19db: 0x1089, 0x19dc: 0x0279, 0x19dd: 0x0369, 0x19de: 0x0289, 0x19df: 0x13d1, 0x19e0: 0x0039, 0x19e1: 0x0ee9, 0x19e2: 0x1159, 0x19e3: 0x0ef9, 0x19e4: 0x0f09, 0x19e5: 0x1199, 0x19e6: 0x0f31, 0x19e7: 0x0249, 0x19e8: 0x0f41, 0x19e9: 0x0259, 0x19ea: 0x0f51, 0x19eb: 0x0359, 0x19ec: 0x0f61, 0x19ed: 0x0f71, 0x19ee: 0x00d9, 0x19ef: 0x0f99, 0x19f0: 0x2039, 0x19f1: 0x0269, 0x19f2: 0x01d9, 0x19f3: 0x0fa9, 0x19f4: 0x0fb9, 0x19f5: 0x1089, 0x19f6: 0x0279, 0x19f7: 0x0369, 0x19f8: 0x0289, 0x19f9: 0x13d1, 0x19fa: 0x0039, 0x19fb: 0x0ee9, 0x19fc: 0x1159, 0x19fd: 0x0ef9, 0x19fe: 0x0f09, 0x19ff: 0x1199, // Block 0x68, offset 0x1a00 0x1a00: 0x0f31, 0x1a01: 0x0249, 0x1a02: 0x0f41, 0x1a03: 0x0259, 0x1a04: 0x0f51, 0x1a05: 0x0359, 0x1a06: 0x0f61, 0x1a07: 0x0f71, 0x1a08: 0x00d9, 0x1a09: 0x0f99, 0x1a0a: 0x2039, 0x1a0b: 0x0269, 0x1a0c: 0x01d9, 0x1a0d: 0x0fa9, 0x1a0e: 0x0fb9, 0x1a0f: 0x1089, 0x1a10: 0x0279, 0x1a11: 0x0369, 0x1a12: 0x0289, 0x1a13: 0x13d1, 0x1a14: 0x0039, 0x1a15: 0x0ee9, 0x1a16: 0x1159, 0x1a17: 0x0ef9, 0x1a18: 0x0f09, 0x1a19: 0x1199, 0x1a1a: 0x0f31, 0x1a1b: 0x0249, 0x1a1c: 0x0f41, 0x1a1d: 0x0259, 0x1a1e: 0x0f51, 0x1a1f: 0x0359, 0x1a20: 0x0f61, 0x1a21: 0x0f71, 0x1a22: 0x00d9, 0x1a23: 0x0f99, 0x1a24: 0x2039, 0x1a25: 0x0269, 0x1a26: 0x01d9, 0x1a27: 0x0fa9, 0x1a28: 0x0fb9, 0x1a29: 0x1089, 0x1a2a: 0x0279, 0x1a2b: 0x0369, 0x1a2c: 0x0289, 0x1a2d: 0x13d1, 0x1a2e: 0x0039, 0x1a2f: 0x0ee9, 0x1a30: 0x1159, 0x1a31: 0x0ef9, 0x1a32: 0x0f09, 0x1a33: 0x1199, 0x1a34: 0x0f31, 0x1a35: 0x0249, 0x1a36: 0x0f41, 0x1a37: 0x0259, 0x1a38: 0x0f51, 0x1a39: 0x0359, 0x1a3a: 0x0f61, 0x1a3b: 0x0f71, 0x1a3c: 0x00d9, 0x1a3d: 0x0f99, 0x1a3e: 0x2039, 0x1a3f: 0x0269, // Block 0x69, offset 0x1a40 0x1a40: 0x01d9, 0x1a41: 0x0fa9, 0x1a42: 0x0fb9, 0x1a43: 0x1089, 0x1a44: 0x0279, 0x1a45: 0x0369, 0x1a46: 0x0289, 0x1a47: 0x13d1, 0x1a48: 0x0039, 0x1a49: 0x0ee9, 0x1a4a: 0x1159, 0x1a4b: 0x0ef9, 0x1a4c: 0x0f09, 0x1a4d: 0x1199, 0x1a4e: 0x0f31, 0x1a4f: 0x0249, 0x1a50: 0x0f41, 0x1a51: 0x0259, 0x1a52: 0x0f51, 0x1a53: 0x0359, 0x1a54: 0x0f61, 0x1a55: 0x0f71, 0x1a56: 0x00d9, 0x1a57: 0x0f99, 0x1a58: 0x2039, 0x1a59: 0x0269, 0x1a5a: 0x01d9, 0x1a5b: 0x0fa9, 0x1a5c: 0x0fb9, 0x1a5d: 0x1089, 0x1a5e: 0x0279, 0x1a5f: 0x0369, 0x1a60: 0x0289, 0x1a61: 0x13d1, 0x1a62: 0x0039, 0x1a63: 0x0ee9, 0x1a64: 0x1159, 0x1a65: 0x0ef9, 0x1a66: 0x0f09, 0x1a67: 0x1199, 0x1a68: 0x0f31, 0x1a69: 0x0249, 0x1a6a: 0x0f41, 0x1a6b: 0x0259, 0x1a6c: 0x0f51, 0x1a6d: 0x0359, 0x1a6e: 0x0f61, 0x1a6f: 0x0f71, 0x1a70: 0x00d9, 0x1a71: 0x0f99, 0x1a72: 0x2039, 0x1a73: 0x0269, 0x1a74: 0x01d9, 0x1a75: 0x0fa9, 0x1a76: 0x0fb9, 0x1a77: 0x1089, 0x1a78: 0x0279, 0x1a79: 0x0369, 0x1a7a: 0x0289, 0x1a7b: 0x13d1, 0x1a7c: 0x0039, 0x1a7d: 0x0ee9, 0x1a7e: 0x1159, 0x1a7f: 0x0ef9, // Block 0x6a, offset 0x1a80 0x1a80: 0x0f09, 0x1a81: 0x1199, 0x1a82: 0x0f31, 0x1a83: 0x0249, 0x1a84: 0x0f41, 0x1a85: 0x0259, 0x1a86: 0x0f51, 0x1a87: 0x0359, 0x1a88: 0x0f61, 0x1a89: 0x0f71, 0x1a8a: 0x00d9, 0x1a8b: 0x0f99, 0x1a8c: 0x2039, 0x1a8d: 0x0269, 0x1a8e: 0x01d9, 0x1a8f: 0x0fa9, 0x1a90: 0x0fb9, 0x1a91: 0x1089, 0x1a92: 0x0279, 0x1a93: 0x0369, 0x1a94: 0x0289, 0x1a95: 0x13d1, 0x1a96: 0x0039, 0x1a97: 0x0ee9, 0x1a98: 0x1159, 0x1a99: 0x0ef9, 0x1a9a: 0x0f09, 0x1a9b: 0x1199, 0x1a9c: 0x0f31, 0x1a9d: 0x0249, 0x1a9e: 0x0f41, 0x1a9f: 0x0259, 0x1aa0: 0x0f51, 0x1aa1: 0x0359, 0x1aa2: 0x0f61, 0x1aa3: 0x0f71, 0x1aa4: 0x00d9, 0x1aa5: 0x0f99, 0x1aa6: 0x2039, 0x1aa7: 0x0269, 0x1aa8: 0x01d9, 0x1aa9: 0x0fa9, 0x1aaa: 0x0fb9, 0x1aab: 0x1089, 0x1aac: 0x0279, 0x1aad: 0x0369, 0x1aae: 0x0289, 0x1aaf: 0x13d1, 0x1ab0: 0x0039, 0x1ab1: 0x0ee9, 0x1ab2: 0x1159, 0x1ab3: 0x0ef9, 0x1ab4: 0x0f09, 0x1ab5: 0x1199, 0x1ab6: 0x0f31, 0x1ab7: 0x0249, 0x1ab8: 0x0f41, 0x1ab9: 0x0259, 0x1aba: 0x0f51, 0x1abb: 0x0359, 0x1abc: 0x0f61, 0x1abd: 0x0f71, 0x1abe: 0x00d9, 0x1abf: 0x0f99, // Block 0x6b, offset 0x1ac0 0x1ac0: 0x2039, 0x1ac1: 0x0269, 0x1ac2: 0x01d9, 0x1ac3: 0x0fa9, 0x1ac4: 0x0fb9, 0x1ac5: 0x1089, 0x1ac6: 0x0279, 0x1ac7: 0x0369, 0x1ac8: 0x0289, 0x1ac9: 0x13d1, 0x1aca: 0x0039, 0x1acb: 0x0ee9, 0x1acc: 0x1159, 0x1acd: 0x0ef9, 0x1ace: 0x0f09, 0x1acf: 0x1199, 0x1ad0: 0x0f31, 0x1ad1: 0x0249, 0x1ad2: 0x0f41, 0x1ad3: 0x0259, 0x1ad4: 0x0f51, 0x1ad5: 0x0359, 0x1ad6: 0x0f61, 0x1ad7: 0x0f71, 0x1ad8: 0x00d9, 0x1ad9: 0x0f99, 0x1ada: 0x2039, 0x1adb: 0x0269, 0x1adc: 0x01d9, 0x1add: 0x0fa9, 0x1ade: 0x0fb9, 0x1adf: 0x1089, 0x1ae0: 0x0279, 0x1ae1: 0x0369, 0x1ae2: 0x0289, 0x1ae3: 0x13d1, 0x1ae4: 0xba81, 0x1ae5: 0xba99, 0x1ae6: 0x0040, 0x1ae7: 0x0040, 0x1ae8: 0xbab1, 0x1ae9: 0x1099, 0x1aea: 0x10b1, 0x1aeb: 0x10c9, 0x1aec: 0xbac9, 0x1aed: 0xbae1, 0x1aee: 0xbaf9, 0x1aef: 0x1429, 0x1af0: 0x1a31, 0x1af1: 0xbb11, 0x1af2: 0xbb29, 0x1af3: 0xbb41, 0x1af4: 0xbb59, 0x1af5: 0xbb71, 0x1af6: 0xbb89, 0x1af7: 0x2109, 0x1af8: 0x1111, 0x1af9: 0x1429, 0x1afa: 0xbba1, 0x1afb: 0xbbb9, 0x1afc: 0xbbd1, 0x1afd: 0x10e1, 0x1afe: 0x10f9, 0x1aff: 0xbbe9, // Block 0x6c, offset 0x1b00 0x1b00: 0x2079, 0x1b01: 0xbc01, 0x1b02: 0xbab1, 0x1b03: 0x1099, 0x1b04: 0x10b1, 0x1b05: 0x10c9, 0x1b06: 0xbac9, 0x1b07: 0xbae1, 0x1b08: 0xbaf9, 0x1b09: 0x1429, 0x1b0a: 0x1a31, 0x1b0b: 0xbb11, 0x1b0c: 0xbb29, 0x1b0d: 0xbb41, 0x1b0e: 0xbb59, 0x1b0f: 0xbb71, 0x1b10: 0xbb89, 0x1b11: 0x2109, 0x1b12: 0x1111, 0x1b13: 0xbba1, 0x1b14: 0xbba1, 0x1b15: 0xbbb9, 0x1b16: 0xbbd1, 0x1b17: 0x10e1, 0x1b18: 0x10f9, 0x1b19: 0xbbe9, 0x1b1a: 0x2079, 0x1b1b: 0xbc21, 0x1b1c: 0xbac9, 0x1b1d: 0x1429, 0x1b1e: 0xbb11, 0x1b1f: 0x10e1, 0x1b20: 0x1111, 0x1b21: 0x2109, 0x1b22: 0xbab1, 0x1b23: 0x1099, 0x1b24: 0x10b1, 0x1b25: 0x10c9, 0x1b26: 0xbac9, 0x1b27: 0xbae1, 0x1b28: 0xbaf9, 0x1b29: 0x1429, 0x1b2a: 0x1a31, 0x1b2b: 0xbb11, 0x1b2c: 0xbb29, 0x1b2d: 0xbb41, 0x1b2e: 0xbb59, 0x1b2f: 0xbb71, 0x1b30: 0xbb89, 0x1b31: 0x2109, 0x1b32: 0x1111, 0x1b33: 0x1429, 0x1b34: 0xbba1, 0x1b35: 0xbbb9, 0x1b36: 0xbbd1, 0x1b37: 0x10e1, 0x1b38: 0x10f9, 0x1b39: 0xbbe9, 0x1b3a: 0x2079, 0x1b3b: 0xbc01, 0x1b3c: 0xbab1, 0x1b3d: 0x1099, 0x1b3e: 0x10b1, 0x1b3f: 0x10c9, // Block 0x6d, offset 0x1b40 0x1b40: 0xbac9, 0x1b41: 0xbae1, 0x1b42: 0xbaf9, 0x1b43: 0x1429, 0x1b44: 0x1a31, 0x1b45: 0xbb11, 0x1b46: 0xbb29, 0x1b47: 0xbb41, 0x1b48: 0xbb59, 0x1b49: 0xbb71, 0x1b4a: 0xbb89, 0x1b4b: 0x2109, 0x1b4c: 0x1111, 0x1b4d: 0xbba1, 0x1b4e: 0xbba1, 0x1b4f: 0xbbb9, 0x1b50: 0xbbd1, 0x1b51: 0x10e1, 0x1b52: 0x10f9, 0x1b53: 0xbbe9, 0x1b54: 0x2079, 0x1b55: 0xbc21, 0x1b56: 0xbac9, 0x1b57: 0x1429, 0x1b58: 0xbb11, 0x1b59: 0x10e1, 0x1b5a: 0x1111, 0x1b5b: 0x2109, 0x1b5c: 0xbab1, 0x1b5d: 0x1099, 0x1b5e: 0x10b1, 0x1b5f: 0x10c9, 0x1b60: 0xbac9, 0x1b61: 0xbae1, 0x1b62: 0xbaf9, 0x1b63: 0x1429, 0x1b64: 0x1a31, 0x1b65: 0xbb11, 0x1b66: 0xbb29, 0x1b67: 0xbb41, 0x1b68: 0xbb59, 0x1b69: 0xbb71, 0x1b6a: 0xbb89, 0x1b6b: 0x2109, 0x1b6c: 0x1111, 0x1b6d: 0x1429, 0x1b6e: 0xbba1, 0x1b6f: 0xbbb9, 0x1b70: 0xbbd1, 0x1b71: 0x10e1, 0x1b72: 0x10f9, 0x1b73: 0xbbe9, 0x1b74: 0x2079, 0x1b75: 0xbc01, 0x1b76: 0xbab1, 0x1b77: 0x1099, 0x1b78: 0x10b1, 0x1b79: 0x10c9, 0x1b7a: 0xbac9, 0x1b7b: 0xbae1, 0x1b7c: 0xbaf9, 0x1b7d: 0x1429, 0x1b7e: 0x1a31, 0x1b7f: 0xbb11, // Block 0x6e, offset 0x1b80 0x1b80: 0xbb29, 0x1b81: 0xbb41, 0x1b82: 0xbb59, 0x1b83: 0xbb71, 0x1b84: 0xbb89, 0x1b85: 0x2109, 0x1b86: 0x1111, 0x1b87: 0xbba1, 0x1b88: 0xbba1, 0x1b89: 0xbbb9, 0x1b8a: 0xbbd1, 0x1b8b: 0x10e1, 0x1b8c: 0x10f9, 0x1b8d: 0xbbe9, 0x1b8e: 0x2079, 0x1b8f: 0xbc21, 0x1b90: 0xbac9, 0x1b91: 0x1429, 0x1b92: 0xbb11, 0x1b93: 0x10e1, 0x1b94: 0x1111, 0x1b95: 0x2109, 0x1b96: 0xbab1, 0x1b97: 0x1099, 0x1b98: 0x10b1, 0x1b99: 0x10c9, 0x1b9a: 0xbac9, 0x1b9b: 0xbae1, 0x1b9c: 0xbaf9, 0x1b9d: 0x1429, 0x1b9e: 0x1a31, 0x1b9f: 0xbb11, 0x1ba0: 0xbb29, 0x1ba1: 0xbb41, 0x1ba2: 0xbb59, 0x1ba3: 0xbb71, 0x1ba4: 0xbb89, 0x1ba5: 0x2109, 0x1ba6: 0x1111, 0x1ba7: 0x1429, 0x1ba8: 0xbba1, 0x1ba9: 0xbbb9, 0x1baa: 0xbbd1, 0x1bab: 0x10e1, 0x1bac: 0x10f9, 0x1bad: 0xbbe9, 0x1bae: 0x2079, 0x1baf: 0xbc01, 0x1bb0: 0xbab1, 0x1bb1: 0x1099, 0x1bb2: 0x10b1, 0x1bb3: 0x10c9, 0x1bb4: 0xbac9, 0x1bb5: 0xbae1, 0x1bb6: 0xbaf9, 0x1bb7: 0x1429, 0x1bb8: 0x1a31, 0x1bb9: 0xbb11, 0x1bba: 0xbb29, 0x1bbb: 0xbb41, 0x1bbc: 0xbb59, 0x1bbd: 0xbb71, 0x1bbe: 0xbb89, 0x1bbf: 0x2109, // Block 0x6f, offset 0x1bc0 0x1bc0: 0x1111, 0x1bc1: 0xbba1, 0x1bc2: 0xbba1, 0x1bc3: 0xbbb9, 0x1bc4: 0xbbd1, 0x1bc5: 0x10e1, 0x1bc6: 0x10f9, 0x1bc7: 0xbbe9, 0x1bc8: 0x2079, 0x1bc9: 0xbc21, 0x1bca: 0xbac9, 0x1bcb: 0x1429, 0x1bcc: 0xbb11, 0x1bcd: 0x10e1, 0x1bce: 0x1111, 0x1bcf: 0x2109, 0x1bd0: 0xbab1, 0x1bd1: 0x1099, 0x1bd2: 0x10b1, 0x1bd3: 0x10c9, 0x1bd4: 0xbac9, 0x1bd5: 0xbae1, 0x1bd6: 0xbaf9, 0x1bd7: 0x1429, 0x1bd8: 0x1a31, 0x1bd9: 0xbb11, 0x1bda: 0xbb29, 0x1bdb: 0xbb41, 0x1bdc: 0xbb59, 0x1bdd: 0xbb71, 0x1bde: 0xbb89, 0x1bdf: 0x2109, 0x1be0: 0x1111, 0x1be1: 0x1429, 0x1be2: 0xbba1, 0x1be3: 0xbbb9, 0x1be4: 0xbbd1, 0x1be5: 0x10e1, 0x1be6: 0x10f9, 0x1be7: 0xbbe9, 0x1be8: 0x2079, 0x1be9: 0xbc01, 0x1bea: 0xbab1, 0x1beb: 0x1099, 0x1bec: 0x10b1, 0x1bed: 0x10c9, 0x1bee: 0xbac9, 0x1bef: 0xbae1, 0x1bf0: 0xbaf9, 0x1bf1: 0x1429, 0x1bf2: 0x1a31, 0x1bf3: 0xbb11, 0x1bf4: 0xbb29, 0x1bf5: 0xbb41, 0x1bf6: 0xbb59, 0x1bf7: 0xbb71, 0x1bf8: 0xbb89, 0x1bf9: 0x2109, 0x1bfa: 0x1111, 0x1bfb: 0xbba1, 0x1bfc: 0xbba1, 0x1bfd: 0xbbb9, 0x1bfe: 0xbbd1, 0x1bff: 0x10e1, // Block 0x70, offset 0x1c00 0x1c00: 0x10f9, 0x1c01: 0xbbe9, 0x1c02: 0x2079, 0x1c03: 0xbc21, 0x1c04: 0xbac9, 0x1c05: 0x1429, 0x1c06: 0xbb11, 0x1c07: 0x10e1, 0x1c08: 0x1111, 0x1c09: 0x2109, 0x1c0a: 0xbc41, 0x1c0b: 0xbc41, 0x1c0c: 0x0040, 0x1c0d: 0x0040, 0x1c0e: 0x1f41, 0x1c0f: 0x00c9, 0x1c10: 0x0069, 0x1c11: 0x0079, 0x1c12: 0x1f51, 0x1c13: 0x1f61, 0x1c14: 0x1f71, 0x1c15: 0x1f81, 0x1c16: 0x1f91, 0x1c17: 0x1fa1, 0x1c18: 0x1f41, 0x1c19: 0x00c9, 0x1c1a: 0x0069, 0x1c1b: 0x0079, 0x1c1c: 0x1f51, 0x1c1d: 0x1f61, 0x1c1e: 0x1f71, 0x1c1f: 0x1f81, 0x1c20: 0x1f91, 0x1c21: 0x1fa1, 0x1c22: 0x1f41, 0x1c23: 0x00c9, 0x1c24: 0x0069, 0x1c25: 0x0079, 0x1c26: 0x1f51, 0x1c27: 0x1f61, 0x1c28: 0x1f71, 0x1c29: 0x1f81, 0x1c2a: 0x1f91, 0x1c2b: 0x1fa1, 0x1c2c: 0x1f41, 0x1c2d: 0x00c9, 0x1c2e: 0x0069, 0x1c2f: 0x0079, 0x1c30: 0x1f51, 0x1c31: 0x1f61, 0x1c32: 0x1f71, 0x1c33: 0x1f81, 0x1c34: 0x1f91, 0x1c35: 0x1fa1, 0x1c36: 0x1f41, 0x1c37: 0x00c9, 0x1c38: 0x0069, 0x1c39: 0x0079, 0x1c3a: 0x1f51, 0x1c3b: 0x1f61, 0x1c3c: 0x1f71, 0x1c3d: 0x1f81, 0x1c3e: 0x1f91, 0x1c3f: 0x1fa1, // Block 0x71, offset 0x1c40 0x1c40: 0xe115, 0x1c41: 0xe115, 0x1c42: 0xe135, 0x1c43: 0xe135, 0x1c44: 0xe115, 0x1c45: 0xe115, 0x1c46: 0xe175, 0x1c47: 0xe175, 0x1c48: 0xe115, 0x1c49: 0xe115, 0x1c4a: 0xe135, 0x1c4b: 0xe135, 0x1c4c: 0xe115, 0x1c4d: 0xe115, 0x1c4e: 0xe1f5, 0x1c4f: 0xe1f5, 0x1c50: 0xe115, 0x1c51: 0xe115, 0x1c52: 0xe135, 0x1c53: 0xe135, 0x1c54: 0xe115, 0x1c55: 0xe115, 0x1c56: 0xe175, 0x1c57: 0xe175, 0x1c58: 0xe115, 0x1c59: 0xe115, 0x1c5a: 0xe135, 0x1c5b: 0xe135, 0x1c5c: 0xe115, 0x1c5d: 0xe115, 0x1c5e: 0x8b05, 0x1c5f: 0x8b05, 0x1c60: 0x04b5, 0x1c61: 0x04b5, 0x1c62: 0x0a08, 0x1c63: 0x0a08, 0x1c64: 0x0a08, 0x1c65: 0x0a08, 0x1c66: 0x0a08, 0x1c67: 0x0a08, 0x1c68: 0x0a08, 0x1c69: 0x0a08, 0x1c6a: 0x0a08, 0x1c6b: 0x0a08, 0x1c6c: 0x0a08, 0x1c6d: 0x0a08, 0x1c6e: 0x0a08, 0x1c6f: 0x0a08, 0x1c70: 0x0a08, 0x1c71: 0x0a08, 0x1c72: 0x0a08, 0x1c73: 0x0a08, 0x1c74: 0x0a08, 0x1c75: 0x0a08, 0x1c76: 0x0a08, 0x1c77: 0x0a08, 0x1c78: 0x0a08, 0x1c79: 0x0a08, 0x1c7a: 0x0a08, 0x1c7b: 0x0a08, 0x1c7c: 0x0a08, 0x1c7d: 0x0a08, 0x1c7e: 0x0a08, 0x1c7f: 0x0a08, // Block 0x72, offset 0x1c80 0x1c80: 0xb189, 0x1c81: 0xb1a1, 0x1c82: 0xb201, 0x1c83: 0xb249, 0x1c84: 0x0040, 0x1c85: 0xb411, 0x1c86: 0xb291, 0x1c87: 0xb219, 0x1c88: 0xb309, 0x1c89: 0xb429, 0x1c8a: 0xb399, 0x1c8b: 0xb3b1, 0x1c8c: 0xb3c9, 0x1c8d: 0xb3e1, 0x1c8e: 0xb2a9, 0x1c8f: 0xb339, 0x1c90: 0xb369, 0x1c91: 0xb2d9, 0x1c92: 0xb381, 0x1c93: 0xb279, 0x1c94: 0xb2c1, 0x1c95: 0xb1d1, 0x1c96: 0xb1e9, 0x1c97: 0xb231, 0x1c98: 0xb261, 0x1c99: 0xb2f1, 0x1c9a: 0xb321, 0x1c9b: 0xb351, 0x1c9c: 0xbc59, 0x1c9d: 0x7949, 0x1c9e: 0xbc71, 0x1c9f: 0xbc89, 0x1ca0: 0x0040, 0x1ca1: 0xb1a1, 0x1ca2: 0xb201, 0x1ca3: 0x0040, 0x1ca4: 0xb3f9, 0x1ca5: 0x0040, 0x1ca6: 0x0040, 0x1ca7: 0xb219, 0x1ca8: 0x0040, 0x1ca9: 0xb429, 0x1caa: 0xb399, 0x1cab: 0xb3b1, 0x1cac: 0xb3c9, 0x1cad: 0xb3e1, 0x1cae: 0xb2a9, 0x1caf: 0xb339, 0x1cb0: 0xb369, 0x1cb1: 0xb2d9, 0x1cb2: 0xb381, 0x1cb3: 0x0040, 0x1cb4: 0xb2c1, 0x1cb5: 0xb1d1, 0x1cb6: 0xb1e9, 0x1cb7: 0xb231, 0x1cb8: 0x0040, 0x1cb9: 0xb2f1, 0x1cba: 0x0040, 0x1cbb: 0xb351, 0x1cbc: 0x0040, 0x1cbd: 0x0040, 0x1cbe: 0x0040, 0x1cbf: 0x0040, // Block 0x73, offset 0x1cc0 0x1cc0: 0x0040, 0x1cc1: 0x0040, 0x1cc2: 0xb201, 0x1cc3: 0x0040, 0x1cc4: 0x0040, 0x1cc5: 0x0040, 0x1cc6: 0x0040, 0x1cc7: 0xb219, 0x1cc8: 0x0040, 0x1cc9: 0xb429, 0x1cca: 0x0040, 0x1ccb: 0xb3b1, 0x1ccc: 0x0040, 0x1ccd: 0xb3e1, 0x1cce: 0xb2a9, 0x1ccf: 0xb339, 0x1cd0: 0x0040, 0x1cd1: 0xb2d9, 0x1cd2: 0xb381, 0x1cd3: 0x0040, 0x1cd4: 0xb2c1, 0x1cd5: 0x0040, 0x1cd6: 0x0040, 0x1cd7: 0xb231, 0x1cd8: 0x0040, 0x1cd9: 0xb2f1, 0x1cda: 0x0040, 0x1cdb: 0xb351, 0x1cdc: 0x0040, 0x1cdd: 0x7949, 0x1cde: 0x0040, 0x1cdf: 0xbc89, 0x1ce0: 0x0040, 0x1ce1: 0xb1a1, 0x1ce2: 0xb201, 0x1ce3: 0x0040, 0x1ce4: 0xb3f9, 0x1ce5: 0x0040, 0x1ce6: 0x0040, 0x1ce7: 0xb219, 0x1ce8: 0xb309, 0x1ce9: 0xb429, 0x1cea: 0xb399, 0x1ceb: 0x0040, 0x1cec: 0xb3c9, 0x1ced: 0xb3e1, 0x1cee: 0xb2a9, 0x1cef: 0xb339, 0x1cf0: 0xb369, 0x1cf1: 0xb2d9, 0x1cf2: 0xb381, 0x1cf3: 0x0040, 0x1cf4: 0xb2c1, 0x1cf5: 0xb1d1, 0x1cf6: 0xb1e9, 0x1cf7: 0xb231, 0x1cf8: 0x0040, 0x1cf9: 0xb2f1, 0x1cfa: 0xb321, 0x1cfb: 0xb351, 0x1cfc: 0xbc59, 0x1cfd: 0x0040, 0x1cfe: 0xbc71, 0x1cff: 0x0040, // Block 0x74, offset 0x1d00 0x1d00: 0xb189, 0x1d01: 0xb1a1, 0x1d02: 0xb201, 0x1d03: 0xb249, 0x1d04: 0xb3f9, 0x1d05: 0xb411, 0x1d06: 0xb291, 0x1d07: 0xb219, 0x1d08: 0xb309, 0x1d09: 0xb429, 0x1d0a: 0x0040, 0x1d0b: 0xb3b1, 0x1d0c: 0xb3c9, 0x1d0d: 0xb3e1, 0x1d0e: 0xb2a9, 0x1d0f: 0xb339, 0x1d10: 0xb369, 0x1d11: 0xb2d9, 0x1d12: 0xb381, 0x1d13: 0xb279, 0x1d14: 0xb2c1, 0x1d15: 0xb1d1, 0x1d16: 0xb1e9, 0x1d17: 0xb231, 0x1d18: 0xb261, 0x1d19: 0xb2f1, 0x1d1a: 0xb321, 0x1d1b: 0xb351, 0x1d1c: 0x0040, 0x1d1d: 0x0040, 0x1d1e: 0x0040, 0x1d1f: 0x0040, 0x1d20: 0x0040, 0x1d21: 0xb1a1, 0x1d22: 0xb201, 0x1d23: 0xb249, 0x1d24: 0x0040, 0x1d25: 0xb411, 0x1d26: 0xb291, 0x1d27: 0xb219, 0x1d28: 0xb309, 0x1d29: 0xb429, 0x1d2a: 0x0040, 0x1d2b: 0xb3b1, 0x1d2c: 0xb3c9, 0x1d2d: 0xb3e1, 0x1d2e: 0xb2a9, 0x1d2f: 0xb339, 0x1d30: 0xb369, 0x1d31: 0xb2d9, 0x1d32: 0xb381, 0x1d33: 0xb279, 0x1d34: 0xb2c1, 0x1d35: 0xb1d1, 0x1d36: 0xb1e9, 0x1d37: 0xb231, 0x1d38: 0xb261, 0x1d39: 0xb2f1, 0x1d3a: 0xb321, 0x1d3b: 0xb351, 0x1d3c: 0x0040, 0x1d3d: 0x0040, 0x1d3e: 0x0040, 0x1d3f: 0x0040, // Block 0x75, offset 0x1d40 0x1d40: 0x0040, 0x1d41: 0xbca2, 0x1d42: 0xbcba, 0x1d43: 0xbcd2, 0x1d44: 0xbcea, 0x1d45: 0xbd02, 0x1d46: 0xbd1a, 0x1d47: 0xbd32, 0x1d48: 0xbd4a, 0x1d49: 0xbd62, 0x1d4a: 0xbd7a, 0x1d4b: 0x0018, 0x1d4c: 0x0018, 0x1d4d: 0x0040, 0x1d4e: 0x0040, 0x1d4f: 0x0040, 0x1d50: 0xbd92, 0x1d51: 0xbdb2, 0x1d52: 0xbdd2, 0x1d53: 0xbdf2, 0x1d54: 0xbe12, 0x1d55: 0xbe32, 0x1d56: 0xbe52, 0x1d57: 0xbe72, 0x1d58: 0xbe92, 0x1d59: 0xbeb2, 0x1d5a: 0xbed2, 0x1d5b: 0xbef2, 0x1d5c: 0xbf12, 0x1d5d: 0xbf32, 0x1d5e: 0xbf52, 0x1d5f: 0xbf72, 0x1d60: 0xbf92, 0x1d61: 0xbfb2, 0x1d62: 0xbfd2, 0x1d63: 0xbff2, 0x1d64: 0xc012, 0x1d65: 0xc032, 0x1d66: 0xc052, 0x1d67: 0xc072, 0x1d68: 0xc092, 0x1d69: 0xc0b2, 0x1d6a: 0xc0d1, 0x1d6b: 0x1159, 0x1d6c: 0x0269, 0x1d6d: 0x6671, 0x1d6e: 0xc111, 0x1d6f: 0x0040, 0x1d70: 0x0039, 0x1d71: 0x0ee9, 0x1d72: 0x1159, 0x1d73: 0x0ef9, 0x1d74: 0x0f09, 0x1d75: 0x1199, 0x1d76: 0x0f31, 0x1d77: 0x0249, 0x1d78: 0x0f41, 0x1d79: 0x0259, 0x1d7a: 0x0f51, 0x1d7b: 0x0359, 0x1d7c: 0x0f61, 0x1d7d: 0x0f71, 0x1d7e: 0x00d9, 0x1d7f: 0x0f99, // Block 0x76, offset 0x1d80 0x1d80: 0x2039, 0x1d81: 0x0269, 0x1d82: 0x01d9, 0x1d83: 0x0fa9, 0x1d84: 0x0fb9, 0x1d85: 0x1089, 0x1d86: 0x0279, 0x1d87: 0x0369, 0x1d88: 0x0289, 0x1d89: 0x13d1, 0x1d8a: 0xc129, 0x1d8b: 0x65b1, 0x1d8c: 0xc141, 0x1d8d: 0x1441, 0x1d8e: 0xc159, 0x1d8f: 0xc179, 0x1d90: 0x0018, 0x1d91: 0x0018, 0x1d92: 0x0018, 0x1d93: 0x0018, 0x1d94: 0x0018, 0x1d95: 0x0018, 0x1d96: 0x0018, 0x1d97: 0x0018, 0x1d98: 0x0018, 0x1d99: 0x0018, 0x1d9a: 0x0018, 0x1d9b: 0x0018, 0x1d9c: 0x0018, 0x1d9d: 0x0018, 0x1d9e: 0x0018, 0x1d9f: 0x0018, 0x1da0: 0x0018, 0x1da1: 0x0018, 0x1da2: 0x0018, 0x1da3: 0x0018, 0x1da4: 0x0018, 0x1da5: 0x0018, 0x1da6: 0x0018, 0x1da7: 0x0018, 0x1da8: 0x0018, 0x1da9: 0x0018, 0x1daa: 0xc191, 0x1dab: 0xc1a9, 0x1dac: 0x0040, 0x1dad: 0x0040, 0x1dae: 0x0040, 0x1daf: 0x0040, 0x1db0: 0x0018, 0x1db1: 0x0018, 0x1db2: 0x0018, 0x1db3: 0x0018, 0x1db4: 0x0018, 0x1db5: 0x0018, 0x1db6: 0x0018, 0x1db7: 0x0018, 0x1db8: 0x0018, 0x1db9: 0x0018, 0x1dba: 0x0018, 0x1dbb: 0x0018, 0x1dbc: 0x0018, 0x1dbd: 0x0018, 0x1dbe: 0x0018, 0x1dbf: 0x0018, // Block 0x77, offset 0x1dc0 0x1dc0: 0xc1d9, 0x1dc1: 0xc211, 0x1dc2: 0xc249, 0x1dc3: 0x0040, 0x1dc4: 0x0040, 0x1dc5: 0x0040, 0x1dc6: 0x0040, 0x1dc7: 0x0040, 0x1dc8: 0x0040, 0x1dc9: 0x0040, 0x1dca: 0x0040, 0x1dcb: 0x0040, 0x1dcc: 0x0040, 0x1dcd: 0x0040, 0x1dce: 0x0040, 0x1dcf: 0x0040, 0x1dd0: 0xc269, 0x1dd1: 0xc289, 0x1dd2: 0xc2a9, 0x1dd3: 0xc2c9, 0x1dd4: 0xc2e9, 0x1dd5: 0xc309, 0x1dd6: 0xc329, 0x1dd7: 0xc349, 0x1dd8: 0xc369, 0x1dd9: 0xc389, 0x1dda: 0xc3a9, 0x1ddb: 0xc3c9, 0x1ddc: 0xc3e9, 0x1ddd: 0xc409, 0x1dde: 0xc429, 0x1ddf: 0xc449, 0x1de0: 0xc469, 0x1de1: 0xc489, 0x1de2: 0xc4a9, 0x1de3: 0xc4c9, 0x1de4: 0xc4e9, 0x1de5: 0xc509, 0x1de6: 0xc529, 0x1de7: 0xc549, 0x1de8: 0xc569, 0x1de9: 0xc589, 0x1dea: 0xc5a9, 0x1deb: 0xc5c9, 0x1dec: 0xc5e9, 0x1ded: 0xc609, 0x1dee: 0xc629, 0x1def: 0xc649, 0x1df0: 0xc669, 0x1df1: 0xc689, 0x1df2: 0xc6a9, 0x1df3: 0xc6c9, 0x1df4: 0xc6e9, 0x1df5: 0xc709, 0x1df6: 0xc729, 0x1df7: 0xc749, 0x1df8: 0xc769, 0x1df9: 0xc789, 0x1dfa: 0xc7a9, 0x1dfb: 0xc7c9, 0x1dfc: 0x0040, 0x1dfd: 0x0040, 0x1dfe: 0x0040, 0x1dff: 0x0040, // Block 0x78, offset 0x1e00 0x1e00: 0xcaf9, 0x1e01: 0xcb19, 0x1e02: 0xcb39, 0x1e03: 0x8b1d, 0x1e04: 0xcb59, 0x1e05: 0xcb79, 0x1e06: 0xcb99, 0x1e07: 0xcbb9, 0x1e08: 0xcbd9, 0x1e09: 0xcbf9, 0x1e0a: 0xcc19, 0x1e0b: 0xcc39, 0x1e0c: 0xcc59, 0x1e0d: 0x8b3d, 0x1e0e: 0xcc79, 0x1e0f: 0xcc99, 0x1e10: 0xccb9, 0x1e11: 0xccd9, 0x1e12: 0x8b5d, 0x1e13: 0xccf9, 0x1e14: 0xcd19, 0x1e15: 0xc429, 0x1e16: 0x8b7d, 0x1e17: 0xcd39, 0x1e18: 0xcd59, 0x1e19: 0xcd79, 0x1e1a: 0xcd99, 0x1e1b: 0xcdb9, 0x1e1c: 0x8b9d, 0x1e1d: 0xcdd9, 0x1e1e: 0xcdf9, 0x1e1f: 0xce19, 0x1e20: 0xce39, 0x1e21: 0xce59, 0x1e22: 0xc789, 0x1e23: 0xce79, 0x1e24: 0xce99, 0x1e25: 0xceb9, 0x1e26: 0xced9, 0x1e27: 0xcef9, 0x1e28: 0xcf19, 0x1e29: 0xcf39, 0x1e2a: 0xcf59, 0x1e2b: 0xcf79, 0x1e2c: 0xcf99, 0x1e2d: 0xcfb9, 0x1e2e: 0xcfd9, 0x1e2f: 0xcff9, 0x1e30: 0xd019, 0x1e31: 0xd039, 0x1e32: 0xd039, 0x1e33: 0xd039, 0x1e34: 0x8bbd, 0x1e35: 0xd059, 0x1e36: 0xd079, 0x1e37: 0xd099, 0x1e38: 0x8bdd, 0x1e39: 0xd0b9, 0x1e3a: 0xd0d9, 0x1e3b: 0xd0f9, 0x1e3c: 0xd119, 0x1e3d: 0xd139, 0x1e3e: 0xd159, 0x1e3f: 0xd179, // Block 0x79, offset 0x1e40 0x1e40: 0xd199, 0x1e41: 0xd1b9, 0x1e42: 0xd1d9, 0x1e43: 0xd1f9, 0x1e44: 0xd219, 0x1e45: 0xd239, 0x1e46: 0xd239, 0x1e47: 0xd259, 0x1e48: 0xd279, 0x1e49: 0xd299, 0x1e4a: 0xd2b9, 0x1e4b: 0xd2d9, 0x1e4c: 0xd2f9, 0x1e4d: 0xd319, 0x1e4e: 0xd339, 0x1e4f: 0xd359, 0x1e50: 0xd379, 0x1e51: 0xd399, 0x1e52: 0xd3b9, 0x1e53: 0xd3d9, 0x1e54: 0xd3f9, 0x1e55: 0xd419, 0x1e56: 0xd439, 0x1e57: 0xd459, 0x1e58: 0xd479, 0x1e59: 0x8bfd, 0x1e5a: 0xd499, 0x1e5b: 0xd4b9, 0x1e5c: 0xd4d9, 0x1e5d: 0xc309, 0x1e5e: 0xd4f9, 0x1e5f: 0xd519, 0x1e60: 0x8c1d, 0x1e61: 0x8c3d, 0x1e62: 0xd539, 0x1e63: 0xd559, 0x1e64: 0xd579, 0x1e65: 0xd599, 0x1e66: 0xd5b9, 0x1e67: 0xd5d9, 0x1e68: 0x2040, 0x1e69: 0xd5f9, 0x1e6a: 0xd619, 0x1e6b: 0xd619, 0x1e6c: 0x8c5d, 0x1e6d: 0xd639, 0x1e6e: 0xd659, 0x1e6f: 0xd679, 0x1e70: 0xd699, 0x1e71: 0x8c7d, 0x1e72: 0xd6b9, 0x1e73: 0xd6d9, 0x1e74: 0x2040, 0x1e75: 0xd6f9, 0x1e76: 0xd719, 0x1e77: 0xd739, 0x1e78: 0xd759, 0x1e79: 0xd779, 0x1e7a: 0xd799, 0x1e7b: 0x8c9d, 0x1e7c: 0xd7b9, 0x1e7d: 0x8cbd, 0x1e7e: 0xd7d9, 0x1e7f: 0xd7f9, // Block 0x7a, offset 0x1e80 0x1e80: 0xd819, 0x1e81: 0xd839, 0x1e82: 0xd859, 0x1e83: 0xd879, 0x1e84: 0xd899, 0x1e85: 0xd8b9, 0x1e86: 0xd8d9, 0x1e87: 0xd8f9, 0x1e88: 0xd919, 0x1e89: 0x8cdd, 0x1e8a: 0xd939, 0x1e8b: 0xd959, 0x1e8c: 0xd979, 0x1e8d: 0xd999, 0x1e8e: 0xd9b9, 0x1e8f: 0x8cfd, 0x1e90: 0xd9d9, 0x1e91: 0x8d1d, 0x1e92: 0x8d3d, 0x1e93: 0xd9f9, 0x1e94: 0xda19, 0x1e95: 0xda19, 0x1e96: 0xda39, 0x1e97: 0x8d5d, 0x1e98: 0x8d7d, 0x1e99: 0xda59, 0x1e9a: 0xda79, 0x1e9b: 0xda99, 0x1e9c: 0xdab9, 0x1e9d: 0xdad9, 0x1e9e: 0xdaf9, 0x1e9f: 0xdb19, 0x1ea0: 0xdb39, 0x1ea1: 0xdb59, 0x1ea2: 0xdb79, 0x1ea3: 0xdb99, 0x1ea4: 0x8d9d, 0x1ea5: 0xdbb9, 0x1ea6: 0xdbd9, 0x1ea7: 0xdbf9, 0x1ea8: 0xdc19, 0x1ea9: 0xdbf9, 0x1eaa: 0xdc39, 0x1eab: 0xdc59, 0x1eac: 0xdc79, 0x1ead: 0xdc99, 0x1eae: 0xdcb9, 0x1eaf: 0xdcd9, 0x1eb0: 0xdcf9, 0x1eb1: 0xdd19, 0x1eb2: 0xdd39, 0x1eb3: 0xdd59, 0x1eb4: 0xdd79, 0x1eb5: 0xdd99, 0x1eb6: 0xddb9, 0x1eb7: 0xddd9, 0x1eb8: 0x8dbd, 0x1eb9: 0xddf9, 0x1eba: 0xde19, 0x1ebb: 0xde39, 0x1ebc: 0xde59, 0x1ebd: 0xde79, 0x1ebe: 0x8ddd, 0x1ebf: 0xde99, // Block 0x7b, offset 0x1ec0 0x1ec0: 0xe599, 0x1ec1: 0xe5b9, 0x1ec2: 0xe5d9, 0x1ec3: 0xe5f9, 0x1ec4: 0xe619, 0x1ec5: 0xe639, 0x1ec6: 0x8efd, 0x1ec7: 0xe659, 0x1ec8: 0xe679, 0x1ec9: 0xe699, 0x1eca: 0xe6b9, 0x1ecb: 0xe6d9, 0x1ecc: 0xe6f9, 0x1ecd: 0x8f1d, 0x1ece: 0xe719, 0x1ecf: 0xe739, 0x1ed0: 0x8f3d, 0x1ed1: 0x8f5d, 0x1ed2: 0xe759, 0x1ed3: 0xe779, 0x1ed4: 0xe799, 0x1ed5: 0xe7b9, 0x1ed6: 0xe7d9, 0x1ed7: 0xe7f9, 0x1ed8: 0xe819, 0x1ed9: 0xe839, 0x1eda: 0xe859, 0x1edb: 0x8f7d, 0x1edc: 0xe879, 0x1edd: 0x8f9d, 0x1ede: 0xe899, 0x1edf: 0x2040, 0x1ee0: 0xe8b9, 0x1ee1: 0xe8d9, 0x1ee2: 0xe8f9, 0x1ee3: 0x8fbd, 0x1ee4: 0xe919, 0x1ee5: 0xe939, 0x1ee6: 0x8fdd, 0x1ee7: 0x8ffd, 0x1ee8: 0xe959, 0x1ee9: 0xe979, 0x1eea: 0xe999, 0x1eeb: 0xe9b9, 0x1eec: 0xe9d9, 0x1eed: 0xe9d9, 0x1eee: 0xe9f9, 0x1eef: 0xea19, 0x1ef0: 0xea39, 0x1ef1: 0xea59, 0x1ef2: 0xea79, 0x1ef3: 0xea99, 0x1ef4: 0xeab9, 0x1ef5: 0x901d, 0x1ef6: 0xead9, 0x1ef7: 0x903d, 0x1ef8: 0xeaf9, 0x1ef9: 0x905d, 0x1efa: 0xeb19, 0x1efb: 0x907d, 0x1efc: 0x909d, 0x1efd: 0x90bd, 0x1efe: 0xeb39, 0x1eff: 0xeb59, // Block 0x7c, offset 0x1f00 0x1f00: 0xeb79, 0x1f01: 0x90dd, 0x1f02: 0x90fd, 0x1f03: 0x911d, 0x1f04: 0x913d, 0x1f05: 0xeb99, 0x1f06: 0xebb9, 0x1f07: 0xebb9, 0x1f08: 0xebd9, 0x1f09: 0xebf9, 0x1f0a: 0xec19, 0x1f0b: 0xec39, 0x1f0c: 0xec59, 0x1f0d: 0x915d, 0x1f0e: 0xec79, 0x1f0f: 0xec99, 0x1f10: 0xecb9, 0x1f11: 0xecd9, 0x1f12: 0x917d, 0x1f13: 0xecf9, 0x1f14: 0x919d, 0x1f15: 0x91bd, 0x1f16: 0xed19, 0x1f17: 0xed39, 0x1f18: 0xed59, 0x1f19: 0xed79, 0x1f1a: 0xed99, 0x1f1b: 0xedb9, 0x1f1c: 0x91dd, 0x1f1d: 0x91fd, 0x1f1e: 0x921d, 0x1f1f: 0x2040, 0x1f20: 0xedd9, 0x1f21: 0x923d, 0x1f22: 0xedf9, 0x1f23: 0xee19, 0x1f24: 0xee39, 0x1f25: 0x925d, 0x1f26: 0xee59, 0x1f27: 0xee79, 0x1f28: 0xee99, 0x1f29: 0xeeb9, 0x1f2a: 0xeed9, 0x1f2b: 0x927d, 0x1f2c: 0xeef9, 0x1f2d: 0xef19, 0x1f2e: 0xef39, 0x1f2f: 0xef59, 0x1f30: 0xef79, 0x1f31: 0xef99, 0x1f32: 0x929d, 0x1f33: 0x92bd, 0x1f34: 0xefb9, 0x1f35: 0x92dd, 0x1f36: 0xefd9, 0x1f37: 0x92fd, 0x1f38: 0xeff9, 0x1f39: 0xf019, 0x1f3a: 0xf039, 0x1f3b: 0x931d, 0x1f3c: 0x933d, 0x1f3d: 0xf059, 0x1f3e: 0x935d, 0x1f3f: 0xf079, // Block 0x7d, offset 0x1f40 0x1f40: 0xf6b9, 0x1f41: 0xf6d9, 0x1f42: 0xf6f9, 0x1f43: 0xf719, 0x1f44: 0xf739, 0x1f45: 0x951d, 0x1f46: 0xf759, 0x1f47: 0xf779, 0x1f48: 0xf799, 0x1f49: 0xf7b9, 0x1f4a: 0xf7d9, 0x1f4b: 0x953d, 0x1f4c: 0x955d, 0x1f4d: 0xf7f9, 0x1f4e: 0xf819, 0x1f4f: 0xf839, 0x1f50: 0xf859, 0x1f51: 0xf879, 0x1f52: 0xf899, 0x1f53: 0x957d, 0x1f54: 0xf8b9, 0x1f55: 0xf8d9, 0x1f56: 0xf8f9, 0x1f57: 0xf919, 0x1f58: 0x959d, 0x1f59: 0x95bd, 0x1f5a: 0xf939, 0x1f5b: 0xf959, 0x1f5c: 0xf979, 0x1f5d: 0x95dd, 0x1f5e: 0xf999, 0x1f5f: 0xf9b9, 0x1f60: 0x6815, 0x1f61: 0x95fd, 0x1f62: 0xf9d9, 0x1f63: 0xf9f9, 0x1f64: 0xfa19, 0x1f65: 0x961d, 0x1f66: 0xfa39, 0x1f67: 0xfa59, 0x1f68: 0xfa79, 0x1f69: 0xfa99, 0x1f6a: 0xfab9, 0x1f6b: 0xfad9, 0x1f6c: 0xfaf9, 0x1f6d: 0x963d, 0x1f6e: 0xfb19, 0x1f6f: 0xfb39, 0x1f70: 0xfb59, 0x1f71: 0x965d, 0x1f72: 0xfb79, 0x1f73: 0xfb99, 0x1f74: 0xfbb9, 0x1f75: 0xfbd9, 0x1f76: 0x7b35, 0x1f77: 0x967d, 0x1f78: 0xfbf9, 0x1f79: 0xfc19, 0x1f7a: 0xfc39, 0x1f7b: 0x969d, 0x1f7c: 0xfc59, 0x1f7d: 0x96bd, 0x1f7e: 0xfc79, 0x1f7f: 0xfc79, // Block 0x7e, offset 0x1f80 0x1f80: 0xfc99, 0x1f81: 0x96dd, 0x1f82: 0xfcb9, 0x1f83: 0xfcd9, 0x1f84: 0xfcf9, 0x1f85: 0xfd19, 0x1f86: 0xfd39, 0x1f87: 0xfd59, 0x1f88: 0xfd79, 0x1f89: 0x96fd, 0x1f8a: 0xfd99, 0x1f8b: 0xfdb9, 0x1f8c: 0xfdd9, 0x1f8d: 0xfdf9, 0x1f8e: 0xfe19, 0x1f8f: 0xfe39, 0x1f90: 0x971d, 0x1f91: 0xfe59, 0x1f92: 0x973d, 0x1f93: 0x975d, 0x1f94: 0x977d, 0x1f95: 0xfe79, 0x1f96: 0xfe99, 0x1f97: 0xfeb9, 0x1f98: 0xfed9, 0x1f99: 0xfef9, 0x1f9a: 0xff19, 0x1f9b: 0xff39, 0x1f9c: 0xff59, 0x1f9d: 0x979d, 0x1f9e: 0x0040, 0x1f9f: 0x0040, 0x1fa0: 0x0040, 0x1fa1: 0x0040, 0x1fa2: 0x0040, 0x1fa3: 0x0040, 0x1fa4: 0x0040, 0x1fa5: 0x0040, 0x1fa6: 0x0040, 0x1fa7: 0x0040, 0x1fa8: 0x0040, 0x1fa9: 0x0040, 0x1faa: 0x0040, 0x1fab: 0x0040, 0x1fac: 0x0040, 0x1fad: 0x0040, 0x1fae: 0x0040, 0x1faf: 0x0040, 0x1fb0: 0x0040, 0x1fb1: 0x0040, 0x1fb2: 0x0040, 0x1fb3: 0x0040, 0x1fb4: 0x0040, 0x1fb5: 0x0040, 0x1fb6: 0x0040, 0x1fb7: 0x0040, 0x1fb8: 0x0040, 0x1fb9: 0x0040, 0x1fba: 0x0040, 0x1fbb: 0x0040, 0x1fbc: 0x0040, 0x1fbd: 0x0040, 0x1fbe: 0x0040, 0x1fbf: 0x0040, } // idnaIndex: 36 blocks, 2304 entries, 4608 bytes // Block 0 is the zero block. var idnaIndex = [2304]uint16{ // Block 0x0, offset 0x0 // Block 0x1, offset 0x40 // Block 0x2, offset 0x80 // Block 0x3, offset 0xc0 0xc2: 0x01, 0xc3: 0x7d, 0xc4: 0x02, 0xc5: 0x03, 0xc6: 0x04, 0xc7: 0x05, 0xc8: 0x06, 0xc9: 0x7e, 0xca: 0x7f, 0xcb: 0x07, 0xcc: 0x80, 0xcd: 0x08, 0xce: 0x09, 0xcf: 0x0a, 0xd0: 0x81, 0xd1: 0x0b, 0xd2: 0x0c, 0xd3: 0x0d, 0xd4: 0x0e, 0xd5: 0x82, 0xd6: 0x83, 0xd7: 0x84, 0xd8: 0x0f, 0xd9: 0x10, 0xda: 0x85, 0xdb: 0x11, 0xdc: 0x12, 0xdd: 0x86, 0xde: 0x87, 0xdf: 0x88, 0xe0: 0x02, 0xe1: 0x03, 0xe2: 0x04, 0xe3: 0x05, 0xe4: 0x06, 0xe5: 0x07, 0xe6: 0x07, 0xe7: 0x07, 0xe8: 0x07, 0xe9: 0x08, 0xea: 0x09, 0xeb: 0x07, 0xec: 0x07, 0xed: 0x0a, 0xee: 0x0b, 0xef: 0x0c, 0xf0: 0x1d, 0xf1: 0x1e, 0xf2: 0x1e, 0xf3: 0x20, 0xf4: 0x21, // Block 0x4, offset 0x100 0x120: 0x89, 0x121: 0x13, 0x122: 0x8a, 0x123: 0x8b, 0x124: 0x8c, 0x125: 0x14, 0x126: 0x15, 0x127: 0x16, 0x128: 0x17, 0x129: 0x18, 0x12a: 0x19, 0x12b: 0x1a, 0x12c: 0x1b, 0x12d: 0x1c, 0x12e: 0x1d, 0x12f: 0x8d, 0x130: 0x8e, 0x131: 0x1e, 0x132: 0x1f, 0x133: 0x20, 0x134: 0x8f, 0x135: 0x21, 0x136: 0x90, 0x137: 0x91, 0x138: 0x92, 0x139: 0x93, 0x13a: 0x22, 0x13b: 0x94, 0x13c: 0x95, 0x13d: 0x23, 0x13e: 0x24, 0x13f: 0x96, // Block 0x5, offset 0x140 0x140: 0x97, 0x141: 0x98, 0x142: 0x99, 0x143: 0x9a, 0x144: 0x9b, 0x145: 0x9c, 0x146: 0x9d, 0x147: 0x9e, 0x148: 0x9f, 0x149: 0xa0, 0x14a: 0xa1, 0x14b: 0xa2, 0x14c: 0xa3, 0x14d: 0xa4, 0x14e: 0xa5, 0x14f: 0xa6, 0x150: 0xa7, 0x151: 0x9f, 0x152: 0x9f, 0x153: 0x9f, 0x154: 0x9f, 0x155: 0x9f, 0x156: 0x9f, 0x157: 0x9f, 0x158: 0x9f, 0x159: 0xa8, 0x15a: 0xa9, 0x15b: 0xaa, 0x15c: 0xab, 0x15d: 0xac, 0x15e: 0xad, 0x15f: 0xae, 0x160: 0xaf, 0x161: 0xb0, 0x162: 0xb1, 0x163: 0xb2, 0x164: 0xb3, 0x165: 0xb4, 0x166: 0xb5, 0x167: 0xb6, 0x168: 0xb7, 0x169: 0xb8, 0x16a: 0xb9, 0x16b: 0xba, 0x16c: 0xbb, 0x16d: 0xbc, 0x16e: 0xbd, 0x16f: 0xbe, 0x170: 0xbf, 0x171: 0xc0, 0x172: 0xc1, 0x173: 0xc2, 0x174: 0x25, 0x175: 0x26, 0x176: 0x27, 0x177: 0xc3, 0x178: 0x28, 0x179: 0x28, 0x17a: 0x29, 0x17b: 0x28, 0x17c: 0xc4, 0x17d: 0x2a, 0x17e: 0x2b, 0x17f: 0x2c, // Block 0x6, offset 0x180 0x180: 0x2d, 0x181: 0x2e, 0x182: 0x2f, 0x183: 0xc5, 0x184: 0x30, 0x185: 0x31, 0x186: 0xc6, 0x187: 0x9b, 0x188: 0xc7, 0x189: 0xc8, 0x18a: 0x9b, 0x18b: 0x9b, 0x18c: 0xc9, 0x18d: 0x9b, 0x18e: 0x9b, 0x18f: 0x9b, 0x190: 0xca, 0x191: 0x32, 0x192: 0x33, 0x193: 0x34, 0x194: 0x9b, 0x195: 0x9b, 0x196: 0x9b, 0x197: 0x9b, 0x198: 0x9b, 0x199: 0x9b, 0x19a: 0x9b, 0x19b: 0x9b, 0x19c: 0x9b, 0x19d: 0x9b, 0x19e: 0x9b, 0x19f: 0x9b, 0x1a0: 0x9b, 0x1a1: 0x9b, 0x1a2: 0x9b, 0x1a3: 0x9b, 0x1a4: 0x9b, 0x1a5: 0x9b, 0x1a6: 0x9b, 0x1a7: 0x9b, 0x1a8: 0xcb, 0x1a9: 0xcc, 0x1aa: 0x9b, 0x1ab: 0xcd, 0x1ac: 0x9b, 0x1ad: 0xce, 0x1ae: 0xcf, 0x1af: 0xd0, 0x1b0: 0xd1, 0x1b1: 0x35, 0x1b2: 0x28, 0x1b3: 0x36, 0x1b4: 0xd2, 0x1b5: 0xd3, 0x1b6: 0xd4, 0x1b7: 0xd5, 0x1b8: 0xd6, 0x1b9: 0xd7, 0x1ba: 0xd8, 0x1bb: 0xd9, 0x1bc: 0xda, 0x1bd: 0xdb, 0x1be: 0xdc, 0x1bf: 0x37, // Block 0x7, offset 0x1c0 0x1c0: 0x38, 0x1c1: 0xdd, 0x1c2: 0xde, 0x1c3: 0xdf, 0x1c4: 0xe0, 0x1c5: 0x39, 0x1c6: 0x3a, 0x1c7: 0xe1, 0x1c8: 0xe2, 0x1c9: 0x3b, 0x1ca: 0x3c, 0x1cb: 0x3d, 0x1cc: 0x3e, 0x1cd: 0x3f, 0x1ce: 0x40, 0x1cf: 0x41, 0x1d0: 0x9f, 0x1d1: 0x9f, 0x1d2: 0x9f, 0x1d3: 0x9f, 0x1d4: 0x9f, 0x1d5: 0x9f, 0x1d6: 0x9f, 0x1d7: 0x9f, 0x1d8: 0x9f, 0x1d9: 0x9f, 0x1da: 0x9f, 0x1db: 0x9f, 0x1dc: 0x9f, 0x1dd: 0x9f, 0x1de: 0x9f, 0x1df: 0x9f, 0x1e0: 0x9f, 0x1e1: 0x9f, 0x1e2: 0x9f, 0x1e3: 0x9f, 0x1e4: 0x9f, 0x1e5: 0x9f, 0x1e6: 0x9f, 0x1e7: 0x9f, 0x1e8: 0x9f, 0x1e9: 0x9f, 0x1ea: 0x9f, 0x1eb: 0x9f, 0x1ec: 0x9f, 0x1ed: 0x9f, 0x1ee: 0x9f, 0x1ef: 0x9f, 0x1f0: 0x9f, 0x1f1: 0x9f, 0x1f2: 0x9f, 0x1f3: 0x9f, 0x1f4: 0x9f, 0x1f5: 0x9f, 0x1f6: 0x9f, 0x1f7: 0x9f, 0x1f8: 0x9f, 0x1f9: 0x9f, 0x1fa: 0x9f, 0x1fb: 0x9f, 0x1fc: 0x9f, 0x1fd: 0x9f, 0x1fe: 0x9f, 0x1ff: 0x9f, // Block 0x8, offset 0x200 0x200: 0x9f, 0x201: 0x9f, 0x202: 0x9f, 0x203: 0x9f, 0x204: 0x9f, 0x205: 0x9f, 0x206: 0x9f, 0x207: 0x9f, 0x208: 0x9f, 0x209: 0x9f, 0x20a: 0x9f, 0x20b: 0x9f, 0x20c: 0x9f, 0x20d: 0x9f, 0x20e: 0x9f, 0x20f: 0x9f, 0x210: 0x9f, 0x211: 0x9f, 0x212: 0x9f, 0x213: 0x9f, 0x214: 0x9f, 0x215: 0x9f, 0x216: 0x9f, 0x217: 0x9f, 0x218: 0x9f, 0x219: 0x9f, 0x21a: 0x9f, 0x21b: 0x9f, 0x21c: 0x9f, 0x21d: 0x9f, 0x21e: 0x9f, 0x21f: 0x9f, 0x220: 0x9f, 0x221: 0x9f, 0x222: 0x9f, 0x223: 0x9f, 0x224: 0x9f, 0x225: 0x9f, 0x226: 0x9f, 0x227: 0x9f, 0x228: 0x9f, 0x229: 0x9f, 0x22a: 0x9f, 0x22b: 0x9f, 0x22c: 0x9f, 0x22d: 0x9f, 0x22e: 0x9f, 0x22f: 0x9f, 0x230: 0x9f, 0x231: 0x9f, 0x232: 0x9f, 0x233: 0x9f, 0x234: 0x9f, 0x235: 0x9f, 0x236: 0xb2, 0x237: 0x9b, 0x238: 0x9f, 0x239: 0x9f, 0x23a: 0x9f, 0x23b: 0x9f, 0x23c: 0x9f, 0x23d: 0x9f, 0x23e: 0x9f, 0x23f: 0x9f, // Block 0x9, offset 0x240 0x240: 0x9f, 0x241: 0x9f, 0x242: 0x9f, 0x243: 0x9f, 0x244: 0x9f, 0x245: 0x9f, 0x246: 0x9f, 0x247: 0x9f, 0x248: 0x9f, 0x249: 0x9f, 0x24a: 0x9f, 0x24b: 0x9f, 0x24c: 0x9f, 0x24d: 0x9f, 0x24e: 0x9f, 0x24f: 0x9f, 0x250: 0x9f, 0x251: 0x9f, 0x252: 0x9f, 0x253: 0x9f, 0x254: 0x9f, 0x255: 0x9f, 0x256: 0x9f, 0x257: 0x9f, 0x258: 0x9f, 0x259: 0x9f, 0x25a: 0x9f, 0x25b: 0x9f, 0x25c: 0x9f, 0x25d: 0x9f, 0x25e: 0x9f, 0x25f: 0x9f, 0x260: 0x9f, 0x261: 0x9f, 0x262: 0x9f, 0x263: 0x9f, 0x264: 0x9f, 0x265: 0x9f, 0x266: 0x9f, 0x267: 0x9f, 0x268: 0x9f, 0x269: 0x9f, 0x26a: 0x9f, 0x26b: 0x9f, 0x26c: 0x9f, 0x26d: 0x9f, 0x26e: 0x9f, 0x26f: 0x9f, 0x270: 0x9f, 0x271: 0x9f, 0x272: 0x9f, 0x273: 0x9f, 0x274: 0x9f, 0x275: 0x9f, 0x276: 0x9f, 0x277: 0x9f, 0x278: 0x9f, 0x279: 0x9f, 0x27a: 0x9f, 0x27b: 0x9f, 0x27c: 0x9f, 0x27d: 0x9f, 0x27e: 0x9f, 0x27f: 0x9f, // Block 0xa, offset 0x280 0x280: 0x9f, 0x281: 0x9f, 0x282: 0x9f, 0x283: 0x9f, 0x284: 0x9f, 0x285: 0x9f, 0x286: 0x9f, 0x287: 0x9f, 0x288: 0x9f, 0x289: 0x9f, 0x28a: 0x9f, 0x28b: 0x9f, 0x28c: 0x9f, 0x28d: 0x9f, 0x28e: 0x9f, 0x28f: 0x9f, 0x290: 0x9f, 0x291: 0x9f, 0x292: 0x9f, 0x293: 0x9f, 0x294: 0x9f, 0x295: 0x9f, 0x296: 0x9f, 0x297: 0x9f, 0x298: 0x9f, 0x299: 0x9f, 0x29a: 0x9f, 0x29b: 0x9f, 0x29c: 0x9f, 0x29d: 0x9f, 0x29e: 0x9f, 0x29f: 0x9f, 0x2a0: 0x9f, 0x2a1: 0x9f, 0x2a2: 0x9f, 0x2a3: 0x9f, 0x2a4: 0x9f, 0x2a5: 0x9f, 0x2a6: 0x9f, 0x2a7: 0x9f, 0x2a8: 0x9f, 0x2a9: 0x9f, 0x2aa: 0x9f, 0x2ab: 0x9f, 0x2ac: 0x9f, 0x2ad: 0x9f, 0x2ae: 0x9f, 0x2af: 0x9f, 0x2b0: 0x9f, 0x2b1: 0x9f, 0x2b2: 0x9f, 0x2b3: 0x9f, 0x2b4: 0x9f, 0x2b5: 0x9f, 0x2b6: 0x9f, 0x2b7: 0x9f, 0x2b8: 0x9f, 0x2b9: 0x9f, 0x2ba: 0x9f, 0x2bb: 0x9f, 0x2bc: 0x9f, 0x2bd: 0x9f, 0x2be: 0x9f, 0x2bf: 0xe3, // Block 0xb, offset 0x2c0 0x2c0: 0x9f, 0x2c1: 0x9f, 0x2c2: 0x9f, 0x2c3: 0x9f, 0x2c4: 0x9f, 0x2c5: 0x9f, 0x2c6: 0x9f, 0x2c7: 0x9f, 0x2c8: 0x9f, 0x2c9: 0x9f, 0x2ca: 0x9f, 0x2cb: 0x9f, 0x2cc: 0x9f, 0x2cd: 0x9f, 0x2ce: 0x9f, 0x2cf: 0x9f, 0x2d0: 0x9f, 0x2d1: 0x9f, 0x2d2: 0xe4, 0x2d3: 0xe5, 0x2d4: 0x9f, 0x2d5: 0x9f, 0x2d6: 0x9f, 0x2d7: 0x9f, 0x2d8: 0xe6, 0x2d9: 0x42, 0x2da: 0x43, 0x2db: 0xe7, 0x2dc: 0x44, 0x2dd: 0x45, 0x2de: 0x46, 0x2df: 0xe8, 0x2e0: 0xe9, 0x2e1: 0xea, 0x2e2: 0xeb, 0x2e3: 0xec, 0x2e4: 0xed, 0x2e5: 0xee, 0x2e6: 0xef, 0x2e7: 0xf0, 0x2e8: 0xf1, 0x2e9: 0xf2, 0x2ea: 0xf3, 0x2eb: 0xf4, 0x2ec: 0xf5, 0x2ed: 0xf6, 0x2ee: 0xf7, 0x2ef: 0xf8, 0x2f0: 0x9f, 0x2f1: 0x9f, 0x2f2: 0x9f, 0x2f3: 0x9f, 0x2f4: 0x9f, 0x2f5: 0x9f, 0x2f6: 0x9f, 0x2f7: 0x9f, 0x2f8: 0x9f, 0x2f9: 0x9f, 0x2fa: 0x9f, 0x2fb: 0x9f, 0x2fc: 0x9f, 0x2fd: 0x9f, 0x2fe: 0x9f, 0x2ff: 0x9f, // Block 0xc, offset 0x300 0x300: 0x9f, 0x301: 0x9f, 0x302: 0x9f, 0x303: 0x9f, 0x304: 0x9f, 0x305: 0x9f, 0x306: 0x9f, 0x307: 0x9f, 0x308: 0x9f, 0x309: 0x9f, 0x30a: 0x9f, 0x30b: 0x9f, 0x30c: 0x9f, 0x30d: 0x9f, 0x30e: 0x9f, 0x30f: 0x9f, 0x310: 0x9f, 0x311: 0x9f, 0x312: 0x9f, 0x313: 0x9f, 0x314: 0x9f, 0x315: 0x9f, 0x316: 0x9f, 0x317: 0x9f, 0x318: 0x9f, 0x319: 0x9f, 0x31a: 0x9f, 0x31b: 0x9f, 0x31c: 0x9f, 0x31d: 0x9f, 0x31e: 0xf9, 0x31f: 0xfa, // Block 0xd, offset 0x340 0x340: 0xba, 0x341: 0xba, 0x342: 0xba, 0x343: 0xba, 0x344: 0xba, 0x345: 0xba, 0x346: 0xba, 0x347: 0xba, 0x348: 0xba, 0x349: 0xba, 0x34a: 0xba, 0x34b: 0xba, 0x34c: 0xba, 0x34d: 0xba, 0x34e: 0xba, 0x34f: 0xba, 0x350: 0xba, 0x351: 0xba, 0x352: 0xba, 0x353: 0xba, 0x354: 0xba, 0x355: 0xba, 0x356: 0xba, 0x357: 0xba, 0x358: 0xba, 0x359: 0xba, 0x35a: 0xba, 0x35b: 0xba, 0x35c: 0xba, 0x35d: 0xba, 0x35e: 0xba, 0x35f: 0xba, 0x360: 0xba, 0x361: 0xba, 0x362: 0xba, 0x363: 0xba, 0x364: 0xba, 0x365: 0xba, 0x366: 0xba, 0x367: 0xba, 0x368: 0xba, 0x369: 0xba, 0x36a: 0xba, 0x36b: 0xba, 0x36c: 0xba, 0x36d: 0xba, 0x36e: 0xba, 0x36f: 0xba, 0x370: 0xba, 0x371: 0xba, 0x372: 0xba, 0x373: 0xba, 0x374: 0xba, 0x375: 0xba, 0x376: 0xba, 0x377: 0xba, 0x378: 0xba, 0x379: 0xba, 0x37a: 0xba, 0x37b: 0xba, 0x37c: 0xba, 0x37d: 0xba, 0x37e: 0xba, 0x37f: 0xba, // Block 0xe, offset 0x380 0x380: 0xba, 0x381: 0xba, 0x382: 0xba, 0x383: 0xba, 0x384: 0xba, 0x385: 0xba, 0x386: 0xba, 0x387: 0xba, 0x388: 0xba, 0x389: 0xba, 0x38a: 0xba, 0x38b: 0xba, 0x38c: 0xba, 0x38d: 0xba, 0x38e: 0xba, 0x38f: 0xba, 0x390: 0xba, 0x391: 0xba, 0x392: 0xba, 0x393: 0xba, 0x394: 0xba, 0x395: 0xba, 0x396: 0xba, 0x397: 0xba, 0x398: 0xba, 0x399: 0xba, 0x39a: 0xba, 0x39b: 0xba, 0x39c: 0xba, 0x39d: 0xba, 0x39e: 0xba, 0x39f: 0xba, 0x3a0: 0xba, 0x3a1: 0xba, 0x3a2: 0xba, 0x3a3: 0xba, 0x3a4: 0xfb, 0x3a5: 0xfc, 0x3a6: 0xfd, 0x3a7: 0xfe, 0x3a8: 0x47, 0x3a9: 0xff, 0x3aa: 0x100, 0x3ab: 0x48, 0x3ac: 0x49, 0x3ad: 0x4a, 0x3ae: 0x4b, 0x3af: 0x4c, 0x3b0: 0x101, 0x3b1: 0x4d, 0x3b2: 0x4e, 0x3b3: 0x4f, 0x3b4: 0x50, 0x3b5: 0x51, 0x3b6: 0x102, 0x3b7: 0x52, 0x3b8: 0x53, 0x3b9: 0x54, 0x3ba: 0x55, 0x3bb: 0x56, 0x3bc: 0x57, 0x3bd: 0x58, 0x3be: 0x59, 0x3bf: 0x5a, // Block 0xf, offset 0x3c0 0x3c0: 0x103, 0x3c1: 0x104, 0x3c2: 0x9f, 0x3c3: 0x105, 0x3c4: 0x106, 0x3c5: 0x9b, 0x3c6: 0x107, 0x3c7: 0x108, 0x3c8: 0xba, 0x3c9: 0xba, 0x3ca: 0x109, 0x3cb: 0x10a, 0x3cc: 0x10b, 0x3cd: 0x10c, 0x3ce: 0x10d, 0x3cf: 0x10e, 0x3d0: 0x10f, 0x3d1: 0x9f, 0x3d2: 0x110, 0x3d3: 0x111, 0x3d4: 0x112, 0x3d5: 0x113, 0x3d6: 0xba, 0x3d7: 0xba, 0x3d8: 0x9f, 0x3d9: 0x9f, 0x3da: 0x9f, 0x3db: 0x9f, 0x3dc: 0x114, 0x3dd: 0x115, 0x3de: 0xba, 0x3df: 0xba, 0x3e0: 0x116, 0x3e1: 0x117, 0x3e2: 0x118, 0x3e3: 0x119, 0x3e4: 0x11a, 0x3e5: 0xba, 0x3e6: 0x11b, 0x3e7: 0x11c, 0x3e8: 0x11d, 0x3e9: 0x11e, 0x3ea: 0x11f, 0x3eb: 0x5b, 0x3ec: 0x120, 0x3ed: 0x121, 0x3ee: 0x5c, 0x3ef: 0xba, 0x3f0: 0x122, 0x3f1: 0x123, 0x3f2: 0x124, 0x3f3: 0x125, 0x3f4: 0xba, 0x3f5: 0xba, 0x3f6: 0xba, 0x3f7: 0xba, 0x3f8: 0xba, 0x3f9: 0x126, 0x3fa: 0xba, 0x3fb: 0xba, 0x3fc: 0xba, 0x3fd: 0xba, 0x3fe: 0xba, 0x3ff: 0xba, // Block 0x10, offset 0x400 0x400: 0x127, 0x401: 0x128, 0x402: 0x129, 0x403: 0x12a, 0x404: 0x12b, 0x405: 0x12c, 0x406: 0x12d, 0x407: 0x12e, 0x408: 0x12f, 0x409: 0xba, 0x40a: 0x130, 0x40b: 0x131, 0x40c: 0x5d, 0x40d: 0x5e, 0x40e: 0xba, 0x40f: 0xba, 0x410: 0x132, 0x411: 0x133, 0x412: 0x134, 0x413: 0x135, 0x414: 0xba, 0x415: 0xba, 0x416: 0x136, 0x417: 0x137, 0x418: 0x138, 0x419: 0x139, 0x41a: 0x13a, 0x41b: 0x13b, 0x41c: 0x13c, 0x41d: 0xba, 0x41e: 0xba, 0x41f: 0xba, 0x420: 0xba, 0x421: 0xba, 0x422: 0x13d, 0x423: 0x13e, 0x424: 0xba, 0x425: 0xba, 0x426: 0xba, 0x427: 0xba, 0x428: 0x13f, 0x429: 0x140, 0x42a: 0x141, 0x42b: 0x142, 0x42c: 0xba, 0x42d: 0xba, 0x42e: 0xba, 0x42f: 0xba, 0x430: 0x143, 0x431: 0x144, 0x432: 0x145, 0x433: 0xba, 0x434: 0x146, 0x435: 0x147, 0x436: 0xba, 0x437: 0xba, 0x438: 0xba, 0x439: 0xba, 0x43a: 0xba, 0x43b: 0xba, 0x43c: 0xba, 0x43d: 0xba, 0x43e: 0xba, 0x43f: 0xba, // Block 0x11, offset 0x440 0x440: 0x9f, 0x441: 0x9f, 0x442: 0x9f, 0x443: 0x9f, 0x444: 0x9f, 0x445: 0x9f, 0x446: 0x9f, 0x447: 0x9f, 0x448: 0x9f, 0x449: 0x9f, 0x44a: 0x9f, 0x44b: 0x9f, 0x44c: 0x9f, 0x44d: 0x9f, 0x44e: 0x148, 0x44f: 0xba, 0x450: 0x9b, 0x451: 0x149, 0x452: 0x9f, 0x453: 0x9f, 0x454: 0x9f, 0x455: 0x14a, 0x456: 0xba, 0x457: 0xba, 0x458: 0xba, 0x459: 0xba, 0x45a: 0xba, 0x45b: 0xba, 0x45c: 0xba, 0x45d: 0xba, 0x45e: 0xba, 0x45f: 0xba, 0x460: 0xba, 0x461: 0xba, 0x462: 0xba, 0x463: 0xba, 0x464: 0xba, 0x465: 0xba, 0x466: 0xba, 0x467: 0xba, 0x468: 0xba, 0x469: 0xba, 0x46a: 0xba, 0x46b: 0xba, 0x46c: 0xba, 0x46d: 0xba, 0x46e: 0xba, 0x46f: 0xba, 0x470: 0xba, 0x471: 0xba, 0x472: 0xba, 0x473: 0xba, 0x474: 0xba, 0x475: 0xba, 0x476: 0xba, 0x477: 0xba, 0x478: 0xba, 0x479: 0xba, 0x47a: 0xba, 0x47b: 0xba, 0x47c: 0xba, 0x47d: 0xba, 0x47e: 0xba, 0x47f: 0xba, // Block 0x12, offset 0x480 0x480: 0x9f, 0x481: 0x9f, 0x482: 0x9f, 0x483: 0x9f, 0x484: 0x9f, 0x485: 0x9f, 0x486: 0x9f, 0x487: 0x9f, 0x488: 0x9f, 0x489: 0x9f, 0x48a: 0x9f, 0x48b: 0x9f, 0x48c: 0x9f, 0x48d: 0x9f, 0x48e: 0x9f, 0x48f: 0x9f, 0x490: 0x14b, 0x491: 0xba, 0x492: 0xba, 0x493: 0xba, 0x494: 0xba, 0x495: 0xba, 0x496: 0xba, 0x497: 0xba, 0x498: 0xba, 0x499: 0xba, 0x49a: 0xba, 0x49b: 0xba, 0x49c: 0xba, 0x49d: 0xba, 0x49e: 0xba, 0x49f: 0xba, 0x4a0: 0xba, 0x4a1: 0xba, 0x4a2: 0xba, 0x4a3: 0xba, 0x4a4: 0xba, 0x4a5: 0xba, 0x4a6: 0xba, 0x4a7: 0xba, 0x4a8: 0xba, 0x4a9: 0xba, 0x4aa: 0xba, 0x4ab: 0xba, 0x4ac: 0xba, 0x4ad: 0xba, 0x4ae: 0xba, 0x4af: 0xba, 0x4b0: 0xba, 0x4b1: 0xba, 0x4b2: 0xba, 0x4b3: 0xba, 0x4b4: 0xba, 0x4b5: 0xba, 0x4b6: 0xba, 0x4b7: 0xba, 0x4b8: 0xba, 0x4b9: 0xba, 0x4ba: 0xba, 0x4bb: 0xba, 0x4bc: 0xba, 0x4bd: 0xba, 0x4be: 0xba, 0x4bf: 0xba, // Block 0x13, offset 0x4c0 0x4c0: 0xba, 0x4c1: 0xba, 0x4c2: 0xba, 0x4c3: 0xba, 0x4c4: 0xba, 0x4c5: 0xba, 0x4c6: 0xba, 0x4c7: 0xba, 0x4c8: 0xba, 0x4c9: 0xba, 0x4ca: 0xba, 0x4cb: 0xba, 0x4cc: 0xba, 0x4cd: 0xba, 0x4ce: 0xba, 0x4cf: 0xba, 0x4d0: 0x9f, 0x4d1: 0x9f, 0x4d2: 0x9f, 0x4d3: 0x9f, 0x4d4: 0x9f, 0x4d5: 0x9f, 0x4d6: 0x9f, 0x4d7: 0x9f, 0x4d8: 0x9f, 0x4d9: 0x14c, 0x4da: 0xba, 0x4db: 0xba, 0x4dc: 0xba, 0x4dd: 0xba, 0x4de: 0xba, 0x4df: 0xba, 0x4e0: 0xba, 0x4e1: 0xba, 0x4e2: 0xba, 0x4e3: 0xba, 0x4e4: 0xba, 0x4e5: 0xba, 0x4e6: 0xba, 0x4e7: 0xba, 0x4e8: 0xba, 0x4e9: 0xba, 0x4ea: 0xba, 0x4eb: 0xba, 0x4ec: 0xba, 0x4ed: 0xba, 0x4ee: 0xba, 0x4ef: 0xba, 0x4f0: 0xba, 0x4f1: 0xba, 0x4f2: 0xba, 0x4f3: 0xba, 0x4f4: 0xba, 0x4f5: 0xba, 0x4f6: 0xba, 0x4f7: 0xba, 0x4f8: 0xba, 0x4f9: 0xba, 0x4fa: 0xba, 0x4fb: 0xba, 0x4fc: 0xba, 0x4fd: 0xba, 0x4fe: 0xba, 0x4ff: 0xba, // Block 0x14, offset 0x500 0x500: 0xba, 0x501: 0xba, 0x502: 0xba, 0x503: 0xba, 0x504: 0xba, 0x505: 0xba, 0x506: 0xba, 0x507: 0xba, 0x508: 0xba, 0x509: 0xba, 0x50a: 0xba, 0x50b: 0xba, 0x50c: 0xba, 0x50d: 0xba, 0x50e: 0xba, 0x50f: 0xba, 0x510: 0xba, 0x511: 0xba, 0x512: 0xba, 0x513: 0xba, 0x514: 0xba, 0x515: 0xba, 0x516: 0xba, 0x517: 0xba, 0x518: 0xba, 0x519: 0xba, 0x51a: 0xba, 0x51b: 0xba, 0x51c: 0xba, 0x51d: 0xba, 0x51e: 0xba, 0x51f: 0xba, 0x520: 0x9f, 0x521: 0x9f, 0x522: 0x9f, 0x523: 0x9f, 0x524: 0x9f, 0x525: 0x9f, 0x526: 0x9f, 0x527: 0x9f, 0x528: 0x142, 0x529: 0x14d, 0x52a: 0xba, 0x52b: 0x14e, 0x52c: 0x14f, 0x52d: 0x150, 0x52e: 0x151, 0x52f: 0xba, 0x530: 0xba, 0x531: 0xba, 0x532: 0xba, 0x533: 0xba, 0x534: 0xba, 0x535: 0xba, 0x536: 0xba, 0x537: 0xba, 0x538: 0xba, 0x539: 0xba, 0x53a: 0xba, 0x53b: 0xba, 0x53c: 0x9f, 0x53d: 0x152, 0x53e: 0x153, 0x53f: 0x154, // Block 0x15, offset 0x540 0x540: 0x9f, 0x541: 0x9f, 0x542: 0x9f, 0x543: 0x9f, 0x544: 0x9f, 0x545: 0x9f, 0x546: 0x9f, 0x547: 0x9f, 0x548: 0x9f, 0x549: 0x9f, 0x54a: 0x9f, 0x54b: 0x9f, 0x54c: 0x9f, 0x54d: 0x9f, 0x54e: 0x9f, 0x54f: 0x9f, 0x550: 0x9f, 0x551: 0x9f, 0x552: 0x9f, 0x553: 0x9f, 0x554: 0x9f, 0x555: 0x9f, 0x556: 0x9f, 0x557: 0x9f, 0x558: 0x9f, 0x559: 0x9f, 0x55a: 0x9f, 0x55b: 0x9f, 0x55c: 0x9f, 0x55d: 0x9f, 0x55e: 0x9f, 0x55f: 0x155, 0x560: 0x9f, 0x561: 0x9f, 0x562: 0x9f, 0x563: 0x9f, 0x564: 0x9f, 0x565: 0x9f, 0x566: 0x9f, 0x567: 0x9f, 0x568: 0x9f, 0x569: 0x9f, 0x56a: 0x9f, 0x56b: 0x156, 0x56c: 0xba, 0x56d: 0xba, 0x56e: 0xba, 0x56f: 0xba, 0x570: 0xba, 0x571: 0xba, 0x572: 0xba, 0x573: 0xba, 0x574: 0xba, 0x575: 0xba, 0x576: 0xba, 0x577: 0xba, 0x578: 0xba, 0x579: 0xba, 0x57a: 0xba, 0x57b: 0xba, 0x57c: 0xba, 0x57d: 0xba, 0x57e: 0xba, 0x57f: 0xba, // Block 0x16, offset 0x580 0x580: 0x9f, 0x581: 0x9f, 0x582: 0x9f, 0x583: 0x9f, 0x584: 0x157, 0x585: 0x158, 0x586: 0x9f, 0x587: 0x9f, 0x588: 0x9f, 0x589: 0x9f, 0x58a: 0x9f, 0x58b: 0x159, 0x58c: 0xba, 0x58d: 0xba, 0x58e: 0xba, 0x58f: 0xba, 0x590: 0xba, 0x591: 0xba, 0x592: 0xba, 0x593: 0xba, 0x594: 0xba, 0x595: 0xba, 0x596: 0xba, 0x597: 0xba, 0x598: 0xba, 0x599: 0xba, 0x59a: 0xba, 0x59b: 0xba, 0x59c: 0xba, 0x59d: 0xba, 0x59e: 0xba, 0x59f: 0xba, 0x5a0: 0xba, 0x5a1: 0xba, 0x5a2: 0xba, 0x5a3: 0xba, 0x5a4: 0xba, 0x5a5: 0xba, 0x5a6: 0xba, 0x5a7: 0xba, 0x5a8: 0xba, 0x5a9: 0xba, 0x5aa: 0xba, 0x5ab: 0xba, 0x5ac: 0xba, 0x5ad: 0xba, 0x5ae: 0xba, 0x5af: 0xba, 0x5b0: 0x9f, 0x5b1: 0x15a, 0x5b2: 0x15b, 0x5b3: 0xba, 0x5b4: 0xba, 0x5b5: 0xba, 0x5b6: 0xba, 0x5b7: 0xba, 0x5b8: 0xba, 0x5b9: 0xba, 0x5ba: 0xba, 0x5bb: 0xba, 0x5bc: 0xba, 0x5bd: 0xba, 0x5be: 0xba, 0x5bf: 0xba, // Block 0x17, offset 0x5c0 0x5c0: 0x9b, 0x5c1: 0x9b, 0x5c2: 0x9b, 0x5c3: 0x15c, 0x5c4: 0x15d, 0x5c5: 0x15e, 0x5c6: 0x15f, 0x5c7: 0x160, 0x5c8: 0x9b, 0x5c9: 0x161, 0x5ca: 0xba, 0x5cb: 0xba, 0x5cc: 0x9b, 0x5cd: 0x162, 0x5ce: 0xba, 0x5cf: 0xba, 0x5d0: 0x5f, 0x5d1: 0x60, 0x5d2: 0x61, 0x5d3: 0x62, 0x5d4: 0x63, 0x5d5: 0x64, 0x5d6: 0x65, 0x5d7: 0x66, 0x5d8: 0x67, 0x5d9: 0x68, 0x5da: 0x69, 0x5db: 0x6a, 0x5dc: 0x6b, 0x5dd: 0x6c, 0x5de: 0x6d, 0x5df: 0x6e, 0x5e0: 0x9b, 0x5e1: 0x9b, 0x5e2: 0x9b, 0x5e3: 0x9b, 0x5e4: 0x9b, 0x5e5: 0x9b, 0x5e6: 0x9b, 0x5e7: 0x9b, 0x5e8: 0x163, 0x5e9: 0x164, 0x5ea: 0x165, 0x5eb: 0xba, 0x5ec: 0xba, 0x5ed: 0xba, 0x5ee: 0xba, 0x5ef: 0xba, 0x5f0: 0xba, 0x5f1: 0xba, 0x5f2: 0xba, 0x5f3: 0xba, 0x5f4: 0xba, 0x5f5: 0xba, 0x5f6: 0xba, 0x5f7: 0xba, 0x5f8: 0xba, 0x5f9: 0xba, 0x5fa: 0xba, 0x5fb: 0xba, 0x5fc: 0xba, 0x5fd: 0xba, 0x5fe: 0xba, 0x5ff: 0xba, // Block 0x18, offset 0x600 0x600: 0x166, 0x601: 0xba, 0x602: 0xba, 0x603: 0xba, 0x604: 0xba, 0x605: 0xba, 0x606: 0xba, 0x607: 0xba, 0x608: 0xba, 0x609: 0xba, 0x60a: 0xba, 0x60b: 0xba, 0x60c: 0xba, 0x60d: 0xba, 0x60e: 0xba, 0x60f: 0xba, 0x610: 0xba, 0x611: 0xba, 0x612: 0xba, 0x613: 0xba, 0x614: 0xba, 0x615: 0xba, 0x616: 0xba, 0x617: 0xba, 0x618: 0xba, 0x619: 0xba, 0x61a: 0xba, 0x61b: 0xba, 0x61c: 0xba, 0x61d: 0xba, 0x61e: 0xba, 0x61f: 0xba, 0x620: 0x122, 0x621: 0x122, 0x622: 0x122, 0x623: 0x167, 0x624: 0x6f, 0x625: 0x168, 0x626: 0xba, 0x627: 0xba, 0x628: 0xba, 0x629: 0xba, 0x62a: 0xba, 0x62b: 0xba, 0x62c: 0xba, 0x62d: 0xba, 0x62e: 0xba, 0x62f: 0xba, 0x630: 0xba, 0x631: 0xba, 0x632: 0xba, 0x633: 0xba, 0x634: 0xba, 0x635: 0xba, 0x636: 0xba, 0x637: 0xba, 0x638: 0x70, 0x639: 0x71, 0x63a: 0x72, 0x63b: 0x169, 0x63c: 0xba, 0x63d: 0xba, 0x63e: 0xba, 0x63f: 0xba, // Block 0x19, offset 0x640 0x640: 0x16a, 0x641: 0x9b, 0x642: 0x16b, 0x643: 0x16c, 0x644: 0x73, 0x645: 0x74, 0x646: 0x16d, 0x647: 0x16e, 0x648: 0x75, 0x649: 0x16f, 0x64a: 0xba, 0x64b: 0xba, 0x64c: 0x9b, 0x64d: 0x9b, 0x64e: 0x9b, 0x64f: 0x9b, 0x650: 0x9b, 0x651: 0x9b, 0x652: 0x9b, 0x653: 0x9b, 0x654: 0x9b, 0x655: 0x9b, 0x656: 0x9b, 0x657: 0x9b, 0x658: 0x9b, 0x659: 0x9b, 0x65a: 0x9b, 0x65b: 0x170, 0x65c: 0x9b, 0x65d: 0x171, 0x65e: 0x9b, 0x65f: 0x172, 0x660: 0x173, 0x661: 0x174, 0x662: 0x175, 0x663: 0xba, 0x664: 0x176, 0x665: 0x177, 0x666: 0x178, 0x667: 0x179, 0x668: 0xba, 0x669: 0xba, 0x66a: 0xba, 0x66b: 0xba, 0x66c: 0xba, 0x66d: 0xba, 0x66e: 0xba, 0x66f: 0xba, 0x670: 0xba, 0x671: 0xba, 0x672: 0xba, 0x673: 0xba, 0x674: 0xba, 0x675: 0xba, 0x676: 0xba, 0x677: 0xba, 0x678: 0xba, 0x679: 0xba, 0x67a: 0xba, 0x67b: 0xba, 0x67c: 0xba, 0x67d: 0xba, 0x67e: 0xba, 0x67f: 0xba, // Block 0x1a, offset 0x680 0x680: 0x9f, 0x681: 0x9f, 0x682: 0x9f, 0x683: 0x9f, 0x684: 0x9f, 0x685: 0x9f, 0x686: 0x9f, 0x687: 0x9f, 0x688: 0x9f, 0x689: 0x9f, 0x68a: 0x9f, 0x68b: 0x9f, 0x68c: 0x9f, 0x68d: 0x9f, 0x68e: 0x9f, 0x68f: 0x9f, 0x690: 0x9f, 0x691: 0x9f, 0x692: 0x9f, 0x693: 0x9f, 0x694: 0x9f, 0x695: 0x9f, 0x696: 0x9f, 0x697: 0x9f, 0x698: 0x9f, 0x699: 0x9f, 0x69a: 0x9f, 0x69b: 0x17a, 0x69c: 0x9f, 0x69d: 0x9f, 0x69e: 0x9f, 0x69f: 0x9f, 0x6a0: 0x9f, 0x6a1: 0x9f, 0x6a2: 0x9f, 0x6a3: 0x9f, 0x6a4: 0x9f, 0x6a5: 0x9f, 0x6a6: 0x9f, 0x6a7: 0x9f, 0x6a8: 0x9f, 0x6a9: 0x9f, 0x6aa: 0x9f, 0x6ab: 0x9f, 0x6ac: 0x9f, 0x6ad: 0x9f, 0x6ae: 0x9f, 0x6af: 0x9f, 0x6b0: 0x9f, 0x6b1: 0x9f, 0x6b2: 0x9f, 0x6b3: 0x9f, 0x6b4: 0x9f, 0x6b5: 0x9f, 0x6b6: 0x9f, 0x6b7: 0x9f, 0x6b8: 0x9f, 0x6b9: 0x9f, 0x6ba: 0x9f, 0x6bb: 0x9f, 0x6bc: 0x9f, 0x6bd: 0x9f, 0x6be: 0x9f, 0x6bf: 0x9f, // Block 0x1b, offset 0x6c0 0x6c0: 0x9f, 0x6c1: 0x9f, 0x6c2: 0x9f, 0x6c3: 0x9f, 0x6c4: 0x9f, 0x6c5: 0x9f, 0x6c6: 0x9f, 0x6c7: 0x9f, 0x6c8: 0x9f, 0x6c9: 0x9f, 0x6ca: 0x9f, 0x6cb: 0x9f, 0x6cc: 0x9f, 0x6cd: 0x9f, 0x6ce: 0x9f, 0x6cf: 0x9f, 0x6d0: 0x9f, 0x6d1: 0x9f, 0x6d2: 0x9f, 0x6d3: 0x9f, 0x6d4: 0x9f, 0x6d5: 0x9f, 0x6d6: 0x9f, 0x6d7: 0x9f, 0x6d8: 0x9f, 0x6d9: 0x9f, 0x6da: 0x9f, 0x6db: 0x9f, 0x6dc: 0x17b, 0x6dd: 0x9f, 0x6de: 0x9f, 0x6df: 0x9f, 0x6e0: 0x17c, 0x6e1: 0x9f, 0x6e2: 0x9f, 0x6e3: 0x9f, 0x6e4: 0x9f, 0x6e5: 0x9f, 0x6e6: 0x9f, 0x6e7: 0x9f, 0x6e8: 0x9f, 0x6e9: 0x9f, 0x6ea: 0x9f, 0x6eb: 0x9f, 0x6ec: 0x9f, 0x6ed: 0x9f, 0x6ee: 0x9f, 0x6ef: 0x9f, 0x6f0: 0x9f, 0x6f1: 0x9f, 0x6f2: 0x9f, 0x6f3: 0x9f, 0x6f4: 0x9f, 0x6f5: 0x9f, 0x6f6: 0x9f, 0x6f7: 0x9f, 0x6f8: 0x9f, 0x6f9: 0x9f, 0x6fa: 0x9f, 0x6fb: 0x9f, 0x6fc: 0x9f, 0x6fd: 0x9f, 0x6fe: 0x9f, 0x6ff: 0x9f, // Block 0x1c, offset 0x700 0x700: 0x9f, 0x701: 0x9f, 0x702: 0x9f, 0x703: 0x9f, 0x704: 0x9f, 0x705: 0x9f, 0x706: 0x9f, 0x707: 0x9f, 0x708: 0x9f, 0x709: 0x9f, 0x70a: 0x9f, 0x70b: 0x9f, 0x70c: 0x9f, 0x70d: 0x9f, 0x70e: 0x9f, 0x70f: 0x9f, 0x710: 0x9f, 0x711: 0x9f, 0x712: 0x9f, 0x713: 0x9f, 0x714: 0x9f, 0x715: 0x9f, 0x716: 0x9f, 0x717: 0x9f, 0x718: 0x9f, 0x719: 0x9f, 0x71a: 0x9f, 0x71b: 0x9f, 0x71c: 0x9f, 0x71d: 0x9f, 0x71e: 0x9f, 0x71f: 0x9f, 0x720: 0x9f, 0x721: 0x9f, 0x722: 0x9f, 0x723: 0x9f, 0x724: 0x9f, 0x725: 0x9f, 0x726: 0x9f, 0x727: 0x9f, 0x728: 0x9f, 0x729: 0x9f, 0x72a: 0x9f, 0x72b: 0x9f, 0x72c: 0x9f, 0x72d: 0x9f, 0x72e: 0x9f, 0x72f: 0x9f, 0x730: 0x9f, 0x731: 0x9f, 0x732: 0x9f, 0x733: 0x9f, 0x734: 0x9f, 0x735: 0x9f, 0x736: 0x9f, 0x737: 0x9f, 0x738: 0x9f, 0x739: 0x9f, 0x73a: 0x17d, 0x73b: 0x9f, 0x73c: 0x9f, 0x73d: 0x9f, 0x73e: 0x9f, 0x73f: 0x9f, // Block 0x1d, offset 0x740 0x740: 0x9f, 0x741: 0x9f, 0x742: 0x9f, 0x743: 0x9f, 0x744: 0x9f, 0x745: 0x9f, 0x746: 0x9f, 0x747: 0x9f, 0x748: 0x9f, 0x749: 0x9f, 0x74a: 0x9f, 0x74b: 0x9f, 0x74c: 0x9f, 0x74d: 0x9f, 0x74e: 0x9f, 0x74f: 0x9f, 0x750: 0x9f, 0x751: 0x9f, 0x752: 0x9f, 0x753: 0x9f, 0x754: 0x9f, 0x755: 0x9f, 0x756: 0x9f, 0x757: 0x9f, 0x758: 0x9f, 0x759: 0x9f, 0x75a: 0x9f, 0x75b: 0x9f, 0x75c: 0x9f, 0x75d: 0x9f, 0x75e: 0x9f, 0x75f: 0x9f, 0x760: 0x9f, 0x761: 0x9f, 0x762: 0x9f, 0x763: 0x9f, 0x764: 0x9f, 0x765: 0x9f, 0x766: 0x9f, 0x767: 0x9f, 0x768: 0x9f, 0x769: 0x9f, 0x76a: 0x9f, 0x76b: 0x9f, 0x76c: 0x9f, 0x76d: 0x9f, 0x76e: 0x9f, 0x76f: 0x17e, 0x770: 0xba, 0x771: 0xba, 0x772: 0xba, 0x773: 0xba, 0x774: 0xba, 0x775: 0xba, 0x776: 0xba, 0x777: 0xba, 0x778: 0xba, 0x779: 0xba, 0x77a: 0xba, 0x77b: 0xba, 0x77c: 0xba, 0x77d: 0xba, 0x77e: 0xba, 0x77f: 0xba, // Block 0x1e, offset 0x780 0x780: 0xba, 0x781: 0xba, 0x782: 0xba, 0x783: 0xba, 0x784: 0xba, 0x785: 0xba, 0x786: 0xba, 0x787: 0xba, 0x788: 0xba, 0x789: 0xba, 0x78a: 0xba, 0x78b: 0xba, 0x78c: 0xba, 0x78d: 0xba, 0x78e: 0xba, 0x78f: 0xba, 0x790: 0xba, 0x791: 0xba, 0x792: 0xba, 0x793: 0xba, 0x794: 0xba, 0x795: 0xba, 0x796: 0xba, 0x797: 0xba, 0x798: 0xba, 0x799: 0xba, 0x79a: 0xba, 0x79b: 0xba, 0x79c: 0xba, 0x79d: 0xba, 0x79e: 0xba, 0x79f: 0xba, 0x7a0: 0x76, 0x7a1: 0x77, 0x7a2: 0x78, 0x7a3: 0x17f, 0x7a4: 0x79, 0x7a5: 0x7a, 0x7a6: 0x180, 0x7a7: 0x7b, 0x7a8: 0x7c, 0x7a9: 0xba, 0x7aa: 0xba, 0x7ab: 0xba, 0x7ac: 0xba, 0x7ad: 0xba, 0x7ae: 0xba, 0x7af: 0xba, 0x7b0: 0xba, 0x7b1: 0xba, 0x7b2: 0xba, 0x7b3: 0xba, 0x7b4: 0xba, 0x7b5: 0xba, 0x7b6: 0xba, 0x7b7: 0xba, 0x7b8: 0xba, 0x7b9: 0xba, 0x7ba: 0xba, 0x7bb: 0xba, 0x7bc: 0xba, 0x7bd: 0xba, 0x7be: 0xba, 0x7bf: 0xba, // Block 0x1f, offset 0x7c0 0x7d0: 0x0d, 0x7d1: 0x0e, 0x7d2: 0x0f, 0x7d3: 0x10, 0x7d4: 0x11, 0x7d5: 0x0b, 0x7d6: 0x12, 0x7d7: 0x07, 0x7d8: 0x13, 0x7d9: 0x0b, 0x7da: 0x0b, 0x7db: 0x14, 0x7dc: 0x0b, 0x7dd: 0x15, 0x7de: 0x16, 0x7df: 0x17, 0x7e0: 0x07, 0x7e1: 0x07, 0x7e2: 0x07, 0x7e3: 0x07, 0x7e4: 0x07, 0x7e5: 0x07, 0x7e6: 0x07, 0x7e7: 0x07, 0x7e8: 0x07, 0x7e9: 0x07, 0x7ea: 0x18, 0x7eb: 0x19, 0x7ec: 0x1a, 0x7ed: 0x07, 0x7ee: 0x1b, 0x7ef: 0x1c, 0x7f0: 0x0b, 0x7f1: 0x0b, 0x7f2: 0x0b, 0x7f3: 0x0b, 0x7f4: 0x0b, 0x7f5: 0x0b, 0x7f6: 0x0b, 0x7f7: 0x0b, 0x7f8: 0x0b, 0x7f9: 0x0b, 0x7fa: 0x0b, 0x7fb: 0x0b, 0x7fc: 0x0b, 0x7fd: 0x0b, 0x7fe: 0x0b, 0x7ff: 0x0b, // Block 0x20, offset 0x800 0x800: 0x0b, 0x801: 0x0b, 0x802: 0x0b, 0x803: 0x0b, 0x804: 0x0b, 0x805: 0x0b, 0x806: 0x0b, 0x807: 0x0b, 0x808: 0x0b, 0x809: 0x0b, 0x80a: 0x0b, 0x80b: 0x0b, 0x80c: 0x0b, 0x80d: 0x0b, 0x80e: 0x0b, 0x80f: 0x0b, 0x810: 0x0b, 0x811: 0x0b, 0x812: 0x0b, 0x813: 0x0b, 0x814: 0x0b, 0x815: 0x0b, 0x816: 0x0b, 0x817: 0x0b, 0x818: 0x0b, 0x819: 0x0b, 0x81a: 0x0b, 0x81b: 0x0b, 0x81c: 0x0b, 0x81d: 0x0b, 0x81e: 0x0b, 0x81f: 0x0b, 0x820: 0x0b, 0x821: 0x0b, 0x822: 0x0b, 0x823: 0x0b, 0x824: 0x0b, 0x825: 0x0b, 0x826: 0x0b, 0x827: 0x0b, 0x828: 0x0b, 0x829: 0x0b, 0x82a: 0x0b, 0x82b: 0x0b, 0x82c: 0x0b, 0x82d: 0x0b, 0x82e: 0x0b, 0x82f: 0x0b, 0x830: 0x0b, 0x831: 0x0b, 0x832: 0x0b, 0x833: 0x0b, 0x834: 0x0b, 0x835: 0x0b, 0x836: 0x0b, 0x837: 0x0b, 0x838: 0x0b, 0x839: 0x0b, 0x83a: 0x0b, 0x83b: 0x0b, 0x83c: 0x0b, 0x83d: 0x0b, 0x83e: 0x0b, 0x83f: 0x0b, // Block 0x21, offset 0x840 0x840: 0x181, 0x841: 0x182, 0x842: 0xba, 0x843: 0xba, 0x844: 0x183, 0x845: 0x183, 0x846: 0x183, 0x847: 0x184, 0x848: 0xba, 0x849: 0xba, 0x84a: 0xba, 0x84b: 0xba, 0x84c: 0xba, 0x84d: 0xba, 0x84e: 0xba, 0x84f: 0xba, 0x850: 0xba, 0x851: 0xba, 0x852: 0xba, 0x853: 0xba, 0x854: 0xba, 0x855: 0xba, 0x856: 0xba, 0x857: 0xba, 0x858: 0xba, 0x859: 0xba, 0x85a: 0xba, 0x85b: 0xba, 0x85c: 0xba, 0x85d: 0xba, 0x85e: 0xba, 0x85f: 0xba, 0x860: 0xba, 0x861: 0xba, 0x862: 0xba, 0x863: 0xba, 0x864: 0xba, 0x865: 0xba, 0x866: 0xba, 0x867: 0xba, 0x868: 0xba, 0x869: 0xba, 0x86a: 0xba, 0x86b: 0xba, 0x86c: 0xba, 0x86d: 0xba, 0x86e: 0xba, 0x86f: 0xba, 0x870: 0xba, 0x871: 0xba, 0x872: 0xba, 0x873: 0xba, 0x874: 0xba, 0x875: 0xba, 0x876: 0xba, 0x877: 0xba, 0x878: 0xba, 0x879: 0xba, 0x87a: 0xba, 0x87b: 0xba, 0x87c: 0xba, 0x87d: 0xba, 0x87e: 0xba, 0x87f: 0xba, // Block 0x22, offset 0x880 0x880: 0x0b, 0x881: 0x0b, 0x882: 0x0b, 0x883: 0x0b, 0x884: 0x0b, 0x885: 0x0b, 0x886: 0x0b, 0x887: 0x0b, 0x888: 0x0b, 0x889: 0x0b, 0x88a: 0x0b, 0x88b: 0x0b, 0x88c: 0x0b, 0x88d: 0x0b, 0x88e: 0x0b, 0x88f: 0x0b, 0x890: 0x0b, 0x891: 0x0b, 0x892: 0x0b, 0x893: 0x0b, 0x894: 0x0b, 0x895: 0x0b, 0x896: 0x0b, 0x897: 0x0b, 0x898: 0x0b, 0x899: 0x0b, 0x89a: 0x0b, 0x89b: 0x0b, 0x89c: 0x0b, 0x89d: 0x0b, 0x89e: 0x0b, 0x89f: 0x0b, 0x8a0: 0x1f, 0x8a1: 0x0b, 0x8a2: 0x0b, 0x8a3: 0x0b, 0x8a4: 0x0b, 0x8a5: 0x0b, 0x8a6: 0x0b, 0x8a7: 0x0b, 0x8a8: 0x0b, 0x8a9: 0x0b, 0x8aa: 0x0b, 0x8ab: 0x0b, 0x8ac: 0x0b, 0x8ad: 0x0b, 0x8ae: 0x0b, 0x8af: 0x0b, 0x8b0: 0x0b, 0x8b1: 0x0b, 0x8b2: 0x0b, 0x8b3: 0x0b, 0x8b4: 0x0b, 0x8b5: 0x0b, 0x8b6: 0x0b, 0x8b7: 0x0b, 0x8b8: 0x0b, 0x8b9: 0x0b, 0x8ba: 0x0b, 0x8bb: 0x0b, 0x8bc: 0x0b, 0x8bd: 0x0b, 0x8be: 0x0b, 0x8bf: 0x0b, // Block 0x23, offset 0x8c0 0x8c0: 0x0b, 0x8c1: 0x0b, 0x8c2: 0x0b, 0x8c3: 0x0b, 0x8c4: 0x0b, 0x8c5: 0x0b, 0x8c6: 0x0b, 0x8c7: 0x0b, 0x8c8: 0x0b, 0x8c9: 0x0b, 0x8ca: 0x0b, 0x8cb: 0x0b, 0x8cc: 0x0b, 0x8cd: 0x0b, 0x8ce: 0x0b, 0x8cf: 0x0b, } // idnaSparseOffset: 264 entries, 528 bytes var idnaSparseOffset = []uint16{0x0, 0x8, 0x19, 0x25, 0x27, 0x2c, 0x34, 0x3f, 0x4b, 0x4f, 0x5e, 0x63, 0x6b, 0x77, 0x85, 0x8a, 0x93, 0xa3, 0xb1, 0xbd, 0xc9, 0xda, 0xe4, 0xeb, 0xf8, 0x109, 0x110, 0x11b, 0x12a, 0x138, 0x142, 0x144, 0x149, 0x14c, 0x14f, 0x151, 0x15d, 0x168, 0x170, 0x176, 0x17c, 0x181, 0x186, 0x189, 0x18d, 0x193, 0x198, 0x1a4, 0x1ae, 0x1b4, 0x1c5, 0x1cf, 0x1d2, 0x1da, 0x1dd, 0x1ea, 0x1f2, 0x1f6, 0x1fd, 0x205, 0x215, 0x221, 0x223, 0x22d, 0x239, 0x245, 0x251, 0x259, 0x25e, 0x268, 0x279, 0x27d, 0x288, 0x28c, 0x295, 0x29d, 0x2a3, 0x2a8, 0x2ab, 0x2af, 0x2b5, 0x2b9, 0x2bd, 0x2c3, 0x2ca, 0x2d0, 0x2d8, 0x2df, 0x2ea, 0x2f4, 0x2f8, 0x2fb, 0x301, 0x305, 0x307, 0x30a, 0x30c, 0x30f, 0x319, 0x31c, 0x32b, 0x32f, 0x334, 0x337, 0x33b, 0x340, 0x345, 0x34b, 0x351, 0x360, 0x366, 0x36a, 0x379, 0x37e, 0x386, 0x390, 0x39b, 0x3a3, 0x3b4, 0x3bd, 0x3cd, 0x3da, 0x3e4, 0x3e9, 0x3f6, 0x3fa, 0x3ff, 0x401, 0x405, 0x407, 0x40b, 0x414, 0x41a, 0x41e, 0x42e, 0x438, 0x43d, 0x440, 0x446, 0x44d, 0x452, 0x456, 0x45c, 0x461, 0x46a, 0x46f, 0x475, 0x47c, 0x483, 0x48a, 0x48e, 0x493, 0x496, 0x49b, 0x4a7, 0x4ad, 0x4b2, 0x4b9, 0x4c1, 0x4c6, 0x4ca, 0x4da, 0x4e1, 0x4e5, 0x4e9, 0x4f0, 0x4f2, 0x4f5, 0x4f8, 0x4fc, 0x500, 0x506, 0x50f, 0x51b, 0x522, 0x52b, 0x533, 0x53a, 0x548, 0x555, 0x562, 0x56b, 0x56f, 0x57d, 0x585, 0x590, 0x599, 0x59f, 0x5a7, 0x5b0, 0x5ba, 0x5bd, 0x5c9, 0x5cc, 0x5d1, 0x5de, 0x5e7, 0x5f3, 0x5f6, 0x600, 0x609, 0x615, 0x622, 0x62a, 0x62d, 0x632, 0x635, 0x638, 0x63b, 0x642, 0x649, 0x64d, 0x658, 0x65b, 0x661, 0x666, 0x66a, 0x66d, 0x670, 0x673, 0x676, 0x679, 0x67e, 0x688, 0x68b, 0x68f, 0x69e, 0x6aa, 0x6ae, 0x6b3, 0x6b8, 0x6bc, 0x6c1, 0x6ca, 0x6d5, 0x6db, 0x6e3, 0x6e7, 0x6eb, 0x6f1, 0x6f7, 0x6fc, 0x6ff, 0x70f, 0x716, 0x719, 0x71c, 0x720, 0x726, 0x72b, 0x730, 0x735, 0x738, 0x73d, 0x740, 0x743, 0x747, 0x74b, 0x74e, 0x75e, 0x76f, 0x774, 0x776, 0x778} // idnaSparseValues: 1915 entries, 7660 bytes var idnaSparseValues = [1915]valueRange{ // Block 0x0, offset 0x0 {value: 0x0000, lo: 0x07}, {value: 0xe105, lo: 0x80, hi: 0x96}, {value: 0x0018, lo: 0x97, hi: 0x97}, {value: 0xe105, lo: 0x98, hi: 0x9e}, {value: 0x001f, lo: 0x9f, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xb7}, {value: 0x0008, lo: 0xb8, hi: 0xbf}, // Block 0x1, offset 0x8 {value: 0x0000, lo: 0x10}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0xe01d, lo: 0x81, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0x82}, {value: 0x0335, lo: 0x83, hi: 0x83}, {value: 0x034d, lo: 0x84, hi: 0x84}, {value: 0x0365, lo: 0x85, hi: 0x85}, {value: 0xe00d, lo: 0x86, hi: 0x86}, {value: 0x0008, lo: 0x87, hi: 0x87}, {value: 0xe00d, lo: 0x88, hi: 0x88}, {value: 0x0008, lo: 0x89, hi: 0x89}, {value: 0xe00d, lo: 0x8a, hi: 0x8a}, {value: 0x0008, lo: 0x8b, hi: 0x8b}, {value: 0xe00d, lo: 0x8c, hi: 0x8c}, {value: 0x0008, lo: 0x8d, hi: 0x8d}, {value: 0xe00d, lo: 0x8e, hi: 0x8e}, {value: 0x0008, lo: 0x8f, hi: 0xbf}, // Block 0x2, offset 0x19 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x0249, lo: 0xb0, hi: 0xb0}, {value: 0x037d, lo: 0xb1, hi: 0xb1}, {value: 0x0259, lo: 0xb2, hi: 0xb2}, {value: 0x0269, lo: 0xb3, hi: 0xb3}, {value: 0x034d, lo: 0xb4, hi: 0xb4}, {value: 0x0395, lo: 0xb5, hi: 0xb5}, {value: 0xe1bd, lo: 0xb6, hi: 0xb6}, {value: 0x0279, lo: 0xb7, hi: 0xb7}, {value: 0x0289, lo: 0xb8, hi: 0xb8}, {value: 0x0008, lo: 0xb9, hi: 0xbf}, // Block 0x3, offset 0x25 {value: 0x0000, lo: 0x01}, {value: 0x3308, lo: 0x80, hi: 0xbf}, // Block 0x4, offset 0x27 {value: 0x0000, lo: 0x04}, {value: 0x03f5, lo: 0x80, hi: 0x8f}, {value: 0xe105, lo: 0x90, hi: 0x9f}, {value: 0x049d, lo: 0xa0, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x5, offset 0x2c {value: 0x0000, lo: 0x07}, {value: 0xe185, lo: 0x80, hi: 0x8f}, {value: 0x0545, lo: 0x90, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x98}, {value: 0x0008, lo: 0x99, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xa0}, {value: 0x0008, lo: 0xa1, hi: 0xbf}, // Block 0x6, offset 0x34 {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0401, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x88}, {value: 0x0018, lo: 0x89, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0x90}, {value: 0x3308, lo: 0x91, hi: 0xbd}, {value: 0x0818, lo: 0xbe, hi: 0xbe}, {value: 0x3308, lo: 0xbf, hi: 0xbf}, // Block 0x7, offset 0x3f {value: 0x0000, lo: 0x0b}, {value: 0x0818, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x82}, {value: 0x0818, lo: 0x83, hi: 0x83}, {value: 0x3308, lo: 0x84, hi: 0x85}, {value: 0x0818, lo: 0x86, hi: 0x86}, {value: 0x3308, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0808, lo: 0x90, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xaf}, {value: 0x0808, lo: 0xb0, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0x8, offset 0x4b {value: 0x0000, lo: 0x03}, {value: 0x0a08, lo: 0x80, hi: 0x87}, {value: 0x0c08, lo: 0x88, hi: 0x99}, {value: 0x0a08, lo: 0x9a, hi: 0xbf}, // Block 0x9, offset 0x4f {value: 0x0000, lo: 0x0e}, {value: 0x3308, lo: 0x80, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8c}, {value: 0x0c08, lo: 0x8d, hi: 0x8d}, {value: 0x0a08, lo: 0x8e, hi: 0x98}, {value: 0x0c08, lo: 0x99, hi: 0x9b}, {value: 0x0a08, lo: 0x9c, hi: 0xaa}, {value: 0x0c08, lo: 0xab, hi: 0xac}, {value: 0x0a08, lo: 0xad, hi: 0xb0}, {value: 0x0c08, lo: 0xb1, hi: 0xb1}, {value: 0x0a08, lo: 0xb2, hi: 0xb2}, {value: 0x0c08, lo: 0xb3, hi: 0xb4}, {value: 0x0a08, lo: 0xb5, hi: 0xb7}, {value: 0x0c08, lo: 0xb8, hi: 0xb9}, {value: 0x0a08, lo: 0xba, hi: 0xbf}, // Block 0xa, offset 0x5e {value: 0x0000, lo: 0x04}, {value: 0x0808, lo: 0x80, hi: 0xa5}, {value: 0x3308, lo: 0xa6, hi: 0xb0}, {value: 0x0808, lo: 0xb1, hi: 0xb1}, {value: 0x0040, lo: 0xb2, hi: 0xbf}, // Block 0xb, offset 0x63 {value: 0x0000, lo: 0x07}, {value: 0x0808, lo: 0x80, hi: 0x89}, {value: 0x0a08, lo: 0x8a, hi: 0xaa}, {value: 0x3308, lo: 0xab, hi: 0xb3}, {value: 0x0808, lo: 0xb4, hi: 0xb5}, {value: 0x0018, lo: 0xb6, hi: 0xb9}, {value: 0x0818, lo: 0xba, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbf}, // Block 0xc, offset 0x6b {value: 0x0000, lo: 0x0b}, {value: 0x0808, lo: 0x80, hi: 0x95}, {value: 0x3308, lo: 0x96, hi: 0x99}, {value: 0x0808, lo: 0x9a, hi: 0x9a}, {value: 0x3308, lo: 0x9b, hi: 0xa3}, {value: 0x0808, lo: 0xa4, hi: 0xa4}, {value: 0x3308, lo: 0xa5, hi: 0xa7}, {value: 0x0808, lo: 0xa8, hi: 0xa8}, {value: 0x3308, lo: 0xa9, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x0818, lo: 0xb0, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0xd, offset 0x77 {value: 0x0000, lo: 0x0d}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0a08, lo: 0xa0, hi: 0xa9}, {value: 0x0c08, lo: 0xaa, hi: 0xac}, {value: 0x0808, lo: 0xad, hi: 0xad}, {value: 0x0c08, lo: 0xae, hi: 0xae}, {value: 0x0a08, lo: 0xaf, hi: 0xb0}, {value: 0x0c08, lo: 0xb1, hi: 0xb2}, {value: 0x0a08, lo: 0xb3, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xb5}, {value: 0x0a08, lo: 0xb6, hi: 0xb8}, {value: 0x0c08, lo: 0xb9, hi: 0xb9}, {value: 0x0a08, lo: 0xba, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbf}, // Block 0xe, offset 0x85 {value: 0x0000, lo: 0x04}, {value: 0x0040, lo: 0x80, hi: 0x93}, {value: 0x3308, lo: 0x94, hi: 0xa1}, {value: 0x0840, lo: 0xa2, hi: 0xa2}, {value: 0x3308, lo: 0xa3, hi: 0xbf}, // Block 0xf, offset 0x8a {value: 0x0000, lo: 0x08}, {value: 0x3308, lo: 0x80, hi: 0x82}, {value: 0x3008, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0xb9}, {value: 0x3308, lo: 0xba, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbf}, // Block 0x10, offset 0x93 {value: 0x0000, lo: 0x0f}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x3008, lo: 0x81, hi: 0x82}, {value: 0x0040, lo: 0x83, hi: 0x85}, {value: 0x3008, lo: 0x86, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x3008, lo: 0x8a, hi: 0x8c}, {value: 0x3b08, lo: 0x8d, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x96}, {value: 0x3008, lo: 0x97, hi: 0x97}, {value: 0x0040, lo: 0x98, hi: 0xa5}, {value: 0x0008, lo: 0xa6, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbf}, // Block 0x11, offset 0xa3 {value: 0x0000, lo: 0x0d}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x3008, lo: 0x81, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8d}, {value: 0x0008, lo: 0x8e, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x91}, {value: 0x0008, lo: 0x92, hi: 0xa8}, {value: 0x0040, lo: 0xa9, hi: 0xa9}, {value: 0x0008, lo: 0xaa, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbd}, {value: 0x3308, lo: 0xbe, hi: 0xbf}, // Block 0x12, offset 0xb1 {value: 0x0000, lo: 0x0b}, {value: 0x3308, lo: 0x80, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8d}, {value: 0x0008, lo: 0x8e, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x91}, {value: 0x0008, lo: 0x92, hi: 0xba}, {value: 0x3b08, lo: 0xbb, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbf}, // Block 0x13, offset 0xbd {value: 0x0000, lo: 0x0b}, {value: 0x0040, lo: 0x80, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x99}, {value: 0x0008, lo: 0x9a, hi: 0xb1}, {value: 0x0040, lo: 0xb2, hi: 0xb2}, {value: 0x0008, lo: 0xb3, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbf}, // Block 0x14, offset 0xc9 {value: 0x0000, lo: 0x10}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x89}, {value: 0x3b08, lo: 0x8a, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8e}, {value: 0x3008, lo: 0x8f, hi: 0x91}, {value: 0x3308, lo: 0x92, hi: 0x94}, {value: 0x0040, lo: 0x95, hi: 0x95}, {value: 0x3308, lo: 0x96, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x97}, {value: 0x3008, lo: 0x98, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xa5}, {value: 0x0008, lo: 0xa6, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xb1}, {value: 0x3008, lo: 0xb2, hi: 0xb3}, {value: 0x0018, lo: 0xb4, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0x15, offset 0xda {value: 0x0000, lo: 0x09}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0xb0}, {value: 0x3308, lo: 0xb1, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xb2}, {value: 0x08f1, lo: 0xb3, hi: 0xb3}, {value: 0x3308, lo: 0xb4, hi: 0xb9}, {value: 0x3b08, lo: 0xba, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbe}, {value: 0x0018, lo: 0xbf, hi: 0xbf}, // Block 0x16, offset 0xe4 {value: 0x0000, lo: 0x06}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x3308, lo: 0x87, hi: 0x8e}, {value: 0x0018, lo: 0x8f, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0xbf}, // Block 0x17, offset 0xeb {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x84}, {value: 0x0040, lo: 0x85, hi: 0x85}, {value: 0x0008, lo: 0x86, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x87}, {value: 0x3308, lo: 0x88, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9b}, {value: 0x0961, lo: 0x9c, hi: 0x9c}, {value: 0x0999, lo: 0x9d, hi: 0x9d}, {value: 0x0008, lo: 0x9e, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0x18, offset 0xf8 {value: 0x0000, lo: 0x10}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x8a}, {value: 0x0008, lo: 0x8b, hi: 0x8b}, {value: 0xe03d, lo: 0x8c, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0x97}, {value: 0x3308, lo: 0x98, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa9}, {value: 0x0018, lo: 0xaa, hi: 0xb4}, {value: 0x3308, lo: 0xb5, hi: 0xb5}, {value: 0x0018, lo: 0xb6, hi: 0xb6}, {value: 0x3308, lo: 0xb7, hi: 0xb7}, {value: 0x0018, lo: 0xb8, hi: 0xb8}, {value: 0x3308, lo: 0xb9, hi: 0xb9}, {value: 0x0018, lo: 0xba, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbf}, // Block 0x19, offset 0x109 {value: 0x0000, lo: 0x06}, {value: 0x0018, lo: 0x80, hi: 0x85}, {value: 0x3308, lo: 0x86, hi: 0x86}, {value: 0x0018, lo: 0x87, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8d}, {value: 0x0018, lo: 0x8e, hi: 0x9a}, {value: 0x0040, lo: 0x9b, hi: 0xbf}, // Block 0x1a, offset 0x110 {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0xaa}, {value: 0x3008, lo: 0xab, hi: 0xac}, {value: 0x3308, lo: 0xad, hi: 0xb0}, {value: 0x3008, lo: 0xb1, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb7}, {value: 0x3008, lo: 0xb8, hi: 0xb8}, {value: 0x3b08, lo: 0xb9, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbc}, {value: 0x3308, lo: 0xbd, hi: 0xbe}, {value: 0x0008, lo: 0xbf, hi: 0xbf}, // Block 0x1b, offset 0x11b {value: 0x0000, lo: 0x0e}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0018, lo: 0x8a, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x95}, {value: 0x3008, lo: 0x96, hi: 0x97}, {value: 0x3308, lo: 0x98, hi: 0x99}, {value: 0x0008, lo: 0x9a, hi: 0x9d}, {value: 0x3308, lo: 0x9e, hi: 0xa0}, {value: 0x0008, lo: 0xa1, hi: 0xa1}, {value: 0x3008, lo: 0xa2, hi: 0xa4}, {value: 0x0008, lo: 0xa5, hi: 0xa6}, {value: 0x3008, lo: 0xa7, hi: 0xad}, {value: 0x0008, lo: 0xae, hi: 0xb0}, {value: 0x3308, lo: 0xb1, hi: 0xb4}, {value: 0x0008, lo: 0xb5, hi: 0xbf}, // Block 0x1c, offset 0x12a {value: 0x0000, lo: 0x0d}, {value: 0x0008, lo: 0x80, hi: 0x81}, {value: 0x3308, lo: 0x82, hi: 0x82}, {value: 0x3008, lo: 0x83, hi: 0x84}, {value: 0x3308, lo: 0x85, hi: 0x86}, {value: 0x3008, lo: 0x87, hi: 0x8c}, {value: 0x3308, lo: 0x8d, hi: 0x8d}, {value: 0x0008, lo: 0x8e, hi: 0x8e}, {value: 0x3008, lo: 0x8f, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x3008, lo: 0x9a, hi: 0x9c}, {value: 0x3308, lo: 0x9d, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0x1d, offset 0x138 {value: 0x0000, lo: 0x09}, {value: 0x0040, lo: 0x80, hi: 0x86}, {value: 0x055d, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8c}, {value: 0x055d, lo: 0x8d, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xba}, {value: 0x0018, lo: 0xbb, hi: 0xbb}, {value: 0xe105, lo: 0xbc, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbf}, // Block 0x1e, offset 0x142 {value: 0x0000, lo: 0x01}, {value: 0x0018, lo: 0x80, hi: 0xbf}, // Block 0x1f, offset 0x144 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0xa0}, {value: 0x2018, lo: 0xa1, hi: 0xb5}, {value: 0x0018, lo: 0xb6, hi: 0xbf}, // Block 0x20, offset 0x149 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0xa7}, {value: 0x2018, lo: 0xa8, hi: 0xbf}, // Block 0x21, offset 0x14c {value: 0x0000, lo: 0x02}, {value: 0x2018, lo: 0x80, hi: 0x82}, {value: 0x0018, lo: 0x83, hi: 0xbf}, // Block 0x22, offset 0x14f {value: 0x0000, lo: 0x01}, {value: 0x0008, lo: 0x80, hi: 0xbf}, // Block 0x23, offset 0x151 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0008, lo: 0x8a, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0x98}, {value: 0x0040, lo: 0x99, hi: 0x99}, {value: 0x0008, lo: 0x9a, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x24, offset 0x15d {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0008, lo: 0x8a, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xb0}, {value: 0x0040, lo: 0xb1, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb7}, {value: 0x0008, lo: 0xb8, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0x25, offset 0x168 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x0040, lo: 0x81, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0xbf}, // Block 0x26, offset 0x170 {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x91}, {value: 0x0008, lo: 0x92, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0xbf}, // Block 0x27, offset 0x176 {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x9a}, {value: 0x0040, lo: 0x9b, hi: 0x9c}, {value: 0x3308, lo: 0x9d, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbf}, // Block 0x28, offset 0x17c {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x29, offset 0x181 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb7}, {value: 0xe045, lo: 0xb8, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbf}, // Block 0x2a, offset 0x186 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0xbf}, // Block 0x2b, offset 0x189 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xac}, {value: 0x0018, lo: 0xad, hi: 0xae}, {value: 0x0008, lo: 0xaf, hi: 0xbf}, // Block 0x2c, offset 0x18d {value: 0x0000, lo: 0x05}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0x9c}, {value: 0x0040, lo: 0x9d, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x2d, offset 0x193 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xaa}, {value: 0x0018, lo: 0xab, hi: 0xb0}, {value: 0x0008, lo: 0xb1, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbf}, // Block 0x2e, offset 0x198 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8d}, {value: 0x0008, lo: 0x8e, hi: 0x91}, {value: 0x3308, lo: 0x92, hi: 0x93}, {value: 0x3b08, lo: 0x94, hi: 0x94}, {value: 0x0040, lo: 0x95, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb3}, {value: 0x3b08, lo: 0xb4, hi: 0xb4}, {value: 0x0018, lo: 0xb5, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0x2f, offset 0x1a4 {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x91}, {value: 0x3308, lo: 0x92, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xad}, {value: 0x0008, lo: 0xae, hi: 0xb0}, {value: 0x0040, lo: 0xb1, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xbf}, // Block 0x30, offset 0x1ae {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0xb3}, {value: 0x3340, lo: 0xb4, hi: 0xb5}, {value: 0x3008, lo: 0xb6, hi: 0xb6}, {value: 0x3308, lo: 0xb7, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbf}, // Block 0x31, offset 0x1b4 {value: 0x0000, lo: 0x10}, {value: 0x3008, lo: 0x80, hi: 0x85}, {value: 0x3308, lo: 0x86, hi: 0x86}, {value: 0x3008, lo: 0x87, hi: 0x88}, {value: 0x3308, lo: 0x89, hi: 0x91}, {value: 0x3b08, lo: 0x92, hi: 0x92}, {value: 0x3308, lo: 0x93, hi: 0x93}, {value: 0x0018, lo: 0x94, hi: 0x96}, {value: 0x0008, lo: 0x97, hi: 0x97}, {value: 0x0018, lo: 0x98, hi: 0x9b}, {value: 0x0008, lo: 0x9c, hi: 0x9c}, {value: 0x3308, lo: 0x9d, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa9}, {value: 0x0040, lo: 0xaa, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0x32, offset 0x1c5 {value: 0x0000, lo: 0x09}, {value: 0x0018, lo: 0x80, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x86}, {value: 0x0218, lo: 0x87, hi: 0x87}, {value: 0x0018, lo: 0x88, hi: 0x8a}, {value: 0x33c0, lo: 0x8b, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0208, lo: 0xa0, hi: 0xbf}, // Block 0x33, offset 0x1cf {value: 0x0000, lo: 0x02}, {value: 0x0208, lo: 0x80, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbf}, // Block 0x34, offset 0x1d2 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0x84}, {value: 0x3308, lo: 0x85, hi: 0x86}, {value: 0x0208, lo: 0x87, hi: 0xa8}, {value: 0x3308, lo: 0xa9, hi: 0xa9}, {value: 0x0208, lo: 0xaa, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x35, offset 0x1da {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xbf}, // Block 0x36, offset 0x1dd {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x3308, lo: 0xa0, hi: 0xa2}, {value: 0x3008, lo: 0xa3, hi: 0xa6}, {value: 0x3308, lo: 0xa7, hi: 0xa8}, {value: 0x3008, lo: 0xa9, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x3008, lo: 0xb0, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb2}, {value: 0x3008, lo: 0xb3, hi: 0xb8}, {value: 0x3308, lo: 0xb9, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0x37, offset 0x1ea {value: 0x0000, lo: 0x07}, {value: 0x0018, lo: 0x80, hi: 0x80}, {value: 0x0040, lo: 0x81, hi: 0x83}, {value: 0x0018, lo: 0x84, hi: 0x85}, {value: 0x0008, lo: 0x86, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0x38, offset 0x1f2 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x39, offset 0x1f6 {value: 0x0000, lo: 0x06}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0028, lo: 0x9a, hi: 0x9a}, {value: 0x0040, lo: 0x9b, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0xbf}, // Block 0x3a, offset 0x1fd {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0x96}, {value: 0x3308, lo: 0x97, hi: 0x98}, {value: 0x3008, lo: 0x99, hi: 0x9a}, {value: 0x3308, lo: 0x9b, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x3b, offset 0x205 {value: 0x0000, lo: 0x0f}, {value: 0x0008, lo: 0x80, hi: 0x94}, {value: 0x3008, lo: 0x95, hi: 0x95}, {value: 0x3308, lo: 0x96, hi: 0x96}, {value: 0x3008, lo: 0x97, hi: 0x97}, {value: 0x3308, lo: 0x98, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x3b08, lo: 0xa0, hi: 0xa0}, {value: 0x3008, lo: 0xa1, hi: 0xa1}, {value: 0x3308, lo: 0xa2, hi: 0xa2}, {value: 0x3008, lo: 0xa3, hi: 0xa4}, {value: 0x3308, lo: 0xa5, hi: 0xac}, {value: 0x3008, lo: 0xad, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbe}, {value: 0x3308, lo: 0xbf, hi: 0xbf}, // Block 0x3c, offset 0x215 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa6}, {value: 0x0008, lo: 0xa7, hi: 0xa7}, {value: 0x0018, lo: 0xa8, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xbd}, {value: 0x3318, lo: 0xbe, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0x3d, offset 0x221 {value: 0x0000, lo: 0x01}, {value: 0x0040, lo: 0x80, hi: 0xbf}, // Block 0x3e, offset 0x223 {value: 0x0000, lo: 0x09}, {value: 0x3308, lo: 0x80, hi: 0x83}, {value: 0x3008, lo: 0x84, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0xb3}, {value: 0x3308, lo: 0xb4, hi: 0xb4}, {value: 0x3008, lo: 0xb5, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbc}, {value: 0x3008, lo: 0xbd, hi: 0xbf}, // Block 0x3f, offset 0x22d {value: 0x0000, lo: 0x0b}, {value: 0x3008, lo: 0x80, hi: 0x81}, {value: 0x3308, lo: 0x82, hi: 0x82}, {value: 0x3008, lo: 0x83, hi: 0x83}, {value: 0x3808, lo: 0x84, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0xaa}, {value: 0x3308, lo: 0xab, hi: 0xb3}, {value: 0x0018, lo: 0xb4, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbf}, // Block 0x40, offset 0x239 {value: 0x0000, lo: 0x0b}, {value: 0x3308, lo: 0x80, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0xa0}, {value: 0x3008, lo: 0xa1, hi: 0xa1}, {value: 0x3308, lo: 0xa2, hi: 0xa5}, {value: 0x3008, lo: 0xa6, hi: 0xa7}, {value: 0x3308, lo: 0xa8, hi: 0xa9}, {value: 0x3808, lo: 0xaa, hi: 0xaa}, {value: 0x3b08, lo: 0xab, hi: 0xab}, {value: 0x3308, lo: 0xac, hi: 0xad}, {value: 0x0008, lo: 0xae, hi: 0xbf}, // Block 0x41, offset 0x245 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0xa5}, {value: 0x3308, lo: 0xa6, hi: 0xa6}, {value: 0x3008, lo: 0xa7, hi: 0xa7}, {value: 0x3308, lo: 0xa8, hi: 0xa9}, {value: 0x3008, lo: 0xaa, hi: 0xac}, {value: 0x3308, lo: 0xad, hi: 0xad}, {value: 0x3008, lo: 0xae, hi: 0xae}, {value: 0x3308, lo: 0xaf, hi: 0xb1}, {value: 0x3808, lo: 0xb2, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xbb}, {value: 0x0018, lo: 0xbc, hi: 0xbf}, // Block 0x42, offset 0x251 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0xa3}, {value: 0x3008, lo: 0xa4, hi: 0xab}, {value: 0x3308, lo: 0xac, hi: 0xb3}, {value: 0x3008, lo: 0xb4, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xba}, {value: 0x0018, lo: 0xbb, hi: 0xbf}, // Block 0x43, offset 0x259 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0x8c}, {value: 0x0008, lo: 0x8d, hi: 0xbd}, {value: 0x0018, lo: 0xbe, hi: 0xbf}, // Block 0x44, offset 0x25e {value: 0x0000, lo: 0x09}, {value: 0x0e29, lo: 0x80, hi: 0x80}, {value: 0x0e41, lo: 0x81, hi: 0x81}, {value: 0x0e59, lo: 0x82, hi: 0x82}, {value: 0x0e71, lo: 0x83, hi: 0x83}, {value: 0x0e89, lo: 0x84, hi: 0x85}, {value: 0x0ea1, lo: 0x86, hi: 0x86}, {value: 0x0eb9, lo: 0x87, hi: 0x87}, {value: 0x057d, lo: 0x88, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0xbf}, // Block 0x45, offset 0x268 {value: 0x0000, lo: 0x10}, {value: 0x0018, lo: 0x80, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x3308, lo: 0x90, hi: 0x92}, {value: 0x0018, lo: 0x93, hi: 0x93}, {value: 0x3308, lo: 0x94, hi: 0xa0}, {value: 0x3008, lo: 0xa1, hi: 0xa1}, {value: 0x3308, lo: 0xa2, hi: 0xa8}, {value: 0x0008, lo: 0xa9, hi: 0xac}, {value: 0x3308, lo: 0xad, hi: 0xad}, {value: 0x0008, lo: 0xae, hi: 0xb1}, {value: 0x3008, lo: 0xb2, hi: 0xb3}, {value: 0x3308, lo: 0xb4, hi: 0xb4}, {value: 0x0008, lo: 0xb5, hi: 0xb6}, {value: 0x3008, lo: 0xb7, hi: 0xb7}, {value: 0x3308, lo: 0xb8, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0x46, offset 0x279 {value: 0x0000, lo: 0x03}, {value: 0x3308, lo: 0x80, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xba}, {value: 0x3308, lo: 0xbb, hi: 0xbf}, // Block 0x47, offset 0x27d {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x87}, {value: 0xe045, lo: 0x88, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x97}, {value: 0xe045, lo: 0x98, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa7}, {value: 0xe045, lo: 0xa8, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb7}, {value: 0xe045, lo: 0xb8, hi: 0xbf}, // Block 0x48, offset 0x288 {value: 0x0000, lo: 0x03}, {value: 0x0040, lo: 0x80, hi: 0x8f}, {value: 0x3318, lo: 0x90, hi: 0xb0}, {value: 0x0040, lo: 0xb1, hi: 0xbf}, // Block 0x49, offset 0x28c {value: 0x0000, lo: 0x08}, {value: 0x0018, lo: 0x80, hi: 0x82}, {value: 0x0040, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0x84}, {value: 0x0018, lo: 0x85, hi: 0x88}, {value: 0x24c1, lo: 0x89, hi: 0x89}, {value: 0x0018, lo: 0x8a, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xbf}, // Block 0x4a, offset 0x295 {value: 0x0000, lo: 0x07}, {value: 0x0018, lo: 0x80, hi: 0xab}, {value: 0x24f1, lo: 0xac, hi: 0xac}, {value: 0x2529, lo: 0xad, hi: 0xad}, {value: 0x0018, lo: 0xae, hi: 0xae}, {value: 0x2579, lo: 0xaf, hi: 0xaf}, {value: 0x25b1, lo: 0xb0, hi: 0xb0}, {value: 0x0018, lo: 0xb1, hi: 0xbf}, // Block 0x4b, offset 0x29d {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x9f}, {value: 0x0080, lo: 0xa0, hi: 0xa0}, {value: 0x0018, lo: 0xa1, hi: 0xad}, {value: 0x0080, lo: 0xae, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xbf}, // Block 0x4c, offset 0x2a3 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0xa8}, {value: 0x09c5, lo: 0xa9, hi: 0xa9}, {value: 0x09e5, lo: 0xaa, hi: 0xaa}, {value: 0x0018, lo: 0xab, hi: 0xbf}, // Block 0x4d, offset 0x2a8 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xbf}, // Block 0x4e, offset 0x2ab {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0x8b}, {value: 0x28c1, lo: 0x8c, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0xbf}, // Block 0x4f, offset 0x2af {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0xb3}, {value: 0x0e66, lo: 0xb4, hi: 0xb4}, {value: 0x292a, lo: 0xb5, hi: 0xb5}, {value: 0x0e86, lo: 0xb6, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xbf}, // Block 0x50, offset 0x2b5 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0x9b}, {value: 0x2941, lo: 0x9c, hi: 0x9c}, {value: 0x0018, lo: 0x9d, hi: 0xbf}, // Block 0x51, offset 0x2b9 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xb5}, {value: 0x0018, lo: 0xb6, hi: 0xbf}, // Block 0x52, offset 0x2bd {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x97}, {value: 0x0018, lo: 0x98, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbc}, {value: 0x0018, lo: 0xbd, hi: 0xbf}, // Block 0x53, offset 0x2c3 {value: 0x0000, lo: 0x06}, {value: 0x0018, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0018, lo: 0x8a, hi: 0x92}, {value: 0x0040, lo: 0x93, hi: 0xab}, {value: 0x0018, lo: 0xac, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, // Block 0x54, offset 0x2ca {value: 0x0000, lo: 0x05}, {value: 0xe185, lo: 0x80, hi: 0x8f}, {value: 0x03f5, lo: 0x90, hi: 0x9f}, {value: 0x0ea5, lo: 0xa0, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x55, offset 0x2d0 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0xa5}, {value: 0x0040, lo: 0xa6, hi: 0xa6}, {value: 0x0008, lo: 0xa7, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xac}, {value: 0x0008, lo: 0xad, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x56, offset 0x2d8 {value: 0x0000, lo: 0x06}, {value: 0x0008, lo: 0x80, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xae}, {value: 0xe075, lo: 0xaf, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb0}, {value: 0x0040, lo: 0xb1, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0x57, offset 0x2df {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xa7}, {value: 0x0008, lo: 0xa8, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xb7}, {value: 0x0008, lo: 0xb8, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0x58, offset 0x2ea {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x8e}, {value: 0x0040, lo: 0x8f, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x3308, lo: 0xa0, hi: 0xbf}, // Block 0x59, offset 0x2f4 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xae}, {value: 0x0008, lo: 0xaf, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xbf}, // Block 0x5a, offset 0x2f8 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0xbf}, // Block 0x5b, offset 0x2fb {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0x9e}, {value: 0x0edd, lo: 0x9f, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xbf}, // Block 0x5c, offset 0x301 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xb2}, {value: 0x0efd, lo: 0xb3, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xbf}, // Block 0x5d, offset 0x305 {value: 0x0020, lo: 0x01}, {value: 0x0f1d, lo: 0x80, hi: 0xbf}, // Block 0x5e, offset 0x307 {value: 0x0020, lo: 0x02}, {value: 0x171d, lo: 0x80, hi: 0x8f}, {value: 0x18fd, lo: 0x90, hi: 0xbf}, // Block 0x5f, offset 0x30a {value: 0x0020, lo: 0x01}, {value: 0x1efd, lo: 0x80, hi: 0xbf}, // Block 0x60, offset 0x30c {value: 0x0000, lo: 0x02}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0xbf}, // Block 0x61, offset 0x30f {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x98}, {value: 0x3308, lo: 0x99, hi: 0x9a}, {value: 0x29e2, lo: 0x9b, hi: 0x9b}, {value: 0x2a0a, lo: 0x9c, hi: 0x9c}, {value: 0x0008, lo: 0x9d, hi: 0x9e}, {value: 0x2a31, lo: 0x9f, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa0}, {value: 0x0008, lo: 0xa1, hi: 0xbf}, // Block 0x62, offset 0x319 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xbe}, {value: 0x2a69, lo: 0xbf, hi: 0xbf}, // Block 0x63, offset 0x31c {value: 0x0000, lo: 0x0e}, {value: 0x0040, lo: 0x80, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xb0}, {value: 0x2a1d, lo: 0xb1, hi: 0xb1}, {value: 0x2a3d, lo: 0xb2, hi: 0xb2}, {value: 0x2a5d, lo: 0xb3, hi: 0xb3}, {value: 0x2a7d, lo: 0xb4, hi: 0xb4}, {value: 0x2a5d, lo: 0xb5, hi: 0xb5}, {value: 0x2a9d, lo: 0xb6, hi: 0xb6}, {value: 0x2abd, lo: 0xb7, hi: 0xb7}, {value: 0x2add, lo: 0xb8, hi: 0xb9}, {value: 0x2afd, lo: 0xba, hi: 0xbb}, {value: 0x2b1d, lo: 0xbc, hi: 0xbd}, {value: 0x2afd, lo: 0xbe, hi: 0xbf}, // Block 0x64, offset 0x32b {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xa3}, {value: 0x0040, lo: 0xa4, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x65, offset 0x32f {value: 0x0030, lo: 0x04}, {value: 0x2aa2, lo: 0x80, hi: 0x9d}, {value: 0x305a, lo: 0x9e, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x30a2, lo: 0xa0, hi: 0xbf}, // Block 0x66, offset 0x334 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xbf}, // Block 0x67, offset 0x337 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xbf}, // Block 0x68, offset 0x33b {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xbd}, {value: 0x0018, lo: 0xbe, hi: 0xbf}, // Block 0x69, offset 0x340 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xbf}, // Block 0x6a, offset 0x345 {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0xa5}, {value: 0x0018, lo: 0xa6, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb1}, {value: 0x0018, lo: 0xb2, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbf}, // Block 0x6b, offset 0x34b {value: 0x0000, lo: 0x05}, {value: 0x0040, lo: 0x80, hi: 0xb6}, {value: 0x0008, lo: 0xb7, hi: 0xb7}, {value: 0x2009, lo: 0xb8, hi: 0xb8}, {value: 0x6e89, lo: 0xb9, hi: 0xb9}, {value: 0x0008, lo: 0xba, hi: 0xbf}, // Block 0x6c, offset 0x351 {value: 0x0000, lo: 0x0e}, {value: 0x0008, lo: 0x80, hi: 0x81}, {value: 0x3308, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0x85}, {value: 0x3b08, lo: 0x86, hi: 0x86}, {value: 0x0008, lo: 0x87, hi: 0x8a}, {value: 0x3308, lo: 0x8b, hi: 0x8b}, {value: 0x0008, lo: 0x8c, hi: 0xa2}, {value: 0x3008, lo: 0xa3, hi: 0xa4}, {value: 0x3308, lo: 0xa5, hi: 0xa6}, {value: 0x3008, lo: 0xa7, hi: 0xa7}, {value: 0x0018, lo: 0xa8, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0x6d, offset 0x360 {value: 0x0000, lo: 0x05}, {value: 0x0208, lo: 0x80, hi: 0xb1}, {value: 0x0108, lo: 0xb2, hi: 0xb2}, {value: 0x0008, lo: 0xb3, hi: 0xb3}, {value: 0x0018, lo: 0xb4, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbf}, // Block 0x6e, offset 0x366 {value: 0x0000, lo: 0x03}, {value: 0x3008, lo: 0x80, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0xb3}, {value: 0x3008, lo: 0xb4, hi: 0xbf}, // Block 0x6f, offset 0x36a {value: 0x0000, lo: 0x0e}, {value: 0x3008, lo: 0x80, hi: 0x83}, {value: 0x3b08, lo: 0x84, hi: 0x84}, {value: 0x3308, lo: 0x85, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x8d}, {value: 0x0018, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x3308, lo: 0xa0, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xb7}, {value: 0x0018, lo: 0xb8, hi: 0xba}, {value: 0x0008, lo: 0xbb, hi: 0xbb}, {value: 0x0018, lo: 0xbc, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbf}, // Block 0x70, offset 0x379 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xa5}, {value: 0x3308, lo: 0xa6, hi: 0xad}, {value: 0x0018, lo: 0xae, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x71, offset 0x37e {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x3308, lo: 0x87, hi: 0x91}, {value: 0x3008, lo: 0x92, hi: 0x92}, {value: 0x3808, lo: 0x93, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x9e}, {value: 0x0018, lo: 0x9f, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbf}, // Block 0x72, offset 0x386 {value: 0x0000, lo: 0x09}, {value: 0x3308, lo: 0x80, hi: 0x82}, {value: 0x3008, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb3}, {value: 0x3008, lo: 0xb4, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xb9}, {value: 0x3008, lo: 0xba, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbc}, {value: 0x3008, lo: 0xbd, hi: 0xbf}, // Block 0x73, offset 0x390 {value: 0x0000, lo: 0x0a}, {value: 0x3808, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8e}, {value: 0x0008, lo: 0x8f, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa4}, {value: 0x3308, lo: 0xa5, hi: 0xa5}, {value: 0x0008, lo: 0xa6, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0x74, offset 0x39b {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0xa8}, {value: 0x3308, lo: 0xa9, hi: 0xae}, {value: 0x3008, lo: 0xaf, hi: 0xb0}, {value: 0x3308, lo: 0xb1, hi: 0xb2}, {value: 0x3008, lo: 0xb3, hi: 0xb4}, {value: 0x3308, lo: 0xb5, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0x75, offset 0x3a3 {value: 0x0000, lo: 0x10}, {value: 0x0008, lo: 0x80, hi: 0x82}, {value: 0x3308, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0x8b}, {value: 0x3308, lo: 0x8c, hi: 0x8c}, {value: 0x3008, lo: 0x8d, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9b}, {value: 0x0018, lo: 0x9c, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xb9}, {value: 0x0008, lo: 0xba, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbc}, {value: 0x3008, lo: 0xbd, hi: 0xbd}, {value: 0x0008, lo: 0xbe, hi: 0xbf}, // Block 0x76, offset 0x3b4 {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb0}, {value: 0x0008, lo: 0xb1, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb4}, {value: 0x0008, lo: 0xb5, hi: 0xb6}, {value: 0x3308, lo: 0xb7, hi: 0xb8}, {value: 0x0008, lo: 0xb9, hi: 0xbd}, {value: 0x3308, lo: 0xbe, hi: 0xbf}, // Block 0x77, offset 0x3bd {value: 0x0000, lo: 0x0f}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0x82}, {value: 0x0040, lo: 0x83, hi: 0x9a}, {value: 0x0008, lo: 0x9b, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xaa}, {value: 0x3008, lo: 0xab, hi: 0xab}, {value: 0x3308, lo: 0xac, hi: 0xad}, {value: 0x3008, lo: 0xae, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xb4}, {value: 0x3008, lo: 0xb5, hi: 0xb5}, {value: 0x3b08, lo: 0xb6, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0x78, offset 0x3cd {value: 0x0000, lo: 0x0c}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x88}, {value: 0x0008, lo: 0x89, hi: 0x8e}, {value: 0x0040, lo: 0x8f, hi: 0x90}, {value: 0x0008, lo: 0x91, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xa7}, {value: 0x0008, lo: 0xa8, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x79, offset 0x3da {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0x9b}, {value: 0x4465, lo: 0x9c, hi: 0x9c}, {value: 0x447d, lo: 0x9d, hi: 0x9d}, {value: 0x2971, lo: 0x9e, hi: 0x9e}, {value: 0xe06d, lo: 0x9f, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa5}, {value: 0x0040, lo: 0xa6, hi: 0xaf}, {value: 0x4495, lo: 0xb0, hi: 0xbf}, // Block 0x7a, offset 0x3e4 {value: 0x0000, lo: 0x04}, {value: 0x44b5, lo: 0x80, hi: 0x8f}, {value: 0x44d5, lo: 0x90, hi: 0x9f}, {value: 0x44f5, lo: 0xa0, hi: 0xaf}, {value: 0x44d5, lo: 0xb0, hi: 0xbf}, // Block 0x7b, offset 0x3e9 {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0xa2}, {value: 0x3008, lo: 0xa3, hi: 0xa4}, {value: 0x3308, lo: 0xa5, hi: 0xa5}, {value: 0x3008, lo: 0xa6, hi: 0xa7}, {value: 0x3308, lo: 0xa8, hi: 0xa8}, {value: 0x3008, lo: 0xa9, hi: 0xaa}, {value: 0x0018, lo: 0xab, hi: 0xab}, {value: 0x3008, lo: 0xac, hi: 0xac}, {value: 0x3b08, lo: 0xad, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0x7c, offset 0x3f6 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xa3}, {value: 0x0040, lo: 0xa4, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xbf}, // Block 0x7d, offset 0x3fa {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x8a}, {value: 0x0018, lo: 0x8b, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0x7e, offset 0x3ff {value: 0x0020, lo: 0x01}, {value: 0x4515, lo: 0x80, hi: 0xbf}, // Block 0x7f, offset 0x401 {value: 0x0020, lo: 0x03}, {value: 0x4d15, lo: 0x80, hi: 0x94}, {value: 0x4ad5, lo: 0x95, hi: 0x95}, {value: 0x4fb5, lo: 0x96, hi: 0xbf}, // Block 0x80, offset 0x405 {value: 0x0020, lo: 0x01}, {value: 0x54f5, lo: 0x80, hi: 0xbf}, // Block 0x81, offset 0x407 {value: 0x0020, lo: 0x03}, {value: 0x5cf5, lo: 0x80, hi: 0x84}, {value: 0x5655, lo: 0x85, hi: 0x85}, {value: 0x5d95, lo: 0x86, hi: 0xbf}, // Block 0x82, offset 0x40b {value: 0x0020, lo: 0x08}, {value: 0x6b55, lo: 0x80, hi: 0x8f}, {value: 0x6d15, lo: 0x90, hi: 0x90}, {value: 0x6d55, lo: 0x91, hi: 0xab}, {value: 0x6ea1, lo: 0xac, hi: 0xac}, {value: 0x70b5, lo: 0xad, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x70d5, lo: 0xb0, hi: 0xbf}, // Block 0x83, offset 0x414 {value: 0x0020, lo: 0x05}, {value: 0x72d5, lo: 0x80, hi: 0xad}, {value: 0x6535, lo: 0xae, hi: 0xae}, {value: 0x7895, lo: 0xaf, hi: 0xb5}, {value: 0x6f55, lo: 0xb6, hi: 0xb6}, {value: 0x7975, lo: 0xb7, hi: 0xbf}, // Block 0x84, offset 0x41a {value: 0x0028, lo: 0x03}, {value: 0x7c21, lo: 0x80, hi: 0x82}, {value: 0x7be1, lo: 0x83, hi: 0x83}, {value: 0x7c99, lo: 0x84, hi: 0xbf}, // Block 0x85, offset 0x41e {value: 0x0038, lo: 0x0f}, {value: 0x9db1, lo: 0x80, hi: 0x83}, {value: 0x9e59, lo: 0x84, hi: 0x85}, {value: 0x9e91, lo: 0x86, hi: 0x87}, {value: 0x9ec9, lo: 0x88, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x91}, {value: 0xa089, lo: 0x92, hi: 0x97}, {value: 0xa1a1, lo: 0x98, hi: 0x9c}, {value: 0xa281, lo: 0x9d, hi: 0xb3}, {value: 0x9d41, lo: 0xb4, hi: 0xb4}, {value: 0x9db1, lo: 0xb5, hi: 0xb5}, {value: 0xa789, lo: 0xb6, hi: 0xbb}, {value: 0xa869, lo: 0xbc, hi: 0xbc}, {value: 0xa7f9, lo: 0xbd, hi: 0xbd}, {value: 0xa8d9, lo: 0xbe, hi: 0xbf}, // Block 0x86, offset 0x42e {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8c}, {value: 0x0008, lo: 0x8d, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xa7}, {value: 0x0008, lo: 0xa8, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbb}, {value: 0x0008, lo: 0xbc, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbe}, {value: 0x0008, lo: 0xbf, hi: 0xbf}, // Block 0x87, offset 0x438 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0xbf}, // Block 0x88, offset 0x43d {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbf}, // Block 0x89, offset 0x440 {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x82}, {value: 0x0040, lo: 0x83, hi: 0x86}, {value: 0x0018, lo: 0x87, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xbf}, // Block 0x8a, offset 0x446 {value: 0x0000, lo: 0x06}, {value: 0x0018, lo: 0x80, hi: 0x8e}, {value: 0x0040, lo: 0x8f, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa0}, {value: 0x0040, lo: 0xa1, hi: 0xbf}, // Block 0x8b, offset 0x44d {value: 0x0000, lo: 0x04}, {value: 0x0040, lo: 0x80, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xbc}, {value: 0x3308, lo: 0xbd, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbf}, // Block 0x8c, offset 0x452 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0x9c}, {value: 0x0040, lo: 0x9d, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x8d, offset 0x456 {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x9f}, {value: 0x3308, lo: 0xa0, hi: 0xa0}, {value: 0x0018, lo: 0xa1, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0x8e, offset 0x45c {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa3}, {value: 0x0040, lo: 0xa4, hi: 0xac}, {value: 0x0008, lo: 0xad, hi: 0xbf}, // Block 0x8f, offset 0x461 {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0x89}, {value: 0x0018, lo: 0x8a, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbf}, // Block 0x90, offset 0x46a {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9e}, {value: 0x0018, lo: 0x9f, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x91, offset 0x46f {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0xbf}, // Block 0x92, offset 0x475 {value: 0x0000, lo: 0x06}, {value: 0xe145, lo: 0x80, hi: 0x87}, {value: 0xe1c5, lo: 0x88, hi: 0x8f}, {value: 0xe145, lo: 0x90, hi: 0x97}, {value: 0x8ad5, lo: 0x98, hi: 0x9f}, {value: 0x8aed, lo: 0xa0, hi: 0xa7}, {value: 0x0008, lo: 0xa8, hi: 0xbf}, // Block 0x93, offset 0x47c {value: 0x0000, lo: 0x06}, {value: 0x0008, lo: 0x80, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa9}, {value: 0x0040, lo: 0xaa, hi: 0xaf}, {value: 0x8aed, lo: 0xb0, hi: 0xb7}, {value: 0x8ad5, lo: 0xb8, hi: 0xbf}, // Block 0x94, offset 0x483 {value: 0x0000, lo: 0x06}, {value: 0xe145, lo: 0x80, hi: 0x87}, {value: 0xe1c5, lo: 0x88, hi: 0x8f}, {value: 0xe145, lo: 0x90, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0x95, offset 0x48a {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x96, offset 0x48e {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xa3}, {value: 0x0040, lo: 0xa4, hi: 0xae}, {value: 0x0018, lo: 0xaf, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, // Block 0x97, offset 0x493 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0x98, offset 0x496 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xbf}, // Block 0x99, offset 0x49b {value: 0x0000, lo: 0x0b}, {value: 0x0808, lo: 0x80, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x87}, {value: 0x0808, lo: 0x88, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0808, lo: 0x8a, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb6}, {value: 0x0808, lo: 0xb7, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbb}, {value: 0x0808, lo: 0xbc, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbe}, {value: 0x0808, lo: 0xbf, hi: 0xbf}, // Block 0x9a, offset 0x4a7 {value: 0x0000, lo: 0x05}, {value: 0x0808, lo: 0x80, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x96}, {value: 0x0818, lo: 0x97, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xb6}, {value: 0x0818, lo: 0xb7, hi: 0xbf}, // Block 0x9b, offset 0x4ad {value: 0x0000, lo: 0x04}, {value: 0x0808, lo: 0x80, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0xa6}, {value: 0x0818, lo: 0xa7, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, // Block 0x9c, offset 0x4b2 {value: 0x0000, lo: 0x06}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xb3}, {value: 0x0808, lo: 0xb4, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xba}, {value: 0x0818, lo: 0xbb, hi: 0xbf}, // Block 0x9d, offset 0x4b9 {value: 0x0000, lo: 0x07}, {value: 0x0808, lo: 0x80, hi: 0x95}, {value: 0x0818, lo: 0x96, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0x9e}, {value: 0x0018, lo: 0x9f, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbe}, {value: 0x0818, lo: 0xbf, hi: 0xbf}, // Block 0x9e, offset 0x4c1 {value: 0x0000, lo: 0x04}, {value: 0x0808, lo: 0x80, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbb}, {value: 0x0818, lo: 0xbc, hi: 0xbd}, {value: 0x0808, lo: 0xbe, hi: 0xbf}, // Block 0x9f, offset 0x4c6 {value: 0x0000, lo: 0x03}, {value: 0x0818, lo: 0x80, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0x91}, {value: 0x0818, lo: 0x92, hi: 0xbf}, // Block 0xa0, offset 0x4ca {value: 0x0000, lo: 0x0f}, {value: 0x0808, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x84}, {value: 0x3308, lo: 0x85, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x8b}, {value: 0x3308, lo: 0x8c, hi: 0x8f}, {value: 0x0808, lo: 0x90, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x94}, {value: 0x0808, lo: 0x95, hi: 0x97}, {value: 0x0040, lo: 0x98, hi: 0x98}, {value: 0x0808, lo: 0x99, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xb7}, {value: 0x3308, lo: 0xb8, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0xa1, offset 0x4da {value: 0x0000, lo: 0x06}, {value: 0x0818, lo: 0x80, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0818, lo: 0x90, hi: 0x98}, {value: 0x0040, lo: 0x99, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xbc}, {value: 0x0818, lo: 0xbd, hi: 0xbf}, // Block 0xa2, offset 0x4e1 {value: 0x0000, lo: 0x03}, {value: 0x0808, lo: 0x80, hi: 0x9c}, {value: 0x0818, lo: 0x9d, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0xa3, offset 0x4e5 {value: 0x0000, lo: 0x03}, {value: 0x0808, lo: 0x80, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb8}, {value: 0x0018, lo: 0xb9, hi: 0xbf}, // Block 0xa4, offset 0x4e9 {value: 0x0000, lo: 0x06}, {value: 0x0808, lo: 0x80, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x97}, {value: 0x0818, lo: 0x98, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xb7}, {value: 0x0818, lo: 0xb8, hi: 0xbf}, // Block 0xa5, offset 0x4f0 {value: 0x0000, lo: 0x01}, {value: 0x0808, lo: 0x80, hi: 0xbf}, // Block 0xa6, offset 0x4f2 {value: 0x0000, lo: 0x02}, {value: 0x0808, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0xbf}, // Block 0xa7, offset 0x4f5 {value: 0x0000, lo: 0x02}, {value: 0x03dd, lo: 0x80, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xbf}, // Block 0xa8, offset 0x4f8 {value: 0x0000, lo: 0x03}, {value: 0x0808, lo: 0x80, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xb9}, {value: 0x0818, lo: 0xba, hi: 0xbf}, // Block 0xa9, offset 0x4fc {value: 0x0000, lo: 0x03}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0818, lo: 0xa0, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0xaa, offset 0x500 {value: 0x0000, lo: 0x05}, {value: 0x3008, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0xb7}, {value: 0x3308, lo: 0xb8, hi: 0xbf}, // Block 0xab, offset 0x506 {value: 0x0000, lo: 0x08}, {value: 0x3308, lo: 0x80, hi: 0x85}, {value: 0x3b08, lo: 0x86, hi: 0x86}, {value: 0x0018, lo: 0x87, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x91}, {value: 0x0018, lo: 0x92, hi: 0xa5}, {value: 0x0008, lo: 0xa6, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0xac, offset 0x50f {value: 0x0000, lo: 0x0b}, {value: 0x3308, lo: 0x80, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0xaf}, {value: 0x3008, lo: 0xb0, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb6}, {value: 0x3008, lo: 0xb7, hi: 0xb8}, {value: 0x3b08, lo: 0xb9, hi: 0xb9}, {value: 0x3308, lo: 0xba, hi: 0xba}, {value: 0x0018, lo: 0xbb, hi: 0xbc}, {value: 0x0340, lo: 0xbd, hi: 0xbd}, {value: 0x0018, lo: 0xbe, hi: 0xbf}, // Block 0xad, offset 0x51b {value: 0x0000, lo: 0x06}, {value: 0x0018, lo: 0x80, hi: 0x81}, {value: 0x0040, lo: 0x82, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xa8}, {value: 0x0040, lo: 0xa9, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0xae, offset 0x522 {value: 0x0000, lo: 0x08}, {value: 0x3308, lo: 0x80, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0xa6}, {value: 0x3308, lo: 0xa7, hi: 0xab}, {value: 0x3008, lo: 0xac, hi: 0xac}, {value: 0x3308, lo: 0xad, hi: 0xb2}, {value: 0x3b08, lo: 0xb3, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xb5}, {value: 0x0008, lo: 0xb6, hi: 0xbf}, // Block 0xaf, offset 0x52b {value: 0x0000, lo: 0x07}, {value: 0x0018, lo: 0x80, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb3}, {value: 0x0018, lo: 0xb4, hi: 0xb5}, {value: 0x0008, lo: 0xb6, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0xb0, offset 0x533 {value: 0x0000, lo: 0x06}, {value: 0x3308, lo: 0x80, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0xb2}, {value: 0x3008, lo: 0xb3, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xbe}, {value: 0x3008, lo: 0xbf, hi: 0xbf}, // Block 0xb1, offset 0x53a {value: 0x0000, lo: 0x0d}, {value: 0x3808, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0x84}, {value: 0x0018, lo: 0x85, hi: 0x89}, {value: 0x3308, lo: 0x8a, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0x9b}, {value: 0x0008, lo: 0x9c, hi: 0x9c}, {value: 0x0018, lo: 0x9d, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xa0}, {value: 0x0018, lo: 0xa1, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0xb2, offset 0x548 {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x91}, {value: 0x0040, lo: 0x92, hi: 0x92}, {value: 0x0008, lo: 0x93, hi: 0xab}, {value: 0x3008, lo: 0xac, hi: 0xae}, {value: 0x3308, lo: 0xaf, hi: 0xb1}, {value: 0x3008, lo: 0xb2, hi: 0xb3}, {value: 0x3308, lo: 0xb4, hi: 0xb4}, {value: 0x3808, lo: 0xb5, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xb7}, {value: 0x0018, lo: 0xb8, hi: 0xbd}, {value: 0x3308, lo: 0xbe, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0xb3, offset 0x555 {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0008, lo: 0x8a, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8e}, {value: 0x0008, lo: 0x8f, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9e}, {value: 0x0008, lo: 0x9f, hi: 0xa8}, {value: 0x0018, lo: 0xa9, hi: 0xa9}, {value: 0x0040, lo: 0xaa, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0xb4, offset 0x562 {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0x9e}, {value: 0x3308, lo: 0x9f, hi: 0x9f}, {value: 0x3008, lo: 0xa0, hi: 0xa2}, {value: 0x3308, lo: 0xa3, hi: 0xa9}, {value: 0x3b08, lo: 0xaa, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0xb5, offset 0x56b {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xb4}, {value: 0x3008, lo: 0xb5, hi: 0xb7}, {value: 0x3308, lo: 0xb8, hi: 0xbf}, // Block 0xb6, offset 0x56f {value: 0x0000, lo: 0x0d}, {value: 0x3008, lo: 0x80, hi: 0x81}, {value: 0x3b08, lo: 0x82, hi: 0x82}, {value: 0x3308, lo: 0x83, hi: 0x84}, {value: 0x3008, lo: 0x85, hi: 0x85}, {value: 0x3308, lo: 0x86, hi: 0x86}, {value: 0x0008, lo: 0x87, hi: 0x8a}, {value: 0x0018, lo: 0x8b, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0x9c}, {value: 0x0018, lo: 0x9d, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0xbf}, // Block 0xb7, offset 0x57d {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x3008, lo: 0xb0, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb8}, {value: 0x3008, lo: 0xb9, hi: 0xb9}, {value: 0x3308, lo: 0xba, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbe}, {value: 0x3308, lo: 0xbf, hi: 0xbf}, // Block 0xb8, offset 0x585 {value: 0x0000, lo: 0x0a}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x3008, lo: 0x81, hi: 0x81}, {value: 0x3b08, lo: 0x82, hi: 0x82}, {value: 0x3308, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0x85}, {value: 0x0018, lo: 0x86, hi: 0x86}, {value: 0x0008, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0xbf}, // Block 0xb9, offset 0x590 {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0xae}, {value: 0x3008, lo: 0xaf, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb7}, {value: 0x3008, lo: 0xb8, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0xba, offset 0x599 {value: 0x0000, lo: 0x05}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0x9b}, {value: 0x3308, lo: 0x9c, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0xbf}, // Block 0xbb, offset 0x59f {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x3008, lo: 0xb0, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbc}, {value: 0x3308, lo: 0xbd, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0xbc, offset 0x5a7 {value: 0x0000, lo: 0x08}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0x84}, {value: 0x0040, lo: 0x85, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xbf}, // Block 0xbd, offset 0x5b0 {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0xaa}, {value: 0x3308, lo: 0xab, hi: 0xab}, {value: 0x3008, lo: 0xac, hi: 0xac}, {value: 0x3308, lo: 0xad, hi: 0xad}, {value: 0x3008, lo: 0xae, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb5}, {value: 0x3808, lo: 0xb6, hi: 0xb6}, {value: 0x3308, lo: 0xb7, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbf}, // Block 0xbe, offset 0x5ba {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0xbf}, // Block 0xbf, offset 0x5bd {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9c}, {value: 0x3308, lo: 0x9d, hi: 0x9f}, {value: 0x3008, lo: 0xa0, hi: 0xa1}, {value: 0x3308, lo: 0xa2, hi: 0xa5}, {value: 0x3008, lo: 0xa6, hi: 0xa6}, {value: 0x3308, lo: 0xa7, hi: 0xaa}, {value: 0x3b08, lo: 0xab, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb9}, {value: 0x0018, lo: 0xba, hi: 0xbf}, // Block 0xc0, offset 0x5c9 {value: 0x0000, lo: 0x02}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x049d, lo: 0xa0, hi: 0xbf}, // Block 0xc1, offset 0x5cc {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xa9}, {value: 0x0018, lo: 0xaa, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xbe}, {value: 0x0008, lo: 0xbf, hi: 0xbf}, // Block 0xc2, offset 0x5d1 {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x86}, {value: 0x3008, lo: 0x87, hi: 0x88}, {value: 0x3308, lo: 0x89, hi: 0x8a}, {value: 0x0008, lo: 0x8b, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb3}, {value: 0x3b08, lo: 0xb4, hi: 0xb4}, {value: 0x3308, lo: 0xb5, hi: 0xb8}, {value: 0x3008, lo: 0xb9, hi: 0xb9}, {value: 0x0008, lo: 0xba, hi: 0xba}, {value: 0x3308, lo: 0xbb, hi: 0xbe}, {value: 0x0018, lo: 0xbf, hi: 0xbf}, // Block 0xc3, offset 0x5de {value: 0x0000, lo: 0x08}, {value: 0x0018, lo: 0x80, hi: 0x86}, {value: 0x3b08, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x90}, {value: 0x3308, lo: 0x91, hi: 0x96}, {value: 0x3008, lo: 0x97, hi: 0x98}, {value: 0x3308, lo: 0x99, hi: 0x9b}, {value: 0x0008, lo: 0x9c, hi: 0xbf}, // Block 0xc4, offset 0x5e7 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x85}, {value: 0x0008, lo: 0x86, hi: 0x89}, {value: 0x3308, lo: 0x8a, hi: 0x96}, {value: 0x3008, lo: 0x97, hi: 0x97}, {value: 0x3308, lo: 0x98, hi: 0x98}, {value: 0x3b08, lo: 0x99, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0x9c}, {value: 0x0040, lo: 0x9d, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0xa2}, {value: 0x0040, lo: 0xa3, hi: 0xbf}, // Block 0xc5, offset 0x5f3 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbf}, // Block 0xc6, offset 0x5f6 {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0008, lo: 0x8a, hi: 0xae}, {value: 0x3008, lo: 0xaf, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xb7}, {value: 0x3308, lo: 0xb8, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0xc7, offset 0x600 {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xbf}, // Block 0xc8, offset 0x609 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0x91}, {value: 0x3308, lo: 0x92, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xa8}, {value: 0x3008, lo: 0xa9, hi: 0xa9}, {value: 0x3308, lo: 0xaa, hi: 0xb0}, {value: 0x3008, lo: 0xb1, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb3}, {value: 0x3008, lo: 0xb4, hi: 0xb4}, {value: 0x3308, lo: 0xb5, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0xc9, offset 0x615 {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0x8a}, {value: 0x0008, lo: 0x8b, hi: 0xb0}, {value: 0x3308, lo: 0xb1, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xb9}, {value: 0x3308, lo: 0xba, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbe}, {value: 0x3308, lo: 0xbf, hi: 0xbf}, // Block 0xca, offset 0x622 {value: 0x0000, lo: 0x07}, {value: 0x3308, lo: 0x80, hi: 0x83}, {value: 0x3b08, lo: 0x84, hi: 0x85}, {value: 0x0008, lo: 0x86, hi: 0x86}, {value: 0x3308, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0xbf}, // Block 0xcb, offset 0x62a {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0xbf}, // Block 0xcc, offset 0x62d {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0xcd, offset 0x632 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0xbf}, // Block 0xce, offset 0x635 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xbf}, // Block 0xcf, offset 0x638 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0xbf}, // Block 0xd0, offset 0x63b {value: 0x0000, lo: 0x06}, {value: 0x0008, lo: 0x80, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa9}, {value: 0x0040, lo: 0xaa, hi: 0xad}, {value: 0x0018, lo: 0xae, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, // Block 0xd1, offset 0x642 {value: 0x0000, lo: 0x06}, {value: 0x0040, lo: 0x80, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb4}, {value: 0x0018, lo: 0xb5, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xbf}, // Block 0xd2, offset 0x649 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xbf}, // Block 0xd3, offset 0x64d {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x83}, {value: 0x0018, lo: 0x84, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0xa1}, {value: 0x0040, lo: 0xa2, hi: 0xa2}, {value: 0x0008, lo: 0xa3, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbf}, // Block 0xd4, offset 0x658 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0xbf}, // Block 0xd5, offset 0x65b {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x84}, {value: 0x0040, lo: 0x85, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x90}, {value: 0x3008, lo: 0x91, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0xd6, offset 0x661 {value: 0x0000, lo: 0x04}, {value: 0x0040, lo: 0x80, hi: 0x8e}, {value: 0x3308, lo: 0x8f, hi: 0x92}, {value: 0x0008, lo: 0x93, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0xd7, offset 0x666 {value: 0x0000, lo: 0x03}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa1}, {value: 0x0040, lo: 0xa2, hi: 0xbf}, // Block 0xd8, offset 0x66a {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xbf}, // Block 0xd9, offset 0x66d {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xbf}, // Block 0xda, offset 0x670 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0xbf}, // Block 0xdb, offset 0x673 {value: 0x0000, lo: 0x02}, {value: 0x0040, lo: 0x80, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0xdc, offset 0x676 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0xdd, offset 0x679 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbf}, // Block 0xde, offset 0x67e {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9b}, {value: 0x0018, lo: 0x9c, hi: 0x9c}, {value: 0x3308, lo: 0x9d, hi: 0x9e}, {value: 0x0018, lo: 0x9f, hi: 0x9f}, {value: 0x03c0, lo: 0xa0, hi: 0xa3}, {value: 0x0040, lo: 0xa4, hi: 0xbf}, // Block 0xdf, offset 0x688 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xbf}, // Block 0xe0, offset 0x68b {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xa8}, {value: 0x0018, lo: 0xa9, hi: 0xbf}, // Block 0xe1, offset 0x68f {value: 0x0000, lo: 0x0e}, {value: 0x0018, lo: 0x80, hi: 0x9d}, {value: 0xb5b9, lo: 0x9e, hi: 0x9e}, {value: 0xb601, lo: 0x9f, hi: 0x9f}, {value: 0xb649, lo: 0xa0, hi: 0xa0}, {value: 0xb6b1, lo: 0xa1, hi: 0xa1}, {value: 0xb719, lo: 0xa2, hi: 0xa2}, {value: 0xb781, lo: 0xa3, hi: 0xa3}, {value: 0xb7e9, lo: 0xa4, hi: 0xa4}, {value: 0x3018, lo: 0xa5, hi: 0xa6}, {value: 0x3318, lo: 0xa7, hi: 0xa9}, {value: 0x0018, lo: 0xaa, hi: 0xac}, {value: 0x3018, lo: 0xad, hi: 0xb2}, {value: 0x0340, lo: 0xb3, hi: 0xba}, {value: 0x3318, lo: 0xbb, hi: 0xbf}, // Block 0xe2, offset 0x69e {value: 0x0000, lo: 0x0b}, {value: 0x3318, lo: 0x80, hi: 0x82}, {value: 0x0018, lo: 0x83, hi: 0x84}, {value: 0x3318, lo: 0x85, hi: 0x8b}, {value: 0x0018, lo: 0x8c, hi: 0xa9}, {value: 0x3318, lo: 0xaa, hi: 0xad}, {value: 0x0018, lo: 0xae, hi: 0xba}, {value: 0xb851, lo: 0xbb, hi: 0xbb}, {value: 0xb899, lo: 0xbc, hi: 0xbc}, {value: 0xb8e1, lo: 0xbd, hi: 0xbd}, {value: 0xb949, lo: 0xbe, hi: 0xbe}, {value: 0xb9b1, lo: 0xbf, hi: 0xbf}, // Block 0xe3, offset 0x6aa {value: 0x0000, lo: 0x03}, {value: 0xba19, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0xa8}, {value: 0x0040, lo: 0xa9, hi: 0xbf}, // Block 0xe4, offset 0x6ae {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x81}, {value: 0x3318, lo: 0x82, hi: 0x84}, {value: 0x0018, lo: 0x85, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0xbf}, // Block 0xe5, offset 0x6b3 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xb1}, {value: 0x0040, lo: 0xb2, hi: 0xbf}, // Block 0xe6, offset 0x6b8 {value: 0x0000, lo: 0x03}, {value: 0x3308, lo: 0x80, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xba}, {value: 0x3308, lo: 0xbb, hi: 0xbf}, // Block 0xe7, offset 0x6bc {value: 0x0000, lo: 0x04}, {value: 0x3308, lo: 0x80, hi: 0xac}, {value: 0x0018, lo: 0xad, hi: 0xb4}, {value: 0x3308, lo: 0xb5, hi: 0xb5}, {value: 0x0018, lo: 0xb6, hi: 0xbf}, // Block 0xe8, offset 0x6c1 {value: 0x0000, lo: 0x08}, {value: 0x0018, lo: 0x80, hi: 0x83}, {value: 0x3308, lo: 0x84, hi: 0x84}, {value: 0x0018, lo: 0x85, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x9a}, {value: 0x3308, lo: 0x9b, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xa0}, {value: 0x3308, lo: 0xa1, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, // Block 0xe9, offset 0x6ca {value: 0x0000, lo: 0x0a}, {value: 0x3308, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x87}, {value: 0x3308, lo: 0x88, hi: 0x98}, {value: 0x0040, lo: 0x99, hi: 0x9a}, {value: 0x3308, lo: 0x9b, hi: 0xa1}, {value: 0x0040, lo: 0xa2, hi: 0xa2}, {value: 0x3308, lo: 0xa3, hi: 0xa4}, {value: 0x0040, lo: 0xa5, hi: 0xa5}, {value: 0x3308, lo: 0xa6, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xbf}, // Block 0xea, offset 0x6d5 {value: 0x0000, lo: 0x05}, {value: 0x0808, lo: 0x80, hi: 0x84}, {value: 0x0040, lo: 0x85, hi: 0x86}, {value: 0x0818, lo: 0x87, hi: 0x8f}, {value: 0x3308, lo: 0x90, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0xbf}, // Block 0xeb, offset 0x6db {value: 0x0000, lo: 0x07}, {value: 0x0a08, lo: 0x80, hi: 0x83}, {value: 0x3308, lo: 0x84, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8f}, {value: 0x0808, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9d}, {value: 0x0818, lo: 0x9e, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0xec, offset 0x6e3 {value: 0x0000, lo: 0x03}, {value: 0x0040, lo: 0x80, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb1}, {value: 0x0040, lo: 0xb2, hi: 0xbf}, // Block 0xed, offset 0x6e7 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xbf}, // Block 0xee, offset 0x6eb {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xb0}, {value: 0x0018, lo: 0xb1, hi: 0xbf}, // Block 0xef, offset 0x6f1 {value: 0x0000, lo: 0x05}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0x90}, {value: 0x0018, lo: 0x91, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xbf}, // Block 0xf0, offset 0x6f7 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x8f}, {value: 0xc1c1, lo: 0x90, hi: 0x90}, {value: 0x0018, lo: 0x91, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xbf}, // Block 0xf1, offset 0x6fc {value: 0x0000, lo: 0x02}, {value: 0x0040, lo: 0x80, hi: 0xa5}, {value: 0x0018, lo: 0xa6, hi: 0xbf}, // Block 0xf2, offset 0x6ff {value: 0x0000, lo: 0x0f}, {value: 0xc7e9, lo: 0x80, hi: 0x80}, {value: 0xc839, lo: 0x81, hi: 0x81}, {value: 0xc889, lo: 0x82, hi: 0x82}, {value: 0xc8d9, lo: 0x83, hi: 0x83}, {value: 0xc929, lo: 0x84, hi: 0x84}, {value: 0xc979, lo: 0x85, hi: 0x85}, {value: 0xc9c9, lo: 0x86, hi: 0x86}, {value: 0xca19, lo: 0x87, hi: 0x87}, {value: 0xca69, lo: 0x88, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x8f}, {value: 0xcab9, lo: 0x90, hi: 0x90}, {value: 0xcad9, lo: 0x91, hi: 0x91}, {value: 0x0040, lo: 0x92, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa5}, {value: 0x0040, lo: 0xa6, hi: 0xbf}, // Block 0xf3, offset 0x70f {value: 0x0000, lo: 0x06}, {value: 0x0018, lo: 0x80, hi: 0x94}, {value: 0x0040, lo: 0x95, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbf}, // Block 0xf4, offset 0x716 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xbf}, // Block 0xf5, offset 0x719 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0x94}, {value: 0x0040, lo: 0x95, hi: 0xbf}, // Block 0xf6, offset 0x71c {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xbf}, // Block 0xf7, offset 0x720 {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xbf}, // Block 0xf8, offset 0x726 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xbf}, // Block 0xf9, offset 0x72b {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0xfa, offset 0x730 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xbf}, // Block 0xfb, offset 0x735 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0x97}, {value: 0x0040, lo: 0x98, hi: 0xbf}, // Block 0xfc, offset 0x738 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x80}, {value: 0x0040, lo: 0x81, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xbf}, // Block 0xfd, offset 0x73d {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0xbf}, // Block 0xfe, offset 0x740 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0xff, offset 0x743 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x100, offset 0x747 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xa1}, {value: 0x0040, lo: 0xa2, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x101, offset 0x74b {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xa0}, {value: 0x0040, lo: 0xa1, hi: 0xbf}, // Block 0x102, offset 0x74e {value: 0x0020, lo: 0x0f}, {value: 0xdeb9, lo: 0x80, hi: 0x89}, {value: 0x8dfd, lo: 0x8a, hi: 0x8a}, {value: 0xdff9, lo: 0x8b, hi: 0x9c}, {value: 0x8e1d, lo: 0x9d, hi: 0x9d}, {value: 0xe239, lo: 0x9e, hi: 0xa2}, {value: 0x8e3d, lo: 0xa3, hi: 0xa3}, {value: 0xe2d9, lo: 0xa4, hi: 0xab}, {value: 0x7ed5, lo: 0xac, hi: 0xac}, {value: 0xe3d9, lo: 0xad, hi: 0xaf}, {value: 0x8e5d, lo: 0xb0, hi: 0xb0}, {value: 0xe439, lo: 0xb1, hi: 0xb6}, {value: 0x8e7d, lo: 0xb7, hi: 0xb9}, {value: 0xe4f9, lo: 0xba, hi: 0xba}, {value: 0x8edd, lo: 0xbb, hi: 0xbb}, {value: 0xe519, lo: 0xbc, hi: 0xbf}, // Block 0x103, offset 0x75e {value: 0x0020, lo: 0x10}, {value: 0x937d, lo: 0x80, hi: 0x80}, {value: 0xf099, lo: 0x81, hi: 0x86}, {value: 0x939d, lo: 0x87, hi: 0x8a}, {value: 0xd9f9, lo: 0x8b, hi: 0x8b}, {value: 0xf159, lo: 0x8c, hi: 0x96}, {value: 0x941d, lo: 0x97, hi: 0x97}, {value: 0xf2b9, lo: 0x98, hi: 0xa3}, {value: 0x943d, lo: 0xa4, hi: 0xa6}, {value: 0xf439, lo: 0xa7, hi: 0xaa}, {value: 0x949d, lo: 0xab, hi: 0xab}, {value: 0xf4b9, lo: 0xac, hi: 0xac}, {value: 0x94bd, lo: 0xad, hi: 0xad}, {value: 0xf4d9, lo: 0xae, hi: 0xaf}, {value: 0x94dd, lo: 0xb0, hi: 0xb1}, {value: 0xf519, lo: 0xb2, hi: 0xbe}, {value: 0x2040, lo: 0xbf, hi: 0xbf}, // Block 0x104, offset 0x76f {value: 0x0000, lo: 0x04}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0340, lo: 0x81, hi: 0x81}, {value: 0x0040, lo: 0x82, hi: 0x9f}, {value: 0x0340, lo: 0xa0, hi: 0xbf}, // Block 0x105, offset 0x774 {value: 0x0000, lo: 0x01}, {value: 0x0340, lo: 0x80, hi: 0xbf}, // Block 0x106, offset 0x776 {value: 0x0000, lo: 0x01}, {value: 0x33c0, lo: 0x80, hi: 0xbf}, // Block 0x107, offset 0x778 {value: 0x0000, lo: 0x02}, {value: 0x33c0, lo: 0x80, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, } // Total table size 42114 bytes (41KiB); checksum: 355A58A4 ================================================ FILE: vendor/golang.org/x/net/idna/tables11.0.0.go ================================================ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. //go:build go1.13 && !go1.14 package idna // UnicodeVersion is the Unicode version from which the tables in this package are derived. const UnicodeVersion = "11.0.0" var mappings string = "" + // Size: 8175 bytes "\x00\x01 \x03 ̈\x01a\x03 ̄\x012\x013\x03 ́\x03 ̧\x011\x01o\x051⁄4\x051⁄2" + "\x053⁄4\x03i̇\x03l·\x03ʼn\x01s\x03dž\x03ⱥ\x03ⱦ\x01h\x01j\x01r\x01w\x01y" + "\x03 ̆\x03 ̇\x03 ̊\x03 ̨\x03 ̃\x03 ̋\x01l\x01x\x04̈́\x03 ι\x01;\x05 ̈́" + "\x04եւ\x04اٴ\x04وٴ\x04ۇٴ\x04يٴ\x06क़\x06ख़\x06ग़\x06ज़\x06ड़\x06ढ़\x06फ़" + "\x06य़\x06ড়\x06ঢ়\x06য়\x06ਲ਼\x06ਸ਼\x06ਖ਼\x06ਗ਼\x06ਜ਼\x06ਫ਼\x06ଡ଼\x06ଢ଼" + "\x06ํา\x06ໍາ\x06ຫນ\x06ຫມ\x06གྷ\x06ཌྷ\x06དྷ\x06བྷ\x06ཛྷ\x06ཀྵ\x06ཱི\x06ཱུ" + "\x06ྲྀ\x09ྲཱྀ\x06ླྀ\x09ླཱྀ\x06ཱྀ\x06ྒྷ\x06ྜྷ\x06ྡྷ\x06ྦྷ\x06ྫྷ\x06ྐྵ\x02" + "в\x02д\x02о\x02с\x02т\x02ъ\x02ѣ\x02æ\x01b\x01d\x01e\x02ǝ\x01g\x01i\x01k" + "\x01m\x01n\x02ȣ\x01p\x01t\x01u\x02ɐ\x02ɑ\x02ə\x02ɛ\x02ɜ\x02ŋ\x02ɔ\x02ɯ" + "\x01v\x02β\x02γ\x02δ\x02φ\x02χ\x02ρ\x02н\x02ɒ\x01c\x02ɕ\x02ð\x01f\x02ɟ" + "\x02ɡ\x02ɥ\x02ɨ\x02ɩ\x02ɪ\x02ʝ\x02ɭ\x02ʟ\x02ɱ\x02ɰ\x02ɲ\x02ɳ\x02ɴ\x02ɵ" + "\x02ɸ\x02ʂ\x02ʃ\x02ƫ\x02ʉ\x02ʊ\x02ʋ\x02ʌ\x01z\x02ʐ\x02ʑ\x02ʒ\x02θ\x02ss" + "\x02ά\x02έ\x02ή\x02ί\x02ό\x02ύ\x02ώ\x05ἀι\x05ἁι\x05ἂι\x05ἃι\x05ἄι\x05ἅι" + "\x05ἆι\x05ἇι\x05ἠι\x05ἡι\x05ἢι\x05ἣι\x05ἤι\x05ἥι\x05ἦι\x05ἧι\x05ὠι\x05ὡι" + "\x05ὢι\x05ὣι\x05ὤι\x05ὥι\x05ὦι\x05ὧι\x05ὰι\x04αι\x04άι\x05ᾶι\x02ι\x05 ̈͂" + "\x05ὴι\x04ηι\x04ήι\x05ῆι\x05 ̓̀\x05 ̓́\x05 ̓͂\x02ΐ\x05 ̔̀\x05 ̔́\x05 ̔͂" + "\x02ΰ\x05 ̈̀\x01`\x05ὼι\x04ωι\x04ώι\x05ῶι\x06′′\x09′′′\x06‵‵\x09‵‵‵\x02!" + "!\x02??\x02?!\x02!?\x0c′′′′\x010\x014\x015\x016\x017\x018\x019\x01+\x01=" + "\x01(\x01)\x02rs\x02ħ\x02no\x01q\x02sm\x02tm\x02ω\x02å\x02א\x02ב\x02ג" + "\x02ד\x02π\x051⁄7\x051⁄9\x061⁄10\x051⁄3\x052⁄3\x051⁄5\x052⁄5\x053⁄5\x054" + "⁄5\x051⁄6\x055⁄6\x051⁄8\x053⁄8\x055⁄8\x057⁄8\x041⁄\x02ii\x02iv\x02vi" + "\x04viii\x02ix\x02xi\x050⁄3\x06∫∫\x09∫∫∫\x06∮∮\x09∮∮∮\x0210\x0211\x0212" + "\x0213\x0214\x0215\x0216\x0217\x0218\x0219\x0220\x04(10)\x04(11)\x04(12)" + "\x04(13)\x04(14)\x04(15)\x04(16)\x04(17)\x04(18)\x04(19)\x04(20)\x0c∫∫∫∫" + "\x02==\x05⫝̸\x02ɫ\x02ɽ\x02ȿ\x02ɀ\x01.\x04 ゙\x04 ゚\x06より\x06コト\x05(ᄀ)\x05" + "(ᄂ)\x05(ᄃ)\x05(ᄅ)\x05(ᄆ)\x05(ᄇ)\x05(ᄉ)\x05(ᄋ)\x05(ᄌ)\x05(ᄎ)\x05(ᄏ)\x05(ᄐ" + ")\x05(ᄑ)\x05(ᄒ)\x05(가)\x05(나)\x05(다)\x05(라)\x05(마)\x05(바)\x05(사)\x05(아)" + "\x05(자)\x05(차)\x05(카)\x05(타)\x05(파)\x05(하)\x05(주)\x08(오전)\x08(오후)\x05(一)" + "\x05(二)\x05(三)\x05(四)\x05(五)\x05(六)\x05(七)\x05(八)\x05(九)\x05(十)\x05(月)" + "\x05(火)\x05(水)\x05(木)\x05(金)\x05(土)\x05(日)\x05(株)\x05(有)\x05(社)\x05(名)" + "\x05(特)\x05(財)\x05(祝)\x05(労)\x05(代)\x05(呼)\x05(学)\x05(監)\x05(企)\x05(資)" + "\x05(協)\x05(祭)\x05(休)\x05(自)\x05(至)\x0221\x0222\x0223\x0224\x0225\x0226" + "\x0227\x0228\x0229\x0230\x0231\x0232\x0233\x0234\x0235\x06참고\x06주의\x0236" + "\x0237\x0238\x0239\x0240\x0241\x0242\x0243\x0244\x0245\x0246\x0247\x0248" + "\x0249\x0250\x041月\x042月\x043月\x044月\x045月\x046月\x047月\x048月\x049月\x0510" + "月\x0511月\x0512月\x02hg\x02ev\x0cアパート\x0cアルファ\x0cアンペア\x09アール\x0cイニング\x09" + "インチ\x09ウォン\x0fエスクード\x0cエーカー\x09オンス\x09オーム\x09カイリ\x0cカラット\x0cカロリー\x09ガロ" + "ン\x09ガンマ\x06ギガ\x09ギニー\x0cキュリー\x0cギルダー\x06キロ\x0fキログラム\x12キロメートル\x0fキロワッ" + "ト\x09グラム\x0fグラムトン\x0fクルゼイロ\x0cクローネ\x09ケース\x09コルナ\x09コーポ\x0cサイクル\x0fサンチ" + "ーム\x0cシリング\x09センチ\x09セント\x09ダース\x06デシ\x06ドル\x06トン\x06ナノ\x09ノット\x09ハイツ" + "\x0fパーセント\x09パーツ\x0cバーレル\x0fピアストル\x09ピクル\x06ピコ\x06ビル\x0fファラッド\x0cフィート" + "\x0fブッシェル\x09フラン\x0fヘクタール\x06ペソ\x09ペニヒ\x09ヘルツ\x09ペンス\x09ページ\x09ベータ\x0cポイ" + "ント\x09ボルト\x06ホン\x09ポンド\x09ホール\x09ホーン\x0cマイクロ\x09マイル\x09マッハ\x09マルク\x0fマ" + "ンション\x0cミクロン\x06ミリ\x0fミリバール\x06メガ\x0cメガトン\x0cメートル\x09ヤード\x09ヤール\x09ユアン" + "\x0cリットル\x06リラ\x09ルピー\x0cルーブル\x06レム\x0fレントゲン\x09ワット\x040点\x041点\x042点" + "\x043点\x044点\x045点\x046点\x047点\x048点\x049点\x0510点\x0511点\x0512点\x0513点" + "\x0514点\x0515点\x0516点\x0517点\x0518点\x0519点\x0520点\x0521点\x0522点\x0523点" + "\x0524点\x02da\x02au\x02ov\x02pc\x02dm\x02iu\x06平成\x06昭和\x06大正\x06明治\x0c株" + "式会社\x02pa\x02na\x02ma\x02ka\x02kb\x02mb\x02gb\x04kcal\x02pf\x02nf\x02m" + "g\x02kg\x02hz\x02ml\x02dl\x02kl\x02fm\x02nm\x02mm\x02cm\x02km\x02m2\x02m" + "3\x05m∕s\x06m∕s2\x07rad∕s\x08rad∕s2\x02ps\x02ns\x02ms\x02pv\x02nv\x02mv" + "\x02kv\x02pw\x02nw\x02mw\x02kw\x02bq\x02cc\x02cd\x06c∕kg\x02db\x02gy\x02" + "ha\x02hp\x02in\x02kk\x02kt\x02lm\x02ln\x02lx\x02ph\x02pr\x02sr\x02sv\x02" + "wb\x05v∕m\x05a∕m\x041日\x042日\x043日\x044日\x045日\x046日\x047日\x048日\x049日" + "\x0510日\x0511日\x0512日\x0513日\x0514日\x0515日\x0516日\x0517日\x0518日\x0519日" + "\x0520日\x0521日\x0522日\x0523日\x0524日\x0525日\x0526日\x0527日\x0528日\x0529日" + "\x0530日\x0531日\x02ь\x02ɦ\x02ɬ\x02ʞ\x02ʇ\x02œ\x04𤋮\x04𢡊\x04𢡄\x04𣏕\x04𥉉" + "\x04𥳐\x04𧻓\x02ff\x02fi\x02fl\x02st\x04մն\x04մե\x04մի\x04վն\x04մխ\x04יִ" + "\x04ײַ\x02ע\x02ה\x02כ\x02ל\x02ם\x02ר\x02ת\x04שׁ\x04שׂ\x06שּׁ\x06שּׂ\x04א" + "ַ\x04אָ\x04אּ\x04בּ\x04גּ\x04דּ\x04הּ\x04וּ\x04זּ\x04טּ\x04יּ\x04ךּ\x04" + "כּ\x04לּ\x04מּ\x04נּ\x04סּ\x04ףּ\x04פּ\x04צּ\x04קּ\x04רּ\x04שּ\x04תּ" + "\x04וֹ\x04בֿ\x04כֿ\x04פֿ\x04אל\x02ٱ\x02ٻ\x02پ\x02ڀ\x02ٺ\x02ٿ\x02ٹ\x02ڤ" + "\x02ڦ\x02ڄ\x02ڃ\x02چ\x02ڇ\x02ڍ\x02ڌ\x02ڎ\x02ڈ\x02ژ\x02ڑ\x02ک\x02گ\x02ڳ" + "\x02ڱ\x02ں\x02ڻ\x02ۀ\x02ہ\x02ھ\x02ے\x02ۓ\x02ڭ\x02ۇ\x02ۆ\x02ۈ\x02ۋ\x02ۅ" + "\x02ۉ\x02ې\x02ى\x04ئا\x04ئە\x04ئو\x04ئۇ\x04ئۆ\x04ئۈ\x04ئې\x04ئى\x02ی\x04" + "ئج\x04ئح\x04ئم\x04ئي\x04بج\x04بح\x04بخ\x04بم\x04بى\x04بي\x04تج\x04تح" + "\x04تخ\x04تم\x04تى\x04تي\x04ثج\x04ثم\x04ثى\x04ثي\x04جح\x04جم\x04حج\x04حم" + "\x04خج\x04خح\x04خم\x04سج\x04سح\x04سخ\x04سم\x04صح\x04صم\x04ضج\x04ضح\x04ضخ" + "\x04ضم\x04طح\x04طم\x04ظم\x04عج\x04عم\x04غج\x04غم\x04فج\x04فح\x04فخ\x04فم" + "\x04فى\x04في\x04قح\x04قم\x04قى\x04قي\x04كا\x04كج\x04كح\x04كخ\x04كل\x04كم" + "\x04كى\x04كي\x04لج\x04لح\x04لخ\x04لم\x04لى\x04لي\x04مج\x04مح\x04مخ\x04مم" + "\x04مى\x04مي\x04نج\x04نح\x04نخ\x04نم\x04نى\x04ني\x04هج\x04هم\x04هى\x04هي" + "\x04يج\x04يح\x04يخ\x04يم\x04يى\x04يي\x04ذٰ\x04رٰ\x04ىٰ\x05 ٌّ\x05 ٍّ\x05" + " َّ\x05 ُّ\x05 ِّ\x05 ّٰ\x04ئر\x04ئز\x04ئن\x04بر\x04بز\x04بن\x04تر\x04تز" + "\x04تن\x04ثر\x04ثز\x04ثن\x04ما\x04نر\x04نز\x04نن\x04ير\x04يز\x04ين\x04ئخ" + "\x04ئه\x04به\x04ته\x04صخ\x04له\x04نه\x04هٰ\x04يه\x04ثه\x04سه\x04شم\x04شه" + "\x06ـَّ\x06ـُّ\x06ـِّ\x04طى\x04طي\x04عى\x04عي\x04غى\x04غي\x04سى\x04سي" + "\x04شى\x04شي\x04حى\x04حي\x04جى\x04جي\x04خى\x04خي\x04صى\x04صي\x04ضى\x04ضي" + "\x04شج\x04شح\x04شخ\x04شر\x04سر\x04صر\x04ضر\x04اً\x06تجم\x06تحج\x06تحم" + "\x06تخم\x06تمج\x06تمح\x06تمخ\x06جمح\x06حمي\x06حمى\x06سحج\x06سجح\x06سجى" + "\x06سمح\x06سمج\x06سمم\x06صحح\x06صمم\x06شحم\x06شجي\x06شمخ\x06شمم\x06ضحى" + "\x06ضخم\x06طمح\x06طمم\x06طمي\x06عجم\x06عمم\x06عمى\x06غمم\x06غمي\x06غمى" + "\x06فخم\x06قمح\x06قمم\x06لحم\x06لحي\x06لحى\x06لجج\x06لخم\x06لمح\x06محج" + "\x06محم\x06محي\x06مجح\x06مجم\x06مخج\x06مخم\x06مجخ\x06همج\x06همم\x06نحم" + "\x06نحى\x06نجم\x06نجى\x06نمي\x06نمى\x06يمم\x06بخي\x06تجي\x06تجى\x06تخي" + "\x06تخى\x06تمي\x06تمى\x06جمي\x06جحى\x06جمى\x06سخى\x06صحي\x06شحي\x06ضحي" + "\x06لجي\x06لمي\x06يحي\x06يجي\x06يمي\x06ممي\x06قمي\x06نحي\x06عمي\x06كمي" + "\x06نجح\x06مخي\x06لجم\x06كمم\x06جحي\x06حجي\x06مجي\x06فمي\x06بحي\x06سخي" + "\x06نجي\x06صلے\x06قلے\x08الله\x08اكبر\x08محمد\x08صلعم\x08رسول\x08عليه" + "\x08وسلم\x06صلى!صلى الله عليه وسلم\x0fجل جلاله\x08ریال\x01,\x01:\x01!" + "\x01?\x01_\x01{\x01}\x01[\x01]\x01#\x01&\x01*\x01-\x01<\x01>\x01\\\x01$" + "\x01%\x01@\x04ـً\x04ـَ\x04ـُ\x04ـِ\x04ـّ\x04ـْ\x02ء\x02آ\x02أ\x02ؤ\x02إ" + "\x02ئ\x02ا\x02ب\x02ة\x02ت\x02ث\x02ج\x02ح\x02خ\x02د\x02ذ\x02ر\x02ز\x02س" + "\x02ش\x02ص\x02ض\x02ط\x02ظ\x02ع\x02غ\x02ف\x02ق\x02ك\x02ل\x02م\x02ن\x02ه" + "\x02و\x02ي\x04لآ\x04لأ\x04لإ\x04لا\x01\x22\x01'\x01/\x01^\x01|\x01~\x02¢" + "\x02£\x02¬\x02¦\x02¥\x08𝅗𝅥\x08𝅘𝅥\x0c𝅘𝅥𝅮\x0c𝅘𝅥𝅯\x0c𝅘𝅥𝅰\x0c𝅘𝅥𝅱\x0c𝅘𝅥𝅲\x08𝆹" + "𝅥\x08𝆺𝅥\x0c𝆹𝅥𝅮\x0c𝆺𝅥𝅮\x0c𝆹𝅥𝅯\x0c𝆺𝅥𝅯\x02ı\x02ȷ\x02α\x02ε\x02ζ\x02η\x02" + "κ\x02λ\x02μ\x02ν\x02ξ\x02ο\x02σ\x02τ\x02υ\x02ψ\x03∇\x03∂\x02ϝ\x02ٮ\x02ڡ" + "\x02ٯ\x020,\x021,\x022,\x023,\x024,\x025,\x026,\x027,\x028,\x029,\x03(a)" + "\x03(b)\x03(c)\x03(d)\x03(e)\x03(f)\x03(g)\x03(h)\x03(i)\x03(j)\x03(k)" + "\x03(l)\x03(m)\x03(n)\x03(o)\x03(p)\x03(q)\x03(r)\x03(s)\x03(t)\x03(u)" + "\x03(v)\x03(w)\x03(x)\x03(y)\x03(z)\x07〔s〕\x02wz\x02hv\x02sd\x03ppv\x02w" + "c\x02mc\x02md\x02dj\x06ほか\x06ココ\x03サ\x03手\x03字\x03双\x03デ\x03二\x03多\x03解" + "\x03天\x03交\x03映\x03無\x03料\x03前\x03後\x03再\x03新\x03初\x03終\x03生\x03販\x03声" + "\x03吹\x03演\x03投\x03捕\x03一\x03三\x03遊\x03左\x03中\x03右\x03指\x03走\x03打\x03禁" + "\x03空\x03合\x03満\x03有\x03月\x03申\x03割\x03営\x03配\x09〔本〕\x09〔三〕\x09〔二〕\x09〔安" + "〕\x09〔点〕\x09〔打〕\x09〔盗〕\x09〔勝〕\x09〔敗〕\x03得\x03可\x03丽\x03丸\x03乁\x03你\x03" + "侮\x03侻\x03倂\x03偺\x03備\x03僧\x03像\x03㒞\x03免\x03兔\x03兤\x03具\x03㒹\x03內\x03" + "冗\x03冤\x03仌\x03冬\x03况\x03凵\x03刃\x03㓟\x03刻\x03剆\x03剷\x03㔕\x03勇\x03勉\x03" + "勤\x03勺\x03包\x03匆\x03北\x03卉\x03卑\x03博\x03即\x03卽\x03卿\x03灰\x03及\x03叟\x03" + "叫\x03叱\x03吆\x03咞\x03吸\x03呈\x03周\x03咢\x03哶\x03唐\x03啓\x03啣\x03善\x03喙\x03" + "喫\x03喳\x03嗂\x03圖\x03嘆\x03圗\x03噑\x03噴\x03切\x03壮\x03城\x03埴\x03堍\x03型\x03" + "堲\x03報\x03墬\x03売\x03壷\x03夆\x03夢\x03奢\x03姬\x03娛\x03娧\x03姘\x03婦\x03㛮\x03" + "嬈\x03嬾\x03寃\x03寘\x03寧\x03寳\x03寿\x03将\x03尢\x03㞁\x03屠\x03屮\x03峀\x03岍\x03" + "嵃\x03嵮\x03嵫\x03嵼\x03巡\x03巢\x03㠯\x03巽\x03帨\x03帽\x03幩\x03㡢\x03㡼\x03庰\x03" + "庳\x03庶\x03廊\x03廾\x03舁\x03弢\x03㣇\x03形\x03彫\x03㣣\x03徚\x03忍\x03志\x03忹\x03" + "悁\x03㤺\x03㤜\x03悔\x03惇\x03慈\x03慌\x03慎\x03慺\x03憎\x03憲\x03憤\x03憯\x03懞\x03" + "懲\x03懶\x03成\x03戛\x03扝\x03抱\x03拔\x03捐\x03挽\x03拼\x03捨\x03掃\x03揤\x03搢\x03" + "揅\x03掩\x03㨮\x03摩\x03摾\x03撝\x03摷\x03㩬\x03敏\x03敬\x03旣\x03書\x03晉\x03㬙\x03" + "暑\x03㬈\x03㫤\x03冒\x03冕\x03最\x03暜\x03肭\x03䏙\x03朗\x03望\x03朡\x03杞\x03杓\x03" + "㭉\x03柺\x03枅\x03桒\x03梅\x03梎\x03栟\x03椔\x03㮝\x03楂\x03榣\x03槪\x03檨\x03櫛\x03" + "㰘\x03次\x03歔\x03㱎\x03歲\x03殟\x03殺\x03殻\x03汎\x03沿\x03泍\x03汧\x03洖\x03派\x03" + "海\x03流\x03浩\x03浸\x03涅\x03洴\x03港\x03湮\x03㴳\x03滋\x03滇\x03淹\x03潮\x03濆\x03" + "瀹\x03瀞\x03瀛\x03㶖\x03灊\x03災\x03灷\x03炭\x03煅\x03熜\x03爨\x03爵\x03牐\x03犀\x03" + "犕\x03獺\x03王\x03㺬\x03玥\x03㺸\x03瑇\x03瑜\x03瑱\x03璅\x03瓊\x03㼛\x03甤\x03甾\x03" + "異\x03瘐\x03㿼\x03䀈\x03直\x03眞\x03真\x03睊\x03䀹\x03瞋\x03䁆\x03䂖\x03硎\x03碌\x03" + "磌\x03䃣\x03祖\x03福\x03秫\x03䄯\x03穀\x03穊\x03穏\x03䈂\x03篆\x03築\x03䈧\x03糒\x03" + "䊠\x03糨\x03糣\x03紀\x03絣\x03䌁\x03緇\x03縂\x03繅\x03䌴\x03䍙\x03罺\x03羕\x03翺\x03" + "者\x03聠\x03聰\x03䏕\x03育\x03脃\x03䐋\x03脾\x03媵\x03舄\x03辞\x03䑫\x03芑\x03芋\x03" + "芝\x03劳\x03花\x03芳\x03芽\x03苦\x03若\x03茝\x03荣\x03莭\x03茣\x03莽\x03菧\x03著\x03" + "荓\x03菊\x03菌\x03菜\x03䔫\x03蓱\x03蓳\x03蔖\x03蕤\x03䕝\x03䕡\x03䕫\x03虐\x03虜\x03" + "虧\x03虩\x03蚩\x03蚈\x03蜎\x03蛢\x03蝹\x03蜨\x03蝫\x03螆\x03蟡\x03蠁\x03䗹\x03衠\x03" + "衣\x03裗\x03裞\x03䘵\x03裺\x03㒻\x03䚾\x03䛇\x03誠\x03諭\x03變\x03豕\x03貫\x03賁\x03" + "贛\x03起\x03跋\x03趼\x03跰\x03軔\x03輸\x03邔\x03郱\x03鄑\x03鄛\x03鈸\x03鋗\x03鋘\x03" + "鉼\x03鏹\x03鐕\x03開\x03䦕\x03閷\x03䧦\x03雃\x03嶲\x03霣\x03䩮\x03䩶\x03韠\x03䪲\x03" + "頋\x03頩\x03飢\x03䬳\x03餩\x03馧\x03駂\x03駾\x03䯎\x03鬒\x03鱀\x03鳽\x03䳎\x03䳭\x03" + "鵧\x03䳸\x03麻\x03䵖\x03黹\x03黾\x03鼅\x03鼏\x03鼖\x03鼻" var xorData string = "" + // Size: 4855 bytes "\x02\x0c\x09\x02\xb0\xec\x02\xad\xd8\x02\xad\xd9\x02\x06\x07\x02\x0f\x12" + "\x02\x0f\x1f\x02\x0f\x1d\x02\x01\x13\x02\x0f\x16\x02\x0f\x0b\x02\x0f3" + "\x02\x0f7\x02\x0f?\x02\x0f/\x02\x0f*\x02\x0c&\x02\x0c*\x02\x0c;\x02\x0c9" + "\x02\x0c%\x02\xab\xed\x02\xab\xe2\x02\xab\xe3\x02\xa9\xe0\x02\xa9\xe1" + "\x02\xa9\xe6\x02\xa3\xcb\x02\xa3\xc8\x02\xa3\xc9\x02\x01#\x02\x01\x08" + "\x02\x0e>\x02\x0e'\x02\x0f\x03\x02\x03\x0d\x02\x03\x09\x02\x03\x17\x02" + "\x03\x0e\x02\x02\x03\x02\x011\x02\x01\x00\x02\x01\x10\x02\x03<\x02\x07" + "\x0d\x02\x02\x0c\x02\x0c0\x02\x01\x03\x02\x01\x01\x02\x01 \x02\x01\x22" + "\x02\x01)\x02\x01\x0a\x02\x01\x0c\x02\x02\x06\x02\x02\x02\x02\x03\x10" + "\x03\x037 \x03\x0b+\x03\x02\x01\x04\x02\x01\x02\x02\x019\x02\x03\x1c\x02" + "\x02$\x03\x80p$\x02\x03:\x02\x03\x0a\x03\xc1r.\x03\xc1r,\x03\xc1r\x02" + "\x02\x02:\x02\x02>\x02\x02,\x02\x02\x10\x02\x02\x00\x03\xc1s<\x03\xc1s*" + "\x03\xc2L$\x03\xc2L;\x02\x09)\x02\x0a\x19\x03\x83\xab\xe3\x03\x83\xab" + "\xf2\x03 4\xe0\x03\x81\xab\xea\x03\x81\xab\xf3\x03 4\xef\x03\x96\xe1\xcd" + "\x03\x84\xe5\xc3\x02\x0d\x11\x03\x8b\xec\xcb\x03\x94\xec\xcf\x03\x9a\xec" + "\xc2\x03\x8b\xec\xdb\x03\x94\xec\xdf\x03\x9a\xec\xd2\x03\x01\x0c!\x03" + "\x01\x0c#\x03ʠ\x9d\x03ʣ\x9c\x03ʢ\x9f\x03ʥ\x9e\x03ʤ\x91\x03ʧ\x90\x03ʦ\x93" + "\x03ʩ\x92\x03ʨ\x95\x03\xca\xf3\xb5\x03\xca\xf0\xb4\x03\xca\xf1\xb7\x03" + "\xca\xf6\xb6\x03\xca\xf7\x89\x03\xca\xf4\x88\x03\xca\xf5\x8b\x03\xca\xfa" + "\x8a\x03\xca\xfb\x8d\x03\xca\xf8\x8c\x03\xca\xf9\x8f\x03\xca\xfe\x8e\x03" + "\xca\xff\x81\x03\xca\xfc\x80\x03\xca\xfd\x83\x03\xca\xe2\x82\x03\xca\xe3" + "\x85\x03\xca\xe0\x84\x03\xca\xe1\x87\x03\xca\xe6\x86\x03\xca\xe7\x99\x03" + "\xca\xe4\x98\x03\xca\xe5\x9b\x03\xca\xea\x9a\x03\xca\xeb\x9d\x03\xca\xe8" + "\x9c\x03ؓ\x89\x03ߔ\x8b\x02\x010\x03\x03\x04\x1e\x03\x04\x15\x12\x03\x0b" + "\x05,\x03\x06\x04\x00\x03\x06\x04)\x03\x06\x044\x03\x06\x04<\x03\x06\x05" + "\x1d\x03\x06\x06\x00\x03\x06\x06\x0a\x03\x06\x06'\x03\x06\x062\x03\x0786" + "\x03\x079/\x03\x079 \x03\x07:\x0e\x03\x07:\x1b\x03\x07:%\x03\x07;/\x03" + "\x07;%\x03\x074\x11\x03\x076\x09\x03\x077*\x03\x070\x01\x03\x070\x0f\x03" + "\x070.\x03\x071\x16\x03\x071\x04\x03\x0710\x03\x072\x18\x03\x072-\x03" + "\x073\x14\x03\x073>\x03\x07'\x09\x03\x07 \x00\x03\x07\x1f\x0b\x03\x07" + "\x18#\x03\x07\x18(\x03\x07\x186\x03\x07\x18\x03\x03\x07\x19\x16\x03\x07" + "\x116\x03\x07\x12'\x03\x07\x13\x10\x03\x07\x0c&\x03\x07\x0c\x08\x03\x07" + "\x0c\x13\x03\x07\x0d\x02\x03\x07\x0d\x1c\x03\x07\x0b5\x03\x07\x0b\x0a" + "\x03\x07\x0b\x01\x03\x07\x0b\x0f\x03\x07\x05\x00\x03\x07\x05\x09\x03\x07" + "\x05\x0b\x03\x07\x07\x01\x03\x07\x07\x08\x03\x07\x00<\x03\x07\x00+\x03" + "\x07\x01)\x03\x07\x01\x1b\x03\x07\x01\x08\x03\x07\x03?\x03\x0445\x03\x04" + "4\x08\x03\x0454\x03\x04)/\x03\x04)5\x03\x04+\x05\x03\x04+\x14\x03\x04+ " + "\x03\x04+<\x03\x04*&\x03\x04*\x22\x03\x04&8\x03\x04!\x01\x03\x04!\x22" + "\x03\x04\x11+\x03\x04\x10.\x03\x04\x104\x03\x04\x13=\x03\x04\x12\x04\x03" + "\x04\x12\x0a\x03\x04\x0d\x1d\x03\x04\x0d\x07\x03\x04\x0d \x03\x05<>\x03" + "\x055<\x03\x055!\x03\x055#\x03\x055&\x03\x054\x1d\x03\x054\x02\x03\x054" + "\x07\x03\x0571\x03\x053\x1a\x03\x053\x16\x03\x05.<\x03\x05.\x07\x03\x05)" + ":\x03\x05)<\x03\x05)\x0c\x03\x05)\x15\x03\x05+-\x03\x05+5\x03\x05$\x1e" + "\x03\x05$\x14\x03\x05'\x04\x03\x05'\x14\x03\x05&\x02\x03\x05\x226\x03" + "\x05\x22\x0c\x03\x05\x22\x1c\x03\x05\x19\x0a\x03\x05\x1b\x09\x03\x05\x1b" + "\x0c\x03\x05\x14\x07\x03\x05\x16?\x03\x05\x16\x0c\x03\x05\x0c\x05\x03" + "\x05\x0e\x0f\x03\x05\x01\x0e\x03\x05\x00(\x03\x05\x030\x03\x05\x03\x06" + "\x03\x0a==\x03\x0a=1\x03\x0a=,\x03\x0a=\x0c\x03\x0a??\x03\x0a<\x08\x03" + "\x0a9!\x03\x0a9)\x03\x0a97\x03\x0a99\x03\x0a6\x0a\x03\x0a6\x1c\x03\x0a6" + "\x17\x03\x0a7'\x03\x0a78\x03\x0a73\x03\x0a'\x01\x03\x0a'&\x03\x0a\x1f" + "\x0e\x03\x0a\x1f\x03\x03\x0a\x1f3\x03\x0a\x1b/\x03\x0a\x18\x19\x03\x0a" + "\x19\x01\x03\x0a\x16\x14\x03\x0a\x0e\x22\x03\x0a\x0f\x10\x03\x0a\x0f\x02" + "\x03\x0a\x0f \x03\x0a\x0c\x04\x03\x0a\x0b>\x03\x0a\x0b+\x03\x0a\x08/\x03" + "\x0a\x046\x03\x0a\x05\x14\x03\x0a\x00\x04\x03\x0a\x00\x10\x03\x0a\x00" + "\x14\x03\x0b<3\x03\x0b;*\x03\x0b9\x22\x03\x0b9)\x03\x0b97\x03\x0b+\x10" + "\x03\x0b((\x03\x0b&5\x03\x0b$\x1c\x03\x0b$\x12\x03\x0b%\x04\x03\x0b#<" + "\x03\x0b#0\x03\x0b#\x0d\x03\x0b#\x19\x03\x0b!:\x03\x0b!\x1f\x03\x0b!\x00" + "\x03\x0b\x1e5\x03\x0b\x1c\x1d\x03\x0b\x1d-\x03\x0b\x1d(\x03\x0b\x18.\x03" + "\x0b\x18 \x03\x0b\x18\x16\x03\x0b\x14\x13\x03\x0b\x15$\x03\x0b\x15\x22" + "\x03\x0b\x12\x1b\x03\x0b\x12\x10\x03\x0b\x132\x03\x0b\x13=\x03\x0b\x12" + "\x18\x03\x0b\x0c&\x03\x0b\x061\x03\x0b\x06:\x03\x0b\x05#\x03\x0b\x05<" + "\x03\x0b\x04\x0b\x03\x0b\x04\x04\x03\x0b\x04\x1b\x03\x0b\x042\x03\x0b" + "\x041\x03\x0b\x03\x03\x03\x0b\x03\x1d\x03\x0b\x03/\x03\x0b\x03+\x03\x0b" + "\x02\x1b\x03\x0b\x02\x00\x03\x0b\x01\x1e\x03\x0b\x01\x08\x03\x0b\x015" + "\x03\x06\x0d9\x03\x06\x0d=\x03\x06\x0d?\x03\x02\x001\x03\x02\x003\x03" + "\x02\x02\x19\x03\x02\x006\x03\x02\x02\x1b\x03\x02\x004\x03\x02\x00<\x03" + "\x02\x02\x0a\x03\x02\x02\x0e\x03\x02\x01\x1a\x03\x02\x01\x07\x03\x02\x01" + "\x05\x03\x02\x01\x0b\x03\x02\x01%\x03\x02\x01\x0c\x03\x02\x01\x04\x03" + "\x02\x01\x1c\x03\x02\x00.\x03\x02\x002\x03\x02\x00>\x03\x02\x00\x12\x03" + "\x02\x00\x16\x03\x02\x011\x03\x02\x013\x03\x02\x02 \x03\x02\x02%\x03\x02" + "\x02$\x03\x02\x028\x03\x02\x02;\x03\x02\x024\x03\x02\x012\x03\x02\x022" + "\x03\x02\x02/\x03\x02\x01,\x03\x02\x01\x13\x03\x02\x01\x16\x03\x02\x01" + "\x11\x03\x02\x01\x1e\x03\x02\x01\x15\x03\x02\x01\x17\x03\x02\x01\x0f\x03" + "\x02\x01\x08\x03\x02\x00?\x03\x02\x03\x07\x03\x02\x03\x0d\x03\x02\x03" + "\x13\x03\x02\x03\x1d\x03\x02\x03\x1f\x03\x02\x00\x03\x03\x02\x00\x0d\x03" + "\x02\x00\x01\x03\x02\x00\x1b\x03\x02\x00\x19\x03\x02\x00\x18\x03\x02\x00" + "\x13\x03\x02\x00/\x03\x07>\x12\x03\x07<\x1f\x03\x07>\x1d\x03\x06\x1d\x0e" + "\x03\x07>\x1c\x03\x07>:\x03\x07>\x13\x03\x04\x12+\x03\x07?\x03\x03\x07>" + "\x02\x03\x06\x224\x03\x06\x1a.\x03\x07<%\x03\x06\x1c\x0b\x03\x0609\x03" + "\x05\x1f\x01\x03\x04'\x08\x03\x93\xfd\xf5\x03\x02\x0d \x03\x02\x0d#\x03" + "\x02\x0d!\x03\x02\x0d&\x03\x02\x0d\x22\x03\x02\x0d/\x03\x02\x0d,\x03\x02" + "\x0d$\x03\x02\x0d'\x03\x02\x0d%\x03\x02\x0d;\x03\x02\x0d=\x03\x02\x0d?" + "\x03\x099.\x03\x08\x0b7\x03\x08\x02\x14\x03\x08\x14\x0d\x03\x08.:\x03" + "\x089'\x03\x0f\x0b\x18\x03\x0f\x1c1\x03\x0f\x17&\x03\x0f9\x1f\x03\x0f0" + "\x0c\x03\x0e\x0a9\x03\x0e\x056\x03\x0e\x1c#\x03\x0f\x13\x0e\x03\x072\x00" + "\x03\x070\x0d\x03\x072\x0b\x03\x06\x11\x18\x03\x070\x10\x03\x06\x0f(\x03" + "\x072\x05\x03\x06\x0f,\x03\x073\x15\x03\x06\x07\x08\x03\x05\x16\x02\x03" + "\x04\x0b \x03\x05:8\x03\x05\x16%\x03\x0a\x0d\x1f\x03\x06\x16\x10\x03\x05" + "\x1d5\x03\x05*;\x03\x05\x16\x1b\x03\x04.-\x03\x06\x1a\x19\x03\x04\x03," + "\x03\x0b87\x03\x04/\x0a\x03\x06\x00,\x03\x04-\x01\x03\x04\x1e-\x03\x06/(" + "\x03\x0a\x0b5\x03\x06\x0e7\x03\x06\x07.\x03\x0597\x03\x0a*%\x03\x0760" + "\x03\x06\x0c;\x03\x05'\x00\x03\x072.\x03\x072\x08\x03\x06=\x01\x03\x06" + "\x05\x1b\x03\x06\x06\x12\x03\x06$=\x03\x06'\x0d\x03\x04\x11\x0f\x03\x076" + ",\x03\x06\x07;\x03\x06.,\x03\x86\xf9\xea\x03\x8f\xff\xeb\x02\x092\x02" + "\x095\x02\x094\x02\x09;\x02\x09>\x02\x098\x02\x09*\x02\x09/\x02\x09,\x02" + "\x09%\x02\x09&\x02\x09#\x02\x09 \x02\x08!\x02\x08%\x02\x08$\x02\x08+\x02" + "\x08.\x02\x08*\x02\x08&\x02\x088\x02\x08>\x02\x084\x02\x086\x02\x080\x02" + "\x08\x10\x02\x08\x17\x02\x08\x12\x02\x08\x1d\x02\x08\x1f\x02\x08\x13\x02" + "\x08\x15\x02\x08\x14\x02\x08\x0c\x03\x8b\xfd\xd0\x03\x81\xec\xc6\x03\x87" + "\xe0\x8a\x03-2\xe3\x03\x80\xef\xe4\x03-2\xea\x03\x88\xe6\xeb\x03\x8e\xe6" + "\xe8\x03\x84\xe6\xe9\x03\x97\xe6\xee\x03-2\xf9\x03-2\xf6\x03\x8e\xe3\xad" + "\x03\x80\xe3\x92\x03\x88\xe3\x90\x03\x8e\xe3\x90\x03\x80\xe3\x97\x03\x88" + "\xe3\x95\x03\x88\xfe\xcb\x03\x8e\xfe\xca\x03\x84\xfe\xcd\x03\x91\xef\xc9" + "\x03-2\xc1\x03-2\xc0\x03-2\xcb\x03\x88@\x09\x03\x8e@\x08\x03\x8f\xe0\xf5" + "\x03\x8e\xe6\xf9\x03\x8e\xe0\xfa\x03\x93\xff\xf4\x03\x84\xee\xd3\x03\x0b" + "(\x04\x023 \x021;\x02\x01*\x03\x0b#\x10\x03\x0b 0\x03\x0b!\x10\x03\x0b!0" + "\x03\x07\x15\x08\x03\x09?5\x03\x07\x1f\x08\x03\x07\x17\x0b\x03\x09\x1f" + "\x15\x03\x0b\x1c7\x03\x0a+#\x03\x06\x1a\x1b\x03\x06\x1a\x14\x03\x0a\x01" + "\x18\x03\x06#\x1b\x03\x0a2\x0c\x03\x0a\x01\x04\x03\x09#;\x03\x08='\x03" + "\x08\x1a\x0a\x03\x07\x03\x0a\x111\x03\x09\x1b\x09\x03\x073.\x03\x07\x01\x00" + "\x03\x09/,\x03\x07#>\x03\x07\x048\x03\x0a\x1f\x22\x03\x098>\x03\x09\x11" + "\x00\x03\x08/\x17\x03\x06'\x22\x03\x0b\x1a+\x03\x0a\x22\x19\x03\x0a/1" + "\x03\x0974\x03\x09\x0f\x22\x03\x08,\x22\x03\x08?\x14\x03\x07$5\x03\x07<3" + "\x03\x07=*\x03\x07\x13\x18\x03\x068\x0a\x03\x06\x09\x16\x03\x06\x13\x00" + "\x03\x08\x067\x03\x08\x01\x03\x03\x08\x12\x1d\x03\x07+7\x03\x06(;\x03" + "\x06\x1c?\x03\x07\x0e\x17\x03\x0a\x06\x1d\x03\x0a\x19\x07\x03\x08\x14$" + "\x03\x07$;\x03\x08,$\x03\x08\x06\x0d\x03\x07\x16\x0a\x03\x06>>\x03\x0a" + "\x06\x12\x03\x0a\x14)\x03\x09\x0d\x1f\x03\x09\x12\x17\x03\x09\x19\x01" + "\x03\x08\x11 \x03\x08\x1d'\x03\x06<\x1a\x03\x0a.\x00\x03\x07'\x18\x03" + "\x0a\x22\x08\x03\x08\x0d\x0a\x03\x08\x13)\x03\x07*)\x03\x06<,\x03\x07" + "\x0b\x1a\x03\x09.\x14\x03\x09\x0d\x1e\x03\x07\x0e#\x03\x0b\x1d'\x03\x0a" + "\x0a8\x03\x09%2\x03\x08+&\x03\x080\x12\x03\x0a)4\x03\x08\x06\x1f\x03\x0b" + "\x1b\x1a\x03\x0a\x1b\x0f\x03\x0b\x1d*\x03\x09\x16$\x03\x090\x11\x03\x08" + "\x11\x08\x03\x0a*(\x03\x0a\x042\x03\x089,\x03\x074'\x03\x07\x0f\x05\x03" + "\x09\x0b\x0a\x03\x07\x1b\x01\x03\x09\x17:\x03\x09.\x0d\x03\x07.\x11\x03" + "\x09+\x15\x03\x080\x13\x03\x0b\x1f\x19\x03\x0a \x11\x03\x0a\x220\x03\x09" + "\x07;\x03\x08\x16\x1c\x03\x07,\x13\x03\x07\x0e/\x03\x06\x221\x03\x0a." + "\x0a\x03\x0a7\x02\x03\x0a\x032\x03\x0a\x1d.\x03\x091\x06\x03\x09\x19:" + "\x03\x08\x02/\x03\x060+\x03\x06\x0f-\x03\x06\x1c\x1f\x03\x06\x1d\x07\x03" + "\x0a,\x11\x03\x09=\x0d\x03\x09\x0b;\x03\x07\x1b/\x03\x0a\x1f:\x03\x09 " + "\x1f\x03\x09.\x10\x03\x094\x0b\x03\x09\x1a1\x03\x08#\x1a\x03\x084\x1d" + "\x03\x08\x01\x1f\x03\x08\x11\x22\x03\x07'8\x03\x07\x1a>\x03\x0757\x03" + "\x06&9\x03\x06+\x11\x03\x0a.\x0b\x03\x0a,>\x03\x0a4#\x03\x08%\x17\x03" + "\x07\x05\x22\x03\x07\x0c\x0b\x03\x0a\x1d+\x03\x0a\x19\x16\x03\x09+\x1f" + "\x03\x09\x08\x0b\x03\x08\x16\x18\x03\x08+\x12\x03\x0b\x1d\x0c\x03\x0a=" + "\x10\x03\x0a\x09\x0d\x03\x0a\x10\x11\x03\x09&0\x03\x08(\x1f\x03\x087\x07" + "\x03\x08\x185\x03\x07'6\x03\x06.\x05\x03\x06=\x04\x03\x06;;\x03\x06\x06," + "\x03\x0b\x18>\x03\x08\x00\x18\x03\x06 \x03\x03\x06<\x00\x03\x09%\x18\x03" + "\x0b\x1c<\x03\x0a%!\x03\x0a\x09\x12\x03\x0a\x16\x02\x03\x090'\x03\x09" + "\x0e=\x03\x08 \x0e\x03\x08>\x03\x03\x074>\x03\x06&?\x03\x06\x19\x09\x03" + "\x06?(\x03\x0a-\x0e\x03\x09:3\x03\x098:\x03\x09\x12\x0b\x03\x09\x1d\x17" + "\x03\x087\x05\x03\x082\x14\x03\x08\x06%\x03\x08\x13\x1f\x03\x06\x06\x0e" + "\x03\x0a\x22<\x03\x09/<\x03\x06>+\x03\x0a'?\x03\x0a\x13\x0c\x03\x09\x10<" + "\x03\x07\x1b=\x03\x0a\x19\x13\x03\x09\x22\x1d\x03\x09\x07\x0d\x03\x08)" + "\x1c\x03\x06=\x1a\x03\x0a/4\x03\x0a7\x11\x03\x0a\x16:\x03\x09?3\x03\x09:" + "/\x03\x09\x05\x0a\x03\x09\x14\x06\x03\x087\x22\x03\x080\x07\x03\x08\x1a" + "\x1f\x03\x07\x04(\x03\x07\x04\x09\x03\x06 %\x03\x06<\x08\x03\x0a+\x14" + "\x03\x09\x1d\x16\x03\x0a70\x03\x08 >\x03\x0857\x03\x070\x0a\x03\x06=\x12" + "\x03\x06\x16%\x03\x06\x1d,\x03\x099#\x03\x09\x10>\x03\x07 \x1e\x03\x08" + "\x0c<\x03\x08\x0b\x18\x03\x08\x15+\x03\x08,:\x03\x08%\x22\x03\x07\x0a$" + "\x03\x0b\x1c=\x03\x07+\x08\x03\x0a/\x05\x03\x0a \x07\x03\x0a\x12'\x03" + "\x09#\x11\x03\x08\x1b\x15\x03\x0a\x06\x01\x03\x09\x1c\x1b\x03\x0922\x03" + "\x07\x14<\x03\x07\x09\x04\x03\x061\x04\x03\x07\x0e\x01\x03\x0a\x13\x18" + "\x03\x0a-\x0c\x03\x0a?\x0d\x03\x0a\x09\x0a\x03\x091&\x03\x0a/\x0b\x03" + "\x08$<\x03\x083\x1d\x03\x08\x0c$\x03\x08\x0d\x07\x03\x08\x0d?\x03\x08" + "\x0e\x14\x03\x065\x0a\x03\x08\x1a#\x03\x08\x16#\x03\x0702\x03\x07\x03" + "\x1a\x03\x06(\x1d\x03\x06+\x1b\x03\x06\x0b\x05\x03\x06\x0b\x17\x03\x06" + "\x0c\x04\x03\x06\x1e\x19\x03\x06+0\x03\x062\x18\x03\x0b\x16\x1e\x03\x0a+" + "\x16\x03\x0a-?\x03\x0a#:\x03\x0a#\x10\x03\x0a%$\x03\x0a>+\x03\x0a01\x03" + "\x0a1\x10\x03\x0a\x099\x03\x0a\x0a\x12\x03\x0a\x19\x1f\x03\x0a\x19\x12" + "\x03\x09*)\x03\x09-\x16\x03\x09.1\x03\x09.2\x03\x09<\x0e\x03\x09> \x03" + "\x093\x12\x03\x09\x0b\x01\x03\x09\x1c2\x03\x09\x11\x1c\x03\x09\x15%\x03" + "\x08,&\x03\x08!\x22\x03\x089(\x03\x08\x0b\x1a\x03\x08\x0d2\x03\x08\x0c" + "\x04\x03\x08\x0c\x06\x03\x08\x0c\x1f\x03\x08\x0c\x0c\x03\x08\x0f\x1f\x03" + "\x08\x0f\x1d\x03\x08\x00\x14\x03\x08\x03\x14\x03\x08\x06\x16\x03\x08\x1e" + "#\x03\x08\x11\x11\x03\x08\x10\x18\x03\x08\x14(\x03\x07)\x1e\x03\x07.1" + "\x03\x07 $\x03\x07 '\x03\x078\x08\x03\x07\x0d0\x03\x07\x0f7\x03\x07\x05#" + "\x03\x07\x05\x1a\x03\x07\x1a7\x03\x07\x1d-\x03\x07\x17\x10\x03\x06)\x1f" + "\x03\x062\x0b\x03\x066\x16\x03\x06\x09\x11\x03\x09(\x1e\x03\x07!5\x03" + "\x0b\x11\x16\x03\x0a/\x04\x03\x0a,\x1a\x03\x0b\x173\x03\x0a,1\x03\x0a/5" + "\x03\x0a\x221\x03\x0a\x22\x0d\x03\x0a?%\x03\x0a<,\x03\x0a?#\x03\x0a>\x19" + "\x03\x0a\x08&\x03\x0a\x0b\x0e\x03\x0a\x0c:\x03\x0a\x0c+\x03\x0a\x03\x22" + "\x03\x0a\x06)\x03\x0a\x11\x10\x03\x0a\x11\x1a\x03\x0a\x17-\x03\x0a\x14(" + "\x03\x09)\x1e\x03\x09/\x09\x03\x09.\x00\x03\x09,\x07\x03\x09/*\x03\x09-9" + "\x03\x09\x228\x03\x09%\x09\x03\x09:\x12\x03\x09;\x1d\x03\x09?\x06\x03" + "\x093%\x03\x096\x05\x03\x096\x08\x03\x097\x02\x03\x09\x07,\x03\x09\x04," + "\x03\x09\x1f\x16\x03\x09\x11\x03\x03\x09\x11\x12\x03\x09\x168\x03\x08*" + "\x05\x03\x08/2\x03\x084:\x03\x08\x22+\x03\x08 0\x03\x08&\x0a\x03\x08;" + "\x10\x03\x08>$\x03\x08>\x18\x03\x0829\x03\x082:\x03\x081,\x03\x081<\x03" + "\x081\x1c\x03\x087#\x03\x087*\x03\x08\x09'\x03\x08\x00\x1d\x03\x08\x05-" + "\x03\x08\x1f4\x03\x08\x1d\x04\x03\x08\x16\x0f\x03\x07*7\x03\x07'!\x03" + "\x07%\x1b\x03\x077\x0c\x03\x07\x0c1\x03\x07\x0c.\x03\x07\x00\x06\x03\x07" + "\x01\x02\x03\x07\x010\x03\x07\x06=\x03\x07\x01\x03\x03\x07\x01\x13\x03" + "\x07\x06\x06\x03\x07\x05\x0a\x03\x07\x1f\x09\x03\x07\x17:\x03\x06*1\x03" + "\x06-\x1d\x03\x06\x223\x03\x062:\x03\x060$\x03\x066\x1e\x03\x064\x12\x03" + "\x0645\x03\x06\x0b\x00\x03\x06\x0b7\x03\x06\x07\x1f\x03\x06\x15\x12\x03" + "\x0c\x05\x0f\x03\x0b+\x0b\x03\x0b+-\x03\x06\x16\x1b\x03\x06\x15\x17\x03" + "\x89\xca\xea\x03\x89\xca\xe8\x03\x0c8\x10\x03\x0c8\x01\x03\x0c8\x0f\x03" + "\x0d8%\x03\x0d8!\x03\x0c8-\x03\x0c8/\x03\x0c8+\x03\x0c87\x03\x0c85\x03" + "\x0c9\x09\x03\x0c9\x0d\x03\x0c9\x0f\x03\x0c9\x0b\x03\xcfu\x0c\x03\xcfu" + "\x0f\x03\xcfu\x0e\x03\xcfu\x09\x03\x0c9\x10\x03\x0d9\x0c\x03\xcf`;\x03" + "\xcf`>\x03\xcf`9\x03\xcf`8\x03\xcf`7\x03\xcf`*\x03\xcf`-\x03\xcf`,\x03" + "\x0d\x1b\x1a\x03\x0d\x1b&\x03\x0c=.\x03\x0c=%\x03\x0c>\x1e\x03\x0c>\x14" + "\x03\x0c?\x06\x03\x0c?\x0b\x03\x0c?\x0c\x03\x0c?\x0d\x03\x0c?\x02\x03" + "\x0c>\x0f\x03\x0c>\x08\x03\x0c>\x09\x03\x0c>,\x03\x0c>\x0c\x03\x0c?\x13" + "\x03\x0c?\x16\x03\x0c?\x15\x03\x0c?\x1c\x03\x0c?\x1f\x03\x0c?\x1d\x03" + "\x0c?\x1a\x03\x0c?\x17\x03\x0c?\x08\x03\x0c?\x09\x03\x0c?\x0e\x03\x0c?" + "\x04\x03\x0c?\x05\x03\x0c" + "\x03\x0c=2\x03\x0c=6\x03\x0c<\x07\x03\x0c<\x05\x03\x0e:!\x03\x0e:#\x03" + "\x0e8\x09\x03\x0e:&\x03\x0e8\x0b\x03\x0e:$\x03\x0e:,\x03\x0e8\x1a\x03" + "\x0e8\x1e\x03\x0e:*\x03\x0e:7\x03\x0e:5\x03\x0e:;\x03\x0e:\x15\x03\x0e:<" + "\x03\x0e:4\x03\x0e:'\x03\x0e:-\x03\x0e:%\x03\x0e:?\x03\x0e:=\x03\x0e:)" + "\x03\x0e:/\x03\xcfs'\x03\x0d=\x0f\x03\x0d+*\x03\x0d99\x03\x0d9;\x03\x0d9" + "?\x03\x0d)\x0d\x03\x0d(%\x02\x01\x18\x02\x01(\x02\x01\x1e\x03\x0f$!\x03" + "\x0f87\x03\x0f4\x0e\x03\x0f5\x1d\x03\x06'\x03\x03\x0f\x08\x18\x03\x0f" + "\x0d\x1b\x03\x0e2=\x03\x0e;\x08\x03\x0e:\x0b\x03\x0e\x06$\x03\x0e\x0d)" + "\x03\x0e\x16\x1f\x03\x0e\x16\x1b\x03\x0d$\x0a\x03\x05,\x1d\x03\x0d. \x03" + "\x0d.#\x03\x0c(/\x03\x09%\x02\x03\x0d90\x03\x0d\x0e4\x03\x0d\x0d\x0f\x03" + "\x0c#\x00\x03\x0c,\x1e\x03\x0c2\x0e\x03\x0c\x01\x17\x03\x0c\x09:\x03\x0e" + "\x173\x03\x0c\x08\x03\x03\x0c\x11\x07\x03\x0c\x10\x18\x03\x0c\x1f\x1c" + "\x03\x0c\x19\x0e\x03\x0c\x1a\x1f\x03\x0f0>\x03\x0b->\x03\x0b<+\x03\x0b8" + "\x13\x03\x0b\x043\x03\x0b\x14\x03\x03\x0b\x16%\x03\x0d\x22&\x03\x0b\x1a" + "\x1a\x03\x0b\x1a\x04\x03\x0a%9\x03\x0a&2\x03\x0a&0\x03\x0a!\x1a\x03\x0a!" + "7\x03\x0a5\x10\x03\x0a=4\x03\x0a?\x0e\x03\x0a>\x10\x03\x0a\x00 \x03\x0a" + "\x0f:\x03\x0a\x0f9\x03\x0a\x0b\x0a\x03\x0a\x17%\x03\x0a\x1b-\x03\x09-" + "\x1a\x03\x09,4\x03\x09.,\x03\x09)\x09\x03\x096!\x03\x091\x1f\x03\x093" + "\x16\x03\x0c+\x1f\x03\x098 \x03\x098=\x03\x0c(\x1a\x03\x0c(\x16\x03\x09" + "\x0a+\x03\x09\x16\x12\x03\x09\x13\x0e\x03\x09\x153\x03\x08)!\x03\x09\x1a" + "\x01\x03\x09\x18\x01\x03\x08%#\x03\x08>\x22\x03\x08\x05%\x03\x08\x02*" + "\x03\x08\x15;\x03\x08\x1b7\x03\x0f\x07\x1d\x03\x0f\x04\x03\x03\x070\x0c" + "\x03\x07;\x0b\x03\x07\x08\x17\x03\x07\x12\x06\x03\x06/-\x03\x0671\x03" + "\x065+\x03\x06>7\x03\x06\x049\x03\x05+\x1e\x03\x05,\x17\x03\x05 \x1d\x03" + "\x05\x22\x05\x03\x050\x1d" // lookup returns the trie value for the first UTF-8 encoding in s and // the width in bytes of this encoding. The size will be 0 if s does not // hold enough bytes to complete the encoding. len(s) must be greater than 0. func (t *idnaTrie) lookup(s []byte) (v uint16, sz int) { c0 := s[0] switch { case c0 < 0x80: // is ASCII return idnaValues[c0], 1 case c0 < 0xC2: return 0, 1 // Illegal UTF-8: not a starter, not ASCII. case c0 < 0xE0: // 2-byte UTF-8 if len(s) < 2 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c1), 2 case c0 < 0xF0: // 3-byte UTF-8 if len(s) < 3 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = idnaIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c2), 3 case c0 < 0xF8: // 4-byte UTF-8 if len(s) < 4 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = idnaIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } o = uint32(i)<<6 + uint32(c2) i = idnaIndex[o] c3 := s[3] if c3 < 0x80 || 0xC0 <= c3 { return 0, 3 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c3), 4 } // Illegal rune return 0, 1 } // lookupUnsafe returns the trie value for the first UTF-8 encoding in s. // s must start with a full and valid UTF-8 encoded rune. func (t *idnaTrie) lookupUnsafe(s []byte) uint16 { c0 := s[0] if c0 < 0x80 { // is ASCII return idnaValues[c0] } i := idnaIndex[c0] if c0 < 0xE0 { // 2-byte UTF-8 return t.lookupValue(uint32(i), s[1]) } i = idnaIndex[uint32(i)<<6+uint32(s[1])] if c0 < 0xF0 { // 3-byte UTF-8 return t.lookupValue(uint32(i), s[2]) } i = idnaIndex[uint32(i)<<6+uint32(s[2])] if c0 < 0xF8 { // 4-byte UTF-8 return t.lookupValue(uint32(i), s[3]) } return 0 } // lookupString returns the trie value for the first UTF-8 encoding in s and // the width in bytes of this encoding. The size will be 0 if s does not // hold enough bytes to complete the encoding. len(s) must be greater than 0. func (t *idnaTrie) lookupString(s string) (v uint16, sz int) { c0 := s[0] switch { case c0 < 0x80: // is ASCII return idnaValues[c0], 1 case c0 < 0xC2: return 0, 1 // Illegal UTF-8: not a starter, not ASCII. case c0 < 0xE0: // 2-byte UTF-8 if len(s) < 2 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c1), 2 case c0 < 0xF0: // 3-byte UTF-8 if len(s) < 3 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = idnaIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c2), 3 case c0 < 0xF8: // 4-byte UTF-8 if len(s) < 4 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = idnaIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } o = uint32(i)<<6 + uint32(c2) i = idnaIndex[o] c3 := s[3] if c3 < 0x80 || 0xC0 <= c3 { return 0, 3 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c3), 4 } // Illegal rune return 0, 1 } // lookupStringUnsafe returns the trie value for the first UTF-8 encoding in s. // s must start with a full and valid UTF-8 encoded rune. func (t *idnaTrie) lookupStringUnsafe(s string) uint16 { c0 := s[0] if c0 < 0x80 { // is ASCII return idnaValues[c0] } i := idnaIndex[c0] if c0 < 0xE0 { // 2-byte UTF-8 return t.lookupValue(uint32(i), s[1]) } i = idnaIndex[uint32(i)<<6+uint32(s[1])] if c0 < 0xF0 { // 3-byte UTF-8 return t.lookupValue(uint32(i), s[2]) } i = idnaIndex[uint32(i)<<6+uint32(s[2])] if c0 < 0xF8 { // 4-byte UTF-8 return t.lookupValue(uint32(i), s[3]) } return 0 } // idnaTrie. Total size: 29404 bytes (28.71 KiB). Checksum: 848c45acb5f7991c. type idnaTrie struct{} func newIdnaTrie(i int) *idnaTrie { return &idnaTrie{} } // lookupValue determines the type of block n and looks up the value for b. func (t *idnaTrie) lookupValue(n uint32, b byte) uint16 { switch { case n < 125: return uint16(idnaValues[n<<6+uint32(b)]) default: n -= 125 return uint16(idnaSparse.lookup(n, b)) } } // idnaValues: 127 blocks, 8128 entries, 16256 bytes // The third block is the zero block. var idnaValues = [8128]uint16{ // Block 0x0, offset 0x0 0x00: 0x0080, 0x01: 0x0080, 0x02: 0x0080, 0x03: 0x0080, 0x04: 0x0080, 0x05: 0x0080, 0x06: 0x0080, 0x07: 0x0080, 0x08: 0x0080, 0x09: 0x0080, 0x0a: 0x0080, 0x0b: 0x0080, 0x0c: 0x0080, 0x0d: 0x0080, 0x0e: 0x0080, 0x0f: 0x0080, 0x10: 0x0080, 0x11: 0x0080, 0x12: 0x0080, 0x13: 0x0080, 0x14: 0x0080, 0x15: 0x0080, 0x16: 0x0080, 0x17: 0x0080, 0x18: 0x0080, 0x19: 0x0080, 0x1a: 0x0080, 0x1b: 0x0080, 0x1c: 0x0080, 0x1d: 0x0080, 0x1e: 0x0080, 0x1f: 0x0080, 0x20: 0x0080, 0x21: 0x0080, 0x22: 0x0080, 0x23: 0x0080, 0x24: 0x0080, 0x25: 0x0080, 0x26: 0x0080, 0x27: 0x0080, 0x28: 0x0080, 0x29: 0x0080, 0x2a: 0x0080, 0x2b: 0x0080, 0x2c: 0x0080, 0x2d: 0x0008, 0x2e: 0x0008, 0x2f: 0x0080, 0x30: 0x0008, 0x31: 0x0008, 0x32: 0x0008, 0x33: 0x0008, 0x34: 0x0008, 0x35: 0x0008, 0x36: 0x0008, 0x37: 0x0008, 0x38: 0x0008, 0x39: 0x0008, 0x3a: 0x0080, 0x3b: 0x0080, 0x3c: 0x0080, 0x3d: 0x0080, 0x3e: 0x0080, 0x3f: 0x0080, // Block 0x1, offset 0x40 0x40: 0x0080, 0x41: 0xe105, 0x42: 0xe105, 0x43: 0xe105, 0x44: 0xe105, 0x45: 0xe105, 0x46: 0xe105, 0x47: 0xe105, 0x48: 0xe105, 0x49: 0xe105, 0x4a: 0xe105, 0x4b: 0xe105, 0x4c: 0xe105, 0x4d: 0xe105, 0x4e: 0xe105, 0x4f: 0xe105, 0x50: 0xe105, 0x51: 0xe105, 0x52: 0xe105, 0x53: 0xe105, 0x54: 0xe105, 0x55: 0xe105, 0x56: 0xe105, 0x57: 0xe105, 0x58: 0xe105, 0x59: 0xe105, 0x5a: 0xe105, 0x5b: 0x0080, 0x5c: 0x0080, 0x5d: 0x0080, 0x5e: 0x0080, 0x5f: 0x0080, 0x60: 0x0080, 0x61: 0x0008, 0x62: 0x0008, 0x63: 0x0008, 0x64: 0x0008, 0x65: 0x0008, 0x66: 0x0008, 0x67: 0x0008, 0x68: 0x0008, 0x69: 0x0008, 0x6a: 0x0008, 0x6b: 0x0008, 0x6c: 0x0008, 0x6d: 0x0008, 0x6e: 0x0008, 0x6f: 0x0008, 0x70: 0x0008, 0x71: 0x0008, 0x72: 0x0008, 0x73: 0x0008, 0x74: 0x0008, 0x75: 0x0008, 0x76: 0x0008, 0x77: 0x0008, 0x78: 0x0008, 0x79: 0x0008, 0x7a: 0x0008, 0x7b: 0x0080, 0x7c: 0x0080, 0x7d: 0x0080, 0x7e: 0x0080, 0x7f: 0x0080, // Block 0x2, offset 0x80 // Block 0x3, offset 0xc0 0xc0: 0x0040, 0xc1: 0x0040, 0xc2: 0x0040, 0xc3: 0x0040, 0xc4: 0x0040, 0xc5: 0x0040, 0xc6: 0x0040, 0xc7: 0x0040, 0xc8: 0x0040, 0xc9: 0x0040, 0xca: 0x0040, 0xcb: 0x0040, 0xcc: 0x0040, 0xcd: 0x0040, 0xce: 0x0040, 0xcf: 0x0040, 0xd0: 0x0040, 0xd1: 0x0040, 0xd2: 0x0040, 0xd3: 0x0040, 0xd4: 0x0040, 0xd5: 0x0040, 0xd6: 0x0040, 0xd7: 0x0040, 0xd8: 0x0040, 0xd9: 0x0040, 0xda: 0x0040, 0xdb: 0x0040, 0xdc: 0x0040, 0xdd: 0x0040, 0xde: 0x0040, 0xdf: 0x0040, 0xe0: 0x000a, 0xe1: 0x0018, 0xe2: 0x0018, 0xe3: 0x0018, 0xe4: 0x0018, 0xe5: 0x0018, 0xe6: 0x0018, 0xe7: 0x0018, 0xe8: 0x001a, 0xe9: 0x0018, 0xea: 0x0039, 0xeb: 0x0018, 0xec: 0x0018, 0xed: 0x03c0, 0xee: 0x0018, 0xef: 0x004a, 0xf0: 0x0018, 0xf1: 0x0018, 0xf2: 0x0069, 0xf3: 0x0079, 0xf4: 0x008a, 0xf5: 0x0005, 0xf6: 0x0018, 0xf7: 0x0008, 0xf8: 0x00aa, 0xf9: 0x00c9, 0xfa: 0x00d9, 0xfb: 0x0018, 0xfc: 0x00e9, 0xfd: 0x0119, 0xfe: 0x0149, 0xff: 0x0018, // Block 0x4, offset 0x100 0x100: 0xe00d, 0x101: 0x0008, 0x102: 0xe00d, 0x103: 0x0008, 0x104: 0xe00d, 0x105: 0x0008, 0x106: 0xe00d, 0x107: 0x0008, 0x108: 0xe00d, 0x109: 0x0008, 0x10a: 0xe00d, 0x10b: 0x0008, 0x10c: 0xe00d, 0x10d: 0x0008, 0x10e: 0xe00d, 0x10f: 0x0008, 0x110: 0xe00d, 0x111: 0x0008, 0x112: 0xe00d, 0x113: 0x0008, 0x114: 0xe00d, 0x115: 0x0008, 0x116: 0xe00d, 0x117: 0x0008, 0x118: 0xe00d, 0x119: 0x0008, 0x11a: 0xe00d, 0x11b: 0x0008, 0x11c: 0xe00d, 0x11d: 0x0008, 0x11e: 0xe00d, 0x11f: 0x0008, 0x120: 0xe00d, 0x121: 0x0008, 0x122: 0xe00d, 0x123: 0x0008, 0x124: 0xe00d, 0x125: 0x0008, 0x126: 0xe00d, 0x127: 0x0008, 0x128: 0xe00d, 0x129: 0x0008, 0x12a: 0xe00d, 0x12b: 0x0008, 0x12c: 0xe00d, 0x12d: 0x0008, 0x12e: 0xe00d, 0x12f: 0x0008, 0x130: 0x0179, 0x131: 0x0008, 0x132: 0x0035, 0x133: 0x004d, 0x134: 0xe00d, 0x135: 0x0008, 0x136: 0xe00d, 0x137: 0x0008, 0x138: 0x0008, 0x139: 0xe01d, 0x13a: 0x0008, 0x13b: 0xe03d, 0x13c: 0x0008, 0x13d: 0xe01d, 0x13e: 0x0008, 0x13f: 0x0199, // Block 0x5, offset 0x140 0x140: 0x0199, 0x141: 0xe01d, 0x142: 0x0008, 0x143: 0xe03d, 0x144: 0x0008, 0x145: 0xe01d, 0x146: 0x0008, 0x147: 0xe07d, 0x148: 0x0008, 0x149: 0x01b9, 0x14a: 0xe00d, 0x14b: 0x0008, 0x14c: 0xe00d, 0x14d: 0x0008, 0x14e: 0xe00d, 0x14f: 0x0008, 0x150: 0xe00d, 0x151: 0x0008, 0x152: 0xe00d, 0x153: 0x0008, 0x154: 0xe00d, 0x155: 0x0008, 0x156: 0xe00d, 0x157: 0x0008, 0x158: 0xe00d, 0x159: 0x0008, 0x15a: 0xe00d, 0x15b: 0x0008, 0x15c: 0xe00d, 0x15d: 0x0008, 0x15e: 0xe00d, 0x15f: 0x0008, 0x160: 0xe00d, 0x161: 0x0008, 0x162: 0xe00d, 0x163: 0x0008, 0x164: 0xe00d, 0x165: 0x0008, 0x166: 0xe00d, 0x167: 0x0008, 0x168: 0xe00d, 0x169: 0x0008, 0x16a: 0xe00d, 0x16b: 0x0008, 0x16c: 0xe00d, 0x16d: 0x0008, 0x16e: 0xe00d, 0x16f: 0x0008, 0x170: 0xe00d, 0x171: 0x0008, 0x172: 0xe00d, 0x173: 0x0008, 0x174: 0xe00d, 0x175: 0x0008, 0x176: 0xe00d, 0x177: 0x0008, 0x178: 0x0065, 0x179: 0xe01d, 0x17a: 0x0008, 0x17b: 0xe03d, 0x17c: 0x0008, 0x17d: 0xe01d, 0x17e: 0x0008, 0x17f: 0x01d9, // Block 0x6, offset 0x180 0x180: 0x0008, 0x181: 0x007d, 0x182: 0xe00d, 0x183: 0x0008, 0x184: 0xe00d, 0x185: 0x0008, 0x186: 0x007d, 0x187: 0xe07d, 0x188: 0x0008, 0x189: 0x0095, 0x18a: 0x00ad, 0x18b: 0xe03d, 0x18c: 0x0008, 0x18d: 0x0008, 0x18e: 0x00c5, 0x18f: 0x00dd, 0x190: 0x00f5, 0x191: 0xe01d, 0x192: 0x0008, 0x193: 0x010d, 0x194: 0x0125, 0x195: 0x0008, 0x196: 0x013d, 0x197: 0x013d, 0x198: 0xe00d, 0x199: 0x0008, 0x19a: 0x0008, 0x19b: 0x0008, 0x19c: 0x010d, 0x19d: 0x0155, 0x19e: 0x0008, 0x19f: 0x016d, 0x1a0: 0xe00d, 0x1a1: 0x0008, 0x1a2: 0xe00d, 0x1a3: 0x0008, 0x1a4: 0xe00d, 0x1a5: 0x0008, 0x1a6: 0x0185, 0x1a7: 0xe07d, 0x1a8: 0x0008, 0x1a9: 0x019d, 0x1aa: 0x0008, 0x1ab: 0x0008, 0x1ac: 0xe00d, 0x1ad: 0x0008, 0x1ae: 0x0185, 0x1af: 0xe0fd, 0x1b0: 0x0008, 0x1b1: 0x01b5, 0x1b2: 0x01cd, 0x1b3: 0xe03d, 0x1b4: 0x0008, 0x1b5: 0xe01d, 0x1b6: 0x0008, 0x1b7: 0x01e5, 0x1b8: 0xe00d, 0x1b9: 0x0008, 0x1ba: 0x0008, 0x1bb: 0x0008, 0x1bc: 0xe00d, 0x1bd: 0x0008, 0x1be: 0x0008, 0x1bf: 0x0008, // Block 0x7, offset 0x1c0 0x1c0: 0x0008, 0x1c1: 0x0008, 0x1c2: 0x0008, 0x1c3: 0x0008, 0x1c4: 0x01e9, 0x1c5: 0x01e9, 0x1c6: 0x01e9, 0x1c7: 0x01fd, 0x1c8: 0x0215, 0x1c9: 0x022d, 0x1ca: 0x0245, 0x1cb: 0x025d, 0x1cc: 0x0275, 0x1cd: 0xe01d, 0x1ce: 0x0008, 0x1cf: 0xe0fd, 0x1d0: 0x0008, 0x1d1: 0xe01d, 0x1d2: 0x0008, 0x1d3: 0xe03d, 0x1d4: 0x0008, 0x1d5: 0xe01d, 0x1d6: 0x0008, 0x1d7: 0xe07d, 0x1d8: 0x0008, 0x1d9: 0xe01d, 0x1da: 0x0008, 0x1db: 0xe03d, 0x1dc: 0x0008, 0x1dd: 0x0008, 0x1de: 0xe00d, 0x1df: 0x0008, 0x1e0: 0xe00d, 0x1e1: 0x0008, 0x1e2: 0xe00d, 0x1e3: 0x0008, 0x1e4: 0xe00d, 0x1e5: 0x0008, 0x1e6: 0xe00d, 0x1e7: 0x0008, 0x1e8: 0xe00d, 0x1e9: 0x0008, 0x1ea: 0xe00d, 0x1eb: 0x0008, 0x1ec: 0xe00d, 0x1ed: 0x0008, 0x1ee: 0xe00d, 0x1ef: 0x0008, 0x1f0: 0x0008, 0x1f1: 0x028d, 0x1f2: 0x02a5, 0x1f3: 0x02bd, 0x1f4: 0xe00d, 0x1f5: 0x0008, 0x1f6: 0x02d5, 0x1f7: 0x02ed, 0x1f8: 0xe00d, 0x1f9: 0x0008, 0x1fa: 0xe00d, 0x1fb: 0x0008, 0x1fc: 0xe00d, 0x1fd: 0x0008, 0x1fe: 0xe00d, 0x1ff: 0x0008, // Block 0x8, offset 0x200 0x200: 0xe00d, 0x201: 0x0008, 0x202: 0xe00d, 0x203: 0x0008, 0x204: 0xe00d, 0x205: 0x0008, 0x206: 0xe00d, 0x207: 0x0008, 0x208: 0xe00d, 0x209: 0x0008, 0x20a: 0xe00d, 0x20b: 0x0008, 0x20c: 0xe00d, 0x20d: 0x0008, 0x20e: 0xe00d, 0x20f: 0x0008, 0x210: 0xe00d, 0x211: 0x0008, 0x212: 0xe00d, 0x213: 0x0008, 0x214: 0xe00d, 0x215: 0x0008, 0x216: 0xe00d, 0x217: 0x0008, 0x218: 0xe00d, 0x219: 0x0008, 0x21a: 0xe00d, 0x21b: 0x0008, 0x21c: 0xe00d, 0x21d: 0x0008, 0x21e: 0xe00d, 0x21f: 0x0008, 0x220: 0x0305, 0x221: 0x0008, 0x222: 0xe00d, 0x223: 0x0008, 0x224: 0xe00d, 0x225: 0x0008, 0x226: 0xe00d, 0x227: 0x0008, 0x228: 0xe00d, 0x229: 0x0008, 0x22a: 0xe00d, 0x22b: 0x0008, 0x22c: 0xe00d, 0x22d: 0x0008, 0x22e: 0xe00d, 0x22f: 0x0008, 0x230: 0xe00d, 0x231: 0x0008, 0x232: 0xe00d, 0x233: 0x0008, 0x234: 0x0008, 0x235: 0x0008, 0x236: 0x0008, 0x237: 0x0008, 0x238: 0x0008, 0x239: 0x0008, 0x23a: 0x0209, 0x23b: 0xe03d, 0x23c: 0x0008, 0x23d: 0x031d, 0x23e: 0x0229, 0x23f: 0x0008, // Block 0x9, offset 0x240 0x240: 0x0008, 0x241: 0x0008, 0x242: 0x0018, 0x243: 0x0018, 0x244: 0x0018, 0x245: 0x0018, 0x246: 0x0008, 0x247: 0x0008, 0x248: 0x0008, 0x249: 0x0008, 0x24a: 0x0008, 0x24b: 0x0008, 0x24c: 0x0008, 0x24d: 0x0008, 0x24e: 0x0008, 0x24f: 0x0008, 0x250: 0x0008, 0x251: 0x0008, 0x252: 0x0018, 0x253: 0x0018, 0x254: 0x0018, 0x255: 0x0018, 0x256: 0x0018, 0x257: 0x0018, 0x258: 0x029a, 0x259: 0x02ba, 0x25a: 0x02da, 0x25b: 0x02fa, 0x25c: 0x031a, 0x25d: 0x033a, 0x25e: 0x0018, 0x25f: 0x0018, 0x260: 0x03ad, 0x261: 0x0359, 0x262: 0x01d9, 0x263: 0x0369, 0x264: 0x03c5, 0x265: 0x0018, 0x266: 0x0018, 0x267: 0x0018, 0x268: 0x0018, 0x269: 0x0018, 0x26a: 0x0018, 0x26b: 0x0018, 0x26c: 0x0008, 0x26d: 0x0018, 0x26e: 0x0008, 0x26f: 0x0018, 0x270: 0x0018, 0x271: 0x0018, 0x272: 0x0018, 0x273: 0x0018, 0x274: 0x0018, 0x275: 0x0018, 0x276: 0x0018, 0x277: 0x0018, 0x278: 0x0018, 0x279: 0x0018, 0x27a: 0x0018, 0x27b: 0x0018, 0x27c: 0x0018, 0x27d: 0x0018, 0x27e: 0x0018, 0x27f: 0x0018, // Block 0xa, offset 0x280 0x280: 0x03dd, 0x281: 0x03dd, 0x282: 0x3308, 0x283: 0x03f5, 0x284: 0x0379, 0x285: 0x040d, 0x286: 0x3308, 0x287: 0x3308, 0x288: 0x3308, 0x289: 0x3308, 0x28a: 0x3308, 0x28b: 0x3308, 0x28c: 0x3308, 0x28d: 0x3308, 0x28e: 0x3308, 0x28f: 0x33c0, 0x290: 0x3308, 0x291: 0x3308, 0x292: 0x3308, 0x293: 0x3308, 0x294: 0x3308, 0x295: 0x3308, 0x296: 0x3308, 0x297: 0x3308, 0x298: 0x3308, 0x299: 0x3308, 0x29a: 0x3308, 0x29b: 0x3308, 0x29c: 0x3308, 0x29d: 0x3308, 0x29e: 0x3308, 0x29f: 0x3308, 0x2a0: 0x3308, 0x2a1: 0x3308, 0x2a2: 0x3308, 0x2a3: 0x3308, 0x2a4: 0x3308, 0x2a5: 0x3308, 0x2a6: 0x3308, 0x2a7: 0x3308, 0x2a8: 0x3308, 0x2a9: 0x3308, 0x2aa: 0x3308, 0x2ab: 0x3308, 0x2ac: 0x3308, 0x2ad: 0x3308, 0x2ae: 0x3308, 0x2af: 0x3308, 0x2b0: 0xe00d, 0x2b1: 0x0008, 0x2b2: 0xe00d, 0x2b3: 0x0008, 0x2b4: 0x0425, 0x2b5: 0x0008, 0x2b6: 0xe00d, 0x2b7: 0x0008, 0x2b8: 0x0040, 0x2b9: 0x0040, 0x2ba: 0x03a2, 0x2bb: 0x0008, 0x2bc: 0x0008, 0x2bd: 0x0008, 0x2be: 0x03c2, 0x2bf: 0x043d, // Block 0xb, offset 0x2c0 0x2c0: 0x0040, 0x2c1: 0x0040, 0x2c2: 0x0040, 0x2c3: 0x0040, 0x2c4: 0x008a, 0x2c5: 0x03d2, 0x2c6: 0xe155, 0x2c7: 0x0455, 0x2c8: 0xe12d, 0x2c9: 0xe13d, 0x2ca: 0xe12d, 0x2cb: 0x0040, 0x2cc: 0x03dd, 0x2cd: 0x0040, 0x2ce: 0x046d, 0x2cf: 0x0485, 0x2d0: 0x0008, 0x2d1: 0xe105, 0x2d2: 0xe105, 0x2d3: 0xe105, 0x2d4: 0xe105, 0x2d5: 0xe105, 0x2d6: 0xe105, 0x2d7: 0xe105, 0x2d8: 0xe105, 0x2d9: 0xe105, 0x2da: 0xe105, 0x2db: 0xe105, 0x2dc: 0xe105, 0x2dd: 0xe105, 0x2de: 0xe105, 0x2df: 0xe105, 0x2e0: 0x049d, 0x2e1: 0x049d, 0x2e2: 0x0040, 0x2e3: 0x049d, 0x2e4: 0x049d, 0x2e5: 0x049d, 0x2e6: 0x049d, 0x2e7: 0x049d, 0x2e8: 0x049d, 0x2e9: 0x049d, 0x2ea: 0x049d, 0x2eb: 0x049d, 0x2ec: 0x0008, 0x2ed: 0x0008, 0x2ee: 0x0008, 0x2ef: 0x0008, 0x2f0: 0x0008, 0x2f1: 0x0008, 0x2f2: 0x0008, 0x2f3: 0x0008, 0x2f4: 0x0008, 0x2f5: 0x0008, 0x2f6: 0x0008, 0x2f7: 0x0008, 0x2f8: 0x0008, 0x2f9: 0x0008, 0x2fa: 0x0008, 0x2fb: 0x0008, 0x2fc: 0x0008, 0x2fd: 0x0008, 0x2fe: 0x0008, 0x2ff: 0x0008, // Block 0xc, offset 0x300 0x300: 0x0008, 0x301: 0x0008, 0x302: 0xe00f, 0x303: 0x0008, 0x304: 0x0008, 0x305: 0x0008, 0x306: 0x0008, 0x307: 0x0008, 0x308: 0x0008, 0x309: 0x0008, 0x30a: 0x0008, 0x30b: 0x0008, 0x30c: 0x0008, 0x30d: 0x0008, 0x30e: 0x0008, 0x30f: 0xe0c5, 0x310: 0x04b5, 0x311: 0x04cd, 0x312: 0xe0bd, 0x313: 0xe0f5, 0x314: 0xe0fd, 0x315: 0xe09d, 0x316: 0xe0b5, 0x317: 0x0008, 0x318: 0xe00d, 0x319: 0x0008, 0x31a: 0xe00d, 0x31b: 0x0008, 0x31c: 0xe00d, 0x31d: 0x0008, 0x31e: 0xe00d, 0x31f: 0x0008, 0x320: 0xe00d, 0x321: 0x0008, 0x322: 0xe00d, 0x323: 0x0008, 0x324: 0xe00d, 0x325: 0x0008, 0x326: 0xe00d, 0x327: 0x0008, 0x328: 0xe00d, 0x329: 0x0008, 0x32a: 0xe00d, 0x32b: 0x0008, 0x32c: 0xe00d, 0x32d: 0x0008, 0x32e: 0xe00d, 0x32f: 0x0008, 0x330: 0x04e5, 0x331: 0xe185, 0x332: 0xe18d, 0x333: 0x0008, 0x334: 0x04fd, 0x335: 0x03dd, 0x336: 0x0018, 0x337: 0xe07d, 0x338: 0x0008, 0x339: 0xe1d5, 0x33a: 0xe00d, 0x33b: 0x0008, 0x33c: 0x0008, 0x33d: 0x0515, 0x33e: 0x052d, 0x33f: 0x052d, // Block 0xd, offset 0x340 0x340: 0x0008, 0x341: 0x0008, 0x342: 0x0008, 0x343: 0x0008, 0x344: 0x0008, 0x345: 0x0008, 0x346: 0x0008, 0x347: 0x0008, 0x348: 0x0008, 0x349: 0x0008, 0x34a: 0x0008, 0x34b: 0x0008, 0x34c: 0x0008, 0x34d: 0x0008, 0x34e: 0x0008, 0x34f: 0x0008, 0x350: 0x0008, 0x351: 0x0008, 0x352: 0x0008, 0x353: 0x0008, 0x354: 0x0008, 0x355: 0x0008, 0x356: 0x0008, 0x357: 0x0008, 0x358: 0x0008, 0x359: 0x0008, 0x35a: 0x0008, 0x35b: 0x0008, 0x35c: 0x0008, 0x35d: 0x0008, 0x35e: 0x0008, 0x35f: 0x0008, 0x360: 0xe00d, 0x361: 0x0008, 0x362: 0xe00d, 0x363: 0x0008, 0x364: 0xe00d, 0x365: 0x0008, 0x366: 0xe00d, 0x367: 0x0008, 0x368: 0xe00d, 0x369: 0x0008, 0x36a: 0xe00d, 0x36b: 0x0008, 0x36c: 0xe00d, 0x36d: 0x0008, 0x36e: 0xe00d, 0x36f: 0x0008, 0x370: 0xe00d, 0x371: 0x0008, 0x372: 0xe00d, 0x373: 0x0008, 0x374: 0xe00d, 0x375: 0x0008, 0x376: 0xe00d, 0x377: 0x0008, 0x378: 0xe00d, 0x379: 0x0008, 0x37a: 0xe00d, 0x37b: 0x0008, 0x37c: 0xe00d, 0x37d: 0x0008, 0x37e: 0xe00d, 0x37f: 0x0008, // Block 0xe, offset 0x380 0x380: 0xe00d, 0x381: 0x0008, 0x382: 0x0018, 0x383: 0x3308, 0x384: 0x3308, 0x385: 0x3308, 0x386: 0x3308, 0x387: 0x3308, 0x388: 0x3318, 0x389: 0x3318, 0x38a: 0xe00d, 0x38b: 0x0008, 0x38c: 0xe00d, 0x38d: 0x0008, 0x38e: 0xe00d, 0x38f: 0x0008, 0x390: 0xe00d, 0x391: 0x0008, 0x392: 0xe00d, 0x393: 0x0008, 0x394: 0xe00d, 0x395: 0x0008, 0x396: 0xe00d, 0x397: 0x0008, 0x398: 0xe00d, 0x399: 0x0008, 0x39a: 0xe00d, 0x39b: 0x0008, 0x39c: 0xe00d, 0x39d: 0x0008, 0x39e: 0xe00d, 0x39f: 0x0008, 0x3a0: 0xe00d, 0x3a1: 0x0008, 0x3a2: 0xe00d, 0x3a3: 0x0008, 0x3a4: 0xe00d, 0x3a5: 0x0008, 0x3a6: 0xe00d, 0x3a7: 0x0008, 0x3a8: 0xe00d, 0x3a9: 0x0008, 0x3aa: 0xe00d, 0x3ab: 0x0008, 0x3ac: 0xe00d, 0x3ad: 0x0008, 0x3ae: 0xe00d, 0x3af: 0x0008, 0x3b0: 0xe00d, 0x3b1: 0x0008, 0x3b2: 0xe00d, 0x3b3: 0x0008, 0x3b4: 0xe00d, 0x3b5: 0x0008, 0x3b6: 0xe00d, 0x3b7: 0x0008, 0x3b8: 0xe00d, 0x3b9: 0x0008, 0x3ba: 0xe00d, 0x3bb: 0x0008, 0x3bc: 0xe00d, 0x3bd: 0x0008, 0x3be: 0xe00d, 0x3bf: 0x0008, // Block 0xf, offset 0x3c0 0x3c0: 0x0040, 0x3c1: 0xe01d, 0x3c2: 0x0008, 0x3c3: 0xe03d, 0x3c4: 0x0008, 0x3c5: 0xe01d, 0x3c6: 0x0008, 0x3c7: 0xe07d, 0x3c8: 0x0008, 0x3c9: 0xe01d, 0x3ca: 0x0008, 0x3cb: 0xe03d, 0x3cc: 0x0008, 0x3cd: 0xe01d, 0x3ce: 0x0008, 0x3cf: 0x0008, 0x3d0: 0xe00d, 0x3d1: 0x0008, 0x3d2: 0xe00d, 0x3d3: 0x0008, 0x3d4: 0xe00d, 0x3d5: 0x0008, 0x3d6: 0xe00d, 0x3d7: 0x0008, 0x3d8: 0xe00d, 0x3d9: 0x0008, 0x3da: 0xe00d, 0x3db: 0x0008, 0x3dc: 0xe00d, 0x3dd: 0x0008, 0x3de: 0xe00d, 0x3df: 0x0008, 0x3e0: 0xe00d, 0x3e1: 0x0008, 0x3e2: 0xe00d, 0x3e3: 0x0008, 0x3e4: 0xe00d, 0x3e5: 0x0008, 0x3e6: 0xe00d, 0x3e7: 0x0008, 0x3e8: 0xe00d, 0x3e9: 0x0008, 0x3ea: 0xe00d, 0x3eb: 0x0008, 0x3ec: 0xe00d, 0x3ed: 0x0008, 0x3ee: 0xe00d, 0x3ef: 0x0008, 0x3f0: 0xe00d, 0x3f1: 0x0008, 0x3f2: 0xe00d, 0x3f3: 0x0008, 0x3f4: 0xe00d, 0x3f5: 0x0008, 0x3f6: 0xe00d, 0x3f7: 0x0008, 0x3f8: 0xe00d, 0x3f9: 0x0008, 0x3fa: 0xe00d, 0x3fb: 0x0008, 0x3fc: 0xe00d, 0x3fd: 0x0008, 0x3fe: 0xe00d, 0x3ff: 0x0008, // Block 0x10, offset 0x400 0x400: 0xe00d, 0x401: 0x0008, 0x402: 0xe00d, 0x403: 0x0008, 0x404: 0xe00d, 0x405: 0x0008, 0x406: 0xe00d, 0x407: 0x0008, 0x408: 0xe00d, 0x409: 0x0008, 0x40a: 0xe00d, 0x40b: 0x0008, 0x40c: 0xe00d, 0x40d: 0x0008, 0x40e: 0xe00d, 0x40f: 0x0008, 0x410: 0xe00d, 0x411: 0x0008, 0x412: 0xe00d, 0x413: 0x0008, 0x414: 0xe00d, 0x415: 0x0008, 0x416: 0xe00d, 0x417: 0x0008, 0x418: 0xe00d, 0x419: 0x0008, 0x41a: 0xe00d, 0x41b: 0x0008, 0x41c: 0xe00d, 0x41d: 0x0008, 0x41e: 0xe00d, 0x41f: 0x0008, 0x420: 0xe00d, 0x421: 0x0008, 0x422: 0xe00d, 0x423: 0x0008, 0x424: 0xe00d, 0x425: 0x0008, 0x426: 0xe00d, 0x427: 0x0008, 0x428: 0xe00d, 0x429: 0x0008, 0x42a: 0xe00d, 0x42b: 0x0008, 0x42c: 0xe00d, 0x42d: 0x0008, 0x42e: 0xe00d, 0x42f: 0x0008, 0x430: 0x0040, 0x431: 0x03f5, 0x432: 0x03f5, 0x433: 0x03f5, 0x434: 0x03f5, 0x435: 0x03f5, 0x436: 0x03f5, 0x437: 0x03f5, 0x438: 0x03f5, 0x439: 0x03f5, 0x43a: 0x03f5, 0x43b: 0x03f5, 0x43c: 0x03f5, 0x43d: 0x03f5, 0x43e: 0x03f5, 0x43f: 0x03f5, // Block 0x11, offset 0x440 0x440: 0x0840, 0x441: 0x0840, 0x442: 0x0840, 0x443: 0x0840, 0x444: 0x0840, 0x445: 0x0840, 0x446: 0x0018, 0x447: 0x0018, 0x448: 0x0818, 0x449: 0x0018, 0x44a: 0x0018, 0x44b: 0x0818, 0x44c: 0x0018, 0x44d: 0x0818, 0x44e: 0x0018, 0x44f: 0x0018, 0x450: 0x3308, 0x451: 0x3308, 0x452: 0x3308, 0x453: 0x3308, 0x454: 0x3308, 0x455: 0x3308, 0x456: 0x3308, 0x457: 0x3308, 0x458: 0x3308, 0x459: 0x3308, 0x45a: 0x3308, 0x45b: 0x0818, 0x45c: 0x0b40, 0x45d: 0x0040, 0x45e: 0x0818, 0x45f: 0x0818, 0x460: 0x0a08, 0x461: 0x0808, 0x462: 0x0c08, 0x463: 0x0c08, 0x464: 0x0c08, 0x465: 0x0c08, 0x466: 0x0a08, 0x467: 0x0c08, 0x468: 0x0a08, 0x469: 0x0c08, 0x46a: 0x0a08, 0x46b: 0x0a08, 0x46c: 0x0a08, 0x46d: 0x0a08, 0x46e: 0x0a08, 0x46f: 0x0c08, 0x470: 0x0c08, 0x471: 0x0c08, 0x472: 0x0c08, 0x473: 0x0a08, 0x474: 0x0a08, 0x475: 0x0a08, 0x476: 0x0a08, 0x477: 0x0a08, 0x478: 0x0a08, 0x479: 0x0a08, 0x47a: 0x0a08, 0x47b: 0x0a08, 0x47c: 0x0a08, 0x47d: 0x0a08, 0x47e: 0x0a08, 0x47f: 0x0a08, // Block 0x12, offset 0x480 0x480: 0x0818, 0x481: 0x0a08, 0x482: 0x0a08, 0x483: 0x0a08, 0x484: 0x0a08, 0x485: 0x0a08, 0x486: 0x0a08, 0x487: 0x0a08, 0x488: 0x0c08, 0x489: 0x0a08, 0x48a: 0x0a08, 0x48b: 0x3308, 0x48c: 0x3308, 0x48d: 0x3308, 0x48e: 0x3308, 0x48f: 0x3308, 0x490: 0x3308, 0x491: 0x3308, 0x492: 0x3308, 0x493: 0x3308, 0x494: 0x3308, 0x495: 0x3308, 0x496: 0x3308, 0x497: 0x3308, 0x498: 0x3308, 0x499: 0x3308, 0x49a: 0x3308, 0x49b: 0x3308, 0x49c: 0x3308, 0x49d: 0x3308, 0x49e: 0x3308, 0x49f: 0x3308, 0x4a0: 0x0808, 0x4a1: 0x0808, 0x4a2: 0x0808, 0x4a3: 0x0808, 0x4a4: 0x0808, 0x4a5: 0x0808, 0x4a6: 0x0808, 0x4a7: 0x0808, 0x4a8: 0x0808, 0x4a9: 0x0808, 0x4aa: 0x0018, 0x4ab: 0x0818, 0x4ac: 0x0818, 0x4ad: 0x0818, 0x4ae: 0x0a08, 0x4af: 0x0a08, 0x4b0: 0x3308, 0x4b1: 0x0c08, 0x4b2: 0x0c08, 0x4b3: 0x0c08, 0x4b4: 0x0808, 0x4b5: 0x0429, 0x4b6: 0x0451, 0x4b7: 0x0479, 0x4b8: 0x04a1, 0x4b9: 0x0a08, 0x4ba: 0x0a08, 0x4bb: 0x0a08, 0x4bc: 0x0a08, 0x4bd: 0x0a08, 0x4be: 0x0a08, 0x4bf: 0x0a08, // Block 0x13, offset 0x4c0 0x4c0: 0x0c08, 0x4c1: 0x0a08, 0x4c2: 0x0a08, 0x4c3: 0x0c08, 0x4c4: 0x0c08, 0x4c5: 0x0c08, 0x4c6: 0x0c08, 0x4c7: 0x0c08, 0x4c8: 0x0c08, 0x4c9: 0x0c08, 0x4ca: 0x0c08, 0x4cb: 0x0c08, 0x4cc: 0x0a08, 0x4cd: 0x0c08, 0x4ce: 0x0a08, 0x4cf: 0x0c08, 0x4d0: 0x0a08, 0x4d1: 0x0a08, 0x4d2: 0x0c08, 0x4d3: 0x0c08, 0x4d4: 0x0818, 0x4d5: 0x0c08, 0x4d6: 0x3308, 0x4d7: 0x3308, 0x4d8: 0x3308, 0x4d9: 0x3308, 0x4da: 0x3308, 0x4db: 0x3308, 0x4dc: 0x3308, 0x4dd: 0x0840, 0x4de: 0x0018, 0x4df: 0x3308, 0x4e0: 0x3308, 0x4e1: 0x3308, 0x4e2: 0x3308, 0x4e3: 0x3308, 0x4e4: 0x3308, 0x4e5: 0x0808, 0x4e6: 0x0808, 0x4e7: 0x3308, 0x4e8: 0x3308, 0x4e9: 0x0018, 0x4ea: 0x3308, 0x4eb: 0x3308, 0x4ec: 0x3308, 0x4ed: 0x3308, 0x4ee: 0x0c08, 0x4ef: 0x0c08, 0x4f0: 0x0008, 0x4f1: 0x0008, 0x4f2: 0x0008, 0x4f3: 0x0008, 0x4f4: 0x0008, 0x4f5: 0x0008, 0x4f6: 0x0008, 0x4f7: 0x0008, 0x4f8: 0x0008, 0x4f9: 0x0008, 0x4fa: 0x0a08, 0x4fb: 0x0a08, 0x4fc: 0x0a08, 0x4fd: 0x0808, 0x4fe: 0x0808, 0x4ff: 0x0a08, // Block 0x14, offset 0x500 0x500: 0x0818, 0x501: 0x0818, 0x502: 0x0818, 0x503: 0x0818, 0x504: 0x0818, 0x505: 0x0818, 0x506: 0x0818, 0x507: 0x0818, 0x508: 0x0818, 0x509: 0x0818, 0x50a: 0x0818, 0x50b: 0x0818, 0x50c: 0x0818, 0x50d: 0x0818, 0x50e: 0x0040, 0x50f: 0x0b40, 0x510: 0x0c08, 0x511: 0x3308, 0x512: 0x0a08, 0x513: 0x0a08, 0x514: 0x0a08, 0x515: 0x0c08, 0x516: 0x0c08, 0x517: 0x0c08, 0x518: 0x0c08, 0x519: 0x0c08, 0x51a: 0x0a08, 0x51b: 0x0a08, 0x51c: 0x0a08, 0x51d: 0x0a08, 0x51e: 0x0c08, 0x51f: 0x0a08, 0x520: 0x0a08, 0x521: 0x0a08, 0x522: 0x0a08, 0x523: 0x0a08, 0x524: 0x0a08, 0x525: 0x0a08, 0x526: 0x0a08, 0x527: 0x0a08, 0x528: 0x0c08, 0x529: 0x0a08, 0x52a: 0x0c08, 0x52b: 0x0a08, 0x52c: 0x0c08, 0x52d: 0x0a08, 0x52e: 0x0a08, 0x52f: 0x0c08, 0x530: 0x3308, 0x531: 0x3308, 0x532: 0x3308, 0x533: 0x3308, 0x534: 0x3308, 0x535: 0x3308, 0x536: 0x3308, 0x537: 0x3308, 0x538: 0x3308, 0x539: 0x3308, 0x53a: 0x3308, 0x53b: 0x3308, 0x53c: 0x3308, 0x53d: 0x3308, 0x53e: 0x3308, 0x53f: 0x3308, // Block 0x15, offset 0x540 0x540: 0x0c08, 0x541: 0x0a08, 0x542: 0x0a08, 0x543: 0x0a08, 0x544: 0x0a08, 0x545: 0x0a08, 0x546: 0x0c08, 0x547: 0x0c08, 0x548: 0x0a08, 0x549: 0x0c08, 0x54a: 0x0a08, 0x54b: 0x0a08, 0x54c: 0x0a08, 0x54d: 0x0a08, 0x54e: 0x0a08, 0x54f: 0x0a08, 0x550: 0x0a08, 0x551: 0x0a08, 0x552: 0x0a08, 0x553: 0x0a08, 0x554: 0x0c08, 0x555: 0x0a08, 0x556: 0x0808, 0x557: 0x0808, 0x558: 0x0808, 0x559: 0x3308, 0x55a: 0x3308, 0x55b: 0x3308, 0x55c: 0x0040, 0x55d: 0x0040, 0x55e: 0x0818, 0x55f: 0x0040, 0x560: 0x0a08, 0x561: 0x0808, 0x562: 0x0a08, 0x563: 0x0a08, 0x564: 0x0a08, 0x565: 0x0a08, 0x566: 0x0808, 0x567: 0x0c08, 0x568: 0x0a08, 0x569: 0x0c08, 0x56a: 0x0c08, 0x56b: 0x0040, 0x56c: 0x0040, 0x56d: 0x0040, 0x56e: 0x0040, 0x56f: 0x0040, 0x570: 0x0040, 0x571: 0x0040, 0x572: 0x0040, 0x573: 0x0040, 0x574: 0x0040, 0x575: 0x0040, 0x576: 0x0040, 0x577: 0x0040, 0x578: 0x0040, 0x579: 0x0040, 0x57a: 0x0040, 0x57b: 0x0040, 0x57c: 0x0040, 0x57d: 0x0040, 0x57e: 0x0040, 0x57f: 0x0040, // Block 0x16, offset 0x580 0x580: 0x3008, 0x581: 0x3308, 0x582: 0x3308, 0x583: 0x3308, 0x584: 0x3308, 0x585: 0x3308, 0x586: 0x3308, 0x587: 0x3308, 0x588: 0x3308, 0x589: 0x3008, 0x58a: 0x3008, 0x58b: 0x3008, 0x58c: 0x3008, 0x58d: 0x3b08, 0x58e: 0x3008, 0x58f: 0x3008, 0x590: 0x0008, 0x591: 0x3308, 0x592: 0x3308, 0x593: 0x3308, 0x594: 0x3308, 0x595: 0x3308, 0x596: 0x3308, 0x597: 0x3308, 0x598: 0x04c9, 0x599: 0x0501, 0x59a: 0x0539, 0x59b: 0x0571, 0x59c: 0x05a9, 0x59d: 0x05e1, 0x59e: 0x0619, 0x59f: 0x0651, 0x5a0: 0x0008, 0x5a1: 0x0008, 0x5a2: 0x3308, 0x5a3: 0x3308, 0x5a4: 0x0018, 0x5a5: 0x0018, 0x5a6: 0x0008, 0x5a7: 0x0008, 0x5a8: 0x0008, 0x5a9: 0x0008, 0x5aa: 0x0008, 0x5ab: 0x0008, 0x5ac: 0x0008, 0x5ad: 0x0008, 0x5ae: 0x0008, 0x5af: 0x0008, 0x5b0: 0x0018, 0x5b1: 0x0008, 0x5b2: 0x0008, 0x5b3: 0x0008, 0x5b4: 0x0008, 0x5b5: 0x0008, 0x5b6: 0x0008, 0x5b7: 0x0008, 0x5b8: 0x0008, 0x5b9: 0x0008, 0x5ba: 0x0008, 0x5bb: 0x0008, 0x5bc: 0x0008, 0x5bd: 0x0008, 0x5be: 0x0008, 0x5bf: 0x0008, // Block 0x17, offset 0x5c0 0x5c0: 0x0008, 0x5c1: 0x3308, 0x5c2: 0x3008, 0x5c3: 0x3008, 0x5c4: 0x0040, 0x5c5: 0x0008, 0x5c6: 0x0008, 0x5c7: 0x0008, 0x5c8: 0x0008, 0x5c9: 0x0008, 0x5ca: 0x0008, 0x5cb: 0x0008, 0x5cc: 0x0008, 0x5cd: 0x0040, 0x5ce: 0x0040, 0x5cf: 0x0008, 0x5d0: 0x0008, 0x5d1: 0x0040, 0x5d2: 0x0040, 0x5d3: 0x0008, 0x5d4: 0x0008, 0x5d5: 0x0008, 0x5d6: 0x0008, 0x5d7: 0x0008, 0x5d8: 0x0008, 0x5d9: 0x0008, 0x5da: 0x0008, 0x5db: 0x0008, 0x5dc: 0x0008, 0x5dd: 0x0008, 0x5de: 0x0008, 0x5df: 0x0008, 0x5e0: 0x0008, 0x5e1: 0x0008, 0x5e2: 0x0008, 0x5e3: 0x0008, 0x5e4: 0x0008, 0x5e5: 0x0008, 0x5e6: 0x0008, 0x5e7: 0x0008, 0x5e8: 0x0008, 0x5e9: 0x0040, 0x5ea: 0x0008, 0x5eb: 0x0008, 0x5ec: 0x0008, 0x5ed: 0x0008, 0x5ee: 0x0008, 0x5ef: 0x0008, 0x5f0: 0x0008, 0x5f1: 0x0040, 0x5f2: 0x0008, 0x5f3: 0x0040, 0x5f4: 0x0040, 0x5f5: 0x0040, 0x5f6: 0x0008, 0x5f7: 0x0008, 0x5f8: 0x0008, 0x5f9: 0x0008, 0x5fa: 0x0040, 0x5fb: 0x0040, 0x5fc: 0x3308, 0x5fd: 0x0008, 0x5fe: 0x3008, 0x5ff: 0x3008, // Block 0x18, offset 0x600 0x600: 0x3008, 0x601: 0x3308, 0x602: 0x3308, 0x603: 0x3308, 0x604: 0x3308, 0x605: 0x0040, 0x606: 0x0040, 0x607: 0x3008, 0x608: 0x3008, 0x609: 0x0040, 0x60a: 0x0040, 0x60b: 0x3008, 0x60c: 0x3008, 0x60d: 0x3b08, 0x60e: 0x0008, 0x60f: 0x0040, 0x610: 0x0040, 0x611: 0x0040, 0x612: 0x0040, 0x613: 0x0040, 0x614: 0x0040, 0x615: 0x0040, 0x616: 0x0040, 0x617: 0x3008, 0x618: 0x0040, 0x619: 0x0040, 0x61a: 0x0040, 0x61b: 0x0040, 0x61c: 0x0689, 0x61d: 0x06c1, 0x61e: 0x0040, 0x61f: 0x06f9, 0x620: 0x0008, 0x621: 0x0008, 0x622: 0x3308, 0x623: 0x3308, 0x624: 0x0040, 0x625: 0x0040, 0x626: 0x0008, 0x627: 0x0008, 0x628: 0x0008, 0x629: 0x0008, 0x62a: 0x0008, 0x62b: 0x0008, 0x62c: 0x0008, 0x62d: 0x0008, 0x62e: 0x0008, 0x62f: 0x0008, 0x630: 0x0008, 0x631: 0x0008, 0x632: 0x0018, 0x633: 0x0018, 0x634: 0x0018, 0x635: 0x0018, 0x636: 0x0018, 0x637: 0x0018, 0x638: 0x0018, 0x639: 0x0018, 0x63a: 0x0018, 0x63b: 0x0018, 0x63c: 0x0008, 0x63d: 0x0018, 0x63e: 0x3308, 0x63f: 0x0040, // Block 0x19, offset 0x640 0x640: 0x0040, 0x641: 0x3308, 0x642: 0x3308, 0x643: 0x3008, 0x644: 0x0040, 0x645: 0x0008, 0x646: 0x0008, 0x647: 0x0008, 0x648: 0x0008, 0x649: 0x0008, 0x64a: 0x0008, 0x64b: 0x0040, 0x64c: 0x0040, 0x64d: 0x0040, 0x64e: 0x0040, 0x64f: 0x0008, 0x650: 0x0008, 0x651: 0x0040, 0x652: 0x0040, 0x653: 0x0008, 0x654: 0x0008, 0x655: 0x0008, 0x656: 0x0008, 0x657: 0x0008, 0x658: 0x0008, 0x659: 0x0008, 0x65a: 0x0008, 0x65b: 0x0008, 0x65c: 0x0008, 0x65d: 0x0008, 0x65e: 0x0008, 0x65f: 0x0008, 0x660: 0x0008, 0x661: 0x0008, 0x662: 0x0008, 0x663: 0x0008, 0x664: 0x0008, 0x665: 0x0008, 0x666: 0x0008, 0x667: 0x0008, 0x668: 0x0008, 0x669: 0x0040, 0x66a: 0x0008, 0x66b: 0x0008, 0x66c: 0x0008, 0x66d: 0x0008, 0x66e: 0x0008, 0x66f: 0x0008, 0x670: 0x0008, 0x671: 0x0040, 0x672: 0x0008, 0x673: 0x0731, 0x674: 0x0040, 0x675: 0x0008, 0x676: 0x0769, 0x677: 0x0040, 0x678: 0x0008, 0x679: 0x0008, 0x67a: 0x0040, 0x67b: 0x0040, 0x67c: 0x3308, 0x67d: 0x0040, 0x67e: 0x3008, 0x67f: 0x3008, // Block 0x1a, offset 0x680 0x680: 0x3008, 0x681: 0x3308, 0x682: 0x3308, 0x683: 0x0040, 0x684: 0x0040, 0x685: 0x0040, 0x686: 0x0040, 0x687: 0x3308, 0x688: 0x3308, 0x689: 0x0040, 0x68a: 0x0040, 0x68b: 0x3308, 0x68c: 0x3308, 0x68d: 0x3b08, 0x68e: 0x0040, 0x68f: 0x0040, 0x690: 0x0040, 0x691: 0x3308, 0x692: 0x0040, 0x693: 0x0040, 0x694: 0x0040, 0x695: 0x0040, 0x696: 0x0040, 0x697: 0x0040, 0x698: 0x0040, 0x699: 0x07a1, 0x69a: 0x07d9, 0x69b: 0x0811, 0x69c: 0x0008, 0x69d: 0x0040, 0x69e: 0x0849, 0x69f: 0x0040, 0x6a0: 0x0040, 0x6a1: 0x0040, 0x6a2: 0x0040, 0x6a3: 0x0040, 0x6a4: 0x0040, 0x6a5: 0x0040, 0x6a6: 0x0008, 0x6a7: 0x0008, 0x6a8: 0x0008, 0x6a9: 0x0008, 0x6aa: 0x0008, 0x6ab: 0x0008, 0x6ac: 0x0008, 0x6ad: 0x0008, 0x6ae: 0x0008, 0x6af: 0x0008, 0x6b0: 0x3308, 0x6b1: 0x3308, 0x6b2: 0x0008, 0x6b3: 0x0008, 0x6b4: 0x0008, 0x6b5: 0x3308, 0x6b6: 0x0018, 0x6b7: 0x0040, 0x6b8: 0x0040, 0x6b9: 0x0040, 0x6ba: 0x0040, 0x6bb: 0x0040, 0x6bc: 0x0040, 0x6bd: 0x0040, 0x6be: 0x0040, 0x6bf: 0x0040, // Block 0x1b, offset 0x6c0 0x6c0: 0x0040, 0x6c1: 0x3308, 0x6c2: 0x3308, 0x6c3: 0x3008, 0x6c4: 0x0040, 0x6c5: 0x0008, 0x6c6: 0x0008, 0x6c7: 0x0008, 0x6c8: 0x0008, 0x6c9: 0x0008, 0x6ca: 0x0008, 0x6cb: 0x0008, 0x6cc: 0x0008, 0x6cd: 0x0008, 0x6ce: 0x0040, 0x6cf: 0x0008, 0x6d0: 0x0008, 0x6d1: 0x0008, 0x6d2: 0x0040, 0x6d3: 0x0008, 0x6d4: 0x0008, 0x6d5: 0x0008, 0x6d6: 0x0008, 0x6d7: 0x0008, 0x6d8: 0x0008, 0x6d9: 0x0008, 0x6da: 0x0008, 0x6db: 0x0008, 0x6dc: 0x0008, 0x6dd: 0x0008, 0x6de: 0x0008, 0x6df: 0x0008, 0x6e0: 0x0008, 0x6e1: 0x0008, 0x6e2: 0x0008, 0x6e3: 0x0008, 0x6e4: 0x0008, 0x6e5: 0x0008, 0x6e6: 0x0008, 0x6e7: 0x0008, 0x6e8: 0x0008, 0x6e9: 0x0040, 0x6ea: 0x0008, 0x6eb: 0x0008, 0x6ec: 0x0008, 0x6ed: 0x0008, 0x6ee: 0x0008, 0x6ef: 0x0008, 0x6f0: 0x0008, 0x6f1: 0x0040, 0x6f2: 0x0008, 0x6f3: 0x0008, 0x6f4: 0x0040, 0x6f5: 0x0008, 0x6f6: 0x0008, 0x6f7: 0x0008, 0x6f8: 0x0008, 0x6f9: 0x0008, 0x6fa: 0x0040, 0x6fb: 0x0040, 0x6fc: 0x3308, 0x6fd: 0x0008, 0x6fe: 0x3008, 0x6ff: 0x3008, // Block 0x1c, offset 0x700 0x700: 0x3008, 0x701: 0x3308, 0x702: 0x3308, 0x703: 0x3308, 0x704: 0x3308, 0x705: 0x3308, 0x706: 0x0040, 0x707: 0x3308, 0x708: 0x3308, 0x709: 0x3008, 0x70a: 0x0040, 0x70b: 0x3008, 0x70c: 0x3008, 0x70d: 0x3b08, 0x70e: 0x0040, 0x70f: 0x0040, 0x710: 0x0008, 0x711: 0x0040, 0x712: 0x0040, 0x713: 0x0040, 0x714: 0x0040, 0x715: 0x0040, 0x716: 0x0040, 0x717: 0x0040, 0x718: 0x0040, 0x719: 0x0040, 0x71a: 0x0040, 0x71b: 0x0040, 0x71c: 0x0040, 0x71d: 0x0040, 0x71e: 0x0040, 0x71f: 0x0040, 0x720: 0x0008, 0x721: 0x0008, 0x722: 0x3308, 0x723: 0x3308, 0x724: 0x0040, 0x725: 0x0040, 0x726: 0x0008, 0x727: 0x0008, 0x728: 0x0008, 0x729: 0x0008, 0x72a: 0x0008, 0x72b: 0x0008, 0x72c: 0x0008, 0x72d: 0x0008, 0x72e: 0x0008, 0x72f: 0x0008, 0x730: 0x0018, 0x731: 0x0018, 0x732: 0x0040, 0x733: 0x0040, 0x734: 0x0040, 0x735: 0x0040, 0x736: 0x0040, 0x737: 0x0040, 0x738: 0x0040, 0x739: 0x0008, 0x73a: 0x3308, 0x73b: 0x3308, 0x73c: 0x3308, 0x73d: 0x3308, 0x73e: 0x3308, 0x73f: 0x3308, // Block 0x1d, offset 0x740 0x740: 0x0040, 0x741: 0x3308, 0x742: 0x3008, 0x743: 0x3008, 0x744: 0x0040, 0x745: 0x0008, 0x746: 0x0008, 0x747: 0x0008, 0x748: 0x0008, 0x749: 0x0008, 0x74a: 0x0008, 0x74b: 0x0008, 0x74c: 0x0008, 0x74d: 0x0040, 0x74e: 0x0040, 0x74f: 0x0008, 0x750: 0x0008, 0x751: 0x0040, 0x752: 0x0040, 0x753: 0x0008, 0x754: 0x0008, 0x755: 0x0008, 0x756: 0x0008, 0x757: 0x0008, 0x758: 0x0008, 0x759: 0x0008, 0x75a: 0x0008, 0x75b: 0x0008, 0x75c: 0x0008, 0x75d: 0x0008, 0x75e: 0x0008, 0x75f: 0x0008, 0x760: 0x0008, 0x761: 0x0008, 0x762: 0x0008, 0x763: 0x0008, 0x764: 0x0008, 0x765: 0x0008, 0x766: 0x0008, 0x767: 0x0008, 0x768: 0x0008, 0x769: 0x0040, 0x76a: 0x0008, 0x76b: 0x0008, 0x76c: 0x0008, 0x76d: 0x0008, 0x76e: 0x0008, 0x76f: 0x0008, 0x770: 0x0008, 0x771: 0x0040, 0x772: 0x0008, 0x773: 0x0008, 0x774: 0x0040, 0x775: 0x0008, 0x776: 0x0008, 0x777: 0x0008, 0x778: 0x0008, 0x779: 0x0008, 0x77a: 0x0040, 0x77b: 0x0040, 0x77c: 0x3308, 0x77d: 0x0008, 0x77e: 0x3008, 0x77f: 0x3308, // Block 0x1e, offset 0x780 0x780: 0x3008, 0x781: 0x3308, 0x782: 0x3308, 0x783: 0x3308, 0x784: 0x3308, 0x785: 0x0040, 0x786: 0x0040, 0x787: 0x3008, 0x788: 0x3008, 0x789: 0x0040, 0x78a: 0x0040, 0x78b: 0x3008, 0x78c: 0x3008, 0x78d: 0x3b08, 0x78e: 0x0040, 0x78f: 0x0040, 0x790: 0x0040, 0x791: 0x0040, 0x792: 0x0040, 0x793: 0x0040, 0x794: 0x0040, 0x795: 0x0040, 0x796: 0x3308, 0x797: 0x3008, 0x798: 0x0040, 0x799: 0x0040, 0x79a: 0x0040, 0x79b: 0x0040, 0x79c: 0x0881, 0x79d: 0x08b9, 0x79e: 0x0040, 0x79f: 0x0008, 0x7a0: 0x0008, 0x7a1: 0x0008, 0x7a2: 0x3308, 0x7a3: 0x3308, 0x7a4: 0x0040, 0x7a5: 0x0040, 0x7a6: 0x0008, 0x7a7: 0x0008, 0x7a8: 0x0008, 0x7a9: 0x0008, 0x7aa: 0x0008, 0x7ab: 0x0008, 0x7ac: 0x0008, 0x7ad: 0x0008, 0x7ae: 0x0008, 0x7af: 0x0008, 0x7b0: 0x0018, 0x7b1: 0x0008, 0x7b2: 0x0018, 0x7b3: 0x0018, 0x7b4: 0x0018, 0x7b5: 0x0018, 0x7b6: 0x0018, 0x7b7: 0x0018, 0x7b8: 0x0040, 0x7b9: 0x0040, 0x7ba: 0x0040, 0x7bb: 0x0040, 0x7bc: 0x0040, 0x7bd: 0x0040, 0x7be: 0x0040, 0x7bf: 0x0040, // Block 0x1f, offset 0x7c0 0x7c0: 0x0040, 0x7c1: 0x0040, 0x7c2: 0x3308, 0x7c3: 0x0008, 0x7c4: 0x0040, 0x7c5: 0x0008, 0x7c6: 0x0008, 0x7c7: 0x0008, 0x7c8: 0x0008, 0x7c9: 0x0008, 0x7ca: 0x0008, 0x7cb: 0x0040, 0x7cc: 0x0040, 0x7cd: 0x0040, 0x7ce: 0x0008, 0x7cf: 0x0008, 0x7d0: 0x0008, 0x7d1: 0x0040, 0x7d2: 0x0008, 0x7d3: 0x0008, 0x7d4: 0x0008, 0x7d5: 0x0008, 0x7d6: 0x0040, 0x7d7: 0x0040, 0x7d8: 0x0040, 0x7d9: 0x0008, 0x7da: 0x0008, 0x7db: 0x0040, 0x7dc: 0x0008, 0x7dd: 0x0040, 0x7de: 0x0008, 0x7df: 0x0008, 0x7e0: 0x0040, 0x7e1: 0x0040, 0x7e2: 0x0040, 0x7e3: 0x0008, 0x7e4: 0x0008, 0x7e5: 0x0040, 0x7e6: 0x0040, 0x7e7: 0x0040, 0x7e8: 0x0008, 0x7e9: 0x0008, 0x7ea: 0x0008, 0x7eb: 0x0040, 0x7ec: 0x0040, 0x7ed: 0x0040, 0x7ee: 0x0008, 0x7ef: 0x0008, 0x7f0: 0x0008, 0x7f1: 0x0008, 0x7f2: 0x0008, 0x7f3: 0x0008, 0x7f4: 0x0008, 0x7f5: 0x0008, 0x7f6: 0x0008, 0x7f7: 0x0008, 0x7f8: 0x0008, 0x7f9: 0x0008, 0x7fa: 0x0040, 0x7fb: 0x0040, 0x7fc: 0x0040, 0x7fd: 0x0040, 0x7fe: 0x3008, 0x7ff: 0x3008, // Block 0x20, offset 0x800 0x800: 0x3308, 0x801: 0x3008, 0x802: 0x3008, 0x803: 0x3008, 0x804: 0x3008, 0x805: 0x0040, 0x806: 0x3308, 0x807: 0x3308, 0x808: 0x3308, 0x809: 0x0040, 0x80a: 0x3308, 0x80b: 0x3308, 0x80c: 0x3308, 0x80d: 0x3b08, 0x80e: 0x0040, 0x80f: 0x0040, 0x810: 0x0040, 0x811: 0x0040, 0x812: 0x0040, 0x813: 0x0040, 0x814: 0x0040, 0x815: 0x3308, 0x816: 0x3308, 0x817: 0x0040, 0x818: 0x0008, 0x819: 0x0008, 0x81a: 0x0008, 0x81b: 0x0040, 0x81c: 0x0040, 0x81d: 0x0040, 0x81e: 0x0040, 0x81f: 0x0040, 0x820: 0x0008, 0x821: 0x0008, 0x822: 0x3308, 0x823: 0x3308, 0x824: 0x0040, 0x825: 0x0040, 0x826: 0x0008, 0x827: 0x0008, 0x828: 0x0008, 0x829: 0x0008, 0x82a: 0x0008, 0x82b: 0x0008, 0x82c: 0x0008, 0x82d: 0x0008, 0x82e: 0x0008, 0x82f: 0x0008, 0x830: 0x0040, 0x831: 0x0040, 0x832: 0x0040, 0x833: 0x0040, 0x834: 0x0040, 0x835: 0x0040, 0x836: 0x0040, 0x837: 0x0040, 0x838: 0x0018, 0x839: 0x0018, 0x83a: 0x0018, 0x83b: 0x0018, 0x83c: 0x0018, 0x83d: 0x0018, 0x83e: 0x0018, 0x83f: 0x0018, // Block 0x21, offset 0x840 0x840: 0x0008, 0x841: 0x3308, 0x842: 0x3008, 0x843: 0x3008, 0x844: 0x0018, 0x845: 0x0008, 0x846: 0x0008, 0x847: 0x0008, 0x848: 0x0008, 0x849: 0x0008, 0x84a: 0x0008, 0x84b: 0x0008, 0x84c: 0x0008, 0x84d: 0x0040, 0x84e: 0x0008, 0x84f: 0x0008, 0x850: 0x0008, 0x851: 0x0040, 0x852: 0x0008, 0x853: 0x0008, 0x854: 0x0008, 0x855: 0x0008, 0x856: 0x0008, 0x857: 0x0008, 0x858: 0x0008, 0x859: 0x0008, 0x85a: 0x0008, 0x85b: 0x0008, 0x85c: 0x0008, 0x85d: 0x0008, 0x85e: 0x0008, 0x85f: 0x0008, 0x860: 0x0008, 0x861: 0x0008, 0x862: 0x0008, 0x863: 0x0008, 0x864: 0x0008, 0x865: 0x0008, 0x866: 0x0008, 0x867: 0x0008, 0x868: 0x0008, 0x869: 0x0040, 0x86a: 0x0008, 0x86b: 0x0008, 0x86c: 0x0008, 0x86d: 0x0008, 0x86e: 0x0008, 0x86f: 0x0008, 0x870: 0x0008, 0x871: 0x0008, 0x872: 0x0008, 0x873: 0x0008, 0x874: 0x0040, 0x875: 0x0008, 0x876: 0x0008, 0x877: 0x0008, 0x878: 0x0008, 0x879: 0x0008, 0x87a: 0x0040, 0x87b: 0x0040, 0x87c: 0x3308, 0x87d: 0x0008, 0x87e: 0x3008, 0x87f: 0x3308, // Block 0x22, offset 0x880 0x880: 0x3008, 0x881: 0x3008, 0x882: 0x3008, 0x883: 0x3008, 0x884: 0x3008, 0x885: 0x0040, 0x886: 0x3308, 0x887: 0x3008, 0x888: 0x3008, 0x889: 0x0040, 0x88a: 0x3008, 0x88b: 0x3008, 0x88c: 0x3308, 0x88d: 0x3b08, 0x88e: 0x0040, 0x88f: 0x0040, 0x890: 0x0040, 0x891: 0x0040, 0x892: 0x0040, 0x893: 0x0040, 0x894: 0x0040, 0x895: 0x3008, 0x896: 0x3008, 0x897: 0x0040, 0x898: 0x0040, 0x899: 0x0040, 0x89a: 0x0040, 0x89b: 0x0040, 0x89c: 0x0040, 0x89d: 0x0040, 0x89e: 0x0008, 0x89f: 0x0040, 0x8a0: 0x0008, 0x8a1: 0x0008, 0x8a2: 0x3308, 0x8a3: 0x3308, 0x8a4: 0x0040, 0x8a5: 0x0040, 0x8a6: 0x0008, 0x8a7: 0x0008, 0x8a8: 0x0008, 0x8a9: 0x0008, 0x8aa: 0x0008, 0x8ab: 0x0008, 0x8ac: 0x0008, 0x8ad: 0x0008, 0x8ae: 0x0008, 0x8af: 0x0008, 0x8b0: 0x0040, 0x8b1: 0x0008, 0x8b2: 0x0008, 0x8b3: 0x0040, 0x8b4: 0x0040, 0x8b5: 0x0040, 0x8b6: 0x0040, 0x8b7: 0x0040, 0x8b8: 0x0040, 0x8b9: 0x0040, 0x8ba: 0x0040, 0x8bb: 0x0040, 0x8bc: 0x0040, 0x8bd: 0x0040, 0x8be: 0x0040, 0x8bf: 0x0040, // Block 0x23, offset 0x8c0 0x8c0: 0x3008, 0x8c1: 0x3308, 0x8c2: 0x3308, 0x8c3: 0x3308, 0x8c4: 0x3308, 0x8c5: 0x0040, 0x8c6: 0x3008, 0x8c7: 0x3008, 0x8c8: 0x3008, 0x8c9: 0x0040, 0x8ca: 0x3008, 0x8cb: 0x3008, 0x8cc: 0x3008, 0x8cd: 0x3b08, 0x8ce: 0x0008, 0x8cf: 0x0018, 0x8d0: 0x0040, 0x8d1: 0x0040, 0x8d2: 0x0040, 0x8d3: 0x0040, 0x8d4: 0x0008, 0x8d5: 0x0008, 0x8d6: 0x0008, 0x8d7: 0x3008, 0x8d8: 0x0018, 0x8d9: 0x0018, 0x8da: 0x0018, 0x8db: 0x0018, 0x8dc: 0x0018, 0x8dd: 0x0018, 0x8de: 0x0018, 0x8df: 0x0008, 0x8e0: 0x0008, 0x8e1: 0x0008, 0x8e2: 0x3308, 0x8e3: 0x3308, 0x8e4: 0x0040, 0x8e5: 0x0040, 0x8e6: 0x0008, 0x8e7: 0x0008, 0x8e8: 0x0008, 0x8e9: 0x0008, 0x8ea: 0x0008, 0x8eb: 0x0008, 0x8ec: 0x0008, 0x8ed: 0x0008, 0x8ee: 0x0008, 0x8ef: 0x0008, 0x8f0: 0x0018, 0x8f1: 0x0018, 0x8f2: 0x0018, 0x8f3: 0x0018, 0x8f4: 0x0018, 0x8f5: 0x0018, 0x8f6: 0x0018, 0x8f7: 0x0018, 0x8f8: 0x0018, 0x8f9: 0x0018, 0x8fa: 0x0008, 0x8fb: 0x0008, 0x8fc: 0x0008, 0x8fd: 0x0008, 0x8fe: 0x0008, 0x8ff: 0x0008, // Block 0x24, offset 0x900 0x900: 0x0040, 0x901: 0x0008, 0x902: 0x0008, 0x903: 0x0040, 0x904: 0x0008, 0x905: 0x0040, 0x906: 0x0040, 0x907: 0x0008, 0x908: 0x0008, 0x909: 0x0040, 0x90a: 0x0008, 0x90b: 0x0040, 0x90c: 0x0040, 0x90d: 0x0008, 0x90e: 0x0040, 0x90f: 0x0040, 0x910: 0x0040, 0x911: 0x0040, 0x912: 0x0040, 0x913: 0x0040, 0x914: 0x0008, 0x915: 0x0008, 0x916: 0x0008, 0x917: 0x0008, 0x918: 0x0040, 0x919: 0x0008, 0x91a: 0x0008, 0x91b: 0x0008, 0x91c: 0x0008, 0x91d: 0x0008, 0x91e: 0x0008, 0x91f: 0x0008, 0x920: 0x0040, 0x921: 0x0008, 0x922: 0x0008, 0x923: 0x0008, 0x924: 0x0040, 0x925: 0x0008, 0x926: 0x0040, 0x927: 0x0008, 0x928: 0x0040, 0x929: 0x0040, 0x92a: 0x0008, 0x92b: 0x0008, 0x92c: 0x0040, 0x92d: 0x0008, 0x92e: 0x0008, 0x92f: 0x0008, 0x930: 0x0008, 0x931: 0x3308, 0x932: 0x0008, 0x933: 0x0929, 0x934: 0x3308, 0x935: 0x3308, 0x936: 0x3308, 0x937: 0x3308, 0x938: 0x3308, 0x939: 0x3308, 0x93a: 0x0040, 0x93b: 0x3308, 0x93c: 0x3308, 0x93d: 0x0008, 0x93e: 0x0040, 0x93f: 0x0040, // Block 0x25, offset 0x940 0x940: 0x0008, 0x941: 0x0008, 0x942: 0x0008, 0x943: 0x09d1, 0x944: 0x0008, 0x945: 0x0008, 0x946: 0x0008, 0x947: 0x0008, 0x948: 0x0040, 0x949: 0x0008, 0x94a: 0x0008, 0x94b: 0x0008, 0x94c: 0x0008, 0x94d: 0x0a09, 0x94e: 0x0008, 0x94f: 0x0008, 0x950: 0x0008, 0x951: 0x0008, 0x952: 0x0a41, 0x953: 0x0008, 0x954: 0x0008, 0x955: 0x0008, 0x956: 0x0008, 0x957: 0x0a79, 0x958: 0x0008, 0x959: 0x0008, 0x95a: 0x0008, 0x95b: 0x0008, 0x95c: 0x0ab1, 0x95d: 0x0008, 0x95e: 0x0008, 0x95f: 0x0008, 0x960: 0x0008, 0x961: 0x0008, 0x962: 0x0008, 0x963: 0x0008, 0x964: 0x0008, 0x965: 0x0008, 0x966: 0x0008, 0x967: 0x0008, 0x968: 0x0008, 0x969: 0x0ae9, 0x96a: 0x0008, 0x96b: 0x0008, 0x96c: 0x0008, 0x96d: 0x0040, 0x96e: 0x0040, 0x96f: 0x0040, 0x970: 0x0040, 0x971: 0x3308, 0x972: 0x3308, 0x973: 0x0b21, 0x974: 0x3308, 0x975: 0x0b59, 0x976: 0x0b91, 0x977: 0x0bc9, 0x978: 0x0c19, 0x979: 0x0c51, 0x97a: 0x3308, 0x97b: 0x3308, 0x97c: 0x3308, 0x97d: 0x3308, 0x97e: 0x3308, 0x97f: 0x3008, // Block 0x26, offset 0x980 0x980: 0x3308, 0x981: 0x0ca1, 0x982: 0x3308, 0x983: 0x3308, 0x984: 0x3b08, 0x985: 0x0018, 0x986: 0x3308, 0x987: 0x3308, 0x988: 0x0008, 0x989: 0x0008, 0x98a: 0x0008, 0x98b: 0x0008, 0x98c: 0x0008, 0x98d: 0x3308, 0x98e: 0x3308, 0x98f: 0x3308, 0x990: 0x3308, 0x991: 0x3308, 0x992: 0x3308, 0x993: 0x0cd9, 0x994: 0x3308, 0x995: 0x3308, 0x996: 0x3308, 0x997: 0x3308, 0x998: 0x0040, 0x999: 0x3308, 0x99a: 0x3308, 0x99b: 0x3308, 0x99c: 0x3308, 0x99d: 0x0d11, 0x99e: 0x3308, 0x99f: 0x3308, 0x9a0: 0x3308, 0x9a1: 0x3308, 0x9a2: 0x0d49, 0x9a3: 0x3308, 0x9a4: 0x3308, 0x9a5: 0x3308, 0x9a6: 0x3308, 0x9a7: 0x0d81, 0x9a8: 0x3308, 0x9a9: 0x3308, 0x9aa: 0x3308, 0x9ab: 0x3308, 0x9ac: 0x0db9, 0x9ad: 0x3308, 0x9ae: 0x3308, 0x9af: 0x3308, 0x9b0: 0x3308, 0x9b1: 0x3308, 0x9b2: 0x3308, 0x9b3: 0x3308, 0x9b4: 0x3308, 0x9b5: 0x3308, 0x9b6: 0x3308, 0x9b7: 0x3308, 0x9b8: 0x3308, 0x9b9: 0x0df1, 0x9ba: 0x3308, 0x9bb: 0x3308, 0x9bc: 0x3308, 0x9bd: 0x0040, 0x9be: 0x0018, 0x9bf: 0x0018, // Block 0x27, offset 0x9c0 0x9c0: 0x0008, 0x9c1: 0x0008, 0x9c2: 0x0008, 0x9c3: 0x0008, 0x9c4: 0x0008, 0x9c5: 0x0008, 0x9c6: 0x0008, 0x9c7: 0x0008, 0x9c8: 0x0008, 0x9c9: 0x0008, 0x9ca: 0x0008, 0x9cb: 0x0008, 0x9cc: 0x0008, 0x9cd: 0x0008, 0x9ce: 0x0008, 0x9cf: 0x0008, 0x9d0: 0x0008, 0x9d1: 0x0008, 0x9d2: 0x0008, 0x9d3: 0x0008, 0x9d4: 0x0008, 0x9d5: 0x0008, 0x9d6: 0x0008, 0x9d7: 0x0008, 0x9d8: 0x0008, 0x9d9: 0x0008, 0x9da: 0x0008, 0x9db: 0x0008, 0x9dc: 0x0008, 0x9dd: 0x0008, 0x9de: 0x0008, 0x9df: 0x0008, 0x9e0: 0x0008, 0x9e1: 0x0008, 0x9e2: 0x0008, 0x9e3: 0x0008, 0x9e4: 0x0008, 0x9e5: 0x0008, 0x9e6: 0x0008, 0x9e7: 0x0008, 0x9e8: 0x0008, 0x9e9: 0x0008, 0x9ea: 0x0008, 0x9eb: 0x0008, 0x9ec: 0x0039, 0x9ed: 0x0ed1, 0x9ee: 0x0ee9, 0x9ef: 0x0008, 0x9f0: 0x0ef9, 0x9f1: 0x0f09, 0x9f2: 0x0f19, 0x9f3: 0x0f31, 0x9f4: 0x0249, 0x9f5: 0x0f41, 0x9f6: 0x0259, 0x9f7: 0x0f51, 0x9f8: 0x0359, 0x9f9: 0x0f61, 0x9fa: 0x0f71, 0x9fb: 0x0008, 0x9fc: 0x00d9, 0x9fd: 0x0f81, 0x9fe: 0x0f99, 0x9ff: 0x0269, // Block 0x28, offset 0xa00 0xa00: 0x0fa9, 0xa01: 0x0fb9, 0xa02: 0x0279, 0xa03: 0x0039, 0xa04: 0x0fc9, 0xa05: 0x0fe1, 0xa06: 0x059d, 0xa07: 0x0ee9, 0xa08: 0x0ef9, 0xa09: 0x0f09, 0xa0a: 0x0ff9, 0xa0b: 0x1011, 0xa0c: 0x1029, 0xa0d: 0x0f31, 0xa0e: 0x0008, 0xa0f: 0x0f51, 0xa10: 0x0f61, 0xa11: 0x1041, 0xa12: 0x00d9, 0xa13: 0x1059, 0xa14: 0x05b5, 0xa15: 0x05b5, 0xa16: 0x0f99, 0xa17: 0x0fa9, 0xa18: 0x0fb9, 0xa19: 0x059d, 0xa1a: 0x1071, 0xa1b: 0x1089, 0xa1c: 0x05cd, 0xa1d: 0x1099, 0xa1e: 0x10b1, 0xa1f: 0x10c9, 0xa20: 0x10e1, 0xa21: 0x10f9, 0xa22: 0x0f41, 0xa23: 0x0269, 0xa24: 0x0fb9, 0xa25: 0x1089, 0xa26: 0x1099, 0xa27: 0x10b1, 0xa28: 0x1111, 0xa29: 0x10e1, 0xa2a: 0x10f9, 0xa2b: 0x0008, 0xa2c: 0x0008, 0xa2d: 0x0008, 0xa2e: 0x0008, 0xa2f: 0x0008, 0xa30: 0x0008, 0xa31: 0x0008, 0xa32: 0x0008, 0xa33: 0x0008, 0xa34: 0x0008, 0xa35: 0x0008, 0xa36: 0x0008, 0xa37: 0x0008, 0xa38: 0x1129, 0xa39: 0x0008, 0xa3a: 0x0008, 0xa3b: 0x0008, 0xa3c: 0x0008, 0xa3d: 0x0008, 0xa3e: 0x0008, 0xa3f: 0x0008, // Block 0x29, offset 0xa40 0xa40: 0x0008, 0xa41: 0x0008, 0xa42: 0x0008, 0xa43: 0x0008, 0xa44: 0x0008, 0xa45: 0x0008, 0xa46: 0x0008, 0xa47: 0x0008, 0xa48: 0x0008, 0xa49: 0x0008, 0xa4a: 0x0008, 0xa4b: 0x0008, 0xa4c: 0x0008, 0xa4d: 0x0008, 0xa4e: 0x0008, 0xa4f: 0x0008, 0xa50: 0x0008, 0xa51: 0x0008, 0xa52: 0x0008, 0xa53: 0x0008, 0xa54: 0x0008, 0xa55: 0x0008, 0xa56: 0x0008, 0xa57: 0x0008, 0xa58: 0x0008, 0xa59: 0x0008, 0xa5a: 0x0008, 0xa5b: 0x1141, 0xa5c: 0x1159, 0xa5d: 0x1169, 0xa5e: 0x1181, 0xa5f: 0x1029, 0xa60: 0x1199, 0xa61: 0x11a9, 0xa62: 0x11c1, 0xa63: 0x11d9, 0xa64: 0x11f1, 0xa65: 0x1209, 0xa66: 0x1221, 0xa67: 0x05e5, 0xa68: 0x1239, 0xa69: 0x1251, 0xa6a: 0xe17d, 0xa6b: 0x1269, 0xa6c: 0x1281, 0xa6d: 0x1299, 0xa6e: 0x12b1, 0xa6f: 0x12c9, 0xa70: 0x12e1, 0xa71: 0x12f9, 0xa72: 0x1311, 0xa73: 0x1329, 0xa74: 0x1341, 0xa75: 0x1359, 0xa76: 0x1371, 0xa77: 0x1389, 0xa78: 0x05fd, 0xa79: 0x13a1, 0xa7a: 0x13b9, 0xa7b: 0x13d1, 0xa7c: 0x13e1, 0xa7d: 0x13f9, 0xa7e: 0x1411, 0xa7f: 0x1429, // Block 0x2a, offset 0xa80 0xa80: 0xe00d, 0xa81: 0x0008, 0xa82: 0xe00d, 0xa83: 0x0008, 0xa84: 0xe00d, 0xa85: 0x0008, 0xa86: 0xe00d, 0xa87: 0x0008, 0xa88: 0xe00d, 0xa89: 0x0008, 0xa8a: 0xe00d, 0xa8b: 0x0008, 0xa8c: 0xe00d, 0xa8d: 0x0008, 0xa8e: 0xe00d, 0xa8f: 0x0008, 0xa90: 0xe00d, 0xa91: 0x0008, 0xa92: 0xe00d, 0xa93: 0x0008, 0xa94: 0xe00d, 0xa95: 0x0008, 0xa96: 0xe00d, 0xa97: 0x0008, 0xa98: 0xe00d, 0xa99: 0x0008, 0xa9a: 0xe00d, 0xa9b: 0x0008, 0xa9c: 0xe00d, 0xa9d: 0x0008, 0xa9e: 0xe00d, 0xa9f: 0x0008, 0xaa0: 0xe00d, 0xaa1: 0x0008, 0xaa2: 0xe00d, 0xaa3: 0x0008, 0xaa4: 0xe00d, 0xaa5: 0x0008, 0xaa6: 0xe00d, 0xaa7: 0x0008, 0xaa8: 0xe00d, 0xaa9: 0x0008, 0xaaa: 0xe00d, 0xaab: 0x0008, 0xaac: 0xe00d, 0xaad: 0x0008, 0xaae: 0xe00d, 0xaaf: 0x0008, 0xab0: 0xe00d, 0xab1: 0x0008, 0xab2: 0xe00d, 0xab3: 0x0008, 0xab4: 0xe00d, 0xab5: 0x0008, 0xab6: 0xe00d, 0xab7: 0x0008, 0xab8: 0xe00d, 0xab9: 0x0008, 0xaba: 0xe00d, 0xabb: 0x0008, 0xabc: 0xe00d, 0xabd: 0x0008, 0xabe: 0xe00d, 0xabf: 0x0008, // Block 0x2b, offset 0xac0 0xac0: 0xe00d, 0xac1: 0x0008, 0xac2: 0xe00d, 0xac3: 0x0008, 0xac4: 0xe00d, 0xac5: 0x0008, 0xac6: 0xe00d, 0xac7: 0x0008, 0xac8: 0xe00d, 0xac9: 0x0008, 0xaca: 0xe00d, 0xacb: 0x0008, 0xacc: 0xe00d, 0xacd: 0x0008, 0xace: 0xe00d, 0xacf: 0x0008, 0xad0: 0xe00d, 0xad1: 0x0008, 0xad2: 0xe00d, 0xad3: 0x0008, 0xad4: 0xe00d, 0xad5: 0x0008, 0xad6: 0x0008, 0xad7: 0x0008, 0xad8: 0x0008, 0xad9: 0x0008, 0xada: 0x0615, 0xadb: 0x0635, 0xadc: 0x0008, 0xadd: 0x0008, 0xade: 0x1441, 0xadf: 0x0008, 0xae0: 0xe00d, 0xae1: 0x0008, 0xae2: 0xe00d, 0xae3: 0x0008, 0xae4: 0xe00d, 0xae5: 0x0008, 0xae6: 0xe00d, 0xae7: 0x0008, 0xae8: 0xe00d, 0xae9: 0x0008, 0xaea: 0xe00d, 0xaeb: 0x0008, 0xaec: 0xe00d, 0xaed: 0x0008, 0xaee: 0xe00d, 0xaef: 0x0008, 0xaf0: 0xe00d, 0xaf1: 0x0008, 0xaf2: 0xe00d, 0xaf3: 0x0008, 0xaf4: 0xe00d, 0xaf5: 0x0008, 0xaf6: 0xe00d, 0xaf7: 0x0008, 0xaf8: 0xe00d, 0xaf9: 0x0008, 0xafa: 0xe00d, 0xafb: 0x0008, 0xafc: 0xe00d, 0xafd: 0x0008, 0xafe: 0xe00d, 0xaff: 0x0008, // Block 0x2c, offset 0xb00 0xb00: 0x0008, 0xb01: 0x0008, 0xb02: 0x0008, 0xb03: 0x0008, 0xb04: 0x0008, 0xb05: 0x0008, 0xb06: 0x0040, 0xb07: 0x0040, 0xb08: 0xe045, 0xb09: 0xe045, 0xb0a: 0xe045, 0xb0b: 0xe045, 0xb0c: 0xe045, 0xb0d: 0xe045, 0xb0e: 0x0040, 0xb0f: 0x0040, 0xb10: 0x0008, 0xb11: 0x0008, 0xb12: 0x0008, 0xb13: 0x0008, 0xb14: 0x0008, 0xb15: 0x0008, 0xb16: 0x0008, 0xb17: 0x0008, 0xb18: 0x0040, 0xb19: 0xe045, 0xb1a: 0x0040, 0xb1b: 0xe045, 0xb1c: 0x0040, 0xb1d: 0xe045, 0xb1e: 0x0040, 0xb1f: 0xe045, 0xb20: 0x0008, 0xb21: 0x0008, 0xb22: 0x0008, 0xb23: 0x0008, 0xb24: 0x0008, 0xb25: 0x0008, 0xb26: 0x0008, 0xb27: 0x0008, 0xb28: 0xe045, 0xb29: 0xe045, 0xb2a: 0xe045, 0xb2b: 0xe045, 0xb2c: 0xe045, 0xb2d: 0xe045, 0xb2e: 0xe045, 0xb2f: 0xe045, 0xb30: 0x0008, 0xb31: 0x1459, 0xb32: 0x0008, 0xb33: 0x1471, 0xb34: 0x0008, 0xb35: 0x1489, 0xb36: 0x0008, 0xb37: 0x14a1, 0xb38: 0x0008, 0xb39: 0x14b9, 0xb3a: 0x0008, 0xb3b: 0x14d1, 0xb3c: 0x0008, 0xb3d: 0x14e9, 0xb3e: 0x0040, 0xb3f: 0x0040, // Block 0x2d, offset 0xb40 0xb40: 0x1501, 0xb41: 0x1531, 0xb42: 0x1561, 0xb43: 0x1591, 0xb44: 0x15c1, 0xb45: 0x15f1, 0xb46: 0x1621, 0xb47: 0x1651, 0xb48: 0x1501, 0xb49: 0x1531, 0xb4a: 0x1561, 0xb4b: 0x1591, 0xb4c: 0x15c1, 0xb4d: 0x15f1, 0xb4e: 0x1621, 0xb4f: 0x1651, 0xb50: 0x1681, 0xb51: 0x16b1, 0xb52: 0x16e1, 0xb53: 0x1711, 0xb54: 0x1741, 0xb55: 0x1771, 0xb56: 0x17a1, 0xb57: 0x17d1, 0xb58: 0x1681, 0xb59: 0x16b1, 0xb5a: 0x16e1, 0xb5b: 0x1711, 0xb5c: 0x1741, 0xb5d: 0x1771, 0xb5e: 0x17a1, 0xb5f: 0x17d1, 0xb60: 0x1801, 0xb61: 0x1831, 0xb62: 0x1861, 0xb63: 0x1891, 0xb64: 0x18c1, 0xb65: 0x18f1, 0xb66: 0x1921, 0xb67: 0x1951, 0xb68: 0x1801, 0xb69: 0x1831, 0xb6a: 0x1861, 0xb6b: 0x1891, 0xb6c: 0x18c1, 0xb6d: 0x18f1, 0xb6e: 0x1921, 0xb6f: 0x1951, 0xb70: 0x0008, 0xb71: 0x0008, 0xb72: 0x1981, 0xb73: 0x19b1, 0xb74: 0x19d9, 0xb75: 0x0040, 0xb76: 0x0008, 0xb77: 0x1a01, 0xb78: 0xe045, 0xb79: 0xe045, 0xb7a: 0x064d, 0xb7b: 0x1459, 0xb7c: 0x19b1, 0xb7d: 0x0666, 0xb7e: 0x1a31, 0xb7f: 0x0686, // Block 0x2e, offset 0xb80 0xb80: 0x06a6, 0xb81: 0x1a4a, 0xb82: 0x1a79, 0xb83: 0x1aa9, 0xb84: 0x1ad1, 0xb85: 0x0040, 0xb86: 0x0008, 0xb87: 0x1af9, 0xb88: 0x06c5, 0xb89: 0x1471, 0xb8a: 0x06dd, 0xb8b: 0x1489, 0xb8c: 0x1aa9, 0xb8d: 0x1b2a, 0xb8e: 0x1b5a, 0xb8f: 0x1b8a, 0xb90: 0x0008, 0xb91: 0x0008, 0xb92: 0x0008, 0xb93: 0x1bb9, 0xb94: 0x0040, 0xb95: 0x0040, 0xb96: 0x0008, 0xb97: 0x0008, 0xb98: 0xe045, 0xb99: 0xe045, 0xb9a: 0x06f5, 0xb9b: 0x14a1, 0xb9c: 0x0040, 0xb9d: 0x1bd2, 0xb9e: 0x1c02, 0xb9f: 0x1c32, 0xba0: 0x0008, 0xba1: 0x0008, 0xba2: 0x0008, 0xba3: 0x1c61, 0xba4: 0x0008, 0xba5: 0x0008, 0xba6: 0x0008, 0xba7: 0x0008, 0xba8: 0xe045, 0xba9: 0xe045, 0xbaa: 0x070d, 0xbab: 0x14d1, 0xbac: 0xe04d, 0xbad: 0x1c7a, 0xbae: 0x03d2, 0xbaf: 0x1caa, 0xbb0: 0x0040, 0xbb1: 0x0040, 0xbb2: 0x1cb9, 0xbb3: 0x1ce9, 0xbb4: 0x1d11, 0xbb5: 0x0040, 0xbb6: 0x0008, 0xbb7: 0x1d39, 0xbb8: 0x0725, 0xbb9: 0x14b9, 0xbba: 0x0515, 0xbbb: 0x14e9, 0xbbc: 0x1ce9, 0xbbd: 0x073e, 0xbbe: 0x075e, 0xbbf: 0x0040, // Block 0x2f, offset 0xbc0 0xbc0: 0x000a, 0xbc1: 0x000a, 0xbc2: 0x000a, 0xbc3: 0x000a, 0xbc4: 0x000a, 0xbc5: 0x000a, 0xbc6: 0x000a, 0xbc7: 0x000a, 0xbc8: 0x000a, 0xbc9: 0x000a, 0xbca: 0x000a, 0xbcb: 0x03c0, 0xbcc: 0x0003, 0xbcd: 0x0003, 0xbce: 0x0340, 0xbcf: 0x0b40, 0xbd0: 0x0018, 0xbd1: 0xe00d, 0xbd2: 0x0018, 0xbd3: 0x0018, 0xbd4: 0x0018, 0xbd5: 0x0018, 0xbd6: 0x0018, 0xbd7: 0x077e, 0xbd8: 0x0018, 0xbd9: 0x0018, 0xbda: 0x0018, 0xbdb: 0x0018, 0xbdc: 0x0018, 0xbdd: 0x0018, 0xbde: 0x0018, 0xbdf: 0x0018, 0xbe0: 0x0018, 0xbe1: 0x0018, 0xbe2: 0x0018, 0xbe3: 0x0018, 0xbe4: 0x0040, 0xbe5: 0x0040, 0xbe6: 0x0040, 0xbe7: 0x0018, 0xbe8: 0x0040, 0xbe9: 0x0040, 0xbea: 0x0340, 0xbeb: 0x0340, 0xbec: 0x0340, 0xbed: 0x0340, 0xbee: 0x0340, 0xbef: 0x000a, 0xbf0: 0x0018, 0xbf1: 0x0018, 0xbf2: 0x0018, 0xbf3: 0x1d69, 0xbf4: 0x1da1, 0xbf5: 0x0018, 0xbf6: 0x1df1, 0xbf7: 0x1e29, 0xbf8: 0x0018, 0xbf9: 0x0018, 0xbfa: 0x0018, 0xbfb: 0x0018, 0xbfc: 0x1e7a, 0xbfd: 0x0018, 0xbfe: 0x079e, 0xbff: 0x0018, // Block 0x30, offset 0xc00 0xc00: 0x0018, 0xc01: 0x0018, 0xc02: 0x0018, 0xc03: 0x0018, 0xc04: 0x0018, 0xc05: 0x0018, 0xc06: 0x0018, 0xc07: 0x1e92, 0xc08: 0x1eaa, 0xc09: 0x1ec2, 0xc0a: 0x0018, 0xc0b: 0x0018, 0xc0c: 0x0018, 0xc0d: 0x0018, 0xc0e: 0x0018, 0xc0f: 0x0018, 0xc10: 0x0018, 0xc11: 0x0018, 0xc12: 0x0018, 0xc13: 0x0018, 0xc14: 0x0018, 0xc15: 0x0018, 0xc16: 0x0018, 0xc17: 0x1ed9, 0xc18: 0x0018, 0xc19: 0x0018, 0xc1a: 0x0018, 0xc1b: 0x0018, 0xc1c: 0x0018, 0xc1d: 0x0018, 0xc1e: 0x0018, 0xc1f: 0x000a, 0xc20: 0x03c0, 0xc21: 0x0340, 0xc22: 0x0340, 0xc23: 0x0340, 0xc24: 0x03c0, 0xc25: 0x0040, 0xc26: 0x0040, 0xc27: 0x0040, 0xc28: 0x0040, 0xc29: 0x0040, 0xc2a: 0x0340, 0xc2b: 0x0340, 0xc2c: 0x0340, 0xc2d: 0x0340, 0xc2e: 0x0340, 0xc2f: 0x0340, 0xc30: 0x1f41, 0xc31: 0x0f41, 0xc32: 0x0040, 0xc33: 0x0040, 0xc34: 0x1f51, 0xc35: 0x1f61, 0xc36: 0x1f71, 0xc37: 0x1f81, 0xc38: 0x1f91, 0xc39: 0x1fa1, 0xc3a: 0x1fb2, 0xc3b: 0x07bd, 0xc3c: 0x1fc2, 0xc3d: 0x1fd2, 0xc3e: 0x1fe2, 0xc3f: 0x0f71, // Block 0x31, offset 0xc40 0xc40: 0x1f41, 0xc41: 0x00c9, 0xc42: 0x0069, 0xc43: 0x0079, 0xc44: 0x1f51, 0xc45: 0x1f61, 0xc46: 0x1f71, 0xc47: 0x1f81, 0xc48: 0x1f91, 0xc49: 0x1fa1, 0xc4a: 0x1fb2, 0xc4b: 0x07d5, 0xc4c: 0x1fc2, 0xc4d: 0x1fd2, 0xc4e: 0x1fe2, 0xc4f: 0x0040, 0xc50: 0x0039, 0xc51: 0x0f09, 0xc52: 0x00d9, 0xc53: 0x0369, 0xc54: 0x0ff9, 0xc55: 0x0249, 0xc56: 0x0f51, 0xc57: 0x0359, 0xc58: 0x0f61, 0xc59: 0x0f71, 0xc5a: 0x0f99, 0xc5b: 0x01d9, 0xc5c: 0x0fa9, 0xc5d: 0x0040, 0xc5e: 0x0040, 0xc5f: 0x0040, 0xc60: 0x0018, 0xc61: 0x0018, 0xc62: 0x0018, 0xc63: 0x0018, 0xc64: 0x0018, 0xc65: 0x0018, 0xc66: 0x0018, 0xc67: 0x0018, 0xc68: 0x1ff1, 0xc69: 0x0018, 0xc6a: 0x0018, 0xc6b: 0x0018, 0xc6c: 0x0018, 0xc6d: 0x0018, 0xc6e: 0x0018, 0xc6f: 0x0018, 0xc70: 0x0018, 0xc71: 0x0018, 0xc72: 0x0018, 0xc73: 0x0018, 0xc74: 0x0018, 0xc75: 0x0018, 0xc76: 0x0018, 0xc77: 0x0018, 0xc78: 0x0018, 0xc79: 0x0018, 0xc7a: 0x0018, 0xc7b: 0x0018, 0xc7c: 0x0018, 0xc7d: 0x0018, 0xc7e: 0x0018, 0xc7f: 0x0018, // Block 0x32, offset 0xc80 0xc80: 0x07ee, 0xc81: 0x080e, 0xc82: 0x1159, 0xc83: 0x082d, 0xc84: 0x0018, 0xc85: 0x084e, 0xc86: 0x086e, 0xc87: 0x1011, 0xc88: 0x0018, 0xc89: 0x088d, 0xc8a: 0x0f31, 0xc8b: 0x0249, 0xc8c: 0x0249, 0xc8d: 0x0249, 0xc8e: 0x0249, 0xc8f: 0x2009, 0xc90: 0x0f41, 0xc91: 0x0f41, 0xc92: 0x0359, 0xc93: 0x0359, 0xc94: 0x0018, 0xc95: 0x0f71, 0xc96: 0x2021, 0xc97: 0x0018, 0xc98: 0x0018, 0xc99: 0x0f99, 0xc9a: 0x2039, 0xc9b: 0x0269, 0xc9c: 0x0269, 0xc9d: 0x0269, 0xc9e: 0x0018, 0xc9f: 0x0018, 0xca0: 0x2049, 0xca1: 0x08ad, 0xca2: 0x2061, 0xca3: 0x0018, 0xca4: 0x13d1, 0xca5: 0x0018, 0xca6: 0x2079, 0xca7: 0x0018, 0xca8: 0x13d1, 0xca9: 0x0018, 0xcaa: 0x0f51, 0xcab: 0x2091, 0xcac: 0x0ee9, 0xcad: 0x1159, 0xcae: 0x0018, 0xcaf: 0x0f09, 0xcb0: 0x0f09, 0xcb1: 0x1199, 0xcb2: 0x0040, 0xcb3: 0x0f61, 0xcb4: 0x00d9, 0xcb5: 0x20a9, 0xcb6: 0x20c1, 0xcb7: 0x20d9, 0xcb8: 0x20f1, 0xcb9: 0x0f41, 0xcba: 0x0018, 0xcbb: 0x08cd, 0xcbc: 0x2109, 0xcbd: 0x10b1, 0xcbe: 0x10b1, 0xcbf: 0x2109, // Block 0x33, offset 0xcc0 0xcc0: 0x08ed, 0xcc1: 0x0018, 0xcc2: 0x0018, 0xcc3: 0x0018, 0xcc4: 0x0018, 0xcc5: 0x0ef9, 0xcc6: 0x0ef9, 0xcc7: 0x0f09, 0xcc8: 0x0f41, 0xcc9: 0x0259, 0xcca: 0x0018, 0xccb: 0x0018, 0xccc: 0x0018, 0xccd: 0x0018, 0xcce: 0x0008, 0xccf: 0x0018, 0xcd0: 0x2121, 0xcd1: 0x2151, 0xcd2: 0x2181, 0xcd3: 0x21b9, 0xcd4: 0x21e9, 0xcd5: 0x2219, 0xcd6: 0x2249, 0xcd7: 0x2279, 0xcd8: 0x22a9, 0xcd9: 0x22d9, 0xcda: 0x2309, 0xcdb: 0x2339, 0xcdc: 0x2369, 0xcdd: 0x2399, 0xcde: 0x23c9, 0xcdf: 0x23f9, 0xce0: 0x0f41, 0xce1: 0x2421, 0xce2: 0x0905, 0xce3: 0x2439, 0xce4: 0x1089, 0xce5: 0x2451, 0xce6: 0x0925, 0xce7: 0x2469, 0xce8: 0x2491, 0xce9: 0x0369, 0xcea: 0x24a9, 0xceb: 0x0945, 0xcec: 0x0359, 0xced: 0x1159, 0xcee: 0x0ef9, 0xcef: 0x0f61, 0xcf0: 0x0f41, 0xcf1: 0x2421, 0xcf2: 0x0965, 0xcf3: 0x2439, 0xcf4: 0x1089, 0xcf5: 0x2451, 0xcf6: 0x0985, 0xcf7: 0x2469, 0xcf8: 0x2491, 0xcf9: 0x0369, 0xcfa: 0x24a9, 0xcfb: 0x09a5, 0xcfc: 0x0359, 0xcfd: 0x1159, 0xcfe: 0x0ef9, 0xcff: 0x0f61, // Block 0x34, offset 0xd00 0xd00: 0x0018, 0xd01: 0x0018, 0xd02: 0x0018, 0xd03: 0x0018, 0xd04: 0x0018, 0xd05: 0x0018, 0xd06: 0x0018, 0xd07: 0x0018, 0xd08: 0x0018, 0xd09: 0x0018, 0xd0a: 0x0018, 0xd0b: 0x0040, 0xd0c: 0x0040, 0xd0d: 0x0040, 0xd0e: 0x0040, 0xd0f: 0x0040, 0xd10: 0x0040, 0xd11: 0x0040, 0xd12: 0x0040, 0xd13: 0x0040, 0xd14: 0x0040, 0xd15: 0x0040, 0xd16: 0x0040, 0xd17: 0x0040, 0xd18: 0x0040, 0xd19: 0x0040, 0xd1a: 0x0040, 0xd1b: 0x0040, 0xd1c: 0x0040, 0xd1d: 0x0040, 0xd1e: 0x0040, 0xd1f: 0x0040, 0xd20: 0x00c9, 0xd21: 0x0069, 0xd22: 0x0079, 0xd23: 0x1f51, 0xd24: 0x1f61, 0xd25: 0x1f71, 0xd26: 0x1f81, 0xd27: 0x1f91, 0xd28: 0x1fa1, 0xd29: 0x2601, 0xd2a: 0x2619, 0xd2b: 0x2631, 0xd2c: 0x2649, 0xd2d: 0x2661, 0xd2e: 0x2679, 0xd2f: 0x2691, 0xd30: 0x26a9, 0xd31: 0x26c1, 0xd32: 0x26d9, 0xd33: 0x26f1, 0xd34: 0x0a06, 0xd35: 0x0a26, 0xd36: 0x0a46, 0xd37: 0x0a66, 0xd38: 0x0a86, 0xd39: 0x0aa6, 0xd3a: 0x0ac6, 0xd3b: 0x0ae6, 0xd3c: 0x0b06, 0xd3d: 0x270a, 0xd3e: 0x2732, 0xd3f: 0x275a, // Block 0x35, offset 0xd40 0xd40: 0x2782, 0xd41: 0x27aa, 0xd42: 0x27d2, 0xd43: 0x27fa, 0xd44: 0x2822, 0xd45: 0x284a, 0xd46: 0x2872, 0xd47: 0x289a, 0xd48: 0x0040, 0xd49: 0x0040, 0xd4a: 0x0040, 0xd4b: 0x0040, 0xd4c: 0x0040, 0xd4d: 0x0040, 0xd4e: 0x0040, 0xd4f: 0x0040, 0xd50: 0x0040, 0xd51: 0x0040, 0xd52: 0x0040, 0xd53: 0x0040, 0xd54: 0x0040, 0xd55: 0x0040, 0xd56: 0x0040, 0xd57: 0x0040, 0xd58: 0x0040, 0xd59: 0x0040, 0xd5a: 0x0040, 0xd5b: 0x0040, 0xd5c: 0x0b26, 0xd5d: 0x0b46, 0xd5e: 0x0b66, 0xd5f: 0x0b86, 0xd60: 0x0ba6, 0xd61: 0x0bc6, 0xd62: 0x0be6, 0xd63: 0x0c06, 0xd64: 0x0c26, 0xd65: 0x0c46, 0xd66: 0x0c66, 0xd67: 0x0c86, 0xd68: 0x0ca6, 0xd69: 0x0cc6, 0xd6a: 0x0ce6, 0xd6b: 0x0d06, 0xd6c: 0x0d26, 0xd6d: 0x0d46, 0xd6e: 0x0d66, 0xd6f: 0x0d86, 0xd70: 0x0da6, 0xd71: 0x0dc6, 0xd72: 0x0de6, 0xd73: 0x0e06, 0xd74: 0x0e26, 0xd75: 0x0e46, 0xd76: 0x0039, 0xd77: 0x0ee9, 0xd78: 0x1159, 0xd79: 0x0ef9, 0xd7a: 0x0f09, 0xd7b: 0x1199, 0xd7c: 0x0f31, 0xd7d: 0x0249, 0xd7e: 0x0f41, 0xd7f: 0x0259, // Block 0x36, offset 0xd80 0xd80: 0x0f51, 0xd81: 0x0359, 0xd82: 0x0f61, 0xd83: 0x0f71, 0xd84: 0x00d9, 0xd85: 0x0f99, 0xd86: 0x2039, 0xd87: 0x0269, 0xd88: 0x01d9, 0xd89: 0x0fa9, 0xd8a: 0x0fb9, 0xd8b: 0x1089, 0xd8c: 0x0279, 0xd8d: 0x0369, 0xd8e: 0x0289, 0xd8f: 0x13d1, 0xd90: 0x0039, 0xd91: 0x0ee9, 0xd92: 0x1159, 0xd93: 0x0ef9, 0xd94: 0x0f09, 0xd95: 0x1199, 0xd96: 0x0f31, 0xd97: 0x0249, 0xd98: 0x0f41, 0xd99: 0x0259, 0xd9a: 0x0f51, 0xd9b: 0x0359, 0xd9c: 0x0f61, 0xd9d: 0x0f71, 0xd9e: 0x00d9, 0xd9f: 0x0f99, 0xda0: 0x2039, 0xda1: 0x0269, 0xda2: 0x01d9, 0xda3: 0x0fa9, 0xda4: 0x0fb9, 0xda5: 0x1089, 0xda6: 0x0279, 0xda7: 0x0369, 0xda8: 0x0289, 0xda9: 0x13d1, 0xdaa: 0x1f41, 0xdab: 0x0018, 0xdac: 0x0018, 0xdad: 0x0018, 0xdae: 0x0018, 0xdaf: 0x0018, 0xdb0: 0x0018, 0xdb1: 0x0018, 0xdb2: 0x0018, 0xdb3: 0x0018, 0xdb4: 0x0018, 0xdb5: 0x0018, 0xdb6: 0x0018, 0xdb7: 0x0018, 0xdb8: 0x0018, 0xdb9: 0x0018, 0xdba: 0x0018, 0xdbb: 0x0018, 0xdbc: 0x0018, 0xdbd: 0x0018, 0xdbe: 0x0018, 0xdbf: 0x0018, // Block 0x37, offset 0xdc0 0xdc0: 0x0008, 0xdc1: 0x0008, 0xdc2: 0x0008, 0xdc3: 0x0008, 0xdc4: 0x0008, 0xdc5: 0x0008, 0xdc6: 0x0008, 0xdc7: 0x0008, 0xdc8: 0x0008, 0xdc9: 0x0008, 0xdca: 0x0008, 0xdcb: 0x0008, 0xdcc: 0x0008, 0xdcd: 0x0008, 0xdce: 0x0008, 0xdcf: 0x0008, 0xdd0: 0x0008, 0xdd1: 0x0008, 0xdd2: 0x0008, 0xdd3: 0x0008, 0xdd4: 0x0008, 0xdd5: 0x0008, 0xdd6: 0x0008, 0xdd7: 0x0008, 0xdd8: 0x0008, 0xdd9: 0x0008, 0xdda: 0x0008, 0xddb: 0x0008, 0xddc: 0x0008, 0xddd: 0x0008, 0xdde: 0x0008, 0xddf: 0x0040, 0xde0: 0xe00d, 0xde1: 0x0008, 0xde2: 0x2971, 0xde3: 0x0ebd, 0xde4: 0x2989, 0xde5: 0x0008, 0xde6: 0x0008, 0xde7: 0xe07d, 0xde8: 0x0008, 0xde9: 0xe01d, 0xdea: 0x0008, 0xdeb: 0xe03d, 0xdec: 0x0008, 0xded: 0x0fe1, 0xdee: 0x1281, 0xdef: 0x0fc9, 0xdf0: 0x1141, 0xdf1: 0x0008, 0xdf2: 0xe00d, 0xdf3: 0x0008, 0xdf4: 0x0008, 0xdf5: 0xe01d, 0xdf6: 0x0008, 0xdf7: 0x0008, 0xdf8: 0x0008, 0xdf9: 0x0008, 0xdfa: 0x0008, 0xdfb: 0x0008, 0xdfc: 0x0259, 0xdfd: 0x1089, 0xdfe: 0x29a1, 0xdff: 0x29b9, // Block 0x38, offset 0xe00 0xe00: 0xe00d, 0xe01: 0x0008, 0xe02: 0xe00d, 0xe03: 0x0008, 0xe04: 0xe00d, 0xe05: 0x0008, 0xe06: 0xe00d, 0xe07: 0x0008, 0xe08: 0xe00d, 0xe09: 0x0008, 0xe0a: 0xe00d, 0xe0b: 0x0008, 0xe0c: 0xe00d, 0xe0d: 0x0008, 0xe0e: 0xe00d, 0xe0f: 0x0008, 0xe10: 0xe00d, 0xe11: 0x0008, 0xe12: 0xe00d, 0xe13: 0x0008, 0xe14: 0xe00d, 0xe15: 0x0008, 0xe16: 0xe00d, 0xe17: 0x0008, 0xe18: 0xe00d, 0xe19: 0x0008, 0xe1a: 0xe00d, 0xe1b: 0x0008, 0xe1c: 0xe00d, 0xe1d: 0x0008, 0xe1e: 0xe00d, 0xe1f: 0x0008, 0xe20: 0xe00d, 0xe21: 0x0008, 0xe22: 0xe00d, 0xe23: 0x0008, 0xe24: 0x0008, 0xe25: 0x0018, 0xe26: 0x0018, 0xe27: 0x0018, 0xe28: 0x0018, 0xe29: 0x0018, 0xe2a: 0x0018, 0xe2b: 0xe03d, 0xe2c: 0x0008, 0xe2d: 0xe01d, 0xe2e: 0x0008, 0xe2f: 0x3308, 0xe30: 0x3308, 0xe31: 0x3308, 0xe32: 0xe00d, 0xe33: 0x0008, 0xe34: 0x0040, 0xe35: 0x0040, 0xe36: 0x0040, 0xe37: 0x0040, 0xe38: 0x0040, 0xe39: 0x0018, 0xe3a: 0x0018, 0xe3b: 0x0018, 0xe3c: 0x0018, 0xe3d: 0x0018, 0xe3e: 0x0018, 0xe3f: 0x0018, // Block 0x39, offset 0xe40 0xe40: 0x26fd, 0xe41: 0x271d, 0xe42: 0x273d, 0xe43: 0x275d, 0xe44: 0x277d, 0xe45: 0x279d, 0xe46: 0x27bd, 0xe47: 0x27dd, 0xe48: 0x27fd, 0xe49: 0x281d, 0xe4a: 0x283d, 0xe4b: 0x285d, 0xe4c: 0x287d, 0xe4d: 0x289d, 0xe4e: 0x28bd, 0xe4f: 0x28dd, 0xe50: 0x28fd, 0xe51: 0x291d, 0xe52: 0x293d, 0xe53: 0x295d, 0xe54: 0x297d, 0xe55: 0x299d, 0xe56: 0x0040, 0xe57: 0x0040, 0xe58: 0x0040, 0xe59: 0x0040, 0xe5a: 0x0040, 0xe5b: 0x0040, 0xe5c: 0x0040, 0xe5d: 0x0040, 0xe5e: 0x0040, 0xe5f: 0x0040, 0xe60: 0x0040, 0xe61: 0x0040, 0xe62: 0x0040, 0xe63: 0x0040, 0xe64: 0x0040, 0xe65: 0x0040, 0xe66: 0x0040, 0xe67: 0x0040, 0xe68: 0x0040, 0xe69: 0x0040, 0xe6a: 0x0040, 0xe6b: 0x0040, 0xe6c: 0x0040, 0xe6d: 0x0040, 0xe6e: 0x0040, 0xe6f: 0x0040, 0xe70: 0x0040, 0xe71: 0x0040, 0xe72: 0x0040, 0xe73: 0x0040, 0xe74: 0x0040, 0xe75: 0x0040, 0xe76: 0x0040, 0xe77: 0x0040, 0xe78: 0x0040, 0xe79: 0x0040, 0xe7a: 0x0040, 0xe7b: 0x0040, 0xe7c: 0x0040, 0xe7d: 0x0040, 0xe7e: 0x0040, 0xe7f: 0x0040, // Block 0x3a, offset 0xe80 0xe80: 0x000a, 0xe81: 0x0018, 0xe82: 0x29d1, 0xe83: 0x0018, 0xe84: 0x0018, 0xe85: 0x0008, 0xe86: 0x0008, 0xe87: 0x0008, 0xe88: 0x0018, 0xe89: 0x0018, 0xe8a: 0x0018, 0xe8b: 0x0018, 0xe8c: 0x0018, 0xe8d: 0x0018, 0xe8e: 0x0018, 0xe8f: 0x0018, 0xe90: 0x0018, 0xe91: 0x0018, 0xe92: 0x0018, 0xe93: 0x0018, 0xe94: 0x0018, 0xe95: 0x0018, 0xe96: 0x0018, 0xe97: 0x0018, 0xe98: 0x0018, 0xe99: 0x0018, 0xe9a: 0x0018, 0xe9b: 0x0018, 0xe9c: 0x0018, 0xe9d: 0x0018, 0xe9e: 0x0018, 0xe9f: 0x0018, 0xea0: 0x0018, 0xea1: 0x0018, 0xea2: 0x0018, 0xea3: 0x0018, 0xea4: 0x0018, 0xea5: 0x0018, 0xea6: 0x0018, 0xea7: 0x0018, 0xea8: 0x0018, 0xea9: 0x0018, 0xeaa: 0x3308, 0xeab: 0x3308, 0xeac: 0x3308, 0xead: 0x3308, 0xeae: 0x3018, 0xeaf: 0x3018, 0xeb0: 0x0018, 0xeb1: 0x0018, 0xeb2: 0x0018, 0xeb3: 0x0018, 0xeb4: 0x0018, 0xeb5: 0x0018, 0xeb6: 0xe125, 0xeb7: 0x0018, 0xeb8: 0x29bd, 0xeb9: 0x29dd, 0xeba: 0x29fd, 0xebb: 0x0018, 0xebc: 0x0008, 0xebd: 0x0018, 0xebe: 0x0018, 0xebf: 0x0018, // Block 0x3b, offset 0xec0 0xec0: 0x2b3d, 0xec1: 0x2b5d, 0xec2: 0x2b7d, 0xec3: 0x2b9d, 0xec4: 0x2bbd, 0xec5: 0x2bdd, 0xec6: 0x2bdd, 0xec7: 0x2bdd, 0xec8: 0x2bfd, 0xec9: 0x2bfd, 0xeca: 0x2bfd, 0xecb: 0x2bfd, 0xecc: 0x2c1d, 0xecd: 0x2c1d, 0xece: 0x2c1d, 0xecf: 0x2c3d, 0xed0: 0x2c5d, 0xed1: 0x2c5d, 0xed2: 0x2a7d, 0xed3: 0x2a7d, 0xed4: 0x2c5d, 0xed5: 0x2c5d, 0xed6: 0x2c7d, 0xed7: 0x2c7d, 0xed8: 0x2c5d, 0xed9: 0x2c5d, 0xeda: 0x2a7d, 0xedb: 0x2a7d, 0xedc: 0x2c5d, 0xedd: 0x2c5d, 0xede: 0x2c3d, 0xedf: 0x2c3d, 0xee0: 0x2c9d, 0xee1: 0x2c9d, 0xee2: 0x2cbd, 0xee3: 0x2cbd, 0xee4: 0x0040, 0xee5: 0x2cdd, 0xee6: 0x2cfd, 0xee7: 0x2d1d, 0xee8: 0x2d1d, 0xee9: 0x2d3d, 0xeea: 0x2d5d, 0xeeb: 0x2d7d, 0xeec: 0x2d9d, 0xeed: 0x2dbd, 0xeee: 0x2ddd, 0xeef: 0x2dfd, 0xef0: 0x2e1d, 0xef1: 0x2e3d, 0xef2: 0x2e3d, 0xef3: 0x2e5d, 0xef4: 0x2e7d, 0xef5: 0x2e7d, 0xef6: 0x2e9d, 0xef7: 0x2ebd, 0xef8: 0x2e5d, 0xef9: 0x2edd, 0xefa: 0x2efd, 0xefb: 0x2edd, 0xefc: 0x2e5d, 0xefd: 0x2f1d, 0xefe: 0x2f3d, 0xeff: 0x2f5d, // Block 0x3c, offset 0xf00 0xf00: 0x2f7d, 0xf01: 0x2f9d, 0xf02: 0x2cfd, 0xf03: 0x2cdd, 0xf04: 0x2fbd, 0xf05: 0x2fdd, 0xf06: 0x2ffd, 0xf07: 0x301d, 0xf08: 0x303d, 0xf09: 0x305d, 0xf0a: 0x307d, 0xf0b: 0x309d, 0xf0c: 0x30bd, 0xf0d: 0x30dd, 0xf0e: 0x30fd, 0xf0f: 0x0040, 0xf10: 0x0018, 0xf11: 0x0018, 0xf12: 0x311d, 0xf13: 0x313d, 0xf14: 0x315d, 0xf15: 0x317d, 0xf16: 0x319d, 0xf17: 0x31bd, 0xf18: 0x31dd, 0xf19: 0x31fd, 0xf1a: 0x321d, 0xf1b: 0x323d, 0xf1c: 0x315d, 0xf1d: 0x325d, 0xf1e: 0x327d, 0xf1f: 0x329d, 0xf20: 0x0008, 0xf21: 0x0008, 0xf22: 0x0008, 0xf23: 0x0008, 0xf24: 0x0008, 0xf25: 0x0008, 0xf26: 0x0008, 0xf27: 0x0008, 0xf28: 0x0008, 0xf29: 0x0008, 0xf2a: 0x0008, 0xf2b: 0x0008, 0xf2c: 0x0008, 0xf2d: 0x0008, 0xf2e: 0x0008, 0xf2f: 0x0008, 0xf30: 0x0008, 0xf31: 0x0008, 0xf32: 0x0008, 0xf33: 0x0008, 0xf34: 0x0008, 0xf35: 0x0008, 0xf36: 0x0008, 0xf37: 0x0008, 0xf38: 0x0008, 0xf39: 0x0008, 0xf3a: 0x0008, 0xf3b: 0x0040, 0xf3c: 0x0040, 0xf3d: 0x0040, 0xf3e: 0x0040, 0xf3f: 0x0040, // Block 0x3d, offset 0xf40 0xf40: 0x36a2, 0xf41: 0x36d2, 0xf42: 0x3702, 0xf43: 0x3732, 0xf44: 0x32bd, 0xf45: 0x32dd, 0xf46: 0x32fd, 0xf47: 0x331d, 0xf48: 0x0018, 0xf49: 0x0018, 0xf4a: 0x0018, 0xf4b: 0x0018, 0xf4c: 0x0018, 0xf4d: 0x0018, 0xf4e: 0x0018, 0xf4f: 0x0018, 0xf50: 0x333d, 0xf51: 0x3761, 0xf52: 0x3779, 0xf53: 0x3791, 0xf54: 0x37a9, 0xf55: 0x37c1, 0xf56: 0x37d9, 0xf57: 0x37f1, 0xf58: 0x3809, 0xf59: 0x3821, 0xf5a: 0x3839, 0xf5b: 0x3851, 0xf5c: 0x3869, 0xf5d: 0x3881, 0xf5e: 0x3899, 0xf5f: 0x38b1, 0xf60: 0x335d, 0xf61: 0x337d, 0xf62: 0x339d, 0xf63: 0x33bd, 0xf64: 0x33dd, 0xf65: 0x33dd, 0xf66: 0x33fd, 0xf67: 0x341d, 0xf68: 0x343d, 0xf69: 0x345d, 0xf6a: 0x347d, 0xf6b: 0x349d, 0xf6c: 0x34bd, 0xf6d: 0x34dd, 0xf6e: 0x34fd, 0xf6f: 0x351d, 0xf70: 0x353d, 0xf71: 0x355d, 0xf72: 0x357d, 0xf73: 0x359d, 0xf74: 0x35bd, 0xf75: 0x35dd, 0xf76: 0x35fd, 0xf77: 0x361d, 0xf78: 0x363d, 0xf79: 0x365d, 0xf7a: 0x367d, 0xf7b: 0x369d, 0xf7c: 0x38c9, 0xf7d: 0x3901, 0xf7e: 0x36bd, 0xf7f: 0x0018, // Block 0x3e, offset 0xf80 0xf80: 0x36dd, 0xf81: 0x36fd, 0xf82: 0x371d, 0xf83: 0x373d, 0xf84: 0x375d, 0xf85: 0x377d, 0xf86: 0x379d, 0xf87: 0x37bd, 0xf88: 0x37dd, 0xf89: 0x37fd, 0xf8a: 0x381d, 0xf8b: 0x383d, 0xf8c: 0x385d, 0xf8d: 0x387d, 0xf8e: 0x389d, 0xf8f: 0x38bd, 0xf90: 0x38dd, 0xf91: 0x38fd, 0xf92: 0x391d, 0xf93: 0x393d, 0xf94: 0x395d, 0xf95: 0x397d, 0xf96: 0x399d, 0xf97: 0x39bd, 0xf98: 0x39dd, 0xf99: 0x39fd, 0xf9a: 0x3a1d, 0xf9b: 0x3a3d, 0xf9c: 0x3a5d, 0xf9d: 0x3a7d, 0xf9e: 0x3a9d, 0xf9f: 0x3abd, 0xfa0: 0x3add, 0xfa1: 0x3afd, 0xfa2: 0x3b1d, 0xfa3: 0x3b3d, 0xfa4: 0x3b5d, 0xfa5: 0x3b7d, 0xfa6: 0x127d, 0xfa7: 0x3b9d, 0xfa8: 0x3bbd, 0xfa9: 0x3bdd, 0xfaa: 0x3bfd, 0xfab: 0x3c1d, 0xfac: 0x3c3d, 0xfad: 0x3c5d, 0xfae: 0x239d, 0xfaf: 0x3c7d, 0xfb0: 0x3c9d, 0xfb1: 0x3939, 0xfb2: 0x3951, 0xfb3: 0x3969, 0xfb4: 0x3981, 0xfb5: 0x3999, 0xfb6: 0x39b1, 0xfb7: 0x39c9, 0xfb8: 0x39e1, 0xfb9: 0x39f9, 0xfba: 0x3a11, 0xfbb: 0x3a29, 0xfbc: 0x3a41, 0xfbd: 0x3a59, 0xfbe: 0x3a71, 0xfbf: 0x3a89, // Block 0x3f, offset 0xfc0 0xfc0: 0x3aa1, 0xfc1: 0x3ac9, 0xfc2: 0x3af1, 0xfc3: 0x3b19, 0xfc4: 0x3b41, 0xfc5: 0x3b69, 0xfc6: 0x3b91, 0xfc7: 0x3bb9, 0xfc8: 0x3be1, 0xfc9: 0x3c09, 0xfca: 0x3c39, 0xfcb: 0x3c69, 0xfcc: 0x3c99, 0xfcd: 0x3cbd, 0xfce: 0x3cb1, 0xfcf: 0x3cdd, 0xfd0: 0x3cfd, 0xfd1: 0x3d15, 0xfd2: 0x3d2d, 0xfd3: 0x3d45, 0xfd4: 0x3d5d, 0xfd5: 0x3d5d, 0xfd6: 0x3d45, 0xfd7: 0x3d75, 0xfd8: 0x07bd, 0xfd9: 0x3d8d, 0xfda: 0x3da5, 0xfdb: 0x3dbd, 0xfdc: 0x3dd5, 0xfdd: 0x3ded, 0xfde: 0x3e05, 0xfdf: 0x3e1d, 0xfe0: 0x3e35, 0xfe1: 0x3e4d, 0xfe2: 0x3e65, 0xfe3: 0x3e7d, 0xfe4: 0x3e95, 0xfe5: 0x3e95, 0xfe6: 0x3ead, 0xfe7: 0x3ead, 0xfe8: 0x3ec5, 0xfe9: 0x3ec5, 0xfea: 0x3edd, 0xfeb: 0x3ef5, 0xfec: 0x3f0d, 0xfed: 0x3f25, 0xfee: 0x3f3d, 0xfef: 0x3f3d, 0xff0: 0x3f55, 0xff1: 0x3f55, 0xff2: 0x3f55, 0xff3: 0x3f6d, 0xff4: 0x3f85, 0xff5: 0x3f9d, 0xff6: 0x3fb5, 0xff7: 0x3f9d, 0xff8: 0x3fcd, 0xff9: 0x3fe5, 0xffa: 0x3f6d, 0xffb: 0x3ffd, 0xffc: 0x4015, 0xffd: 0x4015, 0xffe: 0x4015, 0xfff: 0x0040, // Block 0x40, offset 0x1000 0x1000: 0x3cc9, 0x1001: 0x3d31, 0x1002: 0x3d99, 0x1003: 0x3e01, 0x1004: 0x3e51, 0x1005: 0x3eb9, 0x1006: 0x3f09, 0x1007: 0x3f59, 0x1008: 0x3fd9, 0x1009: 0x4041, 0x100a: 0x4091, 0x100b: 0x40e1, 0x100c: 0x4131, 0x100d: 0x4199, 0x100e: 0x4201, 0x100f: 0x4251, 0x1010: 0x42a1, 0x1011: 0x42d9, 0x1012: 0x4329, 0x1013: 0x4391, 0x1014: 0x43f9, 0x1015: 0x4431, 0x1016: 0x44b1, 0x1017: 0x4549, 0x1018: 0x45c9, 0x1019: 0x4619, 0x101a: 0x4699, 0x101b: 0x4719, 0x101c: 0x4781, 0x101d: 0x47d1, 0x101e: 0x4821, 0x101f: 0x4871, 0x1020: 0x48d9, 0x1021: 0x4959, 0x1022: 0x49c1, 0x1023: 0x4a11, 0x1024: 0x4a61, 0x1025: 0x4ab1, 0x1026: 0x4ae9, 0x1027: 0x4b21, 0x1028: 0x4b59, 0x1029: 0x4b91, 0x102a: 0x4be1, 0x102b: 0x4c31, 0x102c: 0x4cb1, 0x102d: 0x4d01, 0x102e: 0x4d69, 0x102f: 0x4de9, 0x1030: 0x4e39, 0x1031: 0x4e71, 0x1032: 0x4ea9, 0x1033: 0x4f29, 0x1034: 0x4f91, 0x1035: 0x5011, 0x1036: 0x5061, 0x1037: 0x50e1, 0x1038: 0x5119, 0x1039: 0x5169, 0x103a: 0x51b9, 0x103b: 0x5209, 0x103c: 0x5259, 0x103d: 0x52a9, 0x103e: 0x5311, 0x103f: 0x5361, // Block 0x41, offset 0x1040 0x1040: 0x5399, 0x1041: 0x53e9, 0x1042: 0x5439, 0x1043: 0x5489, 0x1044: 0x54f1, 0x1045: 0x5541, 0x1046: 0x5591, 0x1047: 0x55e1, 0x1048: 0x5661, 0x1049: 0x56c9, 0x104a: 0x5701, 0x104b: 0x5781, 0x104c: 0x57b9, 0x104d: 0x5821, 0x104e: 0x5889, 0x104f: 0x58d9, 0x1050: 0x5929, 0x1051: 0x5979, 0x1052: 0x59e1, 0x1053: 0x5a19, 0x1054: 0x5a69, 0x1055: 0x5ad1, 0x1056: 0x5b09, 0x1057: 0x5b89, 0x1058: 0x5bd9, 0x1059: 0x5c01, 0x105a: 0x5c29, 0x105b: 0x5c51, 0x105c: 0x5c79, 0x105d: 0x5ca1, 0x105e: 0x5cc9, 0x105f: 0x5cf1, 0x1060: 0x5d19, 0x1061: 0x5d41, 0x1062: 0x5d69, 0x1063: 0x5d99, 0x1064: 0x5dc9, 0x1065: 0x5df9, 0x1066: 0x5e29, 0x1067: 0x5e59, 0x1068: 0x5e89, 0x1069: 0x5eb9, 0x106a: 0x5ee9, 0x106b: 0x5f19, 0x106c: 0x5f49, 0x106d: 0x5f79, 0x106e: 0x5fa9, 0x106f: 0x5fd9, 0x1070: 0x6009, 0x1071: 0x402d, 0x1072: 0x6039, 0x1073: 0x6051, 0x1074: 0x404d, 0x1075: 0x6069, 0x1076: 0x6081, 0x1077: 0x6099, 0x1078: 0x406d, 0x1079: 0x406d, 0x107a: 0x60b1, 0x107b: 0x60c9, 0x107c: 0x6101, 0x107d: 0x6139, 0x107e: 0x6171, 0x107f: 0x61a9, // Block 0x42, offset 0x1080 0x1080: 0x6211, 0x1081: 0x6229, 0x1082: 0x408d, 0x1083: 0x6241, 0x1084: 0x6259, 0x1085: 0x6271, 0x1086: 0x6289, 0x1087: 0x62a1, 0x1088: 0x40ad, 0x1089: 0x62b9, 0x108a: 0x62e1, 0x108b: 0x62f9, 0x108c: 0x40cd, 0x108d: 0x40cd, 0x108e: 0x6311, 0x108f: 0x6329, 0x1090: 0x6341, 0x1091: 0x40ed, 0x1092: 0x410d, 0x1093: 0x412d, 0x1094: 0x414d, 0x1095: 0x416d, 0x1096: 0x6359, 0x1097: 0x6371, 0x1098: 0x6389, 0x1099: 0x63a1, 0x109a: 0x63b9, 0x109b: 0x418d, 0x109c: 0x63d1, 0x109d: 0x63e9, 0x109e: 0x6401, 0x109f: 0x41ad, 0x10a0: 0x41cd, 0x10a1: 0x6419, 0x10a2: 0x41ed, 0x10a3: 0x420d, 0x10a4: 0x422d, 0x10a5: 0x6431, 0x10a6: 0x424d, 0x10a7: 0x6449, 0x10a8: 0x6479, 0x10a9: 0x6211, 0x10aa: 0x426d, 0x10ab: 0x428d, 0x10ac: 0x42ad, 0x10ad: 0x42cd, 0x10ae: 0x64b1, 0x10af: 0x64f1, 0x10b0: 0x6539, 0x10b1: 0x6551, 0x10b2: 0x42ed, 0x10b3: 0x6569, 0x10b4: 0x6581, 0x10b5: 0x6599, 0x10b6: 0x430d, 0x10b7: 0x65b1, 0x10b8: 0x65c9, 0x10b9: 0x65b1, 0x10ba: 0x65e1, 0x10bb: 0x65f9, 0x10bc: 0x432d, 0x10bd: 0x6611, 0x10be: 0x6629, 0x10bf: 0x6611, // Block 0x43, offset 0x10c0 0x10c0: 0x434d, 0x10c1: 0x436d, 0x10c2: 0x0040, 0x10c3: 0x6641, 0x10c4: 0x6659, 0x10c5: 0x6671, 0x10c6: 0x6689, 0x10c7: 0x0040, 0x10c8: 0x66c1, 0x10c9: 0x66d9, 0x10ca: 0x66f1, 0x10cb: 0x6709, 0x10cc: 0x6721, 0x10cd: 0x6739, 0x10ce: 0x6401, 0x10cf: 0x6751, 0x10d0: 0x6769, 0x10d1: 0x6781, 0x10d2: 0x438d, 0x10d3: 0x6799, 0x10d4: 0x6289, 0x10d5: 0x43ad, 0x10d6: 0x43cd, 0x10d7: 0x67b1, 0x10d8: 0x0040, 0x10d9: 0x43ed, 0x10da: 0x67c9, 0x10db: 0x67e1, 0x10dc: 0x67f9, 0x10dd: 0x6811, 0x10de: 0x6829, 0x10df: 0x6859, 0x10e0: 0x6889, 0x10e1: 0x68b1, 0x10e2: 0x68d9, 0x10e3: 0x6901, 0x10e4: 0x6929, 0x10e5: 0x6951, 0x10e6: 0x6979, 0x10e7: 0x69a1, 0x10e8: 0x69c9, 0x10e9: 0x69f1, 0x10ea: 0x6a21, 0x10eb: 0x6a51, 0x10ec: 0x6a81, 0x10ed: 0x6ab1, 0x10ee: 0x6ae1, 0x10ef: 0x6b11, 0x10f0: 0x6b41, 0x10f1: 0x6b71, 0x10f2: 0x6ba1, 0x10f3: 0x6bd1, 0x10f4: 0x6c01, 0x10f5: 0x6c31, 0x10f6: 0x6c61, 0x10f7: 0x6c91, 0x10f8: 0x6cc1, 0x10f9: 0x6cf1, 0x10fa: 0x6d21, 0x10fb: 0x6d51, 0x10fc: 0x6d81, 0x10fd: 0x6db1, 0x10fe: 0x6de1, 0x10ff: 0x440d, // Block 0x44, offset 0x1100 0x1100: 0xe00d, 0x1101: 0x0008, 0x1102: 0xe00d, 0x1103: 0x0008, 0x1104: 0xe00d, 0x1105: 0x0008, 0x1106: 0xe00d, 0x1107: 0x0008, 0x1108: 0xe00d, 0x1109: 0x0008, 0x110a: 0xe00d, 0x110b: 0x0008, 0x110c: 0xe00d, 0x110d: 0x0008, 0x110e: 0xe00d, 0x110f: 0x0008, 0x1110: 0xe00d, 0x1111: 0x0008, 0x1112: 0xe00d, 0x1113: 0x0008, 0x1114: 0xe00d, 0x1115: 0x0008, 0x1116: 0xe00d, 0x1117: 0x0008, 0x1118: 0xe00d, 0x1119: 0x0008, 0x111a: 0xe00d, 0x111b: 0x0008, 0x111c: 0xe00d, 0x111d: 0x0008, 0x111e: 0xe00d, 0x111f: 0x0008, 0x1120: 0xe00d, 0x1121: 0x0008, 0x1122: 0xe00d, 0x1123: 0x0008, 0x1124: 0xe00d, 0x1125: 0x0008, 0x1126: 0xe00d, 0x1127: 0x0008, 0x1128: 0xe00d, 0x1129: 0x0008, 0x112a: 0xe00d, 0x112b: 0x0008, 0x112c: 0xe00d, 0x112d: 0x0008, 0x112e: 0x0008, 0x112f: 0x3308, 0x1130: 0x3318, 0x1131: 0x3318, 0x1132: 0x3318, 0x1133: 0x0018, 0x1134: 0x3308, 0x1135: 0x3308, 0x1136: 0x3308, 0x1137: 0x3308, 0x1138: 0x3308, 0x1139: 0x3308, 0x113a: 0x3308, 0x113b: 0x3308, 0x113c: 0x3308, 0x113d: 0x3308, 0x113e: 0x0018, 0x113f: 0x0008, // Block 0x45, offset 0x1140 0x1140: 0xe00d, 0x1141: 0x0008, 0x1142: 0xe00d, 0x1143: 0x0008, 0x1144: 0xe00d, 0x1145: 0x0008, 0x1146: 0xe00d, 0x1147: 0x0008, 0x1148: 0xe00d, 0x1149: 0x0008, 0x114a: 0xe00d, 0x114b: 0x0008, 0x114c: 0xe00d, 0x114d: 0x0008, 0x114e: 0xe00d, 0x114f: 0x0008, 0x1150: 0xe00d, 0x1151: 0x0008, 0x1152: 0xe00d, 0x1153: 0x0008, 0x1154: 0xe00d, 0x1155: 0x0008, 0x1156: 0xe00d, 0x1157: 0x0008, 0x1158: 0xe00d, 0x1159: 0x0008, 0x115a: 0xe00d, 0x115b: 0x0008, 0x115c: 0x0ea1, 0x115d: 0x6e11, 0x115e: 0x3308, 0x115f: 0x3308, 0x1160: 0x0008, 0x1161: 0x0008, 0x1162: 0x0008, 0x1163: 0x0008, 0x1164: 0x0008, 0x1165: 0x0008, 0x1166: 0x0008, 0x1167: 0x0008, 0x1168: 0x0008, 0x1169: 0x0008, 0x116a: 0x0008, 0x116b: 0x0008, 0x116c: 0x0008, 0x116d: 0x0008, 0x116e: 0x0008, 0x116f: 0x0008, 0x1170: 0x0008, 0x1171: 0x0008, 0x1172: 0x0008, 0x1173: 0x0008, 0x1174: 0x0008, 0x1175: 0x0008, 0x1176: 0x0008, 0x1177: 0x0008, 0x1178: 0x0008, 0x1179: 0x0008, 0x117a: 0x0008, 0x117b: 0x0008, 0x117c: 0x0008, 0x117d: 0x0008, 0x117e: 0x0008, 0x117f: 0x0008, // Block 0x46, offset 0x1180 0x1180: 0x0018, 0x1181: 0x0018, 0x1182: 0x0018, 0x1183: 0x0018, 0x1184: 0x0018, 0x1185: 0x0018, 0x1186: 0x0018, 0x1187: 0x0018, 0x1188: 0x0018, 0x1189: 0x0018, 0x118a: 0x0018, 0x118b: 0x0018, 0x118c: 0x0018, 0x118d: 0x0018, 0x118e: 0x0018, 0x118f: 0x0018, 0x1190: 0x0018, 0x1191: 0x0018, 0x1192: 0x0018, 0x1193: 0x0018, 0x1194: 0x0018, 0x1195: 0x0018, 0x1196: 0x0018, 0x1197: 0x0008, 0x1198: 0x0008, 0x1199: 0x0008, 0x119a: 0x0008, 0x119b: 0x0008, 0x119c: 0x0008, 0x119d: 0x0008, 0x119e: 0x0008, 0x119f: 0x0008, 0x11a0: 0x0018, 0x11a1: 0x0018, 0x11a2: 0xe00d, 0x11a3: 0x0008, 0x11a4: 0xe00d, 0x11a5: 0x0008, 0x11a6: 0xe00d, 0x11a7: 0x0008, 0x11a8: 0xe00d, 0x11a9: 0x0008, 0x11aa: 0xe00d, 0x11ab: 0x0008, 0x11ac: 0xe00d, 0x11ad: 0x0008, 0x11ae: 0xe00d, 0x11af: 0x0008, 0x11b0: 0x0008, 0x11b1: 0x0008, 0x11b2: 0xe00d, 0x11b3: 0x0008, 0x11b4: 0xe00d, 0x11b5: 0x0008, 0x11b6: 0xe00d, 0x11b7: 0x0008, 0x11b8: 0xe00d, 0x11b9: 0x0008, 0x11ba: 0xe00d, 0x11bb: 0x0008, 0x11bc: 0xe00d, 0x11bd: 0x0008, 0x11be: 0xe00d, 0x11bf: 0x0008, // Block 0x47, offset 0x11c0 0x11c0: 0xe00d, 0x11c1: 0x0008, 0x11c2: 0xe00d, 0x11c3: 0x0008, 0x11c4: 0xe00d, 0x11c5: 0x0008, 0x11c6: 0xe00d, 0x11c7: 0x0008, 0x11c8: 0xe00d, 0x11c9: 0x0008, 0x11ca: 0xe00d, 0x11cb: 0x0008, 0x11cc: 0xe00d, 0x11cd: 0x0008, 0x11ce: 0xe00d, 0x11cf: 0x0008, 0x11d0: 0xe00d, 0x11d1: 0x0008, 0x11d2: 0xe00d, 0x11d3: 0x0008, 0x11d4: 0xe00d, 0x11d5: 0x0008, 0x11d6: 0xe00d, 0x11d7: 0x0008, 0x11d8: 0xe00d, 0x11d9: 0x0008, 0x11da: 0xe00d, 0x11db: 0x0008, 0x11dc: 0xe00d, 0x11dd: 0x0008, 0x11de: 0xe00d, 0x11df: 0x0008, 0x11e0: 0xe00d, 0x11e1: 0x0008, 0x11e2: 0xe00d, 0x11e3: 0x0008, 0x11e4: 0xe00d, 0x11e5: 0x0008, 0x11e6: 0xe00d, 0x11e7: 0x0008, 0x11e8: 0xe00d, 0x11e9: 0x0008, 0x11ea: 0xe00d, 0x11eb: 0x0008, 0x11ec: 0xe00d, 0x11ed: 0x0008, 0x11ee: 0xe00d, 0x11ef: 0x0008, 0x11f0: 0xe0fd, 0x11f1: 0x0008, 0x11f2: 0x0008, 0x11f3: 0x0008, 0x11f4: 0x0008, 0x11f5: 0x0008, 0x11f6: 0x0008, 0x11f7: 0x0008, 0x11f8: 0x0008, 0x11f9: 0xe01d, 0x11fa: 0x0008, 0x11fb: 0xe03d, 0x11fc: 0x0008, 0x11fd: 0x442d, 0x11fe: 0xe00d, 0x11ff: 0x0008, // Block 0x48, offset 0x1200 0x1200: 0xe00d, 0x1201: 0x0008, 0x1202: 0xe00d, 0x1203: 0x0008, 0x1204: 0xe00d, 0x1205: 0x0008, 0x1206: 0xe00d, 0x1207: 0x0008, 0x1208: 0x0008, 0x1209: 0x0018, 0x120a: 0x0018, 0x120b: 0xe03d, 0x120c: 0x0008, 0x120d: 0x11d9, 0x120e: 0x0008, 0x120f: 0x0008, 0x1210: 0xe00d, 0x1211: 0x0008, 0x1212: 0xe00d, 0x1213: 0x0008, 0x1214: 0x0008, 0x1215: 0x0008, 0x1216: 0xe00d, 0x1217: 0x0008, 0x1218: 0xe00d, 0x1219: 0x0008, 0x121a: 0xe00d, 0x121b: 0x0008, 0x121c: 0xe00d, 0x121d: 0x0008, 0x121e: 0xe00d, 0x121f: 0x0008, 0x1220: 0xe00d, 0x1221: 0x0008, 0x1222: 0xe00d, 0x1223: 0x0008, 0x1224: 0xe00d, 0x1225: 0x0008, 0x1226: 0xe00d, 0x1227: 0x0008, 0x1228: 0xe00d, 0x1229: 0x0008, 0x122a: 0x6e29, 0x122b: 0x1029, 0x122c: 0x11c1, 0x122d: 0x6e41, 0x122e: 0x1221, 0x122f: 0x0008, 0x1230: 0x6e59, 0x1231: 0x6e71, 0x1232: 0x1239, 0x1233: 0x444d, 0x1234: 0xe00d, 0x1235: 0x0008, 0x1236: 0xe00d, 0x1237: 0x0008, 0x1238: 0x0040, 0x1239: 0x0008, 0x123a: 0x0040, 0x123b: 0x0040, 0x123c: 0x0040, 0x123d: 0x0040, 0x123e: 0x0040, 0x123f: 0x0040, // Block 0x49, offset 0x1240 0x1240: 0x64d5, 0x1241: 0x64f5, 0x1242: 0x6515, 0x1243: 0x6535, 0x1244: 0x6555, 0x1245: 0x6575, 0x1246: 0x6595, 0x1247: 0x65b5, 0x1248: 0x65d5, 0x1249: 0x65f5, 0x124a: 0x6615, 0x124b: 0x6635, 0x124c: 0x6655, 0x124d: 0x6675, 0x124e: 0x0008, 0x124f: 0x0008, 0x1250: 0x6695, 0x1251: 0x0008, 0x1252: 0x66b5, 0x1253: 0x0008, 0x1254: 0x0008, 0x1255: 0x66d5, 0x1256: 0x66f5, 0x1257: 0x6715, 0x1258: 0x6735, 0x1259: 0x6755, 0x125a: 0x6775, 0x125b: 0x6795, 0x125c: 0x67b5, 0x125d: 0x67d5, 0x125e: 0x67f5, 0x125f: 0x0008, 0x1260: 0x6815, 0x1261: 0x0008, 0x1262: 0x6835, 0x1263: 0x0008, 0x1264: 0x0008, 0x1265: 0x6855, 0x1266: 0x6875, 0x1267: 0x0008, 0x1268: 0x0008, 0x1269: 0x0008, 0x126a: 0x6895, 0x126b: 0x68b5, 0x126c: 0x68d5, 0x126d: 0x68f5, 0x126e: 0x6915, 0x126f: 0x6935, 0x1270: 0x6955, 0x1271: 0x6975, 0x1272: 0x6995, 0x1273: 0x69b5, 0x1274: 0x69d5, 0x1275: 0x69f5, 0x1276: 0x6a15, 0x1277: 0x6a35, 0x1278: 0x6a55, 0x1279: 0x6a75, 0x127a: 0x6a95, 0x127b: 0x6ab5, 0x127c: 0x6ad5, 0x127d: 0x6af5, 0x127e: 0x6b15, 0x127f: 0x6b35, // Block 0x4a, offset 0x1280 0x1280: 0x7a95, 0x1281: 0x7ab5, 0x1282: 0x7ad5, 0x1283: 0x7af5, 0x1284: 0x7b15, 0x1285: 0x7b35, 0x1286: 0x7b55, 0x1287: 0x7b75, 0x1288: 0x7b95, 0x1289: 0x7bb5, 0x128a: 0x7bd5, 0x128b: 0x7bf5, 0x128c: 0x7c15, 0x128d: 0x7c35, 0x128e: 0x7c55, 0x128f: 0x6ec9, 0x1290: 0x6ef1, 0x1291: 0x6f19, 0x1292: 0x7c75, 0x1293: 0x7c95, 0x1294: 0x7cb5, 0x1295: 0x6f41, 0x1296: 0x6f69, 0x1297: 0x6f91, 0x1298: 0x7cd5, 0x1299: 0x7cf5, 0x129a: 0x0040, 0x129b: 0x0040, 0x129c: 0x0040, 0x129d: 0x0040, 0x129e: 0x0040, 0x129f: 0x0040, 0x12a0: 0x0040, 0x12a1: 0x0040, 0x12a2: 0x0040, 0x12a3: 0x0040, 0x12a4: 0x0040, 0x12a5: 0x0040, 0x12a6: 0x0040, 0x12a7: 0x0040, 0x12a8: 0x0040, 0x12a9: 0x0040, 0x12aa: 0x0040, 0x12ab: 0x0040, 0x12ac: 0x0040, 0x12ad: 0x0040, 0x12ae: 0x0040, 0x12af: 0x0040, 0x12b0: 0x0040, 0x12b1: 0x0040, 0x12b2: 0x0040, 0x12b3: 0x0040, 0x12b4: 0x0040, 0x12b5: 0x0040, 0x12b6: 0x0040, 0x12b7: 0x0040, 0x12b8: 0x0040, 0x12b9: 0x0040, 0x12ba: 0x0040, 0x12bb: 0x0040, 0x12bc: 0x0040, 0x12bd: 0x0040, 0x12be: 0x0040, 0x12bf: 0x0040, // Block 0x4b, offset 0x12c0 0x12c0: 0x6fb9, 0x12c1: 0x6fd1, 0x12c2: 0x6fe9, 0x12c3: 0x7d15, 0x12c4: 0x7d35, 0x12c5: 0x7001, 0x12c6: 0x7001, 0x12c7: 0x0040, 0x12c8: 0x0040, 0x12c9: 0x0040, 0x12ca: 0x0040, 0x12cb: 0x0040, 0x12cc: 0x0040, 0x12cd: 0x0040, 0x12ce: 0x0040, 0x12cf: 0x0040, 0x12d0: 0x0040, 0x12d1: 0x0040, 0x12d2: 0x0040, 0x12d3: 0x7019, 0x12d4: 0x7041, 0x12d5: 0x7069, 0x12d6: 0x7091, 0x12d7: 0x70b9, 0x12d8: 0x0040, 0x12d9: 0x0040, 0x12da: 0x0040, 0x12db: 0x0040, 0x12dc: 0x0040, 0x12dd: 0x70e1, 0x12de: 0x3308, 0x12df: 0x7109, 0x12e0: 0x7131, 0x12e1: 0x20a9, 0x12e2: 0x20f1, 0x12e3: 0x7149, 0x12e4: 0x7161, 0x12e5: 0x7179, 0x12e6: 0x7191, 0x12e7: 0x71a9, 0x12e8: 0x71c1, 0x12e9: 0x1fb2, 0x12ea: 0x71d9, 0x12eb: 0x7201, 0x12ec: 0x7229, 0x12ed: 0x7261, 0x12ee: 0x7299, 0x12ef: 0x72c1, 0x12f0: 0x72e9, 0x12f1: 0x7311, 0x12f2: 0x7339, 0x12f3: 0x7361, 0x12f4: 0x7389, 0x12f5: 0x73b1, 0x12f6: 0x73d9, 0x12f7: 0x0040, 0x12f8: 0x7401, 0x12f9: 0x7429, 0x12fa: 0x7451, 0x12fb: 0x7479, 0x12fc: 0x74a1, 0x12fd: 0x0040, 0x12fe: 0x74c9, 0x12ff: 0x0040, // Block 0x4c, offset 0x1300 0x1300: 0x74f1, 0x1301: 0x7519, 0x1302: 0x0040, 0x1303: 0x7541, 0x1304: 0x7569, 0x1305: 0x0040, 0x1306: 0x7591, 0x1307: 0x75b9, 0x1308: 0x75e1, 0x1309: 0x7609, 0x130a: 0x7631, 0x130b: 0x7659, 0x130c: 0x7681, 0x130d: 0x76a9, 0x130e: 0x76d1, 0x130f: 0x76f9, 0x1310: 0x7721, 0x1311: 0x7721, 0x1312: 0x7739, 0x1313: 0x7739, 0x1314: 0x7739, 0x1315: 0x7739, 0x1316: 0x7751, 0x1317: 0x7751, 0x1318: 0x7751, 0x1319: 0x7751, 0x131a: 0x7769, 0x131b: 0x7769, 0x131c: 0x7769, 0x131d: 0x7769, 0x131e: 0x7781, 0x131f: 0x7781, 0x1320: 0x7781, 0x1321: 0x7781, 0x1322: 0x7799, 0x1323: 0x7799, 0x1324: 0x7799, 0x1325: 0x7799, 0x1326: 0x77b1, 0x1327: 0x77b1, 0x1328: 0x77b1, 0x1329: 0x77b1, 0x132a: 0x77c9, 0x132b: 0x77c9, 0x132c: 0x77c9, 0x132d: 0x77c9, 0x132e: 0x77e1, 0x132f: 0x77e1, 0x1330: 0x77e1, 0x1331: 0x77e1, 0x1332: 0x77f9, 0x1333: 0x77f9, 0x1334: 0x77f9, 0x1335: 0x77f9, 0x1336: 0x7811, 0x1337: 0x7811, 0x1338: 0x7811, 0x1339: 0x7811, 0x133a: 0x7829, 0x133b: 0x7829, 0x133c: 0x7829, 0x133d: 0x7829, 0x133e: 0x7841, 0x133f: 0x7841, // Block 0x4d, offset 0x1340 0x1340: 0x7841, 0x1341: 0x7841, 0x1342: 0x7859, 0x1343: 0x7859, 0x1344: 0x7871, 0x1345: 0x7871, 0x1346: 0x7889, 0x1347: 0x7889, 0x1348: 0x78a1, 0x1349: 0x78a1, 0x134a: 0x78b9, 0x134b: 0x78b9, 0x134c: 0x78d1, 0x134d: 0x78d1, 0x134e: 0x78e9, 0x134f: 0x78e9, 0x1350: 0x78e9, 0x1351: 0x78e9, 0x1352: 0x7901, 0x1353: 0x7901, 0x1354: 0x7901, 0x1355: 0x7901, 0x1356: 0x7919, 0x1357: 0x7919, 0x1358: 0x7919, 0x1359: 0x7919, 0x135a: 0x7931, 0x135b: 0x7931, 0x135c: 0x7931, 0x135d: 0x7931, 0x135e: 0x7949, 0x135f: 0x7949, 0x1360: 0x7961, 0x1361: 0x7961, 0x1362: 0x7961, 0x1363: 0x7961, 0x1364: 0x7979, 0x1365: 0x7979, 0x1366: 0x7991, 0x1367: 0x7991, 0x1368: 0x7991, 0x1369: 0x7991, 0x136a: 0x79a9, 0x136b: 0x79a9, 0x136c: 0x79a9, 0x136d: 0x79a9, 0x136e: 0x79c1, 0x136f: 0x79c1, 0x1370: 0x79d9, 0x1371: 0x79d9, 0x1372: 0x0818, 0x1373: 0x0818, 0x1374: 0x0818, 0x1375: 0x0818, 0x1376: 0x0818, 0x1377: 0x0818, 0x1378: 0x0818, 0x1379: 0x0818, 0x137a: 0x0818, 0x137b: 0x0818, 0x137c: 0x0818, 0x137d: 0x0818, 0x137e: 0x0818, 0x137f: 0x0818, // Block 0x4e, offset 0x1380 0x1380: 0x0818, 0x1381: 0x0818, 0x1382: 0x0040, 0x1383: 0x0040, 0x1384: 0x0040, 0x1385: 0x0040, 0x1386: 0x0040, 0x1387: 0x0040, 0x1388: 0x0040, 0x1389: 0x0040, 0x138a: 0x0040, 0x138b: 0x0040, 0x138c: 0x0040, 0x138d: 0x0040, 0x138e: 0x0040, 0x138f: 0x0040, 0x1390: 0x0040, 0x1391: 0x0040, 0x1392: 0x0040, 0x1393: 0x79f1, 0x1394: 0x79f1, 0x1395: 0x79f1, 0x1396: 0x79f1, 0x1397: 0x7a09, 0x1398: 0x7a09, 0x1399: 0x7a21, 0x139a: 0x7a21, 0x139b: 0x7a39, 0x139c: 0x7a39, 0x139d: 0x0479, 0x139e: 0x7a51, 0x139f: 0x7a51, 0x13a0: 0x7a69, 0x13a1: 0x7a69, 0x13a2: 0x7a81, 0x13a3: 0x7a81, 0x13a4: 0x7a99, 0x13a5: 0x7a99, 0x13a6: 0x7a99, 0x13a7: 0x7a99, 0x13a8: 0x7ab1, 0x13a9: 0x7ab1, 0x13aa: 0x7ac9, 0x13ab: 0x7ac9, 0x13ac: 0x7af1, 0x13ad: 0x7af1, 0x13ae: 0x7b19, 0x13af: 0x7b19, 0x13b0: 0x7b41, 0x13b1: 0x7b41, 0x13b2: 0x7b69, 0x13b3: 0x7b69, 0x13b4: 0x7b91, 0x13b5: 0x7b91, 0x13b6: 0x7bb9, 0x13b7: 0x7bb9, 0x13b8: 0x7bb9, 0x13b9: 0x7be1, 0x13ba: 0x7be1, 0x13bb: 0x7be1, 0x13bc: 0x7c09, 0x13bd: 0x7c09, 0x13be: 0x7c09, 0x13bf: 0x7c09, // Block 0x4f, offset 0x13c0 0x13c0: 0x85f9, 0x13c1: 0x8621, 0x13c2: 0x8649, 0x13c3: 0x8671, 0x13c4: 0x8699, 0x13c5: 0x86c1, 0x13c6: 0x86e9, 0x13c7: 0x8711, 0x13c8: 0x8739, 0x13c9: 0x8761, 0x13ca: 0x8789, 0x13cb: 0x87b1, 0x13cc: 0x87d9, 0x13cd: 0x8801, 0x13ce: 0x8829, 0x13cf: 0x8851, 0x13d0: 0x8879, 0x13d1: 0x88a1, 0x13d2: 0x88c9, 0x13d3: 0x88f1, 0x13d4: 0x8919, 0x13d5: 0x8941, 0x13d6: 0x8969, 0x13d7: 0x8991, 0x13d8: 0x89b9, 0x13d9: 0x89e1, 0x13da: 0x8a09, 0x13db: 0x8a31, 0x13dc: 0x8a59, 0x13dd: 0x8a81, 0x13de: 0x8aaa, 0x13df: 0x8ada, 0x13e0: 0x8b0a, 0x13e1: 0x8b3a, 0x13e2: 0x8b6a, 0x13e3: 0x8b9a, 0x13e4: 0x8bc9, 0x13e5: 0x8bf1, 0x13e6: 0x7c71, 0x13e7: 0x8c19, 0x13e8: 0x7be1, 0x13e9: 0x7c99, 0x13ea: 0x8c41, 0x13eb: 0x8c69, 0x13ec: 0x7d39, 0x13ed: 0x8c91, 0x13ee: 0x7d61, 0x13ef: 0x7d89, 0x13f0: 0x8cb9, 0x13f1: 0x8ce1, 0x13f2: 0x7e29, 0x13f3: 0x8d09, 0x13f4: 0x7e51, 0x13f5: 0x7e79, 0x13f6: 0x8d31, 0x13f7: 0x8d59, 0x13f8: 0x7ec9, 0x13f9: 0x8d81, 0x13fa: 0x7ef1, 0x13fb: 0x7f19, 0x13fc: 0x83a1, 0x13fd: 0x83c9, 0x13fe: 0x8441, 0x13ff: 0x8469, // Block 0x50, offset 0x1400 0x1400: 0x8491, 0x1401: 0x8531, 0x1402: 0x8559, 0x1403: 0x8581, 0x1404: 0x85a9, 0x1405: 0x8649, 0x1406: 0x8671, 0x1407: 0x8699, 0x1408: 0x8da9, 0x1409: 0x8739, 0x140a: 0x8dd1, 0x140b: 0x8df9, 0x140c: 0x8829, 0x140d: 0x8e21, 0x140e: 0x8851, 0x140f: 0x8879, 0x1410: 0x8a81, 0x1411: 0x8e49, 0x1412: 0x8e71, 0x1413: 0x89b9, 0x1414: 0x8e99, 0x1415: 0x89e1, 0x1416: 0x8a09, 0x1417: 0x7c21, 0x1418: 0x7c49, 0x1419: 0x8ec1, 0x141a: 0x7c71, 0x141b: 0x8ee9, 0x141c: 0x7cc1, 0x141d: 0x7ce9, 0x141e: 0x7d11, 0x141f: 0x7d39, 0x1420: 0x8f11, 0x1421: 0x7db1, 0x1422: 0x7dd9, 0x1423: 0x7e01, 0x1424: 0x7e29, 0x1425: 0x8f39, 0x1426: 0x7ec9, 0x1427: 0x7f41, 0x1428: 0x7f69, 0x1429: 0x7f91, 0x142a: 0x7fb9, 0x142b: 0x7fe1, 0x142c: 0x8031, 0x142d: 0x8059, 0x142e: 0x8081, 0x142f: 0x80a9, 0x1430: 0x80d1, 0x1431: 0x80f9, 0x1432: 0x8f61, 0x1433: 0x8121, 0x1434: 0x8149, 0x1435: 0x8171, 0x1436: 0x8199, 0x1437: 0x81c1, 0x1438: 0x81e9, 0x1439: 0x8239, 0x143a: 0x8261, 0x143b: 0x8289, 0x143c: 0x82b1, 0x143d: 0x82d9, 0x143e: 0x8301, 0x143f: 0x8329, // Block 0x51, offset 0x1440 0x1440: 0x8351, 0x1441: 0x8379, 0x1442: 0x83f1, 0x1443: 0x8419, 0x1444: 0x84b9, 0x1445: 0x84e1, 0x1446: 0x8509, 0x1447: 0x8531, 0x1448: 0x8559, 0x1449: 0x85d1, 0x144a: 0x85f9, 0x144b: 0x8621, 0x144c: 0x8649, 0x144d: 0x8f89, 0x144e: 0x86c1, 0x144f: 0x86e9, 0x1450: 0x8711, 0x1451: 0x8739, 0x1452: 0x87b1, 0x1453: 0x87d9, 0x1454: 0x8801, 0x1455: 0x8829, 0x1456: 0x8fb1, 0x1457: 0x88a1, 0x1458: 0x88c9, 0x1459: 0x8fd9, 0x145a: 0x8941, 0x145b: 0x8969, 0x145c: 0x8991, 0x145d: 0x89b9, 0x145e: 0x9001, 0x145f: 0x7c71, 0x1460: 0x8ee9, 0x1461: 0x7d39, 0x1462: 0x8f11, 0x1463: 0x7e29, 0x1464: 0x8f39, 0x1465: 0x7ec9, 0x1466: 0x9029, 0x1467: 0x80d1, 0x1468: 0x9051, 0x1469: 0x9079, 0x146a: 0x90a1, 0x146b: 0x8531, 0x146c: 0x8559, 0x146d: 0x8649, 0x146e: 0x8829, 0x146f: 0x8fb1, 0x1470: 0x89b9, 0x1471: 0x9001, 0x1472: 0x90c9, 0x1473: 0x9101, 0x1474: 0x9139, 0x1475: 0x9171, 0x1476: 0x9199, 0x1477: 0x91c1, 0x1478: 0x91e9, 0x1479: 0x9211, 0x147a: 0x9239, 0x147b: 0x9261, 0x147c: 0x9289, 0x147d: 0x92b1, 0x147e: 0x92d9, 0x147f: 0x9301, // Block 0x52, offset 0x1480 0x1480: 0x9329, 0x1481: 0x9351, 0x1482: 0x9379, 0x1483: 0x93a1, 0x1484: 0x93c9, 0x1485: 0x93f1, 0x1486: 0x9419, 0x1487: 0x9441, 0x1488: 0x9469, 0x1489: 0x9491, 0x148a: 0x94b9, 0x148b: 0x94e1, 0x148c: 0x9079, 0x148d: 0x9509, 0x148e: 0x9531, 0x148f: 0x9559, 0x1490: 0x9581, 0x1491: 0x9171, 0x1492: 0x9199, 0x1493: 0x91c1, 0x1494: 0x91e9, 0x1495: 0x9211, 0x1496: 0x9239, 0x1497: 0x9261, 0x1498: 0x9289, 0x1499: 0x92b1, 0x149a: 0x92d9, 0x149b: 0x9301, 0x149c: 0x9329, 0x149d: 0x9351, 0x149e: 0x9379, 0x149f: 0x93a1, 0x14a0: 0x93c9, 0x14a1: 0x93f1, 0x14a2: 0x9419, 0x14a3: 0x9441, 0x14a4: 0x9469, 0x14a5: 0x9491, 0x14a6: 0x94b9, 0x14a7: 0x94e1, 0x14a8: 0x9079, 0x14a9: 0x9509, 0x14aa: 0x9531, 0x14ab: 0x9559, 0x14ac: 0x9581, 0x14ad: 0x9491, 0x14ae: 0x94b9, 0x14af: 0x94e1, 0x14b0: 0x9079, 0x14b1: 0x9051, 0x14b2: 0x90a1, 0x14b3: 0x8211, 0x14b4: 0x8059, 0x14b5: 0x8081, 0x14b6: 0x80a9, 0x14b7: 0x9491, 0x14b8: 0x94b9, 0x14b9: 0x94e1, 0x14ba: 0x8211, 0x14bb: 0x8239, 0x14bc: 0x95a9, 0x14bd: 0x95a9, 0x14be: 0x0018, 0x14bf: 0x0018, // Block 0x53, offset 0x14c0 0x14c0: 0x0040, 0x14c1: 0x0040, 0x14c2: 0x0040, 0x14c3: 0x0040, 0x14c4: 0x0040, 0x14c5: 0x0040, 0x14c6: 0x0040, 0x14c7: 0x0040, 0x14c8: 0x0040, 0x14c9: 0x0040, 0x14ca: 0x0040, 0x14cb: 0x0040, 0x14cc: 0x0040, 0x14cd: 0x0040, 0x14ce: 0x0040, 0x14cf: 0x0040, 0x14d0: 0x95d1, 0x14d1: 0x9609, 0x14d2: 0x9609, 0x14d3: 0x9641, 0x14d4: 0x9679, 0x14d5: 0x96b1, 0x14d6: 0x96e9, 0x14d7: 0x9721, 0x14d8: 0x9759, 0x14d9: 0x9759, 0x14da: 0x9791, 0x14db: 0x97c9, 0x14dc: 0x9801, 0x14dd: 0x9839, 0x14de: 0x9871, 0x14df: 0x98a9, 0x14e0: 0x98a9, 0x14e1: 0x98e1, 0x14e2: 0x9919, 0x14e3: 0x9919, 0x14e4: 0x9951, 0x14e5: 0x9951, 0x14e6: 0x9989, 0x14e7: 0x99c1, 0x14e8: 0x99c1, 0x14e9: 0x99f9, 0x14ea: 0x9a31, 0x14eb: 0x9a31, 0x14ec: 0x9a69, 0x14ed: 0x9a69, 0x14ee: 0x9aa1, 0x14ef: 0x9ad9, 0x14f0: 0x9ad9, 0x14f1: 0x9b11, 0x14f2: 0x9b11, 0x14f3: 0x9b49, 0x14f4: 0x9b81, 0x14f5: 0x9bb9, 0x14f6: 0x9bf1, 0x14f7: 0x9bf1, 0x14f8: 0x9c29, 0x14f9: 0x9c61, 0x14fa: 0x9c99, 0x14fb: 0x9cd1, 0x14fc: 0x9d09, 0x14fd: 0x9d09, 0x14fe: 0x9d41, 0x14ff: 0x9d79, // Block 0x54, offset 0x1500 0x1500: 0xa949, 0x1501: 0xa981, 0x1502: 0xa9b9, 0x1503: 0xa8a1, 0x1504: 0x9bb9, 0x1505: 0x9989, 0x1506: 0xa9f1, 0x1507: 0xaa29, 0x1508: 0x0040, 0x1509: 0x0040, 0x150a: 0x0040, 0x150b: 0x0040, 0x150c: 0x0040, 0x150d: 0x0040, 0x150e: 0x0040, 0x150f: 0x0040, 0x1510: 0x0040, 0x1511: 0x0040, 0x1512: 0x0040, 0x1513: 0x0040, 0x1514: 0x0040, 0x1515: 0x0040, 0x1516: 0x0040, 0x1517: 0x0040, 0x1518: 0x0040, 0x1519: 0x0040, 0x151a: 0x0040, 0x151b: 0x0040, 0x151c: 0x0040, 0x151d: 0x0040, 0x151e: 0x0040, 0x151f: 0x0040, 0x1520: 0x0040, 0x1521: 0x0040, 0x1522: 0x0040, 0x1523: 0x0040, 0x1524: 0x0040, 0x1525: 0x0040, 0x1526: 0x0040, 0x1527: 0x0040, 0x1528: 0x0040, 0x1529: 0x0040, 0x152a: 0x0040, 0x152b: 0x0040, 0x152c: 0x0040, 0x152d: 0x0040, 0x152e: 0x0040, 0x152f: 0x0040, 0x1530: 0xaa61, 0x1531: 0xaa99, 0x1532: 0xaad1, 0x1533: 0xab19, 0x1534: 0xab61, 0x1535: 0xaba9, 0x1536: 0xabf1, 0x1537: 0xac39, 0x1538: 0xac81, 0x1539: 0xacc9, 0x153a: 0xad02, 0x153b: 0xae12, 0x153c: 0xae91, 0x153d: 0x0018, 0x153e: 0x0040, 0x153f: 0x0040, // Block 0x55, offset 0x1540 0x1540: 0x33c0, 0x1541: 0x33c0, 0x1542: 0x33c0, 0x1543: 0x33c0, 0x1544: 0x33c0, 0x1545: 0x33c0, 0x1546: 0x33c0, 0x1547: 0x33c0, 0x1548: 0x33c0, 0x1549: 0x33c0, 0x154a: 0x33c0, 0x154b: 0x33c0, 0x154c: 0x33c0, 0x154d: 0x33c0, 0x154e: 0x33c0, 0x154f: 0x33c0, 0x1550: 0xaeda, 0x1551: 0x7d55, 0x1552: 0x0040, 0x1553: 0xaeea, 0x1554: 0x03c2, 0x1555: 0xaefa, 0x1556: 0xaf0a, 0x1557: 0x7d75, 0x1558: 0x7d95, 0x1559: 0x0040, 0x155a: 0x0040, 0x155b: 0x0040, 0x155c: 0x0040, 0x155d: 0x0040, 0x155e: 0x0040, 0x155f: 0x0040, 0x1560: 0x3308, 0x1561: 0x3308, 0x1562: 0x3308, 0x1563: 0x3308, 0x1564: 0x3308, 0x1565: 0x3308, 0x1566: 0x3308, 0x1567: 0x3308, 0x1568: 0x3308, 0x1569: 0x3308, 0x156a: 0x3308, 0x156b: 0x3308, 0x156c: 0x3308, 0x156d: 0x3308, 0x156e: 0x3308, 0x156f: 0x3308, 0x1570: 0x0040, 0x1571: 0x7db5, 0x1572: 0x7dd5, 0x1573: 0xaf1a, 0x1574: 0xaf1a, 0x1575: 0x1fd2, 0x1576: 0x1fe2, 0x1577: 0xaf2a, 0x1578: 0xaf3a, 0x1579: 0x7df5, 0x157a: 0x7e15, 0x157b: 0x7e35, 0x157c: 0x7df5, 0x157d: 0x7e55, 0x157e: 0x7e75, 0x157f: 0x7e55, // Block 0x56, offset 0x1580 0x1580: 0x7e95, 0x1581: 0x7eb5, 0x1582: 0x7ed5, 0x1583: 0x7eb5, 0x1584: 0x7ef5, 0x1585: 0x0018, 0x1586: 0x0018, 0x1587: 0xaf4a, 0x1588: 0xaf5a, 0x1589: 0x7f16, 0x158a: 0x7f36, 0x158b: 0x7f56, 0x158c: 0x7f76, 0x158d: 0xaf1a, 0x158e: 0xaf1a, 0x158f: 0xaf1a, 0x1590: 0xaeda, 0x1591: 0x7f95, 0x1592: 0x0040, 0x1593: 0x0040, 0x1594: 0x03c2, 0x1595: 0xaeea, 0x1596: 0xaf0a, 0x1597: 0xaefa, 0x1598: 0x7fb5, 0x1599: 0x1fd2, 0x159a: 0x1fe2, 0x159b: 0xaf2a, 0x159c: 0xaf3a, 0x159d: 0x7e95, 0x159e: 0x7ef5, 0x159f: 0xaf6a, 0x15a0: 0xaf7a, 0x15a1: 0xaf8a, 0x15a2: 0x1fb2, 0x15a3: 0xaf99, 0x15a4: 0xafaa, 0x15a5: 0xafba, 0x15a6: 0x1fc2, 0x15a7: 0x0040, 0x15a8: 0xafca, 0x15a9: 0xafda, 0x15aa: 0xafea, 0x15ab: 0xaffa, 0x15ac: 0x0040, 0x15ad: 0x0040, 0x15ae: 0x0040, 0x15af: 0x0040, 0x15b0: 0x7fd6, 0x15b1: 0xb009, 0x15b2: 0x7ff6, 0x15b3: 0x0808, 0x15b4: 0x8016, 0x15b5: 0x0040, 0x15b6: 0x8036, 0x15b7: 0xb031, 0x15b8: 0x8056, 0x15b9: 0xb059, 0x15ba: 0x8076, 0x15bb: 0xb081, 0x15bc: 0x8096, 0x15bd: 0xb0a9, 0x15be: 0x80b6, 0x15bf: 0xb0d1, // Block 0x57, offset 0x15c0 0x15c0: 0xb0f9, 0x15c1: 0xb111, 0x15c2: 0xb111, 0x15c3: 0xb129, 0x15c4: 0xb129, 0x15c5: 0xb141, 0x15c6: 0xb141, 0x15c7: 0xb159, 0x15c8: 0xb159, 0x15c9: 0xb171, 0x15ca: 0xb171, 0x15cb: 0xb171, 0x15cc: 0xb171, 0x15cd: 0xb189, 0x15ce: 0xb189, 0x15cf: 0xb1a1, 0x15d0: 0xb1a1, 0x15d1: 0xb1a1, 0x15d2: 0xb1a1, 0x15d3: 0xb1b9, 0x15d4: 0xb1b9, 0x15d5: 0xb1d1, 0x15d6: 0xb1d1, 0x15d7: 0xb1d1, 0x15d8: 0xb1d1, 0x15d9: 0xb1e9, 0x15da: 0xb1e9, 0x15db: 0xb1e9, 0x15dc: 0xb1e9, 0x15dd: 0xb201, 0x15de: 0xb201, 0x15df: 0xb201, 0x15e0: 0xb201, 0x15e1: 0xb219, 0x15e2: 0xb219, 0x15e3: 0xb219, 0x15e4: 0xb219, 0x15e5: 0xb231, 0x15e6: 0xb231, 0x15e7: 0xb231, 0x15e8: 0xb231, 0x15e9: 0xb249, 0x15ea: 0xb249, 0x15eb: 0xb261, 0x15ec: 0xb261, 0x15ed: 0xb279, 0x15ee: 0xb279, 0x15ef: 0xb291, 0x15f0: 0xb291, 0x15f1: 0xb2a9, 0x15f2: 0xb2a9, 0x15f3: 0xb2a9, 0x15f4: 0xb2a9, 0x15f5: 0xb2c1, 0x15f6: 0xb2c1, 0x15f7: 0xb2c1, 0x15f8: 0xb2c1, 0x15f9: 0xb2d9, 0x15fa: 0xb2d9, 0x15fb: 0xb2d9, 0x15fc: 0xb2d9, 0x15fd: 0xb2f1, 0x15fe: 0xb2f1, 0x15ff: 0xb2f1, // Block 0x58, offset 0x1600 0x1600: 0xb2f1, 0x1601: 0xb309, 0x1602: 0xb309, 0x1603: 0xb309, 0x1604: 0xb309, 0x1605: 0xb321, 0x1606: 0xb321, 0x1607: 0xb321, 0x1608: 0xb321, 0x1609: 0xb339, 0x160a: 0xb339, 0x160b: 0xb339, 0x160c: 0xb339, 0x160d: 0xb351, 0x160e: 0xb351, 0x160f: 0xb351, 0x1610: 0xb351, 0x1611: 0xb369, 0x1612: 0xb369, 0x1613: 0xb369, 0x1614: 0xb369, 0x1615: 0xb381, 0x1616: 0xb381, 0x1617: 0xb381, 0x1618: 0xb381, 0x1619: 0xb399, 0x161a: 0xb399, 0x161b: 0xb399, 0x161c: 0xb399, 0x161d: 0xb3b1, 0x161e: 0xb3b1, 0x161f: 0xb3b1, 0x1620: 0xb3b1, 0x1621: 0xb3c9, 0x1622: 0xb3c9, 0x1623: 0xb3c9, 0x1624: 0xb3c9, 0x1625: 0xb3e1, 0x1626: 0xb3e1, 0x1627: 0xb3e1, 0x1628: 0xb3e1, 0x1629: 0xb3f9, 0x162a: 0xb3f9, 0x162b: 0xb3f9, 0x162c: 0xb3f9, 0x162d: 0xb411, 0x162e: 0xb411, 0x162f: 0x7ab1, 0x1630: 0x7ab1, 0x1631: 0xb429, 0x1632: 0xb429, 0x1633: 0xb429, 0x1634: 0xb429, 0x1635: 0xb441, 0x1636: 0xb441, 0x1637: 0xb469, 0x1638: 0xb469, 0x1639: 0xb491, 0x163a: 0xb491, 0x163b: 0xb4b9, 0x163c: 0xb4b9, 0x163d: 0x0040, 0x163e: 0x0040, 0x163f: 0x03c0, // Block 0x59, offset 0x1640 0x1640: 0x0040, 0x1641: 0xaefa, 0x1642: 0xb4e2, 0x1643: 0xaf6a, 0x1644: 0xafda, 0x1645: 0xafea, 0x1646: 0xaf7a, 0x1647: 0xb4f2, 0x1648: 0x1fd2, 0x1649: 0x1fe2, 0x164a: 0xaf8a, 0x164b: 0x1fb2, 0x164c: 0xaeda, 0x164d: 0xaf99, 0x164e: 0x29d1, 0x164f: 0xb502, 0x1650: 0x1f41, 0x1651: 0x00c9, 0x1652: 0x0069, 0x1653: 0x0079, 0x1654: 0x1f51, 0x1655: 0x1f61, 0x1656: 0x1f71, 0x1657: 0x1f81, 0x1658: 0x1f91, 0x1659: 0x1fa1, 0x165a: 0xaeea, 0x165b: 0x03c2, 0x165c: 0xafaa, 0x165d: 0x1fc2, 0x165e: 0xafba, 0x165f: 0xaf0a, 0x1660: 0xaffa, 0x1661: 0x0039, 0x1662: 0x0ee9, 0x1663: 0x1159, 0x1664: 0x0ef9, 0x1665: 0x0f09, 0x1666: 0x1199, 0x1667: 0x0f31, 0x1668: 0x0249, 0x1669: 0x0f41, 0x166a: 0x0259, 0x166b: 0x0f51, 0x166c: 0x0359, 0x166d: 0x0f61, 0x166e: 0x0f71, 0x166f: 0x00d9, 0x1670: 0x0f99, 0x1671: 0x2039, 0x1672: 0x0269, 0x1673: 0x01d9, 0x1674: 0x0fa9, 0x1675: 0x0fb9, 0x1676: 0x1089, 0x1677: 0x0279, 0x1678: 0x0369, 0x1679: 0x0289, 0x167a: 0x13d1, 0x167b: 0xaf4a, 0x167c: 0xafca, 0x167d: 0xaf5a, 0x167e: 0xb512, 0x167f: 0xaf1a, // Block 0x5a, offset 0x1680 0x1680: 0x1caa, 0x1681: 0x0039, 0x1682: 0x0ee9, 0x1683: 0x1159, 0x1684: 0x0ef9, 0x1685: 0x0f09, 0x1686: 0x1199, 0x1687: 0x0f31, 0x1688: 0x0249, 0x1689: 0x0f41, 0x168a: 0x0259, 0x168b: 0x0f51, 0x168c: 0x0359, 0x168d: 0x0f61, 0x168e: 0x0f71, 0x168f: 0x00d9, 0x1690: 0x0f99, 0x1691: 0x2039, 0x1692: 0x0269, 0x1693: 0x01d9, 0x1694: 0x0fa9, 0x1695: 0x0fb9, 0x1696: 0x1089, 0x1697: 0x0279, 0x1698: 0x0369, 0x1699: 0x0289, 0x169a: 0x13d1, 0x169b: 0xaf2a, 0x169c: 0xb522, 0x169d: 0xaf3a, 0x169e: 0xb532, 0x169f: 0x80d5, 0x16a0: 0x80f5, 0x16a1: 0x29d1, 0x16a2: 0x8115, 0x16a3: 0x8115, 0x16a4: 0x8135, 0x16a5: 0x8155, 0x16a6: 0x8175, 0x16a7: 0x8195, 0x16a8: 0x81b5, 0x16a9: 0x81d5, 0x16aa: 0x81f5, 0x16ab: 0x8215, 0x16ac: 0x8235, 0x16ad: 0x8255, 0x16ae: 0x8275, 0x16af: 0x8295, 0x16b0: 0x82b5, 0x16b1: 0x82d5, 0x16b2: 0x82f5, 0x16b3: 0x8315, 0x16b4: 0x8335, 0x16b5: 0x8355, 0x16b6: 0x8375, 0x16b7: 0x8395, 0x16b8: 0x83b5, 0x16b9: 0x83d5, 0x16ba: 0x83f5, 0x16bb: 0x8415, 0x16bc: 0x81b5, 0x16bd: 0x8435, 0x16be: 0x8455, 0x16bf: 0x8215, // Block 0x5b, offset 0x16c0 0x16c0: 0x8475, 0x16c1: 0x8495, 0x16c2: 0x84b5, 0x16c3: 0x84d5, 0x16c4: 0x84f5, 0x16c5: 0x8515, 0x16c6: 0x8535, 0x16c7: 0x8555, 0x16c8: 0x84d5, 0x16c9: 0x8575, 0x16ca: 0x84d5, 0x16cb: 0x8595, 0x16cc: 0x8595, 0x16cd: 0x85b5, 0x16ce: 0x85b5, 0x16cf: 0x85d5, 0x16d0: 0x8515, 0x16d1: 0x85f5, 0x16d2: 0x8615, 0x16d3: 0x85f5, 0x16d4: 0x8635, 0x16d5: 0x8615, 0x16d6: 0x8655, 0x16d7: 0x8655, 0x16d8: 0x8675, 0x16d9: 0x8675, 0x16da: 0x8695, 0x16db: 0x8695, 0x16dc: 0x8615, 0x16dd: 0x8115, 0x16de: 0x86b5, 0x16df: 0x86d5, 0x16e0: 0x0040, 0x16e1: 0x86f5, 0x16e2: 0x8715, 0x16e3: 0x8735, 0x16e4: 0x8755, 0x16e5: 0x8735, 0x16e6: 0x8775, 0x16e7: 0x8795, 0x16e8: 0x87b5, 0x16e9: 0x87b5, 0x16ea: 0x87d5, 0x16eb: 0x87d5, 0x16ec: 0x87f5, 0x16ed: 0x87f5, 0x16ee: 0x87d5, 0x16ef: 0x87d5, 0x16f0: 0x8815, 0x16f1: 0x8835, 0x16f2: 0x8855, 0x16f3: 0x8875, 0x16f4: 0x8895, 0x16f5: 0x88b5, 0x16f6: 0x88b5, 0x16f7: 0x88b5, 0x16f8: 0x88d5, 0x16f9: 0x88d5, 0x16fa: 0x88d5, 0x16fb: 0x88d5, 0x16fc: 0x87b5, 0x16fd: 0x87b5, 0x16fe: 0x87b5, 0x16ff: 0x0040, // Block 0x5c, offset 0x1700 0x1700: 0x0040, 0x1701: 0x0040, 0x1702: 0x8715, 0x1703: 0x86f5, 0x1704: 0x88f5, 0x1705: 0x86f5, 0x1706: 0x8715, 0x1707: 0x86f5, 0x1708: 0x0040, 0x1709: 0x0040, 0x170a: 0x8915, 0x170b: 0x8715, 0x170c: 0x8935, 0x170d: 0x88f5, 0x170e: 0x8935, 0x170f: 0x8715, 0x1710: 0x0040, 0x1711: 0x0040, 0x1712: 0x8955, 0x1713: 0x8975, 0x1714: 0x8875, 0x1715: 0x8935, 0x1716: 0x88f5, 0x1717: 0x8935, 0x1718: 0x0040, 0x1719: 0x0040, 0x171a: 0x8995, 0x171b: 0x89b5, 0x171c: 0x8995, 0x171d: 0x0040, 0x171e: 0x0040, 0x171f: 0x0040, 0x1720: 0xb541, 0x1721: 0xb559, 0x1722: 0xb571, 0x1723: 0x89d6, 0x1724: 0xb589, 0x1725: 0xb5a1, 0x1726: 0x89f5, 0x1727: 0x0040, 0x1728: 0x8a15, 0x1729: 0x8a35, 0x172a: 0x8a55, 0x172b: 0x8a35, 0x172c: 0x8a75, 0x172d: 0x8a95, 0x172e: 0x8ab5, 0x172f: 0x0040, 0x1730: 0x0040, 0x1731: 0x0040, 0x1732: 0x0040, 0x1733: 0x0040, 0x1734: 0x0040, 0x1735: 0x0040, 0x1736: 0x0040, 0x1737: 0x0040, 0x1738: 0x0040, 0x1739: 0x0340, 0x173a: 0x0340, 0x173b: 0x0340, 0x173c: 0x0040, 0x173d: 0x0040, 0x173e: 0x0040, 0x173f: 0x0040, // Block 0x5d, offset 0x1740 0x1740: 0x0a08, 0x1741: 0x0a08, 0x1742: 0x0a08, 0x1743: 0x0a08, 0x1744: 0x0a08, 0x1745: 0x0c08, 0x1746: 0x0808, 0x1747: 0x0c08, 0x1748: 0x0818, 0x1749: 0x0c08, 0x174a: 0x0c08, 0x174b: 0x0808, 0x174c: 0x0808, 0x174d: 0x0908, 0x174e: 0x0c08, 0x174f: 0x0c08, 0x1750: 0x0c08, 0x1751: 0x0c08, 0x1752: 0x0c08, 0x1753: 0x0a08, 0x1754: 0x0a08, 0x1755: 0x0a08, 0x1756: 0x0a08, 0x1757: 0x0908, 0x1758: 0x0a08, 0x1759: 0x0a08, 0x175a: 0x0a08, 0x175b: 0x0a08, 0x175c: 0x0a08, 0x175d: 0x0c08, 0x175e: 0x0a08, 0x175f: 0x0a08, 0x1760: 0x0a08, 0x1761: 0x0c08, 0x1762: 0x0808, 0x1763: 0x0808, 0x1764: 0x0c08, 0x1765: 0x3308, 0x1766: 0x3308, 0x1767: 0x0040, 0x1768: 0x0040, 0x1769: 0x0040, 0x176a: 0x0040, 0x176b: 0x0a18, 0x176c: 0x0a18, 0x176d: 0x0a18, 0x176e: 0x0a18, 0x176f: 0x0c18, 0x1770: 0x0818, 0x1771: 0x0818, 0x1772: 0x0818, 0x1773: 0x0818, 0x1774: 0x0818, 0x1775: 0x0818, 0x1776: 0x0818, 0x1777: 0x0040, 0x1778: 0x0040, 0x1779: 0x0040, 0x177a: 0x0040, 0x177b: 0x0040, 0x177c: 0x0040, 0x177d: 0x0040, 0x177e: 0x0040, 0x177f: 0x0040, // Block 0x5e, offset 0x1780 0x1780: 0x0a08, 0x1781: 0x0c08, 0x1782: 0x0a08, 0x1783: 0x0c08, 0x1784: 0x0c08, 0x1785: 0x0c08, 0x1786: 0x0a08, 0x1787: 0x0a08, 0x1788: 0x0a08, 0x1789: 0x0c08, 0x178a: 0x0a08, 0x178b: 0x0a08, 0x178c: 0x0c08, 0x178d: 0x0a08, 0x178e: 0x0c08, 0x178f: 0x0c08, 0x1790: 0x0a08, 0x1791: 0x0c08, 0x1792: 0x0040, 0x1793: 0x0040, 0x1794: 0x0040, 0x1795: 0x0040, 0x1796: 0x0040, 0x1797: 0x0040, 0x1798: 0x0040, 0x1799: 0x0818, 0x179a: 0x0818, 0x179b: 0x0818, 0x179c: 0x0818, 0x179d: 0x0040, 0x179e: 0x0040, 0x179f: 0x0040, 0x17a0: 0x0040, 0x17a1: 0x0040, 0x17a2: 0x0040, 0x17a3: 0x0040, 0x17a4: 0x0040, 0x17a5: 0x0040, 0x17a6: 0x0040, 0x17a7: 0x0040, 0x17a8: 0x0040, 0x17a9: 0x0c18, 0x17aa: 0x0c18, 0x17ab: 0x0c18, 0x17ac: 0x0c18, 0x17ad: 0x0a18, 0x17ae: 0x0a18, 0x17af: 0x0818, 0x17b0: 0x0040, 0x17b1: 0x0040, 0x17b2: 0x0040, 0x17b3: 0x0040, 0x17b4: 0x0040, 0x17b5: 0x0040, 0x17b6: 0x0040, 0x17b7: 0x0040, 0x17b8: 0x0040, 0x17b9: 0x0040, 0x17ba: 0x0040, 0x17bb: 0x0040, 0x17bc: 0x0040, 0x17bd: 0x0040, 0x17be: 0x0040, 0x17bf: 0x0040, // Block 0x5f, offset 0x17c0 0x17c0: 0x3308, 0x17c1: 0x3308, 0x17c2: 0x3008, 0x17c3: 0x3008, 0x17c4: 0x0040, 0x17c5: 0x0008, 0x17c6: 0x0008, 0x17c7: 0x0008, 0x17c8: 0x0008, 0x17c9: 0x0008, 0x17ca: 0x0008, 0x17cb: 0x0008, 0x17cc: 0x0008, 0x17cd: 0x0040, 0x17ce: 0x0040, 0x17cf: 0x0008, 0x17d0: 0x0008, 0x17d1: 0x0040, 0x17d2: 0x0040, 0x17d3: 0x0008, 0x17d4: 0x0008, 0x17d5: 0x0008, 0x17d6: 0x0008, 0x17d7: 0x0008, 0x17d8: 0x0008, 0x17d9: 0x0008, 0x17da: 0x0008, 0x17db: 0x0008, 0x17dc: 0x0008, 0x17dd: 0x0008, 0x17de: 0x0008, 0x17df: 0x0008, 0x17e0: 0x0008, 0x17e1: 0x0008, 0x17e2: 0x0008, 0x17e3: 0x0008, 0x17e4: 0x0008, 0x17e5: 0x0008, 0x17e6: 0x0008, 0x17e7: 0x0008, 0x17e8: 0x0008, 0x17e9: 0x0040, 0x17ea: 0x0008, 0x17eb: 0x0008, 0x17ec: 0x0008, 0x17ed: 0x0008, 0x17ee: 0x0008, 0x17ef: 0x0008, 0x17f0: 0x0008, 0x17f1: 0x0040, 0x17f2: 0x0008, 0x17f3: 0x0008, 0x17f4: 0x0040, 0x17f5: 0x0008, 0x17f6: 0x0008, 0x17f7: 0x0008, 0x17f8: 0x0008, 0x17f9: 0x0008, 0x17fa: 0x0040, 0x17fb: 0x3308, 0x17fc: 0x3308, 0x17fd: 0x0008, 0x17fe: 0x3008, 0x17ff: 0x3008, // Block 0x60, offset 0x1800 0x1800: 0x3308, 0x1801: 0x3008, 0x1802: 0x3008, 0x1803: 0x3008, 0x1804: 0x3008, 0x1805: 0x0040, 0x1806: 0x0040, 0x1807: 0x3008, 0x1808: 0x3008, 0x1809: 0x0040, 0x180a: 0x0040, 0x180b: 0x3008, 0x180c: 0x3008, 0x180d: 0x3808, 0x180e: 0x0040, 0x180f: 0x0040, 0x1810: 0x0008, 0x1811: 0x0040, 0x1812: 0x0040, 0x1813: 0x0040, 0x1814: 0x0040, 0x1815: 0x0040, 0x1816: 0x0040, 0x1817: 0x3008, 0x1818: 0x0040, 0x1819: 0x0040, 0x181a: 0x0040, 0x181b: 0x0040, 0x181c: 0x0040, 0x181d: 0x0008, 0x181e: 0x0008, 0x181f: 0x0008, 0x1820: 0x0008, 0x1821: 0x0008, 0x1822: 0x3008, 0x1823: 0x3008, 0x1824: 0x0040, 0x1825: 0x0040, 0x1826: 0x3308, 0x1827: 0x3308, 0x1828: 0x3308, 0x1829: 0x3308, 0x182a: 0x3308, 0x182b: 0x3308, 0x182c: 0x3308, 0x182d: 0x0040, 0x182e: 0x0040, 0x182f: 0x0040, 0x1830: 0x3308, 0x1831: 0x3308, 0x1832: 0x3308, 0x1833: 0x3308, 0x1834: 0x3308, 0x1835: 0x0040, 0x1836: 0x0040, 0x1837: 0x0040, 0x1838: 0x0040, 0x1839: 0x0040, 0x183a: 0x0040, 0x183b: 0x0040, 0x183c: 0x0040, 0x183d: 0x0040, 0x183e: 0x0040, 0x183f: 0x0040, // Block 0x61, offset 0x1840 0x1840: 0x0039, 0x1841: 0x0ee9, 0x1842: 0x1159, 0x1843: 0x0ef9, 0x1844: 0x0f09, 0x1845: 0x1199, 0x1846: 0x0f31, 0x1847: 0x0249, 0x1848: 0x0f41, 0x1849: 0x0259, 0x184a: 0x0f51, 0x184b: 0x0359, 0x184c: 0x0f61, 0x184d: 0x0f71, 0x184e: 0x00d9, 0x184f: 0x0f99, 0x1850: 0x2039, 0x1851: 0x0269, 0x1852: 0x01d9, 0x1853: 0x0fa9, 0x1854: 0x0fb9, 0x1855: 0x1089, 0x1856: 0x0279, 0x1857: 0x0369, 0x1858: 0x0289, 0x1859: 0x13d1, 0x185a: 0x0039, 0x185b: 0x0ee9, 0x185c: 0x1159, 0x185d: 0x0ef9, 0x185e: 0x0f09, 0x185f: 0x1199, 0x1860: 0x0f31, 0x1861: 0x0249, 0x1862: 0x0f41, 0x1863: 0x0259, 0x1864: 0x0f51, 0x1865: 0x0359, 0x1866: 0x0f61, 0x1867: 0x0f71, 0x1868: 0x00d9, 0x1869: 0x0f99, 0x186a: 0x2039, 0x186b: 0x0269, 0x186c: 0x01d9, 0x186d: 0x0fa9, 0x186e: 0x0fb9, 0x186f: 0x1089, 0x1870: 0x0279, 0x1871: 0x0369, 0x1872: 0x0289, 0x1873: 0x13d1, 0x1874: 0x0039, 0x1875: 0x0ee9, 0x1876: 0x1159, 0x1877: 0x0ef9, 0x1878: 0x0f09, 0x1879: 0x1199, 0x187a: 0x0f31, 0x187b: 0x0249, 0x187c: 0x0f41, 0x187d: 0x0259, 0x187e: 0x0f51, 0x187f: 0x0359, // Block 0x62, offset 0x1880 0x1880: 0x0f61, 0x1881: 0x0f71, 0x1882: 0x00d9, 0x1883: 0x0f99, 0x1884: 0x2039, 0x1885: 0x0269, 0x1886: 0x01d9, 0x1887: 0x0fa9, 0x1888: 0x0fb9, 0x1889: 0x1089, 0x188a: 0x0279, 0x188b: 0x0369, 0x188c: 0x0289, 0x188d: 0x13d1, 0x188e: 0x0039, 0x188f: 0x0ee9, 0x1890: 0x1159, 0x1891: 0x0ef9, 0x1892: 0x0f09, 0x1893: 0x1199, 0x1894: 0x0f31, 0x1895: 0x0040, 0x1896: 0x0f41, 0x1897: 0x0259, 0x1898: 0x0f51, 0x1899: 0x0359, 0x189a: 0x0f61, 0x189b: 0x0f71, 0x189c: 0x00d9, 0x189d: 0x0f99, 0x189e: 0x2039, 0x189f: 0x0269, 0x18a0: 0x01d9, 0x18a1: 0x0fa9, 0x18a2: 0x0fb9, 0x18a3: 0x1089, 0x18a4: 0x0279, 0x18a5: 0x0369, 0x18a6: 0x0289, 0x18a7: 0x13d1, 0x18a8: 0x0039, 0x18a9: 0x0ee9, 0x18aa: 0x1159, 0x18ab: 0x0ef9, 0x18ac: 0x0f09, 0x18ad: 0x1199, 0x18ae: 0x0f31, 0x18af: 0x0249, 0x18b0: 0x0f41, 0x18b1: 0x0259, 0x18b2: 0x0f51, 0x18b3: 0x0359, 0x18b4: 0x0f61, 0x18b5: 0x0f71, 0x18b6: 0x00d9, 0x18b7: 0x0f99, 0x18b8: 0x2039, 0x18b9: 0x0269, 0x18ba: 0x01d9, 0x18bb: 0x0fa9, 0x18bc: 0x0fb9, 0x18bd: 0x1089, 0x18be: 0x0279, 0x18bf: 0x0369, // Block 0x63, offset 0x18c0 0x18c0: 0x0289, 0x18c1: 0x13d1, 0x18c2: 0x0039, 0x18c3: 0x0ee9, 0x18c4: 0x1159, 0x18c5: 0x0ef9, 0x18c6: 0x0f09, 0x18c7: 0x1199, 0x18c8: 0x0f31, 0x18c9: 0x0249, 0x18ca: 0x0f41, 0x18cb: 0x0259, 0x18cc: 0x0f51, 0x18cd: 0x0359, 0x18ce: 0x0f61, 0x18cf: 0x0f71, 0x18d0: 0x00d9, 0x18d1: 0x0f99, 0x18d2: 0x2039, 0x18d3: 0x0269, 0x18d4: 0x01d9, 0x18d5: 0x0fa9, 0x18d6: 0x0fb9, 0x18d7: 0x1089, 0x18d8: 0x0279, 0x18d9: 0x0369, 0x18da: 0x0289, 0x18db: 0x13d1, 0x18dc: 0x0039, 0x18dd: 0x0040, 0x18de: 0x1159, 0x18df: 0x0ef9, 0x18e0: 0x0040, 0x18e1: 0x0040, 0x18e2: 0x0f31, 0x18e3: 0x0040, 0x18e4: 0x0040, 0x18e5: 0x0259, 0x18e6: 0x0f51, 0x18e7: 0x0040, 0x18e8: 0x0040, 0x18e9: 0x0f71, 0x18ea: 0x00d9, 0x18eb: 0x0f99, 0x18ec: 0x2039, 0x18ed: 0x0040, 0x18ee: 0x01d9, 0x18ef: 0x0fa9, 0x18f0: 0x0fb9, 0x18f1: 0x1089, 0x18f2: 0x0279, 0x18f3: 0x0369, 0x18f4: 0x0289, 0x18f5: 0x13d1, 0x18f6: 0x0039, 0x18f7: 0x0ee9, 0x18f8: 0x1159, 0x18f9: 0x0ef9, 0x18fa: 0x0040, 0x18fb: 0x1199, 0x18fc: 0x0040, 0x18fd: 0x0249, 0x18fe: 0x0f41, 0x18ff: 0x0259, // Block 0x64, offset 0x1900 0x1900: 0x0f51, 0x1901: 0x0359, 0x1902: 0x0f61, 0x1903: 0x0f71, 0x1904: 0x0040, 0x1905: 0x0f99, 0x1906: 0x2039, 0x1907: 0x0269, 0x1908: 0x01d9, 0x1909: 0x0fa9, 0x190a: 0x0fb9, 0x190b: 0x1089, 0x190c: 0x0279, 0x190d: 0x0369, 0x190e: 0x0289, 0x190f: 0x13d1, 0x1910: 0x0039, 0x1911: 0x0ee9, 0x1912: 0x1159, 0x1913: 0x0ef9, 0x1914: 0x0f09, 0x1915: 0x1199, 0x1916: 0x0f31, 0x1917: 0x0249, 0x1918: 0x0f41, 0x1919: 0x0259, 0x191a: 0x0f51, 0x191b: 0x0359, 0x191c: 0x0f61, 0x191d: 0x0f71, 0x191e: 0x00d9, 0x191f: 0x0f99, 0x1920: 0x2039, 0x1921: 0x0269, 0x1922: 0x01d9, 0x1923: 0x0fa9, 0x1924: 0x0fb9, 0x1925: 0x1089, 0x1926: 0x0279, 0x1927: 0x0369, 0x1928: 0x0289, 0x1929: 0x13d1, 0x192a: 0x0039, 0x192b: 0x0ee9, 0x192c: 0x1159, 0x192d: 0x0ef9, 0x192e: 0x0f09, 0x192f: 0x1199, 0x1930: 0x0f31, 0x1931: 0x0249, 0x1932: 0x0f41, 0x1933: 0x0259, 0x1934: 0x0f51, 0x1935: 0x0359, 0x1936: 0x0f61, 0x1937: 0x0f71, 0x1938: 0x00d9, 0x1939: 0x0f99, 0x193a: 0x2039, 0x193b: 0x0269, 0x193c: 0x01d9, 0x193d: 0x0fa9, 0x193e: 0x0fb9, 0x193f: 0x1089, // Block 0x65, offset 0x1940 0x1940: 0x0279, 0x1941: 0x0369, 0x1942: 0x0289, 0x1943: 0x13d1, 0x1944: 0x0039, 0x1945: 0x0ee9, 0x1946: 0x0040, 0x1947: 0x0ef9, 0x1948: 0x0f09, 0x1949: 0x1199, 0x194a: 0x0f31, 0x194b: 0x0040, 0x194c: 0x0040, 0x194d: 0x0259, 0x194e: 0x0f51, 0x194f: 0x0359, 0x1950: 0x0f61, 0x1951: 0x0f71, 0x1952: 0x00d9, 0x1953: 0x0f99, 0x1954: 0x2039, 0x1955: 0x0040, 0x1956: 0x01d9, 0x1957: 0x0fa9, 0x1958: 0x0fb9, 0x1959: 0x1089, 0x195a: 0x0279, 0x195b: 0x0369, 0x195c: 0x0289, 0x195d: 0x0040, 0x195e: 0x0039, 0x195f: 0x0ee9, 0x1960: 0x1159, 0x1961: 0x0ef9, 0x1962: 0x0f09, 0x1963: 0x1199, 0x1964: 0x0f31, 0x1965: 0x0249, 0x1966: 0x0f41, 0x1967: 0x0259, 0x1968: 0x0f51, 0x1969: 0x0359, 0x196a: 0x0f61, 0x196b: 0x0f71, 0x196c: 0x00d9, 0x196d: 0x0f99, 0x196e: 0x2039, 0x196f: 0x0269, 0x1970: 0x01d9, 0x1971: 0x0fa9, 0x1972: 0x0fb9, 0x1973: 0x1089, 0x1974: 0x0279, 0x1975: 0x0369, 0x1976: 0x0289, 0x1977: 0x13d1, 0x1978: 0x0039, 0x1979: 0x0ee9, 0x197a: 0x0040, 0x197b: 0x0ef9, 0x197c: 0x0f09, 0x197d: 0x1199, 0x197e: 0x0f31, 0x197f: 0x0040, // Block 0x66, offset 0x1980 0x1980: 0x0f41, 0x1981: 0x0259, 0x1982: 0x0f51, 0x1983: 0x0359, 0x1984: 0x0f61, 0x1985: 0x0040, 0x1986: 0x00d9, 0x1987: 0x0040, 0x1988: 0x0040, 0x1989: 0x0040, 0x198a: 0x01d9, 0x198b: 0x0fa9, 0x198c: 0x0fb9, 0x198d: 0x1089, 0x198e: 0x0279, 0x198f: 0x0369, 0x1990: 0x0289, 0x1991: 0x0040, 0x1992: 0x0039, 0x1993: 0x0ee9, 0x1994: 0x1159, 0x1995: 0x0ef9, 0x1996: 0x0f09, 0x1997: 0x1199, 0x1998: 0x0f31, 0x1999: 0x0249, 0x199a: 0x0f41, 0x199b: 0x0259, 0x199c: 0x0f51, 0x199d: 0x0359, 0x199e: 0x0f61, 0x199f: 0x0f71, 0x19a0: 0x00d9, 0x19a1: 0x0f99, 0x19a2: 0x2039, 0x19a3: 0x0269, 0x19a4: 0x01d9, 0x19a5: 0x0fa9, 0x19a6: 0x0fb9, 0x19a7: 0x1089, 0x19a8: 0x0279, 0x19a9: 0x0369, 0x19aa: 0x0289, 0x19ab: 0x13d1, 0x19ac: 0x0039, 0x19ad: 0x0ee9, 0x19ae: 0x1159, 0x19af: 0x0ef9, 0x19b0: 0x0f09, 0x19b1: 0x1199, 0x19b2: 0x0f31, 0x19b3: 0x0249, 0x19b4: 0x0f41, 0x19b5: 0x0259, 0x19b6: 0x0f51, 0x19b7: 0x0359, 0x19b8: 0x0f61, 0x19b9: 0x0f71, 0x19ba: 0x00d9, 0x19bb: 0x0f99, 0x19bc: 0x2039, 0x19bd: 0x0269, 0x19be: 0x01d9, 0x19bf: 0x0fa9, // Block 0x67, offset 0x19c0 0x19c0: 0x0fb9, 0x19c1: 0x1089, 0x19c2: 0x0279, 0x19c3: 0x0369, 0x19c4: 0x0289, 0x19c5: 0x13d1, 0x19c6: 0x0039, 0x19c7: 0x0ee9, 0x19c8: 0x1159, 0x19c9: 0x0ef9, 0x19ca: 0x0f09, 0x19cb: 0x1199, 0x19cc: 0x0f31, 0x19cd: 0x0249, 0x19ce: 0x0f41, 0x19cf: 0x0259, 0x19d0: 0x0f51, 0x19d1: 0x0359, 0x19d2: 0x0f61, 0x19d3: 0x0f71, 0x19d4: 0x00d9, 0x19d5: 0x0f99, 0x19d6: 0x2039, 0x19d7: 0x0269, 0x19d8: 0x01d9, 0x19d9: 0x0fa9, 0x19da: 0x0fb9, 0x19db: 0x1089, 0x19dc: 0x0279, 0x19dd: 0x0369, 0x19de: 0x0289, 0x19df: 0x13d1, 0x19e0: 0x0039, 0x19e1: 0x0ee9, 0x19e2: 0x1159, 0x19e3: 0x0ef9, 0x19e4: 0x0f09, 0x19e5: 0x1199, 0x19e6: 0x0f31, 0x19e7: 0x0249, 0x19e8: 0x0f41, 0x19e9: 0x0259, 0x19ea: 0x0f51, 0x19eb: 0x0359, 0x19ec: 0x0f61, 0x19ed: 0x0f71, 0x19ee: 0x00d9, 0x19ef: 0x0f99, 0x19f0: 0x2039, 0x19f1: 0x0269, 0x19f2: 0x01d9, 0x19f3: 0x0fa9, 0x19f4: 0x0fb9, 0x19f5: 0x1089, 0x19f6: 0x0279, 0x19f7: 0x0369, 0x19f8: 0x0289, 0x19f9: 0x13d1, 0x19fa: 0x0039, 0x19fb: 0x0ee9, 0x19fc: 0x1159, 0x19fd: 0x0ef9, 0x19fe: 0x0f09, 0x19ff: 0x1199, // Block 0x68, offset 0x1a00 0x1a00: 0x0f31, 0x1a01: 0x0249, 0x1a02: 0x0f41, 0x1a03: 0x0259, 0x1a04: 0x0f51, 0x1a05: 0x0359, 0x1a06: 0x0f61, 0x1a07: 0x0f71, 0x1a08: 0x00d9, 0x1a09: 0x0f99, 0x1a0a: 0x2039, 0x1a0b: 0x0269, 0x1a0c: 0x01d9, 0x1a0d: 0x0fa9, 0x1a0e: 0x0fb9, 0x1a0f: 0x1089, 0x1a10: 0x0279, 0x1a11: 0x0369, 0x1a12: 0x0289, 0x1a13: 0x13d1, 0x1a14: 0x0039, 0x1a15: 0x0ee9, 0x1a16: 0x1159, 0x1a17: 0x0ef9, 0x1a18: 0x0f09, 0x1a19: 0x1199, 0x1a1a: 0x0f31, 0x1a1b: 0x0249, 0x1a1c: 0x0f41, 0x1a1d: 0x0259, 0x1a1e: 0x0f51, 0x1a1f: 0x0359, 0x1a20: 0x0f61, 0x1a21: 0x0f71, 0x1a22: 0x00d9, 0x1a23: 0x0f99, 0x1a24: 0x2039, 0x1a25: 0x0269, 0x1a26: 0x01d9, 0x1a27: 0x0fa9, 0x1a28: 0x0fb9, 0x1a29: 0x1089, 0x1a2a: 0x0279, 0x1a2b: 0x0369, 0x1a2c: 0x0289, 0x1a2d: 0x13d1, 0x1a2e: 0x0039, 0x1a2f: 0x0ee9, 0x1a30: 0x1159, 0x1a31: 0x0ef9, 0x1a32: 0x0f09, 0x1a33: 0x1199, 0x1a34: 0x0f31, 0x1a35: 0x0249, 0x1a36: 0x0f41, 0x1a37: 0x0259, 0x1a38: 0x0f51, 0x1a39: 0x0359, 0x1a3a: 0x0f61, 0x1a3b: 0x0f71, 0x1a3c: 0x00d9, 0x1a3d: 0x0f99, 0x1a3e: 0x2039, 0x1a3f: 0x0269, // Block 0x69, offset 0x1a40 0x1a40: 0x01d9, 0x1a41: 0x0fa9, 0x1a42: 0x0fb9, 0x1a43: 0x1089, 0x1a44: 0x0279, 0x1a45: 0x0369, 0x1a46: 0x0289, 0x1a47: 0x13d1, 0x1a48: 0x0039, 0x1a49: 0x0ee9, 0x1a4a: 0x1159, 0x1a4b: 0x0ef9, 0x1a4c: 0x0f09, 0x1a4d: 0x1199, 0x1a4e: 0x0f31, 0x1a4f: 0x0249, 0x1a50: 0x0f41, 0x1a51: 0x0259, 0x1a52: 0x0f51, 0x1a53: 0x0359, 0x1a54: 0x0f61, 0x1a55: 0x0f71, 0x1a56: 0x00d9, 0x1a57: 0x0f99, 0x1a58: 0x2039, 0x1a59: 0x0269, 0x1a5a: 0x01d9, 0x1a5b: 0x0fa9, 0x1a5c: 0x0fb9, 0x1a5d: 0x1089, 0x1a5e: 0x0279, 0x1a5f: 0x0369, 0x1a60: 0x0289, 0x1a61: 0x13d1, 0x1a62: 0x0039, 0x1a63: 0x0ee9, 0x1a64: 0x1159, 0x1a65: 0x0ef9, 0x1a66: 0x0f09, 0x1a67: 0x1199, 0x1a68: 0x0f31, 0x1a69: 0x0249, 0x1a6a: 0x0f41, 0x1a6b: 0x0259, 0x1a6c: 0x0f51, 0x1a6d: 0x0359, 0x1a6e: 0x0f61, 0x1a6f: 0x0f71, 0x1a70: 0x00d9, 0x1a71: 0x0f99, 0x1a72: 0x2039, 0x1a73: 0x0269, 0x1a74: 0x01d9, 0x1a75: 0x0fa9, 0x1a76: 0x0fb9, 0x1a77: 0x1089, 0x1a78: 0x0279, 0x1a79: 0x0369, 0x1a7a: 0x0289, 0x1a7b: 0x13d1, 0x1a7c: 0x0039, 0x1a7d: 0x0ee9, 0x1a7e: 0x1159, 0x1a7f: 0x0ef9, // Block 0x6a, offset 0x1a80 0x1a80: 0x0f09, 0x1a81: 0x1199, 0x1a82: 0x0f31, 0x1a83: 0x0249, 0x1a84: 0x0f41, 0x1a85: 0x0259, 0x1a86: 0x0f51, 0x1a87: 0x0359, 0x1a88: 0x0f61, 0x1a89: 0x0f71, 0x1a8a: 0x00d9, 0x1a8b: 0x0f99, 0x1a8c: 0x2039, 0x1a8d: 0x0269, 0x1a8e: 0x01d9, 0x1a8f: 0x0fa9, 0x1a90: 0x0fb9, 0x1a91: 0x1089, 0x1a92: 0x0279, 0x1a93: 0x0369, 0x1a94: 0x0289, 0x1a95: 0x13d1, 0x1a96: 0x0039, 0x1a97: 0x0ee9, 0x1a98: 0x1159, 0x1a99: 0x0ef9, 0x1a9a: 0x0f09, 0x1a9b: 0x1199, 0x1a9c: 0x0f31, 0x1a9d: 0x0249, 0x1a9e: 0x0f41, 0x1a9f: 0x0259, 0x1aa0: 0x0f51, 0x1aa1: 0x0359, 0x1aa2: 0x0f61, 0x1aa3: 0x0f71, 0x1aa4: 0x00d9, 0x1aa5: 0x0f99, 0x1aa6: 0x2039, 0x1aa7: 0x0269, 0x1aa8: 0x01d9, 0x1aa9: 0x0fa9, 0x1aaa: 0x0fb9, 0x1aab: 0x1089, 0x1aac: 0x0279, 0x1aad: 0x0369, 0x1aae: 0x0289, 0x1aaf: 0x13d1, 0x1ab0: 0x0039, 0x1ab1: 0x0ee9, 0x1ab2: 0x1159, 0x1ab3: 0x0ef9, 0x1ab4: 0x0f09, 0x1ab5: 0x1199, 0x1ab6: 0x0f31, 0x1ab7: 0x0249, 0x1ab8: 0x0f41, 0x1ab9: 0x0259, 0x1aba: 0x0f51, 0x1abb: 0x0359, 0x1abc: 0x0f61, 0x1abd: 0x0f71, 0x1abe: 0x00d9, 0x1abf: 0x0f99, // Block 0x6b, offset 0x1ac0 0x1ac0: 0x2039, 0x1ac1: 0x0269, 0x1ac2: 0x01d9, 0x1ac3: 0x0fa9, 0x1ac4: 0x0fb9, 0x1ac5: 0x1089, 0x1ac6: 0x0279, 0x1ac7: 0x0369, 0x1ac8: 0x0289, 0x1ac9: 0x13d1, 0x1aca: 0x0039, 0x1acb: 0x0ee9, 0x1acc: 0x1159, 0x1acd: 0x0ef9, 0x1ace: 0x0f09, 0x1acf: 0x1199, 0x1ad0: 0x0f31, 0x1ad1: 0x0249, 0x1ad2: 0x0f41, 0x1ad3: 0x0259, 0x1ad4: 0x0f51, 0x1ad5: 0x0359, 0x1ad6: 0x0f61, 0x1ad7: 0x0f71, 0x1ad8: 0x00d9, 0x1ad9: 0x0f99, 0x1ada: 0x2039, 0x1adb: 0x0269, 0x1adc: 0x01d9, 0x1add: 0x0fa9, 0x1ade: 0x0fb9, 0x1adf: 0x1089, 0x1ae0: 0x0279, 0x1ae1: 0x0369, 0x1ae2: 0x0289, 0x1ae3: 0x13d1, 0x1ae4: 0xba81, 0x1ae5: 0xba99, 0x1ae6: 0x0040, 0x1ae7: 0x0040, 0x1ae8: 0xbab1, 0x1ae9: 0x1099, 0x1aea: 0x10b1, 0x1aeb: 0x10c9, 0x1aec: 0xbac9, 0x1aed: 0xbae1, 0x1aee: 0xbaf9, 0x1aef: 0x1429, 0x1af0: 0x1a31, 0x1af1: 0xbb11, 0x1af2: 0xbb29, 0x1af3: 0xbb41, 0x1af4: 0xbb59, 0x1af5: 0xbb71, 0x1af6: 0xbb89, 0x1af7: 0x2109, 0x1af8: 0x1111, 0x1af9: 0x1429, 0x1afa: 0xbba1, 0x1afb: 0xbbb9, 0x1afc: 0xbbd1, 0x1afd: 0x10e1, 0x1afe: 0x10f9, 0x1aff: 0xbbe9, // Block 0x6c, offset 0x1b00 0x1b00: 0x2079, 0x1b01: 0xbc01, 0x1b02: 0xbab1, 0x1b03: 0x1099, 0x1b04: 0x10b1, 0x1b05: 0x10c9, 0x1b06: 0xbac9, 0x1b07: 0xbae1, 0x1b08: 0xbaf9, 0x1b09: 0x1429, 0x1b0a: 0x1a31, 0x1b0b: 0xbb11, 0x1b0c: 0xbb29, 0x1b0d: 0xbb41, 0x1b0e: 0xbb59, 0x1b0f: 0xbb71, 0x1b10: 0xbb89, 0x1b11: 0x2109, 0x1b12: 0x1111, 0x1b13: 0xbba1, 0x1b14: 0xbba1, 0x1b15: 0xbbb9, 0x1b16: 0xbbd1, 0x1b17: 0x10e1, 0x1b18: 0x10f9, 0x1b19: 0xbbe9, 0x1b1a: 0x2079, 0x1b1b: 0xbc21, 0x1b1c: 0xbac9, 0x1b1d: 0x1429, 0x1b1e: 0xbb11, 0x1b1f: 0x10e1, 0x1b20: 0x1111, 0x1b21: 0x2109, 0x1b22: 0xbab1, 0x1b23: 0x1099, 0x1b24: 0x10b1, 0x1b25: 0x10c9, 0x1b26: 0xbac9, 0x1b27: 0xbae1, 0x1b28: 0xbaf9, 0x1b29: 0x1429, 0x1b2a: 0x1a31, 0x1b2b: 0xbb11, 0x1b2c: 0xbb29, 0x1b2d: 0xbb41, 0x1b2e: 0xbb59, 0x1b2f: 0xbb71, 0x1b30: 0xbb89, 0x1b31: 0x2109, 0x1b32: 0x1111, 0x1b33: 0x1429, 0x1b34: 0xbba1, 0x1b35: 0xbbb9, 0x1b36: 0xbbd1, 0x1b37: 0x10e1, 0x1b38: 0x10f9, 0x1b39: 0xbbe9, 0x1b3a: 0x2079, 0x1b3b: 0xbc01, 0x1b3c: 0xbab1, 0x1b3d: 0x1099, 0x1b3e: 0x10b1, 0x1b3f: 0x10c9, // Block 0x6d, offset 0x1b40 0x1b40: 0xbac9, 0x1b41: 0xbae1, 0x1b42: 0xbaf9, 0x1b43: 0x1429, 0x1b44: 0x1a31, 0x1b45: 0xbb11, 0x1b46: 0xbb29, 0x1b47: 0xbb41, 0x1b48: 0xbb59, 0x1b49: 0xbb71, 0x1b4a: 0xbb89, 0x1b4b: 0x2109, 0x1b4c: 0x1111, 0x1b4d: 0xbba1, 0x1b4e: 0xbba1, 0x1b4f: 0xbbb9, 0x1b50: 0xbbd1, 0x1b51: 0x10e1, 0x1b52: 0x10f9, 0x1b53: 0xbbe9, 0x1b54: 0x2079, 0x1b55: 0xbc21, 0x1b56: 0xbac9, 0x1b57: 0x1429, 0x1b58: 0xbb11, 0x1b59: 0x10e1, 0x1b5a: 0x1111, 0x1b5b: 0x2109, 0x1b5c: 0xbab1, 0x1b5d: 0x1099, 0x1b5e: 0x10b1, 0x1b5f: 0x10c9, 0x1b60: 0xbac9, 0x1b61: 0xbae1, 0x1b62: 0xbaf9, 0x1b63: 0x1429, 0x1b64: 0x1a31, 0x1b65: 0xbb11, 0x1b66: 0xbb29, 0x1b67: 0xbb41, 0x1b68: 0xbb59, 0x1b69: 0xbb71, 0x1b6a: 0xbb89, 0x1b6b: 0x2109, 0x1b6c: 0x1111, 0x1b6d: 0x1429, 0x1b6e: 0xbba1, 0x1b6f: 0xbbb9, 0x1b70: 0xbbd1, 0x1b71: 0x10e1, 0x1b72: 0x10f9, 0x1b73: 0xbbe9, 0x1b74: 0x2079, 0x1b75: 0xbc01, 0x1b76: 0xbab1, 0x1b77: 0x1099, 0x1b78: 0x10b1, 0x1b79: 0x10c9, 0x1b7a: 0xbac9, 0x1b7b: 0xbae1, 0x1b7c: 0xbaf9, 0x1b7d: 0x1429, 0x1b7e: 0x1a31, 0x1b7f: 0xbb11, // Block 0x6e, offset 0x1b80 0x1b80: 0xbb29, 0x1b81: 0xbb41, 0x1b82: 0xbb59, 0x1b83: 0xbb71, 0x1b84: 0xbb89, 0x1b85: 0x2109, 0x1b86: 0x1111, 0x1b87: 0xbba1, 0x1b88: 0xbba1, 0x1b89: 0xbbb9, 0x1b8a: 0xbbd1, 0x1b8b: 0x10e1, 0x1b8c: 0x10f9, 0x1b8d: 0xbbe9, 0x1b8e: 0x2079, 0x1b8f: 0xbc21, 0x1b90: 0xbac9, 0x1b91: 0x1429, 0x1b92: 0xbb11, 0x1b93: 0x10e1, 0x1b94: 0x1111, 0x1b95: 0x2109, 0x1b96: 0xbab1, 0x1b97: 0x1099, 0x1b98: 0x10b1, 0x1b99: 0x10c9, 0x1b9a: 0xbac9, 0x1b9b: 0xbae1, 0x1b9c: 0xbaf9, 0x1b9d: 0x1429, 0x1b9e: 0x1a31, 0x1b9f: 0xbb11, 0x1ba0: 0xbb29, 0x1ba1: 0xbb41, 0x1ba2: 0xbb59, 0x1ba3: 0xbb71, 0x1ba4: 0xbb89, 0x1ba5: 0x2109, 0x1ba6: 0x1111, 0x1ba7: 0x1429, 0x1ba8: 0xbba1, 0x1ba9: 0xbbb9, 0x1baa: 0xbbd1, 0x1bab: 0x10e1, 0x1bac: 0x10f9, 0x1bad: 0xbbe9, 0x1bae: 0x2079, 0x1baf: 0xbc01, 0x1bb0: 0xbab1, 0x1bb1: 0x1099, 0x1bb2: 0x10b1, 0x1bb3: 0x10c9, 0x1bb4: 0xbac9, 0x1bb5: 0xbae1, 0x1bb6: 0xbaf9, 0x1bb7: 0x1429, 0x1bb8: 0x1a31, 0x1bb9: 0xbb11, 0x1bba: 0xbb29, 0x1bbb: 0xbb41, 0x1bbc: 0xbb59, 0x1bbd: 0xbb71, 0x1bbe: 0xbb89, 0x1bbf: 0x2109, // Block 0x6f, offset 0x1bc0 0x1bc0: 0x1111, 0x1bc1: 0xbba1, 0x1bc2: 0xbba1, 0x1bc3: 0xbbb9, 0x1bc4: 0xbbd1, 0x1bc5: 0x10e1, 0x1bc6: 0x10f9, 0x1bc7: 0xbbe9, 0x1bc8: 0x2079, 0x1bc9: 0xbc21, 0x1bca: 0xbac9, 0x1bcb: 0x1429, 0x1bcc: 0xbb11, 0x1bcd: 0x10e1, 0x1bce: 0x1111, 0x1bcf: 0x2109, 0x1bd0: 0xbab1, 0x1bd1: 0x1099, 0x1bd2: 0x10b1, 0x1bd3: 0x10c9, 0x1bd4: 0xbac9, 0x1bd5: 0xbae1, 0x1bd6: 0xbaf9, 0x1bd7: 0x1429, 0x1bd8: 0x1a31, 0x1bd9: 0xbb11, 0x1bda: 0xbb29, 0x1bdb: 0xbb41, 0x1bdc: 0xbb59, 0x1bdd: 0xbb71, 0x1bde: 0xbb89, 0x1bdf: 0x2109, 0x1be0: 0x1111, 0x1be1: 0x1429, 0x1be2: 0xbba1, 0x1be3: 0xbbb9, 0x1be4: 0xbbd1, 0x1be5: 0x10e1, 0x1be6: 0x10f9, 0x1be7: 0xbbe9, 0x1be8: 0x2079, 0x1be9: 0xbc01, 0x1bea: 0xbab1, 0x1beb: 0x1099, 0x1bec: 0x10b1, 0x1bed: 0x10c9, 0x1bee: 0xbac9, 0x1bef: 0xbae1, 0x1bf0: 0xbaf9, 0x1bf1: 0x1429, 0x1bf2: 0x1a31, 0x1bf3: 0xbb11, 0x1bf4: 0xbb29, 0x1bf5: 0xbb41, 0x1bf6: 0xbb59, 0x1bf7: 0xbb71, 0x1bf8: 0xbb89, 0x1bf9: 0x2109, 0x1bfa: 0x1111, 0x1bfb: 0xbba1, 0x1bfc: 0xbba1, 0x1bfd: 0xbbb9, 0x1bfe: 0xbbd1, 0x1bff: 0x10e1, // Block 0x70, offset 0x1c00 0x1c00: 0x10f9, 0x1c01: 0xbbe9, 0x1c02: 0x2079, 0x1c03: 0xbc21, 0x1c04: 0xbac9, 0x1c05: 0x1429, 0x1c06: 0xbb11, 0x1c07: 0x10e1, 0x1c08: 0x1111, 0x1c09: 0x2109, 0x1c0a: 0xbc41, 0x1c0b: 0xbc41, 0x1c0c: 0x0040, 0x1c0d: 0x0040, 0x1c0e: 0x1f41, 0x1c0f: 0x00c9, 0x1c10: 0x0069, 0x1c11: 0x0079, 0x1c12: 0x1f51, 0x1c13: 0x1f61, 0x1c14: 0x1f71, 0x1c15: 0x1f81, 0x1c16: 0x1f91, 0x1c17: 0x1fa1, 0x1c18: 0x1f41, 0x1c19: 0x00c9, 0x1c1a: 0x0069, 0x1c1b: 0x0079, 0x1c1c: 0x1f51, 0x1c1d: 0x1f61, 0x1c1e: 0x1f71, 0x1c1f: 0x1f81, 0x1c20: 0x1f91, 0x1c21: 0x1fa1, 0x1c22: 0x1f41, 0x1c23: 0x00c9, 0x1c24: 0x0069, 0x1c25: 0x0079, 0x1c26: 0x1f51, 0x1c27: 0x1f61, 0x1c28: 0x1f71, 0x1c29: 0x1f81, 0x1c2a: 0x1f91, 0x1c2b: 0x1fa1, 0x1c2c: 0x1f41, 0x1c2d: 0x00c9, 0x1c2e: 0x0069, 0x1c2f: 0x0079, 0x1c30: 0x1f51, 0x1c31: 0x1f61, 0x1c32: 0x1f71, 0x1c33: 0x1f81, 0x1c34: 0x1f91, 0x1c35: 0x1fa1, 0x1c36: 0x1f41, 0x1c37: 0x00c9, 0x1c38: 0x0069, 0x1c39: 0x0079, 0x1c3a: 0x1f51, 0x1c3b: 0x1f61, 0x1c3c: 0x1f71, 0x1c3d: 0x1f81, 0x1c3e: 0x1f91, 0x1c3f: 0x1fa1, // Block 0x71, offset 0x1c40 0x1c40: 0xe115, 0x1c41: 0xe115, 0x1c42: 0xe135, 0x1c43: 0xe135, 0x1c44: 0xe115, 0x1c45: 0xe115, 0x1c46: 0xe175, 0x1c47: 0xe175, 0x1c48: 0xe115, 0x1c49: 0xe115, 0x1c4a: 0xe135, 0x1c4b: 0xe135, 0x1c4c: 0xe115, 0x1c4d: 0xe115, 0x1c4e: 0xe1f5, 0x1c4f: 0xe1f5, 0x1c50: 0xe115, 0x1c51: 0xe115, 0x1c52: 0xe135, 0x1c53: 0xe135, 0x1c54: 0xe115, 0x1c55: 0xe115, 0x1c56: 0xe175, 0x1c57: 0xe175, 0x1c58: 0xe115, 0x1c59: 0xe115, 0x1c5a: 0xe135, 0x1c5b: 0xe135, 0x1c5c: 0xe115, 0x1c5d: 0xe115, 0x1c5e: 0x8b05, 0x1c5f: 0x8b05, 0x1c60: 0x04b5, 0x1c61: 0x04b5, 0x1c62: 0x0a08, 0x1c63: 0x0a08, 0x1c64: 0x0a08, 0x1c65: 0x0a08, 0x1c66: 0x0a08, 0x1c67: 0x0a08, 0x1c68: 0x0a08, 0x1c69: 0x0a08, 0x1c6a: 0x0a08, 0x1c6b: 0x0a08, 0x1c6c: 0x0a08, 0x1c6d: 0x0a08, 0x1c6e: 0x0a08, 0x1c6f: 0x0a08, 0x1c70: 0x0a08, 0x1c71: 0x0a08, 0x1c72: 0x0a08, 0x1c73: 0x0a08, 0x1c74: 0x0a08, 0x1c75: 0x0a08, 0x1c76: 0x0a08, 0x1c77: 0x0a08, 0x1c78: 0x0a08, 0x1c79: 0x0a08, 0x1c7a: 0x0a08, 0x1c7b: 0x0a08, 0x1c7c: 0x0a08, 0x1c7d: 0x0a08, 0x1c7e: 0x0a08, 0x1c7f: 0x0a08, // Block 0x72, offset 0x1c80 0x1c80: 0xb189, 0x1c81: 0xb1a1, 0x1c82: 0xb201, 0x1c83: 0xb249, 0x1c84: 0x0040, 0x1c85: 0xb411, 0x1c86: 0xb291, 0x1c87: 0xb219, 0x1c88: 0xb309, 0x1c89: 0xb429, 0x1c8a: 0xb399, 0x1c8b: 0xb3b1, 0x1c8c: 0xb3c9, 0x1c8d: 0xb3e1, 0x1c8e: 0xb2a9, 0x1c8f: 0xb339, 0x1c90: 0xb369, 0x1c91: 0xb2d9, 0x1c92: 0xb381, 0x1c93: 0xb279, 0x1c94: 0xb2c1, 0x1c95: 0xb1d1, 0x1c96: 0xb1e9, 0x1c97: 0xb231, 0x1c98: 0xb261, 0x1c99: 0xb2f1, 0x1c9a: 0xb321, 0x1c9b: 0xb351, 0x1c9c: 0xbc59, 0x1c9d: 0x7949, 0x1c9e: 0xbc71, 0x1c9f: 0xbc89, 0x1ca0: 0x0040, 0x1ca1: 0xb1a1, 0x1ca2: 0xb201, 0x1ca3: 0x0040, 0x1ca4: 0xb3f9, 0x1ca5: 0x0040, 0x1ca6: 0x0040, 0x1ca7: 0xb219, 0x1ca8: 0x0040, 0x1ca9: 0xb429, 0x1caa: 0xb399, 0x1cab: 0xb3b1, 0x1cac: 0xb3c9, 0x1cad: 0xb3e1, 0x1cae: 0xb2a9, 0x1caf: 0xb339, 0x1cb0: 0xb369, 0x1cb1: 0xb2d9, 0x1cb2: 0xb381, 0x1cb3: 0x0040, 0x1cb4: 0xb2c1, 0x1cb5: 0xb1d1, 0x1cb6: 0xb1e9, 0x1cb7: 0xb231, 0x1cb8: 0x0040, 0x1cb9: 0xb2f1, 0x1cba: 0x0040, 0x1cbb: 0xb351, 0x1cbc: 0x0040, 0x1cbd: 0x0040, 0x1cbe: 0x0040, 0x1cbf: 0x0040, // Block 0x73, offset 0x1cc0 0x1cc0: 0x0040, 0x1cc1: 0x0040, 0x1cc2: 0xb201, 0x1cc3: 0x0040, 0x1cc4: 0x0040, 0x1cc5: 0x0040, 0x1cc6: 0x0040, 0x1cc7: 0xb219, 0x1cc8: 0x0040, 0x1cc9: 0xb429, 0x1cca: 0x0040, 0x1ccb: 0xb3b1, 0x1ccc: 0x0040, 0x1ccd: 0xb3e1, 0x1cce: 0xb2a9, 0x1ccf: 0xb339, 0x1cd0: 0x0040, 0x1cd1: 0xb2d9, 0x1cd2: 0xb381, 0x1cd3: 0x0040, 0x1cd4: 0xb2c1, 0x1cd5: 0x0040, 0x1cd6: 0x0040, 0x1cd7: 0xb231, 0x1cd8: 0x0040, 0x1cd9: 0xb2f1, 0x1cda: 0x0040, 0x1cdb: 0xb351, 0x1cdc: 0x0040, 0x1cdd: 0x7949, 0x1cde: 0x0040, 0x1cdf: 0xbc89, 0x1ce0: 0x0040, 0x1ce1: 0xb1a1, 0x1ce2: 0xb201, 0x1ce3: 0x0040, 0x1ce4: 0xb3f9, 0x1ce5: 0x0040, 0x1ce6: 0x0040, 0x1ce7: 0xb219, 0x1ce8: 0xb309, 0x1ce9: 0xb429, 0x1cea: 0xb399, 0x1ceb: 0x0040, 0x1cec: 0xb3c9, 0x1ced: 0xb3e1, 0x1cee: 0xb2a9, 0x1cef: 0xb339, 0x1cf0: 0xb369, 0x1cf1: 0xb2d9, 0x1cf2: 0xb381, 0x1cf3: 0x0040, 0x1cf4: 0xb2c1, 0x1cf5: 0xb1d1, 0x1cf6: 0xb1e9, 0x1cf7: 0xb231, 0x1cf8: 0x0040, 0x1cf9: 0xb2f1, 0x1cfa: 0xb321, 0x1cfb: 0xb351, 0x1cfc: 0xbc59, 0x1cfd: 0x0040, 0x1cfe: 0xbc71, 0x1cff: 0x0040, // Block 0x74, offset 0x1d00 0x1d00: 0xb189, 0x1d01: 0xb1a1, 0x1d02: 0xb201, 0x1d03: 0xb249, 0x1d04: 0xb3f9, 0x1d05: 0xb411, 0x1d06: 0xb291, 0x1d07: 0xb219, 0x1d08: 0xb309, 0x1d09: 0xb429, 0x1d0a: 0x0040, 0x1d0b: 0xb3b1, 0x1d0c: 0xb3c9, 0x1d0d: 0xb3e1, 0x1d0e: 0xb2a9, 0x1d0f: 0xb339, 0x1d10: 0xb369, 0x1d11: 0xb2d9, 0x1d12: 0xb381, 0x1d13: 0xb279, 0x1d14: 0xb2c1, 0x1d15: 0xb1d1, 0x1d16: 0xb1e9, 0x1d17: 0xb231, 0x1d18: 0xb261, 0x1d19: 0xb2f1, 0x1d1a: 0xb321, 0x1d1b: 0xb351, 0x1d1c: 0x0040, 0x1d1d: 0x0040, 0x1d1e: 0x0040, 0x1d1f: 0x0040, 0x1d20: 0x0040, 0x1d21: 0xb1a1, 0x1d22: 0xb201, 0x1d23: 0xb249, 0x1d24: 0x0040, 0x1d25: 0xb411, 0x1d26: 0xb291, 0x1d27: 0xb219, 0x1d28: 0xb309, 0x1d29: 0xb429, 0x1d2a: 0x0040, 0x1d2b: 0xb3b1, 0x1d2c: 0xb3c9, 0x1d2d: 0xb3e1, 0x1d2e: 0xb2a9, 0x1d2f: 0xb339, 0x1d30: 0xb369, 0x1d31: 0xb2d9, 0x1d32: 0xb381, 0x1d33: 0xb279, 0x1d34: 0xb2c1, 0x1d35: 0xb1d1, 0x1d36: 0xb1e9, 0x1d37: 0xb231, 0x1d38: 0xb261, 0x1d39: 0xb2f1, 0x1d3a: 0xb321, 0x1d3b: 0xb351, 0x1d3c: 0x0040, 0x1d3d: 0x0040, 0x1d3e: 0x0040, 0x1d3f: 0x0040, // Block 0x75, offset 0x1d40 0x1d40: 0x0040, 0x1d41: 0xbca2, 0x1d42: 0xbcba, 0x1d43: 0xbcd2, 0x1d44: 0xbcea, 0x1d45: 0xbd02, 0x1d46: 0xbd1a, 0x1d47: 0xbd32, 0x1d48: 0xbd4a, 0x1d49: 0xbd62, 0x1d4a: 0xbd7a, 0x1d4b: 0x0018, 0x1d4c: 0x0018, 0x1d4d: 0x0040, 0x1d4e: 0x0040, 0x1d4f: 0x0040, 0x1d50: 0xbd92, 0x1d51: 0xbdb2, 0x1d52: 0xbdd2, 0x1d53: 0xbdf2, 0x1d54: 0xbe12, 0x1d55: 0xbe32, 0x1d56: 0xbe52, 0x1d57: 0xbe72, 0x1d58: 0xbe92, 0x1d59: 0xbeb2, 0x1d5a: 0xbed2, 0x1d5b: 0xbef2, 0x1d5c: 0xbf12, 0x1d5d: 0xbf32, 0x1d5e: 0xbf52, 0x1d5f: 0xbf72, 0x1d60: 0xbf92, 0x1d61: 0xbfb2, 0x1d62: 0xbfd2, 0x1d63: 0xbff2, 0x1d64: 0xc012, 0x1d65: 0xc032, 0x1d66: 0xc052, 0x1d67: 0xc072, 0x1d68: 0xc092, 0x1d69: 0xc0b2, 0x1d6a: 0xc0d1, 0x1d6b: 0x1159, 0x1d6c: 0x0269, 0x1d6d: 0x6671, 0x1d6e: 0xc111, 0x1d6f: 0x0018, 0x1d70: 0x0039, 0x1d71: 0x0ee9, 0x1d72: 0x1159, 0x1d73: 0x0ef9, 0x1d74: 0x0f09, 0x1d75: 0x1199, 0x1d76: 0x0f31, 0x1d77: 0x0249, 0x1d78: 0x0f41, 0x1d79: 0x0259, 0x1d7a: 0x0f51, 0x1d7b: 0x0359, 0x1d7c: 0x0f61, 0x1d7d: 0x0f71, 0x1d7e: 0x00d9, 0x1d7f: 0x0f99, // Block 0x76, offset 0x1d80 0x1d80: 0x2039, 0x1d81: 0x0269, 0x1d82: 0x01d9, 0x1d83: 0x0fa9, 0x1d84: 0x0fb9, 0x1d85: 0x1089, 0x1d86: 0x0279, 0x1d87: 0x0369, 0x1d88: 0x0289, 0x1d89: 0x13d1, 0x1d8a: 0xc129, 0x1d8b: 0x65b1, 0x1d8c: 0xc141, 0x1d8d: 0x1441, 0x1d8e: 0xc159, 0x1d8f: 0xc179, 0x1d90: 0x0018, 0x1d91: 0x0018, 0x1d92: 0x0018, 0x1d93: 0x0018, 0x1d94: 0x0018, 0x1d95: 0x0018, 0x1d96: 0x0018, 0x1d97: 0x0018, 0x1d98: 0x0018, 0x1d99: 0x0018, 0x1d9a: 0x0018, 0x1d9b: 0x0018, 0x1d9c: 0x0018, 0x1d9d: 0x0018, 0x1d9e: 0x0018, 0x1d9f: 0x0018, 0x1da0: 0x0018, 0x1da1: 0x0018, 0x1da2: 0x0018, 0x1da3: 0x0018, 0x1da4: 0x0018, 0x1da5: 0x0018, 0x1da6: 0x0018, 0x1da7: 0x0018, 0x1da8: 0x0018, 0x1da9: 0x0018, 0x1daa: 0xc191, 0x1dab: 0xc1a9, 0x1dac: 0x0040, 0x1dad: 0x0040, 0x1dae: 0x0040, 0x1daf: 0x0040, 0x1db0: 0x0018, 0x1db1: 0x0018, 0x1db2: 0x0018, 0x1db3: 0x0018, 0x1db4: 0x0018, 0x1db5: 0x0018, 0x1db6: 0x0018, 0x1db7: 0x0018, 0x1db8: 0x0018, 0x1db9: 0x0018, 0x1dba: 0x0018, 0x1dbb: 0x0018, 0x1dbc: 0x0018, 0x1dbd: 0x0018, 0x1dbe: 0x0018, 0x1dbf: 0x0018, // Block 0x77, offset 0x1dc0 0x1dc0: 0xc1d9, 0x1dc1: 0xc211, 0x1dc2: 0xc249, 0x1dc3: 0x0040, 0x1dc4: 0x0040, 0x1dc5: 0x0040, 0x1dc6: 0x0040, 0x1dc7: 0x0040, 0x1dc8: 0x0040, 0x1dc9: 0x0040, 0x1dca: 0x0040, 0x1dcb: 0x0040, 0x1dcc: 0x0040, 0x1dcd: 0x0040, 0x1dce: 0x0040, 0x1dcf: 0x0040, 0x1dd0: 0xc269, 0x1dd1: 0xc289, 0x1dd2: 0xc2a9, 0x1dd3: 0xc2c9, 0x1dd4: 0xc2e9, 0x1dd5: 0xc309, 0x1dd6: 0xc329, 0x1dd7: 0xc349, 0x1dd8: 0xc369, 0x1dd9: 0xc389, 0x1dda: 0xc3a9, 0x1ddb: 0xc3c9, 0x1ddc: 0xc3e9, 0x1ddd: 0xc409, 0x1dde: 0xc429, 0x1ddf: 0xc449, 0x1de0: 0xc469, 0x1de1: 0xc489, 0x1de2: 0xc4a9, 0x1de3: 0xc4c9, 0x1de4: 0xc4e9, 0x1de5: 0xc509, 0x1de6: 0xc529, 0x1de7: 0xc549, 0x1de8: 0xc569, 0x1de9: 0xc589, 0x1dea: 0xc5a9, 0x1deb: 0xc5c9, 0x1dec: 0xc5e9, 0x1ded: 0xc609, 0x1dee: 0xc629, 0x1def: 0xc649, 0x1df0: 0xc669, 0x1df1: 0xc689, 0x1df2: 0xc6a9, 0x1df3: 0xc6c9, 0x1df4: 0xc6e9, 0x1df5: 0xc709, 0x1df6: 0xc729, 0x1df7: 0xc749, 0x1df8: 0xc769, 0x1df9: 0xc789, 0x1dfa: 0xc7a9, 0x1dfb: 0xc7c9, 0x1dfc: 0x0040, 0x1dfd: 0x0040, 0x1dfe: 0x0040, 0x1dff: 0x0040, // Block 0x78, offset 0x1e00 0x1e00: 0xcaf9, 0x1e01: 0xcb19, 0x1e02: 0xcb39, 0x1e03: 0x8b1d, 0x1e04: 0xcb59, 0x1e05: 0xcb79, 0x1e06: 0xcb99, 0x1e07: 0xcbb9, 0x1e08: 0xcbd9, 0x1e09: 0xcbf9, 0x1e0a: 0xcc19, 0x1e0b: 0xcc39, 0x1e0c: 0xcc59, 0x1e0d: 0x8b3d, 0x1e0e: 0xcc79, 0x1e0f: 0xcc99, 0x1e10: 0xccb9, 0x1e11: 0xccd9, 0x1e12: 0x8b5d, 0x1e13: 0xccf9, 0x1e14: 0xcd19, 0x1e15: 0xc429, 0x1e16: 0x8b7d, 0x1e17: 0xcd39, 0x1e18: 0xcd59, 0x1e19: 0xcd79, 0x1e1a: 0xcd99, 0x1e1b: 0xcdb9, 0x1e1c: 0x8b9d, 0x1e1d: 0xcdd9, 0x1e1e: 0xcdf9, 0x1e1f: 0xce19, 0x1e20: 0xce39, 0x1e21: 0xce59, 0x1e22: 0xc789, 0x1e23: 0xce79, 0x1e24: 0xce99, 0x1e25: 0xceb9, 0x1e26: 0xced9, 0x1e27: 0xcef9, 0x1e28: 0xcf19, 0x1e29: 0xcf39, 0x1e2a: 0xcf59, 0x1e2b: 0xcf79, 0x1e2c: 0xcf99, 0x1e2d: 0xcfb9, 0x1e2e: 0xcfd9, 0x1e2f: 0xcff9, 0x1e30: 0xd019, 0x1e31: 0xd039, 0x1e32: 0xd039, 0x1e33: 0xd039, 0x1e34: 0x8bbd, 0x1e35: 0xd059, 0x1e36: 0xd079, 0x1e37: 0xd099, 0x1e38: 0x8bdd, 0x1e39: 0xd0b9, 0x1e3a: 0xd0d9, 0x1e3b: 0xd0f9, 0x1e3c: 0xd119, 0x1e3d: 0xd139, 0x1e3e: 0xd159, 0x1e3f: 0xd179, // Block 0x79, offset 0x1e40 0x1e40: 0xd199, 0x1e41: 0xd1b9, 0x1e42: 0xd1d9, 0x1e43: 0xd1f9, 0x1e44: 0xd219, 0x1e45: 0xd239, 0x1e46: 0xd239, 0x1e47: 0xd259, 0x1e48: 0xd279, 0x1e49: 0xd299, 0x1e4a: 0xd2b9, 0x1e4b: 0xd2d9, 0x1e4c: 0xd2f9, 0x1e4d: 0xd319, 0x1e4e: 0xd339, 0x1e4f: 0xd359, 0x1e50: 0xd379, 0x1e51: 0xd399, 0x1e52: 0xd3b9, 0x1e53: 0xd3d9, 0x1e54: 0xd3f9, 0x1e55: 0xd419, 0x1e56: 0xd439, 0x1e57: 0xd459, 0x1e58: 0xd479, 0x1e59: 0x8bfd, 0x1e5a: 0xd499, 0x1e5b: 0xd4b9, 0x1e5c: 0xd4d9, 0x1e5d: 0xc309, 0x1e5e: 0xd4f9, 0x1e5f: 0xd519, 0x1e60: 0x8c1d, 0x1e61: 0x8c3d, 0x1e62: 0xd539, 0x1e63: 0xd559, 0x1e64: 0xd579, 0x1e65: 0xd599, 0x1e66: 0xd5b9, 0x1e67: 0xd5d9, 0x1e68: 0x2040, 0x1e69: 0xd5f9, 0x1e6a: 0xd619, 0x1e6b: 0xd619, 0x1e6c: 0x8c5d, 0x1e6d: 0xd639, 0x1e6e: 0xd659, 0x1e6f: 0xd679, 0x1e70: 0xd699, 0x1e71: 0x8c7d, 0x1e72: 0xd6b9, 0x1e73: 0xd6d9, 0x1e74: 0x2040, 0x1e75: 0xd6f9, 0x1e76: 0xd719, 0x1e77: 0xd739, 0x1e78: 0xd759, 0x1e79: 0xd779, 0x1e7a: 0xd799, 0x1e7b: 0x8c9d, 0x1e7c: 0xd7b9, 0x1e7d: 0x8cbd, 0x1e7e: 0xd7d9, 0x1e7f: 0xd7f9, // Block 0x7a, offset 0x1e80 0x1e80: 0xd819, 0x1e81: 0xd839, 0x1e82: 0xd859, 0x1e83: 0xd879, 0x1e84: 0xd899, 0x1e85: 0xd8b9, 0x1e86: 0xd8d9, 0x1e87: 0xd8f9, 0x1e88: 0xd919, 0x1e89: 0x8cdd, 0x1e8a: 0xd939, 0x1e8b: 0xd959, 0x1e8c: 0xd979, 0x1e8d: 0xd999, 0x1e8e: 0xd9b9, 0x1e8f: 0x8cfd, 0x1e90: 0xd9d9, 0x1e91: 0x8d1d, 0x1e92: 0x8d3d, 0x1e93: 0xd9f9, 0x1e94: 0xda19, 0x1e95: 0xda19, 0x1e96: 0xda39, 0x1e97: 0x8d5d, 0x1e98: 0x8d7d, 0x1e99: 0xda59, 0x1e9a: 0xda79, 0x1e9b: 0xda99, 0x1e9c: 0xdab9, 0x1e9d: 0xdad9, 0x1e9e: 0xdaf9, 0x1e9f: 0xdb19, 0x1ea0: 0xdb39, 0x1ea1: 0xdb59, 0x1ea2: 0xdb79, 0x1ea3: 0xdb99, 0x1ea4: 0x8d9d, 0x1ea5: 0xdbb9, 0x1ea6: 0xdbd9, 0x1ea7: 0xdbf9, 0x1ea8: 0xdc19, 0x1ea9: 0xdbf9, 0x1eaa: 0xdc39, 0x1eab: 0xdc59, 0x1eac: 0xdc79, 0x1ead: 0xdc99, 0x1eae: 0xdcb9, 0x1eaf: 0xdcd9, 0x1eb0: 0xdcf9, 0x1eb1: 0xdd19, 0x1eb2: 0xdd39, 0x1eb3: 0xdd59, 0x1eb4: 0xdd79, 0x1eb5: 0xdd99, 0x1eb6: 0xddb9, 0x1eb7: 0xddd9, 0x1eb8: 0x8dbd, 0x1eb9: 0xddf9, 0x1eba: 0xde19, 0x1ebb: 0xde39, 0x1ebc: 0xde59, 0x1ebd: 0xde79, 0x1ebe: 0x8ddd, 0x1ebf: 0xde99, // Block 0x7b, offset 0x1ec0 0x1ec0: 0xe599, 0x1ec1: 0xe5b9, 0x1ec2: 0xe5d9, 0x1ec3: 0xe5f9, 0x1ec4: 0xe619, 0x1ec5: 0xe639, 0x1ec6: 0x8efd, 0x1ec7: 0xe659, 0x1ec8: 0xe679, 0x1ec9: 0xe699, 0x1eca: 0xe6b9, 0x1ecb: 0xe6d9, 0x1ecc: 0xe6f9, 0x1ecd: 0x8f1d, 0x1ece: 0xe719, 0x1ecf: 0xe739, 0x1ed0: 0x8f3d, 0x1ed1: 0x8f5d, 0x1ed2: 0xe759, 0x1ed3: 0xe779, 0x1ed4: 0xe799, 0x1ed5: 0xe7b9, 0x1ed6: 0xe7d9, 0x1ed7: 0xe7f9, 0x1ed8: 0xe819, 0x1ed9: 0xe839, 0x1eda: 0xe859, 0x1edb: 0x8f7d, 0x1edc: 0xe879, 0x1edd: 0x8f9d, 0x1ede: 0xe899, 0x1edf: 0x2040, 0x1ee0: 0xe8b9, 0x1ee1: 0xe8d9, 0x1ee2: 0xe8f9, 0x1ee3: 0x8fbd, 0x1ee4: 0xe919, 0x1ee5: 0xe939, 0x1ee6: 0x8fdd, 0x1ee7: 0x8ffd, 0x1ee8: 0xe959, 0x1ee9: 0xe979, 0x1eea: 0xe999, 0x1eeb: 0xe9b9, 0x1eec: 0xe9d9, 0x1eed: 0xe9d9, 0x1eee: 0xe9f9, 0x1eef: 0xea19, 0x1ef0: 0xea39, 0x1ef1: 0xea59, 0x1ef2: 0xea79, 0x1ef3: 0xea99, 0x1ef4: 0xeab9, 0x1ef5: 0x901d, 0x1ef6: 0xead9, 0x1ef7: 0x903d, 0x1ef8: 0xeaf9, 0x1ef9: 0x905d, 0x1efa: 0xeb19, 0x1efb: 0x907d, 0x1efc: 0x909d, 0x1efd: 0x90bd, 0x1efe: 0xeb39, 0x1eff: 0xeb59, // Block 0x7c, offset 0x1f00 0x1f00: 0xeb79, 0x1f01: 0x90dd, 0x1f02: 0x90fd, 0x1f03: 0x911d, 0x1f04: 0x913d, 0x1f05: 0xeb99, 0x1f06: 0xebb9, 0x1f07: 0xebb9, 0x1f08: 0xebd9, 0x1f09: 0xebf9, 0x1f0a: 0xec19, 0x1f0b: 0xec39, 0x1f0c: 0xec59, 0x1f0d: 0x915d, 0x1f0e: 0xec79, 0x1f0f: 0xec99, 0x1f10: 0xecb9, 0x1f11: 0xecd9, 0x1f12: 0x917d, 0x1f13: 0xecf9, 0x1f14: 0x919d, 0x1f15: 0x91bd, 0x1f16: 0xed19, 0x1f17: 0xed39, 0x1f18: 0xed59, 0x1f19: 0xed79, 0x1f1a: 0xed99, 0x1f1b: 0xedb9, 0x1f1c: 0x91dd, 0x1f1d: 0x91fd, 0x1f1e: 0x921d, 0x1f1f: 0x2040, 0x1f20: 0xedd9, 0x1f21: 0x923d, 0x1f22: 0xedf9, 0x1f23: 0xee19, 0x1f24: 0xee39, 0x1f25: 0x925d, 0x1f26: 0xee59, 0x1f27: 0xee79, 0x1f28: 0xee99, 0x1f29: 0xeeb9, 0x1f2a: 0xeed9, 0x1f2b: 0x927d, 0x1f2c: 0xeef9, 0x1f2d: 0xef19, 0x1f2e: 0xef39, 0x1f2f: 0xef59, 0x1f30: 0xef79, 0x1f31: 0xef99, 0x1f32: 0x929d, 0x1f33: 0x92bd, 0x1f34: 0xefb9, 0x1f35: 0x92dd, 0x1f36: 0xefd9, 0x1f37: 0x92fd, 0x1f38: 0xeff9, 0x1f39: 0xf019, 0x1f3a: 0xf039, 0x1f3b: 0x931d, 0x1f3c: 0x933d, 0x1f3d: 0xf059, 0x1f3e: 0x935d, 0x1f3f: 0xf079, // Block 0x7d, offset 0x1f40 0x1f40: 0xf6b9, 0x1f41: 0xf6d9, 0x1f42: 0xf6f9, 0x1f43: 0xf719, 0x1f44: 0xf739, 0x1f45: 0x951d, 0x1f46: 0xf759, 0x1f47: 0xf779, 0x1f48: 0xf799, 0x1f49: 0xf7b9, 0x1f4a: 0xf7d9, 0x1f4b: 0x953d, 0x1f4c: 0x955d, 0x1f4d: 0xf7f9, 0x1f4e: 0xf819, 0x1f4f: 0xf839, 0x1f50: 0xf859, 0x1f51: 0xf879, 0x1f52: 0xf899, 0x1f53: 0x957d, 0x1f54: 0xf8b9, 0x1f55: 0xf8d9, 0x1f56: 0xf8f9, 0x1f57: 0xf919, 0x1f58: 0x959d, 0x1f59: 0x95bd, 0x1f5a: 0xf939, 0x1f5b: 0xf959, 0x1f5c: 0xf979, 0x1f5d: 0x95dd, 0x1f5e: 0xf999, 0x1f5f: 0xf9b9, 0x1f60: 0x6815, 0x1f61: 0x95fd, 0x1f62: 0xf9d9, 0x1f63: 0xf9f9, 0x1f64: 0xfa19, 0x1f65: 0x961d, 0x1f66: 0xfa39, 0x1f67: 0xfa59, 0x1f68: 0xfa79, 0x1f69: 0xfa99, 0x1f6a: 0xfab9, 0x1f6b: 0xfad9, 0x1f6c: 0xfaf9, 0x1f6d: 0x963d, 0x1f6e: 0xfb19, 0x1f6f: 0xfb39, 0x1f70: 0xfb59, 0x1f71: 0x965d, 0x1f72: 0xfb79, 0x1f73: 0xfb99, 0x1f74: 0xfbb9, 0x1f75: 0xfbd9, 0x1f76: 0x7b35, 0x1f77: 0x967d, 0x1f78: 0xfbf9, 0x1f79: 0xfc19, 0x1f7a: 0xfc39, 0x1f7b: 0x969d, 0x1f7c: 0xfc59, 0x1f7d: 0x96bd, 0x1f7e: 0xfc79, 0x1f7f: 0xfc79, // Block 0x7e, offset 0x1f80 0x1f80: 0xfc99, 0x1f81: 0x96dd, 0x1f82: 0xfcb9, 0x1f83: 0xfcd9, 0x1f84: 0xfcf9, 0x1f85: 0xfd19, 0x1f86: 0xfd39, 0x1f87: 0xfd59, 0x1f88: 0xfd79, 0x1f89: 0x96fd, 0x1f8a: 0xfd99, 0x1f8b: 0xfdb9, 0x1f8c: 0xfdd9, 0x1f8d: 0xfdf9, 0x1f8e: 0xfe19, 0x1f8f: 0xfe39, 0x1f90: 0x971d, 0x1f91: 0xfe59, 0x1f92: 0x973d, 0x1f93: 0x975d, 0x1f94: 0x977d, 0x1f95: 0xfe79, 0x1f96: 0xfe99, 0x1f97: 0xfeb9, 0x1f98: 0xfed9, 0x1f99: 0xfef9, 0x1f9a: 0xff19, 0x1f9b: 0xff39, 0x1f9c: 0xff59, 0x1f9d: 0x979d, 0x1f9e: 0x0040, 0x1f9f: 0x0040, 0x1fa0: 0x0040, 0x1fa1: 0x0040, 0x1fa2: 0x0040, 0x1fa3: 0x0040, 0x1fa4: 0x0040, 0x1fa5: 0x0040, 0x1fa6: 0x0040, 0x1fa7: 0x0040, 0x1fa8: 0x0040, 0x1fa9: 0x0040, 0x1faa: 0x0040, 0x1fab: 0x0040, 0x1fac: 0x0040, 0x1fad: 0x0040, 0x1fae: 0x0040, 0x1faf: 0x0040, 0x1fb0: 0x0040, 0x1fb1: 0x0040, 0x1fb2: 0x0040, 0x1fb3: 0x0040, 0x1fb4: 0x0040, 0x1fb5: 0x0040, 0x1fb6: 0x0040, 0x1fb7: 0x0040, 0x1fb8: 0x0040, 0x1fb9: 0x0040, 0x1fba: 0x0040, 0x1fbb: 0x0040, 0x1fbc: 0x0040, 0x1fbd: 0x0040, 0x1fbe: 0x0040, 0x1fbf: 0x0040, } // idnaIndex: 36 blocks, 2304 entries, 4608 bytes // Block 0 is the zero block. var idnaIndex = [2304]uint16{ // Block 0x0, offset 0x0 // Block 0x1, offset 0x40 // Block 0x2, offset 0x80 // Block 0x3, offset 0xc0 0xc2: 0x01, 0xc3: 0x7d, 0xc4: 0x02, 0xc5: 0x03, 0xc6: 0x04, 0xc7: 0x05, 0xc8: 0x06, 0xc9: 0x7e, 0xca: 0x7f, 0xcb: 0x07, 0xcc: 0x80, 0xcd: 0x08, 0xce: 0x09, 0xcf: 0x0a, 0xd0: 0x81, 0xd1: 0x0b, 0xd2: 0x0c, 0xd3: 0x0d, 0xd4: 0x0e, 0xd5: 0x82, 0xd6: 0x83, 0xd7: 0x84, 0xd8: 0x0f, 0xd9: 0x10, 0xda: 0x85, 0xdb: 0x11, 0xdc: 0x12, 0xdd: 0x86, 0xde: 0x87, 0xdf: 0x88, 0xe0: 0x02, 0xe1: 0x03, 0xe2: 0x04, 0xe3: 0x05, 0xe4: 0x06, 0xe5: 0x07, 0xe6: 0x07, 0xe7: 0x07, 0xe8: 0x07, 0xe9: 0x08, 0xea: 0x09, 0xeb: 0x07, 0xec: 0x07, 0xed: 0x0a, 0xee: 0x0b, 0xef: 0x0c, 0xf0: 0x1d, 0xf1: 0x1e, 0xf2: 0x1e, 0xf3: 0x20, 0xf4: 0x21, // Block 0x4, offset 0x100 0x120: 0x89, 0x121: 0x13, 0x122: 0x8a, 0x123: 0x8b, 0x124: 0x8c, 0x125: 0x14, 0x126: 0x15, 0x127: 0x16, 0x128: 0x17, 0x129: 0x18, 0x12a: 0x19, 0x12b: 0x1a, 0x12c: 0x1b, 0x12d: 0x1c, 0x12e: 0x1d, 0x12f: 0x8d, 0x130: 0x8e, 0x131: 0x1e, 0x132: 0x1f, 0x133: 0x20, 0x134: 0x8f, 0x135: 0x21, 0x136: 0x90, 0x137: 0x91, 0x138: 0x92, 0x139: 0x93, 0x13a: 0x22, 0x13b: 0x94, 0x13c: 0x95, 0x13d: 0x23, 0x13e: 0x24, 0x13f: 0x96, // Block 0x5, offset 0x140 0x140: 0x97, 0x141: 0x98, 0x142: 0x99, 0x143: 0x9a, 0x144: 0x9b, 0x145: 0x9c, 0x146: 0x9d, 0x147: 0x9e, 0x148: 0x9f, 0x149: 0xa0, 0x14a: 0xa1, 0x14b: 0xa2, 0x14c: 0xa3, 0x14d: 0xa4, 0x14e: 0xa5, 0x14f: 0xa6, 0x150: 0xa7, 0x151: 0x9f, 0x152: 0x9f, 0x153: 0x9f, 0x154: 0x9f, 0x155: 0x9f, 0x156: 0x9f, 0x157: 0x9f, 0x158: 0x9f, 0x159: 0xa8, 0x15a: 0xa9, 0x15b: 0xaa, 0x15c: 0xab, 0x15d: 0xac, 0x15e: 0xad, 0x15f: 0xae, 0x160: 0xaf, 0x161: 0xb0, 0x162: 0xb1, 0x163: 0xb2, 0x164: 0xb3, 0x165: 0xb4, 0x166: 0xb5, 0x167: 0xb6, 0x168: 0xb7, 0x169: 0xb8, 0x16a: 0xb9, 0x16b: 0xba, 0x16c: 0xbb, 0x16d: 0xbc, 0x16e: 0xbd, 0x16f: 0xbe, 0x170: 0xbf, 0x171: 0xc0, 0x172: 0xc1, 0x173: 0xc2, 0x174: 0x25, 0x175: 0x26, 0x176: 0x27, 0x177: 0xc3, 0x178: 0x28, 0x179: 0x28, 0x17a: 0x29, 0x17b: 0x28, 0x17c: 0xc4, 0x17d: 0x2a, 0x17e: 0x2b, 0x17f: 0x2c, // Block 0x6, offset 0x180 0x180: 0x2d, 0x181: 0x2e, 0x182: 0x2f, 0x183: 0xc5, 0x184: 0x30, 0x185: 0x31, 0x186: 0xc6, 0x187: 0x9b, 0x188: 0xc7, 0x189: 0xc8, 0x18a: 0x9b, 0x18b: 0x9b, 0x18c: 0xc9, 0x18d: 0x9b, 0x18e: 0x9b, 0x18f: 0x9b, 0x190: 0xca, 0x191: 0x32, 0x192: 0x33, 0x193: 0x34, 0x194: 0x9b, 0x195: 0x9b, 0x196: 0x9b, 0x197: 0x9b, 0x198: 0x9b, 0x199: 0x9b, 0x19a: 0x9b, 0x19b: 0x9b, 0x19c: 0x9b, 0x19d: 0x9b, 0x19e: 0x9b, 0x19f: 0x9b, 0x1a0: 0x9b, 0x1a1: 0x9b, 0x1a2: 0x9b, 0x1a3: 0x9b, 0x1a4: 0x9b, 0x1a5: 0x9b, 0x1a6: 0x9b, 0x1a7: 0x9b, 0x1a8: 0xcb, 0x1a9: 0xcc, 0x1aa: 0x9b, 0x1ab: 0xcd, 0x1ac: 0x9b, 0x1ad: 0xce, 0x1ae: 0xcf, 0x1af: 0xd0, 0x1b0: 0xd1, 0x1b1: 0x35, 0x1b2: 0x28, 0x1b3: 0x36, 0x1b4: 0xd2, 0x1b5: 0xd3, 0x1b6: 0xd4, 0x1b7: 0xd5, 0x1b8: 0xd6, 0x1b9: 0xd7, 0x1ba: 0xd8, 0x1bb: 0xd9, 0x1bc: 0xda, 0x1bd: 0xdb, 0x1be: 0xdc, 0x1bf: 0x37, // Block 0x7, offset 0x1c0 0x1c0: 0x38, 0x1c1: 0xdd, 0x1c2: 0xde, 0x1c3: 0xdf, 0x1c4: 0xe0, 0x1c5: 0x39, 0x1c6: 0x3a, 0x1c7: 0xe1, 0x1c8: 0xe2, 0x1c9: 0x3b, 0x1ca: 0x3c, 0x1cb: 0x3d, 0x1cc: 0x3e, 0x1cd: 0x3f, 0x1ce: 0x40, 0x1cf: 0x41, 0x1d0: 0x9f, 0x1d1: 0x9f, 0x1d2: 0x9f, 0x1d3: 0x9f, 0x1d4: 0x9f, 0x1d5: 0x9f, 0x1d6: 0x9f, 0x1d7: 0x9f, 0x1d8: 0x9f, 0x1d9: 0x9f, 0x1da: 0x9f, 0x1db: 0x9f, 0x1dc: 0x9f, 0x1dd: 0x9f, 0x1de: 0x9f, 0x1df: 0x9f, 0x1e0: 0x9f, 0x1e1: 0x9f, 0x1e2: 0x9f, 0x1e3: 0x9f, 0x1e4: 0x9f, 0x1e5: 0x9f, 0x1e6: 0x9f, 0x1e7: 0x9f, 0x1e8: 0x9f, 0x1e9: 0x9f, 0x1ea: 0x9f, 0x1eb: 0x9f, 0x1ec: 0x9f, 0x1ed: 0x9f, 0x1ee: 0x9f, 0x1ef: 0x9f, 0x1f0: 0x9f, 0x1f1: 0x9f, 0x1f2: 0x9f, 0x1f3: 0x9f, 0x1f4: 0x9f, 0x1f5: 0x9f, 0x1f6: 0x9f, 0x1f7: 0x9f, 0x1f8: 0x9f, 0x1f9: 0x9f, 0x1fa: 0x9f, 0x1fb: 0x9f, 0x1fc: 0x9f, 0x1fd: 0x9f, 0x1fe: 0x9f, 0x1ff: 0x9f, // Block 0x8, offset 0x200 0x200: 0x9f, 0x201: 0x9f, 0x202: 0x9f, 0x203: 0x9f, 0x204: 0x9f, 0x205: 0x9f, 0x206: 0x9f, 0x207: 0x9f, 0x208: 0x9f, 0x209: 0x9f, 0x20a: 0x9f, 0x20b: 0x9f, 0x20c: 0x9f, 0x20d: 0x9f, 0x20e: 0x9f, 0x20f: 0x9f, 0x210: 0x9f, 0x211: 0x9f, 0x212: 0x9f, 0x213: 0x9f, 0x214: 0x9f, 0x215: 0x9f, 0x216: 0x9f, 0x217: 0x9f, 0x218: 0x9f, 0x219: 0x9f, 0x21a: 0x9f, 0x21b: 0x9f, 0x21c: 0x9f, 0x21d: 0x9f, 0x21e: 0x9f, 0x21f: 0x9f, 0x220: 0x9f, 0x221: 0x9f, 0x222: 0x9f, 0x223: 0x9f, 0x224: 0x9f, 0x225: 0x9f, 0x226: 0x9f, 0x227: 0x9f, 0x228: 0x9f, 0x229: 0x9f, 0x22a: 0x9f, 0x22b: 0x9f, 0x22c: 0x9f, 0x22d: 0x9f, 0x22e: 0x9f, 0x22f: 0x9f, 0x230: 0x9f, 0x231: 0x9f, 0x232: 0x9f, 0x233: 0x9f, 0x234: 0x9f, 0x235: 0x9f, 0x236: 0xb2, 0x237: 0x9b, 0x238: 0x9f, 0x239: 0x9f, 0x23a: 0x9f, 0x23b: 0x9f, 0x23c: 0x9f, 0x23d: 0x9f, 0x23e: 0x9f, 0x23f: 0x9f, // Block 0x9, offset 0x240 0x240: 0x9f, 0x241: 0x9f, 0x242: 0x9f, 0x243: 0x9f, 0x244: 0x9f, 0x245: 0x9f, 0x246: 0x9f, 0x247: 0x9f, 0x248: 0x9f, 0x249: 0x9f, 0x24a: 0x9f, 0x24b: 0x9f, 0x24c: 0x9f, 0x24d: 0x9f, 0x24e: 0x9f, 0x24f: 0x9f, 0x250: 0x9f, 0x251: 0x9f, 0x252: 0x9f, 0x253: 0x9f, 0x254: 0x9f, 0x255: 0x9f, 0x256: 0x9f, 0x257: 0x9f, 0x258: 0x9f, 0x259: 0x9f, 0x25a: 0x9f, 0x25b: 0x9f, 0x25c: 0x9f, 0x25d: 0x9f, 0x25e: 0x9f, 0x25f: 0x9f, 0x260: 0x9f, 0x261: 0x9f, 0x262: 0x9f, 0x263: 0x9f, 0x264: 0x9f, 0x265: 0x9f, 0x266: 0x9f, 0x267: 0x9f, 0x268: 0x9f, 0x269: 0x9f, 0x26a: 0x9f, 0x26b: 0x9f, 0x26c: 0x9f, 0x26d: 0x9f, 0x26e: 0x9f, 0x26f: 0x9f, 0x270: 0x9f, 0x271: 0x9f, 0x272: 0x9f, 0x273: 0x9f, 0x274: 0x9f, 0x275: 0x9f, 0x276: 0x9f, 0x277: 0x9f, 0x278: 0x9f, 0x279: 0x9f, 0x27a: 0x9f, 0x27b: 0x9f, 0x27c: 0x9f, 0x27d: 0x9f, 0x27e: 0x9f, 0x27f: 0x9f, // Block 0xa, offset 0x280 0x280: 0x9f, 0x281: 0x9f, 0x282: 0x9f, 0x283: 0x9f, 0x284: 0x9f, 0x285: 0x9f, 0x286: 0x9f, 0x287: 0x9f, 0x288: 0x9f, 0x289: 0x9f, 0x28a: 0x9f, 0x28b: 0x9f, 0x28c: 0x9f, 0x28d: 0x9f, 0x28e: 0x9f, 0x28f: 0x9f, 0x290: 0x9f, 0x291: 0x9f, 0x292: 0x9f, 0x293: 0x9f, 0x294: 0x9f, 0x295: 0x9f, 0x296: 0x9f, 0x297: 0x9f, 0x298: 0x9f, 0x299: 0x9f, 0x29a: 0x9f, 0x29b: 0x9f, 0x29c: 0x9f, 0x29d: 0x9f, 0x29e: 0x9f, 0x29f: 0x9f, 0x2a0: 0x9f, 0x2a1: 0x9f, 0x2a2: 0x9f, 0x2a3: 0x9f, 0x2a4: 0x9f, 0x2a5: 0x9f, 0x2a6: 0x9f, 0x2a7: 0x9f, 0x2a8: 0x9f, 0x2a9: 0x9f, 0x2aa: 0x9f, 0x2ab: 0x9f, 0x2ac: 0x9f, 0x2ad: 0x9f, 0x2ae: 0x9f, 0x2af: 0x9f, 0x2b0: 0x9f, 0x2b1: 0x9f, 0x2b2: 0x9f, 0x2b3: 0x9f, 0x2b4: 0x9f, 0x2b5: 0x9f, 0x2b6: 0x9f, 0x2b7: 0x9f, 0x2b8: 0x9f, 0x2b9: 0x9f, 0x2ba: 0x9f, 0x2bb: 0x9f, 0x2bc: 0x9f, 0x2bd: 0x9f, 0x2be: 0x9f, 0x2bf: 0xe3, // Block 0xb, offset 0x2c0 0x2c0: 0x9f, 0x2c1: 0x9f, 0x2c2: 0x9f, 0x2c3: 0x9f, 0x2c4: 0x9f, 0x2c5: 0x9f, 0x2c6: 0x9f, 0x2c7: 0x9f, 0x2c8: 0x9f, 0x2c9: 0x9f, 0x2ca: 0x9f, 0x2cb: 0x9f, 0x2cc: 0x9f, 0x2cd: 0x9f, 0x2ce: 0x9f, 0x2cf: 0x9f, 0x2d0: 0x9f, 0x2d1: 0x9f, 0x2d2: 0xe4, 0x2d3: 0xe5, 0x2d4: 0x9f, 0x2d5: 0x9f, 0x2d6: 0x9f, 0x2d7: 0x9f, 0x2d8: 0xe6, 0x2d9: 0x42, 0x2da: 0x43, 0x2db: 0xe7, 0x2dc: 0x44, 0x2dd: 0x45, 0x2de: 0x46, 0x2df: 0xe8, 0x2e0: 0xe9, 0x2e1: 0xea, 0x2e2: 0xeb, 0x2e3: 0xec, 0x2e4: 0xed, 0x2e5: 0xee, 0x2e6: 0xef, 0x2e7: 0xf0, 0x2e8: 0xf1, 0x2e9: 0xf2, 0x2ea: 0xf3, 0x2eb: 0xf4, 0x2ec: 0xf5, 0x2ed: 0xf6, 0x2ee: 0xf7, 0x2ef: 0xf8, 0x2f0: 0x9f, 0x2f1: 0x9f, 0x2f2: 0x9f, 0x2f3: 0x9f, 0x2f4: 0x9f, 0x2f5: 0x9f, 0x2f6: 0x9f, 0x2f7: 0x9f, 0x2f8: 0x9f, 0x2f9: 0x9f, 0x2fa: 0x9f, 0x2fb: 0x9f, 0x2fc: 0x9f, 0x2fd: 0x9f, 0x2fe: 0x9f, 0x2ff: 0x9f, // Block 0xc, offset 0x300 0x300: 0x9f, 0x301: 0x9f, 0x302: 0x9f, 0x303: 0x9f, 0x304: 0x9f, 0x305: 0x9f, 0x306: 0x9f, 0x307: 0x9f, 0x308: 0x9f, 0x309: 0x9f, 0x30a: 0x9f, 0x30b: 0x9f, 0x30c: 0x9f, 0x30d: 0x9f, 0x30e: 0x9f, 0x30f: 0x9f, 0x310: 0x9f, 0x311: 0x9f, 0x312: 0x9f, 0x313: 0x9f, 0x314: 0x9f, 0x315: 0x9f, 0x316: 0x9f, 0x317: 0x9f, 0x318: 0x9f, 0x319: 0x9f, 0x31a: 0x9f, 0x31b: 0x9f, 0x31c: 0x9f, 0x31d: 0x9f, 0x31e: 0xf9, 0x31f: 0xfa, // Block 0xd, offset 0x340 0x340: 0xba, 0x341: 0xba, 0x342: 0xba, 0x343: 0xba, 0x344: 0xba, 0x345: 0xba, 0x346: 0xba, 0x347: 0xba, 0x348: 0xba, 0x349: 0xba, 0x34a: 0xba, 0x34b: 0xba, 0x34c: 0xba, 0x34d: 0xba, 0x34e: 0xba, 0x34f: 0xba, 0x350: 0xba, 0x351: 0xba, 0x352: 0xba, 0x353: 0xba, 0x354: 0xba, 0x355: 0xba, 0x356: 0xba, 0x357: 0xba, 0x358: 0xba, 0x359: 0xba, 0x35a: 0xba, 0x35b: 0xba, 0x35c: 0xba, 0x35d: 0xba, 0x35e: 0xba, 0x35f: 0xba, 0x360: 0xba, 0x361: 0xba, 0x362: 0xba, 0x363: 0xba, 0x364: 0xba, 0x365: 0xba, 0x366: 0xba, 0x367: 0xba, 0x368: 0xba, 0x369: 0xba, 0x36a: 0xba, 0x36b: 0xba, 0x36c: 0xba, 0x36d: 0xba, 0x36e: 0xba, 0x36f: 0xba, 0x370: 0xba, 0x371: 0xba, 0x372: 0xba, 0x373: 0xba, 0x374: 0xba, 0x375: 0xba, 0x376: 0xba, 0x377: 0xba, 0x378: 0xba, 0x379: 0xba, 0x37a: 0xba, 0x37b: 0xba, 0x37c: 0xba, 0x37d: 0xba, 0x37e: 0xba, 0x37f: 0xba, // Block 0xe, offset 0x380 0x380: 0xba, 0x381: 0xba, 0x382: 0xba, 0x383: 0xba, 0x384: 0xba, 0x385: 0xba, 0x386: 0xba, 0x387: 0xba, 0x388: 0xba, 0x389: 0xba, 0x38a: 0xba, 0x38b: 0xba, 0x38c: 0xba, 0x38d: 0xba, 0x38e: 0xba, 0x38f: 0xba, 0x390: 0xba, 0x391: 0xba, 0x392: 0xba, 0x393: 0xba, 0x394: 0xba, 0x395: 0xba, 0x396: 0xba, 0x397: 0xba, 0x398: 0xba, 0x399: 0xba, 0x39a: 0xba, 0x39b: 0xba, 0x39c: 0xba, 0x39d: 0xba, 0x39e: 0xba, 0x39f: 0xba, 0x3a0: 0xba, 0x3a1: 0xba, 0x3a2: 0xba, 0x3a3: 0xba, 0x3a4: 0xfb, 0x3a5: 0xfc, 0x3a6: 0xfd, 0x3a7: 0xfe, 0x3a8: 0x47, 0x3a9: 0xff, 0x3aa: 0x100, 0x3ab: 0x48, 0x3ac: 0x49, 0x3ad: 0x4a, 0x3ae: 0x4b, 0x3af: 0x4c, 0x3b0: 0x101, 0x3b1: 0x4d, 0x3b2: 0x4e, 0x3b3: 0x4f, 0x3b4: 0x50, 0x3b5: 0x51, 0x3b6: 0x102, 0x3b7: 0x52, 0x3b8: 0x53, 0x3b9: 0x54, 0x3ba: 0x55, 0x3bb: 0x56, 0x3bc: 0x57, 0x3bd: 0x58, 0x3be: 0x59, 0x3bf: 0x5a, // Block 0xf, offset 0x3c0 0x3c0: 0x103, 0x3c1: 0x104, 0x3c2: 0x9f, 0x3c3: 0x105, 0x3c4: 0x106, 0x3c5: 0x9b, 0x3c6: 0x107, 0x3c7: 0x108, 0x3c8: 0xba, 0x3c9: 0xba, 0x3ca: 0x109, 0x3cb: 0x10a, 0x3cc: 0x10b, 0x3cd: 0x10c, 0x3ce: 0x10d, 0x3cf: 0x10e, 0x3d0: 0x10f, 0x3d1: 0x9f, 0x3d2: 0x110, 0x3d3: 0x111, 0x3d4: 0x112, 0x3d5: 0x113, 0x3d6: 0xba, 0x3d7: 0xba, 0x3d8: 0x9f, 0x3d9: 0x9f, 0x3da: 0x9f, 0x3db: 0x9f, 0x3dc: 0x114, 0x3dd: 0x115, 0x3de: 0xba, 0x3df: 0xba, 0x3e0: 0x116, 0x3e1: 0x117, 0x3e2: 0x118, 0x3e3: 0x119, 0x3e4: 0x11a, 0x3e5: 0xba, 0x3e6: 0x11b, 0x3e7: 0x11c, 0x3e8: 0x11d, 0x3e9: 0x11e, 0x3ea: 0x11f, 0x3eb: 0x5b, 0x3ec: 0x120, 0x3ed: 0x121, 0x3ee: 0x5c, 0x3ef: 0xba, 0x3f0: 0x122, 0x3f1: 0x123, 0x3f2: 0x124, 0x3f3: 0x125, 0x3f4: 0x126, 0x3f5: 0xba, 0x3f6: 0xba, 0x3f7: 0xba, 0x3f8: 0xba, 0x3f9: 0x127, 0x3fa: 0xba, 0x3fb: 0xba, 0x3fc: 0x128, 0x3fd: 0x129, 0x3fe: 0xba, 0x3ff: 0xba, // Block 0x10, offset 0x400 0x400: 0x12a, 0x401: 0x12b, 0x402: 0x12c, 0x403: 0x12d, 0x404: 0x12e, 0x405: 0x12f, 0x406: 0x130, 0x407: 0x131, 0x408: 0x132, 0x409: 0xba, 0x40a: 0x133, 0x40b: 0x134, 0x40c: 0x5d, 0x40d: 0x5e, 0x40e: 0xba, 0x40f: 0xba, 0x410: 0x135, 0x411: 0x136, 0x412: 0x137, 0x413: 0x138, 0x414: 0xba, 0x415: 0xba, 0x416: 0x139, 0x417: 0x13a, 0x418: 0x13b, 0x419: 0x13c, 0x41a: 0x13d, 0x41b: 0x13e, 0x41c: 0x13f, 0x41d: 0xba, 0x41e: 0xba, 0x41f: 0xba, 0x420: 0x140, 0x421: 0xba, 0x422: 0x141, 0x423: 0x142, 0x424: 0xba, 0x425: 0xba, 0x426: 0xba, 0x427: 0xba, 0x428: 0x143, 0x429: 0x144, 0x42a: 0x145, 0x42b: 0x146, 0x42c: 0xba, 0x42d: 0xba, 0x42e: 0xba, 0x42f: 0xba, 0x430: 0x147, 0x431: 0x148, 0x432: 0x149, 0x433: 0xba, 0x434: 0x14a, 0x435: 0x14b, 0x436: 0x14c, 0x437: 0xba, 0x438: 0xba, 0x439: 0xba, 0x43a: 0xba, 0x43b: 0x14d, 0x43c: 0xba, 0x43d: 0xba, 0x43e: 0xba, 0x43f: 0xba, // Block 0x11, offset 0x440 0x440: 0x9f, 0x441: 0x9f, 0x442: 0x9f, 0x443: 0x9f, 0x444: 0x9f, 0x445: 0x9f, 0x446: 0x9f, 0x447: 0x9f, 0x448: 0x9f, 0x449: 0x9f, 0x44a: 0x9f, 0x44b: 0x9f, 0x44c: 0x9f, 0x44d: 0x9f, 0x44e: 0x14e, 0x44f: 0xba, 0x450: 0x9b, 0x451: 0x14f, 0x452: 0x9f, 0x453: 0x9f, 0x454: 0x9f, 0x455: 0x150, 0x456: 0xba, 0x457: 0xba, 0x458: 0xba, 0x459: 0xba, 0x45a: 0xba, 0x45b: 0xba, 0x45c: 0xba, 0x45d: 0xba, 0x45e: 0xba, 0x45f: 0xba, 0x460: 0xba, 0x461: 0xba, 0x462: 0xba, 0x463: 0xba, 0x464: 0xba, 0x465: 0xba, 0x466: 0xba, 0x467: 0xba, 0x468: 0xba, 0x469: 0xba, 0x46a: 0xba, 0x46b: 0xba, 0x46c: 0xba, 0x46d: 0xba, 0x46e: 0xba, 0x46f: 0xba, 0x470: 0xba, 0x471: 0xba, 0x472: 0xba, 0x473: 0xba, 0x474: 0xba, 0x475: 0xba, 0x476: 0xba, 0x477: 0xba, 0x478: 0xba, 0x479: 0xba, 0x47a: 0xba, 0x47b: 0xba, 0x47c: 0xba, 0x47d: 0xba, 0x47e: 0xba, 0x47f: 0xba, // Block 0x12, offset 0x480 0x480: 0x9f, 0x481: 0x9f, 0x482: 0x9f, 0x483: 0x9f, 0x484: 0x9f, 0x485: 0x9f, 0x486: 0x9f, 0x487: 0x9f, 0x488: 0x9f, 0x489: 0x9f, 0x48a: 0x9f, 0x48b: 0x9f, 0x48c: 0x9f, 0x48d: 0x9f, 0x48e: 0x9f, 0x48f: 0x9f, 0x490: 0x151, 0x491: 0xba, 0x492: 0xba, 0x493: 0xba, 0x494: 0xba, 0x495: 0xba, 0x496: 0xba, 0x497: 0xba, 0x498: 0xba, 0x499: 0xba, 0x49a: 0xba, 0x49b: 0xba, 0x49c: 0xba, 0x49d: 0xba, 0x49e: 0xba, 0x49f: 0xba, 0x4a0: 0xba, 0x4a1: 0xba, 0x4a2: 0xba, 0x4a3: 0xba, 0x4a4: 0xba, 0x4a5: 0xba, 0x4a6: 0xba, 0x4a7: 0xba, 0x4a8: 0xba, 0x4a9: 0xba, 0x4aa: 0xba, 0x4ab: 0xba, 0x4ac: 0xba, 0x4ad: 0xba, 0x4ae: 0xba, 0x4af: 0xba, 0x4b0: 0xba, 0x4b1: 0xba, 0x4b2: 0xba, 0x4b3: 0xba, 0x4b4: 0xba, 0x4b5: 0xba, 0x4b6: 0xba, 0x4b7: 0xba, 0x4b8: 0xba, 0x4b9: 0xba, 0x4ba: 0xba, 0x4bb: 0xba, 0x4bc: 0xba, 0x4bd: 0xba, 0x4be: 0xba, 0x4bf: 0xba, // Block 0x13, offset 0x4c0 0x4c0: 0xba, 0x4c1: 0xba, 0x4c2: 0xba, 0x4c3: 0xba, 0x4c4: 0xba, 0x4c5: 0xba, 0x4c6: 0xba, 0x4c7: 0xba, 0x4c8: 0xba, 0x4c9: 0xba, 0x4ca: 0xba, 0x4cb: 0xba, 0x4cc: 0xba, 0x4cd: 0xba, 0x4ce: 0xba, 0x4cf: 0xba, 0x4d0: 0x9f, 0x4d1: 0x9f, 0x4d2: 0x9f, 0x4d3: 0x9f, 0x4d4: 0x9f, 0x4d5: 0x9f, 0x4d6: 0x9f, 0x4d7: 0x9f, 0x4d8: 0x9f, 0x4d9: 0x152, 0x4da: 0xba, 0x4db: 0xba, 0x4dc: 0xba, 0x4dd: 0xba, 0x4de: 0xba, 0x4df: 0xba, 0x4e0: 0xba, 0x4e1: 0xba, 0x4e2: 0xba, 0x4e3: 0xba, 0x4e4: 0xba, 0x4e5: 0xba, 0x4e6: 0xba, 0x4e7: 0xba, 0x4e8: 0xba, 0x4e9: 0xba, 0x4ea: 0xba, 0x4eb: 0xba, 0x4ec: 0xba, 0x4ed: 0xba, 0x4ee: 0xba, 0x4ef: 0xba, 0x4f0: 0xba, 0x4f1: 0xba, 0x4f2: 0xba, 0x4f3: 0xba, 0x4f4: 0xba, 0x4f5: 0xba, 0x4f6: 0xba, 0x4f7: 0xba, 0x4f8: 0xba, 0x4f9: 0xba, 0x4fa: 0xba, 0x4fb: 0xba, 0x4fc: 0xba, 0x4fd: 0xba, 0x4fe: 0xba, 0x4ff: 0xba, // Block 0x14, offset 0x500 0x500: 0xba, 0x501: 0xba, 0x502: 0xba, 0x503: 0xba, 0x504: 0xba, 0x505: 0xba, 0x506: 0xba, 0x507: 0xba, 0x508: 0xba, 0x509: 0xba, 0x50a: 0xba, 0x50b: 0xba, 0x50c: 0xba, 0x50d: 0xba, 0x50e: 0xba, 0x50f: 0xba, 0x510: 0xba, 0x511: 0xba, 0x512: 0xba, 0x513: 0xba, 0x514: 0xba, 0x515: 0xba, 0x516: 0xba, 0x517: 0xba, 0x518: 0xba, 0x519: 0xba, 0x51a: 0xba, 0x51b: 0xba, 0x51c: 0xba, 0x51d: 0xba, 0x51e: 0xba, 0x51f: 0xba, 0x520: 0x9f, 0x521: 0x9f, 0x522: 0x9f, 0x523: 0x9f, 0x524: 0x9f, 0x525: 0x9f, 0x526: 0x9f, 0x527: 0x9f, 0x528: 0x146, 0x529: 0x153, 0x52a: 0xba, 0x52b: 0x154, 0x52c: 0x155, 0x52d: 0x156, 0x52e: 0x157, 0x52f: 0xba, 0x530: 0xba, 0x531: 0xba, 0x532: 0xba, 0x533: 0xba, 0x534: 0xba, 0x535: 0xba, 0x536: 0xba, 0x537: 0xba, 0x538: 0xba, 0x539: 0x158, 0x53a: 0x159, 0x53b: 0xba, 0x53c: 0x9f, 0x53d: 0x15a, 0x53e: 0x15b, 0x53f: 0x15c, // Block 0x15, offset 0x540 0x540: 0x9f, 0x541: 0x9f, 0x542: 0x9f, 0x543: 0x9f, 0x544: 0x9f, 0x545: 0x9f, 0x546: 0x9f, 0x547: 0x9f, 0x548: 0x9f, 0x549: 0x9f, 0x54a: 0x9f, 0x54b: 0x9f, 0x54c: 0x9f, 0x54d: 0x9f, 0x54e: 0x9f, 0x54f: 0x9f, 0x550: 0x9f, 0x551: 0x9f, 0x552: 0x9f, 0x553: 0x9f, 0x554: 0x9f, 0x555: 0x9f, 0x556: 0x9f, 0x557: 0x9f, 0x558: 0x9f, 0x559: 0x9f, 0x55a: 0x9f, 0x55b: 0x9f, 0x55c: 0x9f, 0x55d: 0x9f, 0x55e: 0x9f, 0x55f: 0x15d, 0x560: 0x9f, 0x561: 0x9f, 0x562: 0x9f, 0x563: 0x9f, 0x564: 0x9f, 0x565: 0x9f, 0x566: 0x9f, 0x567: 0x9f, 0x568: 0x9f, 0x569: 0x9f, 0x56a: 0x9f, 0x56b: 0x15e, 0x56c: 0xba, 0x56d: 0xba, 0x56e: 0xba, 0x56f: 0xba, 0x570: 0xba, 0x571: 0xba, 0x572: 0xba, 0x573: 0xba, 0x574: 0xba, 0x575: 0xba, 0x576: 0xba, 0x577: 0xba, 0x578: 0xba, 0x579: 0xba, 0x57a: 0xba, 0x57b: 0xba, 0x57c: 0xba, 0x57d: 0xba, 0x57e: 0xba, 0x57f: 0xba, // Block 0x16, offset 0x580 0x580: 0x9f, 0x581: 0x9f, 0x582: 0x9f, 0x583: 0x9f, 0x584: 0x15f, 0x585: 0x160, 0x586: 0x9f, 0x587: 0x9f, 0x588: 0x9f, 0x589: 0x9f, 0x58a: 0x9f, 0x58b: 0x161, 0x58c: 0xba, 0x58d: 0xba, 0x58e: 0xba, 0x58f: 0xba, 0x590: 0xba, 0x591: 0xba, 0x592: 0xba, 0x593: 0xba, 0x594: 0xba, 0x595: 0xba, 0x596: 0xba, 0x597: 0xba, 0x598: 0xba, 0x599: 0xba, 0x59a: 0xba, 0x59b: 0xba, 0x59c: 0xba, 0x59d: 0xba, 0x59e: 0xba, 0x59f: 0xba, 0x5a0: 0xba, 0x5a1: 0xba, 0x5a2: 0xba, 0x5a3: 0xba, 0x5a4: 0xba, 0x5a5: 0xba, 0x5a6: 0xba, 0x5a7: 0xba, 0x5a8: 0xba, 0x5a9: 0xba, 0x5aa: 0xba, 0x5ab: 0xba, 0x5ac: 0xba, 0x5ad: 0xba, 0x5ae: 0xba, 0x5af: 0xba, 0x5b0: 0x9f, 0x5b1: 0x162, 0x5b2: 0x163, 0x5b3: 0xba, 0x5b4: 0xba, 0x5b5: 0xba, 0x5b6: 0xba, 0x5b7: 0xba, 0x5b8: 0xba, 0x5b9: 0xba, 0x5ba: 0xba, 0x5bb: 0xba, 0x5bc: 0xba, 0x5bd: 0xba, 0x5be: 0xba, 0x5bf: 0xba, // Block 0x17, offset 0x5c0 0x5c0: 0x9b, 0x5c1: 0x9b, 0x5c2: 0x9b, 0x5c3: 0x164, 0x5c4: 0x165, 0x5c5: 0x166, 0x5c6: 0x167, 0x5c7: 0x168, 0x5c8: 0x9b, 0x5c9: 0x169, 0x5ca: 0xba, 0x5cb: 0x16a, 0x5cc: 0x9b, 0x5cd: 0x16b, 0x5ce: 0xba, 0x5cf: 0xba, 0x5d0: 0x5f, 0x5d1: 0x60, 0x5d2: 0x61, 0x5d3: 0x62, 0x5d4: 0x63, 0x5d5: 0x64, 0x5d6: 0x65, 0x5d7: 0x66, 0x5d8: 0x67, 0x5d9: 0x68, 0x5da: 0x69, 0x5db: 0x6a, 0x5dc: 0x6b, 0x5dd: 0x6c, 0x5de: 0x6d, 0x5df: 0x6e, 0x5e0: 0x9b, 0x5e1: 0x9b, 0x5e2: 0x9b, 0x5e3: 0x9b, 0x5e4: 0x9b, 0x5e5: 0x9b, 0x5e6: 0x9b, 0x5e7: 0x9b, 0x5e8: 0x16c, 0x5e9: 0x16d, 0x5ea: 0x16e, 0x5eb: 0xba, 0x5ec: 0xba, 0x5ed: 0xba, 0x5ee: 0xba, 0x5ef: 0xba, 0x5f0: 0xba, 0x5f1: 0xba, 0x5f2: 0xba, 0x5f3: 0xba, 0x5f4: 0xba, 0x5f5: 0xba, 0x5f6: 0xba, 0x5f7: 0xba, 0x5f8: 0xba, 0x5f9: 0xba, 0x5fa: 0xba, 0x5fb: 0xba, 0x5fc: 0xba, 0x5fd: 0xba, 0x5fe: 0xba, 0x5ff: 0xba, // Block 0x18, offset 0x600 0x600: 0x16f, 0x601: 0xba, 0x602: 0xba, 0x603: 0xba, 0x604: 0xba, 0x605: 0xba, 0x606: 0xba, 0x607: 0xba, 0x608: 0xba, 0x609: 0xba, 0x60a: 0xba, 0x60b: 0xba, 0x60c: 0xba, 0x60d: 0xba, 0x60e: 0xba, 0x60f: 0xba, 0x610: 0xba, 0x611: 0xba, 0x612: 0xba, 0x613: 0xba, 0x614: 0xba, 0x615: 0xba, 0x616: 0xba, 0x617: 0xba, 0x618: 0xba, 0x619: 0xba, 0x61a: 0xba, 0x61b: 0xba, 0x61c: 0xba, 0x61d: 0xba, 0x61e: 0xba, 0x61f: 0xba, 0x620: 0x122, 0x621: 0x122, 0x622: 0x122, 0x623: 0x170, 0x624: 0x6f, 0x625: 0x171, 0x626: 0xba, 0x627: 0xba, 0x628: 0xba, 0x629: 0xba, 0x62a: 0xba, 0x62b: 0xba, 0x62c: 0xba, 0x62d: 0xba, 0x62e: 0xba, 0x62f: 0xba, 0x630: 0xba, 0x631: 0x172, 0x632: 0x173, 0x633: 0xba, 0x634: 0xba, 0x635: 0xba, 0x636: 0xba, 0x637: 0xba, 0x638: 0x70, 0x639: 0x71, 0x63a: 0x72, 0x63b: 0x174, 0x63c: 0xba, 0x63d: 0xba, 0x63e: 0xba, 0x63f: 0xba, // Block 0x19, offset 0x640 0x640: 0x175, 0x641: 0x9b, 0x642: 0x176, 0x643: 0x177, 0x644: 0x73, 0x645: 0x74, 0x646: 0x178, 0x647: 0x179, 0x648: 0x75, 0x649: 0x17a, 0x64a: 0xba, 0x64b: 0xba, 0x64c: 0x9b, 0x64d: 0x9b, 0x64e: 0x9b, 0x64f: 0x9b, 0x650: 0x9b, 0x651: 0x9b, 0x652: 0x9b, 0x653: 0x9b, 0x654: 0x9b, 0x655: 0x9b, 0x656: 0x9b, 0x657: 0x9b, 0x658: 0x9b, 0x659: 0x9b, 0x65a: 0x9b, 0x65b: 0x17b, 0x65c: 0x9b, 0x65d: 0x17c, 0x65e: 0x9b, 0x65f: 0x17d, 0x660: 0x17e, 0x661: 0x17f, 0x662: 0x180, 0x663: 0xba, 0x664: 0x181, 0x665: 0x182, 0x666: 0x183, 0x667: 0x184, 0x668: 0xba, 0x669: 0x185, 0x66a: 0xba, 0x66b: 0xba, 0x66c: 0xba, 0x66d: 0xba, 0x66e: 0xba, 0x66f: 0xba, 0x670: 0xba, 0x671: 0xba, 0x672: 0xba, 0x673: 0xba, 0x674: 0xba, 0x675: 0xba, 0x676: 0xba, 0x677: 0xba, 0x678: 0xba, 0x679: 0xba, 0x67a: 0xba, 0x67b: 0xba, 0x67c: 0xba, 0x67d: 0xba, 0x67e: 0xba, 0x67f: 0xba, // Block 0x1a, offset 0x680 0x680: 0x9f, 0x681: 0x9f, 0x682: 0x9f, 0x683: 0x9f, 0x684: 0x9f, 0x685: 0x9f, 0x686: 0x9f, 0x687: 0x9f, 0x688: 0x9f, 0x689: 0x9f, 0x68a: 0x9f, 0x68b: 0x9f, 0x68c: 0x9f, 0x68d: 0x9f, 0x68e: 0x9f, 0x68f: 0x9f, 0x690: 0x9f, 0x691: 0x9f, 0x692: 0x9f, 0x693: 0x9f, 0x694: 0x9f, 0x695: 0x9f, 0x696: 0x9f, 0x697: 0x9f, 0x698: 0x9f, 0x699: 0x9f, 0x69a: 0x9f, 0x69b: 0x186, 0x69c: 0x9f, 0x69d: 0x9f, 0x69e: 0x9f, 0x69f: 0x9f, 0x6a0: 0x9f, 0x6a1: 0x9f, 0x6a2: 0x9f, 0x6a3: 0x9f, 0x6a4: 0x9f, 0x6a5: 0x9f, 0x6a6: 0x9f, 0x6a7: 0x9f, 0x6a8: 0x9f, 0x6a9: 0x9f, 0x6aa: 0x9f, 0x6ab: 0x9f, 0x6ac: 0x9f, 0x6ad: 0x9f, 0x6ae: 0x9f, 0x6af: 0x9f, 0x6b0: 0x9f, 0x6b1: 0x9f, 0x6b2: 0x9f, 0x6b3: 0x9f, 0x6b4: 0x9f, 0x6b5: 0x9f, 0x6b6: 0x9f, 0x6b7: 0x9f, 0x6b8: 0x9f, 0x6b9: 0x9f, 0x6ba: 0x9f, 0x6bb: 0x9f, 0x6bc: 0x9f, 0x6bd: 0x9f, 0x6be: 0x9f, 0x6bf: 0x9f, // Block 0x1b, offset 0x6c0 0x6c0: 0x9f, 0x6c1: 0x9f, 0x6c2: 0x9f, 0x6c3: 0x9f, 0x6c4: 0x9f, 0x6c5: 0x9f, 0x6c6: 0x9f, 0x6c7: 0x9f, 0x6c8: 0x9f, 0x6c9: 0x9f, 0x6ca: 0x9f, 0x6cb: 0x9f, 0x6cc: 0x9f, 0x6cd: 0x9f, 0x6ce: 0x9f, 0x6cf: 0x9f, 0x6d0: 0x9f, 0x6d1: 0x9f, 0x6d2: 0x9f, 0x6d3: 0x9f, 0x6d4: 0x9f, 0x6d5: 0x9f, 0x6d6: 0x9f, 0x6d7: 0x9f, 0x6d8: 0x9f, 0x6d9: 0x9f, 0x6da: 0x9f, 0x6db: 0x9f, 0x6dc: 0x187, 0x6dd: 0x9f, 0x6de: 0x9f, 0x6df: 0x9f, 0x6e0: 0x188, 0x6e1: 0x9f, 0x6e2: 0x9f, 0x6e3: 0x9f, 0x6e4: 0x9f, 0x6e5: 0x9f, 0x6e6: 0x9f, 0x6e7: 0x9f, 0x6e8: 0x9f, 0x6e9: 0x9f, 0x6ea: 0x9f, 0x6eb: 0x9f, 0x6ec: 0x9f, 0x6ed: 0x9f, 0x6ee: 0x9f, 0x6ef: 0x9f, 0x6f0: 0x9f, 0x6f1: 0x9f, 0x6f2: 0x9f, 0x6f3: 0x9f, 0x6f4: 0x9f, 0x6f5: 0x9f, 0x6f6: 0x9f, 0x6f7: 0x9f, 0x6f8: 0x9f, 0x6f9: 0x9f, 0x6fa: 0x9f, 0x6fb: 0x9f, 0x6fc: 0x9f, 0x6fd: 0x9f, 0x6fe: 0x9f, 0x6ff: 0x9f, // Block 0x1c, offset 0x700 0x700: 0x9f, 0x701: 0x9f, 0x702: 0x9f, 0x703: 0x9f, 0x704: 0x9f, 0x705: 0x9f, 0x706: 0x9f, 0x707: 0x9f, 0x708: 0x9f, 0x709: 0x9f, 0x70a: 0x9f, 0x70b: 0x9f, 0x70c: 0x9f, 0x70d: 0x9f, 0x70e: 0x9f, 0x70f: 0x9f, 0x710: 0x9f, 0x711: 0x9f, 0x712: 0x9f, 0x713: 0x9f, 0x714: 0x9f, 0x715: 0x9f, 0x716: 0x9f, 0x717: 0x9f, 0x718: 0x9f, 0x719: 0x9f, 0x71a: 0x9f, 0x71b: 0x9f, 0x71c: 0x9f, 0x71d: 0x9f, 0x71e: 0x9f, 0x71f: 0x9f, 0x720: 0x9f, 0x721: 0x9f, 0x722: 0x9f, 0x723: 0x9f, 0x724: 0x9f, 0x725: 0x9f, 0x726: 0x9f, 0x727: 0x9f, 0x728: 0x9f, 0x729: 0x9f, 0x72a: 0x9f, 0x72b: 0x9f, 0x72c: 0x9f, 0x72d: 0x9f, 0x72e: 0x9f, 0x72f: 0x9f, 0x730: 0x9f, 0x731: 0x9f, 0x732: 0x9f, 0x733: 0x9f, 0x734: 0x9f, 0x735: 0x9f, 0x736: 0x9f, 0x737: 0x9f, 0x738: 0x9f, 0x739: 0x9f, 0x73a: 0x189, 0x73b: 0x9f, 0x73c: 0x9f, 0x73d: 0x9f, 0x73e: 0x9f, 0x73f: 0x9f, // Block 0x1d, offset 0x740 0x740: 0x9f, 0x741: 0x9f, 0x742: 0x9f, 0x743: 0x9f, 0x744: 0x9f, 0x745: 0x9f, 0x746: 0x9f, 0x747: 0x9f, 0x748: 0x9f, 0x749: 0x9f, 0x74a: 0x9f, 0x74b: 0x9f, 0x74c: 0x9f, 0x74d: 0x9f, 0x74e: 0x9f, 0x74f: 0x9f, 0x750: 0x9f, 0x751: 0x9f, 0x752: 0x9f, 0x753: 0x9f, 0x754: 0x9f, 0x755: 0x9f, 0x756: 0x9f, 0x757: 0x9f, 0x758: 0x9f, 0x759: 0x9f, 0x75a: 0x9f, 0x75b: 0x9f, 0x75c: 0x9f, 0x75d: 0x9f, 0x75e: 0x9f, 0x75f: 0x9f, 0x760: 0x9f, 0x761: 0x9f, 0x762: 0x9f, 0x763: 0x9f, 0x764: 0x9f, 0x765: 0x9f, 0x766: 0x9f, 0x767: 0x9f, 0x768: 0x9f, 0x769: 0x9f, 0x76a: 0x9f, 0x76b: 0x9f, 0x76c: 0x9f, 0x76d: 0x9f, 0x76e: 0x9f, 0x76f: 0x18a, 0x770: 0xba, 0x771: 0xba, 0x772: 0xba, 0x773: 0xba, 0x774: 0xba, 0x775: 0xba, 0x776: 0xba, 0x777: 0xba, 0x778: 0xba, 0x779: 0xba, 0x77a: 0xba, 0x77b: 0xba, 0x77c: 0xba, 0x77d: 0xba, 0x77e: 0xba, 0x77f: 0xba, // Block 0x1e, offset 0x780 0x780: 0xba, 0x781: 0xba, 0x782: 0xba, 0x783: 0xba, 0x784: 0xba, 0x785: 0xba, 0x786: 0xba, 0x787: 0xba, 0x788: 0xba, 0x789: 0xba, 0x78a: 0xba, 0x78b: 0xba, 0x78c: 0xba, 0x78d: 0xba, 0x78e: 0xba, 0x78f: 0xba, 0x790: 0xba, 0x791: 0xba, 0x792: 0xba, 0x793: 0xba, 0x794: 0xba, 0x795: 0xba, 0x796: 0xba, 0x797: 0xba, 0x798: 0xba, 0x799: 0xba, 0x79a: 0xba, 0x79b: 0xba, 0x79c: 0xba, 0x79d: 0xba, 0x79e: 0xba, 0x79f: 0xba, 0x7a0: 0x76, 0x7a1: 0x77, 0x7a2: 0x78, 0x7a3: 0x18b, 0x7a4: 0x79, 0x7a5: 0x7a, 0x7a6: 0x18c, 0x7a7: 0x7b, 0x7a8: 0x7c, 0x7a9: 0xba, 0x7aa: 0xba, 0x7ab: 0xba, 0x7ac: 0xba, 0x7ad: 0xba, 0x7ae: 0xba, 0x7af: 0xba, 0x7b0: 0xba, 0x7b1: 0xba, 0x7b2: 0xba, 0x7b3: 0xba, 0x7b4: 0xba, 0x7b5: 0xba, 0x7b6: 0xba, 0x7b7: 0xba, 0x7b8: 0xba, 0x7b9: 0xba, 0x7ba: 0xba, 0x7bb: 0xba, 0x7bc: 0xba, 0x7bd: 0xba, 0x7be: 0xba, 0x7bf: 0xba, // Block 0x1f, offset 0x7c0 0x7d0: 0x0d, 0x7d1: 0x0e, 0x7d2: 0x0f, 0x7d3: 0x10, 0x7d4: 0x11, 0x7d5: 0x0b, 0x7d6: 0x12, 0x7d7: 0x07, 0x7d8: 0x13, 0x7d9: 0x0b, 0x7da: 0x0b, 0x7db: 0x14, 0x7dc: 0x0b, 0x7dd: 0x15, 0x7de: 0x16, 0x7df: 0x17, 0x7e0: 0x07, 0x7e1: 0x07, 0x7e2: 0x07, 0x7e3: 0x07, 0x7e4: 0x07, 0x7e5: 0x07, 0x7e6: 0x07, 0x7e7: 0x07, 0x7e8: 0x07, 0x7e9: 0x07, 0x7ea: 0x18, 0x7eb: 0x19, 0x7ec: 0x1a, 0x7ed: 0x07, 0x7ee: 0x1b, 0x7ef: 0x1c, 0x7f0: 0x0b, 0x7f1: 0x0b, 0x7f2: 0x0b, 0x7f3: 0x0b, 0x7f4: 0x0b, 0x7f5: 0x0b, 0x7f6: 0x0b, 0x7f7: 0x0b, 0x7f8: 0x0b, 0x7f9: 0x0b, 0x7fa: 0x0b, 0x7fb: 0x0b, 0x7fc: 0x0b, 0x7fd: 0x0b, 0x7fe: 0x0b, 0x7ff: 0x0b, // Block 0x20, offset 0x800 0x800: 0x0b, 0x801: 0x0b, 0x802: 0x0b, 0x803: 0x0b, 0x804: 0x0b, 0x805: 0x0b, 0x806: 0x0b, 0x807: 0x0b, 0x808: 0x0b, 0x809: 0x0b, 0x80a: 0x0b, 0x80b: 0x0b, 0x80c: 0x0b, 0x80d: 0x0b, 0x80e: 0x0b, 0x80f: 0x0b, 0x810: 0x0b, 0x811: 0x0b, 0x812: 0x0b, 0x813: 0x0b, 0x814: 0x0b, 0x815: 0x0b, 0x816: 0x0b, 0x817: 0x0b, 0x818: 0x0b, 0x819: 0x0b, 0x81a: 0x0b, 0x81b: 0x0b, 0x81c: 0x0b, 0x81d: 0x0b, 0x81e: 0x0b, 0x81f: 0x0b, 0x820: 0x0b, 0x821: 0x0b, 0x822: 0x0b, 0x823: 0x0b, 0x824: 0x0b, 0x825: 0x0b, 0x826: 0x0b, 0x827: 0x0b, 0x828: 0x0b, 0x829: 0x0b, 0x82a: 0x0b, 0x82b: 0x0b, 0x82c: 0x0b, 0x82d: 0x0b, 0x82e: 0x0b, 0x82f: 0x0b, 0x830: 0x0b, 0x831: 0x0b, 0x832: 0x0b, 0x833: 0x0b, 0x834: 0x0b, 0x835: 0x0b, 0x836: 0x0b, 0x837: 0x0b, 0x838: 0x0b, 0x839: 0x0b, 0x83a: 0x0b, 0x83b: 0x0b, 0x83c: 0x0b, 0x83d: 0x0b, 0x83e: 0x0b, 0x83f: 0x0b, // Block 0x21, offset 0x840 0x840: 0x18d, 0x841: 0x18e, 0x842: 0xba, 0x843: 0xba, 0x844: 0x18f, 0x845: 0x18f, 0x846: 0x18f, 0x847: 0x190, 0x848: 0xba, 0x849: 0xba, 0x84a: 0xba, 0x84b: 0xba, 0x84c: 0xba, 0x84d: 0xba, 0x84e: 0xba, 0x84f: 0xba, 0x850: 0xba, 0x851: 0xba, 0x852: 0xba, 0x853: 0xba, 0x854: 0xba, 0x855: 0xba, 0x856: 0xba, 0x857: 0xba, 0x858: 0xba, 0x859: 0xba, 0x85a: 0xba, 0x85b: 0xba, 0x85c: 0xba, 0x85d: 0xba, 0x85e: 0xba, 0x85f: 0xba, 0x860: 0xba, 0x861: 0xba, 0x862: 0xba, 0x863: 0xba, 0x864: 0xba, 0x865: 0xba, 0x866: 0xba, 0x867: 0xba, 0x868: 0xba, 0x869: 0xba, 0x86a: 0xba, 0x86b: 0xba, 0x86c: 0xba, 0x86d: 0xba, 0x86e: 0xba, 0x86f: 0xba, 0x870: 0xba, 0x871: 0xba, 0x872: 0xba, 0x873: 0xba, 0x874: 0xba, 0x875: 0xba, 0x876: 0xba, 0x877: 0xba, 0x878: 0xba, 0x879: 0xba, 0x87a: 0xba, 0x87b: 0xba, 0x87c: 0xba, 0x87d: 0xba, 0x87e: 0xba, 0x87f: 0xba, // Block 0x22, offset 0x880 0x880: 0x0b, 0x881: 0x0b, 0x882: 0x0b, 0x883: 0x0b, 0x884: 0x0b, 0x885: 0x0b, 0x886: 0x0b, 0x887: 0x0b, 0x888: 0x0b, 0x889: 0x0b, 0x88a: 0x0b, 0x88b: 0x0b, 0x88c: 0x0b, 0x88d: 0x0b, 0x88e: 0x0b, 0x88f: 0x0b, 0x890: 0x0b, 0x891: 0x0b, 0x892: 0x0b, 0x893: 0x0b, 0x894: 0x0b, 0x895: 0x0b, 0x896: 0x0b, 0x897: 0x0b, 0x898: 0x0b, 0x899: 0x0b, 0x89a: 0x0b, 0x89b: 0x0b, 0x89c: 0x0b, 0x89d: 0x0b, 0x89e: 0x0b, 0x89f: 0x0b, 0x8a0: 0x1f, 0x8a1: 0x0b, 0x8a2: 0x0b, 0x8a3: 0x0b, 0x8a4: 0x0b, 0x8a5: 0x0b, 0x8a6: 0x0b, 0x8a7: 0x0b, 0x8a8: 0x0b, 0x8a9: 0x0b, 0x8aa: 0x0b, 0x8ab: 0x0b, 0x8ac: 0x0b, 0x8ad: 0x0b, 0x8ae: 0x0b, 0x8af: 0x0b, 0x8b0: 0x0b, 0x8b1: 0x0b, 0x8b2: 0x0b, 0x8b3: 0x0b, 0x8b4: 0x0b, 0x8b5: 0x0b, 0x8b6: 0x0b, 0x8b7: 0x0b, 0x8b8: 0x0b, 0x8b9: 0x0b, 0x8ba: 0x0b, 0x8bb: 0x0b, 0x8bc: 0x0b, 0x8bd: 0x0b, 0x8be: 0x0b, 0x8bf: 0x0b, // Block 0x23, offset 0x8c0 0x8c0: 0x0b, 0x8c1: 0x0b, 0x8c2: 0x0b, 0x8c3: 0x0b, 0x8c4: 0x0b, 0x8c5: 0x0b, 0x8c6: 0x0b, 0x8c7: 0x0b, 0x8c8: 0x0b, 0x8c9: 0x0b, 0x8ca: 0x0b, 0x8cb: 0x0b, 0x8cc: 0x0b, 0x8cd: 0x0b, 0x8ce: 0x0b, 0x8cf: 0x0b, } // idnaSparseOffset: 276 entries, 552 bytes var idnaSparseOffset = []uint16{0x0, 0x8, 0x19, 0x25, 0x27, 0x2c, 0x33, 0x3e, 0x4a, 0x4e, 0x5d, 0x62, 0x6c, 0x78, 0x86, 0x8b, 0x94, 0xa4, 0xb2, 0xbe, 0xca, 0xdb, 0xe5, 0xec, 0xf9, 0x10a, 0x111, 0x11c, 0x12b, 0x139, 0x143, 0x145, 0x14a, 0x14d, 0x150, 0x152, 0x15e, 0x169, 0x171, 0x177, 0x17d, 0x182, 0x187, 0x18a, 0x18e, 0x194, 0x199, 0x1a5, 0x1af, 0x1b5, 0x1c6, 0x1d0, 0x1d3, 0x1db, 0x1de, 0x1eb, 0x1f3, 0x1f7, 0x1fe, 0x206, 0x216, 0x222, 0x224, 0x22e, 0x23a, 0x246, 0x252, 0x25a, 0x25f, 0x269, 0x27a, 0x27e, 0x289, 0x28d, 0x296, 0x29e, 0x2a4, 0x2a9, 0x2ac, 0x2b0, 0x2b6, 0x2ba, 0x2be, 0x2c2, 0x2c7, 0x2cd, 0x2d5, 0x2dc, 0x2e7, 0x2f1, 0x2f5, 0x2f8, 0x2fe, 0x302, 0x304, 0x307, 0x309, 0x30c, 0x316, 0x319, 0x328, 0x32c, 0x331, 0x334, 0x338, 0x33d, 0x342, 0x348, 0x34e, 0x35d, 0x363, 0x367, 0x376, 0x37b, 0x383, 0x38d, 0x398, 0x3a0, 0x3b1, 0x3ba, 0x3ca, 0x3d7, 0x3e1, 0x3e6, 0x3f3, 0x3f7, 0x3fc, 0x3fe, 0x402, 0x404, 0x408, 0x411, 0x417, 0x41b, 0x42b, 0x435, 0x43a, 0x43d, 0x443, 0x44a, 0x44f, 0x453, 0x459, 0x45e, 0x467, 0x46c, 0x472, 0x479, 0x480, 0x487, 0x48b, 0x490, 0x493, 0x498, 0x4a4, 0x4aa, 0x4af, 0x4b6, 0x4be, 0x4c3, 0x4c7, 0x4d7, 0x4de, 0x4e2, 0x4e6, 0x4ed, 0x4ef, 0x4f2, 0x4f5, 0x4f9, 0x502, 0x506, 0x50e, 0x516, 0x51c, 0x525, 0x531, 0x538, 0x541, 0x54b, 0x552, 0x560, 0x56d, 0x57a, 0x583, 0x587, 0x596, 0x59e, 0x5a9, 0x5b2, 0x5b8, 0x5c0, 0x5c9, 0x5d3, 0x5d6, 0x5e2, 0x5eb, 0x5ee, 0x5f3, 0x5fe, 0x607, 0x613, 0x616, 0x620, 0x629, 0x635, 0x642, 0x64f, 0x65d, 0x664, 0x667, 0x66c, 0x66f, 0x672, 0x675, 0x67c, 0x683, 0x687, 0x692, 0x695, 0x698, 0x69b, 0x6a1, 0x6a6, 0x6aa, 0x6ad, 0x6b0, 0x6b3, 0x6b6, 0x6b9, 0x6be, 0x6c8, 0x6cb, 0x6cf, 0x6de, 0x6ea, 0x6ee, 0x6f3, 0x6f7, 0x6fc, 0x700, 0x705, 0x70e, 0x719, 0x71f, 0x727, 0x72a, 0x72d, 0x731, 0x735, 0x73b, 0x741, 0x746, 0x749, 0x759, 0x760, 0x763, 0x766, 0x76a, 0x770, 0x775, 0x77a, 0x782, 0x787, 0x78b, 0x78f, 0x792, 0x795, 0x799, 0x79d, 0x7a0, 0x7b0, 0x7c1, 0x7c6, 0x7c8, 0x7ca} // idnaSparseValues: 1997 entries, 7988 bytes var idnaSparseValues = [1997]valueRange{ // Block 0x0, offset 0x0 {value: 0x0000, lo: 0x07}, {value: 0xe105, lo: 0x80, hi: 0x96}, {value: 0x0018, lo: 0x97, hi: 0x97}, {value: 0xe105, lo: 0x98, hi: 0x9e}, {value: 0x001f, lo: 0x9f, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xb7}, {value: 0x0008, lo: 0xb8, hi: 0xbf}, // Block 0x1, offset 0x8 {value: 0x0000, lo: 0x10}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0xe01d, lo: 0x81, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0x82}, {value: 0x0335, lo: 0x83, hi: 0x83}, {value: 0x034d, lo: 0x84, hi: 0x84}, {value: 0x0365, lo: 0x85, hi: 0x85}, {value: 0xe00d, lo: 0x86, hi: 0x86}, {value: 0x0008, lo: 0x87, hi: 0x87}, {value: 0xe00d, lo: 0x88, hi: 0x88}, {value: 0x0008, lo: 0x89, hi: 0x89}, {value: 0xe00d, lo: 0x8a, hi: 0x8a}, {value: 0x0008, lo: 0x8b, hi: 0x8b}, {value: 0xe00d, lo: 0x8c, hi: 0x8c}, {value: 0x0008, lo: 0x8d, hi: 0x8d}, {value: 0xe00d, lo: 0x8e, hi: 0x8e}, {value: 0x0008, lo: 0x8f, hi: 0xbf}, // Block 0x2, offset 0x19 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x0249, lo: 0xb0, hi: 0xb0}, {value: 0x037d, lo: 0xb1, hi: 0xb1}, {value: 0x0259, lo: 0xb2, hi: 0xb2}, {value: 0x0269, lo: 0xb3, hi: 0xb3}, {value: 0x034d, lo: 0xb4, hi: 0xb4}, {value: 0x0395, lo: 0xb5, hi: 0xb5}, {value: 0xe1bd, lo: 0xb6, hi: 0xb6}, {value: 0x0279, lo: 0xb7, hi: 0xb7}, {value: 0x0289, lo: 0xb8, hi: 0xb8}, {value: 0x0008, lo: 0xb9, hi: 0xbf}, // Block 0x3, offset 0x25 {value: 0x0000, lo: 0x01}, {value: 0x3308, lo: 0x80, hi: 0xbf}, // Block 0x4, offset 0x27 {value: 0x0000, lo: 0x04}, {value: 0x03f5, lo: 0x80, hi: 0x8f}, {value: 0xe105, lo: 0x90, hi: 0x9f}, {value: 0x049d, lo: 0xa0, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x5, offset 0x2c {value: 0x0000, lo: 0x06}, {value: 0xe185, lo: 0x80, hi: 0x8f}, {value: 0x0545, lo: 0x90, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x98}, {value: 0x0008, lo: 0x99, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x6, offset 0x33 {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0401, lo: 0x87, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x88}, {value: 0x0018, lo: 0x89, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0x90}, {value: 0x3308, lo: 0x91, hi: 0xbd}, {value: 0x0818, lo: 0xbe, hi: 0xbe}, {value: 0x3308, lo: 0xbf, hi: 0xbf}, // Block 0x7, offset 0x3e {value: 0x0000, lo: 0x0b}, {value: 0x0818, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x82}, {value: 0x0818, lo: 0x83, hi: 0x83}, {value: 0x3308, lo: 0x84, hi: 0x85}, {value: 0x0818, lo: 0x86, hi: 0x86}, {value: 0x3308, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0808, lo: 0x90, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xae}, {value: 0x0808, lo: 0xaf, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0x8, offset 0x4a {value: 0x0000, lo: 0x03}, {value: 0x0a08, lo: 0x80, hi: 0x87}, {value: 0x0c08, lo: 0x88, hi: 0x99}, {value: 0x0a08, lo: 0x9a, hi: 0xbf}, // Block 0x9, offset 0x4e {value: 0x0000, lo: 0x0e}, {value: 0x3308, lo: 0x80, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8c}, {value: 0x0c08, lo: 0x8d, hi: 0x8d}, {value: 0x0a08, lo: 0x8e, hi: 0x98}, {value: 0x0c08, lo: 0x99, hi: 0x9b}, {value: 0x0a08, lo: 0x9c, hi: 0xaa}, {value: 0x0c08, lo: 0xab, hi: 0xac}, {value: 0x0a08, lo: 0xad, hi: 0xb0}, {value: 0x0c08, lo: 0xb1, hi: 0xb1}, {value: 0x0a08, lo: 0xb2, hi: 0xb2}, {value: 0x0c08, lo: 0xb3, hi: 0xb4}, {value: 0x0a08, lo: 0xb5, hi: 0xb7}, {value: 0x0c08, lo: 0xb8, hi: 0xb9}, {value: 0x0a08, lo: 0xba, hi: 0xbf}, // Block 0xa, offset 0x5d {value: 0x0000, lo: 0x04}, {value: 0x0808, lo: 0x80, hi: 0xa5}, {value: 0x3308, lo: 0xa6, hi: 0xb0}, {value: 0x0808, lo: 0xb1, hi: 0xb1}, {value: 0x0040, lo: 0xb2, hi: 0xbf}, // Block 0xb, offset 0x62 {value: 0x0000, lo: 0x09}, {value: 0x0808, lo: 0x80, hi: 0x89}, {value: 0x0a08, lo: 0x8a, hi: 0xaa}, {value: 0x3308, lo: 0xab, hi: 0xb3}, {value: 0x0808, lo: 0xb4, hi: 0xb5}, {value: 0x0018, lo: 0xb6, hi: 0xb9}, {value: 0x0818, lo: 0xba, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbc}, {value: 0x3308, lo: 0xbd, hi: 0xbd}, {value: 0x0818, lo: 0xbe, hi: 0xbf}, // Block 0xc, offset 0x6c {value: 0x0000, lo: 0x0b}, {value: 0x0808, lo: 0x80, hi: 0x95}, {value: 0x3308, lo: 0x96, hi: 0x99}, {value: 0x0808, lo: 0x9a, hi: 0x9a}, {value: 0x3308, lo: 0x9b, hi: 0xa3}, {value: 0x0808, lo: 0xa4, hi: 0xa4}, {value: 0x3308, lo: 0xa5, hi: 0xa7}, {value: 0x0808, lo: 0xa8, hi: 0xa8}, {value: 0x3308, lo: 0xa9, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x0818, lo: 0xb0, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0xd, offset 0x78 {value: 0x0000, lo: 0x0d}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0a08, lo: 0xa0, hi: 0xa9}, {value: 0x0c08, lo: 0xaa, hi: 0xac}, {value: 0x0808, lo: 0xad, hi: 0xad}, {value: 0x0c08, lo: 0xae, hi: 0xae}, {value: 0x0a08, lo: 0xaf, hi: 0xb0}, {value: 0x0c08, lo: 0xb1, hi: 0xb2}, {value: 0x0a08, lo: 0xb3, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xb5}, {value: 0x0a08, lo: 0xb6, hi: 0xb8}, {value: 0x0c08, lo: 0xb9, hi: 0xb9}, {value: 0x0a08, lo: 0xba, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbf}, // Block 0xe, offset 0x86 {value: 0x0000, lo: 0x04}, {value: 0x0040, lo: 0x80, hi: 0x92}, {value: 0x3308, lo: 0x93, hi: 0xa1}, {value: 0x0840, lo: 0xa2, hi: 0xa2}, {value: 0x3308, lo: 0xa3, hi: 0xbf}, // Block 0xf, offset 0x8b {value: 0x0000, lo: 0x08}, {value: 0x3308, lo: 0x80, hi: 0x82}, {value: 0x3008, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0xb9}, {value: 0x3308, lo: 0xba, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbf}, // Block 0x10, offset 0x94 {value: 0x0000, lo: 0x0f}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x3008, lo: 0x81, hi: 0x82}, {value: 0x0040, lo: 0x83, hi: 0x85}, {value: 0x3008, lo: 0x86, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x3008, lo: 0x8a, hi: 0x8c}, {value: 0x3b08, lo: 0x8d, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x96}, {value: 0x3008, lo: 0x97, hi: 0x97}, {value: 0x0040, lo: 0x98, hi: 0xa5}, {value: 0x0008, lo: 0xa6, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbf}, // Block 0x11, offset 0xa4 {value: 0x0000, lo: 0x0d}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x3008, lo: 0x81, hi: 0x83}, {value: 0x3308, lo: 0x84, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8d}, {value: 0x0008, lo: 0x8e, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x91}, {value: 0x0008, lo: 0x92, hi: 0xa8}, {value: 0x0040, lo: 0xa9, hi: 0xa9}, {value: 0x0008, lo: 0xaa, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbd}, {value: 0x3308, lo: 0xbe, hi: 0xbf}, // Block 0x12, offset 0xb2 {value: 0x0000, lo: 0x0b}, {value: 0x3308, lo: 0x80, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8d}, {value: 0x0008, lo: 0x8e, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x91}, {value: 0x0008, lo: 0x92, hi: 0xba}, {value: 0x3b08, lo: 0xbb, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbf}, // Block 0x13, offset 0xbe {value: 0x0000, lo: 0x0b}, {value: 0x0040, lo: 0x80, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x99}, {value: 0x0008, lo: 0x9a, hi: 0xb1}, {value: 0x0040, lo: 0xb2, hi: 0xb2}, {value: 0x0008, lo: 0xb3, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbf}, // Block 0x14, offset 0xca {value: 0x0000, lo: 0x10}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x89}, {value: 0x3b08, lo: 0x8a, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8e}, {value: 0x3008, lo: 0x8f, hi: 0x91}, {value: 0x3308, lo: 0x92, hi: 0x94}, {value: 0x0040, lo: 0x95, hi: 0x95}, {value: 0x3308, lo: 0x96, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x97}, {value: 0x3008, lo: 0x98, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xa5}, {value: 0x0008, lo: 0xa6, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xb1}, {value: 0x3008, lo: 0xb2, hi: 0xb3}, {value: 0x0018, lo: 0xb4, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0x15, offset 0xdb {value: 0x0000, lo: 0x09}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0xb0}, {value: 0x3308, lo: 0xb1, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xb2}, {value: 0x08f1, lo: 0xb3, hi: 0xb3}, {value: 0x3308, lo: 0xb4, hi: 0xb9}, {value: 0x3b08, lo: 0xba, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbe}, {value: 0x0018, lo: 0xbf, hi: 0xbf}, // Block 0x16, offset 0xe5 {value: 0x0000, lo: 0x06}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x3308, lo: 0x87, hi: 0x8e}, {value: 0x0018, lo: 0x8f, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0xbf}, // Block 0x17, offset 0xec {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x84}, {value: 0x0040, lo: 0x85, hi: 0x85}, {value: 0x0008, lo: 0x86, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x87}, {value: 0x3308, lo: 0x88, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9b}, {value: 0x0961, lo: 0x9c, hi: 0x9c}, {value: 0x0999, lo: 0x9d, hi: 0x9d}, {value: 0x0008, lo: 0x9e, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0x18, offset 0xf9 {value: 0x0000, lo: 0x10}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x8a}, {value: 0x0008, lo: 0x8b, hi: 0x8b}, {value: 0xe03d, lo: 0x8c, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0x97}, {value: 0x3308, lo: 0x98, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa9}, {value: 0x0018, lo: 0xaa, hi: 0xb4}, {value: 0x3308, lo: 0xb5, hi: 0xb5}, {value: 0x0018, lo: 0xb6, hi: 0xb6}, {value: 0x3308, lo: 0xb7, hi: 0xb7}, {value: 0x0018, lo: 0xb8, hi: 0xb8}, {value: 0x3308, lo: 0xb9, hi: 0xb9}, {value: 0x0018, lo: 0xba, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbf}, // Block 0x19, offset 0x10a {value: 0x0000, lo: 0x06}, {value: 0x0018, lo: 0x80, hi: 0x85}, {value: 0x3308, lo: 0x86, hi: 0x86}, {value: 0x0018, lo: 0x87, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8d}, {value: 0x0018, lo: 0x8e, hi: 0x9a}, {value: 0x0040, lo: 0x9b, hi: 0xbf}, // Block 0x1a, offset 0x111 {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0xaa}, {value: 0x3008, lo: 0xab, hi: 0xac}, {value: 0x3308, lo: 0xad, hi: 0xb0}, {value: 0x3008, lo: 0xb1, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb7}, {value: 0x3008, lo: 0xb8, hi: 0xb8}, {value: 0x3b08, lo: 0xb9, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbc}, {value: 0x3308, lo: 0xbd, hi: 0xbe}, {value: 0x0008, lo: 0xbf, hi: 0xbf}, // Block 0x1b, offset 0x11c {value: 0x0000, lo: 0x0e}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0018, lo: 0x8a, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x95}, {value: 0x3008, lo: 0x96, hi: 0x97}, {value: 0x3308, lo: 0x98, hi: 0x99}, {value: 0x0008, lo: 0x9a, hi: 0x9d}, {value: 0x3308, lo: 0x9e, hi: 0xa0}, {value: 0x0008, lo: 0xa1, hi: 0xa1}, {value: 0x3008, lo: 0xa2, hi: 0xa4}, {value: 0x0008, lo: 0xa5, hi: 0xa6}, {value: 0x3008, lo: 0xa7, hi: 0xad}, {value: 0x0008, lo: 0xae, hi: 0xb0}, {value: 0x3308, lo: 0xb1, hi: 0xb4}, {value: 0x0008, lo: 0xb5, hi: 0xbf}, // Block 0x1c, offset 0x12b {value: 0x0000, lo: 0x0d}, {value: 0x0008, lo: 0x80, hi: 0x81}, {value: 0x3308, lo: 0x82, hi: 0x82}, {value: 0x3008, lo: 0x83, hi: 0x84}, {value: 0x3308, lo: 0x85, hi: 0x86}, {value: 0x3008, lo: 0x87, hi: 0x8c}, {value: 0x3308, lo: 0x8d, hi: 0x8d}, {value: 0x0008, lo: 0x8e, hi: 0x8e}, {value: 0x3008, lo: 0x8f, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x3008, lo: 0x9a, hi: 0x9c}, {value: 0x3308, lo: 0x9d, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0x1d, offset 0x139 {value: 0x0000, lo: 0x09}, {value: 0x0040, lo: 0x80, hi: 0x86}, {value: 0x055d, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8c}, {value: 0x055d, lo: 0x8d, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xba}, {value: 0x0018, lo: 0xbb, hi: 0xbb}, {value: 0xe105, lo: 0xbc, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbf}, // Block 0x1e, offset 0x143 {value: 0x0000, lo: 0x01}, {value: 0x0018, lo: 0x80, hi: 0xbf}, // Block 0x1f, offset 0x145 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0xa0}, {value: 0x2018, lo: 0xa1, hi: 0xb5}, {value: 0x0018, lo: 0xb6, hi: 0xbf}, // Block 0x20, offset 0x14a {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0xa7}, {value: 0x2018, lo: 0xa8, hi: 0xbf}, // Block 0x21, offset 0x14d {value: 0x0000, lo: 0x02}, {value: 0x2018, lo: 0x80, hi: 0x82}, {value: 0x0018, lo: 0x83, hi: 0xbf}, // Block 0x22, offset 0x150 {value: 0x0000, lo: 0x01}, {value: 0x0008, lo: 0x80, hi: 0xbf}, // Block 0x23, offset 0x152 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0008, lo: 0x8a, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0x98}, {value: 0x0040, lo: 0x99, hi: 0x99}, {value: 0x0008, lo: 0x9a, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x24, offset 0x15e {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0008, lo: 0x8a, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xb0}, {value: 0x0040, lo: 0xb1, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb7}, {value: 0x0008, lo: 0xb8, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0x25, offset 0x169 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x0040, lo: 0x81, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0xbf}, // Block 0x26, offset 0x171 {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x91}, {value: 0x0008, lo: 0x92, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0xbf}, // Block 0x27, offset 0x177 {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x9a}, {value: 0x0040, lo: 0x9b, hi: 0x9c}, {value: 0x3308, lo: 0x9d, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbf}, // Block 0x28, offset 0x17d {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x29, offset 0x182 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb7}, {value: 0xe045, lo: 0xb8, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbf}, // Block 0x2a, offset 0x187 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0xbf}, // Block 0x2b, offset 0x18a {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xac}, {value: 0x0018, lo: 0xad, hi: 0xae}, {value: 0x0008, lo: 0xaf, hi: 0xbf}, // Block 0x2c, offset 0x18e {value: 0x0000, lo: 0x05}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0x9c}, {value: 0x0040, lo: 0x9d, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x2d, offset 0x194 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xaa}, {value: 0x0018, lo: 0xab, hi: 0xb0}, {value: 0x0008, lo: 0xb1, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbf}, // Block 0x2e, offset 0x199 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8d}, {value: 0x0008, lo: 0x8e, hi: 0x91}, {value: 0x3308, lo: 0x92, hi: 0x93}, {value: 0x3b08, lo: 0x94, hi: 0x94}, {value: 0x0040, lo: 0x95, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb3}, {value: 0x3b08, lo: 0xb4, hi: 0xb4}, {value: 0x0018, lo: 0xb5, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0x2f, offset 0x1a5 {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x91}, {value: 0x3308, lo: 0x92, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xad}, {value: 0x0008, lo: 0xae, hi: 0xb0}, {value: 0x0040, lo: 0xb1, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xbf}, // Block 0x30, offset 0x1af {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0xb3}, {value: 0x3340, lo: 0xb4, hi: 0xb5}, {value: 0x3008, lo: 0xb6, hi: 0xb6}, {value: 0x3308, lo: 0xb7, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbf}, // Block 0x31, offset 0x1b5 {value: 0x0000, lo: 0x10}, {value: 0x3008, lo: 0x80, hi: 0x85}, {value: 0x3308, lo: 0x86, hi: 0x86}, {value: 0x3008, lo: 0x87, hi: 0x88}, {value: 0x3308, lo: 0x89, hi: 0x91}, {value: 0x3b08, lo: 0x92, hi: 0x92}, {value: 0x3308, lo: 0x93, hi: 0x93}, {value: 0x0018, lo: 0x94, hi: 0x96}, {value: 0x0008, lo: 0x97, hi: 0x97}, {value: 0x0018, lo: 0x98, hi: 0x9b}, {value: 0x0008, lo: 0x9c, hi: 0x9c}, {value: 0x3308, lo: 0x9d, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa9}, {value: 0x0040, lo: 0xaa, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0x32, offset 0x1c6 {value: 0x0000, lo: 0x09}, {value: 0x0018, lo: 0x80, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x86}, {value: 0x0218, lo: 0x87, hi: 0x87}, {value: 0x0018, lo: 0x88, hi: 0x8a}, {value: 0x33c0, lo: 0x8b, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0208, lo: 0xa0, hi: 0xbf}, // Block 0x33, offset 0x1d0 {value: 0x0000, lo: 0x02}, {value: 0x0208, lo: 0x80, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbf}, // Block 0x34, offset 0x1d3 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0x84}, {value: 0x3308, lo: 0x85, hi: 0x86}, {value: 0x0208, lo: 0x87, hi: 0xa8}, {value: 0x3308, lo: 0xa9, hi: 0xa9}, {value: 0x0208, lo: 0xaa, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x35, offset 0x1db {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xbf}, // Block 0x36, offset 0x1de {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x3308, lo: 0xa0, hi: 0xa2}, {value: 0x3008, lo: 0xa3, hi: 0xa6}, {value: 0x3308, lo: 0xa7, hi: 0xa8}, {value: 0x3008, lo: 0xa9, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x3008, lo: 0xb0, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb2}, {value: 0x3008, lo: 0xb3, hi: 0xb8}, {value: 0x3308, lo: 0xb9, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0x37, offset 0x1eb {value: 0x0000, lo: 0x07}, {value: 0x0018, lo: 0x80, hi: 0x80}, {value: 0x0040, lo: 0x81, hi: 0x83}, {value: 0x0018, lo: 0x84, hi: 0x85}, {value: 0x0008, lo: 0x86, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0x38, offset 0x1f3 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x39, offset 0x1f7 {value: 0x0000, lo: 0x06}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0028, lo: 0x9a, hi: 0x9a}, {value: 0x0040, lo: 0x9b, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0xbf}, // Block 0x3a, offset 0x1fe {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0x96}, {value: 0x3308, lo: 0x97, hi: 0x98}, {value: 0x3008, lo: 0x99, hi: 0x9a}, {value: 0x3308, lo: 0x9b, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x3b, offset 0x206 {value: 0x0000, lo: 0x0f}, {value: 0x0008, lo: 0x80, hi: 0x94}, {value: 0x3008, lo: 0x95, hi: 0x95}, {value: 0x3308, lo: 0x96, hi: 0x96}, {value: 0x3008, lo: 0x97, hi: 0x97}, {value: 0x3308, lo: 0x98, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x3b08, lo: 0xa0, hi: 0xa0}, {value: 0x3008, lo: 0xa1, hi: 0xa1}, {value: 0x3308, lo: 0xa2, hi: 0xa2}, {value: 0x3008, lo: 0xa3, hi: 0xa4}, {value: 0x3308, lo: 0xa5, hi: 0xac}, {value: 0x3008, lo: 0xad, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbe}, {value: 0x3308, lo: 0xbf, hi: 0xbf}, // Block 0x3c, offset 0x216 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa6}, {value: 0x0008, lo: 0xa7, hi: 0xa7}, {value: 0x0018, lo: 0xa8, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xbd}, {value: 0x3318, lo: 0xbe, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0x3d, offset 0x222 {value: 0x0000, lo: 0x01}, {value: 0x0040, lo: 0x80, hi: 0xbf}, // Block 0x3e, offset 0x224 {value: 0x0000, lo: 0x09}, {value: 0x3308, lo: 0x80, hi: 0x83}, {value: 0x3008, lo: 0x84, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0xb3}, {value: 0x3308, lo: 0xb4, hi: 0xb4}, {value: 0x3008, lo: 0xb5, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbc}, {value: 0x3008, lo: 0xbd, hi: 0xbf}, // Block 0x3f, offset 0x22e {value: 0x0000, lo: 0x0b}, {value: 0x3008, lo: 0x80, hi: 0x81}, {value: 0x3308, lo: 0x82, hi: 0x82}, {value: 0x3008, lo: 0x83, hi: 0x83}, {value: 0x3808, lo: 0x84, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0xaa}, {value: 0x3308, lo: 0xab, hi: 0xb3}, {value: 0x0018, lo: 0xb4, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbf}, // Block 0x40, offset 0x23a {value: 0x0000, lo: 0x0b}, {value: 0x3308, lo: 0x80, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0xa0}, {value: 0x3008, lo: 0xa1, hi: 0xa1}, {value: 0x3308, lo: 0xa2, hi: 0xa5}, {value: 0x3008, lo: 0xa6, hi: 0xa7}, {value: 0x3308, lo: 0xa8, hi: 0xa9}, {value: 0x3808, lo: 0xaa, hi: 0xaa}, {value: 0x3b08, lo: 0xab, hi: 0xab}, {value: 0x3308, lo: 0xac, hi: 0xad}, {value: 0x0008, lo: 0xae, hi: 0xbf}, // Block 0x41, offset 0x246 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0xa5}, {value: 0x3308, lo: 0xa6, hi: 0xa6}, {value: 0x3008, lo: 0xa7, hi: 0xa7}, {value: 0x3308, lo: 0xa8, hi: 0xa9}, {value: 0x3008, lo: 0xaa, hi: 0xac}, {value: 0x3308, lo: 0xad, hi: 0xad}, {value: 0x3008, lo: 0xae, hi: 0xae}, {value: 0x3308, lo: 0xaf, hi: 0xb1}, {value: 0x3808, lo: 0xb2, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xbb}, {value: 0x0018, lo: 0xbc, hi: 0xbf}, // Block 0x42, offset 0x252 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0xa3}, {value: 0x3008, lo: 0xa4, hi: 0xab}, {value: 0x3308, lo: 0xac, hi: 0xb3}, {value: 0x3008, lo: 0xb4, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xba}, {value: 0x0018, lo: 0xbb, hi: 0xbf}, // Block 0x43, offset 0x25a {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0x8c}, {value: 0x0008, lo: 0x8d, hi: 0xbd}, {value: 0x0018, lo: 0xbe, hi: 0xbf}, // Block 0x44, offset 0x25f {value: 0x0000, lo: 0x09}, {value: 0x0e29, lo: 0x80, hi: 0x80}, {value: 0x0e41, lo: 0x81, hi: 0x81}, {value: 0x0e59, lo: 0x82, hi: 0x82}, {value: 0x0e71, lo: 0x83, hi: 0x83}, {value: 0x0e89, lo: 0x84, hi: 0x85}, {value: 0x0ea1, lo: 0x86, hi: 0x86}, {value: 0x0eb9, lo: 0x87, hi: 0x87}, {value: 0x057d, lo: 0x88, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0xbf}, // Block 0x45, offset 0x269 {value: 0x0000, lo: 0x10}, {value: 0x0018, lo: 0x80, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x3308, lo: 0x90, hi: 0x92}, {value: 0x0018, lo: 0x93, hi: 0x93}, {value: 0x3308, lo: 0x94, hi: 0xa0}, {value: 0x3008, lo: 0xa1, hi: 0xa1}, {value: 0x3308, lo: 0xa2, hi: 0xa8}, {value: 0x0008, lo: 0xa9, hi: 0xac}, {value: 0x3308, lo: 0xad, hi: 0xad}, {value: 0x0008, lo: 0xae, hi: 0xb1}, {value: 0x3008, lo: 0xb2, hi: 0xb3}, {value: 0x3308, lo: 0xb4, hi: 0xb4}, {value: 0x0008, lo: 0xb5, hi: 0xb6}, {value: 0x3008, lo: 0xb7, hi: 0xb7}, {value: 0x3308, lo: 0xb8, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0x46, offset 0x27a {value: 0x0000, lo: 0x03}, {value: 0x3308, lo: 0x80, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xba}, {value: 0x3308, lo: 0xbb, hi: 0xbf}, // Block 0x47, offset 0x27e {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x87}, {value: 0xe045, lo: 0x88, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x97}, {value: 0xe045, lo: 0x98, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa7}, {value: 0xe045, lo: 0xa8, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb7}, {value: 0xe045, lo: 0xb8, hi: 0xbf}, // Block 0x48, offset 0x289 {value: 0x0000, lo: 0x03}, {value: 0x0040, lo: 0x80, hi: 0x8f}, {value: 0x3318, lo: 0x90, hi: 0xb0}, {value: 0x0040, lo: 0xb1, hi: 0xbf}, // Block 0x49, offset 0x28d {value: 0x0000, lo: 0x08}, {value: 0x0018, lo: 0x80, hi: 0x82}, {value: 0x0040, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0x84}, {value: 0x0018, lo: 0x85, hi: 0x88}, {value: 0x24c1, lo: 0x89, hi: 0x89}, {value: 0x0018, lo: 0x8a, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xbf}, // Block 0x4a, offset 0x296 {value: 0x0000, lo: 0x07}, {value: 0x0018, lo: 0x80, hi: 0xab}, {value: 0x24f1, lo: 0xac, hi: 0xac}, {value: 0x2529, lo: 0xad, hi: 0xad}, {value: 0x0018, lo: 0xae, hi: 0xae}, {value: 0x2579, lo: 0xaf, hi: 0xaf}, {value: 0x25b1, lo: 0xb0, hi: 0xb0}, {value: 0x0018, lo: 0xb1, hi: 0xbf}, // Block 0x4b, offset 0x29e {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x9f}, {value: 0x0080, lo: 0xa0, hi: 0xa0}, {value: 0x0018, lo: 0xa1, hi: 0xad}, {value: 0x0080, lo: 0xae, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xbf}, // Block 0x4c, offset 0x2a4 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0xa8}, {value: 0x09c5, lo: 0xa9, hi: 0xa9}, {value: 0x09e5, lo: 0xaa, hi: 0xaa}, {value: 0x0018, lo: 0xab, hi: 0xbf}, // Block 0x4d, offset 0x2a9 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xbf}, // Block 0x4e, offset 0x2ac {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0x8b}, {value: 0x28c1, lo: 0x8c, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0xbf}, // Block 0x4f, offset 0x2b0 {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0xb3}, {value: 0x0e66, lo: 0xb4, hi: 0xb4}, {value: 0x292a, lo: 0xb5, hi: 0xb5}, {value: 0x0e86, lo: 0xb6, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xbf}, // Block 0x50, offset 0x2b6 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0x9b}, {value: 0x2941, lo: 0x9c, hi: 0x9c}, {value: 0x0018, lo: 0x9d, hi: 0xbf}, // Block 0x51, offset 0x2ba {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xb5}, {value: 0x0018, lo: 0xb6, hi: 0xbf}, // Block 0x52, offset 0x2be {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x97}, {value: 0x0018, lo: 0x98, hi: 0xbf}, // Block 0x53, offset 0x2c2 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0018, lo: 0x8a, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0x54, offset 0x2c7 {value: 0x0000, lo: 0x05}, {value: 0xe185, lo: 0x80, hi: 0x8f}, {value: 0x03f5, lo: 0x90, hi: 0x9f}, {value: 0x0ea5, lo: 0xa0, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x55, offset 0x2cd {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0xa5}, {value: 0x0040, lo: 0xa6, hi: 0xa6}, {value: 0x0008, lo: 0xa7, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xac}, {value: 0x0008, lo: 0xad, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x56, offset 0x2d5 {value: 0x0000, lo: 0x06}, {value: 0x0008, lo: 0x80, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xae}, {value: 0xe075, lo: 0xaf, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb0}, {value: 0x0040, lo: 0xb1, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0x57, offset 0x2dc {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xa7}, {value: 0x0008, lo: 0xa8, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xb7}, {value: 0x0008, lo: 0xb8, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0x58, offset 0x2e7 {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x8e}, {value: 0x0040, lo: 0x8f, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x3308, lo: 0xa0, hi: 0xbf}, // Block 0x59, offset 0x2f1 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xae}, {value: 0x0008, lo: 0xaf, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xbf}, // Block 0x5a, offset 0x2f5 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0x8e}, {value: 0x0040, lo: 0x8f, hi: 0xbf}, // Block 0x5b, offset 0x2f8 {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0x9e}, {value: 0x0edd, lo: 0x9f, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xbf}, // Block 0x5c, offset 0x2fe {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xb2}, {value: 0x0efd, lo: 0xb3, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xbf}, // Block 0x5d, offset 0x302 {value: 0x0020, lo: 0x01}, {value: 0x0f1d, lo: 0x80, hi: 0xbf}, // Block 0x5e, offset 0x304 {value: 0x0020, lo: 0x02}, {value: 0x171d, lo: 0x80, hi: 0x8f}, {value: 0x18fd, lo: 0x90, hi: 0xbf}, // Block 0x5f, offset 0x307 {value: 0x0020, lo: 0x01}, {value: 0x1efd, lo: 0x80, hi: 0xbf}, // Block 0x60, offset 0x309 {value: 0x0000, lo: 0x02}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0xbf}, // Block 0x61, offset 0x30c {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x98}, {value: 0x3308, lo: 0x99, hi: 0x9a}, {value: 0x29e2, lo: 0x9b, hi: 0x9b}, {value: 0x2a0a, lo: 0x9c, hi: 0x9c}, {value: 0x0008, lo: 0x9d, hi: 0x9e}, {value: 0x2a31, lo: 0x9f, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa0}, {value: 0x0008, lo: 0xa1, hi: 0xbf}, // Block 0x62, offset 0x316 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xbe}, {value: 0x2a69, lo: 0xbf, hi: 0xbf}, // Block 0x63, offset 0x319 {value: 0x0000, lo: 0x0e}, {value: 0x0040, lo: 0x80, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xb0}, {value: 0x2a1d, lo: 0xb1, hi: 0xb1}, {value: 0x2a3d, lo: 0xb2, hi: 0xb2}, {value: 0x2a5d, lo: 0xb3, hi: 0xb3}, {value: 0x2a7d, lo: 0xb4, hi: 0xb4}, {value: 0x2a5d, lo: 0xb5, hi: 0xb5}, {value: 0x2a9d, lo: 0xb6, hi: 0xb6}, {value: 0x2abd, lo: 0xb7, hi: 0xb7}, {value: 0x2add, lo: 0xb8, hi: 0xb9}, {value: 0x2afd, lo: 0xba, hi: 0xbb}, {value: 0x2b1d, lo: 0xbc, hi: 0xbd}, {value: 0x2afd, lo: 0xbe, hi: 0xbf}, // Block 0x64, offset 0x328 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xa3}, {value: 0x0040, lo: 0xa4, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x65, offset 0x32c {value: 0x0030, lo: 0x04}, {value: 0x2aa2, lo: 0x80, hi: 0x9d}, {value: 0x305a, lo: 0x9e, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x30a2, lo: 0xa0, hi: 0xbf}, // Block 0x66, offset 0x331 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, // Block 0x67, offset 0x334 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xbf}, // Block 0x68, offset 0x338 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xbd}, {value: 0x0018, lo: 0xbe, hi: 0xbf}, // Block 0x69, offset 0x33d {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xbf}, // Block 0x6a, offset 0x342 {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0xa5}, {value: 0x0018, lo: 0xa6, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb1}, {value: 0x0018, lo: 0xb2, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbf}, // Block 0x6b, offset 0x348 {value: 0x0000, lo: 0x05}, {value: 0x0040, lo: 0x80, hi: 0xb6}, {value: 0x0008, lo: 0xb7, hi: 0xb7}, {value: 0x2009, lo: 0xb8, hi: 0xb8}, {value: 0x6e89, lo: 0xb9, hi: 0xb9}, {value: 0x0008, lo: 0xba, hi: 0xbf}, // Block 0x6c, offset 0x34e {value: 0x0000, lo: 0x0e}, {value: 0x0008, lo: 0x80, hi: 0x81}, {value: 0x3308, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0x85}, {value: 0x3b08, lo: 0x86, hi: 0x86}, {value: 0x0008, lo: 0x87, hi: 0x8a}, {value: 0x3308, lo: 0x8b, hi: 0x8b}, {value: 0x0008, lo: 0x8c, hi: 0xa2}, {value: 0x3008, lo: 0xa3, hi: 0xa4}, {value: 0x3308, lo: 0xa5, hi: 0xa6}, {value: 0x3008, lo: 0xa7, hi: 0xa7}, {value: 0x0018, lo: 0xa8, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0x6d, offset 0x35d {value: 0x0000, lo: 0x05}, {value: 0x0208, lo: 0x80, hi: 0xb1}, {value: 0x0108, lo: 0xb2, hi: 0xb2}, {value: 0x0008, lo: 0xb3, hi: 0xb3}, {value: 0x0018, lo: 0xb4, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbf}, // Block 0x6e, offset 0x363 {value: 0x0000, lo: 0x03}, {value: 0x3008, lo: 0x80, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0xb3}, {value: 0x3008, lo: 0xb4, hi: 0xbf}, // Block 0x6f, offset 0x367 {value: 0x0000, lo: 0x0e}, {value: 0x3008, lo: 0x80, hi: 0x83}, {value: 0x3b08, lo: 0x84, hi: 0x84}, {value: 0x3308, lo: 0x85, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x8d}, {value: 0x0018, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x3308, lo: 0xa0, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xb7}, {value: 0x0018, lo: 0xb8, hi: 0xba}, {value: 0x0008, lo: 0xbb, hi: 0xbb}, {value: 0x0018, lo: 0xbc, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbe}, {value: 0x3308, lo: 0xbf, hi: 0xbf}, // Block 0x70, offset 0x376 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xa5}, {value: 0x3308, lo: 0xa6, hi: 0xad}, {value: 0x0018, lo: 0xae, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x71, offset 0x37b {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x3308, lo: 0x87, hi: 0x91}, {value: 0x3008, lo: 0x92, hi: 0x92}, {value: 0x3808, lo: 0x93, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x9e}, {value: 0x0018, lo: 0x9f, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbf}, // Block 0x72, offset 0x383 {value: 0x0000, lo: 0x09}, {value: 0x3308, lo: 0x80, hi: 0x82}, {value: 0x3008, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb3}, {value: 0x3008, lo: 0xb4, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xb9}, {value: 0x3008, lo: 0xba, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbc}, {value: 0x3008, lo: 0xbd, hi: 0xbf}, // Block 0x73, offset 0x38d {value: 0x0000, lo: 0x0a}, {value: 0x3808, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8e}, {value: 0x0008, lo: 0x8f, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa4}, {value: 0x3308, lo: 0xa5, hi: 0xa5}, {value: 0x0008, lo: 0xa6, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0x74, offset 0x398 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0xa8}, {value: 0x3308, lo: 0xa9, hi: 0xae}, {value: 0x3008, lo: 0xaf, hi: 0xb0}, {value: 0x3308, lo: 0xb1, hi: 0xb2}, {value: 0x3008, lo: 0xb3, hi: 0xb4}, {value: 0x3308, lo: 0xb5, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0x75, offset 0x3a0 {value: 0x0000, lo: 0x10}, {value: 0x0008, lo: 0x80, hi: 0x82}, {value: 0x3308, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0x8b}, {value: 0x3308, lo: 0x8c, hi: 0x8c}, {value: 0x3008, lo: 0x8d, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9b}, {value: 0x0018, lo: 0x9c, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xb9}, {value: 0x0008, lo: 0xba, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbc}, {value: 0x3008, lo: 0xbd, hi: 0xbd}, {value: 0x0008, lo: 0xbe, hi: 0xbf}, // Block 0x76, offset 0x3b1 {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb0}, {value: 0x0008, lo: 0xb1, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb4}, {value: 0x0008, lo: 0xb5, hi: 0xb6}, {value: 0x3308, lo: 0xb7, hi: 0xb8}, {value: 0x0008, lo: 0xb9, hi: 0xbd}, {value: 0x3308, lo: 0xbe, hi: 0xbf}, // Block 0x77, offset 0x3ba {value: 0x0000, lo: 0x0f}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0x82}, {value: 0x0040, lo: 0x83, hi: 0x9a}, {value: 0x0008, lo: 0x9b, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xaa}, {value: 0x3008, lo: 0xab, hi: 0xab}, {value: 0x3308, lo: 0xac, hi: 0xad}, {value: 0x3008, lo: 0xae, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xb4}, {value: 0x3008, lo: 0xb5, hi: 0xb5}, {value: 0x3b08, lo: 0xb6, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0x78, offset 0x3ca {value: 0x0000, lo: 0x0c}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x88}, {value: 0x0008, lo: 0x89, hi: 0x8e}, {value: 0x0040, lo: 0x8f, hi: 0x90}, {value: 0x0008, lo: 0x91, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xa7}, {value: 0x0008, lo: 0xa8, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x79, offset 0x3d7 {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0x9b}, {value: 0x4465, lo: 0x9c, hi: 0x9c}, {value: 0x447d, lo: 0x9d, hi: 0x9d}, {value: 0x2971, lo: 0x9e, hi: 0x9e}, {value: 0xe06d, lo: 0x9f, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa5}, {value: 0x0040, lo: 0xa6, hi: 0xaf}, {value: 0x4495, lo: 0xb0, hi: 0xbf}, // Block 0x7a, offset 0x3e1 {value: 0x0000, lo: 0x04}, {value: 0x44b5, lo: 0x80, hi: 0x8f}, {value: 0x44d5, lo: 0x90, hi: 0x9f}, {value: 0x44f5, lo: 0xa0, hi: 0xaf}, {value: 0x44d5, lo: 0xb0, hi: 0xbf}, // Block 0x7b, offset 0x3e6 {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0xa2}, {value: 0x3008, lo: 0xa3, hi: 0xa4}, {value: 0x3308, lo: 0xa5, hi: 0xa5}, {value: 0x3008, lo: 0xa6, hi: 0xa7}, {value: 0x3308, lo: 0xa8, hi: 0xa8}, {value: 0x3008, lo: 0xa9, hi: 0xaa}, {value: 0x0018, lo: 0xab, hi: 0xab}, {value: 0x3008, lo: 0xac, hi: 0xac}, {value: 0x3b08, lo: 0xad, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0x7c, offset 0x3f3 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xa3}, {value: 0x0040, lo: 0xa4, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xbf}, // Block 0x7d, offset 0x3f7 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x8a}, {value: 0x0018, lo: 0x8b, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0x7e, offset 0x3fc {value: 0x0020, lo: 0x01}, {value: 0x4515, lo: 0x80, hi: 0xbf}, // Block 0x7f, offset 0x3fe {value: 0x0020, lo: 0x03}, {value: 0x4d15, lo: 0x80, hi: 0x94}, {value: 0x4ad5, lo: 0x95, hi: 0x95}, {value: 0x4fb5, lo: 0x96, hi: 0xbf}, // Block 0x80, offset 0x402 {value: 0x0020, lo: 0x01}, {value: 0x54f5, lo: 0x80, hi: 0xbf}, // Block 0x81, offset 0x404 {value: 0x0020, lo: 0x03}, {value: 0x5cf5, lo: 0x80, hi: 0x84}, {value: 0x5655, lo: 0x85, hi: 0x85}, {value: 0x5d95, lo: 0x86, hi: 0xbf}, // Block 0x82, offset 0x408 {value: 0x0020, lo: 0x08}, {value: 0x6b55, lo: 0x80, hi: 0x8f}, {value: 0x6d15, lo: 0x90, hi: 0x90}, {value: 0x6d55, lo: 0x91, hi: 0xab}, {value: 0x6ea1, lo: 0xac, hi: 0xac}, {value: 0x70b5, lo: 0xad, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x70d5, lo: 0xb0, hi: 0xbf}, // Block 0x83, offset 0x411 {value: 0x0020, lo: 0x05}, {value: 0x72d5, lo: 0x80, hi: 0xad}, {value: 0x6535, lo: 0xae, hi: 0xae}, {value: 0x7895, lo: 0xaf, hi: 0xb5}, {value: 0x6f55, lo: 0xb6, hi: 0xb6}, {value: 0x7975, lo: 0xb7, hi: 0xbf}, // Block 0x84, offset 0x417 {value: 0x0028, lo: 0x03}, {value: 0x7c21, lo: 0x80, hi: 0x82}, {value: 0x7be1, lo: 0x83, hi: 0x83}, {value: 0x7c99, lo: 0x84, hi: 0xbf}, // Block 0x85, offset 0x41b {value: 0x0038, lo: 0x0f}, {value: 0x9db1, lo: 0x80, hi: 0x83}, {value: 0x9e59, lo: 0x84, hi: 0x85}, {value: 0x9e91, lo: 0x86, hi: 0x87}, {value: 0x9ec9, lo: 0x88, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x91}, {value: 0xa089, lo: 0x92, hi: 0x97}, {value: 0xa1a1, lo: 0x98, hi: 0x9c}, {value: 0xa281, lo: 0x9d, hi: 0xb3}, {value: 0x9d41, lo: 0xb4, hi: 0xb4}, {value: 0x9db1, lo: 0xb5, hi: 0xb5}, {value: 0xa789, lo: 0xb6, hi: 0xbb}, {value: 0xa869, lo: 0xbc, hi: 0xbc}, {value: 0xa7f9, lo: 0xbd, hi: 0xbd}, {value: 0xa8d9, lo: 0xbe, hi: 0xbf}, // Block 0x86, offset 0x42b {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8c}, {value: 0x0008, lo: 0x8d, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xa7}, {value: 0x0008, lo: 0xa8, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbb}, {value: 0x0008, lo: 0xbc, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbe}, {value: 0x0008, lo: 0xbf, hi: 0xbf}, // Block 0x87, offset 0x435 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0xbf}, // Block 0x88, offset 0x43a {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbf}, // Block 0x89, offset 0x43d {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x82}, {value: 0x0040, lo: 0x83, hi: 0x86}, {value: 0x0018, lo: 0x87, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xbf}, // Block 0x8a, offset 0x443 {value: 0x0000, lo: 0x06}, {value: 0x0018, lo: 0x80, hi: 0x8e}, {value: 0x0040, lo: 0x8f, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa0}, {value: 0x0040, lo: 0xa1, hi: 0xbf}, // Block 0x8b, offset 0x44a {value: 0x0000, lo: 0x04}, {value: 0x0040, lo: 0x80, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xbc}, {value: 0x3308, lo: 0xbd, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbf}, // Block 0x8c, offset 0x44f {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0x9c}, {value: 0x0040, lo: 0x9d, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x8d, offset 0x453 {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x9f}, {value: 0x3308, lo: 0xa0, hi: 0xa0}, {value: 0x0018, lo: 0xa1, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0x8e, offset 0x459 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa3}, {value: 0x0040, lo: 0xa4, hi: 0xac}, {value: 0x0008, lo: 0xad, hi: 0xbf}, // Block 0x8f, offset 0x45e {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0x89}, {value: 0x0018, lo: 0x8a, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbf}, // Block 0x90, offset 0x467 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9e}, {value: 0x0018, lo: 0x9f, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x91, offset 0x46c {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0xbf}, // Block 0x92, offset 0x472 {value: 0x0000, lo: 0x06}, {value: 0xe145, lo: 0x80, hi: 0x87}, {value: 0xe1c5, lo: 0x88, hi: 0x8f}, {value: 0xe145, lo: 0x90, hi: 0x97}, {value: 0x8ad5, lo: 0x98, hi: 0x9f}, {value: 0x8aed, lo: 0xa0, hi: 0xa7}, {value: 0x0008, lo: 0xa8, hi: 0xbf}, // Block 0x93, offset 0x479 {value: 0x0000, lo: 0x06}, {value: 0x0008, lo: 0x80, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa9}, {value: 0x0040, lo: 0xaa, hi: 0xaf}, {value: 0x8aed, lo: 0xb0, hi: 0xb7}, {value: 0x8ad5, lo: 0xb8, hi: 0xbf}, // Block 0x94, offset 0x480 {value: 0x0000, lo: 0x06}, {value: 0xe145, lo: 0x80, hi: 0x87}, {value: 0xe1c5, lo: 0x88, hi: 0x8f}, {value: 0xe145, lo: 0x90, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0x95, offset 0x487 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x96, offset 0x48b {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xa3}, {value: 0x0040, lo: 0xa4, hi: 0xae}, {value: 0x0018, lo: 0xaf, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, // Block 0x97, offset 0x490 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0x98, offset 0x493 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xbf}, // Block 0x99, offset 0x498 {value: 0x0000, lo: 0x0b}, {value: 0x0808, lo: 0x80, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x87}, {value: 0x0808, lo: 0x88, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0808, lo: 0x8a, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb6}, {value: 0x0808, lo: 0xb7, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbb}, {value: 0x0808, lo: 0xbc, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbe}, {value: 0x0808, lo: 0xbf, hi: 0xbf}, // Block 0x9a, offset 0x4a4 {value: 0x0000, lo: 0x05}, {value: 0x0808, lo: 0x80, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x96}, {value: 0x0818, lo: 0x97, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xb6}, {value: 0x0818, lo: 0xb7, hi: 0xbf}, // Block 0x9b, offset 0x4aa {value: 0x0000, lo: 0x04}, {value: 0x0808, lo: 0x80, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0xa6}, {value: 0x0818, lo: 0xa7, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, // Block 0x9c, offset 0x4af {value: 0x0000, lo: 0x06}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xb3}, {value: 0x0808, lo: 0xb4, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xba}, {value: 0x0818, lo: 0xbb, hi: 0xbf}, // Block 0x9d, offset 0x4b6 {value: 0x0000, lo: 0x07}, {value: 0x0808, lo: 0x80, hi: 0x95}, {value: 0x0818, lo: 0x96, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0x9e}, {value: 0x0018, lo: 0x9f, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbe}, {value: 0x0818, lo: 0xbf, hi: 0xbf}, // Block 0x9e, offset 0x4be {value: 0x0000, lo: 0x04}, {value: 0x0808, lo: 0x80, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbb}, {value: 0x0818, lo: 0xbc, hi: 0xbd}, {value: 0x0808, lo: 0xbe, hi: 0xbf}, // Block 0x9f, offset 0x4c3 {value: 0x0000, lo: 0x03}, {value: 0x0818, lo: 0x80, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0x91}, {value: 0x0818, lo: 0x92, hi: 0xbf}, // Block 0xa0, offset 0x4c7 {value: 0x0000, lo: 0x0f}, {value: 0x0808, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x84}, {value: 0x3308, lo: 0x85, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x8b}, {value: 0x3308, lo: 0x8c, hi: 0x8f}, {value: 0x0808, lo: 0x90, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x94}, {value: 0x0808, lo: 0x95, hi: 0x97}, {value: 0x0040, lo: 0x98, hi: 0x98}, {value: 0x0808, lo: 0x99, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb7}, {value: 0x3308, lo: 0xb8, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0xa1, offset 0x4d7 {value: 0x0000, lo: 0x06}, {value: 0x0818, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x8f}, {value: 0x0818, lo: 0x90, hi: 0x98}, {value: 0x0040, lo: 0x99, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xbc}, {value: 0x0818, lo: 0xbd, hi: 0xbf}, // Block 0xa2, offset 0x4de {value: 0x0000, lo: 0x03}, {value: 0x0808, lo: 0x80, hi: 0x9c}, {value: 0x0818, lo: 0x9d, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0xa3, offset 0x4e2 {value: 0x0000, lo: 0x03}, {value: 0x0808, lo: 0x80, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb8}, {value: 0x0018, lo: 0xb9, hi: 0xbf}, // Block 0xa4, offset 0x4e6 {value: 0x0000, lo: 0x06}, {value: 0x0808, lo: 0x80, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x97}, {value: 0x0818, lo: 0x98, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xb7}, {value: 0x0818, lo: 0xb8, hi: 0xbf}, // Block 0xa5, offset 0x4ed {value: 0x0000, lo: 0x01}, {value: 0x0808, lo: 0x80, hi: 0xbf}, // Block 0xa6, offset 0x4ef {value: 0x0000, lo: 0x02}, {value: 0x0808, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0xbf}, // Block 0xa7, offset 0x4f2 {value: 0x0000, lo: 0x02}, {value: 0x03dd, lo: 0x80, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xbf}, // Block 0xa8, offset 0x4f5 {value: 0x0000, lo: 0x03}, {value: 0x0808, lo: 0x80, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xb9}, {value: 0x0818, lo: 0xba, hi: 0xbf}, // Block 0xa9, offset 0x4f9 {value: 0x0000, lo: 0x08}, {value: 0x0908, lo: 0x80, hi: 0x80}, {value: 0x0a08, lo: 0x81, hi: 0xa1}, {value: 0x0c08, lo: 0xa2, hi: 0xa2}, {value: 0x0a08, lo: 0xa3, hi: 0xa3}, {value: 0x3308, lo: 0xa4, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xaf}, {value: 0x0808, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0xaa, offset 0x502 {value: 0x0000, lo: 0x03}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0818, lo: 0xa0, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0xab, offset 0x506 {value: 0x0000, lo: 0x07}, {value: 0x0808, lo: 0x80, hi: 0x9c}, {value: 0x0818, lo: 0x9d, hi: 0xa6}, {value: 0x0808, lo: 0xa7, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xaf}, {value: 0x0a08, lo: 0xb0, hi: 0xb2}, {value: 0x0c08, lo: 0xb3, hi: 0xb3}, {value: 0x0a08, lo: 0xb4, hi: 0xbf}, // Block 0xac, offset 0x50e {value: 0x0000, lo: 0x07}, {value: 0x0a08, lo: 0x80, hi: 0x84}, {value: 0x0808, lo: 0x85, hi: 0x85}, {value: 0x3308, lo: 0x86, hi: 0x90}, {value: 0x0a18, lo: 0x91, hi: 0x93}, {value: 0x0c18, lo: 0x94, hi: 0x94}, {value: 0x0818, lo: 0x95, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0xbf}, // Block 0xad, offset 0x516 {value: 0x0000, lo: 0x05}, {value: 0x3008, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0xb7}, {value: 0x3308, lo: 0xb8, hi: 0xbf}, // Block 0xae, offset 0x51c {value: 0x0000, lo: 0x08}, {value: 0x3308, lo: 0x80, hi: 0x85}, {value: 0x3b08, lo: 0x86, hi: 0x86}, {value: 0x0018, lo: 0x87, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x91}, {value: 0x0018, lo: 0x92, hi: 0xa5}, {value: 0x0008, lo: 0xa6, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0xaf, offset 0x525 {value: 0x0000, lo: 0x0b}, {value: 0x3308, lo: 0x80, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0xaf}, {value: 0x3008, lo: 0xb0, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb6}, {value: 0x3008, lo: 0xb7, hi: 0xb8}, {value: 0x3b08, lo: 0xb9, hi: 0xb9}, {value: 0x3308, lo: 0xba, hi: 0xba}, {value: 0x0018, lo: 0xbb, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbd}, {value: 0x0018, lo: 0xbe, hi: 0xbf}, // Block 0xb0, offset 0x531 {value: 0x0000, lo: 0x06}, {value: 0x0018, lo: 0x80, hi: 0x81}, {value: 0x0040, lo: 0x82, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xa8}, {value: 0x0040, lo: 0xa9, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0xb1, offset 0x538 {value: 0x0000, lo: 0x08}, {value: 0x3308, lo: 0x80, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0xa6}, {value: 0x3308, lo: 0xa7, hi: 0xab}, {value: 0x3008, lo: 0xac, hi: 0xac}, {value: 0x3308, lo: 0xad, hi: 0xb2}, {value: 0x3b08, lo: 0xb3, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xb5}, {value: 0x0008, lo: 0xb6, hi: 0xbf}, // Block 0xb2, offset 0x541 {value: 0x0000, lo: 0x09}, {value: 0x0018, lo: 0x80, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0x84}, {value: 0x3008, lo: 0x85, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb3}, {value: 0x0018, lo: 0xb4, hi: 0xb5}, {value: 0x0008, lo: 0xb6, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0xb3, offset 0x54b {value: 0x0000, lo: 0x06}, {value: 0x3308, lo: 0x80, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0xb2}, {value: 0x3008, lo: 0xb3, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xbe}, {value: 0x3008, lo: 0xbf, hi: 0xbf}, // Block 0xb4, offset 0x552 {value: 0x0000, lo: 0x0d}, {value: 0x3808, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0x84}, {value: 0x0018, lo: 0x85, hi: 0x88}, {value: 0x3308, lo: 0x89, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0x9b}, {value: 0x0008, lo: 0x9c, hi: 0x9c}, {value: 0x0018, lo: 0x9d, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xa0}, {value: 0x0018, lo: 0xa1, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0xb5, offset 0x560 {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x91}, {value: 0x0040, lo: 0x92, hi: 0x92}, {value: 0x0008, lo: 0x93, hi: 0xab}, {value: 0x3008, lo: 0xac, hi: 0xae}, {value: 0x3308, lo: 0xaf, hi: 0xb1}, {value: 0x3008, lo: 0xb2, hi: 0xb3}, {value: 0x3308, lo: 0xb4, hi: 0xb4}, {value: 0x3808, lo: 0xb5, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xb7}, {value: 0x0018, lo: 0xb8, hi: 0xbd}, {value: 0x3308, lo: 0xbe, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0xb6, offset 0x56d {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0008, lo: 0x8a, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8e}, {value: 0x0008, lo: 0x8f, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9e}, {value: 0x0008, lo: 0x9f, hi: 0xa8}, {value: 0x0018, lo: 0xa9, hi: 0xa9}, {value: 0x0040, lo: 0xaa, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0xb7, offset 0x57a {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0x9e}, {value: 0x3308, lo: 0x9f, hi: 0x9f}, {value: 0x3008, lo: 0xa0, hi: 0xa2}, {value: 0x3308, lo: 0xa3, hi: 0xa9}, {value: 0x3b08, lo: 0xaa, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0xb8, offset 0x583 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xb4}, {value: 0x3008, lo: 0xb5, hi: 0xb7}, {value: 0x3308, lo: 0xb8, hi: 0xbf}, // Block 0xb9, offset 0x587 {value: 0x0000, lo: 0x0e}, {value: 0x3008, lo: 0x80, hi: 0x81}, {value: 0x3b08, lo: 0x82, hi: 0x82}, {value: 0x3308, lo: 0x83, hi: 0x84}, {value: 0x3008, lo: 0x85, hi: 0x85}, {value: 0x3308, lo: 0x86, hi: 0x86}, {value: 0x0008, lo: 0x87, hi: 0x8a}, {value: 0x0018, lo: 0x8b, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0x9c}, {value: 0x0018, lo: 0x9d, hi: 0x9d}, {value: 0x3308, lo: 0x9e, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0xbf}, // Block 0xba, offset 0x596 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x3008, lo: 0xb0, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb8}, {value: 0x3008, lo: 0xb9, hi: 0xb9}, {value: 0x3308, lo: 0xba, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbe}, {value: 0x3308, lo: 0xbf, hi: 0xbf}, // Block 0xbb, offset 0x59e {value: 0x0000, lo: 0x0a}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x3008, lo: 0x81, hi: 0x81}, {value: 0x3b08, lo: 0x82, hi: 0x82}, {value: 0x3308, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0x85}, {value: 0x0018, lo: 0x86, hi: 0x86}, {value: 0x0008, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0xbf}, // Block 0xbc, offset 0x5a9 {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0xae}, {value: 0x3008, lo: 0xaf, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb7}, {value: 0x3008, lo: 0xb8, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0xbd, offset 0x5b2 {value: 0x0000, lo: 0x05}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0x9b}, {value: 0x3308, lo: 0x9c, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0xbf}, // Block 0xbe, offset 0x5b8 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x3008, lo: 0xb0, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbc}, {value: 0x3308, lo: 0xbd, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0xbf, offset 0x5c0 {value: 0x0000, lo: 0x08}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0x84}, {value: 0x0040, lo: 0x85, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xbf}, // Block 0xc0, offset 0x5c9 {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0xaa}, {value: 0x3308, lo: 0xab, hi: 0xab}, {value: 0x3008, lo: 0xac, hi: 0xac}, {value: 0x3308, lo: 0xad, hi: 0xad}, {value: 0x3008, lo: 0xae, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb5}, {value: 0x3808, lo: 0xb6, hi: 0xb6}, {value: 0x3308, lo: 0xb7, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbf}, // Block 0xc1, offset 0x5d3 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0xbf}, // Block 0xc2, offset 0x5d6 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x9a}, {value: 0x0040, lo: 0x9b, hi: 0x9c}, {value: 0x3308, lo: 0x9d, hi: 0x9f}, {value: 0x3008, lo: 0xa0, hi: 0xa1}, {value: 0x3308, lo: 0xa2, hi: 0xa5}, {value: 0x3008, lo: 0xa6, hi: 0xa6}, {value: 0x3308, lo: 0xa7, hi: 0xaa}, {value: 0x3b08, lo: 0xab, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb9}, {value: 0x0018, lo: 0xba, hi: 0xbf}, // Block 0xc3, offset 0x5e2 {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0xab}, {value: 0x3008, lo: 0xac, hi: 0xae}, {value: 0x3308, lo: 0xaf, hi: 0xb7}, {value: 0x3008, lo: 0xb8, hi: 0xb8}, {value: 0x3b08, lo: 0xb9, hi: 0xb9}, {value: 0x3308, lo: 0xba, hi: 0xba}, {value: 0x0018, lo: 0xbb, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0xc4, offset 0x5eb {value: 0x0000, lo: 0x02}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x049d, lo: 0xa0, hi: 0xbf}, // Block 0xc5, offset 0x5ee {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xa9}, {value: 0x0018, lo: 0xaa, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xbe}, {value: 0x0008, lo: 0xbf, hi: 0xbf}, // Block 0xc6, offset 0x5f3 {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x8a}, {value: 0x0008, lo: 0x8b, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb3}, {value: 0x3b08, lo: 0xb4, hi: 0xb4}, {value: 0x3308, lo: 0xb5, hi: 0xb8}, {value: 0x3008, lo: 0xb9, hi: 0xb9}, {value: 0x0008, lo: 0xba, hi: 0xba}, {value: 0x3308, lo: 0xbb, hi: 0xbe}, {value: 0x0018, lo: 0xbf, hi: 0xbf}, // Block 0xc7, offset 0x5fe {value: 0x0000, lo: 0x08}, {value: 0x0018, lo: 0x80, hi: 0x86}, {value: 0x3b08, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x90}, {value: 0x3308, lo: 0x91, hi: 0x96}, {value: 0x3008, lo: 0x97, hi: 0x98}, {value: 0x3308, lo: 0x99, hi: 0x9b}, {value: 0x0008, lo: 0x9c, hi: 0xbf}, // Block 0xc8, offset 0x607 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x85}, {value: 0x0008, lo: 0x86, hi: 0x89}, {value: 0x3308, lo: 0x8a, hi: 0x96}, {value: 0x3008, lo: 0x97, hi: 0x97}, {value: 0x3308, lo: 0x98, hi: 0x98}, {value: 0x3b08, lo: 0x99, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0x9c}, {value: 0x0008, lo: 0x9d, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0xa2}, {value: 0x0040, lo: 0xa3, hi: 0xbf}, // Block 0xc9, offset 0x613 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbf}, // Block 0xca, offset 0x616 {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0008, lo: 0x8a, hi: 0xae}, {value: 0x3008, lo: 0xaf, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xb7}, {value: 0x3308, lo: 0xb8, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0xcb, offset 0x620 {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xbf}, // Block 0xcc, offset 0x629 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0x91}, {value: 0x3308, lo: 0x92, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xa8}, {value: 0x3008, lo: 0xa9, hi: 0xa9}, {value: 0x3308, lo: 0xaa, hi: 0xb0}, {value: 0x3008, lo: 0xb1, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb3}, {value: 0x3008, lo: 0xb4, hi: 0xb4}, {value: 0x3308, lo: 0xb5, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0xcd, offset 0x635 {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0x8a}, {value: 0x0008, lo: 0x8b, hi: 0xb0}, {value: 0x3308, lo: 0xb1, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xb9}, {value: 0x3308, lo: 0xba, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbe}, {value: 0x3308, lo: 0xbf, hi: 0xbf}, // Block 0xce, offset 0x642 {value: 0x0000, lo: 0x0c}, {value: 0x3308, lo: 0x80, hi: 0x83}, {value: 0x3b08, lo: 0x84, hi: 0x85}, {value: 0x0008, lo: 0x86, hi: 0x86}, {value: 0x3308, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa5}, {value: 0x0040, lo: 0xa6, hi: 0xa6}, {value: 0x0008, lo: 0xa7, hi: 0xa8}, {value: 0x0040, lo: 0xa9, hi: 0xa9}, {value: 0x0008, lo: 0xaa, hi: 0xbf}, // Block 0xcf, offset 0x64f {value: 0x0000, lo: 0x0d}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x3008, lo: 0x8a, hi: 0x8e}, {value: 0x0040, lo: 0x8f, hi: 0x8f}, {value: 0x3308, lo: 0x90, hi: 0x91}, {value: 0x0040, lo: 0x92, hi: 0x92}, {value: 0x3008, lo: 0x93, hi: 0x94}, {value: 0x3308, lo: 0x95, hi: 0x95}, {value: 0x3008, lo: 0x96, hi: 0x96}, {value: 0x3b08, lo: 0x97, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0x98}, {value: 0x0040, lo: 0x99, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa9}, {value: 0x0040, lo: 0xaa, hi: 0xbf}, // Block 0xd0, offset 0x65d {value: 0x0000, lo: 0x06}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb4}, {value: 0x3008, lo: 0xb5, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbf}, // Block 0xd1, offset 0x664 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0xbf}, // Block 0xd2, offset 0x667 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0xd3, offset 0x66c {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0xbf}, // Block 0xd4, offset 0x66f {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xbf}, // Block 0xd5, offset 0x672 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0xbf}, // Block 0xd6, offset 0x675 {value: 0x0000, lo: 0x06}, {value: 0x0008, lo: 0x80, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa9}, {value: 0x0040, lo: 0xaa, hi: 0xad}, {value: 0x0018, lo: 0xae, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, // Block 0xd7, offset 0x67c {value: 0x0000, lo: 0x06}, {value: 0x0040, lo: 0x80, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb4}, {value: 0x0018, lo: 0xb5, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xbf}, // Block 0xd8, offset 0x683 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xbf}, // Block 0xd9, offset 0x687 {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x83}, {value: 0x0018, lo: 0x84, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0xa1}, {value: 0x0040, lo: 0xa2, hi: 0xa2}, {value: 0x0008, lo: 0xa3, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbf}, // Block 0xda, offset 0x692 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0xbf}, // Block 0xdb, offset 0x695 {value: 0x0000, lo: 0x02}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0xdc, offset 0x698 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0x9a}, {value: 0x0040, lo: 0x9b, hi: 0xbf}, // Block 0xdd, offset 0x69b {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x84}, {value: 0x0040, lo: 0x85, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x90}, {value: 0x3008, lo: 0x91, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0xde, offset 0x6a1 {value: 0x0000, lo: 0x04}, {value: 0x0040, lo: 0x80, hi: 0x8e}, {value: 0x3308, lo: 0x8f, hi: 0x92}, {value: 0x0008, lo: 0x93, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0xdf, offset 0x6a6 {value: 0x0000, lo: 0x03}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa1}, {value: 0x0040, lo: 0xa2, hi: 0xbf}, // Block 0xe0, offset 0x6aa {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb1}, {value: 0x0040, lo: 0xb2, hi: 0xbf}, // Block 0xe1, offset 0x6ad {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xbf}, // Block 0xe2, offset 0x6b0 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0xbf}, // Block 0xe3, offset 0x6b3 {value: 0x0000, lo: 0x02}, {value: 0x0040, lo: 0x80, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0xe4, offset 0x6b6 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0xe5, offset 0x6b9 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbf}, // Block 0xe6, offset 0x6be {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9b}, {value: 0x0018, lo: 0x9c, hi: 0x9c}, {value: 0x3308, lo: 0x9d, hi: 0x9e}, {value: 0x0018, lo: 0x9f, hi: 0x9f}, {value: 0x03c0, lo: 0xa0, hi: 0xa3}, {value: 0x0040, lo: 0xa4, hi: 0xbf}, // Block 0xe7, offset 0x6c8 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xbf}, // Block 0xe8, offset 0x6cb {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xa8}, {value: 0x0018, lo: 0xa9, hi: 0xbf}, // Block 0xe9, offset 0x6cf {value: 0x0000, lo: 0x0e}, {value: 0x0018, lo: 0x80, hi: 0x9d}, {value: 0xb5b9, lo: 0x9e, hi: 0x9e}, {value: 0xb601, lo: 0x9f, hi: 0x9f}, {value: 0xb649, lo: 0xa0, hi: 0xa0}, {value: 0xb6b1, lo: 0xa1, hi: 0xa1}, {value: 0xb719, lo: 0xa2, hi: 0xa2}, {value: 0xb781, lo: 0xa3, hi: 0xa3}, {value: 0xb7e9, lo: 0xa4, hi: 0xa4}, {value: 0x3018, lo: 0xa5, hi: 0xa6}, {value: 0x3318, lo: 0xa7, hi: 0xa9}, {value: 0x0018, lo: 0xaa, hi: 0xac}, {value: 0x3018, lo: 0xad, hi: 0xb2}, {value: 0x0340, lo: 0xb3, hi: 0xba}, {value: 0x3318, lo: 0xbb, hi: 0xbf}, // Block 0xea, offset 0x6de {value: 0x0000, lo: 0x0b}, {value: 0x3318, lo: 0x80, hi: 0x82}, {value: 0x0018, lo: 0x83, hi: 0x84}, {value: 0x3318, lo: 0x85, hi: 0x8b}, {value: 0x0018, lo: 0x8c, hi: 0xa9}, {value: 0x3318, lo: 0xaa, hi: 0xad}, {value: 0x0018, lo: 0xae, hi: 0xba}, {value: 0xb851, lo: 0xbb, hi: 0xbb}, {value: 0xb899, lo: 0xbc, hi: 0xbc}, {value: 0xb8e1, lo: 0xbd, hi: 0xbd}, {value: 0xb949, lo: 0xbe, hi: 0xbe}, {value: 0xb9b1, lo: 0xbf, hi: 0xbf}, // Block 0xeb, offset 0x6ea {value: 0x0000, lo: 0x03}, {value: 0xba19, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0xa8}, {value: 0x0040, lo: 0xa9, hi: 0xbf}, // Block 0xec, offset 0x6ee {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x81}, {value: 0x3318, lo: 0x82, hi: 0x84}, {value: 0x0018, lo: 0x85, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0xbf}, // Block 0xed, offset 0x6f3 {value: 0x0000, lo: 0x03}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xbf}, // Block 0xee, offset 0x6f7 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbf}, // Block 0xef, offset 0x6fc {value: 0x0000, lo: 0x03}, {value: 0x3308, lo: 0x80, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xba}, {value: 0x3308, lo: 0xbb, hi: 0xbf}, // Block 0xf0, offset 0x700 {value: 0x0000, lo: 0x04}, {value: 0x3308, lo: 0x80, hi: 0xac}, {value: 0x0018, lo: 0xad, hi: 0xb4}, {value: 0x3308, lo: 0xb5, hi: 0xb5}, {value: 0x0018, lo: 0xb6, hi: 0xbf}, // Block 0xf1, offset 0x705 {value: 0x0000, lo: 0x08}, {value: 0x0018, lo: 0x80, hi: 0x83}, {value: 0x3308, lo: 0x84, hi: 0x84}, {value: 0x0018, lo: 0x85, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x9a}, {value: 0x3308, lo: 0x9b, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xa0}, {value: 0x3308, lo: 0xa1, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, // Block 0xf2, offset 0x70e {value: 0x0000, lo: 0x0a}, {value: 0x3308, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x87}, {value: 0x3308, lo: 0x88, hi: 0x98}, {value: 0x0040, lo: 0x99, hi: 0x9a}, {value: 0x3308, lo: 0x9b, hi: 0xa1}, {value: 0x0040, lo: 0xa2, hi: 0xa2}, {value: 0x3308, lo: 0xa3, hi: 0xa4}, {value: 0x0040, lo: 0xa5, hi: 0xa5}, {value: 0x3308, lo: 0xa6, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xbf}, // Block 0xf3, offset 0x719 {value: 0x0000, lo: 0x05}, {value: 0x0808, lo: 0x80, hi: 0x84}, {value: 0x0040, lo: 0x85, hi: 0x86}, {value: 0x0818, lo: 0x87, hi: 0x8f}, {value: 0x3308, lo: 0x90, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0xbf}, // Block 0xf4, offset 0x71f {value: 0x0000, lo: 0x07}, {value: 0x0a08, lo: 0x80, hi: 0x83}, {value: 0x3308, lo: 0x84, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8f}, {value: 0x0808, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9d}, {value: 0x0818, lo: 0x9e, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0xf5, offset 0x727 {value: 0x0000, lo: 0x02}, {value: 0x0040, lo: 0x80, hi: 0xb0}, {value: 0x0818, lo: 0xb1, hi: 0xbf}, // Block 0xf6, offset 0x72a {value: 0x0000, lo: 0x02}, {value: 0x0818, lo: 0x80, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0xf7, offset 0x72d {value: 0x0000, lo: 0x03}, {value: 0x0040, lo: 0x80, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb1}, {value: 0x0040, lo: 0xb2, hi: 0xbf}, // Block 0xf8, offset 0x731 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xbf}, // Block 0xf9, offset 0x735 {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xb0}, {value: 0x0018, lo: 0xb1, hi: 0xbf}, // Block 0xfa, offset 0x73b {value: 0x0000, lo: 0x05}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0x90}, {value: 0x0018, lo: 0x91, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xbf}, // Block 0xfb, offset 0x741 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x8f}, {value: 0xc1c1, lo: 0x90, hi: 0x90}, {value: 0x0018, lo: 0x91, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xbf}, // Block 0xfc, offset 0x746 {value: 0x0000, lo: 0x02}, {value: 0x0040, lo: 0x80, hi: 0xa5}, {value: 0x0018, lo: 0xa6, hi: 0xbf}, // Block 0xfd, offset 0x749 {value: 0x0000, lo: 0x0f}, {value: 0xc7e9, lo: 0x80, hi: 0x80}, {value: 0xc839, lo: 0x81, hi: 0x81}, {value: 0xc889, lo: 0x82, hi: 0x82}, {value: 0xc8d9, lo: 0x83, hi: 0x83}, {value: 0xc929, lo: 0x84, hi: 0x84}, {value: 0xc979, lo: 0x85, hi: 0x85}, {value: 0xc9c9, lo: 0x86, hi: 0x86}, {value: 0xca19, lo: 0x87, hi: 0x87}, {value: 0xca69, lo: 0x88, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x8f}, {value: 0xcab9, lo: 0x90, hi: 0x90}, {value: 0xcad9, lo: 0x91, hi: 0x91}, {value: 0x0040, lo: 0x92, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa5}, {value: 0x0040, lo: 0xa6, hi: 0xbf}, // Block 0xfe, offset 0x759 {value: 0x0000, lo: 0x06}, {value: 0x0018, lo: 0x80, hi: 0x94}, {value: 0x0040, lo: 0x95, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0xff, offset 0x760 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xbf}, // Block 0x100, offset 0x763 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0x98}, {value: 0x0040, lo: 0x99, hi: 0xbf}, // Block 0x101, offset 0x766 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xbf}, // Block 0x102, offset 0x76a {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xbf}, // Block 0x103, offset 0x770 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xbf}, // Block 0x104, offset 0x775 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0x105, offset 0x77a {value: 0x0000, lo: 0x07}, {value: 0x0018, lo: 0x80, hi: 0xb0}, {value: 0x0040, lo: 0xb1, hi: 0xb2}, {value: 0x0018, lo: 0xb3, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xb9}, {value: 0x0018, lo: 0xba, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbb}, {value: 0x0018, lo: 0xbc, hi: 0xbf}, // Block 0x106, offset 0x782 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0xa2}, {value: 0x0040, lo: 0xa3, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0x107, offset 0x787 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0x82}, {value: 0x0040, lo: 0x83, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xbf}, // Block 0x108, offset 0x78b {value: 0x0000, lo: 0x03}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xbf}, // Block 0x109, offset 0x78f {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0xbf}, // Block 0x10a, offset 0x792 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0x10b, offset 0x795 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x10c, offset 0x799 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xa1}, {value: 0x0040, lo: 0xa2, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x10d, offset 0x79d {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xa0}, {value: 0x0040, lo: 0xa1, hi: 0xbf}, // Block 0x10e, offset 0x7a0 {value: 0x0020, lo: 0x0f}, {value: 0xdeb9, lo: 0x80, hi: 0x89}, {value: 0x8dfd, lo: 0x8a, hi: 0x8a}, {value: 0xdff9, lo: 0x8b, hi: 0x9c}, {value: 0x8e1d, lo: 0x9d, hi: 0x9d}, {value: 0xe239, lo: 0x9e, hi: 0xa2}, {value: 0x8e3d, lo: 0xa3, hi: 0xa3}, {value: 0xe2d9, lo: 0xa4, hi: 0xab}, {value: 0x7ed5, lo: 0xac, hi: 0xac}, {value: 0xe3d9, lo: 0xad, hi: 0xaf}, {value: 0x8e5d, lo: 0xb0, hi: 0xb0}, {value: 0xe439, lo: 0xb1, hi: 0xb6}, {value: 0x8e7d, lo: 0xb7, hi: 0xb9}, {value: 0xe4f9, lo: 0xba, hi: 0xba}, {value: 0x8edd, lo: 0xbb, hi: 0xbb}, {value: 0xe519, lo: 0xbc, hi: 0xbf}, // Block 0x10f, offset 0x7b0 {value: 0x0020, lo: 0x10}, {value: 0x937d, lo: 0x80, hi: 0x80}, {value: 0xf099, lo: 0x81, hi: 0x86}, {value: 0x939d, lo: 0x87, hi: 0x8a}, {value: 0xd9f9, lo: 0x8b, hi: 0x8b}, {value: 0xf159, lo: 0x8c, hi: 0x96}, {value: 0x941d, lo: 0x97, hi: 0x97}, {value: 0xf2b9, lo: 0x98, hi: 0xa3}, {value: 0x943d, lo: 0xa4, hi: 0xa6}, {value: 0xf439, lo: 0xa7, hi: 0xaa}, {value: 0x949d, lo: 0xab, hi: 0xab}, {value: 0xf4b9, lo: 0xac, hi: 0xac}, {value: 0x94bd, lo: 0xad, hi: 0xad}, {value: 0xf4d9, lo: 0xae, hi: 0xaf}, {value: 0x94dd, lo: 0xb0, hi: 0xb1}, {value: 0xf519, lo: 0xb2, hi: 0xbe}, {value: 0x2040, lo: 0xbf, hi: 0xbf}, // Block 0x110, offset 0x7c1 {value: 0x0000, lo: 0x04}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0340, lo: 0x81, hi: 0x81}, {value: 0x0040, lo: 0x82, hi: 0x9f}, {value: 0x0340, lo: 0xa0, hi: 0xbf}, // Block 0x111, offset 0x7c6 {value: 0x0000, lo: 0x01}, {value: 0x0340, lo: 0x80, hi: 0xbf}, // Block 0x112, offset 0x7c8 {value: 0x0000, lo: 0x01}, {value: 0x33c0, lo: 0x80, hi: 0xbf}, // Block 0x113, offset 0x7ca {value: 0x0000, lo: 0x02}, {value: 0x33c0, lo: 0x80, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, } // Total table size 42466 bytes (41KiB); checksum: 355A58A4 ================================================ FILE: vendor/golang.org/x/net/idna/tables12.0.0.go ================================================ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. //go:build go1.14 && !go1.16 package idna // UnicodeVersion is the Unicode version from which the tables in this package are derived. const UnicodeVersion = "12.0.0" var mappings string = "" + // Size: 8178 bytes "\x00\x01 \x03 ̈\x01a\x03 ̄\x012\x013\x03 ́\x03 ̧\x011\x01o\x051⁄4\x051⁄2" + "\x053⁄4\x03i̇\x03l·\x03ʼn\x01s\x03dž\x03ⱥ\x03ⱦ\x01h\x01j\x01r\x01w\x01y" + "\x03 ̆\x03 ̇\x03 ̊\x03 ̨\x03 ̃\x03 ̋\x01l\x01x\x04̈́\x03 ι\x01;\x05 ̈́" + "\x04եւ\x04اٴ\x04وٴ\x04ۇٴ\x04يٴ\x06क़\x06ख़\x06ग़\x06ज़\x06ड़\x06ढ़\x06फ़" + "\x06य़\x06ড়\x06ঢ়\x06য়\x06ਲ਼\x06ਸ਼\x06ਖ਼\x06ਗ਼\x06ਜ਼\x06ਫ਼\x06ଡ଼\x06ଢ଼" + "\x06ํา\x06ໍາ\x06ຫນ\x06ຫມ\x06གྷ\x06ཌྷ\x06དྷ\x06བྷ\x06ཛྷ\x06ཀྵ\x06ཱི\x06ཱུ" + "\x06ྲྀ\x09ྲཱྀ\x06ླྀ\x09ླཱྀ\x06ཱྀ\x06ྒྷ\x06ྜྷ\x06ྡྷ\x06ྦྷ\x06ྫྷ\x06ྐྵ\x02" + "в\x02д\x02о\x02с\x02т\x02ъ\x02ѣ\x02æ\x01b\x01d\x01e\x02ǝ\x01g\x01i\x01k" + "\x01m\x01n\x02ȣ\x01p\x01t\x01u\x02ɐ\x02ɑ\x02ə\x02ɛ\x02ɜ\x02ŋ\x02ɔ\x02ɯ" + "\x01v\x02β\x02γ\x02δ\x02φ\x02χ\x02ρ\x02н\x02ɒ\x01c\x02ɕ\x02ð\x01f\x02ɟ" + "\x02ɡ\x02ɥ\x02ɨ\x02ɩ\x02ɪ\x02ʝ\x02ɭ\x02ʟ\x02ɱ\x02ɰ\x02ɲ\x02ɳ\x02ɴ\x02ɵ" + "\x02ɸ\x02ʂ\x02ʃ\x02ƫ\x02ʉ\x02ʊ\x02ʋ\x02ʌ\x01z\x02ʐ\x02ʑ\x02ʒ\x02θ\x02ss" + "\x02ά\x02έ\x02ή\x02ί\x02ό\x02ύ\x02ώ\x05ἀι\x05ἁι\x05ἂι\x05ἃι\x05ἄι\x05ἅι" + "\x05ἆι\x05ἇι\x05ἠι\x05ἡι\x05ἢι\x05ἣι\x05ἤι\x05ἥι\x05ἦι\x05ἧι\x05ὠι\x05ὡι" + "\x05ὢι\x05ὣι\x05ὤι\x05ὥι\x05ὦι\x05ὧι\x05ὰι\x04αι\x04άι\x05ᾶι\x02ι\x05 ̈͂" + "\x05ὴι\x04ηι\x04ήι\x05ῆι\x05 ̓̀\x05 ̓́\x05 ̓͂\x02ΐ\x05 ̔̀\x05 ̔́\x05 ̔͂" + "\x02ΰ\x05 ̈̀\x01`\x05ὼι\x04ωι\x04ώι\x05ῶι\x06′′\x09′′′\x06‵‵\x09‵‵‵\x02!" + "!\x02??\x02?!\x02!?\x0c′′′′\x010\x014\x015\x016\x017\x018\x019\x01+\x01=" + "\x01(\x01)\x02rs\x02ħ\x02no\x01q\x02sm\x02tm\x02ω\x02å\x02א\x02ב\x02ג" + "\x02ד\x02π\x051⁄7\x051⁄9\x061⁄10\x051⁄3\x052⁄3\x051⁄5\x052⁄5\x053⁄5\x054" + "⁄5\x051⁄6\x055⁄6\x051⁄8\x053⁄8\x055⁄8\x057⁄8\x041⁄\x02ii\x02iv\x02vi" + "\x04viii\x02ix\x02xi\x050⁄3\x06∫∫\x09∫∫∫\x06∮∮\x09∮∮∮\x0210\x0211\x0212" + "\x0213\x0214\x0215\x0216\x0217\x0218\x0219\x0220\x04(10)\x04(11)\x04(12)" + "\x04(13)\x04(14)\x04(15)\x04(16)\x04(17)\x04(18)\x04(19)\x04(20)\x0c∫∫∫∫" + "\x02==\x05⫝̸\x02ɫ\x02ɽ\x02ȿ\x02ɀ\x01.\x04 ゙\x04 ゚\x06より\x06コト\x05(ᄀ)\x05" + "(ᄂ)\x05(ᄃ)\x05(ᄅ)\x05(ᄆ)\x05(ᄇ)\x05(ᄉ)\x05(ᄋ)\x05(ᄌ)\x05(ᄎ)\x05(ᄏ)\x05(ᄐ" + ")\x05(ᄑ)\x05(ᄒ)\x05(가)\x05(나)\x05(다)\x05(라)\x05(마)\x05(바)\x05(사)\x05(아)" + "\x05(자)\x05(차)\x05(카)\x05(타)\x05(파)\x05(하)\x05(주)\x08(오전)\x08(오후)\x05(一)" + "\x05(二)\x05(三)\x05(四)\x05(五)\x05(六)\x05(七)\x05(八)\x05(九)\x05(十)\x05(月)" + "\x05(火)\x05(水)\x05(木)\x05(金)\x05(土)\x05(日)\x05(株)\x05(有)\x05(社)\x05(名)" + "\x05(特)\x05(財)\x05(祝)\x05(労)\x05(代)\x05(呼)\x05(学)\x05(監)\x05(企)\x05(資)" + "\x05(協)\x05(祭)\x05(休)\x05(自)\x05(至)\x0221\x0222\x0223\x0224\x0225\x0226" + "\x0227\x0228\x0229\x0230\x0231\x0232\x0233\x0234\x0235\x06참고\x06주의\x0236" + "\x0237\x0238\x0239\x0240\x0241\x0242\x0243\x0244\x0245\x0246\x0247\x0248" + "\x0249\x0250\x041月\x042月\x043月\x044月\x045月\x046月\x047月\x048月\x049月\x0510" + "月\x0511月\x0512月\x02hg\x02ev\x0cアパート\x0cアルファ\x0cアンペア\x09アール\x0cイニング\x09" + "インチ\x09ウォン\x0fエスクード\x0cエーカー\x09オンス\x09オーム\x09カイリ\x0cカラット\x0cカロリー\x09ガロ" + "ン\x09ガンマ\x06ギガ\x09ギニー\x0cキュリー\x0cギルダー\x06キロ\x0fキログラム\x12キロメートル\x0fキロワッ" + "ト\x09グラム\x0fグラムトン\x0fクルゼイロ\x0cクローネ\x09ケース\x09コルナ\x09コーポ\x0cサイクル\x0fサンチ" + "ーム\x0cシリング\x09センチ\x09セント\x09ダース\x06デシ\x06ドル\x06トン\x06ナノ\x09ノット\x09ハイツ" + "\x0fパーセント\x09パーツ\x0cバーレル\x0fピアストル\x09ピクル\x06ピコ\x06ビル\x0fファラッド\x0cフィート" + "\x0fブッシェル\x09フラン\x0fヘクタール\x06ペソ\x09ペニヒ\x09ヘルツ\x09ペンス\x09ページ\x09ベータ\x0cポイ" + "ント\x09ボルト\x06ホン\x09ポンド\x09ホール\x09ホーン\x0cマイクロ\x09マイル\x09マッハ\x09マルク\x0fマ" + "ンション\x0cミクロン\x06ミリ\x0fミリバール\x06メガ\x0cメガトン\x0cメートル\x09ヤード\x09ヤール\x09ユアン" + "\x0cリットル\x06リラ\x09ルピー\x0cルーブル\x06レム\x0fレントゲン\x09ワット\x040点\x041点\x042点" + "\x043点\x044点\x045点\x046点\x047点\x048点\x049点\x0510点\x0511点\x0512点\x0513点" + "\x0514点\x0515点\x0516点\x0517点\x0518点\x0519点\x0520点\x0521点\x0522点\x0523点" + "\x0524点\x02da\x02au\x02ov\x02pc\x02dm\x02iu\x06平成\x06昭和\x06大正\x06明治\x0c株" + "式会社\x02pa\x02na\x02ma\x02ka\x02kb\x02mb\x02gb\x04kcal\x02pf\x02nf\x02m" + "g\x02kg\x02hz\x02ml\x02dl\x02kl\x02fm\x02nm\x02mm\x02cm\x02km\x02m2\x02m" + "3\x05m∕s\x06m∕s2\x07rad∕s\x08rad∕s2\x02ps\x02ns\x02ms\x02pv\x02nv\x02mv" + "\x02kv\x02pw\x02nw\x02mw\x02kw\x02bq\x02cc\x02cd\x06c∕kg\x02db\x02gy\x02" + "ha\x02hp\x02in\x02kk\x02kt\x02lm\x02ln\x02lx\x02ph\x02pr\x02sr\x02sv\x02" + "wb\x05v∕m\x05a∕m\x041日\x042日\x043日\x044日\x045日\x046日\x047日\x048日\x049日" + "\x0510日\x0511日\x0512日\x0513日\x0514日\x0515日\x0516日\x0517日\x0518日\x0519日" + "\x0520日\x0521日\x0522日\x0523日\x0524日\x0525日\x0526日\x0527日\x0528日\x0529日" + "\x0530日\x0531日\x02ь\x02ɦ\x02ɬ\x02ʞ\x02ʇ\x02œ\x04𤋮\x04𢡊\x04𢡄\x04𣏕\x04𥉉" + "\x04𥳐\x04𧻓\x02ff\x02fi\x02fl\x02st\x04մն\x04մե\x04մի\x04վն\x04մխ\x04יִ" + "\x04ײַ\x02ע\x02ה\x02כ\x02ל\x02ם\x02ר\x02ת\x04שׁ\x04שׂ\x06שּׁ\x06שּׂ\x04א" + "ַ\x04אָ\x04אּ\x04בּ\x04גּ\x04דּ\x04הּ\x04וּ\x04זּ\x04טּ\x04יּ\x04ךּ\x04" + "כּ\x04לּ\x04מּ\x04נּ\x04סּ\x04ףּ\x04פּ\x04צּ\x04קּ\x04רּ\x04שּ\x04תּ" + "\x04וֹ\x04בֿ\x04כֿ\x04פֿ\x04אל\x02ٱ\x02ٻ\x02پ\x02ڀ\x02ٺ\x02ٿ\x02ٹ\x02ڤ" + "\x02ڦ\x02ڄ\x02ڃ\x02چ\x02ڇ\x02ڍ\x02ڌ\x02ڎ\x02ڈ\x02ژ\x02ڑ\x02ک\x02گ\x02ڳ" + "\x02ڱ\x02ں\x02ڻ\x02ۀ\x02ہ\x02ھ\x02ے\x02ۓ\x02ڭ\x02ۇ\x02ۆ\x02ۈ\x02ۋ\x02ۅ" + "\x02ۉ\x02ې\x02ى\x04ئا\x04ئە\x04ئو\x04ئۇ\x04ئۆ\x04ئۈ\x04ئې\x04ئى\x02ی\x04" + "ئج\x04ئح\x04ئم\x04ئي\x04بج\x04بح\x04بخ\x04بم\x04بى\x04بي\x04تج\x04تح" + "\x04تخ\x04تم\x04تى\x04تي\x04ثج\x04ثم\x04ثى\x04ثي\x04جح\x04جم\x04حج\x04حم" + "\x04خج\x04خح\x04خم\x04سج\x04سح\x04سخ\x04سم\x04صح\x04صم\x04ضج\x04ضح\x04ضخ" + "\x04ضم\x04طح\x04طم\x04ظم\x04عج\x04عم\x04غج\x04غم\x04فج\x04فح\x04فخ\x04فم" + "\x04فى\x04في\x04قح\x04قم\x04قى\x04قي\x04كا\x04كج\x04كح\x04كخ\x04كل\x04كم" + "\x04كى\x04كي\x04لج\x04لح\x04لخ\x04لم\x04لى\x04لي\x04مج\x04مح\x04مخ\x04مم" + "\x04مى\x04مي\x04نج\x04نح\x04نخ\x04نم\x04نى\x04ني\x04هج\x04هم\x04هى\x04هي" + "\x04يج\x04يح\x04يخ\x04يم\x04يى\x04يي\x04ذٰ\x04رٰ\x04ىٰ\x05 ٌّ\x05 ٍّ\x05" + " َّ\x05 ُّ\x05 ِّ\x05 ّٰ\x04ئر\x04ئز\x04ئن\x04بر\x04بز\x04بن\x04تر\x04تز" + "\x04تن\x04ثر\x04ثز\x04ثن\x04ما\x04نر\x04نز\x04نن\x04ير\x04يز\x04ين\x04ئخ" + "\x04ئه\x04به\x04ته\x04صخ\x04له\x04نه\x04هٰ\x04يه\x04ثه\x04سه\x04شم\x04شه" + "\x06ـَّ\x06ـُّ\x06ـِّ\x04طى\x04طي\x04عى\x04عي\x04غى\x04غي\x04سى\x04سي" + "\x04شى\x04شي\x04حى\x04حي\x04جى\x04جي\x04خى\x04خي\x04صى\x04صي\x04ضى\x04ضي" + "\x04شج\x04شح\x04شخ\x04شر\x04سر\x04صر\x04ضر\x04اً\x06تجم\x06تحج\x06تحم" + "\x06تخم\x06تمج\x06تمح\x06تمخ\x06جمح\x06حمي\x06حمى\x06سحج\x06سجح\x06سجى" + "\x06سمح\x06سمج\x06سمم\x06صحح\x06صمم\x06شحم\x06شجي\x06شمخ\x06شمم\x06ضحى" + "\x06ضخم\x06طمح\x06طمم\x06طمي\x06عجم\x06عمم\x06عمى\x06غمم\x06غمي\x06غمى" + "\x06فخم\x06قمح\x06قمم\x06لحم\x06لحي\x06لحى\x06لجج\x06لخم\x06لمح\x06محج" + "\x06محم\x06محي\x06مجح\x06مجم\x06مخج\x06مخم\x06مجخ\x06همج\x06همم\x06نحم" + "\x06نحى\x06نجم\x06نجى\x06نمي\x06نمى\x06يمم\x06بخي\x06تجي\x06تجى\x06تخي" + "\x06تخى\x06تمي\x06تمى\x06جمي\x06جحى\x06جمى\x06سخى\x06صحي\x06شحي\x06ضحي" + "\x06لجي\x06لمي\x06يحي\x06يجي\x06يمي\x06ممي\x06قمي\x06نحي\x06عمي\x06كمي" + "\x06نجح\x06مخي\x06لجم\x06كمم\x06جحي\x06حجي\x06مجي\x06فمي\x06بحي\x06سخي" + "\x06نجي\x06صلے\x06قلے\x08الله\x08اكبر\x08محمد\x08صلعم\x08رسول\x08عليه" + "\x08وسلم\x06صلى!صلى الله عليه وسلم\x0fجل جلاله\x08ریال\x01,\x01:\x01!" + "\x01?\x01_\x01{\x01}\x01[\x01]\x01#\x01&\x01*\x01-\x01<\x01>\x01\\\x01$" + "\x01%\x01@\x04ـً\x04ـَ\x04ـُ\x04ـِ\x04ـّ\x04ـْ\x02ء\x02آ\x02أ\x02ؤ\x02إ" + "\x02ئ\x02ا\x02ب\x02ة\x02ت\x02ث\x02ج\x02ح\x02خ\x02د\x02ذ\x02ر\x02ز\x02س" + "\x02ش\x02ص\x02ض\x02ط\x02ظ\x02ع\x02غ\x02ف\x02ق\x02ك\x02ل\x02م\x02ن\x02ه" + "\x02و\x02ي\x04لآ\x04لأ\x04لإ\x04لا\x01\x22\x01'\x01/\x01^\x01|\x01~\x02¢" + "\x02£\x02¬\x02¦\x02¥\x08𝅗𝅥\x08𝅘𝅥\x0c𝅘𝅥𝅮\x0c𝅘𝅥𝅯\x0c𝅘𝅥𝅰\x0c𝅘𝅥𝅱\x0c𝅘𝅥𝅲\x08𝆹" + "𝅥\x08𝆺𝅥\x0c𝆹𝅥𝅮\x0c𝆺𝅥𝅮\x0c𝆹𝅥𝅯\x0c𝆺𝅥𝅯\x02ı\x02ȷ\x02α\x02ε\x02ζ\x02η\x02" + "κ\x02λ\x02μ\x02ν\x02ξ\x02ο\x02σ\x02τ\x02υ\x02ψ\x03∇\x03∂\x02ϝ\x02ٮ\x02ڡ" + "\x02ٯ\x020,\x021,\x022,\x023,\x024,\x025,\x026,\x027,\x028,\x029,\x03(a)" + "\x03(b)\x03(c)\x03(d)\x03(e)\x03(f)\x03(g)\x03(h)\x03(i)\x03(j)\x03(k)" + "\x03(l)\x03(m)\x03(n)\x03(o)\x03(p)\x03(q)\x03(r)\x03(s)\x03(t)\x03(u)" + "\x03(v)\x03(w)\x03(x)\x03(y)\x03(z)\x07〔s〕\x02wz\x02hv\x02sd\x03ppv\x02w" + "c\x02mc\x02md\x02mr\x02dj\x06ほか\x06ココ\x03サ\x03手\x03字\x03双\x03デ\x03二\x03多" + "\x03解\x03天\x03交\x03映\x03無\x03料\x03前\x03後\x03再\x03新\x03初\x03終\x03生\x03販" + "\x03声\x03吹\x03演\x03投\x03捕\x03一\x03三\x03遊\x03左\x03中\x03右\x03指\x03走\x03打" + "\x03禁\x03空\x03合\x03満\x03有\x03月\x03申\x03割\x03営\x03配\x09〔本〕\x09〔三〕\x09〔二〕" + "\x09〔安〕\x09〔点〕\x09〔打〕\x09〔盗〕\x09〔勝〕\x09〔敗〕\x03得\x03可\x03丽\x03丸\x03乁\x03你" + "\x03侮\x03侻\x03倂\x03偺\x03備\x03僧\x03像\x03㒞\x03免\x03兔\x03兤\x03具\x03㒹\x03內" + "\x03冗\x03冤\x03仌\x03冬\x03况\x03凵\x03刃\x03㓟\x03刻\x03剆\x03剷\x03㔕\x03勇\x03勉" + "\x03勤\x03勺\x03包\x03匆\x03北\x03卉\x03卑\x03博\x03即\x03卽\x03卿\x03灰\x03及\x03叟" + "\x03叫\x03叱\x03吆\x03咞\x03吸\x03呈\x03周\x03咢\x03哶\x03唐\x03啓\x03啣\x03善\x03喙" + "\x03喫\x03喳\x03嗂\x03圖\x03嘆\x03圗\x03噑\x03噴\x03切\x03壮\x03城\x03埴\x03堍\x03型" + "\x03堲\x03報\x03墬\x03売\x03壷\x03夆\x03夢\x03奢\x03姬\x03娛\x03娧\x03姘\x03婦\x03㛮" + "\x03嬈\x03嬾\x03寃\x03寘\x03寧\x03寳\x03寿\x03将\x03尢\x03㞁\x03屠\x03屮\x03峀\x03岍" + "\x03嵃\x03嵮\x03嵫\x03嵼\x03巡\x03巢\x03㠯\x03巽\x03帨\x03帽\x03幩\x03㡢\x03㡼\x03庰" + "\x03庳\x03庶\x03廊\x03廾\x03舁\x03弢\x03㣇\x03形\x03彫\x03㣣\x03徚\x03忍\x03志\x03忹" + "\x03悁\x03㤺\x03㤜\x03悔\x03惇\x03慈\x03慌\x03慎\x03慺\x03憎\x03憲\x03憤\x03憯\x03懞" + "\x03懲\x03懶\x03成\x03戛\x03扝\x03抱\x03拔\x03捐\x03挽\x03拼\x03捨\x03掃\x03揤\x03搢" + "\x03揅\x03掩\x03㨮\x03摩\x03摾\x03撝\x03摷\x03㩬\x03敏\x03敬\x03旣\x03書\x03晉\x03㬙" + "\x03暑\x03㬈\x03㫤\x03冒\x03冕\x03最\x03暜\x03肭\x03䏙\x03朗\x03望\x03朡\x03杞\x03杓" + "\x03㭉\x03柺\x03枅\x03桒\x03梅\x03梎\x03栟\x03椔\x03㮝\x03楂\x03榣\x03槪\x03檨\x03櫛" + "\x03㰘\x03次\x03歔\x03㱎\x03歲\x03殟\x03殺\x03殻\x03汎\x03沿\x03泍\x03汧\x03洖\x03派" + "\x03海\x03流\x03浩\x03浸\x03涅\x03洴\x03港\x03湮\x03㴳\x03滋\x03滇\x03淹\x03潮\x03濆" + "\x03瀹\x03瀞\x03瀛\x03㶖\x03灊\x03災\x03灷\x03炭\x03煅\x03熜\x03爨\x03爵\x03牐\x03犀" + "\x03犕\x03獺\x03王\x03㺬\x03玥\x03㺸\x03瑇\x03瑜\x03瑱\x03璅\x03瓊\x03㼛\x03甤\x03甾" + "\x03異\x03瘐\x03㿼\x03䀈\x03直\x03眞\x03真\x03睊\x03䀹\x03瞋\x03䁆\x03䂖\x03硎\x03碌" + "\x03磌\x03䃣\x03祖\x03福\x03秫\x03䄯\x03穀\x03穊\x03穏\x03䈂\x03篆\x03築\x03䈧\x03糒" + "\x03䊠\x03糨\x03糣\x03紀\x03絣\x03䌁\x03緇\x03縂\x03繅\x03䌴\x03䍙\x03罺\x03羕\x03翺" + "\x03者\x03聠\x03聰\x03䏕\x03育\x03脃\x03䐋\x03脾\x03媵\x03舄\x03辞\x03䑫\x03芑\x03芋" + "\x03芝\x03劳\x03花\x03芳\x03芽\x03苦\x03若\x03茝\x03荣\x03莭\x03茣\x03莽\x03菧\x03著" + "\x03荓\x03菊\x03菌\x03菜\x03䔫\x03蓱\x03蓳\x03蔖\x03蕤\x03䕝\x03䕡\x03䕫\x03虐\x03虜" + "\x03虧\x03虩\x03蚩\x03蚈\x03蜎\x03蛢\x03蝹\x03蜨\x03蝫\x03螆\x03蟡\x03蠁\x03䗹\x03衠" + "\x03衣\x03裗\x03裞\x03䘵\x03裺\x03㒻\x03䚾\x03䛇\x03誠\x03諭\x03變\x03豕\x03貫\x03賁" + "\x03贛\x03起\x03跋\x03趼\x03跰\x03軔\x03輸\x03邔\x03郱\x03鄑\x03鄛\x03鈸\x03鋗\x03鋘" + "\x03鉼\x03鏹\x03鐕\x03開\x03䦕\x03閷\x03䧦\x03雃\x03嶲\x03霣\x03䩮\x03䩶\x03韠\x03䪲" + "\x03頋\x03頩\x03飢\x03䬳\x03餩\x03馧\x03駂\x03駾\x03䯎\x03鬒\x03鱀\x03鳽\x03䳎\x03䳭" + "\x03鵧\x03䳸\x03麻\x03䵖\x03黹\x03黾\x03鼅\x03鼏\x03鼖\x03鼻" var xorData string = "" + // Size: 4862 bytes "\x02\x0c\x09\x02\xb0\xec\x02\xad\xd8\x02\xad\xd9\x02\x06\x07\x02\x0f\x12" + "\x02\x0f\x1f\x02\x0f\x1d\x02\x01\x13\x02\x0f\x16\x02\x0f\x0b\x02\x0f3" + "\x02\x0f7\x02\x0f?\x02\x0f/\x02\x0f*\x02\x0c&\x02\x0c*\x02\x0c;\x02\x0c9" + "\x02\x0c%\x02\xab\xed\x02\xab\xe2\x02\xab\xe3\x02\xa9\xe0\x02\xa9\xe1" + "\x02\xa9\xe6\x02\xa3\xcb\x02\xa3\xc8\x02\xa3\xc9\x02\x01#\x02\x01\x08" + "\x02\x0e>\x02\x0e'\x02\x0f\x03\x02\x03\x0d\x02\x03\x09\x02\x03\x17\x02" + "\x03\x0e\x02\x02\x03\x02\x011\x02\x01\x00\x02\x01\x10\x02\x03<\x02\x07" + "\x0d\x02\x02\x0c\x02\x0c0\x02\x01\x03\x02\x01\x01\x02\x01 \x02\x01\x22" + "\x02\x01)\x02\x01\x0a\x02\x01\x0c\x02\x02\x06\x02\x02\x02\x02\x03\x10" + "\x03\x037 \x03\x0b+\x03\x021\x00\x02\x01\x04\x02\x01\x02\x02\x019\x02" + "\x03\x1c\x02\x02$\x03\x80p$\x02\x03:\x02\x03\x0a\x03\xc1r.\x03\xc1r,\x03" + "\xc1r\x02\x02\x02:\x02\x02>\x02\x02,\x02\x02\x10\x02\x02\x00\x03\xc1s<" + "\x03\xc1s*\x03\xc2L$\x03\xc2L;\x02\x09)\x02\x0a\x19\x03\x83\xab\xe3\x03" + "\x83\xab\xf2\x03 4\xe0\x03\x81\xab\xea\x03\x81\xab\xf3\x03 4\xef\x03\x96" + "\xe1\xcd\x03\x84\xe5\xc3\x02\x0d\x11\x03\x8b\xec\xcb\x03\x94\xec\xcf\x03" + "\x9a\xec\xc2\x03\x8b\xec\xdb\x03\x94\xec\xdf\x03\x9a\xec\xd2\x03\x01\x0c" + "!\x03\x01\x0c#\x03ʠ\x9d\x03ʣ\x9c\x03ʢ\x9f\x03ʥ\x9e\x03ʤ\x91\x03ʧ\x90\x03" + "ʦ\x93\x03ʩ\x92\x03ʨ\x95\x03\xca\xf3\xb5\x03\xca\xf0\xb4\x03\xca\xf1\xb7" + "\x03\xca\xf6\xb6\x03\xca\xf7\x89\x03\xca\xf4\x88\x03\xca\xf5\x8b\x03\xca" + "\xfa\x8a\x03\xca\xfb\x8d\x03\xca\xf8\x8c\x03\xca\xf9\x8f\x03\xca\xfe\x8e" + "\x03\xca\xff\x81\x03\xca\xfc\x80\x03\xca\xfd\x83\x03\xca\xe2\x82\x03\xca" + "\xe3\x85\x03\xca\xe0\x84\x03\xca\xe1\x87\x03\xca\xe6\x86\x03\xca\xe7\x99" + "\x03\xca\xe4\x98\x03\xca\xe5\x9b\x03\xca\xea\x9a\x03\xca\xeb\x9d\x03\xca" + "\xe8\x9c\x03ؓ\x89\x03ߔ\x8b\x02\x010\x03\x03\x04\x1e\x03\x04\x15\x12\x03" + "\x0b\x05,\x03\x06\x04\x00\x03\x06\x04)\x03\x06\x044\x03\x06\x04<\x03\x06" + "\x05\x1d\x03\x06\x06\x00\x03\x06\x06\x0a\x03\x06\x06'\x03\x06\x062\x03" + "\x0786\x03\x079/\x03\x079 \x03\x07:\x0e\x03\x07:\x1b\x03\x07:%\x03\x07;/" + "\x03\x07;%\x03\x074\x11\x03\x076\x09\x03\x077*\x03\x070\x01\x03\x070\x0f" + "\x03\x070.\x03\x071\x16\x03\x071\x04\x03\x0710\x03\x072\x18\x03\x072-" + "\x03\x073\x14\x03\x073>\x03\x07'\x09\x03\x07 \x00\x03\x07\x1f\x0b\x03" + "\x07\x18#\x03\x07\x18(\x03\x07\x186\x03\x07\x18\x03\x03\x07\x19\x16\x03" + "\x07\x116\x03\x07\x12'\x03\x07\x13\x10\x03\x07\x0c&\x03\x07\x0c\x08\x03" + "\x07\x0c\x13\x03\x07\x0d\x02\x03\x07\x0d\x1c\x03\x07\x0b5\x03\x07\x0b" + "\x0a\x03\x07\x0b\x01\x03\x07\x0b\x0f\x03\x07\x05\x00\x03\x07\x05\x09\x03" + "\x07\x05\x0b\x03\x07\x07\x01\x03\x07\x07\x08\x03\x07\x00<\x03\x07\x00+" + "\x03\x07\x01)\x03\x07\x01\x1b\x03\x07\x01\x08\x03\x07\x03?\x03\x0445\x03" + "\x044\x08\x03\x0454\x03\x04)/\x03\x04)5\x03\x04+\x05\x03\x04+\x14\x03" + "\x04+ \x03\x04+<\x03\x04*&\x03\x04*\x22\x03\x04&8\x03\x04!\x01\x03\x04!" + "\x22\x03\x04\x11+\x03\x04\x10.\x03\x04\x104\x03\x04\x13=\x03\x04\x12\x04" + "\x03\x04\x12\x0a\x03\x04\x0d\x1d\x03\x04\x0d\x07\x03\x04\x0d \x03\x05<>" + "\x03\x055<\x03\x055!\x03\x055#\x03\x055&\x03\x054\x1d\x03\x054\x02\x03" + "\x054\x07\x03\x0571\x03\x053\x1a\x03\x053\x16\x03\x05.<\x03\x05.\x07\x03" + "\x05):\x03\x05)<\x03\x05)\x0c\x03\x05)\x15\x03\x05+-\x03\x05+5\x03\x05$" + "\x1e\x03\x05$\x14\x03\x05'\x04\x03\x05'\x14\x03\x05&\x02\x03\x05\x226" + "\x03\x05\x22\x0c\x03\x05\x22\x1c\x03\x05\x19\x0a\x03\x05\x1b\x09\x03\x05" + "\x1b\x0c\x03\x05\x14\x07\x03\x05\x16?\x03\x05\x16\x0c\x03\x05\x0c\x05" + "\x03\x05\x0e\x0f\x03\x05\x01\x0e\x03\x05\x00(\x03\x05\x030\x03\x05\x03" + "\x06\x03\x0a==\x03\x0a=1\x03\x0a=,\x03\x0a=\x0c\x03\x0a??\x03\x0a<\x08" + "\x03\x0a9!\x03\x0a9)\x03\x0a97\x03\x0a99\x03\x0a6\x0a\x03\x0a6\x1c\x03" + "\x0a6\x17\x03\x0a7'\x03\x0a78\x03\x0a73\x03\x0a'\x01\x03\x0a'&\x03\x0a" + "\x1f\x0e\x03\x0a\x1f\x03\x03\x0a\x1f3\x03\x0a\x1b/\x03\x0a\x18\x19\x03" + "\x0a\x19\x01\x03\x0a\x16\x14\x03\x0a\x0e\x22\x03\x0a\x0f\x10\x03\x0a\x0f" + "\x02\x03\x0a\x0f \x03\x0a\x0c\x04\x03\x0a\x0b>\x03\x0a\x0b+\x03\x0a\x08/" + "\x03\x0a\x046\x03\x0a\x05\x14\x03\x0a\x00\x04\x03\x0a\x00\x10\x03\x0a" + "\x00\x14\x03\x0b<3\x03\x0b;*\x03\x0b9\x22\x03\x0b9)\x03\x0b97\x03\x0b+" + "\x10\x03\x0b((\x03\x0b&5\x03\x0b$\x1c\x03\x0b$\x12\x03\x0b%\x04\x03\x0b#" + "<\x03\x0b#0\x03\x0b#\x0d\x03\x0b#\x19\x03\x0b!:\x03\x0b!\x1f\x03\x0b!" + "\x00\x03\x0b\x1e5\x03\x0b\x1c\x1d\x03\x0b\x1d-\x03\x0b\x1d(\x03\x0b\x18." + "\x03\x0b\x18 \x03\x0b\x18\x16\x03\x0b\x14\x13\x03\x0b\x15$\x03\x0b\x15" + "\x22\x03\x0b\x12\x1b\x03\x0b\x12\x10\x03\x0b\x132\x03\x0b\x13=\x03\x0b" + "\x12\x18\x03\x0b\x0c&\x03\x0b\x061\x03\x0b\x06:\x03\x0b\x05#\x03\x0b\x05" + "<\x03\x0b\x04\x0b\x03\x0b\x04\x04\x03\x0b\x04\x1b\x03\x0b\x042\x03\x0b" + "\x041\x03\x0b\x03\x03\x03\x0b\x03\x1d\x03\x0b\x03/\x03\x0b\x03+\x03\x0b" + "\x02\x1b\x03\x0b\x02\x00\x03\x0b\x01\x1e\x03\x0b\x01\x08\x03\x0b\x015" + "\x03\x06\x0d9\x03\x06\x0d=\x03\x06\x0d?\x03\x02\x001\x03\x02\x003\x03" + "\x02\x02\x19\x03\x02\x006\x03\x02\x02\x1b\x03\x02\x004\x03\x02\x00<\x03" + "\x02\x02\x0a\x03\x02\x02\x0e\x03\x02\x01\x1a\x03\x02\x01\x07\x03\x02\x01" + "\x05\x03\x02\x01\x0b\x03\x02\x01%\x03\x02\x01\x0c\x03\x02\x01\x04\x03" + "\x02\x01\x1c\x03\x02\x00.\x03\x02\x002\x03\x02\x00>\x03\x02\x00\x12\x03" + "\x02\x00\x16\x03\x02\x011\x03\x02\x013\x03\x02\x02 \x03\x02\x02%\x03\x02" + "\x02$\x03\x02\x028\x03\x02\x02;\x03\x02\x024\x03\x02\x012\x03\x02\x022" + "\x03\x02\x02/\x03\x02\x01,\x03\x02\x01\x13\x03\x02\x01\x16\x03\x02\x01" + "\x11\x03\x02\x01\x1e\x03\x02\x01\x15\x03\x02\x01\x17\x03\x02\x01\x0f\x03" + "\x02\x01\x08\x03\x02\x00?\x03\x02\x03\x07\x03\x02\x03\x0d\x03\x02\x03" + "\x13\x03\x02\x03\x1d\x03\x02\x03\x1f\x03\x02\x00\x03\x03\x02\x00\x0d\x03" + "\x02\x00\x01\x03\x02\x00\x1b\x03\x02\x00\x19\x03\x02\x00\x18\x03\x02\x00" + "\x13\x03\x02\x00/\x03\x07>\x12\x03\x07<\x1f\x03\x07>\x1d\x03\x06\x1d\x0e" + "\x03\x07>\x1c\x03\x07>:\x03\x07>\x13\x03\x04\x12+\x03\x07?\x03\x03\x07>" + "\x02\x03\x06\x224\x03\x06\x1a.\x03\x07<%\x03\x06\x1c\x0b\x03\x0609\x03" + "\x05\x1f\x01\x03\x04'\x08\x03\x93\xfd\xf5\x03\x02\x0d \x03\x02\x0d#\x03" + "\x02\x0d!\x03\x02\x0d&\x03\x02\x0d\x22\x03\x02\x0d/\x03\x02\x0d,\x03\x02" + "\x0d$\x03\x02\x0d'\x03\x02\x0d%\x03\x02\x0d;\x03\x02\x0d=\x03\x02\x0d?" + "\x03\x099.\x03\x08\x0b7\x03\x08\x02\x14\x03\x08\x14\x0d\x03\x08.:\x03" + "\x089'\x03\x0f\x0b\x18\x03\x0f\x1c1\x03\x0f\x17&\x03\x0f9\x1f\x03\x0f0" + "\x0c\x03\x0e\x0a9\x03\x0e\x056\x03\x0e\x1c#\x03\x0f\x13\x0e\x03\x072\x00" + "\x03\x070\x0d\x03\x072\x0b\x03\x06\x11\x18\x03\x070\x10\x03\x06\x0f(\x03" + "\x072\x05\x03\x06\x0f,\x03\x073\x15\x03\x06\x07\x08\x03\x05\x16\x02\x03" + "\x04\x0b \x03\x05:8\x03\x05\x16%\x03\x0a\x0d\x1f\x03\x06\x16\x10\x03\x05" + "\x1d5\x03\x05*;\x03\x05\x16\x1b\x03\x04.-\x03\x06\x1a\x19\x03\x04\x03," + "\x03\x0b87\x03\x04/\x0a\x03\x06\x00,\x03\x04-\x01\x03\x04\x1e-\x03\x06/(" + "\x03\x0a\x0b5\x03\x06\x0e7\x03\x06\x07.\x03\x0597\x03\x0a*%\x03\x0760" + "\x03\x06\x0c;\x03\x05'\x00\x03\x072.\x03\x072\x08\x03\x06=\x01\x03\x06" + "\x05\x1b\x03\x06\x06\x12\x03\x06$=\x03\x06'\x0d\x03\x04\x11\x0f\x03\x076" + ",\x03\x06\x07;\x03\x06.,\x03\x86\xf9\xea\x03\x8f\xff\xeb\x02\x092\x02" + "\x095\x02\x094\x02\x09;\x02\x09>\x02\x098\x02\x09*\x02\x09/\x02\x09,\x02" + "\x09%\x02\x09&\x02\x09#\x02\x09 \x02\x08!\x02\x08%\x02\x08$\x02\x08+\x02" + "\x08.\x02\x08*\x02\x08&\x02\x088\x02\x08>\x02\x084\x02\x086\x02\x080\x02" + "\x08\x10\x02\x08\x17\x02\x08\x12\x02\x08\x1d\x02\x08\x1f\x02\x08\x13\x02" + "\x08\x15\x02\x08\x14\x02\x08\x0c\x03\x8b\xfd\xd0\x03\x81\xec\xc6\x03\x87" + "\xe0\x8a\x03-2\xe3\x03\x80\xef\xe4\x03-2\xea\x03\x88\xe6\xeb\x03\x8e\xe6" + "\xe8\x03\x84\xe6\xe9\x03\x97\xe6\xee\x03-2\xf9\x03-2\xf6\x03\x8e\xe3\xad" + "\x03\x80\xe3\x92\x03\x88\xe3\x90\x03\x8e\xe3\x90\x03\x80\xe3\x97\x03\x88" + "\xe3\x95\x03\x88\xfe\xcb\x03\x8e\xfe\xca\x03\x84\xfe\xcd\x03\x91\xef\xc9" + "\x03-2\xc1\x03-2\xc0\x03-2\xcb\x03\x88@\x09\x03\x8e@\x08\x03\x8f\xe0\xf5" + "\x03\x8e\xe6\xf9\x03\x8e\xe0\xfa\x03\x93\xff\xf4\x03\x84\xee\xd3\x03\x0b" + "(\x04\x023 \x03\x0b)\x08\x021;\x02\x01*\x03\x0b#\x10\x03\x0b 0\x03\x0b!" + "\x10\x03\x0b!0\x03\x07\x15\x08\x03\x09?5\x03\x07\x1f\x08\x03\x07\x17\x0b" + "\x03\x09\x1f\x15\x03\x0b\x1c7\x03\x0a+#\x03\x06\x1a\x1b\x03\x06\x1a\x14" + "\x03\x0a\x01\x18\x03\x06#\x1b\x03\x0a2\x0c\x03\x0a\x01\x04\x03\x09#;\x03" + "\x08='\x03\x08\x1a\x0a\x03\x07\x03\x0a\x111\x03\x09\x1b\x09\x03\x073.\x03\x07" + "\x01\x00\x03\x09/,\x03\x07#>\x03\x07\x048\x03\x0a\x1f\x22\x03\x098>\x03" + "\x09\x11\x00\x03\x08/\x17\x03\x06'\x22\x03\x0b\x1a+\x03\x0a\x22\x19\x03" + "\x0a/1\x03\x0974\x03\x09\x0f\x22\x03\x08,\x22\x03\x08?\x14\x03\x07$5\x03" + "\x07<3\x03\x07=*\x03\x07\x13\x18\x03\x068\x0a\x03\x06\x09\x16\x03\x06" + "\x13\x00\x03\x08\x067\x03\x08\x01\x03\x03\x08\x12\x1d\x03\x07+7\x03\x06(" + ";\x03\x06\x1c?\x03\x07\x0e\x17\x03\x0a\x06\x1d\x03\x0a\x19\x07\x03\x08" + "\x14$\x03\x07$;\x03\x08,$\x03\x08\x06\x0d\x03\x07\x16\x0a\x03\x06>>\x03" + "\x0a\x06\x12\x03\x0a\x14)\x03\x09\x0d\x1f\x03\x09\x12\x17\x03\x09\x19" + "\x01\x03\x08\x11 \x03\x08\x1d'\x03\x06<\x1a\x03\x0a.\x00\x03\x07'\x18" + "\x03\x0a\x22\x08\x03\x08\x0d\x0a\x03\x08\x13)\x03\x07*)\x03\x06<,\x03" + "\x07\x0b\x1a\x03\x09.\x14\x03\x09\x0d\x1e\x03\x07\x0e#\x03\x0b\x1d'\x03" + "\x0a\x0a8\x03\x09%2\x03\x08+&\x03\x080\x12\x03\x0a)4\x03\x08\x06\x1f\x03" + "\x0b\x1b\x1a\x03\x0a\x1b\x0f\x03\x0b\x1d*\x03\x09\x16$\x03\x090\x11\x03" + "\x08\x11\x08\x03\x0a*(\x03\x0a\x042\x03\x089,\x03\x074'\x03\x07\x0f\x05" + "\x03\x09\x0b\x0a\x03\x07\x1b\x01\x03\x09\x17:\x03\x09.\x0d\x03\x07.\x11" + "\x03\x09+\x15\x03\x080\x13\x03\x0b\x1f\x19\x03\x0a \x11\x03\x0a\x220\x03" + "\x09\x07;\x03\x08\x16\x1c\x03\x07,\x13\x03\x07\x0e/\x03\x06\x221\x03\x0a" + ".\x0a\x03\x0a7\x02\x03\x0a\x032\x03\x0a\x1d.\x03\x091\x06\x03\x09\x19:" + "\x03\x08\x02/\x03\x060+\x03\x06\x0f-\x03\x06\x1c\x1f\x03\x06\x1d\x07\x03" + "\x0a,\x11\x03\x09=\x0d\x03\x09\x0b;\x03\x07\x1b/\x03\x0a\x1f:\x03\x09 " + "\x1f\x03\x09.\x10\x03\x094\x0b\x03\x09\x1a1\x03\x08#\x1a\x03\x084\x1d" + "\x03\x08\x01\x1f\x03\x08\x11\x22\x03\x07'8\x03\x07\x1a>\x03\x0757\x03" + "\x06&9\x03\x06+\x11\x03\x0a.\x0b\x03\x0a,>\x03\x0a4#\x03\x08%\x17\x03" + "\x07\x05\x22\x03\x07\x0c\x0b\x03\x0a\x1d+\x03\x0a\x19\x16\x03\x09+\x1f" + "\x03\x09\x08\x0b\x03\x08\x16\x18\x03\x08+\x12\x03\x0b\x1d\x0c\x03\x0a=" + "\x10\x03\x0a\x09\x0d\x03\x0a\x10\x11\x03\x09&0\x03\x08(\x1f\x03\x087\x07" + "\x03\x08\x185\x03\x07'6\x03\x06.\x05\x03\x06=\x04\x03\x06;;\x03\x06\x06," + "\x03\x0b\x18>\x03\x08\x00\x18\x03\x06 \x03\x03\x06<\x00\x03\x09%\x18\x03" + "\x0b\x1c<\x03\x0a%!\x03\x0a\x09\x12\x03\x0a\x16\x02\x03\x090'\x03\x09" + "\x0e=\x03\x08 \x0e\x03\x08>\x03\x03\x074>\x03\x06&?\x03\x06\x19\x09\x03" + "\x06?(\x03\x0a-\x0e\x03\x09:3\x03\x098:\x03\x09\x12\x0b\x03\x09\x1d\x17" + "\x03\x087\x05\x03\x082\x14\x03\x08\x06%\x03\x08\x13\x1f\x03\x06\x06\x0e" + "\x03\x0a\x22<\x03\x09/<\x03\x06>+\x03\x0a'?\x03\x0a\x13\x0c\x03\x09\x10<" + "\x03\x07\x1b=\x03\x0a\x19\x13\x03\x09\x22\x1d\x03\x09\x07\x0d\x03\x08)" + "\x1c\x03\x06=\x1a\x03\x0a/4\x03\x0a7\x11\x03\x0a\x16:\x03\x09?3\x03\x09:" + "/\x03\x09\x05\x0a\x03\x09\x14\x06\x03\x087\x22\x03\x080\x07\x03\x08\x1a" + "\x1f\x03\x07\x04(\x03\x07\x04\x09\x03\x06 %\x03\x06<\x08\x03\x0a+\x14" + "\x03\x09\x1d\x16\x03\x0a70\x03\x08 >\x03\x0857\x03\x070\x0a\x03\x06=\x12" + "\x03\x06\x16%\x03\x06\x1d,\x03\x099#\x03\x09\x10>\x03\x07 \x1e\x03\x08" + "\x0c<\x03\x08\x0b\x18\x03\x08\x15+\x03\x08,:\x03\x08%\x22\x03\x07\x0a$" + "\x03\x0b\x1c=\x03\x07+\x08\x03\x0a/\x05\x03\x0a \x07\x03\x0a\x12'\x03" + "\x09#\x11\x03\x08\x1b\x15\x03\x0a\x06\x01\x03\x09\x1c\x1b\x03\x0922\x03" + "\x07\x14<\x03\x07\x09\x04\x03\x061\x04\x03\x07\x0e\x01\x03\x0a\x13\x18" + "\x03\x0a-\x0c\x03\x0a?\x0d\x03\x0a\x09\x0a\x03\x091&\x03\x0a/\x0b\x03" + "\x08$<\x03\x083\x1d\x03\x08\x0c$\x03\x08\x0d\x07\x03\x08\x0d?\x03\x08" + "\x0e\x14\x03\x065\x0a\x03\x08\x1a#\x03\x08\x16#\x03\x0702\x03\x07\x03" + "\x1a\x03\x06(\x1d\x03\x06+\x1b\x03\x06\x0b\x05\x03\x06\x0b\x17\x03\x06" + "\x0c\x04\x03\x06\x1e\x19\x03\x06+0\x03\x062\x18\x03\x0b\x16\x1e\x03\x0a+" + "\x16\x03\x0a-?\x03\x0a#:\x03\x0a#\x10\x03\x0a%$\x03\x0a>+\x03\x0a01\x03" + "\x0a1\x10\x03\x0a\x099\x03\x0a\x0a\x12\x03\x0a\x19\x1f\x03\x0a\x19\x12" + "\x03\x09*)\x03\x09-\x16\x03\x09.1\x03\x09.2\x03\x09<\x0e\x03\x09> \x03" + "\x093\x12\x03\x09\x0b\x01\x03\x09\x1c2\x03\x09\x11\x1c\x03\x09\x15%\x03" + "\x08,&\x03\x08!\x22\x03\x089(\x03\x08\x0b\x1a\x03\x08\x0d2\x03\x08\x0c" + "\x04\x03\x08\x0c\x06\x03\x08\x0c\x1f\x03\x08\x0c\x0c\x03\x08\x0f\x1f\x03" + "\x08\x0f\x1d\x03\x08\x00\x14\x03\x08\x03\x14\x03\x08\x06\x16\x03\x08\x1e" + "#\x03\x08\x11\x11\x03\x08\x10\x18\x03\x08\x14(\x03\x07)\x1e\x03\x07.1" + "\x03\x07 $\x03\x07 '\x03\x078\x08\x03\x07\x0d0\x03\x07\x0f7\x03\x07\x05#" + "\x03\x07\x05\x1a\x03\x07\x1a7\x03\x07\x1d-\x03\x07\x17\x10\x03\x06)\x1f" + "\x03\x062\x0b\x03\x066\x16\x03\x06\x09\x11\x03\x09(\x1e\x03\x07!5\x03" + "\x0b\x11\x16\x03\x0a/\x04\x03\x0a,\x1a\x03\x0b\x173\x03\x0a,1\x03\x0a/5" + "\x03\x0a\x221\x03\x0a\x22\x0d\x03\x0a?%\x03\x0a<,\x03\x0a?#\x03\x0a>\x19" + "\x03\x0a\x08&\x03\x0a\x0b\x0e\x03\x0a\x0c:\x03\x0a\x0c+\x03\x0a\x03\x22" + "\x03\x0a\x06)\x03\x0a\x11\x10\x03\x0a\x11\x1a\x03\x0a\x17-\x03\x0a\x14(" + "\x03\x09)\x1e\x03\x09/\x09\x03\x09.\x00\x03\x09,\x07\x03\x09/*\x03\x09-9" + "\x03\x09\x228\x03\x09%\x09\x03\x09:\x12\x03\x09;\x1d\x03\x09?\x06\x03" + "\x093%\x03\x096\x05\x03\x096\x08\x03\x097\x02\x03\x09\x07,\x03\x09\x04," + "\x03\x09\x1f\x16\x03\x09\x11\x03\x03\x09\x11\x12\x03\x09\x168\x03\x08*" + "\x05\x03\x08/2\x03\x084:\x03\x08\x22+\x03\x08 0\x03\x08&\x0a\x03\x08;" + "\x10\x03\x08>$\x03\x08>\x18\x03\x0829\x03\x082:\x03\x081,\x03\x081<\x03" + "\x081\x1c\x03\x087#\x03\x087*\x03\x08\x09'\x03\x08\x00\x1d\x03\x08\x05-" + "\x03\x08\x1f4\x03\x08\x1d\x04\x03\x08\x16\x0f\x03\x07*7\x03\x07'!\x03" + "\x07%\x1b\x03\x077\x0c\x03\x07\x0c1\x03\x07\x0c.\x03\x07\x00\x06\x03\x07" + "\x01\x02\x03\x07\x010\x03\x07\x06=\x03\x07\x01\x03\x03\x07\x01\x13\x03" + "\x07\x06\x06\x03\x07\x05\x0a\x03\x07\x1f\x09\x03\x07\x17:\x03\x06*1\x03" + "\x06-\x1d\x03\x06\x223\x03\x062:\x03\x060$\x03\x066\x1e\x03\x064\x12\x03" + "\x0645\x03\x06\x0b\x00\x03\x06\x0b7\x03\x06\x07\x1f\x03\x06\x15\x12\x03" + "\x0c\x05\x0f\x03\x0b+\x0b\x03\x0b+-\x03\x06\x16\x1b\x03\x06\x15\x17\x03" + "\x89\xca\xea\x03\x89\xca\xe8\x03\x0c8\x10\x03\x0c8\x01\x03\x0c8\x0f\x03" + "\x0d8%\x03\x0d8!\x03\x0c8-\x03\x0c8/\x03\x0c8+\x03\x0c87\x03\x0c85\x03" + "\x0c9\x09\x03\x0c9\x0d\x03\x0c9\x0f\x03\x0c9\x0b\x03\xcfu\x0c\x03\xcfu" + "\x0f\x03\xcfu\x0e\x03\xcfu\x09\x03\x0c9\x10\x03\x0d9\x0c\x03\xcf`;\x03" + "\xcf`>\x03\xcf`9\x03\xcf`8\x03\xcf`7\x03\xcf`*\x03\xcf`-\x03\xcf`,\x03" + "\x0d\x1b\x1a\x03\x0d\x1b&\x03\x0c=.\x03\x0c=%\x03\x0c>\x1e\x03\x0c>\x14" + "\x03\x0c?\x06\x03\x0c?\x0b\x03\x0c?\x0c\x03\x0c?\x0d\x03\x0c?\x02\x03" + "\x0c>\x0f\x03\x0c>\x08\x03\x0c>\x09\x03\x0c>,\x03\x0c>\x0c\x03\x0c?\x13" + "\x03\x0c?\x16\x03\x0c?\x15\x03\x0c?\x1c\x03\x0c?\x1f\x03\x0c?\x1d\x03" + "\x0c?\x1a\x03\x0c?\x17\x03\x0c?\x08\x03\x0c?\x09\x03\x0c?\x0e\x03\x0c?" + "\x04\x03\x0c?\x05\x03\x0c" + "\x03\x0c=2\x03\x0c=6\x03\x0c<\x07\x03\x0c<\x05\x03\x0e:!\x03\x0e:#\x03" + "\x0e8\x09\x03\x0e:&\x03\x0e8\x0b\x03\x0e:$\x03\x0e:,\x03\x0e8\x1a\x03" + "\x0e8\x1e\x03\x0e:*\x03\x0e:7\x03\x0e:5\x03\x0e:;\x03\x0e:\x15\x03\x0e:<" + "\x03\x0e:4\x03\x0e:'\x03\x0e:-\x03\x0e:%\x03\x0e:?\x03\x0e:=\x03\x0e:)" + "\x03\x0e:/\x03\xcfs'\x03\x0d=\x0f\x03\x0d+*\x03\x0d99\x03\x0d9;\x03\x0d9" + "?\x03\x0d)\x0d\x03\x0d(%\x02\x01\x18\x02\x01(\x02\x01\x1e\x03\x0f$!\x03" + "\x0f87\x03\x0f4\x0e\x03\x0f5\x1d\x03\x06'\x03\x03\x0f\x08\x18\x03\x0f" + "\x0d\x1b\x03\x0e2=\x03\x0e;\x08\x03\x0e:\x0b\x03\x0e\x06$\x03\x0e\x0d)" + "\x03\x0e\x16\x1f\x03\x0e\x16\x1b\x03\x0d$\x0a\x03\x05,\x1d\x03\x0d. \x03" + "\x0d.#\x03\x0c(/\x03\x09%\x02\x03\x0d90\x03\x0d\x0e4\x03\x0d\x0d\x0f\x03" + "\x0c#\x00\x03\x0c,\x1e\x03\x0c2\x0e\x03\x0c\x01\x17\x03\x0c\x09:\x03\x0e" + "\x173\x03\x0c\x08\x03\x03\x0c\x11\x07\x03\x0c\x10\x18\x03\x0c\x1f\x1c" + "\x03\x0c\x19\x0e\x03\x0c\x1a\x1f\x03\x0f0>\x03\x0b->\x03\x0b<+\x03\x0b8" + "\x13\x03\x0b\x043\x03\x0b\x14\x03\x03\x0b\x16%\x03\x0d\x22&\x03\x0b\x1a" + "\x1a\x03\x0b\x1a\x04\x03\x0a%9\x03\x0a&2\x03\x0a&0\x03\x0a!\x1a\x03\x0a!" + "7\x03\x0a5\x10\x03\x0a=4\x03\x0a?\x0e\x03\x0a>\x10\x03\x0a\x00 \x03\x0a" + "\x0f:\x03\x0a\x0f9\x03\x0a\x0b\x0a\x03\x0a\x17%\x03\x0a\x1b-\x03\x09-" + "\x1a\x03\x09,4\x03\x09.,\x03\x09)\x09\x03\x096!\x03\x091\x1f\x03\x093" + "\x16\x03\x0c+\x1f\x03\x098 \x03\x098=\x03\x0c(\x1a\x03\x0c(\x16\x03\x09" + "\x0a+\x03\x09\x16\x12\x03\x09\x13\x0e\x03\x09\x153\x03\x08)!\x03\x09\x1a" + "\x01\x03\x09\x18\x01\x03\x08%#\x03\x08>\x22\x03\x08\x05%\x03\x08\x02*" + "\x03\x08\x15;\x03\x08\x1b7\x03\x0f\x07\x1d\x03\x0f\x04\x03\x03\x070\x0c" + "\x03\x07;\x0b\x03\x07\x08\x17\x03\x07\x12\x06\x03\x06/-\x03\x0671\x03" + "\x065+\x03\x06>7\x03\x06\x049\x03\x05+\x1e\x03\x05,\x17\x03\x05 \x1d\x03" + "\x05\x22\x05\x03\x050\x1d" // lookup returns the trie value for the first UTF-8 encoding in s and // the width in bytes of this encoding. The size will be 0 if s does not // hold enough bytes to complete the encoding. len(s) must be greater than 0. func (t *idnaTrie) lookup(s []byte) (v uint16, sz int) { c0 := s[0] switch { case c0 < 0x80: // is ASCII return idnaValues[c0], 1 case c0 < 0xC2: return 0, 1 // Illegal UTF-8: not a starter, not ASCII. case c0 < 0xE0: // 2-byte UTF-8 if len(s) < 2 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c1), 2 case c0 < 0xF0: // 3-byte UTF-8 if len(s) < 3 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = idnaIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c2), 3 case c0 < 0xF8: // 4-byte UTF-8 if len(s) < 4 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = idnaIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } o = uint32(i)<<6 + uint32(c2) i = idnaIndex[o] c3 := s[3] if c3 < 0x80 || 0xC0 <= c3 { return 0, 3 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c3), 4 } // Illegal rune return 0, 1 } // lookupUnsafe returns the trie value for the first UTF-8 encoding in s. // s must start with a full and valid UTF-8 encoded rune. func (t *idnaTrie) lookupUnsafe(s []byte) uint16 { c0 := s[0] if c0 < 0x80 { // is ASCII return idnaValues[c0] } i := idnaIndex[c0] if c0 < 0xE0 { // 2-byte UTF-8 return t.lookupValue(uint32(i), s[1]) } i = idnaIndex[uint32(i)<<6+uint32(s[1])] if c0 < 0xF0 { // 3-byte UTF-8 return t.lookupValue(uint32(i), s[2]) } i = idnaIndex[uint32(i)<<6+uint32(s[2])] if c0 < 0xF8 { // 4-byte UTF-8 return t.lookupValue(uint32(i), s[3]) } return 0 } // lookupString returns the trie value for the first UTF-8 encoding in s and // the width in bytes of this encoding. The size will be 0 if s does not // hold enough bytes to complete the encoding. len(s) must be greater than 0. func (t *idnaTrie) lookupString(s string) (v uint16, sz int) { c0 := s[0] switch { case c0 < 0x80: // is ASCII return idnaValues[c0], 1 case c0 < 0xC2: return 0, 1 // Illegal UTF-8: not a starter, not ASCII. case c0 < 0xE0: // 2-byte UTF-8 if len(s) < 2 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c1), 2 case c0 < 0xF0: // 3-byte UTF-8 if len(s) < 3 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = idnaIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c2), 3 case c0 < 0xF8: // 4-byte UTF-8 if len(s) < 4 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = idnaIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } o = uint32(i)<<6 + uint32(c2) i = idnaIndex[o] c3 := s[3] if c3 < 0x80 || 0xC0 <= c3 { return 0, 3 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c3), 4 } // Illegal rune return 0, 1 } // lookupStringUnsafe returns the trie value for the first UTF-8 encoding in s. // s must start with a full and valid UTF-8 encoded rune. func (t *idnaTrie) lookupStringUnsafe(s string) uint16 { c0 := s[0] if c0 < 0x80 { // is ASCII return idnaValues[c0] } i := idnaIndex[c0] if c0 < 0xE0 { // 2-byte UTF-8 return t.lookupValue(uint32(i), s[1]) } i = idnaIndex[uint32(i)<<6+uint32(s[1])] if c0 < 0xF0 { // 3-byte UTF-8 return t.lookupValue(uint32(i), s[2]) } i = idnaIndex[uint32(i)<<6+uint32(s[2])] if c0 < 0xF8 { // 4-byte UTF-8 return t.lookupValue(uint32(i), s[3]) } return 0 } // idnaTrie. Total size: 29708 bytes (29.01 KiB). Checksum: c3ecc76d8fffa6e6. type idnaTrie struct{} func newIdnaTrie(i int) *idnaTrie { return &idnaTrie{} } // lookupValue determines the type of block n and looks up the value for b. func (t *idnaTrie) lookupValue(n uint32, b byte) uint16 { switch { case n < 125: return uint16(idnaValues[n<<6+uint32(b)]) default: n -= 125 return uint16(idnaSparse.lookup(n, b)) } } // idnaValues: 127 blocks, 8128 entries, 16256 bytes // The third block is the zero block. var idnaValues = [8128]uint16{ // Block 0x0, offset 0x0 0x00: 0x0080, 0x01: 0x0080, 0x02: 0x0080, 0x03: 0x0080, 0x04: 0x0080, 0x05: 0x0080, 0x06: 0x0080, 0x07: 0x0080, 0x08: 0x0080, 0x09: 0x0080, 0x0a: 0x0080, 0x0b: 0x0080, 0x0c: 0x0080, 0x0d: 0x0080, 0x0e: 0x0080, 0x0f: 0x0080, 0x10: 0x0080, 0x11: 0x0080, 0x12: 0x0080, 0x13: 0x0080, 0x14: 0x0080, 0x15: 0x0080, 0x16: 0x0080, 0x17: 0x0080, 0x18: 0x0080, 0x19: 0x0080, 0x1a: 0x0080, 0x1b: 0x0080, 0x1c: 0x0080, 0x1d: 0x0080, 0x1e: 0x0080, 0x1f: 0x0080, 0x20: 0x0080, 0x21: 0x0080, 0x22: 0x0080, 0x23: 0x0080, 0x24: 0x0080, 0x25: 0x0080, 0x26: 0x0080, 0x27: 0x0080, 0x28: 0x0080, 0x29: 0x0080, 0x2a: 0x0080, 0x2b: 0x0080, 0x2c: 0x0080, 0x2d: 0x0008, 0x2e: 0x0008, 0x2f: 0x0080, 0x30: 0x0008, 0x31: 0x0008, 0x32: 0x0008, 0x33: 0x0008, 0x34: 0x0008, 0x35: 0x0008, 0x36: 0x0008, 0x37: 0x0008, 0x38: 0x0008, 0x39: 0x0008, 0x3a: 0x0080, 0x3b: 0x0080, 0x3c: 0x0080, 0x3d: 0x0080, 0x3e: 0x0080, 0x3f: 0x0080, // Block 0x1, offset 0x40 0x40: 0x0080, 0x41: 0xe105, 0x42: 0xe105, 0x43: 0xe105, 0x44: 0xe105, 0x45: 0xe105, 0x46: 0xe105, 0x47: 0xe105, 0x48: 0xe105, 0x49: 0xe105, 0x4a: 0xe105, 0x4b: 0xe105, 0x4c: 0xe105, 0x4d: 0xe105, 0x4e: 0xe105, 0x4f: 0xe105, 0x50: 0xe105, 0x51: 0xe105, 0x52: 0xe105, 0x53: 0xe105, 0x54: 0xe105, 0x55: 0xe105, 0x56: 0xe105, 0x57: 0xe105, 0x58: 0xe105, 0x59: 0xe105, 0x5a: 0xe105, 0x5b: 0x0080, 0x5c: 0x0080, 0x5d: 0x0080, 0x5e: 0x0080, 0x5f: 0x0080, 0x60: 0x0080, 0x61: 0x0008, 0x62: 0x0008, 0x63: 0x0008, 0x64: 0x0008, 0x65: 0x0008, 0x66: 0x0008, 0x67: 0x0008, 0x68: 0x0008, 0x69: 0x0008, 0x6a: 0x0008, 0x6b: 0x0008, 0x6c: 0x0008, 0x6d: 0x0008, 0x6e: 0x0008, 0x6f: 0x0008, 0x70: 0x0008, 0x71: 0x0008, 0x72: 0x0008, 0x73: 0x0008, 0x74: 0x0008, 0x75: 0x0008, 0x76: 0x0008, 0x77: 0x0008, 0x78: 0x0008, 0x79: 0x0008, 0x7a: 0x0008, 0x7b: 0x0080, 0x7c: 0x0080, 0x7d: 0x0080, 0x7e: 0x0080, 0x7f: 0x0080, // Block 0x2, offset 0x80 // Block 0x3, offset 0xc0 0xc0: 0x0040, 0xc1: 0x0040, 0xc2: 0x0040, 0xc3: 0x0040, 0xc4: 0x0040, 0xc5: 0x0040, 0xc6: 0x0040, 0xc7: 0x0040, 0xc8: 0x0040, 0xc9: 0x0040, 0xca: 0x0040, 0xcb: 0x0040, 0xcc: 0x0040, 0xcd: 0x0040, 0xce: 0x0040, 0xcf: 0x0040, 0xd0: 0x0040, 0xd1: 0x0040, 0xd2: 0x0040, 0xd3: 0x0040, 0xd4: 0x0040, 0xd5: 0x0040, 0xd6: 0x0040, 0xd7: 0x0040, 0xd8: 0x0040, 0xd9: 0x0040, 0xda: 0x0040, 0xdb: 0x0040, 0xdc: 0x0040, 0xdd: 0x0040, 0xde: 0x0040, 0xdf: 0x0040, 0xe0: 0x000a, 0xe1: 0x0018, 0xe2: 0x0018, 0xe3: 0x0018, 0xe4: 0x0018, 0xe5: 0x0018, 0xe6: 0x0018, 0xe7: 0x0018, 0xe8: 0x001a, 0xe9: 0x0018, 0xea: 0x0039, 0xeb: 0x0018, 0xec: 0x0018, 0xed: 0x03c0, 0xee: 0x0018, 0xef: 0x004a, 0xf0: 0x0018, 0xf1: 0x0018, 0xf2: 0x0069, 0xf3: 0x0079, 0xf4: 0x008a, 0xf5: 0x0005, 0xf6: 0x0018, 0xf7: 0x0008, 0xf8: 0x00aa, 0xf9: 0x00c9, 0xfa: 0x00d9, 0xfb: 0x0018, 0xfc: 0x00e9, 0xfd: 0x0119, 0xfe: 0x0149, 0xff: 0x0018, // Block 0x4, offset 0x100 0x100: 0xe00d, 0x101: 0x0008, 0x102: 0xe00d, 0x103: 0x0008, 0x104: 0xe00d, 0x105: 0x0008, 0x106: 0xe00d, 0x107: 0x0008, 0x108: 0xe00d, 0x109: 0x0008, 0x10a: 0xe00d, 0x10b: 0x0008, 0x10c: 0xe00d, 0x10d: 0x0008, 0x10e: 0xe00d, 0x10f: 0x0008, 0x110: 0xe00d, 0x111: 0x0008, 0x112: 0xe00d, 0x113: 0x0008, 0x114: 0xe00d, 0x115: 0x0008, 0x116: 0xe00d, 0x117: 0x0008, 0x118: 0xe00d, 0x119: 0x0008, 0x11a: 0xe00d, 0x11b: 0x0008, 0x11c: 0xe00d, 0x11d: 0x0008, 0x11e: 0xe00d, 0x11f: 0x0008, 0x120: 0xe00d, 0x121: 0x0008, 0x122: 0xe00d, 0x123: 0x0008, 0x124: 0xe00d, 0x125: 0x0008, 0x126: 0xe00d, 0x127: 0x0008, 0x128: 0xe00d, 0x129: 0x0008, 0x12a: 0xe00d, 0x12b: 0x0008, 0x12c: 0xe00d, 0x12d: 0x0008, 0x12e: 0xe00d, 0x12f: 0x0008, 0x130: 0x0179, 0x131: 0x0008, 0x132: 0x0035, 0x133: 0x004d, 0x134: 0xe00d, 0x135: 0x0008, 0x136: 0xe00d, 0x137: 0x0008, 0x138: 0x0008, 0x139: 0xe01d, 0x13a: 0x0008, 0x13b: 0xe03d, 0x13c: 0x0008, 0x13d: 0xe01d, 0x13e: 0x0008, 0x13f: 0x0199, // Block 0x5, offset 0x140 0x140: 0x0199, 0x141: 0xe01d, 0x142: 0x0008, 0x143: 0xe03d, 0x144: 0x0008, 0x145: 0xe01d, 0x146: 0x0008, 0x147: 0xe07d, 0x148: 0x0008, 0x149: 0x01b9, 0x14a: 0xe00d, 0x14b: 0x0008, 0x14c: 0xe00d, 0x14d: 0x0008, 0x14e: 0xe00d, 0x14f: 0x0008, 0x150: 0xe00d, 0x151: 0x0008, 0x152: 0xe00d, 0x153: 0x0008, 0x154: 0xe00d, 0x155: 0x0008, 0x156: 0xe00d, 0x157: 0x0008, 0x158: 0xe00d, 0x159: 0x0008, 0x15a: 0xe00d, 0x15b: 0x0008, 0x15c: 0xe00d, 0x15d: 0x0008, 0x15e: 0xe00d, 0x15f: 0x0008, 0x160: 0xe00d, 0x161: 0x0008, 0x162: 0xe00d, 0x163: 0x0008, 0x164: 0xe00d, 0x165: 0x0008, 0x166: 0xe00d, 0x167: 0x0008, 0x168: 0xe00d, 0x169: 0x0008, 0x16a: 0xe00d, 0x16b: 0x0008, 0x16c: 0xe00d, 0x16d: 0x0008, 0x16e: 0xe00d, 0x16f: 0x0008, 0x170: 0xe00d, 0x171: 0x0008, 0x172: 0xe00d, 0x173: 0x0008, 0x174: 0xe00d, 0x175: 0x0008, 0x176: 0xe00d, 0x177: 0x0008, 0x178: 0x0065, 0x179: 0xe01d, 0x17a: 0x0008, 0x17b: 0xe03d, 0x17c: 0x0008, 0x17d: 0xe01d, 0x17e: 0x0008, 0x17f: 0x01d9, // Block 0x6, offset 0x180 0x180: 0x0008, 0x181: 0x007d, 0x182: 0xe00d, 0x183: 0x0008, 0x184: 0xe00d, 0x185: 0x0008, 0x186: 0x007d, 0x187: 0xe07d, 0x188: 0x0008, 0x189: 0x0095, 0x18a: 0x00ad, 0x18b: 0xe03d, 0x18c: 0x0008, 0x18d: 0x0008, 0x18e: 0x00c5, 0x18f: 0x00dd, 0x190: 0x00f5, 0x191: 0xe01d, 0x192: 0x0008, 0x193: 0x010d, 0x194: 0x0125, 0x195: 0x0008, 0x196: 0x013d, 0x197: 0x013d, 0x198: 0xe00d, 0x199: 0x0008, 0x19a: 0x0008, 0x19b: 0x0008, 0x19c: 0x010d, 0x19d: 0x0155, 0x19e: 0x0008, 0x19f: 0x016d, 0x1a0: 0xe00d, 0x1a1: 0x0008, 0x1a2: 0xe00d, 0x1a3: 0x0008, 0x1a4: 0xe00d, 0x1a5: 0x0008, 0x1a6: 0x0185, 0x1a7: 0xe07d, 0x1a8: 0x0008, 0x1a9: 0x019d, 0x1aa: 0x0008, 0x1ab: 0x0008, 0x1ac: 0xe00d, 0x1ad: 0x0008, 0x1ae: 0x0185, 0x1af: 0xe0fd, 0x1b0: 0x0008, 0x1b1: 0x01b5, 0x1b2: 0x01cd, 0x1b3: 0xe03d, 0x1b4: 0x0008, 0x1b5: 0xe01d, 0x1b6: 0x0008, 0x1b7: 0x01e5, 0x1b8: 0xe00d, 0x1b9: 0x0008, 0x1ba: 0x0008, 0x1bb: 0x0008, 0x1bc: 0xe00d, 0x1bd: 0x0008, 0x1be: 0x0008, 0x1bf: 0x0008, // Block 0x7, offset 0x1c0 0x1c0: 0x0008, 0x1c1: 0x0008, 0x1c2: 0x0008, 0x1c3: 0x0008, 0x1c4: 0x01e9, 0x1c5: 0x01e9, 0x1c6: 0x01e9, 0x1c7: 0x01fd, 0x1c8: 0x0215, 0x1c9: 0x022d, 0x1ca: 0x0245, 0x1cb: 0x025d, 0x1cc: 0x0275, 0x1cd: 0xe01d, 0x1ce: 0x0008, 0x1cf: 0xe0fd, 0x1d0: 0x0008, 0x1d1: 0xe01d, 0x1d2: 0x0008, 0x1d3: 0xe03d, 0x1d4: 0x0008, 0x1d5: 0xe01d, 0x1d6: 0x0008, 0x1d7: 0xe07d, 0x1d8: 0x0008, 0x1d9: 0xe01d, 0x1da: 0x0008, 0x1db: 0xe03d, 0x1dc: 0x0008, 0x1dd: 0x0008, 0x1de: 0xe00d, 0x1df: 0x0008, 0x1e0: 0xe00d, 0x1e1: 0x0008, 0x1e2: 0xe00d, 0x1e3: 0x0008, 0x1e4: 0xe00d, 0x1e5: 0x0008, 0x1e6: 0xe00d, 0x1e7: 0x0008, 0x1e8: 0xe00d, 0x1e9: 0x0008, 0x1ea: 0xe00d, 0x1eb: 0x0008, 0x1ec: 0xe00d, 0x1ed: 0x0008, 0x1ee: 0xe00d, 0x1ef: 0x0008, 0x1f0: 0x0008, 0x1f1: 0x028d, 0x1f2: 0x02a5, 0x1f3: 0x02bd, 0x1f4: 0xe00d, 0x1f5: 0x0008, 0x1f6: 0x02d5, 0x1f7: 0x02ed, 0x1f8: 0xe00d, 0x1f9: 0x0008, 0x1fa: 0xe00d, 0x1fb: 0x0008, 0x1fc: 0xe00d, 0x1fd: 0x0008, 0x1fe: 0xe00d, 0x1ff: 0x0008, // Block 0x8, offset 0x200 0x200: 0xe00d, 0x201: 0x0008, 0x202: 0xe00d, 0x203: 0x0008, 0x204: 0xe00d, 0x205: 0x0008, 0x206: 0xe00d, 0x207: 0x0008, 0x208: 0xe00d, 0x209: 0x0008, 0x20a: 0xe00d, 0x20b: 0x0008, 0x20c: 0xe00d, 0x20d: 0x0008, 0x20e: 0xe00d, 0x20f: 0x0008, 0x210: 0xe00d, 0x211: 0x0008, 0x212: 0xe00d, 0x213: 0x0008, 0x214: 0xe00d, 0x215: 0x0008, 0x216: 0xe00d, 0x217: 0x0008, 0x218: 0xe00d, 0x219: 0x0008, 0x21a: 0xe00d, 0x21b: 0x0008, 0x21c: 0xe00d, 0x21d: 0x0008, 0x21e: 0xe00d, 0x21f: 0x0008, 0x220: 0x0305, 0x221: 0x0008, 0x222: 0xe00d, 0x223: 0x0008, 0x224: 0xe00d, 0x225: 0x0008, 0x226: 0xe00d, 0x227: 0x0008, 0x228: 0xe00d, 0x229: 0x0008, 0x22a: 0xe00d, 0x22b: 0x0008, 0x22c: 0xe00d, 0x22d: 0x0008, 0x22e: 0xe00d, 0x22f: 0x0008, 0x230: 0xe00d, 0x231: 0x0008, 0x232: 0xe00d, 0x233: 0x0008, 0x234: 0x0008, 0x235: 0x0008, 0x236: 0x0008, 0x237: 0x0008, 0x238: 0x0008, 0x239: 0x0008, 0x23a: 0x0209, 0x23b: 0xe03d, 0x23c: 0x0008, 0x23d: 0x031d, 0x23e: 0x0229, 0x23f: 0x0008, // Block 0x9, offset 0x240 0x240: 0x0008, 0x241: 0x0008, 0x242: 0x0018, 0x243: 0x0018, 0x244: 0x0018, 0x245: 0x0018, 0x246: 0x0008, 0x247: 0x0008, 0x248: 0x0008, 0x249: 0x0008, 0x24a: 0x0008, 0x24b: 0x0008, 0x24c: 0x0008, 0x24d: 0x0008, 0x24e: 0x0008, 0x24f: 0x0008, 0x250: 0x0008, 0x251: 0x0008, 0x252: 0x0018, 0x253: 0x0018, 0x254: 0x0018, 0x255: 0x0018, 0x256: 0x0018, 0x257: 0x0018, 0x258: 0x029a, 0x259: 0x02ba, 0x25a: 0x02da, 0x25b: 0x02fa, 0x25c: 0x031a, 0x25d: 0x033a, 0x25e: 0x0018, 0x25f: 0x0018, 0x260: 0x03ad, 0x261: 0x0359, 0x262: 0x01d9, 0x263: 0x0369, 0x264: 0x03c5, 0x265: 0x0018, 0x266: 0x0018, 0x267: 0x0018, 0x268: 0x0018, 0x269: 0x0018, 0x26a: 0x0018, 0x26b: 0x0018, 0x26c: 0x0008, 0x26d: 0x0018, 0x26e: 0x0008, 0x26f: 0x0018, 0x270: 0x0018, 0x271: 0x0018, 0x272: 0x0018, 0x273: 0x0018, 0x274: 0x0018, 0x275: 0x0018, 0x276: 0x0018, 0x277: 0x0018, 0x278: 0x0018, 0x279: 0x0018, 0x27a: 0x0018, 0x27b: 0x0018, 0x27c: 0x0018, 0x27d: 0x0018, 0x27e: 0x0018, 0x27f: 0x0018, // Block 0xa, offset 0x280 0x280: 0x03dd, 0x281: 0x03dd, 0x282: 0x3308, 0x283: 0x03f5, 0x284: 0x0379, 0x285: 0x040d, 0x286: 0x3308, 0x287: 0x3308, 0x288: 0x3308, 0x289: 0x3308, 0x28a: 0x3308, 0x28b: 0x3308, 0x28c: 0x3308, 0x28d: 0x3308, 0x28e: 0x3308, 0x28f: 0x33c0, 0x290: 0x3308, 0x291: 0x3308, 0x292: 0x3308, 0x293: 0x3308, 0x294: 0x3308, 0x295: 0x3308, 0x296: 0x3308, 0x297: 0x3308, 0x298: 0x3308, 0x299: 0x3308, 0x29a: 0x3308, 0x29b: 0x3308, 0x29c: 0x3308, 0x29d: 0x3308, 0x29e: 0x3308, 0x29f: 0x3308, 0x2a0: 0x3308, 0x2a1: 0x3308, 0x2a2: 0x3308, 0x2a3: 0x3308, 0x2a4: 0x3308, 0x2a5: 0x3308, 0x2a6: 0x3308, 0x2a7: 0x3308, 0x2a8: 0x3308, 0x2a9: 0x3308, 0x2aa: 0x3308, 0x2ab: 0x3308, 0x2ac: 0x3308, 0x2ad: 0x3308, 0x2ae: 0x3308, 0x2af: 0x3308, 0x2b0: 0xe00d, 0x2b1: 0x0008, 0x2b2: 0xe00d, 0x2b3: 0x0008, 0x2b4: 0x0425, 0x2b5: 0x0008, 0x2b6: 0xe00d, 0x2b7: 0x0008, 0x2b8: 0x0040, 0x2b9: 0x0040, 0x2ba: 0x03a2, 0x2bb: 0x0008, 0x2bc: 0x0008, 0x2bd: 0x0008, 0x2be: 0x03c2, 0x2bf: 0x043d, // Block 0xb, offset 0x2c0 0x2c0: 0x0040, 0x2c1: 0x0040, 0x2c2: 0x0040, 0x2c3: 0x0040, 0x2c4: 0x008a, 0x2c5: 0x03d2, 0x2c6: 0xe155, 0x2c7: 0x0455, 0x2c8: 0xe12d, 0x2c9: 0xe13d, 0x2ca: 0xe12d, 0x2cb: 0x0040, 0x2cc: 0x03dd, 0x2cd: 0x0040, 0x2ce: 0x046d, 0x2cf: 0x0485, 0x2d0: 0x0008, 0x2d1: 0xe105, 0x2d2: 0xe105, 0x2d3: 0xe105, 0x2d4: 0xe105, 0x2d5: 0xe105, 0x2d6: 0xe105, 0x2d7: 0xe105, 0x2d8: 0xe105, 0x2d9: 0xe105, 0x2da: 0xe105, 0x2db: 0xe105, 0x2dc: 0xe105, 0x2dd: 0xe105, 0x2de: 0xe105, 0x2df: 0xe105, 0x2e0: 0x049d, 0x2e1: 0x049d, 0x2e2: 0x0040, 0x2e3: 0x049d, 0x2e4: 0x049d, 0x2e5: 0x049d, 0x2e6: 0x049d, 0x2e7: 0x049d, 0x2e8: 0x049d, 0x2e9: 0x049d, 0x2ea: 0x049d, 0x2eb: 0x049d, 0x2ec: 0x0008, 0x2ed: 0x0008, 0x2ee: 0x0008, 0x2ef: 0x0008, 0x2f0: 0x0008, 0x2f1: 0x0008, 0x2f2: 0x0008, 0x2f3: 0x0008, 0x2f4: 0x0008, 0x2f5: 0x0008, 0x2f6: 0x0008, 0x2f7: 0x0008, 0x2f8: 0x0008, 0x2f9: 0x0008, 0x2fa: 0x0008, 0x2fb: 0x0008, 0x2fc: 0x0008, 0x2fd: 0x0008, 0x2fe: 0x0008, 0x2ff: 0x0008, // Block 0xc, offset 0x300 0x300: 0x0008, 0x301: 0x0008, 0x302: 0xe00f, 0x303: 0x0008, 0x304: 0x0008, 0x305: 0x0008, 0x306: 0x0008, 0x307: 0x0008, 0x308: 0x0008, 0x309: 0x0008, 0x30a: 0x0008, 0x30b: 0x0008, 0x30c: 0x0008, 0x30d: 0x0008, 0x30e: 0x0008, 0x30f: 0xe0c5, 0x310: 0x04b5, 0x311: 0x04cd, 0x312: 0xe0bd, 0x313: 0xe0f5, 0x314: 0xe0fd, 0x315: 0xe09d, 0x316: 0xe0b5, 0x317: 0x0008, 0x318: 0xe00d, 0x319: 0x0008, 0x31a: 0xe00d, 0x31b: 0x0008, 0x31c: 0xe00d, 0x31d: 0x0008, 0x31e: 0xe00d, 0x31f: 0x0008, 0x320: 0xe00d, 0x321: 0x0008, 0x322: 0xe00d, 0x323: 0x0008, 0x324: 0xe00d, 0x325: 0x0008, 0x326: 0xe00d, 0x327: 0x0008, 0x328: 0xe00d, 0x329: 0x0008, 0x32a: 0xe00d, 0x32b: 0x0008, 0x32c: 0xe00d, 0x32d: 0x0008, 0x32e: 0xe00d, 0x32f: 0x0008, 0x330: 0x04e5, 0x331: 0xe185, 0x332: 0xe18d, 0x333: 0x0008, 0x334: 0x04fd, 0x335: 0x03dd, 0x336: 0x0018, 0x337: 0xe07d, 0x338: 0x0008, 0x339: 0xe1d5, 0x33a: 0xe00d, 0x33b: 0x0008, 0x33c: 0x0008, 0x33d: 0x0515, 0x33e: 0x052d, 0x33f: 0x052d, // Block 0xd, offset 0x340 0x340: 0x0008, 0x341: 0x0008, 0x342: 0x0008, 0x343: 0x0008, 0x344: 0x0008, 0x345: 0x0008, 0x346: 0x0008, 0x347: 0x0008, 0x348: 0x0008, 0x349: 0x0008, 0x34a: 0x0008, 0x34b: 0x0008, 0x34c: 0x0008, 0x34d: 0x0008, 0x34e: 0x0008, 0x34f: 0x0008, 0x350: 0x0008, 0x351: 0x0008, 0x352: 0x0008, 0x353: 0x0008, 0x354: 0x0008, 0x355: 0x0008, 0x356: 0x0008, 0x357: 0x0008, 0x358: 0x0008, 0x359: 0x0008, 0x35a: 0x0008, 0x35b: 0x0008, 0x35c: 0x0008, 0x35d: 0x0008, 0x35e: 0x0008, 0x35f: 0x0008, 0x360: 0xe00d, 0x361: 0x0008, 0x362: 0xe00d, 0x363: 0x0008, 0x364: 0xe00d, 0x365: 0x0008, 0x366: 0xe00d, 0x367: 0x0008, 0x368: 0xe00d, 0x369: 0x0008, 0x36a: 0xe00d, 0x36b: 0x0008, 0x36c: 0xe00d, 0x36d: 0x0008, 0x36e: 0xe00d, 0x36f: 0x0008, 0x370: 0xe00d, 0x371: 0x0008, 0x372: 0xe00d, 0x373: 0x0008, 0x374: 0xe00d, 0x375: 0x0008, 0x376: 0xe00d, 0x377: 0x0008, 0x378: 0xe00d, 0x379: 0x0008, 0x37a: 0xe00d, 0x37b: 0x0008, 0x37c: 0xe00d, 0x37d: 0x0008, 0x37e: 0xe00d, 0x37f: 0x0008, // Block 0xe, offset 0x380 0x380: 0xe00d, 0x381: 0x0008, 0x382: 0x0018, 0x383: 0x3308, 0x384: 0x3308, 0x385: 0x3308, 0x386: 0x3308, 0x387: 0x3308, 0x388: 0x3318, 0x389: 0x3318, 0x38a: 0xe00d, 0x38b: 0x0008, 0x38c: 0xe00d, 0x38d: 0x0008, 0x38e: 0xe00d, 0x38f: 0x0008, 0x390: 0xe00d, 0x391: 0x0008, 0x392: 0xe00d, 0x393: 0x0008, 0x394: 0xe00d, 0x395: 0x0008, 0x396: 0xe00d, 0x397: 0x0008, 0x398: 0xe00d, 0x399: 0x0008, 0x39a: 0xe00d, 0x39b: 0x0008, 0x39c: 0xe00d, 0x39d: 0x0008, 0x39e: 0xe00d, 0x39f: 0x0008, 0x3a0: 0xe00d, 0x3a1: 0x0008, 0x3a2: 0xe00d, 0x3a3: 0x0008, 0x3a4: 0xe00d, 0x3a5: 0x0008, 0x3a6: 0xe00d, 0x3a7: 0x0008, 0x3a8: 0xe00d, 0x3a9: 0x0008, 0x3aa: 0xe00d, 0x3ab: 0x0008, 0x3ac: 0xe00d, 0x3ad: 0x0008, 0x3ae: 0xe00d, 0x3af: 0x0008, 0x3b0: 0xe00d, 0x3b1: 0x0008, 0x3b2: 0xe00d, 0x3b3: 0x0008, 0x3b4: 0xe00d, 0x3b5: 0x0008, 0x3b6: 0xe00d, 0x3b7: 0x0008, 0x3b8: 0xe00d, 0x3b9: 0x0008, 0x3ba: 0xe00d, 0x3bb: 0x0008, 0x3bc: 0xe00d, 0x3bd: 0x0008, 0x3be: 0xe00d, 0x3bf: 0x0008, // Block 0xf, offset 0x3c0 0x3c0: 0x0040, 0x3c1: 0xe01d, 0x3c2: 0x0008, 0x3c3: 0xe03d, 0x3c4: 0x0008, 0x3c5: 0xe01d, 0x3c6: 0x0008, 0x3c7: 0xe07d, 0x3c8: 0x0008, 0x3c9: 0xe01d, 0x3ca: 0x0008, 0x3cb: 0xe03d, 0x3cc: 0x0008, 0x3cd: 0xe01d, 0x3ce: 0x0008, 0x3cf: 0x0008, 0x3d0: 0xe00d, 0x3d1: 0x0008, 0x3d2: 0xe00d, 0x3d3: 0x0008, 0x3d4: 0xe00d, 0x3d5: 0x0008, 0x3d6: 0xe00d, 0x3d7: 0x0008, 0x3d8: 0xe00d, 0x3d9: 0x0008, 0x3da: 0xe00d, 0x3db: 0x0008, 0x3dc: 0xe00d, 0x3dd: 0x0008, 0x3de: 0xe00d, 0x3df: 0x0008, 0x3e0: 0xe00d, 0x3e1: 0x0008, 0x3e2: 0xe00d, 0x3e3: 0x0008, 0x3e4: 0xe00d, 0x3e5: 0x0008, 0x3e6: 0xe00d, 0x3e7: 0x0008, 0x3e8: 0xe00d, 0x3e9: 0x0008, 0x3ea: 0xe00d, 0x3eb: 0x0008, 0x3ec: 0xe00d, 0x3ed: 0x0008, 0x3ee: 0xe00d, 0x3ef: 0x0008, 0x3f0: 0xe00d, 0x3f1: 0x0008, 0x3f2: 0xe00d, 0x3f3: 0x0008, 0x3f4: 0xe00d, 0x3f5: 0x0008, 0x3f6: 0xe00d, 0x3f7: 0x0008, 0x3f8: 0xe00d, 0x3f9: 0x0008, 0x3fa: 0xe00d, 0x3fb: 0x0008, 0x3fc: 0xe00d, 0x3fd: 0x0008, 0x3fe: 0xe00d, 0x3ff: 0x0008, // Block 0x10, offset 0x400 0x400: 0xe00d, 0x401: 0x0008, 0x402: 0xe00d, 0x403: 0x0008, 0x404: 0xe00d, 0x405: 0x0008, 0x406: 0xe00d, 0x407: 0x0008, 0x408: 0xe00d, 0x409: 0x0008, 0x40a: 0xe00d, 0x40b: 0x0008, 0x40c: 0xe00d, 0x40d: 0x0008, 0x40e: 0xe00d, 0x40f: 0x0008, 0x410: 0xe00d, 0x411: 0x0008, 0x412: 0xe00d, 0x413: 0x0008, 0x414: 0xe00d, 0x415: 0x0008, 0x416: 0xe00d, 0x417: 0x0008, 0x418: 0xe00d, 0x419: 0x0008, 0x41a: 0xe00d, 0x41b: 0x0008, 0x41c: 0xe00d, 0x41d: 0x0008, 0x41e: 0xe00d, 0x41f: 0x0008, 0x420: 0xe00d, 0x421: 0x0008, 0x422: 0xe00d, 0x423: 0x0008, 0x424: 0xe00d, 0x425: 0x0008, 0x426: 0xe00d, 0x427: 0x0008, 0x428: 0xe00d, 0x429: 0x0008, 0x42a: 0xe00d, 0x42b: 0x0008, 0x42c: 0xe00d, 0x42d: 0x0008, 0x42e: 0xe00d, 0x42f: 0x0008, 0x430: 0x0040, 0x431: 0x03f5, 0x432: 0x03f5, 0x433: 0x03f5, 0x434: 0x03f5, 0x435: 0x03f5, 0x436: 0x03f5, 0x437: 0x03f5, 0x438: 0x03f5, 0x439: 0x03f5, 0x43a: 0x03f5, 0x43b: 0x03f5, 0x43c: 0x03f5, 0x43d: 0x03f5, 0x43e: 0x03f5, 0x43f: 0x03f5, // Block 0x11, offset 0x440 0x440: 0x0840, 0x441: 0x0840, 0x442: 0x0840, 0x443: 0x0840, 0x444: 0x0840, 0x445: 0x0840, 0x446: 0x0018, 0x447: 0x0018, 0x448: 0x0818, 0x449: 0x0018, 0x44a: 0x0018, 0x44b: 0x0818, 0x44c: 0x0018, 0x44d: 0x0818, 0x44e: 0x0018, 0x44f: 0x0018, 0x450: 0x3308, 0x451: 0x3308, 0x452: 0x3308, 0x453: 0x3308, 0x454: 0x3308, 0x455: 0x3308, 0x456: 0x3308, 0x457: 0x3308, 0x458: 0x3308, 0x459: 0x3308, 0x45a: 0x3308, 0x45b: 0x0818, 0x45c: 0x0b40, 0x45d: 0x0040, 0x45e: 0x0818, 0x45f: 0x0818, 0x460: 0x0a08, 0x461: 0x0808, 0x462: 0x0c08, 0x463: 0x0c08, 0x464: 0x0c08, 0x465: 0x0c08, 0x466: 0x0a08, 0x467: 0x0c08, 0x468: 0x0a08, 0x469: 0x0c08, 0x46a: 0x0a08, 0x46b: 0x0a08, 0x46c: 0x0a08, 0x46d: 0x0a08, 0x46e: 0x0a08, 0x46f: 0x0c08, 0x470: 0x0c08, 0x471: 0x0c08, 0x472: 0x0c08, 0x473: 0x0a08, 0x474: 0x0a08, 0x475: 0x0a08, 0x476: 0x0a08, 0x477: 0x0a08, 0x478: 0x0a08, 0x479: 0x0a08, 0x47a: 0x0a08, 0x47b: 0x0a08, 0x47c: 0x0a08, 0x47d: 0x0a08, 0x47e: 0x0a08, 0x47f: 0x0a08, // Block 0x12, offset 0x480 0x480: 0x0818, 0x481: 0x0a08, 0x482: 0x0a08, 0x483: 0x0a08, 0x484: 0x0a08, 0x485: 0x0a08, 0x486: 0x0a08, 0x487: 0x0a08, 0x488: 0x0c08, 0x489: 0x0a08, 0x48a: 0x0a08, 0x48b: 0x3308, 0x48c: 0x3308, 0x48d: 0x3308, 0x48e: 0x3308, 0x48f: 0x3308, 0x490: 0x3308, 0x491: 0x3308, 0x492: 0x3308, 0x493: 0x3308, 0x494: 0x3308, 0x495: 0x3308, 0x496: 0x3308, 0x497: 0x3308, 0x498: 0x3308, 0x499: 0x3308, 0x49a: 0x3308, 0x49b: 0x3308, 0x49c: 0x3308, 0x49d: 0x3308, 0x49e: 0x3308, 0x49f: 0x3308, 0x4a0: 0x0808, 0x4a1: 0x0808, 0x4a2: 0x0808, 0x4a3: 0x0808, 0x4a4: 0x0808, 0x4a5: 0x0808, 0x4a6: 0x0808, 0x4a7: 0x0808, 0x4a8: 0x0808, 0x4a9: 0x0808, 0x4aa: 0x0018, 0x4ab: 0x0818, 0x4ac: 0x0818, 0x4ad: 0x0818, 0x4ae: 0x0a08, 0x4af: 0x0a08, 0x4b0: 0x3308, 0x4b1: 0x0c08, 0x4b2: 0x0c08, 0x4b3: 0x0c08, 0x4b4: 0x0808, 0x4b5: 0x0429, 0x4b6: 0x0451, 0x4b7: 0x0479, 0x4b8: 0x04a1, 0x4b9: 0x0a08, 0x4ba: 0x0a08, 0x4bb: 0x0a08, 0x4bc: 0x0a08, 0x4bd: 0x0a08, 0x4be: 0x0a08, 0x4bf: 0x0a08, // Block 0x13, offset 0x4c0 0x4c0: 0x0c08, 0x4c1: 0x0a08, 0x4c2: 0x0a08, 0x4c3: 0x0c08, 0x4c4: 0x0c08, 0x4c5: 0x0c08, 0x4c6: 0x0c08, 0x4c7: 0x0c08, 0x4c8: 0x0c08, 0x4c9: 0x0c08, 0x4ca: 0x0c08, 0x4cb: 0x0c08, 0x4cc: 0x0a08, 0x4cd: 0x0c08, 0x4ce: 0x0a08, 0x4cf: 0x0c08, 0x4d0: 0x0a08, 0x4d1: 0x0a08, 0x4d2: 0x0c08, 0x4d3: 0x0c08, 0x4d4: 0x0818, 0x4d5: 0x0c08, 0x4d6: 0x3308, 0x4d7: 0x3308, 0x4d8: 0x3308, 0x4d9: 0x3308, 0x4da: 0x3308, 0x4db: 0x3308, 0x4dc: 0x3308, 0x4dd: 0x0840, 0x4de: 0x0018, 0x4df: 0x3308, 0x4e0: 0x3308, 0x4e1: 0x3308, 0x4e2: 0x3308, 0x4e3: 0x3308, 0x4e4: 0x3308, 0x4e5: 0x0808, 0x4e6: 0x0808, 0x4e7: 0x3308, 0x4e8: 0x3308, 0x4e9: 0x0018, 0x4ea: 0x3308, 0x4eb: 0x3308, 0x4ec: 0x3308, 0x4ed: 0x3308, 0x4ee: 0x0c08, 0x4ef: 0x0c08, 0x4f0: 0x0008, 0x4f1: 0x0008, 0x4f2: 0x0008, 0x4f3: 0x0008, 0x4f4: 0x0008, 0x4f5: 0x0008, 0x4f6: 0x0008, 0x4f7: 0x0008, 0x4f8: 0x0008, 0x4f9: 0x0008, 0x4fa: 0x0a08, 0x4fb: 0x0a08, 0x4fc: 0x0a08, 0x4fd: 0x0808, 0x4fe: 0x0808, 0x4ff: 0x0a08, // Block 0x14, offset 0x500 0x500: 0x0818, 0x501: 0x0818, 0x502: 0x0818, 0x503: 0x0818, 0x504: 0x0818, 0x505: 0x0818, 0x506: 0x0818, 0x507: 0x0818, 0x508: 0x0818, 0x509: 0x0818, 0x50a: 0x0818, 0x50b: 0x0818, 0x50c: 0x0818, 0x50d: 0x0818, 0x50e: 0x0040, 0x50f: 0x0b40, 0x510: 0x0c08, 0x511: 0x3308, 0x512: 0x0a08, 0x513: 0x0a08, 0x514: 0x0a08, 0x515: 0x0c08, 0x516: 0x0c08, 0x517: 0x0c08, 0x518: 0x0c08, 0x519: 0x0c08, 0x51a: 0x0a08, 0x51b: 0x0a08, 0x51c: 0x0a08, 0x51d: 0x0a08, 0x51e: 0x0c08, 0x51f: 0x0a08, 0x520: 0x0a08, 0x521: 0x0a08, 0x522: 0x0a08, 0x523: 0x0a08, 0x524: 0x0a08, 0x525: 0x0a08, 0x526: 0x0a08, 0x527: 0x0a08, 0x528: 0x0c08, 0x529: 0x0a08, 0x52a: 0x0c08, 0x52b: 0x0a08, 0x52c: 0x0c08, 0x52d: 0x0a08, 0x52e: 0x0a08, 0x52f: 0x0c08, 0x530: 0x3308, 0x531: 0x3308, 0x532: 0x3308, 0x533: 0x3308, 0x534: 0x3308, 0x535: 0x3308, 0x536: 0x3308, 0x537: 0x3308, 0x538: 0x3308, 0x539: 0x3308, 0x53a: 0x3308, 0x53b: 0x3308, 0x53c: 0x3308, 0x53d: 0x3308, 0x53e: 0x3308, 0x53f: 0x3308, // Block 0x15, offset 0x540 0x540: 0x0c08, 0x541: 0x0a08, 0x542: 0x0a08, 0x543: 0x0a08, 0x544: 0x0a08, 0x545: 0x0a08, 0x546: 0x0c08, 0x547: 0x0c08, 0x548: 0x0a08, 0x549: 0x0c08, 0x54a: 0x0a08, 0x54b: 0x0a08, 0x54c: 0x0a08, 0x54d: 0x0a08, 0x54e: 0x0a08, 0x54f: 0x0a08, 0x550: 0x0a08, 0x551: 0x0a08, 0x552: 0x0a08, 0x553: 0x0a08, 0x554: 0x0c08, 0x555: 0x0a08, 0x556: 0x0808, 0x557: 0x0808, 0x558: 0x0808, 0x559: 0x3308, 0x55a: 0x3308, 0x55b: 0x3308, 0x55c: 0x0040, 0x55d: 0x0040, 0x55e: 0x0818, 0x55f: 0x0040, 0x560: 0x0a08, 0x561: 0x0808, 0x562: 0x0a08, 0x563: 0x0a08, 0x564: 0x0a08, 0x565: 0x0a08, 0x566: 0x0808, 0x567: 0x0c08, 0x568: 0x0a08, 0x569: 0x0c08, 0x56a: 0x0c08, 0x56b: 0x0040, 0x56c: 0x0040, 0x56d: 0x0040, 0x56e: 0x0040, 0x56f: 0x0040, 0x570: 0x0040, 0x571: 0x0040, 0x572: 0x0040, 0x573: 0x0040, 0x574: 0x0040, 0x575: 0x0040, 0x576: 0x0040, 0x577: 0x0040, 0x578: 0x0040, 0x579: 0x0040, 0x57a: 0x0040, 0x57b: 0x0040, 0x57c: 0x0040, 0x57d: 0x0040, 0x57e: 0x0040, 0x57f: 0x0040, // Block 0x16, offset 0x580 0x580: 0x3008, 0x581: 0x3308, 0x582: 0x3308, 0x583: 0x3308, 0x584: 0x3308, 0x585: 0x3308, 0x586: 0x3308, 0x587: 0x3308, 0x588: 0x3308, 0x589: 0x3008, 0x58a: 0x3008, 0x58b: 0x3008, 0x58c: 0x3008, 0x58d: 0x3b08, 0x58e: 0x3008, 0x58f: 0x3008, 0x590: 0x0008, 0x591: 0x3308, 0x592: 0x3308, 0x593: 0x3308, 0x594: 0x3308, 0x595: 0x3308, 0x596: 0x3308, 0x597: 0x3308, 0x598: 0x04c9, 0x599: 0x0501, 0x59a: 0x0539, 0x59b: 0x0571, 0x59c: 0x05a9, 0x59d: 0x05e1, 0x59e: 0x0619, 0x59f: 0x0651, 0x5a0: 0x0008, 0x5a1: 0x0008, 0x5a2: 0x3308, 0x5a3: 0x3308, 0x5a4: 0x0018, 0x5a5: 0x0018, 0x5a6: 0x0008, 0x5a7: 0x0008, 0x5a8: 0x0008, 0x5a9: 0x0008, 0x5aa: 0x0008, 0x5ab: 0x0008, 0x5ac: 0x0008, 0x5ad: 0x0008, 0x5ae: 0x0008, 0x5af: 0x0008, 0x5b0: 0x0018, 0x5b1: 0x0008, 0x5b2: 0x0008, 0x5b3: 0x0008, 0x5b4: 0x0008, 0x5b5: 0x0008, 0x5b6: 0x0008, 0x5b7: 0x0008, 0x5b8: 0x0008, 0x5b9: 0x0008, 0x5ba: 0x0008, 0x5bb: 0x0008, 0x5bc: 0x0008, 0x5bd: 0x0008, 0x5be: 0x0008, 0x5bf: 0x0008, // Block 0x17, offset 0x5c0 0x5c0: 0x0008, 0x5c1: 0x3308, 0x5c2: 0x3008, 0x5c3: 0x3008, 0x5c4: 0x0040, 0x5c5: 0x0008, 0x5c6: 0x0008, 0x5c7: 0x0008, 0x5c8: 0x0008, 0x5c9: 0x0008, 0x5ca: 0x0008, 0x5cb: 0x0008, 0x5cc: 0x0008, 0x5cd: 0x0040, 0x5ce: 0x0040, 0x5cf: 0x0008, 0x5d0: 0x0008, 0x5d1: 0x0040, 0x5d2: 0x0040, 0x5d3: 0x0008, 0x5d4: 0x0008, 0x5d5: 0x0008, 0x5d6: 0x0008, 0x5d7: 0x0008, 0x5d8: 0x0008, 0x5d9: 0x0008, 0x5da: 0x0008, 0x5db: 0x0008, 0x5dc: 0x0008, 0x5dd: 0x0008, 0x5de: 0x0008, 0x5df: 0x0008, 0x5e0: 0x0008, 0x5e1: 0x0008, 0x5e2: 0x0008, 0x5e3: 0x0008, 0x5e4: 0x0008, 0x5e5: 0x0008, 0x5e6: 0x0008, 0x5e7: 0x0008, 0x5e8: 0x0008, 0x5e9: 0x0040, 0x5ea: 0x0008, 0x5eb: 0x0008, 0x5ec: 0x0008, 0x5ed: 0x0008, 0x5ee: 0x0008, 0x5ef: 0x0008, 0x5f0: 0x0008, 0x5f1: 0x0040, 0x5f2: 0x0008, 0x5f3: 0x0040, 0x5f4: 0x0040, 0x5f5: 0x0040, 0x5f6: 0x0008, 0x5f7: 0x0008, 0x5f8: 0x0008, 0x5f9: 0x0008, 0x5fa: 0x0040, 0x5fb: 0x0040, 0x5fc: 0x3308, 0x5fd: 0x0008, 0x5fe: 0x3008, 0x5ff: 0x3008, // Block 0x18, offset 0x600 0x600: 0x3008, 0x601: 0x3308, 0x602: 0x3308, 0x603: 0x3308, 0x604: 0x3308, 0x605: 0x0040, 0x606: 0x0040, 0x607: 0x3008, 0x608: 0x3008, 0x609: 0x0040, 0x60a: 0x0040, 0x60b: 0x3008, 0x60c: 0x3008, 0x60d: 0x3b08, 0x60e: 0x0008, 0x60f: 0x0040, 0x610: 0x0040, 0x611: 0x0040, 0x612: 0x0040, 0x613: 0x0040, 0x614: 0x0040, 0x615: 0x0040, 0x616: 0x0040, 0x617: 0x3008, 0x618: 0x0040, 0x619: 0x0040, 0x61a: 0x0040, 0x61b: 0x0040, 0x61c: 0x0689, 0x61d: 0x06c1, 0x61e: 0x0040, 0x61f: 0x06f9, 0x620: 0x0008, 0x621: 0x0008, 0x622: 0x3308, 0x623: 0x3308, 0x624: 0x0040, 0x625: 0x0040, 0x626: 0x0008, 0x627: 0x0008, 0x628: 0x0008, 0x629: 0x0008, 0x62a: 0x0008, 0x62b: 0x0008, 0x62c: 0x0008, 0x62d: 0x0008, 0x62e: 0x0008, 0x62f: 0x0008, 0x630: 0x0008, 0x631: 0x0008, 0x632: 0x0018, 0x633: 0x0018, 0x634: 0x0018, 0x635: 0x0018, 0x636: 0x0018, 0x637: 0x0018, 0x638: 0x0018, 0x639: 0x0018, 0x63a: 0x0018, 0x63b: 0x0018, 0x63c: 0x0008, 0x63d: 0x0018, 0x63e: 0x3308, 0x63f: 0x0040, // Block 0x19, offset 0x640 0x640: 0x0040, 0x641: 0x3308, 0x642: 0x3308, 0x643: 0x3008, 0x644: 0x0040, 0x645: 0x0008, 0x646: 0x0008, 0x647: 0x0008, 0x648: 0x0008, 0x649: 0x0008, 0x64a: 0x0008, 0x64b: 0x0040, 0x64c: 0x0040, 0x64d: 0x0040, 0x64e: 0x0040, 0x64f: 0x0008, 0x650: 0x0008, 0x651: 0x0040, 0x652: 0x0040, 0x653: 0x0008, 0x654: 0x0008, 0x655: 0x0008, 0x656: 0x0008, 0x657: 0x0008, 0x658: 0x0008, 0x659: 0x0008, 0x65a: 0x0008, 0x65b: 0x0008, 0x65c: 0x0008, 0x65d: 0x0008, 0x65e: 0x0008, 0x65f: 0x0008, 0x660: 0x0008, 0x661: 0x0008, 0x662: 0x0008, 0x663: 0x0008, 0x664: 0x0008, 0x665: 0x0008, 0x666: 0x0008, 0x667: 0x0008, 0x668: 0x0008, 0x669: 0x0040, 0x66a: 0x0008, 0x66b: 0x0008, 0x66c: 0x0008, 0x66d: 0x0008, 0x66e: 0x0008, 0x66f: 0x0008, 0x670: 0x0008, 0x671: 0x0040, 0x672: 0x0008, 0x673: 0x0731, 0x674: 0x0040, 0x675: 0x0008, 0x676: 0x0769, 0x677: 0x0040, 0x678: 0x0008, 0x679: 0x0008, 0x67a: 0x0040, 0x67b: 0x0040, 0x67c: 0x3308, 0x67d: 0x0040, 0x67e: 0x3008, 0x67f: 0x3008, // Block 0x1a, offset 0x680 0x680: 0x3008, 0x681: 0x3308, 0x682: 0x3308, 0x683: 0x0040, 0x684: 0x0040, 0x685: 0x0040, 0x686: 0x0040, 0x687: 0x3308, 0x688: 0x3308, 0x689: 0x0040, 0x68a: 0x0040, 0x68b: 0x3308, 0x68c: 0x3308, 0x68d: 0x3b08, 0x68e: 0x0040, 0x68f: 0x0040, 0x690: 0x0040, 0x691: 0x3308, 0x692: 0x0040, 0x693: 0x0040, 0x694: 0x0040, 0x695: 0x0040, 0x696: 0x0040, 0x697: 0x0040, 0x698: 0x0040, 0x699: 0x07a1, 0x69a: 0x07d9, 0x69b: 0x0811, 0x69c: 0x0008, 0x69d: 0x0040, 0x69e: 0x0849, 0x69f: 0x0040, 0x6a0: 0x0040, 0x6a1: 0x0040, 0x6a2: 0x0040, 0x6a3: 0x0040, 0x6a4: 0x0040, 0x6a5: 0x0040, 0x6a6: 0x0008, 0x6a7: 0x0008, 0x6a8: 0x0008, 0x6a9: 0x0008, 0x6aa: 0x0008, 0x6ab: 0x0008, 0x6ac: 0x0008, 0x6ad: 0x0008, 0x6ae: 0x0008, 0x6af: 0x0008, 0x6b0: 0x3308, 0x6b1: 0x3308, 0x6b2: 0x0008, 0x6b3: 0x0008, 0x6b4: 0x0008, 0x6b5: 0x3308, 0x6b6: 0x0018, 0x6b7: 0x0040, 0x6b8: 0x0040, 0x6b9: 0x0040, 0x6ba: 0x0040, 0x6bb: 0x0040, 0x6bc: 0x0040, 0x6bd: 0x0040, 0x6be: 0x0040, 0x6bf: 0x0040, // Block 0x1b, offset 0x6c0 0x6c0: 0x0040, 0x6c1: 0x3308, 0x6c2: 0x3308, 0x6c3: 0x3008, 0x6c4: 0x0040, 0x6c5: 0x0008, 0x6c6: 0x0008, 0x6c7: 0x0008, 0x6c8: 0x0008, 0x6c9: 0x0008, 0x6ca: 0x0008, 0x6cb: 0x0008, 0x6cc: 0x0008, 0x6cd: 0x0008, 0x6ce: 0x0040, 0x6cf: 0x0008, 0x6d0: 0x0008, 0x6d1: 0x0008, 0x6d2: 0x0040, 0x6d3: 0x0008, 0x6d4: 0x0008, 0x6d5: 0x0008, 0x6d6: 0x0008, 0x6d7: 0x0008, 0x6d8: 0x0008, 0x6d9: 0x0008, 0x6da: 0x0008, 0x6db: 0x0008, 0x6dc: 0x0008, 0x6dd: 0x0008, 0x6de: 0x0008, 0x6df: 0x0008, 0x6e0: 0x0008, 0x6e1: 0x0008, 0x6e2: 0x0008, 0x6e3: 0x0008, 0x6e4: 0x0008, 0x6e5: 0x0008, 0x6e6: 0x0008, 0x6e7: 0x0008, 0x6e8: 0x0008, 0x6e9: 0x0040, 0x6ea: 0x0008, 0x6eb: 0x0008, 0x6ec: 0x0008, 0x6ed: 0x0008, 0x6ee: 0x0008, 0x6ef: 0x0008, 0x6f0: 0x0008, 0x6f1: 0x0040, 0x6f2: 0x0008, 0x6f3: 0x0008, 0x6f4: 0x0040, 0x6f5: 0x0008, 0x6f6: 0x0008, 0x6f7: 0x0008, 0x6f8: 0x0008, 0x6f9: 0x0008, 0x6fa: 0x0040, 0x6fb: 0x0040, 0x6fc: 0x3308, 0x6fd: 0x0008, 0x6fe: 0x3008, 0x6ff: 0x3008, // Block 0x1c, offset 0x700 0x700: 0x3008, 0x701: 0x3308, 0x702: 0x3308, 0x703: 0x3308, 0x704: 0x3308, 0x705: 0x3308, 0x706: 0x0040, 0x707: 0x3308, 0x708: 0x3308, 0x709: 0x3008, 0x70a: 0x0040, 0x70b: 0x3008, 0x70c: 0x3008, 0x70d: 0x3b08, 0x70e: 0x0040, 0x70f: 0x0040, 0x710: 0x0008, 0x711: 0x0040, 0x712: 0x0040, 0x713: 0x0040, 0x714: 0x0040, 0x715: 0x0040, 0x716: 0x0040, 0x717: 0x0040, 0x718: 0x0040, 0x719: 0x0040, 0x71a: 0x0040, 0x71b: 0x0040, 0x71c: 0x0040, 0x71d: 0x0040, 0x71e: 0x0040, 0x71f: 0x0040, 0x720: 0x0008, 0x721: 0x0008, 0x722: 0x3308, 0x723: 0x3308, 0x724: 0x0040, 0x725: 0x0040, 0x726: 0x0008, 0x727: 0x0008, 0x728: 0x0008, 0x729: 0x0008, 0x72a: 0x0008, 0x72b: 0x0008, 0x72c: 0x0008, 0x72d: 0x0008, 0x72e: 0x0008, 0x72f: 0x0008, 0x730: 0x0018, 0x731: 0x0018, 0x732: 0x0040, 0x733: 0x0040, 0x734: 0x0040, 0x735: 0x0040, 0x736: 0x0040, 0x737: 0x0040, 0x738: 0x0040, 0x739: 0x0008, 0x73a: 0x3308, 0x73b: 0x3308, 0x73c: 0x3308, 0x73d: 0x3308, 0x73e: 0x3308, 0x73f: 0x3308, // Block 0x1d, offset 0x740 0x740: 0x0040, 0x741: 0x3308, 0x742: 0x3008, 0x743: 0x3008, 0x744: 0x0040, 0x745: 0x0008, 0x746: 0x0008, 0x747: 0x0008, 0x748: 0x0008, 0x749: 0x0008, 0x74a: 0x0008, 0x74b: 0x0008, 0x74c: 0x0008, 0x74d: 0x0040, 0x74e: 0x0040, 0x74f: 0x0008, 0x750: 0x0008, 0x751: 0x0040, 0x752: 0x0040, 0x753: 0x0008, 0x754: 0x0008, 0x755: 0x0008, 0x756: 0x0008, 0x757: 0x0008, 0x758: 0x0008, 0x759: 0x0008, 0x75a: 0x0008, 0x75b: 0x0008, 0x75c: 0x0008, 0x75d: 0x0008, 0x75e: 0x0008, 0x75f: 0x0008, 0x760: 0x0008, 0x761: 0x0008, 0x762: 0x0008, 0x763: 0x0008, 0x764: 0x0008, 0x765: 0x0008, 0x766: 0x0008, 0x767: 0x0008, 0x768: 0x0008, 0x769: 0x0040, 0x76a: 0x0008, 0x76b: 0x0008, 0x76c: 0x0008, 0x76d: 0x0008, 0x76e: 0x0008, 0x76f: 0x0008, 0x770: 0x0008, 0x771: 0x0040, 0x772: 0x0008, 0x773: 0x0008, 0x774: 0x0040, 0x775: 0x0008, 0x776: 0x0008, 0x777: 0x0008, 0x778: 0x0008, 0x779: 0x0008, 0x77a: 0x0040, 0x77b: 0x0040, 0x77c: 0x3308, 0x77d: 0x0008, 0x77e: 0x3008, 0x77f: 0x3308, // Block 0x1e, offset 0x780 0x780: 0x3008, 0x781: 0x3308, 0x782: 0x3308, 0x783: 0x3308, 0x784: 0x3308, 0x785: 0x0040, 0x786: 0x0040, 0x787: 0x3008, 0x788: 0x3008, 0x789: 0x0040, 0x78a: 0x0040, 0x78b: 0x3008, 0x78c: 0x3008, 0x78d: 0x3b08, 0x78e: 0x0040, 0x78f: 0x0040, 0x790: 0x0040, 0x791: 0x0040, 0x792: 0x0040, 0x793: 0x0040, 0x794: 0x0040, 0x795: 0x0040, 0x796: 0x3308, 0x797: 0x3008, 0x798: 0x0040, 0x799: 0x0040, 0x79a: 0x0040, 0x79b: 0x0040, 0x79c: 0x0881, 0x79d: 0x08b9, 0x79e: 0x0040, 0x79f: 0x0008, 0x7a0: 0x0008, 0x7a1: 0x0008, 0x7a2: 0x3308, 0x7a3: 0x3308, 0x7a4: 0x0040, 0x7a5: 0x0040, 0x7a6: 0x0008, 0x7a7: 0x0008, 0x7a8: 0x0008, 0x7a9: 0x0008, 0x7aa: 0x0008, 0x7ab: 0x0008, 0x7ac: 0x0008, 0x7ad: 0x0008, 0x7ae: 0x0008, 0x7af: 0x0008, 0x7b0: 0x0018, 0x7b1: 0x0008, 0x7b2: 0x0018, 0x7b3: 0x0018, 0x7b4: 0x0018, 0x7b5: 0x0018, 0x7b6: 0x0018, 0x7b7: 0x0018, 0x7b8: 0x0040, 0x7b9: 0x0040, 0x7ba: 0x0040, 0x7bb: 0x0040, 0x7bc: 0x0040, 0x7bd: 0x0040, 0x7be: 0x0040, 0x7bf: 0x0040, // Block 0x1f, offset 0x7c0 0x7c0: 0x0040, 0x7c1: 0x0040, 0x7c2: 0x3308, 0x7c3: 0x0008, 0x7c4: 0x0040, 0x7c5: 0x0008, 0x7c6: 0x0008, 0x7c7: 0x0008, 0x7c8: 0x0008, 0x7c9: 0x0008, 0x7ca: 0x0008, 0x7cb: 0x0040, 0x7cc: 0x0040, 0x7cd: 0x0040, 0x7ce: 0x0008, 0x7cf: 0x0008, 0x7d0: 0x0008, 0x7d1: 0x0040, 0x7d2: 0x0008, 0x7d3: 0x0008, 0x7d4: 0x0008, 0x7d5: 0x0008, 0x7d6: 0x0040, 0x7d7: 0x0040, 0x7d8: 0x0040, 0x7d9: 0x0008, 0x7da: 0x0008, 0x7db: 0x0040, 0x7dc: 0x0008, 0x7dd: 0x0040, 0x7de: 0x0008, 0x7df: 0x0008, 0x7e0: 0x0040, 0x7e1: 0x0040, 0x7e2: 0x0040, 0x7e3: 0x0008, 0x7e4: 0x0008, 0x7e5: 0x0040, 0x7e6: 0x0040, 0x7e7: 0x0040, 0x7e8: 0x0008, 0x7e9: 0x0008, 0x7ea: 0x0008, 0x7eb: 0x0040, 0x7ec: 0x0040, 0x7ed: 0x0040, 0x7ee: 0x0008, 0x7ef: 0x0008, 0x7f0: 0x0008, 0x7f1: 0x0008, 0x7f2: 0x0008, 0x7f3: 0x0008, 0x7f4: 0x0008, 0x7f5: 0x0008, 0x7f6: 0x0008, 0x7f7: 0x0008, 0x7f8: 0x0008, 0x7f9: 0x0008, 0x7fa: 0x0040, 0x7fb: 0x0040, 0x7fc: 0x0040, 0x7fd: 0x0040, 0x7fe: 0x3008, 0x7ff: 0x3008, // Block 0x20, offset 0x800 0x800: 0x3308, 0x801: 0x3008, 0x802: 0x3008, 0x803: 0x3008, 0x804: 0x3008, 0x805: 0x0040, 0x806: 0x3308, 0x807: 0x3308, 0x808: 0x3308, 0x809: 0x0040, 0x80a: 0x3308, 0x80b: 0x3308, 0x80c: 0x3308, 0x80d: 0x3b08, 0x80e: 0x0040, 0x80f: 0x0040, 0x810: 0x0040, 0x811: 0x0040, 0x812: 0x0040, 0x813: 0x0040, 0x814: 0x0040, 0x815: 0x3308, 0x816: 0x3308, 0x817: 0x0040, 0x818: 0x0008, 0x819: 0x0008, 0x81a: 0x0008, 0x81b: 0x0040, 0x81c: 0x0040, 0x81d: 0x0040, 0x81e: 0x0040, 0x81f: 0x0040, 0x820: 0x0008, 0x821: 0x0008, 0x822: 0x3308, 0x823: 0x3308, 0x824: 0x0040, 0x825: 0x0040, 0x826: 0x0008, 0x827: 0x0008, 0x828: 0x0008, 0x829: 0x0008, 0x82a: 0x0008, 0x82b: 0x0008, 0x82c: 0x0008, 0x82d: 0x0008, 0x82e: 0x0008, 0x82f: 0x0008, 0x830: 0x0040, 0x831: 0x0040, 0x832: 0x0040, 0x833: 0x0040, 0x834: 0x0040, 0x835: 0x0040, 0x836: 0x0040, 0x837: 0x0018, 0x838: 0x0018, 0x839: 0x0018, 0x83a: 0x0018, 0x83b: 0x0018, 0x83c: 0x0018, 0x83d: 0x0018, 0x83e: 0x0018, 0x83f: 0x0018, // Block 0x21, offset 0x840 0x840: 0x0008, 0x841: 0x3308, 0x842: 0x3008, 0x843: 0x3008, 0x844: 0x0018, 0x845: 0x0008, 0x846: 0x0008, 0x847: 0x0008, 0x848: 0x0008, 0x849: 0x0008, 0x84a: 0x0008, 0x84b: 0x0008, 0x84c: 0x0008, 0x84d: 0x0040, 0x84e: 0x0008, 0x84f: 0x0008, 0x850: 0x0008, 0x851: 0x0040, 0x852: 0x0008, 0x853: 0x0008, 0x854: 0x0008, 0x855: 0x0008, 0x856: 0x0008, 0x857: 0x0008, 0x858: 0x0008, 0x859: 0x0008, 0x85a: 0x0008, 0x85b: 0x0008, 0x85c: 0x0008, 0x85d: 0x0008, 0x85e: 0x0008, 0x85f: 0x0008, 0x860: 0x0008, 0x861: 0x0008, 0x862: 0x0008, 0x863: 0x0008, 0x864: 0x0008, 0x865: 0x0008, 0x866: 0x0008, 0x867: 0x0008, 0x868: 0x0008, 0x869: 0x0040, 0x86a: 0x0008, 0x86b: 0x0008, 0x86c: 0x0008, 0x86d: 0x0008, 0x86e: 0x0008, 0x86f: 0x0008, 0x870: 0x0008, 0x871: 0x0008, 0x872: 0x0008, 0x873: 0x0008, 0x874: 0x0040, 0x875: 0x0008, 0x876: 0x0008, 0x877: 0x0008, 0x878: 0x0008, 0x879: 0x0008, 0x87a: 0x0040, 0x87b: 0x0040, 0x87c: 0x3308, 0x87d: 0x0008, 0x87e: 0x3008, 0x87f: 0x3308, // Block 0x22, offset 0x880 0x880: 0x3008, 0x881: 0x3008, 0x882: 0x3008, 0x883: 0x3008, 0x884: 0x3008, 0x885: 0x0040, 0x886: 0x3308, 0x887: 0x3008, 0x888: 0x3008, 0x889: 0x0040, 0x88a: 0x3008, 0x88b: 0x3008, 0x88c: 0x3308, 0x88d: 0x3b08, 0x88e: 0x0040, 0x88f: 0x0040, 0x890: 0x0040, 0x891: 0x0040, 0x892: 0x0040, 0x893: 0x0040, 0x894: 0x0040, 0x895: 0x3008, 0x896: 0x3008, 0x897: 0x0040, 0x898: 0x0040, 0x899: 0x0040, 0x89a: 0x0040, 0x89b: 0x0040, 0x89c: 0x0040, 0x89d: 0x0040, 0x89e: 0x0008, 0x89f: 0x0040, 0x8a0: 0x0008, 0x8a1: 0x0008, 0x8a2: 0x3308, 0x8a3: 0x3308, 0x8a4: 0x0040, 0x8a5: 0x0040, 0x8a6: 0x0008, 0x8a7: 0x0008, 0x8a8: 0x0008, 0x8a9: 0x0008, 0x8aa: 0x0008, 0x8ab: 0x0008, 0x8ac: 0x0008, 0x8ad: 0x0008, 0x8ae: 0x0008, 0x8af: 0x0008, 0x8b0: 0x0040, 0x8b1: 0x0008, 0x8b2: 0x0008, 0x8b3: 0x0040, 0x8b4: 0x0040, 0x8b5: 0x0040, 0x8b6: 0x0040, 0x8b7: 0x0040, 0x8b8: 0x0040, 0x8b9: 0x0040, 0x8ba: 0x0040, 0x8bb: 0x0040, 0x8bc: 0x0040, 0x8bd: 0x0040, 0x8be: 0x0040, 0x8bf: 0x0040, // Block 0x23, offset 0x8c0 0x8c0: 0x3008, 0x8c1: 0x3308, 0x8c2: 0x3308, 0x8c3: 0x3308, 0x8c4: 0x3308, 0x8c5: 0x0040, 0x8c6: 0x3008, 0x8c7: 0x3008, 0x8c8: 0x3008, 0x8c9: 0x0040, 0x8ca: 0x3008, 0x8cb: 0x3008, 0x8cc: 0x3008, 0x8cd: 0x3b08, 0x8ce: 0x0008, 0x8cf: 0x0018, 0x8d0: 0x0040, 0x8d1: 0x0040, 0x8d2: 0x0040, 0x8d3: 0x0040, 0x8d4: 0x0008, 0x8d5: 0x0008, 0x8d6: 0x0008, 0x8d7: 0x3008, 0x8d8: 0x0018, 0x8d9: 0x0018, 0x8da: 0x0018, 0x8db: 0x0018, 0x8dc: 0x0018, 0x8dd: 0x0018, 0x8de: 0x0018, 0x8df: 0x0008, 0x8e0: 0x0008, 0x8e1: 0x0008, 0x8e2: 0x3308, 0x8e3: 0x3308, 0x8e4: 0x0040, 0x8e5: 0x0040, 0x8e6: 0x0008, 0x8e7: 0x0008, 0x8e8: 0x0008, 0x8e9: 0x0008, 0x8ea: 0x0008, 0x8eb: 0x0008, 0x8ec: 0x0008, 0x8ed: 0x0008, 0x8ee: 0x0008, 0x8ef: 0x0008, 0x8f0: 0x0018, 0x8f1: 0x0018, 0x8f2: 0x0018, 0x8f3: 0x0018, 0x8f4: 0x0018, 0x8f5: 0x0018, 0x8f6: 0x0018, 0x8f7: 0x0018, 0x8f8: 0x0018, 0x8f9: 0x0018, 0x8fa: 0x0008, 0x8fb: 0x0008, 0x8fc: 0x0008, 0x8fd: 0x0008, 0x8fe: 0x0008, 0x8ff: 0x0008, // Block 0x24, offset 0x900 0x900: 0x0040, 0x901: 0x0008, 0x902: 0x0008, 0x903: 0x0040, 0x904: 0x0008, 0x905: 0x0040, 0x906: 0x0008, 0x907: 0x0008, 0x908: 0x0008, 0x909: 0x0008, 0x90a: 0x0008, 0x90b: 0x0040, 0x90c: 0x0008, 0x90d: 0x0008, 0x90e: 0x0008, 0x90f: 0x0008, 0x910: 0x0008, 0x911: 0x0008, 0x912: 0x0008, 0x913: 0x0008, 0x914: 0x0008, 0x915: 0x0008, 0x916: 0x0008, 0x917: 0x0008, 0x918: 0x0008, 0x919: 0x0008, 0x91a: 0x0008, 0x91b: 0x0008, 0x91c: 0x0008, 0x91d: 0x0008, 0x91e: 0x0008, 0x91f: 0x0008, 0x920: 0x0008, 0x921: 0x0008, 0x922: 0x0008, 0x923: 0x0008, 0x924: 0x0040, 0x925: 0x0008, 0x926: 0x0040, 0x927: 0x0008, 0x928: 0x0008, 0x929: 0x0008, 0x92a: 0x0008, 0x92b: 0x0008, 0x92c: 0x0008, 0x92d: 0x0008, 0x92e: 0x0008, 0x92f: 0x0008, 0x930: 0x0008, 0x931: 0x3308, 0x932: 0x0008, 0x933: 0x0929, 0x934: 0x3308, 0x935: 0x3308, 0x936: 0x3308, 0x937: 0x3308, 0x938: 0x3308, 0x939: 0x3308, 0x93a: 0x3b08, 0x93b: 0x3308, 0x93c: 0x3308, 0x93d: 0x0008, 0x93e: 0x0040, 0x93f: 0x0040, // Block 0x25, offset 0x940 0x940: 0x0008, 0x941: 0x0008, 0x942: 0x0008, 0x943: 0x09d1, 0x944: 0x0008, 0x945: 0x0008, 0x946: 0x0008, 0x947: 0x0008, 0x948: 0x0040, 0x949: 0x0008, 0x94a: 0x0008, 0x94b: 0x0008, 0x94c: 0x0008, 0x94d: 0x0a09, 0x94e: 0x0008, 0x94f: 0x0008, 0x950: 0x0008, 0x951: 0x0008, 0x952: 0x0a41, 0x953: 0x0008, 0x954: 0x0008, 0x955: 0x0008, 0x956: 0x0008, 0x957: 0x0a79, 0x958: 0x0008, 0x959: 0x0008, 0x95a: 0x0008, 0x95b: 0x0008, 0x95c: 0x0ab1, 0x95d: 0x0008, 0x95e: 0x0008, 0x95f: 0x0008, 0x960: 0x0008, 0x961: 0x0008, 0x962: 0x0008, 0x963: 0x0008, 0x964: 0x0008, 0x965: 0x0008, 0x966: 0x0008, 0x967: 0x0008, 0x968: 0x0008, 0x969: 0x0ae9, 0x96a: 0x0008, 0x96b: 0x0008, 0x96c: 0x0008, 0x96d: 0x0040, 0x96e: 0x0040, 0x96f: 0x0040, 0x970: 0x0040, 0x971: 0x3308, 0x972: 0x3308, 0x973: 0x0b21, 0x974: 0x3308, 0x975: 0x0b59, 0x976: 0x0b91, 0x977: 0x0bc9, 0x978: 0x0c19, 0x979: 0x0c51, 0x97a: 0x3308, 0x97b: 0x3308, 0x97c: 0x3308, 0x97d: 0x3308, 0x97e: 0x3308, 0x97f: 0x3008, // Block 0x26, offset 0x980 0x980: 0x3308, 0x981: 0x0ca1, 0x982: 0x3308, 0x983: 0x3308, 0x984: 0x3b08, 0x985: 0x0018, 0x986: 0x3308, 0x987: 0x3308, 0x988: 0x0008, 0x989: 0x0008, 0x98a: 0x0008, 0x98b: 0x0008, 0x98c: 0x0008, 0x98d: 0x3308, 0x98e: 0x3308, 0x98f: 0x3308, 0x990: 0x3308, 0x991: 0x3308, 0x992: 0x3308, 0x993: 0x0cd9, 0x994: 0x3308, 0x995: 0x3308, 0x996: 0x3308, 0x997: 0x3308, 0x998: 0x0040, 0x999: 0x3308, 0x99a: 0x3308, 0x99b: 0x3308, 0x99c: 0x3308, 0x99d: 0x0d11, 0x99e: 0x3308, 0x99f: 0x3308, 0x9a0: 0x3308, 0x9a1: 0x3308, 0x9a2: 0x0d49, 0x9a3: 0x3308, 0x9a4: 0x3308, 0x9a5: 0x3308, 0x9a6: 0x3308, 0x9a7: 0x0d81, 0x9a8: 0x3308, 0x9a9: 0x3308, 0x9aa: 0x3308, 0x9ab: 0x3308, 0x9ac: 0x0db9, 0x9ad: 0x3308, 0x9ae: 0x3308, 0x9af: 0x3308, 0x9b0: 0x3308, 0x9b1: 0x3308, 0x9b2: 0x3308, 0x9b3: 0x3308, 0x9b4: 0x3308, 0x9b5: 0x3308, 0x9b6: 0x3308, 0x9b7: 0x3308, 0x9b8: 0x3308, 0x9b9: 0x0df1, 0x9ba: 0x3308, 0x9bb: 0x3308, 0x9bc: 0x3308, 0x9bd: 0x0040, 0x9be: 0x0018, 0x9bf: 0x0018, // Block 0x27, offset 0x9c0 0x9c0: 0x0008, 0x9c1: 0x0008, 0x9c2: 0x0008, 0x9c3: 0x0008, 0x9c4: 0x0008, 0x9c5: 0x0008, 0x9c6: 0x0008, 0x9c7: 0x0008, 0x9c8: 0x0008, 0x9c9: 0x0008, 0x9ca: 0x0008, 0x9cb: 0x0008, 0x9cc: 0x0008, 0x9cd: 0x0008, 0x9ce: 0x0008, 0x9cf: 0x0008, 0x9d0: 0x0008, 0x9d1: 0x0008, 0x9d2: 0x0008, 0x9d3: 0x0008, 0x9d4: 0x0008, 0x9d5: 0x0008, 0x9d6: 0x0008, 0x9d7: 0x0008, 0x9d8: 0x0008, 0x9d9: 0x0008, 0x9da: 0x0008, 0x9db: 0x0008, 0x9dc: 0x0008, 0x9dd: 0x0008, 0x9de: 0x0008, 0x9df: 0x0008, 0x9e0: 0x0008, 0x9e1: 0x0008, 0x9e2: 0x0008, 0x9e3: 0x0008, 0x9e4: 0x0008, 0x9e5: 0x0008, 0x9e6: 0x0008, 0x9e7: 0x0008, 0x9e8: 0x0008, 0x9e9: 0x0008, 0x9ea: 0x0008, 0x9eb: 0x0008, 0x9ec: 0x0039, 0x9ed: 0x0ed1, 0x9ee: 0x0ee9, 0x9ef: 0x0008, 0x9f0: 0x0ef9, 0x9f1: 0x0f09, 0x9f2: 0x0f19, 0x9f3: 0x0f31, 0x9f4: 0x0249, 0x9f5: 0x0f41, 0x9f6: 0x0259, 0x9f7: 0x0f51, 0x9f8: 0x0359, 0x9f9: 0x0f61, 0x9fa: 0x0f71, 0x9fb: 0x0008, 0x9fc: 0x00d9, 0x9fd: 0x0f81, 0x9fe: 0x0f99, 0x9ff: 0x0269, // Block 0x28, offset 0xa00 0xa00: 0x0fa9, 0xa01: 0x0fb9, 0xa02: 0x0279, 0xa03: 0x0039, 0xa04: 0x0fc9, 0xa05: 0x0fe1, 0xa06: 0x05b5, 0xa07: 0x0ee9, 0xa08: 0x0ef9, 0xa09: 0x0f09, 0xa0a: 0x0ff9, 0xa0b: 0x1011, 0xa0c: 0x1029, 0xa0d: 0x0f31, 0xa0e: 0x0008, 0xa0f: 0x0f51, 0xa10: 0x0f61, 0xa11: 0x1041, 0xa12: 0x00d9, 0xa13: 0x1059, 0xa14: 0x05cd, 0xa15: 0x05cd, 0xa16: 0x0f99, 0xa17: 0x0fa9, 0xa18: 0x0fb9, 0xa19: 0x05b5, 0xa1a: 0x1071, 0xa1b: 0x1089, 0xa1c: 0x05e5, 0xa1d: 0x1099, 0xa1e: 0x10b1, 0xa1f: 0x10c9, 0xa20: 0x10e1, 0xa21: 0x10f9, 0xa22: 0x0f41, 0xa23: 0x0269, 0xa24: 0x0fb9, 0xa25: 0x1089, 0xa26: 0x1099, 0xa27: 0x10b1, 0xa28: 0x1111, 0xa29: 0x10e1, 0xa2a: 0x10f9, 0xa2b: 0x0008, 0xa2c: 0x0008, 0xa2d: 0x0008, 0xa2e: 0x0008, 0xa2f: 0x0008, 0xa30: 0x0008, 0xa31: 0x0008, 0xa32: 0x0008, 0xa33: 0x0008, 0xa34: 0x0008, 0xa35: 0x0008, 0xa36: 0x0008, 0xa37: 0x0008, 0xa38: 0x1129, 0xa39: 0x0008, 0xa3a: 0x0008, 0xa3b: 0x0008, 0xa3c: 0x0008, 0xa3d: 0x0008, 0xa3e: 0x0008, 0xa3f: 0x0008, // Block 0x29, offset 0xa40 0xa40: 0x0008, 0xa41: 0x0008, 0xa42: 0x0008, 0xa43: 0x0008, 0xa44: 0x0008, 0xa45: 0x0008, 0xa46: 0x0008, 0xa47: 0x0008, 0xa48: 0x0008, 0xa49: 0x0008, 0xa4a: 0x0008, 0xa4b: 0x0008, 0xa4c: 0x0008, 0xa4d: 0x0008, 0xa4e: 0x0008, 0xa4f: 0x0008, 0xa50: 0x0008, 0xa51: 0x0008, 0xa52: 0x0008, 0xa53: 0x0008, 0xa54: 0x0008, 0xa55: 0x0008, 0xa56: 0x0008, 0xa57: 0x0008, 0xa58: 0x0008, 0xa59: 0x0008, 0xa5a: 0x0008, 0xa5b: 0x1141, 0xa5c: 0x1159, 0xa5d: 0x1169, 0xa5e: 0x1181, 0xa5f: 0x1029, 0xa60: 0x1199, 0xa61: 0x11a9, 0xa62: 0x11c1, 0xa63: 0x11d9, 0xa64: 0x11f1, 0xa65: 0x1209, 0xa66: 0x1221, 0xa67: 0x05fd, 0xa68: 0x1239, 0xa69: 0x1251, 0xa6a: 0xe17d, 0xa6b: 0x1269, 0xa6c: 0x1281, 0xa6d: 0x1299, 0xa6e: 0x12b1, 0xa6f: 0x12c9, 0xa70: 0x12e1, 0xa71: 0x12f9, 0xa72: 0x1311, 0xa73: 0x1329, 0xa74: 0x1341, 0xa75: 0x1359, 0xa76: 0x1371, 0xa77: 0x1389, 0xa78: 0x0615, 0xa79: 0x13a1, 0xa7a: 0x13b9, 0xa7b: 0x13d1, 0xa7c: 0x13e1, 0xa7d: 0x13f9, 0xa7e: 0x1411, 0xa7f: 0x1429, // Block 0x2a, offset 0xa80 0xa80: 0xe00d, 0xa81: 0x0008, 0xa82: 0xe00d, 0xa83: 0x0008, 0xa84: 0xe00d, 0xa85: 0x0008, 0xa86: 0xe00d, 0xa87: 0x0008, 0xa88: 0xe00d, 0xa89: 0x0008, 0xa8a: 0xe00d, 0xa8b: 0x0008, 0xa8c: 0xe00d, 0xa8d: 0x0008, 0xa8e: 0xe00d, 0xa8f: 0x0008, 0xa90: 0xe00d, 0xa91: 0x0008, 0xa92: 0xe00d, 0xa93: 0x0008, 0xa94: 0xe00d, 0xa95: 0x0008, 0xa96: 0xe00d, 0xa97: 0x0008, 0xa98: 0xe00d, 0xa99: 0x0008, 0xa9a: 0xe00d, 0xa9b: 0x0008, 0xa9c: 0xe00d, 0xa9d: 0x0008, 0xa9e: 0xe00d, 0xa9f: 0x0008, 0xaa0: 0xe00d, 0xaa1: 0x0008, 0xaa2: 0xe00d, 0xaa3: 0x0008, 0xaa4: 0xe00d, 0xaa5: 0x0008, 0xaa6: 0xe00d, 0xaa7: 0x0008, 0xaa8: 0xe00d, 0xaa9: 0x0008, 0xaaa: 0xe00d, 0xaab: 0x0008, 0xaac: 0xe00d, 0xaad: 0x0008, 0xaae: 0xe00d, 0xaaf: 0x0008, 0xab0: 0xe00d, 0xab1: 0x0008, 0xab2: 0xe00d, 0xab3: 0x0008, 0xab4: 0xe00d, 0xab5: 0x0008, 0xab6: 0xe00d, 0xab7: 0x0008, 0xab8: 0xe00d, 0xab9: 0x0008, 0xaba: 0xe00d, 0xabb: 0x0008, 0xabc: 0xe00d, 0xabd: 0x0008, 0xabe: 0xe00d, 0xabf: 0x0008, // Block 0x2b, offset 0xac0 0xac0: 0xe00d, 0xac1: 0x0008, 0xac2: 0xe00d, 0xac3: 0x0008, 0xac4: 0xe00d, 0xac5: 0x0008, 0xac6: 0xe00d, 0xac7: 0x0008, 0xac8: 0xe00d, 0xac9: 0x0008, 0xaca: 0xe00d, 0xacb: 0x0008, 0xacc: 0xe00d, 0xacd: 0x0008, 0xace: 0xe00d, 0xacf: 0x0008, 0xad0: 0xe00d, 0xad1: 0x0008, 0xad2: 0xe00d, 0xad3: 0x0008, 0xad4: 0xe00d, 0xad5: 0x0008, 0xad6: 0x0008, 0xad7: 0x0008, 0xad8: 0x0008, 0xad9: 0x0008, 0xada: 0x062d, 0xadb: 0x064d, 0xadc: 0x0008, 0xadd: 0x0008, 0xade: 0x1441, 0xadf: 0x0008, 0xae0: 0xe00d, 0xae1: 0x0008, 0xae2: 0xe00d, 0xae3: 0x0008, 0xae4: 0xe00d, 0xae5: 0x0008, 0xae6: 0xe00d, 0xae7: 0x0008, 0xae8: 0xe00d, 0xae9: 0x0008, 0xaea: 0xe00d, 0xaeb: 0x0008, 0xaec: 0xe00d, 0xaed: 0x0008, 0xaee: 0xe00d, 0xaef: 0x0008, 0xaf0: 0xe00d, 0xaf1: 0x0008, 0xaf2: 0xe00d, 0xaf3: 0x0008, 0xaf4: 0xe00d, 0xaf5: 0x0008, 0xaf6: 0xe00d, 0xaf7: 0x0008, 0xaf8: 0xe00d, 0xaf9: 0x0008, 0xafa: 0xe00d, 0xafb: 0x0008, 0xafc: 0xe00d, 0xafd: 0x0008, 0xafe: 0xe00d, 0xaff: 0x0008, // Block 0x2c, offset 0xb00 0xb00: 0x0008, 0xb01: 0x0008, 0xb02: 0x0008, 0xb03: 0x0008, 0xb04: 0x0008, 0xb05: 0x0008, 0xb06: 0x0040, 0xb07: 0x0040, 0xb08: 0xe045, 0xb09: 0xe045, 0xb0a: 0xe045, 0xb0b: 0xe045, 0xb0c: 0xe045, 0xb0d: 0xe045, 0xb0e: 0x0040, 0xb0f: 0x0040, 0xb10: 0x0008, 0xb11: 0x0008, 0xb12: 0x0008, 0xb13: 0x0008, 0xb14: 0x0008, 0xb15: 0x0008, 0xb16: 0x0008, 0xb17: 0x0008, 0xb18: 0x0040, 0xb19: 0xe045, 0xb1a: 0x0040, 0xb1b: 0xe045, 0xb1c: 0x0040, 0xb1d: 0xe045, 0xb1e: 0x0040, 0xb1f: 0xe045, 0xb20: 0x0008, 0xb21: 0x0008, 0xb22: 0x0008, 0xb23: 0x0008, 0xb24: 0x0008, 0xb25: 0x0008, 0xb26: 0x0008, 0xb27: 0x0008, 0xb28: 0xe045, 0xb29: 0xe045, 0xb2a: 0xe045, 0xb2b: 0xe045, 0xb2c: 0xe045, 0xb2d: 0xe045, 0xb2e: 0xe045, 0xb2f: 0xe045, 0xb30: 0x0008, 0xb31: 0x1459, 0xb32: 0x0008, 0xb33: 0x1471, 0xb34: 0x0008, 0xb35: 0x1489, 0xb36: 0x0008, 0xb37: 0x14a1, 0xb38: 0x0008, 0xb39: 0x14b9, 0xb3a: 0x0008, 0xb3b: 0x14d1, 0xb3c: 0x0008, 0xb3d: 0x14e9, 0xb3e: 0x0040, 0xb3f: 0x0040, // Block 0x2d, offset 0xb40 0xb40: 0x1501, 0xb41: 0x1531, 0xb42: 0x1561, 0xb43: 0x1591, 0xb44: 0x15c1, 0xb45: 0x15f1, 0xb46: 0x1621, 0xb47: 0x1651, 0xb48: 0x1501, 0xb49: 0x1531, 0xb4a: 0x1561, 0xb4b: 0x1591, 0xb4c: 0x15c1, 0xb4d: 0x15f1, 0xb4e: 0x1621, 0xb4f: 0x1651, 0xb50: 0x1681, 0xb51: 0x16b1, 0xb52: 0x16e1, 0xb53: 0x1711, 0xb54: 0x1741, 0xb55: 0x1771, 0xb56: 0x17a1, 0xb57: 0x17d1, 0xb58: 0x1681, 0xb59: 0x16b1, 0xb5a: 0x16e1, 0xb5b: 0x1711, 0xb5c: 0x1741, 0xb5d: 0x1771, 0xb5e: 0x17a1, 0xb5f: 0x17d1, 0xb60: 0x1801, 0xb61: 0x1831, 0xb62: 0x1861, 0xb63: 0x1891, 0xb64: 0x18c1, 0xb65: 0x18f1, 0xb66: 0x1921, 0xb67: 0x1951, 0xb68: 0x1801, 0xb69: 0x1831, 0xb6a: 0x1861, 0xb6b: 0x1891, 0xb6c: 0x18c1, 0xb6d: 0x18f1, 0xb6e: 0x1921, 0xb6f: 0x1951, 0xb70: 0x0008, 0xb71: 0x0008, 0xb72: 0x1981, 0xb73: 0x19b1, 0xb74: 0x19d9, 0xb75: 0x0040, 0xb76: 0x0008, 0xb77: 0x1a01, 0xb78: 0xe045, 0xb79: 0xe045, 0xb7a: 0x0665, 0xb7b: 0x1459, 0xb7c: 0x19b1, 0xb7d: 0x067e, 0xb7e: 0x1a31, 0xb7f: 0x069e, // Block 0x2e, offset 0xb80 0xb80: 0x06be, 0xb81: 0x1a4a, 0xb82: 0x1a79, 0xb83: 0x1aa9, 0xb84: 0x1ad1, 0xb85: 0x0040, 0xb86: 0x0008, 0xb87: 0x1af9, 0xb88: 0x06dd, 0xb89: 0x1471, 0xb8a: 0x06f5, 0xb8b: 0x1489, 0xb8c: 0x1aa9, 0xb8d: 0x1b2a, 0xb8e: 0x1b5a, 0xb8f: 0x1b8a, 0xb90: 0x0008, 0xb91: 0x0008, 0xb92: 0x0008, 0xb93: 0x1bb9, 0xb94: 0x0040, 0xb95: 0x0040, 0xb96: 0x0008, 0xb97: 0x0008, 0xb98: 0xe045, 0xb99: 0xe045, 0xb9a: 0x070d, 0xb9b: 0x14a1, 0xb9c: 0x0040, 0xb9d: 0x1bd2, 0xb9e: 0x1c02, 0xb9f: 0x1c32, 0xba0: 0x0008, 0xba1: 0x0008, 0xba2: 0x0008, 0xba3: 0x1c61, 0xba4: 0x0008, 0xba5: 0x0008, 0xba6: 0x0008, 0xba7: 0x0008, 0xba8: 0xe045, 0xba9: 0xe045, 0xbaa: 0x0725, 0xbab: 0x14d1, 0xbac: 0xe04d, 0xbad: 0x1c7a, 0xbae: 0x03d2, 0xbaf: 0x1caa, 0xbb0: 0x0040, 0xbb1: 0x0040, 0xbb2: 0x1cb9, 0xbb3: 0x1ce9, 0xbb4: 0x1d11, 0xbb5: 0x0040, 0xbb6: 0x0008, 0xbb7: 0x1d39, 0xbb8: 0x073d, 0xbb9: 0x14b9, 0xbba: 0x0515, 0xbbb: 0x14e9, 0xbbc: 0x1ce9, 0xbbd: 0x0756, 0xbbe: 0x0776, 0xbbf: 0x0040, // Block 0x2f, offset 0xbc0 0xbc0: 0x000a, 0xbc1: 0x000a, 0xbc2: 0x000a, 0xbc3: 0x000a, 0xbc4: 0x000a, 0xbc5: 0x000a, 0xbc6: 0x000a, 0xbc7: 0x000a, 0xbc8: 0x000a, 0xbc9: 0x000a, 0xbca: 0x000a, 0xbcb: 0x03c0, 0xbcc: 0x0003, 0xbcd: 0x0003, 0xbce: 0x0340, 0xbcf: 0x0b40, 0xbd0: 0x0018, 0xbd1: 0xe00d, 0xbd2: 0x0018, 0xbd3: 0x0018, 0xbd4: 0x0018, 0xbd5: 0x0018, 0xbd6: 0x0018, 0xbd7: 0x0796, 0xbd8: 0x0018, 0xbd9: 0x0018, 0xbda: 0x0018, 0xbdb: 0x0018, 0xbdc: 0x0018, 0xbdd: 0x0018, 0xbde: 0x0018, 0xbdf: 0x0018, 0xbe0: 0x0018, 0xbe1: 0x0018, 0xbe2: 0x0018, 0xbe3: 0x0018, 0xbe4: 0x0040, 0xbe5: 0x0040, 0xbe6: 0x0040, 0xbe7: 0x0018, 0xbe8: 0x0040, 0xbe9: 0x0040, 0xbea: 0x0340, 0xbeb: 0x0340, 0xbec: 0x0340, 0xbed: 0x0340, 0xbee: 0x0340, 0xbef: 0x000a, 0xbf0: 0x0018, 0xbf1: 0x0018, 0xbf2: 0x0018, 0xbf3: 0x1d69, 0xbf4: 0x1da1, 0xbf5: 0x0018, 0xbf6: 0x1df1, 0xbf7: 0x1e29, 0xbf8: 0x0018, 0xbf9: 0x0018, 0xbfa: 0x0018, 0xbfb: 0x0018, 0xbfc: 0x1e7a, 0xbfd: 0x0018, 0xbfe: 0x07b6, 0xbff: 0x0018, // Block 0x30, offset 0xc00 0xc00: 0x0018, 0xc01: 0x0018, 0xc02: 0x0018, 0xc03: 0x0018, 0xc04: 0x0018, 0xc05: 0x0018, 0xc06: 0x0018, 0xc07: 0x1e92, 0xc08: 0x1eaa, 0xc09: 0x1ec2, 0xc0a: 0x0018, 0xc0b: 0x0018, 0xc0c: 0x0018, 0xc0d: 0x0018, 0xc0e: 0x0018, 0xc0f: 0x0018, 0xc10: 0x0018, 0xc11: 0x0018, 0xc12: 0x0018, 0xc13: 0x0018, 0xc14: 0x0018, 0xc15: 0x0018, 0xc16: 0x0018, 0xc17: 0x1ed9, 0xc18: 0x0018, 0xc19: 0x0018, 0xc1a: 0x0018, 0xc1b: 0x0018, 0xc1c: 0x0018, 0xc1d: 0x0018, 0xc1e: 0x0018, 0xc1f: 0x000a, 0xc20: 0x03c0, 0xc21: 0x0340, 0xc22: 0x0340, 0xc23: 0x0340, 0xc24: 0x03c0, 0xc25: 0x0040, 0xc26: 0x0040, 0xc27: 0x0040, 0xc28: 0x0040, 0xc29: 0x0040, 0xc2a: 0x0340, 0xc2b: 0x0340, 0xc2c: 0x0340, 0xc2d: 0x0340, 0xc2e: 0x0340, 0xc2f: 0x0340, 0xc30: 0x1f41, 0xc31: 0x0f41, 0xc32: 0x0040, 0xc33: 0x0040, 0xc34: 0x1f51, 0xc35: 0x1f61, 0xc36: 0x1f71, 0xc37: 0x1f81, 0xc38: 0x1f91, 0xc39: 0x1fa1, 0xc3a: 0x1fb2, 0xc3b: 0x07d5, 0xc3c: 0x1fc2, 0xc3d: 0x1fd2, 0xc3e: 0x1fe2, 0xc3f: 0x0f71, // Block 0x31, offset 0xc40 0xc40: 0x1f41, 0xc41: 0x00c9, 0xc42: 0x0069, 0xc43: 0x0079, 0xc44: 0x1f51, 0xc45: 0x1f61, 0xc46: 0x1f71, 0xc47: 0x1f81, 0xc48: 0x1f91, 0xc49: 0x1fa1, 0xc4a: 0x1fb2, 0xc4b: 0x07ed, 0xc4c: 0x1fc2, 0xc4d: 0x1fd2, 0xc4e: 0x1fe2, 0xc4f: 0x0040, 0xc50: 0x0039, 0xc51: 0x0f09, 0xc52: 0x00d9, 0xc53: 0x0369, 0xc54: 0x0ff9, 0xc55: 0x0249, 0xc56: 0x0f51, 0xc57: 0x0359, 0xc58: 0x0f61, 0xc59: 0x0f71, 0xc5a: 0x0f99, 0xc5b: 0x01d9, 0xc5c: 0x0fa9, 0xc5d: 0x0040, 0xc5e: 0x0040, 0xc5f: 0x0040, 0xc60: 0x0018, 0xc61: 0x0018, 0xc62: 0x0018, 0xc63: 0x0018, 0xc64: 0x0018, 0xc65: 0x0018, 0xc66: 0x0018, 0xc67: 0x0018, 0xc68: 0x1ff1, 0xc69: 0x0018, 0xc6a: 0x0018, 0xc6b: 0x0018, 0xc6c: 0x0018, 0xc6d: 0x0018, 0xc6e: 0x0018, 0xc6f: 0x0018, 0xc70: 0x0018, 0xc71: 0x0018, 0xc72: 0x0018, 0xc73: 0x0018, 0xc74: 0x0018, 0xc75: 0x0018, 0xc76: 0x0018, 0xc77: 0x0018, 0xc78: 0x0018, 0xc79: 0x0018, 0xc7a: 0x0018, 0xc7b: 0x0018, 0xc7c: 0x0018, 0xc7d: 0x0018, 0xc7e: 0x0018, 0xc7f: 0x0018, // Block 0x32, offset 0xc80 0xc80: 0x0806, 0xc81: 0x0826, 0xc82: 0x1159, 0xc83: 0x0845, 0xc84: 0x0018, 0xc85: 0x0866, 0xc86: 0x0886, 0xc87: 0x1011, 0xc88: 0x0018, 0xc89: 0x08a5, 0xc8a: 0x0f31, 0xc8b: 0x0249, 0xc8c: 0x0249, 0xc8d: 0x0249, 0xc8e: 0x0249, 0xc8f: 0x2009, 0xc90: 0x0f41, 0xc91: 0x0f41, 0xc92: 0x0359, 0xc93: 0x0359, 0xc94: 0x0018, 0xc95: 0x0f71, 0xc96: 0x2021, 0xc97: 0x0018, 0xc98: 0x0018, 0xc99: 0x0f99, 0xc9a: 0x2039, 0xc9b: 0x0269, 0xc9c: 0x0269, 0xc9d: 0x0269, 0xc9e: 0x0018, 0xc9f: 0x0018, 0xca0: 0x2049, 0xca1: 0x08c5, 0xca2: 0x2061, 0xca3: 0x0018, 0xca4: 0x13d1, 0xca5: 0x0018, 0xca6: 0x2079, 0xca7: 0x0018, 0xca8: 0x13d1, 0xca9: 0x0018, 0xcaa: 0x0f51, 0xcab: 0x2091, 0xcac: 0x0ee9, 0xcad: 0x1159, 0xcae: 0x0018, 0xcaf: 0x0f09, 0xcb0: 0x0f09, 0xcb1: 0x1199, 0xcb2: 0x0040, 0xcb3: 0x0f61, 0xcb4: 0x00d9, 0xcb5: 0x20a9, 0xcb6: 0x20c1, 0xcb7: 0x20d9, 0xcb8: 0x20f1, 0xcb9: 0x0f41, 0xcba: 0x0018, 0xcbb: 0x08e5, 0xcbc: 0x2109, 0xcbd: 0x10b1, 0xcbe: 0x10b1, 0xcbf: 0x2109, // Block 0x33, offset 0xcc0 0xcc0: 0x0905, 0xcc1: 0x0018, 0xcc2: 0x0018, 0xcc3: 0x0018, 0xcc4: 0x0018, 0xcc5: 0x0ef9, 0xcc6: 0x0ef9, 0xcc7: 0x0f09, 0xcc8: 0x0f41, 0xcc9: 0x0259, 0xcca: 0x0018, 0xccb: 0x0018, 0xccc: 0x0018, 0xccd: 0x0018, 0xcce: 0x0008, 0xccf: 0x0018, 0xcd0: 0x2121, 0xcd1: 0x2151, 0xcd2: 0x2181, 0xcd3: 0x21b9, 0xcd4: 0x21e9, 0xcd5: 0x2219, 0xcd6: 0x2249, 0xcd7: 0x2279, 0xcd8: 0x22a9, 0xcd9: 0x22d9, 0xcda: 0x2309, 0xcdb: 0x2339, 0xcdc: 0x2369, 0xcdd: 0x2399, 0xcde: 0x23c9, 0xcdf: 0x23f9, 0xce0: 0x0f41, 0xce1: 0x2421, 0xce2: 0x091d, 0xce3: 0x2439, 0xce4: 0x1089, 0xce5: 0x2451, 0xce6: 0x093d, 0xce7: 0x2469, 0xce8: 0x2491, 0xce9: 0x0369, 0xcea: 0x24a9, 0xceb: 0x095d, 0xcec: 0x0359, 0xced: 0x1159, 0xcee: 0x0ef9, 0xcef: 0x0f61, 0xcf0: 0x0f41, 0xcf1: 0x2421, 0xcf2: 0x097d, 0xcf3: 0x2439, 0xcf4: 0x1089, 0xcf5: 0x2451, 0xcf6: 0x099d, 0xcf7: 0x2469, 0xcf8: 0x2491, 0xcf9: 0x0369, 0xcfa: 0x24a9, 0xcfb: 0x09bd, 0xcfc: 0x0359, 0xcfd: 0x1159, 0xcfe: 0x0ef9, 0xcff: 0x0f61, // Block 0x34, offset 0xd00 0xd00: 0x0018, 0xd01: 0x0018, 0xd02: 0x0018, 0xd03: 0x0018, 0xd04: 0x0018, 0xd05: 0x0018, 0xd06: 0x0018, 0xd07: 0x0018, 0xd08: 0x0018, 0xd09: 0x0018, 0xd0a: 0x0018, 0xd0b: 0x0040, 0xd0c: 0x0040, 0xd0d: 0x0040, 0xd0e: 0x0040, 0xd0f: 0x0040, 0xd10: 0x0040, 0xd11: 0x0040, 0xd12: 0x0040, 0xd13: 0x0040, 0xd14: 0x0040, 0xd15: 0x0040, 0xd16: 0x0040, 0xd17: 0x0040, 0xd18: 0x0040, 0xd19: 0x0040, 0xd1a: 0x0040, 0xd1b: 0x0040, 0xd1c: 0x0040, 0xd1d: 0x0040, 0xd1e: 0x0040, 0xd1f: 0x0040, 0xd20: 0x00c9, 0xd21: 0x0069, 0xd22: 0x0079, 0xd23: 0x1f51, 0xd24: 0x1f61, 0xd25: 0x1f71, 0xd26: 0x1f81, 0xd27: 0x1f91, 0xd28: 0x1fa1, 0xd29: 0x2601, 0xd2a: 0x2619, 0xd2b: 0x2631, 0xd2c: 0x2649, 0xd2d: 0x2661, 0xd2e: 0x2679, 0xd2f: 0x2691, 0xd30: 0x26a9, 0xd31: 0x26c1, 0xd32: 0x26d9, 0xd33: 0x26f1, 0xd34: 0x0a1e, 0xd35: 0x0a3e, 0xd36: 0x0a5e, 0xd37: 0x0a7e, 0xd38: 0x0a9e, 0xd39: 0x0abe, 0xd3a: 0x0ade, 0xd3b: 0x0afe, 0xd3c: 0x0b1e, 0xd3d: 0x270a, 0xd3e: 0x2732, 0xd3f: 0x275a, // Block 0x35, offset 0xd40 0xd40: 0x2782, 0xd41: 0x27aa, 0xd42: 0x27d2, 0xd43: 0x27fa, 0xd44: 0x2822, 0xd45: 0x284a, 0xd46: 0x2872, 0xd47: 0x289a, 0xd48: 0x0040, 0xd49: 0x0040, 0xd4a: 0x0040, 0xd4b: 0x0040, 0xd4c: 0x0040, 0xd4d: 0x0040, 0xd4e: 0x0040, 0xd4f: 0x0040, 0xd50: 0x0040, 0xd51: 0x0040, 0xd52: 0x0040, 0xd53: 0x0040, 0xd54: 0x0040, 0xd55: 0x0040, 0xd56: 0x0040, 0xd57: 0x0040, 0xd58: 0x0040, 0xd59: 0x0040, 0xd5a: 0x0040, 0xd5b: 0x0040, 0xd5c: 0x0b3e, 0xd5d: 0x0b5e, 0xd5e: 0x0b7e, 0xd5f: 0x0b9e, 0xd60: 0x0bbe, 0xd61: 0x0bde, 0xd62: 0x0bfe, 0xd63: 0x0c1e, 0xd64: 0x0c3e, 0xd65: 0x0c5e, 0xd66: 0x0c7e, 0xd67: 0x0c9e, 0xd68: 0x0cbe, 0xd69: 0x0cde, 0xd6a: 0x0cfe, 0xd6b: 0x0d1e, 0xd6c: 0x0d3e, 0xd6d: 0x0d5e, 0xd6e: 0x0d7e, 0xd6f: 0x0d9e, 0xd70: 0x0dbe, 0xd71: 0x0dde, 0xd72: 0x0dfe, 0xd73: 0x0e1e, 0xd74: 0x0e3e, 0xd75: 0x0e5e, 0xd76: 0x0039, 0xd77: 0x0ee9, 0xd78: 0x1159, 0xd79: 0x0ef9, 0xd7a: 0x0f09, 0xd7b: 0x1199, 0xd7c: 0x0f31, 0xd7d: 0x0249, 0xd7e: 0x0f41, 0xd7f: 0x0259, // Block 0x36, offset 0xd80 0xd80: 0x0f51, 0xd81: 0x0359, 0xd82: 0x0f61, 0xd83: 0x0f71, 0xd84: 0x00d9, 0xd85: 0x0f99, 0xd86: 0x2039, 0xd87: 0x0269, 0xd88: 0x01d9, 0xd89: 0x0fa9, 0xd8a: 0x0fb9, 0xd8b: 0x1089, 0xd8c: 0x0279, 0xd8d: 0x0369, 0xd8e: 0x0289, 0xd8f: 0x13d1, 0xd90: 0x0039, 0xd91: 0x0ee9, 0xd92: 0x1159, 0xd93: 0x0ef9, 0xd94: 0x0f09, 0xd95: 0x1199, 0xd96: 0x0f31, 0xd97: 0x0249, 0xd98: 0x0f41, 0xd99: 0x0259, 0xd9a: 0x0f51, 0xd9b: 0x0359, 0xd9c: 0x0f61, 0xd9d: 0x0f71, 0xd9e: 0x00d9, 0xd9f: 0x0f99, 0xda0: 0x2039, 0xda1: 0x0269, 0xda2: 0x01d9, 0xda3: 0x0fa9, 0xda4: 0x0fb9, 0xda5: 0x1089, 0xda6: 0x0279, 0xda7: 0x0369, 0xda8: 0x0289, 0xda9: 0x13d1, 0xdaa: 0x1f41, 0xdab: 0x0018, 0xdac: 0x0018, 0xdad: 0x0018, 0xdae: 0x0018, 0xdaf: 0x0018, 0xdb0: 0x0018, 0xdb1: 0x0018, 0xdb2: 0x0018, 0xdb3: 0x0018, 0xdb4: 0x0018, 0xdb5: 0x0018, 0xdb6: 0x0018, 0xdb7: 0x0018, 0xdb8: 0x0018, 0xdb9: 0x0018, 0xdba: 0x0018, 0xdbb: 0x0018, 0xdbc: 0x0018, 0xdbd: 0x0018, 0xdbe: 0x0018, 0xdbf: 0x0018, // Block 0x37, offset 0xdc0 0xdc0: 0x0008, 0xdc1: 0x0008, 0xdc2: 0x0008, 0xdc3: 0x0008, 0xdc4: 0x0008, 0xdc5: 0x0008, 0xdc6: 0x0008, 0xdc7: 0x0008, 0xdc8: 0x0008, 0xdc9: 0x0008, 0xdca: 0x0008, 0xdcb: 0x0008, 0xdcc: 0x0008, 0xdcd: 0x0008, 0xdce: 0x0008, 0xdcf: 0x0008, 0xdd0: 0x0008, 0xdd1: 0x0008, 0xdd2: 0x0008, 0xdd3: 0x0008, 0xdd4: 0x0008, 0xdd5: 0x0008, 0xdd6: 0x0008, 0xdd7: 0x0008, 0xdd8: 0x0008, 0xdd9: 0x0008, 0xdda: 0x0008, 0xddb: 0x0008, 0xddc: 0x0008, 0xddd: 0x0008, 0xdde: 0x0008, 0xddf: 0x0040, 0xde0: 0xe00d, 0xde1: 0x0008, 0xde2: 0x2971, 0xde3: 0x0ed5, 0xde4: 0x2989, 0xde5: 0x0008, 0xde6: 0x0008, 0xde7: 0xe07d, 0xde8: 0x0008, 0xde9: 0xe01d, 0xdea: 0x0008, 0xdeb: 0xe03d, 0xdec: 0x0008, 0xded: 0x0fe1, 0xdee: 0x1281, 0xdef: 0x0fc9, 0xdf0: 0x1141, 0xdf1: 0x0008, 0xdf2: 0xe00d, 0xdf3: 0x0008, 0xdf4: 0x0008, 0xdf5: 0xe01d, 0xdf6: 0x0008, 0xdf7: 0x0008, 0xdf8: 0x0008, 0xdf9: 0x0008, 0xdfa: 0x0008, 0xdfb: 0x0008, 0xdfc: 0x0259, 0xdfd: 0x1089, 0xdfe: 0x29a1, 0xdff: 0x29b9, // Block 0x38, offset 0xe00 0xe00: 0xe00d, 0xe01: 0x0008, 0xe02: 0xe00d, 0xe03: 0x0008, 0xe04: 0xe00d, 0xe05: 0x0008, 0xe06: 0xe00d, 0xe07: 0x0008, 0xe08: 0xe00d, 0xe09: 0x0008, 0xe0a: 0xe00d, 0xe0b: 0x0008, 0xe0c: 0xe00d, 0xe0d: 0x0008, 0xe0e: 0xe00d, 0xe0f: 0x0008, 0xe10: 0xe00d, 0xe11: 0x0008, 0xe12: 0xe00d, 0xe13: 0x0008, 0xe14: 0xe00d, 0xe15: 0x0008, 0xe16: 0xe00d, 0xe17: 0x0008, 0xe18: 0xe00d, 0xe19: 0x0008, 0xe1a: 0xe00d, 0xe1b: 0x0008, 0xe1c: 0xe00d, 0xe1d: 0x0008, 0xe1e: 0xe00d, 0xe1f: 0x0008, 0xe20: 0xe00d, 0xe21: 0x0008, 0xe22: 0xe00d, 0xe23: 0x0008, 0xe24: 0x0008, 0xe25: 0x0018, 0xe26: 0x0018, 0xe27: 0x0018, 0xe28: 0x0018, 0xe29: 0x0018, 0xe2a: 0x0018, 0xe2b: 0xe03d, 0xe2c: 0x0008, 0xe2d: 0xe01d, 0xe2e: 0x0008, 0xe2f: 0x3308, 0xe30: 0x3308, 0xe31: 0x3308, 0xe32: 0xe00d, 0xe33: 0x0008, 0xe34: 0x0040, 0xe35: 0x0040, 0xe36: 0x0040, 0xe37: 0x0040, 0xe38: 0x0040, 0xe39: 0x0018, 0xe3a: 0x0018, 0xe3b: 0x0018, 0xe3c: 0x0018, 0xe3d: 0x0018, 0xe3e: 0x0018, 0xe3f: 0x0018, // Block 0x39, offset 0xe40 0xe40: 0x2715, 0xe41: 0x2735, 0xe42: 0x2755, 0xe43: 0x2775, 0xe44: 0x2795, 0xe45: 0x27b5, 0xe46: 0x27d5, 0xe47: 0x27f5, 0xe48: 0x2815, 0xe49: 0x2835, 0xe4a: 0x2855, 0xe4b: 0x2875, 0xe4c: 0x2895, 0xe4d: 0x28b5, 0xe4e: 0x28d5, 0xe4f: 0x28f5, 0xe50: 0x2915, 0xe51: 0x2935, 0xe52: 0x2955, 0xe53: 0x2975, 0xe54: 0x2995, 0xe55: 0x29b5, 0xe56: 0x0040, 0xe57: 0x0040, 0xe58: 0x0040, 0xe59: 0x0040, 0xe5a: 0x0040, 0xe5b: 0x0040, 0xe5c: 0x0040, 0xe5d: 0x0040, 0xe5e: 0x0040, 0xe5f: 0x0040, 0xe60: 0x0040, 0xe61: 0x0040, 0xe62: 0x0040, 0xe63: 0x0040, 0xe64: 0x0040, 0xe65: 0x0040, 0xe66: 0x0040, 0xe67: 0x0040, 0xe68: 0x0040, 0xe69: 0x0040, 0xe6a: 0x0040, 0xe6b: 0x0040, 0xe6c: 0x0040, 0xe6d: 0x0040, 0xe6e: 0x0040, 0xe6f: 0x0040, 0xe70: 0x0040, 0xe71: 0x0040, 0xe72: 0x0040, 0xe73: 0x0040, 0xe74: 0x0040, 0xe75: 0x0040, 0xe76: 0x0040, 0xe77: 0x0040, 0xe78: 0x0040, 0xe79: 0x0040, 0xe7a: 0x0040, 0xe7b: 0x0040, 0xe7c: 0x0040, 0xe7d: 0x0040, 0xe7e: 0x0040, 0xe7f: 0x0040, // Block 0x3a, offset 0xe80 0xe80: 0x000a, 0xe81: 0x0018, 0xe82: 0x29d1, 0xe83: 0x0018, 0xe84: 0x0018, 0xe85: 0x0008, 0xe86: 0x0008, 0xe87: 0x0008, 0xe88: 0x0018, 0xe89: 0x0018, 0xe8a: 0x0018, 0xe8b: 0x0018, 0xe8c: 0x0018, 0xe8d: 0x0018, 0xe8e: 0x0018, 0xe8f: 0x0018, 0xe90: 0x0018, 0xe91: 0x0018, 0xe92: 0x0018, 0xe93: 0x0018, 0xe94: 0x0018, 0xe95: 0x0018, 0xe96: 0x0018, 0xe97: 0x0018, 0xe98: 0x0018, 0xe99: 0x0018, 0xe9a: 0x0018, 0xe9b: 0x0018, 0xe9c: 0x0018, 0xe9d: 0x0018, 0xe9e: 0x0018, 0xe9f: 0x0018, 0xea0: 0x0018, 0xea1: 0x0018, 0xea2: 0x0018, 0xea3: 0x0018, 0xea4: 0x0018, 0xea5: 0x0018, 0xea6: 0x0018, 0xea7: 0x0018, 0xea8: 0x0018, 0xea9: 0x0018, 0xeaa: 0x3308, 0xeab: 0x3308, 0xeac: 0x3308, 0xead: 0x3308, 0xeae: 0x3018, 0xeaf: 0x3018, 0xeb0: 0x0018, 0xeb1: 0x0018, 0xeb2: 0x0018, 0xeb3: 0x0018, 0xeb4: 0x0018, 0xeb5: 0x0018, 0xeb6: 0xe125, 0xeb7: 0x0018, 0xeb8: 0x29d5, 0xeb9: 0x29f5, 0xeba: 0x2a15, 0xebb: 0x0018, 0xebc: 0x0008, 0xebd: 0x0018, 0xebe: 0x0018, 0xebf: 0x0018, // Block 0x3b, offset 0xec0 0xec0: 0x2b55, 0xec1: 0x2b75, 0xec2: 0x2b95, 0xec3: 0x2bb5, 0xec4: 0x2bd5, 0xec5: 0x2bf5, 0xec6: 0x2bf5, 0xec7: 0x2bf5, 0xec8: 0x2c15, 0xec9: 0x2c15, 0xeca: 0x2c15, 0xecb: 0x2c15, 0xecc: 0x2c35, 0xecd: 0x2c35, 0xece: 0x2c35, 0xecf: 0x2c55, 0xed0: 0x2c75, 0xed1: 0x2c75, 0xed2: 0x2a95, 0xed3: 0x2a95, 0xed4: 0x2c75, 0xed5: 0x2c75, 0xed6: 0x2c95, 0xed7: 0x2c95, 0xed8: 0x2c75, 0xed9: 0x2c75, 0xeda: 0x2a95, 0xedb: 0x2a95, 0xedc: 0x2c75, 0xedd: 0x2c75, 0xede: 0x2c55, 0xedf: 0x2c55, 0xee0: 0x2cb5, 0xee1: 0x2cb5, 0xee2: 0x2cd5, 0xee3: 0x2cd5, 0xee4: 0x0040, 0xee5: 0x2cf5, 0xee6: 0x2d15, 0xee7: 0x2d35, 0xee8: 0x2d35, 0xee9: 0x2d55, 0xeea: 0x2d75, 0xeeb: 0x2d95, 0xeec: 0x2db5, 0xeed: 0x2dd5, 0xeee: 0x2df5, 0xeef: 0x2e15, 0xef0: 0x2e35, 0xef1: 0x2e55, 0xef2: 0x2e55, 0xef3: 0x2e75, 0xef4: 0x2e95, 0xef5: 0x2e95, 0xef6: 0x2eb5, 0xef7: 0x2ed5, 0xef8: 0x2e75, 0xef9: 0x2ef5, 0xefa: 0x2f15, 0xefb: 0x2ef5, 0xefc: 0x2e75, 0xefd: 0x2f35, 0xefe: 0x2f55, 0xeff: 0x2f75, // Block 0x3c, offset 0xf00 0xf00: 0x2f95, 0xf01: 0x2fb5, 0xf02: 0x2d15, 0xf03: 0x2cf5, 0xf04: 0x2fd5, 0xf05: 0x2ff5, 0xf06: 0x3015, 0xf07: 0x3035, 0xf08: 0x3055, 0xf09: 0x3075, 0xf0a: 0x3095, 0xf0b: 0x30b5, 0xf0c: 0x30d5, 0xf0d: 0x30f5, 0xf0e: 0x3115, 0xf0f: 0x0040, 0xf10: 0x0018, 0xf11: 0x0018, 0xf12: 0x3135, 0xf13: 0x3155, 0xf14: 0x3175, 0xf15: 0x3195, 0xf16: 0x31b5, 0xf17: 0x31d5, 0xf18: 0x31f5, 0xf19: 0x3215, 0xf1a: 0x3235, 0xf1b: 0x3255, 0xf1c: 0x3175, 0xf1d: 0x3275, 0xf1e: 0x3295, 0xf1f: 0x32b5, 0xf20: 0x0008, 0xf21: 0x0008, 0xf22: 0x0008, 0xf23: 0x0008, 0xf24: 0x0008, 0xf25: 0x0008, 0xf26: 0x0008, 0xf27: 0x0008, 0xf28: 0x0008, 0xf29: 0x0008, 0xf2a: 0x0008, 0xf2b: 0x0008, 0xf2c: 0x0008, 0xf2d: 0x0008, 0xf2e: 0x0008, 0xf2f: 0x0008, 0xf30: 0x0008, 0xf31: 0x0008, 0xf32: 0x0008, 0xf33: 0x0008, 0xf34: 0x0008, 0xf35: 0x0008, 0xf36: 0x0008, 0xf37: 0x0008, 0xf38: 0x0008, 0xf39: 0x0008, 0xf3a: 0x0008, 0xf3b: 0x0040, 0xf3c: 0x0040, 0xf3d: 0x0040, 0xf3e: 0x0040, 0xf3f: 0x0040, // Block 0x3d, offset 0xf40 0xf40: 0x36a2, 0xf41: 0x36d2, 0xf42: 0x3702, 0xf43: 0x3732, 0xf44: 0x32d5, 0xf45: 0x32f5, 0xf46: 0x3315, 0xf47: 0x3335, 0xf48: 0x0018, 0xf49: 0x0018, 0xf4a: 0x0018, 0xf4b: 0x0018, 0xf4c: 0x0018, 0xf4d: 0x0018, 0xf4e: 0x0018, 0xf4f: 0x0018, 0xf50: 0x3355, 0xf51: 0x3761, 0xf52: 0x3779, 0xf53: 0x3791, 0xf54: 0x37a9, 0xf55: 0x37c1, 0xf56: 0x37d9, 0xf57: 0x37f1, 0xf58: 0x3809, 0xf59: 0x3821, 0xf5a: 0x3839, 0xf5b: 0x3851, 0xf5c: 0x3869, 0xf5d: 0x3881, 0xf5e: 0x3899, 0xf5f: 0x38b1, 0xf60: 0x3375, 0xf61: 0x3395, 0xf62: 0x33b5, 0xf63: 0x33d5, 0xf64: 0x33f5, 0xf65: 0x33f5, 0xf66: 0x3415, 0xf67: 0x3435, 0xf68: 0x3455, 0xf69: 0x3475, 0xf6a: 0x3495, 0xf6b: 0x34b5, 0xf6c: 0x34d5, 0xf6d: 0x34f5, 0xf6e: 0x3515, 0xf6f: 0x3535, 0xf70: 0x3555, 0xf71: 0x3575, 0xf72: 0x3595, 0xf73: 0x35b5, 0xf74: 0x35d5, 0xf75: 0x35f5, 0xf76: 0x3615, 0xf77: 0x3635, 0xf78: 0x3655, 0xf79: 0x3675, 0xf7a: 0x3695, 0xf7b: 0x36b5, 0xf7c: 0x38c9, 0xf7d: 0x3901, 0xf7e: 0x36d5, 0xf7f: 0x0018, // Block 0x3e, offset 0xf80 0xf80: 0x36f5, 0xf81: 0x3715, 0xf82: 0x3735, 0xf83: 0x3755, 0xf84: 0x3775, 0xf85: 0x3795, 0xf86: 0x37b5, 0xf87: 0x37d5, 0xf88: 0x37f5, 0xf89: 0x3815, 0xf8a: 0x3835, 0xf8b: 0x3855, 0xf8c: 0x3875, 0xf8d: 0x3895, 0xf8e: 0x38b5, 0xf8f: 0x38d5, 0xf90: 0x38f5, 0xf91: 0x3915, 0xf92: 0x3935, 0xf93: 0x3955, 0xf94: 0x3975, 0xf95: 0x3995, 0xf96: 0x39b5, 0xf97: 0x39d5, 0xf98: 0x39f5, 0xf99: 0x3a15, 0xf9a: 0x3a35, 0xf9b: 0x3a55, 0xf9c: 0x3a75, 0xf9d: 0x3a95, 0xf9e: 0x3ab5, 0xf9f: 0x3ad5, 0xfa0: 0x3af5, 0xfa1: 0x3b15, 0xfa2: 0x3b35, 0xfa3: 0x3b55, 0xfa4: 0x3b75, 0xfa5: 0x3b95, 0xfa6: 0x1295, 0xfa7: 0x3bb5, 0xfa8: 0x3bd5, 0xfa9: 0x3bf5, 0xfaa: 0x3c15, 0xfab: 0x3c35, 0xfac: 0x3c55, 0xfad: 0x3c75, 0xfae: 0x23b5, 0xfaf: 0x3c95, 0xfb0: 0x3cb5, 0xfb1: 0x3939, 0xfb2: 0x3951, 0xfb3: 0x3969, 0xfb4: 0x3981, 0xfb5: 0x3999, 0xfb6: 0x39b1, 0xfb7: 0x39c9, 0xfb8: 0x39e1, 0xfb9: 0x39f9, 0xfba: 0x3a11, 0xfbb: 0x3a29, 0xfbc: 0x3a41, 0xfbd: 0x3a59, 0xfbe: 0x3a71, 0xfbf: 0x3a89, // Block 0x3f, offset 0xfc0 0xfc0: 0x3aa1, 0xfc1: 0x3ac9, 0xfc2: 0x3af1, 0xfc3: 0x3b19, 0xfc4: 0x3b41, 0xfc5: 0x3b69, 0xfc6: 0x3b91, 0xfc7: 0x3bb9, 0xfc8: 0x3be1, 0xfc9: 0x3c09, 0xfca: 0x3c39, 0xfcb: 0x3c69, 0xfcc: 0x3c99, 0xfcd: 0x3cd5, 0xfce: 0x3cb1, 0xfcf: 0x3cf5, 0xfd0: 0x3d15, 0xfd1: 0x3d2d, 0xfd2: 0x3d45, 0xfd3: 0x3d5d, 0xfd4: 0x3d75, 0xfd5: 0x3d75, 0xfd6: 0x3d5d, 0xfd7: 0x3d8d, 0xfd8: 0x07d5, 0xfd9: 0x3da5, 0xfda: 0x3dbd, 0xfdb: 0x3dd5, 0xfdc: 0x3ded, 0xfdd: 0x3e05, 0xfde: 0x3e1d, 0xfdf: 0x3e35, 0xfe0: 0x3e4d, 0xfe1: 0x3e65, 0xfe2: 0x3e7d, 0xfe3: 0x3e95, 0xfe4: 0x3ead, 0xfe5: 0x3ead, 0xfe6: 0x3ec5, 0xfe7: 0x3ec5, 0xfe8: 0x3edd, 0xfe9: 0x3edd, 0xfea: 0x3ef5, 0xfeb: 0x3f0d, 0xfec: 0x3f25, 0xfed: 0x3f3d, 0xfee: 0x3f55, 0xfef: 0x3f55, 0xff0: 0x3f6d, 0xff1: 0x3f6d, 0xff2: 0x3f6d, 0xff3: 0x3f85, 0xff4: 0x3f9d, 0xff5: 0x3fb5, 0xff6: 0x3fcd, 0xff7: 0x3fb5, 0xff8: 0x3fe5, 0xff9: 0x3ffd, 0xffa: 0x3f85, 0xffb: 0x4015, 0xffc: 0x402d, 0xffd: 0x402d, 0xffe: 0x402d, 0xfff: 0x0040, // Block 0x40, offset 0x1000 0x1000: 0x3cc9, 0x1001: 0x3d31, 0x1002: 0x3d99, 0x1003: 0x3e01, 0x1004: 0x3e51, 0x1005: 0x3eb9, 0x1006: 0x3f09, 0x1007: 0x3f59, 0x1008: 0x3fd9, 0x1009: 0x4041, 0x100a: 0x4091, 0x100b: 0x40e1, 0x100c: 0x4131, 0x100d: 0x4199, 0x100e: 0x4201, 0x100f: 0x4251, 0x1010: 0x42a1, 0x1011: 0x42d9, 0x1012: 0x4329, 0x1013: 0x4391, 0x1014: 0x43f9, 0x1015: 0x4431, 0x1016: 0x44b1, 0x1017: 0x4549, 0x1018: 0x45c9, 0x1019: 0x4619, 0x101a: 0x4699, 0x101b: 0x4719, 0x101c: 0x4781, 0x101d: 0x47d1, 0x101e: 0x4821, 0x101f: 0x4871, 0x1020: 0x48d9, 0x1021: 0x4959, 0x1022: 0x49c1, 0x1023: 0x4a11, 0x1024: 0x4a61, 0x1025: 0x4ab1, 0x1026: 0x4ae9, 0x1027: 0x4b21, 0x1028: 0x4b59, 0x1029: 0x4b91, 0x102a: 0x4be1, 0x102b: 0x4c31, 0x102c: 0x4cb1, 0x102d: 0x4d01, 0x102e: 0x4d69, 0x102f: 0x4de9, 0x1030: 0x4e39, 0x1031: 0x4e71, 0x1032: 0x4ea9, 0x1033: 0x4f29, 0x1034: 0x4f91, 0x1035: 0x5011, 0x1036: 0x5061, 0x1037: 0x50e1, 0x1038: 0x5119, 0x1039: 0x5169, 0x103a: 0x51b9, 0x103b: 0x5209, 0x103c: 0x5259, 0x103d: 0x52a9, 0x103e: 0x5311, 0x103f: 0x5361, // Block 0x41, offset 0x1040 0x1040: 0x5399, 0x1041: 0x53e9, 0x1042: 0x5439, 0x1043: 0x5489, 0x1044: 0x54f1, 0x1045: 0x5541, 0x1046: 0x5591, 0x1047: 0x55e1, 0x1048: 0x5661, 0x1049: 0x56c9, 0x104a: 0x5701, 0x104b: 0x5781, 0x104c: 0x57b9, 0x104d: 0x5821, 0x104e: 0x5889, 0x104f: 0x58d9, 0x1050: 0x5929, 0x1051: 0x5979, 0x1052: 0x59e1, 0x1053: 0x5a19, 0x1054: 0x5a69, 0x1055: 0x5ad1, 0x1056: 0x5b09, 0x1057: 0x5b89, 0x1058: 0x5bd9, 0x1059: 0x5c01, 0x105a: 0x5c29, 0x105b: 0x5c51, 0x105c: 0x5c79, 0x105d: 0x5ca1, 0x105e: 0x5cc9, 0x105f: 0x5cf1, 0x1060: 0x5d19, 0x1061: 0x5d41, 0x1062: 0x5d69, 0x1063: 0x5d99, 0x1064: 0x5dc9, 0x1065: 0x5df9, 0x1066: 0x5e29, 0x1067: 0x5e59, 0x1068: 0x5e89, 0x1069: 0x5eb9, 0x106a: 0x5ee9, 0x106b: 0x5f19, 0x106c: 0x5f49, 0x106d: 0x5f79, 0x106e: 0x5fa9, 0x106f: 0x5fd9, 0x1070: 0x6009, 0x1071: 0x4045, 0x1072: 0x6039, 0x1073: 0x6051, 0x1074: 0x4065, 0x1075: 0x6069, 0x1076: 0x6081, 0x1077: 0x6099, 0x1078: 0x4085, 0x1079: 0x4085, 0x107a: 0x60b1, 0x107b: 0x60c9, 0x107c: 0x6101, 0x107d: 0x6139, 0x107e: 0x6171, 0x107f: 0x61a9, // Block 0x42, offset 0x1080 0x1080: 0x6211, 0x1081: 0x6229, 0x1082: 0x40a5, 0x1083: 0x6241, 0x1084: 0x6259, 0x1085: 0x6271, 0x1086: 0x6289, 0x1087: 0x62a1, 0x1088: 0x40c5, 0x1089: 0x62b9, 0x108a: 0x62e1, 0x108b: 0x62f9, 0x108c: 0x40e5, 0x108d: 0x40e5, 0x108e: 0x6311, 0x108f: 0x6329, 0x1090: 0x6341, 0x1091: 0x4105, 0x1092: 0x4125, 0x1093: 0x4145, 0x1094: 0x4165, 0x1095: 0x4185, 0x1096: 0x6359, 0x1097: 0x6371, 0x1098: 0x6389, 0x1099: 0x63a1, 0x109a: 0x63b9, 0x109b: 0x41a5, 0x109c: 0x63d1, 0x109d: 0x63e9, 0x109e: 0x6401, 0x109f: 0x41c5, 0x10a0: 0x41e5, 0x10a1: 0x6419, 0x10a2: 0x4205, 0x10a3: 0x4225, 0x10a4: 0x4245, 0x10a5: 0x6431, 0x10a6: 0x4265, 0x10a7: 0x6449, 0x10a8: 0x6479, 0x10a9: 0x6211, 0x10aa: 0x4285, 0x10ab: 0x42a5, 0x10ac: 0x42c5, 0x10ad: 0x42e5, 0x10ae: 0x64b1, 0x10af: 0x64f1, 0x10b0: 0x6539, 0x10b1: 0x6551, 0x10b2: 0x4305, 0x10b3: 0x6569, 0x10b4: 0x6581, 0x10b5: 0x6599, 0x10b6: 0x4325, 0x10b7: 0x65b1, 0x10b8: 0x65c9, 0x10b9: 0x65b1, 0x10ba: 0x65e1, 0x10bb: 0x65f9, 0x10bc: 0x4345, 0x10bd: 0x6611, 0x10be: 0x6629, 0x10bf: 0x6611, // Block 0x43, offset 0x10c0 0x10c0: 0x4365, 0x10c1: 0x4385, 0x10c2: 0x0040, 0x10c3: 0x6641, 0x10c4: 0x6659, 0x10c5: 0x6671, 0x10c6: 0x6689, 0x10c7: 0x0040, 0x10c8: 0x66c1, 0x10c9: 0x66d9, 0x10ca: 0x66f1, 0x10cb: 0x6709, 0x10cc: 0x6721, 0x10cd: 0x6739, 0x10ce: 0x6401, 0x10cf: 0x6751, 0x10d0: 0x6769, 0x10d1: 0x6781, 0x10d2: 0x43a5, 0x10d3: 0x6799, 0x10d4: 0x6289, 0x10d5: 0x43c5, 0x10d6: 0x43e5, 0x10d7: 0x67b1, 0x10d8: 0x0040, 0x10d9: 0x4405, 0x10da: 0x67c9, 0x10db: 0x67e1, 0x10dc: 0x67f9, 0x10dd: 0x6811, 0x10de: 0x6829, 0x10df: 0x6859, 0x10e0: 0x6889, 0x10e1: 0x68b1, 0x10e2: 0x68d9, 0x10e3: 0x6901, 0x10e4: 0x6929, 0x10e5: 0x6951, 0x10e6: 0x6979, 0x10e7: 0x69a1, 0x10e8: 0x69c9, 0x10e9: 0x69f1, 0x10ea: 0x6a21, 0x10eb: 0x6a51, 0x10ec: 0x6a81, 0x10ed: 0x6ab1, 0x10ee: 0x6ae1, 0x10ef: 0x6b11, 0x10f0: 0x6b41, 0x10f1: 0x6b71, 0x10f2: 0x6ba1, 0x10f3: 0x6bd1, 0x10f4: 0x6c01, 0x10f5: 0x6c31, 0x10f6: 0x6c61, 0x10f7: 0x6c91, 0x10f8: 0x6cc1, 0x10f9: 0x6cf1, 0x10fa: 0x6d21, 0x10fb: 0x6d51, 0x10fc: 0x6d81, 0x10fd: 0x6db1, 0x10fe: 0x6de1, 0x10ff: 0x4425, // Block 0x44, offset 0x1100 0x1100: 0xe00d, 0x1101: 0x0008, 0x1102: 0xe00d, 0x1103: 0x0008, 0x1104: 0xe00d, 0x1105: 0x0008, 0x1106: 0xe00d, 0x1107: 0x0008, 0x1108: 0xe00d, 0x1109: 0x0008, 0x110a: 0xe00d, 0x110b: 0x0008, 0x110c: 0xe00d, 0x110d: 0x0008, 0x110e: 0xe00d, 0x110f: 0x0008, 0x1110: 0xe00d, 0x1111: 0x0008, 0x1112: 0xe00d, 0x1113: 0x0008, 0x1114: 0xe00d, 0x1115: 0x0008, 0x1116: 0xe00d, 0x1117: 0x0008, 0x1118: 0xe00d, 0x1119: 0x0008, 0x111a: 0xe00d, 0x111b: 0x0008, 0x111c: 0xe00d, 0x111d: 0x0008, 0x111e: 0xe00d, 0x111f: 0x0008, 0x1120: 0xe00d, 0x1121: 0x0008, 0x1122: 0xe00d, 0x1123: 0x0008, 0x1124: 0xe00d, 0x1125: 0x0008, 0x1126: 0xe00d, 0x1127: 0x0008, 0x1128: 0xe00d, 0x1129: 0x0008, 0x112a: 0xe00d, 0x112b: 0x0008, 0x112c: 0xe00d, 0x112d: 0x0008, 0x112e: 0x0008, 0x112f: 0x3308, 0x1130: 0x3318, 0x1131: 0x3318, 0x1132: 0x3318, 0x1133: 0x0018, 0x1134: 0x3308, 0x1135: 0x3308, 0x1136: 0x3308, 0x1137: 0x3308, 0x1138: 0x3308, 0x1139: 0x3308, 0x113a: 0x3308, 0x113b: 0x3308, 0x113c: 0x3308, 0x113d: 0x3308, 0x113e: 0x0018, 0x113f: 0x0008, // Block 0x45, offset 0x1140 0x1140: 0xe00d, 0x1141: 0x0008, 0x1142: 0xe00d, 0x1143: 0x0008, 0x1144: 0xe00d, 0x1145: 0x0008, 0x1146: 0xe00d, 0x1147: 0x0008, 0x1148: 0xe00d, 0x1149: 0x0008, 0x114a: 0xe00d, 0x114b: 0x0008, 0x114c: 0xe00d, 0x114d: 0x0008, 0x114e: 0xe00d, 0x114f: 0x0008, 0x1150: 0xe00d, 0x1151: 0x0008, 0x1152: 0xe00d, 0x1153: 0x0008, 0x1154: 0xe00d, 0x1155: 0x0008, 0x1156: 0xe00d, 0x1157: 0x0008, 0x1158: 0xe00d, 0x1159: 0x0008, 0x115a: 0xe00d, 0x115b: 0x0008, 0x115c: 0x0ea1, 0x115d: 0x6e11, 0x115e: 0x3308, 0x115f: 0x3308, 0x1160: 0x0008, 0x1161: 0x0008, 0x1162: 0x0008, 0x1163: 0x0008, 0x1164: 0x0008, 0x1165: 0x0008, 0x1166: 0x0008, 0x1167: 0x0008, 0x1168: 0x0008, 0x1169: 0x0008, 0x116a: 0x0008, 0x116b: 0x0008, 0x116c: 0x0008, 0x116d: 0x0008, 0x116e: 0x0008, 0x116f: 0x0008, 0x1170: 0x0008, 0x1171: 0x0008, 0x1172: 0x0008, 0x1173: 0x0008, 0x1174: 0x0008, 0x1175: 0x0008, 0x1176: 0x0008, 0x1177: 0x0008, 0x1178: 0x0008, 0x1179: 0x0008, 0x117a: 0x0008, 0x117b: 0x0008, 0x117c: 0x0008, 0x117d: 0x0008, 0x117e: 0x0008, 0x117f: 0x0008, // Block 0x46, offset 0x1180 0x1180: 0x0018, 0x1181: 0x0018, 0x1182: 0x0018, 0x1183: 0x0018, 0x1184: 0x0018, 0x1185: 0x0018, 0x1186: 0x0018, 0x1187: 0x0018, 0x1188: 0x0018, 0x1189: 0x0018, 0x118a: 0x0018, 0x118b: 0x0018, 0x118c: 0x0018, 0x118d: 0x0018, 0x118e: 0x0018, 0x118f: 0x0018, 0x1190: 0x0018, 0x1191: 0x0018, 0x1192: 0x0018, 0x1193: 0x0018, 0x1194: 0x0018, 0x1195: 0x0018, 0x1196: 0x0018, 0x1197: 0x0008, 0x1198: 0x0008, 0x1199: 0x0008, 0x119a: 0x0008, 0x119b: 0x0008, 0x119c: 0x0008, 0x119d: 0x0008, 0x119e: 0x0008, 0x119f: 0x0008, 0x11a0: 0x0018, 0x11a1: 0x0018, 0x11a2: 0xe00d, 0x11a3: 0x0008, 0x11a4: 0xe00d, 0x11a5: 0x0008, 0x11a6: 0xe00d, 0x11a7: 0x0008, 0x11a8: 0xe00d, 0x11a9: 0x0008, 0x11aa: 0xe00d, 0x11ab: 0x0008, 0x11ac: 0xe00d, 0x11ad: 0x0008, 0x11ae: 0xe00d, 0x11af: 0x0008, 0x11b0: 0x0008, 0x11b1: 0x0008, 0x11b2: 0xe00d, 0x11b3: 0x0008, 0x11b4: 0xe00d, 0x11b5: 0x0008, 0x11b6: 0xe00d, 0x11b7: 0x0008, 0x11b8: 0xe00d, 0x11b9: 0x0008, 0x11ba: 0xe00d, 0x11bb: 0x0008, 0x11bc: 0xe00d, 0x11bd: 0x0008, 0x11be: 0xe00d, 0x11bf: 0x0008, // Block 0x47, offset 0x11c0 0x11c0: 0xe00d, 0x11c1: 0x0008, 0x11c2: 0xe00d, 0x11c3: 0x0008, 0x11c4: 0xe00d, 0x11c5: 0x0008, 0x11c6: 0xe00d, 0x11c7: 0x0008, 0x11c8: 0xe00d, 0x11c9: 0x0008, 0x11ca: 0xe00d, 0x11cb: 0x0008, 0x11cc: 0xe00d, 0x11cd: 0x0008, 0x11ce: 0xe00d, 0x11cf: 0x0008, 0x11d0: 0xe00d, 0x11d1: 0x0008, 0x11d2: 0xe00d, 0x11d3: 0x0008, 0x11d4: 0xe00d, 0x11d5: 0x0008, 0x11d6: 0xe00d, 0x11d7: 0x0008, 0x11d8: 0xe00d, 0x11d9: 0x0008, 0x11da: 0xe00d, 0x11db: 0x0008, 0x11dc: 0xe00d, 0x11dd: 0x0008, 0x11de: 0xe00d, 0x11df: 0x0008, 0x11e0: 0xe00d, 0x11e1: 0x0008, 0x11e2: 0xe00d, 0x11e3: 0x0008, 0x11e4: 0xe00d, 0x11e5: 0x0008, 0x11e6: 0xe00d, 0x11e7: 0x0008, 0x11e8: 0xe00d, 0x11e9: 0x0008, 0x11ea: 0xe00d, 0x11eb: 0x0008, 0x11ec: 0xe00d, 0x11ed: 0x0008, 0x11ee: 0xe00d, 0x11ef: 0x0008, 0x11f0: 0xe0fd, 0x11f1: 0x0008, 0x11f2: 0x0008, 0x11f3: 0x0008, 0x11f4: 0x0008, 0x11f5: 0x0008, 0x11f6: 0x0008, 0x11f7: 0x0008, 0x11f8: 0x0008, 0x11f9: 0xe01d, 0x11fa: 0x0008, 0x11fb: 0xe03d, 0x11fc: 0x0008, 0x11fd: 0x4445, 0x11fe: 0xe00d, 0x11ff: 0x0008, // Block 0x48, offset 0x1200 0x1200: 0xe00d, 0x1201: 0x0008, 0x1202: 0xe00d, 0x1203: 0x0008, 0x1204: 0xe00d, 0x1205: 0x0008, 0x1206: 0xe00d, 0x1207: 0x0008, 0x1208: 0x0008, 0x1209: 0x0018, 0x120a: 0x0018, 0x120b: 0xe03d, 0x120c: 0x0008, 0x120d: 0x11d9, 0x120e: 0x0008, 0x120f: 0x0008, 0x1210: 0xe00d, 0x1211: 0x0008, 0x1212: 0xe00d, 0x1213: 0x0008, 0x1214: 0x0008, 0x1215: 0x0008, 0x1216: 0xe00d, 0x1217: 0x0008, 0x1218: 0xe00d, 0x1219: 0x0008, 0x121a: 0xe00d, 0x121b: 0x0008, 0x121c: 0xe00d, 0x121d: 0x0008, 0x121e: 0xe00d, 0x121f: 0x0008, 0x1220: 0xe00d, 0x1221: 0x0008, 0x1222: 0xe00d, 0x1223: 0x0008, 0x1224: 0xe00d, 0x1225: 0x0008, 0x1226: 0xe00d, 0x1227: 0x0008, 0x1228: 0xe00d, 0x1229: 0x0008, 0x122a: 0x6e29, 0x122b: 0x1029, 0x122c: 0x11c1, 0x122d: 0x6e41, 0x122e: 0x1221, 0x122f: 0x0008, 0x1230: 0x6e59, 0x1231: 0x6e71, 0x1232: 0x1239, 0x1233: 0x4465, 0x1234: 0xe00d, 0x1235: 0x0008, 0x1236: 0xe00d, 0x1237: 0x0008, 0x1238: 0xe00d, 0x1239: 0x0008, 0x123a: 0xe00d, 0x123b: 0x0008, 0x123c: 0xe00d, 0x123d: 0x0008, 0x123e: 0xe00d, 0x123f: 0x0008, // Block 0x49, offset 0x1240 0x1240: 0x650d, 0x1241: 0x652d, 0x1242: 0x654d, 0x1243: 0x656d, 0x1244: 0x658d, 0x1245: 0x65ad, 0x1246: 0x65cd, 0x1247: 0x65ed, 0x1248: 0x660d, 0x1249: 0x662d, 0x124a: 0x664d, 0x124b: 0x666d, 0x124c: 0x668d, 0x124d: 0x66ad, 0x124e: 0x0008, 0x124f: 0x0008, 0x1250: 0x66cd, 0x1251: 0x0008, 0x1252: 0x66ed, 0x1253: 0x0008, 0x1254: 0x0008, 0x1255: 0x670d, 0x1256: 0x672d, 0x1257: 0x674d, 0x1258: 0x676d, 0x1259: 0x678d, 0x125a: 0x67ad, 0x125b: 0x67cd, 0x125c: 0x67ed, 0x125d: 0x680d, 0x125e: 0x682d, 0x125f: 0x0008, 0x1260: 0x684d, 0x1261: 0x0008, 0x1262: 0x686d, 0x1263: 0x0008, 0x1264: 0x0008, 0x1265: 0x688d, 0x1266: 0x68ad, 0x1267: 0x0008, 0x1268: 0x0008, 0x1269: 0x0008, 0x126a: 0x68cd, 0x126b: 0x68ed, 0x126c: 0x690d, 0x126d: 0x692d, 0x126e: 0x694d, 0x126f: 0x696d, 0x1270: 0x698d, 0x1271: 0x69ad, 0x1272: 0x69cd, 0x1273: 0x69ed, 0x1274: 0x6a0d, 0x1275: 0x6a2d, 0x1276: 0x6a4d, 0x1277: 0x6a6d, 0x1278: 0x6a8d, 0x1279: 0x6aad, 0x127a: 0x6acd, 0x127b: 0x6aed, 0x127c: 0x6b0d, 0x127d: 0x6b2d, 0x127e: 0x6b4d, 0x127f: 0x6b6d, // Block 0x4a, offset 0x1280 0x1280: 0x7acd, 0x1281: 0x7aed, 0x1282: 0x7b0d, 0x1283: 0x7b2d, 0x1284: 0x7b4d, 0x1285: 0x7b6d, 0x1286: 0x7b8d, 0x1287: 0x7bad, 0x1288: 0x7bcd, 0x1289: 0x7bed, 0x128a: 0x7c0d, 0x128b: 0x7c2d, 0x128c: 0x7c4d, 0x128d: 0x7c6d, 0x128e: 0x7c8d, 0x128f: 0x6ec9, 0x1290: 0x6ef1, 0x1291: 0x6f19, 0x1292: 0x7cad, 0x1293: 0x7ccd, 0x1294: 0x7ced, 0x1295: 0x6f41, 0x1296: 0x6f69, 0x1297: 0x6f91, 0x1298: 0x7d0d, 0x1299: 0x7d2d, 0x129a: 0x0040, 0x129b: 0x0040, 0x129c: 0x0040, 0x129d: 0x0040, 0x129e: 0x0040, 0x129f: 0x0040, 0x12a0: 0x0040, 0x12a1: 0x0040, 0x12a2: 0x0040, 0x12a3: 0x0040, 0x12a4: 0x0040, 0x12a5: 0x0040, 0x12a6: 0x0040, 0x12a7: 0x0040, 0x12a8: 0x0040, 0x12a9: 0x0040, 0x12aa: 0x0040, 0x12ab: 0x0040, 0x12ac: 0x0040, 0x12ad: 0x0040, 0x12ae: 0x0040, 0x12af: 0x0040, 0x12b0: 0x0040, 0x12b1: 0x0040, 0x12b2: 0x0040, 0x12b3: 0x0040, 0x12b4: 0x0040, 0x12b5: 0x0040, 0x12b6: 0x0040, 0x12b7: 0x0040, 0x12b8: 0x0040, 0x12b9: 0x0040, 0x12ba: 0x0040, 0x12bb: 0x0040, 0x12bc: 0x0040, 0x12bd: 0x0040, 0x12be: 0x0040, 0x12bf: 0x0040, // Block 0x4b, offset 0x12c0 0x12c0: 0x6fb9, 0x12c1: 0x6fd1, 0x12c2: 0x6fe9, 0x12c3: 0x7d4d, 0x12c4: 0x7d6d, 0x12c5: 0x7001, 0x12c6: 0x7001, 0x12c7: 0x0040, 0x12c8: 0x0040, 0x12c9: 0x0040, 0x12ca: 0x0040, 0x12cb: 0x0040, 0x12cc: 0x0040, 0x12cd: 0x0040, 0x12ce: 0x0040, 0x12cf: 0x0040, 0x12d0: 0x0040, 0x12d1: 0x0040, 0x12d2: 0x0040, 0x12d3: 0x7019, 0x12d4: 0x7041, 0x12d5: 0x7069, 0x12d6: 0x7091, 0x12d7: 0x70b9, 0x12d8: 0x0040, 0x12d9: 0x0040, 0x12da: 0x0040, 0x12db: 0x0040, 0x12dc: 0x0040, 0x12dd: 0x70e1, 0x12de: 0x3308, 0x12df: 0x7109, 0x12e0: 0x7131, 0x12e1: 0x20a9, 0x12e2: 0x20f1, 0x12e3: 0x7149, 0x12e4: 0x7161, 0x12e5: 0x7179, 0x12e6: 0x7191, 0x12e7: 0x71a9, 0x12e8: 0x71c1, 0x12e9: 0x1fb2, 0x12ea: 0x71d9, 0x12eb: 0x7201, 0x12ec: 0x7229, 0x12ed: 0x7261, 0x12ee: 0x7299, 0x12ef: 0x72c1, 0x12f0: 0x72e9, 0x12f1: 0x7311, 0x12f2: 0x7339, 0x12f3: 0x7361, 0x12f4: 0x7389, 0x12f5: 0x73b1, 0x12f6: 0x73d9, 0x12f7: 0x0040, 0x12f8: 0x7401, 0x12f9: 0x7429, 0x12fa: 0x7451, 0x12fb: 0x7479, 0x12fc: 0x74a1, 0x12fd: 0x0040, 0x12fe: 0x74c9, 0x12ff: 0x0040, // Block 0x4c, offset 0x1300 0x1300: 0x74f1, 0x1301: 0x7519, 0x1302: 0x0040, 0x1303: 0x7541, 0x1304: 0x7569, 0x1305: 0x0040, 0x1306: 0x7591, 0x1307: 0x75b9, 0x1308: 0x75e1, 0x1309: 0x7609, 0x130a: 0x7631, 0x130b: 0x7659, 0x130c: 0x7681, 0x130d: 0x76a9, 0x130e: 0x76d1, 0x130f: 0x76f9, 0x1310: 0x7721, 0x1311: 0x7721, 0x1312: 0x7739, 0x1313: 0x7739, 0x1314: 0x7739, 0x1315: 0x7739, 0x1316: 0x7751, 0x1317: 0x7751, 0x1318: 0x7751, 0x1319: 0x7751, 0x131a: 0x7769, 0x131b: 0x7769, 0x131c: 0x7769, 0x131d: 0x7769, 0x131e: 0x7781, 0x131f: 0x7781, 0x1320: 0x7781, 0x1321: 0x7781, 0x1322: 0x7799, 0x1323: 0x7799, 0x1324: 0x7799, 0x1325: 0x7799, 0x1326: 0x77b1, 0x1327: 0x77b1, 0x1328: 0x77b1, 0x1329: 0x77b1, 0x132a: 0x77c9, 0x132b: 0x77c9, 0x132c: 0x77c9, 0x132d: 0x77c9, 0x132e: 0x77e1, 0x132f: 0x77e1, 0x1330: 0x77e1, 0x1331: 0x77e1, 0x1332: 0x77f9, 0x1333: 0x77f9, 0x1334: 0x77f9, 0x1335: 0x77f9, 0x1336: 0x7811, 0x1337: 0x7811, 0x1338: 0x7811, 0x1339: 0x7811, 0x133a: 0x7829, 0x133b: 0x7829, 0x133c: 0x7829, 0x133d: 0x7829, 0x133e: 0x7841, 0x133f: 0x7841, // Block 0x4d, offset 0x1340 0x1340: 0x7841, 0x1341: 0x7841, 0x1342: 0x7859, 0x1343: 0x7859, 0x1344: 0x7871, 0x1345: 0x7871, 0x1346: 0x7889, 0x1347: 0x7889, 0x1348: 0x78a1, 0x1349: 0x78a1, 0x134a: 0x78b9, 0x134b: 0x78b9, 0x134c: 0x78d1, 0x134d: 0x78d1, 0x134e: 0x78e9, 0x134f: 0x78e9, 0x1350: 0x78e9, 0x1351: 0x78e9, 0x1352: 0x7901, 0x1353: 0x7901, 0x1354: 0x7901, 0x1355: 0x7901, 0x1356: 0x7919, 0x1357: 0x7919, 0x1358: 0x7919, 0x1359: 0x7919, 0x135a: 0x7931, 0x135b: 0x7931, 0x135c: 0x7931, 0x135d: 0x7931, 0x135e: 0x7949, 0x135f: 0x7949, 0x1360: 0x7961, 0x1361: 0x7961, 0x1362: 0x7961, 0x1363: 0x7961, 0x1364: 0x7979, 0x1365: 0x7979, 0x1366: 0x7991, 0x1367: 0x7991, 0x1368: 0x7991, 0x1369: 0x7991, 0x136a: 0x79a9, 0x136b: 0x79a9, 0x136c: 0x79a9, 0x136d: 0x79a9, 0x136e: 0x79c1, 0x136f: 0x79c1, 0x1370: 0x79d9, 0x1371: 0x79d9, 0x1372: 0x0818, 0x1373: 0x0818, 0x1374: 0x0818, 0x1375: 0x0818, 0x1376: 0x0818, 0x1377: 0x0818, 0x1378: 0x0818, 0x1379: 0x0818, 0x137a: 0x0818, 0x137b: 0x0818, 0x137c: 0x0818, 0x137d: 0x0818, 0x137e: 0x0818, 0x137f: 0x0818, // Block 0x4e, offset 0x1380 0x1380: 0x0818, 0x1381: 0x0818, 0x1382: 0x0040, 0x1383: 0x0040, 0x1384: 0x0040, 0x1385: 0x0040, 0x1386: 0x0040, 0x1387: 0x0040, 0x1388: 0x0040, 0x1389: 0x0040, 0x138a: 0x0040, 0x138b: 0x0040, 0x138c: 0x0040, 0x138d: 0x0040, 0x138e: 0x0040, 0x138f: 0x0040, 0x1390: 0x0040, 0x1391: 0x0040, 0x1392: 0x0040, 0x1393: 0x79f1, 0x1394: 0x79f1, 0x1395: 0x79f1, 0x1396: 0x79f1, 0x1397: 0x7a09, 0x1398: 0x7a09, 0x1399: 0x7a21, 0x139a: 0x7a21, 0x139b: 0x7a39, 0x139c: 0x7a39, 0x139d: 0x0479, 0x139e: 0x7a51, 0x139f: 0x7a51, 0x13a0: 0x7a69, 0x13a1: 0x7a69, 0x13a2: 0x7a81, 0x13a3: 0x7a81, 0x13a4: 0x7a99, 0x13a5: 0x7a99, 0x13a6: 0x7a99, 0x13a7: 0x7a99, 0x13a8: 0x7ab1, 0x13a9: 0x7ab1, 0x13aa: 0x7ac9, 0x13ab: 0x7ac9, 0x13ac: 0x7af1, 0x13ad: 0x7af1, 0x13ae: 0x7b19, 0x13af: 0x7b19, 0x13b0: 0x7b41, 0x13b1: 0x7b41, 0x13b2: 0x7b69, 0x13b3: 0x7b69, 0x13b4: 0x7b91, 0x13b5: 0x7b91, 0x13b6: 0x7bb9, 0x13b7: 0x7bb9, 0x13b8: 0x7bb9, 0x13b9: 0x7be1, 0x13ba: 0x7be1, 0x13bb: 0x7be1, 0x13bc: 0x7c09, 0x13bd: 0x7c09, 0x13be: 0x7c09, 0x13bf: 0x7c09, // Block 0x4f, offset 0x13c0 0x13c0: 0x85f9, 0x13c1: 0x8621, 0x13c2: 0x8649, 0x13c3: 0x8671, 0x13c4: 0x8699, 0x13c5: 0x86c1, 0x13c6: 0x86e9, 0x13c7: 0x8711, 0x13c8: 0x8739, 0x13c9: 0x8761, 0x13ca: 0x8789, 0x13cb: 0x87b1, 0x13cc: 0x87d9, 0x13cd: 0x8801, 0x13ce: 0x8829, 0x13cf: 0x8851, 0x13d0: 0x8879, 0x13d1: 0x88a1, 0x13d2: 0x88c9, 0x13d3: 0x88f1, 0x13d4: 0x8919, 0x13d5: 0x8941, 0x13d6: 0x8969, 0x13d7: 0x8991, 0x13d8: 0x89b9, 0x13d9: 0x89e1, 0x13da: 0x8a09, 0x13db: 0x8a31, 0x13dc: 0x8a59, 0x13dd: 0x8a81, 0x13de: 0x8aaa, 0x13df: 0x8ada, 0x13e0: 0x8b0a, 0x13e1: 0x8b3a, 0x13e2: 0x8b6a, 0x13e3: 0x8b9a, 0x13e4: 0x8bc9, 0x13e5: 0x8bf1, 0x13e6: 0x7c71, 0x13e7: 0x8c19, 0x13e8: 0x7be1, 0x13e9: 0x7c99, 0x13ea: 0x8c41, 0x13eb: 0x8c69, 0x13ec: 0x7d39, 0x13ed: 0x8c91, 0x13ee: 0x7d61, 0x13ef: 0x7d89, 0x13f0: 0x8cb9, 0x13f1: 0x8ce1, 0x13f2: 0x7e29, 0x13f3: 0x8d09, 0x13f4: 0x7e51, 0x13f5: 0x7e79, 0x13f6: 0x8d31, 0x13f7: 0x8d59, 0x13f8: 0x7ec9, 0x13f9: 0x8d81, 0x13fa: 0x7ef1, 0x13fb: 0x7f19, 0x13fc: 0x83a1, 0x13fd: 0x83c9, 0x13fe: 0x8441, 0x13ff: 0x8469, // Block 0x50, offset 0x1400 0x1400: 0x8491, 0x1401: 0x8531, 0x1402: 0x8559, 0x1403: 0x8581, 0x1404: 0x85a9, 0x1405: 0x8649, 0x1406: 0x8671, 0x1407: 0x8699, 0x1408: 0x8da9, 0x1409: 0x8739, 0x140a: 0x8dd1, 0x140b: 0x8df9, 0x140c: 0x8829, 0x140d: 0x8e21, 0x140e: 0x8851, 0x140f: 0x8879, 0x1410: 0x8a81, 0x1411: 0x8e49, 0x1412: 0x8e71, 0x1413: 0x89b9, 0x1414: 0x8e99, 0x1415: 0x89e1, 0x1416: 0x8a09, 0x1417: 0x7c21, 0x1418: 0x7c49, 0x1419: 0x8ec1, 0x141a: 0x7c71, 0x141b: 0x8ee9, 0x141c: 0x7cc1, 0x141d: 0x7ce9, 0x141e: 0x7d11, 0x141f: 0x7d39, 0x1420: 0x8f11, 0x1421: 0x7db1, 0x1422: 0x7dd9, 0x1423: 0x7e01, 0x1424: 0x7e29, 0x1425: 0x8f39, 0x1426: 0x7ec9, 0x1427: 0x7f41, 0x1428: 0x7f69, 0x1429: 0x7f91, 0x142a: 0x7fb9, 0x142b: 0x7fe1, 0x142c: 0x8031, 0x142d: 0x8059, 0x142e: 0x8081, 0x142f: 0x80a9, 0x1430: 0x80d1, 0x1431: 0x80f9, 0x1432: 0x8f61, 0x1433: 0x8121, 0x1434: 0x8149, 0x1435: 0x8171, 0x1436: 0x8199, 0x1437: 0x81c1, 0x1438: 0x81e9, 0x1439: 0x8239, 0x143a: 0x8261, 0x143b: 0x8289, 0x143c: 0x82b1, 0x143d: 0x82d9, 0x143e: 0x8301, 0x143f: 0x8329, // Block 0x51, offset 0x1440 0x1440: 0x8351, 0x1441: 0x8379, 0x1442: 0x83f1, 0x1443: 0x8419, 0x1444: 0x84b9, 0x1445: 0x84e1, 0x1446: 0x8509, 0x1447: 0x8531, 0x1448: 0x8559, 0x1449: 0x85d1, 0x144a: 0x85f9, 0x144b: 0x8621, 0x144c: 0x8649, 0x144d: 0x8f89, 0x144e: 0x86c1, 0x144f: 0x86e9, 0x1450: 0x8711, 0x1451: 0x8739, 0x1452: 0x87b1, 0x1453: 0x87d9, 0x1454: 0x8801, 0x1455: 0x8829, 0x1456: 0x8fb1, 0x1457: 0x88a1, 0x1458: 0x88c9, 0x1459: 0x8fd9, 0x145a: 0x8941, 0x145b: 0x8969, 0x145c: 0x8991, 0x145d: 0x89b9, 0x145e: 0x9001, 0x145f: 0x7c71, 0x1460: 0x8ee9, 0x1461: 0x7d39, 0x1462: 0x8f11, 0x1463: 0x7e29, 0x1464: 0x8f39, 0x1465: 0x7ec9, 0x1466: 0x9029, 0x1467: 0x80d1, 0x1468: 0x9051, 0x1469: 0x9079, 0x146a: 0x90a1, 0x146b: 0x8531, 0x146c: 0x8559, 0x146d: 0x8649, 0x146e: 0x8829, 0x146f: 0x8fb1, 0x1470: 0x89b9, 0x1471: 0x9001, 0x1472: 0x90c9, 0x1473: 0x9101, 0x1474: 0x9139, 0x1475: 0x9171, 0x1476: 0x9199, 0x1477: 0x91c1, 0x1478: 0x91e9, 0x1479: 0x9211, 0x147a: 0x9239, 0x147b: 0x9261, 0x147c: 0x9289, 0x147d: 0x92b1, 0x147e: 0x92d9, 0x147f: 0x9301, // Block 0x52, offset 0x1480 0x1480: 0x9329, 0x1481: 0x9351, 0x1482: 0x9379, 0x1483: 0x93a1, 0x1484: 0x93c9, 0x1485: 0x93f1, 0x1486: 0x9419, 0x1487: 0x9441, 0x1488: 0x9469, 0x1489: 0x9491, 0x148a: 0x94b9, 0x148b: 0x94e1, 0x148c: 0x9079, 0x148d: 0x9509, 0x148e: 0x9531, 0x148f: 0x9559, 0x1490: 0x9581, 0x1491: 0x9171, 0x1492: 0x9199, 0x1493: 0x91c1, 0x1494: 0x91e9, 0x1495: 0x9211, 0x1496: 0x9239, 0x1497: 0x9261, 0x1498: 0x9289, 0x1499: 0x92b1, 0x149a: 0x92d9, 0x149b: 0x9301, 0x149c: 0x9329, 0x149d: 0x9351, 0x149e: 0x9379, 0x149f: 0x93a1, 0x14a0: 0x93c9, 0x14a1: 0x93f1, 0x14a2: 0x9419, 0x14a3: 0x9441, 0x14a4: 0x9469, 0x14a5: 0x9491, 0x14a6: 0x94b9, 0x14a7: 0x94e1, 0x14a8: 0x9079, 0x14a9: 0x9509, 0x14aa: 0x9531, 0x14ab: 0x9559, 0x14ac: 0x9581, 0x14ad: 0x9491, 0x14ae: 0x94b9, 0x14af: 0x94e1, 0x14b0: 0x9079, 0x14b1: 0x9051, 0x14b2: 0x90a1, 0x14b3: 0x8211, 0x14b4: 0x8059, 0x14b5: 0x8081, 0x14b6: 0x80a9, 0x14b7: 0x9491, 0x14b8: 0x94b9, 0x14b9: 0x94e1, 0x14ba: 0x8211, 0x14bb: 0x8239, 0x14bc: 0x95a9, 0x14bd: 0x95a9, 0x14be: 0x0018, 0x14bf: 0x0018, // Block 0x53, offset 0x14c0 0x14c0: 0x0040, 0x14c1: 0x0040, 0x14c2: 0x0040, 0x14c3: 0x0040, 0x14c4: 0x0040, 0x14c5: 0x0040, 0x14c6: 0x0040, 0x14c7: 0x0040, 0x14c8: 0x0040, 0x14c9: 0x0040, 0x14ca: 0x0040, 0x14cb: 0x0040, 0x14cc: 0x0040, 0x14cd: 0x0040, 0x14ce: 0x0040, 0x14cf: 0x0040, 0x14d0: 0x95d1, 0x14d1: 0x9609, 0x14d2: 0x9609, 0x14d3: 0x9641, 0x14d4: 0x9679, 0x14d5: 0x96b1, 0x14d6: 0x96e9, 0x14d7: 0x9721, 0x14d8: 0x9759, 0x14d9: 0x9759, 0x14da: 0x9791, 0x14db: 0x97c9, 0x14dc: 0x9801, 0x14dd: 0x9839, 0x14de: 0x9871, 0x14df: 0x98a9, 0x14e0: 0x98a9, 0x14e1: 0x98e1, 0x14e2: 0x9919, 0x14e3: 0x9919, 0x14e4: 0x9951, 0x14e5: 0x9951, 0x14e6: 0x9989, 0x14e7: 0x99c1, 0x14e8: 0x99c1, 0x14e9: 0x99f9, 0x14ea: 0x9a31, 0x14eb: 0x9a31, 0x14ec: 0x9a69, 0x14ed: 0x9a69, 0x14ee: 0x9aa1, 0x14ef: 0x9ad9, 0x14f0: 0x9ad9, 0x14f1: 0x9b11, 0x14f2: 0x9b11, 0x14f3: 0x9b49, 0x14f4: 0x9b81, 0x14f5: 0x9bb9, 0x14f6: 0x9bf1, 0x14f7: 0x9bf1, 0x14f8: 0x9c29, 0x14f9: 0x9c61, 0x14fa: 0x9c99, 0x14fb: 0x9cd1, 0x14fc: 0x9d09, 0x14fd: 0x9d09, 0x14fe: 0x9d41, 0x14ff: 0x9d79, // Block 0x54, offset 0x1500 0x1500: 0xa949, 0x1501: 0xa981, 0x1502: 0xa9b9, 0x1503: 0xa8a1, 0x1504: 0x9bb9, 0x1505: 0x9989, 0x1506: 0xa9f1, 0x1507: 0xaa29, 0x1508: 0x0040, 0x1509: 0x0040, 0x150a: 0x0040, 0x150b: 0x0040, 0x150c: 0x0040, 0x150d: 0x0040, 0x150e: 0x0040, 0x150f: 0x0040, 0x1510: 0x0040, 0x1511: 0x0040, 0x1512: 0x0040, 0x1513: 0x0040, 0x1514: 0x0040, 0x1515: 0x0040, 0x1516: 0x0040, 0x1517: 0x0040, 0x1518: 0x0040, 0x1519: 0x0040, 0x151a: 0x0040, 0x151b: 0x0040, 0x151c: 0x0040, 0x151d: 0x0040, 0x151e: 0x0040, 0x151f: 0x0040, 0x1520: 0x0040, 0x1521: 0x0040, 0x1522: 0x0040, 0x1523: 0x0040, 0x1524: 0x0040, 0x1525: 0x0040, 0x1526: 0x0040, 0x1527: 0x0040, 0x1528: 0x0040, 0x1529: 0x0040, 0x152a: 0x0040, 0x152b: 0x0040, 0x152c: 0x0040, 0x152d: 0x0040, 0x152e: 0x0040, 0x152f: 0x0040, 0x1530: 0xaa61, 0x1531: 0xaa99, 0x1532: 0xaad1, 0x1533: 0xab19, 0x1534: 0xab61, 0x1535: 0xaba9, 0x1536: 0xabf1, 0x1537: 0xac39, 0x1538: 0xac81, 0x1539: 0xacc9, 0x153a: 0xad02, 0x153b: 0xae12, 0x153c: 0xae91, 0x153d: 0x0018, 0x153e: 0x0040, 0x153f: 0x0040, // Block 0x55, offset 0x1540 0x1540: 0x33c0, 0x1541: 0x33c0, 0x1542: 0x33c0, 0x1543: 0x33c0, 0x1544: 0x33c0, 0x1545: 0x33c0, 0x1546: 0x33c0, 0x1547: 0x33c0, 0x1548: 0x33c0, 0x1549: 0x33c0, 0x154a: 0x33c0, 0x154b: 0x33c0, 0x154c: 0x33c0, 0x154d: 0x33c0, 0x154e: 0x33c0, 0x154f: 0x33c0, 0x1550: 0xaeda, 0x1551: 0x7d8d, 0x1552: 0x0040, 0x1553: 0xaeea, 0x1554: 0x03c2, 0x1555: 0xaefa, 0x1556: 0xaf0a, 0x1557: 0x7dad, 0x1558: 0x7dcd, 0x1559: 0x0040, 0x155a: 0x0040, 0x155b: 0x0040, 0x155c: 0x0040, 0x155d: 0x0040, 0x155e: 0x0040, 0x155f: 0x0040, 0x1560: 0x3308, 0x1561: 0x3308, 0x1562: 0x3308, 0x1563: 0x3308, 0x1564: 0x3308, 0x1565: 0x3308, 0x1566: 0x3308, 0x1567: 0x3308, 0x1568: 0x3308, 0x1569: 0x3308, 0x156a: 0x3308, 0x156b: 0x3308, 0x156c: 0x3308, 0x156d: 0x3308, 0x156e: 0x3308, 0x156f: 0x3308, 0x1570: 0x0040, 0x1571: 0x7ded, 0x1572: 0x7e0d, 0x1573: 0xaf1a, 0x1574: 0xaf1a, 0x1575: 0x1fd2, 0x1576: 0x1fe2, 0x1577: 0xaf2a, 0x1578: 0xaf3a, 0x1579: 0x7e2d, 0x157a: 0x7e4d, 0x157b: 0x7e6d, 0x157c: 0x7e2d, 0x157d: 0x7e8d, 0x157e: 0x7ead, 0x157f: 0x7e8d, // Block 0x56, offset 0x1580 0x1580: 0x7ecd, 0x1581: 0x7eed, 0x1582: 0x7f0d, 0x1583: 0x7eed, 0x1584: 0x7f2d, 0x1585: 0x0018, 0x1586: 0x0018, 0x1587: 0xaf4a, 0x1588: 0xaf5a, 0x1589: 0x7f4e, 0x158a: 0x7f6e, 0x158b: 0x7f8e, 0x158c: 0x7fae, 0x158d: 0xaf1a, 0x158e: 0xaf1a, 0x158f: 0xaf1a, 0x1590: 0xaeda, 0x1591: 0x7fcd, 0x1592: 0x0040, 0x1593: 0x0040, 0x1594: 0x03c2, 0x1595: 0xaeea, 0x1596: 0xaf0a, 0x1597: 0xaefa, 0x1598: 0x7fed, 0x1599: 0x1fd2, 0x159a: 0x1fe2, 0x159b: 0xaf2a, 0x159c: 0xaf3a, 0x159d: 0x7ecd, 0x159e: 0x7f2d, 0x159f: 0xaf6a, 0x15a0: 0xaf7a, 0x15a1: 0xaf8a, 0x15a2: 0x1fb2, 0x15a3: 0xaf99, 0x15a4: 0xafaa, 0x15a5: 0xafba, 0x15a6: 0x1fc2, 0x15a7: 0x0040, 0x15a8: 0xafca, 0x15a9: 0xafda, 0x15aa: 0xafea, 0x15ab: 0xaffa, 0x15ac: 0x0040, 0x15ad: 0x0040, 0x15ae: 0x0040, 0x15af: 0x0040, 0x15b0: 0x800e, 0x15b1: 0xb009, 0x15b2: 0x802e, 0x15b3: 0x0808, 0x15b4: 0x804e, 0x15b5: 0x0040, 0x15b6: 0x806e, 0x15b7: 0xb031, 0x15b8: 0x808e, 0x15b9: 0xb059, 0x15ba: 0x80ae, 0x15bb: 0xb081, 0x15bc: 0x80ce, 0x15bd: 0xb0a9, 0x15be: 0x80ee, 0x15bf: 0xb0d1, // Block 0x57, offset 0x15c0 0x15c0: 0xb0f9, 0x15c1: 0xb111, 0x15c2: 0xb111, 0x15c3: 0xb129, 0x15c4: 0xb129, 0x15c5: 0xb141, 0x15c6: 0xb141, 0x15c7: 0xb159, 0x15c8: 0xb159, 0x15c9: 0xb171, 0x15ca: 0xb171, 0x15cb: 0xb171, 0x15cc: 0xb171, 0x15cd: 0xb189, 0x15ce: 0xb189, 0x15cf: 0xb1a1, 0x15d0: 0xb1a1, 0x15d1: 0xb1a1, 0x15d2: 0xb1a1, 0x15d3: 0xb1b9, 0x15d4: 0xb1b9, 0x15d5: 0xb1d1, 0x15d6: 0xb1d1, 0x15d7: 0xb1d1, 0x15d8: 0xb1d1, 0x15d9: 0xb1e9, 0x15da: 0xb1e9, 0x15db: 0xb1e9, 0x15dc: 0xb1e9, 0x15dd: 0xb201, 0x15de: 0xb201, 0x15df: 0xb201, 0x15e0: 0xb201, 0x15e1: 0xb219, 0x15e2: 0xb219, 0x15e3: 0xb219, 0x15e4: 0xb219, 0x15e5: 0xb231, 0x15e6: 0xb231, 0x15e7: 0xb231, 0x15e8: 0xb231, 0x15e9: 0xb249, 0x15ea: 0xb249, 0x15eb: 0xb261, 0x15ec: 0xb261, 0x15ed: 0xb279, 0x15ee: 0xb279, 0x15ef: 0xb291, 0x15f0: 0xb291, 0x15f1: 0xb2a9, 0x15f2: 0xb2a9, 0x15f3: 0xb2a9, 0x15f4: 0xb2a9, 0x15f5: 0xb2c1, 0x15f6: 0xb2c1, 0x15f7: 0xb2c1, 0x15f8: 0xb2c1, 0x15f9: 0xb2d9, 0x15fa: 0xb2d9, 0x15fb: 0xb2d9, 0x15fc: 0xb2d9, 0x15fd: 0xb2f1, 0x15fe: 0xb2f1, 0x15ff: 0xb2f1, // Block 0x58, offset 0x1600 0x1600: 0xb2f1, 0x1601: 0xb309, 0x1602: 0xb309, 0x1603: 0xb309, 0x1604: 0xb309, 0x1605: 0xb321, 0x1606: 0xb321, 0x1607: 0xb321, 0x1608: 0xb321, 0x1609: 0xb339, 0x160a: 0xb339, 0x160b: 0xb339, 0x160c: 0xb339, 0x160d: 0xb351, 0x160e: 0xb351, 0x160f: 0xb351, 0x1610: 0xb351, 0x1611: 0xb369, 0x1612: 0xb369, 0x1613: 0xb369, 0x1614: 0xb369, 0x1615: 0xb381, 0x1616: 0xb381, 0x1617: 0xb381, 0x1618: 0xb381, 0x1619: 0xb399, 0x161a: 0xb399, 0x161b: 0xb399, 0x161c: 0xb399, 0x161d: 0xb3b1, 0x161e: 0xb3b1, 0x161f: 0xb3b1, 0x1620: 0xb3b1, 0x1621: 0xb3c9, 0x1622: 0xb3c9, 0x1623: 0xb3c9, 0x1624: 0xb3c9, 0x1625: 0xb3e1, 0x1626: 0xb3e1, 0x1627: 0xb3e1, 0x1628: 0xb3e1, 0x1629: 0xb3f9, 0x162a: 0xb3f9, 0x162b: 0xb3f9, 0x162c: 0xb3f9, 0x162d: 0xb411, 0x162e: 0xb411, 0x162f: 0x7ab1, 0x1630: 0x7ab1, 0x1631: 0xb429, 0x1632: 0xb429, 0x1633: 0xb429, 0x1634: 0xb429, 0x1635: 0xb441, 0x1636: 0xb441, 0x1637: 0xb469, 0x1638: 0xb469, 0x1639: 0xb491, 0x163a: 0xb491, 0x163b: 0xb4b9, 0x163c: 0xb4b9, 0x163d: 0x0040, 0x163e: 0x0040, 0x163f: 0x03c0, // Block 0x59, offset 0x1640 0x1640: 0x0040, 0x1641: 0xaefa, 0x1642: 0xb4e2, 0x1643: 0xaf6a, 0x1644: 0xafda, 0x1645: 0xafea, 0x1646: 0xaf7a, 0x1647: 0xb4f2, 0x1648: 0x1fd2, 0x1649: 0x1fe2, 0x164a: 0xaf8a, 0x164b: 0x1fb2, 0x164c: 0xaeda, 0x164d: 0xaf99, 0x164e: 0x29d1, 0x164f: 0xb502, 0x1650: 0x1f41, 0x1651: 0x00c9, 0x1652: 0x0069, 0x1653: 0x0079, 0x1654: 0x1f51, 0x1655: 0x1f61, 0x1656: 0x1f71, 0x1657: 0x1f81, 0x1658: 0x1f91, 0x1659: 0x1fa1, 0x165a: 0xaeea, 0x165b: 0x03c2, 0x165c: 0xafaa, 0x165d: 0x1fc2, 0x165e: 0xafba, 0x165f: 0xaf0a, 0x1660: 0xaffa, 0x1661: 0x0039, 0x1662: 0x0ee9, 0x1663: 0x1159, 0x1664: 0x0ef9, 0x1665: 0x0f09, 0x1666: 0x1199, 0x1667: 0x0f31, 0x1668: 0x0249, 0x1669: 0x0f41, 0x166a: 0x0259, 0x166b: 0x0f51, 0x166c: 0x0359, 0x166d: 0x0f61, 0x166e: 0x0f71, 0x166f: 0x00d9, 0x1670: 0x0f99, 0x1671: 0x2039, 0x1672: 0x0269, 0x1673: 0x01d9, 0x1674: 0x0fa9, 0x1675: 0x0fb9, 0x1676: 0x1089, 0x1677: 0x0279, 0x1678: 0x0369, 0x1679: 0x0289, 0x167a: 0x13d1, 0x167b: 0xaf4a, 0x167c: 0xafca, 0x167d: 0xaf5a, 0x167e: 0xb512, 0x167f: 0xaf1a, // Block 0x5a, offset 0x1680 0x1680: 0x1caa, 0x1681: 0x0039, 0x1682: 0x0ee9, 0x1683: 0x1159, 0x1684: 0x0ef9, 0x1685: 0x0f09, 0x1686: 0x1199, 0x1687: 0x0f31, 0x1688: 0x0249, 0x1689: 0x0f41, 0x168a: 0x0259, 0x168b: 0x0f51, 0x168c: 0x0359, 0x168d: 0x0f61, 0x168e: 0x0f71, 0x168f: 0x00d9, 0x1690: 0x0f99, 0x1691: 0x2039, 0x1692: 0x0269, 0x1693: 0x01d9, 0x1694: 0x0fa9, 0x1695: 0x0fb9, 0x1696: 0x1089, 0x1697: 0x0279, 0x1698: 0x0369, 0x1699: 0x0289, 0x169a: 0x13d1, 0x169b: 0xaf2a, 0x169c: 0xb522, 0x169d: 0xaf3a, 0x169e: 0xb532, 0x169f: 0x810d, 0x16a0: 0x812d, 0x16a1: 0x29d1, 0x16a2: 0x814d, 0x16a3: 0x814d, 0x16a4: 0x816d, 0x16a5: 0x818d, 0x16a6: 0x81ad, 0x16a7: 0x81cd, 0x16a8: 0x81ed, 0x16a9: 0x820d, 0x16aa: 0x822d, 0x16ab: 0x824d, 0x16ac: 0x826d, 0x16ad: 0x828d, 0x16ae: 0x82ad, 0x16af: 0x82cd, 0x16b0: 0x82ed, 0x16b1: 0x830d, 0x16b2: 0x832d, 0x16b3: 0x834d, 0x16b4: 0x836d, 0x16b5: 0x838d, 0x16b6: 0x83ad, 0x16b7: 0x83cd, 0x16b8: 0x83ed, 0x16b9: 0x840d, 0x16ba: 0x842d, 0x16bb: 0x844d, 0x16bc: 0x81ed, 0x16bd: 0x846d, 0x16be: 0x848d, 0x16bf: 0x824d, // Block 0x5b, offset 0x16c0 0x16c0: 0x84ad, 0x16c1: 0x84cd, 0x16c2: 0x84ed, 0x16c3: 0x850d, 0x16c4: 0x852d, 0x16c5: 0x854d, 0x16c6: 0x856d, 0x16c7: 0x858d, 0x16c8: 0x850d, 0x16c9: 0x85ad, 0x16ca: 0x850d, 0x16cb: 0x85cd, 0x16cc: 0x85cd, 0x16cd: 0x85ed, 0x16ce: 0x85ed, 0x16cf: 0x860d, 0x16d0: 0x854d, 0x16d1: 0x862d, 0x16d2: 0x864d, 0x16d3: 0x862d, 0x16d4: 0x866d, 0x16d5: 0x864d, 0x16d6: 0x868d, 0x16d7: 0x868d, 0x16d8: 0x86ad, 0x16d9: 0x86ad, 0x16da: 0x86cd, 0x16db: 0x86cd, 0x16dc: 0x864d, 0x16dd: 0x814d, 0x16de: 0x86ed, 0x16df: 0x870d, 0x16e0: 0x0040, 0x16e1: 0x872d, 0x16e2: 0x874d, 0x16e3: 0x876d, 0x16e4: 0x878d, 0x16e5: 0x876d, 0x16e6: 0x87ad, 0x16e7: 0x87cd, 0x16e8: 0x87ed, 0x16e9: 0x87ed, 0x16ea: 0x880d, 0x16eb: 0x880d, 0x16ec: 0x882d, 0x16ed: 0x882d, 0x16ee: 0x880d, 0x16ef: 0x880d, 0x16f0: 0x884d, 0x16f1: 0x886d, 0x16f2: 0x888d, 0x16f3: 0x88ad, 0x16f4: 0x88cd, 0x16f5: 0x88ed, 0x16f6: 0x88ed, 0x16f7: 0x88ed, 0x16f8: 0x890d, 0x16f9: 0x890d, 0x16fa: 0x890d, 0x16fb: 0x890d, 0x16fc: 0x87ed, 0x16fd: 0x87ed, 0x16fe: 0x87ed, 0x16ff: 0x0040, // Block 0x5c, offset 0x1700 0x1700: 0x0040, 0x1701: 0x0040, 0x1702: 0x874d, 0x1703: 0x872d, 0x1704: 0x892d, 0x1705: 0x872d, 0x1706: 0x874d, 0x1707: 0x872d, 0x1708: 0x0040, 0x1709: 0x0040, 0x170a: 0x894d, 0x170b: 0x874d, 0x170c: 0x896d, 0x170d: 0x892d, 0x170e: 0x896d, 0x170f: 0x874d, 0x1710: 0x0040, 0x1711: 0x0040, 0x1712: 0x898d, 0x1713: 0x89ad, 0x1714: 0x88ad, 0x1715: 0x896d, 0x1716: 0x892d, 0x1717: 0x896d, 0x1718: 0x0040, 0x1719: 0x0040, 0x171a: 0x89cd, 0x171b: 0x89ed, 0x171c: 0x89cd, 0x171d: 0x0040, 0x171e: 0x0040, 0x171f: 0x0040, 0x1720: 0xb541, 0x1721: 0xb559, 0x1722: 0xb571, 0x1723: 0x8a0e, 0x1724: 0xb589, 0x1725: 0xb5a1, 0x1726: 0x8a2d, 0x1727: 0x0040, 0x1728: 0x8a4d, 0x1729: 0x8a6d, 0x172a: 0x8a8d, 0x172b: 0x8a6d, 0x172c: 0x8aad, 0x172d: 0x8acd, 0x172e: 0x8aed, 0x172f: 0x0040, 0x1730: 0x0040, 0x1731: 0x0040, 0x1732: 0x0040, 0x1733: 0x0040, 0x1734: 0x0040, 0x1735: 0x0040, 0x1736: 0x0040, 0x1737: 0x0040, 0x1738: 0x0040, 0x1739: 0x0340, 0x173a: 0x0340, 0x173b: 0x0340, 0x173c: 0x0040, 0x173d: 0x0040, 0x173e: 0x0040, 0x173f: 0x0040, // Block 0x5d, offset 0x1740 0x1740: 0x0a08, 0x1741: 0x0a08, 0x1742: 0x0a08, 0x1743: 0x0a08, 0x1744: 0x0a08, 0x1745: 0x0c08, 0x1746: 0x0808, 0x1747: 0x0c08, 0x1748: 0x0818, 0x1749: 0x0c08, 0x174a: 0x0c08, 0x174b: 0x0808, 0x174c: 0x0808, 0x174d: 0x0908, 0x174e: 0x0c08, 0x174f: 0x0c08, 0x1750: 0x0c08, 0x1751: 0x0c08, 0x1752: 0x0c08, 0x1753: 0x0a08, 0x1754: 0x0a08, 0x1755: 0x0a08, 0x1756: 0x0a08, 0x1757: 0x0908, 0x1758: 0x0a08, 0x1759: 0x0a08, 0x175a: 0x0a08, 0x175b: 0x0a08, 0x175c: 0x0a08, 0x175d: 0x0c08, 0x175e: 0x0a08, 0x175f: 0x0a08, 0x1760: 0x0a08, 0x1761: 0x0c08, 0x1762: 0x0808, 0x1763: 0x0808, 0x1764: 0x0c08, 0x1765: 0x3308, 0x1766: 0x3308, 0x1767: 0x0040, 0x1768: 0x0040, 0x1769: 0x0040, 0x176a: 0x0040, 0x176b: 0x0a18, 0x176c: 0x0a18, 0x176d: 0x0a18, 0x176e: 0x0a18, 0x176f: 0x0c18, 0x1770: 0x0818, 0x1771: 0x0818, 0x1772: 0x0818, 0x1773: 0x0818, 0x1774: 0x0818, 0x1775: 0x0818, 0x1776: 0x0818, 0x1777: 0x0040, 0x1778: 0x0040, 0x1779: 0x0040, 0x177a: 0x0040, 0x177b: 0x0040, 0x177c: 0x0040, 0x177d: 0x0040, 0x177e: 0x0040, 0x177f: 0x0040, // Block 0x5e, offset 0x1780 0x1780: 0x0a08, 0x1781: 0x0c08, 0x1782: 0x0a08, 0x1783: 0x0c08, 0x1784: 0x0c08, 0x1785: 0x0c08, 0x1786: 0x0a08, 0x1787: 0x0a08, 0x1788: 0x0a08, 0x1789: 0x0c08, 0x178a: 0x0a08, 0x178b: 0x0a08, 0x178c: 0x0c08, 0x178d: 0x0a08, 0x178e: 0x0c08, 0x178f: 0x0c08, 0x1790: 0x0a08, 0x1791: 0x0c08, 0x1792: 0x0040, 0x1793: 0x0040, 0x1794: 0x0040, 0x1795: 0x0040, 0x1796: 0x0040, 0x1797: 0x0040, 0x1798: 0x0040, 0x1799: 0x0818, 0x179a: 0x0818, 0x179b: 0x0818, 0x179c: 0x0818, 0x179d: 0x0040, 0x179e: 0x0040, 0x179f: 0x0040, 0x17a0: 0x0040, 0x17a1: 0x0040, 0x17a2: 0x0040, 0x17a3: 0x0040, 0x17a4: 0x0040, 0x17a5: 0x0040, 0x17a6: 0x0040, 0x17a7: 0x0040, 0x17a8: 0x0040, 0x17a9: 0x0c18, 0x17aa: 0x0c18, 0x17ab: 0x0c18, 0x17ac: 0x0c18, 0x17ad: 0x0a18, 0x17ae: 0x0a18, 0x17af: 0x0818, 0x17b0: 0x0040, 0x17b1: 0x0040, 0x17b2: 0x0040, 0x17b3: 0x0040, 0x17b4: 0x0040, 0x17b5: 0x0040, 0x17b6: 0x0040, 0x17b7: 0x0040, 0x17b8: 0x0040, 0x17b9: 0x0040, 0x17ba: 0x0040, 0x17bb: 0x0040, 0x17bc: 0x0040, 0x17bd: 0x0040, 0x17be: 0x0040, 0x17bf: 0x0040, // Block 0x5f, offset 0x17c0 0x17c0: 0x3308, 0x17c1: 0x3308, 0x17c2: 0x3008, 0x17c3: 0x3008, 0x17c4: 0x0040, 0x17c5: 0x0008, 0x17c6: 0x0008, 0x17c7: 0x0008, 0x17c8: 0x0008, 0x17c9: 0x0008, 0x17ca: 0x0008, 0x17cb: 0x0008, 0x17cc: 0x0008, 0x17cd: 0x0040, 0x17ce: 0x0040, 0x17cf: 0x0008, 0x17d0: 0x0008, 0x17d1: 0x0040, 0x17d2: 0x0040, 0x17d3: 0x0008, 0x17d4: 0x0008, 0x17d5: 0x0008, 0x17d6: 0x0008, 0x17d7: 0x0008, 0x17d8: 0x0008, 0x17d9: 0x0008, 0x17da: 0x0008, 0x17db: 0x0008, 0x17dc: 0x0008, 0x17dd: 0x0008, 0x17de: 0x0008, 0x17df: 0x0008, 0x17e0: 0x0008, 0x17e1: 0x0008, 0x17e2: 0x0008, 0x17e3: 0x0008, 0x17e4: 0x0008, 0x17e5: 0x0008, 0x17e6: 0x0008, 0x17e7: 0x0008, 0x17e8: 0x0008, 0x17e9: 0x0040, 0x17ea: 0x0008, 0x17eb: 0x0008, 0x17ec: 0x0008, 0x17ed: 0x0008, 0x17ee: 0x0008, 0x17ef: 0x0008, 0x17f0: 0x0008, 0x17f1: 0x0040, 0x17f2: 0x0008, 0x17f3: 0x0008, 0x17f4: 0x0040, 0x17f5: 0x0008, 0x17f6: 0x0008, 0x17f7: 0x0008, 0x17f8: 0x0008, 0x17f9: 0x0008, 0x17fa: 0x0040, 0x17fb: 0x3308, 0x17fc: 0x3308, 0x17fd: 0x0008, 0x17fe: 0x3008, 0x17ff: 0x3008, // Block 0x60, offset 0x1800 0x1800: 0x3308, 0x1801: 0x3008, 0x1802: 0x3008, 0x1803: 0x3008, 0x1804: 0x3008, 0x1805: 0x0040, 0x1806: 0x0040, 0x1807: 0x3008, 0x1808: 0x3008, 0x1809: 0x0040, 0x180a: 0x0040, 0x180b: 0x3008, 0x180c: 0x3008, 0x180d: 0x3808, 0x180e: 0x0040, 0x180f: 0x0040, 0x1810: 0x0008, 0x1811: 0x0040, 0x1812: 0x0040, 0x1813: 0x0040, 0x1814: 0x0040, 0x1815: 0x0040, 0x1816: 0x0040, 0x1817: 0x3008, 0x1818: 0x0040, 0x1819: 0x0040, 0x181a: 0x0040, 0x181b: 0x0040, 0x181c: 0x0040, 0x181d: 0x0008, 0x181e: 0x0008, 0x181f: 0x0008, 0x1820: 0x0008, 0x1821: 0x0008, 0x1822: 0x3008, 0x1823: 0x3008, 0x1824: 0x0040, 0x1825: 0x0040, 0x1826: 0x3308, 0x1827: 0x3308, 0x1828: 0x3308, 0x1829: 0x3308, 0x182a: 0x3308, 0x182b: 0x3308, 0x182c: 0x3308, 0x182d: 0x0040, 0x182e: 0x0040, 0x182f: 0x0040, 0x1830: 0x3308, 0x1831: 0x3308, 0x1832: 0x3308, 0x1833: 0x3308, 0x1834: 0x3308, 0x1835: 0x0040, 0x1836: 0x0040, 0x1837: 0x0040, 0x1838: 0x0040, 0x1839: 0x0040, 0x183a: 0x0040, 0x183b: 0x0040, 0x183c: 0x0040, 0x183d: 0x0040, 0x183e: 0x0040, 0x183f: 0x0040, // Block 0x61, offset 0x1840 0x1840: 0x0039, 0x1841: 0x0ee9, 0x1842: 0x1159, 0x1843: 0x0ef9, 0x1844: 0x0f09, 0x1845: 0x1199, 0x1846: 0x0f31, 0x1847: 0x0249, 0x1848: 0x0f41, 0x1849: 0x0259, 0x184a: 0x0f51, 0x184b: 0x0359, 0x184c: 0x0f61, 0x184d: 0x0f71, 0x184e: 0x00d9, 0x184f: 0x0f99, 0x1850: 0x2039, 0x1851: 0x0269, 0x1852: 0x01d9, 0x1853: 0x0fa9, 0x1854: 0x0fb9, 0x1855: 0x1089, 0x1856: 0x0279, 0x1857: 0x0369, 0x1858: 0x0289, 0x1859: 0x13d1, 0x185a: 0x0039, 0x185b: 0x0ee9, 0x185c: 0x1159, 0x185d: 0x0ef9, 0x185e: 0x0f09, 0x185f: 0x1199, 0x1860: 0x0f31, 0x1861: 0x0249, 0x1862: 0x0f41, 0x1863: 0x0259, 0x1864: 0x0f51, 0x1865: 0x0359, 0x1866: 0x0f61, 0x1867: 0x0f71, 0x1868: 0x00d9, 0x1869: 0x0f99, 0x186a: 0x2039, 0x186b: 0x0269, 0x186c: 0x01d9, 0x186d: 0x0fa9, 0x186e: 0x0fb9, 0x186f: 0x1089, 0x1870: 0x0279, 0x1871: 0x0369, 0x1872: 0x0289, 0x1873: 0x13d1, 0x1874: 0x0039, 0x1875: 0x0ee9, 0x1876: 0x1159, 0x1877: 0x0ef9, 0x1878: 0x0f09, 0x1879: 0x1199, 0x187a: 0x0f31, 0x187b: 0x0249, 0x187c: 0x0f41, 0x187d: 0x0259, 0x187e: 0x0f51, 0x187f: 0x0359, // Block 0x62, offset 0x1880 0x1880: 0x0f61, 0x1881: 0x0f71, 0x1882: 0x00d9, 0x1883: 0x0f99, 0x1884: 0x2039, 0x1885: 0x0269, 0x1886: 0x01d9, 0x1887: 0x0fa9, 0x1888: 0x0fb9, 0x1889: 0x1089, 0x188a: 0x0279, 0x188b: 0x0369, 0x188c: 0x0289, 0x188d: 0x13d1, 0x188e: 0x0039, 0x188f: 0x0ee9, 0x1890: 0x1159, 0x1891: 0x0ef9, 0x1892: 0x0f09, 0x1893: 0x1199, 0x1894: 0x0f31, 0x1895: 0x0040, 0x1896: 0x0f41, 0x1897: 0x0259, 0x1898: 0x0f51, 0x1899: 0x0359, 0x189a: 0x0f61, 0x189b: 0x0f71, 0x189c: 0x00d9, 0x189d: 0x0f99, 0x189e: 0x2039, 0x189f: 0x0269, 0x18a0: 0x01d9, 0x18a1: 0x0fa9, 0x18a2: 0x0fb9, 0x18a3: 0x1089, 0x18a4: 0x0279, 0x18a5: 0x0369, 0x18a6: 0x0289, 0x18a7: 0x13d1, 0x18a8: 0x0039, 0x18a9: 0x0ee9, 0x18aa: 0x1159, 0x18ab: 0x0ef9, 0x18ac: 0x0f09, 0x18ad: 0x1199, 0x18ae: 0x0f31, 0x18af: 0x0249, 0x18b0: 0x0f41, 0x18b1: 0x0259, 0x18b2: 0x0f51, 0x18b3: 0x0359, 0x18b4: 0x0f61, 0x18b5: 0x0f71, 0x18b6: 0x00d9, 0x18b7: 0x0f99, 0x18b8: 0x2039, 0x18b9: 0x0269, 0x18ba: 0x01d9, 0x18bb: 0x0fa9, 0x18bc: 0x0fb9, 0x18bd: 0x1089, 0x18be: 0x0279, 0x18bf: 0x0369, // Block 0x63, offset 0x18c0 0x18c0: 0x0289, 0x18c1: 0x13d1, 0x18c2: 0x0039, 0x18c3: 0x0ee9, 0x18c4: 0x1159, 0x18c5: 0x0ef9, 0x18c6: 0x0f09, 0x18c7: 0x1199, 0x18c8: 0x0f31, 0x18c9: 0x0249, 0x18ca: 0x0f41, 0x18cb: 0x0259, 0x18cc: 0x0f51, 0x18cd: 0x0359, 0x18ce: 0x0f61, 0x18cf: 0x0f71, 0x18d0: 0x00d9, 0x18d1: 0x0f99, 0x18d2: 0x2039, 0x18d3: 0x0269, 0x18d4: 0x01d9, 0x18d5: 0x0fa9, 0x18d6: 0x0fb9, 0x18d7: 0x1089, 0x18d8: 0x0279, 0x18d9: 0x0369, 0x18da: 0x0289, 0x18db: 0x13d1, 0x18dc: 0x0039, 0x18dd: 0x0040, 0x18de: 0x1159, 0x18df: 0x0ef9, 0x18e0: 0x0040, 0x18e1: 0x0040, 0x18e2: 0x0f31, 0x18e3: 0x0040, 0x18e4: 0x0040, 0x18e5: 0x0259, 0x18e6: 0x0f51, 0x18e7: 0x0040, 0x18e8: 0x0040, 0x18e9: 0x0f71, 0x18ea: 0x00d9, 0x18eb: 0x0f99, 0x18ec: 0x2039, 0x18ed: 0x0040, 0x18ee: 0x01d9, 0x18ef: 0x0fa9, 0x18f0: 0x0fb9, 0x18f1: 0x1089, 0x18f2: 0x0279, 0x18f3: 0x0369, 0x18f4: 0x0289, 0x18f5: 0x13d1, 0x18f6: 0x0039, 0x18f7: 0x0ee9, 0x18f8: 0x1159, 0x18f9: 0x0ef9, 0x18fa: 0x0040, 0x18fb: 0x1199, 0x18fc: 0x0040, 0x18fd: 0x0249, 0x18fe: 0x0f41, 0x18ff: 0x0259, // Block 0x64, offset 0x1900 0x1900: 0x0f51, 0x1901: 0x0359, 0x1902: 0x0f61, 0x1903: 0x0f71, 0x1904: 0x0040, 0x1905: 0x0f99, 0x1906: 0x2039, 0x1907: 0x0269, 0x1908: 0x01d9, 0x1909: 0x0fa9, 0x190a: 0x0fb9, 0x190b: 0x1089, 0x190c: 0x0279, 0x190d: 0x0369, 0x190e: 0x0289, 0x190f: 0x13d1, 0x1910: 0x0039, 0x1911: 0x0ee9, 0x1912: 0x1159, 0x1913: 0x0ef9, 0x1914: 0x0f09, 0x1915: 0x1199, 0x1916: 0x0f31, 0x1917: 0x0249, 0x1918: 0x0f41, 0x1919: 0x0259, 0x191a: 0x0f51, 0x191b: 0x0359, 0x191c: 0x0f61, 0x191d: 0x0f71, 0x191e: 0x00d9, 0x191f: 0x0f99, 0x1920: 0x2039, 0x1921: 0x0269, 0x1922: 0x01d9, 0x1923: 0x0fa9, 0x1924: 0x0fb9, 0x1925: 0x1089, 0x1926: 0x0279, 0x1927: 0x0369, 0x1928: 0x0289, 0x1929: 0x13d1, 0x192a: 0x0039, 0x192b: 0x0ee9, 0x192c: 0x1159, 0x192d: 0x0ef9, 0x192e: 0x0f09, 0x192f: 0x1199, 0x1930: 0x0f31, 0x1931: 0x0249, 0x1932: 0x0f41, 0x1933: 0x0259, 0x1934: 0x0f51, 0x1935: 0x0359, 0x1936: 0x0f61, 0x1937: 0x0f71, 0x1938: 0x00d9, 0x1939: 0x0f99, 0x193a: 0x2039, 0x193b: 0x0269, 0x193c: 0x01d9, 0x193d: 0x0fa9, 0x193e: 0x0fb9, 0x193f: 0x1089, // Block 0x65, offset 0x1940 0x1940: 0x0279, 0x1941: 0x0369, 0x1942: 0x0289, 0x1943: 0x13d1, 0x1944: 0x0039, 0x1945: 0x0ee9, 0x1946: 0x0040, 0x1947: 0x0ef9, 0x1948: 0x0f09, 0x1949: 0x1199, 0x194a: 0x0f31, 0x194b: 0x0040, 0x194c: 0x0040, 0x194d: 0x0259, 0x194e: 0x0f51, 0x194f: 0x0359, 0x1950: 0x0f61, 0x1951: 0x0f71, 0x1952: 0x00d9, 0x1953: 0x0f99, 0x1954: 0x2039, 0x1955: 0x0040, 0x1956: 0x01d9, 0x1957: 0x0fa9, 0x1958: 0x0fb9, 0x1959: 0x1089, 0x195a: 0x0279, 0x195b: 0x0369, 0x195c: 0x0289, 0x195d: 0x0040, 0x195e: 0x0039, 0x195f: 0x0ee9, 0x1960: 0x1159, 0x1961: 0x0ef9, 0x1962: 0x0f09, 0x1963: 0x1199, 0x1964: 0x0f31, 0x1965: 0x0249, 0x1966: 0x0f41, 0x1967: 0x0259, 0x1968: 0x0f51, 0x1969: 0x0359, 0x196a: 0x0f61, 0x196b: 0x0f71, 0x196c: 0x00d9, 0x196d: 0x0f99, 0x196e: 0x2039, 0x196f: 0x0269, 0x1970: 0x01d9, 0x1971: 0x0fa9, 0x1972: 0x0fb9, 0x1973: 0x1089, 0x1974: 0x0279, 0x1975: 0x0369, 0x1976: 0x0289, 0x1977: 0x13d1, 0x1978: 0x0039, 0x1979: 0x0ee9, 0x197a: 0x0040, 0x197b: 0x0ef9, 0x197c: 0x0f09, 0x197d: 0x1199, 0x197e: 0x0f31, 0x197f: 0x0040, // Block 0x66, offset 0x1980 0x1980: 0x0f41, 0x1981: 0x0259, 0x1982: 0x0f51, 0x1983: 0x0359, 0x1984: 0x0f61, 0x1985: 0x0040, 0x1986: 0x00d9, 0x1987: 0x0040, 0x1988: 0x0040, 0x1989: 0x0040, 0x198a: 0x01d9, 0x198b: 0x0fa9, 0x198c: 0x0fb9, 0x198d: 0x1089, 0x198e: 0x0279, 0x198f: 0x0369, 0x1990: 0x0289, 0x1991: 0x0040, 0x1992: 0x0039, 0x1993: 0x0ee9, 0x1994: 0x1159, 0x1995: 0x0ef9, 0x1996: 0x0f09, 0x1997: 0x1199, 0x1998: 0x0f31, 0x1999: 0x0249, 0x199a: 0x0f41, 0x199b: 0x0259, 0x199c: 0x0f51, 0x199d: 0x0359, 0x199e: 0x0f61, 0x199f: 0x0f71, 0x19a0: 0x00d9, 0x19a1: 0x0f99, 0x19a2: 0x2039, 0x19a3: 0x0269, 0x19a4: 0x01d9, 0x19a5: 0x0fa9, 0x19a6: 0x0fb9, 0x19a7: 0x1089, 0x19a8: 0x0279, 0x19a9: 0x0369, 0x19aa: 0x0289, 0x19ab: 0x13d1, 0x19ac: 0x0039, 0x19ad: 0x0ee9, 0x19ae: 0x1159, 0x19af: 0x0ef9, 0x19b0: 0x0f09, 0x19b1: 0x1199, 0x19b2: 0x0f31, 0x19b3: 0x0249, 0x19b4: 0x0f41, 0x19b5: 0x0259, 0x19b6: 0x0f51, 0x19b7: 0x0359, 0x19b8: 0x0f61, 0x19b9: 0x0f71, 0x19ba: 0x00d9, 0x19bb: 0x0f99, 0x19bc: 0x2039, 0x19bd: 0x0269, 0x19be: 0x01d9, 0x19bf: 0x0fa9, // Block 0x67, offset 0x19c0 0x19c0: 0x0fb9, 0x19c1: 0x1089, 0x19c2: 0x0279, 0x19c3: 0x0369, 0x19c4: 0x0289, 0x19c5: 0x13d1, 0x19c6: 0x0039, 0x19c7: 0x0ee9, 0x19c8: 0x1159, 0x19c9: 0x0ef9, 0x19ca: 0x0f09, 0x19cb: 0x1199, 0x19cc: 0x0f31, 0x19cd: 0x0249, 0x19ce: 0x0f41, 0x19cf: 0x0259, 0x19d0: 0x0f51, 0x19d1: 0x0359, 0x19d2: 0x0f61, 0x19d3: 0x0f71, 0x19d4: 0x00d9, 0x19d5: 0x0f99, 0x19d6: 0x2039, 0x19d7: 0x0269, 0x19d8: 0x01d9, 0x19d9: 0x0fa9, 0x19da: 0x0fb9, 0x19db: 0x1089, 0x19dc: 0x0279, 0x19dd: 0x0369, 0x19de: 0x0289, 0x19df: 0x13d1, 0x19e0: 0x0039, 0x19e1: 0x0ee9, 0x19e2: 0x1159, 0x19e3: 0x0ef9, 0x19e4: 0x0f09, 0x19e5: 0x1199, 0x19e6: 0x0f31, 0x19e7: 0x0249, 0x19e8: 0x0f41, 0x19e9: 0x0259, 0x19ea: 0x0f51, 0x19eb: 0x0359, 0x19ec: 0x0f61, 0x19ed: 0x0f71, 0x19ee: 0x00d9, 0x19ef: 0x0f99, 0x19f0: 0x2039, 0x19f1: 0x0269, 0x19f2: 0x01d9, 0x19f3: 0x0fa9, 0x19f4: 0x0fb9, 0x19f5: 0x1089, 0x19f6: 0x0279, 0x19f7: 0x0369, 0x19f8: 0x0289, 0x19f9: 0x13d1, 0x19fa: 0x0039, 0x19fb: 0x0ee9, 0x19fc: 0x1159, 0x19fd: 0x0ef9, 0x19fe: 0x0f09, 0x19ff: 0x1199, // Block 0x68, offset 0x1a00 0x1a00: 0x0f31, 0x1a01: 0x0249, 0x1a02: 0x0f41, 0x1a03: 0x0259, 0x1a04: 0x0f51, 0x1a05: 0x0359, 0x1a06: 0x0f61, 0x1a07: 0x0f71, 0x1a08: 0x00d9, 0x1a09: 0x0f99, 0x1a0a: 0x2039, 0x1a0b: 0x0269, 0x1a0c: 0x01d9, 0x1a0d: 0x0fa9, 0x1a0e: 0x0fb9, 0x1a0f: 0x1089, 0x1a10: 0x0279, 0x1a11: 0x0369, 0x1a12: 0x0289, 0x1a13: 0x13d1, 0x1a14: 0x0039, 0x1a15: 0x0ee9, 0x1a16: 0x1159, 0x1a17: 0x0ef9, 0x1a18: 0x0f09, 0x1a19: 0x1199, 0x1a1a: 0x0f31, 0x1a1b: 0x0249, 0x1a1c: 0x0f41, 0x1a1d: 0x0259, 0x1a1e: 0x0f51, 0x1a1f: 0x0359, 0x1a20: 0x0f61, 0x1a21: 0x0f71, 0x1a22: 0x00d9, 0x1a23: 0x0f99, 0x1a24: 0x2039, 0x1a25: 0x0269, 0x1a26: 0x01d9, 0x1a27: 0x0fa9, 0x1a28: 0x0fb9, 0x1a29: 0x1089, 0x1a2a: 0x0279, 0x1a2b: 0x0369, 0x1a2c: 0x0289, 0x1a2d: 0x13d1, 0x1a2e: 0x0039, 0x1a2f: 0x0ee9, 0x1a30: 0x1159, 0x1a31: 0x0ef9, 0x1a32: 0x0f09, 0x1a33: 0x1199, 0x1a34: 0x0f31, 0x1a35: 0x0249, 0x1a36: 0x0f41, 0x1a37: 0x0259, 0x1a38: 0x0f51, 0x1a39: 0x0359, 0x1a3a: 0x0f61, 0x1a3b: 0x0f71, 0x1a3c: 0x00d9, 0x1a3d: 0x0f99, 0x1a3e: 0x2039, 0x1a3f: 0x0269, // Block 0x69, offset 0x1a40 0x1a40: 0x01d9, 0x1a41: 0x0fa9, 0x1a42: 0x0fb9, 0x1a43: 0x1089, 0x1a44: 0x0279, 0x1a45: 0x0369, 0x1a46: 0x0289, 0x1a47: 0x13d1, 0x1a48: 0x0039, 0x1a49: 0x0ee9, 0x1a4a: 0x1159, 0x1a4b: 0x0ef9, 0x1a4c: 0x0f09, 0x1a4d: 0x1199, 0x1a4e: 0x0f31, 0x1a4f: 0x0249, 0x1a50: 0x0f41, 0x1a51: 0x0259, 0x1a52: 0x0f51, 0x1a53: 0x0359, 0x1a54: 0x0f61, 0x1a55: 0x0f71, 0x1a56: 0x00d9, 0x1a57: 0x0f99, 0x1a58: 0x2039, 0x1a59: 0x0269, 0x1a5a: 0x01d9, 0x1a5b: 0x0fa9, 0x1a5c: 0x0fb9, 0x1a5d: 0x1089, 0x1a5e: 0x0279, 0x1a5f: 0x0369, 0x1a60: 0x0289, 0x1a61: 0x13d1, 0x1a62: 0x0039, 0x1a63: 0x0ee9, 0x1a64: 0x1159, 0x1a65: 0x0ef9, 0x1a66: 0x0f09, 0x1a67: 0x1199, 0x1a68: 0x0f31, 0x1a69: 0x0249, 0x1a6a: 0x0f41, 0x1a6b: 0x0259, 0x1a6c: 0x0f51, 0x1a6d: 0x0359, 0x1a6e: 0x0f61, 0x1a6f: 0x0f71, 0x1a70: 0x00d9, 0x1a71: 0x0f99, 0x1a72: 0x2039, 0x1a73: 0x0269, 0x1a74: 0x01d9, 0x1a75: 0x0fa9, 0x1a76: 0x0fb9, 0x1a77: 0x1089, 0x1a78: 0x0279, 0x1a79: 0x0369, 0x1a7a: 0x0289, 0x1a7b: 0x13d1, 0x1a7c: 0x0039, 0x1a7d: 0x0ee9, 0x1a7e: 0x1159, 0x1a7f: 0x0ef9, // Block 0x6a, offset 0x1a80 0x1a80: 0x0f09, 0x1a81: 0x1199, 0x1a82: 0x0f31, 0x1a83: 0x0249, 0x1a84: 0x0f41, 0x1a85: 0x0259, 0x1a86: 0x0f51, 0x1a87: 0x0359, 0x1a88: 0x0f61, 0x1a89: 0x0f71, 0x1a8a: 0x00d9, 0x1a8b: 0x0f99, 0x1a8c: 0x2039, 0x1a8d: 0x0269, 0x1a8e: 0x01d9, 0x1a8f: 0x0fa9, 0x1a90: 0x0fb9, 0x1a91: 0x1089, 0x1a92: 0x0279, 0x1a93: 0x0369, 0x1a94: 0x0289, 0x1a95: 0x13d1, 0x1a96: 0x0039, 0x1a97: 0x0ee9, 0x1a98: 0x1159, 0x1a99: 0x0ef9, 0x1a9a: 0x0f09, 0x1a9b: 0x1199, 0x1a9c: 0x0f31, 0x1a9d: 0x0249, 0x1a9e: 0x0f41, 0x1a9f: 0x0259, 0x1aa0: 0x0f51, 0x1aa1: 0x0359, 0x1aa2: 0x0f61, 0x1aa3: 0x0f71, 0x1aa4: 0x00d9, 0x1aa5: 0x0f99, 0x1aa6: 0x2039, 0x1aa7: 0x0269, 0x1aa8: 0x01d9, 0x1aa9: 0x0fa9, 0x1aaa: 0x0fb9, 0x1aab: 0x1089, 0x1aac: 0x0279, 0x1aad: 0x0369, 0x1aae: 0x0289, 0x1aaf: 0x13d1, 0x1ab0: 0x0039, 0x1ab1: 0x0ee9, 0x1ab2: 0x1159, 0x1ab3: 0x0ef9, 0x1ab4: 0x0f09, 0x1ab5: 0x1199, 0x1ab6: 0x0f31, 0x1ab7: 0x0249, 0x1ab8: 0x0f41, 0x1ab9: 0x0259, 0x1aba: 0x0f51, 0x1abb: 0x0359, 0x1abc: 0x0f61, 0x1abd: 0x0f71, 0x1abe: 0x00d9, 0x1abf: 0x0f99, // Block 0x6b, offset 0x1ac0 0x1ac0: 0x2039, 0x1ac1: 0x0269, 0x1ac2: 0x01d9, 0x1ac3: 0x0fa9, 0x1ac4: 0x0fb9, 0x1ac5: 0x1089, 0x1ac6: 0x0279, 0x1ac7: 0x0369, 0x1ac8: 0x0289, 0x1ac9: 0x13d1, 0x1aca: 0x0039, 0x1acb: 0x0ee9, 0x1acc: 0x1159, 0x1acd: 0x0ef9, 0x1ace: 0x0f09, 0x1acf: 0x1199, 0x1ad0: 0x0f31, 0x1ad1: 0x0249, 0x1ad2: 0x0f41, 0x1ad3: 0x0259, 0x1ad4: 0x0f51, 0x1ad5: 0x0359, 0x1ad6: 0x0f61, 0x1ad7: 0x0f71, 0x1ad8: 0x00d9, 0x1ad9: 0x0f99, 0x1ada: 0x2039, 0x1adb: 0x0269, 0x1adc: 0x01d9, 0x1add: 0x0fa9, 0x1ade: 0x0fb9, 0x1adf: 0x1089, 0x1ae0: 0x0279, 0x1ae1: 0x0369, 0x1ae2: 0x0289, 0x1ae3: 0x13d1, 0x1ae4: 0xba81, 0x1ae5: 0xba99, 0x1ae6: 0x0040, 0x1ae7: 0x0040, 0x1ae8: 0xbab1, 0x1ae9: 0x1099, 0x1aea: 0x10b1, 0x1aeb: 0x10c9, 0x1aec: 0xbac9, 0x1aed: 0xbae1, 0x1aee: 0xbaf9, 0x1aef: 0x1429, 0x1af0: 0x1a31, 0x1af1: 0xbb11, 0x1af2: 0xbb29, 0x1af3: 0xbb41, 0x1af4: 0xbb59, 0x1af5: 0xbb71, 0x1af6: 0xbb89, 0x1af7: 0x2109, 0x1af8: 0x1111, 0x1af9: 0x1429, 0x1afa: 0xbba1, 0x1afb: 0xbbb9, 0x1afc: 0xbbd1, 0x1afd: 0x10e1, 0x1afe: 0x10f9, 0x1aff: 0xbbe9, // Block 0x6c, offset 0x1b00 0x1b00: 0x2079, 0x1b01: 0xbc01, 0x1b02: 0xbab1, 0x1b03: 0x1099, 0x1b04: 0x10b1, 0x1b05: 0x10c9, 0x1b06: 0xbac9, 0x1b07: 0xbae1, 0x1b08: 0xbaf9, 0x1b09: 0x1429, 0x1b0a: 0x1a31, 0x1b0b: 0xbb11, 0x1b0c: 0xbb29, 0x1b0d: 0xbb41, 0x1b0e: 0xbb59, 0x1b0f: 0xbb71, 0x1b10: 0xbb89, 0x1b11: 0x2109, 0x1b12: 0x1111, 0x1b13: 0xbba1, 0x1b14: 0xbba1, 0x1b15: 0xbbb9, 0x1b16: 0xbbd1, 0x1b17: 0x10e1, 0x1b18: 0x10f9, 0x1b19: 0xbbe9, 0x1b1a: 0x2079, 0x1b1b: 0xbc21, 0x1b1c: 0xbac9, 0x1b1d: 0x1429, 0x1b1e: 0xbb11, 0x1b1f: 0x10e1, 0x1b20: 0x1111, 0x1b21: 0x2109, 0x1b22: 0xbab1, 0x1b23: 0x1099, 0x1b24: 0x10b1, 0x1b25: 0x10c9, 0x1b26: 0xbac9, 0x1b27: 0xbae1, 0x1b28: 0xbaf9, 0x1b29: 0x1429, 0x1b2a: 0x1a31, 0x1b2b: 0xbb11, 0x1b2c: 0xbb29, 0x1b2d: 0xbb41, 0x1b2e: 0xbb59, 0x1b2f: 0xbb71, 0x1b30: 0xbb89, 0x1b31: 0x2109, 0x1b32: 0x1111, 0x1b33: 0x1429, 0x1b34: 0xbba1, 0x1b35: 0xbbb9, 0x1b36: 0xbbd1, 0x1b37: 0x10e1, 0x1b38: 0x10f9, 0x1b39: 0xbbe9, 0x1b3a: 0x2079, 0x1b3b: 0xbc01, 0x1b3c: 0xbab1, 0x1b3d: 0x1099, 0x1b3e: 0x10b1, 0x1b3f: 0x10c9, // Block 0x6d, offset 0x1b40 0x1b40: 0xbac9, 0x1b41: 0xbae1, 0x1b42: 0xbaf9, 0x1b43: 0x1429, 0x1b44: 0x1a31, 0x1b45: 0xbb11, 0x1b46: 0xbb29, 0x1b47: 0xbb41, 0x1b48: 0xbb59, 0x1b49: 0xbb71, 0x1b4a: 0xbb89, 0x1b4b: 0x2109, 0x1b4c: 0x1111, 0x1b4d: 0xbba1, 0x1b4e: 0xbba1, 0x1b4f: 0xbbb9, 0x1b50: 0xbbd1, 0x1b51: 0x10e1, 0x1b52: 0x10f9, 0x1b53: 0xbbe9, 0x1b54: 0x2079, 0x1b55: 0xbc21, 0x1b56: 0xbac9, 0x1b57: 0x1429, 0x1b58: 0xbb11, 0x1b59: 0x10e1, 0x1b5a: 0x1111, 0x1b5b: 0x2109, 0x1b5c: 0xbab1, 0x1b5d: 0x1099, 0x1b5e: 0x10b1, 0x1b5f: 0x10c9, 0x1b60: 0xbac9, 0x1b61: 0xbae1, 0x1b62: 0xbaf9, 0x1b63: 0x1429, 0x1b64: 0x1a31, 0x1b65: 0xbb11, 0x1b66: 0xbb29, 0x1b67: 0xbb41, 0x1b68: 0xbb59, 0x1b69: 0xbb71, 0x1b6a: 0xbb89, 0x1b6b: 0x2109, 0x1b6c: 0x1111, 0x1b6d: 0x1429, 0x1b6e: 0xbba1, 0x1b6f: 0xbbb9, 0x1b70: 0xbbd1, 0x1b71: 0x10e1, 0x1b72: 0x10f9, 0x1b73: 0xbbe9, 0x1b74: 0x2079, 0x1b75: 0xbc01, 0x1b76: 0xbab1, 0x1b77: 0x1099, 0x1b78: 0x10b1, 0x1b79: 0x10c9, 0x1b7a: 0xbac9, 0x1b7b: 0xbae1, 0x1b7c: 0xbaf9, 0x1b7d: 0x1429, 0x1b7e: 0x1a31, 0x1b7f: 0xbb11, // Block 0x6e, offset 0x1b80 0x1b80: 0xbb29, 0x1b81: 0xbb41, 0x1b82: 0xbb59, 0x1b83: 0xbb71, 0x1b84: 0xbb89, 0x1b85: 0x2109, 0x1b86: 0x1111, 0x1b87: 0xbba1, 0x1b88: 0xbba1, 0x1b89: 0xbbb9, 0x1b8a: 0xbbd1, 0x1b8b: 0x10e1, 0x1b8c: 0x10f9, 0x1b8d: 0xbbe9, 0x1b8e: 0x2079, 0x1b8f: 0xbc21, 0x1b90: 0xbac9, 0x1b91: 0x1429, 0x1b92: 0xbb11, 0x1b93: 0x10e1, 0x1b94: 0x1111, 0x1b95: 0x2109, 0x1b96: 0xbab1, 0x1b97: 0x1099, 0x1b98: 0x10b1, 0x1b99: 0x10c9, 0x1b9a: 0xbac9, 0x1b9b: 0xbae1, 0x1b9c: 0xbaf9, 0x1b9d: 0x1429, 0x1b9e: 0x1a31, 0x1b9f: 0xbb11, 0x1ba0: 0xbb29, 0x1ba1: 0xbb41, 0x1ba2: 0xbb59, 0x1ba3: 0xbb71, 0x1ba4: 0xbb89, 0x1ba5: 0x2109, 0x1ba6: 0x1111, 0x1ba7: 0x1429, 0x1ba8: 0xbba1, 0x1ba9: 0xbbb9, 0x1baa: 0xbbd1, 0x1bab: 0x10e1, 0x1bac: 0x10f9, 0x1bad: 0xbbe9, 0x1bae: 0x2079, 0x1baf: 0xbc01, 0x1bb0: 0xbab1, 0x1bb1: 0x1099, 0x1bb2: 0x10b1, 0x1bb3: 0x10c9, 0x1bb4: 0xbac9, 0x1bb5: 0xbae1, 0x1bb6: 0xbaf9, 0x1bb7: 0x1429, 0x1bb8: 0x1a31, 0x1bb9: 0xbb11, 0x1bba: 0xbb29, 0x1bbb: 0xbb41, 0x1bbc: 0xbb59, 0x1bbd: 0xbb71, 0x1bbe: 0xbb89, 0x1bbf: 0x2109, // Block 0x6f, offset 0x1bc0 0x1bc0: 0x1111, 0x1bc1: 0xbba1, 0x1bc2: 0xbba1, 0x1bc3: 0xbbb9, 0x1bc4: 0xbbd1, 0x1bc5: 0x10e1, 0x1bc6: 0x10f9, 0x1bc7: 0xbbe9, 0x1bc8: 0x2079, 0x1bc9: 0xbc21, 0x1bca: 0xbac9, 0x1bcb: 0x1429, 0x1bcc: 0xbb11, 0x1bcd: 0x10e1, 0x1bce: 0x1111, 0x1bcf: 0x2109, 0x1bd0: 0xbab1, 0x1bd1: 0x1099, 0x1bd2: 0x10b1, 0x1bd3: 0x10c9, 0x1bd4: 0xbac9, 0x1bd5: 0xbae1, 0x1bd6: 0xbaf9, 0x1bd7: 0x1429, 0x1bd8: 0x1a31, 0x1bd9: 0xbb11, 0x1bda: 0xbb29, 0x1bdb: 0xbb41, 0x1bdc: 0xbb59, 0x1bdd: 0xbb71, 0x1bde: 0xbb89, 0x1bdf: 0x2109, 0x1be0: 0x1111, 0x1be1: 0x1429, 0x1be2: 0xbba1, 0x1be3: 0xbbb9, 0x1be4: 0xbbd1, 0x1be5: 0x10e1, 0x1be6: 0x10f9, 0x1be7: 0xbbe9, 0x1be8: 0x2079, 0x1be9: 0xbc01, 0x1bea: 0xbab1, 0x1beb: 0x1099, 0x1bec: 0x10b1, 0x1bed: 0x10c9, 0x1bee: 0xbac9, 0x1bef: 0xbae1, 0x1bf0: 0xbaf9, 0x1bf1: 0x1429, 0x1bf2: 0x1a31, 0x1bf3: 0xbb11, 0x1bf4: 0xbb29, 0x1bf5: 0xbb41, 0x1bf6: 0xbb59, 0x1bf7: 0xbb71, 0x1bf8: 0xbb89, 0x1bf9: 0x2109, 0x1bfa: 0x1111, 0x1bfb: 0xbba1, 0x1bfc: 0xbba1, 0x1bfd: 0xbbb9, 0x1bfe: 0xbbd1, 0x1bff: 0x10e1, // Block 0x70, offset 0x1c00 0x1c00: 0x10f9, 0x1c01: 0xbbe9, 0x1c02: 0x2079, 0x1c03: 0xbc21, 0x1c04: 0xbac9, 0x1c05: 0x1429, 0x1c06: 0xbb11, 0x1c07: 0x10e1, 0x1c08: 0x1111, 0x1c09: 0x2109, 0x1c0a: 0xbc41, 0x1c0b: 0xbc41, 0x1c0c: 0x0040, 0x1c0d: 0x0040, 0x1c0e: 0x1f41, 0x1c0f: 0x00c9, 0x1c10: 0x0069, 0x1c11: 0x0079, 0x1c12: 0x1f51, 0x1c13: 0x1f61, 0x1c14: 0x1f71, 0x1c15: 0x1f81, 0x1c16: 0x1f91, 0x1c17: 0x1fa1, 0x1c18: 0x1f41, 0x1c19: 0x00c9, 0x1c1a: 0x0069, 0x1c1b: 0x0079, 0x1c1c: 0x1f51, 0x1c1d: 0x1f61, 0x1c1e: 0x1f71, 0x1c1f: 0x1f81, 0x1c20: 0x1f91, 0x1c21: 0x1fa1, 0x1c22: 0x1f41, 0x1c23: 0x00c9, 0x1c24: 0x0069, 0x1c25: 0x0079, 0x1c26: 0x1f51, 0x1c27: 0x1f61, 0x1c28: 0x1f71, 0x1c29: 0x1f81, 0x1c2a: 0x1f91, 0x1c2b: 0x1fa1, 0x1c2c: 0x1f41, 0x1c2d: 0x00c9, 0x1c2e: 0x0069, 0x1c2f: 0x0079, 0x1c30: 0x1f51, 0x1c31: 0x1f61, 0x1c32: 0x1f71, 0x1c33: 0x1f81, 0x1c34: 0x1f91, 0x1c35: 0x1fa1, 0x1c36: 0x1f41, 0x1c37: 0x00c9, 0x1c38: 0x0069, 0x1c39: 0x0079, 0x1c3a: 0x1f51, 0x1c3b: 0x1f61, 0x1c3c: 0x1f71, 0x1c3d: 0x1f81, 0x1c3e: 0x1f91, 0x1c3f: 0x1fa1, // Block 0x71, offset 0x1c40 0x1c40: 0xe115, 0x1c41: 0xe115, 0x1c42: 0xe135, 0x1c43: 0xe135, 0x1c44: 0xe115, 0x1c45: 0xe115, 0x1c46: 0xe175, 0x1c47: 0xe175, 0x1c48: 0xe115, 0x1c49: 0xe115, 0x1c4a: 0xe135, 0x1c4b: 0xe135, 0x1c4c: 0xe115, 0x1c4d: 0xe115, 0x1c4e: 0xe1f5, 0x1c4f: 0xe1f5, 0x1c50: 0xe115, 0x1c51: 0xe115, 0x1c52: 0xe135, 0x1c53: 0xe135, 0x1c54: 0xe115, 0x1c55: 0xe115, 0x1c56: 0xe175, 0x1c57: 0xe175, 0x1c58: 0xe115, 0x1c59: 0xe115, 0x1c5a: 0xe135, 0x1c5b: 0xe135, 0x1c5c: 0xe115, 0x1c5d: 0xe115, 0x1c5e: 0x8b3d, 0x1c5f: 0x8b3d, 0x1c60: 0x04b5, 0x1c61: 0x04b5, 0x1c62: 0x0a08, 0x1c63: 0x0a08, 0x1c64: 0x0a08, 0x1c65: 0x0a08, 0x1c66: 0x0a08, 0x1c67: 0x0a08, 0x1c68: 0x0a08, 0x1c69: 0x0a08, 0x1c6a: 0x0a08, 0x1c6b: 0x0a08, 0x1c6c: 0x0a08, 0x1c6d: 0x0a08, 0x1c6e: 0x0a08, 0x1c6f: 0x0a08, 0x1c70: 0x0a08, 0x1c71: 0x0a08, 0x1c72: 0x0a08, 0x1c73: 0x0a08, 0x1c74: 0x0a08, 0x1c75: 0x0a08, 0x1c76: 0x0a08, 0x1c77: 0x0a08, 0x1c78: 0x0a08, 0x1c79: 0x0a08, 0x1c7a: 0x0a08, 0x1c7b: 0x0a08, 0x1c7c: 0x0a08, 0x1c7d: 0x0a08, 0x1c7e: 0x0a08, 0x1c7f: 0x0a08, // Block 0x72, offset 0x1c80 0x1c80: 0xb189, 0x1c81: 0xb1a1, 0x1c82: 0xb201, 0x1c83: 0xb249, 0x1c84: 0x0040, 0x1c85: 0xb411, 0x1c86: 0xb291, 0x1c87: 0xb219, 0x1c88: 0xb309, 0x1c89: 0xb429, 0x1c8a: 0xb399, 0x1c8b: 0xb3b1, 0x1c8c: 0xb3c9, 0x1c8d: 0xb3e1, 0x1c8e: 0xb2a9, 0x1c8f: 0xb339, 0x1c90: 0xb369, 0x1c91: 0xb2d9, 0x1c92: 0xb381, 0x1c93: 0xb279, 0x1c94: 0xb2c1, 0x1c95: 0xb1d1, 0x1c96: 0xb1e9, 0x1c97: 0xb231, 0x1c98: 0xb261, 0x1c99: 0xb2f1, 0x1c9a: 0xb321, 0x1c9b: 0xb351, 0x1c9c: 0xbc59, 0x1c9d: 0x7949, 0x1c9e: 0xbc71, 0x1c9f: 0xbc89, 0x1ca0: 0x0040, 0x1ca1: 0xb1a1, 0x1ca2: 0xb201, 0x1ca3: 0x0040, 0x1ca4: 0xb3f9, 0x1ca5: 0x0040, 0x1ca6: 0x0040, 0x1ca7: 0xb219, 0x1ca8: 0x0040, 0x1ca9: 0xb429, 0x1caa: 0xb399, 0x1cab: 0xb3b1, 0x1cac: 0xb3c9, 0x1cad: 0xb3e1, 0x1cae: 0xb2a9, 0x1caf: 0xb339, 0x1cb0: 0xb369, 0x1cb1: 0xb2d9, 0x1cb2: 0xb381, 0x1cb3: 0x0040, 0x1cb4: 0xb2c1, 0x1cb5: 0xb1d1, 0x1cb6: 0xb1e9, 0x1cb7: 0xb231, 0x1cb8: 0x0040, 0x1cb9: 0xb2f1, 0x1cba: 0x0040, 0x1cbb: 0xb351, 0x1cbc: 0x0040, 0x1cbd: 0x0040, 0x1cbe: 0x0040, 0x1cbf: 0x0040, // Block 0x73, offset 0x1cc0 0x1cc0: 0x0040, 0x1cc1: 0x0040, 0x1cc2: 0xb201, 0x1cc3: 0x0040, 0x1cc4: 0x0040, 0x1cc5: 0x0040, 0x1cc6: 0x0040, 0x1cc7: 0xb219, 0x1cc8: 0x0040, 0x1cc9: 0xb429, 0x1cca: 0x0040, 0x1ccb: 0xb3b1, 0x1ccc: 0x0040, 0x1ccd: 0xb3e1, 0x1cce: 0xb2a9, 0x1ccf: 0xb339, 0x1cd0: 0x0040, 0x1cd1: 0xb2d9, 0x1cd2: 0xb381, 0x1cd3: 0x0040, 0x1cd4: 0xb2c1, 0x1cd5: 0x0040, 0x1cd6: 0x0040, 0x1cd7: 0xb231, 0x1cd8: 0x0040, 0x1cd9: 0xb2f1, 0x1cda: 0x0040, 0x1cdb: 0xb351, 0x1cdc: 0x0040, 0x1cdd: 0x7949, 0x1cde: 0x0040, 0x1cdf: 0xbc89, 0x1ce0: 0x0040, 0x1ce1: 0xb1a1, 0x1ce2: 0xb201, 0x1ce3: 0x0040, 0x1ce4: 0xb3f9, 0x1ce5: 0x0040, 0x1ce6: 0x0040, 0x1ce7: 0xb219, 0x1ce8: 0xb309, 0x1ce9: 0xb429, 0x1cea: 0xb399, 0x1ceb: 0x0040, 0x1cec: 0xb3c9, 0x1ced: 0xb3e1, 0x1cee: 0xb2a9, 0x1cef: 0xb339, 0x1cf0: 0xb369, 0x1cf1: 0xb2d9, 0x1cf2: 0xb381, 0x1cf3: 0x0040, 0x1cf4: 0xb2c1, 0x1cf5: 0xb1d1, 0x1cf6: 0xb1e9, 0x1cf7: 0xb231, 0x1cf8: 0x0040, 0x1cf9: 0xb2f1, 0x1cfa: 0xb321, 0x1cfb: 0xb351, 0x1cfc: 0xbc59, 0x1cfd: 0x0040, 0x1cfe: 0xbc71, 0x1cff: 0x0040, // Block 0x74, offset 0x1d00 0x1d00: 0xb189, 0x1d01: 0xb1a1, 0x1d02: 0xb201, 0x1d03: 0xb249, 0x1d04: 0xb3f9, 0x1d05: 0xb411, 0x1d06: 0xb291, 0x1d07: 0xb219, 0x1d08: 0xb309, 0x1d09: 0xb429, 0x1d0a: 0x0040, 0x1d0b: 0xb3b1, 0x1d0c: 0xb3c9, 0x1d0d: 0xb3e1, 0x1d0e: 0xb2a9, 0x1d0f: 0xb339, 0x1d10: 0xb369, 0x1d11: 0xb2d9, 0x1d12: 0xb381, 0x1d13: 0xb279, 0x1d14: 0xb2c1, 0x1d15: 0xb1d1, 0x1d16: 0xb1e9, 0x1d17: 0xb231, 0x1d18: 0xb261, 0x1d19: 0xb2f1, 0x1d1a: 0xb321, 0x1d1b: 0xb351, 0x1d1c: 0x0040, 0x1d1d: 0x0040, 0x1d1e: 0x0040, 0x1d1f: 0x0040, 0x1d20: 0x0040, 0x1d21: 0xb1a1, 0x1d22: 0xb201, 0x1d23: 0xb249, 0x1d24: 0x0040, 0x1d25: 0xb411, 0x1d26: 0xb291, 0x1d27: 0xb219, 0x1d28: 0xb309, 0x1d29: 0xb429, 0x1d2a: 0x0040, 0x1d2b: 0xb3b1, 0x1d2c: 0xb3c9, 0x1d2d: 0xb3e1, 0x1d2e: 0xb2a9, 0x1d2f: 0xb339, 0x1d30: 0xb369, 0x1d31: 0xb2d9, 0x1d32: 0xb381, 0x1d33: 0xb279, 0x1d34: 0xb2c1, 0x1d35: 0xb1d1, 0x1d36: 0xb1e9, 0x1d37: 0xb231, 0x1d38: 0xb261, 0x1d39: 0xb2f1, 0x1d3a: 0xb321, 0x1d3b: 0xb351, 0x1d3c: 0x0040, 0x1d3d: 0x0040, 0x1d3e: 0x0040, 0x1d3f: 0x0040, // Block 0x75, offset 0x1d40 0x1d40: 0x0040, 0x1d41: 0xbca2, 0x1d42: 0xbcba, 0x1d43: 0xbcd2, 0x1d44: 0xbcea, 0x1d45: 0xbd02, 0x1d46: 0xbd1a, 0x1d47: 0xbd32, 0x1d48: 0xbd4a, 0x1d49: 0xbd62, 0x1d4a: 0xbd7a, 0x1d4b: 0x0018, 0x1d4c: 0x0018, 0x1d4d: 0x0040, 0x1d4e: 0x0040, 0x1d4f: 0x0040, 0x1d50: 0xbd92, 0x1d51: 0xbdb2, 0x1d52: 0xbdd2, 0x1d53: 0xbdf2, 0x1d54: 0xbe12, 0x1d55: 0xbe32, 0x1d56: 0xbe52, 0x1d57: 0xbe72, 0x1d58: 0xbe92, 0x1d59: 0xbeb2, 0x1d5a: 0xbed2, 0x1d5b: 0xbef2, 0x1d5c: 0xbf12, 0x1d5d: 0xbf32, 0x1d5e: 0xbf52, 0x1d5f: 0xbf72, 0x1d60: 0xbf92, 0x1d61: 0xbfb2, 0x1d62: 0xbfd2, 0x1d63: 0xbff2, 0x1d64: 0xc012, 0x1d65: 0xc032, 0x1d66: 0xc052, 0x1d67: 0xc072, 0x1d68: 0xc092, 0x1d69: 0xc0b2, 0x1d6a: 0xc0d1, 0x1d6b: 0x1159, 0x1d6c: 0x0269, 0x1d6d: 0x6671, 0x1d6e: 0xc111, 0x1d6f: 0x0018, 0x1d70: 0x0039, 0x1d71: 0x0ee9, 0x1d72: 0x1159, 0x1d73: 0x0ef9, 0x1d74: 0x0f09, 0x1d75: 0x1199, 0x1d76: 0x0f31, 0x1d77: 0x0249, 0x1d78: 0x0f41, 0x1d79: 0x0259, 0x1d7a: 0x0f51, 0x1d7b: 0x0359, 0x1d7c: 0x0f61, 0x1d7d: 0x0f71, 0x1d7e: 0x00d9, 0x1d7f: 0x0f99, // Block 0x76, offset 0x1d80 0x1d80: 0x2039, 0x1d81: 0x0269, 0x1d82: 0x01d9, 0x1d83: 0x0fa9, 0x1d84: 0x0fb9, 0x1d85: 0x1089, 0x1d86: 0x0279, 0x1d87: 0x0369, 0x1d88: 0x0289, 0x1d89: 0x13d1, 0x1d8a: 0xc129, 0x1d8b: 0x65b1, 0x1d8c: 0xc141, 0x1d8d: 0x1441, 0x1d8e: 0xc159, 0x1d8f: 0xc179, 0x1d90: 0x0018, 0x1d91: 0x0018, 0x1d92: 0x0018, 0x1d93: 0x0018, 0x1d94: 0x0018, 0x1d95: 0x0018, 0x1d96: 0x0018, 0x1d97: 0x0018, 0x1d98: 0x0018, 0x1d99: 0x0018, 0x1d9a: 0x0018, 0x1d9b: 0x0018, 0x1d9c: 0x0018, 0x1d9d: 0x0018, 0x1d9e: 0x0018, 0x1d9f: 0x0018, 0x1da0: 0x0018, 0x1da1: 0x0018, 0x1da2: 0x0018, 0x1da3: 0x0018, 0x1da4: 0x0018, 0x1da5: 0x0018, 0x1da6: 0x0018, 0x1da7: 0x0018, 0x1da8: 0x0018, 0x1da9: 0x0018, 0x1daa: 0xc191, 0x1dab: 0xc1a9, 0x1dac: 0xc1c1, 0x1dad: 0x0040, 0x1dae: 0x0040, 0x1daf: 0x0040, 0x1db0: 0x0018, 0x1db1: 0x0018, 0x1db2: 0x0018, 0x1db3: 0x0018, 0x1db4: 0x0018, 0x1db5: 0x0018, 0x1db6: 0x0018, 0x1db7: 0x0018, 0x1db8: 0x0018, 0x1db9: 0x0018, 0x1dba: 0x0018, 0x1dbb: 0x0018, 0x1dbc: 0x0018, 0x1dbd: 0x0018, 0x1dbe: 0x0018, 0x1dbf: 0x0018, // Block 0x77, offset 0x1dc0 0x1dc0: 0xc1f1, 0x1dc1: 0xc229, 0x1dc2: 0xc261, 0x1dc3: 0x0040, 0x1dc4: 0x0040, 0x1dc5: 0x0040, 0x1dc6: 0x0040, 0x1dc7: 0x0040, 0x1dc8: 0x0040, 0x1dc9: 0x0040, 0x1dca: 0x0040, 0x1dcb: 0x0040, 0x1dcc: 0x0040, 0x1dcd: 0x0040, 0x1dce: 0x0040, 0x1dcf: 0x0040, 0x1dd0: 0xc281, 0x1dd1: 0xc2a1, 0x1dd2: 0xc2c1, 0x1dd3: 0xc2e1, 0x1dd4: 0xc301, 0x1dd5: 0xc321, 0x1dd6: 0xc341, 0x1dd7: 0xc361, 0x1dd8: 0xc381, 0x1dd9: 0xc3a1, 0x1dda: 0xc3c1, 0x1ddb: 0xc3e1, 0x1ddc: 0xc401, 0x1ddd: 0xc421, 0x1dde: 0xc441, 0x1ddf: 0xc461, 0x1de0: 0xc481, 0x1de1: 0xc4a1, 0x1de2: 0xc4c1, 0x1de3: 0xc4e1, 0x1de4: 0xc501, 0x1de5: 0xc521, 0x1de6: 0xc541, 0x1de7: 0xc561, 0x1de8: 0xc581, 0x1de9: 0xc5a1, 0x1dea: 0xc5c1, 0x1deb: 0xc5e1, 0x1dec: 0xc601, 0x1ded: 0xc621, 0x1dee: 0xc641, 0x1def: 0xc661, 0x1df0: 0xc681, 0x1df1: 0xc6a1, 0x1df2: 0xc6c1, 0x1df3: 0xc6e1, 0x1df4: 0xc701, 0x1df5: 0xc721, 0x1df6: 0xc741, 0x1df7: 0xc761, 0x1df8: 0xc781, 0x1df9: 0xc7a1, 0x1dfa: 0xc7c1, 0x1dfb: 0xc7e1, 0x1dfc: 0x0040, 0x1dfd: 0x0040, 0x1dfe: 0x0040, 0x1dff: 0x0040, // Block 0x78, offset 0x1e00 0x1e00: 0xcb11, 0x1e01: 0xcb31, 0x1e02: 0xcb51, 0x1e03: 0x8b55, 0x1e04: 0xcb71, 0x1e05: 0xcb91, 0x1e06: 0xcbb1, 0x1e07: 0xcbd1, 0x1e08: 0xcbf1, 0x1e09: 0xcc11, 0x1e0a: 0xcc31, 0x1e0b: 0xcc51, 0x1e0c: 0xcc71, 0x1e0d: 0x8b75, 0x1e0e: 0xcc91, 0x1e0f: 0xccb1, 0x1e10: 0xccd1, 0x1e11: 0xccf1, 0x1e12: 0x8b95, 0x1e13: 0xcd11, 0x1e14: 0xcd31, 0x1e15: 0xc441, 0x1e16: 0x8bb5, 0x1e17: 0xcd51, 0x1e18: 0xcd71, 0x1e19: 0xcd91, 0x1e1a: 0xcdb1, 0x1e1b: 0xcdd1, 0x1e1c: 0x8bd5, 0x1e1d: 0xcdf1, 0x1e1e: 0xce11, 0x1e1f: 0xce31, 0x1e20: 0xce51, 0x1e21: 0xce71, 0x1e22: 0xc7a1, 0x1e23: 0xce91, 0x1e24: 0xceb1, 0x1e25: 0xced1, 0x1e26: 0xcef1, 0x1e27: 0xcf11, 0x1e28: 0xcf31, 0x1e29: 0xcf51, 0x1e2a: 0xcf71, 0x1e2b: 0xcf91, 0x1e2c: 0xcfb1, 0x1e2d: 0xcfd1, 0x1e2e: 0xcff1, 0x1e2f: 0xd011, 0x1e30: 0xd031, 0x1e31: 0xd051, 0x1e32: 0xd051, 0x1e33: 0xd051, 0x1e34: 0x8bf5, 0x1e35: 0xd071, 0x1e36: 0xd091, 0x1e37: 0xd0b1, 0x1e38: 0x8c15, 0x1e39: 0xd0d1, 0x1e3a: 0xd0f1, 0x1e3b: 0xd111, 0x1e3c: 0xd131, 0x1e3d: 0xd151, 0x1e3e: 0xd171, 0x1e3f: 0xd191, // Block 0x79, offset 0x1e40 0x1e40: 0xd1b1, 0x1e41: 0xd1d1, 0x1e42: 0xd1f1, 0x1e43: 0xd211, 0x1e44: 0xd231, 0x1e45: 0xd251, 0x1e46: 0xd251, 0x1e47: 0xd271, 0x1e48: 0xd291, 0x1e49: 0xd2b1, 0x1e4a: 0xd2d1, 0x1e4b: 0xd2f1, 0x1e4c: 0xd311, 0x1e4d: 0xd331, 0x1e4e: 0xd351, 0x1e4f: 0xd371, 0x1e50: 0xd391, 0x1e51: 0xd3b1, 0x1e52: 0xd3d1, 0x1e53: 0xd3f1, 0x1e54: 0xd411, 0x1e55: 0xd431, 0x1e56: 0xd451, 0x1e57: 0xd471, 0x1e58: 0xd491, 0x1e59: 0x8c35, 0x1e5a: 0xd4b1, 0x1e5b: 0xd4d1, 0x1e5c: 0xd4f1, 0x1e5d: 0xc321, 0x1e5e: 0xd511, 0x1e5f: 0xd531, 0x1e60: 0x8c55, 0x1e61: 0x8c75, 0x1e62: 0xd551, 0x1e63: 0xd571, 0x1e64: 0xd591, 0x1e65: 0xd5b1, 0x1e66: 0xd5d1, 0x1e67: 0xd5f1, 0x1e68: 0x2040, 0x1e69: 0xd611, 0x1e6a: 0xd631, 0x1e6b: 0xd631, 0x1e6c: 0x8c95, 0x1e6d: 0xd651, 0x1e6e: 0xd671, 0x1e6f: 0xd691, 0x1e70: 0xd6b1, 0x1e71: 0x8cb5, 0x1e72: 0xd6d1, 0x1e73: 0xd6f1, 0x1e74: 0x2040, 0x1e75: 0xd711, 0x1e76: 0xd731, 0x1e77: 0xd751, 0x1e78: 0xd771, 0x1e79: 0xd791, 0x1e7a: 0xd7b1, 0x1e7b: 0x8cd5, 0x1e7c: 0xd7d1, 0x1e7d: 0x8cf5, 0x1e7e: 0xd7f1, 0x1e7f: 0xd811, // Block 0x7a, offset 0x1e80 0x1e80: 0xd831, 0x1e81: 0xd851, 0x1e82: 0xd871, 0x1e83: 0xd891, 0x1e84: 0xd8b1, 0x1e85: 0xd8d1, 0x1e86: 0xd8f1, 0x1e87: 0xd911, 0x1e88: 0xd931, 0x1e89: 0x8d15, 0x1e8a: 0xd951, 0x1e8b: 0xd971, 0x1e8c: 0xd991, 0x1e8d: 0xd9b1, 0x1e8e: 0xd9d1, 0x1e8f: 0x8d35, 0x1e90: 0xd9f1, 0x1e91: 0x8d55, 0x1e92: 0x8d75, 0x1e93: 0xda11, 0x1e94: 0xda31, 0x1e95: 0xda31, 0x1e96: 0xda51, 0x1e97: 0x8d95, 0x1e98: 0x8db5, 0x1e99: 0xda71, 0x1e9a: 0xda91, 0x1e9b: 0xdab1, 0x1e9c: 0xdad1, 0x1e9d: 0xdaf1, 0x1e9e: 0xdb11, 0x1e9f: 0xdb31, 0x1ea0: 0xdb51, 0x1ea1: 0xdb71, 0x1ea2: 0xdb91, 0x1ea3: 0xdbb1, 0x1ea4: 0x8dd5, 0x1ea5: 0xdbd1, 0x1ea6: 0xdbf1, 0x1ea7: 0xdc11, 0x1ea8: 0xdc31, 0x1ea9: 0xdc11, 0x1eaa: 0xdc51, 0x1eab: 0xdc71, 0x1eac: 0xdc91, 0x1ead: 0xdcb1, 0x1eae: 0xdcd1, 0x1eaf: 0xdcf1, 0x1eb0: 0xdd11, 0x1eb1: 0xdd31, 0x1eb2: 0xdd51, 0x1eb3: 0xdd71, 0x1eb4: 0xdd91, 0x1eb5: 0xddb1, 0x1eb6: 0xddd1, 0x1eb7: 0xddf1, 0x1eb8: 0x8df5, 0x1eb9: 0xde11, 0x1eba: 0xde31, 0x1ebb: 0xde51, 0x1ebc: 0xde71, 0x1ebd: 0xde91, 0x1ebe: 0x8e15, 0x1ebf: 0xdeb1, // Block 0x7b, offset 0x1ec0 0x1ec0: 0xe5b1, 0x1ec1: 0xe5d1, 0x1ec2: 0xe5f1, 0x1ec3: 0xe611, 0x1ec4: 0xe631, 0x1ec5: 0xe651, 0x1ec6: 0x8f35, 0x1ec7: 0xe671, 0x1ec8: 0xe691, 0x1ec9: 0xe6b1, 0x1eca: 0xe6d1, 0x1ecb: 0xe6f1, 0x1ecc: 0xe711, 0x1ecd: 0x8f55, 0x1ece: 0xe731, 0x1ecf: 0xe751, 0x1ed0: 0x8f75, 0x1ed1: 0x8f95, 0x1ed2: 0xe771, 0x1ed3: 0xe791, 0x1ed4: 0xe7b1, 0x1ed5: 0xe7d1, 0x1ed6: 0xe7f1, 0x1ed7: 0xe811, 0x1ed8: 0xe831, 0x1ed9: 0xe851, 0x1eda: 0xe871, 0x1edb: 0x8fb5, 0x1edc: 0xe891, 0x1edd: 0x8fd5, 0x1ede: 0xe8b1, 0x1edf: 0x2040, 0x1ee0: 0xe8d1, 0x1ee1: 0xe8f1, 0x1ee2: 0xe911, 0x1ee3: 0x8ff5, 0x1ee4: 0xe931, 0x1ee5: 0xe951, 0x1ee6: 0x9015, 0x1ee7: 0x9035, 0x1ee8: 0xe971, 0x1ee9: 0xe991, 0x1eea: 0xe9b1, 0x1eeb: 0xe9d1, 0x1eec: 0xe9f1, 0x1eed: 0xe9f1, 0x1eee: 0xea11, 0x1eef: 0xea31, 0x1ef0: 0xea51, 0x1ef1: 0xea71, 0x1ef2: 0xea91, 0x1ef3: 0xeab1, 0x1ef4: 0xead1, 0x1ef5: 0x9055, 0x1ef6: 0xeaf1, 0x1ef7: 0x9075, 0x1ef8: 0xeb11, 0x1ef9: 0x9095, 0x1efa: 0xeb31, 0x1efb: 0x90b5, 0x1efc: 0x90d5, 0x1efd: 0x90f5, 0x1efe: 0xeb51, 0x1eff: 0xeb71, // Block 0x7c, offset 0x1f00 0x1f00: 0xeb91, 0x1f01: 0x9115, 0x1f02: 0x9135, 0x1f03: 0x9155, 0x1f04: 0x9175, 0x1f05: 0xebb1, 0x1f06: 0xebd1, 0x1f07: 0xebd1, 0x1f08: 0xebf1, 0x1f09: 0xec11, 0x1f0a: 0xec31, 0x1f0b: 0xec51, 0x1f0c: 0xec71, 0x1f0d: 0x9195, 0x1f0e: 0xec91, 0x1f0f: 0xecb1, 0x1f10: 0xecd1, 0x1f11: 0xecf1, 0x1f12: 0x91b5, 0x1f13: 0xed11, 0x1f14: 0x91d5, 0x1f15: 0x91f5, 0x1f16: 0xed31, 0x1f17: 0xed51, 0x1f18: 0xed71, 0x1f19: 0xed91, 0x1f1a: 0xedb1, 0x1f1b: 0xedd1, 0x1f1c: 0x9215, 0x1f1d: 0x9235, 0x1f1e: 0x9255, 0x1f1f: 0x2040, 0x1f20: 0xedf1, 0x1f21: 0x9275, 0x1f22: 0xee11, 0x1f23: 0xee31, 0x1f24: 0xee51, 0x1f25: 0x9295, 0x1f26: 0xee71, 0x1f27: 0xee91, 0x1f28: 0xeeb1, 0x1f29: 0xeed1, 0x1f2a: 0xeef1, 0x1f2b: 0x92b5, 0x1f2c: 0xef11, 0x1f2d: 0xef31, 0x1f2e: 0xef51, 0x1f2f: 0xef71, 0x1f30: 0xef91, 0x1f31: 0xefb1, 0x1f32: 0x92d5, 0x1f33: 0x92f5, 0x1f34: 0xefd1, 0x1f35: 0x9315, 0x1f36: 0xeff1, 0x1f37: 0x9335, 0x1f38: 0xf011, 0x1f39: 0xf031, 0x1f3a: 0xf051, 0x1f3b: 0x9355, 0x1f3c: 0x9375, 0x1f3d: 0xf071, 0x1f3e: 0x9395, 0x1f3f: 0xf091, // Block 0x7d, offset 0x1f40 0x1f40: 0xf6d1, 0x1f41: 0xf6f1, 0x1f42: 0xf711, 0x1f43: 0xf731, 0x1f44: 0xf751, 0x1f45: 0x9555, 0x1f46: 0xf771, 0x1f47: 0xf791, 0x1f48: 0xf7b1, 0x1f49: 0xf7d1, 0x1f4a: 0xf7f1, 0x1f4b: 0x9575, 0x1f4c: 0x9595, 0x1f4d: 0xf811, 0x1f4e: 0xf831, 0x1f4f: 0xf851, 0x1f50: 0xf871, 0x1f51: 0xf891, 0x1f52: 0xf8b1, 0x1f53: 0x95b5, 0x1f54: 0xf8d1, 0x1f55: 0xf8f1, 0x1f56: 0xf911, 0x1f57: 0xf931, 0x1f58: 0x95d5, 0x1f59: 0x95f5, 0x1f5a: 0xf951, 0x1f5b: 0xf971, 0x1f5c: 0xf991, 0x1f5d: 0x9615, 0x1f5e: 0xf9b1, 0x1f5f: 0xf9d1, 0x1f60: 0x684d, 0x1f61: 0x9635, 0x1f62: 0xf9f1, 0x1f63: 0xfa11, 0x1f64: 0xfa31, 0x1f65: 0x9655, 0x1f66: 0xfa51, 0x1f67: 0xfa71, 0x1f68: 0xfa91, 0x1f69: 0xfab1, 0x1f6a: 0xfad1, 0x1f6b: 0xfaf1, 0x1f6c: 0xfb11, 0x1f6d: 0x9675, 0x1f6e: 0xfb31, 0x1f6f: 0xfb51, 0x1f70: 0xfb71, 0x1f71: 0x9695, 0x1f72: 0xfb91, 0x1f73: 0xfbb1, 0x1f74: 0xfbd1, 0x1f75: 0xfbf1, 0x1f76: 0x7b6d, 0x1f77: 0x96b5, 0x1f78: 0xfc11, 0x1f79: 0xfc31, 0x1f7a: 0xfc51, 0x1f7b: 0x96d5, 0x1f7c: 0xfc71, 0x1f7d: 0x96f5, 0x1f7e: 0xfc91, 0x1f7f: 0xfc91, // Block 0x7e, offset 0x1f80 0x1f80: 0xfcb1, 0x1f81: 0x9715, 0x1f82: 0xfcd1, 0x1f83: 0xfcf1, 0x1f84: 0xfd11, 0x1f85: 0xfd31, 0x1f86: 0xfd51, 0x1f87: 0xfd71, 0x1f88: 0xfd91, 0x1f89: 0x9735, 0x1f8a: 0xfdb1, 0x1f8b: 0xfdd1, 0x1f8c: 0xfdf1, 0x1f8d: 0xfe11, 0x1f8e: 0xfe31, 0x1f8f: 0xfe51, 0x1f90: 0x9755, 0x1f91: 0xfe71, 0x1f92: 0x9775, 0x1f93: 0x9795, 0x1f94: 0x97b5, 0x1f95: 0xfe91, 0x1f96: 0xfeb1, 0x1f97: 0xfed1, 0x1f98: 0xfef1, 0x1f99: 0xff11, 0x1f9a: 0xff31, 0x1f9b: 0xff51, 0x1f9c: 0xff71, 0x1f9d: 0x97d5, 0x1f9e: 0x0040, 0x1f9f: 0x0040, 0x1fa0: 0x0040, 0x1fa1: 0x0040, 0x1fa2: 0x0040, 0x1fa3: 0x0040, 0x1fa4: 0x0040, 0x1fa5: 0x0040, 0x1fa6: 0x0040, 0x1fa7: 0x0040, 0x1fa8: 0x0040, 0x1fa9: 0x0040, 0x1faa: 0x0040, 0x1fab: 0x0040, 0x1fac: 0x0040, 0x1fad: 0x0040, 0x1fae: 0x0040, 0x1faf: 0x0040, 0x1fb0: 0x0040, 0x1fb1: 0x0040, 0x1fb2: 0x0040, 0x1fb3: 0x0040, 0x1fb4: 0x0040, 0x1fb5: 0x0040, 0x1fb6: 0x0040, 0x1fb7: 0x0040, 0x1fb8: 0x0040, 0x1fb9: 0x0040, 0x1fba: 0x0040, 0x1fbb: 0x0040, 0x1fbc: 0x0040, 0x1fbd: 0x0040, 0x1fbe: 0x0040, 0x1fbf: 0x0040, } // idnaIndex: 36 blocks, 2304 entries, 4608 bytes // Block 0 is the zero block. var idnaIndex = [2304]uint16{ // Block 0x0, offset 0x0 // Block 0x1, offset 0x40 // Block 0x2, offset 0x80 // Block 0x3, offset 0xc0 0xc2: 0x01, 0xc3: 0x7d, 0xc4: 0x02, 0xc5: 0x03, 0xc6: 0x04, 0xc7: 0x05, 0xc8: 0x06, 0xc9: 0x7e, 0xca: 0x7f, 0xcb: 0x07, 0xcc: 0x80, 0xcd: 0x08, 0xce: 0x09, 0xcf: 0x0a, 0xd0: 0x81, 0xd1: 0x0b, 0xd2: 0x0c, 0xd3: 0x0d, 0xd4: 0x0e, 0xd5: 0x82, 0xd6: 0x83, 0xd7: 0x84, 0xd8: 0x0f, 0xd9: 0x10, 0xda: 0x85, 0xdb: 0x11, 0xdc: 0x12, 0xdd: 0x86, 0xde: 0x87, 0xdf: 0x88, 0xe0: 0x02, 0xe1: 0x03, 0xe2: 0x04, 0xe3: 0x05, 0xe4: 0x06, 0xe5: 0x07, 0xe6: 0x07, 0xe7: 0x07, 0xe8: 0x07, 0xe9: 0x08, 0xea: 0x09, 0xeb: 0x07, 0xec: 0x07, 0xed: 0x0a, 0xee: 0x0b, 0xef: 0x0c, 0xf0: 0x1d, 0xf1: 0x1e, 0xf2: 0x1e, 0xf3: 0x20, 0xf4: 0x21, // Block 0x4, offset 0x100 0x120: 0x89, 0x121: 0x13, 0x122: 0x8a, 0x123: 0x8b, 0x124: 0x8c, 0x125: 0x14, 0x126: 0x15, 0x127: 0x16, 0x128: 0x17, 0x129: 0x18, 0x12a: 0x19, 0x12b: 0x1a, 0x12c: 0x1b, 0x12d: 0x1c, 0x12e: 0x1d, 0x12f: 0x8d, 0x130: 0x8e, 0x131: 0x1e, 0x132: 0x1f, 0x133: 0x20, 0x134: 0x8f, 0x135: 0x21, 0x136: 0x90, 0x137: 0x91, 0x138: 0x92, 0x139: 0x93, 0x13a: 0x22, 0x13b: 0x94, 0x13c: 0x95, 0x13d: 0x23, 0x13e: 0x24, 0x13f: 0x96, // Block 0x5, offset 0x140 0x140: 0x97, 0x141: 0x98, 0x142: 0x99, 0x143: 0x9a, 0x144: 0x9b, 0x145: 0x9c, 0x146: 0x9d, 0x147: 0x9e, 0x148: 0x9f, 0x149: 0xa0, 0x14a: 0xa1, 0x14b: 0xa2, 0x14c: 0xa3, 0x14d: 0xa4, 0x14e: 0xa5, 0x14f: 0xa6, 0x150: 0xa7, 0x151: 0x9f, 0x152: 0x9f, 0x153: 0x9f, 0x154: 0x9f, 0x155: 0x9f, 0x156: 0x9f, 0x157: 0x9f, 0x158: 0x9f, 0x159: 0xa8, 0x15a: 0xa9, 0x15b: 0xaa, 0x15c: 0xab, 0x15d: 0xac, 0x15e: 0xad, 0x15f: 0xae, 0x160: 0xaf, 0x161: 0xb0, 0x162: 0xb1, 0x163: 0xb2, 0x164: 0xb3, 0x165: 0xb4, 0x166: 0xb5, 0x167: 0xb6, 0x168: 0xb7, 0x169: 0xb8, 0x16a: 0xb9, 0x16b: 0xba, 0x16c: 0xbb, 0x16d: 0xbc, 0x16e: 0xbd, 0x16f: 0xbe, 0x170: 0xbf, 0x171: 0xc0, 0x172: 0xc1, 0x173: 0xc2, 0x174: 0x25, 0x175: 0x26, 0x176: 0x27, 0x177: 0xc3, 0x178: 0x28, 0x179: 0x28, 0x17a: 0x29, 0x17b: 0x28, 0x17c: 0xc4, 0x17d: 0x2a, 0x17e: 0x2b, 0x17f: 0x2c, // Block 0x6, offset 0x180 0x180: 0x2d, 0x181: 0x2e, 0x182: 0x2f, 0x183: 0xc5, 0x184: 0x30, 0x185: 0x31, 0x186: 0xc6, 0x187: 0x9b, 0x188: 0xc7, 0x189: 0xc8, 0x18a: 0x9b, 0x18b: 0x9b, 0x18c: 0xc9, 0x18d: 0x9b, 0x18e: 0x9b, 0x18f: 0x9b, 0x190: 0xca, 0x191: 0x32, 0x192: 0x33, 0x193: 0x34, 0x194: 0x9b, 0x195: 0x9b, 0x196: 0x9b, 0x197: 0x9b, 0x198: 0x9b, 0x199: 0x9b, 0x19a: 0x9b, 0x19b: 0x9b, 0x19c: 0x9b, 0x19d: 0x9b, 0x19e: 0x9b, 0x19f: 0x9b, 0x1a0: 0x9b, 0x1a1: 0x9b, 0x1a2: 0x9b, 0x1a3: 0x9b, 0x1a4: 0x9b, 0x1a5: 0x9b, 0x1a6: 0x9b, 0x1a7: 0x9b, 0x1a8: 0xcb, 0x1a9: 0xcc, 0x1aa: 0x9b, 0x1ab: 0xcd, 0x1ac: 0x9b, 0x1ad: 0xce, 0x1ae: 0xcf, 0x1af: 0x9b, 0x1b0: 0xd0, 0x1b1: 0x35, 0x1b2: 0x28, 0x1b3: 0x36, 0x1b4: 0xd1, 0x1b5: 0xd2, 0x1b6: 0xd3, 0x1b7: 0xd4, 0x1b8: 0xd5, 0x1b9: 0xd6, 0x1ba: 0xd7, 0x1bb: 0xd8, 0x1bc: 0xd9, 0x1bd: 0xda, 0x1be: 0xdb, 0x1bf: 0x37, // Block 0x7, offset 0x1c0 0x1c0: 0x38, 0x1c1: 0xdc, 0x1c2: 0xdd, 0x1c3: 0xde, 0x1c4: 0xdf, 0x1c5: 0x39, 0x1c6: 0x3a, 0x1c7: 0xe0, 0x1c8: 0xe1, 0x1c9: 0x3b, 0x1ca: 0x3c, 0x1cb: 0x3d, 0x1cc: 0x3e, 0x1cd: 0x3f, 0x1ce: 0x40, 0x1cf: 0x41, 0x1d0: 0x9f, 0x1d1: 0x9f, 0x1d2: 0x9f, 0x1d3: 0x9f, 0x1d4: 0x9f, 0x1d5: 0x9f, 0x1d6: 0x9f, 0x1d7: 0x9f, 0x1d8: 0x9f, 0x1d9: 0x9f, 0x1da: 0x9f, 0x1db: 0x9f, 0x1dc: 0x9f, 0x1dd: 0x9f, 0x1de: 0x9f, 0x1df: 0x9f, 0x1e0: 0x9f, 0x1e1: 0x9f, 0x1e2: 0x9f, 0x1e3: 0x9f, 0x1e4: 0x9f, 0x1e5: 0x9f, 0x1e6: 0x9f, 0x1e7: 0x9f, 0x1e8: 0x9f, 0x1e9: 0x9f, 0x1ea: 0x9f, 0x1eb: 0x9f, 0x1ec: 0x9f, 0x1ed: 0x9f, 0x1ee: 0x9f, 0x1ef: 0x9f, 0x1f0: 0x9f, 0x1f1: 0x9f, 0x1f2: 0x9f, 0x1f3: 0x9f, 0x1f4: 0x9f, 0x1f5: 0x9f, 0x1f6: 0x9f, 0x1f7: 0x9f, 0x1f8: 0x9f, 0x1f9: 0x9f, 0x1fa: 0x9f, 0x1fb: 0x9f, 0x1fc: 0x9f, 0x1fd: 0x9f, 0x1fe: 0x9f, 0x1ff: 0x9f, // Block 0x8, offset 0x200 0x200: 0x9f, 0x201: 0x9f, 0x202: 0x9f, 0x203: 0x9f, 0x204: 0x9f, 0x205: 0x9f, 0x206: 0x9f, 0x207: 0x9f, 0x208: 0x9f, 0x209: 0x9f, 0x20a: 0x9f, 0x20b: 0x9f, 0x20c: 0x9f, 0x20d: 0x9f, 0x20e: 0x9f, 0x20f: 0x9f, 0x210: 0x9f, 0x211: 0x9f, 0x212: 0x9f, 0x213: 0x9f, 0x214: 0x9f, 0x215: 0x9f, 0x216: 0x9f, 0x217: 0x9f, 0x218: 0x9f, 0x219: 0x9f, 0x21a: 0x9f, 0x21b: 0x9f, 0x21c: 0x9f, 0x21d: 0x9f, 0x21e: 0x9f, 0x21f: 0x9f, 0x220: 0x9f, 0x221: 0x9f, 0x222: 0x9f, 0x223: 0x9f, 0x224: 0x9f, 0x225: 0x9f, 0x226: 0x9f, 0x227: 0x9f, 0x228: 0x9f, 0x229: 0x9f, 0x22a: 0x9f, 0x22b: 0x9f, 0x22c: 0x9f, 0x22d: 0x9f, 0x22e: 0x9f, 0x22f: 0x9f, 0x230: 0x9f, 0x231: 0x9f, 0x232: 0x9f, 0x233: 0x9f, 0x234: 0x9f, 0x235: 0x9f, 0x236: 0xb2, 0x237: 0x9b, 0x238: 0x9f, 0x239: 0x9f, 0x23a: 0x9f, 0x23b: 0x9f, 0x23c: 0x9f, 0x23d: 0x9f, 0x23e: 0x9f, 0x23f: 0x9f, // Block 0x9, offset 0x240 0x240: 0x9f, 0x241: 0x9f, 0x242: 0x9f, 0x243: 0x9f, 0x244: 0x9f, 0x245: 0x9f, 0x246: 0x9f, 0x247: 0x9f, 0x248: 0x9f, 0x249: 0x9f, 0x24a: 0x9f, 0x24b: 0x9f, 0x24c: 0x9f, 0x24d: 0x9f, 0x24e: 0x9f, 0x24f: 0x9f, 0x250: 0x9f, 0x251: 0x9f, 0x252: 0x9f, 0x253: 0x9f, 0x254: 0x9f, 0x255: 0x9f, 0x256: 0x9f, 0x257: 0x9f, 0x258: 0x9f, 0x259: 0x9f, 0x25a: 0x9f, 0x25b: 0x9f, 0x25c: 0x9f, 0x25d: 0x9f, 0x25e: 0x9f, 0x25f: 0x9f, 0x260: 0x9f, 0x261: 0x9f, 0x262: 0x9f, 0x263: 0x9f, 0x264: 0x9f, 0x265: 0x9f, 0x266: 0x9f, 0x267: 0x9f, 0x268: 0x9f, 0x269: 0x9f, 0x26a: 0x9f, 0x26b: 0x9f, 0x26c: 0x9f, 0x26d: 0x9f, 0x26e: 0x9f, 0x26f: 0x9f, 0x270: 0x9f, 0x271: 0x9f, 0x272: 0x9f, 0x273: 0x9f, 0x274: 0x9f, 0x275: 0x9f, 0x276: 0x9f, 0x277: 0x9f, 0x278: 0x9f, 0x279: 0x9f, 0x27a: 0x9f, 0x27b: 0x9f, 0x27c: 0x9f, 0x27d: 0x9f, 0x27e: 0x9f, 0x27f: 0x9f, // Block 0xa, offset 0x280 0x280: 0x9f, 0x281: 0x9f, 0x282: 0x9f, 0x283: 0x9f, 0x284: 0x9f, 0x285: 0x9f, 0x286: 0x9f, 0x287: 0x9f, 0x288: 0x9f, 0x289: 0x9f, 0x28a: 0x9f, 0x28b: 0x9f, 0x28c: 0x9f, 0x28d: 0x9f, 0x28e: 0x9f, 0x28f: 0x9f, 0x290: 0x9f, 0x291: 0x9f, 0x292: 0x9f, 0x293: 0x9f, 0x294: 0x9f, 0x295: 0x9f, 0x296: 0x9f, 0x297: 0x9f, 0x298: 0x9f, 0x299: 0x9f, 0x29a: 0x9f, 0x29b: 0x9f, 0x29c: 0x9f, 0x29d: 0x9f, 0x29e: 0x9f, 0x29f: 0x9f, 0x2a0: 0x9f, 0x2a1: 0x9f, 0x2a2: 0x9f, 0x2a3: 0x9f, 0x2a4: 0x9f, 0x2a5: 0x9f, 0x2a6: 0x9f, 0x2a7: 0x9f, 0x2a8: 0x9f, 0x2a9: 0x9f, 0x2aa: 0x9f, 0x2ab: 0x9f, 0x2ac: 0x9f, 0x2ad: 0x9f, 0x2ae: 0x9f, 0x2af: 0x9f, 0x2b0: 0x9f, 0x2b1: 0x9f, 0x2b2: 0x9f, 0x2b3: 0x9f, 0x2b4: 0x9f, 0x2b5: 0x9f, 0x2b6: 0x9f, 0x2b7: 0x9f, 0x2b8: 0x9f, 0x2b9: 0x9f, 0x2ba: 0x9f, 0x2bb: 0x9f, 0x2bc: 0x9f, 0x2bd: 0x9f, 0x2be: 0x9f, 0x2bf: 0xe2, // Block 0xb, offset 0x2c0 0x2c0: 0x9f, 0x2c1: 0x9f, 0x2c2: 0x9f, 0x2c3: 0x9f, 0x2c4: 0x9f, 0x2c5: 0x9f, 0x2c6: 0x9f, 0x2c7: 0x9f, 0x2c8: 0x9f, 0x2c9: 0x9f, 0x2ca: 0x9f, 0x2cb: 0x9f, 0x2cc: 0x9f, 0x2cd: 0x9f, 0x2ce: 0x9f, 0x2cf: 0x9f, 0x2d0: 0x9f, 0x2d1: 0x9f, 0x2d2: 0xe3, 0x2d3: 0xe4, 0x2d4: 0x9f, 0x2d5: 0x9f, 0x2d6: 0x9f, 0x2d7: 0x9f, 0x2d8: 0xe5, 0x2d9: 0x42, 0x2da: 0x43, 0x2db: 0xe6, 0x2dc: 0x44, 0x2dd: 0x45, 0x2de: 0x46, 0x2df: 0xe7, 0x2e0: 0xe8, 0x2e1: 0xe9, 0x2e2: 0xea, 0x2e3: 0xeb, 0x2e4: 0xec, 0x2e5: 0xed, 0x2e6: 0xee, 0x2e7: 0xef, 0x2e8: 0xf0, 0x2e9: 0xf1, 0x2ea: 0xf2, 0x2eb: 0xf3, 0x2ec: 0xf4, 0x2ed: 0xf5, 0x2ee: 0xf6, 0x2ef: 0xf7, 0x2f0: 0x9f, 0x2f1: 0x9f, 0x2f2: 0x9f, 0x2f3: 0x9f, 0x2f4: 0x9f, 0x2f5: 0x9f, 0x2f6: 0x9f, 0x2f7: 0x9f, 0x2f8: 0x9f, 0x2f9: 0x9f, 0x2fa: 0x9f, 0x2fb: 0x9f, 0x2fc: 0x9f, 0x2fd: 0x9f, 0x2fe: 0x9f, 0x2ff: 0x9f, // Block 0xc, offset 0x300 0x300: 0x9f, 0x301: 0x9f, 0x302: 0x9f, 0x303: 0x9f, 0x304: 0x9f, 0x305: 0x9f, 0x306: 0x9f, 0x307: 0x9f, 0x308: 0x9f, 0x309: 0x9f, 0x30a: 0x9f, 0x30b: 0x9f, 0x30c: 0x9f, 0x30d: 0x9f, 0x30e: 0x9f, 0x30f: 0x9f, 0x310: 0x9f, 0x311: 0x9f, 0x312: 0x9f, 0x313: 0x9f, 0x314: 0x9f, 0x315: 0x9f, 0x316: 0x9f, 0x317: 0x9f, 0x318: 0x9f, 0x319: 0x9f, 0x31a: 0x9f, 0x31b: 0x9f, 0x31c: 0x9f, 0x31d: 0x9f, 0x31e: 0xf8, 0x31f: 0xf9, // Block 0xd, offset 0x340 0x340: 0xba, 0x341: 0xba, 0x342: 0xba, 0x343: 0xba, 0x344: 0xba, 0x345: 0xba, 0x346: 0xba, 0x347: 0xba, 0x348: 0xba, 0x349: 0xba, 0x34a: 0xba, 0x34b: 0xba, 0x34c: 0xba, 0x34d: 0xba, 0x34e: 0xba, 0x34f: 0xba, 0x350: 0xba, 0x351: 0xba, 0x352: 0xba, 0x353: 0xba, 0x354: 0xba, 0x355: 0xba, 0x356: 0xba, 0x357: 0xba, 0x358: 0xba, 0x359: 0xba, 0x35a: 0xba, 0x35b: 0xba, 0x35c: 0xba, 0x35d: 0xba, 0x35e: 0xba, 0x35f: 0xba, 0x360: 0xba, 0x361: 0xba, 0x362: 0xba, 0x363: 0xba, 0x364: 0xba, 0x365: 0xba, 0x366: 0xba, 0x367: 0xba, 0x368: 0xba, 0x369: 0xba, 0x36a: 0xba, 0x36b: 0xba, 0x36c: 0xba, 0x36d: 0xba, 0x36e: 0xba, 0x36f: 0xba, 0x370: 0xba, 0x371: 0xba, 0x372: 0xba, 0x373: 0xba, 0x374: 0xba, 0x375: 0xba, 0x376: 0xba, 0x377: 0xba, 0x378: 0xba, 0x379: 0xba, 0x37a: 0xba, 0x37b: 0xba, 0x37c: 0xba, 0x37d: 0xba, 0x37e: 0xba, 0x37f: 0xba, // Block 0xe, offset 0x380 0x380: 0xba, 0x381: 0xba, 0x382: 0xba, 0x383: 0xba, 0x384: 0xba, 0x385: 0xba, 0x386: 0xba, 0x387: 0xba, 0x388: 0xba, 0x389: 0xba, 0x38a: 0xba, 0x38b: 0xba, 0x38c: 0xba, 0x38d: 0xba, 0x38e: 0xba, 0x38f: 0xba, 0x390: 0xba, 0x391: 0xba, 0x392: 0xba, 0x393: 0xba, 0x394: 0xba, 0x395: 0xba, 0x396: 0xba, 0x397: 0xba, 0x398: 0xba, 0x399: 0xba, 0x39a: 0xba, 0x39b: 0xba, 0x39c: 0xba, 0x39d: 0xba, 0x39e: 0xba, 0x39f: 0xba, 0x3a0: 0xba, 0x3a1: 0xba, 0x3a2: 0xba, 0x3a3: 0xba, 0x3a4: 0xfa, 0x3a5: 0xfb, 0x3a6: 0xfc, 0x3a7: 0xfd, 0x3a8: 0x47, 0x3a9: 0xfe, 0x3aa: 0xff, 0x3ab: 0x48, 0x3ac: 0x49, 0x3ad: 0x4a, 0x3ae: 0x4b, 0x3af: 0x4c, 0x3b0: 0x100, 0x3b1: 0x4d, 0x3b2: 0x4e, 0x3b3: 0x4f, 0x3b4: 0x50, 0x3b5: 0x51, 0x3b6: 0x101, 0x3b7: 0x52, 0x3b8: 0x53, 0x3b9: 0x54, 0x3ba: 0x55, 0x3bb: 0x56, 0x3bc: 0x57, 0x3bd: 0x58, 0x3be: 0x59, 0x3bf: 0x5a, // Block 0xf, offset 0x3c0 0x3c0: 0x102, 0x3c1: 0x103, 0x3c2: 0x9f, 0x3c3: 0x104, 0x3c4: 0x105, 0x3c5: 0x9b, 0x3c6: 0x106, 0x3c7: 0x107, 0x3c8: 0xba, 0x3c9: 0xba, 0x3ca: 0x108, 0x3cb: 0x109, 0x3cc: 0x10a, 0x3cd: 0x10b, 0x3ce: 0x10c, 0x3cf: 0x10d, 0x3d0: 0x10e, 0x3d1: 0x9f, 0x3d2: 0x10f, 0x3d3: 0x110, 0x3d4: 0x111, 0x3d5: 0x112, 0x3d6: 0xba, 0x3d7: 0xba, 0x3d8: 0x9f, 0x3d9: 0x9f, 0x3da: 0x9f, 0x3db: 0x9f, 0x3dc: 0x113, 0x3dd: 0x114, 0x3de: 0xba, 0x3df: 0xba, 0x3e0: 0x115, 0x3e1: 0x116, 0x3e2: 0x117, 0x3e3: 0x118, 0x3e4: 0x119, 0x3e5: 0xba, 0x3e6: 0x11a, 0x3e7: 0x11b, 0x3e8: 0x11c, 0x3e9: 0x11d, 0x3ea: 0x11e, 0x3eb: 0x5b, 0x3ec: 0x11f, 0x3ed: 0x120, 0x3ee: 0x5c, 0x3ef: 0xba, 0x3f0: 0x121, 0x3f1: 0x122, 0x3f2: 0x123, 0x3f3: 0x124, 0x3f4: 0x125, 0x3f5: 0xba, 0x3f6: 0xba, 0x3f7: 0xba, 0x3f8: 0xba, 0x3f9: 0x126, 0x3fa: 0xba, 0x3fb: 0xba, 0x3fc: 0x127, 0x3fd: 0x128, 0x3fe: 0xba, 0x3ff: 0x129, // Block 0x10, offset 0x400 0x400: 0x12a, 0x401: 0x12b, 0x402: 0x12c, 0x403: 0x12d, 0x404: 0x12e, 0x405: 0x12f, 0x406: 0x130, 0x407: 0x131, 0x408: 0x132, 0x409: 0xba, 0x40a: 0x133, 0x40b: 0x134, 0x40c: 0x5d, 0x40d: 0x5e, 0x40e: 0xba, 0x40f: 0xba, 0x410: 0x135, 0x411: 0x136, 0x412: 0x137, 0x413: 0x138, 0x414: 0xba, 0x415: 0xba, 0x416: 0x139, 0x417: 0x13a, 0x418: 0x13b, 0x419: 0x13c, 0x41a: 0x13d, 0x41b: 0x13e, 0x41c: 0x13f, 0x41d: 0xba, 0x41e: 0xba, 0x41f: 0xba, 0x420: 0x140, 0x421: 0xba, 0x422: 0x141, 0x423: 0x142, 0x424: 0xba, 0x425: 0xba, 0x426: 0x143, 0x427: 0x144, 0x428: 0x145, 0x429: 0x146, 0x42a: 0x147, 0x42b: 0x148, 0x42c: 0xba, 0x42d: 0xba, 0x42e: 0xba, 0x42f: 0xba, 0x430: 0x149, 0x431: 0x14a, 0x432: 0x14b, 0x433: 0xba, 0x434: 0x14c, 0x435: 0x14d, 0x436: 0x14e, 0x437: 0xba, 0x438: 0xba, 0x439: 0xba, 0x43a: 0xba, 0x43b: 0x14f, 0x43c: 0xba, 0x43d: 0xba, 0x43e: 0xba, 0x43f: 0x150, // Block 0x11, offset 0x440 0x440: 0x9f, 0x441: 0x9f, 0x442: 0x9f, 0x443: 0x9f, 0x444: 0x9f, 0x445: 0x9f, 0x446: 0x9f, 0x447: 0x9f, 0x448: 0x9f, 0x449: 0x9f, 0x44a: 0x9f, 0x44b: 0x9f, 0x44c: 0x9f, 0x44d: 0x9f, 0x44e: 0x151, 0x44f: 0xba, 0x450: 0x9b, 0x451: 0x152, 0x452: 0x9f, 0x453: 0x9f, 0x454: 0x9f, 0x455: 0x153, 0x456: 0xba, 0x457: 0xba, 0x458: 0xba, 0x459: 0xba, 0x45a: 0xba, 0x45b: 0xba, 0x45c: 0xba, 0x45d: 0xba, 0x45e: 0xba, 0x45f: 0xba, 0x460: 0xba, 0x461: 0xba, 0x462: 0xba, 0x463: 0xba, 0x464: 0xba, 0x465: 0xba, 0x466: 0xba, 0x467: 0xba, 0x468: 0xba, 0x469: 0xba, 0x46a: 0xba, 0x46b: 0xba, 0x46c: 0xba, 0x46d: 0xba, 0x46e: 0xba, 0x46f: 0xba, 0x470: 0xba, 0x471: 0xba, 0x472: 0xba, 0x473: 0xba, 0x474: 0xba, 0x475: 0xba, 0x476: 0xba, 0x477: 0xba, 0x478: 0xba, 0x479: 0xba, 0x47a: 0xba, 0x47b: 0xba, 0x47c: 0xba, 0x47d: 0xba, 0x47e: 0xba, 0x47f: 0xba, // Block 0x12, offset 0x480 0x480: 0x9f, 0x481: 0x9f, 0x482: 0x9f, 0x483: 0x9f, 0x484: 0x9f, 0x485: 0x9f, 0x486: 0x9f, 0x487: 0x9f, 0x488: 0x9f, 0x489: 0x9f, 0x48a: 0x9f, 0x48b: 0x9f, 0x48c: 0x9f, 0x48d: 0x9f, 0x48e: 0x9f, 0x48f: 0x9f, 0x490: 0x154, 0x491: 0xba, 0x492: 0xba, 0x493: 0xba, 0x494: 0xba, 0x495: 0xba, 0x496: 0xba, 0x497: 0xba, 0x498: 0xba, 0x499: 0xba, 0x49a: 0xba, 0x49b: 0xba, 0x49c: 0xba, 0x49d: 0xba, 0x49e: 0xba, 0x49f: 0xba, 0x4a0: 0xba, 0x4a1: 0xba, 0x4a2: 0xba, 0x4a3: 0xba, 0x4a4: 0xba, 0x4a5: 0xba, 0x4a6: 0xba, 0x4a7: 0xba, 0x4a8: 0xba, 0x4a9: 0xba, 0x4aa: 0xba, 0x4ab: 0xba, 0x4ac: 0xba, 0x4ad: 0xba, 0x4ae: 0xba, 0x4af: 0xba, 0x4b0: 0xba, 0x4b1: 0xba, 0x4b2: 0xba, 0x4b3: 0xba, 0x4b4: 0xba, 0x4b5: 0xba, 0x4b6: 0xba, 0x4b7: 0xba, 0x4b8: 0xba, 0x4b9: 0xba, 0x4ba: 0xba, 0x4bb: 0xba, 0x4bc: 0xba, 0x4bd: 0xba, 0x4be: 0xba, 0x4bf: 0xba, // Block 0x13, offset 0x4c0 0x4c0: 0xba, 0x4c1: 0xba, 0x4c2: 0xba, 0x4c3: 0xba, 0x4c4: 0xba, 0x4c5: 0xba, 0x4c6: 0xba, 0x4c7: 0xba, 0x4c8: 0xba, 0x4c9: 0xba, 0x4ca: 0xba, 0x4cb: 0xba, 0x4cc: 0xba, 0x4cd: 0xba, 0x4ce: 0xba, 0x4cf: 0xba, 0x4d0: 0x9f, 0x4d1: 0x9f, 0x4d2: 0x9f, 0x4d3: 0x9f, 0x4d4: 0x9f, 0x4d5: 0x9f, 0x4d6: 0x9f, 0x4d7: 0x9f, 0x4d8: 0x9f, 0x4d9: 0x155, 0x4da: 0xba, 0x4db: 0xba, 0x4dc: 0xba, 0x4dd: 0xba, 0x4de: 0xba, 0x4df: 0xba, 0x4e0: 0xba, 0x4e1: 0xba, 0x4e2: 0xba, 0x4e3: 0xba, 0x4e4: 0xba, 0x4e5: 0xba, 0x4e6: 0xba, 0x4e7: 0xba, 0x4e8: 0xba, 0x4e9: 0xba, 0x4ea: 0xba, 0x4eb: 0xba, 0x4ec: 0xba, 0x4ed: 0xba, 0x4ee: 0xba, 0x4ef: 0xba, 0x4f0: 0xba, 0x4f1: 0xba, 0x4f2: 0xba, 0x4f3: 0xba, 0x4f4: 0xba, 0x4f5: 0xba, 0x4f6: 0xba, 0x4f7: 0xba, 0x4f8: 0xba, 0x4f9: 0xba, 0x4fa: 0xba, 0x4fb: 0xba, 0x4fc: 0xba, 0x4fd: 0xba, 0x4fe: 0xba, 0x4ff: 0xba, // Block 0x14, offset 0x500 0x500: 0xba, 0x501: 0xba, 0x502: 0xba, 0x503: 0xba, 0x504: 0xba, 0x505: 0xba, 0x506: 0xba, 0x507: 0xba, 0x508: 0xba, 0x509: 0xba, 0x50a: 0xba, 0x50b: 0xba, 0x50c: 0xba, 0x50d: 0xba, 0x50e: 0xba, 0x50f: 0xba, 0x510: 0xba, 0x511: 0xba, 0x512: 0xba, 0x513: 0xba, 0x514: 0xba, 0x515: 0xba, 0x516: 0xba, 0x517: 0xba, 0x518: 0xba, 0x519: 0xba, 0x51a: 0xba, 0x51b: 0xba, 0x51c: 0xba, 0x51d: 0xba, 0x51e: 0xba, 0x51f: 0xba, 0x520: 0x9f, 0x521: 0x9f, 0x522: 0x9f, 0x523: 0x9f, 0x524: 0x9f, 0x525: 0x9f, 0x526: 0x9f, 0x527: 0x9f, 0x528: 0x148, 0x529: 0x156, 0x52a: 0xba, 0x52b: 0x157, 0x52c: 0x158, 0x52d: 0x159, 0x52e: 0x15a, 0x52f: 0xba, 0x530: 0xba, 0x531: 0xba, 0x532: 0xba, 0x533: 0xba, 0x534: 0xba, 0x535: 0xba, 0x536: 0xba, 0x537: 0xba, 0x538: 0xba, 0x539: 0x15b, 0x53a: 0x15c, 0x53b: 0xba, 0x53c: 0x9f, 0x53d: 0x15d, 0x53e: 0x15e, 0x53f: 0x15f, // Block 0x15, offset 0x540 0x540: 0x9f, 0x541: 0x9f, 0x542: 0x9f, 0x543: 0x9f, 0x544: 0x9f, 0x545: 0x9f, 0x546: 0x9f, 0x547: 0x9f, 0x548: 0x9f, 0x549: 0x9f, 0x54a: 0x9f, 0x54b: 0x9f, 0x54c: 0x9f, 0x54d: 0x9f, 0x54e: 0x9f, 0x54f: 0x9f, 0x550: 0x9f, 0x551: 0x9f, 0x552: 0x9f, 0x553: 0x9f, 0x554: 0x9f, 0x555: 0x9f, 0x556: 0x9f, 0x557: 0x9f, 0x558: 0x9f, 0x559: 0x9f, 0x55a: 0x9f, 0x55b: 0x9f, 0x55c: 0x9f, 0x55d: 0x9f, 0x55e: 0x9f, 0x55f: 0x160, 0x560: 0x9f, 0x561: 0x9f, 0x562: 0x9f, 0x563: 0x9f, 0x564: 0x9f, 0x565: 0x9f, 0x566: 0x9f, 0x567: 0x9f, 0x568: 0x9f, 0x569: 0x9f, 0x56a: 0x9f, 0x56b: 0x161, 0x56c: 0xba, 0x56d: 0xba, 0x56e: 0xba, 0x56f: 0xba, 0x570: 0xba, 0x571: 0xba, 0x572: 0xba, 0x573: 0xba, 0x574: 0xba, 0x575: 0xba, 0x576: 0xba, 0x577: 0xba, 0x578: 0xba, 0x579: 0xba, 0x57a: 0xba, 0x57b: 0xba, 0x57c: 0xba, 0x57d: 0xba, 0x57e: 0xba, 0x57f: 0xba, // Block 0x16, offset 0x580 0x580: 0x9f, 0x581: 0x9f, 0x582: 0x9f, 0x583: 0x9f, 0x584: 0x162, 0x585: 0x163, 0x586: 0x9f, 0x587: 0x9f, 0x588: 0x9f, 0x589: 0x9f, 0x58a: 0x9f, 0x58b: 0x164, 0x58c: 0xba, 0x58d: 0xba, 0x58e: 0xba, 0x58f: 0xba, 0x590: 0xba, 0x591: 0xba, 0x592: 0xba, 0x593: 0xba, 0x594: 0xba, 0x595: 0xba, 0x596: 0xba, 0x597: 0xba, 0x598: 0xba, 0x599: 0xba, 0x59a: 0xba, 0x59b: 0xba, 0x59c: 0xba, 0x59d: 0xba, 0x59e: 0xba, 0x59f: 0xba, 0x5a0: 0xba, 0x5a1: 0xba, 0x5a2: 0xba, 0x5a3: 0xba, 0x5a4: 0xba, 0x5a5: 0xba, 0x5a6: 0xba, 0x5a7: 0xba, 0x5a8: 0xba, 0x5a9: 0xba, 0x5aa: 0xba, 0x5ab: 0xba, 0x5ac: 0xba, 0x5ad: 0xba, 0x5ae: 0xba, 0x5af: 0xba, 0x5b0: 0x9f, 0x5b1: 0x165, 0x5b2: 0x166, 0x5b3: 0xba, 0x5b4: 0xba, 0x5b5: 0xba, 0x5b6: 0xba, 0x5b7: 0xba, 0x5b8: 0xba, 0x5b9: 0xba, 0x5ba: 0xba, 0x5bb: 0xba, 0x5bc: 0xba, 0x5bd: 0xba, 0x5be: 0xba, 0x5bf: 0xba, // Block 0x17, offset 0x5c0 0x5c0: 0x9b, 0x5c1: 0x9b, 0x5c2: 0x9b, 0x5c3: 0x167, 0x5c4: 0x168, 0x5c5: 0x169, 0x5c6: 0x16a, 0x5c7: 0x16b, 0x5c8: 0x9b, 0x5c9: 0x16c, 0x5ca: 0xba, 0x5cb: 0x16d, 0x5cc: 0x9b, 0x5cd: 0x16e, 0x5ce: 0xba, 0x5cf: 0xba, 0x5d0: 0x5f, 0x5d1: 0x60, 0x5d2: 0x61, 0x5d3: 0x62, 0x5d4: 0x63, 0x5d5: 0x64, 0x5d6: 0x65, 0x5d7: 0x66, 0x5d8: 0x67, 0x5d9: 0x68, 0x5da: 0x69, 0x5db: 0x6a, 0x5dc: 0x6b, 0x5dd: 0x6c, 0x5de: 0x6d, 0x5df: 0x6e, 0x5e0: 0x9b, 0x5e1: 0x9b, 0x5e2: 0x9b, 0x5e3: 0x9b, 0x5e4: 0x9b, 0x5e5: 0x9b, 0x5e6: 0x9b, 0x5e7: 0x9b, 0x5e8: 0x16f, 0x5e9: 0x170, 0x5ea: 0x171, 0x5eb: 0xba, 0x5ec: 0xba, 0x5ed: 0xba, 0x5ee: 0xba, 0x5ef: 0xba, 0x5f0: 0xba, 0x5f1: 0xba, 0x5f2: 0xba, 0x5f3: 0xba, 0x5f4: 0xba, 0x5f5: 0xba, 0x5f6: 0xba, 0x5f7: 0xba, 0x5f8: 0xba, 0x5f9: 0xba, 0x5fa: 0xba, 0x5fb: 0xba, 0x5fc: 0xba, 0x5fd: 0xba, 0x5fe: 0xba, 0x5ff: 0xba, // Block 0x18, offset 0x600 0x600: 0x172, 0x601: 0xba, 0x602: 0xba, 0x603: 0xba, 0x604: 0x173, 0x605: 0x174, 0x606: 0xba, 0x607: 0xba, 0x608: 0xba, 0x609: 0xba, 0x60a: 0xba, 0x60b: 0x175, 0x60c: 0xba, 0x60d: 0xba, 0x60e: 0xba, 0x60f: 0xba, 0x610: 0xba, 0x611: 0xba, 0x612: 0xba, 0x613: 0xba, 0x614: 0xba, 0x615: 0xba, 0x616: 0xba, 0x617: 0xba, 0x618: 0xba, 0x619: 0xba, 0x61a: 0xba, 0x61b: 0xba, 0x61c: 0xba, 0x61d: 0xba, 0x61e: 0xba, 0x61f: 0xba, 0x620: 0x121, 0x621: 0x121, 0x622: 0x121, 0x623: 0x176, 0x624: 0x6f, 0x625: 0x177, 0x626: 0xba, 0x627: 0xba, 0x628: 0xba, 0x629: 0xba, 0x62a: 0xba, 0x62b: 0xba, 0x62c: 0xba, 0x62d: 0xba, 0x62e: 0xba, 0x62f: 0xba, 0x630: 0xba, 0x631: 0x178, 0x632: 0x179, 0x633: 0xba, 0x634: 0x17a, 0x635: 0xba, 0x636: 0xba, 0x637: 0xba, 0x638: 0x70, 0x639: 0x71, 0x63a: 0x72, 0x63b: 0x17b, 0x63c: 0xba, 0x63d: 0xba, 0x63e: 0xba, 0x63f: 0xba, // Block 0x19, offset 0x640 0x640: 0x17c, 0x641: 0x9b, 0x642: 0x17d, 0x643: 0x17e, 0x644: 0x73, 0x645: 0x74, 0x646: 0x17f, 0x647: 0x180, 0x648: 0x75, 0x649: 0x181, 0x64a: 0xba, 0x64b: 0xba, 0x64c: 0x9b, 0x64d: 0x9b, 0x64e: 0x9b, 0x64f: 0x9b, 0x650: 0x9b, 0x651: 0x9b, 0x652: 0x9b, 0x653: 0x9b, 0x654: 0x9b, 0x655: 0x9b, 0x656: 0x9b, 0x657: 0x9b, 0x658: 0x9b, 0x659: 0x9b, 0x65a: 0x9b, 0x65b: 0x182, 0x65c: 0x9b, 0x65d: 0x183, 0x65e: 0x9b, 0x65f: 0x184, 0x660: 0x185, 0x661: 0x186, 0x662: 0x187, 0x663: 0xba, 0x664: 0x188, 0x665: 0x189, 0x666: 0x18a, 0x667: 0x18b, 0x668: 0x9b, 0x669: 0x18c, 0x66a: 0x18d, 0x66b: 0xba, 0x66c: 0xba, 0x66d: 0xba, 0x66e: 0xba, 0x66f: 0xba, 0x670: 0xba, 0x671: 0xba, 0x672: 0xba, 0x673: 0xba, 0x674: 0xba, 0x675: 0xba, 0x676: 0xba, 0x677: 0xba, 0x678: 0xba, 0x679: 0xba, 0x67a: 0xba, 0x67b: 0xba, 0x67c: 0xba, 0x67d: 0xba, 0x67e: 0xba, 0x67f: 0xba, // Block 0x1a, offset 0x680 0x680: 0x9f, 0x681: 0x9f, 0x682: 0x9f, 0x683: 0x9f, 0x684: 0x9f, 0x685: 0x9f, 0x686: 0x9f, 0x687: 0x9f, 0x688: 0x9f, 0x689: 0x9f, 0x68a: 0x9f, 0x68b: 0x9f, 0x68c: 0x9f, 0x68d: 0x9f, 0x68e: 0x9f, 0x68f: 0x9f, 0x690: 0x9f, 0x691: 0x9f, 0x692: 0x9f, 0x693: 0x9f, 0x694: 0x9f, 0x695: 0x9f, 0x696: 0x9f, 0x697: 0x9f, 0x698: 0x9f, 0x699: 0x9f, 0x69a: 0x9f, 0x69b: 0x18e, 0x69c: 0x9f, 0x69d: 0x9f, 0x69e: 0x9f, 0x69f: 0x9f, 0x6a0: 0x9f, 0x6a1: 0x9f, 0x6a2: 0x9f, 0x6a3: 0x9f, 0x6a4: 0x9f, 0x6a5: 0x9f, 0x6a6: 0x9f, 0x6a7: 0x9f, 0x6a8: 0x9f, 0x6a9: 0x9f, 0x6aa: 0x9f, 0x6ab: 0x9f, 0x6ac: 0x9f, 0x6ad: 0x9f, 0x6ae: 0x9f, 0x6af: 0x9f, 0x6b0: 0x9f, 0x6b1: 0x9f, 0x6b2: 0x9f, 0x6b3: 0x9f, 0x6b4: 0x9f, 0x6b5: 0x9f, 0x6b6: 0x9f, 0x6b7: 0x9f, 0x6b8: 0x9f, 0x6b9: 0x9f, 0x6ba: 0x9f, 0x6bb: 0x9f, 0x6bc: 0x9f, 0x6bd: 0x9f, 0x6be: 0x9f, 0x6bf: 0x9f, // Block 0x1b, offset 0x6c0 0x6c0: 0x9f, 0x6c1: 0x9f, 0x6c2: 0x9f, 0x6c3: 0x9f, 0x6c4: 0x9f, 0x6c5: 0x9f, 0x6c6: 0x9f, 0x6c7: 0x9f, 0x6c8: 0x9f, 0x6c9: 0x9f, 0x6ca: 0x9f, 0x6cb: 0x9f, 0x6cc: 0x9f, 0x6cd: 0x9f, 0x6ce: 0x9f, 0x6cf: 0x9f, 0x6d0: 0x9f, 0x6d1: 0x9f, 0x6d2: 0x9f, 0x6d3: 0x9f, 0x6d4: 0x9f, 0x6d5: 0x9f, 0x6d6: 0x9f, 0x6d7: 0x9f, 0x6d8: 0x9f, 0x6d9: 0x9f, 0x6da: 0x9f, 0x6db: 0x9f, 0x6dc: 0x18f, 0x6dd: 0x9f, 0x6de: 0x9f, 0x6df: 0x9f, 0x6e0: 0x190, 0x6e1: 0x9f, 0x6e2: 0x9f, 0x6e3: 0x9f, 0x6e4: 0x9f, 0x6e5: 0x9f, 0x6e6: 0x9f, 0x6e7: 0x9f, 0x6e8: 0x9f, 0x6e9: 0x9f, 0x6ea: 0x9f, 0x6eb: 0x9f, 0x6ec: 0x9f, 0x6ed: 0x9f, 0x6ee: 0x9f, 0x6ef: 0x9f, 0x6f0: 0x9f, 0x6f1: 0x9f, 0x6f2: 0x9f, 0x6f3: 0x9f, 0x6f4: 0x9f, 0x6f5: 0x9f, 0x6f6: 0x9f, 0x6f7: 0x9f, 0x6f8: 0x9f, 0x6f9: 0x9f, 0x6fa: 0x9f, 0x6fb: 0x9f, 0x6fc: 0x9f, 0x6fd: 0x9f, 0x6fe: 0x9f, 0x6ff: 0x9f, // Block 0x1c, offset 0x700 0x700: 0x9f, 0x701: 0x9f, 0x702: 0x9f, 0x703: 0x9f, 0x704: 0x9f, 0x705: 0x9f, 0x706: 0x9f, 0x707: 0x9f, 0x708: 0x9f, 0x709: 0x9f, 0x70a: 0x9f, 0x70b: 0x9f, 0x70c: 0x9f, 0x70d: 0x9f, 0x70e: 0x9f, 0x70f: 0x9f, 0x710: 0x9f, 0x711: 0x9f, 0x712: 0x9f, 0x713: 0x9f, 0x714: 0x9f, 0x715: 0x9f, 0x716: 0x9f, 0x717: 0x9f, 0x718: 0x9f, 0x719: 0x9f, 0x71a: 0x9f, 0x71b: 0x9f, 0x71c: 0x9f, 0x71d: 0x9f, 0x71e: 0x9f, 0x71f: 0x9f, 0x720: 0x9f, 0x721: 0x9f, 0x722: 0x9f, 0x723: 0x9f, 0x724: 0x9f, 0x725: 0x9f, 0x726: 0x9f, 0x727: 0x9f, 0x728: 0x9f, 0x729: 0x9f, 0x72a: 0x9f, 0x72b: 0x9f, 0x72c: 0x9f, 0x72d: 0x9f, 0x72e: 0x9f, 0x72f: 0x9f, 0x730: 0x9f, 0x731: 0x9f, 0x732: 0x9f, 0x733: 0x9f, 0x734: 0x9f, 0x735: 0x9f, 0x736: 0x9f, 0x737: 0x9f, 0x738: 0x9f, 0x739: 0x9f, 0x73a: 0x191, 0x73b: 0x9f, 0x73c: 0x9f, 0x73d: 0x9f, 0x73e: 0x9f, 0x73f: 0x9f, // Block 0x1d, offset 0x740 0x740: 0x9f, 0x741: 0x9f, 0x742: 0x9f, 0x743: 0x9f, 0x744: 0x9f, 0x745: 0x9f, 0x746: 0x9f, 0x747: 0x9f, 0x748: 0x9f, 0x749: 0x9f, 0x74a: 0x9f, 0x74b: 0x9f, 0x74c: 0x9f, 0x74d: 0x9f, 0x74e: 0x9f, 0x74f: 0x9f, 0x750: 0x9f, 0x751: 0x9f, 0x752: 0x9f, 0x753: 0x9f, 0x754: 0x9f, 0x755: 0x9f, 0x756: 0x9f, 0x757: 0x9f, 0x758: 0x9f, 0x759: 0x9f, 0x75a: 0x9f, 0x75b: 0x9f, 0x75c: 0x9f, 0x75d: 0x9f, 0x75e: 0x9f, 0x75f: 0x9f, 0x760: 0x9f, 0x761: 0x9f, 0x762: 0x9f, 0x763: 0x9f, 0x764: 0x9f, 0x765: 0x9f, 0x766: 0x9f, 0x767: 0x9f, 0x768: 0x9f, 0x769: 0x9f, 0x76a: 0x9f, 0x76b: 0x9f, 0x76c: 0x9f, 0x76d: 0x9f, 0x76e: 0x9f, 0x76f: 0x192, 0x770: 0xba, 0x771: 0xba, 0x772: 0xba, 0x773: 0xba, 0x774: 0xba, 0x775: 0xba, 0x776: 0xba, 0x777: 0xba, 0x778: 0xba, 0x779: 0xba, 0x77a: 0xba, 0x77b: 0xba, 0x77c: 0xba, 0x77d: 0xba, 0x77e: 0xba, 0x77f: 0xba, // Block 0x1e, offset 0x780 0x780: 0xba, 0x781: 0xba, 0x782: 0xba, 0x783: 0xba, 0x784: 0xba, 0x785: 0xba, 0x786: 0xba, 0x787: 0xba, 0x788: 0xba, 0x789: 0xba, 0x78a: 0xba, 0x78b: 0xba, 0x78c: 0xba, 0x78d: 0xba, 0x78e: 0xba, 0x78f: 0xba, 0x790: 0xba, 0x791: 0xba, 0x792: 0xba, 0x793: 0xba, 0x794: 0xba, 0x795: 0xba, 0x796: 0xba, 0x797: 0xba, 0x798: 0xba, 0x799: 0xba, 0x79a: 0xba, 0x79b: 0xba, 0x79c: 0xba, 0x79d: 0xba, 0x79e: 0xba, 0x79f: 0xba, 0x7a0: 0x76, 0x7a1: 0x77, 0x7a2: 0x78, 0x7a3: 0x193, 0x7a4: 0x79, 0x7a5: 0x7a, 0x7a6: 0x194, 0x7a7: 0x7b, 0x7a8: 0x7c, 0x7a9: 0xba, 0x7aa: 0xba, 0x7ab: 0xba, 0x7ac: 0xba, 0x7ad: 0xba, 0x7ae: 0xba, 0x7af: 0xba, 0x7b0: 0xba, 0x7b1: 0xba, 0x7b2: 0xba, 0x7b3: 0xba, 0x7b4: 0xba, 0x7b5: 0xba, 0x7b6: 0xba, 0x7b7: 0xba, 0x7b8: 0xba, 0x7b9: 0xba, 0x7ba: 0xba, 0x7bb: 0xba, 0x7bc: 0xba, 0x7bd: 0xba, 0x7be: 0xba, 0x7bf: 0xba, // Block 0x1f, offset 0x7c0 0x7d0: 0x0d, 0x7d1: 0x0e, 0x7d2: 0x0f, 0x7d3: 0x10, 0x7d4: 0x11, 0x7d5: 0x0b, 0x7d6: 0x12, 0x7d7: 0x07, 0x7d8: 0x13, 0x7d9: 0x0b, 0x7da: 0x0b, 0x7db: 0x14, 0x7dc: 0x0b, 0x7dd: 0x15, 0x7de: 0x16, 0x7df: 0x17, 0x7e0: 0x07, 0x7e1: 0x07, 0x7e2: 0x07, 0x7e3: 0x07, 0x7e4: 0x07, 0x7e5: 0x07, 0x7e6: 0x07, 0x7e7: 0x07, 0x7e8: 0x07, 0x7e9: 0x07, 0x7ea: 0x18, 0x7eb: 0x19, 0x7ec: 0x1a, 0x7ed: 0x07, 0x7ee: 0x1b, 0x7ef: 0x1c, 0x7f0: 0x0b, 0x7f1: 0x0b, 0x7f2: 0x0b, 0x7f3: 0x0b, 0x7f4: 0x0b, 0x7f5: 0x0b, 0x7f6: 0x0b, 0x7f7: 0x0b, 0x7f8: 0x0b, 0x7f9: 0x0b, 0x7fa: 0x0b, 0x7fb: 0x0b, 0x7fc: 0x0b, 0x7fd: 0x0b, 0x7fe: 0x0b, 0x7ff: 0x0b, // Block 0x20, offset 0x800 0x800: 0x0b, 0x801: 0x0b, 0x802: 0x0b, 0x803: 0x0b, 0x804: 0x0b, 0x805: 0x0b, 0x806: 0x0b, 0x807: 0x0b, 0x808: 0x0b, 0x809: 0x0b, 0x80a: 0x0b, 0x80b: 0x0b, 0x80c: 0x0b, 0x80d: 0x0b, 0x80e: 0x0b, 0x80f: 0x0b, 0x810: 0x0b, 0x811: 0x0b, 0x812: 0x0b, 0x813: 0x0b, 0x814: 0x0b, 0x815: 0x0b, 0x816: 0x0b, 0x817: 0x0b, 0x818: 0x0b, 0x819: 0x0b, 0x81a: 0x0b, 0x81b: 0x0b, 0x81c: 0x0b, 0x81d: 0x0b, 0x81e: 0x0b, 0x81f: 0x0b, 0x820: 0x0b, 0x821: 0x0b, 0x822: 0x0b, 0x823: 0x0b, 0x824: 0x0b, 0x825: 0x0b, 0x826: 0x0b, 0x827: 0x0b, 0x828: 0x0b, 0x829: 0x0b, 0x82a: 0x0b, 0x82b: 0x0b, 0x82c: 0x0b, 0x82d: 0x0b, 0x82e: 0x0b, 0x82f: 0x0b, 0x830: 0x0b, 0x831: 0x0b, 0x832: 0x0b, 0x833: 0x0b, 0x834: 0x0b, 0x835: 0x0b, 0x836: 0x0b, 0x837: 0x0b, 0x838: 0x0b, 0x839: 0x0b, 0x83a: 0x0b, 0x83b: 0x0b, 0x83c: 0x0b, 0x83d: 0x0b, 0x83e: 0x0b, 0x83f: 0x0b, // Block 0x21, offset 0x840 0x840: 0x195, 0x841: 0x196, 0x842: 0xba, 0x843: 0xba, 0x844: 0x197, 0x845: 0x197, 0x846: 0x197, 0x847: 0x198, 0x848: 0xba, 0x849: 0xba, 0x84a: 0xba, 0x84b: 0xba, 0x84c: 0xba, 0x84d: 0xba, 0x84e: 0xba, 0x84f: 0xba, 0x850: 0xba, 0x851: 0xba, 0x852: 0xba, 0x853: 0xba, 0x854: 0xba, 0x855: 0xba, 0x856: 0xba, 0x857: 0xba, 0x858: 0xba, 0x859: 0xba, 0x85a: 0xba, 0x85b: 0xba, 0x85c: 0xba, 0x85d: 0xba, 0x85e: 0xba, 0x85f: 0xba, 0x860: 0xba, 0x861: 0xba, 0x862: 0xba, 0x863: 0xba, 0x864: 0xba, 0x865: 0xba, 0x866: 0xba, 0x867: 0xba, 0x868: 0xba, 0x869: 0xba, 0x86a: 0xba, 0x86b: 0xba, 0x86c: 0xba, 0x86d: 0xba, 0x86e: 0xba, 0x86f: 0xba, 0x870: 0xba, 0x871: 0xba, 0x872: 0xba, 0x873: 0xba, 0x874: 0xba, 0x875: 0xba, 0x876: 0xba, 0x877: 0xba, 0x878: 0xba, 0x879: 0xba, 0x87a: 0xba, 0x87b: 0xba, 0x87c: 0xba, 0x87d: 0xba, 0x87e: 0xba, 0x87f: 0xba, // Block 0x22, offset 0x880 0x880: 0x0b, 0x881: 0x0b, 0x882: 0x0b, 0x883: 0x0b, 0x884: 0x0b, 0x885: 0x0b, 0x886: 0x0b, 0x887: 0x0b, 0x888: 0x0b, 0x889: 0x0b, 0x88a: 0x0b, 0x88b: 0x0b, 0x88c: 0x0b, 0x88d: 0x0b, 0x88e: 0x0b, 0x88f: 0x0b, 0x890: 0x0b, 0x891: 0x0b, 0x892: 0x0b, 0x893: 0x0b, 0x894: 0x0b, 0x895: 0x0b, 0x896: 0x0b, 0x897: 0x0b, 0x898: 0x0b, 0x899: 0x0b, 0x89a: 0x0b, 0x89b: 0x0b, 0x89c: 0x0b, 0x89d: 0x0b, 0x89e: 0x0b, 0x89f: 0x0b, 0x8a0: 0x1f, 0x8a1: 0x0b, 0x8a2: 0x0b, 0x8a3: 0x0b, 0x8a4: 0x0b, 0x8a5: 0x0b, 0x8a6: 0x0b, 0x8a7: 0x0b, 0x8a8: 0x0b, 0x8a9: 0x0b, 0x8aa: 0x0b, 0x8ab: 0x0b, 0x8ac: 0x0b, 0x8ad: 0x0b, 0x8ae: 0x0b, 0x8af: 0x0b, 0x8b0: 0x0b, 0x8b1: 0x0b, 0x8b2: 0x0b, 0x8b3: 0x0b, 0x8b4: 0x0b, 0x8b5: 0x0b, 0x8b6: 0x0b, 0x8b7: 0x0b, 0x8b8: 0x0b, 0x8b9: 0x0b, 0x8ba: 0x0b, 0x8bb: 0x0b, 0x8bc: 0x0b, 0x8bd: 0x0b, 0x8be: 0x0b, 0x8bf: 0x0b, // Block 0x23, offset 0x8c0 0x8c0: 0x0b, 0x8c1: 0x0b, 0x8c2: 0x0b, 0x8c3: 0x0b, 0x8c4: 0x0b, 0x8c5: 0x0b, 0x8c6: 0x0b, 0x8c7: 0x0b, 0x8c8: 0x0b, 0x8c9: 0x0b, 0x8ca: 0x0b, 0x8cb: 0x0b, 0x8cc: 0x0b, 0x8cd: 0x0b, 0x8ce: 0x0b, 0x8cf: 0x0b, } // idnaSparseOffset: 284 entries, 568 bytes var idnaSparseOffset = []uint16{0x0, 0x8, 0x19, 0x25, 0x27, 0x2c, 0x33, 0x3e, 0x4a, 0x4e, 0x5d, 0x62, 0x6c, 0x78, 0x86, 0x8b, 0x94, 0xa4, 0xb2, 0xbe, 0xca, 0xdb, 0xe5, 0xec, 0xf9, 0x10a, 0x111, 0x11c, 0x12b, 0x139, 0x143, 0x145, 0x14a, 0x14d, 0x150, 0x152, 0x15e, 0x169, 0x171, 0x177, 0x17d, 0x182, 0x187, 0x18a, 0x18e, 0x194, 0x199, 0x1a5, 0x1af, 0x1b5, 0x1c6, 0x1d0, 0x1d3, 0x1db, 0x1de, 0x1eb, 0x1f3, 0x1f7, 0x1fe, 0x206, 0x216, 0x222, 0x224, 0x22e, 0x23a, 0x246, 0x252, 0x25a, 0x25f, 0x26c, 0x27d, 0x281, 0x28c, 0x290, 0x299, 0x2a1, 0x2a7, 0x2ac, 0x2af, 0x2b3, 0x2b9, 0x2bd, 0x2c1, 0x2c5, 0x2cb, 0x2d3, 0x2da, 0x2e5, 0x2ef, 0x2f3, 0x2f6, 0x2fc, 0x300, 0x302, 0x305, 0x307, 0x30a, 0x314, 0x317, 0x326, 0x32a, 0x32f, 0x332, 0x336, 0x33b, 0x340, 0x346, 0x352, 0x361, 0x367, 0x36b, 0x37a, 0x37f, 0x387, 0x391, 0x39c, 0x3a4, 0x3b5, 0x3be, 0x3ce, 0x3db, 0x3e5, 0x3ea, 0x3f7, 0x3fb, 0x400, 0x402, 0x406, 0x408, 0x40c, 0x415, 0x41b, 0x41f, 0x42f, 0x439, 0x43e, 0x441, 0x447, 0x44e, 0x453, 0x457, 0x45d, 0x462, 0x46b, 0x470, 0x476, 0x47d, 0x484, 0x48b, 0x48f, 0x494, 0x497, 0x49c, 0x4a8, 0x4ae, 0x4b3, 0x4ba, 0x4c2, 0x4c7, 0x4cb, 0x4db, 0x4e2, 0x4e6, 0x4ea, 0x4f1, 0x4f3, 0x4f6, 0x4f9, 0x4fd, 0x506, 0x50a, 0x512, 0x51a, 0x51e, 0x524, 0x52d, 0x539, 0x540, 0x549, 0x553, 0x55a, 0x568, 0x575, 0x582, 0x58b, 0x58f, 0x59f, 0x5a7, 0x5b2, 0x5bb, 0x5c1, 0x5c9, 0x5d2, 0x5dd, 0x5e0, 0x5ec, 0x5f5, 0x5f8, 0x5fd, 0x602, 0x60f, 0x61a, 0x623, 0x62d, 0x630, 0x63a, 0x643, 0x64f, 0x65c, 0x669, 0x677, 0x67e, 0x682, 0x685, 0x68a, 0x68d, 0x692, 0x695, 0x69c, 0x6a3, 0x6a7, 0x6b2, 0x6b5, 0x6b8, 0x6bb, 0x6c1, 0x6c7, 0x6cd, 0x6d0, 0x6d3, 0x6d6, 0x6dd, 0x6e0, 0x6e5, 0x6ef, 0x6f2, 0x6f6, 0x705, 0x711, 0x715, 0x71a, 0x71e, 0x723, 0x727, 0x72c, 0x735, 0x740, 0x746, 0x74c, 0x752, 0x758, 0x761, 0x764, 0x767, 0x76b, 0x76f, 0x773, 0x779, 0x77f, 0x784, 0x787, 0x797, 0x79e, 0x7a1, 0x7a6, 0x7aa, 0x7b0, 0x7b5, 0x7b9, 0x7bf, 0x7c5, 0x7c9, 0x7d2, 0x7d7, 0x7da, 0x7dd, 0x7e1, 0x7e5, 0x7e8, 0x7f8, 0x809, 0x80e, 0x810, 0x812} // idnaSparseValues: 2069 entries, 8276 bytes var idnaSparseValues = [2069]valueRange{ // Block 0x0, offset 0x0 {value: 0x0000, lo: 0x07}, {value: 0xe105, lo: 0x80, hi: 0x96}, {value: 0x0018, lo: 0x97, hi: 0x97}, {value: 0xe105, lo: 0x98, hi: 0x9e}, {value: 0x001f, lo: 0x9f, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xb7}, {value: 0x0008, lo: 0xb8, hi: 0xbf}, // Block 0x1, offset 0x8 {value: 0x0000, lo: 0x10}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0xe01d, lo: 0x81, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0x82}, {value: 0x0335, lo: 0x83, hi: 0x83}, {value: 0x034d, lo: 0x84, hi: 0x84}, {value: 0x0365, lo: 0x85, hi: 0x85}, {value: 0xe00d, lo: 0x86, hi: 0x86}, {value: 0x0008, lo: 0x87, hi: 0x87}, {value: 0xe00d, lo: 0x88, hi: 0x88}, {value: 0x0008, lo: 0x89, hi: 0x89}, {value: 0xe00d, lo: 0x8a, hi: 0x8a}, {value: 0x0008, lo: 0x8b, hi: 0x8b}, {value: 0xe00d, lo: 0x8c, hi: 0x8c}, {value: 0x0008, lo: 0x8d, hi: 0x8d}, {value: 0xe00d, lo: 0x8e, hi: 0x8e}, {value: 0x0008, lo: 0x8f, hi: 0xbf}, // Block 0x2, offset 0x19 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x0249, lo: 0xb0, hi: 0xb0}, {value: 0x037d, lo: 0xb1, hi: 0xb1}, {value: 0x0259, lo: 0xb2, hi: 0xb2}, {value: 0x0269, lo: 0xb3, hi: 0xb3}, {value: 0x034d, lo: 0xb4, hi: 0xb4}, {value: 0x0395, lo: 0xb5, hi: 0xb5}, {value: 0xe1bd, lo: 0xb6, hi: 0xb6}, {value: 0x0279, lo: 0xb7, hi: 0xb7}, {value: 0x0289, lo: 0xb8, hi: 0xb8}, {value: 0x0008, lo: 0xb9, hi: 0xbf}, // Block 0x3, offset 0x25 {value: 0x0000, lo: 0x01}, {value: 0x3308, lo: 0x80, hi: 0xbf}, // Block 0x4, offset 0x27 {value: 0x0000, lo: 0x04}, {value: 0x03f5, lo: 0x80, hi: 0x8f}, {value: 0xe105, lo: 0x90, hi: 0x9f}, {value: 0x049d, lo: 0xa0, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x5, offset 0x2c {value: 0x0000, lo: 0x06}, {value: 0xe185, lo: 0x80, hi: 0x8f}, {value: 0x0545, lo: 0x90, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x98}, {value: 0x0008, lo: 0x99, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x6, offset 0x33 {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0401, lo: 0x87, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x88}, {value: 0x0018, lo: 0x89, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0x90}, {value: 0x3308, lo: 0x91, hi: 0xbd}, {value: 0x0818, lo: 0xbe, hi: 0xbe}, {value: 0x3308, lo: 0xbf, hi: 0xbf}, // Block 0x7, offset 0x3e {value: 0x0000, lo: 0x0b}, {value: 0x0818, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x82}, {value: 0x0818, lo: 0x83, hi: 0x83}, {value: 0x3308, lo: 0x84, hi: 0x85}, {value: 0x0818, lo: 0x86, hi: 0x86}, {value: 0x3308, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0808, lo: 0x90, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xae}, {value: 0x0808, lo: 0xaf, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0x8, offset 0x4a {value: 0x0000, lo: 0x03}, {value: 0x0a08, lo: 0x80, hi: 0x87}, {value: 0x0c08, lo: 0x88, hi: 0x99}, {value: 0x0a08, lo: 0x9a, hi: 0xbf}, // Block 0x9, offset 0x4e {value: 0x0000, lo: 0x0e}, {value: 0x3308, lo: 0x80, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8c}, {value: 0x0c08, lo: 0x8d, hi: 0x8d}, {value: 0x0a08, lo: 0x8e, hi: 0x98}, {value: 0x0c08, lo: 0x99, hi: 0x9b}, {value: 0x0a08, lo: 0x9c, hi: 0xaa}, {value: 0x0c08, lo: 0xab, hi: 0xac}, {value: 0x0a08, lo: 0xad, hi: 0xb0}, {value: 0x0c08, lo: 0xb1, hi: 0xb1}, {value: 0x0a08, lo: 0xb2, hi: 0xb2}, {value: 0x0c08, lo: 0xb3, hi: 0xb4}, {value: 0x0a08, lo: 0xb5, hi: 0xb7}, {value: 0x0c08, lo: 0xb8, hi: 0xb9}, {value: 0x0a08, lo: 0xba, hi: 0xbf}, // Block 0xa, offset 0x5d {value: 0x0000, lo: 0x04}, {value: 0x0808, lo: 0x80, hi: 0xa5}, {value: 0x3308, lo: 0xa6, hi: 0xb0}, {value: 0x0808, lo: 0xb1, hi: 0xb1}, {value: 0x0040, lo: 0xb2, hi: 0xbf}, // Block 0xb, offset 0x62 {value: 0x0000, lo: 0x09}, {value: 0x0808, lo: 0x80, hi: 0x89}, {value: 0x0a08, lo: 0x8a, hi: 0xaa}, {value: 0x3308, lo: 0xab, hi: 0xb3}, {value: 0x0808, lo: 0xb4, hi: 0xb5}, {value: 0x0018, lo: 0xb6, hi: 0xb9}, {value: 0x0818, lo: 0xba, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbc}, {value: 0x3308, lo: 0xbd, hi: 0xbd}, {value: 0x0818, lo: 0xbe, hi: 0xbf}, // Block 0xc, offset 0x6c {value: 0x0000, lo: 0x0b}, {value: 0x0808, lo: 0x80, hi: 0x95}, {value: 0x3308, lo: 0x96, hi: 0x99}, {value: 0x0808, lo: 0x9a, hi: 0x9a}, {value: 0x3308, lo: 0x9b, hi: 0xa3}, {value: 0x0808, lo: 0xa4, hi: 0xa4}, {value: 0x3308, lo: 0xa5, hi: 0xa7}, {value: 0x0808, lo: 0xa8, hi: 0xa8}, {value: 0x3308, lo: 0xa9, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x0818, lo: 0xb0, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0xd, offset 0x78 {value: 0x0000, lo: 0x0d}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0a08, lo: 0xa0, hi: 0xa9}, {value: 0x0c08, lo: 0xaa, hi: 0xac}, {value: 0x0808, lo: 0xad, hi: 0xad}, {value: 0x0c08, lo: 0xae, hi: 0xae}, {value: 0x0a08, lo: 0xaf, hi: 0xb0}, {value: 0x0c08, lo: 0xb1, hi: 0xb2}, {value: 0x0a08, lo: 0xb3, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xb5}, {value: 0x0a08, lo: 0xb6, hi: 0xb8}, {value: 0x0c08, lo: 0xb9, hi: 0xb9}, {value: 0x0a08, lo: 0xba, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbf}, // Block 0xe, offset 0x86 {value: 0x0000, lo: 0x04}, {value: 0x0040, lo: 0x80, hi: 0x92}, {value: 0x3308, lo: 0x93, hi: 0xa1}, {value: 0x0840, lo: 0xa2, hi: 0xa2}, {value: 0x3308, lo: 0xa3, hi: 0xbf}, // Block 0xf, offset 0x8b {value: 0x0000, lo: 0x08}, {value: 0x3308, lo: 0x80, hi: 0x82}, {value: 0x3008, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0xb9}, {value: 0x3308, lo: 0xba, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbf}, // Block 0x10, offset 0x94 {value: 0x0000, lo: 0x0f}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x3008, lo: 0x81, hi: 0x82}, {value: 0x0040, lo: 0x83, hi: 0x85}, {value: 0x3008, lo: 0x86, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x3008, lo: 0x8a, hi: 0x8c}, {value: 0x3b08, lo: 0x8d, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x96}, {value: 0x3008, lo: 0x97, hi: 0x97}, {value: 0x0040, lo: 0x98, hi: 0xa5}, {value: 0x0008, lo: 0xa6, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbf}, // Block 0x11, offset 0xa4 {value: 0x0000, lo: 0x0d}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x3008, lo: 0x81, hi: 0x83}, {value: 0x3308, lo: 0x84, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8d}, {value: 0x0008, lo: 0x8e, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x91}, {value: 0x0008, lo: 0x92, hi: 0xa8}, {value: 0x0040, lo: 0xa9, hi: 0xa9}, {value: 0x0008, lo: 0xaa, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbd}, {value: 0x3308, lo: 0xbe, hi: 0xbf}, // Block 0x12, offset 0xb2 {value: 0x0000, lo: 0x0b}, {value: 0x3308, lo: 0x80, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8d}, {value: 0x0008, lo: 0x8e, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x91}, {value: 0x0008, lo: 0x92, hi: 0xba}, {value: 0x3b08, lo: 0xbb, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbf}, // Block 0x13, offset 0xbe {value: 0x0000, lo: 0x0b}, {value: 0x0040, lo: 0x80, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x99}, {value: 0x0008, lo: 0x9a, hi: 0xb1}, {value: 0x0040, lo: 0xb2, hi: 0xb2}, {value: 0x0008, lo: 0xb3, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbf}, // Block 0x14, offset 0xca {value: 0x0000, lo: 0x10}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x89}, {value: 0x3b08, lo: 0x8a, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8e}, {value: 0x3008, lo: 0x8f, hi: 0x91}, {value: 0x3308, lo: 0x92, hi: 0x94}, {value: 0x0040, lo: 0x95, hi: 0x95}, {value: 0x3308, lo: 0x96, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x97}, {value: 0x3008, lo: 0x98, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xa5}, {value: 0x0008, lo: 0xa6, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xb1}, {value: 0x3008, lo: 0xb2, hi: 0xb3}, {value: 0x0018, lo: 0xb4, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0x15, offset 0xdb {value: 0x0000, lo: 0x09}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0xb0}, {value: 0x3308, lo: 0xb1, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xb2}, {value: 0x08f1, lo: 0xb3, hi: 0xb3}, {value: 0x3308, lo: 0xb4, hi: 0xb9}, {value: 0x3b08, lo: 0xba, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbe}, {value: 0x0018, lo: 0xbf, hi: 0xbf}, // Block 0x16, offset 0xe5 {value: 0x0000, lo: 0x06}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x3308, lo: 0x87, hi: 0x8e}, {value: 0x0018, lo: 0x8f, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0xbf}, // Block 0x17, offset 0xec {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x84}, {value: 0x0040, lo: 0x85, hi: 0x85}, {value: 0x0008, lo: 0x86, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x87}, {value: 0x3308, lo: 0x88, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9b}, {value: 0x0961, lo: 0x9c, hi: 0x9c}, {value: 0x0999, lo: 0x9d, hi: 0x9d}, {value: 0x0008, lo: 0x9e, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0x18, offset 0xf9 {value: 0x0000, lo: 0x10}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x8a}, {value: 0x0008, lo: 0x8b, hi: 0x8b}, {value: 0xe03d, lo: 0x8c, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0x97}, {value: 0x3308, lo: 0x98, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa9}, {value: 0x0018, lo: 0xaa, hi: 0xb4}, {value: 0x3308, lo: 0xb5, hi: 0xb5}, {value: 0x0018, lo: 0xb6, hi: 0xb6}, {value: 0x3308, lo: 0xb7, hi: 0xb7}, {value: 0x0018, lo: 0xb8, hi: 0xb8}, {value: 0x3308, lo: 0xb9, hi: 0xb9}, {value: 0x0018, lo: 0xba, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbf}, // Block 0x19, offset 0x10a {value: 0x0000, lo: 0x06}, {value: 0x0018, lo: 0x80, hi: 0x85}, {value: 0x3308, lo: 0x86, hi: 0x86}, {value: 0x0018, lo: 0x87, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8d}, {value: 0x0018, lo: 0x8e, hi: 0x9a}, {value: 0x0040, lo: 0x9b, hi: 0xbf}, // Block 0x1a, offset 0x111 {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0xaa}, {value: 0x3008, lo: 0xab, hi: 0xac}, {value: 0x3308, lo: 0xad, hi: 0xb0}, {value: 0x3008, lo: 0xb1, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb7}, {value: 0x3008, lo: 0xb8, hi: 0xb8}, {value: 0x3b08, lo: 0xb9, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbc}, {value: 0x3308, lo: 0xbd, hi: 0xbe}, {value: 0x0008, lo: 0xbf, hi: 0xbf}, // Block 0x1b, offset 0x11c {value: 0x0000, lo: 0x0e}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0018, lo: 0x8a, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x95}, {value: 0x3008, lo: 0x96, hi: 0x97}, {value: 0x3308, lo: 0x98, hi: 0x99}, {value: 0x0008, lo: 0x9a, hi: 0x9d}, {value: 0x3308, lo: 0x9e, hi: 0xa0}, {value: 0x0008, lo: 0xa1, hi: 0xa1}, {value: 0x3008, lo: 0xa2, hi: 0xa4}, {value: 0x0008, lo: 0xa5, hi: 0xa6}, {value: 0x3008, lo: 0xa7, hi: 0xad}, {value: 0x0008, lo: 0xae, hi: 0xb0}, {value: 0x3308, lo: 0xb1, hi: 0xb4}, {value: 0x0008, lo: 0xb5, hi: 0xbf}, // Block 0x1c, offset 0x12b {value: 0x0000, lo: 0x0d}, {value: 0x0008, lo: 0x80, hi: 0x81}, {value: 0x3308, lo: 0x82, hi: 0x82}, {value: 0x3008, lo: 0x83, hi: 0x84}, {value: 0x3308, lo: 0x85, hi: 0x86}, {value: 0x3008, lo: 0x87, hi: 0x8c}, {value: 0x3308, lo: 0x8d, hi: 0x8d}, {value: 0x0008, lo: 0x8e, hi: 0x8e}, {value: 0x3008, lo: 0x8f, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x3008, lo: 0x9a, hi: 0x9c}, {value: 0x3308, lo: 0x9d, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0x1d, offset 0x139 {value: 0x0000, lo: 0x09}, {value: 0x0040, lo: 0x80, hi: 0x86}, {value: 0x055d, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8c}, {value: 0x055d, lo: 0x8d, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xba}, {value: 0x0018, lo: 0xbb, hi: 0xbb}, {value: 0xe105, lo: 0xbc, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbf}, // Block 0x1e, offset 0x143 {value: 0x0000, lo: 0x01}, {value: 0x0018, lo: 0x80, hi: 0xbf}, // Block 0x1f, offset 0x145 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0xa0}, {value: 0x2018, lo: 0xa1, hi: 0xb5}, {value: 0x0018, lo: 0xb6, hi: 0xbf}, // Block 0x20, offset 0x14a {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0xa7}, {value: 0x2018, lo: 0xa8, hi: 0xbf}, // Block 0x21, offset 0x14d {value: 0x0000, lo: 0x02}, {value: 0x2018, lo: 0x80, hi: 0x82}, {value: 0x0018, lo: 0x83, hi: 0xbf}, // Block 0x22, offset 0x150 {value: 0x0000, lo: 0x01}, {value: 0x0008, lo: 0x80, hi: 0xbf}, // Block 0x23, offset 0x152 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0008, lo: 0x8a, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0x98}, {value: 0x0040, lo: 0x99, hi: 0x99}, {value: 0x0008, lo: 0x9a, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x24, offset 0x15e {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0008, lo: 0x8a, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xb0}, {value: 0x0040, lo: 0xb1, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb7}, {value: 0x0008, lo: 0xb8, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0x25, offset 0x169 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x0040, lo: 0x81, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0xbf}, // Block 0x26, offset 0x171 {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x91}, {value: 0x0008, lo: 0x92, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0xbf}, // Block 0x27, offset 0x177 {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x9a}, {value: 0x0040, lo: 0x9b, hi: 0x9c}, {value: 0x3308, lo: 0x9d, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbf}, // Block 0x28, offset 0x17d {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x29, offset 0x182 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb7}, {value: 0xe045, lo: 0xb8, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbf}, // Block 0x2a, offset 0x187 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0xbf}, // Block 0x2b, offset 0x18a {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xac}, {value: 0x0018, lo: 0xad, hi: 0xae}, {value: 0x0008, lo: 0xaf, hi: 0xbf}, // Block 0x2c, offset 0x18e {value: 0x0000, lo: 0x05}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0x9c}, {value: 0x0040, lo: 0x9d, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x2d, offset 0x194 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xaa}, {value: 0x0018, lo: 0xab, hi: 0xb0}, {value: 0x0008, lo: 0xb1, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbf}, // Block 0x2e, offset 0x199 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8d}, {value: 0x0008, lo: 0x8e, hi: 0x91}, {value: 0x3308, lo: 0x92, hi: 0x93}, {value: 0x3b08, lo: 0x94, hi: 0x94}, {value: 0x0040, lo: 0x95, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb3}, {value: 0x3b08, lo: 0xb4, hi: 0xb4}, {value: 0x0018, lo: 0xb5, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0x2f, offset 0x1a5 {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x91}, {value: 0x3308, lo: 0x92, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xad}, {value: 0x0008, lo: 0xae, hi: 0xb0}, {value: 0x0040, lo: 0xb1, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xbf}, // Block 0x30, offset 0x1af {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0xb3}, {value: 0x3340, lo: 0xb4, hi: 0xb5}, {value: 0x3008, lo: 0xb6, hi: 0xb6}, {value: 0x3308, lo: 0xb7, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbf}, // Block 0x31, offset 0x1b5 {value: 0x0000, lo: 0x10}, {value: 0x3008, lo: 0x80, hi: 0x85}, {value: 0x3308, lo: 0x86, hi: 0x86}, {value: 0x3008, lo: 0x87, hi: 0x88}, {value: 0x3308, lo: 0x89, hi: 0x91}, {value: 0x3b08, lo: 0x92, hi: 0x92}, {value: 0x3308, lo: 0x93, hi: 0x93}, {value: 0x0018, lo: 0x94, hi: 0x96}, {value: 0x0008, lo: 0x97, hi: 0x97}, {value: 0x0018, lo: 0x98, hi: 0x9b}, {value: 0x0008, lo: 0x9c, hi: 0x9c}, {value: 0x3308, lo: 0x9d, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa9}, {value: 0x0040, lo: 0xaa, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0x32, offset 0x1c6 {value: 0x0000, lo: 0x09}, {value: 0x0018, lo: 0x80, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x86}, {value: 0x0218, lo: 0x87, hi: 0x87}, {value: 0x0018, lo: 0x88, hi: 0x8a}, {value: 0x33c0, lo: 0x8b, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0208, lo: 0xa0, hi: 0xbf}, // Block 0x33, offset 0x1d0 {value: 0x0000, lo: 0x02}, {value: 0x0208, lo: 0x80, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbf}, // Block 0x34, offset 0x1d3 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0x84}, {value: 0x3308, lo: 0x85, hi: 0x86}, {value: 0x0208, lo: 0x87, hi: 0xa8}, {value: 0x3308, lo: 0xa9, hi: 0xa9}, {value: 0x0208, lo: 0xaa, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x35, offset 0x1db {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xbf}, // Block 0x36, offset 0x1de {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x3308, lo: 0xa0, hi: 0xa2}, {value: 0x3008, lo: 0xa3, hi: 0xa6}, {value: 0x3308, lo: 0xa7, hi: 0xa8}, {value: 0x3008, lo: 0xa9, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x3008, lo: 0xb0, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb2}, {value: 0x3008, lo: 0xb3, hi: 0xb8}, {value: 0x3308, lo: 0xb9, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0x37, offset 0x1eb {value: 0x0000, lo: 0x07}, {value: 0x0018, lo: 0x80, hi: 0x80}, {value: 0x0040, lo: 0x81, hi: 0x83}, {value: 0x0018, lo: 0x84, hi: 0x85}, {value: 0x0008, lo: 0x86, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0x38, offset 0x1f3 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x39, offset 0x1f7 {value: 0x0000, lo: 0x06}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0028, lo: 0x9a, hi: 0x9a}, {value: 0x0040, lo: 0x9b, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0xbf}, // Block 0x3a, offset 0x1fe {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0x96}, {value: 0x3308, lo: 0x97, hi: 0x98}, {value: 0x3008, lo: 0x99, hi: 0x9a}, {value: 0x3308, lo: 0x9b, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x3b, offset 0x206 {value: 0x0000, lo: 0x0f}, {value: 0x0008, lo: 0x80, hi: 0x94}, {value: 0x3008, lo: 0x95, hi: 0x95}, {value: 0x3308, lo: 0x96, hi: 0x96}, {value: 0x3008, lo: 0x97, hi: 0x97}, {value: 0x3308, lo: 0x98, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x3b08, lo: 0xa0, hi: 0xa0}, {value: 0x3008, lo: 0xa1, hi: 0xa1}, {value: 0x3308, lo: 0xa2, hi: 0xa2}, {value: 0x3008, lo: 0xa3, hi: 0xa4}, {value: 0x3308, lo: 0xa5, hi: 0xac}, {value: 0x3008, lo: 0xad, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbe}, {value: 0x3308, lo: 0xbf, hi: 0xbf}, // Block 0x3c, offset 0x216 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa6}, {value: 0x0008, lo: 0xa7, hi: 0xa7}, {value: 0x0018, lo: 0xa8, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xbd}, {value: 0x3318, lo: 0xbe, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0x3d, offset 0x222 {value: 0x0000, lo: 0x01}, {value: 0x0040, lo: 0x80, hi: 0xbf}, // Block 0x3e, offset 0x224 {value: 0x0000, lo: 0x09}, {value: 0x3308, lo: 0x80, hi: 0x83}, {value: 0x3008, lo: 0x84, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0xb3}, {value: 0x3308, lo: 0xb4, hi: 0xb4}, {value: 0x3008, lo: 0xb5, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbc}, {value: 0x3008, lo: 0xbd, hi: 0xbf}, // Block 0x3f, offset 0x22e {value: 0x0000, lo: 0x0b}, {value: 0x3008, lo: 0x80, hi: 0x81}, {value: 0x3308, lo: 0x82, hi: 0x82}, {value: 0x3008, lo: 0x83, hi: 0x83}, {value: 0x3808, lo: 0x84, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0xaa}, {value: 0x3308, lo: 0xab, hi: 0xb3}, {value: 0x0018, lo: 0xb4, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbf}, // Block 0x40, offset 0x23a {value: 0x0000, lo: 0x0b}, {value: 0x3308, lo: 0x80, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0xa0}, {value: 0x3008, lo: 0xa1, hi: 0xa1}, {value: 0x3308, lo: 0xa2, hi: 0xa5}, {value: 0x3008, lo: 0xa6, hi: 0xa7}, {value: 0x3308, lo: 0xa8, hi: 0xa9}, {value: 0x3808, lo: 0xaa, hi: 0xaa}, {value: 0x3b08, lo: 0xab, hi: 0xab}, {value: 0x3308, lo: 0xac, hi: 0xad}, {value: 0x0008, lo: 0xae, hi: 0xbf}, // Block 0x41, offset 0x246 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0xa5}, {value: 0x3308, lo: 0xa6, hi: 0xa6}, {value: 0x3008, lo: 0xa7, hi: 0xa7}, {value: 0x3308, lo: 0xa8, hi: 0xa9}, {value: 0x3008, lo: 0xaa, hi: 0xac}, {value: 0x3308, lo: 0xad, hi: 0xad}, {value: 0x3008, lo: 0xae, hi: 0xae}, {value: 0x3308, lo: 0xaf, hi: 0xb1}, {value: 0x3808, lo: 0xb2, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xbb}, {value: 0x0018, lo: 0xbc, hi: 0xbf}, // Block 0x42, offset 0x252 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0xa3}, {value: 0x3008, lo: 0xa4, hi: 0xab}, {value: 0x3308, lo: 0xac, hi: 0xb3}, {value: 0x3008, lo: 0xb4, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xba}, {value: 0x0018, lo: 0xbb, hi: 0xbf}, // Block 0x43, offset 0x25a {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0x8c}, {value: 0x0008, lo: 0x8d, hi: 0xbd}, {value: 0x0018, lo: 0xbe, hi: 0xbf}, // Block 0x44, offset 0x25f {value: 0x0000, lo: 0x0c}, {value: 0x0e29, lo: 0x80, hi: 0x80}, {value: 0x0e41, lo: 0x81, hi: 0x81}, {value: 0x0e59, lo: 0x82, hi: 0x82}, {value: 0x0e71, lo: 0x83, hi: 0x83}, {value: 0x0e89, lo: 0x84, hi: 0x85}, {value: 0x0ea1, lo: 0x86, hi: 0x86}, {value: 0x0eb9, lo: 0x87, hi: 0x87}, {value: 0x057d, lo: 0x88, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x8f}, {value: 0x059d, lo: 0x90, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbc}, {value: 0x059d, lo: 0xbd, hi: 0xbf}, // Block 0x45, offset 0x26c {value: 0x0000, lo: 0x10}, {value: 0x0018, lo: 0x80, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x3308, lo: 0x90, hi: 0x92}, {value: 0x0018, lo: 0x93, hi: 0x93}, {value: 0x3308, lo: 0x94, hi: 0xa0}, {value: 0x3008, lo: 0xa1, hi: 0xa1}, {value: 0x3308, lo: 0xa2, hi: 0xa8}, {value: 0x0008, lo: 0xa9, hi: 0xac}, {value: 0x3308, lo: 0xad, hi: 0xad}, {value: 0x0008, lo: 0xae, hi: 0xb3}, {value: 0x3308, lo: 0xb4, hi: 0xb4}, {value: 0x0008, lo: 0xb5, hi: 0xb6}, {value: 0x3008, lo: 0xb7, hi: 0xb7}, {value: 0x3308, lo: 0xb8, hi: 0xb9}, {value: 0x0008, lo: 0xba, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbf}, // Block 0x46, offset 0x27d {value: 0x0000, lo: 0x03}, {value: 0x3308, lo: 0x80, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xba}, {value: 0x3308, lo: 0xbb, hi: 0xbf}, // Block 0x47, offset 0x281 {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x87}, {value: 0xe045, lo: 0x88, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x97}, {value: 0xe045, lo: 0x98, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa7}, {value: 0xe045, lo: 0xa8, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb7}, {value: 0xe045, lo: 0xb8, hi: 0xbf}, // Block 0x48, offset 0x28c {value: 0x0000, lo: 0x03}, {value: 0x0040, lo: 0x80, hi: 0x8f}, {value: 0x3318, lo: 0x90, hi: 0xb0}, {value: 0x0040, lo: 0xb1, hi: 0xbf}, // Block 0x49, offset 0x290 {value: 0x0000, lo: 0x08}, {value: 0x0018, lo: 0x80, hi: 0x82}, {value: 0x0040, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0x84}, {value: 0x0018, lo: 0x85, hi: 0x88}, {value: 0x24c1, lo: 0x89, hi: 0x89}, {value: 0x0018, lo: 0x8a, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xbf}, // Block 0x4a, offset 0x299 {value: 0x0000, lo: 0x07}, {value: 0x0018, lo: 0x80, hi: 0xab}, {value: 0x24f1, lo: 0xac, hi: 0xac}, {value: 0x2529, lo: 0xad, hi: 0xad}, {value: 0x0018, lo: 0xae, hi: 0xae}, {value: 0x2579, lo: 0xaf, hi: 0xaf}, {value: 0x25b1, lo: 0xb0, hi: 0xb0}, {value: 0x0018, lo: 0xb1, hi: 0xbf}, // Block 0x4b, offset 0x2a1 {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x9f}, {value: 0x0080, lo: 0xa0, hi: 0xa0}, {value: 0x0018, lo: 0xa1, hi: 0xad}, {value: 0x0080, lo: 0xae, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xbf}, // Block 0x4c, offset 0x2a7 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0xa8}, {value: 0x09dd, lo: 0xa9, hi: 0xa9}, {value: 0x09fd, lo: 0xaa, hi: 0xaa}, {value: 0x0018, lo: 0xab, hi: 0xbf}, // Block 0x4d, offset 0x2ac {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xbf}, // Block 0x4e, offset 0x2af {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0x8b}, {value: 0x28c1, lo: 0x8c, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0xbf}, // Block 0x4f, offset 0x2b3 {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0xb3}, {value: 0x0e7e, lo: 0xb4, hi: 0xb4}, {value: 0x292a, lo: 0xb5, hi: 0xb5}, {value: 0x0e9e, lo: 0xb6, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xbf}, // Block 0x50, offset 0x2b9 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0x9b}, {value: 0x2941, lo: 0x9c, hi: 0x9c}, {value: 0x0018, lo: 0x9d, hi: 0xbf}, // Block 0x51, offset 0x2bd {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xb5}, {value: 0x0018, lo: 0xb6, hi: 0xbf}, // Block 0x52, offset 0x2c1 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x97}, {value: 0x0018, lo: 0x98, hi: 0xbf}, // Block 0x53, offset 0x2c5 {value: 0x0000, lo: 0x05}, {value: 0xe185, lo: 0x80, hi: 0x8f}, {value: 0x03f5, lo: 0x90, hi: 0x9f}, {value: 0x0ebd, lo: 0xa0, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x54, offset 0x2cb {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0xa5}, {value: 0x0040, lo: 0xa6, hi: 0xa6}, {value: 0x0008, lo: 0xa7, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xac}, {value: 0x0008, lo: 0xad, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x55, offset 0x2d3 {value: 0x0000, lo: 0x06}, {value: 0x0008, lo: 0x80, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xae}, {value: 0xe075, lo: 0xaf, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb0}, {value: 0x0040, lo: 0xb1, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0x56, offset 0x2da {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xa7}, {value: 0x0008, lo: 0xa8, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xb7}, {value: 0x0008, lo: 0xb8, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0x57, offset 0x2e5 {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x8e}, {value: 0x0040, lo: 0x8f, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x3308, lo: 0xa0, hi: 0xbf}, // Block 0x58, offset 0x2ef {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xae}, {value: 0x0008, lo: 0xaf, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xbf}, // Block 0x59, offset 0x2f3 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0xbf}, // Block 0x5a, offset 0x2f6 {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0x9e}, {value: 0x0ef5, lo: 0x9f, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xbf}, // Block 0x5b, offset 0x2fc {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xb2}, {value: 0x0f15, lo: 0xb3, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xbf}, // Block 0x5c, offset 0x300 {value: 0x0020, lo: 0x01}, {value: 0x0f35, lo: 0x80, hi: 0xbf}, // Block 0x5d, offset 0x302 {value: 0x0020, lo: 0x02}, {value: 0x1735, lo: 0x80, hi: 0x8f}, {value: 0x1915, lo: 0x90, hi: 0xbf}, // Block 0x5e, offset 0x305 {value: 0x0020, lo: 0x01}, {value: 0x1f15, lo: 0x80, hi: 0xbf}, // Block 0x5f, offset 0x307 {value: 0x0000, lo: 0x02}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0xbf}, // Block 0x60, offset 0x30a {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x98}, {value: 0x3308, lo: 0x99, hi: 0x9a}, {value: 0x29e2, lo: 0x9b, hi: 0x9b}, {value: 0x2a0a, lo: 0x9c, hi: 0x9c}, {value: 0x0008, lo: 0x9d, hi: 0x9e}, {value: 0x2a31, lo: 0x9f, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa0}, {value: 0x0008, lo: 0xa1, hi: 0xbf}, // Block 0x61, offset 0x314 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xbe}, {value: 0x2a69, lo: 0xbf, hi: 0xbf}, // Block 0x62, offset 0x317 {value: 0x0000, lo: 0x0e}, {value: 0x0040, lo: 0x80, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xb0}, {value: 0x2a35, lo: 0xb1, hi: 0xb1}, {value: 0x2a55, lo: 0xb2, hi: 0xb2}, {value: 0x2a75, lo: 0xb3, hi: 0xb3}, {value: 0x2a95, lo: 0xb4, hi: 0xb4}, {value: 0x2a75, lo: 0xb5, hi: 0xb5}, {value: 0x2ab5, lo: 0xb6, hi: 0xb6}, {value: 0x2ad5, lo: 0xb7, hi: 0xb7}, {value: 0x2af5, lo: 0xb8, hi: 0xb9}, {value: 0x2b15, lo: 0xba, hi: 0xbb}, {value: 0x2b35, lo: 0xbc, hi: 0xbd}, {value: 0x2b15, lo: 0xbe, hi: 0xbf}, // Block 0x63, offset 0x326 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xa3}, {value: 0x0040, lo: 0xa4, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x64, offset 0x32a {value: 0x0030, lo: 0x04}, {value: 0x2aa2, lo: 0x80, hi: 0x9d}, {value: 0x305a, lo: 0x9e, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x30a2, lo: 0xa0, hi: 0xbf}, // Block 0x65, offset 0x32f {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, // Block 0x66, offset 0x332 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xbf}, // Block 0x67, offset 0x336 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xbd}, {value: 0x0018, lo: 0xbe, hi: 0xbf}, // Block 0x68, offset 0x33b {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xbf}, // Block 0x69, offset 0x340 {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0xa5}, {value: 0x0018, lo: 0xa6, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb1}, {value: 0x0018, lo: 0xb2, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbf}, // Block 0x6a, offset 0x346 {value: 0x0000, lo: 0x0b}, {value: 0x0040, lo: 0x80, hi: 0x81}, {value: 0xe00d, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0x83}, {value: 0x03f5, lo: 0x84, hi: 0x84}, {value: 0x1329, lo: 0x85, hi: 0x85}, {value: 0x447d, lo: 0x86, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0xb6}, {value: 0x0008, lo: 0xb7, hi: 0xb7}, {value: 0x2009, lo: 0xb8, hi: 0xb8}, {value: 0x6e89, lo: 0xb9, hi: 0xb9}, {value: 0x0008, lo: 0xba, hi: 0xbf}, // Block 0x6b, offset 0x352 {value: 0x0000, lo: 0x0e}, {value: 0x0008, lo: 0x80, hi: 0x81}, {value: 0x3308, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0x85}, {value: 0x3b08, lo: 0x86, hi: 0x86}, {value: 0x0008, lo: 0x87, hi: 0x8a}, {value: 0x3308, lo: 0x8b, hi: 0x8b}, {value: 0x0008, lo: 0x8c, hi: 0xa2}, {value: 0x3008, lo: 0xa3, hi: 0xa4}, {value: 0x3308, lo: 0xa5, hi: 0xa6}, {value: 0x3008, lo: 0xa7, hi: 0xa7}, {value: 0x0018, lo: 0xa8, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0x6c, offset 0x361 {value: 0x0000, lo: 0x05}, {value: 0x0208, lo: 0x80, hi: 0xb1}, {value: 0x0108, lo: 0xb2, hi: 0xb2}, {value: 0x0008, lo: 0xb3, hi: 0xb3}, {value: 0x0018, lo: 0xb4, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbf}, // Block 0x6d, offset 0x367 {value: 0x0000, lo: 0x03}, {value: 0x3008, lo: 0x80, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0xb3}, {value: 0x3008, lo: 0xb4, hi: 0xbf}, // Block 0x6e, offset 0x36b {value: 0x0000, lo: 0x0e}, {value: 0x3008, lo: 0x80, hi: 0x83}, {value: 0x3b08, lo: 0x84, hi: 0x84}, {value: 0x3308, lo: 0x85, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x8d}, {value: 0x0018, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x3308, lo: 0xa0, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xb7}, {value: 0x0018, lo: 0xb8, hi: 0xba}, {value: 0x0008, lo: 0xbb, hi: 0xbb}, {value: 0x0018, lo: 0xbc, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbe}, {value: 0x3308, lo: 0xbf, hi: 0xbf}, // Block 0x6f, offset 0x37a {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xa5}, {value: 0x3308, lo: 0xa6, hi: 0xad}, {value: 0x0018, lo: 0xae, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x70, offset 0x37f {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x3308, lo: 0x87, hi: 0x91}, {value: 0x3008, lo: 0x92, hi: 0x92}, {value: 0x3808, lo: 0x93, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x9e}, {value: 0x0018, lo: 0x9f, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbf}, // Block 0x71, offset 0x387 {value: 0x0000, lo: 0x09}, {value: 0x3308, lo: 0x80, hi: 0x82}, {value: 0x3008, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb3}, {value: 0x3008, lo: 0xb4, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xb9}, {value: 0x3008, lo: 0xba, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbf}, // Block 0x72, offset 0x391 {value: 0x0000, lo: 0x0a}, {value: 0x3808, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8e}, {value: 0x0008, lo: 0x8f, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa4}, {value: 0x3308, lo: 0xa5, hi: 0xa5}, {value: 0x0008, lo: 0xa6, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0x73, offset 0x39c {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0xa8}, {value: 0x3308, lo: 0xa9, hi: 0xae}, {value: 0x3008, lo: 0xaf, hi: 0xb0}, {value: 0x3308, lo: 0xb1, hi: 0xb2}, {value: 0x3008, lo: 0xb3, hi: 0xb4}, {value: 0x3308, lo: 0xb5, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0x74, offset 0x3a4 {value: 0x0000, lo: 0x10}, {value: 0x0008, lo: 0x80, hi: 0x82}, {value: 0x3308, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0x8b}, {value: 0x3308, lo: 0x8c, hi: 0x8c}, {value: 0x3008, lo: 0x8d, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9b}, {value: 0x0018, lo: 0x9c, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xb9}, {value: 0x0008, lo: 0xba, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbc}, {value: 0x3008, lo: 0xbd, hi: 0xbd}, {value: 0x0008, lo: 0xbe, hi: 0xbf}, // Block 0x75, offset 0x3b5 {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb0}, {value: 0x0008, lo: 0xb1, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb4}, {value: 0x0008, lo: 0xb5, hi: 0xb6}, {value: 0x3308, lo: 0xb7, hi: 0xb8}, {value: 0x0008, lo: 0xb9, hi: 0xbd}, {value: 0x3308, lo: 0xbe, hi: 0xbf}, // Block 0x76, offset 0x3be {value: 0x0000, lo: 0x0f}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0x82}, {value: 0x0040, lo: 0x83, hi: 0x9a}, {value: 0x0008, lo: 0x9b, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xaa}, {value: 0x3008, lo: 0xab, hi: 0xab}, {value: 0x3308, lo: 0xac, hi: 0xad}, {value: 0x3008, lo: 0xae, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xb4}, {value: 0x3008, lo: 0xb5, hi: 0xb5}, {value: 0x3b08, lo: 0xb6, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0x77, offset 0x3ce {value: 0x0000, lo: 0x0c}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x88}, {value: 0x0008, lo: 0x89, hi: 0x8e}, {value: 0x0040, lo: 0x8f, hi: 0x90}, {value: 0x0008, lo: 0x91, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xa7}, {value: 0x0008, lo: 0xa8, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x78, offset 0x3db {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0x9b}, {value: 0x449d, lo: 0x9c, hi: 0x9c}, {value: 0x44b5, lo: 0x9d, hi: 0x9d}, {value: 0x2971, lo: 0x9e, hi: 0x9e}, {value: 0xe06d, lo: 0x9f, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xaf}, {value: 0x44cd, lo: 0xb0, hi: 0xbf}, // Block 0x79, offset 0x3e5 {value: 0x0000, lo: 0x04}, {value: 0x44ed, lo: 0x80, hi: 0x8f}, {value: 0x450d, lo: 0x90, hi: 0x9f}, {value: 0x452d, lo: 0xa0, hi: 0xaf}, {value: 0x450d, lo: 0xb0, hi: 0xbf}, // Block 0x7a, offset 0x3ea {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0xa2}, {value: 0x3008, lo: 0xa3, hi: 0xa4}, {value: 0x3308, lo: 0xa5, hi: 0xa5}, {value: 0x3008, lo: 0xa6, hi: 0xa7}, {value: 0x3308, lo: 0xa8, hi: 0xa8}, {value: 0x3008, lo: 0xa9, hi: 0xaa}, {value: 0x0018, lo: 0xab, hi: 0xab}, {value: 0x3008, lo: 0xac, hi: 0xac}, {value: 0x3b08, lo: 0xad, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0x7b, offset 0x3f7 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xa3}, {value: 0x0040, lo: 0xa4, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xbf}, // Block 0x7c, offset 0x3fb {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x8a}, {value: 0x0018, lo: 0x8b, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0x7d, offset 0x400 {value: 0x0020, lo: 0x01}, {value: 0x454d, lo: 0x80, hi: 0xbf}, // Block 0x7e, offset 0x402 {value: 0x0020, lo: 0x03}, {value: 0x4d4d, lo: 0x80, hi: 0x94}, {value: 0x4b0d, lo: 0x95, hi: 0x95}, {value: 0x4fed, lo: 0x96, hi: 0xbf}, // Block 0x7f, offset 0x406 {value: 0x0020, lo: 0x01}, {value: 0x552d, lo: 0x80, hi: 0xbf}, // Block 0x80, offset 0x408 {value: 0x0020, lo: 0x03}, {value: 0x5d2d, lo: 0x80, hi: 0x84}, {value: 0x568d, lo: 0x85, hi: 0x85}, {value: 0x5dcd, lo: 0x86, hi: 0xbf}, // Block 0x81, offset 0x40c {value: 0x0020, lo: 0x08}, {value: 0x6b8d, lo: 0x80, hi: 0x8f}, {value: 0x6d4d, lo: 0x90, hi: 0x90}, {value: 0x6d8d, lo: 0x91, hi: 0xab}, {value: 0x6ea1, lo: 0xac, hi: 0xac}, {value: 0x70ed, lo: 0xad, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x710d, lo: 0xb0, hi: 0xbf}, // Block 0x82, offset 0x415 {value: 0x0020, lo: 0x05}, {value: 0x730d, lo: 0x80, hi: 0xad}, {value: 0x656d, lo: 0xae, hi: 0xae}, {value: 0x78cd, lo: 0xaf, hi: 0xb5}, {value: 0x6f8d, lo: 0xb6, hi: 0xb6}, {value: 0x79ad, lo: 0xb7, hi: 0xbf}, // Block 0x83, offset 0x41b {value: 0x0028, lo: 0x03}, {value: 0x7c21, lo: 0x80, hi: 0x82}, {value: 0x7be1, lo: 0x83, hi: 0x83}, {value: 0x7c99, lo: 0x84, hi: 0xbf}, // Block 0x84, offset 0x41f {value: 0x0038, lo: 0x0f}, {value: 0x9db1, lo: 0x80, hi: 0x83}, {value: 0x9e59, lo: 0x84, hi: 0x85}, {value: 0x9e91, lo: 0x86, hi: 0x87}, {value: 0x9ec9, lo: 0x88, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x91}, {value: 0xa089, lo: 0x92, hi: 0x97}, {value: 0xa1a1, lo: 0x98, hi: 0x9c}, {value: 0xa281, lo: 0x9d, hi: 0xb3}, {value: 0x9d41, lo: 0xb4, hi: 0xb4}, {value: 0x9db1, lo: 0xb5, hi: 0xb5}, {value: 0xa789, lo: 0xb6, hi: 0xbb}, {value: 0xa869, lo: 0xbc, hi: 0xbc}, {value: 0xa7f9, lo: 0xbd, hi: 0xbd}, {value: 0xa8d9, lo: 0xbe, hi: 0xbf}, // Block 0x85, offset 0x42f {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8c}, {value: 0x0008, lo: 0x8d, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xa7}, {value: 0x0008, lo: 0xa8, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbb}, {value: 0x0008, lo: 0xbc, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbe}, {value: 0x0008, lo: 0xbf, hi: 0xbf}, // Block 0x86, offset 0x439 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0xbf}, // Block 0x87, offset 0x43e {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbf}, // Block 0x88, offset 0x441 {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x82}, {value: 0x0040, lo: 0x83, hi: 0x86}, {value: 0x0018, lo: 0x87, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xbf}, // Block 0x89, offset 0x447 {value: 0x0000, lo: 0x06}, {value: 0x0018, lo: 0x80, hi: 0x8e}, {value: 0x0040, lo: 0x8f, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa0}, {value: 0x0040, lo: 0xa1, hi: 0xbf}, // Block 0x8a, offset 0x44e {value: 0x0000, lo: 0x04}, {value: 0x0040, lo: 0x80, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xbc}, {value: 0x3308, lo: 0xbd, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbf}, // Block 0x8b, offset 0x453 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0x9c}, {value: 0x0040, lo: 0x9d, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x8c, offset 0x457 {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x9f}, {value: 0x3308, lo: 0xa0, hi: 0xa0}, {value: 0x0018, lo: 0xa1, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0x8d, offset 0x45d {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa3}, {value: 0x0040, lo: 0xa4, hi: 0xac}, {value: 0x0008, lo: 0xad, hi: 0xbf}, // Block 0x8e, offset 0x462 {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0x89}, {value: 0x0018, lo: 0x8a, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbf}, // Block 0x8f, offset 0x46b {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9e}, {value: 0x0018, lo: 0x9f, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x90, offset 0x470 {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0xbf}, // Block 0x91, offset 0x476 {value: 0x0000, lo: 0x06}, {value: 0xe145, lo: 0x80, hi: 0x87}, {value: 0xe1c5, lo: 0x88, hi: 0x8f}, {value: 0xe145, lo: 0x90, hi: 0x97}, {value: 0x8b0d, lo: 0x98, hi: 0x9f}, {value: 0x8b25, lo: 0xa0, hi: 0xa7}, {value: 0x0008, lo: 0xa8, hi: 0xbf}, // Block 0x92, offset 0x47d {value: 0x0000, lo: 0x06}, {value: 0x0008, lo: 0x80, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa9}, {value: 0x0040, lo: 0xaa, hi: 0xaf}, {value: 0x8b25, lo: 0xb0, hi: 0xb7}, {value: 0x8b0d, lo: 0xb8, hi: 0xbf}, // Block 0x93, offset 0x484 {value: 0x0000, lo: 0x06}, {value: 0xe145, lo: 0x80, hi: 0x87}, {value: 0xe1c5, lo: 0x88, hi: 0x8f}, {value: 0xe145, lo: 0x90, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0x94, offset 0x48b {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x95, offset 0x48f {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xa3}, {value: 0x0040, lo: 0xa4, hi: 0xae}, {value: 0x0018, lo: 0xaf, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, // Block 0x96, offset 0x494 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0x97, offset 0x497 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xbf}, // Block 0x98, offset 0x49c {value: 0x0000, lo: 0x0b}, {value: 0x0808, lo: 0x80, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x87}, {value: 0x0808, lo: 0x88, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0808, lo: 0x8a, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb6}, {value: 0x0808, lo: 0xb7, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbb}, {value: 0x0808, lo: 0xbc, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbe}, {value: 0x0808, lo: 0xbf, hi: 0xbf}, // Block 0x99, offset 0x4a8 {value: 0x0000, lo: 0x05}, {value: 0x0808, lo: 0x80, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x96}, {value: 0x0818, lo: 0x97, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xb6}, {value: 0x0818, lo: 0xb7, hi: 0xbf}, // Block 0x9a, offset 0x4ae {value: 0x0000, lo: 0x04}, {value: 0x0808, lo: 0x80, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0xa6}, {value: 0x0818, lo: 0xa7, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, // Block 0x9b, offset 0x4b3 {value: 0x0000, lo: 0x06}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xb3}, {value: 0x0808, lo: 0xb4, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xba}, {value: 0x0818, lo: 0xbb, hi: 0xbf}, // Block 0x9c, offset 0x4ba {value: 0x0000, lo: 0x07}, {value: 0x0808, lo: 0x80, hi: 0x95}, {value: 0x0818, lo: 0x96, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0x9e}, {value: 0x0018, lo: 0x9f, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbe}, {value: 0x0818, lo: 0xbf, hi: 0xbf}, // Block 0x9d, offset 0x4c2 {value: 0x0000, lo: 0x04}, {value: 0x0808, lo: 0x80, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbb}, {value: 0x0818, lo: 0xbc, hi: 0xbd}, {value: 0x0808, lo: 0xbe, hi: 0xbf}, // Block 0x9e, offset 0x4c7 {value: 0x0000, lo: 0x03}, {value: 0x0818, lo: 0x80, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0x91}, {value: 0x0818, lo: 0x92, hi: 0xbf}, // Block 0x9f, offset 0x4cb {value: 0x0000, lo: 0x0f}, {value: 0x0808, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x84}, {value: 0x3308, lo: 0x85, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x8b}, {value: 0x3308, lo: 0x8c, hi: 0x8f}, {value: 0x0808, lo: 0x90, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x94}, {value: 0x0808, lo: 0x95, hi: 0x97}, {value: 0x0040, lo: 0x98, hi: 0x98}, {value: 0x0808, lo: 0x99, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb7}, {value: 0x3308, lo: 0xb8, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0xa0, offset 0x4db {value: 0x0000, lo: 0x06}, {value: 0x0818, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x8f}, {value: 0x0818, lo: 0x90, hi: 0x98}, {value: 0x0040, lo: 0x99, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xbc}, {value: 0x0818, lo: 0xbd, hi: 0xbf}, // Block 0xa1, offset 0x4e2 {value: 0x0000, lo: 0x03}, {value: 0x0808, lo: 0x80, hi: 0x9c}, {value: 0x0818, lo: 0x9d, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0xa2, offset 0x4e6 {value: 0x0000, lo: 0x03}, {value: 0x0808, lo: 0x80, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb8}, {value: 0x0018, lo: 0xb9, hi: 0xbf}, // Block 0xa3, offset 0x4ea {value: 0x0000, lo: 0x06}, {value: 0x0808, lo: 0x80, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x97}, {value: 0x0818, lo: 0x98, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xb7}, {value: 0x0818, lo: 0xb8, hi: 0xbf}, // Block 0xa4, offset 0x4f1 {value: 0x0000, lo: 0x01}, {value: 0x0808, lo: 0x80, hi: 0xbf}, // Block 0xa5, offset 0x4f3 {value: 0x0000, lo: 0x02}, {value: 0x0808, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0xbf}, // Block 0xa6, offset 0x4f6 {value: 0x0000, lo: 0x02}, {value: 0x03dd, lo: 0x80, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xbf}, // Block 0xa7, offset 0x4f9 {value: 0x0000, lo: 0x03}, {value: 0x0808, lo: 0x80, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xb9}, {value: 0x0818, lo: 0xba, hi: 0xbf}, // Block 0xa8, offset 0x4fd {value: 0x0000, lo: 0x08}, {value: 0x0908, lo: 0x80, hi: 0x80}, {value: 0x0a08, lo: 0x81, hi: 0xa1}, {value: 0x0c08, lo: 0xa2, hi: 0xa2}, {value: 0x0a08, lo: 0xa3, hi: 0xa3}, {value: 0x3308, lo: 0xa4, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xaf}, {value: 0x0808, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0xa9, offset 0x506 {value: 0x0000, lo: 0x03}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0818, lo: 0xa0, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0xaa, offset 0x50a {value: 0x0000, lo: 0x07}, {value: 0x0808, lo: 0x80, hi: 0x9c}, {value: 0x0818, lo: 0x9d, hi: 0xa6}, {value: 0x0808, lo: 0xa7, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xaf}, {value: 0x0a08, lo: 0xb0, hi: 0xb2}, {value: 0x0c08, lo: 0xb3, hi: 0xb3}, {value: 0x0a08, lo: 0xb4, hi: 0xbf}, // Block 0xab, offset 0x512 {value: 0x0000, lo: 0x07}, {value: 0x0a08, lo: 0x80, hi: 0x84}, {value: 0x0808, lo: 0x85, hi: 0x85}, {value: 0x3308, lo: 0x86, hi: 0x90}, {value: 0x0a18, lo: 0x91, hi: 0x93}, {value: 0x0c18, lo: 0x94, hi: 0x94}, {value: 0x0818, lo: 0x95, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0xbf}, // Block 0xac, offset 0x51a {value: 0x0000, lo: 0x03}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0xad, offset 0x51e {value: 0x0000, lo: 0x05}, {value: 0x3008, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0xb7}, {value: 0x3308, lo: 0xb8, hi: 0xbf}, // Block 0xae, offset 0x524 {value: 0x0000, lo: 0x08}, {value: 0x3308, lo: 0x80, hi: 0x85}, {value: 0x3b08, lo: 0x86, hi: 0x86}, {value: 0x0018, lo: 0x87, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x91}, {value: 0x0018, lo: 0x92, hi: 0xa5}, {value: 0x0008, lo: 0xa6, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0xaf, offset 0x52d {value: 0x0000, lo: 0x0b}, {value: 0x3308, lo: 0x80, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0xaf}, {value: 0x3008, lo: 0xb0, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb6}, {value: 0x3008, lo: 0xb7, hi: 0xb8}, {value: 0x3b08, lo: 0xb9, hi: 0xb9}, {value: 0x3308, lo: 0xba, hi: 0xba}, {value: 0x0018, lo: 0xbb, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbd}, {value: 0x0018, lo: 0xbe, hi: 0xbf}, // Block 0xb0, offset 0x539 {value: 0x0000, lo: 0x06}, {value: 0x0018, lo: 0x80, hi: 0x81}, {value: 0x0040, lo: 0x82, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xa8}, {value: 0x0040, lo: 0xa9, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0xb1, offset 0x540 {value: 0x0000, lo: 0x08}, {value: 0x3308, lo: 0x80, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0xa6}, {value: 0x3308, lo: 0xa7, hi: 0xab}, {value: 0x3008, lo: 0xac, hi: 0xac}, {value: 0x3308, lo: 0xad, hi: 0xb2}, {value: 0x3b08, lo: 0xb3, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xb5}, {value: 0x0008, lo: 0xb6, hi: 0xbf}, // Block 0xb2, offset 0x549 {value: 0x0000, lo: 0x09}, {value: 0x0018, lo: 0x80, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0x84}, {value: 0x3008, lo: 0x85, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb3}, {value: 0x0018, lo: 0xb4, hi: 0xb5}, {value: 0x0008, lo: 0xb6, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0xb3, offset 0x553 {value: 0x0000, lo: 0x06}, {value: 0x3308, lo: 0x80, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0xb2}, {value: 0x3008, lo: 0xb3, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xbe}, {value: 0x3008, lo: 0xbf, hi: 0xbf}, // Block 0xb4, offset 0x55a {value: 0x0000, lo: 0x0d}, {value: 0x3808, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0x84}, {value: 0x0018, lo: 0x85, hi: 0x88}, {value: 0x3308, lo: 0x89, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0x9b}, {value: 0x0008, lo: 0x9c, hi: 0x9c}, {value: 0x0018, lo: 0x9d, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xa0}, {value: 0x0018, lo: 0xa1, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0xb5, offset 0x568 {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x91}, {value: 0x0040, lo: 0x92, hi: 0x92}, {value: 0x0008, lo: 0x93, hi: 0xab}, {value: 0x3008, lo: 0xac, hi: 0xae}, {value: 0x3308, lo: 0xaf, hi: 0xb1}, {value: 0x3008, lo: 0xb2, hi: 0xb3}, {value: 0x3308, lo: 0xb4, hi: 0xb4}, {value: 0x3808, lo: 0xb5, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xb7}, {value: 0x0018, lo: 0xb8, hi: 0xbd}, {value: 0x3308, lo: 0xbe, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0xb6, offset 0x575 {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0008, lo: 0x8a, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8e}, {value: 0x0008, lo: 0x8f, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9e}, {value: 0x0008, lo: 0x9f, hi: 0xa8}, {value: 0x0018, lo: 0xa9, hi: 0xa9}, {value: 0x0040, lo: 0xaa, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0xb7, offset 0x582 {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0x9e}, {value: 0x3308, lo: 0x9f, hi: 0x9f}, {value: 0x3008, lo: 0xa0, hi: 0xa2}, {value: 0x3308, lo: 0xa3, hi: 0xa9}, {value: 0x3b08, lo: 0xaa, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0xb8, offset 0x58b {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xb4}, {value: 0x3008, lo: 0xb5, hi: 0xb7}, {value: 0x3308, lo: 0xb8, hi: 0xbf}, // Block 0xb9, offset 0x58f {value: 0x0000, lo: 0x0f}, {value: 0x3008, lo: 0x80, hi: 0x81}, {value: 0x3b08, lo: 0x82, hi: 0x82}, {value: 0x3308, lo: 0x83, hi: 0x84}, {value: 0x3008, lo: 0x85, hi: 0x85}, {value: 0x3308, lo: 0x86, hi: 0x86}, {value: 0x0008, lo: 0x87, hi: 0x8a}, {value: 0x0018, lo: 0x8b, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0x9c}, {value: 0x0018, lo: 0x9d, hi: 0x9d}, {value: 0x3308, lo: 0x9e, hi: 0x9e}, {value: 0x0008, lo: 0x9f, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0xba, offset 0x59f {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x3008, lo: 0xb0, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb8}, {value: 0x3008, lo: 0xb9, hi: 0xb9}, {value: 0x3308, lo: 0xba, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbe}, {value: 0x3308, lo: 0xbf, hi: 0xbf}, // Block 0xbb, offset 0x5a7 {value: 0x0000, lo: 0x0a}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x3008, lo: 0x81, hi: 0x81}, {value: 0x3b08, lo: 0x82, hi: 0x82}, {value: 0x3308, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0x85}, {value: 0x0018, lo: 0x86, hi: 0x86}, {value: 0x0008, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0xbf}, // Block 0xbc, offset 0x5b2 {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0xae}, {value: 0x3008, lo: 0xaf, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb7}, {value: 0x3008, lo: 0xb8, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0xbd, offset 0x5bb {value: 0x0000, lo: 0x05}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0x9b}, {value: 0x3308, lo: 0x9c, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0xbf}, // Block 0xbe, offset 0x5c1 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x3008, lo: 0xb0, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbc}, {value: 0x3308, lo: 0xbd, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0xbf, offset 0x5c9 {value: 0x0000, lo: 0x08}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0x84}, {value: 0x0040, lo: 0x85, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xbf}, // Block 0xc0, offset 0x5d2 {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0xaa}, {value: 0x3308, lo: 0xab, hi: 0xab}, {value: 0x3008, lo: 0xac, hi: 0xac}, {value: 0x3308, lo: 0xad, hi: 0xad}, {value: 0x3008, lo: 0xae, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb5}, {value: 0x3808, lo: 0xb6, hi: 0xb6}, {value: 0x3308, lo: 0xb7, hi: 0xb7}, {value: 0x0008, lo: 0xb8, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbf}, // Block 0xc1, offset 0x5dd {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0xbf}, // Block 0xc2, offset 0x5e0 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x9a}, {value: 0x0040, lo: 0x9b, hi: 0x9c}, {value: 0x3308, lo: 0x9d, hi: 0x9f}, {value: 0x3008, lo: 0xa0, hi: 0xa1}, {value: 0x3308, lo: 0xa2, hi: 0xa5}, {value: 0x3008, lo: 0xa6, hi: 0xa6}, {value: 0x3308, lo: 0xa7, hi: 0xaa}, {value: 0x3b08, lo: 0xab, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb9}, {value: 0x0018, lo: 0xba, hi: 0xbf}, // Block 0xc3, offset 0x5ec {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0xab}, {value: 0x3008, lo: 0xac, hi: 0xae}, {value: 0x3308, lo: 0xaf, hi: 0xb7}, {value: 0x3008, lo: 0xb8, hi: 0xb8}, {value: 0x3b08, lo: 0xb9, hi: 0xb9}, {value: 0x3308, lo: 0xba, hi: 0xba}, {value: 0x0018, lo: 0xbb, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0xc4, offset 0x5f5 {value: 0x0000, lo: 0x02}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x049d, lo: 0xa0, hi: 0xbf}, // Block 0xc5, offset 0x5f8 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xa9}, {value: 0x0018, lo: 0xaa, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xbe}, {value: 0x0008, lo: 0xbf, hi: 0xbf}, // Block 0xc6, offset 0x5fd {value: 0x0000, lo: 0x04}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xa9}, {value: 0x0008, lo: 0xaa, hi: 0xbf}, // Block 0xc7, offset 0x602 {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x90}, {value: 0x3008, lo: 0x91, hi: 0x93}, {value: 0x3308, lo: 0x94, hi: 0x97}, {value: 0x0040, lo: 0x98, hi: 0x99}, {value: 0x3308, lo: 0x9a, hi: 0x9b}, {value: 0x3008, lo: 0x9c, hi: 0x9f}, {value: 0x3b08, lo: 0xa0, hi: 0xa0}, {value: 0x0008, lo: 0xa1, hi: 0xa1}, {value: 0x0018, lo: 0xa2, hi: 0xa2}, {value: 0x0008, lo: 0xa3, hi: 0xa3}, {value: 0x3008, lo: 0xa4, hi: 0xa4}, {value: 0x0040, lo: 0xa5, hi: 0xbf}, // Block 0xc8, offset 0x60f {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x8a}, {value: 0x0008, lo: 0x8b, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb3}, {value: 0x3b08, lo: 0xb4, hi: 0xb4}, {value: 0x3308, lo: 0xb5, hi: 0xb8}, {value: 0x3008, lo: 0xb9, hi: 0xb9}, {value: 0x0008, lo: 0xba, hi: 0xba}, {value: 0x3308, lo: 0xbb, hi: 0xbe}, {value: 0x0018, lo: 0xbf, hi: 0xbf}, // Block 0xc9, offset 0x61a {value: 0x0000, lo: 0x08}, {value: 0x0018, lo: 0x80, hi: 0x86}, {value: 0x3b08, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x90}, {value: 0x3308, lo: 0x91, hi: 0x96}, {value: 0x3008, lo: 0x97, hi: 0x98}, {value: 0x3308, lo: 0x99, hi: 0x9b}, {value: 0x0008, lo: 0x9c, hi: 0xbf}, // Block 0xca, offset 0x623 {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x3308, lo: 0x8a, hi: 0x96}, {value: 0x3008, lo: 0x97, hi: 0x97}, {value: 0x3308, lo: 0x98, hi: 0x98}, {value: 0x3b08, lo: 0x99, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0x9c}, {value: 0x0008, lo: 0x9d, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0xa2}, {value: 0x0040, lo: 0xa3, hi: 0xbf}, // Block 0xcb, offset 0x62d {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbf}, // Block 0xcc, offset 0x630 {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0008, lo: 0x8a, hi: 0xae}, {value: 0x3008, lo: 0xaf, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xb7}, {value: 0x3308, lo: 0xb8, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0xcd, offset 0x63a {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xbf}, // Block 0xce, offset 0x643 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0x91}, {value: 0x3308, lo: 0x92, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xa8}, {value: 0x3008, lo: 0xa9, hi: 0xa9}, {value: 0x3308, lo: 0xaa, hi: 0xb0}, {value: 0x3008, lo: 0xb1, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb3}, {value: 0x3008, lo: 0xb4, hi: 0xb4}, {value: 0x3308, lo: 0xb5, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0xcf, offset 0x64f {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0x8a}, {value: 0x0008, lo: 0x8b, hi: 0xb0}, {value: 0x3308, lo: 0xb1, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xb9}, {value: 0x3308, lo: 0xba, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbe}, {value: 0x3308, lo: 0xbf, hi: 0xbf}, // Block 0xd0, offset 0x65c {value: 0x0000, lo: 0x0c}, {value: 0x3308, lo: 0x80, hi: 0x83}, {value: 0x3b08, lo: 0x84, hi: 0x85}, {value: 0x0008, lo: 0x86, hi: 0x86}, {value: 0x3308, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa5}, {value: 0x0040, lo: 0xa6, hi: 0xa6}, {value: 0x0008, lo: 0xa7, hi: 0xa8}, {value: 0x0040, lo: 0xa9, hi: 0xa9}, {value: 0x0008, lo: 0xaa, hi: 0xbf}, // Block 0xd1, offset 0x669 {value: 0x0000, lo: 0x0d}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x3008, lo: 0x8a, hi: 0x8e}, {value: 0x0040, lo: 0x8f, hi: 0x8f}, {value: 0x3308, lo: 0x90, hi: 0x91}, {value: 0x0040, lo: 0x92, hi: 0x92}, {value: 0x3008, lo: 0x93, hi: 0x94}, {value: 0x3308, lo: 0x95, hi: 0x95}, {value: 0x3008, lo: 0x96, hi: 0x96}, {value: 0x3b08, lo: 0x97, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0x98}, {value: 0x0040, lo: 0x99, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa9}, {value: 0x0040, lo: 0xaa, hi: 0xbf}, // Block 0xd2, offset 0x677 {value: 0x0000, lo: 0x06}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb4}, {value: 0x3008, lo: 0xb5, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbf}, // Block 0xd3, offset 0x67e {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xb1}, {value: 0x0040, lo: 0xb2, hi: 0xbe}, {value: 0x0018, lo: 0xbf, hi: 0xbf}, // Block 0xd4, offset 0x682 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0xbf}, // Block 0xd5, offset 0x685 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0xd6, offset 0x68a {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0xbf}, // Block 0xd7, offset 0x68d {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x0340, lo: 0xb0, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbf}, // Block 0xd8, offset 0x692 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0xbf}, // Block 0xd9, offset 0x695 {value: 0x0000, lo: 0x06}, {value: 0x0008, lo: 0x80, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa9}, {value: 0x0040, lo: 0xaa, hi: 0xad}, {value: 0x0018, lo: 0xae, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, // Block 0xda, offset 0x69c {value: 0x0000, lo: 0x06}, {value: 0x0040, lo: 0x80, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb4}, {value: 0x0018, lo: 0xb5, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xbf}, // Block 0xdb, offset 0x6a3 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xbf}, // Block 0xdc, offset 0x6a7 {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x83}, {value: 0x0018, lo: 0x84, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0xa1}, {value: 0x0040, lo: 0xa2, hi: 0xa2}, {value: 0x0008, lo: 0xa3, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbf}, // Block 0xdd, offset 0x6b2 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0xbf}, // Block 0xde, offset 0x6b5 {value: 0x0000, lo: 0x02}, {value: 0xe105, lo: 0x80, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0xdf, offset 0x6b8 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0x9a}, {value: 0x0040, lo: 0x9b, hi: 0xbf}, // Block 0xe0, offset 0x6bb {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8e}, {value: 0x3308, lo: 0x8f, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x90}, {value: 0x3008, lo: 0x91, hi: 0xbf}, // Block 0xe1, offset 0x6c1 {value: 0x0000, lo: 0x05}, {value: 0x3008, lo: 0x80, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8e}, {value: 0x3308, lo: 0x8f, hi: 0x92}, {value: 0x0008, lo: 0x93, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0xe2, offset 0x6c7 {value: 0x0000, lo: 0x05}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa1}, {value: 0x0018, lo: 0xa2, hi: 0xa2}, {value: 0x0008, lo: 0xa3, hi: 0xa3}, {value: 0x0040, lo: 0xa4, hi: 0xbf}, // Block 0xe3, offset 0x6cd {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbf}, // Block 0xe4, offset 0x6d0 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xbf}, // Block 0xe5, offset 0x6d3 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0xbf}, // Block 0xe6, offset 0x6d6 {value: 0x0000, lo: 0x06}, {value: 0x0040, lo: 0x80, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x92}, {value: 0x0040, lo: 0x93, hi: 0xa3}, {value: 0x0008, lo: 0xa4, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0xe7, offset 0x6dd {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0xe8, offset 0x6e0 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbf}, // Block 0xe9, offset 0x6e5 {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9b}, {value: 0x0018, lo: 0x9c, hi: 0x9c}, {value: 0x3308, lo: 0x9d, hi: 0x9e}, {value: 0x0018, lo: 0x9f, hi: 0x9f}, {value: 0x03c0, lo: 0xa0, hi: 0xa3}, {value: 0x0040, lo: 0xa4, hi: 0xbf}, // Block 0xea, offset 0x6ef {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xbf}, // Block 0xeb, offset 0x6f2 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xa8}, {value: 0x0018, lo: 0xa9, hi: 0xbf}, // Block 0xec, offset 0x6f6 {value: 0x0000, lo: 0x0e}, {value: 0x0018, lo: 0x80, hi: 0x9d}, {value: 0xb5b9, lo: 0x9e, hi: 0x9e}, {value: 0xb601, lo: 0x9f, hi: 0x9f}, {value: 0xb649, lo: 0xa0, hi: 0xa0}, {value: 0xb6b1, lo: 0xa1, hi: 0xa1}, {value: 0xb719, lo: 0xa2, hi: 0xa2}, {value: 0xb781, lo: 0xa3, hi: 0xa3}, {value: 0xb7e9, lo: 0xa4, hi: 0xa4}, {value: 0x3018, lo: 0xa5, hi: 0xa6}, {value: 0x3318, lo: 0xa7, hi: 0xa9}, {value: 0x0018, lo: 0xaa, hi: 0xac}, {value: 0x3018, lo: 0xad, hi: 0xb2}, {value: 0x0340, lo: 0xb3, hi: 0xba}, {value: 0x3318, lo: 0xbb, hi: 0xbf}, // Block 0xed, offset 0x705 {value: 0x0000, lo: 0x0b}, {value: 0x3318, lo: 0x80, hi: 0x82}, {value: 0x0018, lo: 0x83, hi: 0x84}, {value: 0x3318, lo: 0x85, hi: 0x8b}, {value: 0x0018, lo: 0x8c, hi: 0xa9}, {value: 0x3318, lo: 0xaa, hi: 0xad}, {value: 0x0018, lo: 0xae, hi: 0xba}, {value: 0xb851, lo: 0xbb, hi: 0xbb}, {value: 0xb899, lo: 0xbc, hi: 0xbc}, {value: 0xb8e1, lo: 0xbd, hi: 0xbd}, {value: 0xb949, lo: 0xbe, hi: 0xbe}, {value: 0xb9b1, lo: 0xbf, hi: 0xbf}, // Block 0xee, offset 0x711 {value: 0x0000, lo: 0x03}, {value: 0xba19, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0xa8}, {value: 0x0040, lo: 0xa9, hi: 0xbf}, // Block 0xef, offset 0x715 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x81}, {value: 0x3318, lo: 0x82, hi: 0x84}, {value: 0x0018, lo: 0x85, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0xbf}, // Block 0xf0, offset 0x71a {value: 0x0000, lo: 0x03}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xbf}, // Block 0xf1, offset 0x71e {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbf}, // Block 0xf2, offset 0x723 {value: 0x0000, lo: 0x03}, {value: 0x3308, lo: 0x80, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xba}, {value: 0x3308, lo: 0xbb, hi: 0xbf}, // Block 0xf3, offset 0x727 {value: 0x0000, lo: 0x04}, {value: 0x3308, lo: 0x80, hi: 0xac}, {value: 0x0018, lo: 0xad, hi: 0xb4}, {value: 0x3308, lo: 0xb5, hi: 0xb5}, {value: 0x0018, lo: 0xb6, hi: 0xbf}, // Block 0xf4, offset 0x72c {value: 0x0000, lo: 0x08}, {value: 0x0018, lo: 0x80, hi: 0x83}, {value: 0x3308, lo: 0x84, hi: 0x84}, {value: 0x0018, lo: 0x85, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x9a}, {value: 0x3308, lo: 0x9b, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xa0}, {value: 0x3308, lo: 0xa1, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, // Block 0xf5, offset 0x735 {value: 0x0000, lo: 0x0a}, {value: 0x3308, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x87}, {value: 0x3308, lo: 0x88, hi: 0x98}, {value: 0x0040, lo: 0x99, hi: 0x9a}, {value: 0x3308, lo: 0x9b, hi: 0xa1}, {value: 0x0040, lo: 0xa2, hi: 0xa2}, {value: 0x3308, lo: 0xa3, hi: 0xa4}, {value: 0x0040, lo: 0xa5, hi: 0xa5}, {value: 0x3308, lo: 0xa6, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xbf}, // Block 0xf6, offset 0x740 {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb6}, {value: 0x0008, lo: 0xb7, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbf}, // Block 0xf7, offset 0x746 {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0x8d}, {value: 0x0008, lo: 0x8e, hi: 0x8e}, {value: 0x0018, lo: 0x8f, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0xbf}, // Block 0xf8, offset 0x74c {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0xab}, {value: 0x3308, lo: 0xac, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbe}, {value: 0x0018, lo: 0xbf, hi: 0xbf}, // Block 0xf9, offset 0x752 {value: 0x0000, lo: 0x05}, {value: 0x0808, lo: 0x80, hi: 0x84}, {value: 0x0040, lo: 0x85, hi: 0x86}, {value: 0x0818, lo: 0x87, hi: 0x8f}, {value: 0x3308, lo: 0x90, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0xbf}, // Block 0xfa, offset 0x758 {value: 0x0000, lo: 0x08}, {value: 0x0a08, lo: 0x80, hi: 0x83}, {value: 0x3308, lo: 0x84, hi: 0x8a}, {value: 0x0b08, lo: 0x8b, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8f}, {value: 0x0808, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9d}, {value: 0x0818, lo: 0x9e, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0xfb, offset 0x761 {value: 0x0000, lo: 0x02}, {value: 0x0040, lo: 0x80, hi: 0xb0}, {value: 0x0818, lo: 0xb1, hi: 0xbf}, // Block 0xfc, offset 0x764 {value: 0x0000, lo: 0x02}, {value: 0x0818, lo: 0x80, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0xfd, offset 0x767 {value: 0x0000, lo: 0x03}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0818, lo: 0x81, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbf}, // Block 0xfe, offset 0x76b {value: 0x0000, lo: 0x03}, {value: 0x0040, lo: 0x80, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb1}, {value: 0x0040, lo: 0xb2, hi: 0xbf}, // Block 0xff, offset 0x76f {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xbf}, // Block 0x100, offset 0x773 {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xb0}, {value: 0x0018, lo: 0xb1, hi: 0xbf}, // Block 0x101, offset 0x779 {value: 0x0000, lo: 0x05}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0x90}, {value: 0x0018, lo: 0x91, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xbf}, // Block 0x102, offset 0x77f {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x8f}, {value: 0xc1d9, lo: 0x90, hi: 0x90}, {value: 0x0018, lo: 0x91, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xbf}, // Block 0x103, offset 0x784 {value: 0x0000, lo: 0x02}, {value: 0x0040, lo: 0x80, hi: 0xa5}, {value: 0x0018, lo: 0xa6, hi: 0xbf}, // Block 0x104, offset 0x787 {value: 0x0000, lo: 0x0f}, {value: 0xc801, lo: 0x80, hi: 0x80}, {value: 0xc851, lo: 0x81, hi: 0x81}, {value: 0xc8a1, lo: 0x82, hi: 0x82}, {value: 0xc8f1, lo: 0x83, hi: 0x83}, {value: 0xc941, lo: 0x84, hi: 0x84}, {value: 0xc991, lo: 0x85, hi: 0x85}, {value: 0xc9e1, lo: 0x86, hi: 0x86}, {value: 0xca31, lo: 0x87, hi: 0x87}, {value: 0xca81, lo: 0x88, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x8f}, {value: 0xcad1, lo: 0x90, hi: 0x90}, {value: 0xcaf1, lo: 0x91, hi: 0x91}, {value: 0x0040, lo: 0x92, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa5}, {value: 0x0040, lo: 0xa6, hi: 0xbf}, // Block 0x105, offset 0x797 {value: 0x0000, lo: 0x06}, {value: 0x0018, lo: 0x80, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbf}, // Block 0x106, offset 0x79e {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xbf}, // Block 0x107, offset 0x7a1 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x98}, {value: 0x0040, lo: 0x99, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xbf}, // Block 0x108, offset 0x7a6 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xbf}, // Block 0x109, offset 0x7aa {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xbf}, // Block 0x10a, offset 0x7b0 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xbf}, // Block 0x10b, offset 0x7b5 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0xbf}, // Block 0x10c, offset 0x7b9 {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0xb1}, {value: 0x0040, lo: 0xb2, hi: 0xb2}, {value: 0x0018, lo: 0xb3, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xb9}, {value: 0x0018, lo: 0xba, hi: 0xbf}, // Block 0x10d, offset 0x7bf {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0xa2}, {value: 0x0040, lo: 0xa3, hi: 0xa4}, {value: 0x0018, lo: 0xa5, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xad}, {value: 0x0018, lo: 0xae, hi: 0xbf}, // Block 0x10e, offset 0x7c5 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0xbf}, // Block 0x10f, offset 0x7c9 {value: 0x0000, lo: 0x08}, {value: 0x0018, lo: 0x80, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xb7}, {value: 0x0018, lo: 0xb8, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbf}, // Block 0x110, offset 0x7d2 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x82}, {value: 0x0040, lo: 0x83, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0xbf}, // Block 0x111, offset 0x7d7 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0xbf}, // Block 0x112, offset 0x7da {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0x113, offset 0x7dd {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x114, offset 0x7e1 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xa1}, {value: 0x0040, lo: 0xa2, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x115, offset 0x7e5 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xa0}, {value: 0x0040, lo: 0xa1, hi: 0xbf}, // Block 0x116, offset 0x7e8 {value: 0x0020, lo: 0x0f}, {value: 0xded1, lo: 0x80, hi: 0x89}, {value: 0x8e35, lo: 0x8a, hi: 0x8a}, {value: 0xe011, lo: 0x8b, hi: 0x9c}, {value: 0x8e55, lo: 0x9d, hi: 0x9d}, {value: 0xe251, lo: 0x9e, hi: 0xa2}, {value: 0x8e75, lo: 0xa3, hi: 0xa3}, {value: 0xe2f1, lo: 0xa4, hi: 0xab}, {value: 0x7f0d, lo: 0xac, hi: 0xac}, {value: 0xe3f1, lo: 0xad, hi: 0xaf}, {value: 0x8e95, lo: 0xb0, hi: 0xb0}, {value: 0xe451, lo: 0xb1, hi: 0xb6}, {value: 0x8eb5, lo: 0xb7, hi: 0xb9}, {value: 0xe511, lo: 0xba, hi: 0xba}, {value: 0x8f15, lo: 0xbb, hi: 0xbb}, {value: 0xe531, lo: 0xbc, hi: 0xbf}, // Block 0x117, offset 0x7f8 {value: 0x0020, lo: 0x10}, {value: 0x93b5, lo: 0x80, hi: 0x80}, {value: 0xf0b1, lo: 0x81, hi: 0x86}, {value: 0x93d5, lo: 0x87, hi: 0x8a}, {value: 0xda11, lo: 0x8b, hi: 0x8b}, {value: 0xf171, lo: 0x8c, hi: 0x96}, {value: 0x9455, lo: 0x97, hi: 0x97}, {value: 0xf2d1, lo: 0x98, hi: 0xa3}, {value: 0x9475, lo: 0xa4, hi: 0xa6}, {value: 0xf451, lo: 0xa7, hi: 0xaa}, {value: 0x94d5, lo: 0xab, hi: 0xab}, {value: 0xf4d1, lo: 0xac, hi: 0xac}, {value: 0x94f5, lo: 0xad, hi: 0xad}, {value: 0xf4f1, lo: 0xae, hi: 0xaf}, {value: 0x9515, lo: 0xb0, hi: 0xb1}, {value: 0xf531, lo: 0xb2, hi: 0xbe}, {value: 0x2040, lo: 0xbf, hi: 0xbf}, // Block 0x118, offset 0x809 {value: 0x0000, lo: 0x04}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0340, lo: 0x81, hi: 0x81}, {value: 0x0040, lo: 0x82, hi: 0x9f}, {value: 0x0340, lo: 0xa0, hi: 0xbf}, // Block 0x119, offset 0x80e {value: 0x0000, lo: 0x01}, {value: 0x0340, lo: 0x80, hi: 0xbf}, // Block 0x11a, offset 0x810 {value: 0x0000, lo: 0x01}, {value: 0x33c0, lo: 0x80, hi: 0xbf}, // Block 0x11b, offset 0x812 {value: 0x0000, lo: 0x02}, {value: 0x33c0, lo: 0x80, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, } // Total table size 42780 bytes (41KiB); checksum: 29936AB9 ================================================ FILE: vendor/golang.org/x/net/idna/tables13.0.0.go ================================================ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. //go:build go1.16 && !go1.21 package idna // UnicodeVersion is the Unicode version from which the tables in this package are derived. const UnicodeVersion = "13.0.0" var mappings string = "" + // Size: 6539 bytes " ̈a ̄23 ́ ̧1o1⁄41⁄23⁄4i̇l·ʼnsdžⱥⱦhjrwy ̆ ̇ ̊ ̨ ̃ ̋lẍ́ ι; ̈́եւاٴوٴۇٴيٴक" + "़ख़ग़ज़ड़ढ़फ़य़ড়ঢ়য়ਲ਼ਸ਼ਖ਼ਗ਼ਜ਼ਫ਼ଡ଼ଢ଼ําໍາຫນຫມགྷཌྷདྷབྷཛྷཀྵཱཱིུྲྀྲཱྀླྀླཱ" + "ཱྀྀྒྷྜྷྡྷྦྷྫྷྐྵвдостъѣæbdeǝgikmnȣptuɐɑəɛɜŋɔɯvβγδφχρнɒcɕðfɟɡɥɨɩɪʝɭʟɱɰɲɳ" + "ɴɵɸʂʃƫʉʊʋʌzʐʑʒθssάέήίόύώἀιἁιἂιἃιἄιἅιἆιἇιἠιἡιἢιἣιἤιἥιἦιἧιὠιὡιὢιὣιὤιὥιὦιὧ" + "ιὰιαιάιᾶιι ̈͂ὴιηιήιῆι ̓̀ ̓́ ̓͂ΐ ̔̀ ̔́ ̔͂ΰ ̈̀`ὼιωιώιῶι′′′′′‵‵‵‵‵!!???!!?" + "′′′′0456789+=()rsħnoqsmtmωåאבגדπ1⁄71⁄91⁄101⁄32⁄31⁄52⁄53⁄54⁄51⁄65⁄61⁄83" + "⁄85⁄87⁄81⁄iiivviviiiixxi0⁄3∫∫∫∫∫∮∮∮∮∮1011121314151617181920(10)(11)(12" + ")(13)(14)(15)(16)(17)(18)(19)(20)∫∫∫∫==⫝̸ɫɽȿɀ. ゙ ゚よりコト(ᄀ)(ᄂ)(ᄃ)(ᄅ)(ᄆ)(ᄇ)" + "(ᄉ)(ᄋ)(ᄌ)(ᄎ)(ᄏ)(ᄐ)(ᄑ)(ᄒ)(가)(나)(다)(라)(마)(바)(사)(아)(자)(차)(카)(타)(파)(하)(주)(오전" + ")(오후)(一)(二)(三)(四)(五)(六)(七)(八)(九)(十)(月)(火)(水)(木)(金)(土)(日)(株)(有)(社)(名)(特)(" + "財)(祝)(労)(代)(呼)(学)(監)(企)(資)(協)(祭)(休)(自)(至)21222324252627282930313233343" + "5참고주의3637383940414243444546474849501月2月3月4月5月6月7月8月9月10月11月12月hgev令和アパート" + "アルファアンペアアールイニングインチウォンエスクードエーカーオンスオームカイリカラットカロリーガロンガンマギガギニーキュリーギルダーキロキロ" + "グラムキロメートルキロワットグラムグラムトンクルゼイロクローネケースコルナコーポサイクルサンチームシリングセンチセントダースデシドルトンナノ" + "ノットハイツパーセントパーツバーレルピアストルピクルピコビルファラッドフィートブッシェルフランヘクタールペソペニヒヘルツペンスページベータポ" + "イントボルトホンポンドホールホーンマイクロマイルマッハマルクマンションミクロンミリミリバールメガメガトンメートルヤードヤールユアンリットルリ" + "ラルピールーブルレムレントゲンワット0点1点2点3点4点5点6点7点8点9点10点11点12点13点14点15点16点17点18点19点20" + "点21点22点23点24点daauovpcdmiu平成昭和大正明治株式会社panamakakbmbgbkcalpfnfmgkghzmldlk" + "lfmnmmmcmkmm2m3m∕sm∕s2rad∕srad∕s2psnsmspvnvmvkvpwnwmwkwbqcccdc∕kgdbgyhah" + "pinkkktlmlnlxphprsrsvwbv∕ma∕m1日2日3日4日5日6日7日8日9日10日11日12日13日14日15日16日17日1" + "8日19日20日21日22日23日24日25日26日27日28日29日30日31日ьɦɬʞʇœʍ𤋮𢡊𢡄𣏕𥉉𥳐𧻓fffiflstմնմեմիվնմ" + "խיִײַעהכלםרתשׁשׂשּׁשּׂאַאָאּבּגּדּהּוּזּטּיּךּכּלּמּנּסּףּפּצּקּרּשּתּו" + "ֹבֿכֿפֿאלٱٻپڀٺٿٹڤڦڄڃچڇڍڌڎڈژڑکگڳڱںڻۀہھےۓڭۇۆۈۋۅۉېىئائەئوئۇئۆئۈئېئىیئجئحئم" + "ئيبجبحبخبمبىبيتجتحتختمتىتيثجثمثىثيجحجمحجحمخجخحخمسجسحسخسمصحصمضجضحضخضمطحط" + "مظمعجعمغجغمفجفحفخفمفىفيقحقمقىقيكاكجكحكخكلكمكىكيلجلحلخلملىليمجمحمخمممىمي" + "نجنحنخنمنىنيهجهمهىهييجيحيخيميىييذٰرٰىٰ ٌّ ٍّ َّ ُّ ِّ ّٰئرئزئنبربزبنترت" + "زتنثرثزثنمانرنزننيريزينئخئهبهتهصخلهنههٰيهثهسهشمشهـَّـُّـِّطىطيعىعيغىغيس" + "ىسيشىشيحىحيجىجيخىخيصىصيضىضيشجشحشخشرسرصرضراًتجمتحجتحمتخمتمجتمحتمخجمححميح" + "مىسحجسجحسجىسمحسمجسممصححصممشحمشجيشمخشممضحىضخمطمحطممطميعجمعممعمىغممغميغمى" + "فخمقمحقمملحملحيلحىلججلخملمحمحجمحممحيمجحمجممخجمخممجخهمجهممنحمنحىنجمنجىنم" + "ينمىيممبخيتجيتجىتخيتخىتميتمىجميجحىجمىسخىصحيشحيضحيلجيلمييحييجييميمميقمين" + "حيعميكمينجحمخيلجمكممجحيحجيمجيفميبحيسخينجيصلےقلےاللهاكبرمحمدصلعمرسولعليه" + "وسلمصلىصلى الله عليه وسلمجل جلالهریال,:!?_{}[]#&*-<>\\$%@ـًـَـُـِـّـْءآ" + "أؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهويلآلألإلا\x22'/^|~¢£¬¦¥𝅗𝅥𝅘𝅥𝅘𝅥𝅮𝅘𝅥𝅯𝅘𝅥𝅰𝅘𝅥𝅱" + "𝅘𝅥𝅲𝆹𝅥𝆺𝅥𝆹𝅥𝅮𝆺𝅥𝅮𝆹𝅥𝅯𝆺𝅥𝅯ıȷαεζηκλμνξοστυψ∇∂ϝٮڡٯ0,1,2,3,4,5,6,7,8,9,(a)(b)(c" + ")(d)(e)(f)(g)(h)(i)(j)(k)(l)(m)(n)(o)(p)(q)(r)(s)(t)(u)(v)(w)(x)(y)(z)〔s" + "〕wzhvsdppvwcmcmdmrdjほかココサ手字双デ二多解天交映無料前後再新初終生販声吹演投捕一三遊左中右指走打禁空合満有月申割営配〔" + "本〕〔三〕〔二〕〔安〕〔点〕〔打〕〔盗〕〔勝〕〔敗〕得可丽丸乁你侮侻倂偺備僧像㒞免兔兤具㒹內冗冤仌冬况凵刃㓟刻剆剷㔕勇勉勤勺包匆北卉卑博即卽" + "卿灰及叟叫叱吆咞吸呈周咢哶唐啓啣善喙喫喳嗂圖嘆圗噑噴切壮城埴堍型堲報墬売壷夆夢奢姬娛娧姘婦㛮嬈嬾寃寘寧寳寿将尢㞁屠屮峀岍嵃嵮嵫嵼巡巢㠯巽帨帽" + "幩㡢㡼庰庳庶廊廾舁弢㣇形彫㣣徚忍志忹悁㤺㤜悔惇慈慌慎慺憎憲憤憯懞懲懶成戛扝抱拔捐挽拼捨掃揤搢揅掩㨮摩摾撝摷㩬敏敬旣書晉㬙暑㬈㫤冒冕最暜肭䏙朗" + "望朡杞杓㭉柺枅桒梅梎栟椔㮝楂榣槪檨櫛㰘次歔㱎歲殟殺殻汎沿泍汧洖派海流浩浸涅洴港湮㴳滋滇淹潮濆瀹瀞瀛㶖灊災灷炭煅熜爨爵牐犀犕獺王㺬玥㺸瑇瑜瑱璅" + "瓊㼛甤甾異瘐㿼䀈直眞真睊䀹瞋䁆䂖硎碌磌䃣祖福秫䄯穀穊穏䈂篆築䈧糒䊠糨糣紀絣䌁緇縂繅䌴䍙罺羕翺者聠聰䏕育脃䐋脾媵舄辞䑫芑芋芝劳花芳芽苦若茝荣莭" + "茣莽菧著荓菊菌菜䔫蓱蓳蔖蕤䕝䕡䕫虐虜虧虩蚩蚈蜎蛢蝹蜨蝫螆蟡蠁䗹衠衣裗裞䘵裺㒻䚾䛇誠諭變豕貫賁贛起跋趼跰軔輸邔郱鄑鄛鈸鋗鋘鉼鏹鐕開䦕閷䧦雃嶲霣" + "䩮䩶韠䪲頋頩飢䬳餩馧駂駾䯎鬒鱀鳽䳎䳭鵧䳸麻䵖黹黾鼅鼏鼖鼻" var mappingIndex = []uint16{ // 1650 elements // Entry 0 - 3F 0x0000, 0x0000, 0x0001, 0x0004, 0x0005, 0x0008, 0x0009, 0x000a, 0x000d, 0x0010, 0x0011, 0x0012, 0x0017, 0x001c, 0x0021, 0x0024, 0x0027, 0x002a, 0x002b, 0x002e, 0x0031, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003c, 0x003f, 0x0042, 0x0045, 0x0048, 0x004b, 0x004c, 0x004d, 0x0051, 0x0054, 0x0055, 0x005a, 0x005e, 0x0062, 0x0066, 0x006a, 0x006e, 0x0074, 0x007a, 0x0080, 0x0086, 0x008c, 0x0092, 0x0098, 0x009e, 0x00a4, 0x00aa, 0x00b0, 0x00b6, 0x00bc, 0x00c2, 0x00c8, 0x00ce, 0x00d4, 0x00da, 0x00e0, 0x00e6, // Entry 40 - 7F 0x00ec, 0x00f2, 0x00f8, 0x00fe, 0x0104, 0x010a, 0x0110, 0x0116, 0x011c, 0x0122, 0x0128, 0x012e, 0x0137, 0x013d, 0x0146, 0x014c, 0x0152, 0x0158, 0x015e, 0x0164, 0x016a, 0x0170, 0x0172, 0x0174, 0x0176, 0x0178, 0x017a, 0x017c, 0x017e, 0x0180, 0x0181, 0x0182, 0x0183, 0x0185, 0x0186, 0x0187, 0x0188, 0x0189, 0x018a, 0x018c, 0x018d, 0x018e, 0x018f, 0x0191, 0x0193, 0x0195, 0x0197, 0x0199, 0x019b, 0x019d, 0x019f, 0x01a0, 0x01a2, 0x01a4, 0x01a6, 0x01a8, 0x01aa, 0x01ac, 0x01ae, 0x01b0, 0x01b1, 0x01b3, 0x01b5, 0x01b6, // Entry 80 - BF 0x01b8, 0x01ba, 0x01bc, 0x01be, 0x01c0, 0x01c2, 0x01c4, 0x01c6, 0x01c8, 0x01ca, 0x01cc, 0x01ce, 0x01d0, 0x01d2, 0x01d4, 0x01d6, 0x01d8, 0x01da, 0x01dc, 0x01de, 0x01e0, 0x01e2, 0x01e4, 0x01e5, 0x01e7, 0x01e9, 0x01eb, 0x01ed, 0x01ef, 0x01f1, 0x01f3, 0x01f5, 0x01f7, 0x01f9, 0x01fb, 0x01fd, 0x0202, 0x0207, 0x020c, 0x0211, 0x0216, 0x021b, 0x0220, 0x0225, 0x022a, 0x022f, 0x0234, 0x0239, 0x023e, 0x0243, 0x0248, 0x024d, 0x0252, 0x0257, 0x025c, 0x0261, 0x0266, 0x026b, 0x0270, 0x0275, 0x027a, 0x027e, 0x0282, 0x0287, // Entry C0 - FF 0x0289, 0x028e, 0x0293, 0x0297, 0x029b, 0x02a0, 0x02a5, 0x02aa, 0x02af, 0x02b1, 0x02b6, 0x02bb, 0x02c0, 0x02c2, 0x02c7, 0x02c8, 0x02cd, 0x02d1, 0x02d5, 0x02da, 0x02e0, 0x02e9, 0x02ef, 0x02f8, 0x02fa, 0x02fc, 0x02fe, 0x0300, 0x030c, 0x030d, 0x030e, 0x030f, 0x0310, 0x0311, 0x0312, 0x0313, 0x0314, 0x0315, 0x0316, 0x0317, 0x0319, 0x031b, 0x031d, 0x031e, 0x0320, 0x0322, 0x0324, 0x0326, 0x0328, 0x032a, 0x032c, 0x032e, 0x0330, 0x0335, 0x033a, 0x0340, 0x0345, 0x034a, 0x034f, 0x0354, 0x0359, 0x035e, 0x0363, 0x0368, // Entry 100 - 13F 0x036d, 0x0372, 0x0377, 0x037c, 0x0380, 0x0382, 0x0384, 0x0386, 0x038a, 0x038c, 0x038e, 0x0393, 0x0399, 0x03a2, 0x03a8, 0x03b1, 0x03b3, 0x03b5, 0x03b7, 0x03b9, 0x03bb, 0x03bd, 0x03bf, 0x03c1, 0x03c3, 0x03c5, 0x03c7, 0x03cb, 0x03cf, 0x03d3, 0x03d7, 0x03db, 0x03df, 0x03e3, 0x03e7, 0x03eb, 0x03ef, 0x03f3, 0x03ff, 0x0401, 0x0406, 0x0408, 0x040a, 0x040c, 0x040e, 0x040f, 0x0413, 0x0417, 0x041d, 0x0423, 0x0428, 0x042d, 0x0432, 0x0437, 0x043c, 0x0441, 0x0446, 0x044b, 0x0450, 0x0455, 0x045a, 0x045f, 0x0464, 0x0469, // Entry 140 - 17F 0x046e, 0x0473, 0x0478, 0x047d, 0x0482, 0x0487, 0x048c, 0x0491, 0x0496, 0x049b, 0x04a0, 0x04a5, 0x04aa, 0x04af, 0x04b4, 0x04bc, 0x04c4, 0x04c9, 0x04ce, 0x04d3, 0x04d8, 0x04dd, 0x04e2, 0x04e7, 0x04ec, 0x04f1, 0x04f6, 0x04fb, 0x0500, 0x0505, 0x050a, 0x050f, 0x0514, 0x0519, 0x051e, 0x0523, 0x0528, 0x052d, 0x0532, 0x0537, 0x053c, 0x0541, 0x0546, 0x054b, 0x0550, 0x0555, 0x055a, 0x055f, 0x0564, 0x0569, 0x056e, 0x0573, 0x0578, 0x057a, 0x057c, 0x057e, 0x0580, 0x0582, 0x0584, 0x0586, 0x0588, 0x058a, 0x058c, 0x058e, // Entry 180 - 1BF 0x0590, 0x0592, 0x0594, 0x0596, 0x059c, 0x05a2, 0x05a4, 0x05a6, 0x05a8, 0x05aa, 0x05ac, 0x05ae, 0x05b0, 0x05b2, 0x05b4, 0x05b6, 0x05b8, 0x05ba, 0x05bc, 0x05be, 0x05c0, 0x05c4, 0x05c8, 0x05cc, 0x05d0, 0x05d4, 0x05d8, 0x05dc, 0x05e0, 0x05e4, 0x05e9, 0x05ee, 0x05f3, 0x05f5, 0x05f7, 0x05fd, 0x0609, 0x0615, 0x0621, 0x062a, 0x0636, 0x063f, 0x0648, 0x0657, 0x0663, 0x066c, 0x0675, 0x067e, 0x068a, 0x0696, 0x069f, 0x06a8, 0x06ae, 0x06b7, 0x06c3, 0x06cf, 0x06d5, 0x06e4, 0x06f6, 0x0705, 0x070e, 0x071d, 0x072c, 0x0738, // Entry 1C0 - 1FF 0x0741, 0x074a, 0x0753, 0x075f, 0x076e, 0x077a, 0x0783, 0x078c, 0x0795, 0x079b, 0x07a1, 0x07a7, 0x07ad, 0x07b6, 0x07bf, 0x07ce, 0x07d7, 0x07e3, 0x07f2, 0x07fb, 0x0801, 0x0807, 0x0816, 0x0822, 0x0831, 0x083a, 0x0849, 0x084f, 0x0858, 0x0861, 0x086a, 0x0873, 0x087c, 0x0888, 0x0891, 0x0897, 0x08a0, 0x08a9, 0x08b2, 0x08be, 0x08c7, 0x08d0, 0x08d9, 0x08e8, 0x08f4, 0x08fa, 0x0909, 0x090f, 0x091b, 0x0927, 0x0930, 0x0939, 0x0942, 0x094e, 0x0954, 0x095d, 0x0969, 0x096f, 0x097e, 0x0987, 0x098b, 0x098f, 0x0993, 0x0997, // Entry 200 - 23F 0x099b, 0x099f, 0x09a3, 0x09a7, 0x09ab, 0x09af, 0x09b4, 0x09b9, 0x09be, 0x09c3, 0x09c8, 0x09cd, 0x09d2, 0x09d7, 0x09dc, 0x09e1, 0x09e6, 0x09eb, 0x09f0, 0x09f5, 0x09fa, 0x09fc, 0x09fe, 0x0a00, 0x0a02, 0x0a04, 0x0a06, 0x0a0c, 0x0a12, 0x0a18, 0x0a1e, 0x0a2a, 0x0a2c, 0x0a2e, 0x0a30, 0x0a32, 0x0a34, 0x0a36, 0x0a38, 0x0a3c, 0x0a3e, 0x0a40, 0x0a42, 0x0a44, 0x0a46, 0x0a48, 0x0a4a, 0x0a4c, 0x0a4e, 0x0a50, 0x0a52, 0x0a54, 0x0a56, 0x0a58, 0x0a5a, 0x0a5f, 0x0a65, 0x0a6c, 0x0a74, 0x0a76, 0x0a78, 0x0a7a, 0x0a7c, 0x0a7e, // Entry 240 - 27F 0x0a80, 0x0a82, 0x0a84, 0x0a86, 0x0a88, 0x0a8a, 0x0a8c, 0x0a8e, 0x0a90, 0x0a96, 0x0a98, 0x0a9a, 0x0a9c, 0x0a9e, 0x0aa0, 0x0aa2, 0x0aa4, 0x0aa6, 0x0aa8, 0x0aaa, 0x0aac, 0x0aae, 0x0ab0, 0x0ab2, 0x0ab4, 0x0ab9, 0x0abe, 0x0ac2, 0x0ac6, 0x0aca, 0x0ace, 0x0ad2, 0x0ad6, 0x0ada, 0x0ade, 0x0ae2, 0x0ae7, 0x0aec, 0x0af1, 0x0af6, 0x0afb, 0x0b00, 0x0b05, 0x0b0a, 0x0b0f, 0x0b14, 0x0b19, 0x0b1e, 0x0b23, 0x0b28, 0x0b2d, 0x0b32, 0x0b37, 0x0b3c, 0x0b41, 0x0b46, 0x0b4b, 0x0b50, 0x0b52, 0x0b54, 0x0b56, 0x0b58, 0x0b5a, 0x0b5c, // Entry 280 - 2BF 0x0b5e, 0x0b62, 0x0b66, 0x0b6a, 0x0b6e, 0x0b72, 0x0b76, 0x0b7a, 0x0b7c, 0x0b7e, 0x0b80, 0x0b82, 0x0b86, 0x0b8a, 0x0b8e, 0x0b92, 0x0b96, 0x0b9a, 0x0b9e, 0x0ba0, 0x0ba2, 0x0ba4, 0x0ba6, 0x0ba8, 0x0baa, 0x0bac, 0x0bb0, 0x0bb4, 0x0bba, 0x0bc0, 0x0bc4, 0x0bc8, 0x0bcc, 0x0bd0, 0x0bd4, 0x0bd8, 0x0bdc, 0x0be0, 0x0be4, 0x0be8, 0x0bec, 0x0bf0, 0x0bf4, 0x0bf8, 0x0bfc, 0x0c00, 0x0c04, 0x0c08, 0x0c0c, 0x0c10, 0x0c14, 0x0c18, 0x0c1c, 0x0c20, 0x0c24, 0x0c28, 0x0c2c, 0x0c30, 0x0c34, 0x0c36, 0x0c38, 0x0c3a, 0x0c3c, 0x0c3e, // Entry 2C0 - 2FF 0x0c40, 0x0c42, 0x0c44, 0x0c46, 0x0c48, 0x0c4a, 0x0c4c, 0x0c4e, 0x0c50, 0x0c52, 0x0c54, 0x0c56, 0x0c58, 0x0c5a, 0x0c5c, 0x0c5e, 0x0c60, 0x0c62, 0x0c64, 0x0c66, 0x0c68, 0x0c6a, 0x0c6c, 0x0c6e, 0x0c70, 0x0c72, 0x0c74, 0x0c76, 0x0c78, 0x0c7a, 0x0c7c, 0x0c7e, 0x0c80, 0x0c82, 0x0c86, 0x0c8a, 0x0c8e, 0x0c92, 0x0c96, 0x0c9a, 0x0c9e, 0x0ca2, 0x0ca4, 0x0ca8, 0x0cac, 0x0cb0, 0x0cb4, 0x0cb8, 0x0cbc, 0x0cc0, 0x0cc4, 0x0cc8, 0x0ccc, 0x0cd0, 0x0cd4, 0x0cd8, 0x0cdc, 0x0ce0, 0x0ce4, 0x0ce8, 0x0cec, 0x0cf0, 0x0cf4, 0x0cf8, // Entry 300 - 33F 0x0cfc, 0x0d00, 0x0d04, 0x0d08, 0x0d0c, 0x0d10, 0x0d14, 0x0d18, 0x0d1c, 0x0d20, 0x0d24, 0x0d28, 0x0d2c, 0x0d30, 0x0d34, 0x0d38, 0x0d3c, 0x0d40, 0x0d44, 0x0d48, 0x0d4c, 0x0d50, 0x0d54, 0x0d58, 0x0d5c, 0x0d60, 0x0d64, 0x0d68, 0x0d6c, 0x0d70, 0x0d74, 0x0d78, 0x0d7c, 0x0d80, 0x0d84, 0x0d88, 0x0d8c, 0x0d90, 0x0d94, 0x0d98, 0x0d9c, 0x0da0, 0x0da4, 0x0da8, 0x0dac, 0x0db0, 0x0db4, 0x0db8, 0x0dbc, 0x0dc0, 0x0dc4, 0x0dc8, 0x0dcc, 0x0dd0, 0x0dd4, 0x0dd8, 0x0ddc, 0x0de0, 0x0de4, 0x0de8, 0x0dec, 0x0df0, 0x0df4, 0x0df8, // Entry 340 - 37F 0x0dfc, 0x0e00, 0x0e04, 0x0e08, 0x0e0c, 0x0e10, 0x0e14, 0x0e18, 0x0e1d, 0x0e22, 0x0e27, 0x0e2c, 0x0e31, 0x0e36, 0x0e3a, 0x0e3e, 0x0e42, 0x0e46, 0x0e4a, 0x0e4e, 0x0e52, 0x0e56, 0x0e5a, 0x0e5e, 0x0e62, 0x0e66, 0x0e6a, 0x0e6e, 0x0e72, 0x0e76, 0x0e7a, 0x0e7e, 0x0e82, 0x0e86, 0x0e8a, 0x0e8e, 0x0e92, 0x0e96, 0x0e9a, 0x0e9e, 0x0ea2, 0x0ea6, 0x0eaa, 0x0eae, 0x0eb2, 0x0eb6, 0x0ebc, 0x0ec2, 0x0ec8, 0x0ecc, 0x0ed0, 0x0ed4, 0x0ed8, 0x0edc, 0x0ee0, 0x0ee4, 0x0ee8, 0x0eec, 0x0ef0, 0x0ef4, 0x0ef8, 0x0efc, 0x0f00, 0x0f04, // Entry 380 - 3BF 0x0f08, 0x0f0c, 0x0f10, 0x0f14, 0x0f18, 0x0f1c, 0x0f20, 0x0f24, 0x0f28, 0x0f2c, 0x0f30, 0x0f34, 0x0f38, 0x0f3e, 0x0f44, 0x0f4a, 0x0f50, 0x0f56, 0x0f5c, 0x0f62, 0x0f68, 0x0f6e, 0x0f74, 0x0f7a, 0x0f80, 0x0f86, 0x0f8c, 0x0f92, 0x0f98, 0x0f9e, 0x0fa4, 0x0faa, 0x0fb0, 0x0fb6, 0x0fbc, 0x0fc2, 0x0fc8, 0x0fce, 0x0fd4, 0x0fda, 0x0fe0, 0x0fe6, 0x0fec, 0x0ff2, 0x0ff8, 0x0ffe, 0x1004, 0x100a, 0x1010, 0x1016, 0x101c, 0x1022, 0x1028, 0x102e, 0x1034, 0x103a, 0x1040, 0x1046, 0x104c, 0x1052, 0x1058, 0x105e, 0x1064, 0x106a, // Entry 3C0 - 3FF 0x1070, 0x1076, 0x107c, 0x1082, 0x1088, 0x108e, 0x1094, 0x109a, 0x10a0, 0x10a6, 0x10ac, 0x10b2, 0x10b8, 0x10be, 0x10c4, 0x10ca, 0x10d0, 0x10d6, 0x10dc, 0x10e2, 0x10e8, 0x10ee, 0x10f4, 0x10fa, 0x1100, 0x1106, 0x110c, 0x1112, 0x1118, 0x111e, 0x1124, 0x112a, 0x1130, 0x1136, 0x113c, 0x1142, 0x1148, 0x114e, 0x1154, 0x115a, 0x1160, 0x1166, 0x116c, 0x1172, 0x1178, 0x1180, 0x1188, 0x1190, 0x1198, 0x11a0, 0x11a8, 0x11b0, 0x11b6, 0x11d7, 0x11e6, 0x11ee, 0x11ef, 0x11f0, 0x11f1, 0x11f2, 0x11f3, 0x11f4, 0x11f5, 0x11f6, // Entry 400 - 43F 0x11f7, 0x11f8, 0x11f9, 0x11fa, 0x11fb, 0x11fc, 0x11fd, 0x11fe, 0x11ff, 0x1200, 0x1201, 0x1205, 0x1209, 0x120d, 0x1211, 0x1215, 0x1219, 0x121b, 0x121d, 0x121f, 0x1221, 0x1223, 0x1225, 0x1227, 0x1229, 0x122b, 0x122d, 0x122f, 0x1231, 0x1233, 0x1235, 0x1237, 0x1239, 0x123b, 0x123d, 0x123f, 0x1241, 0x1243, 0x1245, 0x1247, 0x1249, 0x124b, 0x124d, 0x124f, 0x1251, 0x1253, 0x1255, 0x1257, 0x1259, 0x125b, 0x125d, 0x125f, 0x1263, 0x1267, 0x126b, 0x126f, 0x1270, 0x1271, 0x1272, 0x1273, 0x1274, 0x1275, 0x1277, 0x1279, // Entry 440 - 47F 0x127b, 0x127d, 0x127f, 0x1287, 0x128f, 0x129b, 0x12a7, 0x12b3, 0x12bf, 0x12cb, 0x12d3, 0x12db, 0x12e7, 0x12f3, 0x12ff, 0x130b, 0x130d, 0x130f, 0x1311, 0x1313, 0x1315, 0x1317, 0x1319, 0x131b, 0x131d, 0x131f, 0x1321, 0x1323, 0x1325, 0x1327, 0x1329, 0x132b, 0x132e, 0x1331, 0x1333, 0x1335, 0x1337, 0x1339, 0x133b, 0x133d, 0x133f, 0x1341, 0x1343, 0x1345, 0x1347, 0x1349, 0x134b, 0x134d, 0x1350, 0x1353, 0x1356, 0x1359, 0x135c, 0x135f, 0x1362, 0x1365, 0x1368, 0x136b, 0x136e, 0x1371, 0x1374, 0x1377, 0x137a, 0x137d, // Entry 480 - 4BF 0x1380, 0x1383, 0x1386, 0x1389, 0x138c, 0x138f, 0x1392, 0x1395, 0x1398, 0x139b, 0x13a2, 0x13a4, 0x13a6, 0x13a8, 0x13ab, 0x13ad, 0x13af, 0x13b1, 0x13b3, 0x13b5, 0x13bb, 0x13c1, 0x13c4, 0x13c7, 0x13ca, 0x13cd, 0x13d0, 0x13d3, 0x13d6, 0x13d9, 0x13dc, 0x13df, 0x13e2, 0x13e5, 0x13e8, 0x13eb, 0x13ee, 0x13f1, 0x13f4, 0x13f7, 0x13fa, 0x13fd, 0x1400, 0x1403, 0x1406, 0x1409, 0x140c, 0x140f, 0x1412, 0x1415, 0x1418, 0x141b, 0x141e, 0x1421, 0x1424, 0x1427, 0x142a, 0x142d, 0x1430, 0x1433, 0x1436, 0x1439, 0x143c, 0x143f, // Entry 4C0 - 4FF 0x1442, 0x1445, 0x1448, 0x1451, 0x145a, 0x1463, 0x146c, 0x1475, 0x147e, 0x1487, 0x1490, 0x1499, 0x149c, 0x149f, 0x14a2, 0x14a5, 0x14a8, 0x14ab, 0x14ae, 0x14b1, 0x14b4, 0x14b7, 0x14ba, 0x14bd, 0x14c0, 0x14c3, 0x14c6, 0x14c9, 0x14cc, 0x14cf, 0x14d2, 0x14d5, 0x14d8, 0x14db, 0x14de, 0x14e1, 0x14e4, 0x14e7, 0x14ea, 0x14ed, 0x14f0, 0x14f3, 0x14f6, 0x14f9, 0x14fc, 0x14ff, 0x1502, 0x1505, 0x1508, 0x150b, 0x150e, 0x1511, 0x1514, 0x1517, 0x151a, 0x151d, 0x1520, 0x1523, 0x1526, 0x1529, 0x152c, 0x152f, 0x1532, 0x1535, // Entry 500 - 53F 0x1538, 0x153b, 0x153e, 0x1541, 0x1544, 0x1547, 0x154a, 0x154d, 0x1550, 0x1553, 0x1556, 0x1559, 0x155c, 0x155f, 0x1562, 0x1565, 0x1568, 0x156b, 0x156e, 0x1571, 0x1574, 0x1577, 0x157a, 0x157d, 0x1580, 0x1583, 0x1586, 0x1589, 0x158c, 0x158f, 0x1592, 0x1595, 0x1598, 0x159b, 0x159e, 0x15a1, 0x15a4, 0x15a7, 0x15aa, 0x15ad, 0x15b0, 0x15b3, 0x15b6, 0x15b9, 0x15bc, 0x15bf, 0x15c2, 0x15c5, 0x15c8, 0x15cb, 0x15ce, 0x15d1, 0x15d4, 0x15d7, 0x15da, 0x15dd, 0x15e0, 0x15e3, 0x15e6, 0x15e9, 0x15ec, 0x15ef, 0x15f2, 0x15f5, // Entry 540 - 57F 0x15f8, 0x15fb, 0x15fe, 0x1601, 0x1604, 0x1607, 0x160a, 0x160d, 0x1610, 0x1613, 0x1616, 0x1619, 0x161c, 0x161f, 0x1622, 0x1625, 0x1628, 0x162b, 0x162e, 0x1631, 0x1634, 0x1637, 0x163a, 0x163d, 0x1640, 0x1643, 0x1646, 0x1649, 0x164c, 0x164f, 0x1652, 0x1655, 0x1658, 0x165b, 0x165e, 0x1661, 0x1664, 0x1667, 0x166a, 0x166d, 0x1670, 0x1673, 0x1676, 0x1679, 0x167c, 0x167f, 0x1682, 0x1685, 0x1688, 0x168b, 0x168e, 0x1691, 0x1694, 0x1697, 0x169a, 0x169d, 0x16a0, 0x16a3, 0x16a6, 0x16a9, 0x16ac, 0x16af, 0x16b2, 0x16b5, // Entry 580 - 5BF 0x16b8, 0x16bb, 0x16be, 0x16c1, 0x16c4, 0x16c7, 0x16ca, 0x16cd, 0x16d0, 0x16d3, 0x16d6, 0x16d9, 0x16dc, 0x16df, 0x16e2, 0x16e5, 0x16e8, 0x16eb, 0x16ee, 0x16f1, 0x16f4, 0x16f7, 0x16fa, 0x16fd, 0x1700, 0x1703, 0x1706, 0x1709, 0x170c, 0x170f, 0x1712, 0x1715, 0x1718, 0x171b, 0x171e, 0x1721, 0x1724, 0x1727, 0x172a, 0x172d, 0x1730, 0x1733, 0x1736, 0x1739, 0x173c, 0x173f, 0x1742, 0x1745, 0x1748, 0x174b, 0x174e, 0x1751, 0x1754, 0x1757, 0x175a, 0x175d, 0x1760, 0x1763, 0x1766, 0x1769, 0x176c, 0x176f, 0x1772, 0x1775, // Entry 5C0 - 5FF 0x1778, 0x177b, 0x177e, 0x1781, 0x1784, 0x1787, 0x178a, 0x178d, 0x1790, 0x1793, 0x1796, 0x1799, 0x179c, 0x179f, 0x17a2, 0x17a5, 0x17a8, 0x17ab, 0x17ae, 0x17b1, 0x17b4, 0x17b7, 0x17ba, 0x17bd, 0x17c0, 0x17c3, 0x17c6, 0x17c9, 0x17cc, 0x17cf, 0x17d2, 0x17d5, 0x17d8, 0x17db, 0x17de, 0x17e1, 0x17e4, 0x17e7, 0x17ea, 0x17ed, 0x17f0, 0x17f3, 0x17f6, 0x17f9, 0x17fc, 0x17ff, 0x1802, 0x1805, 0x1808, 0x180b, 0x180e, 0x1811, 0x1814, 0x1817, 0x181a, 0x181d, 0x1820, 0x1823, 0x1826, 0x1829, 0x182c, 0x182f, 0x1832, 0x1835, // Entry 600 - 63F 0x1838, 0x183b, 0x183e, 0x1841, 0x1844, 0x1847, 0x184a, 0x184d, 0x1850, 0x1853, 0x1856, 0x1859, 0x185c, 0x185f, 0x1862, 0x1865, 0x1868, 0x186b, 0x186e, 0x1871, 0x1874, 0x1877, 0x187a, 0x187d, 0x1880, 0x1883, 0x1886, 0x1889, 0x188c, 0x188f, 0x1892, 0x1895, 0x1898, 0x189b, 0x189e, 0x18a1, 0x18a4, 0x18a7, 0x18aa, 0x18ad, 0x18b0, 0x18b3, 0x18b6, 0x18b9, 0x18bc, 0x18bf, 0x18c2, 0x18c5, 0x18c8, 0x18cb, 0x18ce, 0x18d1, 0x18d4, 0x18d7, 0x18da, 0x18dd, 0x18e0, 0x18e3, 0x18e6, 0x18e9, 0x18ec, 0x18ef, 0x18f2, 0x18f5, // Entry 640 - 67F 0x18f8, 0x18fb, 0x18fe, 0x1901, 0x1904, 0x1907, 0x190a, 0x190d, 0x1910, 0x1913, 0x1916, 0x1919, 0x191c, 0x191f, 0x1922, 0x1925, 0x1928, 0x192b, 0x192e, 0x1931, 0x1934, 0x1937, 0x193a, 0x193d, 0x1940, 0x1943, 0x1946, 0x1949, 0x194c, 0x194f, 0x1952, 0x1955, 0x1958, 0x195b, 0x195e, 0x1961, 0x1964, 0x1967, 0x196a, 0x196d, 0x1970, 0x1973, 0x1976, 0x1979, 0x197c, 0x197f, 0x1982, 0x1985, 0x1988, 0x198b, } // Size: 3324 bytes var xorData string = "" + // Size: 4862 bytes "\x02\x0c\x09\x02\xb0\xec\x02\xad\xd8\x02\xad\xd9\x02\x06\x07\x02\x0f\x12" + "\x02\x0f\x1f\x02\x0f\x1d\x02\x01\x13\x02\x0f\x16\x02\x0f\x0b\x02\x0f3" + "\x02\x0f7\x02\x0f?\x02\x0f/\x02\x0f*\x02\x0c&\x02\x0c*\x02\x0c;\x02\x0c9" + "\x02\x0c%\x02\xab\xed\x02\xab\xe2\x02\xab\xe3\x02\xa9\xe0\x02\xa9\xe1" + "\x02\xa9\xe6\x02\xa3\xcb\x02\xa3\xc8\x02\xa3\xc9\x02\x01#\x02\x01\x08" + "\x02\x0e>\x02\x0e'\x02\x0f\x03\x02\x03\x0d\x02\x03\x09\x02\x03\x17\x02" + "\x03\x0e\x02\x02\x03\x02\x011\x02\x01\x00\x02\x01\x10\x02\x03<\x02\x07" + "\x0d\x02\x02\x0c\x02\x0c0\x02\x01\x03\x02\x01\x01\x02\x01 \x02\x01\x22" + "\x02\x01)\x02\x01\x0a\x02\x01\x0c\x02\x02\x06\x02\x02\x02\x02\x03\x10" + "\x03\x037 \x03\x0b+\x03\x021\x00\x02\x01\x04\x02\x01\x02\x02\x019\x02" + "\x03\x1c\x02\x02$\x03\x80p$\x02\x03:\x02\x03\x0a\x03\xc1r.\x03\xc1r,\x03" + "\xc1r\x02\x02\x02:\x02\x02>\x02\x02,\x02\x02\x10\x02\x02\x00\x03\xc1s<" + "\x03\xc1s*\x03\xc2L$\x03\xc2L;\x02\x09)\x02\x0a\x19\x03\x83\xab\xe3\x03" + "\x83\xab\xf2\x03 4\xe0\x03\x81\xab\xea\x03\x81\xab\xf3\x03 4\xef\x03\x96" + "\xe1\xcd\x03\x84\xe5\xc3\x02\x0d\x11\x03\x8b\xec\xcb\x03\x94\xec\xcf\x03" + "\x9a\xec\xc2\x03\x8b\xec\xdb\x03\x94\xec\xdf\x03\x9a\xec\xd2\x03\x01\x0c" + "!\x03\x01\x0c#\x03ʠ\x9d\x03ʣ\x9c\x03ʢ\x9f\x03ʥ\x9e\x03ʤ\x91\x03ʧ\x90\x03" + "ʦ\x93\x03ʩ\x92\x03ʨ\x95\x03\xca\xf3\xb5\x03\xca\xf0\xb4\x03\xca\xf1\xb7" + "\x03\xca\xf6\xb6\x03\xca\xf7\x89\x03\xca\xf4\x88\x03\xca\xf5\x8b\x03\xca" + "\xfa\x8a\x03\xca\xfb\x8d\x03\xca\xf8\x8c\x03\xca\xf9\x8f\x03\xca\xfe\x8e" + "\x03\xca\xff\x81\x03\xca\xfc\x80\x03\xca\xfd\x83\x03\xca\xe2\x82\x03\xca" + "\xe3\x85\x03\xca\xe0\x84\x03\xca\xe1\x87\x03\xca\xe6\x86\x03\xca\xe7\x99" + "\x03\xca\xe4\x98\x03\xca\xe5\x9b\x03\xca\xea\x9a\x03\xca\xeb\x9d\x03\xca" + "\xe8\x9c\x03ؓ\x89\x03ߔ\x8b\x02\x010\x03\x03\x04\x1e\x03\x04\x15\x12\x03" + "\x0b\x05,\x03\x06\x04\x00\x03\x06\x04)\x03\x06\x044\x03\x06\x04<\x03\x06" + "\x05\x1d\x03\x06\x06\x00\x03\x06\x06\x0a\x03\x06\x06'\x03\x06\x062\x03" + "\x0786\x03\x079/\x03\x079 \x03\x07:\x0e\x03\x07:\x1b\x03\x07:%\x03\x07;/" + "\x03\x07;%\x03\x074\x11\x03\x076\x09\x03\x077*\x03\x070\x01\x03\x070\x0f" + "\x03\x070.\x03\x071\x16\x03\x071\x04\x03\x0710\x03\x072\x18\x03\x072-" + "\x03\x073\x14\x03\x073>\x03\x07'\x09\x03\x07 \x00\x03\x07\x1f\x0b\x03" + "\x07\x18#\x03\x07\x18(\x03\x07\x186\x03\x07\x18\x03\x03\x07\x19\x16\x03" + "\x07\x116\x03\x07\x12'\x03\x07\x13\x10\x03\x07\x0c&\x03\x07\x0c\x08\x03" + "\x07\x0c\x13\x03\x07\x0d\x02\x03\x07\x0d\x1c\x03\x07\x0b5\x03\x07\x0b" + "\x0a\x03\x07\x0b\x01\x03\x07\x0b\x0f\x03\x07\x05\x00\x03\x07\x05\x09\x03" + "\x07\x05\x0b\x03\x07\x07\x01\x03\x07\x07\x08\x03\x07\x00<\x03\x07\x00+" + "\x03\x07\x01)\x03\x07\x01\x1b\x03\x07\x01\x08\x03\x07\x03?\x03\x0445\x03" + "\x044\x08\x03\x0454\x03\x04)/\x03\x04)5\x03\x04+\x05\x03\x04+\x14\x03" + "\x04+ \x03\x04+<\x03\x04*&\x03\x04*\x22\x03\x04&8\x03\x04!\x01\x03\x04!" + "\x22\x03\x04\x11+\x03\x04\x10.\x03\x04\x104\x03\x04\x13=\x03\x04\x12\x04" + "\x03\x04\x12\x0a\x03\x04\x0d\x1d\x03\x04\x0d\x07\x03\x04\x0d \x03\x05<>" + "\x03\x055<\x03\x055!\x03\x055#\x03\x055&\x03\x054\x1d\x03\x054\x02\x03" + "\x054\x07\x03\x0571\x03\x053\x1a\x03\x053\x16\x03\x05.<\x03\x05.\x07\x03" + "\x05):\x03\x05)<\x03\x05)\x0c\x03\x05)\x15\x03\x05+-\x03\x05+5\x03\x05$" + "\x1e\x03\x05$\x14\x03\x05'\x04\x03\x05'\x14\x03\x05&\x02\x03\x05\x226" + "\x03\x05\x22\x0c\x03\x05\x22\x1c\x03\x05\x19\x0a\x03\x05\x1b\x09\x03\x05" + "\x1b\x0c\x03\x05\x14\x07\x03\x05\x16?\x03\x05\x16\x0c\x03\x05\x0c\x05" + "\x03\x05\x0e\x0f\x03\x05\x01\x0e\x03\x05\x00(\x03\x05\x030\x03\x05\x03" + "\x06\x03\x0a==\x03\x0a=1\x03\x0a=,\x03\x0a=\x0c\x03\x0a??\x03\x0a<\x08" + "\x03\x0a9!\x03\x0a9)\x03\x0a97\x03\x0a99\x03\x0a6\x0a\x03\x0a6\x1c\x03" + "\x0a6\x17\x03\x0a7'\x03\x0a78\x03\x0a73\x03\x0a'\x01\x03\x0a'&\x03\x0a" + "\x1f\x0e\x03\x0a\x1f\x03\x03\x0a\x1f3\x03\x0a\x1b/\x03\x0a\x18\x19\x03" + "\x0a\x19\x01\x03\x0a\x16\x14\x03\x0a\x0e\x22\x03\x0a\x0f\x10\x03\x0a\x0f" + "\x02\x03\x0a\x0f \x03\x0a\x0c\x04\x03\x0a\x0b>\x03\x0a\x0b+\x03\x0a\x08/" + "\x03\x0a\x046\x03\x0a\x05\x14\x03\x0a\x00\x04\x03\x0a\x00\x10\x03\x0a" + "\x00\x14\x03\x0b<3\x03\x0b;*\x03\x0b9\x22\x03\x0b9)\x03\x0b97\x03\x0b+" + "\x10\x03\x0b((\x03\x0b&5\x03\x0b$\x1c\x03\x0b$\x12\x03\x0b%\x04\x03\x0b#" + "<\x03\x0b#0\x03\x0b#\x0d\x03\x0b#\x19\x03\x0b!:\x03\x0b!\x1f\x03\x0b!" + "\x00\x03\x0b\x1e5\x03\x0b\x1c\x1d\x03\x0b\x1d-\x03\x0b\x1d(\x03\x0b\x18." + "\x03\x0b\x18 \x03\x0b\x18\x16\x03\x0b\x14\x13\x03\x0b\x15$\x03\x0b\x15" + "\x22\x03\x0b\x12\x1b\x03\x0b\x12\x10\x03\x0b\x132\x03\x0b\x13=\x03\x0b" + "\x12\x18\x03\x0b\x0c&\x03\x0b\x061\x03\x0b\x06:\x03\x0b\x05#\x03\x0b\x05" + "<\x03\x0b\x04\x0b\x03\x0b\x04\x04\x03\x0b\x04\x1b\x03\x0b\x042\x03\x0b" + "\x041\x03\x0b\x03\x03\x03\x0b\x03\x1d\x03\x0b\x03/\x03\x0b\x03+\x03\x0b" + "\x02\x1b\x03\x0b\x02\x00\x03\x0b\x01\x1e\x03\x0b\x01\x08\x03\x0b\x015" + "\x03\x06\x0d9\x03\x06\x0d=\x03\x06\x0d?\x03\x02\x001\x03\x02\x003\x03" + "\x02\x02\x19\x03\x02\x006\x03\x02\x02\x1b\x03\x02\x004\x03\x02\x00<\x03" + "\x02\x02\x0a\x03\x02\x02\x0e\x03\x02\x01\x1a\x03\x02\x01\x07\x03\x02\x01" + "\x05\x03\x02\x01\x0b\x03\x02\x01%\x03\x02\x01\x0c\x03\x02\x01\x04\x03" + "\x02\x01\x1c\x03\x02\x00.\x03\x02\x002\x03\x02\x00>\x03\x02\x00\x12\x03" + "\x02\x00\x16\x03\x02\x011\x03\x02\x013\x03\x02\x02 \x03\x02\x02%\x03\x02" + "\x02$\x03\x02\x028\x03\x02\x02;\x03\x02\x024\x03\x02\x012\x03\x02\x022" + "\x03\x02\x02/\x03\x02\x01,\x03\x02\x01\x13\x03\x02\x01\x16\x03\x02\x01" + "\x11\x03\x02\x01\x1e\x03\x02\x01\x15\x03\x02\x01\x17\x03\x02\x01\x0f\x03" + "\x02\x01\x08\x03\x02\x00?\x03\x02\x03\x07\x03\x02\x03\x0d\x03\x02\x03" + "\x13\x03\x02\x03\x1d\x03\x02\x03\x1f\x03\x02\x00\x03\x03\x02\x00\x0d\x03" + "\x02\x00\x01\x03\x02\x00\x1b\x03\x02\x00\x19\x03\x02\x00\x18\x03\x02\x00" + "\x13\x03\x02\x00/\x03\x07>\x12\x03\x07<\x1f\x03\x07>\x1d\x03\x06\x1d\x0e" + "\x03\x07>\x1c\x03\x07>:\x03\x07>\x13\x03\x04\x12+\x03\x07?\x03\x03\x07>" + "\x02\x03\x06\x224\x03\x06\x1a.\x03\x07<%\x03\x06\x1c\x0b\x03\x0609\x03" + "\x05\x1f\x01\x03\x04'\x08\x03\x93\xfd\xf5\x03\x02\x0d \x03\x02\x0d#\x03" + "\x02\x0d!\x03\x02\x0d&\x03\x02\x0d\x22\x03\x02\x0d/\x03\x02\x0d,\x03\x02" + "\x0d$\x03\x02\x0d'\x03\x02\x0d%\x03\x02\x0d;\x03\x02\x0d=\x03\x02\x0d?" + "\x03\x099.\x03\x08\x0b7\x03\x08\x02\x14\x03\x08\x14\x0d\x03\x08.:\x03" + "\x089'\x03\x0f\x0b\x18\x03\x0f\x1c1\x03\x0f\x17&\x03\x0f9\x1f\x03\x0f0" + "\x0c\x03\x0e\x0a9\x03\x0e\x056\x03\x0e\x1c#\x03\x0f\x13\x0e\x03\x072\x00" + "\x03\x070\x0d\x03\x072\x0b\x03\x06\x11\x18\x03\x070\x10\x03\x06\x0f(\x03" + "\x072\x05\x03\x06\x0f,\x03\x073\x15\x03\x06\x07\x08\x03\x05\x16\x02\x03" + "\x04\x0b \x03\x05:8\x03\x05\x16%\x03\x0a\x0d\x1f\x03\x06\x16\x10\x03\x05" + "\x1d5\x03\x05*;\x03\x05\x16\x1b\x03\x04.-\x03\x06\x1a\x19\x03\x04\x03," + "\x03\x0b87\x03\x04/\x0a\x03\x06\x00,\x03\x04-\x01\x03\x04\x1e-\x03\x06/(" + "\x03\x0a\x0b5\x03\x06\x0e7\x03\x06\x07.\x03\x0597\x03\x0a*%\x03\x0760" + "\x03\x06\x0c;\x03\x05'\x00\x03\x072.\x03\x072\x08\x03\x06=\x01\x03\x06" + "\x05\x1b\x03\x06\x06\x12\x03\x06$=\x03\x06'\x0d\x03\x04\x11\x0f\x03\x076" + ",\x03\x06\x07;\x03\x06.,\x03\x86\xf9\xea\x03\x8f\xff\xeb\x02\x092\x02" + "\x095\x02\x094\x02\x09;\x02\x09>\x02\x098\x02\x09*\x02\x09/\x02\x09,\x02" + "\x09%\x02\x09&\x02\x09#\x02\x09 \x02\x08!\x02\x08%\x02\x08$\x02\x08+\x02" + "\x08.\x02\x08*\x02\x08&\x02\x088\x02\x08>\x02\x084\x02\x086\x02\x080\x02" + "\x08\x10\x02\x08\x17\x02\x08\x12\x02\x08\x1d\x02\x08\x1f\x02\x08\x13\x02" + "\x08\x15\x02\x08\x14\x02\x08\x0c\x03\x8b\xfd\xd0\x03\x81\xec\xc6\x03\x87" + "\xe0\x8a\x03-2\xe3\x03\x80\xef\xe4\x03-2\xea\x03\x88\xe6\xeb\x03\x8e\xe6" + "\xe8\x03\x84\xe6\xe9\x03\x97\xe6\xee\x03-2\xf9\x03-2\xf6\x03\x8e\xe3\xad" + "\x03\x80\xe3\x92\x03\x88\xe3\x90\x03\x8e\xe3\x90\x03\x80\xe3\x97\x03\x88" + "\xe3\x95\x03\x88\xfe\xcb\x03\x8e\xfe\xca\x03\x84\xfe\xcd\x03\x91\xef\xc9" + "\x03-2\xc1\x03-2\xc0\x03-2\xcb\x03\x88@\x09\x03\x8e@\x08\x03\x8f\xe0\xf5" + "\x03\x8e\xe6\xf9\x03\x8e\xe0\xfa\x03\x93\xff\xf4\x03\x84\xee\xd3\x03\x0b" + "(\x04\x023 \x03\x0b)\x08\x021;\x02\x01*\x03\x0b#\x10\x03\x0b 0\x03\x0b!" + "\x10\x03\x0b!0\x03\x07\x15\x08\x03\x09?5\x03\x07\x1f\x08\x03\x07\x17\x0b" + "\x03\x09\x1f\x15\x03\x0b\x1c7\x03\x0a+#\x03\x06\x1a\x1b\x03\x06\x1a\x14" + "\x03\x0a\x01\x18\x03\x06#\x1b\x03\x0a2\x0c\x03\x0a\x01\x04\x03\x09#;\x03" + "\x08='\x03\x08\x1a\x0a\x03\x07\x03\x0a\x111\x03\x09\x1b\x09\x03\x073.\x03\x07" + "\x01\x00\x03\x09/,\x03\x07#>\x03\x07\x048\x03\x0a\x1f\x22\x03\x098>\x03" + "\x09\x11\x00\x03\x08/\x17\x03\x06'\x22\x03\x0b\x1a+\x03\x0a\x22\x19\x03" + "\x0a/1\x03\x0974\x03\x09\x0f\x22\x03\x08,\x22\x03\x08?\x14\x03\x07$5\x03" + "\x07<3\x03\x07=*\x03\x07\x13\x18\x03\x068\x0a\x03\x06\x09\x16\x03\x06" + "\x13\x00\x03\x08\x067\x03\x08\x01\x03\x03\x08\x12\x1d\x03\x07+7\x03\x06(" + ";\x03\x06\x1c?\x03\x07\x0e\x17\x03\x0a\x06\x1d\x03\x0a\x19\x07\x03\x08" + "\x14$\x03\x07$;\x03\x08,$\x03\x08\x06\x0d\x03\x07\x16\x0a\x03\x06>>\x03" + "\x0a\x06\x12\x03\x0a\x14)\x03\x09\x0d\x1f\x03\x09\x12\x17\x03\x09\x19" + "\x01\x03\x08\x11 \x03\x08\x1d'\x03\x06<\x1a\x03\x0a.\x00\x03\x07'\x18" + "\x03\x0a\x22\x08\x03\x08\x0d\x0a\x03\x08\x13)\x03\x07*)\x03\x06<,\x03" + "\x07\x0b\x1a\x03\x09.\x14\x03\x09\x0d\x1e\x03\x07\x0e#\x03\x0b\x1d'\x03" + "\x0a\x0a8\x03\x09%2\x03\x08+&\x03\x080\x12\x03\x0a)4\x03\x08\x06\x1f\x03" + "\x0b\x1b\x1a\x03\x0a\x1b\x0f\x03\x0b\x1d*\x03\x09\x16$\x03\x090\x11\x03" + "\x08\x11\x08\x03\x0a*(\x03\x0a\x042\x03\x089,\x03\x074'\x03\x07\x0f\x05" + "\x03\x09\x0b\x0a\x03\x07\x1b\x01\x03\x09\x17:\x03\x09.\x0d\x03\x07.\x11" + "\x03\x09+\x15\x03\x080\x13\x03\x0b\x1f\x19\x03\x0a \x11\x03\x0a\x220\x03" + "\x09\x07;\x03\x08\x16\x1c\x03\x07,\x13\x03\x07\x0e/\x03\x06\x221\x03\x0a" + ".\x0a\x03\x0a7\x02\x03\x0a\x032\x03\x0a\x1d.\x03\x091\x06\x03\x09\x19:" + "\x03\x08\x02/\x03\x060+\x03\x06\x0f-\x03\x06\x1c\x1f\x03\x06\x1d\x07\x03" + "\x0a,\x11\x03\x09=\x0d\x03\x09\x0b;\x03\x07\x1b/\x03\x0a\x1f:\x03\x09 " + "\x1f\x03\x09.\x10\x03\x094\x0b\x03\x09\x1a1\x03\x08#\x1a\x03\x084\x1d" + "\x03\x08\x01\x1f\x03\x08\x11\x22\x03\x07'8\x03\x07\x1a>\x03\x0757\x03" + "\x06&9\x03\x06+\x11\x03\x0a.\x0b\x03\x0a,>\x03\x0a4#\x03\x08%\x17\x03" + "\x07\x05\x22\x03\x07\x0c\x0b\x03\x0a\x1d+\x03\x0a\x19\x16\x03\x09+\x1f" + "\x03\x09\x08\x0b\x03\x08\x16\x18\x03\x08+\x12\x03\x0b\x1d\x0c\x03\x0a=" + "\x10\x03\x0a\x09\x0d\x03\x0a\x10\x11\x03\x09&0\x03\x08(\x1f\x03\x087\x07" + "\x03\x08\x185\x03\x07'6\x03\x06.\x05\x03\x06=\x04\x03\x06;;\x03\x06\x06," + "\x03\x0b\x18>\x03\x08\x00\x18\x03\x06 \x03\x03\x06<\x00\x03\x09%\x18\x03" + "\x0b\x1c<\x03\x0a%!\x03\x0a\x09\x12\x03\x0a\x16\x02\x03\x090'\x03\x09" + "\x0e=\x03\x08 \x0e\x03\x08>\x03\x03\x074>\x03\x06&?\x03\x06\x19\x09\x03" + "\x06?(\x03\x0a-\x0e\x03\x09:3\x03\x098:\x03\x09\x12\x0b\x03\x09\x1d\x17" + "\x03\x087\x05\x03\x082\x14\x03\x08\x06%\x03\x08\x13\x1f\x03\x06\x06\x0e" + "\x03\x0a\x22<\x03\x09/<\x03\x06>+\x03\x0a'?\x03\x0a\x13\x0c\x03\x09\x10<" + "\x03\x07\x1b=\x03\x0a\x19\x13\x03\x09\x22\x1d\x03\x09\x07\x0d\x03\x08)" + "\x1c\x03\x06=\x1a\x03\x0a/4\x03\x0a7\x11\x03\x0a\x16:\x03\x09?3\x03\x09:" + "/\x03\x09\x05\x0a\x03\x09\x14\x06\x03\x087\x22\x03\x080\x07\x03\x08\x1a" + "\x1f\x03\x07\x04(\x03\x07\x04\x09\x03\x06 %\x03\x06<\x08\x03\x0a+\x14" + "\x03\x09\x1d\x16\x03\x0a70\x03\x08 >\x03\x0857\x03\x070\x0a\x03\x06=\x12" + "\x03\x06\x16%\x03\x06\x1d,\x03\x099#\x03\x09\x10>\x03\x07 \x1e\x03\x08" + "\x0c<\x03\x08\x0b\x18\x03\x08\x15+\x03\x08,:\x03\x08%\x22\x03\x07\x0a$" + "\x03\x0b\x1c=\x03\x07+\x08\x03\x0a/\x05\x03\x0a \x07\x03\x0a\x12'\x03" + "\x09#\x11\x03\x08\x1b\x15\x03\x0a\x06\x01\x03\x09\x1c\x1b\x03\x0922\x03" + "\x07\x14<\x03\x07\x09\x04\x03\x061\x04\x03\x07\x0e\x01\x03\x0a\x13\x18" + "\x03\x0a-\x0c\x03\x0a?\x0d\x03\x0a\x09\x0a\x03\x091&\x03\x0a/\x0b\x03" + "\x08$<\x03\x083\x1d\x03\x08\x0c$\x03\x08\x0d\x07\x03\x08\x0d?\x03\x08" + "\x0e\x14\x03\x065\x0a\x03\x08\x1a#\x03\x08\x16#\x03\x0702\x03\x07\x03" + "\x1a\x03\x06(\x1d\x03\x06+\x1b\x03\x06\x0b\x05\x03\x06\x0b\x17\x03\x06" + "\x0c\x04\x03\x06\x1e\x19\x03\x06+0\x03\x062\x18\x03\x0b\x16\x1e\x03\x0a+" + "\x16\x03\x0a-?\x03\x0a#:\x03\x0a#\x10\x03\x0a%$\x03\x0a>+\x03\x0a01\x03" + "\x0a1\x10\x03\x0a\x099\x03\x0a\x0a\x12\x03\x0a\x19\x1f\x03\x0a\x19\x12" + "\x03\x09*)\x03\x09-\x16\x03\x09.1\x03\x09.2\x03\x09<\x0e\x03\x09> \x03" + "\x093\x12\x03\x09\x0b\x01\x03\x09\x1c2\x03\x09\x11\x1c\x03\x09\x15%\x03" + "\x08,&\x03\x08!\x22\x03\x089(\x03\x08\x0b\x1a\x03\x08\x0d2\x03\x08\x0c" + "\x04\x03\x08\x0c\x06\x03\x08\x0c\x1f\x03\x08\x0c\x0c\x03\x08\x0f\x1f\x03" + "\x08\x0f\x1d\x03\x08\x00\x14\x03\x08\x03\x14\x03\x08\x06\x16\x03\x08\x1e" + "#\x03\x08\x11\x11\x03\x08\x10\x18\x03\x08\x14(\x03\x07)\x1e\x03\x07.1" + "\x03\x07 $\x03\x07 '\x03\x078\x08\x03\x07\x0d0\x03\x07\x0f7\x03\x07\x05#" + "\x03\x07\x05\x1a\x03\x07\x1a7\x03\x07\x1d-\x03\x07\x17\x10\x03\x06)\x1f" + "\x03\x062\x0b\x03\x066\x16\x03\x06\x09\x11\x03\x09(\x1e\x03\x07!5\x03" + "\x0b\x11\x16\x03\x0a/\x04\x03\x0a,\x1a\x03\x0b\x173\x03\x0a,1\x03\x0a/5" + "\x03\x0a\x221\x03\x0a\x22\x0d\x03\x0a?%\x03\x0a<,\x03\x0a?#\x03\x0a>\x19" + "\x03\x0a\x08&\x03\x0a\x0b\x0e\x03\x0a\x0c:\x03\x0a\x0c+\x03\x0a\x03\x22" + "\x03\x0a\x06)\x03\x0a\x11\x10\x03\x0a\x11\x1a\x03\x0a\x17-\x03\x0a\x14(" + "\x03\x09)\x1e\x03\x09/\x09\x03\x09.\x00\x03\x09,\x07\x03\x09/*\x03\x09-9" + "\x03\x09\x228\x03\x09%\x09\x03\x09:\x12\x03\x09;\x1d\x03\x09?\x06\x03" + "\x093%\x03\x096\x05\x03\x096\x08\x03\x097\x02\x03\x09\x07,\x03\x09\x04," + "\x03\x09\x1f\x16\x03\x09\x11\x03\x03\x09\x11\x12\x03\x09\x168\x03\x08*" + "\x05\x03\x08/2\x03\x084:\x03\x08\x22+\x03\x08 0\x03\x08&\x0a\x03\x08;" + "\x10\x03\x08>$\x03\x08>\x18\x03\x0829\x03\x082:\x03\x081,\x03\x081<\x03" + "\x081\x1c\x03\x087#\x03\x087*\x03\x08\x09'\x03\x08\x00\x1d\x03\x08\x05-" + "\x03\x08\x1f4\x03\x08\x1d\x04\x03\x08\x16\x0f\x03\x07*7\x03\x07'!\x03" + "\x07%\x1b\x03\x077\x0c\x03\x07\x0c1\x03\x07\x0c.\x03\x07\x00\x06\x03\x07" + "\x01\x02\x03\x07\x010\x03\x07\x06=\x03\x07\x01\x03\x03\x07\x01\x13\x03" + "\x07\x06\x06\x03\x07\x05\x0a\x03\x07\x1f\x09\x03\x07\x17:\x03\x06*1\x03" + "\x06-\x1d\x03\x06\x223\x03\x062:\x03\x060$\x03\x066\x1e\x03\x064\x12\x03" + "\x0645\x03\x06\x0b\x00\x03\x06\x0b7\x03\x06\x07\x1f\x03\x06\x15\x12\x03" + "\x0c\x05\x0f\x03\x0b+\x0b\x03\x0b+-\x03\x06\x16\x1b\x03\x06\x15\x17\x03" + "\x89\xca\xea\x03\x89\xca\xe8\x03\x0c8\x10\x03\x0c8\x01\x03\x0c8\x0f\x03" + "\x0d8%\x03\x0d8!\x03\x0c8-\x03\x0c8/\x03\x0c8+\x03\x0c87\x03\x0c85\x03" + "\x0c9\x09\x03\x0c9\x0d\x03\x0c9\x0f\x03\x0c9\x0b\x03\xcfu\x0c\x03\xcfu" + "\x0f\x03\xcfu\x0e\x03\xcfu\x09\x03\x0c9\x10\x03\x0d9\x0c\x03\xcf`;\x03" + "\xcf`>\x03\xcf`9\x03\xcf`8\x03\xcf`7\x03\xcf`*\x03\xcf`-\x03\xcf`,\x03" + "\x0d\x1b\x1a\x03\x0d\x1b&\x03\x0c=.\x03\x0c=%\x03\x0c>\x1e\x03\x0c>\x14" + "\x03\x0c?\x06\x03\x0c?\x0b\x03\x0c?\x0c\x03\x0c?\x0d\x03\x0c?\x02\x03" + "\x0c>\x0f\x03\x0c>\x08\x03\x0c>\x09\x03\x0c>,\x03\x0c>\x0c\x03\x0c?\x13" + "\x03\x0c?\x16\x03\x0c?\x15\x03\x0c?\x1c\x03\x0c?\x1f\x03\x0c?\x1d\x03" + "\x0c?\x1a\x03\x0c?\x17\x03\x0c?\x08\x03\x0c?\x09\x03\x0c?\x0e\x03\x0c?" + "\x04\x03\x0c?\x05\x03\x0c" + "\x03\x0c=2\x03\x0c=6\x03\x0c<\x07\x03\x0c<\x05\x03\x0e:!\x03\x0e:#\x03" + "\x0e8\x09\x03\x0e:&\x03\x0e8\x0b\x03\x0e:$\x03\x0e:,\x03\x0e8\x1a\x03" + "\x0e8\x1e\x03\x0e:*\x03\x0e:7\x03\x0e:5\x03\x0e:;\x03\x0e:\x15\x03\x0e:<" + "\x03\x0e:4\x03\x0e:'\x03\x0e:-\x03\x0e:%\x03\x0e:?\x03\x0e:=\x03\x0e:)" + "\x03\x0e:/\x03\xcfs'\x03\x0d=\x0f\x03\x0d+*\x03\x0d99\x03\x0d9;\x03\x0d9" + "?\x03\x0d)\x0d\x03\x0d(%\x02\x01\x18\x02\x01(\x02\x01\x1e\x03\x0f$!\x03" + "\x0f87\x03\x0f4\x0e\x03\x0f5\x1d\x03\x06'\x03\x03\x0f\x08\x18\x03\x0f" + "\x0d\x1b\x03\x0e2=\x03\x0e;\x08\x03\x0e:\x0b\x03\x0e\x06$\x03\x0e\x0d)" + "\x03\x0e\x16\x1f\x03\x0e\x16\x1b\x03\x0d$\x0a\x03\x05,\x1d\x03\x0d. \x03" + "\x0d.#\x03\x0c(/\x03\x09%\x02\x03\x0d90\x03\x0d\x0e4\x03\x0d\x0d\x0f\x03" + "\x0c#\x00\x03\x0c,\x1e\x03\x0c2\x0e\x03\x0c\x01\x17\x03\x0c\x09:\x03\x0e" + "\x173\x03\x0c\x08\x03\x03\x0c\x11\x07\x03\x0c\x10\x18\x03\x0c\x1f\x1c" + "\x03\x0c\x19\x0e\x03\x0c\x1a\x1f\x03\x0f0>\x03\x0b->\x03\x0b<+\x03\x0b8" + "\x13\x03\x0b\x043\x03\x0b\x14\x03\x03\x0b\x16%\x03\x0d\x22&\x03\x0b\x1a" + "\x1a\x03\x0b\x1a\x04\x03\x0a%9\x03\x0a&2\x03\x0a&0\x03\x0a!\x1a\x03\x0a!" + "7\x03\x0a5\x10\x03\x0a=4\x03\x0a?\x0e\x03\x0a>\x10\x03\x0a\x00 \x03\x0a" + "\x0f:\x03\x0a\x0f9\x03\x0a\x0b\x0a\x03\x0a\x17%\x03\x0a\x1b-\x03\x09-" + "\x1a\x03\x09,4\x03\x09.,\x03\x09)\x09\x03\x096!\x03\x091\x1f\x03\x093" + "\x16\x03\x0c+\x1f\x03\x098 \x03\x098=\x03\x0c(\x1a\x03\x0c(\x16\x03\x09" + "\x0a+\x03\x09\x16\x12\x03\x09\x13\x0e\x03\x09\x153\x03\x08)!\x03\x09\x1a" + "\x01\x03\x09\x18\x01\x03\x08%#\x03\x08>\x22\x03\x08\x05%\x03\x08\x02*" + "\x03\x08\x15;\x03\x08\x1b7\x03\x0f\x07\x1d\x03\x0f\x04\x03\x03\x070\x0c" + "\x03\x07;\x0b\x03\x07\x08\x17\x03\x07\x12\x06\x03\x06/-\x03\x0671\x03" + "\x065+\x03\x06>7\x03\x06\x049\x03\x05+\x1e\x03\x05,\x17\x03\x05 \x1d\x03" + "\x05\x22\x05\x03\x050\x1d" // lookup returns the trie value for the first UTF-8 encoding in s and // the width in bytes of this encoding. The size will be 0 if s does not // hold enough bytes to complete the encoding. len(s) must be greater than 0. func (t *idnaTrie) lookup(s []byte) (v uint16, sz int) { c0 := s[0] switch { case c0 < 0x80: // is ASCII return idnaValues[c0], 1 case c0 < 0xC2: return 0, 1 // Illegal UTF-8: not a starter, not ASCII. case c0 < 0xE0: // 2-byte UTF-8 if len(s) < 2 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c1), 2 case c0 < 0xF0: // 3-byte UTF-8 if len(s) < 3 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = idnaIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c2), 3 case c0 < 0xF8: // 4-byte UTF-8 if len(s) < 4 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = idnaIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } o = uint32(i)<<6 + uint32(c2) i = idnaIndex[o] c3 := s[3] if c3 < 0x80 || 0xC0 <= c3 { return 0, 3 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c3), 4 } // Illegal rune return 0, 1 } // lookupUnsafe returns the trie value for the first UTF-8 encoding in s. // s must start with a full and valid UTF-8 encoded rune. func (t *idnaTrie) lookupUnsafe(s []byte) uint16 { c0 := s[0] if c0 < 0x80 { // is ASCII return idnaValues[c0] } i := idnaIndex[c0] if c0 < 0xE0 { // 2-byte UTF-8 return t.lookupValue(uint32(i), s[1]) } i = idnaIndex[uint32(i)<<6+uint32(s[1])] if c0 < 0xF0 { // 3-byte UTF-8 return t.lookupValue(uint32(i), s[2]) } i = idnaIndex[uint32(i)<<6+uint32(s[2])] if c0 < 0xF8 { // 4-byte UTF-8 return t.lookupValue(uint32(i), s[3]) } return 0 } // lookupString returns the trie value for the first UTF-8 encoding in s and // the width in bytes of this encoding. The size will be 0 if s does not // hold enough bytes to complete the encoding. len(s) must be greater than 0. func (t *idnaTrie) lookupString(s string) (v uint16, sz int) { c0 := s[0] switch { case c0 < 0x80: // is ASCII return idnaValues[c0], 1 case c0 < 0xC2: return 0, 1 // Illegal UTF-8: not a starter, not ASCII. case c0 < 0xE0: // 2-byte UTF-8 if len(s) < 2 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c1), 2 case c0 < 0xF0: // 3-byte UTF-8 if len(s) < 3 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = idnaIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c2), 3 case c0 < 0xF8: // 4-byte UTF-8 if len(s) < 4 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = idnaIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } o = uint32(i)<<6 + uint32(c2) i = idnaIndex[o] c3 := s[3] if c3 < 0x80 || 0xC0 <= c3 { return 0, 3 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c3), 4 } // Illegal rune return 0, 1 } // lookupStringUnsafe returns the trie value for the first UTF-8 encoding in s. // s must start with a full and valid UTF-8 encoded rune. func (t *idnaTrie) lookupStringUnsafe(s string) uint16 { c0 := s[0] if c0 < 0x80 { // is ASCII return idnaValues[c0] } i := idnaIndex[c0] if c0 < 0xE0 { // 2-byte UTF-8 return t.lookupValue(uint32(i), s[1]) } i = idnaIndex[uint32(i)<<6+uint32(s[1])] if c0 < 0xF0 { // 3-byte UTF-8 return t.lookupValue(uint32(i), s[2]) } i = idnaIndex[uint32(i)<<6+uint32(s[2])] if c0 < 0xF8 { // 4-byte UTF-8 return t.lookupValue(uint32(i), s[3]) } return 0 } // idnaTrie. Total size: 30196 bytes (29.49 KiB). Checksum: e2ae95a945f04016. type idnaTrie struct{} func newIdnaTrie(i int) *idnaTrie { return &idnaTrie{} } // lookupValue determines the type of block n and looks up the value for b. func (t *idnaTrie) lookupValue(n uint32, b byte) uint16 { switch { case n < 126: return uint16(idnaValues[n<<6+uint32(b)]) default: n -= 126 return uint16(idnaSparse.lookup(n, b)) } } // idnaValues: 128 blocks, 8192 entries, 16384 bytes // The third block is the zero block. var idnaValues = [8192]uint16{ // Block 0x0, offset 0x0 0x00: 0x0080, 0x01: 0x0080, 0x02: 0x0080, 0x03: 0x0080, 0x04: 0x0080, 0x05: 0x0080, 0x06: 0x0080, 0x07: 0x0080, 0x08: 0x0080, 0x09: 0x0080, 0x0a: 0x0080, 0x0b: 0x0080, 0x0c: 0x0080, 0x0d: 0x0080, 0x0e: 0x0080, 0x0f: 0x0080, 0x10: 0x0080, 0x11: 0x0080, 0x12: 0x0080, 0x13: 0x0080, 0x14: 0x0080, 0x15: 0x0080, 0x16: 0x0080, 0x17: 0x0080, 0x18: 0x0080, 0x19: 0x0080, 0x1a: 0x0080, 0x1b: 0x0080, 0x1c: 0x0080, 0x1d: 0x0080, 0x1e: 0x0080, 0x1f: 0x0080, 0x20: 0x0080, 0x21: 0x0080, 0x22: 0x0080, 0x23: 0x0080, 0x24: 0x0080, 0x25: 0x0080, 0x26: 0x0080, 0x27: 0x0080, 0x28: 0x0080, 0x29: 0x0080, 0x2a: 0x0080, 0x2b: 0x0080, 0x2c: 0x0080, 0x2d: 0x0008, 0x2e: 0x0008, 0x2f: 0x0080, 0x30: 0x0008, 0x31: 0x0008, 0x32: 0x0008, 0x33: 0x0008, 0x34: 0x0008, 0x35: 0x0008, 0x36: 0x0008, 0x37: 0x0008, 0x38: 0x0008, 0x39: 0x0008, 0x3a: 0x0080, 0x3b: 0x0080, 0x3c: 0x0080, 0x3d: 0x0080, 0x3e: 0x0080, 0x3f: 0x0080, // Block 0x1, offset 0x40 0x40: 0x0080, 0x41: 0xe105, 0x42: 0xe105, 0x43: 0xe105, 0x44: 0xe105, 0x45: 0xe105, 0x46: 0xe105, 0x47: 0xe105, 0x48: 0xe105, 0x49: 0xe105, 0x4a: 0xe105, 0x4b: 0xe105, 0x4c: 0xe105, 0x4d: 0xe105, 0x4e: 0xe105, 0x4f: 0xe105, 0x50: 0xe105, 0x51: 0xe105, 0x52: 0xe105, 0x53: 0xe105, 0x54: 0xe105, 0x55: 0xe105, 0x56: 0xe105, 0x57: 0xe105, 0x58: 0xe105, 0x59: 0xe105, 0x5a: 0xe105, 0x5b: 0x0080, 0x5c: 0x0080, 0x5d: 0x0080, 0x5e: 0x0080, 0x5f: 0x0080, 0x60: 0x0080, 0x61: 0x0008, 0x62: 0x0008, 0x63: 0x0008, 0x64: 0x0008, 0x65: 0x0008, 0x66: 0x0008, 0x67: 0x0008, 0x68: 0x0008, 0x69: 0x0008, 0x6a: 0x0008, 0x6b: 0x0008, 0x6c: 0x0008, 0x6d: 0x0008, 0x6e: 0x0008, 0x6f: 0x0008, 0x70: 0x0008, 0x71: 0x0008, 0x72: 0x0008, 0x73: 0x0008, 0x74: 0x0008, 0x75: 0x0008, 0x76: 0x0008, 0x77: 0x0008, 0x78: 0x0008, 0x79: 0x0008, 0x7a: 0x0008, 0x7b: 0x0080, 0x7c: 0x0080, 0x7d: 0x0080, 0x7e: 0x0080, 0x7f: 0x0080, // Block 0x2, offset 0x80 // Block 0x3, offset 0xc0 0xc0: 0x0040, 0xc1: 0x0040, 0xc2: 0x0040, 0xc3: 0x0040, 0xc4: 0x0040, 0xc5: 0x0040, 0xc6: 0x0040, 0xc7: 0x0040, 0xc8: 0x0040, 0xc9: 0x0040, 0xca: 0x0040, 0xcb: 0x0040, 0xcc: 0x0040, 0xcd: 0x0040, 0xce: 0x0040, 0xcf: 0x0040, 0xd0: 0x0040, 0xd1: 0x0040, 0xd2: 0x0040, 0xd3: 0x0040, 0xd4: 0x0040, 0xd5: 0x0040, 0xd6: 0x0040, 0xd7: 0x0040, 0xd8: 0x0040, 0xd9: 0x0040, 0xda: 0x0040, 0xdb: 0x0040, 0xdc: 0x0040, 0xdd: 0x0040, 0xde: 0x0040, 0xdf: 0x0040, 0xe0: 0x000a, 0xe1: 0x0018, 0xe2: 0x0018, 0xe3: 0x0018, 0xe4: 0x0018, 0xe5: 0x0018, 0xe6: 0x0018, 0xe7: 0x0018, 0xe8: 0x0012, 0xe9: 0x0018, 0xea: 0x0019, 0xeb: 0x0018, 0xec: 0x0018, 0xed: 0x03c0, 0xee: 0x0018, 0xef: 0x0022, 0xf0: 0x0018, 0xf1: 0x0018, 0xf2: 0x0029, 0xf3: 0x0031, 0xf4: 0x003a, 0xf5: 0x0005, 0xf6: 0x0018, 0xf7: 0x0008, 0xf8: 0x0042, 0xf9: 0x0049, 0xfa: 0x0051, 0xfb: 0x0018, 0xfc: 0x0059, 0xfd: 0x0061, 0xfe: 0x0069, 0xff: 0x0018, // Block 0x4, offset 0x100 0x100: 0xe00d, 0x101: 0x0008, 0x102: 0xe00d, 0x103: 0x0008, 0x104: 0xe00d, 0x105: 0x0008, 0x106: 0xe00d, 0x107: 0x0008, 0x108: 0xe00d, 0x109: 0x0008, 0x10a: 0xe00d, 0x10b: 0x0008, 0x10c: 0xe00d, 0x10d: 0x0008, 0x10e: 0xe00d, 0x10f: 0x0008, 0x110: 0xe00d, 0x111: 0x0008, 0x112: 0xe00d, 0x113: 0x0008, 0x114: 0xe00d, 0x115: 0x0008, 0x116: 0xe00d, 0x117: 0x0008, 0x118: 0xe00d, 0x119: 0x0008, 0x11a: 0xe00d, 0x11b: 0x0008, 0x11c: 0xe00d, 0x11d: 0x0008, 0x11e: 0xe00d, 0x11f: 0x0008, 0x120: 0xe00d, 0x121: 0x0008, 0x122: 0xe00d, 0x123: 0x0008, 0x124: 0xe00d, 0x125: 0x0008, 0x126: 0xe00d, 0x127: 0x0008, 0x128: 0xe00d, 0x129: 0x0008, 0x12a: 0xe00d, 0x12b: 0x0008, 0x12c: 0xe00d, 0x12d: 0x0008, 0x12e: 0xe00d, 0x12f: 0x0008, 0x130: 0x0071, 0x131: 0x0008, 0x132: 0x0035, 0x133: 0x004d, 0x134: 0xe00d, 0x135: 0x0008, 0x136: 0xe00d, 0x137: 0x0008, 0x138: 0x0008, 0x139: 0xe01d, 0x13a: 0x0008, 0x13b: 0xe03d, 0x13c: 0x0008, 0x13d: 0xe01d, 0x13e: 0x0008, 0x13f: 0x0079, // Block 0x5, offset 0x140 0x140: 0x0079, 0x141: 0xe01d, 0x142: 0x0008, 0x143: 0xe03d, 0x144: 0x0008, 0x145: 0xe01d, 0x146: 0x0008, 0x147: 0xe07d, 0x148: 0x0008, 0x149: 0x0081, 0x14a: 0xe00d, 0x14b: 0x0008, 0x14c: 0xe00d, 0x14d: 0x0008, 0x14e: 0xe00d, 0x14f: 0x0008, 0x150: 0xe00d, 0x151: 0x0008, 0x152: 0xe00d, 0x153: 0x0008, 0x154: 0xe00d, 0x155: 0x0008, 0x156: 0xe00d, 0x157: 0x0008, 0x158: 0xe00d, 0x159: 0x0008, 0x15a: 0xe00d, 0x15b: 0x0008, 0x15c: 0xe00d, 0x15d: 0x0008, 0x15e: 0xe00d, 0x15f: 0x0008, 0x160: 0xe00d, 0x161: 0x0008, 0x162: 0xe00d, 0x163: 0x0008, 0x164: 0xe00d, 0x165: 0x0008, 0x166: 0xe00d, 0x167: 0x0008, 0x168: 0xe00d, 0x169: 0x0008, 0x16a: 0xe00d, 0x16b: 0x0008, 0x16c: 0xe00d, 0x16d: 0x0008, 0x16e: 0xe00d, 0x16f: 0x0008, 0x170: 0xe00d, 0x171: 0x0008, 0x172: 0xe00d, 0x173: 0x0008, 0x174: 0xe00d, 0x175: 0x0008, 0x176: 0xe00d, 0x177: 0x0008, 0x178: 0x0065, 0x179: 0xe01d, 0x17a: 0x0008, 0x17b: 0xe03d, 0x17c: 0x0008, 0x17d: 0xe01d, 0x17e: 0x0008, 0x17f: 0x0089, // Block 0x6, offset 0x180 0x180: 0x0008, 0x181: 0x007d, 0x182: 0xe00d, 0x183: 0x0008, 0x184: 0xe00d, 0x185: 0x0008, 0x186: 0x007d, 0x187: 0xe07d, 0x188: 0x0008, 0x189: 0x0095, 0x18a: 0x00ad, 0x18b: 0xe03d, 0x18c: 0x0008, 0x18d: 0x0008, 0x18e: 0x00c5, 0x18f: 0x00dd, 0x190: 0x00f5, 0x191: 0xe01d, 0x192: 0x0008, 0x193: 0x010d, 0x194: 0x0125, 0x195: 0x0008, 0x196: 0x013d, 0x197: 0x013d, 0x198: 0xe00d, 0x199: 0x0008, 0x19a: 0x0008, 0x19b: 0x0008, 0x19c: 0x010d, 0x19d: 0x0155, 0x19e: 0x0008, 0x19f: 0x016d, 0x1a0: 0xe00d, 0x1a1: 0x0008, 0x1a2: 0xe00d, 0x1a3: 0x0008, 0x1a4: 0xe00d, 0x1a5: 0x0008, 0x1a6: 0x0185, 0x1a7: 0xe07d, 0x1a8: 0x0008, 0x1a9: 0x019d, 0x1aa: 0x0008, 0x1ab: 0x0008, 0x1ac: 0xe00d, 0x1ad: 0x0008, 0x1ae: 0x0185, 0x1af: 0xe0fd, 0x1b0: 0x0008, 0x1b1: 0x01b5, 0x1b2: 0x01cd, 0x1b3: 0xe03d, 0x1b4: 0x0008, 0x1b5: 0xe01d, 0x1b6: 0x0008, 0x1b7: 0x01e5, 0x1b8: 0xe00d, 0x1b9: 0x0008, 0x1ba: 0x0008, 0x1bb: 0x0008, 0x1bc: 0xe00d, 0x1bd: 0x0008, 0x1be: 0x0008, 0x1bf: 0x0008, // Block 0x7, offset 0x1c0 0x1c0: 0x0008, 0x1c1: 0x0008, 0x1c2: 0x0008, 0x1c3: 0x0008, 0x1c4: 0x0091, 0x1c5: 0x0091, 0x1c6: 0x0091, 0x1c7: 0x01fd, 0x1c8: 0x0215, 0x1c9: 0x022d, 0x1ca: 0x0245, 0x1cb: 0x025d, 0x1cc: 0x0275, 0x1cd: 0xe01d, 0x1ce: 0x0008, 0x1cf: 0xe0fd, 0x1d0: 0x0008, 0x1d1: 0xe01d, 0x1d2: 0x0008, 0x1d3: 0xe03d, 0x1d4: 0x0008, 0x1d5: 0xe01d, 0x1d6: 0x0008, 0x1d7: 0xe07d, 0x1d8: 0x0008, 0x1d9: 0xe01d, 0x1da: 0x0008, 0x1db: 0xe03d, 0x1dc: 0x0008, 0x1dd: 0x0008, 0x1de: 0xe00d, 0x1df: 0x0008, 0x1e0: 0xe00d, 0x1e1: 0x0008, 0x1e2: 0xe00d, 0x1e3: 0x0008, 0x1e4: 0xe00d, 0x1e5: 0x0008, 0x1e6: 0xe00d, 0x1e7: 0x0008, 0x1e8: 0xe00d, 0x1e9: 0x0008, 0x1ea: 0xe00d, 0x1eb: 0x0008, 0x1ec: 0xe00d, 0x1ed: 0x0008, 0x1ee: 0xe00d, 0x1ef: 0x0008, 0x1f0: 0x0008, 0x1f1: 0x028d, 0x1f2: 0x02a5, 0x1f3: 0x02bd, 0x1f4: 0xe00d, 0x1f5: 0x0008, 0x1f6: 0x02d5, 0x1f7: 0x02ed, 0x1f8: 0xe00d, 0x1f9: 0x0008, 0x1fa: 0xe00d, 0x1fb: 0x0008, 0x1fc: 0xe00d, 0x1fd: 0x0008, 0x1fe: 0xe00d, 0x1ff: 0x0008, // Block 0x8, offset 0x200 0x200: 0xe00d, 0x201: 0x0008, 0x202: 0xe00d, 0x203: 0x0008, 0x204: 0xe00d, 0x205: 0x0008, 0x206: 0xe00d, 0x207: 0x0008, 0x208: 0xe00d, 0x209: 0x0008, 0x20a: 0xe00d, 0x20b: 0x0008, 0x20c: 0xe00d, 0x20d: 0x0008, 0x20e: 0xe00d, 0x20f: 0x0008, 0x210: 0xe00d, 0x211: 0x0008, 0x212: 0xe00d, 0x213: 0x0008, 0x214: 0xe00d, 0x215: 0x0008, 0x216: 0xe00d, 0x217: 0x0008, 0x218: 0xe00d, 0x219: 0x0008, 0x21a: 0xe00d, 0x21b: 0x0008, 0x21c: 0xe00d, 0x21d: 0x0008, 0x21e: 0xe00d, 0x21f: 0x0008, 0x220: 0x0305, 0x221: 0x0008, 0x222: 0xe00d, 0x223: 0x0008, 0x224: 0xe00d, 0x225: 0x0008, 0x226: 0xe00d, 0x227: 0x0008, 0x228: 0xe00d, 0x229: 0x0008, 0x22a: 0xe00d, 0x22b: 0x0008, 0x22c: 0xe00d, 0x22d: 0x0008, 0x22e: 0xe00d, 0x22f: 0x0008, 0x230: 0xe00d, 0x231: 0x0008, 0x232: 0xe00d, 0x233: 0x0008, 0x234: 0x0008, 0x235: 0x0008, 0x236: 0x0008, 0x237: 0x0008, 0x238: 0x0008, 0x239: 0x0008, 0x23a: 0x0099, 0x23b: 0xe03d, 0x23c: 0x0008, 0x23d: 0x031d, 0x23e: 0x00a1, 0x23f: 0x0008, // Block 0x9, offset 0x240 0x240: 0x0008, 0x241: 0x0008, 0x242: 0x0018, 0x243: 0x0018, 0x244: 0x0018, 0x245: 0x0018, 0x246: 0x0008, 0x247: 0x0008, 0x248: 0x0008, 0x249: 0x0008, 0x24a: 0x0008, 0x24b: 0x0008, 0x24c: 0x0008, 0x24d: 0x0008, 0x24e: 0x0008, 0x24f: 0x0008, 0x250: 0x0008, 0x251: 0x0008, 0x252: 0x0018, 0x253: 0x0018, 0x254: 0x0018, 0x255: 0x0018, 0x256: 0x0018, 0x257: 0x0018, 0x258: 0x00d2, 0x259: 0x00da, 0x25a: 0x00e2, 0x25b: 0x00ea, 0x25c: 0x00f2, 0x25d: 0x00fa, 0x25e: 0x0018, 0x25f: 0x0018, 0x260: 0x03ad, 0x261: 0x0101, 0x262: 0x0089, 0x263: 0x0109, 0x264: 0x03c5, 0x265: 0x0018, 0x266: 0x0018, 0x267: 0x0018, 0x268: 0x0018, 0x269: 0x0018, 0x26a: 0x0018, 0x26b: 0x0018, 0x26c: 0x0008, 0x26d: 0x0018, 0x26e: 0x0008, 0x26f: 0x0018, 0x270: 0x0018, 0x271: 0x0018, 0x272: 0x0018, 0x273: 0x0018, 0x274: 0x0018, 0x275: 0x0018, 0x276: 0x0018, 0x277: 0x0018, 0x278: 0x0018, 0x279: 0x0018, 0x27a: 0x0018, 0x27b: 0x0018, 0x27c: 0x0018, 0x27d: 0x0018, 0x27e: 0x0018, 0x27f: 0x0018, // Block 0xa, offset 0x280 0x280: 0x03dd, 0x281: 0x03dd, 0x282: 0x3308, 0x283: 0x03f5, 0x284: 0x0111, 0x285: 0x040d, 0x286: 0x3308, 0x287: 0x3308, 0x288: 0x3308, 0x289: 0x3308, 0x28a: 0x3308, 0x28b: 0x3308, 0x28c: 0x3308, 0x28d: 0x3308, 0x28e: 0x3308, 0x28f: 0x33c0, 0x290: 0x3308, 0x291: 0x3308, 0x292: 0x3308, 0x293: 0x3308, 0x294: 0x3308, 0x295: 0x3308, 0x296: 0x3308, 0x297: 0x3308, 0x298: 0x3308, 0x299: 0x3308, 0x29a: 0x3308, 0x29b: 0x3308, 0x29c: 0x3308, 0x29d: 0x3308, 0x29e: 0x3308, 0x29f: 0x3308, 0x2a0: 0x3308, 0x2a1: 0x3308, 0x2a2: 0x3308, 0x2a3: 0x3308, 0x2a4: 0x3308, 0x2a5: 0x3308, 0x2a6: 0x3308, 0x2a7: 0x3308, 0x2a8: 0x3308, 0x2a9: 0x3308, 0x2aa: 0x3308, 0x2ab: 0x3308, 0x2ac: 0x3308, 0x2ad: 0x3308, 0x2ae: 0x3308, 0x2af: 0x3308, 0x2b0: 0xe00d, 0x2b1: 0x0008, 0x2b2: 0xe00d, 0x2b3: 0x0008, 0x2b4: 0x0425, 0x2b5: 0x0008, 0x2b6: 0xe00d, 0x2b7: 0x0008, 0x2b8: 0x0040, 0x2b9: 0x0040, 0x2ba: 0x011a, 0x2bb: 0x0008, 0x2bc: 0x0008, 0x2bd: 0x0008, 0x2be: 0x0122, 0x2bf: 0x043d, // Block 0xb, offset 0x2c0 0x2c0: 0x0040, 0x2c1: 0x0040, 0x2c2: 0x0040, 0x2c3: 0x0040, 0x2c4: 0x003a, 0x2c5: 0x012a, 0x2c6: 0xe155, 0x2c7: 0x0455, 0x2c8: 0xe12d, 0x2c9: 0xe13d, 0x2ca: 0xe12d, 0x2cb: 0x0040, 0x2cc: 0x03dd, 0x2cd: 0x0040, 0x2ce: 0x046d, 0x2cf: 0x0485, 0x2d0: 0x0008, 0x2d1: 0xe105, 0x2d2: 0xe105, 0x2d3: 0xe105, 0x2d4: 0xe105, 0x2d5: 0xe105, 0x2d6: 0xe105, 0x2d7: 0xe105, 0x2d8: 0xe105, 0x2d9: 0xe105, 0x2da: 0xe105, 0x2db: 0xe105, 0x2dc: 0xe105, 0x2dd: 0xe105, 0x2de: 0xe105, 0x2df: 0xe105, 0x2e0: 0x049d, 0x2e1: 0x049d, 0x2e2: 0x0040, 0x2e3: 0x049d, 0x2e4: 0x049d, 0x2e5: 0x049d, 0x2e6: 0x049d, 0x2e7: 0x049d, 0x2e8: 0x049d, 0x2e9: 0x049d, 0x2ea: 0x049d, 0x2eb: 0x049d, 0x2ec: 0x0008, 0x2ed: 0x0008, 0x2ee: 0x0008, 0x2ef: 0x0008, 0x2f0: 0x0008, 0x2f1: 0x0008, 0x2f2: 0x0008, 0x2f3: 0x0008, 0x2f4: 0x0008, 0x2f5: 0x0008, 0x2f6: 0x0008, 0x2f7: 0x0008, 0x2f8: 0x0008, 0x2f9: 0x0008, 0x2fa: 0x0008, 0x2fb: 0x0008, 0x2fc: 0x0008, 0x2fd: 0x0008, 0x2fe: 0x0008, 0x2ff: 0x0008, // Block 0xc, offset 0x300 0x300: 0x0008, 0x301: 0x0008, 0x302: 0xe00f, 0x303: 0x0008, 0x304: 0x0008, 0x305: 0x0008, 0x306: 0x0008, 0x307: 0x0008, 0x308: 0x0008, 0x309: 0x0008, 0x30a: 0x0008, 0x30b: 0x0008, 0x30c: 0x0008, 0x30d: 0x0008, 0x30e: 0x0008, 0x30f: 0xe0c5, 0x310: 0x04b5, 0x311: 0x04cd, 0x312: 0xe0bd, 0x313: 0xe0f5, 0x314: 0xe0fd, 0x315: 0xe09d, 0x316: 0xe0b5, 0x317: 0x0008, 0x318: 0xe00d, 0x319: 0x0008, 0x31a: 0xe00d, 0x31b: 0x0008, 0x31c: 0xe00d, 0x31d: 0x0008, 0x31e: 0xe00d, 0x31f: 0x0008, 0x320: 0xe00d, 0x321: 0x0008, 0x322: 0xe00d, 0x323: 0x0008, 0x324: 0xe00d, 0x325: 0x0008, 0x326: 0xe00d, 0x327: 0x0008, 0x328: 0xe00d, 0x329: 0x0008, 0x32a: 0xe00d, 0x32b: 0x0008, 0x32c: 0xe00d, 0x32d: 0x0008, 0x32e: 0xe00d, 0x32f: 0x0008, 0x330: 0x04e5, 0x331: 0xe185, 0x332: 0xe18d, 0x333: 0x0008, 0x334: 0x04fd, 0x335: 0x03dd, 0x336: 0x0018, 0x337: 0xe07d, 0x338: 0x0008, 0x339: 0xe1d5, 0x33a: 0xe00d, 0x33b: 0x0008, 0x33c: 0x0008, 0x33d: 0x0515, 0x33e: 0x052d, 0x33f: 0x052d, // Block 0xd, offset 0x340 0x340: 0x0008, 0x341: 0x0008, 0x342: 0x0008, 0x343: 0x0008, 0x344: 0x0008, 0x345: 0x0008, 0x346: 0x0008, 0x347: 0x0008, 0x348: 0x0008, 0x349: 0x0008, 0x34a: 0x0008, 0x34b: 0x0008, 0x34c: 0x0008, 0x34d: 0x0008, 0x34e: 0x0008, 0x34f: 0x0008, 0x350: 0x0008, 0x351: 0x0008, 0x352: 0x0008, 0x353: 0x0008, 0x354: 0x0008, 0x355: 0x0008, 0x356: 0x0008, 0x357: 0x0008, 0x358: 0x0008, 0x359: 0x0008, 0x35a: 0x0008, 0x35b: 0x0008, 0x35c: 0x0008, 0x35d: 0x0008, 0x35e: 0x0008, 0x35f: 0x0008, 0x360: 0xe00d, 0x361: 0x0008, 0x362: 0xe00d, 0x363: 0x0008, 0x364: 0xe00d, 0x365: 0x0008, 0x366: 0xe00d, 0x367: 0x0008, 0x368: 0xe00d, 0x369: 0x0008, 0x36a: 0xe00d, 0x36b: 0x0008, 0x36c: 0xe00d, 0x36d: 0x0008, 0x36e: 0xe00d, 0x36f: 0x0008, 0x370: 0xe00d, 0x371: 0x0008, 0x372: 0xe00d, 0x373: 0x0008, 0x374: 0xe00d, 0x375: 0x0008, 0x376: 0xe00d, 0x377: 0x0008, 0x378: 0xe00d, 0x379: 0x0008, 0x37a: 0xe00d, 0x37b: 0x0008, 0x37c: 0xe00d, 0x37d: 0x0008, 0x37e: 0xe00d, 0x37f: 0x0008, // Block 0xe, offset 0x380 0x380: 0xe00d, 0x381: 0x0008, 0x382: 0x0018, 0x383: 0x3308, 0x384: 0x3308, 0x385: 0x3308, 0x386: 0x3308, 0x387: 0x3308, 0x388: 0x3318, 0x389: 0x3318, 0x38a: 0xe00d, 0x38b: 0x0008, 0x38c: 0xe00d, 0x38d: 0x0008, 0x38e: 0xe00d, 0x38f: 0x0008, 0x390: 0xe00d, 0x391: 0x0008, 0x392: 0xe00d, 0x393: 0x0008, 0x394: 0xe00d, 0x395: 0x0008, 0x396: 0xe00d, 0x397: 0x0008, 0x398: 0xe00d, 0x399: 0x0008, 0x39a: 0xe00d, 0x39b: 0x0008, 0x39c: 0xe00d, 0x39d: 0x0008, 0x39e: 0xe00d, 0x39f: 0x0008, 0x3a0: 0xe00d, 0x3a1: 0x0008, 0x3a2: 0xe00d, 0x3a3: 0x0008, 0x3a4: 0xe00d, 0x3a5: 0x0008, 0x3a6: 0xe00d, 0x3a7: 0x0008, 0x3a8: 0xe00d, 0x3a9: 0x0008, 0x3aa: 0xe00d, 0x3ab: 0x0008, 0x3ac: 0xe00d, 0x3ad: 0x0008, 0x3ae: 0xe00d, 0x3af: 0x0008, 0x3b0: 0xe00d, 0x3b1: 0x0008, 0x3b2: 0xe00d, 0x3b3: 0x0008, 0x3b4: 0xe00d, 0x3b5: 0x0008, 0x3b6: 0xe00d, 0x3b7: 0x0008, 0x3b8: 0xe00d, 0x3b9: 0x0008, 0x3ba: 0xe00d, 0x3bb: 0x0008, 0x3bc: 0xe00d, 0x3bd: 0x0008, 0x3be: 0xe00d, 0x3bf: 0x0008, // Block 0xf, offset 0x3c0 0x3c0: 0x0040, 0x3c1: 0xe01d, 0x3c2: 0x0008, 0x3c3: 0xe03d, 0x3c4: 0x0008, 0x3c5: 0xe01d, 0x3c6: 0x0008, 0x3c7: 0xe07d, 0x3c8: 0x0008, 0x3c9: 0xe01d, 0x3ca: 0x0008, 0x3cb: 0xe03d, 0x3cc: 0x0008, 0x3cd: 0xe01d, 0x3ce: 0x0008, 0x3cf: 0x0008, 0x3d0: 0xe00d, 0x3d1: 0x0008, 0x3d2: 0xe00d, 0x3d3: 0x0008, 0x3d4: 0xe00d, 0x3d5: 0x0008, 0x3d6: 0xe00d, 0x3d7: 0x0008, 0x3d8: 0xe00d, 0x3d9: 0x0008, 0x3da: 0xe00d, 0x3db: 0x0008, 0x3dc: 0xe00d, 0x3dd: 0x0008, 0x3de: 0xe00d, 0x3df: 0x0008, 0x3e0: 0xe00d, 0x3e1: 0x0008, 0x3e2: 0xe00d, 0x3e3: 0x0008, 0x3e4: 0xe00d, 0x3e5: 0x0008, 0x3e6: 0xe00d, 0x3e7: 0x0008, 0x3e8: 0xe00d, 0x3e9: 0x0008, 0x3ea: 0xe00d, 0x3eb: 0x0008, 0x3ec: 0xe00d, 0x3ed: 0x0008, 0x3ee: 0xe00d, 0x3ef: 0x0008, 0x3f0: 0xe00d, 0x3f1: 0x0008, 0x3f2: 0xe00d, 0x3f3: 0x0008, 0x3f4: 0xe00d, 0x3f5: 0x0008, 0x3f6: 0xe00d, 0x3f7: 0x0008, 0x3f8: 0xe00d, 0x3f9: 0x0008, 0x3fa: 0xe00d, 0x3fb: 0x0008, 0x3fc: 0xe00d, 0x3fd: 0x0008, 0x3fe: 0xe00d, 0x3ff: 0x0008, // Block 0x10, offset 0x400 0x400: 0xe00d, 0x401: 0x0008, 0x402: 0xe00d, 0x403: 0x0008, 0x404: 0xe00d, 0x405: 0x0008, 0x406: 0xe00d, 0x407: 0x0008, 0x408: 0xe00d, 0x409: 0x0008, 0x40a: 0xe00d, 0x40b: 0x0008, 0x40c: 0xe00d, 0x40d: 0x0008, 0x40e: 0xe00d, 0x40f: 0x0008, 0x410: 0xe00d, 0x411: 0x0008, 0x412: 0xe00d, 0x413: 0x0008, 0x414: 0xe00d, 0x415: 0x0008, 0x416: 0xe00d, 0x417: 0x0008, 0x418: 0xe00d, 0x419: 0x0008, 0x41a: 0xe00d, 0x41b: 0x0008, 0x41c: 0xe00d, 0x41d: 0x0008, 0x41e: 0xe00d, 0x41f: 0x0008, 0x420: 0xe00d, 0x421: 0x0008, 0x422: 0xe00d, 0x423: 0x0008, 0x424: 0xe00d, 0x425: 0x0008, 0x426: 0xe00d, 0x427: 0x0008, 0x428: 0xe00d, 0x429: 0x0008, 0x42a: 0xe00d, 0x42b: 0x0008, 0x42c: 0xe00d, 0x42d: 0x0008, 0x42e: 0xe00d, 0x42f: 0x0008, 0x430: 0x0040, 0x431: 0x03f5, 0x432: 0x03f5, 0x433: 0x03f5, 0x434: 0x03f5, 0x435: 0x03f5, 0x436: 0x03f5, 0x437: 0x03f5, 0x438: 0x03f5, 0x439: 0x03f5, 0x43a: 0x03f5, 0x43b: 0x03f5, 0x43c: 0x03f5, 0x43d: 0x03f5, 0x43e: 0x03f5, 0x43f: 0x03f5, // Block 0x11, offset 0x440 0x440: 0x0840, 0x441: 0x0840, 0x442: 0x0840, 0x443: 0x0840, 0x444: 0x0840, 0x445: 0x0840, 0x446: 0x0018, 0x447: 0x0018, 0x448: 0x0818, 0x449: 0x0018, 0x44a: 0x0018, 0x44b: 0x0818, 0x44c: 0x0018, 0x44d: 0x0818, 0x44e: 0x0018, 0x44f: 0x0018, 0x450: 0x3308, 0x451: 0x3308, 0x452: 0x3308, 0x453: 0x3308, 0x454: 0x3308, 0x455: 0x3308, 0x456: 0x3308, 0x457: 0x3308, 0x458: 0x3308, 0x459: 0x3308, 0x45a: 0x3308, 0x45b: 0x0818, 0x45c: 0x0b40, 0x45d: 0x0040, 0x45e: 0x0818, 0x45f: 0x0818, 0x460: 0x0a08, 0x461: 0x0808, 0x462: 0x0c08, 0x463: 0x0c08, 0x464: 0x0c08, 0x465: 0x0c08, 0x466: 0x0a08, 0x467: 0x0c08, 0x468: 0x0a08, 0x469: 0x0c08, 0x46a: 0x0a08, 0x46b: 0x0a08, 0x46c: 0x0a08, 0x46d: 0x0a08, 0x46e: 0x0a08, 0x46f: 0x0c08, 0x470: 0x0c08, 0x471: 0x0c08, 0x472: 0x0c08, 0x473: 0x0a08, 0x474: 0x0a08, 0x475: 0x0a08, 0x476: 0x0a08, 0x477: 0x0a08, 0x478: 0x0a08, 0x479: 0x0a08, 0x47a: 0x0a08, 0x47b: 0x0a08, 0x47c: 0x0a08, 0x47d: 0x0a08, 0x47e: 0x0a08, 0x47f: 0x0a08, // Block 0x12, offset 0x480 0x480: 0x0818, 0x481: 0x0a08, 0x482: 0x0a08, 0x483: 0x0a08, 0x484: 0x0a08, 0x485: 0x0a08, 0x486: 0x0a08, 0x487: 0x0a08, 0x488: 0x0c08, 0x489: 0x0a08, 0x48a: 0x0a08, 0x48b: 0x3308, 0x48c: 0x3308, 0x48d: 0x3308, 0x48e: 0x3308, 0x48f: 0x3308, 0x490: 0x3308, 0x491: 0x3308, 0x492: 0x3308, 0x493: 0x3308, 0x494: 0x3308, 0x495: 0x3308, 0x496: 0x3308, 0x497: 0x3308, 0x498: 0x3308, 0x499: 0x3308, 0x49a: 0x3308, 0x49b: 0x3308, 0x49c: 0x3308, 0x49d: 0x3308, 0x49e: 0x3308, 0x49f: 0x3308, 0x4a0: 0x0808, 0x4a1: 0x0808, 0x4a2: 0x0808, 0x4a3: 0x0808, 0x4a4: 0x0808, 0x4a5: 0x0808, 0x4a6: 0x0808, 0x4a7: 0x0808, 0x4a8: 0x0808, 0x4a9: 0x0808, 0x4aa: 0x0018, 0x4ab: 0x0818, 0x4ac: 0x0818, 0x4ad: 0x0818, 0x4ae: 0x0a08, 0x4af: 0x0a08, 0x4b0: 0x3308, 0x4b1: 0x0c08, 0x4b2: 0x0c08, 0x4b3: 0x0c08, 0x4b4: 0x0808, 0x4b5: 0x0139, 0x4b6: 0x0141, 0x4b7: 0x0149, 0x4b8: 0x0151, 0x4b9: 0x0a08, 0x4ba: 0x0a08, 0x4bb: 0x0a08, 0x4bc: 0x0a08, 0x4bd: 0x0a08, 0x4be: 0x0a08, 0x4bf: 0x0a08, // Block 0x13, offset 0x4c0 0x4c0: 0x0c08, 0x4c1: 0x0a08, 0x4c2: 0x0a08, 0x4c3: 0x0c08, 0x4c4: 0x0c08, 0x4c5: 0x0c08, 0x4c6: 0x0c08, 0x4c7: 0x0c08, 0x4c8: 0x0c08, 0x4c9: 0x0c08, 0x4ca: 0x0c08, 0x4cb: 0x0c08, 0x4cc: 0x0a08, 0x4cd: 0x0c08, 0x4ce: 0x0a08, 0x4cf: 0x0c08, 0x4d0: 0x0a08, 0x4d1: 0x0a08, 0x4d2: 0x0c08, 0x4d3: 0x0c08, 0x4d4: 0x0818, 0x4d5: 0x0c08, 0x4d6: 0x3308, 0x4d7: 0x3308, 0x4d8: 0x3308, 0x4d9: 0x3308, 0x4da: 0x3308, 0x4db: 0x3308, 0x4dc: 0x3308, 0x4dd: 0x0840, 0x4de: 0x0018, 0x4df: 0x3308, 0x4e0: 0x3308, 0x4e1: 0x3308, 0x4e2: 0x3308, 0x4e3: 0x3308, 0x4e4: 0x3308, 0x4e5: 0x0808, 0x4e6: 0x0808, 0x4e7: 0x3308, 0x4e8: 0x3308, 0x4e9: 0x0018, 0x4ea: 0x3308, 0x4eb: 0x3308, 0x4ec: 0x3308, 0x4ed: 0x3308, 0x4ee: 0x0c08, 0x4ef: 0x0c08, 0x4f0: 0x0008, 0x4f1: 0x0008, 0x4f2: 0x0008, 0x4f3: 0x0008, 0x4f4: 0x0008, 0x4f5: 0x0008, 0x4f6: 0x0008, 0x4f7: 0x0008, 0x4f8: 0x0008, 0x4f9: 0x0008, 0x4fa: 0x0a08, 0x4fb: 0x0a08, 0x4fc: 0x0a08, 0x4fd: 0x0808, 0x4fe: 0x0808, 0x4ff: 0x0a08, // Block 0x14, offset 0x500 0x500: 0x0818, 0x501: 0x0818, 0x502: 0x0818, 0x503: 0x0818, 0x504: 0x0818, 0x505: 0x0818, 0x506: 0x0818, 0x507: 0x0818, 0x508: 0x0818, 0x509: 0x0818, 0x50a: 0x0818, 0x50b: 0x0818, 0x50c: 0x0818, 0x50d: 0x0818, 0x50e: 0x0040, 0x50f: 0x0b40, 0x510: 0x0c08, 0x511: 0x3308, 0x512: 0x0a08, 0x513: 0x0a08, 0x514: 0x0a08, 0x515: 0x0c08, 0x516: 0x0c08, 0x517: 0x0c08, 0x518: 0x0c08, 0x519: 0x0c08, 0x51a: 0x0a08, 0x51b: 0x0a08, 0x51c: 0x0a08, 0x51d: 0x0a08, 0x51e: 0x0c08, 0x51f: 0x0a08, 0x520: 0x0a08, 0x521: 0x0a08, 0x522: 0x0a08, 0x523: 0x0a08, 0x524: 0x0a08, 0x525: 0x0a08, 0x526: 0x0a08, 0x527: 0x0a08, 0x528: 0x0c08, 0x529: 0x0a08, 0x52a: 0x0c08, 0x52b: 0x0a08, 0x52c: 0x0c08, 0x52d: 0x0a08, 0x52e: 0x0a08, 0x52f: 0x0c08, 0x530: 0x3308, 0x531: 0x3308, 0x532: 0x3308, 0x533: 0x3308, 0x534: 0x3308, 0x535: 0x3308, 0x536: 0x3308, 0x537: 0x3308, 0x538: 0x3308, 0x539: 0x3308, 0x53a: 0x3308, 0x53b: 0x3308, 0x53c: 0x3308, 0x53d: 0x3308, 0x53e: 0x3308, 0x53f: 0x3308, // Block 0x15, offset 0x540 0x540: 0x0c08, 0x541: 0x0a08, 0x542: 0x0a08, 0x543: 0x0a08, 0x544: 0x0a08, 0x545: 0x0a08, 0x546: 0x0c08, 0x547: 0x0c08, 0x548: 0x0a08, 0x549: 0x0c08, 0x54a: 0x0a08, 0x54b: 0x0a08, 0x54c: 0x0a08, 0x54d: 0x0a08, 0x54e: 0x0a08, 0x54f: 0x0a08, 0x550: 0x0a08, 0x551: 0x0a08, 0x552: 0x0a08, 0x553: 0x0a08, 0x554: 0x0c08, 0x555: 0x0a08, 0x556: 0x0c08, 0x557: 0x0c08, 0x558: 0x0c08, 0x559: 0x3308, 0x55a: 0x3308, 0x55b: 0x3308, 0x55c: 0x0040, 0x55d: 0x0040, 0x55e: 0x0818, 0x55f: 0x0040, 0x560: 0x0a08, 0x561: 0x0808, 0x562: 0x0a08, 0x563: 0x0a08, 0x564: 0x0a08, 0x565: 0x0a08, 0x566: 0x0808, 0x567: 0x0c08, 0x568: 0x0a08, 0x569: 0x0c08, 0x56a: 0x0c08, 0x56b: 0x0040, 0x56c: 0x0040, 0x56d: 0x0040, 0x56e: 0x0040, 0x56f: 0x0040, 0x570: 0x0040, 0x571: 0x0040, 0x572: 0x0040, 0x573: 0x0040, 0x574: 0x0040, 0x575: 0x0040, 0x576: 0x0040, 0x577: 0x0040, 0x578: 0x0040, 0x579: 0x0040, 0x57a: 0x0040, 0x57b: 0x0040, 0x57c: 0x0040, 0x57d: 0x0040, 0x57e: 0x0040, 0x57f: 0x0040, // Block 0x16, offset 0x580 0x580: 0x3008, 0x581: 0x3308, 0x582: 0x3308, 0x583: 0x3308, 0x584: 0x3308, 0x585: 0x3308, 0x586: 0x3308, 0x587: 0x3308, 0x588: 0x3308, 0x589: 0x3008, 0x58a: 0x3008, 0x58b: 0x3008, 0x58c: 0x3008, 0x58d: 0x3b08, 0x58e: 0x3008, 0x58f: 0x3008, 0x590: 0x0008, 0x591: 0x3308, 0x592: 0x3308, 0x593: 0x3308, 0x594: 0x3308, 0x595: 0x3308, 0x596: 0x3308, 0x597: 0x3308, 0x598: 0x0159, 0x599: 0x0161, 0x59a: 0x0169, 0x59b: 0x0171, 0x59c: 0x0179, 0x59d: 0x0181, 0x59e: 0x0189, 0x59f: 0x0191, 0x5a0: 0x0008, 0x5a1: 0x0008, 0x5a2: 0x3308, 0x5a3: 0x3308, 0x5a4: 0x0018, 0x5a5: 0x0018, 0x5a6: 0x0008, 0x5a7: 0x0008, 0x5a8: 0x0008, 0x5a9: 0x0008, 0x5aa: 0x0008, 0x5ab: 0x0008, 0x5ac: 0x0008, 0x5ad: 0x0008, 0x5ae: 0x0008, 0x5af: 0x0008, 0x5b0: 0x0018, 0x5b1: 0x0008, 0x5b2: 0x0008, 0x5b3: 0x0008, 0x5b4: 0x0008, 0x5b5: 0x0008, 0x5b6: 0x0008, 0x5b7: 0x0008, 0x5b8: 0x0008, 0x5b9: 0x0008, 0x5ba: 0x0008, 0x5bb: 0x0008, 0x5bc: 0x0008, 0x5bd: 0x0008, 0x5be: 0x0008, 0x5bf: 0x0008, // Block 0x17, offset 0x5c0 0x5c0: 0x0008, 0x5c1: 0x3308, 0x5c2: 0x3008, 0x5c3: 0x3008, 0x5c4: 0x0040, 0x5c5: 0x0008, 0x5c6: 0x0008, 0x5c7: 0x0008, 0x5c8: 0x0008, 0x5c9: 0x0008, 0x5ca: 0x0008, 0x5cb: 0x0008, 0x5cc: 0x0008, 0x5cd: 0x0040, 0x5ce: 0x0040, 0x5cf: 0x0008, 0x5d0: 0x0008, 0x5d1: 0x0040, 0x5d2: 0x0040, 0x5d3: 0x0008, 0x5d4: 0x0008, 0x5d5: 0x0008, 0x5d6: 0x0008, 0x5d7: 0x0008, 0x5d8: 0x0008, 0x5d9: 0x0008, 0x5da: 0x0008, 0x5db: 0x0008, 0x5dc: 0x0008, 0x5dd: 0x0008, 0x5de: 0x0008, 0x5df: 0x0008, 0x5e0: 0x0008, 0x5e1: 0x0008, 0x5e2: 0x0008, 0x5e3: 0x0008, 0x5e4: 0x0008, 0x5e5: 0x0008, 0x5e6: 0x0008, 0x5e7: 0x0008, 0x5e8: 0x0008, 0x5e9: 0x0040, 0x5ea: 0x0008, 0x5eb: 0x0008, 0x5ec: 0x0008, 0x5ed: 0x0008, 0x5ee: 0x0008, 0x5ef: 0x0008, 0x5f0: 0x0008, 0x5f1: 0x0040, 0x5f2: 0x0008, 0x5f3: 0x0040, 0x5f4: 0x0040, 0x5f5: 0x0040, 0x5f6: 0x0008, 0x5f7: 0x0008, 0x5f8: 0x0008, 0x5f9: 0x0008, 0x5fa: 0x0040, 0x5fb: 0x0040, 0x5fc: 0x3308, 0x5fd: 0x0008, 0x5fe: 0x3008, 0x5ff: 0x3008, // Block 0x18, offset 0x600 0x600: 0x3008, 0x601: 0x3308, 0x602: 0x3308, 0x603: 0x3308, 0x604: 0x3308, 0x605: 0x0040, 0x606: 0x0040, 0x607: 0x3008, 0x608: 0x3008, 0x609: 0x0040, 0x60a: 0x0040, 0x60b: 0x3008, 0x60c: 0x3008, 0x60d: 0x3b08, 0x60e: 0x0008, 0x60f: 0x0040, 0x610: 0x0040, 0x611: 0x0040, 0x612: 0x0040, 0x613: 0x0040, 0x614: 0x0040, 0x615: 0x0040, 0x616: 0x0040, 0x617: 0x3008, 0x618: 0x0040, 0x619: 0x0040, 0x61a: 0x0040, 0x61b: 0x0040, 0x61c: 0x0199, 0x61d: 0x01a1, 0x61e: 0x0040, 0x61f: 0x01a9, 0x620: 0x0008, 0x621: 0x0008, 0x622: 0x3308, 0x623: 0x3308, 0x624: 0x0040, 0x625: 0x0040, 0x626: 0x0008, 0x627: 0x0008, 0x628: 0x0008, 0x629: 0x0008, 0x62a: 0x0008, 0x62b: 0x0008, 0x62c: 0x0008, 0x62d: 0x0008, 0x62e: 0x0008, 0x62f: 0x0008, 0x630: 0x0008, 0x631: 0x0008, 0x632: 0x0018, 0x633: 0x0018, 0x634: 0x0018, 0x635: 0x0018, 0x636: 0x0018, 0x637: 0x0018, 0x638: 0x0018, 0x639: 0x0018, 0x63a: 0x0018, 0x63b: 0x0018, 0x63c: 0x0008, 0x63d: 0x0018, 0x63e: 0x3308, 0x63f: 0x0040, // Block 0x19, offset 0x640 0x640: 0x0040, 0x641: 0x3308, 0x642: 0x3308, 0x643: 0x3008, 0x644: 0x0040, 0x645: 0x0008, 0x646: 0x0008, 0x647: 0x0008, 0x648: 0x0008, 0x649: 0x0008, 0x64a: 0x0008, 0x64b: 0x0040, 0x64c: 0x0040, 0x64d: 0x0040, 0x64e: 0x0040, 0x64f: 0x0008, 0x650: 0x0008, 0x651: 0x0040, 0x652: 0x0040, 0x653: 0x0008, 0x654: 0x0008, 0x655: 0x0008, 0x656: 0x0008, 0x657: 0x0008, 0x658: 0x0008, 0x659: 0x0008, 0x65a: 0x0008, 0x65b: 0x0008, 0x65c: 0x0008, 0x65d: 0x0008, 0x65e: 0x0008, 0x65f: 0x0008, 0x660: 0x0008, 0x661: 0x0008, 0x662: 0x0008, 0x663: 0x0008, 0x664: 0x0008, 0x665: 0x0008, 0x666: 0x0008, 0x667: 0x0008, 0x668: 0x0008, 0x669: 0x0040, 0x66a: 0x0008, 0x66b: 0x0008, 0x66c: 0x0008, 0x66d: 0x0008, 0x66e: 0x0008, 0x66f: 0x0008, 0x670: 0x0008, 0x671: 0x0040, 0x672: 0x0008, 0x673: 0x01b1, 0x674: 0x0040, 0x675: 0x0008, 0x676: 0x01b9, 0x677: 0x0040, 0x678: 0x0008, 0x679: 0x0008, 0x67a: 0x0040, 0x67b: 0x0040, 0x67c: 0x3308, 0x67d: 0x0040, 0x67e: 0x3008, 0x67f: 0x3008, // Block 0x1a, offset 0x680 0x680: 0x3008, 0x681: 0x3308, 0x682: 0x3308, 0x683: 0x0040, 0x684: 0x0040, 0x685: 0x0040, 0x686: 0x0040, 0x687: 0x3308, 0x688: 0x3308, 0x689: 0x0040, 0x68a: 0x0040, 0x68b: 0x3308, 0x68c: 0x3308, 0x68d: 0x3b08, 0x68e: 0x0040, 0x68f: 0x0040, 0x690: 0x0040, 0x691: 0x3308, 0x692: 0x0040, 0x693: 0x0040, 0x694: 0x0040, 0x695: 0x0040, 0x696: 0x0040, 0x697: 0x0040, 0x698: 0x0040, 0x699: 0x01c1, 0x69a: 0x01c9, 0x69b: 0x01d1, 0x69c: 0x0008, 0x69d: 0x0040, 0x69e: 0x01d9, 0x69f: 0x0040, 0x6a0: 0x0040, 0x6a1: 0x0040, 0x6a2: 0x0040, 0x6a3: 0x0040, 0x6a4: 0x0040, 0x6a5: 0x0040, 0x6a6: 0x0008, 0x6a7: 0x0008, 0x6a8: 0x0008, 0x6a9: 0x0008, 0x6aa: 0x0008, 0x6ab: 0x0008, 0x6ac: 0x0008, 0x6ad: 0x0008, 0x6ae: 0x0008, 0x6af: 0x0008, 0x6b0: 0x3308, 0x6b1: 0x3308, 0x6b2: 0x0008, 0x6b3: 0x0008, 0x6b4: 0x0008, 0x6b5: 0x3308, 0x6b6: 0x0018, 0x6b7: 0x0040, 0x6b8: 0x0040, 0x6b9: 0x0040, 0x6ba: 0x0040, 0x6bb: 0x0040, 0x6bc: 0x0040, 0x6bd: 0x0040, 0x6be: 0x0040, 0x6bf: 0x0040, // Block 0x1b, offset 0x6c0 0x6c0: 0x0040, 0x6c1: 0x3308, 0x6c2: 0x3308, 0x6c3: 0x3008, 0x6c4: 0x0040, 0x6c5: 0x0008, 0x6c6: 0x0008, 0x6c7: 0x0008, 0x6c8: 0x0008, 0x6c9: 0x0008, 0x6ca: 0x0008, 0x6cb: 0x0008, 0x6cc: 0x0008, 0x6cd: 0x0008, 0x6ce: 0x0040, 0x6cf: 0x0008, 0x6d0: 0x0008, 0x6d1: 0x0008, 0x6d2: 0x0040, 0x6d3: 0x0008, 0x6d4: 0x0008, 0x6d5: 0x0008, 0x6d6: 0x0008, 0x6d7: 0x0008, 0x6d8: 0x0008, 0x6d9: 0x0008, 0x6da: 0x0008, 0x6db: 0x0008, 0x6dc: 0x0008, 0x6dd: 0x0008, 0x6de: 0x0008, 0x6df: 0x0008, 0x6e0: 0x0008, 0x6e1: 0x0008, 0x6e2: 0x0008, 0x6e3: 0x0008, 0x6e4: 0x0008, 0x6e5: 0x0008, 0x6e6: 0x0008, 0x6e7: 0x0008, 0x6e8: 0x0008, 0x6e9: 0x0040, 0x6ea: 0x0008, 0x6eb: 0x0008, 0x6ec: 0x0008, 0x6ed: 0x0008, 0x6ee: 0x0008, 0x6ef: 0x0008, 0x6f0: 0x0008, 0x6f1: 0x0040, 0x6f2: 0x0008, 0x6f3: 0x0008, 0x6f4: 0x0040, 0x6f5: 0x0008, 0x6f6: 0x0008, 0x6f7: 0x0008, 0x6f8: 0x0008, 0x6f9: 0x0008, 0x6fa: 0x0040, 0x6fb: 0x0040, 0x6fc: 0x3308, 0x6fd: 0x0008, 0x6fe: 0x3008, 0x6ff: 0x3008, // Block 0x1c, offset 0x700 0x700: 0x3008, 0x701: 0x3308, 0x702: 0x3308, 0x703: 0x3308, 0x704: 0x3308, 0x705: 0x3308, 0x706: 0x0040, 0x707: 0x3308, 0x708: 0x3308, 0x709: 0x3008, 0x70a: 0x0040, 0x70b: 0x3008, 0x70c: 0x3008, 0x70d: 0x3b08, 0x70e: 0x0040, 0x70f: 0x0040, 0x710: 0x0008, 0x711: 0x0040, 0x712: 0x0040, 0x713: 0x0040, 0x714: 0x0040, 0x715: 0x0040, 0x716: 0x0040, 0x717: 0x0040, 0x718: 0x0040, 0x719: 0x0040, 0x71a: 0x0040, 0x71b: 0x0040, 0x71c: 0x0040, 0x71d: 0x0040, 0x71e: 0x0040, 0x71f: 0x0040, 0x720: 0x0008, 0x721: 0x0008, 0x722: 0x3308, 0x723: 0x3308, 0x724: 0x0040, 0x725: 0x0040, 0x726: 0x0008, 0x727: 0x0008, 0x728: 0x0008, 0x729: 0x0008, 0x72a: 0x0008, 0x72b: 0x0008, 0x72c: 0x0008, 0x72d: 0x0008, 0x72e: 0x0008, 0x72f: 0x0008, 0x730: 0x0018, 0x731: 0x0018, 0x732: 0x0040, 0x733: 0x0040, 0x734: 0x0040, 0x735: 0x0040, 0x736: 0x0040, 0x737: 0x0040, 0x738: 0x0040, 0x739: 0x0008, 0x73a: 0x3308, 0x73b: 0x3308, 0x73c: 0x3308, 0x73d: 0x3308, 0x73e: 0x3308, 0x73f: 0x3308, // Block 0x1d, offset 0x740 0x740: 0x0040, 0x741: 0x3308, 0x742: 0x3008, 0x743: 0x3008, 0x744: 0x0040, 0x745: 0x0008, 0x746: 0x0008, 0x747: 0x0008, 0x748: 0x0008, 0x749: 0x0008, 0x74a: 0x0008, 0x74b: 0x0008, 0x74c: 0x0008, 0x74d: 0x0040, 0x74e: 0x0040, 0x74f: 0x0008, 0x750: 0x0008, 0x751: 0x0040, 0x752: 0x0040, 0x753: 0x0008, 0x754: 0x0008, 0x755: 0x0008, 0x756: 0x0008, 0x757: 0x0008, 0x758: 0x0008, 0x759: 0x0008, 0x75a: 0x0008, 0x75b: 0x0008, 0x75c: 0x0008, 0x75d: 0x0008, 0x75e: 0x0008, 0x75f: 0x0008, 0x760: 0x0008, 0x761: 0x0008, 0x762: 0x0008, 0x763: 0x0008, 0x764: 0x0008, 0x765: 0x0008, 0x766: 0x0008, 0x767: 0x0008, 0x768: 0x0008, 0x769: 0x0040, 0x76a: 0x0008, 0x76b: 0x0008, 0x76c: 0x0008, 0x76d: 0x0008, 0x76e: 0x0008, 0x76f: 0x0008, 0x770: 0x0008, 0x771: 0x0040, 0x772: 0x0008, 0x773: 0x0008, 0x774: 0x0040, 0x775: 0x0008, 0x776: 0x0008, 0x777: 0x0008, 0x778: 0x0008, 0x779: 0x0008, 0x77a: 0x0040, 0x77b: 0x0040, 0x77c: 0x3308, 0x77d: 0x0008, 0x77e: 0x3008, 0x77f: 0x3308, // Block 0x1e, offset 0x780 0x780: 0x3008, 0x781: 0x3308, 0x782: 0x3308, 0x783: 0x3308, 0x784: 0x3308, 0x785: 0x0040, 0x786: 0x0040, 0x787: 0x3008, 0x788: 0x3008, 0x789: 0x0040, 0x78a: 0x0040, 0x78b: 0x3008, 0x78c: 0x3008, 0x78d: 0x3b08, 0x78e: 0x0040, 0x78f: 0x0040, 0x790: 0x0040, 0x791: 0x0040, 0x792: 0x0040, 0x793: 0x0040, 0x794: 0x0040, 0x795: 0x3308, 0x796: 0x3308, 0x797: 0x3008, 0x798: 0x0040, 0x799: 0x0040, 0x79a: 0x0040, 0x79b: 0x0040, 0x79c: 0x01e1, 0x79d: 0x01e9, 0x79e: 0x0040, 0x79f: 0x0008, 0x7a0: 0x0008, 0x7a1: 0x0008, 0x7a2: 0x3308, 0x7a3: 0x3308, 0x7a4: 0x0040, 0x7a5: 0x0040, 0x7a6: 0x0008, 0x7a7: 0x0008, 0x7a8: 0x0008, 0x7a9: 0x0008, 0x7aa: 0x0008, 0x7ab: 0x0008, 0x7ac: 0x0008, 0x7ad: 0x0008, 0x7ae: 0x0008, 0x7af: 0x0008, 0x7b0: 0x0018, 0x7b1: 0x0008, 0x7b2: 0x0018, 0x7b3: 0x0018, 0x7b4: 0x0018, 0x7b5: 0x0018, 0x7b6: 0x0018, 0x7b7: 0x0018, 0x7b8: 0x0040, 0x7b9: 0x0040, 0x7ba: 0x0040, 0x7bb: 0x0040, 0x7bc: 0x0040, 0x7bd: 0x0040, 0x7be: 0x0040, 0x7bf: 0x0040, // Block 0x1f, offset 0x7c0 0x7c0: 0x0040, 0x7c1: 0x0040, 0x7c2: 0x3308, 0x7c3: 0x0008, 0x7c4: 0x0040, 0x7c5: 0x0008, 0x7c6: 0x0008, 0x7c7: 0x0008, 0x7c8: 0x0008, 0x7c9: 0x0008, 0x7ca: 0x0008, 0x7cb: 0x0040, 0x7cc: 0x0040, 0x7cd: 0x0040, 0x7ce: 0x0008, 0x7cf: 0x0008, 0x7d0: 0x0008, 0x7d1: 0x0040, 0x7d2: 0x0008, 0x7d3: 0x0008, 0x7d4: 0x0008, 0x7d5: 0x0008, 0x7d6: 0x0040, 0x7d7: 0x0040, 0x7d8: 0x0040, 0x7d9: 0x0008, 0x7da: 0x0008, 0x7db: 0x0040, 0x7dc: 0x0008, 0x7dd: 0x0040, 0x7de: 0x0008, 0x7df: 0x0008, 0x7e0: 0x0040, 0x7e1: 0x0040, 0x7e2: 0x0040, 0x7e3: 0x0008, 0x7e4: 0x0008, 0x7e5: 0x0040, 0x7e6: 0x0040, 0x7e7: 0x0040, 0x7e8: 0x0008, 0x7e9: 0x0008, 0x7ea: 0x0008, 0x7eb: 0x0040, 0x7ec: 0x0040, 0x7ed: 0x0040, 0x7ee: 0x0008, 0x7ef: 0x0008, 0x7f0: 0x0008, 0x7f1: 0x0008, 0x7f2: 0x0008, 0x7f3: 0x0008, 0x7f4: 0x0008, 0x7f5: 0x0008, 0x7f6: 0x0008, 0x7f7: 0x0008, 0x7f8: 0x0008, 0x7f9: 0x0008, 0x7fa: 0x0040, 0x7fb: 0x0040, 0x7fc: 0x0040, 0x7fd: 0x0040, 0x7fe: 0x3008, 0x7ff: 0x3008, // Block 0x20, offset 0x800 0x800: 0x3308, 0x801: 0x3008, 0x802: 0x3008, 0x803: 0x3008, 0x804: 0x3008, 0x805: 0x0040, 0x806: 0x3308, 0x807: 0x3308, 0x808: 0x3308, 0x809: 0x0040, 0x80a: 0x3308, 0x80b: 0x3308, 0x80c: 0x3308, 0x80d: 0x3b08, 0x80e: 0x0040, 0x80f: 0x0040, 0x810: 0x0040, 0x811: 0x0040, 0x812: 0x0040, 0x813: 0x0040, 0x814: 0x0040, 0x815: 0x3308, 0x816: 0x3308, 0x817: 0x0040, 0x818: 0x0008, 0x819: 0x0008, 0x81a: 0x0008, 0x81b: 0x0040, 0x81c: 0x0040, 0x81d: 0x0040, 0x81e: 0x0040, 0x81f: 0x0040, 0x820: 0x0008, 0x821: 0x0008, 0x822: 0x3308, 0x823: 0x3308, 0x824: 0x0040, 0x825: 0x0040, 0x826: 0x0008, 0x827: 0x0008, 0x828: 0x0008, 0x829: 0x0008, 0x82a: 0x0008, 0x82b: 0x0008, 0x82c: 0x0008, 0x82d: 0x0008, 0x82e: 0x0008, 0x82f: 0x0008, 0x830: 0x0040, 0x831: 0x0040, 0x832: 0x0040, 0x833: 0x0040, 0x834: 0x0040, 0x835: 0x0040, 0x836: 0x0040, 0x837: 0x0018, 0x838: 0x0018, 0x839: 0x0018, 0x83a: 0x0018, 0x83b: 0x0018, 0x83c: 0x0018, 0x83d: 0x0018, 0x83e: 0x0018, 0x83f: 0x0018, // Block 0x21, offset 0x840 0x840: 0x0008, 0x841: 0x3308, 0x842: 0x3008, 0x843: 0x3008, 0x844: 0x0018, 0x845: 0x0008, 0x846: 0x0008, 0x847: 0x0008, 0x848: 0x0008, 0x849: 0x0008, 0x84a: 0x0008, 0x84b: 0x0008, 0x84c: 0x0008, 0x84d: 0x0040, 0x84e: 0x0008, 0x84f: 0x0008, 0x850: 0x0008, 0x851: 0x0040, 0x852: 0x0008, 0x853: 0x0008, 0x854: 0x0008, 0x855: 0x0008, 0x856: 0x0008, 0x857: 0x0008, 0x858: 0x0008, 0x859: 0x0008, 0x85a: 0x0008, 0x85b: 0x0008, 0x85c: 0x0008, 0x85d: 0x0008, 0x85e: 0x0008, 0x85f: 0x0008, 0x860: 0x0008, 0x861: 0x0008, 0x862: 0x0008, 0x863: 0x0008, 0x864: 0x0008, 0x865: 0x0008, 0x866: 0x0008, 0x867: 0x0008, 0x868: 0x0008, 0x869: 0x0040, 0x86a: 0x0008, 0x86b: 0x0008, 0x86c: 0x0008, 0x86d: 0x0008, 0x86e: 0x0008, 0x86f: 0x0008, 0x870: 0x0008, 0x871: 0x0008, 0x872: 0x0008, 0x873: 0x0008, 0x874: 0x0040, 0x875: 0x0008, 0x876: 0x0008, 0x877: 0x0008, 0x878: 0x0008, 0x879: 0x0008, 0x87a: 0x0040, 0x87b: 0x0040, 0x87c: 0x3308, 0x87d: 0x0008, 0x87e: 0x3008, 0x87f: 0x3308, // Block 0x22, offset 0x880 0x880: 0x3008, 0x881: 0x3008, 0x882: 0x3008, 0x883: 0x3008, 0x884: 0x3008, 0x885: 0x0040, 0x886: 0x3308, 0x887: 0x3008, 0x888: 0x3008, 0x889: 0x0040, 0x88a: 0x3008, 0x88b: 0x3008, 0x88c: 0x3308, 0x88d: 0x3b08, 0x88e: 0x0040, 0x88f: 0x0040, 0x890: 0x0040, 0x891: 0x0040, 0x892: 0x0040, 0x893: 0x0040, 0x894: 0x0040, 0x895: 0x3008, 0x896: 0x3008, 0x897: 0x0040, 0x898: 0x0040, 0x899: 0x0040, 0x89a: 0x0040, 0x89b: 0x0040, 0x89c: 0x0040, 0x89d: 0x0040, 0x89e: 0x0008, 0x89f: 0x0040, 0x8a0: 0x0008, 0x8a1: 0x0008, 0x8a2: 0x3308, 0x8a3: 0x3308, 0x8a4: 0x0040, 0x8a5: 0x0040, 0x8a6: 0x0008, 0x8a7: 0x0008, 0x8a8: 0x0008, 0x8a9: 0x0008, 0x8aa: 0x0008, 0x8ab: 0x0008, 0x8ac: 0x0008, 0x8ad: 0x0008, 0x8ae: 0x0008, 0x8af: 0x0008, 0x8b0: 0x0040, 0x8b1: 0x0008, 0x8b2: 0x0008, 0x8b3: 0x0040, 0x8b4: 0x0040, 0x8b5: 0x0040, 0x8b6: 0x0040, 0x8b7: 0x0040, 0x8b8: 0x0040, 0x8b9: 0x0040, 0x8ba: 0x0040, 0x8bb: 0x0040, 0x8bc: 0x0040, 0x8bd: 0x0040, 0x8be: 0x0040, 0x8bf: 0x0040, // Block 0x23, offset 0x8c0 0x8c0: 0x3008, 0x8c1: 0x3308, 0x8c2: 0x3308, 0x8c3: 0x3308, 0x8c4: 0x3308, 0x8c5: 0x0040, 0x8c6: 0x3008, 0x8c7: 0x3008, 0x8c8: 0x3008, 0x8c9: 0x0040, 0x8ca: 0x3008, 0x8cb: 0x3008, 0x8cc: 0x3008, 0x8cd: 0x3b08, 0x8ce: 0x0008, 0x8cf: 0x0018, 0x8d0: 0x0040, 0x8d1: 0x0040, 0x8d2: 0x0040, 0x8d3: 0x0040, 0x8d4: 0x0008, 0x8d5: 0x0008, 0x8d6: 0x0008, 0x8d7: 0x3008, 0x8d8: 0x0018, 0x8d9: 0x0018, 0x8da: 0x0018, 0x8db: 0x0018, 0x8dc: 0x0018, 0x8dd: 0x0018, 0x8de: 0x0018, 0x8df: 0x0008, 0x8e0: 0x0008, 0x8e1: 0x0008, 0x8e2: 0x3308, 0x8e3: 0x3308, 0x8e4: 0x0040, 0x8e5: 0x0040, 0x8e6: 0x0008, 0x8e7: 0x0008, 0x8e8: 0x0008, 0x8e9: 0x0008, 0x8ea: 0x0008, 0x8eb: 0x0008, 0x8ec: 0x0008, 0x8ed: 0x0008, 0x8ee: 0x0008, 0x8ef: 0x0008, 0x8f0: 0x0018, 0x8f1: 0x0018, 0x8f2: 0x0018, 0x8f3: 0x0018, 0x8f4: 0x0018, 0x8f5: 0x0018, 0x8f6: 0x0018, 0x8f7: 0x0018, 0x8f8: 0x0018, 0x8f9: 0x0018, 0x8fa: 0x0008, 0x8fb: 0x0008, 0x8fc: 0x0008, 0x8fd: 0x0008, 0x8fe: 0x0008, 0x8ff: 0x0008, // Block 0x24, offset 0x900 0x900: 0x0040, 0x901: 0x0008, 0x902: 0x0008, 0x903: 0x0040, 0x904: 0x0008, 0x905: 0x0040, 0x906: 0x0008, 0x907: 0x0008, 0x908: 0x0008, 0x909: 0x0008, 0x90a: 0x0008, 0x90b: 0x0040, 0x90c: 0x0008, 0x90d: 0x0008, 0x90e: 0x0008, 0x90f: 0x0008, 0x910: 0x0008, 0x911: 0x0008, 0x912: 0x0008, 0x913: 0x0008, 0x914: 0x0008, 0x915: 0x0008, 0x916: 0x0008, 0x917: 0x0008, 0x918: 0x0008, 0x919: 0x0008, 0x91a: 0x0008, 0x91b: 0x0008, 0x91c: 0x0008, 0x91d: 0x0008, 0x91e: 0x0008, 0x91f: 0x0008, 0x920: 0x0008, 0x921: 0x0008, 0x922: 0x0008, 0x923: 0x0008, 0x924: 0x0040, 0x925: 0x0008, 0x926: 0x0040, 0x927: 0x0008, 0x928: 0x0008, 0x929: 0x0008, 0x92a: 0x0008, 0x92b: 0x0008, 0x92c: 0x0008, 0x92d: 0x0008, 0x92e: 0x0008, 0x92f: 0x0008, 0x930: 0x0008, 0x931: 0x3308, 0x932: 0x0008, 0x933: 0x01f9, 0x934: 0x3308, 0x935: 0x3308, 0x936: 0x3308, 0x937: 0x3308, 0x938: 0x3308, 0x939: 0x3308, 0x93a: 0x3b08, 0x93b: 0x3308, 0x93c: 0x3308, 0x93d: 0x0008, 0x93e: 0x0040, 0x93f: 0x0040, // Block 0x25, offset 0x940 0x940: 0x0008, 0x941: 0x0008, 0x942: 0x0008, 0x943: 0x0211, 0x944: 0x0008, 0x945: 0x0008, 0x946: 0x0008, 0x947: 0x0008, 0x948: 0x0040, 0x949: 0x0008, 0x94a: 0x0008, 0x94b: 0x0008, 0x94c: 0x0008, 0x94d: 0x0219, 0x94e: 0x0008, 0x94f: 0x0008, 0x950: 0x0008, 0x951: 0x0008, 0x952: 0x0221, 0x953: 0x0008, 0x954: 0x0008, 0x955: 0x0008, 0x956: 0x0008, 0x957: 0x0229, 0x958: 0x0008, 0x959: 0x0008, 0x95a: 0x0008, 0x95b: 0x0008, 0x95c: 0x0231, 0x95d: 0x0008, 0x95e: 0x0008, 0x95f: 0x0008, 0x960: 0x0008, 0x961: 0x0008, 0x962: 0x0008, 0x963: 0x0008, 0x964: 0x0008, 0x965: 0x0008, 0x966: 0x0008, 0x967: 0x0008, 0x968: 0x0008, 0x969: 0x0239, 0x96a: 0x0008, 0x96b: 0x0008, 0x96c: 0x0008, 0x96d: 0x0040, 0x96e: 0x0040, 0x96f: 0x0040, 0x970: 0x0040, 0x971: 0x3308, 0x972: 0x3308, 0x973: 0x0241, 0x974: 0x3308, 0x975: 0x0249, 0x976: 0x0251, 0x977: 0x0259, 0x978: 0x0261, 0x979: 0x0269, 0x97a: 0x3308, 0x97b: 0x3308, 0x97c: 0x3308, 0x97d: 0x3308, 0x97e: 0x3308, 0x97f: 0x3008, // Block 0x26, offset 0x980 0x980: 0x3308, 0x981: 0x0271, 0x982: 0x3308, 0x983: 0x3308, 0x984: 0x3b08, 0x985: 0x0018, 0x986: 0x3308, 0x987: 0x3308, 0x988: 0x0008, 0x989: 0x0008, 0x98a: 0x0008, 0x98b: 0x0008, 0x98c: 0x0008, 0x98d: 0x3308, 0x98e: 0x3308, 0x98f: 0x3308, 0x990: 0x3308, 0x991: 0x3308, 0x992: 0x3308, 0x993: 0x0279, 0x994: 0x3308, 0x995: 0x3308, 0x996: 0x3308, 0x997: 0x3308, 0x998: 0x0040, 0x999: 0x3308, 0x99a: 0x3308, 0x99b: 0x3308, 0x99c: 0x3308, 0x99d: 0x0281, 0x99e: 0x3308, 0x99f: 0x3308, 0x9a0: 0x3308, 0x9a1: 0x3308, 0x9a2: 0x0289, 0x9a3: 0x3308, 0x9a4: 0x3308, 0x9a5: 0x3308, 0x9a6: 0x3308, 0x9a7: 0x0291, 0x9a8: 0x3308, 0x9a9: 0x3308, 0x9aa: 0x3308, 0x9ab: 0x3308, 0x9ac: 0x0299, 0x9ad: 0x3308, 0x9ae: 0x3308, 0x9af: 0x3308, 0x9b0: 0x3308, 0x9b1: 0x3308, 0x9b2: 0x3308, 0x9b3: 0x3308, 0x9b4: 0x3308, 0x9b5: 0x3308, 0x9b6: 0x3308, 0x9b7: 0x3308, 0x9b8: 0x3308, 0x9b9: 0x02a1, 0x9ba: 0x3308, 0x9bb: 0x3308, 0x9bc: 0x3308, 0x9bd: 0x0040, 0x9be: 0x0018, 0x9bf: 0x0018, // Block 0x27, offset 0x9c0 0x9c0: 0x0008, 0x9c1: 0x0008, 0x9c2: 0x0008, 0x9c3: 0x0008, 0x9c4: 0x0008, 0x9c5: 0x0008, 0x9c6: 0x0008, 0x9c7: 0x0008, 0x9c8: 0x0008, 0x9c9: 0x0008, 0x9ca: 0x0008, 0x9cb: 0x0008, 0x9cc: 0x0008, 0x9cd: 0x0008, 0x9ce: 0x0008, 0x9cf: 0x0008, 0x9d0: 0x0008, 0x9d1: 0x0008, 0x9d2: 0x0008, 0x9d3: 0x0008, 0x9d4: 0x0008, 0x9d5: 0x0008, 0x9d6: 0x0008, 0x9d7: 0x0008, 0x9d8: 0x0008, 0x9d9: 0x0008, 0x9da: 0x0008, 0x9db: 0x0008, 0x9dc: 0x0008, 0x9dd: 0x0008, 0x9de: 0x0008, 0x9df: 0x0008, 0x9e0: 0x0008, 0x9e1: 0x0008, 0x9e2: 0x0008, 0x9e3: 0x0008, 0x9e4: 0x0008, 0x9e5: 0x0008, 0x9e6: 0x0008, 0x9e7: 0x0008, 0x9e8: 0x0008, 0x9e9: 0x0008, 0x9ea: 0x0008, 0x9eb: 0x0008, 0x9ec: 0x0019, 0x9ed: 0x02e1, 0x9ee: 0x02e9, 0x9ef: 0x0008, 0x9f0: 0x02f1, 0x9f1: 0x02f9, 0x9f2: 0x0301, 0x9f3: 0x0309, 0x9f4: 0x00a9, 0x9f5: 0x0311, 0x9f6: 0x00b1, 0x9f7: 0x0319, 0x9f8: 0x0101, 0x9f9: 0x0321, 0x9fa: 0x0329, 0x9fb: 0x0008, 0x9fc: 0x0051, 0x9fd: 0x0331, 0x9fe: 0x0339, 0x9ff: 0x00b9, // Block 0x28, offset 0xa00 0xa00: 0x0341, 0xa01: 0x0349, 0xa02: 0x00c1, 0xa03: 0x0019, 0xa04: 0x0351, 0xa05: 0x0359, 0xa06: 0x05b5, 0xa07: 0x02e9, 0xa08: 0x02f1, 0xa09: 0x02f9, 0xa0a: 0x0361, 0xa0b: 0x0369, 0xa0c: 0x0371, 0xa0d: 0x0309, 0xa0e: 0x0008, 0xa0f: 0x0319, 0xa10: 0x0321, 0xa11: 0x0379, 0xa12: 0x0051, 0xa13: 0x0381, 0xa14: 0x05cd, 0xa15: 0x05cd, 0xa16: 0x0339, 0xa17: 0x0341, 0xa18: 0x0349, 0xa19: 0x05b5, 0xa1a: 0x0389, 0xa1b: 0x0391, 0xa1c: 0x05e5, 0xa1d: 0x0399, 0xa1e: 0x03a1, 0xa1f: 0x03a9, 0xa20: 0x03b1, 0xa21: 0x03b9, 0xa22: 0x0311, 0xa23: 0x00b9, 0xa24: 0x0349, 0xa25: 0x0391, 0xa26: 0x0399, 0xa27: 0x03a1, 0xa28: 0x03c1, 0xa29: 0x03b1, 0xa2a: 0x03b9, 0xa2b: 0x0008, 0xa2c: 0x0008, 0xa2d: 0x0008, 0xa2e: 0x0008, 0xa2f: 0x0008, 0xa30: 0x0008, 0xa31: 0x0008, 0xa32: 0x0008, 0xa33: 0x0008, 0xa34: 0x0008, 0xa35: 0x0008, 0xa36: 0x0008, 0xa37: 0x0008, 0xa38: 0x03c9, 0xa39: 0x0008, 0xa3a: 0x0008, 0xa3b: 0x0008, 0xa3c: 0x0008, 0xa3d: 0x0008, 0xa3e: 0x0008, 0xa3f: 0x0008, // Block 0x29, offset 0xa40 0xa40: 0x0008, 0xa41: 0x0008, 0xa42: 0x0008, 0xa43: 0x0008, 0xa44: 0x0008, 0xa45: 0x0008, 0xa46: 0x0008, 0xa47: 0x0008, 0xa48: 0x0008, 0xa49: 0x0008, 0xa4a: 0x0008, 0xa4b: 0x0008, 0xa4c: 0x0008, 0xa4d: 0x0008, 0xa4e: 0x0008, 0xa4f: 0x0008, 0xa50: 0x0008, 0xa51: 0x0008, 0xa52: 0x0008, 0xa53: 0x0008, 0xa54: 0x0008, 0xa55: 0x0008, 0xa56: 0x0008, 0xa57: 0x0008, 0xa58: 0x0008, 0xa59: 0x0008, 0xa5a: 0x0008, 0xa5b: 0x03d1, 0xa5c: 0x03d9, 0xa5d: 0x03e1, 0xa5e: 0x03e9, 0xa5f: 0x0371, 0xa60: 0x03f1, 0xa61: 0x03f9, 0xa62: 0x0401, 0xa63: 0x0409, 0xa64: 0x0411, 0xa65: 0x0419, 0xa66: 0x0421, 0xa67: 0x05fd, 0xa68: 0x0429, 0xa69: 0x0431, 0xa6a: 0xe17d, 0xa6b: 0x0439, 0xa6c: 0x0441, 0xa6d: 0x0449, 0xa6e: 0x0451, 0xa6f: 0x0459, 0xa70: 0x0461, 0xa71: 0x0469, 0xa72: 0x0471, 0xa73: 0x0479, 0xa74: 0x0481, 0xa75: 0x0489, 0xa76: 0x0491, 0xa77: 0x0499, 0xa78: 0x0615, 0xa79: 0x04a1, 0xa7a: 0x04a9, 0xa7b: 0x04b1, 0xa7c: 0x04b9, 0xa7d: 0x04c1, 0xa7e: 0x04c9, 0xa7f: 0x04d1, // Block 0x2a, offset 0xa80 0xa80: 0xe00d, 0xa81: 0x0008, 0xa82: 0xe00d, 0xa83: 0x0008, 0xa84: 0xe00d, 0xa85: 0x0008, 0xa86: 0xe00d, 0xa87: 0x0008, 0xa88: 0xe00d, 0xa89: 0x0008, 0xa8a: 0xe00d, 0xa8b: 0x0008, 0xa8c: 0xe00d, 0xa8d: 0x0008, 0xa8e: 0xe00d, 0xa8f: 0x0008, 0xa90: 0xe00d, 0xa91: 0x0008, 0xa92: 0xe00d, 0xa93: 0x0008, 0xa94: 0xe00d, 0xa95: 0x0008, 0xa96: 0xe00d, 0xa97: 0x0008, 0xa98: 0xe00d, 0xa99: 0x0008, 0xa9a: 0xe00d, 0xa9b: 0x0008, 0xa9c: 0xe00d, 0xa9d: 0x0008, 0xa9e: 0xe00d, 0xa9f: 0x0008, 0xaa0: 0xe00d, 0xaa1: 0x0008, 0xaa2: 0xe00d, 0xaa3: 0x0008, 0xaa4: 0xe00d, 0xaa5: 0x0008, 0xaa6: 0xe00d, 0xaa7: 0x0008, 0xaa8: 0xe00d, 0xaa9: 0x0008, 0xaaa: 0xe00d, 0xaab: 0x0008, 0xaac: 0xe00d, 0xaad: 0x0008, 0xaae: 0xe00d, 0xaaf: 0x0008, 0xab0: 0xe00d, 0xab1: 0x0008, 0xab2: 0xe00d, 0xab3: 0x0008, 0xab4: 0xe00d, 0xab5: 0x0008, 0xab6: 0xe00d, 0xab7: 0x0008, 0xab8: 0xe00d, 0xab9: 0x0008, 0xaba: 0xe00d, 0xabb: 0x0008, 0xabc: 0xe00d, 0xabd: 0x0008, 0xabe: 0xe00d, 0xabf: 0x0008, // Block 0x2b, offset 0xac0 0xac0: 0xe00d, 0xac1: 0x0008, 0xac2: 0xe00d, 0xac3: 0x0008, 0xac4: 0xe00d, 0xac5: 0x0008, 0xac6: 0xe00d, 0xac7: 0x0008, 0xac8: 0xe00d, 0xac9: 0x0008, 0xaca: 0xe00d, 0xacb: 0x0008, 0xacc: 0xe00d, 0xacd: 0x0008, 0xace: 0xe00d, 0xacf: 0x0008, 0xad0: 0xe00d, 0xad1: 0x0008, 0xad2: 0xe00d, 0xad3: 0x0008, 0xad4: 0xe00d, 0xad5: 0x0008, 0xad6: 0x0008, 0xad7: 0x0008, 0xad8: 0x0008, 0xad9: 0x0008, 0xada: 0x062d, 0xadb: 0x064d, 0xadc: 0x0008, 0xadd: 0x0008, 0xade: 0x04d9, 0xadf: 0x0008, 0xae0: 0xe00d, 0xae1: 0x0008, 0xae2: 0xe00d, 0xae3: 0x0008, 0xae4: 0xe00d, 0xae5: 0x0008, 0xae6: 0xe00d, 0xae7: 0x0008, 0xae8: 0xe00d, 0xae9: 0x0008, 0xaea: 0xe00d, 0xaeb: 0x0008, 0xaec: 0xe00d, 0xaed: 0x0008, 0xaee: 0xe00d, 0xaef: 0x0008, 0xaf0: 0xe00d, 0xaf1: 0x0008, 0xaf2: 0xe00d, 0xaf3: 0x0008, 0xaf4: 0xe00d, 0xaf5: 0x0008, 0xaf6: 0xe00d, 0xaf7: 0x0008, 0xaf8: 0xe00d, 0xaf9: 0x0008, 0xafa: 0xe00d, 0xafb: 0x0008, 0xafc: 0xe00d, 0xafd: 0x0008, 0xafe: 0xe00d, 0xaff: 0x0008, // Block 0x2c, offset 0xb00 0xb00: 0x0008, 0xb01: 0x0008, 0xb02: 0x0008, 0xb03: 0x0008, 0xb04: 0x0008, 0xb05: 0x0008, 0xb06: 0x0040, 0xb07: 0x0040, 0xb08: 0xe045, 0xb09: 0xe045, 0xb0a: 0xe045, 0xb0b: 0xe045, 0xb0c: 0xe045, 0xb0d: 0xe045, 0xb0e: 0x0040, 0xb0f: 0x0040, 0xb10: 0x0008, 0xb11: 0x0008, 0xb12: 0x0008, 0xb13: 0x0008, 0xb14: 0x0008, 0xb15: 0x0008, 0xb16: 0x0008, 0xb17: 0x0008, 0xb18: 0x0040, 0xb19: 0xe045, 0xb1a: 0x0040, 0xb1b: 0xe045, 0xb1c: 0x0040, 0xb1d: 0xe045, 0xb1e: 0x0040, 0xb1f: 0xe045, 0xb20: 0x0008, 0xb21: 0x0008, 0xb22: 0x0008, 0xb23: 0x0008, 0xb24: 0x0008, 0xb25: 0x0008, 0xb26: 0x0008, 0xb27: 0x0008, 0xb28: 0xe045, 0xb29: 0xe045, 0xb2a: 0xe045, 0xb2b: 0xe045, 0xb2c: 0xe045, 0xb2d: 0xe045, 0xb2e: 0xe045, 0xb2f: 0xe045, 0xb30: 0x0008, 0xb31: 0x04e1, 0xb32: 0x0008, 0xb33: 0x04e9, 0xb34: 0x0008, 0xb35: 0x04f1, 0xb36: 0x0008, 0xb37: 0x04f9, 0xb38: 0x0008, 0xb39: 0x0501, 0xb3a: 0x0008, 0xb3b: 0x0509, 0xb3c: 0x0008, 0xb3d: 0x0511, 0xb3e: 0x0040, 0xb3f: 0x0040, // Block 0x2d, offset 0xb40 0xb40: 0x0519, 0xb41: 0x0521, 0xb42: 0x0529, 0xb43: 0x0531, 0xb44: 0x0539, 0xb45: 0x0541, 0xb46: 0x0549, 0xb47: 0x0551, 0xb48: 0x0519, 0xb49: 0x0521, 0xb4a: 0x0529, 0xb4b: 0x0531, 0xb4c: 0x0539, 0xb4d: 0x0541, 0xb4e: 0x0549, 0xb4f: 0x0551, 0xb50: 0x0559, 0xb51: 0x0561, 0xb52: 0x0569, 0xb53: 0x0571, 0xb54: 0x0579, 0xb55: 0x0581, 0xb56: 0x0589, 0xb57: 0x0591, 0xb58: 0x0559, 0xb59: 0x0561, 0xb5a: 0x0569, 0xb5b: 0x0571, 0xb5c: 0x0579, 0xb5d: 0x0581, 0xb5e: 0x0589, 0xb5f: 0x0591, 0xb60: 0x0599, 0xb61: 0x05a1, 0xb62: 0x05a9, 0xb63: 0x05b1, 0xb64: 0x05b9, 0xb65: 0x05c1, 0xb66: 0x05c9, 0xb67: 0x05d1, 0xb68: 0x0599, 0xb69: 0x05a1, 0xb6a: 0x05a9, 0xb6b: 0x05b1, 0xb6c: 0x05b9, 0xb6d: 0x05c1, 0xb6e: 0x05c9, 0xb6f: 0x05d1, 0xb70: 0x0008, 0xb71: 0x0008, 0xb72: 0x05d9, 0xb73: 0x05e1, 0xb74: 0x05e9, 0xb75: 0x0040, 0xb76: 0x0008, 0xb77: 0x05f1, 0xb78: 0xe045, 0xb79: 0xe045, 0xb7a: 0x0665, 0xb7b: 0x04e1, 0xb7c: 0x05e1, 0xb7d: 0x067e, 0xb7e: 0x05f9, 0xb7f: 0x069e, // Block 0x2e, offset 0xb80 0xb80: 0x06be, 0xb81: 0x0602, 0xb82: 0x0609, 0xb83: 0x0611, 0xb84: 0x0619, 0xb85: 0x0040, 0xb86: 0x0008, 0xb87: 0x0621, 0xb88: 0x06dd, 0xb89: 0x04e9, 0xb8a: 0x06f5, 0xb8b: 0x04f1, 0xb8c: 0x0611, 0xb8d: 0x062a, 0xb8e: 0x0632, 0xb8f: 0x063a, 0xb90: 0x0008, 0xb91: 0x0008, 0xb92: 0x0008, 0xb93: 0x0641, 0xb94: 0x0040, 0xb95: 0x0040, 0xb96: 0x0008, 0xb97: 0x0008, 0xb98: 0xe045, 0xb99: 0xe045, 0xb9a: 0x070d, 0xb9b: 0x04f9, 0xb9c: 0x0040, 0xb9d: 0x064a, 0xb9e: 0x0652, 0xb9f: 0x065a, 0xba0: 0x0008, 0xba1: 0x0008, 0xba2: 0x0008, 0xba3: 0x0661, 0xba4: 0x0008, 0xba5: 0x0008, 0xba6: 0x0008, 0xba7: 0x0008, 0xba8: 0xe045, 0xba9: 0xe045, 0xbaa: 0x0725, 0xbab: 0x0509, 0xbac: 0xe04d, 0xbad: 0x066a, 0xbae: 0x012a, 0xbaf: 0x0672, 0xbb0: 0x0040, 0xbb1: 0x0040, 0xbb2: 0x0679, 0xbb3: 0x0681, 0xbb4: 0x0689, 0xbb5: 0x0040, 0xbb6: 0x0008, 0xbb7: 0x0691, 0xbb8: 0x073d, 0xbb9: 0x0501, 0xbba: 0x0515, 0xbbb: 0x0511, 0xbbc: 0x0681, 0xbbd: 0x0756, 0xbbe: 0x0776, 0xbbf: 0x0040, // Block 0x2f, offset 0xbc0 0xbc0: 0x000a, 0xbc1: 0x000a, 0xbc2: 0x000a, 0xbc3: 0x000a, 0xbc4: 0x000a, 0xbc5: 0x000a, 0xbc6: 0x000a, 0xbc7: 0x000a, 0xbc8: 0x000a, 0xbc9: 0x000a, 0xbca: 0x000a, 0xbcb: 0x03c0, 0xbcc: 0x0003, 0xbcd: 0x0003, 0xbce: 0x0340, 0xbcf: 0x0b40, 0xbd0: 0x0018, 0xbd1: 0xe00d, 0xbd2: 0x0018, 0xbd3: 0x0018, 0xbd4: 0x0018, 0xbd5: 0x0018, 0xbd6: 0x0018, 0xbd7: 0x0796, 0xbd8: 0x0018, 0xbd9: 0x0018, 0xbda: 0x0018, 0xbdb: 0x0018, 0xbdc: 0x0018, 0xbdd: 0x0018, 0xbde: 0x0018, 0xbdf: 0x0018, 0xbe0: 0x0018, 0xbe1: 0x0018, 0xbe2: 0x0018, 0xbe3: 0x0018, 0xbe4: 0x0040, 0xbe5: 0x0040, 0xbe6: 0x0040, 0xbe7: 0x0018, 0xbe8: 0x0040, 0xbe9: 0x0040, 0xbea: 0x0340, 0xbeb: 0x0340, 0xbec: 0x0340, 0xbed: 0x0340, 0xbee: 0x0340, 0xbef: 0x000a, 0xbf0: 0x0018, 0xbf1: 0x0018, 0xbf2: 0x0018, 0xbf3: 0x0699, 0xbf4: 0x06a1, 0xbf5: 0x0018, 0xbf6: 0x06a9, 0xbf7: 0x06b1, 0xbf8: 0x0018, 0xbf9: 0x0018, 0xbfa: 0x0018, 0xbfb: 0x0018, 0xbfc: 0x06ba, 0xbfd: 0x0018, 0xbfe: 0x07b6, 0xbff: 0x0018, // Block 0x30, offset 0xc00 0xc00: 0x0018, 0xc01: 0x0018, 0xc02: 0x0018, 0xc03: 0x0018, 0xc04: 0x0018, 0xc05: 0x0018, 0xc06: 0x0018, 0xc07: 0x06c2, 0xc08: 0x06ca, 0xc09: 0x06d2, 0xc0a: 0x0018, 0xc0b: 0x0018, 0xc0c: 0x0018, 0xc0d: 0x0018, 0xc0e: 0x0018, 0xc0f: 0x0018, 0xc10: 0x0018, 0xc11: 0x0018, 0xc12: 0x0018, 0xc13: 0x0018, 0xc14: 0x0018, 0xc15: 0x0018, 0xc16: 0x0018, 0xc17: 0x06d9, 0xc18: 0x0018, 0xc19: 0x0018, 0xc1a: 0x0018, 0xc1b: 0x0018, 0xc1c: 0x0018, 0xc1d: 0x0018, 0xc1e: 0x0018, 0xc1f: 0x000a, 0xc20: 0x03c0, 0xc21: 0x0340, 0xc22: 0x0340, 0xc23: 0x0340, 0xc24: 0x03c0, 0xc25: 0x0040, 0xc26: 0x0040, 0xc27: 0x0040, 0xc28: 0x0040, 0xc29: 0x0040, 0xc2a: 0x0340, 0xc2b: 0x0340, 0xc2c: 0x0340, 0xc2d: 0x0340, 0xc2e: 0x0340, 0xc2f: 0x0340, 0xc30: 0x06e1, 0xc31: 0x0311, 0xc32: 0x0040, 0xc33: 0x0040, 0xc34: 0x06e9, 0xc35: 0x06f1, 0xc36: 0x06f9, 0xc37: 0x0701, 0xc38: 0x0709, 0xc39: 0x0711, 0xc3a: 0x071a, 0xc3b: 0x07d5, 0xc3c: 0x0722, 0xc3d: 0x072a, 0xc3e: 0x0732, 0xc3f: 0x0329, // Block 0x31, offset 0xc40 0xc40: 0x06e1, 0xc41: 0x0049, 0xc42: 0x0029, 0xc43: 0x0031, 0xc44: 0x06e9, 0xc45: 0x06f1, 0xc46: 0x06f9, 0xc47: 0x0701, 0xc48: 0x0709, 0xc49: 0x0711, 0xc4a: 0x071a, 0xc4b: 0x07ed, 0xc4c: 0x0722, 0xc4d: 0x072a, 0xc4e: 0x0732, 0xc4f: 0x0040, 0xc50: 0x0019, 0xc51: 0x02f9, 0xc52: 0x0051, 0xc53: 0x0109, 0xc54: 0x0361, 0xc55: 0x00a9, 0xc56: 0x0319, 0xc57: 0x0101, 0xc58: 0x0321, 0xc59: 0x0329, 0xc5a: 0x0339, 0xc5b: 0x0089, 0xc5c: 0x0341, 0xc5d: 0x0040, 0xc5e: 0x0040, 0xc5f: 0x0040, 0xc60: 0x0018, 0xc61: 0x0018, 0xc62: 0x0018, 0xc63: 0x0018, 0xc64: 0x0018, 0xc65: 0x0018, 0xc66: 0x0018, 0xc67: 0x0018, 0xc68: 0x0739, 0xc69: 0x0018, 0xc6a: 0x0018, 0xc6b: 0x0018, 0xc6c: 0x0018, 0xc6d: 0x0018, 0xc6e: 0x0018, 0xc6f: 0x0018, 0xc70: 0x0018, 0xc71: 0x0018, 0xc72: 0x0018, 0xc73: 0x0018, 0xc74: 0x0018, 0xc75: 0x0018, 0xc76: 0x0018, 0xc77: 0x0018, 0xc78: 0x0018, 0xc79: 0x0018, 0xc7a: 0x0018, 0xc7b: 0x0018, 0xc7c: 0x0018, 0xc7d: 0x0018, 0xc7e: 0x0018, 0xc7f: 0x0018, // Block 0x32, offset 0xc80 0xc80: 0x0806, 0xc81: 0x0826, 0xc82: 0x03d9, 0xc83: 0x0845, 0xc84: 0x0018, 0xc85: 0x0866, 0xc86: 0x0886, 0xc87: 0x0369, 0xc88: 0x0018, 0xc89: 0x08a5, 0xc8a: 0x0309, 0xc8b: 0x00a9, 0xc8c: 0x00a9, 0xc8d: 0x00a9, 0xc8e: 0x00a9, 0xc8f: 0x0741, 0xc90: 0x0311, 0xc91: 0x0311, 0xc92: 0x0101, 0xc93: 0x0101, 0xc94: 0x0018, 0xc95: 0x0329, 0xc96: 0x0749, 0xc97: 0x0018, 0xc98: 0x0018, 0xc99: 0x0339, 0xc9a: 0x0751, 0xc9b: 0x00b9, 0xc9c: 0x00b9, 0xc9d: 0x00b9, 0xc9e: 0x0018, 0xc9f: 0x0018, 0xca0: 0x0759, 0xca1: 0x08c5, 0xca2: 0x0761, 0xca3: 0x0018, 0xca4: 0x04b1, 0xca5: 0x0018, 0xca6: 0x0769, 0xca7: 0x0018, 0xca8: 0x04b1, 0xca9: 0x0018, 0xcaa: 0x0319, 0xcab: 0x0771, 0xcac: 0x02e9, 0xcad: 0x03d9, 0xcae: 0x0018, 0xcaf: 0x02f9, 0xcb0: 0x02f9, 0xcb1: 0x03f1, 0xcb2: 0x0040, 0xcb3: 0x0321, 0xcb4: 0x0051, 0xcb5: 0x0779, 0xcb6: 0x0781, 0xcb7: 0x0789, 0xcb8: 0x0791, 0xcb9: 0x0311, 0xcba: 0x0018, 0xcbb: 0x08e5, 0xcbc: 0x0799, 0xcbd: 0x03a1, 0xcbe: 0x03a1, 0xcbf: 0x0799, // Block 0x33, offset 0xcc0 0xcc0: 0x0905, 0xcc1: 0x0018, 0xcc2: 0x0018, 0xcc3: 0x0018, 0xcc4: 0x0018, 0xcc5: 0x02f1, 0xcc6: 0x02f1, 0xcc7: 0x02f9, 0xcc8: 0x0311, 0xcc9: 0x00b1, 0xcca: 0x0018, 0xccb: 0x0018, 0xccc: 0x0018, 0xccd: 0x0018, 0xcce: 0x0008, 0xccf: 0x0018, 0xcd0: 0x07a1, 0xcd1: 0x07a9, 0xcd2: 0x07b1, 0xcd3: 0x07b9, 0xcd4: 0x07c1, 0xcd5: 0x07c9, 0xcd6: 0x07d1, 0xcd7: 0x07d9, 0xcd8: 0x07e1, 0xcd9: 0x07e9, 0xcda: 0x07f1, 0xcdb: 0x07f9, 0xcdc: 0x0801, 0xcdd: 0x0809, 0xcde: 0x0811, 0xcdf: 0x0819, 0xce0: 0x0311, 0xce1: 0x0821, 0xce2: 0x091d, 0xce3: 0x0829, 0xce4: 0x0391, 0xce5: 0x0831, 0xce6: 0x093d, 0xce7: 0x0839, 0xce8: 0x0841, 0xce9: 0x0109, 0xcea: 0x0849, 0xceb: 0x095d, 0xcec: 0x0101, 0xced: 0x03d9, 0xcee: 0x02f1, 0xcef: 0x0321, 0xcf0: 0x0311, 0xcf1: 0x0821, 0xcf2: 0x097d, 0xcf3: 0x0829, 0xcf4: 0x0391, 0xcf5: 0x0831, 0xcf6: 0x099d, 0xcf7: 0x0839, 0xcf8: 0x0841, 0xcf9: 0x0109, 0xcfa: 0x0849, 0xcfb: 0x09bd, 0xcfc: 0x0101, 0xcfd: 0x03d9, 0xcfe: 0x02f1, 0xcff: 0x0321, // Block 0x34, offset 0xd00 0xd00: 0x0018, 0xd01: 0x0018, 0xd02: 0x0018, 0xd03: 0x0018, 0xd04: 0x0018, 0xd05: 0x0018, 0xd06: 0x0018, 0xd07: 0x0018, 0xd08: 0x0018, 0xd09: 0x0018, 0xd0a: 0x0018, 0xd0b: 0x0040, 0xd0c: 0x0040, 0xd0d: 0x0040, 0xd0e: 0x0040, 0xd0f: 0x0040, 0xd10: 0x0040, 0xd11: 0x0040, 0xd12: 0x0040, 0xd13: 0x0040, 0xd14: 0x0040, 0xd15: 0x0040, 0xd16: 0x0040, 0xd17: 0x0040, 0xd18: 0x0040, 0xd19: 0x0040, 0xd1a: 0x0040, 0xd1b: 0x0040, 0xd1c: 0x0040, 0xd1d: 0x0040, 0xd1e: 0x0040, 0xd1f: 0x0040, 0xd20: 0x0049, 0xd21: 0x0029, 0xd22: 0x0031, 0xd23: 0x06e9, 0xd24: 0x06f1, 0xd25: 0x06f9, 0xd26: 0x0701, 0xd27: 0x0709, 0xd28: 0x0711, 0xd29: 0x0879, 0xd2a: 0x0881, 0xd2b: 0x0889, 0xd2c: 0x0891, 0xd2d: 0x0899, 0xd2e: 0x08a1, 0xd2f: 0x08a9, 0xd30: 0x08b1, 0xd31: 0x08b9, 0xd32: 0x08c1, 0xd33: 0x08c9, 0xd34: 0x0a1e, 0xd35: 0x0a3e, 0xd36: 0x0a5e, 0xd37: 0x0a7e, 0xd38: 0x0a9e, 0xd39: 0x0abe, 0xd3a: 0x0ade, 0xd3b: 0x0afe, 0xd3c: 0x0b1e, 0xd3d: 0x08d2, 0xd3e: 0x08da, 0xd3f: 0x08e2, // Block 0x35, offset 0xd40 0xd40: 0x08ea, 0xd41: 0x08f2, 0xd42: 0x08fa, 0xd43: 0x0902, 0xd44: 0x090a, 0xd45: 0x0912, 0xd46: 0x091a, 0xd47: 0x0922, 0xd48: 0x0040, 0xd49: 0x0040, 0xd4a: 0x0040, 0xd4b: 0x0040, 0xd4c: 0x0040, 0xd4d: 0x0040, 0xd4e: 0x0040, 0xd4f: 0x0040, 0xd50: 0x0040, 0xd51: 0x0040, 0xd52: 0x0040, 0xd53: 0x0040, 0xd54: 0x0040, 0xd55: 0x0040, 0xd56: 0x0040, 0xd57: 0x0040, 0xd58: 0x0040, 0xd59: 0x0040, 0xd5a: 0x0040, 0xd5b: 0x0040, 0xd5c: 0x0b3e, 0xd5d: 0x0b5e, 0xd5e: 0x0b7e, 0xd5f: 0x0b9e, 0xd60: 0x0bbe, 0xd61: 0x0bde, 0xd62: 0x0bfe, 0xd63: 0x0c1e, 0xd64: 0x0c3e, 0xd65: 0x0c5e, 0xd66: 0x0c7e, 0xd67: 0x0c9e, 0xd68: 0x0cbe, 0xd69: 0x0cde, 0xd6a: 0x0cfe, 0xd6b: 0x0d1e, 0xd6c: 0x0d3e, 0xd6d: 0x0d5e, 0xd6e: 0x0d7e, 0xd6f: 0x0d9e, 0xd70: 0x0dbe, 0xd71: 0x0dde, 0xd72: 0x0dfe, 0xd73: 0x0e1e, 0xd74: 0x0e3e, 0xd75: 0x0e5e, 0xd76: 0x0019, 0xd77: 0x02e9, 0xd78: 0x03d9, 0xd79: 0x02f1, 0xd7a: 0x02f9, 0xd7b: 0x03f1, 0xd7c: 0x0309, 0xd7d: 0x00a9, 0xd7e: 0x0311, 0xd7f: 0x00b1, // Block 0x36, offset 0xd80 0xd80: 0x0319, 0xd81: 0x0101, 0xd82: 0x0321, 0xd83: 0x0329, 0xd84: 0x0051, 0xd85: 0x0339, 0xd86: 0x0751, 0xd87: 0x00b9, 0xd88: 0x0089, 0xd89: 0x0341, 0xd8a: 0x0349, 0xd8b: 0x0391, 0xd8c: 0x00c1, 0xd8d: 0x0109, 0xd8e: 0x00c9, 0xd8f: 0x04b1, 0xd90: 0x0019, 0xd91: 0x02e9, 0xd92: 0x03d9, 0xd93: 0x02f1, 0xd94: 0x02f9, 0xd95: 0x03f1, 0xd96: 0x0309, 0xd97: 0x00a9, 0xd98: 0x0311, 0xd99: 0x00b1, 0xd9a: 0x0319, 0xd9b: 0x0101, 0xd9c: 0x0321, 0xd9d: 0x0329, 0xd9e: 0x0051, 0xd9f: 0x0339, 0xda0: 0x0751, 0xda1: 0x00b9, 0xda2: 0x0089, 0xda3: 0x0341, 0xda4: 0x0349, 0xda5: 0x0391, 0xda6: 0x00c1, 0xda7: 0x0109, 0xda8: 0x00c9, 0xda9: 0x04b1, 0xdaa: 0x06e1, 0xdab: 0x0018, 0xdac: 0x0018, 0xdad: 0x0018, 0xdae: 0x0018, 0xdaf: 0x0018, 0xdb0: 0x0018, 0xdb1: 0x0018, 0xdb2: 0x0018, 0xdb3: 0x0018, 0xdb4: 0x0018, 0xdb5: 0x0018, 0xdb6: 0x0018, 0xdb7: 0x0018, 0xdb8: 0x0018, 0xdb9: 0x0018, 0xdba: 0x0018, 0xdbb: 0x0018, 0xdbc: 0x0018, 0xdbd: 0x0018, 0xdbe: 0x0018, 0xdbf: 0x0018, // Block 0x37, offset 0xdc0 0xdc0: 0x0008, 0xdc1: 0x0008, 0xdc2: 0x0008, 0xdc3: 0x0008, 0xdc4: 0x0008, 0xdc5: 0x0008, 0xdc6: 0x0008, 0xdc7: 0x0008, 0xdc8: 0x0008, 0xdc9: 0x0008, 0xdca: 0x0008, 0xdcb: 0x0008, 0xdcc: 0x0008, 0xdcd: 0x0008, 0xdce: 0x0008, 0xdcf: 0x0008, 0xdd0: 0x0008, 0xdd1: 0x0008, 0xdd2: 0x0008, 0xdd3: 0x0008, 0xdd4: 0x0008, 0xdd5: 0x0008, 0xdd6: 0x0008, 0xdd7: 0x0008, 0xdd8: 0x0008, 0xdd9: 0x0008, 0xdda: 0x0008, 0xddb: 0x0008, 0xddc: 0x0008, 0xddd: 0x0008, 0xdde: 0x0008, 0xddf: 0x0040, 0xde0: 0xe00d, 0xde1: 0x0008, 0xde2: 0x0941, 0xde3: 0x0ed5, 0xde4: 0x0949, 0xde5: 0x0008, 0xde6: 0x0008, 0xde7: 0xe07d, 0xde8: 0x0008, 0xde9: 0xe01d, 0xdea: 0x0008, 0xdeb: 0xe03d, 0xdec: 0x0008, 0xded: 0x0359, 0xdee: 0x0441, 0xdef: 0x0351, 0xdf0: 0x03d1, 0xdf1: 0x0008, 0xdf2: 0xe00d, 0xdf3: 0x0008, 0xdf4: 0x0008, 0xdf5: 0xe01d, 0xdf6: 0x0008, 0xdf7: 0x0008, 0xdf8: 0x0008, 0xdf9: 0x0008, 0xdfa: 0x0008, 0xdfb: 0x0008, 0xdfc: 0x00b1, 0xdfd: 0x0391, 0xdfe: 0x0951, 0xdff: 0x0959, // Block 0x38, offset 0xe00 0xe00: 0xe00d, 0xe01: 0x0008, 0xe02: 0xe00d, 0xe03: 0x0008, 0xe04: 0xe00d, 0xe05: 0x0008, 0xe06: 0xe00d, 0xe07: 0x0008, 0xe08: 0xe00d, 0xe09: 0x0008, 0xe0a: 0xe00d, 0xe0b: 0x0008, 0xe0c: 0xe00d, 0xe0d: 0x0008, 0xe0e: 0xe00d, 0xe0f: 0x0008, 0xe10: 0xe00d, 0xe11: 0x0008, 0xe12: 0xe00d, 0xe13: 0x0008, 0xe14: 0xe00d, 0xe15: 0x0008, 0xe16: 0xe00d, 0xe17: 0x0008, 0xe18: 0xe00d, 0xe19: 0x0008, 0xe1a: 0xe00d, 0xe1b: 0x0008, 0xe1c: 0xe00d, 0xe1d: 0x0008, 0xe1e: 0xe00d, 0xe1f: 0x0008, 0xe20: 0xe00d, 0xe21: 0x0008, 0xe22: 0xe00d, 0xe23: 0x0008, 0xe24: 0x0008, 0xe25: 0x0018, 0xe26: 0x0018, 0xe27: 0x0018, 0xe28: 0x0018, 0xe29: 0x0018, 0xe2a: 0x0018, 0xe2b: 0xe03d, 0xe2c: 0x0008, 0xe2d: 0xe01d, 0xe2e: 0x0008, 0xe2f: 0x3308, 0xe30: 0x3308, 0xe31: 0x3308, 0xe32: 0xe00d, 0xe33: 0x0008, 0xe34: 0x0040, 0xe35: 0x0040, 0xe36: 0x0040, 0xe37: 0x0040, 0xe38: 0x0040, 0xe39: 0x0018, 0xe3a: 0x0018, 0xe3b: 0x0018, 0xe3c: 0x0018, 0xe3d: 0x0018, 0xe3e: 0x0018, 0xe3f: 0x0018, // Block 0x39, offset 0xe40 0xe40: 0x2715, 0xe41: 0x2735, 0xe42: 0x2755, 0xe43: 0x2775, 0xe44: 0x2795, 0xe45: 0x27b5, 0xe46: 0x27d5, 0xe47: 0x27f5, 0xe48: 0x2815, 0xe49: 0x2835, 0xe4a: 0x2855, 0xe4b: 0x2875, 0xe4c: 0x2895, 0xe4d: 0x28b5, 0xe4e: 0x28d5, 0xe4f: 0x28f5, 0xe50: 0x2915, 0xe51: 0x2935, 0xe52: 0x2955, 0xe53: 0x2975, 0xe54: 0x2995, 0xe55: 0x29b5, 0xe56: 0x0040, 0xe57: 0x0040, 0xe58: 0x0040, 0xe59: 0x0040, 0xe5a: 0x0040, 0xe5b: 0x0040, 0xe5c: 0x0040, 0xe5d: 0x0040, 0xe5e: 0x0040, 0xe5f: 0x0040, 0xe60: 0x0040, 0xe61: 0x0040, 0xe62: 0x0040, 0xe63: 0x0040, 0xe64: 0x0040, 0xe65: 0x0040, 0xe66: 0x0040, 0xe67: 0x0040, 0xe68: 0x0040, 0xe69: 0x0040, 0xe6a: 0x0040, 0xe6b: 0x0040, 0xe6c: 0x0040, 0xe6d: 0x0040, 0xe6e: 0x0040, 0xe6f: 0x0040, 0xe70: 0x0040, 0xe71: 0x0040, 0xe72: 0x0040, 0xe73: 0x0040, 0xe74: 0x0040, 0xe75: 0x0040, 0xe76: 0x0040, 0xe77: 0x0040, 0xe78: 0x0040, 0xe79: 0x0040, 0xe7a: 0x0040, 0xe7b: 0x0040, 0xe7c: 0x0040, 0xe7d: 0x0040, 0xe7e: 0x0040, 0xe7f: 0x0040, // Block 0x3a, offset 0xe80 0xe80: 0x000a, 0xe81: 0x0018, 0xe82: 0x0961, 0xe83: 0x0018, 0xe84: 0x0018, 0xe85: 0x0008, 0xe86: 0x0008, 0xe87: 0x0008, 0xe88: 0x0018, 0xe89: 0x0018, 0xe8a: 0x0018, 0xe8b: 0x0018, 0xe8c: 0x0018, 0xe8d: 0x0018, 0xe8e: 0x0018, 0xe8f: 0x0018, 0xe90: 0x0018, 0xe91: 0x0018, 0xe92: 0x0018, 0xe93: 0x0018, 0xe94: 0x0018, 0xe95: 0x0018, 0xe96: 0x0018, 0xe97: 0x0018, 0xe98: 0x0018, 0xe99: 0x0018, 0xe9a: 0x0018, 0xe9b: 0x0018, 0xe9c: 0x0018, 0xe9d: 0x0018, 0xe9e: 0x0018, 0xe9f: 0x0018, 0xea0: 0x0018, 0xea1: 0x0018, 0xea2: 0x0018, 0xea3: 0x0018, 0xea4: 0x0018, 0xea5: 0x0018, 0xea6: 0x0018, 0xea7: 0x0018, 0xea8: 0x0018, 0xea9: 0x0018, 0xeaa: 0x3308, 0xeab: 0x3308, 0xeac: 0x3308, 0xead: 0x3308, 0xeae: 0x3018, 0xeaf: 0x3018, 0xeb0: 0x0018, 0xeb1: 0x0018, 0xeb2: 0x0018, 0xeb3: 0x0018, 0xeb4: 0x0018, 0xeb5: 0x0018, 0xeb6: 0xe125, 0xeb7: 0x0018, 0xeb8: 0x29d5, 0xeb9: 0x29f5, 0xeba: 0x2a15, 0xebb: 0x0018, 0xebc: 0x0008, 0xebd: 0x0018, 0xebe: 0x0018, 0xebf: 0x0018, // Block 0x3b, offset 0xec0 0xec0: 0x2b55, 0xec1: 0x2b75, 0xec2: 0x2b95, 0xec3: 0x2bb5, 0xec4: 0x2bd5, 0xec5: 0x2bf5, 0xec6: 0x2bf5, 0xec7: 0x2bf5, 0xec8: 0x2c15, 0xec9: 0x2c15, 0xeca: 0x2c15, 0xecb: 0x2c15, 0xecc: 0x2c35, 0xecd: 0x2c35, 0xece: 0x2c35, 0xecf: 0x2c55, 0xed0: 0x2c75, 0xed1: 0x2c75, 0xed2: 0x2a95, 0xed3: 0x2a95, 0xed4: 0x2c75, 0xed5: 0x2c75, 0xed6: 0x2c95, 0xed7: 0x2c95, 0xed8: 0x2c75, 0xed9: 0x2c75, 0xeda: 0x2a95, 0xedb: 0x2a95, 0xedc: 0x2c75, 0xedd: 0x2c75, 0xede: 0x2c55, 0xedf: 0x2c55, 0xee0: 0x2cb5, 0xee1: 0x2cb5, 0xee2: 0x2cd5, 0xee3: 0x2cd5, 0xee4: 0x0040, 0xee5: 0x2cf5, 0xee6: 0x2d15, 0xee7: 0x2d35, 0xee8: 0x2d35, 0xee9: 0x2d55, 0xeea: 0x2d75, 0xeeb: 0x2d95, 0xeec: 0x2db5, 0xeed: 0x2dd5, 0xeee: 0x2df5, 0xeef: 0x2e15, 0xef0: 0x2e35, 0xef1: 0x2e55, 0xef2: 0x2e55, 0xef3: 0x2e75, 0xef4: 0x2e95, 0xef5: 0x2e95, 0xef6: 0x2eb5, 0xef7: 0x2ed5, 0xef8: 0x2e75, 0xef9: 0x2ef5, 0xefa: 0x2f15, 0xefb: 0x2ef5, 0xefc: 0x2e75, 0xefd: 0x2f35, 0xefe: 0x2f55, 0xeff: 0x2f75, // Block 0x3c, offset 0xf00 0xf00: 0x2f95, 0xf01: 0x2fb5, 0xf02: 0x2d15, 0xf03: 0x2cf5, 0xf04: 0x2fd5, 0xf05: 0x2ff5, 0xf06: 0x3015, 0xf07: 0x3035, 0xf08: 0x3055, 0xf09: 0x3075, 0xf0a: 0x3095, 0xf0b: 0x30b5, 0xf0c: 0x30d5, 0xf0d: 0x30f5, 0xf0e: 0x3115, 0xf0f: 0x0040, 0xf10: 0x0018, 0xf11: 0x0018, 0xf12: 0x3135, 0xf13: 0x3155, 0xf14: 0x3175, 0xf15: 0x3195, 0xf16: 0x31b5, 0xf17: 0x31d5, 0xf18: 0x31f5, 0xf19: 0x3215, 0xf1a: 0x3235, 0xf1b: 0x3255, 0xf1c: 0x3175, 0xf1d: 0x3275, 0xf1e: 0x3295, 0xf1f: 0x32b5, 0xf20: 0x0008, 0xf21: 0x0008, 0xf22: 0x0008, 0xf23: 0x0008, 0xf24: 0x0008, 0xf25: 0x0008, 0xf26: 0x0008, 0xf27: 0x0008, 0xf28: 0x0008, 0xf29: 0x0008, 0xf2a: 0x0008, 0xf2b: 0x0008, 0xf2c: 0x0008, 0xf2d: 0x0008, 0xf2e: 0x0008, 0xf2f: 0x0008, 0xf30: 0x0008, 0xf31: 0x0008, 0xf32: 0x0008, 0xf33: 0x0008, 0xf34: 0x0008, 0xf35: 0x0008, 0xf36: 0x0008, 0xf37: 0x0008, 0xf38: 0x0008, 0xf39: 0x0008, 0xf3a: 0x0008, 0xf3b: 0x0008, 0xf3c: 0x0008, 0xf3d: 0x0008, 0xf3e: 0x0008, 0xf3f: 0x0008, // Block 0x3d, offset 0xf40 0xf40: 0x0b82, 0xf41: 0x0b8a, 0xf42: 0x0b92, 0xf43: 0x0b9a, 0xf44: 0x32d5, 0xf45: 0x32f5, 0xf46: 0x3315, 0xf47: 0x3335, 0xf48: 0x0018, 0xf49: 0x0018, 0xf4a: 0x0018, 0xf4b: 0x0018, 0xf4c: 0x0018, 0xf4d: 0x0018, 0xf4e: 0x0018, 0xf4f: 0x0018, 0xf50: 0x3355, 0xf51: 0x0ba1, 0xf52: 0x0ba9, 0xf53: 0x0bb1, 0xf54: 0x0bb9, 0xf55: 0x0bc1, 0xf56: 0x0bc9, 0xf57: 0x0bd1, 0xf58: 0x0bd9, 0xf59: 0x0be1, 0xf5a: 0x0be9, 0xf5b: 0x0bf1, 0xf5c: 0x0bf9, 0xf5d: 0x0c01, 0xf5e: 0x0c09, 0xf5f: 0x0c11, 0xf60: 0x3375, 0xf61: 0x3395, 0xf62: 0x33b5, 0xf63: 0x33d5, 0xf64: 0x33f5, 0xf65: 0x33f5, 0xf66: 0x3415, 0xf67: 0x3435, 0xf68: 0x3455, 0xf69: 0x3475, 0xf6a: 0x3495, 0xf6b: 0x34b5, 0xf6c: 0x34d5, 0xf6d: 0x34f5, 0xf6e: 0x3515, 0xf6f: 0x3535, 0xf70: 0x3555, 0xf71: 0x3575, 0xf72: 0x3595, 0xf73: 0x35b5, 0xf74: 0x35d5, 0xf75: 0x35f5, 0xf76: 0x3615, 0xf77: 0x3635, 0xf78: 0x3655, 0xf79: 0x3675, 0xf7a: 0x3695, 0xf7b: 0x36b5, 0xf7c: 0x0c19, 0xf7d: 0x0c21, 0xf7e: 0x36d5, 0xf7f: 0x0018, // Block 0x3e, offset 0xf80 0xf80: 0x36f5, 0xf81: 0x3715, 0xf82: 0x3735, 0xf83: 0x3755, 0xf84: 0x3775, 0xf85: 0x3795, 0xf86: 0x37b5, 0xf87: 0x37d5, 0xf88: 0x37f5, 0xf89: 0x3815, 0xf8a: 0x3835, 0xf8b: 0x3855, 0xf8c: 0x3875, 0xf8d: 0x3895, 0xf8e: 0x38b5, 0xf8f: 0x38d5, 0xf90: 0x38f5, 0xf91: 0x3915, 0xf92: 0x3935, 0xf93: 0x3955, 0xf94: 0x3975, 0xf95: 0x3995, 0xf96: 0x39b5, 0xf97: 0x39d5, 0xf98: 0x39f5, 0xf99: 0x3a15, 0xf9a: 0x3a35, 0xf9b: 0x3a55, 0xf9c: 0x3a75, 0xf9d: 0x3a95, 0xf9e: 0x3ab5, 0xf9f: 0x3ad5, 0xfa0: 0x3af5, 0xfa1: 0x3b15, 0xfa2: 0x3b35, 0xfa3: 0x3b55, 0xfa4: 0x3b75, 0xfa5: 0x3b95, 0xfa6: 0x1295, 0xfa7: 0x3bb5, 0xfa8: 0x3bd5, 0xfa9: 0x3bf5, 0xfaa: 0x3c15, 0xfab: 0x3c35, 0xfac: 0x3c55, 0xfad: 0x3c75, 0xfae: 0x23b5, 0xfaf: 0x3c95, 0xfb0: 0x3cb5, 0xfb1: 0x0c29, 0xfb2: 0x0c31, 0xfb3: 0x0c39, 0xfb4: 0x0c41, 0xfb5: 0x0c49, 0xfb6: 0x0c51, 0xfb7: 0x0c59, 0xfb8: 0x0c61, 0xfb9: 0x0c69, 0xfba: 0x0c71, 0xfbb: 0x0c79, 0xfbc: 0x0c81, 0xfbd: 0x0c89, 0xfbe: 0x0c91, 0xfbf: 0x0c99, // Block 0x3f, offset 0xfc0 0xfc0: 0x0ca1, 0xfc1: 0x0ca9, 0xfc2: 0x0cb1, 0xfc3: 0x0cb9, 0xfc4: 0x0cc1, 0xfc5: 0x0cc9, 0xfc6: 0x0cd1, 0xfc7: 0x0cd9, 0xfc8: 0x0ce1, 0xfc9: 0x0ce9, 0xfca: 0x0cf1, 0xfcb: 0x0cf9, 0xfcc: 0x0d01, 0xfcd: 0x3cd5, 0xfce: 0x0d09, 0xfcf: 0x3cf5, 0xfd0: 0x3d15, 0xfd1: 0x3d2d, 0xfd2: 0x3d45, 0xfd3: 0x3d5d, 0xfd4: 0x3d75, 0xfd5: 0x3d75, 0xfd6: 0x3d5d, 0xfd7: 0x3d8d, 0xfd8: 0x07d5, 0xfd9: 0x3da5, 0xfda: 0x3dbd, 0xfdb: 0x3dd5, 0xfdc: 0x3ded, 0xfdd: 0x3e05, 0xfde: 0x3e1d, 0xfdf: 0x3e35, 0xfe0: 0x3e4d, 0xfe1: 0x3e65, 0xfe2: 0x3e7d, 0xfe3: 0x3e95, 0xfe4: 0x3ead, 0xfe5: 0x3ead, 0xfe6: 0x3ec5, 0xfe7: 0x3ec5, 0xfe8: 0x3edd, 0xfe9: 0x3edd, 0xfea: 0x3ef5, 0xfeb: 0x3f0d, 0xfec: 0x3f25, 0xfed: 0x3f3d, 0xfee: 0x3f55, 0xfef: 0x3f55, 0xff0: 0x3f6d, 0xff1: 0x3f6d, 0xff2: 0x3f6d, 0xff3: 0x3f85, 0xff4: 0x3f9d, 0xff5: 0x3fb5, 0xff6: 0x3fcd, 0xff7: 0x3fb5, 0xff8: 0x3fe5, 0xff9: 0x3ffd, 0xffa: 0x3f85, 0xffb: 0x4015, 0xffc: 0x402d, 0xffd: 0x402d, 0xffe: 0x402d, 0xfff: 0x0d11, // Block 0x40, offset 0x1000 0x1000: 0x10f9, 0x1001: 0x1101, 0x1002: 0x40a5, 0x1003: 0x1109, 0x1004: 0x1111, 0x1005: 0x1119, 0x1006: 0x1121, 0x1007: 0x1129, 0x1008: 0x40c5, 0x1009: 0x1131, 0x100a: 0x1139, 0x100b: 0x1141, 0x100c: 0x40e5, 0x100d: 0x40e5, 0x100e: 0x1149, 0x100f: 0x1151, 0x1010: 0x1159, 0x1011: 0x4105, 0x1012: 0x4125, 0x1013: 0x4145, 0x1014: 0x4165, 0x1015: 0x4185, 0x1016: 0x1161, 0x1017: 0x1169, 0x1018: 0x1171, 0x1019: 0x1179, 0x101a: 0x1181, 0x101b: 0x41a5, 0x101c: 0x1189, 0x101d: 0x1191, 0x101e: 0x1199, 0x101f: 0x41c5, 0x1020: 0x41e5, 0x1021: 0x11a1, 0x1022: 0x4205, 0x1023: 0x4225, 0x1024: 0x4245, 0x1025: 0x11a9, 0x1026: 0x4265, 0x1027: 0x11b1, 0x1028: 0x11b9, 0x1029: 0x10f9, 0x102a: 0x4285, 0x102b: 0x42a5, 0x102c: 0x42c5, 0x102d: 0x42e5, 0x102e: 0x11c1, 0x102f: 0x11c9, 0x1030: 0x11d1, 0x1031: 0x11d9, 0x1032: 0x4305, 0x1033: 0x11e1, 0x1034: 0x11e9, 0x1035: 0x11f1, 0x1036: 0x4325, 0x1037: 0x11f9, 0x1038: 0x1201, 0x1039: 0x11f9, 0x103a: 0x1209, 0x103b: 0x1211, 0x103c: 0x4345, 0x103d: 0x1219, 0x103e: 0x1221, 0x103f: 0x1219, // Block 0x41, offset 0x1040 0x1040: 0x4365, 0x1041: 0x4385, 0x1042: 0x0040, 0x1043: 0x1229, 0x1044: 0x1231, 0x1045: 0x1239, 0x1046: 0x1241, 0x1047: 0x0040, 0x1048: 0x1249, 0x1049: 0x1251, 0x104a: 0x1259, 0x104b: 0x1261, 0x104c: 0x1269, 0x104d: 0x1271, 0x104e: 0x1199, 0x104f: 0x1279, 0x1050: 0x1281, 0x1051: 0x1289, 0x1052: 0x43a5, 0x1053: 0x1291, 0x1054: 0x1121, 0x1055: 0x43c5, 0x1056: 0x43e5, 0x1057: 0x1299, 0x1058: 0x0040, 0x1059: 0x4405, 0x105a: 0x12a1, 0x105b: 0x12a9, 0x105c: 0x12b1, 0x105d: 0x12b9, 0x105e: 0x12c1, 0x105f: 0x12c9, 0x1060: 0x12d1, 0x1061: 0x12d9, 0x1062: 0x12e1, 0x1063: 0x12e9, 0x1064: 0x12f1, 0x1065: 0x12f9, 0x1066: 0x1301, 0x1067: 0x1309, 0x1068: 0x1311, 0x1069: 0x1319, 0x106a: 0x1321, 0x106b: 0x1329, 0x106c: 0x1331, 0x106d: 0x1339, 0x106e: 0x1341, 0x106f: 0x1349, 0x1070: 0x1351, 0x1071: 0x1359, 0x1072: 0x1361, 0x1073: 0x1369, 0x1074: 0x1371, 0x1075: 0x1379, 0x1076: 0x1381, 0x1077: 0x1389, 0x1078: 0x1391, 0x1079: 0x1399, 0x107a: 0x13a1, 0x107b: 0x13a9, 0x107c: 0x13b1, 0x107d: 0x13b9, 0x107e: 0x13c1, 0x107f: 0x4425, // Block 0x42, offset 0x1080 0x1080: 0xe00d, 0x1081: 0x0008, 0x1082: 0xe00d, 0x1083: 0x0008, 0x1084: 0xe00d, 0x1085: 0x0008, 0x1086: 0xe00d, 0x1087: 0x0008, 0x1088: 0xe00d, 0x1089: 0x0008, 0x108a: 0xe00d, 0x108b: 0x0008, 0x108c: 0xe00d, 0x108d: 0x0008, 0x108e: 0xe00d, 0x108f: 0x0008, 0x1090: 0xe00d, 0x1091: 0x0008, 0x1092: 0xe00d, 0x1093: 0x0008, 0x1094: 0xe00d, 0x1095: 0x0008, 0x1096: 0xe00d, 0x1097: 0x0008, 0x1098: 0xe00d, 0x1099: 0x0008, 0x109a: 0xe00d, 0x109b: 0x0008, 0x109c: 0xe00d, 0x109d: 0x0008, 0x109e: 0xe00d, 0x109f: 0x0008, 0x10a0: 0xe00d, 0x10a1: 0x0008, 0x10a2: 0xe00d, 0x10a3: 0x0008, 0x10a4: 0xe00d, 0x10a5: 0x0008, 0x10a6: 0xe00d, 0x10a7: 0x0008, 0x10a8: 0xe00d, 0x10a9: 0x0008, 0x10aa: 0xe00d, 0x10ab: 0x0008, 0x10ac: 0xe00d, 0x10ad: 0x0008, 0x10ae: 0x0008, 0x10af: 0x3308, 0x10b0: 0x3318, 0x10b1: 0x3318, 0x10b2: 0x3318, 0x10b3: 0x0018, 0x10b4: 0x3308, 0x10b5: 0x3308, 0x10b6: 0x3308, 0x10b7: 0x3308, 0x10b8: 0x3308, 0x10b9: 0x3308, 0x10ba: 0x3308, 0x10bb: 0x3308, 0x10bc: 0x3308, 0x10bd: 0x3308, 0x10be: 0x0018, 0x10bf: 0x0008, // Block 0x43, offset 0x10c0 0x10c0: 0xe00d, 0x10c1: 0x0008, 0x10c2: 0xe00d, 0x10c3: 0x0008, 0x10c4: 0xe00d, 0x10c5: 0x0008, 0x10c6: 0xe00d, 0x10c7: 0x0008, 0x10c8: 0xe00d, 0x10c9: 0x0008, 0x10ca: 0xe00d, 0x10cb: 0x0008, 0x10cc: 0xe00d, 0x10cd: 0x0008, 0x10ce: 0xe00d, 0x10cf: 0x0008, 0x10d0: 0xe00d, 0x10d1: 0x0008, 0x10d2: 0xe00d, 0x10d3: 0x0008, 0x10d4: 0xe00d, 0x10d5: 0x0008, 0x10d6: 0xe00d, 0x10d7: 0x0008, 0x10d8: 0xe00d, 0x10d9: 0x0008, 0x10da: 0xe00d, 0x10db: 0x0008, 0x10dc: 0x02d1, 0x10dd: 0x13c9, 0x10de: 0x3308, 0x10df: 0x3308, 0x10e0: 0x0008, 0x10e1: 0x0008, 0x10e2: 0x0008, 0x10e3: 0x0008, 0x10e4: 0x0008, 0x10e5: 0x0008, 0x10e6: 0x0008, 0x10e7: 0x0008, 0x10e8: 0x0008, 0x10e9: 0x0008, 0x10ea: 0x0008, 0x10eb: 0x0008, 0x10ec: 0x0008, 0x10ed: 0x0008, 0x10ee: 0x0008, 0x10ef: 0x0008, 0x10f0: 0x0008, 0x10f1: 0x0008, 0x10f2: 0x0008, 0x10f3: 0x0008, 0x10f4: 0x0008, 0x10f5: 0x0008, 0x10f6: 0x0008, 0x10f7: 0x0008, 0x10f8: 0x0008, 0x10f9: 0x0008, 0x10fa: 0x0008, 0x10fb: 0x0008, 0x10fc: 0x0008, 0x10fd: 0x0008, 0x10fe: 0x0008, 0x10ff: 0x0008, // Block 0x44, offset 0x1100 0x1100: 0x0018, 0x1101: 0x0018, 0x1102: 0x0018, 0x1103: 0x0018, 0x1104: 0x0018, 0x1105: 0x0018, 0x1106: 0x0018, 0x1107: 0x0018, 0x1108: 0x0018, 0x1109: 0x0018, 0x110a: 0x0018, 0x110b: 0x0018, 0x110c: 0x0018, 0x110d: 0x0018, 0x110e: 0x0018, 0x110f: 0x0018, 0x1110: 0x0018, 0x1111: 0x0018, 0x1112: 0x0018, 0x1113: 0x0018, 0x1114: 0x0018, 0x1115: 0x0018, 0x1116: 0x0018, 0x1117: 0x0008, 0x1118: 0x0008, 0x1119: 0x0008, 0x111a: 0x0008, 0x111b: 0x0008, 0x111c: 0x0008, 0x111d: 0x0008, 0x111e: 0x0008, 0x111f: 0x0008, 0x1120: 0x0018, 0x1121: 0x0018, 0x1122: 0xe00d, 0x1123: 0x0008, 0x1124: 0xe00d, 0x1125: 0x0008, 0x1126: 0xe00d, 0x1127: 0x0008, 0x1128: 0xe00d, 0x1129: 0x0008, 0x112a: 0xe00d, 0x112b: 0x0008, 0x112c: 0xe00d, 0x112d: 0x0008, 0x112e: 0xe00d, 0x112f: 0x0008, 0x1130: 0x0008, 0x1131: 0x0008, 0x1132: 0xe00d, 0x1133: 0x0008, 0x1134: 0xe00d, 0x1135: 0x0008, 0x1136: 0xe00d, 0x1137: 0x0008, 0x1138: 0xe00d, 0x1139: 0x0008, 0x113a: 0xe00d, 0x113b: 0x0008, 0x113c: 0xe00d, 0x113d: 0x0008, 0x113e: 0xe00d, 0x113f: 0x0008, // Block 0x45, offset 0x1140 0x1140: 0xe00d, 0x1141: 0x0008, 0x1142: 0xe00d, 0x1143: 0x0008, 0x1144: 0xe00d, 0x1145: 0x0008, 0x1146: 0xe00d, 0x1147: 0x0008, 0x1148: 0xe00d, 0x1149: 0x0008, 0x114a: 0xe00d, 0x114b: 0x0008, 0x114c: 0xe00d, 0x114d: 0x0008, 0x114e: 0xe00d, 0x114f: 0x0008, 0x1150: 0xe00d, 0x1151: 0x0008, 0x1152: 0xe00d, 0x1153: 0x0008, 0x1154: 0xe00d, 0x1155: 0x0008, 0x1156: 0xe00d, 0x1157: 0x0008, 0x1158: 0xe00d, 0x1159: 0x0008, 0x115a: 0xe00d, 0x115b: 0x0008, 0x115c: 0xe00d, 0x115d: 0x0008, 0x115e: 0xe00d, 0x115f: 0x0008, 0x1160: 0xe00d, 0x1161: 0x0008, 0x1162: 0xe00d, 0x1163: 0x0008, 0x1164: 0xe00d, 0x1165: 0x0008, 0x1166: 0xe00d, 0x1167: 0x0008, 0x1168: 0xe00d, 0x1169: 0x0008, 0x116a: 0xe00d, 0x116b: 0x0008, 0x116c: 0xe00d, 0x116d: 0x0008, 0x116e: 0xe00d, 0x116f: 0x0008, 0x1170: 0xe0fd, 0x1171: 0x0008, 0x1172: 0x0008, 0x1173: 0x0008, 0x1174: 0x0008, 0x1175: 0x0008, 0x1176: 0x0008, 0x1177: 0x0008, 0x1178: 0x0008, 0x1179: 0xe01d, 0x117a: 0x0008, 0x117b: 0xe03d, 0x117c: 0x0008, 0x117d: 0x4445, 0x117e: 0xe00d, 0x117f: 0x0008, // Block 0x46, offset 0x1180 0x1180: 0xe00d, 0x1181: 0x0008, 0x1182: 0xe00d, 0x1183: 0x0008, 0x1184: 0xe00d, 0x1185: 0x0008, 0x1186: 0xe00d, 0x1187: 0x0008, 0x1188: 0x0008, 0x1189: 0x0018, 0x118a: 0x0018, 0x118b: 0xe03d, 0x118c: 0x0008, 0x118d: 0x0409, 0x118e: 0x0008, 0x118f: 0x0008, 0x1190: 0xe00d, 0x1191: 0x0008, 0x1192: 0xe00d, 0x1193: 0x0008, 0x1194: 0x0008, 0x1195: 0x0008, 0x1196: 0xe00d, 0x1197: 0x0008, 0x1198: 0xe00d, 0x1199: 0x0008, 0x119a: 0xe00d, 0x119b: 0x0008, 0x119c: 0xe00d, 0x119d: 0x0008, 0x119e: 0xe00d, 0x119f: 0x0008, 0x11a0: 0xe00d, 0x11a1: 0x0008, 0x11a2: 0xe00d, 0x11a3: 0x0008, 0x11a4: 0xe00d, 0x11a5: 0x0008, 0x11a6: 0xe00d, 0x11a7: 0x0008, 0x11a8: 0xe00d, 0x11a9: 0x0008, 0x11aa: 0x13d1, 0x11ab: 0x0371, 0x11ac: 0x0401, 0x11ad: 0x13d9, 0x11ae: 0x0421, 0x11af: 0x0008, 0x11b0: 0x13e1, 0x11b1: 0x13e9, 0x11b2: 0x0429, 0x11b3: 0x4465, 0x11b4: 0xe00d, 0x11b5: 0x0008, 0x11b6: 0xe00d, 0x11b7: 0x0008, 0x11b8: 0xe00d, 0x11b9: 0x0008, 0x11ba: 0xe00d, 0x11bb: 0x0008, 0x11bc: 0xe00d, 0x11bd: 0x0008, 0x11be: 0xe00d, 0x11bf: 0x0008, // Block 0x47, offset 0x11c0 0x11c0: 0x650d, 0x11c1: 0x652d, 0x11c2: 0x654d, 0x11c3: 0x656d, 0x11c4: 0x658d, 0x11c5: 0x65ad, 0x11c6: 0x65cd, 0x11c7: 0x65ed, 0x11c8: 0x660d, 0x11c9: 0x662d, 0x11ca: 0x664d, 0x11cb: 0x666d, 0x11cc: 0x668d, 0x11cd: 0x66ad, 0x11ce: 0x0008, 0x11cf: 0x0008, 0x11d0: 0x66cd, 0x11d1: 0x0008, 0x11d2: 0x66ed, 0x11d3: 0x0008, 0x11d4: 0x0008, 0x11d5: 0x670d, 0x11d6: 0x672d, 0x11d7: 0x674d, 0x11d8: 0x676d, 0x11d9: 0x678d, 0x11da: 0x67ad, 0x11db: 0x67cd, 0x11dc: 0x67ed, 0x11dd: 0x680d, 0x11de: 0x682d, 0x11df: 0x0008, 0x11e0: 0x684d, 0x11e1: 0x0008, 0x11e2: 0x686d, 0x11e3: 0x0008, 0x11e4: 0x0008, 0x11e5: 0x688d, 0x11e6: 0x68ad, 0x11e7: 0x0008, 0x11e8: 0x0008, 0x11e9: 0x0008, 0x11ea: 0x68cd, 0x11eb: 0x68ed, 0x11ec: 0x690d, 0x11ed: 0x692d, 0x11ee: 0x694d, 0x11ef: 0x696d, 0x11f0: 0x698d, 0x11f1: 0x69ad, 0x11f2: 0x69cd, 0x11f3: 0x69ed, 0x11f4: 0x6a0d, 0x11f5: 0x6a2d, 0x11f6: 0x6a4d, 0x11f7: 0x6a6d, 0x11f8: 0x6a8d, 0x11f9: 0x6aad, 0x11fa: 0x6acd, 0x11fb: 0x6aed, 0x11fc: 0x6b0d, 0x11fd: 0x6b2d, 0x11fe: 0x6b4d, 0x11ff: 0x6b6d, // Block 0x48, offset 0x1200 0x1200: 0x7acd, 0x1201: 0x7aed, 0x1202: 0x7b0d, 0x1203: 0x7b2d, 0x1204: 0x7b4d, 0x1205: 0x7b6d, 0x1206: 0x7b8d, 0x1207: 0x7bad, 0x1208: 0x7bcd, 0x1209: 0x7bed, 0x120a: 0x7c0d, 0x120b: 0x7c2d, 0x120c: 0x7c4d, 0x120d: 0x7c6d, 0x120e: 0x7c8d, 0x120f: 0x1409, 0x1210: 0x1411, 0x1211: 0x1419, 0x1212: 0x7cad, 0x1213: 0x7ccd, 0x1214: 0x7ced, 0x1215: 0x1421, 0x1216: 0x1429, 0x1217: 0x1431, 0x1218: 0x7d0d, 0x1219: 0x7d2d, 0x121a: 0x0040, 0x121b: 0x0040, 0x121c: 0x0040, 0x121d: 0x0040, 0x121e: 0x0040, 0x121f: 0x0040, 0x1220: 0x0040, 0x1221: 0x0040, 0x1222: 0x0040, 0x1223: 0x0040, 0x1224: 0x0040, 0x1225: 0x0040, 0x1226: 0x0040, 0x1227: 0x0040, 0x1228: 0x0040, 0x1229: 0x0040, 0x122a: 0x0040, 0x122b: 0x0040, 0x122c: 0x0040, 0x122d: 0x0040, 0x122e: 0x0040, 0x122f: 0x0040, 0x1230: 0x0040, 0x1231: 0x0040, 0x1232: 0x0040, 0x1233: 0x0040, 0x1234: 0x0040, 0x1235: 0x0040, 0x1236: 0x0040, 0x1237: 0x0040, 0x1238: 0x0040, 0x1239: 0x0040, 0x123a: 0x0040, 0x123b: 0x0040, 0x123c: 0x0040, 0x123d: 0x0040, 0x123e: 0x0040, 0x123f: 0x0040, // Block 0x49, offset 0x1240 0x1240: 0x1439, 0x1241: 0x1441, 0x1242: 0x1449, 0x1243: 0x7d4d, 0x1244: 0x7d6d, 0x1245: 0x1451, 0x1246: 0x1451, 0x1247: 0x0040, 0x1248: 0x0040, 0x1249: 0x0040, 0x124a: 0x0040, 0x124b: 0x0040, 0x124c: 0x0040, 0x124d: 0x0040, 0x124e: 0x0040, 0x124f: 0x0040, 0x1250: 0x0040, 0x1251: 0x0040, 0x1252: 0x0040, 0x1253: 0x1459, 0x1254: 0x1461, 0x1255: 0x1469, 0x1256: 0x1471, 0x1257: 0x1479, 0x1258: 0x0040, 0x1259: 0x0040, 0x125a: 0x0040, 0x125b: 0x0040, 0x125c: 0x0040, 0x125d: 0x1481, 0x125e: 0x3308, 0x125f: 0x1489, 0x1260: 0x1491, 0x1261: 0x0779, 0x1262: 0x0791, 0x1263: 0x1499, 0x1264: 0x14a1, 0x1265: 0x14a9, 0x1266: 0x14b1, 0x1267: 0x14b9, 0x1268: 0x14c1, 0x1269: 0x071a, 0x126a: 0x14c9, 0x126b: 0x14d1, 0x126c: 0x14d9, 0x126d: 0x14e1, 0x126e: 0x14e9, 0x126f: 0x14f1, 0x1270: 0x14f9, 0x1271: 0x1501, 0x1272: 0x1509, 0x1273: 0x1511, 0x1274: 0x1519, 0x1275: 0x1521, 0x1276: 0x1529, 0x1277: 0x0040, 0x1278: 0x1531, 0x1279: 0x1539, 0x127a: 0x1541, 0x127b: 0x1549, 0x127c: 0x1551, 0x127d: 0x0040, 0x127e: 0x1559, 0x127f: 0x0040, // Block 0x4a, offset 0x1280 0x1280: 0x1561, 0x1281: 0x1569, 0x1282: 0x0040, 0x1283: 0x1571, 0x1284: 0x1579, 0x1285: 0x0040, 0x1286: 0x1581, 0x1287: 0x1589, 0x1288: 0x1591, 0x1289: 0x1599, 0x128a: 0x15a1, 0x128b: 0x15a9, 0x128c: 0x15b1, 0x128d: 0x15b9, 0x128e: 0x15c1, 0x128f: 0x15c9, 0x1290: 0x15d1, 0x1291: 0x15d1, 0x1292: 0x15d9, 0x1293: 0x15d9, 0x1294: 0x15d9, 0x1295: 0x15d9, 0x1296: 0x15e1, 0x1297: 0x15e1, 0x1298: 0x15e1, 0x1299: 0x15e1, 0x129a: 0x15e9, 0x129b: 0x15e9, 0x129c: 0x15e9, 0x129d: 0x15e9, 0x129e: 0x15f1, 0x129f: 0x15f1, 0x12a0: 0x15f1, 0x12a1: 0x15f1, 0x12a2: 0x15f9, 0x12a3: 0x15f9, 0x12a4: 0x15f9, 0x12a5: 0x15f9, 0x12a6: 0x1601, 0x12a7: 0x1601, 0x12a8: 0x1601, 0x12a9: 0x1601, 0x12aa: 0x1609, 0x12ab: 0x1609, 0x12ac: 0x1609, 0x12ad: 0x1609, 0x12ae: 0x1611, 0x12af: 0x1611, 0x12b0: 0x1611, 0x12b1: 0x1611, 0x12b2: 0x1619, 0x12b3: 0x1619, 0x12b4: 0x1619, 0x12b5: 0x1619, 0x12b6: 0x1621, 0x12b7: 0x1621, 0x12b8: 0x1621, 0x12b9: 0x1621, 0x12ba: 0x1629, 0x12bb: 0x1629, 0x12bc: 0x1629, 0x12bd: 0x1629, 0x12be: 0x1631, 0x12bf: 0x1631, // Block 0x4b, offset 0x12c0 0x12c0: 0x1631, 0x12c1: 0x1631, 0x12c2: 0x1639, 0x12c3: 0x1639, 0x12c4: 0x1641, 0x12c5: 0x1641, 0x12c6: 0x1649, 0x12c7: 0x1649, 0x12c8: 0x1651, 0x12c9: 0x1651, 0x12ca: 0x1659, 0x12cb: 0x1659, 0x12cc: 0x1661, 0x12cd: 0x1661, 0x12ce: 0x1669, 0x12cf: 0x1669, 0x12d0: 0x1669, 0x12d1: 0x1669, 0x12d2: 0x1671, 0x12d3: 0x1671, 0x12d4: 0x1671, 0x12d5: 0x1671, 0x12d6: 0x1679, 0x12d7: 0x1679, 0x12d8: 0x1679, 0x12d9: 0x1679, 0x12da: 0x1681, 0x12db: 0x1681, 0x12dc: 0x1681, 0x12dd: 0x1681, 0x12de: 0x1689, 0x12df: 0x1689, 0x12e0: 0x1691, 0x12e1: 0x1691, 0x12e2: 0x1691, 0x12e3: 0x1691, 0x12e4: 0x1699, 0x12e5: 0x1699, 0x12e6: 0x16a1, 0x12e7: 0x16a1, 0x12e8: 0x16a1, 0x12e9: 0x16a1, 0x12ea: 0x16a9, 0x12eb: 0x16a9, 0x12ec: 0x16a9, 0x12ed: 0x16a9, 0x12ee: 0x16b1, 0x12ef: 0x16b1, 0x12f0: 0x16b9, 0x12f1: 0x16b9, 0x12f2: 0x0818, 0x12f3: 0x0818, 0x12f4: 0x0818, 0x12f5: 0x0818, 0x12f6: 0x0818, 0x12f7: 0x0818, 0x12f8: 0x0818, 0x12f9: 0x0818, 0x12fa: 0x0818, 0x12fb: 0x0818, 0x12fc: 0x0818, 0x12fd: 0x0818, 0x12fe: 0x0818, 0x12ff: 0x0818, // Block 0x4c, offset 0x1300 0x1300: 0x0818, 0x1301: 0x0818, 0x1302: 0x0040, 0x1303: 0x0040, 0x1304: 0x0040, 0x1305: 0x0040, 0x1306: 0x0040, 0x1307: 0x0040, 0x1308: 0x0040, 0x1309: 0x0040, 0x130a: 0x0040, 0x130b: 0x0040, 0x130c: 0x0040, 0x130d: 0x0040, 0x130e: 0x0040, 0x130f: 0x0040, 0x1310: 0x0040, 0x1311: 0x0040, 0x1312: 0x0040, 0x1313: 0x16c1, 0x1314: 0x16c1, 0x1315: 0x16c1, 0x1316: 0x16c1, 0x1317: 0x16c9, 0x1318: 0x16c9, 0x1319: 0x16d1, 0x131a: 0x16d1, 0x131b: 0x16d9, 0x131c: 0x16d9, 0x131d: 0x0149, 0x131e: 0x16e1, 0x131f: 0x16e1, 0x1320: 0x16e9, 0x1321: 0x16e9, 0x1322: 0x16f1, 0x1323: 0x16f1, 0x1324: 0x16f9, 0x1325: 0x16f9, 0x1326: 0x16f9, 0x1327: 0x16f9, 0x1328: 0x1701, 0x1329: 0x1701, 0x132a: 0x1709, 0x132b: 0x1709, 0x132c: 0x1711, 0x132d: 0x1711, 0x132e: 0x1719, 0x132f: 0x1719, 0x1330: 0x1721, 0x1331: 0x1721, 0x1332: 0x1729, 0x1333: 0x1729, 0x1334: 0x1731, 0x1335: 0x1731, 0x1336: 0x1739, 0x1337: 0x1739, 0x1338: 0x1739, 0x1339: 0x1741, 0x133a: 0x1741, 0x133b: 0x1741, 0x133c: 0x1749, 0x133d: 0x1749, 0x133e: 0x1749, 0x133f: 0x1749, // Block 0x4d, offset 0x1340 0x1340: 0x1949, 0x1341: 0x1951, 0x1342: 0x1959, 0x1343: 0x1961, 0x1344: 0x1969, 0x1345: 0x1971, 0x1346: 0x1979, 0x1347: 0x1981, 0x1348: 0x1989, 0x1349: 0x1991, 0x134a: 0x1999, 0x134b: 0x19a1, 0x134c: 0x19a9, 0x134d: 0x19b1, 0x134e: 0x19b9, 0x134f: 0x19c1, 0x1350: 0x19c9, 0x1351: 0x19d1, 0x1352: 0x19d9, 0x1353: 0x19e1, 0x1354: 0x19e9, 0x1355: 0x19f1, 0x1356: 0x19f9, 0x1357: 0x1a01, 0x1358: 0x1a09, 0x1359: 0x1a11, 0x135a: 0x1a19, 0x135b: 0x1a21, 0x135c: 0x1a29, 0x135d: 0x1a31, 0x135e: 0x1a3a, 0x135f: 0x1a42, 0x1360: 0x1a4a, 0x1361: 0x1a52, 0x1362: 0x1a5a, 0x1363: 0x1a62, 0x1364: 0x1a69, 0x1365: 0x1a71, 0x1366: 0x1761, 0x1367: 0x1a79, 0x1368: 0x1741, 0x1369: 0x1769, 0x136a: 0x1a81, 0x136b: 0x1a89, 0x136c: 0x1789, 0x136d: 0x1a91, 0x136e: 0x1791, 0x136f: 0x1799, 0x1370: 0x1a99, 0x1371: 0x1aa1, 0x1372: 0x17b9, 0x1373: 0x1aa9, 0x1374: 0x17c1, 0x1375: 0x17c9, 0x1376: 0x1ab1, 0x1377: 0x1ab9, 0x1378: 0x17d9, 0x1379: 0x1ac1, 0x137a: 0x17e1, 0x137b: 0x17e9, 0x137c: 0x18d1, 0x137d: 0x18d9, 0x137e: 0x18f1, 0x137f: 0x18f9, // Block 0x4e, offset 0x1380 0x1380: 0x1901, 0x1381: 0x1921, 0x1382: 0x1929, 0x1383: 0x1931, 0x1384: 0x1939, 0x1385: 0x1959, 0x1386: 0x1961, 0x1387: 0x1969, 0x1388: 0x1ac9, 0x1389: 0x1989, 0x138a: 0x1ad1, 0x138b: 0x1ad9, 0x138c: 0x19b9, 0x138d: 0x1ae1, 0x138e: 0x19c1, 0x138f: 0x19c9, 0x1390: 0x1a31, 0x1391: 0x1ae9, 0x1392: 0x1af1, 0x1393: 0x1a09, 0x1394: 0x1af9, 0x1395: 0x1a11, 0x1396: 0x1a19, 0x1397: 0x1751, 0x1398: 0x1759, 0x1399: 0x1b01, 0x139a: 0x1761, 0x139b: 0x1b09, 0x139c: 0x1771, 0x139d: 0x1779, 0x139e: 0x1781, 0x139f: 0x1789, 0x13a0: 0x1b11, 0x13a1: 0x17a1, 0x13a2: 0x17a9, 0x13a3: 0x17b1, 0x13a4: 0x17b9, 0x13a5: 0x1b19, 0x13a6: 0x17d9, 0x13a7: 0x17f1, 0x13a8: 0x17f9, 0x13a9: 0x1801, 0x13aa: 0x1809, 0x13ab: 0x1811, 0x13ac: 0x1821, 0x13ad: 0x1829, 0x13ae: 0x1831, 0x13af: 0x1839, 0x13b0: 0x1841, 0x13b1: 0x1849, 0x13b2: 0x1b21, 0x13b3: 0x1851, 0x13b4: 0x1859, 0x13b5: 0x1861, 0x13b6: 0x1869, 0x13b7: 0x1871, 0x13b8: 0x1879, 0x13b9: 0x1889, 0x13ba: 0x1891, 0x13bb: 0x1899, 0x13bc: 0x18a1, 0x13bd: 0x18a9, 0x13be: 0x18b1, 0x13bf: 0x18b9, // Block 0x4f, offset 0x13c0 0x13c0: 0x18c1, 0x13c1: 0x18c9, 0x13c2: 0x18e1, 0x13c3: 0x18e9, 0x13c4: 0x1909, 0x13c5: 0x1911, 0x13c6: 0x1919, 0x13c7: 0x1921, 0x13c8: 0x1929, 0x13c9: 0x1941, 0x13ca: 0x1949, 0x13cb: 0x1951, 0x13cc: 0x1959, 0x13cd: 0x1b29, 0x13ce: 0x1971, 0x13cf: 0x1979, 0x13d0: 0x1981, 0x13d1: 0x1989, 0x13d2: 0x19a1, 0x13d3: 0x19a9, 0x13d4: 0x19b1, 0x13d5: 0x19b9, 0x13d6: 0x1b31, 0x13d7: 0x19d1, 0x13d8: 0x19d9, 0x13d9: 0x1b39, 0x13da: 0x19f1, 0x13db: 0x19f9, 0x13dc: 0x1a01, 0x13dd: 0x1a09, 0x13de: 0x1b41, 0x13df: 0x1761, 0x13e0: 0x1b09, 0x13e1: 0x1789, 0x13e2: 0x1b11, 0x13e3: 0x17b9, 0x13e4: 0x1b19, 0x13e5: 0x17d9, 0x13e6: 0x1b49, 0x13e7: 0x1841, 0x13e8: 0x1b51, 0x13e9: 0x1b59, 0x13ea: 0x1b61, 0x13eb: 0x1921, 0x13ec: 0x1929, 0x13ed: 0x1959, 0x13ee: 0x19b9, 0x13ef: 0x1b31, 0x13f0: 0x1a09, 0x13f1: 0x1b41, 0x13f2: 0x1b69, 0x13f3: 0x1b71, 0x13f4: 0x1b79, 0x13f5: 0x1b81, 0x13f6: 0x1b89, 0x13f7: 0x1b91, 0x13f8: 0x1b99, 0x13f9: 0x1ba1, 0x13fa: 0x1ba9, 0x13fb: 0x1bb1, 0x13fc: 0x1bb9, 0x13fd: 0x1bc1, 0x13fe: 0x1bc9, 0x13ff: 0x1bd1, // Block 0x50, offset 0x1400 0x1400: 0x1bd9, 0x1401: 0x1be1, 0x1402: 0x1be9, 0x1403: 0x1bf1, 0x1404: 0x1bf9, 0x1405: 0x1c01, 0x1406: 0x1c09, 0x1407: 0x1c11, 0x1408: 0x1c19, 0x1409: 0x1c21, 0x140a: 0x1c29, 0x140b: 0x1c31, 0x140c: 0x1b59, 0x140d: 0x1c39, 0x140e: 0x1c41, 0x140f: 0x1c49, 0x1410: 0x1c51, 0x1411: 0x1b81, 0x1412: 0x1b89, 0x1413: 0x1b91, 0x1414: 0x1b99, 0x1415: 0x1ba1, 0x1416: 0x1ba9, 0x1417: 0x1bb1, 0x1418: 0x1bb9, 0x1419: 0x1bc1, 0x141a: 0x1bc9, 0x141b: 0x1bd1, 0x141c: 0x1bd9, 0x141d: 0x1be1, 0x141e: 0x1be9, 0x141f: 0x1bf1, 0x1420: 0x1bf9, 0x1421: 0x1c01, 0x1422: 0x1c09, 0x1423: 0x1c11, 0x1424: 0x1c19, 0x1425: 0x1c21, 0x1426: 0x1c29, 0x1427: 0x1c31, 0x1428: 0x1b59, 0x1429: 0x1c39, 0x142a: 0x1c41, 0x142b: 0x1c49, 0x142c: 0x1c51, 0x142d: 0x1c21, 0x142e: 0x1c29, 0x142f: 0x1c31, 0x1430: 0x1b59, 0x1431: 0x1b51, 0x1432: 0x1b61, 0x1433: 0x1881, 0x1434: 0x1829, 0x1435: 0x1831, 0x1436: 0x1839, 0x1437: 0x1c21, 0x1438: 0x1c29, 0x1439: 0x1c31, 0x143a: 0x1881, 0x143b: 0x1889, 0x143c: 0x1c59, 0x143d: 0x1c59, 0x143e: 0x0018, 0x143f: 0x0018, // Block 0x51, offset 0x1440 0x1440: 0x0040, 0x1441: 0x0040, 0x1442: 0x0040, 0x1443: 0x0040, 0x1444: 0x0040, 0x1445: 0x0040, 0x1446: 0x0040, 0x1447: 0x0040, 0x1448: 0x0040, 0x1449: 0x0040, 0x144a: 0x0040, 0x144b: 0x0040, 0x144c: 0x0040, 0x144d: 0x0040, 0x144e: 0x0040, 0x144f: 0x0040, 0x1450: 0x1c61, 0x1451: 0x1c69, 0x1452: 0x1c69, 0x1453: 0x1c71, 0x1454: 0x1c79, 0x1455: 0x1c81, 0x1456: 0x1c89, 0x1457: 0x1c91, 0x1458: 0x1c99, 0x1459: 0x1c99, 0x145a: 0x1ca1, 0x145b: 0x1ca9, 0x145c: 0x1cb1, 0x145d: 0x1cb9, 0x145e: 0x1cc1, 0x145f: 0x1cc9, 0x1460: 0x1cc9, 0x1461: 0x1cd1, 0x1462: 0x1cd9, 0x1463: 0x1cd9, 0x1464: 0x1ce1, 0x1465: 0x1ce1, 0x1466: 0x1ce9, 0x1467: 0x1cf1, 0x1468: 0x1cf1, 0x1469: 0x1cf9, 0x146a: 0x1d01, 0x146b: 0x1d01, 0x146c: 0x1d09, 0x146d: 0x1d09, 0x146e: 0x1d11, 0x146f: 0x1d19, 0x1470: 0x1d19, 0x1471: 0x1d21, 0x1472: 0x1d21, 0x1473: 0x1d29, 0x1474: 0x1d31, 0x1475: 0x1d39, 0x1476: 0x1d41, 0x1477: 0x1d41, 0x1478: 0x1d49, 0x1479: 0x1d51, 0x147a: 0x1d59, 0x147b: 0x1d61, 0x147c: 0x1d69, 0x147d: 0x1d69, 0x147e: 0x1d71, 0x147f: 0x1d79, // Block 0x52, offset 0x1480 0x1480: 0x1f29, 0x1481: 0x1f31, 0x1482: 0x1f39, 0x1483: 0x1f11, 0x1484: 0x1d39, 0x1485: 0x1ce9, 0x1486: 0x1f41, 0x1487: 0x1f49, 0x1488: 0x0040, 0x1489: 0x0040, 0x148a: 0x0040, 0x148b: 0x0040, 0x148c: 0x0040, 0x148d: 0x0040, 0x148e: 0x0040, 0x148f: 0x0040, 0x1490: 0x0040, 0x1491: 0x0040, 0x1492: 0x0040, 0x1493: 0x0040, 0x1494: 0x0040, 0x1495: 0x0040, 0x1496: 0x0040, 0x1497: 0x0040, 0x1498: 0x0040, 0x1499: 0x0040, 0x149a: 0x0040, 0x149b: 0x0040, 0x149c: 0x0040, 0x149d: 0x0040, 0x149e: 0x0040, 0x149f: 0x0040, 0x14a0: 0x0040, 0x14a1: 0x0040, 0x14a2: 0x0040, 0x14a3: 0x0040, 0x14a4: 0x0040, 0x14a5: 0x0040, 0x14a6: 0x0040, 0x14a7: 0x0040, 0x14a8: 0x0040, 0x14a9: 0x0040, 0x14aa: 0x0040, 0x14ab: 0x0040, 0x14ac: 0x0040, 0x14ad: 0x0040, 0x14ae: 0x0040, 0x14af: 0x0040, 0x14b0: 0x1f51, 0x14b1: 0x1f59, 0x14b2: 0x1f61, 0x14b3: 0x1f69, 0x14b4: 0x1f71, 0x14b5: 0x1f79, 0x14b6: 0x1f81, 0x14b7: 0x1f89, 0x14b8: 0x1f91, 0x14b9: 0x1f99, 0x14ba: 0x1fa2, 0x14bb: 0x1faa, 0x14bc: 0x1fb1, 0x14bd: 0x0018, 0x14be: 0x0040, 0x14bf: 0x0040, // Block 0x53, offset 0x14c0 0x14c0: 0x33c0, 0x14c1: 0x33c0, 0x14c2: 0x33c0, 0x14c3: 0x33c0, 0x14c4: 0x33c0, 0x14c5: 0x33c0, 0x14c6: 0x33c0, 0x14c7: 0x33c0, 0x14c8: 0x33c0, 0x14c9: 0x33c0, 0x14ca: 0x33c0, 0x14cb: 0x33c0, 0x14cc: 0x33c0, 0x14cd: 0x33c0, 0x14ce: 0x33c0, 0x14cf: 0x33c0, 0x14d0: 0x1fba, 0x14d1: 0x7d8d, 0x14d2: 0x0040, 0x14d3: 0x1fc2, 0x14d4: 0x0122, 0x14d5: 0x1fca, 0x14d6: 0x1fd2, 0x14d7: 0x7dad, 0x14d8: 0x7dcd, 0x14d9: 0x0040, 0x14da: 0x0040, 0x14db: 0x0040, 0x14dc: 0x0040, 0x14dd: 0x0040, 0x14de: 0x0040, 0x14df: 0x0040, 0x14e0: 0x3308, 0x14e1: 0x3308, 0x14e2: 0x3308, 0x14e3: 0x3308, 0x14e4: 0x3308, 0x14e5: 0x3308, 0x14e6: 0x3308, 0x14e7: 0x3308, 0x14e8: 0x3308, 0x14e9: 0x3308, 0x14ea: 0x3308, 0x14eb: 0x3308, 0x14ec: 0x3308, 0x14ed: 0x3308, 0x14ee: 0x3308, 0x14ef: 0x3308, 0x14f0: 0x0040, 0x14f1: 0x7ded, 0x14f2: 0x7e0d, 0x14f3: 0x1fda, 0x14f4: 0x1fda, 0x14f5: 0x072a, 0x14f6: 0x0732, 0x14f7: 0x1fe2, 0x14f8: 0x1fea, 0x14f9: 0x7e2d, 0x14fa: 0x7e4d, 0x14fb: 0x7e6d, 0x14fc: 0x7e2d, 0x14fd: 0x7e8d, 0x14fe: 0x7ead, 0x14ff: 0x7e8d, // Block 0x54, offset 0x1500 0x1500: 0x7ecd, 0x1501: 0x7eed, 0x1502: 0x7f0d, 0x1503: 0x7eed, 0x1504: 0x7f2d, 0x1505: 0x0018, 0x1506: 0x0018, 0x1507: 0x1ff2, 0x1508: 0x1ffa, 0x1509: 0x7f4e, 0x150a: 0x7f6e, 0x150b: 0x7f8e, 0x150c: 0x7fae, 0x150d: 0x1fda, 0x150e: 0x1fda, 0x150f: 0x1fda, 0x1510: 0x1fba, 0x1511: 0x7fcd, 0x1512: 0x0040, 0x1513: 0x0040, 0x1514: 0x0122, 0x1515: 0x1fc2, 0x1516: 0x1fd2, 0x1517: 0x1fca, 0x1518: 0x7fed, 0x1519: 0x072a, 0x151a: 0x0732, 0x151b: 0x1fe2, 0x151c: 0x1fea, 0x151d: 0x7ecd, 0x151e: 0x7f2d, 0x151f: 0x2002, 0x1520: 0x200a, 0x1521: 0x2012, 0x1522: 0x071a, 0x1523: 0x2019, 0x1524: 0x2022, 0x1525: 0x202a, 0x1526: 0x0722, 0x1527: 0x0040, 0x1528: 0x2032, 0x1529: 0x203a, 0x152a: 0x2042, 0x152b: 0x204a, 0x152c: 0x0040, 0x152d: 0x0040, 0x152e: 0x0040, 0x152f: 0x0040, 0x1530: 0x800e, 0x1531: 0x2051, 0x1532: 0x802e, 0x1533: 0x0808, 0x1534: 0x804e, 0x1535: 0x0040, 0x1536: 0x806e, 0x1537: 0x2059, 0x1538: 0x808e, 0x1539: 0x2061, 0x153a: 0x80ae, 0x153b: 0x2069, 0x153c: 0x80ce, 0x153d: 0x2071, 0x153e: 0x80ee, 0x153f: 0x2079, // Block 0x55, offset 0x1540 0x1540: 0x2081, 0x1541: 0x2089, 0x1542: 0x2089, 0x1543: 0x2091, 0x1544: 0x2091, 0x1545: 0x2099, 0x1546: 0x2099, 0x1547: 0x20a1, 0x1548: 0x20a1, 0x1549: 0x20a9, 0x154a: 0x20a9, 0x154b: 0x20a9, 0x154c: 0x20a9, 0x154d: 0x20b1, 0x154e: 0x20b1, 0x154f: 0x20b9, 0x1550: 0x20b9, 0x1551: 0x20b9, 0x1552: 0x20b9, 0x1553: 0x20c1, 0x1554: 0x20c1, 0x1555: 0x20c9, 0x1556: 0x20c9, 0x1557: 0x20c9, 0x1558: 0x20c9, 0x1559: 0x20d1, 0x155a: 0x20d1, 0x155b: 0x20d1, 0x155c: 0x20d1, 0x155d: 0x20d9, 0x155e: 0x20d9, 0x155f: 0x20d9, 0x1560: 0x20d9, 0x1561: 0x20e1, 0x1562: 0x20e1, 0x1563: 0x20e1, 0x1564: 0x20e1, 0x1565: 0x20e9, 0x1566: 0x20e9, 0x1567: 0x20e9, 0x1568: 0x20e9, 0x1569: 0x20f1, 0x156a: 0x20f1, 0x156b: 0x20f9, 0x156c: 0x20f9, 0x156d: 0x2101, 0x156e: 0x2101, 0x156f: 0x2109, 0x1570: 0x2109, 0x1571: 0x2111, 0x1572: 0x2111, 0x1573: 0x2111, 0x1574: 0x2111, 0x1575: 0x2119, 0x1576: 0x2119, 0x1577: 0x2119, 0x1578: 0x2119, 0x1579: 0x2121, 0x157a: 0x2121, 0x157b: 0x2121, 0x157c: 0x2121, 0x157d: 0x2129, 0x157e: 0x2129, 0x157f: 0x2129, // Block 0x56, offset 0x1580 0x1580: 0x2129, 0x1581: 0x2131, 0x1582: 0x2131, 0x1583: 0x2131, 0x1584: 0x2131, 0x1585: 0x2139, 0x1586: 0x2139, 0x1587: 0x2139, 0x1588: 0x2139, 0x1589: 0x2141, 0x158a: 0x2141, 0x158b: 0x2141, 0x158c: 0x2141, 0x158d: 0x2149, 0x158e: 0x2149, 0x158f: 0x2149, 0x1590: 0x2149, 0x1591: 0x2151, 0x1592: 0x2151, 0x1593: 0x2151, 0x1594: 0x2151, 0x1595: 0x2159, 0x1596: 0x2159, 0x1597: 0x2159, 0x1598: 0x2159, 0x1599: 0x2161, 0x159a: 0x2161, 0x159b: 0x2161, 0x159c: 0x2161, 0x159d: 0x2169, 0x159e: 0x2169, 0x159f: 0x2169, 0x15a0: 0x2169, 0x15a1: 0x2171, 0x15a2: 0x2171, 0x15a3: 0x2171, 0x15a4: 0x2171, 0x15a5: 0x2179, 0x15a6: 0x2179, 0x15a7: 0x2179, 0x15a8: 0x2179, 0x15a9: 0x2181, 0x15aa: 0x2181, 0x15ab: 0x2181, 0x15ac: 0x2181, 0x15ad: 0x2189, 0x15ae: 0x2189, 0x15af: 0x1701, 0x15b0: 0x1701, 0x15b1: 0x2191, 0x15b2: 0x2191, 0x15b3: 0x2191, 0x15b4: 0x2191, 0x15b5: 0x2199, 0x15b6: 0x2199, 0x15b7: 0x21a1, 0x15b8: 0x21a1, 0x15b9: 0x21a9, 0x15ba: 0x21a9, 0x15bb: 0x21b1, 0x15bc: 0x21b1, 0x15bd: 0x0040, 0x15be: 0x0040, 0x15bf: 0x03c0, // Block 0x57, offset 0x15c0 0x15c0: 0x0040, 0x15c1: 0x1fca, 0x15c2: 0x21ba, 0x15c3: 0x2002, 0x15c4: 0x203a, 0x15c5: 0x2042, 0x15c6: 0x200a, 0x15c7: 0x21c2, 0x15c8: 0x072a, 0x15c9: 0x0732, 0x15ca: 0x2012, 0x15cb: 0x071a, 0x15cc: 0x1fba, 0x15cd: 0x2019, 0x15ce: 0x0961, 0x15cf: 0x21ca, 0x15d0: 0x06e1, 0x15d1: 0x0049, 0x15d2: 0x0029, 0x15d3: 0x0031, 0x15d4: 0x06e9, 0x15d5: 0x06f1, 0x15d6: 0x06f9, 0x15d7: 0x0701, 0x15d8: 0x0709, 0x15d9: 0x0711, 0x15da: 0x1fc2, 0x15db: 0x0122, 0x15dc: 0x2022, 0x15dd: 0x0722, 0x15de: 0x202a, 0x15df: 0x1fd2, 0x15e0: 0x204a, 0x15e1: 0x0019, 0x15e2: 0x02e9, 0x15e3: 0x03d9, 0x15e4: 0x02f1, 0x15e5: 0x02f9, 0x15e6: 0x03f1, 0x15e7: 0x0309, 0x15e8: 0x00a9, 0x15e9: 0x0311, 0x15ea: 0x00b1, 0x15eb: 0x0319, 0x15ec: 0x0101, 0x15ed: 0x0321, 0x15ee: 0x0329, 0x15ef: 0x0051, 0x15f0: 0x0339, 0x15f1: 0x0751, 0x15f2: 0x00b9, 0x15f3: 0x0089, 0x15f4: 0x0341, 0x15f5: 0x0349, 0x15f6: 0x0391, 0x15f7: 0x00c1, 0x15f8: 0x0109, 0x15f9: 0x00c9, 0x15fa: 0x04b1, 0x15fb: 0x1ff2, 0x15fc: 0x2032, 0x15fd: 0x1ffa, 0x15fe: 0x21d2, 0x15ff: 0x1fda, // Block 0x58, offset 0x1600 0x1600: 0x0672, 0x1601: 0x0019, 0x1602: 0x02e9, 0x1603: 0x03d9, 0x1604: 0x02f1, 0x1605: 0x02f9, 0x1606: 0x03f1, 0x1607: 0x0309, 0x1608: 0x00a9, 0x1609: 0x0311, 0x160a: 0x00b1, 0x160b: 0x0319, 0x160c: 0x0101, 0x160d: 0x0321, 0x160e: 0x0329, 0x160f: 0x0051, 0x1610: 0x0339, 0x1611: 0x0751, 0x1612: 0x00b9, 0x1613: 0x0089, 0x1614: 0x0341, 0x1615: 0x0349, 0x1616: 0x0391, 0x1617: 0x00c1, 0x1618: 0x0109, 0x1619: 0x00c9, 0x161a: 0x04b1, 0x161b: 0x1fe2, 0x161c: 0x21da, 0x161d: 0x1fea, 0x161e: 0x21e2, 0x161f: 0x810d, 0x1620: 0x812d, 0x1621: 0x0961, 0x1622: 0x814d, 0x1623: 0x814d, 0x1624: 0x816d, 0x1625: 0x818d, 0x1626: 0x81ad, 0x1627: 0x81cd, 0x1628: 0x81ed, 0x1629: 0x820d, 0x162a: 0x822d, 0x162b: 0x824d, 0x162c: 0x826d, 0x162d: 0x828d, 0x162e: 0x82ad, 0x162f: 0x82cd, 0x1630: 0x82ed, 0x1631: 0x830d, 0x1632: 0x832d, 0x1633: 0x834d, 0x1634: 0x836d, 0x1635: 0x838d, 0x1636: 0x83ad, 0x1637: 0x83cd, 0x1638: 0x83ed, 0x1639: 0x840d, 0x163a: 0x842d, 0x163b: 0x844d, 0x163c: 0x81ed, 0x163d: 0x846d, 0x163e: 0x848d, 0x163f: 0x824d, // Block 0x59, offset 0x1640 0x1640: 0x84ad, 0x1641: 0x84cd, 0x1642: 0x84ed, 0x1643: 0x850d, 0x1644: 0x852d, 0x1645: 0x854d, 0x1646: 0x856d, 0x1647: 0x858d, 0x1648: 0x850d, 0x1649: 0x85ad, 0x164a: 0x850d, 0x164b: 0x85cd, 0x164c: 0x85cd, 0x164d: 0x85ed, 0x164e: 0x85ed, 0x164f: 0x860d, 0x1650: 0x854d, 0x1651: 0x862d, 0x1652: 0x864d, 0x1653: 0x862d, 0x1654: 0x866d, 0x1655: 0x864d, 0x1656: 0x868d, 0x1657: 0x868d, 0x1658: 0x86ad, 0x1659: 0x86ad, 0x165a: 0x86cd, 0x165b: 0x86cd, 0x165c: 0x864d, 0x165d: 0x814d, 0x165e: 0x86ed, 0x165f: 0x870d, 0x1660: 0x0040, 0x1661: 0x872d, 0x1662: 0x874d, 0x1663: 0x876d, 0x1664: 0x878d, 0x1665: 0x876d, 0x1666: 0x87ad, 0x1667: 0x87cd, 0x1668: 0x87ed, 0x1669: 0x87ed, 0x166a: 0x880d, 0x166b: 0x880d, 0x166c: 0x882d, 0x166d: 0x882d, 0x166e: 0x880d, 0x166f: 0x880d, 0x1670: 0x884d, 0x1671: 0x886d, 0x1672: 0x888d, 0x1673: 0x88ad, 0x1674: 0x88cd, 0x1675: 0x88ed, 0x1676: 0x88ed, 0x1677: 0x88ed, 0x1678: 0x890d, 0x1679: 0x890d, 0x167a: 0x890d, 0x167b: 0x890d, 0x167c: 0x87ed, 0x167d: 0x87ed, 0x167e: 0x87ed, 0x167f: 0x0040, // Block 0x5a, offset 0x1680 0x1680: 0x0040, 0x1681: 0x0040, 0x1682: 0x874d, 0x1683: 0x872d, 0x1684: 0x892d, 0x1685: 0x872d, 0x1686: 0x874d, 0x1687: 0x872d, 0x1688: 0x0040, 0x1689: 0x0040, 0x168a: 0x894d, 0x168b: 0x874d, 0x168c: 0x896d, 0x168d: 0x892d, 0x168e: 0x896d, 0x168f: 0x874d, 0x1690: 0x0040, 0x1691: 0x0040, 0x1692: 0x898d, 0x1693: 0x89ad, 0x1694: 0x88ad, 0x1695: 0x896d, 0x1696: 0x892d, 0x1697: 0x896d, 0x1698: 0x0040, 0x1699: 0x0040, 0x169a: 0x89cd, 0x169b: 0x89ed, 0x169c: 0x89cd, 0x169d: 0x0040, 0x169e: 0x0040, 0x169f: 0x0040, 0x16a0: 0x21e9, 0x16a1: 0x21f1, 0x16a2: 0x21f9, 0x16a3: 0x8a0e, 0x16a4: 0x2201, 0x16a5: 0x2209, 0x16a6: 0x8a2d, 0x16a7: 0x0040, 0x16a8: 0x8a4d, 0x16a9: 0x8a6d, 0x16aa: 0x8a8d, 0x16ab: 0x8a6d, 0x16ac: 0x8aad, 0x16ad: 0x8acd, 0x16ae: 0x8aed, 0x16af: 0x0040, 0x16b0: 0x0040, 0x16b1: 0x0040, 0x16b2: 0x0040, 0x16b3: 0x0040, 0x16b4: 0x0040, 0x16b5: 0x0040, 0x16b6: 0x0040, 0x16b7: 0x0040, 0x16b8: 0x0040, 0x16b9: 0x0340, 0x16ba: 0x0340, 0x16bb: 0x0340, 0x16bc: 0x0040, 0x16bd: 0x0040, 0x16be: 0x0040, 0x16bf: 0x0040, // Block 0x5b, offset 0x16c0 0x16c0: 0x0a08, 0x16c1: 0x0a08, 0x16c2: 0x0a08, 0x16c3: 0x0a08, 0x16c4: 0x0a08, 0x16c5: 0x0c08, 0x16c6: 0x0808, 0x16c7: 0x0c08, 0x16c8: 0x0818, 0x16c9: 0x0c08, 0x16ca: 0x0c08, 0x16cb: 0x0808, 0x16cc: 0x0808, 0x16cd: 0x0908, 0x16ce: 0x0c08, 0x16cf: 0x0c08, 0x16d0: 0x0c08, 0x16d1: 0x0c08, 0x16d2: 0x0c08, 0x16d3: 0x0a08, 0x16d4: 0x0a08, 0x16d5: 0x0a08, 0x16d6: 0x0a08, 0x16d7: 0x0908, 0x16d8: 0x0a08, 0x16d9: 0x0a08, 0x16da: 0x0a08, 0x16db: 0x0a08, 0x16dc: 0x0a08, 0x16dd: 0x0c08, 0x16de: 0x0a08, 0x16df: 0x0a08, 0x16e0: 0x0a08, 0x16e1: 0x0c08, 0x16e2: 0x0808, 0x16e3: 0x0808, 0x16e4: 0x0c08, 0x16e5: 0x3308, 0x16e6: 0x3308, 0x16e7: 0x0040, 0x16e8: 0x0040, 0x16e9: 0x0040, 0x16ea: 0x0040, 0x16eb: 0x0a18, 0x16ec: 0x0a18, 0x16ed: 0x0a18, 0x16ee: 0x0a18, 0x16ef: 0x0c18, 0x16f0: 0x0818, 0x16f1: 0x0818, 0x16f2: 0x0818, 0x16f3: 0x0818, 0x16f4: 0x0818, 0x16f5: 0x0818, 0x16f6: 0x0818, 0x16f7: 0x0040, 0x16f8: 0x0040, 0x16f9: 0x0040, 0x16fa: 0x0040, 0x16fb: 0x0040, 0x16fc: 0x0040, 0x16fd: 0x0040, 0x16fe: 0x0040, 0x16ff: 0x0040, // Block 0x5c, offset 0x1700 0x1700: 0x0a08, 0x1701: 0x0c08, 0x1702: 0x0a08, 0x1703: 0x0c08, 0x1704: 0x0c08, 0x1705: 0x0c08, 0x1706: 0x0a08, 0x1707: 0x0a08, 0x1708: 0x0a08, 0x1709: 0x0c08, 0x170a: 0x0a08, 0x170b: 0x0a08, 0x170c: 0x0c08, 0x170d: 0x0a08, 0x170e: 0x0c08, 0x170f: 0x0c08, 0x1710: 0x0a08, 0x1711: 0x0c08, 0x1712: 0x0040, 0x1713: 0x0040, 0x1714: 0x0040, 0x1715: 0x0040, 0x1716: 0x0040, 0x1717: 0x0040, 0x1718: 0x0040, 0x1719: 0x0818, 0x171a: 0x0818, 0x171b: 0x0818, 0x171c: 0x0818, 0x171d: 0x0040, 0x171e: 0x0040, 0x171f: 0x0040, 0x1720: 0x0040, 0x1721: 0x0040, 0x1722: 0x0040, 0x1723: 0x0040, 0x1724: 0x0040, 0x1725: 0x0040, 0x1726: 0x0040, 0x1727: 0x0040, 0x1728: 0x0040, 0x1729: 0x0c18, 0x172a: 0x0c18, 0x172b: 0x0c18, 0x172c: 0x0c18, 0x172d: 0x0a18, 0x172e: 0x0a18, 0x172f: 0x0818, 0x1730: 0x0040, 0x1731: 0x0040, 0x1732: 0x0040, 0x1733: 0x0040, 0x1734: 0x0040, 0x1735: 0x0040, 0x1736: 0x0040, 0x1737: 0x0040, 0x1738: 0x0040, 0x1739: 0x0040, 0x173a: 0x0040, 0x173b: 0x0040, 0x173c: 0x0040, 0x173d: 0x0040, 0x173e: 0x0040, 0x173f: 0x0040, // Block 0x5d, offset 0x1740 0x1740: 0x3308, 0x1741: 0x3308, 0x1742: 0x3008, 0x1743: 0x3008, 0x1744: 0x0040, 0x1745: 0x0008, 0x1746: 0x0008, 0x1747: 0x0008, 0x1748: 0x0008, 0x1749: 0x0008, 0x174a: 0x0008, 0x174b: 0x0008, 0x174c: 0x0008, 0x174d: 0x0040, 0x174e: 0x0040, 0x174f: 0x0008, 0x1750: 0x0008, 0x1751: 0x0040, 0x1752: 0x0040, 0x1753: 0x0008, 0x1754: 0x0008, 0x1755: 0x0008, 0x1756: 0x0008, 0x1757: 0x0008, 0x1758: 0x0008, 0x1759: 0x0008, 0x175a: 0x0008, 0x175b: 0x0008, 0x175c: 0x0008, 0x175d: 0x0008, 0x175e: 0x0008, 0x175f: 0x0008, 0x1760: 0x0008, 0x1761: 0x0008, 0x1762: 0x0008, 0x1763: 0x0008, 0x1764: 0x0008, 0x1765: 0x0008, 0x1766: 0x0008, 0x1767: 0x0008, 0x1768: 0x0008, 0x1769: 0x0040, 0x176a: 0x0008, 0x176b: 0x0008, 0x176c: 0x0008, 0x176d: 0x0008, 0x176e: 0x0008, 0x176f: 0x0008, 0x1770: 0x0008, 0x1771: 0x0040, 0x1772: 0x0008, 0x1773: 0x0008, 0x1774: 0x0040, 0x1775: 0x0008, 0x1776: 0x0008, 0x1777: 0x0008, 0x1778: 0x0008, 0x1779: 0x0008, 0x177a: 0x0040, 0x177b: 0x3308, 0x177c: 0x3308, 0x177d: 0x0008, 0x177e: 0x3008, 0x177f: 0x3008, // Block 0x5e, offset 0x1780 0x1780: 0x3308, 0x1781: 0x3008, 0x1782: 0x3008, 0x1783: 0x3008, 0x1784: 0x3008, 0x1785: 0x0040, 0x1786: 0x0040, 0x1787: 0x3008, 0x1788: 0x3008, 0x1789: 0x0040, 0x178a: 0x0040, 0x178b: 0x3008, 0x178c: 0x3008, 0x178d: 0x3808, 0x178e: 0x0040, 0x178f: 0x0040, 0x1790: 0x0008, 0x1791: 0x0040, 0x1792: 0x0040, 0x1793: 0x0040, 0x1794: 0x0040, 0x1795: 0x0040, 0x1796: 0x0040, 0x1797: 0x3008, 0x1798: 0x0040, 0x1799: 0x0040, 0x179a: 0x0040, 0x179b: 0x0040, 0x179c: 0x0040, 0x179d: 0x0008, 0x179e: 0x0008, 0x179f: 0x0008, 0x17a0: 0x0008, 0x17a1: 0x0008, 0x17a2: 0x3008, 0x17a3: 0x3008, 0x17a4: 0x0040, 0x17a5: 0x0040, 0x17a6: 0x3308, 0x17a7: 0x3308, 0x17a8: 0x3308, 0x17a9: 0x3308, 0x17aa: 0x3308, 0x17ab: 0x3308, 0x17ac: 0x3308, 0x17ad: 0x0040, 0x17ae: 0x0040, 0x17af: 0x0040, 0x17b0: 0x3308, 0x17b1: 0x3308, 0x17b2: 0x3308, 0x17b3: 0x3308, 0x17b4: 0x3308, 0x17b5: 0x0040, 0x17b6: 0x0040, 0x17b7: 0x0040, 0x17b8: 0x0040, 0x17b9: 0x0040, 0x17ba: 0x0040, 0x17bb: 0x0040, 0x17bc: 0x0040, 0x17bd: 0x0040, 0x17be: 0x0040, 0x17bf: 0x0040, // Block 0x5f, offset 0x17c0 0x17c0: 0x0008, 0x17c1: 0x0008, 0x17c2: 0x0008, 0x17c3: 0x0008, 0x17c4: 0x0008, 0x17c5: 0x0008, 0x17c6: 0x0008, 0x17c7: 0x0040, 0x17c8: 0x0040, 0x17c9: 0x0008, 0x17ca: 0x0040, 0x17cb: 0x0040, 0x17cc: 0x0008, 0x17cd: 0x0008, 0x17ce: 0x0008, 0x17cf: 0x0008, 0x17d0: 0x0008, 0x17d1: 0x0008, 0x17d2: 0x0008, 0x17d3: 0x0008, 0x17d4: 0x0040, 0x17d5: 0x0008, 0x17d6: 0x0008, 0x17d7: 0x0040, 0x17d8: 0x0008, 0x17d9: 0x0008, 0x17da: 0x0008, 0x17db: 0x0008, 0x17dc: 0x0008, 0x17dd: 0x0008, 0x17de: 0x0008, 0x17df: 0x0008, 0x17e0: 0x0008, 0x17e1: 0x0008, 0x17e2: 0x0008, 0x17e3: 0x0008, 0x17e4: 0x0008, 0x17e5: 0x0008, 0x17e6: 0x0008, 0x17e7: 0x0008, 0x17e8: 0x0008, 0x17e9: 0x0008, 0x17ea: 0x0008, 0x17eb: 0x0008, 0x17ec: 0x0008, 0x17ed: 0x0008, 0x17ee: 0x0008, 0x17ef: 0x0008, 0x17f0: 0x3008, 0x17f1: 0x3008, 0x17f2: 0x3008, 0x17f3: 0x3008, 0x17f4: 0x3008, 0x17f5: 0x3008, 0x17f6: 0x0040, 0x17f7: 0x3008, 0x17f8: 0x3008, 0x17f9: 0x0040, 0x17fa: 0x0040, 0x17fb: 0x3308, 0x17fc: 0x3308, 0x17fd: 0x3808, 0x17fe: 0x3b08, 0x17ff: 0x0008, // Block 0x60, offset 0x1800 0x1800: 0x0019, 0x1801: 0x02e9, 0x1802: 0x03d9, 0x1803: 0x02f1, 0x1804: 0x02f9, 0x1805: 0x03f1, 0x1806: 0x0309, 0x1807: 0x00a9, 0x1808: 0x0311, 0x1809: 0x00b1, 0x180a: 0x0319, 0x180b: 0x0101, 0x180c: 0x0321, 0x180d: 0x0329, 0x180e: 0x0051, 0x180f: 0x0339, 0x1810: 0x0751, 0x1811: 0x00b9, 0x1812: 0x0089, 0x1813: 0x0341, 0x1814: 0x0349, 0x1815: 0x0391, 0x1816: 0x00c1, 0x1817: 0x0109, 0x1818: 0x00c9, 0x1819: 0x04b1, 0x181a: 0x0019, 0x181b: 0x02e9, 0x181c: 0x03d9, 0x181d: 0x02f1, 0x181e: 0x02f9, 0x181f: 0x03f1, 0x1820: 0x0309, 0x1821: 0x00a9, 0x1822: 0x0311, 0x1823: 0x00b1, 0x1824: 0x0319, 0x1825: 0x0101, 0x1826: 0x0321, 0x1827: 0x0329, 0x1828: 0x0051, 0x1829: 0x0339, 0x182a: 0x0751, 0x182b: 0x00b9, 0x182c: 0x0089, 0x182d: 0x0341, 0x182e: 0x0349, 0x182f: 0x0391, 0x1830: 0x00c1, 0x1831: 0x0109, 0x1832: 0x00c9, 0x1833: 0x04b1, 0x1834: 0x0019, 0x1835: 0x02e9, 0x1836: 0x03d9, 0x1837: 0x02f1, 0x1838: 0x02f9, 0x1839: 0x03f1, 0x183a: 0x0309, 0x183b: 0x00a9, 0x183c: 0x0311, 0x183d: 0x00b1, 0x183e: 0x0319, 0x183f: 0x0101, // Block 0x61, offset 0x1840 0x1840: 0x0321, 0x1841: 0x0329, 0x1842: 0x0051, 0x1843: 0x0339, 0x1844: 0x0751, 0x1845: 0x00b9, 0x1846: 0x0089, 0x1847: 0x0341, 0x1848: 0x0349, 0x1849: 0x0391, 0x184a: 0x00c1, 0x184b: 0x0109, 0x184c: 0x00c9, 0x184d: 0x04b1, 0x184e: 0x0019, 0x184f: 0x02e9, 0x1850: 0x03d9, 0x1851: 0x02f1, 0x1852: 0x02f9, 0x1853: 0x03f1, 0x1854: 0x0309, 0x1855: 0x0040, 0x1856: 0x0311, 0x1857: 0x00b1, 0x1858: 0x0319, 0x1859: 0x0101, 0x185a: 0x0321, 0x185b: 0x0329, 0x185c: 0x0051, 0x185d: 0x0339, 0x185e: 0x0751, 0x185f: 0x00b9, 0x1860: 0x0089, 0x1861: 0x0341, 0x1862: 0x0349, 0x1863: 0x0391, 0x1864: 0x00c1, 0x1865: 0x0109, 0x1866: 0x00c9, 0x1867: 0x04b1, 0x1868: 0x0019, 0x1869: 0x02e9, 0x186a: 0x03d9, 0x186b: 0x02f1, 0x186c: 0x02f9, 0x186d: 0x03f1, 0x186e: 0x0309, 0x186f: 0x00a9, 0x1870: 0x0311, 0x1871: 0x00b1, 0x1872: 0x0319, 0x1873: 0x0101, 0x1874: 0x0321, 0x1875: 0x0329, 0x1876: 0x0051, 0x1877: 0x0339, 0x1878: 0x0751, 0x1879: 0x00b9, 0x187a: 0x0089, 0x187b: 0x0341, 0x187c: 0x0349, 0x187d: 0x0391, 0x187e: 0x00c1, 0x187f: 0x0109, // Block 0x62, offset 0x1880 0x1880: 0x00c9, 0x1881: 0x04b1, 0x1882: 0x0019, 0x1883: 0x02e9, 0x1884: 0x03d9, 0x1885: 0x02f1, 0x1886: 0x02f9, 0x1887: 0x03f1, 0x1888: 0x0309, 0x1889: 0x00a9, 0x188a: 0x0311, 0x188b: 0x00b1, 0x188c: 0x0319, 0x188d: 0x0101, 0x188e: 0x0321, 0x188f: 0x0329, 0x1890: 0x0051, 0x1891: 0x0339, 0x1892: 0x0751, 0x1893: 0x00b9, 0x1894: 0x0089, 0x1895: 0x0341, 0x1896: 0x0349, 0x1897: 0x0391, 0x1898: 0x00c1, 0x1899: 0x0109, 0x189a: 0x00c9, 0x189b: 0x04b1, 0x189c: 0x0019, 0x189d: 0x0040, 0x189e: 0x03d9, 0x189f: 0x02f1, 0x18a0: 0x0040, 0x18a1: 0x0040, 0x18a2: 0x0309, 0x18a3: 0x0040, 0x18a4: 0x0040, 0x18a5: 0x00b1, 0x18a6: 0x0319, 0x18a7: 0x0040, 0x18a8: 0x0040, 0x18a9: 0x0329, 0x18aa: 0x0051, 0x18ab: 0x0339, 0x18ac: 0x0751, 0x18ad: 0x0040, 0x18ae: 0x0089, 0x18af: 0x0341, 0x18b0: 0x0349, 0x18b1: 0x0391, 0x18b2: 0x00c1, 0x18b3: 0x0109, 0x18b4: 0x00c9, 0x18b5: 0x04b1, 0x18b6: 0x0019, 0x18b7: 0x02e9, 0x18b8: 0x03d9, 0x18b9: 0x02f1, 0x18ba: 0x0040, 0x18bb: 0x03f1, 0x18bc: 0x0040, 0x18bd: 0x00a9, 0x18be: 0x0311, 0x18bf: 0x00b1, // Block 0x63, offset 0x18c0 0x18c0: 0x0319, 0x18c1: 0x0101, 0x18c2: 0x0321, 0x18c3: 0x0329, 0x18c4: 0x0040, 0x18c5: 0x0339, 0x18c6: 0x0751, 0x18c7: 0x00b9, 0x18c8: 0x0089, 0x18c9: 0x0341, 0x18ca: 0x0349, 0x18cb: 0x0391, 0x18cc: 0x00c1, 0x18cd: 0x0109, 0x18ce: 0x00c9, 0x18cf: 0x04b1, 0x18d0: 0x0019, 0x18d1: 0x02e9, 0x18d2: 0x03d9, 0x18d3: 0x02f1, 0x18d4: 0x02f9, 0x18d5: 0x03f1, 0x18d6: 0x0309, 0x18d7: 0x00a9, 0x18d8: 0x0311, 0x18d9: 0x00b1, 0x18da: 0x0319, 0x18db: 0x0101, 0x18dc: 0x0321, 0x18dd: 0x0329, 0x18de: 0x0051, 0x18df: 0x0339, 0x18e0: 0x0751, 0x18e1: 0x00b9, 0x18e2: 0x0089, 0x18e3: 0x0341, 0x18e4: 0x0349, 0x18e5: 0x0391, 0x18e6: 0x00c1, 0x18e7: 0x0109, 0x18e8: 0x00c9, 0x18e9: 0x04b1, 0x18ea: 0x0019, 0x18eb: 0x02e9, 0x18ec: 0x03d9, 0x18ed: 0x02f1, 0x18ee: 0x02f9, 0x18ef: 0x03f1, 0x18f0: 0x0309, 0x18f1: 0x00a9, 0x18f2: 0x0311, 0x18f3: 0x00b1, 0x18f4: 0x0319, 0x18f5: 0x0101, 0x18f6: 0x0321, 0x18f7: 0x0329, 0x18f8: 0x0051, 0x18f9: 0x0339, 0x18fa: 0x0751, 0x18fb: 0x00b9, 0x18fc: 0x0089, 0x18fd: 0x0341, 0x18fe: 0x0349, 0x18ff: 0x0391, // Block 0x64, offset 0x1900 0x1900: 0x00c1, 0x1901: 0x0109, 0x1902: 0x00c9, 0x1903: 0x04b1, 0x1904: 0x0019, 0x1905: 0x02e9, 0x1906: 0x0040, 0x1907: 0x02f1, 0x1908: 0x02f9, 0x1909: 0x03f1, 0x190a: 0x0309, 0x190b: 0x0040, 0x190c: 0x0040, 0x190d: 0x00b1, 0x190e: 0x0319, 0x190f: 0x0101, 0x1910: 0x0321, 0x1911: 0x0329, 0x1912: 0x0051, 0x1913: 0x0339, 0x1914: 0x0751, 0x1915: 0x0040, 0x1916: 0x0089, 0x1917: 0x0341, 0x1918: 0x0349, 0x1919: 0x0391, 0x191a: 0x00c1, 0x191b: 0x0109, 0x191c: 0x00c9, 0x191d: 0x0040, 0x191e: 0x0019, 0x191f: 0x02e9, 0x1920: 0x03d9, 0x1921: 0x02f1, 0x1922: 0x02f9, 0x1923: 0x03f1, 0x1924: 0x0309, 0x1925: 0x00a9, 0x1926: 0x0311, 0x1927: 0x00b1, 0x1928: 0x0319, 0x1929: 0x0101, 0x192a: 0x0321, 0x192b: 0x0329, 0x192c: 0x0051, 0x192d: 0x0339, 0x192e: 0x0751, 0x192f: 0x00b9, 0x1930: 0x0089, 0x1931: 0x0341, 0x1932: 0x0349, 0x1933: 0x0391, 0x1934: 0x00c1, 0x1935: 0x0109, 0x1936: 0x00c9, 0x1937: 0x04b1, 0x1938: 0x0019, 0x1939: 0x02e9, 0x193a: 0x0040, 0x193b: 0x02f1, 0x193c: 0x02f9, 0x193d: 0x03f1, 0x193e: 0x0309, 0x193f: 0x0040, // Block 0x65, offset 0x1940 0x1940: 0x0311, 0x1941: 0x00b1, 0x1942: 0x0319, 0x1943: 0x0101, 0x1944: 0x0321, 0x1945: 0x0040, 0x1946: 0x0051, 0x1947: 0x0040, 0x1948: 0x0040, 0x1949: 0x0040, 0x194a: 0x0089, 0x194b: 0x0341, 0x194c: 0x0349, 0x194d: 0x0391, 0x194e: 0x00c1, 0x194f: 0x0109, 0x1950: 0x00c9, 0x1951: 0x0040, 0x1952: 0x0019, 0x1953: 0x02e9, 0x1954: 0x03d9, 0x1955: 0x02f1, 0x1956: 0x02f9, 0x1957: 0x03f1, 0x1958: 0x0309, 0x1959: 0x00a9, 0x195a: 0x0311, 0x195b: 0x00b1, 0x195c: 0x0319, 0x195d: 0x0101, 0x195e: 0x0321, 0x195f: 0x0329, 0x1960: 0x0051, 0x1961: 0x0339, 0x1962: 0x0751, 0x1963: 0x00b9, 0x1964: 0x0089, 0x1965: 0x0341, 0x1966: 0x0349, 0x1967: 0x0391, 0x1968: 0x00c1, 0x1969: 0x0109, 0x196a: 0x00c9, 0x196b: 0x04b1, 0x196c: 0x0019, 0x196d: 0x02e9, 0x196e: 0x03d9, 0x196f: 0x02f1, 0x1970: 0x02f9, 0x1971: 0x03f1, 0x1972: 0x0309, 0x1973: 0x00a9, 0x1974: 0x0311, 0x1975: 0x00b1, 0x1976: 0x0319, 0x1977: 0x0101, 0x1978: 0x0321, 0x1979: 0x0329, 0x197a: 0x0051, 0x197b: 0x0339, 0x197c: 0x0751, 0x197d: 0x00b9, 0x197e: 0x0089, 0x197f: 0x0341, // Block 0x66, offset 0x1980 0x1980: 0x0349, 0x1981: 0x0391, 0x1982: 0x00c1, 0x1983: 0x0109, 0x1984: 0x00c9, 0x1985: 0x04b1, 0x1986: 0x0019, 0x1987: 0x02e9, 0x1988: 0x03d9, 0x1989: 0x02f1, 0x198a: 0x02f9, 0x198b: 0x03f1, 0x198c: 0x0309, 0x198d: 0x00a9, 0x198e: 0x0311, 0x198f: 0x00b1, 0x1990: 0x0319, 0x1991: 0x0101, 0x1992: 0x0321, 0x1993: 0x0329, 0x1994: 0x0051, 0x1995: 0x0339, 0x1996: 0x0751, 0x1997: 0x00b9, 0x1998: 0x0089, 0x1999: 0x0341, 0x199a: 0x0349, 0x199b: 0x0391, 0x199c: 0x00c1, 0x199d: 0x0109, 0x199e: 0x00c9, 0x199f: 0x04b1, 0x19a0: 0x0019, 0x19a1: 0x02e9, 0x19a2: 0x03d9, 0x19a3: 0x02f1, 0x19a4: 0x02f9, 0x19a5: 0x03f1, 0x19a6: 0x0309, 0x19a7: 0x00a9, 0x19a8: 0x0311, 0x19a9: 0x00b1, 0x19aa: 0x0319, 0x19ab: 0x0101, 0x19ac: 0x0321, 0x19ad: 0x0329, 0x19ae: 0x0051, 0x19af: 0x0339, 0x19b0: 0x0751, 0x19b1: 0x00b9, 0x19b2: 0x0089, 0x19b3: 0x0341, 0x19b4: 0x0349, 0x19b5: 0x0391, 0x19b6: 0x00c1, 0x19b7: 0x0109, 0x19b8: 0x00c9, 0x19b9: 0x04b1, 0x19ba: 0x0019, 0x19bb: 0x02e9, 0x19bc: 0x03d9, 0x19bd: 0x02f1, 0x19be: 0x02f9, 0x19bf: 0x03f1, // Block 0x67, offset 0x19c0 0x19c0: 0x0309, 0x19c1: 0x00a9, 0x19c2: 0x0311, 0x19c3: 0x00b1, 0x19c4: 0x0319, 0x19c5: 0x0101, 0x19c6: 0x0321, 0x19c7: 0x0329, 0x19c8: 0x0051, 0x19c9: 0x0339, 0x19ca: 0x0751, 0x19cb: 0x00b9, 0x19cc: 0x0089, 0x19cd: 0x0341, 0x19ce: 0x0349, 0x19cf: 0x0391, 0x19d0: 0x00c1, 0x19d1: 0x0109, 0x19d2: 0x00c9, 0x19d3: 0x04b1, 0x19d4: 0x0019, 0x19d5: 0x02e9, 0x19d6: 0x03d9, 0x19d7: 0x02f1, 0x19d8: 0x02f9, 0x19d9: 0x03f1, 0x19da: 0x0309, 0x19db: 0x00a9, 0x19dc: 0x0311, 0x19dd: 0x00b1, 0x19de: 0x0319, 0x19df: 0x0101, 0x19e0: 0x0321, 0x19e1: 0x0329, 0x19e2: 0x0051, 0x19e3: 0x0339, 0x19e4: 0x0751, 0x19e5: 0x00b9, 0x19e6: 0x0089, 0x19e7: 0x0341, 0x19e8: 0x0349, 0x19e9: 0x0391, 0x19ea: 0x00c1, 0x19eb: 0x0109, 0x19ec: 0x00c9, 0x19ed: 0x04b1, 0x19ee: 0x0019, 0x19ef: 0x02e9, 0x19f0: 0x03d9, 0x19f1: 0x02f1, 0x19f2: 0x02f9, 0x19f3: 0x03f1, 0x19f4: 0x0309, 0x19f5: 0x00a9, 0x19f6: 0x0311, 0x19f7: 0x00b1, 0x19f8: 0x0319, 0x19f9: 0x0101, 0x19fa: 0x0321, 0x19fb: 0x0329, 0x19fc: 0x0051, 0x19fd: 0x0339, 0x19fe: 0x0751, 0x19ff: 0x00b9, // Block 0x68, offset 0x1a00 0x1a00: 0x0089, 0x1a01: 0x0341, 0x1a02: 0x0349, 0x1a03: 0x0391, 0x1a04: 0x00c1, 0x1a05: 0x0109, 0x1a06: 0x00c9, 0x1a07: 0x04b1, 0x1a08: 0x0019, 0x1a09: 0x02e9, 0x1a0a: 0x03d9, 0x1a0b: 0x02f1, 0x1a0c: 0x02f9, 0x1a0d: 0x03f1, 0x1a0e: 0x0309, 0x1a0f: 0x00a9, 0x1a10: 0x0311, 0x1a11: 0x00b1, 0x1a12: 0x0319, 0x1a13: 0x0101, 0x1a14: 0x0321, 0x1a15: 0x0329, 0x1a16: 0x0051, 0x1a17: 0x0339, 0x1a18: 0x0751, 0x1a19: 0x00b9, 0x1a1a: 0x0089, 0x1a1b: 0x0341, 0x1a1c: 0x0349, 0x1a1d: 0x0391, 0x1a1e: 0x00c1, 0x1a1f: 0x0109, 0x1a20: 0x00c9, 0x1a21: 0x04b1, 0x1a22: 0x0019, 0x1a23: 0x02e9, 0x1a24: 0x03d9, 0x1a25: 0x02f1, 0x1a26: 0x02f9, 0x1a27: 0x03f1, 0x1a28: 0x0309, 0x1a29: 0x00a9, 0x1a2a: 0x0311, 0x1a2b: 0x00b1, 0x1a2c: 0x0319, 0x1a2d: 0x0101, 0x1a2e: 0x0321, 0x1a2f: 0x0329, 0x1a30: 0x0051, 0x1a31: 0x0339, 0x1a32: 0x0751, 0x1a33: 0x00b9, 0x1a34: 0x0089, 0x1a35: 0x0341, 0x1a36: 0x0349, 0x1a37: 0x0391, 0x1a38: 0x00c1, 0x1a39: 0x0109, 0x1a3a: 0x00c9, 0x1a3b: 0x04b1, 0x1a3c: 0x0019, 0x1a3d: 0x02e9, 0x1a3e: 0x03d9, 0x1a3f: 0x02f1, // Block 0x69, offset 0x1a40 0x1a40: 0x02f9, 0x1a41: 0x03f1, 0x1a42: 0x0309, 0x1a43: 0x00a9, 0x1a44: 0x0311, 0x1a45: 0x00b1, 0x1a46: 0x0319, 0x1a47: 0x0101, 0x1a48: 0x0321, 0x1a49: 0x0329, 0x1a4a: 0x0051, 0x1a4b: 0x0339, 0x1a4c: 0x0751, 0x1a4d: 0x00b9, 0x1a4e: 0x0089, 0x1a4f: 0x0341, 0x1a50: 0x0349, 0x1a51: 0x0391, 0x1a52: 0x00c1, 0x1a53: 0x0109, 0x1a54: 0x00c9, 0x1a55: 0x04b1, 0x1a56: 0x0019, 0x1a57: 0x02e9, 0x1a58: 0x03d9, 0x1a59: 0x02f1, 0x1a5a: 0x02f9, 0x1a5b: 0x03f1, 0x1a5c: 0x0309, 0x1a5d: 0x00a9, 0x1a5e: 0x0311, 0x1a5f: 0x00b1, 0x1a60: 0x0319, 0x1a61: 0x0101, 0x1a62: 0x0321, 0x1a63: 0x0329, 0x1a64: 0x0051, 0x1a65: 0x0339, 0x1a66: 0x0751, 0x1a67: 0x00b9, 0x1a68: 0x0089, 0x1a69: 0x0341, 0x1a6a: 0x0349, 0x1a6b: 0x0391, 0x1a6c: 0x00c1, 0x1a6d: 0x0109, 0x1a6e: 0x00c9, 0x1a6f: 0x04b1, 0x1a70: 0x0019, 0x1a71: 0x02e9, 0x1a72: 0x03d9, 0x1a73: 0x02f1, 0x1a74: 0x02f9, 0x1a75: 0x03f1, 0x1a76: 0x0309, 0x1a77: 0x00a9, 0x1a78: 0x0311, 0x1a79: 0x00b1, 0x1a7a: 0x0319, 0x1a7b: 0x0101, 0x1a7c: 0x0321, 0x1a7d: 0x0329, 0x1a7e: 0x0051, 0x1a7f: 0x0339, // Block 0x6a, offset 0x1a80 0x1a80: 0x0751, 0x1a81: 0x00b9, 0x1a82: 0x0089, 0x1a83: 0x0341, 0x1a84: 0x0349, 0x1a85: 0x0391, 0x1a86: 0x00c1, 0x1a87: 0x0109, 0x1a88: 0x00c9, 0x1a89: 0x04b1, 0x1a8a: 0x0019, 0x1a8b: 0x02e9, 0x1a8c: 0x03d9, 0x1a8d: 0x02f1, 0x1a8e: 0x02f9, 0x1a8f: 0x03f1, 0x1a90: 0x0309, 0x1a91: 0x00a9, 0x1a92: 0x0311, 0x1a93: 0x00b1, 0x1a94: 0x0319, 0x1a95: 0x0101, 0x1a96: 0x0321, 0x1a97: 0x0329, 0x1a98: 0x0051, 0x1a99: 0x0339, 0x1a9a: 0x0751, 0x1a9b: 0x00b9, 0x1a9c: 0x0089, 0x1a9d: 0x0341, 0x1a9e: 0x0349, 0x1a9f: 0x0391, 0x1aa0: 0x00c1, 0x1aa1: 0x0109, 0x1aa2: 0x00c9, 0x1aa3: 0x04b1, 0x1aa4: 0x2279, 0x1aa5: 0x2281, 0x1aa6: 0x0040, 0x1aa7: 0x0040, 0x1aa8: 0x2289, 0x1aa9: 0x0399, 0x1aaa: 0x03a1, 0x1aab: 0x03a9, 0x1aac: 0x2291, 0x1aad: 0x2299, 0x1aae: 0x22a1, 0x1aaf: 0x04d1, 0x1ab0: 0x05f9, 0x1ab1: 0x22a9, 0x1ab2: 0x22b1, 0x1ab3: 0x22b9, 0x1ab4: 0x22c1, 0x1ab5: 0x22c9, 0x1ab6: 0x22d1, 0x1ab7: 0x0799, 0x1ab8: 0x03c1, 0x1ab9: 0x04d1, 0x1aba: 0x22d9, 0x1abb: 0x22e1, 0x1abc: 0x22e9, 0x1abd: 0x03b1, 0x1abe: 0x03b9, 0x1abf: 0x22f1, // Block 0x6b, offset 0x1ac0 0x1ac0: 0x0769, 0x1ac1: 0x22f9, 0x1ac2: 0x2289, 0x1ac3: 0x0399, 0x1ac4: 0x03a1, 0x1ac5: 0x03a9, 0x1ac6: 0x2291, 0x1ac7: 0x2299, 0x1ac8: 0x22a1, 0x1ac9: 0x04d1, 0x1aca: 0x05f9, 0x1acb: 0x22a9, 0x1acc: 0x22b1, 0x1acd: 0x22b9, 0x1ace: 0x22c1, 0x1acf: 0x22c9, 0x1ad0: 0x22d1, 0x1ad1: 0x0799, 0x1ad2: 0x03c1, 0x1ad3: 0x22d9, 0x1ad4: 0x22d9, 0x1ad5: 0x22e1, 0x1ad6: 0x22e9, 0x1ad7: 0x03b1, 0x1ad8: 0x03b9, 0x1ad9: 0x22f1, 0x1ada: 0x0769, 0x1adb: 0x2301, 0x1adc: 0x2291, 0x1add: 0x04d1, 0x1ade: 0x22a9, 0x1adf: 0x03b1, 0x1ae0: 0x03c1, 0x1ae1: 0x0799, 0x1ae2: 0x2289, 0x1ae3: 0x0399, 0x1ae4: 0x03a1, 0x1ae5: 0x03a9, 0x1ae6: 0x2291, 0x1ae7: 0x2299, 0x1ae8: 0x22a1, 0x1ae9: 0x04d1, 0x1aea: 0x05f9, 0x1aeb: 0x22a9, 0x1aec: 0x22b1, 0x1aed: 0x22b9, 0x1aee: 0x22c1, 0x1aef: 0x22c9, 0x1af0: 0x22d1, 0x1af1: 0x0799, 0x1af2: 0x03c1, 0x1af3: 0x04d1, 0x1af4: 0x22d9, 0x1af5: 0x22e1, 0x1af6: 0x22e9, 0x1af7: 0x03b1, 0x1af8: 0x03b9, 0x1af9: 0x22f1, 0x1afa: 0x0769, 0x1afb: 0x22f9, 0x1afc: 0x2289, 0x1afd: 0x0399, 0x1afe: 0x03a1, 0x1aff: 0x03a9, // Block 0x6c, offset 0x1b00 0x1b00: 0x2291, 0x1b01: 0x2299, 0x1b02: 0x22a1, 0x1b03: 0x04d1, 0x1b04: 0x05f9, 0x1b05: 0x22a9, 0x1b06: 0x22b1, 0x1b07: 0x22b9, 0x1b08: 0x22c1, 0x1b09: 0x22c9, 0x1b0a: 0x22d1, 0x1b0b: 0x0799, 0x1b0c: 0x03c1, 0x1b0d: 0x22d9, 0x1b0e: 0x22d9, 0x1b0f: 0x22e1, 0x1b10: 0x22e9, 0x1b11: 0x03b1, 0x1b12: 0x03b9, 0x1b13: 0x22f1, 0x1b14: 0x0769, 0x1b15: 0x2301, 0x1b16: 0x2291, 0x1b17: 0x04d1, 0x1b18: 0x22a9, 0x1b19: 0x03b1, 0x1b1a: 0x03c1, 0x1b1b: 0x0799, 0x1b1c: 0x2289, 0x1b1d: 0x0399, 0x1b1e: 0x03a1, 0x1b1f: 0x03a9, 0x1b20: 0x2291, 0x1b21: 0x2299, 0x1b22: 0x22a1, 0x1b23: 0x04d1, 0x1b24: 0x05f9, 0x1b25: 0x22a9, 0x1b26: 0x22b1, 0x1b27: 0x22b9, 0x1b28: 0x22c1, 0x1b29: 0x22c9, 0x1b2a: 0x22d1, 0x1b2b: 0x0799, 0x1b2c: 0x03c1, 0x1b2d: 0x04d1, 0x1b2e: 0x22d9, 0x1b2f: 0x22e1, 0x1b30: 0x22e9, 0x1b31: 0x03b1, 0x1b32: 0x03b9, 0x1b33: 0x22f1, 0x1b34: 0x0769, 0x1b35: 0x22f9, 0x1b36: 0x2289, 0x1b37: 0x0399, 0x1b38: 0x03a1, 0x1b39: 0x03a9, 0x1b3a: 0x2291, 0x1b3b: 0x2299, 0x1b3c: 0x22a1, 0x1b3d: 0x04d1, 0x1b3e: 0x05f9, 0x1b3f: 0x22a9, // Block 0x6d, offset 0x1b40 0x1b40: 0x22b1, 0x1b41: 0x22b9, 0x1b42: 0x22c1, 0x1b43: 0x22c9, 0x1b44: 0x22d1, 0x1b45: 0x0799, 0x1b46: 0x03c1, 0x1b47: 0x22d9, 0x1b48: 0x22d9, 0x1b49: 0x22e1, 0x1b4a: 0x22e9, 0x1b4b: 0x03b1, 0x1b4c: 0x03b9, 0x1b4d: 0x22f1, 0x1b4e: 0x0769, 0x1b4f: 0x2301, 0x1b50: 0x2291, 0x1b51: 0x04d1, 0x1b52: 0x22a9, 0x1b53: 0x03b1, 0x1b54: 0x03c1, 0x1b55: 0x0799, 0x1b56: 0x2289, 0x1b57: 0x0399, 0x1b58: 0x03a1, 0x1b59: 0x03a9, 0x1b5a: 0x2291, 0x1b5b: 0x2299, 0x1b5c: 0x22a1, 0x1b5d: 0x04d1, 0x1b5e: 0x05f9, 0x1b5f: 0x22a9, 0x1b60: 0x22b1, 0x1b61: 0x22b9, 0x1b62: 0x22c1, 0x1b63: 0x22c9, 0x1b64: 0x22d1, 0x1b65: 0x0799, 0x1b66: 0x03c1, 0x1b67: 0x04d1, 0x1b68: 0x22d9, 0x1b69: 0x22e1, 0x1b6a: 0x22e9, 0x1b6b: 0x03b1, 0x1b6c: 0x03b9, 0x1b6d: 0x22f1, 0x1b6e: 0x0769, 0x1b6f: 0x22f9, 0x1b70: 0x2289, 0x1b71: 0x0399, 0x1b72: 0x03a1, 0x1b73: 0x03a9, 0x1b74: 0x2291, 0x1b75: 0x2299, 0x1b76: 0x22a1, 0x1b77: 0x04d1, 0x1b78: 0x05f9, 0x1b79: 0x22a9, 0x1b7a: 0x22b1, 0x1b7b: 0x22b9, 0x1b7c: 0x22c1, 0x1b7d: 0x22c9, 0x1b7e: 0x22d1, 0x1b7f: 0x0799, // Block 0x6e, offset 0x1b80 0x1b80: 0x03c1, 0x1b81: 0x22d9, 0x1b82: 0x22d9, 0x1b83: 0x22e1, 0x1b84: 0x22e9, 0x1b85: 0x03b1, 0x1b86: 0x03b9, 0x1b87: 0x22f1, 0x1b88: 0x0769, 0x1b89: 0x2301, 0x1b8a: 0x2291, 0x1b8b: 0x04d1, 0x1b8c: 0x22a9, 0x1b8d: 0x03b1, 0x1b8e: 0x03c1, 0x1b8f: 0x0799, 0x1b90: 0x2289, 0x1b91: 0x0399, 0x1b92: 0x03a1, 0x1b93: 0x03a9, 0x1b94: 0x2291, 0x1b95: 0x2299, 0x1b96: 0x22a1, 0x1b97: 0x04d1, 0x1b98: 0x05f9, 0x1b99: 0x22a9, 0x1b9a: 0x22b1, 0x1b9b: 0x22b9, 0x1b9c: 0x22c1, 0x1b9d: 0x22c9, 0x1b9e: 0x22d1, 0x1b9f: 0x0799, 0x1ba0: 0x03c1, 0x1ba1: 0x04d1, 0x1ba2: 0x22d9, 0x1ba3: 0x22e1, 0x1ba4: 0x22e9, 0x1ba5: 0x03b1, 0x1ba6: 0x03b9, 0x1ba7: 0x22f1, 0x1ba8: 0x0769, 0x1ba9: 0x22f9, 0x1baa: 0x2289, 0x1bab: 0x0399, 0x1bac: 0x03a1, 0x1bad: 0x03a9, 0x1bae: 0x2291, 0x1baf: 0x2299, 0x1bb0: 0x22a1, 0x1bb1: 0x04d1, 0x1bb2: 0x05f9, 0x1bb3: 0x22a9, 0x1bb4: 0x22b1, 0x1bb5: 0x22b9, 0x1bb6: 0x22c1, 0x1bb7: 0x22c9, 0x1bb8: 0x22d1, 0x1bb9: 0x0799, 0x1bba: 0x03c1, 0x1bbb: 0x22d9, 0x1bbc: 0x22d9, 0x1bbd: 0x22e1, 0x1bbe: 0x22e9, 0x1bbf: 0x03b1, // Block 0x6f, offset 0x1bc0 0x1bc0: 0x03b9, 0x1bc1: 0x22f1, 0x1bc2: 0x0769, 0x1bc3: 0x2301, 0x1bc4: 0x2291, 0x1bc5: 0x04d1, 0x1bc6: 0x22a9, 0x1bc7: 0x03b1, 0x1bc8: 0x03c1, 0x1bc9: 0x0799, 0x1bca: 0x2309, 0x1bcb: 0x2309, 0x1bcc: 0x0040, 0x1bcd: 0x0040, 0x1bce: 0x06e1, 0x1bcf: 0x0049, 0x1bd0: 0x0029, 0x1bd1: 0x0031, 0x1bd2: 0x06e9, 0x1bd3: 0x06f1, 0x1bd4: 0x06f9, 0x1bd5: 0x0701, 0x1bd6: 0x0709, 0x1bd7: 0x0711, 0x1bd8: 0x06e1, 0x1bd9: 0x0049, 0x1bda: 0x0029, 0x1bdb: 0x0031, 0x1bdc: 0x06e9, 0x1bdd: 0x06f1, 0x1bde: 0x06f9, 0x1bdf: 0x0701, 0x1be0: 0x0709, 0x1be1: 0x0711, 0x1be2: 0x06e1, 0x1be3: 0x0049, 0x1be4: 0x0029, 0x1be5: 0x0031, 0x1be6: 0x06e9, 0x1be7: 0x06f1, 0x1be8: 0x06f9, 0x1be9: 0x0701, 0x1bea: 0x0709, 0x1beb: 0x0711, 0x1bec: 0x06e1, 0x1bed: 0x0049, 0x1bee: 0x0029, 0x1bef: 0x0031, 0x1bf0: 0x06e9, 0x1bf1: 0x06f1, 0x1bf2: 0x06f9, 0x1bf3: 0x0701, 0x1bf4: 0x0709, 0x1bf5: 0x0711, 0x1bf6: 0x06e1, 0x1bf7: 0x0049, 0x1bf8: 0x0029, 0x1bf9: 0x0031, 0x1bfa: 0x06e9, 0x1bfb: 0x06f1, 0x1bfc: 0x06f9, 0x1bfd: 0x0701, 0x1bfe: 0x0709, 0x1bff: 0x0711, // Block 0x70, offset 0x1c00 0x1c00: 0xe115, 0x1c01: 0xe115, 0x1c02: 0xe135, 0x1c03: 0xe135, 0x1c04: 0xe115, 0x1c05: 0xe115, 0x1c06: 0xe175, 0x1c07: 0xe175, 0x1c08: 0xe115, 0x1c09: 0xe115, 0x1c0a: 0xe135, 0x1c0b: 0xe135, 0x1c0c: 0xe115, 0x1c0d: 0xe115, 0x1c0e: 0xe1f5, 0x1c0f: 0xe1f5, 0x1c10: 0xe115, 0x1c11: 0xe115, 0x1c12: 0xe135, 0x1c13: 0xe135, 0x1c14: 0xe115, 0x1c15: 0xe115, 0x1c16: 0xe175, 0x1c17: 0xe175, 0x1c18: 0xe115, 0x1c19: 0xe115, 0x1c1a: 0xe135, 0x1c1b: 0xe135, 0x1c1c: 0xe115, 0x1c1d: 0xe115, 0x1c1e: 0x8b3d, 0x1c1f: 0x8b3d, 0x1c20: 0x04b5, 0x1c21: 0x04b5, 0x1c22: 0x0a08, 0x1c23: 0x0a08, 0x1c24: 0x0a08, 0x1c25: 0x0a08, 0x1c26: 0x0a08, 0x1c27: 0x0a08, 0x1c28: 0x0a08, 0x1c29: 0x0a08, 0x1c2a: 0x0a08, 0x1c2b: 0x0a08, 0x1c2c: 0x0a08, 0x1c2d: 0x0a08, 0x1c2e: 0x0a08, 0x1c2f: 0x0a08, 0x1c30: 0x0a08, 0x1c31: 0x0a08, 0x1c32: 0x0a08, 0x1c33: 0x0a08, 0x1c34: 0x0a08, 0x1c35: 0x0a08, 0x1c36: 0x0a08, 0x1c37: 0x0a08, 0x1c38: 0x0a08, 0x1c39: 0x0a08, 0x1c3a: 0x0a08, 0x1c3b: 0x0a08, 0x1c3c: 0x0a08, 0x1c3d: 0x0a08, 0x1c3e: 0x0a08, 0x1c3f: 0x0a08, // Block 0x71, offset 0x1c40 0x1c40: 0x20b1, 0x1c41: 0x20b9, 0x1c42: 0x20d9, 0x1c43: 0x20f1, 0x1c44: 0x0040, 0x1c45: 0x2189, 0x1c46: 0x2109, 0x1c47: 0x20e1, 0x1c48: 0x2131, 0x1c49: 0x2191, 0x1c4a: 0x2161, 0x1c4b: 0x2169, 0x1c4c: 0x2171, 0x1c4d: 0x2179, 0x1c4e: 0x2111, 0x1c4f: 0x2141, 0x1c50: 0x2151, 0x1c51: 0x2121, 0x1c52: 0x2159, 0x1c53: 0x2101, 0x1c54: 0x2119, 0x1c55: 0x20c9, 0x1c56: 0x20d1, 0x1c57: 0x20e9, 0x1c58: 0x20f9, 0x1c59: 0x2129, 0x1c5a: 0x2139, 0x1c5b: 0x2149, 0x1c5c: 0x2311, 0x1c5d: 0x1689, 0x1c5e: 0x2319, 0x1c5f: 0x2321, 0x1c60: 0x0040, 0x1c61: 0x20b9, 0x1c62: 0x20d9, 0x1c63: 0x0040, 0x1c64: 0x2181, 0x1c65: 0x0040, 0x1c66: 0x0040, 0x1c67: 0x20e1, 0x1c68: 0x0040, 0x1c69: 0x2191, 0x1c6a: 0x2161, 0x1c6b: 0x2169, 0x1c6c: 0x2171, 0x1c6d: 0x2179, 0x1c6e: 0x2111, 0x1c6f: 0x2141, 0x1c70: 0x2151, 0x1c71: 0x2121, 0x1c72: 0x2159, 0x1c73: 0x0040, 0x1c74: 0x2119, 0x1c75: 0x20c9, 0x1c76: 0x20d1, 0x1c77: 0x20e9, 0x1c78: 0x0040, 0x1c79: 0x2129, 0x1c7a: 0x0040, 0x1c7b: 0x2149, 0x1c7c: 0x0040, 0x1c7d: 0x0040, 0x1c7e: 0x0040, 0x1c7f: 0x0040, // Block 0x72, offset 0x1c80 0x1c80: 0x0040, 0x1c81: 0x0040, 0x1c82: 0x20d9, 0x1c83: 0x0040, 0x1c84: 0x0040, 0x1c85: 0x0040, 0x1c86: 0x0040, 0x1c87: 0x20e1, 0x1c88: 0x0040, 0x1c89: 0x2191, 0x1c8a: 0x0040, 0x1c8b: 0x2169, 0x1c8c: 0x0040, 0x1c8d: 0x2179, 0x1c8e: 0x2111, 0x1c8f: 0x2141, 0x1c90: 0x0040, 0x1c91: 0x2121, 0x1c92: 0x2159, 0x1c93: 0x0040, 0x1c94: 0x2119, 0x1c95: 0x0040, 0x1c96: 0x0040, 0x1c97: 0x20e9, 0x1c98: 0x0040, 0x1c99: 0x2129, 0x1c9a: 0x0040, 0x1c9b: 0x2149, 0x1c9c: 0x0040, 0x1c9d: 0x1689, 0x1c9e: 0x0040, 0x1c9f: 0x2321, 0x1ca0: 0x0040, 0x1ca1: 0x20b9, 0x1ca2: 0x20d9, 0x1ca3: 0x0040, 0x1ca4: 0x2181, 0x1ca5: 0x0040, 0x1ca6: 0x0040, 0x1ca7: 0x20e1, 0x1ca8: 0x2131, 0x1ca9: 0x2191, 0x1caa: 0x2161, 0x1cab: 0x0040, 0x1cac: 0x2171, 0x1cad: 0x2179, 0x1cae: 0x2111, 0x1caf: 0x2141, 0x1cb0: 0x2151, 0x1cb1: 0x2121, 0x1cb2: 0x2159, 0x1cb3: 0x0040, 0x1cb4: 0x2119, 0x1cb5: 0x20c9, 0x1cb6: 0x20d1, 0x1cb7: 0x20e9, 0x1cb8: 0x0040, 0x1cb9: 0x2129, 0x1cba: 0x2139, 0x1cbb: 0x2149, 0x1cbc: 0x2311, 0x1cbd: 0x0040, 0x1cbe: 0x2319, 0x1cbf: 0x0040, // Block 0x73, offset 0x1cc0 0x1cc0: 0x20b1, 0x1cc1: 0x20b9, 0x1cc2: 0x20d9, 0x1cc3: 0x20f1, 0x1cc4: 0x2181, 0x1cc5: 0x2189, 0x1cc6: 0x2109, 0x1cc7: 0x20e1, 0x1cc8: 0x2131, 0x1cc9: 0x2191, 0x1cca: 0x0040, 0x1ccb: 0x2169, 0x1ccc: 0x2171, 0x1ccd: 0x2179, 0x1cce: 0x2111, 0x1ccf: 0x2141, 0x1cd0: 0x2151, 0x1cd1: 0x2121, 0x1cd2: 0x2159, 0x1cd3: 0x2101, 0x1cd4: 0x2119, 0x1cd5: 0x20c9, 0x1cd6: 0x20d1, 0x1cd7: 0x20e9, 0x1cd8: 0x20f9, 0x1cd9: 0x2129, 0x1cda: 0x2139, 0x1cdb: 0x2149, 0x1cdc: 0x0040, 0x1cdd: 0x0040, 0x1cde: 0x0040, 0x1cdf: 0x0040, 0x1ce0: 0x0040, 0x1ce1: 0x20b9, 0x1ce2: 0x20d9, 0x1ce3: 0x20f1, 0x1ce4: 0x0040, 0x1ce5: 0x2189, 0x1ce6: 0x2109, 0x1ce7: 0x20e1, 0x1ce8: 0x2131, 0x1ce9: 0x2191, 0x1cea: 0x0040, 0x1ceb: 0x2169, 0x1cec: 0x2171, 0x1ced: 0x2179, 0x1cee: 0x2111, 0x1cef: 0x2141, 0x1cf0: 0x2151, 0x1cf1: 0x2121, 0x1cf2: 0x2159, 0x1cf3: 0x2101, 0x1cf4: 0x2119, 0x1cf5: 0x20c9, 0x1cf6: 0x20d1, 0x1cf7: 0x20e9, 0x1cf8: 0x20f9, 0x1cf9: 0x2129, 0x1cfa: 0x2139, 0x1cfb: 0x2149, 0x1cfc: 0x0040, 0x1cfd: 0x0040, 0x1cfe: 0x0040, 0x1cff: 0x0040, // Block 0x74, offset 0x1d00 0x1d00: 0x0040, 0x1d01: 0x232a, 0x1d02: 0x2332, 0x1d03: 0x233a, 0x1d04: 0x2342, 0x1d05: 0x234a, 0x1d06: 0x2352, 0x1d07: 0x235a, 0x1d08: 0x2362, 0x1d09: 0x236a, 0x1d0a: 0x2372, 0x1d0b: 0x0018, 0x1d0c: 0x0018, 0x1d0d: 0x0018, 0x1d0e: 0x0018, 0x1d0f: 0x0018, 0x1d10: 0x237a, 0x1d11: 0x2382, 0x1d12: 0x238a, 0x1d13: 0x2392, 0x1d14: 0x239a, 0x1d15: 0x23a2, 0x1d16: 0x23aa, 0x1d17: 0x23b2, 0x1d18: 0x23ba, 0x1d19: 0x23c2, 0x1d1a: 0x23ca, 0x1d1b: 0x23d2, 0x1d1c: 0x23da, 0x1d1d: 0x23e2, 0x1d1e: 0x23ea, 0x1d1f: 0x23f2, 0x1d20: 0x23fa, 0x1d21: 0x2402, 0x1d22: 0x240a, 0x1d23: 0x2412, 0x1d24: 0x241a, 0x1d25: 0x2422, 0x1d26: 0x242a, 0x1d27: 0x2432, 0x1d28: 0x243a, 0x1d29: 0x2442, 0x1d2a: 0x2449, 0x1d2b: 0x03d9, 0x1d2c: 0x00b9, 0x1d2d: 0x1239, 0x1d2e: 0x2451, 0x1d2f: 0x0018, 0x1d30: 0x0019, 0x1d31: 0x02e9, 0x1d32: 0x03d9, 0x1d33: 0x02f1, 0x1d34: 0x02f9, 0x1d35: 0x03f1, 0x1d36: 0x0309, 0x1d37: 0x00a9, 0x1d38: 0x0311, 0x1d39: 0x00b1, 0x1d3a: 0x0319, 0x1d3b: 0x0101, 0x1d3c: 0x0321, 0x1d3d: 0x0329, 0x1d3e: 0x0051, 0x1d3f: 0x0339, // Block 0x75, offset 0x1d40 0x1d40: 0x0751, 0x1d41: 0x00b9, 0x1d42: 0x0089, 0x1d43: 0x0341, 0x1d44: 0x0349, 0x1d45: 0x0391, 0x1d46: 0x00c1, 0x1d47: 0x0109, 0x1d48: 0x00c9, 0x1d49: 0x04b1, 0x1d4a: 0x2459, 0x1d4b: 0x11f9, 0x1d4c: 0x2461, 0x1d4d: 0x04d9, 0x1d4e: 0x2469, 0x1d4f: 0x2471, 0x1d50: 0x0018, 0x1d51: 0x0018, 0x1d52: 0x0018, 0x1d53: 0x0018, 0x1d54: 0x0018, 0x1d55: 0x0018, 0x1d56: 0x0018, 0x1d57: 0x0018, 0x1d58: 0x0018, 0x1d59: 0x0018, 0x1d5a: 0x0018, 0x1d5b: 0x0018, 0x1d5c: 0x0018, 0x1d5d: 0x0018, 0x1d5e: 0x0018, 0x1d5f: 0x0018, 0x1d60: 0x0018, 0x1d61: 0x0018, 0x1d62: 0x0018, 0x1d63: 0x0018, 0x1d64: 0x0018, 0x1d65: 0x0018, 0x1d66: 0x0018, 0x1d67: 0x0018, 0x1d68: 0x0018, 0x1d69: 0x0018, 0x1d6a: 0x2479, 0x1d6b: 0x2481, 0x1d6c: 0x2489, 0x1d6d: 0x0018, 0x1d6e: 0x0018, 0x1d6f: 0x0018, 0x1d70: 0x0018, 0x1d71: 0x0018, 0x1d72: 0x0018, 0x1d73: 0x0018, 0x1d74: 0x0018, 0x1d75: 0x0018, 0x1d76: 0x0018, 0x1d77: 0x0018, 0x1d78: 0x0018, 0x1d79: 0x0018, 0x1d7a: 0x0018, 0x1d7b: 0x0018, 0x1d7c: 0x0018, 0x1d7d: 0x0018, 0x1d7e: 0x0018, 0x1d7f: 0x0018, // Block 0x76, offset 0x1d80 0x1d80: 0x2499, 0x1d81: 0x24a1, 0x1d82: 0x24a9, 0x1d83: 0x0040, 0x1d84: 0x0040, 0x1d85: 0x0040, 0x1d86: 0x0040, 0x1d87: 0x0040, 0x1d88: 0x0040, 0x1d89: 0x0040, 0x1d8a: 0x0040, 0x1d8b: 0x0040, 0x1d8c: 0x0040, 0x1d8d: 0x0040, 0x1d8e: 0x0040, 0x1d8f: 0x0040, 0x1d90: 0x24b1, 0x1d91: 0x24b9, 0x1d92: 0x24c1, 0x1d93: 0x24c9, 0x1d94: 0x24d1, 0x1d95: 0x24d9, 0x1d96: 0x24e1, 0x1d97: 0x24e9, 0x1d98: 0x24f1, 0x1d99: 0x24f9, 0x1d9a: 0x2501, 0x1d9b: 0x2509, 0x1d9c: 0x2511, 0x1d9d: 0x2519, 0x1d9e: 0x2521, 0x1d9f: 0x2529, 0x1da0: 0x2531, 0x1da1: 0x2539, 0x1da2: 0x2541, 0x1da3: 0x2549, 0x1da4: 0x2551, 0x1da5: 0x2559, 0x1da6: 0x2561, 0x1da7: 0x2569, 0x1da8: 0x2571, 0x1da9: 0x2579, 0x1daa: 0x2581, 0x1dab: 0x2589, 0x1dac: 0x2591, 0x1dad: 0x2599, 0x1dae: 0x25a1, 0x1daf: 0x25a9, 0x1db0: 0x25b1, 0x1db1: 0x25b9, 0x1db2: 0x25c1, 0x1db3: 0x25c9, 0x1db4: 0x25d1, 0x1db5: 0x25d9, 0x1db6: 0x25e1, 0x1db7: 0x25e9, 0x1db8: 0x25f1, 0x1db9: 0x25f9, 0x1dba: 0x2601, 0x1dbb: 0x2609, 0x1dbc: 0x0040, 0x1dbd: 0x0040, 0x1dbe: 0x0040, 0x1dbf: 0x0040, // Block 0x77, offset 0x1dc0 0x1dc0: 0x2669, 0x1dc1: 0x2671, 0x1dc2: 0x2679, 0x1dc3: 0x8b55, 0x1dc4: 0x2681, 0x1dc5: 0x2689, 0x1dc6: 0x2691, 0x1dc7: 0x2699, 0x1dc8: 0x26a1, 0x1dc9: 0x26a9, 0x1dca: 0x26b1, 0x1dcb: 0x26b9, 0x1dcc: 0x26c1, 0x1dcd: 0x8b75, 0x1dce: 0x26c9, 0x1dcf: 0x26d1, 0x1dd0: 0x26d9, 0x1dd1: 0x26e1, 0x1dd2: 0x8b95, 0x1dd3: 0x26e9, 0x1dd4: 0x26f1, 0x1dd5: 0x2521, 0x1dd6: 0x8bb5, 0x1dd7: 0x26f9, 0x1dd8: 0x2701, 0x1dd9: 0x2709, 0x1dda: 0x2711, 0x1ddb: 0x2719, 0x1ddc: 0x8bd5, 0x1ddd: 0x2721, 0x1dde: 0x2729, 0x1ddf: 0x2731, 0x1de0: 0x2739, 0x1de1: 0x2741, 0x1de2: 0x25f9, 0x1de3: 0x2749, 0x1de4: 0x2751, 0x1de5: 0x2759, 0x1de6: 0x2761, 0x1de7: 0x2769, 0x1de8: 0x2771, 0x1de9: 0x2779, 0x1dea: 0x2781, 0x1deb: 0x2789, 0x1dec: 0x2791, 0x1ded: 0x2799, 0x1dee: 0x27a1, 0x1def: 0x27a9, 0x1df0: 0x27b1, 0x1df1: 0x27b9, 0x1df2: 0x27b9, 0x1df3: 0x27b9, 0x1df4: 0x8bf5, 0x1df5: 0x27c1, 0x1df6: 0x27c9, 0x1df7: 0x27d1, 0x1df8: 0x8c15, 0x1df9: 0x27d9, 0x1dfa: 0x27e1, 0x1dfb: 0x27e9, 0x1dfc: 0x27f1, 0x1dfd: 0x27f9, 0x1dfe: 0x2801, 0x1dff: 0x2809, // Block 0x78, offset 0x1e00 0x1e00: 0x2811, 0x1e01: 0x2819, 0x1e02: 0x2821, 0x1e03: 0x2829, 0x1e04: 0x2831, 0x1e05: 0x2839, 0x1e06: 0x2839, 0x1e07: 0x2841, 0x1e08: 0x2849, 0x1e09: 0x2851, 0x1e0a: 0x2859, 0x1e0b: 0x2861, 0x1e0c: 0x2869, 0x1e0d: 0x2871, 0x1e0e: 0x2879, 0x1e0f: 0x2881, 0x1e10: 0x2889, 0x1e11: 0x2891, 0x1e12: 0x2899, 0x1e13: 0x28a1, 0x1e14: 0x28a9, 0x1e15: 0x28b1, 0x1e16: 0x28b9, 0x1e17: 0x28c1, 0x1e18: 0x28c9, 0x1e19: 0x8c35, 0x1e1a: 0x28d1, 0x1e1b: 0x28d9, 0x1e1c: 0x28e1, 0x1e1d: 0x24d9, 0x1e1e: 0x28e9, 0x1e1f: 0x28f1, 0x1e20: 0x8c55, 0x1e21: 0x8c75, 0x1e22: 0x28f9, 0x1e23: 0x2901, 0x1e24: 0x2909, 0x1e25: 0x2911, 0x1e26: 0x2919, 0x1e27: 0x2921, 0x1e28: 0x2040, 0x1e29: 0x2929, 0x1e2a: 0x2931, 0x1e2b: 0x2931, 0x1e2c: 0x8c95, 0x1e2d: 0x2939, 0x1e2e: 0x2941, 0x1e2f: 0x2949, 0x1e30: 0x2951, 0x1e31: 0x8cb5, 0x1e32: 0x2959, 0x1e33: 0x2961, 0x1e34: 0x2040, 0x1e35: 0x2969, 0x1e36: 0x2971, 0x1e37: 0x2979, 0x1e38: 0x2981, 0x1e39: 0x2989, 0x1e3a: 0x2991, 0x1e3b: 0x8cd5, 0x1e3c: 0x2999, 0x1e3d: 0x8cf5, 0x1e3e: 0x29a1, 0x1e3f: 0x29a9, // Block 0x79, offset 0x1e40 0x1e40: 0x29b1, 0x1e41: 0x29b9, 0x1e42: 0x29c1, 0x1e43: 0x29c9, 0x1e44: 0x29d1, 0x1e45: 0x29d9, 0x1e46: 0x29e1, 0x1e47: 0x29e9, 0x1e48: 0x29f1, 0x1e49: 0x8d15, 0x1e4a: 0x29f9, 0x1e4b: 0x2a01, 0x1e4c: 0x2a09, 0x1e4d: 0x2a11, 0x1e4e: 0x2a19, 0x1e4f: 0x8d35, 0x1e50: 0x2a21, 0x1e51: 0x8d55, 0x1e52: 0x8d75, 0x1e53: 0x2a29, 0x1e54: 0x2a31, 0x1e55: 0x2a31, 0x1e56: 0x2a39, 0x1e57: 0x8d95, 0x1e58: 0x8db5, 0x1e59: 0x2a41, 0x1e5a: 0x2a49, 0x1e5b: 0x2a51, 0x1e5c: 0x2a59, 0x1e5d: 0x2a61, 0x1e5e: 0x2a69, 0x1e5f: 0x2a71, 0x1e60: 0x2a79, 0x1e61: 0x2a81, 0x1e62: 0x2a89, 0x1e63: 0x2a91, 0x1e64: 0x8dd5, 0x1e65: 0x2a99, 0x1e66: 0x2aa1, 0x1e67: 0x2aa9, 0x1e68: 0x2ab1, 0x1e69: 0x2aa9, 0x1e6a: 0x2ab9, 0x1e6b: 0x2ac1, 0x1e6c: 0x2ac9, 0x1e6d: 0x2ad1, 0x1e6e: 0x2ad9, 0x1e6f: 0x2ae1, 0x1e70: 0x2ae9, 0x1e71: 0x2af1, 0x1e72: 0x2af9, 0x1e73: 0x2b01, 0x1e74: 0x2b09, 0x1e75: 0x2b11, 0x1e76: 0x2b19, 0x1e77: 0x2b21, 0x1e78: 0x8df5, 0x1e79: 0x2b29, 0x1e7a: 0x2b31, 0x1e7b: 0x2b39, 0x1e7c: 0x2b41, 0x1e7d: 0x2b49, 0x1e7e: 0x8e15, 0x1e7f: 0x2b51, // Block 0x7a, offset 0x1e80 0x1e80: 0x2b59, 0x1e81: 0x2b61, 0x1e82: 0x2b69, 0x1e83: 0x2b71, 0x1e84: 0x2b79, 0x1e85: 0x2b81, 0x1e86: 0x2b89, 0x1e87: 0x2b91, 0x1e88: 0x2b99, 0x1e89: 0x2ba1, 0x1e8a: 0x8e35, 0x1e8b: 0x2ba9, 0x1e8c: 0x2bb1, 0x1e8d: 0x2bb9, 0x1e8e: 0x2bc1, 0x1e8f: 0x2bc9, 0x1e90: 0x2bd1, 0x1e91: 0x2bd9, 0x1e92: 0x2be1, 0x1e93: 0x2be9, 0x1e94: 0x2bf1, 0x1e95: 0x2bf9, 0x1e96: 0x2c01, 0x1e97: 0x2c09, 0x1e98: 0x2c11, 0x1e99: 0x2c19, 0x1e9a: 0x2c21, 0x1e9b: 0x2c29, 0x1e9c: 0x2c31, 0x1e9d: 0x8e55, 0x1e9e: 0x2c39, 0x1e9f: 0x2c41, 0x1ea0: 0x2c49, 0x1ea1: 0x2c51, 0x1ea2: 0x2c59, 0x1ea3: 0x8e75, 0x1ea4: 0x2c61, 0x1ea5: 0x2c69, 0x1ea6: 0x2c71, 0x1ea7: 0x2c79, 0x1ea8: 0x2c81, 0x1ea9: 0x2c89, 0x1eaa: 0x2c91, 0x1eab: 0x2c99, 0x1eac: 0x7f0d, 0x1ead: 0x2ca1, 0x1eae: 0x2ca9, 0x1eaf: 0x2cb1, 0x1eb0: 0x8e95, 0x1eb1: 0x2cb9, 0x1eb2: 0x2cc1, 0x1eb3: 0x2cc9, 0x1eb4: 0x2cd1, 0x1eb5: 0x2cd9, 0x1eb6: 0x2ce1, 0x1eb7: 0x8eb5, 0x1eb8: 0x8ed5, 0x1eb9: 0x8ef5, 0x1eba: 0x2ce9, 0x1ebb: 0x8f15, 0x1ebc: 0x2cf1, 0x1ebd: 0x2cf9, 0x1ebe: 0x2d01, 0x1ebf: 0x2d09, // Block 0x7b, offset 0x1ec0 0x1ec0: 0x2d11, 0x1ec1: 0x2d19, 0x1ec2: 0x2d21, 0x1ec3: 0x2d29, 0x1ec4: 0x2d31, 0x1ec5: 0x2d39, 0x1ec6: 0x8f35, 0x1ec7: 0x2d41, 0x1ec8: 0x2d49, 0x1ec9: 0x2d51, 0x1eca: 0x2d59, 0x1ecb: 0x2d61, 0x1ecc: 0x2d69, 0x1ecd: 0x8f55, 0x1ece: 0x2d71, 0x1ecf: 0x2d79, 0x1ed0: 0x8f75, 0x1ed1: 0x8f95, 0x1ed2: 0x2d81, 0x1ed3: 0x2d89, 0x1ed4: 0x2d91, 0x1ed5: 0x2d99, 0x1ed6: 0x2da1, 0x1ed7: 0x2da9, 0x1ed8: 0x2db1, 0x1ed9: 0x2db9, 0x1eda: 0x2dc1, 0x1edb: 0x8fb5, 0x1edc: 0x2dc9, 0x1edd: 0x8fd5, 0x1ede: 0x2dd1, 0x1edf: 0x2040, 0x1ee0: 0x2dd9, 0x1ee1: 0x2de1, 0x1ee2: 0x2de9, 0x1ee3: 0x8ff5, 0x1ee4: 0x2df1, 0x1ee5: 0x2df9, 0x1ee6: 0x9015, 0x1ee7: 0x9035, 0x1ee8: 0x2e01, 0x1ee9: 0x2e09, 0x1eea: 0x2e11, 0x1eeb: 0x2e19, 0x1eec: 0x2e21, 0x1eed: 0x2e21, 0x1eee: 0x2e29, 0x1eef: 0x2e31, 0x1ef0: 0x2e39, 0x1ef1: 0x2e41, 0x1ef2: 0x2e49, 0x1ef3: 0x2e51, 0x1ef4: 0x2e59, 0x1ef5: 0x9055, 0x1ef6: 0x2e61, 0x1ef7: 0x9075, 0x1ef8: 0x2e69, 0x1ef9: 0x9095, 0x1efa: 0x2e71, 0x1efb: 0x90b5, 0x1efc: 0x90d5, 0x1efd: 0x90f5, 0x1efe: 0x2e79, 0x1eff: 0x2e81, // Block 0x7c, offset 0x1f00 0x1f00: 0x2e89, 0x1f01: 0x9115, 0x1f02: 0x9135, 0x1f03: 0x9155, 0x1f04: 0x9175, 0x1f05: 0x2e91, 0x1f06: 0x2e99, 0x1f07: 0x2e99, 0x1f08: 0x2ea1, 0x1f09: 0x2ea9, 0x1f0a: 0x2eb1, 0x1f0b: 0x2eb9, 0x1f0c: 0x2ec1, 0x1f0d: 0x9195, 0x1f0e: 0x2ec9, 0x1f0f: 0x2ed1, 0x1f10: 0x2ed9, 0x1f11: 0x2ee1, 0x1f12: 0x91b5, 0x1f13: 0x2ee9, 0x1f14: 0x91d5, 0x1f15: 0x91f5, 0x1f16: 0x2ef1, 0x1f17: 0x2ef9, 0x1f18: 0x2f01, 0x1f19: 0x2f09, 0x1f1a: 0x2f11, 0x1f1b: 0x2f19, 0x1f1c: 0x9215, 0x1f1d: 0x9235, 0x1f1e: 0x9255, 0x1f1f: 0x2040, 0x1f20: 0x2f21, 0x1f21: 0x9275, 0x1f22: 0x2f29, 0x1f23: 0x2f31, 0x1f24: 0x2f39, 0x1f25: 0x9295, 0x1f26: 0x2f41, 0x1f27: 0x2f49, 0x1f28: 0x2f51, 0x1f29: 0x2f59, 0x1f2a: 0x2f61, 0x1f2b: 0x92b5, 0x1f2c: 0x2f69, 0x1f2d: 0x2f71, 0x1f2e: 0x2f79, 0x1f2f: 0x2f81, 0x1f30: 0x2f89, 0x1f31: 0x2f91, 0x1f32: 0x92d5, 0x1f33: 0x92f5, 0x1f34: 0x2f99, 0x1f35: 0x9315, 0x1f36: 0x2fa1, 0x1f37: 0x9335, 0x1f38: 0x2fa9, 0x1f39: 0x2fb1, 0x1f3a: 0x2fb9, 0x1f3b: 0x9355, 0x1f3c: 0x9375, 0x1f3d: 0x2fc1, 0x1f3e: 0x9395, 0x1f3f: 0x2fc9, // Block 0x7d, offset 0x1f40 0x1f40: 0x93b5, 0x1f41: 0x2fd1, 0x1f42: 0x2fd9, 0x1f43: 0x2fe1, 0x1f44: 0x2fe9, 0x1f45: 0x2ff1, 0x1f46: 0x2ff9, 0x1f47: 0x93d5, 0x1f48: 0x93f5, 0x1f49: 0x9415, 0x1f4a: 0x9435, 0x1f4b: 0x2a29, 0x1f4c: 0x3001, 0x1f4d: 0x3009, 0x1f4e: 0x3011, 0x1f4f: 0x3019, 0x1f50: 0x3021, 0x1f51: 0x3029, 0x1f52: 0x3031, 0x1f53: 0x3039, 0x1f54: 0x3041, 0x1f55: 0x3049, 0x1f56: 0x3051, 0x1f57: 0x9455, 0x1f58: 0x3059, 0x1f59: 0x3061, 0x1f5a: 0x3069, 0x1f5b: 0x3071, 0x1f5c: 0x3079, 0x1f5d: 0x3081, 0x1f5e: 0x3089, 0x1f5f: 0x3091, 0x1f60: 0x3099, 0x1f61: 0x30a1, 0x1f62: 0x30a9, 0x1f63: 0x30b1, 0x1f64: 0x9475, 0x1f65: 0x9495, 0x1f66: 0x94b5, 0x1f67: 0x30b9, 0x1f68: 0x30c1, 0x1f69: 0x30c9, 0x1f6a: 0x30d1, 0x1f6b: 0x94d5, 0x1f6c: 0x30d9, 0x1f6d: 0x94f5, 0x1f6e: 0x30e1, 0x1f6f: 0x30e9, 0x1f70: 0x9515, 0x1f71: 0x9535, 0x1f72: 0x30f1, 0x1f73: 0x30f9, 0x1f74: 0x3101, 0x1f75: 0x3109, 0x1f76: 0x3111, 0x1f77: 0x3119, 0x1f78: 0x3121, 0x1f79: 0x3129, 0x1f7a: 0x3131, 0x1f7b: 0x3139, 0x1f7c: 0x3141, 0x1f7d: 0x3149, 0x1f7e: 0x3151, 0x1f7f: 0x2040, // Block 0x7e, offset 0x1f80 0x1f80: 0x3159, 0x1f81: 0x3161, 0x1f82: 0x3169, 0x1f83: 0x3171, 0x1f84: 0x3179, 0x1f85: 0x9555, 0x1f86: 0x3181, 0x1f87: 0x3189, 0x1f88: 0x3191, 0x1f89: 0x3199, 0x1f8a: 0x31a1, 0x1f8b: 0x9575, 0x1f8c: 0x9595, 0x1f8d: 0x31a9, 0x1f8e: 0x31b1, 0x1f8f: 0x31b9, 0x1f90: 0x31c1, 0x1f91: 0x31c9, 0x1f92: 0x31d1, 0x1f93: 0x95b5, 0x1f94: 0x31d9, 0x1f95: 0x31e1, 0x1f96: 0x31e9, 0x1f97: 0x31f1, 0x1f98: 0x95d5, 0x1f99: 0x95f5, 0x1f9a: 0x31f9, 0x1f9b: 0x3201, 0x1f9c: 0x3209, 0x1f9d: 0x9615, 0x1f9e: 0x3211, 0x1f9f: 0x3219, 0x1fa0: 0x684d, 0x1fa1: 0x9635, 0x1fa2: 0x3221, 0x1fa3: 0x3229, 0x1fa4: 0x3231, 0x1fa5: 0x9655, 0x1fa6: 0x3239, 0x1fa7: 0x3241, 0x1fa8: 0x3249, 0x1fa9: 0x3251, 0x1faa: 0x3259, 0x1fab: 0x3261, 0x1fac: 0x3269, 0x1fad: 0x9675, 0x1fae: 0x3271, 0x1faf: 0x3279, 0x1fb0: 0x3281, 0x1fb1: 0x9695, 0x1fb2: 0x3289, 0x1fb3: 0x3291, 0x1fb4: 0x3299, 0x1fb5: 0x32a1, 0x1fb6: 0x7b6d, 0x1fb7: 0x96b5, 0x1fb8: 0x32a9, 0x1fb9: 0x32b1, 0x1fba: 0x32b9, 0x1fbb: 0x96d5, 0x1fbc: 0x32c1, 0x1fbd: 0x96f5, 0x1fbe: 0x32c9, 0x1fbf: 0x32c9, // Block 0x7f, offset 0x1fc0 0x1fc0: 0x32d1, 0x1fc1: 0x9715, 0x1fc2: 0x32d9, 0x1fc3: 0x32e1, 0x1fc4: 0x32e9, 0x1fc5: 0x32f1, 0x1fc6: 0x32f9, 0x1fc7: 0x3301, 0x1fc8: 0x3309, 0x1fc9: 0x9735, 0x1fca: 0x3311, 0x1fcb: 0x3319, 0x1fcc: 0x3321, 0x1fcd: 0x3329, 0x1fce: 0x3331, 0x1fcf: 0x3339, 0x1fd0: 0x9755, 0x1fd1: 0x3341, 0x1fd2: 0x9775, 0x1fd3: 0x9795, 0x1fd4: 0x97b5, 0x1fd5: 0x3349, 0x1fd6: 0x3351, 0x1fd7: 0x3359, 0x1fd8: 0x3361, 0x1fd9: 0x3369, 0x1fda: 0x3371, 0x1fdb: 0x3379, 0x1fdc: 0x3381, 0x1fdd: 0x97d5, 0x1fde: 0x0040, 0x1fdf: 0x0040, 0x1fe0: 0x0040, 0x1fe1: 0x0040, 0x1fe2: 0x0040, 0x1fe3: 0x0040, 0x1fe4: 0x0040, 0x1fe5: 0x0040, 0x1fe6: 0x0040, 0x1fe7: 0x0040, 0x1fe8: 0x0040, 0x1fe9: 0x0040, 0x1fea: 0x0040, 0x1feb: 0x0040, 0x1fec: 0x0040, 0x1fed: 0x0040, 0x1fee: 0x0040, 0x1fef: 0x0040, 0x1ff0: 0x0040, 0x1ff1: 0x0040, 0x1ff2: 0x0040, 0x1ff3: 0x0040, 0x1ff4: 0x0040, 0x1ff5: 0x0040, 0x1ff6: 0x0040, 0x1ff7: 0x0040, 0x1ff8: 0x0040, 0x1ff9: 0x0040, 0x1ffa: 0x0040, 0x1ffb: 0x0040, 0x1ffc: 0x0040, 0x1ffd: 0x0040, 0x1ffe: 0x0040, 0x1fff: 0x0040, } // idnaIndex: 37 blocks, 2368 entries, 4736 bytes // Block 0 is the zero block. var idnaIndex = [2368]uint16{ // Block 0x0, offset 0x0 // Block 0x1, offset 0x40 // Block 0x2, offset 0x80 // Block 0x3, offset 0xc0 0xc2: 0x01, 0xc3: 0x7e, 0xc4: 0x02, 0xc5: 0x03, 0xc6: 0x04, 0xc7: 0x05, 0xc8: 0x06, 0xc9: 0x7f, 0xca: 0x80, 0xcb: 0x07, 0xcc: 0x81, 0xcd: 0x08, 0xce: 0x09, 0xcf: 0x0a, 0xd0: 0x82, 0xd1: 0x0b, 0xd2: 0x0c, 0xd3: 0x0d, 0xd4: 0x0e, 0xd5: 0x83, 0xd6: 0x84, 0xd7: 0x85, 0xd8: 0x0f, 0xd9: 0x10, 0xda: 0x86, 0xdb: 0x11, 0xdc: 0x12, 0xdd: 0x87, 0xde: 0x88, 0xdf: 0x89, 0xe0: 0x02, 0xe1: 0x03, 0xe2: 0x04, 0xe3: 0x05, 0xe4: 0x06, 0xe5: 0x07, 0xe6: 0x07, 0xe7: 0x07, 0xe8: 0x07, 0xe9: 0x08, 0xea: 0x09, 0xeb: 0x07, 0xec: 0x07, 0xed: 0x0a, 0xee: 0x0b, 0xef: 0x0c, 0xf0: 0x1e, 0xf1: 0x1f, 0xf2: 0x1f, 0xf3: 0x21, 0xf4: 0x22, // Block 0x4, offset 0x100 0x120: 0x8a, 0x121: 0x13, 0x122: 0x8b, 0x123: 0x8c, 0x124: 0x8d, 0x125: 0x14, 0x126: 0x15, 0x127: 0x16, 0x128: 0x17, 0x129: 0x18, 0x12a: 0x19, 0x12b: 0x1a, 0x12c: 0x1b, 0x12d: 0x1c, 0x12e: 0x1d, 0x12f: 0x8e, 0x130: 0x8f, 0x131: 0x1e, 0x132: 0x1f, 0x133: 0x20, 0x134: 0x90, 0x135: 0x21, 0x136: 0x91, 0x137: 0x92, 0x138: 0x93, 0x139: 0x94, 0x13a: 0x22, 0x13b: 0x95, 0x13c: 0x96, 0x13d: 0x23, 0x13e: 0x24, 0x13f: 0x97, // Block 0x5, offset 0x140 0x140: 0x98, 0x141: 0x99, 0x142: 0x9a, 0x143: 0x9b, 0x144: 0x9c, 0x145: 0x9d, 0x146: 0x9e, 0x147: 0x9f, 0x148: 0xa0, 0x149: 0xa1, 0x14a: 0xa2, 0x14b: 0xa3, 0x14c: 0xa4, 0x14d: 0xa5, 0x14e: 0xa6, 0x14f: 0xa7, 0x150: 0xa8, 0x151: 0xa0, 0x152: 0xa0, 0x153: 0xa0, 0x154: 0xa0, 0x155: 0xa0, 0x156: 0xa0, 0x157: 0xa0, 0x158: 0xa0, 0x159: 0xa9, 0x15a: 0xaa, 0x15b: 0xab, 0x15c: 0xac, 0x15d: 0xad, 0x15e: 0xae, 0x15f: 0xaf, 0x160: 0xb0, 0x161: 0xb1, 0x162: 0xb2, 0x163: 0xb3, 0x164: 0xb4, 0x165: 0xb5, 0x166: 0xb6, 0x167: 0xb7, 0x168: 0xb8, 0x169: 0xb9, 0x16a: 0xba, 0x16b: 0xbb, 0x16c: 0xbc, 0x16d: 0xbd, 0x16e: 0xbe, 0x16f: 0xbf, 0x170: 0xc0, 0x171: 0xc1, 0x172: 0xc2, 0x173: 0xc3, 0x174: 0x25, 0x175: 0x26, 0x176: 0x27, 0x177: 0xc4, 0x178: 0x28, 0x179: 0x28, 0x17a: 0x29, 0x17b: 0x28, 0x17c: 0xc5, 0x17d: 0x2a, 0x17e: 0x2b, 0x17f: 0x2c, // Block 0x6, offset 0x180 0x180: 0x2d, 0x181: 0x2e, 0x182: 0x2f, 0x183: 0xc6, 0x184: 0x30, 0x185: 0x31, 0x186: 0xc7, 0x187: 0x9c, 0x188: 0xc8, 0x189: 0xc9, 0x18a: 0x9c, 0x18b: 0x9c, 0x18c: 0xca, 0x18d: 0x9c, 0x18e: 0x9c, 0x18f: 0x9c, 0x190: 0xcb, 0x191: 0x32, 0x192: 0x33, 0x193: 0x34, 0x194: 0x9c, 0x195: 0x9c, 0x196: 0x9c, 0x197: 0x9c, 0x198: 0x9c, 0x199: 0x9c, 0x19a: 0x9c, 0x19b: 0x9c, 0x19c: 0x9c, 0x19d: 0x9c, 0x19e: 0x9c, 0x19f: 0x9c, 0x1a0: 0x9c, 0x1a1: 0x9c, 0x1a2: 0x9c, 0x1a3: 0x9c, 0x1a4: 0x9c, 0x1a5: 0x9c, 0x1a6: 0x9c, 0x1a7: 0x9c, 0x1a8: 0xcc, 0x1a9: 0xcd, 0x1aa: 0x9c, 0x1ab: 0xce, 0x1ac: 0x9c, 0x1ad: 0xcf, 0x1ae: 0xd0, 0x1af: 0x9c, 0x1b0: 0xd1, 0x1b1: 0x35, 0x1b2: 0x28, 0x1b3: 0x36, 0x1b4: 0xd2, 0x1b5: 0xd3, 0x1b6: 0xd4, 0x1b7: 0xd5, 0x1b8: 0xd6, 0x1b9: 0xd7, 0x1ba: 0xd8, 0x1bb: 0xd9, 0x1bc: 0xda, 0x1bd: 0xdb, 0x1be: 0xdc, 0x1bf: 0x37, // Block 0x7, offset 0x1c0 0x1c0: 0x38, 0x1c1: 0xdd, 0x1c2: 0xde, 0x1c3: 0xdf, 0x1c4: 0xe0, 0x1c5: 0x39, 0x1c6: 0x3a, 0x1c7: 0xe1, 0x1c8: 0xe2, 0x1c9: 0x3b, 0x1ca: 0x3c, 0x1cb: 0x3d, 0x1cc: 0xe3, 0x1cd: 0xe4, 0x1ce: 0x3e, 0x1cf: 0x3f, 0x1d0: 0xa0, 0x1d1: 0xa0, 0x1d2: 0xa0, 0x1d3: 0xa0, 0x1d4: 0xa0, 0x1d5: 0xa0, 0x1d6: 0xa0, 0x1d7: 0xa0, 0x1d8: 0xa0, 0x1d9: 0xa0, 0x1da: 0xa0, 0x1db: 0xa0, 0x1dc: 0xa0, 0x1dd: 0xa0, 0x1de: 0xa0, 0x1df: 0xa0, 0x1e0: 0xa0, 0x1e1: 0xa0, 0x1e2: 0xa0, 0x1e3: 0xa0, 0x1e4: 0xa0, 0x1e5: 0xa0, 0x1e6: 0xa0, 0x1e7: 0xa0, 0x1e8: 0xa0, 0x1e9: 0xa0, 0x1ea: 0xa0, 0x1eb: 0xa0, 0x1ec: 0xa0, 0x1ed: 0xa0, 0x1ee: 0xa0, 0x1ef: 0xa0, 0x1f0: 0xa0, 0x1f1: 0xa0, 0x1f2: 0xa0, 0x1f3: 0xa0, 0x1f4: 0xa0, 0x1f5: 0xa0, 0x1f6: 0xa0, 0x1f7: 0xa0, 0x1f8: 0xa0, 0x1f9: 0xa0, 0x1fa: 0xa0, 0x1fb: 0xa0, 0x1fc: 0xa0, 0x1fd: 0xa0, 0x1fe: 0xa0, 0x1ff: 0xa0, // Block 0x8, offset 0x200 0x200: 0xa0, 0x201: 0xa0, 0x202: 0xa0, 0x203: 0xa0, 0x204: 0xa0, 0x205: 0xa0, 0x206: 0xa0, 0x207: 0xa0, 0x208: 0xa0, 0x209: 0xa0, 0x20a: 0xa0, 0x20b: 0xa0, 0x20c: 0xa0, 0x20d: 0xa0, 0x20e: 0xa0, 0x20f: 0xa0, 0x210: 0xa0, 0x211: 0xa0, 0x212: 0xa0, 0x213: 0xa0, 0x214: 0xa0, 0x215: 0xa0, 0x216: 0xa0, 0x217: 0xa0, 0x218: 0xa0, 0x219: 0xa0, 0x21a: 0xa0, 0x21b: 0xa0, 0x21c: 0xa0, 0x21d: 0xa0, 0x21e: 0xa0, 0x21f: 0xa0, 0x220: 0xa0, 0x221: 0xa0, 0x222: 0xa0, 0x223: 0xa0, 0x224: 0xa0, 0x225: 0xa0, 0x226: 0xa0, 0x227: 0xa0, 0x228: 0xa0, 0x229: 0xa0, 0x22a: 0xa0, 0x22b: 0xa0, 0x22c: 0xa0, 0x22d: 0xa0, 0x22e: 0xa0, 0x22f: 0xa0, 0x230: 0xa0, 0x231: 0xa0, 0x232: 0xa0, 0x233: 0xa0, 0x234: 0xa0, 0x235: 0xa0, 0x236: 0xa0, 0x237: 0x9c, 0x238: 0xa0, 0x239: 0xa0, 0x23a: 0xa0, 0x23b: 0xa0, 0x23c: 0xa0, 0x23d: 0xa0, 0x23e: 0xa0, 0x23f: 0xa0, // Block 0x9, offset 0x240 0x240: 0xa0, 0x241: 0xa0, 0x242: 0xa0, 0x243: 0xa0, 0x244: 0xa0, 0x245: 0xa0, 0x246: 0xa0, 0x247: 0xa0, 0x248: 0xa0, 0x249: 0xa0, 0x24a: 0xa0, 0x24b: 0xa0, 0x24c: 0xa0, 0x24d: 0xa0, 0x24e: 0xa0, 0x24f: 0xa0, 0x250: 0xa0, 0x251: 0xa0, 0x252: 0xa0, 0x253: 0xa0, 0x254: 0xa0, 0x255: 0xa0, 0x256: 0xa0, 0x257: 0xa0, 0x258: 0xa0, 0x259: 0xa0, 0x25a: 0xa0, 0x25b: 0xa0, 0x25c: 0xa0, 0x25d: 0xa0, 0x25e: 0xa0, 0x25f: 0xa0, 0x260: 0xa0, 0x261: 0xa0, 0x262: 0xa0, 0x263: 0xa0, 0x264: 0xa0, 0x265: 0xa0, 0x266: 0xa0, 0x267: 0xa0, 0x268: 0xa0, 0x269: 0xa0, 0x26a: 0xa0, 0x26b: 0xa0, 0x26c: 0xa0, 0x26d: 0xa0, 0x26e: 0xa0, 0x26f: 0xa0, 0x270: 0xa0, 0x271: 0xa0, 0x272: 0xa0, 0x273: 0xa0, 0x274: 0xa0, 0x275: 0xa0, 0x276: 0xa0, 0x277: 0xa0, 0x278: 0xa0, 0x279: 0xa0, 0x27a: 0xa0, 0x27b: 0xa0, 0x27c: 0xa0, 0x27d: 0xa0, 0x27e: 0xa0, 0x27f: 0xa0, // Block 0xa, offset 0x280 0x280: 0xa0, 0x281: 0xa0, 0x282: 0xa0, 0x283: 0xa0, 0x284: 0xa0, 0x285: 0xa0, 0x286: 0xa0, 0x287: 0xa0, 0x288: 0xa0, 0x289: 0xa0, 0x28a: 0xa0, 0x28b: 0xa0, 0x28c: 0xa0, 0x28d: 0xa0, 0x28e: 0xa0, 0x28f: 0xa0, 0x290: 0xa0, 0x291: 0xa0, 0x292: 0xa0, 0x293: 0xa0, 0x294: 0xa0, 0x295: 0xa0, 0x296: 0xa0, 0x297: 0xa0, 0x298: 0xa0, 0x299: 0xa0, 0x29a: 0xa0, 0x29b: 0xa0, 0x29c: 0xa0, 0x29d: 0xa0, 0x29e: 0xa0, 0x29f: 0xa0, 0x2a0: 0xa0, 0x2a1: 0xa0, 0x2a2: 0xa0, 0x2a3: 0xa0, 0x2a4: 0xa0, 0x2a5: 0xa0, 0x2a6: 0xa0, 0x2a7: 0xa0, 0x2a8: 0xa0, 0x2a9: 0xa0, 0x2aa: 0xa0, 0x2ab: 0xa0, 0x2ac: 0xa0, 0x2ad: 0xa0, 0x2ae: 0xa0, 0x2af: 0xa0, 0x2b0: 0xa0, 0x2b1: 0xa0, 0x2b2: 0xa0, 0x2b3: 0xa0, 0x2b4: 0xa0, 0x2b5: 0xa0, 0x2b6: 0xa0, 0x2b7: 0xa0, 0x2b8: 0xa0, 0x2b9: 0xa0, 0x2ba: 0xa0, 0x2bb: 0xa0, 0x2bc: 0xa0, 0x2bd: 0xa0, 0x2be: 0xa0, 0x2bf: 0xe5, // Block 0xb, offset 0x2c0 0x2c0: 0xa0, 0x2c1: 0xa0, 0x2c2: 0xa0, 0x2c3: 0xa0, 0x2c4: 0xa0, 0x2c5: 0xa0, 0x2c6: 0xa0, 0x2c7: 0xa0, 0x2c8: 0xa0, 0x2c9: 0xa0, 0x2ca: 0xa0, 0x2cb: 0xa0, 0x2cc: 0xa0, 0x2cd: 0xa0, 0x2ce: 0xa0, 0x2cf: 0xa0, 0x2d0: 0xa0, 0x2d1: 0xa0, 0x2d2: 0xe6, 0x2d3: 0xe7, 0x2d4: 0xa0, 0x2d5: 0xa0, 0x2d6: 0xa0, 0x2d7: 0xa0, 0x2d8: 0xe8, 0x2d9: 0x40, 0x2da: 0x41, 0x2db: 0xe9, 0x2dc: 0x42, 0x2dd: 0x43, 0x2de: 0x44, 0x2df: 0xea, 0x2e0: 0xeb, 0x2e1: 0xec, 0x2e2: 0xed, 0x2e3: 0xee, 0x2e4: 0xef, 0x2e5: 0xf0, 0x2e6: 0xf1, 0x2e7: 0xf2, 0x2e8: 0xf3, 0x2e9: 0xf4, 0x2ea: 0xf5, 0x2eb: 0xf6, 0x2ec: 0xf7, 0x2ed: 0xf8, 0x2ee: 0xf9, 0x2ef: 0xfa, 0x2f0: 0xa0, 0x2f1: 0xa0, 0x2f2: 0xa0, 0x2f3: 0xa0, 0x2f4: 0xa0, 0x2f5: 0xa0, 0x2f6: 0xa0, 0x2f7: 0xa0, 0x2f8: 0xa0, 0x2f9: 0xa0, 0x2fa: 0xa0, 0x2fb: 0xa0, 0x2fc: 0xa0, 0x2fd: 0xa0, 0x2fe: 0xa0, 0x2ff: 0xa0, // Block 0xc, offset 0x300 0x300: 0xa0, 0x301: 0xa0, 0x302: 0xa0, 0x303: 0xa0, 0x304: 0xa0, 0x305: 0xa0, 0x306: 0xa0, 0x307: 0xa0, 0x308: 0xa0, 0x309: 0xa0, 0x30a: 0xa0, 0x30b: 0xa0, 0x30c: 0xa0, 0x30d: 0xa0, 0x30e: 0xa0, 0x30f: 0xa0, 0x310: 0xa0, 0x311: 0xa0, 0x312: 0xa0, 0x313: 0xa0, 0x314: 0xa0, 0x315: 0xa0, 0x316: 0xa0, 0x317: 0xa0, 0x318: 0xa0, 0x319: 0xa0, 0x31a: 0xa0, 0x31b: 0xa0, 0x31c: 0xa0, 0x31d: 0xa0, 0x31e: 0xfb, 0x31f: 0xfc, // Block 0xd, offset 0x340 0x340: 0xfd, 0x341: 0xfd, 0x342: 0xfd, 0x343: 0xfd, 0x344: 0xfd, 0x345: 0xfd, 0x346: 0xfd, 0x347: 0xfd, 0x348: 0xfd, 0x349: 0xfd, 0x34a: 0xfd, 0x34b: 0xfd, 0x34c: 0xfd, 0x34d: 0xfd, 0x34e: 0xfd, 0x34f: 0xfd, 0x350: 0xfd, 0x351: 0xfd, 0x352: 0xfd, 0x353: 0xfd, 0x354: 0xfd, 0x355: 0xfd, 0x356: 0xfd, 0x357: 0xfd, 0x358: 0xfd, 0x359: 0xfd, 0x35a: 0xfd, 0x35b: 0xfd, 0x35c: 0xfd, 0x35d: 0xfd, 0x35e: 0xfd, 0x35f: 0xfd, 0x360: 0xfd, 0x361: 0xfd, 0x362: 0xfd, 0x363: 0xfd, 0x364: 0xfd, 0x365: 0xfd, 0x366: 0xfd, 0x367: 0xfd, 0x368: 0xfd, 0x369: 0xfd, 0x36a: 0xfd, 0x36b: 0xfd, 0x36c: 0xfd, 0x36d: 0xfd, 0x36e: 0xfd, 0x36f: 0xfd, 0x370: 0xfd, 0x371: 0xfd, 0x372: 0xfd, 0x373: 0xfd, 0x374: 0xfd, 0x375: 0xfd, 0x376: 0xfd, 0x377: 0xfd, 0x378: 0xfd, 0x379: 0xfd, 0x37a: 0xfd, 0x37b: 0xfd, 0x37c: 0xfd, 0x37d: 0xfd, 0x37e: 0xfd, 0x37f: 0xfd, // Block 0xe, offset 0x380 0x380: 0xfd, 0x381: 0xfd, 0x382: 0xfd, 0x383: 0xfd, 0x384: 0xfd, 0x385: 0xfd, 0x386: 0xfd, 0x387: 0xfd, 0x388: 0xfd, 0x389: 0xfd, 0x38a: 0xfd, 0x38b: 0xfd, 0x38c: 0xfd, 0x38d: 0xfd, 0x38e: 0xfd, 0x38f: 0xfd, 0x390: 0xfd, 0x391: 0xfd, 0x392: 0xfd, 0x393: 0xfd, 0x394: 0xfd, 0x395: 0xfd, 0x396: 0xfd, 0x397: 0xfd, 0x398: 0xfd, 0x399: 0xfd, 0x39a: 0xfd, 0x39b: 0xfd, 0x39c: 0xfd, 0x39d: 0xfd, 0x39e: 0xfd, 0x39f: 0xfd, 0x3a0: 0xfd, 0x3a1: 0xfd, 0x3a2: 0xfd, 0x3a3: 0xfd, 0x3a4: 0xfe, 0x3a5: 0xff, 0x3a6: 0x100, 0x3a7: 0x101, 0x3a8: 0x45, 0x3a9: 0x102, 0x3aa: 0x103, 0x3ab: 0x46, 0x3ac: 0x47, 0x3ad: 0x48, 0x3ae: 0x49, 0x3af: 0x4a, 0x3b0: 0x104, 0x3b1: 0x4b, 0x3b2: 0x4c, 0x3b3: 0x4d, 0x3b4: 0x4e, 0x3b5: 0x4f, 0x3b6: 0x105, 0x3b7: 0x50, 0x3b8: 0x51, 0x3b9: 0x52, 0x3ba: 0x53, 0x3bb: 0x54, 0x3bc: 0x55, 0x3bd: 0x56, 0x3be: 0x57, 0x3bf: 0x58, // Block 0xf, offset 0x3c0 0x3c0: 0x106, 0x3c1: 0x107, 0x3c2: 0xa0, 0x3c3: 0x108, 0x3c4: 0x109, 0x3c5: 0x9c, 0x3c6: 0x10a, 0x3c7: 0x10b, 0x3c8: 0xfd, 0x3c9: 0xfd, 0x3ca: 0x10c, 0x3cb: 0x10d, 0x3cc: 0x10e, 0x3cd: 0x10f, 0x3ce: 0x110, 0x3cf: 0x111, 0x3d0: 0x112, 0x3d1: 0xa0, 0x3d2: 0x113, 0x3d3: 0x114, 0x3d4: 0x115, 0x3d5: 0x116, 0x3d6: 0xfd, 0x3d7: 0xfd, 0x3d8: 0xa0, 0x3d9: 0xa0, 0x3da: 0xa0, 0x3db: 0xa0, 0x3dc: 0x117, 0x3dd: 0x118, 0x3de: 0xfd, 0x3df: 0xfd, 0x3e0: 0x119, 0x3e1: 0x11a, 0x3e2: 0x11b, 0x3e3: 0x11c, 0x3e4: 0x11d, 0x3e5: 0xfd, 0x3e6: 0x11e, 0x3e7: 0x11f, 0x3e8: 0x120, 0x3e9: 0x121, 0x3ea: 0x122, 0x3eb: 0x59, 0x3ec: 0x123, 0x3ed: 0x124, 0x3ee: 0x5a, 0x3ef: 0xfd, 0x3f0: 0x125, 0x3f1: 0x126, 0x3f2: 0x127, 0x3f3: 0x128, 0x3f4: 0x129, 0x3f5: 0xfd, 0x3f6: 0xfd, 0x3f7: 0xfd, 0x3f8: 0xfd, 0x3f9: 0x12a, 0x3fa: 0x12b, 0x3fb: 0xfd, 0x3fc: 0x12c, 0x3fd: 0x12d, 0x3fe: 0x12e, 0x3ff: 0x12f, // Block 0x10, offset 0x400 0x400: 0x130, 0x401: 0x131, 0x402: 0x132, 0x403: 0x133, 0x404: 0x134, 0x405: 0x135, 0x406: 0x136, 0x407: 0x137, 0x408: 0x138, 0x409: 0xfd, 0x40a: 0x139, 0x40b: 0x13a, 0x40c: 0x5b, 0x40d: 0x5c, 0x40e: 0xfd, 0x40f: 0xfd, 0x410: 0x13b, 0x411: 0x13c, 0x412: 0x13d, 0x413: 0x13e, 0x414: 0xfd, 0x415: 0xfd, 0x416: 0x13f, 0x417: 0x140, 0x418: 0x141, 0x419: 0x142, 0x41a: 0x143, 0x41b: 0x144, 0x41c: 0x145, 0x41d: 0xfd, 0x41e: 0xfd, 0x41f: 0xfd, 0x420: 0x146, 0x421: 0xfd, 0x422: 0x147, 0x423: 0x148, 0x424: 0x5d, 0x425: 0x149, 0x426: 0x14a, 0x427: 0x14b, 0x428: 0x14c, 0x429: 0x14d, 0x42a: 0x14e, 0x42b: 0x14f, 0x42c: 0xfd, 0x42d: 0xfd, 0x42e: 0xfd, 0x42f: 0xfd, 0x430: 0x150, 0x431: 0x151, 0x432: 0x152, 0x433: 0xfd, 0x434: 0x153, 0x435: 0x154, 0x436: 0x155, 0x437: 0xfd, 0x438: 0xfd, 0x439: 0xfd, 0x43a: 0xfd, 0x43b: 0x156, 0x43c: 0xfd, 0x43d: 0xfd, 0x43e: 0x157, 0x43f: 0x158, // Block 0x11, offset 0x440 0x440: 0xa0, 0x441: 0xa0, 0x442: 0xa0, 0x443: 0xa0, 0x444: 0xa0, 0x445: 0xa0, 0x446: 0xa0, 0x447: 0xa0, 0x448: 0xa0, 0x449: 0xa0, 0x44a: 0xa0, 0x44b: 0xa0, 0x44c: 0xa0, 0x44d: 0xa0, 0x44e: 0x159, 0x44f: 0xfd, 0x450: 0x9c, 0x451: 0x15a, 0x452: 0xa0, 0x453: 0xa0, 0x454: 0xa0, 0x455: 0x15b, 0x456: 0xfd, 0x457: 0xfd, 0x458: 0xfd, 0x459: 0xfd, 0x45a: 0xfd, 0x45b: 0xfd, 0x45c: 0xfd, 0x45d: 0xfd, 0x45e: 0xfd, 0x45f: 0xfd, 0x460: 0xfd, 0x461: 0xfd, 0x462: 0xfd, 0x463: 0xfd, 0x464: 0xfd, 0x465: 0xfd, 0x466: 0xfd, 0x467: 0xfd, 0x468: 0xfd, 0x469: 0xfd, 0x46a: 0xfd, 0x46b: 0xfd, 0x46c: 0xfd, 0x46d: 0xfd, 0x46e: 0xfd, 0x46f: 0xfd, 0x470: 0xfd, 0x471: 0xfd, 0x472: 0xfd, 0x473: 0xfd, 0x474: 0xfd, 0x475: 0xfd, 0x476: 0xfd, 0x477: 0xfd, 0x478: 0xfd, 0x479: 0xfd, 0x47a: 0xfd, 0x47b: 0xfd, 0x47c: 0xfd, 0x47d: 0xfd, 0x47e: 0xfd, 0x47f: 0xfd, // Block 0x12, offset 0x480 0x480: 0xa0, 0x481: 0xa0, 0x482: 0xa0, 0x483: 0xa0, 0x484: 0xa0, 0x485: 0xa0, 0x486: 0xa0, 0x487: 0xa0, 0x488: 0xa0, 0x489: 0xa0, 0x48a: 0xa0, 0x48b: 0xa0, 0x48c: 0xa0, 0x48d: 0xa0, 0x48e: 0xa0, 0x48f: 0xa0, 0x490: 0x15c, 0x491: 0xfd, 0x492: 0xfd, 0x493: 0xfd, 0x494: 0xfd, 0x495: 0xfd, 0x496: 0xfd, 0x497: 0xfd, 0x498: 0xfd, 0x499: 0xfd, 0x49a: 0xfd, 0x49b: 0xfd, 0x49c: 0xfd, 0x49d: 0xfd, 0x49e: 0xfd, 0x49f: 0xfd, 0x4a0: 0xfd, 0x4a1: 0xfd, 0x4a2: 0xfd, 0x4a3: 0xfd, 0x4a4: 0xfd, 0x4a5: 0xfd, 0x4a6: 0xfd, 0x4a7: 0xfd, 0x4a8: 0xfd, 0x4a9: 0xfd, 0x4aa: 0xfd, 0x4ab: 0xfd, 0x4ac: 0xfd, 0x4ad: 0xfd, 0x4ae: 0xfd, 0x4af: 0xfd, 0x4b0: 0xfd, 0x4b1: 0xfd, 0x4b2: 0xfd, 0x4b3: 0xfd, 0x4b4: 0xfd, 0x4b5: 0xfd, 0x4b6: 0xfd, 0x4b7: 0xfd, 0x4b8: 0xfd, 0x4b9: 0xfd, 0x4ba: 0xfd, 0x4bb: 0xfd, 0x4bc: 0xfd, 0x4bd: 0xfd, 0x4be: 0xfd, 0x4bf: 0xfd, // Block 0x13, offset 0x4c0 0x4c0: 0xfd, 0x4c1: 0xfd, 0x4c2: 0xfd, 0x4c3: 0xfd, 0x4c4: 0xfd, 0x4c5: 0xfd, 0x4c6: 0xfd, 0x4c7: 0xfd, 0x4c8: 0xfd, 0x4c9: 0xfd, 0x4ca: 0xfd, 0x4cb: 0xfd, 0x4cc: 0xfd, 0x4cd: 0xfd, 0x4ce: 0xfd, 0x4cf: 0xfd, 0x4d0: 0xa0, 0x4d1: 0xa0, 0x4d2: 0xa0, 0x4d3: 0xa0, 0x4d4: 0xa0, 0x4d5: 0xa0, 0x4d6: 0xa0, 0x4d7: 0xa0, 0x4d8: 0xa0, 0x4d9: 0x15d, 0x4da: 0xfd, 0x4db: 0xfd, 0x4dc: 0xfd, 0x4dd: 0xfd, 0x4de: 0xfd, 0x4df: 0xfd, 0x4e0: 0xfd, 0x4e1: 0xfd, 0x4e2: 0xfd, 0x4e3: 0xfd, 0x4e4: 0xfd, 0x4e5: 0xfd, 0x4e6: 0xfd, 0x4e7: 0xfd, 0x4e8: 0xfd, 0x4e9: 0xfd, 0x4ea: 0xfd, 0x4eb: 0xfd, 0x4ec: 0xfd, 0x4ed: 0xfd, 0x4ee: 0xfd, 0x4ef: 0xfd, 0x4f0: 0xfd, 0x4f1: 0xfd, 0x4f2: 0xfd, 0x4f3: 0xfd, 0x4f4: 0xfd, 0x4f5: 0xfd, 0x4f6: 0xfd, 0x4f7: 0xfd, 0x4f8: 0xfd, 0x4f9: 0xfd, 0x4fa: 0xfd, 0x4fb: 0xfd, 0x4fc: 0xfd, 0x4fd: 0xfd, 0x4fe: 0xfd, 0x4ff: 0xfd, // Block 0x14, offset 0x500 0x500: 0xfd, 0x501: 0xfd, 0x502: 0xfd, 0x503: 0xfd, 0x504: 0xfd, 0x505: 0xfd, 0x506: 0xfd, 0x507: 0xfd, 0x508: 0xfd, 0x509: 0xfd, 0x50a: 0xfd, 0x50b: 0xfd, 0x50c: 0xfd, 0x50d: 0xfd, 0x50e: 0xfd, 0x50f: 0xfd, 0x510: 0xfd, 0x511: 0xfd, 0x512: 0xfd, 0x513: 0xfd, 0x514: 0xfd, 0x515: 0xfd, 0x516: 0xfd, 0x517: 0xfd, 0x518: 0xfd, 0x519: 0xfd, 0x51a: 0xfd, 0x51b: 0xfd, 0x51c: 0xfd, 0x51d: 0xfd, 0x51e: 0xfd, 0x51f: 0xfd, 0x520: 0xa0, 0x521: 0xa0, 0x522: 0xa0, 0x523: 0xa0, 0x524: 0xa0, 0x525: 0xa0, 0x526: 0xa0, 0x527: 0xa0, 0x528: 0x14f, 0x529: 0x15e, 0x52a: 0xfd, 0x52b: 0x15f, 0x52c: 0x160, 0x52d: 0x161, 0x52e: 0x162, 0x52f: 0xfd, 0x530: 0xfd, 0x531: 0xfd, 0x532: 0xfd, 0x533: 0xfd, 0x534: 0xfd, 0x535: 0xfd, 0x536: 0xfd, 0x537: 0xfd, 0x538: 0xfd, 0x539: 0x163, 0x53a: 0x164, 0x53b: 0xfd, 0x53c: 0xa0, 0x53d: 0x165, 0x53e: 0x166, 0x53f: 0x167, // Block 0x15, offset 0x540 0x540: 0xa0, 0x541: 0xa0, 0x542: 0xa0, 0x543: 0xa0, 0x544: 0xa0, 0x545: 0xa0, 0x546: 0xa0, 0x547: 0xa0, 0x548: 0xa0, 0x549: 0xa0, 0x54a: 0xa0, 0x54b: 0xa0, 0x54c: 0xa0, 0x54d: 0xa0, 0x54e: 0xa0, 0x54f: 0xa0, 0x550: 0xa0, 0x551: 0xa0, 0x552: 0xa0, 0x553: 0xa0, 0x554: 0xa0, 0x555: 0xa0, 0x556: 0xa0, 0x557: 0xa0, 0x558: 0xa0, 0x559: 0xa0, 0x55a: 0xa0, 0x55b: 0xa0, 0x55c: 0xa0, 0x55d: 0xa0, 0x55e: 0xa0, 0x55f: 0x168, 0x560: 0xa0, 0x561: 0xa0, 0x562: 0xa0, 0x563: 0xa0, 0x564: 0xa0, 0x565: 0xa0, 0x566: 0xa0, 0x567: 0xa0, 0x568: 0xa0, 0x569: 0xa0, 0x56a: 0xa0, 0x56b: 0xa0, 0x56c: 0xa0, 0x56d: 0xa0, 0x56e: 0xa0, 0x56f: 0xa0, 0x570: 0xa0, 0x571: 0xa0, 0x572: 0xa0, 0x573: 0x169, 0x574: 0x16a, 0x575: 0xfd, 0x576: 0xfd, 0x577: 0xfd, 0x578: 0xfd, 0x579: 0xfd, 0x57a: 0xfd, 0x57b: 0xfd, 0x57c: 0xfd, 0x57d: 0xfd, 0x57e: 0xfd, 0x57f: 0xfd, // Block 0x16, offset 0x580 0x580: 0xa0, 0x581: 0xa0, 0x582: 0xa0, 0x583: 0xa0, 0x584: 0x16b, 0x585: 0x16c, 0x586: 0xa0, 0x587: 0xa0, 0x588: 0xa0, 0x589: 0xa0, 0x58a: 0xa0, 0x58b: 0x16d, 0x58c: 0xfd, 0x58d: 0xfd, 0x58e: 0xfd, 0x58f: 0xfd, 0x590: 0xfd, 0x591: 0xfd, 0x592: 0xfd, 0x593: 0xfd, 0x594: 0xfd, 0x595: 0xfd, 0x596: 0xfd, 0x597: 0xfd, 0x598: 0xfd, 0x599: 0xfd, 0x59a: 0xfd, 0x59b: 0xfd, 0x59c: 0xfd, 0x59d: 0xfd, 0x59e: 0xfd, 0x59f: 0xfd, 0x5a0: 0xfd, 0x5a1: 0xfd, 0x5a2: 0xfd, 0x5a3: 0xfd, 0x5a4: 0xfd, 0x5a5: 0xfd, 0x5a6: 0xfd, 0x5a7: 0xfd, 0x5a8: 0xfd, 0x5a9: 0xfd, 0x5aa: 0xfd, 0x5ab: 0xfd, 0x5ac: 0xfd, 0x5ad: 0xfd, 0x5ae: 0xfd, 0x5af: 0xfd, 0x5b0: 0xa0, 0x5b1: 0x16e, 0x5b2: 0x16f, 0x5b3: 0xfd, 0x5b4: 0xfd, 0x5b5: 0xfd, 0x5b6: 0xfd, 0x5b7: 0xfd, 0x5b8: 0xfd, 0x5b9: 0xfd, 0x5ba: 0xfd, 0x5bb: 0xfd, 0x5bc: 0xfd, 0x5bd: 0xfd, 0x5be: 0xfd, 0x5bf: 0xfd, // Block 0x17, offset 0x5c0 0x5c0: 0x9c, 0x5c1: 0x9c, 0x5c2: 0x9c, 0x5c3: 0x170, 0x5c4: 0x171, 0x5c5: 0x172, 0x5c6: 0x173, 0x5c7: 0x174, 0x5c8: 0x9c, 0x5c9: 0x175, 0x5ca: 0xfd, 0x5cb: 0x176, 0x5cc: 0x9c, 0x5cd: 0x177, 0x5ce: 0xfd, 0x5cf: 0xfd, 0x5d0: 0x5e, 0x5d1: 0x5f, 0x5d2: 0x60, 0x5d3: 0x61, 0x5d4: 0x62, 0x5d5: 0x63, 0x5d6: 0x64, 0x5d7: 0x65, 0x5d8: 0x66, 0x5d9: 0x67, 0x5da: 0x68, 0x5db: 0x69, 0x5dc: 0x6a, 0x5dd: 0x6b, 0x5de: 0x6c, 0x5df: 0x6d, 0x5e0: 0x9c, 0x5e1: 0x9c, 0x5e2: 0x9c, 0x5e3: 0x9c, 0x5e4: 0x9c, 0x5e5: 0x9c, 0x5e6: 0x9c, 0x5e7: 0x9c, 0x5e8: 0x178, 0x5e9: 0x179, 0x5ea: 0x17a, 0x5eb: 0xfd, 0x5ec: 0xfd, 0x5ed: 0xfd, 0x5ee: 0xfd, 0x5ef: 0xfd, 0x5f0: 0xfd, 0x5f1: 0xfd, 0x5f2: 0xfd, 0x5f3: 0xfd, 0x5f4: 0xfd, 0x5f5: 0xfd, 0x5f6: 0xfd, 0x5f7: 0xfd, 0x5f8: 0xfd, 0x5f9: 0xfd, 0x5fa: 0xfd, 0x5fb: 0xfd, 0x5fc: 0xfd, 0x5fd: 0xfd, 0x5fe: 0xfd, 0x5ff: 0xfd, // Block 0x18, offset 0x600 0x600: 0x17b, 0x601: 0xfd, 0x602: 0xfd, 0x603: 0xfd, 0x604: 0x17c, 0x605: 0x17d, 0x606: 0xfd, 0x607: 0xfd, 0x608: 0xfd, 0x609: 0xfd, 0x60a: 0xfd, 0x60b: 0x17e, 0x60c: 0xfd, 0x60d: 0xfd, 0x60e: 0xfd, 0x60f: 0xfd, 0x610: 0xfd, 0x611: 0xfd, 0x612: 0xfd, 0x613: 0xfd, 0x614: 0xfd, 0x615: 0xfd, 0x616: 0xfd, 0x617: 0xfd, 0x618: 0xfd, 0x619: 0xfd, 0x61a: 0xfd, 0x61b: 0xfd, 0x61c: 0xfd, 0x61d: 0xfd, 0x61e: 0xfd, 0x61f: 0xfd, 0x620: 0x125, 0x621: 0x125, 0x622: 0x125, 0x623: 0x17f, 0x624: 0x6e, 0x625: 0x180, 0x626: 0xfd, 0x627: 0xfd, 0x628: 0xfd, 0x629: 0xfd, 0x62a: 0xfd, 0x62b: 0xfd, 0x62c: 0xfd, 0x62d: 0xfd, 0x62e: 0xfd, 0x62f: 0xfd, 0x630: 0xfd, 0x631: 0x181, 0x632: 0x182, 0x633: 0xfd, 0x634: 0x183, 0x635: 0xfd, 0x636: 0xfd, 0x637: 0xfd, 0x638: 0x6f, 0x639: 0x70, 0x63a: 0x71, 0x63b: 0x184, 0x63c: 0xfd, 0x63d: 0xfd, 0x63e: 0xfd, 0x63f: 0xfd, // Block 0x19, offset 0x640 0x640: 0x185, 0x641: 0x9c, 0x642: 0x186, 0x643: 0x187, 0x644: 0x72, 0x645: 0x73, 0x646: 0x188, 0x647: 0x189, 0x648: 0x74, 0x649: 0x18a, 0x64a: 0xfd, 0x64b: 0xfd, 0x64c: 0x9c, 0x64d: 0x9c, 0x64e: 0x9c, 0x64f: 0x9c, 0x650: 0x9c, 0x651: 0x9c, 0x652: 0x9c, 0x653: 0x9c, 0x654: 0x9c, 0x655: 0x9c, 0x656: 0x9c, 0x657: 0x9c, 0x658: 0x9c, 0x659: 0x9c, 0x65a: 0x9c, 0x65b: 0x18b, 0x65c: 0x9c, 0x65d: 0x18c, 0x65e: 0x9c, 0x65f: 0x18d, 0x660: 0x18e, 0x661: 0x18f, 0x662: 0x190, 0x663: 0xfd, 0x664: 0x9c, 0x665: 0x191, 0x666: 0x9c, 0x667: 0x192, 0x668: 0x9c, 0x669: 0x193, 0x66a: 0x194, 0x66b: 0x195, 0x66c: 0x9c, 0x66d: 0x9c, 0x66e: 0x196, 0x66f: 0x197, 0x670: 0xfd, 0x671: 0xfd, 0x672: 0xfd, 0x673: 0xfd, 0x674: 0xfd, 0x675: 0xfd, 0x676: 0xfd, 0x677: 0xfd, 0x678: 0xfd, 0x679: 0xfd, 0x67a: 0xfd, 0x67b: 0xfd, 0x67c: 0xfd, 0x67d: 0xfd, 0x67e: 0xfd, 0x67f: 0xfd, // Block 0x1a, offset 0x680 0x680: 0xa0, 0x681: 0xa0, 0x682: 0xa0, 0x683: 0xa0, 0x684: 0xa0, 0x685: 0xa0, 0x686: 0xa0, 0x687: 0xa0, 0x688: 0xa0, 0x689: 0xa0, 0x68a: 0xa0, 0x68b: 0xa0, 0x68c: 0xa0, 0x68d: 0xa0, 0x68e: 0xa0, 0x68f: 0xa0, 0x690: 0xa0, 0x691: 0xa0, 0x692: 0xa0, 0x693: 0xa0, 0x694: 0xa0, 0x695: 0xa0, 0x696: 0xa0, 0x697: 0xa0, 0x698: 0xa0, 0x699: 0xa0, 0x69a: 0xa0, 0x69b: 0x198, 0x69c: 0xa0, 0x69d: 0xa0, 0x69e: 0xa0, 0x69f: 0xa0, 0x6a0: 0xa0, 0x6a1: 0xa0, 0x6a2: 0xa0, 0x6a3: 0xa0, 0x6a4: 0xa0, 0x6a5: 0xa0, 0x6a6: 0xa0, 0x6a7: 0xa0, 0x6a8: 0xa0, 0x6a9: 0xa0, 0x6aa: 0xa0, 0x6ab: 0xa0, 0x6ac: 0xa0, 0x6ad: 0xa0, 0x6ae: 0xa0, 0x6af: 0xa0, 0x6b0: 0xa0, 0x6b1: 0xa0, 0x6b2: 0xa0, 0x6b3: 0xa0, 0x6b4: 0xa0, 0x6b5: 0xa0, 0x6b6: 0xa0, 0x6b7: 0xa0, 0x6b8: 0xa0, 0x6b9: 0xa0, 0x6ba: 0xa0, 0x6bb: 0xa0, 0x6bc: 0xa0, 0x6bd: 0xa0, 0x6be: 0xa0, 0x6bf: 0xa0, // Block 0x1b, offset 0x6c0 0x6c0: 0xa0, 0x6c1: 0xa0, 0x6c2: 0xa0, 0x6c3: 0xa0, 0x6c4: 0xa0, 0x6c5: 0xa0, 0x6c6: 0xa0, 0x6c7: 0xa0, 0x6c8: 0xa0, 0x6c9: 0xa0, 0x6ca: 0xa0, 0x6cb: 0xa0, 0x6cc: 0xa0, 0x6cd: 0xa0, 0x6ce: 0xa0, 0x6cf: 0xa0, 0x6d0: 0xa0, 0x6d1: 0xa0, 0x6d2: 0xa0, 0x6d3: 0xa0, 0x6d4: 0xa0, 0x6d5: 0xa0, 0x6d6: 0xa0, 0x6d7: 0xa0, 0x6d8: 0xa0, 0x6d9: 0xa0, 0x6da: 0xa0, 0x6db: 0xa0, 0x6dc: 0x199, 0x6dd: 0xa0, 0x6de: 0xa0, 0x6df: 0xa0, 0x6e0: 0x19a, 0x6e1: 0xa0, 0x6e2: 0xa0, 0x6e3: 0xa0, 0x6e4: 0xa0, 0x6e5: 0xa0, 0x6e6: 0xa0, 0x6e7: 0xa0, 0x6e8: 0xa0, 0x6e9: 0xa0, 0x6ea: 0xa0, 0x6eb: 0xa0, 0x6ec: 0xa0, 0x6ed: 0xa0, 0x6ee: 0xa0, 0x6ef: 0xa0, 0x6f0: 0xa0, 0x6f1: 0xa0, 0x6f2: 0xa0, 0x6f3: 0xa0, 0x6f4: 0xa0, 0x6f5: 0xa0, 0x6f6: 0xa0, 0x6f7: 0xa0, 0x6f8: 0xa0, 0x6f9: 0xa0, 0x6fa: 0xa0, 0x6fb: 0xa0, 0x6fc: 0xa0, 0x6fd: 0xa0, 0x6fe: 0xa0, 0x6ff: 0xa0, // Block 0x1c, offset 0x700 0x700: 0xa0, 0x701: 0xa0, 0x702: 0xa0, 0x703: 0xa0, 0x704: 0xa0, 0x705: 0xa0, 0x706: 0xa0, 0x707: 0xa0, 0x708: 0xa0, 0x709: 0xa0, 0x70a: 0xa0, 0x70b: 0xa0, 0x70c: 0xa0, 0x70d: 0xa0, 0x70e: 0xa0, 0x70f: 0xa0, 0x710: 0xa0, 0x711: 0xa0, 0x712: 0xa0, 0x713: 0xa0, 0x714: 0xa0, 0x715: 0xa0, 0x716: 0xa0, 0x717: 0xa0, 0x718: 0xa0, 0x719: 0xa0, 0x71a: 0xa0, 0x71b: 0xa0, 0x71c: 0xa0, 0x71d: 0xa0, 0x71e: 0xa0, 0x71f: 0xa0, 0x720: 0xa0, 0x721: 0xa0, 0x722: 0xa0, 0x723: 0xa0, 0x724: 0xa0, 0x725: 0xa0, 0x726: 0xa0, 0x727: 0xa0, 0x728: 0xa0, 0x729: 0xa0, 0x72a: 0xa0, 0x72b: 0xa0, 0x72c: 0xa0, 0x72d: 0xa0, 0x72e: 0xa0, 0x72f: 0xa0, 0x730: 0xa0, 0x731: 0xa0, 0x732: 0xa0, 0x733: 0xa0, 0x734: 0xa0, 0x735: 0xa0, 0x736: 0xa0, 0x737: 0xa0, 0x738: 0xa0, 0x739: 0xa0, 0x73a: 0x19b, 0x73b: 0xa0, 0x73c: 0xa0, 0x73d: 0xa0, 0x73e: 0xa0, 0x73f: 0xa0, // Block 0x1d, offset 0x740 0x740: 0xa0, 0x741: 0xa0, 0x742: 0xa0, 0x743: 0xa0, 0x744: 0xa0, 0x745: 0xa0, 0x746: 0xa0, 0x747: 0xa0, 0x748: 0xa0, 0x749: 0xa0, 0x74a: 0xa0, 0x74b: 0xa0, 0x74c: 0xa0, 0x74d: 0xa0, 0x74e: 0xa0, 0x74f: 0xa0, 0x750: 0xa0, 0x751: 0xa0, 0x752: 0xa0, 0x753: 0xa0, 0x754: 0xa0, 0x755: 0xa0, 0x756: 0xa0, 0x757: 0xa0, 0x758: 0xa0, 0x759: 0xa0, 0x75a: 0xa0, 0x75b: 0xa0, 0x75c: 0xa0, 0x75d: 0xa0, 0x75e: 0xa0, 0x75f: 0xa0, 0x760: 0xa0, 0x761: 0xa0, 0x762: 0xa0, 0x763: 0xa0, 0x764: 0xa0, 0x765: 0xa0, 0x766: 0xa0, 0x767: 0xa0, 0x768: 0xa0, 0x769: 0xa0, 0x76a: 0xa0, 0x76b: 0xa0, 0x76c: 0xa0, 0x76d: 0xa0, 0x76e: 0xa0, 0x76f: 0x19c, 0x770: 0xfd, 0x771: 0xfd, 0x772: 0xfd, 0x773: 0xfd, 0x774: 0xfd, 0x775: 0xfd, 0x776: 0xfd, 0x777: 0xfd, 0x778: 0xfd, 0x779: 0xfd, 0x77a: 0xfd, 0x77b: 0xfd, 0x77c: 0xfd, 0x77d: 0xfd, 0x77e: 0xfd, 0x77f: 0xfd, // Block 0x1e, offset 0x780 0x780: 0xfd, 0x781: 0xfd, 0x782: 0xfd, 0x783: 0xfd, 0x784: 0xfd, 0x785: 0xfd, 0x786: 0xfd, 0x787: 0xfd, 0x788: 0xfd, 0x789: 0xfd, 0x78a: 0xfd, 0x78b: 0xfd, 0x78c: 0xfd, 0x78d: 0xfd, 0x78e: 0xfd, 0x78f: 0xfd, 0x790: 0xfd, 0x791: 0xfd, 0x792: 0xfd, 0x793: 0xfd, 0x794: 0xfd, 0x795: 0xfd, 0x796: 0xfd, 0x797: 0xfd, 0x798: 0xfd, 0x799: 0xfd, 0x79a: 0xfd, 0x79b: 0xfd, 0x79c: 0xfd, 0x79d: 0xfd, 0x79e: 0xfd, 0x79f: 0xfd, 0x7a0: 0x75, 0x7a1: 0x76, 0x7a2: 0x77, 0x7a3: 0x78, 0x7a4: 0x79, 0x7a5: 0x7a, 0x7a6: 0x7b, 0x7a7: 0x7c, 0x7a8: 0x7d, 0x7a9: 0xfd, 0x7aa: 0xfd, 0x7ab: 0xfd, 0x7ac: 0xfd, 0x7ad: 0xfd, 0x7ae: 0xfd, 0x7af: 0xfd, 0x7b0: 0xfd, 0x7b1: 0xfd, 0x7b2: 0xfd, 0x7b3: 0xfd, 0x7b4: 0xfd, 0x7b5: 0xfd, 0x7b6: 0xfd, 0x7b7: 0xfd, 0x7b8: 0xfd, 0x7b9: 0xfd, 0x7ba: 0xfd, 0x7bb: 0xfd, 0x7bc: 0xfd, 0x7bd: 0xfd, 0x7be: 0xfd, 0x7bf: 0xfd, // Block 0x1f, offset 0x7c0 0x7c0: 0xa0, 0x7c1: 0xa0, 0x7c2: 0xa0, 0x7c3: 0xa0, 0x7c4: 0xa0, 0x7c5: 0xa0, 0x7c6: 0xa0, 0x7c7: 0xa0, 0x7c8: 0xa0, 0x7c9: 0xa0, 0x7ca: 0xa0, 0x7cb: 0xa0, 0x7cc: 0xa0, 0x7cd: 0x19d, 0x7ce: 0xfd, 0x7cf: 0xfd, 0x7d0: 0xfd, 0x7d1: 0xfd, 0x7d2: 0xfd, 0x7d3: 0xfd, 0x7d4: 0xfd, 0x7d5: 0xfd, 0x7d6: 0xfd, 0x7d7: 0xfd, 0x7d8: 0xfd, 0x7d9: 0xfd, 0x7da: 0xfd, 0x7db: 0xfd, 0x7dc: 0xfd, 0x7dd: 0xfd, 0x7de: 0xfd, 0x7df: 0xfd, 0x7e0: 0xfd, 0x7e1: 0xfd, 0x7e2: 0xfd, 0x7e3: 0xfd, 0x7e4: 0xfd, 0x7e5: 0xfd, 0x7e6: 0xfd, 0x7e7: 0xfd, 0x7e8: 0xfd, 0x7e9: 0xfd, 0x7ea: 0xfd, 0x7eb: 0xfd, 0x7ec: 0xfd, 0x7ed: 0xfd, 0x7ee: 0xfd, 0x7ef: 0xfd, 0x7f0: 0xfd, 0x7f1: 0xfd, 0x7f2: 0xfd, 0x7f3: 0xfd, 0x7f4: 0xfd, 0x7f5: 0xfd, 0x7f6: 0xfd, 0x7f7: 0xfd, 0x7f8: 0xfd, 0x7f9: 0xfd, 0x7fa: 0xfd, 0x7fb: 0xfd, 0x7fc: 0xfd, 0x7fd: 0xfd, 0x7fe: 0xfd, 0x7ff: 0xfd, // Block 0x20, offset 0x800 0x810: 0x0d, 0x811: 0x0e, 0x812: 0x0f, 0x813: 0x10, 0x814: 0x11, 0x815: 0x0b, 0x816: 0x12, 0x817: 0x07, 0x818: 0x13, 0x819: 0x0b, 0x81a: 0x0b, 0x81b: 0x14, 0x81c: 0x0b, 0x81d: 0x15, 0x81e: 0x16, 0x81f: 0x17, 0x820: 0x07, 0x821: 0x07, 0x822: 0x07, 0x823: 0x07, 0x824: 0x07, 0x825: 0x07, 0x826: 0x07, 0x827: 0x07, 0x828: 0x07, 0x829: 0x07, 0x82a: 0x18, 0x82b: 0x19, 0x82c: 0x1a, 0x82d: 0x07, 0x82e: 0x1b, 0x82f: 0x1c, 0x830: 0x07, 0x831: 0x1d, 0x832: 0x0b, 0x833: 0x0b, 0x834: 0x0b, 0x835: 0x0b, 0x836: 0x0b, 0x837: 0x0b, 0x838: 0x0b, 0x839: 0x0b, 0x83a: 0x0b, 0x83b: 0x0b, 0x83c: 0x0b, 0x83d: 0x0b, 0x83e: 0x0b, 0x83f: 0x0b, // Block 0x21, offset 0x840 0x840: 0x0b, 0x841: 0x0b, 0x842: 0x0b, 0x843: 0x0b, 0x844: 0x0b, 0x845: 0x0b, 0x846: 0x0b, 0x847: 0x0b, 0x848: 0x0b, 0x849: 0x0b, 0x84a: 0x0b, 0x84b: 0x0b, 0x84c: 0x0b, 0x84d: 0x0b, 0x84e: 0x0b, 0x84f: 0x0b, 0x850: 0x0b, 0x851: 0x0b, 0x852: 0x0b, 0x853: 0x0b, 0x854: 0x0b, 0x855: 0x0b, 0x856: 0x0b, 0x857: 0x0b, 0x858: 0x0b, 0x859: 0x0b, 0x85a: 0x0b, 0x85b: 0x0b, 0x85c: 0x0b, 0x85d: 0x0b, 0x85e: 0x0b, 0x85f: 0x0b, 0x860: 0x0b, 0x861: 0x0b, 0x862: 0x0b, 0x863: 0x0b, 0x864: 0x0b, 0x865: 0x0b, 0x866: 0x0b, 0x867: 0x0b, 0x868: 0x0b, 0x869: 0x0b, 0x86a: 0x0b, 0x86b: 0x0b, 0x86c: 0x0b, 0x86d: 0x0b, 0x86e: 0x0b, 0x86f: 0x0b, 0x870: 0x0b, 0x871: 0x0b, 0x872: 0x0b, 0x873: 0x0b, 0x874: 0x0b, 0x875: 0x0b, 0x876: 0x0b, 0x877: 0x0b, 0x878: 0x0b, 0x879: 0x0b, 0x87a: 0x0b, 0x87b: 0x0b, 0x87c: 0x0b, 0x87d: 0x0b, 0x87e: 0x0b, 0x87f: 0x0b, // Block 0x22, offset 0x880 0x880: 0x19e, 0x881: 0x19f, 0x882: 0xfd, 0x883: 0xfd, 0x884: 0x1a0, 0x885: 0x1a0, 0x886: 0x1a0, 0x887: 0x1a1, 0x888: 0xfd, 0x889: 0xfd, 0x88a: 0xfd, 0x88b: 0xfd, 0x88c: 0xfd, 0x88d: 0xfd, 0x88e: 0xfd, 0x88f: 0xfd, 0x890: 0xfd, 0x891: 0xfd, 0x892: 0xfd, 0x893: 0xfd, 0x894: 0xfd, 0x895: 0xfd, 0x896: 0xfd, 0x897: 0xfd, 0x898: 0xfd, 0x899: 0xfd, 0x89a: 0xfd, 0x89b: 0xfd, 0x89c: 0xfd, 0x89d: 0xfd, 0x89e: 0xfd, 0x89f: 0xfd, 0x8a0: 0xfd, 0x8a1: 0xfd, 0x8a2: 0xfd, 0x8a3: 0xfd, 0x8a4: 0xfd, 0x8a5: 0xfd, 0x8a6: 0xfd, 0x8a7: 0xfd, 0x8a8: 0xfd, 0x8a9: 0xfd, 0x8aa: 0xfd, 0x8ab: 0xfd, 0x8ac: 0xfd, 0x8ad: 0xfd, 0x8ae: 0xfd, 0x8af: 0xfd, 0x8b0: 0xfd, 0x8b1: 0xfd, 0x8b2: 0xfd, 0x8b3: 0xfd, 0x8b4: 0xfd, 0x8b5: 0xfd, 0x8b6: 0xfd, 0x8b7: 0xfd, 0x8b8: 0xfd, 0x8b9: 0xfd, 0x8ba: 0xfd, 0x8bb: 0xfd, 0x8bc: 0xfd, 0x8bd: 0xfd, 0x8be: 0xfd, 0x8bf: 0xfd, // Block 0x23, offset 0x8c0 0x8c0: 0x0b, 0x8c1: 0x0b, 0x8c2: 0x0b, 0x8c3: 0x0b, 0x8c4: 0x0b, 0x8c5: 0x0b, 0x8c6: 0x0b, 0x8c7: 0x0b, 0x8c8: 0x0b, 0x8c9: 0x0b, 0x8ca: 0x0b, 0x8cb: 0x0b, 0x8cc: 0x0b, 0x8cd: 0x0b, 0x8ce: 0x0b, 0x8cf: 0x0b, 0x8d0: 0x0b, 0x8d1: 0x0b, 0x8d2: 0x0b, 0x8d3: 0x0b, 0x8d4: 0x0b, 0x8d5: 0x0b, 0x8d6: 0x0b, 0x8d7: 0x0b, 0x8d8: 0x0b, 0x8d9: 0x0b, 0x8da: 0x0b, 0x8db: 0x0b, 0x8dc: 0x0b, 0x8dd: 0x0b, 0x8de: 0x0b, 0x8df: 0x0b, 0x8e0: 0x20, 0x8e1: 0x0b, 0x8e2: 0x0b, 0x8e3: 0x0b, 0x8e4: 0x0b, 0x8e5: 0x0b, 0x8e6: 0x0b, 0x8e7: 0x0b, 0x8e8: 0x0b, 0x8e9: 0x0b, 0x8ea: 0x0b, 0x8eb: 0x0b, 0x8ec: 0x0b, 0x8ed: 0x0b, 0x8ee: 0x0b, 0x8ef: 0x0b, 0x8f0: 0x0b, 0x8f1: 0x0b, 0x8f2: 0x0b, 0x8f3: 0x0b, 0x8f4: 0x0b, 0x8f5: 0x0b, 0x8f6: 0x0b, 0x8f7: 0x0b, 0x8f8: 0x0b, 0x8f9: 0x0b, 0x8fa: 0x0b, 0x8fb: 0x0b, 0x8fc: 0x0b, 0x8fd: 0x0b, 0x8fe: 0x0b, 0x8ff: 0x0b, // Block 0x24, offset 0x900 0x900: 0x0b, 0x901: 0x0b, 0x902: 0x0b, 0x903: 0x0b, 0x904: 0x0b, 0x905: 0x0b, 0x906: 0x0b, 0x907: 0x0b, 0x908: 0x0b, 0x909: 0x0b, 0x90a: 0x0b, 0x90b: 0x0b, 0x90c: 0x0b, 0x90d: 0x0b, 0x90e: 0x0b, 0x90f: 0x0b, } // idnaSparseOffset: 292 entries, 584 bytes var idnaSparseOffset = []uint16{0x0, 0x8, 0x19, 0x25, 0x27, 0x2c, 0x33, 0x3e, 0x4a, 0x4e, 0x5d, 0x62, 0x6c, 0x78, 0x85, 0x8b, 0x94, 0xa4, 0xb2, 0xbd, 0xca, 0xdb, 0xe5, 0xec, 0xf9, 0x10a, 0x111, 0x11c, 0x12b, 0x139, 0x143, 0x145, 0x14a, 0x14d, 0x150, 0x152, 0x15e, 0x169, 0x171, 0x177, 0x17d, 0x182, 0x187, 0x18a, 0x18e, 0x194, 0x199, 0x1a5, 0x1af, 0x1b5, 0x1c6, 0x1d0, 0x1d3, 0x1db, 0x1de, 0x1eb, 0x1f3, 0x1f7, 0x1fe, 0x206, 0x216, 0x222, 0x225, 0x22f, 0x23b, 0x247, 0x253, 0x25b, 0x260, 0x26d, 0x27e, 0x282, 0x28d, 0x291, 0x29a, 0x2a2, 0x2a8, 0x2ad, 0x2b0, 0x2b4, 0x2ba, 0x2be, 0x2c2, 0x2c6, 0x2cc, 0x2d4, 0x2db, 0x2e6, 0x2f0, 0x2f4, 0x2f7, 0x2fd, 0x301, 0x303, 0x306, 0x308, 0x30b, 0x315, 0x318, 0x327, 0x32b, 0x32f, 0x331, 0x33a, 0x33d, 0x341, 0x346, 0x34b, 0x351, 0x362, 0x372, 0x378, 0x37c, 0x38b, 0x390, 0x398, 0x3a2, 0x3ad, 0x3b5, 0x3c6, 0x3cf, 0x3df, 0x3ec, 0x3f8, 0x3fd, 0x40a, 0x40e, 0x413, 0x415, 0x417, 0x41b, 0x41d, 0x421, 0x42a, 0x430, 0x434, 0x444, 0x44e, 0x453, 0x456, 0x45c, 0x463, 0x468, 0x46c, 0x472, 0x477, 0x480, 0x485, 0x48b, 0x492, 0x499, 0x4a0, 0x4a4, 0x4a9, 0x4ac, 0x4b1, 0x4bd, 0x4c3, 0x4c8, 0x4cf, 0x4d7, 0x4dc, 0x4e0, 0x4f0, 0x4f7, 0x4fb, 0x4ff, 0x506, 0x508, 0x50b, 0x50e, 0x512, 0x51b, 0x51f, 0x527, 0x52f, 0x537, 0x543, 0x54f, 0x555, 0x55e, 0x56a, 0x571, 0x57a, 0x585, 0x58c, 0x59b, 0x5a8, 0x5b5, 0x5be, 0x5c2, 0x5d1, 0x5d9, 0x5e4, 0x5ed, 0x5f3, 0x5fb, 0x604, 0x60f, 0x612, 0x61e, 0x627, 0x62a, 0x62f, 0x638, 0x63d, 0x64a, 0x655, 0x65e, 0x668, 0x66b, 0x675, 0x67e, 0x68a, 0x697, 0x6a4, 0x6b2, 0x6b9, 0x6bd, 0x6c1, 0x6c4, 0x6c9, 0x6cc, 0x6d1, 0x6d4, 0x6db, 0x6e2, 0x6e6, 0x6f1, 0x6f4, 0x6f7, 0x6fa, 0x700, 0x706, 0x70f, 0x712, 0x715, 0x718, 0x71b, 0x722, 0x725, 0x72a, 0x734, 0x737, 0x73b, 0x74a, 0x756, 0x75a, 0x75f, 0x763, 0x768, 0x76c, 0x771, 0x77a, 0x785, 0x78b, 0x791, 0x797, 0x79d, 0x7a6, 0x7a9, 0x7ac, 0x7b0, 0x7b4, 0x7b8, 0x7be, 0x7c4, 0x7c9, 0x7cc, 0x7dc, 0x7e3, 0x7e6, 0x7eb, 0x7ef, 0x7f5, 0x7fc, 0x800, 0x804, 0x80d, 0x814, 0x819, 0x81d, 0x82b, 0x82e, 0x831, 0x835, 0x839, 0x83c, 0x83f, 0x844, 0x846, 0x848} // idnaSparseValues: 2123 entries, 8492 bytes var idnaSparseValues = [2123]valueRange{ // Block 0x0, offset 0x0 {value: 0x0000, lo: 0x07}, {value: 0xe105, lo: 0x80, hi: 0x96}, {value: 0x0018, lo: 0x97, hi: 0x97}, {value: 0xe105, lo: 0x98, hi: 0x9e}, {value: 0x001f, lo: 0x9f, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xb7}, {value: 0x0008, lo: 0xb8, hi: 0xbf}, // Block 0x1, offset 0x8 {value: 0x0000, lo: 0x10}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0xe01d, lo: 0x81, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0x82}, {value: 0x0335, lo: 0x83, hi: 0x83}, {value: 0x034d, lo: 0x84, hi: 0x84}, {value: 0x0365, lo: 0x85, hi: 0x85}, {value: 0xe00d, lo: 0x86, hi: 0x86}, {value: 0x0008, lo: 0x87, hi: 0x87}, {value: 0xe00d, lo: 0x88, hi: 0x88}, {value: 0x0008, lo: 0x89, hi: 0x89}, {value: 0xe00d, lo: 0x8a, hi: 0x8a}, {value: 0x0008, lo: 0x8b, hi: 0x8b}, {value: 0xe00d, lo: 0x8c, hi: 0x8c}, {value: 0x0008, lo: 0x8d, hi: 0x8d}, {value: 0xe00d, lo: 0x8e, hi: 0x8e}, {value: 0x0008, lo: 0x8f, hi: 0xbf}, // Block 0x2, offset 0x19 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x00a9, lo: 0xb0, hi: 0xb0}, {value: 0x037d, lo: 0xb1, hi: 0xb1}, {value: 0x00b1, lo: 0xb2, hi: 0xb2}, {value: 0x00b9, lo: 0xb3, hi: 0xb3}, {value: 0x034d, lo: 0xb4, hi: 0xb4}, {value: 0x0395, lo: 0xb5, hi: 0xb5}, {value: 0xe1bd, lo: 0xb6, hi: 0xb6}, {value: 0x00c1, lo: 0xb7, hi: 0xb7}, {value: 0x00c9, lo: 0xb8, hi: 0xb8}, {value: 0x0008, lo: 0xb9, hi: 0xbf}, // Block 0x3, offset 0x25 {value: 0x0000, lo: 0x01}, {value: 0x3308, lo: 0x80, hi: 0xbf}, // Block 0x4, offset 0x27 {value: 0x0000, lo: 0x04}, {value: 0x03f5, lo: 0x80, hi: 0x8f}, {value: 0xe105, lo: 0x90, hi: 0x9f}, {value: 0x049d, lo: 0xa0, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x5, offset 0x2c {value: 0x0000, lo: 0x06}, {value: 0xe185, lo: 0x80, hi: 0x8f}, {value: 0x0545, lo: 0x90, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x98}, {value: 0x0008, lo: 0x99, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x6, offset 0x33 {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0131, lo: 0x87, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x88}, {value: 0x0018, lo: 0x89, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0x90}, {value: 0x3308, lo: 0x91, hi: 0xbd}, {value: 0x0818, lo: 0xbe, hi: 0xbe}, {value: 0x3308, lo: 0xbf, hi: 0xbf}, // Block 0x7, offset 0x3e {value: 0x0000, lo: 0x0b}, {value: 0x0818, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x82}, {value: 0x0818, lo: 0x83, hi: 0x83}, {value: 0x3308, lo: 0x84, hi: 0x85}, {value: 0x0818, lo: 0x86, hi: 0x86}, {value: 0x3308, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0808, lo: 0x90, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xae}, {value: 0x0808, lo: 0xaf, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0x8, offset 0x4a {value: 0x0000, lo: 0x03}, {value: 0x0a08, lo: 0x80, hi: 0x87}, {value: 0x0c08, lo: 0x88, hi: 0x99}, {value: 0x0a08, lo: 0x9a, hi: 0xbf}, // Block 0x9, offset 0x4e {value: 0x0000, lo: 0x0e}, {value: 0x3308, lo: 0x80, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8c}, {value: 0x0c08, lo: 0x8d, hi: 0x8d}, {value: 0x0a08, lo: 0x8e, hi: 0x98}, {value: 0x0c08, lo: 0x99, hi: 0x9b}, {value: 0x0a08, lo: 0x9c, hi: 0xaa}, {value: 0x0c08, lo: 0xab, hi: 0xac}, {value: 0x0a08, lo: 0xad, hi: 0xb0}, {value: 0x0c08, lo: 0xb1, hi: 0xb1}, {value: 0x0a08, lo: 0xb2, hi: 0xb2}, {value: 0x0c08, lo: 0xb3, hi: 0xb4}, {value: 0x0a08, lo: 0xb5, hi: 0xb7}, {value: 0x0c08, lo: 0xb8, hi: 0xb9}, {value: 0x0a08, lo: 0xba, hi: 0xbf}, // Block 0xa, offset 0x5d {value: 0x0000, lo: 0x04}, {value: 0x0808, lo: 0x80, hi: 0xa5}, {value: 0x3308, lo: 0xa6, hi: 0xb0}, {value: 0x0808, lo: 0xb1, hi: 0xb1}, {value: 0x0040, lo: 0xb2, hi: 0xbf}, // Block 0xb, offset 0x62 {value: 0x0000, lo: 0x09}, {value: 0x0808, lo: 0x80, hi: 0x89}, {value: 0x0a08, lo: 0x8a, hi: 0xaa}, {value: 0x3308, lo: 0xab, hi: 0xb3}, {value: 0x0808, lo: 0xb4, hi: 0xb5}, {value: 0x0018, lo: 0xb6, hi: 0xb9}, {value: 0x0818, lo: 0xba, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbc}, {value: 0x3308, lo: 0xbd, hi: 0xbd}, {value: 0x0818, lo: 0xbe, hi: 0xbf}, // Block 0xc, offset 0x6c {value: 0x0000, lo: 0x0b}, {value: 0x0808, lo: 0x80, hi: 0x95}, {value: 0x3308, lo: 0x96, hi: 0x99}, {value: 0x0808, lo: 0x9a, hi: 0x9a}, {value: 0x3308, lo: 0x9b, hi: 0xa3}, {value: 0x0808, lo: 0xa4, hi: 0xa4}, {value: 0x3308, lo: 0xa5, hi: 0xa7}, {value: 0x0808, lo: 0xa8, hi: 0xa8}, {value: 0x3308, lo: 0xa9, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x0818, lo: 0xb0, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0xd, offset 0x78 {value: 0x0000, lo: 0x0c}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0a08, lo: 0xa0, hi: 0xa9}, {value: 0x0c08, lo: 0xaa, hi: 0xac}, {value: 0x0808, lo: 0xad, hi: 0xad}, {value: 0x0c08, lo: 0xae, hi: 0xae}, {value: 0x0a08, lo: 0xaf, hi: 0xb0}, {value: 0x0c08, lo: 0xb1, hi: 0xb2}, {value: 0x0a08, lo: 0xb3, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xb5}, {value: 0x0a08, lo: 0xb6, hi: 0xb8}, {value: 0x0c08, lo: 0xb9, hi: 0xb9}, {value: 0x0a08, lo: 0xba, hi: 0xbf}, // Block 0xe, offset 0x85 {value: 0x0000, lo: 0x05}, {value: 0x0a08, lo: 0x80, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x92}, {value: 0x3308, lo: 0x93, hi: 0xa1}, {value: 0x0840, lo: 0xa2, hi: 0xa2}, {value: 0x3308, lo: 0xa3, hi: 0xbf}, // Block 0xf, offset 0x8b {value: 0x0000, lo: 0x08}, {value: 0x3308, lo: 0x80, hi: 0x82}, {value: 0x3008, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0xb9}, {value: 0x3308, lo: 0xba, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbf}, // Block 0x10, offset 0x94 {value: 0x0000, lo: 0x0f}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x3008, lo: 0x81, hi: 0x82}, {value: 0x0040, lo: 0x83, hi: 0x85}, {value: 0x3008, lo: 0x86, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x3008, lo: 0x8a, hi: 0x8c}, {value: 0x3b08, lo: 0x8d, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x96}, {value: 0x3008, lo: 0x97, hi: 0x97}, {value: 0x0040, lo: 0x98, hi: 0xa5}, {value: 0x0008, lo: 0xa6, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbf}, // Block 0x11, offset 0xa4 {value: 0x0000, lo: 0x0d}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x3008, lo: 0x81, hi: 0x83}, {value: 0x3308, lo: 0x84, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8d}, {value: 0x0008, lo: 0x8e, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x91}, {value: 0x0008, lo: 0x92, hi: 0xa8}, {value: 0x0040, lo: 0xa9, hi: 0xa9}, {value: 0x0008, lo: 0xaa, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbd}, {value: 0x3308, lo: 0xbe, hi: 0xbf}, // Block 0x12, offset 0xb2 {value: 0x0000, lo: 0x0a}, {value: 0x3308, lo: 0x80, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8d}, {value: 0x0008, lo: 0x8e, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x91}, {value: 0x0008, lo: 0x92, hi: 0xba}, {value: 0x3b08, lo: 0xbb, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbf}, // Block 0x13, offset 0xbd {value: 0x0000, lo: 0x0c}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x99}, {value: 0x0008, lo: 0x9a, hi: 0xb1}, {value: 0x0040, lo: 0xb2, hi: 0xb2}, {value: 0x0008, lo: 0xb3, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbf}, // Block 0x14, offset 0xca {value: 0x0000, lo: 0x10}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x89}, {value: 0x3b08, lo: 0x8a, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8e}, {value: 0x3008, lo: 0x8f, hi: 0x91}, {value: 0x3308, lo: 0x92, hi: 0x94}, {value: 0x0040, lo: 0x95, hi: 0x95}, {value: 0x3308, lo: 0x96, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x97}, {value: 0x3008, lo: 0x98, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xa5}, {value: 0x0008, lo: 0xa6, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xb1}, {value: 0x3008, lo: 0xb2, hi: 0xb3}, {value: 0x0018, lo: 0xb4, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0x15, offset 0xdb {value: 0x0000, lo: 0x09}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0xb0}, {value: 0x3308, lo: 0xb1, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xb2}, {value: 0x01f1, lo: 0xb3, hi: 0xb3}, {value: 0x3308, lo: 0xb4, hi: 0xb9}, {value: 0x3b08, lo: 0xba, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbe}, {value: 0x0018, lo: 0xbf, hi: 0xbf}, // Block 0x16, offset 0xe5 {value: 0x0000, lo: 0x06}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x3308, lo: 0x87, hi: 0x8e}, {value: 0x0018, lo: 0x8f, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0xbf}, // Block 0x17, offset 0xec {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x84}, {value: 0x0040, lo: 0x85, hi: 0x85}, {value: 0x0008, lo: 0x86, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x87}, {value: 0x3308, lo: 0x88, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9b}, {value: 0x0201, lo: 0x9c, hi: 0x9c}, {value: 0x0209, lo: 0x9d, hi: 0x9d}, {value: 0x0008, lo: 0x9e, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0x18, offset 0xf9 {value: 0x0000, lo: 0x10}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x8a}, {value: 0x0008, lo: 0x8b, hi: 0x8b}, {value: 0xe03d, lo: 0x8c, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0x97}, {value: 0x3308, lo: 0x98, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa9}, {value: 0x0018, lo: 0xaa, hi: 0xb4}, {value: 0x3308, lo: 0xb5, hi: 0xb5}, {value: 0x0018, lo: 0xb6, hi: 0xb6}, {value: 0x3308, lo: 0xb7, hi: 0xb7}, {value: 0x0018, lo: 0xb8, hi: 0xb8}, {value: 0x3308, lo: 0xb9, hi: 0xb9}, {value: 0x0018, lo: 0xba, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbf}, // Block 0x19, offset 0x10a {value: 0x0000, lo: 0x06}, {value: 0x0018, lo: 0x80, hi: 0x85}, {value: 0x3308, lo: 0x86, hi: 0x86}, {value: 0x0018, lo: 0x87, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8d}, {value: 0x0018, lo: 0x8e, hi: 0x9a}, {value: 0x0040, lo: 0x9b, hi: 0xbf}, // Block 0x1a, offset 0x111 {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0xaa}, {value: 0x3008, lo: 0xab, hi: 0xac}, {value: 0x3308, lo: 0xad, hi: 0xb0}, {value: 0x3008, lo: 0xb1, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb7}, {value: 0x3008, lo: 0xb8, hi: 0xb8}, {value: 0x3b08, lo: 0xb9, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbc}, {value: 0x3308, lo: 0xbd, hi: 0xbe}, {value: 0x0008, lo: 0xbf, hi: 0xbf}, // Block 0x1b, offset 0x11c {value: 0x0000, lo: 0x0e}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0018, lo: 0x8a, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x95}, {value: 0x3008, lo: 0x96, hi: 0x97}, {value: 0x3308, lo: 0x98, hi: 0x99}, {value: 0x0008, lo: 0x9a, hi: 0x9d}, {value: 0x3308, lo: 0x9e, hi: 0xa0}, {value: 0x0008, lo: 0xa1, hi: 0xa1}, {value: 0x3008, lo: 0xa2, hi: 0xa4}, {value: 0x0008, lo: 0xa5, hi: 0xa6}, {value: 0x3008, lo: 0xa7, hi: 0xad}, {value: 0x0008, lo: 0xae, hi: 0xb0}, {value: 0x3308, lo: 0xb1, hi: 0xb4}, {value: 0x0008, lo: 0xb5, hi: 0xbf}, // Block 0x1c, offset 0x12b {value: 0x0000, lo: 0x0d}, {value: 0x0008, lo: 0x80, hi: 0x81}, {value: 0x3308, lo: 0x82, hi: 0x82}, {value: 0x3008, lo: 0x83, hi: 0x84}, {value: 0x3308, lo: 0x85, hi: 0x86}, {value: 0x3008, lo: 0x87, hi: 0x8c}, {value: 0x3308, lo: 0x8d, hi: 0x8d}, {value: 0x0008, lo: 0x8e, hi: 0x8e}, {value: 0x3008, lo: 0x8f, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x3008, lo: 0x9a, hi: 0x9c}, {value: 0x3308, lo: 0x9d, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0x1d, offset 0x139 {value: 0x0000, lo: 0x09}, {value: 0x0040, lo: 0x80, hi: 0x86}, {value: 0x055d, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8c}, {value: 0x055d, lo: 0x8d, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xba}, {value: 0x0018, lo: 0xbb, hi: 0xbb}, {value: 0xe105, lo: 0xbc, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbf}, // Block 0x1e, offset 0x143 {value: 0x0000, lo: 0x01}, {value: 0x0018, lo: 0x80, hi: 0xbf}, // Block 0x1f, offset 0x145 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0xa0}, {value: 0x2018, lo: 0xa1, hi: 0xb5}, {value: 0x0018, lo: 0xb6, hi: 0xbf}, // Block 0x20, offset 0x14a {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0xa7}, {value: 0x2018, lo: 0xa8, hi: 0xbf}, // Block 0x21, offset 0x14d {value: 0x0000, lo: 0x02}, {value: 0x2018, lo: 0x80, hi: 0x82}, {value: 0x0018, lo: 0x83, hi: 0xbf}, // Block 0x22, offset 0x150 {value: 0x0000, lo: 0x01}, {value: 0x0008, lo: 0x80, hi: 0xbf}, // Block 0x23, offset 0x152 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0008, lo: 0x8a, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0x98}, {value: 0x0040, lo: 0x99, hi: 0x99}, {value: 0x0008, lo: 0x9a, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x24, offset 0x15e {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0008, lo: 0x8a, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xb0}, {value: 0x0040, lo: 0xb1, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb7}, {value: 0x0008, lo: 0xb8, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0x25, offset 0x169 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x0040, lo: 0x81, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0xbf}, // Block 0x26, offset 0x171 {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x91}, {value: 0x0008, lo: 0x92, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0xbf}, // Block 0x27, offset 0x177 {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x9a}, {value: 0x0040, lo: 0x9b, hi: 0x9c}, {value: 0x3308, lo: 0x9d, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbf}, // Block 0x28, offset 0x17d {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x29, offset 0x182 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb7}, {value: 0xe045, lo: 0xb8, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbf}, // Block 0x2a, offset 0x187 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0xbf}, // Block 0x2b, offset 0x18a {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xac}, {value: 0x0018, lo: 0xad, hi: 0xae}, {value: 0x0008, lo: 0xaf, hi: 0xbf}, // Block 0x2c, offset 0x18e {value: 0x0000, lo: 0x05}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0x9c}, {value: 0x0040, lo: 0x9d, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x2d, offset 0x194 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xaa}, {value: 0x0018, lo: 0xab, hi: 0xb0}, {value: 0x0008, lo: 0xb1, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbf}, // Block 0x2e, offset 0x199 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8d}, {value: 0x0008, lo: 0x8e, hi: 0x91}, {value: 0x3308, lo: 0x92, hi: 0x93}, {value: 0x3b08, lo: 0x94, hi: 0x94}, {value: 0x0040, lo: 0x95, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb3}, {value: 0x3b08, lo: 0xb4, hi: 0xb4}, {value: 0x0018, lo: 0xb5, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0x2f, offset 0x1a5 {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x91}, {value: 0x3308, lo: 0x92, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xad}, {value: 0x0008, lo: 0xae, hi: 0xb0}, {value: 0x0040, lo: 0xb1, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xbf}, // Block 0x30, offset 0x1af {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0xb3}, {value: 0x3340, lo: 0xb4, hi: 0xb5}, {value: 0x3008, lo: 0xb6, hi: 0xb6}, {value: 0x3308, lo: 0xb7, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbf}, // Block 0x31, offset 0x1b5 {value: 0x0000, lo: 0x10}, {value: 0x3008, lo: 0x80, hi: 0x85}, {value: 0x3308, lo: 0x86, hi: 0x86}, {value: 0x3008, lo: 0x87, hi: 0x88}, {value: 0x3308, lo: 0x89, hi: 0x91}, {value: 0x3b08, lo: 0x92, hi: 0x92}, {value: 0x3308, lo: 0x93, hi: 0x93}, {value: 0x0018, lo: 0x94, hi: 0x96}, {value: 0x0008, lo: 0x97, hi: 0x97}, {value: 0x0018, lo: 0x98, hi: 0x9b}, {value: 0x0008, lo: 0x9c, hi: 0x9c}, {value: 0x3308, lo: 0x9d, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa9}, {value: 0x0040, lo: 0xaa, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0x32, offset 0x1c6 {value: 0x0000, lo: 0x09}, {value: 0x0018, lo: 0x80, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x86}, {value: 0x0218, lo: 0x87, hi: 0x87}, {value: 0x0018, lo: 0x88, hi: 0x8a}, {value: 0x33c0, lo: 0x8b, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0208, lo: 0xa0, hi: 0xbf}, // Block 0x33, offset 0x1d0 {value: 0x0000, lo: 0x02}, {value: 0x0208, lo: 0x80, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbf}, // Block 0x34, offset 0x1d3 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0x84}, {value: 0x3308, lo: 0x85, hi: 0x86}, {value: 0x0208, lo: 0x87, hi: 0xa8}, {value: 0x3308, lo: 0xa9, hi: 0xa9}, {value: 0x0208, lo: 0xaa, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x35, offset 0x1db {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xbf}, // Block 0x36, offset 0x1de {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x3308, lo: 0xa0, hi: 0xa2}, {value: 0x3008, lo: 0xa3, hi: 0xa6}, {value: 0x3308, lo: 0xa7, hi: 0xa8}, {value: 0x3008, lo: 0xa9, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x3008, lo: 0xb0, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb2}, {value: 0x3008, lo: 0xb3, hi: 0xb8}, {value: 0x3308, lo: 0xb9, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0x37, offset 0x1eb {value: 0x0000, lo: 0x07}, {value: 0x0018, lo: 0x80, hi: 0x80}, {value: 0x0040, lo: 0x81, hi: 0x83}, {value: 0x0018, lo: 0x84, hi: 0x85}, {value: 0x0008, lo: 0x86, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0x38, offset 0x1f3 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x39, offset 0x1f7 {value: 0x0000, lo: 0x06}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0028, lo: 0x9a, hi: 0x9a}, {value: 0x0040, lo: 0x9b, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0xbf}, // Block 0x3a, offset 0x1fe {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0x96}, {value: 0x3308, lo: 0x97, hi: 0x98}, {value: 0x3008, lo: 0x99, hi: 0x9a}, {value: 0x3308, lo: 0x9b, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x3b, offset 0x206 {value: 0x0000, lo: 0x0f}, {value: 0x0008, lo: 0x80, hi: 0x94}, {value: 0x3008, lo: 0x95, hi: 0x95}, {value: 0x3308, lo: 0x96, hi: 0x96}, {value: 0x3008, lo: 0x97, hi: 0x97}, {value: 0x3308, lo: 0x98, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x3b08, lo: 0xa0, hi: 0xa0}, {value: 0x3008, lo: 0xa1, hi: 0xa1}, {value: 0x3308, lo: 0xa2, hi: 0xa2}, {value: 0x3008, lo: 0xa3, hi: 0xa4}, {value: 0x3308, lo: 0xa5, hi: 0xac}, {value: 0x3008, lo: 0xad, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbe}, {value: 0x3308, lo: 0xbf, hi: 0xbf}, // Block 0x3c, offset 0x216 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa6}, {value: 0x0008, lo: 0xa7, hi: 0xa7}, {value: 0x0018, lo: 0xa8, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xbd}, {value: 0x3318, lo: 0xbe, hi: 0xbe}, {value: 0x3308, lo: 0xbf, hi: 0xbf}, // Block 0x3d, offset 0x222 {value: 0x0000, lo: 0x02}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x0040, lo: 0x81, hi: 0xbf}, // Block 0x3e, offset 0x225 {value: 0x0000, lo: 0x09}, {value: 0x3308, lo: 0x80, hi: 0x83}, {value: 0x3008, lo: 0x84, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0xb3}, {value: 0x3308, lo: 0xb4, hi: 0xb4}, {value: 0x3008, lo: 0xb5, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbc}, {value: 0x3008, lo: 0xbd, hi: 0xbf}, // Block 0x3f, offset 0x22f {value: 0x0000, lo: 0x0b}, {value: 0x3008, lo: 0x80, hi: 0x81}, {value: 0x3308, lo: 0x82, hi: 0x82}, {value: 0x3008, lo: 0x83, hi: 0x83}, {value: 0x3808, lo: 0x84, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0xaa}, {value: 0x3308, lo: 0xab, hi: 0xb3}, {value: 0x0018, lo: 0xb4, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbf}, // Block 0x40, offset 0x23b {value: 0x0000, lo: 0x0b}, {value: 0x3308, lo: 0x80, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0xa0}, {value: 0x3008, lo: 0xa1, hi: 0xa1}, {value: 0x3308, lo: 0xa2, hi: 0xa5}, {value: 0x3008, lo: 0xa6, hi: 0xa7}, {value: 0x3308, lo: 0xa8, hi: 0xa9}, {value: 0x3808, lo: 0xaa, hi: 0xaa}, {value: 0x3b08, lo: 0xab, hi: 0xab}, {value: 0x3308, lo: 0xac, hi: 0xad}, {value: 0x0008, lo: 0xae, hi: 0xbf}, // Block 0x41, offset 0x247 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0xa5}, {value: 0x3308, lo: 0xa6, hi: 0xa6}, {value: 0x3008, lo: 0xa7, hi: 0xa7}, {value: 0x3308, lo: 0xa8, hi: 0xa9}, {value: 0x3008, lo: 0xaa, hi: 0xac}, {value: 0x3308, lo: 0xad, hi: 0xad}, {value: 0x3008, lo: 0xae, hi: 0xae}, {value: 0x3308, lo: 0xaf, hi: 0xb1}, {value: 0x3808, lo: 0xb2, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xbb}, {value: 0x0018, lo: 0xbc, hi: 0xbf}, // Block 0x42, offset 0x253 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0xa3}, {value: 0x3008, lo: 0xa4, hi: 0xab}, {value: 0x3308, lo: 0xac, hi: 0xb3}, {value: 0x3008, lo: 0xb4, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xba}, {value: 0x0018, lo: 0xbb, hi: 0xbf}, // Block 0x43, offset 0x25b {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0x8c}, {value: 0x0008, lo: 0x8d, hi: 0xbd}, {value: 0x0018, lo: 0xbe, hi: 0xbf}, // Block 0x44, offset 0x260 {value: 0x0000, lo: 0x0c}, {value: 0x02a9, lo: 0x80, hi: 0x80}, {value: 0x02b1, lo: 0x81, hi: 0x81}, {value: 0x02b9, lo: 0x82, hi: 0x82}, {value: 0x02c1, lo: 0x83, hi: 0x83}, {value: 0x02c9, lo: 0x84, hi: 0x85}, {value: 0x02d1, lo: 0x86, hi: 0x86}, {value: 0x02d9, lo: 0x87, hi: 0x87}, {value: 0x057d, lo: 0x88, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x8f}, {value: 0x059d, lo: 0x90, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbc}, {value: 0x059d, lo: 0xbd, hi: 0xbf}, // Block 0x45, offset 0x26d {value: 0x0000, lo: 0x10}, {value: 0x0018, lo: 0x80, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x3308, lo: 0x90, hi: 0x92}, {value: 0x0018, lo: 0x93, hi: 0x93}, {value: 0x3308, lo: 0x94, hi: 0xa0}, {value: 0x3008, lo: 0xa1, hi: 0xa1}, {value: 0x3308, lo: 0xa2, hi: 0xa8}, {value: 0x0008, lo: 0xa9, hi: 0xac}, {value: 0x3308, lo: 0xad, hi: 0xad}, {value: 0x0008, lo: 0xae, hi: 0xb3}, {value: 0x3308, lo: 0xb4, hi: 0xb4}, {value: 0x0008, lo: 0xb5, hi: 0xb6}, {value: 0x3008, lo: 0xb7, hi: 0xb7}, {value: 0x3308, lo: 0xb8, hi: 0xb9}, {value: 0x0008, lo: 0xba, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbf}, // Block 0x46, offset 0x27e {value: 0x0000, lo: 0x03}, {value: 0x3308, lo: 0x80, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xba}, {value: 0x3308, lo: 0xbb, hi: 0xbf}, // Block 0x47, offset 0x282 {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x87}, {value: 0xe045, lo: 0x88, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x97}, {value: 0xe045, lo: 0x98, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa7}, {value: 0xe045, lo: 0xa8, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb7}, {value: 0xe045, lo: 0xb8, hi: 0xbf}, // Block 0x48, offset 0x28d {value: 0x0000, lo: 0x03}, {value: 0x0040, lo: 0x80, hi: 0x8f}, {value: 0x3318, lo: 0x90, hi: 0xb0}, {value: 0x0040, lo: 0xb1, hi: 0xbf}, // Block 0x49, offset 0x291 {value: 0x0000, lo: 0x08}, {value: 0x0018, lo: 0x80, hi: 0x82}, {value: 0x0040, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0x84}, {value: 0x0018, lo: 0x85, hi: 0x88}, {value: 0x0851, lo: 0x89, hi: 0x89}, {value: 0x0018, lo: 0x8a, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xbf}, // Block 0x4a, offset 0x29a {value: 0x0000, lo: 0x07}, {value: 0x0018, lo: 0x80, hi: 0xab}, {value: 0x0859, lo: 0xac, hi: 0xac}, {value: 0x0861, lo: 0xad, hi: 0xad}, {value: 0x0018, lo: 0xae, hi: 0xae}, {value: 0x0869, lo: 0xaf, hi: 0xaf}, {value: 0x0871, lo: 0xb0, hi: 0xb0}, {value: 0x0018, lo: 0xb1, hi: 0xbf}, // Block 0x4b, offset 0x2a2 {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x9f}, {value: 0x0080, lo: 0xa0, hi: 0xa0}, {value: 0x0018, lo: 0xa1, hi: 0xad}, {value: 0x0080, lo: 0xae, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xbf}, // Block 0x4c, offset 0x2a8 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0xa8}, {value: 0x09dd, lo: 0xa9, hi: 0xa9}, {value: 0x09fd, lo: 0xaa, hi: 0xaa}, {value: 0x0018, lo: 0xab, hi: 0xbf}, // Block 0x4d, offset 0x2ad {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xbf}, // Block 0x4e, offset 0x2b0 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0x8b}, {value: 0x0929, lo: 0x8c, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0xbf}, // Block 0x4f, offset 0x2b4 {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0xb3}, {value: 0x0e7e, lo: 0xb4, hi: 0xb4}, {value: 0x0932, lo: 0xb5, hi: 0xb5}, {value: 0x0e9e, lo: 0xb6, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xbf}, // Block 0x50, offset 0x2ba {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0x9b}, {value: 0x0939, lo: 0x9c, hi: 0x9c}, {value: 0x0018, lo: 0x9d, hi: 0xbf}, // Block 0x51, offset 0x2be {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xb5}, {value: 0x0018, lo: 0xb6, hi: 0xbf}, // Block 0x52, offset 0x2c2 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x96}, {value: 0x0018, lo: 0x97, hi: 0xbf}, // Block 0x53, offset 0x2c6 {value: 0x0000, lo: 0x05}, {value: 0xe185, lo: 0x80, hi: 0x8f}, {value: 0x03f5, lo: 0x90, hi: 0x9f}, {value: 0x0ebd, lo: 0xa0, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x54, offset 0x2cc {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0xa5}, {value: 0x0040, lo: 0xa6, hi: 0xa6}, {value: 0x0008, lo: 0xa7, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xac}, {value: 0x0008, lo: 0xad, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x55, offset 0x2d4 {value: 0x0000, lo: 0x06}, {value: 0x0008, lo: 0x80, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xae}, {value: 0xe075, lo: 0xaf, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb0}, {value: 0x0040, lo: 0xb1, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0x56, offset 0x2db {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xa7}, {value: 0x0008, lo: 0xa8, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xb7}, {value: 0x0008, lo: 0xb8, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0x57, offset 0x2e6 {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x8e}, {value: 0x0040, lo: 0x8f, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x3308, lo: 0xa0, hi: 0xbf}, // Block 0x58, offset 0x2f0 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xae}, {value: 0x0008, lo: 0xaf, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xbf}, // Block 0x59, offset 0x2f4 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0x92}, {value: 0x0040, lo: 0x93, hi: 0xbf}, // Block 0x5a, offset 0x2f7 {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0x9e}, {value: 0x0ef5, lo: 0x9f, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xbf}, // Block 0x5b, offset 0x2fd {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xb2}, {value: 0x0f15, lo: 0xb3, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xbf}, // Block 0x5c, offset 0x301 {value: 0x0020, lo: 0x01}, {value: 0x0f35, lo: 0x80, hi: 0xbf}, // Block 0x5d, offset 0x303 {value: 0x0020, lo: 0x02}, {value: 0x1735, lo: 0x80, hi: 0x8f}, {value: 0x1915, lo: 0x90, hi: 0xbf}, // Block 0x5e, offset 0x306 {value: 0x0020, lo: 0x01}, {value: 0x1f15, lo: 0x80, hi: 0xbf}, // Block 0x5f, offset 0x308 {value: 0x0000, lo: 0x02}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0xbf}, // Block 0x60, offset 0x30b {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x98}, {value: 0x3308, lo: 0x99, hi: 0x9a}, {value: 0x096a, lo: 0x9b, hi: 0x9b}, {value: 0x0972, lo: 0x9c, hi: 0x9c}, {value: 0x0008, lo: 0x9d, hi: 0x9e}, {value: 0x0979, lo: 0x9f, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa0}, {value: 0x0008, lo: 0xa1, hi: 0xbf}, // Block 0x61, offset 0x315 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xbe}, {value: 0x0981, lo: 0xbf, hi: 0xbf}, // Block 0x62, offset 0x318 {value: 0x0000, lo: 0x0e}, {value: 0x0040, lo: 0x80, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xb0}, {value: 0x2a35, lo: 0xb1, hi: 0xb1}, {value: 0x2a55, lo: 0xb2, hi: 0xb2}, {value: 0x2a75, lo: 0xb3, hi: 0xb3}, {value: 0x2a95, lo: 0xb4, hi: 0xb4}, {value: 0x2a75, lo: 0xb5, hi: 0xb5}, {value: 0x2ab5, lo: 0xb6, hi: 0xb6}, {value: 0x2ad5, lo: 0xb7, hi: 0xb7}, {value: 0x2af5, lo: 0xb8, hi: 0xb9}, {value: 0x2b15, lo: 0xba, hi: 0xbb}, {value: 0x2b35, lo: 0xbc, hi: 0xbd}, {value: 0x2b15, lo: 0xbe, hi: 0xbf}, // Block 0x63, offset 0x327 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xa3}, {value: 0x0040, lo: 0xa4, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x64, offset 0x32b {value: 0x0008, lo: 0x03}, {value: 0x098a, lo: 0x80, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x0a82, lo: 0xa0, hi: 0xbf}, // Block 0x65, offset 0x32f {value: 0x0008, lo: 0x01}, {value: 0x0d19, lo: 0x80, hi: 0xbf}, // Block 0x66, offset 0x331 {value: 0x0008, lo: 0x08}, {value: 0x0f19, lo: 0x80, hi: 0xb0}, {value: 0x4045, lo: 0xb1, hi: 0xb1}, {value: 0x10a1, lo: 0xb2, hi: 0xb3}, {value: 0x4065, lo: 0xb4, hi: 0xb4}, {value: 0x10b1, lo: 0xb5, hi: 0xb7}, {value: 0x4085, lo: 0xb8, hi: 0xb8}, {value: 0x4085, lo: 0xb9, hi: 0xb9}, {value: 0x10c9, lo: 0xba, hi: 0xbf}, // Block 0x67, offset 0x33a {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbf}, // Block 0x68, offset 0x33d {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xbf}, // Block 0x69, offset 0x341 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xbd}, {value: 0x0018, lo: 0xbe, hi: 0xbf}, // Block 0x6a, offset 0x346 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xbf}, // Block 0x6b, offset 0x34b {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0xa5}, {value: 0x0018, lo: 0xa6, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb1}, {value: 0x0018, lo: 0xb2, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbf}, // Block 0x6c, offset 0x351 {value: 0x0000, lo: 0x10}, {value: 0x0040, lo: 0x80, hi: 0x81}, {value: 0xe00d, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0x83}, {value: 0x03f5, lo: 0x84, hi: 0x84}, {value: 0x0479, lo: 0x85, hi: 0x85}, {value: 0x447d, lo: 0x86, hi: 0x86}, {value: 0xe07d, lo: 0x87, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x88}, {value: 0xe01d, lo: 0x89, hi: 0x89}, {value: 0x0008, lo: 0x8a, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0xb4}, {value: 0xe01d, lo: 0xb5, hi: 0xb5}, {value: 0x0008, lo: 0xb6, hi: 0xb7}, {value: 0x0741, lo: 0xb8, hi: 0xb8}, {value: 0x13f1, lo: 0xb9, hi: 0xb9}, {value: 0x0008, lo: 0xba, hi: 0xbf}, // Block 0x6d, offset 0x362 {value: 0x0000, lo: 0x0f}, {value: 0x0008, lo: 0x80, hi: 0x81}, {value: 0x3308, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0x85}, {value: 0x3b08, lo: 0x86, hi: 0x86}, {value: 0x0008, lo: 0x87, hi: 0x8a}, {value: 0x3308, lo: 0x8b, hi: 0x8b}, {value: 0x0008, lo: 0x8c, hi: 0xa2}, {value: 0x3008, lo: 0xa3, hi: 0xa4}, {value: 0x3308, lo: 0xa5, hi: 0xa6}, {value: 0x3008, lo: 0xa7, hi: 0xa7}, {value: 0x0018, lo: 0xa8, hi: 0xab}, {value: 0x3b08, lo: 0xac, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0x6e, offset 0x372 {value: 0x0000, lo: 0x05}, {value: 0x0208, lo: 0x80, hi: 0xb1}, {value: 0x0108, lo: 0xb2, hi: 0xb2}, {value: 0x0008, lo: 0xb3, hi: 0xb3}, {value: 0x0018, lo: 0xb4, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbf}, // Block 0x6f, offset 0x378 {value: 0x0000, lo: 0x03}, {value: 0x3008, lo: 0x80, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0xb3}, {value: 0x3008, lo: 0xb4, hi: 0xbf}, // Block 0x70, offset 0x37c {value: 0x0000, lo: 0x0e}, {value: 0x3008, lo: 0x80, hi: 0x83}, {value: 0x3b08, lo: 0x84, hi: 0x84}, {value: 0x3308, lo: 0x85, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x8d}, {value: 0x0018, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x3308, lo: 0xa0, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xb7}, {value: 0x0018, lo: 0xb8, hi: 0xba}, {value: 0x0008, lo: 0xbb, hi: 0xbb}, {value: 0x0018, lo: 0xbc, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbe}, {value: 0x3308, lo: 0xbf, hi: 0xbf}, // Block 0x71, offset 0x38b {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xa5}, {value: 0x3308, lo: 0xa6, hi: 0xad}, {value: 0x0018, lo: 0xae, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x72, offset 0x390 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x3308, lo: 0x87, hi: 0x91}, {value: 0x3008, lo: 0x92, hi: 0x92}, {value: 0x3808, lo: 0x93, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x9e}, {value: 0x0018, lo: 0x9f, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbf}, // Block 0x73, offset 0x398 {value: 0x0000, lo: 0x09}, {value: 0x3308, lo: 0x80, hi: 0x82}, {value: 0x3008, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb3}, {value: 0x3008, lo: 0xb4, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xb9}, {value: 0x3008, lo: 0xba, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbf}, // Block 0x74, offset 0x3a2 {value: 0x0000, lo: 0x0a}, {value: 0x3808, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8e}, {value: 0x0008, lo: 0x8f, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa4}, {value: 0x3308, lo: 0xa5, hi: 0xa5}, {value: 0x0008, lo: 0xa6, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0x75, offset 0x3ad {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0xa8}, {value: 0x3308, lo: 0xa9, hi: 0xae}, {value: 0x3008, lo: 0xaf, hi: 0xb0}, {value: 0x3308, lo: 0xb1, hi: 0xb2}, {value: 0x3008, lo: 0xb3, hi: 0xb4}, {value: 0x3308, lo: 0xb5, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0x76, offset 0x3b5 {value: 0x0000, lo: 0x10}, {value: 0x0008, lo: 0x80, hi: 0x82}, {value: 0x3308, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0x8b}, {value: 0x3308, lo: 0x8c, hi: 0x8c}, {value: 0x3008, lo: 0x8d, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9b}, {value: 0x0018, lo: 0x9c, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xb9}, {value: 0x0008, lo: 0xba, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbc}, {value: 0x3008, lo: 0xbd, hi: 0xbd}, {value: 0x0008, lo: 0xbe, hi: 0xbf}, // Block 0x77, offset 0x3c6 {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb0}, {value: 0x0008, lo: 0xb1, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb4}, {value: 0x0008, lo: 0xb5, hi: 0xb6}, {value: 0x3308, lo: 0xb7, hi: 0xb8}, {value: 0x0008, lo: 0xb9, hi: 0xbd}, {value: 0x3308, lo: 0xbe, hi: 0xbf}, // Block 0x78, offset 0x3cf {value: 0x0000, lo: 0x0f}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0x82}, {value: 0x0040, lo: 0x83, hi: 0x9a}, {value: 0x0008, lo: 0x9b, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xaa}, {value: 0x3008, lo: 0xab, hi: 0xab}, {value: 0x3308, lo: 0xac, hi: 0xad}, {value: 0x3008, lo: 0xae, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xb4}, {value: 0x3008, lo: 0xb5, hi: 0xb5}, {value: 0x3b08, lo: 0xb6, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0x79, offset 0x3df {value: 0x0000, lo: 0x0c}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x88}, {value: 0x0008, lo: 0x89, hi: 0x8e}, {value: 0x0040, lo: 0x8f, hi: 0x90}, {value: 0x0008, lo: 0x91, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xa7}, {value: 0x0008, lo: 0xa8, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x7a, offset 0x3ec {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0x9b}, {value: 0x449d, lo: 0x9c, hi: 0x9c}, {value: 0x44b5, lo: 0x9d, hi: 0x9d}, {value: 0x0941, lo: 0x9e, hi: 0x9e}, {value: 0xe06d, lo: 0x9f, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa8}, {value: 0x13f9, lo: 0xa9, hi: 0xa9}, {value: 0x0018, lo: 0xaa, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x44cd, lo: 0xb0, hi: 0xbf}, // Block 0x7b, offset 0x3f8 {value: 0x0000, lo: 0x04}, {value: 0x44ed, lo: 0x80, hi: 0x8f}, {value: 0x450d, lo: 0x90, hi: 0x9f}, {value: 0x452d, lo: 0xa0, hi: 0xaf}, {value: 0x450d, lo: 0xb0, hi: 0xbf}, // Block 0x7c, offset 0x3fd {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0xa2}, {value: 0x3008, lo: 0xa3, hi: 0xa4}, {value: 0x3308, lo: 0xa5, hi: 0xa5}, {value: 0x3008, lo: 0xa6, hi: 0xa7}, {value: 0x3308, lo: 0xa8, hi: 0xa8}, {value: 0x3008, lo: 0xa9, hi: 0xaa}, {value: 0x0018, lo: 0xab, hi: 0xab}, {value: 0x3008, lo: 0xac, hi: 0xac}, {value: 0x3b08, lo: 0xad, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0x7d, offset 0x40a {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xa3}, {value: 0x0040, lo: 0xa4, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xbf}, // Block 0x7e, offset 0x40e {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x8a}, {value: 0x0018, lo: 0x8b, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0x7f, offset 0x413 {value: 0x0000, lo: 0x01}, {value: 0x0040, lo: 0x80, hi: 0xbf}, // Block 0x80, offset 0x415 {value: 0x0020, lo: 0x01}, {value: 0x454d, lo: 0x80, hi: 0xbf}, // Block 0x81, offset 0x417 {value: 0x0020, lo: 0x03}, {value: 0x4d4d, lo: 0x80, hi: 0x94}, {value: 0x4b0d, lo: 0x95, hi: 0x95}, {value: 0x4fed, lo: 0x96, hi: 0xbf}, // Block 0x82, offset 0x41b {value: 0x0020, lo: 0x01}, {value: 0x552d, lo: 0x80, hi: 0xbf}, // Block 0x83, offset 0x41d {value: 0x0020, lo: 0x03}, {value: 0x5d2d, lo: 0x80, hi: 0x84}, {value: 0x568d, lo: 0x85, hi: 0x85}, {value: 0x5dcd, lo: 0x86, hi: 0xbf}, // Block 0x84, offset 0x421 {value: 0x0020, lo: 0x08}, {value: 0x6b8d, lo: 0x80, hi: 0x8f}, {value: 0x6d4d, lo: 0x90, hi: 0x90}, {value: 0x6d8d, lo: 0x91, hi: 0xab}, {value: 0x1401, lo: 0xac, hi: 0xac}, {value: 0x70ed, lo: 0xad, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x710d, lo: 0xb0, hi: 0xbf}, // Block 0x85, offset 0x42a {value: 0x0020, lo: 0x05}, {value: 0x730d, lo: 0x80, hi: 0xad}, {value: 0x656d, lo: 0xae, hi: 0xae}, {value: 0x78cd, lo: 0xaf, hi: 0xb5}, {value: 0x6f8d, lo: 0xb6, hi: 0xb6}, {value: 0x79ad, lo: 0xb7, hi: 0xbf}, // Block 0x86, offset 0x430 {value: 0x0008, lo: 0x03}, {value: 0x1751, lo: 0x80, hi: 0x82}, {value: 0x1741, lo: 0x83, hi: 0x83}, {value: 0x1769, lo: 0x84, hi: 0xbf}, // Block 0x87, offset 0x434 {value: 0x0008, lo: 0x0f}, {value: 0x1d81, lo: 0x80, hi: 0x83}, {value: 0x1d99, lo: 0x84, hi: 0x85}, {value: 0x1da1, lo: 0x86, hi: 0x87}, {value: 0x1da9, lo: 0x88, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x91}, {value: 0x1de9, lo: 0x92, hi: 0x97}, {value: 0x1e11, lo: 0x98, hi: 0x9c}, {value: 0x1e31, lo: 0x9d, hi: 0xb3}, {value: 0x1d71, lo: 0xb4, hi: 0xb4}, {value: 0x1d81, lo: 0xb5, hi: 0xb5}, {value: 0x1ee9, lo: 0xb6, hi: 0xbb}, {value: 0x1f09, lo: 0xbc, hi: 0xbc}, {value: 0x1ef9, lo: 0xbd, hi: 0xbd}, {value: 0x1f19, lo: 0xbe, hi: 0xbf}, // Block 0x88, offset 0x444 {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8c}, {value: 0x0008, lo: 0x8d, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xa7}, {value: 0x0008, lo: 0xa8, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbb}, {value: 0x0008, lo: 0xbc, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbe}, {value: 0x0008, lo: 0xbf, hi: 0xbf}, // Block 0x89, offset 0x44e {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0xbf}, // Block 0x8a, offset 0x453 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbf}, // Block 0x8b, offset 0x456 {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x82}, {value: 0x0040, lo: 0x83, hi: 0x86}, {value: 0x0018, lo: 0x87, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xbf}, // Block 0x8c, offset 0x45c {value: 0x0000, lo: 0x06}, {value: 0x0018, lo: 0x80, hi: 0x8e}, {value: 0x0040, lo: 0x8f, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0x9c}, {value: 0x0040, lo: 0x9d, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa0}, {value: 0x0040, lo: 0xa1, hi: 0xbf}, // Block 0x8d, offset 0x463 {value: 0x0000, lo: 0x04}, {value: 0x0040, lo: 0x80, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xbc}, {value: 0x3308, lo: 0xbd, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbf}, // Block 0x8e, offset 0x468 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0x9c}, {value: 0x0040, lo: 0x9d, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x8f, offset 0x46c {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x9f}, {value: 0x3308, lo: 0xa0, hi: 0xa0}, {value: 0x0018, lo: 0xa1, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0x90, offset 0x472 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa3}, {value: 0x0040, lo: 0xa4, hi: 0xac}, {value: 0x0008, lo: 0xad, hi: 0xbf}, // Block 0x91, offset 0x477 {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0x89}, {value: 0x0018, lo: 0x8a, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbf}, // Block 0x92, offset 0x480 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9e}, {value: 0x0018, lo: 0x9f, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x93, offset 0x485 {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0xbf}, // Block 0x94, offset 0x48b {value: 0x0000, lo: 0x06}, {value: 0xe145, lo: 0x80, hi: 0x87}, {value: 0xe1c5, lo: 0x88, hi: 0x8f}, {value: 0xe145, lo: 0x90, hi: 0x97}, {value: 0x8b0d, lo: 0x98, hi: 0x9f}, {value: 0x8b25, lo: 0xa0, hi: 0xa7}, {value: 0x0008, lo: 0xa8, hi: 0xbf}, // Block 0x95, offset 0x492 {value: 0x0000, lo: 0x06}, {value: 0x0008, lo: 0x80, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa9}, {value: 0x0040, lo: 0xaa, hi: 0xaf}, {value: 0x8b25, lo: 0xb0, hi: 0xb7}, {value: 0x8b0d, lo: 0xb8, hi: 0xbf}, // Block 0x96, offset 0x499 {value: 0x0000, lo: 0x06}, {value: 0xe145, lo: 0x80, hi: 0x87}, {value: 0xe1c5, lo: 0x88, hi: 0x8f}, {value: 0xe145, lo: 0x90, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0x97, offset 0x4a0 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x98, offset 0x4a4 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xa3}, {value: 0x0040, lo: 0xa4, hi: 0xae}, {value: 0x0018, lo: 0xaf, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, // Block 0x99, offset 0x4a9 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0x9a, offset 0x4ac {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xbf}, // Block 0x9b, offset 0x4b1 {value: 0x0000, lo: 0x0b}, {value: 0x0808, lo: 0x80, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x87}, {value: 0x0808, lo: 0x88, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0808, lo: 0x8a, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb6}, {value: 0x0808, lo: 0xb7, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbb}, {value: 0x0808, lo: 0xbc, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbe}, {value: 0x0808, lo: 0xbf, hi: 0xbf}, // Block 0x9c, offset 0x4bd {value: 0x0000, lo: 0x05}, {value: 0x0808, lo: 0x80, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x96}, {value: 0x0818, lo: 0x97, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xb6}, {value: 0x0818, lo: 0xb7, hi: 0xbf}, // Block 0x9d, offset 0x4c3 {value: 0x0000, lo: 0x04}, {value: 0x0808, lo: 0x80, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0xa6}, {value: 0x0818, lo: 0xa7, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, // Block 0x9e, offset 0x4c8 {value: 0x0000, lo: 0x06}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xb3}, {value: 0x0808, lo: 0xb4, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xba}, {value: 0x0818, lo: 0xbb, hi: 0xbf}, // Block 0x9f, offset 0x4cf {value: 0x0000, lo: 0x07}, {value: 0x0808, lo: 0x80, hi: 0x95}, {value: 0x0818, lo: 0x96, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0x9e}, {value: 0x0018, lo: 0x9f, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbe}, {value: 0x0818, lo: 0xbf, hi: 0xbf}, // Block 0xa0, offset 0x4d7 {value: 0x0000, lo: 0x04}, {value: 0x0808, lo: 0x80, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbb}, {value: 0x0818, lo: 0xbc, hi: 0xbd}, {value: 0x0808, lo: 0xbe, hi: 0xbf}, // Block 0xa1, offset 0x4dc {value: 0x0000, lo: 0x03}, {value: 0x0818, lo: 0x80, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0x91}, {value: 0x0818, lo: 0x92, hi: 0xbf}, // Block 0xa2, offset 0x4e0 {value: 0x0000, lo: 0x0f}, {value: 0x0808, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x84}, {value: 0x3308, lo: 0x85, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x8b}, {value: 0x3308, lo: 0x8c, hi: 0x8f}, {value: 0x0808, lo: 0x90, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x94}, {value: 0x0808, lo: 0x95, hi: 0x97}, {value: 0x0040, lo: 0x98, hi: 0x98}, {value: 0x0808, lo: 0x99, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb7}, {value: 0x3308, lo: 0xb8, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0xa3, offset 0x4f0 {value: 0x0000, lo: 0x06}, {value: 0x0818, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x8f}, {value: 0x0818, lo: 0x90, hi: 0x98}, {value: 0x0040, lo: 0x99, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xbc}, {value: 0x0818, lo: 0xbd, hi: 0xbf}, // Block 0xa4, offset 0x4f7 {value: 0x0000, lo: 0x03}, {value: 0x0808, lo: 0x80, hi: 0x9c}, {value: 0x0818, lo: 0x9d, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0xa5, offset 0x4fb {value: 0x0000, lo: 0x03}, {value: 0x0808, lo: 0x80, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb8}, {value: 0x0018, lo: 0xb9, hi: 0xbf}, // Block 0xa6, offset 0x4ff {value: 0x0000, lo: 0x06}, {value: 0x0808, lo: 0x80, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x97}, {value: 0x0818, lo: 0x98, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xb7}, {value: 0x0818, lo: 0xb8, hi: 0xbf}, // Block 0xa7, offset 0x506 {value: 0x0000, lo: 0x01}, {value: 0x0808, lo: 0x80, hi: 0xbf}, // Block 0xa8, offset 0x508 {value: 0x0000, lo: 0x02}, {value: 0x0808, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0xbf}, // Block 0xa9, offset 0x50b {value: 0x0000, lo: 0x02}, {value: 0x03dd, lo: 0x80, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xbf}, // Block 0xaa, offset 0x50e {value: 0x0000, lo: 0x03}, {value: 0x0808, lo: 0x80, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xb9}, {value: 0x0818, lo: 0xba, hi: 0xbf}, // Block 0xab, offset 0x512 {value: 0x0000, lo: 0x08}, {value: 0x0908, lo: 0x80, hi: 0x80}, {value: 0x0a08, lo: 0x81, hi: 0xa1}, {value: 0x0c08, lo: 0xa2, hi: 0xa2}, {value: 0x0a08, lo: 0xa3, hi: 0xa3}, {value: 0x3308, lo: 0xa4, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xaf}, {value: 0x0808, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0xac, offset 0x51b {value: 0x0000, lo: 0x03}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0818, lo: 0xa0, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0xad, offset 0x51f {value: 0x0000, lo: 0x07}, {value: 0x0808, lo: 0x80, hi: 0xa9}, {value: 0x0040, lo: 0xaa, hi: 0xaa}, {value: 0x3308, lo: 0xab, hi: 0xac}, {value: 0x0818, lo: 0xad, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x0808, lo: 0xb0, hi: 0xb1}, {value: 0x0040, lo: 0xb2, hi: 0xbf}, // Block 0xae, offset 0x527 {value: 0x0000, lo: 0x07}, {value: 0x0808, lo: 0x80, hi: 0x9c}, {value: 0x0818, lo: 0x9d, hi: 0xa6}, {value: 0x0808, lo: 0xa7, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xaf}, {value: 0x0a08, lo: 0xb0, hi: 0xb2}, {value: 0x0c08, lo: 0xb3, hi: 0xb3}, {value: 0x0a08, lo: 0xb4, hi: 0xbf}, // Block 0xaf, offset 0x52f {value: 0x0000, lo: 0x07}, {value: 0x0a08, lo: 0x80, hi: 0x84}, {value: 0x0808, lo: 0x85, hi: 0x85}, {value: 0x3308, lo: 0x86, hi: 0x90}, {value: 0x0a18, lo: 0x91, hi: 0x93}, {value: 0x0c18, lo: 0x94, hi: 0x94}, {value: 0x0818, lo: 0x95, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0xbf}, // Block 0xb0, offset 0x537 {value: 0x0000, lo: 0x0b}, {value: 0x0040, lo: 0x80, hi: 0xaf}, {value: 0x0a08, lo: 0xb0, hi: 0xb0}, {value: 0x0808, lo: 0xb1, hi: 0xb1}, {value: 0x0a08, lo: 0xb2, hi: 0xb3}, {value: 0x0c08, lo: 0xb4, hi: 0xb6}, {value: 0x0808, lo: 0xb7, hi: 0xb7}, {value: 0x0a08, lo: 0xb8, hi: 0xb8}, {value: 0x0c08, lo: 0xb9, hi: 0xba}, {value: 0x0a08, lo: 0xbb, hi: 0xbc}, {value: 0x0c08, lo: 0xbd, hi: 0xbd}, {value: 0x0a08, lo: 0xbe, hi: 0xbf}, // Block 0xb1, offset 0x543 {value: 0x0000, lo: 0x0b}, {value: 0x0808, lo: 0x80, hi: 0x80}, {value: 0x0a08, lo: 0x81, hi: 0x81}, {value: 0x0c08, lo: 0x82, hi: 0x83}, {value: 0x0a08, lo: 0x84, hi: 0x84}, {value: 0x0818, lo: 0x85, hi: 0x88}, {value: 0x0c18, lo: 0x89, hi: 0x89}, {value: 0x0a18, lo: 0x8a, hi: 0x8a}, {value: 0x0918, lo: 0x8b, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0xb2, offset 0x54f {value: 0x0000, lo: 0x05}, {value: 0x3008, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0xb7}, {value: 0x3308, lo: 0xb8, hi: 0xbf}, // Block 0xb3, offset 0x555 {value: 0x0000, lo: 0x08}, {value: 0x3308, lo: 0x80, hi: 0x85}, {value: 0x3b08, lo: 0x86, hi: 0x86}, {value: 0x0018, lo: 0x87, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x91}, {value: 0x0018, lo: 0x92, hi: 0xa5}, {value: 0x0008, lo: 0xa6, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0xb4, offset 0x55e {value: 0x0000, lo: 0x0b}, {value: 0x3308, lo: 0x80, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0xaf}, {value: 0x3008, lo: 0xb0, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb6}, {value: 0x3008, lo: 0xb7, hi: 0xb8}, {value: 0x3b08, lo: 0xb9, hi: 0xb9}, {value: 0x3308, lo: 0xba, hi: 0xba}, {value: 0x0018, lo: 0xbb, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbd}, {value: 0x0018, lo: 0xbe, hi: 0xbf}, // Block 0xb5, offset 0x56a {value: 0x0000, lo: 0x06}, {value: 0x0018, lo: 0x80, hi: 0x81}, {value: 0x0040, lo: 0x82, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xa8}, {value: 0x0040, lo: 0xa9, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0xb6, offset 0x571 {value: 0x0000, lo: 0x08}, {value: 0x3308, lo: 0x80, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0xa6}, {value: 0x3308, lo: 0xa7, hi: 0xab}, {value: 0x3008, lo: 0xac, hi: 0xac}, {value: 0x3308, lo: 0xad, hi: 0xb2}, {value: 0x3b08, lo: 0xb3, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xb5}, {value: 0x0008, lo: 0xb6, hi: 0xbf}, // Block 0xb7, offset 0x57a {value: 0x0000, lo: 0x0a}, {value: 0x0018, lo: 0x80, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0x84}, {value: 0x3008, lo: 0x85, hi: 0x86}, {value: 0x0008, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb3}, {value: 0x0018, lo: 0xb4, hi: 0xb5}, {value: 0x0008, lo: 0xb6, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0xb8, offset 0x585 {value: 0x0000, lo: 0x06}, {value: 0x3308, lo: 0x80, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0xb2}, {value: 0x3008, lo: 0xb3, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xbe}, {value: 0x3008, lo: 0xbf, hi: 0xbf}, // Block 0xb9, offset 0x58c {value: 0x0000, lo: 0x0e}, {value: 0x3808, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0x84}, {value: 0x0018, lo: 0x85, hi: 0x88}, {value: 0x3308, lo: 0x89, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0x8d}, {value: 0x3008, lo: 0x8e, hi: 0x8e}, {value: 0x3308, lo: 0x8f, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0x9b}, {value: 0x0008, lo: 0x9c, hi: 0x9c}, {value: 0x0018, lo: 0x9d, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xa0}, {value: 0x0018, lo: 0xa1, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0xba, offset 0x59b {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x91}, {value: 0x0040, lo: 0x92, hi: 0x92}, {value: 0x0008, lo: 0x93, hi: 0xab}, {value: 0x3008, lo: 0xac, hi: 0xae}, {value: 0x3308, lo: 0xaf, hi: 0xb1}, {value: 0x3008, lo: 0xb2, hi: 0xb3}, {value: 0x3308, lo: 0xb4, hi: 0xb4}, {value: 0x3808, lo: 0xb5, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xb7}, {value: 0x0018, lo: 0xb8, hi: 0xbd}, {value: 0x3308, lo: 0xbe, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0xbb, offset 0x5a8 {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0008, lo: 0x8a, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8e}, {value: 0x0008, lo: 0x8f, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9e}, {value: 0x0008, lo: 0x9f, hi: 0xa8}, {value: 0x0018, lo: 0xa9, hi: 0xa9}, {value: 0x0040, lo: 0xaa, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0xbc, offset 0x5b5 {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0x9e}, {value: 0x3308, lo: 0x9f, hi: 0x9f}, {value: 0x3008, lo: 0xa0, hi: 0xa2}, {value: 0x3308, lo: 0xa3, hi: 0xa9}, {value: 0x3b08, lo: 0xaa, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0xbd, offset 0x5be {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xb4}, {value: 0x3008, lo: 0xb5, hi: 0xb7}, {value: 0x3308, lo: 0xb8, hi: 0xbf}, // Block 0xbe, offset 0x5c2 {value: 0x0000, lo: 0x0e}, {value: 0x3008, lo: 0x80, hi: 0x81}, {value: 0x3b08, lo: 0x82, hi: 0x82}, {value: 0x3308, lo: 0x83, hi: 0x84}, {value: 0x3008, lo: 0x85, hi: 0x85}, {value: 0x3308, lo: 0x86, hi: 0x86}, {value: 0x0008, lo: 0x87, hi: 0x8a}, {value: 0x0018, lo: 0x8b, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0x9c}, {value: 0x0018, lo: 0x9d, hi: 0x9d}, {value: 0x3308, lo: 0x9e, hi: 0x9e}, {value: 0x0008, lo: 0x9f, hi: 0xa1}, {value: 0x0040, lo: 0xa2, hi: 0xbf}, // Block 0xbf, offset 0x5d1 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x3008, lo: 0xb0, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb8}, {value: 0x3008, lo: 0xb9, hi: 0xb9}, {value: 0x3308, lo: 0xba, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbe}, {value: 0x3308, lo: 0xbf, hi: 0xbf}, // Block 0xc0, offset 0x5d9 {value: 0x0000, lo: 0x0a}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x3008, lo: 0x81, hi: 0x81}, {value: 0x3b08, lo: 0x82, hi: 0x82}, {value: 0x3308, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0x85}, {value: 0x0018, lo: 0x86, hi: 0x86}, {value: 0x0008, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0xbf}, // Block 0xc1, offset 0x5e4 {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0xae}, {value: 0x3008, lo: 0xaf, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb7}, {value: 0x3008, lo: 0xb8, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0xc2, offset 0x5ed {value: 0x0000, lo: 0x05}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0x9b}, {value: 0x3308, lo: 0x9c, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0xbf}, // Block 0xc3, offset 0x5f3 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x3008, lo: 0xb0, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbc}, {value: 0x3308, lo: 0xbd, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0xc4, offset 0x5fb {value: 0x0000, lo: 0x08}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0x84}, {value: 0x0040, lo: 0x85, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xbf}, // Block 0xc5, offset 0x604 {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0xaa}, {value: 0x3308, lo: 0xab, hi: 0xab}, {value: 0x3008, lo: 0xac, hi: 0xac}, {value: 0x3308, lo: 0xad, hi: 0xad}, {value: 0x3008, lo: 0xae, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb5}, {value: 0x3808, lo: 0xb6, hi: 0xb6}, {value: 0x3308, lo: 0xb7, hi: 0xb7}, {value: 0x0008, lo: 0xb8, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbf}, // Block 0xc6, offset 0x60f {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0xbf}, // Block 0xc7, offset 0x612 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x9a}, {value: 0x0040, lo: 0x9b, hi: 0x9c}, {value: 0x3308, lo: 0x9d, hi: 0x9f}, {value: 0x3008, lo: 0xa0, hi: 0xa1}, {value: 0x3308, lo: 0xa2, hi: 0xa5}, {value: 0x3008, lo: 0xa6, hi: 0xa6}, {value: 0x3308, lo: 0xa7, hi: 0xaa}, {value: 0x3b08, lo: 0xab, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb9}, {value: 0x0018, lo: 0xba, hi: 0xbf}, // Block 0xc8, offset 0x61e {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0xab}, {value: 0x3008, lo: 0xac, hi: 0xae}, {value: 0x3308, lo: 0xaf, hi: 0xb7}, {value: 0x3008, lo: 0xb8, hi: 0xb8}, {value: 0x3b08, lo: 0xb9, hi: 0xb9}, {value: 0x3308, lo: 0xba, hi: 0xba}, {value: 0x0018, lo: 0xbb, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0xc9, offset 0x627 {value: 0x0000, lo: 0x02}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x049d, lo: 0xa0, hi: 0xbf}, // Block 0xca, offset 0x62a {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xa9}, {value: 0x0018, lo: 0xaa, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xbe}, {value: 0x0008, lo: 0xbf, hi: 0xbf}, // Block 0xcb, offset 0x62f {value: 0x0000, lo: 0x08}, {value: 0x3008, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x82}, {value: 0x3308, lo: 0x83, hi: 0x83}, {value: 0x0018, lo: 0x84, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0xbf}, // Block 0xcc, offset 0x638 {value: 0x0000, lo: 0x04}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xa9}, {value: 0x0008, lo: 0xaa, hi: 0xbf}, // Block 0xcd, offset 0x63d {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x90}, {value: 0x3008, lo: 0x91, hi: 0x93}, {value: 0x3308, lo: 0x94, hi: 0x97}, {value: 0x0040, lo: 0x98, hi: 0x99}, {value: 0x3308, lo: 0x9a, hi: 0x9b}, {value: 0x3008, lo: 0x9c, hi: 0x9f}, {value: 0x3b08, lo: 0xa0, hi: 0xa0}, {value: 0x0008, lo: 0xa1, hi: 0xa1}, {value: 0x0018, lo: 0xa2, hi: 0xa2}, {value: 0x0008, lo: 0xa3, hi: 0xa3}, {value: 0x3008, lo: 0xa4, hi: 0xa4}, {value: 0x0040, lo: 0xa5, hi: 0xbf}, // Block 0xce, offset 0x64a {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x8a}, {value: 0x0008, lo: 0x8b, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb3}, {value: 0x3b08, lo: 0xb4, hi: 0xb4}, {value: 0x3308, lo: 0xb5, hi: 0xb8}, {value: 0x3008, lo: 0xb9, hi: 0xb9}, {value: 0x0008, lo: 0xba, hi: 0xba}, {value: 0x3308, lo: 0xbb, hi: 0xbe}, {value: 0x0018, lo: 0xbf, hi: 0xbf}, // Block 0xcf, offset 0x655 {value: 0x0000, lo: 0x08}, {value: 0x0018, lo: 0x80, hi: 0x86}, {value: 0x3b08, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x90}, {value: 0x3308, lo: 0x91, hi: 0x96}, {value: 0x3008, lo: 0x97, hi: 0x98}, {value: 0x3308, lo: 0x99, hi: 0x9b}, {value: 0x0008, lo: 0x9c, hi: 0xbf}, // Block 0xd0, offset 0x65e {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x3308, lo: 0x8a, hi: 0x96}, {value: 0x3008, lo: 0x97, hi: 0x97}, {value: 0x3308, lo: 0x98, hi: 0x98}, {value: 0x3b08, lo: 0x99, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0x9c}, {value: 0x0008, lo: 0x9d, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0xa2}, {value: 0x0040, lo: 0xa3, hi: 0xbf}, // Block 0xd1, offset 0x668 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbf}, // Block 0xd2, offset 0x66b {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0008, lo: 0x8a, hi: 0xae}, {value: 0x3008, lo: 0xaf, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xb7}, {value: 0x3308, lo: 0xb8, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0xd3, offset 0x675 {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xbf}, // Block 0xd4, offset 0x67e {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0x91}, {value: 0x3308, lo: 0x92, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xa8}, {value: 0x3008, lo: 0xa9, hi: 0xa9}, {value: 0x3308, lo: 0xaa, hi: 0xb0}, {value: 0x3008, lo: 0xb1, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb3}, {value: 0x3008, lo: 0xb4, hi: 0xb4}, {value: 0x3308, lo: 0xb5, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0xd5, offset 0x68a {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0x8a}, {value: 0x0008, lo: 0x8b, hi: 0xb0}, {value: 0x3308, lo: 0xb1, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xb9}, {value: 0x3308, lo: 0xba, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbe}, {value: 0x3308, lo: 0xbf, hi: 0xbf}, // Block 0xd6, offset 0x697 {value: 0x0000, lo: 0x0c}, {value: 0x3308, lo: 0x80, hi: 0x83}, {value: 0x3b08, lo: 0x84, hi: 0x85}, {value: 0x0008, lo: 0x86, hi: 0x86}, {value: 0x3308, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa5}, {value: 0x0040, lo: 0xa6, hi: 0xa6}, {value: 0x0008, lo: 0xa7, hi: 0xa8}, {value: 0x0040, lo: 0xa9, hi: 0xa9}, {value: 0x0008, lo: 0xaa, hi: 0xbf}, // Block 0xd7, offset 0x6a4 {value: 0x0000, lo: 0x0d}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x3008, lo: 0x8a, hi: 0x8e}, {value: 0x0040, lo: 0x8f, hi: 0x8f}, {value: 0x3308, lo: 0x90, hi: 0x91}, {value: 0x0040, lo: 0x92, hi: 0x92}, {value: 0x3008, lo: 0x93, hi: 0x94}, {value: 0x3308, lo: 0x95, hi: 0x95}, {value: 0x3008, lo: 0x96, hi: 0x96}, {value: 0x3b08, lo: 0x97, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0x98}, {value: 0x0040, lo: 0x99, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa9}, {value: 0x0040, lo: 0xaa, hi: 0xbf}, // Block 0xd8, offset 0x6b2 {value: 0x0000, lo: 0x06}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb4}, {value: 0x3008, lo: 0xb5, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbf}, // Block 0xd9, offset 0x6b9 {value: 0x0000, lo: 0x03}, {value: 0x0040, lo: 0x80, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb0}, {value: 0x0040, lo: 0xb1, hi: 0xbf}, // Block 0xda, offset 0x6bd {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xb1}, {value: 0x0040, lo: 0xb2, hi: 0xbe}, {value: 0x0018, lo: 0xbf, hi: 0xbf}, // Block 0xdb, offset 0x6c1 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0xbf}, // Block 0xdc, offset 0x6c4 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0xdd, offset 0x6c9 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0xbf}, // Block 0xde, offset 0x6cc {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x0340, lo: 0xb0, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbf}, // Block 0xdf, offset 0x6d1 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0xbf}, // Block 0xe0, offset 0x6d4 {value: 0x0000, lo: 0x06}, {value: 0x0008, lo: 0x80, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa9}, {value: 0x0040, lo: 0xaa, hi: 0xad}, {value: 0x0018, lo: 0xae, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, // Block 0xe1, offset 0x6db {value: 0x0000, lo: 0x06}, {value: 0x0040, lo: 0x80, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb4}, {value: 0x0018, lo: 0xb5, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xbf}, // Block 0xe2, offset 0x6e2 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xbf}, // Block 0xe3, offset 0x6e6 {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x83}, {value: 0x0018, lo: 0x84, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0xa1}, {value: 0x0040, lo: 0xa2, hi: 0xa2}, {value: 0x0008, lo: 0xa3, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbf}, // Block 0xe4, offset 0x6f1 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0xbf}, // Block 0xe5, offset 0x6f4 {value: 0x0000, lo: 0x02}, {value: 0xe105, lo: 0x80, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0xe6, offset 0x6f7 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0x9a}, {value: 0x0040, lo: 0x9b, hi: 0xbf}, // Block 0xe7, offset 0x6fa {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8e}, {value: 0x3308, lo: 0x8f, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x90}, {value: 0x3008, lo: 0x91, hi: 0xbf}, // Block 0xe8, offset 0x700 {value: 0x0000, lo: 0x05}, {value: 0x3008, lo: 0x80, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8e}, {value: 0x3308, lo: 0x8f, hi: 0x92}, {value: 0x0008, lo: 0x93, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0xe9, offset 0x706 {value: 0x0000, lo: 0x08}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa1}, {value: 0x0018, lo: 0xa2, hi: 0xa2}, {value: 0x0008, lo: 0xa3, hi: 0xa3}, {value: 0x3308, lo: 0xa4, hi: 0xa4}, {value: 0x0040, lo: 0xa5, hi: 0xaf}, {value: 0x3008, lo: 0xb0, hi: 0xb1}, {value: 0x0040, lo: 0xb2, hi: 0xbf}, // Block 0xea, offset 0x70f {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbf}, // Block 0xeb, offset 0x712 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0xbf}, // Block 0xec, offset 0x715 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0xbf}, // Block 0xed, offset 0x718 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0xbf}, // Block 0xee, offset 0x71b {value: 0x0000, lo: 0x06}, {value: 0x0040, lo: 0x80, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x92}, {value: 0x0040, lo: 0x93, hi: 0xa3}, {value: 0x0008, lo: 0xa4, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0xef, offset 0x722 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0xf0, offset 0x725 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbf}, // Block 0xf1, offset 0x72a {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9b}, {value: 0x0018, lo: 0x9c, hi: 0x9c}, {value: 0x3308, lo: 0x9d, hi: 0x9e}, {value: 0x0018, lo: 0x9f, hi: 0x9f}, {value: 0x03c0, lo: 0xa0, hi: 0xa3}, {value: 0x0040, lo: 0xa4, hi: 0xbf}, // Block 0xf2, offset 0x734 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xbf}, // Block 0xf3, offset 0x737 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xa8}, {value: 0x0018, lo: 0xa9, hi: 0xbf}, // Block 0xf4, offset 0x73b {value: 0x0000, lo: 0x0e}, {value: 0x0018, lo: 0x80, hi: 0x9d}, {value: 0x2211, lo: 0x9e, hi: 0x9e}, {value: 0x2219, lo: 0x9f, hi: 0x9f}, {value: 0x2221, lo: 0xa0, hi: 0xa0}, {value: 0x2229, lo: 0xa1, hi: 0xa1}, {value: 0x2231, lo: 0xa2, hi: 0xa2}, {value: 0x2239, lo: 0xa3, hi: 0xa3}, {value: 0x2241, lo: 0xa4, hi: 0xa4}, {value: 0x3018, lo: 0xa5, hi: 0xa6}, {value: 0x3318, lo: 0xa7, hi: 0xa9}, {value: 0x0018, lo: 0xaa, hi: 0xac}, {value: 0x3018, lo: 0xad, hi: 0xb2}, {value: 0x0340, lo: 0xb3, hi: 0xba}, {value: 0x3318, lo: 0xbb, hi: 0xbf}, // Block 0xf5, offset 0x74a {value: 0x0000, lo: 0x0b}, {value: 0x3318, lo: 0x80, hi: 0x82}, {value: 0x0018, lo: 0x83, hi: 0x84}, {value: 0x3318, lo: 0x85, hi: 0x8b}, {value: 0x0018, lo: 0x8c, hi: 0xa9}, {value: 0x3318, lo: 0xaa, hi: 0xad}, {value: 0x0018, lo: 0xae, hi: 0xba}, {value: 0x2249, lo: 0xbb, hi: 0xbb}, {value: 0x2251, lo: 0xbc, hi: 0xbc}, {value: 0x2259, lo: 0xbd, hi: 0xbd}, {value: 0x2261, lo: 0xbe, hi: 0xbe}, {value: 0x2269, lo: 0xbf, hi: 0xbf}, // Block 0xf6, offset 0x756 {value: 0x0000, lo: 0x03}, {value: 0x2271, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0xa8}, {value: 0x0040, lo: 0xa9, hi: 0xbf}, // Block 0xf7, offset 0x75a {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x81}, {value: 0x3318, lo: 0x82, hi: 0x84}, {value: 0x0018, lo: 0x85, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0xbf}, // Block 0xf8, offset 0x75f {value: 0x0000, lo: 0x03}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xbf}, // Block 0xf9, offset 0x763 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbf}, // Block 0xfa, offset 0x768 {value: 0x0000, lo: 0x03}, {value: 0x3308, lo: 0x80, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xba}, {value: 0x3308, lo: 0xbb, hi: 0xbf}, // Block 0xfb, offset 0x76c {value: 0x0000, lo: 0x04}, {value: 0x3308, lo: 0x80, hi: 0xac}, {value: 0x0018, lo: 0xad, hi: 0xb4}, {value: 0x3308, lo: 0xb5, hi: 0xb5}, {value: 0x0018, lo: 0xb6, hi: 0xbf}, // Block 0xfc, offset 0x771 {value: 0x0000, lo: 0x08}, {value: 0x0018, lo: 0x80, hi: 0x83}, {value: 0x3308, lo: 0x84, hi: 0x84}, {value: 0x0018, lo: 0x85, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x9a}, {value: 0x3308, lo: 0x9b, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xa0}, {value: 0x3308, lo: 0xa1, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, // Block 0xfd, offset 0x77a {value: 0x0000, lo: 0x0a}, {value: 0x3308, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x87}, {value: 0x3308, lo: 0x88, hi: 0x98}, {value: 0x0040, lo: 0x99, hi: 0x9a}, {value: 0x3308, lo: 0x9b, hi: 0xa1}, {value: 0x0040, lo: 0xa2, hi: 0xa2}, {value: 0x3308, lo: 0xa3, hi: 0xa4}, {value: 0x0040, lo: 0xa5, hi: 0xa5}, {value: 0x3308, lo: 0xa6, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xbf}, // Block 0xfe, offset 0x785 {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb6}, {value: 0x0008, lo: 0xb7, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbf}, // Block 0xff, offset 0x78b {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0x8d}, {value: 0x0008, lo: 0x8e, hi: 0x8e}, {value: 0x0018, lo: 0x8f, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0xbf}, // Block 0x100, offset 0x791 {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0xab}, {value: 0x3308, lo: 0xac, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbe}, {value: 0x0018, lo: 0xbf, hi: 0xbf}, // Block 0x101, offset 0x797 {value: 0x0000, lo: 0x05}, {value: 0x0808, lo: 0x80, hi: 0x84}, {value: 0x0040, lo: 0x85, hi: 0x86}, {value: 0x0818, lo: 0x87, hi: 0x8f}, {value: 0x3308, lo: 0x90, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0xbf}, // Block 0x102, offset 0x79d {value: 0x0000, lo: 0x08}, {value: 0x0a08, lo: 0x80, hi: 0x83}, {value: 0x3308, lo: 0x84, hi: 0x8a}, {value: 0x0b08, lo: 0x8b, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8f}, {value: 0x0808, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9d}, {value: 0x0818, lo: 0x9e, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0x103, offset 0x7a6 {value: 0x0000, lo: 0x02}, {value: 0x0040, lo: 0x80, hi: 0xb0}, {value: 0x0818, lo: 0xb1, hi: 0xbf}, // Block 0x104, offset 0x7a9 {value: 0x0000, lo: 0x02}, {value: 0x0818, lo: 0x80, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0x105, offset 0x7ac {value: 0x0000, lo: 0x03}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0818, lo: 0x81, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbf}, // Block 0x106, offset 0x7b0 {value: 0x0000, lo: 0x03}, {value: 0x0040, lo: 0x80, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb1}, {value: 0x0040, lo: 0xb2, hi: 0xbf}, // Block 0x107, offset 0x7b4 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xbf}, // Block 0x108, offset 0x7b8 {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xb0}, {value: 0x0018, lo: 0xb1, hi: 0xbf}, // Block 0x109, offset 0x7be {value: 0x0000, lo: 0x05}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0x90}, {value: 0x0018, lo: 0x91, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xbf}, // Block 0x10a, offset 0x7c4 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x8f}, {value: 0x2491, lo: 0x90, hi: 0x90}, {value: 0x0018, lo: 0x91, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xbf}, // Block 0x10b, offset 0x7c9 {value: 0x0000, lo: 0x02}, {value: 0x0040, lo: 0x80, hi: 0xa5}, {value: 0x0018, lo: 0xa6, hi: 0xbf}, // Block 0x10c, offset 0x7cc {value: 0x0000, lo: 0x0f}, {value: 0x2611, lo: 0x80, hi: 0x80}, {value: 0x2619, lo: 0x81, hi: 0x81}, {value: 0x2621, lo: 0x82, hi: 0x82}, {value: 0x2629, lo: 0x83, hi: 0x83}, {value: 0x2631, lo: 0x84, hi: 0x84}, {value: 0x2639, lo: 0x85, hi: 0x85}, {value: 0x2641, lo: 0x86, hi: 0x86}, {value: 0x2649, lo: 0x87, hi: 0x87}, {value: 0x2651, lo: 0x88, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x8f}, {value: 0x2659, lo: 0x90, hi: 0x90}, {value: 0x2661, lo: 0x91, hi: 0x91}, {value: 0x0040, lo: 0x92, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa5}, {value: 0x0040, lo: 0xa6, hi: 0xbf}, // Block 0x10d, offset 0x7dc {value: 0x0000, lo: 0x06}, {value: 0x0018, lo: 0x80, hi: 0x97}, {value: 0x0040, lo: 0x98, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbf}, // Block 0x10e, offset 0x7e3 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xbf}, // Block 0x10f, offset 0x7e6 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x98}, {value: 0x0040, lo: 0x99, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xbf}, // Block 0x110, offset 0x7eb {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xbf}, // Block 0x111, offset 0x7ef {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xbf}, // Block 0x112, offset 0x7f5 {value: 0x0000, lo: 0x06}, {value: 0x0018, lo: 0x80, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb1}, {value: 0x0040, lo: 0xb2, hi: 0xbf}, // Block 0x113, offset 0x7fc {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xb9}, {value: 0x0018, lo: 0xba, hi: 0xbf}, // Block 0x114, offset 0x800 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0xbf}, // Block 0x115, offset 0x804 {value: 0x0000, lo: 0x08}, {value: 0x0018, lo: 0x80, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xb7}, {value: 0x0018, lo: 0xb8, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbf}, // Block 0x116, offset 0x80d {value: 0x0000, lo: 0x06}, {value: 0x0018, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xa8}, {value: 0x0040, lo: 0xa9, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0x117, offset 0x814 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x82}, {value: 0x0040, lo: 0x83, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0xbf}, // Block 0x118, offset 0x819 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0x92}, {value: 0x0040, lo: 0x93, hi: 0x93}, {value: 0x0018, lo: 0x94, hi: 0xbf}, // Block 0x119, offset 0x81d {value: 0x0000, lo: 0x0d}, {value: 0x0018, lo: 0x80, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0xaf}, {value: 0x06e1, lo: 0xb0, hi: 0xb0}, {value: 0x0049, lo: 0xb1, hi: 0xb1}, {value: 0x0029, lo: 0xb2, hi: 0xb2}, {value: 0x0031, lo: 0xb3, hi: 0xb3}, {value: 0x06e9, lo: 0xb4, hi: 0xb4}, {value: 0x06f1, lo: 0xb5, hi: 0xb5}, {value: 0x06f9, lo: 0xb6, hi: 0xb6}, {value: 0x0701, lo: 0xb7, hi: 0xb7}, {value: 0x0709, lo: 0xb8, hi: 0xb8}, {value: 0x0711, lo: 0xb9, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0x11a, offset 0x82b {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0xbf}, // Block 0x11b, offset 0x82e {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0x11c, offset 0x831 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x11d, offset 0x835 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xa1}, {value: 0x0040, lo: 0xa2, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x11e, offset 0x839 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xa0}, {value: 0x0040, lo: 0xa1, hi: 0xbf}, // Block 0x11f, offset 0x83c {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0xbf}, // Block 0x120, offset 0x83f {value: 0x0000, lo: 0x04}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0340, lo: 0x81, hi: 0x81}, {value: 0x0040, lo: 0x82, hi: 0x9f}, {value: 0x0340, lo: 0xa0, hi: 0xbf}, // Block 0x121, offset 0x844 {value: 0x0000, lo: 0x01}, {value: 0x0340, lo: 0x80, hi: 0xbf}, // Block 0x122, offset 0x846 {value: 0x0000, lo: 0x01}, {value: 0x33c0, lo: 0x80, hi: 0xbf}, // Block 0x123, offset 0x848 {value: 0x0000, lo: 0x02}, {value: 0x33c0, lo: 0x80, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, } // Total table size 44953 bytes (43KiB); checksum: D51909DD ================================================ FILE: vendor/golang.org/x/net/idna/tables15.0.0.go ================================================ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. //go:build go1.21 package idna // UnicodeVersion is the Unicode version from which the tables in this package are derived. const UnicodeVersion = "15.0.0" var mappings string = "" + // Size: 6704 bytes " ̈a ̄23 ́ ̧1o1⁄41⁄23⁄4i̇l·ʼnsdžⱥⱦhjrwy ̆ ̇ ̊ ̨ ̃ ̋lẍ́ ι; ̈́եւاٴوٴۇٴيٴक" + "़ख़ग़ज़ड़ढ़फ़य़ড়ঢ়য়ਲ਼ਸ਼ਖ਼ਗ਼ਜ਼ਫ਼ଡ଼ଢ଼ําໍາຫນຫມགྷཌྷདྷབྷཛྷཀྵཱཱིུྲྀྲཱྀླྀླཱ" + "ཱྀྀྒྷྜྷྡྷྦྷྫྷྐྵвдостъѣæbdeǝgikmnȣptuɐɑəɛɜŋɔɯvβγδφχρнɒcɕðfɟɡɥɨɩɪʝɭʟɱɰɲɳ" + "ɴɵɸʂʃƫʉʊʋʌzʐʑʒθssάέήίόύώἀιἁιἂιἃιἄιἅιἆιἇιἠιἡιἢιἣιἤιἥιἦιἧιὠιὡιὢιὣιὤιὥιὦιὧ" + "ιὰιαιάιᾶιι ̈͂ὴιηιήιῆι ̓̀ ̓́ ̓͂ΐ ̔̀ ̔́ ̔͂ΰ ̈̀`ὼιωιώιῶι′′′′′‵‵‵‵‵!!???!!?" + "′′′′0456789+=()rsħnoqsmtmωåאבגדπ1⁄71⁄91⁄101⁄32⁄31⁄52⁄53⁄54⁄51⁄65⁄61⁄83" + "⁄85⁄87⁄81⁄iiivviviiiixxi0⁄3∫∫∫∫∫∮∮∮∮∮1011121314151617181920(10)(11)(12" + ")(13)(14)(15)(16)(17)(18)(19)(20)∫∫∫∫==⫝̸ɫɽȿɀ. ゙ ゚よりコト(ᄀ)(ᄂ)(ᄃ)(ᄅ)(ᄆ)(ᄇ)" + "(ᄉ)(ᄋ)(ᄌ)(ᄎ)(ᄏ)(ᄐ)(ᄑ)(ᄒ)(가)(나)(다)(라)(마)(바)(사)(아)(자)(차)(카)(타)(파)(하)(주)(오전" + ")(오후)(一)(二)(三)(四)(五)(六)(七)(八)(九)(十)(月)(火)(水)(木)(金)(土)(日)(株)(有)(社)(名)(特)(" + "財)(祝)(労)(代)(呼)(学)(監)(企)(資)(協)(祭)(休)(自)(至)21222324252627282930313233343" + "5참고주의3637383940414243444546474849501月2月3月4月5月6月7月8月9月10月11月12月hgev令和アパート" + "アルファアンペアアールイニングインチウォンエスクードエーカーオンスオームカイリカラットカロリーガロンガンマギガギニーキュリーギルダーキロキロ" + "グラムキロメートルキロワットグラムグラムトンクルゼイロクローネケースコルナコーポサイクルサンチームシリングセンチセントダースデシドルトンナノ" + "ノットハイツパーセントパーツバーレルピアストルピクルピコビルファラッドフィートブッシェルフランヘクタールペソペニヒヘルツペンスページベータポ" + "イントボルトホンポンドホールホーンマイクロマイルマッハマルクマンションミクロンミリミリバールメガメガトンメートルヤードヤールユアンリットルリ" + "ラルピールーブルレムレントゲンワット0点1点2点3点4点5点6点7点8点9点10点11点12点13点14点15点16点17点18点19点20" + "点21点22点23点24点daauovpcdmiu平成昭和大正明治株式会社panamakakbmbgbkcalpfnfmgkghzmldlk" + "lfmnmmmcmkmm2m3m∕sm∕s2rad∕srad∕s2psnsmspvnvmvkvpwnwmwkwbqcccdc∕kgdbgyhah" + "pinkkktlmlnlxphprsrsvwbv∕ma∕m1日2日3日4日5日6日7日8日9日10日11日12日13日14日15日16日17日1" + "8日19日20日21日22日23日24日25日26日27日28日29日30日31日ьɦɬʞʇœʍ𤋮𢡊𢡄𣏕𥉉𥳐𧻓fffiflstմնմեմիվնմ" + "խיִײַעהכלםרתשׁשׂשּׁשּׂאַאָאּבּגּדּהּוּזּטּיּךּכּלּמּנּסּףּפּצּקּרּשּתּו" + "ֹבֿכֿפֿאלٱٻپڀٺٿٹڤڦڄڃچڇڍڌڎڈژڑکگڳڱںڻۀہھےۓڭۇۆۈۋۅۉېىئائەئوئۇئۆئۈئېئىیئجئحئم" + "ئيبجبحبخبمبىبيتجتحتختمتىتيثجثمثىثيجحجمحجحمخجخحخمسجسحسخسمصحصمضجضحضخضمطحط" + "مظمعجعمغجغمفجفحفخفمفىفيقحقمقىقيكاكجكحكخكلكمكىكيلجلحلخلملىليمجمحمخمممىمي" + "نجنحنخنمنىنيهجهمهىهييجيحيخيميىييذٰرٰىٰ ٌّ ٍّ َّ ُّ ِّ ّٰئرئزئنبربزبنترت" + "زتنثرثزثنمانرنزننيريزينئخئهبهتهصخلهنههٰيهثهسهشمشهـَّـُّـِّطىطيعىعيغىغيس" + "ىسيشىشيحىحيجىجيخىخيصىصيضىضيشجشحشخشرسرصرضراًتجمتحجتحمتخمتمجتمحتمخجمححميح" + "مىسحجسجحسجىسمحسمجسممصححصممشحمشجيشمخشممضحىضخمطمحطممطميعجمعممعمىغممغميغمى" + "فخمقمحقمملحملحيلحىلججلخملمحمحجمحممحيمجحمجممخجمخممجخهمجهممنحمنحىنجمنجىنم" + "ينمىيممبخيتجيتجىتخيتخىتميتمىجميجحىجمىسخىصحيشحيضحيلجيلمييحييجييميمميقمين" + "حيعميكمينجحمخيلجمكممجحيحجيمجيفميبحيسخينجيصلےقلےاللهاكبرمحمدصلعمرسولعليه" + "وسلمصلىصلى الله عليه وسلمجل جلالهریال,:!?_{}[]#&*-<>\\$%@ـًـَـُـِـّـْءآ" + "أؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهويلآلألإلا\x22'/^|~¢£¬¦¥ːˑʙɓʣꭦʥʤɖɗᶑɘɞʩɤɢ" + "ɠʛʜɧʄʪʫꞎɮʎøɶɷɺɾʀʨʦꭧʧʈⱱʏʡʢʘǀǁǂ𝅗𝅥𝅘𝅥𝅘𝅥𝅮𝅘𝅥𝅯𝅘𝅥𝅰𝅘𝅥𝅱𝅘𝅥𝅲𝆹𝅥𝆺𝅥𝆹𝅥𝅮𝆺𝅥𝅮𝆹𝅥𝅯𝆺𝅥𝅯ıȷαεζηκ" + "λμνξοστυψ∇∂ϝабгежзиклмпруфхцчшыэюꚉәіјөүӏґѕџҫꙑұٮڡٯ0,1,2,3,4,5,6,7,8,9,(a" + ")(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)(m)(n)(o)(p)(q)(r)(s)(t)(u)(v)(w)(x)(y" + ")(z)〔s〕wzhvsdppvwcmcmdmrdjほかココサ手字双デ二多解天交映無料前後再新初終生販声吹演投捕一三遊左中右指走打禁空合満有月申" + "割営配〔本〕〔三〕〔二〕〔安〕〔点〕〔打〕〔盗〕〔勝〕〔敗〕得可丽丸乁你侮侻倂偺備僧像㒞免兔兤具㒹內冗冤仌冬况凵刃㓟刻剆剷㔕勇勉勤勺包匆北卉" + "卑博即卽卿灰及叟叫叱吆咞吸呈周咢哶唐啓啣善喙喫喳嗂圖嘆圗噑噴切壮城埴堍型堲報墬売壷夆夢奢姬娛娧姘婦㛮嬈嬾寃寘寧寳寿将尢㞁屠屮峀岍嵃嵮嵫嵼巡巢" + "㠯巽帨帽幩㡢㡼庰庳庶廊廾舁弢㣇形彫㣣徚忍志忹悁㤺㤜悔惇慈慌慎慺憎憲憤憯懞懲懶成戛扝抱拔捐挽拼捨掃揤搢揅掩㨮摩摾撝摷㩬敏敬旣書晉㬙暑㬈㫤冒冕最" + "暜肭䏙朗望朡杞杓㭉柺枅桒梅梎栟椔㮝楂榣槪檨櫛㰘次歔㱎歲殟殺殻汎沿泍汧洖派海流浩浸涅洴港湮㴳滋滇淹潮濆瀹瀞瀛㶖灊災灷炭煅熜爨爵牐犀犕獺王㺬玥㺸" + "瑇瑜瑱璅瓊㼛甤甾異瘐㿼䀈直眞真睊䀹瞋䁆䂖硎碌磌䃣祖福秫䄯穀穊穏䈂篆築䈧糒䊠糨糣紀絣䌁緇縂繅䌴䍙罺羕翺者聠聰䏕育脃䐋脾媵舄辞䑫芑芋芝劳花芳芽苦" + "若茝荣莭茣莽菧著荓菊菌菜䔫蓱蓳蔖蕤䕝䕡䕫虐虜虧虩蚩蚈蜎蛢蝹蜨蝫螆蟡蠁䗹衠衣裗裞䘵裺㒻䚾䛇誠諭變豕貫賁贛起跋趼跰軔輸邔郱鄑鄛鈸鋗鋘鉼鏹鐕開䦕閷" + "䧦雃嶲霣䩮䩶韠䪲頋頩飢䬳餩馧駂駾䯎鬒鱀鳽䳎䳭鵧䳸麻䵖黹黾鼅鼏鼖鼻" var mappingIndex = []uint16{ // 1729 elements // Entry 0 - 3F 0x0000, 0x0000, 0x0001, 0x0004, 0x0005, 0x0008, 0x0009, 0x000a, 0x000d, 0x0010, 0x0011, 0x0012, 0x0017, 0x001c, 0x0021, 0x0024, 0x0027, 0x002a, 0x002b, 0x002e, 0x0031, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003c, 0x003f, 0x0042, 0x0045, 0x0048, 0x004b, 0x004c, 0x004d, 0x0051, 0x0054, 0x0055, 0x005a, 0x005e, 0x0062, 0x0066, 0x006a, 0x006e, 0x0074, 0x007a, 0x0080, 0x0086, 0x008c, 0x0092, 0x0098, 0x009e, 0x00a4, 0x00aa, 0x00b0, 0x00b6, 0x00bc, 0x00c2, 0x00c8, 0x00ce, 0x00d4, 0x00da, 0x00e0, 0x00e6, // Entry 40 - 7F 0x00ec, 0x00f2, 0x00f8, 0x00fe, 0x0104, 0x010a, 0x0110, 0x0116, 0x011c, 0x0122, 0x0128, 0x012e, 0x0137, 0x013d, 0x0146, 0x014c, 0x0152, 0x0158, 0x015e, 0x0164, 0x016a, 0x0170, 0x0172, 0x0174, 0x0176, 0x0178, 0x017a, 0x017c, 0x017e, 0x0180, 0x0181, 0x0182, 0x0183, 0x0185, 0x0186, 0x0187, 0x0188, 0x0189, 0x018a, 0x018c, 0x018d, 0x018e, 0x018f, 0x0191, 0x0193, 0x0195, 0x0197, 0x0199, 0x019b, 0x019d, 0x019f, 0x01a0, 0x01a2, 0x01a4, 0x01a6, 0x01a8, 0x01aa, 0x01ac, 0x01ae, 0x01b0, 0x01b1, 0x01b3, 0x01b5, 0x01b6, // Entry 80 - BF 0x01b8, 0x01ba, 0x01bc, 0x01be, 0x01c0, 0x01c2, 0x01c4, 0x01c6, 0x01c8, 0x01ca, 0x01cc, 0x01ce, 0x01d0, 0x01d2, 0x01d4, 0x01d6, 0x01d8, 0x01da, 0x01dc, 0x01de, 0x01e0, 0x01e2, 0x01e4, 0x01e5, 0x01e7, 0x01e9, 0x01eb, 0x01ed, 0x01ef, 0x01f1, 0x01f3, 0x01f5, 0x01f7, 0x01f9, 0x01fb, 0x01fd, 0x0202, 0x0207, 0x020c, 0x0211, 0x0216, 0x021b, 0x0220, 0x0225, 0x022a, 0x022f, 0x0234, 0x0239, 0x023e, 0x0243, 0x0248, 0x024d, 0x0252, 0x0257, 0x025c, 0x0261, 0x0266, 0x026b, 0x0270, 0x0275, 0x027a, 0x027e, 0x0282, 0x0287, // Entry C0 - FF 0x0289, 0x028e, 0x0293, 0x0297, 0x029b, 0x02a0, 0x02a5, 0x02aa, 0x02af, 0x02b1, 0x02b6, 0x02bb, 0x02c0, 0x02c2, 0x02c7, 0x02c8, 0x02cd, 0x02d1, 0x02d5, 0x02da, 0x02e0, 0x02e9, 0x02ef, 0x02f8, 0x02fa, 0x02fc, 0x02fe, 0x0300, 0x030c, 0x030d, 0x030e, 0x030f, 0x0310, 0x0311, 0x0312, 0x0313, 0x0314, 0x0315, 0x0316, 0x0317, 0x0319, 0x031b, 0x031d, 0x031e, 0x0320, 0x0322, 0x0324, 0x0326, 0x0328, 0x032a, 0x032c, 0x032e, 0x0330, 0x0335, 0x033a, 0x0340, 0x0345, 0x034a, 0x034f, 0x0354, 0x0359, 0x035e, 0x0363, 0x0368, // Entry 100 - 13F 0x036d, 0x0372, 0x0377, 0x037c, 0x0380, 0x0382, 0x0384, 0x0386, 0x038a, 0x038c, 0x038e, 0x0393, 0x0399, 0x03a2, 0x03a8, 0x03b1, 0x03b3, 0x03b5, 0x03b7, 0x03b9, 0x03bb, 0x03bd, 0x03bf, 0x03c1, 0x03c3, 0x03c5, 0x03c7, 0x03cb, 0x03cf, 0x03d3, 0x03d7, 0x03db, 0x03df, 0x03e3, 0x03e7, 0x03eb, 0x03ef, 0x03f3, 0x03ff, 0x0401, 0x0406, 0x0408, 0x040a, 0x040c, 0x040e, 0x040f, 0x0413, 0x0417, 0x041d, 0x0423, 0x0428, 0x042d, 0x0432, 0x0437, 0x043c, 0x0441, 0x0446, 0x044b, 0x0450, 0x0455, 0x045a, 0x045f, 0x0464, 0x0469, // Entry 140 - 17F 0x046e, 0x0473, 0x0478, 0x047d, 0x0482, 0x0487, 0x048c, 0x0491, 0x0496, 0x049b, 0x04a0, 0x04a5, 0x04aa, 0x04af, 0x04b4, 0x04bc, 0x04c4, 0x04c9, 0x04ce, 0x04d3, 0x04d8, 0x04dd, 0x04e2, 0x04e7, 0x04ec, 0x04f1, 0x04f6, 0x04fb, 0x0500, 0x0505, 0x050a, 0x050f, 0x0514, 0x0519, 0x051e, 0x0523, 0x0528, 0x052d, 0x0532, 0x0537, 0x053c, 0x0541, 0x0546, 0x054b, 0x0550, 0x0555, 0x055a, 0x055f, 0x0564, 0x0569, 0x056e, 0x0573, 0x0578, 0x057a, 0x057c, 0x057e, 0x0580, 0x0582, 0x0584, 0x0586, 0x0588, 0x058a, 0x058c, 0x058e, // Entry 180 - 1BF 0x0590, 0x0592, 0x0594, 0x0596, 0x059c, 0x05a2, 0x05a4, 0x05a6, 0x05a8, 0x05aa, 0x05ac, 0x05ae, 0x05b0, 0x05b2, 0x05b4, 0x05b6, 0x05b8, 0x05ba, 0x05bc, 0x05be, 0x05c0, 0x05c4, 0x05c8, 0x05cc, 0x05d0, 0x05d4, 0x05d8, 0x05dc, 0x05e0, 0x05e4, 0x05e9, 0x05ee, 0x05f3, 0x05f5, 0x05f7, 0x05fd, 0x0609, 0x0615, 0x0621, 0x062a, 0x0636, 0x063f, 0x0648, 0x0657, 0x0663, 0x066c, 0x0675, 0x067e, 0x068a, 0x0696, 0x069f, 0x06a8, 0x06ae, 0x06b7, 0x06c3, 0x06cf, 0x06d5, 0x06e4, 0x06f6, 0x0705, 0x070e, 0x071d, 0x072c, 0x0738, // Entry 1C0 - 1FF 0x0741, 0x074a, 0x0753, 0x075f, 0x076e, 0x077a, 0x0783, 0x078c, 0x0795, 0x079b, 0x07a1, 0x07a7, 0x07ad, 0x07b6, 0x07bf, 0x07ce, 0x07d7, 0x07e3, 0x07f2, 0x07fb, 0x0801, 0x0807, 0x0816, 0x0822, 0x0831, 0x083a, 0x0849, 0x084f, 0x0858, 0x0861, 0x086a, 0x0873, 0x087c, 0x0888, 0x0891, 0x0897, 0x08a0, 0x08a9, 0x08b2, 0x08be, 0x08c7, 0x08d0, 0x08d9, 0x08e8, 0x08f4, 0x08fa, 0x0909, 0x090f, 0x091b, 0x0927, 0x0930, 0x0939, 0x0942, 0x094e, 0x0954, 0x095d, 0x0969, 0x096f, 0x097e, 0x0987, 0x098b, 0x098f, 0x0993, 0x0997, // Entry 200 - 23F 0x099b, 0x099f, 0x09a3, 0x09a7, 0x09ab, 0x09af, 0x09b4, 0x09b9, 0x09be, 0x09c3, 0x09c8, 0x09cd, 0x09d2, 0x09d7, 0x09dc, 0x09e1, 0x09e6, 0x09eb, 0x09f0, 0x09f5, 0x09fa, 0x09fc, 0x09fe, 0x0a00, 0x0a02, 0x0a04, 0x0a06, 0x0a0c, 0x0a12, 0x0a18, 0x0a1e, 0x0a2a, 0x0a2c, 0x0a2e, 0x0a30, 0x0a32, 0x0a34, 0x0a36, 0x0a38, 0x0a3c, 0x0a3e, 0x0a40, 0x0a42, 0x0a44, 0x0a46, 0x0a48, 0x0a4a, 0x0a4c, 0x0a4e, 0x0a50, 0x0a52, 0x0a54, 0x0a56, 0x0a58, 0x0a5a, 0x0a5f, 0x0a65, 0x0a6c, 0x0a74, 0x0a76, 0x0a78, 0x0a7a, 0x0a7c, 0x0a7e, // Entry 240 - 27F 0x0a80, 0x0a82, 0x0a84, 0x0a86, 0x0a88, 0x0a8a, 0x0a8c, 0x0a8e, 0x0a90, 0x0a96, 0x0a98, 0x0a9a, 0x0a9c, 0x0a9e, 0x0aa0, 0x0aa2, 0x0aa4, 0x0aa6, 0x0aa8, 0x0aaa, 0x0aac, 0x0aae, 0x0ab0, 0x0ab2, 0x0ab4, 0x0ab9, 0x0abe, 0x0ac2, 0x0ac6, 0x0aca, 0x0ace, 0x0ad2, 0x0ad6, 0x0ada, 0x0ade, 0x0ae2, 0x0ae7, 0x0aec, 0x0af1, 0x0af6, 0x0afb, 0x0b00, 0x0b05, 0x0b0a, 0x0b0f, 0x0b14, 0x0b19, 0x0b1e, 0x0b23, 0x0b28, 0x0b2d, 0x0b32, 0x0b37, 0x0b3c, 0x0b41, 0x0b46, 0x0b4b, 0x0b50, 0x0b52, 0x0b54, 0x0b56, 0x0b58, 0x0b5a, 0x0b5c, // Entry 280 - 2BF 0x0b5e, 0x0b62, 0x0b66, 0x0b6a, 0x0b6e, 0x0b72, 0x0b76, 0x0b7a, 0x0b7c, 0x0b7e, 0x0b80, 0x0b82, 0x0b86, 0x0b8a, 0x0b8e, 0x0b92, 0x0b96, 0x0b9a, 0x0b9e, 0x0ba0, 0x0ba2, 0x0ba4, 0x0ba6, 0x0ba8, 0x0baa, 0x0bac, 0x0bb0, 0x0bb4, 0x0bba, 0x0bc0, 0x0bc4, 0x0bc8, 0x0bcc, 0x0bd0, 0x0bd4, 0x0bd8, 0x0bdc, 0x0be0, 0x0be4, 0x0be8, 0x0bec, 0x0bf0, 0x0bf4, 0x0bf8, 0x0bfc, 0x0c00, 0x0c04, 0x0c08, 0x0c0c, 0x0c10, 0x0c14, 0x0c18, 0x0c1c, 0x0c20, 0x0c24, 0x0c28, 0x0c2c, 0x0c30, 0x0c34, 0x0c36, 0x0c38, 0x0c3a, 0x0c3c, 0x0c3e, // Entry 2C0 - 2FF 0x0c40, 0x0c42, 0x0c44, 0x0c46, 0x0c48, 0x0c4a, 0x0c4c, 0x0c4e, 0x0c50, 0x0c52, 0x0c54, 0x0c56, 0x0c58, 0x0c5a, 0x0c5c, 0x0c5e, 0x0c60, 0x0c62, 0x0c64, 0x0c66, 0x0c68, 0x0c6a, 0x0c6c, 0x0c6e, 0x0c70, 0x0c72, 0x0c74, 0x0c76, 0x0c78, 0x0c7a, 0x0c7c, 0x0c7e, 0x0c80, 0x0c82, 0x0c86, 0x0c8a, 0x0c8e, 0x0c92, 0x0c96, 0x0c9a, 0x0c9e, 0x0ca2, 0x0ca4, 0x0ca8, 0x0cac, 0x0cb0, 0x0cb4, 0x0cb8, 0x0cbc, 0x0cc0, 0x0cc4, 0x0cc8, 0x0ccc, 0x0cd0, 0x0cd4, 0x0cd8, 0x0cdc, 0x0ce0, 0x0ce4, 0x0ce8, 0x0cec, 0x0cf0, 0x0cf4, 0x0cf8, // Entry 300 - 33F 0x0cfc, 0x0d00, 0x0d04, 0x0d08, 0x0d0c, 0x0d10, 0x0d14, 0x0d18, 0x0d1c, 0x0d20, 0x0d24, 0x0d28, 0x0d2c, 0x0d30, 0x0d34, 0x0d38, 0x0d3c, 0x0d40, 0x0d44, 0x0d48, 0x0d4c, 0x0d50, 0x0d54, 0x0d58, 0x0d5c, 0x0d60, 0x0d64, 0x0d68, 0x0d6c, 0x0d70, 0x0d74, 0x0d78, 0x0d7c, 0x0d80, 0x0d84, 0x0d88, 0x0d8c, 0x0d90, 0x0d94, 0x0d98, 0x0d9c, 0x0da0, 0x0da4, 0x0da8, 0x0dac, 0x0db0, 0x0db4, 0x0db8, 0x0dbc, 0x0dc0, 0x0dc4, 0x0dc8, 0x0dcc, 0x0dd0, 0x0dd4, 0x0dd8, 0x0ddc, 0x0de0, 0x0de4, 0x0de8, 0x0dec, 0x0df0, 0x0df4, 0x0df8, // Entry 340 - 37F 0x0dfc, 0x0e00, 0x0e04, 0x0e08, 0x0e0c, 0x0e10, 0x0e14, 0x0e18, 0x0e1d, 0x0e22, 0x0e27, 0x0e2c, 0x0e31, 0x0e36, 0x0e3a, 0x0e3e, 0x0e42, 0x0e46, 0x0e4a, 0x0e4e, 0x0e52, 0x0e56, 0x0e5a, 0x0e5e, 0x0e62, 0x0e66, 0x0e6a, 0x0e6e, 0x0e72, 0x0e76, 0x0e7a, 0x0e7e, 0x0e82, 0x0e86, 0x0e8a, 0x0e8e, 0x0e92, 0x0e96, 0x0e9a, 0x0e9e, 0x0ea2, 0x0ea6, 0x0eaa, 0x0eae, 0x0eb2, 0x0eb6, 0x0ebc, 0x0ec2, 0x0ec8, 0x0ecc, 0x0ed0, 0x0ed4, 0x0ed8, 0x0edc, 0x0ee0, 0x0ee4, 0x0ee8, 0x0eec, 0x0ef0, 0x0ef4, 0x0ef8, 0x0efc, 0x0f00, 0x0f04, // Entry 380 - 3BF 0x0f08, 0x0f0c, 0x0f10, 0x0f14, 0x0f18, 0x0f1c, 0x0f20, 0x0f24, 0x0f28, 0x0f2c, 0x0f30, 0x0f34, 0x0f38, 0x0f3e, 0x0f44, 0x0f4a, 0x0f50, 0x0f56, 0x0f5c, 0x0f62, 0x0f68, 0x0f6e, 0x0f74, 0x0f7a, 0x0f80, 0x0f86, 0x0f8c, 0x0f92, 0x0f98, 0x0f9e, 0x0fa4, 0x0faa, 0x0fb0, 0x0fb6, 0x0fbc, 0x0fc2, 0x0fc8, 0x0fce, 0x0fd4, 0x0fda, 0x0fe0, 0x0fe6, 0x0fec, 0x0ff2, 0x0ff8, 0x0ffe, 0x1004, 0x100a, 0x1010, 0x1016, 0x101c, 0x1022, 0x1028, 0x102e, 0x1034, 0x103a, 0x1040, 0x1046, 0x104c, 0x1052, 0x1058, 0x105e, 0x1064, 0x106a, // Entry 3C0 - 3FF 0x1070, 0x1076, 0x107c, 0x1082, 0x1088, 0x108e, 0x1094, 0x109a, 0x10a0, 0x10a6, 0x10ac, 0x10b2, 0x10b8, 0x10be, 0x10c4, 0x10ca, 0x10d0, 0x10d6, 0x10dc, 0x10e2, 0x10e8, 0x10ee, 0x10f4, 0x10fa, 0x1100, 0x1106, 0x110c, 0x1112, 0x1118, 0x111e, 0x1124, 0x112a, 0x1130, 0x1136, 0x113c, 0x1142, 0x1148, 0x114e, 0x1154, 0x115a, 0x1160, 0x1166, 0x116c, 0x1172, 0x1178, 0x1180, 0x1188, 0x1190, 0x1198, 0x11a0, 0x11a8, 0x11b0, 0x11b6, 0x11d7, 0x11e6, 0x11ee, 0x11ef, 0x11f0, 0x11f1, 0x11f2, 0x11f3, 0x11f4, 0x11f5, 0x11f6, // Entry 400 - 43F 0x11f7, 0x11f8, 0x11f9, 0x11fa, 0x11fb, 0x11fc, 0x11fd, 0x11fe, 0x11ff, 0x1200, 0x1201, 0x1205, 0x1209, 0x120d, 0x1211, 0x1215, 0x1219, 0x121b, 0x121d, 0x121f, 0x1221, 0x1223, 0x1225, 0x1227, 0x1229, 0x122b, 0x122d, 0x122f, 0x1231, 0x1233, 0x1235, 0x1237, 0x1239, 0x123b, 0x123d, 0x123f, 0x1241, 0x1243, 0x1245, 0x1247, 0x1249, 0x124b, 0x124d, 0x124f, 0x1251, 0x1253, 0x1255, 0x1257, 0x1259, 0x125b, 0x125d, 0x125f, 0x1263, 0x1267, 0x126b, 0x126f, 0x1270, 0x1271, 0x1272, 0x1273, 0x1274, 0x1275, 0x1277, 0x1279, // Entry 440 - 47F 0x127b, 0x127d, 0x127f, 0x1281, 0x1283, 0x1285, 0x1287, 0x1289, 0x128c, 0x128e, 0x1290, 0x1292, 0x1294, 0x1297, 0x1299, 0x129b, 0x129d, 0x129f, 0x12a1, 0x12a3, 0x12a5, 0x12a7, 0x12a9, 0x12ab, 0x12ad, 0x12af, 0x12b2, 0x12b4, 0x12b6, 0x12b8, 0x12ba, 0x12bc, 0x12be, 0x12c0, 0x12c2, 0x12c4, 0x12c6, 0x12c9, 0x12cb, 0x12cd, 0x12d0, 0x12d2, 0x12d4, 0x12d6, 0x12d8, 0x12da, 0x12dc, 0x12de, 0x12e6, 0x12ee, 0x12fa, 0x1306, 0x1312, 0x131e, 0x132a, 0x1332, 0x133a, 0x1346, 0x1352, 0x135e, 0x136a, 0x136c, 0x136e, 0x1370, // Entry 480 - 4BF 0x1372, 0x1374, 0x1376, 0x1378, 0x137a, 0x137c, 0x137e, 0x1380, 0x1382, 0x1384, 0x1386, 0x1388, 0x138a, 0x138d, 0x1390, 0x1392, 0x1394, 0x1396, 0x1398, 0x139a, 0x139c, 0x139e, 0x13a0, 0x13a2, 0x13a4, 0x13a6, 0x13a8, 0x13aa, 0x13ac, 0x13ae, 0x13b0, 0x13b2, 0x13b4, 0x13b6, 0x13b8, 0x13ba, 0x13bc, 0x13bf, 0x13c1, 0x13c3, 0x13c5, 0x13c7, 0x13c9, 0x13cb, 0x13cd, 0x13cf, 0x13d1, 0x13d3, 0x13d6, 0x13d8, 0x13da, 0x13dc, 0x13de, 0x13e0, 0x13e2, 0x13e4, 0x13e6, 0x13e8, 0x13ea, 0x13ec, 0x13ee, 0x13f0, 0x13f2, 0x13f5, // Entry 4C0 - 4FF 0x13f8, 0x13fb, 0x13fe, 0x1401, 0x1404, 0x1407, 0x140a, 0x140d, 0x1410, 0x1413, 0x1416, 0x1419, 0x141c, 0x141f, 0x1422, 0x1425, 0x1428, 0x142b, 0x142e, 0x1431, 0x1434, 0x1437, 0x143a, 0x143d, 0x1440, 0x1447, 0x1449, 0x144b, 0x144d, 0x1450, 0x1452, 0x1454, 0x1456, 0x1458, 0x145a, 0x1460, 0x1466, 0x1469, 0x146c, 0x146f, 0x1472, 0x1475, 0x1478, 0x147b, 0x147e, 0x1481, 0x1484, 0x1487, 0x148a, 0x148d, 0x1490, 0x1493, 0x1496, 0x1499, 0x149c, 0x149f, 0x14a2, 0x14a5, 0x14a8, 0x14ab, 0x14ae, 0x14b1, 0x14b4, 0x14b7, // Entry 500 - 53F 0x14ba, 0x14bd, 0x14c0, 0x14c3, 0x14c6, 0x14c9, 0x14cc, 0x14cf, 0x14d2, 0x14d5, 0x14d8, 0x14db, 0x14de, 0x14e1, 0x14e4, 0x14e7, 0x14ea, 0x14ed, 0x14f6, 0x14ff, 0x1508, 0x1511, 0x151a, 0x1523, 0x152c, 0x1535, 0x153e, 0x1541, 0x1544, 0x1547, 0x154a, 0x154d, 0x1550, 0x1553, 0x1556, 0x1559, 0x155c, 0x155f, 0x1562, 0x1565, 0x1568, 0x156b, 0x156e, 0x1571, 0x1574, 0x1577, 0x157a, 0x157d, 0x1580, 0x1583, 0x1586, 0x1589, 0x158c, 0x158f, 0x1592, 0x1595, 0x1598, 0x159b, 0x159e, 0x15a1, 0x15a4, 0x15a7, 0x15aa, 0x15ad, // Entry 540 - 57F 0x15b0, 0x15b3, 0x15b6, 0x15b9, 0x15bc, 0x15bf, 0x15c2, 0x15c5, 0x15c8, 0x15cb, 0x15ce, 0x15d1, 0x15d4, 0x15d7, 0x15da, 0x15dd, 0x15e0, 0x15e3, 0x15e6, 0x15e9, 0x15ec, 0x15ef, 0x15f2, 0x15f5, 0x15f8, 0x15fb, 0x15fe, 0x1601, 0x1604, 0x1607, 0x160a, 0x160d, 0x1610, 0x1613, 0x1616, 0x1619, 0x161c, 0x161f, 0x1622, 0x1625, 0x1628, 0x162b, 0x162e, 0x1631, 0x1634, 0x1637, 0x163a, 0x163d, 0x1640, 0x1643, 0x1646, 0x1649, 0x164c, 0x164f, 0x1652, 0x1655, 0x1658, 0x165b, 0x165e, 0x1661, 0x1664, 0x1667, 0x166a, 0x166d, // Entry 580 - 5BF 0x1670, 0x1673, 0x1676, 0x1679, 0x167c, 0x167f, 0x1682, 0x1685, 0x1688, 0x168b, 0x168e, 0x1691, 0x1694, 0x1697, 0x169a, 0x169d, 0x16a0, 0x16a3, 0x16a6, 0x16a9, 0x16ac, 0x16af, 0x16b2, 0x16b5, 0x16b8, 0x16bb, 0x16be, 0x16c1, 0x16c4, 0x16c7, 0x16ca, 0x16cd, 0x16d0, 0x16d3, 0x16d6, 0x16d9, 0x16dc, 0x16df, 0x16e2, 0x16e5, 0x16e8, 0x16eb, 0x16ee, 0x16f1, 0x16f4, 0x16f7, 0x16fa, 0x16fd, 0x1700, 0x1703, 0x1706, 0x1709, 0x170c, 0x170f, 0x1712, 0x1715, 0x1718, 0x171b, 0x171e, 0x1721, 0x1724, 0x1727, 0x172a, 0x172d, // Entry 5C0 - 5FF 0x1730, 0x1733, 0x1736, 0x1739, 0x173c, 0x173f, 0x1742, 0x1745, 0x1748, 0x174b, 0x174e, 0x1751, 0x1754, 0x1757, 0x175a, 0x175d, 0x1760, 0x1763, 0x1766, 0x1769, 0x176c, 0x176f, 0x1772, 0x1775, 0x1778, 0x177b, 0x177e, 0x1781, 0x1784, 0x1787, 0x178a, 0x178d, 0x1790, 0x1793, 0x1796, 0x1799, 0x179c, 0x179f, 0x17a2, 0x17a5, 0x17a8, 0x17ab, 0x17ae, 0x17b1, 0x17b4, 0x17b7, 0x17ba, 0x17bd, 0x17c0, 0x17c3, 0x17c6, 0x17c9, 0x17cc, 0x17cf, 0x17d2, 0x17d5, 0x17d8, 0x17db, 0x17de, 0x17e1, 0x17e4, 0x17e7, 0x17ea, 0x17ed, // Entry 600 - 63F 0x17f0, 0x17f3, 0x17f6, 0x17f9, 0x17fc, 0x17ff, 0x1802, 0x1805, 0x1808, 0x180b, 0x180e, 0x1811, 0x1814, 0x1817, 0x181a, 0x181d, 0x1820, 0x1823, 0x1826, 0x1829, 0x182c, 0x182f, 0x1832, 0x1835, 0x1838, 0x183b, 0x183e, 0x1841, 0x1844, 0x1847, 0x184a, 0x184d, 0x1850, 0x1853, 0x1856, 0x1859, 0x185c, 0x185f, 0x1862, 0x1865, 0x1868, 0x186b, 0x186e, 0x1871, 0x1874, 0x1877, 0x187a, 0x187d, 0x1880, 0x1883, 0x1886, 0x1889, 0x188c, 0x188f, 0x1892, 0x1895, 0x1898, 0x189b, 0x189e, 0x18a1, 0x18a4, 0x18a7, 0x18aa, 0x18ad, // Entry 640 - 67F 0x18b0, 0x18b3, 0x18b6, 0x18b9, 0x18bc, 0x18bf, 0x18c2, 0x18c5, 0x18c8, 0x18cb, 0x18ce, 0x18d1, 0x18d4, 0x18d7, 0x18da, 0x18dd, 0x18e0, 0x18e3, 0x18e6, 0x18e9, 0x18ec, 0x18ef, 0x18f2, 0x18f5, 0x18f8, 0x18fb, 0x18fe, 0x1901, 0x1904, 0x1907, 0x190a, 0x190d, 0x1910, 0x1913, 0x1916, 0x1919, 0x191c, 0x191f, 0x1922, 0x1925, 0x1928, 0x192b, 0x192e, 0x1931, 0x1934, 0x1937, 0x193a, 0x193d, 0x1940, 0x1943, 0x1946, 0x1949, 0x194c, 0x194f, 0x1952, 0x1955, 0x1958, 0x195b, 0x195e, 0x1961, 0x1964, 0x1967, 0x196a, 0x196d, // Entry 680 - 6BF 0x1970, 0x1973, 0x1976, 0x1979, 0x197c, 0x197f, 0x1982, 0x1985, 0x1988, 0x198b, 0x198e, 0x1991, 0x1994, 0x1997, 0x199a, 0x199d, 0x19a0, 0x19a3, 0x19a6, 0x19a9, 0x19ac, 0x19af, 0x19b2, 0x19b5, 0x19b8, 0x19bb, 0x19be, 0x19c1, 0x19c4, 0x19c7, 0x19ca, 0x19cd, 0x19d0, 0x19d3, 0x19d6, 0x19d9, 0x19dc, 0x19df, 0x19e2, 0x19e5, 0x19e8, 0x19eb, 0x19ee, 0x19f1, 0x19f4, 0x19f7, 0x19fa, 0x19fd, 0x1a00, 0x1a03, 0x1a06, 0x1a09, 0x1a0c, 0x1a0f, 0x1a12, 0x1a15, 0x1a18, 0x1a1b, 0x1a1e, 0x1a21, 0x1a24, 0x1a27, 0x1a2a, 0x1a2d, // Entry 6C0 - 6FF 0x1a30, } // Size: 3482 bytes var xorData string = "" + // Size: 4907 bytes "\x02\x0c\x09\x02\xb0\xec\x02\xad\xd8\x02\xad\xd9\x02\x06\x07\x02\x0f\x12" + "\x02\x0f\x1f\x02\x0f\x1d\x02\x01\x13\x02\x0f\x16\x02\x0f\x0b\x02\x0f3" + "\x02\x0f7\x02\x0f?\x02\x0f/\x02\x0f*\x02\x0c&\x02\x0c*\x02\x0c;\x02\x0c9" + "\x02\x0c%\x02\xab\xed\x02\xab\xe2\x02\xab\xe3\x02\xa9\xe0\x02\xa9\xe1" + "\x02\xa9\xe6\x02\xa3\xcb\x02\xa3\xc8\x02\xa3\xc9\x02\x01#\x02\x01\x08" + "\x02\x0e>\x02\x0e'\x02\x0f\x03\x02\x03\x0d\x02\x03\x09\x02\x03\x17\x02" + "\x03\x0e\x02\x02\x03\x02\x011\x02\x01\x00\x02\x01\x10\x02\x03<\x02\x07" + "\x0d\x02\x02\x0c\x02\x0c0\x02\x01\x03\x02\x01\x01\x02\x01 \x02\x01\x22" + "\x02\x01)\x02\x01\x0a\x02\x01\x0c\x02\x02\x06\x02\x02\x02\x02\x03\x10" + "\x03\x037 \x03\x0b+\x03\x021\x00\x02\x01\x04\x02\x01\x02\x02\x019\x02" + "\x03\x1c\x02\x02$\x03\x80p$\x02\x03:\x02\x03\x0a\x03\xc1r.\x03\xc1r,\x03" + "\xc1r\x02\x02\x02:\x02\x02>\x02\x02,\x02\x02\x10\x02\x02\x00\x03\xc1s<" + "\x03\xc1s*\x03\xc2L$\x03\xc2L;\x02\x09)\x02\x0a\x19\x03\x83\xab\xe3\x03" + "\x83\xab\xf2\x03 4\xe0\x03\x81\xab\xea\x03\x81\xab\xf3\x03 4\xef\x03\x96" + "\xe1\xcd\x03\x84\xe5\xc3\x02\x0d\x11\x03\x8b\xec\xcb\x03\x94\xec\xcf\x03" + "\x9a\xec\xc2\x03\x8b\xec\xdb\x03\x94\xec\xdf\x03\x9a\xec\xd2\x03\x01\x0c" + "!\x03\x01\x0c#\x03ʠ\x9d\x03ʣ\x9c\x03ʢ\x9f\x03ʥ\x9e\x03ʤ\x91\x03ʧ\x90\x03" + "ʦ\x93\x03ʩ\x92\x03ʨ\x95\x03\xca\xf3\xb5\x03\xca\xf0\xb4\x03\xca\xf1\xb7" + "\x03\xca\xf6\xb6\x03\xca\xf7\x89\x03\xca\xf4\x88\x03\xca\xf5\x8b\x03\xca" + "\xfa\x8a\x03\xca\xfb\x8d\x03\xca\xf8\x8c\x03\xca\xf9\x8f\x03\xca\xfe\x8e" + "\x03\xca\xff\x81\x03\xca\xfc\x80\x03\xca\xfd\x83\x03\xca\xe2\x82\x03\xca" + "\xe3\x85\x03\xca\xe0\x84\x03\xca\xe1\x87\x03\xca\xe6\x86\x03\xca\xe7\x99" + "\x03\xca\xe4\x98\x03\xca\xe5\x9b\x03\xca\xea\x9a\x03\xca\xeb\x9d\x03\xca" + "\xe8\x9c\x03ؓ\x89\x03ߔ\x8b\x02\x010\x03\x03\x04\x1e\x03\x04\x15\x12\x03" + "\x0b\x05,\x03\x06\x04\x00\x03\x06\x04)\x03\x06\x044\x03\x06\x04<\x03\x06" + "\x05\x1d\x03\x06\x06\x00\x03\x06\x06\x0a\x03\x06\x06'\x03\x06\x062\x03" + "\x0786\x03\x079/\x03\x079 \x03\x07:\x0e\x03\x07:\x1b\x03\x07:%\x03\x07;/" + "\x03\x07;%\x03\x074\x11\x03\x076\x09\x03\x077*\x03\x070\x01\x03\x070\x0f" + "\x03\x070.\x03\x071\x16\x03\x071\x04\x03\x0710\x03\x072\x18\x03\x072-" + "\x03\x073\x14\x03\x073>\x03\x07'\x09\x03\x07 \x00\x03\x07\x1f\x0b\x03" + "\x07\x18#\x03\x07\x18(\x03\x07\x186\x03\x07\x18\x03\x03\x07\x19\x16\x03" + "\x07\x116\x03\x07\x12'\x03\x07\x13\x10\x03\x07\x0c&\x03\x07\x0c\x08\x03" + "\x07\x0c\x13\x03\x07\x0d\x02\x03\x07\x0d\x1c\x03\x07\x0b5\x03\x07\x0b" + "\x0a\x03\x07\x0b\x01\x03\x07\x0b\x0f\x03\x07\x05\x00\x03\x07\x05\x09\x03" + "\x07\x05\x0b\x03\x07\x07\x01\x03\x07\x07\x08\x03\x07\x00<\x03\x07\x00+" + "\x03\x07\x01)\x03\x07\x01\x1b\x03\x07\x01\x08\x03\x07\x03?\x03\x0445\x03" + "\x044\x08\x03\x0454\x03\x04)/\x03\x04)5\x03\x04+\x05\x03\x04+\x14\x03" + "\x04+ \x03\x04+<\x03\x04*&\x03\x04*\x22\x03\x04&8\x03\x04!\x01\x03\x04!" + "\x22\x03\x04\x11+\x03\x04\x10.\x03\x04\x104\x03\x04\x13=\x03\x04\x12\x04" + "\x03\x04\x12\x0a\x03\x04\x0d\x1d\x03\x04\x0d\x07\x03\x04\x0d \x03\x05<>" + "\x03\x055<\x03\x055!\x03\x055#\x03\x055&\x03\x054\x1d\x03\x054\x02\x03" + "\x054\x07\x03\x0571\x03\x053\x1a\x03\x053\x16\x03\x05.<\x03\x05.\x07\x03" + "\x05):\x03\x05)<\x03\x05)\x0c\x03\x05)\x15\x03\x05+-\x03\x05+5\x03\x05$" + "\x1e\x03\x05$\x14\x03\x05'\x04\x03\x05'\x14\x03\x05&\x02\x03\x05\x226" + "\x03\x05\x22\x0c\x03\x05\x22\x1c\x03\x05\x19\x0a\x03\x05\x1b\x09\x03\x05" + "\x1b\x0c\x03\x05\x14\x07\x03\x05\x16?\x03\x05\x16\x0c\x03\x05\x0c\x05" + "\x03\x05\x0e\x0f\x03\x05\x01\x0e\x03\x05\x00(\x03\x05\x030\x03\x05\x03" + "\x06\x03\x0a==\x03\x0a=1\x03\x0a=,\x03\x0a=\x0c\x03\x0a??\x03\x0a<\x08" + "\x03\x0a9!\x03\x0a9)\x03\x0a97\x03\x0a99\x03\x0a6\x0a\x03\x0a6\x1c\x03" + "\x0a6\x17\x03\x0a7'\x03\x0a78\x03\x0a73\x03\x0a'\x01\x03\x0a'&\x03\x0a" + "\x1f\x0e\x03\x0a\x1f\x03\x03\x0a\x1f3\x03\x0a\x1b/\x03\x0a\x18\x19\x03" + "\x0a\x19\x01\x03\x0a\x16\x14\x03\x0a\x0e\x22\x03\x0a\x0f\x10\x03\x0a\x0f" + "\x02\x03\x0a\x0f \x03\x0a\x0c\x04\x03\x0a\x0b>\x03\x0a\x0b+\x03\x0a\x08/" + "\x03\x0a\x046\x03\x0a\x05\x14\x03\x0a\x00\x04\x03\x0a\x00\x10\x03\x0a" + "\x00\x14\x03\x0b<3\x03\x0b;*\x03\x0b9\x22\x03\x0b9)\x03\x0b97\x03\x0b+" + "\x10\x03\x0b((\x03\x0b&5\x03\x0b$\x1c\x03\x0b$\x12\x03\x0b%\x04\x03\x0b#" + "<\x03\x0b#0\x03\x0b#\x0d\x03\x0b#\x19\x03\x0b!:\x03\x0b!\x1f\x03\x0b!" + "\x00\x03\x0b\x1e5\x03\x0b\x1c\x1d\x03\x0b\x1d-\x03\x0b\x1d(\x03\x0b\x18." + "\x03\x0b\x18 \x03\x0b\x18\x16\x03\x0b\x14\x13\x03\x0b\x15$\x03\x0b\x15" + "\x22\x03\x0b\x12\x1b\x03\x0b\x12\x10\x03\x0b\x132\x03\x0b\x13=\x03\x0b" + "\x12\x18\x03\x0b\x0c&\x03\x0b\x061\x03\x0b\x06:\x03\x0b\x05#\x03\x0b\x05" + "<\x03\x0b\x04\x0b\x03\x0b\x04\x04\x03\x0b\x04\x1b\x03\x0b\x042\x03\x0b" + "\x041\x03\x0b\x03\x03\x03\x0b\x03\x1d\x03\x0b\x03/\x03\x0b\x03+\x03\x0b" + "\x02\x1b\x03\x0b\x02\x00\x03\x0b\x01\x1e\x03\x0b\x01\x08\x03\x0b\x015" + "\x03\x06\x0d9\x03\x06\x0d=\x03\x06\x0d?\x03\x02\x001\x03\x02\x003\x03" + "\x02\x02\x19\x03\x02\x006\x03\x02\x02\x1b\x03\x02\x004\x03\x02\x00<\x03" + "\x02\x02\x0a\x03\x02\x02\x0e\x03\x02\x01\x1a\x03\x02\x01\x07\x03\x02\x01" + "\x05\x03\x02\x01\x0b\x03\x02\x01%\x03\x02\x01\x0c\x03\x02\x01\x04\x03" + "\x02\x01\x1c\x03\x02\x00.\x03\x02\x002\x03\x02\x00>\x03\x02\x00\x12\x03" + "\x02\x00\x16\x03\x02\x011\x03\x02\x013\x03\x02\x02 \x03\x02\x02%\x03\x02" + "\x02$\x03\x02\x028\x03\x02\x02;\x03\x02\x024\x03\x02\x012\x03\x02\x022" + "\x03\x02\x02/\x03\x02\x01,\x03\x02\x01\x13\x03\x02\x01\x16\x03\x02\x01" + "\x11\x03\x02\x01\x1e\x03\x02\x01\x15\x03\x02\x01\x17\x03\x02\x01\x0f\x03" + "\x02\x01\x08\x03\x02\x00?\x03\x02\x03\x07\x03\x02\x03\x0d\x03\x02\x03" + "\x13\x03\x02\x03\x1d\x03\x02\x03\x1f\x03\x02\x00\x03\x03\x02\x00\x0d\x03" + "\x02\x00\x01\x03\x02\x00\x1b\x03\x02\x00\x19\x03\x02\x00\x18\x03\x02\x00" + "\x13\x03\x02\x00/\x03\x07>\x12\x03\x07<\x1f\x03\x07>\x1d\x03\x06\x1d\x0e" + "\x03\x07>\x1c\x03\x07>:\x03\x07>\x13\x03\x04\x12+\x03\x07?\x03\x03\x07>" + "\x02\x03\x06\x224\x03\x06\x1a.\x03\x07<%\x03\x06\x1c\x0b\x03\x0609\x03" + "\x05\x1f\x01\x03\x04'\x08\x03\x93\xfd\xf5\x03\x02\x0d \x03\x02\x0d#\x03" + "\x02\x0d!\x03\x02\x0d&\x03\x02\x0d\x22\x03\x02\x0d/\x03\x02\x0d,\x03\x02" + "\x0d$\x03\x02\x0d'\x03\x02\x0d%\x03\x02\x0d;\x03\x02\x0d=\x03\x02\x0d?" + "\x03\x099.\x03\x08\x0b7\x03\x08\x02\x14\x03\x08\x14\x0d\x03\x08.:\x03" + "\x089'\x03\x0f\x0b\x18\x03\x0f\x1c1\x03\x0f\x17&\x03\x0f9\x1f\x03\x0f0" + "\x0c\x03\x0e\x0a9\x03\x0e\x056\x03\x0e\x1c#\x03\x0f\x13\x0e\x03\x072\x00" + "\x03\x070\x0d\x03\x072\x0b\x03\x06\x11\x18\x03\x070\x10\x03\x06\x0f(\x03" + "\x072\x05\x03\x06\x0f,\x03\x073\x15\x03\x06\x07\x08\x03\x05\x16\x02\x03" + "\x04\x0b \x03\x05:8\x03\x05\x16%\x03\x0a\x0d\x1f\x03\x06\x16\x10\x03\x05" + "\x1d5\x03\x05*;\x03\x05\x16\x1b\x03\x04.-\x03\x06\x1a\x19\x03\x04\x03," + "\x03\x0b87\x03\x04/\x0a\x03\x06\x00,\x03\x04-\x01\x03\x04\x1e-\x03\x06/(" + "\x03\x0a\x0b5\x03\x06\x0e7\x03\x06\x07.\x03\x0597\x03\x0a*%\x03\x0760" + "\x03\x06\x0c;\x03\x05'\x00\x03\x072.\x03\x072\x08\x03\x06=\x01\x03\x06" + "\x05\x1b\x03\x06\x06\x12\x03\x06$=\x03\x06'\x0d\x03\x04\x11\x0f\x03\x076" + ",\x03\x06\x07;\x03\x06.,\x03\x86\xf9\xea\x03\x8f\xff\xeb\x02\x092\x02" + "\x095\x02\x094\x02\x09;\x02\x09>\x02\x098\x02\x09*\x02\x09/\x02\x09,\x02" + "\x09%\x02\x09&\x02\x09#\x02\x09 \x02\x08!\x02\x08%\x02\x08$\x02\x08+\x02" + "\x08.\x02\x08*\x02\x08&\x02\x088\x02\x08>\x02\x084\x02\x086\x02\x080\x02" + "\x08\x10\x02\x08\x17\x02\x08\x12\x02\x08\x1d\x02\x08\x1f\x02\x08\x13\x02" + "\x08\x15\x02\x08\x14\x02\x08\x0c\x03\x8b\xfd\xd0\x03\x81\xec\xc6\x03\x87" + "\xe0\x8a\x03-2\xe3\x03\x80\xef\xe4\x03-2\xea\x03\x88\xe6\xeb\x03\x8e\xe6" + "\xe8\x03\x84\xe6\xe9\x03\x97\xe6\xee\x03-2\xf9\x03-2\xf6\x03\x8e\xe3\xad" + "\x03\x80\xe3\x92\x03\x88\xe3\x90\x03\x8e\xe3\x90\x03\x80\xe3\x97\x03\x88" + "\xe3\x95\x03\x88\xfe\xcb\x03\x8e\xfe\xca\x03\x84\xfe\xcd\x03\x91\xef\xc9" + "\x03-2\xc1\x03-2\xc0\x03-2\xcb\x03\x88@\x09\x03\x8e@\x08\x03\x8f\xe0\xf5" + "\x03\x8e\xe6\xf9\x03\x8e\xe0\xfa\x03\x93\xff\xf4\x03\x84\xee\xd3\x03\x0b" + "(\x04\x023 \x03\x0b)\x08\x021;\x02\x01*\x03\x0b#\x10\x03\x0b 0\x03\x0b!" + "\x10\x03\x0b!0\x03\x07\x15\x08\x03\x09?5\x03\x07\x1f\x08\x03\x07\x17\x0b" + "\x03\x09\x1f\x15\x03\x0b\x1c7\x03\x0a+#\x03\x06\x1a\x1b\x03\x06\x1a\x14" + "\x03\x0a\x01\x18\x03\x06#\x1b\x03\x0a2\x0c\x03\x0a\x01\x04\x03\x09#;\x03" + "\x08='\x03\x08\x1a\x0a\x03\x07\x03\x0a\x111\x03\x09\x1b\x09\x03\x073.\x03\x07" + "\x01\x00\x03\x09/,\x03\x07#>\x03\x07\x048\x03\x0a\x1f\x22\x03\x098>\x03" + "\x09\x11\x00\x03\x08/\x17\x03\x06'\x22\x03\x0b\x1a+\x03\x0a\x22\x19\x03" + "\x0a/1\x03\x0974\x03\x09\x0f\x22\x03\x08,\x22\x03\x08?\x14\x03\x07$5\x03" + "\x07<3\x03\x07=*\x03\x07\x13\x18\x03\x068\x0a\x03\x06\x09\x16\x03\x06" + "\x13\x00\x03\x08\x067\x03\x08\x01\x03\x03\x08\x12\x1d\x03\x07+7\x03\x06(" + ";\x03\x06\x1c?\x03\x07\x0e\x17\x03\x0a\x06\x1d\x03\x0a\x19\x07\x03\x08" + "\x14$\x03\x07$;\x03\x08,$\x03\x08\x06\x0d\x03\x07\x16\x0a\x03\x06>>\x03" + "\x0a\x06\x12\x03\x0a\x14)\x03\x09\x0d\x1f\x03\x09\x12\x17\x03\x09\x19" + "\x01\x03\x08\x11 \x03\x08\x1d'\x03\x06<\x1a\x03\x0a.\x00\x03\x07'\x18" + "\x03\x0a\x22\x08\x03\x08\x0d\x0a\x03\x08\x13)\x03\x07*)\x03\x06<,\x03" + "\x07\x0b\x1a\x03\x09.\x14\x03\x09\x0d\x1e\x03\x07\x0e#\x03\x0b\x1d'\x03" + "\x0a\x0a8\x03\x09%2\x03\x08+&\x03\x080\x12\x03\x0a)4\x03\x08\x06\x1f\x03" + "\x0b\x1b\x1a\x03\x0a\x1b\x0f\x03\x0b\x1d*\x03\x09\x16$\x03\x090\x11\x03" + "\x08\x11\x08\x03\x0a*(\x03\x0a\x042\x03\x089,\x03\x074'\x03\x07\x0f\x05" + "\x03\x09\x0b\x0a\x03\x07\x1b\x01\x03\x09\x17:\x03\x09.\x0d\x03\x07.\x11" + "\x03\x09+\x15\x03\x080\x13\x03\x0b\x1f\x19\x03\x0a \x11\x03\x0a\x220\x03" + "\x09\x07;\x03\x08\x16\x1c\x03\x07,\x13\x03\x07\x0e/\x03\x06\x221\x03\x0a" + ".\x0a\x03\x0a7\x02\x03\x0a\x032\x03\x0a\x1d.\x03\x091\x06\x03\x09\x19:" + "\x03\x08\x02/\x03\x060+\x03\x06\x0f-\x03\x06\x1c\x1f\x03\x06\x1d\x07\x03" + "\x0a,\x11\x03\x09=\x0d\x03\x09\x0b;\x03\x07\x1b/\x03\x0a\x1f:\x03\x09 " + "\x1f\x03\x09.\x10\x03\x094\x0b\x03\x09\x1a1\x03\x08#\x1a\x03\x084\x1d" + "\x03\x08\x01\x1f\x03\x08\x11\x22\x03\x07'8\x03\x07\x1a>\x03\x0757\x03" + "\x06&9\x03\x06+\x11\x03\x0a.\x0b\x03\x0a,>\x03\x0a4#\x03\x08%\x17\x03" + "\x07\x05\x22\x03\x07\x0c\x0b\x03\x0a\x1d+\x03\x0a\x19\x16\x03\x09+\x1f" + "\x03\x09\x08\x0b\x03\x08\x16\x18\x03\x08+\x12\x03\x0b\x1d\x0c\x03\x0a=" + "\x10\x03\x0a\x09\x0d\x03\x0a\x10\x11\x03\x09&0\x03\x08(\x1f\x03\x087\x07" + "\x03\x08\x185\x03\x07'6\x03\x06.\x05\x03\x06=\x04\x03\x06;;\x03\x06\x06," + "\x03\x0b\x18>\x03\x08\x00\x18\x03\x06 \x03\x03\x06<\x00\x03\x09%\x18\x03" + "\x0b\x1c<\x03\x0a%!\x03\x0a\x09\x12\x03\x0a\x16\x02\x03\x090'\x03\x09" + "\x0e=\x03\x08 \x0e\x03\x08>\x03\x03\x074>\x03\x06&?\x03\x06\x19\x09\x03" + "\x06?(\x03\x0a-\x0e\x03\x09:3\x03\x098:\x03\x09\x12\x0b\x03\x09\x1d\x17" + "\x03\x087\x05\x03\x082\x14\x03\x08\x06%\x03\x08\x13\x1f\x03\x06\x06\x0e" + "\x03\x0a\x22<\x03\x09/<\x03\x06>+\x03\x0a'?\x03\x0a\x13\x0c\x03\x09\x10<" + "\x03\x07\x1b=\x03\x0a\x19\x13\x03\x09\x22\x1d\x03\x09\x07\x0d\x03\x08)" + "\x1c\x03\x06=\x1a\x03\x0a/4\x03\x0a7\x11\x03\x0a\x16:\x03\x09?3\x03\x09:" + "/\x03\x09\x05\x0a\x03\x09\x14\x06\x03\x087\x22\x03\x080\x07\x03\x08\x1a" + "\x1f\x03\x07\x04(\x03\x07\x04\x09\x03\x06 %\x03\x06<\x08\x03\x0a+\x14" + "\x03\x09\x1d\x16\x03\x0a70\x03\x08 >\x03\x0857\x03\x070\x0a\x03\x06=\x12" + "\x03\x06\x16%\x03\x06\x1d,\x03\x099#\x03\x09\x10>\x03\x07 \x1e\x03\x08" + "\x0c<\x03\x08\x0b\x18\x03\x08\x15+\x03\x08,:\x03\x08%\x22\x03\x07\x0a$" + "\x03\x0b\x1c=\x03\x07+\x08\x03\x0a/\x05\x03\x0a \x07\x03\x0a\x12'\x03" + "\x09#\x11\x03\x08\x1b\x15\x03\x0a\x06\x01\x03\x09\x1c\x1b\x03\x0922\x03" + "\x07\x14<\x03\x07\x09\x04\x03\x061\x04\x03\x07\x0e\x01\x03\x0a\x13\x18" + "\x03\x0a-\x0c\x03\x0a?\x0d\x03\x0a\x09\x0a\x03\x091&\x03\x0a/\x0b\x03" + "\x08$<\x03\x083\x1d\x03\x08\x0c$\x03\x08\x0d\x07\x03\x08\x0d?\x03\x08" + "\x0e\x14\x03\x065\x0a\x03\x08\x1a#\x03\x08\x16#\x03\x0702\x03\x07\x03" + "\x1a\x03\x06(\x1d\x03\x06+\x1b\x03\x06\x0b\x05\x03\x06\x0b\x17\x03\x06" + "\x0c\x04\x03\x06\x1e\x19\x03\x06+0\x03\x062\x18\x03\x0b\x16\x1e\x03\x0a+" + "\x16\x03\x0a-?\x03\x0a#:\x03\x0a#\x10\x03\x0a%$\x03\x0a>+\x03\x0a01\x03" + "\x0a1\x10\x03\x0a\x099\x03\x0a\x0a\x12\x03\x0a\x19\x1f\x03\x0a\x19\x12" + "\x03\x09*)\x03\x09-\x16\x03\x09.1\x03\x09.2\x03\x09<\x0e\x03\x09> \x03" + "\x093\x12\x03\x09\x0b\x01\x03\x09\x1c2\x03\x09\x11\x1c\x03\x09\x15%\x03" + "\x08,&\x03\x08!\x22\x03\x089(\x03\x08\x0b\x1a\x03\x08\x0d2\x03\x08\x0c" + "\x04\x03\x08\x0c\x06\x03\x08\x0c\x1f\x03\x08\x0c\x0c\x03\x08\x0f\x1f\x03" + "\x08\x0f\x1d\x03\x08\x00\x14\x03\x08\x03\x14\x03\x08\x06\x16\x03\x08\x1e" + "#\x03\x08\x11\x11\x03\x08\x10\x18\x03\x08\x14(\x03\x07)\x1e\x03\x07.1" + "\x03\x07 $\x03\x07 '\x03\x078\x08\x03\x07\x0d0\x03\x07\x0f7\x03\x07\x05#" + "\x03\x07\x05\x1a\x03\x07\x1a7\x03\x07\x1d-\x03\x07\x17\x10\x03\x06)\x1f" + "\x03\x062\x0b\x03\x066\x16\x03\x06\x09\x11\x03\x09(\x1e\x03\x07!5\x03" + "\x0b\x11\x16\x03\x0a/\x04\x03\x0a,\x1a\x03\x0b\x173\x03\x0a,1\x03\x0a/5" + "\x03\x0a\x221\x03\x0a\x22\x0d\x03\x0a?%\x03\x0a<,\x03\x0a?#\x03\x0a>\x19" + "\x03\x0a\x08&\x03\x0a\x0b\x0e\x03\x0a\x0c:\x03\x0a\x0c+\x03\x0a\x03\x22" + "\x03\x0a\x06)\x03\x0a\x11\x10\x03\x0a\x11\x1a\x03\x0a\x17-\x03\x0a\x14(" + "\x03\x09)\x1e\x03\x09/\x09\x03\x09.\x00\x03\x09,\x07\x03\x09/*\x03\x09-9" + "\x03\x09\x228\x03\x09%\x09\x03\x09:\x12\x03\x09;\x1d\x03\x09?\x06\x03" + "\x093%\x03\x096\x05\x03\x096\x08\x03\x097\x02\x03\x09\x07,\x03\x09\x04," + "\x03\x09\x1f\x16\x03\x09\x11\x03\x03\x09\x11\x12\x03\x09\x168\x03\x08*" + "\x05\x03\x08/2\x03\x084:\x03\x08\x22+\x03\x08 0\x03\x08&\x0a\x03\x08;" + "\x10\x03\x08>$\x03\x08>\x18\x03\x0829\x03\x082:\x03\x081,\x03\x081<\x03" + "\x081\x1c\x03\x087#\x03\x087*\x03\x08\x09'\x03\x08\x00\x1d\x03\x08\x05-" + "\x03\x08\x1f4\x03\x08\x1d\x04\x03\x08\x16\x0f\x03\x07*7\x03\x07'!\x03" + "\x07%\x1b\x03\x077\x0c\x03\x07\x0c1\x03\x07\x0c.\x03\x07\x00\x06\x03\x07" + "\x01\x02\x03\x07\x010\x03\x07\x06=\x03\x07\x01\x03\x03\x07\x01\x13\x03" + "\x07\x06\x06\x03\x07\x05\x0a\x03\x07\x1f\x09\x03\x07\x17:\x03\x06*1\x03" + "\x06-\x1d\x03\x06\x223\x03\x062:\x03\x060$\x03\x066\x1e\x03\x064\x12\x03" + "\x0645\x03\x06\x0b\x00\x03\x06\x0b7\x03\x06\x07\x1f\x03\x06\x15\x12\x03" + "\x0c\x05\x0f\x03\x0b+\x0b\x03\x0b+-\x03\x06\x16\x1b\x03\x06\x15\x17\x03" + "\x89\xca\xea\x03\x89\xca\xe8\x03\x0c8\x10\x03\x0c8\x01\x03\x0c8\x0f\x03" + "\x0d8%\x03\x0d8!\x03\x0c8-\x03\x0c8/\x03\x0c8+\x03\x0c87\x03\x0c85\x03" + "\x0c9\x09\x03\x0c9\x0d\x03\x0c9\x0f\x03\x0c9\x0b\x03\xcfu\x0c\x03\xcfu" + "\x0f\x03\xcfu\x0e\x03\xcfu\x09\x03\x0c9\x10\x03\x0d9\x0c\x03\xcf`;\x03" + "\xcf`>\x03\xcf`9\x03\xcf`8\x03\xcf`7\x03\xcf`*\x03\xcf`-\x03\xcf`,\x03" + "\x0d\x1b\x1a\x03\x0d\x1b&\x03\x0c=.\x03\x0c=%\x03\x0c>\x1e\x03\x0c>\x14" + "\x03\x0c?\x06\x03\x0c?\x0b\x03\x0c?\x0c\x03\x0c?\x0d\x03\x0c?\x02\x03" + "\x0c>\x0f\x03\x0c>\x08\x03\x0c>\x09\x03\x0c>,\x03\x0c>\x0c\x03\x0c?\x13" + "\x03\x0c?\x16\x03\x0c?\x15\x03\x0c?\x1c\x03\x0c?\x1f\x03\x0c?\x1d\x03" + "\x0c?\x1a\x03\x0c?\x17\x03\x0c?\x08\x03\x0c?\x09\x03\x0c?\x0e\x03\x0c?" + "\x04\x03\x0c?\x05\x03\x0c" + "\x03\x0c=2\x03\x0c=6\x03\x0c<\x07\x03\x0c<\x05\x03\x0e:!\x03\x0e:#\x03" + "\x0e8\x09\x03\x0e:&\x03\x0e8\x0b\x03\x0e:$\x03\x0e:,\x03\x0e8\x1a\x03" + "\x0e8\x1e\x03\x0e:*\x03\x0e:7\x03\x0e:5\x03\x0e:;\x03\x0e:\x15\x03\x0e:<" + "\x03\x0e:4\x03\x0e:'\x03\x0e:-\x03\x0e:%\x03\x0e:?\x03\x0e:=\x03\x0e:)" + "\x03\x0e:/\x03\xcfs'\x03\x0d=\x0f\x03\x0d+*\x03\x0d99\x03\x0d9;\x03\x0d9" + "?\x03\x0d)\x0d\x03\x0d(%\x02\x01\x18\x02\x01(\x02\x03'\x02\x03)\x02\x03+" + "\x02\x03/\x02\x03\x19\x02\x03\x1b\x02\x03\x1f\x03\x0d\x22\x18\x03\x0d" + "\x22\x1a\x03\x0d\x22'\x03\x0d\x22/\x03\x0d\x223\x03\x0d\x22$\x02\x01\x1e" + "\x03\x0f$!\x03\x0f87\x03\x0f4\x0e\x03\x0f5\x1d\x03\x06'\x03\x03\x0f\x08" + "\x18\x03\x0f\x0d\x1b\x03\x0e2=\x03\x0e;\x08\x03\x0e:\x0b\x03\x0e\x06$" + "\x03\x0e\x0d)\x03\x0e\x16\x1f\x03\x0e\x16\x1b\x03\x0d$\x0a\x03\x05,\x1d" + "\x03\x0d. \x03\x0d.#\x03\x0c(/\x03\x09%\x02\x03\x0d90\x03\x0d\x0e4\x03" + "\x0d\x0d\x0f\x03\x0c#\x00\x03\x0c,\x1e\x03\x0c2\x0e\x03\x0c\x01\x17\x03" + "\x0c\x09:\x03\x0e\x173\x03\x0c\x08\x03\x03\x0c\x11\x07\x03\x0c\x10\x18" + "\x03\x0c\x1f\x1c\x03\x0c\x19\x0e\x03\x0c\x1a\x1f\x03\x0f0>\x03\x0b->\x03" + "\x0b<+\x03\x0b8\x13\x03\x0b\x043\x03\x0b\x14\x03\x03\x0b\x16%\x03\x0d" + "\x22&\x03\x0b\x1a\x1a\x03\x0b\x1a\x04\x03\x0a%9\x03\x0a&2\x03\x0a&0\x03" + "\x0a!\x1a\x03\x0a!7\x03\x0a5\x10\x03\x0a=4\x03\x0a?\x0e\x03\x0a>\x10\x03" + "\x0a\x00 \x03\x0a\x0f:\x03\x0a\x0f9\x03\x0a\x0b\x0a\x03\x0a\x17%\x03\x0a" + "\x1b-\x03\x09-\x1a\x03\x09,4\x03\x09.,\x03\x09)\x09\x03\x096!\x03\x091" + "\x1f\x03\x093\x16\x03\x0c+\x1f\x03\x098 \x03\x098=\x03\x0c(\x1a\x03\x0c(" + "\x16\x03\x09\x0a+\x03\x09\x16\x12\x03\x09\x13\x0e\x03\x09\x153\x03\x08)!" + "\x03\x09\x1a\x01\x03\x09\x18\x01\x03\x08%#\x03\x08>\x22\x03\x08\x05%\x03" + "\x08\x02*\x03\x08\x15;\x03\x08\x1b7\x03\x0f\x07\x1d\x03\x0f\x04\x03\x03" + "\x070\x0c\x03\x07;\x0b\x03\x07\x08\x17\x03\x07\x12\x06\x03\x06/-\x03\x06" + "71\x03\x065+\x03\x06>7\x03\x06\x049\x03\x05+\x1e\x03\x05,\x17\x03\x05 " + "\x1d\x03\x05\x22\x05\x03\x050\x1d" // lookup returns the trie value for the first UTF-8 encoding in s and // the width in bytes of this encoding. The size will be 0 if s does not // hold enough bytes to complete the encoding. len(s) must be greater than 0. func (t *idnaTrie) lookup(s []byte) (v uint16, sz int) { c0 := s[0] switch { case c0 < 0x80: // is ASCII return idnaValues[c0], 1 case c0 < 0xC2: return 0, 1 // Illegal UTF-8: not a starter, not ASCII. case c0 < 0xE0: // 2-byte UTF-8 if len(s) < 2 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c1), 2 case c0 < 0xF0: // 3-byte UTF-8 if len(s) < 3 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = idnaIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c2), 3 case c0 < 0xF8: // 4-byte UTF-8 if len(s) < 4 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = idnaIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } o = uint32(i)<<6 + uint32(c2) i = idnaIndex[o] c3 := s[3] if c3 < 0x80 || 0xC0 <= c3 { return 0, 3 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c3), 4 } // Illegal rune return 0, 1 } // lookupUnsafe returns the trie value for the first UTF-8 encoding in s. // s must start with a full and valid UTF-8 encoded rune. func (t *idnaTrie) lookupUnsafe(s []byte) uint16 { c0 := s[0] if c0 < 0x80 { // is ASCII return idnaValues[c0] } i := idnaIndex[c0] if c0 < 0xE0 { // 2-byte UTF-8 return t.lookupValue(uint32(i), s[1]) } i = idnaIndex[uint32(i)<<6+uint32(s[1])] if c0 < 0xF0 { // 3-byte UTF-8 return t.lookupValue(uint32(i), s[2]) } i = idnaIndex[uint32(i)<<6+uint32(s[2])] if c0 < 0xF8 { // 4-byte UTF-8 return t.lookupValue(uint32(i), s[3]) } return 0 } // lookupString returns the trie value for the first UTF-8 encoding in s and // the width in bytes of this encoding. The size will be 0 if s does not // hold enough bytes to complete the encoding. len(s) must be greater than 0. func (t *idnaTrie) lookupString(s string) (v uint16, sz int) { c0 := s[0] switch { case c0 < 0x80: // is ASCII return idnaValues[c0], 1 case c0 < 0xC2: return 0, 1 // Illegal UTF-8: not a starter, not ASCII. case c0 < 0xE0: // 2-byte UTF-8 if len(s) < 2 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c1), 2 case c0 < 0xF0: // 3-byte UTF-8 if len(s) < 3 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = idnaIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c2), 3 case c0 < 0xF8: // 4-byte UTF-8 if len(s) < 4 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = idnaIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } o = uint32(i)<<6 + uint32(c2) i = idnaIndex[o] c3 := s[3] if c3 < 0x80 || 0xC0 <= c3 { return 0, 3 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c3), 4 } // Illegal rune return 0, 1 } // lookupStringUnsafe returns the trie value for the first UTF-8 encoding in s. // s must start with a full and valid UTF-8 encoded rune. func (t *idnaTrie) lookupStringUnsafe(s string) uint16 { c0 := s[0] if c0 < 0x80 { // is ASCII return idnaValues[c0] } i := idnaIndex[c0] if c0 < 0xE0 { // 2-byte UTF-8 return t.lookupValue(uint32(i), s[1]) } i = idnaIndex[uint32(i)<<6+uint32(s[1])] if c0 < 0xF0 { // 3-byte UTF-8 return t.lookupValue(uint32(i), s[2]) } i = idnaIndex[uint32(i)<<6+uint32(s[2])] if c0 < 0xF8 { // 4-byte UTF-8 return t.lookupValue(uint32(i), s[3]) } return 0 } // idnaTrie. Total size: 31598 bytes (30.86 KiB). Checksum: d3118eda0d6b5360. type idnaTrie struct{} func newIdnaTrie(i int) *idnaTrie { return &idnaTrie{} } // lookupValue determines the type of block n and looks up the value for b. func (t *idnaTrie) lookupValue(n uint32, b byte) uint16 { switch { case n < 133: return uint16(idnaValues[n<<6+uint32(b)]) default: n -= 133 return uint16(idnaSparse.lookup(n, b)) } } // idnaValues: 135 blocks, 8640 entries, 17280 bytes // The third block is the zero block. var idnaValues = [8640]uint16{ // Block 0x0, offset 0x0 0x00: 0x0080, 0x01: 0x0080, 0x02: 0x0080, 0x03: 0x0080, 0x04: 0x0080, 0x05: 0x0080, 0x06: 0x0080, 0x07: 0x0080, 0x08: 0x0080, 0x09: 0x0080, 0x0a: 0x0080, 0x0b: 0x0080, 0x0c: 0x0080, 0x0d: 0x0080, 0x0e: 0x0080, 0x0f: 0x0080, 0x10: 0x0080, 0x11: 0x0080, 0x12: 0x0080, 0x13: 0x0080, 0x14: 0x0080, 0x15: 0x0080, 0x16: 0x0080, 0x17: 0x0080, 0x18: 0x0080, 0x19: 0x0080, 0x1a: 0x0080, 0x1b: 0x0080, 0x1c: 0x0080, 0x1d: 0x0080, 0x1e: 0x0080, 0x1f: 0x0080, 0x20: 0x0080, 0x21: 0x0080, 0x22: 0x0080, 0x23: 0x0080, 0x24: 0x0080, 0x25: 0x0080, 0x26: 0x0080, 0x27: 0x0080, 0x28: 0x0080, 0x29: 0x0080, 0x2a: 0x0080, 0x2b: 0x0080, 0x2c: 0x0080, 0x2d: 0x0008, 0x2e: 0x0008, 0x2f: 0x0080, 0x30: 0x0008, 0x31: 0x0008, 0x32: 0x0008, 0x33: 0x0008, 0x34: 0x0008, 0x35: 0x0008, 0x36: 0x0008, 0x37: 0x0008, 0x38: 0x0008, 0x39: 0x0008, 0x3a: 0x0080, 0x3b: 0x0080, 0x3c: 0x0080, 0x3d: 0x0080, 0x3e: 0x0080, 0x3f: 0x0080, // Block 0x1, offset 0x40 0x40: 0x0080, 0x41: 0xe105, 0x42: 0xe105, 0x43: 0xe105, 0x44: 0xe105, 0x45: 0xe105, 0x46: 0xe105, 0x47: 0xe105, 0x48: 0xe105, 0x49: 0xe105, 0x4a: 0xe105, 0x4b: 0xe105, 0x4c: 0xe105, 0x4d: 0xe105, 0x4e: 0xe105, 0x4f: 0xe105, 0x50: 0xe105, 0x51: 0xe105, 0x52: 0xe105, 0x53: 0xe105, 0x54: 0xe105, 0x55: 0xe105, 0x56: 0xe105, 0x57: 0xe105, 0x58: 0xe105, 0x59: 0xe105, 0x5a: 0xe105, 0x5b: 0x0080, 0x5c: 0x0080, 0x5d: 0x0080, 0x5e: 0x0080, 0x5f: 0x0080, 0x60: 0x0080, 0x61: 0x0008, 0x62: 0x0008, 0x63: 0x0008, 0x64: 0x0008, 0x65: 0x0008, 0x66: 0x0008, 0x67: 0x0008, 0x68: 0x0008, 0x69: 0x0008, 0x6a: 0x0008, 0x6b: 0x0008, 0x6c: 0x0008, 0x6d: 0x0008, 0x6e: 0x0008, 0x6f: 0x0008, 0x70: 0x0008, 0x71: 0x0008, 0x72: 0x0008, 0x73: 0x0008, 0x74: 0x0008, 0x75: 0x0008, 0x76: 0x0008, 0x77: 0x0008, 0x78: 0x0008, 0x79: 0x0008, 0x7a: 0x0008, 0x7b: 0x0080, 0x7c: 0x0080, 0x7d: 0x0080, 0x7e: 0x0080, 0x7f: 0x0080, // Block 0x2, offset 0x80 // Block 0x3, offset 0xc0 0xc0: 0x0040, 0xc1: 0x0040, 0xc2: 0x0040, 0xc3: 0x0040, 0xc4: 0x0040, 0xc5: 0x0040, 0xc6: 0x0040, 0xc7: 0x0040, 0xc8: 0x0040, 0xc9: 0x0040, 0xca: 0x0040, 0xcb: 0x0040, 0xcc: 0x0040, 0xcd: 0x0040, 0xce: 0x0040, 0xcf: 0x0040, 0xd0: 0x0040, 0xd1: 0x0040, 0xd2: 0x0040, 0xd3: 0x0040, 0xd4: 0x0040, 0xd5: 0x0040, 0xd6: 0x0040, 0xd7: 0x0040, 0xd8: 0x0040, 0xd9: 0x0040, 0xda: 0x0040, 0xdb: 0x0040, 0xdc: 0x0040, 0xdd: 0x0040, 0xde: 0x0040, 0xdf: 0x0040, 0xe0: 0x000a, 0xe1: 0x0018, 0xe2: 0x0018, 0xe3: 0x0018, 0xe4: 0x0018, 0xe5: 0x0018, 0xe6: 0x0018, 0xe7: 0x0018, 0xe8: 0x0012, 0xe9: 0x0018, 0xea: 0x0019, 0xeb: 0x0018, 0xec: 0x0018, 0xed: 0x03c0, 0xee: 0x0018, 0xef: 0x0022, 0xf0: 0x0018, 0xf1: 0x0018, 0xf2: 0x0029, 0xf3: 0x0031, 0xf4: 0x003a, 0xf5: 0x0005, 0xf6: 0x0018, 0xf7: 0x0008, 0xf8: 0x0042, 0xf9: 0x0049, 0xfa: 0x0051, 0xfb: 0x0018, 0xfc: 0x0059, 0xfd: 0x0061, 0xfe: 0x0069, 0xff: 0x0018, // Block 0x4, offset 0x100 0x100: 0xe00d, 0x101: 0x0008, 0x102: 0xe00d, 0x103: 0x0008, 0x104: 0xe00d, 0x105: 0x0008, 0x106: 0xe00d, 0x107: 0x0008, 0x108: 0xe00d, 0x109: 0x0008, 0x10a: 0xe00d, 0x10b: 0x0008, 0x10c: 0xe00d, 0x10d: 0x0008, 0x10e: 0xe00d, 0x10f: 0x0008, 0x110: 0xe00d, 0x111: 0x0008, 0x112: 0xe00d, 0x113: 0x0008, 0x114: 0xe00d, 0x115: 0x0008, 0x116: 0xe00d, 0x117: 0x0008, 0x118: 0xe00d, 0x119: 0x0008, 0x11a: 0xe00d, 0x11b: 0x0008, 0x11c: 0xe00d, 0x11d: 0x0008, 0x11e: 0xe00d, 0x11f: 0x0008, 0x120: 0xe00d, 0x121: 0x0008, 0x122: 0xe00d, 0x123: 0x0008, 0x124: 0xe00d, 0x125: 0x0008, 0x126: 0xe00d, 0x127: 0x0008, 0x128: 0xe00d, 0x129: 0x0008, 0x12a: 0xe00d, 0x12b: 0x0008, 0x12c: 0xe00d, 0x12d: 0x0008, 0x12e: 0xe00d, 0x12f: 0x0008, 0x130: 0x0071, 0x131: 0x0008, 0x132: 0x0035, 0x133: 0x004d, 0x134: 0xe00d, 0x135: 0x0008, 0x136: 0xe00d, 0x137: 0x0008, 0x138: 0x0008, 0x139: 0xe01d, 0x13a: 0x0008, 0x13b: 0xe03d, 0x13c: 0x0008, 0x13d: 0xe01d, 0x13e: 0x0008, 0x13f: 0x0079, // Block 0x5, offset 0x140 0x140: 0x0079, 0x141: 0xe01d, 0x142: 0x0008, 0x143: 0xe03d, 0x144: 0x0008, 0x145: 0xe01d, 0x146: 0x0008, 0x147: 0xe07d, 0x148: 0x0008, 0x149: 0x0081, 0x14a: 0xe00d, 0x14b: 0x0008, 0x14c: 0xe00d, 0x14d: 0x0008, 0x14e: 0xe00d, 0x14f: 0x0008, 0x150: 0xe00d, 0x151: 0x0008, 0x152: 0xe00d, 0x153: 0x0008, 0x154: 0xe00d, 0x155: 0x0008, 0x156: 0xe00d, 0x157: 0x0008, 0x158: 0xe00d, 0x159: 0x0008, 0x15a: 0xe00d, 0x15b: 0x0008, 0x15c: 0xe00d, 0x15d: 0x0008, 0x15e: 0xe00d, 0x15f: 0x0008, 0x160: 0xe00d, 0x161: 0x0008, 0x162: 0xe00d, 0x163: 0x0008, 0x164: 0xe00d, 0x165: 0x0008, 0x166: 0xe00d, 0x167: 0x0008, 0x168: 0xe00d, 0x169: 0x0008, 0x16a: 0xe00d, 0x16b: 0x0008, 0x16c: 0xe00d, 0x16d: 0x0008, 0x16e: 0xe00d, 0x16f: 0x0008, 0x170: 0xe00d, 0x171: 0x0008, 0x172: 0xe00d, 0x173: 0x0008, 0x174: 0xe00d, 0x175: 0x0008, 0x176: 0xe00d, 0x177: 0x0008, 0x178: 0x0065, 0x179: 0xe01d, 0x17a: 0x0008, 0x17b: 0xe03d, 0x17c: 0x0008, 0x17d: 0xe01d, 0x17e: 0x0008, 0x17f: 0x0089, // Block 0x6, offset 0x180 0x180: 0x0008, 0x181: 0x007d, 0x182: 0xe00d, 0x183: 0x0008, 0x184: 0xe00d, 0x185: 0x0008, 0x186: 0x007d, 0x187: 0xe07d, 0x188: 0x0008, 0x189: 0x0095, 0x18a: 0x00ad, 0x18b: 0xe03d, 0x18c: 0x0008, 0x18d: 0x0008, 0x18e: 0x00c5, 0x18f: 0x00dd, 0x190: 0x00f5, 0x191: 0xe01d, 0x192: 0x0008, 0x193: 0x010d, 0x194: 0x0125, 0x195: 0x0008, 0x196: 0x013d, 0x197: 0x013d, 0x198: 0xe00d, 0x199: 0x0008, 0x19a: 0x0008, 0x19b: 0x0008, 0x19c: 0x010d, 0x19d: 0x0155, 0x19e: 0x0008, 0x19f: 0x016d, 0x1a0: 0xe00d, 0x1a1: 0x0008, 0x1a2: 0xe00d, 0x1a3: 0x0008, 0x1a4: 0xe00d, 0x1a5: 0x0008, 0x1a6: 0x0185, 0x1a7: 0xe07d, 0x1a8: 0x0008, 0x1a9: 0x019d, 0x1aa: 0x0008, 0x1ab: 0x0008, 0x1ac: 0xe00d, 0x1ad: 0x0008, 0x1ae: 0x0185, 0x1af: 0xe0fd, 0x1b0: 0x0008, 0x1b1: 0x01b5, 0x1b2: 0x01cd, 0x1b3: 0xe03d, 0x1b4: 0x0008, 0x1b5: 0xe01d, 0x1b6: 0x0008, 0x1b7: 0x01e5, 0x1b8: 0xe00d, 0x1b9: 0x0008, 0x1ba: 0x0008, 0x1bb: 0x0008, 0x1bc: 0xe00d, 0x1bd: 0x0008, 0x1be: 0x0008, 0x1bf: 0x0008, // Block 0x7, offset 0x1c0 0x1c0: 0x0008, 0x1c1: 0x0008, 0x1c2: 0x0008, 0x1c3: 0x0008, 0x1c4: 0x0091, 0x1c5: 0x0091, 0x1c6: 0x0091, 0x1c7: 0x01fd, 0x1c8: 0x0215, 0x1c9: 0x022d, 0x1ca: 0x0245, 0x1cb: 0x025d, 0x1cc: 0x0275, 0x1cd: 0xe01d, 0x1ce: 0x0008, 0x1cf: 0xe0fd, 0x1d0: 0x0008, 0x1d1: 0xe01d, 0x1d2: 0x0008, 0x1d3: 0xe03d, 0x1d4: 0x0008, 0x1d5: 0xe01d, 0x1d6: 0x0008, 0x1d7: 0xe07d, 0x1d8: 0x0008, 0x1d9: 0xe01d, 0x1da: 0x0008, 0x1db: 0xe03d, 0x1dc: 0x0008, 0x1dd: 0x0008, 0x1de: 0xe00d, 0x1df: 0x0008, 0x1e0: 0xe00d, 0x1e1: 0x0008, 0x1e2: 0xe00d, 0x1e3: 0x0008, 0x1e4: 0xe00d, 0x1e5: 0x0008, 0x1e6: 0xe00d, 0x1e7: 0x0008, 0x1e8: 0xe00d, 0x1e9: 0x0008, 0x1ea: 0xe00d, 0x1eb: 0x0008, 0x1ec: 0xe00d, 0x1ed: 0x0008, 0x1ee: 0xe00d, 0x1ef: 0x0008, 0x1f0: 0x0008, 0x1f1: 0x028d, 0x1f2: 0x02a5, 0x1f3: 0x02bd, 0x1f4: 0xe00d, 0x1f5: 0x0008, 0x1f6: 0x02d5, 0x1f7: 0x02ed, 0x1f8: 0xe00d, 0x1f9: 0x0008, 0x1fa: 0xe00d, 0x1fb: 0x0008, 0x1fc: 0xe00d, 0x1fd: 0x0008, 0x1fe: 0xe00d, 0x1ff: 0x0008, // Block 0x8, offset 0x200 0x200: 0xe00d, 0x201: 0x0008, 0x202: 0xe00d, 0x203: 0x0008, 0x204: 0xe00d, 0x205: 0x0008, 0x206: 0xe00d, 0x207: 0x0008, 0x208: 0xe00d, 0x209: 0x0008, 0x20a: 0xe00d, 0x20b: 0x0008, 0x20c: 0xe00d, 0x20d: 0x0008, 0x20e: 0xe00d, 0x20f: 0x0008, 0x210: 0xe00d, 0x211: 0x0008, 0x212: 0xe00d, 0x213: 0x0008, 0x214: 0xe00d, 0x215: 0x0008, 0x216: 0xe00d, 0x217: 0x0008, 0x218: 0xe00d, 0x219: 0x0008, 0x21a: 0xe00d, 0x21b: 0x0008, 0x21c: 0xe00d, 0x21d: 0x0008, 0x21e: 0xe00d, 0x21f: 0x0008, 0x220: 0x0305, 0x221: 0x0008, 0x222: 0xe00d, 0x223: 0x0008, 0x224: 0xe00d, 0x225: 0x0008, 0x226: 0xe00d, 0x227: 0x0008, 0x228: 0xe00d, 0x229: 0x0008, 0x22a: 0xe00d, 0x22b: 0x0008, 0x22c: 0xe00d, 0x22d: 0x0008, 0x22e: 0xe00d, 0x22f: 0x0008, 0x230: 0xe00d, 0x231: 0x0008, 0x232: 0xe00d, 0x233: 0x0008, 0x234: 0x0008, 0x235: 0x0008, 0x236: 0x0008, 0x237: 0x0008, 0x238: 0x0008, 0x239: 0x0008, 0x23a: 0x0099, 0x23b: 0xe03d, 0x23c: 0x0008, 0x23d: 0x031d, 0x23e: 0x00a1, 0x23f: 0x0008, // Block 0x9, offset 0x240 0x240: 0x0008, 0x241: 0x0008, 0x242: 0x0018, 0x243: 0x0018, 0x244: 0x0018, 0x245: 0x0018, 0x246: 0x0008, 0x247: 0x0008, 0x248: 0x0008, 0x249: 0x0008, 0x24a: 0x0008, 0x24b: 0x0008, 0x24c: 0x0008, 0x24d: 0x0008, 0x24e: 0x0008, 0x24f: 0x0008, 0x250: 0x0008, 0x251: 0x0008, 0x252: 0x0018, 0x253: 0x0018, 0x254: 0x0018, 0x255: 0x0018, 0x256: 0x0018, 0x257: 0x0018, 0x258: 0x00d2, 0x259: 0x00da, 0x25a: 0x00e2, 0x25b: 0x00ea, 0x25c: 0x00f2, 0x25d: 0x00fa, 0x25e: 0x0018, 0x25f: 0x0018, 0x260: 0x03ad, 0x261: 0x0101, 0x262: 0x0089, 0x263: 0x0109, 0x264: 0x03c5, 0x265: 0x0018, 0x266: 0x0018, 0x267: 0x0018, 0x268: 0x0018, 0x269: 0x0018, 0x26a: 0x0018, 0x26b: 0x0018, 0x26c: 0x0008, 0x26d: 0x0018, 0x26e: 0x0008, 0x26f: 0x0018, 0x270: 0x0018, 0x271: 0x0018, 0x272: 0x0018, 0x273: 0x0018, 0x274: 0x0018, 0x275: 0x0018, 0x276: 0x0018, 0x277: 0x0018, 0x278: 0x0018, 0x279: 0x0018, 0x27a: 0x0018, 0x27b: 0x0018, 0x27c: 0x0018, 0x27d: 0x0018, 0x27e: 0x0018, 0x27f: 0x0018, // Block 0xa, offset 0x280 0x280: 0x03dd, 0x281: 0x03dd, 0x282: 0x3308, 0x283: 0x03f5, 0x284: 0x0111, 0x285: 0x040d, 0x286: 0x3308, 0x287: 0x3308, 0x288: 0x3308, 0x289: 0x3308, 0x28a: 0x3308, 0x28b: 0x3308, 0x28c: 0x3308, 0x28d: 0x3308, 0x28e: 0x3308, 0x28f: 0x33c0, 0x290: 0x3308, 0x291: 0x3308, 0x292: 0x3308, 0x293: 0x3308, 0x294: 0x3308, 0x295: 0x3308, 0x296: 0x3308, 0x297: 0x3308, 0x298: 0x3308, 0x299: 0x3308, 0x29a: 0x3308, 0x29b: 0x3308, 0x29c: 0x3308, 0x29d: 0x3308, 0x29e: 0x3308, 0x29f: 0x3308, 0x2a0: 0x3308, 0x2a1: 0x3308, 0x2a2: 0x3308, 0x2a3: 0x3308, 0x2a4: 0x3308, 0x2a5: 0x3308, 0x2a6: 0x3308, 0x2a7: 0x3308, 0x2a8: 0x3308, 0x2a9: 0x3308, 0x2aa: 0x3308, 0x2ab: 0x3308, 0x2ac: 0x3308, 0x2ad: 0x3308, 0x2ae: 0x3308, 0x2af: 0x3308, 0x2b0: 0xe00d, 0x2b1: 0x0008, 0x2b2: 0xe00d, 0x2b3: 0x0008, 0x2b4: 0x0425, 0x2b5: 0x0008, 0x2b6: 0xe00d, 0x2b7: 0x0008, 0x2b8: 0x0040, 0x2b9: 0x0040, 0x2ba: 0x011a, 0x2bb: 0x0008, 0x2bc: 0x0008, 0x2bd: 0x0008, 0x2be: 0x0122, 0x2bf: 0x043d, // Block 0xb, offset 0x2c0 0x2c0: 0x0040, 0x2c1: 0x0040, 0x2c2: 0x0040, 0x2c3: 0x0040, 0x2c4: 0x003a, 0x2c5: 0x012a, 0x2c6: 0xe155, 0x2c7: 0x0455, 0x2c8: 0xe12d, 0x2c9: 0xe13d, 0x2ca: 0xe12d, 0x2cb: 0x0040, 0x2cc: 0x03dd, 0x2cd: 0x0040, 0x2ce: 0x046d, 0x2cf: 0x0485, 0x2d0: 0x0008, 0x2d1: 0xe105, 0x2d2: 0xe105, 0x2d3: 0xe105, 0x2d4: 0xe105, 0x2d5: 0xe105, 0x2d6: 0xe105, 0x2d7: 0xe105, 0x2d8: 0xe105, 0x2d9: 0xe105, 0x2da: 0xe105, 0x2db: 0xe105, 0x2dc: 0xe105, 0x2dd: 0xe105, 0x2de: 0xe105, 0x2df: 0xe105, 0x2e0: 0x049d, 0x2e1: 0x049d, 0x2e2: 0x0040, 0x2e3: 0x049d, 0x2e4: 0x049d, 0x2e5: 0x049d, 0x2e6: 0x049d, 0x2e7: 0x049d, 0x2e8: 0x049d, 0x2e9: 0x049d, 0x2ea: 0x049d, 0x2eb: 0x049d, 0x2ec: 0x0008, 0x2ed: 0x0008, 0x2ee: 0x0008, 0x2ef: 0x0008, 0x2f0: 0x0008, 0x2f1: 0x0008, 0x2f2: 0x0008, 0x2f3: 0x0008, 0x2f4: 0x0008, 0x2f5: 0x0008, 0x2f6: 0x0008, 0x2f7: 0x0008, 0x2f8: 0x0008, 0x2f9: 0x0008, 0x2fa: 0x0008, 0x2fb: 0x0008, 0x2fc: 0x0008, 0x2fd: 0x0008, 0x2fe: 0x0008, 0x2ff: 0x0008, // Block 0xc, offset 0x300 0x300: 0x0008, 0x301: 0x0008, 0x302: 0xe00f, 0x303: 0x0008, 0x304: 0x0008, 0x305: 0x0008, 0x306: 0x0008, 0x307: 0x0008, 0x308: 0x0008, 0x309: 0x0008, 0x30a: 0x0008, 0x30b: 0x0008, 0x30c: 0x0008, 0x30d: 0x0008, 0x30e: 0x0008, 0x30f: 0xe0c5, 0x310: 0x04b5, 0x311: 0x04cd, 0x312: 0xe0bd, 0x313: 0xe0f5, 0x314: 0xe0fd, 0x315: 0xe09d, 0x316: 0xe0b5, 0x317: 0x0008, 0x318: 0xe00d, 0x319: 0x0008, 0x31a: 0xe00d, 0x31b: 0x0008, 0x31c: 0xe00d, 0x31d: 0x0008, 0x31e: 0xe00d, 0x31f: 0x0008, 0x320: 0xe00d, 0x321: 0x0008, 0x322: 0xe00d, 0x323: 0x0008, 0x324: 0xe00d, 0x325: 0x0008, 0x326: 0xe00d, 0x327: 0x0008, 0x328: 0xe00d, 0x329: 0x0008, 0x32a: 0xe00d, 0x32b: 0x0008, 0x32c: 0xe00d, 0x32d: 0x0008, 0x32e: 0xe00d, 0x32f: 0x0008, 0x330: 0x04e5, 0x331: 0xe185, 0x332: 0xe18d, 0x333: 0x0008, 0x334: 0x04fd, 0x335: 0x03dd, 0x336: 0x0018, 0x337: 0xe07d, 0x338: 0x0008, 0x339: 0xe1d5, 0x33a: 0xe00d, 0x33b: 0x0008, 0x33c: 0x0008, 0x33d: 0x0515, 0x33e: 0x052d, 0x33f: 0x052d, // Block 0xd, offset 0x340 0x340: 0x0008, 0x341: 0x0008, 0x342: 0x0008, 0x343: 0x0008, 0x344: 0x0008, 0x345: 0x0008, 0x346: 0x0008, 0x347: 0x0008, 0x348: 0x0008, 0x349: 0x0008, 0x34a: 0x0008, 0x34b: 0x0008, 0x34c: 0x0008, 0x34d: 0x0008, 0x34e: 0x0008, 0x34f: 0x0008, 0x350: 0x0008, 0x351: 0x0008, 0x352: 0x0008, 0x353: 0x0008, 0x354: 0x0008, 0x355: 0x0008, 0x356: 0x0008, 0x357: 0x0008, 0x358: 0x0008, 0x359: 0x0008, 0x35a: 0x0008, 0x35b: 0x0008, 0x35c: 0x0008, 0x35d: 0x0008, 0x35e: 0x0008, 0x35f: 0x0008, 0x360: 0xe00d, 0x361: 0x0008, 0x362: 0xe00d, 0x363: 0x0008, 0x364: 0xe00d, 0x365: 0x0008, 0x366: 0xe00d, 0x367: 0x0008, 0x368: 0xe00d, 0x369: 0x0008, 0x36a: 0xe00d, 0x36b: 0x0008, 0x36c: 0xe00d, 0x36d: 0x0008, 0x36e: 0xe00d, 0x36f: 0x0008, 0x370: 0xe00d, 0x371: 0x0008, 0x372: 0xe00d, 0x373: 0x0008, 0x374: 0xe00d, 0x375: 0x0008, 0x376: 0xe00d, 0x377: 0x0008, 0x378: 0xe00d, 0x379: 0x0008, 0x37a: 0xe00d, 0x37b: 0x0008, 0x37c: 0xe00d, 0x37d: 0x0008, 0x37e: 0xe00d, 0x37f: 0x0008, // Block 0xe, offset 0x380 0x380: 0xe00d, 0x381: 0x0008, 0x382: 0x0018, 0x383: 0x3308, 0x384: 0x3308, 0x385: 0x3308, 0x386: 0x3308, 0x387: 0x3308, 0x388: 0x3318, 0x389: 0x3318, 0x38a: 0xe00d, 0x38b: 0x0008, 0x38c: 0xe00d, 0x38d: 0x0008, 0x38e: 0xe00d, 0x38f: 0x0008, 0x390: 0xe00d, 0x391: 0x0008, 0x392: 0xe00d, 0x393: 0x0008, 0x394: 0xe00d, 0x395: 0x0008, 0x396: 0xe00d, 0x397: 0x0008, 0x398: 0xe00d, 0x399: 0x0008, 0x39a: 0xe00d, 0x39b: 0x0008, 0x39c: 0xe00d, 0x39d: 0x0008, 0x39e: 0xe00d, 0x39f: 0x0008, 0x3a0: 0xe00d, 0x3a1: 0x0008, 0x3a2: 0xe00d, 0x3a3: 0x0008, 0x3a4: 0xe00d, 0x3a5: 0x0008, 0x3a6: 0xe00d, 0x3a7: 0x0008, 0x3a8: 0xe00d, 0x3a9: 0x0008, 0x3aa: 0xe00d, 0x3ab: 0x0008, 0x3ac: 0xe00d, 0x3ad: 0x0008, 0x3ae: 0xe00d, 0x3af: 0x0008, 0x3b0: 0xe00d, 0x3b1: 0x0008, 0x3b2: 0xe00d, 0x3b3: 0x0008, 0x3b4: 0xe00d, 0x3b5: 0x0008, 0x3b6: 0xe00d, 0x3b7: 0x0008, 0x3b8: 0xe00d, 0x3b9: 0x0008, 0x3ba: 0xe00d, 0x3bb: 0x0008, 0x3bc: 0xe00d, 0x3bd: 0x0008, 0x3be: 0xe00d, 0x3bf: 0x0008, // Block 0xf, offset 0x3c0 0x3c0: 0x0040, 0x3c1: 0xe01d, 0x3c2: 0x0008, 0x3c3: 0xe03d, 0x3c4: 0x0008, 0x3c5: 0xe01d, 0x3c6: 0x0008, 0x3c7: 0xe07d, 0x3c8: 0x0008, 0x3c9: 0xe01d, 0x3ca: 0x0008, 0x3cb: 0xe03d, 0x3cc: 0x0008, 0x3cd: 0xe01d, 0x3ce: 0x0008, 0x3cf: 0x0008, 0x3d0: 0xe00d, 0x3d1: 0x0008, 0x3d2: 0xe00d, 0x3d3: 0x0008, 0x3d4: 0xe00d, 0x3d5: 0x0008, 0x3d6: 0xe00d, 0x3d7: 0x0008, 0x3d8: 0xe00d, 0x3d9: 0x0008, 0x3da: 0xe00d, 0x3db: 0x0008, 0x3dc: 0xe00d, 0x3dd: 0x0008, 0x3de: 0xe00d, 0x3df: 0x0008, 0x3e0: 0xe00d, 0x3e1: 0x0008, 0x3e2: 0xe00d, 0x3e3: 0x0008, 0x3e4: 0xe00d, 0x3e5: 0x0008, 0x3e6: 0xe00d, 0x3e7: 0x0008, 0x3e8: 0xe00d, 0x3e9: 0x0008, 0x3ea: 0xe00d, 0x3eb: 0x0008, 0x3ec: 0xe00d, 0x3ed: 0x0008, 0x3ee: 0xe00d, 0x3ef: 0x0008, 0x3f0: 0xe00d, 0x3f1: 0x0008, 0x3f2: 0xe00d, 0x3f3: 0x0008, 0x3f4: 0xe00d, 0x3f5: 0x0008, 0x3f6: 0xe00d, 0x3f7: 0x0008, 0x3f8: 0xe00d, 0x3f9: 0x0008, 0x3fa: 0xe00d, 0x3fb: 0x0008, 0x3fc: 0xe00d, 0x3fd: 0x0008, 0x3fe: 0xe00d, 0x3ff: 0x0008, // Block 0x10, offset 0x400 0x400: 0xe00d, 0x401: 0x0008, 0x402: 0xe00d, 0x403: 0x0008, 0x404: 0xe00d, 0x405: 0x0008, 0x406: 0xe00d, 0x407: 0x0008, 0x408: 0xe00d, 0x409: 0x0008, 0x40a: 0xe00d, 0x40b: 0x0008, 0x40c: 0xe00d, 0x40d: 0x0008, 0x40e: 0xe00d, 0x40f: 0x0008, 0x410: 0xe00d, 0x411: 0x0008, 0x412: 0xe00d, 0x413: 0x0008, 0x414: 0xe00d, 0x415: 0x0008, 0x416: 0xe00d, 0x417: 0x0008, 0x418: 0xe00d, 0x419: 0x0008, 0x41a: 0xe00d, 0x41b: 0x0008, 0x41c: 0xe00d, 0x41d: 0x0008, 0x41e: 0xe00d, 0x41f: 0x0008, 0x420: 0xe00d, 0x421: 0x0008, 0x422: 0xe00d, 0x423: 0x0008, 0x424: 0xe00d, 0x425: 0x0008, 0x426: 0xe00d, 0x427: 0x0008, 0x428: 0xe00d, 0x429: 0x0008, 0x42a: 0xe00d, 0x42b: 0x0008, 0x42c: 0xe00d, 0x42d: 0x0008, 0x42e: 0xe00d, 0x42f: 0x0008, 0x430: 0x0040, 0x431: 0x03f5, 0x432: 0x03f5, 0x433: 0x03f5, 0x434: 0x03f5, 0x435: 0x03f5, 0x436: 0x03f5, 0x437: 0x03f5, 0x438: 0x03f5, 0x439: 0x03f5, 0x43a: 0x03f5, 0x43b: 0x03f5, 0x43c: 0x03f5, 0x43d: 0x03f5, 0x43e: 0x03f5, 0x43f: 0x03f5, // Block 0x11, offset 0x440 0x440: 0x0840, 0x441: 0x0840, 0x442: 0x0840, 0x443: 0x0840, 0x444: 0x0840, 0x445: 0x0840, 0x446: 0x0018, 0x447: 0x0018, 0x448: 0x0818, 0x449: 0x0018, 0x44a: 0x0018, 0x44b: 0x0818, 0x44c: 0x0018, 0x44d: 0x0818, 0x44e: 0x0018, 0x44f: 0x0018, 0x450: 0x3308, 0x451: 0x3308, 0x452: 0x3308, 0x453: 0x3308, 0x454: 0x3308, 0x455: 0x3308, 0x456: 0x3308, 0x457: 0x3308, 0x458: 0x3308, 0x459: 0x3308, 0x45a: 0x3308, 0x45b: 0x0818, 0x45c: 0x0b40, 0x45d: 0x0818, 0x45e: 0x0818, 0x45f: 0x0818, 0x460: 0x0a08, 0x461: 0x0808, 0x462: 0x0c08, 0x463: 0x0c08, 0x464: 0x0c08, 0x465: 0x0c08, 0x466: 0x0a08, 0x467: 0x0c08, 0x468: 0x0a08, 0x469: 0x0c08, 0x46a: 0x0a08, 0x46b: 0x0a08, 0x46c: 0x0a08, 0x46d: 0x0a08, 0x46e: 0x0a08, 0x46f: 0x0c08, 0x470: 0x0c08, 0x471: 0x0c08, 0x472: 0x0c08, 0x473: 0x0a08, 0x474: 0x0a08, 0x475: 0x0a08, 0x476: 0x0a08, 0x477: 0x0a08, 0x478: 0x0a08, 0x479: 0x0a08, 0x47a: 0x0a08, 0x47b: 0x0a08, 0x47c: 0x0a08, 0x47d: 0x0a08, 0x47e: 0x0a08, 0x47f: 0x0a08, // Block 0x12, offset 0x480 0x480: 0x0818, 0x481: 0x0a08, 0x482: 0x0a08, 0x483: 0x0a08, 0x484: 0x0a08, 0x485: 0x0a08, 0x486: 0x0a08, 0x487: 0x0a08, 0x488: 0x0c08, 0x489: 0x0a08, 0x48a: 0x0a08, 0x48b: 0x3308, 0x48c: 0x3308, 0x48d: 0x3308, 0x48e: 0x3308, 0x48f: 0x3308, 0x490: 0x3308, 0x491: 0x3308, 0x492: 0x3308, 0x493: 0x3308, 0x494: 0x3308, 0x495: 0x3308, 0x496: 0x3308, 0x497: 0x3308, 0x498: 0x3308, 0x499: 0x3308, 0x49a: 0x3308, 0x49b: 0x3308, 0x49c: 0x3308, 0x49d: 0x3308, 0x49e: 0x3308, 0x49f: 0x3308, 0x4a0: 0x0808, 0x4a1: 0x0808, 0x4a2: 0x0808, 0x4a3: 0x0808, 0x4a4: 0x0808, 0x4a5: 0x0808, 0x4a6: 0x0808, 0x4a7: 0x0808, 0x4a8: 0x0808, 0x4a9: 0x0808, 0x4aa: 0x0018, 0x4ab: 0x0818, 0x4ac: 0x0818, 0x4ad: 0x0818, 0x4ae: 0x0a08, 0x4af: 0x0a08, 0x4b0: 0x3308, 0x4b1: 0x0c08, 0x4b2: 0x0c08, 0x4b3: 0x0c08, 0x4b4: 0x0808, 0x4b5: 0x0139, 0x4b6: 0x0141, 0x4b7: 0x0149, 0x4b8: 0x0151, 0x4b9: 0x0a08, 0x4ba: 0x0a08, 0x4bb: 0x0a08, 0x4bc: 0x0a08, 0x4bd: 0x0a08, 0x4be: 0x0a08, 0x4bf: 0x0a08, // Block 0x13, offset 0x4c0 0x4c0: 0x0c08, 0x4c1: 0x0a08, 0x4c2: 0x0a08, 0x4c3: 0x0c08, 0x4c4: 0x0c08, 0x4c5: 0x0c08, 0x4c6: 0x0c08, 0x4c7: 0x0c08, 0x4c8: 0x0c08, 0x4c9: 0x0c08, 0x4ca: 0x0c08, 0x4cb: 0x0c08, 0x4cc: 0x0a08, 0x4cd: 0x0c08, 0x4ce: 0x0a08, 0x4cf: 0x0c08, 0x4d0: 0x0a08, 0x4d1: 0x0a08, 0x4d2: 0x0c08, 0x4d3: 0x0c08, 0x4d4: 0x0818, 0x4d5: 0x0c08, 0x4d6: 0x3308, 0x4d7: 0x3308, 0x4d8: 0x3308, 0x4d9: 0x3308, 0x4da: 0x3308, 0x4db: 0x3308, 0x4dc: 0x3308, 0x4dd: 0x0840, 0x4de: 0x0018, 0x4df: 0x3308, 0x4e0: 0x3308, 0x4e1: 0x3308, 0x4e2: 0x3308, 0x4e3: 0x3308, 0x4e4: 0x3308, 0x4e5: 0x0808, 0x4e6: 0x0808, 0x4e7: 0x3308, 0x4e8: 0x3308, 0x4e9: 0x0018, 0x4ea: 0x3308, 0x4eb: 0x3308, 0x4ec: 0x3308, 0x4ed: 0x3308, 0x4ee: 0x0c08, 0x4ef: 0x0c08, 0x4f0: 0x0008, 0x4f1: 0x0008, 0x4f2: 0x0008, 0x4f3: 0x0008, 0x4f4: 0x0008, 0x4f5: 0x0008, 0x4f6: 0x0008, 0x4f7: 0x0008, 0x4f8: 0x0008, 0x4f9: 0x0008, 0x4fa: 0x0a08, 0x4fb: 0x0a08, 0x4fc: 0x0a08, 0x4fd: 0x0808, 0x4fe: 0x0808, 0x4ff: 0x0a08, // Block 0x14, offset 0x500 0x500: 0x0818, 0x501: 0x0818, 0x502: 0x0818, 0x503: 0x0818, 0x504: 0x0818, 0x505: 0x0818, 0x506: 0x0818, 0x507: 0x0818, 0x508: 0x0818, 0x509: 0x0818, 0x50a: 0x0818, 0x50b: 0x0818, 0x50c: 0x0818, 0x50d: 0x0818, 0x50e: 0x0040, 0x50f: 0x0b40, 0x510: 0x0c08, 0x511: 0x3308, 0x512: 0x0a08, 0x513: 0x0a08, 0x514: 0x0a08, 0x515: 0x0c08, 0x516: 0x0c08, 0x517: 0x0c08, 0x518: 0x0c08, 0x519: 0x0c08, 0x51a: 0x0a08, 0x51b: 0x0a08, 0x51c: 0x0a08, 0x51d: 0x0a08, 0x51e: 0x0c08, 0x51f: 0x0a08, 0x520: 0x0a08, 0x521: 0x0a08, 0x522: 0x0a08, 0x523: 0x0a08, 0x524: 0x0a08, 0x525: 0x0a08, 0x526: 0x0a08, 0x527: 0x0a08, 0x528: 0x0c08, 0x529: 0x0a08, 0x52a: 0x0c08, 0x52b: 0x0a08, 0x52c: 0x0c08, 0x52d: 0x0a08, 0x52e: 0x0a08, 0x52f: 0x0c08, 0x530: 0x3308, 0x531: 0x3308, 0x532: 0x3308, 0x533: 0x3308, 0x534: 0x3308, 0x535: 0x3308, 0x536: 0x3308, 0x537: 0x3308, 0x538: 0x3308, 0x539: 0x3308, 0x53a: 0x3308, 0x53b: 0x3308, 0x53c: 0x3308, 0x53d: 0x3308, 0x53e: 0x3308, 0x53f: 0x3308, // Block 0x15, offset 0x540 0x540: 0x0c08, 0x541: 0x0a08, 0x542: 0x0a08, 0x543: 0x0a08, 0x544: 0x0a08, 0x545: 0x0a08, 0x546: 0x0c08, 0x547: 0x0c08, 0x548: 0x0a08, 0x549: 0x0c08, 0x54a: 0x0a08, 0x54b: 0x0a08, 0x54c: 0x0a08, 0x54d: 0x0a08, 0x54e: 0x0a08, 0x54f: 0x0a08, 0x550: 0x0a08, 0x551: 0x0a08, 0x552: 0x0a08, 0x553: 0x0a08, 0x554: 0x0c08, 0x555: 0x0a08, 0x556: 0x0c08, 0x557: 0x0c08, 0x558: 0x0c08, 0x559: 0x3308, 0x55a: 0x3308, 0x55b: 0x3308, 0x55c: 0x0040, 0x55d: 0x0040, 0x55e: 0x0818, 0x55f: 0x0040, 0x560: 0x0a08, 0x561: 0x0808, 0x562: 0x0a08, 0x563: 0x0a08, 0x564: 0x0a08, 0x565: 0x0a08, 0x566: 0x0808, 0x567: 0x0c08, 0x568: 0x0a08, 0x569: 0x0c08, 0x56a: 0x0c08, 0x56b: 0x0040, 0x56c: 0x0040, 0x56d: 0x0040, 0x56e: 0x0040, 0x56f: 0x0040, 0x570: 0x0c08, 0x571: 0x0c08, 0x572: 0x0c08, 0x573: 0x0c08, 0x574: 0x0c08, 0x575: 0x0c08, 0x576: 0x0c08, 0x577: 0x0c08, 0x578: 0x0c08, 0x579: 0x0c08, 0x57a: 0x0c08, 0x57b: 0x0c08, 0x57c: 0x0c08, 0x57d: 0x0c08, 0x57e: 0x0c08, 0x57f: 0x0c08, // Block 0x16, offset 0x580 0x580: 0x0c08, 0x581: 0x0c08, 0x582: 0x0c08, 0x583: 0x0808, 0x584: 0x0808, 0x585: 0x0808, 0x586: 0x0a08, 0x587: 0x0808, 0x588: 0x0818, 0x589: 0x0a08, 0x58a: 0x0a08, 0x58b: 0x0a08, 0x58c: 0x0a08, 0x58d: 0x0a08, 0x58e: 0x0c08, 0x58f: 0x0040, 0x590: 0x0840, 0x591: 0x0840, 0x592: 0x0040, 0x593: 0x0040, 0x594: 0x0040, 0x595: 0x0040, 0x596: 0x0040, 0x597: 0x0040, 0x598: 0x3308, 0x599: 0x3308, 0x59a: 0x3308, 0x59b: 0x3308, 0x59c: 0x3308, 0x59d: 0x3308, 0x59e: 0x3308, 0x59f: 0x3308, 0x5a0: 0x0a08, 0x5a1: 0x0a08, 0x5a2: 0x0a08, 0x5a3: 0x0a08, 0x5a4: 0x0a08, 0x5a5: 0x0a08, 0x5a6: 0x0a08, 0x5a7: 0x0a08, 0x5a8: 0x0a08, 0x5a9: 0x0a08, 0x5aa: 0x0c08, 0x5ab: 0x0c08, 0x5ac: 0x0c08, 0x5ad: 0x0808, 0x5ae: 0x0c08, 0x5af: 0x0a08, 0x5b0: 0x0a08, 0x5b1: 0x0c08, 0x5b2: 0x0c08, 0x5b3: 0x0a08, 0x5b4: 0x0a08, 0x5b5: 0x0a08, 0x5b6: 0x0a08, 0x5b7: 0x0a08, 0x5b8: 0x0a08, 0x5b9: 0x0c08, 0x5ba: 0x0a08, 0x5bb: 0x0a08, 0x5bc: 0x0a08, 0x5bd: 0x0a08, 0x5be: 0x0a08, 0x5bf: 0x0a08, // Block 0x17, offset 0x5c0 0x5c0: 0x3008, 0x5c1: 0x3308, 0x5c2: 0x3308, 0x5c3: 0x3308, 0x5c4: 0x3308, 0x5c5: 0x3308, 0x5c6: 0x3308, 0x5c7: 0x3308, 0x5c8: 0x3308, 0x5c9: 0x3008, 0x5ca: 0x3008, 0x5cb: 0x3008, 0x5cc: 0x3008, 0x5cd: 0x3b08, 0x5ce: 0x3008, 0x5cf: 0x3008, 0x5d0: 0x0008, 0x5d1: 0x3308, 0x5d2: 0x3308, 0x5d3: 0x3308, 0x5d4: 0x3308, 0x5d5: 0x3308, 0x5d6: 0x3308, 0x5d7: 0x3308, 0x5d8: 0x0159, 0x5d9: 0x0161, 0x5da: 0x0169, 0x5db: 0x0171, 0x5dc: 0x0179, 0x5dd: 0x0181, 0x5de: 0x0189, 0x5df: 0x0191, 0x5e0: 0x0008, 0x5e1: 0x0008, 0x5e2: 0x3308, 0x5e3: 0x3308, 0x5e4: 0x0018, 0x5e5: 0x0018, 0x5e6: 0x0008, 0x5e7: 0x0008, 0x5e8: 0x0008, 0x5e9: 0x0008, 0x5ea: 0x0008, 0x5eb: 0x0008, 0x5ec: 0x0008, 0x5ed: 0x0008, 0x5ee: 0x0008, 0x5ef: 0x0008, 0x5f0: 0x0018, 0x5f1: 0x0008, 0x5f2: 0x0008, 0x5f3: 0x0008, 0x5f4: 0x0008, 0x5f5: 0x0008, 0x5f6: 0x0008, 0x5f7: 0x0008, 0x5f8: 0x0008, 0x5f9: 0x0008, 0x5fa: 0x0008, 0x5fb: 0x0008, 0x5fc: 0x0008, 0x5fd: 0x0008, 0x5fe: 0x0008, 0x5ff: 0x0008, // Block 0x18, offset 0x600 0x600: 0x0008, 0x601: 0x3308, 0x602: 0x3008, 0x603: 0x3008, 0x604: 0x0040, 0x605: 0x0008, 0x606: 0x0008, 0x607: 0x0008, 0x608: 0x0008, 0x609: 0x0008, 0x60a: 0x0008, 0x60b: 0x0008, 0x60c: 0x0008, 0x60d: 0x0040, 0x60e: 0x0040, 0x60f: 0x0008, 0x610: 0x0008, 0x611: 0x0040, 0x612: 0x0040, 0x613: 0x0008, 0x614: 0x0008, 0x615: 0x0008, 0x616: 0x0008, 0x617: 0x0008, 0x618: 0x0008, 0x619: 0x0008, 0x61a: 0x0008, 0x61b: 0x0008, 0x61c: 0x0008, 0x61d: 0x0008, 0x61e: 0x0008, 0x61f: 0x0008, 0x620: 0x0008, 0x621: 0x0008, 0x622: 0x0008, 0x623: 0x0008, 0x624: 0x0008, 0x625: 0x0008, 0x626: 0x0008, 0x627: 0x0008, 0x628: 0x0008, 0x629: 0x0040, 0x62a: 0x0008, 0x62b: 0x0008, 0x62c: 0x0008, 0x62d: 0x0008, 0x62e: 0x0008, 0x62f: 0x0008, 0x630: 0x0008, 0x631: 0x0040, 0x632: 0x0008, 0x633: 0x0040, 0x634: 0x0040, 0x635: 0x0040, 0x636: 0x0008, 0x637: 0x0008, 0x638: 0x0008, 0x639: 0x0008, 0x63a: 0x0040, 0x63b: 0x0040, 0x63c: 0x3308, 0x63d: 0x0008, 0x63e: 0x3008, 0x63f: 0x3008, // Block 0x19, offset 0x640 0x640: 0x3008, 0x641: 0x3308, 0x642: 0x3308, 0x643: 0x3308, 0x644: 0x3308, 0x645: 0x0040, 0x646: 0x0040, 0x647: 0x3008, 0x648: 0x3008, 0x649: 0x0040, 0x64a: 0x0040, 0x64b: 0x3008, 0x64c: 0x3008, 0x64d: 0x3b08, 0x64e: 0x0008, 0x64f: 0x0040, 0x650: 0x0040, 0x651: 0x0040, 0x652: 0x0040, 0x653: 0x0040, 0x654: 0x0040, 0x655: 0x0040, 0x656: 0x0040, 0x657: 0x3008, 0x658: 0x0040, 0x659: 0x0040, 0x65a: 0x0040, 0x65b: 0x0040, 0x65c: 0x0199, 0x65d: 0x01a1, 0x65e: 0x0040, 0x65f: 0x01a9, 0x660: 0x0008, 0x661: 0x0008, 0x662: 0x3308, 0x663: 0x3308, 0x664: 0x0040, 0x665: 0x0040, 0x666: 0x0008, 0x667: 0x0008, 0x668: 0x0008, 0x669: 0x0008, 0x66a: 0x0008, 0x66b: 0x0008, 0x66c: 0x0008, 0x66d: 0x0008, 0x66e: 0x0008, 0x66f: 0x0008, 0x670: 0x0008, 0x671: 0x0008, 0x672: 0x0018, 0x673: 0x0018, 0x674: 0x0018, 0x675: 0x0018, 0x676: 0x0018, 0x677: 0x0018, 0x678: 0x0018, 0x679: 0x0018, 0x67a: 0x0018, 0x67b: 0x0018, 0x67c: 0x0008, 0x67d: 0x0018, 0x67e: 0x3308, 0x67f: 0x0040, // Block 0x1a, offset 0x680 0x680: 0x0040, 0x681: 0x3308, 0x682: 0x3308, 0x683: 0x3008, 0x684: 0x0040, 0x685: 0x0008, 0x686: 0x0008, 0x687: 0x0008, 0x688: 0x0008, 0x689: 0x0008, 0x68a: 0x0008, 0x68b: 0x0040, 0x68c: 0x0040, 0x68d: 0x0040, 0x68e: 0x0040, 0x68f: 0x0008, 0x690: 0x0008, 0x691: 0x0040, 0x692: 0x0040, 0x693: 0x0008, 0x694: 0x0008, 0x695: 0x0008, 0x696: 0x0008, 0x697: 0x0008, 0x698: 0x0008, 0x699: 0x0008, 0x69a: 0x0008, 0x69b: 0x0008, 0x69c: 0x0008, 0x69d: 0x0008, 0x69e: 0x0008, 0x69f: 0x0008, 0x6a0: 0x0008, 0x6a1: 0x0008, 0x6a2: 0x0008, 0x6a3: 0x0008, 0x6a4: 0x0008, 0x6a5: 0x0008, 0x6a6: 0x0008, 0x6a7: 0x0008, 0x6a8: 0x0008, 0x6a9: 0x0040, 0x6aa: 0x0008, 0x6ab: 0x0008, 0x6ac: 0x0008, 0x6ad: 0x0008, 0x6ae: 0x0008, 0x6af: 0x0008, 0x6b0: 0x0008, 0x6b1: 0x0040, 0x6b2: 0x0008, 0x6b3: 0x01b1, 0x6b4: 0x0040, 0x6b5: 0x0008, 0x6b6: 0x01b9, 0x6b7: 0x0040, 0x6b8: 0x0008, 0x6b9: 0x0008, 0x6ba: 0x0040, 0x6bb: 0x0040, 0x6bc: 0x3308, 0x6bd: 0x0040, 0x6be: 0x3008, 0x6bf: 0x3008, // Block 0x1b, offset 0x6c0 0x6c0: 0x3008, 0x6c1: 0x3308, 0x6c2: 0x3308, 0x6c3: 0x0040, 0x6c4: 0x0040, 0x6c5: 0x0040, 0x6c6: 0x0040, 0x6c7: 0x3308, 0x6c8: 0x3308, 0x6c9: 0x0040, 0x6ca: 0x0040, 0x6cb: 0x3308, 0x6cc: 0x3308, 0x6cd: 0x3b08, 0x6ce: 0x0040, 0x6cf: 0x0040, 0x6d0: 0x0040, 0x6d1: 0x3308, 0x6d2: 0x0040, 0x6d3: 0x0040, 0x6d4: 0x0040, 0x6d5: 0x0040, 0x6d6: 0x0040, 0x6d7: 0x0040, 0x6d8: 0x0040, 0x6d9: 0x01c1, 0x6da: 0x01c9, 0x6db: 0x01d1, 0x6dc: 0x0008, 0x6dd: 0x0040, 0x6de: 0x01d9, 0x6df: 0x0040, 0x6e0: 0x0040, 0x6e1: 0x0040, 0x6e2: 0x0040, 0x6e3: 0x0040, 0x6e4: 0x0040, 0x6e5: 0x0040, 0x6e6: 0x0008, 0x6e7: 0x0008, 0x6e8: 0x0008, 0x6e9: 0x0008, 0x6ea: 0x0008, 0x6eb: 0x0008, 0x6ec: 0x0008, 0x6ed: 0x0008, 0x6ee: 0x0008, 0x6ef: 0x0008, 0x6f0: 0x3308, 0x6f1: 0x3308, 0x6f2: 0x0008, 0x6f3: 0x0008, 0x6f4: 0x0008, 0x6f5: 0x3308, 0x6f6: 0x0018, 0x6f7: 0x0040, 0x6f8: 0x0040, 0x6f9: 0x0040, 0x6fa: 0x0040, 0x6fb: 0x0040, 0x6fc: 0x0040, 0x6fd: 0x0040, 0x6fe: 0x0040, 0x6ff: 0x0040, // Block 0x1c, offset 0x700 0x700: 0x0040, 0x701: 0x3308, 0x702: 0x3308, 0x703: 0x3008, 0x704: 0x0040, 0x705: 0x0008, 0x706: 0x0008, 0x707: 0x0008, 0x708: 0x0008, 0x709: 0x0008, 0x70a: 0x0008, 0x70b: 0x0008, 0x70c: 0x0008, 0x70d: 0x0008, 0x70e: 0x0040, 0x70f: 0x0008, 0x710: 0x0008, 0x711: 0x0008, 0x712: 0x0040, 0x713: 0x0008, 0x714: 0x0008, 0x715: 0x0008, 0x716: 0x0008, 0x717: 0x0008, 0x718: 0x0008, 0x719: 0x0008, 0x71a: 0x0008, 0x71b: 0x0008, 0x71c: 0x0008, 0x71d: 0x0008, 0x71e: 0x0008, 0x71f: 0x0008, 0x720: 0x0008, 0x721: 0x0008, 0x722: 0x0008, 0x723: 0x0008, 0x724: 0x0008, 0x725: 0x0008, 0x726: 0x0008, 0x727: 0x0008, 0x728: 0x0008, 0x729: 0x0040, 0x72a: 0x0008, 0x72b: 0x0008, 0x72c: 0x0008, 0x72d: 0x0008, 0x72e: 0x0008, 0x72f: 0x0008, 0x730: 0x0008, 0x731: 0x0040, 0x732: 0x0008, 0x733: 0x0008, 0x734: 0x0040, 0x735: 0x0008, 0x736: 0x0008, 0x737: 0x0008, 0x738: 0x0008, 0x739: 0x0008, 0x73a: 0x0040, 0x73b: 0x0040, 0x73c: 0x3308, 0x73d: 0x0008, 0x73e: 0x3008, 0x73f: 0x3008, // Block 0x1d, offset 0x740 0x740: 0x3008, 0x741: 0x3308, 0x742: 0x3308, 0x743: 0x3308, 0x744: 0x3308, 0x745: 0x3308, 0x746: 0x0040, 0x747: 0x3308, 0x748: 0x3308, 0x749: 0x3008, 0x74a: 0x0040, 0x74b: 0x3008, 0x74c: 0x3008, 0x74d: 0x3b08, 0x74e: 0x0040, 0x74f: 0x0040, 0x750: 0x0008, 0x751: 0x0040, 0x752: 0x0040, 0x753: 0x0040, 0x754: 0x0040, 0x755: 0x0040, 0x756: 0x0040, 0x757: 0x0040, 0x758: 0x0040, 0x759: 0x0040, 0x75a: 0x0040, 0x75b: 0x0040, 0x75c: 0x0040, 0x75d: 0x0040, 0x75e: 0x0040, 0x75f: 0x0040, 0x760: 0x0008, 0x761: 0x0008, 0x762: 0x3308, 0x763: 0x3308, 0x764: 0x0040, 0x765: 0x0040, 0x766: 0x0008, 0x767: 0x0008, 0x768: 0x0008, 0x769: 0x0008, 0x76a: 0x0008, 0x76b: 0x0008, 0x76c: 0x0008, 0x76d: 0x0008, 0x76e: 0x0008, 0x76f: 0x0008, 0x770: 0x0018, 0x771: 0x0018, 0x772: 0x0040, 0x773: 0x0040, 0x774: 0x0040, 0x775: 0x0040, 0x776: 0x0040, 0x777: 0x0040, 0x778: 0x0040, 0x779: 0x0008, 0x77a: 0x3308, 0x77b: 0x3308, 0x77c: 0x3308, 0x77d: 0x3308, 0x77e: 0x3308, 0x77f: 0x3308, // Block 0x1e, offset 0x780 0x780: 0x0040, 0x781: 0x3308, 0x782: 0x3008, 0x783: 0x3008, 0x784: 0x0040, 0x785: 0x0008, 0x786: 0x0008, 0x787: 0x0008, 0x788: 0x0008, 0x789: 0x0008, 0x78a: 0x0008, 0x78b: 0x0008, 0x78c: 0x0008, 0x78d: 0x0040, 0x78e: 0x0040, 0x78f: 0x0008, 0x790: 0x0008, 0x791: 0x0040, 0x792: 0x0040, 0x793: 0x0008, 0x794: 0x0008, 0x795: 0x0008, 0x796: 0x0008, 0x797: 0x0008, 0x798: 0x0008, 0x799: 0x0008, 0x79a: 0x0008, 0x79b: 0x0008, 0x79c: 0x0008, 0x79d: 0x0008, 0x79e: 0x0008, 0x79f: 0x0008, 0x7a0: 0x0008, 0x7a1: 0x0008, 0x7a2: 0x0008, 0x7a3: 0x0008, 0x7a4: 0x0008, 0x7a5: 0x0008, 0x7a6: 0x0008, 0x7a7: 0x0008, 0x7a8: 0x0008, 0x7a9: 0x0040, 0x7aa: 0x0008, 0x7ab: 0x0008, 0x7ac: 0x0008, 0x7ad: 0x0008, 0x7ae: 0x0008, 0x7af: 0x0008, 0x7b0: 0x0008, 0x7b1: 0x0040, 0x7b2: 0x0008, 0x7b3: 0x0008, 0x7b4: 0x0040, 0x7b5: 0x0008, 0x7b6: 0x0008, 0x7b7: 0x0008, 0x7b8: 0x0008, 0x7b9: 0x0008, 0x7ba: 0x0040, 0x7bb: 0x0040, 0x7bc: 0x3308, 0x7bd: 0x0008, 0x7be: 0x3008, 0x7bf: 0x3308, // Block 0x1f, offset 0x7c0 0x7c0: 0x3008, 0x7c1: 0x3308, 0x7c2: 0x3308, 0x7c3: 0x3308, 0x7c4: 0x3308, 0x7c5: 0x0040, 0x7c6: 0x0040, 0x7c7: 0x3008, 0x7c8: 0x3008, 0x7c9: 0x0040, 0x7ca: 0x0040, 0x7cb: 0x3008, 0x7cc: 0x3008, 0x7cd: 0x3b08, 0x7ce: 0x0040, 0x7cf: 0x0040, 0x7d0: 0x0040, 0x7d1: 0x0040, 0x7d2: 0x0040, 0x7d3: 0x0040, 0x7d4: 0x0040, 0x7d5: 0x3308, 0x7d6: 0x3308, 0x7d7: 0x3008, 0x7d8: 0x0040, 0x7d9: 0x0040, 0x7da: 0x0040, 0x7db: 0x0040, 0x7dc: 0x01e1, 0x7dd: 0x01e9, 0x7de: 0x0040, 0x7df: 0x0008, 0x7e0: 0x0008, 0x7e1: 0x0008, 0x7e2: 0x3308, 0x7e3: 0x3308, 0x7e4: 0x0040, 0x7e5: 0x0040, 0x7e6: 0x0008, 0x7e7: 0x0008, 0x7e8: 0x0008, 0x7e9: 0x0008, 0x7ea: 0x0008, 0x7eb: 0x0008, 0x7ec: 0x0008, 0x7ed: 0x0008, 0x7ee: 0x0008, 0x7ef: 0x0008, 0x7f0: 0x0018, 0x7f1: 0x0008, 0x7f2: 0x0018, 0x7f3: 0x0018, 0x7f4: 0x0018, 0x7f5: 0x0018, 0x7f6: 0x0018, 0x7f7: 0x0018, 0x7f8: 0x0040, 0x7f9: 0x0040, 0x7fa: 0x0040, 0x7fb: 0x0040, 0x7fc: 0x0040, 0x7fd: 0x0040, 0x7fe: 0x0040, 0x7ff: 0x0040, // Block 0x20, offset 0x800 0x800: 0x0040, 0x801: 0x0040, 0x802: 0x3308, 0x803: 0x0008, 0x804: 0x0040, 0x805: 0x0008, 0x806: 0x0008, 0x807: 0x0008, 0x808: 0x0008, 0x809: 0x0008, 0x80a: 0x0008, 0x80b: 0x0040, 0x80c: 0x0040, 0x80d: 0x0040, 0x80e: 0x0008, 0x80f: 0x0008, 0x810: 0x0008, 0x811: 0x0040, 0x812: 0x0008, 0x813: 0x0008, 0x814: 0x0008, 0x815: 0x0008, 0x816: 0x0040, 0x817: 0x0040, 0x818: 0x0040, 0x819: 0x0008, 0x81a: 0x0008, 0x81b: 0x0040, 0x81c: 0x0008, 0x81d: 0x0040, 0x81e: 0x0008, 0x81f: 0x0008, 0x820: 0x0040, 0x821: 0x0040, 0x822: 0x0040, 0x823: 0x0008, 0x824: 0x0008, 0x825: 0x0040, 0x826: 0x0040, 0x827: 0x0040, 0x828: 0x0008, 0x829: 0x0008, 0x82a: 0x0008, 0x82b: 0x0040, 0x82c: 0x0040, 0x82d: 0x0040, 0x82e: 0x0008, 0x82f: 0x0008, 0x830: 0x0008, 0x831: 0x0008, 0x832: 0x0008, 0x833: 0x0008, 0x834: 0x0008, 0x835: 0x0008, 0x836: 0x0008, 0x837: 0x0008, 0x838: 0x0008, 0x839: 0x0008, 0x83a: 0x0040, 0x83b: 0x0040, 0x83c: 0x0040, 0x83d: 0x0040, 0x83e: 0x3008, 0x83f: 0x3008, // Block 0x21, offset 0x840 0x840: 0x3308, 0x841: 0x3008, 0x842: 0x3008, 0x843: 0x3008, 0x844: 0x3008, 0x845: 0x0040, 0x846: 0x3308, 0x847: 0x3308, 0x848: 0x3308, 0x849: 0x0040, 0x84a: 0x3308, 0x84b: 0x3308, 0x84c: 0x3308, 0x84d: 0x3b08, 0x84e: 0x0040, 0x84f: 0x0040, 0x850: 0x0040, 0x851: 0x0040, 0x852: 0x0040, 0x853: 0x0040, 0x854: 0x0040, 0x855: 0x3308, 0x856: 0x3308, 0x857: 0x0040, 0x858: 0x0008, 0x859: 0x0008, 0x85a: 0x0008, 0x85b: 0x0040, 0x85c: 0x0040, 0x85d: 0x0008, 0x85e: 0x0040, 0x85f: 0x0040, 0x860: 0x0008, 0x861: 0x0008, 0x862: 0x3308, 0x863: 0x3308, 0x864: 0x0040, 0x865: 0x0040, 0x866: 0x0008, 0x867: 0x0008, 0x868: 0x0008, 0x869: 0x0008, 0x86a: 0x0008, 0x86b: 0x0008, 0x86c: 0x0008, 0x86d: 0x0008, 0x86e: 0x0008, 0x86f: 0x0008, 0x870: 0x0040, 0x871: 0x0040, 0x872: 0x0040, 0x873: 0x0040, 0x874: 0x0040, 0x875: 0x0040, 0x876: 0x0040, 0x877: 0x0018, 0x878: 0x0018, 0x879: 0x0018, 0x87a: 0x0018, 0x87b: 0x0018, 0x87c: 0x0018, 0x87d: 0x0018, 0x87e: 0x0018, 0x87f: 0x0018, // Block 0x22, offset 0x880 0x880: 0x0008, 0x881: 0x3308, 0x882: 0x3008, 0x883: 0x3008, 0x884: 0x0018, 0x885: 0x0008, 0x886: 0x0008, 0x887: 0x0008, 0x888: 0x0008, 0x889: 0x0008, 0x88a: 0x0008, 0x88b: 0x0008, 0x88c: 0x0008, 0x88d: 0x0040, 0x88e: 0x0008, 0x88f: 0x0008, 0x890: 0x0008, 0x891: 0x0040, 0x892: 0x0008, 0x893: 0x0008, 0x894: 0x0008, 0x895: 0x0008, 0x896: 0x0008, 0x897: 0x0008, 0x898: 0x0008, 0x899: 0x0008, 0x89a: 0x0008, 0x89b: 0x0008, 0x89c: 0x0008, 0x89d: 0x0008, 0x89e: 0x0008, 0x89f: 0x0008, 0x8a0: 0x0008, 0x8a1: 0x0008, 0x8a2: 0x0008, 0x8a3: 0x0008, 0x8a4: 0x0008, 0x8a5: 0x0008, 0x8a6: 0x0008, 0x8a7: 0x0008, 0x8a8: 0x0008, 0x8a9: 0x0040, 0x8aa: 0x0008, 0x8ab: 0x0008, 0x8ac: 0x0008, 0x8ad: 0x0008, 0x8ae: 0x0008, 0x8af: 0x0008, 0x8b0: 0x0008, 0x8b1: 0x0008, 0x8b2: 0x0008, 0x8b3: 0x0008, 0x8b4: 0x0040, 0x8b5: 0x0008, 0x8b6: 0x0008, 0x8b7: 0x0008, 0x8b8: 0x0008, 0x8b9: 0x0008, 0x8ba: 0x0040, 0x8bb: 0x0040, 0x8bc: 0x3308, 0x8bd: 0x0008, 0x8be: 0x3008, 0x8bf: 0x3308, // Block 0x23, offset 0x8c0 0x8c0: 0x3008, 0x8c1: 0x3008, 0x8c2: 0x3008, 0x8c3: 0x3008, 0x8c4: 0x3008, 0x8c5: 0x0040, 0x8c6: 0x3308, 0x8c7: 0x3008, 0x8c8: 0x3008, 0x8c9: 0x0040, 0x8ca: 0x3008, 0x8cb: 0x3008, 0x8cc: 0x3308, 0x8cd: 0x3b08, 0x8ce: 0x0040, 0x8cf: 0x0040, 0x8d0: 0x0040, 0x8d1: 0x0040, 0x8d2: 0x0040, 0x8d3: 0x0040, 0x8d4: 0x0040, 0x8d5: 0x3008, 0x8d6: 0x3008, 0x8d7: 0x0040, 0x8d8: 0x0040, 0x8d9: 0x0040, 0x8da: 0x0040, 0x8db: 0x0040, 0x8dc: 0x0040, 0x8dd: 0x0008, 0x8de: 0x0008, 0x8df: 0x0040, 0x8e0: 0x0008, 0x8e1: 0x0008, 0x8e2: 0x3308, 0x8e3: 0x3308, 0x8e4: 0x0040, 0x8e5: 0x0040, 0x8e6: 0x0008, 0x8e7: 0x0008, 0x8e8: 0x0008, 0x8e9: 0x0008, 0x8ea: 0x0008, 0x8eb: 0x0008, 0x8ec: 0x0008, 0x8ed: 0x0008, 0x8ee: 0x0008, 0x8ef: 0x0008, 0x8f0: 0x0040, 0x8f1: 0x0008, 0x8f2: 0x0008, 0x8f3: 0x3008, 0x8f4: 0x0040, 0x8f5: 0x0040, 0x8f6: 0x0040, 0x8f7: 0x0040, 0x8f8: 0x0040, 0x8f9: 0x0040, 0x8fa: 0x0040, 0x8fb: 0x0040, 0x8fc: 0x0040, 0x8fd: 0x0040, 0x8fe: 0x0040, 0x8ff: 0x0040, // Block 0x24, offset 0x900 0x900: 0x3008, 0x901: 0x3308, 0x902: 0x3308, 0x903: 0x3308, 0x904: 0x3308, 0x905: 0x0040, 0x906: 0x3008, 0x907: 0x3008, 0x908: 0x3008, 0x909: 0x0040, 0x90a: 0x3008, 0x90b: 0x3008, 0x90c: 0x3008, 0x90d: 0x3b08, 0x90e: 0x0008, 0x90f: 0x0018, 0x910: 0x0040, 0x911: 0x0040, 0x912: 0x0040, 0x913: 0x0040, 0x914: 0x0008, 0x915: 0x0008, 0x916: 0x0008, 0x917: 0x3008, 0x918: 0x0018, 0x919: 0x0018, 0x91a: 0x0018, 0x91b: 0x0018, 0x91c: 0x0018, 0x91d: 0x0018, 0x91e: 0x0018, 0x91f: 0x0008, 0x920: 0x0008, 0x921: 0x0008, 0x922: 0x3308, 0x923: 0x3308, 0x924: 0x0040, 0x925: 0x0040, 0x926: 0x0008, 0x927: 0x0008, 0x928: 0x0008, 0x929: 0x0008, 0x92a: 0x0008, 0x92b: 0x0008, 0x92c: 0x0008, 0x92d: 0x0008, 0x92e: 0x0008, 0x92f: 0x0008, 0x930: 0x0018, 0x931: 0x0018, 0x932: 0x0018, 0x933: 0x0018, 0x934: 0x0018, 0x935: 0x0018, 0x936: 0x0018, 0x937: 0x0018, 0x938: 0x0018, 0x939: 0x0018, 0x93a: 0x0008, 0x93b: 0x0008, 0x93c: 0x0008, 0x93d: 0x0008, 0x93e: 0x0008, 0x93f: 0x0008, // Block 0x25, offset 0x940 0x940: 0x0040, 0x941: 0x0008, 0x942: 0x0008, 0x943: 0x0040, 0x944: 0x0008, 0x945: 0x0040, 0x946: 0x0008, 0x947: 0x0008, 0x948: 0x0008, 0x949: 0x0008, 0x94a: 0x0008, 0x94b: 0x0040, 0x94c: 0x0008, 0x94d: 0x0008, 0x94e: 0x0008, 0x94f: 0x0008, 0x950: 0x0008, 0x951: 0x0008, 0x952: 0x0008, 0x953: 0x0008, 0x954: 0x0008, 0x955: 0x0008, 0x956: 0x0008, 0x957: 0x0008, 0x958: 0x0008, 0x959: 0x0008, 0x95a: 0x0008, 0x95b: 0x0008, 0x95c: 0x0008, 0x95d: 0x0008, 0x95e: 0x0008, 0x95f: 0x0008, 0x960: 0x0008, 0x961: 0x0008, 0x962: 0x0008, 0x963: 0x0008, 0x964: 0x0040, 0x965: 0x0008, 0x966: 0x0040, 0x967: 0x0008, 0x968: 0x0008, 0x969: 0x0008, 0x96a: 0x0008, 0x96b: 0x0008, 0x96c: 0x0008, 0x96d: 0x0008, 0x96e: 0x0008, 0x96f: 0x0008, 0x970: 0x0008, 0x971: 0x3308, 0x972: 0x0008, 0x973: 0x01f9, 0x974: 0x3308, 0x975: 0x3308, 0x976: 0x3308, 0x977: 0x3308, 0x978: 0x3308, 0x979: 0x3308, 0x97a: 0x3b08, 0x97b: 0x3308, 0x97c: 0x3308, 0x97d: 0x0008, 0x97e: 0x0040, 0x97f: 0x0040, // Block 0x26, offset 0x980 0x980: 0x0008, 0x981: 0x0008, 0x982: 0x0008, 0x983: 0x0211, 0x984: 0x0008, 0x985: 0x0008, 0x986: 0x0008, 0x987: 0x0008, 0x988: 0x0040, 0x989: 0x0008, 0x98a: 0x0008, 0x98b: 0x0008, 0x98c: 0x0008, 0x98d: 0x0219, 0x98e: 0x0008, 0x98f: 0x0008, 0x990: 0x0008, 0x991: 0x0008, 0x992: 0x0221, 0x993: 0x0008, 0x994: 0x0008, 0x995: 0x0008, 0x996: 0x0008, 0x997: 0x0229, 0x998: 0x0008, 0x999: 0x0008, 0x99a: 0x0008, 0x99b: 0x0008, 0x99c: 0x0231, 0x99d: 0x0008, 0x99e: 0x0008, 0x99f: 0x0008, 0x9a0: 0x0008, 0x9a1: 0x0008, 0x9a2: 0x0008, 0x9a3: 0x0008, 0x9a4: 0x0008, 0x9a5: 0x0008, 0x9a6: 0x0008, 0x9a7: 0x0008, 0x9a8: 0x0008, 0x9a9: 0x0239, 0x9aa: 0x0008, 0x9ab: 0x0008, 0x9ac: 0x0008, 0x9ad: 0x0040, 0x9ae: 0x0040, 0x9af: 0x0040, 0x9b0: 0x0040, 0x9b1: 0x3308, 0x9b2: 0x3308, 0x9b3: 0x0241, 0x9b4: 0x3308, 0x9b5: 0x0249, 0x9b6: 0x0251, 0x9b7: 0x0259, 0x9b8: 0x0261, 0x9b9: 0x0269, 0x9ba: 0x3308, 0x9bb: 0x3308, 0x9bc: 0x3308, 0x9bd: 0x3308, 0x9be: 0x3308, 0x9bf: 0x3008, // Block 0x27, offset 0x9c0 0x9c0: 0x3308, 0x9c1: 0x0271, 0x9c2: 0x3308, 0x9c3: 0x3308, 0x9c4: 0x3b08, 0x9c5: 0x0018, 0x9c6: 0x3308, 0x9c7: 0x3308, 0x9c8: 0x0008, 0x9c9: 0x0008, 0x9ca: 0x0008, 0x9cb: 0x0008, 0x9cc: 0x0008, 0x9cd: 0x3308, 0x9ce: 0x3308, 0x9cf: 0x3308, 0x9d0: 0x3308, 0x9d1: 0x3308, 0x9d2: 0x3308, 0x9d3: 0x0279, 0x9d4: 0x3308, 0x9d5: 0x3308, 0x9d6: 0x3308, 0x9d7: 0x3308, 0x9d8: 0x0040, 0x9d9: 0x3308, 0x9da: 0x3308, 0x9db: 0x3308, 0x9dc: 0x3308, 0x9dd: 0x0281, 0x9de: 0x3308, 0x9df: 0x3308, 0x9e0: 0x3308, 0x9e1: 0x3308, 0x9e2: 0x0289, 0x9e3: 0x3308, 0x9e4: 0x3308, 0x9e5: 0x3308, 0x9e6: 0x3308, 0x9e7: 0x0291, 0x9e8: 0x3308, 0x9e9: 0x3308, 0x9ea: 0x3308, 0x9eb: 0x3308, 0x9ec: 0x0299, 0x9ed: 0x3308, 0x9ee: 0x3308, 0x9ef: 0x3308, 0x9f0: 0x3308, 0x9f1: 0x3308, 0x9f2: 0x3308, 0x9f3: 0x3308, 0x9f4: 0x3308, 0x9f5: 0x3308, 0x9f6: 0x3308, 0x9f7: 0x3308, 0x9f8: 0x3308, 0x9f9: 0x02a1, 0x9fa: 0x3308, 0x9fb: 0x3308, 0x9fc: 0x3308, 0x9fd: 0x0040, 0x9fe: 0x0018, 0x9ff: 0x0018, // Block 0x28, offset 0xa00 0xa00: 0x0008, 0xa01: 0x0008, 0xa02: 0x0008, 0xa03: 0x0008, 0xa04: 0x0008, 0xa05: 0x0008, 0xa06: 0x0008, 0xa07: 0x0008, 0xa08: 0x0008, 0xa09: 0x0008, 0xa0a: 0x0008, 0xa0b: 0x0008, 0xa0c: 0x0008, 0xa0d: 0x0008, 0xa0e: 0x0008, 0xa0f: 0x0008, 0xa10: 0x0008, 0xa11: 0x0008, 0xa12: 0x0008, 0xa13: 0x0008, 0xa14: 0x0008, 0xa15: 0x0008, 0xa16: 0x0008, 0xa17: 0x0008, 0xa18: 0x0008, 0xa19: 0x0008, 0xa1a: 0x0008, 0xa1b: 0x0008, 0xa1c: 0x0008, 0xa1d: 0x0008, 0xa1e: 0x0008, 0xa1f: 0x0008, 0xa20: 0x0008, 0xa21: 0x0008, 0xa22: 0x0008, 0xa23: 0x0008, 0xa24: 0x0008, 0xa25: 0x0008, 0xa26: 0x0008, 0xa27: 0x0008, 0xa28: 0x0008, 0xa29: 0x0008, 0xa2a: 0x0008, 0xa2b: 0x0008, 0xa2c: 0x0019, 0xa2d: 0x02e1, 0xa2e: 0x02e9, 0xa2f: 0x0008, 0xa30: 0x02f1, 0xa31: 0x02f9, 0xa32: 0x0301, 0xa33: 0x0309, 0xa34: 0x00a9, 0xa35: 0x0311, 0xa36: 0x00b1, 0xa37: 0x0319, 0xa38: 0x0101, 0xa39: 0x0321, 0xa3a: 0x0329, 0xa3b: 0x0008, 0xa3c: 0x0051, 0xa3d: 0x0331, 0xa3e: 0x0339, 0xa3f: 0x00b9, // Block 0x29, offset 0xa40 0xa40: 0x0341, 0xa41: 0x0349, 0xa42: 0x00c1, 0xa43: 0x0019, 0xa44: 0x0351, 0xa45: 0x0359, 0xa46: 0x05b5, 0xa47: 0x02e9, 0xa48: 0x02f1, 0xa49: 0x02f9, 0xa4a: 0x0361, 0xa4b: 0x0369, 0xa4c: 0x0371, 0xa4d: 0x0309, 0xa4e: 0x0008, 0xa4f: 0x0319, 0xa50: 0x0321, 0xa51: 0x0379, 0xa52: 0x0051, 0xa53: 0x0381, 0xa54: 0x05cd, 0xa55: 0x05cd, 0xa56: 0x0339, 0xa57: 0x0341, 0xa58: 0x0349, 0xa59: 0x05b5, 0xa5a: 0x0389, 0xa5b: 0x0391, 0xa5c: 0x05e5, 0xa5d: 0x0399, 0xa5e: 0x03a1, 0xa5f: 0x03a9, 0xa60: 0x03b1, 0xa61: 0x03b9, 0xa62: 0x0311, 0xa63: 0x00b9, 0xa64: 0x0349, 0xa65: 0x0391, 0xa66: 0x0399, 0xa67: 0x03a1, 0xa68: 0x03c1, 0xa69: 0x03b1, 0xa6a: 0x03b9, 0xa6b: 0x0008, 0xa6c: 0x0008, 0xa6d: 0x0008, 0xa6e: 0x0008, 0xa6f: 0x0008, 0xa70: 0x0008, 0xa71: 0x0008, 0xa72: 0x0008, 0xa73: 0x0008, 0xa74: 0x0008, 0xa75: 0x0008, 0xa76: 0x0008, 0xa77: 0x0008, 0xa78: 0x03c9, 0xa79: 0x0008, 0xa7a: 0x0008, 0xa7b: 0x0008, 0xa7c: 0x0008, 0xa7d: 0x0008, 0xa7e: 0x0008, 0xa7f: 0x0008, // Block 0x2a, offset 0xa80 0xa80: 0x0008, 0xa81: 0x0008, 0xa82: 0x0008, 0xa83: 0x0008, 0xa84: 0x0008, 0xa85: 0x0008, 0xa86: 0x0008, 0xa87: 0x0008, 0xa88: 0x0008, 0xa89: 0x0008, 0xa8a: 0x0008, 0xa8b: 0x0008, 0xa8c: 0x0008, 0xa8d: 0x0008, 0xa8e: 0x0008, 0xa8f: 0x0008, 0xa90: 0x0008, 0xa91: 0x0008, 0xa92: 0x0008, 0xa93: 0x0008, 0xa94: 0x0008, 0xa95: 0x0008, 0xa96: 0x0008, 0xa97: 0x0008, 0xa98: 0x0008, 0xa99: 0x0008, 0xa9a: 0x0008, 0xa9b: 0x03d1, 0xa9c: 0x03d9, 0xa9d: 0x03e1, 0xa9e: 0x03e9, 0xa9f: 0x0371, 0xaa0: 0x03f1, 0xaa1: 0x03f9, 0xaa2: 0x0401, 0xaa3: 0x0409, 0xaa4: 0x0411, 0xaa5: 0x0419, 0xaa6: 0x0421, 0xaa7: 0x05fd, 0xaa8: 0x0429, 0xaa9: 0x0431, 0xaaa: 0xe17d, 0xaab: 0x0439, 0xaac: 0x0441, 0xaad: 0x0449, 0xaae: 0x0451, 0xaaf: 0x0459, 0xab0: 0x0461, 0xab1: 0x0469, 0xab2: 0x0471, 0xab3: 0x0479, 0xab4: 0x0481, 0xab5: 0x0489, 0xab6: 0x0491, 0xab7: 0x0499, 0xab8: 0x0615, 0xab9: 0x04a1, 0xaba: 0x04a9, 0xabb: 0x04b1, 0xabc: 0x04b9, 0xabd: 0x04c1, 0xabe: 0x04c9, 0xabf: 0x04d1, // Block 0x2b, offset 0xac0 0xac0: 0xe00d, 0xac1: 0x0008, 0xac2: 0xe00d, 0xac3: 0x0008, 0xac4: 0xe00d, 0xac5: 0x0008, 0xac6: 0xe00d, 0xac7: 0x0008, 0xac8: 0xe00d, 0xac9: 0x0008, 0xaca: 0xe00d, 0xacb: 0x0008, 0xacc: 0xe00d, 0xacd: 0x0008, 0xace: 0xe00d, 0xacf: 0x0008, 0xad0: 0xe00d, 0xad1: 0x0008, 0xad2: 0xe00d, 0xad3: 0x0008, 0xad4: 0xe00d, 0xad5: 0x0008, 0xad6: 0xe00d, 0xad7: 0x0008, 0xad8: 0xe00d, 0xad9: 0x0008, 0xada: 0xe00d, 0xadb: 0x0008, 0xadc: 0xe00d, 0xadd: 0x0008, 0xade: 0xe00d, 0xadf: 0x0008, 0xae0: 0xe00d, 0xae1: 0x0008, 0xae2: 0xe00d, 0xae3: 0x0008, 0xae4: 0xe00d, 0xae5: 0x0008, 0xae6: 0xe00d, 0xae7: 0x0008, 0xae8: 0xe00d, 0xae9: 0x0008, 0xaea: 0xe00d, 0xaeb: 0x0008, 0xaec: 0xe00d, 0xaed: 0x0008, 0xaee: 0xe00d, 0xaef: 0x0008, 0xaf0: 0xe00d, 0xaf1: 0x0008, 0xaf2: 0xe00d, 0xaf3: 0x0008, 0xaf4: 0xe00d, 0xaf5: 0x0008, 0xaf6: 0xe00d, 0xaf7: 0x0008, 0xaf8: 0xe00d, 0xaf9: 0x0008, 0xafa: 0xe00d, 0xafb: 0x0008, 0xafc: 0xe00d, 0xafd: 0x0008, 0xafe: 0xe00d, 0xaff: 0x0008, // Block 0x2c, offset 0xb00 0xb00: 0xe00d, 0xb01: 0x0008, 0xb02: 0xe00d, 0xb03: 0x0008, 0xb04: 0xe00d, 0xb05: 0x0008, 0xb06: 0xe00d, 0xb07: 0x0008, 0xb08: 0xe00d, 0xb09: 0x0008, 0xb0a: 0xe00d, 0xb0b: 0x0008, 0xb0c: 0xe00d, 0xb0d: 0x0008, 0xb0e: 0xe00d, 0xb0f: 0x0008, 0xb10: 0xe00d, 0xb11: 0x0008, 0xb12: 0xe00d, 0xb13: 0x0008, 0xb14: 0xe00d, 0xb15: 0x0008, 0xb16: 0x0008, 0xb17: 0x0008, 0xb18: 0x0008, 0xb19: 0x0008, 0xb1a: 0x062d, 0xb1b: 0x064d, 0xb1c: 0x0008, 0xb1d: 0x0008, 0xb1e: 0x04d9, 0xb1f: 0x0008, 0xb20: 0xe00d, 0xb21: 0x0008, 0xb22: 0xe00d, 0xb23: 0x0008, 0xb24: 0xe00d, 0xb25: 0x0008, 0xb26: 0xe00d, 0xb27: 0x0008, 0xb28: 0xe00d, 0xb29: 0x0008, 0xb2a: 0xe00d, 0xb2b: 0x0008, 0xb2c: 0xe00d, 0xb2d: 0x0008, 0xb2e: 0xe00d, 0xb2f: 0x0008, 0xb30: 0xe00d, 0xb31: 0x0008, 0xb32: 0xe00d, 0xb33: 0x0008, 0xb34: 0xe00d, 0xb35: 0x0008, 0xb36: 0xe00d, 0xb37: 0x0008, 0xb38: 0xe00d, 0xb39: 0x0008, 0xb3a: 0xe00d, 0xb3b: 0x0008, 0xb3c: 0xe00d, 0xb3d: 0x0008, 0xb3e: 0xe00d, 0xb3f: 0x0008, // Block 0x2d, offset 0xb40 0xb40: 0x0008, 0xb41: 0x0008, 0xb42: 0x0008, 0xb43: 0x0008, 0xb44: 0x0008, 0xb45: 0x0008, 0xb46: 0x0040, 0xb47: 0x0040, 0xb48: 0xe045, 0xb49: 0xe045, 0xb4a: 0xe045, 0xb4b: 0xe045, 0xb4c: 0xe045, 0xb4d: 0xe045, 0xb4e: 0x0040, 0xb4f: 0x0040, 0xb50: 0x0008, 0xb51: 0x0008, 0xb52: 0x0008, 0xb53: 0x0008, 0xb54: 0x0008, 0xb55: 0x0008, 0xb56: 0x0008, 0xb57: 0x0008, 0xb58: 0x0040, 0xb59: 0xe045, 0xb5a: 0x0040, 0xb5b: 0xe045, 0xb5c: 0x0040, 0xb5d: 0xe045, 0xb5e: 0x0040, 0xb5f: 0xe045, 0xb60: 0x0008, 0xb61: 0x0008, 0xb62: 0x0008, 0xb63: 0x0008, 0xb64: 0x0008, 0xb65: 0x0008, 0xb66: 0x0008, 0xb67: 0x0008, 0xb68: 0xe045, 0xb69: 0xe045, 0xb6a: 0xe045, 0xb6b: 0xe045, 0xb6c: 0xe045, 0xb6d: 0xe045, 0xb6e: 0xe045, 0xb6f: 0xe045, 0xb70: 0x0008, 0xb71: 0x04e1, 0xb72: 0x0008, 0xb73: 0x04e9, 0xb74: 0x0008, 0xb75: 0x04f1, 0xb76: 0x0008, 0xb77: 0x04f9, 0xb78: 0x0008, 0xb79: 0x0501, 0xb7a: 0x0008, 0xb7b: 0x0509, 0xb7c: 0x0008, 0xb7d: 0x0511, 0xb7e: 0x0040, 0xb7f: 0x0040, // Block 0x2e, offset 0xb80 0xb80: 0x0519, 0xb81: 0x0521, 0xb82: 0x0529, 0xb83: 0x0531, 0xb84: 0x0539, 0xb85: 0x0541, 0xb86: 0x0549, 0xb87: 0x0551, 0xb88: 0x0519, 0xb89: 0x0521, 0xb8a: 0x0529, 0xb8b: 0x0531, 0xb8c: 0x0539, 0xb8d: 0x0541, 0xb8e: 0x0549, 0xb8f: 0x0551, 0xb90: 0x0559, 0xb91: 0x0561, 0xb92: 0x0569, 0xb93: 0x0571, 0xb94: 0x0579, 0xb95: 0x0581, 0xb96: 0x0589, 0xb97: 0x0591, 0xb98: 0x0559, 0xb99: 0x0561, 0xb9a: 0x0569, 0xb9b: 0x0571, 0xb9c: 0x0579, 0xb9d: 0x0581, 0xb9e: 0x0589, 0xb9f: 0x0591, 0xba0: 0x0599, 0xba1: 0x05a1, 0xba2: 0x05a9, 0xba3: 0x05b1, 0xba4: 0x05b9, 0xba5: 0x05c1, 0xba6: 0x05c9, 0xba7: 0x05d1, 0xba8: 0x0599, 0xba9: 0x05a1, 0xbaa: 0x05a9, 0xbab: 0x05b1, 0xbac: 0x05b9, 0xbad: 0x05c1, 0xbae: 0x05c9, 0xbaf: 0x05d1, 0xbb0: 0x0008, 0xbb1: 0x0008, 0xbb2: 0x05d9, 0xbb3: 0x05e1, 0xbb4: 0x05e9, 0xbb5: 0x0040, 0xbb6: 0x0008, 0xbb7: 0x05f1, 0xbb8: 0xe045, 0xbb9: 0xe045, 0xbba: 0x0665, 0xbbb: 0x04e1, 0xbbc: 0x05e1, 0xbbd: 0x067e, 0xbbe: 0x05f9, 0xbbf: 0x069e, // Block 0x2f, offset 0xbc0 0xbc0: 0x06be, 0xbc1: 0x0602, 0xbc2: 0x0609, 0xbc3: 0x0611, 0xbc4: 0x0619, 0xbc5: 0x0040, 0xbc6: 0x0008, 0xbc7: 0x0621, 0xbc8: 0x06dd, 0xbc9: 0x04e9, 0xbca: 0x06f5, 0xbcb: 0x04f1, 0xbcc: 0x0611, 0xbcd: 0x062a, 0xbce: 0x0632, 0xbcf: 0x063a, 0xbd0: 0x0008, 0xbd1: 0x0008, 0xbd2: 0x0008, 0xbd3: 0x0641, 0xbd4: 0x0040, 0xbd5: 0x0040, 0xbd6: 0x0008, 0xbd7: 0x0008, 0xbd8: 0xe045, 0xbd9: 0xe045, 0xbda: 0x070d, 0xbdb: 0x04f9, 0xbdc: 0x0040, 0xbdd: 0x064a, 0xbde: 0x0652, 0xbdf: 0x065a, 0xbe0: 0x0008, 0xbe1: 0x0008, 0xbe2: 0x0008, 0xbe3: 0x0661, 0xbe4: 0x0008, 0xbe5: 0x0008, 0xbe6: 0x0008, 0xbe7: 0x0008, 0xbe8: 0xe045, 0xbe9: 0xe045, 0xbea: 0x0725, 0xbeb: 0x0509, 0xbec: 0xe04d, 0xbed: 0x066a, 0xbee: 0x012a, 0xbef: 0x0672, 0xbf0: 0x0040, 0xbf1: 0x0040, 0xbf2: 0x0679, 0xbf3: 0x0681, 0xbf4: 0x0689, 0xbf5: 0x0040, 0xbf6: 0x0008, 0xbf7: 0x0691, 0xbf8: 0x073d, 0xbf9: 0x0501, 0xbfa: 0x0515, 0xbfb: 0x0511, 0xbfc: 0x0681, 0xbfd: 0x0756, 0xbfe: 0x0776, 0xbff: 0x0040, // Block 0x30, offset 0xc00 0xc00: 0x000a, 0xc01: 0x000a, 0xc02: 0x000a, 0xc03: 0x000a, 0xc04: 0x000a, 0xc05: 0x000a, 0xc06: 0x000a, 0xc07: 0x000a, 0xc08: 0x000a, 0xc09: 0x000a, 0xc0a: 0x000a, 0xc0b: 0x03c0, 0xc0c: 0x0003, 0xc0d: 0x0003, 0xc0e: 0x0340, 0xc0f: 0x0b40, 0xc10: 0x0018, 0xc11: 0xe00d, 0xc12: 0x0018, 0xc13: 0x0018, 0xc14: 0x0018, 0xc15: 0x0018, 0xc16: 0x0018, 0xc17: 0x0796, 0xc18: 0x0018, 0xc19: 0x0018, 0xc1a: 0x0018, 0xc1b: 0x0018, 0xc1c: 0x0018, 0xc1d: 0x0018, 0xc1e: 0x0018, 0xc1f: 0x0018, 0xc20: 0x0018, 0xc21: 0x0018, 0xc22: 0x0018, 0xc23: 0x0018, 0xc24: 0x0040, 0xc25: 0x0040, 0xc26: 0x0040, 0xc27: 0x0018, 0xc28: 0x0040, 0xc29: 0x0040, 0xc2a: 0x0340, 0xc2b: 0x0340, 0xc2c: 0x0340, 0xc2d: 0x0340, 0xc2e: 0x0340, 0xc2f: 0x000a, 0xc30: 0x0018, 0xc31: 0x0018, 0xc32: 0x0018, 0xc33: 0x0699, 0xc34: 0x06a1, 0xc35: 0x0018, 0xc36: 0x06a9, 0xc37: 0x06b1, 0xc38: 0x0018, 0xc39: 0x0018, 0xc3a: 0x0018, 0xc3b: 0x0018, 0xc3c: 0x06ba, 0xc3d: 0x0018, 0xc3e: 0x07b6, 0xc3f: 0x0018, // Block 0x31, offset 0xc40 0xc40: 0x0018, 0xc41: 0x0018, 0xc42: 0x0018, 0xc43: 0x0018, 0xc44: 0x0018, 0xc45: 0x0018, 0xc46: 0x0018, 0xc47: 0x06c2, 0xc48: 0x06ca, 0xc49: 0x06d2, 0xc4a: 0x0018, 0xc4b: 0x0018, 0xc4c: 0x0018, 0xc4d: 0x0018, 0xc4e: 0x0018, 0xc4f: 0x0018, 0xc50: 0x0018, 0xc51: 0x0018, 0xc52: 0x0018, 0xc53: 0x0018, 0xc54: 0x0018, 0xc55: 0x0018, 0xc56: 0x0018, 0xc57: 0x06d9, 0xc58: 0x0018, 0xc59: 0x0018, 0xc5a: 0x0018, 0xc5b: 0x0018, 0xc5c: 0x0018, 0xc5d: 0x0018, 0xc5e: 0x0018, 0xc5f: 0x000a, 0xc60: 0x03c0, 0xc61: 0x0340, 0xc62: 0x0340, 0xc63: 0x0340, 0xc64: 0x03c0, 0xc65: 0x0040, 0xc66: 0x0040, 0xc67: 0x0040, 0xc68: 0x0040, 0xc69: 0x0040, 0xc6a: 0x0340, 0xc6b: 0x0340, 0xc6c: 0x0340, 0xc6d: 0x0340, 0xc6e: 0x0340, 0xc6f: 0x0340, 0xc70: 0x06e1, 0xc71: 0x0311, 0xc72: 0x0040, 0xc73: 0x0040, 0xc74: 0x06e9, 0xc75: 0x06f1, 0xc76: 0x06f9, 0xc77: 0x0701, 0xc78: 0x0709, 0xc79: 0x0711, 0xc7a: 0x071a, 0xc7b: 0x07d5, 0xc7c: 0x0722, 0xc7d: 0x072a, 0xc7e: 0x0732, 0xc7f: 0x0329, // Block 0x32, offset 0xc80 0xc80: 0x06e1, 0xc81: 0x0049, 0xc82: 0x0029, 0xc83: 0x0031, 0xc84: 0x06e9, 0xc85: 0x06f1, 0xc86: 0x06f9, 0xc87: 0x0701, 0xc88: 0x0709, 0xc89: 0x0711, 0xc8a: 0x071a, 0xc8b: 0x07ed, 0xc8c: 0x0722, 0xc8d: 0x072a, 0xc8e: 0x0732, 0xc8f: 0x0040, 0xc90: 0x0019, 0xc91: 0x02f9, 0xc92: 0x0051, 0xc93: 0x0109, 0xc94: 0x0361, 0xc95: 0x00a9, 0xc96: 0x0319, 0xc97: 0x0101, 0xc98: 0x0321, 0xc99: 0x0329, 0xc9a: 0x0339, 0xc9b: 0x0089, 0xc9c: 0x0341, 0xc9d: 0x0040, 0xc9e: 0x0040, 0xc9f: 0x0040, 0xca0: 0x0018, 0xca1: 0x0018, 0xca2: 0x0018, 0xca3: 0x0018, 0xca4: 0x0018, 0xca5: 0x0018, 0xca6: 0x0018, 0xca7: 0x0018, 0xca8: 0x0739, 0xca9: 0x0018, 0xcaa: 0x0018, 0xcab: 0x0018, 0xcac: 0x0018, 0xcad: 0x0018, 0xcae: 0x0018, 0xcaf: 0x0018, 0xcb0: 0x0018, 0xcb1: 0x0018, 0xcb2: 0x0018, 0xcb3: 0x0018, 0xcb4: 0x0018, 0xcb5: 0x0018, 0xcb6: 0x0018, 0xcb7: 0x0018, 0xcb8: 0x0018, 0xcb9: 0x0018, 0xcba: 0x0018, 0xcbb: 0x0018, 0xcbc: 0x0018, 0xcbd: 0x0018, 0xcbe: 0x0018, 0xcbf: 0x0018, // Block 0x33, offset 0xcc0 0xcc0: 0x0806, 0xcc1: 0x0826, 0xcc2: 0x03d9, 0xcc3: 0x0845, 0xcc4: 0x0018, 0xcc5: 0x0866, 0xcc6: 0x0886, 0xcc7: 0x0369, 0xcc8: 0x0018, 0xcc9: 0x08a5, 0xcca: 0x0309, 0xccb: 0x00a9, 0xccc: 0x00a9, 0xccd: 0x00a9, 0xcce: 0x00a9, 0xccf: 0x0741, 0xcd0: 0x0311, 0xcd1: 0x0311, 0xcd2: 0x0101, 0xcd3: 0x0101, 0xcd4: 0x0018, 0xcd5: 0x0329, 0xcd6: 0x0749, 0xcd7: 0x0018, 0xcd8: 0x0018, 0xcd9: 0x0339, 0xcda: 0x0751, 0xcdb: 0x00b9, 0xcdc: 0x00b9, 0xcdd: 0x00b9, 0xcde: 0x0018, 0xcdf: 0x0018, 0xce0: 0x0759, 0xce1: 0x08c5, 0xce2: 0x0761, 0xce3: 0x0018, 0xce4: 0x04b1, 0xce5: 0x0018, 0xce6: 0x0769, 0xce7: 0x0018, 0xce8: 0x04b1, 0xce9: 0x0018, 0xcea: 0x0319, 0xceb: 0x0771, 0xcec: 0x02e9, 0xced: 0x03d9, 0xcee: 0x0018, 0xcef: 0x02f9, 0xcf0: 0x02f9, 0xcf1: 0x03f1, 0xcf2: 0x0040, 0xcf3: 0x0321, 0xcf4: 0x0051, 0xcf5: 0x0779, 0xcf6: 0x0781, 0xcf7: 0x0789, 0xcf8: 0x0791, 0xcf9: 0x0311, 0xcfa: 0x0018, 0xcfb: 0x08e5, 0xcfc: 0x0799, 0xcfd: 0x03a1, 0xcfe: 0x03a1, 0xcff: 0x0799, // Block 0x34, offset 0xd00 0xd00: 0x0905, 0xd01: 0x0018, 0xd02: 0x0018, 0xd03: 0x0018, 0xd04: 0x0018, 0xd05: 0x02f1, 0xd06: 0x02f1, 0xd07: 0x02f9, 0xd08: 0x0311, 0xd09: 0x00b1, 0xd0a: 0x0018, 0xd0b: 0x0018, 0xd0c: 0x0018, 0xd0d: 0x0018, 0xd0e: 0x0008, 0xd0f: 0x0018, 0xd10: 0x07a1, 0xd11: 0x07a9, 0xd12: 0x07b1, 0xd13: 0x07b9, 0xd14: 0x07c1, 0xd15: 0x07c9, 0xd16: 0x07d1, 0xd17: 0x07d9, 0xd18: 0x07e1, 0xd19: 0x07e9, 0xd1a: 0x07f1, 0xd1b: 0x07f9, 0xd1c: 0x0801, 0xd1d: 0x0809, 0xd1e: 0x0811, 0xd1f: 0x0819, 0xd20: 0x0311, 0xd21: 0x0821, 0xd22: 0x091d, 0xd23: 0x0829, 0xd24: 0x0391, 0xd25: 0x0831, 0xd26: 0x093d, 0xd27: 0x0839, 0xd28: 0x0841, 0xd29: 0x0109, 0xd2a: 0x0849, 0xd2b: 0x095d, 0xd2c: 0x0101, 0xd2d: 0x03d9, 0xd2e: 0x02f1, 0xd2f: 0x0321, 0xd30: 0x0311, 0xd31: 0x0821, 0xd32: 0x097d, 0xd33: 0x0829, 0xd34: 0x0391, 0xd35: 0x0831, 0xd36: 0x099d, 0xd37: 0x0839, 0xd38: 0x0841, 0xd39: 0x0109, 0xd3a: 0x0849, 0xd3b: 0x09bd, 0xd3c: 0x0101, 0xd3d: 0x03d9, 0xd3e: 0x02f1, 0xd3f: 0x0321, // Block 0x35, offset 0xd40 0xd40: 0x0018, 0xd41: 0x0018, 0xd42: 0x0018, 0xd43: 0x0018, 0xd44: 0x0018, 0xd45: 0x0018, 0xd46: 0x0018, 0xd47: 0x0018, 0xd48: 0x0018, 0xd49: 0x0018, 0xd4a: 0x0018, 0xd4b: 0x0040, 0xd4c: 0x0040, 0xd4d: 0x0040, 0xd4e: 0x0040, 0xd4f: 0x0040, 0xd50: 0x0040, 0xd51: 0x0040, 0xd52: 0x0040, 0xd53: 0x0040, 0xd54: 0x0040, 0xd55: 0x0040, 0xd56: 0x0040, 0xd57: 0x0040, 0xd58: 0x0040, 0xd59: 0x0040, 0xd5a: 0x0040, 0xd5b: 0x0040, 0xd5c: 0x0040, 0xd5d: 0x0040, 0xd5e: 0x0040, 0xd5f: 0x0040, 0xd60: 0x0049, 0xd61: 0x0029, 0xd62: 0x0031, 0xd63: 0x06e9, 0xd64: 0x06f1, 0xd65: 0x06f9, 0xd66: 0x0701, 0xd67: 0x0709, 0xd68: 0x0711, 0xd69: 0x0879, 0xd6a: 0x0881, 0xd6b: 0x0889, 0xd6c: 0x0891, 0xd6d: 0x0899, 0xd6e: 0x08a1, 0xd6f: 0x08a9, 0xd70: 0x08b1, 0xd71: 0x08b9, 0xd72: 0x08c1, 0xd73: 0x08c9, 0xd74: 0x0a1e, 0xd75: 0x0a3e, 0xd76: 0x0a5e, 0xd77: 0x0a7e, 0xd78: 0x0a9e, 0xd79: 0x0abe, 0xd7a: 0x0ade, 0xd7b: 0x0afe, 0xd7c: 0x0b1e, 0xd7d: 0x08d2, 0xd7e: 0x08da, 0xd7f: 0x08e2, // Block 0x36, offset 0xd80 0xd80: 0x08ea, 0xd81: 0x08f2, 0xd82: 0x08fa, 0xd83: 0x0902, 0xd84: 0x090a, 0xd85: 0x0912, 0xd86: 0x091a, 0xd87: 0x0922, 0xd88: 0x0040, 0xd89: 0x0040, 0xd8a: 0x0040, 0xd8b: 0x0040, 0xd8c: 0x0040, 0xd8d: 0x0040, 0xd8e: 0x0040, 0xd8f: 0x0040, 0xd90: 0x0040, 0xd91: 0x0040, 0xd92: 0x0040, 0xd93: 0x0040, 0xd94: 0x0040, 0xd95: 0x0040, 0xd96: 0x0040, 0xd97: 0x0040, 0xd98: 0x0040, 0xd99: 0x0040, 0xd9a: 0x0040, 0xd9b: 0x0040, 0xd9c: 0x0b3e, 0xd9d: 0x0b5e, 0xd9e: 0x0b7e, 0xd9f: 0x0b9e, 0xda0: 0x0bbe, 0xda1: 0x0bde, 0xda2: 0x0bfe, 0xda3: 0x0c1e, 0xda4: 0x0c3e, 0xda5: 0x0c5e, 0xda6: 0x0c7e, 0xda7: 0x0c9e, 0xda8: 0x0cbe, 0xda9: 0x0cde, 0xdaa: 0x0cfe, 0xdab: 0x0d1e, 0xdac: 0x0d3e, 0xdad: 0x0d5e, 0xdae: 0x0d7e, 0xdaf: 0x0d9e, 0xdb0: 0x0dbe, 0xdb1: 0x0dde, 0xdb2: 0x0dfe, 0xdb3: 0x0e1e, 0xdb4: 0x0e3e, 0xdb5: 0x0e5e, 0xdb6: 0x0019, 0xdb7: 0x02e9, 0xdb8: 0x03d9, 0xdb9: 0x02f1, 0xdba: 0x02f9, 0xdbb: 0x03f1, 0xdbc: 0x0309, 0xdbd: 0x00a9, 0xdbe: 0x0311, 0xdbf: 0x00b1, // Block 0x37, offset 0xdc0 0xdc0: 0x0319, 0xdc1: 0x0101, 0xdc2: 0x0321, 0xdc3: 0x0329, 0xdc4: 0x0051, 0xdc5: 0x0339, 0xdc6: 0x0751, 0xdc7: 0x00b9, 0xdc8: 0x0089, 0xdc9: 0x0341, 0xdca: 0x0349, 0xdcb: 0x0391, 0xdcc: 0x00c1, 0xdcd: 0x0109, 0xdce: 0x00c9, 0xdcf: 0x04b1, 0xdd0: 0x0019, 0xdd1: 0x02e9, 0xdd2: 0x03d9, 0xdd3: 0x02f1, 0xdd4: 0x02f9, 0xdd5: 0x03f1, 0xdd6: 0x0309, 0xdd7: 0x00a9, 0xdd8: 0x0311, 0xdd9: 0x00b1, 0xdda: 0x0319, 0xddb: 0x0101, 0xddc: 0x0321, 0xddd: 0x0329, 0xdde: 0x0051, 0xddf: 0x0339, 0xde0: 0x0751, 0xde1: 0x00b9, 0xde2: 0x0089, 0xde3: 0x0341, 0xde4: 0x0349, 0xde5: 0x0391, 0xde6: 0x00c1, 0xde7: 0x0109, 0xde8: 0x00c9, 0xde9: 0x04b1, 0xdea: 0x06e1, 0xdeb: 0x0018, 0xdec: 0x0018, 0xded: 0x0018, 0xdee: 0x0018, 0xdef: 0x0018, 0xdf0: 0x0018, 0xdf1: 0x0018, 0xdf2: 0x0018, 0xdf3: 0x0018, 0xdf4: 0x0018, 0xdf5: 0x0018, 0xdf6: 0x0018, 0xdf7: 0x0018, 0xdf8: 0x0018, 0xdf9: 0x0018, 0xdfa: 0x0018, 0xdfb: 0x0018, 0xdfc: 0x0018, 0xdfd: 0x0018, 0xdfe: 0x0018, 0xdff: 0x0018, // Block 0x38, offset 0xe00 0xe00: 0x0008, 0xe01: 0x0008, 0xe02: 0x0008, 0xe03: 0x0008, 0xe04: 0x0008, 0xe05: 0x0008, 0xe06: 0x0008, 0xe07: 0x0008, 0xe08: 0x0008, 0xe09: 0x0008, 0xe0a: 0x0008, 0xe0b: 0x0008, 0xe0c: 0x0008, 0xe0d: 0x0008, 0xe0e: 0x0008, 0xe0f: 0x0008, 0xe10: 0x0008, 0xe11: 0x0008, 0xe12: 0x0008, 0xe13: 0x0008, 0xe14: 0x0008, 0xe15: 0x0008, 0xe16: 0x0008, 0xe17: 0x0008, 0xe18: 0x0008, 0xe19: 0x0008, 0xe1a: 0x0008, 0xe1b: 0x0008, 0xe1c: 0x0008, 0xe1d: 0x0008, 0xe1e: 0x0008, 0xe1f: 0x0008, 0xe20: 0xe00d, 0xe21: 0x0008, 0xe22: 0x0941, 0xe23: 0x0ed5, 0xe24: 0x0949, 0xe25: 0x0008, 0xe26: 0x0008, 0xe27: 0xe07d, 0xe28: 0x0008, 0xe29: 0xe01d, 0xe2a: 0x0008, 0xe2b: 0xe03d, 0xe2c: 0x0008, 0xe2d: 0x0359, 0xe2e: 0x0441, 0xe2f: 0x0351, 0xe30: 0x03d1, 0xe31: 0x0008, 0xe32: 0xe00d, 0xe33: 0x0008, 0xe34: 0x0008, 0xe35: 0xe01d, 0xe36: 0x0008, 0xe37: 0x0008, 0xe38: 0x0008, 0xe39: 0x0008, 0xe3a: 0x0008, 0xe3b: 0x0008, 0xe3c: 0x00b1, 0xe3d: 0x0391, 0xe3e: 0x0951, 0xe3f: 0x0959, // Block 0x39, offset 0xe40 0xe40: 0xe00d, 0xe41: 0x0008, 0xe42: 0xe00d, 0xe43: 0x0008, 0xe44: 0xe00d, 0xe45: 0x0008, 0xe46: 0xe00d, 0xe47: 0x0008, 0xe48: 0xe00d, 0xe49: 0x0008, 0xe4a: 0xe00d, 0xe4b: 0x0008, 0xe4c: 0xe00d, 0xe4d: 0x0008, 0xe4e: 0xe00d, 0xe4f: 0x0008, 0xe50: 0xe00d, 0xe51: 0x0008, 0xe52: 0xe00d, 0xe53: 0x0008, 0xe54: 0xe00d, 0xe55: 0x0008, 0xe56: 0xe00d, 0xe57: 0x0008, 0xe58: 0xe00d, 0xe59: 0x0008, 0xe5a: 0xe00d, 0xe5b: 0x0008, 0xe5c: 0xe00d, 0xe5d: 0x0008, 0xe5e: 0xe00d, 0xe5f: 0x0008, 0xe60: 0xe00d, 0xe61: 0x0008, 0xe62: 0xe00d, 0xe63: 0x0008, 0xe64: 0x0008, 0xe65: 0x0018, 0xe66: 0x0018, 0xe67: 0x0018, 0xe68: 0x0018, 0xe69: 0x0018, 0xe6a: 0x0018, 0xe6b: 0xe03d, 0xe6c: 0x0008, 0xe6d: 0xe01d, 0xe6e: 0x0008, 0xe6f: 0x3308, 0xe70: 0x3308, 0xe71: 0x3308, 0xe72: 0xe00d, 0xe73: 0x0008, 0xe74: 0x0040, 0xe75: 0x0040, 0xe76: 0x0040, 0xe77: 0x0040, 0xe78: 0x0040, 0xe79: 0x0018, 0xe7a: 0x0018, 0xe7b: 0x0018, 0xe7c: 0x0018, 0xe7d: 0x0018, 0xe7e: 0x0018, 0xe7f: 0x0018, // Block 0x3a, offset 0xe80 0xe80: 0x2715, 0xe81: 0x2735, 0xe82: 0x2755, 0xe83: 0x2775, 0xe84: 0x2795, 0xe85: 0x27b5, 0xe86: 0x27d5, 0xe87: 0x27f5, 0xe88: 0x2815, 0xe89: 0x2835, 0xe8a: 0x2855, 0xe8b: 0x2875, 0xe8c: 0x2895, 0xe8d: 0x28b5, 0xe8e: 0x28d5, 0xe8f: 0x28f5, 0xe90: 0x2915, 0xe91: 0x2935, 0xe92: 0x2955, 0xe93: 0x2975, 0xe94: 0x2995, 0xe95: 0x29b5, 0xe96: 0x0040, 0xe97: 0x0040, 0xe98: 0x0040, 0xe99: 0x0040, 0xe9a: 0x0040, 0xe9b: 0x0040, 0xe9c: 0x0040, 0xe9d: 0x0040, 0xe9e: 0x0040, 0xe9f: 0x0040, 0xea0: 0x0040, 0xea1: 0x0040, 0xea2: 0x0040, 0xea3: 0x0040, 0xea4: 0x0040, 0xea5: 0x0040, 0xea6: 0x0040, 0xea7: 0x0040, 0xea8: 0x0040, 0xea9: 0x0040, 0xeaa: 0x0040, 0xeab: 0x0040, 0xeac: 0x0040, 0xead: 0x0040, 0xeae: 0x0040, 0xeaf: 0x0040, 0xeb0: 0x0040, 0xeb1: 0x0040, 0xeb2: 0x0040, 0xeb3: 0x0040, 0xeb4: 0x0040, 0xeb5: 0x0040, 0xeb6: 0x0040, 0xeb7: 0x0040, 0xeb8: 0x0040, 0xeb9: 0x0040, 0xeba: 0x0040, 0xebb: 0x0040, 0xebc: 0x0040, 0xebd: 0x0040, 0xebe: 0x0040, 0xebf: 0x0040, // Block 0x3b, offset 0xec0 0xec0: 0x000a, 0xec1: 0x0018, 0xec2: 0x0961, 0xec3: 0x0018, 0xec4: 0x0018, 0xec5: 0x0008, 0xec6: 0x0008, 0xec7: 0x0008, 0xec8: 0x0018, 0xec9: 0x0018, 0xeca: 0x0018, 0xecb: 0x0018, 0xecc: 0x0018, 0xecd: 0x0018, 0xece: 0x0018, 0xecf: 0x0018, 0xed0: 0x0018, 0xed1: 0x0018, 0xed2: 0x0018, 0xed3: 0x0018, 0xed4: 0x0018, 0xed5: 0x0018, 0xed6: 0x0018, 0xed7: 0x0018, 0xed8: 0x0018, 0xed9: 0x0018, 0xeda: 0x0018, 0xedb: 0x0018, 0xedc: 0x0018, 0xedd: 0x0018, 0xede: 0x0018, 0xedf: 0x0018, 0xee0: 0x0018, 0xee1: 0x0018, 0xee2: 0x0018, 0xee3: 0x0018, 0xee4: 0x0018, 0xee5: 0x0018, 0xee6: 0x0018, 0xee7: 0x0018, 0xee8: 0x0018, 0xee9: 0x0018, 0xeea: 0x3308, 0xeeb: 0x3308, 0xeec: 0x3308, 0xeed: 0x3308, 0xeee: 0x3018, 0xeef: 0x3018, 0xef0: 0x0018, 0xef1: 0x0018, 0xef2: 0x0018, 0xef3: 0x0018, 0xef4: 0x0018, 0xef5: 0x0018, 0xef6: 0xe125, 0xef7: 0x0018, 0xef8: 0x29d5, 0xef9: 0x29f5, 0xefa: 0x2a15, 0xefb: 0x0018, 0xefc: 0x0008, 0xefd: 0x0018, 0xefe: 0x0018, 0xeff: 0x0018, // Block 0x3c, offset 0xf00 0xf00: 0x2b55, 0xf01: 0x2b75, 0xf02: 0x2b95, 0xf03: 0x2bb5, 0xf04: 0x2bd5, 0xf05: 0x2bf5, 0xf06: 0x2bf5, 0xf07: 0x2bf5, 0xf08: 0x2c15, 0xf09: 0x2c15, 0xf0a: 0x2c15, 0xf0b: 0x2c15, 0xf0c: 0x2c35, 0xf0d: 0x2c35, 0xf0e: 0x2c35, 0xf0f: 0x2c55, 0xf10: 0x2c75, 0xf11: 0x2c75, 0xf12: 0x2a95, 0xf13: 0x2a95, 0xf14: 0x2c75, 0xf15: 0x2c75, 0xf16: 0x2c95, 0xf17: 0x2c95, 0xf18: 0x2c75, 0xf19: 0x2c75, 0xf1a: 0x2a95, 0xf1b: 0x2a95, 0xf1c: 0x2c75, 0xf1d: 0x2c75, 0xf1e: 0x2c55, 0xf1f: 0x2c55, 0xf20: 0x2cb5, 0xf21: 0x2cb5, 0xf22: 0x2cd5, 0xf23: 0x2cd5, 0xf24: 0x0040, 0xf25: 0x2cf5, 0xf26: 0x2d15, 0xf27: 0x2d35, 0xf28: 0x2d35, 0xf29: 0x2d55, 0xf2a: 0x2d75, 0xf2b: 0x2d95, 0xf2c: 0x2db5, 0xf2d: 0x2dd5, 0xf2e: 0x2df5, 0xf2f: 0x2e15, 0xf30: 0x2e35, 0xf31: 0x2e55, 0xf32: 0x2e55, 0xf33: 0x2e75, 0xf34: 0x2e95, 0xf35: 0x2e95, 0xf36: 0x2eb5, 0xf37: 0x2ed5, 0xf38: 0x2e75, 0xf39: 0x2ef5, 0xf3a: 0x2f15, 0xf3b: 0x2ef5, 0xf3c: 0x2e75, 0xf3d: 0x2f35, 0xf3e: 0x2f55, 0xf3f: 0x2f75, // Block 0x3d, offset 0xf40 0xf40: 0x2f95, 0xf41: 0x2fb5, 0xf42: 0x2d15, 0xf43: 0x2cf5, 0xf44: 0x2fd5, 0xf45: 0x2ff5, 0xf46: 0x3015, 0xf47: 0x3035, 0xf48: 0x3055, 0xf49: 0x3075, 0xf4a: 0x3095, 0xf4b: 0x30b5, 0xf4c: 0x30d5, 0xf4d: 0x30f5, 0xf4e: 0x3115, 0xf4f: 0x0040, 0xf50: 0x0018, 0xf51: 0x0018, 0xf52: 0x3135, 0xf53: 0x3155, 0xf54: 0x3175, 0xf55: 0x3195, 0xf56: 0x31b5, 0xf57: 0x31d5, 0xf58: 0x31f5, 0xf59: 0x3215, 0xf5a: 0x3235, 0xf5b: 0x3255, 0xf5c: 0x3175, 0xf5d: 0x3275, 0xf5e: 0x3295, 0xf5f: 0x32b5, 0xf60: 0x0008, 0xf61: 0x0008, 0xf62: 0x0008, 0xf63: 0x0008, 0xf64: 0x0008, 0xf65: 0x0008, 0xf66: 0x0008, 0xf67: 0x0008, 0xf68: 0x0008, 0xf69: 0x0008, 0xf6a: 0x0008, 0xf6b: 0x0008, 0xf6c: 0x0008, 0xf6d: 0x0008, 0xf6e: 0x0008, 0xf6f: 0x0008, 0xf70: 0x0008, 0xf71: 0x0008, 0xf72: 0x0008, 0xf73: 0x0008, 0xf74: 0x0008, 0xf75: 0x0008, 0xf76: 0x0008, 0xf77: 0x0008, 0xf78: 0x0008, 0xf79: 0x0008, 0xf7a: 0x0008, 0xf7b: 0x0008, 0xf7c: 0x0008, 0xf7d: 0x0008, 0xf7e: 0x0008, 0xf7f: 0x0008, // Block 0x3e, offset 0xf80 0xf80: 0x0b82, 0xf81: 0x0b8a, 0xf82: 0x0b92, 0xf83: 0x0b9a, 0xf84: 0x32d5, 0xf85: 0x32f5, 0xf86: 0x3315, 0xf87: 0x3335, 0xf88: 0x0018, 0xf89: 0x0018, 0xf8a: 0x0018, 0xf8b: 0x0018, 0xf8c: 0x0018, 0xf8d: 0x0018, 0xf8e: 0x0018, 0xf8f: 0x0018, 0xf90: 0x3355, 0xf91: 0x0ba1, 0xf92: 0x0ba9, 0xf93: 0x0bb1, 0xf94: 0x0bb9, 0xf95: 0x0bc1, 0xf96: 0x0bc9, 0xf97: 0x0bd1, 0xf98: 0x0bd9, 0xf99: 0x0be1, 0xf9a: 0x0be9, 0xf9b: 0x0bf1, 0xf9c: 0x0bf9, 0xf9d: 0x0c01, 0xf9e: 0x0c09, 0xf9f: 0x0c11, 0xfa0: 0x3375, 0xfa1: 0x3395, 0xfa2: 0x33b5, 0xfa3: 0x33d5, 0xfa4: 0x33f5, 0xfa5: 0x33f5, 0xfa6: 0x3415, 0xfa7: 0x3435, 0xfa8: 0x3455, 0xfa9: 0x3475, 0xfaa: 0x3495, 0xfab: 0x34b5, 0xfac: 0x34d5, 0xfad: 0x34f5, 0xfae: 0x3515, 0xfaf: 0x3535, 0xfb0: 0x3555, 0xfb1: 0x3575, 0xfb2: 0x3595, 0xfb3: 0x35b5, 0xfb4: 0x35d5, 0xfb5: 0x35f5, 0xfb6: 0x3615, 0xfb7: 0x3635, 0xfb8: 0x3655, 0xfb9: 0x3675, 0xfba: 0x3695, 0xfbb: 0x36b5, 0xfbc: 0x0c19, 0xfbd: 0x0c21, 0xfbe: 0x36d5, 0xfbf: 0x0018, // Block 0x3f, offset 0xfc0 0xfc0: 0x36f5, 0xfc1: 0x3715, 0xfc2: 0x3735, 0xfc3: 0x3755, 0xfc4: 0x3775, 0xfc5: 0x3795, 0xfc6: 0x37b5, 0xfc7: 0x37d5, 0xfc8: 0x37f5, 0xfc9: 0x3815, 0xfca: 0x3835, 0xfcb: 0x3855, 0xfcc: 0x3875, 0xfcd: 0x3895, 0xfce: 0x38b5, 0xfcf: 0x38d5, 0xfd0: 0x38f5, 0xfd1: 0x3915, 0xfd2: 0x3935, 0xfd3: 0x3955, 0xfd4: 0x3975, 0xfd5: 0x3995, 0xfd6: 0x39b5, 0xfd7: 0x39d5, 0xfd8: 0x39f5, 0xfd9: 0x3a15, 0xfda: 0x3a35, 0xfdb: 0x3a55, 0xfdc: 0x3a75, 0xfdd: 0x3a95, 0xfde: 0x3ab5, 0xfdf: 0x3ad5, 0xfe0: 0x3af5, 0xfe1: 0x3b15, 0xfe2: 0x3b35, 0xfe3: 0x3b55, 0xfe4: 0x3b75, 0xfe5: 0x3b95, 0xfe6: 0x1295, 0xfe7: 0x3bb5, 0xfe8: 0x3bd5, 0xfe9: 0x3bf5, 0xfea: 0x3c15, 0xfeb: 0x3c35, 0xfec: 0x3c55, 0xfed: 0x3c75, 0xfee: 0x23b5, 0xfef: 0x3c95, 0xff0: 0x3cb5, 0xff1: 0x0c29, 0xff2: 0x0c31, 0xff3: 0x0c39, 0xff4: 0x0c41, 0xff5: 0x0c49, 0xff6: 0x0c51, 0xff7: 0x0c59, 0xff8: 0x0c61, 0xff9: 0x0c69, 0xffa: 0x0c71, 0xffb: 0x0c79, 0xffc: 0x0c81, 0xffd: 0x0c89, 0xffe: 0x0c91, 0xfff: 0x0c99, // Block 0x40, offset 0x1000 0x1000: 0x0ca1, 0x1001: 0x0ca9, 0x1002: 0x0cb1, 0x1003: 0x0cb9, 0x1004: 0x0cc1, 0x1005: 0x0cc9, 0x1006: 0x0cd1, 0x1007: 0x0cd9, 0x1008: 0x0ce1, 0x1009: 0x0ce9, 0x100a: 0x0cf1, 0x100b: 0x0cf9, 0x100c: 0x0d01, 0x100d: 0x3cd5, 0x100e: 0x0d09, 0x100f: 0x3cf5, 0x1010: 0x3d15, 0x1011: 0x3d2d, 0x1012: 0x3d45, 0x1013: 0x3d5d, 0x1014: 0x3d75, 0x1015: 0x3d75, 0x1016: 0x3d5d, 0x1017: 0x3d8d, 0x1018: 0x07d5, 0x1019: 0x3da5, 0x101a: 0x3dbd, 0x101b: 0x3dd5, 0x101c: 0x3ded, 0x101d: 0x3e05, 0x101e: 0x3e1d, 0x101f: 0x3e35, 0x1020: 0x3e4d, 0x1021: 0x3e65, 0x1022: 0x3e7d, 0x1023: 0x3e95, 0x1024: 0x3ead, 0x1025: 0x3ead, 0x1026: 0x3ec5, 0x1027: 0x3ec5, 0x1028: 0x3edd, 0x1029: 0x3edd, 0x102a: 0x3ef5, 0x102b: 0x3f0d, 0x102c: 0x3f25, 0x102d: 0x3f3d, 0x102e: 0x3f55, 0x102f: 0x3f55, 0x1030: 0x3f6d, 0x1031: 0x3f6d, 0x1032: 0x3f6d, 0x1033: 0x3f85, 0x1034: 0x3f9d, 0x1035: 0x3fb5, 0x1036: 0x3fcd, 0x1037: 0x3fb5, 0x1038: 0x3fe5, 0x1039: 0x3ffd, 0x103a: 0x3f85, 0x103b: 0x4015, 0x103c: 0x402d, 0x103d: 0x402d, 0x103e: 0x402d, 0x103f: 0x0d11, // Block 0x41, offset 0x1040 0x1040: 0x10f9, 0x1041: 0x1101, 0x1042: 0x40a5, 0x1043: 0x1109, 0x1044: 0x1111, 0x1045: 0x1119, 0x1046: 0x1121, 0x1047: 0x1129, 0x1048: 0x40c5, 0x1049: 0x1131, 0x104a: 0x1139, 0x104b: 0x1141, 0x104c: 0x40e5, 0x104d: 0x40e5, 0x104e: 0x1149, 0x104f: 0x1151, 0x1050: 0x1159, 0x1051: 0x4105, 0x1052: 0x4125, 0x1053: 0x4145, 0x1054: 0x4165, 0x1055: 0x4185, 0x1056: 0x1161, 0x1057: 0x1169, 0x1058: 0x1171, 0x1059: 0x1179, 0x105a: 0x1181, 0x105b: 0x41a5, 0x105c: 0x1189, 0x105d: 0x1191, 0x105e: 0x1199, 0x105f: 0x41c5, 0x1060: 0x41e5, 0x1061: 0x11a1, 0x1062: 0x4205, 0x1063: 0x4225, 0x1064: 0x4245, 0x1065: 0x11a9, 0x1066: 0x4265, 0x1067: 0x11b1, 0x1068: 0x11b9, 0x1069: 0x10f9, 0x106a: 0x4285, 0x106b: 0x42a5, 0x106c: 0x42c5, 0x106d: 0x42e5, 0x106e: 0x11c1, 0x106f: 0x11c9, 0x1070: 0x11d1, 0x1071: 0x11d9, 0x1072: 0x4305, 0x1073: 0x11e1, 0x1074: 0x11e9, 0x1075: 0x11f1, 0x1076: 0x4325, 0x1077: 0x11f9, 0x1078: 0x1201, 0x1079: 0x11f9, 0x107a: 0x1209, 0x107b: 0x1211, 0x107c: 0x4345, 0x107d: 0x1219, 0x107e: 0x1221, 0x107f: 0x1219, // Block 0x42, offset 0x1080 0x1080: 0x4365, 0x1081: 0x4385, 0x1082: 0x0040, 0x1083: 0x1229, 0x1084: 0x1231, 0x1085: 0x1239, 0x1086: 0x1241, 0x1087: 0x0040, 0x1088: 0x1249, 0x1089: 0x1251, 0x108a: 0x1259, 0x108b: 0x1261, 0x108c: 0x1269, 0x108d: 0x1271, 0x108e: 0x1199, 0x108f: 0x1279, 0x1090: 0x1281, 0x1091: 0x1289, 0x1092: 0x43a5, 0x1093: 0x1291, 0x1094: 0x1121, 0x1095: 0x43c5, 0x1096: 0x43e5, 0x1097: 0x1299, 0x1098: 0x0040, 0x1099: 0x4405, 0x109a: 0x12a1, 0x109b: 0x12a9, 0x109c: 0x12b1, 0x109d: 0x12b9, 0x109e: 0x12c1, 0x109f: 0x12c9, 0x10a0: 0x12d1, 0x10a1: 0x12d9, 0x10a2: 0x12e1, 0x10a3: 0x12e9, 0x10a4: 0x12f1, 0x10a5: 0x12f9, 0x10a6: 0x1301, 0x10a7: 0x1309, 0x10a8: 0x1311, 0x10a9: 0x1319, 0x10aa: 0x1321, 0x10ab: 0x1329, 0x10ac: 0x1331, 0x10ad: 0x1339, 0x10ae: 0x1341, 0x10af: 0x1349, 0x10b0: 0x1351, 0x10b1: 0x1359, 0x10b2: 0x1361, 0x10b3: 0x1369, 0x10b4: 0x1371, 0x10b5: 0x1379, 0x10b6: 0x1381, 0x10b7: 0x1389, 0x10b8: 0x1391, 0x10b9: 0x1399, 0x10ba: 0x13a1, 0x10bb: 0x13a9, 0x10bc: 0x13b1, 0x10bd: 0x13b9, 0x10be: 0x13c1, 0x10bf: 0x4425, // Block 0x43, offset 0x10c0 0x10c0: 0xe00d, 0x10c1: 0x0008, 0x10c2: 0xe00d, 0x10c3: 0x0008, 0x10c4: 0xe00d, 0x10c5: 0x0008, 0x10c6: 0xe00d, 0x10c7: 0x0008, 0x10c8: 0xe00d, 0x10c9: 0x0008, 0x10ca: 0xe00d, 0x10cb: 0x0008, 0x10cc: 0xe00d, 0x10cd: 0x0008, 0x10ce: 0xe00d, 0x10cf: 0x0008, 0x10d0: 0xe00d, 0x10d1: 0x0008, 0x10d2: 0xe00d, 0x10d3: 0x0008, 0x10d4: 0xe00d, 0x10d5: 0x0008, 0x10d6: 0xe00d, 0x10d7: 0x0008, 0x10d8: 0xe00d, 0x10d9: 0x0008, 0x10da: 0xe00d, 0x10db: 0x0008, 0x10dc: 0xe00d, 0x10dd: 0x0008, 0x10de: 0xe00d, 0x10df: 0x0008, 0x10e0: 0xe00d, 0x10e1: 0x0008, 0x10e2: 0xe00d, 0x10e3: 0x0008, 0x10e4: 0xe00d, 0x10e5: 0x0008, 0x10e6: 0xe00d, 0x10e7: 0x0008, 0x10e8: 0xe00d, 0x10e9: 0x0008, 0x10ea: 0xe00d, 0x10eb: 0x0008, 0x10ec: 0xe00d, 0x10ed: 0x0008, 0x10ee: 0x0008, 0x10ef: 0x3308, 0x10f0: 0x3318, 0x10f1: 0x3318, 0x10f2: 0x3318, 0x10f3: 0x0018, 0x10f4: 0x3308, 0x10f5: 0x3308, 0x10f6: 0x3308, 0x10f7: 0x3308, 0x10f8: 0x3308, 0x10f9: 0x3308, 0x10fa: 0x3308, 0x10fb: 0x3308, 0x10fc: 0x3308, 0x10fd: 0x3308, 0x10fe: 0x0018, 0x10ff: 0x0008, // Block 0x44, offset 0x1100 0x1100: 0xe00d, 0x1101: 0x0008, 0x1102: 0xe00d, 0x1103: 0x0008, 0x1104: 0xe00d, 0x1105: 0x0008, 0x1106: 0xe00d, 0x1107: 0x0008, 0x1108: 0xe00d, 0x1109: 0x0008, 0x110a: 0xe00d, 0x110b: 0x0008, 0x110c: 0xe00d, 0x110d: 0x0008, 0x110e: 0xe00d, 0x110f: 0x0008, 0x1110: 0xe00d, 0x1111: 0x0008, 0x1112: 0xe00d, 0x1113: 0x0008, 0x1114: 0xe00d, 0x1115: 0x0008, 0x1116: 0xe00d, 0x1117: 0x0008, 0x1118: 0xe00d, 0x1119: 0x0008, 0x111a: 0xe00d, 0x111b: 0x0008, 0x111c: 0x02d1, 0x111d: 0x13c9, 0x111e: 0x3308, 0x111f: 0x3308, 0x1120: 0x0008, 0x1121: 0x0008, 0x1122: 0x0008, 0x1123: 0x0008, 0x1124: 0x0008, 0x1125: 0x0008, 0x1126: 0x0008, 0x1127: 0x0008, 0x1128: 0x0008, 0x1129: 0x0008, 0x112a: 0x0008, 0x112b: 0x0008, 0x112c: 0x0008, 0x112d: 0x0008, 0x112e: 0x0008, 0x112f: 0x0008, 0x1130: 0x0008, 0x1131: 0x0008, 0x1132: 0x0008, 0x1133: 0x0008, 0x1134: 0x0008, 0x1135: 0x0008, 0x1136: 0x0008, 0x1137: 0x0008, 0x1138: 0x0008, 0x1139: 0x0008, 0x113a: 0x0008, 0x113b: 0x0008, 0x113c: 0x0008, 0x113d: 0x0008, 0x113e: 0x0008, 0x113f: 0x0008, // Block 0x45, offset 0x1140 0x1140: 0x0018, 0x1141: 0x0018, 0x1142: 0x0018, 0x1143: 0x0018, 0x1144: 0x0018, 0x1145: 0x0018, 0x1146: 0x0018, 0x1147: 0x0018, 0x1148: 0x0018, 0x1149: 0x0018, 0x114a: 0x0018, 0x114b: 0x0018, 0x114c: 0x0018, 0x114d: 0x0018, 0x114e: 0x0018, 0x114f: 0x0018, 0x1150: 0x0018, 0x1151: 0x0018, 0x1152: 0x0018, 0x1153: 0x0018, 0x1154: 0x0018, 0x1155: 0x0018, 0x1156: 0x0018, 0x1157: 0x0008, 0x1158: 0x0008, 0x1159: 0x0008, 0x115a: 0x0008, 0x115b: 0x0008, 0x115c: 0x0008, 0x115d: 0x0008, 0x115e: 0x0008, 0x115f: 0x0008, 0x1160: 0x0018, 0x1161: 0x0018, 0x1162: 0xe00d, 0x1163: 0x0008, 0x1164: 0xe00d, 0x1165: 0x0008, 0x1166: 0xe00d, 0x1167: 0x0008, 0x1168: 0xe00d, 0x1169: 0x0008, 0x116a: 0xe00d, 0x116b: 0x0008, 0x116c: 0xe00d, 0x116d: 0x0008, 0x116e: 0xe00d, 0x116f: 0x0008, 0x1170: 0x0008, 0x1171: 0x0008, 0x1172: 0xe00d, 0x1173: 0x0008, 0x1174: 0xe00d, 0x1175: 0x0008, 0x1176: 0xe00d, 0x1177: 0x0008, 0x1178: 0xe00d, 0x1179: 0x0008, 0x117a: 0xe00d, 0x117b: 0x0008, 0x117c: 0xe00d, 0x117d: 0x0008, 0x117e: 0xe00d, 0x117f: 0x0008, // Block 0x46, offset 0x1180 0x1180: 0xe00d, 0x1181: 0x0008, 0x1182: 0xe00d, 0x1183: 0x0008, 0x1184: 0xe00d, 0x1185: 0x0008, 0x1186: 0xe00d, 0x1187: 0x0008, 0x1188: 0xe00d, 0x1189: 0x0008, 0x118a: 0xe00d, 0x118b: 0x0008, 0x118c: 0xe00d, 0x118d: 0x0008, 0x118e: 0xe00d, 0x118f: 0x0008, 0x1190: 0xe00d, 0x1191: 0x0008, 0x1192: 0xe00d, 0x1193: 0x0008, 0x1194: 0xe00d, 0x1195: 0x0008, 0x1196: 0xe00d, 0x1197: 0x0008, 0x1198: 0xe00d, 0x1199: 0x0008, 0x119a: 0xe00d, 0x119b: 0x0008, 0x119c: 0xe00d, 0x119d: 0x0008, 0x119e: 0xe00d, 0x119f: 0x0008, 0x11a0: 0xe00d, 0x11a1: 0x0008, 0x11a2: 0xe00d, 0x11a3: 0x0008, 0x11a4: 0xe00d, 0x11a5: 0x0008, 0x11a6: 0xe00d, 0x11a7: 0x0008, 0x11a8: 0xe00d, 0x11a9: 0x0008, 0x11aa: 0xe00d, 0x11ab: 0x0008, 0x11ac: 0xe00d, 0x11ad: 0x0008, 0x11ae: 0xe00d, 0x11af: 0x0008, 0x11b0: 0xe0fd, 0x11b1: 0x0008, 0x11b2: 0x0008, 0x11b3: 0x0008, 0x11b4: 0x0008, 0x11b5: 0x0008, 0x11b6: 0x0008, 0x11b7: 0x0008, 0x11b8: 0x0008, 0x11b9: 0xe01d, 0x11ba: 0x0008, 0x11bb: 0xe03d, 0x11bc: 0x0008, 0x11bd: 0x4445, 0x11be: 0xe00d, 0x11bf: 0x0008, // Block 0x47, offset 0x11c0 0x11c0: 0xe00d, 0x11c1: 0x0008, 0x11c2: 0xe00d, 0x11c3: 0x0008, 0x11c4: 0xe00d, 0x11c5: 0x0008, 0x11c6: 0xe00d, 0x11c7: 0x0008, 0x11c8: 0x0008, 0x11c9: 0x0018, 0x11ca: 0x0018, 0x11cb: 0xe03d, 0x11cc: 0x0008, 0x11cd: 0x0409, 0x11ce: 0x0008, 0x11cf: 0x0008, 0x11d0: 0xe00d, 0x11d1: 0x0008, 0x11d2: 0xe00d, 0x11d3: 0x0008, 0x11d4: 0x0008, 0x11d5: 0x0008, 0x11d6: 0xe00d, 0x11d7: 0x0008, 0x11d8: 0xe00d, 0x11d9: 0x0008, 0x11da: 0xe00d, 0x11db: 0x0008, 0x11dc: 0xe00d, 0x11dd: 0x0008, 0x11de: 0xe00d, 0x11df: 0x0008, 0x11e0: 0xe00d, 0x11e1: 0x0008, 0x11e2: 0xe00d, 0x11e3: 0x0008, 0x11e4: 0xe00d, 0x11e5: 0x0008, 0x11e6: 0xe00d, 0x11e7: 0x0008, 0x11e8: 0xe00d, 0x11e9: 0x0008, 0x11ea: 0x13d1, 0x11eb: 0x0371, 0x11ec: 0x0401, 0x11ed: 0x13d9, 0x11ee: 0x0421, 0x11ef: 0x0008, 0x11f0: 0x13e1, 0x11f1: 0x13e9, 0x11f2: 0x0429, 0x11f3: 0x4465, 0x11f4: 0xe00d, 0x11f5: 0x0008, 0x11f6: 0xe00d, 0x11f7: 0x0008, 0x11f8: 0xe00d, 0x11f9: 0x0008, 0x11fa: 0xe00d, 0x11fb: 0x0008, 0x11fc: 0xe00d, 0x11fd: 0x0008, 0x11fe: 0xe00d, 0x11ff: 0x0008, // Block 0x48, offset 0x1200 0x1200: 0xe00d, 0x1201: 0x0008, 0x1202: 0xe00d, 0x1203: 0x0008, 0x1204: 0x03f5, 0x1205: 0x0479, 0x1206: 0x447d, 0x1207: 0xe07d, 0x1208: 0x0008, 0x1209: 0xe01d, 0x120a: 0x0008, 0x120b: 0x0040, 0x120c: 0x0040, 0x120d: 0x0040, 0x120e: 0x0040, 0x120f: 0x0040, 0x1210: 0xe00d, 0x1211: 0x0008, 0x1212: 0x0040, 0x1213: 0x0008, 0x1214: 0x0040, 0x1215: 0x0008, 0x1216: 0xe00d, 0x1217: 0x0008, 0x1218: 0xe00d, 0x1219: 0x0008, 0x121a: 0x0040, 0x121b: 0x0040, 0x121c: 0x0040, 0x121d: 0x0040, 0x121e: 0x0040, 0x121f: 0x0040, 0x1220: 0x0040, 0x1221: 0x0040, 0x1222: 0x0040, 0x1223: 0x0040, 0x1224: 0x0040, 0x1225: 0x0040, 0x1226: 0x0040, 0x1227: 0x0040, 0x1228: 0x0040, 0x1229: 0x0040, 0x122a: 0x0040, 0x122b: 0x0040, 0x122c: 0x0040, 0x122d: 0x0040, 0x122e: 0x0040, 0x122f: 0x0040, 0x1230: 0x0040, 0x1231: 0x0040, 0x1232: 0x03d9, 0x1233: 0x03f1, 0x1234: 0x0751, 0x1235: 0xe01d, 0x1236: 0x0008, 0x1237: 0x0008, 0x1238: 0x0741, 0x1239: 0x13f1, 0x123a: 0x0008, 0x123b: 0x0008, 0x123c: 0x0008, 0x123d: 0x0008, 0x123e: 0x0008, 0x123f: 0x0008, // Block 0x49, offset 0x1240 0x1240: 0x650d, 0x1241: 0x652d, 0x1242: 0x654d, 0x1243: 0x656d, 0x1244: 0x658d, 0x1245: 0x65ad, 0x1246: 0x65cd, 0x1247: 0x65ed, 0x1248: 0x660d, 0x1249: 0x662d, 0x124a: 0x664d, 0x124b: 0x666d, 0x124c: 0x668d, 0x124d: 0x66ad, 0x124e: 0x0008, 0x124f: 0x0008, 0x1250: 0x66cd, 0x1251: 0x0008, 0x1252: 0x66ed, 0x1253: 0x0008, 0x1254: 0x0008, 0x1255: 0x670d, 0x1256: 0x672d, 0x1257: 0x674d, 0x1258: 0x676d, 0x1259: 0x678d, 0x125a: 0x67ad, 0x125b: 0x67cd, 0x125c: 0x67ed, 0x125d: 0x680d, 0x125e: 0x682d, 0x125f: 0x0008, 0x1260: 0x684d, 0x1261: 0x0008, 0x1262: 0x686d, 0x1263: 0x0008, 0x1264: 0x0008, 0x1265: 0x688d, 0x1266: 0x68ad, 0x1267: 0x0008, 0x1268: 0x0008, 0x1269: 0x0008, 0x126a: 0x68cd, 0x126b: 0x68ed, 0x126c: 0x690d, 0x126d: 0x692d, 0x126e: 0x694d, 0x126f: 0x696d, 0x1270: 0x698d, 0x1271: 0x69ad, 0x1272: 0x69cd, 0x1273: 0x69ed, 0x1274: 0x6a0d, 0x1275: 0x6a2d, 0x1276: 0x6a4d, 0x1277: 0x6a6d, 0x1278: 0x6a8d, 0x1279: 0x6aad, 0x127a: 0x6acd, 0x127b: 0x6aed, 0x127c: 0x6b0d, 0x127d: 0x6b2d, 0x127e: 0x6b4d, 0x127f: 0x6b6d, // Block 0x4a, offset 0x1280 0x1280: 0x7acd, 0x1281: 0x7aed, 0x1282: 0x7b0d, 0x1283: 0x7b2d, 0x1284: 0x7b4d, 0x1285: 0x7b6d, 0x1286: 0x7b8d, 0x1287: 0x7bad, 0x1288: 0x7bcd, 0x1289: 0x7bed, 0x128a: 0x7c0d, 0x128b: 0x7c2d, 0x128c: 0x7c4d, 0x128d: 0x7c6d, 0x128e: 0x7c8d, 0x128f: 0x1409, 0x1290: 0x1411, 0x1291: 0x1419, 0x1292: 0x7cad, 0x1293: 0x7ccd, 0x1294: 0x7ced, 0x1295: 0x1421, 0x1296: 0x1429, 0x1297: 0x1431, 0x1298: 0x7d0d, 0x1299: 0x7d2d, 0x129a: 0x0040, 0x129b: 0x0040, 0x129c: 0x0040, 0x129d: 0x0040, 0x129e: 0x0040, 0x129f: 0x0040, 0x12a0: 0x0040, 0x12a1: 0x0040, 0x12a2: 0x0040, 0x12a3: 0x0040, 0x12a4: 0x0040, 0x12a5: 0x0040, 0x12a6: 0x0040, 0x12a7: 0x0040, 0x12a8: 0x0040, 0x12a9: 0x0040, 0x12aa: 0x0040, 0x12ab: 0x0040, 0x12ac: 0x0040, 0x12ad: 0x0040, 0x12ae: 0x0040, 0x12af: 0x0040, 0x12b0: 0x0040, 0x12b1: 0x0040, 0x12b2: 0x0040, 0x12b3: 0x0040, 0x12b4: 0x0040, 0x12b5: 0x0040, 0x12b6: 0x0040, 0x12b7: 0x0040, 0x12b8: 0x0040, 0x12b9: 0x0040, 0x12ba: 0x0040, 0x12bb: 0x0040, 0x12bc: 0x0040, 0x12bd: 0x0040, 0x12be: 0x0040, 0x12bf: 0x0040, // Block 0x4b, offset 0x12c0 0x12c0: 0x1439, 0x12c1: 0x1441, 0x12c2: 0x1449, 0x12c3: 0x7d4d, 0x12c4: 0x7d6d, 0x12c5: 0x1451, 0x12c6: 0x1451, 0x12c7: 0x0040, 0x12c8: 0x0040, 0x12c9: 0x0040, 0x12ca: 0x0040, 0x12cb: 0x0040, 0x12cc: 0x0040, 0x12cd: 0x0040, 0x12ce: 0x0040, 0x12cf: 0x0040, 0x12d0: 0x0040, 0x12d1: 0x0040, 0x12d2: 0x0040, 0x12d3: 0x1459, 0x12d4: 0x1461, 0x12d5: 0x1469, 0x12d6: 0x1471, 0x12d7: 0x1479, 0x12d8: 0x0040, 0x12d9: 0x0040, 0x12da: 0x0040, 0x12db: 0x0040, 0x12dc: 0x0040, 0x12dd: 0x1481, 0x12de: 0x3308, 0x12df: 0x1489, 0x12e0: 0x1491, 0x12e1: 0x0779, 0x12e2: 0x0791, 0x12e3: 0x1499, 0x12e4: 0x14a1, 0x12e5: 0x14a9, 0x12e6: 0x14b1, 0x12e7: 0x14b9, 0x12e8: 0x14c1, 0x12e9: 0x071a, 0x12ea: 0x14c9, 0x12eb: 0x14d1, 0x12ec: 0x14d9, 0x12ed: 0x14e1, 0x12ee: 0x14e9, 0x12ef: 0x14f1, 0x12f0: 0x14f9, 0x12f1: 0x1501, 0x12f2: 0x1509, 0x12f3: 0x1511, 0x12f4: 0x1519, 0x12f5: 0x1521, 0x12f6: 0x1529, 0x12f7: 0x0040, 0x12f8: 0x1531, 0x12f9: 0x1539, 0x12fa: 0x1541, 0x12fb: 0x1549, 0x12fc: 0x1551, 0x12fd: 0x0040, 0x12fe: 0x1559, 0x12ff: 0x0040, // Block 0x4c, offset 0x1300 0x1300: 0x1561, 0x1301: 0x1569, 0x1302: 0x0040, 0x1303: 0x1571, 0x1304: 0x1579, 0x1305: 0x0040, 0x1306: 0x1581, 0x1307: 0x1589, 0x1308: 0x1591, 0x1309: 0x1599, 0x130a: 0x15a1, 0x130b: 0x15a9, 0x130c: 0x15b1, 0x130d: 0x15b9, 0x130e: 0x15c1, 0x130f: 0x15c9, 0x1310: 0x15d1, 0x1311: 0x15d1, 0x1312: 0x15d9, 0x1313: 0x15d9, 0x1314: 0x15d9, 0x1315: 0x15d9, 0x1316: 0x15e1, 0x1317: 0x15e1, 0x1318: 0x15e1, 0x1319: 0x15e1, 0x131a: 0x15e9, 0x131b: 0x15e9, 0x131c: 0x15e9, 0x131d: 0x15e9, 0x131e: 0x15f1, 0x131f: 0x15f1, 0x1320: 0x15f1, 0x1321: 0x15f1, 0x1322: 0x15f9, 0x1323: 0x15f9, 0x1324: 0x15f9, 0x1325: 0x15f9, 0x1326: 0x1601, 0x1327: 0x1601, 0x1328: 0x1601, 0x1329: 0x1601, 0x132a: 0x1609, 0x132b: 0x1609, 0x132c: 0x1609, 0x132d: 0x1609, 0x132e: 0x1611, 0x132f: 0x1611, 0x1330: 0x1611, 0x1331: 0x1611, 0x1332: 0x1619, 0x1333: 0x1619, 0x1334: 0x1619, 0x1335: 0x1619, 0x1336: 0x1621, 0x1337: 0x1621, 0x1338: 0x1621, 0x1339: 0x1621, 0x133a: 0x1629, 0x133b: 0x1629, 0x133c: 0x1629, 0x133d: 0x1629, 0x133e: 0x1631, 0x133f: 0x1631, // Block 0x4d, offset 0x1340 0x1340: 0x1631, 0x1341: 0x1631, 0x1342: 0x1639, 0x1343: 0x1639, 0x1344: 0x1641, 0x1345: 0x1641, 0x1346: 0x1649, 0x1347: 0x1649, 0x1348: 0x1651, 0x1349: 0x1651, 0x134a: 0x1659, 0x134b: 0x1659, 0x134c: 0x1661, 0x134d: 0x1661, 0x134e: 0x1669, 0x134f: 0x1669, 0x1350: 0x1669, 0x1351: 0x1669, 0x1352: 0x1671, 0x1353: 0x1671, 0x1354: 0x1671, 0x1355: 0x1671, 0x1356: 0x1679, 0x1357: 0x1679, 0x1358: 0x1679, 0x1359: 0x1679, 0x135a: 0x1681, 0x135b: 0x1681, 0x135c: 0x1681, 0x135d: 0x1681, 0x135e: 0x1689, 0x135f: 0x1689, 0x1360: 0x1691, 0x1361: 0x1691, 0x1362: 0x1691, 0x1363: 0x1691, 0x1364: 0x1699, 0x1365: 0x1699, 0x1366: 0x16a1, 0x1367: 0x16a1, 0x1368: 0x16a1, 0x1369: 0x16a1, 0x136a: 0x16a9, 0x136b: 0x16a9, 0x136c: 0x16a9, 0x136d: 0x16a9, 0x136e: 0x16b1, 0x136f: 0x16b1, 0x1370: 0x16b9, 0x1371: 0x16b9, 0x1372: 0x0818, 0x1373: 0x0818, 0x1374: 0x0818, 0x1375: 0x0818, 0x1376: 0x0818, 0x1377: 0x0818, 0x1378: 0x0818, 0x1379: 0x0818, 0x137a: 0x0818, 0x137b: 0x0818, 0x137c: 0x0818, 0x137d: 0x0818, 0x137e: 0x0818, 0x137f: 0x0818, // Block 0x4e, offset 0x1380 0x1380: 0x0818, 0x1381: 0x0818, 0x1382: 0x0818, 0x1383: 0x0040, 0x1384: 0x0040, 0x1385: 0x0040, 0x1386: 0x0040, 0x1387: 0x0040, 0x1388: 0x0040, 0x1389: 0x0040, 0x138a: 0x0040, 0x138b: 0x0040, 0x138c: 0x0040, 0x138d: 0x0040, 0x138e: 0x0040, 0x138f: 0x0040, 0x1390: 0x0040, 0x1391: 0x0040, 0x1392: 0x0040, 0x1393: 0x16c1, 0x1394: 0x16c1, 0x1395: 0x16c1, 0x1396: 0x16c1, 0x1397: 0x16c9, 0x1398: 0x16c9, 0x1399: 0x16d1, 0x139a: 0x16d1, 0x139b: 0x16d9, 0x139c: 0x16d9, 0x139d: 0x0149, 0x139e: 0x16e1, 0x139f: 0x16e1, 0x13a0: 0x16e9, 0x13a1: 0x16e9, 0x13a2: 0x16f1, 0x13a3: 0x16f1, 0x13a4: 0x16f9, 0x13a5: 0x16f9, 0x13a6: 0x16f9, 0x13a7: 0x16f9, 0x13a8: 0x1701, 0x13a9: 0x1701, 0x13aa: 0x1709, 0x13ab: 0x1709, 0x13ac: 0x1711, 0x13ad: 0x1711, 0x13ae: 0x1719, 0x13af: 0x1719, 0x13b0: 0x1721, 0x13b1: 0x1721, 0x13b2: 0x1729, 0x13b3: 0x1729, 0x13b4: 0x1731, 0x13b5: 0x1731, 0x13b6: 0x1739, 0x13b7: 0x1739, 0x13b8: 0x1739, 0x13b9: 0x1741, 0x13ba: 0x1741, 0x13bb: 0x1741, 0x13bc: 0x1749, 0x13bd: 0x1749, 0x13be: 0x1749, 0x13bf: 0x1749, // Block 0x4f, offset 0x13c0 0x13c0: 0x1949, 0x13c1: 0x1951, 0x13c2: 0x1959, 0x13c3: 0x1961, 0x13c4: 0x1969, 0x13c5: 0x1971, 0x13c6: 0x1979, 0x13c7: 0x1981, 0x13c8: 0x1989, 0x13c9: 0x1991, 0x13ca: 0x1999, 0x13cb: 0x19a1, 0x13cc: 0x19a9, 0x13cd: 0x19b1, 0x13ce: 0x19b9, 0x13cf: 0x19c1, 0x13d0: 0x19c9, 0x13d1: 0x19d1, 0x13d2: 0x19d9, 0x13d3: 0x19e1, 0x13d4: 0x19e9, 0x13d5: 0x19f1, 0x13d6: 0x19f9, 0x13d7: 0x1a01, 0x13d8: 0x1a09, 0x13d9: 0x1a11, 0x13da: 0x1a19, 0x13db: 0x1a21, 0x13dc: 0x1a29, 0x13dd: 0x1a31, 0x13de: 0x1a3a, 0x13df: 0x1a42, 0x13e0: 0x1a4a, 0x13e1: 0x1a52, 0x13e2: 0x1a5a, 0x13e3: 0x1a62, 0x13e4: 0x1a69, 0x13e5: 0x1a71, 0x13e6: 0x1761, 0x13e7: 0x1a79, 0x13e8: 0x1741, 0x13e9: 0x1769, 0x13ea: 0x1a81, 0x13eb: 0x1a89, 0x13ec: 0x1789, 0x13ed: 0x1a91, 0x13ee: 0x1791, 0x13ef: 0x1799, 0x13f0: 0x1a99, 0x13f1: 0x1aa1, 0x13f2: 0x17b9, 0x13f3: 0x1aa9, 0x13f4: 0x17c1, 0x13f5: 0x17c9, 0x13f6: 0x1ab1, 0x13f7: 0x1ab9, 0x13f8: 0x17d9, 0x13f9: 0x1ac1, 0x13fa: 0x17e1, 0x13fb: 0x17e9, 0x13fc: 0x18d1, 0x13fd: 0x18d9, 0x13fe: 0x18f1, 0x13ff: 0x18f9, // Block 0x50, offset 0x1400 0x1400: 0x1901, 0x1401: 0x1921, 0x1402: 0x1929, 0x1403: 0x1931, 0x1404: 0x1939, 0x1405: 0x1959, 0x1406: 0x1961, 0x1407: 0x1969, 0x1408: 0x1ac9, 0x1409: 0x1989, 0x140a: 0x1ad1, 0x140b: 0x1ad9, 0x140c: 0x19b9, 0x140d: 0x1ae1, 0x140e: 0x19c1, 0x140f: 0x19c9, 0x1410: 0x1a31, 0x1411: 0x1ae9, 0x1412: 0x1af1, 0x1413: 0x1a09, 0x1414: 0x1af9, 0x1415: 0x1a11, 0x1416: 0x1a19, 0x1417: 0x1751, 0x1418: 0x1759, 0x1419: 0x1b01, 0x141a: 0x1761, 0x141b: 0x1b09, 0x141c: 0x1771, 0x141d: 0x1779, 0x141e: 0x1781, 0x141f: 0x1789, 0x1420: 0x1b11, 0x1421: 0x17a1, 0x1422: 0x17a9, 0x1423: 0x17b1, 0x1424: 0x17b9, 0x1425: 0x1b19, 0x1426: 0x17d9, 0x1427: 0x17f1, 0x1428: 0x17f9, 0x1429: 0x1801, 0x142a: 0x1809, 0x142b: 0x1811, 0x142c: 0x1821, 0x142d: 0x1829, 0x142e: 0x1831, 0x142f: 0x1839, 0x1430: 0x1841, 0x1431: 0x1849, 0x1432: 0x1b21, 0x1433: 0x1851, 0x1434: 0x1859, 0x1435: 0x1861, 0x1436: 0x1869, 0x1437: 0x1871, 0x1438: 0x1879, 0x1439: 0x1889, 0x143a: 0x1891, 0x143b: 0x1899, 0x143c: 0x18a1, 0x143d: 0x18a9, 0x143e: 0x18b1, 0x143f: 0x18b9, // Block 0x51, offset 0x1440 0x1440: 0x18c1, 0x1441: 0x18c9, 0x1442: 0x18e1, 0x1443: 0x18e9, 0x1444: 0x1909, 0x1445: 0x1911, 0x1446: 0x1919, 0x1447: 0x1921, 0x1448: 0x1929, 0x1449: 0x1941, 0x144a: 0x1949, 0x144b: 0x1951, 0x144c: 0x1959, 0x144d: 0x1b29, 0x144e: 0x1971, 0x144f: 0x1979, 0x1450: 0x1981, 0x1451: 0x1989, 0x1452: 0x19a1, 0x1453: 0x19a9, 0x1454: 0x19b1, 0x1455: 0x19b9, 0x1456: 0x1b31, 0x1457: 0x19d1, 0x1458: 0x19d9, 0x1459: 0x1b39, 0x145a: 0x19f1, 0x145b: 0x19f9, 0x145c: 0x1a01, 0x145d: 0x1a09, 0x145e: 0x1b41, 0x145f: 0x1761, 0x1460: 0x1b09, 0x1461: 0x1789, 0x1462: 0x1b11, 0x1463: 0x17b9, 0x1464: 0x1b19, 0x1465: 0x17d9, 0x1466: 0x1b49, 0x1467: 0x1841, 0x1468: 0x1b51, 0x1469: 0x1b59, 0x146a: 0x1b61, 0x146b: 0x1921, 0x146c: 0x1929, 0x146d: 0x1959, 0x146e: 0x19b9, 0x146f: 0x1b31, 0x1470: 0x1a09, 0x1471: 0x1b41, 0x1472: 0x1b69, 0x1473: 0x1b71, 0x1474: 0x1b79, 0x1475: 0x1b81, 0x1476: 0x1b89, 0x1477: 0x1b91, 0x1478: 0x1b99, 0x1479: 0x1ba1, 0x147a: 0x1ba9, 0x147b: 0x1bb1, 0x147c: 0x1bb9, 0x147d: 0x1bc1, 0x147e: 0x1bc9, 0x147f: 0x1bd1, // Block 0x52, offset 0x1480 0x1480: 0x1bd9, 0x1481: 0x1be1, 0x1482: 0x1be9, 0x1483: 0x1bf1, 0x1484: 0x1bf9, 0x1485: 0x1c01, 0x1486: 0x1c09, 0x1487: 0x1c11, 0x1488: 0x1c19, 0x1489: 0x1c21, 0x148a: 0x1c29, 0x148b: 0x1c31, 0x148c: 0x1b59, 0x148d: 0x1c39, 0x148e: 0x1c41, 0x148f: 0x1c49, 0x1490: 0x1c51, 0x1491: 0x1b81, 0x1492: 0x1b89, 0x1493: 0x1b91, 0x1494: 0x1b99, 0x1495: 0x1ba1, 0x1496: 0x1ba9, 0x1497: 0x1bb1, 0x1498: 0x1bb9, 0x1499: 0x1bc1, 0x149a: 0x1bc9, 0x149b: 0x1bd1, 0x149c: 0x1bd9, 0x149d: 0x1be1, 0x149e: 0x1be9, 0x149f: 0x1bf1, 0x14a0: 0x1bf9, 0x14a1: 0x1c01, 0x14a2: 0x1c09, 0x14a3: 0x1c11, 0x14a4: 0x1c19, 0x14a5: 0x1c21, 0x14a6: 0x1c29, 0x14a7: 0x1c31, 0x14a8: 0x1b59, 0x14a9: 0x1c39, 0x14aa: 0x1c41, 0x14ab: 0x1c49, 0x14ac: 0x1c51, 0x14ad: 0x1c21, 0x14ae: 0x1c29, 0x14af: 0x1c31, 0x14b0: 0x1b59, 0x14b1: 0x1b51, 0x14b2: 0x1b61, 0x14b3: 0x1881, 0x14b4: 0x1829, 0x14b5: 0x1831, 0x14b6: 0x1839, 0x14b7: 0x1c21, 0x14b8: 0x1c29, 0x14b9: 0x1c31, 0x14ba: 0x1881, 0x14bb: 0x1889, 0x14bc: 0x1c59, 0x14bd: 0x1c59, 0x14be: 0x0018, 0x14bf: 0x0018, // Block 0x53, offset 0x14c0 0x14c0: 0x0018, 0x14c1: 0x0018, 0x14c2: 0x0018, 0x14c3: 0x0018, 0x14c4: 0x0018, 0x14c5: 0x0018, 0x14c6: 0x0018, 0x14c7: 0x0018, 0x14c8: 0x0018, 0x14c9: 0x0018, 0x14ca: 0x0018, 0x14cb: 0x0018, 0x14cc: 0x0018, 0x14cd: 0x0018, 0x14ce: 0x0018, 0x14cf: 0x0018, 0x14d0: 0x1c61, 0x14d1: 0x1c69, 0x14d2: 0x1c69, 0x14d3: 0x1c71, 0x14d4: 0x1c79, 0x14d5: 0x1c81, 0x14d6: 0x1c89, 0x14d7: 0x1c91, 0x14d8: 0x1c99, 0x14d9: 0x1c99, 0x14da: 0x1ca1, 0x14db: 0x1ca9, 0x14dc: 0x1cb1, 0x14dd: 0x1cb9, 0x14de: 0x1cc1, 0x14df: 0x1cc9, 0x14e0: 0x1cc9, 0x14e1: 0x1cd1, 0x14e2: 0x1cd9, 0x14e3: 0x1cd9, 0x14e4: 0x1ce1, 0x14e5: 0x1ce1, 0x14e6: 0x1ce9, 0x14e7: 0x1cf1, 0x14e8: 0x1cf1, 0x14e9: 0x1cf9, 0x14ea: 0x1d01, 0x14eb: 0x1d01, 0x14ec: 0x1d09, 0x14ed: 0x1d09, 0x14ee: 0x1d11, 0x14ef: 0x1d19, 0x14f0: 0x1d19, 0x14f1: 0x1d21, 0x14f2: 0x1d21, 0x14f3: 0x1d29, 0x14f4: 0x1d31, 0x14f5: 0x1d39, 0x14f6: 0x1d41, 0x14f7: 0x1d41, 0x14f8: 0x1d49, 0x14f9: 0x1d51, 0x14fa: 0x1d59, 0x14fb: 0x1d61, 0x14fc: 0x1d69, 0x14fd: 0x1d69, 0x14fe: 0x1d71, 0x14ff: 0x1d79, // Block 0x54, offset 0x1500 0x1500: 0x1f29, 0x1501: 0x1f31, 0x1502: 0x1f39, 0x1503: 0x1f11, 0x1504: 0x1d39, 0x1505: 0x1ce9, 0x1506: 0x1f41, 0x1507: 0x1f49, 0x1508: 0x0040, 0x1509: 0x0040, 0x150a: 0x0040, 0x150b: 0x0040, 0x150c: 0x0040, 0x150d: 0x0040, 0x150e: 0x0040, 0x150f: 0x0018, 0x1510: 0x0040, 0x1511: 0x0040, 0x1512: 0x0040, 0x1513: 0x0040, 0x1514: 0x0040, 0x1515: 0x0040, 0x1516: 0x0040, 0x1517: 0x0040, 0x1518: 0x0040, 0x1519: 0x0040, 0x151a: 0x0040, 0x151b: 0x0040, 0x151c: 0x0040, 0x151d: 0x0040, 0x151e: 0x0040, 0x151f: 0x0040, 0x1520: 0x0040, 0x1521: 0x0040, 0x1522: 0x0040, 0x1523: 0x0040, 0x1524: 0x0040, 0x1525: 0x0040, 0x1526: 0x0040, 0x1527: 0x0040, 0x1528: 0x0040, 0x1529: 0x0040, 0x152a: 0x0040, 0x152b: 0x0040, 0x152c: 0x0040, 0x152d: 0x0040, 0x152e: 0x0040, 0x152f: 0x0040, 0x1530: 0x1f51, 0x1531: 0x1f59, 0x1532: 0x1f61, 0x1533: 0x1f69, 0x1534: 0x1f71, 0x1535: 0x1f79, 0x1536: 0x1f81, 0x1537: 0x1f89, 0x1538: 0x1f91, 0x1539: 0x1f99, 0x153a: 0x1fa2, 0x153b: 0x1faa, 0x153c: 0x1fb1, 0x153d: 0x0018, 0x153e: 0x0018, 0x153f: 0x0018, // Block 0x55, offset 0x1540 0x1540: 0x33c0, 0x1541: 0x33c0, 0x1542: 0x33c0, 0x1543: 0x33c0, 0x1544: 0x33c0, 0x1545: 0x33c0, 0x1546: 0x33c0, 0x1547: 0x33c0, 0x1548: 0x33c0, 0x1549: 0x33c0, 0x154a: 0x33c0, 0x154b: 0x33c0, 0x154c: 0x33c0, 0x154d: 0x33c0, 0x154e: 0x33c0, 0x154f: 0x33c0, 0x1550: 0x1fba, 0x1551: 0x7d8d, 0x1552: 0x0040, 0x1553: 0x1fc2, 0x1554: 0x0122, 0x1555: 0x1fca, 0x1556: 0x1fd2, 0x1557: 0x7dad, 0x1558: 0x7dcd, 0x1559: 0x0040, 0x155a: 0x0040, 0x155b: 0x0040, 0x155c: 0x0040, 0x155d: 0x0040, 0x155e: 0x0040, 0x155f: 0x0040, 0x1560: 0x3308, 0x1561: 0x3308, 0x1562: 0x3308, 0x1563: 0x3308, 0x1564: 0x3308, 0x1565: 0x3308, 0x1566: 0x3308, 0x1567: 0x3308, 0x1568: 0x3308, 0x1569: 0x3308, 0x156a: 0x3308, 0x156b: 0x3308, 0x156c: 0x3308, 0x156d: 0x3308, 0x156e: 0x3308, 0x156f: 0x3308, 0x1570: 0x0040, 0x1571: 0x7ded, 0x1572: 0x7e0d, 0x1573: 0x1fda, 0x1574: 0x1fda, 0x1575: 0x072a, 0x1576: 0x0732, 0x1577: 0x1fe2, 0x1578: 0x1fea, 0x1579: 0x7e2d, 0x157a: 0x7e4d, 0x157b: 0x7e6d, 0x157c: 0x7e2d, 0x157d: 0x7e8d, 0x157e: 0x7ead, 0x157f: 0x7e8d, // Block 0x56, offset 0x1580 0x1580: 0x7ecd, 0x1581: 0x7eed, 0x1582: 0x7f0d, 0x1583: 0x7eed, 0x1584: 0x7f2d, 0x1585: 0x0018, 0x1586: 0x0018, 0x1587: 0x1ff2, 0x1588: 0x1ffa, 0x1589: 0x7f4e, 0x158a: 0x7f6e, 0x158b: 0x7f8e, 0x158c: 0x7fae, 0x158d: 0x1fda, 0x158e: 0x1fda, 0x158f: 0x1fda, 0x1590: 0x1fba, 0x1591: 0x7fcd, 0x1592: 0x0040, 0x1593: 0x0040, 0x1594: 0x0122, 0x1595: 0x1fc2, 0x1596: 0x1fd2, 0x1597: 0x1fca, 0x1598: 0x7fed, 0x1599: 0x072a, 0x159a: 0x0732, 0x159b: 0x1fe2, 0x159c: 0x1fea, 0x159d: 0x7ecd, 0x159e: 0x7f2d, 0x159f: 0x2002, 0x15a0: 0x200a, 0x15a1: 0x2012, 0x15a2: 0x071a, 0x15a3: 0x2019, 0x15a4: 0x2022, 0x15a5: 0x202a, 0x15a6: 0x0722, 0x15a7: 0x0040, 0x15a8: 0x2032, 0x15a9: 0x203a, 0x15aa: 0x2042, 0x15ab: 0x204a, 0x15ac: 0x0040, 0x15ad: 0x0040, 0x15ae: 0x0040, 0x15af: 0x0040, 0x15b0: 0x800e, 0x15b1: 0x2051, 0x15b2: 0x802e, 0x15b3: 0x0808, 0x15b4: 0x804e, 0x15b5: 0x0040, 0x15b6: 0x806e, 0x15b7: 0x2059, 0x15b8: 0x808e, 0x15b9: 0x2061, 0x15ba: 0x80ae, 0x15bb: 0x2069, 0x15bc: 0x80ce, 0x15bd: 0x2071, 0x15be: 0x80ee, 0x15bf: 0x2079, // Block 0x57, offset 0x15c0 0x15c0: 0x2081, 0x15c1: 0x2089, 0x15c2: 0x2089, 0x15c3: 0x2091, 0x15c4: 0x2091, 0x15c5: 0x2099, 0x15c6: 0x2099, 0x15c7: 0x20a1, 0x15c8: 0x20a1, 0x15c9: 0x20a9, 0x15ca: 0x20a9, 0x15cb: 0x20a9, 0x15cc: 0x20a9, 0x15cd: 0x20b1, 0x15ce: 0x20b1, 0x15cf: 0x20b9, 0x15d0: 0x20b9, 0x15d1: 0x20b9, 0x15d2: 0x20b9, 0x15d3: 0x20c1, 0x15d4: 0x20c1, 0x15d5: 0x20c9, 0x15d6: 0x20c9, 0x15d7: 0x20c9, 0x15d8: 0x20c9, 0x15d9: 0x20d1, 0x15da: 0x20d1, 0x15db: 0x20d1, 0x15dc: 0x20d1, 0x15dd: 0x20d9, 0x15de: 0x20d9, 0x15df: 0x20d9, 0x15e0: 0x20d9, 0x15e1: 0x20e1, 0x15e2: 0x20e1, 0x15e3: 0x20e1, 0x15e4: 0x20e1, 0x15e5: 0x20e9, 0x15e6: 0x20e9, 0x15e7: 0x20e9, 0x15e8: 0x20e9, 0x15e9: 0x20f1, 0x15ea: 0x20f1, 0x15eb: 0x20f9, 0x15ec: 0x20f9, 0x15ed: 0x2101, 0x15ee: 0x2101, 0x15ef: 0x2109, 0x15f0: 0x2109, 0x15f1: 0x2111, 0x15f2: 0x2111, 0x15f3: 0x2111, 0x15f4: 0x2111, 0x15f5: 0x2119, 0x15f6: 0x2119, 0x15f7: 0x2119, 0x15f8: 0x2119, 0x15f9: 0x2121, 0x15fa: 0x2121, 0x15fb: 0x2121, 0x15fc: 0x2121, 0x15fd: 0x2129, 0x15fe: 0x2129, 0x15ff: 0x2129, // Block 0x58, offset 0x1600 0x1600: 0x2129, 0x1601: 0x2131, 0x1602: 0x2131, 0x1603: 0x2131, 0x1604: 0x2131, 0x1605: 0x2139, 0x1606: 0x2139, 0x1607: 0x2139, 0x1608: 0x2139, 0x1609: 0x2141, 0x160a: 0x2141, 0x160b: 0x2141, 0x160c: 0x2141, 0x160d: 0x2149, 0x160e: 0x2149, 0x160f: 0x2149, 0x1610: 0x2149, 0x1611: 0x2151, 0x1612: 0x2151, 0x1613: 0x2151, 0x1614: 0x2151, 0x1615: 0x2159, 0x1616: 0x2159, 0x1617: 0x2159, 0x1618: 0x2159, 0x1619: 0x2161, 0x161a: 0x2161, 0x161b: 0x2161, 0x161c: 0x2161, 0x161d: 0x2169, 0x161e: 0x2169, 0x161f: 0x2169, 0x1620: 0x2169, 0x1621: 0x2171, 0x1622: 0x2171, 0x1623: 0x2171, 0x1624: 0x2171, 0x1625: 0x2179, 0x1626: 0x2179, 0x1627: 0x2179, 0x1628: 0x2179, 0x1629: 0x2181, 0x162a: 0x2181, 0x162b: 0x2181, 0x162c: 0x2181, 0x162d: 0x2189, 0x162e: 0x2189, 0x162f: 0x1701, 0x1630: 0x1701, 0x1631: 0x2191, 0x1632: 0x2191, 0x1633: 0x2191, 0x1634: 0x2191, 0x1635: 0x2199, 0x1636: 0x2199, 0x1637: 0x21a1, 0x1638: 0x21a1, 0x1639: 0x21a9, 0x163a: 0x21a9, 0x163b: 0x21b1, 0x163c: 0x21b1, 0x163d: 0x0040, 0x163e: 0x0040, 0x163f: 0x03c0, // Block 0x59, offset 0x1640 0x1640: 0x0040, 0x1641: 0x1fca, 0x1642: 0x21ba, 0x1643: 0x2002, 0x1644: 0x203a, 0x1645: 0x2042, 0x1646: 0x200a, 0x1647: 0x21c2, 0x1648: 0x072a, 0x1649: 0x0732, 0x164a: 0x2012, 0x164b: 0x071a, 0x164c: 0x1fba, 0x164d: 0x2019, 0x164e: 0x0961, 0x164f: 0x21ca, 0x1650: 0x06e1, 0x1651: 0x0049, 0x1652: 0x0029, 0x1653: 0x0031, 0x1654: 0x06e9, 0x1655: 0x06f1, 0x1656: 0x06f9, 0x1657: 0x0701, 0x1658: 0x0709, 0x1659: 0x0711, 0x165a: 0x1fc2, 0x165b: 0x0122, 0x165c: 0x2022, 0x165d: 0x0722, 0x165e: 0x202a, 0x165f: 0x1fd2, 0x1660: 0x204a, 0x1661: 0x0019, 0x1662: 0x02e9, 0x1663: 0x03d9, 0x1664: 0x02f1, 0x1665: 0x02f9, 0x1666: 0x03f1, 0x1667: 0x0309, 0x1668: 0x00a9, 0x1669: 0x0311, 0x166a: 0x00b1, 0x166b: 0x0319, 0x166c: 0x0101, 0x166d: 0x0321, 0x166e: 0x0329, 0x166f: 0x0051, 0x1670: 0x0339, 0x1671: 0x0751, 0x1672: 0x00b9, 0x1673: 0x0089, 0x1674: 0x0341, 0x1675: 0x0349, 0x1676: 0x0391, 0x1677: 0x00c1, 0x1678: 0x0109, 0x1679: 0x00c9, 0x167a: 0x04b1, 0x167b: 0x1ff2, 0x167c: 0x2032, 0x167d: 0x1ffa, 0x167e: 0x21d2, 0x167f: 0x1fda, // Block 0x5a, offset 0x1680 0x1680: 0x0672, 0x1681: 0x0019, 0x1682: 0x02e9, 0x1683: 0x03d9, 0x1684: 0x02f1, 0x1685: 0x02f9, 0x1686: 0x03f1, 0x1687: 0x0309, 0x1688: 0x00a9, 0x1689: 0x0311, 0x168a: 0x00b1, 0x168b: 0x0319, 0x168c: 0x0101, 0x168d: 0x0321, 0x168e: 0x0329, 0x168f: 0x0051, 0x1690: 0x0339, 0x1691: 0x0751, 0x1692: 0x00b9, 0x1693: 0x0089, 0x1694: 0x0341, 0x1695: 0x0349, 0x1696: 0x0391, 0x1697: 0x00c1, 0x1698: 0x0109, 0x1699: 0x00c9, 0x169a: 0x04b1, 0x169b: 0x1fe2, 0x169c: 0x21da, 0x169d: 0x1fea, 0x169e: 0x21e2, 0x169f: 0x810d, 0x16a0: 0x812d, 0x16a1: 0x0961, 0x16a2: 0x814d, 0x16a3: 0x814d, 0x16a4: 0x816d, 0x16a5: 0x818d, 0x16a6: 0x81ad, 0x16a7: 0x81cd, 0x16a8: 0x81ed, 0x16a9: 0x820d, 0x16aa: 0x822d, 0x16ab: 0x824d, 0x16ac: 0x826d, 0x16ad: 0x828d, 0x16ae: 0x82ad, 0x16af: 0x82cd, 0x16b0: 0x82ed, 0x16b1: 0x830d, 0x16b2: 0x832d, 0x16b3: 0x834d, 0x16b4: 0x836d, 0x16b5: 0x838d, 0x16b6: 0x83ad, 0x16b7: 0x83cd, 0x16b8: 0x83ed, 0x16b9: 0x840d, 0x16ba: 0x842d, 0x16bb: 0x844d, 0x16bc: 0x81ed, 0x16bd: 0x846d, 0x16be: 0x848d, 0x16bf: 0x824d, // Block 0x5b, offset 0x16c0 0x16c0: 0x84ad, 0x16c1: 0x84cd, 0x16c2: 0x84ed, 0x16c3: 0x850d, 0x16c4: 0x852d, 0x16c5: 0x854d, 0x16c6: 0x856d, 0x16c7: 0x858d, 0x16c8: 0x850d, 0x16c9: 0x85ad, 0x16ca: 0x850d, 0x16cb: 0x85cd, 0x16cc: 0x85cd, 0x16cd: 0x85ed, 0x16ce: 0x85ed, 0x16cf: 0x860d, 0x16d0: 0x854d, 0x16d1: 0x862d, 0x16d2: 0x864d, 0x16d3: 0x862d, 0x16d4: 0x866d, 0x16d5: 0x864d, 0x16d6: 0x868d, 0x16d7: 0x868d, 0x16d8: 0x86ad, 0x16d9: 0x86ad, 0x16da: 0x86cd, 0x16db: 0x86cd, 0x16dc: 0x864d, 0x16dd: 0x814d, 0x16de: 0x86ed, 0x16df: 0x870d, 0x16e0: 0x0040, 0x16e1: 0x872d, 0x16e2: 0x874d, 0x16e3: 0x876d, 0x16e4: 0x878d, 0x16e5: 0x876d, 0x16e6: 0x87ad, 0x16e7: 0x87cd, 0x16e8: 0x87ed, 0x16e9: 0x87ed, 0x16ea: 0x880d, 0x16eb: 0x880d, 0x16ec: 0x882d, 0x16ed: 0x882d, 0x16ee: 0x880d, 0x16ef: 0x880d, 0x16f0: 0x884d, 0x16f1: 0x886d, 0x16f2: 0x888d, 0x16f3: 0x88ad, 0x16f4: 0x88cd, 0x16f5: 0x88ed, 0x16f6: 0x88ed, 0x16f7: 0x88ed, 0x16f8: 0x890d, 0x16f9: 0x890d, 0x16fa: 0x890d, 0x16fb: 0x890d, 0x16fc: 0x87ed, 0x16fd: 0x87ed, 0x16fe: 0x87ed, 0x16ff: 0x0040, // Block 0x5c, offset 0x1700 0x1700: 0x0040, 0x1701: 0x0040, 0x1702: 0x874d, 0x1703: 0x872d, 0x1704: 0x892d, 0x1705: 0x872d, 0x1706: 0x874d, 0x1707: 0x872d, 0x1708: 0x0040, 0x1709: 0x0040, 0x170a: 0x894d, 0x170b: 0x874d, 0x170c: 0x896d, 0x170d: 0x892d, 0x170e: 0x896d, 0x170f: 0x874d, 0x1710: 0x0040, 0x1711: 0x0040, 0x1712: 0x898d, 0x1713: 0x89ad, 0x1714: 0x88ad, 0x1715: 0x896d, 0x1716: 0x892d, 0x1717: 0x896d, 0x1718: 0x0040, 0x1719: 0x0040, 0x171a: 0x89cd, 0x171b: 0x89ed, 0x171c: 0x89cd, 0x171d: 0x0040, 0x171e: 0x0040, 0x171f: 0x0040, 0x1720: 0x21e9, 0x1721: 0x21f1, 0x1722: 0x21f9, 0x1723: 0x8a0e, 0x1724: 0x2201, 0x1725: 0x2209, 0x1726: 0x8a2d, 0x1727: 0x0040, 0x1728: 0x8a4d, 0x1729: 0x8a6d, 0x172a: 0x8a8d, 0x172b: 0x8a6d, 0x172c: 0x8aad, 0x172d: 0x8acd, 0x172e: 0x8aed, 0x172f: 0x0040, 0x1730: 0x0040, 0x1731: 0x0040, 0x1732: 0x0040, 0x1733: 0x0040, 0x1734: 0x0040, 0x1735: 0x0040, 0x1736: 0x0040, 0x1737: 0x0040, 0x1738: 0x0040, 0x1739: 0x0340, 0x173a: 0x0340, 0x173b: 0x0340, 0x173c: 0x0040, 0x173d: 0x0040, 0x173e: 0x0040, 0x173f: 0x0040, // Block 0x5d, offset 0x1740 0x1740: 0x0008, 0x1741: 0x0008, 0x1742: 0x0008, 0x1743: 0x0008, 0x1744: 0x0008, 0x1745: 0x0008, 0x1746: 0x0008, 0x1747: 0x0008, 0x1748: 0x0008, 0x1749: 0x0008, 0x174a: 0x0008, 0x174b: 0x0008, 0x174c: 0x0008, 0x174d: 0x0008, 0x174e: 0x0008, 0x174f: 0x0008, 0x1750: 0x0008, 0x1751: 0x0008, 0x1752: 0x0008, 0x1753: 0x0008, 0x1754: 0x0008, 0x1755: 0x0008, 0x1756: 0x0008, 0x1757: 0x0008, 0x1758: 0x0008, 0x1759: 0x0008, 0x175a: 0x0008, 0x175b: 0x0008, 0x175c: 0x0008, 0x175d: 0x0008, 0x175e: 0x0008, 0x175f: 0x0008, 0x1760: 0x0008, 0x1761: 0x0008, 0x1762: 0x0008, 0x1763: 0x0008, 0x1764: 0x0040, 0x1765: 0x0040, 0x1766: 0x0040, 0x1767: 0x0040, 0x1768: 0x0040, 0x1769: 0x0040, 0x176a: 0x0040, 0x176b: 0x0040, 0x176c: 0x0040, 0x176d: 0x0040, 0x176e: 0x0040, 0x176f: 0x0018, 0x1770: 0x8b3d, 0x1771: 0x8b55, 0x1772: 0x8b6d, 0x1773: 0x8b55, 0x1774: 0x8b85, 0x1775: 0x8b55, 0x1776: 0x8b6d, 0x1777: 0x8b55, 0x1778: 0x8b3d, 0x1779: 0x8b9d, 0x177a: 0x8bb5, 0x177b: 0x0040, 0x177c: 0x8bcd, 0x177d: 0x8b9d, 0x177e: 0x8bb5, 0x177f: 0x8b9d, // Block 0x5e, offset 0x1780 0x1780: 0xe13d, 0x1781: 0xe14d, 0x1782: 0xe15d, 0x1783: 0xe14d, 0x1784: 0xe17d, 0x1785: 0xe14d, 0x1786: 0xe15d, 0x1787: 0xe14d, 0x1788: 0xe13d, 0x1789: 0xe1cd, 0x178a: 0xe1dd, 0x178b: 0x0040, 0x178c: 0xe1fd, 0x178d: 0xe1cd, 0x178e: 0xe1dd, 0x178f: 0xe1cd, 0x1790: 0xe13d, 0x1791: 0xe14d, 0x1792: 0xe15d, 0x1793: 0x0040, 0x1794: 0xe17d, 0x1795: 0xe14d, 0x1796: 0x0040, 0x1797: 0x0008, 0x1798: 0x0008, 0x1799: 0x0008, 0x179a: 0x0008, 0x179b: 0x0008, 0x179c: 0x0008, 0x179d: 0x0008, 0x179e: 0x0008, 0x179f: 0x0008, 0x17a0: 0x0008, 0x17a1: 0x0008, 0x17a2: 0x0040, 0x17a3: 0x0008, 0x17a4: 0x0008, 0x17a5: 0x0008, 0x17a6: 0x0008, 0x17a7: 0x0008, 0x17a8: 0x0008, 0x17a9: 0x0008, 0x17aa: 0x0008, 0x17ab: 0x0008, 0x17ac: 0x0008, 0x17ad: 0x0008, 0x17ae: 0x0008, 0x17af: 0x0008, 0x17b0: 0x0008, 0x17b1: 0x0008, 0x17b2: 0x0040, 0x17b3: 0x0008, 0x17b4: 0x0008, 0x17b5: 0x0008, 0x17b6: 0x0008, 0x17b7: 0x0008, 0x17b8: 0x0008, 0x17b9: 0x0008, 0x17ba: 0x0040, 0x17bb: 0x0008, 0x17bc: 0x0008, 0x17bd: 0x0040, 0x17be: 0x0040, 0x17bf: 0x0040, // Block 0x5f, offset 0x17c0 0x17c0: 0x0008, 0x17c1: 0x2211, 0x17c2: 0x2219, 0x17c3: 0x02e1, 0x17c4: 0x2221, 0x17c5: 0x2229, 0x17c6: 0x0040, 0x17c7: 0x2231, 0x17c8: 0x2239, 0x17c9: 0x2241, 0x17ca: 0x2249, 0x17cb: 0x2251, 0x17cc: 0x2259, 0x17cd: 0x2261, 0x17ce: 0x2269, 0x17cf: 0x2271, 0x17d0: 0x2279, 0x17d1: 0x2281, 0x17d2: 0x2289, 0x17d3: 0x2291, 0x17d4: 0x2299, 0x17d5: 0x0741, 0x17d6: 0x22a1, 0x17d7: 0x22a9, 0x17d8: 0x22b1, 0x17d9: 0x22b9, 0x17da: 0x22c1, 0x17db: 0x13d9, 0x17dc: 0x8be5, 0x17dd: 0x22c9, 0x17de: 0x22d1, 0x17df: 0x8c05, 0x17e0: 0x22d9, 0x17e1: 0x8c25, 0x17e2: 0x22e1, 0x17e3: 0x22e9, 0x17e4: 0x22f1, 0x17e5: 0x0751, 0x17e6: 0x22f9, 0x17e7: 0x8c45, 0x17e8: 0x0949, 0x17e9: 0x2301, 0x17ea: 0x2309, 0x17eb: 0x2311, 0x17ec: 0x2319, 0x17ed: 0x2321, 0x17ee: 0x2329, 0x17ef: 0x2331, 0x17f0: 0x2339, 0x17f1: 0x0040, 0x17f2: 0x2341, 0x17f3: 0x2349, 0x17f4: 0x2351, 0x17f5: 0x2359, 0x17f6: 0x2361, 0x17f7: 0x2369, 0x17f8: 0x2371, 0x17f9: 0x8c65, 0x17fa: 0x8c85, 0x17fb: 0x0040, 0x17fc: 0x0040, 0x17fd: 0x0040, 0x17fe: 0x0040, 0x17ff: 0x0040, // Block 0x60, offset 0x1800 0x1800: 0x0a08, 0x1801: 0x0a08, 0x1802: 0x0a08, 0x1803: 0x0a08, 0x1804: 0x0a08, 0x1805: 0x0c08, 0x1806: 0x0808, 0x1807: 0x0c08, 0x1808: 0x0818, 0x1809: 0x0c08, 0x180a: 0x0c08, 0x180b: 0x0808, 0x180c: 0x0808, 0x180d: 0x0908, 0x180e: 0x0c08, 0x180f: 0x0c08, 0x1810: 0x0c08, 0x1811: 0x0c08, 0x1812: 0x0c08, 0x1813: 0x0a08, 0x1814: 0x0a08, 0x1815: 0x0a08, 0x1816: 0x0a08, 0x1817: 0x0908, 0x1818: 0x0a08, 0x1819: 0x0a08, 0x181a: 0x0a08, 0x181b: 0x0a08, 0x181c: 0x0a08, 0x181d: 0x0c08, 0x181e: 0x0a08, 0x181f: 0x0a08, 0x1820: 0x0a08, 0x1821: 0x0c08, 0x1822: 0x0808, 0x1823: 0x0808, 0x1824: 0x0c08, 0x1825: 0x3308, 0x1826: 0x3308, 0x1827: 0x0040, 0x1828: 0x0040, 0x1829: 0x0040, 0x182a: 0x0040, 0x182b: 0x0a18, 0x182c: 0x0a18, 0x182d: 0x0a18, 0x182e: 0x0a18, 0x182f: 0x0c18, 0x1830: 0x0818, 0x1831: 0x0818, 0x1832: 0x0818, 0x1833: 0x0818, 0x1834: 0x0818, 0x1835: 0x0818, 0x1836: 0x0818, 0x1837: 0x0040, 0x1838: 0x0040, 0x1839: 0x0040, 0x183a: 0x0040, 0x183b: 0x0040, 0x183c: 0x0040, 0x183d: 0x0040, 0x183e: 0x0040, 0x183f: 0x0040, // Block 0x61, offset 0x1840 0x1840: 0x0a08, 0x1841: 0x0c08, 0x1842: 0x0a08, 0x1843: 0x0c08, 0x1844: 0x0c08, 0x1845: 0x0c08, 0x1846: 0x0a08, 0x1847: 0x0a08, 0x1848: 0x0a08, 0x1849: 0x0c08, 0x184a: 0x0a08, 0x184b: 0x0a08, 0x184c: 0x0c08, 0x184d: 0x0a08, 0x184e: 0x0c08, 0x184f: 0x0c08, 0x1850: 0x0a08, 0x1851: 0x0c08, 0x1852: 0x0040, 0x1853: 0x0040, 0x1854: 0x0040, 0x1855: 0x0040, 0x1856: 0x0040, 0x1857: 0x0040, 0x1858: 0x0040, 0x1859: 0x0818, 0x185a: 0x0818, 0x185b: 0x0818, 0x185c: 0x0818, 0x185d: 0x0040, 0x185e: 0x0040, 0x185f: 0x0040, 0x1860: 0x0040, 0x1861: 0x0040, 0x1862: 0x0040, 0x1863: 0x0040, 0x1864: 0x0040, 0x1865: 0x0040, 0x1866: 0x0040, 0x1867: 0x0040, 0x1868: 0x0040, 0x1869: 0x0c18, 0x186a: 0x0c18, 0x186b: 0x0c18, 0x186c: 0x0c18, 0x186d: 0x0a18, 0x186e: 0x0a18, 0x186f: 0x0818, 0x1870: 0x0040, 0x1871: 0x0040, 0x1872: 0x0040, 0x1873: 0x0040, 0x1874: 0x0040, 0x1875: 0x0040, 0x1876: 0x0040, 0x1877: 0x0040, 0x1878: 0x0040, 0x1879: 0x0040, 0x187a: 0x0040, 0x187b: 0x0040, 0x187c: 0x0040, 0x187d: 0x0040, 0x187e: 0x0040, 0x187f: 0x0040, // Block 0x62, offset 0x1880 0x1880: 0x3308, 0x1881: 0x3308, 0x1882: 0x3008, 0x1883: 0x3008, 0x1884: 0x0040, 0x1885: 0x0008, 0x1886: 0x0008, 0x1887: 0x0008, 0x1888: 0x0008, 0x1889: 0x0008, 0x188a: 0x0008, 0x188b: 0x0008, 0x188c: 0x0008, 0x188d: 0x0040, 0x188e: 0x0040, 0x188f: 0x0008, 0x1890: 0x0008, 0x1891: 0x0040, 0x1892: 0x0040, 0x1893: 0x0008, 0x1894: 0x0008, 0x1895: 0x0008, 0x1896: 0x0008, 0x1897: 0x0008, 0x1898: 0x0008, 0x1899: 0x0008, 0x189a: 0x0008, 0x189b: 0x0008, 0x189c: 0x0008, 0x189d: 0x0008, 0x189e: 0x0008, 0x189f: 0x0008, 0x18a0: 0x0008, 0x18a1: 0x0008, 0x18a2: 0x0008, 0x18a3: 0x0008, 0x18a4: 0x0008, 0x18a5: 0x0008, 0x18a6: 0x0008, 0x18a7: 0x0008, 0x18a8: 0x0008, 0x18a9: 0x0040, 0x18aa: 0x0008, 0x18ab: 0x0008, 0x18ac: 0x0008, 0x18ad: 0x0008, 0x18ae: 0x0008, 0x18af: 0x0008, 0x18b0: 0x0008, 0x18b1: 0x0040, 0x18b2: 0x0008, 0x18b3: 0x0008, 0x18b4: 0x0040, 0x18b5: 0x0008, 0x18b6: 0x0008, 0x18b7: 0x0008, 0x18b8: 0x0008, 0x18b9: 0x0008, 0x18ba: 0x0040, 0x18bb: 0x3308, 0x18bc: 0x3308, 0x18bd: 0x0008, 0x18be: 0x3008, 0x18bf: 0x3008, // Block 0x63, offset 0x18c0 0x18c0: 0x3308, 0x18c1: 0x3008, 0x18c2: 0x3008, 0x18c3: 0x3008, 0x18c4: 0x3008, 0x18c5: 0x0040, 0x18c6: 0x0040, 0x18c7: 0x3008, 0x18c8: 0x3008, 0x18c9: 0x0040, 0x18ca: 0x0040, 0x18cb: 0x3008, 0x18cc: 0x3008, 0x18cd: 0x3808, 0x18ce: 0x0040, 0x18cf: 0x0040, 0x18d0: 0x0008, 0x18d1: 0x0040, 0x18d2: 0x0040, 0x18d3: 0x0040, 0x18d4: 0x0040, 0x18d5: 0x0040, 0x18d6: 0x0040, 0x18d7: 0x3008, 0x18d8: 0x0040, 0x18d9: 0x0040, 0x18da: 0x0040, 0x18db: 0x0040, 0x18dc: 0x0040, 0x18dd: 0x0008, 0x18de: 0x0008, 0x18df: 0x0008, 0x18e0: 0x0008, 0x18e1: 0x0008, 0x18e2: 0x3008, 0x18e3: 0x3008, 0x18e4: 0x0040, 0x18e5: 0x0040, 0x18e6: 0x3308, 0x18e7: 0x3308, 0x18e8: 0x3308, 0x18e9: 0x3308, 0x18ea: 0x3308, 0x18eb: 0x3308, 0x18ec: 0x3308, 0x18ed: 0x0040, 0x18ee: 0x0040, 0x18ef: 0x0040, 0x18f0: 0x3308, 0x18f1: 0x3308, 0x18f2: 0x3308, 0x18f3: 0x3308, 0x18f4: 0x3308, 0x18f5: 0x0040, 0x18f6: 0x0040, 0x18f7: 0x0040, 0x18f8: 0x0040, 0x18f9: 0x0040, 0x18fa: 0x0040, 0x18fb: 0x0040, 0x18fc: 0x0040, 0x18fd: 0x0040, 0x18fe: 0x0040, 0x18ff: 0x0040, // Block 0x64, offset 0x1900 0x1900: 0x0008, 0x1901: 0x0008, 0x1902: 0x0008, 0x1903: 0x0008, 0x1904: 0x0008, 0x1905: 0x0008, 0x1906: 0x0008, 0x1907: 0x0040, 0x1908: 0x0040, 0x1909: 0x0008, 0x190a: 0x0040, 0x190b: 0x0040, 0x190c: 0x0008, 0x190d: 0x0008, 0x190e: 0x0008, 0x190f: 0x0008, 0x1910: 0x0008, 0x1911: 0x0008, 0x1912: 0x0008, 0x1913: 0x0008, 0x1914: 0x0040, 0x1915: 0x0008, 0x1916: 0x0008, 0x1917: 0x0040, 0x1918: 0x0008, 0x1919: 0x0008, 0x191a: 0x0008, 0x191b: 0x0008, 0x191c: 0x0008, 0x191d: 0x0008, 0x191e: 0x0008, 0x191f: 0x0008, 0x1920: 0x0008, 0x1921: 0x0008, 0x1922: 0x0008, 0x1923: 0x0008, 0x1924: 0x0008, 0x1925: 0x0008, 0x1926: 0x0008, 0x1927: 0x0008, 0x1928: 0x0008, 0x1929: 0x0008, 0x192a: 0x0008, 0x192b: 0x0008, 0x192c: 0x0008, 0x192d: 0x0008, 0x192e: 0x0008, 0x192f: 0x0008, 0x1930: 0x3008, 0x1931: 0x3008, 0x1932: 0x3008, 0x1933: 0x3008, 0x1934: 0x3008, 0x1935: 0x3008, 0x1936: 0x0040, 0x1937: 0x3008, 0x1938: 0x3008, 0x1939: 0x0040, 0x193a: 0x0040, 0x193b: 0x3308, 0x193c: 0x3308, 0x193d: 0x3808, 0x193e: 0x3b08, 0x193f: 0x0008, // Block 0x65, offset 0x1940 0x1940: 0x0019, 0x1941: 0x02e9, 0x1942: 0x03d9, 0x1943: 0x02f1, 0x1944: 0x02f9, 0x1945: 0x03f1, 0x1946: 0x0309, 0x1947: 0x00a9, 0x1948: 0x0311, 0x1949: 0x00b1, 0x194a: 0x0319, 0x194b: 0x0101, 0x194c: 0x0321, 0x194d: 0x0329, 0x194e: 0x0051, 0x194f: 0x0339, 0x1950: 0x0751, 0x1951: 0x00b9, 0x1952: 0x0089, 0x1953: 0x0341, 0x1954: 0x0349, 0x1955: 0x0391, 0x1956: 0x00c1, 0x1957: 0x0109, 0x1958: 0x00c9, 0x1959: 0x04b1, 0x195a: 0x0019, 0x195b: 0x02e9, 0x195c: 0x03d9, 0x195d: 0x02f1, 0x195e: 0x02f9, 0x195f: 0x03f1, 0x1960: 0x0309, 0x1961: 0x00a9, 0x1962: 0x0311, 0x1963: 0x00b1, 0x1964: 0x0319, 0x1965: 0x0101, 0x1966: 0x0321, 0x1967: 0x0329, 0x1968: 0x0051, 0x1969: 0x0339, 0x196a: 0x0751, 0x196b: 0x00b9, 0x196c: 0x0089, 0x196d: 0x0341, 0x196e: 0x0349, 0x196f: 0x0391, 0x1970: 0x00c1, 0x1971: 0x0109, 0x1972: 0x00c9, 0x1973: 0x04b1, 0x1974: 0x0019, 0x1975: 0x02e9, 0x1976: 0x03d9, 0x1977: 0x02f1, 0x1978: 0x02f9, 0x1979: 0x03f1, 0x197a: 0x0309, 0x197b: 0x00a9, 0x197c: 0x0311, 0x197d: 0x00b1, 0x197e: 0x0319, 0x197f: 0x0101, // Block 0x66, offset 0x1980 0x1980: 0x0321, 0x1981: 0x0329, 0x1982: 0x0051, 0x1983: 0x0339, 0x1984: 0x0751, 0x1985: 0x00b9, 0x1986: 0x0089, 0x1987: 0x0341, 0x1988: 0x0349, 0x1989: 0x0391, 0x198a: 0x00c1, 0x198b: 0x0109, 0x198c: 0x00c9, 0x198d: 0x04b1, 0x198e: 0x0019, 0x198f: 0x02e9, 0x1990: 0x03d9, 0x1991: 0x02f1, 0x1992: 0x02f9, 0x1993: 0x03f1, 0x1994: 0x0309, 0x1995: 0x0040, 0x1996: 0x0311, 0x1997: 0x00b1, 0x1998: 0x0319, 0x1999: 0x0101, 0x199a: 0x0321, 0x199b: 0x0329, 0x199c: 0x0051, 0x199d: 0x0339, 0x199e: 0x0751, 0x199f: 0x00b9, 0x19a0: 0x0089, 0x19a1: 0x0341, 0x19a2: 0x0349, 0x19a3: 0x0391, 0x19a4: 0x00c1, 0x19a5: 0x0109, 0x19a6: 0x00c9, 0x19a7: 0x04b1, 0x19a8: 0x0019, 0x19a9: 0x02e9, 0x19aa: 0x03d9, 0x19ab: 0x02f1, 0x19ac: 0x02f9, 0x19ad: 0x03f1, 0x19ae: 0x0309, 0x19af: 0x00a9, 0x19b0: 0x0311, 0x19b1: 0x00b1, 0x19b2: 0x0319, 0x19b3: 0x0101, 0x19b4: 0x0321, 0x19b5: 0x0329, 0x19b6: 0x0051, 0x19b7: 0x0339, 0x19b8: 0x0751, 0x19b9: 0x00b9, 0x19ba: 0x0089, 0x19bb: 0x0341, 0x19bc: 0x0349, 0x19bd: 0x0391, 0x19be: 0x00c1, 0x19bf: 0x0109, // Block 0x67, offset 0x19c0 0x19c0: 0x00c9, 0x19c1: 0x04b1, 0x19c2: 0x0019, 0x19c3: 0x02e9, 0x19c4: 0x03d9, 0x19c5: 0x02f1, 0x19c6: 0x02f9, 0x19c7: 0x03f1, 0x19c8: 0x0309, 0x19c9: 0x00a9, 0x19ca: 0x0311, 0x19cb: 0x00b1, 0x19cc: 0x0319, 0x19cd: 0x0101, 0x19ce: 0x0321, 0x19cf: 0x0329, 0x19d0: 0x0051, 0x19d1: 0x0339, 0x19d2: 0x0751, 0x19d3: 0x00b9, 0x19d4: 0x0089, 0x19d5: 0x0341, 0x19d6: 0x0349, 0x19d7: 0x0391, 0x19d8: 0x00c1, 0x19d9: 0x0109, 0x19da: 0x00c9, 0x19db: 0x04b1, 0x19dc: 0x0019, 0x19dd: 0x0040, 0x19de: 0x03d9, 0x19df: 0x02f1, 0x19e0: 0x0040, 0x19e1: 0x0040, 0x19e2: 0x0309, 0x19e3: 0x0040, 0x19e4: 0x0040, 0x19e5: 0x00b1, 0x19e6: 0x0319, 0x19e7: 0x0040, 0x19e8: 0x0040, 0x19e9: 0x0329, 0x19ea: 0x0051, 0x19eb: 0x0339, 0x19ec: 0x0751, 0x19ed: 0x0040, 0x19ee: 0x0089, 0x19ef: 0x0341, 0x19f0: 0x0349, 0x19f1: 0x0391, 0x19f2: 0x00c1, 0x19f3: 0x0109, 0x19f4: 0x00c9, 0x19f5: 0x04b1, 0x19f6: 0x0019, 0x19f7: 0x02e9, 0x19f8: 0x03d9, 0x19f9: 0x02f1, 0x19fa: 0x0040, 0x19fb: 0x03f1, 0x19fc: 0x0040, 0x19fd: 0x00a9, 0x19fe: 0x0311, 0x19ff: 0x00b1, // Block 0x68, offset 0x1a00 0x1a00: 0x0319, 0x1a01: 0x0101, 0x1a02: 0x0321, 0x1a03: 0x0329, 0x1a04: 0x0040, 0x1a05: 0x0339, 0x1a06: 0x0751, 0x1a07: 0x00b9, 0x1a08: 0x0089, 0x1a09: 0x0341, 0x1a0a: 0x0349, 0x1a0b: 0x0391, 0x1a0c: 0x00c1, 0x1a0d: 0x0109, 0x1a0e: 0x00c9, 0x1a0f: 0x04b1, 0x1a10: 0x0019, 0x1a11: 0x02e9, 0x1a12: 0x03d9, 0x1a13: 0x02f1, 0x1a14: 0x02f9, 0x1a15: 0x03f1, 0x1a16: 0x0309, 0x1a17: 0x00a9, 0x1a18: 0x0311, 0x1a19: 0x00b1, 0x1a1a: 0x0319, 0x1a1b: 0x0101, 0x1a1c: 0x0321, 0x1a1d: 0x0329, 0x1a1e: 0x0051, 0x1a1f: 0x0339, 0x1a20: 0x0751, 0x1a21: 0x00b9, 0x1a22: 0x0089, 0x1a23: 0x0341, 0x1a24: 0x0349, 0x1a25: 0x0391, 0x1a26: 0x00c1, 0x1a27: 0x0109, 0x1a28: 0x00c9, 0x1a29: 0x04b1, 0x1a2a: 0x0019, 0x1a2b: 0x02e9, 0x1a2c: 0x03d9, 0x1a2d: 0x02f1, 0x1a2e: 0x02f9, 0x1a2f: 0x03f1, 0x1a30: 0x0309, 0x1a31: 0x00a9, 0x1a32: 0x0311, 0x1a33: 0x00b1, 0x1a34: 0x0319, 0x1a35: 0x0101, 0x1a36: 0x0321, 0x1a37: 0x0329, 0x1a38: 0x0051, 0x1a39: 0x0339, 0x1a3a: 0x0751, 0x1a3b: 0x00b9, 0x1a3c: 0x0089, 0x1a3d: 0x0341, 0x1a3e: 0x0349, 0x1a3f: 0x0391, // Block 0x69, offset 0x1a40 0x1a40: 0x00c1, 0x1a41: 0x0109, 0x1a42: 0x00c9, 0x1a43: 0x04b1, 0x1a44: 0x0019, 0x1a45: 0x02e9, 0x1a46: 0x0040, 0x1a47: 0x02f1, 0x1a48: 0x02f9, 0x1a49: 0x03f1, 0x1a4a: 0x0309, 0x1a4b: 0x0040, 0x1a4c: 0x0040, 0x1a4d: 0x00b1, 0x1a4e: 0x0319, 0x1a4f: 0x0101, 0x1a50: 0x0321, 0x1a51: 0x0329, 0x1a52: 0x0051, 0x1a53: 0x0339, 0x1a54: 0x0751, 0x1a55: 0x0040, 0x1a56: 0x0089, 0x1a57: 0x0341, 0x1a58: 0x0349, 0x1a59: 0x0391, 0x1a5a: 0x00c1, 0x1a5b: 0x0109, 0x1a5c: 0x00c9, 0x1a5d: 0x0040, 0x1a5e: 0x0019, 0x1a5f: 0x02e9, 0x1a60: 0x03d9, 0x1a61: 0x02f1, 0x1a62: 0x02f9, 0x1a63: 0x03f1, 0x1a64: 0x0309, 0x1a65: 0x00a9, 0x1a66: 0x0311, 0x1a67: 0x00b1, 0x1a68: 0x0319, 0x1a69: 0x0101, 0x1a6a: 0x0321, 0x1a6b: 0x0329, 0x1a6c: 0x0051, 0x1a6d: 0x0339, 0x1a6e: 0x0751, 0x1a6f: 0x00b9, 0x1a70: 0x0089, 0x1a71: 0x0341, 0x1a72: 0x0349, 0x1a73: 0x0391, 0x1a74: 0x00c1, 0x1a75: 0x0109, 0x1a76: 0x00c9, 0x1a77: 0x04b1, 0x1a78: 0x0019, 0x1a79: 0x02e9, 0x1a7a: 0x0040, 0x1a7b: 0x02f1, 0x1a7c: 0x02f9, 0x1a7d: 0x03f1, 0x1a7e: 0x0309, 0x1a7f: 0x0040, // Block 0x6a, offset 0x1a80 0x1a80: 0x0311, 0x1a81: 0x00b1, 0x1a82: 0x0319, 0x1a83: 0x0101, 0x1a84: 0x0321, 0x1a85: 0x0040, 0x1a86: 0x0051, 0x1a87: 0x0040, 0x1a88: 0x0040, 0x1a89: 0x0040, 0x1a8a: 0x0089, 0x1a8b: 0x0341, 0x1a8c: 0x0349, 0x1a8d: 0x0391, 0x1a8e: 0x00c1, 0x1a8f: 0x0109, 0x1a90: 0x00c9, 0x1a91: 0x0040, 0x1a92: 0x0019, 0x1a93: 0x02e9, 0x1a94: 0x03d9, 0x1a95: 0x02f1, 0x1a96: 0x02f9, 0x1a97: 0x03f1, 0x1a98: 0x0309, 0x1a99: 0x00a9, 0x1a9a: 0x0311, 0x1a9b: 0x00b1, 0x1a9c: 0x0319, 0x1a9d: 0x0101, 0x1a9e: 0x0321, 0x1a9f: 0x0329, 0x1aa0: 0x0051, 0x1aa1: 0x0339, 0x1aa2: 0x0751, 0x1aa3: 0x00b9, 0x1aa4: 0x0089, 0x1aa5: 0x0341, 0x1aa6: 0x0349, 0x1aa7: 0x0391, 0x1aa8: 0x00c1, 0x1aa9: 0x0109, 0x1aaa: 0x00c9, 0x1aab: 0x04b1, 0x1aac: 0x0019, 0x1aad: 0x02e9, 0x1aae: 0x03d9, 0x1aaf: 0x02f1, 0x1ab0: 0x02f9, 0x1ab1: 0x03f1, 0x1ab2: 0x0309, 0x1ab3: 0x00a9, 0x1ab4: 0x0311, 0x1ab5: 0x00b1, 0x1ab6: 0x0319, 0x1ab7: 0x0101, 0x1ab8: 0x0321, 0x1ab9: 0x0329, 0x1aba: 0x0051, 0x1abb: 0x0339, 0x1abc: 0x0751, 0x1abd: 0x00b9, 0x1abe: 0x0089, 0x1abf: 0x0341, // Block 0x6b, offset 0x1ac0 0x1ac0: 0x0349, 0x1ac1: 0x0391, 0x1ac2: 0x00c1, 0x1ac3: 0x0109, 0x1ac4: 0x00c9, 0x1ac5: 0x04b1, 0x1ac6: 0x0019, 0x1ac7: 0x02e9, 0x1ac8: 0x03d9, 0x1ac9: 0x02f1, 0x1aca: 0x02f9, 0x1acb: 0x03f1, 0x1acc: 0x0309, 0x1acd: 0x00a9, 0x1ace: 0x0311, 0x1acf: 0x00b1, 0x1ad0: 0x0319, 0x1ad1: 0x0101, 0x1ad2: 0x0321, 0x1ad3: 0x0329, 0x1ad4: 0x0051, 0x1ad5: 0x0339, 0x1ad6: 0x0751, 0x1ad7: 0x00b9, 0x1ad8: 0x0089, 0x1ad9: 0x0341, 0x1ada: 0x0349, 0x1adb: 0x0391, 0x1adc: 0x00c1, 0x1add: 0x0109, 0x1ade: 0x00c9, 0x1adf: 0x04b1, 0x1ae0: 0x0019, 0x1ae1: 0x02e9, 0x1ae2: 0x03d9, 0x1ae3: 0x02f1, 0x1ae4: 0x02f9, 0x1ae5: 0x03f1, 0x1ae6: 0x0309, 0x1ae7: 0x00a9, 0x1ae8: 0x0311, 0x1ae9: 0x00b1, 0x1aea: 0x0319, 0x1aeb: 0x0101, 0x1aec: 0x0321, 0x1aed: 0x0329, 0x1aee: 0x0051, 0x1aef: 0x0339, 0x1af0: 0x0751, 0x1af1: 0x00b9, 0x1af2: 0x0089, 0x1af3: 0x0341, 0x1af4: 0x0349, 0x1af5: 0x0391, 0x1af6: 0x00c1, 0x1af7: 0x0109, 0x1af8: 0x00c9, 0x1af9: 0x04b1, 0x1afa: 0x0019, 0x1afb: 0x02e9, 0x1afc: 0x03d9, 0x1afd: 0x02f1, 0x1afe: 0x02f9, 0x1aff: 0x03f1, // Block 0x6c, offset 0x1b00 0x1b00: 0x0309, 0x1b01: 0x00a9, 0x1b02: 0x0311, 0x1b03: 0x00b1, 0x1b04: 0x0319, 0x1b05: 0x0101, 0x1b06: 0x0321, 0x1b07: 0x0329, 0x1b08: 0x0051, 0x1b09: 0x0339, 0x1b0a: 0x0751, 0x1b0b: 0x00b9, 0x1b0c: 0x0089, 0x1b0d: 0x0341, 0x1b0e: 0x0349, 0x1b0f: 0x0391, 0x1b10: 0x00c1, 0x1b11: 0x0109, 0x1b12: 0x00c9, 0x1b13: 0x04b1, 0x1b14: 0x0019, 0x1b15: 0x02e9, 0x1b16: 0x03d9, 0x1b17: 0x02f1, 0x1b18: 0x02f9, 0x1b19: 0x03f1, 0x1b1a: 0x0309, 0x1b1b: 0x00a9, 0x1b1c: 0x0311, 0x1b1d: 0x00b1, 0x1b1e: 0x0319, 0x1b1f: 0x0101, 0x1b20: 0x0321, 0x1b21: 0x0329, 0x1b22: 0x0051, 0x1b23: 0x0339, 0x1b24: 0x0751, 0x1b25: 0x00b9, 0x1b26: 0x0089, 0x1b27: 0x0341, 0x1b28: 0x0349, 0x1b29: 0x0391, 0x1b2a: 0x00c1, 0x1b2b: 0x0109, 0x1b2c: 0x00c9, 0x1b2d: 0x04b1, 0x1b2e: 0x0019, 0x1b2f: 0x02e9, 0x1b30: 0x03d9, 0x1b31: 0x02f1, 0x1b32: 0x02f9, 0x1b33: 0x03f1, 0x1b34: 0x0309, 0x1b35: 0x00a9, 0x1b36: 0x0311, 0x1b37: 0x00b1, 0x1b38: 0x0319, 0x1b39: 0x0101, 0x1b3a: 0x0321, 0x1b3b: 0x0329, 0x1b3c: 0x0051, 0x1b3d: 0x0339, 0x1b3e: 0x0751, 0x1b3f: 0x00b9, // Block 0x6d, offset 0x1b40 0x1b40: 0x0089, 0x1b41: 0x0341, 0x1b42: 0x0349, 0x1b43: 0x0391, 0x1b44: 0x00c1, 0x1b45: 0x0109, 0x1b46: 0x00c9, 0x1b47: 0x04b1, 0x1b48: 0x0019, 0x1b49: 0x02e9, 0x1b4a: 0x03d9, 0x1b4b: 0x02f1, 0x1b4c: 0x02f9, 0x1b4d: 0x03f1, 0x1b4e: 0x0309, 0x1b4f: 0x00a9, 0x1b50: 0x0311, 0x1b51: 0x00b1, 0x1b52: 0x0319, 0x1b53: 0x0101, 0x1b54: 0x0321, 0x1b55: 0x0329, 0x1b56: 0x0051, 0x1b57: 0x0339, 0x1b58: 0x0751, 0x1b59: 0x00b9, 0x1b5a: 0x0089, 0x1b5b: 0x0341, 0x1b5c: 0x0349, 0x1b5d: 0x0391, 0x1b5e: 0x00c1, 0x1b5f: 0x0109, 0x1b60: 0x00c9, 0x1b61: 0x04b1, 0x1b62: 0x0019, 0x1b63: 0x02e9, 0x1b64: 0x03d9, 0x1b65: 0x02f1, 0x1b66: 0x02f9, 0x1b67: 0x03f1, 0x1b68: 0x0309, 0x1b69: 0x00a9, 0x1b6a: 0x0311, 0x1b6b: 0x00b1, 0x1b6c: 0x0319, 0x1b6d: 0x0101, 0x1b6e: 0x0321, 0x1b6f: 0x0329, 0x1b70: 0x0051, 0x1b71: 0x0339, 0x1b72: 0x0751, 0x1b73: 0x00b9, 0x1b74: 0x0089, 0x1b75: 0x0341, 0x1b76: 0x0349, 0x1b77: 0x0391, 0x1b78: 0x00c1, 0x1b79: 0x0109, 0x1b7a: 0x00c9, 0x1b7b: 0x04b1, 0x1b7c: 0x0019, 0x1b7d: 0x02e9, 0x1b7e: 0x03d9, 0x1b7f: 0x02f1, // Block 0x6e, offset 0x1b80 0x1b80: 0x02f9, 0x1b81: 0x03f1, 0x1b82: 0x0309, 0x1b83: 0x00a9, 0x1b84: 0x0311, 0x1b85: 0x00b1, 0x1b86: 0x0319, 0x1b87: 0x0101, 0x1b88: 0x0321, 0x1b89: 0x0329, 0x1b8a: 0x0051, 0x1b8b: 0x0339, 0x1b8c: 0x0751, 0x1b8d: 0x00b9, 0x1b8e: 0x0089, 0x1b8f: 0x0341, 0x1b90: 0x0349, 0x1b91: 0x0391, 0x1b92: 0x00c1, 0x1b93: 0x0109, 0x1b94: 0x00c9, 0x1b95: 0x04b1, 0x1b96: 0x0019, 0x1b97: 0x02e9, 0x1b98: 0x03d9, 0x1b99: 0x02f1, 0x1b9a: 0x02f9, 0x1b9b: 0x03f1, 0x1b9c: 0x0309, 0x1b9d: 0x00a9, 0x1b9e: 0x0311, 0x1b9f: 0x00b1, 0x1ba0: 0x0319, 0x1ba1: 0x0101, 0x1ba2: 0x0321, 0x1ba3: 0x0329, 0x1ba4: 0x0051, 0x1ba5: 0x0339, 0x1ba6: 0x0751, 0x1ba7: 0x00b9, 0x1ba8: 0x0089, 0x1ba9: 0x0341, 0x1baa: 0x0349, 0x1bab: 0x0391, 0x1bac: 0x00c1, 0x1bad: 0x0109, 0x1bae: 0x00c9, 0x1baf: 0x04b1, 0x1bb0: 0x0019, 0x1bb1: 0x02e9, 0x1bb2: 0x03d9, 0x1bb3: 0x02f1, 0x1bb4: 0x02f9, 0x1bb5: 0x03f1, 0x1bb6: 0x0309, 0x1bb7: 0x00a9, 0x1bb8: 0x0311, 0x1bb9: 0x00b1, 0x1bba: 0x0319, 0x1bbb: 0x0101, 0x1bbc: 0x0321, 0x1bbd: 0x0329, 0x1bbe: 0x0051, 0x1bbf: 0x0339, // Block 0x6f, offset 0x1bc0 0x1bc0: 0x0751, 0x1bc1: 0x00b9, 0x1bc2: 0x0089, 0x1bc3: 0x0341, 0x1bc4: 0x0349, 0x1bc5: 0x0391, 0x1bc6: 0x00c1, 0x1bc7: 0x0109, 0x1bc8: 0x00c9, 0x1bc9: 0x04b1, 0x1bca: 0x0019, 0x1bcb: 0x02e9, 0x1bcc: 0x03d9, 0x1bcd: 0x02f1, 0x1bce: 0x02f9, 0x1bcf: 0x03f1, 0x1bd0: 0x0309, 0x1bd1: 0x00a9, 0x1bd2: 0x0311, 0x1bd3: 0x00b1, 0x1bd4: 0x0319, 0x1bd5: 0x0101, 0x1bd6: 0x0321, 0x1bd7: 0x0329, 0x1bd8: 0x0051, 0x1bd9: 0x0339, 0x1bda: 0x0751, 0x1bdb: 0x00b9, 0x1bdc: 0x0089, 0x1bdd: 0x0341, 0x1bde: 0x0349, 0x1bdf: 0x0391, 0x1be0: 0x00c1, 0x1be1: 0x0109, 0x1be2: 0x00c9, 0x1be3: 0x04b1, 0x1be4: 0x23e1, 0x1be5: 0x23e9, 0x1be6: 0x0040, 0x1be7: 0x0040, 0x1be8: 0x23f1, 0x1be9: 0x0399, 0x1bea: 0x03a1, 0x1beb: 0x03a9, 0x1bec: 0x23f9, 0x1bed: 0x2401, 0x1bee: 0x2409, 0x1bef: 0x04d1, 0x1bf0: 0x05f9, 0x1bf1: 0x2411, 0x1bf2: 0x2419, 0x1bf3: 0x2421, 0x1bf4: 0x2429, 0x1bf5: 0x2431, 0x1bf6: 0x2439, 0x1bf7: 0x0799, 0x1bf8: 0x03c1, 0x1bf9: 0x04d1, 0x1bfa: 0x2441, 0x1bfb: 0x2449, 0x1bfc: 0x2451, 0x1bfd: 0x03b1, 0x1bfe: 0x03b9, 0x1bff: 0x2459, // Block 0x70, offset 0x1c00 0x1c00: 0x0769, 0x1c01: 0x2461, 0x1c02: 0x23f1, 0x1c03: 0x0399, 0x1c04: 0x03a1, 0x1c05: 0x03a9, 0x1c06: 0x23f9, 0x1c07: 0x2401, 0x1c08: 0x2409, 0x1c09: 0x04d1, 0x1c0a: 0x05f9, 0x1c0b: 0x2411, 0x1c0c: 0x2419, 0x1c0d: 0x2421, 0x1c0e: 0x2429, 0x1c0f: 0x2431, 0x1c10: 0x2439, 0x1c11: 0x0799, 0x1c12: 0x03c1, 0x1c13: 0x2441, 0x1c14: 0x2441, 0x1c15: 0x2449, 0x1c16: 0x2451, 0x1c17: 0x03b1, 0x1c18: 0x03b9, 0x1c19: 0x2459, 0x1c1a: 0x0769, 0x1c1b: 0x2469, 0x1c1c: 0x23f9, 0x1c1d: 0x04d1, 0x1c1e: 0x2411, 0x1c1f: 0x03b1, 0x1c20: 0x03c1, 0x1c21: 0x0799, 0x1c22: 0x23f1, 0x1c23: 0x0399, 0x1c24: 0x03a1, 0x1c25: 0x03a9, 0x1c26: 0x23f9, 0x1c27: 0x2401, 0x1c28: 0x2409, 0x1c29: 0x04d1, 0x1c2a: 0x05f9, 0x1c2b: 0x2411, 0x1c2c: 0x2419, 0x1c2d: 0x2421, 0x1c2e: 0x2429, 0x1c2f: 0x2431, 0x1c30: 0x2439, 0x1c31: 0x0799, 0x1c32: 0x03c1, 0x1c33: 0x04d1, 0x1c34: 0x2441, 0x1c35: 0x2449, 0x1c36: 0x2451, 0x1c37: 0x03b1, 0x1c38: 0x03b9, 0x1c39: 0x2459, 0x1c3a: 0x0769, 0x1c3b: 0x2461, 0x1c3c: 0x23f1, 0x1c3d: 0x0399, 0x1c3e: 0x03a1, 0x1c3f: 0x03a9, // Block 0x71, offset 0x1c40 0x1c40: 0x23f9, 0x1c41: 0x2401, 0x1c42: 0x2409, 0x1c43: 0x04d1, 0x1c44: 0x05f9, 0x1c45: 0x2411, 0x1c46: 0x2419, 0x1c47: 0x2421, 0x1c48: 0x2429, 0x1c49: 0x2431, 0x1c4a: 0x2439, 0x1c4b: 0x0799, 0x1c4c: 0x03c1, 0x1c4d: 0x2441, 0x1c4e: 0x2441, 0x1c4f: 0x2449, 0x1c50: 0x2451, 0x1c51: 0x03b1, 0x1c52: 0x03b9, 0x1c53: 0x2459, 0x1c54: 0x0769, 0x1c55: 0x2469, 0x1c56: 0x23f9, 0x1c57: 0x04d1, 0x1c58: 0x2411, 0x1c59: 0x03b1, 0x1c5a: 0x03c1, 0x1c5b: 0x0799, 0x1c5c: 0x23f1, 0x1c5d: 0x0399, 0x1c5e: 0x03a1, 0x1c5f: 0x03a9, 0x1c60: 0x23f9, 0x1c61: 0x2401, 0x1c62: 0x2409, 0x1c63: 0x04d1, 0x1c64: 0x05f9, 0x1c65: 0x2411, 0x1c66: 0x2419, 0x1c67: 0x2421, 0x1c68: 0x2429, 0x1c69: 0x2431, 0x1c6a: 0x2439, 0x1c6b: 0x0799, 0x1c6c: 0x03c1, 0x1c6d: 0x04d1, 0x1c6e: 0x2441, 0x1c6f: 0x2449, 0x1c70: 0x2451, 0x1c71: 0x03b1, 0x1c72: 0x03b9, 0x1c73: 0x2459, 0x1c74: 0x0769, 0x1c75: 0x2461, 0x1c76: 0x23f1, 0x1c77: 0x0399, 0x1c78: 0x03a1, 0x1c79: 0x03a9, 0x1c7a: 0x23f9, 0x1c7b: 0x2401, 0x1c7c: 0x2409, 0x1c7d: 0x04d1, 0x1c7e: 0x05f9, 0x1c7f: 0x2411, // Block 0x72, offset 0x1c80 0x1c80: 0x2419, 0x1c81: 0x2421, 0x1c82: 0x2429, 0x1c83: 0x2431, 0x1c84: 0x2439, 0x1c85: 0x0799, 0x1c86: 0x03c1, 0x1c87: 0x2441, 0x1c88: 0x2441, 0x1c89: 0x2449, 0x1c8a: 0x2451, 0x1c8b: 0x03b1, 0x1c8c: 0x03b9, 0x1c8d: 0x2459, 0x1c8e: 0x0769, 0x1c8f: 0x2469, 0x1c90: 0x23f9, 0x1c91: 0x04d1, 0x1c92: 0x2411, 0x1c93: 0x03b1, 0x1c94: 0x03c1, 0x1c95: 0x0799, 0x1c96: 0x23f1, 0x1c97: 0x0399, 0x1c98: 0x03a1, 0x1c99: 0x03a9, 0x1c9a: 0x23f9, 0x1c9b: 0x2401, 0x1c9c: 0x2409, 0x1c9d: 0x04d1, 0x1c9e: 0x05f9, 0x1c9f: 0x2411, 0x1ca0: 0x2419, 0x1ca1: 0x2421, 0x1ca2: 0x2429, 0x1ca3: 0x2431, 0x1ca4: 0x2439, 0x1ca5: 0x0799, 0x1ca6: 0x03c1, 0x1ca7: 0x04d1, 0x1ca8: 0x2441, 0x1ca9: 0x2449, 0x1caa: 0x2451, 0x1cab: 0x03b1, 0x1cac: 0x03b9, 0x1cad: 0x2459, 0x1cae: 0x0769, 0x1caf: 0x2461, 0x1cb0: 0x23f1, 0x1cb1: 0x0399, 0x1cb2: 0x03a1, 0x1cb3: 0x03a9, 0x1cb4: 0x23f9, 0x1cb5: 0x2401, 0x1cb6: 0x2409, 0x1cb7: 0x04d1, 0x1cb8: 0x05f9, 0x1cb9: 0x2411, 0x1cba: 0x2419, 0x1cbb: 0x2421, 0x1cbc: 0x2429, 0x1cbd: 0x2431, 0x1cbe: 0x2439, 0x1cbf: 0x0799, // Block 0x73, offset 0x1cc0 0x1cc0: 0x03c1, 0x1cc1: 0x2441, 0x1cc2: 0x2441, 0x1cc3: 0x2449, 0x1cc4: 0x2451, 0x1cc5: 0x03b1, 0x1cc6: 0x03b9, 0x1cc7: 0x2459, 0x1cc8: 0x0769, 0x1cc9: 0x2469, 0x1cca: 0x23f9, 0x1ccb: 0x04d1, 0x1ccc: 0x2411, 0x1ccd: 0x03b1, 0x1cce: 0x03c1, 0x1ccf: 0x0799, 0x1cd0: 0x23f1, 0x1cd1: 0x0399, 0x1cd2: 0x03a1, 0x1cd3: 0x03a9, 0x1cd4: 0x23f9, 0x1cd5: 0x2401, 0x1cd6: 0x2409, 0x1cd7: 0x04d1, 0x1cd8: 0x05f9, 0x1cd9: 0x2411, 0x1cda: 0x2419, 0x1cdb: 0x2421, 0x1cdc: 0x2429, 0x1cdd: 0x2431, 0x1cde: 0x2439, 0x1cdf: 0x0799, 0x1ce0: 0x03c1, 0x1ce1: 0x04d1, 0x1ce2: 0x2441, 0x1ce3: 0x2449, 0x1ce4: 0x2451, 0x1ce5: 0x03b1, 0x1ce6: 0x03b9, 0x1ce7: 0x2459, 0x1ce8: 0x0769, 0x1ce9: 0x2461, 0x1cea: 0x23f1, 0x1ceb: 0x0399, 0x1cec: 0x03a1, 0x1ced: 0x03a9, 0x1cee: 0x23f9, 0x1cef: 0x2401, 0x1cf0: 0x2409, 0x1cf1: 0x04d1, 0x1cf2: 0x05f9, 0x1cf3: 0x2411, 0x1cf4: 0x2419, 0x1cf5: 0x2421, 0x1cf6: 0x2429, 0x1cf7: 0x2431, 0x1cf8: 0x2439, 0x1cf9: 0x0799, 0x1cfa: 0x03c1, 0x1cfb: 0x2441, 0x1cfc: 0x2441, 0x1cfd: 0x2449, 0x1cfe: 0x2451, 0x1cff: 0x03b1, // Block 0x74, offset 0x1d00 0x1d00: 0x03b9, 0x1d01: 0x2459, 0x1d02: 0x0769, 0x1d03: 0x2469, 0x1d04: 0x23f9, 0x1d05: 0x04d1, 0x1d06: 0x2411, 0x1d07: 0x03b1, 0x1d08: 0x03c1, 0x1d09: 0x0799, 0x1d0a: 0x2471, 0x1d0b: 0x2471, 0x1d0c: 0x0040, 0x1d0d: 0x0040, 0x1d0e: 0x06e1, 0x1d0f: 0x0049, 0x1d10: 0x0029, 0x1d11: 0x0031, 0x1d12: 0x06e9, 0x1d13: 0x06f1, 0x1d14: 0x06f9, 0x1d15: 0x0701, 0x1d16: 0x0709, 0x1d17: 0x0711, 0x1d18: 0x06e1, 0x1d19: 0x0049, 0x1d1a: 0x0029, 0x1d1b: 0x0031, 0x1d1c: 0x06e9, 0x1d1d: 0x06f1, 0x1d1e: 0x06f9, 0x1d1f: 0x0701, 0x1d20: 0x0709, 0x1d21: 0x0711, 0x1d22: 0x06e1, 0x1d23: 0x0049, 0x1d24: 0x0029, 0x1d25: 0x0031, 0x1d26: 0x06e9, 0x1d27: 0x06f1, 0x1d28: 0x06f9, 0x1d29: 0x0701, 0x1d2a: 0x0709, 0x1d2b: 0x0711, 0x1d2c: 0x06e1, 0x1d2d: 0x0049, 0x1d2e: 0x0029, 0x1d2f: 0x0031, 0x1d30: 0x06e9, 0x1d31: 0x06f1, 0x1d32: 0x06f9, 0x1d33: 0x0701, 0x1d34: 0x0709, 0x1d35: 0x0711, 0x1d36: 0x06e1, 0x1d37: 0x0049, 0x1d38: 0x0029, 0x1d39: 0x0031, 0x1d3a: 0x06e9, 0x1d3b: 0x06f1, 0x1d3c: 0x06f9, 0x1d3d: 0x0701, 0x1d3e: 0x0709, 0x1d3f: 0x0711, // Block 0x75, offset 0x1d40 0x1d40: 0x3308, 0x1d41: 0x3308, 0x1d42: 0x3308, 0x1d43: 0x3308, 0x1d44: 0x3308, 0x1d45: 0x3308, 0x1d46: 0x3308, 0x1d47: 0x0040, 0x1d48: 0x3308, 0x1d49: 0x3308, 0x1d4a: 0x3308, 0x1d4b: 0x3308, 0x1d4c: 0x3308, 0x1d4d: 0x3308, 0x1d4e: 0x3308, 0x1d4f: 0x3308, 0x1d50: 0x3308, 0x1d51: 0x3308, 0x1d52: 0x3308, 0x1d53: 0x3308, 0x1d54: 0x3308, 0x1d55: 0x3308, 0x1d56: 0x3308, 0x1d57: 0x3308, 0x1d58: 0x3308, 0x1d59: 0x0040, 0x1d5a: 0x0040, 0x1d5b: 0x3308, 0x1d5c: 0x3308, 0x1d5d: 0x3308, 0x1d5e: 0x3308, 0x1d5f: 0x3308, 0x1d60: 0x3308, 0x1d61: 0x3308, 0x1d62: 0x0040, 0x1d63: 0x3308, 0x1d64: 0x3308, 0x1d65: 0x0040, 0x1d66: 0x3308, 0x1d67: 0x3308, 0x1d68: 0x3308, 0x1d69: 0x3308, 0x1d6a: 0x3308, 0x1d6b: 0x0040, 0x1d6c: 0x0040, 0x1d6d: 0x0040, 0x1d6e: 0x0040, 0x1d6f: 0x0040, 0x1d70: 0x2479, 0x1d71: 0x2481, 0x1d72: 0x02a9, 0x1d73: 0x2489, 0x1d74: 0x02b1, 0x1d75: 0x2491, 0x1d76: 0x2499, 0x1d77: 0x24a1, 0x1d78: 0x24a9, 0x1d79: 0x24b1, 0x1d7a: 0x24b9, 0x1d7b: 0x24c1, 0x1d7c: 0x02b9, 0x1d7d: 0x24c9, 0x1d7e: 0x24d1, 0x1d7f: 0x02c1, // Block 0x76, offset 0x1d80 0x1d80: 0x02c9, 0x1d81: 0x24d9, 0x1d82: 0x24e1, 0x1d83: 0x24e9, 0x1d84: 0x24f1, 0x1d85: 0x24f9, 0x1d86: 0x2501, 0x1d87: 0x2509, 0x1d88: 0x2511, 0x1d89: 0x2519, 0x1d8a: 0x2521, 0x1d8b: 0x2529, 0x1d8c: 0x2531, 0x1d8d: 0x2539, 0x1d8e: 0x2541, 0x1d8f: 0x2549, 0x1d90: 0x2551, 0x1d91: 0x2479, 0x1d92: 0x2481, 0x1d93: 0x02a9, 0x1d94: 0x2489, 0x1d95: 0x02b1, 0x1d96: 0x2491, 0x1d97: 0x2499, 0x1d98: 0x24a1, 0x1d99: 0x24a9, 0x1d9a: 0x24b1, 0x1d9b: 0x24b9, 0x1d9c: 0x02b9, 0x1d9d: 0x24c9, 0x1d9e: 0x02c1, 0x1d9f: 0x24d9, 0x1da0: 0x24e1, 0x1da1: 0x24e9, 0x1da2: 0x24f1, 0x1da3: 0x24f9, 0x1da4: 0x2501, 0x1da5: 0x02d1, 0x1da6: 0x2509, 0x1da7: 0x2559, 0x1da8: 0x2531, 0x1da9: 0x2561, 0x1daa: 0x2569, 0x1dab: 0x2571, 0x1dac: 0x2579, 0x1dad: 0x2581, 0x1dae: 0x0040, 0x1daf: 0x0040, 0x1db0: 0x0040, 0x1db1: 0x0040, 0x1db2: 0x0040, 0x1db3: 0x0040, 0x1db4: 0x0040, 0x1db5: 0x0040, 0x1db6: 0x0040, 0x1db7: 0x0040, 0x1db8: 0x0040, 0x1db9: 0x0040, 0x1dba: 0x0040, 0x1dbb: 0x0040, 0x1dbc: 0x0040, 0x1dbd: 0x0040, 0x1dbe: 0x0040, 0x1dbf: 0x0040, // Block 0x77, offset 0x1dc0 0x1dc0: 0xe115, 0x1dc1: 0xe115, 0x1dc2: 0xe135, 0x1dc3: 0xe135, 0x1dc4: 0xe115, 0x1dc5: 0xe115, 0x1dc6: 0xe175, 0x1dc7: 0xe175, 0x1dc8: 0xe115, 0x1dc9: 0xe115, 0x1dca: 0xe135, 0x1dcb: 0xe135, 0x1dcc: 0xe115, 0x1dcd: 0xe115, 0x1dce: 0xe1f5, 0x1dcf: 0xe1f5, 0x1dd0: 0xe115, 0x1dd1: 0xe115, 0x1dd2: 0xe135, 0x1dd3: 0xe135, 0x1dd4: 0xe115, 0x1dd5: 0xe115, 0x1dd6: 0xe175, 0x1dd7: 0xe175, 0x1dd8: 0xe115, 0x1dd9: 0xe115, 0x1dda: 0xe135, 0x1ddb: 0xe135, 0x1ddc: 0xe115, 0x1ddd: 0xe115, 0x1dde: 0x8ca5, 0x1ddf: 0x8ca5, 0x1de0: 0x04b5, 0x1de1: 0x04b5, 0x1de2: 0x0a08, 0x1de3: 0x0a08, 0x1de4: 0x0a08, 0x1de5: 0x0a08, 0x1de6: 0x0a08, 0x1de7: 0x0a08, 0x1de8: 0x0a08, 0x1de9: 0x0a08, 0x1dea: 0x0a08, 0x1deb: 0x0a08, 0x1dec: 0x0a08, 0x1ded: 0x0a08, 0x1dee: 0x0a08, 0x1def: 0x0a08, 0x1df0: 0x0a08, 0x1df1: 0x0a08, 0x1df2: 0x0a08, 0x1df3: 0x0a08, 0x1df4: 0x0a08, 0x1df5: 0x0a08, 0x1df6: 0x0a08, 0x1df7: 0x0a08, 0x1df8: 0x0a08, 0x1df9: 0x0a08, 0x1dfa: 0x0a08, 0x1dfb: 0x0a08, 0x1dfc: 0x0a08, 0x1dfd: 0x0a08, 0x1dfe: 0x0a08, 0x1dff: 0x0a08, // Block 0x78, offset 0x1e00 0x1e00: 0x20b1, 0x1e01: 0x20b9, 0x1e02: 0x20d9, 0x1e03: 0x20f1, 0x1e04: 0x0040, 0x1e05: 0x2189, 0x1e06: 0x2109, 0x1e07: 0x20e1, 0x1e08: 0x2131, 0x1e09: 0x2191, 0x1e0a: 0x2161, 0x1e0b: 0x2169, 0x1e0c: 0x2171, 0x1e0d: 0x2179, 0x1e0e: 0x2111, 0x1e0f: 0x2141, 0x1e10: 0x2151, 0x1e11: 0x2121, 0x1e12: 0x2159, 0x1e13: 0x2101, 0x1e14: 0x2119, 0x1e15: 0x20c9, 0x1e16: 0x20d1, 0x1e17: 0x20e9, 0x1e18: 0x20f9, 0x1e19: 0x2129, 0x1e1a: 0x2139, 0x1e1b: 0x2149, 0x1e1c: 0x2589, 0x1e1d: 0x1689, 0x1e1e: 0x2591, 0x1e1f: 0x2599, 0x1e20: 0x0040, 0x1e21: 0x20b9, 0x1e22: 0x20d9, 0x1e23: 0x0040, 0x1e24: 0x2181, 0x1e25: 0x0040, 0x1e26: 0x0040, 0x1e27: 0x20e1, 0x1e28: 0x0040, 0x1e29: 0x2191, 0x1e2a: 0x2161, 0x1e2b: 0x2169, 0x1e2c: 0x2171, 0x1e2d: 0x2179, 0x1e2e: 0x2111, 0x1e2f: 0x2141, 0x1e30: 0x2151, 0x1e31: 0x2121, 0x1e32: 0x2159, 0x1e33: 0x0040, 0x1e34: 0x2119, 0x1e35: 0x20c9, 0x1e36: 0x20d1, 0x1e37: 0x20e9, 0x1e38: 0x0040, 0x1e39: 0x2129, 0x1e3a: 0x0040, 0x1e3b: 0x2149, 0x1e3c: 0x0040, 0x1e3d: 0x0040, 0x1e3e: 0x0040, 0x1e3f: 0x0040, // Block 0x79, offset 0x1e40 0x1e40: 0x0040, 0x1e41: 0x0040, 0x1e42: 0x20d9, 0x1e43: 0x0040, 0x1e44: 0x0040, 0x1e45: 0x0040, 0x1e46: 0x0040, 0x1e47: 0x20e1, 0x1e48: 0x0040, 0x1e49: 0x2191, 0x1e4a: 0x0040, 0x1e4b: 0x2169, 0x1e4c: 0x0040, 0x1e4d: 0x2179, 0x1e4e: 0x2111, 0x1e4f: 0x2141, 0x1e50: 0x0040, 0x1e51: 0x2121, 0x1e52: 0x2159, 0x1e53: 0x0040, 0x1e54: 0x2119, 0x1e55: 0x0040, 0x1e56: 0x0040, 0x1e57: 0x20e9, 0x1e58: 0x0040, 0x1e59: 0x2129, 0x1e5a: 0x0040, 0x1e5b: 0x2149, 0x1e5c: 0x0040, 0x1e5d: 0x1689, 0x1e5e: 0x0040, 0x1e5f: 0x2599, 0x1e60: 0x0040, 0x1e61: 0x20b9, 0x1e62: 0x20d9, 0x1e63: 0x0040, 0x1e64: 0x2181, 0x1e65: 0x0040, 0x1e66: 0x0040, 0x1e67: 0x20e1, 0x1e68: 0x2131, 0x1e69: 0x2191, 0x1e6a: 0x2161, 0x1e6b: 0x0040, 0x1e6c: 0x2171, 0x1e6d: 0x2179, 0x1e6e: 0x2111, 0x1e6f: 0x2141, 0x1e70: 0x2151, 0x1e71: 0x2121, 0x1e72: 0x2159, 0x1e73: 0x0040, 0x1e74: 0x2119, 0x1e75: 0x20c9, 0x1e76: 0x20d1, 0x1e77: 0x20e9, 0x1e78: 0x0040, 0x1e79: 0x2129, 0x1e7a: 0x2139, 0x1e7b: 0x2149, 0x1e7c: 0x2589, 0x1e7d: 0x0040, 0x1e7e: 0x2591, 0x1e7f: 0x0040, // Block 0x7a, offset 0x1e80 0x1e80: 0x20b1, 0x1e81: 0x20b9, 0x1e82: 0x20d9, 0x1e83: 0x20f1, 0x1e84: 0x2181, 0x1e85: 0x2189, 0x1e86: 0x2109, 0x1e87: 0x20e1, 0x1e88: 0x2131, 0x1e89: 0x2191, 0x1e8a: 0x0040, 0x1e8b: 0x2169, 0x1e8c: 0x2171, 0x1e8d: 0x2179, 0x1e8e: 0x2111, 0x1e8f: 0x2141, 0x1e90: 0x2151, 0x1e91: 0x2121, 0x1e92: 0x2159, 0x1e93: 0x2101, 0x1e94: 0x2119, 0x1e95: 0x20c9, 0x1e96: 0x20d1, 0x1e97: 0x20e9, 0x1e98: 0x20f9, 0x1e99: 0x2129, 0x1e9a: 0x2139, 0x1e9b: 0x2149, 0x1e9c: 0x0040, 0x1e9d: 0x0040, 0x1e9e: 0x0040, 0x1e9f: 0x0040, 0x1ea0: 0x0040, 0x1ea1: 0x20b9, 0x1ea2: 0x20d9, 0x1ea3: 0x20f1, 0x1ea4: 0x0040, 0x1ea5: 0x2189, 0x1ea6: 0x2109, 0x1ea7: 0x20e1, 0x1ea8: 0x2131, 0x1ea9: 0x2191, 0x1eaa: 0x0040, 0x1eab: 0x2169, 0x1eac: 0x2171, 0x1ead: 0x2179, 0x1eae: 0x2111, 0x1eaf: 0x2141, 0x1eb0: 0x2151, 0x1eb1: 0x2121, 0x1eb2: 0x2159, 0x1eb3: 0x2101, 0x1eb4: 0x2119, 0x1eb5: 0x20c9, 0x1eb6: 0x20d1, 0x1eb7: 0x20e9, 0x1eb8: 0x20f9, 0x1eb9: 0x2129, 0x1eba: 0x2139, 0x1ebb: 0x2149, 0x1ebc: 0x0040, 0x1ebd: 0x0040, 0x1ebe: 0x0040, 0x1ebf: 0x0040, // Block 0x7b, offset 0x1ec0 0x1ec0: 0x0040, 0x1ec1: 0x25a2, 0x1ec2: 0x25aa, 0x1ec3: 0x25b2, 0x1ec4: 0x25ba, 0x1ec5: 0x25c2, 0x1ec6: 0x25ca, 0x1ec7: 0x25d2, 0x1ec8: 0x25da, 0x1ec9: 0x25e2, 0x1eca: 0x25ea, 0x1ecb: 0x0018, 0x1ecc: 0x0018, 0x1ecd: 0x0018, 0x1ece: 0x0018, 0x1ecf: 0x0018, 0x1ed0: 0x25f2, 0x1ed1: 0x25fa, 0x1ed2: 0x2602, 0x1ed3: 0x260a, 0x1ed4: 0x2612, 0x1ed5: 0x261a, 0x1ed6: 0x2622, 0x1ed7: 0x262a, 0x1ed8: 0x2632, 0x1ed9: 0x263a, 0x1eda: 0x2642, 0x1edb: 0x264a, 0x1edc: 0x2652, 0x1edd: 0x265a, 0x1ede: 0x2662, 0x1edf: 0x266a, 0x1ee0: 0x2672, 0x1ee1: 0x267a, 0x1ee2: 0x2682, 0x1ee3: 0x268a, 0x1ee4: 0x2692, 0x1ee5: 0x269a, 0x1ee6: 0x26a2, 0x1ee7: 0x26aa, 0x1ee8: 0x26b2, 0x1ee9: 0x26ba, 0x1eea: 0x26c1, 0x1eeb: 0x03d9, 0x1eec: 0x00b9, 0x1eed: 0x1239, 0x1eee: 0x26c9, 0x1eef: 0x0018, 0x1ef0: 0x0019, 0x1ef1: 0x02e9, 0x1ef2: 0x03d9, 0x1ef3: 0x02f1, 0x1ef4: 0x02f9, 0x1ef5: 0x03f1, 0x1ef6: 0x0309, 0x1ef7: 0x00a9, 0x1ef8: 0x0311, 0x1ef9: 0x00b1, 0x1efa: 0x0319, 0x1efb: 0x0101, 0x1efc: 0x0321, 0x1efd: 0x0329, 0x1efe: 0x0051, 0x1eff: 0x0339, // Block 0x7c, offset 0x1f00 0x1f00: 0x0751, 0x1f01: 0x00b9, 0x1f02: 0x0089, 0x1f03: 0x0341, 0x1f04: 0x0349, 0x1f05: 0x0391, 0x1f06: 0x00c1, 0x1f07: 0x0109, 0x1f08: 0x00c9, 0x1f09: 0x04b1, 0x1f0a: 0x26d1, 0x1f0b: 0x11f9, 0x1f0c: 0x26d9, 0x1f0d: 0x04d9, 0x1f0e: 0x26e1, 0x1f0f: 0x26e9, 0x1f10: 0x0018, 0x1f11: 0x0018, 0x1f12: 0x0018, 0x1f13: 0x0018, 0x1f14: 0x0018, 0x1f15: 0x0018, 0x1f16: 0x0018, 0x1f17: 0x0018, 0x1f18: 0x0018, 0x1f19: 0x0018, 0x1f1a: 0x0018, 0x1f1b: 0x0018, 0x1f1c: 0x0018, 0x1f1d: 0x0018, 0x1f1e: 0x0018, 0x1f1f: 0x0018, 0x1f20: 0x0018, 0x1f21: 0x0018, 0x1f22: 0x0018, 0x1f23: 0x0018, 0x1f24: 0x0018, 0x1f25: 0x0018, 0x1f26: 0x0018, 0x1f27: 0x0018, 0x1f28: 0x0018, 0x1f29: 0x0018, 0x1f2a: 0x26f1, 0x1f2b: 0x26f9, 0x1f2c: 0x2701, 0x1f2d: 0x0018, 0x1f2e: 0x0018, 0x1f2f: 0x0018, 0x1f30: 0x0018, 0x1f31: 0x0018, 0x1f32: 0x0018, 0x1f33: 0x0018, 0x1f34: 0x0018, 0x1f35: 0x0018, 0x1f36: 0x0018, 0x1f37: 0x0018, 0x1f38: 0x0018, 0x1f39: 0x0018, 0x1f3a: 0x0018, 0x1f3b: 0x0018, 0x1f3c: 0x0018, 0x1f3d: 0x0018, 0x1f3e: 0x0018, 0x1f3f: 0x0018, // Block 0x7d, offset 0x1f40 0x1f40: 0x2711, 0x1f41: 0x2719, 0x1f42: 0x2721, 0x1f43: 0x0040, 0x1f44: 0x0040, 0x1f45: 0x0040, 0x1f46: 0x0040, 0x1f47: 0x0040, 0x1f48: 0x0040, 0x1f49: 0x0040, 0x1f4a: 0x0040, 0x1f4b: 0x0040, 0x1f4c: 0x0040, 0x1f4d: 0x0040, 0x1f4e: 0x0040, 0x1f4f: 0x0040, 0x1f50: 0x2729, 0x1f51: 0x2731, 0x1f52: 0x2739, 0x1f53: 0x2741, 0x1f54: 0x2749, 0x1f55: 0x2751, 0x1f56: 0x2759, 0x1f57: 0x2761, 0x1f58: 0x2769, 0x1f59: 0x2771, 0x1f5a: 0x2779, 0x1f5b: 0x2781, 0x1f5c: 0x2789, 0x1f5d: 0x2791, 0x1f5e: 0x2799, 0x1f5f: 0x27a1, 0x1f60: 0x27a9, 0x1f61: 0x27b1, 0x1f62: 0x27b9, 0x1f63: 0x27c1, 0x1f64: 0x27c9, 0x1f65: 0x27d1, 0x1f66: 0x27d9, 0x1f67: 0x27e1, 0x1f68: 0x27e9, 0x1f69: 0x27f1, 0x1f6a: 0x27f9, 0x1f6b: 0x2801, 0x1f6c: 0x2809, 0x1f6d: 0x2811, 0x1f6e: 0x2819, 0x1f6f: 0x2821, 0x1f70: 0x2829, 0x1f71: 0x2831, 0x1f72: 0x2839, 0x1f73: 0x2841, 0x1f74: 0x2849, 0x1f75: 0x2851, 0x1f76: 0x2859, 0x1f77: 0x2861, 0x1f78: 0x2869, 0x1f79: 0x2871, 0x1f7a: 0x2879, 0x1f7b: 0x2881, 0x1f7c: 0x0040, 0x1f7d: 0x0040, 0x1f7e: 0x0040, 0x1f7f: 0x0040, // Block 0x7e, offset 0x1f80 0x1f80: 0x28e1, 0x1f81: 0x28e9, 0x1f82: 0x28f1, 0x1f83: 0x8cbd, 0x1f84: 0x28f9, 0x1f85: 0x2901, 0x1f86: 0x2909, 0x1f87: 0x2911, 0x1f88: 0x2919, 0x1f89: 0x2921, 0x1f8a: 0x2929, 0x1f8b: 0x2931, 0x1f8c: 0x2939, 0x1f8d: 0x8cdd, 0x1f8e: 0x2941, 0x1f8f: 0x2949, 0x1f90: 0x2951, 0x1f91: 0x2959, 0x1f92: 0x8cfd, 0x1f93: 0x2961, 0x1f94: 0x2969, 0x1f95: 0x2799, 0x1f96: 0x8d1d, 0x1f97: 0x2971, 0x1f98: 0x2979, 0x1f99: 0x2981, 0x1f9a: 0x2989, 0x1f9b: 0x2991, 0x1f9c: 0x8d3d, 0x1f9d: 0x2999, 0x1f9e: 0x29a1, 0x1f9f: 0x29a9, 0x1fa0: 0x29b1, 0x1fa1: 0x29b9, 0x1fa2: 0x2871, 0x1fa3: 0x29c1, 0x1fa4: 0x29c9, 0x1fa5: 0x29d1, 0x1fa6: 0x29d9, 0x1fa7: 0x29e1, 0x1fa8: 0x29e9, 0x1fa9: 0x29f1, 0x1faa: 0x29f9, 0x1fab: 0x2a01, 0x1fac: 0x2a09, 0x1fad: 0x2a11, 0x1fae: 0x2a19, 0x1faf: 0x2a21, 0x1fb0: 0x2a29, 0x1fb1: 0x2a31, 0x1fb2: 0x2a31, 0x1fb3: 0x2a31, 0x1fb4: 0x8d5d, 0x1fb5: 0x2a39, 0x1fb6: 0x2a41, 0x1fb7: 0x2a49, 0x1fb8: 0x8d7d, 0x1fb9: 0x2a51, 0x1fba: 0x2a59, 0x1fbb: 0x2a61, 0x1fbc: 0x2a69, 0x1fbd: 0x2a71, 0x1fbe: 0x2a79, 0x1fbf: 0x2a81, // Block 0x7f, offset 0x1fc0 0x1fc0: 0x2a89, 0x1fc1: 0x2a91, 0x1fc2: 0x2a99, 0x1fc3: 0x2aa1, 0x1fc4: 0x2aa9, 0x1fc5: 0x2ab1, 0x1fc6: 0x2ab1, 0x1fc7: 0x2ab9, 0x1fc8: 0x2ac1, 0x1fc9: 0x2ac9, 0x1fca: 0x2ad1, 0x1fcb: 0x2ad9, 0x1fcc: 0x2ae1, 0x1fcd: 0x2ae9, 0x1fce: 0x2af1, 0x1fcf: 0x2af9, 0x1fd0: 0x2b01, 0x1fd1: 0x2b09, 0x1fd2: 0x2b11, 0x1fd3: 0x2b19, 0x1fd4: 0x2b21, 0x1fd5: 0x2b29, 0x1fd6: 0x2b31, 0x1fd7: 0x2b39, 0x1fd8: 0x2b41, 0x1fd9: 0x8d9d, 0x1fda: 0x2b49, 0x1fdb: 0x2b51, 0x1fdc: 0x2b59, 0x1fdd: 0x2751, 0x1fde: 0x2b61, 0x1fdf: 0x2b69, 0x1fe0: 0x8dbd, 0x1fe1: 0x8ddd, 0x1fe2: 0x2b71, 0x1fe3: 0x2b79, 0x1fe4: 0x2b81, 0x1fe5: 0x2b89, 0x1fe6: 0x2b91, 0x1fe7: 0x2b99, 0x1fe8: 0x2040, 0x1fe9: 0x2ba1, 0x1fea: 0x2ba9, 0x1feb: 0x2ba9, 0x1fec: 0x8dfd, 0x1fed: 0x2bb1, 0x1fee: 0x2bb9, 0x1fef: 0x2bc1, 0x1ff0: 0x2bc9, 0x1ff1: 0x8e1d, 0x1ff2: 0x2bd1, 0x1ff3: 0x2bd9, 0x1ff4: 0x2040, 0x1ff5: 0x2be1, 0x1ff6: 0x2be9, 0x1ff7: 0x2bf1, 0x1ff8: 0x2bf9, 0x1ff9: 0x2c01, 0x1ffa: 0x2c09, 0x1ffb: 0x8e3d, 0x1ffc: 0x2c11, 0x1ffd: 0x8e5d, 0x1ffe: 0x2c19, 0x1fff: 0x2c21, // Block 0x80, offset 0x2000 0x2000: 0x2c29, 0x2001: 0x2c31, 0x2002: 0x2c39, 0x2003: 0x2c41, 0x2004: 0x2c49, 0x2005: 0x2c51, 0x2006: 0x2c59, 0x2007: 0x2c61, 0x2008: 0x2c69, 0x2009: 0x8e7d, 0x200a: 0x2c71, 0x200b: 0x2c79, 0x200c: 0x2c81, 0x200d: 0x2c89, 0x200e: 0x2c91, 0x200f: 0x8e9d, 0x2010: 0x2c99, 0x2011: 0x8ebd, 0x2012: 0x8edd, 0x2013: 0x2ca1, 0x2014: 0x2ca9, 0x2015: 0x2ca9, 0x2016: 0x2cb1, 0x2017: 0x8efd, 0x2018: 0x8f1d, 0x2019: 0x2cb9, 0x201a: 0x2cc1, 0x201b: 0x2cc9, 0x201c: 0x2cd1, 0x201d: 0x2cd9, 0x201e: 0x2ce1, 0x201f: 0x2ce9, 0x2020: 0x2cf1, 0x2021: 0x2cf9, 0x2022: 0x2d01, 0x2023: 0x2d09, 0x2024: 0x8f3d, 0x2025: 0x2d11, 0x2026: 0x2d19, 0x2027: 0x2d21, 0x2028: 0x2d29, 0x2029: 0x2d21, 0x202a: 0x2d31, 0x202b: 0x2d39, 0x202c: 0x2d41, 0x202d: 0x2d49, 0x202e: 0x2d51, 0x202f: 0x2d59, 0x2030: 0x2d61, 0x2031: 0x2d69, 0x2032: 0x2d71, 0x2033: 0x2d79, 0x2034: 0x2d81, 0x2035: 0x2d89, 0x2036: 0x2d91, 0x2037: 0x2d99, 0x2038: 0x8f5d, 0x2039: 0x2da1, 0x203a: 0x2da9, 0x203b: 0x2db1, 0x203c: 0x2db9, 0x203d: 0x2dc1, 0x203e: 0x8f7d, 0x203f: 0x2dc9, // Block 0x81, offset 0x2040 0x2040: 0x2dd1, 0x2041: 0x2dd9, 0x2042: 0x2de1, 0x2043: 0x2de9, 0x2044: 0x2df1, 0x2045: 0x2df9, 0x2046: 0x2e01, 0x2047: 0x2e09, 0x2048: 0x2e11, 0x2049: 0x2e19, 0x204a: 0x8f9d, 0x204b: 0x2e21, 0x204c: 0x2e29, 0x204d: 0x2e31, 0x204e: 0x2e39, 0x204f: 0x2e41, 0x2050: 0x2e49, 0x2051: 0x2e51, 0x2052: 0x2e59, 0x2053: 0x2e61, 0x2054: 0x2e69, 0x2055: 0x2e71, 0x2056: 0x2e79, 0x2057: 0x2e81, 0x2058: 0x2e89, 0x2059: 0x2e91, 0x205a: 0x2e99, 0x205b: 0x2ea1, 0x205c: 0x2ea9, 0x205d: 0x8fbd, 0x205e: 0x2eb1, 0x205f: 0x2eb9, 0x2060: 0x2ec1, 0x2061: 0x2ec9, 0x2062: 0x2ed1, 0x2063: 0x8fdd, 0x2064: 0x2ed9, 0x2065: 0x2ee1, 0x2066: 0x2ee9, 0x2067: 0x2ef1, 0x2068: 0x2ef9, 0x2069: 0x2f01, 0x206a: 0x2f09, 0x206b: 0x2f11, 0x206c: 0x7f0d, 0x206d: 0x2f19, 0x206e: 0x2f21, 0x206f: 0x2f29, 0x2070: 0x8ffd, 0x2071: 0x2f31, 0x2072: 0x2f39, 0x2073: 0x2f41, 0x2074: 0x2f49, 0x2075: 0x2f51, 0x2076: 0x2f59, 0x2077: 0x901d, 0x2078: 0x903d, 0x2079: 0x905d, 0x207a: 0x2f61, 0x207b: 0x907d, 0x207c: 0x2f69, 0x207d: 0x2f71, 0x207e: 0x2f79, 0x207f: 0x2f81, // Block 0x82, offset 0x2080 0x2080: 0x2f89, 0x2081: 0x2f91, 0x2082: 0x2f99, 0x2083: 0x2fa1, 0x2084: 0x2fa9, 0x2085: 0x2fb1, 0x2086: 0x909d, 0x2087: 0x2fb9, 0x2088: 0x2fc1, 0x2089: 0x2fc9, 0x208a: 0x2fd1, 0x208b: 0x2fd9, 0x208c: 0x2fe1, 0x208d: 0x90bd, 0x208e: 0x2fe9, 0x208f: 0x2ff1, 0x2090: 0x90dd, 0x2091: 0x90fd, 0x2092: 0x2ff9, 0x2093: 0x3001, 0x2094: 0x3009, 0x2095: 0x3011, 0x2096: 0x3019, 0x2097: 0x3021, 0x2098: 0x3029, 0x2099: 0x3031, 0x209a: 0x3039, 0x209b: 0x911d, 0x209c: 0x3041, 0x209d: 0x913d, 0x209e: 0x3049, 0x209f: 0x2040, 0x20a0: 0x3051, 0x20a1: 0x3059, 0x20a2: 0x3061, 0x20a3: 0x915d, 0x20a4: 0x3069, 0x20a5: 0x3071, 0x20a6: 0x917d, 0x20a7: 0x919d, 0x20a8: 0x3079, 0x20a9: 0x3081, 0x20aa: 0x3089, 0x20ab: 0x3091, 0x20ac: 0x3099, 0x20ad: 0x3099, 0x20ae: 0x30a1, 0x20af: 0x30a9, 0x20b0: 0x30b1, 0x20b1: 0x30b9, 0x20b2: 0x30c1, 0x20b3: 0x30c9, 0x20b4: 0x30d1, 0x20b5: 0x91bd, 0x20b6: 0x30d9, 0x20b7: 0x91dd, 0x20b8: 0x30e1, 0x20b9: 0x91fd, 0x20ba: 0x30e9, 0x20bb: 0x921d, 0x20bc: 0x923d, 0x20bd: 0x925d, 0x20be: 0x30f1, 0x20bf: 0x30f9, // Block 0x83, offset 0x20c0 0x20c0: 0x3101, 0x20c1: 0x927d, 0x20c2: 0x929d, 0x20c3: 0x92bd, 0x20c4: 0x92dd, 0x20c5: 0x3109, 0x20c6: 0x3111, 0x20c7: 0x3111, 0x20c8: 0x3119, 0x20c9: 0x3121, 0x20ca: 0x3129, 0x20cb: 0x3131, 0x20cc: 0x3139, 0x20cd: 0x92fd, 0x20ce: 0x3141, 0x20cf: 0x3149, 0x20d0: 0x3151, 0x20d1: 0x3159, 0x20d2: 0x931d, 0x20d3: 0x3161, 0x20d4: 0x933d, 0x20d5: 0x935d, 0x20d6: 0x3169, 0x20d7: 0x3171, 0x20d8: 0x3179, 0x20d9: 0x3181, 0x20da: 0x3189, 0x20db: 0x3191, 0x20dc: 0x937d, 0x20dd: 0x939d, 0x20de: 0x93bd, 0x20df: 0x2040, 0x20e0: 0x3199, 0x20e1: 0x93dd, 0x20e2: 0x31a1, 0x20e3: 0x31a9, 0x20e4: 0x31b1, 0x20e5: 0x93fd, 0x20e6: 0x31b9, 0x20e7: 0x31c1, 0x20e8: 0x31c9, 0x20e9: 0x31d1, 0x20ea: 0x31d9, 0x20eb: 0x941d, 0x20ec: 0x31e1, 0x20ed: 0x31e9, 0x20ee: 0x31f1, 0x20ef: 0x31f9, 0x20f0: 0x3201, 0x20f1: 0x3209, 0x20f2: 0x943d, 0x20f3: 0x945d, 0x20f4: 0x3211, 0x20f5: 0x947d, 0x20f6: 0x3219, 0x20f7: 0x949d, 0x20f8: 0x3221, 0x20f9: 0x3229, 0x20fa: 0x3231, 0x20fb: 0x94bd, 0x20fc: 0x94dd, 0x20fd: 0x3239, 0x20fe: 0x94fd, 0x20ff: 0x3241, // Block 0x84, offset 0x2100 0x2100: 0x951d, 0x2101: 0x3249, 0x2102: 0x3251, 0x2103: 0x3259, 0x2104: 0x3261, 0x2105: 0x3269, 0x2106: 0x3271, 0x2107: 0x953d, 0x2108: 0x955d, 0x2109: 0x957d, 0x210a: 0x959d, 0x210b: 0x2ca1, 0x210c: 0x3279, 0x210d: 0x3281, 0x210e: 0x3289, 0x210f: 0x3291, 0x2110: 0x3299, 0x2111: 0x32a1, 0x2112: 0x32a9, 0x2113: 0x32b1, 0x2114: 0x32b9, 0x2115: 0x32c1, 0x2116: 0x32c9, 0x2117: 0x95bd, 0x2118: 0x32d1, 0x2119: 0x32d9, 0x211a: 0x32e1, 0x211b: 0x32e9, 0x211c: 0x32f1, 0x211d: 0x32f9, 0x211e: 0x3301, 0x211f: 0x3309, 0x2120: 0x3311, 0x2121: 0x3319, 0x2122: 0x3321, 0x2123: 0x3329, 0x2124: 0x95dd, 0x2125: 0x95fd, 0x2126: 0x961d, 0x2127: 0x3331, 0x2128: 0x3339, 0x2129: 0x3341, 0x212a: 0x3349, 0x212b: 0x963d, 0x212c: 0x3351, 0x212d: 0x965d, 0x212e: 0x3359, 0x212f: 0x3361, 0x2130: 0x967d, 0x2131: 0x969d, 0x2132: 0x3369, 0x2133: 0x3371, 0x2134: 0x3379, 0x2135: 0x3381, 0x2136: 0x3389, 0x2137: 0x3391, 0x2138: 0x3399, 0x2139: 0x33a1, 0x213a: 0x33a9, 0x213b: 0x33b1, 0x213c: 0x33b9, 0x213d: 0x33c1, 0x213e: 0x33c9, 0x213f: 0x2040, // Block 0x85, offset 0x2140 0x2140: 0x33d1, 0x2141: 0x33d9, 0x2142: 0x33e1, 0x2143: 0x33e9, 0x2144: 0x33f1, 0x2145: 0x96bd, 0x2146: 0x33f9, 0x2147: 0x3401, 0x2148: 0x3409, 0x2149: 0x3411, 0x214a: 0x3419, 0x214b: 0x96dd, 0x214c: 0x96fd, 0x214d: 0x3421, 0x214e: 0x3429, 0x214f: 0x3431, 0x2150: 0x3439, 0x2151: 0x3441, 0x2152: 0x3449, 0x2153: 0x971d, 0x2154: 0x3451, 0x2155: 0x3459, 0x2156: 0x3461, 0x2157: 0x3469, 0x2158: 0x973d, 0x2159: 0x975d, 0x215a: 0x3471, 0x215b: 0x3479, 0x215c: 0x3481, 0x215d: 0x977d, 0x215e: 0x3489, 0x215f: 0x3491, 0x2160: 0x684d, 0x2161: 0x979d, 0x2162: 0x3499, 0x2163: 0x34a1, 0x2164: 0x34a9, 0x2165: 0x97bd, 0x2166: 0x34b1, 0x2167: 0x34b9, 0x2168: 0x34c1, 0x2169: 0x34c9, 0x216a: 0x34d1, 0x216b: 0x34d9, 0x216c: 0x34e1, 0x216d: 0x97dd, 0x216e: 0x34e9, 0x216f: 0x34f1, 0x2170: 0x34f9, 0x2171: 0x97fd, 0x2172: 0x3501, 0x2173: 0x3509, 0x2174: 0x3511, 0x2175: 0x3519, 0x2176: 0x7b6d, 0x2177: 0x981d, 0x2178: 0x3521, 0x2179: 0x3529, 0x217a: 0x3531, 0x217b: 0x983d, 0x217c: 0x3539, 0x217d: 0x985d, 0x217e: 0x3541, 0x217f: 0x3541, // Block 0x86, offset 0x2180 0x2180: 0x3549, 0x2181: 0x987d, 0x2182: 0x3551, 0x2183: 0x3559, 0x2184: 0x3561, 0x2185: 0x3569, 0x2186: 0x3571, 0x2187: 0x3579, 0x2188: 0x3581, 0x2189: 0x989d, 0x218a: 0x3589, 0x218b: 0x3591, 0x218c: 0x3599, 0x218d: 0x35a1, 0x218e: 0x35a9, 0x218f: 0x35b1, 0x2190: 0x98bd, 0x2191: 0x35b9, 0x2192: 0x98dd, 0x2193: 0x98fd, 0x2194: 0x991d, 0x2195: 0x35c1, 0x2196: 0x35c9, 0x2197: 0x35d1, 0x2198: 0x35d9, 0x2199: 0x35e1, 0x219a: 0x35e9, 0x219b: 0x35f1, 0x219c: 0x35f9, 0x219d: 0x993d, 0x219e: 0x0040, 0x219f: 0x0040, 0x21a0: 0x0040, 0x21a1: 0x0040, 0x21a2: 0x0040, 0x21a3: 0x0040, 0x21a4: 0x0040, 0x21a5: 0x0040, 0x21a6: 0x0040, 0x21a7: 0x0040, 0x21a8: 0x0040, 0x21a9: 0x0040, 0x21aa: 0x0040, 0x21ab: 0x0040, 0x21ac: 0x0040, 0x21ad: 0x0040, 0x21ae: 0x0040, 0x21af: 0x0040, 0x21b0: 0x0040, 0x21b1: 0x0040, 0x21b2: 0x0040, 0x21b3: 0x0040, 0x21b4: 0x0040, 0x21b5: 0x0040, 0x21b6: 0x0040, 0x21b7: 0x0040, 0x21b8: 0x0040, 0x21b9: 0x0040, 0x21ba: 0x0040, 0x21bb: 0x0040, 0x21bc: 0x0040, 0x21bd: 0x0040, 0x21be: 0x0040, 0x21bf: 0x0040, } // idnaIndex: 39 blocks, 2496 entries, 4992 bytes // Block 0 is the zero block. var idnaIndex = [2496]uint16{ // Block 0x0, offset 0x0 // Block 0x1, offset 0x40 // Block 0x2, offset 0x80 // Block 0x3, offset 0xc0 0xc2: 0x01, 0xc3: 0x85, 0xc4: 0x02, 0xc5: 0x03, 0xc6: 0x04, 0xc7: 0x05, 0xc8: 0x06, 0xc9: 0x86, 0xca: 0x87, 0xcb: 0x07, 0xcc: 0x88, 0xcd: 0x08, 0xce: 0x09, 0xcf: 0x0a, 0xd0: 0x89, 0xd1: 0x0b, 0xd2: 0x0c, 0xd3: 0x0d, 0xd4: 0x0e, 0xd5: 0x8a, 0xd6: 0x8b, 0xd7: 0x8c, 0xd8: 0x0f, 0xd9: 0x10, 0xda: 0x8d, 0xdb: 0x11, 0xdc: 0x12, 0xdd: 0x8e, 0xde: 0x8f, 0xdf: 0x90, 0xe0: 0x02, 0xe1: 0x03, 0xe2: 0x04, 0xe3: 0x05, 0xe4: 0x06, 0xe5: 0x07, 0xe6: 0x07, 0xe7: 0x07, 0xe8: 0x07, 0xe9: 0x07, 0xea: 0x08, 0xeb: 0x07, 0xec: 0x07, 0xed: 0x09, 0xee: 0x0a, 0xef: 0x0b, 0xf0: 0x20, 0xf1: 0x21, 0xf2: 0x21, 0xf3: 0x23, 0xf4: 0x24, // Block 0x4, offset 0x100 0x120: 0x91, 0x121: 0x13, 0x122: 0x14, 0x123: 0x92, 0x124: 0x93, 0x125: 0x15, 0x126: 0x16, 0x127: 0x17, 0x128: 0x18, 0x129: 0x19, 0x12a: 0x1a, 0x12b: 0x1b, 0x12c: 0x1c, 0x12d: 0x1d, 0x12e: 0x1e, 0x12f: 0x94, 0x130: 0x95, 0x131: 0x1f, 0x132: 0x20, 0x133: 0x21, 0x134: 0x96, 0x135: 0x22, 0x136: 0x97, 0x137: 0x98, 0x138: 0x99, 0x139: 0x9a, 0x13a: 0x23, 0x13b: 0x9b, 0x13c: 0x9c, 0x13d: 0x24, 0x13e: 0x25, 0x13f: 0x9d, // Block 0x5, offset 0x140 0x140: 0x9e, 0x141: 0x9f, 0x142: 0xa0, 0x143: 0xa1, 0x144: 0xa2, 0x145: 0xa3, 0x146: 0xa4, 0x147: 0xa5, 0x148: 0xa6, 0x149: 0xa7, 0x14a: 0xa8, 0x14b: 0xa9, 0x14c: 0xaa, 0x14d: 0xab, 0x14e: 0xac, 0x14f: 0xad, 0x150: 0xae, 0x151: 0xa6, 0x152: 0xa6, 0x153: 0xa6, 0x154: 0xa6, 0x155: 0xa6, 0x156: 0xa6, 0x157: 0xa6, 0x158: 0xa6, 0x159: 0xaf, 0x15a: 0xb0, 0x15b: 0xb1, 0x15c: 0xb2, 0x15d: 0xb3, 0x15e: 0xb4, 0x15f: 0xb5, 0x160: 0xb6, 0x161: 0xb7, 0x162: 0xb8, 0x163: 0xb9, 0x164: 0xba, 0x165: 0xbb, 0x166: 0xbc, 0x167: 0xbd, 0x168: 0xbe, 0x169: 0xbf, 0x16a: 0xc0, 0x16b: 0xc1, 0x16c: 0xc2, 0x16d: 0xc3, 0x16e: 0xc4, 0x16f: 0xc5, 0x170: 0xc6, 0x171: 0xc7, 0x172: 0xc8, 0x173: 0xc9, 0x174: 0x26, 0x175: 0x27, 0x176: 0x28, 0x177: 0x88, 0x178: 0x29, 0x179: 0x29, 0x17a: 0x2a, 0x17b: 0x29, 0x17c: 0xca, 0x17d: 0x2b, 0x17e: 0x2c, 0x17f: 0x2d, // Block 0x6, offset 0x180 0x180: 0x2e, 0x181: 0x2f, 0x182: 0x30, 0x183: 0xcb, 0x184: 0x31, 0x185: 0x32, 0x186: 0xcc, 0x187: 0xa2, 0x188: 0xcd, 0x189: 0xce, 0x18a: 0xa2, 0x18b: 0xa2, 0x18c: 0xcf, 0x18d: 0xa2, 0x18e: 0xa2, 0x18f: 0xa2, 0x190: 0xd0, 0x191: 0x33, 0x192: 0x34, 0x193: 0x35, 0x194: 0xa2, 0x195: 0xa2, 0x196: 0xa2, 0x197: 0xa2, 0x198: 0xa2, 0x199: 0xa2, 0x19a: 0xa2, 0x19b: 0xa2, 0x19c: 0xa2, 0x19d: 0xa2, 0x19e: 0xa2, 0x19f: 0xa2, 0x1a0: 0xa2, 0x1a1: 0xa2, 0x1a2: 0xa2, 0x1a3: 0xa2, 0x1a4: 0xa2, 0x1a5: 0xa2, 0x1a6: 0xa2, 0x1a7: 0xa2, 0x1a8: 0xd1, 0x1a9: 0xd2, 0x1aa: 0xa2, 0x1ab: 0xd3, 0x1ac: 0xa2, 0x1ad: 0xd4, 0x1ae: 0xd5, 0x1af: 0xa2, 0x1b0: 0xd6, 0x1b1: 0x36, 0x1b2: 0x29, 0x1b3: 0x37, 0x1b4: 0xd7, 0x1b5: 0xd8, 0x1b6: 0xd9, 0x1b7: 0xda, 0x1b8: 0xdb, 0x1b9: 0xdc, 0x1ba: 0xdd, 0x1bb: 0xde, 0x1bc: 0xdf, 0x1bd: 0xe0, 0x1be: 0xe1, 0x1bf: 0x38, // Block 0x7, offset 0x1c0 0x1c0: 0x39, 0x1c1: 0xe2, 0x1c2: 0xe3, 0x1c3: 0xe4, 0x1c4: 0xe5, 0x1c5: 0x3a, 0x1c6: 0x3b, 0x1c7: 0xe6, 0x1c8: 0xe7, 0x1c9: 0x3c, 0x1ca: 0x3d, 0x1cb: 0x3e, 0x1cc: 0xe8, 0x1cd: 0xe9, 0x1ce: 0x3f, 0x1cf: 0x40, 0x1d0: 0xa6, 0x1d1: 0xa6, 0x1d2: 0xa6, 0x1d3: 0xa6, 0x1d4: 0xa6, 0x1d5: 0xa6, 0x1d6: 0xa6, 0x1d7: 0xa6, 0x1d8: 0xa6, 0x1d9: 0xa6, 0x1da: 0xa6, 0x1db: 0xa6, 0x1dc: 0xa6, 0x1dd: 0xa6, 0x1de: 0xa6, 0x1df: 0xa6, 0x1e0: 0xa6, 0x1e1: 0xa6, 0x1e2: 0xa6, 0x1e3: 0xa6, 0x1e4: 0xa6, 0x1e5: 0xa6, 0x1e6: 0xa6, 0x1e7: 0xa6, 0x1e8: 0xa6, 0x1e9: 0xa6, 0x1ea: 0xa6, 0x1eb: 0xa6, 0x1ec: 0xa6, 0x1ed: 0xa6, 0x1ee: 0xa6, 0x1ef: 0xa6, 0x1f0: 0xa6, 0x1f1: 0xa6, 0x1f2: 0xa6, 0x1f3: 0xa6, 0x1f4: 0xa6, 0x1f5: 0xa6, 0x1f6: 0xa6, 0x1f7: 0xa6, 0x1f8: 0xa6, 0x1f9: 0xa6, 0x1fa: 0xa6, 0x1fb: 0xa6, 0x1fc: 0xa6, 0x1fd: 0xa6, 0x1fe: 0xa6, 0x1ff: 0xa6, // Block 0x8, offset 0x200 0x200: 0xa6, 0x201: 0xa6, 0x202: 0xa6, 0x203: 0xa6, 0x204: 0xa6, 0x205: 0xa6, 0x206: 0xa6, 0x207: 0xa6, 0x208: 0xa6, 0x209: 0xa6, 0x20a: 0xa6, 0x20b: 0xa6, 0x20c: 0xa6, 0x20d: 0xa6, 0x20e: 0xa6, 0x20f: 0xa6, 0x210: 0xa6, 0x211: 0xa6, 0x212: 0xa6, 0x213: 0xa6, 0x214: 0xa6, 0x215: 0xa6, 0x216: 0xa6, 0x217: 0xa6, 0x218: 0xa6, 0x219: 0xa6, 0x21a: 0xa6, 0x21b: 0xa6, 0x21c: 0xa6, 0x21d: 0xa6, 0x21e: 0xa6, 0x21f: 0xa6, 0x220: 0xa6, 0x221: 0xa6, 0x222: 0xa6, 0x223: 0xa6, 0x224: 0xa6, 0x225: 0xa6, 0x226: 0xa6, 0x227: 0xa6, 0x228: 0xa6, 0x229: 0xa6, 0x22a: 0xa6, 0x22b: 0xa6, 0x22c: 0xa6, 0x22d: 0xa6, 0x22e: 0xa6, 0x22f: 0xa6, 0x230: 0xa6, 0x231: 0xa6, 0x232: 0xa6, 0x233: 0xa6, 0x234: 0xa6, 0x235: 0xa6, 0x236: 0xa6, 0x237: 0xa2, 0x238: 0xa6, 0x239: 0xa6, 0x23a: 0xa6, 0x23b: 0xa6, 0x23c: 0xa6, 0x23d: 0xa6, 0x23e: 0xa6, 0x23f: 0xa6, // Block 0x9, offset 0x240 0x240: 0xa6, 0x241: 0xa6, 0x242: 0xa6, 0x243: 0xa6, 0x244: 0xa6, 0x245: 0xa6, 0x246: 0xa6, 0x247: 0xa6, 0x248: 0xa6, 0x249: 0xa6, 0x24a: 0xa6, 0x24b: 0xa6, 0x24c: 0xa6, 0x24d: 0xa6, 0x24e: 0xa6, 0x24f: 0xa6, 0x250: 0xa6, 0x251: 0xa6, 0x252: 0xa6, 0x253: 0xa6, 0x254: 0xa6, 0x255: 0xa6, 0x256: 0xa6, 0x257: 0xa6, 0x258: 0xa6, 0x259: 0xa6, 0x25a: 0xa6, 0x25b: 0xa6, 0x25c: 0xa6, 0x25d: 0xa6, 0x25e: 0xa6, 0x25f: 0xa6, 0x260: 0xa6, 0x261: 0xa6, 0x262: 0xa6, 0x263: 0xa6, 0x264: 0xa6, 0x265: 0xa6, 0x266: 0xa6, 0x267: 0xa6, 0x268: 0xa6, 0x269: 0xa6, 0x26a: 0xa6, 0x26b: 0xa6, 0x26c: 0xa6, 0x26d: 0xa6, 0x26e: 0xa6, 0x26f: 0xa6, 0x270: 0xa6, 0x271: 0xa6, 0x272: 0xa6, 0x273: 0xa6, 0x274: 0xa6, 0x275: 0xa6, 0x276: 0xa6, 0x277: 0xa6, 0x278: 0xa6, 0x279: 0xa6, 0x27a: 0xa6, 0x27b: 0xa6, 0x27c: 0xa6, 0x27d: 0xa6, 0x27e: 0xa6, 0x27f: 0xa6, // Block 0xa, offset 0x280 0x280: 0xa6, 0x281: 0xa6, 0x282: 0xa6, 0x283: 0xa6, 0x284: 0xa6, 0x285: 0xa6, 0x286: 0xa6, 0x287: 0xa6, 0x288: 0xa6, 0x289: 0xa6, 0x28a: 0xa6, 0x28b: 0xa6, 0x28c: 0xa6, 0x28d: 0xa6, 0x28e: 0xa6, 0x28f: 0xa6, 0x290: 0xa6, 0x291: 0xa6, 0x292: 0xea, 0x293: 0xeb, 0x294: 0xa6, 0x295: 0xa6, 0x296: 0xa6, 0x297: 0xa6, 0x298: 0xec, 0x299: 0x41, 0x29a: 0x42, 0x29b: 0xed, 0x29c: 0x43, 0x29d: 0x44, 0x29e: 0x45, 0x29f: 0x46, 0x2a0: 0xee, 0x2a1: 0xef, 0x2a2: 0xf0, 0x2a3: 0xf1, 0x2a4: 0xf2, 0x2a5: 0xf3, 0x2a6: 0xf4, 0x2a7: 0xf5, 0x2a8: 0xf6, 0x2a9: 0xf7, 0x2aa: 0xf8, 0x2ab: 0xf9, 0x2ac: 0xfa, 0x2ad: 0xfb, 0x2ae: 0xfc, 0x2af: 0xfd, 0x2b0: 0xa6, 0x2b1: 0xa6, 0x2b2: 0xa6, 0x2b3: 0xa6, 0x2b4: 0xa6, 0x2b5: 0xa6, 0x2b6: 0xa6, 0x2b7: 0xa6, 0x2b8: 0xa6, 0x2b9: 0xa6, 0x2ba: 0xa6, 0x2bb: 0xa6, 0x2bc: 0xa6, 0x2bd: 0xa6, 0x2be: 0xa6, 0x2bf: 0xa6, // Block 0xb, offset 0x2c0 0x2c0: 0xa6, 0x2c1: 0xa6, 0x2c2: 0xa6, 0x2c3: 0xa6, 0x2c4: 0xa6, 0x2c5: 0xa6, 0x2c6: 0xa6, 0x2c7: 0xa6, 0x2c8: 0xa6, 0x2c9: 0xa6, 0x2ca: 0xa6, 0x2cb: 0xa6, 0x2cc: 0xa6, 0x2cd: 0xa6, 0x2ce: 0xa6, 0x2cf: 0xa6, 0x2d0: 0xa6, 0x2d1: 0xa6, 0x2d2: 0xa6, 0x2d3: 0xa6, 0x2d4: 0xa6, 0x2d5: 0xa6, 0x2d6: 0xa6, 0x2d7: 0xa6, 0x2d8: 0xa6, 0x2d9: 0xa6, 0x2da: 0xa6, 0x2db: 0xa6, 0x2dc: 0xa6, 0x2dd: 0xa6, 0x2de: 0xfe, 0x2df: 0xff, // Block 0xc, offset 0x300 0x300: 0x100, 0x301: 0x100, 0x302: 0x100, 0x303: 0x100, 0x304: 0x100, 0x305: 0x100, 0x306: 0x100, 0x307: 0x100, 0x308: 0x100, 0x309: 0x100, 0x30a: 0x100, 0x30b: 0x100, 0x30c: 0x100, 0x30d: 0x100, 0x30e: 0x100, 0x30f: 0x100, 0x310: 0x100, 0x311: 0x100, 0x312: 0x100, 0x313: 0x100, 0x314: 0x100, 0x315: 0x100, 0x316: 0x100, 0x317: 0x100, 0x318: 0x100, 0x319: 0x100, 0x31a: 0x100, 0x31b: 0x100, 0x31c: 0x100, 0x31d: 0x100, 0x31e: 0x100, 0x31f: 0x100, 0x320: 0x100, 0x321: 0x100, 0x322: 0x100, 0x323: 0x100, 0x324: 0x100, 0x325: 0x100, 0x326: 0x100, 0x327: 0x100, 0x328: 0x100, 0x329: 0x100, 0x32a: 0x100, 0x32b: 0x100, 0x32c: 0x100, 0x32d: 0x100, 0x32e: 0x100, 0x32f: 0x100, 0x330: 0x100, 0x331: 0x100, 0x332: 0x100, 0x333: 0x100, 0x334: 0x100, 0x335: 0x100, 0x336: 0x100, 0x337: 0x100, 0x338: 0x100, 0x339: 0x100, 0x33a: 0x100, 0x33b: 0x100, 0x33c: 0x100, 0x33d: 0x100, 0x33e: 0x100, 0x33f: 0x100, // Block 0xd, offset 0x340 0x340: 0x100, 0x341: 0x100, 0x342: 0x100, 0x343: 0x100, 0x344: 0x100, 0x345: 0x100, 0x346: 0x100, 0x347: 0x100, 0x348: 0x100, 0x349: 0x100, 0x34a: 0x100, 0x34b: 0x100, 0x34c: 0x100, 0x34d: 0x100, 0x34e: 0x100, 0x34f: 0x100, 0x350: 0x100, 0x351: 0x100, 0x352: 0x100, 0x353: 0x100, 0x354: 0x100, 0x355: 0x100, 0x356: 0x100, 0x357: 0x100, 0x358: 0x100, 0x359: 0x100, 0x35a: 0x100, 0x35b: 0x100, 0x35c: 0x100, 0x35d: 0x100, 0x35e: 0x100, 0x35f: 0x100, 0x360: 0x100, 0x361: 0x100, 0x362: 0x100, 0x363: 0x100, 0x364: 0x101, 0x365: 0x102, 0x366: 0x103, 0x367: 0x104, 0x368: 0x47, 0x369: 0x105, 0x36a: 0x106, 0x36b: 0x48, 0x36c: 0x49, 0x36d: 0x4a, 0x36e: 0x4b, 0x36f: 0x4c, 0x370: 0x107, 0x371: 0x4d, 0x372: 0x4e, 0x373: 0x4f, 0x374: 0x50, 0x375: 0x51, 0x376: 0x108, 0x377: 0x52, 0x378: 0x53, 0x379: 0x54, 0x37a: 0x55, 0x37b: 0x56, 0x37c: 0x57, 0x37d: 0x58, 0x37e: 0x59, 0x37f: 0x5a, // Block 0xe, offset 0x380 0x380: 0x109, 0x381: 0x10a, 0x382: 0xa6, 0x383: 0x10b, 0x384: 0x10c, 0x385: 0xa2, 0x386: 0x10d, 0x387: 0x10e, 0x388: 0x100, 0x389: 0x100, 0x38a: 0x10f, 0x38b: 0x110, 0x38c: 0x111, 0x38d: 0x112, 0x38e: 0x113, 0x38f: 0x114, 0x390: 0x115, 0x391: 0xa6, 0x392: 0x116, 0x393: 0x117, 0x394: 0x118, 0x395: 0x5b, 0x396: 0x5c, 0x397: 0x100, 0x398: 0xa6, 0x399: 0xa6, 0x39a: 0xa6, 0x39b: 0xa6, 0x39c: 0x119, 0x39d: 0x11a, 0x39e: 0x5d, 0x39f: 0x100, 0x3a0: 0x11b, 0x3a1: 0x11c, 0x3a2: 0x11d, 0x3a3: 0x11e, 0x3a4: 0x11f, 0x3a5: 0x100, 0x3a6: 0x120, 0x3a7: 0x121, 0x3a8: 0x122, 0x3a9: 0x123, 0x3aa: 0x124, 0x3ab: 0x5e, 0x3ac: 0x125, 0x3ad: 0x126, 0x3ae: 0x5f, 0x3af: 0x100, 0x3b0: 0x127, 0x3b1: 0x128, 0x3b2: 0x129, 0x3b3: 0x12a, 0x3b4: 0x12b, 0x3b5: 0x100, 0x3b6: 0x100, 0x3b7: 0x100, 0x3b8: 0x100, 0x3b9: 0x12c, 0x3ba: 0x12d, 0x3bb: 0x12e, 0x3bc: 0x12f, 0x3bd: 0x130, 0x3be: 0x131, 0x3bf: 0x132, // Block 0xf, offset 0x3c0 0x3c0: 0x133, 0x3c1: 0x134, 0x3c2: 0x135, 0x3c3: 0x136, 0x3c4: 0x137, 0x3c5: 0x138, 0x3c6: 0x139, 0x3c7: 0x13a, 0x3c8: 0x13b, 0x3c9: 0x13c, 0x3ca: 0x13d, 0x3cb: 0x13e, 0x3cc: 0x60, 0x3cd: 0x61, 0x3ce: 0x100, 0x3cf: 0x100, 0x3d0: 0x13f, 0x3d1: 0x140, 0x3d2: 0x141, 0x3d3: 0x142, 0x3d4: 0x100, 0x3d5: 0x100, 0x3d6: 0x143, 0x3d7: 0x144, 0x3d8: 0x145, 0x3d9: 0x146, 0x3da: 0x147, 0x3db: 0x148, 0x3dc: 0x149, 0x3dd: 0x14a, 0x3de: 0x100, 0x3df: 0x100, 0x3e0: 0x14b, 0x3e1: 0x100, 0x3e2: 0x14c, 0x3e3: 0x14d, 0x3e4: 0x62, 0x3e5: 0x14e, 0x3e6: 0x14f, 0x3e7: 0x150, 0x3e8: 0x151, 0x3e9: 0x152, 0x3ea: 0x153, 0x3eb: 0x154, 0x3ec: 0x155, 0x3ed: 0x100, 0x3ee: 0x100, 0x3ef: 0x100, 0x3f0: 0x156, 0x3f1: 0x157, 0x3f2: 0x158, 0x3f3: 0x100, 0x3f4: 0x159, 0x3f5: 0x15a, 0x3f6: 0x15b, 0x3f7: 0x100, 0x3f8: 0x100, 0x3f9: 0x100, 0x3fa: 0x100, 0x3fb: 0x15c, 0x3fc: 0x15d, 0x3fd: 0x15e, 0x3fe: 0x15f, 0x3ff: 0x160, // Block 0x10, offset 0x400 0x400: 0xa6, 0x401: 0xa6, 0x402: 0xa6, 0x403: 0xa6, 0x404: 0xa6, 0x405: 0xa6, 0x406: 0xa6, 0x407: 0xa6, 0x408: 0xa6, 0x409: 0xa6, 0x40a: 0xa6, 0x40b: 0xa6, 0x40c: 0xa6, 0x40d: 0xa6, 0x40e: 0x161, 0x40f: 0x100, 0x410: 0xa2, 0x411: 0x162, 0x412: 0xa6, 0x413: 0xa6, 0x414: 0xa6, 0x415: 0x163, 0x416: 0x100, 0x417: 0x100, 0x418: 0x100, 0x419: 0x100, 0x41a: 0x100, 0x41b: 0x100, 0x41c: 0x100, 0x41d: 0x100, 0x41e: 0x100, 0x41f: 0x100, 0x420: 0x100, 0x421: 0x100, 0x422: 0x100, 0x423: 0x100, 0x424: 0x100, 0x425: 0x100, 0x426: 0x100, 0x427: 0x100, 0x428: 0x100, 0x429: 0x100, 0x42a: 0x100, 0x42b: 0x100, 0x42c: 0x100, 0x42d: 0x100, 0x42e: 0x100, 0x42f: 0x100, 0x430: 0x100, 0x431: 0x100, 0x432: 0x100, 0x433: 0x100, 0x434: 0x100, 0x435: 0x100, 0x436: 0x100, 0x437: 0x100, 0x438: 0x100, 0x439: 0x100, 0x43a: 0x100, 0x43b: 0x100, 0x43c: 0x100, 0x43d: 0x100, 0x43e: 0x164, 0x43f: 0x165, // Block 0x11, offset 0x440 0x440: 0xa6, 0x441: 0xa6, 0x442: 0xa6, 0x443: 0xa6, 0x444: 0xa6, 0x445: 0xa6, 0x446: 0xa6, 0x447: 0xa6, 0x448: 0xa6, 0x449: 0xa6, 0x44a: 0xa6, 0x44b: 0xa6, 0x44c: 0xa6, 0x44d: 0xa6, 0x44e: 0xa6, 0x44f: 0xa6, 0x450: 0x166, 0x451: 0x167, 0x452: 0x100, 0x453: 0x100, 0x454: 0x100, 0x455: 0x100, 0x456: 0x100, 0x457: 0x100, 0x458: 0x100, 0x459: 0x100, 0x45a: 0x100, 0x45b: 0x100, 0x45c: 0x100, 0x45d: 0x100, 0x45e: 0x100, 0x45f: 0x100, 0x460: 0x100, 0x461: 0x100, 0x462: 0x100, 0x463: 0x100, 0x464: 0x100, 0x465: 0x100, 0x466: 0x100, 0x467: 0x100, 0x468: 0x100, 0x469: 0x100, 0x46a: 0x100, 0x46b: 0x100, 0x46c: 0x100, 0x46d: 0x100, 0x46e: 0x100, 0x46f: 0x100, 0x470: 0x100, 0x471: 0x100, 0x472: 0x100, 0x473: 0x100, 0x474: 0x100, 0x475: 0x100, 0x476: 0x100, 0x477: 0x100, 0x478: 0x100, 0x479: 0x100, 0x47a: 0x100, 0x47b: 0x100, 0x47c: 0x100, 0x47d: 0x100, 0x47e: 0x100, 0x47f: 0x100, // Block 0x12, offset 0x480 0x480: 0x100, 0x481: 0x100, 0x482: 0x100, 0x483: 0x100, 0x484: 0x100, 0x485: 0x100, 0x486: 0x100, 0x487: 0x100, 0x488: 0x100, 0x489: 0x100, 0x48a: 0x100, 0x48b: 0x100, 0x48c: 0x100, 0x48d: 0x100, 0x48e: 0x100, 0x48f: 0x100, 0x490: 0xa6, 0x491: 0xa6, 0x492: 0xa6, 0x493: 0xa6, 0x494: 0xa6, 0x495: 0xa6, 0x496: 0xa6, 0x497: 0xa6, 0x498: 0xa6, 0x499: 0x14a, 0x49a: 0x100, 0x49b: 0x100, 0x49c: 0x100, 0x49d: 0x100, 0x49e: 0x100, 0x49f: 0x100, 0x4a0: 0x100, 0x4a1: 0x100, 0x4a2: 0x100, 0x4a3: 0x100, 0x4a4: 0x100, 0x4a5: 0x100, 0x4a6: 0x100, 0x4a7: 0x100, 0x4a8: 0x100, 0x4a9: 0x100, 0x4aa: 0x100, 0x4ab: 0x100, 0x4ac: 0x100, 0x4ad: 0x100, 0x4ae: 0x100, 0x4af: 0x100, 0x4b0: 0x100, 0x4b1: 0x100, 0x4b2: 0x100, 0x4b3: 0x100, 0x4b4: 0x100, 0x4b5: 0x100, 0x4b6: 0x100, 0x4b7: 0x100, 0x4b8: 0x100, 0x4b9: 0x100, 0x4ba: 0x100, 0x4bb: 0x100, 0x4bc: 0x100, 0x4bd: 0x100, 0x4be: 0x100, 0x4bf: 0x100, // Block 0x13, offset 0x4c0 0x4c0: 0x100, 0x4c1: 0x100, 0x4c2: 0x100, 0x4c3: 0x100, 0x4c4: 0x100, 0x4c5: 0x100, 0x4c6: 0x100, 0x4c7: 0x100, 0x4c8: 0x100, 0x4c9: 0x100, 0x4ca: 0x100, 0x4cb: 0x100, 0x4cc: 0x100, 0x4cd: 0x100, 0x4ce: 0x100, 0x4cf: 0x100, 0x4d0: 0x100, 0x4d1: 0x100, 0x4d2: 0x100, 0x4d3: 0x100, 0x4d4: 0x100, 0x4d5: 0x100, 0x4d6: 0x100, 0x4d7: 0x100, 0x4d8: 0x100, 0x4d9: 0x100, 0x4da: 0x100, 0x4db: 0x100, 0x4dc: 0x100, 0x4dd: 0x100, 0x4de: 0x100, 0x4df: 0x100, 0x4e0: 0xa6, 0x4e1: 0xa6, 0x4e2: 0xa6, 0x4e3: 0xa6, 0x4e4: 0xa6, 0x4e5: 0xa6, 0x4e6: 0xa6, 0x4e7: 0xa6, 0x4e8: 0x154, 0x4e9: 0x168, 0x4ea: 0x169, 0x4eb: 0x16a, 0x4ec: 0x16b, 0x4ed: 0x16c, 0x4ee: 0x16d, 0x4ef: 0x100, 0x4f0: 0x100, 0x4f1: 0x100, 0x4f2: 0x100, 0x4f3: 0x100, 0x4f4: 0x100, 0x4f5: 0x100, 0x4f6: 0x100, 0x4f7: 0x100, 0x4f8: 0x100, 0x4f9: 0x16e, 0x4fa: 0x16f, 0x4fb: 0x100, 0x4fc: 0xa6, 0x4fd: 0x170, 0x4fe: 0x171, 0x4ff: 0x172, // Block 0x14, offset 0x500 0x500: 0xa6, 0x501: 0xa6, 0x502: 0xa6, 0x503: 0xa6, 0x504: 0xa6, 0x505: 0xa6, 0x506: 0xa6, 0x507: 0xa6, 0x508: 0xa6, 0x509: 0xa6, 0x50a: 0xa6, 0x50b: 0xa6, 0x50c: 0xa6, 0x50d: 0xa6, 0x50e: 0xa6, 0x50f: 0xa6, 0x510: 0xa6, 0x511: 0xa6, 0x512: 0xa6, 0x513: 0xa6, 0x514: 0xa6, 0x515: 0xa6, 0x516: 0xa6, 0x517: 0xa6, 0x518: 0xa6, 0x519: 0xa6, 0x51a: 0xa6, 0x51b: 0xa6, 0x51c: 0xa6, 0x51d: 0xa6, 0x51e: 0xa6, 0x51f: 0x173, 0x520: 0xa6, 0x521: 0xa6, 0x522: 0xa6, 0x523: 0xa6, 0x524: 0xa6, 0x525: 0xa6, 0x526: 0xa6, 0x527: 0xa6, 0x528: 0xa6, 0x529: 0xa6, 0x52a: 0xa6, 0x52b: 0xa6, 0x52c: 0xa6, 0x52d: 0xa6, 0x52e: 0xa6, 0x52f: 0xa6, 0x530: 0xa6, 0x531: 0xa6, 0x532: 0xa6, 0x533: 0x174, 0x534: 0x175, 0x535: 0x100, 0x536: 0x100, 0x537: 0x100, 0x538: 0x100, 0x539: 0x100, 0x53a: 0x100, 0x53b: 0x100, 0x53c: 0x100, 0x53d: 0x100, 0x53e: 0x100, 0x53f: 0x100, // Block 0x15, offset 0x540 0x540: 0x100, 0x541: 0x100, 0x542: 0x100, 0x543: 0x100, 0x544: 0x100, 0x545: 0x100, 0x546: 0x100, 0x547: 0x100, 0x548: 0x100, 0x549: 0x100, 0x54a: 0x100, 0x54b: 0x100, 0x54c: 0x100, 0x54d: 0x100, 0x54e: 0x100, 0x54f: 0x100, 0x550: 0x100, 0x551: 0x100, 0x552: 0x100, 0x553: 0x100, 0x554: 0x100, 0x555: 0x100, 0x556: 0x100, 0x557: 0x100, 0x558: 0x100, 0x559: 0x100, 0x55a: 0x100, 0x55b: 0x100, 0x55c: 0x100, 0x55d: 0x100, 0x55e: 0x100, 0x55f: 0x100, 0x560: 0x100, 0x561: 0x100, 0x562: 0x100, 0x563: 0x100, 0x564: 0x100, 0x565: 0x100, 0x566: 0x100, 0x567: 0x100, 0x568: 0x100, 0x569: 0x100, 0x56a: 0x100, 0x56b: 0x100, 0x56c: 0x100, 0x56d: 0x100, 0x56e: 0x100, 0x56f: 0x100, 0x570: 0x100, 0x571: 0x100, 0x572: 0x100, 0x573: 0x100, 0x574: 0x100, 0x575: 0x100, 0x576: 0x100, 0x577: 0x100, 0x578: 0x100, 0x579: 0x100, 0x57a: 0x100, 0x57b: 0x100, 0x57c: 0x100, 0x57d: 0x100, 0x57e: 0x100, 0x57f: 0x176, // Block 0x16, offset 0x580 0x580: 0xa6, 0x581: 0xa6, 0x582: 0xa6, 0x583: 0xa6, 0x584: 0x177, 0x585: 0x178, 0x586: 0xa6, 0x587: 0xa6, 0x588: 0xa6, 0x589: 0xa6, 0x58a: 0xa6, 0x58b: 0x179, 0x58c: 0x100, 0x58d: 0x100, 0x58e: 0x100, 0x58f: 0x100, 0x590: 0x100, 0x591: 0x100, 0x592: 0x100, 0x593: 0x100, 0x594: 0x100, 0x595: 0x100, 0x596: 0x100, 0x597: 0x100, 0x598: 0x100, 0x599: 0x100, 0x59a: 0x100, 0x59b: 0x100, 0x59c: 0x100, 0x59d: 0x100, 0x59e: 0x100, 0x59f: 0x100, 0x5a0: 0x100, 0x5a1: 0x100, 0x5a2: 0x100, 0x5a3: 0x100, 0x5a4: 0x100, 0x5a5: 0x100, 0x5a6: 0x100, 0x5a7: 0x100, 0x5a8: 0x100, 0x5a9: 0x100, 0x5aa: 0x100, 0x5ab: 0x100, 0x5ac: 0x100, 0x5ad: 0x100, 0x5ae: 0x100, 0x5af: 0x100, 0x5b0: 0xa6, 0x5b1: 0x17a, 0x5b2: 0x17b, 0x5b3: 0x100, 0x5b4: 0x100, 0x5b5: 0x100, 0x5b6: 0x100, 0x5b7: 0x100, 0x5b8: 0x100, 0x5b9: 0x100, 0x5ba: 0x100, 0x5bb: 0x100, 0x5bc: 0x100, 0x5bd: 0x100, 0x5be: 0x100, 0x5bf: 0x100, // Block 0x17, offset 0x5c0 0x5c0: 0x100, 0x5c1: 0x100, 0x5c2: 0x100, 0x5c3: 0x100, 0x5c4: 0x100, 0x5c5: 0x100, 0x5c6: 0x100, 0x5c7: 0x100, 0x5c8: 0x100, 0x5c9: 0x100, 0x5ca: 0x100, 0x5cb: 0x100, 0x5cc: 0x100, 0x5cd: 0x100, 0x5ce: 0x100, 0x5cf: 0x100, 0x5d0: 0x100, 0x5d1: 0x100, 0x5d2: 0x100, 0x5d3: 0x100, 0x5d4: 0x100, 0x5d5: 0x100, 0x5d6: 0x100, 0x5d7: 0x100, 0x5d8: 0x100, 0x5d9: 0x100, 0x5da: 0x100, 0x5db: 0x100, 0x5dc: 0x100, 0x5dd: 0x100, 0x5de: 0x100, 0x5df: 0x100, 0x5e0: 0x100, 0x5e1: 0x100, 0x5e2: 0x100, 0x5e3: 0x100, 0x5e4: 0x100, 0x5e5: 0x100, 0x5e6: 0x100, 0x5e7: 0x100, 0x5e8: 0x100, 0x5e9: 0x100, 0x5ea: 0x100, 0x5eb: 0x100, 0x5ec: 0x100, 0x5ed: 0x100, 0x5ee: 0x100, 0x5ef: 0x100, 0x5f0: 0x100, 0x5f1: 0x100, 0x5f2: 0x100, 0x5f3: 0x100, 0x5f4: 0x100, 0x5f5: 0x100, 0x5f6: 0x100, 0x5f7: 0x100, 0x5f8: 0x100, 0x5f9: 0x100, 0x5fa: 0x100, 0x5fb: 0x100, 0x5fc: 0x17c, 0x5fd: 0x17d, 0x5fe: 0xa2, 0x5ff: 0x17e, // Block 0x18, offset 0x600 0x600: 0xa2, 0x601: 0xa2, 0x602: 0xa2, 0x603: 0x17f, 0x604: 0x180, 0x605: 0x181, 0x606: 0x182, 0x607: 0x183, 0x608: 0xa2, 0x609: 0x184, 0x60a: 0x100, 0x60b: 0x185, 0x60c: 0xa2, 0x60d: 0x186, 0x60e: 0x100, 0x60f: 0x100, 0x610: 0x63, 0x611: 0x64, 0x612: 0x65, 0x613: 0x66, 0x614: 0x67, 0x615: 0x68, 0x616: 0x69, 0x617: 0x6a, 0x618: 0x6b, 0x619: 0x6c, 0x61a: 0x6d, 0x61b: 0x6e, 0x61c: 0x6f, 0x61d: 0x70, 0x61e: 0x71, 0x61f: 0x72, 0x620: 0xa2, 0x621: 0xa2, 0x622: 0xa2, 0x623: 0xa2, 0x624: 0xa2, 0x625: 0xa2, 0x626: 0xa2, 0x627: 0xa2, 0x628: 0x187, 0x629: 0x188, 0x62a: 0x189, 0x62b: 0x100, 0x62c: 0x100, 0x62d: 0x100, 0x62e: 0x100, 0x62f: 0x100, 0x630: 0x100, 0x631: 0x100, 0x632: 0x100, 0x633: 0x100, 0x634: 0x100, 0x635: 0x100, 0x636: 0x100, 0x637: 0x100, 0x638: 0x100, 0x639: 0x100, 0x63a: 0x100, 0x63b: 0x100, 0x63c: 0x18a, 0x63d: 0x100, 0x63e: 0x100, 0x63f: 0x100, // Block 0x19, offset 0x640 0x640: 0x73, 0x641: 0x74, 0x642: 0x18b, 0x643: 0x100, 0x644: 0x18c, 0x645: 0x18d, 0x646: 0x100, 0x647: 0x100, 0x648: 0x100, 0x649: 0x100, 0x64a: 0x18e, 0x64b: 0x18f, 0x64c: 0x100, 0x64d: 0x100, 0x64e: 0x100, 0x64f: 0x100, 0x650: 0x100, 0x651: 0x100, 0x652: 0x100, 0x653: 0x190, 0x654: 0x100, 0x655: 0x100, 0x656: 0x100, 0x657: 0x100, 0x658: 0x100, 0x659: 0x100, 0x65a: 0x100, 0x65b: 0x100, 0x65c: 0x100, 0x65d: 0x100, 0x65e: 0x100, 0x65f: 0x191, 0x660: 0x127, 0x661: 0x127, 0x662: 0x127, 0x663: 0x192, 0x664: 0x75, 0x665: 0x193, 0x666: 0x100, 0x667: 0x100, 0x668: 0x100, 0x669: 0x100, 0x66a: 0x100, 0x66b: 0x100, 0x66c: 0x100, 0x66d: 0x100, 0x66e: 0x100, 0x66f: 0x100, 0x670: 0x100, 0x671: 0x194, 0x672: 0x195, 0x673: 0x100, 0x674: 0x196, 0x675: 0x100, 0x676: 0x100, 0x677: 0x100, 0x678: 0x76, 0x679: 0x77, 0x67a: 0x78, 0x67b: 0x197, 0x67c: 0x100, 0x67d: 0x100, 0x67e: 0x100, 0x67f: 0x100, // Block 0x1a, offset 0x680 0x680: 0x198, 0x681: 0xa2, 0x682: 0x199, 0x683: 0x19a, 0x684: 0x79, 0x685: 0x7a, 0x686: 0x19b, 0x687: 0x19c, 0x688: 0x7b, 0x689: 0x19d, 0x68a: 0x100, 0x68b: 0x100, 0x68c: 0xa2, 0x68d: 0xa2, 0x68e: 0xa2, 0x68f: 0xa2, 0x690: 0xa2, 0x691: 0xa2, 0x692: 0xa2, 0x693: 0xa2, 0x694: 0xa2, 0x695: 0xa2, 0x696: 0xa2, 0x697: 0xa2, 0x698: 0xa2, 0x699: 0xa2, 0x69a: 0xa2, 0x69b: 0x19e, 0x69c: 0xa2, 0x69d: 0x19f, 0x69e: 0xa2, 0x69f: 0x1a0, 0x6a0: 0x1a1, 0x6a1: 0x1a2, 0x6a2: 0x1a3, 0x6a3: 0x100, 0x6a4: 0xa2, 0x6a5: 0xa2, 0x6a6: 0xa2, 0x6a7: 0xa2, 0x6a8: 0xa2, 0x6a9: 0x1a4, 0x6aa: 0x1a5, 0x6ab: 0x1a6, 0x6ac: 0xa2, 0x6ad: 0xa2, 0x6ae: 0x1a7, 0x6af: 0x1a8, 0x6b0: 0x100, 0x6b1: 0x100, 0x6b2: 0x100, 0x6b3: 0x100, 0x6b4: 0x100, 0x6b5: 0x100, 0x6b6: 0x100, 0x6b7: 0x100, 0x6b8: 0x100, 0x6b9: 0x100, 0x6ba: 0x100, 0x6bb: 0x100, 0x6bc: 0x100, 0x6bd: 0x100, 0x6be: 0x100, 0x6bf: 0x100, // Block 0x1b, offset 0x6c0 0x6c0: 0xa6, 0x6c1: 0xa6, 0x6c2: 0xa6, 0x6c3: 0xa6, 0x6c4: 0xa6, 0x6c5: 0xa6, 0x6c6: 0xa6, 0x6c7: 0xa6, 0x6c8: 0xa6, 0x6c9: 0xa6, 0x6ca: 0xa6, 0x6cb: 0xa6, 0x6cc: 0xa6, 0x6cd: 0xa6, 0x6ce: 0xa6, 0x6cf: 0xa6, 0x6d0: 0xa6, 0x6d1: 0xa6, 0x6d2: 0xa6, 0x6d3: 0xa6, 0x6d4: 0xa6, 0x6d5: 0xa6, 0x6d6: 0xa6, 0x6d7: 0xa6, 0x6d8: 0xa6, 0x6d9: 0xa6, 0x6da: 0xa6, 0x6db: 0x1a9, 0x6dc: 0xa6, 0x6dd: 0xa6, 0x6de: 0xa6, 0x6df: 0xa6, 0x6e0: 0xa6, 0x6e1: 0xa6, 0x6e2: 0xa6, 0x6e3: 0xa6, 0x6e4: 0xa6, 0x6e5: 0xa6, 0x6e6: 0xa6, 0x6e7: 0xa6, 0x6e8: 0xa6, 0x6e9: 0xa6, 0x6ea: 0xa6, 0x6eb: 0xa6, 0x6ec: 0xa6, 0x6ed: 0xa6, 0x6ee: 0xa6, 0x6ef: 0xa6, 0x6f0: 0xa6, 0x6f1: 0xa6, 0x6f2: 0xa6, 0x6f3: 0xa6, 0x6f4: 0xa6, 0x6f5: 0xa6, 0x6f6: 0xa6, 0x6f7: 0xa6, 0x6f8: 0xa6, 0x6f9: 0xa6, 0x6fa: 0xa6, 0x6fb: 0xa6, 0x6fc: 0xa6, 0x6fd: 0xa6, 0x6fe: 0xa6, 0x6ff: 0xa6, // Block 0x1c, offset 0x700 0x700: 0xa6, 0x701: 0xa6, 0x702: 0xa6, 0x703: 0xa6, 0x704: 0xa6, 0x705: 0xa6, 0x706: 0xa6, 0x707: 0xa6, 0x708: 0xa6, 0x709: 0xa6, 0x70a: 0xa6, 0x70b: 0xa6, 0x70c: 0xa6, 0x70d: 0xa6, 0x70e: 0xa6, 0x70f: 0xa6, 0x710: 0xa6, 0x711: 0xa6, 0x712: 0xa6, 0x713: 0xa6, 0x714: 0xa6, 0x715: 0xa6, 0x716: 0xa6, 0x717: 0xa6, 0x718: 0xa6, 0x719: 0xa6, 0x71a: 0xa6, 0x71b: 0xa6, 0x71c: 0x1aa, 0x71d: 0xa6, 0x71e: 0xa6, 0x71f: 0xa6, 0x720: 0x1ab, 0x721: 0xa6, 0x722: 0xa6, 0x723: 0xa6, 0x724: 0xa6, 0x725: 0xa6, 0x726: 0xa6, 0x727: 0xa6, 0x728: 0xa6, 0x729: 0xa6, 0x72a: 0xa6, 0x72b: 0xa6, 0x72c: 0xa6, 0x72d: 0xa6, 0x72e: 0xa6, 0x72f: 0xa6, 0x730: 0xa6, 0x731: 0xa6, 0x732: 0xa6, 0x733: 0xa6, 0x734: 0xa6, 0x735: 0xa6, 0x736: 0xa6, 0x737: 0xa6, 0x738: 0xa6, 0x739: 0xa6, 0x73a: 0xa6, 0x73b: 0xa6, 0x73c: 0xa6, 0x73d: 0xa6, 0x73e: 0xa6, 0x73f: 0xa6, // Block 0x1d, offset 0x740 0x740: 0xa6, 0x741: 0xa6, 0x742: 0xa6, 0x743: 0xa6, 0x744: 0xa6, 0x745: 0xa6, 0x746: 0xa6, 0x747: 0xa6, 0x748: 0xa6, 0x749: 0xa6, 0x74a: 0xa6, 0x74b: 0xa6, 0x74c: 0xa6, 0x74d: 0xa6, 0x74e: 0xa6, 0x74f: 0xa6, 0x750: 0xa6, 0x751: 0xa6, 0x752: 0xa6, 0x753: 0xa6, 0x754: 0xa6, 0x755: 0xa6, 0x756: 0xa6, 0x757: 0xa6, 0x758: 0xa6, 0x759: 0xa6, 0x75a: 0xa6, 0x75b: 0xa6, 0x75c: 0xa6, 0x75d: 0xa6, 0x75e: 0xa6, 0x75f: 0xa6, 0x760: 0xa6, 0x761: 0xa6, 0x762: 0xa6, 0x763: 0xa6, 0x764: 0xa6, 0x765: 0xa6, 0x766: 0xa6, 0x767: 0xa6, 0x768: 0xa6, 0x769: 0xa6, 0x76a: 0xa6, 0x76b: 0xa6, 0x76c: 0xa6, 0x76d: 0xa6, 0x76e: 0xa6, 0x76f: 0xa6, 0x770: 0xa6, 0x771: 0xa6, 0x772: 0xa6, 0x773: 0xa6, 0x774: 0xa6, 0x775: 0xa6, 0x776: 0xa6, 0x777: 0xa6, 0x778: 0xa6, 0x779: 0xa6, 0x77a: 0x1ac, 0x77b: 0xa6, 0x77c: 0xa6, 0x77d: 0xa6, 0x77e: 0xa6, 0x77f: 0xa6, // Block 0x1e, offset 0x780 0x780: 0xa6, 0x781: 0xa6, 0x782: 0xa6, 0x783: 0xa6, 0x784: 0xa6, 0x785: 0xa6, 0x786: 0xa6, 0x787: 0xa6, 0x788: 0xa6, 0x789: 0xa6, 0x78a: 0xa6, 0x78b: 0xa6, 0x78c: 0xa6, 0x78d: 0xa6, 0x78e: 0xa6, 0x78f: 0xa6, 0x790: 0xa6, 0x791: 0xa6, 0x792: 0xa6, 0x793: 0xa6, 0x794: 0xa6, 0x795: 0xa6, 0x796: 0xa6, 0x797: 0xa6, 0x798: 0xa6, 0x799: 0xa6, 0x79a: 0xa6, 0x79b: 0xa6, 0x79c: 0xa6, 0x79d: 0xa6, 0x79e: 0xa6, 0x79f: 0xa6, 0x7a0: 0xa6, 0x7a1: 0xa6, 0x7a2: 0xa6, 0x7a3: 0xa6, 0x7a4: 0xa6, 0x7a5: 0xa6, 0x7a6: 0xa6, 0x7a7: 0xa6, 0x7a8: 0xa6, 0x7a9: 0xa6, 0x7aa: 0xa6, 0x7ab: 0xa6, 0x7ac: 0xa6, 0x7ad: 0xa6, 0x7ae: 0xa6, 0x7af: 0x1ad, 0x7b0: 0x100, 0x7b1: 0x100, 0x7b2: 0x100, 0x7b3: 0x100, 0x7b4: 0x100, 0x7b5: 0x100, 0x7b6: 0x100, 0x7b7: 0x100, 0x7b8: 0x100, 0x7b9: 0x100, 0x7ba: 0x100, 0x7bb: 0x100, 0x7bc: 0x100, 0x7bd: 0x100, 0x7be: 0x100, 0x7bf: 0x100, // Block 0x1f, offset 0x7c0 0x7c0: 0x100, 0x7c1: 0x100, 0x7c2: 0x100, 0x7c3: 0x100, 0x7c4: 0x100, 0x7c5: 0x100, 0x7c6: 0x100, 0x7c7: 0x100, 0x7c8: 0x100, 0x7c9: 0x100, 0x7ca: 0x100, 0x7cb: 0x100, 0x7cc: 0x100, 0x7cd: 0x100, 0x7ce: 0x100, 0x7cf: 0x100, 0x7d0: 0x100, 0x7d1: 0x100, 0x7d2: 0x100, 0x7d3: 0x100, 0x7d4: 0x100, 0x7d5: 0x100, 0x7d6: 0x100, 0x7d7: 0x100, 0x7d8: 0x100, 0x7d9: 0x100, 0x7da: 0x100, 0x7db: 0x100, 0x7dc: 0x100, 0x7dd: 0x100, 0x7de: 0x100, 0x7df: 0x100, 0x7e0: 0x7c, 0x7e1: 0x7d, 0x7e2: 0x7e, 0x7e3: 0x7f, 0x7e4: 0x80, 0x7e5: 0x81, 0x7e6: 0x82, 0x7e7: 0x83, 0x7e8: 0x84, 0x7e9: 0x100, 0x7ea: 0x100, 0x7eb: 0x100, 0x7ec: 0x100, 0x7ed: 0x100, 0x7ee: 0x100, 0x7ef: 0x100, 0x7f0: 0x100, 0x7f1: 0x100, 0x7f2: 0x100, 0x7f3: 0x100, 0x7f4: 0x100, 0x7f5: 0x100, 0x7f6: 0x100, 0x7f7: 0x100, 0x7f8: 0x100, 0x7f9: 0x100, 0x7fa: 0x100, 0x7fb: 0x100, 0x7fc: 0x100, 0x7fd: 0x100, 0x7fe: 0x100, 0x7ff: 0x100, // Block 0x20, offset 0x800 0x800: 0xa6, 0x801: 0xa6, 0x802: 0xa6, 0x803: 0xa6, 0x804: 0xa6, 0x805: 0xa6, 0x806: 0xa6, 0x807: 0xa6, 0x808: 0xa6, 0x809: 0xa6, 0x80a: 0xa6, 0x80b: 0xa6, 0x80c: 0xa6, 0x80d: 0x1ae, 0x80e: 0xa6, 0x80f: 0xa6, 0x810: 0xa6, 0x811: 0xa6, 0x812: 0xa6, 0x813: 0xa6, 0x814: 0xa6, 0x815: 0xa6, 0x816: 0xa6, 0x817: 0xa6, 0x818: 0xa6, 0x819: 0xa6, 0x81a: 0xa6, 0x81b: 0xa6, 0x81c: 0xa6, 0x81d: 0xa6, 0x81e: 0xa6, 0x81f: 0xa6, 0x820: 0xa6, 0x821: 0xa6, 0x822: 0xa6, 0x823: 0xa6, 0x824: 0xa6, 0x825: 0xa6, 0x826: 0xa6, 0x827: 0xa6, 0x828: 0xa6, 0x829: 0xa6, 0x82a: 0xa6, 0x82b: 0xa6, 0x82c: 0xa6, 0x82d: 0xa6, 0x82e: 0xa6, 0x82f: 0xa6, 0x830: 0xa6, 0x831: 0xa6, 0x832: 0xa6, 0x833: 0xa6, 0x834: 0xa6, 0x835: 0xa6, 0x836: 0xa6, 0x837: 0xa6, 0x838: 0xa6, 0x839: 0xa6, 0x83a: 0xa6, 0x83b: 0xa6, 0x83c: 0xa6, 0x83d: 0xa6, 0x83e: 0xa6, 0x83f: 0xa6, // Block 0x21, offset 0x840 0x840: 0xa6, 0x841: 0xa6, 0x842: 0xa6, 0x843: 0xa6, 0x844: 0xa6, 0x845: 0xa6, 0x846: 0xa6, 0x847: 0xa6, 0x848: 0xa6, 0x849: 0xa6, 0x84a: 0xa6, 0x84b: 0xa6, 0x84c: 0xa6, 0x84d: 0xa6, 0x84e: 0x1af, 0x84f: 0x100, 0x850: 0x100, 0x851: 0x100, 0x852: 0x100, 0x853: 0x100, 0x854: 0x100, 0x855: 0x100, 0x856: 0x100, 0x857: 0x100, 0x858: 0x100, 0x859: 0x100, 0x85a: 0x100, 0x85b: 0x100, 0x85c: 0x100, 0x85d: 0x100, 0x85e: 0x100, 0x85f: 0x100, 0x860: 0x100, 0x861: 0x100, 0x862: 0x100, 0x863: 0x100, 0x864: 0x100, 0x865: 0x100, 0x866: 0x100, 0x867: 0x100, 0x868: 0x100, 0x869: 0x100, 0x86a: 0x100, 0x86b: 0x100, 0x86c: 0x100, 0x86d: 0x100, 0x86e: 0x100, 0x86f: 0x100, 0x870: 0x100, 0x871: 0x100, 0x872: 0x100, 0x873: 0x100, 0x874: 0x100, 0x875: 0x100, 0x876: 0x100, 0x877: 0x100, 0x878: 0x100, 0x879: 0x100, 0x87a: 0x100, 0x87b: 0x100, 0x87c: 0x100, 0x87d: 0x100, 0x87e: 0x100, 0x87f: 0x100, // Block 0x22, offset 0x880 0x890: 0x0c, 0x891: 0x0d, 0x892: 0x0e, 0x893: 0x0f, 0x894: 0x10, 0x895: 0x0a, 0x896: 0x11, 0x897: 0x07, 0x898: 0x12, 0x899: 0x0a, 0x89a: 0x13, 0x89b: 0x14, 0x89c: 0x15, 0x89d: 0x16, 0x89e: 0x17, 0x89f: 0x18, 0x8a0: 0x07, 0x8a1: 0x07, 0x8a2: 0x07, 0x8a3: 0x07, 0x8a4: 0x07, 0x8a5: 0x07, 0x8a6: 0x07, 0x8a7: 0x07, 0x8a8: 0x07, 0x8a9: 0x07, 0x8aa: 0x19, 0x8ab: 0x1a, 0x8ac: 0x1b, 0x8ad: 0x07, 0x8ae: 0x1c, 0x8af: 0x1d, 0x8b0: 0x07, 0x8b1: 0x1e, 0x8b2: 0x1f, 0x8b3: 0x0a, 0x8b4: 0x0a, 0x8b5: 0x0a, 0x8b6: 0x0a, 0x8b7: 0x0a, 0x8b8: 0x0a, 0x8b9: 0x0a, 0x8ba: 0x0a, 0x8bb: 0x0a, 0x8bc: 0x0a, 0x8bd: 0x0a, 0x8be: 0x0a, 0x8bf: 0x0a, // Block 0x23, offset 0x8c0 0x8c0: 0x0a, 0x8c1: 0x0a, 0x8c2: 0x0a, 0x8c3: 0x0a, 0x8c4: 0x0a, 0x8c5: 0x0a, 0x8c6: 0x0a, 0x8c7: 0x0a, 0x8c8: 0x0a, 0x8c9: 0x0a, 0x8ca: 0x0a, 0x8cb: 0x0a, 0x8cc: 0x0a, 0x8cd: 0x0a, 0x8ce: 0x0a, 0x8cf: 0x0a, 0x8d0: 0x0a, 0x8d1: 0x0a, 0x8d2: 0x0a, 0x8d3: 0x0a, 0x8d4: 0x0a, 0x8d5: 0x0a, 0x8d6: 0x0a, 0x8d7: 0x0a, 0x8d8: 0x0a, 0x8d9: 0x0a, 0x8da: 0x0a, 0x8db: 0x0a, 0x8dc: 0x0a, 0x8dd: 0x0a, 0x8de: 0x0a, 0x8df: 0x0a, 0x8e0: 0x0a, 0x8e1: 0x0a, 0x8e2: 0x0a, 0x8e3: 0x0a, 0x8e4: 0x0a, 0x8e5: 0x0a, 0x8e6: 0x0a, 0x8e7: 0x0a, 0x8e8: 0x0a, 0x8e9: 0x0a, 0x8ea: 0x0a, 0x8eb: 0x0a, 0x8ec: 0x0a, 0x8ed: 0x0a, 0x8ee: 0x0a, 0x8ef: 0x0a, 0x8f0: 0x0a, 0x8f1: 0x0a, 0x8f2: 0x0a, 0x8f3: 0x0a, 0x8f4: 0x0a, 0x8f5: 0x0a, 0x8f6: 0x0a, 0x8f7: 0x0a, 0x8f8: 0x0a, 0x8f9: 0x0a, 0x8fa: 0x0a, 0x8fb: 0x0a, 0x8fc: 0x0a, 0x8fd: 0x0a, 0x8fe: 0x0a, 0x8ff: 0x0a, // Block 0x24, offset 0x900 0x900: 0x1b0, 0x901: 0x1b1, 0x902: 0x100, 0x903: 0x100, 0x904: 0x1b2, 0x905: 0x1b2, 0x906: 0x1b2, 0x907: 0x1b3, 0x908: 0x100, 0x909: 0x100, 0x90a: 0x100, 0x90b: 0x100, 0x90c: 0x100, 0x90d: 0x100, 0x90e: 0x100, 0x90f: 0x100, 0x910: 0x100, 0x911: 0x100, 0x912: 0x100, 0x913: 0x100, 0x914: 0x100, 0x915: 0x100, 0x916: 0x100, 0x917: 0x100, 0x918: 0x100, 0x919: 0x100, 0x91a: 0x100, 0x91b: 0x100, 0x91c: 0x100, 0x91d: 0x100, 0x91e: 0x100, 0x91f: 0x100, 0x920: 0x100, 0x921: 0x100, 0x922: 0x100, 0x923: 0x100, 0x924: 0x100, 0x925: 0x100, 0x926: 0x100, 0x927: 0x100, 0x928: 0x100, 0x929: 0x100, 0x92a: 0x100, 0x92b: 0x100, 0x92c: 0x100, 0x92d: 0x100, 0x92e: 0x100, 0x92f: 0x100, 0x930: 0x100, 0x931: 0x100, 0x932: 0x100, 0x933: 0x100, 0x934: 0x100, 0x935: 0x100, 0x936: 0x100, 0x937: 0x100, 0x938: 0x100, 0x939: 0x100, 0x93a: 0x100, 0x93b: 0x100, 0x93c: 0x100, 0x93d: 0x100, 0x93e: 0x100, 0x93f: 0x100, // Block 0x25, offset 0x940 0x940: 0x0a, 0x941: 0x0a, 0x942: 0x0a, 0x943: 0x0a, 0x944: 0x0a, 0x945: 0x0a, 0x946: 0x0a, 0x947: 0x0a, 0x948: 0x0a, 0x949: 0x0a, 0x94a: 0x0a, 0x94b: 0x0a, 0x94c: 0x0a, 0x94d: 0x0a, 0x94e: 0x0a, 0x94f: 0x0a, 0x950: 0x0a, 0x951: 0x0a, 0x952: 0x0a, 0x953: 0x0a, 0x954: 0x0a, 0x955: 0x0a, 0x956: 0x0a, 0x957: 0x0a, 0x958: 0x0a, 0x959: 0x0a, 0x95a: 0x0a, 0x95b: 0x0a, 0x95c: 0x0a, 0x95d: 0x0a, 0x95e: 0x0a, 0x95f: 0x0a, 0x960: 0x22, 0x961: 0x0a, 0x962: 0x0a, 0x963: 0x0a, 0x964: 0x0a, 0x965: 0x0a, 0x966: 0x0a, 0x967: 0x0a, 0x968: 0x0a, 0x969: 0x0a, 0x96a: 0x0a, 0x96b: 0x0a, 0x96c: 0x0a, 0x96d: 0x0a, 0x96e: 0x0a, 0x96f: 0x0a, 0x970: 0x0a, 0x971: 0x0a, 0x972: 0x0a, 0x973: 0x0a, 0x974: 0x0a, 0x975: 0x0a, 0x976: 0x0a, 0x977: 0x0a, 0x978: 0x0a, 0x979: 0x0a, 0x97a: 0x0a, 0x97b: 0x0a, 0x97c: 0x0a, 0x97d: 0x0a, 0x97e: 0x0a, 0x97f: 0x0a, // Block 0x26, offset 0x980 0x980: 0x0a, 0x981: 0x0a, 0x982: 0x0a, 0x983: 0x0a, 0x984: 0x0a, 0x985: 0x0a, 0x986: 0x0a, 0x987: 0x0a, 0x988: 0x0a, 0x989: 0x0a, 0x98a: 0x0a, 0x98b: 0x0a, 0x98c: 0x0a, 0x98d: 0x0a, 0x98e: 0x0a, 0x98f: 0x0a, } // idnaSparseOffset: 303 entries, 606 bytes var idnaSparseOffset = []uint16{0x0, 0x8, 0x19, 0x25, 0x27, 0x2c, 0x33, 0x3e, 0x4a, 0x4e, 0x5d, 0x62, 0x6c, 0x78, 0x7e, 0x87, 0x97, 0xa6, 0xb1, 0xbe, 0xcf, 0xd9, 0xe0, 0xed, 0xfe, 0x105, 0x110, 0x11f, 0x12d, 0x137, 0x139, 0x13e, 0x141, 0x144, 0x146, 0x152, 0x15d, 0x165, 0x16b, 0x171, 0x176, 0x17b, 0x17e, 0x182, 0x188, 0x18d, 0x198, 0x1a2, 0x1a8, 0x1b9, 0x1c4, 0x1c7, 0x1cf, 0x1d2, 0x1df, 0x1e7, 0x1eb, 0x1f2, 0x1fa, 0x20a, 0x216, 0x219, 0x223, 0x22f, 0x23b, 0x247, 0x24f, 0x254, 0x261, 0x272, 0x27d, 0x282, 0x28b, 0x293, 0x299, 0x29e, 0x2a1, 0x2a5, 0x2ab, 0x2af, 0x2b3, 0x2b7, 0x2bc, 0x2c4, 0x2cb, 0x2d6, 0x2e0, 0x2e4, 0x2e7, 0x2ed, 0x2f1, 0x2f3, 0x2f6, 0x2f8, 0x2fb, 0x305, 0x308, 0x317, 0x31b, 0x31f, 0x321, 0x32a, 0x32e, 0x333, 0x338, 0x33e, 0x34e, 0x354, 0x358, 0x367, 0x36c, 0x374, 0x37e, 0x389, 0x391, 0x3a2, 0x3ab, 0x3bb, 0x3c8, 0x3d4, 0x3d9, 0x3e6, 0x3ea, 0x3ef, 0x3f1, 0x3f3, 0x3f7, 0x3f9, 0x3fd, 0x406, 0x40c, 0x410, 0x420, 0x42a, 0x42f, 0x432, 0x438, 0x43f, 0x444, 0x448, 0x44e, 0x453, 0x45c, 0x461, 0x467, 0x46e, 0x475, 0x47c, 0x480, 0x483, 0x488, 0x494, 0x49a, 0x49f, 0x4a6, 0x4ae, 0x4b3, 0x4b7, 0x4c7, 0x4ce, 0x4d2, 0x4d6, 0x4dd, 0x4df, 0x4e2, 0x4e5, 0x4e9, 0x4f2, 0x4f6, 0x4fe, 0x501, 0x509, 0x514, 0x523, 0x52f, 0x535, 0x542, 0x54e, 0x556, 0x55f, 0x56a, 0x571, 0x580, 0x58d, 0x591, 0x59e, 0x5a7, 0x5ab, 0x5ba, 0x5c2, 0x5cd, 0x5d6, 0x5dc, 0x5e4, 0x5ed, 0x5f9, 0x5fc, 0x608, 0x60b, 0x614, 0x617, 0x61c, 0x625, 0x62a, 0x637, 0x642, 0x64b, 0x656, 0x659, 0x65c, 0x666, 0x66f, 0x67b, 0x688, 0x695, 0x6a3, 0x6aa, 0x6b5, 0x6bc, 0x6c0, 0x6c4, 0x6c7, 0x6cc, 0x6cf, 0x6d2, 0x6d6, 0x6d9, 0x6de, 0x6e5, 0x6e8, 0x6f0, 0x6f4, 0x6ff, 0x702, 0x705, 0x708, 0x70e, 0x714, 0x71d, 0x720, 0x723, 0x726, 0x72e, 0x733, 0x73c, 0x73f, 0x744, 0x74e, 0x752, 0x756, 0x759, 0x75c, 0x760, 0x76f, 0x77b, 0x77f, 0x784, 0x789, 0x78e, 0x792, 0x797, 0x7a0, 0x7a5, 0x7a9, 0x7af, 0x7b5, 0x7ba, 0x7c0, 0x7c6, 0x7d0, 0x7d6, 0x7df, 0x7e2, 0x7e5, 0x7e9, 0x7ed, 0x7f1, 0x7f7, 0x7fd, 0x802, 0x805, 0x815, 0x81c, 0x820, 0x827, 0x82b, 0x831, 0x838, 0x83f, 0x845, 0x84e, 0x852, 0x860, 0x863, 0x866, 0x86a, 0x86e, 0x871, 0x875, 0x878, 0x87d, 0x87f, 0x881} // idnaSparseValues: 2180 entries, 8720 bytes var idnaSparseValues = [2180]valueRange{ // Block 0x0, offset 0x0 {value: 0x0000, lo: 0x07}, {value: 0xe105, lo: 0x80, hi: 0x96}, {value: 0x0018, lo: 0x97, hi: 0x97}, {value: 0xe105, lo: 0x98, hi: 0x9e}, {value: 0x001f, lo: 0x9f, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xb7}, {value: 0x0008, lo: 0xb8, hi: 0xbf}, // Block 0x1, offset 0x8 {value: 0x0000, lo: 0x10}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0xe01d, lo: 0x81, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0x82}, {value: 0x0335, lo: 0x83, hi: 0x83}, {value: 0x034d, lo: 0x84, hi: 0x84}, {value: 0x0365, lo: 0x85, hi: 0x85}, {value: 0xe00d, lo: 0x86, hi: 0x86}, {value: 0x0008, lo: 0x87, hi: 0x87}, {value: 0xe00d, lo: 0x88, hi: 0x88}, {value: 0x0008, lo: 0x89, hi: 0x89}, {value: 0xe00d, lo: 0x8a, hi: 0x8a}, {value: 0x0008, lo: 0x8b, hi: 0x8b}, {value: 0xe00d, lo: 0x8c, hi: 0x8c}, {value: 0x0008, lo: 0x8d, hi: 0x8d}, {value: 0xe00d, lo: 0x8e, hi: 0x8e}, {value: 0x0008, lo: 0x8f, hi: 0xbf}, // Block 0x2, offset 0x19 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x00a9, lo: 0xb0, hi: 0xb0}, {value: 0x037d, lo: 0xb1, hi: 0xb1}, {value: 0x00b1, lo: 0xb2, hi: 0xb2}, {value: 0x00b9, lo: 0xb3, hi: 0xb3}, {value: 0x034d, lo: 0xb4, hi: 0xb4}, {value: 0x0395, lo: 0xb5, hi: 0xb5}, {value: 0xe1bd, lo: 0xb6, hi: 0xb6}, {value: 0x00c1, lo: 0xb7, hi: 0xb7}, {value: 0x00c9, lo: 0xb8, hi: 0xb8}, {value: 0x0008, lo: 0xb9, hi: 0xbf}, // Block 0x3, offset 0x25 {value: 0x0000, lo: 0x01}, {value: 0x3308, lo: 0x80, hi: 0xbf}, // Block 0x4, offset 0x27 {value: 0x0000, lo: 0x04}, {value: 0x03f5, lo: 0x80, hi: 0x8f}, {value: 0xe105, lo: 0x90, hi: 0x9f}, {value: 0x049d, lo: 0xa0, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x5, offset 0x2c {value: 0x0000, lo: 0x06}, {value: 0xe185, lo: 0x80, hi: 0x8f}, {value: 0x0545, lo: 0x90, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x98}, {value: 0x0008, lo: 0x99, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x6, offset 0x33 {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0131, lo: 0x87, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x88}, {value: 0x0018, lo: 0x89, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0x90}, {value: 0x3308, lo: 0x91, hi: 0xbd}, {value: 0x0818, lo: 0xbe, hi: 0xbe}, {value: 0x3308, lo: 0xbf, hi: 0xbf}, // Block 0x7, offset 0x3e {value: 0x0000, lo: 0x0b}, {value: 0x0818, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x82}, {value: 0x0818, lo: 0x83, hi: 0x83}, {value: 0x3308, lo: 0x84, hi: 0x85}, {value: 0x0818, lo: 0x86, hi: 0x86}, {value: 0x3308, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0808, lo: 0x90, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xae}, {value: 0x0808, lo: 0xaf, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0x8, offset 0x4a {value: 0x0000, lo: 0x03}, {value: 0x0a08, lo: 0x80, hi: 0x87}, {value: 0x0c08, lo: 0x88, hi: 0x99}, {value: 0x0a08, lo: 0x9a, hi: 0xbf}, // Block 0x9, offset 0x4e {value: 0x0000, lo: 0x0e}, {value: 0x3308, lo: 0x80, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8c}, {value: 0x0c08, lo: 0x8d, hi: 0x8d}, {value: 0x0a08, lo: 0x8e, hi: 0x98}, {value: 0x0c08, lo: 0x99, hi: 0x9b}, {value: 0x0a08, lo: 0x9c, hi: 0xaa}, {value: 0x0c08, lo: 0xab, hi: 0xac}, {value: 0x0a08, lo: 0xad, hi: 0xb0}, {value: 0x0c08, lo: 0xb1, hi: 0xb1}, {value: 0x0a08, lo: 0xb2, hi: 0xb2}, {value: 0x0c08, lo: 0xb3, hi: 0xb4}, {value: 0x0a08, lo: 0xb5, hi: 0xb7}, {value: 0x0c08, lo: 0xb8, hi: 0xb9}, {value: 0x0a08, lo: 0xba, hi: 0xbf}, // Block 0xa, offset 0x5d {value: 0x0000, lo: 0x04}, {value: 0x0808, lo: 0x80, hi: 0xa5}, {value: 0x3308, lo: 0xa6, hi: 0xb0}, {value: 0x0808, lo: 0xb1, hi: 0xb1}, {value: 0x0040, lo: 0xb2, hi: 0xbf}, // Block 0xb, offset 0x62 {value: 0x0000, lo: 0x09}, {value: 0x0808, lo: 0x80, hi: 0x89}, {value: 0x0a08, lo: 0x8a, hi: 0xaa}, {value: 0x3308, lo: 0xab, hi: 0xb3}, {value: 0x0808, lo: 0xb4, hi: 0xb5}, {value: 0x0018, lo: 0xb6, hi: 0xb9}, {value: 0x0818, lo: 0xba, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbc}, {value: 0x3308, lo: 0xbd, hi: 0xbd}, {value: 0x0818, lo: 0xbe, hi: 0xbf}, // Block 0xc, offset 0x6c {value: 0x0000, lo: 0x0b}, {value: 0x0808, lo: 0x80, hi: 0x95}, {value: 0x3308, lo: 0x96, hi: 0x99}, {value: 0x0808, lo: 0x9a, hi: 0x9a}, {value: 0x3308, lo: 0x9b, hi: 0xa3}, {value: 0x0808, lo: 0xa4, hi: 0xa4}, {value: 0x3308, lo: 0xa5, hi: 0xa7}, {value: 0x0808, lo: 0xa8, hi: 0xa8}, {value: 0x3308, lo: 0xa9, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x0818, lo: 0xb0, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0xd, offset 0x78 {value: 0x0000, lo: 0x05}, {value: 0x0a08, lo: 0x80, hi: 0x88}, {value: 0x0808, lo: 0x89, hi: 0x89}, {value: 0x3308, lo: 0x8a, hi: 0xa1}, {value: 0x0840, lo: 0xa2, hi: 0xa2}, {value: 0x3308, lo: 0xa3, hi: 0xbf}, // Block 0xe, offset 0x7e {value: 0x0000, lo: 0x08}, {value: 0x3308, lo: 0x80, hi: 0x82}, {value: 0x3008, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0xb9}, {value: 0x3308, lo: 0xba, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbf}, // Block 0xf, offset 0x87 {value: 0x0000, lo: 0x0f}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x3008, lo: 0x81, hi: 0x82}, {value: 0x0040, lo: 0x83, hi: 0x85}, {value: 0x3008, lo: 0x86, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x3008, lo: 0x8a, hi: 0x8c}, {value: 0x3b08, lo: 0x8d, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x96}, {value: 0x3008, lo: 0x97, hi: 0x97}, {value: 0x0040, lo: 0x98, hi: 0xa5}, {value: 0x0008, lo: 0xa6, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbf}, // Block 0x10, offset 0x97 {value: 0x0000, lo: 0x0e}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x3008, lo: 0x81, hi: 0x83}, {value: 0x3308, lo: 0x84, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8d}, {value: 0x0008, lo: 0x8e, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x91}, {value: 0x0008, lo: 0x92, hi: 0xa8}, {value: 0x0040, lo: 0xa9, hi: 0xa9}, {value: 0x0008, lo: 0xaa, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbd}, {value: 0x3308, lo: 0xbe, hi: 0xbf}, // Block 0x11, offset 0xa6 {value: 0x0000, lo: 0x0a}, {value: 0x3308, lo: 0x80, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8d}, {value: 0x0008, lo: 0x8e, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x91}, {value: 0x0008, lo: 0x92, hi: 0xba}, {value: 0x3b08, lo: 0xbb, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbf}, // Block 0x12, offset 0xb1 {value: 0x0000, lo: 0x0c}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x99}, {value: 0x0008, lo: 0x9a, hi: 0xb1}, {value: 0x0040, lo: 0xb2, hi: 0xb2}, {value: 0x0008, lo: 0xb3, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbf}, // Block 0x13, offset 0xbe {value: 0x0000, lo: 0x10}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x89}, {value: 0x3b08, lo: 0x8a, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8e}, {value: 0x3008, lo: 0x8f, hi: 0x91}, {value: 0x3308, lo: 0x92, hi: 0x94}, {value: 0x0040, lo: 0x95, hi: 0x95}, {value: 0x3308, lo: 0x96, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x97}, {value: 0x3008, lo: 0x98, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xa5}, {value: 0x0008, lo: 0xa6, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xb1}, {value: 0x3008, lo: 0xb2, hi: 0xb3}, {value: 0x0018, lo: 0xb4, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0x14, offset 0xcf {value: 0x0000, lo: 0x09}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0xb0}, {value: 0x3308, lo: 0xb1, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xb2}, {value: 0x01f1, lo: 0xb3, hi: 0xb3}, {value: 0x3308, lo: 0xb4, hi: 0xb9}, {value: 0x3b08, lo: 0xba, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbe}, {value: 0x0018, lo: 0xbf, hi: 0xbf}, // Block 0x15, offset 0xd9 {value: 0x0000, lo: 0x06}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x3308, lo: 0x87, hi: 0x8e}, {value: 0x0018, lo: 0x8f, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0xbf}, // Block 0x16, offset 0xe0 {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x84}, {value: 0x0040, lo: 0x85, hi: 0x85}, {value: 0x0008, lo: 0x86, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x87}, {value: 0x3308, lo: 0x88, hi: 0x8e}, {value: 0x0040, lo: 0x8f, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9b}, {value: 0x0201, lo: 0x9c, hi: 0x9c}, {value: 0x0209, lo: 0x9d, hi: 0x9d}, {value: 0x0008, lo: 0x9e, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0x17, offset 0xed {value: 0x0000, lo: 0x10}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x8a}, {value: 0x0008, lo: 0x8b, hi: 0x8b}, {value: 0xe03d, lo: 0x8c, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0x97}, {value: 0x3308, lo: 0x98, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa9}, {value: 0x0018, lo: 0xaa, hi: 0xb4}, {value: 0x3308, lo: 0xb5, hi: 0xb5}, {value: 0x0018, lo: 0xb6, hi: 0xb6}, {value: 0x3308, lo: 0xb7, hi: 0xb7}, {value: 0x0018, lo: 0xb8, hi: 0xb8}, {value: 0x3308, lo: 0xb9, hi: 0xb9}, {value: 0x0018, lo: 0xba, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbf}, // Block 0x18, offset 0xfe {value: 0x0000, lo: 0x06}, {value: 0x0018, lo: 0x80, hi: 0x85}, {value: 0x3308, lo: 0x86, hi: 0x86}, {value: 0x0018, lo: 0x87, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8d}, {value: 0x0018, lo: 0x8e, hi: 0x9a}, {value: 0x0040, lo: 0x9b, hi: 0xbf}, // Block 0x19, offset 0x105 {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0xaa}, {value: 0x3008, lo: 0xab, hi: 0xac}, {value: 0x3308, lo: 0xad, hi: 0xb0}, {value: 0x3008, lo: 0xb1, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb7}, {value: 0x3008, lo: 0xb8, hi: 0xb8}, {value: 0x3b08, lo: 0xb9, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbc}, {value: 0x3308, lo: 0xbd, hi: 0xbe}, {value: 0x0008, lo: 0xbf, hi: 0xbf}, // Block 0x1a, offset 0x110 {value: 0x0000, lo: 0x0e}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0018, lo: 0x8a, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x95}, {value: 0x3008, lo: 0x96, hi: 0x97}, {value: 0x3308, lo: 0x98, hi: 0x99}, {value: 0x0008, lo: 0x9a, hi: 0x9d}, {value: 0x3308, lo: 0x9e, hi: 0xa0}, {value: 0x0008, lo: 0xa1, hi: 0xa1}, {value: 0x3008, lo: 0xa2, hi: 0xa4}, {value: 0x0008, lo: 0xa5, hi: 0xa6}, {value: 0x3008, lo: 0xa7, hi: 0xad}, {value: 0x0008, lo: 0xae, hi: 0xb0}, {value: 0x3308, lo: 0xb1, hi: 0xb4}, {value: 0x0008, lo: 0xb5, hi: 0xbf}, // Block 0x1b, offset 0x11f {value: 0x0000, lo: 0x0d}, {value: 0x0008, lo: 0x80, hi: 0x81}, {value: 0x3308, lo: 0x82, hi: 0x82}, {value: 0x3008, lo: 0x83, hi: 0x84}, {value: 0x3308, lo: 0x85, hi: 0x86}, {value: 0x3008, lo: 0x87, hi: 0x8c}, {value: 0x3308, lo: 0x8d, hi: 0x8d}, {value: 0x0008, lo: 0x8e, hi: 0x8e}, {value: 0x3008, lo: 0x8f, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x3008, lo: 0x9a, hi: 0x9c}, {value: 0x3308, lo: 0x9d, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0x1c, offset 0x12d {value: 0x0000, lo: 0x09}, {value: 0x0040, lo: 0x80, hi: 0x86}, {value: 0x055d, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8c}, {value: 0x055d, lo: 0x8d, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xba}, {value: 0x0018, lo: 0xbb, hi: 0xbb}, {value: 0xe105, lo: 0xbc, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbf}, // Block 0x1d, offset 0x137 {value: 0x0000, lo: 0x01}, {value: 0x0018, lo: 0x80, hi: 0xbf}, // Block 0x1e, offset 0x139 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0xa0}, {value: 0x2018, lo: 0xa1, hi: 0xb5}, {value: 0x0018, lo: 0xb6, hi: 0xbf}, // Block 0x1f, offset 0x13e {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0xa7}, {value: 0x2018, lo: 0xa8, hi: 0xbf}, // Block 0x20, offset 0x141 {value: 0x0000, lo: 0x02}, {value: 0x2018, lo: 0x80, hi: 0x82}, {value: 0x0018, lo: 0x83, hi: 0xbf}, // Block 0x21, offset 0x144 {value: 0x0000, lo: 0x01}, {value: 0x0008, lo: 0x80, hi: 0xbf}, // Block 0x22, offset 0x146 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0008, lo: 0x8a, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0x98}, {value: 0x0040, lo: 0x99, hi: 0x99}, {value: 0x0008, lo: 0x9a, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x23, offset 0x152 {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0008, lo: 0x8a, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xb0}, {value: 0x0040, lo: 0xb1, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb7}, {value: 0x0008, lo: 0xb8, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0x24, offset 0x15d {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x0040, lo: 0x81, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0xbf}, // Block 0x25, offset 0x165 {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x91}, {value: 0x0008, lo: 0x92, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0xbf}, // Block 0x26, offset 0x16b {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x9a}, {value: 0x0040, lo: 0x9b, hi: 0x9c}, {value: 0x3308, lo: 0x9d, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbf}, // Block 0x27, offset 0x171 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x28, offset 0x176 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb7}, {value: 0xe045, lo: 0xb8, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbf}, // Block 0x29, offset 0x17b {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0xbf}, // Block 0x2a, offset 0x17e {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xac}, {value: 0x0018, lo: 0xad, hi: 0xae}, {value: 0x0008, lo: 0xaf, hi: 0xbf}, // Block 0x2b, offset 0x182 {value: 0x0000, lo: 0x05}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0x9c}, {value: 0x0040, lo: 0x9d, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x2c, offset 0x188 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xaa}, {value: 0x0018, lo: 0xab, hi: 0xb0}, {value: 0x0008, lo: 0xb1, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbf}, // Block 0x2d, offset 0x18d {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x91}, {value: 0x3308, lo: 0x92, hi: 0x93}, {value: 0x3b08, lo: 0x94, hi: 0x94}, {value: 0x3808, lo: 0x95, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x9e}, {value: 0x0008, lo: 0x9f, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb3}, {value: 0x3808, lo: 0xb4, hi: 0xb4}, {value: 0x0018, lo: 0xb5, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0x2e, offset 0x198 {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x91}, {value: 0x3308, lo: 0x92, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xad}, {value: 0x0008, lo: 0xae, hi: 0xb0}, {value: 0x0040, lo: 0xb1, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xbf}, // Block 0x2f, offset 0x1a2 {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0xb3}, {value: 0x3340, lo: 0xb4, hi: 0xb5}, {value: 0x3008, lo: 0xb6, hi: 0xb6}, {value: 0x3308, lo: 0xb7, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbf}, // Block 0x30, offset 0x1a8 {value: 0x0000, lo: 0x10}, {value: 0x3008, lo: 0x80, hi: 0x85}, {value: 0x3308, lo: 0x86, hi: 0x86}, {value: 0x3008, lo: 0x87, hi: 0x88}, {value: 0x3308, lo: 0x89, hi: 0x91}, {value: 0x3b08, lo: 0x92, hi: 0x92}, {value: 0x3308, lo: 0x93, hi: 0x93}, {value: 0x0018, lo: 0x94, hi: 0x96}, {value: 0x0008, lo: 0x97, hi: 0x97}, {value: 0x0018, lo: 0x98, hi: 0x9b}, {value: 0x0008, lo: 0x9c, hi: 0x9c}, {value: 0x3308, lo: 0x9d, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa9}, {value: 0x0040, lo: 0xaa, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0x31, offset 0x1b9 {value: 0x0000, lo: 0x0a}, {value: 0x0018, lo: 0x80, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x86}, {value: 0x0218, lo: 0x87, hi: 0x87}, {value: 0x0018, lo: 0x88, hi: 0x8a}, {value: 0x33c0, lo: 0x8b, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8e}, {value: 0x33c0, lo: 0x8f, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0208, lo: 0xa0, hi: 0xbf}, // Block 0x32, offset 0x1c4 {value: 0x0000, lo: 0x02}, {value: 0x0208, lo: 0x80, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbf}, // Block 0x33, offset 0x1c7 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0x84}, {value: 0x3308, lo: 0x85, hi: 0x86}, {value: 0x0208, lo: 0x87, hi: 0xa8}, {value: 0x3308, lo: 0xa9, hi: 0xa9}, {value: 0x0208, lo: 0xaa, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x34, offset 0x1cf {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xbf}, // Block 0x35, offset 0x1d2 {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x3308, lo: 0xa0, hi: 0xa2}, {value: 0x3008, lo: 0xa3, hi: 0xa6}, {value: 0x3308, lo: 0xa7, hi: 0xa8}, {value: 0x3008, lo: 0xa9, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x3008, lo: 0xb0, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb2}, {value: 0x3008, lo: 0xb3, hi: 0xb8}, {value: 0x3308, lo: 0xb9, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0x36, offset 0x1df {value: 0x0000, lo: 0x07}, {value: 0x0018, lo: 0x80, hi: 0x80}, {value: 0x0040, lo: 0x81, hi: 0x83}, {value: 0x0018, lo: 0x84, hi: 0x85}, {value: 0x0008, lo: 0x86, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0x37, offset 0x1e7 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x38, offset 0x1eb {value: 0x0000, lo: 0x06}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0028, lo: 0x9a, hi: 0x9a}, {value: 0x0040, lo: 0x9b, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0xbf}, // Block 0x39, offset 0x1f2 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0x96}, {value: 0x3308, lo: 0x97, hi: 0x98}, {value: 0x3008, lo: 0x99, hi: 0x9a}, {value: 0x3308, lo: 0x9b, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x3a, offset 0x1fa {value: 0x0000, lo: 0x0f}, {value: 0x0008, lo: 0x80, hi: 0x94}, {value: 0x3008, lo: 0x95, hi: 0x95}, {value: 0x3308, lo: 0x96, hi: 0x96}, {value: 0x3008, lo: 0x97, hi: 0x97}, {value: 0x3308, lo: 0x98, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x3b08, lo: 0xa0, hi: 0xa0}, {value: 0x3008, lo: 0xa1, hi: 0xa1}, {value: 0x3308, lo: 0xa2, hi: 0xa2}, {value: 0x3008, lo: 0xa3, hi: 0xa4}, {value: 0x3308, lo: 0xa5, hi: 0xac}, {value: 0x3008, lo: 0xad, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbe}, {value: 0x3308, lo: 0xbf, hi: 0xbf}, // Block 0x3b, offset 0x20a {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa6}, {value: 0x0008, lo: 0xa7, hi: 0xa7}, {value: 0x0018, lo: 0xa8, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xbd}, {value: 0x3318, lo: 0xbe, hi: 0xbe}, {value: 0x3308, lo: 0xbf, hi: 0xbf}, // Block 0x3c, offset 0x216 {value: 0x0000, lo: 0x02}, {value: 0x3308, lo: 0x80, hi: 0x8e}, {value: 0x0040, lo: 0x8f, hi: 0xbf}, // Block 0x3d, offset 0x219 {value: 0x0000, lo: 0x09}, {value: 0x3308, lo: 0x80, hi: 0x83}, {value: 0x3008, lo: 0x84, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0xb3}, {value: 0x3308, lo: 0xb4, hi: 0xb4}, {value: 0x3008, lo: 0xb5, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbc}, {value: 0x3008, lo: 0xbd, hi: 0xbf}, // Block 0x3e, offset 0x223 {value: 0x0000, lo: 0x0b}, {value: 0x3008, lo: 0x80, hi: 0x81}, {value: 0x3308, lo: 0x82, hi: 0x82}, {value: 0x3008, lo: 0x83, hi: 0x83}, {value: 0x3808, lo: 0x84, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0xaa}, {value: 0x3308, lo: 0xab, hi: 0xb3}, {value: 0x0018, lo: 0xb4, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0x3f, offset 0x22f {value: 0x0000, lo: 0x0b}, {value: 0x3308, lo: 0x80, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0xa0}, {value: 0x3008, lo: 0xa1, hi: 0xa1}, {value: 0x3308, lo: 0xa2, hi: 0xa5}, {value: 0x3008, lo: 0xa6, hi: 0xa7}, {value: 0x3308, lo: 0xa8, hi: 0xa9}, {value: 0x3808, lo: 0xaa, hi: 0xaa}, {value: 0x3b08, lo: 0xab, hi: 0xab}, {value: 0x3308, lo: 0xac, hi: 0xad}, {value: 0x0008, lo: 0xae, hi: 0xbf}, // Block 0x40, offset 0x23b {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0xa5}, {value: 0x3308, lo: 0xa6, hi: 0xa6}, {value: 0x3008, lo: 0xa7, hi: 0xa7}, {value: 0x3308, lo: 0xa8, hi: 0xa9}, {value: 0x3008, lo: 0xaa, hi: 0xac}, {value: 0x3308, lo: 0xad, hi: 0xad}, {value: 0x3008, lo: 0xae, hi: 0xae}, {value: 0x3308, lo: 0xaf, hi: 0xb1}, {value: 0x3808, lo: 0xb2, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xbb}, {value: 0x0018, lo: 0xbc, hi: 0xbf}, // Block 0x41, offset 0x247 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0xa3}, {value: 0x3008, lo: 0xa4, hi: 0xab}, {value: 0x3308, lo: 0xac, hi: 0xb3}, {value: 0x3008, lo: 0xb4, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xba}, {value: 0x0018, lo: 0xbb, hi: 0xbf}, // Block 0x42, offset 0x24f {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0x8c}, {value: 0x0008, lo: 0x8d, hi: 0xbd}, {value: 0x0018, lo: 0xbe, hi: 0xbf}, // Block 0x43, offset 0x254 {value: 0x0000, lo: 0x0c}, {value: 0x02a9, lo: 0x80, hi: 0x80}, {value: 0x02b1, lo: 0x81, hi: 0x81}, {value: 0x02b9, lo: 0x82, hi: 0x82}, {value: 0x02c1, lo: 0x83, hi: 0x83}, {value: 0x02c9, lo: 0x84, hi: 0x85}, {value: 0x02d1, lo: 0x86, hi: 0x86}, {value: 0x02d9, lo: 0x87, hi: 0x87}, {value: 0x057d, lo: 0x88, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x8f}, {value: 0x059d, lo: 0x90, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbc}, {value: 0x059d, lo: 0xbd, hi: 0xbf}, // Block 0x44, offset 0x261 {value: 0x0000, lo: 0x10}, {value: 0x0018, lo: 0x80, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x3308, lo: 0x90, hi: 0x92}, {value: 0x0018, lo: 0x93, hi: 0x93}, {value: 0x3308, lo: 0x94, hi: 0xa0}, {value: 0x3008, lo: 0xa1, hi: 0xa1}, {value: 0x3308, lo: 0xa2, hi: 0xa8}, {value: 0x0008, lo: 0xa9, hi: 0xac}, {value: 0x3308, lo: 0xad, hi: 0xad}, {value: 0x0008, lo: 0xae, hi: 0xb3}, {value: 0x3308, lo: 0xb4, hi: 0xb4}, {value: 0x0008, lo: 0xb5, hi: 0xb6}, {value: 0x3008, lo: 0xb7, hi: 0xb7}, {value: 0x3308, lo: 0xb8, hi: 0xb9}, {value: 0x0008, lo: 0xba, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbf}, // Block 0x45, offset 0x272 {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x87}, {value: 0xe045, lo: 0x88, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x97}, {value: 0xe045, lo: 0x98, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa7}, {value: 0xe045, lo: 0xa8, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb7}, {value: 0xe045, lo: 0xb8, hi: 0xbf}, // Block 0x46, offset 0x27d {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x80}, {value: 0x0040, lo: 0x81, hi: 0x8f}, {value: 0x3318, lo: 0x90, hi: 0xb0}, {value: 0x0040, lo: 0xb1, hi: 0xbf}, // Block 0x47, offset 0x282 {value: 0x0000, lo: 0x08}, {value: 0x0018, lo: 0x80, hi: 0x82}, {value: 0x0040, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0x84}, {value: 0x0018, lo: 0x85, hi: 0x88}, {value: 0x0851, lo: 0x89, hi: 0x89}, {value: 0x0018, lo: 0x8a, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xbf}, // Block 0x48, offset 0x28b {value: 0x0000, lo: 0x07}, {value: 0x0018, lo: 0x80, hi: 0xab}, {value: 0x0859, lo: 0xac, hi: 0xac}, {value: 0x0861, lo: 0xad, hi: 0xad}, {value: 0x0018, lo: 0xae, hi: 0xae}, {value: 0x0869, lo: 0xaf, hi: 0xaf}, {value: 0x0871, lo: 0xb0, hi: 0xb0}, {value: 0x0018, lo: 0xb1, hi: 0xbf}, // Block 0x49, offset 0x293 {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x9f}, {value: 0x0080, lo: 0xa0, hi: 0xa0}, {value: 0x0018, lo: 0xa1, hi: 0xad}, {value: 0x0080, lo: 0xae, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xbf}, // Block 0x4a, offset 0x299 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0xa8}, {value: 0x09dd, lo: 0xa9, hi: 0xa9}, {value: 0x09fd, lo: 0xaa, hi: 0xaa}, {value: 0x0018, lo: 0xab, hi: 0xbf}, // Block 0x4b, offset 0x29e {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xbf}, // Block 0x4c, offset 0x2a1 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0x8b}, {value: 0x0929, lo: 0x8c, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0xbf}, // Block 0x4d, offset 0x2a5 {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0xb3}, {value: 0x0e7e, lo: 0xb4, hi: 0xb4}, {value: 0x0932, lo: 0xb5, hi: 0xb5}, {value: 0x0e9e, lo: 0xb6, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xbf}, // Block 0x4e, offset 0x2ab {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0x9b}, {value: 0x0939, lo: 0x9c, hi: 0x9c}, {value: 0x0018, lo: 0x9d, hi: 0xbf}, // Block 0x4f, offset 0x2af {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xb5}, {value: 0x0018, lo: 0xb6, hi: 0xbf}, // Block 0x50, offset 0x2b3 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x96}, {value: 0x0018, lo: 0x97, hi: 0xbf}, // Block 0x51, offset 0x2b7 {value: 0x0000, lo: 0x04}, {value: 0xe185, lo: 0x80, hi: 0x8f}, {value: 0x03f5, lo: 0x90, hi: 0x9f}, {value: 0x0ebd, lo: 0xa0, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x52, offset 0x2bc {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0xa5}, {value: 0x0040, lo: 0xa6, hi: 0xa6}, {value: 0x0008, lo: 0xa7, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xac}, {value: 0x0008, lo: 0xad, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x53, offset 0x2c4 {value: 0x0000, lo: 0x06}, {value: 0x0008, lo: 0x80, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xae}, {value: 0xe075, lo: 0xaf, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb0}, {value: 0x0040, lo: 0xb1, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0x54, offset 0x2cb {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xa7}, {value: 0x0008, lo: 0xa8, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xb7}, {value: 0x0008, lo: 0xb8, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0x55, offset 0x2d6 {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x8e}, {value: 0x0040, lo: 0x8f, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x3308, lo: 0xa0, hi: 0xbf}, // Block 0x56, offset 0x2e0 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xae}, {value: 0x0008, lo: 0xaf, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xbf}, // Block 0x57, offset 0x2e4 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0xbf}, // Block 0x58, offset 0x2e7 {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0x9e}, {value: 0x0ef5, lo: 0x9f, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xbf}, // Block 0x59, offset 0x2ed {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xb2}, {value: 0x0f15, lo: 0xb3, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xbf}, // Block 0x5a, offset 0x2f1 {value: 0x0020, lo: 0x01}, {value: 0x0f35, lo: 0x80, hi: 0xbf}, // Block 0x5b, offset 0x2f3 {value: 0x0020, lo: 0x02}, {value: 0x1735, lo: 0x80, hi: 0x8f}, {value: 0x1915, lo: 0x90, hi: 0xbf}, // Block 0x5c, offset 0x2f6 {value: 0x0020, lo: 0x01}, {value: 0x1f15, lo: 0x80, hi: 0xbf}, // Block 0x5d, offset 0x2f8 {value: 0x0000, lo: 0x02}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0xbf}, // Block 0x5e, offset 0x2fb {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x98}, {value: 0x3308, lo: 0x99, hi: 0x9a}, {value: 0x096a, lo: 0x9b, hi: 0x9b}, {value: 0x0972, lo: 0x9c, hi: 0x9c}, {value: 0x0008, lo: 0x9d, hi: 0x9e}, {value: 0x0979, lo: 0x9f, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa0}, {value: 0x0008, lo: 0xa1, hi: 0xbf}, // Block 0x5f, offset 0x305 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xbe}, {value: 0x0981, lo: 0xbf, hi: 0xbf}, // Block 0x60, offset 0x308 {value: 0x0000, lo: 0x0e}, {value: 0x0040, lo: 0x80, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xb0}, {value: 0x2a35, lo: 0xb1, hi: 0xb1}, {value: 0x2a55, lo: 0xb2, hi: 0xb2}, {value: 0x2a75, lo: 0xb3, hi: 0xb3}, {value: 0x2a95, lo: 0xb4, hi: 0xb4}, {value: 0x2a75, lo: 0xb5, hi: 0xb5}, {value: 0x2ab5, lo: 0xb6, hi: 0xb6}, {value: 0x2ad5, lo: 0xb7, hi: 0xb7}, {value: 0x2af5, lo: 0xb8, hi: 0xb9}, {value: 0x2b15, lo: 0xba, hi: 0xbb}, {value: 0x2b35, lo: 0xbc, hi: 0xbd}, {value: 0x2b15, lo: 0xbe, hi: 0xbf}, // Block 0x61, offset 0x317 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xa3}, {value: 0x0040, lo: 0xa4, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x62, offset 0x31b {value: 0x0008, lo: 0x03}, {value: 0x098a, lo: 0x80, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x0a82, lo: 0xa0, hi: 0xbf}, // Block 0x63, offset 0x31f {value: 0x0008, lo: 0x01}, {value: 0x0d19, lo: 0x80, hi: 0xbf}, // Block 0x64, offset 0x321 {value: 0x0008, lo: 0x08}, {value: 0x0f19, lo: 0x80, hi: 0xb0}, {value: 0x4045, lo: 0xb1, hi: 0xb1}, {value: 0x10a1, lo: 0xb2, hi: 0xb3}, {value: 0x4065, lo: 0xb4, hi: 0xb4}, {value: 0x10b1, lo: 0xb5, hi: 0xb7}, {value: 0x4085, lo: 0xb8, hi: 0xb8}, {value: 0x4085, lo: 0xb9, hi: 0xb9}, {value: 0x10c9, lo: 0xba, hi: 0xbf}, // Block 0x65, offset 0x32a {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xbf}, // Block 0x66, offset 0x32e {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xbd}, {value: 0x0018, lo: 0xbe, hi: 0xbf}, // Block 0x67, offset 0x333 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xbf}, // Block 0x68, offset 0x338 {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0xa5}, {value: 0x0018, lo: 0xa6, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb1}, {value: 0x0018, lo: 0xb2, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbf}, // Block 0x69, offset 0x33e {value: 0x0000, lo: 0x0f}, {value: 0x0008, lo: 0x80, hi: 0x81}, {value: 0x3308, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0x85}, {value: 0x3b08, lo: 0x86, hi: 0x86}, {value: 0x0008, lo: 0x87, hi: 0x8a}, {value: 0x3308, lo: 0x8b, hi: 0x8b}, {value: 0x0008, lo: 0x8c, hi: 0xa2}, {value: 0x3008, lo: 0xa3, hi: 0xa4}, {value: 0x3308, lo: 0xa5, hi: 0xa6}, {value: 0x3008, lo: 0xa7, hi: 0xa7}, {value: 0x0018, lo: 0xa8, hi: 0xab}, {value: 0x3b08, lo: 0xac, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0x6a, offset 0x34e {value: 0x0000, lo: 0x05}, {value: 0x0208, lo: 0x80, hi: 0xb1}, {value: 0x0108, lo: 0xb2, hi: 0xb2}, {value: 0x0008, lo: 0xb3, hi: 0xb3}, {value: 0x0018, lo: 0xb4, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbf}, // Block 0x6b, offset 0x354 {value: 0x0000, lo: 0x03}, {value: 0x3008, lo: 0x80, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0xb3}, {value: 0x3008, lo: 0xb4, hi: 0xbf}, // Block 0x6c, offset 0x358 {value: 0x0000, lo: 0x0e}, {value: 0x3008, lo: 0x80, hi: 0x83}, {value: 0x3b08, lo: 0x84, hi: 0x84}, {value: 0x3308, lo: 0x85, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x8d}, {value: 0x0018, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x3308, lo: 0xa0, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xb7}, {value: 0x0018, lo: 0xb8, hi: 0xba}, {value: 0x0008, lo: 0xbb, hi: 0xbb}, {value: 0x0018, lo: 0xbc, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbe}, {value: 0x3308, lo: 0xbf, hi: 0xbf}, // Block 0x6d, offset 0x367 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xa5}, {value: 0x3308, lo: 0xa6, hi: 0xad}, {value: 0x0018, lo: 0xae, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x6e, offset 0x36c {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x3308, lo: 0x87, hi: 0x91}, {value: 0x3008, lo: 0x92, hi: 0x92}, {value: 0x3808, lo: 0x93, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x9e}, {value: 0x0018, lo: 0x9f, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbf}, // Block 0x6f, offset 0x374 {value: 0x0000, lo: 0x09}, {value: 0x3308, lo: 0x80, hi: 0x82}, {value: 0x3008, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb3}, {value: 0x3008, lo: 0xb4, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xb9}, {value: 0x3008, lo: 0xba, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbf}, // Block 0x70, offset 0x37e {value: 0x0000, lo: 0x0a}, {value: 0x3808, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8e}, {value: 0x0008, lo: 0x8f, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa4}, {value: 0x3308, lo: 0xa5, hi: 0xa5}, {value: 0x0008, lo: 0xa6, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0x71, offset 0x389 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0xa8}, {value: 0x3308, lo: 0xa9, hi: 0xae}, {value: 0x3008, lo: 0xaf, hi: 0xb0}, {value: 0x3308, lo: 0xb1, hi: 0xb2}, {value: 0x3008, lo: 0xb3, hi: 0xb4}, {value: 0x3308, lo: 0xb5, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0x72, offset 0x391 {value: 0x0000, lo: 0x10}, {value: 0x0008, lo: 0x80, hi: 0x82}, {value: 0x3308, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0x8b}, {value: 0x3308, lo: 0x8c, hi: 0x8c}, {value: 0x3008, lo: 0x8d, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9b}, {value: 0x0018, lo: 0x9c, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xb9}, {value: 0x0008, lo: 0xba, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbc}, {value: 0x3008, lo: 0xbd, hi: 0xbd}, {value: 0x0008, lo: 0xbe, hi: 0xbf}, // Block 0x73, offset 0x3a2 {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb0}, {value: 0x0008, lo: 0xb1, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb4}, {value: 0x0008, lo: 0xb5, hi: 0xb6}, {value: 0x3308, lo: 0xb7, hi: 0xb8}, {value: 0x0008, lo: 0xb9, hi: 0xbd}, {value: 0x3308, lo: 0xbe, hi: 0xbf}, // Block 0x74, offset 0x3ab {value: 0x0000, lo: 0x0f}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0x82}, {value: 0x0040, lo: 0x83, hi: 0x9a}, {value: 0x0008, lo: 0x9b, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xaa}, {value: 0x3008, lo: 0xab, hi: 0xab}, {value: 0x3308, lo: 0xac, hi: 0xad}, {value: 0x3008, lo: 0xae, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xb4}, {value: 0x3008, lo: 0xb5, hi: 0xb5}, {value: 0x3b08, lo: 0xb6, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0x75, offset 0x3bb {value: 0x0000, lo: 0x0c}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x88}, {value: 0x0008, lo: 0x89, hi: 0x8e}, {value: 0x0040, lo: 0x8f, hi: 0x90}, {value: 0x0008, lo: 0x91, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xa7}, {value: 0x0008, lo: 0xa8, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x76, offset 0x3c8 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0x9b}, {value: 0x449d, lo: 0x9c, hi: 0x9c}, {value: 0x44b5, lo: 0x9d, hi: 0x9d}, {value: 0x0941, lo: 0x9e, hi: 0x9e}, {value: 0xe06d, lo: 0x9f, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa8}, {value: 0x13f9, lo: 0xa9, hi: 0xa9}, {value: 0x0018, lo: 0xaa, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x44cd, lo: 0xb0, hi: 0xbf}, // Block 0x77, offset 0x3d4 {value: 0x0000, lo: 0x04}, {value: 0x44ed, lo: 0x80, hi: 0x8f}, {value: 0x450d, lo: 0x90, hi: 0x9f}, {value: 0x452d, lo: 0xa0, hi: 0xaf}, {value: 0x450d, lo: 0xb0, hi: 0xbf}, // Block 0x78, offset 0x3d9 {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0xa2}, {value: 0x3008, lo: 0xa3, hi: 0xa4}, {value: 0x3308, lo: 0xa5, hi: 0xa5}, {value: 0x3008, lo: 0xa6, hi: 0xa7}, {value: 0x3308, lo: 0xa8, hi: 0xa8}, {value: 0x3008, lo: 0xa9, hi: 0xaa}, {value: 0x0018, lo: 0xab, hi: 0xab}, {value: 0x3008, lo: 0xac, hi: 0xac}, {value: 0x3b08, lo: 0xad, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0x79, offset 0x3e6 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xa3}, {value: 0x0040, lo: 0xa4, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xbf}, // Block 0x7a, offset 0x3ea {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x8a}, {value: 0x0018, lo: 0x8b, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0x7b, offset 0x3ef {value: 0x0000, lo: 0x01}, {value: 0x0040, lo: 0x80, hi: 0xbf}, // Block 0x7c, offset 0x3f1 {value: 0x0020, lo: 0x01}, {value: 0x454d, lo: 0x80, hi: 0xbf}, // Block 0x7d, offset 0x3f3 {value: 0x0020, lo: 0x03}, {value: 0x4d4d, lo: 0x80, hi: 0x94}, {value: 0x4b0d, lo: 0x95, hi: 0x95}, {value: 0x4fed, lo: 0x96, hi: 0xbf}, // Block 0x7e, offset 0x3f7 {value: 0x0020, lo: 0x01}, {value: 0x552d, lo: 0x80, hi: 0xbf}, // Block 0x7f, offset 0x3f9 {value: 0x0020, lo: 0x03}, {value: 0x5d2d, lo: 0x80, hi: 0x84}, {value: 0x568d, lo: 0x85, hi: 0x85}, {value: 0x5dcd, lo: 0x86, hi: 0xbf}, // Block 0x80, offset 0x3fd {value: 0x0020, lo: 0x08}, {value: 0x6b8d, lo: 0x80, hi: 0x8f}, {value: 0x6d4d, lo: 0x90, hi: 0x90}, {value: 0x6d8d, lo: 0x91, hi: 0xab}, {value: 0x1401, lo: 0xac, hi: 0xac}, {value: 0x70ed, lo: 0xad, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x710d, lo: 0xb0, hi: 0xbf}, // Block 0x81, offset 0x406 {value: 0x0020, lo: 0x05}, {value: 0x730d, lo: 0x80, hi: 0xad}, {value: 0x656d, lo: 0xae, hi: 0xae}, {value: 0x78cd, lo: 0xaf, hi: 0xb5}, {value: 0x6f8d, lo: 0xb6, hi: 0xb6}, {value: 0x79ad, lo: 0xb7, hi: 0xbf}, // Block 0x82, offset 0x40c {value: 0x0008, lo: 0x03}, {value: 0x1751, lo: 0x80, hi: 0x82}, {value: 0x1741, lo: 0x83, hi: 0x83}, {value: 0x1769, lo: 0x84, hi: 0xbf}, // Block 0x83, offset 0x410 {value: 0x0008, lo: 0x0f}, {value: 0x1d81, lo: 0x80, hi: 0x83}, {value: 0x1d99, lo: 0x84, hi: 0x85}, {value: 0x1da1, lo: 0x86, hi: 0x87}, {value: 0x1da9, lo: 0x88, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x91}, {value: 0x1de9, lo: 0x92, hi: 0x97}, {value: 0x1e11, lo: 0x98, hi: 0x9c}, {value: 0x1e31, lo: 0x9d, hi: 0xb3}, {value: 0x1d71, lo: 0xb4, hi: 0xb4}, {value: 0x1d81, lo: 0xb5, hi: 0xb5}, {value: 0x1ee9, lo: 0xb6, hi: 0xbb}, {value: 0x1f09, lo: 0xbc, hi: 0xbc}, {value: 0x1ef9, lo: 0xbd, hi: 0xbd}, {value: 0x1f19, lo: 0xbe, hi: 0xbf}, // Block 0x84, offset 0x420 {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8c}, {value: 0x0008, lo: 0x8d, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xa7}, {value: 0x0008, lo: 0xa8, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbb}, {value: 0x0008, lo: 0xbc, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbe}, {value: 0x0008, lo: 0xbf, hi: 0xbf}, // Block 0x85, offset 0x42a {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0xbf}, // Block 0x86, offset 0x42f {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbf}, // Block 0x87, offset 0x432 {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x82}, {value: 0x0040, lo: 0x83, hi: 0x86}, {value: 0x0018, lo: 0x87, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xbf}, // Block 0x88, offset 0x438 {value: 0x0000, lo: 0x06}, {value: 0x0018, lo: 0x80, hi: 0x8e}, {value: 0x0040, lo: 0x8f, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0x9c}, {value: 0x0040, lo: 0x9d, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa0}, {value: 0x0040, lo: 0xa1, hi: 0xbf}, // Block 0x89, offset 0x43f {value: 0x0000, lo: 0x04}, {value: 0x0040, lo: 0x80, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xbc}, {value: 0x3308, lo: 0xbd, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbf}, // Block 0x8a, offset 0x444 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0x9c}, {value: 0x0040, lo: 0x9d, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x8b, offset 0x448 {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x9f}, {value: 0x3308, lo: 0xa0, hi: 0xa0}, {value: 0x0018, lo: 0xa1, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0x8c, offset 0x44e {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa3}, {value: 0x0040, lo: 0xa4, hi: 0xac}, {value: 0x0008, lo: 0xad, hi: 0xbf}, // Block 0x8d, offset 0x453 {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0x89}, {value: 0x0018, lo: 0x8a, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbf}, // Block 0x8e, offset 0x45c {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9e}, {value: 0x0018, lo: 0x9f, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x8f, offset 0x461 {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0xbf}, // Block 0x90, offset 0x467 {value: 0x0000, lo: 0x06}, {value: 0xe145, lo: 0x80, hi: 0x87}, {value: 0xe1c5, lo: 0x88, hi: 0x8f}, {value: 0xe145, lo: 0x90, hi: 0x97}, {value: 0x8b0d, lo: 0x98, hi: 0x9f}, {value: 0x8b25, lo: 0xa0, hi: 0xa7}, {value: 0x0008, lo: 0xa8, hi: 0xbf}, // Block 0x91, offset 0x46e {value: 0x0000, lo: 0x06}, {value: 0x0008, lo: 0x80, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa9}, {value: 0x0040, lo: 0xaa, hi: 0xaf}, {value: 0x8b25, lo: 0xb0, hi: 0xb7}, {value: 0x8b0d, lo: 0xb8, hi: 0xbf}, // Block 0x92, offset 0x475 {value: 0x0000, lo: 0x06}, {value: 0xe145, lo: 0x80, hi: 0x87}, {value: 0xe1c5, lo: 0x88, hi: 0x8f}, {value: 0xe145, lo: 0x90, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0x93, offset 0x47c {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x94, offset 0x480 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0x95, offset 0x483 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xbf}, // Block 0x96, offset 0x488 {value: 0x0000, lo: 0x0b}, {value: 0x0808, lo: 0x80, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x87}, {value: 0x0808, lo: 0x88, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0808, lo: 0x8a, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb6}, {value: 0x0808, lo: 0xb7, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbb}, {value: 0x0808, lo: 0xbc, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbe}, {value: 0x0808, lo: 0xbf, hi: 0xbf}, // Block 0x97, offset 0x494 {value: 0x0000, lo: 0x05}, {value: 0x0808, lo: 0x80, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x96}, {value: 0x0818, lo: 0x97, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xb6}, {value: 0x0818, lo: 0xb7, hi: 0xbf}, // Block 0x98, offset 0x49a {value: 0x0000, lo: 0x04}, {value: 0x0808, lo: 0x80, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0xa6}, {value: 0x0818, lo: 0xa7, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, // Block 0x99, offset 0x49f {value: 0x0000, lo: 0x06}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xb3}, {value: 0x0808, lo: 0xb4, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xba}, {value: 0x0818, lo: 0xbb, hi: 0xbf}, // Block 0x9a, offset 0x4a6 {value: 0x0000, lo: 0x07}, {value: 0x0808, lo: 0x80, hi: 0x95}, {value: 0x0818, lo: 0x96, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0x9e}, {value: 0x0018, lo: 0x9f, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbe}, {value: 0x0818, lo: 0xbf, hi: 0xbf}, // Block 0x9b, offset 0x4ae {value: 0x0000, lo: 0x04}, {value: 0x0808, lo: 0x80, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbb}, {value: 0x0818, lo: 0xbc, hi: 0xbd}, {value: 0x0808, lo: 0xbe, hi: 0xbf}, // Block 0x9c, offset 0x4b3 {value: 0x0000, lo: 0x03}, {value: 0x0818, lo: 0x80, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0x91}, {value: 0x0818, lo: 0x92, hi: 0xbf}, // Block 0x9d, offset 0x4b7 {value: 0x0000, lo: 0x0f}, {value: 0x0808, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x84}, {value: 0x3308, lo: 0x85, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x8b}, {value: 0x3308, lo: 0x8c, hi: 0x8f}, {value: 0x0808, lo: 0x90, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x94}, {value: 0x0808, lo: 0x95, hi: 0x97}, {value: 0x0040, lo: 0x98, hi: 0x98}, {value: 0x0808, lo: 0x99, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb7}, {value: 0x3308, lo: 0xb8, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0x9e, offset 0x4c7 {value: 0x0000, lo: 0x06}, {value: 0x0818, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x8f}, {value: 0x0818, lo: 0x90, hi: 0x98}, {value: 0x0040, lo: 0x99, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xbc}, {value: 0x0818, lo: 0xbd, hi: 0xbf}, // Block 0x9f, offset 0x4ce {value: 0x0000, lo: 0x03}, {value: 0x0808, lo: 0x80, hi: 0x9c}, {value: 0x0818, lo: 0x9d, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0xa0, offset 0x4d2 {value: 0x0000, lo: 0x03}, {value: 0x0808, lo: 0x80, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb8}, {value: 0x0018, lo: 0xb9, hi: 0xbf}, // Block 0xa1, offset 0x4d6 {value: 0x0000, lo: 0x06}, {value: 0x0808, lo: 0x80, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x97}, {value: 0x0818, lo: 0x98, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xb7}, {value: 0x0818, lo: 0xb8, hi: 0xbf}, // Block 0xa2, offset 0x4dd {value: 0x0000, lo: 0x01}, {value: 0x0808, lo: 0x80, hi: 0xbf}, // Block 0xa3, offset 0x4df {value: 0x0000, lo: 0x02}, {value: 0x0808, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0xbf}, // Block 0xa4, offset 0x4e2 {value: 0x0000, lo: 0x02}, {value: 0x03dd, lo: 0x80, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xbf}, // Block 0xa5, offset 0x4e5 {value: 0x0000, lo: 0x03}, {value: 0x0808, lo: 0x80, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xb9}, {value: 0x0818, lo: 0xba, hi: 0xbf}, // Block 0xa6, offset 0x4e9 {value: 0x0000, lo: 0x08}, {value: 0x0908, lo: 0x80, hi: 0x80}, {value: 0x0a08, lo: 0x81, hi: 0xa1}, {value: 0x0c08, lo: 0xa2, hi: 0xa2}, {value: 0x0a08, lo: 0xa3, hi: 0xa3}, {value: 0x3308, lo: 0xa4, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xaf}, {value: 0x0808, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0xa7, offset 0x4f2 {value: 0x0000, lo: 0x03}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0818, lo: 0xa0, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0xa8, offset 0x4f6 {value: 0x0000, lo: 0x07}, {value: 0x0808, lo: 0x80, hi: 0xa9}, {value: 0x0040, lo: 0xaa, hi: 0xaa}, {value: 0x3308, lo: 0xab, hi: 0xac}, {value: 0x0818, lo: 0xad, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x0808, lo: 0xb0, hi: 0xb1}, {value: 0x0040, lo: 0xb2, hi: 0xbf}, // Block 0xa9, offset 0x4fe {value: 0x0000, lo: 0x02}, {value: 0x0040, lo: 0x80, hi: 0xbc}, {value: 0x3308, lo: 0xbd, hi: 0xbf}, // Block 0xaa, offset 0x501 {value: 0x0000, lo: 0x07}, {value: 0x0808, lo: 0x80, hi: 0x9c}, {value: 0x0818, lo: 0x9d, hi: 0xa6}, {value: 0x0808, lo: 0xa7, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xaf}, {value: 0x0a08, lo: 0xb0, hi: 0xb2}, {value: 0x0c08, lo: 0xb3, hi: 0xb3}, {value: 0x0a08, lo: 0xb4, hi: 0xbf}, // Block 0xab, offset 0x509 {value: 0x0000, lo: 0x0a}, {value: 0x0a08, lo: 0x80, hi: 0x84}, {value: 0x0808, lo: 0x85, hi: 0x85}, {value: 0x3308, lo: 0x86, hi: 0x90}, {value: 0x0a18, lo: 0x91, hi: 0x93}, {value: 0x0c18, lo: 0x94, hi: 0x94}, {value: 0x0818, lo: 0x95, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0xaf}, {value: 0x0a08, lo: 0xb0, hi: 0xb3}, {value: 0x0c08, lo: 0xb4, hi: 0xb5}, {value: 0x0a08, lo: 0xb6, hi: 0xbf}, // Block 0xac, offset 0x514 {value: 0x0000, lo: 0x0e}, {value: 0x0a08, lo: 0x80, hi: 0x81}, {value: 0x3308, lo: 0x82, hi: 0x85}, {value: 0x0818, lo: 0x86, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0xaf}, {value: 0x0a08, lo: 0xb0, hi: 0xb0}, {value: 0x0808, lo: 0xb1, hi: 0xb1}, {value: 0x0a08, lo: 0xb2, hi: 0xb3}, {value: 0x0c08, lo: 0xb4, hi: 0xb6}, {value: 0x0808, lo: 0xb7, hi: 0xb7}, {value: 0x0a08, lo: 0xb8, hi: 0xb8}, {value: 0x0c08, lo: 0xb9, hi: 0xba}, {value: 0x0a08, lo: 0xbb, hi: 0xbc}, {value: 0x0c08, lo: 0xbd, hi: 0xbd}, {value: 0x0a08, lo: 0xbe, hi: 0xbf}, // Block 0xad, offset 0x523 {value: 0x0000, lo: 0x0b}, {value: 0x0808, lo: 0x80, hi: 0x80}, {value: 0x0a08, lo: 0x81, hi: 0x81}, {value: 0x0c08, lo: 0x82, hi: 0x83}, {value: 0x0a08, lo: 0x84, hi: 0x84}, {value: 0x0818, lo: 0x85, hi: 0x88}, {value: 0x0c18, lo: 0x89, hi: 0x89}, {value: 0x0a18, lo: 0x8a, hi: 0x8a}, {value: 0x0918, lo: 0x8b, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0xae, offset 0x52f {value: 0x0000, lo: 0x05}, {value: 0x3008, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0xb7}, {value: 0x3308, lo: 0xb8, hi: 0xbf}, // Block 0xaf, offset 0x535 {value: 0x0000, lo: 0x0c}, {value: 0x3308, lo: 0x80, hi: 0x85}, {value: 0x3b08, lo: 0x86, hi: 0x86}, {value: 0x0018, lo: 0x87, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x91}, {value: 0x0018, lo: 0x92, hi: 0xa5}, {value: 0x0008, lo: 0xa6, hi: 0xaf}, {value: 0x3b08, lo: 0xb0, hi: 0xb0}, {value: 0x0008, lo: 0xb1, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb4}, {value: 0x0008, lo: 0xb5, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0xb0, offset 0x542 {value: 0x0000, lo: 0x0b}, {value: 0x3308, lo: 0x80, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0xaf}, {value: 0x3008, lo: 0xb0, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb6}, {value: 0x3008, lo: 0xb7, hi: 0xb8}, {value: 0x3b08, lo: 0xb9, hi: 0xb9}, {value: 0x3308, lo: 0xba, hi: 0xba}, {value: 0x0018, lo: 0xbb, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbd}, {value: 0x0018, lo: 0xbe, hi: 0xbf}, // Block 0xb1, offset 0x54e {value: 0x0000, lo: 0x07}, {value: 0x0018, lo: 0x80, hi: 0x81}, {value: 0x3308, lo: 0x82, hi: 0x82}, {value: 0x0040, lo: 0x83, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xa8}, {value: 0x0040, lo: 0xa9, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0xb2, offset 0x556 {value: 0x0000, lo: 0x08}, {value: 0x3308, lo: 0x80, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0xa6}, {value: 0x3308, lo: 0xa7, hi: 0xab}, {value: 0x3008, lo: 0xac, hi: 0xac}, {value: 0x3308, lo: 0xad, hi: 0xb2}, {value: 0x3b08, lo: 0xb3, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xb5}, {value: 0x0008, lo: 0xb6, hi: 0xbf}, // Block 0xb3, offset 0x55f {value: 0x0000, lo: 0x0a}, {value: 0x0018, lo: 0x80, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0x84}, {value: 0x3008, lo: 0x85, hi: 0x86}, {value: 0x0008, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb3}, {value: 0x0018, lo: 0xb4, hi: 0xb5}, {value: 0x0008, lo: 0xb6, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0xb4, offset 0x56a {value: 0x0000, lo: 0x06}, {value: 0x3308, lo: 0x80, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0xb2}, {value: 0x3008, lo: 0xb3, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xbe}, {value: 0x3008, lo: 0xbf, hi: 0xbf}, // Block 0xb5, offset 0x571 {value: 0x0000, lo: 0x0e}, {value: 0x3808, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0x84}, {value: 0x0018, lo: 0x85, hi: 0x88}, {value: 0x3308, lo: 0x89, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0x8d}, {value: 0x3008, lo: 0x8e, hi: 0x8e}, {value: 0x3308, lo: 0x8f, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0x9b}, {value: 0x0008, lo: 0x9c, hi: 0x9c}, {value: 0x0018, lo: 0x9d, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xa0}, {value: 0x0018, lo: 0xa1, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0xb6, offset 0x580 {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x91}, {value: 0x0040, lo: 0x92, hi: 0x92}, {value: 0x0008, lo: 0x93, hi: 0xab}, {value: 0x3008, lo: 0xac, hi: 0xae}, {value: 0x3308, lo: 0xaf, hi: 0xb1}, {value: 0x3008, lo: 0xb2, hi: 0xb3}, {value: 0x3308, lo: 0xb4, hi: 0xb4}, {value: 0x3808, lo: 0xb5, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xb7}, {value: 0x0018, lo: 0xb8, hi: 0xbd}, {value: 0x3308, lo: 0xbe, hi: 0xbe}, {value: 0x0008, lo: 0xbf, hi: 0xbf}, // Block 0xb7, offset 0x58d {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x81}, {value: 0x0040, lo: 0x82, hi: 0xbf}, // Block 0xb8, offset 0x591 {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0008, lo: 0x8a, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8e}, {value: 0x0008, lo: 0x8f, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9e}, {value: 0x0008, lo: 0x9f, hi: 0xa8}, {value: 0x0018, lo: 0xa9, hi: 0xa9}, {value: 0x0040, lo: 0xaa, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0xb9, offset 0x59e {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0x9e}, {value: 0x3308, lo: 0x9f, hi: 0x9f}, {value: 0x3008, lo: 0xa0, hi: 0xa2}, {value: 0x3308, lo: 0xa3, hi: 0xa9}, {value: 0x3b08, lo: 0xaa, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0xba, offset 0x5a7 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xb4}, {value: 0x3008, lo: 0xb5, hi: 0xb7}, {value: 0x3308, lo: 0xb8, hi: 0xbf}, // Block 0xbb, offset 0x5ab {value: 0x0000, lo: 0x0e}, {value: 0x3008, lo: 0x80, hi: 0x81}, {value: 0x3b08, lo: 0x82, hi: 0x82}, {value: 0x3308, lo: 0x83, hi: 0x84}, {value: 0x3008, lo: 0x85, hi: 0x85}, {value: 0x3308, lo: 0x86, hi: 0x86}, {value: 0x0008, lo: 0x87, hi: 0x8a}, {value: 0x0018, lo: 0x8b, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0x9c}, {value: 0x0018, lo: 0x9d, hi: 0x9d}, {value: 0x3308, lo: 0x9e, hi: 0x9e}, {value: 0x0008, lo: 0x9f, hi: 0xa1}, {value: 0x0040, lo: 0xa2, hi: 0xbf}, // Block 0xbc, offset 0x5ba {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x3008, lo: 0xb0, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb8}, {value: 0x3008, lo: 0xb9, hi: 0xb9}, {value: 0x3308, lo: 0xba, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbe}, {value: 0x3308, lo: 0xbf, hi: 0xbf}, // Block 0xbd, offset 0x5c2 {value: 0x0000, lo: 0x0a}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x3008, lo: 0x81, hi: 0x81}, {value: 0x3b08, lo: 0x82, hi: 0x82}, {value: 0x3308, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0x85}, {value: 0x0018, lo: 0x86, hi: 0x86}, {value: 0x0008, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0xbf}, // Block 0xbe, offset 0x5cd {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0xae}, {value: 0x3008, lo: 0xaf, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb7}, {value: 0x3008, lo: 0xb8, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0xbf, offset 0x5d6 {value: 0x0000, lo: 0x05}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0x9b}, {value: 0x3308, lo: 0x9c, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0xbf}, // Block 0xc0, offset 0x5dc {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x3008, lo: 0xb0, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbc}, {value: 0x3308, lo: 0xbd, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0xc1, offset 0x5e4 {value: 0x0000, lo: 0x08}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0x84}, {value: 0x0040, lo: 0x85, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xbf}, // Block 0xc2, offset 0x5ed {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0xaa}, {value: 0x3308, lo: 0xab, hi: 0xab}, {value: 0x3008, lo: 0xac, hi: 0xac}, {value: 0x3308, lo: 0xad, hi: 0xad}, {value: 0x3008, lo: 0xae, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb5}, {value: 0x3808, lo: 0xb6, hi: 0xb6}, {value: 0x3308, lo: 0xb7, hi: 0xb7}, {value: 0x0008, lo: 0xb8, hi: 0xb8}, {value: 0x0018, lo: 0xb9, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0xc3, offset 0x5f9 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0xbf}, // Block 0xc4, offset 0x5fc {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x9a}, {value: 0x0040, lo: 0x9b, hi: 0x9c}, {value: 0x3308, lo: 0x9d, hi: 0x9f}, {value: 0x3008, lo: 0xa0, hi: 0xa1}, {value: 0x3308, lo: 0xa2, hi: 0xa5}, {value: 0x3008, lo: 0xa6, hi: 0xa6}, {value: 0x3308, lo: 0xa7, hi: 0xaa}, {value: 0x3b08, lo: 0xab, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb9}, {value: 0x0018, lo: 0xba, hi: 0xbf}, // Block 0xc5, offset 0x608 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0xbf}, // Block 0xc6, offset 0x60b {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0xab}, {value: 0x3008, lo: 0xac, hi: 0xae}, {value: 0x3308, lo: 0xaf, hi: 0xb7}, {value: 0x3008, lo: 0xb8, hi: 0xb8}, {value: 0x3b08, lo: 0xb9, hi: 0xb9}, {value: 0x3308, lo: 0xba, hi: 0xba}, {value: 0x0018, lo: 0xbb, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0xc7, offset 0x614 {value: 0x0000, lo: 0x02}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x049d, lo: 0xa0, hi: 0xbf}, // Block 0xc8, offset 0x617 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xa9}, {value: 0x0018, lo: 0xaa, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xbe}, {value: 0x0008, lo: 0xbf, hi: 0xbf}, // Block 0xc9, offset 0x61c {value: 0x0000, lo: 0x08}, {value: 0x3008, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x82}, {value: 0x3308, lo: 0x83, hi: 0x83}, {value: 0x0018, lo: 0x84, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0xbf}, // Block 0xca, offset 0x625 {value: 0x0000, lo: 0x04}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xa9}, {value: 0x0008, lo: 0xaa, hi: 0xbf}, // Block 0xcb, offset 0x62a {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x90}, {value: 0x3008, lo: 0x91, hi: 0x93}, {value: 0x3308, lo: 0x94, hi: 0x97}, {value: 0x0040, lo: 0x98, hi: 0x99}, {value: 0x3308, lo: 0x9a, hi: 0x9b}, {value: 0x3008, lo: 0x9c, hi: 0x9f}, {value: 0x3b08, lo: 0xa0, hi: 0xa0}, {value: 0x0008, lo: 0xa1, hi: 0xa1}, {value: 0x0018, lo: 0xa2, hi: 0xa2}, {value: 0x0008, lo: 0xa3, hi: 0xa3}, {value: 0x3008, lo: 0xa4, hi: 0xa4}, {value: 0x0040, lo: 0xa5, hi: 0xbf}, // Block 0xcc, offset 0x637 {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x8a}, {value: 0x0008, lo: 0x8b, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb3}, {value: 0x3b08, lo: 0xb4, hi: 0xb4}, {value: 0x3308, lo: 0xb5, hi: 0xb8}, {value: 0x3008, lo: 0xb9, hi: 0xb9}, {value: 0x0008, lo: 0xba, hi: 0xba}, {value: 0x3308, lo: 0xbb, hi: 0xbe}, {value: 0x0018, lo: 0xbf, hi: 0xbf}, // Block 0xcd, offset 0x642 {value: 0x0000, lo: 0x08}, {value: 0x0018, lo: 0x80, hi: 0x86}, {value: 0x3b08, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x90}, {value: 0x3308, lo: 0x91, hi: 0x96}, {value: 0x3008, lo: 0x97, hi: 0x98}, {value: 0x3308, lo: 0x99, hi: 0x9b}, {value: 0x0008, lo: 0x9c, hi: 0xbf}, // Block 0xce, offset 0x64b {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x3308, lo: 0x8a, hi: 0x96}, {value: 0x3008, lo: 0x97, hi: 0x97}, {value: 0x3308, lo: 0x98, hi: 0x98}, {value: 0x3b08, lo: 0x99, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0x9c}, {value: 0x0008, lo: 0x9d, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0xa2}, {value: 0x0040, lo: 0xa3, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0xcf, offset 0x656 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbf}, // Block 0xd0, offset 0x659 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0xbf}, // Block 0xd1, offset 0x65c {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0008, lo: 0x8a, hi: 0xae}, {value: 0x3008, lo: 0xaf, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xb7}, {value: 0x3308, lo: 0xb8, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0xd2, offset 0x666 {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xbf}, // Block 0xd3, offset 0x66f {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0x91}, {value: 0x3308, lo: 0x92, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xa8}, {value: 0x3008, lo: 0xa9, hi: 0xa9}, {value: 0x3308, lo: 0xaa, hi: 0xb0}, {value: 0x3008, lo: 0xb1, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb3}, {value: 0x3008, lo: 0xb4, hi: 0xb4}, {value: 0x3308, lo: 0xb5, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0xd4, offset 0x67b {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0x8a}, {value: 0x0008, lo: 0x8b, hi: 0xb0}, {value: 0x3308, lo: 0xb1, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xb9}, {value: 0x3308, lo: 0xba, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbe}, {value: 0x3308, lo: 0xbf, hi: 0xbf}, // Block 0xd5, offset 0x688 {value: 0x0000, lo: 0x0c}, {value: 0x3308, lo: 0x80, hi: 0x83}, {value: 0x3b08, lo: 0x84, hi: 0x85}, {value: 0x0008, lo: 0x86, hi: 0x86}, {value: 0x3308, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa5}, {value: 0x0040, lo: 0xa6, hi: 0xa6}, {value: 0x0008, lo: 0xa7, hi: 0xa8}, {value: 0x0040, lo: 0xa9, hi: 0xa9}, {value: 0x0008, lo: 0xaa, hi: 0xbf}, // Block 0xd6, offset 0x695 {value: 0x0000, lo: 0x0d}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x3008, lo: 0x8a, hi: 0x8e}, {value: 0x0040, lo: 0x8f, hi: 0x8f}, {value: 0x3308, lo: 0x90, hi: 0x91}, {value: 0x0040, lo: 0x92, hi: 0x92}, {value: 0x3008, lo: 0x93, hi: 0x94}, {value: 0x3308, lo: 0x95, hi: 0x95}, {value: 0x3008, lo: 0x96, hi: 0x96}, {value: 0x3b08, lo: 0x97, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0x98}, {value: 0x0040, lo: 0x99, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa9}, {value: 0x0040, lo: 0xaa, hi: 0xbf}, // Block 0xd7, offset 0x6a3 {value: 0x0000, lo: 0x06}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb4}, {value: 0x3008, lo: 0xb5, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbf}, // Block 0xd8, offset 0x6aa {value: 0x0000, lo: 0x0a}, {value: 0x3308, lo: 0x80, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0x82}, {value: 0x3008, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x91}, {value: 0x0008, lo: 0x92, hi: 0xb3}, {value: 0x3008, lo: 0xb4, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbf}, // Block 0xd9, offset 0x6b5 {value: 0x0000, lo: 0x06}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x3808, lo: 0x81, hi: 0x81}, {value: 0x3b08, lo: 0x82, hi: 0x82}, {value: 0x0018, lo: 0x83, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0xbf}, // Block 0xda, offset 0x6bc {value: 0x0000, lo: 0x03}, {value: 0x0040, lo: 0x80, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb0}, {value: 0x0040, lo: 0xb1, hi: 0xbf}, // Block 0xdb, offset 0x6c0 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xb1}, {value: 0x0040, lo: 0xb2, hi: 0xbe}, {value: 0x0018, lo: 0xbf, hi: 0xbf}, // Block 0xdc, offset 0x6c4 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0xbf}, // Block 0xdd, offset 0x6c7 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0xde, offset 0x6cc {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0xbf}, // Block 0xdf, offset 0x6cf {value: 0x0000, lo: 0x02}, {value: 0x0040, lo: 0x80, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xbf}, // Block 0xe0, offset 0x6d2 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xb0}, {value: 0x0018, lo: 0xb1, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xbf}, // Block 0xe1, offset 0x6d6 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x0340, lo: 0xb0, hi: 0xbf}, // Block 0xe2, offset 0x6d9 {value: 0x0000, lo: 0x04}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0x86}, {value: 0x3308, lo: 0x87, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0xbf}, // Block 0xe3, offset 0x6de {value: 0x0000, lo: 0x06}, {value: 0x0008, lo: 0x80, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa9}, {value: 0x0040, lo: 0xaa, hi: 0xad}, {value: 0x0018, lo: 0xae, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0xe4, offset 0x6e5 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0xe5, offset 0x6e8 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb4}, {value: 0x0018, lo: 0xb5, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xbf}, // Block 0xe6, offset 0x6f0 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xbf}, // Block 0xe7, offset 0x6f4 {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x83}, {value: 0x0018, lo: 0x84, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0xa1}, {value: 0x0040, lo: 0xa2, hi: 0xa2}, {value: 0x0008, lo: 0xa3, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbf}, // Block 0xe8, offset 0x6ff {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0xbf}, // Block 0xe9, offset 0x702 {value: 0x0000, lo: 0x02}, {value: 0xe105, lo: 0x80, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0xea, offset 0x705 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0x9a}, {value: 0x0040, lo: 0x9b, hi: 0xbf}, // Block 0xeb, offset 0x708 {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8e}, {value: 0x3308, lo: 0x8f, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x90}, {value: 0x3008, lo: 0x91, hi: 0xbf}, // Block 0xec, offset 0x70e {value: 0x0000, lo: 0x05}, {value: 0x3008, lo: 0x80, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8e}, {value: 0x3308, lo: 0x8f, hi: 0x92}, {value: 0x0008, lo: 0x93, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0xed, offset 0x714 {value: 0x0000, lo: 0x08}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa1}, {value: 0x0018, lo: 0xa2, hi: 0xa2}, {value: 0x0008, lo: 0xa3, hi: 0xa3}, {value: 0x3308, lo: 0xa4, hi: 0xa4}, {value: 0x0040, lo: 0xa5, hi: 0xaf}, {value: 0x3008, lo: 0xb0, hi: 0xb1}, {value: 0x0040, lo: 0xb2, hi: 0xbf}, // Block 0xee, offset 0x71d {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbf}, // Block 0xef, offset 0x720 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0xbf}, // Block 0xf0, offset 0x723 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0xbf}, // Block 0xf1, offset 0x726 {value: 0x0000, lo: 0x07}, {value: 0x0040, lo: 0x80, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xb4}, {value: 0x0008, lo: 0xb5, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0xf2, offset 0x72e {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xa2}, {value: 0x0040, lo: 0xa3, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xbf}, // Block 0xf3, offset 0x733 {value: 0x0000, lo: 0x08}, {value: 0x0040, lo: 0x80, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x92}, {value: 0x0040, lo: 0x93, hi: 0x94}, {value: 0x0008, lo: 0x95, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0xa3}, {value: 0x0008, lo: 0xa4, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0xf4, offset 0x73c {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0xf5, offset 0x73f {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbf}, // Block 0xf6, offset 0x744 {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9b}, {value: 0x0018, lo: 0x9c, hi: 0x9c}, {value: 0x3308, lo: 0x9d, hi: 0x9e}, {value: 0x0018, lo: 0x9f, hi: 0x9f}, {value: 0x03c0, lo: 0xa0, hi: 0xa3}, {value: 0x0040, lo: 0xa4, hi: 0xbf}, // Block 0xf7, offset 0x74e {value: 0x0000, lo: 0x03}, {value: 0x3308, lo: 0x80, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xbf}, // Block 0xf8, offset 0x752 {value: 0x0000, lo: 0x03}, {value: 0x3308, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xbf}, // Block 0xf9, offset 0x756 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0xbf}, // Block 0xfa, offset 0x759 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xbf}, // Block 0xfb, offset 0x75c {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xa8}, {value: 0x0018, lo: 0xa9, hi: 0xbf}, // Block 0xfc, offset 0x760 {value: 0x0000, lo: 0x0e}, {value: 0x0018, lo: 0x80, hi: 0x9d}, {value: 0x2379, lo: 0x9e, hi: 0x9e}, {value: 0x2381, lo: 0x9f, hi: 0x9f}, {value: 0x2389, lo: 0xa0, hi: 0xa0}, {value: 0x2391, lo: 0xa1, hi: 0xa1}, {value: 0x2399, lo: 0xa2, hi: 0xa2}, {value: 0x23a1, lo: 0xa3, hi: 0xa3}, {value: 0x23a9, lo: 0xa4, hi: 0xa4}, {value: 0x3018, lo: 0xa5, hi: 0xa6}, {value: 0x3318, lo: 0xa7, hi: 0xa9}, {value: 0x0018, lo: 0xaa, hi: 0xac}, {value: 0x3018, lo: 0xad, hi: 0xb2}, {value: 0x0340, lo: 0xb3, hi: 0xba}, {value: 0x3318, lo: 0xbb, hi: 0xbf}, // Block 0xfd, offset 0x76f {value: 0x0000, lo: 0x0b}, {value: 0x3318, lo: 0x80, hi: 0x82}, {value: 0x0018, lo: 0x83, hi: 0x84}, {value: 0x3318, lo: 0x85, hi: 0x8b}, {value: 0x0018, lo: 0x8c, hi: 0xa9}, {value: 0x3318, lo: 0xaa, hi: 0xad}, {value: 0x0018, lo: 0xae, hi: 0xba}, {value: 0x23b1, lo: 0xbb, hi: 0xbb}, {value: 0x23b9, lo: 0xbc, hi: 0xbc}, {value: 0x23c1, lo: 0xbd, hi: 0xbd}, {value: 0x23c9, lo: 0xbe, hi: 0xbe}, {value: 0x23d1, lo: 0xbf, hi: 0xbf}, // Block 0xfe, offset 0x77b {value: 0x0000, lo: 0x03}, {value: 0x23d9, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xbf}, // Block 0xff, offset 0x77f {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x81}, {value: 0x3318, lo: 0x82, hi: 0x84}, {value: 0x0018, lo: 0x85, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0xbf}, // Block 0x100, offset 0x784 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xbf}, // Block 0x101, offset 0x789 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbf}, // Block 0x102, offset 0x78e {value: 0x0000, lo: 0x03}, {value: 0x3308, lo: 0x80, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xba}, {value: 0x3308, lo: 0xbb, hi: 0xbf}, // Block 0x103, offset 0x792 {value: 0x0000, lo: 0x04}, {value: 0x3308, lo: 0x80, hi: 0xac}, {value: 0x0018, lo: 0xad, hi: 0xb4}, {value: 0x3308, lo: 0xb5, hi: 0xb5}, {value: 0x0018, lo: 0xb6, hi: 0xbf}, // Block 0x104, offset 0x797 {value: 0x0000, lo: 0x08}, {value: 0x0018, lo: 0x80, hi: 0x83}, {value: 0x3308, lo: 0x84, hi: 0x84}, {value: 0x0018, lo: 0x85, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x9a}, {value: 0x3308, lo: 0x9b, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xa0}, {value: 0x3308, lo: 0xa1, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, // Block 0x105, offset 0x7a0 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0xa4}, {value: 0x0008, lo: 0xa5, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xbf}, // Block 0x106, offset 0x7a5 {value: 0x0000, lo: 0x03}, {value: 0x0040, lo: 0x80, hi: 0x8e}, {value: 0x3308, lo: 0x8f, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0xbf}, // Block 0x107, offset 0x7a9 {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb6}, {value: 0x0008, lo: 0xb7, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbf}, // Block 0x108, offset 0x7af {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0x8d}, {value: 0x0008, lo: 0x8e, hi: 0x8e}, {value: 0x0018, lo: 0x8f, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0xbf}, // Block 0x109, offset 0x7b5 {value: 0x0000, lo: 0x04}, {value: 0x0040, lo: 0x80, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xad}, {value: 0x3308, lo: 0xae, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xbf}, // Block 0x10a, offset 0x7ba {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0xab}, {value: 0x3308, lo: 0xac, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbe}, {value: 0x0018, lo: 0xbf, hi: 0xbf}, // Block 0x10b, offset 0x7c0 {value: 0x0000, lo: 0x05}, {value: 0x0040, lo: 0x80, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xab}, {value: 0x3308, lo: 0xac, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0x10c, offset 0x7c6 {value: 0x0000, lo: 0x09}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xa7}, {value: 0x0008, lo: 0xa8, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xac}, {value: 0x0008, lo: 0xad, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0x10d, offset 0x7d0 {value: 0x0000, lo: 0x05}, {value: 0x0808, lo: 0x80, hi: 0x84}, {value: 0x0040, lo: 0x85, hi: 0x86}, {value: 0x0818, lo: 0x87, hi: 0x8f}, {value: 0x3308, lo: 0x90, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0xbf}, // Block 0x10e, offset 0x7d6 {value: 0x0000, lo: 0x08}, {value: 0x0a08, lo: 0x80, hi: 0x83}, {value: 0x3308, lo: 0x84, hi: 0x8a}, {value: 0x0b08, lo: 0x8b, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8f}, {value: 0x0808, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9d}, {value: 0x0818, lo: 0x9e, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0x10f, offset 0x7df {value: 0x0000, lo: 0x02}, {value: 0x0040, lo: 0x80, hi: 0xb0}, {value: 0x0818, lo: 0xb1, hi: 0xbf}, // Block 0x110, offset 0x7e2 {value: 0x0000, lo: 0x02}, {value: 0x0818, lo: 0x80, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0x111, offset 0x7e5 {value: 0x0000, lo: 0x03}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0818, lo: 0x81, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbf}, // Block 0x112, offset 0x7e9 {value: 0x0000, lo: 0x03}, {value: 0x0040, lo: 0x80, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb1}, {value: 0x0040, lo: 0xb2, hi: 0xbf}, // Block 0x113, offset 0x7ed {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xbf}, // Block 0x114, offset 0x7f1 {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xb0}, {value: 0x0018, lo: 0xb1, hi: 0xbf}, // Block 0x115, offset 0x7f7 {value: 0x0000, lo: 0x05}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0x90}, {value: 0x0018, lo: 0x91, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xbf}, // Block 0x116, offset 0x7fd {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x8f}, {value: 0x2709, lo: 0x90, hi: 0x90}, {value: 0x0018, lo: 0x91, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xbf}, // Block 0x117, offset 0x802 {value: 0x0000, lo: 0x02}, {value: 0x0040, lo: 0x80, hi: 0xa5}, {value: 0x0018, lo: 0xa6, hi: 0xbf}, // Block 0x118, offset 0x805 {value: 0x0000, lo: 0x0f}, {value: 0x2889, lo: 0x80, hi: 0x80}, {value: 0x2891, lo: 0x81, hi: 0x81}, {value: 0x2899, lo: 0x82, hi: 0x82}, {value: 0x28a1, lo: 0x83, hi: 0x83}, {value: 0x28a9, lo: 0x84, hi: 0x84}, {value: 0x28b1, lo: 0x85, hi: 0x85}, {value: 0x28b9, lo: 0x86, hi: 0x86}, {value: 0x28c1, lo: 0x87, hi: 0x87}, {value: 0x28c9, lo: 0x88, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x8f}, {value: 0x28d1, lo: 0x90, hi: 0x90}, {value: 0x28d9, lo: 0x91, hi: 0x91}, {value: 0x0040, lo: 0x92, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa5}, {value: 0x0040, lo: 0xa6, hi: 0xbf}, // Block 0x119, offset 0x815 {value: 0x0000, lo: 0x06}, {value: 0x0018, lo: 0x80, hi: 0x97}, {value: 0x0040, lo: 0x98, hi: 0x9b}, {value: 0x0018, lo: 0x9c, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbf}, // Block 0x11a, offset 0x81c {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xba}, {value: 0x0018, lo: 0xbb, hi: 0xbf}, // Block 0x11b, offset 0x820 {value: 0x0000, lo: 0x06}, {value: 0x0018, lo: 0x80, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb0}, {value: 0x0040, lo: 0xb1, hi: 0xbf}, // Block 0x11c, offset 0x827 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xbf}, // Block 0x11d, offset 0x82b {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xbf}, // Block 0x11e, offset 0x831 {value: 0x0000, lo: 0x06}, {value: 0x0018, lo: 0x80, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb1}, {value: 0x0040, lo: 0xb2, hi: 0xbf}, // Block 0x11f, offset 0x838 {value: 0x0000, lo: 0x06}, {value: 0x0018, lo: 0x80, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbf}, // Block 0x120, offset 0x83f {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbe}, {value: 0x0018, lo: 0xbf, hi: 0xbf}, // Block 0x121, offset 0x845 {value: 0x0000, lo: 0x08}, {value: 0x0018, lo: 0x80, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x8d}, {value: 0x0018, lo: 0x8e, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa8}, {value: 0x0040, lo: 0xa9, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbf}, // Block 0x122, offset 0x84e {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0x92}, {value: 0x0040, lo: 0x93, hi: 0x93}, {value: 0x0018, lo: 0x94, hi: 0xbf}, // Block 0x123, offset 0x852 {value: 0x0000, lo: 0x0d}, {value: 0x0018, lo: 0x80, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0xaf}, {value: 0x06e1, lo: 0xb0, hi: 0xb0}, {value: 0x0049, lo: 0xb1, hi: 0xb1}, {value: 0x0029, lo: 0xb2, hi: 0xb2}, {value: 0x0031, lo: 0xb3, hi: 0xb3}, {value: 0x06e9, lo: 0xb4, hi: 0xb4}, {value: 0x06f1, lo: 0xb5, hi: 0xb5}, {value: 0x06f9, lo: 0xb6, hi: 0xb6}, {value: 0x0701, lo: 0xb7, hi: 0xb7}, {value: 0x0709, lo: 0xb8, hi: 0xb8}, {value: 0x0711, lo: 0xb9, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0x124, offset 0x860 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0x125, offset 0x863 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0x126, offset 0x866 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x127, offset 0x86a {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xa1}, {value: 0x0040, lo: 0xa2, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x128, offset 0x86e {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xa0}, {value: 0x0040, lo: 0xa1, hi: 0xbf}, // Block 0x129, offset 0x871 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xbf}, // Block 0x12a, offset 0x875 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, // Block 0x12b, offset 0x878 {value: 0x0000, lo: 0x04}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0340, lo: 0x81, hi: 0x81}, {value: 0x0040, lo: 0x82, hi: 0x9f}, {value: 0x0340, lo: 0xa0, hi: 0xbf}, // Block 0x12c, offset 0x87d {value: 0x0000, lo: 0x01}, {value: 0x0340, lo: 0x80, hi: 0xbf}, // Block 0x12d, offset 0x87f {value: 0x0000, lo: 0x01}, {value: 0x33c0, lo: 0x80, hi: 0xbf}, // Block 0x12e, offset 0x881 {value: 0x0000, lo: 0x02}, {value: 0x33c0, lo: 0x80, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, } // Total table size 46723 bytes (45KiB); checksum: 4CF3143A ================================================ FILE: vendor/golang.org/x/net/idna/tables9.0.0.go ================================================ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. //go:build !go1.10 package idna // UnicodeVersion is the Unicode version from which the tables in this package are derived. const UnicodeVersion = "9.0.0" var mappings string = "" + // Size: 8175 bytes "\x00\x01 \x03 ̈\x01a\x03 ̄\x012\x013\x03 ́\x03 ̧\x011\x01o\x051⁄4\x051⁄2" + "\x053⁄4\x03i̇\x03l·\x03ʼn\x01s\x03dž\x03ⱥ\x03ⱦ\x01h\x01j\x01r\x01w\x01y" + "\x03 ̆\x03 ̇\x03 ̊\x03 ̨\x03 ̃\x03 ̋\x01l\x01x\x04̈́\x03 ι\x01;\x05 ̈́" + "\x04եւ\x04اٴ\x04وٴ\x04ۇٴ\x04يٴ\x06क़\x06ख़\x06ग़\x06ज़\x06ड़\x06ढ़\x06फ़" + "\x06य़\x06ড়\x06ঢ়\x06য়\x06ਲ਼\x06ਸ਼\x06ਖ਼\x06ਗ਼\x06ਜ਼\x06ਫ਼\x06ଡ଼\x06ଢ଼" + "\x06ํา\x06ໍາ\x06ຫນ\x06ຫມ\x06གྷ\x06ཌྷ\x06དྷ\x06བྷ\x06ཛྷ\x06ཀྵ\x06ཱི\x06ཱུ" + "\x06ྲྀ\x09ྲཱྀ\x06ླྀ\x09ླཱྀ\x06ཱྀ\x06ྒྷ\x06ྜྷ\x06ྡྷ\x06ྦྷ\x06ྫྷ\x06ྐྵ\x02" + "в\x02д\x02о\x02с\x02т\x02ъ\x02ѣ\x02æ\x01b\x01d\x01e\x02ǝ\x01g\x01i\x01k" + "\x01m\x01n\x02ȣ\x01p\x01t\x01u\x02ɐ\x02ɑ\x02ə\x02ɛ\x02ɜ\x02ŋ\x02ɔ\x02ɯ" + "\x01v\x02β\x02γ\x02δ\x02φ\x02χ\x02ρ\x02н\x02ɒ\x01c\x02ɕ\x02ð\x01f\x02ɟ" + "\x02ɡ\x02ɥ\x02ɨ\x02ɩ\x02ɪ\x02ʝ\x02ɭ\x02ʟ\x02ɱ\x02ɰ\x02ɲ\x02ɳ\x02ɴ\x02ɵ" + "\x02ɸ\x02ʂ\x02ʃ\x02ƫ\x02ʉ\x02ʊ\x02ʋ\x02ʌ\x01z\x02ʐ\x02ʑ\x02ʒ\x02θ\x02ss" + "\x02ά\x02έ\x02ή\x02ί\x02ό\x02ύ\x02ώ\x05ἀι\x05ἁι\x05ἂι\x05ἃι\x05ἄι\x05ἅι" + "\x05ἆι\x05ἇι\x05ἠι\x05ἡι\x05ἢι\x05ἣι\x05ἤι\x05ἥι\x05ἦι\x05ἧι\x05ὠι\x05ὡι" + "\x05ὢι\x05ὣι\x05ὤι\x05ὥι\x05ὦι\x05ὧι\x05ὰι\x04αι\x04άι\x05ᾶι\x02ι\x05 ̈͂" + "\x05ὴι\x04ηι\x04ήι\x05ῆι\x05 ̓̀\x05 ̓́\x05 ̓͂\x02ΐ\x05 ̔̀\x05 ̔́\x05 ̔͂" + "\x02ΰ\x05 ̈̀\x01`\x05ὼι\x04ωι\x04ώι\x05ῶι\x06′′\x09′′′\x06‵‵\x09‵‵‵\x02!" + "!\x02??\x02?!\x02!?\x0c′′′′\x010\x014\x015\x016\x017\x018\x019\x01+\x01=" + "\x01(\x01)\x02rs\x02ħ\x02no\x01q\x02sm\x02tm\x02ω\x02å\x02א\x02ב\x02ג" + "\x02ד\x02π\x051⁄7\x051⁄9\x061⁄10\x051⁄3\x052⁄3\x051⁄5\x052⁄5\x053⁄5\x054" + "⁄5\x051⁄6\x055⁄6\x051⁄8\x053⁄8\x055⁄8\x057⁄8\x041⁄\x02ii\x02iv\x02vi" + "\x04viii\x02ix\x02xi\x050⁄3\x06∫∫\x09∫∫∫\x06∮∮\x09∮∮∮\x0210\x0211\x0212" + "\x0213\x0214\x0215\x0216\x0217\x0218\x0219\x0220\x04(10)\x04(11)\x04(12)" + "\x04(13)\x04(14)\x04(15)\x04(16)\x04(17)\x04(18)\x04(19)\x04(20)\x0c∫∫∫∫" + "\x02==\x05⫝̸\x02ɫ\x02ɽ\x02ȿ\x02ɀ\x01.\x04 ゙\x04 ゚\x06より\x06コト\x05(ᄀ)\x05" + "(ᄂ)\x05(ᄃ)\x05(ᄅ)\x05(ᄆ)\x05(ᄇ)\x05(ᄉ)\x05(ᄋ)\x05(ᄌ)\x05(ᄎ)\x05(ᄏ)\x05(ᄐ" + ")\x05(ᄑ)\x05(ᄒ)\x05(가)\x05(나)\x05(다)\x05(라)\x05(마)\x05(바)\x05(사)\x05(아)" + "\x05(자)\x05(차)\x05(카)\x05(타)\x05(파)\x05(하)\x05(주)\x08(오전)\x08(오후)\x05(一)" + "\x05(二)\x05(三)\x05(四)\x05(五)\x05(六)\x05(七)\x05(八)\x05(九)\x05(十)\x05(月)" + "\x05(火)\x05(水)\x05(木)\x05(金)\x05(土)\x05(日)\x05(株)\x05(有)\x05(社)\x05(名)" + "\x05(特)\x05(財)\x05(祝)\x05(労)\x05(代)\x05(呼)\x05(学)\x05(監)\x05(企)\x05(資)" + "\x05(協)\x05(祭)\x05(休)\x05(自)\x05(至)\x0221\x0222\x0223\x0224\x0225\x0226" + "\x0227\x0228\x0229\x0230\x0231\x0232\x0233\x0234\x0235\x06참고\x06주의\x0236" + "\x0237\x0238\x0239\x0240\x0241\x0242\x0243\x0244\x0245\x0246\x0247\x0248" + "\x0249\x0250\x041月\x042月\x043月\x044月\x045月\x046月\x047月\x048月\x049月\x0510" + "月\x0511月\x0512月\x02hg\x02ev\x0cアパート\x0cアルファ\x0cアンペア\x09アール\x0cイニング\x09" + "インチ\x09ウォン\x0fエスクード\x0cエーカー\x09オンス\x09オーム\x09カイリ\x0cカラット\x0cカロリー\x09ガロ" + "ン\x09ガンマ\x06ギガ\x09ギニー\x0cキュリー\x0cギルダー\x06キロ\x0fキログラム\x12キロメートル\x0fキロワッ" + "ト\x09グラム\x0fグラムトン\x0fクルゼイロ\x0cクローネ\x09ケース\x09コルナ\x09コーポ\x0cサイクル\x0fサンチ" + "ーム\x0cシリング\x09センチ\x09セント\x09ダース\x06デシ\x06ドル\x06トン\x06ナノ\x09ノット\x09ハイツ" + "\x0fパーセント\x09パーツ\x0cバーレル\x0fピアストル\x09ピクル\x06ピコ\x06ビル\x0fファラッド\x0cフィート" + "\x0fブッシェル\x09フラン\x0fヘクタール\x06ペソ\x09ペニヒ\x09ヘルツ\x09ペンス\x09ページ\x09ベータ\x0cポイ" + "ント\x09ボルト\x06ホン\x09ポンド\x09ホール\x09ホーン\x0cマイクロ\x09マイル\x09マッハ\x09マルク\x0fマ" + "ンション\x0cミクロン\x06ミリ\x0fミリバール\x06メガ\x0cメガトン\x0cメートル\x09ヤード\x09ヤール\x09ユアン" + "\x0cリットル\x06リラ\x09ルピー\x0cルーブル\x06レム\x0fレントゲン\x09ワット\x040点\x041点\x042点" + "\x043点\x044点\x045点\x046点\x047点\x048点\x049点\x0510点\x0511点\x0512点\x0513点" + "\x0514点\x0515点\x0516点\x0517点\x0518点\x0519点\x0520点\x0521点\x0522点\x0523点" + "\x0524点\x02da\x02au\x02ov\x02pc\x02dm\x02iu\x06平成\x06昭和\x06大正\x06明治\x0c株" + "式会社\x02pa\x02na\x02ma\x02ka\x02kb\x02mb\x02gb\x04kcal\x02pf\x02nf\x02m" + "g\x02kg\x02hz\x02ml\x02dl\x02kl\x02fm\x02nm\x02mm\x02cm\x02km\x02m2\x02m" + "3\x05m∕s\x06m∕s2\x07rad∕s\x08rad∕s2\x02ps\x02ns\x02ms\x02pv\x02nv\x02mv" + "\x02kv\x02pw\x02nw\x02mw\x02kw\x02bq\x02cc\x02cd\x06c∕kg\x02db\x02gy\x02" + "ha\x02hp\x02in\x02kk\x02kt\x02lm\x02ln\x02lx\x02ph\x02pr\x02sr\x02sv\x02" + "wb\x05v∕m\x05a∕m\x041日\x042日\x043日\x044日\x045日\x046日\x047日\x048日\x049日" + "\x0510日\x0511日\x0512日\x0513日\x0514日\x0515日\x0516日\x0517日\x0518日\x0519日" + "\x0520日\x0521日\x0522日\x0523日\x0524日\x0525日\x0526日\x0527日\x0528日\x0529日" + "\x0530日\x0531日\x02ь\x02ɦ\x02ɬ\x02ʞ\x02ʇ\x02œ\x04𤋮\x04𢡊\x04𢡄\x04𣏕\x04𥉉" + "\x04𥳐\x04𧻓\x02ff\x02fi\x02fl\x02st\x04մն\x04մե\x04մի\x04վն\x04մխ\x04יִ" + "\x04ײַ\x02ע\x02ה\x02כ\x02ל\x02ם\x02ר\x02ת\x04שׁ\x04שׂ\x06שּׁ\x06שּׂ\x04א" + "ַ\x04אָ\x04אּ\x04בּ\x04גּ\x04דּ\x04הּ\x04וּ\x04זּ\x04טּ\x04יּ\x04ךּ\x04" + "כּ\x04לּ\x04מּ\x04נּ\x04סּ\x04ףּ\x04פּ\x04צּ\x04קּ\x04רּ\x04שּ\x04תּ" + "\x04וֹ\x04בֿ\x04כֿ\x04פֿ\x04אל\x02ٱ\x02ٻ\x02پ\x02ڀ\x02ٺ\x02ٿ\x02ٹ\x02ڤ" + "\x02ڦ\x02ڄ\x02ڃ\x02چ\x02ڇ\x02ڍ\x02ڌ\x02ڎ\x02ڈ\x02ژ\x02ڑ\x02ک\x02گ\x02ڳ" + "\x02ڱ\x02ں\x02ڻ\x02ۀ\x02ہ\x02ھ\x02ے\x02ۓ\x02ڭ\x02ۇ\x02ۆ\x02ۈ\x02ۋ\x02ۅ" + "\x02ۉ\x02ې\x02ى\x04ئا\x04ئە\x04ئو\x04ئۇ\x04ئۆ\x04ئۈ\x04ئې\x04ئى\x02ی\x04" + "ئج\x04ئح\x04ئم\x04ئي\x04بج\x04بح\x04بخ\x04بم\x04بى\x04بي\x04تج\x04تح" + "\x04تخ\x04تم\x04تى\x04تي\x04ثج\x04ثم\x04ثى\x04ثي\x04جح\x04جم\x04حج\x04حم" + "\x04خج\x04خح\x04خم\x04سج\x04سح\x04سخ\x04سم\x04صح\x04صم\x04ضج\x04ضح\x04ضخ" + "\x04ضم\x04طح\x04طم\x04ظم\x04عج\x04عم\x04غج\x04غم\x04فج\x04فح\x04فخ\x04فم" + "\x04فى\x04في\x04قح\x04قم\x04قى\x04قي\x04كا\x04كج\x04كح\x04كخ\x04كل\x04كم" + "\x04كى\x04كي\x04لج\x04لح\x04لخ\x04لم\x04لى\x04لي\x04مج\x04مح\x04مخ\x04مم" + "\x04مى\x04مي\x04نج\x04نح\x04نخ\x04نم\x04نى\x04ني\x04هج\x04هم\x04هى\x04هي" + "\x04يج\x04يح\x04يخ\x04يم\x04يى\x04يي\x04ذٰ\x04رٰ\x04ىٰ\x05 ٌّ\x05 ٍّ\x05" + " َّ\x05 ُّ\x05 ِّ\x05 ّٰ\x04ئر\x04ئز\x04ئن\x04بر\x04بز\x04بن\x04تر\x04تز" + "\x04تن\x04ثر\x04ثز\x04ثن\x04ما\x04نر\x04نز\x04نن\x04ير\x04يز\x04ين\x04ئخ" + "\x04ئه\x04به\x04ته\x04صخ\x04له\x04نه\x04هٰ\x04يه\x04ثه\x04سه\x04شم\x04شه" + "\x06ـَّ\x06ـُّ\x06ـِّ\x04طى\x04طي\x04عى\x04عي\x04غى\x04غي\x04سى\x04سي" + "\x04شى\x04شي\x04حى\x04حي\x04جى\x04جي\x04خى\x04خي\x04صى\x04صي\x04ضى\x04ضي" + "\x04شج\x04شح\x04شخ\x04شر\x04سر\x04صر\x04ضر\x04اً\x06تجم\x06تحج\x06تحم" + "\x06تخم\x06تمج\x06تمح\x06تمخ\x06جمح\x06حمي\x06حمى\x06سحج\x06سجح\x06سجى" + "\x06سمح\x06سمج\x06سمم\x06صحح\x06صمم\x06شحم\x06شجي\x06شمخ\x06شمم\x06ضحى" + "\x06ضخم\x06طمح\x06طمم\x06طمي\x06عجم\x06عمم\x06عمى\x06غمم\x06غمي\x06غمى" + "\x06فخم\x06قمح\x06قمم\x06لحم\x06لحي\x06لحى\x06لجج\x06لخم\x06لمح\x06محج" + "\x06محم\x06محي\x06مجح\x06مجم\x06مخج\x06مخم\x06مجخ\x06همج\x06همم\x06نحم" + "\x06نحى\x06نجم\x06نجى\x06نمي\x06نمى\x06يمم\x06بخي\x06تجي\x06تجى\x06تخي" + "\x06تخى\x06تمي\x06تمى\x06جمي\x06جحى\x06جمى\x06سخى\x06صحي\x06شحي\x06ضحي" + "\x06لجي\x06لمي\x06يحي\x06يجي\x06يمي\x06ممي\x06قمي\x06نحي\x06عمي\x06كمي" + "\x06نجح\x06مخي\x06لجم\x06كمم\x06جحي\x06حجي\x06مجي\x06فمي\x06بحي\x06سخي" + "\x06نجي\x06صلے\x06قلے\x08الله\x08اكبر\x08محمد\x08صلعم\x08رسول\x08عليه" + "\x08وسلم\x06صلى!صلى الله عليه وسلم\x0fجل جلاله\x08ریال\x01,\x01:\x01!" + "\x01?\x01_\x01{\x01}\x01[\x01]\x01#\x01&\x01*\x01-\x01<\x01>\x01\\\x01$" + "\x01%\x01@\x04ـً\x04ـَ\x04ـُ\x04ـِ\x04ـّ\x04ـْ\x02ء\x02آ\x02أ\x02ؤ\x02إ" + "\x02ئ\x02ا\x02ب\x02ة\x02ت\x02ث\x02ج\x02ح\x02خ\x02د\x02ذ\x02ر\x02ز\x02س" + "\x02ش\x02ص\x02ض\x02ط\x02ظ\x02ع\x02غ\x02ف\x02ق\x02ك\x02ل\x02م\x02ن\x02ه" + "\x02و\x02ي\x04لآ\x04لأ\x04لإ\x04لا\x01\x22\x01'\x01/\x01^\x01|\x01~\x02¢" + "\x02£\x02¬\x02¦\x02¥\x08𝅗𝅥\x08𝅘𝅥\x0c𝅘𝅥𝅮\x0c𝅘𝅥𝅯\x0c𝅘𝅥𝅰\x0c𝅘𝅥𝅱\x0c𝅘𝅥𝅲\x08𝆹" + "𝅥\x08𝆺𝅥\x0c𝆹𝅥𝅮\x0c𝆺𝅥𝅮\x0c𝆹𝅥𝅯\x0c𝆺𝅥𝅯\x02ı\x02ȷ\x02α\x02ε\x02ζ\x02η\x02" + "κ\x02λ\x02μ\x02ν\x02ξ\x02ο\x02σ\x02τ\x02υ\x02ψ\x03∇\x03∂\x02ϝ\x02ٮ\x02ڡ" + "\x02ٯ\x020,\x021,\x022,\x023,\x024,\x025,\x026,\x027,\x028,\x029,\x03(a)" + "\x03(b)\x03(c)\x03(d)\x03(e)\x03(f)\x03(g)\x03(h)\x03(i)\x03(j)\x03(k)" + "\x03(l)\x03(m)\x03(n)\x03(o)\x03(p)\x03(q)\x03(r)\x03(s)\x03(t)\x03(u)" + "\x03(v)\x03(w)\x03(x)\x03(y)\x03(z)\x07〔s〕\x02wz\x02hv\x02sd\x03ppv\x02w" + "c\x02mc\x02md\x02dj\x06ほか\x06ココ\x03サ\x03手\x03字\x03双\x03デ\x03二\x03多\x03解" + "\x03天\x03交\x03映\x03無\x03料\x03前\x03後\x03再\x03新\x03初\x03終\x03生\x03販\x03声" + "\x03吹\x03演\x03投\x03捕\x03一\x03三\x03遊\x03左\x03中\x03右\x03指\x03走\x03打\x03禁" + "\x03空\x03合\x03満\x03有\x03月\x03申\x03割\x03営\x03配\x09〔本〕\x09〔三〕\x09〔二〕\x09〔安" + "〕\x09〔点〕\x09〔打〕\x09〔盗〕\x09〔勝〕\x09〔敗〕\x03得\x03可\x03丽\x03丸\x03乁\x03你\x03" + "侮\x03侻\x03倂\x03偺\x03備\x03僧\x03像\x03㒞\x03免\x03兔\x03兤\x03具\x03㒹\x03內\x03" + "冗\x03冤\x03仌\x03冬\x03况\x03凵\x03刃\x03㓟\x03刻\x03剆\x03剷\x03㔕\x03勇\x03勉\x03" + "勤\x03勺\x03包\x03匆\x03北\x03卉\x03卑\x03博\x03即\x03卽\x03卿\x03灰\x03及\x03叟\x03" + "叫\x03叱\x03吆\x03咞\x03吸\x03呈\x03周\x03咢\x03哶\x03唐\x03啓\x03啣\x03善\x03喙\x03" + "喫\x03喳\x03嗂\x03圖\x03嘆\x03圗\x03噑\x03噴\x03切\x03壮\x03城\x03埴\x03堍\x03型\x03" + "堲\x03報\x03墬\x03売\x03壷\x03夆\x03夢\x03奢\x03姬\x03娛\x03娧\x03姘\x03婦\x03㛮\x03" + "嬈\x03嬾\x03寃\x03寘\x03寧\x03寳\x03寿\x03将\x03尢\x03㞁\x03屠\x03屮\x03峀\x03岍\x03" + "嵃\x03嵮\x03嵫\x03嵼\x03巡\x03巢\x03㠯\x03巽\x03帨\x03帽\x03幩\x03㡢\x03㡼\x03庰\x03" + "庳\x03庶\x03廊\x03廾\x03舁\x03弢\x03㣇\x03形\x03彫\x03㣣\x03徚\x03忍\x03志\x03忹\x03" + "悁\x03㤺\x03㤜\x03悔\x03惇\x03慈\x03慌\x03慎\x03慺\x03憎\x03憲\x03憤\x03憯\x03懞\x03" + "懲\x03懶\x03成\x03戛\x03扝\x03抱\x03拔\x03捐\x03挽\x03拼\x03捨\x03掃\x03揤\x03搢\x03" + "揅\x03掩\x03㨮\x03摩\x03摾\x03撝\x03摷\x03㩬\x03敏\x03敬\x03旣\x03書\x03晉\x03㬙\x03" + "暑\x03㬈\x03㫤\x03冒\x03冕\x03最\x03暜\x03肭\x03䏙\x03朗\x03望\x03朡\x03杞\x03杓\x03" + "㭉\x03柺\x03枅\x03桒\x03梅\x03梎\x03栟\x03椔\x03㮝\x03楂\x03榣\x03槪\x03檨\x03櫛\x03" + "㰘\x03次\x03歔\x03㱎\x03歲\x03殟\x03殺\x03殻\x03汎\x03沿\x03泍\x03汧\x03洖\x03派\x03" + "海\x03流\x03浩\x03浸\x03涅\x03洴\x03港\x03湮\x03㴳\x03滋\x03滇\x03淹\x03潮\x03濆\x03" + "瀹\x03瀞\x03瀛\x03㶖\x03灊\x03災\x03灷\x03炭\x03煅\x03熜\x03爨\x03爵\x03牐\x03犀\x03" + "犕\x03獺\x03王\x03㺬\x03玥\x03㺸\x03瑇\x03瑜\x03瑱\x03璅\x03瓊\x03㼛\x03甤\x03甾\x03" + "異\x03瘐\x03㿼\x03䀈\x03直\x03眞\x03真\x03睊\x03䀹\x03瞋\x03䁆\x03䂖\x03硎\x03碌\x03" + "磌\x03䃣\x03祖\x03福\x03秫\x03䄯\x03穀\x03穊\x03穏\x03䈂\x03篆\x03築\x03䈧\x03糒\x03" + "䊠\x03糨\x03糣\x03紀\x03絣\x03䌁\x03緇\x03縂\x03繅\x03䌴\x03䍙\x03罺\x03羕\x03翺\x03" + "者\x03聠\x03聰\x03䏕\x03育\x03脃\x03䐋\x03脾\x03媵\x03舄\x03辞\x03䑫\x03芑\x03芋\x03" + "芝\x03劳\x03花\x03芳\x03芽\x03苦\x03若\x03茝\x03荣\x03莭\x03茣\x03莽\x03菧\x03著\x03" + "荓\x03菊\x03菌\x03菜\x03䔫\x03蓱\x03蓳\x03蔖\x03蕤\x03䕝\x03䕡\x03䕫\x03虐\x03虜\x03" + "虧\x03虩\x03蚩\x03蚈\x03蜎\x03蛢\x03蝹\x03蜨\x03蝫\x03螆\x03蟡\x03蠁\x03䗹\x03衠\x03" + "衣\x03裗\x03裞\x03䘵\x03裺\x03㒻\x03䚾\x03䛇\x03誠\x03諭\x03變\x03豕\x03貫\x03賁\x03" + "贛\x03起\x03跋\x03趼\x03跰\x03軔\x03輸\x03邔\x03郱\x03鄑\x03鄛\x03鈸\x03鋗\x03鋘\x03" + "鉼\x03鏹\x03鐕\x03開\x03䦕\x03閷\x03䧦\x03雃\x03嶲\x03霣\x03䩮\x03䩶\x03韠\x03䪲\x03" + "頋\x03頩\x03飢\x03䬳\x03餩\x03馧\x03駂\x03駾\x03䯎\x03鬒\x03鱀\x03鳽\x03䳎\x03䳭\x03" + "鵧\x03䳸\x03麻\x03䵖\x03黹\x03黾\x03鼅\x03鼏\x03鼖\x03鼻" var xorData string = "" + // Size: 4855 bytes "\x02\x0c\x09\x02\xb0\xec\x02\xad\xd8\x02\xad\xd9\x02\x06\x07\x02\x0f\x12" + "\x02\x0f\x1f\x02\x0f\x1d\x02\x01\x13\x02\x0f\x16\x02\x0f\x0b\x02\x0f3" + "\x02\x0f7\x02\x0f?\x02\x0f/\x02\x0f*\x02\x0c&\x02\x0c*\x02\x0c;\x02\x0c9" + "\x02\x0c%\x02\xab\xed\x02\xab\xe2\x02\xab\xe3\x02\xa9\xe0\x02\xa9\xe1" + "\x02\xa9\xe6\x02\xa3\xcb\x02\xa3\xc8\x02\xa3\xc9\x02\x01#\x02\x01\x08" + "\x02\x0e>\x02\x0e'\x02\x0f\x03\x02\x03\x0d\x02\x03\x09\x02\x03\x17\x02" + "\x03\x0e\x02\x02\x03\x02\x011\x02\x01\x00\x02\x01\x10\x02\x03<\x02\x07" + "\x0d\x02\x02\x0c\x02\x0c0\x02\x01\x03\x02\x01\x01\x02\x01 \x02\x01\x22" + "\x02\x01)\x02\x01\x0a\x02\x01\x0c\x02\x02\x06\x02\x02\x02\x02\x03\x10" + "\x03\x037 \x03\x0b+\x03\x02\x01\x04\x02\x01\x02\x02\x019\x02\x03\x1c\x02" + "\x02$\x03\x80p$\x02\x03:\x02\x03\x0a\x03\xc1r.\x03\xc1r,\x03\xc1r\x02" + "\x02\x02:\x02\x02>\x02\x02,\x02\x02\x10\x02\x02\x00\x03\xc1s<\x03\xc1s*" + "\x03\xc2L$\x03\xc2L;\x02\x09)\x02\x0a\x19\x03\x83\xab\xe3\x03\x83\xab" + "\xf2\x03 4\xe0\x03\x81\xab\xea\x03\x81\xab\xf3\x03 4\xef\x03\x96\xe1\xcd" + "\x03\x84\xe5\xc3\x02\x0d\x11\x03\x8b\xec\xcb\x03\x94\xec\xcf\x03\x9a\xec" + "\xc2\x03\x8b\xec\xdb\x03\x94\xec\xdf\x03\x9a\xec\xd2\x03\x01\x0c!\x03" + "\x01\x0c#\x03ʠ\x9d\x03ʣ\x9c\x03ʢ\x9f\x03ʥ\x9e\x03ʤ\x91\x03ʧ\x90\x03ʦ\x93" + "\x03ʩ\x92\x03ʨ\x95\x03\xca\xf3\xb5\x03\xca\xf0\xb4\x03\xca\xf1\xb7\x03" + "\xca\xf6\xb6\x03\xca\xf7\x89\x03\xca\xf4\x88\x03\xca\xf5\x8b\x03\xca\xfa" + "\x8a\x03\xca\xfb\x8d\x03\xca\xf8\x8c\x03\xca\xf9\x8f\x03\xca\xfe\x8e\x03" + "\xca\xff\x81\x03\xca\xfc\x80\x03\xca\xfd\x83\x03\xca\xe2\x82\x03\xca\xe3" + "\x85\x03\xca\xe0\x84\x03\xca\xe1\x87\x03\xca\xe6\x86\x03\xca\xe7\x99\x03" + "\xca\xe4\x98\x03\xca\xe5\x9b\x03\xca\xea\x9a\x03\xca\xeb\x9d\x03\xca\xe8" + "\x9c\x03ؓ\x89\x03ߔ\x8b\x02\x010\x03\x03\x04\x1e\x03\x04\x15\x12\x03\x0b" + "\x05,\x03\x06\x04\x00\x03\x06\x04)\x03\x06\x044\x03\x06\x04<\x03\x06\x05" + "\x1d\x03\x06\x06\x00\x03\x06\x06\x0a\x03\x06\x06'\x03\x06\x062\x03\x0786" + "\x03\x079/\x03\x079 \x03\x07:\x0e\x03\x07:\x1b\x03\x07:%\x03\x07;/\x03" + "\x07;%\x03\x074\x11\x03\x076\x09\x03\x077*\x03\x070\x01\x03\x070\x0f\x03" + "\x070.\x03\x071\x16\x03\x071\x04\x03\x0710\x03\x072\x18\x03\x072-\x03" + "\x073\x14\x03\x073>\x03\x07'\x09\x03\x07 \x00\x03\x07\x1f\x0b\x03\x07" + "\x18#\x03\x07\x18(\x03\x07\x186\x03\x07\x18\x03\x03\x07\x19\x16\x03\x07" + "\x116\x03\x07\x12'\x03\x07\x13\x10\x03\x07\x0c&\x03\x07\x0c\x08\x03\x07" + "\x0c\x13\x03\x07\x0d\x02\x03\x07\x0d\x1c\x03\x07\x0b5\x03\x07\x0b\x0a" + "\x03\x07\x0b\x01\x03\x07\x0b\x0f\x03\x07\x05\x00\x03\x07\x05\x09\x03\x07" + "\x05\x0b\x03\x07\x07\x01\x03\x07\x07\x08\x03\x07\x00<\x03\x07\x00+\x03" + "\x07\x01)\x03\x07\x01\x1b\x03\x07\x01\x08\x03\x07\x03?\x03\x0445\x03\x04" + "4\x08\x03\x0454\x03\x04)/\x03\x04)5\x03\x04+\x05\x03\x04+\x14\x03\x04+ " + "\x03\x04+<\x03\x04*&\x03\x04*\x22\x03\x04&8\x03\x04!\x01\x03\x04!\x22" + "\x03\x04\x11+\x03\x04\x10.\x03\x04\x104\x03\x04\x13=\x03\x04\x12\x04\x03" + "\x04\x12\x0a\x03\x04\x0d\x1d\x03\x04\x0d\x07\x03\x04\x0d \x03\x05<>\x03" + "\x055<\x03\x055!\x03\x055#\x03\x055&\x03\x054\x1d\x03\x054\x02\x03\x054" + "\x07\x03\x0571\x03\x053\x1a\x03\x053\x16\x03\x05.<\x03\x05.\x07\x03\x05)" + ":\x03\x05)<\x03\x05)\x0c\x03\x05)\x15\x03\x05+-\x03\x05+5\x03\x05$\x1e" + "\x03\x05$\x14\x03\x05'\x04\x03\x05'\x14\x03\x05&\x02\x03\x05\x226\x03" + "\x05\x22\x0c\x03\x05\x22\x1c\x03\x05\x19\x0a\x03\x05\x1b\x09\x03\x05\x1b" + "\x0c\x03\x05\x14\x07\x03\x05\x16?\x03\x05\x16\x0c\x03\x05\x0c\x05\x03" + "\x05\x0e\x0f\x03\x05\x01\x0e\x03\x05\x00(\x03\x05\x030\x03\x05\x03\x06" + "\x03\x0a==\x03\x0a=1\x03\x0a=,\x03\x0a=\x0c\x03\x0a??\x03\x0a<\x08\x03" + "\x0a9!\x03\x0a9)\x03\x0a97\x03\x0a99\x03\x0a6\x0a\x03\x0a6\x1c\x03\x0a6" + "\x17\x03\x0a7'\x03\x0a78\x03\x0a73\x03\x0a'\x01\x03\x0a'&\x03\x0a\x1f" + "\x0e\x03\x0a\x1f\x03\x03\x0a\x1f3\x03\x0a\x1b/\x03\x0a\x18\x19\x03\x0a" + "\x19\x01\x03\x0a\x16\x14\x03\x0a\x0e\x22\x03\x0a\x0f\x10\x03\x0a\x0f\x02" + "\x03\x0a\x0f \x03\x0a\x0c\x04\x03\x0a\x0b>\x03\x0a\x0b+\x03\x0a\x08/\x03" + "\x0a\x046\x03\x0a\x05\x14\x03\x0a\x00\x04\x03\x0a\x00\x10\x03\x0a\x00" + "\x14\x03\x0b<3\x03\x0b;*\x03\x0b9\x22\x03\x0b9)\x03\x0b97\x03\x0b+\x10" + "\x03\x0b((\x03\x0b&5\x03\x0b$\x1c\x03\x0b$\x12\x03\x0b%\x04\x03\x0b#<" + "\x03\x0b#0\x03\x0b#\x0d\x03\x0b#\x19\x03\x0b!:\x03\x0b!\x1f\x03\x0b!\x00" + "\x03\x0b\x1e5\x03\x0b\x1c\x1d\x03\x0b\x1d-\x03\x0b\x1d(\x03\x0b\x18.\x03" + "\x0b\x18 \x03\x0b\x18\x16\x03\x0b\x14\x13\x03\x0b\x15$\x03\x0b\x15\x22" + "\x03\x0b\x12\x1b\x03\x0b\x12\x10\x03\x0b\x132\x03\x0b\x13=\x03\x0b\x12" + "\x18\x03\x0b\x0c&\x03\x0b\x061\x03\x0b\x06:\x03\x0b\x05#\x03\x0b\x05<" + "\x03\x0b\x04\x0b\x03\x0b\x04\x04\x03\x0b\x04\x1b\x03\x0b\x042\x03\x0b" + "\x041\x03\x0b\x03\x03\x03\x0b\x03\x1d\x03\x0b\x03/\x03\x0b\x03+\x03\x0b" + "\x02\x1b\x03\x0b\x02\x00\x03\x0b\x01\x1e\x03\x0b\x01\x08\x03\x0b\x015" + "\x03\x06\x0d9\x03\x06\x0d=\x03\x06\x0d?\x03\x02\x001\x03\x02\x003\x03" + "\x02\x02\x19\x03\x02\x006\x03\x02\x02\x1b\x03\x02\x004\x03\x02\x00<\x03" + "\x02\x02\x0a\x03\x02\x02\x0e\x03\x02\x01\x1a\x03\x02\x01\x07\x03\x02\x01" + "\x05\x03\x02\x01\x0b\x03\x02\x01%\x03\x02\x01\x0c\x03\x02\x01\x04\x03" + "\x02\x01\x1c\x03\x02\x00.\x03\x02\x002\x03\x02\x00>\x03\x02\x00\x12\x03" + "\x02\x00\x16\x03\x02\x011\x03\x02\x013\x03\x02\x02 \x03\x02\x02%\x03\x02" + "\x02$\x03\x02\x028\x03\x02\x02;\x03\x02\x024\x03\x02\x012\x03\x02\x022" + "\x03\x02\x02/\x03\x02\x01,\x03\x02\x01\x13\x03\x02\x01\x16\x03\x02\x01" + "\x11\x03\x02\x01\x1e\x03\x02\x01\x15\x03\x02\x01\x17\x03\x02\x01\x0f\x03" + "\x02\x01\x08\x03\x02\x00?\x03\x02\x03\x07\x03\x02\x03\x0d\x03\x02\x03" + "\x13\x03\x02\x03\x1d\x03\x02\x03\x1f\x03\x02\x00\x03\x03\x02\x00\x0d\x03" + "\x02\x00\x01\x03\x02\x00\x1b\x03\x02\x00\x19\x03\x02\x00\x18\x03\x02\x00" + "\x13\x03\x02\x00/\x03\x07>\x12\x03\x07<\x1f\x03\x07>\x1d\x03\x06\x1d\x0e" + "\x03\x07>\x1c\x03\x07>:\x03\x07>\x13\x03\x04\x12+\x03\x07?\x03\x03\x07>" + "\x02\x03\x06\x224\x03\x06\x1a.\x03\x07<%\x03\x06\x1c\x0b\x03\x0609\x03" + "\x05\x1f\x01\x03\x04'\x08\x03\x93\xfd\xf5\x03\x02\x0d \x03\x02\x0d#\x03" + "\x02\x0d!\x03\x02\x0d&\x03\x02\x0d\x22\x03\x02\x0d/\x03\x02\x0d,\x03\x02" + "\x0d$\x03\x02\x0d'\x03\x02\x0d%\x03\x02\x0d;\x03\x02\x0d=\x03\x02\x0d?" + "\x03\x099.\x03\x08\x0b7\x03\x08\x02\x14\x03\x08\x14\x0d\x03\x08.:\x03" + "\x089'\x03\x0f\x0b\x18\x03\x0f\x1c1\x03\x0f\x17&\x03\x0f9\x1f\x03\x0f0" + "\x0c\x03\x0e\x0a9\x03\x0e\x056\x03\x0e\x1c#\x03\x0f\x13\x0e\x03\x072\x00" + "\x03\x070\x0d\x03\x072\x0b\x03\x06\x11\x18\x03\x070\x10\x03\x06\x0f(\x03" + "\x072\x05\x03\x06\x0f,\x03\x073\x15\x03\x06\x07\x08\x03\x05\x16\x02\x03" + "\x04\x0b \x03\x05:8\x03\x05\x16%\x03\x0a\x0d\x1f\x03\x06\x16\x10\x03\x05" + "\x1d5\x03\x05*;\x03\x05\x16\x1b\x03\x04.-\x03\x06\x1a\x19\x03\x04\x03," + "\x03\x0b87\x03\x04/\x0a\x03\x06\x00,\x03\x04-\x01\x03\x04\x1e-\x03\x06/(" + "\x03\x0a\x0b5\x03\x06\x0e7\x03\x06\x07.\x03\x0597\x03\x0a*%\x03\x0760" + "\x03\x06\x0c;\x03\x05'\x00\x03\x072.\x03\x072\x08\x03\x06=\x01\x03\x06" + "\x05\x1b\x03\x06\x06\x12\x03\x06$=\x03\x06'\x0d\x03\x04\x11\x0f\x03\x076" + ",\x03\x06\x07;\x03\x06.,\x03\x86\xf9\xea\x03\x8f\xff\xeb\x02\x092\x02" + "\x095\x02\x094\x02\x09;\x02\x09>\x02\x098\x02\x09*\x02\x09/\x02\x09,\x02" + "\x09%\x02\x09&\x02\x09#\x02\x09 \x02\x08!\x02\x08%\x02\x08$\x02\x08+\x02" + "\x08.\x02\x08*\x02\x08&\x02\x088\x02\x08>\x02\x084\x02\x086\x02\x080\x02" + "\x08\x10\x02\x08\x17\x02\x08\x12\x02\x08\x1d\x02\x08\x1f\x02\x08\x13\x02" + "\x08\x15\x02\x08\x14\x02\x08\x0c\x03\x8b\xfd\xd0\x03\x81\xec\xc6\x03\x87" + "\xe0\x8a\x03-2\xe3\x03\x80\xef\xe4\x03-2\xea\x03\x88\xe6\xeb\x03\x8e\xe6" + "\xe8\x03\x84\xe6\xe9\x03\x97\xe6\xee\x03-2\xf9\x03-2\xf6\x03\x8e\xe3\xad" + "\x03\x80\xe3\x92\x03\x88\xe3\x90\x03\x8e\xe3\x90\x03\x80\xe3\x97\x03\x88" + "\xe3\x95\x03\x88\xfe\xcb\x03\x8e\xfe\xca\x03\x84\xfe\xcd\x03\x91\xef\xc9" + "\x03-2\xc1\x03-2\xc0\x03-2\xcb\x03\x88@\x09\x03\x8e@\x08\x03\x8f\xe0\xf5" + "\x03\x8e\xe6\xf9\x03\x8e\xe0\xfa\x03\x93\xff\xf4\x03\x84\xee\xd3\x03\x0b" + "(\x04\x023 \x021;\x02\x01*\x03\x0b#\x10\x03\x0b 0\x03\x0b!\x10\x03\x0b!0" + "\x03\x07\x15\x08\x03\x09?5\x03\x07\x1f\x08\x03\x07\x17\x0b\x03\x09\x1f" + "\x15\x03\x0b\x1c7\x03\x0a+#\x03\x06\x1a\x1b\x03\x06\x1a\x14\x03\x0a\x01" + "\x18\x03\x06#\x1b\x03\x0a2\x0c\x03\x0a\x01\x04\x03\x09#;\x03\x08='\x03" + "\x08\x1a\x0a\x03\x07\x03\x0a\x111\x03\x09\x1b\x09\x03\x073.\x03\x07\x01\x00" + "\x03\x09/,\x03\x07#>\x03\x07\x048\x03\x0a\x1f\x22\x03\x098>\x03\x09\x11" + "\x00\x03\x08/\x17\x03\x06'\x22\x03\x0b\x1a+\x03\x0a\x22\x19\x03\x0a/1" + "\x03\x0974\x03\x09\x0f\x22\x03\x08,\x22\x03\x08?\x14\x03\x07$5\x03\x07<3" + "\x03\x07=*\x03\x07\x13\x18\x03\x068\x0a\x03\x06\x09\x16\x03\x06\x13\x00" + "\x03\x08\x067\x03\x08\x01\x03\x03\x08\x12\x1d\x03\x07+7\x03\x06(;\x03" + "\x06\x1c?\x03\x07\x0e\x17\x03\x0a\x06\x1d\x03\x0a\x19\x07\x03\x08\x14$" + "\x03\x07$;\x03\x08,$\x03\x08\x06\x0d\x03\x07\x16\x0a\x03\x06>>\x03\x0a" + "\x06\x12\x03\x0a\x14)\x03\x09\x0d\x1f\x03\x09\x12\x17\x03\x09\x19\x01" + "\x03\x08\x11 \x03\x08\x1d'\x03\x06<\x1a\x03\x0a.\x00\x03\x07'\x18\x03" + "\x0a\x22\x08\x03\x08\x0d\x0a\x03\x08\x13)\x03\x07*)\x03\x06<,\x03\x07" + "\x0b\x1a\x03\x09.\x14\x03\x09\x0d\x1e\x03\x07\x0e#\x03\x0b\x1d'\x03\x0a" + "\x0a8\x03\x09%2\x03\x08+&\x03\x080\x12\x03\x0a)4\x03\x08\x06\x1f\x03\x0b" + "\x1b\x1a\x03\x0a\x1b\x0f\x03\x0b\x1d*\x03\x09\x16$\x03\x090\x11\x03\x08" + "\x11\x08\x03\x0a*(\x03\x0a\x042\x03\x089,\x03\x074'\x03\x07\x0f\x05\x03" + "\x09\x0b\x0a\x03\x07\x1b\x01\x03\x09\x17:\x03\x09.\x0d\x03\x07.\x11\x03" + "\x09+\x15\x03\x080\x13\x03\x0b\x1f\x19\x03\x0a \x11\x03\x0a\x220\x03\x09" + "\x07;\x03\x08\x16\x1c\x03\x07,\x13\x03\x07\x0e/\x03\x06\x221\x03\x0a." + "\x0a\x03\x0a7\x02\x03\x0a\x032\x03\x0a\x1d.\x03\x091\x06\x03\x09\x19:" + "\x03\x08\x02/\x03\x060+\x03\x06\x0f-\x03\x06\x1c\x1f\x03\x06\x1d\x07\x03" + "\x0a,\x11\x03\x09=\x0d\x03\x09\x0b;\x03\x07\x1b/\x03\x0a\x1f:\x03\x09 " + "\x1f\x03\x09.\x10\x03\x094\x0b\x03\x09\x1a1\x03\x08#\x1a\x03\x084\x1d" + "\x03\x08\x01\x1f\x03\x08\x11\x22\x03\x07'8\x03\x07\x1a>\x03\x0757\x03" + "\x06&9\x03\x06+\x11\x03\x0a.\x0b\x03\x0a,>\x03\x0a4#\x03\x08%\x17\x03" + "\x07\x05\x22\x03\x07\x0c\x0b\x03\x0a\x1d+\x03\x0a\x19\x16\x03\x09+\x1f" + "\x03\x09\x08\x0b\x03\x08\x16\x18\x03\x08+\x12\x03\x0b\x1d\x0c\x03\x0a=" + "\x10\x03\x0a\x09\x0d\x03\x0a\x10\x11\x03\x09&0\x03\x08(\x1f\x03\x087\x07" + "\x03\x08\x185\x03\x07'6\x03\x06.\x05\x03\x06=\x04\x03\x06;;\x03\x06\x06," + "\x03\x0b\x18>\x03\x08\x00\x18\x03\x06 \x03\x03\x06<\x00\x03\x09%\x18\x03" + "\x0b\x1c<\x03\x0a%!\x03\x0a\x09\x12\x03\x0a\x16\x02\x03\x090'\x03\x09" + "\x0e=\x03\x08 \x0e\x03\x08>\x03\x03\x074>\x03\x06&?\x03\x06\x19\x09\x03" + "\x06?(\x03\x0a-\x0e\x03\x09:3\x03\x098:\x03\x09\x12\x0b\x03\x09\x1d\x17" + "\x03\x087\x05\x03\x082\x14\x03\x08\x06%\x03\x08\x13\x1f\x03\x06\x06\x0e" + "\x03\x0a\x22<\x03\x09/<\x03\x06>+\x03\x0a'?\x03\x0a\x13\x0c\x03\x09\x10<" + "\x03\x07\x1b=\x03\x0a\x19\x13\x03\x09\x22\x1d\x03\x09\x07\x0d\x03\x08)" + "\x1c\x03\x06=\x1a\x03\x0a/4\x03\x0a7\x11\x03\x0a\x16:\x03\x09?3\x03\x09:" + "/\x03\x09\x05\x0a\x03\x09\x14\x06\x03\x087\x22\x03\x080\x07\x03\x08\x1a" + "\x1f\x03\x07\x04(\x03\x07\x04\x09\x03\x06 %\x03\x06<\x08\x03\x0a+\x14" + "\x03\x09\x1d\x16\x03\x0a70\x03\x08 >\x03\x0857\x03\x070\x0a\x03\x06=\x12" + "\x03\x06\x16%\x03\x06\x1d,\x03\x099#\x03\x09\x10>\x03\x07 \x1e\x03\x08" + "\x0c<\x03\x08\x0b\x18\x03\x08\x15+\x03\x08,:\x03\x08%\x22\x03\x07\x0a$" + "\x03\x0b\x1c=\x03\x07+\x08\x03\x0a/\x05\x03\x0a \x07\x03\x0a\x12'\x03" + "\x09#\x11\x03\x08\x1b\x15\x03\x0a\x06\x01\x03\x09\x1c\x1b\x03\x0922\x03" + "\x07\x14<\x03\x07\x09\x04\x03\x061\x04\x03\x07\x0e\x01\x03\x0a\x13\x18" + "\x03\x0a-\x0c\x03\x0a?\x0d\x03\x0a\x09\x0a\x03\x091&\x03\x0a/\x0b\x03" + "\x08$<\x03\x083\x1d\x03\x08\x0c$\x03\x08\x0d\x07\x03\x08\x0d?\x03\x08" + "\x0e\x14\x03\x065\x0a\x03\x08\x1a#\x03\x08\x16#\x03\x0702\x03\x07\x03" + "\x1a\x03\x06(\x1d\x03\x06+\x1b\x03\x06\x0b\x05\x03\x06\x0b\x17\x03\x06" + "\x0c\x04\x03\x06\x1e\x19\x03\x06+0\x03\x062\x18\x03\x0b\x16\x1e\x03\x0a+" + "\x16\x03\x0a-?\x03\x0a#:\x03\x0a#\x10\x03\x0a%$\x03\x0a>+\x03\x0a01\x03" + "\x0a1\x10\x03\x0a\x099\x03\x0a\x0a\x12\x03\x0a\x19\x1f\x03\x0a\x19\x12" + "\x03\x09*)\x03\x09-\x16\x03\x09.1\x03\x09.2\x03\x09<\x0e\x03\x09> \x03" + "\x093\x12\x03\x09\x0b\x01\x03\x09\x1c2\x03\x09\x11\x1c\x03\x09\x15%\x03" + "\x08,&\x03\x08!\x22\x03\x089(\x03\x08\x0b\x1a\x03\x08\x0d2\x03\x08\x0c" + "\x04\x03\x08\x0c\x06\x03\x08\x0c\x1f\x03\x08\x0c\x0c\x03\x08\x0f\x1f\x03" + "\x08\x0f\x1d\x03\x08\x00\x14\x03\x08\x03\x14\x03\x08\x06\x16\x03\x08\x1e" + "#\x03\x08\x11\x11\x03\x08\x10\x18\x03\x08\x14(\x03\x07)\x1e\x03\x07.1" + "\x03\x07 $\x03\x07 '\x03\x078\x08\x03\x07\x0d0\x03\x07\x0f7\x03\x07\x05#" + "\x03\x07\x05\x1a\x03\x07\x1a7\x03\x07\x1d-\x03\x07\x17\x10\x03\x06)\x1f" + "\x03\x062\x0b\x03\x066\x16\x03\x06\x09\x11\x03\x09(\x1e\x03\x07!5\x03" + "\x0b\x11\x16\x03\x0a/\x04\x03\x0a,\x1a\x03\x0b\x173\x03\x0a,1\x03\x0a/5" + "\x03\x0a\x221\x03\x0a\x22\x0d\x03\x0a?%\x03\x0a<,\x03\x0a?#\x03\x0a>\x19" + "\x03\x0a\x08&\x03\x0a\x0b\x0e\x03\x0a\x0c:\x03\x0a\x0c+\x03\x0a\x03\x22" + "\x03\x0a\x06)\x03\x0a\x11\x10\x03\x0a\x11\x1a\x03\x0a\x17-\x03\x0a\x14(" + "\x03\x09)\x1e\x03\x09/\x09\x03\x09.\x00\x03\x09,\x07\x03\x09/*\x03\x09-9" + "\x03\x09\x228\x03\x09%\x09\x03\x09:\x12\x03\x09;\x1d\x03\x09?\x06\x03" + "\x093%\x03\x096\x05\x03\x096\x08\x03\x097\x02\x03\x09\x07,\x03\x09\x04," + "\x03\x09\x1f\x16\x03\x09\x11\x03\x03\x09\x11\x12\x03\x09\x168\x03\x08*" + "\x05\x03\x08/2\x03\x084:\x03\x08\x22+\x03\x08 0\x03\x08&\x0a\x03\x08;" + "\x10\x03\x08>$\x03\x08>\x18\x03\x0829\x03\x082:\x03\x081,\x03\x081<\x03" + "\x081\x1c\x03\x087#\x03\x087*\x03\x08\x09'\x03\x08\x00\x1d\x03\x08\x05-" + "\x03\x08\x1f4\x03\x08\x1d\x04\x03\x08\x16\x0f\x03\x07*7\x03\x07'!\x03" + "\x07%\x1b\x03\x077\x0c\x03\x07\x0c1\x03\x07\x0c.\x03\x07\x00\x06\x03\x07" + "\x01\x02\x03\x07\x010\x03\x07\x06=\x03\x07\x01\x03\x03\x07\x01\x13\x03" + "\x07\x06\x06\x03\x07\x05\x0a\x03\x07\x1f\x09\x03\x07\x17:\x03\x06*1\x03" + "\x06-\x1d\x03\x06\x223\x03\x062:\x03\x060$\x03\x066\x1e\x03\x064\x12\x03" + "\x0645\x03\x06\x0b\x00\x03\x06\x0b7\x03\x06\x07\x1f\x03\x06\x15\x12\x03" + "\x0c\x05\x0f\x03\x0b+\x0b\x03\x0b+-\x03\x06\x16\x1b\x03\x06\x15\x17\x03" + "\x89\xca\xea\x03\x89\xca\xe8\x03\x0c8\x10\x03\x0c8\x01\x03\x0c8\x0f\x03" + "\x0d8%\x03\x0d8!\x03\x0c8-\x03\x0c8/\x03\x0c8+\x03\x0c87\x03\x0c85\x03" + "\x0c9\x09\x03\x0c9\x0d\x03\x0c9\x0f\x03\x0c9\x0b\x03\xcfu\x0c\x03\xcfu" + "\x0f\x03\xcfu\x0e\x03\xcfu\x09\x03\x0c9\x10\x03\x0d9\x0c\x03\xcf`;\x03" + "\xcf`>\x03\xcf`9\x03\xcf`8\x03\xcf`7\x03\xcf`*\x03\xcf`-\x03\xcf`,\x03" + "\x0d\x1b\x1a\x03\x0d\x1b&\x03\x0c=.\x03\x0c=%\x03\x0c>\x1e\x03\x0c>\x14" + "\x03\x0c?\x06\x03\x0c?\x0b\x03\x0c?\x0c\x03\x0c?\x0d\x03\x0c?\x02\x03" + "\x0c>\x0f\x03\x0c>\x08\x03\x0c>\x09\x03\x0c>,\x03\x0c>\x0c\x03\x0c?\x13" + "\x03\x0c?\x16\x03\x0c?\x15\x03\x0c?\x1c\x03\x0c?\x1f\x03\x0c?\x1d\x03" + "\x0c?\x1a\x03\x0c?\x17\x03\x0c?\x08\x03\x0c?\x09\x03\x0c?\x0e\x03\x0c?" + "\x04\x03\x0c?\x05\x03\x0c" + "\x03\x0c=2\x03\x0c=6\x03\x0c<\x07\x03\x0c<\x05\x03\x0e:!\x03\x0e:#\x03" + "\x0e8\x09\x03\x0e:&\x03\x0e8\x0b\x03\x0e:$\x03\x0e:,\x03\x0e8\x1a\x03" + "\x0e8\x1e\x03\x0e:*\x03\x0e:7\x03\x0e:5\x03\x0e:;\x03\x0e:\x15\x03\x0e:<" + "\x03\x0e:4\x03\x0e:'\x03\x0e:-\x03\x0e:%\x03\x0e:?\x03\x0e:=\x03\x0e:)" + "\x03\x0e:/\x03\xcfs'\x03\x0d=\x0f\x03\x0d+*\x03\x0d99\x03\x0d9;\x03\x0d9" + "?\x03\x0d)\x0d\x03\x0d(%\x02\x01\x18\x02\x01(\x02\x01\x1e\x03\x0f$!\x03" + "\x0f87\x03\x0f4\x0e\x03\x0f5\x1d\x03\x06'\x03\x03\x0f\x08\x18\x03\x0f" + "\x0d\x1b\x03\x0e2=\x03\x0e;\x08\x03\x0e:\x0b\x03\x0e\x06$\x03\x0e\x0d)" + "\x03\x0e\x16\x1f\x03\x0e\x16\x1b\x03\x0d$\x0a\x03\x05,\x1d\x03\x0d. \x03" + "\x0d.#\x03\x0c(/\x03\x09%\x02\x03\x0d90\x03\x0d\x0e4\x03\x0d\x0d\x0f\x03" + "\x0c#\x00\x03\x0c,\x1e\x03\x0c2\x0e\x03\x0c\x01\x17\x03\x0c\x09:\x03\x0e" + "\x173\x03\x0c\x08\x03\x03\x0c\x11\x07\x03\x0c\x10\x18\x03\x0c\x1f\x1c" + "\x03\x0c\x19\x0e\x03\x0c\x1a\x1f\x03\x0f0>\x03\x0b->\x03\x0b<+\x03\x0b8" + "\x13\x03\x0b\x043\x03\x0b\x14\x03\x03\x0b\x16%\x03\x0d\x22&\x03\x0b\x1a" + "\x1a\x03\x0b\x1a\x04\x03\x0a%9\x03\x0a&2\x03\x0a&0\x03\x0a!\x1a\x03\x0a!" + "7\x03\x0a5\x10\x03\x0a=4\x03\x0a?\x0e\x03\x0a>\x10\x03\x0a\x00 \x03\x0a" + "\x0f:\x03\x0a\x0f9\x03\x0a\x0b\x0a\x03\x0a\x17%\x03\x0a\x1b-\x03\x09-" + "\x1a\x03\x09,4\x03\x09.,\x03\x09)\x09\x03\x096!\x03\x091\x1f\x03\x093" + "\x16\x03\x0c+\x1f\x03\x098 \x03\x098=\x03\x0c(\x1a\x03\x0c(\x16\x03\x09" + "\x0a+\x03\x09\x16\x12\x03\x09\x13\x0e\x03\x09\x153\x03\x08)!\x03\x09\x1a" + "\x01\x03\x09\x18\x01\x03\x08%#\x03\x08>\x22\x03\x08\x05%\x03\x08\x02*" + "\x03\x08\x15;\x03\x08\x1b7\x03\x0f\x07\x1d\x03\x0f\x04\x03\x03\x070\x0c" + "\x03\x07;\x0b\x03\x07\x08\x17\x03\x07\x12\x06\x03\x06/-\x03\x0671\x03" + "\x065+\x03\x06>7\x03\x06\x049\x03\x05+\x1e\x03\x05,\x17\x03\x05 \x1d\x03" + "\x05\x22\x05\x03\x050\x1d" // lookup returns the trie value for the first UTF-8 encoding in s and // the width in bytes of this encoding. The size will be 0 if s does not // hold enough bytes to complete the encoding. len(s) must be greater than 0. func (t *idnaTrie) lookup(s []byte) (v uint16, sz int) { c0 := s[0] switch { case c0 < 0x80: // is ASCII return idnaValues[c0], 1 case c0 < 0xC2: return 0, 1 // Illegal UTF-8: not a starter, not ASCII. case c0 < 0xE0: // 2-byte UTF-8 if len(s) < 2 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c1), 2 case c0 < 0xF0: // 3-byte UTF-8 if len(s) < 3 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = idnaIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c2), 3 case c0 < 0xF8: // 4-byte UTF-8 if len(s) < 4 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = idnaIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } o = uint32(i)<<6 + uint32(c2) i = idnaIndex[o] c3 := s[3] if c3 < 0x80 || 0xC0 <= c3 { return 0, 3 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c3), 4 } // Illegal rune return 0, 1 } // lookupUnsafe returns the trie value for the first UTF-8 encoding in s. // s must start with a full and valid UTF-8 encoded rune. func (t *idnaTrie) lookupUnsafe(s []byte) uint16 { c0 := s[0] if c0 < 0x80 { // is ASCII return idnaValues[c0] } i := idnaIndex[c0] if c0 < 0xE0 { // 2-byte UTF-8 return t.lookupValue(uint32(i), s[1]) } i = idnaIndex[uint32(i)<<6+uint32(s[1])] if c0 < 0xF0 { // 3-byte UTF-8 return t.lookupValue(uint32(i), s[2]) } i = idnaIndex[uint32(i)<<6+uint32(s[2])] if c0 < 0xF8 { // 4-byte UTF-8 return t.lookupValue(uint32(i), s[3]) } return 0 } // lookupString returns the trie value for the first UTF-8 encoding in s and // the width in bytes of this encoding. The size will be 0 if s does not // hold enough bytes to complete the encoding. len(s) must be greater than 0. func (t *idnaTrie) lookupString(s string) (v uint16, sz int) { c0 := s[0] switch { case c0 < 0x80: // is ASCII return idnaValues[c0], 1 case c0 < 0xC2: return 0, 1 // Illegal UTF-8: not a starter, not ASCII. case c0 < 0xE0: // 2-byte UTF-8 if len(s) < 2 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c1), 2 case c0 < 0xF0: // 3-byte UTF-8 if len(s) < 3 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = idnaIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c2), 3 case c0 < 0xF8: // 4-byte UTF-8 if len(s) < 4 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = idnaIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } o = uint32(i)<<6 + uint32(c2) i = idnaIndex[o] c3 := s[3] if c3 < 0x80 || 0xC0 <= c3 { return 0, 3 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c3), 4 } // Illegal rune return 0, 1 } // lookupStringUnsafe returns the trie value for the first UTF-8 encoding in s. // s must start with a full and valid UTF-8 encoded rune. func (t *idnaTrie) lookupStringUnsafe(s string) uint16 { c0 := s[0] if c0 < 0x80 { // is ASCII return idnaValues[c0] } i := idnaIndex[c0] if c0 < 0xE0 { // 2-byte UTF-8 return t.lookupValue(uint32(i), s[1]) } i = idnaIndex[uint32(i)<<6+uint32(s[1])] if c0 < 0xF0 { // 3-byte UTF-8 return t.lookupValue(uint32(i), s[2]) } i = idnaIndex[uint32(i)<<6+uint32(s[2])] if c0 < 0xF8 { // 4-byte UTF-8 return t.lookupValue(uint32(i), s[3]) } return 0 } // idnaTrie. Total size: 28600 bytes (27.93 KiB). Checksum: 95575047b5d8fff. type idnaTrie struct{} func newIdnaTrie(i int) *idnaTrie { return &idnaTrie{} } // lookupValue determines the type of block n and looks up the value for b. func (t *idnaTrie) lookupValue(n uint32, b byte) uint16 { switch { case n < 124: return uint16(idnaValues[n<<6+uint32(b)]) default: n -= 124 return uint16(idnaSparse.lookup(n, b)) } } // idnaValues: 126 blocks, 8064 entries, 16128 bytes // The third block is the zero block. var idnaValues = [8064]uint16{ // Block 0x0, offset 0x0 0x00: 0x0080, 0x01: 0x0080, 0x02: 0x0080, 0x03: 0x0080, 0x04: 0x0080, 0x05: 0x0080, 0x06: 0x0080, 0x07: 0x0080, 0x08: 0x0080, 0x09: 0x0080, 0x0a: 0x0080, 0x0b: 0x0080, 0x0c: 0x0080, 0x0d: 0x0080, 0x0e: 0x0080, 0x0f: 0x0080, 0x10: 0x0080, 0x11: 0x0080, 0x12: 0x0080, 0x13: 0x0080, 0x14: 0x0080, 0x15: 0x0080, 0x16: 0x0080, 0x17: 0x0080, 0x18: 0x0080, 0x19: 0x0080, 0x1a: 0x0080, 0x1b: 0x0080, 0x1c: 0x0080, 0x1d: 0x0080, 0x1e: 0x0080, 0x1f: 0x0080, 0x20: 0x0080, 0x21: 0x0080, 0x22: 0x0080, 0x23: 0x0080, 0x24: 0x0080, 0x25: 0x0080, 0x26: 0x0080, 0x27: 0x0080, 0x28: 0x0080, 0x29: 0x0080, 0x2a: 0x0080, 0x2b: 0x0080, 0x2c: 0x0080, 0x2d: 0x0008, 0x2e: 0x0008, 0x2f: 0x0080, 0x30: 0x0008, 0x31: 0x0008, 0x32: 0x0008, 0x33: 0x0008, 0x34: 0x0008, 0x35: 0x0008, 0x36: 0x0008, 0x37: 0x0008, 0x38: 0x0008, 0x39: 0x0008, 0x3a: 0x0080, 0x3b: 0x0080, 0x3c: 0x0080, 0x3d: 0x0080, 0x3e: 0x0080, 0x3f: 0x0080, // Block 0x1, offset 0x40 0x40: 0x0080, 0x41: 0xe105, 0x42: 0xe105, 0x43: 0xe105, 0x44: 0xe105, 0x45: 0xe105, 0x46: 0xe105, 0x47: 0xe105, 0x48: 0xe105, 0x49: 0xe105, 0x4a: 0xe105, 0x4b: 0xe105, 0x4c: 0xe105, 0x4d: 0xe105, 0x4e: 0xe105, 0x4f: 0xe105, 0x50: 0xe105, 0x51: 0xe105, 0x52: 0xe105, 0x53: 0xe105, 0x54: 0xe105, 0x55: 0xe105, 0x56: 0xe105, 0x57: 0xe105, 0x58: 0xe105, 0x59: 0xe105, 0x5a: 0xe105, 0x5b: 0x0080, 0x5c: 0x0080, 0x5d: 0x0080, 0x5e: 0x0080, 0x5f: 0x0080, 0x60: 0x0080, 0x61: 0x0008, 0x62: 0x0008, 0x63: 0x0008, 0x64: 0x0008, 0x65: 0x0008, 0x66: 0x0008, 0x67: 0x0008, 0x68: 0x0008, 0x69: 0x0008, 0x6a: 0x0008, 0x6b: 0x0008, 0x6c: 0x0008, 0x6d: 0x0008, 0x6e: 0x0008, 0x6f: 0x0008, 0x70: 0x0008, 0x71: 0x0008, 0x72: 0x0008, 0x73: 0x0008, 0x74: 0x0008, 0x75: 0x0008, 0x76: 0x0008, 0x77: 0x0008, 0x78: 0x0008, 0x79: 0x0008, 0x7a: 0x0008, 0x7b: 0x0080, 0x7c: 0x0080, 0x7d: 0x0080, 0x7e: 0x0080, 0x7f: 0x0080, // Block 0x2, offset 0x80 // Block 0x3, offset 0xc0 0xc0: 0x0040, 0xc1: 0x0040, 0xc2: 0x0040, 0xc3: 0x0040, 0xc4: 0x0040, 0xc5: 0x0040, 0xc6: 0x0040, 0xc7: 0x0040, 0xc8: 0x0040, 0xc9: 0x0040, 0xca: 0x0040, 0xcb: 0x0040, 0xcc: 0x0040, 0xcd: 0x0040, 0xce: 0x0040, 0xcf: 0x0040, 0xd0: 0x0040, 0xd1: 0x0040, 0xd2: 0x0040, 0xd3: 0x0040, 0xd4: 0x0040, 0xd5: 0x0040, 0xd6: 0x0040, 0xd7: 0x0040, 0xd8: 0x0040, 0xd9: 0x0040, 0xda: 0x0040, 0xdb: 0x0040, 0xdc: 0x0040, 0xdd: 0x0040, 0xde: 0x0040, 0xdf: 0x0040, 0xe0: 0x000a, 0xe1: 0x0018, 0xe2: 0x0018, 0xe3: 0x0018, 0xe4: 0x0018, 0xe5: 0x0018, 0xe6: 0x0018, 0xe7: 0x0018, 0xe8: 0x001a, 0xe9: 0x0018, 0xea: 0x0039, 0xeb: 0x0018, 0xec: 0x0018, 0xed: 0x03c0, 0xee: 0x0018, 0xef: 0x004a, 0xf0: 0x0018, 0xf1: 0x0018, 0xf2: 0x0069, 0xf3: 0x0079, 0xf4: 0x008a, 0xf5: 0x0005, 0xf6: 0x0018, 0xf7: 0x0008, 0xf8: 0x00aa, 0xf9: 0x00c9, 0xfa: 0x00d9, 0xfb: 0x0018, 0xfc: 0x00e9, 0xfd: 0x0119, 0xfe: 0x0149, 0xff: 0x0018, // Block 0x4, offset 0x100 0x100: 0xe00d, 0x101: 0x0008, 0x102: 0xe00d, 0x103: 0x0008, 0x104: 0xe00d, 0x105: 0x0008, 0x106: 0xe00d, 0x107: 0x0008, 0x108: 0xe00d, 0x109: 0x0008, 0x10a: 0xe00d, 0x10b: 0x0008, 0x10c: 0xe00d, 0x10d: 0x0008, 0x10e: 0xe00d, 0x10f: 0x0008, 0x110: 0xe00d, 0x111: 0x0008, 0x112: 0xe00d, 0x113: 0x0008, 0x114: 0xe00d, 0x115: 0x0008, 0x116: 0xe00d, 0x117: 0x0008, 0x118: 0xe00d, 0x119: 0x0008, 0x11a: 0xe00d, 0x11b: 0x0008, 0x11c: 0xe00d, 0x11d: 0x0008, 0x11e: 0xe00d, 0x11f: 0x0008, 0x120: 0xe00d, 0x121: 0x0008, 0x122: 0xe00d, 0x123: 0x0008, 0x124: 0xe00d, 0x125: 0x0008, 0x126: 0xe00d, 0x127: 0x0008, 0x128: 0xe00d, 0x129: 0x0008, 0x12a: 0xe00d, 0x12b: 0x0008, 0x12c: 0xe00d, 0x12d: 0x0008, 0x12e: 0xe00d, 0x12f: 0x0008, 0x130: 0x0179, 0x131: 0x0008, 0x132: 0x0035, 0x133: 0x004d, 0x134: 0xe00d, 0x135: 0x0008, 0x136: 0xe00d, 0x137: 0x0008, 0x138: 0x0008, 0x139: 0xe01d, 0x13a: 0x0008, 0x13b: 0xe03d, 0x13c: 0x0008, 0x13d: 0xe01d, 0x13e: 0x0008, 0x13f: 0x0199, // Block 0x5, offset 0x140 0x140: 0x0199, 0x141: 0xe01d, 0x142: 0x0008, 0x143: 0xe03d, 0x144: 0x0008, 0x145: 0xe01d, 0x146: 0x0008, 0x147: 0xe07d, 0x148: 0x0008, 0x149: 0x01b9, 0x14a: 0xe00d, 0x14b: 0x0008, 0x14c: 0xe00d, 0x14d: 0x0008, 0x14e: 0xe00d, 0x14f: 0x0008, 0x150: 0xe00d, 0x151: 0x0008, 0x152: 0xe00d, 0x153: 0x0008, 0x154: 0xe00d, 0x155: 0x0008, 0x156: 0xe00d, 0x157: 0x0008, 0x158: 0xe00d, 0x159: 0x0008, 0x15a: 0xe00d, 0x15b: 0x0008, 0x15c: 0xe00d, 0x15d: 0x0008, 0x15e: 0xe00d, 0x15f: 0x0008, 0x160: 0xe00d, 0x161: 0x0008, 0x162: 0xe00d, 0x163: 0x0008, 0x164: 0xe00d, 0x165: 0x0008, 0x166: 0xe00d, 0x167: 0x0008, 0x168: 0xe00d, 0x169: 0x0008, 0x16a: 0xe00d, 0x16b: 0x0008, 0x16c: 0xe00d, 0x16d: 0x0008, 0x16e: 0xe00d, 0x16f: 0x0008, 0x170: 0xe00d, 0x171: 0x0008, 0x172: 0xe00d, 0x173: 0x0008, 0x174: 0xe00d, 0x175: 0x0008, 0x176: 0xe00d, 0x177: 0x0008, 0x178: 0x0065, 0x179: 0xe01d, 0x17a: 0x0008, 0x17b: 0xe03d, 0x17c: 0x0008, 0x17d: 0xe01d, 0x17e: 0x0008, 0x17f: 0x01d9, // Block 0x6, offset 0x180 0x180: 0x0008, 0x181: 0x007d, 0x182: 0xe00d, 0x183: 0x0008, 0x184: 0xe00d, 0x185: 0x0008, 0x186: 0x007d, 0x187: 0xe07d, 0x188: 0x0008, 0x189: 0x0095, 0x18a: 0x00ad, 0x18b: 0xe03d, 0x18c: 0x0008, 0x18d: 0x0008, 0x18e: 0x00c5, 0x18f: 0x00dd, 0x190: 0x00f5, 0x191: 0xe01d, 0x192: 0x0008, 0x193: 0x010d, 0x194: 0x0125, 0x195: 0x0008, 0x196: 0x013d, 0x197: 0x013d, 0x198: 0xe00d, 0x199: 0x0008, 0x19a: 0x0008, 0x19b: 0x0008, 0x19c: 0x010d, 0x19d: 0x0155, 0x19e: 0x0008, 0x19f: 0x016d, 0x1a0: 0xe00d, 0x1a1: 0x0008, 0x1a2: 0xe00d, 0x1a3: 0x0008, 0x1a4: 0xe00d, 0x1a5: 0x0008, 0x1a6: 0x0185, 0x1a7: 0xe07d, 0x1a8: 0x0008, 0x1a9: 0x019d, 0x1aa: 0x0008, 0x1ab: 0x0008, 0x1ac: 0xe00d, 0x1ad: 0x0008, 0x1ae: 0x0185, 0x1af: 0xe0fd, 0x1b0: 0x0008, 0x1b1: 0x01b5, 0x1b2: 0x01cd, 0x1b3: 0xe03d, 0x1b4: 0x0008, 0x1b5: 0xe01d, 0x1b6: 0x0008, 0x1b7: 0x01e5, 0x1b8: 0xe00d, 0x1b9: 0x0008, 0x1ba: 0x0008, 0x1bb: 0x0008, 0x1bc: 0xe00d, 0x1bd: 0x0008, 0x1be: 0x0008, 0x1bf: 0x0008, // Block 0x7, offset 0x1c0 0x1c0: 0x0008, 0x1c1: 0x0008, 0x1c2: 0x0008, 0x1c3: 0x0008, 0x1c4: 0x01e9, 0x1c5: 0x01e9, 0x1c6: 0x01e9, 0x1c7: 0x01fd, 0x1c8: 0x0215, 0x1c9: 0x022d, 0x1ca: 0x0245, 0x1cb: 0x025d, 0x1cc: 0x0275, 0x1cd: 0xe01d, 0x1ce: 0x0008, 0x1cf: 0xe0fd, 0x1d0: 0x0008, 0x1d1: 0xe01d, 0x1d2: 0x0008, 0x1d3: 0xe03d, 0x1d4: 0x0008, 0x1d5: 0xe01d, 0x1d6: 0x0008, 0x1d7: 0xe07d, 0x1d8: 0x0008, 0x1d9: 0xe01d, 0x1da: 0x0008, 0x1db: 0xe03d, 0x1dc: 0x0008, 0x1dd: 0x0008, 0x1de: 0xe00d, 0x1df: 0x0008, 0x1e0: 0xe00d, 0x1e1: 0x0008, 0x1e2: 0xe00d, 0x1e3: 0x0008, 0x1e4: 0xe00d, 0x1e5: 0x0008, 0x1e6: 0xe00d, 0x1e7: 0x0008, 0x1e8: 0xe00d, 0x1e9: 0x0008, 0x1ea: 0xe00d, 0x1eb: 0x0008, 0x1ec: 0xe00d, 0x1ed: 0x0008, 0x1ee: 0xe00d, 0x1ef: 0x0008, 0x1f0: 0x0008, 0x1f1: 0x028d, 0x1f2: 0x02a5, 0x1f3: 0x02bd, 0x1f4: 0xe00d, 0x1f5: 0x0008, 0x1f6: 0x02d5, 0x1f7: 0x02ed, 0x1f8: 0xe00d, 0x1f9: 0x0008, 0x1fa: 0xe00d, 0x1fb: 0x0008, 0x1fc: 0xe00d, 0x1fd: 0x0008, 0x1fe: 0xe00d, 0x1ff: 0x0008, // Block 0x8, offset 0x200 0x200: 0xe00d, 0x201: 0x0008, 0x202: 0xe00d, 0x203: 0x0008, 0x204: 0xe00d, 0x205: 0x0008, 0x206: 0xe00d, 0x207: 0x0008, 0x208: 0xe00d, 0x209: 0x0008, 0x20a: 0xe00d, 0x20b: 0x0008, 0x20c: 0xe00d, 0x20d: 0x0008, 0x20e: 0xe00d, 0x20f: 0x0008, 0x210: 0xe00d, 0x211: 0x0008, 0x212: 0xe00d, 0x213: 0x0008, 0x214: 0xe00d, 0x215: 0x0008, 0x216: 0xe00d, 0x217: 0x0008, 0x218: 0xe00d, 0x219: 0x0008, 0x21a: 0xe00d, 0x21b: 0x0008, 0x21c: 0xe00d, 0x21d: 0x0008, 0x21e: 0xe00d, 0x21f: 0x0008, 0x220: 0x0305, 0x221: 0x0008, 0x222: 0xe00d, 0x223: 0x0008, 0x224: 0xe00d, 0x225: 0x0008, 0x226: 0xe00d, 0x227: 0x0008, 0x228: 0xe00d, 0x229: 0x0008, 0x22a: 0xe00d, 0x22b: 0x0008, 0x22c: 0xe00d, 0x22d: 0x0008, 0x22e: 0xe00d, 0x22f: 0x0008, 0x230: 0xe00d, 0x231: 0x0008, 0x232: 0xe00d, 0x233: 0x0008, 0x234: 0x0008, 0x235: 0x0008, 0x236: 0x0008, 0x237: 0x0008, 0x238: 0x0008, 0x239: 0x0008, 0x23a: 0x0209, 0x23b: 0xe03d, 0x23c: 0x0008, 0x23d: 0x031d, 0x23e: 0x0229, 0x23f: 0x0008, // Block 0x9, offset 0x240 0x240: 0x0008, 0x241: 0x0008, 0x242: 0x0018, 0x243: 0x0018, 0x244: 0x0018, 0x245: 0x0018, 0x246: 0x0008, 0x247: 0x0008, 0x248: 0x0008, 0x249: 0x0008, 0x24a: 0x0008, 0x24b: 0x0008, 0x24c: 0x0008, 0x24d: 0x0008, 0x24e: 0x0008, 0x24f: 0x0008, 0x250: 0x0008, 0x251: 0x0008, 0x252: 0x0018, 0x253: 0x0018, 0x254: 0x0018, 0x255: 0x0018, 0x256: 0x0018, 0x257: 0x0018, 0x258: 0x029a, 0x259: 0x02ba, 0x25a: 0x02da, 0x25b: 0x02fa, 0x25c: 0x031a, 0x25d: 0x033a, 0x25e: 0x0018, 0x25f: 0x0018, 0x260: 0x03ad, 0x261: 0x0359, 0x262: 0x01d9, 0x263: 0x0369, 0x264: 0x03c5, 0x265: 0x0018, 0x266: 0x0018, 0x267: 0x0018, 0x268: 0x0018, 0x269: 0x0018, 0x26a: 0x0018, 0x26b: 0x0018, 0x26c: 0x0008, 0x26d: 0x0018, 0x26e: 0x0008, 0x26f: 0x0018, 0x270: 0x0018, 0x271: 0x0018, 0x272: 0x0018, 0x273: 0x0018, 0x274: 0x0018, 0x275: 0x0018, 0x276: 0x0018, 0x277: 0x0018, 0x278: 0x0018, 0x279: 0x0018, 0x27a: 0x0018, 0x27b: 0x0018, 0x27c: 0x0018, 0x27d: 0x0018, 0x27e: 0x0018, 0x27f: 0x0018, // Block 0xa, offset 0x280 0x280: 0x03dd, 0x281: 0x03dd, 0x282: 0x3308, 0x283: 0x03f5, 0x284: 0x0379, 0x285: 0x040d, 0x286: 0x3308, 0x287: 0x3308, 0x288: 0x3308, 0x289: 0x3308, 0x28a: 0x3308, 0x28b: 0x3308, 0x28c: 0x3308, 0x28d: 0x3308, 0x28e: 0x3308, 0x28f: 0x33c0, 0x290: 0x3308, 0x291: 0x3308, 0x292: 0x3308, 0x293: 0x3308, 0x294: 0x3308, 0x295: 0x3308, 0x296: 0x3308, 0x297: 0x3308, 0x298: 0x3308, 0x299: 0x3308, 0x29a: 0x3308, 0x29b: 0x3308, 0x29c: 0x3308, 0x29d: 0x3308, 0x29e: 0x3308, 0x29f: 0x3308, 0x2a0: 0x3308, 0x2a1: 0x3308, 0x2a2: 0x3308, 0x2a3: 0x3308, 0x2a4: 0x3308, 0x2a5: 0x3308, 0x2a6: 0x3308, 0x2a7: 0x3308, 0x2a8: 0x3308, 0x2a9: 0x3308, 0x2aa: 0x3308, 0x2ab: 0x3308, 0x2ac: 0x3308, 0x2ad: 0x3308, 0x2ae: 0x3308, 0x2af: 0x3308, 0x2b0: 0xe00d, 0x2b1: 0x0008, 0x2b2: 0xe00d, 0x2b3: 0x0008, 0x2b4: 0x0425, 0x2b5: 0x0008, 0x2b6: 0xe00d, 0x2b7: 0x0008, 0x2b8: 0x0040, 0x2b9: 0x0040, 0x2ba: 0x03a2, 0x2bb: 0x0008, 0x2bc: 0x0008, 0x2bd: 0x0008, 0x2be: 0x03c2, 0x2bf: 0x043d, // Block 0xb, offset 0x2c0 0x2c0: 0x0040, 0x2c1: 0x0040, 0x2c2: 0x0040, 0x2c3: 0x0040, 0x2c4: 0x008a, 0x2c5: 0x03d2, 0x2c6: 0xe155, 0x2c7: 0x0455, 0x2c8: 0xe12d, 0x2c9: 0xe13d, 0x2ca: 0xe12d, 0x2cb: 0x0040, 0x2cc: 0x03dd, 0x2cd: 0x0040, 0x2ce: 0x046d, 0x2cf: 0x0485, 0x2d0: 0x0008, 0x2d1: 0xe105, 0x2d2: 0xe105, 0x2d3: 0xe105, 0x2d4: 0xe105, 0x2d5: 0xe105, 0x2d6: 0xe105, 0x2d7: 0xe105, 0x2d8: 0xe105, 0x2d9: 0xe105, 0x2da: 0xe105, 0x2db: 0xe105, 0x2dc: 0xe105, 0x2dd: 0xe105, 0x2de: 0xe105, 0x2df: 0xe105, 0x2e0: 0x049d, 0x2e1: 0x049d, 0x2e2: 0x0040, 0x2e3: 0x049d, 0x2e4: 0x049d, 0x2e5: 0x049d, 0x2e6: 0x049d, 0x2e7: 0x049d, 0x2e8: 0x049d, 0x2e9: 0x049d, 0x2ea: 0x049d, 0x2eb: 0x049d, 0x2ec: 0x0008, 0x2ed: 0x0008, 0x2ee: 0x0008, 0x2ef: 0x0008, 0x2f0: 0x0008, 0x2f1: 0x0008, 0x2f2: 0x0008, 0x2f3: 0x0008, 0x2f4: 0x0008, 0x2f5: 0x0008, 0x2f6: 0x0008, 0x2f7: 0x0008, 0x2f8: 0x0008, 0x2f9: 0x0008, 0x2fa: 0x0008, 0x2fb: 0x0008, 0x2fc: 0x0008, 0x2fd: 0x0008, 0x2fe: 0x0008, 0x2ff: 0x0008, // Block 0xc, offset 0x300 0x300: 0x0008, 0x301: 0x0008, 0x302: 0xe00f, 0x303: 0x0008, 0x304: 0x0008, 0x305: 0x0008, 0x306: 0x0008, 0x307: 0x0008, 0x308: 0x0008, 0x309: 0x0008, 0x30a: 0x0008, 0x30b: 0x0008, 0x30c: 0x0008, 0x30d: 0x0008, 0x30e: 0x0008, 0x30f: 0xe0c5, 0x310: 0x04b5, 0x311: 0x04cd, 0x312: 0xe0bd, 0x313: 0xe0f5, 0x314: 0xe0fd, 0x315: 0xe09d, 0x316: 0xe0b5, 0x317: 0x0008, 0x318: 0xe00d, 0x319: 0x0008, 0x31a: 0xe00d, 0x31b: 0x0008, 0x31c: 0xe00d, 0x31d: 0x0008, 0x31e: 0xe00d, 0x31f: 0x0008, 0x320: 0xe00d, 0x321: 0x0008, 0x322: 0xe00d, 0x323: 0x0008, 0x324: 0xe00d, 0x325: 0x0008, 0x326: 0xe00d, 0x327: 0x0008, 0x328: 0xe00d, 0x329: 0x0008, 0x32a: 0xe00d, 0x32b: 0x0008, 0x32c: 0xe00d, 0x32d: 0x0008, 0x32e: 0xe00d, 0x32f: 0x0008, 0x330: 0x04e5, 0x331: 0xe185, 0x332: 0xe18d, 0x333: 0x0008, 0x334: 0x04fd, 0x335: 0x03dd, 0x336: 0x0018, 0x337: 0xe07d, 0x338: 0x0008, 0x339: 0xe1d5, 0x33a: 0xe00d, 0x33b: 0x0008, 0x33c: 0x0008, 0x33d: 0x0515, 0x33e: 0x052d, 0x33f: 0x052d, // Block 0xd, offset 0x340 0x340: 0x0008, 0x341: 0x0008, 0x342: 0x0008, 0x343: 0x0008, 0x344: 0x0008, 0x345: 0x0008, 0x346: 0x0008, 0x347: 0x0008, 0x348: 0x0008, 0x349: 0x0008, 0x34a: 0x0008, 0x34b: 0x0008, 0x34c: 0x0008, 0x34d: 0x0008, 0x34e: 0x0008, 0x34f: 0x0008, 0x350: 0x0008, 0x351: 0x0008, 0x352: 0x0008, 0x353: 0x0008, 0x354: 0x0008, 0x355: 0x0008, 0x356: 0x0008, 0x357: 0x0008, 0x358: 0x0008, 0x359: 0x0008, 0x35a: 0x0008, 0x35b: 0x0008, 0x35c: 0x0008, 0x35d: 0x0008, 0x35e: 0x0008, 0x35f: 0x0008, 0x360: 0xe00d, 0x361: 0x0008, 0x362: 0xe00d, 0x363: 0x0008, 0x364: 0xe00d, 0x365: 0x0008, 0x366: 0xe00d, 0x367: 0x0008, 0x368: 0xe00d, 0x369: 0x0008, 0x36a: 0xe00d, 0x36b: 0x0008, 0x36c: 0xe00d, 0x36d: 0x0008, 0x36e: 0xe00d, 0x36f: 0x0008, 0x370: 0xe00d, 0x371: 0x0008, 0x372: 0xe00d, 0x373: 0x0008, 0x374: 0xe00d, 0x375: 0x0008, 0x376: 0xe00d, 0x377: 0x0008, 0x378: 0xe00d, 0x379: 0x0008, 0x37a: 0xe00d, 0x37b: 0x0008, 0x37c: 0xe00d, 0x37d: 0x0008, 0x37e: 0xe00d, 0x37f: 0x0008, // Block 0xe, offset 0x380 0x380: 0xe00d, 0x381: 0x0008, 0x382: 0x0018, 0x383: 0x3308, 0x384: 0x3308, 0x385: 0x3308, 0x386: 0x3308, 0x387: 0x3308, 0x388: 0x3318, 0x389: 0x3318, 0x38a: 0xe00d, 0x38b: 0x0008, 0x38c: 0xe00d, 0x38d: 0x0008, 0x38e: 0xe00d, 0x38f: 0x0008, 0x390: 0xe00d, 0x391: 0x0008, 0x392: 0xe00d, 0x393: 0x0008, 0x394: 0xe00d, 0x395: 0x0008, 0x396: 0xe00d, 0x397: 0x0008, 0x398: 0xe00d, 0x399: 0x0008, 0x39a: 0xe00d, 0x39b: 0x0008, 0x39c: 0xe00d, 0x39d: 0x0008, 0x39e: 0xe00d, 0x39f: 0x0008, 0x3a0: 0xe00d, 0x3a1: 0x0008, 0x3a2: 0xe00d, 0x3a3: 0x0008, 0x3a4: 0xe00d, 0x3a5: 0x0008, 0x3a6: 0xe00d, 0x3a7: 0x0008, 0x3a8: 0xe00d, 0x3a9: 0x0008, 0x3aa: 0xe00d, 0x3ab: 0x0008, 0x3ac: 0xe00d, 0x3ad: 0x0008, 0x3ae: 0xe00d, 0x3af: 0x0008, 0x3b0: 0xe00d, 0x3b1: 0x0008, 0x3b2: 0xe00d, 0x3b3: 0x0008, 0x3b4: 0xe00d, 0x3b5: 0x0008, 0x3b6: 0xe00d, 0x3b7: 0x0008, 0x3b8: 0xe00d, 0x3b9: 0x0008, 0x3ba: 0xe00d, 0x3bb: 0x0008, 0x3bc: 0xe00d, 0x3bd: 0x0008, 0x3be: 0xe00d, 0x3bf: 0x0008, // Block 0xf, offset 0x3c0 0x3c0: 0x0040, 0x3c1: 0xe01d, 0x3c2: 0x0008, 0x3c3: 0xe03d, 0x3c4: 0x0008, 0x3c5: 0xe01d, 0x3c6: 0x0008, 0x3c7: 0xe07d, 0x3c8: 0x0008, 0x3c9: 0xe01d, 0x3ca: 0x0008, 0x3cb: 0xe03d, 0x3cc: 0x0008, 0x3cd: 0xe01d, 0x3ce: 0x0008, 0x3cf: 0x0008, 0x3d0: 0xe00d, 0x3d1: 0x0008, 0x3d2: 0xe00d, 0x3d3: 0x0008, 0x3d4: 0xe00d, 0x3d5: 0x0008, 0x3d6: 0xe00d, 0x3d7: 0x0008, 0x3d8: 0xe00d, 0x3d9: 0x0008, 0x3da: 0xe00d, 0x3db: 0x0008, 0x3dc: 0xe00d, 0x3dd: 0x0008, 0x3de: 0xe00d, 0x3df: 0x0008, 0x3e0: 0xe00d, 0x3e1: 0x0008, 0x3e2: 0xe00d, 0x3e3: 0x0008, 0x3e4: 0xe00d, 0x3e5: 0x0008, 0x3e6: 0xe00d, 0x3e7: 0x0008, 0x3e8: 0xe00d, 0x3e9: 0x0008, 0x3ea: 0xe00d, 0x3eb: 0x0008, 0x3ec: 0xe00d, 0x3ed: 0x0008, 0x3ee: 0xe00d, 0x3ef: 0x0008, 0x3f0: 0xe00d, 0x3f1: 0x0008, 0x3f2: 0xe00d, 0x3f3: 0x0008, 0x3f4: 0xe00d, 0x3f5: 0x0008, 0x3f6: 0xe00d, 0x3f7: 0x0008, 0x3f8: 0xe00d, 0x3f9: 0x0008, 0x3fa: 0xe00d, 0x3fb: 0x0008, 0x3fc: 0xe00d, 0x3fd: 0x0008, 0x3fe: 0xe00d, 0x3ff: 0x0008, // Block 0x10, offset 0x400 0x400: 0xe00d, 0x401: 0x0008, 0x402: 0xe00d, 0x403: 0x0008, 0x404: 0xe00d, 0x405: 0x0008, 0x406: 0xe00d, 0x407: 0x0008, 0x408: 0xe00d, 0x409: 0x0008, 0x40a: 0xe00d, 0x40b: 0x0008, 0x40c: 0xe00d, 0x40d: 0x0008, 0x40e: 0xe00d, 0x40f: 0x0008, 0x410: 0xe00d, 0x411: 0x0008, 0x412: 0xe00d, 0x413: 0x0008, 0x414: 0xe00d, 0x415: 0x0008, 0x416: 0xe00d, 0x417: 0x0008, 0x418: 0xe00d, 0x419: 0x0008, 0x41a: 0xe00d, 0x41b: 0x0008, 0x41c: 0xe00d, 0x41d: 0x0008, 0x41e: 0xe00d, 0x41f: 0x0008, 0x420: 0xe00d, 0x421: 0x0008, 0x422: 0xe00d, 0x423: 0x0008, 0x424: 0xe00d, 0x425: 0x0008, 0x426: 0xe00d, 0x427: 0x0008, 0x428: 0xe00d, 0x429: 0x0008, 0x42a: 0xe00d, 0x42b: 0x0008, 0x42c: 0xe00d, 0x42d: 0x0008, 0x42e: 0xe00d, 0x42f: 0x0008, 0x430: 0x0040, 0x431: 0x03f5, 0x432: 0x03f5, 0x433: 0x03f5, 0x434: 0x03f5, 0x435: 0x03f5, 0x436: 0x03f5, 0x437: 0x03f5, 0x438: 0x03f5, 0x439: 0x03f5, 0x43a: 0x03f5, 0x43b: 0x03f5, 0x43c: 0x03f5, 0x43d: 0x03f5, 0x43e: 0x03f5, 0x43f: 0x03f5, // Block 0x11, offset 0x440 0x440: 0x0840, 0x441: 0x0840, 0x442: 0x0840, 0x443: 0x0840, 0x444: 0x0840, 0x445: 0x0840, 0x446: 0x0018, 0x447: 0x0018, 0x448: 0x0818, 0x449: 0x0018, 0x44a: 0x0018, 0x44b: 0x0818, 0x44c: 0x0018, 0x44d: 0x0818, 0x44e: 0x0018, 0x44f: 0x0018, 0x450: 0x3308, 0x451: 0x3308, 0x452: 0x3308, 0x453: 0x3308, 0x454: 0x3308, 0x455: 0x3308, 0x456: 0x3308, 0x457: 0x3308, 0x458: 0x3308, 0x459: 0x3308, 0x45a: 0x3308, 0x45b: 0x0818, 0x45c: 0x0b40, 0x45d: 0x0040, 0x45e: 0x0818, 0x45f: 0x0818, 0x460: 0x0a08, 0x461: 0x0808, 0x462: 0x0c08, 0x463: 0x0c08, 0x464: 0x0c08, 0x465: 0x0c08, 0x466: 0x0a08, 0x467: 0x0c08, 0x468: 0x0a08, 0x469: 0x0c08, 0x46a: 0x0a08, 0x46b: 0x0a08, 0x46c: 0x0a08, 0x46d: 0x0a08, 0x46e: 0x0a08, 0x46f: 0x0c08, 0x470: 0x0c08, 0x471: 0x0c08, 0x472: 0x0c08, 0x473: 0x0a08, 0x474: 0x0a08, 0x475: 0x0a08, 0x476: 0x0a08, 0x477: 0x0a08, 0x478: 0x0a08, 0x479: 0x0a08, 0x47a: 0x0a08, 0x47b: 0x0a08, 0x47c: 0x0a08, 0x47d: 0x0a08, 0x47e: 0x0a08, 0x47f: 0x0a08, // Block 0x12, offset 0x480 0x480: 0x0818, 0x481: 0x0a08, 0x482: 0x0a08, 0x483: 0x0a08, 0x484: 0x0a08, 0x485: 0x0a08, 0x486: 0x0a08, 0x487: 0x0a08, 0x488: 0x0c08, 0x489: 0x0a08, 0x48a: 0x0a08, 0x48b: 0x3308, 0x48c: 0x3308, 0x48d: 0x3308, 0x48e: 0x3308, 0x48f: 0x3308, 0x490: 0x3308, 0x491: 0x3308, 0x492: 0x3308, 0x493: 0x3308, 0x494: 0x3308, 0x495: 0x3308, 0x496: 0x3308, 0x497: 0x3308, 0x498: 0x3308, 0x499: 0x3308, 0x49a: 0x3308, 0x49b: 0x3308, 0x49c: 0x3308, 0x49d: 0x3308, 0x49e: 0x3308, 0x49f: 0x3308, 0x4a0: 0x0808, 0x4a1: 0x0808, 0x4a2: 0x0808, 0x4a3: 0x0808, 0x4a4: 0x0808, 0x4a5: 0x0808, 0x4a6: 0x0808, 0x4a7: 0x0808, 0x4a8: 0x0808, 0x4a9: 0x0808, 0x4aa: 0x0018, 0x4ab: 0x0818, 0x4ac: 0x0818, 0x4ad: 0x0818, 0x4ae: 0x0a08, 0x4af: 0x0a08, 0x4b0: 0x3308, 0x4b1: 0x0c08, 0x4b2: 0x0c08, 0x4b3: 0x0c08, 0x4b4: 0x0808, 0x4b5: 0x0429, 0x4b6: 0x0451, 0x4b7: 0x0479, 0x4b8: 0x04a1, 0x4b9: 0x0a08, 0x4ba: 0x0a08, 0x4bb: 0x0a08, 0x4bc: 0x0a08, 0x4bd: 0x0a08, 0x4be: 0x0a08, 0x4bf: 0x0a08, // Block 0x13, offset 0x4c0 0x4c0: 0x0c08, 0x4c1: 0x0a08, 0x4c2: 0x0a08, 0x4c3: 0x0c08, 0x4c4: 0x0c08, 0x4c5: 0x0c08, 0x4c6: 0x0c08, 0x4c7: 0x0c08, 0x4c8: 0x0c08, 0x4c9: 0x0c08, 0x4ca: 0x0c08, 0x4cb: 0x0c08, 0x4cc: 0x0a08, 0x4cd: 0x0c08, 0x4ce: 0x0a08, 0x4cf: 0x0c08, 0x4d0: 0x0a08, 0x4d1: 0x0a08, 0x4d2: 0x0c08, 0x4d3: 0x0c08, 0x4d4: 0x0818, 0x4d5: 0x0c08, 0x4d6: 0x3308, 0x4d7: 0x3308, 0x4d8: 0x3308, 0x4d9: 0x3308, 0x4da: 0x3308, 0x4db: 0x3308, 0x4dc: 0x3308, 0x4dd: 0x0840, 0x4de: 0x0018, 0x4df: 0x3308, 0x4e0: 0x3308, 0x4e1: 0x3308, 0x4e2: 0x3308, 0x4e3: 0x3308, 0x4e4: 0x3308, 0x4e5: 0x0808, 0x4e6: 0x0808, 0x4e7: 0x3308, 0x4e8: 0x3308, 0x4e9: 0x0018, 0x4ea: 0x3308, 0x4eb: 0x3308, 0x4ec: 0x3308, 0x4ed: 0x3308, 0x4ee: 0x0c08, 0x4ef: 0x0c08, 0x4f0: 0x0008, 0x4f1: 0x0008, 0x4f2: 0x0008, 0x4f3: 0x0008, 0x4f4: 0x0008, 0x4f5: 0x0008, 0x4f6: 0x0008, 0x4f7: 0x0008, 0x4f8: 0x0008, 0x4f9: 0x0008, 0x4fa: 0x0a08, 0x4fb: 0x0a08, 0x4fc: 0x0a08, 0x4fd: 0x0808, 0x4fe: 0x0808, 0x4ff: 0x0a08, // Block 0x14, offset 0x500 0x500: 0x0818, 0x501: 0x0818, 0x502: 0x0818, 0x503: 0x0818, 0x504: 0x0818, 0x505: 0x0818, 0x506: 0x0818, 0x507: 0x0818, 0x508: 0x0818, 0x509: 0x0818, 0x50a: 0x0818, 0x50b: 0x0818, 0x50c: 0x0818, 0x50d: 0x0818, 0x50e: 0x0040, 0x50f: 0x0b40, 0x510: 0x0c08, 0x511: 0x3308, 0x512: 0x0a08, 0x513: 0x0a08, 0x514: 0x0a08, 0x515: 0x0c08, 0x516: 0x0c08, 0x517: 0x0c08, 0x518: 0x0c08, 0x519: 0x0c08, 0x51a: 0x0a08, 0x51b: 0x0a08, 0x51c: 0x0a08, 0x51d: 0x0a08, 0x51e: 0x0c08, 0x51f: 0x0a08, 0x520: 0x0a08, 0x521: 0x0a08, 0x522: 0x0a08, 0x523: 0x0a08, 0x524: 0x0a08, 0x525: 0x0a08, 0x526: 0x0a08, 0x527: 0x0a08, 0x528: 0x0c08, 0x529: 0x0a08, 0x52a: 0x0c08, 0x52b: 0x0a08, 0x52c: 0x0c08, 0x52d: 0x0a08, 0x52e: 0x0a08, 0x52f: 0x0c08, 0x530: 0x3308, 0x531: 0x3308, 0x532: 0x3308, 0x533: 0x3308, 0x534: 0x3308, 0x535: 0x3308, 0x536: 0x3308, 0x537: 0x3308, 0x538: 0x3308, 0x539: 0x3308, 0x53a: 0x3308, 0x53b: 0x3308, 0x53c: 0x3308, 0x53d: 0x3308, 0x53e: 0x3308, 0x53f: 0x3308, // Block 0x15, offset 0x540 0x540: 0x3008, 0x541: 0x3308, 0x542: 0x3308, 0x543: 0x3308, 0x544: 0x3308, 0x545: 0x3308, 0x546: 0x3308, 0x547: 0x3308, 0x548: 0x3308, 0x549: 0x3008, 0x54a: 0x3008, 0x54b: 0x3008, 0x54c: 0x3008, 0x54d: 0x3b08, 0x54e: 0x3008, 0x54f: 0x3008, 0x550: 0x0008, 0x551: 0x3308, 0x552: 0x3308, 0x553: 0x3308, 0x554: 0x3308, 0x555: 0x3308, 0x556: 0x3308, 0x557: 0x3308, 0x558: 0x04c9, 0x559: 0x0501, 0x55a: 0x0539, 0x55b: 0x0571, 0x55c: 0x05a9, 0x55d: 0x05e1, 0x55e: 0x0619, 0x55f: 0x0651, 0x560: 0x0008, 0x561: 0x0008, 0x562: 0x3308, 0x563: 0x3308, 0x564: 0x0018, 0x565: 0x0018, 0x566: 0x0008, 0x567: 0x0008, 0x568: 0x0008, 0x569: 0x0008, 0x56a: 0x0008, 0x56b: 0x0008, 0x56c: 0x0008, 0x56d: 0x0008, 0x56e: 0x0008, 0x56f: 0x0008, 0x570: 0x0018, 0x571: 0x0008, 0x572: 0x0008, 0x573: 0x0008, 0x574: 0x0008, 0x575: 0x0008, 0x576: 0x0008, 0x577: 0x0008, 0x578: 0x0008, 0x579: 0x0008, 0x57a: 0x0008, 0x57b: 0x0008, 0x57c: 0x0008, 0x57d: 0x0008, 0x57e: 0x0008, 0x57f: 0x0008, // Block 0x16, offset 0x580 0x580: 0x0008, 0x581: 0x3308, 0x582: 0x3008, 0x583: 0x3008, 0x584: 0x0040, 0x585: 0x0008, 0x586: 0x0008, 0x587: 0x0008, 0x588: 0x0008, 0x589: 0x0008, 0x58a: 0x0008, 0x58b: 0x0008, 0x58c: 0x0008, 0x58d: 0x0040, 0x58e: 0x0040, 0x58f: 0x0008, 0x590: 0x0008, 0x591: 0x0040, 0x592: 0x0040, 0x593: 0x0008, 0x594: 0x0008, 0x595: 0x0008, 0x596: 0x0008, 0x597: 0x0008, 0x598: 0x0008, 0x599: 0x0008, 0x59a: 0x0008, 0x59b: 0x0008, 0x59c: 0x0008, 0x59d: 0x0008, 0x59e: 0x0008, 0x59f: 0x0008, 0x5a0: 0x0008, 0x5a1: 0x0008, 0x5a2: 0x0008, 0x5a3: 0x0008, 0x5a4: 0x0008, 0x5a5: 0x0008, 0x5a6: 0x0008, 0x5a7: 0x0008, 0x5a8: 0x0008, 0x5a9: 0x0040, 0x5aa: 0x0008, 0x5ab: 0x0008, 0x5ac: 0x0008, 0x5ad: 0x0008, 0x5ae: 0x0008, 0x5af: 0x0008, 0x5b0: 0x0008, 0x5b1: 0x0040, 0x5b2: 0x0008, 0x5b3: 0x0040, 0x5b4: 0x0040, 0x5b5: 0x0040, 0x5b6: 0x0008, 0x5b7: 0x0008, 0x5b8: 0x0008, 0x5b9: 0x0008, 0x5ba: 0x0040, 0x5bb: 0x0040, 0x5bc: 0x3308, 0x5bd: 0x0008, 0x5be: 0x3008, 0x5bf: 0x3008, // Block 0x17, offset 0x5c0 0x5c0: 0x3008, 0x5c1: 0x3308, 0x5c2: 0x3308, 0x5c3: 0x3308, 0x5c4: 0x3308, 0x5c5: 0x0040, 0x5c6: 0x0040, 0x5c7: 0x3008, 0x5c8: 0x3008, 0x5c9: 0x0040, 0x5ca: 0x0040, 0x5cb: 0x3008, 0x5cc: 0x3008, 0x5cd: 0x3b08, 0x5ce: 0x0008, 0x5cf: 0x0040, 0x5d0: 0x0040, 0x5d1: 0x0040, 0x5d2: 0x0040, 0x5d3: 0x0040, 0x5d4: 0x0040, 0x5d5: 0x0040, 0x5d6: 0x0040, 0x5d7: 0x3008, 0x5d8: 0x0040, 0x5d9: 0x0040, 0x5da: 0x0040, 0x5db: 0x0040, 0x5dc: 0x0689, 0x5dd: 0x06c1, 0x5de: 0x0040, 0x5df: 0x06f9, 0x5e0: 0x0008, 0x5e1: 0x0008, 0x5e2: 0x3308, 0x5e3: 0x3308, 0x5e4: 0x0040, 0x5e5: 0x0040, 0x5e6: 0x0008, 0x5e7: 0x0008, 0x5e8: 0x0008, 0x5e9: 0x0008, 0x5ea: 0x0008, 0x5eb: 0x0008, 0x5ec: 0x0008, 0x5ed: 0x0008, 0x5ee: 0x0008, 0x5ef: 0x0008, 0x5f0: 0x0008, 0x5f1: 0x0008, 0x5f2: 0x0018, 0x5f3: 0x0018, 0x5f4: 0x0018, 0x5f5: 0x0018, 0x5f6: 0x0018, 0x5f7: 0x0018, 0x5f8: 0x0018, 0x5f9: 0x0018, 0x5fa: 0x0018, 0x5fb: 0x0018, 0x5fc: 0x0040, 0x5fd: 0x0040, 0x5fe: 0x0040, 0x5ff: 0x0040, // Block 0x18, offset 0x600 0x600: 0x0040, 0x601: 0x3308, 0x602: 0x3308, 0x603: 0x3008, 0x604: 0x0040, 0x605: 0x0008, 0x606: 0x0008, 0x607: 0x0008, 0x608: 0x0008, 0x609: 0x0008, 0x60a: 0x0008, 0x60b: 0x0040, 0x60c: 0x0040, 0x60d: 0x0040, 0x60e: 0x0040, 0x60f: 0x0008, 0x610: 0x0008, 0x611: 0x0040, 0x612: 0x0040, 0x613: 0x0008, 0x614: 0x0008, 0x615: 0x0008, 0x616: 0x0008, 0x617: 0x0008, 0x618: 0x0008, 0x619: 0x0008, 0x61a: 0x0008, 0x61b: 0x0008, 0x61c: 0x0008, 0x61d: 0x0008, 0x61e: 0x0008, 0x61f: 0x0008, 0x620: 0x0008, 0x621: 0x0008, 0x622: 0x0008, 0x623: 0x0008, 0x624: 0x0008, 0x625: 0x0008, 0x626: 0x0008, 0x627: 0x0008, 0x628: 0x0008, 0x629: 0x0040, 0x62a: 0x0008, 0x62b: 0x0008, 0x62c: 0x0008, 0x62d: 0x0008, 0x62e: 0x0008, 0x62f: 0x0008, 0x630: 0x0008, 0x631: 0x0040, 0x632: 0x0008, 0x633: 0x0731, 0x634: 0x0040, 0x635: 0x0008, 0x636: 0x0769, 0x637: 0x0040, 0x638: 0x0008, 0x639: 0x0008, 0x63a: 0x0040, 0x63b: 0x0040, 0x63c: 0x3308, 0x63d: 0x0040, 0x63e: 0x3008, 0x63f: 0x3008, // Block 0x19, offset 0x640 0x640: 0x3008, 0x641: 0x3308, 0x642: 0x3308, 0x643: 0x0040, 0x644: 0x0040, 0x645: 0x0040, 0x646: 0x0040, 0x647: 0x3308, 0x648: 0x3308, 0x649: 0x0040, 0x64a: 0x0040, 0x64b: 0x3308, 0x64c: 0x3308, 0x64d: 0x3b08, 0x64e: 0x0040, 0x64f: 0x0040, 0x650: 0x0040, 0x651: 0x3308, 0x652: 0x0040, 0x653: 0x0040, 0x654: 0x0040, 0x655: 0x0040, 0x656: 0x0040, 0x657: 0x0040, 0x658: 0x0040, 0x659: 0x07a1, 0x65a: 0x07d9, 0x65b: 0x0811, 0x65c: 0x0008, 0x65d: 0x0040, 0x65e: 0x0849, 0x65f: 0x0040, 0x660: 0x0040, 0x661: 0x0040, 0x662: 0x0040, 0x663: 0x0040, 0x664: 0x0040, 0x665: 0x0040, 0x666: 0x0008, 0x667: 0x0008, 0x668: 0x0008, 0x669: 0x0008, 0x66a: 0x0008, 0x66b: 0x0008, 0x66c: 0x0008, 0x66d: 0x0008, 0x66e: 0x0008, 0x66f: 0x0008, 0x670: 0x3308, 0x671: 0x3308, 0x672: 0x0008, 0x673: 0x0008, 0x674: 0x0008, 0x675: 0x3308, 0x676: 0x0040, 0x677: 0x0040, 0x678: 0x0040, 0x679: 0x0040, 0x67a: 0x0040, 0x67b: 0x0040, 0x67c: 0x0040, 0x67d: 0x0040, 0x67e: 0x0040, 0x67f: 0x0040, // Block 0x1a, offset 0x680 0x680: 0x0040, 0x681: 0x3308, 0x682: 0x3308, 0x683: 0x3008, 0x684: 0x0040, 0x685: 0x0008, 0x686: 0x0008, 0x687: 0x0008, 0x688: 0x0008, 0x689: 0x0008, 0x68a: 0x0008, 0x68b: 0x0008, 0x68c: 0x0008, 0x68d: 0x0008, 0x68e: 0x0040, 0x68f: 0x0008, 0x690: 0x0008, 0x691: 0x0008, 0x692: 0x0040, 0x693: 0x0008, 0x694: 0x0008, 0x695: 0x0008, 0x696: 0x0008, 0x697: 0x0008, 0x698: 0x0008, 0x699: 0x0008, 0x69a: 0x0008, 0x69b: 0x0008, 0x69c: 0x0008, 0x69d: 0x0008, 0x69e: 0x0008, 0x69f: 0x0008, 0x6a0: 0x0008, 0x6a1: 0x0008, 0x6a2: 0x0008, 0x6a3: 0x0008, 0x6a4: 0x0008, 0x6a5: 0x0008, 0x6a6: 0x0008, 0x6a7: 0x0008, 0x6a8: 0x0008, 0x6a9: 0x0040, 0x6aa: 0x0008, 0x6ab: 0x0008, 0x6ac: 0x0008, 0x6ad: 0x0008, 0x6ae: 0x0008, 0x6af: 0x0008, 0x6b0: 0x0008, 0x6b1: 0x0040, 0x6b2: 0x0008, 0x6b3: 0x0008, 0x6b4: 0x0040, 0x6b5: 0x0008, 0x6b6: 0x0008, 0x6b7: 0x0008, 0x6b8: 0x0008, 0x6b9: 0x0008, 0x6ba: 0x0040, 0x6bb: 0x0040, 0x6bc: 0x3308, 0x6bd: 0x0008, 0x6be: 0x3008, 0x6bf: 0x3008, // Block 0x1b, offset 0x6c0 0x6c0: 0x3008, 0x6c1: 0x3308, 0x6c2: 0x3308, 0x6c3: 0x3308, 0x6c4: 0x3308, 0x6c5: 0x3308, 0x6c6: 0x0040, 0x6c7: 0x3308, 0x6c8: 0x3308, 0x6c9: 0x3008, 0x6ca: 0x0040, 0x6cb: 0x3008, 0x6cc: 0x3008, 0x6cd: 0x3b08, 0x6ce: 0x0040, 0x6cf: 0x0040, 0x6d0: 0x0008, 0x6d1: 0x0040, 0x6d2: 0x0040, 0x6d3: 0x0040, 0x6d4: 0x0040, 0x6d5: 0x0040, 0x6d6: 0x0040, 0x6d7: 0x0040, 0x6d8: 0x0040, 0x6d9: 0x0040, 0x6da: 0x0040, 0x6db: 0x0040, 0x6dc: 0x0040, 0x6dd: 0x0040, 0x6de: 0x0040, 0x6df: 0x0040, 0x6e0: 0x0008, 0x6e1: 0x0008, 0x6e2: 0x3308, 0x6e3: 0x3308, 0x6e4: 0x0040, 0x6e5: 0x0040, 0x6e6: 0x0008, 0x6e7: 0x0008, 0x6e8: 0x0008, 0x6e9: 0x0008, 0x6ea: 0x0008, 0x6eb: 0x0008, 0x6ec: 0x0008, 0x6ed: 0x0008, 0x6ee: 0x0008, 0x6ef: 0x0008, 0x6f0: 0x0018, 0x6f1: 0x0018, 0x6f2: 0x0040, 0x6f3: 0x0040, 0x6f4: 0x0040, 0x6f5: 0x0040, 0x6f6: 0x0040, 0x6f7: 0x0040, 0x6f8: 0x0040, 0x6f9: 0x0008, 0x6fa: 0x0040, 0x6fb: 0x0040, 0x6fc: 0x0040, 0x6fd: 0x0040, 0x6fe: 0x0040, 0x6ff: 0x0040, // Block 0x1c, offset 0x700 0x700: 0x0040, 0x701: 0x3308, 0x702: 0x3008, 0x703: 0x3008, 0x704: 0x0040, 0x705: 0x0008, 0x706: 0x0008, 0x707: 0x0008, 0x708: 0x0008, 0x709: 0x0008, 0x70a: 0x0008, 0x70b: 0x0008, 0x70c: 0x0008, 0x70d: 0x0040, 0x70e: 0x0040, 0x70f: 0x0008, 0x710: 0x0008, 0x711: 0x0040, 0x712: 0x0040, 0x713: 0x0008, 0x714: 0x0008, 0x715: 0x0008, 0x716: 0x0008, 0x717: 0x0008, 0x718: 0x0008, 0x719: 0x0008, 0x71a: 0x0008, 0x71b: 0x0008, 0x71c: 0x0008, 0x71d: 0x0008, 0x71e: 0x0008, 0x71f: 0x0008, 0x720: 0x0008, 0x721: 0x0008, 0x722: 0x0008, 0x723: 0x0008, 0x724: 0x0008, 0x725: 0x0008, 0x726: 0x0008, 0x727: 0x0008, 0x728: 0x0008, 0x729: 0x0040, 0x72a: 0x0008, 0x72b: 0x0008, 0x72c: 0x0008, 0x72d: 0x0008, 0x72e: 0x0008, 0x72f: 0x0008, 0x730: 0x0008, 0x731: 0x0040, 0x732: 0x0008, 0x733: 0x0008, 0x734: 0x0040, 0x735: 0x0008, 0x736: 0x0008, 0x737: 0x0008, 0x738: 0x0008, 0x739: 0x0008, 0x73a: 0x0040, 0x73b: 0x0040, 0x73c: 0x3308, 0x73d: 0x0008, 0x73e: 0x3008, 0x73f: 0x3308, // Block 0x1d, offset 0x740 0x740: 0x3008, 0x741: 0x3308, 0x742: 0x3308, 0x743: 0x3308, 0x744: 0x3308, 0x745: 0x0040, 0x746: 0x0040, 0x747: 0x3008, 0x748: 0x3008, 0x749: 0x0040, 0x74a: 0x0040, 0x74b: 0x3008, 0x74c: 0x3008, 0x74d: 0x3b08, 0x74e: 0x0040, 0x74f: 0x0040, 0x750: 0x0040, 0x751: 0x0040, 0x752: 0x0040, 0x753: 0x0040, 0x754: 0x0040, 0x755: 0x0040, 0x756: 0x3308, 0x757: 0x3008, 0x758: 0x0040, 0x759: 0x0040, 0x75a: 0x0040, 0x75b: 0x0040, 0x75c: 0x0881, 0x75d: 0x08b9, 0x75e: 0x0040, 0x75f: 0x0008, 0x760: 0x0008, 0x761: 0x0008, 0x762: 0x3308, 0x763: 0x3308, 0x764: 0x0040, 0x765: 0x0040, 0x766: 0x0008, 0x767: 0x0008, 0x768: 0x0008, 0x769: 0x0008, 0x76a: 0x0008, 0x76b: 0x0008, 0x76c: 0x0008, 0x76d: 0x0008, 0x76e: 0x0008, 0x76f: 0x0008, 0x770: 0x0018, 0x771: 0x0008, 0x772: 0x0018, 0x773: 0x0018, 0x774: 0x0018, 0x775: 0x0018, 0x776: 0x0018, 0x777: 0x0018, 0x778: 0x0040, 0x779: 0x0040, 0x77a: 0x0040, 0x77b: 0x0040, 0x77c: 0x0040, 0x77d: 0x0040, 0x77e: 0x0040, 0x77f: 0x0040, // Block 0x1e, offset 0x780 0x780: 0x0040, 0x781: 0x0040, 0x782: 0x3308, 0x783: 0x0008, 0x784: 0x0040, 0x785: 0x0008, 0x786: 0x0008, 0x787: 0x0008, 0x788: 0x0008, 0x789: 0x0008, 0x78a: 0x0008, 0x78b: 0x0040, 0x78c: 0x0040, 0x78d: 0x0040, 0x78e: 0x0008, 0x78f: 0x0008, 0x790: 0x0008, 0x791: 0x0040, 0x792: 0x0008, 0x793: 0x0008, 0x794: 0x0008, 0x795: 0x0008, 0x796: 0x0040, 0x797: 0x0040, 0x798: 0x0040, 0x799: 0x0008, 0x79a: 0x0008, 0x79b: 0x0040, 0x79c: 0x0008, 0x79d: 0x0040, 0x79e: 0x0008, 0x79f: 0x0008, 0x7a0: 0x0040, 0x7a1: 0x0040, 0x7a2: 0x0040, 0x7a3: 0x0008, 0x7a4: 0x0008, 0x7a5: 0x0040, 0x7a6: 0x0040, 0x7a7: 0x0040, 0x7a8: 0x0008, 0x7a9: 0x0008, 0x7aa: 0x0008, 0x7ab: 0x0040, 0x7ac: 0x0040, 0x7ad: 0x0040, 0x7ae: 0x0008, 0x7af: 0x0008, 0x7b0: 0x0008, 0x7b1: 0x0008, 0x7b2: 0x0008, 0x7b3: 0x0008, 0x7b4: 0x0008, 0x7b5: 0x0008, 0x7b6: 0x0008, 0x7b7: 0x0008, 0x7b8: 0x0008, 0x7b9: 0x0008, 0x7ba: 0x0040, 0x7bb: 0x0040, 0x7bc: 0x0040, 0x7bd: 0x0040, 0x7be: 0x3008, 0x7bf: 0x3008, // Block 0x1f, offset 0x7c0 0x7c0: 0x3308, 0x7c1: 0x3008, 0x7c2: 0x3008, 0x7c3: 0x3008, 0x7c4: 0x3008, 0x7c5: 0x0040, 0x7c6: 0x3308, 0x7c7: 0x3308, 0x7c8: 0x3308, 0x7c9: 0x0040, 0x7ca: 0x3308, 0x7cb: 0x3308, 0x7cc: 0x3308, 0x7cd: 0x3b08, 0x7ce: 0x0040, 0x7cf: 0x0040, 0x7d0: 0x0040, 0x7d1: 0x0040, 0x7d2: 0x0040, 0x7d3: 0x0040, 0x7d4: 0x0040, 0x7d5: 0x3308, 0x7d6: 0x3308, 0x7d7: 0x0040, 0x7d8: 0x0008, 0x7d9: 0x0008, 0x7da: 0x0008, 0x7db: 0x0040, 0x7dc: 0x0040, 0x7dd: 0x0040, 0x7de: 0x0040, 0x7df: 0x0040, 0x7e0: 0x0008, 0x7e1: 0x0008, 0x7e2: 0x3308, 0x7e3: 0x3308, 0x7e4: 0x0040, 0x7e5: 0x0040, 0x7e6: 0x0008, 0x7e7: 0x0008, 0x7e8: 0x0008, 0x7e9: 0x0008, 0x7ea: 0x0008, 0x7eb: 0x0008, 0x7ec: 0x0008, 0x7ed: 0x0008, 0x7ee: 0x0008, 0x7ef: 0x0008, 0x7f0: 0x0040, 0x7f1: 0x0040, 0x7f2: 0x0040, 0x7f3: 0x0040, 0x7f4: 0x0040, 0x7f5: 0x0040, 0x7f6: 0x0040, 0x7f7: 0x0040, 0x7f8: 0x0018, 0x7f9: 0x0018, 0x7fa: 0x0018, 0x7fb: 0x0018, 0x7fc: 0x0018, 0x7fd: 0x0018, 0x7fe: 0x0018, 0x7ff: 0x0018, // Block 0x20, offset 0x800 0x800: 0x0008, 0x801: 0x3308, 0x802: 0x3008, 0x803: 0x3008, 0x804: 0x0040, 0x805: 0x0008, 0x806: 0x0008, 0x807: 0x0008, 0x808: 0x0008, 0x809: 0x0008, 0x80a: 0x0008, 0x80b: 0x0008, 0x80c: 0x0008, 0x80d: 0x0040, 0x80e: 0x0008, 0x80f: 0x0008, 0x810: 0x0008, 0x811: 0x0040, 0x812: 0x0008, 0x813: 0x0008, 0x814: 0x0008, 0x815: 0x0008, 0x816: 0x0008, 0x817: 0x0008, 0x818: 0x0008, 0x819: 0x0008, 0x81a: 0x0008, 0x81b: 0x0008, 0x81c: 0x0008, 0x81d: 0x0008, 0x81e: 0x0008, 0x81f: 0x0008, 0x820: 0x0008, 0x821: 0x0008, 0x822: 0x0008, 0x823: 0x0008, 0x824: 0x0008, 0x825: 0x0008, 0x826: 0x0008, 0x827: 0x0008, 0x828: 0x0008, 0x829: 0x0040, 0x82a: 0x0008, 0x82b: 0x0008, 0x82c: 0x0008, 0x82d: 0x0008, 0x82e: 0x0008, 0x82f: 0x0008, 0x830: 0x0008, 0x831: 0x0008, 0x832: 0x0008, 0x833: 0x0008, 0x834: 0x0040, 0x835: 0x0008, 0x836: 0x0008, 0x837: 0x0008, 0x838: 0x0008, 0x839: 0x0008, 0x83a: 0x0040, 0x83b: 0x0040, 0x83c: 0x3308, 0x83d: 0x0008, 0x83e: 0x3008, 0x83f: 0x3308, // Block 0x21, offset 0x840 0x840: 0x3008, 0x841: 0x3008, 0x842: 0x3008, 0x843: 0x3008, 0x844: 0x3008, 0x845: 0x0040, 0x846: 0x3308, 0x847: 0x3008, 0x848: 0x3008, 0x849: 0x0040, 0x84a: 0x3008, 0x84b: 0x3008, 0x84c: 0x3308, 0x84d: 0x3b08, 0x84e: 0x0040, 0x84f: 0x0040, 0x850: 0x0040, 0x851: 0x0040, 0x852: 0x0040, 0x853: 0x0040, 0x854: 0x0040, 0x855: 0x3008, 0x856: 0x3008, 0x857: 0x0040, 0x858: 0x0040, 0x859: 0x0040, 0x85a: 0x0040, 0x85b: 0x0040, 0x85c: 0x0040, 0x85d: 0x0040, 0x85e: 0x0008, 0x85f: 0x0040, 0x860: 0x0008, 0x861: 0x0008, 0x862: 0x3308, 0x863: 0x3308, 0x864: 0x0040, 0x865: 0x0040, 0x866: 0x0008, 0x867: 0x0008, 0x868: 0x0008, 0x869: 0x0008, 0x86a: 0x0008, 0x86b: 0x0008, 0x86c: 0x0008, 0x86d: 0x0008, 0x86e: 0x0008, 0x86f: 0x0008, 0x870: 0x0040, 0x871: 0x0008, 0x872: 0x0008, 0x873: 0x0040, 0x874: 0x0040, 0x875: 0x0040, 0x876: 0x0040, 0x877: 0x0040, 0x878: 0x0040, 0x879: 0x0040, 0x87a: 0x0040, 0x87b: 0x0040, 0x87c: 0x0040, 0x87d: 0x0040, 0x87e: 0x0040, 0x87f: 0x0040, // Block 0x22, offset 0x880 0x880: 0x3008, 0x881: 0x3308, 0x882: 0x3308, 0x883: 0x3308, 0x884: 0x3308, 0x885: 0x0040, 0x886: 0x3008, 0x887: 0x3008, 0x888: 0x3008, 0x889: 0x0040, 0x88a: 0x3008, 0x88b: 0x3008, 0x88c: 0x3008, 0x88d: 0x3b08, 0x88e: 0x0008, 0x88f: 0x0018, 0x890: 0x0040, 0x891: 0x0040, 0x892: 0x0040, 0x893: 0x0040, 0x894: 0x0008, 0x895: 0x0008, 0x896: 0x0008, 0x897: 0x3008, 0x898: 0x0018, 0x899: 0x0018, 0x89a: 0x0018, 0x89b: 0x0018, 0x89c: 0x0018, 0x89d: 0x0018, 0x89e: 0x0018, 0x89f: 0x0008, 0x8a0: 0x0008, 0x8a1: 0x0008, 0x8a2: 0x3308, 0x8a3: 0x3308, 0x8a4: 0x0040, 0x8a5: 0x0040, 0x8a6: 0x0008, 0x8a7: 0x0008, 0x8a8: 0x0008, 0x8a9: 0x0008, 0x8aa: 0x0008, 0x8ab: 0x0008, 0x8ac: 0x0008, 0x8ad: 0x0008, 0x8ae: 0x0008, 0x8af: 0x0008, 0x8b0: 0x0018, 0x8b1: 0x0018, 0x8b2: 0x0018, 0x8b3: 0x0018, 0x8b4: 0x0018, 0x8b5: 0x0018, 0x8b6: 0x0018, 0x8b7: 0x0018, 0x8b8: 0x0018, 0x8b9: 0x0018, 0x8ba: 0x0008, 0x8bb: 0x0008, 0x8bc: 0x0008, 0x8bd: 0x0008, 0x8be: 0x0008, 0x8bf: 0x0008, // Block 0x23, offset 0x8c0 0x8c0: 0x0040, 0x8c1: 0x0008, 0x8c2: 0x0008, 0x8c3: 0x0040, 0x8c4: 0x0008, 0x8c5: 0x0040, 0x8c6: 0x0040, 0x8c7: 0x0008, 0x8c8: 0x0008, 0x8c9: 0x0040, 0x8ca: 0x0008, 0x8cb: 0x0040, 0x8cc: 0x0040, 0x8cd: 0x0008, 0x8ce: 0x0040, 0x8cf: 0x0040, 0x8d0: 0x0040, 0x8d1: 0x0040, 0x8d2: 0x0040, 0x8d3: 0x0040, 0x8d4: 0x0008, 0x8d5: 0x0008, 0x8d6: 0x0008, 0x8d7: 0x0008, 0x8d8: 0x0040, 0x8d9: 0x0008, 0x8da: 0x0008, 0x8db: 0x0008, 0x8dc: 0x0008, 0x8dd: 0x0008, 0x8de: 0x0008, 0x8df: 0x0008, 0x8e0: 0x0040, 0x8e1: 0x0008, 0x8e2: 0x0008, 0x8e3: 0x0008, 0x8e4: 0x0040, 0x8e5: 0x0008, 0x8e6: 0x0040, 0x8e7: 0x0008, 0x8e8: 0x0040, 0x8e9: 0x0040, 0x8ea: 0x0008, 0x8eb: 0x0008, 0x8ec: 0x0040, 0x8ed: 0x0008, 0x8ee: 0x0008, 0x8ef: 0x0008, 0x8f0: 0x0008, 0x8f1: 0x3308, 0x8f2: 0x0008, 0x8f3: 0x0929, 0x8f4: 0x3308, 0x8f5: 0x3308, 0x8f6: 0x3308, 0x8f7: 0x3308, 0x8f8: 0x3308, 0x8f9: 0x3308, 0x8fa: 0x0040, 0x8fb: 0x3308, 0x8fc: 0x3308, 0x8fd: 0x0008, 0x8fe: 0x0040, 0x8ff: 0x0040, // Block 0x24, offset 0x900 0x900: 0x0008, 0x901: 0x0008, 0x902: 0x0008, 0x903: 0x09d1, 0x904: 0x0008, 0x905: 0x0008, 0x906: 0x0008, 0x907: 0x0008, 0x908: 0x0040, 0x909: 0x0008, 0x90a: 0x0008, 0x90b: 0x0008, 0x90c: 0x0008, 0x90d: 0x0a09, 0x90e: 0x0008, 0x90f: 0x0008, 0x910: 0x0008, 0x911: 0x0008, 0x912: 0x0a41, 0x913: 0x0008, 0x914: 0x0008, 0x915: 0x0008, 0x916: 0x0008, 0x917: 0x0a79, 0x918: 0x0008, 0x919: 0x0008, 0x91a: 0x0008, 0x91b: 0x0008, 0x91c: 0x0ab1, 0x91d: 0x0008, 0x91e: 0x0008, 0x91f: 0x0008, 0x920: 0x0008, 0x921: 0x0008, 0x922: 0x0008, 0x923: 0x0008, 0x924: 0x0008, 0x925: 0x0008, 0x926: 0x0008, 0x927: 0x0008, 0x928: 0x0008, 0x929: 0x0ae9, 0x92a: 0x0008, 0x92b: 0x0008, 0x92c: 0x0008, 0x92d: 0x0040, 0x92e: 0x0040, 0x92f: 0x0040, 0x930: 0x0040, 0x931: 0x3308, 0x932: 0x3308, 0x933: 0x0b21, 0x934: 0x3308, 0x935: 0x0b59, 0x936: 0x0b91, 0x937: 0x0bc9, 0x938: 0x0c19, 0x939: 0x0c51, 0x93a: 0x3308, 0x93b: 0x3308, 0x93c: 0x3308, 0x93d: 0x3308, 0x93e: 0x3308, 0x93f: 0x3008, // Block 0x25, offset 0x940 0x940: 0x3308, 0x941: 0x0ca1, 0x942: 0x3308, 0x943: 0x3308, 0x944: 0x3b08, 0x945: 0x0018, 0x946: 0x3308, 0x947: 0x3308, 0x948: 0x0008, 0x949: 0x0008, 0x94a: 0x0008, 0x94b: 0x0008, 0x94c: 0x0008, 0x94d: 0x3308, 0x94e: 0x3308, 0x94f: 0x3308, 0x950: 0x3308, 0x951: 0x3308, 0x952: 0x3308, 0x953: 0x0cd9, 0x954: 0x3308, 0x955: 0x3308, 0x956: 0x3308, 0x957: 0x3308, 0x958: 0x0040, 0x959: 0x3308, 0x95a: 0x3308, 0x95b: 0x3308, 0x95c: 0x3308, 0x95d: 0x0d11, 0x95e: 0x3308, 0x95f: 0x3308, 0x960: 0x3308, 0x961: 0x3308, 0x962: 0x0d49, 0x963: 0x3308, 0x964: 0x3308, 0x965: 0x3308, 0x966: 0x3308, 0x967: 0x0d81, 0x968: 0x3308, 0x969: 0x3308, 0x96a: 0x3308, 0x96b: 0x3308, 0x96c: 0x0db9, 0x96d: 0x3308, 0x96e: 0x3308, 0x96f: 0x3308, 0x970: 0x3308, 0x971: 0x3308, 0x972: 0x3308, 0x973: 0x3308, 0x974: 0x3308, 0x975: 0x3308, 0x976: 0x3308, 0x977: 0x3308, 0x978: 0x3308, 0x979: 0x0df1, 0x97a: 0x3308, 0x97b: 0x3308, 0x97c: 0x3308, 0x97d: 0x0040, 0x97e: 0x0018, 0x97f: 0x0018, // Block 0x26, offset 0x980 0x980: 0x0008, 0x981: 0x0008, 0x982: 0x0008, 0x983: 0x0008, 0x984: 0x0008, 0x985: 0x0008, 0x986: 0x0008, 0x987: 0x0008, 0x988: 0x0008, 0x989: 0x0008, 0x98a: 0x0008, 0x98b: 0x0008, 0x98c: 0x0008, 0x98d: 0x0008, 0x98e: 0x0008, 0x98f: 0x0008, 0x990: 0x0008, 0x991: 0x0008, 0x992: 0x0008, 0x993: 0x0008, 0x994: 0x0008, 0x995: 0x0008, 0x996: 0x0008, 0x997: 0x0008, 0x998: 0x0008, 0x999: 0x0008, 0x99a: 0x0008, 0x99b: 0x0008, 0x99c: 0x0008, 0x99d: 0x0008, 0x99e: 0x0008, 0x99f: 0x0008, 0x9a0: 0x0008, 0x9a1: 0x0008, 0x9a2: 0x0008, 0x9a3: 0x0008, 0x9a4: 0x0008, 0x9a5: 0x0008, 0x9a6: 0x0008, 0x9a7: 0x0008, 0x9a8: 0x0008, 0x9a9: 0x0008, 0x9aa: 0x0008, 0x9ab: 0x0008, 0x9ac: 0x0039, 0x9ad: 0x0ed1, 0x9ae: 0x0ee9, 0x9af: 0x0008, 0x9b0: 0x0ef9, 0x9b1: 0x0f09, 0x9b2: 0x0f19, 0x9b3: 0x0f31, 0x9b4: 0x0249, 0x9b5: 0x0f41, 0x9b6: 0x0259, 0x9b7: 0x0f51, 0x9b8: 0x0359, 0x9b9: 0x0f61, 0x9ba: 0x0f71, 0x9bb: 0x0008, 0x9bc: 0x00d9, 0x9bd: 0x0f81, 0x9be: 0x0f99, 0x9bf: 0x0269, // Block 0x27, offset 0x9c0 0x9c0: 0x0fa9, 0x9c1: 0x0fb9, 0x9c2: 0x0279, 0x9c3: 0x0039, 0x9c4: 0x0fc9, 0x9c5: 0x0fe1, 0x9c6: 0x059d, 0x9c7: 0x0ee9, 0x9c8: 0x0ef9, 0x9c9: 0x0f09, 0x9ca: 0x0ff9, 0x9cb: 0x1011, 0x9cc: 0x1029, 0x9cd: 0x0f31, 0x9ce: 0x0008, 0x9cf: 0x0f51, 0x9d0: 0x0f61, 0x9d1: 0x1041, 0x9d2: 0x00d9, 0x9d3: 0x1059, 0x9d4: 0x05b5, 0x9d5: 0x05b5, 0x9d6: 0x0f99, 0x9d7: 0x0fa9, 0x9d8: 0x0fb9, 0x9d9: 0x059d, 0x9da: 0x1071, 0x9db: 0x1089, 0x9dc: 0x05cd, 0x9dd: 0x1099, 0x9de: 0x10b1, 0x9df: 0x10c9, 0x9e0: 0x10e1, 0x9e1: 0x10f9, 0x9e2: 0x0f41, 0x9e3: 0x0269, 0x9e4: 0x0fb9, 0x9e5: 0x1089, 0x9e6: 0x1099, 0x9e7: 0x10b1, 0x9e8: 0x1111, 0x9e9: 0x10e1, 0x9ea: 0x10f9, 0x9eb: 0x0008, 0x9ec: 0x0008, 0x9ed: 0x0008, 0x9ee: 0x0008, 0x9ef: 0x0008, 0x9f0: 0x0008, 0x9f1: 0x0008, 0x9f2: 0x0008, 0x9f3: 0x0008, 0x9f4: 0x0008, 0x9f5: 0x0008, 0x9f6: 0x0008, 0x9f7: 0x0008, 0x9f8: 0x1129, 0x9f9: 0x0008, 0x9fa: 0x0008, 0x9fb: 0x0008, 0x9fc: 0x0008, 0x9fd: 0x0008, 0x9fe: 0x0008, 0x9ff: 0x0008, // Block 0x28, offset 0xa00 0xa00: 0x0008, 0xa01: 0x0008, 0xa02: 0x0008, 0xa03: 0x0008, 0xa04: 0x0008, 0xa05: 0x0008, 0xa06: 0x0008, 0xa07: 0x0008, 0xa08: 0x0008, 0xa09: 0x0008, 0xa0a: 0x0008, 0xa0b: 0x0008, 0xa0c: 0x0008, 0xa0d: 0x0008, 0xa0e: 0x0008, 0xa0f: 0x0008, 0xa10: 0x0008, 0xa11: 0x0008, 0xa12: 0x0008, 0xa13: 0x0008, 0xa14: 0x0008, 0xa15: 0x0008, 0xa16: 0x0008, 0xa17: 0x0008, 0xa18: 0x0008, 0xa19: 0x0008, 0xa1a: 0x0008, 0xa1b: 0x1141, 0xa1c: 0x1159, 0xa1d: 0x1169, 0xa1e: 0x1181, 0xa1f: 0x1029, 0xa20: 0x1199, 0xa21: 0x11a9, 0xa22: 0x11c1, 0xa23: 0x11d9, 0xa24: 0x11f1, 0xa25: 0x1209, 0xa26: 0x1221, 0xa27: 0x05e5, 0xa28: 0x1239, 0xa29: 0x1251, 0xa2a: 0xe17d, 0xa2b: 0x1269, 0xa2c: 0x1281, 0xa2d: 0x1299, 0xa2e: 0x12b1, 0xa2f: 0x12c9, 0xa30: 0x12e1, 0xa31: 0x12f9, 0xa32: 0x1311, 0xa33: 0x1329, 0xa34: 0x1341, 0xa35: 0x1359, 0xa36: 0x1371, 0xa37: 0x1389, 0xa38: 0x05fd, 0xa39: 0x13a1, 0xa3a: 0x13b9, 0xa3b: 0x13d1, 0xa3c: 0x13e1, 0xa3d: 0x13f9, 0xa3e: 0x1411, 0xa3f: 0x1429, // Block 0x29, offset 0xa40 0xa40: 0xe00d, 0xa41: 0x0008, 0xa42: 0xe00d, 0xa43: 0x0008, 0xa44: 0xe00d, 0xa45: 0x0008, 0xa46: 0xe00d, 0xa47: 0x0008, 0xa48: 0xe00d, 0xa49: 0x0008, 0xa4a: 0xe00d, 0xa4b: 0x0008, 0xa4c: 0xe00d, 0xa4d: 0x0008, 0xa4e: 0xe00d, 0xa4f: 0x0008, 0xa50: 0xe00d, 0xa51: 0x0008, 0xa52: 0xe00d, 0xa53: 0x0008, 0xa54: 0xe00d, 0xa55: 0x0008, 0xa56: 0xe00d, 0xa57: 0x0008, 0xa58: 0xe00d, 0xa59: 0x0008, 0xa5a: 0xe00d, 0xa5b: 0x0008, 0xa5c: 0xe00d, 0xa5d: 0x0008, 0xa5e: 0xe00d, 0xa5f: 0x0008, 0xa60: 0xe00d, 0xa61: 0x0008, 0xa62: 0xe00d, 0xa63: 0x0008, 0xa64: 0xe00d, 0xa65: 0x0008, 0xa66: 0xe00d, 0xa67: 0x0008, 0xa68: 0xe00d, 0xa69: 0x0008, 0xa6a: 0xe00d, 0xa6b: 0x0008, 0xa6c: 0xe00d, 0xa6d: 0x0008, 0xa6e: 0xe00d, 0xa6f: 0x0008, 0xa70: 0xe00d, 0xa71: 0x0008, 0xa72: 0xe00d, 0xa73: 0x0008, 0xa74: 0xe00d, 0xa75: 0x0008, 0xa76: 0xe00d, 0xa77: 0x0008, 0xa78: 0xe00d, 0xa79: 0x0008, 0xa7a: 0xe00d, 0xa7b: 0x0008, 0xa7c: 0xe00d, 0xa7d: 0x0008, 0xa7e: 0xe00d, 0xa7f: 0x0008, // Block 0x2a, offset 0xa80 0xa80: 0xe00d, 0xa81: 0x0008, 0xa82: 0xe00d, 0xa83: 0x0008, 0xa84: 0xe00d, 0xa85: 0x0008, 0xa86: 0xe00d, 0xa87: 0x0008, 0xa88: 0xe00d, 0xa89: 0x0008, 0xa8a: 0xe00d, 0xa8b: 0x0008, 0xa8c: 0xe00d, 0xa8d: 0x0008, 0xa8e: 0xe00d, 0xa8f: 0x0008, 0xa90: 0xe00d, 0xa91: 0x0008, 0xa92: 0xe00d, 0xa93: 0x0008, 0xa94: 0xe00d, 0xa95: 0x0008, 0xa96: 0x0008, 0xa97: 0x0008, 0xa98: 0x0008, 0xa99: 0x0008, 0xa9a: 0x0615, 0xa9b: 0x0635, 0xa9c: 0x0008, 0xa9d: 0x0008, 0xa9e: 0x1441, 0xa9f: 0x0008, 0xaa0: 0xe00d, 0xaa1: 0x0008, 0xaa2: 0xe00d, 0xaa3: 0x0008, 0xaa4: 0xe00d, 0xaa5: 0x0008, 0xaa6: 0xe00d, 0xaa7: 0x0008, 0xaa8: 0xe00d, 0xaa9: 0x0008, 0xaaa: 0xe00d, 0xaab: 0x0008, 0xaac: 0xe00d, 0xaad: 0x0008, 0xaae: 0xe00d, 0xaaf: 0x0008, 0xab0: 0xe00d, 0xab1: 0x0008, 0xab2: 0xe00d, 0xab3: 0x0008, 0xab4: 0xe00d, 0xab5: 0x0008, 0xab6: 0xe00d, 0xab7: 0x0008, 0xab8: 0xe00d, 0xab9: 0x0008, 0xaba: 0xe00d, 0xabb: 0x0008, 0xabc: 0xe00d, 0xabd: 0x0008, 0xabe: 0xe00d, 0xabf: 0x0008, // Block 0x2b, offset 0xac0 0xac0: 0x0008, 0xac1: 0x0008, 0xac2: 0x0008, 0xac3: 0x0008, 0xac4: 0x0008, 0xac5: 0x0008, 0xac6: 0x0040, 0xac7: 0x0040, 0xac8: 0xe045, 0xac9: 0xe045, 0xaca: 0xe045, 0xacb: 0xe045, 0xacc: 0xe045, 0xacd: 0xe045, 0xace: 0x0040, 0xacf: 0x0040, 0xad0: 0x0008, 0xad1: 0x0008, 0xad2: 0x0008, 0xad3: 0x0008, 0xad4: 0x0008, 0xad5: 0x0008, 0xad6: 0x0008, 0xad7: 0x0008, 0xad8: 0x0040, 0xad9: 0xe045, 0xada: 0x0040, 0xadb: 0xe045, 0xadc: 0x0040, 0xadd: 0xe045, 0xade: 0x0040, 0xadf: 0xe045, 0xae0: 0x0008, 0xae1: 0x0008, 0xae2: 0x0008, 0xae3: 0x0008, 0xae4: 0x0008, 0xae5: 0x0008, 0xae6: 0x0008, 0xae7: 0x0008, 0xae8: 0xe045, 0xae9: 0xe045, 0xaea: 0xe045, 0xaeb: 0xe045, 0xaec: 0xe045, 0xaed: 0xe045, 0xaee: 0xe045, 0xaef: 0xe045, 0xaf0: 0x0008, 0xaf1: 0x1459, 0xaf2: 0x0008, 0xaf3: 0x1471, 0xaf4: 0x0008, 0xaf5: 0x1489, 0xaf6: 0x0008, 0xaf7: 0x14a1, 0xaf8: 0x0008, 0xaf9: 0x14b9, 0xafa: 0x0008, 0xafb: 0x14d1, 0xafc: 0x0008, 0xafd: 0x14e9, 0xafe: 0x0040, 0xaff: 0x0040, // Block 0x2c, offset 0xb00 0xb00: 0x1501, 0xb01: 0x1531, 0xb02: 0x1561, 0xb03: 0x1591, 0xb04: 0x15c1, 0xb05: 0x15f1, 0xb06: 0x1621, 0xb07: 0x1651, 0xb08: 0x1501, 0xb09: 0x1531, 0xb0a: 0x1561, 0xb0b: 0x1591, 0xb0c: 0x15c1, 0xb0d: 0x15f1, 0xb0e: 0x1621, 0xb0f: 0x1651, 0xb10: 0x1681, 0xb11: 0x16b1, 0xb12: 0x16e1, 0xb13: 0x1711, 0xb14: 0x1741, 0xb15: 0x1771, 0xb16: 0x17a1, 0xb17: 0x17d1, 0xb18: 0x1681, 0xb19: 0x16b1, 0xb1a: 0x16e1, 0xb1b: 0x1711, 0xb1c: 0x1741, 0xb1d: 0x1771, 0xb1e: 0x17a1, 0xb1f: 0x17d1, 0xb20: 0x1801, 0xb21: 0x1831, 0xb22: 0x1861, 0xb23: 0x1891, 0xb24: 0x18c1, 0xb25: 0x18f1, 0xb26: 0x1921, 0xb27: 0x1951, 0xb28: 0x1801, 0xb29: 0x1831, 0xb2a: 0x1861, 0xb2b: 0x1891, 0xb2c: 0x18c1, 0xb2d: 0x18f1, 0xb2e: 0x1921, 0xb2f: 0x1951, 0xb30: 0x0008, 0xb31: 0x0008, 0xb32: 0x1981, 0xb33: 0x19b1, 0xb34: 0x19d9, 0xb35: 0x0040, 0xb36: 0x0008, 0xb37: 0x1a01, 0xb38: 0xe045, 0xb39: 0xe045, 0xb3a: 0x064d, 0xb3b: 0x1459, 0xb3c: 0x19b1, 0xb3d: 0x0666, 0xb3e: 0x1a31, 0xb3f: 0x0686, // Block 0x2d, offset 0xb40 0xb40: 0x06a6, 0xb41: 0x1a4a, 0xb42: 0x1a79, 0xb43: 0x1aa9, 0xb44: 0x1ad1, 0xb45: 0x0040, 0xb46: 0x0008, 0xb47: 0x1af9, 0xb48: 0x06c5, 0xb49: 0x1471, 0xb4a: 0x06dd, 0xb4b: 0x1489, 0xb4c: 0x1aa9, 0xb4d: 0x1b2a, 0xb4e: 0x1b5a, 0xb4f: 0x1b8a, 0xb50: 0x0008, 0xb51: 0x0008, 0xb52: 0x0008, 0xb53: 0x1bb9, 0xb54: 0x0040, 0xb55: 0x0040, 0xb56: 0x0008, 0xb57: 0x0008, 0xb58: 0xe045, 0xb59: 0xe045, 0xb5a: 0x06f5, 0xb5b: 0x14a1, 0xb5c: 0x0040, 0xb5d: 0x1bd2, 0xb5e: 0x1c02, 0xb5f: 0x1c32, 0xb60: 0x0008, 0xb61: 0x0008, 0xb62: 0x0008, 0xb63: 0x1c61, 0xb64: 0x0008, 0xb65: 0x0008, 0xb66: 0x0008, 0xb67: 0x0008, 0xb68: 0xe045, 0xb69: 0xe045, 0xb6a: 0x070d, 0xb6b: 0x14d1, 0xb6c: 0xe04d, 0xb6d: 0x1c7a, 0xb6e: 0x03d2, 0xb6f: 0x1caa, 0xb70: 0x0040, 0xb71: 0x0040, 0xb72: 0x1cb9, 0xb73: 0x1ce9, 0xb74: 0x1d11, 0xb75: 0x0040, 0xb76: 0x0008, 0xb77: 0x1d39, 0xb78: 0x0725, 0xb79: 0x14b9, 0xb7a: 0x0515, 0xb7b: 0x14e9, 0xb7c: 0x1ce9, 0xb7d: 0x073e, 0xb7e: 0x075e, 0xb7f: 0x0040, // Block 0x2e, offset 0xb80 0xb80: 0x000a, 0xb81: 0x000a, 0xb82: 0x000a, 0xb83: 0x000a, 0xb84: 0x000a, 0xb85: 0x000a, 0xb86: 0x000a, 0xb87: 0x000a, 0xb88: 0x000a, 0xb89: 0x000a, 0xb8a: 0x000a, 0xb8b: 0x03c0, 0xb8c: 0x0003, 0xb8d: 0x0003, 0xb8e: 0x0340, 0xb8f: 0x0b40, 0xb90: 0x0018, 0xb91: 0xe00d, 0xb92: 0x0018, 0xb93: 0x0018, 0xb94: 0x0018, 0xb95: 0x0018, 0xb96: 0x0018, 0xb97: 0x077e, 0xb98: 0x0018, 0xb99: 0x0018, 0xb9a: 0x0018, 0xb9b: 0x0018, 0xb9c: 0x0018, 0xb9d: 0x0018, 0xb9e: 0x0018, 0xb9f: 0x0018, 0xba0: 0x0018, 0xba1: 0x0018, 0xba2: 0x0018, 0xba3: 0x0018, 0xba4: 0x0040, 0xba5: 0x0040, 0xba6: 0x0040, 0xba7: 0x0018, 0xba8: 0x0040, 0xba9: 0x0040, 0xbaa: 0x0340, 0xbab: 0x0340, 0xbac: 0x0340, 0xbad: 0x0340, 0xbae: 0x0340, 0xbaf: 0x000a, 0xbb0: 0x0018, 0xbb1: 0x0018, 0xbb2: 0x0018, 0xbb3: 0x1d69, 0xbb4: 0x1da1, 0xbb5: 0x0018, 0xbb6: 0x1df1, 0xbb7: 0x1e29, 0xbb8: 0x0018, 0xbb9: 0x0018, 0xbba: 0x0018, 0xbbb: 0x0018, 0xbbc: 0x1e7a, 0xbbd: 0x0018, 0xbbe: 0x079e, 0xbbf: 0x0018, // Block 0x2f, offset 0xbc0 0xbc0: 0x0018, 0xbc1: 0x0018, 0xbc2: 0x0018, 0xbc3: 0x0018, 0xbc4: 0x0018, 0xbc5: 0x0018, 0xbc6: 0x0018, 0xbc7: 0x1e92, 0xbc8: 0x1eaa, 0xbc9: 0x1ec2, 0xbca: 0x0018, 0xbcb: 0x0018, 0xbcc: 0x0018, 0xbcd: 0x0018, 0xbce: 0x0018, 0xbcf: 0x0018, 0xbd0: 0x0018, 0xbd1: 0x0018, 0xbd2: 0x0018, 0xbd3: 0x0018, 0xbd4: 0x0018, 0xbd5: 0x0018, 0xbd6: 0x0018, 0xbd7: 0x1ed9, 0xbd8: 0x0018, 0xbd9: 0x0018, 0xbda: 0x0018, 0xbdb: 0x0018, 0xbdc: 0x0018, 0xbdd: 0x0018, 0xbde: 0x0018, 0xbdf: 0x000a, 0xbe0: 0x03c0, 0xbe1: 0x0340, 0xbe2: 0x0340, 0xbe3: 0x0340, 0xbe4: 0x03c0, 0xbe5: 0x0040, 0xbe6: 0x0040, 0xbe7: 0x0040, 0xbe8: 0x0040, 0xbe9: 0x0040, 0xbea: 0x0340, 0xbeb: 0x0340, 0xbec: 0x0340, 0xbed: 0x0340, 0xbee: 0x0340, 0xbef: 0x0340, 0xbf0: 0x1f41, 0xbf1: 0x0f41, 0xbf2: 0x0040, 0xbf3: 0x0040, 0xbf4: 0x1f51, 0xbf5: 0x1f61, 0xbf6: 0x1f71, 0xbf7: 0x1f81, 0xbf8: 0x1f91, 0xbf9: 0x1fa1, 0xbfa: 0x1fb2, 0xbfb: 0x07bd, 0xbfc: 0x1fc2, 0xbfd: 0x1fd2, 0xbfe: 0x1fe2, 0xbff: 0x0f71, // Block 0x30, offset 0xc00 0xc00: 0x1f41, 0xc01: 0x00c9, 0xc02: 0x0069, 0xc03: 0x0079, 0xc04: 0x1f51, 0xc05: 0x1f61, 0xc06: 0x1f71, 0xc07: 0x1f81, 0xc08: 0x1f91, 0xc09: 0x1fa1, 0xc0a: 0x1fb2, 0xc0b: 0x07d5, 0xc0c: 0x1fc2, 0xc0d: 0x1fd2, 0xc0e: 0x1fe2, 0xc0f: 0x0040, 0xc10: 0x0039, 0xc11: 0x0f09, 0xc12: 0x00d9, 0xc13: 0x0369, 0xc14: 0x0ff9, 0xc15: 0x0249, 0xc16: 0x0f51, 0xc17: 0x0359, 0xc18: 0x0f61, 0xc19: 0x0f71, 0xc1a: 0x0f99, 0xc1b: 0x01d9, 0xc1c: 0x0fa9, 0xc1d: 0x0040, 0xc1e: 0x0040, 0xc1f: 0x0040, 0xc20: 0x0018, 0xc21: 0x0018, 0xc22: 0x0018, 0xc23: 0x0018, 0xc24: 0x0018, 0xc25: 0x0018, 0xc26: 0x0018, 0xc27: 0x0018, 0xc28: 0x1ff1, 0xc29: 0x0018, 0xc2a: 0x0018, 0xc2b: 0x0018, 0xc2c: 0x0018, 0xc2d: 0x0018, 0xc2e: 0x0018, 0xc2f: 0x0018, 0xc30: 0x0018, 0xc31: 0x0018, 0xc32: 0x0018, 0xc33: 0x0018, 0xc34: 0x0018, 0xc35: 0x0018, 0xc36: 0x0018, 0xc37: 0x0018, 0xc38: 0x0018, 0xc39: 0x0018, 0xc3a: 0x0018, 0xc3b: 0x0018, 0xc3c: 0x0018, 0xc3d: 0x0018, 0xc3e: 0x0018, 0xc3f: 0x0040, // Block 0x31, offset 0xc40 0xc40: 0x07ee, 0xc41: 0x080e, 0xc42: 0x1159, 0xc43: 0x082d, 0xc44: 0x0018, 0xc45: 0x084e, 0xc46: 0x086e, 0xc47: 0x1011, 0xc48: 0x0018, 0xc49: 0x088d, 0xc4a: 0x0f31, 0xc4b: 0x0249, 0xc4c: 0x0249, 0xc4d: 0x0249, 0xc4e: 0x0249, 0xc4f: 0x2009, 0xc50: 0x0f41, 0xc51: 0x0f41, 0xc52: 0x0359, 0xc53: 0x0359, 0xc54: 0x0018, 0xc55: 0x0f71, 0xc56: 0x2021, 0xc57: 0x0018, 0xc58: 0x0018, 0xc59: 0x0f99, 0xc5a: 0x2039, 0xc5b: 0x0269, 0xc5c: 0x0269, 0xc5d: 0x0269, 0xc5e: 0x0018, 0xc5f: 0x0018, 0xc60: 0x2049, 0xc61: 0x08ad, 0xc62: 0x2061, 0xc63: 0x0018, 0xc64: 0x13d1, 0xc65: 0x0018, 0xc66: 0x2079, 0xc67: 0x0018, 0xc68: 0x13d1, 0xc69: 0x0018, 0xc6a: 0x0f51, 0xc6b: 0x2091, 0xc6c: 0x0ee9, 0xc6d: 0x1159, 0xc6e: 0x0018, 0xc6f: 0x0f09, 0xc70: 0x0f09, 0xc71: 0x1199, 0xc72: 0x0040, 0xc73: 0x0f61, 0xc74: 0x00d9, 0xc75: 0x20a9, 0xc76: 0x20c1, 0xc77: 0x20d9, 0xc78: 0x20f1, 0xc79: 0x0f41, 0xc7a: 0x0018, 0xc7b: 0x08cd, 0xc7c: 0x2109, 0xc7d: 0x10b1, 0xc7e: 0x10b1, 0xc7f: 0x2109, // Block 0x32, offset 0xc80 0xc80: 0x08ed, 0xc81: 0x0018, 0xc82: 0x0018, 0xc83: 0x0018, 0xc84: 0x0018, 0xc85: 0x0ef9, 0xc86: 0x0ef9, 0xc87: 0x0f09, 0xc88: 0x0f41, 0xc89: 0x0259, 0xc8a: 0x0018, 0xc8b: 0x0018, 0xc8c: 0x0018, 0xc8d: 0x0018, 0xc8e: 0x0008, 0xc8f: 0x0018, 0xc90: 0x2121, 0xc91: 0x2151, 0xc92: 0x2181, 0xc93: 0x21b9, 0xc94: 0x21e9, 0xc95: 0x2219, 0xc96: 0x2249, 0xc97: 0x2279, 0xc98: 0x22a9, 0xc99: 0x22d9, 0xc9a: 0x2309, 0xc9b: 0x2339, 0xc9c: 0x2369, 0xc9d: 0x2399, 0xc9e: 0x23c9, 0xc9f: 0x23f9, 0xca0: 0x0f41, 0xca1: 0x2421, 0xca2: 0x0905, 0xca3: 0x2439, 0xca4: 0x1089, 0xca5: 0x2451, 0xca6: 0x0925, 0xca7: 0x2469, 0xca8: 0x2491, 0xca9: 0x0369, 0xcaa: 0x24a9, 0xcab: 0x0945, 0xcac: 0x0359, 0xcad: 0x1159, 0xcae: 0x0ef9, 0xcaf: 0x0f61, 0xcb0: 0x0f41, 0xcb1: 0x2421, 0xcb2: 0x0965, 0xcb3: 0x2439, 0xcb4: 0x1089, 0xcb5: 0x2451, 0xcb6: 0x0985, 0xcb7: 0x2469, 0xcb8: 0x2491, 0xcb9: 0x0369, 0xcba: 0x24a9, 0xcbb: 0x09a5, 0xcbc: 0x0359, 0xcbd: 0x1159, 0xcbe: 0x0ef9, 0xcbf: 0x0f61, // Block 0x33, offset 0xcc0 0xcc0: 0x0018, 0xcc1: 0x0018, 0xcc2: 0x0018, 0xcc3: 0x0018, 0xcc4: 0x0018, 0xcc5: 0x0018, 0xcc6: 0x0018, 0xcc7: 0x0018, 0xcc8: 0x0018, 0xcc9: 0x0018, 0xcca: 0x0018, 0xccb: 0x0040, 0xccc: 0x0040, 0xccd: 0x0040, 0xcce: 0x0040, 0xccf: 0x0040, 0xcd0: 0x0040, 0xcd1: 0x0040, 0xcd2: 0x0040, 0xcd3: 0x0040, 0xcd4: 0x0040, 0xcd5: 0x0040, 0xcd6: 0x0040, 0xcd7: 0x0040, 0xcd8: 0x0040, 0xcd9: 0x0040, 0xcda: 0x0040, 0xcdb: 0x0040, 0xcdc: 0x0040, 0xcdd: 0x0040, 0xcde: 0x0040, 0xcdf: 0x0040, 0xce0: 0x00c9, 0xce1: 0x0069, 0xce2: 0x0079, 0xce3: 0x1f51, 0xce4: 0x1f61, 0xce5: 0x1f71, 0xce6: 0x1f81, 0xce7: 0x1f91, 0xce8: 0x1fa1, 0xce9: 0x2601, 0xcea: 0x2619, 0xceb: 0x2631, 0xcec: 0x2649, 0xced: 0x2661, 0xcee: 0x2679, 0xcef: 0x2691, 0xcf0: 0x26a9, 0xcf1: 0x26c1, 0xcf2: 0x26d9, 0xcf3: 0x26f1, 0xcf4: 0x0a06, 0xcf5: 0x0a26, 0xcf6: 0x0a46, 0xcf7: 0x0a66, 0xcf8: 0x0a86, 0xcf9: 0x0aa6, 0xcfa: 0x0ac6, 0xcfb: 0x0ae6, 0xcfc: 0x0b06, 0xcfd: 0x270a, 0xcfe: 0x2732, 0xcff: 0x275a, // Block 0x34, offset 0xd00 0xd00: 0x2782, 0xd01: 0x27aa, 0xd02: 0x27d2, 0xd03: 0x27fa, 0xd04: 0x2822, 0xd05: 0x284a, 0xd06: 0x2872, 0xd07: 0x289a, 0xd08: 0x0040, 0xd09: 0x0040, 0xd0a: 0x0040, 0xd0b: 0x0040, 0xd0c: 0x0040, 0xd0d: 0x0040, 0xd0e: 0x0040, 0xd0f: 0x0040, 0xd10: 0x0040, 0xd11: 0x0040, 0xd12: 0x0040, 0xd13: 0x0040, 0xd14: 0x0040, 0xd15: 0x0040, 0xd16: 0x0040, 0xd17: 0x0040, 0xd18: 0x0040, 0xd19: 0x0040, 0xd1a: 0x0040, 0xd1b: 0x0040, 0xd1c: 0x0b26, 0xd1d: 0x0b46, 0xd1e: 0x0b66, 0xd1f: 0x0b86, 0xd20: 0x0ba6, 0xd21: 0x0bc6, 0xd22: 0x0be6, 0xd23: 0x0c06, 0xd24: 0x0c26, 0xd25: 0x0c46, 0xd26: 0x0c66, 0xd27: 0x0c86, 0xd28: 0x0ca6, 0xd29: 0x0cc6, 0xd2a: 0x0ce6, 0xd2b: 0x0d06, 0xd2c: 0x0d26, 0xd2d: 0x0d46, 0xd2e: 0x0d66, 0xd2f: 0x0d86, 0xd30: 0x0da6, 0xd31: 0x0dc6, 0xd32: 0x0de6, 0xd33: 0x0e06, 0xd34: 0x0e26, 0xd35: 0x0e46, 0xd36: 0x0039, 0xd37: 0x0ee9, 0xd38: 0x1159, 0xd39: 0x0ef9, 0xd3a: 0x0f09, 0xd3b: 0x1199, 0xd3c: 0x0f31, 0xd3d: 0x0249, 0xd3e: 0x0f41, 0xd3f: 0x0259, // Block 0x35, offset 0xd40 0xd40: 0x0f51, 0xd41: 0x0359, 0xd42: 0x0f61, 0xd43: 0x0f71, 0xd44: 0x00d9, 0xd45: 0x0f99, 0xd46: 0x2039, 0xd47: 0x0269, 0xd48: 0x01d9, 0xd49: 0x0fa9, 0xd4a: 0x0fb9, 0xd4b: 0x1089, 0xd4c: 0x0279, 0xd4d: 0x0369, 0xd4e: 0x0289, 0xd4f: 0x13d1, 0xd50: 0x0039, 0xd51: 0x0ee9, 0xd52: 0x1159, 0xd53: 0x0ef9, 0xd54: 0x0f09, 0xd55: 0x1199, 0xd56: 0x0f31, 0xd57: 0x0249, 0xd58: 0x0f41, 0xd59: 0x0259, 0xd5a: 0x0f51, 0xd5b: 0x0359, 0xd5c: 0x0f61, 0xd5d: 0x0f71, 0xd5e: 0x00d9, 0xd5f: 0x0f99, 0xd60: 0x2039, 0xd61: 0x0269, 0xd62: 0x01d9, 0xd63: 0x0fa9, 0xd64: 0x0fb9, 0xd65: 0x1089, 0xd66: 0x0279, 0xd67: 0x0369, 0xd68: 0x0289, 0xd69: 0x13d1, 0xd6a: 0x1f41, 0xd6b: 0x0018, 0xd6c: 0x0018, 0xd6d: 0x0018, 0xd6e: 0x0018, 0xd6f: 0x0018, 0xd70: 0x0018, 0xd71: 0x0018, 0xd72: 0x0018, 0xd73: 0x0018, 0xd74: 0x0018, 0xd75: 0x0018, 0xd76: 0x0018, 0xd77: 0x0018, 0xd78: 0x0018, 0xd79: 0x0018, 0xd7a: 0x0018, 0xd7b: 0x0018, 0xd7c: 0x0018, 0xd7d: 0x0018, 0xd7e: 0x0018, 0xd7f: 0x0018, // Block 0x36, offset 0xd80 0xd80: 0x0008, 0xd81: 0x0008, 0xd82: 0x0008, 0xd83: 0x0008, 0xd84: 0x0008, 0xd85: 0x0008, 0xd86: 0x0008, 0xd87: 0x0008, 0xd88: 0x0008, 0xd89: 0x0008, 0xd8a: 0x0008, 0xd8b: 0x0008, 0xd8c: 0x0008, 0xd8d: 0x0008, 0xd8e: 0x0008, 0xd8f: 0x0008, 0xd90: 0x0008, 0xd91: 0x0008, 0xd92: 0x0008, 0xd93: 0x0008, 0xd94: 0x0008, 0xd95: 0x0008, 0xd96: 0x0008, 0xd97: 0x0008, 0xd98: 0x0008, 0xd99: 0x0008, 0xd9a: 0x0008, 0xd9b: 0x0008, 0xd9c: 0x0008, 0xd9d: 0x0008, 0xd9e: 0x0008, 0xd9f: 0x0040, 0xda0: 0xe00d, 0xda1: 0x0008, 0xda2: 0x2971, 0xda3: 0x0ebd, 0xda4: 0x2989, 0xda5: 0x0008, 0xda6: 0x0008, 0xda7: 0xe07d, 0xda8: 0x0008, 0xda9: 0xe01d, 0xdaa: 0x0008, 0xdab: 0xe03d, 0xdac: 0x0008, 0xdad: 0x0fe1, 0xdae: 0x1281, 0xdaf: 0x0fc9, 0xdb0: 0x1141, 0xdb1: 0x0008, 0xdb2: 0xe00d, 0xdb3: 0x0008, 0xdb4: 0x0008, 0xdb5: 0xe01d, 0xdb6: 0x0008, 0xdb7: 0x0008, 0xdb8: 0x0008, 0xdb9: 0x0008, 0xdba: 0x0008, 0xdbb: 0x0008, 0xdbc: 0x0259, 0xdbd: 0x1089, 0xdbe: 0x29a1, 0xdbf: 0x29b9, // Block 0x37, offset 0xdc0 0xdc0: 0xe00d, 0xdc1: 0x0008, 0xdc2: 0xe00d, 0xdc3: 0x0008, 0xdc4: 0xe00d, 0xdc5: 0x0008, 0xdc6: 0xe00d, 0xdc7: 0x0008, 0xdc8: 0xe00d, 0xdc9: 0x0008, 0xdca: 0xe00d, 0xdcb: 0x0008, 0xdcc: 0xe00d, 0xdcd: 0x0008, 0xdce: 0xe00d, 0xdcf: 0x0008, 0xdd0: 0xe00d, 0xdd1: 0x0008, 0xdd2: 0xe00d, 0xdd3: 0x0008, 0xdd4: 0xe00d, 0xdd5: 0x0008, 0xdd6: 0xe00d, 0xdd7: 0x0008, 0xdd8: 0xe00d, 0xdd9: 0x0008, 0xdda: 0xe00d, 0xddb: 0x0008, 0xddc: 0xe00d, 0xddd: 0x0008, 0xdde: 0xe00d, 0xddf: 0x0008, 0xde0: 0xe00d, 0xde1: 0x0008, 0xde2: 0xe00d, 0xde3: 0x0008, 0xde4: 0x0008, 0xde5: 0x0018, 0xde6: 0x0018, 0xde7: 0x0018, 0xde8: 0x0018, 0xde9: 0x0018, 0xdea: 0x0018, 0xdeb: 0xe03d, 0xdec: 0x0008, 0xded: 0xe01d, 0xdee: 0x0008, 0xdef: 0x3308, 0xdf0: 0x3308, 0xdf1: 0x3308, 0xdf2: 0xe00d, 0xdf3: 0x0008, 0xdf4: 0x0040, 0xdf5: 0x0040, 0xdf6: 0x0040, 0xdf7: 0x0040, 0xdf8: 0x0040, 0xdf9: 0x0018, 0xdfa: 0x0018, 0xdfb: 0x0018, 0xdfc: 0x0018, 0xdfd: 0x0018, 0xdfe: 0x0018, 0xdff: 0x0018, // Block 0x38, offset 0xe00 0xe00: 0x26fd, 0xe01: 0x271d, 0xe02: 0x273d, 0xe03: 0x275d, 0xe04: 0x277d, 0xe05: 0x279d, 0xe06: 0x27bd, 0xe07: 0x27dd, 0xe08: 0x27fd, 0xe09: 0x281d, 0xe0a: 0x283d, 0xe0b: 0x285d, 0xe0c: 0x287d, 0xe0d: 0x289d, 0xe0e: 0x28bd, 0xe0f: 0x28dd, 0xe10: 0x28fd, 0xe11: 0x291d, 0xe12: 0x293d, 0xe13: 0x295d, 0xe14: 0x297d, 0xe15: 0x299d, 0xe16: 0x0040, 0xe17: 0x0040, 0xe18: 0x0040, 0xe19: 0x0040, 0xe1a: 0x0040, 0xe1b: 0x0040, 0xe1c: 0x0040, 0xe1d: 0x0040, 0xe1e: 0x0040, 0xe1f: 0x0040, 0xe20: 0x0040, 0xe21: 0x0040, 0xe22: 0x0040, 0xe23: 0x0040, 0xe24: 0x0040, 0xe25: 0x0040, 0xe26: 0x0040, 0xe27: 0x0040, 0xe28: 0x0040, 0xe29: 0x0040, 0xe2a: 0x0040, 0xe2b: 0x0040, 0xe2c: 0x0040, 0xe2d: 0x0040, 0xe2e: 0x0040, 0xe2f: 0x0040, 0xe30: 0x0040, 0xe31: 0x0040, 0xe32: 0x0040, 0xe33: 0x0040, 0xe34: 0x0040, 0xe35: 0x0040, 0xe36: 0x0040, 0xe37: 0x0040, 0xe38: 0x0040, 0xe39: 0x0040, 0xe3a: 0x0040, 0xe3b: 0x0040, 0xe3c: 0x0040, 0xe3d: 0x0040, 0xe3e: 0x0040, 0xe3f: 0x0040, // Block 0x39, offset 0xe40 0xe40: 0x000a, 0xe41: 0x0018, 0xe42: 0x29d1, 0xe43: 0x0018, 0xe44: 0x0018, 0xe45: 0x0008, 0xe46: 0x0008, 0xe47: 0x0008, 0xe48: 0x0018, 0xe49: 0x0018, 0xe4a: 0x0018, 0xe4b: 0x0018, 0xe4c: 0x0018, 0xe4d: 0x0018, 0xe4e: 0x0018, 0xe4f: 0x0018, 0xe50: 0x0018, 0xe51: 0x0018, 0xe52: 0x0018, 0xe53: 0x0018, 0xe54: 0x0018, 0xe55: 0x0018, 0xe56: 0x0018, 0xe57: 0x0018, 0xe58: 0x0018, 0xe59: 0x0018, 0xe5a: 0x0018, 0xe5b: 0x0018, 0xe5c: 0x0018, 0xe5d: 0x0018, 0xe5e: 0x0018, 0xe5f: 0x0018, 0xe60: 0x0018, 0xe61: 0x0018, 0xe62: 0x0018, 0xe63: 0x0018, 0xe64: 0x0018, 0xe65: 0x0018, 0xe66: 0x0018, 0xe67: 0x0018, 0xe68: 0x0018, 0xe69: 0x0018, 0xe6a: 0x3308, 0xe6b: 0x3308, 0xe6c: 0x3308, 0xe6d: 0x3308, 0xe6e: 0x3018, 0xe6f: 0x3018, 0xe70: 0x0018, 0xe71: 0x0018, 0xe72: 0x0018, 0xe73: 0x0018, 0xe74: 0x0018, 0xe75: 0x0018, 0xe76: 0xe125, 0xe77: 0x0018, 0xe78: 0x29bd, 0xe79: 0x29dd, 0xe7a: 0x29fd, 0xe7b: 0x0018, 0xe7c: 0x0008, 0xe7d: 0x0018, 0xe7e: 0x0018, 0xe7f: 0x0018, // Block 0x3a, offset 0xe80 0xe80: 0x2b3d, 0xe81: 0x2b5d, 0xe82: 0x2b7d, 0xe83: 0x2b9d, 0xe84: 0x2bbd, 0xe85: 0x2bdd, 0xe86: 0x2bdd, 0xe87: 0x2bdd, 0xe88: 0x2bfd, 0xe89: 0x2bfd, 0xe8a: 0x2bfd, 0xe8b: 0x2bfd, 0xe8c: 0x2c1d, 0xe8d: 0x2c1d, 0xe8e: 0x2c1d, 0xe8f: 0x2c3d, 0xe90: 0x2c5d, 0xe91: 0x2c5d, 0xe92: 0x2a7d, 0xe93: 0x2a7d, 0xe94: 0x2c5d, 0xe95: 0x2c5d, 0xe96: 0x2c7d, 0xe97: 0x2c7d, 0xe98: 0x2c5d, 0xe99: 0x2c5d, 0xe9a: 0x2a7d, 0xe9b: 0x2a7d, 0xe9c: 0x2c5d, 0xe9d: 0x2c5d, 0xe9e: 0x2c3d, 0xe9f: 0x2c3d, 0xea0: 0x2c9d, 0xea1: 0x2c9d, 0xea2: 0x2cbd, 0xea3: 0x2cbd, 0xea4: 0x0040, 0xea5: 0x2cdd, 0xea6: 0x2cfd, 0xea7: 0x2d1d, 0xea8: 0x2d1d, 0xea9: 0x2d3d, 0xeaa: 0x2d5d, 0xeab: 0x2d7d, 0xeac: 0x2d9d, 0xead: 0x2dbd, 0xeae: 0x2ddd, 0xeaf: 0x2dfd, 0xeb0: 0x2e1d, 0xeb1: 0x2e3d, 0xeb2: 0x2e3d, 0xeb3: 0x2e5d, 0xeb4: 0x2e7d, 0xeb5: 0x2e7d, 0xeb6: 0x2e9d, 0xeb7: 0x2ebd, 0xeb8: 0x2e5d, 0xeb9: 0x2edd, 0xeba: 0x2efd, 0xebb: 0x2edd, 0xebc: 0x2e5d, 0xebd: 0x2f1d, 0xebe: 0x2f3d, 0xebf: 0x2f5d, // Block 0x3b, offset 0xec0 0xec0: 0x2f7d, 0xec1: 0x2f9d, 0xec2: 0x2cfd, 0xec3: 0x2cdd, 0xec4: 0x2fbd, 0xec5: 0x2fdd, 0xec6: 0x2ffd, 0xec7: 0x301d, 0xec8: 0x303d, 0xec9: 0x305d, 0xeca: 0x307d, 0xecb: 0x309d, 0xecc: 0x30bd, 0xecd: 0x30dd, 0xece: 0x30fd, 0xecf: 0x0040, 0xed0: 0x0018, 0xed1: 0x0018, 0xed2: 0x311d, 0xed3: 0x313d, 0xed4: 0x315d, 0xed5: 0x317d, 0xed6: 0x319d, 0xed7: 0x31bd, 0xed8: 0x31dd, 0xed9: 0x31fd, 0xeda: 0x321d, 0xedb: 0x323d, 0xedc: 0x315d, 0xedd: 0x325d, 0xede: 0x327d, 0xedf: 0x329d, 0xee0: 0x0008, 0xee1: 0x0008, 0xee2: 0x0008, 0xee3: 0x0008, 0xee4: 0x0008, 0xee5: 0x0008, 0xee6: 0x0008, 0xee7: 0x0008, 0xee8: 0x0008, 0xee9: 0x0008, 0xeea: 0x0008, 0xeeb: 0x0008, 0xeec: 0x0008, 0xeed: 0x0008, 0xeee: 0x0008, 0xeef: 0x0008, 0xef0: 0x0008, 0xef1: 0x0008, 0xef2: 0x0008, 0xef3: 0x0008, 0xef4: 0x0008, 0xef5: 0x0008, 0xef6: 0x0008, 0xef7: 0x0008, 0xef8: 0x0008, 0xef9: 0x0008, 0xefa: 0x0008, 0xefb: 0x0040, 0xefc: 0x0040, 0xefd: 0x0040, 0xefe: 0x0040, 0xeff: 0x0040, // Block 0x3c, offset 0xf00 0xf00: 0x36a2, 0xf01: 0x36d2, 0xf02: 0x3702, 0xf03: 0x3732, 0xf04: 0x32bd, 0xf05: 0x32dd, 0xf06: 0x32fd, 0xf07: 0x331d, 0xf08: 0x0018, 0xf09: 0x0018, 0xf0a: 0x0018, 0xf0b: 0x0018, 0xf0c: 0x0018, 0xf0d: 0x0018, 0xf0e: 0x0018, 0xf0f: 0x0018, 0xf10: 0x333d, 0xf11: 0x3761, 0xf12: 0x3779, 0xf13: 0x3791, 0xf14: 0x37a9, 0xf15: 0x37c1, 0xf16: 0x37d9, 0xf17: 0x37f1, 0xf18: 0x3809, 0xf19: 0x3821, 0xf1a: 0x3839, 0xf1b: 0x3851, 0xf1c: 0x3869, 0xf1d: 0x3881, 0xf1e: 0x3899, 0xf1f: 0x38b1, 0xf20: 0x335d, 0xf21: 0x337d, 0xf22: 0x339d, 0xf23: 0x33bd, 0xf24: 0x33dd, 0xf25: 0x33dd, 0xf26: 0x33fd, 0xf27: 0x341d, 0xf28: 0x343d, 0xf29: 0x345d, 0xf2a: 0x347d, 0xf2b: 0x349d, 0xf2c: 0x34bd, 0xf2d: 0x34dd, 0xf2e: 0x34fd, 0xf2f: 0x351d, 0xf30: 0x353d, 0xf31: 0x355d, 0xf32: 0x357d, 0xf33: 0x359d, 0xf34: 0x35bd, 0xf35: 0x35dd, 0xf36: 0x35fd, 0xf37: 0x361d, 0xf38: 0x363d, 0xf39: 0x365d, 0xf3a: 0x367d, 0xf3b: 0x369d, 0xf3c: 0x38c9, 0xf3d: 0x3901, 0xf3e: 0x36bd, 0xf3f: 0x0018, // Block 0x3d, offset 0xf40 0xf40: 0x36dd, 0xf41: 0x36fd, 0xf42: 0x371d, 0xf43: 0x373d, 0xf44: 0x375d, 0xf45: 0x377d, 0xf46: 0x379d, 0xf47: 0x37bd, 0xf48: 0x37dd, 0xf49: 0x37fd, 0xf4a: 0x381d, 0xf4b: 0x383d, 0xf4c: 0x385d, 0xf4d: 0x387d, 0xf4e: 0x389d, 0xf4f: 0x38bd, 0xf50: 0x38dd, 0xf51: 0x38fd, 0xf52: 0x391d, 0xf53: 0x393d, 0xf54: 0x395d, 0xf55: 0x397d, 0xf56: 0x399d, 0xf57: 0x39bd, 0xf58: 0x39dd, 0xf59: 0x39fd, 0xf5a: 0x3a1d, 0xf5b: 0x3a3d, 0xf5c: 0x3a5d, 0xf5d: 0x3a7d, 0xf5e: 0x3a9d, 0xf5f: 0x3abd, 0xf60: 0x3add, 0xf61: 0x3afd, 0xf62: 0x3b1d, 0xf63: 0x3b3d, 0xf64: 0x3b5d, 0xf65: 0x3b7d, 0xf66: 0x127d, 0xf67: 0x3b9d, 0xf68: 0x3bbd, 0xf69: 0x3bdd, 0xf6a: 0x3bfd, 0xf6b: 0x3c1d, 0xf6c: 0x3c3d, 0xf6d: 0x3c5d, 0xf6e: 0x239d, 0xf6f: 0x3c7d, 0xf70: 0x3c9d, 0xf71: 0x3939, 0xf72: 0x3951, 0xf73: 0x3969, 0xf74: 0x3981, 0xf75: 0x3999, 0xf76: 0x39b1, 0xf77: 0x39c9, 0xf78: 0x39e1, 0xf79: 0x39f9, 0xf7a: 0x3a11, 0xf7b: 0x3a29, 0xf7c: 0x3a41, 0xf7d: 0x3a59, 0xf7e: 0x3a71, 0xf7f: 0x3a89, // Block 0x3e, offset 0xf80 0xf80: 0x3aa1, 0xf81: 0x3ac9, 0xf82: 0x3af1, 0xf83: 0x3b19, 0xf84: 0x3b41, 0xf85: 0x3b69, 0xf86: 0x3b91, 0xf87: 0x3bb9, 0xf88: 0x3be1, 0xf89: 0x3c09, 0xf8a: 0x3c39, 0xf8b: 0x3c69, 0xf8c: 0x3c99, 0xf8d: 0x3cbd, 0xf8e: 0x3cb1, 0xf8f: 0x3cdd, 0xf90: 0x3cfd, 0xf91: 0x3d15, 0xf92: 0x3d2d, 0xf93: 0x3d45, 0xf94: 0x3d5d, 0xf95: 0x3d5d, 0xf96: 0x3d45, 0xf97: 0x3d75, 0xf98: 0x07bd, 0xf99: 0x3d8d, 0xf9a: 0x3da5, 0xf9b: 0x3dbd, 0xf9c: 0x3dd5, 0xf9d: 0x3ded, 0xf9e: 0x3e05, 0xf9f: 0x3e1d, 0xfa0: 0x3e35, 0xfa1: 0x3e4d, 0xfa2: 0x3e65, 0xfa3: 0x3e7d, 0xfa4: 0x3e95, 0xfa5: 0x3e95, 0xfa6: 0x3ead, 0xfa7: 0x3ead, 0xfa8: 0x3ec5, 0xfa9: 0x3ec5, 0xfaa: 0x3edd, 0xfab: 0x3ef5, 0xfac: 0x3f0d, 0xfad: 0x3f25, 0xfae: 0x3f3d, 0xfaf: 0x3f3d, 0xfb0: 0x3f55, 0xfb1: 0x3f55, 0xfb2: 0x3f55, 0xfb3: 0x3f6d, 0xfb4: 0x3f85, 0xfb5: 0x3f9d, 0xfb6: 0x3fb5, 0xfb7: 0x3f9d, 0xfb8: 0x3fcd, 0xfb9: 0x3fe5, 0xfba: 0x3f6d, 0xfbb: 0x3ffd, 0xfbc: 0x4015, 0xfbd: 0x4015, 0xfbe: 0x4015, 0xfbf: 0x0040, // Block 0x3f, offset 0xfc0 0xfc0: 0x3cc9, 0xfc1: 0x3d31, 0xfc2: 0x3d99, 0xfc3: 0x3e01, 0xfc4: 0x3e51, 0xfc5: 0x3eb9, 0xfc6: 0x3f09, 0xfc7: 0x3f59, 0xfc8: 0x3fd9, 0xfc9: 0x4041, 0xfca: 0x4091, 0xfcb: 0x40e1, 0xfcc: 0x4131, 0xfcd: 0x4199, 0xfce: 0x4201, 0xfcf: 0x4251, 0xfd0: 0x42a1, 0xfd1: 0x42d9, 0xfd2: 0x4329, 0xfd3: 0x4391, 0xfd4: 0x43f9, 0xfd5: 0x4431, 0xfd6: 0x44b1, 0xfd7: 0x4549, 0xfd8: 0x45c9, 0xfd9: 0x4619, 0xfda: 0x4699, 0xfdb: 0x4719, 0xfdc: 0x4781, 0xfdd: 0x47d1, 0xfde: 0x4821, 0xfdf: 0x4871, 0xfe0: 0x48d9, 0xfe1: 0x4959, 0xfe2: 0x49c1, 0xfe3: 0x4a11, 0xfe4: 0x4a61, 0xfe5: 0x4ab1, 0xfe6: 0x4ae9, 0xfe7: 0x4b21, 0xfe8: 0x4b59, 0xfe9: 0x4b91, 0xfea: 0x4be1, 0xfeb: 0x4c31, 0xfec: 0x4cb1, 0xfed: 0x4d01, 0xfee: 0x4d69, 0xfef: 0x4de9, 0xff0: 0x4e39, 0xff1: 0x4e71, 0xff2: 0x4ea9, 0xff3: 0x4f29, 0xff4: 0x4f91, 0xff5: 0x5011, 0xff6: 0x5061, 0xff7: 0x50e1, 0xff8: 0x5119, 0xff9: 0x5169, 0xffa: 0x51b9, 0xffb: 0x5209, 0xffc: 0x5259, 0xffd: 0x52a9, 0xffe: 0x5311, 0xfff: 0x5361, // Block 0x40, offset 0x1000 0x1000: 0x5399, 0x1001: 0x53e9, 0x1002: 0x5439, 0x1003: 0x5489, 0x1004: 0x54f1, 0x1005: 0x5541, 0x1006: 0x5591, 0x1007: 0x55e1, 0x1008: 0x5661, 0x1009: 0x56c9, 0x100a: 0x5701, 0x100b: 0x5781, 0x100c: 0x57b9, 0x100d: 0x5821, 0x100e: 0x5889, 0x100f: 0x58d9, 0x1010: 0x5929, 0x1011: 0x5979, 0x1012: 0x59e1, 0x1013: 0x5a19, 0x1014: 0x5a69, 0x1015: 0x5ad1, 0x1016: 0x5b09, 0x1017: 0x5b89, 0x1018: 0x5bd9, 0x1019: 0x5c01, 0x101a: 0x5c29, 0x101b: 0x5c51, 0x101c: 0x5c79, 0x101d: 0x5ca1, 0x101e: 0x5cc9, 0x101f: 0x5cf1, 0x1020: 0x5d19, 0x1021: 0x5d41, 0x1022: 0x5d69, 0x1023: 0x5d99, 0x1024: 0x5dc9, 0x1025: 0x5df9, 0x1026: 0x5e29, 0x1027: 0x5e59, 0x1028: 0x5e89, 0x1029: 0x5eb9, 0x102a: 0x5ee9, 0x102b: 0x5f19, 0x102c: 0x5f49, 0x102d: 0x5f79, 0x102e: 0x5fa9, 0x102f: 0x5fd9, 0x1030: 0x6009, 0x1031: 0x402d, 0x1032: 0x6039, 0x1033: 0x6051, 0x1034: 0x404d, 0x1035: 0x6069, 0x1036: 0x6081, 0x1037: 0x6099, 0x1038: 0x406d, 0x1039: 0x406d, 0x103a: 0x60b1, 0x103b: 0x60c9, 0x103c: 0x6101, 0x103d: 0x6139, 0x103e: 0x6171, 0x103f: 0x61a9, // Block 0x41, offset 0x1040 0x1040: 0x6211, 0x1041: 0x6229, 0x1042: 0x408d, 0x1043: 0x6241, 0x1044: 0x6259, 0x1045: 0x6271, 0x1046: 0x6289, 0x1047: 0x62a1, 0x1048: 0x40ad, 0x1049: 0x62b9, 0x104a: 0x62e1, 0x104b: 0x62f9, 0x104c: 0x40cd, 0x104d: 0x40cd, 0x104e: 0x6311, 0x104f: 0x6329, 0x1050: 0x6341, 0x1051: 0x40ed, 0x1052: 0x410d, 0x1053: 0x412d, 0x1054: 0x414d, 0x1055: 0x416d, 0x1056: 0x6359, 0x1057: 0x6371, 0x1058: 0x6389, 0x1059: 0x63a1, 0x105a: 0x63b9, 0x105b: 0x418d, 0x105c: 0x63d1, 0x105d: 0x63e9, 0x105e: 0x6401, 0x105f: 0x41ad, 0x1060: 0x41cd, 0x1061: 0x6419, 0x1062: 0x41ed, 0x1063: 0x420d, 0x1064: 0x422d, 0x1065: 0x6431, 0x1066: 0x424d, 0x1067: 0x6449, 0x1068: 0x6479, 0x1069: 0x6211, 0x106a: 0x426d, 0x106b: 0x428d, 0x106c: 0x42ad, 0x106d: 0x42cd, 0x106e: 0x64b1, 0x106f: 0x64f1, 0x1070: 0x6539, 0x1071: 0x6551, 0x1072: 0x42ed, 0x1073: 0x6569, 0x1074: 0x6581, 0x1075: 0x6599, 0x1076: 0x430d, 0x1077: 0x65b1, 0x1078: 0x65c9, 0x1079: 0x65b1, 0x107a: 0x65e1, 0x107b: 0x65f9, 0x107c: 0x432d, 0x107d: 0x6611, 0x107e: 0x6629, 0x107f: 0x6611, // Block 0x42, offset 0x1080 0x1080: 0x434d, 0x1081: 0x436d, 0x1082: 0x0040, 0x1083: 0x6641, 0x1084: 0x6659, 0x1085: 0x6671, 0x1086: 0x6689, 0x1087: 0x0040, 0x1088: 0x66c1, 0x1089: 0x66d9, 0x108a: 0x66f1, 0x108b: 0x6709, 0x108c: 0x6721, 0x108d: 0x6739, 0x108e: 0x6401, 0x108f: 0x6751, 0x1090: 0x6769, 0x1091: 0x6781, 0x1092: 0x438d, 0x1093: 0x6799, 0x1094: 0x6289, 0x1095: 0x43ad, 0x1096: 0x43cd, 0x1097: 0x67b1, 0x1098: 0x0040, 0x1099: 0x43ed, 0x109a: 0x67c9, 0x109b: 0x67e1, 0x109c: 0x67f9, 0x109d: 0x6811, 0x109e: 0x6829, 0x109f: 0x6859, 0x10a0: 0x6889, 0x10a1: 0x68b1, 0x10a2: 0x68d9, 0x10a3: 0x6901, 0x10a4: 0x6929, 0x10a5: 0x6951, 0x10a6: 0x6979, 0x10a7: 0x69a1, 0x10a8: 0x69c9, 0x10a9: 0x69f1, 0x10aa: 0x6a21, 0x10ab: 0x6a51, 0x10ac: 0x6a81, 0x10ad: 0x6ab1, 0x10ae: 0x6ae1, 0x10af: 0x6b11, 0x10b0: 0x6b41, 0x10b1: 0x6b71, 0x10b2: 0x6ba1, 0x10b3: 0x6bd1, 0x10b4: 0x6c01, 0x10b5: 0x6c31, 0x10b6: 0x6c61, 0x10b7: 0x6c91, 0x10b8: 0x6cc1, 0x10b9: 0x6cf1, 0x10ba: 0x6d21, 0x10bb: 0x6d51, 0x10bc: 0x6d81, 0x10bd: 0x6db1, 0x10be: 0x6de1, 0x10bf: 0x440d, // Block 0x43, offset 0x10c0 0x10c0: 0xe00d, 0x10c1: 0x0008, 0x10c2: 0xe00d, 0x10c3: 0x0008, 0x10c4: 0xe00d, 0x10c5: 0x0008, 0x10c6: 0xe00d, 0x10c7: 0x0008, 0x10c8: 0xe00d, 0x10c9: 0x0008, 0x10ca: 0xe00d, 0x10cb: 0x0008, 0x10cc: 0xe00d, 0x10cd: 0x0008, 0x10ce: 0xe00d, 0x10cf: 0x0008, 0x10d0: 0xe00d, 0x10d1: 0x0008, 0x10d2: 0xe00d, 0x10d3: 0x0008, 0x10d4: 0xe00d, 0x10d5: 0x0008, 0x10d6: 0xe00d, 0x10d7: 0x0008, 0x10d8: 0xe00d, 0x10d9: 0x0008, 0x10da: 0xe00d, 0x10db: 0x0008, 0x10dc: 0xe00d, 0x10dd: 0x0008, 0x10de: 0xe00d, 0x10df: 0x0008, 0x10e0: 0xe00d, 0x10e1: 0x0008, 0x10e2: 0xe00d, 0x10e3: 0x0008, 0x10e4: 0xe00d, 0x10e5: 0x0008, 0x10e6: 0xe00d, 0x10e7: 0x0008, 0x10e8: 0xe00d, 0x10e9: 0x0008, 0x10ea: 0xe00d, 0x10eb: 0x0008, 0x10ec: 0xe00d, 0x10ed: 0x0008, 0x10ee: 0x0008, 0x10ef: 0x3308, 0x10f0: 0x3318, 0x10f1: 0x3318, 0x10f2: 0x3318, 0x10f3: 0x0018, 0x10f4: 0x3308, 0x10f5: 0x3308, 0x10f6: 0x3308, 0x10f7: 0x3308, 0x10f8: 0x3308, 0x10f9: 0x3308, 0x10fa: 0x3308, 0x10fb: 0x3308, 0x10fc: 0x3308, 0x10fd: 0x3308, 0x10fe: 0x0018, 0x10ff: 0x0008, // Block 0x44, offset 0x1100 0x1100: 0xe00d, 0x1101: 0x0008, 0x1102: 0xe00d, 0x1103: 0x0008, 0x1104: 0xe00d, 0x1105: 0x0008, 0x1106: 0xe00d, 0x1107: 0x0008, 0x1108: 0xe00d, 0x1109: 0x0008, 0x110a: 0xe00d, 0x110b: 0x0008, 0x110c: 0xe00d, 0x110d: 0x0008, 0x110e: 0xe00d, 0x110f: 0x0008, 0x1110: 0xe00d, 0x1111: 0x0008, 0x1112: 0xe00d, 0x1113: 0x0008, 0x1114: 0xe00d, 0x1115: 0x0008, 0x1116: 0xe00d, 0x1117: 0x0008, 0x1118: 0xe00d, 0x1119: 0x0008, 0x111a: 0xe00d, 0x111b: 0x0008, 0x111c: 0x0ea1, 0x111d: 0x6e11, 0x111e: 0x3308, 0x111f: 0x3308, 0x1120: 0x0008, 0x1121: 0x0008, 0x1122: 0x0008, 0x1123: 0x0008, 0x1124: 0x0008, 0x1125: 0x0008, 0x1126: 0x0008, 0x1127: 0x0008, 0x1128: 0x0008, 0x1129: 0x0008, 0x112a: 0x0008, 0x112b: 0x0008, 0x112c: 0x0008, 0x112d: 0x0008, 0x112e: 0x0008, 0x112f: 0x0008, 0x1130: 0x0008, 0x1131: 0x0008, 0x1132: 0x0008, 0x1133: 0x0008, 0x1134: 0x0008, 0x1135: 0x0008, 0x1136: 0x0008, 0x1137: 0x0008, 0x1138: 0x0008, 0x1139: 0x0008, 0x113a: 0x0008, 0x113b: 0x0008, 0x113c: 0x0008, 0x113d: 0x0008, 0x113e: 0x0008, 0x113f: 0x0008, // Block 0x45, offset 0x1140 0x1140: 0x0018, 0x1141: 0x0018, 0x1142: 0x0018, 0x1143: 0x0018, 0x1144: 0x0018, 0x1145: 0x0018, 0x1146: 0x0018, 0x1147: 0x0018, 0x1148: 0x0018, 0x1149: 0x0018, 0x114a: 0x0018, 0x114b: 0x0018, 0x114c: 0x0018, 0x114d: 0x0018, 0x114e: 0x0018, 0x114f: 0x0018, 0x1150: 0x0018, 0x1151: 0x0018, 0x1152: 0x0018, 0x1153: 0x0018, 0x1154: 0x0018, 0x1155: 0x0018, 0x1156: 0x0018, 0x1157: 0x0008, 0x1158: 0x0008, 0x1159: 0x0008, 0x115a: 0x0008, 0x115b: 0x0008, 0x115c: 0x0008, 0x115d: 0x0008, 0x115e: 0x0008, 0x115f: 0x0008, 0x1160: 0x0018, 0x1161: 0x0018, 0x1162: 0xe00d, 0x1163: 0x0008, 0x1164: 0xe00d, 0x1165: 0x0008, 0x1166: 0xe00d, 0x1167: 0x0008, 0x1168: 0xe00d, 0x1169: 0x0008, 0x116a: 0xe00d, 0x116b: 0x0008, 0x116c: 0xe00d, 0x116d: 0x0008, 0x116e: 0xe00d, 0x116f: 0x0008, 0x1170: 0x0008, 0x1171: 0x0008, 0x1172: 0xe00d, 0x1173: 0x0008, 0x1174: 0xe00d, 0x1175: 0x0008, 0x1176: 0xe00d, 0x1177: 0x0008, 0x1178: 0xe00d, 0x1179: 0x0008, 0x117a: 0xe00d, 0x117b: 0x0008, 0x117c: 0xe00d, 0x117d: 0x0008, 0x117e: 0xe00d, 0x117f: 0x0008, // Block 0x46, offset 0x1180 0x1180: 0xe00d, 0x1181: 0x0008, 0x1182: 0xe00d, 0x1183: 0x0008, 0x1184: 0xe00d, 0x1185: 0x0008, 0x1186: 0xe00d, 0x1187: 0x0008, 0x1188: 0xe00d, 0x1189: 0x0008, 0x118a: 0xe00d, 0x118b: 0x0008, 0x118c: 0xe00d, 0x118d: 0x0008, 0x118e: 0xe00d, 0x118f: 0x0008, 0x1190: 0xe00d, 0x1191: 0x0008, 0x1192: 0xe00d, 0x1193: 0x0008, 0x1194: 0xe00d, 0x1195: 0x0008, 0x1196: 0xe00d, 0x1197: 0x0008, 0x1198: 0xe00d, 0x1199: 0x0008, 0x119a: 0xe00d, 0x119b: 0x0008, 0x119c: 0xe00d, 0x119d: 0x0008, 0x119e: 0xe00d, 0x119f: 0x0008, 0x11a0: 0xe00d, 0x11a1: 0x0008, 0x11a2: 0xe00d, 0x11a3: 0x0008, 0x11a4: 0xe00d, 0x11a5: 0x0008, 0x11a6: 0xe00d, 0x11a7: 0x0008, 0x11a8: 0xe00d, 0x11a9: 0x0008, 0x11aa: 0xe00d, 0x11ab: 0x0008, 0x11ac: 0xe00d, 0x11ad: 0x0008, 0x11ae: 0xe00d, 0x11af: 0x0008, 0x11b0: 0xe0fd, 0x11b1: 0x0008, 0x11b2: 0x0008, 0x11b3: 0x0008, 0x11b4: 0x0008, 0x11b5: 0x0008, 0x11b6: 0x0008, 0x11b7: 0x0008, 0x11b8: 0x0008, 0x11b9: 0xe01d, 0x11ba: 0x0008, 0x11bb: 0xe03d, 0x11bc: 0x0008, 0x11bd: 0x442d, 0x11be: 0xe00d, 0x11bf: 0x0008, // Block 0x47, offset 0x11c0 0x11c0: 0xe00d, 0x11c1: 0x0008, 0x11c2: 0xe00d, 0x11c3: 0x0008, 0x11c4: 0xe00d, 0x11c5: 0x0008, 0x11c6: 0xe00d, 0x11c7: 0x0008, 0x11c8: 0x0008, 0x11c9: 0x0018, 0x11ca: 0x0018, 0x11cb: 0xe03d, 0x11cc: 0x0008, 0x11cd: 0x11d9, 0x11ce: 0x0008, 0x11cf: 0x0008, 0x11d0: 0xe00d, 0x11d1: 0x0008, 0x11d2: 0xe00d, 0x11d3: 0x0008, 0x11d4: 0x0008, 0x11d5: 0x0008, 0x11d6: 0xe00d, 0x11d7: 0x0008, 0x11d8: 0xe00d, 0x11d9: 0x0008, 0x11da: 0xe00d, 0x11db: 0x0008, 0x11dc: 0xe00d, 0x11dd: 0x0008, 0x11de: 0xe00d, 0x11df: 0x0008, 0x11e0: 0xe00d, 0x11e1: 0x0008, 0x11e2: 0xe00d, 0x11e3: 0x0008, 0x11e4: 0xe00d, 0x11e5: 0x0008, 0x11e6: 0xe00d, 0x11e7: 0x0008, 0x11e8: 0xe00d, 0x11e9: 0x0008, 0x11ea: 0x6e29, 0x11eb: 0x1029, 0x11ec: 0x11c1, 0x11ed: 0x6e41, 0x11ee: 0x1221, 0x11ef: 0x0040, 0x11f0: 0x6e59, 0x11f1: 0x6e71, 0x11f2: 0x1239, 0x11f3: 0x444d, 0x11f4: 0xe00d, 0x11f5: 0x0008, 0x11f6: 0xe00d, 0x11f7: 0x0008, 0x11f8: 0x0040, 0x11f9: 0x0040, 0x11fa: 0x0040, 0x11fb: 0x0040, 0x11fc: 0x0040, 0x11fd: 0x0040, 0x11fe: 0x0040, 0x11ff: 0x0040, // Block 0x48, offset 0x1200 0x1200: 0x64d5, 0x1201: 0x64f5, 0x1202: 0x6515, 0x1203: 0x6535, 0x1204: 0x6555, 0x1205: 0x6575, 0x1206: 0x6595, 0x1207: 0x65b5, 0x1208: 0x65d5, 0x1209: 0x65f5, 0x120a: 0x6615, 0x120b: 0x6635, 0x120c: 0x6655, 0x120d: 0x6675, 0x120e: 0x0008, 0x120f: 0x0008, 0x1210: 0x6695, 0x1211: 0x0008, 0x1212: 0x66b5, 0x1213: 0x0008, 0x1214: 0x0008, 0x1215: 0x66d5, 0x1216: 0x66f5, 0x1217: 0x6715, 0x1218: 0x6735, 0x1219: 0x6755, 0x121a: 0x6775, 0x121b: 0x6795, 0x121c: 0x67b5, 0x121d: 0x67d5, 0x121e: 0x67f5, 0x121f: 0x0008, 0x1220: 0x6815, 0x1221: 0x0008, 0x1222: 0x6835, 0x1223: 0x0008, 0x1224: 0x0008, 0x1225: 0x6855, 0x1226: 0x6875, 0x1227: 0x0008, 0x1228: 0x0008, 0x1229: 0x0008, 0x122a: 0x6895, 0x122b: 0x68b5, 0x122c: 0x68d5, 0x122d: 0x68f5, 0x122e: 0x6915, 0x122f: 0x6935, 0x1230: 0x6955, 0x1231: 0x6975, 0x1232: 0x6995, 0x1233: 0x69b5, 0x1234: 0x69d5, 0x1235: 0x69f5, 0x1236: 0x6a15, 0x1237: 0x6a35, 0x1238: 0x6a55, 0x1239: 0x6a75, 0x123a: 0x6a95, 0x123b: 0x6ab5, 0x123c: 0x6ad5, 0x123d: 0x6af5, 0x123e: 0x6b15, 0x123f: 0x6b35, // Block 0x49, offset 0x1240 0x1240: 0x7a95, 0x1241: 0x7ab5, 0x1242: 0x7ad5, 0x1243: 0x7af5, 0x1244: 0x7b15, 0x1245: 0x7b35, 0x1246: 0x7b55, 0x1247: 0x7b75, 0x1248: 0x7b95, 0x1249: 0x7bb5, 0x124a: 0x7bd5, 0x124b: 0x7bf5, 0x124c: 0x7c15, 0x124d: 0x7c35, 0x124e: 0x7c55, 0x124f: 0x6ec9, 0x1250: 0x6ef1, 0x1251: 0x6f19, 0x1252: 0x7c75, 0x1253: 0x7c95, 0x1254: 0x7cb5, 0x1255: 0x6f41, 0x1256: 0x6f69, 0x1257: 0x6f91, 0x1258: 0x7cd5, 0x1259: 0x7cf5, 0x125a: 0x0040, 0x125b: 0x0040, 0x125c: 0x0040, 0x125d: 0x0040, 0x125e: 0x0040, 0x125f: 0x0040, 0x1260: 0x0040, 0x1261: 0x0040, 0x1262: 0x0040, 0x1263: 0x0040, 0x1264: 0x0040, 0x1265: 0x0040, 0x1266: 0x0040, 0x1267: 0x0040, 0x1268: 0x0040, 0x1269: 0x0040, 0x126a: 0x0040, 0x126b: 0x0040, 0x126c: 0x0040, 0x126d: 0x0040, 0x126e: 0x0040, 0x126f: 0x0040, 0x1270: 0x0040, 0x1271: 0x0040, 0x1272: 0x0040, 0x1273: 0x0040, 0x1274: 0x0040, 0x1275: 0x0040, 0x1276: 0x0040, 0x1277: 0x0040, 0x1278: 0x0040, 0x1279: 0x0040, 0x127a: 0x0040, 0x127b: 0x0040, 0x127c: 0x0040, 0x127d: 0x0040, 0x127e: 0x0040, 0x127f: 0x0040, // Block 0x4a, offset 0x1280 0x1280: 0x6fb9, 0x1281: 0x6fd1, 0x1282: 0x6fe9, 0x1283: 0x7d15, 0x1284: 0x7d35, 0x1285: 0x7001, 0x1286: 0x7001, 0x1287: 0x0040, 0x1288: 0x0040, 0x1289: 0x0040, 0x128a: 0x0040, 0x128b: 0x0040, 0x128c: 0x0040, 0x128d: 0x0040, 0x128e: 0x0040, 0x128f: 0x0040, 0x1290: 0x0040, 0x1291: 0x0040, 0x1292: 0x0040, 0x1293: 0x7019, 0x1294: 0x7041, 0x1295: 0x7069, 0x1296: 0x7091, 0x1297: 0x70b9, 0x1298: 0x0040, 0x1299: 0x0040, 0x129a: 0x0040, 0x129b: 0x0040, 0x129c: 0x0040, 0x129d: 0x70e1, 0x129e: 0x3308, 0x129f: 0x7109, 0x12a0: 0x7131, 0x12a1: 0x20a9, 0x12a2: 0x20f1, 0x12a3: 0x7149, 0x12a4: 0x7161, 0x12a5: 0x7179, 0x12a6: 0x7191, 0x12a7: 0x71a9, 0x12a8: 0x71c1, 0x12a9: 0x1fb2, 0x12aa: 0x71d9, 0x12ab: 0x7201, 0x12ac: 0x7229, 0x12ad: 0x7261, 0x12ae: 0x7299, 0x12af: 0x72c1, 0x12b0: 0x72e9, 0x12b1: 0x7311, 0x12b2: 0x7339, 0x12b3: 0x7361, 0x12b4: 0x7389, 0x12b5: 0x73b1, 0x12b6: 0x73d9, 0x12b7: 0x0040, 0x12b8: 0x7401, 0x12b9: 0x7429, 0x12ba: 0x7451, 0x12bb: 0x7479, 0x12bc: 0x74a1, 0x12bd: 0x0040, 0x12be: 0x74c9, 0x12bf: 0x0040, // Block 0x4b, offset 0x12c0 0x12c0: 0x74f1, 0x12c1: 0x7519, 0x12c2: 0x0040, 0x12c3: 0x7541, 0x12c4: 0x7569, 0x12c5: 0x0040, 0x12c6: 0x7591, 0x12c7: 0x75b9, 0x12c8: 0x75e1, 0x12c9: 0x7609, 0x12ca: 0x7631, 0x12cb: 0x7659, 0x12cc: 0x7681, 0x12cd: 0x76a9, 0x12ce: 0x76d1, 0x12cf: 0x76f9, 0x12d0: 0x7721, 0x12d1: 0x7721, 0x12d2: 0x7739, 0x12d3: 0x7739, 0x12d4: 0x7739, 0x12d5: 0x7739, 0x12d6: 0x7751, 0x12d7: 0x7751, 0x12d8: 0x7751, 0x12d9: 0x7751, 0x12da: 0x7769, 0x12db: 0x7769, 0x12dc: 0x7769, 0x12dd: 0x7769, 0x12de: 0x7781, 0x12df: 0x7781, 0x12e0: 0x7781, 0x12e1: 0x7781, 0x12e2: 0x7799, 0x12e3: 0x7799, 0x12e4: 0x7799, 0x12e5: 0x7799, 0x12e6: 0x77b1, 0x12e7: 0x77b1, 0x12e8: 0x77b1, 0x12e9: 0x77b1, 0x12ea: 0x77c9, 0x12eb: 0x77c9, 0x12ec: 0x77c9, 0x12ed: 0x77c9, 0x12ee: 0x77e1, 0x12ef: 0x77e1, 0x12f0: 0x77e1, 0x12f1: 0x77e1, 0x12f2: 0x77f9, 0x12f3: 0x77f9, 0x12f4: 0x77f9, 0x12f5: 0x77f9, 0x12f6: 0x7811, 0x12f7: 0x7811, 0x12f8: 0x7811, 0x12f9: 0x7811, 0x12fa: 0x7829, 0x12fb: 0x7829, 0x12fc: 0x7829, 0x12fd: 0x7829, 0x12fe: 0x7841, 0x12ff: 0x7841, // Block 0x4c, offset 0x1300 0x1300: 0x7841, 0x1301: 0x7841, 0x1302: 0x7859, 0x1303: 0x7859, 0x1304: 0x7871, 0x1305: 0x7871, 0x1306: 0x7889, 0x1307: 0x7889, 0x1308: 0x78a1, 0x1309: 0x78a1, 0x130a: 0x78b9, 0x130b: 0x78b9, 0x130c: 0x78d1, 0x130d: 0x78d1, 0x130e: 0x78e9, 0x130f: 0x78e9, 0x1310: 0x78e9, 0x1311: 0x78e9, 0x1312: 0x7901, 0x1313: 0x7901, 0x1314: 0x7901, 0x1315: 0x7901, 0x1316: 0x7919, 0x1317: 0x7919, 0x1318: 0x7919, 0x1319: 0x7919, 0x131a: 0x7931, 0x131b: 0x7931, 0x131c: 0x7931, 0x131d: 0x7931, 0x131e: 0x7949, 0x131f: 0x7949, 0x1320: 0x7961, 0x1321: 0x7961, 0x1322: 0x7961, 0x1323: 0x7961, 0x1324: 0x7979, 0x1325: 0x7979, 0x1326: 0x7991, 0x1327: 0x7991, 0x1328: 0x7991, 0x1329: 0x7991, 0x132a: 0x79a9, 0x132b: 0x79a9, 0x132c: 0x79a9, 0x132d: 0x79a9, 0x132e: 0x79c1, 0x132f: 0x79c1, 0x1330: 0x79d9, 0x1331: 0x79d9, 0x1332: 0x0818, 0x1333: 0x0818, 0x1334: 0x0818, 0x1335: 0x0818, 0x1336: 0x0818, 0x1337: 0x0818, 0x1338: 0x0818, 0x1339: 0x0818, 0x133a: 0x0818, 0x133b: 0x0818, 0x133c: 0x0818, 0x133d: 0x0818, 0x133e: 0x0818, 0x133f: 0x0818, // Block 0x4d, offset 0x1340 0x1340: 0x0818, 0x1341: 0x0818, 0x1342: 0x0040, 0x1343: 0x0040, 0x1344: 0x0040, 0x1345: 0x0040, 0x1346: 0x0040, 0x1347: 0x0040, 0x1348: 0x0040, 0x1349: 0x0040, 0x134a: 0x0040, 0x134b: 0x0040, 0x134c: 0x0040, 0x134d: 0x0040, 0x134e: 0x0040, 0x134f: 0x0040, 0x1350: 0x0040, 0x1351: 0x0040, 0x1352: 0x0040, 0x1353: 0x79f1, 0x1354: 0x79f1, 0x1355: 0x79f1, 0x1356: 0x79f1, 0x1357: 0x7a09, 0x1358: 0x7a09, 0x1359: 0x7a21, 0x135a: 0x7a21, 0x135b: 0x7a39, 0x135c: 0x7a39, 0x135d: 0x0479, 0x135e: 0x7a51, 0x135f: 0x7a51, 0x1360: 0x7a69, 0x1361: 0x7a69, 0x1362: 0x7a81, 0x1363: 0x7a81, 0x1364: 0x7a99, 0x1365: 0x7a99, 0x1366: 0x7a99, 0x1367: 0x7a99, 0x1368: 0x7ab1, 0x1369: 0x7ab1, 0x136a: 0x7ac9, 0x136b: 0x7ac9, 0x136c: 0x7af1, 0x136d: 0x7af1, 0x136e: 0x7b19, 0x136f: 0x7b19, 0x1370: 0x7b41, 0x1371: 0x7b41, 0x1372: 0x7b69, 0x1373: 0x7b69, 0x1374: 0x7b91, 0x1375: 0x7b91, 0x1376: 0x7bb9, 0x1377: 0x7bb9, 0x1378: 0x7bb9, 0x1379: 0x7be1, 0x137a: 0x7be1, 0x137b: 0x7be1, 0x137c: 0x7c09, 0x137d: 0x7c09, 0x137e: 0x7c09, 0x137f: 0x7c09, // Block 0x4e, offset 0x1380 0x1380: 0x85f9, 0x1381: 0x8621, 0x1382: 0x8649, 0x1383: 0x8671, 0x1384: 0x8699, 0x1385: 0x86c1, 0x1386: 0x86e9, 0x1387: 0x8711, 0x1388: 0x8739, 0x1389: 0x8761, 0x138a: 0x8789, 0x138b: 0x87b1, 0x138c: 0x87d9, 0x138d: 0x8801, 0x138e: 0x8829, 0x138f: 0x8851, 0x1390: 0x8879, 0x1391: 0x88a1, 0x1392: 0x88c9, 0x1393: 0x88f1, 0x1394: 0x8919, 0x1395: 0x8941, 0x1396: 0x8969, 0x1397: 0x8991, 0x1398: 0x89b9, 0x1399: 0x89e1, 0x139a: 0x8a09, 0x139b: 0x8a31, 0x139c: 0x8a59, 0x139d: 0x8a81, 0x139e: 0x8aaa, 0x139f: 0x8ada, 0x13a0: 0x8b0a, 0x13a1: 0x8b3a, 0x13a2: 0x8b6a, 0x13a3: 0x8b9a, 0x13a4: 0x8bc9, 0x13a5: 0x8bf1, 0x13a6: 0x7c71, 0x13a7: 0x8c19, 0x13a8: 0x7be1, 0x13a9: 0x7c99, 0x13aa: 0x8c41, 0x13ab: 0x8c69, 0x13ac: 0x7d39, 0x13ad: 0x8c91, 0x13ae: 0x7d61, 0x13af: 0x7d89, 0x13b0: 0x8cb9, 0x13b1: 0x8ce1, 0x13b2: 0x7e29, 0x13b3: 0x8d09, 0x13b4: 0x7e51, 0x13b5: 0x7e79, 0x13b6: 0x8d31, 0x13b7: 0x8d59, 0x13b8: 0x7ec9, 0x13b9: 0x8d81, 0x13ba: 0x7ef1, 0x13bb: 0x7f19, 0x13bc: 0x83a1, 0x13bd: 0x83c9, 0x13be: 0x8441, 0x13bf: 0x8469, // Block 0x4f, offset 0x13c0 0x13c0: 0x8491, 0x13c1: 0x8531, 0x13c2: 0x8559, 0x13c3: 0x8581, 0x13c4: 0x85a9, 0x13c5: 0x8649, 0x13c6: 0x8671, 0x13c7: 0x8699, 0x13c8: 0x8da9, 0x13c9: 0x8739, 0x13ca: 0x8dd1, 0x13cb: 0x8df9, 0x13cc: 0x8829, 0x13cd: 0x8e21, 0x13ce: 0x8851, 0x13cf: 0x8879, 0x13d0: 0x8a81, 0x13d1: 0x8e49, 0x13d2: 0x8e71, 0x13d3: 0x89b9, 0x13d4: 0x8e99, 0x13d5: 0x89e1, 0x13d6: 0x8a09, 0x13d7: 0x7c21, 0x13d8: 0x7c49, 0x13d9: 0x8ec1, 0x13da: 0x7c71, 0x13db: 0x8ee9, 0x13dc: 0x7cc1, 0x13dd: 0x7ce9, 0x13de: 0x7d11, 0x13df: 0x7d39, 0x13e0: 0x8f11, 0x13e1: 0x7db1, 0x13e2: 0x7dd9, 0x13e3: 0x7e01, 0x13e4: 0x7e29, 0x13e5: 0x8f39, 0x13e6: 0x7ec9, 0x13e7: 0x7f41, 0x13e8: 0x7f69, 0x13e9: 0x7f91, 0x13ea: 0x7fb9, 0x13eb: 0x7fe1, 0x13ec: 0x8031, 0x13ed: 0x8059, 0x13ee: 0x8081, 0x13ef: 0x80a9, 0x13f0: 0x80d1, 0x13f1: 0x80f9, 0x13f2: 0x8f61, 0x13f3: 0x8121, 0x13f4: 0x8149, 0x13f5: 0x8171, 0x13f6: 0x8199, 0x13f7: 0x81c1, 0x13f8: 0x81e9, 0x13f9: 0x8239, 0x13fa: 0x8261, 0x13fb: 0x8289, 0x13fc: 0x82b1, 0x13fd: 0x82d9, 0x13fe: 0x8301, 0x13ff: 0x8329, // Block 0x50, offset 0x1400 0x1400: 0x8351, 0x1401: 0x8379, 0x1402: 0x83f1, 0x1403: 0x8419, 0x1404: 0x84b9, 0x1405: 0x84e1, 0x1406: 0x8509, 0x1407: 0x8531, 0x1408: 0x8559, 0x1409: 0x85d1, 0x140a: 0x85f9, 0x140b: 0x8621, 0x140c: 0x8649, 0x140d: 0x8f89, 0x140e: 0x86c1, 0x140f: 0x86e9, 0x1410: 0x8711, 0x1411: 0x8739, 0x1412: 0x87b1, 0x1413: 0x87d9, 0x1414: 0x8801, 0x1415: 0x8829, 0x1416: 0x8fb1, 0x1417: 0x88a1, 0x1418: 0x88c9, 0x1419: 0x8fd9, 0x141a: 0x8941, 0x141b: 0x8969, 0x141c: 0x8991, 0x141d: 0x89b9, 0x141e: 0x9001, 0x141f: 0x7c71, 0x1420: 0x8ee9, 0x1421: 0x7d39, 0x1422: 0x8f11, 0x1423: 0x7e29, 0x1424: 0x8f39, 0x1425: 0x7ec9, 0x1426: 0x9029, 0x1427: 0x80d1, 0x1428: 0x9051, 0x1429: 0x9079, 0x142a: 0x90a1, 0x142b: 0x8531, 0x142c: 0x8559, 0x142d: 0x8649, 0x142e: 0x8829, 0x142f: 0x8fb1, 0x1430: 0x89b9, 0x1431: 0x9001, 0x1432: 0x90c9, 0x1433: 0x9101, 0x1434: 0x9139, 0x1435: 0x9171, 0x1436: 0x9199, 0x1437: 0x91c1, 0x1438: 0x91e9, 0x1439: 0x9211, 0x143a: 0x9239, 0x143b: 0x9261, 0x143c: 0x9289, 0x143d: 0x92b1, 0x143e: 0x92d9, 0x143f: 0x9301, // Block 0x51, offset 0x1440 0x1440: 0x9329, 0x1441: 0x9351, 0x1442: 0x9379, 0x1443: 0x93a1, 0x1444: 0x93c9, 0x1445: 0x93f1, 0x1446: 0x9419, 0x1447: 0x9441, 0x1448: 0x9469, 0x1449: 0x9491, 0x144a: 0x94b9, 0x144b: 0x94e1, 0x144c: 0x9079, 0x144d: 0x9509, 0x144e: 0x9531, 0x144f: 0x9559, 0x1450: 0x9581, 0x1451: 0x9171, 0x1452: 0x9199, 0x1453: 0x91c1, 0x1454: 0x91e9, 0x1455: 0x9211, 0x1456: 0x9239, 0x1457: 0x9261, 0x1458: 0x9289, 0x1459: 0x92b1, 0x145a: 0x92d9, 0x145b: 0x9301, 0x145c: 0x9329, 0x145d: 0x9351, 0x145e: 0x9379, 0x145f: 0x93a1, 0x1460: 0x93c9, 0x1461: 0x93f1, 0x1462: 0x9419, 0x1463: 0x9441, 0x1464: 0x9469, 0x1465: 0x9491, 0x1466: 0x94b9, 0x1467: 0x94e1, 0x1468: 0x9079, 0x1469: 0x9509, 0x146a: 0x9531, 0x146b: 0x9559, 0x146c: 0x9581, 0x146d: 0x9491, 0x146e: 0x94b9, 0x146f: 0x94e1, 0x1470: 0x9079, 0x1471: 0x9051, 0x1472: 0x90a1, 0x1473: 0x8211, 0x1474: 0x8059, 0x1475: 0x8081, 0x1476: 0x80a9, 0x1477: 0x9491, 0x1478: 0x94b9, 0x1479: 0x94e1, 0x147a: 0x8211, 0x147b: 0x8239, 0x147c: 0x95a9, 0x147d: 0x95a9, 0x147e: 0x0018, 0x147f: 0x0018, // Block 0x52, offset 0x1480 0x1480: 0x0040, 0x1481: 0x0040, 0x1482: 0x0040, 0x1483: 0x0040, 0x1484: 0x0040, 0x1485: 0x0040, 0x1486: 0x0040, 0x1487: 0x0040, 0x1488: 0x0040, 0x1489: 0x0040, 0x148a: 0x0040, 0x148b: 0x0040, 0x148c: 0x0040, 0x148d: 0x0040, 0x148e: 0x0040, 0x148f: 0x0040, 0x1490: 0x95d1, 0x1491: 0x9609, 0x1492: 0x9609, 0x1493: 0x9641, 0x1494: 0x9679, 0x1495: 0x96b1, 0x1496: 0x96e9, 0x1497: 0x9721, 0x1498: 0x9759, 0x1499: 0x9759, 0x149a: 0x9791, 0x149b: 0x97c9, 0x149c: 0x9801, 0x149d: 0x9839, 0x149e: 0x9871, 0x149f: 0x98a9, 0x14a0: 0x98a9, 0x14a1: 0x98e1, 0x14a2: 0x9919, 0x14a3: 0x9919, 0x14a4: 0x9951, 0x14a5: 0x9951, 0x14a6: 0x9989, 0x14a7: 0x99c1, 0x14a8: 0x99c1, 0x14a9: 0x99f9, 0x14aa: 0x9a31, 0x14ab: 0x9a31, 0x14ac: 0x9a69, 0x14ad: 0x9a69, 0x14ae: 0x9aa1, 0x14af: 0x9ad9, 0x14b0: 0x9ad9, 0x14b1: 0x9b11, 0x14b2: 0x9b11, 0x14b3: 0x9b49, 0x14b4: 0x9b81, 0x14b5: 0x9bb9, 0x14b6: 0x9bf1, 0x14b7: 0x9bf1, 0x14b8: 0x9c29, 0x14b9: 0x9c61, 0x14ba: 0x9c99, 0x14bb: 0x9cd1, 0x14bc: 0x9d09, 0x14bd: 0x9d09, 0x14be: 0x9d41, 0x14bf: 0x9d79, // Block 0x53, offset 0x14c0 0x14c0: 0xa949, 0x14c1: 0xa981, 0x14c2: 0xa9b9, 0x14c3: 0xa8a1, 0x14c4: 0x9bb9, 0x14c5: 0x9989, 0x14c6: 0xa9f1, 0x14c7: 0xaa29, 0x14c8: 0x0040, 0x14c9: 0x0040, 0x14ca: 0x0040, 0x14cb: 0x0040, 0x14cc: 0x0040, 0x14cd: 0x0040, 0x14ce: 0x0040, 0x14cf: 0x0040, 0x14d0: 0x0040, 0x14d1: 0x0040, 0x14d2: 0x0040, 0x14d3: 0x0040, 0x14d4: 0x0040, 0x14d5: 0x0040, 0x14d6: 0x0040, 0x14d7: 0x0040, 0x14d8: 0x0040, 0x14d9: 0x0040, 0x14da: 0x0040, 0x14db: 0x0040, 0x14dc: 0x0040, 0x14dd: 0x0040, 0x14de: 0x0040, 0x14df: 0x0040, 0x14e0: 0x0040, 0x14e1: 0x0040, 0x14e2: 0x0040, 0x14e3: 0x0040, 0x14e4: 0x0040, 0x14e5: 0x0040, 0x14e6: 0x0040, 0x14e7: 0x0040, 0x14e8: 0x0040, 0x14e9: 0x0040, 0x14ea: 0x0040, 0x14eb: 0x0040, 0x14ec: 0x0040, 0x14ed: 0x0040, 0x14ee: 0x0040, 0x14ef: 0x0040, 0x14f0: 0xaa61, 0x14f1: 0xaa99, 0x14f2: 0xaad1, 0x14f3: 0xab19, 0x14f4: 0xab61, 0x14f5: 0xaba9, 0x14f6: 0xabf1, 0x14f7: 0xac39, 0x14f8: 0xac81, 0x14f9: 0xacc9, 0x14fa: 0xad02, 0x14fb: 0xae12, 0x14fc: 0xae91, 0x14fd: 0x0018, 0x14fe: 0x0040, 0x14ff: 0x0040, // Block 0x54, offset 0x1500 0x1500: 0x33c0, 0x1501: 0x33c0, 0x1502: 0x33c0, 0x1503: 0x33c0, 0x1504: 0x33c0, 0x1505: 0x33c0, 0x1506: 0x33c0, 0x1507: 0x33c0, 0x1508: 0x33c0, 0x1509: 0x33c0, 0x150a: 0x33c0, 0x150b: 0x33c0, 0x150c: 0x33c0, 0x150d: 0x33c0, 0x150e: 0x33c0, 0x150f: 0x33c0, 0x1510: 0xaeda, 0x1511: 0x7d55, 0x1512: 0x0040, 0x1513: 0xaeea, 0x1514: 0x03c2, 0x1515: 0xaefa, 0x1516: 0xaf0a, 0x1517: 0x7d75, 0x1518: 0x7d95, 0x1519: 0x0040, 0x151a: 0x0040, 0x151b: 0x0040, 0x151c: 0x0040, 0x151d: 0x0040, 0x151e: 0x0040, 0x151f: 0x0040, 0x1520: 0x3308, 0x1521: 0x3308, 0x1522: 0x3308, 0x1523: 0x3308, 0x1524: 0x3308, 0x1525: 0x3308, 0x1526: 0x3308, 0x1527: 0x3308, 0x1528: 0x3308, 0x1529: 0x3308, 0x152a: 0x3308, 0x152b: 0x3308, 0x152c: 0x3308, 0x152d: 0x3308, 0x152e: 0x3308, 0x152f: 0x3308, 0x1530: 0x0040, 0x1531: 0x7db5, 0x1532: 0x7dd5, 0x1533: 0xaf1a, 0x1534: 0xaf1a, 0x1535: 0x1fd2, 0x1536: 0x1fe2, 0x1537: 0xaf2a, 0x1538: 0xaf3a, 0x1539: 0x7df5, 0x153a: 0x7e15, 0x153b: 0x7e35, 0x153c: 0x7df5, 0x153d: 0x7e55, 0x153e: 0x7e75, 0x153f: 0x7e55, // Block 0x55, offset 0x1540 0x1540: 0x7e95, 0x1541: 0x7eb5, 0x1542: 0x7ed5, 0x1543: 0x7eb5, 0x1544: 0x7ef5, 0x1545: 0x0018, 0x1546: 0x0018, 0x1547: 0xaf4a, 0x1548: 0xaf5a, 0x1549: 0x7f16, 0x154a: 0x7f36, 0x154b: 0x7f56, 0x154c: 0x7f76, 0x154d: 0xaf1a, 0x154e: 0xaf1a, 0x154f: 0xaf1a, 0x1550: 0xaeda, 0x1551: 0x7f95, 0x1552: 0x0040, 0x1553: 0x0040, 0x1554: 0x03c2, 0x1555: 0xaeea, 0x1556: 0xaf0a, 0x1557: 0xaefa, 0x1558: 0x7fb5, 0x1559: 0x1fd2, 0x155a: 0x1fe2, 0x155b: 0xaf2a, 0x155c: 0xaf3a, 0x155d: 0x7e95, 0x155e: 0x7ef5, 0x155f: 0xaf6a, 0x1560: 0xaf7a, 0x1561: 0xaf8a, 0x1562: 0x1fb2, 0x1563: 0xaf99, 0x1564: 0xafaa, 0x1565: 0xafba, 0x1566: 0x1fc2, 0x1567: 0x0040, 0x1568: 0xafca, 0x1569: 0xafda, 0x156a: 0xafea, 0x156b: 0xaffa, 0x156c: 0x0040, 0x156d: 0x0040, 0x156e: 0x0040, 0x156f: 0x0040, 0x1570: 0x7fd6, 0x1571: 0xb009, 0x1572: 0x7ff6, 0x1573: 0x0808, 0x1574: 0x8016, 0x1575: 0x0040, 0x1576: 0x8036, 0x1577: 0xb031, 0x1578: 0x8056, 0x1579: 0xb059, 0x157a: 0x8076, 0x157b: 0xb081, 0x157c: 0x8096, 0x157d: 0xb0a9, 0x157e: 0x80b6, 0x157f: 0xb0d1, // Block 0x56, offset 0x1580 0x1580: 0xb0f9, 0x1581: 0xb111, 0x1582: 0xb111, 0x1583: 0xb129, 0x1584: 0xb129, 0x1585: 0xb141, 0x1586: 0xb141, 0x1587: 0xb159, 0x1588: 0xb159, 0x1589: 0xb171, 0x158a: 0xb171, 0x158b: 0xb171, 0x158c: 0xb171, 0x158d: 0xb189, 0x158e: 0xb189, 0x158f: 0xb1a1, 0x1590: 0xb1a1, 0x1591: 0xb1a1, 0x1592: 0xb1a1, 0x1593: 0xb1b9, 0x1594: 0xb1b9, 0x1595: 0xb1d1, 0x1596: 0xb1d1, 0x1597: 0xb1d1, 0x1598: 0xb1d1, 0x1599: 0xb1e9, 0x159a: 0xb1e9, 0x159b: 0xb1e9, 0x159c: 0xb1e9, 0x159d: 0xb201, 0x159e: 0xb201, 0x159f: 0xb201, 0x15a0: 0xb201, 0x15a1: 0xb219, 0x15a2: 0xb219, 0x15a3: 0xb219, 0x15a4: 0xb219, 0x15a5: 0xb231, 0x15a6: 0xb231, 0x15a7: 0xb231, 0x15a8: 0xb231, 0x15a9: 0xb249, 0x15aa: 0xb249, 0x15ab: 0xb261, 0x15ac: 0xb261, 0x15ad: 0xb279, 0x15ae: 0xb279, 0x15af: 0xb291, 0x15b0: 0xb291, 0x15b1: 0xb2a9, 0x15b2: 0xb2a9, 0x15b3: 0xb2a9, 0x15b4: 0xb2a9, 0x15b5: 0xb2c1, 0x15b6: 0xb2c1, 0x15b7: 0xb2c1, 0x15b8: 0xb2c1, 0x15b9: 0xb2d9, 0x15ba: 0xb2d9, 0x15bb: 0xb2d9, 0x15bc: 0xb2d9, 0x15bd: 0xb2f1, 0x15be: 0xb2f1, 0x15bf: 0xb2f1, // Block 0x57, offset 0x15c0 0x15c0: 0xb2f1, 0x15c1: 0xb309, 0x15c2: 0xb309, 0x15c3: 0xb309, 0x15c4: 0xb309, 0x15c5: 0xb321, 0x15c6: 0xb321, 0x15c7: 0xb321, 0x15c8: 0xb321, 0x15c9: 0xb339, 0x15ca: 0xb339, 0x15cb: 0xb339, 0x15cc: 0xb339, 0x15cd: 0xb351, 0x15ce: 0xb351, 0x15cf: 0xb351, 0x15d0: 0xb351, 0x15d1: 0xb369, 0x15d2: 0xb369, 0x15d3: 0xb369, 0x15d4: 0xb369, 0x15d5: 0xb381, 0x15d6: 0xb381, 0x15d7: 0xb381, 0x15d8: 0xb381, 0x15d9: 0xb399, 0x15da: 0xb399, 0x15db: 0xb399, 0x15dc: 0xb399, 0x15dd: 0xb3b1, 0x15de: 0xb3b1, 0x15df: 0xb3b1, 0x15e0: 0xb3b1, 0x15e1: 0xb3c9, 0x15e2: 0xb3c9, 0x15e3: 0xb3c9, 0x15e4: 0xb3c9, 0x15e5: 0xb3e1, 0x15e6: 0xb3e1, 0x15e7: 0xb3e1, 0x15e8: 0xb3e1, 0x15e9: 0xb3f9, 0x15ea: 0xb3f9, 0x15eb: 0xb3f9, 0x15ec: 0xb3f9, 0x15ed: 0xb411, 0x15ee: 0xb411, 0x15ef: 0x7ab1, 0x15f0: 0x7ab1, 0x15f1: 0xb429, 0x15f2: 0xb429, 0x15f3: 0xb429, 0x15f4: 0xb429, 0x15f5: 0xb441, 0x15f6: 0xb441, 0x15f7: 0xb469, 0x15f8: 0xb469, 0x15f9: 0xb491, 0x15fa: 0xb491, 0x15fb: 0xb4b9, 0x15fc: 0xb4b9, 0x15fd: 0x0040, 0x15fe: 0x0040, 0x15ff: 0x03c0, // Block 0x58, offset 0x1600 0x1600: 0x0040, 0x1601: 0xaefa, 0x1602: 0xb4e2, 0x1603: 0xaf6a, 0x1604: 0xafda, 0x1605: 0xafea, 0x1606: 0xaf7a, 0x1607: 0xb4f2, 0x1608: 0x1fd2, 0x1609: 0x1fe2, 0x160a: 0xaf8a, 0x160b: 0x1fb2, 0x160c: 0xaeda, 0x160d: 0xaf99, 0x160e: 0x29d1, 0x160f: 0xb502, 0x1610: 0x1f41, 0x1611: 0x00c9, 0x1612: 0x0069, 0x1613: 0x0079, 0x1614: 0x1f51, 0x1615: 0x1f61, 0x1616: 0x1f71, 0x1617: 0x1f81, 0x1618: 0x1f91, 0x1619: 0x1fa1, 0x161a: 0xaeea, 0x161b: 0x03c2, 0x161c: 0xafaa, 0x161d: 0x1fc2, 0x161e: 0xafba, 0x161f: 0xaf0a, 0x1620: 0xaffa, 0x1621: 0x0039, 0x1622: 0x0ee9, 0x1623: 0x1159, 0x1624: 0x0ef9, 0x1625: 0x0f09, 0x1626: 0x1199, 0x1627: 0x0f31, 0x1628: 0x0249, 0x1629: 0x0f41, 0x162a: 0x0259, 0x162b: 0x0f51, 0x162c: 0x0359, 0x162d: 0x0f61, 0x162e: 0x0f71, 0x162f: 0x00d9, 0x1630: 0x0f99, 0x1631: 0x2039, 0x1632: 0x0269, 0x1633: 0x01d9, 0x1634: 0x0fa9, 0x1635: 0x0fb9, 0x1636: 0x1089, 0x1637: 0x0279, 0x1638: 0x0369, 0x1639: 0x0289, 0x163a: 0x13d1, 0x163b: 0xaf4a, 0x163c: 0xafca, 0x163d: 0xaf5a, 0x163e: 0xb512, 0x163f: 0xaf1a, // Block 0x59, offset 0x1640 0x1640: 0x1caa, 0x1641: 0x0039, 0x1642: 0x0ee9, 0x1643: 0x1159, 0x1644: 0x0ef9, 0x1645: 0x0f09, 0x1646: 0x1199, 0x1647: 0x0f31, 0x1648: 0x0249, 0x1649: 0x0f41, 0x164a: 0x0259, 0x164b: 0x0f51, 0x164c: 0x0359, 0x164d: 0x0f61, 0x164e: 0x0f71, 0x164f: 0x00d9, 0x1650: 0x0f99, 0x1651: 0x2039, 0x1652: 0x0269, 0x1653: 0x01d9, 0x1654: 0x0fa9, 0x1655: 0x0fb9, 0x1656: 0x1089, 0x1657: 0x0279, 0x1658: 0x0369, 0x1659: 0x0289, 0x165a: 0x13d1, 0x165b: 0xaf2a, 0x165c: 0xb522, 0x165d: 0xaf3a, 0x165e: 0xb532, 0x165f: 0x80d5, 0x1660: 0x80f5, 0x1661: 0x29d1, 0x1662: 0x8115, 0x1663: 0x8115, 0x1664: 0x8135, 0x1665: 0x8155, 0x1666: 0x8175, 0x1667: 0x8195, 0x1668: 0x81b5, 0x1669: 0x81d5, 0x166a: 0x81f5, 0x166b: 0x8215, 0x166c: 0x8235, 0x166d: 0x8255, 0x166e: 0x8275, 0x166f: 0x8295, 0x1670: 0x82b5, 0x1671: 0x82d5, 0x1672: 0x82f5, 0x1673: 0x8315, 0x1674: 0x8335, 0x1675: 0x8355, 0x1676: 0x8375, 0x1677: 0x8395, 0x1678: 0x83b5, 0x1679: 0x83d5, 0x167a: 0x83f5, 0x167b: 0x8415, 0x167c: 0x81b5, 0x167d: 0x8435, 0x167e: 0x8455, 0x167f: 0x8215, // Block 0x5a, offset 0x1680 0x1680: 0x8475, 0x1681: 0x8495, 0x1682: 0x84b5, 0x1683: 0x84d5, 0x1684: 0x84f5, 0x1685: 0x8515, 0x1686: 0x8535, 0x1687: 0x8555, 0x1688: 0x84d5, 0x1689: 0x8575, 0x168a: 0x84d5, 0x168b: 0x8595, 0x168c: 0x8595, 0x168d: 0x85b5, 0x168e: 0x85b5, 0x168f: 0x85d5, 0x1690: 0x8515, 0x1691: 0x85f5, 0x1692: 0x8615, 0x1693: 0x85f5, 0x1694: 0x8635, 0x1695: 0x8615, 0x1696: 0x8655, 0x1697: 0x8655, 0x1698: 0x8675, 0x1699: 0x8675, 0x169a: 0x8695, 0x169b: 0x8695, 0x169c: 0x8615, 0x169d: 0x8115, 0x169e: 0x86b5, 0x169f: 0x86d5, 0x16a0: 0x0040, 0x16a1: 0x86f5, 0x16a2: 0x8715, 0x16a3: 0x8735, 0x16a4: 0x8755, 0x16a5: 0x8735, 0x16a6: 0x8775, 0x16a7: 0x8795, 0x16a8: 0x87b5, 0x16a9: 0x87b5, 0x16aa: 0x87d5, 0x16ab: 0x87d5, 0x16ac: 0x87f5, 0x16ad: 0x87f5, 0x16ae: 0x87d5, 0x16af: 0x87d5, 0x16b0: 0x8815, 0x16b1: 0x8835, 0x16b2: 0x8855, 0x16b3: 0x8875, 0x16b4: 0x8895, 0x16b5: 0x88b5, 0x16b6: 0x88b5, 0x16b7: 0x88b5, 0x16b8: 0x88d5, 0x16b9: 0x88d5, 0x16ba: 0x88d5, 0x16bb: 0x88d5, 0x16bc: 0x87b5, 0x16bd: 0x87b5, 0x16be: 0x87b5, 0x16bf: 0x0040, // Block 0x5b, offset 0x16c0 0x16c0: 0x0040, 0x16c1: 0x0040, 0x16c2: 0x8715, 0x16c3: 0x86f5, 0x16c4: 0x88f5, 0x16c5: 0x86f5, 0x16c6: 0x8715, 0x16c7: 0x86f5, 0x16c8: 0x0040, 0x16c9: 0x0040, 0x16ca: 0x8915, 0x16cb: 0x8715, 0x16cc: 0x8935, 0x16cd: 0x88f5, 0x16ce: 0x8935, 0x16cf: 0x8715, 0x16d0: 0x0040, 0x16d1: 0x0040, 0x16d2: 0x8955, 0x16d3: 0x8975, 0x16d4: 0x8875, 0x16d5: 0x8935, 0x16d6: 0x88f5, 0x16d7: 0x8935, 0x16d8: 0x0040, 0x16d9: 0x0040, 0x16da: 0x8995, 0x16db: 0x89b5, 0x16dc: 0x8995, 0x16dd: 0x0040, 0x16de: 0x0040, 0x16df: 0x0040, 0x16e0: 0xb541, 0x16e1: 0xb559, 0x16e2: 0xb571, 0x16e3: 0x89d6, 0x16e4: 0xb589, 0x16e5: 0xb5a1, 0x16e6: 0x89f5, 0x16e7: 0x0040, 0x16e8: 0x8a15, 0x16e9: 0x8a35, 0x16ea: 0x8a55, 0x16eb: 0x8a35, 0x16ec: 0x8a75, 0x16ed: 0x8a95, 0x16ee: 0x8ab5, 0x16ef: 0x0040, 0x16f0: 0x0040, 0x16f1: 0x0040, 0x16f2: 0x0040, 0x16f3: 0x0040, 0x16f4: 0x0040, 0x16f5: 0x0040, 0x16f6: 0x0040, 0x16f7: 0x0040, 0x16f8: 0x0040, 0x16f9: 0x0340, 0x16fa: 0x0340, 0x16fb: 0x0340, 0x16fc: 0x0040, 0x16fd: 0x0040, 0x16fe: 0x0040, 0x16ff: 0x0040, // Block 0x5c, offset 0x1700 0x1700: 0x0a08, 0x1701: 0x0a08, 0x1702: 0x0a08, 0x1703: 0x0a08, 0x1704: 0x0a08, 0x1705: 0x0c08, 0x1706: 0x0808, 0x1707: 0x0c08, 0x1708: 0x0818, 0x1709: 0x0c08, 0x170a: 0x0c08, 0x170b: 0x0808, 0x170c: 0x0808, 0x170d: 0x0908, 0x170e: 0x0c08, 0x170f: 0x0c08, 0x1710: 0x0c08, 0x1711: 0x0c08, 0x1712: 0x0c08, 0x1713: 0x0a08, 0x1714: 0x0a08, 0x1715: 0x0a08, 0x1716: 0x0a08, 0x1717: 0x0908, 0x1718: 0x0a08, 0x1719: 0x0a08, 0x171a: 0x0a08, 0x171b: 0x0a08, 0x171c: 0x0a08, 0x171d: 0x0c08, 0x171e: 0x0a08, 0x171f: 0x0a08, 0x1720: 0x0a08, 0x1721: 0x0c08, 0x1722: 0x0808, 0x1723: 0x0808, 0x1724: 0x0c08, 0x1725: 0x3308, 0x1726: 0x3308, 0x1727: 0x0040, 0x1728: 0x0040, 0x1729: 0x0040, 0x172a: 0x0040, 0x172b: 0x0a18, 0x172c: 0x0a18, 0x172d: 0x0a18, 0x172e: 0x0a18, 0x172f: 0x0c18, 0x1730: 0x0818, 0x1731: 0x0818, 0x1732: 0x0818, 0x1733: 0x0818, 0x1734: 0x0818, 0x1735: 0x0818, 0x1736: 0x0818, 0x1737: 0x0040, 0x1738: 0x0040, 0x1739: 0x0040, 0x173a: 0x0040, 0x173b: 0x0040, 0x173c: 0x0040, 0x173d: 0x0040, 0x173e: 0x0040, 0x173f: 0x0040, // Block 0x5d, offset 0x1740 0x1740: 0x0a08, 0x1741: 0x0c08, 0x1742: 0x0a08, 0x1743: 0x0c08, 0x1744: 0x0c08, 0x1745: 0x0c08, 0x1746: 0x0a08, 0x1747: 0x0a08, 0x1748: 0x0a08, 0x1749: 0x0c08, 0x174a: 0x0a08, 0x174b: 0x0a08, 0x174c: 0x0c08, 0x174d: 0x0a08, 0x174e: 0x0c08, 0x174f: 0x0c08, 0x1750: 0x0a08, 0x1751: 0x0c08, 0x1752: 0x0040, 0x1753: 0x0040, 0x1754: 0x0040, 0x1755: 0x0040, 0x1756: 0x0040, 0x1757: 0x0040, 0x1758: 0x0040, 0x1759: 0x0818, 0x175a: 0x0818, 0x175b: 0x0818, 0x175c: 0x0818, 0x175d: 0x0040, 0x175e: 0x0040, 0x175f: 0x0040, 0x1760: 0x0040, 0x1761: 0x0040, 0x1762: 0x0040, 0x1763: 0x0040, 0x1764: 0x0040, 0x1765: 0x0040, 0x1766: 0x0040, 0x1767: 0x0040, 0x1768: 0x0040, 0x1769: 0x0c18, 0x176a: 0x0c18, 0x176b: 0x0c18, 0x176c: 0x0c18, 0x176d: 0x0a18, 0x176e: 0x0a18, 0x176f: 0x0818, 0x1770: 0x0040, 0x1771: 0x0040, 0x1772: 0x0040, 0x1773: 0x0040, 0x1774: 0x0040, 0x1775: 0x0040, 0x1776: 0x0040, 0x1777: 0x0040, 0x1778: 0x0040, 0x1779: 0x0040, 0x177a: 0x0040, 0x177b: 0x0040, 0x177c: 0x0040, 0x177d: 0x0040, 0x177e: 0x0040, 0x177f: 0x0040, // Block 0x5e, offset 0x1780 0x1780: 0x3308, 0x1781: 0x3308, 0x1782: 0x3008, 0x1783: 0x3008, 0x1784: 0x0040, 0x1785: 0x0008, 0x1786: 0x0008, 0x1787: 0x0008, 0x1788: 0x0008, 0x1789: 0x0008, 0x178a: 0x0008, 0x178b: 0x0008, 0x178c: 0x0008, 0x178d: 0x0040, 0x178e: 0x0040, 0x178f: 0x0008, 0x1790: 0x0008, 0x1791: 0x0040, 0x1792: 0x0040, 0x1793: 0x0008, 0x1794: 0x0008, 0x1795: 0x0008, 0x1796: 0x0008, 0x1797: 0x0008, 0x1798: 0x0008, 0x1799: 0x0008, 0x179a: 0x0008, 0x179b: 0x0008, 0x179c: 0x0008, 0x179d: 0x0008, 0x179e: 0x0008, 0x179f: 0x0008, 0x17a0: 0x0008, 0x17a1: 0x0008, 0x17a2: 0x0008, 0x17a3: 0x0008, 0x17a4: 0x0008, 0x17a5: 0x0008, 0x17a6: 0x0008, 0x17a7: 0x0008, 0x17a8: 0x0008, 0x17a9: 0x0040, 0x17aa: 0x0008, 0x17ab: 0x0008, 0x17ac: 0x0008, 0x17ad: 0x0008, 0x17ae: 0x0008, 0x17af: 0x0008, 0x17b0: 0x0008, 0x17b1: 0x0040, 0x17b2: 0x0008, 0x17b3: 0x0008, 0x17b4: 0x0040, 0x17b5: 0x0008, 0x17b6: 0x0008, 0x17b7: 0x0008, 0x17b8: 0x0008, 0x17b9: 0x0008, 0x17ba: 0x0040, 0x17bb: 0x0040, 0x17bc: 0x3308, 0x17bd: 0x0008, 0x17be: 0x3008, 0x17bf: 0x3008, // Block 0x5f, offset 0x17c0 0x17c0: 0x3308, 0x17c1: 0x3008, 0x17c2: 0x3008, 0x17c3: 0x3008, 0x17c4: 0x3008, 0x17c5: 0x0040, 0x17c6: 0x0040, 0x17c7: 0x3008, 0x17c8: 0x3008, 0x17c9: 0x0040, 0x17ca: 0x0040, 0x17cb: 0x3008, 0x17cc: 0x3008, 0x17cd: 0x3808, 0x17ce: 0x0040, 0x17cf: 0x0040, 0x17d0: 0x0008, 0x17d1: 0x0040, 0x17d2: 0x0040, 0x17d3: 0x0040, 0x17d4: 0x0040, 0x17d5: 0x0040, 0x17d6: 0x0040, 0x17d7: 0x3008, 0x17d8: 0x0040, 0x17d9: 0x0040, 0x17da: 0x0040, 0x17db: 0x0040, 0x17dc: 0x0040, 0x17dd: 0x0008, 0x17de: 0x0008, 0x17df: 0x0008, 0x17e0: 0x0008, 0x17e1: 0x0008, 0x17e2: 0x3008, 0x17e3: 0x3008, 0x17e4: 0x0040, 0x17e5: 0x0040, 0x17e6: 0x3308, 0x17e7: 0x3308, 0x17e8: 0x3308, 0x17e9: 0x3308, 0x17ea: 0x3308, 0x17eb: 0x3308, 0x17ec: 0x3308, 0x17ed: 0x0040, 0x17ee: 0x0040, 0x17ef: 0x0040, 0x17f0: 0x3308, 0x17f1: 0x3308, 0x17f2: 0x3308, 0x17f3: 0x3308, 0x17f4: 0x3308, 0x17f5: 0x0040, 0x17f6: 0x0040, 0x17f7: 0x0040, 0x17f8: 0x0040, 0x17f9: 0x0040, 0x17fa: 0x0040, 0x17fb: 0x0040, 0x17fc: 0x0040, 0x17fd: 0x0040, 0x17fe: 0x0040, 0x17ff: 0x0040, // Block 0x60, offset 0x1800 0x1800: 0x0039, 0x1801: 0x0ee9, 0x1802: 0x1159, 0x1803: 0x0ef9, 0x1804: 0x0f09, 0x1805: 0x1199, 0x1806: 0x0f31, 0x1807: 0x0249, 0x1808: 0x0f41, 0x1809: 0x0259, 0x180a: 0x0f51, 0x180b: 0x0359, 0x180c: 0x0f61, 0x180d: 0x0f71, 0x180e: 0x00d9, 0x180f: 0x0f99, 0x1810: 0x2039, 0x1811: 0x0269, 0x1812: 0x01d9, 0x1813: 0x0fa9, 0x1814: 0x0fb9, 0x1815: 0x1089, 0x1816: 0x0279, 0x1817: 0x0369, 0x1818: 0x0289, 0x1819: 0x13d1, 0x181a: 0x0039, 0x181b: 0x0ee9, 0x181c: 0x1159, 0x181d: 0x0ef9, 0x181e: 0x0f09, 0x181f: 0x1199, 0x1820: 0x0f31, 0x1821: 0x0249, 0x1822: 0x0f41, 0x1823: 0x0259, 0x1824: 0x0f51, 0x1825: 0x0359, 0x1826: 0x0f61, 0x1827: 0x0f71, 0x1828: 0x00d9, 0x1829: 0x0f99, 0x182a: 0x2039, 0x182b: 0x0269, 0x182c: 0x01d9, 0x182d: 0x0fa9, 0x182e: 0x0fb9, 0x182f: 0x1089, 0x1830: 0x0279, 0x1831: 0x0369, 0x1832: 0x0289, 0x1833: 0x13d1, 0x1834: 0x0039, 0x1835: 0x0ee9, 0x1836: 0x1159, 0x1837: 0x0ef9, 0x1838: 0x0f09, 0x1839: 0x1199, 0x183a: 0x0f31, 0x183b: 0x0249, 0x183c: 0x0f41, 0x183d: 0x0259, 0x183e: 0x0f51, 0x183f: 0x0359, // Block 0x61, offset 0x1840 0x1840: 0x0f61, 0x1841: 0x0f71, 0x1842: 0x00d9, 0x1843: 0x0f99, 0x1844: 0x2039, 0x1845: 0x0269, 0x1846: 0x01d9, 0x1847: 0x0fa9, 0x1848: 0x0fb9, 0x1849: 0x1089, 0x184a: 0x0279, 0x184b: 0x0369, 0x184c: 0x0289, 0x184d: 0x13d1, 0x184e: 0x0039, 0x184f: 0x0ee9, 0x1850: 0x1159, 0x1851: 0x0ef9, 0x1852: 0x0f09, 0x1853: 0x1199, 0x1854: 0x0f31, 0x1855: 0x0040, 0x1856: 0x0f41, 0x1857: 0x0259, 0x1858: 0x0f51, 0x1859: 0x0359, 0x185a: 0x0f61, 0x185b: 0x0f71, 0x185c: 0x00d9, 0x185d: 0x0f99, 0x185e: 0x2039, 0x185f: 0x0269, 0x1860: 0x01d9, 0x1861: 0x0fa9, 0x1862: 0x0fb9, 0x1863: 0x1089, 0x1864: 0x0279, 0x1865: 0x0369, 0x1866: 0x0289, 0x1867: 0x13d1, 0x1868: 0x0039, 0x1869: 0x0ee9, 0x186a: 0x1159, 0x186b: 0x0ef9, 0x186c: 0x0f09, 0x186d: 0x1199, 0x186e: 0x0f31, 0x186f: 0x0249, 0x1870: 0x0f41, 0x1871: 0x0259, 0x1872: 0x0f51, 0x1873: 0x0359, 0x1874: 0x0f61, 0x1875: 0x0f71, 0x1876: 0x00d9, 0x1877: 0x0f99, 0x1878: 0x2039, 0x1879: 0x0269, 0x187a: 0x01d9, 0x187b: 0x0fa9, 0x187c: 0x0fb9, 0x187d: 0x1089, 0x187e: 0x0279, 0x187f: 0x0369, // Block 0x62, offset 0x1880 0x1880: 0x0289, 0x1881: 0x13d1, 0x1882: 0x0039, 0x1883: 0x0ee9, 0x1884: 0x1159, 0x1885: 0x0ef9, 0x1886: 0x0f09, 0x1887: 0x1199, 0x1888: 0x0f31, 0x1889: 0x0249, 0x188a: 0x0f41, 0x188b: 0x0259, 0x188c: 0x0f51, 0x188d: 0x0359, 0x188e: 0x0f61, 0x188f: 0x0f71, 0x1890: 0x00d9, 0x1891: 0x0f99, 0x1892: 0x2039, 0x1893: 0x0269, 0x1894: 0x01d9, 0x1895: 0x0fa9, 0x1896: 0x0fb9, 0x1897: 0x1089, 0x1898: 0x0279, 0x1899: 0x0369, 0x189a: 0x0289, 0x189b: 0x13d1, 0x189c: 0x0039, 0x189d: 0x0040, 0x189e: 0x1159, 0x189f: 0x0ef9, 0x18a0: 0x0040, 0x18a1: 0x0040, 0x18a2: 0x0f31, 0x18a3: 0x0040, 0x18a4: 0x0040, 0x18a5: 0x0259, 0x18a6: 0x0f51, 0x18a7: 0x0040, 0x18a8: 0x0040, 0x18a9: 0x0f71, 0x18aa: 0x00d9, 0x18ab: 0x0f99, 0x18ac: 0x2039, 0x18ad: 0x0040, 0x18ae: 0x01d9, 0x18af: 0x0fa9, 0x18b0: 0x0fb9, 0x18b1: 0x1089, 0x18b2: 0x0279, 0x18b3: 0x0369, 0x18b4: 0x0289, 0x18b5: 0x13d1, 0x18b6: 0x0039, 0x18b7: 0x0ee9, 0x18b8: 0x1159, 0x18b9: 0x0ef9, 0x18ba: 0x0040, 0x18bb: 0x1199, 0x18bc: 0x0040, 0x18bd: 0x0249, 0x18be: 0x0f41, 0x18bf: 0x0259, // Block 0x63, offset 0x18c0 0x18c0: 0x0f51, 0x18c1: 0x0359, 0x18c2: 0x0f61, 0x18c3: 0x0f71, 0x18c4: 0x0040, 0x18c5: 0x0f99, 0x18c6: 0x2039, 0x18c7: 0x0269, 0x18c8: 0x01d9, 0x18c9: 0x0fa9, 0x18ca: 0x0fb9, 0x18cb: 0x1089, 0x18cc: 0x0279, 0x18cd: 0x0369, 0x18ce: 0x0289, 0x18cf: 0x13d1, 0x18d0: 0x0039, 0x18d1: 0x0ee9, 0x18d2: 0x1159, 0x18d3: 0x0ef9, 0x18d4: 0x0f09, 0x18d5: 0x1199, 0x18d6: 0x0f31, 0x18d7: 0x0249, 0x18d8: 0x0f41, 0x18d9: 0x0259, 0x18da: 0x0f51, 0x18db: 0x0359, 0x18dc: 0x0f61, 0x18dd: 0x0f71, 0x18de: 0x00d9, 0x18df: 0x0f99, 0x18e0: 0x2039, 0x18e1: 0x0269, 0x18e2: 0x01d9, 0x18e3: 0x0fa9, 0x18e4: 0x0fb9, 0x18e5: 0x1089, 0x18e6: 0x0279, 0x18e7: 0x0369, 0x18e8: 0x0289, 0x18e9: 0x13d1, 0x18ea: 0x0039, 0x18eb: 0x0ee9, 0x18ec: 0x1159, 0x18ed: 0x0ef9, 0x18ee: 0x0f09, 0x18ef: 0x1199, 0x18f0: 0x0f31, 0x18f1: 0x0249, 0x18f2: 0x0f41, 0x18f3: 0x0259, 0x18f4: 0x0f51, 0x18f5: 0x0359, 0x18f6: 0x0f61, 0x18f7: 0x0f71, 0x18f8: 0x00d9, 0x18f9: 0x0f99, 0x18fa: 0x2039, 0x18fb: 0x0269, 0x18fc: 0x01d9, 0x18fd: 0x0fa9, 0x18fe: 0x0fb9, 0x18ff: 0x1089, // Block 0x64, offset 0x1900 0x1900: 0x0279, 0x1901: 0x0369, 0x1902: 0x0289, 0x1903: 0x13d1, 0x1904: 0x0039, 0x1905: 0x0ee9, 0x1906: 0x0040, 0x1907: 0x0ef9, 0x1908: 0x0f09, 0x1909: 0x1199, 0x190a: 0x0f31, 0x190b: 0x0040, 0x190c: 0x0040, 0x190d: 0x0259, 0x190e: 0x0f51, 0x190f: 0x0359, 0x1910: 0x0f61, 0x1911: 0x0f71, 0x1912: 0x00d9, 0x1913: 0x0f99, 0x1914: 0x2039, 0x1915: 0x0040, 0x1916: 0x01d9, 0x1917: 0x0fa9, 0x1918: 0x0fb9, 0x1919: 0x1089, 0x191a: 0x0279, 0x191b: 0x0369, 0x191c: 0x0289, 0x191d: 0x0040, 0x191e: 0x0039, 0x191f: 0x0ee9, 0x1920: 0x1159, 0x1921: 0x0ef9, 0x1922: 0x0f09, 0x1923: 0x1199, 0x1924: 0x0f31, 0x1925: 0x0249, 0x1926: 0x0f41, 0x1927: 0x0259, 0x1928: 0x0f51, 0x1929: 0x0359, 0x192a: 0x0f61, 0x192b: 0x0f71, 0x192c: 0x00d9, 0x192d: 0x0f99, 0x192e: 0x2039, 0x192f: 0x0269, 0x1930: 0x01d9, 0x1931: 0x0fa9, 0x1932: 0x0fb9, 0x1933: 0x1089, 0x1934: 0x0279, 0x1935: 0x0369, 0x1936: 0x0289, 0x1937: 0x13d1, 0x1938: 0x0039, 0x1939: 0x0ee9, 0x193a: 0x0040, 0x193b: 0x0ef9, 0x193c: 0x0f09, 0x193d: 0x1199, 0x193e: 0x0f31, 0x193f: 0x0040, // Block 0x65, offset 0x1940 0x1940: 0x0f41, 0x1941: 0x0259, 0x1942: 0x0f51, 0x1943: 0x0359, 0x1944: 0x0f61, 0x1945: 0x0040, 0x1946: 0x00d9, 0x1947: 0x0040, 0x1948: 0x0040, 0x1949: 0x0040, 0x194a: 0x01d9, 0x194b: 0x0fa9, 0x194c: 0x0fb9, 0x194d: 0x1089, 0x194e: 0x0279, 0x194f: 0x0369, 0x1950: 0x0289, 0x1951: 0x0040, 0x1952: 0x0039, 0x1953: 0x0ee9, 0x1954: 0x1159, 0x1955: 0x0ef9, 0x1956: 0x0f09, 0x1957: 0x1199, 0x1958: 0x0f31, 0x1959: 0x0249, 0x195a: 0x0f41, 0x195b: 0x0259, 0x195c: 0x0f51, 0x195d: 0x0359, 0x195e: 0x0f61, 0x195f: 0x0f71, 0x1960: 0x00d9, 0x1961: 0x0f99, 0x1962: 0x2039, 0x1963: 0x0269, 0x1964: 0x01d9, 0x1965: 0x0fa9, 0x1966: 0x0fb9, 0x1967: 0x1089, 0x1968: 0x0279, 0x1969: 0x0369, 0x196a: 0x0289, 0x196b: 0x13d1, 0x196c: 0x0039, 0x196d: 0x0ee9, 0x196e: 0x1159, 0x196f: 0x0ef9, 0x1970: 0x0f09, 0x1971: 0x1199, 0x1972: 0x0f31, 0x1973: 0x0249, 0x1974: 0x0f41, 0x1975: 0x0259, 0x1976: 0x0f51, 0x1977: 0x0359, 0x1978: 0x0f61, 0x1979: 0x0f71, 0x197a: 0x00d9, 0x197b: 0x0f99, 0x197c: 0x2039, 0x197d: 0x0269, 0x197e: 0x01d9, 0x197f: 0x0fa9, // Block 0x66, offset 0x1980 0x1980: 0x0fb9, 0x1981: 0x1089, 0x1982: 0x0279, 0x1983: 0x0369, 0x1984: 0x0289, 0x1985: 0x13d1, 0x1986: 0x0039, 0x1987: 0x0ee9, 0x1988: 0x1159, 0x1989: 0x0ef9, 0x198a: 0x0f09, 0x198b: 0x1199, 0x198c: 0x0f31, 0x198d: 0x0249, 0x198e: 0x0f41, 0x198f: 0x0259, 0x1990: 0x0f51, 0x1991: 0x0359, 0x1992: 0x0f61, 0x1993: 0x0f71, 0x1994: 0x00d9, 0x1995: 0x0f99, 0x1996: 0x2039, 0x1997: 0x0269, 0x1998: 0x01d9, 0x1999: 0x0fa9, 0x199a: 0x0fb9, 0x199b: 0x1089, 0x199c: 0x0279, 0x199d: 0x0369, 0x199e: 0x0289, 0x199f: 0x13d1, 0x19a0: 0x0039, 0x19a1: 0x0ee9, 0x19a2: 0x1159, 0x19a3: 0x0ef9, 0x19a4: 0x0f09, 0x19a5: 0x1199, 0x19a6: 0x0f31, 0x19a7: 0x0249, 0x19a8: 0x0f41, 0x19a9: 0x0259, 0x19aa: 0x0f51, 0x19ab: 0x0359, 0x19ac: 0x0f61, 0x19ad: 0x0f71, 0x19ae: 0x00d9, 0x19af: 0x0f99, 0x19b0: 0x2039, 0x19b1: 0x0269, 0x19b2: 0x01d9, 0x19b3: 0x0fa9, 0x19b4: 0x0fb9, 0x19b5: 0x1089, 0x19b6: 0x0279, 0x19b7: 0x0369, 0x19b8: 0x0289, 0x19b9: 0x13d1, 0x19ba: 0x0039, 0x19bb: 0x0ee9, 0x19bc: 0x1159, 0x19bd: 0x0ef9, 0x19be: 0x0f09, 0x19bf: 0x1199, // Block 0x67, offset 0x19c0 0x19c0: 0x0f31, 0x19c1: 0x0249, 0x19c2: 0x0f41, 0x19c3: 0x0259, 0x19c4: 0x0f51, 0x19c5: 0x0359, 0x19c6: 0x0f61, 0x19c7: 0x0f71, 0x19c8: 0x00d9, 0x19c9: 0x0f99, 0x19ca: 0x2039, 0x19cb: 0x0269, 0x19cc: 0x01d9, 0x19cd: 0x0fa9, 0x19ce: 0x0fb9, 0x19cf: 0x1089, 0x19d0: 0x0279, 0x19d1: 0x0369, 0x19d2: 0x0289, 0x19d3: 0x13d1, 0x19d4: 0x0039, 0x19d5: 0x0ee9, 0x19d6: 0x1159, 0x19d7: 0x0ef9, 0x19d8: 0x0f09, 0x19d9: 0x1199, 0x19da: 0x0f31, 0x19db: 0x0249, 0x19dc: 0x0f41, 0x19dd: 0x0259, 0x19de: 0x0f51, 0x19df: 0x0359, 0x19e0: 0x0f61, 0x19e1: 0x0f71, 0x19e2: 0x00d9, 0x19e3: 0x0f99, 0x19e4: 0x2039, 0x19e5: 0x0269, 0x19e6: 0x01d9, 0x19e7: 0x0fa9, 0x19e8: 0x0fb9, 0x19e9: 0x1089, 0x19ea: 0x0279, 0x19eb: 0x0369, 0x19ec: 0x0289, 0x19ed: 0x13d1, 0x19ee: 0x0039, 0x19ef: 0x0ee9, 0x19f0: 0x1159, 0x19f1: 0x0ef9, 0x19f2: 0x0f09, 0x19f3: 0x1199, 0x19f4: 0x0f31, 0x19f5: 0x0249, 0x19f6: 0x0f41, 0x19f7: 0x0259, 0x19f8: 0x0f51, 0x19f9: 0x0359, 0x19fa: 0x0f61, 0x19fb: 0x0f71, 0x19fc: 0x00d9, 0x19fd: 0x0f99, 0x19fe: 0x2039, 0x19ff: 0x0269, // Block 0x68, offset 0x1a00 0x1a00: 0x01d9, 0x1a01: 0x0fa9, 0x1a02: 0x0fb9, 0x1a03: 0x1089, 0x1a04: 0x0279, 0x1a05: 0x0369, 0x1a06: 0x0289, 0x1a07: 0x13d1, 0x1a08: 0x0039, 0x1a09: 0x0ee9, 0x1a0a: 0x1159, 0x1a0b: 0x0ef9, 0x1a0c: 0x0f09, 0x1a0d: 0x1199, 0x1a0e: 0x0f31, 0x1a0f: 0x0249, 0x1a10: 0x0f41, 0x1a11: 0x0259, 0x1a12: 0x0f51, 0x1a13: 0x0359, 0x1a14: 0x0f61, 0x1a15: 0x0f71, 0x1a16: 0x00d9, 0x1a17: 0x0f99, 0x1a18: 0x2039, 0x1a19: 0x0269, 0x1a1a: 0x01d9, 0x1a1b: 0x0fa9, 0x1a1c: 0x0fb9, 0x1a1d: 0x1089, 0x1a1e: 0x0279, 0x1a1f: 0x0369, 0x1a20: 0x0289, 0x1a21: 0x13d1, 0x1a22: 0x0039, 0x1a23: 0x0ee9, 0x1a24: 0x1159, 0x1a25: 0x0ef9, 0x1a26: 0x0f09, 0x1a27: 0x1199, 0x1a28: 0x0f31, 0x1a29: 0x0249, 0x1a2a: 0x0f41, 0x1a2b: 0x0259, 0x1a2c: 0x0f51, 0x1a2d: 0x0359, 0x1a2e: 0x0f61, 0x1a2f: 0x0f71, 0x1a30: 0x00d9, 0x1a31: 0x0f99, 0x1a32: 0x2039, 0x1a33: 0x0269, 0x1a34: 0x01d9, 0x1a35: 0x0fa9, 0x1a36: 0x0fb9, 0x1a37: 0x1089, 0x1a38: 0x0279, 0x1a39: 0x0369, 0x1a3a: 0x0289, 0x1a3b: 0x13d1, 0x1a3c: 0x0039, 0x1a3d: 0x0ee9, 0x1a3e: 0x1159, 0x1a3f: 0x0ef9, // Block 0x69, offset 0x1a40 0x1a40: 0x0f09, 0x1a41: 0x1199, 0x1a42: 0x0f31, 0x1a43: 0x0249, 0x1a44: 0x0f41, 0x1a45: 0x0259, 0x1a46: 0x0f51, 0x1a47: 0x0359, 0x1a48: 0x0f61, 0x1a49: 0x0f71, 0x1a4a: 0x00d9, 0x1a4b: 0x0f99, 0x1a4c: 0x2039, 0x1a4d: 0x0269, 0x1a4e: 0x01d9, 0x1a4f: 0x0fa9, 0x1a50: 0x0fb9, 0x1a51: 0x1089, 0x1a52: 0x0279, 0x1a53: 0x0369, 0x1a54: 0x0289, 0x1a55: 0x13d1, 0x1a56: 0x0039, 0x1a57: 0x0ee9, 0x1a58: 0x1159, 0x1a59: 0x0ef9, 0x1a5a: 0x0f09, 0x1a5b: 0x1199, 0x1a5c: 0x0f31, 0x1a5d: 0x0249, 0x1a5e: 0x0f41, 0x1a5f: 0x0259, 0x1a60: 0x0f51, 0x1a61: 0x0359, 0x1a62: 0x0f61, 0x1a63: 0x0f71, 0x1a64: 0x00d9, 0x1a65: 0x0f99, 0x1a66: 0x2039, 0x1a67: 0x0269, 0x1a68: 0x01d9, 0x1a69: 0x0fa9, 0x1a6a: 0x0fb9, 0x1a6b: 0x1089, 0x1a6c: 0x0279, 0x1a6d: 0x0369, 0x1a6e: 0x0289, 0x1a6f: 0x13d1, 0x1a70: 0x0039, 0x1a71: 0x0ee9, 0x1a72: 0x1159, 0x1a73: 0x0ef9, 0x1a74: 0x0f09, 0x1a75: 0x1199, 0x1a76: 0x0f31, 0x1a77: 0x0249, 0x1a78: 0x0f41, 0x1a79: 0x0259, 0x1a7a: 0x0f51, 0x1a7b: 0x0359, 0x1a7c: 0x0f61, 0x1a7d: 0x0f71, 0x1a7e: 0x00d9, 0x1a7f: 0x0f99, // Block 0x6a, offset 0x1a80 0x1a80: 0x2039, 0x1a81: 0x0269, 0x1a82: 0x01d9, 0x1a83: 0x0fa9, 0x1a84: 0x0fb9, 0x1a85: 0x1089, 0x1a86: 0x0279, 0x1a87: 0x0369, 0x1a88: 0x0289, 0x1a89: 0x13d1, 0x1a8a: 0x0039, 0x1a8b: 0x0ee9, 0x1a8c: 0x1159, 0x1a8d: 0x0ef9, 0x1a8e: 0x0f09, 0x1a8f: 0x1199, 0x1a90: 0x0f31, 0x1a91: 0x0249, 0x1a92: 0x0f41, 0x1a93: 0x0259, 0x1a94: 0x0f51, 0x1a95: 0x0359, 0x1a96: 0x0f61, 0x1a97: 0x0f71, 0x1a98: 0x00d9, 0x1a99: 0x0f99, 0x1a9a: 0x2039, 0x1a9b: 0x0269, 0x1a9c: 0x01d9, 0x1a9d: 0x0fa9, 0x1a9e: 0x0fb9, 0x1a9f: 0x1089, 0x1aa0: 0x0279, 0x1aa1: 0x0369, 0x1aa2: 0x0289, 0x1aa3: 0x13d1, 0x1aa4: 0xba81, 0x1aa5: 0xba99, 0x1aa6: 0x0040, 0x1aa7: 0x0040, 0x1aa8: 0xbab1, 0x1aa9: 0x1099, 0x1aaa: 0x10b1, 0x1aab: 0x10c9, 0x1aac: 0xbac9, 0x1aad: 0xbae1, 0x1aae: 0xbaf9, 0x1aaf: 0x1429, 0x1ab0: 0x1a31, 0x1ab1: 0xbb11, 0x1ab2: 0xbb29, 0x1ab3: 0xbb41, 0x1ab4: 0xbb59, 0x1ab5: 0xbb71, 0x1ab6: 0xbb89, 0x1ab7: 0x2109, 0x1ab8: 0x1111, 0x1ab9: 0x1429, 0x1aba: 0xbba1, 0x1abb: 0xbbb9, 0x1abc: 0xbbd1, 0x1abd: 0x10e1, 0x1abe: 0x10f9, 0x1abf: 0xbbe9, // Block 0x6b, offset 0x1ac0 0x1ac0: 0x2079, 0x1ac1: 0xbc01, 0x1ac2: 0xbab1, 0x1ac3: 0x1099, 0x1ac4: 0x10b1, 0x1ac5: 0x10c9, 0x1ac6: 0xbac9, 0x1ac7: 0xbae1, 0x1ac8: 0xbaf9, 0x1ac9: 0x1429, 0x1aca: 0x1a31, 0x1acb: 0xbb11, 0x1acc: 0xbb29, 0x1acd: 0xbb41, 0x1ace: 0xbb59, 0x1acf: 0xbb71, 0x1ad0: 0xbb89, 0x1ad1: 0x2109, 0x1ad2: 0x1111, 0x1ad3: 0xbba1, 0x1ad4: 0xbba1, 0x1ad5: 0xbbb9, 0x1ad6: 0xbbd1, 0x1ad7: 0x10e1, 0x1ad8: 0x10f9, 0x1ad9: 0xbbe9, 0x1ada: 0x2079, 0x1adb: 0xbc21, 0x1adc: 0xbac9, 0x1add: 0x1429, 0x1ade: 0xbb11, 0x1adf: 0x10e1, 0x1ae0: 0x1111, 0x1ae1: 0x2109, 0x1ae2: 0xbab1, 0x1ae3: 0x1099, 0x1ae4: 0x10b1, 0x1ae5: 0x10c9, 0x1ae6: 0xbac9, 0x1ae7: 0xbae1, 0x1ae8: 0xbaf9, 0x1ae9: 0x1429, 0x1aea: 0x1a31, 0x1aeb: 0xbb11, 0x1aec: 0xbb29, 0x1aed: 0xbb41, 0x1aee: 0xbb59, 0x1aef: 0xbb71, 0x1af0: 0xbb89, 0x1af1: 0x2109, 0x1af2: 0x1111, 0x1af3: 0x1429, 0x1af4: 0xbba1, 0x1af5: 0xbbb9, 0x1af6: 0xbbd1, 0x1af7: 0x10e1, 0x1af8: 0x10f9, 0x1af9: 0xbbe9, 0x1afa: 0x2079, 0x1afb: 0xbc01, 0x1afc: 0xbab1, 0x1afd: 0x1099, 0x1afe: 0x10b1, 0x1aff: 0x10c9, // Block 0x6c, offset 0x1b00 0x1b00: 0xbac9, 0x1b01: 0xbae1, 0x1b02: 0xbaf9, 0x1b03: 0x1429, 0x1b04: 0x1a31, 0x1b05: 0xbb11, 0x1b06: 0xbb29, 0x1b07: 0xbb41, 0x1b08: 0xbb59, 0x1b09: 0xbb71, 0x1b0a: 0xbb89, 0x1b0b: 0x2109, 0x1b0c: 0x1111, 0x1b0d: 0xbba1, 0x1b0e: 0xbba1, 0x1b0f: 0xbbb9, 0x1b10: 0xbbd1, 0x1b11: 0x10e1, 0x1b12: 0x10f9, 0x1b13: 0xbbe9, 0x1b14: 0x2079, 0x1b15: 0xbc21, 0x1b16: 0xbac9, 0x1b17: 0x1429, 0x1b18: 0xbb11, 0x1b19: 0x10e1, 0x1b1a: 0x1111, 0x1b1b: 0x2109, 0x1b1c: 0xbab1, 0x1b1d: 0x1099, 0x1b1e: 0x10b1, 0x1b1f: 0x10c9, 0x1b20: 0xbac9, 0x1b21: 0xbae1, 0x1b22: 0xbaf9, 0x1b23: 0x1429, 0x1b24: 0x1a31, 0x1b25: 0xbb11, 0x1b26: 0xbb29, 0x1b27: 0xbb41, 0x1b28: 0xbb59, 0x1b29: 0xbb71, 0x1b2a: 0xbb89, 0x1b2b: 0x2109, 0x1b2c: 0x1111, 0x1b2d: 0x1429, 0x1b2e: 0xbba1, 0x1b2f: 0xbbb9, 0x1b30: 0xbbd1, 0x1b31: 0x10e1, 0x1b32: 0x10f9, 0x1b33: 0xbbe9, 0x1b34: 0x2079, 0x1b35: 0xbc01, 0x1b36: 0xbab1, 0x1b37: 0x1099, 0x1b38: 0x10b1, 0x1b39: 0x10c9, 0x1b3a: 0xbac9, 0x1b3b: 0xbae1, 0x1b3c: 0xbaf9, 0x1b3d: 0x1429, 0x1b3e: 0x1a31, 0x1b3f: 0xbb11, // Block 0x6d, offset 0x1b40 0x1b40: 0xbb29, 0x1b41: 0xbb41, 0x1b42: 0xbb59, 0x1b43: 0xbb71, 0x1b44: 0xbb89, 0x1b45: 0x2109, 0x1b46: 0x1111, 0x1b47: 0xbba1, 0x1b48: 0xbba1, 0x1b49: 0xbbb9, 0x1b4a: 0xbbd1, 0x1b4b: 0x10e1, 0x1b4c: 0x10f9, 0x1b4d: 0xbbe9, 0x1b4e: 0x2079, 0x1b4f: 0xbc21, 0x1b50: 0xbac9, 0x1b51: 0x1429, 0x1b52: 0xbb11, 0x1b53: 0x10e1, 0x1b54: 0x1111, 0x1b55: 0x2109, 0x1b56: 0xbab1, 0x1b57: 0x1099, 0x1b58: 0x10b1, 0x1b59: 0x10c9, 0x1b5a: 0xbac9, 0x1b5b: 0xbae1, 0x1b5c: 0xbaf9, 0x1b5d: 0x1429, 0x1b5e: 0x1a31, 0x1b5f: 0xbb11, 0x1b60: 0xbb29, 0x1b61: 0xbb41, 0x1b62: 0xbb59, 0x1b63: 0xbb71, 0x1b64: 0xbb89, 0x1b65: 0x2109, 0x1b66: 0x1111, 0x1b67: 0x1429, 0x1b68: 0xbba1, 0x1b69: 0xbbb9, 0x1b6a: 0xbbd1, 0x1b6b: 0x10e1, 0x1b6c: 0x10f9, 0x1b6d: 0xbbe9, 0x1b6e: 0x2079, 0x1b6f: 0xbc01, 0x1b70: 0xbab1, 0x1b71: 0x1099, 0x1b72: 0x10b1, 0x1b73: 0x10c9, 0x1b74: 0xbac9, 0x1b75: 0xbae1, 0x1b76: 0xbaf9, 0x1b77: 0x1429, 0x1b78: 0x1a31, 0x1b79: 0xbb11, 0x1b7a: 0xbb29, 0x1b7b: 0xbb41, 0x1b7c: 0xbb59, 0x1b7d: 0xbb71, 0x1b7e: 0xbb89, 0x1b7f: 0x2109, // Block 0x6e, offset 0x1b80 0x1b80: 0x1111, 0x1b81: 0xbba1, 0x1b82: 0xbba1, 0x1b83: 0xbbb9, 0x1b84: 0xbbd1, 0x1b85: 0x10e1, 0x1b86: 0x10f9, 0x1b87: 0xbbe9, 0x1b88: 0x2079, 0x1b89: 0xbc21, 0x1b8a: 0xbac9, 0x1b8b: 0x1429, 0x1b8c: 0xbb11, 0x1b8d: 0x10e1, 0x1b8e: 0x1111, 0x1b8f: 0x2109, 0x1b90: 0xbab1, 0x1b91: 0x1099, 0x1b92: 0x10b1, 0x1b93: 0x10c9, 0x1b94: 0xbac9, 0x1b95: 0xbae1, 0x1b96: 0xbaf9, 0x1b97: 0x1429, 0x1b98: 0x1a31, 0x1b99: 0xbb11, 0x1b9a: 0xbb29, 0x1b9b: 0xbb41, 0x1b9c: 0xbb59, 0x1b9d: 0xbb71, 0x1b9e: 0xbb89, 0x1b9f: 0x2109, 0x1ba0: 0x1111, 0x1ba1: 0x1429, 0x1ba2: 0xbba1, 0x1ba3: 0xbbb9, 0x1ba4: 0xbbd1, 0x1ba5: 0x10e1, 0x1ba6: 0x10f9, 0x1ba7: 0xbbe9, 0x1ba8: 0x2079, 0x1ba9: 0xbc01, 0x1baa: 0xbab1, 0x1bab: 0x1099, 0x1bac: 0x10b1, 0x1bad: 0x10c9, 0x1bae: 0xbac9, 0x1baf: 0xbae1, 0x1bb0: 0xbaf9, 0x1bb1: 0x1429, 0x1bb2: 0x1a31, 0x1bb3: 0xbb11, 0x1bb4: 0xbb29, 0x1bb5: 0xbb41, 0x1bb6: 0xbb59, 0x1bb7: 0xbb71, 0x1bb8: 0xbb89, 0x1bb9: 0x2109, 0x1bba: 0x1111, 0x1bbb: 0xbba1, 0x1bbc: 0xbba1, 0x1bbd: 0xbbb9, 0x1bbe: 0xbbd1, 0x1bbf: 0x10e1, // Block 0x6f, offset 0x1bc0 0x1bc0: 0x10f9, 0x1bc1: 0xbbe9, 0x1bc2: 0x2079, 0x1bc3: 0xbc21, 0x1bc4: 0xbac9, 0x1bc5: 0x1429, 0x1bc6: 0xbb11, 0x1bc7: 0x10e1, 0x1bc8: 0x1111, 0x1bc9: 0x2109, 0x1bca: 0xbc41, 0x1bcb: 0xbc41, 0x1bcc: 0x0040, 0x1bcd: 0x0040, 0x1bce: 0x1f41, 0x1bcf: 0x00c9, 0x1bd0: 0x0069, 0x1bd1: 0x0079, 0x1bd2: 0x1f51, 0x1bd3: 0x1f61, 0x1bd4: 0x1f71, 0x1bd5: 0x1f81, 0x1bd6: 0x1f91, 0x1bd7: 0x1fa1, 0x1bd8: 0x1f41, 0x1bd9: 0x00c9, 0x1bda: 0x0069, 0x1bdb: 0x0079, 0x1bdc: 0x1f51, 0x1bdd: 0x1f61, 0x1bde: 0x1f71, 0x1bdf: 0x1f81, 0x1be0: 0x1f91, 0x1be1: 0x1fa1, 0x1be2: 0x1f41, 0x1be3: 0x00c9, 0x1be4: 0x0069, 0x1be5: 0x0079, 0x1be6: 0x1f51, 0x1be7: 0x1f61, 0x1be8: 0x1f71, 0x1be9: 0x1f81, 0x1bea: 0x1f91, 0x1beb: 0x1fa1, 0x1bec: 0x1f41, 0x1bed: 0x00c9, 0x1bee: 0x0069, 0x1bef: 0x0079, 0x1bf0: 0x1f51, 0x1bf1: 0x1f61, 0x1bf2: 0x1f71, 0x1bf3: 0x1f81, 0x1bf4: 0x1f91, 0x1bf5: 0x1fa1, 0x1bf6: 0x1f41, 0x1bf7: 0x00c9, 0x1bf8: 0x0069, 0x1bf9: 0x0079, 0x1bfa: 0x1f51, 0x1bfb: 0x1f61, 0x1bfc: 0x1f71, 0x1bfd: 0x1f81, 0x1bfe: 0x1f91, 0x1bff: 0x1fa1, // Block 0x70, offset 0x1c00 0x1c00: 0xe115, 0x1c01: 0xe115, 0x1c02: 0xe135, 0x1c03: 0xe135, 0x1c04: 0xe115, 0x1c05: 0xe115, 0x1c06: 0xe175, 0x1c07: 0xe175, 0x1c08: 0xe115, 0x1c09: 0xe115, 0x1c0a: 0xe135, 0x1c0b: 0xe135, 0x1c0c: 0xe115, 0x1c0d: 0xe115, 0x1c0e: 0xe1f5, 0x1c0f: 0xe1f5, 0x1c10: 0xe115, 0x1c11: 0xe115, 0x1c12: 0xe135, 0x1c13: 0xe135, 0x1c14: 0xe115, 0x1c15: 0xe115, 0x1c16: 0xe175, 0x1c17: 0xe175, 0x1c18: 0xe115, 0x1c19: 0xe115, 0x1c1a: 0xe135, 0x1c1b: 0xe135, 0x1c1c: 0xe115, 0x1c1d: 0xe115, 0x1c1e: 0x8b05, 0x1c1f: 0x8b05, 0x1c20: 0x04b5, 0x1c21: 0x04b5, 0x1c22: 0x0a08, 0x1c23: 0x0a08, 0x1c24: 0x0a08, 0x1c25: 0x0a08, 0x1c26: 0x0a08, 0x1c27: 0x0a08, 0x1c28: 0x0a08, 0x1c29: 0x0a08, 0x1c2a: 0x0a08, 0x1c2b: 0x0a08, 0x1c2c: 0x0a08, 0x1c2d: 0x0a08, 0x1c2e: 0x0a08, 0x1c2f: 0x0a08, 0x1c30: 0x0a08, 0x1c31: 0x0a08, 0x1c32: 0x0a08, 0x1c33: 0x0a08, 0x1c34: 0x0a08, 0x1c35: 0x0a08, 0x1c36: 0x0a08, 0x1c37: 0x0a08, 0x1c38: 0x0a08, 0x1c39: 0x0a08, 0x1c3a: 0x0a08, 0x1c3b: 0x0a08, 0x1c3c: 0x0a08, 0x1c3d: 0x0a08, 0x1c3e: 0x0a08, 0x1c3f: 0x0a08, // Block 0x71, offset 0x1c40 0x1c40: 0xb189, 0x1c41: 0xb1a1, 0x1c42: 0xb201, 0x1c43: 0xb249, 0x1c44: 0x0040, 0x1c45: 0xb411, 0x1c46: 0xb291, 0x1c47: 0xb219, 0x1c48: 0xb309, 0x1c49: 0xb429, 0x1c4a: 0xb399, 0x1c4b: 0xb3b1, 0x1c4c: 0xb3c9, 0x1c4d: 0xb3e1, 0x1c4e: 0xb2a9, 0x1c4f: 0xb339, 0x1c50: 0xb369, 0x1c51: 0xb2d9, 0x1c52: 0xb381, 0x1c53: 0xb279, 0x1c54: 0xb2c1, 0x1c55: 0xb1d1, 0x1c56: 0xb1e9, 0x1c57: 0xb231, 0x1c58: 0xb261, 0x1c59: 0xb2f1, 0x1c5a: 0xb321, 0x1c5b: 0xb351, 0x1c5c: 0xbc59, 0x1c5d: 0x7949, 0x1c5e: 0xbc71, 0x1c5f: 0xbc89, 0x1c60: 0x0040, 0x1c61: 0xb1a1, 0x1c62: 0xb201, 0x1c63: 0x0040, 0x1c64: 0xb3f9, 0x1c65: 0x0040, 0x1c66: 0x0040, 0x1c67: 0xb219, 0x1c68: 0x0040, 0x1c69: 0xb429, 0x1c6a: 0xb399, 0x1c6b: 0xb3b1, 0x1c6c: 0xb3c9, 0x1c6d: 0xb3e1, 0x1c6e: 0xb2a9, 0x1c6f: 0xb339, 0x1c70: 0xb369, 0x1c71: 0xb2d9, 0x1c72: 0xb381, 0x1c73: 0x0040, 0x1c74: 0xb2c1, 0x1c75: 0xb1d1, 0x1c76: 0xb1e9, 0x1c77: 0xb231, 0x1c78: 0x0040, 0x1c79: 0xb2f1, 0x1c7a: 0x0040, 0x1c7b: 0xb351, 0x1c7c: 0x0040, 0x1c7d: 0x0040, 0x1c7e: 0x0040, 0x1c7f: 0x0040, // Block 0x72, offset 0x1c80 0x1c80: 0x0040, 0x1c81: 0x0040, 0x1c82: 0xb201, 0x1c83: 0x0040, 0x1c84: 0x0040, 0x1c85: 0x0040, 0x1c86: 0x0040, 0x1c87: 0xb219, 0x1c88: 0x0040, 0x1c89: 0xb429, 0x1c8a: 0x0040, 0x1c8b: 0xb3b1, 0x1c8c: 0x0040, 0x1c8d: 0xb3e1, 0x1c8e: 0xb2a9, 0x1c8f: 0xb339, 0x1c90: 0x0040, 0x1c91: 0xb2d9, 0x1c92: 0xb381, 0x1c93: 0x0040, 0x1c94: 0xb2c1, 0x1c95: 0x0040, 0x1c96: 0x0040, 0x1c97: 0xb231, 0x1c98: 0x0040, 0x1c99: 0xb2f1, 0x1c9a: 0x0040, 0x1c9b: 0xb351, 0x1c9c: 0x0040, 0x1c9d: 0x7949, 0x1c9e: 0x0040, 0x1c9f: 0xbc89, 0x1ca0: 0x0040, 0x1ca1: 0xb1a1, 0x1ca2: 0xb201, 0x1ca3: 0x0040, 0x1ca4: 0xb3f9, 0x1ca5: 0x0040, 0x1ca6: 0x0040, 0x1ca7: 0xb219, 0x1ca8: 0xb309, 0x1ca9: 0xb429, 0x1caa: 0xb399, 0x1cab: 0x0040, 0x1cac: 0xb3c9, 0x1cad: 0xb3e1, 0x1cae: 0xb2a9, 0x1caf: 0xb339, 0x1cb0: 0xb369, 0x1cb1: 0xb2d9, 0x1cb2: 0xb381, 0x1cb3: 0x0040, 0x1cb4: 0xb2c1, 0x1cb5: 0xb1d1, 0x1cb6: 0xb1e9, 0x1cb7: 0xb231, 0x1cb8: 0x0040, 0x1cb9: 0xb2f1, 0x1cba: 0xb321, 0x1cbb: 0xb351, 0x1cbc: 0xbc59, 0x1cbd: 0x0040, 0x1cbe: 0xbc71, 0x1cbf: 0x0040, // Block 0x73, offset 0x1cc0 0x1cc0: 0xb189, 0x1cc1: 0xb1a1, 0x1cc2: 0xb201, 0x1cc3: 0xb249, 0x1cc4: 0xb3f9, 0x1cc5: 0xb411, 0x1cc6: 0xb291, 0x1cc7: 0xb219, 0x1cc8: 0xb309, 0x1cc9: 0xb429, 0x1cca: 0x0040, 0x1ccb: 0xb3b1, 0x1ccc: 0xb3c9, 0x1ccd: 0xb3e1, 0x1cce: 0xb2a9, 0x1ccf: 0xb339, 0x1cd0: 0xb369, 0x1cd1: 0xb2d9, 0x1cd2: 0xb381, 0x1cd3: 0xb279, 0x1cd4: 0xb2c1, 0x1cd5: 0xb1d1, 0x1cd6: 0xb1e9, 0x1cd7: 0xb231, 0x1cd8: 0xb261, 0x1cd9: 0xb2f1, 0x1cda: 0xb321, 0x1cdb: 0xb351, 0x1cdc: 0x0040, 0x1cdd: 0x0040, 0x1cde: 0x0040, 0x1cdf: 0x0040, 0x1ce0: 0x0040, 0x1ce1: 0xb1a1, 0x1ce2: 0xb201, 0x1ce3: 0xb249, 0x1ce4: 0x0040, 0x1ce5: 0xb411, 0x1ce6: 0xb291, 0x1ce7: 0xb219, 0x1ce8: 0xb309, 0x1ce9: 0xb429, 0x1cea: 0x0040, 0x1ceb: 0xb3b1, 0x1cec: 0xb3c9, 0x1ced: 0xb3e1, 0x1cee: 0xb2a9, 0x1cef: 0xb339, 0x1cf0: 0xb369, 0x1cf1: 0xb2d9, 0x1cf2: 0xb381, 0x1cf3: 0xb279, 0x1cf4: 0xb2c1, 0x1cf5: 0xb1d1, 0x1cf6: 0xb1e9, 0x1cf7: 0xb231, 0x1cf8: 0xb261, 0x1cf9: 0xb2f1, 0x1cfa: 0xb321, 0x1cfb: 0xb351, 0x1cfc: 0x0040, 0x1cfd: 0x0040, 0x1cfe: 0x0040, 0x1cff: 0x0040, // Block 0x74, offset 0x1d00 0x1d00: 0x0040, 0x1d01: 0xbca2, 0x1d02: 0xbcba, 0x1d03: 0xbcd2, 0x1d04: 0xbcea, 0x1d05: 0xbd02, 0x1d06: 0xbd1a, 0x1d07: 0xbd32, 0x1d08: 0xbd4a, 0x1d09: 0xbd62, 0x1d0a: 0xbd7a, 0x1d0b: 0x0018, 0x1d0c: 0x0018, 0x1d0d: 0x0040, 0x1d0e: 0x0040, 0x1d0f: 0x0040, 0x1d10: 0xbd92, 0x1d11: 0xbdb2, 0x1d12: 0xbdd2, 0x1d13: 0xbdf2, 0x1d14: 0xbe12, 0x1d15: 0xbe32, 0x1d16: 0xbe52, 0x1d17: 0xbe72, 0x1d18: 0xbe92, 0x1d19: 0xbeb2, 0x1d1a: 0xbed2, 0x1d1b: 0xbef2, 0x1d1c: 0xbf12, 0x1d1d: 0xbf32, 0x1d1e: 0xbf52, 0x1d1f: 0xbf72, 0x1d20: 0xbf92, 0x1d21: 0xbfb2, 0x1d22: 0xbfd2, 0x1d23: 0xbff2, 0x1d24: 0xc012, 0x1d25: 0xc032, 0x1d26: 0xc052, 0x1d27: 0xc072, 0x1d28: 0xc092, 0x1d29: 0xc0b2, 0x1d2a: 0xc0d1, 0x1d2b: 0x1159, 0x1d2c: 0x0269, 0x1d2d: 0x6671, 0x1d2e: 0xc111, 0x1d2f: 0x0040, 0x1d30: 0x0039, 0x1d31: 0x0ee9, 0x1d32: 0x1159, 0x1d33: 0x0ef9, 0x1d34: 0x0f09, 0x1d35: 0x1199, 0x1d36: 0x0f31, 0x1d37: 0x0249, 0x1d38: 0x0f41, 0x1d39: 0x0259, 0x1d3a: 0x0f51, 0x1d3b: 0x0359, 0x1d3c: 0x0f61, 0x1d3d: 0x0f71, 0x1d3e: 0x00d9, 0x1d3f: 0x0f99, // Block 0x75, offset 0x1d40 0x1d40: 0x2039, 0x1d41: 0x0269, 0x1d42: 0x01d9, 0x1d43: 0x0fa9, 0x1d44: 0x0fb9, 0x1d45: 0x1089, 0x1d46: 0x0279, 0x1d47: 0x0369, 0x1d48: 0x0289, 0x1d49: 0x13d1, 0x1d4a: 0xc129, 0x1d4b: 0x65b1, 0x1d4c: 0xc141, 0x1d4d: 0x1441, 0x1d4e: 0xc159, 0x1d4f: 0xc179, 0x1d50: 0x0018, 0x1d51: 0x0018, 0x1d52: 0x0018, 0x1d53: 0x0018, 0x1d54: 0x0018, 0x1d55: 0x0018, 0x1d56: 0x0018, 0x1d57: 0x0018, 0x1d58: 0x0018, 0x1d59: 0x0018, 0x1d5a: 0x0018, 0x1d5b: 0x0018, 0x1d5c: 0x0018, 0x1d5d: 0x0018, 0x1d5e: 0x0018, 0x1d5f: 0x0018, 0x1d60: 0x0018, 0x1d61: 0x0018, 0x1d62: 0x0018, 0x1d63: 0x0018, 0x1d64: 0x0018, 0x1d65: 0x0018, 0x1d66: 0x0018, 0x1d67: 0x0018, 0x1d68: 0x0018, 0x1d69: 0x0018, 0x1d6a: 0xc191, 0x1d6b: 0xc1a9, 0x1d6c: 0x0040, 0x1d6d: 0x0040, 0x1d6e: 0x0040, 0x1d6f: 0x0040, 0x1d70: 0x0018, 0x1d71: 0x0018, 0x1d72: 0x0018, 0x1d73: 0x0018, 0x1d74: 0x0018, 0x1d75: 0x0018, 0x1d76: 0x0018, 0x1d77: 0x0018, 0x1d78: 0x0018, 0x1d79: 0x0018, 0x1d7a: 0x0018, 0x1d7b: 0x0018, 0x1d7c: 0x0018, 0x1d7d: 0x0018, 0x1d7e: 0x0018, 0x1d7f: 0x0018, // Block 0x76, offset 0x1d80 0x1d80: 0xc1d9, 0x1d81: 0xc211, 0x1d82: 0xc249, 0x1d83: 0x0040, 0x1d84: 0x0040, 0x1d85: 0x0040, 0x1d86: 0x0040, 0x1d87: 0x0040, 0x1d88: 0x0040, 0x1d89: 0x0040, 0x1d8a: 0x0040, 0x1d8b: 0x0040, 0x1d8c: 0x0040, 0x1d8d: 0x0040, 0x1d8e: 0x0040, 0x1d8f: 0x0040, 0x1d90: 0xc269, 0x1d91: 0xc289, 0x1d92: 0xc2a9, 0x1d93: 0xc2c9, 0x1d94: 0xc2e9, 0x1d95: 0xc309, 0x1d96: 0xc329, 0x1d97: 0xc349, 0x1d98: 0xc369, 0x1d99: 0xc389, 0x1d9a: 0xc3a9, 0x1d9b: 0xc3c9, 0x1d9c: 0xc3e9, 0x1d9d: 0xc409, 0x1d9e: 0xc429, 0x1d9f: 0xc449, 0x1da0: 0xc469, 0x1da1: 0xc489, 0x1da2: 0xc4a9, 0x1da3: 0xc4c9, 0x1da4: 0xc4e9, 0x1da5: 0xc509, 0x1da6: 0xc529, 0x1da7: 0xc549, 0x1da8: 0xc569, 0x1da9: 0xc589, 0x1daa: 0xc5a9, 0x1dab: 0xc5c9, 0x1dac: 0xc5e9, 0x1dad: 0xc609, 0x1dae: 0xc629, 0x1daf: 0xc649, 0x1db0: 0xc669, 0x1db1: 0xc689, 0x1db2: 0xc6a9, 0x1db3: 0xc6c9, 0x1db4: 0xc6e9, 0x1db5: 0xc709, 0x1db6: 0xc729, 0x1db7: 0xc749, 0x1db8: 0xc769, 0x1db9: 0xc789, 0x1dba: 0xc7a9, 0x1dbb: 0xc7c9, 0x1dbc: 0x0040, 0x1dbd: 0x0040, 0x1dbe: 0x0040, 0x1dbf: 0x0040, // Block 0x77, offset 0x1dc0 0x1dc0: 0xcaf9, 0x1dc1: 0xcb19, 0x1dc2: 0xcb39, 0x1dc3: 0x8b1d, 0x1dc4: 0xcb59, 0x1dc5: 0xcb79, 0x1dc6: 0xcb99, 0x1dc7: 0xcbb9, 0x1dc8: 0xcbd9, 0x1dc9: 0xcbf9, 0x1dca: 0xcc19, 0x1dcb: 0xcc39, 0x1dcc: 0xcc59, 0x1dcd: 0x8b3d, 0x1dce: 0xcc79, 0x1dcf: 0xcc99, 0x1dd0: 0xccb9, 0x1dd1: 0xccd9, 0x1dd2: 0x8b5d, 0x1dd3: 0xccf9, 0x1dd4: 0xcd19, 0x1dd5: 0xc429, 0x1dd6: 0x8b7d, 0x1dd7: 0xcd39, 0x1dd8: 0xcd59, 0x1dd9: 0xcd79, 0x1dda: 0xcd99, 0x1ddb: 0xcdb9, 0x1ddc: 0x8b9d, 0x1ddd: 0xcdd9, 0x1dde: 0xcdf9, 0x1ddf: 0xce19, 0x1de0: 0xce39, 0x1de1: 0xce59, 0x1de2: 0xc789, 0x1de3: 0xce79, 0x1de4: 0xce99, 0x1de5: 0xceb9, 0x1de6: 0xced9, 0x1de7: 0xcef9, 0x1de8: 0xcf19, 0x1de9: 0xcf39, 0x1dea: 0xcf59, 0x1deb: 0xcf79, 0x1dec: 0xcf99, 0x1ded: 0xcfb9, 0x1dee: 0xcfd9, 0x1def: 0xcff9, 0x1df0: 0xd019, 0x1df1: 0xd039, 0x1df2: 0xd039, 0x1df3: 0xd039, 0x1df4: 0x8bbd, 0x1df5: 0xd059, 0x1df6: 0xd079, 0x1df7: 0xd099, 0x1df8: 0x8bdd, 0x1df9: 0xd0b9, 0x1dfa: 0xd0d9, 0x1dfb: 0xd0f9, 0x1dfc: 0xd119, 0x1dfd: 0xd139, 0x1dfe: 0xd159, 0x1dff: 0xd179, // Block 0x78, offset 0x1e00 0x1e00: 0xd199, 0x1e01: 0xd1b9, 0x1e02: 0xd1d9, 0x1e03: 0xd1f9, 0x1e04: 0xd219, 0x1e05: 0xd239, 0x1e06: 0xd239, 0x1e07: 0xd259, 0x1e08: 0xd279, 0x1e09: 0xd299, 0x1e0a: 0xd2b9, 0x1e0b: 0xd2d9, 0x1e0c: 0xd2f9, 0x1e0d: 0xd319, 0x1e0e: 0xd339, 0x1e0f: 0xd359, 0x1e10: 0xd379, 0x1e11: 0xd399, 0x1e12: 0xd3b9, 0x1e13: 0xd3d9, 0x1e14: 0xd3f9, 0x1e15: 0xd419, 0x1e16: 0xd439, 0x1e17: 0xd459, 0x1e18: 0xd479, 0x1e19: 0x8bfd, 0x1e1a: 0xd499, 0x1e1b: 0xd4b9, 0x1e1c: 0xd4d9, 0x1e1d: 0xc309, 0x1e1e: 0xd4f9, 0x1e1f: 0xd519, 0x1e20: 0x8c1d, 0x1e21: 0x8c3d, 0x1e22: 0xd539, 0x1e23: 0xd559, 0x1e24: 0xd579, 0x1e25: 0xd599, 0x1e26: 0xd5b9, 0x1e27: 0xd5d9, 0x1e28: 0x2040, 0x1e29: 0xd5f9, 0x1e2a: 0xd619, 0x1e2b: 0xd619, 0x1e2c: 0x8c5d, 0x1e2d: 0xd639, 0x1e2e: 0xd659, 0x1e2f: 0xd679, 0x1e30: 0xd699, 0x1e31: 0x8c7d, 0x1e32: 0xd6b9, 0x1e33: 0xd6d9, 0x1e34: 0x2040, 0x1e35: 0xd6f9, 0x1e36: 0xd719, 0x1e37: 0xd739, 0x1e38: 0xd759, 0x1e39: 0xd779, 0x1e3a: 0xd799, 0x1e3b: 0x8c9d, 0x1e3c: 0xd7b9, 0x1e3d: 0x8cbd, 0x1e3e: 0xd7d9, 0x1e3f: 0xd7f9, // Block 0x79, offset 0x1e40 0x1e40: 0xd819, 0x1e41: 0xd839, 0x1e42: 0xd859, 0x1e43: 0xd879, 0x1e44: 0xd899, 0x1e45: 0xd8b9, 0x1e46: 0xd8d9, 0x1e47: 0xd8f9, 0x1e48: 0xd919, 0x1e49: 0x8cdd, 0x1e4a: 0xd939, 0x1e4b: 0xd959, 0x1e4c: 0xd979, 0x1e4d: 0xd999, 0x1e4e: 0xd9b9, 0x1e4f: 0x8cfd, 0x1e50: 0xd9d9, 0x1e51: 0x8d1d, 0x1e52: 0x8d3d, 0x1e53: 0xd9f9, 0x1e54: 0xda19, 0x1e55: 0xda19, 0x1e56: 0xda39, 0x1e57: 0x8d5d, 0x1e58: 0x8d7d, 0x1e59: 0xda59, 0x1e5a: 0xda79, 0x1e5b: 0xda99, 0x1e5c: 0xdab9, 0x1e5d: 0xdad9, 0x1e5e: 0xdaf9, 0x1e5f: 0xdb19, 0x1e60: 0xdb39, 0x1e61: 0xdb59, 0x1e62: 0xdb79, 0x1e63: 0xdb99, 0x1e64: 0x8d9d, 0x1e65: 0xdbb9, 0x1e66: 0xdbd9, 0x1e67: 0xdbf9, 0x1e68: 0xdc19, 0x1e69: 0xdbf9, 0x1e6a: 0xdc39, 0x1e6b: 0xdc59, 0x1e6c: 0xdc79, 0x1e6d: 0xdc99, 0x1e6e: 0xdcb9, 0x1e6f: 0xdcd9, 0x1e70: 0xdcf9, 0x1e71: 0xdd19, 0x1e72: 0xdd39, 0x1e73: 0xdd59, 0x1e74: 0xdd79, 0x1e75: 0xdd99, 0x1e76: 0xddb9, 0x1e77: 0xddd9, 0x1e78: 0x8dbd, 0x1e79: 0xddf9, 0x1e7a: 0xde19, 0x1e7b: 0xde39, 0x1e7c: 0xde59, 0x1e7d: 0xde79, 0x1e7e: 0x8ddd, 0x1e7f: 0xde99, // Block 0x7a, offset 0x1e80 0x1e80: 0xe599, 0x1e81: 0xe5b9, 0x1e82: 0xe5d9, 0x1e83: 0xe5f9, 0x1e84: 0xe619, 0x1e85: 0xe639, 0x1e86: 0x8efd, 0x1e87: 0xe659, 0x1e88: 0xe679, 0x1e89: 0xe699, 0x1e8a: 0xe6b9, 0x1e8b: 0xe6d9, 0x1e8c: 0xe6f9, 0x1e8d: 0x8f1d, 0x1e8e: 0xe719, 0x1e8f: 0xe739, 0x1e90: 0x8f3d, 0x1e91: 0x8f5d, 0x1e92: 0xe759, 0x1e93: 0xe779, 0x1e94: 0xe799, 0x1e95: 0xe7b9, 0x1e96: 0xe7d9, 0x1e97: 0xe7f9, 0x1e98: 0xe819, 0x1e99: 0xe839, 0x1e9a: 0xe859, 0x1e9b: 0x8f7d, 0x1e9c: 0xe879, 0x1e9d: 0x8f9d, 0x1e9e: 0xe899, 0x1e9f: 0x2040, 0x1ea0: 0xe8b9, 0x1ea1: 0xe8d9, 0x1ea2: 0xe8f9, 0x1ea3: 0x8fbd, 0x1ea4: 0xe919, 0x1ea5: 0xe939, 0x1ea6: 0x8fdd, 0x1ea7: 0x8ffd, 0x1ea8: 0xe959, 0x1ea9: 0xe979, 0x1eaa: 0xe999, 0x1eab: 0xe9b9, 0x1eac: 0xe9d9, 0x1ead: 0xe9d9, 0x1eae: 0xe9f9, 0x1eaf: 0xea19, 0x1eb0: 0xea39, 0x1eb1: 0xea59, 0x1eb2: 0xea79, 0x1eb3: 0xea99, 0x1eb4: 0xeab9, 0x1eb5: 0x901d, 0x1eb6: 0xead9, 0x1eb7: 0x903d, 0x1eb8: 0xeaf9, 0x1eb9: 0x905d, 0x1eba: 0xeb19, 0x1ebb: 0x907d, 0x1ebc: 0x909d, 0x1ebd: 0x90bd, 0x1ebe: 0xeb39, 0x1ebf: 0xeb59, // Block 0x7b, offset 0x1ec0 0x1ec0: 0xeb79, 0x1ec1: 0x90dd, 0x1ec2: 0x90fd, 0x1ec3: 0x911d, 0x1ec4: 0x913d, 0x1ec5: 0xeb99, 0x1ec6: 0xebb9, 0x1ec7: 0xebb9, 0x1ec8: 0xebd9, 0x1ec9: 0xebf9, 0x1eca: 0xec19, 0x1ecb: 0xec39, 0x1ecc: 0xec59, 0x1ecd: 0x915d, 0x1ece: 0xec79, 0x1ecf: 0xec99, 0x1ed0: 0xecb9, 0x1ed1: 0xecd9, 0x1ed2: 0x917d, 0x1ed3: 0xecf9, 0x1ed4: 0x919d, 0x1ed5: 0x91bd, 0x1ed6: 0xed19, 0x1ed7: 0xed39, 0x1ed8: 0xed59, 0x1ed9: 0xed79, 0x1eda: 0xed99, 0x1edb: 0xedb9, 0x1edc: 0x91dd, 0x1edd: 0x91fd, 0x1ede: 0x921d, 0x1edf: 0x2040, 0x1ee0: 0xedd9, 0x1ee1: 0x923d, 0x1ee2: 0xedf9, 0x1ee3: 0xee19, 0x1ee4: 0xee39, 0x1ee5: 0x925d, 0x1ee6: 0xee59, 0x1ee7: 0xee79, 0x1ee8: 0xee99, 0x1ee9: 0xeeb9, 0x1eea: 0xeed9, 0x1eeb: 0x927d, 0x1eec: 0xeef9, 0x1eed: 0xef19, 0x1eee: 0xef39, 0x1eef: 0xef59, 0x1ef0: 0xef79, 0x1ef1: 0xef99, 0x1ef2: 0x929d, 0x1ef3: 0x92bd, 0x1ef4: 0xefb9, 0x1ef5: 0x92dd, 0x1ef6: 0xefd9, 0x1ef7: 0x92fd, 0x1ef8: 0xeff9, 0x1ef9: 0xf019, 0x1efa: 0xf039, 0x1efb: 0x931d, 0x1efc: 0x933d, 0x1efd: 0xf059, 0x1efe: 0x935d, 0x1eff: 0xf079, // Block 0x7c, offset 0x1f00 0x1f00: 0xf6b9, 0x1f01: 0xf6d9, 0x1f02: 0xf6f9, 0x1f03: 0xf719, 0x1f04: 0xf739, 0x1f05: 0x951d, 0x1f06: 0xf759, 0x1f07: 0xf779, 0x1f08: 0xf799, 0x1f09: 0xf7b9, 0x1f0a: 0xf7d9, 0x1f0b: 0x953d, 0x1f0c: 0x955d, 0x1f0d: 0xf7f9, 0x1f0e: 0xf819, 0x1f0f: 0xf839, 0x1f10: 0xf859, 0x1f11: 0xf879, 0x1f12: 0xf899, 0x1f13: 0x957d, 0x1f14: 0xf8b9, 0x1f15: 0xf8d9, 0x1f16: 0xf8f9, 0x1f17: 0xf919, 0x1f18: 0x959d, 0x1f19: 0x95bd, 0x1f1a: 0xf939, 0x1f1b: 0xf959, 0x1f1c: 0xf979, 0x1f1d: 0x95dd, 0x1f1e: 0xf999, 0x1f1f: 0xf9b9, 0x1f20: 0x6815, 0x1f21: 0x95fd, 0x1f22: 0xf9d9, 0x1f23: 0xf9f9, 0x1f24: 0xfa19, 0x1f25: 0x961d, 0x1f26: 0xfa39, 0x1f27: 0xfa59, 0x1f28: 0xfa79, 0x1f29: 0xfa99, 0x1f2a: 0xfab9, 0x1f2b: 0xfad9, 0x1f2c: 0xfaf9, 0x1f2d: 0x963d, 0x1f2e: 0xfb19, 0x1f2f: 0xfb39, 0x1f30: 0xfb59, 0x1f31: 0x965d, 0x1f32: 0xfb79, 0x1f33: 0xfb99, 0x1f34: 0xfbb9, 0x1f35: 0xfbd9, 0x1f36: 0x7b35, 0x1f37: 0x967d, 0x1f38: 0xfbf9, 0x1f39: 0xfc19, 0x1f3a: 0xfc39, 0x1f3b: 0x969d, 0x1f3c: 0xfc59, 0x1f3d: 0x96bd, 0x1f3e: 0xfc79, 0x1f3f: 0xfc79, // Block 0x7d, offset 0x1f40 0x1f40: 0xfc99, 0x1f41: 0x96dd, 0x1f42: 0xfcb9, 0x1f43: 0xfcd9, 0x1f44: 0xfcf9, 0x1f45: 0xfd19, 0x1f46: 0xfd39, 0x1f47: 0xfd59, 0x1f48: 0xfd79, 0x1f49: 0x96fd, 0x1f4a: 0xfd99, 0x1f4b: 0xfdb9, 0x1f4c: 0xfdd9, 0x1f4d: 0xfdf9, 0x1f4e: 0xfe19, 0x1f4f: 0xfe39, 0x1f50: 0x971d, 0x1f51: 0xfe59, 0x1f52: 0x973d, 0x1f53: 0x975d, 0x1f54: 0x977d, 0x1f55: 0xfe79, 0x1f56: 0xfe99, 0x1f57: 0xfeb9, 0x1f58: 0xfed9, 0x1f59: 0xfef9, 0x1f5a: 0xff19, 0x1f5b: 0xff39, 0x1f5c: 0xff59, 0x1f5d: 0x979d, 0x1f5e: 0x0040, 0x1f5f: 0x0040, 0x1f60: 0x0040, 0x1f61: 0x0040, 0x1f62: 0x0040, 0x1f63: 0x0040, 0x1f64: 0x0040, 0x1f65: 0x0040, 0x1f66: 0x0040, 0x1f67: 0x0040, 0x1f68: 0x0040, 0x1f69: 0x0040, 0x1f6a: 0x0040, 0x1f6b: 0x0040, 0x1f6c: 0x0040, 0x1f6d: 0x0040, 0x1f6e: 0x0040, 0x1f6f: 0x0040, 0x1f70: 0x0040, 0x1f71: 0x0040, 0x1f72: 0x0040, 0x1f73: 0x0040, 0x1f74: 0x0040, 0x1f75: 0x0040, 0x1f76: 0x0040, 0x1f77: 0x0040, 0x1f78: 0x0040, 0x1f79: 0x0040, 0x1f7a: 0x0040, 0x1f7b: 0x0040, 0x1f7c: 0x0040, 0x1f7d: 0x0040, 0x1f7e: 0x0040, 0x1f7f: 0x0040, } // idnaIndex: 35 blocks, 2240 entries, 4480 bytes // Block 0 is the zero block. var idnaIndex = [2240]uint16{ // Block 0x0, offset 0x0 // Block 0x1, offset 0x40 // Block 0x2, offset 0x80 // Block 0x3, offset 0xc0 0xc2: 0x01, 0xc3: 0x7c, 0xc4: 0x02, 0xc5: 0x03, 0xc6: 0x04, 0xc7: 0x05, 0xc8: 0x06, 0xc9: 0x7d, 0xca: 0x7e, 0xcb: 0x07, 0xcc: 0x7f, 0xcd: 0x08, 0xce: 0x09, 0xcf: 0x0a, 0xd0: 0x80, 0xd1: 0x0b, 0xd2: 0x0c, 0xd3: 0x0d, 0xd4: 0x0e, 0xd5: 0x81, 0xd6: 0x82, 0xd7: 0x83, 0xd8: 0x0f, 0xd9: 0x10, 0xda: 0x84, 0xdb: 0x11, 0xdc: 0x12, 0xdd: 0x85, 0xde: 0x86, 0xdf: 0x87, 0xe0: 0x02, 0xe1: 0x03, 0xe2: 0x04, 0xe3: 0x05, 0xe4: 0x06, 0xe5: 0x07, 0xe6: 0x07, 0xe7: 0x07, 0xe8: 0x07, 0xe9: 0x08, 0xea: 0x09, 0xeb: 0x07, 0xec: 0x07, 0xed: 0x0a, 0xee: 0x0b, 0xef: 0x0c, 0xf0: 0x1c, 0xf1: 0x1d, 0xf2: 0x1d, 0xf3: 0x1f, 0xf4: 0x20, // Block 0x4, offset 0x100 0x120: 0x88, 0x121: 0x89, 0x122: 0x8a, 0x123: 0x8b, 0x124: 0x8c, 0x125: 0x13, 0x126: 0x14, 0x127: 0x15, 0x128: 0x16, 0x129: 0x17, 0x12a: 0x18, 0x12b: 0x19, 0x12c: 0x1a, 0x12d: 0x1b, 0x12e: 0x1c, 0x12f: 0x8d, 0x130: 0x8e, 0x131: 0x1d, 0x132: 0x1e, 0x133: 0x1f, 0x134: 0x8f, 0x135: 0x20, 0x136: 0x90, 0x137: 0x91, 0x138: 0x92, 0x139: 0x93, 0x13a: 0x21, 0x13b: 0x94, 0x13c: 0x95, 0x13d: 0x22, 0x13e: 0x23, 0x13f: 0x96, // Block 0x5, offset 0x140 0x140: 0x97, 0x141: 0x98, 0x142: 0x99, 0x143: 0x9a, 0x144: 0x9b, 0x145: 0x9c, 0x146: 0x9d, 0x147: 0x9e, 0x148: 0x9f, 0x149: 0xa0, 0x14a: 0xa1, 0x14b: 0xa2, 0x14c: 0xa3, 0x14d: 0xa4, 0x14e: 0xa5, 0x14f: 0xa6, 0x150: 0xa7, 0x151: 0x9f, 0x152: 0x9f, 0x153: 0x9f, 0x154: 0x9f, 0x155: 0x9f, 0x156: 0x9f, 0x157: 0x9f, 0x158: 0x9f, 0x159: 0xa8, 0x15a: 0xa9, 0x15b: 0xaa, 0x15c: 0xab, 0x15d: 0xac, 0x15e: 0xad, 0x15f: 0xae, 0x160: 0xaf, 0x161: 0xb0, 0x162: 0xb1, 0x163: 0xb2, 0x164: 0xb3, 0x165: 0xb4, 0x166: 0xb5, 0x167: 0xb6, 0x168: 0xb7, 0x169: 0xb8, 0x16a: 0xb9, 0x16b: 0xba, 0x16c: 0xbb, 0x16d: 0xbc, 0x16e: 0xbd, 0x16f: 0xbe, 0x170: 0xbf, 0x171: 0xc0, 0x172: 0xc1, 0x173: 0xc2, 0x174: 0x24, 0x175: 0x25, 0x176: 0x26, 0x177: 0xc3, 0x178: 0x27, 0x179: 0x27, 0x17a: 0x28, 0x17b: 0x27, 0x17c: 0xc4, 0x17d: 0x29, 0x17e: 0x2a, 0x17f: 0x2b, // Block 0x6, offset 0x180 0x180: 0x2c, 0x181: 0x2d, 0x182: 0x2e, 0x183: 0xc5, 0x184: 0x2f, 0x185: 0x30, 0x186: 0xc6, 0x187: 0x9b, 0x188: 0xc7, 0x189: 0xc8, 0x18a: 0x9b, 0x18b: 0x9b, 0x18c: 0xc9, 0x18d: 0x9b, 0x18e: 0x9b, 0x18f: 0xca, 0x190: 0xcb, 0x191: 0x31, 0x192: 0x32, 0x193: 0x33, 0x194: 0x9b, 0x195: 0x9b, 0x196: 0x9b, 0x197: 0x9b, 0x198: 0x9b, 0x199: 0x9b, 0x19a: 0x9b, 0x19b: 0x9b, 0x19c: 0x9b, 0x19d: 0x9b, 0x19e: 0x9b, 0x19f: 0x9b, 0x1a0: 0x9b, 0x1a1: 0x9b, 0x1a2: 0x9b, 0x1a3: 0x9b, 0x1a4: 0x9b, 0x1a5: 0x9b, 0x1a6: 0x9b, 0x1a7: 0x9b, 0x1a8: 0xcc, 0x1a9: 0xcd, 0x1aa: 0x9b, 0x1ab: 0xce, 0x1ac: 0x9b, 0x1ad: 0xcf, 0x1ae: 0xd0, 0x1af: 0xd1, 0x1b0: 0xd2, 0x1b1: 0x34, 0x1b2: 0x27, 0x1b3: 0x35, 0x1b4: 0xd3, 0x1b5: 0xd4, 0x1b6: 0xd5, 0x1b7: 0xd6, 0x1b8: 0xd7, 0x1b9: 0xd8, 0x1ba: 0xd9, 0x1bb: 0xda, 0x1bc: 0xdb, 0x1bd: 0xdc, 0x1be: 0xdd, 0x1bf: 0x36, // Block 0x7, offset 0x1c0 0x1c0: 0x37, 0x1c1: 0xde, 0x1c2: 0xdf, 0x1c3: 0xe0, 0x1c4: 0xe1, 0x1c5: 0x38, 0x1c6: 0x39, 0x1c7: 0xe2, 0x1c8: 0xe3, 0x1c9: 0x3a, 0x1ca: 0x3b, 0x1cb: 0x3c, 0x1cc: 0x3d, 0x1cd: 0x3e, 0x1ce: 0x3f, 0x1cf: 0x40, 0x1d0: 0x9f, 0x1d1: 0x9f, 0x1d2: 0x9f, 0x1d3: 0x9f, 0x1d4: 0x9f, 0x1d5: 0x9f, 0x1d6: 0x9f, 0x1d7: 0x9f, 0x1d8: 0x9f, 0x1d9: 0x9f, 0x1da: 0x9f, 0x1db: 0x9f, 0x1dc: 0x9f, 0x1dd: 0x9f, 0x1de: 0x9f, 0x1df: 0x9f, 0x1e0: 0x9f, 0x1e1: 0x9f, 0x1e2: 0x9f, 0x1e3: 0x9f, 0x1e4: 0x9f, 0x1e5: 0x9f, 0x1e6: 0x9f, 0x1e7: 0x9f, 0x1e8: 0x9f, 0x1e9: 0x9f, 0x1ea: 0x9f, 0x1eb: 0x9f, 0x1ec: 0x9f, 0x1ed: 0x9f, 0x1ee: 0x9f, 0x1ef: 0x9f, 0x1f0: 0x9f, 0x1f1: 0x9f, 0x1f2: 0x9f, 0x1f3: 0x9f, 0x1f4: 0x9f, 0x1f5: 0x9f, 0x1f6: 0x9f, 0x1f7: 0x9f, 0x1f8: 0x9f, 0x1f9: 0x9f, 0x1fa: 0x9f, 0x1fb: 0x9f, 0x1fc: 0x9f, 0x1fd: 0x9f, 0x1fe: 0x9f, 0x1ff: 0x9f, // Block 0x8, offset 0x200 0x200: 0x9f, 0x201: 0x9f, 0x202: 0x9f, 0x203: 0x9f, 0x204: 0x9f, 0x205: 0x9f, 0x206: 0x9f, 0x207: 0x9f, 0x208: 0x9f, 0x209: 0x9f, 0x20a: 0x9f, 0x20b: 0x9f, 0x20c: 0x9f, 0x20d: 0x9f, 0x20e: 0x9f, 0x20f: 0x9f, 0x210: 0x9f, 0x211: 0x9f, 0x212: 0x9f, 0x213: 0x9f, 0x214: 0x9f, 0x215: 0x9f, 0x216: 0x9f, 0x217: 0x9f, 0x218: 0x9f, 0x219: 0x9f, 0x21a: 0x9f, 0x21b: 0x9f, 0x21c: 0x9f, 0x21d: 0x9f, 0x21e: 0x9f, 0x21f: 0x9f, 0x220: 0x9f, 0x221: 0x9f, 0x222: 0x9f, 0x223: 0x9f, 0x224: 0x9f, 0x225: 0x9f, 0x226: 0x9f, 0x227: 0x9f, 0x228: 0x9f, 0x229: 0x9f, 0x22a: 0x9f, 0x22b: 0x9f, 0x22c: 0x9f, 0x22d: 0x9f, 0x22e: 0x9f, 0x22f: 0x9f, 0x230: 0x9f, 0x231: 0x9f, 0x232: 0x9f, 0x233: 0x9f, 0x234: 0x9f, 0x235: 0x9f, 0x236: 0xb2, 0x237: 0x9b, 0x238: 0x9f, 0x239: 0x9f, 0x23a: 0x9f, 0x23b: 0x9f, 0x23c: 0x9f, 0x23d: 0x9f, 0x23e: 0x9f, 0x23f: 0x9f, // Block 0x9, offset 0x240 0x240: 0x9f, 0x241: 0x9f, 0x242: 0x9f, 0x243: 0x9f, 0x244: 0x9f, 0x245: 0x9f, 0x246: 0x9f, 0x247: 0x9f, 0x248: 0x9f, 0x249: 0x9f, 0x24a: 0x9f, 0x24b: 0x9f, 0x24c: 0x9f, 0x24d: 0x9f, 0x24e: 0x9f, 0x24f: 0x9f, 0x250: 0x9f, 0x251: 0x9f, 0x252: 0x9f, 0x253: 0x9f, 0x254: 0x9f, 0x255: 0x9f, 0x256: 0x9f, 0x257: 0x9f, 0x258: 0x9f, 0x259: 0x9f, 0x25a: 0x9f, 0x25b: 0x9f, 0x25c: 0x9f, 0x25d: 0x9f, 0x25e: 0x9f, 0x25f: 0x9f, 0x260: 0x9f, 0x261: 0x9f, 0x262: 0x9f, 0x263: 0x9f, 0x264: 0x9f, 0x265: 0x9f, 0x266: 0x9f, 0x267: 0x9f, 0x268: 0x9f, 0x269: 0x9f, 0x26a: 0x9f, 0x26b: 0x9f, 0x26c: 0x9f, 0x26d: 0x9f, 0x26e: 0x9f, 0x26f: 0x9f, 0x270: 0x9f, 0x271: 0x9f, 0x272: 0x9f, 0x273: 0x9f, 0x274: 0x9f, 0x275: 0x9f, 0x276: 0x9f, 0x277: 0x9f, 0x278: 0x9f, 0x279: 0x9f, 0x27a: 0x9f, 0x27b: 0x9f, 0x27c: 0x9f, 0x27d: 0x9f, 0x27e: 0x9f, 0x27f: 0x9f, // Block 0xa, offset 0x280 0x280: 0x9f, 0x281: 0x9f, 0x282: 0x9f, 0x283: 0x9f, 0x284: 0x9f, 0x285: 0x9f, 0x286: 0x9f, 0x287: 0x9f, 0x288: 0x9f, 0x289: 0x9f, 0x28a: 0x9f, 0x28b: 0x9f, 0x28c: 0x9f, 0x28d: 0x9f, 0x28e: 0x9f, 0x28f: 0x9f, 0x290: 0x9f, 0x291: 0x9f, 0x292: 0x9f, 0x293: 0x9f, 0x294: 0x9f, 0x295: 0x9f, 0x296: 0x9f, 0x297: 0x9f, 0x298: 0x9f, 0x299: 0x9f, 0x29a: 0x9f, 0x29b: 0x9f, 0x29c: 0x9f, 0x29d: 0x9f, 0x29e: 0x9f, 0x29f: 0x9f, 0x2a0: 0x9f, 0x2a1: 0x9f, 0x2a2: 0x9f, 0x2a3: 0x9f, 0x2a4: 0x9f, 0x2a5: 0x9f, 0x2a6: 0x9f, 0x2a7: 0x9f, 0x2a8: 0x9f, 0x2a9: 0x9f, 0x2aa: 0x9f, 0x2ab: 0x9f, 0x2ac: 0x9f, 0x2ad: 0x9f, 0x2ae: 0x9f, 0x2af: 0x9f, 0x2b0: 0x9f, 0x2b1: 0x9f, 0x2b2: 0x9f, 0x2b3: 0x9f, 0x2b4: 0x9f, 0x2b5: 0x9f, 0x2b6: 0x9f, 0x2b7: 0x9f, 0x2b8: 0x9f, 0x2b9: 0x9f, 0x2ba: 0x9f, 0x2bb: 0x9f, 0x2bc: 0x9f, 0x2bd: 0x9f, 0x2be: 0x9f, 0x2bf: 0xe4, // Block 0xb, offset 0x2c0 0x2c0: 0x9f, 0x2c1: 0x9f, 0x2c2: 0x9f, 0x2c3: 0x9f, 0x2c4: 0x9f, 0x2c5: 0x9f, 0x2c6: 0x9f, 0x2c7: 0x9f, 0x2c8: 0x9f, 0x2c9: 0x9f, 0x2ca: 0x9f, 0x2cb: 0x9f, 0x2cc: 0x9f, 0x2cd: 0x9f, 0x2ce: 0x9f, 0x2cf: 0x9f, 0x2d0: 0x9f, 0x2d1: 0x9f, 0x2d2: 0xe5, 0x2d3: 0xe6, 0x2d4: 0x9f, 0x2d5: 0x9f, 0x2d6: 0x9f, 0x2d7: 0x9f, 0x2d8: 0xe7, 0x2d9: 0x41, 0x2da: 0x42, 0x2db: 0xe8, 0x2dc: 0x43, 0x2dd: 0x44, 0x2de: 0x45, 0x2df: 0xe9, 0x2e0: 0xea, 0x2e1: 0xeb, 0x2e2: 0xec, 0x2e3: 0xed, 0x2e4: 0xee, 0x2e5: 0xef, 0x2e6: 0xf0, 0x2e7: 0xf1, 0x2e8: 0xf2, 0x2e9: 0xf3, 0x2ea: 0xf4, 0x2eb: 0xf5, 0x2ec: 0xf6, 0x2ed: 0xf7, 0x2ee: 0xf8, 0x2ef: 0xf9, 0x2f0: 0x9f, 0x2f1: 0x9f, 0x2f2: 0x9f, 0x2f3: 0x9f, 0x2f4: 0x9f, 0x2f5: 0x9f, 0x2f6: 0x9f, 0x2f7: 0x9f, 0x2f8: 0x9f, 0x2f9: 0x9f, 0x2fa: 0x9f, 0x2fb: 0x9f, 0x2fc: 0x9f, 0x2fd: 0x9f, 0x2fe: 0x9f, 0x2ff: 0x9f, // Block 0xc, offset 0x300 0x300: 0x9f, 0x301: 0x9f, 0x302: 0x9f, 0x303: 0x9f, 0x304: 0x9f, 0x305: 0x9f, 0x306: 0x9f, 0x307: 0x9f, 0x308: 0x9f, 0x309: 0x9f, 0x30a: 0x9f, 0x30b: 0x9f, 0x30c: 0x9f, 0x30d: 0x9f, 0x30e: 0x9f, 0x30f: 0x9f, 0x310: 0x9f, 0x311: 0x9f, 0x312: 0x9f, 0x313: 0x9f, 0x314: 0x9f, 0x315: 0x9f, 0x316: 0x9f, 0x317: 0x9f, 0x318: 0x9f, 0x319: 0x9f, 0x31a: 0x9f, 0x31b: 0x9f, 0x31c: 0x9f, 0x31d: 0x9f, 0x31e: 0xfa, 0x31f: 0xfb, // Block 0xd, offset 0x340 0x340: 0xba, 0x341: 0xba, 0x342: 0xba, 0x343: 0xba, 0x344: 0xba, 0x345: 0xba, 0x346: 0xba, 0x347: 0xba, 0x348: 0xba, 0x349: 0xba, 0x34a: 0xba, 0x34b: 0xba, 0x34c: 0xba, 0x34d: 0xba, 0x34e: 0xba, 0x34f: 0xba, 0x350: 0xba, 0x351: 0xba, 0x352: 0xba, 0x353: 0xba, 0x354: 0xba, 0x355: 0xba, 0x356: 0xba, 0x357: 0xba, 0x358: 0xba, 0x359: 0xba, 0x35a: 0xba, 0x35b: 0xba, 0x35c: 0xba, 0x35d: 0xba, 0x35e: 0xba, 0x35f: 0xba, 0x360: 0xba, 0x361: 0xba, 0x362: 0xba, 0x363: 0xba, 0x364: 0xba, 0x365: 0xba, 0x366: 0xba, 0x367: 0xba, 0x368: 0xba, 0x369: 0xba, 0x36a: 0xba, 0x36b: 0xba, 0x36c: 0xba, 0x36d: 0xba, 0x36e: 0xba, 0x36f: 0xba, 0x370: 0xba, 0x371: 0xba, 0x372: 0xba, 0x373: 0xba, 0x374: 0xba, 0x375: 0xba, 0x376: 0xba, 0x377: 0xba, 0x378: 0xba, 0x379: 0xba, 0x37a: 0xba, 0x37b: 0xba, 0x37c: 0xba, 0x37d: 0xba, 0x37e: 0xba, 0x37f: 0xba, // Block 0xe, offset 0x380 0x380: 0xba, 0x381: 0xba, 0x382: 0xba, 0x383: 0xba, 0x384: 0xba, 0x385: 0xba, 0x386: 0xba, 0x387: 0xba, 0x388: 0xba, 0x389: 0xba, 0x38a: 0xba, 0x38b: 0xba, 0x38c: 0xba, 0x38d: 0xba, 0x38e: 0xba, 0x38f: 0xba, 0x390: 0xba, 0x391: 0xba, 0x392: 0xba, 0x393: 0xba, 0x394: 0xba, 0x395: 0xba, 0x396: 0xba, 0x397: 0xba, 0x398: 0xba, 0x399: 0xba, 0x39a: 0xba, 0x39b: 0xba, 0x39c: 0xba, 0x39d: 0xba, 0x39e: 0xba, 0x39f: 0xba, 0x3a0: 0xba, 0x3a1: 0xba, 0x3a2: 0xba, 0x3a3: 0xba, 0x3a4: 0xfc, 0x3a5: 0xfd, 0x3a6: 0xfe, 0x3a7: 0xff, 0x3a8: 0x46, 0x3a9: 0x100, 0x3aa: 0x101, 0x3ab: 0x47, 0x3ac: 0x48, 0x3ad: 0x49, 0x3ae: 0x4a, 0x3af: 0x4b, 0x3b0: 0x102, 0x3b1: 0x4c, 0x3b2: 0x4d, 0x3b3: 0x4e, 0x3b4: 0x4f, 0x3b5: 0x50, 0x3b6: 0x103, 0x3b7: 0x51, 0x3b8: 0x52, 0x3b9: 0x53, 0x3ba: 0x54, 0x3bb: 0x55, 0x3bc: 0x56, 0x3bd: 0x57, 0x3be: 0x58, 0x3bf: 0x59, // Block 0xf, offset 0x3c0 0x3c0: 0x104, 0x3c1: 0x105, 0x3c2: 0x9f, 0x3c3: 0x106, 0x3c4: 0x107, 0x3c5: 0x9b, 0x3c6: 0x108, 0x3c7: 0x109, 0x3c8: 0xba, 0x3c9: 0xba, 0x3ca: 0x10a, 0x3cb: 0x10b, 0x3cc: 0x10c, 0x3cd: 0x10d, 0x3ce: 0x10e, 0x3cf: 0x10f, 0x3d0: 0x110, 0x3d1: 0x9f, 0x3d2: 0x111, 0x3d3: 0x112, 0x3d4: 0x113, 0x3d5: 0x114, 0x3d6: 0xba, 0x3d7: 0xba, 0x3d8: 0x9f, 0x3d9: 0x9f, 0x3da: 0x9f, 0x3db: 0x9f, 0x3dc: 0x115, 0x3dd: 0x116, 0x3de: 0xba, 0x3df: 0xba, 0x3e0: 0x117, 0x3e1: 0x118, 0x3e2: 0x119, 0x3e3: 0x11a, 0x3e4: 0x11b, 0x3e5: 0xba, 0x3e6: 0x11c, 0x3e7: 0x11d, 0x3e8: 0x11e, 0x3e9: 0x11f, 0x3ea: 0x120, 0x3eb: 0x5a, 0x3ec: 0x121, 0x3ed: 0x122, 0x3ee: 0x5b, 0x3ef: 0xba, 0x3f0: 0x123, 0x3f1: 0x124, 0x3f2: 0x125, 0x3f3: 0x126, 0x3f4: 0xba, 0x3f5: 0xba, 0x3f6: 0xba, 0x3f7: 0xba, 0x3f8: 0xba, 0x3f9: 0x127, 0x3fa: 0xba, 0x3fb: 0xba, 0x3fc: 0xba, 0x3fd: 0xba, 0x3fe: 0xba, 0x3ff: 0xba, // Block 0x10, offset 0x400 0x400: 0x128, 0x401: 0x129, 0x402: 0x12a, 0x403: 0x12b, 0x404: 0x12c, 0x405: 0x12d, 0x406: 0x12e, 0x407: 0x12f, 0x408: 0x130, 0x409: 0xba, 0x40a: 0x131, 0x40b: 0x132, 0x40c: 0x5c, 0x40d: 0x5d, 0x40e: 0xba, 0x40f: 0xba, 0x410: 0x133, 0x411: 0x134, 0x412: 0x135, 0x413: 0x136, 0x414: 0xba, 0x415: 0xba, 0x416: 0x137, 0x417: 0x138, 0x418: 0x139, 0x419: 0x13a, 0x41a: 0x13b, 0x41b: 0x13c, 0x41c: 0x13d, 0x41d: 0xba, 0x41e: 0xba, 0x41f: 0xba, 0x420: 0xba, 0x421: 0xba, 0x422: 0x13e, 0x423: 0x13f, 0x424: 0xba, 0x425: 0xba, 0x426: 0xba, 0x427: 0xba, 0x428: 0xba, 0x429: 0xba, 0x42a: 0xba, 0x42b: 0x140, 0x42c: 0xba, 0x42d: 0xba, 0x42e: 0xba, 0x42f: 0xba, 0x430: 0x141, 0x431: 0x142, 0x432: 0x143, 0x433: 0xba, 0x434: 0xba, 0x435: 0xba, 0x436: 0xba, 0x437: 0xba, 0x438: 0xba, 0x439: 0xba, 0x43a: 0xba, 0x43b: 0xba, 0x43c: 0xba, 0x43d: 0xba, 0x43e: 0xba, 0x43f: 0xba, // Block 0x11, offset 0x440 0x440: 0x9f, 0x441: 0x9f, 0x442: 0x9f, 0x443: 0x9f, 0x444: 0x9f, 0x445: 0x9f, 0x446: 0x9f, 0x447: 0x9f, 0x448: 0x9f, 0x449: 0x9f, 0x44a: 0x9f, 0x44b: 0x9f, 0x44c: 0x9f, 0x44d: 0x9f, 0x44e: 0x144, 0x44f: 0xba, 0x450: 0x9b, 0x451: 0x145, 0x452: 0x9f, 0x453: 0x9f, 0x454: 0x9f, 0x455: 0x146, 0x456: 0xba, 0x457: 0xba, 0x458: 0xba, 0x459: 0xba, 0x45a: 0xba, 0x45b: 0xba, 0x45c: 0xba, 0x45d: 0xba, 0x45e: 0xba, 0x45f: 0xba, 0x460: 0xba, 0x461: 0xba, 0x462: 0xba, 0x463: 0xba, 0x464: 0xba, 0x465: 0xba, 0x466: 0xba, 0x467: 0xba, 0x468: 0xba, 0x469: 0xba, 0x46a: 0xba, 0x46b: 0xba, 0x46c: 0xba, 0x46d: 0xba, 0x46e: 0xba, 0x46f: 0xba, 0x470: 0xba, 0x471: 0xba, 0x472: 0xba, 0x473: 0xba, 0x474: 0xba, 0x475: 0xba, 0x476: 0xba, 0x477: 0xba, 0x478: 0xba, 0x479: 0xba, 0x47a: 0xba, 0x47b: 0xba, 0x47c: 0xba, 0x47d: 0xba, 0x47e: 0xba, 0x47f: 0xba, // Block 0x12, offset 0x480 0x480: 0x9f, 0x481: 0x9f, 0x482: 0x9f, 0x483: 0x9f, 0x484: 0x9f, 0x485: 0x9f, 0x486: 0x9f, 0x487: 0x9f, 0x488: 0x9f, 0x489: 0x9f, 0x48a: 0x9f, 0x48b: 0x9f, 0x48c: 0x9f, 0x48d: 0x9f, 0x48e: 0x9f, 0x48f: 0x9f, 0x490: 0x147, 0x491: 0xba, 0x492: 0xba, 0x493: 0xba, 0x494: 0xba, 0x495: 0xba, 0x496: 0xba, 0x497: 0xba, 0x498: 0xba, 0x499: 0xba, 0x49a: 0xba, 0x49b: 0xba, 0x49c: 0xba, 0x49d: 0xba, 0x49e: 0xba, 0x49f: 0xba, 0x4a0: 0xba, 0x4a1: 0xba, 0x4a2: 0xba, 0x4a3: 0xba, 0x4a4: 0xba, 0x4a5: 0xba, 0x4a6: 0xba, 0x4a7: 0xba, 0x4a8: 0xba, 0x4a9: 0xba, 0x4aa: 0xba, 0x4ab: 0xba, 0x4ac: 0xba, 0x4ad: 0xba, 0x4ae: 0xba, 0x4af: 0xba, 0x4b0: 0xba, 0x4b1: 0xba, 0x4b2: 0xba, 0x4b3: 0xba, 0x4b4: 0xba, 0x4b5: 0xba, 0x4b6: 0xba, 0x4b7: 0xba, 0x4b8: 0xba, 0x4b9: 0xba, 0x4ba: 0xba, 0x4bb: 0xba, 0x4bc: 0xba, 0x4bd: 0xba, 0x4be: 0xba, 0x4bf: 0xba, // Block 0x13, offset 0x4c0 0x4c0: 0xba, 0x4c1: 0xba, 0x4c2: 0xba, 0x4c3: 0xba, 0x4c4: 0xba, 0x4c5: 0xba, 0x4c6: 0xba, 0x4c7: 0xba, 0x4c8: 0xba, 0x4c9: 0xba, 0x4ca: 0xba, 0x4cb: 0xba, 0x4cc: 0xba, 0x4cd: 0xba, 0x4ce: 0xba, 0x4cf: 0xba, 0x4d0: 0x9f, 0x4d1: 0x9f, 0x4d2: 0x9f, 0x4d3: 0x9f, 0x4d4: 0x9f, 0x4d5: 0x9f, 0x4d6: 0x9f, 0x4d7: 0x9f, 0x4d8: 0x9f, 0x4d9: 0x148, 0x4da: 0xba, 0x4db: 0xba, 0x4dc: 0xba, 0x4dd: 0xba, 0x4de: 0xba, 0x4df: 0xba, 0x4e0: 0xba, 0x4e1: 0xba, 0x4e2: 0xba, 0x4e3: 0xba, 0x4e4: 0xba, 0x4e5: 0xba, 0x4e6: 0xba, 0x4e7: 0xba, 0x4e8: 0xba, 0x4e9: 0xba, 0x4ea: 0xba, 0x4eb: 0xba, 0x4ec: 0xba, 0x4ed: 0xba, 0x4ee: 0xba, 0x4ef: 0xba, 0x4f0: 0xba, 0x4f1: 0xba, 0x4f2: 0xba, 0x4f3: 0xba, 0x4f4: 0xba, 0x4f5: 0xba, 0x4f6: 0xba, 0x4f7: 0xba, 0x4f8: 0xba, 0x4f9: 0xba, 0x4fa: 0xba, 0x4fb: 0xba, 0x4fc: 0xba, 0x4fd: 0xba, 0x4fe: 0xba, 0x4ff: 0xba, // Block 0x14, offset 0x500 0x500: 0xba, 0x501: 0xba, 0x502: 0xba, 0x503: 0xba, 0x504: 0xba, 0x505: 0xba, 0x506: 0xba, 0x507: 0xba, 0x508: 0xba, 0x509: 0xba, 0x50a: 0xba, 0x50b: 0xba, 0x50c: 0xba, 0x50d: 0xba, 0x50e: 0xba, 0x50f: 0xba, 0x510: 0xba, 0x511: 0xba, 0x512: 0xba, 0x513: 0xba, 0x514: 0xba, 0x515: 0xba, 0x516: 0xba, 0x517: 0xba, 0x518: 0xba, 0x519: 0xba, 0x51a: 0xba, 0x51b: 0xba, 0x51c: 0xba, 0x51d: 0xba, 0x51e: 0xba, 0x51f: 0xba, 0x520: 0x9f, 0x521: 0x9f, 0x522: 0x9f, 0x523: 0x9f, 0x524: 0x9f, 0x525: 0x9f, 0x526: 0x9f, 0x527: 0x9f, 0x528: 0x140, 0x529: 0x149, 0x52a: 0xba, 0x52b: 0x14a, 0x52c: 0x14b, 0x52d: 0x14c, 0x52e: 0x14d, 0x52f: 0xba, 0x530: 0xba, 0x531: 0xba, 0x532: 0xba, 0x533: 0xba, 0x534: 0xba, 0x535: 0xba, 0x536: 0xba, 0x537: 0xba, 0x538: 0xba, 0x539: 0xba, 0x53a: 0xba, 0x53b: 0xba, 0x53c: 0x9f, 0x53d: 0x14e, 0x53e: 0x14f, 0x53f: 0x150, // Block 0x15, offset 0x540 0x540: 0x9f, 0x541: 0x9f, 0x542: 0x9f, 0x543: 0x9f, 0x544: 0x9f, 0x545: 0x9f, 0x546: 0x9f, 0x547: 0x9f, 0x548: 0x9f, 0x549: 0x9f, 0x54a: 0x9f, 0x54b: 0x9f, 0x54c: 0x9f, 0x54d: 0x9f, 0x54e: 0x9f, 0x54f: 0x9f, 0x550: 0x9f, 0x551: 0x9f, 0x552: 0x9f, 0x553: 0x9f, 0x554: 0x9f, 0x555: 0x9f, 0x556: 0x9f, 0x557: 0x9f, 0x558: 0x9f, 0x559: 0x9f, 0x55a: 0x9f, 0x55b: 0x9f, 0x55c: 0x9f, 0x55d: 0x9f, 0x55e: 0x9f, 0x55f: 0x151, 0x560: 0x9f, 0x561: 0x9f, 0x562: 0x9f, 0x563: 0x9f, 0x564: 0x9f, 0x565: 0x9f, 0x566: 0x9f, 0x567: 0x9f, 0x568: 0x9f, 0x569: 0x9f, 0x56a: 0x9f, 0x56b: 0x152, 0x56c: 0xba, 0x56d: 0xba, 0x56e: 0xba, 0x56f: 0xba, 0x570: 0xba, 0x571: 0xba, 0x572: 0xba, 0x573: 0xba, 0x574: 0xba, 0x575: 0xba, 0x576: 0xba, 0x577: 0xba, 0x578: 0xba, 0x579: 0xba, 0x57a: 0xba, 0x57b: 0xba, 0x57c: 0xba, 0x57d: 0xba, 0x57e: 0xba, 0x57f: 0xba, // Block 0x16, offset 0x580 0x580: 0x153, 0x581: 0xba, 0x582: 0xba, 0x583: 0xba, 0x584: 0xba, 0x585: 0xba, 0x586: 0xba, 0x587: 0xba, 0x588: 0xba, 0x589: 0xba, 0x58a: 0xba, 0x58b: 0xba, 0x58c: 0xba, 0x58d: 0xba, 0x58e: 0xba, 0x58f: 0xba, 0x590: 0xba, 0x591: 0xba, 0x592: 0xba, 0x593: 0xba, 0x594: 0xba, 0x595: 0xba, 0x596: 0xba, 0x597: 0xba, 0x598: 0xba, 0x599: 0xba, 0x59a: 0xba, 0x59b: 0xba, 0x59c: 0xba, 0x59d: 0xba, 0x59e: 0xba, 0x59f: 0xba, 0x5a0: 0xba, 0x5a1: 0xba, 0x5a2: 0xba, 0x5a3: 0xba, 0x5a4: 0xba, 0x5a5: 0xba, 0x5a6: 0xba, 0x5a7: 0xba, 0x5a8: 0xba, 0x5a9: 0xba, 0x5aa: 0xba, 0x5ab: 0xba, 0x5ac: 0xba, 0x5ad: 0xba, 0x5ae: 0xba, 0x5af: 0xba, 0x5b0: 0x9f, 0x5b1: 0x154, 0x5b2: 0x155, 0x5b3: 0xba, 0x5b4: 0xba, 0x5b5: 0xba, 0x5b6: 0xba, 0x5b7: 0xba, 0x5b8: 0xba, 0x5b9: 0xba, 0x5ba: 0xba, 0x5bb: 0xba, 0x5bc: 0xba, 0x5bd: 0xba, 0x5be: 0xba, 0x5bf: 0xba, // Block 0x17, offset 0x5c0 0x5c0: 0x9b, 0x5c1: 0x9b, 0x5c2: 0x9b, 0x5c3: 0x156, 0x5c4: 0x157, 0x5c5: 0x158, 0x5c6: 0x159, 0x5c7: 0x15a, 0x5c8: 0x9b, 0x5c9: 0x15b, 0x5ca: 0xba, 0x5cb: 0xba, 0x5cc: 0x9b, 0x5cd: 0x15c, 0x5ce: 0xba, 0x5cf: 0xba, 0x5d0: 0x5e, 0x5d1: 0x5f, 0x5d2: 0x60, 0x5d3: 0x61, 0x5d4: 0x62, 0x5d5: 0x63, 0x5d6: 0x64, 0x5d7: 0x65, 0x5d8: 0x66, 0x5d9: 0x67, 0x5da: 0x68, 0x5db: 0x69, 0x5dc: 0x6a, 0x5dd: 0x6b, 0x5de: 0x6c, 0x5df: 0x6d, 0x5e0: 0x9b, 0x5e1: 0x9b, 0x5e2: 0x9b, 0x5e3: 0x9b, 0x5e4: 0x9b, 0x5e5: 0x9b, 0x5e6: 0x9b, 0x5e7: 0x9b, 0x5e8: 0x15d, 0x5e9: 0x15e, 0x5ea: 0x15f, 0x5eb: 0xba, 0x5ec: 0xba, 0x5ed: 0xba, 0x5ee: 0xba, 0x5ef: 0xba, 0x5f0: 0xba, 0x5f1: 0xba, 0x5f2: 0xba, 0x5f3: 0xba, 0x5f4: 0xba, 0x5f5: 0xba, 0x5f6: 0xba, 0x5f7: 0xba, 0x5f8: 0xba, 0x5f9: 0xba, 0x5fa: 0xba, 0x5fb: 0xba, 0x5fc: 0xba, 0x5fd: 0xba, 0x5fe: 0xba, 0x5ff: 0xba, // Block 0x18, offset 0x600 0x600: 0x160, 0x601: 0xba, 0x602: 0xba, 0x603: 0xba, 0x604: 0xba, 0x605: 0xba, 0x606: 0xba, 0x607: 0xba, 0x608: 0xba, 0x609: 0xba, 0x60a: 0xba, 0x60b: 0xba, 0x60c: 0xba, 0x60d: 0xba, 0x60e: 0xba, 0x60f: 0xba, 0x610: 0xba, 0x611: 0xba, 0x612: 0xba, 0x613: 0xba, 0x614: 0xba, 0x615: 0xba, 0x616: 0xba, 0x617: 0xba, 0x618: 0xba, 0x619: 0xba, 0x61a: 0xba, 0x61b: 0xba, 0x61c: 0xba, 0x61d: 0xba, 0x61e: 0xba, 0x61f: 0xba, 0x620: 0x123, 0x621: 0x123, 0x622: 0x123, 0x623: 0x161, 0x624: 0x6e, 0x625: 0x162, 0x626: 0xba, 0x627: 0xba, 0x628: 0xba, 0x629: 0xba, 0x62a: 0xba, 0x62b: 0xba, 0x62c: 0xba, 0x62d: 0xba, 0x62e: 0xba, 0x62f: 0xba, 0x630: 0xba, 0x631: 0xba, 0x632: 0xba, 0x633: 0xba, 0x634: 0xba, 0x635: 0xba, 0x636: 0xba, 0x637: 0xba, 0x638: 0x6f, 0x639: 0x70, 0x63a: 0x71, 0x63b: 0x163, 0x63c: 0xba, 0x63d: 0xba, 0x63e: 0xba, 0x63f: 0xba, // Block 0x19, offset 0x640 0x640: 0x164, 0x641: 0x9b, 0x642: 0x165, 0x643: 0x166, 0x644: 0x72, 0x645: 0x73, 0x646: 0x167, 0x647: 0x168, 0x648: 0x74, 0x649: 0x169, 0x64a: 0xba, 0x64b: 0xba, 0x64c: 0x9b, 0x64d: 0x9b, 0x64e: 0x9b, 0x64f: 0x9b, 0x650: 0x9b, 0x651: 0x9b, 0x652: 0x9b, 0x653: 0x9b, 0x654: 0x9b, 0x655: 0x9b, 0x656: 0x9b, 0x657: 0x9b, 0x658: 0x9b, 0x659: 0x9b, 0x65a: 0x9b, 0x65b: 0x16a, 0x65c: 0x9b, 0x65d: 0x16b, 0x65e: 0x9b, 0x65f: 0x16c, 0x660: 0x16d, 0x661: 0x16e, 0x662: 0x16f, 0x663: 0xba, 0x664: 0x170, 0x665: 0x171, 0x666: 0x172, 0x667: 0x173, 0x668: 0xba, 0x669: 0xba, 0x66a: 0xba, 0x66b: 0xba, 0x66c: 0xba, 0x66d: 0xba, 0x66e: 0xba, 0x66f: 0xba, 0x670: 0xba, 0x671: 0xba, 0x672: 0xba, 0x673: 0xba, 0x674: 0xba, 0x675: 0xba, 0x676: 0xba, 0x677: 0xba, 0x678: 0xba, 0x679: 0xba, 0x67a: 0xba, 0x67b: 0xba, 0x67c: 0xba, 0x67d: 0xba, 0x67e: 0xba, 0x67f: 0xba, // Block 0x1a, offset 0x680 0x680: 0x9f, 0x681: 0x9f, 0x682: 0x9f, 0x683: 0x9f, 0x684: 0x9f, 0x685: 0x9f, 0x686: 0x9f, 0x687: 0x9f, 0x688: 0x9f, 0x689: 0x9f, 0x68a: 0x9f, 0x68b: 0x9f, 0x68c: 0x9f, 0x68d: 0x9f, 0x68e: 0x9f, 0x68f: 0x9f, 0x690: 0x9f, 0x691: 0x9f, 0x692: 0x9f, 0x693: 0x9f, 0x694: 0x9f, 0x695: 0x9f, 0x696: 0x9f, 0x697: 0x9f, 0x698: 0x9f, 0x699: 0x9f, 0x69a: 0x9f, 0x69b: 0x174, 0x69c: 0x9f, 0x69d: 0x9f, 0x69e: 0x9f, 0x69f: 0x9f, 0x6a0: 0x9f, 0x6a1: 0x9f, 0x6a2: 0x9f, 0x6a3: 0x9f, 0x6a4: 0x9f, 0x6a5: 0x9f, 0x6a6: 0x9f, 0x6a7: 0x9f, 0x6a8: 0x9f, 0x6a9: 0x9f, 0x6aa: 0x9f, 0x6ab: 0x9f, 0x6ac: 0x9f, 0x6ad: 0x9f, 0x6ae: 0x9f, 0x6af: 0x9f, 0x6b0: 0x9f, 0x6b1: 0x9f, 0x6b2: 0x9f, 0x6b3: 0x9f, 0x6b4: 0x9f, 0x6b5: 0x9f, 0x6b6: 0x9f, 0x6b7: 0x9f, 0x6b8: 0x9f, 0x6b9: 0x9f, 0x6ba: 0x9f, 0x6bb: 0x9f, 0x6bc: 0x9f, 0x6bd: 0x9f, 0x6be: 0x9f, 0x6bf: 0x9f, // Block 0x1b, offset 0x6c0 0x6c0: 0x9f, 0x6c1: 0x9f, 0x6c2: 0x9f, 0x6c3: 0x9f, 0x6c4: 0x9f, 0x6c5: 0x9f, 0x6c6: 0x9f, 0x6c7: 0x9f, 0x6c8: 0x9f, 0x6c9: 0x9f, 0x6ca: 0x9f, 0x6cb: 0x9f, 0x6cc: 0x9f, 0x6cd: 0x9f, 0x6ce: 0x9f, 0x6cf: 0x9f, 0x6d0: 0x9f, 0x6d1: 0x9f, 0x6d2: 0x9f, 0x6d3: 0x9f, 0x6d4: 0x9f, 0x6d5: 0x9f, 0x6d6: 0x9f, 0x6d7: 0x9f, 0x6d8: 0x9f, 0x6d9: 0x9f, 0x6da: 0x9f, 0x6db: 0x9f, 0x6dc: 0x175, 0x6dd: 0x9f, 0x6de: 0x9f, 0x6df: 0x9f, 0x6e0: 0x176, 0x6e1: 0x9f, 0x6e2: 0x9f, 0x6e3: 0x9f, 0x6e4: 0x9f, 0x6e5: 0x9f, 0x6e6: 0x9f, 0x6e7: 0x9f, 0x6e8: 0x9f, 0x6e9: 0x9f, 0x6ea: 0x9f, 0x6eb: 0x9f, 0x6ec: 0x9f, 0x6ed: 0x9f, 0x6ee: 0x9f, 0x6ef: 0x9f, 0x6f0: 0x9f, 0x6f1: 0x9f, 0x6f2: 0x9f, 0x6f3: 0x9f, 0x6f4: 0x9f, 0x6f5: 0x9f, 0x6f6: 0x9f, 0x6f7: 0x9f, 0x6f8: 0x9f, 0x6f9: 0x9f, 0x6fa: 0x9f, 0x6fb: 0x9f, 0x6fc: 0x9f, 0x6fd: 0x9f, 0x6fe: 0x9f, 0x6ff: 0x9f, // Block 0x1c, offset 0x700 0x700: 0x9f, 0x701: 0x9f, 0x702: 0x9f, 0x703: 0x9f, 0x704: 0x9f, 0x705: 0x9f, 0x706: 0x9f, 0x707: 0x9f, 0x708: 0x9f, 0x709: 0x9f, 0x70a: 0x9f, 0x70b: 0x9f, 0x70c: 0x9f, 0x70d: 0x9f, 0x70e: 0x9f, 0x70f: 0x9f, 0x710: 0x9f, 0x711: 0x9f, 0x712: 0x9f, 0x713: 0x9f, 0x714: 0x9f, 0x715: 0x9f, 0x716: 0x9f, 0x717: 0x9f, 0x718: 0x9f, 0x719: 0x9f, 0x71a: 0x9f, 0x71b: 0x9f, 0x71c: 0x9f, 0x71d: 0x9f, 0x71e: 0x9f, 0x71f: 0x9f, 0x720: 0x9f, 0x721: 0x9f, 0x722: 0x9f, 0x723: 0x9f, 0x724: 0x9f, 0x725: 0x9f, 0x726: 0x9f, 0x727: 0x9f, 0x728: 0x9f, 0x729: 0x9f, 0x72a: 0x9f, 0x72b: 0x9f, 0x72c: 0x9f, 0x72d: 0x9f, 0x72e: 0x9f, 0x72f: 0x9f, 0x730: 0x9f, 0x731: 0x9f, 0x732: 0x9f, 0x733: 0x9f, 0x734: 0x9f, 0x735: 0x9f, 0x736: 0x9f, 0x737: 0x9f, 0x738: 0x9f, 0x739: 0x9f, 0x73a: 0x177, 0x73b: 0xba, 0x73c: 0xba, 0x73d: 0xba, 0x73e: 0xba, 0x73f: 0xba, // Block 0x1d, offset 0x740 0x740: 0xba, 0x741: 0xba, 0x742: 0xba, 0x743: 0xba, 0x744: 0xba, 0x745: 0xba, 0x746: 0xba, 0x747: 0xba, 0x748: 0xba, 0x749: 0xba, 0x74a: 0xba, 0x74b: 0xba, 0x74c: 0xba, 0x74d: 0xba, 0x74e: 0xba, 0x74f: 0xba, 0x750: 0xba, 0x751: 0xba, 0x752: 0xba, 0x753: 0xba, 0x754: 0xba, 0x755: 0xba, 0x756: 0xba, 0x757: 0xba, 0x758: 0xba, 0x759: 0xba, 0x75a: 0xba, 0x75b: 0xba, 0x75c: 0xba, 0x75d: 0xba, 0x75e: 0xba, 0x75f: 0xba, 0x760: 0x75, 0x761: 0x76, 0x762: 0x77, 0x763: 0x178, 0x764: 0x78, 0x765: 0x79, 0x766: 0x179, 0x767: 0x7a, 0x768: 0x7b, 0x769: 0xba, 0x76a: 0xba, 0x76b: 0xba, 0x76c: 0xba, 0x76d: 0xba, 0x76e: 0xba, 0x76f: 0xba, 0x770: 0xba, 0x771: 0xba, 0x772: 0xba, 0x773: 0xba, 0x774: 0xba, 0x775: 0xba, 0x776: 0xba, 0x777: 0xba, 0x778: 0xba, 0x779: 0xba, 0x77a: 0xba, 0x77b: 0xba, 0x77c: 0xba, 0x77d: 0xba, 0x77e: 0xba, 0x77f: 0xba, // Block 0x1e, offset 0x780 0x790: 0x0d, 0x791: 0x0e, 0x792: 0x0f, 0x793: 0x10, 0x794: 0x11, 0x795: 0x0b, 0x796: 0x12, 0x797: 0x07, 0x798: 0x13, 0x799: 0x0b, 0x79a: 0x0b, 0x79b: 0x14, 0x79c: 0x0b, 0x79d: 0x15, 0x79e: 0x16, 0x79f: 0x17, 0x7a0: 0x07, 0x7a1: 0x07, 0x7a2: 0x07, 0x7a3: 0x07, 0x7a4: 0x07, 0x7a5: 0x07, 0x7a6: 0x07, 0x7a7: 0x07, 0x7a8: 0x07, 0x7a9: 0x07, 0x7aa: 0x18, 0x7ab: 0x19, 0x7ac: 0x1a, 0x7ad: 0x0b, 0x7ae: 0x0b, 0x7af: 0x1b, 0x7b0: 0x0b, 0x7b1: 0x0b, 0x7b2: 0x0b, 0x7b3: 0x0b, 0x7b4: 0x0b, 0x7b5: 0x0b, 0x7b6: 0x0b, 0x7b7: 0x0b, 0x7b8: 0x0b, 0x7b9: 0x0b, 0x7ba: 0x0b, 0x7bb: 0x0b, 0x7bc: 0x0b, 0x7bd: 0x0b, 0x7be: 0x0b, 0x7bf: 0x0b, // Block 0x1f, offset 0x7c0 0x7c0: 0x0b, 0x7c1: 0x0b, 0x7c2: 0x0b, 0x7c3: 0x0b, 0x7c4: 0x0b, 0x7c5: 0x0b, 0x7c6: 0x0b, 0x7c7: 0x0b, 0x7c8: 0x0b, 0x7c9: 0x0b, 0x7ca: 0x0b, 0x7cb: 0x0b, 0x7cc: 0x0b, 0x7cd: 0x0b, 0x7ce: 0x0b, 0x7cf: 0x0b, 0x7d0: 0x0b, 0x7d1: 0x0b, 0x7d2: 0x0b, 0x7d3: 0x0b, 0x7d4: 0x0b, 0x7d5: 0x0b, 0x7d6: 0x0b, 0x7d7: 0x0b, 0x7d8: 0x0b, 0x7d9: 0x0b, 0x7da: 0x0b, 0x7db: 0x0b, 0x7dc: 0x0b, 0x7dd: 0x0b, 0x7de: 0x0b, 0x7df: 0x0b, 0x7e0: 0x0b, 0x7e1: 0x0b, 0x7e2: 0x0b, 0x7e3: 0x0b, 0x7e4: 0x0b, 0x7e5: 0x0b, 0x7e6: 0x0b, 0x7e7: 0x0b, 0x7e8: 0x0b, 0x7e9: 0x0b, 0x7ea: 0x0b, 0x7eb: 0x0b, 0x7ec: 0x0b, 0x7ed: 0x0b, 0x7ee: 0x0b, 0x7ef: 0x0b, 0x7f0: 0x0b, 0x7f1: 0x0b, 0x7f2: 0x0b, 0x7f3: 0x0b, 0x7f4: 0x0b, 0x7f5: 0x0b, 0x7f6: 0x0b, 0x7f7: 0x0b, 0x7f8: 0x0b, 0x7f9: 0x0b, 0x7fa: 0x0b, 0x7fb: 0x0b, 0x7fc: 0x0b, 0x7fd: 0x0b, 0x7fe: 0x0b, 0x7ff: 0x0b, // Block 0x20, offset 0x800 0x800: 0x17a, 0x801: 0x17b, 0x802: 0xba, 0x803: 0xba, 0x804: 0x17c, 0x805: 0x17c, 0x806: 0x17c, 0x807: 0x17d, 0x808: 0xba, 0x809: 0xba, 0x80a: 0xba, 0x80b: 0xba, 0x80c: 0xba, 0x80d: 0xba, 0x80e: 0xba, 0x80f: 0xba, 0x810: 0xba, 0x811: 0xba, 0x812: 0xba, 0x813: 0xba, 0x814: 0xba, 0x815: 0xba, 0x816: 0xba, 0x817: 0xba, 0x818: 0xba, 0x819: 0xba, 0x81a: 0xba, 0x81b: 0xba, 0x81c: 0xba, 0x81d: 0xba, 0x81e: 0xba, 0x81f: 0xba, 0x820: 0xba, 0x821: 0xba, 0x822: 0xba, 0x823: 0xba, 0x824: 0xba, 0x825: 0xba, 0x826: 0xba, 0x827: 0xba, 0x828: 0xba, 0x829: 0xba, 0x82a: 0xba, 0x82b: 0xba, 0x82c: 0xba, 0x82d: 0xba, 0x82e: 0xba, 0x82f: 0xba, 0x830: 0xba, 0x831: 0xba, 0x832: 0xba, 0x833: 0xba, 0x834: 0xba, 0x835: 0xba, 0x836: 0xba, 0x837: 0xba, 0x838: 0xba, 0x839: 0xba, 0x83a: 0xba, 0x83b: 0xba, 0x83c: 0xba, 0x83d: 0xba, 0x83e: 0xba, 0x83f: 0xba, // Block 0x21, offset 0x840 0x840: 0x0b, 0x841: 0x0b, 0x842: 0x0b, 0x843: 0x0b, 0x844: 0x0b, 0x845: 0x0b, 0x846: 0x0b, 0x847: 0x0b, 0x848: 0x0b, 0x849: 0x0b, 0x84a: 0x0b, 0x84b: 0x0b, 0x84c: 0x0b, 0x84d: 0x0b, 0x84e: 0x0b, 0x84f: 0x0b, 0x850: 0x0b, 0x851: 0x0b, 0x852: 0x0b, 0x853: 0x0b, 0x854: 0x0b, 0x855: 0x0b, 0x856: 0x0b, 0x857: 0x0b, 0x858: 0x0b, 0x859: 0x0b, 0x85a: 0x0b, 0x85b: 0x0b, 0x85c: 0x0b, 0x85d: 0x0b, 0x85e: 0x0b, 0x85f: 0x0b, 0x860: 0x1e, 0x861: 0x0b, 0x862: 0x0b, 0x863: 0x0b, 0x864: 0x0b, 0x865: 0x0b, 0x866: 0x0b, 0x867: 0x0b, 0x868: 0x0b, 0x869: 0x0b, 0x86a: 0x0b, 0x86b: 0x0b, 0x86c: 0x0b, 0x86d: 0x0b, 0x86e: 0x0b, 0x86f: 0x0b, 0x870: 0x0b, 0x871: 0x0b, 0x872: 0x0b, 0x873: 0x0b, 0x874: 0x0b, 0x875: 0x0b, 0x876: 0x0b, 0x877: 0x0b, 0x878: 0x0b, 0x879: 0x0b, 0x87a: 0x0b, 0x87b: 0x0b, 0x87c: 0x0b, 0x87d: 0x0b, 0x87e: 0x0b, 0x87f: 0x0b, // Block 0x22, offset 0x880 0x880: 0x0b, 0x881: 0x0b, 0x882: 0x0b, 0x883: 0x0b, 0x884: 0x0b, 0x885: 0x0b, 0x886: 0x0b, 0x887: 0x0b, 0x888: 0x0b, 0x889: 0x0b, 0x88a: 0x0b, 0x88b: 0x0b, 0x88c: 0x0b, 0x88d: 0x0b, 0x88e: 0x0b, 0x88f: 0x0b, } // idnaSparseOffset: 258 entries, 516 bytes var idnaSparseOffset = []uint16{0x0, 0x8, 0x19, 0x25, 0x27, 0x2c, 0x34, 0x3f, 0x4b, 0x4f, 0x5e, 0x63, 0x6b, 0x77, 0x85, 0x93, 0x98, 0xa1, 0xb1, 0xbf, 0xcc, 0xd8, 0xe9, 0xf3, 0xfa, 0x107, 0x118, 0x11f, 0x12a, 0x139, 0x147, 0x151, 0x153, 0x158, 0x15b, 0x15e, 0x160, 0x16c, 0x177, 0x17f, 0x185, 0x18b, 0x190, 0x195, 0x198, 0x19c, 0x1a2, 0x1a7, 0x1b3, 0x1bd, 0x1c3, 0x1d4, 0x1de, 0x1e1, 0x1e9, 0x1ec, 0x1f9, 0x201, 0x205, 0x20c, 0x214, 0x224, 0x230, 0x232, 0x23c, 0x248, 0x254, 0x260, 0x268, 0x26d, 0x277, 0x288, 0x28c, 0x297, 0x29b, 0x2a4, 0x2ac, 0x2b2, 0x2b7, 0x2ba, 0x2bd, 0x2c1, 0x2c7, 0x2cb, 0x2cf, 0x2d5, 0x2dc, 0x2e2, 0x2ea, 0x2f1, 0x2fc, 0x306, 0x30a, 0x30d, 0x313, 0x317, 0x319, 0x31c, 0x31e, 0x321, 0x32b, 0x32e, 0x33d, 0x341, 0x346, 0x349, 0x34d, 0x352, 0x357, 0x35d, 0x363, 0x372, 0x378, 0x37c, 0x38b, 0x390, 0x398, 0x3a2, 0x3ad, 0x3b5, 0x3c6, 0x3cf, 0x3df, 0x3ec, 0x3f6, 0x3fb, 0x408, 0x40c, 0x411, 0x413, 0x417, 0x419, 0x41d, 0x426, 0x42c, 0x430, 0x440, 0x44a, 0x44f, 0x452, 0x458, 0x45f, 0x464, 0x468, 0x46e, 0x473, 0x47c, 0x481, 0x487, 0x48e, 0x495, 0x49c, 0x4a0, 0x4a5, 0x4a8, 0x4ad, 0x4b9, 0x4bf, 0x4c4, 0x4cb, 0x4d3, 0x4d8, 0x4dc, 0x4ec, 0x4f3, 0x4f7, 0x4fb, 0x502, 0x504, 0x507, 0x50a, 0x50e, 0x512, 0x518, 0x521, 0x52d, 0x534, 0x53d, 0x545, 0x54c, 0x55a, 0x567, 0x574, 0x57d, 0x581, 0x58f, 0x597, 0x5a2, 0x5ab, 0x5b1, 0x5b9, 0x5c2, 0x5cc, 0x5cf, 0x5db, 0x5de, 0x5e3, 0x5e6, 0x5f0, 0x5f9, 0x605, 0x608, 0x60d, 0x610, 0x613, 0x616, 0x61d, 0x624, 0x628, 0x633, 0x636, 0x63c, 0x641, 0x645, 0x648, 0x64b, 0x64e, 0x653, 0x65d, 0x660, 0x664, 0x673, 0x67f, 0x683, 0x688, 0x68d, 0x691, 0x696, 0x69f, 0x6aa, 0x6b0, 0x6b8, 0x6bc, 0x6c0, 0x6c6, 0x6cc, 0x6d1, 0x6d4, 0x6e2, 0x6e9, 0x6ec, 0x6ef, 0x6f3, 0x6f9, 0x6fe, 0x708, 0x70d, 0x710, 0x713, 0x716, 0x719, 0x71d, 0x720, 0x730, 0x741, 0x746, 0x748, 0x74a} // idnaSparseValues: 1869 entries, 7476 bytes var idnaSparseValues = [1869]valueRange{ // Block 0x0, offset 0x0 {value: 0x0000, lo: 0x07}, {value: 0xe105, lo: 0x80, hi: 0x96}, {value: 0x0018, lo: 0x97, hi: 0x97}, {value: 0xe105, lo: 0x98, hi: 0x9e}, {value: 0x001f, lo: 0x9f, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xb7}, {value: 0x0008, lo: 0xb8, hi: 0xbf}, // Block 0x1, offset 0x8 {value: 0x0000, lo: 0x10}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0xe01d, lo: 0x81, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0x82}, {value: 0x0335, lo: 0x83, hi: 0x83}, {value: 0x034d, lo: 0x84, hi: 0x84}, {value: 0x0365, lo: 0x85, hi: 0x85}, {value: 0xe00d, lo: 0x86, hi: 0x86}, {value: 0x0008, lo: 0x87, hi: 0x87}, {value: 0xe00d, lo: 0x88, hi: 0x88}, {value: 0x0008, lo: 0x89, hi: 0x89}, {value: 0xe00d, lo: 0x8a, hi: 0x8a}, {value: 0x0008, lo: 0x8b, hi: 0x8b}, {value: 0xe00d, lo: 0x8c, hi: 0x8c}, {value: 0x0008, lo: 0x8d, hi: 0x8d}, {value: 0xe00d, lo: 0x8e, hi: 0x8e}, {value: 0x0008, lo: 0x8f, hi: 0xbf}, // Block 0x2, offset 0x19 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x0249, lo: 0xb0, hi: 0xb0}, {value: 0x037d, lo: 0xb1, hi: 0xb1}, {value: 0x0259, lo: 0xb2, hi: 0xb2}, {value: 0x0269, lo: 0xb3, hi: 0xb3}, {value: 0x034d, lo: 0xb4, hi: 0xb4}, {value: 0x0395, lo: 0xb5, hi: 0xb5}, {value: 0xe1bd, lo: 0xb6, hi: 0xb6}, {value: 0x0279, lo: 0xb7, hi: 0xb7}, {value: 0x0289, lo: 0xb8, hi: 0xb8}, {value: 0x0008, lo: 0xb9, hi: 0xbf}, // Block 0x3, offset 0x25 {value: 0x0000, lo: 0x01}, {value: 0x3308, lo: 0x80, hi: 0xbf}, // Block 0x4, offset 0x27 {value: 0x0000, lo: 0x04}, {value: 0x03f5, lo: 0x80, hi: 0x8f}, {value: 0xe105, lo: 0x90, hi: 0x9f}, {value: 0x049d, lo: 0xa0, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x5, offset 0x2c {value: 0x0000, lo: 0x07}, {value: 0xe185, lo: 0x80, hi: 0x8f}, {value: 0x0545, lo: 0x90, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x98}, {value: 0x0008, lo: 0x99, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xa0}, {value: 0x0008, lo: 0xa1, hi: 0xbf}, // Block 0x6, offset 0x34 {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0401, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x88}, {value: 0x0018, lo: 0x89, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0x90}, {value: 0x3308, lo: 0x91, hi: 0xbd}, {value: 0x0818, lo: 0xbe, hi: 0xbe}, {value: 0x3308, lo: 0xbf, hi: 0xbf}, // Block 0x7, offset 0x3f {value: 0x0000, lo: 0x0b}, {value: 0x0818, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x82}, {value: 0x0818, lo: 0x83, hi: 0x83}, {value: 0x3308, lo: 0x84, hi: 0x85}, {value: 0x0818, lo: 0x86, hi: 0x86}, {value: 0x3308, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0808, lo: 0x90, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xaf}, {value: 0x0808, lo: 0xb0, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0x8, offset 0x4b {value: 0x0000, lo: 0x03}, {value: 0x0a08, lo: 0x80, hi: 0x87}, {value: 0x0c08, lo: 0x88, hi: 0x99}, {value: 0x0a08, lo: 0x9a, hi: 0xbf}, // Block 0x9, offset 0x4f {value: 0x0000, lo: 0x0e}, {value: 0x3308, lo: 0x80, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8c}, {value: 0x0c08, lo: 0x8d, hi: 0x8d}, {value: 0x0a08, lo: 0x8e, hi: 0x98}, {value: 0x0c08, lo: 0x99, hi: 0x9b}, {value: 0x0a08, lo: 0x9c, hi: 0xaa}, {value: 0x0c08, lo: 0xab, hi: 0xac}, {value: 0x0a08, lo: 0xad, hi: 0xb0}, {value: 0x0c08, lo: 0xb1, hi: 0xb1}, {value: 0x0a08, lo: 0xb2, hi: 0xb2}, {value: 0x0c08, lo: 0xb3, hi: 0xb4}, {value: 0x0a08, lo: 0xb5, hi: 0xb7}, {value: 0x0c08, lo: 0xb8, hi: 0xb9}, {value: 0x0a08, lo: 0xba, hi: 0xbf}, // Block 0xa, offset 0x5e {value: 0x0000, lo: 0x04}, {value: 0x0808, lo: 0x80, hi: 0xa5}, {value: 0x3308, lo: 0xa6, hi: 0xb0}, {value: 0x0808, lo: 0xb1, hi: 0xb1}, {value: 0x0040, lo: 0xb2, hi: 0xbf}, // Block 0xb, offset 0x63 {value: 0x0000, lo: 0x07}, {value: 0x0808, lo: 0x80, hi: 0x89}, {value: 0x0a08, lo: 0x8a, hi: 0xaa}, {value: 0x3308, lo: 0xab, hi: 0xb3}, {value: 0x0808, lo: 0xb4, hi: 0xb5}, {value: 0x0018, lo: 0xb6, hi: 0xb9}, {value: 0x0818, lo: 0xba, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbf}, // Block 0xc, offset 0x6b {value: 0x0000, lo: 0x0b}, {value: 0x0808, lo: 0x80, hi: 0x95}, {value: 0x3308, lo: 0x96, hi: 0x99}, {value: 0x0808, lo: 0x9a, hi: 0x9a}, {value: 0x3308, lo: 0x9b, hi: 0xa3}, {value: 0x0808, lo: 0xa4, hi: 0xa4}, {value: 0x3308, lo: 0xa5, hi: 0xa7}, {value: 0x0808, lo: 0xa8, hi: 0xa8}, {value: 0x3308, lo: 0xa9, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x0818, lo: 0xb0, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0xd, offset 0x77 {value: 0x0000, lo: 0x0d}, {value: 0x0c08, lo: 0x80, hi: 0x80}, {value: 0x0a08, lo: 0x81, hi: 0x85}, {value: 0x0c08, lo: 0x86, hi: 0x87}, {value: 0x0a08, lo: 0x88, hi: 0x88}, {value: 0x0c08, lo: 0x89, hi: 0x89}, {value: 0x0a08, lo: 0x8a, hi: 0x93}, {value: 0x0c08, lo: 0x94, hi: 0x94}, {value: 0x0a08, lo: 0x95, hi: 0x95}, {value: 0x0808, lo: 0x96, hi: 0x98}, {value: 0x3308, lo: 0x99, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0x9d}, {value: 0x0818, lo: 0x9e, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0xbf}, // Block 0xe, offset 0x85 {value: 0x0000, lo: 0x0d}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0a08, lo: 0xa0, hi: 0xa9}, {value: 0x0c08, lo: 0xaa, hi: 0xac}, {value: 0x0808, lo: 0xad, hi: 0xad}, {value: 0x0c08, lo: 0xae, hi: 0xae}, {value: 0x0a08, lo: 0xaf, hi: 0xb0}, {value: 0x0c08, lo: 0xb1, hi: 0xb2}, {value: 0x0a08, lo: 0xb3, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xb5}, {value: 0x0a08, lo: 0xb6, hi: 0xb8}, {value: 0x0c08, lo: 0xb9, hi: 0xb9}, {value: 0x0a08, lo: 0xba, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbf}, // Block 0xf, offset 0x93 {value: 0x0000, lo: 0x04}, {value: 0x0040, lo: 0x80, hi: 0x93}, {value: 0x3308, lo: 0x94, hi: 0xa1}, {value: 0x0840, lo: 0xa2, hi: 0xa2}, {value: 0x3308, lo: 0xa3, hi: 0xbf}, // Block 0x10, offset 0x98 {value: 0x0000, lo: 0x08}, {value: 0x3308, lo: 0x80, hi: 0x82}, {value: 0x3008, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0xb9}, {value: 0x3308, lo: 0xba, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbf}, // Block 0x11, offset 0xa1 {value: 0x0000, lo: 0x0f}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x3008, lo: 0x81, hi: 0x82}, {value: 0x0040, lo: 0x83, hi: 0x85}, {value: 0x3008, lo: 0x86, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x3008, lo: 0x8a, hi: 0x8c}, {value: 0x3b08, lo: 0x8d, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x96}, {value: 0x3008, lo: 0x97, hi: 0x97}, {value: 0x0040, lo: 0x98, hi: 0xa5}, {value: 0x0008, lo: 0xa6, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbf}, // Block 0x12, offset 0xb1 {value: 0x0000, lo: 0x0d}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x3008, lo: 0x81, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8d}, {value: 0x0008, lo: 0x8e, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x91}, {value: 0x0008, lo: 0x92, hi: 0xa8}, {value: 0x0040, lo: 0xa9, hi: 0xa9}, {value: 0x0008, lo: 0xaa, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbd}, {value: 0x3308, lo: 0xbe, hi: 0xbf}, // Block 0x13, offset 0xbf {value: 0x0000, lo: 0x0c}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8d}, {value: 0x0008, lo: 0x8e, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x91}, {value: 0x0008, lo: 0x92, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbf}, // Block 0x14, offset 0xcc {value: 0x0000, lo: 0x0b}, {value: 0x0040, lo: 0x80, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x99}, {value: 0x0008, lo: 0x9a, hi: 0xb1}, {value: 0x0040, lo: 0xb2, hi: 0xb2}, {value: 0x0008, lo: 0xb3, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbf}, // Block 0x15, offset 0xd8 {value: 0x0000, lo: 0x10}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x89}, {value: 0x3b08, lo: 0x8a, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8e}, {value: 0x3008, lo: 0x8f, hi: 0x91}, {value: 0x3308, lo: 0x92, hi: 0x94}, {value: 0x0040, lo: 0x95, hi: 0x95}, {value: 0x3308, lo: 0x96, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x97}, {value: 0x3008, lo: 0x98, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xa5}, {value: 0x0008, lo: 0xa6, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xb1}, {value: 0x3008, lo: 0xb2, hi: 0xb3}, {value: 0x0018, lo: 0xb4, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0x16, offset 0xe9 {value: 0x0000, lo: 0x09}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0xb0}, {value: 0x3308, lo: 0xb1, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xb2}, {value: 0x08f1, lo: 0xb3, hi: 0xb3}, {value: 0x3308, lo: 0xb4, hi: 0xb9}, {value: 0x3b08, lo: 0xba, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbe}, {value: 0x0018, lo: 0xbf, hi: 0xbf}, // Block 0x17, offset 0xf3 {value: 0x0000, lo: 0x06}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x3308, lo: 0x87, hi: 0x8e}, {value: 0x0018, lo: 0x8f, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0xbf}, // Block 0x18, offset 0xfa {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x84}, {value: 0x0040, lo: 0x85, hi: 0x85}, {value: 0x0008, lo: 0x86, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x87}, {value: 0x3308, lo: 0x88, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9b}, {value: 0x0961, lo: 0x9c, hi: 0x9c}, {value: 0x0999, lo: 0x9d, hi: 0x9d}, {value: 0x0008, lo: 0x9e, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0x19, offset 0x107 {value: 0x0000, lo: 0x10}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x8a}, {value: 0x0008, lo: 0x8b, hi: 0x8b}, {value: 0xe03d, lo: 0x8c, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0x97}, {value: 0x3308, lo: 0x98, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa9}, {value: 0x0018, lo: 0xaa, hi: 0xb4}, {value: 0x3308, lo: 0xb5, hi: 0xb5}, {value: 0x0018, lo: 0xb6, hi: 0xb6}, {value: 0x3308, lo: 0xb7, hi: 0xb7}, {value: 0x0018, lo: 0xb8, hi: 0xb8}, {value: 0x3308, lo: 0xb9, hi: 0xb9}, {value: 0x0018, lo: 0xba, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbf}, // Block 0x1a, offset 0x118 {value: 0x0000, lo: 0x06}, {value: 0x0018, lo: 0x80, hi: 0x85}, {value: 0x3308, lo: 0x86, hi: 0x86}, {value: 0x0018, lo: 0x87, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8d}, {value: 0x0018, lo: 0x8e, hi: 0x9a}, {value: 0x0040, lo: 0x9b, hi: 0xbf}, // Block 0x1b, offset 0x11f {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0xaa}, {value: 0x3008, lo: 0xab, hi: 0xac}, {value: 0x3308, lo: 0xad, hi: 0xb0}, {value: 0x3008, lo: 0xb1, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb7}, {value: 0x3008, lo: 0xb8, hi: 0xb8}, {value: 0x3b08, lo: 0xb9, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbc}, {value: 0x3308, lo: 0xbd, hi: 0xbe}, {value: 0x0008, lo: 0xbf, hi: 0xbf}, // Block 0x1c, offset 0x12a {value: 0x0000, lo: 0x0e}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0018, lo: 0x8a, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x95}, {value: 0x3008, lo: 0x96, hi: 0x97}, {value: 0x3308, lo: 0x98, hi: 0x99}, {value: 0x0008, lo: 0x9a, hi: 0x9d}, {value: 0x3308, lo: 0x9e, hi: 0xa0}, {value: 0x0008, lo: 0xa1, hi: 0xa1}, {value: 0x3008, lo: 0xa2, hi: 0xa4}, {value: 0x0008, lo: 0xa5, hi: 0xa6}, {value: 0x3008, lo: 0xa7, hi: 0xad}, {value: 0x0008, lo: 0xae, hi: 0xb0}, {value: 0x3308, lo: 0xb1, hi: 0xb4}, {value: 0x0008, lo: 0xb5, hi: 0xbf}, // Block 0x1d, offset 0x139 {value: 0x0000, lo: 0x0d}, {value: 0x0008, lo: 0x80, hi: 0x81}, {value: 0x3308, lo: 0x82, hi: 0x82}, {value: 0x3008, lo: 0x83, hi: 0x84}, {value: 0x3308, lo: 0x85, hi: 0x86}, {value: 0x3008, lo: 0x87, hi: 0x8c}, {value: 0x3308, lo: 0x8d, hi: 0x8d}, {value: 0x0008, lo: 0x8e, hi: 0x8e}, {value: 0x3008, lo: 0x8f, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x3008, lo: 0x9a, hi: 0x9c}, {value: 0x3308, lo: 0x9d, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0x1e, offset 0x147 {value: 0x0000, lo: 0x09}, {value: 0x0040, lo: 0x80, hi: 0x86}, {value: 0x055d, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8c}, {value: 0x055d, lo: 0x8d, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xba}, {value: 0x0018, lo: 0xbb, hi: 0xbb}, {value: 0xe105, lo: 0xbc, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbf}, // Block 0x1f, offset 0x151 {value: 0x0000, lo: 0x01}, {value: 0x0018, lo: 0x80, hi: 0xbf}, // Block 0x20, offset 0x153 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0xa0}, {value: 0x2018, lo: 0xa1, hi: 0xb5}, {value: 0x0018, lo: 0xb6, hi: 0xbf}, // Block 0x21, offset 0x158 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0xa7}, {value: 0x2018, lo: 0xa8, hi: 0xbf}, // Block 0x22, offset 0x15b {value: 0x0000, lo: 0x02}, {value: 0x2018, lo: 0x80, hi: 0x82}, {value: 0x0018, lo: 0x83, hi: 0xbf}, // Block 0x23, offset 0x15e {value: 0x0000, lo: 0x01}, {value: 0x0008, lo: 0x80, hi: 0xbf}, // Block 0x24, offset 0x160 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0008, lo: 0x8a, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0x98}, {value: 0x0040, lo: 0x99, hi: 0x99}, {value: 0x0008, lo: 0x9a, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x25, offset 0x16c {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0008, lo: 0x8a, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xb0}, {value: 0x0040, lo: 0xb1, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb7}, {value: 0x0008, lo: 0xb8, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0x26, offset 0x177 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x0040, lo: 0x81, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0xbf}, // Block 0x27, offset 0x17f {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x91}, {value: 0x0008, lo: 0x92, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0xbf}, // Block 0x28, offset 0x185 {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x9a}, {value: 0x0040, lo: 0x9b, hi: 0x9c}, {value: 0x3308, lo: 0x9d, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbf}, // Block 0x29, offset 0x18b {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x2a, offset 0x190 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb7}, {value: 0xe045, lo: 0xb8, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbf}, // Block 0x2b, offset 0x195 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0xbf}, // Block 0x2c, offset 0x198 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xac}, {value: 0x0018, lo: 0xad, hi: 0xae}, {value: 0x0008, lo: 0xaf, hi: 0xbf}, // Block 0x2d, offset 0x19c {value: 0x0000, lo: 0x05}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0x9c}, {value: 0x0040, lo: 0x9d, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x2e, offset 0x1a2 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xaa}, {value: 0x0018, lo: 0xab, hi: 0xb0}, {value: 0x0008, lo: 0xb1, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbf}, // Block 0x2f, offset 0x1a7 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8d}, {value: 0x0008, lo: 0x8e, hi: 0x91}, {value: 0x3308, lo: 0x92, hi: 0x93}, {value: 0x3b08, lo: 0x94, hi: 0x94}, {value: 0x0040, lo: 0x95, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb3}, {value: 0x3b08, lo: 0xb4, hi: 0xb4}, {value: 0x0018, lo: 0xb5, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0x30, offset 0x1b3 {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x91}, {value: 0x3308, lo: 0x92, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xad}, {value: 0x0008, lo: 0xae, hi: 0xb0}, {value: 0x0040, lo: 0xb1, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xbf}, // Block 0x31, offset 0x1bd {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0xb3}, {value: 0x3340, lo: 0xb4, hi: 0xb5}, {value: 0x3008, lo: 0xb6, hi: 0xb6}, {value: 0x3308, lo: 0xb7, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbf}, // Block 0x32, offset 0x1c3 {value: 0x0000, lo: 0x10}, {value: 0x3008, lo: 0x80, hi: 0x85}, {value: 0x3308, lo: 0x86, hi: 0x86}, {value: 0x3008, lo: 0x87, hi: 0x88}, {value: 0x3308, lo: 0x89, hi: 0x91}, {value: 0x3b08, lo: 0x92, hi: 0x92}, {value: 0x3308, lo: 0x93, hi: 0x93}, {value: 0x0018, lo: 0x94, hi: 0x96}, {value: 0x0008, lo: 0x97, hi: 0x97}, {value: 0x0018, lo: 0x98, hi: 0x9b}, {value: 0x0008, lo: 0x9c, hi: 0x9c}, {value: 0x3308, lo: 0x9d, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa9}, {value: 0x0040, lo: 0xaa, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0x33, offset 0x1d4 {value: 0x0000, lo: 0x09}, {value: 0x0018, lo: 0x80, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x86}, {value: 0x0218, lo: 0x87, hi: 0x87}, {value: 0x0018, lo: 0x88, hi: 0x8a}, {value: 0x33c0, lo: 0x8b, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0208, lo: 0xa0, hi: 0xbf}, // Block 0x34, offset 0x1de {value: 0x0000, lo: 0x02}, {value: 0x0208, lo: 0x80, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbf}, // Block 0x35, offset 0x1e1 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0x84}, {value: 0x3308, lo: 0x85, hi: 0x86}, {value: 0x0208, lo: 0x87, hi: 0xa8}, {value: 0x3308, lo: 0xa9, hi: 0xa9}, {value: 0x0208, lo: 0xaa, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x36, offset 0x1e9 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xbf}, // Block 0x37, offset 0x1ec {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x3308, lo: 0xa0, hi: 0xa2}, {value: 0x3008, lo: 0xa3, hi: 0xa6}, {value: 0x3308, lo: 0xa7, hi: 0xa8}, {value: 0x3008, lo: 0xa9, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x3008, lo: 0xb0, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb2}, {value: 0x3008, lo: 0xb3, hi: 0xb8}, {value: 0x3308, lo: 0xb9, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0x38, offset 0x1f9 {value: 0x0000, lo: 0x07}, {value: 0x0018, lo: 0x80, hi: 0x80}, {value: 0x0040, lo: 0x81, hi: 0x83}, {value: 0x0018, lo: 0x84, hi: 0x85}, {value: 0x0008, lo: 0x86, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0x39, offset 0x201 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x3a, offset 0x205 {value: 0x0000, lo: 0x06}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0028, lo: 0x9a, hi: 0x9a}, {value: 0x0040, lo: 0x9b, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0xbf}, // Block 0x3b, offset 0x20c {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0x96}, {value: 0x3308, lo: 0x97, hi: 0x98}, {value: 0x3008, lo: 0x99, hi: 0x9a}, {value: 0x3308, lo: 0x9b, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x3c, offset 0x214 {value: 0x0000, lo: 0x0f}, {value: 0x0008, lo: 0x80, hi: 0x94}, {value: 0x3008, lo: 0x95, hi: 0x95}, {value: 0x3308, lo: 0x96, hi: 0x96}, {value: 0x3008, lo: 0x97, hi: 0x97}, {value: 0x3308, lo: 0x98, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x3b08, lo: 0xa0, hi: 0xa0}, {value: 0x3008, lo: 0xa1, hi: 0xa1}, {value: 0x3308, lo: 0xa2, hi: 0xa2}, {value: 0x3008, lo: 0xa3, hi: 0xa4}, {value: 0x3308, lo: 0xa5, hi: 0xac}, {value: 0x3008, lo: 0xad, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbe}, {value: 0x3308, lo: 0xbf, hi: 0xbf}, // Block 0x3d, offset 0x224 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa6}, {value: 0x0008, lo: 0xa7, hi: 0xa7}, {value: 0x0018, lo: 0xa8, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xbd}, {value: 0x3318, lo: 0xbe, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0x3e, offset 0x230 {value: 0x0000, lo: 0x01}, {value: 0x0040, lo: 0x80, hi: 0xbf}, // Block 0x3f, offset 0x232 {value: 0x0000, lo: 0x09}, {value: 0x3308, lo: 0x80, hi: 0x83}, {value: 0x3008, lo: 0x84, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0xb3}, {value: 0x3308, lo: 0xb4, hi: 0xb4}, {value: 0x3008, lo: 0xb5, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbc}, {value: 0x3008, lo: 0xbd, hi: 0xbf}, // Block 0x40, offset 0x23c {value: 0x0000, lo: 0x0b}, {value: 0x3008, lo: 0x80, hi: 0x81}, {value: 0x3308, lo: 0x82, hi: 0x82}, {value: 0x3008, lo: 0x83, hi: 0x83}, {value: 0x3808, lo: 0x84, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0xaa}, {value: 0x3308, lo: 0xab, hi: 0xb3}, {value: 0x0018, lo: 0xb4, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbf}, // Block 0x41, offset 0x248 {value: 0x0000, lo: 0x0b}, {value: 0x3308, lo: 0x80, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0xa0}, {value: 0x3008, lo: 0xa1, hi: 0xa1}, {value: 0x3308, lo: 0xa2, hi: 0xa5}, {value: 0x3008, lo: 0xa6, hi: 0xa7}, {value: 0x3308, lo: 0xa8, hi: 0xa9}, {value: 0x3808, lo: 0xaa, hi: 0xaa}, {value: 0x3b08, lo: 0xab, hi: 0xab}, {value: 0x3308, lo: 0xac, hi: 0xad}, {value: 0x0008, lo: 0xae, hi: 0xbf}, // Block 0x42, offset 0x254 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0xa5}, {value: 0x3308, lo: 0xa6, hi: 0xa6}, {value: 0x3008, lo: 0xa7, hi: 0xa7}, {value: 0x3308, lo: 0xa8, hi: 0xa9}, {value: 0x3008, lo: 0xaa, hi: 0xac}, {value: 0x3308, lo: 0xad, hi: 0xad}, {value: 0x3008, lo: 0xae, hi: 0xae}, {value: 0x3308, lo: 0xaf, hi: 0xb1}, {value: 0x3808, lo: 0xb2, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xbb}, {value: 0x0018, lo: 0xbc, hi: 0xbf}, // Block 0x43, offset 0x260 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0xa3}, {value: 0x3008, lo: 0xa4, hi: 0xab}, {value: 0x3308, lo: 0xac, hi: 0xb3}, {value: 0x3008, lo: 0xb4, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xba}, {value: 0x0018, lo: 0xbb, hi: 0xbf}, // Block 0x44, offset 0x268 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0x8c}, {value: 0x0008, lo: 0x8d, hi: 0xbd}, {value: 0x0018, lo: 0xbe, hi: 0xbf}, // Block 0x45, offset 0x26d {value: 0x0000, lo: 0x09}, {value: 0x0e29, lo: 0x80, hi: 0x80}, {value: 0x0e41, lo: 0x81, hi: 0x81}, {value: 0x0e59, lo: 0x82, hi: 0x82}, {value: 0x0e71, lo: 0x83, hi: 0x83}, {value: 0x0e89, lo: 0x84, hi: 0x85}, {value: 0x0ea1, lo: 0x86, hi: 0x86}, {value: 0x0eb9, lo: 0x87, hi: 0x87}, {value: 0x057d, lo: 0x88, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0xbf}, // Block 0x46, offset 0x277 {value: 0x0000, lo: 0x10}, {value: 0x0018, lo: 0x80, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x3308, lo: 0x90, hi: 0x92}, {value: 0x0018, lo: 0x93, hi: 0x93}, {value: 0x3308, lo: 0x94, hi: 0xa0}, {value: 0x3008, lo: 0xa1, hi: 0xa1}, {value: 0x3308, lo: 0xa2, hi: 0xa8}, {value: 0x0008, lo: 0xa9, hi: 0xac}, {value: 0x3308, lo: 0xad, hi: 0xad}, {value: 0x0008, lo: 0xae, hi: 0xb1}, {value: 0x3008, lo: 0xb2, hi: 0xb3}, {value: 0x3308, lo: 0xb4, hi: 0xb4}, {value: 0x0008, lo: 0xb5, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xb7}, {value: 0x3308, lo: 0xb8, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0x47, offset 0x288 {value: 0x0000, lo: 0x03}, {value: 0x3308, lo: 0x80, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xba}, {value: 0x3308, lo: 0xbb, hi: 0xbf}, // Block 0x48, offset 0x28c {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x87}, {value: 0xe045, lo: 0x88, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x97}, {value: 0xe045, lo: 0x98, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa7}, {value: 0xe045, lo: 0xa8, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb7}, {value: 0xe045, lo: 0xb8, hi: 0xbf}, // Block 0x49, offset 0x297 {value: 0x0000, lo: 0x03}, {value: 0x0040, lo: 0x80, hi: 0x8f}, {value: 0x3318, lo: 0x90, hi: 0xb0}, {value: 0x0040, lo: 0xb1, hi: 0xbf}, // Block 0x4a, offset 0x29b {value: 0x0000, lo: 0x08}, {value: 0x0018, lo: 0x80, hi: 0x82}, {value: 0x0040, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0x84}, {value: 0x0018, lo: 0x85, hi: 0x88}, {value: 0x24c1, lo: 0x89, hi: 0x89}, {value: 0x0018, lo: 0x8a, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xbf}, // Block 0x4b, offset 0x2a4 {value: 0x0000, lo: 0x07}, {value: 0x0018, lo: 0x80, hi: 0xab}, {value: 0x24f1, lo: 0xac, hi: 0xac}, {value: 0x2529, lo: 0xad, hi: 0xad}, {value: 0x0018, lo: 0xae, hi: 0xae}, {value: 0x2579, lo: 0xaf, hi: 0xaf}, {value: 0x25b1, lo: 0xb0, hi: 0xb0}, {value: 0x0018, lo: 0xb1, hi: 0xbf}, // Block 0x4c, offset 0x2ac {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x9f}, {value: 0x0080, lo: 0xa0, hi: 0xa0}, {value: 0x0018, lo: 0xa1, hi: 0xad}, {value: 0x0080, lo: 0xae, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xbf}, // Block 0x4d, offset 0x2b2 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0xa8}, {value: 0x09c5, lo: 0xa9, hi: 0xa9}, {value: 0x09e5, lo: 0xaa, hi: 0xaa}, {value: 0x0018, lo: 0xab, hi: 0xbf}, // Block 0x4e, offset 0x2b7 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0x4f, offset 0x2ba {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xbf}, // Block 0x50, offset 0x2bd {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0x8b}, {value: 0x28c1, lo: 0x8c, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0xbf}, // Block 0x51, offset 0x2c1 {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0xb3}, {value: 0x0e66, lo: 0xb4, hi: 0xb4}, {value: 0x292a, lo: 0xb5, hi: 0xb5}, {value: 0x0e86, lo: 0xb6, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xbf}, // Block 0x52, offset 0x2c7 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0x9b}, {value: 0x2941, lo: 0x9c, hi: 0x9c}, {value: 0x0018, lo: 0x9d, hi: 0xbf}, // Block 0x53, offset 0x2cb {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xb5}, {value: 0x0018, lo: 0xb6, hi: 0xbf}, // Block 0x54, offset 0x2cf {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x97}, {value: 0x0018, lo: 0x98, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbc}, {value: 0x0018, lo: 0xbd, hi: 0xbf}, // Block 0x55, offset 0x2d5 {value: 0x0000, lo: 0x06}, {value: 0x0018, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0018, lo: 0x8a, hi: 0x91}, {value: 0x0040, lo: 0x92, hi: 0xab}, {value: 0x0018, lo: 0xac, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, // Block 0x56, offset 0x2dc {value: 0x0000, lo: 0x05}, {value: 0xe185, lo: 0x80, hi: 0x8f}, {value: 0x03f5, lo: 0x90, hi: 0x9f}, {value: 0x0ea5, lo: 0xa0, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x57, offset 0x2e2 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0xa5}, {value: 0x0040, lo: 0xa6, hi: 0xa6}, {value: 0x0008, lo: 0xa7, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xac}, {value: 0x0008, lo: 0xad, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x58, offset 0x2ea {value: 0x0000, lo: 0x06}, {value: 0x0008, lo: 0x80, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xae}, {value: 0xe075, lo: 0xaf, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb0}, {value: 0x0040, lo: 0xb1, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0x59, offset 0x2f1 {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xa7}, {value: 0x0008, lo: 0xa8, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xb7}, {value: 0x0008, lo: 0xb8, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0x5a, offset 0x2fc {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x8e}, {value: 0x0040, lo: 0x8f, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x3308, lo: 0xa0, hi: 0xbf}, // Block 0x5b, offset 0x306 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xae}, {value: 0x0008, lo: 0xaf, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xbf}, // Block 0x5c, offset 0x30a {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0x84}, {value: 0x0040, lo: 0x85, hi: 0xbf}, // Block 0x5d, offset 0x30d {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0x9e}, {value: 0x0edd, lo: 0x9f, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xbf}, // Block 0x5e, offset 0x313 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xb2}, {value: 0x0efd, lo: 0xb3, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xbf}, // Block 0x5f, offset 0x317 {value: 0x0020, lo: 0x01}, {value: 0x0f1d, lo: 0x80, hi: 0xbf}, // Block 0x60, offset 0x319 {value: 0x0020, lo: 0x02}, {value: 0x171d, lo: 0x80, hi: 0x8f}, {value: 0x18fd, lo: 0x90, hi: 0xbf}, // Block 0x61, offset 0x31c {value: 0x0020, lo: 0x01}, {value: 0x1efd, lo: 0x80, hi: 0xbf}, // Block 0x62, offset 0x31e {value: 0x0000, lo: 0x02}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0xbf}, // Block 0x63, offset 0x321 {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x98}, {value: 0x3308, lo: 0x99, hi: 0x9a}, {value: 0x29e2, lo: 0x9b, hi: 0x9b}, {value: 0x2a0a, lo: 0x9c, hi: 0x9c}, {value: 0x0008, lo: 0x9d, hi: 0x9e}, {value: 0x2a31, lo: 0x9f, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa0}, {value: 0x0008, lo: 0xa1, hi: 0xbf}, // Block 0x64, offset 0x32b {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xbe}, {value: 0x2a69, lo: 0xbf, hi: 0xbf}, // Block 0x65, offset 0x32e {value: 0x0000, lo: 0x0e}, {value: 0x0040, lo: 0x80, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xb0}, {value: 0x2a1d, lo: 0xb1, hi: 0xb1}, {value: 0x2a3d, lo: 0xb2, hi: 0xb2}, {value: 0x2a5d, lo: 0xb3, hi: 0xb3}, {value: 0x2a7d, lo: 0xb4, hi: 0xb4}, {value: 0x2a5d, lo: 0xb5, hi: 0xb5}, {value: 0x2a9d, lo: 0xb6, hi: 0xb6}, {value: 0x2abd, lo: 0xb7, hi: 0xb7}, {value: 0x2add, lo: 0xb8, hi: 0xb9}, {value: 0x2afd, lo: 0xba, hi: 0xbb}, {value: 0x2b1d, lo: 0xbc, hi: 0xbd}, {value: 0x2afd, lo: 0xbe, hi: 0xbf}, // Block 0x66, offset 0x33d {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xa3}, {value: 0x0040, lo: 0xa4, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x67, offset 0x341 {value: 0x0030, lo: 0x04}, {value: 0x2aa2, lo: 0x80, hi: 0x9d}, {value: 0x305a, lo: 0x9e, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x30a2, lo: 0xa0, hi: 0xbf}, // Block 0x68, offset 0x346 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0xbf}, // Block 0x69, offset 0x349 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xbf}, // Block 0x6a, offset 0x34d {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xbd}, {value: 0x0018, lo: 0xbe, hi: 0xbf}, // Block 0x6b, offset 0x352 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xbf}, // Block 0x6c, offset 0x357 {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0xa5}, {value: 0x0018, lo: 0xa6, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb1}, {value: 0x0018, lo: 0xb2, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbf}, // Block 0x6d, offset 0x35d {value: 0x0000, lo: 0x05}, {value: 0x0040, lo: 0x80, hi: 0xb6}, {value: 0x0008, lo: 0xb7, hi: 0xb7}, {value: 0x2009, lo: 0xb8, hi: 0xb8}, {value: 0x6e89, lo: 0xb9, hi: 0xb9}, {value: 0x0008, lo: 0xba, hi: 0xbf}, // Block 0x6e, offset 0x363 {value: 0x0000, lo: 0x0e}, {value: 0x0008, lo: 0x80, hi: 0x81}, {value: 0x3308, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0x85}, {value: 0x3b08, lo: 0x86, hi: 0x86}, {value: 0x0008, lo: 0x87, hi: 0x8a}, {value: 0x3308, lo: 0x8b, hi: 0x8b}, {value: 0x0008, lo: 0x8c, hi: 0xa2}, {value: 0x3008, lo: 0xa3, hi: 0xa4}, {value: 0x3308, lo: 0xa5, hi: 0xa6}, {value: 0x3008, lo: 0xa7, hi: 0xa7}, {value: 0x0018, lo: 0xa8, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0x6f, offset 0x372 {value: 0x0000, lo: 0x05}, {value: 0x0208, lo: 0x80, hi: 0xb1}, {value: 0x0108, lo: 0xb2, hi: 0xb2}, {value: 0x0008, lo: 0xb3, hi: 0xb3}, {value: 0x0018, lo: 0xb4, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbf}, // Block 0x70, offset 0x378 {value: 0x0000, lo: 0x03}, {value: 0x3008, lo: 0x80, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0xb3}, {value: 0x3008, lo: 0xb4, hi: 0xbf}, // Block 0x71, offset 0x37c {value: 0x0000, lo: 0x0e}, {value: 0x3008, lo: 0x80, hi: 0x83}, {value: 0x3b08, lo: 0x84, hi: 0x84}, {value: 0x3308, lo: 0x85, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x8d}, {value: 0x0018, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x3308, lo: 0xa0, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xb7}, {value: 0x0018, lo: 0xb8, hi: 0xba}, {value: 0x0008, lo: 0xbb, hi: 0xbb}, {value: 0x0018, lo: 0xbc, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbf}, // Block 0x72, offset 0x38b {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xa5}, {value: 0x3308, lo: 0xa6, hi: 0xad}, {value: 0x0018, lo: 0xae, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x73, offset 0x390 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x3308, lo: 0x87, hi: 0x91}, {value: 0x3008, lo: 0x92, hi: 0x92}, {value: 0x3808, lo: 0x93, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x9e}, {value: 0x0018, lo: 0x9f, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbf}, // Block 0x74, offset 0x398 {value: 0x0000, lo: 0x09}, {value: 0x3308, lo: 0x80, hi: 0x82}, {value: 0x3008, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb3}, {value: 0x3008, lo: 0xb4, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xb9}, {value: 0x3008, lo: 0xba, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbc}, {value: 0x3008, lo: 0xbd, hi: 0xbf}, // Block 0x75, offset 0x3a2 {value: 0x0000, lo: 0x0a}, {value: 0x3808, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8e}, {value: 0x0008, lo: 0x8f, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa4}, {value: 0x3308, lo: 0xa5, hi: 0xa5}, {value: 0x0008, lo: 0xa6, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0x76, offset 0x3ad {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0xa8}, {value: 0x3308, lo: 0xa9, hi: 0xae}, {value: 0x3008, lo: 0xaf, hi: 0xb0}, {value: 0x3308, lo: 0xb1, hi: 0xb2}, {value: 0x3008, lo: 0xb3, hi: 0xb4}, {value: 0x3308, lo: 0xb5, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0x77, offset 0x3b5 {value: 0x0000, lo: 0x10}, {value: 0x0008, lo: 0x80, hi: 0x82}, {value: 0x3308, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0x8b}, {value: 0x3308, lo: 0x8c, hi: 0x8c}, {value: 0x3008, lo: 0x8d, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9b}, {value: 0x0018, lo: 0x9c, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xb9}, {value: 0x0008, lo: 0xba, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbc}, {value: 0x3008, lo: 0xbd, hi: 0xbd}, {value: 0x0008, lo: 0xbe, hi: 0xbf}, // Block 0x78, offset 0x3c6 {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb0}, {value: 0x0008, lo: 0xb1, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb4}, {value: 0x0008, lo: 0xb5, hi: 0xb6}, {value: 0x3308, lo: 0xb7, hi: 0xb8}, {value: 0x0008, lo: 0xb9, hi: 0xbd}, {value: 0x3308, lo: 0xbe, hi: 0xbf}, // Block 0x79, offset 0x3cf {value: 0x0000, lo: 0x0f}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0x82}, {value: 0x0040, lo: 0x83, hi: 0x9a}, {value: 0x0008, lo: 0x9b, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xaa}, {value: 0x3008, lo: 0xab, hi: 0xab}, {value: 0x3308, lo: 0xac, hi: 0xad}, {value: 0x3008, lo: 0xae, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xb4}, {value: 0x3008, lo: 0xb5, hi: 0xb5}, {value: 0x3b08, lo: 0xb6, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0x7a, offset 0x3df {value: 0x0000, lo: 0x0c}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x88}, {value: 0x0008, lo: 0x89, hi: 0x8e}, {value: 0x0040, lo: 0x8f, hi: 0x90}, {value: 0x0008, lo: 0x91, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xa7}, {value: 0x0008, lo: 0xa8, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x7b, offset 0x3ec {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0x9b}, {value: 0x4465, lo: 0x9c, hi: 0x9c}, {value: 0x447d, lo: 0x9d, hi: 0x9d}, {value: 0x2971, lo: 0x9e, hi: 0x9e}, {value: 0xe06d, lo: 0x9f, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa5}, {value: 0x0040, lo: 0xa6, hi: 0xaf}, {value: 0x4495, lo: 0xb0, hi: 0xbf}, // Block 0x7c, offset 0x3f6 {value: 0x0000, lo: 0x04}, {value: 0x44b5, lo: 0x80, hi: 0x8f}, {value: 0x44d5, lo: 0x90, hi: 0x9f}, {value: 0x44f5, lo: 0xa0, hi: 0xaf}, {value: 0x44d5, lo: 0xb0, hi: 0xbf}, // Block 0x7d, offset 0x3fb {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0xa2}, {value: 0x3008, lo: 0xa3, hi: 0xa4}, {value: 0x3308, lo: 0xa5, hi: 0xa5}, {value: 0x3008, lo: 0xa6, hi: 0xa7}, {value: 0x3308, lo: 0xa8, hi: 0xa8}, {value: 0x3008, lo: 0xa9, hi: 0xaa}, {value: 0x0018, lo: 0xab, hi: 0xab}, {value: 0x3008, lo: 0xac, hi: 0xac}, {value: 0x3b08, lo: 0xad, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0x7e, offset 0x408 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xa3}, {value: 0x0040, lo: 0xa4, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xbf}, // Block 0x7f, offset 0x40c {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x8a}, {value: 0x0018, lo: 0x8b, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0x80, offset 0x411 {value: 0x0020, lo: 0x01}, {value: 0x4515, lo: 0x80, hi: 0xbf}, // Block 0x81, offset 0x413 {value: 0x0020, lo: 0x03}, {value: 0x4d15, lo: 0x80, hi: 0x94}, {value: 0x4ad5, lo: 0x95, hi: 0x95}, {value: 0x4fb5, lo: 0x96, hi: 0xbf}, // Block 0x82, offset 0x417 {value: 0x0020, lo: 0x01}, {value: 0x54f5, lo: 0x80, hi: 0xbf}, // Block 0x83, offset 0x419 {value: 0x0020, lo: 0x03}, {value: 0x5cf5, lo: 0x80, hi: 0x84}, {value: 0x5655, lo: 0x85, hi: 0x85}, {value: 0x5d95, lo: 0x86, hi: 0xbf}, // Block 0x84, offset 0x41d {value: 0x0020, lo: 0x08}, {value: 0x6b55, lo: 0x80, hi: 0x8f}, {value: 0x6d15, lo: 0x90, hi: 0x90}, {value: 0x6d55, lo: 0x91, hi: 0xab}, {value: 0x6ea1, lo: 0xac, hi: 0xac}, {value: 0x70b5, lo: 0xad, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x70d5, lo: 0xb0, hi: 0xbf}, // Block 0x85, offset 0x426 {value: 0x0020, lo: 0x05}, {value: 0x72d5, lo: 0x80, hi: 0xad}, {value: 0x6535, lo: 0xae, hi: 0xae}, {value: 0x7895, lo: 0xaf, hi: 0xb5}, {value: 0x6f55, lo: 0xb6, hi: 0xb6}, {value: 0x7975, lo: 0xb7, hi: 0xbf}, // Block 0x86, offset 0x42c {value: 0x0028, lo: 0x03}, {value: 0x7c21, lo: 0x80, hi: 0x82}, {value: 0x7be1, lo: 0x83, hi: 0x83}, {value: 0x7c99, lo: 0x84, hi: 0xbf}, // Block 0x87, offset 0x430 {value: 0x0038, lo: 0x0f}, {value: 0x9db1, lo: 0x80, hi: 0x83}, {value: 0x9e59, lo: 0x84, hi: 0x85}, {value: 0x9e91, lo: 0x86, hi: 0x87}, {value: 0x9ec9, lo: 0x88, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x91}, {value: 0xa089, lo: 0x92, hi: 0x97}, {value: 0xa1a1, lo: 0x98, hi: 0x9c}, {value: 0xa281, lo: 0x9d, hi: 0xb3}, {value: 0x9d41, lo: 0xb4, hi: 0xb4}, {value: 0x9db1, lo: 0xb5, hi: 0xb5}, {value: 0xa789, lo: 0xb6, hi: 0xbb}, {value: 0xa869, lo: 0xbc, hi: 0xbc}, {value: 0xa7f9, lo: 0xbd, hi: 0xbd}, {value: 0xa8d9, lo: 0xbe, hi: 0xbf}, // Block 0x88, offset 0x440 {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8c}, {value: 0x0008, lo: 0x8d, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xa7}, {value: 0x0008, lo: 0xa8, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbb}, {value: 0x0008, lo: 0xbc, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbe}, {value: 0x0008, lo: 0xbf, hi: 0xbf}, // Block 0x89, offset 0x44a {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0xbf}, // Block 0x8a, offset 0x44f {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbf}, // Block 0x8b, offset 0x452 {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x82}, {value: 0x0040, lo: 0x83, hi: 0x86}, {value: 0x0018, lo: 0x87, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xbf}, // Block 0x8c, offset 0x458 {value: 0x0000, lo: 0x06}, {value: 0x0018, lo: 0x80, hi: 0x8e}, {value: 0x0040, lo: 0x8f, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa0}, {value: 0x0040, lo: 0xa1, hi: 0xbf}, // Block 0x8d, offset 0x45f {value: 0x0000, lo: 0x04}, {value: 0x0040, lo: 0x80, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xbc}, {value: 0x3308, lo: 0xbd, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbf}, // Block 0x8e, offset 0x464 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0x9c}, {value: 0x0040, lo: 0x9d, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x8f, offset 0x468 {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x9f}, {value: 0x3308, lo: 0xa0, hi: 0xa0}, {value: 0x0018, lo: 0xa1, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0x90, offset 0x46e {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa3}, {value: 0x0040, lo: 0xa4, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x91, offset 0x473 {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0x89}, {value: 0x0018, lo: 0x8a, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbf}, // Block 0x92, offset 0x47c {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9e}, {value: 0x0018, lo: 0x9f, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x93, offset 0x481 {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0xbf}, // Block 0x94, offset 0x487 {value: 0x0000, lo: 0x06}, {value: 0xe145, lo: 0x80, hi: 0x87}, {value: 0xe1c5, lo: 0x88, hi: 0x8f}, {value: 0xe145, lo: 0x90, hi: 0x97}, {value: 0x8ad5, lo: 0x98, hi: 0x9f}, {value: 0x8aed, lo: 0xa0, hi: 0xa7}, {value: 0x0008, lo: 0xa8, hi: 0xbf}, // Block 0x95, offset 0x48e {value: 0x0000, lo: 0x06}, {value: 0x0008, lo: 0x80, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa9}, {value: 0x0040, lo: 0xaa, hi: 0xaf}, {value: 0x8aed, lo: 0xb0, hi: 0xb7}, {value: 0x8ad5, lo: 0xb8, hi: 0xbf}, // Block 0x96, offset 0x495 {value: 0x0000, lo: 0x06}, {value: 0xe145, lo: 0x80, hi: 0x87}, {value: 0xe1c5, lo: 0x88, hi: 0x8f}, {value: 0xe145, lo: 0x90, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0x97, offset 0x49c {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x98, offset 0x4a0 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xa3}, {value: 0x0040, lo: 0xa4, hi: 0xae}, {value: 0x0018, lo: 0xaf, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, // Block 0x99, offset 0x4a5 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0x9a, offset 0x4a8 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xbf}, // Block 0x9b, offset 0x4ad {value: 0x0000, lo: 0x0b}, {value: 0x0808, lo: 0x80, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x87}, {value: 0x0808, lo: 0x88, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0808, lo: 0x8a, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb6}, {value: 0x0808, lo: 0xb7, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbb}, {value: 0x0808, lo: 0xbc, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbe}, {value: 0x0808, lo: 0xbf, hi: 0xbf}, // Block 0x9c, offset 0x4b9 {value: 0x0000, lo: 0x05}, {value: 0x0808, lo: 0x80, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x96}, {value: 0x0818, lo: 0x97, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xb6}, {value: 0x0818, lo: 0xb7, hi: 0xbf}, // Block 0x9d, offset 0x4bf {value: 0x0000, lo: 0x04}, {value: 0x0808, lo: 0x80, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0xa6}, {value: 0x0818, lo: 0xa7, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, // Block 0x9e, offset 0x4c4 {value: 0x0000, lo: 0x06}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xb3}, {value: 0x0808, lo: 0xb4, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xba}, {value: 0x0818, lo: 0xbb, hi: 0xbf}, // Block 0x9f, offset 0x4cb {value: 0x0000, lo: 0x07}, {value: 0x0808, lo: 0x80, hi: 0x95}, {value: 0x0818, lo: 0x96, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0x9e}, {value: 0x0018, lo: 0x9f, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbe}, {value: 0x0818, lo: 0xbf, hi: 0xbf}, // Block 0xa0, offset 0x4d3 {value: 0x0000, lo: 0x04}, {value: 0x0808, lo: 0x80, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbb}, {value: 0x0818, lo: 0xbc, hi: 0xbd}, {value: 0x0808, lo: 0xbe, hi: 0xbf}, // Block 0xa1, offset 0x4d8 {value: 0x0000, lo: 0x03}, {value: 0x0818, lo: 0x80, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0x91}, {value: 0x0818, lo: 0x92, hi: 0xbf}, // Block 0xa2, offset 0x4dc {value: 0x0000, lo: 0x0f}, {value: 0x0808, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x84}, {value: 0x3308, lo: 0x85, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x8b}, {value: 0x3308, lo: 0x8c, hi: 0x8f}, {value: 0x0808, lo: 0x90, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x94}, {value: 0x0808, lo: 0x95, hi: 0x97}, {value: 0x0040, lo: 0x98, hi: 0x98}, {value: 0x0808, lo: 0x99, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xb7}, {value: 0x3308, lo: 0xb8, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0xa3, offset 0x4ec {value: 0x0000, lo: 0x06}, {value: 0x0818, lo: 0x80, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0818, lo: 0x90, hi: 0x98}, {value: 0x0040, lo: 0x99, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xbc}, {value: 0x0818, lo: 0xbd, hi: 0xbf}, // Block 0xa4, offset 0x4f3 {value: 0x0000, lo: 0x03}, {value: 0x0808, lo: 0x80, hi: 0x9c}, {value: 0x0818, lo: 0x9d, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0xa5, offset 0x4f7 {value: 0x0000, lo: 0x03}, {value: 0x0808, lo: 0x80, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb8}, {value: 0x0018, lo: 0xb9, hi: 0xbf}, // Block 0xa6, offset 0x4fb {value: 0x0000, lo: 0x06}, {value: 0x0808, lo: 0x80, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x97}, {value: 0x0818, lo: 0x98, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xb7}, {value: 0x0818, lo: 0xb8, hi: 0xbf}, // Block 0xa7, offset 0x502 {value: 0x0000, lo: 0x01}, {value: 0x0808, lo: 0x80, hi: 0xbf}, // Block 0xa8, offset 0x504 {value: 0x0000, lo: 0x02}, {value: 0x0808, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0xbf}, // Block 0xa9, offset 0x507 {value: 0x0000, lo: 0x02}, {value: 0x03dd, lo: 0x80, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xbf}, // Block 0xaa, offset 0x50a {value: 0x0000, lo: 0x03}, {value: 0x0808, lo: 0x80, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xb9}, {value: 0x0818, lo: 0xba, hi: 0xbf}, // Block 0xab, offset 0x50e {value: 0x0000, lo: 0x03}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0818, lo: 0xa0, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0xac, offset 0x512 {value: 0x0000, lo: 0x05}, {value: 0x3008, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0xb7}, {value: 0x3308, lo: 0xb8, hi: 0xbf}, // Block 0xad, offset 0x518 {value: 0x0000, lo: 0x08}, {value: 0x3308, lo: 0x80, hi: 0x85}, {value: 0x3b08, lo: 0x86, hi: 0x86}, {value: 0x0018, lo: 0x87, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x91}, {value: 0x0018, lo: 0x92, hi: 0xa5}, {value: 0x0008, lo: 0xa6, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0xae, offset 0x521 {value: 0x0000, lo: 0x0b}, {value: 0x3308, lo: 0x80, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0xaf}, {value: 0x3008, lo: 0xb0, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb6}, {value: 0x3008, lo: 0xb7, hi: 0xb8}, {value: 0x3b08, lo: 0xb9, hi: 0xb9}, {value: 0x3308, lo: 0xba, hi: 0xba}, {value: 0x0018, lo: 0xbb, hi: 0xbc}, {value: 0x0340, lo: 0xbd, hi: 0xbd}, {value: 0x0018, lo: 0xbe, hi: 0xbf}, // Block 0xaf, offset 0x52d {value: 0x0000, lo: 0x06}, {value: 0x0018, lo: 0x80, hi: 0x81}, {value: 0x0040, lo: 0x82, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xa8}, {value: 0x0040, lo: 0xa9, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0xb0, offset 0x534 {value: 0x0000, lo: 0x08}, {value: 0x3308, lo: 0x80, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0xa6}, {value: 0x3308, lo: 0xa7, hi: 0xab}, {value: 0x3008, lo: 0xac, hi: 0xac}, {value: 0x3308, lo: 0xad, hi: 0xb2}, {value: 0x3b08, lo: 0xb3, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xb5}, {value: 0x0008, lo: 0xb6, hi: 0xbf}, // Block 0xb1, offset 0x53d {value: 0x0000, lo: 0x07}, {value: 0x0018, lo: 0x80, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb3}, {value: 0x0018, lo: 0xb4, hi: 0xb5}, {value: 0x0008, lo: 0xb6, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0xb2, offset 0x545 {value: 0x0000, lo: 0x06}, {value: 0x3308, lo: 0x80, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0xb2}, {value: 0x3008, lo: 0xb3, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xbe}, {value: 0x3008, lo: 0xbf, hi: 0xbf}, // Block 0xb3, offset 0x54c {value: 0x0000, lo: 0x0d}, {value: 0x3808, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0x84}, {value: 0x0018, lo: 0x85, hi: 0x89}, {value: 0x3308, lo: 0x8a, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0x9b}, {value: 0x0008, lo: 0x9c, hi: 0x9c}, {value: 0x0018, lo: 0x9d, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xa0}, {value: 0x0018, lo: 0xa1, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0xb4, offset 0x55a {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x91}, {value: 0x0040, lo: 0x92, hi: 0x92}, {value: 0x0008, lo: 0x93, hi: 0xab}, {value: 0x3008, lo: 0xac, hi: 0xae}, {value: 0x3308, lo: 0xaf, hi: 0xb1}, {value: 0x3008, lo: 0xb2, hi: 0xb3}, {value: 0x3308, lo: 0xb4, hi: 0xb4}, {value: 0x3808, lo: 0xb5, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xb7}, {value: 0x0018, lo: 0xb8, hi: 0xbd}, {value: 0x3308, lo: 0xbe, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0xb5, offset 0x567 {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0008, lo: 0x8a, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8e}, {value: 0x0008, lo: 0x8f, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9e}, {value: 0x0008, lo: 0x9f, hi: 0xa8}, {value: 0x0018, lo: 0xa9, hi: 0xa9}, {value: 0x0040, lo: 0xaa, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0xb6, offset 0x574 {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0x9e}, {value: 0x3308, lo: 0x9f, hi: 0x9f}, {value: 0x3008, lo: 0xa0, hi: 0xa2}, {value: 0x3308, lo: 0xa3, hi: 0xa9}, {value: 0x3b08, lo: 0xaa, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0xb7, offset 0x57d {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xb4}, {value: 0x3008, lo: 0xb5, hi: 0xb7}, {value: 0x3308, lo: 0xb8, hi: 0xbf}, // Block 0xb8, offset 0x581 {value: 0x0000, lo: 0x0d}, {value: 0x3008, lo: 0x80, hi: 0x81}, {value: 0x3b08, lo: 0x82, hi: 0x82}, {value: 0x3308, lo: 0x83, hi: 0x84}, {value: 0x3008, lo: 0x85, hi: 0x85}, {value: 0x3308, lo: 0x86, hi: 0x86}, {value: 0x0008, lo: 0x87, hi: 0x8a}, {value: 0x0018, lo: 0x8b, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0x9c}, {value: 0x0018, lo: 0x9d, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0xbf}, // Block 0xb9, offset 0x58f {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x3008, lo: 0xb0, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb8}, {value: 0x3008, lo: 0xb9, hi: 0xb9}, {value: 0x3308, lo: 0xba, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbe}, {value: 0x3308, lo: 0xbf, hi: 0xbf}, // Block 0xba, offset 0x597 {value: 0x0000, lo: 0x0a}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x3008, lo: 0x81, hi: 0x81}, {value: 0x3b08, lo: 0x82, hi: 0x82}, {value: 0x3308, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0x85}, {value: 0x0018, lo: 0x86, hi: 0x86}, {value: 0x0008, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0xbf}, // Block 0xbb, offset 0x5a2 {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0xae}, {value: 0x3008, lo: 0xaf, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb7}, {value: 0x3008, lo: 0xb8, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0xbc, offset 0x5ab {value: 0x0000, lo: 0x05}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0x9b}, {value: 0x3308, lo: 0x9c, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0xbf}, // Block 0xbd, offset 0x5b1 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x3008, lo: 0xb0, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbc}, {value: 0x3308, lo: 0xbd, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0xbe, offset 0x5b9 {value: 0x0000, lo: 0x08}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0x84}, {value: 0x0040, lo: 0x85, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xbf}, // Block 0xbf, offset 0x5c2 {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0xaa}, {value: 0x3308, lo: 0xab, hi: 0xab}, {value: 0x3008, lo: 0xac, hi: 0xac}, {value: 0x3308, lo: 0xad, hi: 0xad}, {value: 0x3008, lo: 0xae, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb5}, {value: 0x3808, lo: 0xb6, hi: 0xb6}, {value: 0x3308, lo: 0xb7, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbf}, // Block 0xc0, offset 0x5cc {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0xbf}, // Block 0xc1, offset 0x5cf {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9c}, {value: 0x3308, lo: 0x9d, hi: 0x9f}, {value: 0x3008, lo: 0xa0, hi: 0xa1}, {value: 0x3308, lo: 0xa2, hi: 0xa5}, {value: 0x3008, lo: 0xa6, hi: 0xa6}, {value: 0x3308, lo: 0xa7, hi: 0xaa}, {value: 0x3b08, lo: 0xab, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb9}, {value: 0x0018, lo: 0xba, hi: 0xbf}, // Block 0xc2, offset 0x5db {value: 0x0000, lo: 0x02}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x049d, lo: 0xa0, hi: 0xbf}, // Block 0xc3, offset 0x5de {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xa9}, {value: 0x0018, lo: 0xaa, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xbe}, {value: 0x0008, lo: 0xbf, hi: 0xbf}, // Block 0xc4, offset 0x5e3 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbf}, // Block 0xc5, offset 0x5e6 {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0008, lo: 0x8a, hi: 0xae}, {value: 0x3008, lo: 0xaf, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xb7}, {value: 0x3308, lo: 0xb8, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0xc6, offset 0x5f0 {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xbf}, // Block 0xc7, offset 0x5f9 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0x91}, {value: 0x3308, lo: 0x92, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xa8}, {value: 0x3008, lo: 0xa9, hi: 0xa9}, {value: 0x3308, lo: 0xaa, hi: 0xb0}, {value: 0x3008, lo: 0xb1, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb3}, {value: 0x3008, lo: 0xb4, hi: 0xb4}, {value: 0x3308, lo: 0xb5, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0xc8, offset 0x605 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0xbf}, // Block 0xc9, offset 0x608 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0xca, offset 0x60d {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0xbf}, // Block 0xcb, offset 0x610 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xbf}, // Block 0xcc, offset 0x613 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0xbf}, // Block 0xcd, offset 0x616 {value: 0x0000, lo: 0x06}, {value: 0x0008, lo: 0x80, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa9}, {value: 0x0040, lo: 0xaa, hi: 0xad}, {value: 0x0018, lo: 0xae, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, // Block 0xce, offset 0x61d {value: 0x0000, lo: 0x06}, {value: 0x0040, lo: 0x80, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb4}, {value: 0x0018, lo: 0xb5, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xbf}, // Block 0xcf, offset 0x624 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xbf}, // Block 0xd0, offset 0x628 {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x83}, {value: 0x0018, lo: 0x84, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0xa1}, {value: 0x0040, lo: 0xa2, hi: 0xa2}, {value: 0x0008, lo: 0xa3, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbf}, // Block 0xd1, offset 0x633 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0xbf}, // Block 0xd2, offset 0x636 {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x84}, {value: 0x0040, lo: 0x85, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x90}, {value: 0x3008, lo: 0x91, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0xd3, offset 0x63c {value: 0x0000, lo: 0x04}, {value: 0x0040, lo: 0x80, hi: 0x8e}, {value: 0x3308, lo: 0x8f, hi: 0x92}, {value: 0x0008, lo: 0x93, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0xd4, offset 0x641 {value: 0x0000, lo: 0x03}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa0}, {value: 0x0040, lo: 0xa1, hi: 0xbf}, // Block 0xd5, offset 0x645 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xbf}, // Block 0xd6, offset 0x648 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xbf}, // Block 0xd7, offset 0x64b {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x81}, {value: 0x0040, lo: 0x82, hi: 0xbf}, // Block 0xd8, offset 0x64e {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbf}, // Block 0xd9, offset 0x653 {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9b}, {value: 0x0018, lo: 0x9c, hi: 0x9c}, {value: 0x3308, lo: 0x9d, hi: 0x9e}, {value: 0x0018, lo: 0x9f, hi: 0x9f}, {value: 0x03c0, lo: 0xa0, hi: 0xa3}, {value: 0x0040, lo: 0xa4, hi: 0xbf}, // Block 0xda, offset 0x65d {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xbf}, // Block 0xdb, offset 0x660 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xa8}, {value: 0x0018, lo: 0xa9, hi: 0xbf}, // Block 0xdc, offset 0x664 {value: 0x0000, lo: 0x0e}, {value: 0x0018, lo: 0x80, hi: 0x9d}, {value: 0xb5b9, lo: 0x9e, hi: 0x9e}, {value: 0xb601, lo: 0x9f, hi: 0x9f}, {value: 0xb649, lo: 0xa0, hi: 0xa0}, {value: 0xb6b1, lo: 0xa1, hi: 0xa1}, {value: 0xb719, lo: 0xa2, hi: 0xa2}, {value: 0xb781, lo: 0xa3, hi: 0xa3}, {value: 0xb7e9, lo: 0xa4, hi: 0xa4}, {value: 0x3018, lo: 0xa5, hi: 0xa6}, {value: 0x3318, lo: 0xa7, hi: 0xa9}, {value: 0x0018, lo: 0xaa, hi: 0xac}, {value: 0x3018, lo: 0xad, hi: 0xb2}, {value: 0x0340, lo: 0xb3, hi: 0xba}, {value: 0x3318, lo: 0xbb, hi: 0xbf}, // Block 0xdd, offset 0x673 {value: 0x0000, lo: 0x0b}, {value: 0x3318, lo: 0x80, hi: 0x82}, {value: 0x0018, lo: 0x83, hi: 0x84}, {value: 0x3318, lo: 0x85, hi: 0x8b}, {value: 0x0018, lo: 0x8c, hi: 0xa9}, {value: 0x3318, lo: 0xaa, hi: 0xad}, {value: 0x0018, lo: 0xae, hi: 0xba}, {value: 0xb851, lo: 0xbb, hi: 0xbb}, {value: 0xb899, lo: 0xbc, hi: 0xbc}, {value: 0xb8e1, lo: 0xbd, hi: 0xbd}, {value: 0xb949, lo: 0xbe, hi: 0xbe}, {value: 0xb9b1, lo: 0xbf, hi: 0xbf}, // Block 0xde, offset 0x67f {value: 0x0000, lo: 0x03}, {value: 0xba19, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0xa8}, {value: 0x0040, lo: 0xa9, hi: 0xbf}, // Block 0xdf, offset 0x683 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x81}, {value: 0x3318, lo: 0x82, hi: 0x84}, {value: 0x0018, lo: 0x85, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0xbf}, // Block 0xe0, offset 0x688 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xb1}, {value: 0x0040, lo: 0xb2, hi: 0xbf}, // Block 0xe1, offset 0x68d {value: 0x0000, lo: 0x03}, {value: 0x3308, lo: 0x80, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xba}, {value: 0x3308, lo: 0xbb, hi: 0xbf}, // Block 0xe2, offset 0x691 {value: 0x0000, lo: 0x04}, {value: 0x3308, lo: 0x80, hi: 0xac}, {value: 0x0018, lo: 0xad, hi: 0xb4}, {value: 0x3308, lo: 0xb5, hi: 0xb5}, {value: 0x0018, lo: 0xb6, hi: 0xbf}, // Block 0xe3, offset 0x696 {value: 0x0000, lo: 0x08}, {value: 0x0018, lo: 0x80, hi: 0x83}, {value: 0x3308, lo: 0x84, hi: 0x84}, {value: 0x0018, lo: 0x85, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x9a}, {value: 0x3308, lo: 0x9b, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xa0}, {value: 0x3308, lo: 0xa1, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, // Block 0xe4, offset 0x69f {value: 0x0000, lo: 0x0a}, {value: 0x3308, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x87}, {value: 0x3308, lo: 0x88, hi: 0x98}, {value: 0x0040, lo: 0x99, hi: 0x9a}, {value: 0x3308, lo: 0x9b, hi: 0xa1}, {value: 0x0040, lo: 0xa2, hi: 0xa2}, {value: 0x3308, lo: 0xa3, hi: 0xa4}, {value: 0x0040, lo: 0xa5, hi: 0xa5}, {value: 0x3308, lo: 0xa6, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xbf}, // Block 0xe5, offset 0x6aa {value: 0x0000, lo: 0x05}, {value: 0x0808, lo: 0x80, hi: 0x84}, {value: 0x0040, lo: 0x85, hi: 0x86}, {value: 0x0818, lo: 0x87, hi: 0x8f}, {value: 0x3308, lo: 0x90, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0xbf}, // Block 0xe6, offset 0x6b0 {value: 0x0000, lo: 0x07}, {value: 0x0a08, lo: 0x80, hi: 0x83}, {value: 0x3308, lo: 0x84, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8f}, {value: 0x0808, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9d}, {value: 0x0818, lo: 0x9e, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0xe7, offset 0x6b8 {value: 0x0000, lo: 0x03}, {value: 0x0040, lo: 0x80, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb1}, {value: 0x0040, lo: 0xb2, hi: 0xbf}, // Block 0xe8, offset 0x6bc {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xbf}, // Block 0xe9, offset 0x6c0 {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xb0}, {value: 0x0018, lo: 0xb1, hi: 0xbf}, // Block 0xea, offset 0x6c6 {value: 0x0000, lo: 0x05}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0x90}, {value: 0x0018, lo: 0x91, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xbf}, // Block 0xeb, offset 0x6cc {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x8f}, {value: 0xc1c1, lo: 0x90, hi: 0x90}, {value: 0x0018, lo: 0x91, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xbf}, // Block 0xec, offset 0x6d1 {value: 0x0000, lo: 0x02}, {value: 0x0040, lo: 0x80, hi: 0xa5}, {value: 0x0018, lo: 0xa6, hi: 0xbf}, // Block 0xed, offset 0x6d4 {value: 0x0000, lo: 0x0d}, {value: 0xc7e9, lo: 0x80, hi: 0x80}, {value: 0xc839, lo: 0x81, hi: 0x81}, {value: 0xc889, lo: 0x82, hi: 0x82}, {value: 0xc8d9, lo: 0x83, hi: 0x83}, {value: 0xc929, lo: 0x84, hi: 0x84}, {value: 0xc979, lo: 0x85, hi: 0x85}, {value: 0xc9c9, lo: 0x86, hi: 0x86}, {value: 0xca19, lo: 0x87, hi: 0x87}, {value: 0xca69, lo: 0x88, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x8f}, {value: 0xcab9, lo: 0x90, hi: 0x90}, {value: 0xcad9, lo: 0x91, hi: 0x91}, {value: 0x0040, lo: 0x92, hi: 0xbf}, // Block 0xee, offset 0x6e2 {value: 0x0000, lo: 0x06}, {value: 0x0018, lo: 0x80, hi: 0x92}, {value: 0x0040, lo: 0x93, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0xef, offset 0x6e9 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xbf}, // Block 0xf0, offset 0x6ec {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0x94}, {value: 0x0040, lo: 0x95, hi: 0xbf}, // Block 0xf1, offset 0x6ef {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xbf}, // Block 0xf2, offset 0x6f3 {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xbf}, // Block 0xf3, offset 0x6f9 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xbf}, // Block 0xf4, offset 0x6fe {value: 0x0000, lo: 0x09}, {value: 0x0040, lo: 0x80, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb0}, {value: 0x0040, lo: 0xb1, hi: 0xb2}, {value: 0x0018, lo: 0xb3, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0xf5, offset 0x708 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0xbf}, // Block 0xf6, offset 0x70d {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0x91}, {value: 0x0040, lo: 0x92, hi: 0xbf}, // Block 0xf7, offset 0x710 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0x80}, {value: 0x0040, lo: 0x81, hi: 0xbf}, // Block 0xf8, offset 0x713 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0xbf}, // Block 0xf9, offset 0x716 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0xfa, offset 0x719 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0xfb, offset 0x71d {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xa1}, {value: 0x0040, lo: 0xa2, hi: 0xbf}, // Block 0xfc, offset 0x720 {value: 0x0020, lo: 0x0f}, {value: 0xdeb9, lo: 0x80, hi: 0x89}, {value: 0x8dfd, lo: 0x8a, hi: 0x8a}, {value: 0xdff9, lo: 0x8b, hi: 0x9c}, {value: 0x8e1d, lo: 0x9d, hi: 0x9d}, {value: 0xe239, lo: 0x9e, hi: 0xa2}, {value: 0x8e3d, lo: 0xa3, hi: 0xa3}, {value: 0xe2d9, lo: 0xa4, hi: 0xab}, {value: 0x7ed5, lo: 0xac, hi: 0xac}, {value: 0xe3d9, lo: 0xad, hi: 0xaf}, {value: 0x8e5d, lo: 0xb0, hi: 0xb0}, {value: 0xe439, lo: 0xb1, hi: 0xb6}, {value: 0x8e7d, lo: 0xb7, hi: 0xb9}, {value: 0xe4f9, lo: 0xba, hi: 0xba}, {value: 0x8edd, lo: 0xbb, hi: 0xbb}, {value: 0xe519, lo: 0xbc, hi: 0xbf}, // Block 0xfd, offset 0x730 {value: 0x0020, lo: 0x10}, {value: 0x937d, lo: 0x80, hi: 0x80}, {value: 0xf099, lo: 0x81, hi: 0x86}, {value: 0x939d, lo: 0x87, hi: 0x8a}, {value: 0xd9f9, lo: 0x8b, hi: 0x8b}, {value: 0xf159, lo: 0x8c, hi: 0x96}, {value: 0x941d, lo: 0x97, hi: 0x97}, {value: 0xf2b9, lo: 0x98, hi: 0xa3}, {value: 0x943d, lo: 0xa4, hi: 0xa6}, {value: 0xf439, lo: 0xa7, hi: 0xaa}, {value: 0x949d, lo: 0xab, hi: 0xab}, {value: 0xf4b9, lo: 0xac, hi: 0xac}, {value: 0x94bd, lo: 0xad, hi: 0xad}, {value: 0xf4d9, lo: 0xae, hi: 0xaf}, {value: 0x94dd, lo: 0xb0, hi: 0xb1}, {value: 0xf519, lo: 0xb2, hi: 0xbe}, {value: 0x2040, lo: 0xbf, hi: 0xbf}, // Block 0xfe, offset 0x741 {value: 0x0000, lo: 0x04}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0340, lo: 0x81, hi: 0x81}, {value: 0x0040, lo: 0x82, hi: 0x9f}, {value: 0x0340, lo: 0xa0, hi: 0xbf}, // Block 0xff, offset 0x746 {value: 0x0000, lo: 0x01}, {value: 0x0340, lo: 0x80, hi: 0xbf}, // Block 0x100, offset 0x748 {value: 0x0000, lo: 0x01}, {value: 0x33c0, lo: 0x80, hi: 0xbf}, // Block 0x101, offset 0x74a {value: 0x0000, lo: 0x02}, {value: 0x33c0, lo: 0x80, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, } // Total table size 41662 bytes (40KiB); checksum: 355A58A4 ================================================ FILE: vendor/golang.org/x/net/idna/trie.go ================================================ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. // Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package idna // Sparse block handling code. type valueRange struct { value uint16 // header: value:stride lo, hi byte // header: lo:n } type sparseBlocks struct { values []valueRange offset []uint16 } var idnaSparse = sparseBlocks{ values: idnaSparseValues[:], offset: idnaSparseOffset[:], } // Don't use newIdnaTrie to avoid unconditional linking in of the table. var trie = &idnaTrie{} // lookup determines the type of block n and looks up the value for b. // For n < t.cutoff, the block is a simple lookup table. Otherwise, the block // is a list of ranges with an accompanying value. Given a matching range r, // the value for b is by r.value + (b - r.lo) * stride. func (t *sparseBlocks) lookup(n uint32, b byte) uint16 { offset := t.offset[n] header := t.values[offset] lo := offset + 1 hi := lo + uint16(header.lo) for lo < hi { m := lo + (hi-lo)/2 r := t.values[m] if r.lo <= b && b <= r.hi { return r.value + uint16(b-r.lo)*header.value } if b < r.lo { hi = m } else { lo = m + 1 } } return 0 } ================================================ FILE: vendor/golang.org/x/net/idna/trie12.0.0.go ================================================ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. // Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build !go1.16 package idna // appendMapping appends the mapping for the respective rune. isMapped must be // true. A mapping is a categorization of a rune as defined in UTS #46. func (c info) appendMapping(b []byte, s string) []byte { index := int(c >> indexShift) if c&xorBit == 0 { s := mappings[index:] return append(b, s[1:s[0]+1]...) } b = append(b, s...) if c&inlineXOR == inlineXOR { // TODO: support and handle two-byte inline masks b[len(b)-1] ^= byte(index) } else { for p := len(b) - int(xorData[index]); p < len(b); p++ { index++ b[p] ^= xorData[index] } } return b } ================================================ FILE: vendor/golang.org/x/net/idna/trie13.0.0.go ================================================ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. // Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build go1.16 package idna // appendMapping appends the mapping for the respective rune. isMapped must be // true. A mapping is a categorization of a rune as defined in UTS #46. func (c info) appendMapping(b []byte, s string) []byte { index := int(c >> indexShift) if c&xorBit == 0 { p := index return append(b, mappings[mappingIndex[p]:mappingIndex[p+1]]...) } b = append(b, s...) if c&inlineXOR == inlineXOR { // TODO: support and handle two-byte inline masks b[len(b)-1] ^= byte(index) } else { for p := len(b) - int(xorData[index]); p < len(b); p++ { index++ b[p] ^= xorData[index] } } return b } ================================================ FILE: vendor/golang.org/x/net/idna/trieval.go ================================================ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. package idna // This file contains definitions for interpreting the trie value of the idna // trie generated by "go run gen*.go". It is shared by both the generator // program and the resultant package. Sharing is achieved by the generator // copying gen_trieval.go to trieval.go and changing what's above this comment. // info holds information from the IDNA mapping table for a single rune. It is // the value returned by a trie lookup. In most cases, all information fits in // a 16-bit value. For mappings, this value may contain an index into a slice // with the mapped string. Such mappings can consist of the actual mapped value // or an XOR pattern to be applied to the bytes of the UTF8 encoding of the // input rune. This technique is used by the cases packages and reduces the // table size significantly. // // The per-rune values have the following format: // // if mapped { // if inlinedXOR { // 15..13 inline XOR marker // 12..11 unused // 10..3 inline XOR mask // } else { // 15..3 index into xor or mapping table // } // } else { // 15..14 unused // 13 mayNeedNorm // 12..11 attributes // 10..8 joining type // 7..3 category type // } // 2 use xor pattern // 1..0 mapped category // // See the definitions below for a more detailed description of the various // bits. type info uint16 const ( catSmallMask = 0x3 catBigMask = 0xF8 indexShift = 3 xorBit = 0x4 // interpret the index as an xor pattern inlineXOR = 0xE000 // These bits are set if the XOR pattern is inlined. joinShift = 8 joinMask = 0x07 // Attributes attributesMask = 0x1800 viramaModifier = 0x1800 modifier = 0x1000 rtl = 0x0800 mayNeedNorm = 0x2000 ) // A category corresponds to a category defined in the IDNA mapping table. type category uint16 const ( unknown category = 0 // not currently defined in unicode. mapped category = 1 disallowedSTD3Mapped category = 2 deviation category = 3 ) const ( valid category = 0x08 validNV8 category = 0x18 validXV8 category = 0x28 disallowed category = 0x40 disallowedSTD3Valid category = 0x80 ignored category = 0xC0 ) // join types and additional rune information const ( joiningL = (iota + 1) joiningD joiningT joiningR //the following types are derived during processing joinZWJ joinZWNJ joinVirama numJoinTypes ) func (c info) isMapped() bool { return c&0x3 != 0 } func (c info) category() category { small := c & catSmallMask if small != 0 { return category(small) } return category(c & catBigMask) } func (c info) joinType() info { if c.isMapped() { return 0 } return (c >> joinShift) & joinMask } func (c info) isModifier() bool { return c&(modifier|catSmallMask) == modifier } func (c info) isViramaModifier() bool { return c&(attributesMask|catSmallMask) == viramaModifier } ================================================ FILE: vendor/golang.org/x/net/internal/httpcommon/ascii.go ================================================ // Copyright 2025 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package httpcommon import "strings" // The HTTP protocols are defined in terms of ASCII, not Unicode. This file // contains helper functions which may use Unicode-aware functions which would // otherwise be unsafe and could introduce vulnerabilities if used improperly. // asciiEqualFold is strings.EqualFold, ASCII only. It reports whether s and t // are equal, ASCII-case-insensitively. func asciiEqualFold(s, t string) bool { if len(s) != len(t) { return false } for i := 0; i < len(s); i++ { if lower(s[i]) != lower(t[i]) { return false } } return true } // lower returns the ASCII lowercase version of b. func lower(b byte) byte { if 'A' <= b && b <= 'Z' { return b + ('a' - 'A') } return b } // isASCIIPrint returns whether s is ASCII and printable according to // https://tools.ietf.org/html/rfc20#section-4.2. func isASCIIPrint(s string) bool { for i := 0; i < len(s); i++ { if s[i] < ' ' || s[i] > '~' { return false } } return true } // asciiToLower returns the lowercase version of s if s is ASCII and printable, // and whether or not it was. func asciiToLower(s string) (lower string, ok bool) { if !isASCIIPrint(s) { return "", false } return strings.ToLower(s), true } ================================================ FILE: vendor/golang.org/x/net/internal/httpcommon/headermap.go ================================================ // Copyright 2025 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package httpcommon import ( "net/textproto" "sync" ) var ( commonBuildOnce sync.Once commonLowerHeader map[string]string // Go-Canonical-Case -> lower-case commonCanonHeader map[string]string // lower-case -> Go-Canonical-Case ) func buildCommonHeaderMapsOnce() { commonBuildOnce.Do(buildCommonHeaderMaps) } func buildCommonHeaderMaps() { common := []string{ "accept", "accept-charset", "accept-encoding", "accept-language", "accept-ranges", "age", "access-control-allow-credentials", "access-control-allow-headers", "access-control-allow-methods", "access-control-allow-origin", "access-control-expose-headers", "access-control-max-age", "access-control-request-headers", "access-control-request-method", "allow", "authorization", "cache-control", "content-disposition", "content-encoding", "content-language", "content-length", "content-location", "content-range", "content-type", "cookie", "date", "etag", "expect", "expires", "from", "host", "if-match", "if-modified-since", "if-none-match", "if-unmodified-since", "last-modified", "link", "location", "max-forwards", "origin", "proxy-authenticate", "proxy-authorization", "range", "referer", "refresh", "retry-after", "server", "set-cookie", "strict-transport-security", "trailer", "transfer-encoding", "user-agent", "vary", "via", "www-authenticate", "x-forwarded-for", "x-forwarded-proto", } commonLowerHeader = make(map[string]string, len(common)) commonCanonHeader = make(map[string]string, len(common)) for _, v := range common { chk := textproto.CanonicalMIMEHeaderKey(v) commonLowerHeader[chk] = v commonCanonHeader[v] = chk } } // LowerHeader returns the lowercase form of a header name, // used on the wire for HTTP/2 and HTTP/3 requests. func LowerHeader(v string) (lower string, ascii bool) { buildCommonHeaderMapsOnce() if s, ok := commonLowerHeader[v]; ok { return s, true } return asciiToLower(v) } // CanonicalHeader canonicalizes a header name. (For example, "host" becomes "Host".) func CanonicalHeader(v string) string { buildCommonHeaderMapsOnce() if s, ok := commonCanonHeader[v]; ok { return s } return textproto.CanonicalMIMEHeaderKey(v) } // CachedCanonicalHeader returns the canonical form of a well-known header name. func CachedCanonicalHeader(v string) (string, bool) { buildCommonHeaderMapsOnce() s, ok := commonCanonHeader[v] return s, ok } ================================================ FILE: vendor/golang.org/x/net/internal/httpcommon/request.go ================================================ // Copyright 2025 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package httpcommon import ( "context" "errors" "fmt" "net/http/httptrace" "net/textproto" "net/url" "sort" "strconv" "strings" "golang.org/x/net/http/httpguts" "golang.org/x/net/http2/hpack" ) var ( ErrRequestHeaderListSize = errors.New("request header list larger than peer's advertised limit") ) // Request is a subset of http.Request. // It'd be simpler to pass an *http.Request, of course, but we can't depend on net/http // without creating a dependency cycle. type Request struct { URL *url.URL Method string Host string Header map[string][]string Trailer map[string][]string ActualContentLength int64 // 0 means 0, -1 means unknown } // EncodeHeadersParam is parameters to EncodeHeaders. type EncodeHeadersParam struct { Request Request // AddGzipHeader indicates that an "accept-encoding: gzip" header should be // added to the request. AddGzipHeader bool // PeerMaxHeaderListSize, when non-zero, is the peer's MAX_HEADER_LIST_SIZE setting. PeerMaxHeaderListSize uint64 // DefaultUserAgent is the User-Agent header to send when the request // neither contains a User-Agent nor disables it. DefaultUserAgent string } // EncodeHeadersResult is the result of EncodeHeaders. type EncodeHeadersResult struct { HasBody bool HasTrailers bool } // EncodeHeaders constructs request headers common to HTTP/2 and HTTP/3. // It validates a request and calls headerf with each pseudo-header and header // for the request. // The headerf function is called with the validated, canonicalized header name. func EncodeHeaders(ctx context.Context, param EncodeHeadersParam, headerf func(name, value string)) (res EncodeHeadersResult, _ error) { req := param.Request // Check for invalid connection-level headers. if err := checkConnHeaders(req.Header); err != nil { return res, err } if req.URL == nil { return res, errors.New("Request.URL is nil") } host := req.Host if host == "" { host = req.URL.Host } host, err := httpguts.PunycodeHostPort(host) if err != nil { return res, err } if !httpguts.ValidHostHeader(host) { return res, errors.New("invalid Host header") } // isNormalConnect is true if this is a non-extended CONNECT request. isNormalConnect := false var protocol string if vv := req.Header[":protocol"]; len(vv) > 0 { protocol = vv[0] } if req.Method == "CONNECT" && protocol == "" { isNormalConnect = true } else if protocol != "" && req.Method != "CONNECT" { return res, errors.New("invalid :protocol header in non-CONNECT request") } // Validate the path, except for non-extended CONNECT requests which have no path. var path string if !isNormalConnect { path = req.URL.RequestURI() if !validPseudoPath(path) { orig := path path = strings.TrimPrefix(path, req.URL.Scheme+"://"+host) if !validPseudoPath(path) { if req.URL.Opaque != "" { return res, fmt.Errorf("invalid request :path %q from URL.Opaque = %q", orig, req.URL.Opaque) } else { return res, fmt.Errorf("invalid request :path %q", orig) } } } } // Check for any invalid headers+trailers and return an error before we // potentially pollute our hpack state. (We want to be able to // continue to reuse the hpack encoder for future requests) if err := validateHeaders(req.Header); err != "" { return res, fmt.Errorf("invalid HTTP header %s", err) } if err := validateHeaders(req.Trailer); err != "" { return res, fmt.Errorf("invalid HTTP trailer %s", err) } trailers, err := commaSeparatedTrailers(req.Trailer) if err != nil { return res, err } enumerateHeaders := func(f func(name, value string)) { // 8.1.2.3 Request Pseudo-Header Fields // The :path pseudo-header field includes the path and query parts of the // target URI (the path-absolute production and optionally a '?' character // followed by the query production, see Sections 3.3 and 3.4 of // [RFC3986]). f(":authority", host) m := req.Method if m == "" { m = "GET" } f(":method", m) if !isNormalConnect { f(":path", path) f(":scheme", req.URL.Scheme) } if protocol != "" { f(":protocol", protocol) } if trailers != "" { f("trailer", trailers) } var didUA bool for k, vv := range req.Header { if asciiEqualFold(k, "host") || asciiEqualFold(k, "content-length") { // Host is :authority, already sent. // Content-Length is automatic, set below. continue } else if asciiEqualFold(k, "connection") || asciiEqualFold(k, "proxy-connection") || asciiEqualFold(k, "transfer-encoding") || asciiEqualFold(k, "upgrade") || asciiEqualFold(k, "keep-alive") { // Per 8.1.2.2 Connection-Specific Header // Fields, don't send connection-specific // fields. We have already checked if any // are error-worthy so just ignore the rest. continue } else if asciiEqualFold(k, "user-agent") { // Match Go's http1 behavior: at most one // User-Agent. If set to nil or empty string, // then omit it. Otherwise if not mentioned, // include the default (below). didUA = true if len(vv) < 1 { continue } vv = vv[:1] if vv[0] == "" { continue } } else if asciiEqualFold(k, "cookie") { // Per 8.1.2.5 To allow for better compression efficiency, the // Cookie header field MAY be split into separate header fields, // each with one or more cookie-pairs. for _, v := range vv { for { p := strings.IndexByte(v, ';') if p < 0 { break } f("cookie", v[:p]) p++ // strip space after semicolon if any. for p+1 <= len(v) && v[p] == ' ' { p++ } v = v[p:] } if len(v) > 0 { f("cookie", v) } } continue } else if k == ":protocol" { // :protocol pseudo-header was already sent above. continue } for _, v := range vv { f(k, v) } } if shouldSendReqContentLength(req.Method, req.ActualContentLength) { f("content-length", strconv.FormatInt(req.ActualContentLength, 10)) } if param.AddGzipHeader { f("accept-encoding", "gzip") } if !didUA { f("user-agent", param.DefaultUserAgent) } } // Do a first pass over the headers counting bytes to ensure // we don't exceed cc.peerMaxHeaderListSize. This is done as a // separate pass before encoding the headers to prevent // modifying the hpack state. if param.PeerMaxHeaderListSize > 0 { hlSize := uint64(0) enumerateHeaders(func(name, value string) { hf := hpack.HeaderField{Name: name, Value: value} hlSize += uint64(hf.Size()) }) if hlSize > param.PeerMaxHeaderListSize { return res, ErrRequestHeaderListSize } } trace := httptrace.ContextClientTrace(ctx) // Header list size is ok. Write the headers. enumerateHeaders(func(name, value string) { name, ascii := LowerHeader(name) if !ascii { // Skip writing invalid headers. Per RFC 7540, Section 8.1.2, header // field names have to be ASCII characters (just as in HTTP/1.x). return } headerf(name, value) if trace != nil && trace.WroteHeaderField != nil { trace.WroteHeaderField(name, []string{value}) } }) res.HasBody = req.ActualContentLength != 0 res.HasTrailers = trailers != "" return res, nil } // IsRequestGzip reports whether we should add an Accept-Encoding: gzip header // for a request. func IsRequestGzip(method string, header map[string][]string, disableCompression bool) bool { // TODO(bradfitz): this is a copy of the logic in net/http. Unify somewhere? if !disableCompression && len(header["Accept-Encoding"]) == 0 && len(header["Range"]) == 0 && method != "HEAD" { // Request gzip only, not deflate. Deflate is ambiguous and // not as universally supported anyway. // See: https://zlib.net/zlib_faq.html#faq39 // // Note that we don't request this for HEAD requests, // due to a bug in nginx: // http://trac.nginx.org/nginx/ticket/358 // https://golang.org/issue/5522 // // We don't request gzip if the request is for a range, since // auto-decoding a portion of a gzipped document will just fail // anyway. See https://golang.org/issue/8923 return true } return false } // checkConnHeaders checks whether req has any invalid connection-level headers. // // https://www.rfc-editor.org/rfc/rfc9114.html#section-4.2-3 // https://www.rfc-editor.org/rfc/rfc9113.html#section-8.2.2-1 // // Certain headers are special-cased as okay but not transmitted later. // For example, we allow "Transfer-Encoding: chunked", but drop the header when encoding. func checkConnHeaders(h map[string][]string) error { if vv := h["Upgrade"]; len(vv) > 0 && (vv[0] != "" && vv[0] != "chunked") { return fmt.Errorf("invalid Upgrade request header: %q", vv) } if vv := h["Transfer-Encoding"]; len(vv) > 0 && (len(vv) > 1 || vv[0] != "" && vv[0] != "chunked") { return fmt.Errorf("invalid Transfer-Encoding request header: %q", vv) } if vv := h["Connection"]; len(vv) > 0 && (len(vv) > 1 || vv[0] != "" && !asciiEqualFold(vv[0], "close") && !asciiEqualFold(vv[0], "keep-alive")) { return fmt.Errorf("invalid Connection request header: %q", vv) } return nil } func commaSeparatedTrailers(trailer map[string][]string) (string, error) { keys := make([]string, 0, len(trailer)) for k := range trailer { k = CanonicalHeader(k) switch k { case "Transfer-Encoding", "Trailer", "Content-Length": return "", fmt.Errorf("invalid Trailer key %q", k) } keys = append(keys, k) } if len(keys) > 0 { sort.Strings(keys) return strings.Join(keys, ","), nil } return "", nil } // validPseudoPath reports whether v is a valid :path pseudo-header // value. It must be either: // // - a non-empty string starting with '/' // - the string '*', for OPTIONS requests. // // For now this is only used a quick check for deciding when to clean // up Opaque URLs before sending requests from the Transport. // See golang.org/issue/16847 // // We used to enforce that the path also didn't start with "//", but // Google's GFE accepts such paths and Chrome sends them, so ignore // that part of the spec. See golang.org/issue/19103. func validPseudoPath(v string) bool { return (len(v) > 0 && v[0] == '/') || v == "*" } func validateHeaders(hdrs map[string][]string) string { for k, vv := range hdrs { if !httpguts.ValidHeaderFieldName(k) && k != ":protocol" { return fmt.Sprintf("name %q", k) } for _, v := range vv { if !httpguts.ValidHeaderFieldValue(v) { // Don't include the value in the error, // because it may be sensitive. return fmt.Sprintf("value for header %q", k) } } } return "" } // shouldSendReqContentLength reports whether we should send // a "content-length" request header. This logic is basically a copy of the net/http // transferWriter.shouldSendContentLength. // The contentLength is the corrected contentLength (so 0 means actually 0, not unknown). // -1 means unknown. func shouldSendReqContentLength(method string, contentLength int64) bool { if contentLength > 0 { return true } if contentLength < 0 { return false } // For zero bodies, whether we send a content-length depends on the method. // It also kinda doesn't matter for http2 either way, with END_STREAM. switch method { case "POST", "PUT", "PATCH": return true default: return false } } // ServerRequestParam is parameters to NewServerRequest. type ServerRequestParam struct { Method string Scheme, Authority, Path string Protocol string Header map[string][]string } // ServerRequestResult is the result of NewServerRequest. type ServerRequestResult struct { // Various http.Request fields. URL *url.URL RequestURI string Trailer map[string][]string NeedsContinue bool // client provided an "Expect: 100-continue" header // If the request should be rejected, this is a short string suitable for passing // to the http2 package's CountError function. // It might be a bit odd to return errors this way rather than returning an error, // but this ensures we don't forget to include a CountError reason. InvalidReason string } func NewServerRequest(rp ServerRequestParam) ServerRequestResult { needsContinue := httpguts.HeaderValuesContainsToken(rp.Header["Expect"], "100-continue") if needsContinue { delete(rp.Header, "Expect") } // Merge Cookie headers into one "; "-delimited value. if cookies := rp.Header["Cookie"]; len(cookies) > 1 { rp.Header["Cookie"] = []string{strings.Join(cookies, "; ")} } // Setup Trailers var trailer map[string][]string for _, v := range rp.Header["Trailer"] { for _, key := range strings.Split(v, ",") { key = textproto.CanonicalMIMEHeaderKey(textproto.TrimString(key)) switch key { case "Transfer-Encoding", "Trailer", "Content-Length": // Bogus. (copy of http1 rules) // Ignore. default: if trailer == nil { trailer = make(map[string][]string) } trailer[key] = nil } } } delete(rp.Header, "Trailer") // "':authority' MUST NOT include the deprecated userinfo subcomponent // for "http" or "https" schemed URIs." // https://www.rfc-editor.org/rfc/rfc9113.html#section-8.3.1-2.3.8 if strings.IndexByte(rp.Authority, '@') != -1 && (rp.Scheme == "http" || rp.Scheme == "https") { return ServerRequestResult{ InvalidReason: "userinfo_in_authority", } } var url_ *url.URL var requestURI string if rp.Method == "CONNECT" && rp.Protocol == "" { url_ = &url.URL{Host: rp.Authority} requestURI = rp.Authority // mimic HTTP/1 server behavior } else { var err error url_, err = url.ParseRequestURI(rp.Path) if err != nil { return ServerRequestResult{ InvalidReason: "bad_path", } } requestURI = rp.Path } return ServerRequestResult{ URL: url_, NeedsContinue: needsContinue, RequestURI: requestURI, Trailer: trailer, } } ================================================ FILE: vendor/golang.org/x/net/internal/httpsfv/httpsfv.go ================================================ // Copyright 2025 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package httpsfv provides functionality for dealing with HTTP Structured // Field Values. package httpsfv import ( "slices" "strconv" "strings" "time" "unicode/utf8" ) func isLCAlpha(b byte) bool { return (b >= 'a' && b <= 'z') } func isAlpha(b byte) bool { return isLCAlpha(b) || (b >= 'A' && b <= 'Z') } func isDigit(b byte) bool { return b >= '0' && b <= '9' } func isVChar(b byte) bool { return b >= 0x21 && b <= 0x7e } func isSP(b byte) bool { return b == 0x20 } func isTChar(b byte) bool { if isAlpha(b) || isDigit(b) { return true } return slices.Contains([]byte{'!', '#', '$', '%', '&', '\'', '*', '+', '-', '.', '^', '_', '`', '|', '~'}, b) } func countLeftWhitespace(s string) int { i := 0 for _, ch := range []byte(s) { if ch != ' ' && ch != '\t' { break } i++ } return i } // https://www.rfc-editor.org/rfc/rfc4648#section-8. func decOctetHex(ch1, ch2 byte) (ch byte, ok bool) { decBase16 := func(in byte) (out byte, ok bool) { if !isDigit(in) && !(in >= 'a' && in <= 'f') { return 0, false } if isDigit(in) { return in - '0', true } return in - 'a' + 10, true } if ch1, ok = decBase16(ch1); !ok { return 0, ok } if ch2, ok = decBase16(ch2); !ok { return 0, ok } return ch1<<4 | ch2, true } // ParseList parses a list from a given HTTP Structured Field Values. // // Given an HTTP SFV string that represents a list, it will call the given // function using each of the members and parameters contained in the list. // This allows the caller to extract information out of the list. // // This function will return once it encounters the end of the string, or // something that is not a list. If it cannot consume the entire given // string, the ok value returned will be false. // // https://www.rfc-editor.org/rfc/rfc9651.html#name-parsing-a-list. func ParseList(s string, f func(member, param string)) (ok bool) { for len(s) != 0 { var member, param string if len(s) != 0 && s[0] == '(' { if member, s, ok = consumeBareInnerList(s, nil); !ok { return ok } } else { if member, s, ok = consumeBareItem(s); !ok { return ok } } if param, s, ok = consumeParameter(s, nil); !ok { return ok } if f != nil { f(member, param) } s = s[countLeftWhitespace(s):] if len(s) == 0 { break } if s[0] != ',' { return false } s = s[1:] s = s[countLeftWhitespace(s):] if len(s) == 0 { return false } } return true } // consumeBareInnerList consumes an inner list // (https://www.rfc-editor.org/rfc/rfc9651.html#name-parsing-an-inner-list), // except for the inner list's top-most parameter. // For example, given `(a;b c;d);e`, it will consume only `(a;b c;d)`. func consumeBareInnerList(s string, f func(bareItem, param string)) (consumed, rest string, ok bool) { if len(s) == 0 || s[0] != '(' { return "", s, false } rest = s[1:] for len(rest) != 0 { var bareItem, param string rest = rest[countLeftWhitespace(rest):] if len(rest) != 0 && rest[0] == ')' { rest = rest[1:] break } if bareItem, rest, ok = consumeBareItem(rest); !ok { return "", s, ok } if param, rest, ok = consumeParameter(rest, nil); !ok { return "", s, ok } if len(rest) == 0 || (rest[0] != ')' && !isSP(rest[0])) { return "", s, false } if f != nil { f(bareItem, param) } } return s[:len(s)-len(rest)], rest, true } // ParseBareInnerList parses a bare inner list from a given HTTP Structured // Field Values. // // We define a bare inner list as an inner list // (https://www.rfc-editor.org/rfc/rfc9651.html#name-parsing-an-inner-list), // without the top-most parameter of the inner list. For example, given the // inner list `(a;b c;d);e`, the bare inner list would be `(a;b c;d)`. // // Given an HTTP SFV string that represents a bare inner list, it will call the // given function using each of the bare item and parameter within the bare // inner list. This allows the caller to extract information out of the bare // inner list. // // This function will return once it encounters the end of the bare inner list, // or something that is not a bare inner list. If it cannot consume the entire // given string, the ok value returned will be false. func ParseBareInnerList(s string, f func(bareItem, param string)) (ok bool) { _, rest, ok := consumeBareInnerList(s, f) return rest == "" && ok } // https://www.rfc-editor.org/rfc/rfc9651.html#name-parsing-an-item. func consumeItem(s string, f func(bareItem, param string)) (consumed, rest string, ok bool) { var bareItem, param string if bareItem, rest, ok = consumeBareItem(s); !ok { return "", s, ok } if param, rest, ok = consumeParameter(rest, nil); !ok { return "", s, ok } if f != nil { f(bareItem, param) } return s[:len(s)-len(rest)], rest, true } // ParseItem parses an item from a given HTTP Structured Field Values. // // Given an HTTP SFV string that represents an item, it will call the given // function once, with the bare item and the parameter of the item. This allows // the caller to extract information out of the item. // // This function will return once it encounters the end of the string, or // something that is not an item. If it cannot consume the entire given // string, the ok value returned will be false. // // https://www.rfc-editor.org/rfc/rfc9651.html#name-parsing-an-item. func ParseItem(s string, f func(bareItem, param string)) (ok bool) { _, rest, ok := consumeItem(s, f) return rest == "" && ok } // ParseDictionary parses a dictionary from a given HTTP Structured Field // Values. // // Given an HTTP SFV string that represents a dictionary, it will call the // given function using each of the keys, values, and parameters contained in // the dictionary. This allows the caller to extract information out of the // dictionary. // // This function will return once it encounters the end of the string, or // something that is not a dictionary. If it cannot consume the entire given // string, the ok value returned will be false. // // https://www.rfc-editor.org/rfc/rfc9651.html#name-parsing-a-dictionary. func ParseDictionary(s string, f func(key, val, param string)) (ok bool) { for len(s) != 0 { var key, val, param string val = "?1" // Default value for empty val is boolean true. if key, s, ok = consumeKey(s); !ok { return ok } if len(s) != 0 && s[0] == '=' { s = s[1:] if len(s) != 0 && s[0] == '(' { if val, s, ok = consumeBareInnerList(s, nil); !ok { return ok } } else { if val, s, ok = consumeBareItem(s); !ok { return ok } } } if param, s, ok = consumeParameter(s, nil); !ok { return ok } if f != nil { f(key, val, param) } s = s[countLeftWhitespace(s):] if len(s) == 0 { break } if s[0] == ',' { s = s[1:] } s = s[countLeftWhitespace(s):] if len(s) == 0 { return false } } return true } // https://www.rfc-editor.org/rfc/rfc9651.html#parse-param. func consumeParameter(s string, f func(key, val string)) (consumed, rest string, ok bool) { rest = s for len(rest) != 0 { var key, val string val = "?1" // Default value for empty val is boolean true. if rest[0] != ';' { break } rest = rest[1:] rest = rest[countLeftWhitespace(rest):] key, rest, ok = consumeKey(rest) if !ok { return "", s, ok } if len(rest) != 0 && rest[0] == '=' { rest = rest[1:] val, rest, ok = consumeBareItem(rest) if !ok { return "", s, ok } } if f != nil { f(key, val) } } return s[:len(s)-len(rest)], rest, true } // ParseParameter parses a parameter from a given HTTP Structured Field Values. // // Given an HTTP SFV string that represents a parameter, it will call the given // function using each of the keys and values contained in the parameter. This // allows the caller to extract information out of the parameter. // // This function will return once it encounters the end of the string, or // something that is not a parameter. If it cannot consume the entire given // string, the ok value returned will be false. // // https://www.rfc-editor.org/rfc/rfc9651.html#parse-param. func ParseParameter(s string, f func(key, val string)) (ok bool) { _, rest, ok := consumeParameter(s, f) return rest == "" && ok } // https://www.rfc-editor.org/rfc/rfc9651.html#name-parsing-a-key. func consumeKey(s string) (consumed, rest string, ok bool) { if len(s) == 0 || (!isLCAlpha(s[0]) && s[0] != '*') { return "", s, false } i := 0 for _, ch := range []byte(s) { if !isLCAlpha(ch) && !isDigit(ch) && !slices.Contains([]byte("_-.*"), ch) { break } i++ } return s[:i], s[i:], true } // https://www.rfc-editor.org/rfc/rfc9651.html#name-parsing-an-integer-or-decim. func consumeIntegerOrDecimal(s string) (consumed, rest string, ok bool) { var i, signOffset, periodIndex int var isDecimal bool if i < len(s) && s[i] == '-' { i++ signOffset++ } if i >= len(s) { return "", s, false } if !isDigit(s[i]) { return "", s, false } for i < len(s) { ch := s[i] if isDigit(ch) { i++ continue } if !isDecimal && ch == '.' { if i-signOffset > 12 { return "", s, false } periodIndex = i isDecimal = true i++ continue } break } if !isDecimal && i-signOffset > 15 { return "", s, false } if isDecimal { if i-signOffset > 16 { return "", s, false } if s[i-1] == '.' { return "", s, false } if i-periodIndex-1 > 3 { return "", s, false } } return s[:i], s[i:], true } // ParseInteger parses an integer from a given HTTP Structured Field Values. // // The entire HTTP SFV string must consist of a valid integer. It returns the // parsed integer and an ok boolean value, indicating success or not. // // https://www.rfc-editor.org/rfc/rfc9651.html#name-parsing-an-integer-or-decim. func ParseInteger(s string) (parsed int64, ok bool) { if _, rest, ok := consumeIntegerOrDecimal(s); !ok || rest != "" { return 0, false } if n, err := strconv.ParseInt(s, 10, 64); err == nil { return n, true } return 0, false } // ParseDecimal parses a decimal from a given HTTP Structured Field Values. // // The entire HTTP SFV string must consist of a valid decimal. It returns the // parsed decimal and an ok boolean value, indicating success or not. // // https://www.rfc-editor.org/rfc/rfc9651.html#name-parsing-an-integer-or-decim. func ParseDecimal(s string) (parsed float64, ok bool) { if _, rest, ok := consumeIntegerOrDecimal(s); !ok || rest != "" { return 0, false } if !strings.Contains(s, ".") { return 0, false } if n, err := strconv.ParseFloat(s, 64); err == nil { return n, true } return 0, false } // https://www.rfc-editor.org/rfc/rfc9651.html#name-parsing-a-string. func consumeString(s string) (consumed, rest string, ok bool) { if len(s) == 0 || s[0] != '"' { return "", s, false } for i := 1; i < len(s); i++ { switch ch := s[i]; ch { case '\\': if i+1 >= len(s) { return "", s, false } i++ if ch = s[i]; ch != '"' && ch != '\\' { return "", s, false } case '"': return s[:i+1], s[i+1:], true default: if !isVChar(ch) && !isSP(ch) { return "", s, false } } } return "", s, false } // ParseString parses a Go string from a given HTTP Structured Field Values. // // The entire HTTP SFV string must consist of a valid string. It returns the // parsed string and an ok boolean value, indicating success or not. // // https://www.rfc-editor.org/rfc/rfc9651.html#name-parsing-a-string. func ParseString(s string) (parsed string, ok bool) { if _, rest, ok := consumeString(s); !ok || rest != "" { return "", false } return s[1 : len(s)-1], true } // https://www.rfc-editor.org/rfc/rfc9651.html#name-parsing-a-token func consumeToken(s string) (consumed, rest string, ok bool) { if len(s) == 0 || (!isAlpha(s[0]) && s[0] != '*') { return "", s, false } i := 0 for _, ch := range []byte(s) { if !isTChar(ch) && !slices.Contains([]byte(":/"), ch) { break } i++ } return s[:i], s[i:], true } // ParseToken parses a token from a given HTTP Structured Field Values. // // The entire HTTP SFV string must consist of a valid token. It returns the // parsed token and an ok boolean value, indicating success or not. // // https://www.rfc-editor.org/rfc/rfc9651.html#name-parsing-a-token func ParseToken(s string) (parsed string, ok bool) { if _, rest, ok := consumeToken(s); !ok || rest != "" { return "", false } return s, true } // https://www.rfc-editor.org/rfc/rfc9651.html#name-parsing-a-byte-sequence. func consumeByteSequence(s string) (consumed, rest string, ok bool) { if len(s) == 0 || s[0] != ':' { return "", s, false } for i := 1; i < len(s); i++ { if ch := s[i]; ch == ':' { return s[:i+1], s[i+1:], true } if ch := s[i]; !isAlpha(ch) && !isDigit(ch) && !slices.Contains([]byte("+/="), ch) { return "", s, false } } return "", s, false } // ParseByteSequence parses a byte sequence from a given HTTP Structured Field // Values. // // The entire HTTP SFV string must consist of a valid byte sequence. It returns // the parsed byte sequence and an ok boolean value, indicating success or not. // // https://www.rfc-editor.org/rfc/rfc9651.html#name-parsing-a-byte-sequence. func ParseByteSequence(s string) (parsed []byte, ok bool) { if _, rest, ok := consumeByteSequence(s); !ok || rest != "" { return nil, false } return []byte(s[1 : len(s)-1]), true } // https://www.rfc-editor.org/rfc/rfc9651.html#name-parsing-a-boolean. func consumeBoolean(s string) (consumed, rest string, ok bool) { if len(s) >= 2 && (s[:2] == "?0" || s[:2] == "?1") { return s[:2], s[2:], true } return "", s, false } // ParseBoolean parses a boolean from a given HTTP Structured Field Values. // // The entire HTTP SFV string must consist of a valid boolean. It returns the // parsed boolean and an ok boolean value, indicating success or not. // // https://www.rfc-editor.org/rfc/rfc9651.html#name-parsing-a-boolean. func ParseBoolean(s string) (parsed bool, ok bool) { if _, rest, ok := consumeBoolean(s); !ok || rest != "" { return false, false } return s == "?1", true } // https://www.rfc-editor.org/rfc/rfc9651.html#name-parsing-a-date. func consumeDate(s string) (consumed, rest string, ok bool) { if len(s) == 0 || s[0] != '@' { return "", s, false } if _, rest, ok = consumeIntegerOrDecimal(s[1:]); !ok { return "", s, ok } consumed = s[:len(s)-len(rest)] if slices.Contains([]byte(consumed), '.') { return "", s, false } return consumed, rest, ok } // ParseDate parses a date from a given HTTP Structured Field Values. // // The entire HTTP SFV string must consist of a valid date. It returns the // parsed date and an ok boolean value, indicating success or not. // // https://www.rfc-editor.org/rfc/rfc9651.html#name-parsing-a-date. func ParseDate(s string) (parsed time.Time, ok bool) { if _, rest, ok := consumeDate(s); !ok || rest != "" { return time.Time{}, false } if n, ok := ParseInteger(s[1:]); !ok { return time.Time{}, false } else { return time.Unix(n, 0), true } } // https://www.rfc-editor.org/rfc/rfc9651.html#name-parsing-a-display-string. func consumeDisplayString(s string) (consumed, rest string, ok bool) { // To prevent excessive allocation, especially when input is large, we // maintain a buffer of 4 bytes to keep track of the last rune we // encounter. This way, we can validate that the display string conforms to // UTF-8 without actually building the whole string. var lastRune [4]byte var runeLen int isPartOfValidRune := func(ch byte) bool { lastRune[runeLen] = ch runeLen++ if utf8.FullRune(lastRune[:runeLen]) { r, s := utf8.DecodeRune(lastRune[:runeLen]) if r == utf8.RuneError { return false } copy(lastRune[:], lastRune[s:runeLen]) runeLen -= s return true } return runeLen <= 4 } if len(s) <= 1 || s[:2] != `%"` { return "", s, false } i := 2 for i < len(s) { ch := s[i] if !isVChar(ch) && !isSP(ch) { return "", s, false } switch ch { case '"': if runeLen > 0 { return "", s, false } return s[:i+1], s[i+1:], true case '%': if i+2 >= len(s) { return "", s, false } if ch, ok = decOctetHex(s[i+1], s[i+2]); !ok { return "", s, ok } if ok = isPartOfValidRune(ch); !ok { return "", s, ok } i += 3 default: if ok = isPartOfValidRune(ch); !ok { return "", s, ok } i++ } } return "", s, false } // ParseDisplayString parses a display string from a given HTTP Structured // Field Values. // // The entire HTTP SFV string must consist of a valid display string. It // returns the parsed display string and an ok boolean value, indicating // success or not. // // https://www.rfc-editor.org/rfc/rfc9651.html#name-parsing-a-display-string. func ParseDisplayString(s string) (parsed string, ok bool) { if _, rest, ok := consumeDisplayString(s); !ok || rest != "" { return "", false } // consumeDisplayString() already validates that we have a valid display // string. Therefore, we can just construct the display string, without // validating it again. s = s[2 : len(s)-1] var b strings.Builder for i := 0; i < len(s); { if s[i] == '%' { decoded, _ := decOctetHex(s[i+1], s[i+2]) b.WriteByte(decoded) i += 3 continue } b.WriteByte(s[i]) i++ } return b.String(), true } // https://www.rfc-editor.org/rfc/rfc9651.html#parse-bare-item. func consumeBareItem(s string) (consumed, rest string, ok bool) { if len(s) == 0 { return "", s, false } ch := s[0] switch { case ch == '-' || isDigit(ch): return consumeIntegerOrDecimal(s) case ch == '"': return consumeString(s) case ch == '*' || isAlpha(ch): return consumeToken(s) case ch == ':': return consumeByteSequence(s) case ch == '?': return consumeBoolean(s) case ch == '@': return consumeDate(s) case ch == '%': return consumeDisplayString(s) default: return "", s, false } } ================================================ FILE: vendor/golang.org/x/net/internal/timeseries/timeseries.go ================================================ // Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package timeseries implements a time series structure for stats collection. package timeseries // import "golang.org/x/net/internal/timeseries" import ( "fmt" "log" "time" ) const ( timeSeriesNumBuckets = 64 minuteHourSeriesNumBuckets = 60 ) var timeSeriesResolutions = []time.Duration{ 1 * time.Second, 10 * time.Second, 1 * time.Minute, 10 * time.Minute, 1 * time.Hour, 6 * time.Hour, 24 * time.Hour, // 1 day 7 * 24 * time.Hour, // 1 week 4 * 7 * 24 * time.Hour, // 4 weeks 16 * 7 * 24 * time.Hour, // 16 weeks } var minuteHourSeriesResolutions = []time.Duration{ 1 * time.Second, 1 * time.Minute, } // An Observable is a kind of data that can be aggregated in a time series. type Observable interface { Multiply(ratio float64) // Multiplies the data in self by a given ratio Add(other Observable) // Adds the data from a different observation to self Clear() // Clears the observation so it can be reused. CopyFrom(other Observable) // Copies the contents of a given observation to self } // Float attaches the methods of Observable to a float64. type Float float64 // NewFloat returns a Float. func NewFloat() Observable { f := Float(0) return &f } // String returns the float as a string. func (f *Float) String() string { return fmt.Sprintf("%g", f.Value()) } // Value returns the float's value. func (f *Float) Value() float64 { return float64(*f) } func (f *Float) Multiply(ratio float64) { *f *= Float(ratio) } func (f *Float) Add(other Observable) { o := other.(*Float) *f += *o } func (f *Float) Clear() { *f = 0 } func (f *Float) CopyFrom(other Observable) { o := other.(*Float) *f = *o } // A Clock tells the current time. type Clock interface { Time() time.Time } type defaultClock int var defaultClockInstance defaultClock func (defaultClock) Time() time.Time { return time.Now() } // Information kept per level. Each level consists of a circular list of // observations. The start of the level may be derived from end and the // len(buckets) * sizeInMillis. type tsLevel struct { oldest int // index to oldest bucketed Observable newest int // index to newest bucketed Observable end time.Time // end timestamp for this level size time.Duration // duration of the bucketed Observable buckets []Observable // collections of observations provider func() Observable // used for creating new Observable } func (l *tsLevel) Clear() { l.oldest = 0 l.newest = len(l.buckets) - 1 l.end = time.Time{} for i := range l.buckets { if l.buckets[i] != nil { l.buckets[i].Clear() l.buckets[i] = nil } } } func (l *tsLevel) InitLevel(size time.Duration, numBuckets int, f func() Observable) { l.size = size l.provider = f l.buckets = make([]Observable, numBuckets) } // Keeps a sequence of levels. Each level is responsible for storing data at // a given resolution. For example, the first level stores data at a one // minute resolution while the second level stores data at a one hour // resolution. // Each level is represented by a sequence of buckets. Each bucket spans an // interval equal to the resolution of the level. New observations are added // to the last bucket. type timeSeries struct { provider func() Observable // make more Observable numBuckets int // number of buckets in each level levels []*tsLevel // levels of bucketed Observable lastAdd time.Time // time of last Observable tracked total Observable // convenient aggregation of all Observable clock Clock // Clock for getting current time pending Observable // observations not yet bucketed pendingTime time.Time // what time are we keeping in pending dirty bool // if there are pending observations } // init initializes a level according to the supplied criteria. func (ts *timeSeries) init(resolutions []time.Duration, f func() Observable, numBuckets int, clock Clock) { ts.provider = f ts.numBuckets = numBuckets ts.clock = clock ts.levels = make([]*tsLevel, len(resolutions)) for i := range resolutions { if i > 0 && resolutions[i-1] >= resolutions[i] { log.Print("timeseries: resolutions must be monotonically increasing") break } newLevel := new(tsLevel) newLevel.InitLevel(resolutions[i], ts.numBuckets, ts.provider) ts.levels[i] = newLevel } ts.Clear() } // Clear removes all observations from the time series. func (ts *timeSeries) Clear() { ts.lastAdd = time.Time{} ts.total = ts.resetObservation(ts.total) ts.pending = ts.resetObservation(ts.pending) ts.pendingTime = time.Time{} ts.dirty = false for i := range ts.levels { ts.levels[i].Clear() } } // Add records an observation at the current time. func (ts *timeSeries) Add(observation Observable) { ts.AddWithTime(observation, ts.clock.Time()) } // AddWithTime records an observation at the specified time. func (ts *timeSeries) AddWithTime(observation Observable, t time.Time) { smallBucketDuration := ts.levels[0].size if t.After(ts.lastAdd) { ts.lastAdd = t } if t.After(ts.pendingTime) { ts.advance(t) ts.mergePendingUpdates() ts.pendingTime = ts.levels[0].end ts.pending.CopyFrom(observation) ts.dirty = true } else if t.After(ts.pendingTime.Add(-1 * smallBucketDuration)) { // The observation is close enough to go into the pending bucket. // This compensates for clock skewing and small scheduling delays // by letting the update stay in the fast path. ts.pending.Add(observation) ts.dirty = true } else { ts.mergeValue(observation, t) } } // mergeValue inserts the observation at the specified time in the past into all levels. func (ts *timeSeries) mergeValue(observation Observable, t time.Time) { for _, level := range ts.levels { index := (ts.numBuckets - 1) - int(level.end.Sub(t)/level.size) if 0 <= index && index < ts.numBuckets { bucketNumber := (level.oldest + index) % ts.numBuckets if level.buckets[bucketNumber] == nil { level.buckets[bucketNumber] = level.provider() } level.buckets[bucketNumber].Add(observation) } } ts.total.Add(observation) } // mergePendingUpdates applies the pending updates into all levels. func (ts *timeSeries) mergePendingUpdates() { if ts.dirty { ts.mergeValue(ts.pending, ts.pendingTime) ts.pending = ts.resetObservation(ts.pending) ts.dirty = false } } // advance cycles the buckets at each level until the latest bucket in // each level can hold the time specified. func (ts *timeSeries) advance(t time.Time) { if !t.After(ts.levels[0].end) { return } for i := 0; i < len(ts.levels); i++ { level := ts.levels[i] if !level.end.Before(t) { break } // If the time is sufficiently far, just clear the level and advance // directly. if !t.Before(level.end.Add(level.size * time.Duration(ts.numBuckets))) { for _, b := range level.buckets { ts.resetObservation(b) } level.end = time.Unix(0, (t.UnixNano()/level.size.Nanoseconds())*level.size.Nanoseconds()) } for t.After(level.end) { level.end = level.end.Add(level.size) level.newest = level.oldest level.oldest = (level.oldest + 1) % ts.numBuckets ts.resetObservation(level.buckets[level.newest]) } t = level.end } } // Latest returns the sum of the num latest buckets from the level. func (ts *timeSeries) Latest(level, num int) Observable { now := ts.clock.Time() if ts.levels[0].end.Before(now) { ts.advance(now) } ts.mergePendingUpdates() result := ts.provider() l := ts.levels[level] index := l.newest for i := 0; i < num; i++ { if l.buckets[index] != nil { result.Add(l.buckets[index]) } if index == 0 { index = ts.numBuckets } index-- } return result } // LatestBuckets returns a copy of the num latest buckets from level. func (ts *timeSeries) LatestBuckets(level, num int) []Observable { if level < 0 || level > len(ts.levels) { log.Print("timeseries: bad level argument: ", level) return nil } if num < 0 || num >= ts.numBuckets { log.Print("timeseries: bad num argument: ", num) return nil } results := make([]Observable, num) now := ts.clock.Time() if ts.levels[0].end.Before(now) { ts.advance(now) } ts.mergePendingUpdates() l := ts.levels[level] index := l.newest for i := 0; i < num; i++ { result := ts.provider() results[i] = result if l.buckets[index] != nil { result.CopyFrom(l.buckets[index]) } if index == 0 { index = ts.numBuckets } index -= 1 } return results } // ScaleBy updates observations by scaling by factor. func (ts *timeSeries) ScaleBy(factor float64) { for _, l := range ts.levels { for i := 0; i < ts.numBuckets; i++ { l.buckets[i].Multiply(factor) } } ts.total.Multiply(factor) ts.pending.Multiply(factor) } // Range returns the sum of observations added over the specified time range. // If start or finish times don't fall on bucket boundaries of the same // level, then return values are approximate answers. func (ts *timeSeries) Range(start, finish time.Time) Observable { return ts.ComputeRange(start, finish, 1)[0] } // Recent returns the sum of observations from the last delta. func (ts *timeSeries) Recent(delta time.Duration) Observable { now := ts.clock.Time() return ts.Range(now.Add(-delta), now) } // Total returns the total of all observations. func (ts *timeSeries) Total() Observable { ts.mergePendingUpdates() return ts.total } // ComputeRange computes a specified number of values into a slice using // the observations recorded over the specified time period. The return // values are approximate if the start or finish times don't fall on the // bucket boundaries at the same level or if the number of buckets spanning // the range is not an integral multiple of num. func (ts *timeSeries) ComputeRange(start, finish time.Time, num int) []Observable { if start.After(finish) { log.Printf("timeseries: start > finish, %v>%v", start, finish) return nil } if num < 0 { log.Printf("timeseries: num < 0, %v", num) return nil } results := make([]Observable, num) for _, l := range ts.levels { if !start.Before(l.end.Add(-l.size * time.Duration(ts.numBuckets))) { ts.extract(l, start, finish, num, results) return results } } // Failed to find a level that covers the desired range. So just // extract from the last level, even if it doesn't cover the entire // desired range. ts.extract(ts.levels[len(ts.levels)-1], start, finish, num, results) return results } // RecentList returns the specified number of values in slice over the most // recent time period of the specified range. func (ts *timeSeries) RecentList(delta time.Duration, num int) []Observable { if delta < 0 { return nil } now := ts.clock.Time() return ts.ComputeRange(now.Add(-delta), now, num) } // extract returns a slice of specified number of observations from a given // level over a given range. func (ts *timeSeries) extract(l *tsLevel, start, finish time.Time, num int, results []Observable) { ts.mergePendingUpdates() srcInterval := l.size dstInterval := finish.Sub(start) / time.Duration(num) dstStart := start srcStart := l.end.Add(-srcInterval * time.Duration(ts.numBuckets)) srcIndex := 0 // Where should scanning start? if dstStart.After(srcStart) { advance := int(dstStart.Sub(srcStart) / srcInterval) srcIndex += advance srcStart = srcStart.Add(time.Duration(advance) * srcInterval) } // The i'th value is computed as show below. // interval = (finish/start)/num // i'th value = sum of observation in range // [ start + i * interval, // start + (i + 1) * interval ) for i := 0; i < num; i++ { results[i] = ts.resetObservation(results[i]) dstEnd := dstStart.Add(dstInterval) for srcIndex < ts.numBuckets && srcStart.Before(dstEnd) { srcEnd := srcStart.Add(srcInterval) if srcEnd.After(ts.lastAdd) { srcEnd = ts.lastAdd } if !srcEnd.Before(dstStart) { srcValue := l.buckets[(srcIndex+l.oldest)%ts.numBuckets] if !srcStart.Before(dstStart) && !srcEnd.After(dstEnd) { // dst completely contains src. if srcValue != nil { results[i].Add(srcValue) } } else { // dst partially overlaps src. overlapStart := maxTime(srcStart, dstStart) overlapEnd := minTime(srcEnd, dstEnd) base := srcEnd.Sub(srcStart) fraction := overlapEnd.Sub(overlapStart).Seconds() / base.Seconds() used := ts.provider() if srcValue != nil { used.CopyFrom(srcValue) } used.Multiply(fraction) results[i].Add(used) } if srcEnd.After(dstEnd) { break } } srcIndex++ srcStart = srcStart.Add(srcInterval) } dstStart = dstStart.Add(dstInterval) } } // resetObservation clears the content so the struct may be reused. func (ts *timeSeries) resetObservation(observation Observable) Observable { if observation == nil { observation = ts.provider() } else { observation.Clear() } return observation } // TimeSeries tracks data at granularities from 1 second to 16 weeks. type TimeSeries struct { timeSeries } // NewTimeSeries creates a new TimeSeries using the function provided for creating new Observable. func NewTimeSeries(f func() Observable) *TimeSeries { return NewTimeSeriesWithClock(f, defaultClockInstance) } // NewTimeSeriesWithClock creates a new TimeSeries using the function provided for creating new Observable and the clock for // assigning timestamps. func NewTimeSeriesWithClock(f func() Observable, clock Clock) *TimeSeries { ts := new(TimeSeries) ts.timeSeries.init(timeSeriesResolutions, f, timeSeriesNumBuckets, clock) return ts } // MinuteHourSeries tracks data at granularities of 1 minute and 1 hour. type MinuteHourSeries struct { timeSeries } // NewMinuteHourSeries creates a new MinuteHourSeries using the function provided for creating new Observable. func NewMinuteHourSeries(f func() Observable) *MinuteHourSeries { return NewMinuteHourSeriesWithClock(f, defaultClockInstance) } // NewMinuteHourSeriesWithClock creates a new MinuteHourSeries using the function provided for creating new Observable and the clock for // assigning timestamps. func NewMinuteHourSeriesWithClock(f func() Observable, clock Clock) *MinuteHourSeries { ts := new(MinuteHourSeries) ts.timeSeries.init(minuteHourSeriesResolutions, f, minuteHourSeriesNumBuckets, clock) return ts } func (ts *MinuteHourSeries) Minute() Observable { return ts.timeSeries.Latest(0, 60) } func (ts *MinuteHourSeries) Hour() Observable { return ts.timeSeries.Latest(1, 60) } func minTime(a, b time.Time) time.Time { if a.Before(b) { return a } return b } func maxTime(a, b time.Time) time.Time { if a.After(b) { return a } return b } ================================================ FILE: vendor/golang.org/x/net/trace/events.go ================================================ // Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package trace import ( "bytes" "fmt" "html/template" "io" "log" "net/http" "runtime" "sort" "strconv" "strings" "sync" "sync/atomic" "text/tabwriter" "time" ) const maxEventsPerLog = 100 type bucket struct { MaxErrAge time.Duration String string } var buckets = []bucket{ {0, "total"}, {10 * time.Second, "errs<10s"}, {1 * time.Minute, "errs<1m"}, {10 * time.Minute, "errs<10m"}, {1 * time.Hour, "errs<1h"}, {10 * time.Hour, "errs<10h"}, {24000 * time.Hour, "errors"}, } // RenderEvents renders the HTML page typically served at /debug/events. // It does not do any auth checking. The request may be nil. // // Most users will use the Events handler. func RenderEvents(w http.ResponseWriter, req *http.Request, sensitive bool) { now := time.Now() data := &struct { Families []string // family names Buckets []bucket Counts [][]int // eventLog count per family/bucket // Set when a bucket has been selected. Family string Bucket int EventLogs eventLogs Expanded bool }{ Buckets: buckets, } famMu.RLock() data.Families = make([]string, 0, len(families)) for name := range families { data.Families = append(data.Families, name) } famMu.RUnlock() sort.Strings(data.Families) // Count the number of eventLogs in each family for each error age. data.Counts = make([][]int, len(data.Families)) for i, name := range data.Families { // TODO(sameer): move this loop under the family lock. f := getEventFamily(name) data.Counts[i] = make([]int, len(data.Buckets)) for j, b := range data.Buckets { data.Counts[i][j] = f.Count(now, b.MaxErrAge) } } if req != nil { var ok bool data.Family, data.Bucket, ok = parseEventsArgs(req) if !ok { // No-op } else { data.EventLogs = getEventFamily(data.Family).Copy(now, buckets[data.Bucket].MaxErrAge) } if data.EventLogs != nil { defer data.EventLogs.Free() sort.Sort(data.EventLogs) } if exp, err := strconv.ParseBool(req.FormValue("exp")); err == nil { data.Expanded = exp } } famMu.RLock() defer famMu.RUnlock() if err := eventsTmpl().Execute(w, data); err != nil { log.Printf("net/trace: Failed executing template: %v", err) } } func parseEventsArgs(req *http.Request) (fam string, b int, ok bool) { fam, bStr := req.FormValue("fam"), req.FormValue("b") if fam == "" || bStr == "" { return "", 0, false } b, err := strconv.Atoi(bStr) if err != nil || b < 0 || b >= len(buckets) { return "", 0, false } return fam, b, true } // An EventLog provides a log of events associated with a specific object. type EventLog interface { // Printf formats its arguments with fmt.Sprintf and adds the // result to the event log. Printf(format string, a ...interface{}) // Errorf is like Printf, but it marks this event as an error. Errorf(format string, a ...interface{}) // Finish declares that this event log is complete. // The event log should not be used after calling this method. Finish() } // NewEventLog returns a new EventLog with the specified family name // and title. func NewEventLog(family, title string) EventLog { el := newEventLog() el.ref() el.Family, el.Title = family, title el.Start = time.Now() el.events = make([]logEntry, 0, maxEventsPerLog) el.stack = make([]uintptr, 32) n := runtime.Callers(2, el.stack) el.stack = el.stack[:n] getEventFamily(family).add(el) return el } func (el *eventLog) Finish() { getEventFamily(el.Family).remove(el) el.unref() // matches ref in New } var ( famMu sync.RWMutex families = make(map[string]*eventFamily) // family name => family ) func getEventFamily(fam string) *eventFamily { famMu.Lock() defer famMu.Unlock() f := families[fam] if f == nil { f = &eventFamily{} families[fam] = f } return f } type eventFamily struct { mu sync.RWMutex eventLogs eventLogs } func (f *eventFamily) add(el *eventLog) { f.mu.Lock() f.eventLogs = append(f.eventLogs, el) f.mu.Unlock() } func (f *eventFamily) remove(el *eventLog) { f.mu.Lock() defer f.mu.Unlock() for i, el0 := range f.eventLogs { if el == el0 { copy(f.eventLogs[i:], f.eventLogs[i+1:]) f.eventLogs = f.eventLogs[:len(f.eventLogs)-1] return } } } func (f *eventFamily) Count(now time.Time, maxErrAge time.Duration) (n int) { f.mu.RLock() defer f.mu.RUnlock() for _, el := range f.eventLogs { if el.hasRecentError(now, maxErrAge) { n++ } } return } func (f *eventFamily) Copy(now time.Time, maxErrAge time.Duration) (els eventLogs) { f.mu.RLock() defer f.mu.RUnlock() els = make(eventLogs, 0, len(f.eventLogs)) for _, el := range f.eventLogs { if el.hasRecentError(now, maxErrAge) { el.ref() els = append(els, el) } } return } type eventLogs []*eventLog // Free calls unref on each element of the list. func (els eventLogs) Free() { for _, el := range els { el.unref() } } // eventLogs may be sorted in reverse chronological order. func (els eventLogs) Len() int { return len(els) } func (els eventLogs) Less(i, j int) bool { return els[i].Start.After(els[j].Start) } func (els eventLogs) Swap(i, j int) { els[i], els[j] = els[j], els[i] } // A logEntry is a timestamped log entry in an event log. type logEntry struct { When time.Time Elapsed time.Duration // since previous event in log NewDay bool // whether this event is on a different day to the previous event What string IsErr bool } // WhenString returns a string representation of the elapsed time of the event. // It will include the date if midnight was crossed. func (e logEntry) WhenString() string { if e.NewDay { return e.When.Format("2006/01/02 15:04:05.000000") } return e.When.Format("15:04:05.000000") } // An eventLog represents an active event log. type eventLog struct { // Family is the top-level grouping of event logs to which this belongs. Family string // Title is the title of this event log. Title string // Timing information. Start time.Time // Call stack where this event log was created. stack []uintptr // Append-only sequence of events. // // TODO(sameer): change this to a ring buffer to avoid the array copy // when we hit maxEventsPerLog. mu sync.RWMutex events []logEntry LastErrorTime time.Time discarded int refs int32 // how many buckets this is in } func (el *eventLog) reset() { // Clear all but the mutex. Mutexes may not be copied, even when unlocked. el.Family = "" el.Title = "" el.Start = time.Time{} el.stack = nil el.events = nil el.LastErrorTime = time.Time{} el.discarded = 0 el.refs = 0 } func (el *eventLog) hasRecentError(now time.Time, maxErrAge time.Duration) bool { if maxErrAge == 0 { return true } el.mu.RLock() defer el.mu.RUnlock() return now.Sub(el.LastErrorTime) < maxErrAge } // delta returns the elapsed time since the last event or the log start, // and whether it spans midnight. // L >= el.mu func (el *eventLog) delta(t time.Time) (time.Duration, bool) { if len(el.events) == 0 { return t.Sub(el.Start), false } prev := el.events[len(el.events)-1].When return t.Sub(prev), prev.Day() != t.Day() } func (el *eventLog) Printf(format string, a ...interface{}) { el.printf(false, format, a...) } func (el *eventLog) Errorf(format string, a ...interface{}) { el.printf(true, format, a...) } func (el *eventLog) printf(isErr bool, format string, a ...interface{}) { e := logEntry{When: time.Now(), IsErr: isErr, What: fmt.Sprintf(format, a...)} el.mu.Lock() e.Elapsed, e.NewDay = el.delta(e.When) if len(el.events) < maxEventsPerLog { el.events = append(el.events, e) } else { // Discard the oldest event. if el.discarded == 0 { // el.discarded starts at two to count for the event it // is replacing, plus the next one that we are about to // drop. el.discarded = 2 } else { el.discarded++ } // TODO(sameer): if this causes allocations on a critical path, // change eventLog.What to be a fmt.Stringer, as in trace.go. el.events[0].What = fmt.Sprintf("(%d events discarded)", el.discarded) // The timestamp of the discarded meta-event should be // the time of the last event it is representing. el.events[0].When = el.events[1].When copy(el.events[1:], el.events[2:]) el.events[maxEventsPerLog-1] = e } if e.IsErr { el.LastErrorTime = e.When } el.mu.Unlock() } func (el *eventLog) ref() { atomic.AddInt32(&el.refs, 1) } func (el *eventLog) unref() { if atomic.AddInt32(&el.refs, -1) == 0 { freeEventLog(el) } } func (el *eventLog) When() string { return el.Start.Format("2006/01/02 15:04:05.000000") } func (el *eventLog) ElapsedTime() string { elapsed := time.Since(el.Start) return fmt.Sprintf("%.6f", elapsed.Seconds()) } func (el *eventLog) Stack() string { buf := new(bytes.Buffer) tw := tabwriter.NewWriter(buf, 1, 8, 1, '\t', 0) printStackRecord(tw, el.stack) tw.Flush() return buf.String() } // printStackRecord prints the function + source line information // for a single stack trace. // Adapted from runtime/pprof/pprof.go. func printStackRecord(w io.Writer, stk []uintptr) { for _, pc := range stk { f := runtime.FuncForPC(pc) if f == nil { continue } file, line := f.FileLine(pc) name := f.Name() // Hide runtime.goexit and any runtime functions at the beginning. if strings.HasPrefix(name, "runtime.") { continue } fmt.Fprintf(w, "# %s\t%s:%d\n", name, file, line) } } func (el *eventLog) Events() []logEntry { el.mu.RLock() defer el.mu.RUnlock() return el.events } // freeEventLogs is a freelist of *eventLog var freeEventLogs = make(chan *eventLog, 1000) // newEventLog returns a event log ready to use. func newEventLog() *eventLog { select { case el := <-freeEventLogs: return el default: return new(eventLog) } } // freeEventLog adds el to freeEventLogs if there's room. // This is non-blocking. func freeEventLog(el *eventLog) { el.reset() select { case freeEventLogs <- el: default: } } var eventsTmplCache *template.Template var eventsTmplOnce sync.Once func eventsTmpl() *template.Template { eventsTmplOnce.Do(func() { eventsTmplCache = template.Must(template.New("events").Funcs(template.FuncMap{ "elapsed": elapsed, "trimSpace": strings.TrimSpace, }).Parse(eventsHTML)) }) return eventsTmplCache } const eventsHTML = ` events

/debug/events

{{range $i, $fam := .Families}} {{range $j, $bucket := $.Buckets}} {{$n := index $.Counts $i $j}} {{end}} {{end}}
{{$fam}} {{if $n}}{{end}} [{{$n}} {{$bucket.String}}] {{if $n}}{{end}}
{{if $.EventLogs}}

Family: {{$.Family}}

{{if $.Expanded}}{{end}} [Summary]{{if $.Expanded}}{{end}} {{if not $.Expanded}}{{end}} [Expanded]{{if not $.Expanded}}{{end}} {{range $el := $.EventLogs}} {{if $.Expanded}} {{range $el.Events}} {{end}} {{end}} {{end}}
WhenElapsed
{{$el.When}} {{$el.ElapsedTime}} {{$el.Title}}
{{$el.Stack|trimSpace}}
{{.WhenString}} {{elapsed .Elapsed}} .{{if .IsErr}}E{{else}}.{{end}}. {{.What}}
{{end}} ` ================================================ FILE: vendor/golang.org/x/net/trace/histogram.go ================================================ // Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package trace // This file implements histogramming for RPC statistics collection. import ( "bytes" "fmt" "html/template" "log" "math" "sync" "golang.org/x/net/internal/timeseries" ) const ( bucketCount = 38 ) // histogram keeps counts of values in buckets that are spaced // out in powers of 2: 0-1, 2-3, 4-7... // histogram implements timeseries.Observable type histogram struct { sum int64 // running total of measurements sumOfSquares float64 // square of running total buckets []int64 // bucketed values for histogram value int // holds a single value as an optimization valueCount int64 // number of values recorded for single value } // addMeasurement records a value measurement observation to the histogram. func (h *histogram) addMeasurement(value int64) { // TODO: assert invariant h.sum += value h.sumOfSquares += float64(value) * float64(value) bucketIndex := getBucket(value) if h.valueCount == 0 || (h.valueCount > 0 && h.value == bucketIndex) { h.value = bucketIndex h.valueCount++ } else { h.allocateBuckets() h.buckets[bucketIndex]++ } } func (h *histogram) allocateBuckets() { if h.buckets == nil { h.buckets = make([]int64, bucketCount) h.buckets[h.value] = h.valueCount h.value = 0 h.valueCount = -1 } } func log2(i int64) int { n := 0 for ; i >= 0x100; i >>= 8 { n += 8 } for ; i > 0; i >>= 1 { n += 1 } return n } func getBucket(i int64) (index int) { index = log2(i) - 1 if index < 0 { index = 0 } if index >= bucketCount { index = bucketCount - 1 } return } // Total returns the number of recorded observations. func (h *histogram) total() (total int64) { if h.valueCount >= 0 { total = h.valueCount } for _, val := range h.buckets { total += int64(val) } return } // Average returns the average value of recorded observations. func (h *histogram) average() float64 { t := h.total() if t == 0 { return 0 } return float64(h.sum) / float64(t) } // Variance returns the variance of recorded observations. func (h *histogram) variance() float64 { t := float64(h.total()) if t == 0 { return 0 } s := float64(h.sum) / t return h.sumOfSquares/t - s*s } // StandardDeviation returns the standard deviation of recorded observations. func (h *histogram) standardDeviation() float64 { return math.Sqrt(h.variance()) } // PercentileBoundary estimates the value that the given fraction of recorded // observations are less than. func (h *histogram) percentileBoundary(percentile float64) int64 { total := h.total() // Corner cases (make sure result is strictly less than Total()) if total == 0 { return 0 } else if total == 1 { return int64(h.average()) } percentOfTotal := round(float64(total) * percentile) var runningTotal int64 for i := range h.buckets { value := h.buckets[i] runningTotal += value if runningTotal == percentOfTotal { // We hit an exact bucket boundary. If the next bucket has data, it is a // good estimate of the value. If the bucket is empty, we interpolate the // midpoint between the next bucket's boundary and the next non-zero // bucket. If the remaining buckets are all empty, then we use the // boundary for the next bucket as the estimate. j := uint8(i + 1) min := bucketBoundary(j) if runningTotal < total { for h.buckets[j] == 0 { j++ } } max := bucketBoundary(j) return min + round(float64(max-min)/2) } else if runningTotal > percentOfTotal { // The value is in this bucket. Interpolate the value. delta := runningTotal - percentOfTotal percentBucket := float64(value-delta) / float64(value) bucketMin := bucketBoundary(uint8(i)) nextBucketMin := bucketBoundary(uint8(i + 1)) bucketSize := nextBucketMin - bucketMin return bucketMin + round(percentBucket*float64(bucketSize)) } } return bucketBoundary(bucketCount - 1) } // Median returns the estimated median of the observed values. func (h *histogram) median() int64 { return h.percentileBoundary(0.5) } // Add adds other to h. func (h *histogram) Add(other timeseries.Observable) { o := other.(*histogram) if o.valueCount == 0 { // Other histogram is empty } else if h.valueCount >= 0 && o.valueCount > 0 && h.value == o.value { // Both have a single bucketed value, aggregate them h.valueCount += o.valueCount } else { // Two different values necessitate buckets in this histogram h.allocateBuckets() if o.valueCount >= 0 { h.buckets[o.value] += o.valueCount } else { for i := range h.buckets { h.buckets[i] += o.buckets[i] } } } h.sumOfSquares += o.sumOfSquares h.sum += o.sum } // Clear resets the histogram to an empty state, removing all observed values. func (h *histogram) Clear() { h.buckets = nil h.value = 0 h.valueCount = 0 h.sum = 0 h.sumOfSquares = 0 } // CopyFrom copies from other, which must be a *histogram, into h. func (h *histogram) CopyFrom(other timeseries.Observable) { o := other.(*histogram) if o.valueCount == -1 { h.allocateBuckets() copy(h.buckets, o.buckets) } h.sum = o.sum h.sumOfSquares = o.sumOfSquares h.value = o.value h.valueCount = o.valueCount } // Multiply scales the histogram by the specified ratio. func (h *histogram) Multiply(ratio float64) { if h.valueCount == -1 { for i := range h.buckets { h.buckets[i] = int64(float64(h.buckets[i]) * ratio) } } else { h.valueCount = int64(float64(h.valueCount) * ratio) } h.sum = int64(float64(h.sum) * ratio) h.sumOfSquares = h.sumOfSquares * ratio } // New creates a new histogram. func (h *histogram) New() timeseries.Observable { r := new(histogram) r.Clear() return r } func (h *histogram) String() string { return fmt.Sprintf("%d, %f, %d, %d, %v", h.sum, h.sumOfSquares, h.value, h.valueCount, h.buckets) } // round returns the closest int64 to the argument func round(in float64) int64 { return int64(math.Floor(in + 0.5)) } // bucketBoundary returns the first value in the bucket. func bucketBoundary(bucket uint8) int64 { if bucket == 0 { return 0 } return 1 << bucket } // bucketData holds data about a specific bucket for use in distTmpl. type bucketData struct { Lower, Upper int64 N int64 Pct, CumulativePct float64 GraphWidth int } // data holds data about a Distribution for use in distTmpl. type data struct { Buckets []*bucketData Count, Median int64 Mean, StandardDeviation float64 } // maxHTMLBarWidth is the maximum width of the HTML bar for visualizing buckets. const maxHTMLBarWidth = 350.0 // newData returns data representing h for use in distTmpl. func (h *histogram) newData() *data { // Force the allocation of buckets to simplify the rendering implementation h.allocateBuckets() // We scale the bars on the right so that the largest bar is // maxHTMLBarWidth pixels in width. maxBucket := int64(0) for _, n := range h.buckets { if n > maxBucket { maxBucket = n } } total := h.total() barsizeMult := maxHTMLBarWidth / float64(maxBucket) var pctMult float64 if total == 0 { pctMult = 1.0 } else { pctMult = 100.0 / float64(total) } buckets := make([]*bucketData, len(h.buckets)) runningTotal := int64(0) for i, n := range h.buckets { if n == 0 { continue } runningTotal += n var upperBound int64 if i < bucketCount-1 { upperBound = bucketBoundary(uint8(i + 1)) } else { upperBound = math.MaxInt64 } buckets[i] = &bucketData{ Lower: bucketBoundary(uint8(i)), Upper: upperBound, N: n, Pct: float64(n) * pctMult, CumulativePct: float64(runningTotal) * pctMult, GraphWidth: int(float64(n) * barsizeMult), } } return &data{ Buckets: buckets, Count: total, Median: h.median(), Mean: h.average(), StandardDeviation: h.standardDeviation(), } } func (h *histogram) html() template.HTML { buf := new(bytes.Buffer) if err := distTmpl().Execute(buf, h.newData()); err != nil { buf.Reset() log.Printf("net/trace: couldn't execute template: %v", err) } return template.HTML(buf.String()) } var distTmplCache *template.Template var distTmplOnce sync.Once func distTmpl() *template.Template { distTmplOnce.Do(func() { // Input: data distTmplCache = template.Must(template.New("distTmpl").Parse(`
Count: {{.Count}} Mean: {{printf "%.0f" .Mean}} StdDev: {{printf "%.0f" .StandardDeviation}} Median: {{.Median}}

{{range $b := .Buckets}} {{if $b}} {{end}} {{end}}
[ {{.Lower}}, {{.Upper}}) {{.N}} {{printf "%#.3f" .Pct}}% {{printf "%#.3f" .CumulativePct}}%
`)) }) return distTmplCache } ================================================ FILE: vendor/golang.org/x/net/trace/trace.go ================================================ // Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Package trace implements tracing of requests and long-lived objects. It exports HTTP interfaces on /debug/requests and /debug/events. A trace.Trace provides tracing for short-lived objects, usually requests. A request handler might be implemented like this: func fooHandler(w http.ResponseWriter, req *http.Request) { tr := trace.New("mypkg.Foo", req.URL.Path) defer tr.Finish() ... tr.LazyPrintf("some event %q happened", str) ... if err := somethingImportant(); err != nil { tr.LazyPrintf("somethingImportant failed: %v", err) tr.SetError() } } The /debug/requests HTTP endpoint organizes the traces by family, errors, and duration. It also provides histogram of request duration for each family. A trace.EventLog provides tracing for long-lived objects, such as RPC connections. // A Fetcher fetches URL paths for a single domain. type Fetcher struct { domain string events trace.EventLog } func NewFetcher(domain string) *Fetcher { return &Fetcher{ domain, trace.NewEventLog("mypkg.Fetcher", domain), } } func (f *Fetcher) Fetch(path string) (string, error) { resp, err := http.Get("http://" + f.domain + "/" + path) if err != nil { f.events.Errorf("Get(%q) = %v", path, err) return "", err } f.events.Printf("Get(%q) = %s", path, resp.Status) ... } func (f *Fetcher) Close() error { f.events.Finish() return nil } The /debug/events HTTP endpoint organizes the event logs by family and by time since the last error. The expanded view displays recent log entries and the log's call stack. */ package trace // import "golang.org/x/net/trace" import ( "bytes" "context" "fmt" "html/template" "io" "log" "net" "net/http" "net/url" "runtime" "sort" "strconv" "sync" "sync/atomic" "time" "golang.org/x/net/internal/timeseries" ) // DebugUseAfterFinish controls whether to debug uses of Trace values after finishing. // FOR DEBUGGING ONLY. This will slow down the program. var DebugUseAfterFinish = false // HTTP ServeMux paths. const ( debugRequestsPath = "/debug/requests" debugEventsPath = "/debug/events" ) // AuthRequest determines whether a specific request is permitted to load the // /debug/requests or /debug/events pages. // // It returns two bools; the first indicates whether the page may be viewed at all, // and the second indicates whether sensitive events will be shown. // // AuthRequest may be replaced by a program to customize its authorization requirements. // // The default AuthRequest function returns (true, true) if and only if the request // comes from localhost/127.0.0.1/[::1]. var AuthRequest = func(req *http.Request) (any, sensitive bool) { // RemoteAddr is commonly in the form "IP" or "IP:port". // If it is in the form "IP:port", split off the port. host, _, err := net.SplitHostPort(req.RemoteAddr) if err != nil { host = req.RemoteAddr } switch host { case "localhost", "127.0.0.1", "::1": return true, true default: return false, false } } func init() { _, pat := http.DefaultServeMux.Handler(&http.Request{URL: &url.URL{Path: debugRequestsPath}}) if pat == debugRequestsPath { panic("/debug/requests is already registered. You may have two independent copies of " + "golang.org/x/net/trace in your binary, trying to maintain separate state. This may " + "involve a vendored copy of golang.org/x/net/trace.") } // TODO(jbd): Serve Traces from /debug/traces in the future? // There is no requirement for a request to be present to have traces. http.HandleFunc(debugRequestsPath, Traces) http.HandleFunc(debugEventsPath, Events) } // NewContext returns a copy of the parent context // and associates it with a Trace. func NewContext(ctx context.Context, tr Trace) context.Context { return context.WithValue(ctx, contextKey, tr) } // FromContext returns the Trace bound to the context, if any. func FromContext(ctx context.Context) (tr Trace, ok bool) { tr, ok = ctx.Value(contextKey).(Trace) return } // Traces responds with traces from the program. // The package initialization registers it in http.DefaultServeMux // at /debug/requests. // // It performs authorization by running AuthRequest. func Traces(w http.ResponseWriter, req *http.Request) { any, sensitive := AuthRequest(req) if !any { http.Error(w, "not allowed", http.StatusUnauthorized) return } w.Header().Set("Content-Type", "text/html; charset=utf-8") Render(w, req, sensitive) } // Events responds with a page of events collected by EventLogs. // The package initialization registers it in http.DefaultServeMux // at /debug/events. // // It performs authorization by running AuthRequest. func Events(w http.ResponseWriter, req *http.Request) { any, sensitive := AuthRequest(req) if !any { http.Error(w, "not allowed", http.StatusUnauthorized) return } w.Header().Set("Content-Type", "text/html; charset=utf-8") RenderEvents(w, req, sensitive) } // Render renders the HTML page typically served at /debug/requests. // It does not do any auth checking. The request may be nil. // // Most users will use the Traces handler. func Render(w io.Writer, req *http.Request, sensitive bool) { data := &struct { Families []string ActiveTraceCount map[string]int CompletedTraces map[string]*family // Set when a bucket has been selected. Traces traceList Family string Bucket int Expanded bool Traced bool Active bool ShowSensitive bool // whether to show sensitive events Histogram template.HTML HistogramWindow string // e.g. "last minute", "last hour", "all time" // If non-zero, the set of traces is a partial set, // and this is the total number. Total int }{ CompletedTraces: completedTraces, } data.ShowSensitive = sensitive if req != nil { // Allow show_sensitive=0 to force hiding of sensitive data for testing. // This only goes one way; you can't use show_sensitive=1 to see things. if req.FormValue("show_sensitive") == "0" { data.ShowSensitive = false } if exp, err := strconv.ParseBool(req.FormValue("exp")); err == nil { data.Expanded = exp } if exp, err := strconv.ParseBool(req.FormValue("rtraced")); err == nil { data.Traced = exp } } completedMu.RLock() data.Families = make([]string, 0, len(completedTraces)) for fam := range completedTraces { data.Families = append(data.Families, fam) } completedMu.RUnlock() sort.Strings(data.Families) // We are careful here to minimize the time spent locking activeMu, // since that lock is required every time an RPC starts and finishes. data.ActiveTraceCount = make(map[string]int, len(data.Families)) activeMu.RLock() for fam, s := range activeTraces { data.ActiveTraceCount[fam] = s.Len() } activeMu.RUnlock() var ok bool data.Family, data.Bucket, ok = parseArgs(req) switch { case !ok: // No-op case data.Bucket == -1: data.Active = true n := data.ActiveTraceCount[data.Family] data.Traces = getActiveTraces(data.Family) if len(data.Traces) < n { data.Total = n } case data.Bucket < bucketsPerFamily: if b := lookupBucket(data.Family, data.Bucket); b != nil { data.Traces = b.Copy(data.Traced) } default: if f := getFamily(data.Family, false); f != nil { var obs timeseries.Observable f.LatencyMu.RLock() switch o := data.Bucket - bucketsPerFamily; o { case 0: obs = f.Latency.Minute() data.HistogramWindow = "last minute" case 1: obs = f.Latency.Hour() data.HistogramWindow = "last hour" case 2: obs = f.Latency.Total() data.HistogramWindow = "all time" } f.LatencyMu.RUnlock() if obs != nil { data.Histogram = obs.(*histogram).html() } } } if data.Traces != nil { defer data.Traces.Free() sort.Sort(data.Traces) } completedMu.RLock() defer completedMu.RUnlock() if err := pageTmpl().ExecuteTemplate(w, "Page", data); err != nil { log.Printf("net/trace: Failed executing template: %v", err) } } func parseArgs(req *http.Request) (fam string, b int, ok bool) { if req == nil { return "", 0, false } fam, bStr := req.FormValue("fam"), req.FormValue("b") if fam == "" || bStr == "" { return "", 0, false } b, err := strconv.Atoi(bStr) if err != nil || b < -1 { return "", 0, false } return fam, b, true } func lookupBucket(fam string, b int) *traceBucket { f := getFamily(fam, false) if f == nil || b < 0 || b >= len(f.Buckets) { return nil } return f.Buckets[b] } type contextKeyT string var contextKey = contextKeyT("golang.org/x/net/trace.Trace") // Trace represents an active request. type Trace interface { // LazyLog adds x to the event log. It will be evaluated each time the // /debug/requests page is rendered. Any memory referenced by x will be // pinned until the trace is finished and later discarded. LazyLog(x fmt.Stringer, sensitive bool) // LazyPrintf evaluates its arguments with fmt.Sprintf each time the // /debug/requests page is rendered. Any memory referenced by a will be // pinned until the trace is finished and later discarded. LazyPrintf(format string, a ...interface{}) // SetError declares that this trace resulted in an error. SetError() // SetRecycler sets a recycler for the trace. // f will be called for each event passed to LazyLog at a time when // it is no longer required, whether while the trace is still active // and the event is discarded, or when a completed trace is discarded. SetRecycler(f func(interface{})) // SetTraceInfo sets the trace info for the trace. // This is currently unused. SetTraceInfo(traceID, spanID uint64) // SetMaxEvents sets the maximum number of events that will be stored // in the trace. This has no effect if any events have already been // added to the trace. SetMaxEvents(m int) // Finish declares that this trace is complete. // The trace should not be used after calling this method. Finish() } type lazySprintf struct { format string a []interface{} } func (l *lazySprintf) String() string { return fmt.Sprintf(l.format, l.a...) } // New returns a new Trace with the specified family and title. func New(family, title string) Trace { tr := newTrace() tr.ref() tr.Family, tr.Title = family, title tr.Start = time.Now() tr.maxEvents = maxEventsPerTrace tr.events = tr.eventsBuf[:0] activeMu.RLock() s := activeTraces[tr.Family] activeMu.RUnlock() if s == nil { activeMu.Lock() s = activeTraces[tr.Family] // check again if s == nil { s = new(traceSet) activeTraces[tr.Family] = s } activeMu.Unlock() } s.Add(tr) // Trigger allocation of the completed trace structure for this family. // This will cause the family to be present in the request page during // the first trace of this family. We don't care about the return value, // nor is there any need for this to run inline, so we execute it in its // own goroutine, but only if the family isn't allocated yet. completedMu.RLock() if _, ok := completedTraces[tr.Family]; !ok { go allocFamily(tr.Family) } completedMu.RUnlock() return tr } func (tr *trace) Finish() { elapsed := time.Since(tr.Start) tr.mu.Lock() tr.Elapsed = elapsed tr.mu.Unlock() if DebugUseAfterFinish { buf := make([]byte, 4<<10) // 4 KB should be enough n := runtime.Stack(buf, false) tr.finishStack = buf[:n] } activeMu.RLock() m := activeTraces[tr.Family] activeMu.RUnlock() m.Remove(tr) f := getFamily(tr.Family, true) tr.mu.RLock() // protects tr fields in Cond.match calls for _, b := range f.Buckets { if b.Cond.match(tr) { b.Add(tr) } } tr.mu.RUnlock() // Add a sample of elapsed time as microseconds to the family's timeseries h := new(histogram) h.addMeasurement(elapsed.Nanoseconds() / 1e3) f.LatencyMu.Lock() f.Latency.Add(h) f.LatencyMu.Unlock() tr.unref() // matches ref in New } const ( bucketsPerFamily = 9 tracesPerBucket = 10 maxActiveTraces = 20 // Maximum number of active traces to show. maxEventsPerTrace = 10 numHistogramBuckets = 38 ) var ( // The active traces. activeMu sync.RWMutex activeTraces = make(map[string]*traceSet) // family -> traces // Families of completed traces. completedMu sync.RWMutex completedTraces = make(map[string]*family) // family -> traces ) type traceSet struct { mu sync.RWMutex m map[*trace]bool // We could avoid the entire map scan in FirstN by having a slice of all the traces // ordered by start time, and an index into that from the trace struct, with a periodic // repack of the slice after enough traces finish; we could also use a skip list or similar. // However, that would shift some of the expense from /debug/requests time to RPC time, // which is probably the wrong trade-off. } func (ts *traceSet) Len() int { ts.mu.RLock() defer ts.mu.RUnlock() return len(ts.m) } func (ts *traceSet) Add(tr *trace) { ts.mu.Lock() if ts.m == nil { ts.m = make(map[*trace]bool) } ts.m[tr] = true ts.mu.Unlock() } func (ts *traceSet) Remove(tr *trace) { ts.mu.Lock() delete(ts.m, tr) ts.mu.Unlock() } // FirstN returns the first n traces ordered by time. func (ts *traceSet) FirstN(n int) traceList { ts.mu.RLock() defer ts.mu.RUnlock() if n > len(ts.m) { n = len(ts.m) } trl := make(traceList, 0, n) // Fast path for when no selectivity is needed. if n == len(ts.m) { for tr := range ts.m { tr.ref() trl = append(trl, tr) } sort.Sort(trl) return trl } // Pick the oldest n traces. // This is inefficient. See the comment in the traceSet struct. for tr := range ts.m { // Put the first n traces into trl in the order they occur. // When we have n, sort trl, and thereafter maintain its order. if len(trl) < n { tr.ref() trl = append(trl, tr) if len(trl) == n { // This is guaranteed to happen exactly once during this loop. sort.Sort(trl) } continue } if tr.Start.After(trl[n-1].Start) { continue } // Find where to insert this one. tr.ref() i := sort.Search(n, func(i int) bool { return trl[i].Start.After(tr.Start) }) trl[n-1].unref() copy(trl[i+1:], trl[i:]) trl[i] = tr } return trl } func getActiveTraces(fam string) traceList { activeMu.RLock() s := activeTraces[fam] activeMu.RUnlock() if s == nil { return nil } return s.FirstN(maxActiveTraces) } func getFamily(fam string, allocNew bool) *family { completedMu.RLock() f := completedTraces[fam] completedMu.RUnlock() if f == nil && allocNew { f = allocFamily(fam) } return f } func allocFamily(fam string) *family { completedMu.Lock() defer completedMu.Unlock() f := completedTraces[fam] if f == nil { f = newFamily() completedTraces[fam] = f } return f } // family represents a set of trace buckets and associated latency information. type family struct { // traces may occur in multiple buckets. Buckets [bucketsPerFamily]*traceBucket // latency time series LatencyMu sync.RWMutex Latency *timeseries.MinuteHourSeries } func newFamily() *family { return &family{ Buckets: [bucketsPerFamily]*traceBucket{ {Cond: minCond(0)}, {Cond: minCond(50 * time.Millisecond)}, {Cond: minCond(100 * time.Millisecond)}, {Cond: minCond(200 * time.Millisecond)}, {Cond: minCond(500 * time.Millisecond)}, {Cond: minCond(1 * time.Second)}, {Cond: minCond(10 * time.Second)}, {Cond: minCond(100 * time.Second)}, {Cond: errorCond{}}, }, Latency: timeseries.NewMinuteHourSeries(func() timeseries.Observable { return new(histogram) }), } } // traceBucket represents a size-capped bucket of historic traces, // along with a condition for a trace to belong to the bucket. type traceBucket struct { Cond cond // Ring buffer implementation of a fixed-size FIFO queue. mu sync.RWMutex buf [tracesPerBucket]*trace start int // < tracesPerBucket length int // <= tracesPerBucket } func (b *traceBucket) Add(tr *trace) { b.mu.Lock() defer b.mu.Unlock() i := b.start + b.length if i >= tracesPerBucket { i -= tracesPerBucket } if b.length == tracesPerBucket { // "Remove" an element from the bucket. b.buf[i].unref() b.start++ if b.start == tracesPerBucket { b.start = 0 } } b.buf[i] = tr if b.length < tracesPerBucket { b.length++ } tr.ref() } // Copy returns a copy of the traces in the bucket. // If tracedOnly is true, only the traces with trace information will be returned. // The logs will be ref'd before returning; the caller should call // the Free method when it is done with them. // TODO(dsymonds): keep track of traced requests in separate buckets. func (b *traceBucket) Copy(tracedOnly bool) traceList { b.mu.RLock() defer b.mu.RUnlock() trl := make(traceList, 0, b.length) for i, x := 0, b.start; i < b.length; i++ { tr := b.buf[x] if !tracedOnly || tr.spanID != 0 { tr.ref() trl = append(trl, tr) } x++ if x == b.length { x = 0 } } return trl } func (b *traceBucket) Empty() bool { b.mu.RLock() defer b.mu.RUnlock() return b.length == 0 } // cond represents a condition on a trace. type cond interface { match(t *trace) bool String() string } type minCond time.Duration func (m minCond) match(t *trace) bool { return t.Elapsed >= time.Duration(m) } func (m minCond) String() string { return fmt.Sprintf("≥%gs", time.Duration(m).Seconds()) } type errorCond struct{} func (e errorCond) match(t *trace) bool { return t.IsError } func (e errorCond) String() string { return "errors" } type traceList []*trace // Free calls unref on each element of the list. func (trl traceList) Free() { for _, t := range trl { t.unref() } } // traceList may be sorted in reverse chronological order. func (trl traceList) Len() int { return len(trl) } func (trl traceList) Less(i, j int) bool { return trl[i].Start.After(trl[j].Start) } func (trl traceList) Swap(i, j int) { trl[i], trl[j] = trl[j], trl[i] } // An event is a timestamped log entry in a trace. type event struct { When time.Time Elapsed time.Duration // since previous event in trace NewDay bool // whether this event is on a different day to the previous event Recyclable bool // whether this event was passed via LazyLog Sensitive bool // whether this event contains sensitive information What interface{} // string or fmt.Stringer } // WhenString returns a string representation of the elapsed time of the event. // It will include the date if midnight was crossed. func (e event) WhenString() string { if e.NewDay { return e.When.Format("2006/01/02 15:04:05.000000") } return e.When.Format("15:04:05.000000") } // discarded represents a number of discarded events. // It is stored as *discarded to make it easier to update in-place. type discarded int func (d *discarded) String() string { return fmt.Sprintf("(%d events discarded)", int(*d)) } // trace represents an active or complete request, // either sent or received by this program. type trace struct { // Family is the top-level grouping of traces to which this belongs. Family string // Title is the title of this trace. Title string // Start time of the this trace. Start time.Time mu sync.RWMutex events []event // Append-only sequence of events (modulo discards). maxEvents int recycler func(interface{}) IsError bool // Whether this trace resulted in an error. Elapsed time.Duration // Elapsed time for this trace, zero while active. traceID uint64 // Trace information if non-zero. spanID uint64 refs int32 // how many buckets this is in disc discarded // scratch space to avoid allocation finishStack []byte // where finish was called, if DebugUseAfterFinish is set eventsBuf [4]event // preallocated buffer in case we only log a few events } func (tr *trace) reset() { // Clear all but the mutex. Mutexes may not be copied, even when unlocked. tr.Family = "" tr.Title = "" tr.Start = time.Time{} tr.mu.Lock() tr.Elapsed = 0 tr.traceID = 0 tr.spanID = 0 tr.IsError = false tr.maxEvents = 0 tr.events = nil tr.recycler = nil tr.mu.Unlock() tr.refs = 0 tr.disc = 0 tr.finishStack = nil for i := range tr.eventsBuf { tr.eventsBuf[i] = event{} } } // delta returns the elapsed time since the last event or the trace start, // and whether it spans midnight. // L >= tr.mu func (tr *trace) delta(t time.Time) (time.Duration, bool) { if len(tr.events) == 0 { return t.Sub(tr.Start), false } prev := tr.events[len(tr.events)-1].When return t.Sub(prev), prev.Day() != t.Day() } func (tr *trace) addEvent(x interface{}, recyclable, sensitive bool) { if DebugUseAfterFinish && tr.finishStack != nil { buf := make([]byte, 4<<10) // 4 KB should be enough n := runtime.Stack(buf, false) log.Printf("net/trace: trace used after finish:\nFinished at:\n%s\nUsed at:\n%s", tr.finishStack, buf[:n]) } /* NOTE TO DEBUGGERS If you are here because your program panicked in this code, it is almost definitely the fault of code using this package, and very unlikely to be the fault of this code. The most likely scenario is that some code elsewhere is using a trace.Trace after its Finish method is called. You can temporarily set the DebugUseAfterFinish var to help discover where that is; do not leave that var set, since it makes this package much less efficient. */ e := event{When: time.Now(), What: x, Recyclable: recyclable, Sensitive: sensitive} tr.mu.Lock() e.Elapsed, e.NewDay = tr.delta(e.When) if len(tr.events) < tr.maxEvents { tr.events = append(tr.events, e) } else { // Discard the middle events. di := int((tr.maxEvents - 1) / 2) if d, ok := tr.events[di].What.(*discarded); ok { (*d)++ } else { // disc starts at two to count for the event it is replacing, // plus the next one that we are about to drop. tr.disc = 2 if tr.recycler != nil && tr.events[di].Recyclable { go tr.recycler(tr.events[di].What) } tr.events[di].What = &tr.disc } // The timestamp of the discarded meta-event should be // the time of the last event it is representing. tr.events[di].When = tr.events[di+1].When if tr.recycler != nil && tr.events[di+1].Recyclable { go tr.recycler(tr.events[di+1].What) } copy(tr.events[di+1:], tr.events[di+2:]) tr.events[tr.maxEvents-1] = e } tr.mu.Unlock() } func (tr *trace) LazyLog(x fmt.Stringer, sensitive bool) { tr.addEvent(x, true, sensitive) } func (tr *trace) LazyPrintf(format string, a ...interface{}) { tr.addEvent(&lazySprintf{format, a}, false, false) } func (tr *trace) SetError() { tr.mu.Lock() tr.IsError = true tr.mu.Unlock() } func (tr *trace) SetRecycler(f func(interface{})) { tr.mu.Lock() tr.recycler = f tr.mu.Unlock() } func (tr *trace) SetTraceInfo(traceID, spanID uint64) { tr.mu.Lock() tr.traceID, tr.spanID = traceID, spanID tr.mu.Unlock() } func (tr *trace) SetMaxEvents(m int) { tr.mu.Lock() // Always keep at least three events: first, discarded count, last. if len(tr.events) == 0 && m > 3 { tr.maxEvents = m } tr.mu.Unlock() } func (tr *trace) ref() { atomic.AddInt32(&tr.refs, 1) } func (tr *trace) unref() { if atomic.AddInt32(&tr.refs, -1) == 0 { tr.mu.RLock() if tr.recycler != nil { // freeTrace clears tr, so we hold tr.recycler and tr.events here. go func(f func(interface{}), es []event) { for _, e := range es { if e.Recyclable { f(e.What) } } }(tr.recycler, tr.events) } tr.mu.RUnlock() freeTrace(tr) } } func (tr *trace) When() string { return tr.Start.Format("2006/01/02 15:04:05.000000") } func (tr *trace) ElapsedTime() string { tr.mu.RLock() t := tr.Elapsed tr.mu.RUnlock() if t == 0 { // Active trace. t = time.Since(tr.Start) } return fmt.Sprintf("%.6f", t.Seconds()) } func (tr *trace) Events() []event { tr.mu.RLock() defer tr.mu.RUnlock() return tr.events } var traceFreeList = make(chan *trace, 1000) // TODO(dsymonds): Use sync.Pool? // newTrace returns a trace ready to use. func newTrace() *trace { select { case tr := <-traceFreeList: return tr default: return new(trace) } } // freeTrace adds tr to traceFreeList if there's room. // This is non-blocking. func freeTrace(tr *trace) { if DebugUseAfterFinish { return // never reuse } tr.reset() select { case traceFreeList <- tr: default: } } func elapsed(d time.Duration) string { b := []byte(fmt.Sprintf("%.6f", d.Seconds())) // For subsecond durations, blank all zeros before decimal point, // and all zeros between the decimal point and the first non-zero digit. if d < time.Second { dot := bytes.IndexByte(b, '.') for i := 0; i < dot; i++ { b[i] = ' ' } for i := dot + 1; i < len(b); i++ { if b[i] == '0' { b[i] = ' ' } else { break } } } return string(b) } var pageTmplCache *template.Template var pageTmplOnce sync.Once func pageTmpl() *template.Template { pageTmplOnce.Do(func() { pageTmplCache = template.Must(template.New("Page").Funcs(template.FuncMap{ "elapsed": elapsed, "add": func(a, b int) int { return a + b }, }).Parse(pageHTML)) }) return pageTmplCache } const pageHTML = ` {{template "Prolog" .}} {{template "StatusTable" .}} {{template "Epilog" .}} {{define "Prolog"}} /debug/requests

/debug/requests

{{end}} {{/* end of Prolog */}} {{define "StatusTable"}} {{range $fam := .Families}} {{$n := index $.ActiveTraceCount $fam}} {{$f := index $.CompletedTraces $fam}} {{range $i, $b := $f.Buckets}} {{$empty := $b.Empty}} {{end}} {{$nb := len $f.Buckets}} {{end}}
{{$fam}} {{if $n}}{{end}} [{{$n}} active] {{if $n}}{{end}} {{if not $empty}}{{end}} [{{.Cond}}] {{if not $empty}}{{end}} [minute] [hour] [total]
{{end}} {{/* end of StatusTable */}} {{define "Epilog"}} {{if $.Traces}}

Family: {{$.Family}}

{{if or $.Expanded $.Traced}} [Normal/Summary] {{else}} [Normal/Summary] {{end}} {{if or (not $.Expanded) $.Traced}} [Normal/Expanded] {{else}} [Normal/Expanded] {{end}} {{if not $.Active}} {{if or $.Expanded (not $.Traced)}} [Traced/Summary] {{else}} [Traced/Summary] {{end}} {{if or (not $.Expanded) (not $.Traced)}} [Traced/Expanded] {{else}} [Traced/Expanded] {{end}} {{end}} {{if $.Total}}

Showing {{len $.Traces}} of {{$.Total}} traces.

{{end}} {{range $tr := $.Traces}} {{/* TODO: include traceID/spanID */}} {{if $.Expanded}} {{range $tr.Events}} {{end}} {{end}} {{end}}
{{if $.Active}}Active{{else}}Completed{{end}} Requests
WhenElapsed (s)
{{$tr.When}} {{$tr.ElapsedTime}} {{$tr.Title}}
{{.WhenString}} {{elapsed .Elapsed}} {{if or $.ShowSensitive (not .Sensitive)}}... {{.What}}{{else}}[redacted]{{end}}
{{end}} {{/* if $.Traces */}} {{if $.Histogram}}

Latency (µs) of {{$.Family}} over {{$.HistogramWindow}}

{{$.Histogram}} {{end}} {{/* if $.Histogram */}} {{end}} {{/* end of Epilog */}} ` ================================================ FILE: vendor/golang.org/x/oauth2/.travis.yml ================================================ language: go go: - tip install: - export GOPATH="$HOME/gopath" - mkdir -p "$GOPATH/src/golang.org/x" - mv "$TRAVIS_BUILD_DIR" "$GOPATH/src/golang.org/x/oauth2" - go get -v -t -d golang.org/x/oauth2/... script: - go test -v golang.org/x/oauth2/... ================================================ FILE: vendor/golang.org/x/oauth2/CONTRIBUTING.md ================================================ # Contributing to Go Go is an open source project. It is the work of hundreds of contributors. We appreciate your help! ## Filing issues When [filing an issue](https://github.com/golang/oauth2/issues), make sure to answer these five questions: 1. What version of Go are you using (`go version`)? 2. What operating system and processor architecture are you using? 3. What did you do? 4. What did you expect to see? 5. What did you see instead? General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker. The gophers there will answer or ask you to file an issue if you've tripped over a bug. ## Contributing code Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html) before sending patches. Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file. ================================================ FILE: vendor/golang.org/x/oauth2/LICENSE ================================================ Copyright 2009 The Go Authors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: vendor/golang.org/x/oauth2/README.md ================================================ # OAuth2 for Go [![Go Reference](https://pkg.go.dev/badge/golang.org/x/oauth2.svg)](https://pkg.go.dev/golang.org/x/oauth2) [![Build Status](https://travis-ci.org/golang/oauth2.svg?branch=master)](https://travis-ci.org/golang/oauth2) oauth2 package contains a client implementation for OAuth 2.0 spec. See pkg.go.dev for further documentation and examples. * [pkg.go.dev/golang.org/x/oauth2](https://pkg.go.dev/golang.org/x/oauth2) * [pkg.go.dev/golang.org/x/oauth2/google](https://pkg.go.dev/golang.org/x/oauth2/google) ## Policy for new endpoints We no longer accept new provider-specific packages in this repo if all they do is add a single endpoint variable. If you just want to add a single endpoint, add it to the [pkg.go.dev/golang.org/x/oauth2/endpoints](https://pkg.go.dev/golang.org/x/oauth2/endpoints) package. ## Report Issues / Send Patches The main issue tracker for the oauth2 repository is located at https://github.com/golang/oauth2/issues. This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://go.dev/doc/contribute. The git repository is https://go.googlesource.com/oauth2. Note: * Excluding trivial changes, all contributions should be connected to an existing issue. * API changes must go through the [change proposal process](https://go.dev/s/proposal-process) before they can be accepted. * The code owners are listed at [dev.golang.org/owners](https://dev.golang.org/owners#:~:text=x/oauth2). ================================================ FILE: vendor/golang.org/x/oauth2/deviceauth.go ================================================ package oauth2 import ( "context" "encoding/json" "errors" "fmt" "io" "mime" "net/http" "net/url" "strings" "time" "golang.org/x/oauth2/internal" ) // https://datatracker.ietf.org/doc/html/rfc8628#section-3.5 const ( errAuthorizationPending = "authorization_pending" errSlowDown = "slow_down" errAccessDenied = "access_denied" errExpiredToken = "expired_token" ) // DeviceAuthResponse describes a successful RFC 8628 Device Authorization Response // https://datatracker.ietf.org/doc/html/rfc8628#section-3.2 type DeviceAuthResponse struct { // DeviceCode DeviceCode string `json:"device_code"` // UserCode is the code the user should enter at the verification uri UserCode string `json:"user_code"` // VerificationURI is where user should enter the user code VerificationURI string `json:"verification_uri"` // VerificationURIComplete (if populated) includes the user code in the verification URI. This is typically shown to the user in non-textual form, such as a QR code. VerificationURIComplete string `json:"verification_uri_complete,omitempty"` // Expiry is when the device code and user code expire Expiry time.Time `json:"expires_in,omitempty"` // Interval is the duration in seconds that Poll should wait between requests Interval int64 `json:"interval,omitempty"` } func (d DeviceAuthResponse) MarshalJSON() ([]byte, error) { type Alias DeviceAuthResponse var expiresIn int64 if !d.Expiry.IsZero() { expiresIn = int64(time.Until(d.Expiry).Seconds()) } return json.Marshal(&struct { ExpiresIn int64 `json:"expires_in,omitempty"` *Alias }{ ExpiresIn: expiresIn, Alias: (*Alias)(&d), }) } func (c *DeviceAuthResponse) UnmarshalJSON(data []byte) error { type Alias DeviceAuthResponse aux := &struct { ExpiresIn int64 `json:"expires_in"` // workaround misspelling of verification_uri VerificationURL string `json:"verification_url"` *Alias }{ Alias: (*Alias)(c), } if err := json.Unmarshal(data, &aux); err != nil { return err } if aux.ExpiresIn != 0 { c.Expiry = time.Now().UTC().Add(time.Second * time.Duration(aux.ExpiresIn)) } if c.VerificationURI == "" { c.VerificationURI = aux.VerificationURL } return nil } // DeviceAuth returns a device auth struct which contains a device code // and authorization information provided for users to enter on another device. func (c *Config) DeviceAuth(ctx context.Context, opts ...AuthCodeOption) (*DeviceAuthResponse, error) { // https://datatracker.ietf.org/doc/html/rfc8628#section-3.1 v := url.Values{ "client_id": {c.ClientID}, } if len(c.Scopes) > 0 { v.Set("scope", strings.Join(c.Scopes, " ")) } for _, opt := range opts { opt.setValue(v) } return retrieveDeviceAuth(ctx, c, v) } func retrieveDeviceAuth(ctx context.Context, c *Config, v url.Values) (*DeviceAuthResponse, error) { if c.Endpoint.DeviceAuthURL == "" { return nil, errors.New("endpoint missing DeviceAuthURL") } req, err := http.NewRequest("POST", c.Endpoint.DeviceAuthURL, strings.NewReader(v.Encode())) if err != nil { return nil, err } req.Header.Set("Content-Type", "application/x-www-form-urlencoded") req.Header.Set("Accept", "application/json") t := time.Now() r, err := internal.ContextClient(ctx).Do(req) if err != nil { return nil, err } body, err := io.ReadAll(io.LimitReader(r.Body, 1<<20)) if err != nil { return nil, fmt.Errorf("oauth2: cannot auth device: %v", err) } if code := r.StatusCode; code < 200 || code > 299 { retrieveError := &RetrieveError{ Response: r, Body: body, } content, _, _ := mime.ParseMediaType(r.Header.Get("Content-Type")) switch content { case "application/x-www-form-urlencoded", "text/plain": // some endpoints return a query string vals, err := url.ParseQuery(string(body)) if err != nil { return nil, retrieveError } retrieveError.ErrorCode = vals.Get("error") retrieveError.ErrorDescription = vals.Get("error_description") retrieveError.ErrorURI = vals.Get("error_uri") default: var tj struct { // https://datatracker.ietf.org/doc/html/rfc6749#section-5.2 ErrorCode string `json:"error"` ErrorDescription string `json:"error_description"` ErrorURI string `json:"error_uri"` } if json.Unmarshal(body, &tj) != nil { return nil, retrieveError } retrieveError.ErrorCode = tj.ErrorCode retrieveError.ErrorDescription = tj.ErrorDescription retrieveError.ErrorURI = tj.ErrorURI } return nil, retrieveError } da := &DeviceAuthResponse{} err = json.Unmarshal(body, &da) if err != nil { return nil, fmt.Errorf("unmarshal %s", err) } if !da.Expiry.IsZero() { // Make a small adjustment to account for time taken by the request da.Expiry = da.Expiry.Add(-time.Since(t)) } return da, nil } // DeviceAccessToken polls the server to exchange a device code for a token. func (c *Config) DeviceAccessToken(ctx context.Context, da *DeviceAuthResponse, opts ...AuthCodeOption) (*Token, error) { if !da.Expiry.IsZero() { var cancel context.CancelFunc ctx, cancel = context.WithDeadline(ctx, da.Expiry) defer cancel() } // https://datatracker.ietf.org/doc/html/rfc8628#section-3.4 v := url.Values{ "client_id": {c.ClientID}, "grant_type": {"urn:ietf:params:oauth:grant-type:device_code"}, "device_code": {da.DeviceCode}, } if len(c.Scopes) > 0 { v.Set("scope", strings.Join(c.Scopes, " ")) } for _, opt := range opts { opt.setValue(v) } // "If no value is provided, clients MUST use 5 as the default." // https://datatracker.ietf.org/doc/html/rfc8628#section-3.2 interval := da.Interval if interval == 0 { interval = 5 } ticker := time.NewTicker(time.Duration(interval) * time.Second) defer ticker.Stop() for { select { case <-ctx.Done(): return nil, ctx.Err() case <-ticker.C: tok, err := retrieveToken(ctx, c, v) if err == nil { return tok, nil } e, ok := err.(*RetrieveError) if !ok { return nil, err } switch e.ErrorCode { case errSlowDown: // https://datatracker.ietf.org/doc/html/rfc8628#section-3.5 // "the interval MUST be increased by 5 seconds for this and all subsequent requests" interval += 5 ticker.Reset(time.Duration(interval) * time.Second) case errAuthorizationPending: // Do nothing. case errAccessDenied, errExpiredToken: fallthrough default: return tok, err } } } } ================================================ FILE: vendor/golang.org/x/oauth2/internal/doc.go ================================================ // Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package internal contains support packages for [golang.org/x/oauth2]. package internal ================================================ FILE: vendor/golang.org/x/oauth2/internal/oauth2.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package internal import ( "crypto/rsa" "crypto/x509" "encoding/pem" "errors" "fmt" ) // ParseKey converts the binary contents of a private key file // to an [*rsa.PrivateKey]. It detects whether the private key is in a // PEM container or not. If so, it extracts the private key // from PEM container before conversion. It only supports PEM // containers with no passphrase. func ParseKey(key []byte) (*rsa.PrivateKey, error) { block, _ := pem.Decode(key) if block != nil { key = block.Bytes } parsedKey, err := x509.ParsePKCS8PrivateKey(key) if err != nil { parsedKey, err = x509.ParsePKCS1PrivateKey(key) if err != nil { return nil, fmt.Errorf("private key should be a PEM or plain PKCS1 or PKCS8; parse error: %v", err) } } parsed, ok := parsedKey.(*rsa.PrivateKey) if !ok { return nil, errors.New("private key is invalid") } return parsed, nil } ================================================ FILE: vendor/golang.org/x/oauth2/internal/token.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package internal import ( "context" "encoding/json" "errors" "fmt" "io" "math" "mime" "net/http" "net/url" "strconv" "strings" "sync" "sync/atomic" "time" ) // Token represents the credentials used to authorize // the requests to access protected resources on the OAuth 2.0 // provider's backend. // // This type is a mirror of [golang.org/x/oauth2.Token] and exists to break // an otherwise-circular dependency. Other internal packages // should convert this Token into an [golang.org/x/oauth2.Token] before use. type Token struct { // AccessToken is the token that authorizes and authenticates // the requests. AccessToken string // TokenType is the type of token. // The Type method returns either this or "Bearer", the default. TokenType string // RefreshToken is a token that's used by the application // (as opposed to the user) to refresh the access token // if it expires. RefreshToken string // Expiry is the optional expiration time of the access token. // // If zero, TokenSource implementations will reuse the same // token forever and RefreshToken or equivalent // mechanisms for that TokenSource will not be used. Expiry time.Time // ExpiresIn is the OAuth2 wire format "expires_in" field, // which specifies how many seconds later the token expires, // relative to an unknown time base approximately around "now". // It is the application's responsibility to populate // `Expiry` from `ExpiresIn` when required. ExpiresIn int64 `json:"expires_in,omitempty"` // Raw optionally contains extra metadata from the server // when updating a token. Raw any } // tokenJSON is the struct representing the HTTP response from OAuth2 // providers returning a token or error in JSON form. // https://datatracker.ietf.org/doc/html/rfc6749#section-5.1 type tokenJSON struct { AccessToken string `json:"access_token"` TokenType string `json:"token_type"` RefreshToken string `json:"refresh_token"` ExpiresIn expirationTime `json:"expires_in"` // at least PayPal returns string, while most return number // error fields // https://datatracker.ietf.org/doc/html/rfc6749#section-5.2 ErrorCode string `json:"error"` ErrorDescription string `json:"error_description"` ErrorURI string `json:"error_uri"` } func (e *tokenJSON) expiry() (t time.Time) { if v := e.ExpiresIn; v != 0 { return time.Now().Add(time.Duration(v) * time.Second) } return } type expirationTime int32 func (e *expirationTime) UnmarshalJSON(b []byte) error { if len(b) == 0 || string(b) == "null" { return nil } var n json.Number err := json.Unmarshal(b, &n) if err != nil { return err } i, err := n.Int64() if err != nil { return err } if i > math.MaxInt32 { i = math.MaxInt32 } *e = expirationTime(i) return nil } // AuthStyle is a copy of the golang.org/x/oauth2 package's AuthStyle type. type AuthStyle int const ( AuthStyleUnknown AuthStyle = 0 AuthStyleInParams AuthStyle = 1 AuthStyleInHeader AuthStyle = 2 ) // LazyAuthStyleCache is a backwards compatibility compromise to let Configs // have a lazily-initialized AuthStyleCache. // // The two users of this, oauth2.Config and oauth2/clientcredentials.Config, // both would ideally just embed an unexported AuthStyleCache but because both // were historically allowed to be copied by value we can't retroactively add an // uncopyable Mutex to them. // // We could use an atomic.Pointer, but that was added recently enough (in Go // 1.18) that we'd break Go 1.17 users where the tests as of 2023-08-03 // still pass. By using an atomic.Value, it supports both Go 1.17 and // copying by value, even if that's not ideal. type LazyAuthStyleCache struct { v atomic.Value // of *AuthStyleCache } func (lc *LazyAuthStyleCache) Get() *AuthStyleCache { if c, ok := lc.v.Load().(*AuthStyleCache); ok { return c } c := new(AuthStyleCache) if !lc.v.CompareAndSwap(nil, c) { c = lc.v.Load().(*AuthStyleCache) } return c } type authStyleCacheKey struct { url string clientID string } // AuthStyleCache is the set of tokenURLs we've successfully used via // RetrieveToken and which style auth we ended up using. // It's called a cache, but it doesn't (yet?) shrink. It's expected that // the set of OAuth2 servers a program contacts over time is fixed and // small. type AuthStyleCache struct { mu sync.Mutex m map[authStyleCacheKey]AuthStyle } // lookupAuthStyle reports which auth style we last used with tokenURL // when calling RetrieveToken and whether we have ever done so. func (c *AuthStyleCache) lookupAuthStyle(tokenURL, clientID string) (style AuthStyle, ok bool) { c.mu.Lock() defer c.mu.Unlock() style, ok = c.m[authStyleCacheKey{tokenURL, clientID}] return } // setAuthStyle adds an entry to authStyleCache, documented above. func (c *AuthStyleCache) setAuthStyle(tokenURL, clientID string, v AuthStyle) { c.mu.Lock() defer c.mu.Unlock() if c.m == nil { c.m = make(map[authStyleCacheKey]AuthStyle) } c.m[authStyleCacheKey{tokenURL, clientID}] = v } // newTokenRequest returns a new *http.Request to retrieve a new token // from tokenURL using the provided clientID, clientSecret, and POST // body parameters. // // inParams is whether the clientID & clientSecret should be encoded // as the POST body. An 'inParams' value of true means to send it in // the POST body (along with any values in v); false means to send it // in the Authorization header. func newTokenRequest(tokenURL, clientID, clientSecret string, v url.Values, authStyle AuthStyle) (*http.Request, error) { if authStyle == AuthStyleInParams { v = cloneURLValues(v) if clientID != "" { v.Set("client_id", clientID) } if clientSecret != "" { v.Set("client_secret", clientSecret) } } req, err := http.NewRequest("POST", tokenURL, strings.NewReader(v.Encode())) if err != nil { return nil, err } req.Header.Set("Content-Type", "application/x-www-form-urlencoded") if authStyle == AuthStyleInHeader { req.SetBasicAuth(url.QueryEscape(clientID), url.QueryEscape(clientSecret)) } return req, nil } func cloneURLValues(v url.Values) url.Values { v2 := make(url.Values, len(v)) for k, vv := range v { v2[k] = append([]string(nil), vv...) } return v2 } func RetrieveToken(ctx context.Context, clientID, clientSecret, tokenURL string, v url.Values, authStyle AuthStyle, styleCache *AuthStyleCache) (*Token, error) { needsAuthStyleProbe := authStyle == AuthStyleUnknown if needsAuthStyleProbe { if style, ok := styleCache.lookupAuthStyle(tokenURL, clientID); ok { authStyle = style needsAuthStyleProbe = false } else { authStyle = AuthStyleInHeader // the first way we'll try } } req, err := newTokenRequest(tokenURL, clientID, clientSecret, v, authStyle) if err != nil { return nil, err } token, err := doTokenRoundTrip(ctx, req) if err != nil && needsAuthStyleProbe { // If we get an error, assume the server wants the // clientID & clientSecret in a different form. // See https://code.google.com/p/goauth2/issues/detail?id=31 for background. // In summary: // - Reddit only accepts client secret in the Authorization header // - Dropbox accepts either it in URL param or Auth header, but not both. // - Google only accepts URL param (not spec compliant?), not Auth header // - Stripe only accepts client secret in Auth header with Bearer method, not Basic // // We used to maintain a big table in this code of all the sites and which way // they went, but maintaining it didn't scale & got annoying. // So just try both ways. authStyle = AuthStyleInParams // the second way we'll try req, _ = newTokenRequest(tokenURL, clientID, clientSecret, v, authStyle) token, err = doTokenRoundTrip(ctx, req) } if needsAuthStyleProbe && err == nil { styleCache.setAuthStyle(tokenURL, clientID, authStyle) } // Don't overwrite `RefreshToken` with an empty value // if this was a token refreshing request. if token != nil && token.RefreshToken == "" { token.RefreshToken = v.Get("refresh_token") } return token, err } func doTokenRoundTrip(ctx context.Context, req *http.Request) (*Token, error) { r, err := ContextClient(ctx).Do(req.WithContext(ctx)) if err != nil { return nil, err } body, err := io.ReadAll(io.LimitReader(r.Body, 1<<20)) r.Body.Close() if err != nil { return nil, fmt.Errorf("oauth2: cannot fetch token: %v", err) } failureStatus := r.StatusCode < 200 || r.StatusCode > 299 retrieveError := &RetrieveError{ Response: r, Body: body, // attempt to populate error detail below } var token *Token content, _, _ := mime.ParseMediaType(r.Header.Get("Content-Type")) switch content { case "application/x-www-form-urlencoded", "text/plain": // some endpoints return a query string vals, err := url.ParseQuery(string(body)) if err != nil { if failureStatus { return nil, retrieveError } return nil, fmt.Errorf("oauth2: cannot parse response: %v", err) } retrieveError.ErrorCode = vals.Get("error") retrieveError.ErrorDescription = vals.Get("error_description") retrieveError.ErrorURI = vals.Get("error_uri") token = &Token{ AccessToken: vals.Get("access_token"), TokenType: vals.Get("token_type"), RefreshToken: vals.Get("refresh_token"), Raw: vals, } e := vals.Get("expires_in") expires, _ := strconv.Atoi(e) if expires != 0 { token.Expiry = time.Now().Add(time.Duration(expires) * time.Second) } default: var tj tokenJSON if err = json.Unmarshal(body, &tj); err != nil { if failureStatus { return nil, retrieveError } return nil, fmt.Errorf("oauth2: cannot parse json: %v", err) } retrieveError.ErrorCode = tj.ErrorCode retrieveError.ErrorDescription = tj.ErrorDescription retrieveError.ErrorURI = tj.ErrorURI token = &Token{ AccessToken: tj.AccessToken, TokenType: tj.TokenType, RefreshToken: tj.RefreshToken, Expiry: tj.expiry(), ExpiresIn: int64(tj.ExpiresIn), Raw: make(map[string]any), } json.Unmarshal(body, &token.Raw) // no error checks for optional fields } // according to spec, servers should respond status 400 in error case // https://www.rfc-editor.org/rfc/rfc6749#section-5.2 // but some unorthodox servers respond 200 in error case if failureStatus || retrieveError.ErrorCode != "" { return nil, retrieveError } if token.AccessToken == "" { return nil, errors.New("oauth2: server response missing access_token") } return token, nil } // mirrors oauth2.RetrieveError type RetrieveError struct { Response *http.Response Body []byte ErrorCode string ErrorDescription string ErrorURI string } func (r *RetrieveError) Error() string { if r.ErrorCode != "" { s := fmt.Sprintf("oauth2: %q", r.ErrorCode) if r.ErrorDescription != "" { s += fmt.Sprintf(" %q", r.ErrorDescription) } if r.ErrorURI != "" { s += fmt.Sprintf(" %q", r.ErrorURI) } return s } return fmt.Sprintf("oauth2: cannot fetch token: %v\nResponse: %s", r.Response.Status, r.Body) } ================================================ FILE: vendor/golang.org/x/oauth2/internal/transport.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package internal import ( "context" "net/http" ) // HTTPClient is the context key to use with [context.WithValue] // to associate an [*http.Client] value with a context. var HTTPClient ContextKey // ContextKey is just an empty struct. It exists so HTTPClient can be // an immutable public variable with a unique type. It's immutable // because nobody else can create a ContextKey, being unexported. type ContextKey struct{} func ContextClient(ctx context.Context) *http.Client { if ctx != nil { if hc, ok := ctx.Value(HTTPClient).(*http.Client); ok { return hc } } return http.DefaultClient } ================================================ FILE: vendor/golang.org/x/oauth2/oauth2.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package oauth2 provides support for making // OAuth2 authorized and authenticated HTTP requests, // as specified in RFC 6749. // It can additionally grant authorization with Bearer JWT. package oauth2 // import "golang.org/x/oauth2" import ( "context" "errors" "net/http" "net/url" "strings" "sync" "time" "golang.org/x/oauth2/internal" ) // NoContext is the default context you should supply if not using // your own [context.Context]. // // Deprecated: Use [context.Background] or [context.TODO] instead. var NoContext = context.TODO() // RegisterBrokenAuthHeaderProvider previously did something. It is now a no-op. // // Deprecated: this function no longer does anything. Caller code that // wants to avoid potential extra HTTP requests made during // auto-probing of the provider's auth style should set // Endpoint.AuthStyle. func RegisterBrokenAuthHeaderProvider(tokenURL string) {} // Config describes a typical 3-legged OAuth2 flow, with both the // client application information and the server's endpoint URLs. // For the client credentials 2-legged OAuth2 flow, see the // [golang.org/x/oauth2/clientcredentials] package. type Config struct { // ClientID is the application's ID. ClientID string // ClientSecret is the application's secret. ClientSecret string // Endpoint contains the authorization server's token endpoint // URLs. These are constants specific to each server and are // often available via site-specific packages, such as // google.Endpoint or github.Endpoint. Endpoint Endpoint // RedirectURL is the URL to redirect users going through // the OAuth flow, after the resource owner's URLs. RedirectURL string // Scopes specifies optional requested permissions. Scopes []string // authStyleCache caches which auth style to use when Endpoint.AuthStyle is // the zero value (AuthStyleAutoDetect). authStyleCache internal.LazyAuthStyleCache } // A TokenSource is anything that can return a token. type TokenSource interface { // Token returns a token or an error. // Token must be safe for concurrent use by multiple goroutines. // The returned Token must not be modified. Token() (*Token, error) } // Endpoint represents an OAuth 2.0 provider's authorization and token // endpoint URLs. type Endpoint struct { AuthURL string DeviceAuthURL string TokenURL string // AuthStyle optionally specifies how the endpoint wants the // client ID & client secret sent. The zero value means to // auto-detect. AuthStyle AuthStyle } // AuthStyle represents how requests for tokens are authenticated // to the server. type AuthStyle int const ( // AuthStyleAutoDetect means to auto-detect which authentication // style the provider wants by trying both ways and caching // the successful way for the future. AuthStyleAutoDetect AuthStyle = 0 // AuthStyleInParams sends the "client_id" and "client_secret" // in the POST body as application/x-www-form-urlencoded parameters. AuthStyleInParams AuthStyle = 1 // AuthStyleInHeader sends the client_id and client_secret // using HTTP Basic Authorization. This is an optional style // described in the OAuth2 RFC 6749 section 2.3.1. AuthStyleInHeader AuthStyle = 2 ) var ( // AccessTypeOnline and AccessTypeOffline are options passed // to the Options.AuthCodeURL method. They modify the // "access_type" field that gets sent in the URL returned by // AuthCodeURL. // // Online is the default if neither is specified. If your // application needs to refresh access tokens when the user // is not present at the browser, then use offline. This will // result in your application obtaining a refresh token the // first time your application exchanges an authorization // code for a user. AccessTypeOnline AuthCodeOption = SetAuthURLParam("access_type", "online") AccessTypeOffline AuthCodeOption = SetAuthURLParam("access_type", "offline") // ApprovalForce forces the users to view the consent dialog // and confirm the permissions request at the URL returned // from AuthCodeURL, even if they've already done so. ApprovalForce AuthCodeOption = SetAuthURLParam("prompt", "consent") ) // An AuthCodeOption is passed to Config.AuthCodeURL. type AuthCodeOption interface { setValue(url.Values) } type setParam struct{ k, v string } func (p setParam) setValue(m url.Values) { m.Set(p.k, p.v) } // SetAuthURLParam builds an [AuthCodeOption] which passes key/value parameters // to a provider's authorization endpoint. func SetAuthURLParam(key, value string) AuthCodeOption { return setParam{key, value} } // AuthCodeURL returns a URL to OAuth 2.0 provider's consent page // that asks for permissions for the required scopes explicitly. // // State is an opaque value used by the client to maintain state between the // request and callback. The authorization server includes this value when // redirecting the user agent back to the client. // // Opts may include [AccessTypeOnline] or [AccessTypeOffline], as well // as [ApprovalForce]. // // To protect against CSRF attacks, opts should include a PKCE challenge // (S256ChallengeOption). Not all servers support PKCE. An alternative is to // generate a random state parameter and verify it after exchange. // See https://datatracker.ietf.org/doc/html/rfc6749#section-10.12 (predating // PKCE), https://www.oauth.com/oauth2-servers/pkce/ and // https://www.ietf.org/archive/id/draft-ietf-oauth-v2-1-09.html#name-cross-site-request-forgery (describing both approaches) func (c *Config) AuthCodeURL(state string, opts ...AuthCodeOption) string { var buf strings.Builder buf.WriteString(c.Endpoint.AuthURL) v := url.Values{ "response_type": {"code"}, "client_id": {c.ClientID}, } if c.RedirectURL != "" { v.Set("redirect_uri", c.RedirectURL) } if len(c.Scopes) > 0 { v.Set("scope", strings.Join(c.Scopes, " ")) } if state != "" { v.Set("state", state) } for _, opt := range opts { opt.setValue(v) } if strings.Contains(c.Endpoint.AuthURL, "?") { buf.WriteByte('&') } else { buf.WriteByte('?') } buf.WriteString(v.Encode()) return buf.String() } // PasswordCredentialsToken converts a resource owner username and password // pair into a token. // // Per the RFC, this grant type should only be used "when there is a high // degree of trust between the resource owner and the client (e.g., the client // is part of the device operating system or a highly privileged application), // and when other authorization grant types are not available." // See https://tools.ietf.org/html/rfc6749#section-4.3 for more info. // // The provided context optionally controls which HTTP client is used. See the [HTTPClient] variable. func (c *Config) PasswordCredentialsToken(ctx context.Context, username, password string) (*Token, error) { v := url.Values{ "grant_type": {"password"}, "username": {username}, "password": {password}, } if len(c.Scopes) > 0 { v.Set("scope", strings.Join(c.Scopes, " ")) } return retrieveToken(ctx, c, v) } // Exchange converts an authorization code into a token. // // It is used after a resource provider redirects the user back // to the Redirect URI (the URL obtained from AuthCodeURL). // // The provided context optionally controls which HTTP client is used. See the [HTTPClient] variable. // // The code will be in the [http.Request.FormValue]("code"). Before // calling Exchange, be sure to validate [http.Request.FormValue]("state") if you are // using it to protect against CSRF attacks. // // If using PKCE to protect against CSRF attacks, opts should include a // VerifierOption. func (c *Config) Exchange(ctx context.Context, code string, opts ...AuthCodeOption) (*Token, error) { v := url.Values{ "grant_type": {"authorization_code"}, "code": {code}, } if c.RedirectURL != "" { v.Set("redirect_uri", c.RedirectURL) } for _, opt := range opts { opt.setValue(v) } return retrieveToken(ctx, c, v) } // Client returns an HTTP client using the provided token. // The token will auto-refresh as necessary. The underlying // HTTP transport will be obtained using the provided context. // The returned client and its Transport should not be modified. func (c *Config) Client(ctx context.Context, t *Token) *http.Client { return NewClient(ctx, c.TokenSource(ctx, t)) } // TokenSource returns a [TokenSource] that returns t until t expires, // automatically refreshing it as necessary using the provided context. // // Most users will use [Config.Client] instead. func (c *Config) TokenSource(ctx context.Context, t *Token) TokenSource { tkr := &tokenRefresher{ ctx: ctx, conf: c, } if t != nil { tkr.refreshToken = t.RefreshToken } return &reuseTokenSource{ t: t, new: tkr, } } // tokenRefresher is a TokenSource that makes "grant_type=refresh_token" // HTTP requests to renew a token using a RefreshToken. type tokenRefresher struct { ctx context.Context // used to get HTTP requests conf *Config refreshToken string } // WARNING: Token is not safe for concurrent access, as it // updates the tokenRefresher's refreshToken field. // Within this package, it is used by reuseTokenSource which // synchronizes calls to this method with its own mutex. func (tf *tokenRefresher) Token() (*Token, error) { if tf.refreshToken == "" { return nil, errors.New("oauth2: token expired and refresh token is not set") } tk, err := retrieveToken(tf.ctx, tf.conf, url.Values{ "grant_type": {"refresh_token"}, "refresh_token": {tf.refreshToken}, }) if err != nil { return nil, err } if tf.refreshToken != tk.RefreshToken { tf.refreshToken = tk.RefreshToken } return tk, nil } // reuseTokenSource is a TokenSource that holds a single token in memory // and validates its expiry before each call to retrieve it with // Token. If it's expired, it will be auto-refreshed using the // new TokenSource. type reuseTokenSource struct { new TokenSource // called when t is expired. mu sync.Mutex // guards t t *Token expiryDelta time.Duration } // Token returns the current token if it's still valid, else will // refresh the current token and return the new one. func (s *reuseTokenSource) Token() (*Token, error) { s.mu.Lock() defer s.mu.Unlock() if s.t.Valid() { return s.t, nil } t, err := s.new.Token() if err != nil { return nil, err } t.expiryDelta = s.expiryDelta s.t = t return t, nil } // StaticTokenSource returns a [TokenSource] that always returns the same token. // Because the provided token t is never refreshed, StaticTokenSource is only // useful for tokens that never expire. func StaticTokenSource(t *Token) TokenSource { return staticTokenSource{t} } // staticTokenSource is a TokenSource that always returns the same Token. type staticTokenSource struct { t *Token } func (s staticTokenSource) Token() (*Token, error) { return s.t, nil } // HTTPClient is the context key to use with [context.WithValue] // to associate a [*http.Client] value with a context. var HTTPClient internal.ContextKey // NewClient creates an [*http.Client] from a [context.Context] and [TokenSource]. // The returned client is not valid beyond the lifetime of the context. // // Note that if a custom [*http.Client] is provided via the [context.Context] it // is used only for token acquisition and is not used to configure the // [*http.Client] returned from NewClient. // // As a special case, if src is nil, a non-OAuth2 client is returned // using the provided context. This exists to support related OAuth2 // packages. func NewClient(ctx context.Context, src TokenSource) *http.Client { if src == nil { return internal.ContextClient(ctx) } cc := internal.ContextClient(ctx) return &http.Client{ Transport: &Transport{ Base: cc.Transport, Source: ReuseTokenSource(nil, src), }, CheckRedirect: cc.CheckRedirect, Jar: cc.Jar, Timeout: cc.Timeout, } } // ReuseTokenSource returns a [TokenSource] which repeatedly returns the // same token as long as it's valid, starting with t. // When its cached token is invalid, a new token is obtained from src. // // ReuseTokenSource is typically used to reuse tokens from a cache // (such as a file on disk) between runs of a program, rather than // obtaining new tokens unnecessarily. // // The initial token t may be nil, in which case the [TokenSource] is // wrapped in a caching version if it isn't one already. This also // means it's always safe to wrap ReuseTokenSource around any other // [TokenSource] without adverse effects. func ReuseTokenSource(t *Token, src TokenSource) TokenSource { // Don't wrap a reuseTokenSource in itself. That would work, // but cause an unnecessary number of mutex operations. // Just build the equivalent one. if rt, ok := src.(*reuseTokenSource); ok { if t == nil { // Just use it directly. return rt } src = rt.new } return &reuseTokenSource{ t: t, new: src, } } // ReuseTokenSourceWithExpiry returns a [TokenSource] that acts in the same manner as the // [TokenSource] returned by [ReuseTokenSource], except the expiry buffer is // configurable. The expiration time of a token is calculated as // t.Expiry.Add(-earlyExpiry). func ReuseTokenSourceWithExpiry(t *Token, src TokenSource, earlyExpiry time.Duration) TokenSource { // Don't wrap a reuseTokenSource in itself. That would work, // but cause an unnecessary number of mutex operations. // Just build the equivalent one. if rt, ok := src.(*reuseTokenSource); ok { if t == nil { // Just use it directly, but set the expiryDelta to earlyExpiry, // so the behavior matches what the user expects. rt.expiryDelta = earlyExpiry return rt } src = rt.new } if t != nil { t.expiryDelta = earlyExpiry } return &reuseTokenSource{ t: t, new: src, expiryDelta: earlyExpiry, } } ================================================ FILE: vendor/golang.org/x/oauth2/pkce.go ================================================ // Copyright 2023 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package oauth2 import ( "crypto/rand" "crypto/sha256" "encoding/base64" "net/url" ) const ( codeChallengeKey = "code_challenge" codeChallengeMethodKey = "code_challenge_method" codeVerifierKey = "code_verifier" ) // GenerateVerifier generates a PKCE code verifier with 32 octets of randomness. // This follows recommendations in RFC 7636. // // A fresh verifier should be generated for each authorization. // The resulting verifier should be passed to [Config.AuthCodeURL] or [Config.DeviceAuth] // with [S256ChallengeOption], and to [Config.Exchange] or [Config.DeviceAccessToken] // with [VerifierOption]. func GenerateVerifier() string { // "RECOMMENDED that the output of a suitable random number generator be // used to create a 32-octet sequence. The octet sequence is then // base64url-encoded to produce a 43-octet URL-safe string to use as the // code verifier." // https://datatracker.ietf.org/doc/html/rfc7636#section-4.1 data := make([]byte, 32) if _, err := rand.Read(data); err != nil { panic(err) } return base64.RawURLEncoding.EncodeToString(data) } // VerifierOption returns a PKCE code verifier [AuthCodeOption]. It should only be // passed to [Config.Exchange] or [Config.DeviceAccessToken]. func VerifierOption(verifier string) AuthCodeOption { return setParam{k: codeVerifierKey, v: verifier} } // S256ChallengeFromVerifier returns a PKCE code challenge derived from verifier with method S256. // // Prefer to use [S256ChallengeOption] where possible. func S256ChallengeFromVerifier(verifier string) string { sha := sha256.Sum256([]byte(verifier)) return base64.RawURLEncoding.EncodeToString(sha[:]) } // S256ChallengeOption derives a PKCE code challenge from the verifier with // method S256. It should be passed to [Config.AuthCodeURL] or [Config.DeviceAuth] // only. func S256ChallengeOption(verifier string) AuthCodeOption { return challengeOption{ challenge_method: "S256", challenge: S256ChallengeFromVerifier(verifier), } } type challengeOption struct{ challenge_method, challenge string } func (p challengeOption) setValue(m url.Values) { m.Set(codeChallengeMethodKey, p.challenge_method) m.Set(codeChallengeKey, p.challenge) } ================================================ FILE: vendor/golang.org/x/oauth2/token.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package oauth2 import ( "context" "fmt" "net/http" "net/url" "strconv" "strings" "time" "golang.org/x/oauth2/internal" ) // defaultExpiryDelta determines how earlier a token should be considered // expired than its actual expiration time. It is used to avoid late // expirations due to client-server time mismatches. const defaultExpiryDelta = 10 * time.Second // Token represents the credentials used to authorize // the requests to access protected resources on the OAuth 2.0 // provider's backend. // // Most users of this package should not access fields of Token // directly. They're exported mostly for use by related packages // implementing derivative OAuth2 flows. type Token struct { // AccessToken is the token that authorizes and authenticates // the requests. AccessToken string `json:"access_token"` // TokenType is the type of token. // The Type method returns either this or "Bearer", the default. TokenType string `json:"token_type,omitempty"` // RefreshToken is a token that's used by the application // (as opposed to the user) to refresh the access token // if it expires. RefreshToken string `json:"refresh_token,omitempty"` // Expiry is the optional expiration time of the access token. // // If zero, [TokenSource] implementations will reuse the same // token forever and RefreshToken or equivalent // mechanisms for that TokenSource will not be used. Expiry time.Time `json:"expiry,omitempty"` // ExpiresIn is the OAuth2 wire format "expires_in" field, // which specifies how many seconds later the token expires, // relative to an unknown time base approximately around "now". // It is the application's responsibility to populate // `Expiry` from `ExpiresIn` when required. ExpiresIn int64 `json:"expires_in,omitempty"` // raw optionally contains extra metadata from the server // when updating a token. raw any // expiryDelta is used to calculate when a token is considered // expired, by subtracting from Expiry. If zero, defaultExpiryDelta // is used. expiryDelta time.Duration } // Type returns t.TokenType if non-empty, else "Bearer". func (t *Token) Type() string { if strings.EqualFold(t.TokenType, "bearer") { return "Bearer" } if strings.EqualFold(t.TokenType, "mac") { return "MAC" } if strings.EqualFold(t.TokenType, "basic") { return "Basic" } if t.TokenType != "" { return t.TokenType } return "Bearer" } // SetAuthHeader sets the Authorization header to r using the access // token in t. // // This method is unnecessary when using [Transport] or an HTTP Client // returned by this package. func (t *Token) SetAuthHeader(r *http.Request) { r.Header.Set("Authorization", t.Type()+" "+t.AccessToken) } // WithExtra returns a new [Token] that's a clone of t, but using the // provided raw extra map. This is only intended for use by packages // implementing derivative OAuth2 flows. func (t *Token) WithExtra(extra any) *Token { t2 := new(Token) *t2 = *t t2.raw = extra return t2 } // Extra returns an extra field. // Extra fields are key-value pairs returned by the server as // part of the token retrieval response. func (t *Token) Extra(key string) any { if raw, ok := t.raw.(map[string]any); ok { return raw[key] } vals, ok := t.raw.(url.Values) if !ok { return nil } v := vals.Get(key) switch s := strings.TrimSpace(v); strings.Count(s, ".") { case 0: // Contains no "."; try to parse as int if i, err := strconv.ParseInt(s, 10, 64); err == nil { return i } case 1: // Contains a single "."; try to parse as float if f, err := strconv.ParseFloat(s, 64); err == nil { return f } } return v } // timeNow is time.Now but pulled out as a variable for tests. var timeNow = time.Now // expired reports whether the token is expired. // t must be non-nil. func (t *Token) expired() bool { if t.Expiry.IsZero() { return false } expiryDelta := defaultExpiryDelta if t.expiryDelta != 0 { expiryDelta = t.expiryDelta } return t.Expiry.Round(0).Add(-expiryDelta).Before(timeNow()) } // Valid reports whether t is non-nil, has an AccessToken, and is not expired. func (t *Token) Valid() bool { return t != nil && t.AccessToken != "" && !t.expired() } // tokenFromInternal maps an *internal.Token struct into // a *Token struct. func tokenFromInternal(t *internal.Token) *Token { if t == nil { return nil } return &Token{ AccessToken: t.AccessToken, TokenType: t.TokenType, RefreshToken: t.RefreshToken, Expiry: t.Expiry, ExpiresIn: t.ExpiresIn, raw: t.Raw, } } // retrieveToken takes a *Config and uses that to retrieve an *internal.Token. // This token is then mapped from *internal.Token into an *oauth2.Token which is returned along // with an error. func retrieveToken(ctx context.Context, c *Config, v url.Values) (*Token, error) { tk, err := internal.RetrieveToken(ctx, c.ClientID, c.ClientSecret, c.Endpoint.TokenURL, v, internal.AuthStyle(c.Endpoint.AuthStyle), c.authStyleCache.Get()) if err != nil { if rErr, ok := err.(*internal.RetrieveError); ok { return nil, (*RetrieveError)(rErr) } return nil, err } return tokenFromInternal(tk), nil } // RetrieveError is the error returned when the token endpoint returns a // non-2XX HTTP status code or populates RFC 6749's 'error' parameter. // https://datatracker.ietf.org/doc/html/rfc6749#section-5.2 type RetrieveError struct { Response *http.Response // Body is the body that was consumed by reading Response.Body. // It may be truncated. Body []byte // ErrorCode is RFC 6749's 'error' parameter. ErrorCode string // ErrorDescription is RFC 6749's 'error_description' parameter. ErrorDescription string // ErrorURI is RFC 6749's 'error_uri' parameter. ErrorURI string } func (r *RetrieveError) Error() string { if r.ErrorCode != "" { s := fmt.Sprintf("oauth2: %q", r.ErrorCode) if r.ErrorDescription != "" { s += fmt.Sprintf(" %q", r.ErrorDescription) } if r.ErrorURI != "" { s += fmt.Sprintf(" %q", r.ErrorURI) } return s } return fmt.Sprintf("oauth2: cannot fetch token: %v\nResponse: %s", r.Response.Status, r.Body) } ================================================ FILE: vendor/golang.org/x/oauth2/transport.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package oauth2 import ( "errors" "log" "net/http" "sync" ) // Transport is an [http.RoundTripper] that makes OAuth 2.0 HTTP requests, // wrapping a base [http.RoundTripper] and adding an Authorization header // with a token from the supplied [TokenSource]. // // Transport is a low-level mechanism. Most code will use the // higher-level [Config.Client] method instead. type Transport struct { // Source supplies the token to add to outgoing requests' // Authorization headers. Source TokenSource // Base is the base RoundTripper used to make HTTP requests. // If nil, http.DefaultTransport is used. Base http.RoundTripper } // RoundTrip authorizes and authenticates the request with an // access token from Transport's Source. func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) { reqBodyClosed := false if req.Body != nil { defer func() { if !reqBodyClosed { req.Body.Close() } }() } if t.Source == nil { return nil, errors.New("oauth2: Transport's Source is nil") } token, err := t.Source.Token() if err != nil { return nil, err } req2 := req.Clone(req.Context()) token.SetAuthHeader(req2) // req.Body is assumed to be closed by the base RoundTripper. reqBodyClosed = true return t.base().RoundTrip(req2) } var cancelOnce sync.Once // CancelRequest does nothing. It used to be a legacy cancellation mechanism // but now only logs on first use to warn that it's deprecated. // // Deprecated: use contexts for cancellation instead. func (t *Transport) CancelRequest(req *http.Request) { cancelOnce.Do(func() { log.Printf("deprecated: golang.org/x/oauth2: Transport.CancelRequest no longer does anything; use contexts") }) } func (t *Transport) base() http.RoundTripper { if t.Base != nil { return t.Base } return http.DefaultTransport } ================================================ FILE: vendor/golang.org/x/sync/LICENSE ================================================ Copyright 2009 The Go Authors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: vendor/golang.org/x/sync/PATENTS ================================================ Additional IP Rights Grant (Patents) "This implementation" means the copyrightable works distributed by Google as part of the Go project. Google hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, transfer and otherwise run, modify and propagate the contents of this implementation of Go, where such license applies only to those patent claims, both currently owned or controlled by Google and acquired in the future, licensable by Google that are necessarily infringed by this implementation of Go. This grant does not include claims that would be infringed only as a consequence of further modification of this implementation. If you or your agent or exclusive licensee institute or order or agree to the institution of patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that this implementation of Go or any code incorporated within this implementation of Go constitutes direct or contributory patent infringement, or inducement of patent infringement, then any patent rights granted to you under this License for this implementation of Go shall terminate as of the date such litigation is filed. ================================================ FILE: vendor/golang.org/x/sync/errgroup/errgroup.go ================================================ // Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package errgroup provides synchronization, error propagation, and Context // cancellation for groups of goroutines working on subtasks of a common task. // // [errgroup.Group] is related to [sync.WaitGroup] but adds handling of tasks // returning errors. package errgroup import ( "context" "fmt" "sync" ) type token struct{} // A Group is a collection of goroutines working on subtasks that are part of // the same overall task. A Group should not be reused for different tasks. // // A zero Group is valid, has no limit on the number of active goroutines, // and does not cancel on error. type Group struct { cancel func(error) wg sync.WaitGroup sem chan token errOnce sync.Once err error } func (g *Group) done() { if g.sem != nil { <-g.sem } g.wg.Done() } // WithContext returns a new Group and an associated Context derived from ctx. // // The derived Context is canceled the first time a function passed to Go // returns a non-nil error or the first time Wait returns, whichever occurs // first. func WithContext(ctx context.Context) (*Group, context.Context) { ctx, cancel := context.WithCancelCause(ctx) return &Group{cancel: cancel}, ctx } // Wait blocks until all function calls from the Go method have returned, then // returns the first non-nil error (if any) from them. func (g *Group) Wait() error { g.wg.Wait() if g.cancel != nil { g.cancel(g.err) } return g.err } // Go calls the given function in a new goroutine. // // The first call to Go must happen before a Wait. // It blocks until the new goroutine can be added without the number of // goroutines in the group exceeding the configured limit. // // The first goroutine in the group that returns a non-nil error will // cancel the associated Context, if any. The error will be returned // by Wait. func (g *Group) Go(f func() error) { if g.sem != nil { g.sem <- token{} } g.wg.Add(1) go func() { defer g.done() // It is tempting to propagate panics from f() // up to the goroutine that calls Wait, but // it creates more problems than it solves: // - it delays panics arbitrarily, // making bugs harder to detect; // - it turns f's panic stack into a mere value, // hiding it from crash-monitoring tools; // - it risks deadlocks that hide the panic entirely, // if f's panic leaves the program in a state // that prevents the Wait call from being reached. // See #53757, #74275, #74304, #74306. if err := f(); err != nil { g.errOnce.Do(func() { g.err = err if g.cancel != nil { g.cancel(g.err) } }) } }() } // TryGo calls the given function in a new goroutine only if the number of // active goroutines in the group is currently below the configured limit. // // The return value reports whether the goroutine was started. func (g *Group) TryGo(f func() error) bool { if g.sem != nil { select { case g.sem <- token{}: // Note: this allows barging iff channels in general allow barging. default: return false } } g.wg.Add(1) go func() { defer g.done() if err := f(); err != nil { g.errOnce.Do(func() { g.err = err if g.cancel != nil { g.cancel(g.err) } }) } }() return true } // SetLimit limits the number of active goroutines in this group to at most n. // A negative value indicates no limit. // A limit of zero will prevent any new goroutines from being added. // // Any subsequent call to the Go method will block until it can add an active // goroutine without exceeding the configured limit. // // The limit must not be modified while any goroutines in the group are active. func (g *Group) SetLimit(n int) { if n < 0 { g.sem = nil return } if active := len(g.sem); active != 0 { panic(fmt.Errorf("errgroup: modify limit while %v goroutines in the group are still active", active)) } g.sem = make(chan token, n) } ================================================ FILE: vendor/golang.org/x/sync/semaphore/semaphore.go ================================================ // Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package semaphore provides a weighted semaphore implementation. package semaphore // import "golang.org/x/sync/semaphore" import ( "container/list" "context" "sync" ) type waiter struct { n int64 ready chan<- struct{} // Closed when semaphore acquired. } // NewWeighted creates a new weighted semaphore with the given // maximum combined weight for concurrent access. func NewWeighted(n int64) *Weighted { w := &Weighted{size: n} return w } // Weighted provides a way to bound concurrent access to a resource. // The callers can request access with a given weight. type Weighted struct { size int64 cur int64 mu sync.Mutex waiters list.List } // Acquire acquires the semaphore with a weight of n, blocking until resources // are available or ctx is done. On success, returns nil. On failure, returns // ctx.Err() and leaves the semaphore unchanged. func (s *Weighted) Acquire(ctx context.Context, n int64) error { done := ctx.Done() s.mu.Lock() select { case <-done: // ctx becoming done has "happened before" acquiring the semaphore, // whether it became done before the call began or while we were // waiting for the mutex. We prefer to fail even if we could acquire // the mutex without blocking. s.mu.Unlock() return ctx.Err() default: } if s.size-s.cur >= n && s.waiters.Len() == 0 { // Since we hold s.mu and haven't synchronized since checking done, if // ctx becomes done before we return here, it becoming done must have // "happened concurrently" with this call - it cannot "happen before" // we return in this branch. So, we're ok to always acquire here. s.cur += n s.mu.Unlock() return nil } if n > s.size { // Don't make other Acquire calls block on one that's doomed to fail. s.mu.Unlock() <-done return ctx.Err() } ready := make(chan struct{}) w := waiter{n: n, ready: ready} elem := s.waiters.PushBack(w) s.mu.Unlock() select { case <-done: s.mu.Lock() select { case <-ready: // Acquired the semaphore after we were canceled. // Pretend we didn't and put the tokens back. s.cur -= n s.notifyWaiters() default: isFront := s.waiters.Front() == elem s.waiters.Remove(elem) // If we're at the front and there're extra tokens left, notify other waiters. if isFront && s.size > s.cur { s.notifyWaiters() } } s.mu.Unlock() return ctx.Err() case <-ready: // Acquired the semaphore. Check that ctx isn't already done. // We check the done channel instead of calling ctx.Err because we // already have the channel, and ctx.Err is O(n) with the nesting // depth of ctx. select { case <-done: s.Release(n) return ctx.Err() default: } return nil } } // TryAcquire acquires the semaphore with a weight of n without blocking. // On success, returns true. On failure, returns false and leaves the semaphore unchanged. func (s *Weighted) TryAcquire(n int64) bool { s.mu.Lock() success := s.size-s.cur >= n && s.waiters.Len() == 0 if success { s.cur += n } s.mu.Unlock() return success } // Release releases the semaphore with a weight of n. func (s *Weighted) Release(n int64) { s.mu.Lock() s.cur -= n if s.cur < 0 { s.mu.Unlock() panic("semaphore: released more than held") } s.notifyWaiters() s.mu.Unlock() } func (s *Weighted) notifyWaiters() { for { next := s.waiters.Front() if next == nil { break // No more waiters blocked. } w := next.Value.(waiter) if s.size-s.cur < w.n { // Not enough tokens for the next waiter. We could keep going (to try to // find a waiter with a smaller request), but under load that could cause // starvation for large requests; instead, we leave all remaining waiters // blocked. // // Consider a semaphore used as a read-write lock, with N tokens, N // readers, and one writer. Each reader can Acquire(1) to obtain a read // lock. The writer can Acquire(N) to obtain a write lock, excluding all // of the readers. If we allow the readers to jump ahead in the queue, // the writer will starve — there is always one token available for every // reader. break } s.cur += w.n s.waiters.Remove(next) close(w.ready) } } ================================================ FILE: vendor/golang.org/x/sys/LICENSE ================================================ Copyright 2009 The Go Authors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: vendor/golang.org/x/sys/PATENTS ================================================ Additional IP Rights Grant (Patents) "This implementation" means the copyrightable works distributed by Google as part of the Go project. Google hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, transfer and otherwise run, modify and propagate the contents of this implementation of Go, where such license applies only to those patent claims, both currently owned or controlled by Google and acquired in the future, licensable by Google that are necessarily infringed by this implementation of Go. This grant does not include claims that would be infringed only as a consequence of further modification of this implementation. If you or your agent or exclusive licensee institute or order or agree to the institution of patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that this implementation of Go or any code incorporated within this implementation of Go constitutes direct or contributory patent infringement, or inducement of patent infringement, then any patent rights granted to you under this License for this implementation of Go shall terminate as of the date such litigation is filed. ================================================ FILE: vendor/golang.org/x/sys/cpu/asm_aix_ppc64.s ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build gc #include "textflag.h" // // System calls for ppc64, AIX are implemented in runtime/syscall_aix.go // TEXT ·syscall6(SB),NOSPLIT,$0-88 JMP syscall·syscall6(SB) TEXT ·rawSyscall6(SB),NOSPLIT,$0-88 JMP syscall·rawSyscall6(SB) ================================================ FILE: vendor/golang.org/x/sys/cpu/asm_darwin_arm64_gc.s ================================================ // Copyright 2024 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build darwin && arm64 && gc #include "textflag.h" TEXT libc_sysctlbyname_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sysctlbyname(SB) GLOBL ·libc_sysctlbyname_trampoline_addr(SB), RODATA, $8 DATA ·libc_sysctlbyname_trampoline_addr(SB)/8, $libc_sysctlbyname_trampoline<>(SB) ================================================ FILE: vendor/golang.org/x/sys/cpu/asm_darwin_x86_gc.s ================================================ // Copyright 2024 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build darwin && amd64 && gc #include "textflag.h" TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sysctl(SB) GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8 DATA ·libc_sysctl_trampoline_addr(SB)/8, $libc_sysctl_trampoline<>(SB) TEXT libc_sysctlbyname_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sysctlbyname(SB) GLOBL ·libc_sysctlbyname_trampoline_addr(SB), RODATA, $8 DATA ·libc_sysctlbyname_trampoline_addr(SB)/8, $libc_sysctlbyname_trampoline<>(SB) ================================================ FILE: vendor/golang.org/x/sys/cpu/byteorder.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cpu import ( "runtime" ) // byteOrder is a subset of encoding/binary.ByteOrder. type byteOrder interface { Uint32([]byte) uint32 Uint64([]byte) uint64 } type littleEndian struct{} type bigEndian struct{} func (littleEndian) Uint32(b []byte) uint32 { _ = b[3] // bounds check hint to compiler; see golang.org/issue/14808 return uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24 } func (littleEndian) Uint64(b []byte) uint64 { _ = b[7] // bounds check hint to compiler; see golang.org/issue/14808 return uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56 } func (bigEndian) Uint32(b []byte) uint32 { _ = b[3] // bounds check hint to compiler; see golang.org/issue/14808 return uint32(b[3]) | uint32(b[2])<<8 | uint32(b[1])<<16 | uint32(b[0])<<24 } func (bigEndian) Uint64(b []byte) uint64 { _ = b[7] // bounds check hint to compiler; see golang.org/issue/14808 return uint64(b[7]) | uint64(b[6])<<8 | uint64(b[5])<<16 | uint64(b[4])<<24 | uint64(b[3])<<32 | uint64(b[2])<<40 | uint64(b[1])<<48 | uint64(b[0])<<56 } // hostByteOrder returns littleEndian on little-endian machines and // bigEndian on big-endian machines. func hostByteOrder() byteOrder { switch runtime.GOARCH { case "386", "amd64", "amd64p32", "alpha", "arm", "arm64", "loong64", "mipsle", "mips64le", "mips64p32le", "nios2", "ppc64le", "riscv", "riscv64", "sh": return littleEndian{} case "armbe", "arm64be", "m68k", "mips", "mips64", "mips64p32", "ppc", "ppc64", "s390", "s390x", "shbe", "sparc", "sparc64": return bigEndian{} } panic("unknown architecture") } ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package cpu implements processor feature detection for // various CPU architectures. package cpu import ( "os" "strings" ) // Initialized reports whether the CPU features were initialized. // // For some GOOS/GOARCH combinations initialization of the CPU features depends // on reading an operating specific file, e.g. /proc/self/auxv on linux/arm // Initialized will report false if reading the file fails. var Initialized bool // CacheLinePad is used to pad structs to avoid false sharing. type CacheLinePad struct{ _ [cacheLineSize]byte } // X86 contains the supported CPU features of the // current X86/AMD64 platform. If the current platform // is not X86/AMD64 then all feature flags are false. // // X86 is padded to avoid false sharing. Further the HasAVX // and HasAVX2 are only set if the OS supports XMM and YMM // registers in addition to the CPUID feature bit being set. var X86 struct { _ CacheLinePad HasAES bool // AES hardware implementation (AES NI) HasADX bool // Multi-precision add-carry instruction extensions HasAVX bool // Advanced vector extension HasAVX2 bool // Advanced vector extension 2 HasAVX512 bool // Advanced vector extension 512 HasAVX512F bool // Advanced vector extension 512 Foundation Instructions HasAVX512CD bool // Advanced vector extension 512 Conflict Detection Instructions HasAVX512ER bool // Advanced vector extension 512 Exponential and Reciprocal Instructions HasAVX512PF bool // Advanced vector extension 512 Prefetch Instructions HasAVX512VL bool // Advanced vector extension 512 Vector Length Extensions HasAVX512BW bool // Advanced vector extension 512 Byte and Word Instructions HasAVX512DQ bool // Advanced vector extension 512 Doubleword and Quadword Instructions HasAVX512IFMA bool // Advanced vector extension 512 Integer Fused Multiply Add HasAVX512VBMI bool // Advanced vector extension 512 Vector Byte Manipulation Instructions HasAVX5124VNNIW bool // Advanced vector extension 512 Vector Neural Network Instructions Word variable precision HasAVX5124FMAPS bool // Advanced vector extension 512 Fused Multiply Accumulation Packed Single precision HasAVX512VPOPCNTDQ bool // Advanced vector extension 512 Double and quad word population count instructions HasAVX512VPCLMULQDQ bool // Advanced vector extension 512 Vector carry-less multiply operations HasAVX512VNNI bool // Advanced vector extension 512 Vector Neural Network Instructions HasAVX512GFNI bool // Advanced vector extension 512 Galois field New Instructions HasAVX512VAES bool // Advanced vector extension 512 Vector AES instructions HasAVX512VBMI2 bool // Advanced vector extension 512 Vector Byte Manipulation Instructions 2 HasAVX512BITALG bool // Advanced vector extension 512 Bit Algorithms HasAVX512BF16 bool // Advanced vector extension 512 BFloat16 Instructions HasAMXTile bool // Advanced Matrix Extension Tile instructions HasAMXInt8 bool // Advanced Matrix Extension Int8 instructions HasAMXBF16 bool // Advanced Matrix Extension BFloat16 instructions HasBMI1 bool // Bit manipulation instruction set 1 HasBMI2 bool // Bit manipulation instruction set 2 HasCX16 bool // Compare and exchange 16 Bytes HasERMS bool // Enhanced REP for MOVSB and STOSB HasFMA bool // Fused-multiply-add instructions HasOSXSAVE bool // OS supports XSAVE/XRESTOR for saving/restoring XMM registers. HasPCLMULQDQ bool // PCLMULQDQ instruction - most often used for AES-GCM HasPOPCNT bool // Hamming weight instruction POPCNT. HasRDRAND bool // RDRAND instruction (on-chip random number generator) HasRDSEED bool // RDSEED instruction (on-chip random number generator) HasSSE2 bool // Streaming SIMD extension 2 (always available on amd64) HasSSE3 bool // Streaming SIMD extension 3 HasSSSE3 bool // Supplemental streaming SIMD extension 3 HasSSE41 bool // Streaming SIMD extension 4 and 4.1 HasSSE42 bool // Streaming SIMD extension 4 and 4.2 HasAVXIFMA bool // Advanced vector extension Integer Fused Multiply Add HasAVXVNNI bool // Advanced vector extension Vector Neural Network Instructions HasAVXVNNIInt8 bool // Advanced vector extension Vector Neural Network Int8 instructions _ CacheLinePad } // ARM64 contains the supported CPU features of the // current ARMv8(aarch64) platform. If the current platform // is not arm64 then all feature flags are false. var ARM64 struct { _ CacheLinePad HasFP bool // Floating-point instruction set (always available) HasASIMD bool // Advanced SIMD (always available) HasEVTSTRM bool // Event stream support HasAES bool // AES hardware implementation HasPMULL bool // Polynomial multiplication instruction set HasSHA1 bool // SHA1 hardware implementation HasSHA2 bool // SHA2 hardware implementation HasCRC32 bool // CRC32 hardware implementation HasATOMICS bool // Atomic memory operation instruction set HasFPHP bool // Half precision floating-point instruction set HasASIMDHP bool // Advanced SIMD half precision instruction set HasCPUID bool // CPUID identification scheme registers HasASIMDRDM bool // Rounding double multiply add/subtract instruction set HasJSCVT bool // Javascript conversion from floating-point to integer HasFCMA bool // Floating-point multiplication and addition of complex numbers HasLRCPC bool // Release Consistent processor consistent support HasDCPOP bool // Persistent memory support HasSHA3 bool // SHA3 hardware implementation HasSM3 bool // SM3 hardware implementation HasSM4 bool // SM4 hardware implementation HasASIMDDP bool // Advanced SIMD double precision instruction set HasSHA512 bool // SHA512 hardware implementation HasSVE bool // Scalable Vector Extensions HasSVE2 bool // Scalable Vector Extensions 2 HasASIMDFHM bool // Advanced SIMD multiplication FP16 to FP32 HasDIT bool // Data Independent Timing support HasI8MM bool // Advanced SIMD Int8 matrix multiplication instructions _ CacheLinePad } // ARM contains the supported CPU features of the current ARM (32-bit) platform. // All feature flags are false if: // 1. the current platform is not arm, or // 2. the current operating system is not Linux. var ARM struct { _ CacheLinePad HasSWP bool // SWP instruction support HasHALF bool // Half-word load and store support HasTHUMB bool // ARM Thumb instruction set Has26BIT bool // Address space limited to 26-bits HasFASTMUL bool // 32-bit operand, 64-bit result multiplication support HasFPA bool // Floating point arithmetic support HasVFP bool // Vector floating point support HasEDSP bool // DSP Extensions support HasJAVA bool // Java instruction set HasIWMMXT bool // Intel Wireless MMX technology support HasCRUNCH bool // MaverickCrunch context switching and handling HasTHUMBEE bool // Thumb EE instruction set HasNEON bool // NEON instruction set HasVFPv3 bool // Vector floating point version 3 support HasVFPv3D16 bool // Vector floating point version 3 D8-D15 HasTLS bool // Thread local storage support HasVFPv4 bool // Vector floating point version 4 support HasIDIVA bool // Integer divide instruction support in ARM mode HasIDIVT bool // Integer divide instruction support in Thumb mode HasVFPD32 bool // Vector floating point version 3 D15-D31 HasLPAE bool // Large Physical Address Extensions HasEVTSTRM bool // Event stream support HasAES bool // AES hardware implementation HasPMULL bool // Polynomial multiplication instruction set HasSHA1 bool // SHA1 hardware implementation HasSHA2 bool // SHA2 hardware implementation HasCRC32 bool // CRC32 hardware implementation _ CacheLinePad } // The booleans in Loong64 contain the correspondingly named cpu feature bit. // The struct is padded to avoid false sharing. var Loong64 struct { _ CacheLinePad HasLSX bool // support 128-bit vector extension HasLASX bool // support 256-bit vector extension HasCRC32 bool // support CRC instruction HasLAM_BH bool // support AM{SWAP/ADD}[_DB].{B/H} instruction HasLAMCAS bool // support AMCAS[_DB].{B/H/W/D} instruction _ CacheLinePad } // MIPS64X contains the supported CPU features of the current mips64/mips64le // platforms. If the current platform is not mips64/mips64le or the current // operating system is not Linux then all feature flags are false. var MIPS64X struct { _ CacheLinePad HasMSA bool // MIPS SIMD architecture _ CacheLinePad } // PPC64 contains the supported CPU features of the current ppc64/ppc64le platforms. // If the current platform is not ppc64/ppc64le then all feature flags are false. // // For ppc64/ppc64le, it is safe to check only for ISA level starting on ISA v3.00, // since there are no optional categories. There are some exceptions that also // require kernel support to work (DARN, SCV), so there are feature bits for // those as well. The struct is padded to avoid false sharing. var PPC64 struct { _ CacheLinePad HasDARN bool // Hardware random number generator (requires kernel enablement) HasSCV bool // Syscall vectored (requires kernel enablement) IsPOWER8 bool // ISA v2.07 (POWER8) IsPOWER9 bool // ISA v3.00 (POWER9), implies IsPOWER8 _ CacheLinePad } // S390X contains the supported CPU features of the current IBM Z // (s390x) platform. If the current platform is not IBM Z then all // feature flags are false. // // S390X is padded to avoid false sharing. Further HasVX is only set // if the OS supports vector registers in addition to the STFLE // feature bit being set. var S390X struct { _ CacheLinePad HasZARCH bool // z/Architecture mode is active [mandatory] HasSTFLE bool // store facility list extended HasLDISP bool // long (20-bit) displacements HasEIMM bool // 32-bit immediates HasDFP bool // decimal floating point HasETF3EH bool // ETF-3 enhanced HasMSA bool // message security assist (CPACF) HasAES bool // KM-AES{128,192,256} functions HasAESCBC bool // KMC-AES{128,192,256} functions HasAESCTR bool // KMCTR-AES{128,192,256} functions HasAESGCM bool // KMA-GCM-AES{128,192,256} functions HasGHASH bool // KIMD-GHASH function HasSHA1 bool // K{I,L}MD-SHA-1 functions HasSHA256 bool // K{I,L}MD-SHA-256 functions HasSHA512 bool // K{I,L}MD-SHA-512 functions HasSHA3 bool // K{I,L}MD-SHA3-{224,256,384,512} and K{I,L}MD-SHAKE-{128,256} functions HasVX bool // vector facility HasVXE bool // vector-enhancements facility 1 _ CacheLinePad } // RISCV64 contains the supported CPU features and performance characteristics for riscv64 // platforms. The booleans in RISCV64, with the exception of HasFastMisaligned, indicate // the presence of RISC-V extensions. // // It is safe to assume that all the RV64G extensions are supported and so they are omitted from // this structure. As riscv64 Go programs require at least RV64G, the code that populates // this structure cannot run successfully if some of the RV64G extensions are missing. // The struct is padded to avoid false sharing. var RISCV64 struct { _ CacheLinePad HasFastMisaligned bool // Fast misaligned accesses HasC bool // Compressed instruction-set extension HasV bool // Vector extension compatible with RVV 1.0 HasZba bool // Address generation instructions extension HasZbb bool // Basic bit-manipulation extension HasZbs bool // Single-bit instructions extension HasZvbb bool // Vector Basic Bit-manipulation HasZvbc bool // Vector Carryless Multiplication HasZvkb bool // Vector Cryptography Bit-manipulation HasZvkt bool // Vector Data-Independent Execution Latency HasZvkg bool // Vector GCM/GMAC HasZvkn bool // NIST Algorithm Suite (AES/SHA256/SHA512) HasZvknc bool // NIST Algorithm Suite with carryless multiply HasZvkng bool // NIST Algorithm Suite with GCM HasZvks bool // ShangMi Algorithm Suite HasZvksc bool // ShangMi Algorithm Suite with carryless multiplication HasZvksg bool // ShangMi Algorithm Suite with GCM _ CacheLinePad } func init() { archInit() initOptions() processOptions() } // options contains the cpu debug options that can be used in GODEBUG. // Options are arch dependent and are added by the arch specific initOptions functions. // Features that are mandatory for the specific GOARCH should have the Required field set // (e.g. SSE2 on amd64). var options []option // Option names should be lower case. e.g. avx instead of AVX. type option struct { Name string Feature *bool Specified bool // whether feature value was specified in GODEBUG Enable bool // whether feature should be enabled Required bool // whether feature is mandatory and can not be disabled } func processOptions() { env := os.Getenv("GODEBUG") field: for env != "" { field := "" i := strings.IndexByte(env, ',') if i < 0 { field, env = env, "" } else { field, env = env[:i], env[i+1:] } if len(field) < 4 || field[:4] != "cpu." { continue } i = strings.IndexByte(field, '=') if i < 0 { print("GODEBUG sys/cpu: no value specified for \"", field, "\"\n") continue } key, value := field[4:i], field[i+1:] // e.g. "SSE2", "on" var enable bool switch value { case "on": enable = true case "off": enable = false default: print("GODEBUG sys/cpu: value \"", value, "\" not supported for cpu option \"", key, "\"\n") continue field } if key == "all" { for i := range options { options[i].Specified = true options[i].Enable = enable || options[i].Required } continue field } for i := range options { if options[i].Name == key { options[i].Specified = true options[i].Enable = enable continue field } } print("GODEBUG sys/cpu: unknown cpu feature \"", key, "\"\n") } for _, o := range options { if !o.Specified { continue } if o.Enable && !*o.Feature { print("GODEBUG sys/cpu: can not enable \"", o.Name, "\", missing CPU support\n") continue } if !o.Enable && o.Required { print("GODEBUG sys/cpu: can not disable \"", o.Name, "\", required CPU feature\n") continue } *o.Feature = o.Enable } } ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_aix.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build aix package cpu const ( // getsystemcfg constants _SC_IMPL = 2 _IMPL_POWER8 = 0x10000 _IMPL_POWER9 = 0x20000 ) func archInit() { impl := getsystemcfg(_SC_IMPL) if impl&_IMPL_POWER8 != 0 { PPC64.IsPOWER8 = true } if impl&_IMPL_POWER9 != 0 { PPC64.IsPOWER8 = true PPC64.IsPOWER9 = true } Initialized = true } func getsystemcfg(label int) (n uint64) { r0, _ := callgetsystemcfg(label) n = uint64(r0) return } ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_arm.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cpu const cacheLineSize = 32 // HWCAP/HWCAP2 bits. // These are specific to Linux. const ( hwcap_SWP = 1 << 0 hwcap_HALF = 1 << 1 hwcap_THUMB = 1 << 2 hwcap_26BIT = 1 << 3 hwcap_FAST_MULT = 1 << 4 hwcap_FPA = 1 << 5 hwcap_VFP = 1 << 6 hwcap_EDSP = 1 << 7 hwcap_JAVA = 1 << 8 hwcap_IWMMXT = 1 << 9 hwcap_CRUNCH = 1 << 10 hwcap_THUMBEE = 1 << 11 hwcap_NEON = 1 << 12 hwcap_VFPv3 = 1 << 13 hwcap_VFPv3D16 = 1 << 14 hwcap_TLS = 1 << 15 hwcap_VFPv4 = 1 << 16 hwcap_IDIVA = 1 << 17 hwcap_IDIVT = 1 << 18 hwcap_VFPD32 = 1 << 19 hwcap_LPAE = 1 << 20 hwcap_EVTSTRM = 1 << 21 hwcap2_AES = 1 << 0 hwcap2_PMULL = 1 << 1 hwcap2_SHA1 = 1 << 2 hwcap2_SHA2 = 1 << 3 hwcap2_CRC32 = 1 << 4 ) func initOptions() { options = []option{ {Name: "pmull", Feature: &ARM.HasPMULL}, {Name: "sha1", Feature: &ARM.HasSHA1}, {Name: "sha2", Feature: &ARM.HasSHA2}, {Name: "swp", Feature: &ARM.HasSWP}, {Name: "thumb", Feature: &ARM.HasTHUMB}, {Name: "thumbee", Feature: &ARM.HasTHUMBEE}, {Name: "tls", Feature: &ARM.HasTLS}, {Name: "vfp", Feature: &ARM.HasVFP}, {Name: "vfpd32", Feature: &ARM.HasVFPD32}, {Name: "vfpv3", Feature: &ARM.HasVFPv3}, {Name: "vfpv3d16", Feature: &ARM.HasVFPv3D16}, {Name: "vfpv4", Feature: &ARM.HasVFPv4}, {Name: "half", Feature: &ARM.HasHALF}, {Name: "26bit", Feature: &ARM.Has26BIT}, {Name: "fastmul", Feature: &ARM.HasFASTMUL}, {Name: "fpa", Feature: &ARM.HasFPA}, {Name: "edsp", Feature: &ARM.HasEDSP}, {Name: "java", Feature: &ARM.HasJAVA}, {Name: "iwmmxt", Feature: &ARM.HasIWMMXT}, {Name: "crunch", Feature: &ARM.HasCRUNCH}, {Name: "neon", Feature: &ARM.HasNEON}, {Name: "idivt", Feature: &ARM.HasIDIVT}, {Name: "idiva", Feature: &ARM.HasIDIVA}, {Name: "lpae", Feature: &ARM.HasLPAE}, {Name: "evtstrm", Feature: &ARM.HasEVTSTRM}, {Name: "aes", Feature: &ARM.HasAES}, {Name: "crc32", Feature: &ARM.HasCRC32}, } } ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_arm64.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cpu import "runtime" // cacheLineSize is used to prevent false sharing of cache lines. // We choose 128 because Apple Silicon, a.k.a. M1, has 128-byte cache line size. // It doesn't cost much and is much more future-proof. const cacheLineSize = 128 func initOptions() { options = []option{ {Name: "fp", Feature: &ARM64.HasFP}, {Name: "asimd", Feature: &ARM64.HasASIMD}, {Name: "evstrm", Feature: &ARM64.HasEVTSTRM}, {Name: "aes", Feature: &ARM64.HasAES}, {Name: "fphp", Feature: &ARM64.HasFPHP}, {Name: "jscvt", Feature: &ARM64.HasJSCVT}, {Name: "lrcpc", Feature: &ARM64.HasLRCPC}, {Name: "pmull", Feature: &ARM64.HasPMULL}, {Name: "sha1", Feature: &ARM64.HasSHA1}, {Name: "sha2", Feature: &ARM64.HasSHA2}, {Name: "sha3", Feature: &ARM64.HasSHA3}, {Name: "sha512", Feature: &ARM64.HasSHA512}, {Name: "sm3", Feature: &ARM64.HasSM3}, {Name: "sm4", Feature: &ARM64.HasSM4}, {Name: "sve", Feature: &ARM64.HasSVE}, {Name: "sve2", Feature: &ARM64.HasSVE2}, {Name: "crc32", Feature: &ARM64.HasCRC32}, {Name: "atomics", Feature: &ARM64.HasATOMICS}, {Name: "asimdhp", Feature: &ARM64.HasASIMDHP}, {Name: "cpuid", Feature: &ARM64.HasCPUID}, {Name: "asimrdm", Feature: &ARM64.HasASIMDRDM}, {Name: "fcma", Feature: &ARM64.HasFCMA}, {Name: "dcpop", Feature: &ARM64.HasDCPOP}, {Name: "asimddp", Feature: &ARM64.HasASIMDDP}, {Name: "asimdfhm", Feature: &ARM64.HasASIMDFHM}, {Name: "dit", Feature: &ARM64.HasDIT}, {Name: "i8mm", Feature: &ARM64.HasI8MM}, } } func archInit() { if runtime.GOOS == "freebsd" { readARM64Registers() } else { // Most platforms don't seem to allow directly reading these registers. doinit() } } // setMinimalFeatures fakes the minimal ARM64 features expected by // TestARM64minimalFeatures. func setMinimalFeatures() { ARM64.HasASIMD = true ARM64.HasFP = true } func readARM64Registers() { Initialized = true parseARM64SystemRegisters(getisar0(), getisar1(), getpfr0()) } func parseARM64SystemRegisters(isar0, isar1, pfr0 uint64) { // ID_AA64ISAR0_EL1 switch extractBits(isar0, 4, 7) { case 1: ARM64.HasAES = true case 2: ARM64.HasAES = true ARM64.HasPMULL = true } switch extractBits(isar0, 8, 11) { case 1: ARM64.HasSHA1 = true } switch extractBits(isar0, 12, 15) { case 1: ARM64.HasSHA2 = true case 2: ARM64.HasSHA2 = true ARM64.HasSHA512 = true } switch extractBits(isar0, 16, 19) { case 1: ARM64.HasCRC32 = true } switch extractBits(isar0, 20, 23) { case 2: ARM64.HasATOMICS = true } switch extractBits(isar0, 28, 31) { case 1: ARM64.HasASIMDRDM = true } switch extractBits(isar0, 32, 35) { case 1: ARM64.HasSHA3 = true } switch extractBits(isar0, 36, 39) { case 1: ARM64.HasSM3 = true } switch extractBits(isar0, 40, 43) { case 1: ARM64.HasSM4 = true } switch extractBits(isar0, 44, 47) { case 1: ARM64.HasASIMDDP = true } // ID_AA64ISAR1_EL1 switch extractBits(isar1, 0, 3) { case 1: ARM64.HasDCPOP = true } switch extractBits(isar1, 12, 15) { case 1: ARM64.HasJSCVT = true } switch extractBits(isar1, 16, 19) { case 1: ARM64.HasFCMA = true } switch extractBits(isar1, 20, 23) { case 1: ARM64.HasLRCPC = true } switch extractBits(isar1, 52, 55) { case 1: ARM64.HasI8MM = true } // ID_AA64PFR0_EL1 switch extractBits(pfr0, 16, 19) { case 0: ARM64.HasFP = true case 1: ARM64.HasFP = true ARM64.HasFPHP = true } switch extractBits(pfr0, 20, 23) { case 0: ARM64.HasASIMD = true case 1: ARM64.HasASIMD = true ARM64.HasASIMDHP = true } switch extractBits(pfr0, 32, 35) { case 1: ARM64.HasSVE = true parseARM64SVERegister(getzfr0()) } switch extractBits(pfr0, 48, 51) { case 1: ARM64.HasDIT = true } } func parseARM64SVERegister(zfr0 uint64) { switch extractBits(zfr0, 0, 3) { case 1: ARM64.HasSVE2 = true } } func extractBits(data uint64, start, end uint) uint { return (uint)(data>>start) & ((1 << (end - start + 1)) - 1) } ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_arm64.s ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build gc #include "textflag.h" // func getisar0() uint64 TEXT ·getisar0(SB),NOSPLIT,$0-8 // get Instruction Set Attributes 0 into x0 MRS ID_AA64ISAR0_EL1, R0 MOVD R0, ret+0(FP) RET // func getisar1() uint64 TEXT ·getisar1(SB),NOSPLIT,$0-8 // get Instruction Set Attributes 1 into x0 MRS ID_AA64ISAR1_EL1, R0 MOVD R0, ret+0(FP) RET // func getpfr0() uint64 TEXT ·getpfr0(SB),NOSPLIT,$0-8 // get Processor Feature Register 0 into x0 MRS ID_AA64PFR0_EL1, R0 MOVD R0, ret+0(FP) RET // func getzfr0() uint64 TEXT ·getzfr0(SB),NOSPLIT,$0-8 // get SVE Feature Register 0 into x0 MRS ID_AA64ZFR0_EL1, R0 MOVD R0, ret+0(FP) RET ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_darwin_arm64.go ================================================ // Copyright 2026 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build darwin && arm64 && gc package cpu func doinit() { setMinimalFeatures() // The feature flags are explained in [Instruction Set Detection]. // There are some differences between MacOS versions: // // MacOS 11 and 12 do not have "hw.optional" sysctl values for some of the features. // // MacOS 13 changed some of the naming conventions to align with ARM Architecture Reference Manual. // For example "hw.optional.armv8_2_sha512" became "hw.optional.arm.FEAT_SHA512". // It currently checks both to stay compatible with MacOS 11 and 12. // The old names also work with MacOS 13, however it's not clear whether // they will continue working with future OS releases. // // Once MacOS 12 is no longer supported the old names can be removed. // // [Instruction Set Detection]: https://developer.apple.com/documentation/kernel/1387446-sysctlbyname/determining_instruction_set_characteristics // Encryption, hashing and checksum capabilities // For the following flags there are no MacOS 11 sysctl flags. ARM64.HasAES = true || darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_AES\x00")) ARM64.HasPMULL = true || darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_PMULL\x00")) ARM64.HasSHA1 = true || darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_SHA1\x00")) ARM64.HasSHA2 = true || darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_SHA256\x00")) ARM64.HasSHA3 = darwinSysctlEnabled([]byte("hw.optional.armv8_2_sha3\x00")) || darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_SHA3\x00")) ARM64.HasSHA512 = darwinSysctlEnabled([]byte("hw.optional.armv8_2_sha512\x00")) || darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_SHA512\x00")) ARM64.HasCRC32 = darwinSysctlEnabled([]byte("hw.optional.armv8_crc32\x00")) // Atomic and memory ordering ARM64.HasATOMICS = darwinSysctlEnabled([]byte("hw.optional.armv8_1_atomics\x00")) || darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_LSE\x00")) ARM64.HasLRCPC = darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_LRCPC\x00")) // SIMD and floating point capabilities ARM64.HasFPHP = darwinSysctlEnabled([]byte("hw.optional.neon_fp16\x00")) || darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_FP16\x00")) ARM64.HasASIMDHP = darwinSysctlEnabled([]byte("hw.optional.neon_hpfp\x00")) || darwinSysctlEnabled([]byte("hw.optional.AdvSIMD_HPFPCvt\x00")) ARM64.HasASIMDRDM = darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_RDM\x00")) ARM64.HasASIMDDP = darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_DotProd\x00")) ARM64.HasASIMDFHM = darwinSysctlEnabled([]byte("hw.optional.armv8_2_fhm\x00")) || darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_FHM\x00")) ARM64.HasI8MM = darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_I8MM\x00")) ARM64.HasJSCVT = darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_JSCVT\x00")) ARM64.HasFCMA = darwinSysctlEnabled([]byte("hw.optional.armv8_3_compnum\x00")) || darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_FCMA\x00")) // Miscellaneous ARM64.HasDCPOP = darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_DPB\x00")) ARM64.HasEVTSTRM = darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_ECV\x00")) ARM64.HasDIT = darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_DIT\x00")) // Not supported, but added for completeness ARM64.HasCPUID = false ARM64.HasSM3 = false // darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_SM3\x00")) ARM64.HasSM4 = false // darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_SM4\x00")) ARM64.HasSVE = false // darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_SVE\x00")) ARM64.HasSVE2 = false // darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_SVE2\x00")) } ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_darwin_arm64_other.go ================================================ // Copyright 2026 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build darwin && arm64 && !gc package cpu func doinit() { setMinimalFeatures() ARM64.HasASIMD = true ARM64.HasFP = true // Go already assumes these to be available because they were on the M1 // and these are supported on all Apple arm64 chips. ARM64.HasAES = true ARM64.HasPMULL = true ARM64.HasSHA1 = true ARM64.HasSHA2 = true if runtime.GOOS != "ios" { // Apple A7 processors do not support these, however // M-series SoCs are at least armv8.4-a ARM64.HasCRC32 = true // armv8.1 ARM64.HasATOMICS = true // armv8.2 ARM64.HasJSCVT = true // armv8.3, if HasFP } } ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_darwin_x86.go ================================================ // Copyright 2024 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build darwin && amd64 && gc package cpu // darwinSupportsAVX512 checks Darwin kernel for AVX512 support via sysctl // call (see issue 43089). It also restricts AVX512 support for Darwin to // kernel version 21.3.0 (MacOS 12.2.0) or later (see issue 49233). // // Background: // Darwin implements a special mechanism to economize on thread state when // AVX512 specific registers are not in use. This scheme minimizes state when // preempting threads that haven't yet used any AVX512 instructions, but adds // special requirements to check for AVX512 hardware support at runtime (e.g. // via sysctl call or commpage inspection). See issue 43089 and link below for // full background: // https://github.com/apple-oss-distributions/xnu/blob/xnu-11215.1.10/osfmk/i386/fpu.c#L214-L240 // // Additionally, all versions of the Darwin kernel from 19.6.0 through 21.2.0 // (corresponding to MacOS 10.15.6 - 12.1) have a bug that can cause corruption // of the AVX512 mask registers (K0-K7) upon signal return. For this reason // AVX512 is considered unsafe to use on Darwin for kernel versions prior to // 21.3.0, where a fix has been confirmed. See issue 49233 for full background. func darwinSupportsAVX512() bool { return darwinSysctlEnabled([]byte("hw.optional.avx512f\x00")) && darwinKernelVersionCheck(21, 3, 0) } // Ensure Darwin kernel version is at least major.minor.patch, avoiding dependencies func darwinKernelVersionCheck(major, minor, patch int) bool { var release [256]byte err := darwinOSRelease(&release) if err != nil { return false } var mmp [3]int c := 0 Loop: for _, b := range release[:] { switch { case b >= '0' && b <= '9': mmp[c] = 10*mmp[c] + int(b-'0') case b == '.': c++ if c > 2 { return false } case b == 0: break Loop default: return false } } if c != 2 { return false } return mmp[0] > major || mmp[0] == major && (mmp[1] > minor || mmp[1] == minor && mmp[2] >= patch) } ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build gc package cpu func getisar0() uint64 func getisar1() uint64 func getpfr0() uint64 func getzfr0() uint64 ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_gc_s390x.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build gc package cpu // haveAsmFunctions reports whether the other functions in this file can // be safely called. func haveAsmFunctions() bool { return true } // The following feature detection functions are defined in cpu_s390x.s. // They are likely to be expensive to call so the results should be cached. func stfle() facilityList func kmQuery() queryResult func kmcQuery() queryResult func kmctrQuery() queryResult func kmaQuery() queryResult func kimdQuery() queryResult func klmdQuery() queryResult ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_gc_x86.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build (386 || amd64 || amd64p32) && gc package cpu // cpuid is implemented in cpu_gc_x86.s for gc compiler // and in cpu_gccgo.c for gccgo. func cpuid(eaxArg, ecxArg uint32) (eax, ebx, ecx, edx uint32) // xgetbv with ecx = 0 is implemented in cpu_gc_x86.s for gc compiler // and in cpu_gccgo.c for gccgo. func xgetbv() (eax, edx uint32) ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_gc_x86.s ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build (386 || amd64 || amd64p32) && gc #include "textflag.h" // func cpuid(eaxArg, ecxArg uint32) (eax, ebx, ecx, edx uint32) TEXT ·cpuid(SB), NOSPLIT, $0-24 MOVL eaxArg+0(FP), AX MOVL ecxArg+4(FP), CX CPUID MOVL AX, eax+8(FP) MOVL BX, ebx+12(FP) MOVL CX, ecx+16(FP) MOVL DX, edx+20(FP) RET // func xgetbv() (eax, edx uint32) TEXT ·xgetbv(SB), NOSPLIT, $0-8 MOVL $0, CX XGETBV MOVL AX, eax+0(FP) MOVL DX, edx+4(FP) RET ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build gccgo package cpu func getisar0() uint64 { return 0 } func getisar1() uint64 { return 0 } func getpfr0() uint64 { return 0 } func getzfr0() uint64 { return 0 } ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_gccgo_s390x.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build gccgo package cpu // haveAsmFunctions reports whether the other functions in this file can // be safely called. func haveAsmFunctions() bool { return false } // TODO(mundaym): the following feature detection functions are currently // stubs. See https://golang.org/cl/162887 for how to fix this. // They are likely to be expensive to call so the results should be cached. func stfle() facilityList { panic("not implemented for gccgo") } func kmQuery() queryResult { panic("not implemented for gccgo") } func kmcQuery() queryResult { panic("not implemented for gccgo") } func kmctrQuery() queryResult { panic("not implemented for gccgo") } func kmaQuery() queryResult { panic("not implemented for gccgo") } func kimdQuery() queryResult { panic("not implemented for gccgo") } func klmdQuery() queryResult { panic("not implemented for gccgo") } ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.c ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build (386 || amd64 || amd64p32) && gccgo #include #include #include // Need to wrap __get_cpuid_count because it's declared as static. int gccgoGetCpuidCount(uint32_t leaf, uint32_t subleaf, uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx) { return __get_cpuid_count(leaf, subleaf, eax, ebx, ecx, edx); } #pragma GCC diagnostic ignored "-Wunknown-pragmas" #pragma GCC push_options #pragma GCC target("xsave") #pragma clang attribute push (__attribute__((target("xsave"))), apply_to=function) // xgetbv reads the contents of an XCR (Extended Control Register) // specified in the ECX register into registers EDX:EAX. // Currently, the only supported value for XCR is 0. void gccgoXgetbv(uint32_t *eax, uint32_t *edx) { uint64_t v = _xgetbv(0); *eax = v & 0xffffffff; *edx = v >> 32; } #pragma clang attribute pop #pragma GCC pop_options ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build (386 || amd64 || amd64p32) && gccgo package cpu //extern gccgoGetCpuidCount func gccgoGetCpuidCount(eaxArg, ecxArg uint32, eax, ebx, ecx, edx *uint32) func cpuid(eaxArg, ecxArg uint32) (eax, ebx, ecx, edx uint32) { var a, b, c, d uint32 gccgoGetCpuidCount(eaxArg, ecxArg, &a, &b, &c, &d) return a, b, c, d } //extern gccgoXgetbv func gccgoXgetbv(eax, edx *uint32) func xgetbv() (eax, edx uint32) { var a, d uint32 gccgoXgetbv(&a, &d) return a, d } ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_linux.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build !386 && !amd64 && !amd64p32 && !arm64 package cpu func archInit() { if err := readHWCAP(); err != nil { return } doinit() Initialized = true } ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_linux_arm.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cpu func doinit() { ARM.HasSWP = isSet(hwCap, hwcap_SWP) ARM.HasHALF = isSet(hwCap, hwcap_HALF) ARM.HasTHUMB = isSet(hwCap, hwcap_THUMB) ARM.Has26BIT = isSet(hwCap, hwcap_26BIT) ARM.HasFASTMUL = isSet(hwCap, hwcap_FAST_MULT) ARM.HasFPA = isSet(hwCap, hwcap_FPA) ARM.HasVFP = isSet(hwCap, hwcap_VFP) ARM.HasEDSP = isSet(hwCap, hwcap_EDSP) ARM.HasJAVA = isSet(hwCap, hwcap_JAVA) ARM.HasIWMMXT = isSet(hwCap, hwcap_IWMMXT) ARM.HasCRUNCH = isSet(hwCap, hwcap_CRUNCH) ARM.HasTHUMBEE = isSet(hwCap, hwcap_THUMBEE) ARM.HasNEON = isSet(hwCap, hwcap_NEON) ARM.HasVFPv3 = isSet(hwCap, hwcap_VFPv3) ARM.HasVFPv3D16 = isSet(hwCap, hwcap_VFPv3D16) ARM.HasTLS = isSet(hwCap, hwcap_TLS) ARM.HasVFPv4 = isSet(hwCap, hwcap_VFPv4) ARM.HasIDIVA = isSet(hwCap, hwcap_IDIVA) ARM.HasIDIVT = isSet(hwCap, hwcap_IDIVT) ARM.HasVFPD32 = isSet(hwCap, hwcap_VFPD32) ARM.HasLPAE = isSet(hwCap, hwcap_LPAE) ARM.HasEVTSTRM = isSet(hwCap, hwcap_EVTSTRM) ARM.HasAES = isSet(hwCap2, hwcap2_AES) ARM.HasPMULL = isSet(hwCap2, hwcap2_PMULL) ARM.HasSHA1 = isSet(hwCap2, hwcap2_SHA1) ARM.HasSHA2 = isSet(hwCap2, hwcap2_SHA2) ARM.HasCRC32 = isSet(hwCap2, hwcap2_CRC32) } func isSet(hwc uint, value uint) bool { return hwc&value != 0 } ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cpu import ( "strings" "syscall" ) // HWCAP/HWCAP2 bits. These are exposed by Linux. const ( hwcap_FP = 1 << 0 hwcap_ASIMD = 1 << 1 hwcap_EVTSTRM = 1 << 2 hwcap_AES = 1 << 3 hwcap_PMULL = 1 << 4 hwcap_SHA1 = 1 << 5 hwcap_SHA2 = 1 << 6 hwcap_CRC32 = 1 << 7 hwcap_ATOMICS = 1 << 8 hwcap_FPHP = 1 << 9 hwcap_ASIMDHP = 1 << 10 hwcap_CPUID = 1 << 11 hwcap_ASIMDRDM = 1 << 12 hwcap_JSCVT = 1 << 13 hwcap_FCMA = 1 << 14 hwcap_LRCPC = 1 << 15 hwcap_DCPOP = 1 << 16 hwcap_SHA3 = 1 << 17 hwcap_SM3 = 1 << 18 hwcap_SM4 = 1 << 19 hwcap_ASIMDDP = 1 << 20 hwcap_SHA512 = 1 << 21 hwcap_SVE = 1 << 22 hwcap_ASIMDFHM = 1 << 23 hwcap_DIT = 1 << 24 hwcap2_SVE2 = 1 << 1 hwcap2_I8MM = 1 << 13 ) // linuxKernelCanEmulateCPUID reports whether we're running // on Linux 4.11+. Ideally we'd like to ask the question about // whether the current kernel contains // https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=77c97b4ee21290f5f083173d957843b615abbff2 // but the version number will have to do. func linuxKernelCanEmulateCPUID() bool { var un syscall.Utsname syscall.Uname(&un) var sb strings.Builder for _, b := range un.Release[:] { if b == 0 { break } sb.WriteByte(byte(b)) } major, minor, _, ok := parseRelease(sb.String()) return ok && (major > 4 || major == 4 && minor >= 11) } func doinit() { if err := readHWCAP(); err != nil { // We failed to read /proc/self/auxv. This can happen if the binary has // been given extra capabilities(7) with /bin/setcap. // // When this happens, we have two options. If the Linux kernel is new // enough (4.11+), we can read the arm64 registers directly which'll // trap into the kernel and then return back to userspace. // // But on older kernels, such as Linux 4.4.180 as used on many Synology // devices, calling readARM64Registers (specifically getisar0) will // cause a SIGILL and we'll die. So for older kernels, parse /proc/cpuinfo // instead. // // See golang/go#57336. if linuxKernelCanEmulateCPUID() { readARM64Registers() } else { readLinuxProcCPUInfo() } return } // HWCAP feature bits ARM64.HasFP = isSet(hwCap, hwcap_FP) ARM64.HasASIMD = isSet(hwCap, hwcap_ASIMD) ARM64.HasEVTSTRM = isSet(hwCap, hwcap_EVTSTRM) ARM64.HasAES = isSet(hwCap, hwcap_AES) ARM64.HasPMULL = isSet(hwCap, hwcap_PMULL) ARM64.HasSHA1 = isSet(hwCap, hwcap_SHA1) ARM64.HasSHA2 = isSet(hwCap, hwcap_SHA2) ARM64.HasCRC32 = isSet(hwCap, hwcap_CRC32) ARM64.HasATOMICS = isSet(hwCap, hwcap_ATOMICS) ARM64.HasFPHP = isSet(hwCap, hwcap_FPHP) ARM64.HasASIMDHP = isSet(hwCap, hwcap_ASIMDHP) ARM64.HasCPUID = isSet(hwCap, hwcap_CPUID) ARM64.HasASIMDRDM = isSet(hwCap, hwcap_ASIMDRDM) ARM64.HasJSCVT = isSet(hwCap, hwcap_JSCVT) ARM64.HasFCMA = isSet(hwCap, hwcap_FCMA) ARM64.HasLRCPC = isSet(hwCap, hwcap_LRCPC) ARM64.HasDCPOP = isSet(hwCap, hwcap_DCPOP) ARM64.HasSHA3 = isSet(hwCap, hwcap_SHA3) ARM64.HasSM3 = isSet(hwCap, hwcap_SM3) ARM64.HasSM4 = isSet(hwCap, hwcap_SM4) ARM64.HasASIMDDP = isSet(hwCap, hwcap_ASIMDDP) ARM64.HasSHA512 = isSet(hwCap, hwcap_SHA512) ARM64.HasSVE = isSet(hwCap, hwcap_SVE) ARM64.HasASIMDFHM = isSet(hwCap, hwcap_ASIMDFHM) ARM64.HasDIT = isSet(hwCap, hwcap_DIT) // HWCAP2 feature bits ARM64.HasSVE2 = isSet(hwCap2, hwcap2_SVE2) ARM64.HasI8MM = isSet(hwCap2, hwcap2_I8MM) } func isSet(hwc uint, value uint) bool { return hwc&value != 0 } ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_linux_loong64.go ================================================ // Copyright 2025 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cpu // HWCAP bits. These are exposed by the Linux kernel. const ( hwcap_LOONGARCH_LSX = 1 << 4 hwcap_LOONGARCH_LASX = 1 << 5 ) func doinit() { // TODO: Features that require kernel support like LSX and LASX can // be detected here once needed in std library or by the compiler. Loong64.HasLSX = hwcIsSet(hwCap, hwcap_LOONGARCH_LSX) Loong64.HasLASX = hwcIsSet(hwCap, hwcap_LOONGARCH_LASX) } func hwcIsSet(hwc uint, val uint) bool { return hwc&val != 0 } ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_linux_mips64x.go ================================================ // Copyright 2020 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build linux && (mips64 || mips64le) package cpu // HWCAP bits. These are exposed by the Linux kernel 5.4. const ( // CPU features hwcap_MIPS_MSA = 1 << 1 ) func doinit() { // HWCAP feature bits MIPS64X.HasMSA = isSet(hwCap, hwcap_MIPS_MSA) } func isSet(hwc uint, value uint) bool { return hwc&value != 0 } ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_linux_noinit.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build linux && !arm && !arm64 && !loong64 && !mips64 && !mips64le && !ppc64 && !ppc64le && !s390x && !riscv64 package cpu func doinit() {} ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build linux && (ppc64 || ppc64le) package cpu // HWCAP/HWCAP2 bits. These are exposed by the kernel. const ( // ISA Level _PPC_FEATURE2_ARCH_2_07 = 0x80000000 _PPC_FEATURE2_ARCH_3_00 = 0x00800000 // CPU features _PPC_FEATURE2_DARN = 0x00200000 _PPC_FEATURE2_SCV = 0x00100000 ) func doinit() { // HWCAP2 feature bits PPC64.IsPOWER8 = isSet(hwCap2, _PPC_FEATURE2_ARCH_2_07) PPC64.IsPOWER9 = isSet(hwCap2, _PPC_FEATURE2_ARCH_3_00) PPC64.HasDARN = isSet(hwCap2, _PPC_FEATURE2_DARN) PPC64.HasSCV = isSet(hwCap2, _PPC_FEATURE2_SCV) } func isSet(hwc uint, value uint) bool { return hwc&value != 0 } ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_linux_riscv64.go ================================================ // Copyright 2024 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cpu import ( "syscall" "unsafe" ) // RISC-V extension discovery code for Linux. The approach here is to first try the riscv_hwprobe // syscall falling back to HWCAP to check for the C extension if riscv_hwprobe is not available. // // A note on detection of the Vector extension using HWCAP. // // Support for the Vector extension version 1.0 was added to the Linux kernel in release 6.5. // Support for the riscv_hwprobe syscall was added in 6.4. It follows that if the riscv_hwprobe // syscall is not available then neither is the Vector extension (which needs kernel support). // The riscv_hwprobe syscall should then be all we need to detect the Vector extension. // However, some RISC-V board manufacturers ship boards with an older kernel on top of which // they have back-ported various versions of the Vector extension patches but not the riscv_hwprobe // patches. These kernels advertise support for the Vector extension using HWCAP. Falling // back to HWCAP to detect the Vector extension, if riscv_hwprobe is not available, or simply not // bothering with riscv_hwprobe at all and just using HWCAP may then seem like an attractive option. // // Unfortunately, simply checking the 'V' bit in AT_HWCAP will not work as this bit is used by // RISC-V board and cloud instance providers to mean different things. The Lichee Pi 4A board // and the Scaleway RV1 cloud instances use the 'V' bit to advertise their support for the unratified // 0.7.1 version of the Vector Specification. The Banana Pi BPI-F3 and the CanMV-K230 board use // it to advertise support for 1.0 of the Vector extension. Versions 0.7.1 and 1.0 of the Vector // extension are binary incompatible. HWCAP can then not be used in isolation to populate the // HasV field as this field indicates that the underlying CPU is compatible with RVV 1.0. // // There is a way at runtime to distinguish between versions 0.7.1 and 1.0 of the Vector // specification by issuing a RVV 1.0 vsetvli instruction and checking the vill bit of the vtype // register. This check would allow us to safely detect version 1.0 of the Vector extension // with HWCAP, if riscv_hwprobe were not available. However, the check cannot // be added until the assembler supports the Vector instructions. // // Note the riscv_hwprobe syscall does not suffer from these ambiguities by design as all of the // extensions it advertises support for are explicitly versioned. It's also worth noting that // the riscv_hwprobe syscall is the only way to detect multi-letter RISC-V extensions, e.g., Zba. // These cannot be detected using HWCAP and so riscv_hwprobe must be used to detect the majority // of RISC-V extensions. // // Please see https://docs.kernel.org/arch/riscv/hwprobe.html for more information. // golang.org/x/sys/cpu is not allowed to depend on golang.org/x/sys/unix so we must // reproduce the constants, types and functions needed to make the riscv_hwprobe syscall // here. const ( // Copied from golang.org/x/sys/unix/ztypes_linux_riscv64.go. riscv_HWPROBE_KEY_IMA_EXT_0 = 0x4 riscv_HWPROBE_IMA_C = 0x2 riscv_HWPROBE_IMA_V = 0x4 riscv_HWPROBE_EXT_ZBA = 0x8 riscv_HWPROBE_EXT_ZBB = 0x10 riscv_HWPROBE_EXT_ZBS = 0x20 riscv_HWPROBE_EXT_ZVBB = 0x20000 riscv_HWPROBE_EXT_ZVBC = 0x40000 riscv_HWPROBE_EXT_ZVKB = 0x80000 riscv_HWPROBE_EXT_ZVKG = 0x100000 riscv_HWPROBE_EXT_ZVKNED = 0x200000 riscv_HWPROBE_EXT_ZVKNHB = 0x800000 riscv_HWPROBE_EXT_ZVKSED = 0x1000000 riscv_HWPROBE_EXT_ZVKSH = 0x2000000 riscv_HWPROBE_EXT_ZVKT = 0x4000000 riscv_HWPROBE_KEY_CPUPERF_0 = 0x5 riscv_HWPROBE_MISALIGNED_FAST = 0x3 riscv_HWPROBE_MISALIGNED_MASK = 0x7 ) const ( // sys_RISCV_HWPROBE is copied from golang.org/x/sys/unix/zsysnum_linux_riscv64.go. sys_RISCV_HWPROBE = 258 ) // riscvHWProbePairs is copied from golang.org/x/sys/unix/ztypes_linux_riscv64.go. type riscvHWProbePairs struct { key int64 value uint64 } const ( // CPU features hwcap_RISCV_ISA_C = 1 << ('C' - 'A') ) func doinit() { // A slice of key/value pair structures is passed to the RISCVHWProbe syscall. The key // field should be initialised with one of the key constants defined above, e.g., // RISCV_HWPROBE_KEY_IMA_EXT_0. The syscall will set the value field to the appropriate value. // If the kernel does not recognise a key it will set the key field to -1 and the value field to 0. pairs := []riscvHWProbePairs{ {riscv_HWPROBE_KEY_IMA_EXT_0, 0}, {riscv_HWPROBE_KEY_CPUPERF_0, 0}, } // This call only indicates that extensions are supported if they are implemented on all cores. if riscvHWProbe(pairs, 0) { if pairs[0].key != -1 { v := uint(pairs[0].value) RISCV64.HasC = isSet(v, riscv_HWPROBE_IMA_C) RISCV64.HasV = isSet(v, riscv_HWPROBE_IMA_V) RISCV64.HasZba = isSet(v, riscv_HWPROBE_EXT_ZBA) RISCV64.HasZbb = isSet(v, riscv_HWPROBE_EXT_ZBB) RISCV64.HasZbs = isSet(v, riscv_HWPROBE_EXT_ZBS) RISCV64.HasZvbb = isSet(v, riscv_HWPROBE_EXT_ZVBB) RISCV64.HasZvbc = isSet(v, riscv_HWPROBE_EXT_ZVBC) RISCV64.HasZvkb = isSet(v, riscv_HWPROBE_EXT_ZVKB) RISCV64.HasZvkg = isSet(v, riscv_HWPROBE_EXT_ZVKG) RISCV64.HasZvkt = isSet(v, riscv_HWPROBE_EXT_ZVKT) // Cryptography shorthand extensions RISCV64.HasZvkn = isSet(v, riscv_HWPROBE_EXT_ZVKNED) && isSet(v, riscv_HWPROBE_EXT_ZVKNHB) && RISCV64.HasZvkb && RISCV64.HasZvkt RISCV64.HasZvknc = RISCV64.HasZvkn && RISCV64.HasZvbc RISCV64.HasZvkng = RISCV64.HasZvkn && RISCV64.HasZvkg RISCV64.HasZvks = isSet(v, riscv_HWPROBE_EXT_ZVKSED) && isSet(v, riscv_HWPROBE_EXT_ZVKSH) && RISCV64.HasZvkb && RISCV64.HasZvkt RISCV64.HasZvksc = RISCV64.HasZvks && RISCV64.HasZvbc RISCV64.HasZvksg = RISCV64.HasZvks && RISCV64.HasZvkg } if pairs[1].key != -1 { v := pairs[1].value & riscv_HWPROBE_MISALIGNED_MASK RISCV64.HasFastMisaligned = v == riscv_HWPROBE_MISALIGNED_FAST } } // Let's double check with HWCAP if the C extension does not appear to be supported. // This may happen if we're running on a kernel older than 6.4. if !RISCV64.HasC { RISCV64.HasC = isSet(hwCap, hwcap_RISCV_ISA_C) } } func isSet(hwc uint, value uint) bool { return hwc&value != 0 } // riscvHWProbe is a simplified version of the generated wrapper function found in // golang.org/x/sys/unix/zsyscall_linux_riscv64.go. We simplify it by removing the // cpuCount and cpus parameters which we do not need. We always want to pass 0 for // these parameters here so the kernel only reports the extensions that are present // on all cores. func riscvHWProbe(pairs []riscvHWProbePairs, flags uint) bool { var _zero uintptr var p0 unsafe.Pointer if len(pairs) > 0 { p0 = unsafe.Pointer(&pairs[0]) } else { p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall.Syscall6(sys_RISCV_HWPROBE, uintptr(p0), uintptr(len(pairs)), uintptr(0), uintptr(0), uintptr(flags), 0) return e1 == 0 } ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_linux_s390x.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cpu const ( // bit mask values from /usr/include/bits/hwcap.h hwcap_ZARCH = 2 hwcap_STFLE = 4 hwcap_MSA = 8 hwcap_LDISP = 16 hwcap_EIMM = 32 hwcap_DFP = 64 hwcap_ETF3EH = 256 hwcap_VX = 2048 hwcap_VXE = 8192 ) func initS390Xbase() { // test HWCAP bit vector has := func(featureMask uint) bool { return hwCap&featureMask == featureMask } // mandatory S390X.HasZARCH = has(hwcap_ZARCH) // optional S390X.HasSTFLE = has(hwcap_STFLE) S390X.HasLDISP = has(hwcap_LDISP) S390X.HasEIMM = has(hwcap_EIMM) S390X.HasETF3EH = has(hwcap_ETF3EH) S390X.HasDFP = has(hwcap_DFP) S390X.HasMSA = has(hwcap_MSA) S390X.HasVX = has(hwcap_VX) if S390X.HasVX { S390X.HasVXE = has(hwcap_VXE) } } ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_loong64.go ================================================ // Copyright 2022 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build loong64 package cpu const cacheLineSize = 64 // Bit fields for CPUCFG registers, Related reference documents: // https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html#_cpucfg const ( // CPUCFG1 bits cpucfg1_CRC32 = 1 << 25 // CPUCFG2 bits cpucfg2_LAM_BH = 1 << 27 cpucfg2_LAMCAS = 1 << 28 ) func initOptions() { options = []option{ {Name: "lsx", Feature: &Loong64.HasLSX}, {Name: "lasx", Feature: &Loong64.HasLASX}, {Name: "crc32", Feature: &Loong64.HasCRC32}, {Name: "lam_bh", Feature: &Loong64.HasLAM_BH}, {Name: "lamcas", Feature: &Loong64.HasLAMCAS}, } // The CPUCFG data on Loong64 only reflects the hardware capabilities, // not the kernel support status, so features such as LSX and LASX that // require kernel support cannot be obtained from the CPUCFG data. // // These features only require hardware capability support and do not // require kernel specific support, so they can be obtained directly // through CPUCFG cfg1 := get_cpucfg(1) cfg2 := get_cpucfg(2) Loong64.HasCRC32 = cfgIsSet(cfg1, cpucfg1_CRC32) Loong64.HasLAMCAS = cfgIsSet(cfg2, cpucfg2_LAMCAS) Loong64.HasLAM_BH = cfgIsSet(cfg2, cpucfg2_LAM_BH) } func get_cpucfg(reg uint32) uint32 func cfgIsSet(cfg uint32, val uint32) bool { return cfg&val != 0 } ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_loong64.s ================================================ // Copyright 2025 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. #include "textflag.h" // func get_cpucfg(reg uint32) uint32 TEXT ·get_cpucfg(SB), NOSPLIT|NOFRAME, $0 MOVW reg+0(FP), R5 // CPUCFG R5, R4 = 0x00006ca4 WORD $0x00006ca4 MOVW R4, ret+8(FP) RET ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_mips64x.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build mips64 || mips64le package cpu const cacheLineSize = 32 func initOptions() { options = []option{ {Name: "msa", Feature: &MIPS64X.HasMSA}, } } ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_mipsx.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build mips || mipsle package cpu const cacheLineSize = 32 func initOptions() {} ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_netbsd_arm64.go ================================================ // Copyright 2020 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cpu import ( "syscall" "unsafe" ) // Minimal copy of functionality from x/sys/unix so the cpu package can call // sysctl without depending on x/sys/unix. const ( _CTL_QUERY = -2 _SYSCTL_VERS_1 = 0x1000000 ) var _zero uintptr func sysctl(mib []int32, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { var _p0 unsafe.Pointer if len(mib) > 0 { _p0 = unsafe.Pointer(&mib[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, errno := syscall.Syscall6( syscall.SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) if errno != 0 { return errno } return nil } type sysctlNode struct { Flags uint32 Num int32 Name [32]int8 Ver uint32 __rsvd uint32 Un [16]byte _sysctl_size [8]byte _sysctl_func [8]byte _sysctl_parent [8]byte _sysctl_desc [8]byte } func sysctlNodes(mib []int32) ([]sysctlNode, error) { var olen uintptr // Get a list of all sysctl nodes below the given MIB by performing // a sysctl for the given MIB with CTL_QUERY appended. mib = append(mib, _CTL_QUERY) qnode := sysctlNode{Flags: _SYSCTL_VERS_1} qp := (*byte)(unsafe.Pointer(&qnode)) sz := unsafe.Sizeof(qnode) if err := sysctl(mib, nil, &olen, qp, sz); err != nil { return nil, err } // Now that we know the size, get the actual nodes. nodes := make([]sysctlNode, olen/sz) np := (*byte)(unsafe.Pointer(&nodes[0])) if err := sysctl(mib, np, &olen, qp, sz); err != nil { return nil, err } return nodes, nil } func nametomib(name string) ([]int32, error) { // Split name into components. var parts []string last := 0 for i := 0; i < len(name); i++ { if name[i] == '.' { parts = append(parts, name[last:i]) last = i + 1 } } parts = append(parts, name[last:]) mib := []int32{} // Discover the nodes and construct the MIB OID. for partno, part := range parts { nodes, err := sysctlNodes(mib) if err != nil { return nil, err } for _, node := range nodes { n := make([]byte, 0) for i := range node.Name { if node.Name[i] != 0 { n = append(n, byte(node.Name[i])) } } if string(n) == part { mib = append(mib, int32(node.Num)) break } } if len(mib) != partno+1 { return nil, err } } return mib, nil } // aarch64SysctlCPUID is struct aarch64_sysctl_cpu_id from NetBSD's type aarch64SysctlCPUID struct { midr uint64 /* Main ID Register */ revidr uint64 /* Revision ID Register */ mpidr uint64 /* Multiprocessor Affinity Register */ aa64dfr0 uint64 /* A64 Debug Feature Register 0 */ aa64dfr1 uint64 /* A64 Debug Feature Register 1 */ aa64isar0 uint64 /* A64 Instruction Set Attribute Register 0 */ aa64isar1 uint64 /* A64 Instruction Set Attribute Register 1 */ aa64mmfr0 uint64 /* A64 Memory Model Feature Register 0 */ aa64mmfr1 uint64 /* A64 Memory Model Feature Register 1 */ aa64mmfr2 uint64 /* A64 Memory Model Feature Register 2 */ aa64pfr0 uint64 /* A64 Processor Feature Register 0 */ aa64pfr1 uint64 /* A64 Processor Feature Register 1 */ aa64zfr0 uint64 /* A64 SVE Feature ID Register 0 */ mvfr0 uint32 /* Media and VFP Feature Register 0 */ mvfr1 uint32 /* Media and VFP Feature Register 1 */ mvfr2 uint32 /* Media and VFP Feature Register 2 */ pad uint32 clidr uint64 /* Cache Level ID Register */ ctr uint64 /* Cache Type Register */ } func sysctlCPUID(name string) (*aarch64SysctlCPUID, error) { mib, err := nametomib(name) if err != nil { return nil, err } out := aarch64SysctlCPUID{} n := unsafe.Sizeof(out) _, _, errno := syscall.Syscall6( syscall.SYS___SYSCTL, uintptr(unsafe.Pointer(&mib[0])), uintptr(len(mib)), uintptr(unsafe.Pointer(&out)), uintptr(unsafe.Pointer(&n)), uintptr(0), uintptr(0)) if errno != 0 { return nil, errno } return &out, nil } func doinit() { cpuid, err := sysctlCPUID("machdep.cpu0.cpu_id") if err != nil { setMinimalFeatures() return } parseARM64SystemRegisters(cpuid.aa64isar0, cpuid.aa64isar1, cpuid.aa64pfr0) Initialized = true } ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_openbsd_arm64.go ================================================ // Copyright 2022 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cpu import ( "syscall" "unsafe" ) // Minimal copy of functionality from x/sys/unix so the cpu package can call // sysctl without depending on x/sys/unix. const ( // From OpenBSD's sys/sysctl.h. _CTL_MACHDEP = 7 // From OpenBSD's machine/cpu.h. _CPU_ID_AA64ISAR0 = 2 _CPU_ID_AA64ISAR1 = 3 ) // Implemented in the runtime package (runtime/sys_openbsd3.go) func syscall_syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) //go:linkname syscall_syscall6 syscall.syscall6 func sysctl(mib []uint32, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { _, _, errno := syscall_syscall6(libc_sysctl_trampoline_addr, uintptr(unsafe.Pointer(&mib[0])), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) if errno != 0 { return errno } return nil } var libc_sysctl_trampoline_addr uintptr //go:cgo_import_dynamic libc_sysctl sysctl "libc.so" func sysctlUint64(mib []uint32) (uint64, bool) { var out uint64 nout := unsafe.Sizeof(out) if err := sysctl(mib, (*byte)(unsafe.Pointer(&out)), &nout, nil, 0); err != nil { return 0, false } return out, true } func doinit() { setMinimalFeatures() // Get ID_AA64ISAR0 and ID_AA64ISAR1 from sysctl. isar0, ok := sysctlUint64([]uint32{_CTL_MACHDEP, _CPU_ID_AA64ISAR0}) if !ok { return } isar1, ok := sysctlUint64([]uint32{_CTL_MACHDEP, _CPU_ID_AA64ISAR1}) if !ok { return } parseARM64SystemRegisters(isar0, isar1, 0) Initialized = true } ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_openbsd_arm64.s ================================================ // Copyright 2022 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. #include "textflag.h" TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sysctl(SB) GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8 DATA ·libc_sysctl_trampoline_addr(SB)/8, $libc_sysctl_trampoline<>(SB) ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_other_arm.go ================================================ // Copyright 2020 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build !linux && arm package cpu func archInit() {} ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_other_arm64.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build !darwin && !linux && !netbsd && !openbsd && !windows && arm64 package cpu func doinit() { setMinimalFeatures() } ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_other_mips64x.go ================================================ // Copyright 2020 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build !linux && (mips64 || mips64le) package cpu func archInit() { Initialized = true } ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_other_ppc64x.go ================================================ // Copyright 2022 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build !aix && !linux && (ppc64 || ppc64le) package cpu func archInit() { PPC64.IsPOWER8 = true Initialized = true } ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_other_riscv64.go ================================================ // Copyright 2022 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build !linux && riscv64 package cpu func archInit() { Initialized = true } ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_other_x86.go ================================================ // Copyright 2024 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build 386 || amd64p32 || (amd64 && (!darwin || !gc)) package cpu func darwinSupportsAVX512() bool { panic("only implemented for gc && amd64 && darwin") } ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_ppc64x.go ================================================ // Copyright 2020 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build ppc64 || ppc64le package cpu const cacheLineSize = 128 func initOptions() { options = []option{ {Name: "darn", Feature: &PPC64.HasDARN}, {Name: "scv", Feature: &PPC64.HasSCV}, } } ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_riscv64.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build riscv64 package cpu const cacheLineSize = 64 func initOptions() { options = []option{ {Name: "fastmisaligned", Feature: &RISCV64.HasFastMisaligned}, {Name: "c", Feature: &RISCV64.HasC}, {Name: "v", Feature: &RISCV64.HasV}, {Name: "zba", Feature: &RISCV64.HasZba}, {Name: "zbb", Feature: &RISCV64.HasZbb}, {Name: "zbs", Feature: &RISCV64.HasZbs}, // RISC-V Cryptography Extensions {Name: "zvbb", Feature: &RISCV64.HasZvbb}, {Name: "zvbc", Feature: &RISCV64.HasZvbc}, {Name: "zvkb", Feature: &RISCV64.HasZvkb}, {Name: "zvkg", Feature: &RISCV64.HasZvkg}, {Name: "zvkt", Feature: &RISCV64.HasZvkt}, {Name: "zvkn", Feature: &RISCV64.HasZvkn}, {Name: "zvknc", Feature: &RISCV64.HasZvknc}, {Name: "zvkng", Feature: &RISCV64.HasZvkng}, {Name: "zvks", Feature: &RISCV64.HasZvks}, {Name: "zvksc", Feature: &RISCV64.HasZvksc}, {Name: "zvksg", Feature: &RISCV64.HasZvksg}, } } ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_s390x.go ================================================ // Copyright 2020 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cpu const cacheLineSize = 256 func initOptions() { options = []option{ {Name: "zarch", Feature: &S390X.HasZARCH, Required: true}, {Name: "stfle", Feature: &S390X.HasSTFLE, Required: true}, {Name: "ldisp", Feature: &S390X.HasLDISP, Required: true}, {Name: "eimm", Feature: &S390X.HasEIMM, Required: true}, {Name: "dfp", Feature: &S390X.HasDFP}, {Name: "etf3eh", Feature: &S390X.HasETF3EH}, {Name: "msa", Feature: &S390X.HasMSA}, {Name: "aes", Feature: &S390X.HasAES}, {Name: "aescbc", Feature: &S390X.HasAESCBC}, {Name: "aesctr", Feature: &S390X.HasAESCTR}, {Name: "aesgcm", Feature: &S390X.HasAESGCM}, {Name: "ghash", Feature: &S390X.HasGHASH}, {Name: "sha1", Feature: &S390X.HasSHA1}, {Name: "sha256", Feature: &S390X.HasSHA256}, {Name: "sha3", Feature: &S390X.HasSHA3}, {Name: "sha512", Feature: &S390X.HasSHA512}, {Name: "vx", Feature: &S390X.HasVX}, {Name: "vxe", Feature: &S390X.HasVXE}, } } // bitIsSet reports whether the bit at index is set. The bit index // is in big endian order, so bit index 0 is the leftmost bit. func bitIsSet(bits []uint64, index uint) bool { return bits[index/64]&((1<<63)>>(index%64)) != 0 } // facility is a bit index for the named facility. type facility uint8 const ( // mandatory facilities zarch facility = 1 // z architecture mode is active stflef facility = 7 // store-facility-list-extended ldisp facility = 18 // long-displacement eimm facility = 21 // extended-immediate // miscellaneous facilities dfp facility = 42 // decimal-floating-point etf3eh facility = 30 // extended-translation 3 enhancement // cryptography facilities msa facility = 17 // message-security-assist msa3 facility = 76 // message-security-assist extension 3 msa4 facility = 77 // message-security-assist extension 4 msa5 facility = 57 // message-security-assist extension 5 msa8 facility = 146 // message-security-assist extension 8 msa9 facility = 155 // message-security-assist extension 9 // vector facilities vx facility = 129 // vector facility vxe facility = 135 // vector-enhancements 1 vxe2 facility = 148 // vector-enhancements 2 ) // facilityList contains the result of an STFLE call. // Bits are numbered in big endian order so the // leftmost bit (the MSB) is at index 0. type facilityList struct { bits [4]uint64 } // Has reports whether the given facilities are present. func (s *facilityList) Has(fs ...facility) bool { if len(fs) == 0 { panic("no facility bits provided") } for _, f := range fs { if !bitIsSet(s.bits[:], uint(f)) { return false } } return true } // function is the code for the named cryptographic function. type function uint8 const ( // KM{,A,C,CTR} function codes aes128 function = 18 // AES-128 aes192 function = 19 // AES-192 aes256 function = 20 // AES-256 // K{I,L}MD function codes sha1 function = 1 // SHA-1 sha256 function = 2 // SHA-256 sha512 function = 3 // SHA-512 sha3_224 function = 32 // SHA3-224 sha3_256 function = 33 // SHA3-256 sha3_384 function = 34 // SHA3-384 sha3_512 function = 35 // SHA3-512 shake128 function = 36 // SHAKE-128 shake256 function = 37 // SHAKE-256 // KLMD function codes ghash function = 65 // GHASH ) // queryResult contains the result of a Query function // call. Bits are numbered in big endian order so the // leftmost bit (the MSB) is at index 0. type queryResult struct { bits [2]uint64 } // Has reports whether the given functions are present. func (q *queryResult) Has(fns ...function) bool { if len(fns) == 0 { panic("no function codes provided") } for _, f := range fns { if !bitIsSet(q.bits[:], uint(f)) { return false } } return true } func doinit() { initS390Xbase() // We need implementations of stfle, km and so on // to detect cryptographic features. if !haveAsmFunctions() { return } // optional cryptographic functions if S390X.HasMSA { aes := []function{aes128, aes192, aes256} // cipher message km, kmc := kmQuery(), kmcQuery() S390X.HasAES = km.Has(aes...) S390X.HasAESCBC = kmc.Has(aes...) if S390X.HasSTFLE { facilities := stfle() if facilities.Has(msa4) { kmctr := kmctrQuery() S390X.HasAESCTR = kmctr.Has(aes...) } if facilities.Has(msa8) { kma := kmaQuery() S390X.HasAESGCM = kma.Has(aes...) } } // compute message digest kimd := kimdQuery() // intermediate (no padding) klmd := klmdQuery() // last (padding) S390X.HasSHA1 = kimd.Has(sha1) && klmd.Has(sha1) S390X.HasSHA256 = kimd.Has(sha256) && klmd.Has(sha256) S390X.HasSHA512 = kimd.Has(sha512) && klmd.Has(sha512) S390X.HasGHASH = kimd.Has(ghash) // KLMD-GHASH does not exist sha3 := []function{ sha3_224, sha3_256, sha3_384, sha3_512, shake128, shake256, } S390X.HasSHA3 = kimd.Has(sha3...) && klmd.Has(sha3...) } } ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_s390x.s ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build gc #include "textflag.h" // func stfle() facilityList TEXT ·stfle(SB), NOSPLIT|NOFRAME, $0-32 MOVD $ret+0(FP), R1 MOVD $3, R0 // last doubleword index to store XC $32, (R1), (R1) // clear 4 doublewords (32 bytes) WORD $0xb2b01000 // store facility list extended (STFLE) RET // func kmQuery() queryResult TEXT ·kmQuery(SB), NOSPLIT|NOFRAME, $0-16 MOVD $0, R0 // set function code to 0 (KM-Query) MOVD $ret+0(FP), R1 // address of 16-byte return value WORD $0xB92E0024 // cipher message (KM) RET // func kmcQuery() queryResult TEXT ·kmcQuery(SB), NOSPLIT|NOFRAME, $0-16 MOVD $0, R0 // set function code to 0 (KMC-Query) MOVD $ret+0(FP), R1 // address of 16-byte return value WORD $0xB92F0024 // cipher message with chaining (KMC) RET // func kmctrQuery() queryResult TEXT ·kmctrQuery(SB), NOSPLIT|NOFRAME, $0-16 MOVD $0, R0 // set function code to 0 (KMCTR-Query) MOVD $ret+0(FP), R1 // address of 16-byte return value WORD $0xB92D4024 // cipher message with counter (KMCTR) RET // func kmaQuery() queryResult TEXT ·kmaQuery(SB), NOSPLIT|NOFRAME, $0-16 MOVD $0, R0 // set function code to 0 (KMA-Query) MOVD $ret+0(FP), R1 // address of 16-byte return value WORD $0xb9296024 // cipher message with authentication (KMA) RET // func kimdQuery() queryResult TEXT ·kimdQuery(SB), NOSPLIT|NOFRAME, $0-16 MOVD $0, R0 // set function code to 0 (KIMD-Query) MOVD $ret+0(FP), R1 // address of 16-byte return value WORD $0xB93E0024 // compute intermediate message digest (KIMD) RET // func klmdQuery() queryResult TEXT ·klmdQuery(SB), NOSPLIT|NOFRAME, $0-16 MOVD $0, R0 // set function code to 0 (KLMD-Query) MOVD $ret+0(FP), R1 // address of 16-byte return value WORD $0xB93F0024 // compute last message digest (KLMD) RET ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_wasm.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build wasm package cpu // We're compiling the cpu package for an unknown (software-abstracted) CPU. // Make CacheLinePad an empty struct and hope that the usual struct alignment // rules are good enough. const cacheLineSize = 0 func initOptions() {} func archInit() {} ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_windows_arm64.go ================================================ // Copyright 2026 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cpu import ( "golang.org/x/sys/windows" ) func doinit() { // set HasASIMD and HasFP to true as per // https://learn.microsoft.com/en-us/cpp/build/arm64-windows-abi-conventions?view=msvc-170#base-requirements // // The ARM64 version of Windows always presupposes that it's running on an ARMv8 or later architecture. // Both floating-point and NEON support are presumed to be present in hardware. // ARM64.HasASIMD = true ARM64.HasFP = true if windows.IsProcessorFeaturePresent(windows.PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE) { ARM64.HasAES = true ARM64.HasPMULL = true ARM64.HasSHA1 = true ARM64.HasSHA2 = true } ARM64.HasSHA3 = windows.IsProcessorFeaturePresent(windows.PF_ARM_SHA3_INSTRUCTIONS_AVAILABLE) ARM64.HasCRC32 = windows.IsProcessorFeaturePresent(windows.PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE) ARM64.HasSHA512 = windows.IsProcessorFeaturePresent(windows.PF_ARM_SHA512_INSTRUCTIONS_AVAILABLE) ARM64.HasATOMICS = windows.IsProcessorFeaturePresent(windows.PF_ARM_V81_ATOMIC_INSTRUCTIONS_AVAILABLE) if windows.IsProcessorFeaturePresent(windows.PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE) { ARM64.HasASIMDDP = true ARM64.HasASIMDRDM = true } if windows.IsProcessorFeaturePresent(windows.PF_ARM_V83_LRCPC_INSTRUCTIONS_AVAILABLE) { ARM64.HasLRCPC = true ARM64.HasSM3 = true } ARM64.HasSVE = windows.IsProcessorFeaturePresent(windows.PF_ARM_SVE_INSTRUCTIONS_AVAILABLE) ARM64.HasSVE2 = windows.IsProcessorFeaturePresent(windows.PF_ARM_SVE2_INSTRUCTIONS_AVAILABLE) ARM64.HasJSCVT = windows.IsProcessorFeaturePresent(windows.PF_ARM_V83_JSCVT_INSTRUCTIONS_AVAILABLE) } ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_x86.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build 386 || amd64 || amd64p32 package cpu import "runtime" const cacheLineSize = 64 func initOptions() { options = []option{ {Name: "adx", Feature: &X86.HasADX}, {Name: "aes", Feature: &X86.HasAES}, {Name: "avx", Feature: &X86.HasAVX}, {Name: "avx2", Feature: &X86.HasAVX2}, {Name: "avx512", Feature: &X86.HasAVX512}, {Name: "avx512f", Feature: &X86.HasAVX512F}, {Name: "avx512cd", Feature: &X86.HasAVX512CD}, {Name: "avx512er", Feature: &X86.HasAVX512ER}, {Name: "avx512pf", Feature: &X86.HasAVX512PF}, {Name: "avx512vl", Feature: &X86.HasAVX512VL}, {Name: "avx512bw", Feature: &X86.HasAVX512BW}, {Name: "avx512dq", Feature: &X86.HasAVX512DQ}, {Name: "avx512ifma", Feature: &X86.HasAVX512IFMA}, {Name: "avx512vbmi", Feature: &X86.HasAVX512VBMI}, {Name: "avx512vnniw", Feature: &X86.HasAVX5124VNNIW}, {Name: "avx5124fmaps", Feature: &X86.HasAVX5124FMAPS}, {Name: "avx512vpopcntdq", Feature: &X86.HasAVX512VPOPCNTDQ}, {Name: "avx512vpclmulqdq", Feature: &X86.HasAVX512VPCLMULQDQ}, {Name: "avx512vnni", Feature: &X86.HasAVX512VNNI}, {Name: "avx512gfni", Feature: &X86.HasAVX512GFNI}, {Name: "avx512vaes", Feature: &X86.HasAVX512VAES}, {Name: "avx512vbmi2", Feature: &X86.HasAVX512VBMI2}, {Name: "avx512bitalg", Feature: &X86.HasAVX512BITALG}, {Name: "avx512bf16", Feature: &X86.HasAVX512BF16}, {Name: "amxtile", Feature: &X86.HasAMXTile}, {Name: "amxint8", Feature: &X86.HasAMXInt8}, {Name: "amxbf16", Feature: &X86.HasAMXBF16}, {Name: "bmi1", Feature: &X86.HasBMI1}, {Name: "bmi2", Feature: &X86.HasBMI2}, {Name: "cx16", Feature: &X86.HasCX16}, {Name: "erms", Feature: &X86.HasERMS}, {Name: "fma", Feature: &X86.HasFMA}, {Name: "osxsave", Feature: &X86.HasOSXSAVE}, {Name: "pclmulqdq", Feature: &X86.HasPCLMULQDQ}, {Name: "popcnt", Feature: &X86.HasPOPCNT}, {Name: "rdrand", Feature: &X86.HasRDRAND}, {Name: "rdseed", Feature: &X86.HasRDSEED}, {Name: "sse3", Feature: &X86.HasSSE3}, {Name: "sse41", Feature: &X86.HasSSE41}, {Name: "sse42", Feature: &X86.HasSSE42}, {Name: "ssse3", Feature: &X86.HasSSSE3}, {Name: "avxifma", Feature: &X86.HasAVXIFMA}, {Name: "avxvnni", Feature: &X86.HasAVXVNNI}, {Name: "avxvnniint8", Feature: &X86.HasAVXVNNIInt8}, // These capabilities should always be enabled on amd64: {Name: "sse2", Feature: &X86.HasSSE2, Required: runtime.GOARCH == "amd64"}, } } func archInit() { // From internal/cpu const ( // eax bits cpuid_AVXVNNI = 1 << 4 // ecx bits cpuid_SSE3 = 1 << 0 cpuid_PCLMULQDQ = 1 << 1 cpuid_AVX512VBMI = 1 << 1 cpuid_AVX512VBMI2 = 1 << 6 cpuid_SSSE3 = 1 << 9 cpuid_AVX512GFNI = 1 << 8 cpuid_AVX512VAES = 1 << 9 cpuid_AVX512VNNI = 1 << 11 cpuid_AVX512BITALG = 1 << 12 cpuid_FMA = 1 << 12 cpuid_AVX512VPOPCNTDQ = 1 << 14 cpuid_SSE41 = 1 << 19 cpuid_SSE42 = 1 << 20 cpuid_POPCNT = 1 << 23 cpuid_AES = 1 << 25 cpuid_OSXSAVE = 1 << 27 cpuid_AVX = 1 << 28 // "Extended Feature Flag" bits returned in EBX for CPUID EAX=0x7 ECX=0x0 cpuid_BMI1 = 1 << 3 cpuid_AVX2 = 1 << 5 cpuid_BMI2 = 1 << 8 cpuid_ERMS = 1 << 9 cpuid_AVX512F = 1 << 16 cpuid_AVX512DQ = 1 << 17 cpuid_ADX = 1 << 19 cpuid_AVX512CD = 1 << 28 cpuid_SHA = 1 << 29 cpuid_AVX512BW = 1 << 30 cpuid_AVX512VL = 1 << 31 // "Extended Feature Flag" bits returned in ECX for CPUID EAX=0x7 ECX=0x0 cpuid_AVX512_VBMI = 1 << 1 cpuid_AVX512_VBMI2 = 1 << 6 cpuid_GFNI = 1 << 8 cpuid_AVX512VPCLMULQDQ = 1 << 10 cpuid_AVX512_BITALG = 1 << 12 // edx bits cpuid_FSRM = 1 << 4 // edx bits for CPUID 0x80000001 cpuid_RDTSCP = 1 << 27 ) // Additional constants not in internal/cpu const ( // eax=1: edx cpuid_SSE2 = 1 << 26 // eax=1: ecx cpuid_CX16 = 1 << 13 cpuid_RDRAND = 1 << 30 // eax=7,ecx=0: ebx cpuid_RDSEED = 1 << 18 cpuid_AVX512IFMA = 1 << 21 cpuid_AVX512PF = 1 << 26 cpuid_AVX512ER = 1 << 27 // eax=7,ecx=0: edx cpuid_AVX5124VNNIW = 1 << 2 cpuid_AVX5124FMAPS = 1 << 3 cpuid_AMXBF16 = 1 << 22 cpuid_AMXTile = 1 << 24 cpuid_AMXInt8 = 1 << 25 // eax=7,ecx=1: eax cpuid_AVX512BF16 = 1 << 5 cpuid_AVXIFMA = 1 << 23 // eax=7,ecx=1: edx cpuid_AVXVNNIInt8 = 1 << 4 ) Initialized = true maxID, _, _, _ := cpuid(0, 0) if maxID < 1 { return } _, _, ecx1, edx1 := cpuid(1, 0) X86.HasSSE2 = isSet(edx1, cpuid_SSE2) X86.HasSSE3 = isSet(ecx1, cpuid_SSE3) X86.HasPCLMULQDQ = isSet(ecx1, cpuid_PCLMULQDQ) X86.HasSSSE3 = isSet(ecx1, cpuid_SSSE3) X86.HasFMA = isSet(ecx1, cpuid_FMA) X86.HasCX16 = isSet(ecx1, cpuid_CX16) X86.HasSSE41 = isSet(ecx1, cpuid_SSE41) X86.HasSSE42 = isSet(ecx1, cpuid_SSE42) X86.HasPOPCNT = isSet(ecx1, cpuid_POPCNT) X86.HasAES = isSet(ecx1, cpuid_AES) X86.HasOSXSAVE = isSet(ecx1, cpuid_OSXSAVE) X86.HasRDRAND = isSet(ecx1, cpuid_RDRAND) var osSupportsAVX, osSupportsAVX512 bool // For XGETBV, OSXSAVE bit is required and sufficient. if X86.HasOSXSAVE { eax, _ := xgetbv() // Check if XMM and YMM registers have OS support. osSupportsAVX = isSet(eax, 1<<1) && isSet(eax, 1<<2) if runtime.GOOS == "darwin" { // Darwin requires special AVX512 checks, see cpu_darwin_x86.go osSupportsAVX512 = osSupportsAVX && darwinSupportsAVX512() } else { // Check if OPMASK and ZMM registers have OS support. osSupportsAVX512 = osSupportsAVX && isSet(eax, 1<<5) && isSet(eax, 1<<6) && isSet(eax, 1<<7) } } X86.HasAVX = isSet(ecx1, cpuid_AVX) && osSupportsAVX if maxID < 7 { return } eax7, ebx7, ecx7, edx7 := cpuid(7, 0) X86.HasBMI1 = isSet(ebx7, cpuid_BMI1) X86.HasAVX2 = isSet(ebx7, cpuid_AVX2) && osSupportsAVX X86.HasBMI2 = isSet(ebx7, cpuid_BMI2) X86.HasERMS = isSet(ebx7, cpuid_ERMS) X86.HasRDSEED = isSet(ebx7, cpuid_RDSEED) X86.HasADX = isSet(ebx7, cpuid_ADX) X86.HasAVX512 = isSet(ebx7, cpuid_AVX512F) && osSupportsAVX512 // Because avx-512 foundation is the core required extension if X86.HasAVX512 { X86.HasAVX512F = true X86.HasAVX512CD = isSet(ebx7, cpuid_AVX512CD) X86.HasAVX512ER = isSet(ebx7, cpuid_AVX512ER) X86.HasAVX512PF = isSet(ebx7, cpuid_AVX512PF) X86.HasAVX512VL = isSet(ebx7, cpuid_AVX512VL) X86.HasAVX512BW = isSet(ebx7, cpuid_AVX512BW) X86.HasAVX512DQ = isSet(ebx7, cpuid_AVX512DQ) X86.HasAVX512IFMA = isSet(ebx7, cpuid_AVX512IFMA) X86.HasAVX512VBMI = isSet(ecx7, cpuid_AVX512_VBMI) X86.HasAVX5124VNNIW = isSet(edx7, cpuid_AVX5124VNNIW) X86.HasAVX5124FMAPS = isSet(edx7, cpuid_AVX5124FMAPS) X86.HasAVX512VPOPCNTDQ = isSet(ecx7, cpuid_AVX512VPOPCNTDQ) X86.HasAVX512VPCLMULQDQ = isSet(ecx7, cpuid_AVX512VPCLMULQDQ) X86.HasAVX512VNNI = isSet(ecx7, cpuid_AVX512VNNI) X86.HasAVX512GFNI = isSet(ecx7, cpuid_AVX512GFNI) X86.HasAVX512VAES = isSet(ecx7, cpuid_AVX512VAES) X86.HasAVX512VBMI2 = isSet(ecx7, cpuid_AVX512VBMI2) X86.HasAVX512BITALG = isSet(ecx7, cpuid_AVX512BITALG) } X86.HasAMXTile = isSet(edx7, cpuid_AMXTile) X86.HasAMXInt8 = isSet(edx7, cpuid_AMXInt8) X86.HasAMXBF16 = isSet(edx7, cpuid_AMXBF16) // These features depend on the second level of extended features. if eax7 >= 1 { eax71, _, _, edx71 := cpuid(7, 1) if X86.HasAVX512 { X86.HasAVX512BF16 = isSet(eax71, cpuid_AVX512BF16) } if X86.HasAVX { X86.HasAVXIFMA = isSet(eax71, cpuid_AVXIFMA) X86.HasAVXVNNI = isSet(eax71, cpuid_AVXVNNI) X86.HasAVXVNNIInt8 = isSet(edx71, cpuid_AVXVNNIInt8) } } } func isSet(hwc uint32, value uint32) bool { return hwc&value != 0 } ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_zos.go ================================================ // Copyright 2020 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cpu func archInit() { doinit() Initialized = true } ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_zos_s390x.go ================================================ // Copyright 2020 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cpu func initS390Xbase() { // get the facilities list facilities := stfle() // mandatory S390X.HasZARCH = facilities.Has(zarch) S390X.HasSTFLE = facilities.Has(stflef) S390X.HasLDISP = facilities.Has(ldisp) S390X.HasEIMM = facilities.Has(eimm) // optional S390X.HasETF3EH = facilities.Has(etf3eh) S390X.HasDFP = facilities.Has(dfp) S390X.HasMSA = facilities.Has(msa) S390X.HasVX = facilities.Has(vx) if S390X.HasVX { S390X.HasVXE = facilities.Has(vxe) } } ================================================ FILE: vendor/golang.org/x/sys/cpu/endian_big.go ================================================ // Copyright 2023 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build armbe || arm64be || m68k || mips || mips64 || mips64p32 || ppc || ppc64 || s390 || s390x || shbe || sparc || sparc64 package cpu // IsBigEndian records whether the GOARCH's byte order is big endian. const IsBigEndian = true ================================================ FILE: vendor/golang.org/x/sys/cpu/endian_little.go ================================================ // Copyright 2023 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build 386 || amd64 || amd64p32 || alpha || arm || arm64 || loong64 || mipsle || mips64le || mips64p32le || nios2 || ppc64le || riscv || riscv64 || sh || wasm package cpu // IsBigEndian records whether the GOARCH's byte order is big endian. const IsBigEndian = false ================================================ FILE: vendor/golang.org/x/sys/cpu/hwcap_linux.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cpu import ( "os" ) const ( _AT_HWCAP = 16 _AT_HWCAP2 = 26 procAuxv = "/proc/self/auxv" uintSize = int(32 << (^uint(0) >> 63)) ) // For those platforms don't have a 'cpuid' equivalent we use HWCAP/HWCAP2 // These are initialized in cpu_$GOARCH.go // and should not be changed after they are initialized. var hwCap uint var hwCap2 uint func readHWCAP() error { // For Go 1.21+, get auxv from the Go runtime. if a := getAuxv(); len(a) > 0 { for len(a) >= 2 { tag, val := a[0], uint(a[1]) a = a[2:] switch tag { case _AT_HWCAP: hwCap = val case _AT_HWCAP2: hwCap2 = val } } return nil } buf, err := os.ReadFile(procAuxv) if err != nil { // e.g. on android /proc/self/auxv is not accessible, so silently // ignore the error and leave Initialized = false. On some // architectures (e.g. arm64) doinit() implements a fallback // readout and will set Initialized = true again. return err } bo := hostByteOrder() for len(buf) >= 2*(uintSize/8) { var tag, val uint switch uintSize { case 32: tag = uint(bo.Uint32(buf[0:])) val = uint(bo.Uint32(buf[4:])) buf = buf[8:] case 64: tag = uint(bo.Uint64(buf[0:])) val = uint(bo.Uint64(buf[8:])) buf = buf[16:] } switch tag { case _AT_HWCAP: hwCap = val case _AT_HWCAP2: hwCap2 = val } } return nil } ================================================ FILE: vendor/golang.org/x/sys/cpu/parse.go ================================================ // Copyright 2022 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cpu import "strconv" // parseRelease parses a dot-separated version number. It follows the semver // syntax, but allows the minor and patch versions to be elided. // // This is a copy of the Go runtime's parseRelease from // https://golang.org/cl/209597. func parseRelease(rel string) (major, minor, patch int, ok bool) { // Strip anything after a dash or plus. for i := range len(rel) { if rel[i] == '-' || rel[i] == '+' { rel = rel[:i] break } } next := func() (int, bool) { for i := range len(rel) { if rel[i] == '.' { ver, err := strconv.Atoi(rel[:i]) rel = rel[i+1:] return ver, err == nil } } ver, err := strconv.Atoi(rel) rel = "" return ver, err == nil } if major, ok = next(); !ok || rel == "" { return } if minor, ok = next(); !ok || rel == "" { return } patch, ok = next() return } ================================================ FILE: vendor/golang.org/x/sys/cpu/proc_cpuinfo_linux.go ================================================ // Copyright 2022 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build linux && arm64 package cpu import ( "errors" "io" "os" "strings" ) func readLinuxProcCPUInfo() error { f, err := os.Open("/proc/cpuinfo") if err != nil { return err } defer f.Close() var buf [1 << 10]byte // enough for first CPU n, err := io.ReadFull(f, buf[:]) if err != nil && err != io.ErrUnexpectedEOF { return err } in := string(buf[:n]) const features = "\nFeatures : " i := strings.Index(in, features) if i == -1 { return errors.New("no CPU features found") } in = in[i+len(features):] if i := strings.Index(in, "\n"); i != -1 { in = in[:i] } m := map[string]*bool{} initOptions() // need it early here; it's harmless to call twice for _, o := range options { m[o.Name] = o.Feature } // The EVTSTRM field has alias "evstrm" in Go, but Linux calls it "evtstrm". m["evtstrm"] = &ARM64.HasEVTSTRM for _, f := range strings.Fields(in) { if p, ok := m[f]; ok { *p = true } } return nil } ================================================ FILE: vendor/golang.org/x/sys/cpu/runtime_auxv.go ================================================ // Copyright 2023 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cpu // getAuxvFn is non-nil on Go 1.21+ (via runtime_auxv_go121.go init) // on platforms that use auxv. var getAuxvFn func() []uintptr func getAuxv() []uintptr { if getAuxvFn == nil { return nil } return getAuxvFn() } ================================================ FILE: vendor/golang.org/x/sys/cpu/runtime_auxv_go121.go ================================================ // Copyright 2023 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build go1.21 package cpu import ( _ "unsafe" // for linkname ) //go:linkname runtime_getAuxv runtime.getAuxv func runtime_getAuxv() []uintptr func init() { getAuxvFn = runtime_getAuxv } ================================================ FILE: vendor/golang.org/x/sys/cpu/syscall_aix_gccgo.go ================================================ // Copyright 2020 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Recreate a getsystemcfg syscall handler instead of // using the one provided by x/sys/unix to avoid having // the dependency between them. (See golang.org/issue/32102) // Moreover, this file will be used during the building of // gccgo's libgo and thus must not used a CGo method. //go:build aix && gccgo package cpu import ( "syscall" ) //extern getsystemcfg func gccgoGetsystemcfg(label uint32) (r uint64) func callgetsystemcfg(label int) (r1 uintptr, e1 syscall.Errno) { r1 = uintptr(gccgoGetsystemcfg(uint32(label))) e1 = syscall.GetErrno() return } ================================================ FILE: vendor/golang.org/x/sys/cpu/syscall_aix_ppc64_gc.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Minimal copy of x/sys/unix so the cpu package can make a // system call on AIX without depending on x/sys/unix. // (See golang.org/issue/32102) //go:build aix && ppc64 && gc package cpu import ( "syscall" "unsafe" ) //go:cgo_import_dynamic libc_getsystemcfg getsystemcfg "libc.a/shr_64.o" //go:linkname libc_getsystemcfg libc_getsystemcfg type syscallFunc uintptr var libc_getsystemcfg syscallFunc type errno = syscall.Errno // Implemented in runtime/syscall_aix.go. func rawSyscall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err errno) func syscall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err errno) func callgetsystemcfg(label int) (r1 uintptr, e1 errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_getsystemcfg)), 1, uintptr(label), 0, 0, 0, 0, 0) return } ================================================ FILE: vendor/golang.org/x/sys/cpu/syscall_darwin_arm64_gc.go ================================================ // Copyright 2024 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Minimal copy from internal/cpu and runtime to make sysctl calls. //go:build darwin && arm64 && gc package cpu import ( "syscall" "unsafe" ) type Errno = syscall.Errno // adapted from internal/cpu/cpu_arm64_darwin.go func darwinSysctlEnabled(name []byte) bool { out := int32(0) nout := unsafe.Sizeof(out) if ret := sysctlbyname(&name[0], (*byte)(unsafe.Pointer(&out)), &nout, nil, 0); ret != nil { return false } return out > 0 } //go:cgo_import_dynamic libc_sysctl sysctl "/usr/lib/libSystem.B.dylib" var libc_sysctlbyname_trampoline_addr uintptr // adapted from runtime/sys_darwin.go in the pattern of sysctl() above, as defined in x/sys/unix func sysctlbyname(name *byte, old *byte, oldlen *uintptr, new *byte, newlen uintptr) error { if _, _, err := syscall_syscall6( libc_sysctlbyname_trampoline_addr, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen), 0, ); err != 0 { return err } return nil } //go:cgo_import_dynamic libc_sysctlbyname sysctlbyname "/usr/lib/libSystem.B.dylib" // Implemented in the runtime package (runtime/sys_darwin.go) func syscall_syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) //go:linkname syscall_syscall6 syscall.syscall6 ================================================ FILE: vendor/golang.org/x/sys/cpu/syscall_darwin_x86_gc.go ================================================ // Copyright 2024 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Minimal copy of x/sys/unix so the cpu package can make a // system call on Darwin without depending on x/sys/unix. //go:build darwin && amd64 && gc package cpu import ( "syscall" "unsafe" ) type _C_int int32 // adapted from unix.Uname() at x/sys/unix/syscall_darwin.go L419 func darwinOSRelease(release *[256]byte) error { // from x/sys/unix/zerrors_openbsd_amd64.go const ( CTL_KERN = 0x1 KERN_OSRELEASE = 0x2 ) mib := []_C_int{CTL_KERN, KERN_OSRELEASE} n := unsafe.Sizeof(*release) return sysctl(mib, &release[0], &n, nil, 0) } type Errno = syscall.Errno var _zero uintptr // Single-word zero for use when we need a valid pointer to 0 bytes. // from x/sys/unix/zsyscall_darwin_amd64.go L791-807 func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) error { var _p0 unsafe.Pointer if len(mib) > 0 { _p0 = unsafe.Pointer(&mib[0]) } else { _p0 = unsafe.Pointer(&_zero) } if _, _, err := syscall_syscall6( libc_sysctl_trampoline_addr, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen), ); err != 0 { return err } return nil } var libc_sysctl_trampoline_addr uintptr // adapted from internal/cpu/cpu_arm64_darwin.go func darwinSysctlEnabled(name []byte) bool { out := int32(0) nout := unsafe.Sizeof(out) if ret := sysctlbyname(&name[0], (*byte)(unsafe.Pointer(&out)), &nout, nil, 0); ret != nil { return false } return out > 0 } //go:cgo_import_dynamic libc_sysctl sysctl "/usr/lib/libSystem.B.dylib" var libc_sysctlbyname_trampoline_addr uintptr // adapted from runtime/sys_darwin.go in the pattern of sysctl() above, as defined in x/sys/unix func sysctlbyname(name *byte, old *byte, oldlen *uintptr, new *byte, newlen uintptr) error { if _, _, err := syscall_syscall6( libc_sysctlbyname_trampoline_addr, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen), 0, ); err != 0 { return err } return nil } //go:cgo_import_dynamic libc_sysctlbyname sysctlbyname "/usr/lib/libSystem.B.dylib" // Implemented in the runtime package (runtime/sys_darwin.go) func syscall_syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) //go:linkname syscall_syscall6 syscall.syscall6 ================================================ FILE: vendor/golang.org/x/sys/plan9/asm.s ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. #include "textflag.h" TEXT ·use(SB),NOSPLIT,$0 RET ================================================ FILE: vendor/golang.org/x/sys/plan9/asm_plan9_386.s ================================================ // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. #include "textflag.h" // // System call support for 386, Plan 9 // // Just jump to package syscall's implementation for all these functions. // The runtime may know about them. TEXT ·Syscall(SB),NOSPLIT,$0-32 JMP syscall·Syscall(SB) TEXT ·Syscall6(SB),NOSPLIT,$0-44 JMP syscall·Syscall6(SB) TEXT ·RawSyscall(SB),NOSPLIT,$0-28 JMP syscall·RawSyscall(SB) TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 JMP syscall·RawSyscall6(SB) TEXT ·seek(SB),NOSPLIT,$0-36 JMP syscall·seek(SB) TEXT ·exit(SB),NOSPLIT,$4-4 JMP syscall·exit(SB) ================================================ FILE: vendor/golang.org/x/sys/plan9/asm_plan9_amd64.s ================================================ // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. #include "textflag.h" // // System call support for amd64, Plan 9 // // Just jump to package syscall's implementation for all these functions. // The runtime may know about them. TEXT ·Syscall(SB),NOSPLIT,$0-64 JMP syscall·Syscall(SB) TEXT ·Syscall6(SB),NOSPLIT,$0-88 JMP syscall·Syscall6(SB) TEXT ·RawSyscall(SB),NOSPLIT,$0-56 JMP syscall·RawSyscall(SB) TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 JMP syscall·RawSyscall6(SB) TEXT ·seek(SB),NOSPLIT,$0-56 JMP syscall·seek(SB) TEXT ·exit(SB),NOSPLIT,$8-8 JMP syscall·exit(SB) ================================================ FILE: vendor/golang.org/x/sys/plan9/asm_plan9_arm.s ================================================ // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. #include "textflag.h" // System call support for plan9 on arm // Just jump to package syscall's implementation for all these functions. // The runtime may know about them. TEXT ·Syscall(SB),NOSPLIT,$0-32 JMP syscall·Syscall(SB) TEXT ·Syscall6(SB),NOSPLIT,$0-44 JMP syscall·Syscall6(SB) TEXT ·RawSyscall(SB),NOSPLIT,$0-28 JMP syscall·RawSyscall(SB) TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 JMP syscall·RawSyscall6(SB) TEXT ·seek(SB),NOSPLIT,$0-36 JMP syscall·exit(SB) ================================================ FILE: vendor/golang.org/x/sys/plan9/const_plan9.go ================================================ package plan9 // Plan 9 Constants // Open modes const ( O_RDONLY = 0 O_WRONLY = 1 O_RDWR = 2 O_TRUNC = 16 O_CLOEXEC = 32 O_EXCL = 0x1000 ) // Rfork flags const ( RFNAMEG = 1 << 0 RFENVG = 1 << 1 RFFDG = 1 << 2 RFNOTEG = 1 << 3 RFPROC = 1 << 4 RFMEM = 1 << 5 RFNOWAIT = 1 << 6 RFCNAMEG = 1 << 10 RFCENVG = 1 << 11 RFCFDG = 1 << 12 RFREND = 1 << 13 RFNOMNT = 1 << 14 ) // Qid.Type bits const ( QTDIR = 0x80 QTAPPEND = 0x40 QTEXCL = 0x20 QTMOUNT = 0x10 QTAUTH = 0x08 QTTMP = 0x04 QTFILE = 0x00 ) // Dir.Mode bits const ( DMDIR = 0x80000000 DMAPPEND = 0x40000000 DMEXCL = 0x20000000 DMMOUNT = 0x10000000 DMAUTH = 0x08000000 DMTMP = 0x04000000 DMREAD = 0x4 DMWRITE = 0x2 DMEXEC = 0x1 ) const ( STATMAX = 65535 ERRMAX = 128 STATFIXLEN = 49 ) // Mount and bind flags const ( MREPL = 0x0000 MBEFORE = 0x0001 MAFTER = 0x0002 MORDER = 0x0003 MCREATE = 0x0004 MCACHE = 0x0010 MMASK = 0x0017 ) ================================================ FILE: vendor/golang.org/x/sys/plan9/dir_plan9.go ================================================ // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Plan 9 directory marshalling. See intro(5). package plan9 import "errors" var ( ErrShortStat = errors.New("stat buffer too short") ErrBadStat = errors.New("malformed stat buffer") ErrBadName = errors.New("bad character in file name") ) // A Qid represents a 9P server's unique identification for a file. type Qid struct { Path uint64 // the file server's unique identification for the file Vers uint32 // version number for given Path Type uint8 // the type of the file (plan9.QTDIR for example) } // A Dir contains the metadata for a file. type Dir struct { // system-modified data Type uint16 // server type Dev uint32 // server subtype // file data Qid Qid // unique id from server Mode uint32 // permissions Atime uint32 // last read time Mtime uint32 // last write time Length int64 // file length Name string // last element of path Uid string // owner name Gid string // group name Muid string // last modifier name } var nullDir = Dir{ Type: ^uint16(0), Dev: ^uint32(0), Qid: Qid{ Path: ^uint64(0), Vers: ^uint32(0), Type: ^uint8(0), }, Mode: ^uint32(0), Atime: ^uint32(0), Mtime: ^uint32(0), Length: ^int64(0), } // Null assigns special "don't touch" values to members of d to // avoid modifying them during plan9.Wstat. func (d *Dir) Null() { *d = nullDir } // Marshal encodes a 9P stat message corresponding to d into b // // If there isn't enough space in b for a stat message, ErrShortStat is returned. func (d *Dir) Marshal(b []byte) (n int, err error) { n = STATFIXLEN + len(d.Name) + len(d.Uid) + len(d.Gid) + len(d.Muid) if n > len(b) { return n, ErrShortStat } for _, c := range d.Name { if c == '/' { return n, ErrBadName } } b = pbit16(b, uint16(n)-2) b = pbit16(b, d.Type) b = pbit32(b, d.Dev) b = pbit8(b, d.Qid.Type) b = pbit32(b, d.Qid.Vers) b = pbit64(b, d.Qid.Path) b = pbit32(b, d.Mode) b = pbit32(b, d.Atime) b = pbit32(b, d.Mtime) b = pbit64(b, uint64(d.Length)) b = pstring(b, d.Name) b = pstring(b, d.Uid) b = pstring(b, d.Gid) b = pstring(b, d.Muid) return n, nil } // UnmarshalDir decodes a single 9P stat message from b and returns the resulting Dir. // // If b is too small to hold a valid stat message, ErrShortStat is returned. // // If the stat message itself is invalid, ErrBadStat is returned. func UnmarshalDir(b []byte) (*Dir, error) { if len(b) < STATFIXLEN { return nil, ErrShortStat } size, buf := gbit16(b) if len(b) != int(size)+2 { return nil, ErrBadStat } b = buf var d Dir d.Type, b = gbit16(b) d.Dev, b = gbit32(b) d.Qid.Type, b = gbit8(b) d.Qid.Vers, b = gbit32(b) d.Qid.Path, b = gbit64(b) d.Mode, b = gbit32(b) d.Atime, b = gbit32(b) d.Mtime, b = gbit32(b) n, b := gbit64(b) d.Length = int64(n) var ok bool if d.Name, b, ok = gstring(b); !ok { return nil, ErrBadStat } if d.Uid, b, ok = gstring(b); !ok { return nil, ErrBadStat } if d.Gid, b, ok = gstring(b); !ok { return nil, ErrBadStat } if d.Muid, b, ok = gstring(b); !ok { return nil, ErrBadStat } return &d, nil } // pbit8 copies the 8-bit number v to b and returns the remaining slice of b. func pbit8(b []byte, v uint8) []byte { b[0] = byte(v) return b[1:] } // pbit16 copies the 16-bit number v to b in little-endian order and returns the remaining slice of b. func pbit16(b []byte, v uint16) []byte { b[0] = byte(v) b[1] = byte(v >> 8) return b[2:] } // pbit32 copies the 32-bit number v to b in little-endian order and returns the remaining slice of b. func pbit32(b []byte, v uint32) []byte { b[0] = byte(v) b[1] = byte(v >> 8) b[2] = byte(v >> 16) b[3] = byte(v >> 24) return b[4:] } // pbit64 copies the 64-bit number v to b in little-endian order and returns the remaining slice of b. func pbit64(b []byte, v uint64) []byte { b[0] = byte(v) b[1] = byte(v >> 8) b[2] = byte(v >> 16) b[3] = byte(v >> 24) b[4] = byte(v >> 32) b[5] = byte(v >> 40) b[6] = byte(v >> 48) b[7] = byte(v >> 56) return b[8:] } // pstring copies the string s to b, prepending it with a 16-bit length in little-endian order, and // returning the remaining slice of b.. func pstring(b []byte, s string) []byte { b = pbit16(b, uint16(len(s))) n := copy(b, s) return b[n:] } // gbit8 reads an 8-bit number from b and returns it with the remaining slice of b. func gbit8(b []byte) (uint8, []byte) { return uint8(b[0]), b[1:] } // gbit16 reads a 16-bit number in little-endian order from b and returns it with the remaining slice of b. func gbit16(b []byte) (uint16, []byte) { return uint16(b[0]) | uint16(b[1])<<8, b[2:] } // gbit32 reads a 32-bit number in little-endian order from b and returns it with the remaining slice of b. func gbit32(b []byte) (uint32, []byte) { return uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24, b[4:] } // gbit64 reads a 64-bit number in little-endian order from b and returns it with the remaining slice of b. func gbit64(b []byte) (uint64, []byte) { lo := uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24 hi := uint32(b[4]) | uint32(b[5])<<8 | uint32(b[6])<<16 | uint32(b[7])<<24 return uint64(lo) | uint64(hi)<<32, b[8:] } // gstring reads a string from b, prefixed with a 16-bit length in little-endian order. // It returns the string with the remaining slice of b and a boolean. If the length is // greater than the number of bytes in b, the boolean will be false. func gstring(b []byte) (string, []byte, bool) { n, b := gbit16(b) if int(n) > len(b) { return "", b, false } return string(b[:n]), b[n:], true } ================================================ FILE: vendor/golang.org/x/sys/plan9/env_plan9.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Plan 9 environment variables. package plan9 import ( "syscall" ) func Getenv(key string) (value string, found bool) { return syscall.Getenv(key) } func Setenv(key, value string) error { return syscall.Setenv(key, value) } func Clearenv() { syscall.Clearenv() } func Environ() []string { return syscall.Environ() } func Unsetenv(key string) error { return syscall.Unsetenv(key) } ================================================ FILE: vendor/golang.org/x/sys/plan9/errors_plan9.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package plan9 import "syscall" // Constants const ( // Invented values to support what package os expects. O_CREAT = 0x02000 O_APPEND = 0x00400 O_NOCTTY = 0x00000 O_NONBLOCK = 0x00000 O_SYNC = 0x00000 O_ASYNC = 0x00000 S_IFMT = 0x1f000 S_IFIFO = 0x1000 S_IFCHR = 0x2000 S_IFDIR = 0x4000 S_IFBLK = 0x6000 S_IFREG = 0x8000 S_IFLNK = 0xa000 S_IFSOCK = 0xc000 ) // Errors var ( EINVAL = syscall.NewError("bad arg in system call") ENOTDIR = syscall.NewError("not a directory") EISDIR = syscall.NewError("file is a directory") ENOENT = syscall.NewError("file does not exist") EEXIST = syscall.NewError("file already exists") EMFILE = syscall.NewError("no free file descriptors") EIO = syscall.NewError("i/o error") ENAMETOOLONG = syscall.NewError("file name too long") EINTR = syscall.NewError("interrupted") EPERM = syscall.NewError("permission denied") EBUSY = syscall.NewError("no free devices") ETIMEDOUT = syscall.NewError("connection timed out") EPLAN9 = syscall.NewError("not supported by plan 9") // The following errors do not correspond to any // Plan 9 system messages. Invented to support // what package os and others expect. EACCES = syscall.NewError("access permission denied") EAFNOSUPPORT = syscall.NewError("address family not supported by protocol") ) ================================================ FILE: vendor/golang.org/x/sys/plan9/mkall.sh ================================================ #!/usr/bin/env bash # Copyright 2009 The Go Authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. # The plan9 package provides access to the raw system call # interface of the underlying operating system. Porting Go to # a new architecture/operating system combination requires # some manual effort, though there are tools that automate # much of the process. The auto-generated files have names # beginning with z. # # This script runs or (given -n) prints suggested commands to generate z files # for the current system. Running those commands is not automatic. # This script is documentation more than anything else. # # * asm_${GOOS}_${GOARCH}.s # # This hand-written assembly file implements system call dispatch. # There are three entry points: # # func Syscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr); # func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr); # func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr); # # The first and second are the standard ones; they differ only in # how many arguments can be passed to the kernel. # The third is for low-level use by the ForkExec wrapper; # unlike the first two, it does not call into the scheduler to # let it know that a system call is running. # # * syscall_${GOOS}.go # # This hand-written Go file implements system calls that need # special handling and lists "//sys" comments giving prototypes # for ones that can be auto-generated. Mksyscall reads those # comments to generate the stubs. # # * syscall_${GOOS}_${GOARCH}.go # # Same as syscall_${GOOS}.go except that it contains code specific # to ${GOOS} on one particular architecture. # # * types_${GOOS}.c # # This hand-written C file includes standard C headers and then # creates typedef or enum names beginning with a dollar sign # (use of $ in variable names is a gcc extension). The hardest # part about preparing this file is figuring out which headers to # include and which symbols need to be #defined to get the # actual data structures that pass through to the kernel system calls. # Some C libraries present alternate versions for binary compatibility # and translate them on the way in and out of system calls, but # there is almost always a #define that can get the real ones. # See types_darwin.c and types_linux.c for examples. # # * zerror_${GOOS}_${GOARCH}.go # # This machine-generated file defines the system's error numbers, # error strings, and signal numbers. The generator is "mkerrors.sh". # Usually no arguments are needed, but mkerrors.sh will pass its # arguments on to godefs. # # * zsyscall_${GOOS}_${GOARCH}.go # # Generated by mksyscall.pl; see syscall_${GOOS}.go above. # # * zsysnum_${GOOS}_${GOARCH}.go # # Generated by mksysnum_${GOOS}. # # * ztypes_${GOOS}_${GOARCH}.go # # Generated by godefs; see types_${GOOS}.c above. GOOSARCH="${GOOS}_${GOARCH}" # defaults mksyscall="go run mksyscall.go" mkerrors="./mkerrors.sh" zerrors="zerrors_$GOOSARCH.go" mksysctl="" zsysctl="zsysctl_$GOOSARCH.go" mksysnum= mktypes= run="sh" case "$1" in -syscalls) for i in zsyscall*go do sed 1q $i | sed 's;^// ;;' | sh > _$i && gofmt < _$i > $i rm _$i done exit 0 ;; -n) run="cat" shift esac case "$#" in 0) ;; *) echo 'usage: mkall.sh [-n]' 1>&2 exit 2 esac case "$GOOSARCH" in _* | *_ | _) echo 'undefined $GOOS_$GOARCH:' "$GOOSARCH" 1>&2 exit 1 ;; plan9_386) mkerrors= mksyscall="go run mksyscall.go -l32 -plan9 -tags plan9,386" mksysnum="./mksysnum_plan9.sh /n/sources/plan9/sys/src/libc/9syscall/sys.h" mktypes="XXX" ;; plan9_amd64) mkerrors= mksyscall="go run mksyscall.go -l32 -plan9 -tags plan9,amd64" mksysnum="./mksysnum_plan9.sh /n/sources/plan9/sys/src/libc/9syscall/sys.h" mktypes="XXX" ;; plan9_arm) mkerrors= mksyscall="go run mksyscall.go -l32 -plan9 -tags plan9,arm" mksysnum="./mksysnum_plan9.sh /n/sources/plan9/sys/src/libc/9syscall/sys.h" mktypes="XXX" ;; *) echo 'unrecognized $GOOS_$GOARCH: ' "$GOOSARCH" 1>&2 exit 1 ;; esac ( if [ -n "$mkerrors" ]; then echo "$mkerrors |gofmt >$zerrors"; fi case "$GOOS" in plan9) syscall_goos="syscall_$GOOS.go" if [ -n "$mksyscall" ]; then echo "$mksyscall $syscall_goos |gofmt >zsyscall_$GOOSARCH.go"; fi ;; esac if [ -n "$mksysctl" ]; then echo "$mksysctl |gofmt >$zsysctl"; fi if [ -n "$mksysnum" ]; then echo "$mksysnum |gofmt >zsysnum_$GOOSARCH.go"; fi if [ -n "$mktypes" ]; then echo "$mktypes types_$GOOS.go |gofmt >ztypes_$GOOSARCH.go"; fi ) | $run ================================================ FILE: vendor/golang.org/x/sys/plan9/mkerrors.sh ================================================ #!/usr/bin/env bash # Copyright 2009 The Go Authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. # Generate Go code listing errors and other #defined constant # values (ENAMETOOLONG etc.), by asking the preprocessor # about the definitions. unset LANG export LC_ALL=C export LC_CTYPE=C CC=${CC:-gcc} uname=$(uname) includes=' #include #include #include #include #include #include #include #include #include #include #include #include #include ' ccflags="$@" # Write go tool cgo -godefs input. ( echo package plan9 echo echo '/*' indirect="includes_$(uname)" echo "${!indirect} $includes" echo '*/' echo 'import "C"' echo echo 'const (' # The gcc command line prints all the #defines # it encounters while processing the input echo "${!indirect} $includes" | $CC -x c - -E -dM $ccflags | awk ' $1 != "#define" || $2 ~ /\(/ || $3 == "" {next} $2 ~ /^E([ABCD]X|[BIS]P|[SD]I|S|FL)$/ {next} # 386 registers $2 ~ /^(SIGEV_|SIGSTKSZ|SIGRT(MIN|MAX))/ {next} $2 ~ /^(SCM_SRCRT)$/ {next} $2 ~ /^(MAP_FAILED)$/ {next} $2 !~ /^ETH_/ && $2 !~ /^EPROC_/ && $2 !~ /^EQUIV_/ && $2 !~ /^EXPR_/ && $2 ~ /^E[A-Z0-9_]+$/ || $2 ~ /^B[0-9_]+$/ || $2 ~ /^V[A-Z0-9]+$/ || $2 ~ /^CS[A-Z0-9]/ || $2 ~ /^I(SIG|CANON|CRNL|EXTEN|MAXBEL|STRIP|UTF8)$/ || $2 ~ /^IGN/ || $2 ~ /^IX(ON|ANY|OFF)$/ || $2 ~ /^IN(LCR|PCK)$/ || $2 ~ /(^FLU?SH)|(FLU?SH$)/ || $2 ~ /^C(LOCAL|READ)$/ || $2 == "BRKINT" || $2 == "HUPCL" || $2 == "PENDIN" || $2 == "TOSTOP" || $2 ~ /^PAR/ || $2 ~ /^SIG[^_]/ || $2 ~ /^O[CNPFP][A-Z]+[^_][A-Z]+$/ || $2 ~ /^IN_/ || $2 ~ /^LOCK_(SH|EX|NB|UN)$/ || $2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|ICMP6|TCP|EVFILT|NOTE|EV|SHUT|PROT|MAP|PACKET|MSG|SCM|MCL|DT|MADV|PR)_/ || $2 == "ICMPV6_FILTER" || $2 == "SOMAXCONN" || $2 == "NAME_MAX" || $2 == "IFNAMSIZ" || $2 ~ /^CTL_(MAXNAME|NET|QUERY)$/ || $2 ~ /^SYSCTL_VERS/ || $2 ~ /^(MS|MNT)_/ || $2 ~ /^TUN(SET|GET|ATTACH|DETACH)/ || $2 ~ /^(O|F|FD|NAME|S|PTRACE|PT)_/ || $2 ~ /^LINUX_REBOOT_CMD_/ || $2 ~ /^LINUX_REBOOT_MAGIC[12]$/ || $2 !~ "NLA_TYPE_MASK" && $2 ~ /^(NETLINK|NLM|NLMSG|NLA|IFA|IFAN|RT|RTCF|RTN|RTPROT|RTNH|ARPHRD|ETH_P)_/ || $2 ~ /^SIOC/ || $2 ~ /^TIOC/ || $2 !~ "RTF_BITS" && $2 ~ /^(IFF|IFT|NET_RT|RTM|RTF|RTV|RTA|RTAX)_/ || $2 ~ /^BIOC/ || $2 ~ /^RUSAGE_(SELF|CHILDREN|THREAD)/ || $2 ~ /^RLIMIT_(AS|CORE|CPU|DATA|FSIZE|NOFILE|STACK)|RLIM_INFINITY/ || $2 ~ /^PRIO_(PROCESS|PGRP|USER)/ || $2 ~ /^CLONE_[A-Z_]+/ || $2 !~ /^(BPF_TIMEVAL)$/ && $2 ~ /^(BPF|DLT)_/ || $2 !~ "WMESGLEN" && $2 ~ /^W[A-Z0-9]+$/ {printf("\t%s = C.%s\n", $2, $2)} $2 ~ /^__WCOREFLAG$/ {next} $2 ~ /^__W[A-Z0-9]+$/ {printf("\t%s = C.%s\n", substr($2,3), $2)} {next} ' | sort echo ')' ) >_const.go # Pull out the error names for later. errors=$( echo '#include ' | $CC -x c - -E -dM $ccflags | awk '$1=="#define" && $2 ~ /^E[A-Z0-9_]+$/ { print $2 }' | sort ) # Pull out the signal names for later. signals=$( echo '#include ' | $CC -x c - -E -dM $ccflags | awk '$1=="#define" && $2 ~ /^SIG[A-Z0-9]+$/ { print $2 }' | grep -v 'SIGSTKSIZE\|SIGSTKSZ\|SIGRT' | sort ) # Again, writing regexps to a file. echo '#include ' | $CC -x c - -E -dM $ccflags | awk '$1=="#define" && $2 ~ /^E[A-Z0-9_]+$/ { print "^\t" $2 "[ \t]*=" }' | sort >_error.grep echo '#include ' | $CC -x c - -E -dM $ccflags | awk '$1=="#define" && $2 ~ /^SIG[A-Z0-9]+$/ { print "^\t" $2 "[ \t]*=" }' | grep -v 'SIGSTKSIZE\|SIGSTKSZ\|SIGRT' | sort >_signal.grep echo '// mkerrors.sh' "$@" echo '// Code generated by the command above; DO NOT EDIT.' echo go tool cgo -godefs -- "$@" _const.go >_error.out cat _error.out | grep -vf _error.grep | grep -vf _signal.grep echo echo '// Errors' echo 'const (' cat _error.out | grep -f _error.grep | sed 's/=\(.*\)/= Errno(\1)/' echo ')' echo echo '// Signals' echo 'const (' cat _error.out | grep -f _signal.grep | sed 's/=\(.*\)/= Signal(\1)/' echo ')' # Run C program to print error and syscall strings. ( echo -E " #include #include #include #include #include #include #define nelem(x) (sizeof(x)/sizeof((x)[0])) enum { A = 'A', Z = 'Z', a = 'a', z = 'z' }; // avoid need for single quotes below int errors[] = { " for i in $errors do echo -E ' '$i, done echo -E " }; int signals[] = { " for i in $signals do echo -E ' '$i, done # Use -E because on some systems bash builtin interprets \n itself. echo -E ' }; static int intcmp(const void *a, const void *b) { return *(int*)a - *(int*)b; } int main(void) { int i, j, e; char buf[1024], *p; printf("\n\n// Error table\n"); printf("var errors = [...]string {\n"); qsort(errors, nelem(errors), sizeof errors[0], intcmp); for(i=0; i 0 && errors[i-1] == e) continue; strcpy(buf, strerror(e)); // lowercase first letter: Bad -> bad, but STREAM -> STREAM. if(A <= buf[0] && buf[0] <= Z && a <= buf[1] && buf[1] <= z) buf[0] += a - A; printf("\t%d: \"%s\",\n", e, buf); } printf("}\n\n"); printf("\n\n// Signal table\n"); printf("var signals = [...]string {\n"); qsort(signals, nelem(signals), sizeof signals[0], intcmp); for(i=0; i 0 && signals[i-1] == e) continue; strcpy(buf, strsignal(e)); // lowercase first letter: Bad -> bad, but STREAM -> STREAM. if(A <= buf[0] && buf[0] <= Z && a <= buf[1] && buf[1] <= z) buf[0] += a - A; // cut trailing : number. p = strrchr(buf, ":"[0]); if(p) *p = '\0'; printf("\t%d: \"%s\",\n", e, buf); } printf("}\n\n"); return 0; } ' ) >_errors.c $CC $ccflags -o _errors _errors.c && $GORUN ./_errors && rm -f _errors.c _errors _const.go _error.grep _signal.grep _error.out ================================================ FILE: vendor/golang.org/x/sys/plan9/mksysnum_plan9.sh ================================================ #!/bin/sh # Copyright 2009 The Go Authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. COMMAND="mksysnum_plan9.sh $@" cat <= 10 { buf[i] = byte(val%10 + '0') i-- val /= 10 } buf[i] = byte(val + '0') return string(buf[i:]) } ================================================ FILE: vendor/golang.org/x/sys/plan9/syscall.go ================================================ // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build plan9 // Package plan9 contains an interface to the low-level operating system // primitives. OS details vary depending on the underlying system, and // by default, godoc will display the OS-specific documentation for the current // system. If you want godoc to display documentation for another // system, set $GOOS and $GOARCH to the desired system. For example, if // you want to view documentation for freebsd/arm on linux/amd64, set $GOOS // to freebsd and $GOARCH to arm. // // The primary use of this package is inside other packages that provide a more // portable interface to the system, such as "os", "time" and "net". Use // those packages rather than this one if you can. // // For details of the functions and data types in this package consult // the manuals for the appropriate operating system. // // These calls return err == nil to indicate success; otherwise // err represents an operating system error describing the failure and // holds a value of type syscall.ErrorString. package plan9 // import "golang.org/x/sys/plan9" import ( "bytes" "strings" "unsafe" ) // ByteSliceFromString returns a NUL-terminated slice of bytes // containing the text of s. If s contains a NUL byte at any // location, it returns (nil, EINVAL). func ByteSliceFromString(s string) ([]byte, error) { if strings.IndexByte(s, 0) != -1 { return nil, EINVAL } a := make([]byte, len(s)+1) copy(a, s) return a, nil } // BytePtrFromString returns a pointer to a NUL-terminated array of // bytes containing the text of s. If s contains a NUL byte at any // location, it returns (nil, EINVAL). func BytePtrFromString(s string) (*byte, error) { a, err := ByteSliceFromString(s) if err != nil { return nil, err } return &a[0], nil } // ByteSliceToString returns a string form of the text represented by the slice s, with a terminating NUL and any // bytes after the NUL removed. func ByteSliceToString(s []byte) string { if i := bytes.IndexByte(s, 0); i != -1 { s = s[:i] } return string(s) } // BytePtrToString takes a pointer to a sequence of text and returns the corresponding string. // If the pointer is nil, it returns the empty string. It assumes that the text sequence is terminated // at a zero byte; if the zero byte is not present, the program may crash. func BytePtrToString(p *byte) string { if p == nil { return "" } if *p == 0 { return "" } // Find NUL terminator. n := 0 for ptr := unsafe.Pointer(p); *(*byte)(ptr) != 0; n++ { ptr = unsafe.Pointer(uintptr(ptr) + 1) } return string(unsafe.Slice(p, n)) } // Single-word zero for use when we need a valid pointer to 0 bytes. // See mksyscall.pl. var _zero uintptr func (ts *Timespec) Unix() (sec int64, nsec int64) { return int64(ts.Sec), int64(ts.Nsec) } func (tv *Timeval) Unix() (sec int64, nsec int64) { return int64(tv.Sec), int64(tv.Usec) * 1000 } func (ts *Timespec) Nano() int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } func (tv *Timeval) Nano() int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1000 } // use is a no-op, but the compiler cannot see that it is. // Calling use(p) ensures that p is kept live until that point. // //go:noescape func use(p unsafe.Pointer) ================================================ FILE: vendor/golang.org/x/sys/plan9/syscall_plan9.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Plan 9 system calls. // This file is compiled as ordinary Go code, // but it is also input to mksyscall, // which parses the //sys lines and generates system call stubs. // Note that sometimes we use a lowercase //sys name and // wrap it in our own nicer implementation. package plan9 import ( "bytes" "syscall" "unsafe" ) // A Note is a string describing a process note. // It implements the os.Signal interface. type Note = syscall.Note var ( Stdin = 0 Stdout = 1 Stderr = 2 ) // For testing: clients can set this flag to force // creation of IPv6 sockets to return EAFNOSUPPORT. var SocketDisableIPv6 bool func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.ErrorString) func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.ErrorString) func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr) func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr) func atoi(b []byte) (n uint) { n = 0 for i := 0; i < len(b); i++ { n = n*10 + uint(b[i]-'0') } return } func cstring(s []byte) string { i := bytes.IndexByte(s, 0) if i == -1 { i = len(s) } return string(s[:i]) } func errstr() string { var buf [ERRMAX]byte RawSyscall(SYS_ERRSTR, uintptr(unsafe.Pointer(&buf[0])), uintptr(len(buf)), 0) buf[len(buf)-1] = 0 return cstring(buf[:]) } // Implemented in assembly to import from runtime. func exit(code int) func Exit(code int) { exit(code) } func readnum(path string) (uint, error) { var b [12]byte fd, e := Open(path, O_RDONLY) if e != nil { return 0, e } defer Close(fd) n, e := Pread(fd, b[:], 0) if e != nil { return 0, e } m := 0 for ; m < n && b[m] == ' '; m++ { } return atoi(b[m : n-1]), nil } func Getpid() (pid int) { n, _ := readnum("#c/pid") return int(n) } func Getppid() (ppid int) { n, _ := readnum("#c/ppid") return int(n) } func Read(fd int, p []byte) (n int, err error) { return Pread(fd, p, -1) } func Write(fd int, p []byte) (n int, err error) { return Pwrite(fd, p, -1) } var ioSync int64 //sys fd2path(fd int, buf []byte) (err error) func Fd2path(fd int) (path string, err error) { var buf [512]byte e := fd2path(fd, buf[:]) if e != nil { return "", e } return cstring(buf[:]), nil } //sys pipe(p *[2]int32) (err error) func Pipe(p []int) (err error) { if len(p) != 2 { return syscall.ErrorString("bad arg in system call") } var pp [2]int32 err = pipe(&pp) if err == nil { p[0] = int(pp[0]) p[1] = int(pp[1]) } return } // Underlying system call writes to newoffset via pointer. // Implemented in assembly to avoid allocation. func seek(placeholder uintptr, fd int, offset int64, whence int) (newoffset int64, err string) func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { newoffset, e := seek(0, fd, offset, whence) if newoffset == -1 { err = syscall.ErrorString(e) } return } func Mkdir(path string, mode uint32) (err error) { fd, err := Create(path, O_RDONLY, DMDIR|mode) if fd != -1 { Close(fd) } return } type Waitmsg struct { Pid int Time [3]uint32 Msg string } func (w Waitmsg) Exited() bool { return true } func (w Waitmsg) Signaled() bool { return false } func (w Waitmsg) ExitStatus() int { if len(w.Msg) == 0 { // a normal exit returns no message return 0 } return 1 } //sys await(s []byte) (n int, err error) func Await(w *Waitmsg) (err error) { var buf [512]byte var f [5][]byte n, err := await(buf[:]) if err != nil || w == nil { return } nf := 0 p := 0 for i := 0; i < n && nf < len(f)-1; i++ { if buf[i] == ' ' { f[nf] = buf[p:i] p = i + 1 nf++ } } f[nf] = buf[p:] nf++ if nf != len(f) { return syscall.ErrorString("invalid wait message") } w.Pid = int(atoi(f[0])) w.Time[0] = uint32(atoi(f[1])) w.Time[1] = uint32(atoi(f[2])) w.Time[2] = uint32(atoi(f[3])) w.Msg = cstring(f[4]) if w.Msg == "''" { // await() returns '' for no error w.Msg = "" } return } func Unmount(name, old string) (err error) { fixwd() oldp, err := BytePtrFromString(old) if err != nil { return err } oldptr := uintptr(unsafe.Pointer(oldp)) var r0 uintptr var e syscall.ErrorString // bind(2) man page: If name is zero, everything bound or mounted upon old is unbound or unmounted. if name == "" { r0, _, e = Syscall(SYS_UNMOUNT, _zero, oldptr, 0) } else { namep, err := BytePtrFromString(name) if err != nil { return err } r0, _, e = Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(namep)), oldptr, 0) } if int32(r0) == -1 { err = e } return } func Fchdir(fd int) (err error) { path, err := Fd2path(fd) if err != nil { return } return Chdir(path) } type Timespec struct { Sec int32 Nsec int32 } type Timeval struct { Sec int32 Usec int32 } func NsecToTimeval(nsec int64) (tv Timeval) { nsec += 999 // round up to microsecond tv.Usec = int32(nsec % 1e9 / 1e3) tv.Sec = int32(nsec / 1e9) return } func nsec() int64 { var scratch int64 r0, _, _ := Syscall(SYS_NSEC, uintptr(unsafe.Pointer(&scratch)), 0, 0) // TODO(aram): remove hack after I fix _nsec in the pc64 kernel. if r0 == 0 { return scratch } return int64(r0) } func Gettimeofday(tv *Timeval) error { nsec := nsec() *tv = NsecToTimeval(nsec) return nil } func Getpagesize() int { return 0x1000 } func Getegid() (egid int) { return -1 } func Geteuid() (euid int) { return -1 } func Getgid() (gid int) { return -1 } func Getuid() (uid int) { return -1 } func Getgroups() (gids []int, err error) { return make([]int, 0), nil } //sys open(path string, mode int) (fd int, err error) func Open(path string, mode int) (fd int, err error) { fixwd() return open(path, mode) } //sys create(path string, mode int, perm uint32) (fd int, err error) func Create(path string, mode int, perm uint32) (fd int, err error) { fixwd() return create(path, mode, perm) } //sys remove(path string) (err error) func Remove(path string) error { fixwd() return remove(path) } //sys stat(path string, edir []byte) (n int, err error) func Stat(path string, edir []byte) (n int, err error) { fixwd() return stat(path, edir) } //sys bind(name string, old string, flag int) (err error) func Bind(name string, old string, flag int) (err error) { fixwd() return bind(name, old, flag) } //sys mount(fd int, afd int, old string, flag int, aname string) (err error) func Mount(fd int, afd int, old string, flag int, aname string) (err error) { fixwd() return mount(fd, afd, old, flag, aname) } //sys wstat(path string, edir []byte) (err error) func Wstat(path string, edir []byte) (err error) { fixwd() return wstat(path, edir) } //sys chdir(path string) (err error) //sys Dup(oldfd int, newfd int) (fd int, err error) //sys Pread(fd int, p []byte, offset int64) (n int, err error) //sys Pwrite(fd int, p []byte, offset int64) (n int, err error) //sys Close(fd int) (err error) //sys Fstat(fd int, edir []byte) (n int, err error) //sys Fwstat(fd int, edir []byte) (err error) ================================================ FILE: vendor/golang.org/x/sys/plan9/zsyscall_plan9_386.go ================================================ // go run mksyscall.go -l32 -plan9 -tags plan9,386 syscall_plan9.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build plan9 && 386 package plan9 import "unsafe" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fd2path(fd int, buf []byte) (err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_FD2PATH, uintptr(fd), uintptr(_p0), uintptr(len(buf))) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe(p *[2]int32) (err error) { r0, _, e1 := Syscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func await(s []byte) (n int, err error) { var _p0 unsafe.Pointer if len(s) > 0 { _p0 = unsafe.Pointer(&s[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_AWAIT, uintptr(_p0), uintptr(len(s)), 0) n = int(r0) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func open(path string, mode int) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) fd = int(r0) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func create(path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall(SYS_CREATE, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) fd = int(r0) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func remove(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall(SYS_REMOVE, uintptr(unsafe.Pointer(_p0)), 0, 0) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func stat(path string, edir []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(edir) > 0 { _p1 = unsafe.Pointer(&edir[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(edir))) n = int(r0) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(name string, old string, flag int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(name) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(old) if err != nil { return } r0, _, e1 := Syscall(SYS_BIND, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flag)) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mount(fd int, afd int, old string, flag int, aname string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(old) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(aname) if err != nil { return } r0, _, e1 := Syscall6(SYS_MOUNT, uintptr(fd), uintptr(afd), uintptr(unsafe.Pointer(_p0)), uintptr(flag), uintptr(unsafe.Pointer(_p1)), 0) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func wstat(path string, edir []byte) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(edir) > 0 { _p1 = unsafe.Pointer(&edir[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_WSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(edir))) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(oldfd int, newfd int) (fd int, err error) { r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), uintptr(newfd), 0) fd = int(r0) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0) n = int(r0) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0) n = int(r0) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Close(fd int) (err error) { r0, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstat(fd int, edir []byte) (n int, err error) { var _p0 unsafe.Pointer if len(edir) > 0 { _p0 = unsafe.Pointer(&edir[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(_p0), uintptr(len(edir))) n = int(r0) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fwstat(fd int, edir []byte) (err error) { var _p0 unsafe.Pointer if len(edir) > 0 { _p0 = unsafe.Pointer(&edir[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_FWSTAT, uintptr(fd), uintptr(_p0), uintptr(len(edir))) if int32(r0) == -1 { err = e1 } return } ================================================ FILE: vendor/golang.org/x/sys/plan9/zsyscall_plan9_amd64.go ================================================ // go run mksyscall.go -l32 -plan9 -tags plan9,amd64 syscall_plan9.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build plan9 && amd64 package plan9 import "unsafe" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fd2path(fd int, buf []byte) (err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_FD2PATH, uintptr(fd), uintptr(_p0), uintptr(len(buf))) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe(p *[2]int32) (err error) { r0, _, e1 := Syscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func await(s []byte) (n int, err error) { var _p0 unsafe.Pointer if len(s) > 0 { _p0 = unsafe.Pointer(&s[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_AWAIT, uintptr(_p0), uintptr(len(s)), 0) n = int(r0) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func open(path string, mode int) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) fd = int(r0) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func create(path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall(SYS_CREATE, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) fd = int(r0) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func remove(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall(SYS_REMOVE, uintptr(unsafe.Pointer(_p0)), 0, 0) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func stat(path string, edir []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(edir) > 0 { _p1 = unsafe.Pointer(&edir[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(edir))) n = int(r0) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(name string, old string, flag int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(name) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(old) if err != nil { return } r0, _, e1 := Syscall(SYS_BIND, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flag)) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mount(fd int, afd int, old string, flag int, aname string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(old) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(aname) if err != nil { return } r0, _, e1 := Syscall6(SYS_MOUNT, uintptr(fd), uintptr(afd), uintptr(unsafe.Pointer(_p0)), uintptr(flag), uintptr(unsafe.Pointer(_p1)), 0) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func wstat(path string, edir []byte) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(edir) > 0 { _p1 = unsafe.Pointer(&edir[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_WSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(edir))) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(oldfd int, newfd int) (fd int, err error) { r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), uintptr(newfd), 0) fd = int(r0) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0) n = int(r0) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0) n = int(r0) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Close(fd int) (err error) { r0, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstat(fd int, edir []byte) (n int, err error) { var _p0 unsafe.Pointer if len(edir) > 0 { _p0 = unsafe.Pointer(&edir[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(_p0), uintptr(len(edir))) n = int(r0) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fwstat(fd int, edir []byte) (err error) { var _p0 unsafe.Pointer if len(edir) > 0 { _p0 = unsafe.Pointer(&edir[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_FWSTAT, uintptr(fd), uintptr(_p0), uintptr(len(edir))) if int32(r0) == -1 { err = e1 } return } ================================================ FILE: vendor/golang.org/x/sys/plan9/zsyscall_plan9_arm.go ================================================ // go run mksyscall.go -l32 -plan9 -tags plan9,arm syscall_plan9.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build plan9 && arm package plan9 import "unsafe" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fd2path(fd int, buf []byte) (err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_FD2PATH, uintptr(fd), uintptr(_p0), uintptr(len(buf))) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe(p *[2]int32) (err error) { r0, _, e1 := Syscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func await(s []byte) (n int, err error) { var _p0 unsafe.Pointer if len(s) > 0 { _p0 = unsafe.Pointer(&s[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_AWAIT, uintptr(_p0), uintptr(len(s)), 0) n = int(r0) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func open(path string, mode int) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) fd = int(r0) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func create(path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall(SYS_CREATE, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) fd = int(r0) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func remove(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall(SYS_REMOVE, uintptr(unsafe.Pointer(_p0)), 0, 0) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func stat(path string, edir []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(edir) > 0 { _p1 = unsafe.Pointer(&edir[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(edir))) n = int(r0) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(name string, old string, flag int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(name) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(old) if err != nil { return } r0, _, e1 := Syscall(SYS_BIND, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flag)) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mount(fd int, afd int, old string, flag int, aname string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(old) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(aname) if err != nil { return } r0, _, e1 := Syscall6(SYS_MOUNT, uintptr(fd), uintptr(afd), uintptr(unsafe.Pointer(_p0)), uintptr(flag), uintptr(unsafe.Pointer(_p1)), 0) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func wstat(path string, edir []byte) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(edir) > 0 { _p1 = unsafe.Pointer(&edir[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_WSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(edir))) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(oldfd int, newfd int) (fd int, err error) { r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), uintptr(newfd), 0) fd = int(r0) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0) n = int(r0) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0) n = int(r0) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Close(fd int) (err error) { r0, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstat(fd int, edir []byte) (n int, err error) { var _p0 unsafe.Pointer if len(edir) > 0 { _p0 = unsafe.Pointer(&edir[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(_p0), uintptr(len(edir))) n = int(r0) if int32(r0) == -1 { err = e1 } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fwstat(fd int, edir []byte) (err error) { var _p0 unsafe.Pointer if len(edir) > 0 { _p0 = unsafe.Pointer(&edir[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_FWSTAT, uintptr(fd), uintptr(_p0), uintptr(len(edir))) if int32(r0) == -1 { err = e1 } return } ================================================ FILE: vendor/golang.org/x/sys/plan9/zsysnum_plan9.go ================================================ // mksysnum_plan9.sh /opt/plan9/sys/src/libc/9syscall/sys.h // MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT package plan9 const ( SYS_SYSR1 = 0 SYS_BIND = 2 SYS_CHDIR = 3 SYS_CLOSE = 4 SYS_DUP = 5 SYS_ALARM = 6 SYS_EXEC = 7 SYS_EXITS = 8 SYS_FAUTH = 10 SYS_SEGBRK = 12 SYS_OPEN = 14 SYS_OSEEK = 16 SYS_SLEEP = 17 SYS_RFORK = 19 SYS_PIPE = 21 SYS_CREATE = 22 SYS_FD2PATH = 23 SYS_BRK_ = 24 SYS_REMOVE = 25 SYS_NOTIFY = 28 SYS_NOTED = 29 SYS_SEGATTACH = 30 SYS_SEGDETACH = 31 SYS_SEGFREE = 32 SYS_SEGFLUSH = 33 SYS_RENDEZVOUS = 34 SYS_UNMOUNT = 35 SYS_SEMACQUIRE = 37 SYS_SEMRELEASE = 38 SYS_SEEK = 39 SYS_FVERSION = 40 SYS_ERRSTR = 41 SYS_STAT = 42 SYS_FSTAT = 43 SYS_WSTAT = 44 SYS_FWSTAT = 45 SYS_MOUNT = 46 SYS_AWAIT = 47 SYS_PREAD = 50 SYS_PWRITE = 51 SYS_TSEMACQUIRE = 52 SYS_NSEC = 53 ) ================================================ FILE: vendor/golang.org/x/sys/unix/.gitignore ================================================ _obj/ unix.test ================================================ FILE: vendor/golang.org/x/sys/unix/README.md ================================================ # Building `sys/unix` The sys/unix package provides access to the raw system call interface of the underlying operating system. See: https://godoc.org/golang.org/x/sys/unix Porting Go to a new architecture/OS combination or adding syscalls, types, or constants to an existing architecture/OS pair requires some manual effort; however, there are tools that automate much of the process. ## Build Systems There are currently two ways we generate the necessary files. We are currently migrating the build system to use containers so the builds are reproducible. This is being done on an OS-by-OS basis. Please update this documentation as components of the build system change. ### Old Build System (currently for `GOOS != "linux"`) The old build system generates the Go files based on the C header files present on your system. This means that files for a given GOOS/GOARCH pair must be generated on a system with that OS and architecture. This also means that the generated code can differ from system to system, based on differences in the header files. To avoid this, if you are using the old build system, only generate the Go files on an installation with unmodified header files. It is also important to keep track of which version of the OS the files were generated from (ex. Darwin 14 vs Darwin 15). This makes it easier to track the progress of changes and have each OS upgrade correspond to a single change. To build the files for your current OS and architecture, make sure GOOS and GOARCH are set correctly and run `mkall.sh`. This will generate the files for your specific system. Running `mkall.sh -n` shows the commands that will be run. Requirements: bash, go ### New Build System (currently for `GOOS == "linux"`) The new build system uses a Docker container to generate the go files directly from source checkouts of the kernel and various system libraries. This means that on any platform that supports Docker, all the files using the new build system can be generated at once, and generated files will not change based on what the person running the scripts has installed on their computer. The OS specific files for the new build system are located in the `${GOOS}` directory, and the build is coordinated by the `${GOOS}/mkall.go` program. When the kernel or system library updates, modify the Dockerfile at `${GOOS}/Dockerfile` to checkout the new release of the source. To build all the files under the new build system, you must be on an amd64/Linux system and have your GOOS and GOARCH set accordingly. Running `mkall.sh` will then generate all of the files for all of the GOOS/GOARCH pairs in the new build system. Running `mkall.sh -n` shows the commands that will be run. Requirements: bash, go, docker ## Component files This section describes the various files used in the code generation process. It also contains instructions on how to modify these files to add a new architecture/OS or to add additional syscalls, types, or constants. Note that if you are using the new build system, the scripts/programs cannot be called normally. They must be called from within the docker container. ### asm files The hand-written assembly file at `asm_${GOOS}_${GOARCH}.s` implements system call dispatch. There are three entry points: ``` func Syscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr) func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr) func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr) ``` The first and second are the standard ones; they differ only in how many arguments can be passed to the kernel. The third is for low-level use by the ForkExec wrapper. Unlike the first two, it does not call into the scheduler to let it know that a system call is running. When porting Go to a new architecture/OS, this file must be implemented for each GOOS/GOARCH pair. ### mksysnum Mksysnum is a Go program located at `${GOOS}/mksysnum.go` (or `mksysnum_${GOOS}.go` for the old system). This program takes in a list of header files containing the syscall number declarations and parses them to produce the corresponding list of Go numeric constants. See `zsysnum_${GOOS}_${GOARCH}.go` for the generated constants. Adding new syscall numbers is mostly done by running the build on a sufficiently new installation of the target OS (or updating the source checkouts for the new build system). However, depending on the OS, you may need to update the parsing in mksysnum. ### mksyscall.go The `syscall.go`, `syscall_${GOOS}.go`, `syscall_${GOOS}_${GOARCH}.go` are hand-written Go files which implement system calls (for unix, the specific OS, or the specific OS/Architecture pair respectively) that need special handling and list `//sys` comments giving prototypes for ones that can be generated. The mksyscall.go program takes the `//sys` and `//sysnb` comments and converts them into syscalls. This requires the name of the prototype in the comment to match a syscall number in the `zsysnum_${GOOS}_${GOARCH}.go` file. The function prototype can be exported (capitalized) or not. Adding a new syscall often just requires adding a new `//sys` function prototype with the desired arguments and a capitalized name so it is exported. However, if you want the interface to the syscall to be different, often one will make an unexported `//sys` prototype, and then write a custom wrapper in `syscall_${GOOS}.go`. ### types files For each OS, there is a hand-written Go file at `${GOOS}/types.go` (or `types_${GOOS}.go` on the old system). This file includes standard C headers and creates Go type aliases to the corresponding C types. The file is then fed through godef to get the Go compatible definitions. Finally, the generated code is fed though mkpost.go to format the code correctly and remove any hidden or private identifiers. This cleaned-up code is written to `ztypes_${GOOS}_${GOARCH}.go`. The hardest part about preparing this file is figuring out which headers to include and which symbols need to be `#define`d to get the actual data structures that pass through to the kernel system calls. Some C libraries preset alternate versions for binary compatibility and translate them on the way in and out of system calls, but there is almost always a `#define` that can get the real ones. See `types_darwin.go` and `linux/types.go` for examples. To add a new type, add in the necessary include statement at the top of the file (if it is not already there) and add in a type alias line. Note that if your type is significantly different on different architectures, you may need some `#if/#elif` macros in your include statements. ### mkerrors.sh This script is used to generate the system's various constants. This doesn't just include the error numbers and error strings, but also the signal numbers and a wide variety of miscellaneous constants. The constants come from the list of include files in the `includes_${uname}` variable. A regex then picks out the desired `#define` statements, and generates the corresponding Go constants. The error numbers and strings are generated from `#include `, and the signal numbers and strings are generated from `#include `. All of these constants are written to `zerrors_${GOOS}_${GOARCH}.go` via a C program, `_errors.c`, which prints out all the constants. To add a constant, add the header that includes it to the appropriate variable. Then, edit the regex (if necessary) to match the desired constant. Avoid making the regex too broad to avoid matching unintended constants. ### internal/mkmerge This program is used to extract duplicate const, func, and type declarations from the generated architecture-specific files listed below, and merge these into a common file for each OS. The merge is performed in the following steps: 1. Construct the set of common code that is identical in all architecture-specific files. 2. Write this common code to the merged file. 3. Remove the common code from all architecture-specific files. ## Generated files ### `zerrors_${GOOS}_${GOARCH}.go` A file containing all of the system's generated error numbers, error strings, signal numbers, and constants. Generated by `mkerrors.sh` (see above). ### `zsyscall_${GOOS}_${GOARCH}.go` A file containing all the generated syscalls for a specific GOOS and GOARCH. Generated by `mksyscall.go` (see above). ### `zsysnum_${GOOS}_${GOARCH}.go` A list of numeric constants for all the syscall number of the specific GOOS and GOARCH. Generated by mksysnum (see above). ### `ztypes_${GOOS}_${GOARCH}.go` A file containing Go types for passing into (or returning from) syscalls. Generated by godefs and the types file (see above). ================================================ FILE: vendor/golang.org/x/sys/unix/affinity_linux.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // CPU affinity functions package unix import ( "math/bits" "unsafe" ) const cpuSetSize = _CPU_SETSIZE / _NCPUBITS // CPUSet represents a CPU affinity mask. type CPUSet [cpuSetSize]cpuMask func schedAffinity(trap uintptr, pid int, set *CPUSet) error { _, _, e := RawSyscall(trap, uintptr(pid), uintptr(unsafe.Sizeof(*set)), uintptr(unsafe.Pointer(set))) if e != 0 { return errnoErr(e) } return nil } // SchedGetaffinity gets the CPU affinity mask of the thread specified by pid. // If pid is 0 the calling thread is used. func SchedGetaffinity(pid int, set *CPUSet) error { return schedAffinity(SYS_SCHED_GETAFFINITY, pid, set) } // SchedSetaffinity sets the CPU affinity mask of the thread specified by pid. // If pid is 0 the calling thread is used. func SchedSetaffinity(pid int, set *CPUSet) error { return schedAffinity(SYS_SCHED_SETAFFINITY, pid, set) } // Zero clears the set s, so that it contains no CPUs. func (s *CPUSet) Zero() { clear(s[:]) } // Fill adds all possible CPU bits to the set s. On Linux, [SchedSetaffinity] // will silently ignore any invalid CPU bits in [CPUSet] so this is an // efficient way of resetting the CPU affinity of a process. func (s *CPUSet) Fill() { for i := range s { s[i] = ^cpuMask(0) } } func cpuBitsIndex(cpu int) int { return cpu / _NCPUBITS } func cpuBitsMask(cpu int) cpuMask { return cpuMask(1 << (uint(cpu) % _NCPUBITS)) } // Set adds cpu to the set s. func (s *CPUSet) Set(cpu int) { i := cpuBitsIndex(cpu) if i < len(s) { s[i] |= cpuBitsMask(cpu) } } // Clear removes cpu from the set s. func (s *CPUSet) Clear(cpu int) { i := cpuBitsIndex(cpu) if i < len(s) { s[i] &^= cpuBitsMask(cpu) } } // IsSet reports whether cpu is in the set s. func (s *CPUSet) IsSet(cpu int) bool { i := cpuBitsIndex(cpu) if i < len(s) { return s[i]&cpuBitsMask(cpu) != 0 } return false } // Count returns the number of CPUs in the set s. func (s *CPUSet) Count() int { c := 0 for _, b := range s { c += bits.OnesCount64(uint64(b)) } return c } ================================================ FILE: vendor/golang.org/x/sys/unix/aliases.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos package unix import "syscall" type Signal = syscall.Signal type Errno = syscall.Errno type SysProcAttr = syscall.SysProcAttr ================================================ FILE: vendor/golang.org/x/sys/unix/asm_aix_ppc64.s ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build gc #include "textflag.h" // // System calls for ppc64, AIX are implemented in runtime/syscall_aix.go // TEXT ·syscall6(SB),NOSPLIT,$0-88 JMP syscall·syscall6(SB) TEXT ·rawSyscall6(SB),NOSPLIT,$0-88 JMP syscall·rawSyscall6(SB) ================================================ FILE: vendor/golang.org/x/sys/unix/asm_bsd_386.s ================================================ // Copyright 2021 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build (freebsd || netbsd || openbsd) && gc #include "textflag.h" // System call support for 386 BSD // Just jump to package syscall's implementation for all these functions. // The runtime may know about them. TEXT ·Syscall(SB),NOSPLIT,$0-28 JMP syscall·Syscall(SB) TEXT ·Syscall6(SB),NOSPLIT,$0-40 JMP syscall·Syscall6(SB) TEXT ·Syscall9(SB),NOSPLIT,$0-52 JMP syscall·Syscall9(SB) TEXT ·RawSyscall(SB),NOSPLIT,$0-28 JMP syscall·RawSyscall(SB) TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 JMP syscall·RawSyscall6(SB) ================================================ FILE: vendor/golang.org/x/sys/unix/asm_bsd_amd64.s ================================================ // Copyright 2021 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build (darwin || dragonfly || freebsd || netbsd || openbsd) && gc #include "textflag.h" // System call support for AMD64 BSD // Just jump to package syscall's implementation for all these functions. // The runtime may know about them. TEXT ·Syscall(SB),NOSPLIT,$0-56 JMP syscall·Syscall(SB) TEXT ·Syscall6(SB),NOSPLIT,$0-80 JMP syscall·Syscall6(SB) TEXT ·Syscall9(SB),NOSPLIT,$0-104 JMP syscall·Syscall9(SB) TEXT ·RawSyscall(SB),NOSPLIT,$0-56 JMP syscall·RawSyscall(SB) TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 JMP syscall·RawSyscall6(SB) ================================================ FILE: vendor/golang.org/x/sys/unix/asm_bsd_arm.s ================================================ // Copyright 2021 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build (freebsd || netbsd || openbsd) && gc #include "textflag.h" // System call support for ARM BSD // Just jump to package syscall's implementation for all these functions. // The runtime may know about them. TEXT ·Syscall(SB),NOSPLIT,$0-28 B syscall·Syscall(SB) TEXT ·Syscall6(SB),NOSPLIT,$0-40 B syscall·Syscall6(SB) TEXT ·Syscall9(SB),NOSPLIT,$0-52 B syscall·Syscall9(SB) TEXT ·RawSyscall(SB),NOSPLIT,$0-28 B syscall·RawSyscall(SB) TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 B syscall·RawSyscall6(SB) ================================================ FILE: vendor/golang.org/x/sys/unix/asm_bsd_arm64.s ================================================ // Copyright 2021 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build (darwin || freebsd || netbsd || openbsd) && gc #include "textflag.h" // System call support for ARM64 BSD // Just jump to package syscall's implementation for all these functions. // The runtime may know about them. TEXT ·Syscall(SB),NOSPLIT,$0-56 JMP syscall·Syscall(SB) TEXT ·Syscall6(SB),NOSPLIT,$0-80 JMP syscall·Syscall6(SB) TEXT ·Syscall9(SB),NOSPLIT,$0-104 JMP syscall·Syscall9(SB) TEXT ·RawSyscall(SB),NOSPLIT,$0-56 JMP syscall·RawSyscall(SB) TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 JMP syscall·RawSyscall6(SB) ================================================ FILE: vendor/golang.org/x/sys/unix/asm_bsd_ppc64.s ================================================ // Copyright 2022 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build (darwin || freebsd || netbsd || openbsd) && gc #include "textflag.h" // // System call support for ppc64, BSD // // Just jump to package syscall's implementation for all these functions. // The runtime may know about them. TEXT ·Syscall(SB),NOSPLIT,$0-56 JMP syscall·Syscall(SB) TEXT ·Syscall6(SB),NOSPLIT,$0-80 JMP syscall·Syscall6(SB) TEXT ·Syscall9(SB),NOSPLIT,$0-104 JMP syscall·Syscall9(SB) TEXT ·RawSyscall(SB),NOSPLIT,$0-56 JMP syscall·RawSyscall(SB) TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 JMP syscall·RawSyscall6(SB) ================================================ FILE: vendor/golang.org/x/sys/unix/asm_bsd_riscv64.s ================================================ // Copyright 2021 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build (darwin || freebsd || netbsd || openbsd) && gc #include "textflag.h" // System call support for RISCV64 BSD // Just jump to package syscall's implementation for all these functions. // The runtime may know about them. TEXT ·Syscall(SB),NOSPLIT,$0-56 JMP syscall·Syscall(SB) TEXT ·Syscall6(SB),NOSPLIT,$0-80 JMP syscall·Syscall6(SB) TEXT ·Syscall9(SB),NOSPLIT,$0-104 JMP syscall·Syscall9(SB) TEXT ·RawSyscall(SB),NOSPLIT,$0-56 JMP syscall·RawSyscall(SB) TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 JMP syscall·RawSyscall6(SB) ================================================ FILE: vendor/golang.org/x/sys/unix/asm_linux_386.s ================================================ // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build gc #include "textflag.h" // // System calls for 386, Linux // // See ../runtime/sys_linux_386.s for the reason why we always use int 0x80 // instead of the glibc-specific "CALL 0x10(GS)". #define INVOKE_SYSCALL INT $0x80 // Just jump to package syscall's implementation for all these functions. // The runtime may know about them. TEXT ·Syscall(SB),NOSPLIT,$0-28 JMP syscall·Syscall(SB) TEXT ·Syscall6(SB),NOSPLIT,$0-40 JMP syscall·Syscall6(SB) TEXT ·SyscallNoError(SB),NOSPLIT,$0-24 CALL runtime·entersyscall(SB) MOVL trap+0(FP), AX // syscall entry MOVL a1+4(FP), BX MOVL a2+8(FP), CX MOVL a3+12(FP), DX MOVL $0, SI MOVL $0, DI INVOKE_SYSCALL MOVL AX, r1+16(FP) MOVL DX, r2+20(FP) CALL runtime·exitsyscall(SB) RET TEXT ·RawSyscall(SB),NOSPLIT,$0-28 JMP syscall·RawSyscall(SB) TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 JMP syscall·RawSyscall6(SB) TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24 MOVL trap+0(FP), AX // syscall entry MOVL a1+4(FP), BX MOVL a2+8(FP), CX MOVL a3+12(FP), DX MOVL $0, SI MOVL $0, DI INVOKE_SYSCALL MOVL AX, r1+16(FP) MOVL DX, r2+20(FP) RET TEXT ·socketcall(SB),NOSPLIT,$0-36 JMP syscall·socketcall(SB) TEXT ·rawsocketcall(SB),NOSPLIT,$0-36 JMP syscall·rawsocketcall(SB) TEXT ·seek(SB),NOSPLIT,$0-28 JMP syscall·seek(SB) ================================================ FILE: vendor/golang.org/x/sys/unix/asm_linux_amd64.s ================================================ // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build gc #include "textflag.h" // // System calls for AMD64, Linux // // Just jump to package syscall's implementation for all these functions. // The runtime may know about them. TEXT ·Syscall(SB),NOSPLIT,$0-56 JMP syscall·Syscall(SB) TEXT ·Syscall6(SB),NOSPLIT,$0-80 JMP syscall·Syscall6(SB) TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 CALL runtime·entersyscall(SB) MOVQ a1+8(FP), DI MOVQ a2+16(FP), SI MOVQ a3+24(FP), DX MOVQ $0, R10 MOVQ $0, R8 MOVQ $0, R9 MOVQ trap+0(FP), AX // syscall entry SYSCALL MOVQ AX, r1+32(FP) MOVQ DX, r2+40(FP) CALL runtime·exitsyscall(SB) RET TEXT ·RawSyscall(SB),NOSPLIT,$0-56 JMP syscall·RawSyscall(SB) TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 JMP syscall·RawSyscall6(SB) TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 MOVQ a1+8(FP), DI MOVQ a2+16(FP), SI MOVQ a3+24(FP), DX MOVQ $0, R10 MOVQ $0, R8 MOVQ $0, R9 MOVQ trap+0(FP), AX // syscall entry SYSCALL MOVQ AX, r1+32(FP) MOVQ DX, r2+40(FP) RET TEXT ·gettimeofday(SB),NOSPLIT,$0-16 JMP syscall·gettimeofday(SB) ================================================ FILE: vendor/golang.org/x/sys/unix/asm_linux_arm.s ================================================ // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build gc #include "textflag.h" // // System calls for arm, Linux // // Just jump to package syscall's implementation for all these functions. // The runtime may know about them. TEXT ·Syscall(SB),NOSPLIT,$0-28 B syscall·Syscall(SB) TEXT ·Syscall6(SB),NOSPLIT,$0-40 B syscall·Syscall6(SB) TEXT ·SyscallNoError(SB),NOSPLIT,$0-24 BL runtime·entersyscall(SB) MOVW trap+0(FP), R7 MOVW a1+4(FP), R0 MOVW a2+8(FP), R1 MOVW a3+12(FP), R2 MOVW $0, R3 MOVW $0, R4 MOVW $0, R5 SWI $0 MOVW R0, r1+16(FP) MOVW $0, R0 MOVW R0, r2+20(FP) BL runtime·exitsyscall(SB) RET TEXT ·RawSyscall(SB),NOSPLIT,$0-28 B syscall·RawSyscall(SB) TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 B syscall·RawSyscall6(SB) TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24 MOVW trap+0(FP), R7 // syscall entry MOVW a1+4(FP), R0 MOVW a2+8(FP), R1 MOVW a3+12(FP), R2 SWI $0 MOVW R0, r1+16(FP) MOVW $0, R0 MOVW R0, r2+20(FP) RET TEXT ·seek(SB),NOSPLIT,$0-28 B syscall·seek(SB) ================================================ FILE: vendor/golang.org/x/sys/unix/asm_linux_arm64.s ================================================ // Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build linux && arm64 && gc #include "textflag.h" // Just jump to package syscall's implementation for all these functions. // The runtime may know about them. TEXT ·Syscall(SB),NOSPLIT,$0-56 B syscall·Syscall(SB) TEXT ·Syscall6(SB),NOSPLIT,$0-80 B syscall·Syscall6(SB) TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 BL runtime·entersyscall(SB) MOVD a1+8(FP), R0 MOVD a2+16(FP), R1 MOVD a3+24(FP), R2 MOVD $0, R3 MOVD $0, R4 MOVD $0, R5 MOVD trap+0(FP), R8 // syscall entry SVC MOVD R0, r1+32(FP) // r1 MOVD R1, r2+40(FP) // r2 BL runtime·exitsyscall(SB) RET TEXT ·RawSyscall(SB),NOSPLIT,$0-56 B syscall·RawSyscall(SB) TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 B syscall·RawSyscall6(SB) TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 MOVD a1+8(FP), R0 MOVD a2+16(FP), R1 MOVD a3+24(FP), R2 MOVD $0, R3 MOVD $0, R4 MOVD $0, R5 MOVD trap+0(FP), R8 // syscall entry SVC MOVD R0, r1+32(FP) MOVD R1, r2+40(FP) RET ================================================ FILE: vendor/golang.org/x/sys/unix/asm_linux_loong64.s ================================================ // Copyright 2022 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build linux && loong64 && gc #include "textflag.h" // Just jump to package syscall's implementation for all these functions. // The runtime may know about them. TEXT ·Syscall(SB),NOSPLIT,$0-56 JMP syscall·Syscall(SB) TEXT ·Syscall6(SB),NOSPLIT,$0-80 JMP syscall·Syscall6(SB) TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 JAL runtime·entersyscall(SB) MOVV a1+8(FP), R4 MOVV a2+16(FP), R5 MOVV a3+24(FP), R6 MOVV R0, R7 MOVV R0, R8 MOVV R0, R9 MOVV trap+0(FP), R11 // syscall entry SYSCALL MOVV R4, r1+32(FP) MOVV R0, r2+40(FP) // r2 is not used. Always set to 0 JAL runtime·exitsyscall(SB) RET TEXT ·RawSyscall(SB),NOSPLIT,$0-56 JMP syscall·RawSyscall(SB) TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 JMP syscall·RawSyscall6(SB) TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 MOVV a1+8(FP), R4 MOVV a2+16(FP), R5 MOVV a3+24(FP), R6 MOVV R0, R7 MOVV R0, R8 MOVV R0, R9 MOVV trap+0(FP), R11 // syscall entry SYSCALL MOVV R4, r1+32(FP) MOVV R0, r2+40(FP) // r2 is not used. Always set to 0 RET ================================================ FILE: vendor/golang.org/x/sys/unix/asm_linux_mips64x.s ================================================ // Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build linux && (mips64 || mips64le) && gc #include "textflag.h" // // System calls for mips64, Linux // // Just jump to package syscall's implementation for all these functions. // The runtime may know about them. TEXT ·Syscall(SB),NOSPLIT,$0-56 JMP syscall·Syscall(SB) TEXT ·Syscall6(SB),NOSPLIT,$0-80 JMP syscall·Syscall6(SB) TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 JAL runtime·entersyscall(SB) MOVV a1+8(FP), R4 MOVV a2+16(FP), R5 MOVV a3+24(FP), R6 MOVV R0, R7 MOVV R0, R8 MOVV R0, R9 MOVV trap+0(FP), R2 // syscall entry SYSCALL MOVV R2, r1+32(FP) MOVV R3, r2+40(FP) JAL runtime·exitsyscall(SB) RET TEXT ·RawSyscall(SB),NOSPLIT,$0-56 JMP syscall·RawSyscall(SB) TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 JMP syscall·RawSyscall6(SB) TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 MOVV a1+8(FP), R4 MOVV a2+16(FP), R5 MOVV a3+24(FP), R6 MOVV R0, R7 MOVV R0, R8 MOVV R0, R9 MOVV trap+0(FP), R2 // syscall entry SYSCALL MOVV R2, r1+32(FP) MOVV R3, r2+40(FP) RET ================================================ FILE: vendor/golang.org/x/sys/unix/asm_linux_mipsx.s ================================================ // Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build linux && (mips || mipsle) && gc #include "textflag.h" // // System calls for mips, Linux // // Just jump to package syscall's implementation for all these functions. // The runtime may know about them. TEXT ·Syscall(SB),NOSPLIT,$0-28 JMP syscall·Syscall(SB) TEXT ·Syscall6(SB),NOSPLIT,$0-40 JMP syscall·Syscall6(SB) TEXT ·Syscall9(SB),NOSPLIT,$0-52 JMP syscall·Syscall9(SB) TEXT ·SyscallNoError(SB),NOSPLIT,$0-24 JAL runtime·entersyscall(SB) MOVW a1+4(FP), R4 MOVW a2+8(FP), R5 MOVW a3+12(FP), R6 MOVW R0, R7 MOVW trap+0(FP), R2 // syscall entry SYSCALL MOVW R2, r1+16(FP) // r1 MOVW R3, r2+20(FP) // r2 JAL runtime·exitsyscall(SB) RET TEXT ·RawSyscall(SB),NOSPLIT,$0-28 JMP syscall·RawSyscall(SB) TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 JMP syscall·RawSyscall6(SB) TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24 MOVW a1+4(FP), R4 MOVW a2+8(FP), R5 MOVW a3+12(FP), R6 MOVW trap+0(FP), R2 // syscall entry SYSCALL MOVW R2, r1+16(FP) MOVW R3, r2+20(FP) RET ================================================ FILE: vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build linux && (ppc64 || ppc64le) && gc #include "textflag.h" // // System calls for ppc64, Linux // // Just jump to package syscall's implementation for all these functions. // The runtime may know about them. TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 BL runtime·entersyscall(SB) MOVD a1+8(FP), R3 MOVD a2+16(FP), R4 MOVD a3+24(FP), R5 MOVD R0, R6 MOVD R0, R7 MOVD R0, R8 MOVD trap+0(FP), R9 // syscall entry SYSCALL R9 MOVD R3, r1+32(FP) MOVD R4, r2+40(FP) BL runtime·exitsyscall(SB) RET TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 MOVD a1+8(FP), R3 MOVD a2+16(FP), R4 MOVD a3+24(FP), R5 MOVD R0, R6 MOVD R0, R7 MOVD R0, R8 MOVD trap+0(FP), R9 // syscall entry SYSCALL R9 MOVD R3, r1+32(FP) MOVD R4, r2+40(FP) RET ================================================ FILE: vendor/golang.org/x/sys/unix/asm_linux_riscv64.s ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build riscv64 && gc #include "textflag.h" // // System calls for linux/riscv64. // // Where available, just jump to package syscall's implementation of // these functions. TEXT ·Syscall(SB),NOSPLIT,$0-56 JMP syscall·Syscall(SB) TEXT ·Syscall6(SB),NOSPLIT,$0-80 JMP syscall·Syscall6(SB) TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 CALL runtime·entersyscall(SB) MOV a1+8(FP), A0 MOV a2+16(FP), A1 MOV a3+24(FP), A2 MOV trap+0(FP), A7 // syscall entry ECALL MOV A0, r1+32(FP) // r1 MOV A1, r2+40(FP) // r2 CALL runtime·exitsyscall(SB) RET TEXT ·RawSyscall(SB),NOSPLIT,$0-56 JMP syscall·RawSyscall(SB) TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 JMP syscall·RawSyscall6(SB) TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 MOV a1+8(FP), A0 MOV a2+16(FP), A1 MOV a3+24(FP), A2 MOV trap+0(FP), A7 // syscall entry ECALL MOV A0, r1+32(FP) MOV A1, r2+40(FP) RET ================================================ FILE: vendor/golang.org/x/sys/unix/asm_linux_s390x.s ================================================ // Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build linux && s390x && gc #include "textflag.h" // // System calls for s390x, Linux // // Just jump to package syscall's implementation for all these functions. // The runtime may know about them. TEXT ·Syscall(SB),NOSPLIT,$0-56 BR syscall·Syscall(SB) TEXT ·Syscall6(SB),NOSPLIT,$0-80 BR syscall·Syscall6(SB) TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 BL runtime·entersyscall(SB) MOVD a1+8(FP), R2 MOVD a2+16(FP), R3 MOVD a3+24(FP), R4 MOVD $0, R5 MOVD $0, R6 MOVD $0, R7 MOVD trap+0(FP), R1 // syscall entry SYSCALL MOVD R2, r1+32(FP) MOVD R3, r2+40(FP) BL runtime·exitsyscall(SB) RET TEXT ·RawSyscall(SB),NOSPLIT,$0-56 BR syscall·RawSyscall(SB) TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 BR syscall·RawSyscall6(SB) TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 MOVD a1+8(FP), R2 MOVD a2+16(FP), R3 MOVD a3+24(FP), R4 MOVD $0, R5 MOVD $0, R6 MOVD $0, R7 MOVD trap+0(FP), R1 // syscall entry SYSCALL MOVD R2, r1+32(FP) MOVD R3, r2+40(FP) RET ================================================ FILE: vendor/golang.org/x/sys/unix/asm_openbsd_mips64.s ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build gc #include "textflag.h" // // System call support for mips64, OpenBSD // // Just jump to package syscall's implementation for all these functions. // The runtime may know about them. TEXT ·Syscall(SB),NOSPLIT,$0-56 JMP syscall·Syscall(SB) TEXT ·Syscall6(SB),NOSPLIT,$0-80 JMP syscall·Syscall6(SB) TEXT ·Syscall9(SB),NOSPLIT,$0-104 JMP syscall·Syscall9(SB) TEXT ·RawSyscall(SB),NOSPLIT,$0-56 JMP syscall·RawSyscall(SB) TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 JMP syscall·RawSyscall6(SB) ================================================ FILE: vendor/golang.org/x/sys/unix/asm_solaris_amd64.s ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build gc #include "textflag.h" // // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go // TEXT ·sysvicall6(SB),NOSPLIT,$0-88 JMP syscall·sysvicall6(SB) TEXT ·rawSysvicall6(SB),NOSPLIT,$0-88 JMP syscall·rawSysvicall6(SB) ================================================ FILE: vendor/golang.org/x/sys/unix/asm_zos_s390x.s ================================================ // Copyright 2020 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build zos && s390x && gc #include "textflag.h" #define PSALAA 1208(R0) #define GTAB64(x) 80(x) #define LCA64(x) 88(x) #define SAVSTACK_ASYNC(x) 336(x) // in the LCA #define CAA(x) 8(x) #define CEECAATHDID(x) 976(x) // in the CAA #define EDCHPXV(x) 1016(x) // in the CAA #define GOCB(x) 1104(x) // in the CAA // SS_*, where x=SAVSTACK_ASYNC #define SS_LE(x) 0(x) #define SS_GO(x) 8(x) #define SS_ERRNO(x) 16(x) #define SS_ERRNOJR(x) 20(x) // Function Descriptor Offsets #define __errno 0x156*16 #define __err2ad 0x16C*16 // Call Instructions #define LE_CALL BYTE $0x0D; BYTE $0x76 // BL R7, R6 #define SVC_LOAD BYTE $0x0A; BYTE $0x08 // SVC 08 LOAD #define SVC_DELETE BYTE $0x0A; BYTE $0x09 // SVC 09 DELETE DATA zosLibVec<>(SB)/8, $0 GLOBL zosLibVec<>(SB), NOPTR, $8 TEXT ·initZosLibVec(SB), NOSPLIT|NOFRAME, $0-0 MOVW PSALAA, R8 MOVD LCA64(R8), R8 MOVD CAA(R8), R8 MOVD EDCHPXV(R8), R8 MOVD R8, zosLibVec<>(SB) RET TEXT ·GetZosLibVec(SB), NOSPLIT|NOFRAME, $0-0 MOVD zosLibVec<>(SB), R8 MOVD R8, ret+0(FP) RET TEXT ·clearErrno(SB), NOSPLIT, $0-0 BL addrerrno<>(SB) MOVD $0, 0(R3) RET // Returns the address of errno in R3. TEXT addrerrno<>(SB), NOSPLIT|NOFRAME, $0-0 // Get library control area (LCA). MOVW PSALAA, R8 MOVD LCA64(R8), R8 // Get __errno FuncDesc. MOVD CAA(R8), R9 MOVD EDCHPXV(R9), R9 ADD $(__errno), R9 LMG 0(R9), R5, R6 // Switch to saved LE stack. MOVD SAVSTACK_ASYNC(R8), R9 MOVD 0(R9), R4 MOVD $0, 0(R9) // Call __errno function. LE_CALL NOPH // Switch back to Go stack. XOR R0, R0 // Restore R0 to $0. MOVD R4, 0(R9) // Save stack pointer. RET // func svcCall(fnptr unsafe.Pointer, argv *unsafe.Pointer, dsa *uint64) TEXT ·svcCall(SB), NOSPLIT, $0 BL runtime·save_g(SB) // Save g and stack pointer MOVW PSALAA, R8 MOVD LCA64(R8), R8 MOVD SAVSTACK_ASYNC(R8), R9 MOVD R15, 0(R9) MOVD argv+8(FP), R1 // Move function arguments into registers MOVD dsa+16(FP), g MOVD fnptr+0(FP), R15 BYTE $0x0D // Branch to function BYTE $0xEF BL runtime·load_g(SB) // Restore g and stack pointer MOVW PSALAA, R8 MOVD LCA64(R8), R8 MOVD SAVSTACK_ASYNC(R8), R9 MOVD 0(R9), R15 RET // func svcLoad(name *byte) unsafe.Pointer TEXT ·svcLoad(SB), NOSPLIT, $0 MOVD R15, R2 // Save go stack pointer MOVD name+0(FP), R0 // Move SVC args into registers MOVD $0x80000000, R1 MOVD $0, R15 SVC_LOAD MOVW R15, R3 // Save return code from SVC MOVD R2, R15 // Restore go stack pointer CMP R3, $0 // Check SVC return code BNE error MOVD $-2, R3 // Reset last bit of entry point to zero AND R0, R3 MOVD R3, ret+8(FP) // Return entry point returned by SVC CMP R0, R3 // Check if last bit of entry point was set BNE done MOVD R15, R2 // Save go stack pointer MOVD $0, R15 // Move SVC args into registers (entry point still in r0 from SVC 08) SVC_DELETE MOVD R2, R15 // Restore go stack pointer error: MOVD $0, ret+8(FP) // Return 0 on failure done: XOR R0, R0 // Reset r0 to 0 RET // func svcUnload(name *byte, fnptr unsafe.Pointer) int64 TEXT ·svcUnload(SB), NOSPLIT, $0 MOVD R15, R2 // Save go stack pointer MOVD name+0(FP), R0 // Move SVC args into registers MOVD fnptr+8(FP), R15 SVC_DELETE XOR R0, R0 // Reset r0 to 0 MOVD R15, R1 // Save SVC return code MOVD R2, R15 // Restore go stack pointer MOVD R1, ret+16(FP) // Return SVC return code RET // func gettid() uint64 TEXT ·gettid(SB), NOSPLIT, $0 // Get library control area (LCA). MOVW PSALAA, R8 MOVD LCA64(R8), R8 // Get CEECAATHDID MOVD CAA(R8), R9 MOVD CEECAATHDID(R9), R9 MOVD R9, ret+0(FP) RET // // Call LE function, if the return is -1 // errno and errno2 is retrieved // TEXT ·CallLeFuncWithErr(SB), NOSPLIT, $0 MOVW PSALAA, R8 MOVD LCA64(R8), R8 MOVD CAA(R8), R9 MOVD g, GOCB(R9) // Restore LE stack. MOVD SAVSTACK_ASYNC(R8), R9 // R9-> LE stack frame saving address MOVD 0(R9), R4 // R4-> restore previously saved stack frame pointer MOVD parms_base+8(FP), R7 // R7 -> argument array MOVD parms_len+16(FP), R8 // R8 number of arguments // arg 1 ---> R1 CMP R8, $0 BEQ docall SUB $1, R8 MOVD 0(R7), R1 // arg 2 ---> R2 CMP R8, $0 BEQ docall SUB $1, R8 ADD $8, R7 MOVD 0(R7), R2 // arg 3 --> R3 CMP R8, $0 BEQ docall SUB $1, R8 ADD $8, R7 MOVD 0(R7), R3 CMP R8, $0 BEQ docall MOVD $2176+16, R6 // starting LE stack address-8 to store 4th argument repeat: ADD $8, R7 MOVD 0(R7), R0 // advance arg pointer by 8 byte ADD $8, R6 // advance LE argument address by 8 byte MOVD R0, (R4)(R6*1) // copy argument from go-slice to le-frame SUB $1, R8 CMP R8, $0 BNE repeat docall: MOVD funcdesc+0(FP), R8 // R8-> function descriptor LMG 0(R8), R5, R6 MOVD $0, 0(R9) // R9 address of SAVSTACK_ASYNC LE_CALL // balr R7, R6 (return #1) NOPH MOVD R3, ret+32(FP) CMP R3, $-1 // compare result to -1 BNE done // retrieve errno and errno2 MOVD zosLibVec<>(SB), R8 ADD $(__errno), R8 LMG 0(R8), R5, R6 LE_CALL // balr R7, R6 __errno (return #3) NOPH MOVWZ 0(R3), R3 MOVD R3, err+48(FP) MOVD zosLibVec<>(SB), R8 ADD $(__err2ad), R8 LMG 0(R8), R5, R6 LE_CALL // balr R7, R6 __err2ad (return #2) NOPH MOVW (R3), R2 // retrieve errno2 MOVD R2, errno2+40(FP) // store in return area done: MOVD R4, 0(R9) // Save stack pointer. RET // // Call LE function, if the return is 0 // errno and errno2 is retrieved // TEXT ·CallLeFuncWithPtrReturn(SB), NOSPLIT, $0 MOVW PSALAA, R8 MOVD LCA64(R8), R8 MOVD CAA(R8), R9 MOVD g, GOCB(R9) // Restore LE stack. MOVD SAVSTACK_ASYNC(R8), R9 // R9-> LE stack frame saving address MOVD 0(R9), R4 // R4-> restore previously saved stack frame pointer MOVD parms_base+8(FP), R7 // R7 -> argument array MOVD parms_len+16(FP), R8 // R8 number of arguments // arg 1 ---> R1 CMP R8, $0 BEQ docall SUB $1, R8 MOVD 0(R7), R1 // arg 2 ---> R2 CMP R8, $0 BEQ docall SUB $1, R8 ADD $8, R7 MOVD 0(R7), R2 // arg 3 --> R3 CMP R8, $0 BEQ docall SUB $1, R8 ADD $8, R7 MOVD 0(R7), R3 CMP R8, $0 BEQ docall MOVD $2176+16, R6 // starting LE stack address-8 to store 4th argument repeat: ADD $8, R7 MOVD 0(R7), R0 // advance arg pointer by 8 byte ADD $8, R6 // advance LE argument address by 8 byte MOVD R0, (R4)(R6*1) // copy argument from go-slice to le-frame SUB $1, R8 CMP R8, $0 BNE repeat docall: MOVD funcdesc+0(FP), R8 // R8-> function descriptor LMG 0(R8), R5, R6 MOVD $0, 0(R9) // R9 address of SAVSTACK_ASYNC LE_CALL // balr R7, R6 (return #1) NOPH MOVD R3, ret+32(FP) CMP R3, $0 // compare result to 0 BNE done // retrieve errno and errno2 MOVD zosLibVec<>(SB), R8 ADD $(__errno), R8 LMG 0(R8), R5, R6 LE_CALL // balr R7, R6 __errno (return #3) NOPH MOVWZ 0(R3), R3 MOVD R3, err+48(FP) MOVD zosLibVec<>(SB), R8 ADD $(__err2ad), R8 LMG 0(R8), R5, R6 LE_CALL // balr R7, R6 __err2ad (return #2) NOPH MOVW (R3), R2 // retrieve errno2 MOVD R2, errno2+40(FP) // store in return area XOR R2, R2 MOVWZ R2, (R3) // clear errno2 done: MOVD R4, 0(R9) // Save stack pointer. RET // // function to test if a pointer can be safely dereferenced (content read) // return 0 for succces // TEXT ·ptrtest(SB), NOSPLIT, $0-16 MOVD arg+0(FP), R10 // test pointer in R10 // set up R2 to point to CEECAADMC BYTE $0xE3; BYTE $0x20; BYTE $0x04; BYTE $0xB8; BYTE $0x00; BYTE $0x17 // llgt 2,1208 BYTE $0xB9; BYTE $0x17; BYTE $0x00; BYTE $0x22 // llgtr 2,2 BYTE $0xA5; BYTE $0x26; BYTE $0x7F; BYTE $0xFF // nilh 2,32767 BYTE $0xE3; BYTE $0x22; BYTE $0x00; BYTE $0x58; BYTE $0x00; BYTE $0x04 // lg 2,88(2) BYTE $0xE3; BYTE $0x22; BYTE $0x00; BYTE $0x08; BYTE $0x00; BYTE $0x04 // lg 2,8(2) BYTE $0x41; BYTE $0x22; BYTE $0x03; BYTE $0x68 // la 2,872(2) // set up R5 to point to the "shunt" path which set 1 to R3 (failure) BYTE $0xB9; BYTE $0x82; BYTE $0x00; BYTE $0x33 // xgr 3,3 BYTE $0xA7; BYTE $0x55; BYTE $0x00; BYTE $0x04 // bras 5,lbl1 BYTE $0xA7; BYTE $0x39; BYTE $0x00; BYTE $0x01 // lghi 3,1 // if r3 is not zero (failed) then branch to finish BYTE $0xB9; BYTE $0x02; BYTE $0x00; BYTE $0x33 // lbl1 ltgr 3,3 BYTE $0xA7; BYTE $0x74; BYTE $0x00; BYTE $0x08 // brc b'0111',lbl2 // stomic store shunt address in R5 into CEECAADMC BYTE $0xE3; BYTE $0x52; BYTE $0x00; BYTE $0x00; BYTE $0x00; BYTE $0x24 // stg 5,0(2) // now try reading from the test pointer in R10, if it fails it branches to the "lghi" instruction above BYTE $0xE3; BYTE $0x9A; BYTE $0x00; BYTE $0x00; BYTE $0x00; BYTE $0x04 // lg 9,0(10) // finish here, restore 0 into CEECAADMC BYTE $0xB9; BYTE $0x82; BYTE $0x00; BYTE $0x99 // lbl2 xgr 9,9 BYTE $0xE3; BYTE $0x92; BYTE $0x00; BYTE $0x00; BYTE $0x00; BYTE $0x24 // stg 9,0(2) MOVD R3, ret+8(FP) // result in R3 RET // // function to test if a untptr can be loaded from a pointer // return 1: the 8-byte content // 2: 0 for success, 1 for failure // // func safeload(ptr uintptr) ( value uintptr, error uintptr) TEXT ·safeload(SB), NOSPLIT, $0-24 MOVD ptr+0(FP), R10 // test pointer in R10 MOVD $0x0, R6 BYTE $0xE3; BYTE $0x20; BYTE $0x04; BYTE $0xB8; BYTE $0x00; BYTE $0x17 // llgt 2,1208 BYTE $0xB9; BYTE $0x17; BYTE $0x00; BYTE $0x22 // llgtr 2,2 BYTE $0xA5; BYTE $0x26; BYTE $0x7F; BYTE $0xFF // nilh 2,32767 BYTE $0xE3; BYTE $0x22; BYTE $0x00; BYTE $0x58; BYTE $0x00; BYTE $0x04 // lg 2,88(2) BYTE $0xE3; BYTE $0x22; BYTE $0x00; BYTE $0x08; BYTE $0x00; BYTE $0x04 // lg 2,8(2) BYTE $0x41; BYTE $0x22; BYTE $0x03; BYTE $0x68 // la 2,872(2) BYTE $0xB9; BYTE $0x82; BYTE $0x00; BYTE $0x33 // xgr 3,3 BYTE $0xA7; BYTE $0x55; BYTE $0x00; BYTE $0x04 // bras 5,lbl1 BYTE $0xA7; BYTE $0x39; BYTE $0x00; BYTE $0x01 // lghi 3,1 BYTE $0xB9; BYTE $0x02; BYTE $0x00; BYTE $0x33 // lbl1 ltgr 3,3 BYTE $0xA7; BYTE $0x74; BYTE $0x00; BYTE $0x08 // brc b'0111',lbl2 BYTE $0xE3; BYTE $0x52; BYTE $0x00; BYTE $0x00; BYTE $0x00; BYTE $0x24 // stg 5,0(2) BYTE $0xE3; BYTE $0x6A; BYTE $0x00; BYTE $0x00; BYTE $0x00; BYTE $0x04 // lg 6,0(10) BYTE $0xB9; BYTE $0x82; BYTE $0x00; BYTE $0x99 // lbl2 xgr 9,9 BYTE $0xE3; BYTE $0x92; BYTE $0x00; BYTE $0x00; BYTE $0x00; BYTE $0x24 // stg 9,0(2) MOVD R6, value+8(FP) // result in R6 MOVD R3, error+16(FP) // error in R3 RET ================================================ FILE: vendor/golang.org/x/sys/unix/auxv.go ================================================ // Copyright 2025 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build go1.21 && (aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos) package unix import ( "syscall" "unsafe" ) //go:linkname runtime_getAuxv runtime.getAuxv func runtime_getAuxv() []uintptr // Auxv returns the ELF auxiliary vector as a sequence of key/value pairs. // The returned slice is always a fresh copy, owned by the caller. // It returns an error on non-ELF platforms, or if the auxiliary vector cannot be accessed, // which happens in some locked-down environments and build modes. func Auxv() ([][2]uintptr, error) { vec := runtime_getAuxv() vecLen := len(vec) if vecLen == 0 { return nil, syscall.ENOENT } if vecLen%2 != 0 { return nil, syscall.EINVAL } result := make([]uintptr, vecLen) copy(result, vec) return unsafe.Slice((*[2]uintptr)(unsafe.Pointer(&result[0])), vecLen/2), nil } ================================================ FILE: vendor/golang.org/x/sys/unix/auxv_unsupported.go ================================================ // Copyright 2025 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build !go1.21 && (aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos) package unix import "syscall" func Auxv() ([][2]uintptr, error) { return nil, syscall.ENOTSUP } ================================================ FILE: vendor/golang.org/x/sys/unix/bluetooth_linux.go ================================================ // Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Bluetooth sockets and messages package unix // Bluetooth Protocols const ( BTPROTO_L2CAP = 0 BTPROTO_HCI = 1 BTPROTO_SCO = 2 BTPROTO_RFCOMM = 3 BTPROTO_BNEP = 4 BTPROTO_CMTP = 5 BTPROTO_HIDP = 6 BTPROTO_AVDTP = 7 ) const ( HCI_CHANNEL_RAW = 0 HCI_CHANNEL_USER = 1 HCI_CHANNEL_MONITOR = 2 HCI_CHANNEL_CONTROL = 3 HCI_CHANNEL_LOGGING = 4 ) // Socketoption Level const ( SOL_BLUETOOTH = 0x112 SOL_HCI = 0x0 SOL_L2CAP = 0x6 SOL_RFCOMM = 0x12 SOL_SCO = 0x11 ) ================================================ FILE: vendor/golang.org/x/sys/unix/bpxsvc_zos.go ================================================ // Copyright 2024 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build zos package unix import ( "bytes" "fmt" "unsafe" ) //go:noescape func bpxcall(plist []unsafe.Pointer, bpx_offset int64) //go:noescape func A2e([]byte) //go:noescape func E2a([]byte) const ( BPX4STA = 192 // stat BPX4FST = 104 // fstat BPX4LST = 132 // lstat BPX4OPN = 156 // open BPX4CLO = 72 // close BPX4CHR = 500 // chattr BPX4FCR = 504 // fchattr BPX4LCR = 1180 // lchattr BPX4CTW = 492 // cond_timed_wait BPX4GTH = 1056 // __getthent BPX4PTQ = 412 // pthread_quiesc BPX4PTR = 320 // ptrace ) const ( //options //byte1 BPX_OPNFHIGH = 0x80 //byte2 BPX_OPNFEXEC = 0x80 //byte3 BPX_O_NOLARGEFILE = 0x08 BPX_O_LARGEFILE = 0x04 BPX_O_ASYNCSIG = 0x02 BPX_O_SYNC = 0x01 //byte4 BPX_O_CREXCL = 0xc0 BPX_O_CREAT = 0x80 BPX_O_EXCL = 0x40 BPX_O_NOCTTY = 0x20 BPX_O_TRUNC = 0x10 BPX_O_APPEND = 0x08 BPX_O_NONBLOCK = 0x04 BPX_FNDELAY = 0x04 BPX_O_RDWR = 0x03 BPX_O_RDONLY = 0x02 BPX_O_WRONLY = 0x01 BPX_O_ACCMODE = 0x03 BPX_O_GETFL = 0x0f //mode // byte1 (file type) BPX_FT_DIR = 1 BPX_FT_CHARSPEC = 2 BPX_FT_REGFILE = 3 BPX_FT_FIFO = 4 BPX_FT_SYMLINK = 5 BPX_FT_SOCKET = 6 //byte3 BPX_S_ISUID = 0x08 BPX_S_ISGID = 0x04 BPX_S_ISVTX = 0x02 BPX_S_IRWXU1 = 0x01 BPX_S_IRUSR = 0x01 //byte4 BPX_S_IRWXU2 = 0xc0 BPX_S_IWUSR = 0x80 BPX_S_IXUSR = 0x40 BPX_S_IRWXG = 0x38 BPX_S_IRGRP = 0x20 BPX_S_IWGRP = 0x10 BPX_S_IXGRP = 0x08 BPX_S_IRWXOX = 0x07 BPX_S_IROTH = 0x04 BPX_S_IWOTH = 0x02 BPX_S_IXOTH = 0x01 CW_INTRPT = 1 CW_CONDVAR = 32 CW_TIMEOUT = 64 PGTHA_NEXT = 2 PGTHA_CURRENT = 1 PGTHA_FIRST = 0 PGTHA_LAST = 3 PGTHA_PROCESS = 0x80 PGTHA_CONTTY = 0x40 PGTHA_PATH = 0x20 PGTHA_COMMAND = 0x10 PGTHA_FILEDATA = 0x08 PGTHA_THREAD = 0x04 PGTHA_PTAG = 0x02 PGTHA_COMMANDLONG = 0x01 PGTHA_THREADFAST = 0x80 PGTHA_FILEPATH = 0x40 PGTHA_THDSIGMASK = 0x20 // thread quiece mode QUIESCE_TERM int32 = 1 QUIESCE_FORCE int32 = 2 QUIESCE_QUERY int32 = 3 QUIESCE_FREEZE int32 = 4 QUIESCE_UNFREEZE int32 = 5 FREEZE_THIS_THREAD int32 = 6 FREEZE_EXIT int32 = 8 QUIESCE_SRB int32 = 9 ) type Pgtha struct { Pid uint32 // 0 Tid0 uint32 // 4 Tid1 uint32 Accesspid byte // C Accesstid byte // D Accessasid uint16 // E Loginname [8]byte // 10 Flag1 byte // 18 Flag1b2 byte // 19 } type Bpxystat_t struct { // DSECT BPXYSTAT St_id [4]uint8 // 0 St_length uint16 // 0x4 St_version uint16 // 0x6 St_mode uint32 // 0x8 St_ino uint32 // 0xc St_dev uint32 // 0x10 St_nlink uint32 // 0x14 St_uid uint32 // 0x18 St_gid uint32 // 0x1c St_size uint64 // 0x20 St_atime uint32 // 0x28 St_mtime uint32 // 0x2c St_ctime uint32 // 0x30 St_rdev uint32 // 0x34 St_auditoraudit uint32 // 0x38 St_useraudit uint32 // 0x3c St_blksize uint32 // 0x40 St_createtime uint32 // 0x44 St_auditid [4]uint32 // 0x48 St_res01 uint32 // 0x58 Ft_ccsid uint16 // 0x5c Ft_flags uint16 // 0x5e St_res01a [2]uint32 // 0x60 St_res02 uint32 // 0x68 St_blocks uint32 // 0x6c St_opaque [3]uint8 // 0x70 St_visible uint8 // 0x73 St_reftime uint32 // 0x74 St_fid uint64 // 0x78 St_filefmt uint8 // 0x80 St_fspflag2 uint8 // 0x81 St_res03 [2]uint8 // 0x82 St_ctimemsec uint32 // 0x84 St_seclabel [8]uint8 // 0x88 St_res04 [4]uint8 // 0x90 // end of version 1 _ uint32 // 0x94 St_atime64 uint64 // 0x98 St_mtime64 uint64 // 0xa0 St_ctime64 uint64 // 0xa8 St_createtime64 uint64 // 0xb0 St_reftime64 uint64 // 0xb8 _ uint64 // 0xc0 St_res05 [16]uint8 // 0xc8 // end of version 2 } type BpxFilestatus struct { Oflag1 byte Oflag2 byte Oflag3 byte Oflag4 byte } type BpxMode struct { Ftype byte Mode1 byte Mode2 byte Mode3 byte } // Thr attribute structure for extended attributes type Bpxyatt_t struct { // DSECT BPXYATT Att_id [4]uint8 Att_version uint16 Att_res01 [2]uint8 Att_setflags1 uint8 Att_setflags2 uint8 Att_setflags3 uint8 Att_setflags4 uint8 Att_mode uint32 Att_uid uint32 Att_gid uint32 Att_opaquemask [3]uint8 Att_visblmaskres uint8 Att_opaque [3]uint8 Att_visibleres uint8 Att_size_h uint32 Att_size_l uint32 Att_atime uint32 Att_mtime uint32 Att_auditoraudit uint32 Att_useraudit uint32 Att_ctime uint32 Att_reftime uint32 // end of version 1 Att_filefmt uint8 Att_res02 [3]uint8 Att_filetag uint32 Att_res03 [8]uint8 // end of version 2 Att_atime64 uint64 Att_mtime64 uint64 Att_ctime64 uint64 Att_reftime64 uint64 Att_seclabel [8]uint8 Att_ver3res02 [8]uint8 // end of version 3 } func BpxOpen(name string, options *BpxFilestatus, mode *BpxMode) (rv int32, rc int32, rn int32) { if len(name) < 1024 { var namebuf [1024]byte sz := int32(copy(namebuf[:], name)) A2e(namebuf[:sz]) var parms [7]unsafe.Pointer parms[0] = unsafe.Pointer(&sz) parms[1] = unsafe.Pointer(&namebuf[0]) parms[2] = unsafe.Pointer(options) parms[3] = unsafe.Pointer(mode) parms[4] = unsafe.Pointer(&rv) parms[5] = unsafe.Pointer(&rc) parms[6] = unsafe.Pointer(&rn) bpxcall(parms[:], BPX4OPN) return rv, rc, rn } return -1, -1, -1 } func BpxClose(fd int32) (rv int32, rc int32, rn int32) { var parms [4]unsafe.Pointer parms[0] = unsafe.Pointer(&fd) parms[1] = unsafe.Pointer(&rv) parms[2] = unsafe.Pointer(&rc) parms[3] = unsafe.Pointer(&rn) bpxcall(parms[:], BPX4CLO) return rv, rc, rn } func BpxFileFStat(fd int32, st *Bpxystat_t) (rv int32, rc int32, rn int32) { st.St_id = [4]uint8{0xe2, 0xe3, 0xc1, 0xe3} st.St_version = 2 stat_sz := uint32(unsafe.Sizeof(*st)) var parms [6]unsafe.Pointer parms[0] = unsafe.Pointer(&fd) parms[1] = unsafe.Pointer(&stat_sz) parms[2] = unsafe.Pointer(st) parms[3] = unsafe.Pointer(&rv) parms[4] = unsafe.Pointer(&rc) parms[5] = unsafe.Pointer(&rn) bpxcall(parms[:], BPX4FST) return rv, rc, rn } func BpxFileStat(name string, st *Bpxystat_t) (rv int32, rc int32, rn int32) { if len(name) < 1024 { var namebuf [1024]byte sz := int32(copy(namebuf[:], name)) A2e(namebuf[:sz]) st.St_id = [4]uint8{0xe2, 0xe3, 0xc1, 0xe3} st.St_version = 2 stat_sz := uint32(unsafe.Sizeof(*st)) var parms [7]unsafe.Pointer parms[0] = unsafe.Pointer(&sz) parms[1] = unsafe.Pointer(&namebuf[0]) parms[2] = unsafe.Pointer(&stat_sz) parms[3] = unsafe.Pointer(st) parms[4] = unsafe.Pointer(&rv) parms[5] = unsafe.Pointer(&rc) parms[6] = unsafe.Pointer(&rn) bpxcall(parms[:], BPX4STA) return rv, rc, rn } return -1, -1, -1 } func BpxFileLStat(name string, st *Bpxystat_t) (rv int32, rc int32, rn int32) { if len(name) < 1024 { var namebuf [1024]byte sz := int32(copy(namebuf[:], name)) A2e(namebuf[:sz]) st.St_id = [4]uint8{0xe2, 0xe3, 0xc1, 0xe3} st.St_version = 2 stat_sz := uint32(unsafe.Sizeof(*st)) var parms [7]unsafe.Pointer parms[0] = unsafe.Pointer(&sz) parms[1] = unsafe.Pointer(&namebuf[0]) parms[2] = unsafe.Pointer(&stat_sz) parms[3] = unsafe.Pointer(st) parms[4] = unsafe.Pointer(&rv) parms[5] = unsafe.Pointer(&rc) parms[6] = unsafe.Pointer(&rn) bpxcall(parms[:], BPX4LST) return rv, rc, rn } return -1, -1, -1 } func BpxChattr(path string, attr *Bpxyatt_t) (rv int32, rc int32, rn int32) { if len(path) >= 1024 { return -1, -1, -1 } var namebuf [1024]byte sz := int32(copy(namebuf[:], path)) A2e(namebuf[:sz]) attr_sz := uint32(unsafe.Sizeof(*attr)) var parms [7]unsafe.Pointer parms[0] = unsafe.Pointer(&sz) parms[1] = unsafe.Pointer(&namebuf[0]) parms[2] = unsafe.Pointer(&attr_sz) parms[3] = unsafe.Pointer(attr) parms[4] = unsafe.Pointer(&rv) parms[5] = unsafe.Pointer(&rc) parms[6] = unsafe.Pointer(&rn) bpxcall(parms[:], BPX4CHR) return rv, rc, rn } func BpxLchattr(path string, attr *Bpxyatt_t) (rv int32, rc int32, rn int32) { if len(path) >= 1024 { return -1, -1, -1 } var namebuf [1024]byte sz := int32(copy(namebuf[:], path)) A2e(namebuf[:sz]) attr_sz := uint32(unsafe.Sizeof(*attr)) var parms [7]unsafe.Pointer parms[0] = unsafe.Pointer(&sz) parms[1] = unsafe.Pointer(&namebuf[0]) parms[2] = unsafe.Pointer(&attr_sz) parms[3] = unsafe.Pointer(attr) parms[4] = unsafe.Pointer(&rv) parms[5] = unsafe.Pointer(&rc) parms[6] = unsafe.Pointer(&rn) bpxcall(parms[:], BPX4LCR) return rv, rc, rn } func BpxFchattr(fd int32, attr *Bpxyatt_t) (rv int32, rc int32, rn int32) { attr_sz := uint32(unsafe.Sizeof(*attr)) var parms [6]unsafe.Pointer parms[0] = unsafe.Pointer(&fd) parms[1] = unsafe.Pointer(&attr_sz) parms[2] = unsafe.Pointer(attr) parms[3] = unsafe.Pointer(&rv) parms[4] = unsafe.Pointer(&rc) parms[5] = unsafe.Pointer(&rn) bpxcall(parms[:], BPX4FCR) return rv, rc, rn } func BpxCondTimedWait(sec uint32, nsec uint32, events uint32, secrem *uint32, nsecrem *uint32) (rv int32, rc int32, rn int32) { var parms [8]unsafe.Pointer parms[0] = unsafe.Pointer(&sec) parms[1] = unsafe.Pointer(&nsec) parms[2] = unsafe.Pointer(&events) parms[3] = unsafe.Pointer(secrem) parms[4] = unsafe.Pointer(nsecrem) parms[5] = unsafe.Pointer(&rv) parms[6] = unsafe.Pointer(&rc) parms[7] = unsafe.Pointer(&rn) bpxcall(parms[:], BPX4CTW) return rv, rc, rn } func BpxGetthent(in *Pgtha, outlen *uint32, out unsafe.Pointer) (rv int32, rc int32, rn int32) { var parms [7]unsafe.Pointer inlen := uint32(26) // nothing else will work. Go says Pgtha is 28-byte because of alignment, but Pgtha is "packed" and must be 26-byte parms[0] = unsafe.Pointer(&inlen) parms[1] = unsafe.Pointer(&in) parms[2] = unsafe.Pointer(outlen) parms[3] = unsafe.Pointer(&out) parms[4] = unsafe.Pointer(&rv) parms[5] = unsafe.Pointer(&rc) parms[6] = unsafe.Pointer(&rn) bpxcall(parms[:], BPX4GTH) return rv, rc, rn } func ZosJobname() (jobname string, err error) { var pgtha Pgtha pgtha.Pid = uint32(Getpid()) pgtha.Accesspid = PGTHA_CURRENT pgtha.Flag1 = PGTHA_PROCESS var out [256]byte var outlen uint32 outlen = 256 rv, rc, rn := BpxGetthent(&pgtha, &outlen, unsafe.Pointer(&out[0])) if rv == 0 { gthc := []byte{0x87, 0xa3, 0x88, 0x83} // 'gthc' in ebcdic ix := bytes.Index(out[:], gthc) if ix == -1 { err = fmt.Errorf("BPX4GTH: gthc return data not found") return } jn := out[ix+80 : ix+88] // we didn't declare Pgthc, but jobname is 8-byte at offset 80 E2a(jn) jobname = string(bytes.TrimRight(jn, " ")) } else { err = fmt.Errorf("BPX4GTH: rc=%d errno=%d reason=code=0x%x", rv, rc, rn) } return } func Bpx4ptq(code int32, data string) (rv int32, rc int32, rn int32) { var userdata [8]byte var parms [5]unsafe.Pointer copy(userdata[:], data+" ") A2e(userdata[:]) parms[0] = unsafe.Pointer(&code) parms[1] = unsafe.Pointer(&userdata[0]) parms[2] = unsafe.Pointer(&rv) parms[3] = unsafe.Pointer(&rc) parms[4] = unsafe.Pointer(&rn) bpxcall(parms[:], BPX4PTQ) return rv, rc, rn } const ( PT_TRACE_ME = 0 // Debug this process PT_READ_I = 1 // Read a full word PT_READ_D = 2 // Read a full word PT_READ_U = 3 // Read control info PT_WRITE_I = 4 //Write a full word PT_WRITE_D = 5 //Write a full word PT_CONTINUE = 7 //Continue the process PT_KILL = 8 //Terminate the process PT_READ_GPR = 11 // Read GPR, CR, PSW PT_READ_FPR = 12 // Read FPR PT_READ_VR = 13 // Read VR PT_WRITE_GPR = 14 // Write GPR, CR, PSW PT_WRITE_FPR = 15 // Write FPR PT_WRITE_VR = 16 // Write VR PT_READ_BLOCK = 17 // Read storage PT_WRITE_BLOCK = 19 // Write storage PT_READ_GPRH = 20 // Read GPRH PT_WRITE_GPRH = 21 // Write GPRH PT_REGHSET = 22 // Read all GPRHs PT_ATTACH = 30 // Attach to a process PT_DETACH = 31 // Detach from a process PT_REGSET = 32 // Read all GPRs PT_REATTACH = 33 // Reattach to a process PT_LDINFO = 34 // Read loader info PT_MULTI = 35 // Multi process mode PT_LD64INFO = 36 // RMODE64 Info Area PT_BLOCKREQ = 40 // Block request PT_THREAD_INFO = 60 // Read thread info PT_THREAD_MODIFY = 61 PT_THREAD_READ_FOCUS = 62 PT_THREAD_WRITE_FOCUS = 63 PT_THREAD_HOLD = 64 PT_THREAD_SIGNAL = 65 PT_EXPLAIN = 66 PT_EVENTS = 67 PT_THREAD_INFO_EXTENDED = 68 PT_REATTACH2 = 71 PT_CAPTURE = 72 PT_UNCAPTURE = 73 PT_GET_THREAD_TCB = 74 PT_GET_ALET = 75 PT_SWAPIN = 76 PT_EXTENDED_EVENT = 98 PT_RECOVER = 99 // Debug a program check PT_GPR0 = 0 // General purpose register 0 PT_GPR1 = 1 // General purpose register 1 PT_GPR2 = 2 // General purpose register 2 PT_GPR3 = 3 // General purpose register 3 PT_GPR4 = 4 // General purpose register 4 PT_GPR5 = 5 // General purpose register 5 PT_GPR6 = 6 // General purpose register 6 PT_GPR7 = 7 // General purpose register 7 PT_GPR8 = 8 // General purpose register 8 PT_GPR9 = 9 // General purpose register 9 PT_GPR10 = 10 // General purpose register 10 PT_GPR11 = 11 // General purpose register 11 PT_GPR12 = 12 // General purpose register 12 PT_GPR13 = 13 // General purpose register 13 PT_GPR14 = 14 // General purpose register 14 PT_GPR15 = 15 // General purpose register 15 PT_FPR0 = 16 // Floating point register 0 PT_FPR1 = 17 // Floating point register 1 PT_FPR2 = 18 // Floating point register 2 PT_FPR3 = 19 // Floating point register 3 PT_FPR4 = 20 // Floating point register 4 PT_FPR5 = 21 // Floating point register 5 PT_FPR6 = 22 // Floating point register 6 PT_FPR7 = 23 // Floating point register 7 PT_FPR8 = 24 // Floating point register 8 PT_FPR9 = 25 // Floating point register 9 PT_FPR10 = 26 // Floating point register 10 PT_FPR11 = 27 // Floating point register 11 PT_FPR12 = 28 // Floating point register 12 PT_FPR13 = 29 // Floating point register 13 PT_FPR14 = 30 // Floating point register 14 PT_FPR15 = 31 // Floating point register 15 PT_FPC = 32 // Floating point control register PT_PSW = 40 // PSW PT_PSW0 = 40 // Left half of the PSW PT_PSW1 = 41 // Right half of the PSW PT_CR0 = 42 // Control register 0 PT_CR1 = 43 // Control register 1 PT_CR2 = 44 // Control register 2 PT_CR3 = 45 // Control register 3 PT_CR4 = 46 // Control register 4 PT_CR5 = 47 // Control register 5 PT_CR6 = 48 // Control register 6 PT_CR7 = 49 // Control register 7 PT_CR8 = 50 // Control register 8 PT_CR9 = 51 // Control register 9 PT_CR10 = 52 // Control register 10 PT_CR11 = 53 // Control register 11 PT_CR12 = 54 // Control register 12 PT_CR13 = 55 // Control register 13 PT_CR14 = 56 // Control register 14 PT_CR15 = 57 // Control register 15 PT_GPRH0 = 58 // GP High register 0 PT_GPRH1 = 59 // GP High register 1 PT_GPRH2 = 60 // GP High register 2 PT_GPRH3 = 61 // GP High register 3 PT_GPRH4 = 62 // GP High register 4 PT_GPRH5 = 63 // GP High register 5 PT_GPRH6 = 64 // GP High register 6 PT_GPRH7 = 65 // GP High register 7 PT_GPRH8 = 66 // GP High register 8 PT_GPRH9 = 67 // GP High register 9 PT_GPRH10 = 68 // GP High register 10 PT_GPRH11 = 69 // GP High register 11 PT_GPRH12 = 70 // GP High register 12 PT_GPRH13 = 71 // GP High register 13 PT_GPRH14 = 72 // GP High register 14 PT_GPRH15 = 73 // GP High register 15 PT_VR0 = 74 // Vector register 0 PT_VR1 = 75 // Vector register 1 PT_VR2 = 76 // Vector register 2 PT_VR3 = 77 // Vector register 3 PT_VR4 = 78 // Vector register 4 PT_VR5 = 79 // Vector register 5 PT_VR6 = 80 // Vector register 6 PT_VR7 = 81 // Vector register 7 PT_VR8 = 82 // Vector register 8 PT_VR9 = 83 // Vector register 9 PT_VR10 = 84 // Vector register 10 PT_VR11 = 85 // Vector register 11 PT_VR12 = 86 // Vector register 12 PT_VR13 = 87 // Vector register 13 PT_VR14 = 88 // Vector register 14 PT_VR15 = 89 // Vector register 15 PT_VR16 = 90 // Vector register 16 PT_VR17 = 91 // Vector register 17 PT_VR18 = 92 // Vector register 18 PT_VR19 = 93 // Vector register 19 PT_VR20 = 94 // Vector register 20 PT_VR21 = 95 // Vector register 21 PT_VR22 = 96 // Vector register 22 PT_VR23 = 97 // Vector register 23 PT_VR24 = 98 // Vector register 24 PT_VR25 = 99 // Vector register 25 PT_VR26 = 100 // Vector register 26 PT_VR27 = 101 // Vector register 27 PT_VR28 = 102 // Vector register 28 PT_VR29 = 103 // Vector register 29 PT_VR30 = 104 // Vector register 30 PT_VR31 = 105 // Vector register 31 PT_PSWG = 106 // PSWG PT_PSWG0 = 106 // Bytes 0-3 PT_PSWG1 = 107 // Bytes 4-7 PT_PSWG2 = 108 // Bytes 8-11 (IA high word) PT_PSWG3 = 109 // Bytes 12-15 (IA low word) ) func Bpx4ptr(request int32, pid int32, addr unsafe.Pointer, data unsafe.Pointer, buffer unsafe.Pointer) (rv int32, rc int32, rn int32) { var parms [8]unsafe.Pointer parms[0] = unsafe.Pointer(&request) parms[1] = unsafe.Pointer(&pid) parms[2] = unsafe.Pointer(&addr) parms[3] = unsafe.Pointer(&data) parms[4] = unsafe.Pointer(&buffer) parms[5] = unsafe.Pointer(&rv) parms[6] = unsafe.Pointer(&rc) parms[7] = unsafe.Pointer(&rn) bpxcall(parms[:], BPX4PTR) return rv, rc, rn } func copyU8(val uint8, dest []uint8) int { if len(dest) < 1 { return 0 } dest[0] = val return 1 } func copyU8Arr(src, dest []uint8) int { if len(dest) < len(src) { return 0 } for i, v := range src { dest[i] = v } return len(src) } func copyU16(val uint16, dest []uint16) int { if len(dest) < 1 { return 0 } dest[0] = val return 1 } func copyU32(val uint32, dest []uint32) int { if len(dest) < 1 { return 0 } dest[0] = val return 1 } func copyU32Arr(src, dest []uint32) int { if len(dest) < len(src) { return 0 } for i, v := range src { dest[i] = v } return len(src) } func copyU64(val uint64, dest []uint64) int { if len(dest) < 1 { return 0 } dest[0] = val return 1 } ================================================ FILE: vendor/golang.org/x/sys/unix/bpxsvc_zos.s ================================================ // Copyright 2024 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. #include "go_asm.h" #include "textflag.h" // function to call USS assembly language services // // doc: https://www.ibm.com/support/knowledgecenter/en/SSLTBW_3.1.0/com.ibm.zos.v3r1.bpxb100/bit64env.htm // // arg1 unsafe.Pointer array that ressembles an OS PLIST // // arg2 function offset as in // doc: https://www.ibm.com/support/knowledgecenter/en/SSLTBW_3.1.0/com.ibm.zos.v3r1.bpxb100/bpx2cr_List_of_offsets.htm // // func bpxcall(plist []unsafe.Pointer, bpx_offset int64) TEXT ·bpxcall(SB), NOSPLIT|NOFRAME, $0 MOVD plist_base+0(FP), R1 // r1 points to plist MOVD bpx_offset+24(FP), R2 // r2 offset to BPX vector table MOVD R14, R7 // save r14 MOVD R15, R8 // save r15 MOVWZ 16(R0), R9 MOVWZ 544(R9), R9 MOVWZ 24(R9), R9 // call vector in r9 ADD R2, R9 // add offset to vector table MOVWZ (R9), R9 // r9 points to entry point BYTE $0x0D // BL R14,R9 --> basr r14,r9 BYTE $0xE9 // clobbers 0,1,14,15 MOVD R8, R15 // restore 15 JMP R7 // return via saved return address // func A2e(arr [] byte) // code page conversion from 819 to 1047 TEXT ·A2e(SB), NOSPLIT|NOFRAME, $0 MOVD arg_base+0(FP), R2 // pointer to arry of characters MOVD arg_len+8(FP), R3 // count XOR R0, R0 XOR R1, R1 BYTE $0xA7; BYTE $0x15; BYTE $0x00; BYTE $0x82 // BRAS 1,(2+(256/2)) // ASCII -> EBCDIC conversion table: BYTE $0x00; BYTE $0x01; BYTE $0x02; BYTE $0x03 BYTE $0x37; BYTE $0x2d; BYTE $0x2e; BYTE $0x2f BYTE $0x16; BYTE $0x05; BYTE $0x15; BYTE $0x0b BYTE $0x0c; BYTE $0x0d; BYTE $0x0e; BYTE $0x0f BYTE $0x10; BYTE $0x11; BYTE $0x12; BYTE $0x13 BYTE $0x3c; BYTE $0x3d; BYTE $0x32; BYTE $0x26 BYTE $0x18; BYTE $0x19; BYTE $0x3f; BYTE $0x27 BYTE $0x1c; BYTE $0x1d; BYTE $0x1e; BYTE $0x1f BYTE $0x40; BYTE $0x5a; BYTE $0x7f; BYTE $0x7b BYTE $0x5b; BYTE $0x6c; BYTE $0x50; BYTE $0x7d BYTE $0x4d; BYTE $0x5d; BYTE $0x5c; BYTE $0x4e BYTE $0x6b; BYTE $0x60; BYTE $0x4b; BYTE $0x61 BYTE $0xf0; BYTE $0xf1; BYTE $0xf2; BYTE $0xf3 BYTE $0xf4; BYTE $0xf5; BYTE $0xf6; BYTE $0xf7 BYTE $0xf8; BYTE $0xf9; BYTE $0x7a; BYTE $0x5e BYTE $0x4c; BYTE $0x7e; BYTE $0x6e; BYTE $0x6f BYTE $0x7c; BYTE $0xc1; BYTE $0xc2; BYTE $0xc3 BYTE $0xc4; BYTE $0xc5; BYTE $0xc6; BYTE $0xc7 BYTE $0xc8; BYTE $0xc9; BYTE $0xd1; BYTE $0xd2 BYTE $0xd3; BYTE $0xd4; BYTE $0xd5; BYTE $0xd6 BYTE $0xd7; BYTE $0xd8; BYTE $0xd9; BYTE $0xe2 BYTE $0xe3; BYTE $0xe4; BYTE $0xe5; BYTE $0xe6 BYTE $0xe7; BYTE $0xe8; BYTE $0xe9; BYTE $0xad BYTE $0xe0; BYTE $0xbd; BYTE $0x5f; BYTE $0x6d BYTE $0x79; BYTE $0x81; BYTE $0x82; BYTE $0x83 BYTE $0x84; BYTE $0x85; BYTE $0x86; BYTE $0x87 BYTE $0x88; BYTE $0x89; BYTE $0x91; BYTE $0x92 BYTE $0x93; BYTE $0x94; BYTE $0x95; BYTE $0x96 BYTE $0x97; BYTE $0x98; BYTE $0x99; BYTE $0xa2 BYTE $0xa3; BYTE $0xa4; BYTE $0xa5; BYTE $0xa6 BYTE $0xa7; BYTE $0xa8; BYTE $0xa9; BYTE $0xc0 BYTE $0x4f; BYTE $0xd0; BYTE $0xa1; BYTE $0x07 BYTE $0x20; BYTE $0x21; BYTE $0x22; BYTE $0x23 BYTE $0x24; BYTE $0x25; BYTE $0x06; BYTE $0x17 BYTE $0x28; BYTE $0x29; BYTE $0x2a; BYTE $0x2b BYTE $0x2c; BYTE $0x09; BYTE $0x0a; BYTE $0x1b BYTE $0x30; BYTE $0x31; BYTE $0x1a; BYTE $0x33 BYTE $0x34; BYTE $0x35; BYTE $0x36; BYTE $0x08 BYTE $0x38; BYTE $0x39; BYTE $0x3a; BYTE $0x3b BYTE $0x04; BYTE $0x14; BYTE $0x3e; BYTE $0xff BYTE $0x41; BYTE $0xaa; BYTE $0x4a; BYTE $0xb1 BYTE $0x9f; BYTE $0xb2; BYTE $0x6a; BYTE $0xb5 BYTE $0xbb; BYTE $0xb4; BYTE $0x9a; BYTE $0x8a BYTE $0xb0; BYTE $0xca; BYTE $0xaf; BYTE $0xbc BYTE $0x90; BYTE $0x8f; BYTE $0xea; BYTE $0xfa BYTE $0xbe; BYTE $0xa0; BYTE $0xb6; BYTE $0xb3 BYTE $0x9d; BYTE $0xda; BYTE $0x9b; BYTE $0x8b BYTE $0xb7; BYTE $0xb8; BYTE $0xb9; BYTE $0xab BYTE $0x64; BYTE $0x65; BYTE $0x62; BYTE $0x66 BYTE $0x63; BYTE $0x67; BYTE $0x9e; BYTE $0x68 BYTE $0x74; BYTE $0x71; BYTE $0x72; BYTE $0x73 BYTE $0x78; BYTE $0x75; BYTE $0x76; BYTE $0x77 BYTE $0xac; BYTE $0x69; BYTE $0xed; BYTE $0xee BYTE $0xeb; BYTE $0xef; BYTE $0xec; BYTE $0xbf BYTE $0x80; BYTE $0xfd; BYTE $0xfe; BYTE $0xfb BYTE $0xfc; BYTE $0xba; BYTE $0xae; BYTE $0x59 BYTE $0x44; BYTE $0x45; BYTE $0x42; BYTE $0x46 BYTE $0x43; BYTE $0x47; BYTE $0x9c; BYTE $0x48 BYTE $0x54; BYTE $0x51; BYTE $0x52; BYTE $0x53 BYTE $0x58; BYTE $0x55; BYTE $0x56; BYTE $0x57 BYTE $0x8c; BYTE $0x49; BYTE $0xcd; BYTE $0xce BYTE $0xcb; BYTE $0xcf; BYTE $0xcc; BYTE $0xe1 BYTE $0x70; BYTE $0xdd; BYTE $0xde; BYTE $0xdb BYTE $0xdc; BYTE $0x8d; BYTE $0x8e; BYTE $0xdf retry: WORD $0xB9931022 // TROO 2,2,b'0001' BVS retry RET // func e2a(arr [] byte) // code page conversion from 1047 to 819 TEXT ·E2a(SB), NOSPLIT|NOFRAME, $0 MOVD arg_base+0(FP), R2 // pointer to arry of characters MOVD arg_len+8(FP), R3 // count XOR R0, R0 XOR R1, R1 BYTE $0xA7; BYTE $0x15; BYTE $0x00; BYTE $0x82 // BRAS 1,(2+(256/2)) // EBCDIC -> ASCII conversion table: BYTE $0x00; BYTE $0x01; BYTE $0x02; BYTE $0x03 BYTE $0x9c; BYTE $0x09; BYTE $0x86; BYTE $0x7f BYTE $0x97; BYTE $0x8d; BYTE $0x8e; BYTE $0x0b BYTE $0x0c; BYTE $0x0d; BYTE $0x0e; BYTE $0x0f BYTE $0x10; BYTE $0x11; BYTE $0x12; BYTE $0x13 BYTE $0x9d; BYTE $0x0a; BYTE $0x08; BYTE $0x87 BYTE $0x18; BYTE $0x19; BYTE $0x92; BYTE $0x8f BYTE $0x1c; BYTE $0x1d; BYTE $0x1e; BYTE $0x1f BYTE $0x80; BYTE $0x81; BYTE $0x82; BYTE $0x83 BYTE $0x84; BYTE $0x85; BYTE $0x17; BYTE $0x1b BYTE $0x88; BYTE $0x89; BYTE $0x8a; BYTE $0x8b BYTE $0x8c; BYTE $0x05; BYTE $0x06; BYTE $0x07 BYTE $0x90; BYTE $0x91; BYTE $0x16; BYTE $0x93 BYTE $0x94; BYTE $0x95; BYTE $0x96; BYTE $0x04 BYTE $0x98; BYTE $0x99; BYTE $0x9a; BYTE $0x9b BYTE $0x14; BYTE $0x15; BYTE $0x9e; BYTE $0x1a BYTE $0x20; BYTE $0xa0; BYTE $0xe2; BYTE $0xe4 BYTE $0xe0; BYTE $0xe1; BYTE $0xe3; BYTE $0xe5 BYTE $0xe7; BYTE $0xf1; BYTE $0xa2; BYTE $0x2e BYTE $0x3c; BYTE $0x28; BYTE $0x2b; BYTE $0x7c BYTE $0x26; BYTE $0xe9; BYTE $0xea; BYTE $0xeb BYTE $0xe8; BYTE $0xed; BYTE $0xee; BYTE $0xef BYTE $0xec; BYTE $0xdf; BYTE $0x21; BYTE $0x24 BYTE $0x2a; BYTE $0x29; BYTE $0x3b; BYTE $0x5e BYTE $0x2d; BYTE $0x2f; BYTE $0xc2; BYTE $0xc4 BYTE $0xc0; BYTE $0xc1; BYTE $0xc3; BYTE $0xc5 BYTE $0xc7; BYTE $0xd1; BYTE $0xa6; BYTE $0x2c BYTE $0x25; BYTE $0x5f; BYTE $0x3e; BYTE $0x3f BYTE $0xf8; BYTE $0xc9; BYTE $0xca; BYTE $0xcb BYTE $0xc8; BYTE $0xcd; BYTE $0xce; BYTE $0xcf BYTE $0xcc; BYTE $0x60; BYTE $0x3a; BYTE $0x23 BYTE $0x40; BYTE $0x27; BYTE $0x3d; BYTE $0x22 BYTE $0xd8; BYTE $0x61; BYTE $0x62; BYTE $0x63 BYTE $0x64; BYTE $0x65; BYTE $0x66; BYTE $0x67 BYTE $0x68; BYTE $0x69; BYTE $0xab; BYTE $0xbb BYTE $0xf0; BYTE $0xfd; BYTE $0xfe; BYTE $0xb1 BYTE $0xb0; BYTE $0x6a; BYTE $0x6b; BYTE $0x6c BYTE $0x6d; BYTE $0x6e; BYTE $0x6f; BYTE $0x70 BYTE $0x71; BYTE $0x72; BYTE $0xaa; BYTE $0xba BYTE $0xe6; BYTE $0xb8; BYTE $0xc6; BYTE $0xa4 BYTE $0xb5; BYTE $0x7e; BYTE $0x73; BYTE $0x74 BYTE $0x75; BYTE $0x76; BYTE $0x77; BYTE $0x78 BYTE $0x79; BYTE $0x7a; BYTE $0xa1; BYTE $0xbf BYTE $0xd0; BYTE $0x5b; BYTE $0xde; BYTE $0xae BYTE $0xac; BYTE $0xa3; BYTE $0xa5; BYTE $0xb7 BYTE $0xa9; BYTE $0xa7; BYTE $0xb6; BYTE $0xbc BYTE $0xbd; BYTE $0xbe; BYTE $0xdd; BYTE $0xa8 BYTE $0xaf; BYTE $0x5d; BYTE $0xb4; BYTE $0xd7 BYTE $0x7b; BYTE $0x41; BYTE $0x42; BYTE $0x43 BYTE $0x44; BYTE $0x45; BYTE $0x46; BYTE $0x47 BYTE $0x48; BYTE $0x49; BYTE $0xad; BYTE $0xf4 BYTE $0xf6; BYTE $0xf2; BYTE $0xf3; BYTE $0xf5 BYTE $0x7d; BYTE $0x4a; BYTE $0x4b; BYTE $0x4c BYTE $0x4d; BYTE $0x4e; BYTE $0x4f; BYTE $0x50 BYTE $0x51; BYTE $0x52; BYTE $0xb9; BYTE $0xfb BYTE $0xfc; BYTE $0xf9; BYTE $0xfa; BYTE $0xff BYTE $0x5c; BYTE $0xf7; BYTE $0x53; BYTE $0x54 BYTE $0x55; BYTE $0x56; BYTE $0x57; BYTE $0x58 BYTE $0x59; BYTE $0x5a; BYTE $0xb2; BYTE $0xd4 BYTE $0xd6; BYTE $0xd2; BYTE $0xd3; BYTE $0xd5 BYTE $0x30; BYTE $0x31; BYTE $0x32; BYTE $0x33 BYTE $0x34; BYTE $0x35; BYTE $0x36; BYTE $0x37 BYTE $0x38; BYTE $0x39; BYTE $0xb3; BYTE $0xdb BYTE $0xdc; BYTE $0xd9; BYTE $0xda; BYTE $0x9f retry: WORD $0xB9931022 // TROO 2,2,b'0001' BVS retry RET ================================================ FILE: vendor/golang.org/x/sys/unix/cap_freebsd.go ================================================ // Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build freebsd package unix import ( "errors" "fmt" ) // Go implementation of C mostly found in /usr/src/sys/kern/subr_capability.c const ( // This is the version of CapRights this package understands. See C implementation for parallels. capRightsGoVersion = CAP_RIGHTS_VERSION_00 capArSizeMin = CAP_RIGHTS_VERSION_00 + 2 capArSizeMax = capRightsGoVersion + 2 ) var ( bit2idx = []int{ -1, 0, 1, -1, 2, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, } ) func capidxbit(right uint64) int { return int((right >> 57) & 0x1f) } func rightToIndex(right uint64) (int, error) { idx := capidxbit(right) if idx < 0 || idx >= len(bit2idx) { return -2, fmt.Errorf("index for right 0x%x out of range", right) } return bit2idx[idx], nil } func caprver(right uint64) int { return int(right >> 62) } func capver(rights *CapRights) int { return caprver(rights.Rights[0]) } func caparsize(rights *CapRights) int { return capver(rights) + 2 } // CapRightsSet sets the permissions in setrights in rights. func CapRightsSet(rights *CapRights, setrights []uint64) error { // This is essentially a copy of cap_rights_vset() if capver(rights) != CAP_RIGHTS_VERSION_00 { return fmt.Errorf("bad rights version %d", capver(rights)) } n := caparsize(rights) if n < capArSizeMin || n > capArSizeMax { return errors.New("bad rights size") } for _, right := range setrights { if caprver(right) != CAP_RIGHTS_VERSION_00 { return errors.New("bad right version") } i, err := rightToIndex(right) if err != nil { return err } if i >= n { return errors.New("index overflow") } if capidxbit(rights.Rights[i]) != capidxbit(right) { return errors.New("index mismatch") } rights.Rights[i] |= right if capidxbit(rights.Rights[i]) != capidxbit(right) { return errors.New("index mismatch (after assign)") } } return nil } // CapRightsClear clears the permissions in clearrights from rights. func CapRightsClear(rights *CapRights, clearrights []uint64) error { // This is essentially a copy of cap_rights_vclear() if capver(rights) != CAP_RIGHTS_VERSION_00 { return fmt.Errorf("bad rights version %d", capver(rights)) } n := caparsize(rights) if n < capArSizeMin || n > capArSizeMax { return errors.New("bad rights size") } for _, right := range clearrights { if caprver(right) != CAP_RIGHTS_VERSION_00 { return errors.New("bad right version") } i, err := rightToIndex(right) if err != nil { return err } if i >= n { return errors.New("index overflow") } if capidxbit(rights.Rights[i]) != capidxbit(right) { return errors.New("index mismatch") } rights.Rights[i] &= ^(right & 0x01FFFFFFFFFFFFFF) if capidxbit(rights.Rights[i]) != capidxbit(right) { return errors.New("index mismatch (after assign)") } } return nil } // CapRightsIsSet checks whether all the permissions in setrights are present in rights. func CapRightsIsSet(rights *CapRights, setrights []uint64) (bool, error) { // This is essentially a copy of cap_rights_is_vset() if capver(rights) != CAP_RIGHTS_VERSION_00 { return false, fmt.Errorf("bad rights version %d", capver(rights)) } n := caparsize(rights) if n < capArSizeMin || n > capArSizeMax { return false, errors.New("bad rights size") } for _, right := range setrights { if caprver(right) != CAP_RIGHTS_VERSION_00 { return false, errors.New("bad right version") } i, err := rightToIndex(right) if err != nil { return false, err } if i >= n { return false, errors.New("index overflow") } if capidxbit(rights.Rights[i]) != capidxbit(right) { return false, errors.New("index mismatch") } if (rights.Rights[i] & right) != right { return false, nil } } return true, nil } func capright(idx uint64, bit uint64) uint64 { return ((1 << (57 + idx)) | bit) } // CapRightsInit returns a pointer to an initialised CapRights structure filled with rights. // See man cap_rights_init(3) and rights(4). func CapRightsInit(rights []uint64) (*CapRights, error) { var r CapRights r.Rights[0] = (capRightsGoVersion << 62) | capright(0, 0) r.Rights[1] = capright(1, 0) err := CapRightsSet(&r, rights) if err != nil { return nil, err } return &r, nil } // CapRightsLimit reduces the operations permitted on fd to at most those contained in rights. // The capability rights on fd can never be increased by CapRightsLimit. // See man cap_rights_limit(2) and rights(4). func CapRightsLimit(fd uintptr, rights *CapRights) error { return capRightsLimit(int(fd), rights) } // CapRightsGet returns a CapRights structure containing the operations permitted on fd. // See man cap_rights_get(3) and rights(4). func CapRightsGet(fd uintptr) (*CapRights, error) { r, err := CapRightsInit(nil) if err != nil { return nil, err } err = capRightsGet(capRightsGoVersion, int(fd), r) if err != nil { return nil, err } return r, nil } ================================================ FILE: vendor/golang.org/x/sys/unix/constants.go ================================================ // Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos package unix const ( R_OK = 0x4 W_OK = 0x2 X_OK = 0x1 ) ================================================ FILE: vendor/golang.org/x/sys/unix/dev_aix_ppc.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build aix && ppc // Functions to access/create device major and minor numbers matching the // encoding used by AIX. package unix // Major returns the major component of a Linux device number. func Major(dev uint64) uint32 { return uint32((dev >> 16) & 0xffff) } // Minor returns the minor component of a Linux device number. func Minor(dev uint64) uint32 { return uint32(dev & 0xffff) } // Mkdev returns a Linux device number generated from the given major and minor // components. func Mkdev(major, minor uint32) uint64 { return uint64(((major) << 16) | (minor)) } ================================================ FILE: vendor/golang.org/x/sys/unix/dev_aix_ppc64.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build aix && ppc64 // Functions to access/create device major and minor numbers matching the // encoding used AIX. package unix // Major returns the major component of a Linux device number. func Major(dev uint64) uint32 { return uint32((dev & 0x3fffffff00000000) >> 32) } // Minor returns the minor component of a Linux device number. func Minor(dev uint64) uint32 { return uint32((dev & 0x00000000ffffffff) >> 0) } // Mkdev returns a Linux device number generated from the given major and minor // components. func Mkdev(major, minor uint32) uint64 { var DEVNO64 uint64 DEVNO64 = 0x8000000000000000 return ((uint64(major) << 32) | (uint64(minor) & 0x00000000FFFFFFFF) | DEVNO64) } ================================================ FILE: vendor/golang.org/x/sys/unix/dev_darwin.go ================================================ // Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Functions to access/create device major and minor numbers matching the // encoding used in Darwin's sys/types.h header. package unix // Major returns the major component of a Darwin device number. func Major(dev uint64) uint32 { return uint32((dev >> 24) & 0xff) } // Minor returns the minor component of a Darwin device number. func Minor(dev uint64) uint32 { return uint32(dev & 0xffffff) } // Mkdev returns a Darwin device number generated from the given major and minor // components. func Mkdev(major, minor uint32) uint64 { return (uint64(major) << 24) | uint64(minor) } ================================================ FILE: vendor/golang.org/x/sys/unix/dev_dragonfly.go ================================================ // Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Functions to access/create device major and minor numbers matching the // encoding used in Dragonfly's sys/types.h header. // // The information below is extracted and adapted from sys/types.h: // // Minor gives a cookie instead of an index since in order to avoid changing the // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for // devices that don't use them. package unix // Major returns the major component of a DragonFlyBSD device number. func Major(dev uint64) uint32 { return uint32((dev >> 8) & 0xff) } // Minor returns the minor component of a DragonFlyBSD device number. func Minor(dev uint64) uint32 { return uint32(dev & 0xffff00ff) } // Mkdev returns a DragonFlyBSD device number generated from the given major and // minor components. func Mkdev(major, minor uint32) uint64 { return (uint64(major) << 8) | uint64(minor) } ================================================ FILE: vendor/golang.org/x/sys/unix/dev_freebsd.go ================================================ // Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Functions to access/create device major and minor numbers matching the // encoding used in FreeBSD's sys/types.h header. // // The information below is extracted and adapted from sys/types.h: // // Minor gives a cookie instead of an index since in order to avoid changing the // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for // devices that don't use them. package unix // Major returns the major component of a FreeBSD device number. func Major(dev uint64) uint32 { return uint32((dev >> 8) & 0xff) } // Minor returns the minor component of a FreeBSD device number. func Minor(dev uint64) uint32 { return uint32(dev & 0xffff00ff) } // Mkdev returns a FreeBSD device number generated from the given major and // minor components. func Mkdev(major, minor uint32) uint64 { return (uint64(major) << 8) | uint64(minor) } ================================================ FILE: vendor/golang.org/x/sys/unix/dev_linux.go ================================================ // Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Functions to access/create device major and minor numbers matching the // encoding used by the Linux kernel and glibc. // // The information below is extracted and adapted from bits/sysmacros.h in the // glibc sources: // // dev_t in glibc is 64-bit, with 32-bit major and minor numbers. glibc's // default encoding is MMMM Mmmm mmmM MMmm, where M is a hex digit of the major // number and m is a hex digit of the minor number. This is backward compatible // with legacy systems where dev_t is 16 bits wide, encoded as MMmm. It is also // backward compatible with the Linux kernel, which for some architectures uses // 32-bit dev_t, encoded as mmmM MMmm. package unix // Major returns the major component of a Linux device number. func Major(dev uint64) uint32 { major := uint32((dev & 0x00000000000fff00) >> 8) major |= uint32((dev & 0xfffff00000000000) >> 32) return major } // Minor returns the minor component of a Linux device number. func Minor(dev uint64) uint32 { minor := uint32((dev & 0x00000000000000ff) >> 0) minor |= uint32((dev & 0x00000ffffff00000) >> 12) return minor } // Mkdev returns a Linux device number generated from the given major and minor // components. func Mkdev(major, minor uint32) uint64 { dev := (uint64(major) & 0x00000fff) << 8 dev |= (uint64(major) & 0xfffff000) << 32 dev |= (uint64(minor) & 0x000000ff) << 0 dev |= (uint64(minor) & 0xffffff00) << 12 return dev } ================================================ FILE: vendor/golang.org/x/sys/unix/dev_netbsd.go ================================================ // Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Functions to access/create device major and minor numbers matching the // encoding used in NetBSD's sys/types.h header. package unix // Major returns the major component of a NetBSD device number. func Major(dev uint64) uint32 { return uint32((dev & 0x000fff00) >> 8) } // Minor returns the minor component of a NetBSD device number. func Minor(dev uint64) uint32 { minor := uint32((dev & 0x000000ff) >> 0) minor |= uint32((dev & 0xfff00000) >> 12) return minor } // Mkdev returns a NetBSD device number generated from the given major and minor // components. func Mkdev(major, minor uint32) uint64 { dev := (uint64(major) << 8) & 0x000fff00 dev |= (uint64(minor) << 12) & 0xfff00000 dev |= (uint64(minor) << 0) & 0x000000ff return dev } ================================================ FILE: vendor/golang.org/x/sys/unix/dev_openbsd.go ================================================ // Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Functions to access/create device major and minor numbers matching the // encoding used in OpenBSD's sys/types.h header. package unix // Major returns the major component of an OpenBSD device number. func Major(dev uint64) uint32 { return uint32((dev & 0x0000ff00) >> 8) } // Minor returns the minor component of an OpenBSD device number. func Minor(dev uint64) uint32 { minor := uint32((dev & 0x000000ff) >> 0) minor |= uint32((dev & 0xffff0000) >> 8) return minor } // Mkdev returns an OpenBSD device number generated from the given major and minor // components. func Mkdev(major, minor uint32) uint64 { dev := (uint64(major) << 8) & 0x0000ff00 dev |= (uint64(minor) << 8) & 0xffff0000 dev |= (uint64(minor) << 0) & 0x000000ff return dev } ================================================ FILE: vendor/golang.org/x/sys/unix/dev_zos.go ================================================ // Copyright 2020 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build zos && s390x // Functions to access/create device major and minor numbers matching the // encoding used by z/OS. // // The information below is extracted and adapted from macros. package unix // Major returns the major component of a z/OS device number. func Major(dev uint64) uint32 { return uint32((dev >> 16) & 0x0000FFFF) } // Minor returns the minor component of a z/OS device number. func Minor(dev uint64) uint32 { return uint32(dev & 0x0000FFFF) } // Mkdev returns a z/OS device number generated from the given major and minor // components. func Mkdev(major, minor uint32) uint64 { return (uint64(major) << 16) | uint64(minor) } ================================================ FILE: vendor/golang.org/x/sys/unix/dirent.go ================================================ // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos package unix import "unsafe" // readInt returns the size-bytes unsigned integer in native byte order at offset off. func readInt(b []byte, off, size uintptr) (u uint64, ok bool) { if len(b) < int(off+size) { return 0, false } if isBigEndian { return readIntBE(b[off:], size), true } return readIntLE(b[off:], size), true } func readIntBE(b []byte, size uintptr) uint64 { switch size { case 1: return uint64(b[0]) case 2: _ = b[1] // bounds check hint to compiler; see golang.org/issue/14808 return uint64(b[1]) | uint64(b[0])<<8 case 4: _ = b[3] // bounds check hint to compiler; see golang.org/issue/14808 return uint64(b[3]) | uint64(b[2])<<8 | uint64(b[1])<<16 | uint64(b[0])<<24 case 8: _ = b[7] // bounds check hint to compiler; see golang.org/issue/14808 return uint64(b[7]) | uint64(b[6])<<8 | uint64(b[5])<<16 | uint64(b[4])<<24 | uint64(b[3])<<32 | uint64(b[2])<<40 | uint64(b[1])<<48 | uint64(b[0])<<56 default: panic("syscall: readInt with unsupported size") } } func readIntLE(b []byte, size uintptr) uint64 { switch size { case 1: return uint64(b[0]) case 2: _ = b[1] // bounds check hint to compiler; see golang.org/issue/14808 return uint64(b[0]) | uint64(b[1])<<8 case 4: _ = b[3] // bounds check hint to compiler; see golang.org/issue/14808 return uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 case 8: _ = b[7] // bounds check hint to compiler; see golang.org/issue/14808 return uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56 default: panic("syscall: readInt with unsupported size") } } // ParseDirent parses up to max directory entries in buf, // appending the names to names. It returns the number of // bytes consumed from buf, the number of entries added // to names, and the new names slice. func ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) { origlen := len(buf) count = 0 for max != 0 && len(buf) > 0 { reclen, ok := direntReclen(buf) if !ok || reclen > uint64(len(buf)) { return origlen, count, names } rec := buf[:reclen] buf = buf[reclen:] ino, ok := direntIno(rec) if !ok { break } if ino == 0 { // File absent in directory. continue } const namoff = uint64(unsafe.Offsetof(Dirent{}.Name)) namlen, ok := direntNamlen(rec) if !ok || namoff+namlen > uint64(len(rec)) { break } name := rec[namoff : namoff+namlen] for i, c := range name { if c == 0 { name = name[:i] break } } // Check for useless names before allocating a string. if string(name) == "." || string(name) == ".." { continue } max-- count++ names = append(names, string(name)) } return origlen - len(buf), count, names } ================================================ FILE: vendor/golang.org/x/sys/unix/endian_big.go ================================================ // Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // //go:build armbe || arm64be || m68k || mips || mips64 || mips64p32 || ppc || ppc64 || s390 || s390x || shbe || sparc || sparc64 package unix const isBigEndian = true ================================================ FILE: vendor/golang.org/x/sys/unix/endian_little.go ================================================ // Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // //go:build 386 || amd64 || amd64p32 || alpha || arm || arm64 || loong64 || mipsle || mips64le || mips64p32le || nios2 || ppc64le || riscv || riscv64 || sh package unix const isBigEndian = false ================================================ FILE: vendor/golang.org/x/sys/unix/env_unix.go ================================================ // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos // Unix environment variables. package unix import "syscall" func Getenv(key string) (value string, found bool) { return syscall.Getenv(key) } func Setenv(key, value string) error { return syscall.Setenv(key, value) } func Clearenv() { syscall.Clearenv() } func Environ() []string { return syscall.Environ() } func Unsetenv(key string) error { return syscall.Unsetenv(key) } ================================================ FILE: vendor/golang.org/x/sys/unix/fcntl.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build dragonfly || freebsd || linux || netbsd package unix import "unsafe" // fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux // systems by fcntl_linux_32bit.go to be SYS_FCNTL64. var fcntl64Syscall uintptr = SYS_FCNTL func fcntl(fd int, cmd, arg int) (int, error) { valptr, _, errno := Syscall(fcntl64Syscall, uintptr(fd), uintptr(cmd), uintptr(arg)) var err error if errno != 0 { err = errno } return int(valptr), err } // FcntlInt performs a fcntl syscall on fd with the provided command and argument. func FcntlInt(fd uintptr, cmd, arg int) (int, error) { return fcntl(int(fd), cmd, arg) } // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk))) if errno == 0 { return nil } return errno } ================================================ FILE: vendor/golang.org/x/sys/unix/fcntl_darwin.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package unix import "unsafe" // FcntlInt performs a fcntl syscall on fd with the provided command and argument. func FcntlInt(fd uintptr, cmd, arg int) (int, error) { return fcntl(int(fd), cmd, arg) } // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { _, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(lk)))) return err } // FcntlFstore performs a fcntl syscall for the F_PREALLOCATE command. func FcntlFstore(fd uintptr, cmd int, fstore *Fstore_t) error { _, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(fstore)))) return err } ================================================ FILE: vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build (linux && 386) || (linux && arm) || (linux && mips) || (linux && mipsle) || (linux && ppc) package unix func init() { // On 32-bit Linux systems, the fcntl syscall that matches Go's // Flock_t type is SYS_FCNTL64, not SYS_FCNTL. fcntl64Syscall = SYS_FCNTL64 } ================================================ FILE: vendor/golang.org/x/sys/unix/fdset.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos package unix // Set adds fd to the set fds. func (fds *FdSet) Set(fd int) { fds.Bits[fd/NFDBITS] |= (1 << (uintptr(fd) % NFDBITS)) } // Clear removes fd from the set fds. func (fds *FdSet) Clear(fd int) { fds.Bits[fd/NFDBITS] &^= (1 << (uintptr(fd) % NFDBITS)) } // IsSet returns whether fd is in the set fds. func (fds *FdSet) IsSet(fd int) bool { return fds.Bits[fd/NFDBITS]&(1<<(uintptr(fd)%NFDBITS)) != 0 } // Zero clears the set fds. func (fds *FdSet) Zero() { clear(fds.Bits[:]) } ================================================ FILE: vendor/golang.org/x/sys/unix/gccgo.go ================================================ // Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build gccgo && !aix && !hurd package unix import "syscall" // We can't use the gc-syntax .s files for gccgo. On the plus side // much of the functionality can be written directly in Go. func realSyscallNoError(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r uintptr) func realSyscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r, errno uintptr) func SyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) { syscall.Entersyscall() r := realSyscallNoError(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0) syscall.Exitsyscall() return r, 0 } func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { syscall.Entersyscall() r, errno := realSyscall(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0) syscall.Exitsyscall() return r, 0, syscall.Errno(errno) } func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { syscall.Entersyscall() r, errno := realSyscall(trap, a1, a2, a3, a4, a5, a6, 0, 0, 0) syscall.Exitsyscall() return r, 0, syscall.Errno(errno) } func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) { syscall.Entersyscall() r, errno := realSyscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9) syscall.Exitsyscall() return r, 0, syscall.Errno(errno) } func RawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) { r := realSyscallNoError(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0) return r, 0 } func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { r, errno := realSyscall(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0) return r, 0, syscall.Errno(errno) } func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { r, errno := realSyscall(trap, a1, a2, a3, a4, a5, a6, 0, 0, 0) return r, 0, syscall.Errno(errno) } ================================================ FILE: vendor/golang.org/x/sys/unix/gccgo_c.c ================================================ // Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build gccgo && !aix && !hurd #include #include #include #define _STRINGIFY2_(x) #x #define _STRINGIFY_(x) _STRINGIFY2_(x) #define GOSYM_PREFIX _STRINGIFY_(__USER_LABEL_PREFIX__) // Call syscall from C code because the gccgo support for calling from // Go to C does not support varargs functions. struct ret { uintptr_t r; uintptr_t err; }; struct ret gccgoRealSyscall(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) __asm__(GOSYM_PREFIX GOPKGPATH ".realSyscall"); struct ret gccgoRealSyscall(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) { struct ret r; errno = 0; r.r = syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); r.err = errno; return r; } uintptr_t gccgoRealSyscallNoError(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) __asm__(GOSYM_PREFIX GOPKGPATH ".realSyscallNoError"); uintptr_t gccgoRealSyscallNoError(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) { return syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); } ================================================ FILE: vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go ================================================ // Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build gccgo && linux && amd64 package unix import "syscall" //extern gettimeofday func realGettimeofday(*Timeval, *byte) int32 func gettimeofday(tv *Timeval) (err syscall.Errno) { r := realGettimeofday(tv, nil) if r < 0 { return syscall.GetErrno() } return 0 } ================================================ FILE: vendor/golang.org/x/sys/unix/ifreq_linux.go ================================================ // Copyright 2021 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build linux package unix import ( "unsafe" ) // Helpers for dealing with ifreq since it contains a union and thus requires a // lot of unsafe.Pointer casts to use properly. // An Ifreq is a type-safe wrapper around the raw ifreq struct. An Ifreq // contains an interface name and a union of arbitrary data which can be // accessed using the Ifreq's methods. To create an Ifreq, use the NewIfreq // function. // // Use the Name method to access the stored interface name. The union data // fields can be get and set using the following methods: // - Uint16/SetUint16: flags // - Uint32/SetUint32: ifindex, metric, mtu type Ifreq struct{ raw ifreq } // NewIfreq creates an Ifreq with the input network interface name after // validating the name does not exceed IFNAMSIZ-1 (trailing NULL required) // bytes. func NewIfreq(name string) (*Ifreq, error) { // Leave room for terminating NULL byte. if len(name) >= IFNAMSIZ { return nil, EINVAL } var ifr ifreq copy(ifr.Ifrn[:], name) return &Ifreq{raw: ifr}, nil } // TODO(mdlayher): get/set methods for hardware address sockaddr, char array, etc. // Name returns the interface name associated with the Ifreq. func (ifr *Ifreq) Name() string { return ByteSliceToString(ifr.raw.Ifrn[:]) } // According to netdevice(7), only AF_INET addresses are returned for numerous // sockaddr ioctls. For convenience, we expose these as Inet4Addr since the Port // field and other data is always empty. // Inet4Addr returns the Ifreq union data from an embedded sockaddr as a C // in_addr/Go []byte (4-byte IPv4 address) value. If the sockaddr family is not // AF_INET, an error is returned. func (ifr *Ifreq) Inet4Addr() ([]byte, error) { raw := *(*RawSockaddrInet4)(unsafe.Pointer(&ifr.raw.Ifru[:SizeofSockaddrInet4][0])) if raw.Family != AF_INET { // Cannot safely interpret raw.Addr bytes as an IPv4 address. return nil, EINVAL } return raw.Addr[:], nil } // SetInet4Addr sets a C in_addr/Go []byte (4-byte IPv4 address) value in an // embedded sockaddr within the Ifreq's union data. v must be 4 bytes in length // or an error will be returned. func (ifr *Ifreq) SetInet4Addr(v []byte) error { if len(v) != 4 { return EINVAL } var addr [4]byte copy(addr[:], v) ifr.clear() *(*RawSockaddrInet4)( unsafe.Pointer(&ifr.raw.Ifru[:SizeofSockaddrInet4][0]), ) = RawSockaddrInet4{ // Always set IP family as ioctls would require it anyway. Family: AF_INET, Addr: addr, } return nil } // Uint16 returns the Ifreq union data as a C short/Go uint16 value. func (ifr *Ifreq) Uint16() uint16 { return *(*uint16)(unsafe.Pointer(&ifr.raw.Ifru[:2][0])) } // SetUint16 sets a C short/Go uint16 value as the Ifreq's union data. func (ifr *Ifreq) SetUint16(v uint16) { ifr.clear() *(*uint16)(unsafe.Pointer(&ifr.raw.Ifru[:2][0])) = v } // Uint32 returns the Ifreq union data as a C int/Go uint32 value. func (ifr *Ifreq) Uint32() uint32 { return *(*uint32)(unsafe.Pointer(&ifr.raw.Ifru[:4][0])) } // SetUint32 sets a C int/Go uint32 value as the Ifreq's union data. func (ifr *Ifreq) SetUint32(v uint32) { ifr.clear() *(*uint32)(unsafe.Pointer(&ifr.raw.Ifru[:4][0])) = v } // clear zeroes the ifreq's union field to prevent trailing garbage data from // being sent to the kernel if an ifreq is reused. func (ifr *Ifreq) clear() { clear(ifr.raw.Ifru[:]) } // TODO(mdlayher): export as IfreqData? For now we can provide helpers such as // IoctlGetEthtoolDrvinfo which use these APIs under the hood. // An ifreqData is an Ifreq which carries pointer data. To produce an ifreqData, // use the Ifreq.withData method. type ifreqData struct { name [IFNAMSIZ]byte // A type separate from ifreq is required in order to comply with the // unsafe.Pointer rules since the "pointer-ness" of data would not be // preserved if it were cast into the byte array of a raw ifreq. data unsafe.Pointer // Pad to the same size as ifreq. _ [len(ifreq{}.Ifru) - SizeofPtr]byte } // withData produces an ifreqData with the pointer p set for ioctls which require // arbitrary pointer data. func (ifr Ifreq) withData(p unsafe.Pointer) ifreqData { return ifreqData{ name: ifr.raw.Ifrn, data: p, } } ================================================ FILE: vendor/golang.org/x/sys/unix/ioctl_linux.go ================================================ // Copyright 2021 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package unix import "unsafe" // IoctlRetInt performs an ioctl operation specified by req on a device // associated with opened file descriptor fd, and returns a non-negative // integer that is returned by the ioctl syscall. func IoctlRetInt(fd int, req uint) (int, error) { ret, _, err := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), 0) if err != 0 { return 0, err } return int(ret), nil } func IoctlGetUint32(fd int, req uint) (uint32, error) { var value uint32 err := ioctlPtr(fd, req, unsafe.Pointer(&value)) return value, err } func IoctlGetRTCTime(fd int) (*RTCTime, error) { var value RTCTime err := ioctlPtr(fd, RTC_RD_TIME, unsafe.Pointer(&value)) return &value, err } func IoctlSetRTCTime(fd int, value *RTCTime) error { return ioctlPtr(fd, RTC_SET_TIME, unsafe.Pointer(value)) } func IoctlGetRTCWkAlrm(fd int) (*RTCWkAlrm, error) { var value RTCWkAlrm err := ioctlPtr(fd, RTC_WKALM_RD, unsafe.Pointer(&value)) return &value, err } func IoctlSetRTCWkAlrm(fd int, value *RTCWkAlrm) error { return ioctlPtr(fd, RTC_WKALM_SET, unsafe.Pointer(value)) } // IoctlGetEthtoolDrvinfo fetches ethtool driver information for the network // device specified by ifname. func IoctlGetEthtoolDrvinfo(fd int, ifname string) (*EthtoolDrvinfo, error) { ifr, err := NewIfreq(ifname) if err != nil { return nil, err } value := EthtoolDrvinfo{Cmd: ETHTOOL_GDRVINFO} ifrd := ifr.withData(unsafe.Pointer(&value)) err = ioctlIfreqData(fd, SIOCETHTOOL, &ifrd) return &value, err } // IoctlGetEthtoolTsInfo fetches ethtool timestamping and PHC // association for the network device specified by ifname. func IoctlGetEthtoolTsInfo(fd int, ifname string) (*EthtoolTsInfo, error) { ifr, err := NewIfreq(ifname) if err != nil { return nil, err } value := EthtoolTsInfo{Cmd: ETHTOOL_GET_TS_INFO} ifrd := ifr.withData(unsafe.Pointer(&value)) err = ioctlIfreqData(fd, SIOCETHTOOL, &ifrd) return &value, err } // IoctlGetHwTstamp retrieves the hardware timestamping configuration // for the network device specified by ifname. func IoctlGetHwTstamp(fd int, ifname string) (*HwTstampConfig, error) { ifr, err := NewIfreq(ifname) if err != nil { return nil, err } value := HwTstampConfig{} ifrd := ifr.withData(unsafe.Pointer(&value)) err = ioctlIfreqData(fd, SIOCGHWTSTAMP, &ifrd) return &value, err } // IoctlSetHwTstamp updates the hardware timestamping configuration for // the network device specified by ifname. func IoctlSetHwTstamp(fd int, ifname string, cfg *HwTstampConfig) error { ifr, err := NewIfreq(ifname) if err != nil { return err } ifrd := ifr.withData(unsafe.Pointer(cfg)) return ioctlIfreqData(fd, SIOCSHWTSTAMP, &ifrd) } // FdToClockID derives the clock ID from the file descriptor number // - see clock_gettime(3), FD_TO_CLOCKID macros. The resulting ID is // suitable for system calls like ClockGettime. func FdToClockID(fd int) int32 { return int32((int(^fd) << 3) | 3) } // IoctlPtpClockGetcaps returns the description of a given PTP device. func IoctlPtpClockGetcaps(fd int) (*PtpClockCaps, error) { var value PtpClockCaps err := ioctlPtr(fd, PTP_CLOCK_GETCAPS2, unsafe.Pointer(&value)) return &value, err } // IoctlPtpSysOffsetPrecise returns a description of the clock // offset compared to the system clock. func IoctlPtpSysOffsetPrecise(fd int) (*PtpSysOffsetPrecise, error) { var value PtpSysOffsetPrecise err := ioctlPtr(fd, PTP_SYS_OFFSET_PRECISE2, unsafe.Pointer(&value)) return &value, err } // IoctlPtpSysOffsetExtended returns an extended description of the // clock offset compared to the system clock. The samples parameter // specifies the desired number of measurements. func IoctlPtpSysOffsetExtended(fd int, samples uint) (*PtpSysOffsetExtended, error) { value := PtpSysOffsetExtended{Samples: uint32(samples)} err := ioctlPtr(fd, PTP_SYS_OFFSET_EXTENDED2, unsafe.Pointer(&value)) return &value, err } // IoctlPtpPinGetfunc returns the configuration of the specified // I/O pin on given PTP device. func IoctlPtpPinGetfunc(fd int, index uint) (*PtpPinDesc, error) { value := PtpPinDesc{Index: uint32(index)} err := ioctlPtr(fd, PTP_PIN_GETFUNC2, unsafe.Pointer(&value)) return &value, err } // IoctlPtpPinSetfunc updates configuration of the specified PTP // I/O pin. func IoctlPtpPinSetfunc(fd int, pd *PtpPinDesc) error { return ioctlPtr(fd, PTP_PIN_SETFUNC2, unsafe.Pointer(pd)) } // IoctlPtpPeroutRequest configures the periodic output mode of the // PTP I/O pins. func IoctlPtpPeroutRequest(fd int, r *PtpPeroutRequest) error { return ioctlPtr(fd, PTP_PEROUT_REQUEST2, unsafe.Pointer(r)) } // IoctlPtpExttsRequest configures the external timestamping mode // of the PTP I/O pins. func IoctlPtpExttsRequest(fd int, r *PtpExttsRequest) error { return ioctlPtr(fd, PTP_EXTTS_REQUEST2, unsafe.Pointer(r)) } // IoctlGetWatchdogInfo fetches information about a watchdog device from the // Linux watchdog API. For more information, see: // https://www.kernel.org/doc/html/latest/watchdog/watchdog-api.html. func IoctlGetWatchdogInfo(fd int) (*WatchdogInfo, error) { var value WatchdogInfo err := ioctlPtr(fd, WDIOC_GETSUPPORT, unsafe.Pointer(&value)) return &value, err } // IoctlWatchdogKeepalive issues a keepalive ioctl to a watchdog device. For // more information, see: // https://www.kernel.org/doc/html/latest/watchdog/watchdog-api.html. func IoctlWatchdogKeepalive(fd int) error { // arg is ignored and not a pointer, so ioctl is fine instead of ioctlPtr. return ioctl(fd, WDIOC_KEEPALIVE, 0) } // IoctlFileCloneRange performs an FICLONERANGE ioctl operation to clone the // range of data conveyed in value to the file associated with the file // descriptor destFd. See the ioctl_ficlonerange(2) man page for details. func IoctlFileCloneRange(destFd int, value *FileCloneRange) error { return ioctlPtr(destFd, FICLONERANGE, unsafe.Pointer(value)) } // IoctlFileClone performs an FICLONE ioctl operation to clone the entire file // associated with the file description srcFd to the file associated with the // file descriptor destFd. See the ioctl_ficlone(2) man page for details. func IoctlFileClone(destFd, srcFd int) error { return ioctl(destFd, FICLONE, uintptr(srcFd)) } type FileDedupeRange struct { Src_offset uint64 Src_length uint64 Reserved1 uint16 Reserved2 uint32 Info []FileDedupeRangeInfo } type FileDedupeRangeInfo struct { Dest_fd int64 Dest_offset uint64 Bytes_deduped uint64 Status int32 Reserved uint32 } // IoctlFileDedupeRange performs an FIDEDUPERANGE ioctl operation to share the // range of data conveyed in value from the file associated with the file // descriptor srcFd to the value.Info destinations. See the // ioctl_fideduperange(2) man page for details. func IoctlFileDedupeRange(srcFd int, value *FileDedupeRange) error { buf := make([]byte, SizeofRawFileDedupeRange+ len(value.Info)*SizeofRawFileDedupeRangeInfo) rawrange := (*RawFileDedupeRange)(unsafe.Pointer(&buf[0])) rawrange.Src_offset = value.Src_offset rawrange.Src_length = value.Src_length rawrange.Dest_count = uint16(len(value.Info)) rawrange.Reserved1 = value.Reserved1 rawrange.Reserved2 = value.Reserved2 for i := range value.Info { rawinfo := (*RawFileDedupeRangeInfo)(unsafe.Pointer( uintptr(unsafe.Pointer(&buf[0])) + uintptr(SizeofRawFileDedupeRange) + uintptr(i*SizeofRawFileDedupeRangeInfo))) rawinfo.Dest_fd = value.Info[i].Dest_fd rawinfo.Dest_offset = value.Info[i].Dest_offset rawinfo.Bytes_deduped = value.Info[i].Bytes_deduped rawinfo.Status = value.Info[i].Status rawinfo.Reserved = value.Info[i].Reserved } err := ioctlPtr(srcFd, FIDEDUPERANGE, unsafe.Pointer(&buf[0])) // Output for i := range value.Info { rawinfo := (*RawFileDedupeRangeInfo)(unsafe.Pointer( uintptr(unsafe.Pointer(&buf[0])) + uintptr(SizeofRawFileDedupeRange) + uintptr(i*SizeofRawFileDedupeRangeInfo))) value.Info[i].Dest_fd = rawinfo.Dest_fd value.Info[i].Dest_offset = rawinfo.Dest_offset value.Info[i].Bytes_deduped = rawinfo.Bytes_deduped value.Info[i].Status = rawinfo.Status value.Info[i].Reserved = rawinfo.Reserved } return err } func IoctlHIDGetDesc(fd int, value *HIDRawReportDescriptor) error { return ioctlPtr(fd, HIDIOCGRDESC, unsafe.Pointer(value)) } func IoctlHIDGetRawInfo(fd int) (*HIDRawDevInfo, error) { var value HIDRawDevInfo err := ioctlPtr(fd, HIDIOCGRAWINFO, unsafe.Pointer(&value)) return &value, err } func IoctlHIDGetRawName(fd int) (string, error) { var value [_HIDIOCGRAWNAME_LEN]byte err := ioctlPtr(fd, _HIDIOCGRAWNAME, unsafe.Pointer(&value[0])) return ByteSliceToString(value[:]), err } func IoctlHIDGetRawPhys(fd int) (string, error) { var value [_HIDIOCGRAWPHYS_LEN]byte err := ioctlPtr(fd, _HIDIOCGRAWPHYS, unsafe.Pointer(&value[0])) return ByteSliceToString(value[:]), err } func IoctlHIDGetRawUniq(fd int) (string, error) { var value [_HIDIOCGRAWUNIQ_LEN]byte err := ioctlPtr(fd, _HIDIOCGRAWUNIQ, unsafe.Pointer(&value[0])) return ByteSliceToString(value[:]), err } // IoctlIfreq performs an ioctl using an Ifreq structure for input and/or // output. See the netdevice(7) man page for details. func IoctlIfreq(fd int, req uint, value *Ifreq) error { // It is possible we will add more fields to *Ifreq itself later to prevent // misuse, so pass the raw *ifreq directly. return ioctlPtr(fd, req, unsafe.Pointer(&value.raw)) } // TODO(mdlayher): export if and when IfreqData is exported. // ioctlIfreqData performs an ioctl using an ifreqData structure for input // and/or output. See the netdevice(7) man page for details. func ioctlIfreqData(fd int, req uint, value *ifreqData) error { // The memory layout of IfreqData (type-safe) and ifreq (not type-safe) are // identical so pass *IfreqData directly. return ioctlPtr(fd, req, unsafe.Pointer(value)) } // IoctlKCMClone attaches a new file descriptor to a multiplexor by cloning an // existing KCM socket, returning a structure containing the file descriptor of // the new socket. func IoctlKCMClone(fd int) (*KCMClone, error) { var info KCMClone if err := ioctlPtr(fd, SIOCKCMCLONE, unsafe.Pointer(&info)); err != nil { return nil, err } return &info, nil } // IoctlKCMAttach attaches a TCP socket and associated BPF program file // descriptor to a multiplexor. func IoctlKCMAttach(fd int, info KCMAttach) error { return ioctlPtr(fd, SIOCKCMATTACH, unsafe.Pointer(&info)) } // IoctlKCMUnattach unattaches a TCP socket file descriptor from a multiplexor. func IoctlKCMUnattach(fd int, info KCMUnattach) error { return ioctlPtr(fd, SIOCKCMUNATTACH, unsafe.Pointer(&info)) } // IoctlLoopGetStatus64 gets the status of the loop device associated with the // file descriptor fd using the LOOP_GET_STATUS64 operation. func IoctlLoopGetStatus64(fd int) (*LoopInfo64, error) { var value LoopInfo64 if err := ioctlPtr(fd, LOOP_GET_STATUS64, unsafe.Pointer(&value)); err != nil { return nil, err } return &value, nil } // IoctlLoopSetStatus64 sets the status of the loop device associated with the // file descriptor fd using the LOOP_SET_STATUS64 operation. func IoctlLoopSetStatus64(fd int, value *LoopInfo64) error { return ioctlPtr(fd, LOOP_SET_STATUS64, unsafe.Pointer(value)) } // IoctlLoopConfigure configures all loop device parameters in a single step func IoctlLoopConfigure(fd int, value *LoopConfig) error { return ioctlPtr(fd, LOOP_CONFIGURE, unsafe.Pointer(value)) } ================================================ FILE: vendor/golang.org/x/sys/unix/ioctl_signed.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build aix || solaris package unix import "unsafe" // ioctl itself should not be exposed directly, but additional get/set // functions for specific types are permissible. // IoctlSetInt performs an ioctl operation which sets an integer value // on fd, using the specified request number. func IoctlSetInt(fd int, req int, value int) error { return ioctl(fd, req, uintptr(value)) } // IoctlSetPointerInt performs an ioctl operation which sets an // integer value on fd, using the specified request number. The ioctl // argument is called with a pointer to the integer value, rather than // passing the integer value directly. func IoctlSetPointerInt(fd int, req int, value int) error { v := int32(value) return ioctlPtr(fd, req, unsafe.Pointer(&v)) } // IoctlSetString performs an ioctl operation which sets a string value // on fd, using the specified request number. func IoctlSetString(fd int, req int, value string) error { bs := append([]byte(value), 0) return ioctlPtr(fd, req, unsafe.Pointer(&bs[0])) } // IoctlSetWinsize performs an ioctl on fd with a *Winsize argument. // // To change fd's window size, the req argument should be TIOCSWINSZ. func IoctlSetWinsize(fd int, req int, value *Winsize) error { // TODO: if we get the chance, remove the req parameter and // hardcode TIOCSWINSZ. return ioctlPtr(fd, req, unsafe.Pointer(value)) } // IoctlSetTermios performs an ioctl on fd with a *Termios. // // The req value will usually be TCSETA or TIOCSETA. func IoctlSetTermios(fd int, req int, value *Termios) error { // TODO: if we get the chance, remove the req parameter. return ioctlPtr(fd, req, unsafe.Pointer(value)) } // IoctlGetInt performs an ioctl operation which gets an integer value // from fd, using the specified request number. // // A few ioctl requests use the return value as an output parameter; // for those, IoctlRetInt should be used instead of this function. func IoctlGetInt(fd int, req int) (int, error) { var value int err := ioctlPtr(fd, req, unsafe.Pointer(&value)) return value, err } func IoctlGetWinsize(fd int, req int) (*Winsize, error) { var value Winsize err := ioctlPtr(fd, req, unsafe.Pointer(&value)) return &value, err } func IoctlGetTermios(fd int, req int) (*Termios, error) { var value Termios err := ioctlPtr(fd, req, unsafe.Pointer(&value)) return &value, err } ================================================ FILE: vendor/golang.org/x/sys/unix/ioctl_unsigned.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build darwin || dragonfly || freebsd || hurd || linux || netbsd || openbsd package unix import "unsafe" // ioctl itself should not be exposed directly, but additional get/set // functions for specific types are permissible. // IoctlSetInt performs an ioctl operation which sets an integer value // on fd, using the specified request number. func IoctlSetInt(fd int, req uint, value int) error { return ioctl(fd, req, uintptr(value)) } // IoctlSetPointerInt performs an ioctl operation which sets an // integer value on fd, using the specified request number. The ioctl // argument is called with a pointer to the integer value, rather than // passing the integer value directly. func IoctlSetPointerInt(fd int, req uint, value int) error { v := int32(value) return ioctlPtr(fd, req, unsafe.Pointer(&v)) } // IoctlSetString performs an ioctl operation which sets a string value // on fd, using the specified request number. func IoctlSetString(fd int, req uint, value string) error { bs := append([]byte(value), 0) return ioctlPtr(fd, req, unsafe.Pointer(&bs[0])) } // IoctlSetWinsize performs an ioctl on fd with a *Winsize argument. // // To change fd's window size, the req argument should be TIOCSWINSZ. func IoctlSetWinsize(fd int, req uint, value *Winsize) error { // TODO: if we get the chance, remove the req parameter and // hardcode TIOCSWINSZ. return ioctlPtr(fd, req, unsafe.Pointer(value)) } // IoctlSetTermios performs an ioctl on fd with a *Termios. // // The req value will usually be TCSETA or TIOCSETA. func IoctlSetTermios(fd int, req uint, value *Termios) error { // TODO: if we get the chance, remove the req parameter. return ioctlPtr(fd, req, unsafe.Pointer(value)) } // IoctlGetInt performs an ioctl operation which gets an integer value // from fd, using the specified request number. // // A few ioctl requests use the return value as an output parameter; // for those, IoctlRetInt should be used instead of this function. func IoctlGetInt(fd int, req uint) (int, error) { var value int err := ioctlPtr(fd, req, unsafe.Pointer(&value)) return value, err } func IoctlGetWinsize(fd int, req uint) (*Winsize, error) { var value Winsize err := ioctlPtr(fd, req, unsafe.Pointer(&value)) return &value, err } func IoctlGetTermios(fd int, req uint) (*Termios, error) { var value Termios err := ioctlPtr(fd, req, unsafe.Pointer(&value)) return &value, err } ================================================ FILE: vendor/golang.org/x/sys/unix/ioctl_zos.go ================================================ // Copyright 2020 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build zos && s390x package unix import ( "runtime" "unsafe" ) // ioctl itself should not be exposed directly, but additional get/set // functions for specific types are permissible. // IoctlSetInt performs an ioctl operation which sets an integer value // on fd, using the specified request number. func IoctlSetInt(fd int, req int, value int) error { return ioctl(fd, req, uintptr(value)) } // IoctlSetWinsize performs an ioctl on fd with a *Winsize argument. // // To change fd's window size, the req argument should be TIOCSWINSZ. func IoctlSetWinsize(fd int, req int, value *Winsize) error { // TODO: if we get the chance, remove the req parameter and // hardcode TIOCSWINSZ. return ioctlPtr(fd, req, unsafe.Pointer(value)) } // IoctlSetTermios performs an ioctl on fd with a *Termios. // // The req value is expected to be TCSETS, TCSETSW, or TCSETSF func IoctlSetTermios(fd int, req int, value *Termios) error { if (req != TCSETS) && (req != TCSETSW) && (req != TCSETSF) { return ENOSYS } err := Tcsetattr(fd, int(req), value) runtime.KeepAlive(value) return err } // IoctlGetInt performs an ioctl operation which gets an integer value // from fd, using the specified request number. // // A few ioctl requests use the return value as an output parameter; // for those, IoctlRetInt should be used instead of this function. func IoctlGetInt(fd int, req int) (int, error) { var value int err := ioctlPtr(fd, req, unsafe.Pointer(&value)) return value, err } func IoctlGetWinsize(fd int, req int) (*Winsize, error) { var value Winsize err := ioctlPtr(fd, req, unsafe.Pointer(&value)) return &value, err } // IoctlGetTermios performs an ioctl on fd with a *Termios. // // The req value is expected to be TCGETS func IoctlGetTermios(fd int, req int) (*Termios, error) { var value Termios if req != TCGETS { return &value, ENOSYS } err := Tcgetattr(fd, &value) return &value, err } ================================================ FILE: vendor/golang.org/x/sys/unix/mkall.sh ================================================ #!/usr/bin/env bash # Copyright 2009 The Go Authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. # This script runs or (given -n) prints suggested commands to generate files for # the Architecture/OS specified by the GOARCH and GOOS environment variables. # See README.md for more information about how the build system works. GOOSARCH="${GOOS}_${GOARCH}" # defaults mksyscall="go run mksyscall.go" mkerrors="./mkerrors.sh" zerrors="zerrors_$GOOSARCH.go" mksysctl="" zsysctl="zsysctl_$GOOSARCH.go" mksysnum= mktypes= mkasm= run="sh" cmd="" case "$1" in -syscalls) for i in zsyscall*go do # Run the command line that appears in the first line # of the generated file to regenerate it. sed 1q $i | sed 's;^// ;;' | sh > _$i && gofmt < _$i > $i rm _$i done exit 0 ;; -n) run="cat" cmd="echo" shift esac case "$#" in 0) ;; *) echo 'usage: mkall.sh [-n]' 1>&2 exit 2 esac if [[ "$GOOS" = "linux" ]]; then # Use the Docker-based build system # Files generated through docker (use $cmd so you can Ctl-C the build or run) set -e $cmd docker build --tag generate:$GOOS $GOOS $cmd docker run --interactive --tty --volume $(cd -- "$(dirname -- "$0")/.." && pwd):/build generate:$GOOS exit fi GOOSARCH_in=syscall_$GOOSARCH.go case "$GOOSARCH" in _* | *_ | _) echo 'undefined $GOOS_$GOARCH:' "$GOOSARCH" 1>&2 exit 1 ;; aix_ppc) mkerrors="$mkerrors -maix32" mksyscall="go run mksyscall_aix_ppc.go -aix" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; aix_ppc64) mkerrors="$mkerrors -maix64" mksyscall="go run mksyscall_aix_ppc64.go -aix" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; darwin_amd64) mkerrors="$mkerrors -m64" mktypes="GOARCH=$GOARCH go tool cgo -godefs" mkasm="go run mkasm.go" ;; darwin_arm64) mkerrors="$mkerrors -m64" mktypes="GOARCH=$GOARCH go tool cgo -godefs" mkasm="go run mkasm.go" ;; dragonfly_amd64) mkerrors="$mkerrors -m64" mksyscall="go run mksyscall.go -dragonfly" mksysnum="go run mksysnum.go 'https://gitweb.dragonflybsd.org/dragonfly.git/blob_plain/HEAD:/sys/kern/syscalls.master'" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; freebsd_386) mkerrors="$mkerrors -m32" mksyscall="go run mksyscall.go -l32" mksysnum="go run mksysnum.go 'https://cgit.freebsd.org/src/plain/sys/kern/syscalls.master?h=stable/12'" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; freebsd_amd64) mkerrors="$mkerrors -m64" mksysnum="go run mksysnum.go 'https://cgit.freebsd.org/src/plain/sys/kern/syscalls.master?h=stable/12'" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; freebsd_arm) mkerrors="$mkerrors" mksyscall="go run mksyscall.go -l32 -arm" mksysnum="go run mksysnum.go 'https://cgit.freebsd.org/src/plain/sys/kern/syscalls.master?h=stable/12'" # Let the type of C char be signed for making the bare syscall # API consistent across platforms. mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char" ;; freebsd_arm64) mkerrors="$mkerrors -m64" mksysnum="go run mksysnum.go 'https://cgit.freebsd.org/src/plain/sys/kern/syscalls.master?h=stable/12'" mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char" ;; freebsd_riscv64) mkerrors="$mkerrors -m64" mksysnum="go run mksysnum.go 'https://cgit.freebsd.org/src/plain/sys/kern/syscalls.master?h=stable/12'" mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char" ;; netbsd_386) mkerrors="$mkerrors -m32" mksyscall="go run mksyscall.go -l32 -netbsd" mksysnum="go run mksysnum.go 'http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master'" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; netbsd_amd64) mkerrors="$mkerrors -m64" mksyscall="go run mksyscall.go -netbsd" mksysnum="go run mksysnum.go 'http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master'" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; netbsd_arm) mkerrors="$mkerrors" mksyscall="go run mksyscall.go -l32 -netbsd -arm" mksysnum="go run mksysnum.go 'http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master'" # Let the type of C char be signed for making the bare syscall # API consistent across platforms. mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char" ;; netbsd_arm64) mkerrors="$mkerrors -m64" mksyscall="go run mksyscall.go -netbsd" mksysnum="go run mksysnum.go 'http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master'" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; openbsd_386) mkasm="go run mkasm.go" mkerrors="$mkerrors -m32" mksyscall="go run mksyscall.go -l32 -openbsd -libc" mksysctl="go run mksysctl_openbsd.go" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; openbsd_amd64) mkasm="go run mkasm.go" mkerrors="$mkerrors -m64" mksyscall="go run mksyscall.go -openbsd -libc" mksysctl="go run mksysctl_openbsd.go" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; openbsd_arm) mkasm="go run mkasm.go" mkerrors="$mkerrors" mksyscall="go run mksyscall.go -l32 -openbsd -arm -libc" mksysctl="go run mksysctl_openbsd.go" # Let the type of C char be signed for making the bare syscall # API consistent across platforms. mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char" ;; openbsd_arm64) mkasm="go run mkasm.go" mkerrors="$mkerrors -m64" mksyscall="go run mksyscall.go -openbsd -libc" mksysctl="go run mksysctl_openbsd.go" # Let the type of C char be signed for making the bare syscall # API consistent across platforms. mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char" ;; openbsd_mips64) mkasm="go run mkasm.go" mkerrors="$mkerrors -m64" mksyscall="go run mksyscall.go -openbsd -libc" mksysctl="go run mksysctl_openbsd.go" # Let the type of C char be signed for making the bare syscall # API consistent across platforms. mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char" ;; openbsd_ppc64) mkasm="go run mkasm.go" mkerrors="$mkerrors -m64" mksyscall="go run mksyscall.go -openbsd -libc" mksysctl="go run mksysctl_openbsd.go" # Let the type of C char be signed for making the bare syscall # API consistent across platforms. mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char" ;; openbsd_riscv64) mkasm="go run mkasm.go" mkerrors="$mkerrors -m64" mksyscall="go run mksyscall.go -openbsd -libc" mksysctl="go run mksysctl_openbsd.go" # Let the type of C char be signed for making the bare syscall # API consistent across platforms. mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char" ;; solaris_amd64) mksyscall="go run mksyscall_solaris.go" mkerrors="$mkerrors -m64" mksysnum= mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; illumos_amd64) mksyscall="go run mksyscall_solaris.go" mkerrors= mksysnum= mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; *) echo 'unrecognized $GOOS_$GOARCH: ' "$GOOSARCH" 1>&2 exit 1 ;; esac ( if [ -n "$mkerrors" ]; then echo "$mkerrors |gofmt >$zerrors"; fi case "$GOOS" in *) syscall_goos="syscall_$GOOS.go" case "$GOOS" in darwin | dragonfly | freebsd | netbsd | openbsd) syscall_goos="syscall_bsd.go $syscall_goos" ;; esac if [ -n "$mksyscall" ]; then if [ "$GOOSARCH" == "aix_ppc64" ]; then # aix/ppc64 script generates files instead of writing to stdin. echo "$mksyscall -tags $GOOS,$GOARCH $syscall_goos $GOOSARCH_in && gofmt -w zsyscall_$GOOSARCH.go && gofmt -w zsyscall_"$GOOSARCH"_gccgo.go && gofmt -w zsyscall_"$GOOSARCH"_gc.go " ; elif [ "$GOOS" == "illumos" ]; then # illumos code generation requires a --illumos switch echo "$mksyscall -illumos -tags illumos,$GOARCH syscall_illumos.go |gofmt > zsyscall_illumos_$GOARCH.go"; # illumos implies solaris, so solaris code generation is also required echo "$mksyscall -tags solaris,$GOARCH syscall_solaris.go syscall_solaris_$GOARCH.go |gofmt >zsyscall_solaris_$GOARCH.go"; else echo "$mksyscall -tags $GOOS,$GOARCH $syscall_goos $GOOSARCH_in |gofmt >zsyscall_$GOOSARCH.go"; fi fi esac if [ -n "$mksysctl" ]; then echo "$mksysctl |gofmt >$zsysctl"; fi if [ -n "$mksysnum" ]; then echo "$mksysnum |gofmt >zsysnum_$GOOSARCH.go"; fi if [ -n "$mktypes" ]; then echo "$mktypes types_$GOOS.go | go run mkpost.go > ztypes_$GOOSARCH.go"; fi if [ -n "$mkasm" ]; then echo "$mkasm $GOOS $GOARCH"; fi ) | $run ================================================ FILE: vendor/golang.org/x/sys/unix/mkerrors.sh ================================================ #!/usr/bin/env bash # Copyright 2009 The Go Authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. # Generate Go code listing errors and other #defined constant # values (ENAMETOOLONG etc.), by asking the preprocessor # about the definitions. unset LANG export LC_ALL=C export LC_CTYPE=C if test -z "$GOARCH" -o -z "$GOOS"; then echo 1>&2 "GOARCH or GOOS not defined in environment" exit 1 fi # Check that we are using the new build system if we should if [[ "$GOOS" = "linux" ]] && [[ "$GOLANG_SYS_BUILD" != "docker" ]]; then echo 1>&2 "In the Docker based build system, mkerrors should not be called directly." echo 1>&2 "See README.md" exit 1 fi if [[ "$GOOS" = "aix" ]]; then CC=${CC:-gcc} else CC=${CC:-cc} fi if [[ "$GOOS" = "solaris" ]]; then # Assumes GNU versions of utilities in PATH. export PATH=/usr/gnu/bin:$PATH fi uname=$(uname) includes_AIX=' #include #include #include #include #include #include #include #include #include #include #include #define AF_LOCAL AF_UNIX ' includes_Darwin=' #define _DARWIN_C_SOURCE #define KERNEL 1 #define _DARWIN_USE_64_BIT_INODE #define __APPLE_USE_RFC_3542 #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // for backwards compatibility because moved TIOCREMOTE to Kernel.framework after MacOSX12.0.sdk. #define TIOCREMOTE 0x80047469 ' includes_DragonFly=' #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include ' includes_FreeBSD=' #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if __FreeBSD__ >= 10 #define IFT_CARP 0xf8 // IFT_CARP is deprecated in FreeBSD 10 #undef SIOCAIFADDR #define SIOCAIFADDR _IOW(105, 26, struct oifaliasreq) // ifaliasreq contains if_data #undef SIOCSIFPHYADDR #define SIOCSIFPHYADDR _IOW(105, 70, struct oifaliasreq) // ifaliasreq contains if_data #endif ' includes_Linux=' #define _LARGEFILE_SOURCE #define _LARGEFILE64_SOURCE #ifndef __LP64__ #define _FILE_OFFSET_BITS 64 #endif #define _GNU_SOURCE // See the description in unix/linux/types.go #if defined(__ARM_EABI__) || \ (defined(__mips__) && (_MIPS_SIM == _ABIO32)) || \ (defined(__powerpc__) && (!defined(__powerpc64__))) # ifdef _TIME_BITS # undef _TIME_BITS # endif # define _TIME_BITS 32 #endif // is broken on powerpc64, as it fails to include definitions of // these structures. We just include them copied from . #if defined(__powerpc__) struct sgttyb { char sg_ispeed; char sg_ospeed; char sg_erase; char sg_kill; short sg_flags; }; struct tchars { char t_intrc; char t_quitc; char t_startc; char t_stopc; char t_eofc; char t_brkc; }; struct ltchars { char t_suspc; char t_dsuspc; char t_rprntc; char t_flushc; char t_werasc; char t_lnextc; }; #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if defined(__sparc__) // On sparc{,64}, the kernel defines struct termios2 itself which clashes with the // definition in glibc. As only the error constants are needed here, include the // generic termibits.h (which is included by termbits.h on sparc). #include #else #include #endif #ifndef PTRACE_GETREGS #define PTRACE_GETREGS 0xc #endif #ifndef PTRACE_SETREGS #define PTRACE_SETREGS 0xd #endif #ifdef SOL_BLUETOOTH // SPARC includes this in /usr/include/sparc64-linux-gnu/bits/socket.h // but it is already in bluetooth_linux.go #undef SOL_BLUETOOTH #endif // Certain constants are missing from the fs/crypto UAPI #define FS_KEY_DESC_PREFIX "fscrypt:" #define FS_KEY_DESC_PREFIX_SIZE 8 #define FS_MAX_KEY_SIZE 64 // The code generator produces -0x1 for (~0), but an unsigned value is necessary // for the tipc_subscr timeout __u32 field. #undef TIPC_WAIT_FOREVER #define TIPC_WAIT_FOREVER 0xffffffff // Copied from linux/netfilter/nf_nat.h // Including linux/netfilter/nf_nat.h here causes conflicts between linux/in.h // and netinet/in.h. #define NF_NAT_RANGE_MAP_IPS (1 << 0) #define NF_NAT_RANGE_PROTO_SPECIFIED (1 << 1) #define NF_NAT_RANGE_PROTO_RANDOM (1 << 2) #define NF_NAT_RANGE_PERSISTENT (1 << 3) #define NF_NAT_RANGE_PROTO_RANDOM_FULLY (1 << 4) #define NF_NAT_RANGE_PROTO_OFFSET (1 << 5) #define NF_NAT_RANGE_NETMAP (1 << 6) #define NF_NAT_RANGE_PROTO_RANDOM_ALL \ (NF_NAT_RANGE_PROTO_RANDOM | NF_NAT_RANGE_PROTO_RANDOM_FULLY) #define NF_NAT_RANGE_MASK \ (NF_NAT_RANGE_MAP_IPS | NF_NAT_RANGE_PROTO_SPECIFIED | \ NF_NAT_RANGE_PROTO_RANDOM | NF_NAT_RANGE_PERSISTENT | \ NF_NAT_RANGE_PROTO_RANDOM_FULLY | NF_NAT_RANGE_PROTO_OFFSET | \ NF_NAT_RANGE_NETMAP) // Copied from linux/hid.h. // Keep in sync with the size of the referenced fields. #define _HIDIOCGRAWNAME_LEN 128 // sizeof_field(struct hid_device, name) #define _HIDIOCGRAWPHYS_LEN 64 // sizeof_field(struct hid_device, phys) #define _HIDIOCGRAWUNIQ_LEN 64 // sizeof_field(struct hid_device, uniq) #define _HIDIOCGRAWNAME HIDIOCGRAWNAME(_HIDIOCGRAWNAME_LEN) #define _HIDIOCGRAWPHYS HIDIOCGRAWPHYS(_HIDIOCGRAWPHYS_LEN) #define _HIDIOCGRAWUNIQ HIDIOCGRAWUNIQ(_HIDIOCGRAWUNIQ_LEN) // Renamed in v6.16, commit c6d732c38f93 ("net: ethtool: remove duplicate defines for family info") #define ETHTOOL_FAMILY_NAME ETHTOOL_GENL_NAME #define ETHTOOL_FAMILY_VERSION ETHTOOL_GENL_VERSION ' includes_NetBSD=' #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // Needed since refers to it... #define schedppq 1 ' includes_OpenBSD=' #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // We keep some constants not supported in OpenBSD 5.5 and beyond for // the promise of compatibility. #define EMUL_ENABLED 0x1 #define EMUL_NATIVE 0x2 #define IPV6_FAITH 0x1d #define IPV6_OPTIONS 0x1 #define IPV6_RTHDR_STRICT 0x1 #define IPV6_SOCKOPT_RESERVED1 0x3 #define SIOCGIFGENERIC 0xc020693a #define SIOCSIFGENERIC 0x80206939 #define WALTSIG 0x4 ' includes_SunOS=' #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include ' includes=' #include #include #include #include #include #include #include #include #include #include #include #include #include #include ' ccflags="$@" # Write go tool cgo -godefs input. ( echo package unix echo echo '/*' indirect="includes_$(uname)" echo "${!indirect} $includes" echo '*/' echo 'import "C"' echo 'import "syscall"' echo echo 'const (' # The gcc command line prints all the #defines # it encounters while processing the input echo "${!indirect} $includes" | $CC -x c - -E -dM $ccflags | awk ' $1 != "#define" || $2 ~ /\(/ || $3 == "" {next} $2 ~ /^E([ABCD]X|[BIS]P|[SD]I|S|FL)$/ {next} # 386 registers $2 ~ /^(SIGEV_|SIGSTKSZ|SIGRT(MIN|MAX))/ {next} $2 ~ /^(SCM_SRCRT)$/ {next} $2 ~ /^(MAP_FAILED)$/ {next} $2 ~ /^ELF_.*$/ {next}# contains ELF_ARCH, etc. $2 ~ /^EXTATTR_NAMESPACE_NAMES/ || $2 ~ /^EXTATTR_NAMESPACE_[A-Z]+_STRING/ {next} $2 !~ /^ECCAPBITS/ && $2 !~ /^ETH_/ && $2 !~ /^EPROC_/ && $2 !~ /^EQUIV_/ && $2 !~ /^EXPR_/ && $2 !~ /^EVIOC/ && $2 ~ /^E[A-Z0-9_]+$/ || $2 ~ /^B[0-9_]+$/ || $2 ~ /^(OLD|NEW)DEV$/ || $2 == "BOTHER" || $2 ~ /^CI?BAUD(EX)?$/ || $2 == "IBSHIFT" || $2 ~ /^V[A-Z0-9]+$/ || $2 ~ /^CS[A-Z0-9]/ || $2 ~ /^I(SIG|CANON|CRNL|UCLC|EXTEN|MAXBEL|STRIP|UTF8)$/ || $2 ~ /^IGN/ || $2 ~ /^IX(ON|ANY|OFF)$/ || $2 ~ /^IN(LCR|PCK)$/ || $2 !~ "X86_CR3_PCID_NOFLUSH" && $2 ~ /(^FLU?SH)|(FLU?SH$)/ || $2 ~ /^C(LOCAL|READ|MSPAR|RTSCTS)$/ || $2 == "BRKINT" || $2 == "HUPCL" || $2 == "PENDIN" || $2 == "TOSTOP" || $2 == "XCASE" || $2 == "ALTWERASE" || $2 == "NOKERNINFO" || $2 == "NFDBITS" || $2 ~ /^PAR/ || $2 ~ /^SIG[^_]/ || $2 ~ /^O[CNPFPL][A-Z]+[^_][A-Z]+$/ || $2 ~ /^(NL|CR|TAB|BS|VT|FF)DLY$/ || $2 ~ /^(NL|CR|TAB|BS|VT|FF)[0-9]$/ || $2 ~ /^(DT|EI|ELF|EV|NN|NT|PF|SHF|SHN|SHT|STB|STT|VER)_/ || $2 ~ /^O?XTABS$/ || $2 ~ /^TC[IO](ON|OFF)$/ || $2 ~ /^IN_/ || $2 ~ /^KCM/ || $2 ~ /^LANDLOCK_/ || $2 ~ /^LOCK_(SH|EX|NB|UN)$/ || $2 ~ /^LO_(KEY|NAME)_SIZE$/ || $2 ~ /^LOOP_(CLR|CTL|GET|SET)_/ || $2 == "LOOP_CONFIGURE" || $2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|TCP|MCAST|EVFILT|NOTE|SHUT|PROT|MAP|MREMAP|MFD|T?PACKET|MSG|SCM|MCL|DT|MADV|PR|LOCAL|TCPOPT|UDP)_/ || $2 ~ /^NFC_(GENL|PROTO|COMM|RF|SE|DIRECTION|LLCP|SOCKPROTO)_/ || $2 ~ /^NFC_.*_(MAX)?SIZE$/ || $2 ~ /^PTP_/ || $2 ~ /^RAW_PAYLOAD_/ || $2 ~ /^[US]F_/ || $2 ~ /^TP_STATUS_/ || $2 ~ /^FALLOC_/ || $2 ~ /^ICMPV?6?_(FILTER|SEC)/ || $2 == "SOMAXCONN" || $2 == "NAME_MAX" || $2 == "IFNAMSIZ" || $2 ~ /^CTL_(HW|KERN|MAXNAME|NET|QUERY)$/ || $2 ~ /^KERN_(HOSTNAME|OS(RELEASE|TYPE)|VERSION)$/ || $2 ~ /^HW_MACHINE$/ || $2 ~ /^SYSCTL_VERS/ || $2 !~ "MNT_BITS" && $2 ~ /^(MS|MNT|MOUNT|UMOUNT)_/ || $2 ~ /^NS_GET_/ || $2 ~ /^TUN(SET|GET|ATTACH|DETACH)/ || $2 ~ /^(O|F|[ES]?FD|NAME|S|PTRACE|PT|PIOD|TFD)_/ || $2 ~ /^KEXEC_/ || $2 ~ /^LINUX_REBOOT_CMD_/ || $2 ~ /^LINUX_REBOOT_MAGIC[12]$/ || $2 ~ /^MODULE_INIT_/ || $2 !~ "NLA_TYPE_MASK" && $2 !~ /^RTC_VL_(ACCURACY|BACKUP|DATA)/ && $2 ~ /^(NETLINK|NLM|NLMSG|NLA|IFA|IFAN|RT|RTC|RTCF|RTN|RTPROT|RTNH|ARPHRD|ETH_P|NETNSA)_/ || $2 ~ /^SOCK_|SK_DIAG_|SKNLGRP_$/ || $2 ~ /^(CONNECT|SAE)_/ || $2 ~ /^FIORDCHK$/ || $2 ~ /^SIOC/ || $2 ~ /^TIOC/ || $2 ~ /^TCGET/ || $2 ~ /^TCSET/ || $2 ~ /^TC(FLSH|SBRKP?|XONC)$/ || $2 !~ "RTF_BITS" && $2 ~ /^(IFF|IFT|NET_RT|RTM(GRP)?|RTF|RTV|RTA|RTAX)_/ || $2 ~ /^BIOC/ || $2 ~ /^DIOC/ || $2 ~ /^RUSAGE_(SELF|CHILDREN|THREAD)/ || $2 ~ /^RLIMIT_(AS|CORE|CPU|DATA|FSIZE|LOCKS|MEMLOCK|MSGQUEUE|NICE|NOFILE|NPROC|RSS|RTPRIO|RTTIME|SIGPENDING|STACK)|RLIM_INFINITY/ || $2 ~ /^PRIO_(PROCESS|PGRP|USER)/ || $2 ~ /^CLONE_[A-Z_]+/ || $2 !~ /^(BPF_TIMEVAL|BPF_FIB_LOOKUP_[A-Z]+|BPF_F_LINK)$/ && $2 ~ /^(BPF|DLT)_/ || $2 ~ /^AUDIT_/ || $2 ~ /^(CLOCK|TIMER)_/ || $2 ~ /^CAN_/ || $2 ~ /^CAP_/ || $2 ~ /^CP_/ || $2 ~ /^CPUSTATES$/ || $2 ~ /^CTLIOCGINFO$/ || $2 ~ /^ALG_/ || $2 ~ /^FI(CLONE|DEDUPERANGE)/ || $2 ~ /^FS_(POLICY_FLAGS|KEY_DESC|ENCRYPTION_MODE|[A-Z0-9_]+_KEY_SIZE)/ || $2 ~ /^FS_IOC_.*(ENCRYPTION|VERITY|[GS]ETFLAGS)/ || $2 ~ /^FS_VERITY_/ || $2 ~ /^FSCRYPT_/ || $2 ~ /^DM_/ || $2 ~ /^GRND_/ || $2 ~ /^RND/ || $2 ~ /^KEY_(SPEC|REQKEY_DEFL)_/ || $2 ~ /^KEYCTL_/ || $2 ~ /^PERF_/ || $2 ~ /^SECCOMP_/ || $2 ~ /^SEEK_/ || $2 ~ /^SCHED_/ || $2 ~ /^SPLICE_/ || $2 ~ /^SYNC_FILE_RANGE_/ || $2 !~ /IOC_MAGIC/ && $2 ~ /^[A-Z][A-Z0-9_]+_MAGIC2?$/ || $2 ~ /^(VM|VMADDR)_/ || $2 ~ /^(IOCTL_VM_SOCKETS_|IOCTL_MEI_)/ || $2 ~ /^(TASKSTATS|TS)_/ || $2 ~ /^CGROUPSTATS_/ || $2 ~ /^GENL_/ || $2 ~ /^STATX_/ || $2 ~ /^RENAME/ || $2 ~ /^UBI_IOC[A-Z]/ || $2 ~ /^UTIME_/ || $2 ~ /^XATTR_(CREATE|REPLACE|NO(DEFAULT|FOLLOW|SECURITY)|SHOWCOMPRESSION)/ || $2 ~ /^ATTR_(BIT_MAP_COUNT|(CMN|VOL|FILE)_)/ || $2 ~ /^FSOPT_/ || $2 ~ /^WDIO[CFS]_/ || $2 ~ /^NFN/ || $2 !~ /^NFT_META_IIFTYPE/ && $2 ~ /^NFT_/ || $2 ~ /^NF_NAT_/ || $2 ~ /^XDP_/ || $2 ~ /^RWF_/ || $2 ~ /^(HDIO|WIN|SMART)_/ || $2 ~ /^CRYPTO_/ || $2 ~ /^TIPC_/ || $2 !~ "DEVLINK_RELOAD_LIMITS_VALID_MASK" && $2 ~ /^DEVLINK_/ || $2 ~ /^ETHTOOL_/ || $2 ~ /^LWTUNNEL_IP/ || $2 ~ /^ITIMER_/ || $2 !~ "WMESGLEN" && $2 ~ /^W[A-Z0-9]+$/ || $2 ~ /^P_/ || $2 ~/^PPPIOC/ || $2 ~ /^FAN_|FANOTIFY_/ || $2 == "HID_MAX_DESCRIPTOR_SIZE" || $2 ~ /^_?HIDIOC/ || $2 ~ /^BUS_(USB|HIL|BLUETOOTH|VIRTUAL)$/ || $2 ~ /^MTD/ || $2 ~ /^OTP/ || $2 ~ /^MEM/ || $2 ~ /^WG/ || $2 ~ /^FIB_RULE_/ || $2 ~ /^BLK[A-Z]*(GET$|SET$|BUF$|PART$|SIZE|IOMIN$|IOOPT$|ALIGNOFF$|DISCARD|ROTATIONAL$|ZEROOUT$|GETDISKSEQ$)/ {printf("\t%s = C.%s\n", $2, $2)} $2 ~ /^__WCOREFLAG$/ {next} $2 ~ /^__W[A-Z0-9]+$/ {printf("\t%s = C.%s\n", substr($2,3), $2)} {next} ' | sort echo ')' ) >_const.go # Pull out the error names for later. errors=$( echo '#include ' | $CC -x c - -E -dM $ccflags | awk '$1=="#define" && $2 ~ /^E[A-Z0-9_]+$/ { print $2 }' | sort ) # Pull out the signal names for later. signals=$( echo '#include ' | $CC -x c - -E -dM $ccflags | awk '$1=="#define" && $2 ~ /^SIG[A-Z0-9]+$/ { print $2 }' | grep -E -v '(SIGSTKSIZE|SIGSTKSZ|SIGRT|SIGMAX64)' | sort ) # Again, writing regexps to a file. echo '#include ' | $CC -x c - -E -dM $ccflags | awk '$1=="#define" && $2 ~ /^E[A-Z0-9_]+$/ { print "^\t" $2 "[ \t]*=" }' | sort >_error.grep echo '#include ' | $CC -x c - -E -dM $ccflags | awk '$1=="#define" && $2 ~ /^SIG[A-Z0-9]+$/ { print "^\t" $2 "[ \t]*=" }' | grep -E -v '(SIGSTKSIZE|SIGSTKSZ|SIGRT|SIGMAX64)' | sort >_signal.grep echo '// mkerrors.sh' "$@" echo '// Code generated by the command above; see README.md. DO NOT EDIT.' echo echo "//go:build ${GOARCH} && ${GOOS}" echo go tool cgo -godefs -- "$@" _const.go >_error.out cat _error.out | grep -vf _error.grep | grep -vf _signal.grep echo echo '// Errors' echo 'const (' cat _error.out | grep -f _error.grep | sed 's/=\(.*\)/= syscall.Errno(\1)/' echo ')' echo echo '// Signals' echo 'const (' cat _error.out | grep -f _signal.grep | sed 's/=\(.*\)/= syscall.Signal(\1)/' echo ')' # Run C program to print error and syscall strings. ( echo -E " #include #include #include #include #include #include #define nelem(x) (sizeof(x)/sizeof((x)[0])) enum { A = 'A', Z = 'Z', a = 'a', z = 'z' }; // avoid need for single quotes below struct tuple { int num; const char *name; }; struct tuple errors[] = { " for i in $errors do echo -E ' {'$i', "'$i'" },' done echo -E " }; struct tuple signals[] = { " for i in $signals do echo -E ' {'$i', "'$i'" },' done # Use -E because on some systems bash builtin interprets \n itself. echo -E ' }; static int tuplecmp(const void *a, const void *b) { return ((struct tuple *)a)->num - ((struct tuple *)b)->num; } int main(void) { int i, e; char buf[1024], *p; printf("\n\n// Error table\n"); printf("var errorList = [...]struct {\n"); printf("\tnum syscall.Errno\n"); printf("\tname string\n"); printf("\tdesc string\n"); printf("} {\n"); qsort(errors, nelem(errors), sizeof errors[0], tuplecmp); for(i=0; i 0 && errors[i-1].num == e) continue; strncpy(buf, strerror(e), sizeof(buf) - 1); buf[sizeof(buf) - 1] = '\0'; // lowercase first letter: Bad -> bad, but STREAM -> STREAM. if(A <= buf[0] && buf[0] <= Z && a <= buf[1] && buf[1] <= z) buf[0] += a - A; printf("\t{ %d, \"%s\", \"%s\" },\n", e, errors[i].name, buf); } printf("}\n\n"); printf("\n\n// Signal table\n"); printf("var signalList = [...]struct {\n"); printf("\tnum syscall.Signal\n"); printf("\tname string\n"); printf("\tdesc string\n"); printf("} {\n"); qsort(signals, nelem(signals), sizeof signals[0], tuplecmp); for(i=0; i 0 && signals[i-1].num == e) continue; strncpy(buf, strsignal(e), sizeof(buf) - 1); buf[sizeof(buf) - 1] = '\0'; // lowercase first letter: Bad -> bad, but STREAM -> STREAM. if(A <= buf[0] && buf[0] <= Z && a <= buf[1] && buf[1] <= z) buf[0] += a - A; // cut trailing : number. p = strrchr(buf, ":"[0]); if(p) *p = '\0'; printf("\t{ %d, \"%s\", \"%s\" },\n", e, signals[i].name, buf); } printf("}\n\n"); return 0; } ' ) >_errors.c $CC $ccflags -o _errors _errors.c && $GORUN ./_errors && rm -f _errors.c _errors _const.go _error.grep _signal.grep _error.out ================================================ FILE: vendor/golang.org/x/sys/unix/mmap_nomremap.go ================================================ // Copyright 2023 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build aix || darwin || dragonfly || freebsd || openbsd || solaris || zos package unix var mapper = &mmapper{ active: make(map[*byte][]byte), mmap: mmap, munmap: munmap, } ================================================ FILE: vendor/golang.org/x/sys/unix/mremap.go ================================================ // Copyright 2023 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build linux || netbsd package unix import "unsafe" type mremapMmapper struct { mmapper mremap func(oldaddr uintptr, oldlength uintptr, newlength uintptr, flags int, newaddr uintptr) (xaddr uintptr, err error) } var mapper = &mremapMmapper{ mmapper: mmapper{ active: make(map[*byte][]byte), mmap: mmap, munmap: munmap, }, mremap: mremap, } func (m *mremapMmapper) Mremap(oldData []byte, newLength int, flags int) (data []byte, err error) { if newLength <= 0 || len(oldData) == 0 || len(oldData) != cap(oldData) || flags&mremapFixed != 0 { return nil, EINVAL } pOld := &oldData[cap(oldData)-1] m.Lock() defer m.Unlock() bOld := m.active[pOld] if bOld == nil || &bOld[0] != &oldData[0] { return nil, EINVAL } newAddr, errno := m.mremap(uintptr(unsafe.Pointer(&bOld[0])), uintptr(len(bOld)), uintptr(newLength), flags, 0) if errno != nil { return nil, errno } bNew := unsafe.Slice((*byte)(unsafe.Pointer(newAddr)), newLength) pNew := &bNew[cap(bNew)-1] if flags&mremapDontunmap == 0 { delete(m.active, pOld) } m.active[pNew] = bNew return bNew, nil } func Mremap(oldData []byte, newLength int, flags int) (data []byte, err error) { return mapper.Mremap(oldData, newLength, flags) } func MremapPtr(oldAddr unsafe.Pointer, oldSize uintptr, newAddr unsafe.Pointer, newSize uintptr, flags int) (ret unsafe.Pointer, err error) { xaddr, err := mapper.mremap(uintptr(oldAddr), oldSize, newSize, flags, uintptr(newAddr)) return unsafe.Pointer(xaddr), err } ================================================ FILE: vendor/golang.org/x/sys/unix/pagesize_unix.go ================================================ // Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos // For Unix, get the pagesize from the runtime. package unix import "syscall" func Getpagesize() int { return syscall.Getpagesize() } ================================================ FILE: vendor/golang.org/x/sys/unix/pledge_openbsd.go ================================================ // Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package unix import ( "errors" "fmt" "strconv" ) // Pledge implements the pledge syscall. // // This changes both the promises and execpromises; use PledgePromises or // PledgeExecpromises to only change the promises or execpromises // respectively. // // For more information see pledge(2). func Pledge(promises, execpromises string) error { if err := pledgeAvailable(); err != nil { return err } pptr, err := BytePtrFromString(promises) if err != nil { return err } exptr, err := BytePtrFromString(execpromises) if err != nil { return err } return pledge(pptr, exptr) } // PledgePromises implements the pledge syscall. // // This changes the promises and leaves the execpromises untouched. // // For more information see pledge(2). func PledgePromises(promises string) error { if err := pledgeAvailable(); err != nil { return err } pptr, err := BytePtrFromString(promises) if err != nil { return err } return pledge(pptr, nil) } // PledgeExecpromises implements the pledge syscall. // // This changes the execpromises and leaves the promises untouched. // // For more information see pledge(2). func PledgeExecpromises(execpromises string) error { if err := pledgeAvailable(); err != nil { return err } exptr, err := BytePtrFromString(execpromises) if err != nil { return err } return pledge(nil, exptr) } // majmin returns major and minor version number for an OpenBSD system. func majmin() (major int, minor int, err error) { var v Utsname err = Uname(&v) if err != nil { return } major, err = strconv.Atoi(string(v.Release[0])) if err != nil { err = errors.New("cannot parse major version number returned by uname") return } minor, err = strconv.Atoi(string(v.Release[2])) if err != nil { err = errors.New("cannot parse minor version number returned by uname") return } return } // pledgeAvailable checks for availability of the pledge(2) syscall // based on the running OpenBSD version. func pledgeAvailable() error { maj, min, err := majmin() if err != nil { return err } // Require OpenBSD 6.4 as a minimum. if maj < 6 || (maj == 6 && min <= 3) { return fmt.Errorf("cannot call Pledge on OpenBSD %d.%d", maj, min) } return nil } ================================================ FILE: vendor/golang.org/x/sys/unix/ptrace_darwin.go ================================================ // Copyright 2020 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build darwin && !ios package unix func ptrace(request int, pid int, addr uintptr, data uintptr) error { return ptrace1(request, pid, addr, data) } ================================================ FILE: vendor/golang.org/x/sys/unix/ptrace_ios.go ================================================ // Copyright 2020 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build ios package unix func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) { return ENOTSUP } ================================================ FILE: vendor/golang.org/x/sys/unix/race.go ================================================ // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build (darwin && race) || (linux && race) || (freebsd && race) package unix import ( "runtime" "unsafe" ) const raceenabled = true func raceAcquire(addr unsafe.Pointer) { runtime.RaceAcquire(addr) } func raceReleaseMerge(addr unsafe.Pointer) { runtime.RaceReleaseMerge(addr) } func raceReadRange(addr unsafe.Pointer, len int) { runtime.RaceReadRange(addr, len) } func raceWriteRange(addr unsafe.Pointer, len int) { runtime.RaceWriteRange(addr, len) } ================================================ FILE: vendor/golang.org/x/sys/unix/race0.go ================================================ // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build aix || (darwin && !race) || (linux && !race) || (freebsd && !race) || netbsd || openbsd || solaris || dragonfly || zos package unix import ( "unsafe" ) const raceenabled = false func raceAcquire(addr unsafe.Pointer) { } func raceReleaseMerge(addr unsafe.Pointer) { } func raceReadRange(addr unsafe.Pointer, len int) { } func raceWriteRange(addr unsafe.Pointer, len int) { } ================================================ FILE: vendor/golang.org/x/sys/unix/readdirent_getdents.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build aix || dragonfly || freebsd || linux || netbsd || openbsd package unix // ReadDirent reads directory entries from fd and writes them into buf. func ReadDirent(fd int, buf []byte) (n int, err error) { return Getdents(fd, buf) } ================================================ FILE: vendor/golang.org/x/sys/unix/readdirent_getdirentries.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build darwin || zos package unix import "unsafe" // ReadDirent reads directory entries from fd and writes them into buf. func ReadDirent(fd int, buf []byte) (n int, err error) { // Final argument is (basep *uintptr) and the syscall doesn't take nil. // 64 bits should be enough. (32 bits isn't even on 386). Since the // actual system call is getdirentries64, 64 is a good guess. // TODO(rsc): Can we use a single global basep for all calls? var base = (*uintptr)(unsafe.Pointer(new(uint64))) return Getdirentries(fd, buf, base) } ================================================ FILE: vendor/golang.org/x/sys/unix/sockcmsg_dragonfly.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package unix // Round the length of a raw sockaddr up to align it properly. func cmsgAlignOf(salen int) int { salign := SizeofPtr if SizeofPtr == 8 && !supportsABI(_dragonflyABIChangeVersion) { // 64-bit Dragonfly before the September 2019 ABI changes still requires // 32-bit aligned access to network subsystem. salign = 4 } return (salen + salign - 1) & ^(salign - 1) } ================================================ FILE: vendor/golang.org/x/sys/unix/sockcmsg_linux.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Socket control messages package unix import "unsafe" // UnixCredentials encodes credentials into a socket control message // for sending to another process. This can be used for // authentication. func UnixCredentials(ucred *Ucred) []byte { b := make([]byte, CmsgSpace(SizeofUcred)) h := (*Cmsghdr)(unsafe.Pointer(&b[0])) h.Level = SOL_SOCKET h.Type = SCM_CREDENTIALS h.SetLen(CmsgLen(SizeofUcred)) *(*Ucred)(h.data(0)) = *ucred return b } // ParseUnixCredentials decodes a socket control message that contains // credentials in a Ucred structure. To receive such a message, the // SO_PASSCRED option must be enabled on the socket. func ParseUnixCredentials(m *SocketControlMessage) (*Ucred, error) { if m.Header.Level != SOL_SOCKET { return nil, EINVAL } if m.Header.Type != SCM_CREDENTIALS { return nil, EINVAL } ucred := *(*Ucred)(unsafe.Pointer(&m.Data[0])) return &ucred, nil } // PktInfo4 encodes Inet4Pktinfo into a socket control message of type IP_PKTINFO. func PktInfo4(info *Inet4Pktinfo) []byte { b := make([]byte, CmsgSpace(SizeofInet4Pktinfo)) h := (*Cmsghdr)(unsafe.Pointer(&b[0])) h.Level = SOL_IP h.Type = IP_PKTINFO h.SetLen(CmsgLen(SizeofInet4Pktinfo)) *(*Inet4Pktinfo)(h.data(0)) = *info return b } // PktInfo6 encodes Inet6Pktinfo into a socket control message of type IPV6_PKTINFO. func PktInfo6(info *Inet6Pktinfo) []byte { b := make([]byte, CmsgSpace(SizeofInet6Pktinfo)) h := (*Cmsghdr)(unsafe.Pointer(&b[0])) h.Level = SOL_IPV6 h.Type = IPV6_PKTINFO h.SetLen(CmsgLen(SizeofInet6Pktinfo)) *(*Inet6Pktinfo)(h.data(0)) = *info return b } // ParseOrigDstAddr decodes a socket control message containing the original // destination address. To receive such a message the IP_RECVORIGDSTADDR or // IPV6_RECVORIGDSTADDR option must be enabled on the socket. func ParseOrigDstAddr(m *SocketControlMessage) (Sockaddr, error) { switch { case m.Header.Level == SOL_IP && m.Header.Type == IP_ORIGDSTADDR: pp := (*RawSockaddrInet4)(unsafe.Pointer(&m.Data[0])) sa := new(SockaddrInet4) p := (*[2]byte)(unsafe.Pointer(&pp.Port)) sa.Port = int(p[0])<<8 + int(p[1]) sa.Addr = pp.Addr return sa, nil case m.Header.Level == SOL_IPV6 && m.Header.Type == IPV6_ORIGDSTADDR: pp := (*RawSockaddrInet6)(unsafe.Pointer(&m.Data[0])) sa := new(SockaddrInet6) p := (*[2]byte)(unsafe.Pointer(&pp.Port)) sa.Port = int(p[0])<<8 + int(p[1]) sa.ZoneId = pp.Scope_id sa.Addr = pp.Addr return sa, nil default: return nil, EINVAL } } ================================================ FILE: vendor/golang.org/x/sys/unix/sockcmsg_unix.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos // Socket control messages package unix import ( "unsafe" ) // CmsgLen returns the value to store in the Len field of the Cmsghdr // structure, taking into account any necessary alignment. func CmsgLen(datalen int) int { return cmsgAlignOf(SizeofCmsghdr) + datalen } // CmsgSpace returns the number of bytes an ancillary element with // payload of the passed data length occupies. func CmsgSpace(datalen int) int { return cmsgAlignOf(SizeofCmsghdr) + cmsgAlignOf(datalen) } func (h *Cmsghdr) data(offset uintptr) unsafe.Pointer { return unsafe.Pointer(uintptr(unsafe.Pointer(h)) + uintptr(cmsgAlignOf(SizeofCmsghdr)) + offset) } // SocketControlMessage represents a socket control message. type SocketControlMessage struct { Header Cmsghdr Data []byte } // ParseSocketControlMessage parses b as an array of socket control // messages. func ParseSocketControlMessage(b []byte) ([]SocketControlMessage, error) { var msgs []SocketControlMessage i := 0 for i+CmsgLen(0) <= len(b) { h, dbuf, err := socketControlMessageHeaderAndData(b[i:]) if err != nil { return nil, err } m := SocketControlMessage{Header: *h, Data: dbuf} msgs = append(msgs, m) i += cmsgAlignOf(int(h.Len)) } return msgs, nil } // ParseOneSocketControlMessage parses a single socket control message from b, returning the message header, // message data (a slice of b), and the remainder of b after that single message. // When there are no remaining messages, len(remainder) == 0. func ParseOneSocketControlMessage(b []byte) (hdr Cmsghdr, data []byte, remainder []byte, err error) { h, dbuf, err := socketControlMessageHeaderAndData(b) if err != nil { return Cmsghdr{}, nil, nil, err } if i := cmsgAlignOf(int(h.Len)); i < len(b) { remainder = b[i:] } return *h, dbuf, remainder, nil } func socketControlMessageHeaderAndData(b []byte) (*Cmsghdr, []byte, error) { h := (*Cmsghdr)(unsafe.Pointer(&b[0])) if h.Len < SizeofCmsghdr || uint64(h.Len) > uint64(len(b)) { return nil, nil, EINVAL } return h, b[cmsgAlignOf(SizeofCmsghdr):h.Len], nil } // UnixRights encodes a set of open file descriptors into a socket // control message for sending to another process. func UnixRights(fds ...int) []byte { datalen := len(fds) * 4 b := make([]byte, CmsgSpace(datalen)) h := (*Cmsghdr)(unsafe.Pointer(&b[0])) h.Level = SOL_SOCKET h.Type = SCM_RIGHTS h.SetLen(CmsgLen(datalen)) for i, fd := range fds { *(*int32)(h.data(4 * uintptr(i))) = int32(fd) } return b } // ParseUnixRights decodes a socket control message that contains an // integer array of open file descriptors from another process. func ParseUnixRights(m *SocketControlMessage) ([]int, error) { if m.Header.Level != SOL_SOCKET { return nil, EINVAL } if m.Header.Type != SCM_RIGHTS { return nil, EINVAL } fds := make([]int, len(m.Data)>>2) for i, j := 0, 0; i < len(m.Data); i += 4 { fds[j] = int(*(*int32)(unsafe.Pointer(&m.Data[i]))) j++ } return fds, nil } ================================================ FILE: vendor/golang.org/x/sys/unix/sockcmsg_unix_other.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build aix || darwin || freebsd || linux || netbsd || openbsd || solaris || zos package unix import ( "runtime" ) // Round the length of a raw sockaddr up to align it properly. func cmsgAlignOf(salen int) int { salign := SizeofPtr // dragonfly needs to check ABI version at runtime, see cmsgAlignOf in // sockcmsg_dragonfly.go switch runtime.GOOS { case "aix": // There is no alignment on AIX. salign = 1 case "darwin", "ios", "illumos", "solaris": // NOTE: It seems like 64-bit Darwin, Illumos and Solaris // kernels still require 32-bit aligned access to network // subsystem. if SizeofPtr == 8 { salign = 4 } case "netbsd", "openbsd": // NetBSD and OpenBSD armv7 require 64-bit alignment. if runtime.GOARCH == "arm" { salign = 8 } // NetBSD aarch64 requires 128-bit alignment. if runtime.GOOS == "netbsd" && runtime.GOARCH == "arm64" { salign = 16 } case "zos": // z/OS socket macros use [32-bit] sizeof(int) alignment, // not pointer width. salign = SizeofInt } return (salen + salign - 1) & ^(salign - 1) } ================================================ FILE: vendor/golang.org/x/sys/unix/sockcmsg_zos.go ================================================ // Copyright 2024 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Socket control messages package unix import "unsafe" // UnixCredentials encodes credentials into a socket control message // for sending to another process. This can be used for // authentication. func UnixCredentials(ucred *Ucred) []byte { b := make([]byte, CmsgSpace(SizeofUcred)) h := (*Cmsghdr)(unsafe.Pointer(&b[0])) h.Level = SOL_SOCKET h.Type = SCM_CREDENTIALS h.SetLen(CmsgLen(SizeofUcred)) *(*Ucred)(h.data(0)) = *ucred return b } // ParseUnixCredentials decodes a socket control message that contains // credentials in a Ucred structure. To receive such a message, the // SO_PASSCRED option must be enabled on the socket. func ParseUnixCredentials(m *SocketControlMessage) (*Ucred, error) { if m.Header.Level != SOL_SOCKET { return nil, EINVAL } if m.Header.Type != SCM_CREDENTIALS { return nil, EINVAL } ucred := *(*Ucred)(unsafe.Pointer(&m.Data[0])) return &ucred, nil } // PktInfo4 encodes Inet4Pktinfo into a socket control message of type IP_PKTINFO. func PktInfo4(info *Inet4Pktinfo) []byte { b := make([]byte, CmsgSpace(SizeofInet4Pktinfo)) h := (*Cmsghdr)(unsafe.Pointer(&b[0])) h.Level = SOL_IP h.Type = IP_PKTINFO h.SetLen(CmsgLen(SizeofInet4Pktinfo)) *(*Inet4Pktinfo)(h.data(0)) = *info return b } // PktInfo6 encodes Inet6Pktinfo into a socket control message of type IPV6_PKTINFO. func PktInfo6(info *Inet6Pktinfo) []byte { b := make([]byte, CmsgSpace(SizeofInet6Pktinfo)) h := (*Cmsghdr)(unsafe.Pointer(&b[0])) h.Level = SOL_IPV6 h.Type = IPV6_PKTINFO h.SetLen(CmsgLen(SizeofInet6Pktinfo)) *(*Inet6Pktinfo)(h.data(0)) = *info return b } ================================================ FILE: vendor/golang.org/x/sys/unix/symaddr_zos_s390x.s ================================================ // Copyright 2024 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build zos && s390x && gc #include "textflag.h" // provide the address of function variable to be fixed up. TEXT ·getPipe2Addr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Pipe2(SB), R8 MOVD R8, ret+0(FP) RET TEXT ·get_FlockAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Flock(SB), R8 MOVD R8, ret+0(FP) RET TEXT ·get_GetxattrAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Getxattr(SB), R8 MOVD R8, ret+0(FP) RET TEXT ·get_NanosleepAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Nanosleep(SB), R8 MOVD R8, ret+0(FP) RET TEXT ·get_SetxattrAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Setxattr(SB), R8 MOVD R8, ret+0(FP) RET TEXT ·get_Wait4Addr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Wait4(SB), R8 MOVD R8, ret+0(FP) RET TEXT ·get_MountAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Mount(SB), R8 MOVD R8, ret+0(FP) RET TEXT ·get_UnmountAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Unmount(SB), R8 MOVD R8, ret+0(FP) RET TEXT ·get_UtimesNanoAtAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·UtimesNanoAt(SB), R8 MOVD R8, ret+0(FP) RET TEXT ·get_UtimesNanoAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·UtimesNano(SB), R8 MOVD R8, ret+0(FP) RET TEXT ·get_MkfifoatAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Mkfifoat(SB), R8 MOVD R8, ret+0(FP) RET TEXT ·get_ChtagAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Chtag(SB), R8 MOVD R8, ret+0(FP) RET TEXT ·get_ReadlinkatAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Readlinkat(SB), R8 MOVD R8, ret+0(FP) RET ================================================ FILE: vendor/golang.org/x/sys/unix/syscall.go ================================================ // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos // Package unix contains an interface to the low-level operating system // primitives. OS details vary depending on the underlying system, and // by default, godoc will display OS-specific documentation for the current // system. If you want godoc to display OS documentation for another // system, set $GOOS and $GOARCH to the desired system. For example, if // you want to view documentation for freebsd/arm on linux/amd64, set $GOOS // to freebsd and $GOARCH to arm. // // The primary use of this package is inside other packages that provide a more // portable interface to the system, such as "os", "time" and "net". Use // those packages rather than this one if you can. // // For details of the functions and data types in this package consult // the manuals for the appropriate operating system. // // These calls return err == nil to indicate success; otherwise // err represents an operating system error describing the failure and // holds a value of type syscall.Errno. package unix // import "golang.org/x/sys/unix" import ( "bytes" "strings" "unsafe" ) // ByteSliceFromString returns a NUL-terminated slice of bytes // containing the text of s. If s contains a NUL byte at any // location, it returns (nil, EINVAL). func ByteSliceFromString(s string) ([]byte, error) { if strings.IndexByte(s, 0) != -1 { return nil, EINVAL } a := make([]byte, len(s)+1) copy(a, s) return a, nil } // BytePtrFromString returns a pointer to a NUL-terminated array of // bytes containing the text of s. If s contains a NUL byte at any // location, it returns (nil, EINVAL). func BytePtrFromString(s string) (*byte, error) { a, err := ByteSliceFromString(s) if err != nil { return nil, err } return &a[0], nil } // ByteSliceToString returns a string form of the text represented by the slice s, with a terminating NUL and any // bytes after the NUL removed. func ByteSliceToString(s []byte) string { if i := bytes.IndexByte(s, 0); i != -1 { s = s[:i] } return string(s) } // BytePtrToString takes a pointer to a sequence of text and returns the corresponding string. // If the pointer is nil, it returns the empty string. It assumes that the text sequence is terminated // at a zero byte; if the zero byte is not present, the program may crash. func BytePtrToString(p *byte) string { if p == nil { return "" } if *p == 0 { return "" } // Find NUL terminator. n := 0 for ptr := unsafe.Pointer(p); *(*byte)(ptr) != 0; n++ { ptr = unsafe.Pointer(uintptr(ptr) + 1) } return string(unsafe.Slice(p, n)) } // Single-word zero for use when we need a valid pointer to 0 bytes. var _zero uintptr ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_aix.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build aix // Aix system calls. // This file is compiled as ordinary Go code, // but it is also input to mksyscall, // which parses the //sys lines and generates system call stubs. // Note that sometimes we use a lowercase //sys name and // wrap it in our own nicer implementation. package unix import "unsafe" /* * Wrapped */ func Access(path string, mode uint32) (err error) { return Faccessat(AT_FDCWD, path, mode, 0) } func Chmod(path string, mode uint32) (err error) { return Fchmodat(AT_FDCWD, path, mode, 0) } func Chown(path string, uid int, gid int) (err error) { return Fchownat(AT_FDCWD, path, uid, gid, 0) } func Creat(path string, mode uint32) (fd int, err error) { return Open(path, O_CREAT|O_WRONLY|O_TRUNC, mode) } //sys utimes(path string, times *[2]Timeval) (err error) func Utimes(path string, tv []Timeval) error { if len(tv) != 2 { return EINVAL } return utimes(path, (*[2]Timeval)(unsafe.Pointer(&tv[0]))) } //sys utimensat(dirfd int, path string, times *[2]Timespec, flag int) (err error) func UtimesNano(path string, ts []Timespec) error { if len(ts) != 2 { return EINVAL } return utimensat(AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0) } func UtimesNanoAt(dirfd int, path string, ts []Timespec, flags int) error { if ts == nil { return utimensat(dirfd, path, nil, flags) } if len(ts) != 2 { return EINVAL } return utimensat(dirfd, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), flags) } func (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, _Socklen, error) { if sa.Port < 0 || sa.Port > 0xFFFF { return nil, 0, EINVAL } sa.raw.Family = AF_INET p := (*[2]byte)(unsafe.Pointer(&sa.raw.Port)) p[0] = byte(sa.Port >> 8) p[1] = byte(sa.Port) sa.raw.Addr = sa.Addr return unsafe.Pointer(&sa.raw), SizeofSockaddrInet4, nil } func (sa *SockaddrInet6) sockaddr() (unsafe.Pointer, _Socklen, error) { if sa.Port < 0 || sa.Port > 0xFFFF { return nil, 0, EINVAL } sa.raw.Family = AF_INET6 p := (*[2]byte)(unsafe.Pointer(&sa.raw.Port)) p[0] = byte(sa.Port >> 8) p[1] = byte(sa.Port) sa.raw.Scope_id = sa.ZoneId sa.raw.Addr = sa.Addr return unsafe.Pointer(&sa.raw), SizeofSockaddrInet6, nil } func (sa *SockaddrUnix) sockaddr() (unsafe.Pointer, _Socklen, error) { name := sa.Name n := len(name) if n > len(sa.raw.Path) { return nil, 0, EINVAL } if n == len(sa.raw.Path) && name[0] != '@' { return nil, 0, EINVAL } sa.raw.Family = AF_UNIX for i := 0; i < n; i++ { sa.raw.Path[i] = uint8(name[i]) } // length is family (uint16), name, NUL. sl := _Socklen(2) if n > 0 { sl += _Socklen(n) + 1 } if sa.raw.Path[0] == '@' || (sa.raw.Path[0] == 0 && sl > 3) { // Check sl > 3 so we don't change unnamed socket behavior. sa.raw.Path[0] = 0 // Don't count trailing NUL for abstract address. sl-- } return unsafe.Pointer(&sa.raw), sl, nil } func Getsockname(fd int) (sa Sockaddr, err error) { var rsa RawSockaddrAny var len _Socklen = SizeofSockaddrAny if err = getsockname(fd, &rsa, &len); err != nil { return } return anyToSockaddr(fd, &rsa) } //sys getcwd(buf []byte) (err error) const ImplementsGetwd = true func Getwd() (ret string, err error) { for len := uint64(4096); ; len *= 2 { b := make([]byte, len) err := getcwd(b) if err == nil { i := 0 for b[i] != 0 { i++ } return string(b[0:i]), nil } if err != ERANGE { return "", err } } } func Getcwd(buf []byte) (n int, err error) { err = getcwd(buf) if err == nil { i := 0 for buf[i] != 0 { i++ } n = i + 1 } return } func Getgroups() (gids []int, err error) { n, err := getgroups(0, nil) if err != nil { return nil, err } if n == 0 { return nil, nil } // Sanity check group count. Max is 16 on BSD. if n < 0 || n > 1000 { return nil, EINVAL } a := make([]_Gid_t, n) n, err = getgroups(n, &a[0]) if err != nil { return nil, err } gids = make([]int, n) for i, v := range a[0:n] { gids[i] = int(v) } return } func Setgroups(gids []int) (err error) { if len(gids) == 0 { return setgroups(0, nil) } a := make([]_Gid_t, len(gids)) for i, v := range gids { a[i] = _Gid_t(v) } return setgroups(len(a), &a[0]) } /* * Socket */ //sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) func Accept(fd int) (nfd int, sa Sockaddr, err error) { var rsa RawSockaddrAny var len _Socklen = SizeofSockaddrAny nfd, err = accept(fd, &rsa, &len) if nfd == -1 { return } sa, err = anyToSockaddr(fd, &rsa) if err != nil { Close(nfd) nfd = 0 } return } func recvmsgRaw(fd int, iov []Iovec, oob []byte, flags int, rsa *RawSockaddrAny) (n, oobn int, recvflags int, err error) { var msg Msghdr msg.Name = (*byte)(unsafe.Pointer(rsa)) msg.Namelen = uint32(SizeofSockaddrAny) var dummy byte if len(oob) > 0 { // receive at least one normal byte if emptyIovecs(iov) { var iova [1]Iovec iova[0].Base = &dummy iova[0].SetLen(1) iov = iova[:] } msg.Control = (*byte)(unsafe.Pointer(&oob[0])) msg.SetControllen(len(oob)) } if len(iov) > 0 { msg.Iov = &iov[0] msg.SetIovlen(len(iov)) } if n, err = recvmsg(fd, &msg, flags); n == -1 { return } oobn = int(msg.Controllen) recvflags = int(msg.Flags) return } func sendmsgN(fd int, iov []Iovec, oob []byte, ptr unsafe.Pointer, salen _Socklen, flags int) (n int, err error) { var msg Msghdr msg.Name = (*byte)(unsafe.Pointer(ptr)) msg.Namelen = uint32(salen) var dummy byte var empty bool if len(oob) > 0 { // send at least one normal byte empty = emptyIovecs(iov) if empty { var iova [1]Iovec iova[0].Base = &dummy iova[0].SetLen(1) iov = iova[:] } msg.Control = (*byte)(unsafe.Pointer(&oob[0])) msg.SetControllen(len(oob)) } if len(iov) > 0 { msg.Iov = &iov[0] msg.SetIovlen(len(iov)) } if n, err = sendmsg(fd, &msg, flags); err != nil { return 0, err } if len(oob) > 0 && empty { n = 0 } return n, nil } func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) { switch rsa.Addr.Family { case AF_UNIX: pp := (*RawSockaddrUnix)(unsafe.Pointer(rsa)) sa := new(SockaddrUnix) // Some versions of AIX have a bug in getsockname (see IV78655). // We can't rely on sa.Len being set correctly. n := SizeofSockaddrUnix - 3 // subtract leading Family, Len, terminating NUL. for i := 0; i < n; i++ { if pp.Path[i] == 0 { n = i break } } sa.Name = string(unsafe.Slice((*byte)(unsafe.Pointer(&pp.Path[0])), n)) return sa, nil case AF_INET: pp := (*RawSockaddrInet4)(unsafe.Pointer(rsa)) sa := new(SockaddrInet4) p := (*[2]byte)(unsafe.Pointer(&pp.Port)) sa.Port = int(p[0])<<8 + int(p[1]) sa.Addr = pp.Addr return sa, nil case AF_INET6: pp := (*RawSockaddrInet6)(unsafe.Pointer(rsa)) sa := new(SockaddrInet6) p := (*[2]byte)(unsafe.Pointer(&pp.Port)) sa.Port = int(p[0])<<8 + int(p[1]) sa.ZoneId = pp.Scope_id sa.Addr = pp.Addr return sa, nil } return nil, EAFNOSUPPORT } func Gettimeofday(tv *Timeval) (err error) { err = gettimeofday(tv, nil) return } func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { if raceenabled { raceReleaseMerge(unsafe.Pointer(&ioSync)) } return sendfile(outfd, infd, offset, count) } // TODO func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { return -1, ENOSYS } func direntIno(buf []byte) (uint64, bool) { return readInt(buf, unsafe.Offsetof(Dirent{}.Ino), unsafe.Sizeof(Dirent{}.Ino)) } func direntReclen(buf []byte) (uint64, bool) { return readInt(buf, unsafe.Offsetof(Dirent{}.Reclen), unsafe.Sizeof(Dirent{}.Reclen)) } func direntNamlen(buf []byte) (uint64, bool) { reclen, ok := direntReclen(buf) if !ok { return 0, false } return reclen - uint64(unsafe.Offsetof(Dirent{}.Name)), true } //sys getdirent(fd int, buf []byte) (n int, err error) func Getdents(fd int, buf []byte) (n int, err error) { return getdirent(fd, buf) } //sys wait4(pid Pid_t, status *_C_int, options int, rusage *Rusage) (wpid Pid_t, err error) func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, err error) { var status _C_int var r Pid_t err = ERESTART // AIX wait4 may return with ERESTART errno, while the process is still // active. for err == ERESTART { r, err = wait4(Pid_t(pid), &status, options, rusage) } wpid = int(r) if wstatus != nil { *wstatus = WaitStatus(status) } return } /* * Wait */ type WaitStatus uint32 func (w WaitStatus) Stopped() bool { return w&0x40 != 0 } func (w WaitStatus) StopSignal() Signal { if !w.Stopped() { return -1 } return Signal(w>>8) & 0xFF } func (w WaitStatus) Exited() bool { return w&0xFF == 0 } func (w WaitStatus) ExitStatus() int { if !w.Exited() { return -1 } return int((w >> 8) & 0xFF) } func (w WaitStatus) Signaled() bool { return w&0x40 == 0 && w&0xFF != 0 } func (w WaitStatus) Signal() Signal { if !w.Signaled() { return -1 } return Signal(w>>16) & 0xFF } func (w WaitStatus) Continued() bool { return w&0x01000000 != 0 } func (w WaitStatus) CoreDump() bool { return w&0x80 == 0x80 } func (w WaitStatus) TrapCause() int { return -1 } //sys ioctl(fd int, req int, arg uintptr) (err error) //sys ioctlPtr(fd int, req int, arg unsafe.Pointer) (err error) = ioctl // fcntl must never be called with cmd=F_DUP2FD because it doesn't work on AIX // There is no way to create a custom fcntl and to keep //sys fcntl easily, // Therefore, the programmer must call dup2 instead of fcntl in this case. // FcntlInt performs a fcntl syscall on fd with the provided command and argument. //sys FcntlInt(fd uintptr, cmd int, arg int) (r int,err error) = fcntl // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. //sys FcntlFlock(fd uintptr, cmd int, lk *Flock_t) (err error) = fcntl //sys fcntl(fd int, cmd int, arg int) (val int, err error) //sys fsyncRange(fd int, how int, start int64, length int64) (err error) = fsync_range func Fsync(fd int) error { return fsyncRange(fd, O_SYNC, 0, 0) } /* * Direct access */ //sys Acct(path string) (err error) //sys Chdir(path string) (err error) //sys Chroot(path string) (err error) //sys Close(fd int) (err error) //sys Dup(oldfd int) (fd int, err error) //sys Exit(code int) //sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error) //sys Fchdir(fd int) (err error) //sys Fchmod(fd int, mode uint32) (err error) //sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) //sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) //sys Fdatasync(fd int) (err error) // readdir_r //sysnb Getpgid(pid int) (pgid int, err error) //sys Getpgrp() (pid int) //sysnb Getpid() (pid int) //sysnb Getppid() (ppid int) //sys Getpriority(which int, who int) (prio int, err error) //sysnb Getrusage(who int, rusage *Rusage) (err error) //sysnb Getsid(pid int) (sid int, err error) //sysnb Kill(pid int, sig Signal) (err error) //sys Klogctl(typ int, buf []byte) (n int, err error) = syslog //sys Mkdir(dirfd int, path string, mode uint32) (err error) //sys Mkdirat(dirfd int, path string, mode uint32) (err error) //sys Mkfifo(path string, mode uint32) (err error) //sys Mknod(path string, mode uint32, dev int) (err error) //sys Mknodat(dirfd int, path string, mode uint32, dev int) (err error) //sys Nanosleep(time *Timespec, leftover *Timespec) (err error) //sys Open(path string, mode int, perm uint32) (fd int, err error) = open64 //sys Openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) //sys read(fd int, p []byte) (n int, err error) //sys Readlink(path string, buf []byte) (n int, err error) //sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) //sys Setdomainname(p []byte) (err error) //sys Sethostname(p []byte) (err error) //sysnb Setpgid(pid int, pgid int) (err error) //sysnb Setsid() (pid int, err error) //sysnb Settimeofday(tv *Timeval) (err error) //sys Setuid(uid int) (err error) //sys Setgid(uid int) (err error) //sys Setpriority(which int, who int, prio int) (err error) //sys Statx(dirfd int, path string, flags int, mask int, stat *Statx_t) (err error) //sys Sync() //sysnb Times(tms *Tms) (ticks uintptr, err error) //sysnb Umask(mask int) (oldmask int) //sysnb Uname(buf *Utsname) (err error) //sys Unlink(path string) (err error) //sys Unlinkat(dirfd int, path string, flags int) (err error) //sys Ustat(dev int, ubuf *Ustat_t) (err error) //sys write(fd int, p []byte) (n int, err error) //sys Dup2(oldfd int, newfd int) (err error) //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = posix_fadvise64 //sys Fchown(fd int, uid int, gid int) (err error) //sys fstat(fd int, stat *Stat_t) (err error) //sys fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = fstatat //sys Fstatfs(fd int, buf *Statfs_t) (err error) //sys Ftruncate(fd int, length int64) (err error) //sysnb Getegid() (egid int) //sysnb Geteuid() (euid int) //sysnb Getgid() (gid int) //sysnb Getuid() (uid int) //sys Lchown(path string, uid int, gid int) (err error) //sys Listen(s int, n int) (err error) //sys lstat(path string, stat *Stat_t) (err error) //sys Pause() (err error) //sys pread(fd int, p []byte, offset int64) (n int, err error) = pread64 //sys pwrite(fd int, p []byte, offset int64) (n int, err error) = pwrite64 //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) //sys Pselect(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timespec, sigmask *Sigset_t) (n int, err error) //sysnb Setregid(rgid int, egid int) (err error) //sysnb Setreuid(ruid int, euid int) (err error) //sys Shutdown(fd int, how int) (err error) //sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) //sys stat(path string, statptr *Stat_t) (err error) //sys Statfs(path string, buf *Statfs_t) (err error) //sys Truncate(path string, length int64) (err error) //sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) //sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) //sysnb getgroups(n int, list *_Gid_t) (nn int, err error) //sysnb setgroups(n int, list *_Gid_t) (err error) //sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) //sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) //sysnb socket(domain int, typ int, proto int) (fd int, err error) //sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) //sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) //sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) //sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) //sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) // In order to use msghdr structure with Control, Controllen, nrecvmsg and nsendmsg must be used. //sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error) = nrecvmsg //sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error) = nsendmsg //sys munmap(addr uintptr, length uintptr) (err error) //sys Madvise(b []byte, advice int) (err error) //sys Mprotect(b []byte, prot int) (err error) //sys Mlock(b []byte) (err error) //sys Mlockall(flags int) (err error) //sys Msync(b []byte, flags int) (err error) //sys Munlock(b []byte) (err error) //sys Munlockall() (err error) //sysnb pipe(p *[2]_C_int) (err error) func Pipe(p []int) (err error) { if len(p) != 2 { return EINVAL } var pp [2]_C_int err = pipe(&pp) if err == nil { p[0] = int(pp[0]) p[1] = int(pp[1]) } return } //sys poll(fds *PollFd, nfds int, timeout int) (n int, err error) func Poll(fds []PollFd, timeout int) (n int, err error) { if len(fds) == 0 { return poll(nil, 0, timeout) } return poll(&fds[0], len(fds), timeout) } //sys gettimeofday(tv *Timeval, tzp *Timezone) (err error) //sysnb Time(t *Time_t) (tt Time_t, err error) //sys Utime(path string, buf *Utimbuf) (err error) //sys Getsystemcfg(label int) (n uint64) //sys umount(target string) (err error) func Unmount(target string, flags int) (err error) { if flags != 0 { // AIX doesn't have any flags for umount. return ENOSYS } return umount(target) } ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_aix_ppc.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build aix && ppc package unix //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) = getrlimit64 //sys Seek(fd int, offset int64, whence int) (off int64, err error) = lseek64 //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) func setTimespec(sec, nsec int64) Timespec { return Timespec{Sec: int32(sec), Nsec: int32(nsec)} } func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: int32(sec), Usec: int32(usec)} } func (iov *Iovec) SetLen(length int) { iov.Len = uint32(length) } func (msghdr *Msghdr) SetControllen(length int) { msghdr.Controllen = uint32(length) } func (msghdr *Msghdr) SetIovlen(length int) { msghdr.Iovlen = int32(length) } func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint32(length) } func Fstat(fd int, stat *Stat_t) error { return fstat(fd, stat) } func Fstatat(dirfd int, path string, stat *Stat_t, flags int) error { return fstatat(dirfd, path, stat, flags) } func Lstat(path string, stat *Stat_t) error { return lstat(path, stat) } func Stat(path string, statptr *Stat_t) error { return stat(path, statptr) } ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_aix_ppc64.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build aix && ppc64 package unix //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) //sys Seek(fd int, offset int64, whence int) (off int64, err error) = lseek //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) = mmap64 func setTimespec(sec, nsec int64) Timespec { return Timespec{Sec: sec, Nsec: nsec} } func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: int64(sec), Usec: int32(usec)} } func (iov *Iovec) SetLen(length int) { iov.Len = uint64(length) } func (msghdr *Msghdr) SetControllen(length int) { msghdr.Controllen = uint32(length) } func (msghdr *Msghdr) SetIovlen(length int) { msghdr.Iovlen = int32(length) } func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint32(length) } // In order to only have Timespec structure, type of Stat_t's fields // Atim, Mtim and Ctim is changed from StTimespec to Timespec during // ztypes generation. // On ppc64, Timespec.Nsec is an int64 while StTimespec.Nsec is an // int32, so the fields' value must be modified. func fixStatTimFields(stat *Stat_t) { stat.Atim.Nsec >>= 32 stat.Mtim.Nsec >>= 32 stat.Ctim.Nsec >>= 32 } func Fstat(fd int, stat *Stat_t) error { err := fstat(fd, stat) if err != nil { return err } fixStatTimFields(stat) return nil } func Fstatat(dirfd int, path string, stat *Stat_t, flags int) error { err := fstatat(dirfd, path, stat, flags) if err != nil { return err } fixStatTimFields(stat) return nil } func Lstat(path string, stat *Stat_t) error { err := lstat(path, stat) if err != nil { return err } fixStatTimFields(stat) return nil } func Stat(path string, statptr *Stat_t) error { err := stat(path, statptr) if err != nil { return err } fixStatTimFields(statptr) return nil } ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_bsd.go ================================================ // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build darwin || dragonfly || freebsd || netbsd || openbsd // BSD system call wrappers shared by *BSD based systems // including OS X (Darwin) and FreeBSD. Like the other // syscall_*.go files it is compiled as Go code but also // used as input to mksyscall which parses the //sys // lines and generates system call stubs. package unix import ( "runtime" "syscall" "unsafe" ) const ImplementsGetwd = true func Getwd() (string, error) { var buf [PathMax]byte _, err := Getcwd(buf[0:]) if err != nil { return "", err } n := clen(buf[:]) if n < 1 { return "", EINVAL } return string(buf[:n]), nil } /* * Wrapped */ //sysnb getgroups(ngid int, gid *_Gid_t) (n int, err error) //sysnb setgroups(ngid int, gid *_Gid_t) (err error) func Getgroups() (gids []int, err error) { n, err := getgroups(0, nil) if err != nil { return nil, err } if n == 0 { return nil, nil } // Sanity check group count. Max is 16 on BSD. if n < 0 || n > 1000 { return nil, EINVAL } a := make([]_Gid_t, n) n, err = getgroups(n, &a[0]) if err != nil { return nil, err } gids = make([]int, n) for i, v := range a[0:n] { gids[i] = int(v) } return } func Setgroups(gids []int) (err error) { if len(gids) == 0 { return setgroups(0, nil) } a := make([]_Gid_t, len(gids)) for i, v := range gids { a[i] = _Gid_t(v) } return setgroups(len(a), &a[0]) } // Wait status is 7 bits at bottom, either 0 (exited), // 0x7F (stopped), or a signal number that caused an exit. // The 0x80 bit is whether there was a core dump. // An extra number (exit code, signal causing a stop) // is in the high bits. type WaitStatus uint32 const ( mask = 0x7F core = 0x80 shift = 8 exited = 0 killed = 9 stopped = 0x7F ) func (w WaitStatus) Exited() bool { return w&mask == exited } func (w WaitStatus) ExitStatus() int { if w&mask != exited { return -1 } return int(w >> shift) } func (w WaitStatus) Signaled() bool { return w&mask != stopped && w&mask != 0 } func (w WaitStatus) Signal() syscall.Signal { sig := syscall.Signal(w & mask) if sig == stopped || sig == 0 { return -1 } return sig } func (w WaitStatus) CoreDump() bool { return w.Signaled() && w&core != 0 } func (w WaitStatus) Stopped() bool { return w&mask == stopped && syscall.Signal(w>>shift) != SIGSTOP } func (w WaitStatus) Killed() bool { return w&mask == killed && syscall.Signal(w>>shift) != SIGKILL } func (w WaitStatus) Continued() bool { return w&mask == stopped && syscall.Signal(w>>shift) == SIGSTOP } func (w WaitStatus) StopSignal() syscall.Signal { if !w.Stopped() { return -1 } return syscall.Signal(w>>shift) & 0xFF } func (w WaitStatus) TrapCause() int { return -1 } //sys wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, err error) { var status _C_int wpid, err = wait4(pid, &status, options, rusage) if wstatus != nil { *wstatus = WaitStatus(status) } return } //sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) //sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) //sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) //sysnb socket(domain int, typ int, proto int) (fd int, err error) //sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) //sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) //sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) //sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) //sys Shutdown(s int, how int) (err error) func (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, _Socklen, error) { if sa.Port < 0 || sa.Port > 0xFFFF { return nil, 0, EINVAL } sa.raw.Len = SizeofSockaddrInet4 sa.raw.Family = AF_INET p := (*[2]byte)(unsafe.Pointer(&sa.raw.Port)) p[0] = byte(sa.Port >> 8) p[1] = byte(sa.Port) sa.raw.Addr = sa.Addr return unsafe.Pointer(&sa.raw), _Socklen(sa.raw.Len), nil } func (sa *SockaddrInet6) sockaddr() (unsafe.Pointer, _Socklen, error) { if sa.Port < 0 || sa.Port > 0xFFFF { return nil, 0, EINVAL } sa.raw.Len = SizeofSockaddrInet6 sa.raw.Family = AF_INET6 p := (*[2]byte)(unsafe.Pointer(&sa.raw.Port)) p[0] = byte(sa.Port >> 8) p[1] = byte(sa.Port) sa.raw.Scope_id = sa.ZoneId sa.raw.Addr = sa.Addr return unsafe.Pointer(&sa.raw), _Socklen(sa.raw.Len), nil } func (sa *SockaddrUnix) sockaddr() (unsafe.Pointer, _Socklen, error) { name := sa.Name n := len(name) if n >= len(sa.raw.Path) || n == 0 { return nil, 0, EINVAL } sa.raw.Len = byte(3 + n) // 2 for Family, Len; 1 for NUL sa.raw.Family = AF_UNIX for i := 0; i < n; i++ { sa.raw.Path[i] = int8(name[i]) } return unsafe.Pointer(&sa.raw), _Socklen(sa.raw.Len), nil } func (sa *SockaddrDatalink) sockaddr() (unsafe.Pointer, _Socklen, error) { if sa.Index == 0 { return nil, 0, EINVAL } sa.raw.Len = sa.Len sa.raw.Family = AF_LINK sa.raw.Index = sa.Index sa.raw.Type = sa.Type sa.raw.Nlen = sa.Nlen sa.raw.Alen = sa.Alen sa.raw.Slen = sa.Slen sa.raw.Data = sa.Data return unsafe.Pointer(&sa.raw), SizeofSockaddrDatalink, nil } func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) { switch rsa.Addr.Family { case AF_LINK: pp := (*RawSockaddrDatalink)(unsafe.Pointer(rsa)) sa := new(SockaddrDatalink) sa.Len = pp.Len sa.Family = pp.Family sa.Index = pp.Index sa.Type = pp.Type sa.Nlen = pp.Nlen sa.Alen = pp.Alen sa.Slen = pp.Slen sa.Data = pp.Data return sa, nil case AF_UNIX: pp := (*RawSockaddrUnix)(unsafe.Pointer(rsa)) if pp.Len < 2 || pp.Len > SizeofSockaddrUnix { return nil, EINVAL } sa := new(SockaddrUnix) // Some BSDs include the trailing NUL in the length, whereas // others do not. Work around this by subtracting the leading // family and len. The path is then scanned to see if a NUL // terminator still exists within the length. n := int(pp.Len) - 2 // subtract leading Family, Len for i := 0; i < n; i++ { if pp.Path[i] == 0 { // found early NUL; assume Len included the NUL // or was overestimating. n = i break } } sa.Name = string(unsafe.Slice((*byte)(unsafe.Pointer(&pp.Path[0])), n)) return sa, nil case AF_INET: pp := (*RawSockaddrInet4)(unsafe.Pointer(rsa)) sa := new(SockaddrInet4) p := (*[2]byte)(unsafe.Pointer(&pp.Port)) sa.Port = int(p[0])<<8 + int(p[1]) sa.Addr = pp.Addr return sa, nil case AF_INET6: pp := (*RawSockaddrInet6)(unsafe.Pointer(rsa)) sa := new(SockaddrInet6) p := (*[2]byte)(unsafe.Pointer(&pp.Port)) sa.Port = int(p[0])<<8 + int(p[1]) sa.ZoneId = pp.Scope_id sa.Addr = pp.Addr return sa, nil } return anyToSockaddrGOOS(fd, rsa) } func Accept(fd int) (nfd int, sa Sockaddr, err error) { var rsa RawSockaddrAny var len _Socklen = SizeofSockaddrAny nfd, err = accept(fd, &rsa, &len) if err != nil { return } if (runtime.GOOS == "darwin" || runtime.GOOS == "ios") && len == 0 { // Accepted socket has no address. // This is likely due to a bug in xnu kernels, // where instead of ECONNABORTED error socket // is accepted, but has no address. Close(nfd) return 0, nil, ECONNABORTED } sa, err = anyToSockaddr(fd, &rsa) if err != nil { Close(nfd) nfd = 0 } return } func Getsockname(fd int) (sa Sockaddr, err error) { var rsa RawSockaddrAny var len _Socklen = SizeofSockaddrAny if err = getsockname(fd, &rsa, &len); err != nil { return } // TODO(jsing): DragonFly has a "bug" (see issue 3349), which should be // reported upstream. if runtime.GOOS == "dragonfly" && rsa.Addr.Family == AF_UNSPEC && rsa.Addr.Len == 0 { rsa.Addr.Family = AF_UNIX rsa.Addr.Len = SizeofSockaddrUnix } return anyToSockaddr(fd, &rsa) } //sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) // GetsockoptString returns the string value of the socket option opt for the // socket associated with fd at the given socket level. func GetsockoptString(fd, level, opt int) (string, error) { buf := make([]byte, 256) vallen := _Socklen(len(buf)) err := getsockopt(fd, level, opt, unsafe.Pointer(&buf[0]), &vallen) if err != nil { return "", err } return ByteSliceToString(buf[:vallen]), nil } //sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) //sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) //sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error) func recvmsgRaw(fd int, iov []Iovec, oob []byte, flags int, rsa *RawSockaddrAny) (n, oobn int, recvflags int, err error) { var msg Msghdr msg.Name = (*byte)(unsafe.Pointer(rsa)) msg.Namelen = uint32(SizeofSockaddrAny) var dummy byte if len(oob) > 0 { // receive at least one normal byte if emptyIovecs(iov) { var iova [1]Iovec iova[0].Base = &dummy iova[0].SetLen(1) iov = iova[:] } msg.Control = (*byte)(unsafe.Pointer(&oob[0])) msg.SetControllen(len(oob)) } if len(iov) > 0 { msg.Iov = &iov[0] msg.SetIovlen(len(iov)) } if n, err = recvmsg(fd, &msg, flags); err != nil { return } oobn = int(msg.Controllen) recvflags = int(msg.Flags) return } //sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error) func sendmsgN(fd int, iov []Iovec, oob []byte, ptr unsafe.Pointer, salen _Socklen, flags int) (n int, err error) { var msg Msghdr msg.Name = (*byte)(unsafe.Pointer(ptr)) msg.Namelen = uint32(salen) var dummy byte var empty bool if len(oob) > 0 { // send at least one normal byte empty = emptyIovecs(iov) if empty { var iova [1]Iovec iova[0].Base = &dummy iova[0].SetLen(1) iov = iova[:] } msg.Control = (*byte)(unsafe.Pointer(&oob[0])) msg.SetControllen(len(oob)) } if len(iov) > 0 { msg.Iov = &iov[0] msg.SetIovlen(len(iov)) } if n, err = sendmsg(fd, &msg, flags); err != nil { return 0, err } if len(oob) > 0 && empty { n = 0 } return n, nil } //sys kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) func Kevent(kq int, changes, events []Kevent_t, timeout *Timespec) (n int, err error) { var change, event unsafe.Pointer if len(changes) > 0 { change = unsafe.Pointer(&changes[0]) } if len(events) > 0 { event = unsafe.Pointer(&events[0]) } return kevent(kq, change, len(changes), event, len(events), timeout) } // sysctlmib translates name to mib number and appends any additional args. func sysctlmib(name string, args ...int) ([]_C_int, error) { // Translate name to mib number. mib, err := nametomib(name) if err != nil { return nil, err } for _, a := range args { mib = append(mib, _C_int(a)) } return mib, nil } func Sysctl(name string) (string, error) { return SysctlArgs(name) } func SysctlArgs(name string, args ...int) (string, error) { buf, err := SysctlRaw(name, args...) if err != nil { return "", err } n := len(buf) // Throw away terminating NUL. if n > 0 && buf[n-1] == '\x00' { n-- } return string(buf[0:n]), nil } func SysctlUint32(name string) (uint32, error) { return SysctlUint32Args(name) } func SysctlUint32Args(name string, args ...int) (uint32, error) { mib, err := sysctlmib(name, args...) if err != nil { return 0, err } n := uintptr(4) buf := make([]byte, 4) if err := sysctl(mib, &buf[0], &n, nil, 0); err != nil { return 0, err } if n != 4 { return 0, EIO } return *(*uint32)(unsafe.Pointer(&buf[0])), nil } func SysctlUint64(name string, args ...int) (uint64, error) { mib, err := sysctlmib(name, args...) if err != nil { return 0, err } n := uintptr(8) buf := make([]byte, 8) if err := sysctl(mib, &buf[0], &n, nil, 0); err != nil { return 0, err } if n != 8 { return 0, EIO } return *(*uint64)(unsafe.Pointer(&buf[0])), nil } func SysctlRaw(name string, args ...int) ([]byte, error) { mib, err := sysctlmib(name, args...) if err != nil { return nil, err } // Find size. n := uintptr(0) if err := sysctl(mib, nil, &n, nil, 0); err != nil { return nil, err } if n == 0 { return nil, nil } // Read into buffer of that size. buf := make([]byte, n) if err := sysctl(mib, &buf[0], &n, nil, 0); err != nil { return nil, err } // The actual call may return less than the original reported required // size so ensure we deal with that. return buf[:n], nil } func SysctlClockinfo(name string) (*Clockinfo, error) { mib, err := sysctlmib(name) if err != nil { return nil, err } n := uintptr(SizeofClockinfo) var ci Clockinfo if err := sysctl(mib, (*byte)(unsafe.Pointer(&ci)), &n, nil, 0); err != nil { return nil, err } if n != SizeofClockinfo { return nil, EIO } return &ci, nil } func SysctlTimeval(name string) (*Timeval, error) { mib, err := sysctlmib(name) if err != nil { return nil, err } var tv Timeval n := uintptr(unsafe.Sizeof(tv)) if err := sysctl(mib, (*byte)(unsafe.Pointer(&tv)), &n, nil, 0); err != nil { return nil, err } if n != unsafe.Sizeof(tv) { return nil, EIO } return &tv, nil } //sys utimes(path string, timeval *[2]Timeval) (err error) func Utimes(path string, tv []Timeval) error { if tv == nil { return utimes(path, nil) } if len(tv) != 2 { return EINVAL } return utimes(path, (*[2]Timeval)(unsafe.Pointer(&tv[0]))) } func UtimesNano(path string, ts []Timespec) error { if ts == nil { err := utimensat(AT_FDCWD, path, nil, 0) if err != ENOSYS { return err } return utimes(path, nil) } if len(ts) != 2 { return EINVAL } err := utimensat(AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0) if err != ENOSYS { return err } // Not as efficient as it could be because Timespec and // Timeval have different types in the different OSes tv := [2]Timeval{ NsecToTimeval(TimespecToNsec(ts[0])), NsecToTimeval(TimespecToNsec(ts[1])), } return utimes(path, (*[2]Timeval)(unsafe.Pointer(&tv[0]))) } func UtimesNanoAt(dirfd int, path string, ts []Timespec, flags int) error { if ts == nil { return utimensat(dirfd, path, nil, flags) } if len(ts) != 2 { return EINVAL } return utimensat(dirfd, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), flags) } //sys futimes(fd int, timeval *[2]Timeval) (err error) func Futimes(fd int, tv []Timeval) error { if tv == nil { return futimes(fd, nil) } if len(tv) != 2 { return EINVAL } return futimes(fd, (*[2]Timeval)(unsafe.Pointer(&tv[0]))) } //sys poll(fds *PollFd, nfds int, timeout int) (n int, err error) func Poll(fds []PollFd, timeout int) (n int, err error) { if len(fds) == 0 { return poll(nil, 0, timeout) } return poll(&fds[0], len(fds), timeout) } // TODO: wrap // Acct(name nil-string) (err error) // Gethostuuid(uuid *byte, timeout *Timespec) (err error) // Ptrace(req int, pid int, addr uintptr, data int) (ret uintptr, err error) //sys Madvise(b []byte, behav int) (err error) //sys Mlock(b []byte) (err error) //sys Mlockall(flags int) (err error) //sys Mprotect(b []byte, prot int) (err error) //sys Msync(b []byte, flags int) (err error) //sys Munlock(b []byte) (err error) //sys Munlockall() (err error) ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_darwin.go ================================================ // Copyright 2009,2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Darwin system calls. // This file is compiled as ordinary Go code, // but it is also input to mksyscall, // which parses the //sys lines and generates system call stubs. // Note that sometimes we use a lowercase //sys name and wrap // it in our own nicer implementation, either here or in // syscall_bsd.go or syscall_unix.go. package unix import ( "fmt" "syscall" "unsafe" ) //sys closedir(dir uintptr) (err error) //sys readdir_r(dir uintptr, entry *Dirent, result **Dirent) (res Errno) func fdopendir(fd int) (dir uintptr, err error) { r0, _, e1 := syscall_syscallPtr(libc_fdopendir_trampoline_addr, uintptr(fd), 0, 0) dir = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fdopendir_trampoline_addr uintptr //go:cgo_import_dynamic libc_fdopendir fdopendir "/usr/lib/libSystem.B.dylib" func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { // Simulate Getdirentries using fdopendir/readdir_r/closedir. // We store the number of entries to skip in the seek // offset of fd. See issue #31368. // It's not the full required semantics, but should handle the case // of calling Getdirentries or ReadDirent repeatedly. // It won't handle assigning the results of lseek to *basep, or handle // the directory being edited underfoot. skip, err := Seek(fd, 0, 1 /* SEEK_CUR */) if err != nil { return 0, err } // We need to duplicate the incoming file descriptor // because the caller expects to retain control of it, but // fdopendir expects to take control of its argument. // Just Dup'ing the file descriptor is not enough, as the // result shares underlying state. Use Openat to make a really // new file descriptor referring to the same directory. fd2, err := Openat(fd, ".", O_RDONLY, 0) if err != nil { return 0, err } d, err := fdopendir(fd2) if err != nil { Close(fd2) return 0, err } defer closedir(d) var cnt int64 for { var entry Dirent var entryp *Dirent e := readdir_r(d, &entry, &entryp) if e != 0 { return n, errnoErr(e) } if entryp == nil { break } if skip > 0 { skip-- cnt++ continue } reclen := int(entry.Reclen) if reclen > len(buf) { // Not enough room. Return for now. // The counter will let us know where we should start up again. // Note: this strategy for suspending in the middle and // restarting is O(n^2) in the length of the directory. Oh well. break } // Copy entry into return buffer. s := unsafe.Slice((*byte)(unsafe.Pointer(&entry)), reclen) copy(buf, s) buf = buf[reclen:] n += reclen cnt++ } // Set the seek offset of the input fd to record // how many files we've already returned. _, err = Seek(fd, cnt, 0 /* SEEK_SET */) if err != nil { return n, err } return n, nil } // SockaddrDatalink implements the Sockaddr interface for AF_LINK type sockets. type SockaddrDatalink struct { Len uint8 Family uint8 Index uint16 Type uint8 Nlen uint8 Alen uint8 Slen uint8 Data [12]int8 raw RawSockaddrDatalink } // SockaddrCtl implements the Sockaddr interface for AF_SYSTEM type sockets. type SockaddrCtl struct { ID uint32 Unit uint32 raw RawSockaddrCtl } func (sa *SockaddrCtl) sockaddr() (unsafe.Pointer, _Socklen, error) { sa.raw.Sc_len = SizeofSockaddrCtl sa.raw.Sc_family = AF_SYSTEM sa.raw.Ss_sysaddr = AF_SYS_CONTROL sa.raw.Sc_id = sa.ID sa.raw.Sc_unit = sa.Unit return unsafe.Pointer(&sa.raw), SizeofSockaddrCtl, nil } // SockaddrVM implements the Sockaddr interface for AF_VSOCK type sockets. // SockaddrVM provides access to Darwin VM sockets: a mechanism that enables // bidirectional communication between a hypervisor and its guest virtual // machines. type SockaddrVM struct { // CID and Port specify a context ID and port address for a VM socket. // Guests have a unique CID, and hosts may have a well-known CID of: // - VMADDR_CID_HYPERVISOR: refers to the hypervisor process. // - VMADDR_CID_LOCAL: refers to local communication (loopback). // - VMADDR_CID_HOST: refers to other processes on the host. CID uint32 Port uint32 raw RawSockaddrVM } func (sa *SockaddrVM) sockaddr() (unsafe.Pointer, _Socklen, error) { sa.raw.Len = SizeofSockaddrVM sa.raw.Family = AF_VSOCK sa.raw.Port = sa.Port sa.raw.Cid = sa.CID return unsafe.Pointer(&sa.raw), SizeofSockaddrVM, nil } func anyToSockaddrGOOS(fd int, rsa *RawSockaddrAny) (Sockaddr, error) { switch rsa.Addr.Family { case AF_SYSTEM: pp := (*RawSockaddrCtl)(unsafe.Pointer(rsa)) if pp.Ss_sysaddr == AF_SYS_CONTROL { sa := new(SockaddrCtl) sa.ID = pp.Sc_id sa.Unit = pp.Sc_unit return sa, nil } case AF_VSOCK: pp := (*RawSockaddrVM)(unsafe.Pointer(rsa)) sa := &SockaddrVM{ CID: pp.Cid, Port: pp.Port, } return sa, nil } return nil, EAFNOSUPPORT } // Some external packages rely on SYS___SYSCTL being defined to implement their // own sysctl wrappers. Provide it here, even though direct syscalls are no // longer supported on darwin. const SYS___SYSCTL = SYS_SYSCTL // Translate "kern.hostname" to []_C_int{0,1,2,3}. func nametomib(name string) (mib []_C_int, err error) { const siz = unsafe.Sizeof(mib[0]) // NOTE(rsc): It seems strange to set the buffer to have // size CTL_MAXNAME+2 but use only CTL_MAXNAME // as the size. I don't know why the +2 is here, but the // kernel uses +2 for its own implementation of this function. // I am scared that if we don't include the +2 here, the kernel // will silently write 2 words farther than we specify // and we'll get memory corruption. var buf [CTL_MAXNAME + 2]_C_int n := uintptr(CTL_MAXNAME) * siz p := (*byte)(unsafe.Pointer(&buf[0])) bytes, err := ByteSliceFromString(name) if err != nil { return nil, err } // Magic sysctl: "setting" 0.3 to a string name // lets you read back the array of integers form. if err = sysctl([]_C_int{0, 3}, p, &n, &bytes[0], uintptr(len(name))); err != nil { return nil, err } return buf[0 : n/siz], nil } func direntIno(buf []byte) (uint64, bool) { return readInt(buf, unsafe.Offsetof(Dirent{}.Ino), unsafe.Sizeof(Dirent{}.Ino)) } func direntReclen(buf []byte) (uint64, bool) { return readInt(buf, unsafe.Offsetof(Dirent{}.Reclen), unsafe.Sizeof(Dirent{}.Reclen)) } func direntNamlen(buf []byte) (uint64, bool) { return readInt(buf, unsafe.Offsetof(Dirent{}.Namlen), unsafe.Sizeof(Dirent{}.Namlen)) } func PtraceAttach(pid int) (err error) { return ptrace(PT_ATTACH, pid, 0, 0) } func PtraceDetach(pid int) (err error) { return ptrace(PT_DETACH, pid, 0, 0) } func PtraceDenyAttach() (err error) { return ptrace(PT_DENY_ATTACH, 0, 0, 0) } //sysnb pipe(p *[2]int32) (err error) func Pipe(p []int) (err error) { if len(p) != 2 { return EINVAL } var x [2]int32 err = pipe(&x) if err == nil { p[0] = int(x[0]) p[1] = int(x[1]) } return } func Getfsstat(buf []Statfs_t, flags int) (n int, err error) { var _p0 unsafe.Pointer var bufsize uintptr if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) bufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf)) } return getfsstat(_p0, bufsize, flags) } func xattrPointer(dest []byte) *byte { // It's only when dest is set to NULL that the OS X implementations of // getxattr() and listxattr() return the current sizes of the named attributes. // An empty byte array is not sufficient. To maintain the same behaviour as the // linux implementation, we wrap around the system calls and pass in NULL when // dest is empty. var destp *byte if len(dest) > 0 { destp = &dest[0] } return destp } //sys getxattr(path string, attr string, dest *byte, size int, position uint32, options int) (sz int, err error) func Getxattr(path string, attr string, dest []byte) (sz int, err error) { return getxattr(path, attr, xattrPointer(dest), len(dest), 0, 0) } func Lgetxattr(link string, attr string, dest []byte) (sz int, err error) { return getxattr(link, attr, xattrPointer(dest), len(dest), 0, XATTR_NOFOLLOW) } //sys fgetxattr(fd int, attr string, dest *byte, size int, position uint32, options int) (sz int, err error) func Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) { return fgetxattr(fd, attr, xattrPointer(dest), len(dest), 0, 0) } //sys setxattr(path string, attr string, data *byte, size int, position uint32, options int) (err error) func Setxattr(path string, attr string, data []byte, flags int) (err error) { // The parameters for the OS X implementation vary slightly compared to the // linux system call, specifically the position parameter: // // linux: // int setxattr( // const char *path, // const char *name, // const void *value, // size_t size, // int flags // ); // // darwin: // int setxattr( // const char *path, // const char *name, // void *value, // size_t size, // u_int32_t position, // int options // ); // // position specifies the offset within the extended attribute. In the // current implementation, only the resource fork extended attribute makes // use of this argument. For all others, position is reserved. We simply // default to setting it to zero. return setxattr(path, attr, xattrPointer(data), len(data), 0, flags) } func Lsetxattr(link string, attr string, data []byte, flags int) (err error) { return setxattr(link, attr, xattrPointer(data), len(data), 0, flags|XATTR_NOFOLLOW) } //sys fsetxattr(fd int, attr string, data *byte, size int, position uint32, options int) (err error) func Fsetxattr(fd int, attr string, data []byte, flags int) (err error) { return fsetxattr(fd, attr, xattrPointer(data), len(data), 0, 0) } //sys removexattr(path string, attr string, options int) (err error) func Removexattr(path string, attr string) (err error) { // We wrap around and explicitly zero out the options provided to the OS X // implementation of removexattr, we do so for interoperability with the // linux variant. return removexattr(path, attr, 0) } func Lremovexattr(link string, attr string) (err error) { return removexattr(link, attr, XATTR_NOFOLLOW) } //sys fremovexattr(fd int, attr string, options int) (err error) func Fremovexattr(fd int, attr string) (err error) { return fremovexattr(fd, attr, 0) } //sys listxattr(path string, dest *byte, size int, options int) (sz int, err error) func Listxattr(path string, dest []byte) (sz int, err error) { return listxattr(path, xattrPointer(dest), len(dest), 0) } func Llistxattr(link string, dest []byte) (sz int, err error) { return listxattr(link, xattrPointer(dest), len(dest), XATTR_NOFOLLOW) } //sys flistxattr(fd int, dest *byte, size int, options int) (sz int, err error) func Flistxattr(fd int, dest []byte) (sz int, err error) { return flistxattr(fd, xattrPointer(dest), len(dest), 0) } //sys utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) /* * Wrapped */ //sys fcntl(fd int, cmd int, arg int) (val int, err error) //sys kill(pid int, signum int, posix int) (err error) func Kill(pid int, signum syscall.Signal) (err error) { return kill(pid, int(signum), 1) } //sys ioctl(fd int, req uint, arg uintptr) (err error) //sys ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) = SYS_IOCTL func IoctlCtlInfo(fd int, ctlInfo *CtlInfo) error { return ioctlPtr(fd, CTLIOCGINFO, unsafe.Pointer(ctlInfo)) } // IfreqMTU is struct ifreq used to get or set a network device's MTU. type IfreqMTU struct { Name [IFNAMSIZ]byte MTU int32 } // IoctlGetIfreqMTU performs the SIOCGIFMTU ioctl operation on fd to get the MTU // of the network device specified by ifname. func IoctlGetIfreqMTU(fd int, ifname string) (*IfreqMTU, error) { var ifreq IfreqMTU copy(ifreq.Name[:], ifname) err := ioctlPtr(fd, SIOCGIFMTU, unsafe.Pointer(&ifreq)) return &ifreq, err } // IoctlSetIfreqMTU performs the SIOCSIFMTU ioctl operation on fd to set the MTU // of the network device specified by ifreq.Name. func IoctlSetIfreqMTU(fd int, ifreq *IfreqMTU) error { return ioctlPtr(fd, SIOCSIFMTU, unsafe.Pointer(ifreq)) } //sys renamexNp(from string, to string, flag uint32) (err error) func RenamexNp(from string, to string, flag uint32) (err error) { return renamexNp(from, to, flag) } //sys renameatxNp(fromfd int, from string, tofd int, to string, flag uint32) (err error) func RenameatxNp(fromfd int, from string, tofd int, to string, flag uint32) (err error) { return renameatxNp(fromfd, from, tofd, to, flag) } //sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS_SYSCTL func Uname(uname *Utsname) error { mib := []_C_int{CTL_KERN, KERN_OSTYPE} n := unsafe.Sizeof(uname.Sysname) if err := sysctl(mib, &uname.Sysname[0], &n, nil, 0); err != nil { return err } mib = []_C_int{CTL_KERN, KERN_HOSTNAME} n = unsafe.Sizeof(uname.Nodename) if err := sysctl(mib, &uname.Nodename[0], &n, nil, 0); err != nil { return err } mib = []_C_int{CTL_KERN, KERN_OSRELEASE} n = unsafe.Sizeof(uname.Release) if err := sysctl(mib, &uname.Release[0], &n, nil, 0); err != nil { return err } mib = []_C_int{CTL_KERN, KERN_VERSION} n = unsafe.Sizeof(uname.Version) if err := sysctl(mib, &uname.Version[0], &n, nil, 0); err != nil { return err } // The version might have newlines or tabs in it, convert them to // spaces. for i, b := range uname.Version { if b == '\n' || b == '\t' { if i == len(uname.Version)-1 { uname.Version[i] = 0 } else { uname.Version[i] = ' ' } } } mib = []_C_int{CTL_HW, HW_MACHINE} n = unsafe.Sizeof(uname.Machine) if err := sysctl(mib, &uname.Machine[0], &n, nil, 0); err != nil { return err } return nil } func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { if raceenabled { raceReleaseMerge(unsafe.Pointer(&ioSync)) } var length = int64(count) err = sendfile(infd, outfd, *offset, &length, nil, 0) written = int(length) return } func GetsockoptIPMreqn(fd, level, opt int) (*IPMreqn, error) { var value IPMreqn vallen := _Socklen(SizeofIPMreqn) errno := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen) return &value, errno } func SetsockoptIPMreqn(fd, level, opt int, mreq *IPMreqn) (err error) { return setsockopt(fd, level, opt, unsafe.Pointer(mreq), unsafe.Sizeof(*mreq)) } // GetsockoptXucred is a getsockopt wrapper that returns an Xucred struct. // The usual level and opt are SOL_LOCAL and LOCAL_PEERCRED, respectively. func GetsockoptXucred(fd, level, opt int) (*Xucred, error) { x := new(Xucred) vallen := _Socklen(SizeofXucred) err := getsockopt(fd, level, opt, unsafe.Pointer(x), &vallen) return x, err } func GetsockoptTCPConnectionInfo(fd, level, opt int) (*TCPConnectionInfo, error) { var value TCPConnectionInfo vallen := _Socklen(SizeofTCPConnectionInfo) err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen) return &value, err } func SysctlKinfoProc(name string, args ...int) (*KinfoProc, error) { mib, err := sysctlmib(name, args...) if err != nil { return nil, err } var kinfo KinfoProc n := uintptr(SizeofKinfoProc) if err := sysctl(mib, (*byte)(unsafe.Pointer(&kinfo)), &n, nil, 0); err != nil { return nil, err } if n != SizeofKinfoProc { return nil, EIO } return &kinfo, nil } func SysctlKinfoProcSlice(name string, args ...int) ([]KinfoProc, error) { mib, err := sysctlmib(name, args...) if err != nil { return nil, err } for { // Find size. n := uintptr(0) if err := sysctl(mib, nil, &n, nil, 0); err != nil { return nil, err } if n == 0 { return nil, nil } if n%SizeofKinfoProc != 0 { return nil, fmt.Errorf("sysctl() returned a size of %d, which is not a multiple of %d", n, SizeofKinfoProc) } // Read into buffer of that size. buf := make([]KinfoProc, n/SizeofKinfoProc) if err := sysctl(mib, (*byte)(unsafe.Pointer(&buf[0])), &n, nil, 0); err != nil { if err == ENOMEM { // Process table grew. Try again. continue } return nil, err } if n%SizeofKinfoProc != 0 { return nil, fmt.Errorf("sysctl() returned a size of %d, which is not a multiple of %d", n, SizeofKinfoProc) } // The actual call may return less than the original reported required // size so ensure we deal with that. return buf[:n/SizeofKinfoProc], nil } } //sys pthread_chdir_np(path string) (err error) func PthreadChdir(path string) (err error) { return pthread_chdir_np(path) } //sys pthread_fchdir_np(fd int) (err error) func PthreadFchdir(fd int) (err error) { return pthread_fchdir_np(fd) } // Connectx calls connectx(2) to initiate a connection on a socket. // // srcIf, srcAddr, and dstAddr are filled into a [SaEndpoints] struct and passed as the endpoints argument. // // - srcIf is the optional source interface index. 0 means unspecified. // - srcAddr is the optional source address. nil means unspecified. // - dstAddr is the destination address. // // On success, Connectx returns the number of bytes enqueued for transmission. func Connectx(fd int, srcIf uint32, srcAddr, dstAddr Sockaddr, associd SaeAssocID, flags uint32, iov []Iovec, connid *SaeConnID) (n uintptr, err error) { endpoints := SaEndpoints{ Srcif: srcIf, } if srcAddr != nil { addrp, addrlen, err := srcAddr.sockaddr() if err != nil { return 0, err } endpoints.Srcaddr = (*RawSockaddr)(addrp) endpoints.Srcaddrlen = uint32(addrlen) } if dstAddr != nil { addrp, addrlen, err := dstAddr.sockaddr() if err != nil { return 0, err } endpoints.Dstaddr = (*RawSockaddr)(addrp) endpoints.Dstaddrlen = uint32(addrlen) } err = connectx(fd, &endpoints, associd, flags, iov, &n, connid) return } const minIovec = 8 func Readv(fd int, iovs [][]byte) (n int, err error) { iovecs := make([]Iovec, 0, minIovec) iovecs = appendBytes(iovecs, iovs) n, err = readv(fd, iovecs) readvRacedetect(iovecs, n, err) return n, err } func Preadv(fd int, iovs [][]byte, offset int64) (n int, err error) { iovecs := make([]Iovec, 0, minIovec) iovecs = appendBytes(iovecs, iovs) n, err = preadv(fd, iovecs, offset) readvRacedetect(iovecs, n, err) return n, err } func Writev(fd int, iovs [][]byte) (n int, err error) { iovecs := make([]Iovec, 0, minIovec) iovecs = appendBytes(iovecs, iovs) if raceenabled { raceReleaseMerge(unsafe.Pointer(&ioSync)) } n, err = writev(fd, iovecs) writevRacedetect(iovecs, n) return n, err } func Pwritev(fd int, iovs [][]byte, offset int64) (n int, err error) { iovecs := make([]Iovec, 0, minIovec) iovecs = appendBytes(iovecs, iovs) if raceenabled { raceReleaseMerge(unsafe.Pointer(&ioSync)) } n, err = pwritev(fd, iovecs, offset) writevRacedetect(iovecs, n) return n, err } func appendBytes(vecs []Iovec, bs [][]byte) []Iovec { for _, b := range bs { var v Iovec v.SetLen(len(b)) if len(b) > 0 { v.Base = &b[0] } else { v.Base = (*byte)(unsafe.Pointer(&_zero)) } vecs = append(vecs, v) } return vecs } func writevRacedetect(iovecs []Iovec, n int) { if !raceenabled { return } for i := 0; n > 0 && i < len(iovecs); i++ { m := int(iovecs[i].Len) if m > n { m = n } n -= m if m > 0 { raceReadRange(unsafe.Pointer(iovecs[i].Base), m) } } } func readvRacedetect(iovecs []Iovec, n int, err error) { if !raceenabled { return } for i := 0; n > 0 && i < len(iovecs); i++ { m := int(iovecs[i].Len) if m > n { m = n } n -= m if m > 0 { raceWriteRange(unsafe.Pointer(iovecs[i].Base), m) } } if err == nil { raceAcquire(unsafe.Pointer(&ioSync)) } } //sys connectx(fd int, endpoints *SaEndpoints, associd SaeAssocID, flags uint32, iov []Iovec, n *uintptr, connid *SaeConnID) (err error) //sys sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) //sys shmat(id int, addr uintptr, flag int) (ret uintptr, err error) //sys shmctl(id int, cmd int, buf *SysvShmDesc) (result int, err error) //sys shmdt(addr uintptr) (err error) //sys shmget(key int, size int, flag int) (id int, err error) /* * Exposed directly */ //sys Access(path string, mode uint32) (err error) //sys Adjtime(delta *Timeval, olddelta *Timeval) (err error) //sys Chdir(path string) (err error) //sys Chflags(path string, flags int) (err error) //sys Chmod(path string, mode uint32) (err error) //sys Chown(path string, uid int, gid int) (err error) //sys Chroot(path string) (err error) //sys ClockGettime(clockid int32, time *Timespec) (err error) //sys Close(fd int) (err error) //sys Clonefile(src string, dst string, flags int) (err error) //sys Clonefileat(srcDirfd int, src string, dstDirfd int, dst string, flags int) (err error) //sys Dup(fd int) (nfd int, err error) //sys Dup2(from int, to int) (err error) //sys Exchangedata(path1 string, path2 string, options int) (err error) //sys Exit(code int) //sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error) //sys Fchdir(fd int) (err error) //sys Fchflags(fd int, flags int) (err error) //sys Fchmod(fd int, mode uint32) (err error) //sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) //sys Fchown(fd int, uid int, gid int) (err error) //sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) //sys Fclonefileat(srcDirfd int, dstDirfd int, dst string, flags int) (err error) //sys Flock(fd int, how int) (err error) //sys Fpathconf(fd int, name int) (val int, err error) //sys Fsync(fd int) (err error) //sys Ftruncate(fd int, length int64) (err error) //sys Getcwd(buf []byte) (n int, err error) //sys Getdtablesize() (size int) //sysnb Getegid() (egid int) //sysnb Geteuid() (uid int) //sysnb Getgid() (gid int) //sysnb Getpgid(pid int) (pgid int, err error) //sysnb Getpgrp() (pgrp int) //sysnb Getpid() (pid int) //sysnb Getppid() (ppid int) //sys Getpriority(which int, who int) (prio int, err error) //sysnb Getrlimit(which int, lim *Rlimit) (err error) //sysnb Getrusage(who int, rusage *Rusage) (err error) //sysnb Getsid(pid int) (sid int, err error) //sysnb Gettimeofday(tp *Timeval) (err error) //sysnb Getuid() (uid int) //sysnb Issetugid() (tainted bool) //sys Kqueue() (fd int, err error) //sys Lchown(path string, uid int, gid int) (err error) //sys Link(path string, link string) (err error) //sys Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) //sys Listen(s int, backlog int) (err error) //sys Mkdir(path string, mode uint32) (err error) //sys Mkdirat(dirfd int, path string, mode uint32) (err error) //sys Mkfifo(path string, mode uint32) (err error) //sys Mknod(path string, mode uint32, dev int) (err error) //sys Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) //sys Open(path string, mode int, perm uint32) (fd int, err error) //sys Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) //sys Pathconf(path string, name int) (val int, err error) //sys pread(fd int, p []byte, offset int64) (n int, err error) //sys pwrite(fd int, p []byte, offset int64) (n int, err error) //sys read(fd int, p []byte) (n int, err error) //sys Readlink(path string, buf []byte) (n int, err error) //sys Readlinkat(dirfd int, path string, buf []byte) (n int, err error) //sys Rename(from string, to string) (err error) //sys Renameat(fromfd int, from string, tofd int, to string) (err error) //sys Revoke(path string) (err error) //sys Rmdir(path string) (err error) //sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) //sys Setattrlist(path string, attrlist *Attrlist, attrBuf []byte, options int) (err error) //sys Setegid(egid int) (err error) //sysnb Seteuid(euid int) (err error) //sysnb Setgid(gid int) (err error) //sys Setlogin(name string) (err error) //sysnb Setpgid(pid int, pgid int) (err error) //sys Setpriority(which int, who int, prio int) (err error) //sys Setprivexec(flag int) (err error) //sysnb Setregid(rgid int, egid int) (err error) //sysnb Setreuid(ruid int, euid int) (err error) //sysnb Setsid() (pid int, err error) //sysnb Settimeofday(tp *Timeval) (err error) //sysnb Setuid(uid int) (err error) //sys Symlink(path string, link string) (err error) //sys Symlinkat(oldpath string, newdirfd int, newpath string) (err error) //sys Sync() (err error) //sys Truncate(path string, length int64) (err error) //sys Umask(newmask int) (oldmask int) //sys Undelete(path string) (err error) //sys Unlink(path string) (err error) //sys Unlinkat(dirfd int, path string, flags int) (err error) //sys Unmount(path string, flags int) (err error) //sys write(fd int, p []byte) (n int, err error) //sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) //sys munmap(addr uintptr, length uintptr) (err error) //sys readv(fd int, iovecs []Iovec) (n int, err error) //sys preadv(fd int, iovecs []Iovec, offset int64) (n int, err error) //sys writev(fd int, iovecs []Iovec) (n int, err error) //sys pwritev(fd int, iovecs []Iovec, offset int64) (n int, err error) ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go ================================================ // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build amd64 && darwin package unix import "syscall" func setTimespec(sec, nsec int64) Timespec { return Timespec{Sec: sec, Nsec: nsec} } func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: sec, Usec: int32(usec)} } func SetKevent(k *Kevent_t, fd, mode, flags int) { k.Ident = uint64(fd) k.Filter = int16(mode) k.Flags = uint16(flags) } func (iov *Iovec) SetLen(length int) { iov.Len = uint64(length) } func (msghdr *Msghdr) SetControllen(length int) { msghdr.Controllen = uint32(length) } func (msghdr *Msghdr) SetIovlen(length int) { msghdr.Iovlen = int32(length) } func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint32(length) } func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) //sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64 //sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64 //sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_FSTATFS64 //sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT64 //sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64 //sys ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) = SYS_ptrace //sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64 //sys Statfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64 ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go ================================================ // Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build arm64 && darwin package unix import "syscall" func setTimespec(sec, nsec int64) Timespec { return Timespec{Sec: sec, Nsec: nsec} } func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: sec, Usec: int32(usec)} } func SetKevent(k *Kevent_t, fd, mode, flags int) { k.Ident = uint64(fd) k.Filter = int16(mode) k.Flags = uint16(flags) } func (iov *Iovec) SetLen(length int) { iov.Len = uint64(length) } func (msghdr *Msghdr) SetControllen(length int) { msghdr.Controllen = uint32(length) } func (msghdr *Msghdr) SetIovlen(length int) { msghdr.Iovlen = int32(length) } func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint32(length) } func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) // sic //sys Fstat(fd int, stat *Stat_t) (err error) //sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) //sys Fstatfs(fd int, stat *Statfs_t) (err error) //sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT //sys Lstat(path string, stat *Stat_t) (err error) //sys ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) = SYS_ptrace //sys Stat(path string, stat *Stat_t) (err error) //sys Statfs(path string, stat *Statfs_t) (err error) ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build darwin package unix import _ "unsafe" // Implemented in the runtime package (runtime/sys_darwin.go) func syscall_syscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) func syscall_syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) func syscall_syscall6X(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) func syscall_syscall9(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) // 32-bit only func syscall_rawSyscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) func syscall_rawSyscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) func syscall_syscallPtr(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) //go:linkname syscall_syscall syscall.syscall //go:linkname syscall_syscall6 syscall.syscall6 //go:linkname syscall_syscall6X syscall.syscall6X //go:linkname syscall_syscall9 syscall.syscall9 //go:linkname syscall_rawSyscall syscall.rawSyscall //go:linkname syscall_rawSyscall6 syscall.rawSyscall6 //go:linkname syscall_syscallPtr syscall.syscallPtr ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_dragonfly.go ================================================ // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // DragonFly BSD system calls. // This file is compiled as ordinary Go code, // but it is also input to mksyscall, // which parses the //sys lines and generates system call stubs. // Note that sometimes we use a lowercase //sys name and wrap // it in our own nicer implementation, either here or in // syscall_bsd.go or syscall_unix.go. package unix import ( "sync" "unsafe" ) // See version list in https://github.com/DragonFlyBSD/DragonFlyBSD/blob/master/sys/sys/param.h var ( osreldateOnce sync.Once osreldate uint32 ) // First __DragonFly_version after September 2019 ABI changes // http://lists.dragonflybsd.org/pipermail/users/2019-September/358280.html const _dragonflyABIChangeVersion = 500705 func supportsABI(ver uint32) bool { osreldateOnce.Do(func() { osreldate, _ = SysctlUint32("kern.osreldate") }) return osreldate >= ver } // SockaddrDatalink implements the Sockaddr interface for AF_LINK type sockets. type SockaddrDatalink struct { Len uint8 Family uint8 Index uint16 Type uint8 Nlen uint8 Alen uint8 Slen uint8 Data [12]int8 Rcf uint16 Route [16]uint16 raw RawSockaddrDatalink } func anyToSockaddrGOOS(fd int, rsa *RawSockaddrAny) (Sockaddr, error) { return nil, EAFNOSUPPORT } // Translate "kern.hostname" to []_C_int{0,1,2,3}. func nametomib(name string) (mib []_C_int, err error) { const siz = unsafe.Sizeof(mib[0]) // NOTE(rsc): It seems strange to set the buffer to have // size CTL_MAXNAME+2 but use only CTL_MAXNAME // as the size. I don't know why the +2 is here, but the // kernel uses +2 for its own implementation of this function. // I am scared that if we don't include the +2 here, the kernel // will silently write 2 words farther than we specify // and we'll get memory corruption. var buf [CTL_MAXNAME + 2]_C_int n := uintptr(CTL_MAXNAME) * siz p := (*byte)(unsafe.Pointer(&buf[0])) bytes, err := ByteSliceFromString(name) if err != nil { return nil, err } // Magic sysctl: "setting" 0.3 to a string name // lets you read back the array of integers form. if err = sysctl([]_C_int{0, 3}, p, &n, &bytes[0], uintptr(len(name))); err != nil { return nil, err } return buf[0 : n/siz], nil } func direntIno(buf []byte) (uint64, bool) { return readInt(buf, unsafe.Offsetof(Dirent{}.Fileno), unsafe.Sizeof(Dirent{}.Fileno)) } func direntReclen(buf []byte) (uint64, bool) { namlen, ok := direntNamlen(buf) if !ok { return 0, false } return (16 + namlen + 1 + 7) &^ 7, true } func direntNamlen(buf []byte) (uint64, bool) { return readInt(buf, unsafe.Offsetof(Dirent{}.Namlen), unsafe.Sizeof(Dirent{}.Namlen)) } //sysnb pipe() (r int, w int, err error) func Pipe(p []int) (err error) { if len(p) != 2 { return EINVAL } r, w, err := pipe() if err == nil { p[0], p[1] = r, w } return } //sysnb pipe2(p *[2]_C_int, flags int) (r int, w int, err error) func Pipe2(p []int, flags int) (err error) { if len(p) != 2 { return EINVAL } var pp [2]_C_int // pipe2 on dragonfly takes an fds array as an argument, but still // returns the file descriptors. r, w, err := pipe2(&pp, flags) if err == nil { p[0], p[1] = r, w } return err } //sys extpread(fd int, p []byte, flags int, offset int64) (n int, err error) func pread(fd int, p []byte, offset int64) (n int, err error) { return extpread(fd, p, 0, offset) } //sys extpwrite(fd int, p []byte, flags int, offset int64) (n int, err error) func pwrite(fd int, p []byte, offset int64) (n int, err error) { return extpwrite(fd, p, 0, offset) } func Accept4(fd, flags int) (nfd int, sa Sockaddr, err error) { var rsa RawSockaddrAny var len _Socklen = SizeofSockaddrAny nfd, err = accept4(fd, &rsa, &len, flags) if err != nil { return } if len > SizeofSockaddrAny { panic("RawSockaddrAny too small") } sa, err = anyToSockaddr(fd, &rsa) if err != nil { Close(nfd) nfd = 0 } return } //sys Getcwd(buf []byte) (n int, err error) = SYS___GETCWD func Getfsstat(buf []Statfs_t, flags int) (n int, err error) { var _p0 unsafe.Pointer var bufsize uintptr if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) bufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf)) } r0, _, e1 := Syscall(SYS_GETFSSTAT, uintptr(_p0), bufsize, uintptr(flags)) n = int(r0) if e1 != 0 { err = e1 } return } //sys ioctl(fd int, req uint, arg uintptr) (err error) //sys ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) = SYS_IOCTL //sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL func sysctlUname(mib []_C_int, old *byte, oldlen *uintptr) error { err := sysctl(mib, old, oldlen, nil, 0) if err != nil { // Utsname members on Dragonfly are only 32 bytes and // the syscall returns ENOMEM in case the actual value // is longer. if err == ENOMEM { err = nil } } return err } func Uname(uname *Utsname) error { mib := []_C_int{CTL_KERN, KERN_OSTYPE} n := unsafe.Sizeof(uname.Sysname) if err := sysctlUname(mib, &uname.Sysname[0], &n); err != nil { return err } uname.Sysname[unsafe.Sizeof(uname.Sysname)-1] = 0 mib = []_C_int{CTL_KERN, KERN_HOSTNAME} n = unsafe.Sizeof(uname.Nodename) if err := sysctlUname(mib, &uname.Nodename[0], &n); err != nil { return err } uname.Nodename[unsafe.Sizeof(uname.Nodename)-1] = 0 mib = []_C_int{CTL_KERN, KERN_OSRELEASE} n = unsafe.Sizeof(uname.Release) if err := sysctlUname(mib, &uname.Release[0], &n); err != nil { return err } uname.Release[unsafe.Sizeof(uname.Release)-1] = 0 mib = []_C_int{CTL_KERN, KERN_VERSION} n = unsafe.Sizeof(uname.Version) if err := sysctlUname(mib, &uname.Version[0], &n); err != nil { return err } // The version might have newlines or tabs in it, convert them to // spaces. for i, b := range uname.Version { if b == '\n' || b == '\t' { if i == len(uname.Version)-1 { uname.Version[i] = 0 } else { uname.Version[i] = ' ' } } } mib = []_C_int{CTL_HW, HW_MACHINE} n = unsafe.Sizeof(uname.Machine) if err := sysctlUname(mib, &uname.Machine[0], &n); err != nil { return err } uname.Machine[unsafe.Sizeof(uname.Machine)-1] = 0 return nil } func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { if raceenabled { raceReleaseMerge(unsafe.Pointer(&ioSync)) } return sendfile(outfd, infd, offset, count) } func Dup3(oldfd, newfd, flags int) error { if oldfd == newfd || flags&^O_CLOEXEC != 0 { return EINVAL } how := F_DUP2FD if flags&O_CLOEXEC != 0 { how = F_DUP2FD_CLOEXEC } _, err := fcntl(oldfd, how, newfd) return err } /* * Exposed directly */ //sys Access(path string, mode uint32) (err error) //sys Adjtime(delta *Timeval, olddelta *Timeval) (err error) //sys Chdir(path string) (err error) //sys Chflags(path string, flags int) (err error) //sys Chmod(path string, mode uint32) (err error) //sys Chown(path string, uid int, gid int) (err error) //sys Chroot(path string) (err error) //sys ClockGettime(clockid int32, time *Timespec) (err error) //sys Close(fd int) (err error) //sys Dup(fd int) (nfd int, err error) //sys Dup2(from int, to int) (err error) //sys Exit(code int) //sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error) //sys Fchdir(fd int) (err error) //sys Fchflags(fd int, flags int) (err error) //sys Fchmod(fd int, mode uint32) (err error) //sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) //sys Fchown(fd int, uid int, gid int) (err error) //sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) //sys Flock(fd int, how int) (err error) //sys Fpathconf(fd int, name int) (val int, err error) //sys Fstat(fd int, stat *Stat_t) (err error) //sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) //sys Fstatfs(fd int, stat *Statfs_t) (err error) //sys Fsync(fd int) (err error) //sys Ftruncate(fd int, length int64) (err error) //sys Getdents(fd int, buf []byte) (n int, err error) //sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) //sys Getdtablesize() (size int) //sysnb Getegid() (egid int) //sysnb Geteuid() (uid int) //sysnb Getgid() (gid int) //sysnb Getpgid(pid int) (pgid int, err error) //sysnb Getpgrp() (pgrp int) //sysnb Getpid() (pid int) //sysnb Getppid() (ppid int) //sys Getpriority(which int, who int) (prio int, err error) //sysnb Getrlimit(which int, lim *Rlimit) (err error) //sysnb Getrusage(who int, rusage *Rusage) (err error) //sysnb Getsid(pid int) (sid int, err error) //sysnb Gettimeofday(tv *Timeval) (err error) //sysnb Getuid() (uid int) //sys Issetugid() (tainted bool) //sys Kill(pid int, signum syscall.Signal) (err error) //sys Kqueue() (fd int, err error) //sys Lchown(path string, uid int, gid int) (err error) //sys Link(path string, link string) (err error) //sys Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) //sys Listen(s int, backlog int) (err error) //sys Lstat(path string, stat *Stat_t) (err error) //sys Mkdir(path string, mode uint32) (err error) //sys Mkdirat(dirfd int, path string, mode uint32) (err error) //sys Mkfifo(path string, mode uint32) (err error) //sys Mknod(path string, mode uint32, dev int) (err error) //sys Mknodat(fd int, path string, mode uint32, dev int) (err error) //sys Nanosleep(time *Timespec, leftover *Timespec) (err error) //sys Open(path string, mode int, perm uint32) (fd int, err error) //sys Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) //sys Pathconf(path string, name int) (val int, err error) //sys read(fd int, p []byte) (n int, err error) //sys Readlink(path string, buf []byte) (n int, err error) //sys Rename(from string, to string) (err error) //sys Renameat(fromfd int, from string, tofd int, to string) (err error) //sys Revoke(path string) (err error) //sys Rmdir(path string) (err error) //sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) //sysnb Setegid(egid int) (err error) //sysnb Seteuid(euid int) (err error) //sysnb Setgid(gid int) (err error) //sys Setlogin(name string) (err error) //sysnb Setpgid(pid int, pgid int) (err error) //sys Setpriority(which int, who int, prio int) (err error) //sysnb Setregid(rgid int, egid int) (err error) //sysnb Setreuid(ruid int, euid int) (err error) //sysnb Setresgid(rgid int, egid int, sgid int) (err error) //sysnb Setresuid(ruid int, euid int, suid int) (err error) //sysnb Setsid() (pid int, err error) //sysnb Settimeofday(tp *Timeval) (err error) //sysnb Setuid(uid int) (err error) //sys Stat(path string, stat *Stat_t) (err error) //sys Statfs(path string, stat *Statfs_t) (err error) //sys Symlink(path string, link string) (err error) //sys Symlinkat(oldpath string, newdirfd int, newpath string) (err error) //sys Sync() (err error) //sys Truncate(path string, length int64) (err error) //sys Umask(newmask int) (oldmask int) //sys Undelete(path string) (err error) //sys Unlink(path string) (err error) //sys Unlinkat(dirfd int, path string, flags int) (err error) //sys Unmount(path string, flags int) (err error) //sys write(fd int, p []byte) (n int, err error) //sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) //sys munmap(addr uintptr, length uintptr) (err error) //sys accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error) //sys utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go ================================================ // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build amd64 && dragonfly package unix import ( "syscall" "unsafe" ) func setTimespec(sec, nsec int64) Timespec { return Timespec{Sec: sec, Nsec: nsec} } func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: sec, Usec: usec} } func SetKevent(k *Kevent_t, fd, mode, flags int) { k.Ident = uint64(fd) k.Filter = int16(mode) k.Flags = uint16(flags) } func (iov *Iovec) SetLen(length int) { iov.Len = uint64(length) } func (msghdr *Msghdr) SetControllen(length int) { msghdr.Controllen = uint32(length) } func (msghdr *Msghdr) SetIovlen(length int) { msghdr.Iovlen = int32(length) } func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint32(length) } func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { var writtenOut uint64 = 0 _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0) written = int(writtenOut) if e1 != 0 { err = e1 } return } func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_freebsd.go ================================================ // Copyright 2009,2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // FreeBSD system calls. // This file is compiled as ordinary Go code, // but it is also input to mksyscall, // which parses the //sys lines and generates system call stubs. // Note that sometimes we use a lowercase //sys name and wrap // it in our own nicer implementation, either here or in // syscall_bsd.go or syscall_unix.go. package unix import ( "errors" "sync" "unsafe" ) // See https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/versions.html. var ( osreldateOnce sync.Once osreldate uint32 ) func supportsABI(ver uint32) bool { osreldateOnce.Do(func() { osreldate, _ = SysctlUint32("kern.osreldate") }) return osreldate >= ver } // SockaddrDatalink implements the Sockaddr interface for AF_LINK type sockets. type SockaddrDatalink struct { Len uint8 Family uint8 Index uint16 Type uint8 Nlen uint8 Alen uint8 Slen uint8 Data [46]int8 raw RawSockaddrDatalink } func anyToSockaddrGOOS(fd int, rsa *RawSockaddrAny) (Sockaddr, error) { return nil, EAFNOSUPPORT } // Translate "kern.hostname" to []_C_int{0,1,2,3}. func nametomib(name string) (mib []_C_int, err error) { const siz = unsafe.Sizeof(mib[0]) // NOTE(rsc): It seems strange to set the buffer to have // size CTL_MAXNAME+2 but use only CTL_MAXNAME // as the size. I don't know why the +2 is here, but the // kernel uses +2 for its own implementation of this function. // I am scared that if we don't include the +2 here, the kernel // will silently write 2 words farther than we specify // and we'll get memory corruption. var buf [CTL_MAXNAME + 2]_C_int n := uintptr(CTL_MAXNAME) * siz p := (*byte)(unsafe.Pointer(&buf[0])) bytes, err := ByteSliceFromString(name) if err != nil { return nil, err } // Magic sysctl: "setting" 0.3 to a string name // lets you read back the array of integers form. if err = sysctl([]_C_int{0, 3}, p, &n, &bytes[0], uintptr(len(name))); err != nil { return nil, err } return buf[0 : n/siz], nil } func direntIno(buf []byte) (uint64, bool) { return readInt(buf, unsafe.Offsetof(Dirent{}.Fileno), unsafe.Sizeof(Dirent{}.Fileno)) } func direntReclen(buf []byte) (uint64, bool) { return readInt(buf, unsafe.Offsetof(Dirent{}.Reclen), unsafe.Sizeof(Dirent{}.Reclen)) } func direntNamlen(buf []byte) (uint64, bool) { return readInt(buf, unsafe.Offsetof(Dirent{}.Namlen), unsafe.Sizeof(Dirent{}.Namlen)) } func Pipe(p []int) (err error) { return Pipe2(p, 0) } //sysnb pipe2(p *[2]_C_int, flags int) (err error) func Pipe2(p []int, flags int) error { if len(p) != 2 { return EINVAL } var pp [2]_C_int err := pipe2(&pp, flags) if err == nil { p[0] = int(pp[0]) p[1] = int(pp[1]) } return err } func GetsockoptIPMreqn(fd, level, opt int) (*IPMreqn, error) { var value IPMreqn vallen := _Socklen(SizeofIPMreqn) errno := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen) return &value, errno } func SetsockoptIPMreqn(fd, level, opt int, mreq *IPMreqn) (err error) { return setsockopt(fd, level, opt, unsafe.Pointer(mreq), unsafe.Sizeof(*mreq)) } // GetsockoptXucred is a getsockopt wrapper that returns an Xucred struct. // The usual level and opt are SOL_LOCAL and LOCAL_PEERCRED, respectively. func GetsockoptXucred(fd, level, opt int) (*Xucred, error) { x := new(Xucred) vallen := _Socklen(SizeofXucred) err := getsockopt(fd, level, opt, unsafe.Pointer(x), &vallen) return x, err } func Accept4(fd, flags int) (nfd int, sa Sockaddr, err error) { var rsa RawSockaddrAny var len _Socklen = SizeofSockaddrAny nfd, err = accept4(fd, &rsa, &len, flags) if err != nil { return } if len > SizeofSockaddrAny { panic("RawSockaddrAny too small") } sa, err = anyToSockaddr(fd, &rsa) if err != nil { Close(nfd) nfd = 0 } return } //sys Getcwd(buf []byte) (n int, err error) = SYS___GETCWD func Getfsstat(buf []Statfs_t, flags int) (n int, err error) { var ( _p0 unsafe.Pointer bufsize uintptr ) if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) bufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf)) } r0, _, e1 := Syscall(SYS_GETFSSTAT, uintptr(_p0), bufsize, uintptr(flags)) n = int(r0) if e1 != 0 { err = e1 } return } //sys ioctl(fd int, req uint, arg uintptr) (err error) = SYS_IOCTL //sys ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) = SYS_IOCTL //sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL func Uname(uname *Utsname) error { mib := []_C_int{CTL_KERN, KERN_OSTYPE} n := unsafe.Sizeof(uname.Sysname) // Suppress ENOMEM errors to be compatible with the C library __xuname() implementation. if err := sysctl(mib, &uname.Sysname[0], &n, nil, 0); err != nil && !errors.Is(err, ENOMEM) { return err } mib = []_C_int{CTL_KERN, KERN_HOSTNAME} n = unsafe.Sizeof(uname.Nodename) if err := sysctl(mib, &uname.Nodename[0], &n, nil, 0); err != nil && !errors.Is(err, ENOMEM) { return err } mib = []_C_int{CTL_KERN, KERN_OSRELEASE} n = unsafe.Sizeof(uname.Release) if err := sysctl(mib, &uname.Release[0], &n, nil, 0); err != nil && !errors.Is(err, ENOMEM) { return err } mib = []_C_int{CTL_KERN, KERN_VERSION} n = unsafe.Sizeof(uname.Version) if err := sysctl(mib, &uname.Version[0], &n, nil, 0); err != nil && !errors.Is(err, ENOMEM) { return err } // The version might have newlines or tabs in it, convert them to // spaces. for i, b := range uname.Version { if b == '\n' || b == '\t' { if i == len(uname.Version)-1 { uname.Version[i] = 0 } else { uname.Version[i] = ' ' } } } mib = []_C_int{CTL_HW, HW_MACHINE} n = unsafe.Sizeof(uname.Machine) if err := sysctl(mib, &uname.Machine[0], &n, nil, 0); err != nil && !errors.Is(err, ENOMEM) { return err } return nil } func Stat(path string, st *Stat_t) (err error) { return Fstatat(AT_FDCWD, path, st, 0) } func Lstat(path string, st *Stat_t) (err error) { return Fstatat(AT_FDCWD, path, st, AT_SYMLINK_NOFOLLOW) } func Getdents(fd int, buf []byte) (n int, err error) { return Getdirentries(fd, buf, nil) } func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { if basep == nil || unsafe.Sizeof(*basep) == 8 { return getdirentries(fd, buf, (*uint64)(unsafe.Pointer(basep))) } // The syscall needs a 64-bit base. On 32-bit machines // we can't just use the basep passed in. See #32498. var base uint64 = uint64(*basep) n, err = getdirentries(fd, buf, &base) *basep = uintptr(base) if base>>32 != 0 { // We can't stuff the base back into a uintptr, so any // future calls would be suspect. Generate an error. // EIO is allowed by getdirentries. err = EIO } return } func Mknod(path string, mode uint32, dev uint64) (err error) { return Mknodat(AT_FDCWD, path, mode, dev) } func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { if raceenabled { raceReleaseMerge(unsafe.Pointer(&ioSync)) } return sendfile(outfd, infd, offset, count) } //sys ptrace(request int, pid int, addr uintptr, data int) (err error) //sys ptracePtr(request int, pid int, addr unsafe.Pointer, data int) (err error) = SYS_PTRACE func PtraceAttach(pid int) (err error) { return ptrace(PT_ATTACH, pid, 0, 0) } func PtraceCont(pid int, signal int) (err error) { return ptrace(PT_CONTINUE, pid, 1, signal) } func PtraceDetach(pid int) (err error) { return ptrace(PT_DETACH, pid, 1, 0) } func PtraceGetFpRegs(pid int, fpregsout *FpReg) (err error) { return ptracePtr(PT_GETFPREGS, pid, unsafe.Pointer(fpregsout), 0) } func PtraceGetRegs(pid int, regsout *Reg) (err error) { return ptracePtr(PT_GETREGS, pid, unsafe.Pointer(regsout), 0) } func PtraceIO(req int, pid int, offs uintptr, out []byte, countin int) (count int, err error) { ioDesc := PtraceIoDesc{ Op: int32(req), Offs: offs, } if countin > 0 { _ = out[:countin] // check bounds ioDesc.Addr = &out[0] } else if out != nil { ioDesc.Addr = (*byte)(unsafe.Pointer(&_zero)) } ioDesc.SetLen(countin) err = ptracePtr(PT_IO, pid, unsafe.Pointer(&ioDesc), 0) return int(ioDesc.Len), err } func PtraceLwpEvents(pid int, enable int) (err error) { return ptrace(PT_LWP_EVENTS, pid, 0, enable) } func PtraceLwpInfo(pid int, info *PtraceLwpInfoStruct) (err error) { return ptracePtr(PT_LWPINFO, pid, unsafe.Pointer(info), int(unsafe.Sizeof(*info))) } func PtracePeekData(pid int, addr uintptr, out []byte) (count int, err error) { return PtraceIO(PIOD_READ_D, pid, addr, out, SizeofLong) } func PtracePeekText(pid int, addr uintptr, out []byte) (count int, err error) { return PtraceIO(PIOD_READ_I, pid, addr, out, SizeofLong) } func PtracePokeData(pid int, addr uintptr, data []byte) (count int, err error) { return PtraceIO(PIOD_WRITE_D, pid, addr, data, SizeofLong) } func PtracePokeText(pid int, addr uintptr, data []byte) (count int, err error) { return PtraceIO(PIOD_WRITE_I, pid, addr, data, SizeofLong) } func PtraceSetRegs(pid int, regs *Reg) (err error) { return ptracePtr(PT_SETREGS, pid, unsafe.Pointer(regs), 0) } func PtraceSingleStep(pid int) (err error) { return ptrace(PT_STEP, pid, 1, 0) } func Dup3(oldfd, newfd, flags int) error { if oldfd == newfd || flags&^O_CLOEXEC != 0 { return EINVAL } how := F_DUP2FD if flags&O_CLOEXEC != 0 { how = F_DUP2FD_CLOEXEC } _, err := fcntl(oldfd, how, newfd) return err } /* * Exposed directly */ //sys Access(path string, mode uint32) (err error) //sys Adjtime(delta *Timeval, olddelta *Timeval) (err error) //sys CapEnter() (err error) //sys capRightsGet(version int, fd int, rightsp *CapRights) (err error) = SYS___CAP_RIGHTS_GET //sys capRightsLimit(fd int, rightsp *CapRights) (err error) //sys Chdir(path string) (err error) //sys Chflags(path string, flags int) (err error) //sys Chmod(path string, mode uint32) (err error) //sys Chown(path string, uid int, gid int) (err error) //sys Chroot(path string) (err error) //sys ClockGettime(clockid int32, time *Timespec) (err error) //sys Close(fd int) (err error) //sys Dup(fd int) (nfd int, err error) //sys Dup2(from int, to int) (err error) //sys Exit(code int) //sys ExtattrGetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) //sys ExtattrSetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) //sys ExtattrDeleteFd(fd int, attrnamespace int, attrname string) (err error) //sys ExtattrListFd(fd int, attrnamespace int, data uintptr, nbytes int) (ret int, err error) //sys ExtattrGetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) //sys ExtattrSetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) //sys ExtattrDeleteFile(file string, attrnamespace int, attrname string) (err error) //sys ExtattrListFile(file string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) //sys ExtattrGetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) //sys ExtattrSetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) //sys ExtattrDeleteLink(link string, attrnamespace int, attrname string) (err error) //sys ExtattrListLink(link string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_POSIX_FADVISE //sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error) //sys Fchdir(fd int) (err error) //sys Fchflags(fd int, flags int) (err error) //sys Fchmod(fd int, mode uint32) (err error) //sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) //sys Fchown(fd int, uid int, gid int) (err error) //sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) //sys Flock(fd int, how int) (err error) //sys Fpathconf(fd int, name int) (val int, err error) //sys Fstat(fd int, stat *Stat_t) (err error) //sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) //sys Fstatfs(fd int, stat *Statfs_t) (err error) //sys Fsync(fd int) (err error) //sys Ftruncate(fd int, length int64) (err error) //sys getdirentries(fd int, buf []byte, basep *uint64) (n int, err error) //sys Getdtablesize() (size int) //sysnb Getegid() (egid int) //sysnb Geteuid() (uid int) //sysnb Getgid() (gid int) //sysnb Getpgid(pid int) (pgid int, err error) //sysnb Getpgrp() (pgrp int) //sysnb Getpid() (pid int) //sysnb Getppid() (ppid int) //sys Getpriority(which int, who int) (prio int, err error) //sysnb Getrlimit(which int, lim *Rlimit) (err error) //sysnb Getrusage(who int, rusage *Rusage) (err error) //sysnb Getsid(pid int) (sid int, err error) //sysnb Gettimeofday(tv *Timeval) (err error) //sysnb Getuid() (uid int) //sys Issetugid() (tainted bool) //sys Kill(pid int, signum syscall.Signal) (err error) //sys Kqueue() (fd int, err error) //sys Lchown(path string, uid int, gid int) (err error) //sys Link(path string, link string) (err error) //sys Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) //sys Listen(s int, backlog int) (err error) //sys Mkdir(path string, mode uint32) (err error) //sys Mkdirat(dirfd int, path string, mode uint32) (err error) //sys Mkfifo(path string, mode uint32) (err error) //sys Mknodat(fd int, path string, mode uint32, dev uint64) (err error) //sys Nanosleep(time *Timespec, leftover *Timespec) (err error) //sys Open(path string, mode int, perm uint32) (fd int, err error) //sys Openat(fdat int, path string, mode int, perm uint32) (fd int, err error) //sys Pathconf(path string, name int) (val int, err error) //sys pread(fd int, p []byte, offset int64) (n int, err error) //sys pwrite(fd int, p []byte, offset int64) (n int, err error) //sys read(fd int, p []byte) (n int, err error) //sys Readlink(path string, buf []byte) (n int, err error) //sys Readlinkat(dirfd int, path string, buf []byte) (n int, err error) //sys Rename(from string, to string) (err error) //sys Renameat(fromfd int, from string, tofd int, to string) (err error) //sys Revoke(path string) (err error) //sys Rmdir(path string) (err error) //sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) //sysnb Setegid(egid int) (err error) //sysnb Seteuid(euid int) (err error) //sysnb Setgid(gid int) (err error) //sys Setlogin(name string) (err error) //sysnb Setpgid(pid int, pgid int) (err error) //sys Setpriority(which int, who int, prio int) (err error) //sysnb Setregid(rgid int, egid int) (err error) //sysnb Setreuid(ruid int, euid int) (err error) //sysnb Setresgid(rgid int, egid int, sgid int) (err error) //sysnb Setresuid(ruid int, euid int, suid int) (err error) //sysnb Setsid() (pid int, err error) //sysnb Settimeofday(tp *Timeval) (err error) //sysnb Setuid(uid int) (err error) //sys Statfs(path string, stat *Statfs_t) (err error) //sys Symlink(path string, link string) (err error) //sys Symlinkat(oldpath string, newdirfd int, newpath string) (err error) //sys Sync() (err error) //sys Truncate(path string, length int64) (err error) //sys Umask(newmask int) (oldmask int) //sys Undelete(path string) (err error) //sys Unlink(path string) (err error) //sys Unlinkat(dirfd int, path string, flags int) (err error) //sys Unmount(path string, flags int) (err error) //sys write(fd int, p []byte) (n int, err error) //sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) //sys munmap(addr uintptr, length uintptr) (err error) //sys accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error) //sys utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_freebsd_386.go ================================================ // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build 386 && freebsd package unix import ( "syscall" "unsafe" ) func setTimespec(sec, nsec int64) Timespec { return Timespec{Sec: int32(sec), Nsec: int32(nsec)} } func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: int32(sec), Usec: int32(usec)} } func SetKevent(k *Kevent_t, fd, mode, flags int) { k.Ident = uint32(fd) k.Filter = int16(mode) k.Flags = uint16(flags) } func (iov *Iovec) SetLen(length int) { iov.Len = uint32(length) } func (msghdr *Msghdr) SetControllen(length int) { msghdr.Controllen = uint32(length) } func (msghdr *Msghdr) SetIovlen(length int) { msghdr.Iovlen = int32(length) } func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint32(length) } func (d *PtraceIoDesc) SetLen(length int) { d.Len = uint32(length) } func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { var writtenOut uint64 = 0 _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr((*offset)>>32), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0) written = int(writtenOut) if e1 != 0 { err = e1 } return } func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) func PtraceGetFsBase(pid int, fsbase *int64) (err error) { return ptracePtr(PT_GETFSBASE, pid, unsafe.Pointer(fsbase), 0) } ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go ================================================ // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build amd64 && freebsd package unix import ( "syscall" "unsafe" ) func setTimespec(sec, nsec int64) Timespec { return Timespec{Sec: sec, Nsec: nsec} } func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: sec, Usec: usec} } func SetKevent(k *Kevent_t, fd, mode, flags int) { k.Ident = uint64(fd) k.Filter = int16(mode) k.Flags = uint16(flags) } func (iov *Iovec) SetLen(length int) { iov.Len = uint64(length) } func (msghdr *Msghdr) SetControllen(length int) { msghdr.Controllen = uint32(length) } func (msghdr *Msghdr) SetIovlen(length int) { msghdr.Iovlen = int32(length) } func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint32(length) } func (d *PtraceIoDesc) SetLen(length int) { d.Len = uint64(length) } func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { var writtenOut uint64 = 0 _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0) written = int(writtenOut) if e1 != 0 { err = e1 } return } func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) func PtraceGetFsBase(pid int, fsbase *int64) (err error) { return ptracePtr(PT_GETFSBASE, pid, unsafe.Pointer(fsbase), 0) } ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go ================================================ // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build arm && freebsd package unix import ( "syscall" "unsafe" ) func setTimespec(sec, nsec int64) Timespec { return Timespec{Sec: sec, Nsec: int32(nsec)} } func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: sec, Usec: int32(usec)} } func SetKevent(k *Kevent_t, fd, mode, flags int) { k.Ident = uint32(fd) k.Filter = int16(mode) k.Flags = uint16(flags) } func (iov *Iovec) SetLen(length int) { iov.Len = uint32(length) } func (msghdr *Msghdr) SetControllen(length int) { msghdr.Controllen = uint32(length) } func (msghdr *Msghdr) SetIovlen(length int) { msghdr.Iovlen = int32(length) } func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint32(length) } func (d *PtraceIoDesc) SetLen(length int) { d.Len = uint32(length) } func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { var writtenOut uint64 = 0 _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr((*offset)>>32), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0) written = int(writtenOut) if e1 != 0 { err = e1 } return } func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build arm64 && freebsd package unix import ( "syscall" "unsafe" ) func setTimespec(sec, nsec int64) Timespec { return Timespec{Sec: sec, Nsec: nsec} } func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: sec, Usec: usec} } func SetKevent(k *Kevent_t, fd, mode, flags int) { k.Ident = uint64(fd) k.Filter = int16(mode) k.Flags = uint16(flags) } func (iov *Iovec) SetLen(length int) { iov.Len = uint64(length) } func (msghdr *Msghdr) SetControllen(length int) { msghdr.Controllen = uint32(length) } func (msghdr *Msghdr) SetIovlen(length int) { msghdr.Iovlen = int32(length) } func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint32(length) } func (d *PtraceIoDesc) SetLen(length int) { d.Len = uint64(length) } func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { var writtenOut uint64 = 0 _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0) written = int(writtenOut) if e1 != 0 { err = e1 } return } func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_freebsd_riscv64.go ================================================ // Copyright 2022 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build riscv64 && freebsd package unix import ( "syscall" "unsafe" ) func setTimespec(sec, nsec int64) Timespec { return Timespec{Sec: sec, Nsec: nsec} } func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: sec, Usec: usec} } func SetKevent(k *Kevent_t, fd, mode, flags int) { k.Ident = uint64(fd) k.Filter = int16(mode) k.Flags = uint16(flags) } func (iov *Iovec) SetLen(length int) { iov.Len = uint64(length) } func (msghdr *Msghdr) SetControllen(length int) { msghdr.Controllen = uint32(length) } func (msghdr *Msghdr) SetIovlen(length int) { msghdr.Iovlen = int32(length) } func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint32(length) } func (d *PtraceIoDesc) SetLen(length int) { d.Len = uint64(length) } func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { var writtenOut uint64 = 0 _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0) written = int(writtenOut) if e1 != 0 { err = e1 } return } func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_hurd.go ================================================ // Copyright 2022 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build hurd package unix /* #include int ioctl(int, unsigned long int, uintptr_t); */ import "C" import "unsafe" func ioctl(fd int, req uint, arg uintptr) (err error) { r0, er := C.ioctl(C.int(fd), C.ulong(req), C.uintptr_t(arg)) if r0 == -1 && er != nil { err = er } return } func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) { r0, er := C.ioctl(C.int(fd), C.ulong(req), C.uintptr_t(uintptr(arg))) if r0 == -1 && er != nil { err = er } return } ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_hurd_386.go ================================================ // Copyright 2022 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build 386 && hurd package unix const ( TIOCGETA = 0x62251713 ) type Winsize struct { Row uint16 Col uint16 Xpixel uint16 Ypixel uint16 } type Termios struct { Iflag uint32 Oflag uint32 Cflag uint32 Lflag uint32 Cc [20]uint8 Ispeed int32 Ospeed int32 } ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_illumos.go ================================================ // Copyright 2021 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // illumos system calls not present on Solaris. //go:build amd64 && illumos package unix import ( "unsafe" ) func bytes2iovec(bs [][]byte) []Iovec { iovecs := make([]Iovec, len(bs)) for i, b := range bs { iovecs[i].SetLen(len(b)) if len(b) > 0 { iovecs[i].Base = &b[0] } else { iovecs[i].Base = (*byte)(unsafe.Pointer(&_zero)) } } return iovecs } //sys readv(fd int, iovs []Iovec) (n int, err error) func Readv(fd int, iovs [][]byte) (n int, err error) { iovecs := bytes2iovec(iovs) n, err = readv(fd, iovecs) return n, err } //sys preadv(fd int, iovs []Iovec, off int64) (n int, err error) func Preadv(fd int, iovs [][]byte, off int64) (n int, err error) { iovecs := bytes2iovec(iovs) n, err = preadv(fd, iovecs, off) return n, err } //sys writev(fd int, iovs []Iovec) (n int, err error) func Writev(fd int, iovs [][]byte) (n int, err error) { iovecs := bytes2iovec(iovs) n, err = writev(fd, iovecs) return n, err } //sys pwritev(fd int, iovs []Iovec, off int64) (n int, err error) func Pwritev(fd int, iovs [][]byte, off int64) (n int, err error) { iovecs := bytes2iovec(iovs) n, err = pwritev(fd, iovecs, off) return n, err } //sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) = libsocket.accept4 func Accept4(fd int, flags int) (nfd int, sa Sockaddr, err error) { var rsa RawSockaddrAny var len _Socklen = SizeofSockaddrAny nfd, err = accept4(fd, &rsa, &len, flags) if err != nil { return } if len > SizeofSockaddrAny { panic("RawSockaddrAny too small") } sa, err = anyToSockaddr(fd, &rsa) if err != nil { Close(nfd) nfd = 0 } return } ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_linux.go ================================================ // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Linux system calls. // This file is compiled as ordinary Go code, // but it is also input to mksyscall, // which parses the //sys lines and generates system call stubs. // Note that sometimes we use a lowercase //sys name and // wrap it in our own nicer implementation. package unix import ( "encoding/binary" "slices" "strconv" "syscall" "time" "unsafe" ) /* * Wrapped */ func Access(path string, mode uint32) (err error) { return Faccessat(AT_FDCWD, path, mode, 0) } func Chmod(path string, mode uint32) (err error) { return Fchmodat(AT_FDCWD, path, mode, 0) } func Chown(path string, uid int, gid int) (err error) { return Fchownat(AT_FDCWD, path, uid, gid, 0) } func Creat(path string, mode uint32) (fd int, err error) { return Open(path, O_CREAT|O_WRONLY|O_TRUNC, mode) } func EpollCreate(size int) (fd int, err error) { if size <= 0 { return -1, EINVAL } return EpollCreate1(0) } //sys FanotifyInit(flags uint, event_f_flags uint) (fd int, err error) //sys fanotifyMark(fd int, flags uint, mask uint64, dirFd int, pathname *byte) (err error) func FanotifyMark(fd int, flags uint, mask uint64, dirFd int, pathname string) (err error) { if pathname == "" { return fanotifyMark(fd, flags, mask, dirFd, nil) } p, err := BytePtrFromString(pathname) if err != nil { return err } return fanotifyMark(fd, flags, mask, dirFd, p) } //sys fchmodat(dirfd int, path string, mode uint32) (err error) //sys fchmodat2(dirfd int, path string, mode uint32, flags int) (err error) func Fchmodat(dirfd int, path string, mode uint32, flags int) error { // Linux fchmodat doesn't support the flags parameter, but fchmodat2 does. // Try fchmodat2 if flags are specified. if flags != 0 { err := fchmodat2(dirfd, path, mode, flags) if err == ENOSYS { // fchmodat2 isn't available. If the flags are known to be valid, // return EOPNOTSUPP to indicate that fchmodat doesn't support them. if flags&^(AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) != 0 { return EINVAL } else if flags&(AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) != 0 { return EOPNOTSUPP } } return err } return fchmodat(dirfd, path, mode) } func InotifyInit() (fd int, err error) { return InotifyInit1(0) } //sys ioctl(fd int, req uint, arg uintptr) (err error) = SYS_IOCTL //sys ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) = SYS_IOCTL // ioctl itself should not be exposed directly, but additional get/set functions // for specific types are permissible. These are defined in ioctl.go and // ioctl_linux.go. // // The third argument to ioctl is often a pointer but sometimes an integer. // Callers should use ioctlPtr when the third argument is a pointer and ioctl // when the third argument is an integer. // // TODO: some existing code incorrectly uses ioctl when it should use ioctlPtr. //sys Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) func Link(oldpath string, newpath string) (err error) { return Linkat(AT_FDCWD, oldpath, AT_FDCWD, newpath, 0) } func Mkdir(path string, mode uint32) (err error) { return Mkdirat(AT_FDCWD, path, mode) } func Mknod(path string, mode uint32, dev int) (err error) { return Mknodat(AT_FDCWD, path, mode, dev) } func Open(path string, mode int, perm uint32) (fd int, err error) { return openat(AT_FDCWD, path, mode|O_LARGEFILE, perm) } //sys openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) func Openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) { return openat(dirfd, path, flags|O_LARGEFILE, mode) } //sys openat2(dirfd int, path string, open_how *OpenHow, size int) (fd int, err error) func Openat2(dirfd int, path string, how *OpenHow) (fd int, err error) { return openat2(dirfd, path, how, SizeofOpenHow) } func Pipe(p []int) error { return Pipe2(p, 0) } //sysnb pipe2(p *[2]_C_int, flags int) (err error) func Pipe2(p []int, flags int) error { if len(p) != 2 { return EINVAL } var pp [2]_C_int err := pipe2(&pp, flags) if err == nil { p[0] = int(pp[0]) p[1] = int(pp[1]) } return err } //sys ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error) func Ppoll(fds []PollFd, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { if len(fds) == 0 { return ppoll(nil, 0, timeout, sigmask) } return ppoll(&fds[0], len(fds), timeout, sigmask) } func Poll(fds []PollFd, timeout int) (n int, err error) { var ts *Timespec if timeout >= 0 { ts = new(Timespec) *ts = NsecToTimespec(int64(timeout) * 1e6) } return Ppoll(fds, ts, nil) } //sys Readlinkat(dirfd int, path string, buf []byte) (n int, err error) func Readlink(path string, buf []byte) (n int, err error) { return Readlinkat(AT_FDCWD, path, buf) } func Rename(oldpath string, newpath string) (err error) { return Renameat(AT_FDCWD, oldpath, AT_FDCWD, newpath) } func Rmdir(path string) error { return Unlinkat(AT_FDCWD, path, AT_REMOVEDIR) } //sys Symlinkat(oldpath string, newdirfd int, newpath string) (err error) func Symlink(oldpath string, newpath string) (err error) { return Symlinkat(oldpath, AT_FDCWD, newpath) } func Unlink(path string) error { return Unlinkat(AT_FDCWD, path, 0) } //sys Unlinkat(dirfd int, path string, flags int) (err error) func Utimes(path string, tv []Timeval) error { if tv == nil { err := utimensat(AT_FDCWD, path, nil, 0) if err != ENOSYS { return err } return utimes(path, nil) } if len(tv) != 2 { return EINVAL } var ts [2]Timespec ts[0] = NsecToTimespec(TimevalToNsec(tv[0])) ts[1] = NsecToTimespec(TimevalToNsec(tv[1])) err := utimensat(AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0) if err != ENOSYS { return err } return utimes(path, (*[2]Timeval)(unsafe.Pointer(&tv[0]))) } //sys utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) func UtimesNano(path string, ts []Timespec) error { return UtimesNanoAt(AT_FDCWD, path, ts, 0) } func UtimesNanoAt(dirfd int, path string, ts []Timespec, flags int) error { if ts == nil { return utimensat(dirfd, path, nil, flags) } if len(ts) != 2 { return EINVAL } return utimensat(dirfd, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), flags) } func Futimesat(dirfd int, path string, tv []Timeval) error { if tv == nil { return futimesat(dirfd, path, nil) } if len(tv) != 2 { return EINVAL } return futimesat(dirfd, path, (*[2]Timeval)(unsafe.Pointer(&tv[0]))) } func Futimes(fd int, tv []Timeval) (err error) { // Believe it or not, this is the best we can do on Linux // (and is what glibc does). return Utimes("/proc/self/fd/"+strconv.Itoa(fd), tv) } const ImplementsGetwd = true //sys Getcwd(buf []byte) (n int, err error) func Getwd() (wd string, err error) { var buf [PathMax]byte n, err := Getcwd(buf[0:]) if err != nil { return "", err } // Getcwd returns the number of bytes written to buf, including the NUL. if n < 1 || n > len(buf) || buf[n-1] != 0 { return "", EINVAL } // In some cases, Linux can return a path that starts with the // "(unreachable)" prefix, which can potentially be a valid relative // path. To work around that, return ENOENT if path is not absolute. if buf[0] != '/' { return "", ENOENT } return string(buf[0 : n-1]), nil } func Getgroups() (gids []int, err error) { n, err := getgroups(0, nil) if err != nil { return nil, err } if n == 0 { return nil, nil } // Sanity check group count. Max is 1<<16 on Linux. if n < 0 || n > 1<<20 { return nil, EINVAL } a := make([]_Gid_t, n) n, err = getgroups(n, &a[0]) if err != nil { return nil, err } gids = make([]int, n) for i, v := range a[0:n] { gids[i] = int(v) } return } func Setgroups(gids []int) (err error) { if len(gids) == 0 { return setgroups(0, nil) } a := make([]_Gid_t, len(gids)) for i, v := range gids { a[i] = _Gid_t(v) } return setgroups(len(a), &a[0]) } type WaitStatus uint32 // Wait status is 7 bits at bottom, either 0 (exited), // 0x7F (stopped), or a signal number that caused an exit. // The 0x80 bit is whether there was a core dump. // An extra number (exit code, signal causing a stop) // is in the high bits. At least that's the idea. // There are various irregularities. For example, the // "continued" status is 0xFFFF, distinguishing itself // from stopped via the core dump bit. const ( mask = 0x7F core = 0x80 exited = 0x00 stopped = 0x7F shift = 8 ) func (w WaitStatus) Exited() bool { return w&mask == exited } func (w WaitStatus) Signaled() bool { return w&mask != stopped && w&mask != exited } func (w WaitStatus) Stopped() bool { return w&0xFF == stopped } func (w WaitStatus) Continued() bool { return w == 0xFFFF } func (w WaitStatus) CoreDump() bool { return w.Signaled() && w&core != 0 } func (w WaitStatus) ExitStatus() int { if !w.Exited() { return -1 } return int(w>>shift) & 0xFF } func (w WaitStatus) Signal() syscall.Signal { if !w.Signaled() { return -1 } return syscall.Signal(w & mask) } func (w WaitStatus) StopSignal() syscall.Signal { if !w.Stopped() { return -1 } return syscall.Signal(w>>shift) & 0xFF } func (w WaitStatus) TrapCause() int { if w.StopSignal() != SIGTRAP { return -1 } return int(w>>shift) >> 8 } //sys wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, err error) { var status _C_int wpid, err = wait4(pid, &status, options, rusage) if wstatus != nil { *wstatus = WaitStatus(status) } return } //sys Waitid(idType int, id int, info *Siginfo, options int, rusage *Rusage) (err error) func Mkfifo(path string, mode uint32) error { return Mknod(path, mode|S_IFIFO, 0) } func Mkfifoat(dirfd int, path string, mode uint32) error { return Mknodat(dirfd, path, mode|S_IFIFO, 0) } func (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, _Socklen, error) { if sa.Port < 0 || sa.Port > 0xFFFF { return nil, 0, EINVAL } sa.raw.Family = AF_INET p := (*[2]byte)(unsafe.Pointer(&sa.raw.Port)) p[0] = byte(sa.Port >> 8) p[1] = byte(sa.Port) sa.raw.Addr = sa.Addr return unsafe.Pointer(&sa.raw), SizeofSockaddrInet4, nil } func (sa *SockaddrInet6) sockaddr() (unsafe.Pointer, _Socklen, error) { if sa.Port < 0 || sa.Port > 0xFFFF { return nil, 0, EINVAL } sa.raw.Family = AF_INET6 p := (*[2]byte)(unsafe.Pointer(&sa.raw.Port)) p[0] = byte(sa.Port >> 8) p[1] = byte(sa.Port) sa.raw.Scope_id = sa.ZoneId sa.raw.Addr = sa.Addr return unsafe.Pointer(&sa.raw), SizeofSockaddrInet6, nil } func (sa *SockaddrUnix) sockaddr() (unsafe.Pointer, _Socklen, error) { name := sa.Name n := len(name) if n >= len(sa.raw.Path) { return nil, 0, EINVAL } sa.raw.Family = AF_UNIX for i := range n { sa.raw.Path[i] = int8(name[i]) } // length is family (uint16), name, NUL. sl := _Socklen(2) if n > 0 { sl += _Socklen(n) + 1 } if sa.raw.Path[0] == '@' || (sa.raw.Path[0] == 0 && sl > 3) { // Check sl > 3 so we don't change unnamed socket behavior. sa.raw.Path[0] = 0 // Don't count trailing NUL for abstract address. sl-- } return unsafe.Pointer(&sa.raw), sl, nil } // SockaddrLinklayer implements the Sockaddr interface for AF_PACKET type sockets. type SockaddrLinklayer struct { Protocol uint16 Ifindex int Hatype uint16 Pkttype uint8 Halen uint8 Addr [8]byte raw RawSockaddrLinklayer } func (sa *SockaddrLinklayer) sockaddr() (unsafe.Pointer, _Socklen, error) { if sa.Ifindex < 0 || sa.Ifindex > 0x7fffffff { return nil, 0, EINVAL } sa.raw.Family = AF_PACKET sa.raw.Protocol = sa.Protocol sa.raw.Ifindex = int32(sa.Ifindex) sa.raw.Hatype = sa.Hatype sa.raw.Pkttype = sa.Pkttype sa.raw.Halen = sa.Halen sa.raw.Addr = sa.Addr return unsafe.Pointer(&sa.raw), SizeofSockaddrLinklayer, nil } // SockaddrNetlink implements the Sockaddr interface for AF_NETLINK type sockets. type SockaddrNetlink struct { Family uint16 Pad uint16 Pid uint32 Groups uint32 raw RawSockaddrNetlink } func (sa *SockaddrNetlink) sockaddr() (unsafe.Pointer, _Socklen, error) { sa.raw.Family = AF_NETLINK sa.raw.Pad = sa.Pad sa.raw.Pid = sa.Pid sa.raw.Groups = sa.Groups return unsafe.Pointer(&sa.raw), SizeofSockaddrNetlink, nil } // SockaddrHCI implements the Sockaddr interface for AF_BLUETOOTH type sockets // using the HCI protocol. type SockaddrHCI struct { Dev uint16 Channel uint16 raw RawSockaddrHCI } func (sa *SockaddrHCI) sockaddr() (unsafe.Pointer, _Socklen, error) { sa.raw.Family = AF_BLUETOOTH sa.raw.Dev = sa.Dev sa.raw.Channel = sa.Channel return unsafe.Pointer(&sa.raw), SizeofSockaddrHCI, nil } // SockaddrL2 implements the Sockaddr interface for AF_BLUETOOTH type sockets // using the L2CAP protocol. type SockaddrL2 struct { PSM uint16 CID uint16 Addr [6]uint8 AddrType uint8 raw RawSockaddrL2 } func (sa *SockaddrL2) sockaddr() (unsafe.Pointer, _Socklen, error) { sa.raw.Family = AF_BLUETOOTH psm := (*[2]byte)(unsafe.Pointer(&sa.raw.Psm)) psm[0] = byte(sa.PSM) psm[1] = byte(sa.PSM >> 8) for i := range len(sa.Addr) { sa.raw.Bdaddr[i] = sa.Addr[len(sa.Addr)-1-i] } cid := (*[2]byte)(unsafe.Pointer(&sa.raw.Cid)) cid[0] = byte(sa.CID) cid[1] = byte(sa.CID >> 8) sa.raw.Bdaddr_type = sa.AddrType return unsafe.Pointer(&sa.raw), SizeofSockaddrL2, nil } // SockaddrRFCOMM implements the Sockaddr interface for AF_BLUETOOTH type sockets // using the RFCOMM protocol. // // Server example: // // fd, _ := Socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM) // _ = unix.Bind(fd, &unix.SockaddrRFCOMM{ // Channel: 1, // Addr: [6]uint8{0, 0, 0, 0, 0, 0}, // BDADDR_ANY or 00:00:00:00:00:00 // }) // _ = Listen(fd, 1) // nfd, sa, _ := Accept(fd) // fmt.Printf("conn addr=%v fd=%d", sa.(*unix.SockaddrRFCOMM).Addr, nfd) // Read(nfd, buf) // // Client example: // // fd, _ := Socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM) // _ = Connect(fd, &SockaddrRFCOMM{ // Channel: 1, // Addr: [6]byte{0x11, 0x22, 0x33, 0xaa, 0xbb, 0xcc}, // CC:BB:AA:33:22:11 // }) // Write(fd, []byte(`hello`)) type SockaddrRFCOMM struct { // Addr represents a bluetooth address, byte ordering is little-endian. Addr [6]uint8 // Channel is a designated bluetooth channel, only 1-30 are available for use. // Since Linux 2.6.7 and further zero value is the first available channel. Channel uint8 raw RawSockaddrRFCOMM } func (sa *SockaddrRFCOMM) sockaddr() (unsafe.Pointer, _Socklen, error) { sa.raw.Family = AF_BLUETOOTH sa.raw.Channel = sa.Channel sa.raw.Bdaddr = sa.Addr return unsafe.Pointer(&sa.raw), SizeofSockaddrRFCOMM, nil } // SockaddrCAN implements the Sockaddr interface for AF_CAN type sockets. // The RxID and TxID fields are used for transport protocol addressing in // (CAN_TP16, CAN_TP20, CAN_MCNET, and CAN_ISOTP), they can be left with // zero values for CAN_RAW and CAN_BCM sockets as they have no meaning. // // The SockaddrCAN struct must be bound to the socket file descriptor // using Bind before the CAN socket can be used. // // // Read one raw CAN frame // fd, _ := Socket(AF_CAN, SOCK_RAW, CAN_RAW) // addr := &SockaddrCAN{Ifindex: index} // Bind(fd, addr) // frame := make([]byte, 16) // Read(fd, frame) // // The full SocketCAN documentation can be found in the linux kernel // archives at: https://www.kernel.org/doc/Documentation/networking/can.txt type SockaddrCAN struct { Ifindex int RxID uint32 TxID uint32 raw RawSockaddrCAN } func (sa *SockaddrCAN) sockaddr() (unsafe.Pointer, _Socklen, error) { if sa.Ifindex < 0 || sa.Ifindex > 0x7fffffff { return nil, 0, EINVAL } sa.raw.Family = AF_CAN sa.raw.Ifindex = int32(sa.Ifindex) rx := (*[4]byte)(unsafe.Pointer(&sa.RxID)) for i := range 4 { sa.raw.Addr[i] = rx[i] } tx := (*[4]byte)(unsafe.Pointer(&sa.TxID)) for i := range 4 { sa.raw.Addr[i+4] = tx[i] } return unsafe.Pointer(&sa.raw), SizeofSockaddrCAN, nil } // SockaddrCANJ1939 implements the Sockaddr interface for AF_CAN using J1939 // protocol (https://en.wikipedia.org/wiki/SAE_J1939). For more information // on the purposes of the fields, check the official linux kernel documentation // available here: https://www.kernel.org/doc/Documentation/networking/j1939.rst type SockaddrCANJ1939 struct { Ifindex int Name uint64 PGN uint32 Addr uint8 raw RawSockaddrCAN } func (sa *SockaddrCANJ1939) sockaddr() (unsafe.Pointer, _Socklen, error) { if sa.Ifindex < 0 || sa.Ifindex > 0x7fffffff { return nil, 0, EINVAL } sa.raw.Family = AF_CAN sa.raw.Ifindex = int32(sa.Ifindex) n := (*[8]byte)(unsafe.Pointer(&sa.Name)) for i := range 8 { sa.raw.Addr[i] = n[i] } p := (*[4]byte)(unsafe.Pointer(&sa.PGN)) for i := range 4 { sa.raw.Addr[i+8] = p[i] } sa.raw.Addr[12] = sa.Addr return unsafe.Pointer(&sa.raw), SizeofSockaddrCAN, nil } // SockaddrALG implements the Sockaddr interface for AF_ALG type sockets. // SockaddrALG enables userspace access to the Linux kernel's cryptography // subsystem. The Type and Name fields specify which type of hash or cipher // should be used with a given socket. // // To create a file descriptor that provides access to a hash or cipher, both // Bind and Accept must be used. Once the setup process is complete, input // data can be written to the socket, processed by the kernel, and then read // back as hash output or ciphertext. // // Here is an example of using an AF_ALG socket with SHA1 hashing. // The initial socket setup process is as follows: // // // Open a socket to perform SHA1 hashing. // fd, _ := unix.Socket(unix.AF_ALG, unix.SOCK_SEQPACKET, 0) // addr := &unix.SockaddrALG{Type: "hash", Name: "sha1"} // unix.Bind(fd, addr) // // Note: unix.Accept does not work at this time; must invoke accept() // // manually using unix.Syscall. // hashfd, _, _ := unix.Syscall(unix.SYS_ACCEPT, uintptr(fd), 0, 0) // // Once a file descriptor has been returned from Accept, it may be used to // perform SHA1 hashing. The descriptor is not safe for concurrent use, but // may be re-used repeatedly with subsequent Write and Read operations. // // When hashing a small byte slice or string, a single Write and Read may // be used: // // // Assume hashfd is already configured using the setup process. // hash := os.NewFile(hashfd, "sha1") // // Hash an input string and read the results. Each Write discards // // previous hash state. Read always reads the current state. // b := make([]byte, 20) // for i := 0; i < 2; i++ { // io.WriteString(hash, "Hello, world.") // hash.Read(b) // fmt.Println(hex.EncodeToString(b)) // } // // Output: // // 2ae01472317d1935a84797ec1983ae243fc6aa28 // // 2ae01472317d1935a84797ec1983ae243fc6aa28 // // For hashing larger byte slices, or byte streams such as those read from // a file or socket, use Sendto with MSG_MORE to instruct the kernel to update // the hash digest instead of creating a new one for a given chunk and finalizing it. // // // Assume hashfd and addr are already configured using the setup process. // hash := os.NewFile(hashfd, "sha1") // // Hash the contents of a file. // f, _ := os.Open("/tmp/linux-4.10-rc7.tar.xz") // b := make([]byte, 4096) // for { // n, err := f.Read(b) // if err == io.EOF { // break // } // unix.Sendto(hashfd, b[:n], unix.MSG_MORE, addr) // } // hash.Read(b) // fmt.Println(hex.EncodeToString(b)) // // Output: 85cdcad0c06eef66f805ecce353bec9accbeecc5 // // For more information, see: http://www.chronox.de/crypto-API/crypto/userspace-if.html. type SockaddrALG struct { Type string Name string Feature uint32 Mask uint32 raw RawSockaddrALG } func (sa *SockaddrALG) sockaddr() (unsafe.Pointer, _Socklen, error) { // Leave room for NUL byte terminator. if len(sa.Type) > len(sa.raw.Type)-1 { return nil, 0, EINVAL } if len(sa.Name) > len(sa.raw.Name)-1 { return nil, 0, EINVAL } sa.raw.Family = AF_ALG sa.raw.Feat = sa.Feature sa.raw.Mask = sa.Mask copy(sa.raw.Type[:], sa.Type) copy(sa.raw.Name[:], sa.Name) return unsafe.Pointer(&sa.raw), SizeofSockaddrALG, nil } // SockaddrVM implements the Sockaddr interface for AF_VSOCK type sockets. // SockaddrVM provides access to Linux VM sockets: a mechanism that enables // bidirectional communication between a hypervisor and its guest virtual // machines. type SockaddrVM struct { // CID and Port specify a context ID and port address for a VM socket. // Guests have a unique CID, and hosts may have a well-known CID of: // - VMADDR_CID_HYPERVISOR: refers to the hypervisor process. // - VMADDR_CID_LOCAL: refers to local communication (loopback). // - VMADDR_CID_HOST: refers to other processes on the host. CID uint32 Port uint32 Flags uint8 raw RawSockaddrVM } func (sa *SockaddrVM) sockaddr() (unsafe.Pointer, _Socklen, error) { sa.raw.Family = AF_VSOCK sa.raw.Port = sa.Port sa.raw.Cid = sa.CID sa.raw.Flags = sa.Flags return unsafe.Pointer(&sa.raw), SizeofSockaddrVM, nil } type SockaddrXDP struct { Flags uint16 Ifindex uint32 QueueID uint32 SharedUmemFD uint32 raw RawSockaddrXDP } func (sa *SockaddrXDP) sockaddr() (unsafe.Pointer, _Socklen, error) { sa.raw.Family = AF_XDP sa.raw.Flags = sa.Flags sa.raw.Ifindex = sa.Ifindex sa.raw.Queue_id = sa.QueueID sa.raw.Shared_umem_fd = sa.SharedUmemFD return unsafe.Pointer(&sa.raw), SizeofSockaddrXDP, nil } // This constant mirrors the #define of PX_PROTO_OE in // linux/if_pppox.h. We're defining this by hand here instead of // autogenerating through mkerrors.sh because including // linux/if_pppox.h causes some declaration conflicts with other // includes (linux/if_pppox.h includes linux/in.h, which conflicts // with netinet/in.h). Given that we only need a single zero constant // out of that file, it's cleaner to just define it by hand here. const px_proto_oe = 0 type SockaddrPPPoE struct { SID uint16 Remote []byte Dev string raw RawSockaddrPPPoX } func (sa *SockaddrPPPoE) sockaddr() (unsafe.Pointer, _Socklen, error) { if len(sa.Remote) != 6 { return nil, 0, EINVAL } if len(sa.Dev) > IFNAMSIZ-1 { return nil, 0, EINVAL } *(*uint16)(unsafe.Pointer(&sa.raw[0])) = AF_PPPOX // This next field is in host-endian byte order. We can't use the // same unsafe pointer cast as above, because this value is not // 32-bit aligned and some architectures don't allow unaligned // access. // // However, the value of px_proto_oe is 0, so we can use // encoding/binary helpers to write the bytes without worrying // about the ordering. binary.BigEndian.PutUint32(sa.raw[2:6], px_proto_oe) // This field is deliberately big-endian, unlike the previous // one. The kernel expects SID to be in network byte order. binary.BigEndian.PutUint16(sa.raw[6:8], sa.SID) copy(sa.raw[8:14], sa.Remote) clear(sa.raw[14 : 14+IFNAMSIZ]) copy(sa.raw[14:], sa.Dev) return unsafe.Pointer(&sa.raw), SizeofSockaddrPPPoX, nil } // SockaddrTIPC implements the Sockaddr interface for AF_TIPC type sockets. // For more information on TIPC, see: http://tipc.sourceforge.net/. type SockaddrTIPC struct { // Scope is the publication scopes when binding service/service range. // Should be set to TIPC_CLUSTER_SCOPE or TIPC_NODE_SCOPE. Scope int // Addr is the type of address used to manipulate a socket. Addr must be // one of: // - *TIPCSocketAddr: "id" variant in the C addr union // - *TIPCServiceRange: "nameseq" variant in the C addr union // - *TIPCServiceName: "name" variant in the C addr union // // If nil, EINVAL will be returned when the structure is used. Addr TIPCAddr raw RawSockaddrTIPC } // TIPCAddr is implemented by types that can be used as an address for // SockaddrTIPC. It is only implemented by *TIPCSocketAddr, *TIPCServiceRange, // and *TIPCServiceName. type TIPCAddr interface { tipcAddrtype() uint8 tipcAddr() [12]byte } func (sa *TIPCSocketAddr) tipcAddr() [12]byte { var out [12]byte copy(out[:], (*(*[unsafe.Sizeof(TIPCSocketAddr{})]byte)(unsafe.Pointer(sa)))[:]) return out } func (sa *TIPCSocketAddr) tipcAddrtype() uint8 { return TIPC_SOCKET_ADDR } func (sa *TIPCServiceRange) tipcAddr() [12]byte { var out [12]byte copy(out[:], (*(*[unsafe.Sizeof(TIPCServiceRange{})]byte)(unsafe.Pointer(sa)))[:]) return out } func (sa *TIPCServiceRange) tipcAddrtype() uint8 { return TIPC_SERVICE_RANGE } func (sa *TIPCServiceName) tipcAddr() [12]byte { var out [12]byte copy(out[:], (*(*[unsafe.Sizeof(TIPCServiceName{})]byte)(unsafe.Pointer(sa)))[:]) return out } func (sa *TIPCServiceName) tipcAddrtype() uint8 { return TIPC_SERVICE_ADDR } func (sa *SockaddrTIPC) sockaddr() (unsafe.Pointer, _Socklen, error) { if sa.Addr == nil { return nil, 0, EINVAL } sa.raw.Family = AF_TIPC sa.raw.Scope = int8(sa.Scope) sa.raw.Addrtype = sa.Addr.tipcAddrtype() sa.raw.Addr = sa.Addr.tipcAddr() return unsafe.Pointer(&sa.raw), SizeofSockaddrTIPC, nil } // SockaddrL2TPIP implements the Sockaddr interface for IPPROTO_L2TP/AF_INET sockets. type SockaddrL2TPIP struct { Addr [4]byte ConnId uint32 raw RawSockaddrL2TPIP } func (sa *SockaddrL2TPIP) sockaddr() (unsafe.Pointer, _Socklen, error) { sa.raw.Family = AF_INET sa.raw.Conn_id = sa.ConnId sa.raw.Addr = sa.Addr return unsafe.Pointer(&sa.raw), SizeofSockaddrL2TPIP, nil } // SockaddrL2TPIP6 implements the Sockaddr interface for IPPROTO_L2TP/AF_INET6 sockets. type SockaddrL2TPIP6 struct { Addr [16]byte ZoneId uint32 ConnId uint32 raw RawSockaddrL2TPIP6 } func (sa *SockaddrL2TPIP6) sockaddr() (unsafe.Pointer, _Socklen, error) { sa.raw.Family = AF_INET6 sa.raw.Conn_id = sa.ConnId sa.raw.Scope_id = sa.ZoneId sa.raw.Addr = sa.Addr return unsafe.Pointer(&sa.raw), SizeofSockaddrL2TPIP6, nil } // SockaddrIUCV implements the Sockaddr interface for AF_IUCV sockets. type SockaddrIUCV struct { UserID string Name string raw RawSockaddrIUCV } func (sa *SockaddrIUCV) sockaddr() (unsafe.Pointer, _Socklen, error) { sa.raw.Family = AF_IUCV // These are EBCDIC encoded by the kernel, but we still need to pad them // with blanks. Initializing with blanks allows the caller to feed in either // a padded or an unpadded string. for i := range 8 { sa.raw.Nodeid[i] = ' ' sa.raw.User_id[i] = ' ' sa.raw.Name[i] = ' ' } if len(sa.UserID) > 8 || len(sa.Name) > 8 { return nil, 0, EINVAL } for i, b := range []byte(sa.UserID[:]) { sa.raw.User_id[i] = int8(b) } for i, b := range []byte(sa.Name[:]) { sa.raw.Name[i] = int8(b) } return unsafe.Pointer(&sa.raw), SizeofSockaddrIUCV, nil } type SockaddrNFC struct { DeviceIdx uint32 TargetIdx uint32 NFCProtocol uint32 raw RawSockaddrNFC } func (sa *SockaddrNFC) sockaddr() (unsafe.Pointer, _Socklen, error) { sa.raw.Sa_family = AF_NFC sa.raw.Dev_idx = sa.DeviceIdx sa.raw.Target_idx = sa.TargetIdx sa.raw.Nfc_protocol = sa.NFCProtocol return unsafe.Pointer(&sa.raw), SizeofSockaddrNFC, nil } type SockaddrNFCLLCP struct { DeviceIdx uint32 TargetIdx uint32 NFCProtocol uint32 DestinationSAP uint8 SourceSAP uint8 ServiceName string raw RawSockaddrNFCLLCP } func (sa *SockaddrNFCLLCP) sockaddr() (unsafe.Pointer, _Socklen, error) { sa.raw.Sa_family = AF_NFC sa.raw.Dev_idx = sa.DeviceIdx sa.raw.Target_idx = sa.TargetIdx sa.raw.Nfc_protocol = sa.NFCProtocol sa.raw.Dsap = sa.DestinationSAP sa.raw.Ssap = sa.SourceSAP if len(sa.ServiceName) > len(sa.raw.Service_name) { return nil, 0, EINVAL } copy(sa.raw.Service_name[:], sa.ServiceName) sa.raw.SetServiceNameLen(len(sa.ServiceName)) return unsafe.Pointer(&sa.raw), SizeofSockaddrNFCLLCP, nil } var socketProtocol = func(fd int) (int, error) { return GetsockoptInt(fd, SOL_SOCKET, SO_PROTOCOL) } func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) { switch rsa.Addr.Family { case AF_NETLINK: pp := (*RawSockaddrNetlink)(unsafe.Pointer(rsa)) sa := new(SockaddrNetlink) sa.Family = pp.Family sa.Pad = pp.Pad sa.Pid = pp.Pid sa.Groups = pp.Groups return sa, nil case AF_PACKET: pp := (*RawSockaddrLinklayer)(unsafe.Pointer(rsa)) sa := new(SockaddrLinklayer) sa.Protocol = pp.Protocol sa.Ifindex = int(pp.Ifindex) sa.Hatype = pp.Hatype sa.Pkttype = pp.Pkttype sa.Halen = pp.Halen sa.Addr = pp.Addr return sa, nil case AF_UNIX: pp := (*RawSockaddrUnix)(unsafe.Pointer(rsa)) sa := new(SockaddrUnix) if pp.Path[0] == 0 { // "Abstract" Unix domain socket. // Rewrite leading NUL as @ for textual display. // (This is the standard convention.) // Not friendly to overwrite in place, // but the callers below don't care. pp.Path[0] = '@' } // Assume path ends at NUL. // This is not technically the Linux semantics for // abstract Unix domain sockets--they are supposed // to be uninterpreted fixed-size binary blobs--but // everyone uses this convention. n := 0 for n < len(pp.Path) && pp.Path[n] != 0 { n++ } sa.Name = string(unsafe.Slice((*byte)(unsafe.Pointer(&pp.Path[0])), n)) return sa, nil case AF_INET: proto, err := socketProtocol(fd) if err != nil { return nil, err } switch proto { case IPPROTO_L2TP: pp := (*RawSockaddrL2TPIP)(unsafe.Pointer(rsa)) sa := new(SockaddrL2TPIP) sa.ConnId = pp.Conn_id sa.Addr = pp.Addr return sa, nil default: pp := (*RawSockaddrInet4)(unsafe.Pointer(rsa)) sa := new(SockaddrInet4) p := (*[2]byte)(unsafe.Pointer(&pp.Port)) sa.Port = int(p[0])<<8 + int(p[1]) sa.Addr = pp.Addr return sa, nil } case AF_INET6: proto, err := socketProtocol(fd) if err != nil { return nil, err } switch proto { case IPPROTO_L2TP: pp := (*RawSockaddrL2TPIP6)(unsafe.Pointer(rsa)) sa := new(SockaddrL2TPIP6) sa.ConnId = pp.Conn_id sa.ZoneId = pp.Scope_id sa.Addr = pp.Addr return sa, nil default: pp := (*RawSockaddrInet6)(unsafe.Pointer(rsa)) sa := new(SockaddrInet6) p := (*[2]byte)(unsafe.Pointer(&pp.Port)) sa.Port = int(p[0])<<8 + int(p[1]) sa.ZoneId = pp.Scope_id sa.Addr = pp.Addr return sa, nil } case AF_VSOCK: pp := (*RawSockaddrVM)(unsafe.Pointer(rsa)) sa := &SockaddrVM{ CID: pp.Cid, Port: pp.Port, Flags: pp.Flags, } return sa, nil case AF_BLUETOOTH: proto, err := socketProtocol(fd) if err != nil { return nil, err } // only BTPROTO_L2CAP and BTPROTO_RFCOMM can accept connections switch proto { case BTPROTO_L2CAP: pp := (*RawSockaddrL2)(unsafe.Pointer(rsa)) sa := &SockaddrL2{ PSM: pp.Psm, CID: pp.Cid, Addr: pp.Bdaddr, AddrType: pp.Bdaddr_type, } return sa, nil case BTPROTO_RFCOMM: pp := (*RawSockaddrRFCOMM)(unsafe.Pointer(rsa)) sa := &SockaddrRFCOMM{ Channel: pp.Channel, Addr: pp.Bdaddr, } return sa, nil } case AF_XDP: pp := (*RawSockaddrXDP)(unsafe.Pointer(rsa)) sa := &SockaddrXDP{ Flags: pp.Flags, Ifindex: pp.Ifindex, QueueID: pp.Queue_id, SharedUmemFD: pp.Shared_umem_fd, } return sa, nil case AF_PPPOX: pp := (*RawSockaddrPPPoX)(unsafe.Pointer(rsa)) if binary.BigEndian.Uint32(pp[2:6]) != px_proto_oe { return nil, EINVAL } sa := &SockaddrPPPoE{ SID: binary.BigEndian.Uint16(pp[6:8]), Remote: pp[8:14], } for i := 14; i < 14+IFNAMSIZ; i++ { if pp[i] == 0 { sa.Dev = string(pp[14:i]) break } } return sa, nil case AF_TIPC: pp := (*RawSockaddrTIPC)(unsafe.Pointer(rsa)) sa := &SockaddrTIPC{ Scope: int(pp.Scope), } // Determine which union variant is present in pp.Addr by checking // pp.Addrtype. switch pp.Addrtype { case TIPC_SERVICE_RANGE: sa.Addr = (*TIPCServiceRange)(unsafe.Pointer(&pp.Addr)) case TIPC_SERVICE_ADDR: sa.Addr = (*TIPCServiceName)(unsafe.Pointer(&pp.Addr)) case TIPC_SOCKET_ADDR: sa.Addr = (*TIPCSocketAddr)(unsafe.Pointer(&pp.Addr)) default: return nil, EINVAL } return sa, nil case AF_IUCV: pp := (*RawSockaddrIUCV)(unsafe.Pointer(rsa)) var user [8]byte var name [8]byte for i := range 8 { user[i] = byte(pp.User_id[i]) name[i] = byte(pp.Name[i]) } sa := &SockaddrIUCV{ UserID: string(user[:]), Name: string(name[:]), } return sa, nil case AF_CAN: proto, err := socketProtocol(fd) if err != nil { return nil, err } pp := (*RawSockaddrCAN)(unsafe.Pointer(rsa)) switch proto { case CAN_J1939: sa := &SockaddrCANJ1939{ Ifindex: int(pp.Ifindex), } name := (*[8]byte)(unsafe.Pointer(&sa.Name)) for i := range 8 { name[i] = pp.Addr[i] } pgn := (*[4]byte)(unsafe.Pointer(&sa.PGN)) for i := range 4 { pgn[i] = pp.Addr[i+8] } addr := (*[1]byte)(unsafe.Pointer(&sa.Addr)) addr[0] = pp.Addr[12] return sa, nil default: sa := &SockaddrCAN{ Ifindex: int(pp.Ifindex), } rx := (*[4]byte)(unsafe.Pointer(&sa.RxID)) for i := range 4 { rx[i] = pp.Addr[i] } tx := (*[4]byte)(unsafe.Pointer(&sa.TxID)) for i := range 4 { tx[i] = pp.Addr[i+4] } return sa, nil } case AF_NFC: proto, err := socketProtocol(fd) if err != nil { return nil, err } switch proto { case NFC_SOCKPROTO_RAW: pp := (*RawSockaddrNFC)(unsafe.Pointer(rsa)) sa := &SockaddrNFC{ DeviceIdx: pp.Dev_idx, TargetIdx: pp.Target_idx, NFCProtocol: pp.Nfc_protocol, } return sa, nil case NFC_SOCKPROTO_LLCP: pp := (*RawSockaddrNFCLLCP)(unsafe.Pointer(rsa)) if uint64(pp.Service_name_len) > uint64(len(pp.Service_name)) { return nil, EINVAL } sa := &SockaddrNFCLLCP{ DeviceIdx: pp.Dev_idx, TargetIdx: pp.Target_idx, NFCProtocol: pp.Nfc_protocol, DestinationSAP: pp.Dsap, SourceSAP: pp.Ssap, ServiceName: string(pp.Service_name[:pp.Service_name_len]), } return sa, nil default: return nil, EINVAL } } return nil, EAFNOSUPPORT } func Accept(fd int) (nfd int, sa Sockaddr, err error) { var rsa RawSockaddrAny var len _Socklen = SizeofSockaddrAny nfd, err = accept4(fd, &rsa, &len, 0) if err != nil { return } sa, err = anyToSockaddr(fd, &rsa) if err != nil { Close(nfd) nfd = 0 } return } func Accept4(fd int, flags int) (nfd int, sa Sockaddr, err error) { var rsa RawSockaddrAny var len _Socklen = SizeofSockaddrAny nfd, err = accept4(fd, &rsa, &len, flags) if err != nil { return } if len > SizeofSockaddrAny { panic("RawSockaddrAny too small") } sa, err = anyToSockaddr(fd, &rsa) if err != nil { Close(nfd) nfd = 0 } return } func Getsockname(fd int) (sa Sockaddr, err error) { var rsa RawSockaddrAny var len _Socklen = SizeofSockaddrAny if err = getsockname(fd, &rsa, &len); err != nil { return } return anyToSockaddr(fd, &rsa) } func GetsockoptIPMreqn(fd, level, opt int) (*IPMreqn, error) { var value IPMreqn vallen := _Socklen(SizeofIPMreqn) err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen) return &value, err } func GetsockoptUcred(fd, level, opt int) (*Ucred, error) { var value Ucred vallen := _Socklen(SizeofUcred) err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen) return &value, err } func GetsockoptTCPInfo(fd, level, opt int) (*TCPInfo, error) { var value TCPInfo vallen := _Socklen(SizeofTCPInfo) err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen) return &value, err } // GetsockoptTCPCCVegasInfo returns algorithm specific congestion control information for a socket using the "vegas" // algorithm. // // The socket's congestion control algorighm can be retrieved via [GetsockoptString] with the [TCP_CONGESTION] option: // // algo, err := unix.GetsockoptString(fd, unix.IPPROTO_TCP, unix.TCP_CONGESTION) func GetsockoptTCPCCVegasInfo(fd, level, opt int) (*TCPVegasInfo, error) { var value [SizeofTCPCCInfo / 4]uint32 // ensure proper alignment vallen := _Socklen(SizeofTCPCCInfo) err := getsockopt(fd, level, opt, unsafe.Pointer(&value[0]), &vallen) out := (*TCPVegasInfo)(unsafe.Pointer(&value[0])) return out, err } // GetsockoptTCPCCDCTCPInfo returns algorithm specific congestion control information for a socket using the "dctp" // algorithm. // // The socket's congestion control algorighm can be retrieved via [GetsockoptString] with the [TCP_CONGESTION] option: // // algo, err := unix.GetsockoptString(fd, unix.IPPROTO_TCP, unix.TCP_CONGESTION) func GetsockoptTCPCCDCTCPInfo(fd, level, opt int) (*TCPDCTCPInfo, error) { var value [SizeofTCPCCInfo / 4]uint32 // ensure proper alignment vallen := _Socklen(SizeofTCPCCInfo) err := getsockopt(fd, level, opt, unsafe.Pointer(&value[0]), &vallen) out := (*TCPDCTCPInfo)(unsafe.Pointer(&value[0])) return out, err } // GetsockoptTCPCCBBRInfo returns algorithm specific congestion control information for a socket using the "bbr" // algorithm. // // The socket's congestion control algorighm can be retrieved via [GetsockoptString] with the [TCP_CONGESTION] option: // // algo, err := unix.GetsockoptString(fd, unix.IPPROTO_TCP, unix.TCP_CONGESTION) func GetsockoptTCPCCBBRInfo(fd, level, opt int) (*TCPBBRInfo, error) { var value [SizeofTCPCCInfo / 4]uint32 // ensure proper alignment vallen := _Socklen(SizeofTCPCCInfo) err := getsockopt(fd, level, opt, unsafe.Pointer(&value[0]), &vallen) out := (*TCPBBRInfo)(unsafe.Pointer(&value[0])) return out, err } // GetsockoptString returns the string value of the socket option opt for the // socket associated with fd at the given socket level. func GetsockoptString(fd, level, opt int) (string, error) { buf := make([]byte, 256) vallen := _Socklen(len(buf)) err := getsockopt(fd, level, opt, unsafe.Pointer(&buf[0]), &vallen) if err != nil { if err == ERANGE { buf = make([]byte, vallen) err = getsockopt(fd, level, opt, unsafe.Pointer(&buf[0]), &vallen) } if err != nil { return "", err } } return ByteSliceToString(buf[:vallen]), nil } func GetsockoptTpacketStats(fd, level, opt int) (*TpacketStats, error) { var value TpacketStats vallen := _Socklen(SizeofTpacketStats) err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen) return &value, err } func GetsockoptTpacketStatsV3(fd, level, opt int) (*TpacketStatsV3, error) { var value TpacketStatsV3 vallen := _Socklen(SizeofTpacketStatsV3) err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen) return &value, err } func SetsockoptIPMreqn(fd, level, opt int, mreq *IPMreqn) (err error) { return setsockopt(fd, level, opt, unsafe.Pointer(mreq), unsafe.Sizeof(*mreq)) } func SetsockoptPacketMreq(fd, level, opt int, mreq *PacketMreq) error { return setsockopt(fd, level, opt, unsafe.Pointer(mreq), unsafe.Sizeof(*mreq)) } // SetsockoptSockFprog attaches a classic BPF or an extended BPF program to a // socket to filter incoming packets. See 'man 7 socket' for usage information. func SetsockoptSockFprog(fd, level, opt int, fprog *SockFprog) error { return setsockopt(fd, level, opt, unsafe.Pointer(fprog), unsafe.Sizeof(*fprog)) } func SetsockoptCanRawFilter(fd, level, opt int, filter []CanFilter) error { var p unsafe.Pointer if len(filter) > 0 { p = unsafe.Pointer(&filter[0]) } return setsockopt(fd, level, opt, p, uintptr(len(filter)*SizeofCanFilter)) } func SetsockoptTpacketReq(fd, level, opt int, tp *TpacketReq) error { return setsockopt(fd, level, opt, unsafe.Pointer(tp), unsafe.Sizeof(*tp)) } func SetsockoptTpacketReq3(fd, level, opt int, tp *TpacketReq3) error { return setsockopt(fd, level, opt, unsafe.Pointer(tp), unsafe.Sizeof(*tp)) } func SetsockoptTCPRepairOpt(fd, level, opt int, o []TCPRepairOpt) (err error) { if len(o) == 0 { return EINVAL } return setsockopt(fd, level, opt, unsafe.Pointer(&o[0]), uintptr(SizeofTCPRepairOpt*len(o))) } func SetsockoptTCPMD5Sig(fd, level, opt int, s *TCPMD5Sig) error { return setsockopt(fd, level, opt, unsafe.Pointer(s), unsafe.Sizeof(*s)) } // Keyctl Commands (http://man7.org/linux/man-pages/man2/keyctl.2.html) // KeyctlInt calls keyctl commands in which each argument is an int. // These commands are KEYCTL_REVOKE, KEYCTL_CHOWN, KEYCTL_CLEAR, KEYCTL_LINK, // KEYCTL_UNLINK, KEYCTL_NEGATE, KEYCTL_SET_REQKEY_KEYRING, KEYCTL_SET_TIMEOUT, // KEYCTL_ASSUME_AUTHORITY, KEYCTL_SESSION_TO_PARENT, KEYCTL_REJECT, // KEYCTL_INVALIDATE, and KEYCTL_GET_PERSISTENT. //sys KeyctlInt(cmd int, arg2 int, arg3 int, arg4 int, arg5 int) (ret int, err error) = SYS_KEYCTL // KeyctlBuffer calls keyctl commands in which the third and fourth // arguments are a buffer and its length, respectively. // These commands are KEYCTL_UPDATE, KEYCTL_READ, and KEYCTL_INSTANTIATE. //sys KeyctlBuffer(cmd int, arg2 int, buf []byte, arg5 int) (ret int, err error) = SYS_KEYCTL // KeyctlString calls keyctl commands which return a string. // These commands are KEYCTL_DESCRIBE and KEYCTL_GET_SECURITY. func KeyctlString(cmd int, id int) (string, error) { // We must loop as the string data may change in between the syscalls. // We could allocate a large buffer here to reduce the chance that the // syscall needs to be called twice; however, this is unnecessary as // the performance loss is negligible. var buffer []byte for { // Try to fill the buffer with data length, err := KeyctlBuffer(cmd, id, buffer, 0) if err != nil { return "", err } // Check if the data was written if length <= len(buffer) { // Exclude the null terminator return string(buffer[:length-1]), nil } // Make a bigger buffer if needed buffer = make([]byte, length) } } // Keyctl commands with special signatures. // KeyctlGetKeyringID implements the KEYCTL_GET_KEYRING_ID command. // See the full documentation at: // http://man7.org/linux/man-pages/man3/keyctl_get_keyring_ID.3.html func KeyctlGetKeyringID(id int, create bool) (ringid int, err error) { createInt := 0 if create { createInt = 1 } return KeyctlInt(KEYCTL_GET_KEYRING_ID, id, createInt, 0, 0) } // KeyctlSetperm implements the KEYCTL_SETPERM command. The perm value is the // key handle permission mask as described in the "keyctl setperm" section of // http://man7.org/linux/man-pages/man1/keyctl.1.html. // See the full documentation at: // http://man7.org/linux/man-pages/man3/keyctl_setperm.3.html func KeyctlSetperm(id int, perm uint32) error { _, err := KeyctlInt(KEYCTL_SETPERM, id, int(perm), 0, 0) return err } //sys keyctlJoin(cmd int, arg2 string) (ret int, err error) = SYS_KEYCTL // KeyctlJoinSessionKeyring implements the KEYCTL_JOIN_SESSION_KEYRING command. // See the full documentation at: // http://man7.org/linux/man-pages/man3/keyctl_join_session_keyring.3.html func KeyctlJoinSessionKeyring(name string) (ringid int, err error) { return keyctlJoin(KEYCTL_JOIN_SESSION_KEYRING, name) } //sys keyctlSearch(cmd int, arg2 int, arg3 string, arg4 string, arg5 int) (ret int, err error) = SYS_KEYCTL // KeyctlSearch implements the KEYCTL_SEARCH command. // See the full documentation at: // http://man7.org/linux/man-pages/man3/keyctl_search.3.html func KeyctlSearch(ringid int, keyType, description string, destRingid int) (id int, err error) { return keyctlSearch(KEYCTL_SEARCH, ringid, keyType, description, destRingid) } //sys keyctlIOV(cmd int, arg2 int, payload []Iovec, arg5 int) (err error) = SYS_KEYCTL // KeyctlInstantiateIOV implements the KEYCTL_INSTANTIATE_IOV command. This // command is similar to KEYCTL_INSTANTIATE, except that the payload is a slice // of Iovec (each of which represents a buffer) instead of a single buffer. // See the full documentation at: // http://man7.org/linux/man-pages/man3/keyctl_instantiate_iov.3.html func KeyctlInstantiateIOV(id int, payload []Iovec, ringid int) error { return keyctlIOV(KEYCTL_INSTANTIATE_IOV, id, payload, ringid) } //sys keyctlDH(cmd int, arg2 *KeyctlDHParams, buf []byte) (ret int, err error) = SYS_KEYCTL // KeyctlDHCompute implements the KEYCTL_DH_COMPUTE command. This command // computes a Diffie-Hellman shared secret based on the provide params. The // secret is written to the provided buffer and the returned size is the number // of bytes written (returning an error if there is insufficient space in the // buffer). If a nil buffer is passed in, this function returns the minimum // buffer length needed to store the appropriate data. Note that this differs // from KEYCTL_READ's behavior which always returns the requested payload size. // See the full documentation at: // http://man7.org/linux/man-pages/man3/keyctl_dh_compute.3.html func KeyctlDHCompute(params *KeyctlDHParams, buffer []byte) (size int, err error) { return keyctlDH(KEYCTL_DH_COMPUTE, params, buffer) } // KeyctlRestrictKeyring implements the KEYCTL_RESTRICT_KEYRING command. This // command limits the set of keys that can be linked to the keyring, regardless // of keyring permissions. The command requires the "setattr" permission. // // When called with an empty keyType the command locks the keyring, preventing // any further keys from being linked to the keyring. // // The "asymmetric" keyType defines restrictions requiring key payloads to be // DER encoded X.509 certificates signed by keys in another keyring. Restrictions // for "asymmetric" include "builtin_trusted", "builtin_and_secondary_trusted", // "key_or_keyring:", and "key_or_keyring::chain". // // As of Linux 4.12, only the "asymmetric" keyType defines type-specific // restrictions. // // See the full documentation at: // http://man7.org/linux/man-pages/man3/keyctl_restrict_keyring.3.html // http://man7.org/linux/man-pages/man2/keyctl.2.html func KeyctlRestrictKeyring(ringid int, keyType string, restriction string) error { if keyType == "" { return keyctlRestrictKeyring(KEYCTL_RESTRICT_KEYRING, ringid) } return keyctlRestrictKeyringByType(KEYCTL_RESTRICT_KEYRING, ringid, keyType, restriction) } //sys keyctlRestrictKeyringByType(cmd int, arg2 int, keyType string, restriction string) (err error) = SYS_KEYCTL //sys keyctlRestrictKeyring(cmd int, arg2 int) (err error) = SYS_KEYCTL func recvmsgRaw(fd int, iov []Iovec, oob []byte, flags int, rsa *RawSockaddrAny) (n, oobn int, recvflags int, err error) { var msg Msghdr msg.Name = (*byte)(unsafe.Pointer(rsa)) msg.Namelen = uint32(SizeofSockaddrAny) var dummy byte if len(oob) > 0 { if emptyIovecs(iov) { var sockType int sockType, err = GetsockoptInt(fd, SOL_SOCKET, SO_TYPE) if err != nil { return } // receive at least one normal byte if sockType != SOCK_DGRAM { var iova [1]Iovec iova[0].Base = &dummy iova[0].SetLen(1) iov = iova[:] } } msg.Control = &oob[0] msg.SetControllen(len(oob)) } if len(iov) > 0 { msg.Iov = &iov[0] msg.SetIovlen(len(iov)) } if n, err = recvmsg(fd, &msg, flags); err != nil { return } oobn = int(msg.Controllen) recvflags = int(msg.Flags) return } func sendmsgN(fd int, iov []Iovec, oob []byte, ptr unsafe.Pointer, salen _Socklen, flags int) (n int, err error) { var msg Msghdr msg.Name = (*byte)(ptr) msg.Namelen = uint32(salen) var dummy byte var empty bool if len(oob) > 0 { empty = emptyIovecs(iov) if empty { var sockType int sockType, err = GetsockoptInt(fd, SOL_SOCKET, SO_TYPE) if err != nil { return 0, err } // send at least one normal byte if sockType != SOCK_DGRAM { var iova [1]Iovec iova[0].Base = &dummy iova[0].SetLen(1) iov = iova[:] } } msg.Control = &oob[0] msg.SetControllen(len(oob)) } if len(iov) > 0 { msg.Iov = &iov[0] msg.SetIovlen(len(iov)) } if n, err = sendmsg(fd, &msg, flags); err != nil { return 0, err } if len(oob) > 0 && empty { n = 0 } return n, nil } // BindToDevice binds the socket associated with fd to device. func BindToDevice(fd int, device string) (err error) { return SetsockoptString(fd, SOL_SOCKET, SO_BINDTODEVICE, device) } //sys ptrace(request int, pid int, addr uintptr, data uintptr) (err error) //sys ptracePtr(request int, pid int, addr uintptr, data unsafe.Pointer) (err error) = SYS_PTRACE func ptracePeek(req int, pid int, addr uintptr, out []byte) (count int, err error) { // The peek requests are machine-size oriented, so we wrap it // to retrieve arbitrary-length data. // The ptrace syscall differs from glibc's ptrace. // Peeks returns the word in *data, not as the return value. var buf [SizeofPtr]byte // Leading edge. PEEKTEXT/PEEKDATA don't require aligned // access (PEEKUSER warns that it might), but if we don't // align our reads, we might straddle an unmapped page // boundary and not get the bytes leading up to the page // boundary. n := 0 if addr%SizeofPtr != 0 { err = ptracePtr(req, pid, addr-addr%SizeofPtr, unsafe.Pointer(&buf[0])) if err != nil { return 0, err } n += copy(out, buf[addr%SizeofPtr:]) out = out[n:] } // Remainder. for len(out) > 0 { // We use an internal buffer to guarantee alignment. // It's not documented if this is necessary, but we're paranoid. err = ptracePtr(req, pid, addr+uintptr(n), unsafe.Pointer(&buf[0])) if err != nil { return n, err } copied := copy(out, buf[0:]) n += copied out = out[copied:] } return n, nil } func PtracePeekText(pid int, addr uintptr, out []byte) (count int, err error) { return ptracePeek(PTRACE_PEEKTEXT, pid, addr, out) } func PtracePeekData(pid int, addr uintptr, out []byte) (count int, err error) { return ptracePeek(PTRACE_PEEKDATA, pid, addr, out) } func PtracePeekUser(pid int, addr uintptr, out []byte) (count int, err error) { return ptracePeek(PTRACE_PEEKUSR, pid, addr, out) } func ptracePoke(pokeReq int, peekReq int, pid int, addr uintptr, data []byte) (count int, err error) { // As for ptracePeek, we need to align our accesses to deal // with the possibility of straddling an invalid page. // Leading edge. n := 0 if addr%SizeofPtr != 0 { var buf [SizeofPtr]byte err = ptracePtr(peekReq, pid, addr-addr%SizeofPtr, unsafe.Pointer(&buf[0])) if err != nil { return 0, err } n += copy(buf[addr%SizeofPtr:], data) word := *((*uintptr)(unsafe.Pointer(&buf[0]))) err = ptrace(pokeReq, pid, addr-addr%SizeofPtr, word) if err != nil { return 0, err } data = data[n:] } // Interior. for len(data) > SizeofPtr { word := *((*uintptr)(unsafe.Pointer(&data[0]))) err = ptrace(pokeReq, pid, addr+uintptr(n), word) if err != nil { return n, err } n += SizeofPtr data = data[SizeofPtr:] } // Trailing edge. if len(data) > 0 { var buf [SizeofPtr]byte err = ptracePtr(peekReq, pid, addr+uintptr(n), unsafe.Pointer(&buf[0])) if err != nil { return n, err } copy(buf[0:], data) word := *((*uintptr)(unsafe.Pointer(&buf[0]))) err = ptrace(pokeReq, pid, addr+uintptr(n), word) if err != nil { return n, err } n += len(data) } return n, nil } func PtracePokeText(pid int, addr uintptr, data []byte) (count int, err error) { return ptracePoke(PTRACE_POKETEXT, PTRACE_PEEKTEXT, pid, addr, data) } func PtracePokeData(pid int, addr uintptr, data []byte) (count int, err error) { return ptracePoke(PTRACE_POKEDATA, PTRACE_PEEKDATA, pid, addr, data) } func PtracePokeUser(pid int, addr uintptr, data []byte) (count int, err error) { return ptracePoke(PTRACE_POKEUSR, PTRACE_PEEKUSR, pid, addr, data) } // elfNT_PRSTATUS is a copy of the debug/elf.NT_PRSTATUS constant so // x/sys/unix doesn't need to depend on debug/elf and thus // compress/zlib, debug/dwarf, and other packages. const elfNT_PRSTATUS = 1 func PtraceGetRegs(pid int, regsout *PtraceRegs) (err error) { var iov Iovec iov.Base = (*byte)(unsafe.Pointer(regsout)) iov.SetLen(int(unsafe.Sizeof(*regsout))) return ptracePtr(PTRACE_GETREGSET, pid, uintptr(elfNT_PRSTATUS), unsafe.Pointer(&iov)) } func PtraceSetRegs(pid int, regs *PtraceRegs) (err error) { var iov Iovec iov.Base = (*byte)(unsafe.Pointer(regs)) iov.SetLen(int(unsafe.Sizeof(*regs))) return ptracePtr(PTRACE_SETREGSET, pid, uintptr(elfNT_PRSTATUS), unsafe.Pointer(&iov)) } func PtraceSetOptions(pid int, options int) (err error) { return ptrace(PTRACE_SETOPTIONS, pid, 0, uintptr(options)) } func PtraceGetEventMsg(pid int) (msg uint, err error) { var data _C_long err = ptracePtr(PTRACE_GETEVENTMSG, pid, 0, unsafe.Pointer(&data)) msg = uint(data) return } func PtraceCont(pid int, signal int) (err error) { return ptrace(PTRACE_CONT, pid, 0, uintptr(signal)) } func PtraceSyscall(pid int, signal int) (err error) { return ptrace(PTRACE_SYSCALL, pid, 0, uintptr(signal)) } func PtraceSingleStep(pid int) (err error) { return ptrace(PTRACE_SINGLESTEP, pid, 0, 0) } func PtraceInterrupt(pid int) (err error) { return ptrace(PTRACE_INTERRUPT, pid, 0, 0) } func PtraceAttach(pid int) (err error) { return ptrace(PTRACE_ATTACH, pid, 0, 0) } func PtraceSeize(pid int) (err error) { return ptrace(PTRACE_SEIZE, pid, 0, 0) } func PtraceDetach(pid int) (err error) { return ptrace(PTRACE_DETACH, pid, 0, 0) } //sys reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error) func Reboot(cmd int) (err error) { return reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, cmd, "") } func direntIno(buf []byte) (uint64, bool) { return readInt(buf, unsafe.Offsetof(Dirent{}.Ino), unsafe.Sizeof(Dirent{}.Ino)) } func direntReclen(buf []byte) (uint64, bool) { return readInt(buf, unsafe.Offsetof(Dirent{}.Reclen), unsafe.Sizeof(Dirent{}.Reclen)) } func direntNamlen(buf []byte) (uint64, bool) { reclen, ok := direntReclen(buf) if !ok { return 0, false } return reclen - uint64(unsafe.Offsetof(Dirent{}.Name)), true } //sys mount(source string, target string, fstype string, flags uintptr, data *byte) (err error) func Mount(source string, target string, fstype string, flags uintptr, data string) (err error) { // Certain file systems get rather angry and EINVAL if you give // them an empty string of data, rather than NULL. if data == "" { return mount(source, target, fstype, flags, nil) } datap, err := BytePtrFromString(data) if err != nil { return err } return mount(source, target, fstype, flags, datap) } //sys mountSetattr(dirfd int, pathname string, flags uint, attr *MountAttr, size uintptr) (err error) = SYS_MOUNT_SETATTR // MountSetattr is a wrapper for mount_setattr(2). // https://man7.org/linux/man-pages/man2/mount_setattr.2.html // // Requires kernel >= 5.12. func MountSetattr(dirfd int, pathname string, flags uint, attr *MountAttr) error { return mountSetattr(dirfd, pathname, flags, attr, unsafe.Sizeof(*attr)) } func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { if raceenabled { raceReleaseMerge(unsafe.Pointer(&ioSync)) } return sendfile(outfd, infd, offset, count) } // Sendto // Recvfrom // Socketpair /* * Direct access */ //sys Acct(path string) (err error) //sys AddKey(keyType string, description string, payload []byte, ringid int) (id int, err error) //sys Adjtimex(buf *Timex) (state int, err error) //sysnb Capget(hdr *CapUserHeader, data *CapUserData) (err error) //sysnb Capset(hdr *CapUserHeader, data *CapUserData) (err error) //sys Chdir(path string) (err error) //sys Chroot(path string) (err error) //sys ClockAdjtime(clockid int32, buf *Timex) (state int, err error) //sys ClockGetres(clockid int32, res *Timespec) (err error) //sys ClockGettime(clockid int32, time *Timespec) (err error) //sys ClockSettime(clockid int32, time *Timespec) (err error) //sys ClockNanosleep(clockid int32, flags int, request *Timespec, remain *Timespec) (err error) //sys Close(fd int) (err error) //sys CloseRange(first uint, last uint, flags uint) (err error) //sys CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) //sys DeleteModule(name string, flags int) (err error) //sys Dup(oldfd int) (fd int, err error) func Dup2(oldfd, newfd int) error { return Dup3(oldfd, newfd, 0) } //sys Dup3(oldfd int, newfd int, flags int) (err error) //sysnb EpollCreate1(flag int) (fd int, err error) //sysnb EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) //sys Eventfd(initval uint, flags int) (fd int, err error) = SYS_EVENTFD2 //sys Exit(code int) = SYS_EXIT_GROUP //sys Fallocate(fd int, mode uint32, off int64, len int64) (err error) //sys Fchdir(fd int) (err error) //sys Fchmod(fd int, mode uint32) (err error) //sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) //sys Fdatasync(fd int) (err error) //sys Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) //sys FinitModule(fd int, params string, flags int) (err error) //sys Flistxattr(fd int, dest []byte) (sz int, err error) //sys Flock(fd int, how int) (err error) //sys Fremovexattr(fd int, attr string) (err error) //sys Fsetxattr(fd int, attr string, dest []byte, flags int) (err error) //sys Fsync(fd int) (err error) //sys Fsmount(fd int, flags int, mountAttrs int) (fsfd int, err error) //sys Fsopen(fsName string, flags int) (fd int, err error) //sys Fspick(dirfd int, pathName string, flags int) (fd int, err error) //sys fsconfig(fd int, cmd uint, key *byte, value *byte, aux int) (err error) func fsconfigCommon(fd int, cmd uint, key string, value *byte, aux int) (err error) { var keyp *byte if keyp, err = BytePtrFromString(key); err != nil { return } return fsconfig(fd, cmd, keyp, value, aux) } // FsconfigSetFlag is equivalent to fsconfig(2) called // with cmd == FSCONFIG_SET_FLAG. // // fd is the filesystem context to act upon. // key the parameter key to set. func FsconfigSetFlag(fd int, key string) (err error) { return fsconfigCommon(fd, FSCONFIG_SET_FLAG, key, nil, 0) } // FsconfigSetString is equivalent to fsconfig(2) called // with cmd == FSCONFIG_SET_STRING. // // fd is the filesystem context to act upon. // key the parameter key to set. // value is the parameter value to set. func FsconfigSetString(fd int, key string, value string) (err error) { var valuep *byte if valuep, err = BytePtrFromString(value); err != nil { return } return fsconfigCommon(fd, FSCONFIG_SET_STRING, key, valuep, 0) } // FsconfigSetBinary is equivalent to fsconfig(2) called // with cmd == FSCONFIG_SET_BINARY. // // fd is the filesystem context to act upon. // key the parameter key to set. // value is the parameter value to set. func FsconfigSetBinary(fd int, key string, value []byte) (err error) { if len(value) == 0 { return EINVAL } return fsconfigCommon(fd, FSCONFIG_SET_BINARY, key, &value[0], len(value)) } // FsconfigSetPath is equivalent to fsconfig(2) called // with cmd == FSCONFIG_SET_PATH. // // fd is the filesystem context to act upon. // key the parameter key to set. // path is a non-empty path for specified key. // atfd is a file descriptor at which to start lookup from or AT_FDCWD. func FsconfigSetPath(fd int, key string, path string, atfd int) (err error) { var valuep *byte if valuep, err = BytePtrFromString(path); err != nil { return } return fsconfigCommon(fd, FSCONFIG_SET_PATH, key, valuep, atfd) } // FsconfigSetPathEmpty is equivalent to fsconfig(2) called // with cmd == FSCONFIG_SET_PATH_EMPTY. The same as // FconfigSetPath but with AT_PATH_EMPTY implied. func FsconfigSetPathEmpty(fd int, key string, path string, atfd int) (err error) { var valuep *byte if valuep, err = BytePtrFromString(path); err != nil { return } return fsconfigCommon(fd, FSCONFIG_SET_PATH_EMPTY, key, valuep, atfd) } // FsconfigSetFd is equivalent to fsconfig(2) called // with cmd == FSCONFIG_SET_FD. // // fd is the filesystem context to act upon. // key the parameter key to set. // value is a file descriptor to be assigned to specified key. func FsconfigSetFd(fd int, key string, value int) (err error) { return fsconfigCommon(fd, FSCONFIG_SET_FD, key, nil, value) } // FsconfigCreate is equivalent to fsconfig(2) called // with cmd == FSCONFIG_CMD_CREATE. // // fd is the filesystem context to act upon. func FsconfigCreate(fd int) (err error) { return fsconfig(fd, FSCONFIG_CMD_CREATE, nil, nil, 0) } // FsconfigReconfigure is equivalent to fsconfig(2) called // with cmd == FSCONFIG_CMD_RECONFIGURE. // // fd is the filesystem context to act upon. func FsconfigReconfigure(fd int) (err error) { return fsconfig(fd, FSCONFIG_CMD_RECONFIGURE, nil, nil, 0) } //sys Getdents(fd int, buf []byte) (n int, err error) = SYS_GETDENTS64 //sysnb Getpgid(pid int) (pgid int, err error) func Getpgrp() (pid int) { pid, _ = Getpgid(0) return } //sysnb Getpid() (pid int) //sysnb Getppid() (ppid int) //sys Getpriority(which int, who int) (prio int, err error) func Getrandom(buf []byte, flags int) (n int, err error) { vdsoRet, supported := vgetrandom(buf, uint32(flags)) if supported { if vdsoRet < 0 { return 0, errnoErr(syscall.Errno(-vdsoRet)) } return vdsoRet, nil } var p *byte if len(buf) > 0 { p = &buf[0] } r, _, e := Syscall(SYS_GETRANDOM, uintptr(unsafe.Pointer(p)), uintptr(len(buf)), uintptr(flags)) if e != 0 { return 0, errnoErr(e) } return int(r), nil } //sysnb Getrusage(who int, rusage *Rusage) (err error) //sysnb Getsid(pid int) (sid int, err error) //sysnb Gettid() (tid int) //sys Getxattr(path string, attr string, dest []byte) (sz int, err error) //sys InitModule(moduleImage []byte, params string) (err error) //sys InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) //sysnb InotifyInit1(flags int) (fd int, err error) //sysnb InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) //sysnb Kill(pid int, sig syscall.Signal) (err error) //sys Klogctl(typ int, buf []byte) (n int, err error) = SYS_SYSLOG //sys Lgetxattr(path string, attr string, dest []byte) (sz int, err error) //sys Listxattr(path string, dest []byte) (sz int, err error) //sys Llistxattr(path string, dest []byte) (sz int, err error) //sys Lremovexattr(path string, attr string) (err error) //sys Lsetxattr(path string, attr string, data []byte, flags int) (err error) //sys MemfdCreate(name string, flags int) (fd int, err error) //sys Mkdirat(dirfd int, path string, mode uint32) (err error) //sys Mknodat(dirfd int, path string, mode uint32, dev int) (err error) //sys MoveMount(fromDirfd int, fromPathName string, toDirfd int, toPathName string, flags int) (err error) //sys Nanosleep(time *Timespec, leftover *Timespec) (err error) //sys OpenTree(dfd int, fileName string, flags uint) (r int, err error) //sys PerfEventOpen(attr *PerfEventAttr, pid int, cpu int, groupFd int, flags int) (fd int, err error) //sys PivotRoot(newroot string, putold string) (err error) = SYS_PIVOT_ROOT //sys Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error) //sys pselect6(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timespec, sigmask *sigset_argpack) (n int, err error) //sys read(fd int, p []byte) (n int, err error) //sys Removexattr(path string, attr string) (err error) //sys Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error) //sys RequestKey(keyType string, description string, callback string, destRingid int) (id int, err error) //sys Setdomainname(p []byte) (err error) //sys Sethostname(p []byte) (err error) //sysnb Setpgid(pid int, pgid int) (err error) //sysnb Setsid() (pid int, err error) //sysnb Settimeofday(tv *Timeval) (err error) //sys Setns(fd int, nstype int) (err error) //go:linkname syscall_prlimit syscall.prlimit func syscall_prlimit(pid, resource int, newlimit, old *syscall.Rlimit) error func Prlimit(pid, resource int, newlimit, old *Rlimit) error { // Just call the syscall version, because as of Go 1.21 // it will affect starting a new process. return syscall_prlimit(pid, resource, (*syscall.Rlimit)(newlimit), (*syscall.Rlimit)(old)) } // PrctlRetInt performs a prctl operation specified by option and further // optional arguments arg2 through arg5 depending on option. It returns a // non-negative integer that is returned by the prctl syscall. func PrctlRetInt(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (int, error) { ret, _, err := Syscall6(SYS_PRCTL, uintptr(option), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0) if err != 0 { return 0, err } return int(ret), nil } func Setuid(uid int) (err error) { return syscall.Setuid(uid) } func Setgid(gid int) (err error) { return syscall.Setgid(gid) } func Setreuid(ruid, euid int) (err error) { return syscall.Setreuid(ruid, euid) } func Setregid(rgid, egid int) (err error) { return syscall.Setregid(rgid, egid) } func Setresuid(ruid, euid, suid int) (err error) { return syscall.Setresuid(ruid, euid, suid) } func Setresgid(rgid, egid, sgid int) (err error) { return syscall.Setresgid(rgid, egid, sgid) } // SetfsgidRetGid sets fsgid for current thread and returns previous fsgid set. // setfsgid(2) will return a non-nil error only if its caller lacks CAP_SETUID capability. // If the call fails due to other reasons, current fsgid will be returned. func SetfsgidRetGid(gid int) (int, error) { return setfsgid(gid) } // SetfsuidRetUid sets fsuid for current thread and returns previous fsuid set. // setfsgid(2) will return a non-nil error only if its caller lacks CAP_SETUID capability // If the call fails due to other reasons, current fsuid will be returned. func SetfsuidRetUid(uid int) (int, error) { return setfsuid(uid) } func Setfsgid(gid int) error { _, err := setfsgid(gid) return err } func Setfsuid(uid int) error { _, err := setfsuid(uid) return err } func Signalfd(fd int, sigmask *Sigset_t, flags int) (newfd int, err error) { return signalfd(fd, sigmask, _C__NSIG/8, flags) } //sys Setpriority(which int, who int, prio int) (err error) //sys Setxattr(path string, attr string, data []byte, flags int) (err error) //sys signalfd(fd int, sigmask *Sigset_t, maskSize uintptr, flags int) (newfd int, err error) = SYS_SIGNALFD4 //sys Statx(dirfd int, path string, flags int, mask int, stat *Statx_t) (err error) //sys Sync() //sys Syncfs(fd int) (err error) //sysnb Sysinfo(info *Sysinfo_t) (err error) //sys Tee(rfd int, wfd int, len int, flags int) (n int64, err error) //sysnb TimerfdCreate(clockid int, flags int) (fd int, err error) //sysnb TimerfdGettime(fd int, currValue *ItimerSpec) (err error) //sysnb TimerfdSettime(fd int, flags int, newValue *ItimerSpec, oldValue *ItimerSpec) (err error) //sysnb Tgkill(tgid int, tid int, sig syscall.Signal) (err error) //sysnb Times(tms *Tms) (ticks uintptr, err error) //sysnb Umask(mask int) (oldmask int) //sysnb Uname(buf *Utsname) (err error) //sys Unmount(target string, flags int) (err error) = SYS_UMOUNT2 //sys Unshare(flags int) (err error) //sys write(fd int, p []byte) (n int, err error) //sys exitThread(code int) (err error) = SYS_EXIT //sys readv(fd int, iovs []Iovec) (n int, err error) = SYS_READV //sys writev(fd int, iovs []Iovec) (n int, err error) = SYS_WRITEV //sys preadv(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) = SYS_PREADV //sys pwritev(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) = SYS_PWRITEV //sys preadv2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) = SYS_PREADV2 //sys pwritev2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) = SYS_PWRITEV2 // minIovec is the size of the small initial allocation used by // Readv, Writev, etc. // // This small allocation gets stack allocated, which lets the // common use case of len(iovs) <= minIovs avoid more expensive // heap allocations. const minIovec = 8 // appendBytes converts bs to Iovecs and appends them to vecs. func appendBytes(vecs []Iovec, bs [][]byte) []Iovec { for _, b := range bs { var v Iovec v.SetLen(len(b)) if len(b) > 0 { v.Base = &b[0] } else { v.Base = (*byte)(unsafe.Pointer(&_zero)) } vecs = append(vecs, v) } return vecs } // offs2lohi splits offs into its low and high order bits. func offs2lohi(offs int64) (lo, hi uintptr) { const longBits = SizeofLong * 8 return uintptr(offs), uintptr(uint64(offs) >> (longBits - 1) >> 1) // two shifts to avoid false positive in vet } func Readv(fd int, iovs [][]byte) (n int, err error) { iovecs := make([]Iovec, 0, minIovec) iovecs = appendBytes(iovecs, iovs) n, err = readv(fd, iovecs) readvRacedetect(iovecs, n, err) return n, err } func Preadv(fd int, iovs [][]byte, offset int64) (n int, err error) { iovecs := make([]Iovec, 0, minIovec) iovecs = appendBytes(iovecs, iovs) lo, hi := offs2lohi(offset) n, err = preadv(fd, iovecs, lo, hi) readvRacedetect(iovecs, n, err) return n, err } func Preadv2(fd int, iovs [][]byte, offset int64, flags int) (n int, err error) { iovecs := make([]Iovec, 0, minIovec) iovecs = appendBytes(iovecs, iovs) lo, hi := offs2lohi(offset) n, err = preadv2(fd, iovecs, lo, hi, flags) readvRacedetect(iovecs, n, err) return n, err } func readvRacedetect(iovecs []Iovec, n int, err error) { if !raceenabled { return } for i := 0; n > 0 && i < len(iovecs); i++ { m := min(int(iovecs[i].Len), n) n -= m if m > 0 { raceWriteRange(unsafe.Pointer(iovecs[i].Base), m) } } if err == nil { raceAcquire(unsafe.Pointer(&ioSync)) } } func Writev(fd int, iovs [][]byte) (n int, err error) { iovecs := make([]Iovec, 0, minIovec) iovecs = appendBytes(iovecs, iovs) if raceenabled { raceReleaseMerge(unsafe.Pointer(&ioSync)) } n, err = writev(fd, iovecs) writevRacedetect(iovecs, n) return n, err } func Pwritev(fd int, iovs [][]byte, offset int64) (n int, err error) { iovecs := make([]Iovec, 0, minIovec) iovecs = appendBytes(iovecs, iovs) if raceenabled { raceReleaseMerge(unsafe.Pointer(&ioSync)) } lo, hi := offs2lohi(offset) n, err = pwritev(fd, iovecs, lo, hi) writevRacedetect(iovecs, n) return n, err } func Pwritev2(fd int, iovs [][]byte, offset int64, flags int) (n int, err error) { iovecs := make([]Iovec, 0, minIovec) iovecs = appendBytes(iovecs, iovs) if raceenabled { raceReleaseMerge(unsafe.Pointer(&ioSync)) } lo, hi := offs2lohi(offset) n, err = pwritev2(fd, iovecs, lo, hi, flags) writevRacedetect(iovecs, n) return n, err } func writevRacedetect(iovecs []Iovec, n int) { if !raceenabled { return } for i := 0; n > 0 && i < len(iovecs); i++ { m := min(int(iovecs[i].Len), n) n -= m if m > 0 { raceReadRange(unsafe.Pointer(iovecs[i].Base), m) } } } // mmap varies by architecture; see syscall_linux_*.go. //sys munmap(addr uintptr, length uintptr) (err error) //sys mremap(oldaddr uintptr, oldlength uintptr, newlength uintptr, flags int, newaddr uintptr) (xaddr uintptr, err error) //sys Madvise(b []byte, advice int) (err error) //sys Mprotect(b []byte, prot int) (err error) //sys Mlock(b []byte) (err error) //sys Mlockall(flags int) (err error) //sys Msync(b []byte, flags int) (err error) //sys Munlock(b []byte) (err error) //sys Munlockall() (err error) const ( mremapFixed = MREMAP_FIXED mremapDontunmap = MREMAP_DONTUNMAP mremapMaymove = MREMAP_MAYMOVE ) // Vmsplice splices user pages from a slice of Iovecs into a pipe specified by fd, // using the specified flags. func Vmsplice(fd int, iovs []Iovec, flags int) (int, error) { var p unsafe.Pointer if len(iovs) > 0 { p = unsafe.Pointer(&iovs[0]) } n, _, errno := Syscall6(SYS_VMSPLICE, uintptr(fd), uintptr(p), uintptr(len(iovs)), uintptr(flags), 0, 0) if errno != 0 { return 0, syscall.Errno(errno) } return int(n), nil } func isGroupMember(gid int) bool { groups, err := Getgroups() if err != nil { return false } return slices.Contains(groups, gid) } func isCapDacOverrideSet() bool { hdr := CapUserHeader{Version: LINUX_CAPABILITY_VERSION_3} data := [2]CapUserData{} err := Capget(&hdr, &data[0]) return err == nil && data[0].Effective&(1<> 6) & 7 } else { var gid int if flags&AT_EACCESS != 0 { gid = Getegid() } else { gid = Getgid() } if uint32(gid) == st.Gid || isGroupMember(int(st.Gid)) { fmode = (st.Mode >> 3) & 7 } else { fmode = st.Mode & 7 } } if fmode&mode == mode { return nil } return EACCES } //sys nameToHandleAt(dirFD int, pathname string, fh *fileHandle, mountID *_C_int, flags int) (err error) = SYS_NAME_TO_HANDLE_AT //sys openByHandleAt(mountFD int, fh *fileHandle, flags int) (fd int, err error) = SYS_OPEN_BY_HANDLE_AT // fileHandle is the argument to nameToHandleAt and openByHandleAt. We // originally tried to generate it via unix/linux/types.go with "type // fileHandle C.struct_file_handle" but that generated empty structs // for mips64 and mips64le. Instead, hard code it for now (it's the // same everywhere else) until the mips64 generator issue is fixed. type fileHandle struct { Bytes uint32 Type int32 } // FileHandle represents the C struct file_handle used by // name_to_handle_at (see NameToHandleAt) and open_by_handle_at (see // OpenByHandleAt). type FileHandle struct { *fileHandle } // NewFileHandle constructs a FileHandle. func NewFileHandle(handleType int32, handle []byte) FileHandle { const hdrSize = unsafe.Sizeof(fileHandle{}) buf := make([]byte, hdrSize+uintptr(len(handle))) copy(buf[hdrSize:], handle) fh := (*fileHandle)(unsafe.Pointer(&buf[0])) fh.Type = handleType fh.Bytes = uint32(len(handle)) return FileHandle{fh} } func (fh *FileHandle) Size() int { return int(fh.fileHandle.Bytes) } func (fh *FileHandle) Type() int32 { return fh.fileHandle.Type } func (fh *FileHandle) Bytes() []byte { n := fh.Size() if n == 0 { return nil } return unsafe.Slice((*byte)(unsafe.Pointer(uintptr(unsafe.Pointer(&fh.fileHandle.Type))+4)), n) } // NameToHandleAt wraps the name_to_handle_at system call; it obtains // a handle for a path name. func NameToHandleAt(dirfd int, path string, flags int) (handle FileHandle, mountID int, err error) { var mid _C_int // Try first with a small buffer, assuming the handle will // only be 32 bytes. size := uint32(32 + unsafe.Sizeof(fileHandle{})) didResize := false for { buf := make([]byte, size) fh := (*fileHandle)(unsafe.Pointer(&buf[0])) fh.Bytes = size - uint32(unsafe.Sizeof(fileHandle{})) err = nameToHandleAt(dirfd, path, fh, &mid, flags) if err == EOVERFLOW { if didResize { // We shouldn't need to resize more than once return } didResize = true size = fh.Bytes + uint32(unsafe.Sizeof(fileHandle{})) continue } if err != nil { return } return FileHandle{fh}, int(mid), nil } } // OpenByHandleAt wraps the open_by_handle_at system call; it opens a // file via a handle as previously returned by NameToHandleAt. func OpenByHandleAt(mountFD int, handle FileHandle, flags int) (fd int, err error) { return openByHandleAt(mountFD, handle.fileHandle, flags) } // Klogset wraps the sys_syslog system call; it sets console_loglevel to // the value specified by arg and passes a dummy pointer to bufp. func Klogset(typ int, arg int) (err error) { var p unsafe.Pointer _, _, errno := Syscall(SYS_SYSLOG, uintptr(typ), uintptr(p), uintptr(arg)) if errno != 0 { return errnoErr(errno) } return nil } // RemoteIovec is Iovec with the pointer replaced with an integer. // It is used for ProcessVMReadv and ProcessVMWritev, where the pointer // refers to a location in a different process' address space, which // would confuse the Go garbage collector. type RemoteIovec struct { Base uintptr Len int } //sys ProcessVMReadv(pid int, localIov []Iovec, remoteIov []RemoteIovec, flags uint) (n int, err error) = SYS_PROCESS_VM_READV //sys ProcessVMWritev(pid int, localIov []Iovec, remoteIov []RemoteIovec, flags uint) (n int, err error) = SYS_PROCESS_VM_WRITEV //sys PidfdOpen(pid int, flags int) (fd int, err error) = SYS_PIDFD_OPEN //sys PidfdGetfd(pidfd int, targetfd int, flags int) (fd int, err error) = SYS_PIDFD_GETFD //sys PidfdSendSignal(pidfd int, sig Signal, info *Siginfo, flags int) (err error) = SYS_PIDFD_SEND_SIGNAL //sys shmat(id int, addr uintptr, flag int) (ret uintptr, err error) //sys shmctl(id int, cmd int, buf *SysvShmDesc) (result int, err error) //sys shmdt(addr uintptr) (err error) //sys shmget(key int, size int, flag int) (id int, err error) //sys getitimer(which int, currValue *Itimerval) (err error) //sys setitimer(which int, newValue *Itimerval, oldValue *Itimerval) (err error) // MakeItimerval creates an Itimerval from interval and value durations. func MakeItimerval(interval, value time.Duration) Itimerval { return Itimerval{ Interval: NsecToTimeval(interval.Nanoseconds()), Value: NsecToTimeval(value.Nanoseconds()), } } // A value which may be passed to the which parameter for Getitimer and // Setitimer. type ItimerWhich int // Possible which values for Getitimer and Setitimer. const ( ItimerReal ItimerWhich = ITIMER_REAL ItimerVirtual ItimerWhich = ITIMER_VIRTUAL ItimerProf ItimerWhich = ITIMER_PROF ) // Getitimer wraps getitimer(2) to return the current value of the timer // specified by which. func Getitimer(which ItimerWhich) (Itimerval, error) { var it Itimerval if err := getitimer(int(which), &it); err != nil { return Itimerval{}, err } return it, nil } // Setitimer wraps setitimer(2) to arm or disarm the timer specified by which. // It returns the previous value of the timer. // // If the Itimerval argument is the zero value, the timer will be disarmed. func Setitimer(which ItimerWhich, it Itimerval) (Itimerval, error) { var prev Itimerval if err := setitimer(int(which), &it, &prev); err != nil { return Itimerval{}, err } return prev, nil } //sysnb rtSigprocmask(how int, set *Sigset_t, oldset *Sigset_t, sigsetsize uintptr) (err error) = SYS_RT_SIGPROCMASK func PthreadSigmask(how int, set, oldset *Sigset_t) error { if oldset != nil { // Explicitly clear in case Sigset_t is larger than _C__NSIG. *oldset = Sigset_t{} } return rtSigprocmask(how, set, oldset, _C__NSIG/8) } //sysnb getresuid(ruid *_C_int, euid *_C_int, suid *_C_int) //sysnb getresgid(rgid *_C_int, egid *_C_int, sgid *_C_int) func Getresuid() (ruid, euid, suid int) { var r, e, s _C_int getresuid(&r, &e, &s) return int(r), int(e), int(s) } func Getresgid() (rgid, egid, sgid int) { var r, e, s _C_int getresgid(&r, &e, &s) return int(r), int(e), int(s) } // Pselect is a wrapper around the Linux pselect6 system call. // This version does not modify the timeout argument. func Pselect(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { // Per https://man7.org/linux/man-pages/man2/select.2.html#NOTES, // The Linux pselect6() system call modifies its timeout argument. // [Not modifying the argument] is the behavior required by POSIX.1-2001. var mutableTimeout *Timespec if timeout != nil { mutableTimeout = new(Timespec) *mutableTimeout = *timeout } // The final argument of the pselect6() system call is not a // sigset_t * pointer, but is instead a structure var kernelMask *sigset_argpack if sigmask != nil { wordBits := 32 << (^uintptr(0) >> 63) // see math.intSize // A sigset stores one bit per signal, // offset by 1 (because signal 0 does not exist). // So the number of words needed is ⌈__C_NSIG - 1 / wordBits⌉. sigsetWords := (_C__NSIG - 1 + wordBits - 1) / (wordBits) sigsetBytes := uintptr(sigsetWords * (wordBits / 8)) kernelMask = &sigset_argpack{ ss: sigmask, ssLen: sigsetBytes, } } return pselect6(nfd, r, w, e, mutableTimeout, kernelMask) } //sys schedSetattr(pid int, attr *SchedAttr, flags uint) (err error) //sys schedGetattr(pid int, attr *SchedAttr, size uint, flags uint) (err error) // SchedSetAttr is a wrapper for sched_setattr(2) syscall. // https://man7.org/linux/man-pages/man2/sched_setattr.2.html func SchedSetAttr(pid int, attr *SchedAttr, flags uint) error { if attr == nil { return EINVAL } attr.Size = SizeofSchedAttr return schedSetattr(pid, attr, flags) } // SchedGetAttr is a wrapper for sched_getattr(2) syscall. // https://man7.org/linux/man-pages/man2/sched_getattr.2.html func SchedGetAttr(pid int, flags uint) (*SchedAttr, error) { attr := &SchedAttr{} if err := schedGetattr(pid, attr, SizeofSchedAttr, flags); err != nil { return nil, err } return attr, nil } //sys Cachestat(fd uint, crange *CachestatRange, cstat *Cachestat_t, flags uint) (err error) //sys Mseal(b []byte, flags uint) (err error) //sys setMemPolicy(mode int, mask *CPUSet, size int) (err error) = SYS_SET_MEMPOLICY func SetMemPolicy(mode int, mask *CPUSet) error { return setMemPolicy(mode, mask, _CPU_SETSIZE) } ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_linux_386.go ================================================ // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build 386 && linux package unix import ( "unsafe" ) func setTimespec(sec, nsec int64) Timespec { return Timespec{Sec: int32(sec), Nsec: int32(nsec)} } func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: int32(sec), Usec: int32(usec)} } // 64-bit file system and 32-bit uid calls // (386 default is 32-bit file system and 16-bit uid). //sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64_64 //sys Fchown(fd int, uid int, gid int) (err error) = SYS_FCHOWN32 //sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64 //sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64 //sys Ftruncate(fd int, length int64) (err error) = SYS_FTRUNCATE64 //sysnb Getegid() (egid int) = SYS_GETEGID32 //sysnb Geteuid() (euid int) = SYS_GETEUID32 //sysnb Getgid() (gid int) = SYS_GETGID32 //sysnb Getuid() (uid int) = SYS_GETUID32 //sys Ioperm(from int, num int, on int) (err error) //sys Iopl(level int) (err error) //sys Lchown(path string, uid int, gid int) (err error) = SYS_LCHOWN32 //sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64 //sys pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 //sys pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 //sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) = SYS_SENDFILE64 //sys setfsgid(gid int) (prev int, err error) = SYS_SETFSGID32 //sys setfsuid(uid int) (prev int, err error) = SYS_SETFSUID32 //sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) //sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64 //sys SyncFileRange(fd int, off int64, n int64, flags int) (err error) //sys Truncate(path string, length int64) (err error) = SYS_TRUNCATE64 //sys Ustat(dev int, ubuf *Ustat_t) (err error) //sysnb getgroups(n int, list *_Gid_t) (nn int, err error) = SYS_GETGROUPS32 //sysnb setgroups(n int, list *_Gid_t) (err error) = SYS_SETGROUPS32 //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS__NEWSELECT //sys mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, err error) //sys Pause() (err error) func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) { page := uintptr(offset / 4096) if offset != int64(page)*4096 { return 0, EINVAL } return mmap2(addr, length, prot, flags, fd, page) } type rlimit32 struct { Cur uint32 Max uint32 } //sysnb getrlimit(resource int, rlim *rlimit32) (err error) = SYS_GETRLIMIT const rlimInf32 = ^uint32(0) const rlimInf64 = ^uint64(0) func Getrlimit(resource int, rlim *Rlimit) (err error) { err = Prlimit(0, resource, nil, rlim) if err != ENOSYS { return err } rl := rlimit32{} err = getrlimit(resource, &rl) if err != nil { return } if rl.Cur == rlimInf32 { rlim.Cur = rlimInf64 } else { rlim.Cur = uint64(rl.Cur) } if rl.Max == rlimInf32 { rlim.Max = rlimInf64 } else { rlim.Max = uint64(rl.Max) } return } func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { newoffset, errno := seek(fd, offset, whence) if errno != 0 { return 0, errno } return newoffset, nil } //sys futimesat(dirfd int, path string, times *[2]Timeval) (err error) //sysnb Gettimeofday(tv *Timeval) (err error) //sysnb Time(t *Time_t) (tt Time_t, err error) //sys Utime(path string, buf *Utimbuf) (err error) //sys utimes(path string, times *[2]Timeval) (err error) // On x86 Linux, all the socket calls go through an extra indirection, // I think because the 5-register system call interface can't handle // the 6-argument calls like sendto and recvfrom. Instead the // arguments to the underlying system call are the number below // and a pointer to an array of uintptr. We hide the pointer in the // socketcall assembly to avoid allocation on every system call. const ( // see linux/net.h _SOCKET = 1 _BIND = 2 _CONNECT = 3 _LISTEN = 4 _ACCEPT = 5 _GETSOCKNAME = 6 _GETPEERNAME = 7 _SOCKETPAIR = 8 _SEND = 9 _RECV = 10 _SENDTO = 11 _RECVFROM = 12 _SHUTDOWN = 13 _SETSOCKOPT = 14 _GETSOCKOPT = 15 _SENDMSG = 16 _RECVMSG = 17 _ACCEPT4 = 18 _RECVMMSG = 19 _SENDMMSG = 20 ) func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) { fd, e := socketcall(_ACCEPT4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0) if e != 0 { err = e } return } func getsockname(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, e := rawsocketcall(_GETSOCKNAME, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0) if e != 0 { err = e } return } func getpeername(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, e := rawsocketcall(_GETPEERNAME, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0) if e != 0 { err = e } return } func socketpair(domain int, typ int, flags int, fd *[2]int32) (err error) { _, e := rawsocketcall(_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(flags), uintptr(unsafe.Pointer(fd)), 0, 0) if e != 0 { err = e } return } func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, e := socketcall(_BIND, uintptr(s), uintptr(addr), uintptr(addrlen), 0, 0, 0) if e != 0 { err = e } return } func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, e := socketcall(_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen), 0, 0, 0) if e != 0 { err = e } return } func socket(domain int, typ int, proto int) (fd int, err error) { fd, e := rawsocketcall(_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto), 0, 0, 0) if e != 0 { err = e } return } func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { _, e := socketcall(_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e != 0 { err = e } return } func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { _, e := socketcall(_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), vallen, 0) if e != 0 { err = e } return } func recvfrom(s int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { var base uintptr if len(p) > 0 { base = uintptr(unsafe.Pointer(&p[0])) } n, e := socketcall(_RECVFROM, uintptr(s), base, uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) if e != 0 { err = e } return } func sendto(s int, p []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { var base uintptr if len(p) > 0 { base = uintptr(unsafe.Pointer(&p[0])) } _, e := socketcall(_SENDTO, uintptr(s), base, uintptr(len(p)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e != 0 { err = e } return } func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { n, e := socketcall(_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags), 0, 0, 0) if e != 0 { err = e } return } func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { n, e := socketcall(_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags), 0, 0, 0) if e != 0 { err = e } return } func Listen(s int, n int) (err error) { _, e := socketcall(_LISTEN, uintptr(s), uintptr(n), 0, 0, 0, 0) if e != 0 { err = e } return } func Shutdown(s, how int) (err error) { _, e := socketcall(_SHUTDOWN, uintptr(s), uintptr(how), 0, 0, 0, 0) if e != 0 { err = e } return } func Fstatfs(fd int, buf *Statfs_t) (err error) { _, _, e := Syscall(SYS_FSTATFS64, uintptr(fd), unsafe.Sizeof(*buf), uintptr(unsafe.Pointer(buf))) if e != 0 { err = e } return } func Statfs(path string, buf *Statfs_t) (err error) { pathp, err := BytePtrFromString(path) if err != nil { return err } _, _, e := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(pathp)), unsafe.Sizeof(*buf), uintptr(unsafe.Pointer(buf))) if e != 0 { err = e } return } func (r *PtraceRegs) PC() uint64 { return uint64(uint32(r.Eip)) } func (r *PtraceRegs) SetPC(pc uint64) { r.Eip = int32(pc) } func (iov *Iovec) SetLen(length int) { iov.Len = uint32(length) } func (msghdr *Msghdr) SetControllen(length int) { msghdr.Controllen = uint32(length) } func (msghdr *Msghdr) SetIovlen(length int) { msghdr.Iovlen = uint32(length) } func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint32(length) } func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) { rsa.Service_name_len = uint32(length) } ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_linux_alarm.go ================================================ // Copyright 2022 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build linux && (386 || amd64 || mips || mipsle || mips64 || mipsle || ppc64 || ppc64le || ppc || s390x || sparc64) package unix // SYS_ALARM is not defined on arm or riscv, but is available for other GOARCH // values. //sys Alarm(seconds uint) (remaining uint, err error) ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_linux_amd64.go ================================================ // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build amd64 && linux package unix //sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64 //sys Fchown(fd int, uid int, gid int) (err error) //sys Fstat(fd int, stat *Stat_t) (err error) //sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_NEWFSTATAT //sys Fstatfs(fd int, buf *Statfs_t) (err error) //sys Ftruncate(fd int, length int64) (err error) //sysnb Getegid() (egid int) //sysnb Geteuid() (euid int) //sysnb Getgid() (gid int) //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) //sysnb Getuid() (uid int) //sys Ioperm(from int, num int, on int) (err error) //sys Iopl(level int) (err error) //sys Lchown(path string, uid int, gid int) (err error) //sys Listen(s int, n int) (err error) func Lstat(path string, stat *Stat_t) (err error) { return Fstatat(AT_FDCWD, path, stat, AT_SYMLINK_NOFOLLOW) } //sys MemfdSecret(flags int) (fd int, err error) //sys Pause() (err error) //sys pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 //sys pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 //sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) //sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { var ts *Timespec if timeout != nil { ts = &Timespec{Sec: timeout.Sec, Nsec: timeout.Usec * 1000} } return pselect6(nfd, r, w, e, ts, nil) } //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) //sys setfsgid(gid int) (prev int, err error) //sys setfsuid(uid int) (prev int, err error) //sys Shutdown(fd int, how int) (err error) //sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) func Stat(path string, stat *Stat_t) (err error) { // Use fstatat, because Android's seccomp policy blocks stat. return Fstatat(AT_FDCWD, path, stat, 0) } //sys Statfs(path string, buf *Statfs_t) (err error) //sys SyncFileRange(fd int, off int64, n int64, flags int) (err error) //sys Truncate(path string, length int64) (err error) //sys Ustat(dev int, ubuf *Ustat_t) (err error) //sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) //sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) //sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) //sysnb getgroups(n int, list *_Gid_t) (nn int, err error) //sysnb setgroups(n int, list *_Gid_t) (err error) //sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) //sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) //sysnb socket(domain int, typ int, proto int) (fd int, err error) //sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) //sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) //sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) //sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) //sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) //sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error) //sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error) //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) //sys futimesat(dirfd int, path string, times *[2]Timeval) (err error) func Gettimeofday(tv *Timeval) (err error) { errno := gettimeofday(tv) if errno != 0 { return errno } return nil } func Time(t *Time_t) (tt Time_t, err error) { var tv Timeval errno := gettimeofday(&tv) if errno != 0 { return 0, errno } if t != nil { *t = Time_t(tv.Sec) } return Time_t(tv.Sec), nil } //sys Utime(path string, buf *Utimbuf) (err error) //sys utimes(path string, times *[2]Timeval) (err error) func setTimespec(sec, nsec int64) Timespec { return Timespec{Sec: sec, Nsec: nsec} } func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: sec, Usec: usec} } func (r *PtraceRegs) PC() uint64 { return r.Rip } func (r *PtraceRegs) SetPC(pc uint64) { r.Rip = pc } func (iov *Iovec) SetLen(length int) { iov.Len = uint64(length) } func (msghdr *Msghdr) SetControllen(length int) { msghdr.Controllen = uint64(length) } func (msghdr *Msghdr) SetIovlen(length int) { msghdr.Iovlen = uint64(length) } func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint64(length) } func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) { rsa.Service_name_len = uint64(length) } //sys kexecFileLoad(kernelFd int, initrdFd int, cmdlineLen int, cmdline string, flags int) (err error) func KexecFileLoad(kernelFd int, initrdFd int, cmdline string, flags int) error { cmdlineLen := len(cmdline) if cmdlineLen > 0 { // Account for the additional NULL byte added by // BytePtrFromString in kexecFileLoad. The kexec_file_load // syscall expects a NULL-terminated string. cmdlineLen++ } return kexecFileLoad(kernelFd, initrdFd, cmdlineLen, cmdline, flags) } ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go ================================================ // Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build amd64 && linux && gc package unix import "syscall" //go:noescape func gettimeofday(tv *Timeval) (err syscall.Errno) ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_linux_arm.go ================================================ // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build arm && linux package unix import ( "unsafe" ) func setTimespec(sec, nsec int64) Timespec { return Timespec{Sec: int32(sec), Nsec: int32(nsec)} } func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: int32(sec), Usec: int32(usec)} } func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { newoffset, errno := seek(fd, offset, whence) if errno != 0 { return 0, errno } return newoffset, nil } //sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) //sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) //sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) //sysnb getgroups(n int, list *_Gid_t) (nn int, err error) = SYS_GETGROUPS32 //sysnb setgroups(n int, list *_Gid_t) (err error) = SYS_SETGROUPS32 //sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) //sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) //sysnb socket(domain int, typ int, proto int) (fd int, err error) //sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) //sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) //sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) //sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) //sysnb socketpair(domain int, typ int, flags int, fd *[2]int32) (err error) //sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error) //sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error) // 64-bit file system and 32-bit uid calls // (16-bit uid calls are not always supported in newer kernels) //sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) //sys Fchown(fd int, uid int, gid int) (err error) = SYS_FCHOWN32 //sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64 //sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64 //sysnb Getegid() (egid int) = SYS_GETEGID32 //sysnb Geteuid() (euid int) = SYS_GETEUID32 //sysnb Getgid() (gid int) = SYS_GETGID32 //sysnb Getuid() (uid int) = SYS_GETUID32 //sys Lchown(path string, uid int, gid int) (err error) = SYS_LCHOWN32 //sys Listen(s int, n int) (err error) //sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64 //sys Pause() (err error) //sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) = SYS_SENDFILE64 //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS__NEWSELECT //sys setfsgid(gid int) (prev int, err error) = SYS_SETFSGID32 //sys setfsuid(uid int) (prev int, err error) = SYS_SETFSUID32 //sys Shutdown(fd int, how int) (err error) //sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) //sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64 //sys Ustat(dev int, ubuf *Ustat_t) (err error) //sys futimesat(dirfd int, path string, times *[2]Timeval) (err error) //sysnb Gettimeofday(tv *Timeval) (err error) func Time(t *Time_t) (Time_t, error) { var tv Timeval err := Gettimeofday(&tv) if err != nil { return 0, err } if t != nil { *t = Time_t(tv.Sec) } return Time_t(tv.Sec), nil } func Utime(path string, buf *Utimbuf) error { tv := []Timeval{ {Sec: buf.Actime}, {Sec: buf.Modtime}, } return Utimes(path, tv) } //sys utimes(path string, times *[2]Timeval) (err error) //sys pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 //sys pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 //sys Truncate(path string, length int64) (err error) = SYS_TRUNCATE64 //sys Ftruncate(fd int, length int64) (err error) = SYS_FTRUNCATE64 func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall6(SYS_ARM_FADVISE64_64, uintptr(fd), uintptr(advice), uintptr(offset), uintptr(offset>>32), uintptr(length), uintptr(length>>32)) if e1 != 0 { err = errnoErr(e1) } return } //sys mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, err error) func Fstatfs(fd int, buf *Statfs_t) (err error) { _, _, e := Syscall(SYS_FSTATFS64, uintptr(fd), unsafe.Sizeof(*buf), uintptr(unsafe.Pointer(buf))) if e != 0 { err = e } return } func Statfs(path string, buf *Statfs_t) (err error) { pathp, err := BytePtrFromString(path) if err != nil { return err } _, _, e := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(pathp)), unsafe.Sizeof(*buf), uintptr(unsafe.Pointer(buf))) if e != 0 { err = e } return } func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) { page := uintptr(offset / 4096) if offset != int64(page)*4096 { return 0, EINVAL } return mmap2(addr, length, prot, flags, fd, page) } type rlimit32 struct { Cur uint32 Max uint32 } //sysnb getrlimit(resource int, rlim *rlimit32) (err error) = SYS_UGETRLIMIT const rlimInf32 = ^uint32(0) const rlimInf64 = ^uint64(0) func Getrlimit(resource int, rlim *Rlimit) (err error) { err = Prlimit(0, resource, nil, rlim) if err != ENOSYS { return err } rl := rlimit32{} err = getrlimit(resource, &rl) if err != nil { return } if rl.Cur == rlimInf32 { rlim.Cur = rlimInf64 } else { rlim.Cur = uint64(rl.Cur) } if rl.Max == rlimInf32 { rlim.Max = rlimInf64 } else { rlim.Max = uint64(rl.Max) } return } func (r *PtraceRegs) PC() uint64 { return uint64(r.Uregs[15]) } func (r *PtraceRegs) SetPC(pc uint64) { r.Uregs[15] = uint32(pc) } func (iov *Iovec) SetLen(length int) { iov.Len = uint32(length) } func (msghdr *Msghdr) SetControllen(length int) { msghdr.Controllen = uint32(length) } func (msghdr *Msghdr) SetIovlen(length int) { msghdr.Iovlen = uint32(length) } func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint32(length) } func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) { rsa.Service_name_len = uint32(length) } //sys armSyncFileRange(fd int, flags int, off int64, n int64) (err error) = SYS_ARM_SYNC_FILE_RANGE func SyncFileRange(fd int, off int64, n int64, flags int) error { // The sync_file_range and arm_sync_file_range syscalls differ only in the // order of their arguments. return armSyncFileRange(fd, flags, off, n) } //sys kexecFileLoad(kernelFd int, initrdFd int, cmdlineLen int, cmdline string, flags int) (err error) func KexecFileLoad(kernelFd int, initrdFd int, cmdline string, flags int) error { cmdlineLen := len(cmdline) if cmdlineLen > 0 { // Account for the additional NULL byte added by // BytePtrFromString in kexecFileLoad. The kexec_file_load // syscall expects a NULL-terminated string. cmdlineLen++ } return kexecFileLoad(kernelFd, initrdFd, cmdlineLen, cmdline, flags) } ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_linux_arm64.go ================================================ // Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build arm64 && linux package unix import "unsafe" //sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) = SYS_EPOLL_PWAIT //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64 //sys Fchown(fd int, uid int, gid int) (err error) //sys Fstat(fd int, stat *Stat_t) (err error) //sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) //sys Fstatfs(fd int, buf *Statfs_t) (err error) //sys Ftruncate(fd int, length int64) (err error) //sysnb Getegid() (egid int) //sysnb Geteuid() (euid int) //sysnb Getgid() (gid int) //sysnb getrlimit(resource int, rlim *Rlimit) (err error) //sysnb Getuid() (uid int) //sys Listen(s int, n int) (err error) //sys MemfdSecret(flags int) (fd int, err error) //sys pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 //sys pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 //sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) //sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { var ts *Timespec if timeout != nil { ts = &Timespec{Sec: timeout.Sec, Nsec: timeout.Usec * 1000} } return pselect6(nfd, r, w, e, ts, nil) } //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) //sys setfsgid(gid int) (prev int, err error) //sys setfsuid(uid int) (prev int, err error) //sys Shutdown(fd int, how int) (err error) //sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) func Stat(path string, stat *Stat_t) (err error) { return Fstatat(AT_FDCWD, path, stat, 0) } func Lchown(path string, uid int, gid int) (err error) { return Fchownat(AT_FDCWD, path, uid, gid, AT_SYMLINK_NOFOLLOW) } func Lstat(path string, stat *Stat_t) (err error) { return Fstatat(AT_FDCWD, path, stat, AT_SYMLINK_NOFOLLOW) } //sys Statfs(path string, buf *Statfs_t) (err error) //sys SyncFileRange(fd int, off int64, n int64, flags int) (err error) //sys Truncate(path string, length int64) (err error) func Ustat(dev int, ubuf *Ustat_t) (err error) { return ENOSYS } //sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) //sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) //sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) //sysnb getgroups(n int, list *_Gid_t) (nn int, err error) //sysnb setgroups(n int, list *_Gid_t) (err error) //sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) //sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) //sysnb socket(domain int, typ int, proto int) (fd int, err error) //sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) //sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) //sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) //sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) //sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) //sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error) //sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error) //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) //sysnb Gettimeofday(tv *Timeval) (err error) func setTimespec(sec, nsec int64) Timespec { return Timespec{Sec: sec, Nsec: nsec} } func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: sec, Usec: usec} } func futimesat(dirfd int, path string, tv *[2]Timeval) (err error) { if tv == nil { return utimensat(dirfd, path, nil, 0) } ts := []Timespec{ NsecToTimespec(TimevalToNsec(tv[0])), NsecToTimespec(TimevalToNsec(tv[1])), } return utimensat(dirfd, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0) } func Time(t *Time_t) (Time_t, error) { var tv Timeval err := Gettimeofday(&tv) if err != nil { return 0, err } if t != nil { *t = Time_t(tv.Sec) } return Time_t(tv.Sec), nil } func Utime(path string, buf *Utimbuf) error { tv := []Timeval{ {Sec: buf.Actime}, {Sec: buf.Modtime}, } return Utimes(path, tv) } func utimes(path string, tv *[2]Timeval) (err error) { if tv == nil { return utimensat(AT_FDCWD, path, nil, 0) } ts := []Timespec{ NsecToTimespec(TimevalToNsec(tv[0])), NsecToTimespec(TimevalToNsec(tv[1])), } return utimensat(AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0) } // Getrlimit prefers the prlimit64 system call. See issue 38604. func Getrlimit(resource int, rlim *Rlimit) error { err := Prlimit(0, resource, nil, rlim) if err != ENOSYS { return err } return getrlimit(resource, rlim) } func (r *PtraceRegs) PC() uint64 { return r.Pc } func (r *PtraceRegs) SetPC(pc uint64) { r.Pc = pc } func (iov *Iovec) SetLen(length int) { iov.Len = uint64(length) } func (msghdr *Msghdr) SetControllen(length int) { msghdr.Controllen = uint64(length) } func (msghdr *Msghdr) SetIovlen(length int) { msghdr.Iovlen = uint64(length) } func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint64(length) } func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) { rsa.Service_name_len = uint64(length) } func Pause() error { _, err := ppoll(nil, 0, nil, nil) return err } //sys kexecFileLoad(kernelFd int, initrdFd int, cmdlineLen int, cmdline string, flags int) (err error) func KexecFileLoad(kernelFd int, initrdFd int, cmdline string, flags int) error { cmdlineLen := len(cmdline) if cmdlineLen > 0 { // Account for the additional NULL byte added by // BytePtrFromString in kexecFileLoad. The kexec_file_load // syscall expects a NULL-terminated string. cmdlineLen++ } return kexecFileLoad(kernelFd, initrdFd, cmdlineLen, cmdline, flags) } const SYS_FSTATAT = SYS_NEWFSTATAT ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_linux_gc.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build linux && gc package unix // SyscallNoError may be used instead of Syscall for syscalls that don't fail. func SyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) // RawSyscallNoError may be used instead of RawSyscall for syscalls that don't // fail. func RawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build linux && gc && 386 package unix import "syscall" // Underlying system call writes to newoffset via pointer. // Implemented in assembly to avoid allocation. func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_linux_gc_arm.go ================================================ // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build arm && gc && linux package unix import "syscall" // Underlying system call writes to newoffset via pointer. // Implemented in assembly to avoid allocation. func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build linux && gccgo && 386 package unix import ( "syscall" "unsafe" ) func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { var newoffset int64 offsetLow := uint32(offset & 0xffffffff) offsetHigh := uint32((offset >> 32) & 0xffffffff) _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) return newoffset, err } func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) { fd, _, err := Syscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0) return int(fd), err } func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) { fd, _, err := RawSyscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0) return int(fd), err } ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build linux && gccgo && arm package unix import ( "syscall" "unsafe" ) func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { var newoffset int64 offsetLow := uint32(offset & 0xffffffff) offsetHigh := uint32((offset >> 32) & 0xffffffff) _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) return newoffset, err } ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_linux_loong64.go ================================================ // Copyright 2022 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build loong64 && linux package unix import "unsafe" //sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) = SYS_EPOLL_PWAIT //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64 //sys Fchown(fd int, uid int, gid int) (err error) //sys Fstatfs(fd int, buf *Statfs_t) (err error) //sys Ftruncate(fd int, length int64) (err error) //sysnb Getegid() (egid int) //sysnb Geteuid() (euid int) //sysnb Getgid() (gid int) //sysnb Getuid() (uid int) //sys Listen(s int, n int) (err error) //sys pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 //sys pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 //sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { var ts *Timespec if timeout != nil { ts = &Timespec{Sec: timeout.Sec, Nsec: timeout.Usec * 1000} } return pselect6(nfd, r, w, e, ts, nil) } //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) //sys setfsgid(gid int) (prev int, err error) //sys setfsuid(uid int) (prev int, err error) //sys Shutdown(fd int, how int) (err error) //sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) func timespecFromStatxTimestamp(x StatxTimestamp) Timespec { return Timespec{ Sec: x.Sec, Nsec: int64(x.Nsec), } } func Fstatat(fd int, path string, stat *Stat_t, flags int) error { var r Statx_t // Do it the glibc way, add AT_NO_AUTOMOUNT. if err := Statx(fd, path, AT_NO_AUTOMOUNT|flags, STATX_BASIC_STATS, &r); err != nil { return err } stat.Dev = Mkdev(r.Dev_major, r.Dev_minor) stat.Ino = r.Ino stat.Mode = uint32(r.Mode) stat.Nlink = r.Nlink stat.Uid = r.Uid stat.Gid = r.Gid stat.Rdev = Mkdev(r.Rdev_major, r.Rdev_minor) // hope we don't get to process files so large to overflow these size // fields... stat.Size = int64(r.Size) stat.Blksize = int32(r.Blksize) stat.Blocks = int64(r.Blocks) stat.Atim = timespecFromStatxTimestamp(r.Atime) stat.Mtim = timespecFromStatxTimestamp(r.Mtime) stat.Ctim = timespecFromStatxTimestamp(r.Ctime) return nil } func Fstat(fd int, stat *Stat_t) (err error) { return Fstatat(fd, "", stat, AT_EMPTY_PATH) } func Stat(path string, stat *Stat_t) (err error) { return Fstatat(AT_FDCWD, path, stat, 0) } func Lchown(path string, uid int, gid int) (err error) { return Fchownat(AT_FDCWD, path, uid, gid, AT_SYMLINK_NOFOLLOW) } func Lstat(path string, stat *Stat_t) (err error) { return Fstatat(AT_FDCWD, path, stat, AT_SYMLINK_NOFOLLOW) } //sys Statfs(path string, buf *Statfs_t) (err error) //sys SyncFileRange(fd int, off int64, n int64, flags int) (err error) //sys Truncate(path string, length int64) (err error) func Ustat(dev int, ubuf *Ustat_t) (err error) { return ENOSYS } //sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) //sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) //sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) //sysnb getgroups(n int, list *_Gid_t) (nn int, err error) //sysnb setgroups(n int, list *_Gid_t) (err error) //sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) //sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) //sysnb socket(domain int, typ int, proto int) (fd int, err error) //sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) //sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) //sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) //sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) //sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) //sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error) //sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error) //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) //sysnb Gettimeofday(tv *Timeval) (err error) func setTimespec(sec, nsec int64) Timespec { return Timespec{Sec: sec, Nsec: nsec} } func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: sec, Usec: usec} } func Getrlimit(resource int, rlim *Rlimit) (err error) { err = Prlimit(0, resource, nil, rlim) return } func futimesat(dirfd int, path string, tv *[2]Timeval) (err error) { if tv == nil { return utimensat(dirfd, path, nil, 0) } ts := []Timespec{ NsecToTimespec(TimevalToNsec(tv[0])), NsecToTimespec(TimevalToNsec(tv[1])), } return utimensat(dirfd, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0) } func Time(t *Time_t) (Time_t, error) { var tv Timeval err := Gettimeofday(&tv) if err != nil { return 0, err } if t != nil { *t = Time_t(tv.Sec) } return Time_t(tv.Sec), nil } func Utime(path string, buf *Utimbuf) error { tv := []Timeval{ {Sec: buf.Actime}, {Sec: buf.Modtime}, } return Utimes(path, tv) } func utimes(path string, tv *[2]Timeval) (err error) { if tv == nil { return utimensat(AT_FDCWD, path, nil, 0) } ts := []Timespec{ NsecToTimespec(TimevalToNsec(tv[0])), NsecToTimespec(TimevalToNsec(tv[1])), } return utimensat(AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0) } func (r *PtraceRegs) PC() uint64 { return r.Era } func (r *PtraceRegs) SetPC(era uint64) { r.Era = era } func (iov *Iovec) SetLen(length int) { iov.Len = uint64(length) } func (msghdr *Msghdr) SetControllen(length int) { msghdr.Controllen = uint64(length) } func (msghdr *Msghdr) SetIovlen(length int) { msghdr.Iovlen = uint64(length) } func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint64(length) } func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) { rsa.Service_name_len = uint64(length) } func Pause() error { _, err := ppoll(nil, 0, nil, nil) return err } func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) { return Renameat2(olddirfd, oldpath, newdirfd, newpath, 0) } //sys kexecFileLoad(kernelFd int, initrdFd int, cmdlineLen int, cmdline string, flags int) (err error) func KexecFileLoad(kernelFd int, initrdFd int, cmdline string, flags int) error { cmdlineLen := len(cmdline) if cmdlineLen > 0 { // Account for the additional NULL byte added by // BytePtrFromString in kexecFileLoad. The kexec_file_load // syscall expects a NULL-terminated string. cmdlineLen++ } return kexecFileLoad(kernelFd, initrdFd, cmdlineLen, cmdline, flags) } const SYS_FSTATAT = SYS_NEWFSTATAT ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go ================================================ // Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build linux && (mips64 || mips64le) package unix //sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64 //sys Fchown(fd int, uid int, gid int) (err error) //sys Fstatfs(fd int, buf *Statfs_t) (err error) //sys Ftruncate(fd int, length int64) (err error) //sysnb Getegid() (egid int) //sysnb Geteuid() (euid int) //sysnb Getgid() (gid int) //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) //sysnb Getuid() (uid int) //sys Lchown(path string, uid int, gid int) (err error) //sys Listen(s int, n int) (err error) //sys Pause() (err error) //sys pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 //sys pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 //sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) //sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { var ts *Timespec if timeout != nil { ts = &Timespec{Sec: timeout.Sec, Nsec: timeout.Usec * 1000} } return pselect6(nfd, r, w, e, ts, nil) } //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) //sys setfsgid(gid int) (prev int, err error) //sys setfsuid(uid int) (prev int, err error) //sys Shutdown(fd int, how int) (err error) //sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) //sys Statfs(path string, buf *Statfs_t) (err error) //sys SyncFileRange(fd int, off int64, n int64, flags int) (err error) //sys Truncate(path string, length int64) (err error) //sys Ustat(dev int, ubuf *Ustat_t) (err error) //sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) //sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) //sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) //sysnb getgroups(n int, list *_Gid_t) (nn int, err error) //sysnb setgroups(n int, list *_Gid_t) (err error) //sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) //sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) //sysnb socket(domain int, typ int, proto int) (fd int, err error) //sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) //sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) //sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) //sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) //sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) //sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error) //sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error) //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) //sys futimesat(dirfd int, path string, times *[2]Timeval) (err error) //sysnb Gettimeofday(tv *Timeval) (err error) func Time(t *Time_t) (tt Time_t, err error) { var tv Timeval err = Gettimeofday(&tv) if err != nil { return 0, err } if t != nil { *t = Time_t(tv.Sec) } return Time_t(tv.Sec), nil } //sys Utime(path string, buf *Utimbuf) (err error) //sys utimes(path string, times *[2]Timeval) (err error) func setTimespec(sec, nsec int64) Timespec { return Timespec{Sec: sec, Nsec: nsec} } func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: sec, Usec: usec} } func Ioperm(from int, num int, on int) (err error) { return ENOSYS } func Iopl(level int) (err error) { return ENOSYS } type stat_t struct { Dev uint32 Pad0 [3]int32 Ino uint64 Mode uint32 Nlink uint32 Uid uint32 Gid uint32 Rdev uint32 Pad1 [3]uint32 Size int64 Atime uint32 Atime_nsec uint32 Mtime uint32 Mtime_nsec uint32 Ctime uint32 Ctime_nsec uint32 Blksize uint32 Pad2 uint32 Blocks int64 } //sys fstat(fd int, st *stat_t) (err error) //sys fstatat(dirfd int, path string, st *stat_t, flags int) (err error) = SYS_NEWFSTATAT //sys lstat(path string, st *stat_t) (err error) //sys stat(path string, st *stat_t) (err error) func Fstat(fd int, s *Stat_t) (err error) { st := &stat_t{} err = fstat(fd, st) fillStat_t(s, st) return } func Fstatat(dirfd int, path string, s *Stat_t, flags int) (err error) { st := &stat_t{} err = fstatat(dirfd, path, st, flags) fillStat_t(s, st) return } func Lstat(path string, s *Stat_t) (err error) { st := &stat_t{} err = lstat(path, st) fillStat_t(s, st) return } func Stat(path string, s *Stat_t) (err error) { st := &stat_t{} err = stat(path, st) fillStat_t(s, st) return } func fillStat_t(s *Stat_t, st *stat_t) { s.Dev = st.Dev s.Ino = st.Ino s.Mode = st.Mode s.Nlink = st.Nlink s.Uid = st.Uid s.Gid = st.Gid s.Rdev = st.Rdev s.Size = st.Size s.Atim = Timespec{int64(st.Atime), int64(st.Atime_nsec)} s.Mtim = Timespec{int64(st.Mtime), int64(st.Mtime_nsec)} s.Ctim = Timespec{int64(st.Ctime), int64(st.Ctime_nsec)} s.Blksize = st.Blksize s.Blocks = st.Blocks } func (r *PtraceRegs) PC() uint64 { return r.Epc } func (r *PtraceRegs) SetPC(pc uint64) { r.Epc = pc } func (iov *Iovec) SetLen(length int) { iov.Len = uint64(length) } func (msghdr *Msghdr) SetControllen(length int) { msghdr.Controllen = uint64(length) } func (msghdr *Msghdr) SetIovlen(length int) { msghdr.Iovlen = uint64(length) } func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint64(length) } func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) { rsa.Service_name_len = uint64(length) } ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go ================================================ // Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build linux && (mips || mipsle) package unix import ( "syscall" "unsafe" ) func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) //sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64 //sys Fchown(fd int, uid int, gid int) (err error) //sys Ftruncate(fd int, length int64) (err error) = SYS_FTRUNCATE64 //sysnb Getegid() (egid int) //sysnb Geteuid() (euid int) //sysnb Getgid() (gid int) //sysnb Getuid() (uid int) //sys Lchown(path string, uid int, gid int) (err error) //sys Listen(s int, n int) (err error) //sys pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 //sys pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 //sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS__NEWSELECT //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) = SYS_SENDFILE64 //sys setfsgid(gid int) (prev int, err error) //sys setfsuid(uid int) (prev int, err error) //sys Shutdown(fd int, how int) (err error) //sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) //sys SyncFileRange(fd int, off int64, n int64, flags int) (err error) //sys Truncate(path string, length int64) (err error) = SYS_TRUNCATE64 //sys Ustat(dev int, ubuf *Ustat_t) (err error) //sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) //sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) //sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) //sysnb getgroups(n int, list *_Gid_t) (nn int, err error) //sysnb setgroups(n int, list *_Gid_t) (err error) //sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) //sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) //sysnb socket(domain int, typ int, proto int) (fd int, err error) //sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) //sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) //sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) //sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) //sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) //sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error) //sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error) //sys Ioperm(from int, num int, on int) (err error) //sys Iopl(level int) (err error) //sys futimesat(dirfd int, path string, times *[2]Timeval) (err error) //sysnb Gettimeofday(tv *Timeval) (err error) //sysnb Time(t *Time_t) (tt Time_t, err error) //sys Utime(path string, buf *Utimbuf) (err error) //sys utimes(path string, times *[2]Timeval) (err error) //sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64 //sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64 //sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64 //sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64 //sys Pause() (err error) func Fstatfs(fd int, buf *Statfs_t) (err error) { _, _, e := Syscall(SYS_FSTATFS64, uintptr(fd), unsafe.Sizeof(*buf), uintptr(unsafe.Pointer(buf))) if e != 0 { err = errnoErr(e) } return } func Statfs(path string, buf *Statfs_t) (err error) { p, err := BytePtrFromString(path) if err != nil { return err } _, _, e := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(p)), unsafe.Sizeof(*buf), uintptr(unsafe.Pointer(buf))) if e != 0 { err = errnoErr(e) } return } func Seek(fd int, offset int64, whence int) (off int64, err error) { _, _, e := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offset>>32), uintptr(offset), uintptr(unsafe.Pointer(&off)), uintptr(whence), 0) if e != 0 { err = errnoErr(e) } return } func setTimespec(sec, nsec int64) Timespec { return Timespec{Sec: int32(sec), Nsec: int32(nsec)} } func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: int32(sec), Usec: int32(usec)} } //sys mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, err error) func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) { page := uintptr(offset / 4096) if offset != int64(page)*4096 { return 0, EINVAL } return mmap2(addr, length, prot, flags, fd, page) } const rlimInf32 = ^uint32(0) const rlimInf64 = ^uint64(0) type rlimit32 struct { Cur uint32 Max uint32 } //sysnb getrlimit(resource int, rlim *rlimit32) (err error) = SYS_GETRLIMIT func Getrlimit(resource int, rlim *Rlimit) (err error) { err = Prlimit(0, resource, nil, rlim) if err != ENOSYS { return err } rl := rlimit32{} err = getrlimit(resource, &rl) if err != nil { return } if rl.Cur == rlimInf32 { rlim.Cur = rlimInf64 } else { rlim.Cur = uint64(rl.Cur) } if rl.Max == rlimInf32 { rlim.Max = rlimInf64 } else { rlim.Max = uint64(rl.Max) } return } func (r *PtraceRegs) PC() uint64 { return r.Epc } func (r *PtraceRegs) SetPC(pc uint64) { r.Epc = pc } func (iov *Iovec) SetLen(length int) { iov.Len = uint32(length) } func (msghdr *Msghdr) SetControllen(length int) { msghdr.Controllen = uint32(length) } func (msghdr *Msghdr) SetIovlen(length int) { msghdr.Iovlen = uint32(length) } func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint32(length) } func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) { rsa.Service_name_len = uint32(length) } ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_linux_ppc.go ================================================ // Copyright 2021 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build linux && ppc package unix import ( "syscall" "unsafe" ) //sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) //sys Fchown(fd int, uid int, gid int) (err error) //sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64 //sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64 //sys Ftruncate(fd int, length int64) (err error) = SYS_FTRUNCATE64 //sysnb Getegid() (egid int) //sysnb Geteuid() (euid int) //sysnb Getgid() (gid int) //sysnb Getuid() (uid int) //sys Ioperm(from int, num int, on int) (err error) //sys Iopl(level int) (err error) //sys Lchown(path string, uid int, gid int) (err error) //sys Listen(s int, n int) (err error) //sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64 //sys Pause() (err error) //sys pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 //sys pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 //sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS__NEWSELECT //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) = SYS_SENDFILE64 //sys setfsgid(gid int) (prev int, err error) //sys setfsuid(uid int) (prev int, err error) //sys Shutdown(fd int, how int) (err error) //sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) //sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64 //sys Truncate(path string, length int64) (err error) = SYS_TRUNCATE64 //sys Ustat(dev int, ubuf *Ustat_t) (err error) //sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) //sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) //sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) //sysnb getgroups(n int, list *_Gid_t) (nn int, err error) //sysnb setgroups(n int, list *_Gid_t) (err error) //sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) //sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) //sysnb socket(domain int, typ int, proto int) (fd int, err error) //sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) //sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) //sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) //sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) //sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) //sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error) //sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error) //sys futimesat(dirfd int, path string, times *[2]Timeval) (err error) //sysnb Gettimeofday(tv *Timeval) (err error) //sysnb Time(t *Time_t) (tt Time_t, err error) //sys Utime(path string, buf *Utimbuf) (err error) //sys utimes(path string, times *[2]Timeval) (err error) func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall6(SYS_FADVISE64_64, uintptr(fd), uintptr(advice), uintptr(offset>>32), uintptr(offset), uintptr(length>>32), uintptr(length)) if e1 != 0 { err = errnoErr(e1) } return } func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { var newoffset int64 offsetLow := uint32(offset & 0xffffffff) offsetHigh := uint32((offset >> 32) & 0xffffffff) _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) return newoffset, err } func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { newoffset, errno := seek(fd, offset, whence) if errno != 0 { return 0, errno } return newoffset, nil } func Fstatfs(fd int, buf *Statfs_t) (err error) { _, _, e := Syscall(SYS_FSTATFS64, uintptr(fd), unsafe.Sizeof(*buf), uintptr(unsafe.Pointer(buf))) if e != 0 { err = e } return } func Statfs(path string, buf *Statfs_t) (err error) { pathp, err := BytePtrFromString(path) if err != nil { return err } _, _, e := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(pathp)), unsafe.Sizeof(*buf), uintptr(unsafe.Pointer(buf))) if e != 0 { err = e } return } //sys mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, err error) func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) { page := uintptr(offset / 4096) if offset != int64(page)*4096 { return 0, EINVAL } return mmap2(addr, length, prot, flags, fd, page) } func setTimespec(sec, nsec int64) Timespec { return Timespec{Sec: int32(sec), Nsec: int32(nsec)} } func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: int32(sec), Usec: int32(usec)} } type rlimit32 struct { Cur uint32 Max uint32 } //sysnb getrlimit(resource int, rlim *rlimit32) (err error) = SYS_UGETRLIMIT const rlimInf32 = ^uint32(0) const rlimInf64 = ^uint64(0) func Getrlimit(resource int, rlim *Rlimit) (err error) { err = Prlimit(0, resource, nil, rlim) if err != ENOSYS { return err } rl := rlimit32{} err = getrlimit(resource, &rl) if err != nil { return } if rl.Cur == rlimInf32 { rlim.Cur = rlimInf64 } else { rlim.Cur = uint64(rl.Cur) } if rl.Max == rlimInf32 { rlim.Max = rlimInf64 } else { rlim.Max = uint64(rl.Max) } return } func (r *PtraceRegs) PC() uint32 { return r.Nip } func (r *PtraceRegs) SetPC(pc uint32) { r.Nip = pc } func (iov *Iovec) SetLen(length int) { iov.Len = uint32(length) } func (msghdr *Msghdr) SetControllen(length int) { msghdr.Controllen = uint32(length) } func (msghdr *Msghdr) SetIovlen(length int) { msghdr.Iovlen = uint32(length) } func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint32(length) } func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) { rsa.Service_name_len = uint32(length) } //sys syncFileRange2(fd int, flags int, off int64, n int64) (err error) = SYS_SYNC_FILE_RANGE2 func SyncFileRange(fd int, off int64, n int64, flags int) error { // The sync_file_range and sync_file_range2 syscalls differ only in the // order of their arguments. return syncFileRange2(fd, flags, off, n) } //sys kexecFileLoad(kernelFd int, initrdFd int, cmdlineLen int, cmdline string, flags int) (err error) func KexecFileLoad(kernelFd int, initrdFd int, cmdline string, flags int) error { cmdlineLen := len(cmdline) if cmdlineLen > 0 { // Account for the additional NULL byte added by // BytePtrFromString in kexecFileLoad. The kexec_file_load // syscall expects a NULL-terminated string. cmdlineLen++ } return kexecFileLoad(kernelFd, initrdFd, cmdlineLen, cmdline, flags) } ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go ================================================ // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build linux && (ppc64 || ppc64le) package unix //sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64 //sys Fchown(fd int, uid int, gid int) (err error) //sys Fstat(fd int, stat *Stat_t) (err error) //sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_NEWFSTATAT //sys Fstatfs(fd int, buf *Statfs_t) (err error) //sys Ftruncate(fd int, length int64) (err error) //sysnb Getegid() (egid int) //sysnb Geteuid() (euid int) //sysnb Getgid() (gid int) //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) = SYS_UGETRLIMIT //sysnb Getuid() (uid int) //sys Ioperm(from int, num int, on int) (err error) //sys Iopl(level int) (err error) //sys Lchown(path string, uid int, gid int) (err error) //sys Listen(s int, n int) (err error) //sys Lstat(path string, stat *Stat_t) (err error) //sys Pause() (err error) //sys pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 //sys pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 //sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) //sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS__NEWSELECT //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) //sys setfsgid(gid int) (prev int, err error) //sys setfsuid(uid int) (prev int, err error) //sys Shutdown(fd int, how int) (err error) //sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) //sys Stat(path string, stat *Stat_t) (err error) //sys Statfs(path string, buf *Statfs_t) (err error) //sys Truncate(path string, length int64) (err error) //sys Ustat(dev int, ubuf *Ustat_t) (err error) //sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) //sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) //sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) //sysnb getgroups(n int, list *_Gid_t) (nn int, err error) //sysnb setgroups(n int, list *_Gid_t) (err error) //sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) //sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) //sysnb socket(domain int, typ int, proto int) (fd int, err error) //sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) //sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) //sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) //sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) //sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) //sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error) //sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error) //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) //sys futimesat(dirfd int, path string, times *[2]Timeval) (err error) //sysnb Gettimeofday(tv *Timeval) (err error) //sysnb Time(t *Time_t) (tt Time_t, err error) //sys Utime(path string, buf *Utimbuf) (err error) //sys utimes(path string, times *[2]Timeval) (err error) func setTimespec(sec, nsec int64) Timespec { return Timespec{Sec: sec, Nsec: nsec} } func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: sec, Usec: usec} } func (r *PtraceRegs) PC() uint64 { return r.Nip } func (r *PtraceRegs) SetPC(pc uint64) { r.Nip = pc } func (iov *Iovec) SetLen(length int) { iov.Len = uint64(length) } func (msghdr *Msghdr) SetControllen(length int) { msghdr.Controllen = uint64(length) } func (msghdr *Msghdr) SetIovlen(length int) { msghdr.Iovlen = uint64(length) } func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint64(length) } func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) { rsa.Service_name_len = uint64(length) } //sys syncFileRange2(fd int, flags int, off int64, n int64) (err error) = SYS_SYNC_FILE_RANGE2 func SyncFileRange(fd int, off int64, n int64, flags int) error { // The sync_file_range and sync_file_range2 syscalls differ only in the // order of their arguments. return syncFileRange2(fd, flags, off, n) } //sys kexecFileLoad(kernelFd int, initrdFd int, cmdlineLen int, cmdline string, flags int) (err error) func KexecFileLoad(kernelFd int, initrdFd int, cmdline string, flags int) error { cmdlineLen := len(cmdline) if cmdlineLen > 0 { // Account for the additional NULL byte added by // BytePtrFromString in kexecFileLoad. The kexec_file_load // syscall expects a NULL-terminated string. cmdlineLen++ } return kexecFileLoad(kernelFd, initrdFd, cmdlineLen, cmdline, flags) } ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build riscv64 && linux package unix import "unsafe" //sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) = SYS_EPOLL_PWAIT //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64 //sys Fchown(fd int, uid int, gid int) (err error) //sys Fstat(fd int, stat *Stat_t) (err error) //sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) //sys Fstatfs(fd int, buf *Statfs_t) (err error) //sys Ftruncate(fd int, length int64) (err error) //sysnb Getegid() (egid int) //sysnb Geteuid() (euid int) //sysnb Getgid() (gid int) //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) //sysnb Getuid() (uid int) //sys Listen(s int, n int) (err error) //sys MemfdSecret(flags int) (fd int, err error) //sys pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 //sys pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 //sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { var ts *Timespec if timeout != nil { ts = &Timespec{Sec: timeout.Sec, Nsec: timeout.Usec * 1000} } return pselect6(nfd, r, w, e, ts, nil) } //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) //sys setfsgid(gid int) (prev int, err error) //sys setfsuid(uid int) (prev int, err error) //sys Shutdown(fd int, how int) (err error) //sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) func Stat(path string, stat *Stat_t) (err error) { return Fstatat(AT_FDCWD, path, stat, 0) } func Lchown(path string, uid int, gid int) (err error) { return Fchownat(AT_FDCWD, path, uid, gid, AT_SYMLINK_NOFOLLOW) } func Lstat(path string, stat *Stat_t) (err error) { return Fstatat(AT_FDCWD, path, stat, AT_SYMLINK_NOFOLLOW) } //sys Statfs(path string, buf *Statfs_t) (err error) //sys SyncFileRange(fd int, off int64, n int64, flags int) (err error) //sys Truncate(path string, length int64) (err error) func Ustat(dev int, ubuf *Ustat_t) (err error) { return ENOSYS } //sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) //sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) //sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) //sysnb getgroups(n int, list *_Gid_t) (nn int, err error) //sysnb setgroups(n int, list *_Gid_t) (err error) //sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) //sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) //sysnb socket(domain int, typ int, proto int) (fd int, err error) //sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) //sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) //sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) //sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) //sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) //sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error) //sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error) //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) //sysnb Gettimeofday(tv *Timeval) (err error) func setTimespec(sec, nsec int64) Timespec { return Timespec{Sec: sec, Nsec: nsec} } func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: sec, Usec: usec} } func futimesat(dirfd int, path string, tv *[2]Timeval) (err error) { if tv == nil { return utimensat(dirfd, path, nil, 0) } ts := []Timespec{ NsecToTimespec(TimevalToNsec(tv[0])), NsecToTimespec(TimevalToNsec(tv[1])), } return utimensat(dirfd, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0) } func Time(t *Time_t) (Time_t, error) { var tv Timeval err := Gettimeofday(&tv) if err != nil { return 0, err } if t != nil { *t = Time_t(tv.Sec) } return Time_t(tv.Sec), nil } func Utime(path string, buf *Utimbuf) error { tv := []Timeval{ {Sec: buf.Actime}, {Sec: buf.Modtime}, } return Utimes(path, tv) } func utimes(path string, tv *[2]Timeval) (err error) { if tv == nil { return utimensat(AT_FDCWD, path, nil, 0) } ts := []Timespec{ NsecToTimespec(TimevalToNsec(tv[0])), NsecToTimespec(TimevalToNsec(tv[1])), } return utimensat(AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0) } func (r *PtraceRegs) PC() uint64 { return r.Pc } func (r *PtraceRegs) SetPC(pc uint64) { r.Pc = pc } func (iov *Iovec) SetLen(length int) { iov.Len = uint64(length) } func (msghdr *Msghdr) SetControllen(length int) { msghdr.Controllen = uint64(length) } func (msghdr *Msghdr) SetIovlen(length int) { msghdr.Iovlen = uint64(length) } func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint64(length) } func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) { rsa.Service_name_len = uint64(length) } func Pause() error { _, err := ppoll(nil, 0, nil, nil) return err } func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) { return Renameat2(olddirfd, oldpath, newdirfd, newpath, 0) } //sys kexecFileLoad(kernelFd int, initrdFd int, cmdlineLen int, cmdline string, flags int) (err error) func KexecFileLoad(kernelFd int, initrdFd int, cmdline string, flags int) error { cmdlineLen := len(cmdline) if cmdlineLen > 0 { // Account for the additional NULL byte added by // BytePtrFromString in kexecFileLoad. The kexec_file_load // syscall expects a NULL-terminated string. cmdlineLen++ } return kexecFileLoad(kernelFd, initrdFd, cmdlineLen, cmdline, flags) } //sys riscvHWProbe(pairs []RISCVHWProbePairs, cpuCount uintptr, cpus *CPUSet, flags uint) (err error) func RISCVHWProbe(pairs []RISCVHWProbePairs, set *CPUSet, flags uint) (err error) { var setSize uintptr if set != nil { setSize = uintptr(unsafe.Sizeof(*set)) } return riscvHWProbe(pairs, setSize, set, flags) } const SYS_FSTATAT = SYS_NEWFSTATAT ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_linux_s390x.go ================================================ // Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build s390x && linux package unix import ( "unsafe" ) //sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64 //sys Fchown(fd int, uid int, gid int) (err error) //sys Fstat(fd int, stat *Stat_t) (err error) //sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_NEWFSTATAT //sys Fstatfs(fd int, buf *Statfs_t) (err error) //sys Ftruncate(fd int, length int64) (err error) //sysnb Getegid() (egid int) //sysnb Geteuid() (euid int) //sysnb Getgid() (gid int) //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) //sysnb Getuid() (uid int) //sys Lchown(path string, uid int, gid int) (err error) //sys Lstat(path string, stat *Stat_t) (err error) //sys Pause() (err error) //sys pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 //sys pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 //sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) //sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) //sys setfsgid(gid int) (prev int, err error) //sys setfsuid(uid int) (prev int, err error) //sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) //sys Stat(path string, stat *Stat_t) (err error) //sys Statfs(path string, buf *Statfs_t) (err error) //sys SyncFileRange(fd int, off int64, n int64, flags int) (err error) //sys Truncate(path string, length int64) (err error) //sys Ustat(dev int, ubuf *Ustat_t) (err error) //sysnb getgroups(n int, list *_Gid_t) (nn int, err error) //sysnb setgroups(n int, list *_Gid_t) (err error) //sys futimesat(dirfd int, path string, times *[2]Timeval) (err error) //sysnb Gettimeofday(tv *Timeval) (err error) func Time(t *Time_t) (tt Time_t, err error) { var tv Timeval err = Gettimeofday(&tv) if err != nil { return 0, err } if t != nil { *t = Time_t(tv.Sec) } return Time_t(tv.Sec), nil } //sys Utime(path string, buf *Utimbuf) (err error) //sys utimes(path string, times *[2]Timeval) (err error) func setTimespec(sec, nsec int64) Timespec { return Timespec{Sec: sec, Nsec: nsec} } func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: sec, Usec: usec} } func Ioperm(from int, num int, on int) (err error) { return ENOSYS } func Iopl(level int) (err error) { return ENOSYS } func (r *PtraceRegs) PC() uint64 { return r.Psw.Addr } func (r *PtraceRegs) SetPC(pc uint64) { r.Psw.Addr = pc } func (iov *Iovec) SetLen(length int) { iov.Len = uint64(length) } func (msghdr *Msghdr) SetControllen(length int) { msghdr.Controllen = uint64(length) } func (msghdr *Msghdr) SetIovlen(length int) { msghdr.Iovlen = uint64(length) } func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint64(length) } func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) { rsa.Service_name_len = uint64(length) } // Linux on s390x uses the old mmap interface, which requires arguments to be passed in a struct. // mmap2 also requires arguments to be passed in a struct; it is currently not exposed in . func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) { mmap_args := [6]uintptr{addr, length, uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset)} r0, _, e1 := Syscall(SYS_MMAP, uintptr(unsafe.Pointer(&mmap_args[0])), 0, 0) xaddr = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } // On s390x Linux, all the socket calls go through an extra indirection. // The arguments to the underlying system call (SYS_SOCKETCALL) are the // number below and a pointer to an array of uintptr. const ( // see linux/net.h netSocket = 1 netBind = 2 netConnect = 3 netListen = 4 netAccept = 5 netGetSockName = 6 netGetPeerName = 7 netSocketPair = 8 netSend = 9 netRecv = 10 netSendTo = 11 netRecvFrom = 12 netShutdown = 13 netSetSockOpt = 14 netGetSockOpt = 15 netSendMsg = 16 netRecvMsg = 17 netAccept4 = 18 netRecvMMsg = 19 netSendMMsg = 20 ) func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (int, error) { args := [4]uintptr{uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags)} fd, _, err := Syscall(SYS_SOCKETCALL, netAccept4, uintptr(unsafe.Pointer(&args)), 0) if err != 0 { return 0, err } return int(fd), nil } func getsockname(s int, rsa *RawSockaddrAny, addrlen *_Socklen) error { args := [3]uintptr{uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))} _, _, err := RawSyscall(SYS_SOCKETCALL, netGetSockName, uintptr(unsafe.Pointer(&args)), 0) if err != 0 { return err } return nil } func getpeername(s int, rsa *RawSockaddrAny, addrlen *_Socklen) error { args := [3]uintptr{uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))} _, _, err := RawSyscall(SYS_SOCKETCALL, netGetPeerName, uintptr(unsafe.Pointer(&args)), 0) if err != 0 { return err } return nil } func socketpair(domain int, typ int, flags int, fd *[2]int32) error { args := [4]uintptr{uintptr(domain), uintptr(typ), uintptr(flags), uintptr(unsafe.Pointer(fd))} _, _, err := RawSyscall(SYS_SOCKETCALL, netSocketPair, uintptr(unsafe.Pointer(&args)), 0) if err != 0 { return err } return nil } func bind(s int, addr unsafe.Pointer, addrlen _Socklen) error { args := [3]uintptr{uintptr(s), uintptr(addr), uintptr(addrlen)} _, _, err := Syscall(SYS_SOCKETCALL, netBind, uintptr(unsafe.Pointer(&args)), 0) if err != 0 { return err } return nil } func connect(s int, addr unsafe.Pointer, addrlen _Socklen) error { args := [3]uintptr{uintptr(s), uintptr(addr), uintptr(addrlen)} _, _, err := Syscall(SYS_SOCKETCALL, netConnect, uintptr(unsafe.Pointer(&args)), 0) if err != 0 { return err } return nil } func socket(domain int, typ int, proto int) (int, error) { args := [3]uintptr{uintptr(domain), uintptr(typ), uintptr(proto)} fd, _, err := RawSyscall(SYS_SOCKETCALL, netSocket, uintptr(unsafe.Pointer(&args)), 0) if err != 0 { return 0, err } return int(fd), nil } func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) error { args := [5]uintptr{uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen))} _, _, err := Syscall(SYS_SOCKETCALL, netGetSockOpt, uintptr(unsafe.Pointer(&args)), 0) if err != 0 { return err } return nil } func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) error { args := [5]uintptr{uintptr(s), uintptr(level), uintptr(name), uintptr(val), vallen} _, _, err := Syscall(SYS_SOCKETCALL, netSetSockOpt, uintptr(unsafe.Pointer(&args)), 0) if err != 0 { return err } return nil } func recvfrom(s int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (int, error) { var base uintptr if len(p) > 0 { base = uintptr(unsafe.Pointer(&p[0])) } args := [6]uintptr{uintptr(s), base, uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))} n, _, err := Syscall(SYS_SOCKETCALL, netRecvFrom, uintptr(unsafe.Pointer(&args)), 0) if err != 0 { return 0, err } return int(n), nil } func sendto(s int, p []byte, flags int, to unsafe.Pointer, addrlen _Socklen) error { var base uintptr if len(p) > 0 { base = uintptr(unsafe.Pointer(&p[0])) } args := [6]uintptr{uintptr(s), base, uintptr(len(p)), uintptr(flags), uintptr(to), uintptr(addrlen)} _, _, err := Syscall(SYS_SOCKETCALL, netSendTo, uintptr(unsafe.Pointer(&args)), 0) if err != 0 { return err } return nil } func recvmsg(s int, msg *Msghdr, flags int) (int, error) { args := [3]uintptr{uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)} n, _, err := Syscall(SYS_SOCKETCALL, netRecvMsg, uintptr(unsafe.Pointer(&args)), 0) if err != 0 { return 0, err } return int(n), nil } func sendmsg(s int, msg *Msghdr, flags int) (int, error) { args := [3]uintptr{uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)} n, _, err := Syscall(SYS_SOCKETCALL, netSendMsg, uintptr(unsafe.Pointer(&args)), 0) if err != 0 { return 0, err } return int(n), nil } func Listen(s int, n int) error { args := [2]uintptr{uintptr(s), uintptr(n)} _, _, err := Syscall(SYS_SOCKETCALL, netListen, uintptr(unsafe.Pointer(&args)), 0) if err != 0 { return err } return nil } func Shutdown(s, how int) error { args := [2]uintptr{uintptr(s), uintptr(how)} _, _, err := Syscall(SYS_SOCKETCALL, netShutdown, uintptr(unsafe.Pointer(&args)), 0) if err != 0 { return err } return nil } //sys kexecFileLoad(kernelFd int, initrdFd int, cmdlineLen int, cmdline string, flags int) (err error) func KexecFileLoad(kernelFd int, initrdFd int, cmdline string, flags int) error { cmdlineLen := len(cmdline) if cmdlineLen > 0 { // Account for the additional NULL byte added by // BytePtrFromString in kexecFileLoad. The kexec_file_load // syscall expects a NULL-terminated string. cmdlineLen++ } return kexecFileLoad(kernelFd, initrdFd, cmdlineLen, cmdline, flags) } ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go ================================================ // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build sparc64 && linux package unix //sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64 //sys Fchown(fd int, uid int, gid int) (err error) //sys Fstat(fd int, stat *Stat_t) (err error) //sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64 //sys Fstatfs(fd int, buf *Statfs_t) (err error) //sys Ftruncate(fd int, length int64) (err error) //sysnb Getegid() (egid int) //sysnb Geteuid() (euid int) //sysnb Getgid() (gid int) //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) //sysnb Getuid() (uid int) //sys Lchown(path string, uid int, gid int) (err error) //sys Listen(s int, n int) (err error) //sys Lstat(path string, stat *Stat_t) (err error) //sys Pause() (err error) //sys pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 //sys pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 //sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) //sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) //sys setfsgid(gid int) (prev int, err error) //sys setfsuid(uid int) (prev int, err error) //sys Shutdown(fd int, how int) (err error) //sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) //sys Stat(path string, stat *Stat_t) (err error) //sys Statfs(path string, buf *Statfs_t) (err error) //sys SyncFileRange(fd int, off int64, n int64, flags int) (err error) //sys Truncate(path string, length int64) (err error) //sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) //sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) //sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) //sysnb getgroups(n int, list *_Gid_t) (nn int, err error) //sysnb setgroups(n int, list *_Gid_t) (err error) //sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) //sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) //sysnb socket(domain int, typ int, proto int) (fd int, err error) //sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) //sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) //sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) //sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) //sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) //sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error) //sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error) //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) func Ioperm(from int, num int, on int) (err error) { return ENOSYS } func Iopl(level int) (err error) { return ENOSYS } //sys futimesat(dirfd int, path string, times *[2]Timeval) (err error) //sysnb Gettimeofday(tv *Timeval) (err error) func Time(t *Time_t) (tt Time_t, err error) { var tv Timeval err = Gettimeofday(&tv) if err != nil { return 0, err } if t != nil { *t = Time_t(tv.Sec) } return Time_t(tv.Sec), nil } //sys Utime(path string, buf *Utimbuf) (err error) //sys utimes(path string, times *[2]Timeval) (err error) func setTimespec(sec, nsec int64) Timespec { return Timespec{Sec: sec, Nsec: nsec} } func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: sec, Usec: int32(usec)} } func (r *PtraceRegs) PC() uint64 { return r.Tpc } func (r *PtraceRegs) SetPC(pc uint64) { r.Tpc = pc } func (iov *Iovec) SetLen(length int) { iov.Len = uint64(length) } func (msghdr *Msghdr) SetControllen(length int) { msghdr.Controllen = uint64(length) } func (msghdr *Msghdr) SetIovlen(length int) { msghdr.Iovlen = uint64(length) } func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint64(length) } func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) { rsa.Service_name_len = uint64(length) } ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_netbsd.go ================================================ // Copyright 2009,2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // NetBSD system calls. // This file is compiled as ordinary Go code, // but it is also input to mksyscall, // which parses the //sys lines and generates system call stubs. // Note that sometimes we use a lowercase //sys name and wrap // it in our own nicer implementation, either here or in // syscall_bsd.go or syscall_unix.go. package unix import ( "syscall" "unsafe" ) // SockaddrDatalink implements the Sockaddr interface for AF_LINK type sockets. type SockaddrDatalink struct { Len uint8 Family uint8 Index uint16 Type uint8 Nlen uint8 Alen uint8 Slen uint8 Data [12]int8 raw RawSockaddrDatalink } func anyToSockaddrGOOS(fd int, rsa *RawSockaddrAny) (Sockaddr, error) { return nil, EAFNOSUPPORT } func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) func sysctlNodes(mib []_C_int) (nodes []Sysctlnode, err error) { var olen uintptr // Get a list of all sysctl nodes below the given MIB by performing // a sysctl for the given MIB with CTL_QUERY appended. mib = append(mib, CTL_QUERY) qnode := Sysctlnode{Flags: SYSCTL_VERS_1} qp := (*byte)(unsafe.Pointer(&qnode)) sz := unsafe.Sizeof(qnode) if err = sysctl(mib, nil, &olen, qp, sz); err != nil { return nil, err } // Now that we know the size, get the actual nodes. nodes = make([]Sysctlnode, olen/sz) np := (*byte)(unsafe.Pointer(&nodes[0])) if err = sysctl(mib, np, &olen, qp, sz); err != nil { return nil, err } return nodes, nil } func nametomib(name string) (mib []_C_int, err error) { // Split name into components. var parts []string last := 0 for i := 0; i < len(name); i++ { if name[i] == '.' { parts = append(parts, name[last:i]) last = i + 1 } } parts = append(parts, name[last:]) // Discover the nodes and construct the MIB OID. for partno, part := range parts { nodes, err := sysctlNodes(mib) if err != nil { return nil, err } for _, node := range nodes { n := make([]byte, 0) for i := range node.Name { if node.Name[i] != 0 { n = append(n, byte(node.Name[i])) } } if string(n) == part { mib = append(mib, _C_int(node.Num)) break } } if len(mib) != partno+1 { return nil, EINVAL } } return mib, nil } func direntIno(buf []byte) (uint64, bool) { return readInt(buf, unsafe.Offsetof(Dirent{}.Fileno), unsafe.Sizeof(Dirent{}.Fileno)) } func direntReclen(buf []byte) (uint64, bool) { return readInt(buf, unsafe.Offsetof(Dirent{}.Reclen), unsafe.Sizeof(Dirent{}.Reclen)) } func direntNamlen(buf []byte) (uint64, bool) { return readInt(buf, unsafe.Offsetof(Dirent{}.Namlen), unsafe.Sizeof(Dirent{}.Namlen)) } func SysctlUvmexp(name string) (*Uvmexp, error) { mib, err := sysctlmib(name) if err != nil { return nil, err } n := uintptr(SizeofUvmexp) var u Uvmexp if err := sysctl(mib, (*byte)(unsafe.Pointer(&u)), &n, nil, 0); err != nil { return nil, err } return &u, nil } func Pipe(p []int) (err error) { return Pipe2(p, 0) } //sysnb pipe2(p *[2]_C_int, flags int) (err error) func Pipe2(p []int, flags int) error { if len(p) != 2 { return EINVAL } var pp [2]_C_int err := pipe2(&pp, flags) if err == nil { p[0] = int(pp[0]) p[1] = int(pp[1]) } return err } //sys Getdents(fd int, buf []byte) (n int, err error) func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { n, err = Getdents(fd, buf) if err != nil || basep == nil { return } var off int64 off, err = Seek(fd, 0, 1 /* SEEK_CUR */) if err != nil { *basep = ^uintptr(0) return } *basep = uintptr(off) if unsafe.Sizeof(*basep) == 8 { return } if off>>32 != 0 { // We can't stuff the offset back into a uintptr, so any // future calls would be suspect. Generate an error. // EIO is allowed by getdirentries. err = EIO } return } //sys Getcwd(buf []byte) (n int, err error) = SYS___GETCWD // TODO func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { return -1, ENOSYS } //sys ioctl(fd int, req uint, arg uintptr) (err error) //sys ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) = SYS_IOCTL //sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL func IoctlGetPtmget(fd int, req uint) (*Ptmget, error) { var value Ptmget err := ioctlPtr(fd, req, unsafe.Pointer(&value)) return &value, err } func Uname(uname *Utsname) error { mib := []_C_int{CTL_KERN, KERN_OSTYPE} n := unsafe.Sizeof(uname.Sysname) if err := sysctl(mib, &uname.Sysname[0], &n, nil, 0); err != nil { return err } mib = []_C_int{CTL_KERN, KERN_HOSTNAME} n = unsafe.Sizeof(uname.Nodename) if err := sysctl(mib, &uname.Nodename[0], &n, nil, 0); err != nil { return err } mib = []_C_int{CTL_KERN, KERN_OSRELEASE} n = unsafe.Sizeof(uname.Release) if err := sysctl(mib, &uname.Release[0], &n, nil, 0); err != nil { return err } mib = []_C_int{CTL_KERN, KERN_VERSION} n = unsafe.Sizeof(uname.Version) if err := sysctl(mib, &uname.Version[0], &n, nil, 0); err != nil { return err } // The version might have newlines or tabs in it, convert them to // spaces. for i, b := range uname.Version { if b == '\n' || b == '\t' { if i == len(uname.Version)-1 { uname.Version[i] = 0 } else { uname.Version[i] = ' ' } } } mib = []_C_int{CTL_HW, HW_MACHINE} n = unsafe.Sizeof(uname.Machine) if err := sysctl(mib, &uname.Machine[0], &n, nil, 0); err != nil { return err } return nil } func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { if raceenabled { raceReleaseMerge(unsafe.Pointer(&ioSync)) } return sendfile(outfd, infd, offset, count) } func Fstatvfs(fd int, buf *Statvfs_t) (err error) { return Fstatvfs1(fd, buf, ST_WAIT) } func Statvfs(path string, buf *Statvfs_t) (err error) { return Statvfs1(path, buf, ST_WAIT) } func Getvfsstat(buf []Statvfs_t, flags int) (n int, err error) { var ( _p0 unsafe.Pointer bufsize uintptr ) if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) bufsize = unsafe.Sizeof(Statvfs_t{}) * uintptr(len(buf)) } r0, _, e1 := Syscall(SYS_GETVFSSTAT, uintptr(_p0), bufsize, uintptr(flags)) n = int(r0) if e1 != 0 { err = e1 } return } /* * Exposed directly */ //sys Access(path string, mode uint32) (err error) //sys Adjtime(delta *Timeval, olddelta *Timeval) (err error) //sys Chdir(path string) (err error) //sys Chflags(path string, flags int) (err error) //sys Chmod(path string, mode uint32) (err error) //sys Chown(path string, uid int, gid int) (err error) //sys Chroot(path string) (err error) //sys ClockGettime(clockid int32, time *Timespec) (err error) //sys Close(fd int) (err error) //sys Dup(fd int) (nfd int, err error) //sys Dup2(from int, to int) (err error) //sys Dup3(from int, to int, flags int) (err error) //sys Exit(code int) //sys ExtattrGetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) //sys ExtattrSetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) //sys ExtattrDeleteFd(fd int, attrnamespace int, attrname string) (err error) //sys ExtattrListFd(fd int, attrnamespace int, data uintptr, nbytes int) (ret int, err error) //sys ExtattrGetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) //sys ExtattrSetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) //sys ExtattrDeleteFile(file string, attrnamespace int, attrname string) (err error) //sys ExtattrListFile(file string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) //sys ExtattrGetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) //sys ExtattrSetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) //sys ExtattrDeleteLink(link string, attrnamespace int, attrname string) (err error) //sys ExtattrListLink(link string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) //sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error) //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_POSIX_FADVISE //sys Fchdir(fd int) (err error) //sys Fchflags(fd int, flags int) (err error) //sys Fchmod(fd int, mode uint32) (err error) //sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) //sys Fchown(fd int, uid int, gid int) (err error) //sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) //sys Flock(fd int, how int) (err error) //sys Fpathconf(fd int, name int) (val int, err error) //sys Fstat(fd int, stat *Stat_t) (err error) //sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) //sys Fstatvfs1(fd int, buf *Statvfs_t, flags int) (err error) = SYS_FSTATVFS1 //sys Fsync(fd int) (err error) //sys Ftruncate(fd int, length int64) (err error) //sysnb Getegid() (egid int) //sysnb Geteuid() (uid int) //sysnb Getgid() (gid int) //sysnb Getpgid(pid int) (pgid int, err error) //sysnb Getpgrp() (pgrp int) //sysnb Getpid() (pid int) //sysnb Getppid() (ppid int) //sys Getpriority(which int, who int) (prio int, err error) //sysnb Getrlimit(which int, lim *Rlimit) (err error) //sysnb Getrusage(who int, rusage *Rusage) (err error) //sysnb Getsid(pid int) (sid int, err error) //sysnb Gettimeofday(tv *Timeval) (err error) //sysnb Getuid() (uid int) //sys Issetugid() (tainted bool) //sys Kill(pid int, signum syscall.Signal) (err error) //sys Kqueue() (fd int, err error) //sys Lchown(path string, uid int, gid int) (err error) //sys Link(path string, link string) (err error) //sys Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) //sys Listen(s int, backlog int) (err error) //sys Lstat(path string, stat *Stat_t) (err error) //sys Mkdir(path string, mode uint32) (err error) //sys Mkdirat(dirfd int, path string, mode uint32) (err error) //sys Mkfifo(path string, mode uint32) (err error) //sys Mkfifoat(dirfd int, path string, mode uint32) (err error) //sys Mknod(path string, mode uint32, dev int) (err error) //sys Mknodat(dirfd int, path string, mode uint32, dev int) (err error) //sys Nanosleep(time *Timespec, leftover *Timespec) (err error) //sys Open(path string, mode int, perm uint32) (fd int, err error) //sys Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) //sys Pathconf(path string, name int) (val int, err error) //sys pread(fd int, p []byte, offset int64) (n int, err error) //sys pwrite(fd int, p []byte, offset int64) (n int, err error) //sys read(fd int, p []byte) (n int, err error) //sys Readlink(path string, buf []byte) (n int, err error) //sys Readlinkat(dirfd int, path string, buf []byte) (n int, err error) //sys Rename(from string, to string) (err error) //sys Renameat(fromfd int, from string, tofd int, to string) (err error) //sys Revoke(path string) (err error) //sys Rmdir(path string) (err error) //sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) //sysnb Setegid(egid int) (err error) //sysnb Seteuid(euid int) (err error) //sysnb Setgid(gid int) (err error) //sysnb Setpgid(pid int, pgid int) (err error) //sys Setpriority(which int, who int, prio int) (err error) //sysnb Setregid(rgid int, egid int) (err error) //sysnb Setreuid(ruid int, euid int) (err error) //sysnb Setsid() (pid int, err error) //sysnb Settimeofday(tp *Timeval) (err error) //sysnb Setuid(uid int) (err error) //sys Stat(path string, stat *Stat_t) (err error) //sys Statvfs1(path string, buf *Statvfs_t, flags int) (err error) = SYS_STATVFS1 //sys Symlink(path string, link string) (err error) //sys Symlinkat(oldpath string, newdirfd int, newpath string) (err error) //sys Sync() (err error) //sys Truncate(path string, length int64) (err error) //sys Umask(newmask int) (oldmask int) //sys Unlink(path string) (err error) //sys Unlinkat(dirfd int, path string, flags int) (err error) //sys Unmount(path string, flags int) (err error) //sys write(fd int, p []byte) (n int, err error) //sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) //sys munmap(addr uintptr, length uintptr) (err error) //sys utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) const ( mremapFixed = MAP_FIXED mremapDontunmap = 0 mremapMaymove = 0 ) //sys mremapNetBSD(oldp uintptr, oldsize uintptr, newp uintptr, newsize uintptr, flags int) (xaddr uintptr, err error) = SYS_MREMAP func mremap(oldaddr uintptr, oldlength uintptr, newlength uintptr, flags int, newaddr uintptr) (uintptr, error) { return mremapNetBSD(oldaddr, oldlength, newaddr, newlength, flags) } ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_netbsd_386.go ================================================ // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build 386 && netbsd package unix func setTimespec(sec, nsec int64) Timespec { return Timespec{Sec: sec, Nsec: int32(nsec)} } func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: sec, Usec: int32(usec)} } func SetKevent(k *Kevent_t, fd, mode, flags int) { k.Ident = uint32(fd) k.Filter = uint32(mode) k.Flags = uint32(flags) } func (iov *Iovec) SetLen(length int) { iov.Len = uint32(length) } func (msghdr *Msghdr) SetControllen(length int) { msghdr.Controllen = uint32(length) } func (msghdr *Msghdr) SetIovlen(length int) { msghdr.Iovlen = int32(length) } func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint32(length) } ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go ================================================ // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build amd64 && netbsd package unix func setTimespec(sec, nsec int64) Timespec { return Timespec{Sec: sec, Nsec: nsec} } func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: sec, Usec: int32(usec)} } func SetKevent(k *Kevent_t, fd, mode, flags int) { k.Ident = uint64(fd) k.Filter = uint32(mode) k.Flags = uint32(flags) } func (iov *Iovec) SetLen(length int) { iov.Len = uint64(length) } func (msghdr *Msghdr) SetControllen(length int) { msghdr.Controllen = uint32(length) } func (msghdr *Msghdr) SetIovlen(length int) { msghdr.Iovlen = int32(length) } func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint32(length) } ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go ================================================ // Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build arm && netbsd package unix func setTimespec(sec, nsec int64) Timespec { return Timespec{Sec: sec, Nsec: int32(nsec)} } func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: sec, Usec: int32(usec)} } func SetKevent(k *Kevent_t, fd, mode, flags int) { k.Ident = uint32(fd) k.Filter = uint32(mode) k.Flags = uint32(flags) } func (iov *Iovec) SetLen(length int) { iov.Len = uint32(length) } func (msghdr *Msghdr) SetControllen(length int) { msghdr.Controllen = uint32(length) } func (msghdr *Msghdr) SetIovlen(length int) { msghdr.Iovlen = int32(length) } func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint32(length) } ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_netbsd_arm64.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build arm64 && netbsd package unix func setTimespec(sec, nsec int64) Timespec { return Timespec{Sec: sec, Nsec: nsec} } func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: sec, Usec: int32(usec)} } func SetKevent(k *Kevent_t, fd, mode, flags int) { k.Ident = uint64(fd) k.Filter = uint32(mode) k.Flags = uint32(flags) } func (iov *Iovec) SetLen(length int) { iov.Len = uint64(length) } func (msghdr *Msghdr) SetControllen(length int) { msghdr.Controllen = uint32(length) } func (msghdr *Msghdr) SetIovlen(length int) { msghdr.Iovlen = int32(length) } func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint32(length) } ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_openbsd.go ================================================ // Copyright 2009,2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // OpenBSD system calls. // This file is compiled as ordinary Go code, // but it is also input to mksyscall, // which parses the //sys lines and generates system call stubs. // Note that sometimes we use a lowercase //sys name and wrap // it in our own nicer implementation, either here or in // syscall_bsd.go or syscall_unix.go. package unix import ( "sort" "syscall" "unsafe" ) // SockaddrDatalink implements the Sockaddr interface for AF_LINK type sockets. type SockaddrDatalink struct { Len uint8 Family uint8 Index uint16 Type uint8 Nlen uint8 Alen uint8 Slen uint8 Data [24]int8 raw RawSockaddrDatalink } func anyToSockaddrGOOS(fd int, rsa *RawSockaddrAny) (Sockaddr, error) { return nil, EAFNOSUPPORT } func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) func nametomib(name string) (mib []_C_int, err error) { i := sort.Search(len(sysctlMib), func(i int) bool { return sysctlMib[i].ctlname >= name }) if i < len(sysctlMib) && sysctlMib[i].ctlname == name { return sysctlMib[i].ctloid, nil } return nil, EINVAL } func direntIno(buf []byte) (uint64, bool) { return readInt(buf, unsafe.Offsetof(Dirent{}.Fileno), unsafe.Sizeof(Dirent{}.Fileno)) } func direntReclen(buf []byte) (uint64, bool) { return readInt(buf, unsafe.Offsetof(Dirent{}.Reclen), unsafe.Sizeof(Dirent{}.Reclen)) } func direntNamlen(buf []byte) (uint64, bool) { return readInt(buf, unsafe.Offsetof(Dirent{}.Namlen), unsafe.Sizeof(Dirent{}.Namlen)) } func SysctlUvmexp(name string) (*Uvmexp, error) { mib, err := sysctlmib(name) if err != nil { return nil, err } n := uintptr(SizeofUvmexp) var u Uvmexp if err := sysctl(mib, (*byte)(unsafe.Pointer(&u)), &n, nil, 0); err != nil { return nil, err } if n != SizeofUvmexp { return nil, EIO } return &u, nil } func Pipe(p []int) (err error) { return Pipe2(p, 0) } //sysnb pipe2(p *[2]_C_int, flags int) (err error) func Pipe2(p []int, flags int) error { if len(p) != 2 { return EINVAL } var pp [2]_C_int err := pipe2(&pp, flags) if err == nil { p[0] = int(pp[0]) p[1] = int(pp[1]) } return err } //sys Getdents(fd int, buf []byte) (n int, err error) func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { n, err = Getdents(fd, buf) if err != nil || basep == nil { return } var off int64 off, err = Seek(fd, 0, 1 /* SEEK_CUR */) if err != nil { *basep = ^uintptr(0) return } *basep = uintptr(off) if unsafe.Sizeof(*basep) == 8 { return } if off>>32 != 0 { // We can't stuff the offset back into a uintptr, so any // future calls would be suspect. Generate an error. // EIO was allowed by getdirentries. err = EIO } return } //sys Getcwd(buf []byte) (n int, err error) = SYS___GETCWD func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { if raceenabled { raceReleaseMerge(unsafe.Pointer(&ioSync)) } return sendfile(outfd, infd, offset, count) } // TODO func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { return -1, ENOSYS } func Getfsstat(buf []Statfs_t, flags int) (n int, err error) { var bufptr *Statfs_t var bufsize uintptr if len(buf) > 0 { bufptr = &buf[0] bufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf)) } return getfsstat(bufptr, bufsize, flags) } //sysnb getresuid(ruid *_C_int, euid *_C_int, suid *_C_int) //sysnb getresgid(rgid *_C_int, egid *_C_int, sgid *_C_int) func Getresuid() (ruid, euid, suid int) { var r, e, s _C_int getresuid(&r, &e, &s) return int(r), int(e), int(s) } func Getresgid() (rgid, egid, sgid int) { var r, e, s _C_int getresgid(&r, &e, &s) return int(r), int(e), int(s) } //sys ioctl(fd int, req uint, arg uintptr) (err error) //sys ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) = SYS_IOCTL //sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL //sys fcntl(fd int, cmd int, arg int) (n int, err error) //sys fcntlPtr(fd int, cmd int, arg unsafe.Pointer) (n int, err error) = SYS_FCNTL // FcntlInt performs a fcntl syscall on fd with the provided command and argument. func FcntlInt(fd uintptr, cmd, arg int) (int, error) { return fcntl(int(fd), cmd, arg) } // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { _, err := fcntlPtr(int(fd), cmd, unsafe.Pointer(lk)) return err } //sys ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error) func Ppoll(fds []PollFd, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { if len(fds) == 0 { return ppoll(nil, 0, timeout, sigmask) } return ppoll(&fds[0], len(fds), timeout, sigmask) } func Uname(uname *Utsname) error { mib := []_C_int{CTL_KERN, KERN_OSTYPE} n := unsafe.Sizeof(uname.Sysname) if err := sysctl(mib, &uname.Sysname[0], &n, nil, 0); err != nil { return err } mib = []_C_int{CTL_KERN, KERN_HOSTNAME} n = unsafe.Sizeof(uname.Nodename) if err := sysctl(mib, &uname.Nodename[0], &n, nil, 0); err != nil { return err } mib = []_C_int{CTL_KERN, KERN_OSRELEASE} n = unsafe.Sizeof(uname.Release) if err := sysctl(mib, &uname.Release[0], &n, nil, 0); err != nil { return err } mib = []_C_int{CTL_KERN, KERN_VERSION} n = unsafe.Sizeof(uname.Version) if err := sysctl(mib, &uname.Version[0], &n, nil, 0); err != nil { return err } // The version might have newlines or tabs in it, convert them to // spaces. for i, b := range uname.Version { if b == '\n' || b == '\t' { if i == len(uname.Version)-1 { uname.Version[i] = 0 } else { uname.Version[i] = ' ' } } } mib = []_C_int{CTL_HW, HW_MACHINE} n = unsafe.Sizeof(uname.Machine) if err := sysctl(mib, &uname.Machine[0], &n, nil, 0); err != nil { return err } return nil } /* * Exposed directly */ //sys Access(path string, mode uint32) (err error) //sys Adjtime(delta *Timeval, olddelta *Timeval) (err error) //sys Chdir(path string) (err error) //sys Chflags(path string, flags int) (err error) //sys Chmod(path string, mode uint32) (err error) //sys Chown(path string, uid int, gid int) (err error) //sys Chroot(path string) (err error) //sys ClockGettime(clockid int32, time *Timespec) (err error) //sys Close(fd int) (err error) //sys Dup(fd int) (nfd int, err error) //sys Dup2(from int, to int) (err error) //sys Dup3(from int, to int, flags int) (err error) //sys Exit(code int) //sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error) //sys Fchdir(fd int) (err error) //sys Fchflags(fd int, flags int) (err error) //sys Fchmod(fd int, mode uint32) (err error) //sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) //sys Fchown(fd int, uid int, gid int) (err error) //sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) //sys Flock(fd int, how int) (err error) //sys Fpathconf(fd int, name int) (val int, err error) //sys Fstat(fd int, stat *Stat_t) (err error) //sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) //sys Fstatfs(fd int, stat *Statfs_t) (err error) //sys Fsync(fd int) (err error) //sys Ftruncate(fd int, length int64) (err error) //sysnb Getegid() (egid int) //sysnb Geteuid() (uid int) //sysnb Getgid() (gid int) //sysnb Getpgid(pid int) (pgid int, err error) //sysnb Getpgrp() (pgrp int) //sysnb Getpid() (pid int) //sysnb Getppid() (ppid int) //sys Getpriority(which int, who int) (prio int, err error) //sysnb Getrlimit(which int, lim *Rlimit) (err error) //sysnb Getrtable() (rtable int, err error) //sysnb Getrusage(who int, rusage *Rusage) (err error) //sysnb Getsid(pid int) (sid int, err error) //sysnb Gettimeofday(tv *Timeval) (err error) //sysnb Getuid() (uid int) //sys Issetugid() (tainted bool) //sys Kill(pid int, signum syscall.Signal) (err error) //sys Kqueue() (fd int, err error) //sys Lchown(path string, uid int, gid int) (err error) //sys Link(path string, link string) (err error) //sys Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) //sys Listen(s int, backlog int) (err error) //sys Lstat(path string, stat *Stat_t) (err error) //sys Mkdir(path string, mode uint32) (err error) //sys Mkdirat(dirfd int, path string, mode uint32) (err error) //sys Mkfifo(path string, mode uint32) (err error) //sys Mkfifoat(dirfd int, path string, mode uint32) (err error) //sys Mknod(path string, mode uint32, dev int) (err error) //sys Mknodat(dirfd int, path string, mode uint32, dev int) (err error) //sys Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) //sys Nanosleep(time *Timespec, leftover *Timespec) (err error) //sys Open(path string, mode int, perm uint32) (fd int, err error) //sys Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) //sys Pathconf(path string, name int) (val int, err error) //sys pread(fd int, p []byte, offset int64) (n int, err error) //sys pwrite(fd int, p []byte, offset int64) (n int, err error) //sys read(fd int, p []byte) (n int, err error) //sys Readlink(path string, buf []byte) (n int, err error) //sys Readlinkat(dirfd int, path string, buf []byte) (n int, err error) //sys Rename(from string, to string) (err error) //sys Renameat(fromfd int, from string, tofd int, to string) (err error) //sys Revoke(path string) (err error) //sys Rmdir(path string) (err error) //sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) //sysnb Setegid(egid int) (err error) //sysnb Seteuid(euid int) (err error) //sysnb Setgid(gid int) (err error) //sys Setlogin(name string) (err error) //sysnb Setpgid(pid int, pgid int) (err error) //sys Setpriority(which int, who int, prio int) (err error) //sysnb Setregid(rgid int, egid int) (err error) //sysnb Setreuid(ruid int, euid int) (err error) //sysnb Setresgid(rgid int, egid int, sgid int) (err error) //sysnb Setresuid(ruid int, euid int, suid int) (err error) //sysnb Setrtable(rtable int) (err error) //sysnb Setsid() (pid int, err error) //sysnb Settimeofday(tp *Timeval) (err error) //sysnb Setuid(uid int) (err error) //sys Stat(path string, stat *Stat_t) (err error) //sys Statfs(path string, stat *Statfs_t) (err error) //sys Symlink(path string, link string) (err error) //sys Symlinkat(oldpath string, newdirfd int, newpath string) (err error) //sys Sync() (err error) //sys Truncate(path string, length int64) (err error) //sys Umask(newmask int) (oldmask int) //sys Unlink(path string) (err error) //sys Unlinkat(dirfd int, path string, flags int) (err error) //sys Unmount(path string, flags int) (err error) //sys write(fd int, p []byte) (n int, err error) //sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) //sys munmap(addr uintptr, length uintptr) (err error) //sys getfsstat(stat *Statfs_t, bufsize uintptr, flags int) (n int, err error) //sys utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) //sys pledge(promises *byte, execpromises *byte) (err error) //sys unveil(path *byte, flags *byte) (err error) ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_openbsd_386.go ================================================ // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build 386 && openbsd package unix func setTimespec(sec, nsec int64) Timespec { return Timespec{Sec: sec, Nsec: int32(nsec)} } func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: sec, Usec: int32(usec)} } func SetKevent(k *Kevent_t, fd, mode, flags int) { k.Ident = uint32(fd) k.Filter = int16(mode) k.Flags = uint16(flags) } func (iov *Iovec) SetLen(length int) { iov.Len = uint32(length) } func (msghdr *Msghdr) SetControllen(length int) { msghdr.Controllen = uint32(length) } func (msghdr *Msghdr) SetIovlen(length int) { msghdr.Iovlen = uint32(length) } func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint32(length) } // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions // of openbsd/386 the syscall is called sysctl instead of __sysctl. const SYS___SYSCTL = SYS_SYSCTL ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go ================================================ // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build amd64 && openbsd package unix func setTimespec(sec, nsec int64) Timespec { return Timespec{Sec: sec, Nsec: nsec} } func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: sec, Usec: usec} } func SetKevent(k *Kevent_t, fd, mode, flags int) { k.Ident = uint64(fd) k.Filter = int16(mode) k.Flags = uint16(flags) } func (iov *Iovec) SetLen(length int) { iov.Len = uint64(length) } func (msghdr *Msghdr) SetControllen(length int) { msghdr.Controllen = uint32(length) } func (msghdr *Msghdr) SetIovlen(length int) { msghdr.Iovlen = uint32(length) } func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint32(length) } // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions // of openbsd/amd64 the syscall is called sysctl instead of __sysctl. const SYS___SYSCTL = SYS_SYSCTL ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go ================================================ // Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build arm && openbsd package unix func setTimespec(sec, nsec int64) Timespec { return Timespec{Sec: sec, Nsec: int32(nsec)} } func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: sec, Usec: int32(usec)} } func SetKevent(k *Kevent_t, fd, mode, flags int) { k.Ident = uint32(fd) k.Filter = int16(mode) k.Flags = uint16(flags) } func (iov *Iovec) SetLen(length int) { iov.Len = uint32(length) } func (msghdr *Msghdr) SetControllen(length int) { msghdr.Controllen = uint32(length) } func (msghdr *Msghdr) SetIovlen(length int) { msghdr.Iovlen = uint32(length) } func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint32(length) } // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions // of openbsd/arm the syscall is called sysctl instead of __sysctl. const SYS___SYSCTL = SYS_SYSCTL ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_openbsd_arm64.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build arm64 && openbsd package unix func setTimespec(sec, nsec int64) Timespec { return Timespec{Sec: sec, Nsec: nsec} } func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: sec, Usec: usec} } func SetKevent(k *Kevent_t, fd, mode, flags int) { k.Ident = uint64(fd) k.Filter = int16(mode) k.Flags = uint16(flags) } func (iov *Iovec) SetLen(length int) { iov.Len = uint64(length) } func (msghdr *Msghdr) SetControllen(length int) { msghdr.Controllen = uint32(length) } func (msghdr *Msghdr) SetIovlen(length int) { msghdr.Iovlen = uint32(length) } func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint32(length) } // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions // of openbsd/amd64 the syscall is called sysctl instead of __sysctl. const SYS___SYSCTL = SYS_SYSCTL ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_openbsd_libc.go ================================================ // Copyright 2022 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build openbsd package unix import _ "unsafe" // Implemented in the runtime package (runtime/sys_openbsd3.go) func syscall_syscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) func syscall_syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) func syscall_syscall10(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10 uintptr) (r1, r2 uintptr, err Errno) func syscall_rawSyscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) func syscall_rawSyscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) //go:linkname syscall_syscall syscall.syscall //go:linkname syscall_syscall6 syscall.syscall6 //go:linkname syscall_syscall10 syscall.syscall10 //go:linkname syscall_rawSyscall syscall.rawSyscall //go:linkname syscall_rawSyscall6 syscall.rawSyscall6 func syscall_syscall9(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) { return syscall_syscall10(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, 0) } ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_openbsd_mips64.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package unix func setTimespec(sec, nsec int64) Timespec { return Timespec{Sec: sec, Nsec: nsec} } func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: sec, Usec: usec} } func SetKevent(k *Kevent_t, fd, mode, flags int) { k.Ident = uint64(fd) k.Filter = int16(mode) k.Flags = uint16(flags) } func (iov *Iovec) SetLen(length int) { iov.Len = uint64(length) } func (msghdr *Msghdr) SetControllen(length int) { msghdr.Controllen = uint32(length) } func (msghdr *Msghdr) SetIovlen(length int) { msghdr.Iovlen = uint32(length) } func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint32(length) } // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions // of OpenBSD the syscall is called sysctl instead of __sysctl. const SYS___SYSCTL = SYS_SYSCTL ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_openbsd_ppc64.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build ppc64 && openbsd package unix func setTimespec(sec, nsec int64) Timespec { return Timespec{Sec: sec, Nsec: nsec} } func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: sec, Usec: usec} } func SetKevent(k *Kevent_t, fd, mode, flags int) { k.Ident = uint64(fd) k.Filter = int16(mode) k.Flags = uint16(flags) } func (iov *Iovec) SetLen(length int) { iov.Len = uint64(length) } func (msghdr *Msghdr) SetControllen(length int) { msghdr.Controllen = uint32(length) } func (msghdr *Msghdr) SetIovlen(length int) { msghdr.Iovlen = uint32(length) } func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint32(length) } // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions // of openbsd/ppc64 the syscall is called sysctl instead of __sysctl. const SYS___SYSCTL = SYS_SYSCTL ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_openbsd_riscv64.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build riscv64 && openbsd package unix func setTimespec(sec, nsec int64) Timespec { return Timespec{Sec: sec, Nsec: nsec} } func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: sec, Usec: usec} } func SetKevent(k *Kevent_t, fd, mode, flags int) { k.Ident = uint64(fd) k.Filter = int16(mode) k.Flags = uint16(flags) } func (iov *Iovec) SetLen(length int) { iov.Len = uint64(length) } func (msghdr *Msghdr) SetControllen(length int) { msghdr.Controllen = uint32(length) } func (msghdr *Msghdr) SetIovlen(length int) { msghdr.Iovlen = uint32(length) } func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint32(length) } // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions // of openbsd/riscv64 the syscall is called sysctl instead of __sysctl. const SYS___SYSCTL = SYS_SYSCTL ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_solaris.go ================================================ // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Solaris system calls. // This file is compiled as ordinary Go code, // but it is also input to mksyscall, // which parses the //sys lines and generates system call stubs. // Note that sometimes we use a lowercase //sys name and wrap // it in our own nicer implementation, either here or in // syscall_solaris.go or syscall_unix.go. package unix import ( "fmt" "os" "runtime" "sync" "syscall" "unsafe" ) // Implemented in runtime/syscall_solaris.go. type syscallFunc uintptr func rawSysvicall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) func sysvicall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) // SockaddrDatalink implements the Sockaddr interface for AF_LINK type sockets. type SockaddrDatalink struct { Family uint16 Index uint16 Type uint8 Nlen uint8 Alen uint8 Slen uint8 Data [244]int8 raw RawSockaddrDatalink } func direntIno(buf []byte) (uint64, bool) { return readInt(buf, unsafe.Offsetof(Dirent{}.Ino), unsafe.Sizeof(Dirent{}.Ino)) } func direntReclen(buf []byte) (uint64, bool) { return readInt(buf, unsafe.Offsetof(Dirent{}.Reclen), unsafe.Sizeof(Dirent{}.Reclen)) } func direntNamlen(buf []byte) (uint64, bool) { reclen, ok := direntReclen(buf) if !ok { return 0, false } return reclen - uint64(unsafe.Offsetof(Dirent{}.Name)), true } //sysnb pipe(p *[2]_C_int) (n int, err error) func Pipe(p []int) (err error) { if len(p) != 2 { return EINVAL } var pp [2]_C_int n, err := pipe(&pp) if n != 0 { return err } if err == nil { p[0] = int(pp[0]) p[1] = int(pp[1]) } return nil } //sysnb pipe2(p *[2]_C_int, flags int) (err error) func Pipe2(p []int, flags int) error { if len(p) != 2 { return EINVAL } var pp [2]_C_int err := pipe2(&pp, flags) if err == nil { p[0] = int(pp[0]) p[1] = int(pp[1]) } return err } func (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, _Socklen, error) { if sa.Port < 0 || sa.Port > 0xFFFF { return nil, 0, EINVAL } sa.raw.Family = AF_INET p := (*[2]byte)(unsafe.Pointer(&sa.raw.Port)) p[0] = byte(sa.Port >> 8) p[1] = byte(sa.Port) sa.raw.Addr = sa.Addr return unsafe.Pointer(&sa.raw), SizeofSockaddrInet4, nil } func (sa *SockaddrInet6) sockaddr() (unsafe.Pointer, _Socklen, error) { if sa.Port < 0 || sa.Port > 0xFFFF { return nil, 0, EINVAL } sa.raw.Family = AF_INET6 p := (*[2]byte)(unsafe.Pointer(&sa.raw.Port)) p[0] = byte(sa.Port >> 8) p[1] = byte(sa.Port) sa.raw.Scope_id = sa.ZoneId sa.raw.Addr = sa.Addr return unsafe.Pointer(&sa.raw), SizeofSockaddrInet6, nil } func (sa *SockaddrUnix) sockaddr() (unsafe.Pointer, _Socklen, error) { name := sa.Name n := len(name) if n >= len(sa.raw.Path) { return nil, 0, EINVAL } sa.raw.Family = AF_UNIX for i := 0; i < n; i++ { sa.raw.Path[i] = int8(name[i]) } // length is family (uint16), name, NUL. sl := _Socklen(2) if n > 0 { sl += _Socklen(n) + 1 } if sa.raw.Path[0] == '@' || (sa.raw.Path[0] == 0 && sl > 3) { // Check sl > 3 so we don't change unnamed socket behavior. sa.raw.Path[0] = 0 // Don't count trailing NUL for abstract address. sl-- } return unsafe.Pointer(&sa.raw), sl, nil } //sys getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) = libsocket.getsockname func Getsockname(fd int) (sa Sockaddr, err error) { var rsa RawSockaddrAny var len _Socklen = SizeofSockaddrAny if err = getsockname(fd, &rsa, &len); err != nil { return } return anyToSockaddr(fd, &rsa) } // GetsockoptString returns the string value of the socket option opt for the // socket associated with fd at the given socket level. func GetsockoptString(fd, level, opt int) (string, error) { buf := make([]byte, 256) vallen := _Socklen(len(buf)) err := getsockopt(fd, level, opt, unsafe.Pointer(&buf[0]), &vallen) if err != nil { return "", err } return ByteSliceToString(buf[:vallen]), nil } const ImplementsGetwd = true //sys Getcwd(buf []byte) (n int, err error) func Getwd() (wd string, err error) { var buf [PathMax]byte // Getcwd will return an error if it failed for any reason. _, err = Getcwd(buf[0:]) if err != nil { return "", err } n := clen(buf[:]) if n < 1 { return "", EINVAL } return string(buf[:n]), nil } /* * Wrapped */ //sysnb getgroups(ngid int, gid *_Gid_t) (n int, err error) //sysnb setgroups(ngid int, gid *_Gid_t) (err error) func Getgroups() (gids []int, err error) { n, err := getgroups(0, nil) // Check for error and sanity check group count. Newer versions of // Solaris allow up to 1024 (NGROUPS_MAX). if n < 0 || n > 1024 { if err != nil { return nil, err } return nil, EINVAL } else if n == 0 { return nil, nil } a := make([]_Gid_t, n) n, err = getgroups(n, &a[0]) if n == -1 { return nil, err } gids = make([]int, n) for i, v := range a[0:n] { gids[i] = int(v) } return } func Setgroups(gids []int) (err error) { if len(gids) == 0 { return setgroups(0, nil) } a := make([]_Gid_t, len(gids)) for i, v := range gids { a[i] = _Gid_t(v) } return setgroups(len(a), &a[0]) } // ReadDirent reads directory entries from fd and writes them into buf. func ReadDirent(fd int, buf []byte) (n int, err error) { // Final argument is (basep *uintptr) and the syscall doesn't take nil. // TODO(rsc): Can we use a single global basep for all calls? return Getdents(fd, buf, new(uintptr)) } // Wait status is 7 bits at bottom, either 0 (exited), // 0x7F (stopped), or a signal number that caused an exit. // The 0x80 bit is whether there was a core dump. // An extra number (exit code, signal causing a stop) // is in the high bits. type WaitStatus uint32 const ( mask = 0x7F core = 0x80 shift = 8 exited = 0 stopped = 0x7F ) func (w WaitStatus) Exited() bool { return w&mask == exited } func (w WaitStatus) ExitStatus() int { if w&mask != exited { return -1 } return int(w >> shift) } func (w WaitStatus) Signaled() bool { return w&mask != stopped && w&mask != 0 } func (w WaitStatus) Signal() syscall.Signal { sig := syscall.Signal(w & mask) if sig == stopped || sig == 0 { return -1 } return sig } func (w WaitStatus) CoreDump() bool { return w.Signaled() && w&core != 0 } func (w WaitStatus) Stopped() bool { return w&mask == stopped && syscall.Signal(w>>shift) != SIGSTOP } func (w WaitStatus) Continued() bool { return w&mask == stopped && syscall.Signal(w>>shift) == SIGSTOP } func (w WaitStatus) StopSignal() syscall.Signal { if !w.Stopped() { return -1 } return syscall.Signal(w>>shift) & 0xFF } func (w WaitStatus) TrapCause() int { return -1 } //sys wait4(pid int32, statusp *_C_int, options int, rusage *Rusage) (wpid int32, err error) func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (int, error) { var status _C_int rpid, err := wait4(int32(pid), &status, options, rusage) wpid := int(rpid) if wpid == -1 { return wpid, err } if wstatus != nil { *wstatus = WaitStatus(status) } return wpid, nil } //sys gethostname(buf []byte) (n int, err error) func Gethostname() (name string, err error) { var buf [MaxHostNameLen]byte n, err := gethostname(buf[:]) if n != 0 { return "", err } n = clen(buf[:]) if n < 1 { return "", EFAULT } return string(buf[:n]), nil } //sys utimes(path string, times *[2]Timeval) (err error) func Utimes(path string, tv []Timeval) (err error) { if tv == nil { return utimes(path, nil) } if len(tv) != 2 { return EINVAL } return utimes(path, (*[2]Timeval)(unsafe.Pointer(&tv[0]))) } //sys utimensat(fd int, path string, times *[2]Timespec, flag int) (err error) func UtimesNano(path string, ts []Timespec) error { if ts == nil { return utimensat(AT_FDCWD, path, nil, 0) } if len(ts) != 2 { return EINVAL } return utimensat(AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0) } func UtimesNanoAt(dirfd int, path string, ts []Timespec, flags int) error { if ts == nil { return utimensat(dirfd, path, nil, flags) } if len(ts) != 2 { return EINVAL } return utimensat(dirfd, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), flags) } //sys fcntl(fd int, cmd int, arg int) (val int, err error) // FcntlInt performs a fcntl syscall on fd with the provided command and argument. func FcntlInt(fd uintptr, cmd, arg int) (int, error) { valptr, _, errno := sysvicall6(uintptr(unsafe.Pointer(&procfcntl)), 3, uintptr(fd), uintptr(cmd), uintptr(arg), 0, 0, 0) var err error if errno != 0 { err = errno } return int(valptr), err } // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procfcntl)), 3, uintptr(fd), uintptr(cmd), uintptr(unsafe.Pointer(lk)), 0, 0, 0) if e1 != 0 { return e1 } return nil } //sys futimesat(fildes int, path *byte, times *[2]Timeval) (err error) func Futimesat(dirfd int, path string, tv []Timeval) error { pathp, err := BytePtrFromString(path) if err != nil { return err } if tv == nil { return futimesat(dirfd, pathp, nil) } if len(tv) != 2 { return EINVAL } return futimesat(dirfd, pathp, (*[2]Timeval)(unsafe.Pointer(&tv[0]))) } // Solaris doesn't have an futimes function because it allows NULL to be // specified as the path for futimesat. However, Go doesn't like // NULL-style string interfaces, so this simple wrapper is provided. func Futimes(fd int, tv []Timeval) error { if tv == nil { return futimesat(fd, nil, nil) } if len(tv) != 2 { return EINVAL } return futimesat(fd, nil, (*[2]Timeval)(unsafe.Pointer(&tv[0]))) } func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) { switch rsa.Addr.Family { case AF_UNIX: pp := (*RawSockaddrUnix)(unsafe.Pointer(rsa)) sa := new(SockaddrUnix) // Assume path ends at NUL. // This is not technically the Solaris semantics for // abstract Unix domain sockets -- they are supposed // to be uninterpreted fixed-size binary blobs -- but // everyone uses this convention. n := 0 for n < len(pp.Path) && pp.Path[n] != 0 { n++ } sa.Name = string(unsafe.Slice((*byte)(unsafe.Pointer(&pp.Path[0])), n)) return sa, nil case AF_INET: pp := (*RawSockaddrInet4)(unsafe.Pointer(rsa)) sa := new(SockaddrInet4) p := (*[2]byte)(unsafe.Pointer(&pp.Port)) sa.Port = int(p[0])<<8 + int(p[1]) sa.Addr = pp.Addr return sa, nil case AF_INET6: pp := (*RawSockaddrInet6)(unsafe.Pointer(rsa)) sa := new(SockaddrInet6) p := (*[2]byte)(unsafe.Pointer(&pp.Port)) sa.Port = int(p[0])<<8 + int(p[1]) sa.ZoneId = pp.Scope_id sa.Addr = pp.Addr return sa, nil } return nil, EAFNOSUPPORT } //sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) = libsocket.accept func Accept(fd int) (nfd int, sa Sockaddr, err error) { var rsa RawSockaddrAny var len _Socklen = SizeofSockaddrAny nfd, err = accept(fd, &rsa, &len) if nfd == -1 { return } sa, err = anyToSockaddr(fd, &rsa) if err != nil { Close(nfd) nfd = 0 } return } //sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error) = libsocket.__xnet_recvmsg func recvmsgRaw(fd int, iov []Iovec, oob []byte, flags int, rsa *RawSockaddrAny) (n, oobn int, recvflags int, err error) { var msg Msghdr msg.Name = (*byte)(unsafe.Pointer(rsa)) msg.Namelen = uint32(SizeofSockaddrAny) var dummy byte if len(oob) > 0 { // receive at least one normal byte if emptyIovecs(iov) { var iova [1]Iovec iova[0].Base = &dummy iova[0].SetLen(1) iov = iova[:] } msg.Accrightslen = int32(len(oob)) } if len(iov) > 0 { msg.Iov = &iov[0] msg.SetIovlen(len(iov)) } if n, err = recvmsg(fd, &msg, flags); n == -1 { return } oobn = int(msg.Accrightslen) return } //sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error) = libsocket.__xnet_sendmsg func sendmsgN(fd int, iov []Iovec, oob []byte, ptr unsafe.Pointer, salen _Socklen, flags int) (n int, err error) { var msg Msghdr msg.Name = (*byte)(unsafe.Pointer(ptr)) msg.Namelen = uint32(salen) var dummy byte var empty bool if len(oob) > 0 { // send at least one normal byte empty = emptyIovecs(iov) if empty { var iova [1]Iovec iova[0].Base = &dummy iova[0].SetLen(1) iov = iova[:] } msg.Accrightslen = int32(len(oob)) } if len(iov) > 0 { msg.Iov = &iov[0] msg.SetIovlen(len(iov)) } if n, err = sendmsg(fd, &msg, flags); err != nil { return 0, err } if len(oob) > 0 && empty { n = 0 } return n, nil } //sys acct(path *byte) (err error) func Acct(path string) (err error) { if len(path) == 0 { // Assume caller wants to disable accounting. return acct(nil) } pathp, err := BytePtrFromString(path) if err != nil { return err } return acct(pathp) } //sys __makedev(version int, major uint, minor uint) (val uint64) func Mkdev(major, minor uint32) uint64 { return __makedev(NEWDEV, uint(major), uint(minor)) } //sys __major(version int, dev uint64) (val uint) func Major(dev uint64) uint32 { return uint32(__major(NEWDEV, dev)) } //sys __minor(version int, dev uint64) (val uint) func Minor(dev uint64) uint32 { return uint32(__minor(NEWDEV, dev)) } /* * Expose the ioctl function */ //sys ioctlRet(fd int, req int, arg uintptr) (ret int, err error) = libc.ioctl //sys ioctlPtrRet(fd int, req int, arg unsafe.Pointer) (ret int, err error) = libc.ioctl func ioctl(fd int, req int, arg uintptr) (err error) { _, err = ioctlRet(fd, req, arg) return err } func ioctlPtr(fd int, req int, arg unsafe.Pointer) (err error) { _, err = ioctlPtrRet(fd, req, arg) return err } func IoctlSetTermio(fd int, req int, value *Termio) error { return ioctlPtr(fd, req, unsafe.Pointer(value)) } func IoctlGetTermio(fd int, req int) (*Termio, error) { var value Termio err := ioctlPtr(fd, req, unsafe.Pointer(&value)) return &value, err } //sys poll(fds *PollFd, nfds int, timeout int) (n int, err error) func Poll(fds []PollFd, timeout int) (n int, err error) { if len(fds) == 0 { return poll(nil, 0, timeout) } return poll(&fds[0], len(fds), timeout) } func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { if raceenabled { raceReleaseMerge(unsafe.Pointer(&ioSync)) } return sendfile(outfd, infd, offset, count) } /* * Exposed directly */ //sys Access(path string, mode uint32) (err error) //sys Adjtime(delta *Timeval, olddelta *Timeval) (err error) //sys Chdir(path string) (err error) //sys Chmod(path string, mode uint32) (err error) //sys Chown(path string, uid int, gid int) (err error) //sys Chroot(path string) (err error) //sys ClockGettime(clockid int32, time *Timespec) (err error) //sys Close(fd int) (err error) //sys Creat(path string, mode uint32) (fd int, err error) //sys Dup(fd int) (nfd int, err error) //sys Dup2(oldfd int, newfd int) (err error) //sys Exit(code int) //sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error) //sys Fchdir(fd int) (err error) //sys Fchmod(fd int, mode uint32) (err error) //sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) //sys Fchown(fd int, uid int, gid int) (err error) //sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) //sys Fdatasync(fd int) (err error) //sys Flock(fd int, how int) (err error) //sys Fpathconf(fd int, name int) (val int, err error) //sys Fstat(fd int, stat *Stat_t) (err error) //sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) //sys Fstatvfs(fd int, vfsstat *Statvfs_t) (err error) //sys Getdents(fd int, buf []byte, basep *uintptr) (n int, err error) //sysnb Getgid() (gid int) //sysnb Getpid() (pid int) //sysnb Getpgid(pid int) (pgid int, err error) //sysnb Getpgrp() (pgid int, err error) //sys Geteuid() (euid int) //sys Getegid() (egid int) //sys Getppid() (ppid int) //sys Getpriority(which int, who int) (n int, err error) //sysnb Getrlimit(which int, lim *Rlimit) (err error) //sysnb Getrusage(who int, rusage *Rusage) (err error) //sysnb Getsid(pid int) (sid int, err error) //sysnb Gettimeofday(tv *Timeval) (err error) //sysnb Getuid() (uid int) //sys Kill(pid int, signum syscall.Signal) (err error) //sys Lchown(path string, uid int, gid int) (err error) //sys Link(path string, link string) (err error) //sys Listen(s int, backlog int) (err error) = libsocket.__xnet_listen //sys Lstat(path string, stat *Stat_t) (err error) //sys Madvise(b []byte, advice int) (err error) //sys Mkdir(path string, mode uint32) (err error) //sys Mkdirat(dirfd int, path string, mode uint32) (err error) //sys Mkfifo(path string, mode uint32) (err error) //sys Mkfifoat(dirfd int, path string, mode uint32) (err error) //sys Mknod(path string, mode uint32, dev int) (err error) //sys Mknodat(dirfd int, path string, mode uint32, dev int) (err error) //sys Mlock(b []byte) (err error) //sys Mlockall(flags int) (err error) //sys Mprotect(b []byte, prot int) (err error) //sys Msync(b []byte, flags int) (err error) //sys Munlock(b []byte) (err error) //sys Munlockall() (err error) //sys Nanosleep(time *Timespec, leftover *Timespec) (err error) //sys Open(path string, mode int, perm uint32) (fd int, err error) //sys Openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) //sys Pathconf(path string, name int) (val int, err error) //sys Pause() (err error) //sys pread(fd int, p []byte, offset int64) (n int, err error) //sys pwrite(fd int, p []byte, offset int64) (n int, err error) //sys read(fd int, p []byte) (n int, err error) //sys Readlink(path string, buf []byte) (n int, err error) //sys Rename(from string, to string) (err error) //sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) //sys Rmdir(path string) (err error) //sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = lseek //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) //sysnb Setegid(egid int) (err error) //sysnb Seteuid(euid int) (err error) //sysnb Setgid(gid int) (err error) //sys Sethostname(p []byte) (err error) //sysnb Setpgid(pid int, pgid int) (err error) //sys Setpriority(which int, who int, prio int) (err error) //sysnb Setregid(rgid int, egid int) (err error) //sysnb Setreuid(ruid int, euid int) (err error) //sysnb Setsid() (pid int, err error) //sysnb Setuid(uid int) (err error) //sys Shutdown(s int, how int) (err error) = libsocket.shutdown //sys Stat(path string, stat *Stat_t) (err error) //sys Statvfs(path string, vfsstat *Statvfs_t) (err error) //sys Symlink(path string, link string) (err error) //sys Sync() (err error) //sys Sysconf(which int) (n int64, err error) //sysnb Times(tms *Tms) (ticks uintptr, err error) //sys Truncate(path string, length int64) (err error) //sys Fsync(fd int) (err error) //sys Ftruncate(fd int, length int64) (err error) //sys Umask(mask int) (oldmask int) //sysnb Uname(buf *Utsname) (err error) //sys Unmount(target string, flags int) (err error) = libc.umount //sys Unlink(path string) (err error) //sys Unlinkat(dirfd int, path string, flags int) (err error) //sys Ustat(dev int, ubuf *Ustat_t) (err error) //sys Utime(path string, buf *Utimbuf) (err error) //sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) = libsocket.__xnet_bind //sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) = libsocket.__xnet_connect //sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) //sys munmap(addr uintptr, length uintptr) (err error) //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) = libsendfile.sendfile //sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) = libsocket.__xnet_sendto //sys socket(domain int, typ int, proto int) (fd int, err error) = libsocket.__xnet_socket //sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) = libsocket.__xnet_socketpair //sys write(fd int, p []byte) (n int, err error) //sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) = libsocket.__xnet_getsockopt //sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) = libsocket.getpeername //sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) = libsocket.setsockopt //sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) = libsocket.recvfrom // Event Ports type fileObjCookie struct { fobj *fileObj cookie interface{} } // EventPort provides a safe abstraction on top of Solaris/illumos Event Ports. type EventPort struct { port int mu sync.Mutex fds map[uintptr]*fileObjCookie paths map[string]*fileObjCookie // The user cookie presents an interesting challenge from a memory management perspective. // There are two paths by which we can discover that it is no longer in use: // 1. The user calls port_dissociate before any events fire // 2. An event fires and we return it to the user // The tricky situation is if the event has fired in the kernel but // the user hasn't requested/received it yet. // If the user wants to port_dissociate before the event has been processed, // we should handle things gracefully. To do so, we need to keep an extra // reference to the cookie around until the event is processed // thus the otherwise seemingly extraneous "cookies" map // The key of this map is a pointer to the corresponding fCookie cookies map[*fileObjCookie]struct{} } // PortEvent is an abstraction of the port_event C struct. // Compare Source against PORT_SOURCE_FILE or PORT_SOURCE_FD // to see if Path or Fd was the event source. The other will be // uninitialized. type PortEvent struct { Cookie interface{} Events int32 Fd uintptr Path string Source uint16 fobj *fileObj } // NewEventPort creates a new EventPort including the // underlying call to port_create(3c). func NewEventPort() (*EventPort, error) { port, err := port_create() if err != nil { return nil, err } e := &EventPort{ port: port, fds: make(map[uintptr]*fileObjCookie), paths: make(map[string]*fileObjCookie), cookies: make(map[*fileObjCookie]struct{}), } return e, nil } //sys port_create() (n int, err error) //sys port_associate(port int, source int, object uintptr, events int, user *byte) (n int, err error) //sys port_dissociate(port int, source int, object uintptr) (n int, err error) //sys port_get(port int, pe *portEvent, timeout *Timespec) (n int, err error) //sys port_getn(port int, pe *portEvent, max uint32, nget *uint32, timeout *Timespec) (n int, err error) // Close closes the event port. func (e *EventPort) Close() error { e.mu.Lock() defer e.mu.Unlock() err := Close(e.port) if err != nil { return err } e.fds = nil e.paths = nil e.cookies = nil return nil } // PathIsWatched checks to see if path is associated with this EventPort. func (e *EventPort) PathIsWatched(path string) bool { e.mu.Lock() defer e.mu.Unlock() _, found := e.paths[path] return found } // FdIsWatched checks to see if fd is associated with this EventPort. func (e *EventPort) FdIsWatched(fd uintptr) bool { e.mu.Lock() defer e.mu.Unlock() _, found := e.fds[fd] return found } // AssociatePath wraps port_associate(3c) for a filesystem path including // creating the necessary file_obj from the provided stat information. func (e *EventPort) AssociatePath(path string, stat os.FileInfo, events int, cookie interface{}) error { e.mu.Lock() defer e.mu.Unlock() if _, found := e.paths[path]; found { return fmt.Errorf("%v is already associated with this Event Port", path) } fCookie, err := createFileObjCookie(path, stat, cookie) if err != nil { return err } _, err = port_associate(e.port, PORT_SOURCE_FILE, uintptr(unsafe.Pointer(fCookie.fobj)), events, (*byte)(unsafe.Pointer(fCookie))) if err != nil { return err } e.paths[path] = fCookie e.cookies[fCookie] = struct{}{} return nil } // DissociatePath wraps port_dissociate(3c) for a filesystem path. func (e *EventPort) DissociatePath(path string) error { e.mu.Lock() defer e.mu.Unlock() f, ok := e.paths[path] if !ok { return fmt.Errorf("%v is not associated with this Event Port", path) } _, err := port_dissociate(e.port, PORT_SOURCE_FILE, uintptr(unsafe.Pointer(f.fobj))) // If the path is no longer associated with this event port (ENOENT) // we should delete it from our map. We can still return ENOENT to the caller. // But we need to save the cookie if err != nil && err != ENOENT { return err } if err == nil { // dissociate was successful, safe to delete the cookie fCookie := e.paths[path] delete(e.cookies, fCookie) } delete(e.paths, path) return err } // AssociateFd wraps calls to port_associate(3c) on file descriptors. func (e *EventPort) AssociateFd(fd uintptr, events int, cookie interface{}) error { e.mu.Lock() defer e.mu.Unlock() if _, found := e.fds[fd]; found { return fmt.Errorf("%v is already associated with this Event Port", fd) } fCookie, err := createFileObjCookie("", nil, cookie) if err != nil { return err } _, err = port_associate(e.port, PORT_SOURCE_FD, fd, events, (*byte)(unsafe.Pointer(fCookie))) if err != nil { return err } e.fds[fd] = fCookie e.cookies[fCookie] = struct{}{} return nil } // DissociateFd wraps calls to port_dissociate(3c) on file descriptors. func (e *EventPort) DissociateFd(fd uintptr) error { e.mu.Lock() defer e.mu.Unlock() _, ok := e.fds[fd] if !ok { return fmt.Errorf("%v is not associated with this Event Port", fd) } _, err := port_dissociate(e.port, PORT_SOURCE_FD, fd) if err != nil && err != ENOENT { return err } if err == nil { // dissociate was successful, safe to delete the cookie fCookie := e.fds[fd] delete(e.cookies, fCookie) } delete(e.fds, fd) return err } func createFileObjCookie(name string, stat os.FileInfo, cookie interface{}) (*fileObjCookie, error) { fCookie := new(fileObjCookie) fCookie.cookie = cookie if name != "" && stat != nil { fCookie.fobj = new(fileObj) bs, err := ByteSliceFromString(name) if err != nil { return nil, err } fCookie.fobj.Name = (*int8)(unsafe.Pointer(&bs[0])) s := stat.Sys().(*syscall.Stat_t) fCookie.fobj.Atim.Sec = s.Atim.Sec fCookie.fobj.Atim.Nsec = s.Atim.Nsec fCookie.fobj.Mtim.Sec = s.Mtim.Sec fCookie.fobj.Mtim.Nsec = s.Mtim.Nsec fCookie.fobj.Ctim.Sec = s.Ctim.Sec fCookie.fobj.Ctim.Nsec = s.Ctim.Nsec } return fCookie, nil } // GetOne wraps port_get(3c) and returns a single PortEvent. func (e *EventPort) GetOne(t *Timespec) (*PortEvent, error) { pe := new(portEvent) _, err := port_get(e.port, pe, t) if err != nil { return nil, err } p := new(PortEvent) e.mu.Lock() defer e.mu.Unlock() err = e.peIntToExt(pe, p) if err != nil { return nil, err } return p, nil } // peIntToExt converts a cgo portEvent struct into the friendlier PortEvent // NOTE: Always call this function while holding the e.mu mutex func (e *EventPort) peIntToExt(peInt *portEvent, peExt *PortEvent) error { if e.cookies == nil { return fmt.Errorf("this EventPort is already closed") } peExt.Events = peInt.Events peExt.Source = peInt.Source fCookie := (*fileObjCookie)(unsafe.Pointer(peInt.User)) _, found := e.cookies[fCookie] if !found { panic("unexpected event port address; may be due to kernel bug; see https://go.dev/issue/54254") } peExt.Cookie = fCookie.cookie delete(e.cookies, fCookie) switch peInt.Source { case PORT_SOURCE_FD: peExt.Fd = uintptr(peInt.Object) // Only remove the fds entry if it exists and this cookie matches if fobj, ok := e.fds[peExt.Fd]; ok { if fobj == fCookie { delete(e.fds, peExt.Fd) } } case PORT_SOURCE_FILE: peExt.fobj = fCookie.fobj peExt.Path = BytePtrToString((*byte)(unsafe.Pointer(peExt.fobj.Name))) // Only remove the paths entry if it exists and this cookie matches if fobj, ok := e.paths[peExt.Path]; ok { if fobj == fCookie { delete(e.paths, peExt.Path) } } } return nil } // Pending wraps port_getn(3c) and returns how many events are pending. func (e *EventPort) Pending() (int, error) { var n uint32 = 0 _, err := port_getn(e.port, nil, 0, &n, nil) return int(n), err } // Get wraps port_getn(3c) and fills a slice of PortEvent. // It will block until either min events have been received // or the timeout has been exceeded. It will return how many // events were actually received along with any error information. func (e *EventPort) Get(s []PortEvent, min int, timeout *Timespec) (int, error) { if min == 0 { return 0, fmt.Errorf("need to request at least one event or use Pending() instead") } if len(s) < min { return 0, fmt.Errorf("len(s) (%d) is less than min events requested (%d)", len(s), min) } got := uint32(min) max := uint32(len(s)) var err error ps := make([]portEvent, max) _, err = port_getn(e.port, &ps[0], max, &got, timeout) // got will be trustworthy with ETIME, but not any other error. if err != nil && err != ETIME { return 0, err } e.mu.Lock() defer e.mu.Unlock() valid := 0 for i := 0; i < int(got); i++ { err2 := e.peIntToExt(&ps[i], &s[i]) if err2 != nil { if valid == 0 && err == nil { // If err2 is the only error and there are no valid events // to return, return it to the caller. err = err2 } break } valid = i + 1 } return valid, err } //sys putmsg(fd int, clptr *strbuf, dataptr *strbuf, flags int) (err error) func Putmsg(fd int, cl []byte, data []byte, flags int) (err error) { var clp, datap *strbuf if len(cl) > 0 { clp = &strbuf{ Len: int32(len(cl)), Buf: (*int8)(unsafe.Pointer(&cl[0])), } } if len(data) > 0 { datap = &strbuf{ Len: int32(len(data)), Buf: (*int8)(unsafe.Pointer(&data[0])), } } return putmsg(fd, clp, datap, flags) } //sys getmsg(fd int, clptr *strbuf, dataptr *strbuf, flags *int) (err error) func Getmsg(fd int, cl []byte, data []byte) (retCl []byte, retData []byte, flags int, err error) { var clp, datap *strbuf if len(cl) > 0 { clp = &strbuf{ Maxlen: int32(len(cl)), Buf: (*int8)(unsafe.Pointer(&cl[0])), } } if len(data) > 0 { datap = &strbuf{ Maxlen: int32(len(data)), Buf: (*int8)(unsafe.Pointer(&data[0])), } } if err = getmsg(fd, clp, datap, &flags); err != nil { return nil, nil, 0, err } if len(cl) > 0 { retCl = cl[:clp.Len] } if len(data) > 0 { retData = data[:datap.Len] } return retCl, retData, flags, nil } func IoctlSetIntRetInt(fd int, req int, arg int) (int, error) { return ioctlRet(fd, req, uintptr(arg)) } // Lifreq Helpers func (l *Lifreq) SetName(name string) error { if len(name) >= len(l.Name) { return fmt.Errorf("name cannot be more than %d characters", len(l.Name)-1) } for i := range name { l.Name[i] = int8(name[i]) } return nil } func (l *Lifreq) SetLifruInt(d int) { *(*int)(unsafe.Pointer(&l.Lifru[0])) = d } func (l *Lifreq) GetLifruInt() int { return *(*int)(unsafe.Pointer(&l.Lifru[0])) } func (l *Lifreq) SetLifruUint(d uint) { *(*uint)(unsafe.Pointer(&l.Lifru[0])) = d } func (l *Lifreq) GetLifruUint() uint { return *(*uint)(unsafe.Pointer(&l.Lifru[0])) } func IoctlLifreq(fd int, req int, l *Lifreq) error { return ioctlPtr(fd, req, unsafe.Pointer(l)) } // Strioctl Helpers func (s *Strioctl) SetInt(i int) { s.Len = int32(unsafe.Sizeof(i)) s.Dp = (*int8)(unsafe.Pointer(&i)) } func IoctlSetStrioctlRetInt(fd int, req int, s *Strioctl) (int, error) { return ioctlPtrRet(fd, req, unsafe.Pointer(s)) } // Ucred Helpers // See ucred(3c) and getpeerucred(3c) //sys getpeerucred(fd uintptr, ucred *uintptr) (err error) //sys ucredFree(ucred uintptr) = ucred_free //sys ucredGet(pid int) (ucred uintptr, err error) = ucred_get //sys ucredGeteuid(ucred uintptr) (uid int) = ucred_geteuid //sys ucredGetegid(ucred uintptr) (gid int) = ucred_getegid //sys ucredGetruid(ucred uintptr) (uid int) = ucred_getruid //sys ucredGetrgid(ucred uintptr) (gid int) = ucred_getrgid //sys ucredGetsuid(ucred uintptr) (uid int) = ucred_getsuid //sys ucredGetsgid(ucred uintptr) (gid int) = ucred_getsgid //sys ucredGetpid(ucred uintptr) (pid int) = ucred_getpid // Ucred is an opaque struct that holds user credentials. type Ucred struct { ucred uintptr } // We need to ensure that ucredFree is called on the underlying ucred // when the Ucred is garbage collected. func ucredFinalizer(u *Ucred) { ucredFree(u.ucred) } func GetPeerUcred(fd uintptr) (*Ucred, error) { var ucred uintptr err := getpeerucred(fd, &ucred) if err != nil { return nil, err } result := &Ucred{ ucred: ucred, } // set the finalizer on the result so that the ucred will be freed runtime.SetFinalizer(result, ucredFinalizer) return result, nil } func UcredGet(pid int) (*Ucred, error) { ucred, err := ucredGet(pid) if err != nil { return nil, err } result := &Ucred{ ucred: ucred, } // set the finalizer on the result so that the ucred will be freed runtime.SetFinalizer(result, ucredFinalizer) return result, nil } func (u *Ucred) Geteuid() int { defer runtime.KeepAlive(u) return ucredGeteuid(u.ucred) } func (u *Ucred) Getruid() int { defer runtime.KeepAlive(u) return ucredGetruid(u.ucred) } func (u *Ucred) Getsuid() int { defer runtime.KeepAlive(u) return ucredGetsuid(u.ucred) } func (u *Ucred) Getegid() int { defer runtime.KeepAlive(u) return ucredGetegid(u.ucred) } func (u *Ucred) Getrgid() int { defer runtime.KeepAlive(u) return ucredGetrgid(u.ucred) } func (u *Ucred) Getsgid() int { defer runtime.KeepAlive(u) return ucredGetsgid(u.ucred) } func (u *Ucred) Getpid() int { defer runtime.KeepAlive(u) return ucredGetpid(u.ucred) } ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go ================================================ // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build amd64 && solaris package unix func setTimespec(sec, nsec int64) Timespec { return Timespec{Sec: sec, Nsec: nsec} } func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: sec, Usec: usec} } func (iov *Iovec) SetLen(length int) { iov.Len = uint64(length) } func (msghdr *Msghdr) SetIovlen(length int) { msghdr.Iovlen = int32(length) } func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint32(length) } ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_unix.go ================================================ // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris package unix import ( "bytes" "sort" "sync" "syscall" "unsafe" ) var ( Stdin = 0 Stdout = 1 Stderr = 2 ) // Do the interface allocations only once for common // Errno values. var ( errEAGAIN error = syscall.EAGAIN errEINVAL error = syscall.EINVAL errENOENT error = syscall.ENOENT ) var ( signalNameMapOnce sync.Once signalNameMap map[string]syscall.Signal ) // errnoErr returns common boxed Errno values, to prevent // allocations at runtime. func errnoErr(e syscall.Errno) error { switch e { case 0: return nil case EAGAIN: return errEAGAIN case EINVAL: return errEINVAL case ENOENT: return errENOENT } return e } // ErrnoName returns the error name for error number e. func ErrnoName(e syscall.Errno) string { i := sort.Search(len(errorList), func(i int) bool { return errorList[i].num >= e }) if i < len(errorList) && errorList[i].num == e { return errorList[i].name } return "" } // SignalName returns the signal name for signal number s. func SignalName(s syscall.Signal) string { i := sort.Search(len(signalList), func(i int) bool { return signalList[i].num >= s }) if i < len(signalList) && signalList[i].num == s { return signalList[i].name } return "" } // SignalNum returns the syscall.Signal for signal named s, // or 0 if a signal with such name is not found. // The signal name should start with "SIG". func SignalNum(s string) syscall.Signal { signalNameMapOnce.Do(func() { signalNameMap = make(map[string]syscall.Signal, len(signalList)) for _, signal := range signalList { signalNameMap[signal.name] = signal.num } }) return signalNameMap[s] } // clen returns the index of the first NULL byte in n or len(n) if n contains no NULL byte. func clen(n []byte) int { i := bytes.IndexByte(n, 0) if i == -1 { i = len(n) } return i } // Mmap manager, for use by operating system-specific implementations. type mmapper struct { sync.Mutex active map[*byte][]byte // active mappings; key is last byte in mapping mmap func(addr, length uintptr, prot, flags, fd int, offset int64) (uintptr, error) munmap func(addr uintptr, length uintptr) error } func (m *mmapper) Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error) { if length <= 0 { return nil, EINVAL } // Map the requested memory. addr, errno := m.mmap(0, uintptr(length), prot, flags, fd, offset) if errno != nil { return nil, errno } // Use unsafe to convert addr into a []byte. b := unsafe.Slice((*byte)(unsafe.Pointer(addr)), length) // Register mapping in m and return it. p := &b[cap(b)-1] m.Lock() defer m.Unlock() m.active[p] = b return b, nil } func (m *mmapper) Munmap(data []byte) (err error) { if len(data) == 0 || len(data) != cap(data) { return EINVAL } // Find the base of the mapping. p := &data[cap(data)-1] m.Lock() defer m.Unlock() b := m.active[p] if b == nil || &b[0] != &data[0] { return EINVAL } // Unmap the memory and update m. if errno := m.munmap(uintptr(unsafe.Pointer(&b[0])), uintptr(len(b))); errno != nil { return errno } delete(m.active, p) return nil } func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error) { return mapper.Mmap(fd, offset, length, prot, flags) } func Munmap(b []byte) (err error) { return mapper.Munmap(b) } func MmapPtr(fd int, offset int64, addr unsafe.Pointer, length uintptr, prot int, flags int) (ret unsafe.Pointer, err error) { xaddr, err := mapper.mmap(uintptr(addr), length, prot, flags, fd, offset) return unsafe.Pointer(xaddr), err } func MunmapPtr(addr unsafe.Pointer, length uintptr) (err error) { return mapper.munmap(uintptr(addr), length) } func Read(fd int, p []byte) (n int, err error) { n, err = read(fd, p) if raceenabled { if n > 0 { raceWriteRange(unsafe.Pointer(&p[0]), n) } if err == nil { raceAcquire(unsafe.Pointer(&ioSync)) } } return } func Write(fd int, p []byte) (n int, err error) { if raceenabled { raceReleaseMerge(unsafe.Pointer(&ioSync)) } n, err = write(fd, p) if raceenabled && n > 0 { raceReadRange(unsafe.Pointer(&p[0]), n) } return } func Pread(fd int, p []byte, offset int64) (n int, err error) { n, err = pread(fd, p, offset) if raceenabled { if n > 0 { raceWriteRange(unsafe.Pointer(&p[0]), n) } if err == nil { raceAcquire(unsafe.Pointer(&ioSync)) } } return } func Pwrite(fd int, p []byte, offset int64) (n int, err error) { if raceenabled { raceReleaseMerge(unsafe.Pointer(&ioSync)) } n, err = pwrite(fd, p, offset) if raceenabled && n > 0 { raceReadRange(unsafe.Pointer(&p[0]), n) } return } // For testing: clients can set this flag to force // creation of IPv6 sockets to return EAFNOSUPPORT. var SocketDisableIPv6 bool // Sockaddr represents a socket address. type Sockaddr interface { sockaddr() (ptr unsafe.Pointer, len _Socklen, err error) // lowercase; only we can define Sockaddrs } // SockaddrInet4 implements the Sockaddr interface for AF_INET type sockets. type SockaddrInet4 struct { Port int Addr [4]byte raw RawSockaddrInet4 } // SockaddrInet6 implements the Sockaddr interface for AF_INET6 type sockets. type SockaddrInet6 struct { Port int ZoneId uint32 Addr [16]byte raw RawSockaddrInet6 } // SockaddrUnix implements the Sockaddr interface for AF_UNIX type sockets. type SockaddrUnix struct { Name string raw RawSockaddrUnix } func Bind(fd int, sa Sockaddr) (err error) { ptr, n, err := sa.sockaddr() if err != nil { return err } return bind(fd, ptr, n) } func Connect(fd int, sa Sockaddr) (err error) { ptr, n, err := sa.sockaddr() if err != nil { return err } return connect(fd, ptr, n) } func Getpeername(fd int) (sa Sockaddr, err error) { var rsa RawSockaddrAny var len _Socklen = SizeofSockaddrAny if err = getpeername(fd, &rsa, &len); err != nil { return } return anyToSockaddr(fd, &rsa) } func GetsockoptByte(fd, level, opt int) (value byte, err error) { var n byte vallen := _Socklen(1) err = getsockopt(fd, level, opt, unsafe.Pointer(&n), &vallen) return n, err } func GetsockoptInt(fd, level, opt int) (value int, err error) { var n int32 vallen := _Socklen(4) err = getsockopt(fd, level, opt, unsafe.Pointer(&n), &vallen) return int(n), err } func GetsockoptInet4Addr(fd, level, opt int) (value [4]byte, err error) { vallen := _Socklen(4) err = getsockopt(fd, level, opt, unsafe.Pointer(&value[0]), &vallen) return value, err } func GetsockoptIPMreq(fd, level, opt int) (*IPMreq, error) { var value IPMreq vallen := _Socklen(SizeofIPMreq) err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen) return &value, err } func GetsockoptIPv6Mreq(fd, level, opt int) (*IPv6Mreq, error) { var value IPv6Mreq vallen := _Socklen(SizeofIPv6Mreq) err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen) return &value, err } func GetsockoptIPv6MTUInfo(fd, level, opt int) (*IPv6MTUInfo, error) { var value IPv6MTUInfo vallen := _Socklen(SizeofIPv6MTUInfo) err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen) return &value, err } func GetsockoptICMPv6Filter(fd, level, opt int) (*ICMPv6Filter, error) { var value ICMPv6Filter vallen := _Socklen(SizeofICMPv6Filter) err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen) return &value, err } func GetsockoptLinger(fd, level, opt int) (*Linger, error) { var linger Linger vallen := _Socklen(SizeofLinger) err := getsockopt(fd, level, opt, unsafe.Pointer(&linger), &vallen) return &linger, err } func GetsockoptTimeval(fd, level, opt int) (*Timeval, error) { var tv Timeval vallen := _Socklen(unsafe.Sizeof(tv)) err := getsockopt(fd, level, opt, unsafe.Pointer(&tv), &vallen) return &tv, err } func GetsockoptUint64(fd, level, opt int) (value uint64, err error) { var n uint64 vallen := _Socklen(8) err = getsockopt(fd, level, opt, unsafe.Pointer(&n), &vallen) return n, err } func Recvfrom(fd int, p []byte, flags int) (n int, from Sockaddr, err error) { var rsa RawSockaddrAny var len _Socklen = SizeofSockaddrAny if n, err = recvfrom(fd, p, flags, &rsa, &len); err != nil { return } if rsa.Addr.Family != AF_UNSPEC { from, err = anyToSockaddr(fd, &rsa) } return } // Recvmsg receives a message from a socket using the recvmsg system call. The // received non-control data will be written to p, and any "out of band" // control data will be written to oob. The flags are passed to recvmsg. // // The results are: // - n is the number of non-control data bytes read into p // - oobn is the number of control data bytes read into oob; this may be interpreted using [ParseSocketControlMessage] // - recvflags is flags returned by recvmsg // - from is the address of the sender // // If the underlying socket type is not SOCK_DGRAM, a received message // containing oob data and a single '\0' of non-control data is treated as if // the message contained only control data, i.e. n will be zero on return. func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) { var iov [1]Iovec if len(p) > 0 { iov[0].Base = &p[0] iov[0].SetLen(len(p)) } var rsa RawSockaddrAny if n, oobn, recvflags, err = recvmsgRaw(fd, iov[:], oob, flags, &rsa); err != nil { return } // source address is only specified if the socket is unconnected if rsa.Addr.Family != AF_UNSPEC { from, err = anyToSockaddr(fd, &rsa) } return } // RecvmsgBuffers receives a message from a socket using the recvmsg system // call. This function is equivalent to Recvmsg, but non-control data read is // scattered into the buffers slices. func RecvmsgBuffers(fd int, buffers [][]byte, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) { iov := make([]Iovec, len(buffers)) for i := range buffers { if len(buffers[i]) > 0 { iov[i].Base = &buffers[i][0] iov[i].SetLen(len(buffers[i])) } else { iov[i].Base = (*byte)(unsafe.Pointer(&_zero)) } } var rsa RawSockaddrAny if n, oobn, recvflags, err = recvmsgRaw(fd, iov, oob, flags, &rsa); err != nil { return } if rsa.Addr.Family != AF_UNSPEC { from, err = anyToSockaddr(fd, &rsa) } return } // Sendmsg sends a message on a socket to an address using the sendmsg system // call. This function is equivalent to SendmsgN, but does not return the // number of bytes actually sent. func Sendmsg(fd int, p, oob []byte, to Sockaddr, flags int) (err error) { _, err = SendmsgN(fd, p, oob, to, flags) return } // SendmsgN sends a message on a socket to an address using the sendmsg system // call. p contains the non-control data to send, and oob contains the "out of // band" control data. The flags are passed to sendmsg. The number of // non-control bytes actually written to the socket is returned. // // Some socket types do not support sending control data without accompanying // non-control data. If p is empty, and oob contains control data, and the // underlying socket type is not SOCK_DGRAM, p will be treated as containing a // single '\0' and the return value will indicate zero bytes sent. // // The Go function Recvmsg, if called with an empty p and a non-empty oob, // will read and ignore this additional '\0'. If the message is received by // code that does not use Recvmsg, or that does not use Go at all, that code // will need to be written to expect and ignore the additional '\0'. // // If you need to send non-empty oob with p actually empty, and if the // underlying socket type supports it, you can do so via a raw system call as // follows: // // msg := &unix.Msghdr{ // Control: &oob[0], // } // msg.SetControllen(len(oob)) // n, _, errno := unix.Syscall(unix.SYS_SENDMSG, uintptr(fd), uintptr(unsafe.Pointer(msg)), flags) func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error) { var iov [1]Iovec if len(p) > 0 { iov[0].Base = &p[0] iov[0].SetLen(len(p)) } var ptr unsafe.Pointer var salen _Socklen if to != nil { ptr, salen, err = to.sockaddr() if err != nil { return 0, err } } return sendmsgN(fd, iov[:], oob, ptr, salen, flags) } // SendmsgBuffers sends a message on a socket to an address using the sendmsg // system call. This function is equivalent to SendmsgN, but the non-control // data is gathered from buffers. func SendmsgBuffers(fd int, buffers [][]byte, oob []byte, to Sockaddr, flags int) (n int, err error) { iov := make([]Iovec, len(buffers)) for i := range buffers { if len(buffers[i]) > 0 { iov[i].Base = &buffers[i][0] iov[i].SetLen(len(buffers[i])) } else { iov[i].Base = (*byte)(unsafe.Pointer(&_zero)) } } var ptr unsafe.Pointer var salen _Socklen if to != nil { ptr, salen, err = to.sockaddr() if err != nil { return 0, err } } return sendmsgN(fd, iov, oob, ptr, salen, flags) } func Send(s int, buf []byte, flags int) (err error) { return sendto(s, buf, flags, nil, 0) } func Sendto(fd int, p []byte, flags int, to Sockaddr) (err error) { var ptr unsafe.Pointer var salen _Socklen if to != nil { ptr, salen, err = to.sockaddr() if err != nil { return err } } return sendto(fd, p, flags, ptr, salen) } func SetsockoptByte(fd, level, opt int, value byte) (err error) { return setsockopt(fd, level, opt, unsafe.Pointer(&value), 1) } func SetsockoptInt(fd, level, opt int, value int) (err error) { var n = int32(value) return setsockopt(fd, level, opt, unsafe.Pointer(&n), 4) } func SetsockoptInet4Addr(fd, level, opt int, value [4]byte) (err error) { return setsockopt(fd, level, opt, unsafe.Pointer(&value[0]), 4) } func SetsockoptIPMreq(fd, level, opt int, mreq *IPMreq) (err error) { return setsockopt(fd, level, opt, unsafe.Pointer(mreq), SizeofIPMreq) } func SetsockoptIPv6Mreq(fd, level, opt int, mreq *IPv6Mreq) (err error) { return setsockopt(fd, level, opt, unsafe.Pointer(mreq), SizeofIPv6Mreq) } func SetsockoptICMPv6Filter(fd, level, opt int, filter *ICMPv6Filter) error { return setsockopt(fd, level, opt, unsafe.Pointer(filter), SizeofICMPv6Filter) } func SetsockoptLinger(fd, level, opt int, l *Linger) (err error) { return setsockopt(fd, level, opt, unsafe.Pointer(l), SizeofLinger) } func SetsockoptString(fd, level, opt int, s string) (err error) { var p unsafe.Pointer if len(s) > 0 { p = unsafe.Pointer(&[]byte(s)[0]) } return setsockopt(fd, level, opt, p, uintptr(len(s))) } func SetsockoptTimeval(fd, level, opt int, tv *Timeval) (err error) { return setsockopt(fd, level, opt, unsafe.Pointer(tv), unsafe.Sizeof(*tv)) } func SetsockoptUint64(fd, level, opt int, value uint64) (err error) { return setsockopt(fd, level, opt, unsafe.Pointer(&value), 8) } func Socket(domain, typ, proto int) (fd int, err error) { if domain == AF_INET6 && SocketDisableIPv6 { return -1, EAFNOSUPPORT } fd, err = socket(domain, typ, proto) return } func Socketpair(domain, typ, proto int) (fd [2]int, err error) { var fdx [2]int32 err = socketpair(domain, typ, proto, &fdx) if err == nil { fd[0] = int(fdx[0]) fd[1] = int(fdx[1]) } return } var ioSync int64 func CloseOnExec(fd int) { fcntl(fd, F_SETFD, FD_CLOEXEC) } func SetNonblock(fd int, nonblocking bool) (err error) { flag, err := fcntl(fd, F_GETFL, 0) if err != nil { return err } if (flag&O_NONBLOCK != 0) == nonblocking { return nil } if nonblocking { flag |= O_NONBLOCK } else { flag &= ^O_NONBLOCK } _, err = fcntl(fd, F_SETFL, flag) return err } // Exec calls execve(2), which replaces the calling executable in the process // tree. argv0 should be the full path to an executable ("/bin/ls") and the // executable name should also be the first argument in argv (["ls", "-l"]). // envv are the environment variables that should be passed to the new // process (["USER=go", "PWD=/tmp"]). func Exec(argv0 string, argv []string, envv []string) error { return syscall.Exec(argv0, argv, envv) } // Lutimes sets the access and modification times tv on path. If path refers to // a symlink, it is not dereferenced and the timestamps are set on the symlink. // If tv is nil, the access and modification times are set to the current time. // Otherwise tv must contain exactly 2 elements, with access time as the first // element and modification time as the second element. func Lutimes(path string, tv []Timeval) error { if tv == nil { return UtimesNanoAt(AT_FDCWD, path, nil, AT_SYMLINK_NOFOLLOW) } if len(tv) != 2 { return EINVAL } ts := []Timespec{ NsecToTimespec(TimevalToNsec(tv[0])), NsecToTimespec(TimevalToNsec(tv[1])), } return UtimesNanoAt(AT_FDCWD, path, ts, AT_SYMLINK_NOFOLLOW) } // emptyIovecs reports whether there are no bytes in the slice of Iovec. func emptyIovecs(iov []Iovec) bool { for i := range iov { if iov[i].Len > 0 { return false } } return true } // Setrlimit sets a resource limit. func Setrlimit(resource int, rlim *Rlimit) error { // Just call the syscall version, because as of Go 1.21 // it will affect starting a new process. return syscall.Setrlimit(resource, (*syscall.Rlimit)(rlim)) } ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_unix_gc.go ================================================ // Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build (darwin || dragonfly || freebsd || (linux && !ppc64 && !ppc64le) || netbsd || openbsd || solaris) && gc package unix import "syscall" func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build linux && (ppc64le || ppc64) && gc package unix import "syscall" func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { return syscall.Syscall(trap, a1, a2, a3) } func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { return syscall.Syscall6(trap, a1, a2, a3, a4, a5, a6) } func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { return syscall.RawSyscall(trap, a1, a2, a3) } func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { return syscall.RawSyscall6(trap, a1, a2, a3, a4, a5, a6) } ================================================ FILE: vendor/golang.org/x/sys/unix/syscall_zos_s390x.go ================================================ // Copyright 2020 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build zos && s390x // Many of the following syscalls are not available on all versions of z/OS. // Some missing calls have legacy implementations/simulations but others // will be missing completely. To achieve consistent failing behaviour on // legacy systems, we first test the function pointer via a safeloading // mechanism to see if the function exists on a given system. Then execution // is branched to either continue the function call, or return an error. package unix import ( "bytes" "fmt" "os" "reflect" "regexp" "runtime" "sort" "strings" "sync" "syscall" "unsafe" ) //go:noescape func initZosLibVec() //go:noescape func GetZosLibVec() uintptr func init() { initZosLibVec() r0, _, _ := CallLeFuncWithPtrReturn(GetZosLibVec()+SYS_____GETENV_A<<4, uintptr(unsafe.Pointer(&([]byte("__ZOS_XSYSTRACE\x00"))[0]))) if r0 != 0 { n, _, _ := CallLeFuncWithPtrReturn(GetZosLibVec()+SYS___ATOI_A<<4, r0) ZosTraceLevel = int(n) r0, _, _ := CallLeFuncWithPtrReturn(GetZosLibVec()+SYS_____GETENV_A<<4, uintptr(unsafe.Pointer(&([]byte("__ZOS_XSYSTRACEFD\x00"))[0]))) if r0 != 0 { fd, _, _ := CallLeFuncWithPtrReturn(GetZosLibVec()+SYS___ATOI_A<<4, r0) f := os.NewFile(fd, "zostracefile") if f != nil { ZosTracefile = f } } } } //go:noescape func CallLeFuncWithErr(funcdesc uintptr, parms ...uintptr) (ret, errno2 uintptr, err Errno) //go:noescape func CallLeFuncWithPtrReturn(funcdesc uintptr, parms ...uintptr) (ret, errno2 uintptr, err Errno) // ------------------------------- // pointer validity test // good pointer returns 0 // bad pointer returns 1 // //go:nosplit func ptrtest(uintptr) uint64 // Load memory at ptr location with error handling if the location is invalid // //go:noescape func safeload(ptr uintptr) (value uintptr, error uintptr) const ( entrypointLocationOffset = 8 // From function descriptor xplinkEyecatcher = 0x00c300c500c500f1 // ".C.E.E.1" eyecatcherOffset = 16 // From function entrypoint (negative) ppa1LocationOffset = 8 // From function entrypoint (negative) nameLenOffset = 0x14 // From PPA1 start nameOffset = 0x16 // From PPA1 start ) func getPpaOffset(funcptr uintptr) int64 { entrypoint, err := safeload(funcptr + entrypointLocationOffset) if err != 0 { return -1 } // XPLink functions have ".C.E.E.1" as the first 8 bytes (EBCDIC) val, err := safeload(entrypoint - eyecatcherOffset) if err != 0 { return -1 } if val != xplinkEyecatcher { return -1 } ppaoff, err := safeload(entrypoint - ppa1LocationOffset) if err != 0 { return -1 } ppaoff >>= 32 return int64(ppaoff) } //------------------------------- // function descriptor pointer validity test // good pointer returns 0 // bad pointer returns 1 // TODO: currently mksyscall_zos_s390x.go generate empty string for funcName // have correct funcName pass to the funcptrtest function func funcptrtest(funcptr uintptr, funcName string) uint64 { entrypoint, err := safeload(funcptr + entrypointLocationOffset) if err != 0 { return 1 } ppaoff := getPpaOffset(funcptr) if ppaoff == -1 { return 1 } // PPA1 offset value is from the start of the entire function block, not the entrypoint ppa1 := (entrypoint - eyecatcherOffset) + uintptr(ppaoff) nameLen, err := safeload(ppa1 + nameLenOffset) if err != 0 { return 1 } nameLen >>= 48 if nameLen > 128 { return 1 } // no function name input to argument end here if funcName == "" { return 0 } var funcname [128]byte for i := 0; i < int(nameLen); i += 8 { v, err := safeload(ppa1 + nameOffset + uintptr(i)) if err != 0 { return 1 } funcname[i] = byte(v >> 56) funcname[i+1] = byte(v >> 48) funcname[i+2] = byte(v >> 40) funcname[i+3] = byte(v >> 32) funcname[i+4] = byte(v >> 24) funcname[i+5] = byte(v >> 16) funcname[i+6] = byte(v >> 8) funcname[i+7] = byte(v) } runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS___E2A_L<<4, // __e2a_l []uintptr{uintptr(unsafe.Pointer(&funcname[0])), nameLen}) name := string(funcname[:nameLen]) if name != funcName { return 1 } return 0 } // For detection of capabilities on a system. // Is function descriptor f a valid function? func isValidLeFunc(f uintptr) error { ret := funcptrtest(f, "") if ret != 0 { return fmt.Errorf("Bad pointer, not an LE function ") } return nil } // Retrieve function name from descriptor func getLeFuncName(f uintptr) (string, error) { // assume it has been checked, only check ppa1 validity here entry := ((*[2]uintptr)(unsafe.Pointer(f)))[1] preamp := ((*[4]uint32)(unsafe.Pointer(entry - eyecatcherOffset))) offsetPpa1 := preamp[2] if offsetPpa1 > 0x0ffff { return "", fmt.Errorf("PPA1 offset seems too big 0x%x\n", offsetPpa1) } ppa1 := uintptr(unsafe.Pointer(preamp)) + uintptr(offsetPpa1) res := ptrtest(ppa1) if res != 0 { return "", fmt.Errorf("PPA1 address not valid") } size := *(*uint16)(unsafe.Pointer(ppa1 + nameLenOffset)) if size > 128 { return "", fmt.Errorf("Function name seems too long, length=%d\n", size) } var name [128]byte funcname := (*[128]byte)(unsafe.Pointer(ppa1 + nameOffset)) copy(name[0:size], funcname[0:size]) runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS___E2A_L<<4, // __e2a_l []uintptr{uintptr(unsafe.Pointer(&name[0])), uintptr(size)}) return string(name[:size]), nil } // Check z/OS version func zosLeVersion() (version, release uint32) { p1 := (*(*uintptr)(unsafe.Pointer(uintptr(1208)))) >> 32 p1 = *(*uintptr)(unsafe.Pointer(uintptr(p1 + 88))) p1 = *(*uintptr)(unsafe.Pointer(uintptr(p1 + 8))) p1 = *(*uintptr)(unsafe.Pointer(uintptr(p1 + 984))) vrm := *(*uint32)(unsafe.Pointer(p1 + 80)) version = (vrm & 0x00ff0000) >> 16 release = (vrm & 0x0000ff00) >> 8 return } // returns a zos C FILE * for stdio fd 0, 1, 2 func ZosStdioFilep(fd int32) uintptr { return uintptr(*(*uint64)(unsafe.Pointer(uintptr(*(*uint64)(unsafe.Pointer(uintptr(*(*uint64)(unsafe.Pointer(uintptr(uint64(*(*uint32)(unsafe.Pointer(uintptr(1208)))) + 80))) + uint64((fd+2)<<3)))))))) } func copyStat(stat *Stat_t, statLE *Stat_LE_t) { stat.Dev = uint64(statLE.Dev) stat.Ino = uint64(statLE.Ino) stat.Nlink = uint64(statLE.Nlink) stat.Mode = uint32(statLE.Mode) stat.Uid = uint32(statLE.Uid) stat.Gid = uint32(statLE.Gid) stat.Rdev = uint64(statLE.Rdev) stat.Size = statLE.Size stat.Atim.Sec = int64(statLE.Atim) stat.Atim.Nsec = 0 //zos doesn't return nanoseconds stat.Mtim.Sec = int64(statLE.Mtim) stat.Mtim.Nsec = 0 //zos doesn't return nanoseconds stat.Ctim.Sec = int64(statLE.Ctim) stat.Ctim.Nsec = 0 //zos doesn't return nanoseconds stat.Blksize = int64(statLE.Blksize) stat.Blocks = statLE.Blocks } func svcCall(fnptr unsafe.Pointer, argv *unsafe.Pointer, dsa *uint64) func svcLoad(name *byte) unsafe.Pointer func svcUnload(name *byte, fnptr unsafe.Pointer) int64 func (d *Dirent) NameString() string { if d == nil { return "" } s := string(d.Name[:]) idx := strings.IndexByte(s, 0) if idx == -1 { return s } else { return s[:idx] } } func DecodeData(dest []byte, sz int, val uint64) { for i := 0; i < sz; i++ { dest[sz-1-i] = byte((val >> (uint64(i * 8))) & 0xff) } } func EncodeData(data []byte) uint64 { var value uint64 sz := len(data) for i := 0; i < sz; i++ { value |= uint64(data[i]) << uint64(((sz - i - 1) * 8)) } return value } func (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, _Socklen, error) { if sa.Port < 0 || sa.Port > 0xFFFF { return nil, 0, EINVAL } sa.raw.Len = SizeofSockaddrInet4 sa.raw.Family = AF_INET p := (*[2]byte)(unsafe.Pointer(&sa.raw.Port)) p[0] = byte(sa.Port >> 8) p[1] = byte(sa.Port) for i := 0; i < len(sa.Addr); i++ { sa.raw.Addr[i] = sa.Addr[i] } return unsafe.Pointer(&sa.raw), _Socklen(sa.raw.Len), nil } func (sa *SockaddrInet6) sockaddr() (unsafe.Pointer, _Socklen, error) { if sa.Port < 0 || sa.Port > 0xFFFF { return nil, 0, EINVAL } sa.raw.Len = SizeofSockaddrInet6 sa.raw.Family = AF_INET6 p := (*[2]byte)(unsafe.Pointer(&sa.raw.Port)) p[0] = byte(sa.Port >> 8) p[1] = byte(sa.Port) sa.raw.Scope_id = sa.ZoneId for i := 0; i < len(sa.Addr); i++ { sa.raw.Addr[i] = sa.Addr[i] } return unsafe.Pointer(&sa.raw), _Socklen(sa.raw.Len), nil } func (sa *SockaddrUnix) sockaddr() (unsafe.Pointer, _Socklen, error) { name := sa.Name n := len(name) if n >= len(sa.raw.Path) || n == 0 { return nil, 0, EINVAL } sa.raw.Len = byte(3 + n) // 2 for Family, Len; 1 for NUL sa.raw.Family = AF_UNIX for i := 0; i < n; i++ { sa.raw.Path[i] = int8(name[i]) } return unsafe.Pointer(&sa.raw), _Socklen(sa.raw.Len), nil } func anyToSockaddr(_ int, rsa *RawSockaddrAny) (Sockaddr, error) { // TODO(neeilan): Implement use of first param (fd) switch rsa.Addr.Family { case AF_UNIX: pp := (*RawSockaddrUnix)(unsafe.Pointer(rsa)) sa := new(SockaddrUnix) // For z/OS, only replace NUL with @ when the // length is not zero. if pp.Len != 0 && pp.Path[0] == 0 { // "Abstract" Unix domain socket. // Rewrite leading NUL as @ for textual display. // (This is the standard convention.) // Not friendly to overwrite in place, // but the callers below don't care. pp.Path[0] = '@' } // Assume path ends at NUL. // // For z/OS, the length of the name is a field // in the structure. To be on the safe side, we // will still scan the name for a NUL but only // to the length provided in the structure. // // This is not technically the Linux semantics for // abstract Unix domain sockets--they are supposed // to be uninterpreted fixed-size binary blobs--but // everyone uses this convention. n := 0 for n < int(pp.Len) && pp.Path[n] != 0 { n++ } sa.Name = string(unsafe.Slice((*byte)(unsafe.Pointer(&pp.Path[0])), n)) return sa, nil case AF_INET: pp := (*RawSockaddrInet4)(unsafe.Pointer(rsa)) sa := new(SockaddrInet4) p := (*[2]byte)(unsafe.Pointer(&pp.Port)) sa.Port = int(p[0])<<8 + int(p[1]) for i := 0; i < len(sa.Addr); i++ { sa.Addr[i] = pp.Addr[i] } return sa, nil case AF_INET6: pp := (*RawSockaddrInet6)(unsafe.Pointer(rsa)) sa := new(SockaddrInet6) p := (*[2]byte)(unsafe.Pointer(&pp.Port)) sa.Port = int(p[0])<<8 + int(p[1]) sa.ZoneId = pp.Scope_id for i := 0; i < len(sa.Addr); i++ { sa.Addr[i] = pp.Addr[i] } return sa, nil } return nil, EAFNOSUPPORT } func Accept(fd int) (nfd int, sa Sockaddr, err error) { var rsa RawSockaddrAny var len _Socklen = SizeofSockaddrAny nfd, err = accept(fd, &rsa, &len) if err != nil { return } // TODO(neeilan): Remove 0 in call sa, err = anyToSockaddr(0, &rsa) if err != nil { Close(nfd) nfd = 0 } return } func Accept4(fd int, flags int) (nfd int, sa Sockaddr, err error) { var rsa RawSockaddrAny var len _Socklen = SizeofSockaddrAny nfd, err = accept4(fd, &rsa, &len, flags) if err != nil { return } if len > SizeofSockaddrAny { panic("RawSockaddrAny too small") } // TODO(neeilan): Remove 0 in call sa, err = anyToSockaddr(0, &rsa) if err != nil { Close(nfd) nfd = 0 } return } func Ctermid() (tty string, err error) { var termdev [1025]byte runtime.EnterSyscall() r0, err2, err1 := CallLeFuncWithPtrReturn(GetZosLibVec()+SYS___CTERMID_A<<4, uintptr(unsafe.Pointer(&termdev[0]))) runtime.ExitSyscall() if r0 == 0 { return "", fmt.Errorf("%s (errno2=0x%x)\n", err1.Error(), err2) } s := string(termdev[:]) idx := strings.Index(s, string(rune(0))) if idx == -1 { tty = s } else { tty = s[:idx] } return } func (iov *Iovec) SetLen(length int) { iov.Len = uint64(length) } func (msghdr *Msghdr) SetControllen(length int) { msghdr.Controllen = int32(length) } func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = int32(length) } //sys fcntl(fd int, cmd int, arg int) (val int, err error) //sys Flistxattr(fd int, dest []byte) (sz int, err error) = SYS___FLISTXATTR_A //sys Fremovexattr(fd int, attr string) (err error) = SYS___FREMOVEXATTR_A //sys read(fd int, p []byte) (n int, err error) //sys write(fd int, p []byte) (n int, err error) //sys Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) = SYS___FGETXATTR_A //sys Fsetxattr(fd int, attr string, data []byte, flag int) (err error) = SYS___FSETXATTR_A //sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) = SYS___ACCEPT_A //sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) = SYS___ACCEPT4_A //sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) = SYS___BIND_A //sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) = SYS___CONNECT_A //sysnb getgroups(n int, list *_Gid_t) (nn int, err error) //sysnb setgroups(n int, list *_Gid_t) (err error) //sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) //sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) //sysnb socket(domain int, typ int, proto int) (fd int, err error) //sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) //sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) = SYS___GETPEERNAME_A //sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) = SYS___GETSOCKNAME_A //sys Removexattr(path string, attr string) (err error) = SYS___REMOVEXATTR_A //sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) = SYS___RECVFROM_A //sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) = SYS___SENDTO_A //sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error) = SYS___RECVMSG_A //sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error) = SYS___SENDMSG_A //sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) = SYS_MMAP //sys munmap(addr uintptr, length uintptr) (err error) = SYS_MUNMAP //sys ioctl(fd int, req int, arg uintptr) (err error) = SYS_IOCTL //sys ioctlPtr(fd int, req int, arg unsafe.Pointer) (err error) = SYS_IOCTL //sys shmat(id int, addr uintptr, flag int) (ret uintptr, err error) = SYS_SHMAT //sys shmctl(id int, cmd int, buf *SysvShmDesc) (result int, err error) = SYS_SHMCTL64 //sys shmdt(addr uintptr) (err error) = SYS_SHMDT //sys shmget(key int, size int, flag int) (id int, err error) = SYS_SHMGET //sys Access(path string, mode uint32) (err error) = SYS___ACCESS_A //sys Chdir(path string) (err error) = SYS___CHDIR_A //sys Chown(path string, uid int, gid int) (err error) = SYS___CHOWN_A //sys Chmod(path string, mode uint32) (err error) = SYS___CHMOD_A //sys Creat(path string, mode uint32) (fd int, err error) = SYS___CREAT_A //sys Dup(oldfd int) (fd int, err error) //sys Dup2(oldfd int, newfd int) (err error) //sys Dup3(oldfd int, newfd int, flags int) (err error) = SYS_DUP3 //sys Dirfd(dirp uintptr) (fd int, err error) = SYS_DIRFD //sys EpollCreate(size int) (fd int, err error) = SYS_EPOLL_CREATE //sys EpollCreate1(flags int) (fd int, err error) = SYS_EPOLL_CREATE1 //sys EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) = SYS_EPOLL_CTL //sys EpollPwait(epfd int, events []EpollEvent, msec int, sigmask *int) (n int, err error) = SYS_EPOLL_PWAIT //sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) = SYS_EPOLL_WAIT //sys Errno2() (er2 int) = SYS___ERRNO2 //sys Eventfd(initval uint, flags int) (fd int, err error) = SYS_EVENTFD //sys Exit(code int) //sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error) = SYS___FACCESSAT_A func Faccessat2(dirfd int, path string, mode uint32, flags int) (err error) { return Faccessat(dirfd, path, mode, flags) } //sys Fchdir(fd int) (err error) //sys Fchmod(fd int, mode uint32) (err error) //sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) = SYS___FCHMODAT_A //sys Fchown(fd int, uid int, gid int) (err error) //sys Fchownat(fd int, path string, uid int, gid int, flags int) (err error) = SYS___FCHOWNAT_A //sys FcntlInt(fd uintptr, cmd int, arg int) (retval int, err error) = SYS_FCNTL //sys Fdatasync(fd int) (err error) = SYS_FDATASYNC //sys fstat(fd int, stat *Stat_LE_t) (err error) //sys fstatat(dirfd int, path string, stat *Stat_LE_t, flags int) (err error) = SYS___FSTATAT_A func Fstat(fd int, stat *Stat_t) (err error) { var statLE Stat_LE_t err = fstat(fd, &statLE) copyStat(stat, &statLE) return } func Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) { var statLE Stat_LE_t err = fstatat(dirfd, path, &statLE, flags) copyStat(stat, &statLE) return } func impl_Getxattr(path string, attr string, dest []byte) (sz int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } var _p2 unsafe.Pointer if len(dest) > 0 { _p2 = unsafe.Pointer(&dest[0]) } else { _p2 = unsafe.Pointer(&_zero) } r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___GETXATTR_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest))) sz = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_GetxattrAddr() *(func(path string, attr string, dest []byte) (sz int, err error)) var Getxattr = enter_Getxattr func enter_Getxattr(path string, attr string, dest []byte) (sz int, err error) { funcref := get_GetxattrAddr() if validGetxattr() { *funcref = impl_Getxattr } else { *funcref = error_Getxattr } return (*funcref)(path, attr, dest) } func error_Getxattr(path string, attr string, dest []byte) (sz int, err error) { return -1, ENOSYS } func validGetxattr() bool { if funcptrtest(GetZosLibVec()+SYS___GETXATTR_A<<4, "") == 0 { if name, err := getLeFuncName(GetZosLibVec() + SYS___GETXATTR_A<<4); err == nil { return name == "__getxattr_a" } } return false } //sys Lgetxattr(link string, attr string, dest []byte) (sz int, err error) = SYS___LGETXATTR_A //sys Lsetxattr(path string, attr string, data []byte, flags int) (err error) = SYS___LSETXATTR_A func impl_Setxattr(path string, attr string, data []byte, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } var _p2 unsafe.Pointer if len(data) > 0 { _p2 = unsafe.Pointer(&data[0]) } else { _p2 = unsafe.Pointer(&_zero) } r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___SETXATTR_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags)) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_SetxattrAddr() *(func(path string, attr string, data []byte, flags int) (err error)) var Setxattr = enter_Setxattr func enter_Setxattr(path string, attr string, data []byte, flags int) (err error) { funcref := get_SetxattrAddr() if validSetxattr() { *funcref = impl_Setxattr } else { *funcref = error_Setxattr } return (*funcref)(path, attr, data, flags) } func error_Setxattr(path string, attr string, data []byte, flags int) (err error) { return ENOSYS } func validSetxattr() bool { if funcptrtest(GetZosLibVec()+SYS___SETXATTR_A<<4, "") == 0 { if name, err := getLeFuncName(GetZosLibVec() + SYS___SETXATTR_A<<4); err == nil { return name == "__setxattr_a" } } return false } //sys Fstatfs(fd int, buf *Statfs_t) (err error) = SYS_FSTATFS //sys Fstatvfs(fd int, stat *Statvfs_t) (err error) = SYS_FSTATVFS //sys Fsync(fd int) (err error) //sys Futimes(fd int, tv []Timeval) (err error) = SYS_FUTIMES //sys Futimesat(dirfd int, path string, tv []Timeval) (err error) = SYS___FUTIMESAT_A //sys Ftruncate(fd int, length int64) (err error) //sys Getrandom(buf []byte, flags int) (n int, err error) = SYS_GETRANDOM //sys InotifyInit() (fd int, err error) = SYS_INOTIFY_INIT //sys InotifyInit1(flags int) (fd int, err error) = SYS_INOTIFY_INIT1 //sys InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) = SYS___INOTIFY_ADD_WATCH_A //sys InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) = SYS_INOTIFY_RM_WATCH //sys Listxattr(path string, dest []byte) (sz int, err error) = SYS___LISTXATTR_A //sys Llistxattr(path string, dest []byte) (sz int, err error) = SYS___LLISTXATTR_A //sys Lremovexattr(path string, attr string) (err error) = SYS___LREMOVEXATTR_A //sys Lutimes(path string, tv []Timeval) (err error) = SYS___LUTIMES_A //sys Mprotect(b []byte, prot int) (err error) = SYS_MPROTECT //sys Msync(b []byte, flags int) (err error) = SYS_MSYNC //sys Console2(cmsg *ConsMsg2, modstr *byte, concmd *uint32) (err error) = SYS___CONSOLE2 // Pipe2 begin //go:nosplit func getPipe2Addr() *(func([]int, int) error) var Pipe2 = pipe2Enter func pipe2Enter(p []int, flags int) (err error) { if funcptrtest(GetZosLibVec()+SYS_PIPE2<<4, "") == 0 { *getPipe2Addr() = pipe2Impl } else { *getPipe2Addr() = pipe2Error } return (*getPipe2Addr())(p, flags) } func pipe2Impl(p []int, flags int) (err error) { var pp [2]_C_int r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_PIPE2<<4, uintptr(unsafe.Pointer(&pp[0])), uintptr(flags)) if int64(r0) == -1 { err = errnoErr2(e1, e2) } else { p[0] = int(pp[0]) p[1] = int(pp[1]) } return } func pipe2Error(p []int, flags int) (err error) { return fmt.Errorf("Pipe2 is not available on this system") } // Pipe2 end //sys Poll(fds []PollFd, timeout int) (n int, err error) = SYS_POLL func Readdir(dir uintptr) (dirent *Dirent, err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___READDIR_A<<4, uintptr(dir)) runtime.ExitSyscall() dirent = (*Dirent)(unsafe.Pointer(r0)) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //sys Readdir_r(dirp uintptr, entry *direntLE, result **direntLE) (err error) = SYS___READDIR_R_A //sys Statfs(path string, buf *Statfs_t) (err error) = SYS___STATFS_A //sys Syncfs(fd int) (err error) = SYS_SYNCFS //sys Times(tms *Tms) (ticks uintptr, err error) = SYS_TIMES //sys W_Getmntent(buff *byte, size int) (lastsys int, err error) = SYS_W_GETMNTENT //sys W_Getmntent_A(buff *byte, size int) (lastsys int, err error) = SYS___W_GETMNTENT_A //sys mount_LE(path string, filesystem string, fstype string, mtm uint32, parmlen int32, parm string) (err error) = SYS___MOUNT_A //sys unmount_LE(filesystem string, mtm int) (err error) = SYS___UMOUNT_A //sys Chroot(path string) (err error) = SYS___CHROOT_A //sys Select(nmsgsfds int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (ret int, err error) = SYS_SELECT //sysnb Uname(buf *Utsname) (err error) = SYS_____OSNAME_A //sys Unshare(flags int) (err error) = SYS_UNSHARE func Ptsname(fd int) (name string, err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithPtrReturn(GetZosLibVec()+SYS___PTSNAME_A<<4, uintptr(fd)) runtime.ExitSyscall() if r0 == 0 { err = errnoErr2(e1, e2) } else { name = u2s(unsafe.Pointer(r0)) } return } func u2s(cstr unsafe.Pointer) string { str := (*[1024]uint8)(cstr) i := 0 for str[i] != 0 { i++ } return string(str[:i]) } func Close(fd int) (err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_CLOSE<<4, uintptr(fd)) runtime.ExitSyscall() for i := 0; e1 == EAGAIN && i < 10; i++ { runtime.EnterSyscall() CallLeFuncWithErr(GetZosLibVec()+SYS_USLEEP<<4, uintptr(10)) runtime.ExitSyscall() runtime.EnterSyscall() r0, e2, e1 = CallLeFuncWithErr(GetZosLibVec()+SYS_CLOSE<<4, uintptr(fd)) runtime.ExitSyscall() } if r0 != 0 { err = errnoErr2(e1, e2) } return } // Dummy function: there are no semantics for Madvise on z/OS func Madvise(b []byte, advice int) (err error) { return } func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error) { return mapper.Mmap(fd, offset, length, prot, flags) } func Munmap(b []byte) (err error) { return mapper.Munmap(b) } func MmapPtr(fd int, offset int64, addr unsafe.Pointer, length uintptr, prot int, flags int) (ret unsafe.Pointer, err error) { xaddr, err := mapper.mmap(uintptr(addr), length, prot, flags, fd, offset) return unsafe.Pointer(xaddr), err } func MunmapPtr(addr unsafe.Pointer, length uintptr) (err error) { return mapper.munmap(uintptr(addr), length) } //sys Gethostname(buf []byte) (err error) = SYS___GETHOSTNAME_A //sysnb Getgid() (gid int) //sysnb Getpid() (pid int) //sysnb Getpgid(pid int) (pgid int, err error) = SYS_GETPGID func Getpgrp() (pid int) { pid, _ = Getpgid(0) return } //sysnb Getppid() (pid int) //sys Getpriority(which int, who int) (prio int, err error) //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) = SYS_GETRLIMIT //sysnb getrusage(who int, rusage *rusage_zos) (err error) = SYS_GETRUSAGE func Getrusage(who int, rusage *Rusage) (err error) { var ruz rusage_zos err = getrusage(who, &ruz) //Only the first two fields of Rusage are set rusage.Utime.Sec = ruz.Utime.Sec rusage.Utime.Usec = int64(ruz.Utime.Usec) rusage.Stime.Sec = ruz.Stime.Sec rusage.Stime.Usec = int64(ruz.Stime.Usec) return } //sys Getegid() (egid int) = SYS_GETEGID //sys Geteuid() (euid int) = SYS_GETEUID //sysnb Getsid(pid int) (sid int, err error) = SYS_GETSID //sysnb Getuid() (uid int) //sysnb Kill(pid int, sig Signal) (err error) //sys Lchown(path string, uid int, gid int) (err error) = SYS___LCHOWN_A //sys Link(path string, link string) (err error) = SYS___LINK_A //sys Linkat(oldDirFd int, oldPath string, newDirFd int, newPath string, flags int) (err error) = SYS___LINKAT_A //sys Listen(s int, n int) (err error) //sys lstat(path string, stat *Stat_LE_t) (err error) = SYS___LSTAT_A func Lstat(path string, stat *Stat_t) (err error) { var statLE Stat_LE_t err = lstat(path, &statLE) copyStat(stat, &statLE) return } // for checking symlinks begins with $VERSION/ $SYSNAME/ $SYSSYMR/ $SYSSYMA/ func isSpecialPath(path []byte) (v bool) { var special = [4][8]byte{ {'V', 'E', 'R', 'S', 'I', 'O', 'N', '/'}, {'S', 'Y', 'S', 'N', 'A', 'M', 'E', '/'}, {'S', 'Y', 'S', 'S', 'Y', 'M', 'R', '/'}, {'S', 'Y', 'S', 'S', 'Y', 'M', 'A', '/'}} var i, j int for i = 0; i < len(special); i++ { for j = 0; j < len(special[i]); j++ { if path[j] != special[i][j] { break } } if j == len(special[i]) { return true } } return false } func realpath(srcpath string, abspath []byte) (pathlen int, errno int) { var source [1024]byte copy(source[:], srcpath) source[len(srcpath)] = 0 ret := runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS___REALPATH_A<<4, //__realpath_a() []uintptr{uintptr(unsafe.Pointer(&source[0])), uintptr(unsafe.Pointer(&abspath[0]))}) if ret != 0 { index := bytes.IndexByte(abspath[:], byte(0)) if index != -1 { return index, 0 } } else { errptr := (*int)(unsafe.Pointer(runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS___ERRNO<<4, []uintptr{}))) //__errno() return 0, *errptr } return 0, 245 // EBADDATA 245 } func Readlink(path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } n = int(runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS___READLINK_A<<4, []uintptr{uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))})) runtime.KeepAlive(unsafe.Pointer(_p0)) if n == -1 { value := *(*int32)(unsafe.Pointer(runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS___ERRNO<<4, []uintptr{}))) err = errnoErr(Errno(value)) } else { if buf[0] == '$' { if isSpecialPath(buf[1:9]) { cnt, err1 := realpath(path, buf) if err1 == 0 { n = cnt } } } } return } func impl_Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___READLINKAT_A<<4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) runtime.ExitSyscall() n = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) return n, err } else { if buf[0] == '$' { if isSpecialPath(buf[1:9]) { cnt, err1 := realpath(path, buf) if err1 == 0 { n = cnt } } } } return } //go:nosplit func get_ReadlinkatAddr() *(func(dirfd int, path string, buf []byte) (n int, err error)) var Readlinkat = enter_Readlinkat func enter_Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { funcref := get_ReadlinkatAddr() if funcptrtest(GetZosLibVec()+SYS___READLINKAT_A<<4, "") == 0 { *funcref = impl_Readlinkat } else { *funcref = error_Readlinkat } return (*funcref)(dirfd, path, buf) } func error_Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { n = -1 err = ENOSYS return } //sys Mkdir(path string, mode uint32) (err error) = SYS___MKDIR_A //sys Mkdirat(dirfd int, path string, mode uint32) (err error) = SYS___MKDIRAT_A //sys Mkfifo(path string, mode uint32) (err error) = SYS___MKFIFO_A //sys Mknod(path string, mode uint32, dev int) (err error) = SYS___MKNOD_A //sys Mknodat(dirfd int, path string, mode uint32, dev int) (err error) = SYS___MKNODAT_A //sys PivotRoot(newroot string, oldroot string) (err error) = SYS___PIVOT_ROOT_A //sys Pread(fd int, p []byte, offset int64) (n int, err error) //sys Pwrite(fd int, p []byte, offset int64) (n int, err error) //sys Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error) = SYS___PRCTL_A //sysnb Prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) = SYS_PRLIMIT //sys Rename(from string, to string) (err error) = SYS___RENAME_A //sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) = SYS___RENAMEAT_A //sys Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error) = SYS___RENAMEAT2_A //sys Rmdir(path string) (err error) = SYS___RMDIR_A //sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK //sys Setegid(egid int) (err error) = SYS_SETEGID //sys Seteuid(euid int) (err error) = SYS_SETEUID //sys Sethostname(p []byte) (err error) = SYS___SETHOSTNAME_A //sys Setns(fd int, nstype int) (err error) = SYS_SETNS //sys Setpriority(which int, who int, prio int) (err error) //sysnb Setpgid(pid int, pgid int) (err error) = SYS_SETPGID //sysnb Setrlimit(resource int, lim *Rlimit) (err error) //sysnb Setregid(rgid int, egid int) (err error) = SYS_SETREGID //sysnb Setreuid(ruid int, euid int) (err error) = SYS_SETREUID //sysnb Setsid() (pid int, err error) = SYS_SETSID //sys Setuid(uid int) (err error) = SYS_SETUID //sys Setgid(uid int) (err error) = SYS_SETGID //sys Shutdown(fd int, how int) (err error) //sys stat(path string, statLE *Stat_LE_t) (err error) = SYS___STAT_A func Stat(path string, sta *Stat_t) (err error) { var statLE Stat_LE_t err = stat(path, &statLE) copyStat(sta, &statLE) return } //sys Symlink(path string, link string) (err error) = SYS___SYMLINK_A //sys Symlinkat(oldPath string, dirfd int, newPath string) (err error) = SYS___SYMLINKAT_A //sys Sync() = SYS_SYNC //sys Truncate(path string, length int64) (err error) = SYS___TRUNCATE_A //sys Tcgetattr(fildes int, termptr *Termios) (err error) = SYS_TCGETATTR //sys Tcsetattr(fildes int, when int, termptr *Termios) (err error) = SYS_TCSETATTR //sys Umask(mask int) (oldmask int) //sys Unlink(path string) (err error) = SYS___UNLINK_A //sys Unlinkat(dirfd int, path string, flags int) (err error) = SYS___UNLINKAT_A //sys Utime(path string, utim *Utimbuf) (err error) = SYS___UTIME_A //sys open(path string, mode int, perm uint32) (fd int, err error) = SYS___OPEN_A func Open(path string, mode int, perm uint32) (fd int, err error) { if mode&O_ACCMODE == 0 { mode |= O_RDONLY } return open(path, mode, perm) } //sys openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) = SYS___OPENAT_A func Openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) { if flags&O_ACCMODE == 0 { flags |= O_RDONLY } return openat(dirfd, path, flags, mode) } //sys openat2(dirfd int, path string, open_how *OpenHow, size int) (fd int, err error) = SYS___OPENAT2_A func Openat2(dirfd int, path string, how *OpenHow) (fd int, err error) { if how.Flags&O_ACCMODE == 0 { how.Flags |= O_RDONLY } return openat2(dirfd, path, how, SizeofOpenHow) } func ZosFdToPath(dirfd int) (path string, err error) { var buffer [1024]byte runtime.EnterSyscall() ret, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_W_IOCTL<<4, uintptr(dirfd), 17, 1024, uintptr(unsafe.Pointer(&buffer[0]))) runtime.ExitSyscall() if ret == 0 { zb := bytes.IndexByte(buffer[:], 0) if zb == -1 { zb = len(buffer) } CallLeFuncWithErr(GetZosLibVec()+SYS___E2A_L<<4, uintptr(unsafe.Pointer(&buffer[0])), uintptr(zb)) return string(buffer[:zb]), nil } return "", errnoErr2(e1, e2) } //sys remove(path string) (err error) func Remove(path string) error { return remove(path) } const ImplementsGetwd = true func Getcwd(buf []byte) (n int, err error) { var p unsafe.Pointer if len(buf) > 0 { p = unsafe.Pointer(&buf[0]) } else { p = unsafe.Pointer(&_zero) } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithPtrReturn(GetZosLibVec()+SYS___GETCWD_A<<4, uintptr(p), uintptr(len(buf))) runtime.ExitSyscall() n = clen(buf) + 1 if r0 == 0 { err = errnoErr2(e1, e2) } return } func Getwd() (wd string, err error) { var buf [PathMax]byte n, err := Getcwd(buf[0:]) if err != nil { return "", err } // Getcwd returns the number of bytes written to buf, including the NUL. if n < 1 || n > len(buf) || buf[n-1] != 0 { return "", EINVAL } return string(buf[0 : n-1]), nil } func Getgroups() (gids []int, err error) { n, err := getgroups(0, nil) if err != nil { return nil, err } if n == 0 { return nil, nil } // Sanity check group count. Max is 1<<16 on Linux. if n < 0 || n > 1<<20 { return nil, EINVAL } a := make([]_Gid_t, n) n, err = getgroups(n, &a[0]) if err != nil { return nil, err } gids = make([]int, n) for i, v := range a[0:n] { gids[i] = int(v) } return } func Setgroups(gids []int) (err error) { if len(gids) == 0 { return setgroups(0, nil) } a := make([]_Gid_t, len(gids)) for i, v := range gids { a[i] = _Gid_t(v) } return setgroups(len(a), &a[0]) } func gettid() uint64 func Gettid() (tid int) { return int(gettid()) } type WaitStatus uint32 // Wait status is 7 bits at bottom, either 0 (exited), // 0x7F (stopped), or a signal number that caused an exit. // The 0x80 bit is whether there was a core dump. // An extra number (exit code, signal causing a stop) // is in the high bits. At least that's the idea. // There are various irregularities. For example, the // "continued" status is 0xFFFF, distinguishing itself // from stopped via the core dump bit. const ( mask = 0x7F core = 0x80 exited = 0x00 stopped = 0x7F shift = 8 ) func (w WaitStatus) Exited() bool { return w&mask == exited } func (w WaitStatus) Signaled() bool { return w&mask != stopped && w&mask != exited } func (w WaitStatus) Stopped() bool { return w&0xFF == stopped } func (w WaitStatus) Continued() bool { return w == 0xFFFF } func (w WaitStatus) CoreDump() bool { return w.Signaled() && w&core != 0 } func (w WaitStatus) ExitStatus() int { if !w.Exited() { return -1 } return int(w>>shift) & 0xFF } func (w WaitStatus) Signal() Signal { if !w.Signaled() { return -1 } return Signal(w & mask) } func (w WaitStatus) StopSignal() Signal { if !w.Stopped() { return -1 } return Signal(w>>shift) & 0xFF } func (w WaitStatus) TrapCause() int { return -1 } //sys waitid(idType int, id int, info *Siginfo, options int) (err error) func Waitid(idType int, id int, info *Siginfo, options int, rusage *Rusage) (err error) { return waitid(idType, id, info, options) } //sys waitpid(pid int, wstatus *_C_int, options int) (wpid int, err error) func impl_Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_WAIT4<<4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage))) runtime.ExitSyscall() wpid = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_Wait4Addr() *(func(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, err error)) var Wait4 = enter_Wait4 func enter_Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, err error) { funcref := get_Wait4Addr() if funcptrtest(GetZosLibVec()+SYS_WAIT4<<4, "") == 0 { *funcref = impl_Wait4 } else { *funcref = legacyWait4 } return (*funcref)(pid, wstatus, options, rusage) } func legacyWait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, err error) { // TODO(mundaym): z/OS doesn't have wait4. I don't think getrusage does what we want. // At the moment rusage will not be touched. var status _C_int wpid, err = waitpid(pid, &status, options) if wstatus != nil { *wstatus = WaitStatus(status) } return } //sysnb gettimeofday(tv *timeval_zos) (err error) func Gettimeofday(tv *Timeval) (err error) { var tvz timeval_zos err = gettimeofday(&tvz) tv.Sec = tvz.Sec tv.Usec = int64(tvz.Usec) return } func Time(t *Time_t) (tt Time_t, err error) { var tv Timeval err = Gettimeofday(&tv) if err != nil { return 0, err } if t != nil { *t = Time_t(tv.Sec) } return Time_t(tv.Sec), nil } func setTimespec(sec, nsec int64) Timespec { return Timespec{Sec: sec, Nsec: nsec} } func setTimeval(sec, usec int64) Timeval { //fix return Timeval{Sec: sec, Usec: usec} } //sysnb pipe(p *[2]_C_int) (err error) func Pipe(p []int) (err error) { if len(p) != 2 { return EINVAL } var pp [2]_C_int err = pipe(&pp) p[0] = int(pp[0]) p[1] = int(pp[1]) return } //sys utimes(path string, timeval *[2]Timeval) (err error) = SYS___UTIMES_A func Utimes(path string, tv []Timeval) (err error) { if tv == nil { return utimes(path, nil) } if len(tv) != 2 { return EINVAL } return utimes(path, (*[2]Timeval)(unsafe.Pointer(&tv[0]))) } //sys utimensat(dirfd int, path string, ts *[2]Timespec, flags int) (err error) = SYS___UTIMENSAT_A func validUtimensat() bool { if funcptrtest(GetZosLibVec()+SYS___UTIMENSAT_A<<4, "") == 0 { if name, err := getLeFuncName(GetZosLibVec() + SYS___UTIMENSAT_A<<4); err == nil { return name == "__utimensat_a" } } return false } // Begin UtimesNano //go:nosplit func get_UtimesNanoAddr() *(func(path string, ts []Timespec) (err error)) var UtimesNano = enter_UtimesNano func enter_UtimesNano(path string, ts []Timespec) (err error) { funcref := get_UtimesNanoAddr() if validUtimensat() { *funcref = utimesNanoImpl } else { *funcref = legacyUtimesNano } return (*funcref)(path, ts) } func utimesNanoImpl(path string, ts []Timespec) (err error) { if ts == nil { return utimensat(AT_FDCWD, path, nil, 0) } if len(ts) != 2 { return EINVAL } return utimensat(AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0) } func legacyUtimesNano(path string, ts []Timespec) (err error) { if len(ts) != 2 { return EINVAL } // Not as efficient as it could be because Timespec and // Timeval have different types in the different OSes tv := [2]Timeval{ NsecToTimeval(TimespecToNsec(ts[0])), NsecToTimeval(TimespecToNsec(ts[1])), } return utimes(path, (*[2]Timeval)(unsafe.Pointer(&tv[0]))) } // End UtimesNano // Begin UtimesNanoAt //go:nosplit func get_UtimesNanoAtAddr() *(func(dirfd int, path string, ts []Timespec, flags int) (err error)) var UtimesNanoAt = enter_UtimesNanoAt func enter_UtimesNanoAt(dirfd int, path string, ts []Timespec, flags int) (err error) { funcref := get_UtimesNanoAtAddr() if validUtimensat() { *funcref = utimesNanoAtImpl } else { *funcref = legacyUtimesNanoAt } return (*funcref)(dirfd, path, ts, flags) } func utimesNanoAtImpl(dirfd int, path string, ts []Timespec, flags int) (err error) { if ts == nil { return utimensat(dirfd, path, nil, flags) } if len(ts) != 2 { return EINVAL } return utimensat(dirfd, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), flags) } func legacyUtimesNanoAt(dirfd int, path string, ts []Timespec, flags int) (err error) { if path[0] != '/' { dirPath, err := ZosFdToPath(dirfd) if err != nil { return err } path = dirPath + "/" + path } if flags == AT_SYMLINK_NOFOLLOW { if len(ts) != 2 { return EINVAL } if ts[0].Nsec >= 5e8 { ts[0].Sec++ } ts[0].Nsec = 0 if ts[1].Nsec >= 5e8 { ts[1].Sec++ } ts[1].Nsec = 0 // Not as efficient as it could be because Timespec and // Timeval have different types in the different OSes tv := []Timeval{ NsecToTimeval(TimespecToNsec(ts[0])), NsecToTimeval(TimespecToNsec(ts[1])), } return Lutimes(path, tv) } return UtimesNano(path, ts) } // End UtimesNanoAt func Getsockname(fd int) (sa Sockaddr, err error) { var rsa RawSockaddrAny var len _Socklen = SizeofSockaddrAny if err = getsockname(fd, &rsa, &len); err != nil { return } // TODO(neeilan) : Remove this 0 ( added to get sys/unix compiling on z/OS ) return anyToSockaddr(0, &rsa) } const ( // identifier constants nwmHeaderIdentifier = 0xd5e6d4c8 nwmFilterIdentifier = 0xd5e6d4c6 nwmTCPConnIdentifier = 0xd5e6d4c3 nwmRecHeaderIdentifier = 0xd5e6d4d9 nwmIPStatsIdentifier = 0xd5e6d4c9d7e2e340 nwmIPGStatsIdentifier = 0xd5e6d4c9d7c7e2e3 nwmTCPStatsIdentifier = 0xd5e6d4e3c3d7e2e3 nwmUDPStatsIdentifier = 0xd5e6d4e4c4d7e2e3 nwmICMPGStatsEntry = 0xd5e6d4c9c3d4d7c7 nwmICMPTStatsEntry = 0xd5e6d4c9c3d4d7e3 // nwmHeader constants nwmVersion1 = 1 nwmVersion2 = 2 nwmCurrentVer = 2 nwmTCPConnType = 1 nwmGlobalStatsType = 14 // nwmFilter constants nwmFilterLclAddrMask = 0x20000000 // Local address nwmFilterSrcAddrMask = 0x20000000 // Source address nwmFilterLclPortMask = 0x10000000 // Local port nwmFilterSrcPortMask = 0x10000000 // Source port // nwmConnEntry constants nwmTCPStateClosed = 1 nwmTCPStateListen = 2 nwmTCPStateSynSent = 3 nwmTCPStateSynRcvd = 4 nwmTCPStateEstab = 5 nwmTCPStateFinWait1 = 6 nwmTCPStateFinWait2 = 7 nwmTCPStateClosWait = 8 nwmTCPStateLastAck = 9 nwmTCPStateClosing = 10 nwmTCPStateTimeWait = 11 nwmTCPStateDeletTCB = 12 // Existing constants on linux BPF_TCP_CLOSE = 1 BPF_TCP_LISTEN = 2 BPF_TCP_SYN_SENT = 3 BPF_TCP_SYN_RECV = 4 BPF_TCP_ESTABLISHED = 5 BPF_TCP_FIN_WAIT1 = 6 BPF_TCP_FIN_WAIT2 = 7 BPF_TCP_CLOSE_WAIT = 8 BPF_TCP_LAST_ACK = 9 BPF_TCP_CLOSING = 10 BPF_TCP_TIME_WAIT = 11 BPF_TCP_NEW_SYN_RECV = -1 BPF_TCP_MAX_STATES = -2 ) type nwmTriplet struct { offset uint32 length uint32 number uint32 } type nwmQuadruplet struct { offset uint32 length uint32 number uint32 match uint32 } type nwmHeader struct { ident uint32 length uint32 version uint16 nwmType uint16 bytesNeeded uint32 options uint32 _ [16]byte inputDesc nwmTriplet outputDesc nwmQuadruplet } type nwmFilter struct { ident uint32 flags uint32 resourceName [8]byte resourceId uint32 listenerId uint32 local [28]byte // union of sockaddr4 and sockaddr6 remote [28]byte // union of sockaddr4 and sockaddr6 _ uint16 _ uint16 asid uint16 _ [2]byte tnLuName [8]byte tnMonGrp uint32 tnAppl [8]byte applData [40]byte nInterface [16]byte dVipa [16]byte dVipaPfx uint16 dVipaPort uint16 dVipaFamily byte _ [3]byte destXCF [16]byte destXCFPfx uint16 destXCFFamily byte _ [1]byte targIP [16]byte targIPPfx uint16 targIPFamily byte _ [1]byte _ [20]byte } type nwmRecHeader struct { ident uint32 length uint32 number byte _ [3]byte } type nwmTCPStatsEntry struct { ident uint64 currEstab uint32 activeOpened uint32 passiveOpened uint32 connClosed uint32 estabResets uint32 attemptFails uint32 passiveDrops uint32 timeWaitReused uint32 inSegs uint64 predictAck uint32 predictData uint32 inDupAck uint32 inBadSum uint32 inBadLen uint32 inShort uint32 inDiscOldTime uint32 inAllBeforeWin uint32 inSomeBeforeWin uint32 inAllAfterWin uint32 inSomeAfterWin uint32 inOutOfOrder uint32 inAfterClose uint32 inWinProbes uint32 inWinUpdates uint32 outWinUpdates uint32 outSegs uint64 outDelayAcks uint32 outRsts uint32 retransSegs uint32 retransTimeouts uint32 retransDrops uint32 pmtuRetrans uint32 pmtuErrors uint32 outWinProbes uint32 probeDrops uint32 keepAliveProbes uint32 keepAliveDrops uint32 finwait2Drops uint32 acceptCount uint64 inBulkQSegs uint64 inDiscards uint64 connFloods uint32 connStalls uint32 cfgEphemDef uint16 ephemInUse uint16 ephemHiWater uint16 flags byte _ [1]byte ephemExhaust uint32 smcRCurrEstabLnks uint32 smcRLnkActTimeOut uint32 smcRActLnkOpened uint32 smcRPasLnkOpened uint32 smcRLnksClosed uint32 smcRCurrEstab uint32 smcRActiveOpened uint32 smcRPassiveOpened uint32 smcRConnClosed uint32 smcRInSegs uint64 smcROutSegs uint64 smcRInRsts uint32 smcROutRsts uint32 smcDCurrEstabLnks uint32 smcDActLnkOpened uint32 smcDPasLnkOpened uint32 smcDLnksClosed uint32 smcDCurrEstab uint32 smcDActiveOpened uint32 smcDPassiveOpened uint32 smcDConnClosed uint32 smcDInSegs uint64 smcDOutSegs uint64 smcDInRsts uint32 smcDOutRsts uint32 } type nwmConnEntry struct { ident uint32 local [28]byte // union of sockaddr4 and sockaddr6 remote [28]byte // union of sockaddr4 and sockaddr6 startTime [8]byte // uint64, changed to prevent padding from being inserted lastActivity [8]byte // uint64 bytesIn [8]byte // uint64 bytesOut [8]byte // uint64 inSegs [8]byte // uint64 outSegs [8]byte // uint64 state uint16 activeOpen byte flag01 byte outBuffered uint32 inBuffered uint32 maxSndWnd uint32 reXmtCount uint32 congestionWnd uint32 ssThresh uint32 roundTripTime uint32 roundTripVar uint32 sendMSS uint32 sndWnd uint32 rcvBufSize uint32 sndBufSize uint32 outOfOrderCount uint32 lcl0WindowCount uint32 rmt0WindowCount uint32 dupacks uint32 flag02 byte sockOpt6Cont byte asid uint16 resourceName [8]byte resourceId uint32 subtask uint32 sockOpt byte sockOpt6 byte clusterConnFlag byte proto byte targetAppl [8]byte luName [8]byte clientUserId [8]byte logMode [8]byte timeStamp uint32 timeStampAge uint32 serverResourceId uint32 intfName [16]byte ttlsStatPol byte ttlsStatConn byte ttlsSSLProt uint16 ttlsNegCiph [2]byte ttlsSecType byte ttlsFIPS140Mode byte ttlsUserID [8]byte applData [40]byte inOldestTime [8]byte // uint64 outOldestTime [8]byte // uint64 tcpTrustedPartner byte _ [3]byte bulkDataIntfName [16]byte ttlsNegCiph4 [4]byte smcReason uint32 lclSMCLinkId uint32 rmtSMCLinkId uint32 smcStatus byte smcFlags byte _ [2]byte rcvWnd uint32 lclSMCBufSz uint32 rmtSMCBufSz uint32 ttlsSessID [32]byte ttlsSessIDLen int16 _ [1]byte smcDStatus byte smcDReason uint32 } var svcNameTable [][]byte = [][]byte{ []byte("\xc5\xe9\xc2\xd5\xd4\xc9\xc6\xf4"), // svc_EZBNMIF4 } const ( svc_EZBNMIF4 = 0 ) func GetsockoptTCPInfo(fd, level, opt int) (*TCPInfo, error) { jobname := []byte("\x5c\x40\x40\x40\x40\x40\x40\x40") // "*" responseBuffer := [4096]byte{0} var bufferAlet, reasonCode uint32 = 0, 0 var bufferLen, returnValue, returnCode int32 = 4096, 0, 0 dsa := [18]uint64{0} var argv [7]unsafe.Pointer argv[0] = unsafe.Pointer(&jobname[0]) argv[1] = unsafe.Pointer(&responseBuffer[0]) argv[2] = unsafe.Pointer(&bufferAlet) argv[3] = unsafe.Pointer(&bufferLen) argv[4] = unsafe.Pointer(&returnValue) argv[5] = unsafe.Pointer(&returnCode) argv[6] = unsafe.Pointer(&reasonCode) request := (*struct { header nwmHeader filter nwmFilter })(unsafe.Pointer(&responseBuffer[0])) EZBNMIF4 := svcLoad(&svcNameTable[svc_EZBNMIF4][0]) if EZBNMIF4 == nil { return nil, errnoErr(EINVAL) } // GetGlobalStats EZBNMIF4 call request.header.ident = nwmHeaderIdentifier request.header.length = uint32(unsafe.Sizeof(request.header)) request.header.version = nwmCurrentVer request.header.nwmType = nwmGlobalStatsType request.header.options = 0x80000000 svcCall(EZBNMIF4, &argv[0], &dsa[0]) // outputDesc field is filled by EZBNMIF4 on success if returnCode != 0 || request.header.outputDesc.offset == 0 { return nil, errnoErr(EINVAL) } // Check that EZBNMIF4 returned a nwmRecHeader recHeader := (*nwmRecHeader)(unsafe.Pointer(&responseBuffer[request.header.outputDesc.offset])) if recHeader.ident != nwmRecHeaderIdentifier { return nil, errnoErr(EINVAL) } // Parse nwmTriplets to get offsets of returned entries var sections []*uint64 var sectionDesc *nwmTriplet = (*nwmTriplet)(unsafe.Pointer(&responseBuffer[0])) for i := uint32(0); i < uint32(recHeader.number); i++ { offset := request.header.outputDesc.offset + uint32(unsafe.Sizeof(*recHeader)) + i*uint32(unsafe.Sizeof(*sectionDesc)) sectionDesc = (*nwmTriplet)(unsafe.Pointer(&responseBuffer[offset])) for j := uint32(0); j < sectionDesc.number; j++ { offset = request.header.outputDesc.offset + sectionDesc.offset + j*sectionDesc.length sections = append(sections, (*uint64)(unsafe.Pointer(&responseBuffer[offset]))) } } // Find nwmTCPStatsEntry in returned entries var tcpStats *nwmTCPStatsEntry = nil for _, ptr := range sections { switch *ptr { case nwmTCPStatsIdentifier: if tcpStats != nil { return nil, errnoErr(EINVAL) } tcpStats = (*nwmTCPStatsEntry)(unsafe.Pointer(ptr)) case nwmIPStatsIdentifier: case nwmIPGStatsIdentifier: case nwmUDPStatsIdentifier: case nwmICMPGStatsEntry: case nwmICMPTStatsEntry: default: return nil, errnoErr(EINVAL) } } if tcpStats == nil { return nil, errnoErr(EINVAL) } // GetConnectionDetail EZBNMIF4 call responseBuffer = [4096]byte{0} dsa = [18]uint64{0} bufferAlet, reasonCode = 0, 0 bufferLen, returnValue, returnCode = 4096, 0, 0 nameptr := (*uint32)(unsafe.Pointer(uintptr(0x21c))) // Get jobname of current process nameptr = (*uint32)(unsafe.Pointer(uintptr(*nameptr + 12))) argv[0] = unsafe.Pointer(uintptr(*nameptr)) request.header.ident = nwmHeaderIdentifier request.header.length = uint32(unsafe.Sizeof(request.header)) request.header.version = nwmCurrentVer request.header.nwmType = nwmTCPConnType request.header.options = 0x80000000 request.filter.ident = nwmFilterIdentifier var localSockaddr RawSockaddrAny socklen := _Socklen(SizeofSockaddrAny) err := getsockname(fd, &localSockaddr, &socklen) if err != nil { return nil, errnoErr(EINVAL) } if localSockaddr.Addr.Family == AF_INET { localSockaddr := (*RawSockaddrInet4)(unsafe.Pointer(&localSockaddr.Addr)) localSockFilter := (*RawSockaddrInet4)(unsafe.Pointer(&request.filter.local[0])) localSockFilter.Family = AF_INET var i int for i = 0; i < 4; i++ { if localSockaddr.Addr[i] != 0 { break } } if i != 4 { request.filter.flags |= nwmFilterLclAddrMask for i = 0; i < 4; i++ { localSockFilter.Addr[i] = localSockaddr.Addr[i] } } if localSockaddr.Port != 0 { request.filter.flags |= nwmFilterLclPortMask localSockFilter.Port = localSockaddr.Port } } else if localSockaddr.Addr.Family == AF_INET6 { localSockaddr := (*RawSockaddrInet6)(unsafe.Pointer(&localSockaddr.Addr)) localSockFilter := (*RawSockaddrInet6)(unsafe.Pointer(&request.filter.local[0])) localSockFilter.Family = AF_INET6 var i int for i = 0; i < 16; i++ { if localSockaddr.Addr[i] != 0 { break } } if i != 16 { request.filter.flags |= nwmFilterLclAddrMask for i = 0; i < 16; i++ { localSockFilter.Addr[i] = localSockaddr.Addr[i] } } if localSockaddr.Port != 0 { request.filter.flags |= nwmFilterLclPortMask localSockFilter.Port = localSockaddr.Port } } svcCall(EZBNMIF4, &argv[0], &dsa[0]) // outputDesc field is filled by EZBNMIF4 on success if returnCode != 0 || request.header.outputDesc.offset == 0 { return nil, errnoErr(EINVAL) } // Check that EZBNMIF4 returned a nwmConnEntry conn := (*nwmConnEntry)(unsafe.Pointer(&responseBuffer[request.header.outputDesc.offset])) if conn.ident != nwmTCPConnIdentifier { return nil, errnoErr(EINVAL) } // Copy data from the returned data structures into tcpInfo // Stats from nwmConnEntry are specific to that connection. // Stats from nwmTCPStatsEntry are global (to the interface?) // Fields may not be an exact match. Some fields have no equivalent. var tcpinfo TCPInfo tcpinfo.State = uint8(conn.state) tcpinfo.Ca_state = 0 // dummy tcpinfo.Retransmits = uint8(tcpStats.retransSegs) tcpinfo.Probes = uint8(tcpStats.outWinProbes) tcpinfo.Backoff = 0 // dummy tcpinfo.Options = 0 // dummy tcpinfo.Rto = tcpStats.retransTimeouts tcpinfo.Ato = tcpStats.outDelayAcks tcpinfo.Snd_mss = conn.sendMSS tcpinfo.Rcv_mss = conn.sendMSS // dummy tcpinfo.Unacked = 0 // dummy tcpinfo.Sacked = 0 // dummy tcpinfo.Lost = 0 // dummy tcpinfo.Retrans = conn.reXmtCount tcpinfo.Fackets = 0 // dummy tcpinfo.Last_data_sent = uint32(*(*uint64)(unsafe.Pointer(&conn.lastActivity[0]))) tcpinfo.Last_ack_sent = uint32(*(*uint64)(unsafe.Pointer(&conn.outOldestTime[0]))) tcpinfo.Last_data_recv = uint32(*(*uint64)(unsafe.Pointer(&conn.inOldestTime[0]))) tcpinfo.Last_ack_recv = uint32(*(*uint64)(unsafe.Pointer(&conn.inOldestTime[0]))) tcpinfo.Pmtu = conn.sendMSS // dummy, NWMIfRouteMtu is a candidate tcpinfo.Rcv_ssthresh = conn.ssThresh tcpinfo.Rtt = conn.roundTripTime tcpinfo.Rttvar = conn.roundTripVar tcpinfo.Snd_ssthresh = conn.ssThresh // dummy tcpinfo.Snd_cwnd = conn.congestionWnd tcpinfo.Advmss = conn.sendMSS // dummy tcpinfo.Reordering = 0 // dummy tcpinfo.Rcv_rtt = conn.roundTripTime // dummy tcpinfo.Rcv_space = conn.sendMSS // dummy tcpinfo.Total_retrans = conn.reXmtCount svcUnload(&svcNameTable[svc_EZBNMIF4][0], EZBNMIF4) return &tcpinfo, nil } // GetsockoptString returns the string value of the socket option opt for the // socket associated with fd at the given socket level. func GetsockoptString(fd, level, opt int) (string, error) { buf := make([]byte, 256) vallen := _Socklen(len(buf)) err := getsockopt(fd, level, opt, unsafe.Pointer(&buf[0]), &vallen) if err != nil { return "", err } return ByteSliceToString(buf[:vallen]), nil } func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) { var msg Msghdr var rsa RawSockaddrAny msg.Name = (*byte)(unsafe.Pointer(&rsa)) msg.Namelen = SizeofSockaddrAny var iov Iovec if len(p) > 0 { iov.Base = (*byte)(unsafe.Pointer(&p[0])) iov.SetLen(len(p)) } var dummy byte if len(oob) > 0 { // receive at least one normal byte if len(p) == 0 { iov.Base = &dummy iov.SetLen(1) } msg.Control = (*byte)(unsafe.Pointer(&oob[0])) msg.SetControllen(len(oob)) } msg.Iov = &iov msg.Iovlen = 1 if n, err = recvmsg(fd, &msg, flags); err != nil { return } oobn = int(msg.Controllen) recvflags = int(msg.Flags) // source address is only specified if the socket is unconnected if rsa.Addr.Family != AF_UNSPEC { // TODO(neeilan): Remove 0 arg added to get this compiling on z/OS from, err = anyToSockaddr(0, &rsa) } return } func Sendmsg(fd int, p, oob []byte, to Sockaddr, flags int) (err error) { _, err = SendmsgN(fd, p, oob, to, flags) return } func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error) { var ptr unsafe.Pointer var salen _Socklen if to != nil { var err error ptr, salen, err = to.sockaddr() if err != nil { return 0, err } } var msg Msghdr msg.Name = (*byte)(unsafe.Pointer(ptr)) msg.Namelen = int32(salen) var iov Iovec if len(p) > 0 { iov.Base = (*byte)(unsafe.Pointer(&p[0])) iov.SetLen(len(p)) } var dummy byte if len(oob) > 0 { // send at least one normal byte if len(p) == 0 { iov.Base = &dummy iov.SetLen(1) } msg.Control = (*byte)(unsafe.Pointer(&oob[0])) msg.SetControllen(len(oob)) } msg.Iov = &iov msg.Iovlen = 1 if n, err = sendmsg(fd, &msg, flags); err != nil { return 0, err } if len(oob) > 0 && len(p) == 0 { n = 0 } return n, nil } func Opendir(name string) (uintptr, error) { p, err := BytePtrFromString(name) if err != nil { return 0, err } err = nil runtime.EnterSyscall() dir, e2, e1 := CallLeFuncWithPtrReturn(GetZosLibVec()+SYS___OPENDIR_A<<4, uintptr(unsafe.Pointer(p))) runtime.ExitSyscall() runtime.KeepAlive(unsafe.Pointer(p)) if dir == 0 { err = errnoErr2(e1, e2) } return dir, err } // clearsyscall.Errno resets the errno value to 0. func clearErrno() func Closedir(dir uintptr) error { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_CLOSEDIR<<4, dir) runtime.ExitSyscall() if r0 != 0 { return errnoErr2(e1, e2) } return nil } func Seekdir(dir uintptr, pos int) { runtime.EnterSyscall() CallLeFuncWithErr(GetZosLibVec()+SYS_SEEKDIR<<4, dir, uintptr(pos)) runtime.ExitSyscall() } func Telldir(dir uintptr) (int, error) { p, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_TELLDIR<<4, dir) pos := int(p) if int64(p) == -1 { return pos, errnoErr2(e1, e2) } return pos, nil } // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { // struct flock is packed on z/OS. We can't emulate that in Go so // instead we pack it here. var flock [24]byte *(*int16)(unsafe.Pointer(&flock[0])) = lk.Type *(*int16)(unsafe.Pointer(&flock[2])) = lk.Whence *(*int64)(unsafe.Pointer(&flock[4])) = lk.Start *(*int64)(unsafe.Pointer(&flock[12])) = lk.Len *(*int32)(unsafe.Pointer(&flock[20])) = lk.Pid runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FCNTL<<4, fd, uintptr(cmd), uintptr(unsafe.Pointer(&flock))) runtime.ExitSyscall() lk.Type = *(*int16)(unsafe.Pointer(&flock[0])) lk.Whence = *(*int16)(unsafe.Pointer(&flock[2])) lk.Start = *(*int64)(unsafe.Pointer(&flock[4])) lk.Len = *(*int64)(unsafe.Pointer(&flock[12])) lk.Pid = *(*int32)(unsafe.Pointer(&flock[20])) if r0 == 0 { return nil } return errnoErr2(e1, e2) } func impl_Flock(fd int, how int) (err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FLOCK<<4, uintptr(fd), uintptr(how)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_FlockAddr() *(func(fd int, how int) (err error)) var Flock = enter_Flock func validFlock(fp uintptr) bool { if funcptrtest(GetZosLibVec()+SYS_FLOCK<<4, "") == 0 { if name, err := getLeFuncName(GetZosLibVec() + SYS_FLOCK<<4); err == nil { return name == "flock" } } return false } func enter_Flock(fd int, how int) (err error) { funcref := get_FlockAddr() if validFlock(GetZosLibVec() + SYS_FLOCK<<4) { *funcref = impl_Flock } else { *funcref = legacyFlock } return (*funcref)(fd, how) } func legacyFlock(fd int, how int) error { var flock_type int16 var fcntl_cmd int switch how { case LOCK_SH | LOCK_NB: flock_type = F_RDLCK fcntl_cmd = F_SETLK case LOCK_EX | LOCK_NB: flock_type = F_WRLCK fcntl_cmd = F_SETLK case LOCK_EX: flock_type = F_WRLCK fcntl_cmd = F_SETLKW case LOCK_UN: flock_type = F_UNLCK fcntl_cmd = F_SETLKW default: } flock := Flock_t{ Type: int16(flock_type), Whence: int16(0), Start: int64(0), Len: int64(0), Pid: int32(Getppid()), } err := FcntlFlock(uintptr(fd), fcntl_cmd, &flock) return err } func Mlock(b []byte) (err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___MLOCKALL<<4, _BPX_NONSWAP) runtime.ExitSyscall() if r0 != 0 { err = errnoErr2(e1, e2) } return } func Mlock2(b []byte, flags int) (err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___MLOCKALL<<4, _BPX_NONSWAP) runtime.ExitSyscall() if r0 != 0 { err = errnoErr2(e1, e2) } return } func Mlockall(flags int) (err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___MLOCKALL<<4, _BPX_NONSWAP) runtime.ExitSyscall() if r0 != 0 { err = errnoErr2(e1, e2) } return } func Munlock(b []byte) (err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___MLOCKALL<<4, _BPX_SWAP) runtime.ExitSyscall() if r0 != 0 { err = errnoErr2(e1, e2) } return } func Munlockall() (err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___MLOCKALL<<4, _BPX_SWAP) runtime.ExitSyscall() if r0 != 0 { err = errnoErr2(e1, e2) } return } func ClockGettime(clockid int32, ts *Timespec) error { var ticks_per_sec uint32 = 100 //TODO(kenan): value is currently hardcoded; need sysconf() call otherwise var nsec_per_sec int64 = 1000000000 if ts == nil { return EFAULT } if clockid == CLOCK_REALTIME || clockid == CLOCK_MONOTONIC { var nanotime int64 = runtime.Nanotime1() ts.Sec = nanotime / nsec_per_sec ts.Nsec = nanotime % nsec_per_sec } else if clockid == CLOCK_PROCESS_CPUTIME_ID || clockid == CLOCK_THREAD_CPUTIME_ID { var tm Tms _, err := Times(&tm) if err != nil { return EFAULT } ts.Sec = int64(tm.Utime / ticks_per_sec) ts.Nsec = int64(tm.Utime) * nsec_per_sec / int64(ticks_per_sec) } else { return EINVAL } return nil } // Chtag //go:nosplit func get_ChtagAddr() *(func(path string, ccsid uint64, textbit uint64) error) var Chtag = enter_Chtag func enter_Chtag(path string, ccsid uint64, textbit uint64) error { funcref := get_ChtagAddr() if validSetxattr() { *funcref = impl_Chtag } else { *funcref = legacy_Chtag } return (*funcref)(path, ccsid, textbit) } func legacy_Chtag(path string, ccsid uint64, textbit uint64) error { tag := ccsid<<16 | textbit<<15 var tag_buff [8]byte DecodeData(tag_buff[:], 8, tag) return Setxattr(path, "filetag", tag_buff[:], XATTR_REPLACE) } func impl_Chtag(path string, ccsid uint64, textbit uint64) error { tag := ccsid<<16 | textbit<<15 var tag_buff [4]byte DecodeData(tag_buff[:], 4, tag) return Setxattr(path, "system.filetag", tag_buff[:], XATTR_REPLACE) } // End of Chtag // Nanosleep //go:nosplit func get_NanosleepAddr() *(func(time *Timespec, leftover *Timespec) error) var Nanosleep = enter_Nanosleep func enter_Nanosleep(time *Timespec, leftover *Timespec) error { funcref := get_NanosleepAddr() if funcptrtest(GetZosLibVec()+SYS_NANOSLEEP<<4, "") == 0 { *funcref = impl_Nanosleep } else { *funcref = legacyNanosleep } return (*funcref)(time, leftover) } func impl_Nanosleep(time *Timespec, leftover *Timespec) error { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_NANOSLEEP<<4, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover))) runtime.ExitSyscall() if int64(r0) == -1 { return errnoErr2(e1, e2) } return nil } func legacyNanosleep(time *Timespec, leftover *Timespec) error { t0 := runtime.Nanotime1() var secrem uint32 var nsecrem uint32 total := time.Sec*1000000000 + time.Nsec elapsed := runtime.Nanotime1() - t0 var rv int32 var rc int32 var err error // repeatedly sleep for 1 second until less than 1 second left for total-elapsed > 1000000000 { rv, rc, _ = BpxCondTimedWait(uint32(1), uint32(0), uint32(CW_CONDVAR), &secrem, &nsecrem) if rv != 0 && rc != 112 { // 112 is EAGAIN if leftover != nil && rc == 120 { // 120 is EINTR leftover.Sec = int64(secrem) leftover.Nsec = int64(nsecrem) } err = Errno(rc) return err } elapsed = runtime.Nanotime1() - t0 } // sleep the remainder if total > elapsed { rv, rc, _ = BpxCondTimedWait(uint32(0), uint32(total-elapsed), uint32(CW_CONDVAR), &secrem, &nsecrem) } if leftover != nil && rc == 120 { leftover.Sec = int64(secrem) leftover.Nsec = int64(nsecrem) } if rv != 0 && rc != 112 { err = Errno(rc) } return err } // End of Nanosleep var ( Stdin = 0 Stdout = 1 Stderr = 2 ) // Do the interface allocations only once for common // Errno values. var ( errEAGAIN error = syscall.EAGAIN errEINVAL error = syscall.EINVAL errENOENT error = syscall.ENOENT ) var ZosTraceLevel int var ZosTracefile *os.File var ( signalNameMapOnce sync.Once signalNameMap map[string]syscall.Signal ) // errnoErr returns common boxed Errno values, to prevent // allocations at runtime. func errnoErr(e Errno) error { switch e { case 0: return nil case EAGAIN: return errEAGAIN case EINVAL: return errEINVAL case ENOENT: return errENOENT } return e } var reg *regexp.Regexp // enhanced with zos specific errno2 func errnoErr2(e Errno, e2 uintptr) error { switch e { case 0: return nil case EAGAIN: return errEAGAIN /* Allow the retrieval of errno2 for EINVAL and ENOENT on zos case EINVAL: return errEINVAL case ENOENT: return errENOENT */ } if ZosTraceLevel > 0 { var name string if reg == nil { reg = regexp.MustCompile("(^unix\\.[^/]+$|.*\\/unix\\.[^/]+$)") } i := 1 pc, file, line, ok := runtime.Caller(i) if ok { name = runtime.FuncForPC(pc).Name() } for ok && reg.MatchString(runtime.FuncForPC(pc).Name()) { i += 1 pc, file, line, ok = runtime.Caller(i) } if ok { if ZosTracefile == nil { ZosConsolePrintf("From %s:%d\n", file, line) ZosConsolePrintf("%s: %s (errno2=0x%x)\n", name, e.Error(), e2) } else { fmt.Fprintf(ZosTracefile, "From %s:%d\n", file, line) fmt.Fprintf(ZosTracefile, "%s: %s (errno2=0x%x)\n", name, e.Error(), e2) } } else { if ZosTracefile == nil { ZosConsolePrintf("%s (errno2=0x%x)\n", e.Error(), e2) } else { fmt.Fprintf(ZosTracefile, "%s (errno2=0x%x)\n", e.Error(), e2) } } } return e } // ErrnoName returns the error name for error number e. func ErrnoName(e Errno) string { i := sort.Search(len(errorList), func(i int) bool { return errorList[i].num >= e }) if i < len(errorList) && errorList[i].num == e { return errorList[i].name } return "" } // SignalName returns the signal name for signal number s. func SignalName(s syscall.Signal) string { i := sort.Search(len(signalList), func(i int) bool { return signalList[i].num >= s }) if i < len(signalList) && signalList[i].num == s { return signalList[i].name } return "" } // SignalNum returns the syscall.Signal for signal named s, // or 0 if a signal with such name is not found. // The signal name should start with "SIG". func SignalNum(s string) syscall.Signal { signalNameMapOnce.Do(func() { signalNameMap = make(map[string]syscall.Signal, len(signalList)) for _, signal := range signalList { signalNameMap[signal.name] = signal.num } }) return signalNameMap[s] } // clen returns the index of the first NULL byte in n or len(n) if n contains no NULL byte. func clen(n []byte) int { i := bytes.IndexByte(n, 0) if i == -1 { i = len(n) } return i } // Mmap manager, for use by operating system-specific implementations. type mmapper struct { sync.Mutex active map[*byte][]byte // active mappings; key is last byte in mapping mmap func(addr, length uintptr, prot, flags, fd int, offset int64) (uintptr, error) munmap func(addr uintptr, length uintptr) error } func (m *mmapper) Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error) { if length <= 0 { return nil, EINVAL } // Set __MAP_64 by default flags |= __MAP_64 // Map the requested memory. addr, errno := m.mmap(0, uintptr(length), prot, flags, fd, offset) if errno != nil { return nil, errno } // Slice memory layout var sl = struct { addr uintptr len int cap int }{addr, length, length} // Use unsafe to turn sl into a []byte. b := *(*[]byte)(unsafe.Pointer(&sl)) // Register mapping in m and return it. p := &b[cap(b)-1] m.Lock() defer m.Unlock() m.active[p] = b return b, nil } func (m *mmapper) Munmap(data []byte) (err error) { if len(data) == 0 || len(data) != cap(data) { return EINVAL } // Find the base of the mapping. p := &data[cap(data)-1] m.Lock() defer m.Unlock() b := m.active[p] if b == nil || &b[0] != &data[0] { return EINVAL } // Unmap the memory and update m. if errno := m.munmap(uintptr(unsafe.Pointer(&b[0])), uintptr(len(b))); errno != nil { return errno } delete(m.active, p) return nil } func Read(fd int, p []byte) (n int, err error) { n, err = read(fd, p) if raceenabled { if n > 0 { raceWriteRange(unsafe.Pointer(&p[0]), n) } if err == nil { raceAcquire(unsafe.Pointer(&ioSync)) } } return } func Write(fd int, p []byte) (n int, err error) { if raceenabled { raceReleaseMerge(unsafe.Pointer(&ioSync)) } n, err = write(fd, p) if raceenabled && n > 0 { raceReadRange(unsafe.Pointer(&p[0]), n) } return } // For testing: clients can set this flag to force // creation of IPv6 sockets to return EAFNOSUPPORT. var SocketDisableIPv6 bool // Sockaddr represents a socket address. type Sockaddr interface { sockaddr() (ptr unsafe.Pointer, len _Socklen, err error) // lowercase; only we can define Sockaddrs } // SockaddrInet4 implements the Sockaddr interface for AF_INET type sockets. type SockaddrInet4 struct { Port int Addr [4]byte raw RawSockaddrInet4 } // SockaddrInet6 implements the Sockaddr interface for AF_INET6 type sockets. type SockaddrInet6 struct { Port int ZoneId uint32 Addr [16]byte raw RawSockaddrInet6 } // SockaddrUnix implements the Sockaddr interface for AF_UNIX type sockets. type SockaddrUnix struct { Name string raw RawSockaddrUnix } func Bind(fd int, sa Sockaddr) (err error) { ptr, n, err := sa.sockaddr() if err != nil { return err } return bind(fd, ptr, n) } func Connect(fd int, sa Sockaddr) (err error) { ptr, n, err := sa.sockaddr() if err != nil { return err } return connect(fd, ptr, n) } func Getpeername(fd int) (sa Sockaddr, err error) { var rsa RawSockaddrAny var len _Socklen = SizeofSockaddrAny if err = getpeername(fd, &rsa, &len); err != nil { return } return anyToSockaddr(fd, &rsa) } func GetsockoptByte(fd, level, opt int) (value byte, err error) { var n byte vallen := _Socklen(1) err = getsockopt(fd, level, opt, unsafe.Pointer(&n), &vallen) return n, err } func GetsockoptInt(fd, level, opt int) (value int, err error) { var n int32 vallen := _Socklen(4) err = getsockopt(fd, level, opt, unsafe.Pointer(&n), &vallen) return int(n), err } func GetsockoptInet4Addr(fd, level, opt int) (value [4]byte, err error) { vallen := _Socklen(4) err = getsockopt(fd, level, opt, unsafe.Pointer(&value[0]), &vallen) return value, err } func GetsockoptIPMreq(fd, level, opt int) (*IPMreq, error) { var value IPMreq vallen := _Socklen(SizeofIPMreq) err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen) return &value, err } func GetsockoptIPv6Mreq(fd, level, opt int) (*IPv6Mreq, error) { var value IPv6Mreq vallen := _Socklen(SizeofIPv6Mreq) err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen) return &value, err } func GetsockoptIPv6MTUInfo(fd, level, opt int) (*IPv6MTUInfo, error) { var value IPv6MTUInfo vallen := _Socklen(SizeofIPv6MTUInfo) err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen) return &value, err } func GetsockoptICMPv6Filter(fd, level, opt int) (*ICMPv6Filter, error) { var value ICMPv6Filter vallen := _Socklen(SizeofICMPv6Filter) err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen) return &value, err } func GetsockoptLinger(fd, level, opt int) (*Linger, error) { var linger Linger vallen := _Socklen(SizeofLinger) err := getsockopt(fd, level, opt, unsafe.Pointer(&linger), &vallen) return &linger, err } func GetsockoptTimeval(fd, level, opt int) (*Timeval, error) { var tv Timeval vallen := _Socklen(unsafe.Sizeof(tv)) err := getsockopt(fd, level, opt, unsafe.Pointer(&tv), &vallen) return &tv, err } func GetsockoptUint64(fd, level, opt int) (value uint64, err error) { var n uint64 vallen := _Socklen(8) err = getsockopt(fd, level, opt, unsafe.Pointer(&n), &vallen) return n, err } func Recvfrom(fd int, p []byte, flags int) (n int, from Sockaddr, err error) { var rsa RawSockaddrAny var len _Socklen = SizeofSockaddrAny if n, err = recvfrom(fd, p, flags, &rsa, &len); err != nil { return } if rsa.Addr.Family != AF_UNSPEC { from, err = anyToSockaddr(fd, &rsa) } return } func Sendto(fd int, p []byte, flags int, to Sockaddr) (err error) { ptr, n, err := to.sockaddr() if err != nil { return err } return sendto(fd, p, flags, ptr, n) } func SetsockoptByte(fd, level, opt int, value byte) (err error) { return setsockopt(fd, level, opt, unsafe.Pointer(&value), 1) } func SetsockoptInt(fd, level, opt int, value int) (err error) { var n = int32(value) return setsockopt(fd, level, opt, unsafe.Pointer(&n), 4) } func SetsockoptInet4Addr(fd, level, opt int, value [4]byte) (err error) { return setsockopt(fd, level, opt, unsafe.Pointer(&value[0]), 4) } func SetsockoptIPMreq(fd, level, opt int, mreq *IPMreq) (err error) { return setsockopt(fd, level, opt, unsafe.Pointer(mreq), SizeofIPMreq) } func SetsockoptIPv6Mreq(fd, level, opt int, mreq *IPv6Mreq) (err error) { return setsockopt(fd, level, opt, unsafe.Pointer(mreq), SizeofIPv6Mreq) } func SetsockoptICMPv6Filter(fd, level, opt int, filter *ICMPv6Filter) error { return setsockopt(fd, level, opt, unsafe.Pointer(filter), SizeofICMPv6Filter) } func SetsockoptLinger(fd, level, opt int, l *Linger) (err error) { return setsockopt(fd, level, opt, unsafe.Pointer(l), SizeofLinger) } func SetsockoptString(fd, level, opt int, s string) (err error) { var p unsafe.Pointer if len(s) > 0 { p = unsafe.Pointer(&[]byte(s)[0]) } return setsockopt(fd, level, opt, p, uintptr(len(s))) } func SetsockoptTimeval(fd, level, opt int, tv *Timeval) (err error) { return setsockopt(fd, level, opt, unsafe.Pointer(tv), unsafe.Sizeof(*tv)) } func SetsockoptUint64(fd, level, opt int, value uint64) (err error) { return setsockopt(fd, level, opt, unsafe.Pointer(&value), 8) } func Socket(domain, typ, proto int) (fd int, err error) { if domain == AF_INET6 && SocketDisableIPv6 { return -1, EAFNOSUPPORT } fd, err = socket(domain, typ, proto) return } func Socketpair(domain, typ, proto int) (fd [2]int, err error) { var fdx [2]int32 err = socketpair(domain, typ, proto, &fdx) if err == nil { fd[0] = int(fdx[0]) fd[1] = int(fdx[1]) } return } var ioSync int64 func CloseOnExec(fd int) { fcntl(fd, F_SETFD, FD_CLOEXEC) } func SetNonblock(fd int, nonblocking bool) (err error) { flag, err := fcntl(fd, F_GETFL, 0) if err != nil { return err } if nonblocking { flag |= O_NONBLOCK } else { flag &= ^O_NONBLOCK } _, err = fcntl(fd, F_SETFL, flag) return err } // Exec calls execve(2), which replaces the calling executable in the process // tree. argv0 should be the full path to an executable ("/bin/ls") and the // executable name should also be the first argument in argv (["ls", "-l"]). // envv are the environment variables that should be passed to the new // process (["USER=go", "PWD=/tmp"]). func Exec(argv0 string, argv []string, envv []string) error { return syscall.Exec(argv0, argv, envv) } func Getag(path string) (ccsid uint16, flag uint16, err error) { var val [8]byte sz, err := Getxattr(path, "ccsid", val[:]) if err != nil { return } ccsid = uint16(EncodeData(val[0:sz])) sz, err = Getxattr(path, "flags", val[:]) if err != nil { return } flag = uint16(EncodeData(val[0:sz]) >> 15) return } // Mount begin func impl_Mount(source string, target string, fstype string, flags uintptr, data string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(source) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(target) if err != nil { return } var _p2 *byte _p2, err = BytePtrFromString(fstype) if err != nil { return } var _p3 *byte _p3, err = BytePtrFromString(data) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___MOUNT1_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(flags), uintptr(unsafe.Pointer(_p3))) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_MountAddr() *(func(source string, target string, fstype string, flags uintptr, data string) (err error)) var Mount = enter_Mount func enter_Mount(source string, target string, fstype string, flags uintptr, data string) (err error) { funcref := get_MountAddr() if validMount() { *funcref = impl_Mount } else { *funcref = legacyMount } return (*funcref)(source, target, fstype, flags, data) } func legacyMount(source string, target string, fstype string, flags uintptr, data string) (err error) { if needspace := 8 - len(fstype); needspace <= 0 { fstype = fstype[0:8] } else { fstype += " "[0:needspace] } return mount_LE(target, source, fstype, uint32(flags), int32(len(data)), data) } func validMount() bool { if funcptrtest(GetZosLibVec()+SYS___MOUNT1_A<<4, "") == 0 { if name, err := getLeFuncName(GetZosLibVec() + SYS___MOUNT1_A<<4); err == nil { return name == "__mount1_a" } } return false } // Mount end // Unmount begin func impl_Unmount(target string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(target) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___UMOUNT2_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(flags)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_UnmountAddr() *(func(target string, flags int) (err error)) var Unmount = enter_Unmount func enter_Unmount(target string, flags int) (err error) { funcref := get_UnmountAddr() if funcptrtest(GetZosLibVec()+SYS___UMOUNT2_A<<4, "") == 0 { *funcref = impl_Unmount } else { *funcref = legacyUnmount } return (*funcref)(target, flags) } func legacyUnmount(name string, mtm int) (err error) { // mountpoint is always a full path and starts with a '/' // check if input string is not a mountpoint but a filesystem name if name[0] != '/' { return unmount_LE(name, mtm) } // treat name as mountpoint b2s := func(arr []byte) string { var str string for i := 0; i < len(arr); i++ { if arr[i] == 0 { str = string(arr[:i]) break } } return str } var buffer struct { header W_Mnth fsinfo [64]W_Mntent } fs_count, err := W_Getmntent_A((*byte)(unsafe.Pointer(&buffer)), int(unsafe.Sizeof(buffer))) if err == nil { err = EINVAL for i := 0; i < fs_count; i++ { if b2s(buffer.fsinfo[i].Mountpoint[:]) == name { err = unmount_LE(b2s(buffer.fsinfo[i].Fsname[:]), mtm) break } } } else if fs_count == 0 { err = EINVAL } return err } // Unmount end func direntIno(buf []byte) (uint64, bool) { return readInt(buf, unsafe.Offsetof(Dirent{}.Ino), unsafe.Sizeof(Dirent{}.Ino)) } func direntReclen(buf []byte) (uint64, bool) { return readInt(buf, unsafe.Offsetof(Dirent{}.Reclen), unsafe.Sizeof(Dirent{}.Reclen)) } func direntNamlen(buf []byte) (uint64, bool) { reclen, ok := direntReclen(buf) if !ok { return 0, false } return reclen - uint64(unsafe.Offsetof(Dirent{}.Name)), true } func direntLeToDirentUnix(dirent *direntLE, dir uintptr, path string) (Dirent, error) { var d Dirent d.Ino = uint64(dirent.Ino) offset, err := Telldir(dir) if err != nil { return d, err } d.Off = int64(offset) s := string(bytes.Split(dirent.Name[:], []byte{0})[0]) copy(d.Name[:], s) d.Reclen = uint16(24 + len(d.NameString())) var st Stat_t path = path + "/" + s err = Lstat(path, &st) if err != nil { return d, err } d.Type = uint8(st.Mode >> 24) return d, err } func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { // Simulation of Getdirentries port from the Darwin implementation. // COMMENTS FROM DARWIN: // It's not the full required semantics, but should handle the case // of calling Getdirentries or ReadDirent repeatedly. // It won't handle assigning the results of lseek to *basep, or handle // the directory being edited underfoot. skip, err := Seek(fd, 0, 1 /* SEEK_CUR */) if err != nil { return 0, err } // Get path from fd to avoid unavailable call (fdopendir) path, err := ZosFdToPath(fd) if err != nil { return 0, err } d, err := Opendir(path) if err != nil { return 0, err } defer Closedir(d) var cnt int64 for { var entryLE direntLE var entrypLE *direntLE e := Readdir_r(d, &entryLE, &entrypLE) if e != nil { return n, e } if entrypLE == nil { break } if skip > 0 { skip-- cnt++ continue } // Dirent on zos has a different structure entry, e := direntLeToDirentUnix(&entryLE, d, path) if e != nil { return n, e } reclen := int(entry.Reclen) if reclen > len(buf) { // Not enough room. Return for now. // The counter will let us know where we should start up again. // Note: this strategy for suspending in the middle and // restarting is O(n^2) in the length of the directory. Oh well. break } // Copy entry into return buffer. s := unsafe.Slice((*byte)(unsafe.Pointer(&entry)), reclen) copy(buf, s) buf = buf[reclen:] n += reclen cnt++ } // Set the seek offset of the input fd to record // how many files we've already returned. _, err = Seek(fd, cnt, 0 /* SEEK_SET */) if err != nil { return n, err } return n, nil } func Err2ad() (eadd *int) { r0, _, _ := CallLeFuncWithErr(GetZosLibVec() + SYS___ERR2AD<<4) eadd = (*int)(unsafe.Pointer(r0)) return } func ZosConsolePrintf(format string, v ...interface{}) (int, error) { type __cmsg struct { _ uint16 _ [2]uint8 __msg_length uint32 __msg uintptr _ [4]uint8 } msg := fmt.Sprintf(format, v...) strptr := unsafe.Pointer((*reflect.StringHeader)(unsafe.Pointer(&msg)).Data) len := (*reflect.StringHeader)(unsafe.Pointer(&msg)).Len cmsg := __cmsg{__msg_length: uint32(len), __msg: uintptr(strptr)} cmd := uint32(0) runtime.EnterSyscall() rc, err2, err1 := CallLeFuncWithErr(GetZosLibVec()+SYS_____CONSOLE_A<<4, uintptr(unsafe.Pointer(&cmsg)), 0, uintptr(unsafe.Pointer(&cmd))) runtime.ExitSyscall() if rc != 0 { return 0, fmt.Errorf("%s (errno2=0x%x)\n", err1.Error(), err2) } return 0, nil } func ZosStringToEbcdicBytes(str string, nullterm bool) (ebcdicBytes []byte) { if nullterm { ebcdicBytes = []byte(str + "\x00") } else { ebcdicBytes = []byte(str) } A2e(ebcdicBytes) return } func ZosEbcdicBytesToString(b []byte, trimRight bool) (str string) { res := make([]byte, len(b)) copy(res, b) E2a(res) if trimRight { str = string(bytes.TrimRight(res, " \x00")) } else { str = string(res) } return } func fdToPath(dirfd int) (path string, err error) { var buffer [1024]byte // w_ctrl() ret := runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS_W_IOCTL<<4, []uintptr{uintptr(dirfd), 17, 1024, uintptr(unsafe.Pointer(&buffer[0]))}) if ret == 0 { zb := bytes.IndexByte(buffer[:], 0) if zb == -1 { zb = len(buffer) } // __e2a_l() runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS___E2A_L<<4, []uintptr{uintptr(unsafe.Pointer(&buffer[0])), uintptr(zb)}) return string(buffer[:zb]), nil } // __errno() errno := int(*(*int32)(unsafe.Pointer(runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS___ERRNO<<4, []uintptr{})))) // __errno2() errno2 := int(runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS___ERRNO2<<4, []uintptr{})) // strerror_r() ret = runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS_STRERROR_R<<4, []uintptr{uintptr(errno), uintptr(unsafe.Pointer(&buffer[0])), 1024}) if ret == 0 { zb := bytes.IndexByte(buffer[:], 0) if zb == -1 { zb = len(buffer) } return "", fmt.Errorf("%s (errno2=0x%x)", buffer[:zb], errno2) } else { return "", fmt.Errorf("fdToPath errno %d (errno2=0x%x)", errno, errno2) } } func impl_Mkfifoat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___MKFIFOAT_A<<4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_MkfifoatAddr() *(func(dirfd int, path string, mode uint32) (err error)) var Mkfifoat = enter_Mkfifoat func enter_Mkfifoat(dirfd int, path string, mode uint32) (err error) { funcref := get_MkfifoatAddr() if funcptrtest(GetZosLibVec()+SYS___MKFIFOAT_A<<4, "") == 0 { *funcref = impl_Mkfifoat } else { *funcref = legacy_Mkfifoat } return (*funcref)(dirfd, path, mode) } func legacy_Mkfifoat(dirfd int, path string, mode uint32) (err error) { dirname, err := ZosFdToPath(dirfd) if err != nil { return err } return Mkfifo(dirname+"/"+path, mode) } //sys Posix_openpt(oflag int) (fd int, err error) = SYS_POSIX_OPENPT //sys Grantpt(fildes int) (rc int, err error) = SYS_GRANTPT //sys Unlockpt(fildes int) (rc int, err error) = SYS_UNLOCKPT func fcntlAsIs(fd uintptr, cmd int, arg uintptr) (val int, err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FCNTL<<4, uintptr(fd), uintptr(cmd), arg) runtime.ExitSyscall() val = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } func Fcntl(fd uintptr, cmd int, op interface{}) (ret int, err error) { switch op.(type) { case *Flock_t: err = FcntlFlock(fd, cmd, op.(*Flock_t)) if err != nil { ret = -1 } return case int: return FcntlInt(fd, cmd, op.(int)) case *F_cnvrt: return fcntlAsIs(fd, cmd, uintptr(unsafe.Pointer(op.(*F_cnvrt)))) case unsafe.Pointer: return fcntlAsIs(fd, cmd, uintptr(op.(unsafe.Pointer))) default: return -1, EINVAL } return } func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { if raceenabled { raceReleaseMerge(unsafe.Pointer(&ioSync)) } return sendfile(outfd, infd, offset, count) } func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { // TODO: use LE call instead if the call is implemented originalOffset, err := Seek(infd, 0, SEEK_CUR) if err != nil { return -1, err } //start reading data from in_fd if offset != nil { _, err := Seek(infd, *offset, SEEK_SET) if err != nil { return -1, err } } buf := make([]byte, count) readBuf := make([]byte, 0) var n int = 0 for i := 0; i < count; i += n { n, err := Read(infd, buf) if n == 0 { if err != nil { return -1, err } else { // EOF break } } readBuf = append(readBuf, buf...) buf = buf[0:0] } n2, err := Write(outfd, readBuf) if err != nil { return -1, err } //When sendfile() returns, this variable will be set to the // offset of the byte following the last byte that was read. if offset != nil { *offset = *offset + int64(n) // If offset is not NULL, then sendfile() does not modify the file // offset of in_fd _, err := Seek(infd, originalOffset, SEEK_SET) if err != nil { return -1, err } } return n2, nil } ================================================ FILE: vendor/golang.org/x/sys/unix/sysvshm_linux.go ================================================ // Copyright 2021 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build linux package unix import "runtime" // SysvShmCtl performs control operations on the shared memory segment // specified by id. func SysvShmCtl(id, cmd int, desc *SysvShmDesc) (result int, err error) { if runtime.GOARCH == "arm" || runtime.GOARCH == "mips64" || runtime.GOARCH == "mips64le" { cmd |= ipc_64 } return shmctl(id, cmd, desc) } ================================================ FILE: vendor/golang.org/x/sys/unix/sysvshm_unix.go ================================================ // Copyright 2021 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build (darwin && !ios) || linux || zos package unix import "unsafe" // SysvShmAttach attaches the Sysv shared memory segment associated with the // shared memory identifier id. func SysvShmAttach(id int, addr uintptr, flag int) ([]byte, error) { addr, errno := shmat(id, addr, flag) if errno != nil { return nil, errno } // Retrieve the size of the shared memory to enable slice creation var info SysvShmDesc _, err := SysvShmCtl(id, IPC_STAT, &info) if err != nil { // release the shared memory if we can't find the size // ignoring error from shmdt as there's nothing sensible to return here shmdt(addr) return nil, err } // Use unsafe to convert addr into a []byte. b := unsafe.Slice((*byte)(unsafe.Pointer(addr)), int(info.Segsz)) return b, nil } // SysvShmDetach unmaps the shared memory slice returned from SysvShmAttach. // // It is not safe to use the slice after calling this function. func SysvShmDetach(data []byte) error { if len(data) == 0 { return EINVAL } return shmdt(uintptr(unsafe.Pointer(&data[0]))) } // SysvShmGet returns the Sysv shared memory identifier associated with key. // If the IPC_CREAT flag is specified a new segment is created. func SysvShmGet(key, size, flag int) (id int, err error) { return shmget(key, size, flag) } ================================================ FILE: vendor/golang.org/x/sys/unix/sysvshm_unix_other.go ================================================ // Copyright 2021 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build (darwin && !ios) || zos package unix // SysvShmCtl performs control operations on the shared memory segment // specified by id. func SysvShmCtl(id, cmd int, desc *SysvShmDesc) (result int, err error) { return shmctl(id, cmd, desc) } ================================================ FILE: vendor/golang.org/x/sys/unix/timestruct.go ================================================ // Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos package unix import "time" // TimespecToNsec returns the time stored in ts as nanoseconds. func TimespecToNsec(ts Timespec) int64 { return ts.Nano() } // NsecToTimespec converts a number of nanoseconds into a Timespec. func NsecToTimespec(nsec int64) Timespec { sec := nsec / 1e9 nsec = nsec % 1e9 if nsec < 0 { nsec += 1e9 sec-- } return setTimespec(sec, nsec) } // TimeToTimespec converts t into a Timespec. // On some 32-bit systems the range of valid Timespec values are smaller // than that of time.Time values. So if t is out of the valid range of // Timespec, it returns a zero Timespec and ERANGE. func TimeToTimespec(t time.Time) (Timespec, error) { sec := t.Unix() nsec := int64(t.Nanosecond()) ts := setTimespec(sec, nsec) // Currently all targets have either int32 or int64 for Timespec.Sec. // If there were a new target with floating point type for it, we have // to consider the rounding error. if int64(ts.Sec) != sec { return Timespec{}, ERANGE } return ts, nil } // TimevalToNsec returns the time stored in tv as nanoseconds. func TimevalToNsec(tv Timeval) int64 { return tv.Nano() } // NsecToTimeval converts a number of nanoseconds into a Timeval. func NsecToTimeval(nsec int64) Timeval { nsec += 999 // round up to microsecond usec := nsec % 1e9 / 1e3 sec := nsec / 1e9 if usec < 0 { usec += 1e6 sec-- } return setTimeval(sec, usec) } // Unix returns the time stored in ts as seconds plus nanoseconds. func (ts *Timespec) Unix() (sec int64, nsec int64) { return int64(ts.Sec), int64(ts.Nsec) } // Unix returns the time stored in tv as seconds plus nanoseconds. func (tv *Timeval) Unix() (sec int64, nsec int64) { return int64(tv.Sec), int64(tv.Usec) * 1000 } // Nano returns the time stored in ts as nanoseconds. func (ts *Timespec) Nano() int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } // Nano returns the time stored in tv as nanoseconds. func (tv *Timeval) Nano() int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1000 } ================================================ FILE: vendor/golang.org/x/sys/unix/unveil_openbsd.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package unix import "fmt" // Unveil implements the unveil syscall. // For more information see unveil(2). // Note that the special case of blocking further // unveil calls is handled by UnveilBlock. func Unveil(path string, flags string) error { if err := supportsUnveil(); err != nil { return err } pathPtr, err := BytePtrFromString(path) if err != nil { return err } flagsPtr, err := BytePtrFromString(flags) if err != nil { return err } return unveil(pathPtr, flagsPtr) } // UnveilBlock blocks future unveil calls. // For more information see unveil(2). func UnveilBlock() error { if err := supportsUnveil(); err != nil { return err } return unveil(nil, nil) } // supportsUnveil checks for availability of the unveil(2) system call based // on the running OpenBSD version. func supportsUnveil() error { maj, min, err := majmin() if err != nil { return err } // unveil is not available before 6.4 if maj < 6 || (maj == 6 && min <= 3) { return fmt.Errorf("cannot call Unveil on OpenBSD %d.%d", maj, min) } return nil } ================================================ FILE: vendor/golang.org/x/sys/unix/vgetrandom_linux.go ================================================ // Copyright 2024 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build linux && go1.24 package unix import _ "unsafe" //go:linkname vgetrandom runtime.vgetrandom //go:noescape func vgetrandom(p []byte, flags uint32) (ret int, supported bool) ================================================ FILE: vendor/golang.org/x/sys/unix/vgetrandom_unsupported.go ================================================ // Copyright 2024 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build !linux || !go1.24 package unix func vgetrandom(p []byte, flags uint32) (ret int, supported bool) { return -1, false } ================================================ FILE: vendor/golang.org/x/sys/unix/xattr_bsd.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build freebsd || netbsd package unix import ( "strings" "unsafe" ) // Derive extattr namespace and attribute name func xattrnamespace(fullattr string) (ns int, attr string, err error) { s := strings.IndexByte(fullattr, '.') if s == -1 { return -1, "", ENOATTR } namespace := fullattr[0:s] attr = fullattr[s+1:] switch namespace { case "user": return EXTATTR_NAMESPACE_USER, attr, nil case "system": return EXTATTR_NAMESPACE_SYSTEM, attr, nil default: return -1, "", ENOATTR } } func initxattrdest(dest []byte, idx int) (d unsafe.Pointer) { if len(dest) > idx { return unsafe.Pointer(&dest[idx]) } if dest != nil { // extattr_get_file and extattr_list_file treat NULL differently from // a non-NULL pointer of length zero. Preserve the property of nilness, // even if we can't use dest directly. return unsafe.Pointer(&_zero) } return nil } // FreeBSD and NetBSD implement their own syscalls to handle extended attributes func Getxattr(file string, attr string, dest []byte) (sz int, err error) { d := initxattrdest(dest, 0) destsize := len(dest) nsid, a, err := xattrnamespace(attr) if err != nil { return -1, err } return ExtattrGetFile(file, nsid, a, uintptr(d), destsize) } func Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) { d := initxattrdest(dest, 0) destsize := len(dest) nsid, a, err := xattrnamespace(attr) if err != nil { return -1, err } return ExtattrGetFd(fd, nsid, a, uintptr(d), destsize) } func Lgetxattr(link string, attr string, dest []byte) (sz int, err error) { d := initxattrdest(dest, 0) destsize := len(dest) nsid, a, err := xattrnamespace(attr) if err != nil { return -1, err } return ExtattrGetLink(link, nsid, a, uintptr(d), destsize) } // flags are unused on FreeBSD func Fsetxattr(fd int, attr string, data []byte, flags int) (err error) { var d unsafe.Pointer if len(data) > 0 { d = unsafe.Pointer(&data[0]) } datasiz := len(data) nsid, a, err := xattrnamespace(attr) if err != nil { return } _, err = ExtattrSetFd(fd, nsid, a, uintptr(d), datasiz) return } func Setxattr(file string, attr string, data []byte, flags int) (err error) { var d unsafe.Pointer if len(data) > 0 { d = unsafe.Pointer(&data[0]) } datasiz := len(data) nsid, a, err := xattrnamespace(attr) if err != nil { return } _, err = ExtattrSetFile(file, nsid, a, uintptr(d), datasiz) return } func Lsetxattr(link string, attr string, data []byte, flags int) (err error) { var d unsafe.Pointer if len(data) > 0 { d = unsafe.Pointer(&data[0]) } datasiz := len(data) nsid, a, err := xattrnamespace(attr) if err != nil { return } _, err = ExtattrSetLink(link, nsid, a, uintptr(d), datasiz) return } func Removexattr(file string, attr string) (err error) { nsid, a, err := xattrnamespace(attr) if err != nil { return } err = ExtattrDeleteFile(file, nsid, a) return } func Fremovexattr(fd int, attr string) (err error) { nsid, a, err := xattrnamespace(attr) if err != nil { return } err = ExtattrDeleteFd(fd, nsid, a) return } func Lremovexattr(link string, attr string) (err error) { nsid, a, err := xattrnamespace(attr) if err != nil { return } err = ExtattrDeleteLink(link, nsid, a) return } func Listxattr(file string, dest []byte) (sz int, err error) { destsiz := len(dest) // FreeBSD won't allow you to list xattrs from multiple namespaces s, pos := 0, 0 for _, nsid := range [...]int{EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM} { stmp, e := ListxattrNS(file, nsid, dest[pos:]) /* Errors accessing system attrs are ignored so that * we can implement the Linux-like behavior of omitting errors that * we don't have read permissions on * * Linux will still error if we ask for user attributes on a file that * we don't have read permissions on, so don't ignore those errors */ if e != nil { if e == EPERM && nsid != EXTATTR_NAMESPACE_USER { continue } return s, e } s += stmp pos = s if pos > destsiz { pos = destsiz } } return s, nil } func ListxattrNS(file string, nsid int, dest []byte) (sz int, err error) { d := initxattrdest(dest, 0) destsiz := len(dest) s, e := ExtattrListFile(file, nsid, uintptr(d), destsiz) if e != nil { return 0, err } return s, nil } func Flistxattr(fd int, dest []byte) (sz int, err error) { destsiz := len(dest) s, pos := 0, 0 for _, nsid := range [...]int{EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM} { stmp, e := FlistxattrNS(fd, nsid, dest[pos:]) if e != nil { if e == EPERM && nsid != EXTATTR_NAMESPACE_USER { continue } return s, e } s += stmp pos = s if pos > destsiz { pos = destsiz } } return s, nil } func FlistxattrNS(fd int, nsid int, dest []byte) (sz int, err error) { d := initxattrdest(dest, 0) destsiz := len(dest) s, e := ExtattrListFd(fd, nsid, uintptr(d), destsiz) if e != nil { return 0, err } return s, nil } func Llistxattr(link string, dest []byte) (sz int, err error) { destsiz := len(dest) s, pos := 0, 0 for _, nsid := range [...]int{EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM} { stmp, e := LlistxattrNS(link, nsid, dest[pos:]) if e != nil { if e == EPERM && nsid != EXTATTR_NAMESPACE_USER { continue } return s, e } s += stmp pos = s if pos > destsiz { pos = destsiz } } return s, nil } func LlistxattrNS(link string, nsid int, dest []byte) (sz int, err error) { d := initxattrdest(dest, 0) destsiz := len(dest) s, e := ExtattrListLink(link, nsid, uintptr(d), destsiz) if e != nil { return 0, err } return s, nil } ================================================ FILE: vendor/golang.org/x/sys/unix/zerrors_aix_ppc.go ================================================ // mkerrors.sh -maix32 // Code generated by the command above; see README.md. DO NOT EDIT. //go:build ppc && aix // Created by cgo -godefs - DO NOT EDIT // cgo -godefs -- -maix32 _const.go package unix import "syscall" const ( AF_APPLETALK = 0x10 AF_BYPASS = 0x19 AF_CCITT = 0xa AF_CHAOS = 0x5 AF_DATAKIT = 0x9 AF_DECnet = 0xc AF_DLI = 0xd AF_ECMA = 0x8 AF_HYLINK = 0xf AF_IMPLINK = 0x3 AF_INET = 0x2 AF_INET6 = 0x18 AF_INTF = 0x14 AF_ISO = 0x7 AF_LAT = 0xe AF_LINK = 0x12 AF_LOCAL = 0x1 AF_MAX = 0x1e AF_NDD = 0x17 AF_NETWARE = 0x16 AF_NS = 0x6 AF_OSI = 0x7 AF_PUP = 0x4 AF_RIF = 0x15 AF_ROUTE = 0x11 AF_SNA = 0xb AF_UNIX = 0x1 AF_UNSPEC = 0x0 ALTWERASE = 0x400000 ARPHRD_802_3 = 0x6 ARPHRD_802_5 = 0x6 ARPHRD_ETHER = 0x1 ARPHRD_FDDI = 0x1 B0 = 0x0 B110 = 0x3 B1200 = 0x9 B134 = 0x4 B150 = 0x5 B1800 = 0xa B19200 = 0xe B200 = 0x6 B2400 = 0xb B300 = 0x7 B38400 = 0xf B4800 = 0xc B50 = 0x1 B600 = 0x8 B75 = 0x2 B9600 = 0xd BRKINT = 0x2 BS0 = 0x0 BS1 = 0x1000 BSDLY = 0x1000 CAP_AACCT = 0x6 CAP_ARM_APPLICATION = 0x5 CAP_BYPASS_RAC_VMM = 0x3 CAP_CLEAR = 0x0 CAP_CREDENTIALS = 0x7 CAP_EFFECTIVE = 0x1 CAP_EWLM_AGENT = 0x4 CAP_INHERITABLE = 0x2 CAP_MAXIMUM = 0x7 CAP_NUMA_ATTACH = 0x2 CAP_PERMITTED = 0x3 CAP_PROPAGATE = 0x1 CAP_PROPOGATE = 0x1 CAP_SET = 0x1 CBAUD = 0xf CFLUSH = 0xf CIBAUD = 0xf0000 CLOCAL = 0x800 CLOCK_MONOTONIC = 0xa CLOCK_PROCESS_CPUTIME_ID = 0xb CLOCK_REALTIME = 0x9 CLOCK_THREAD_CPUTIME_ID = 0xc CR0 = 0x0 CR1 = 0x100 CR2 = 0x200 CR3 = 0x300 CRDLY = 0x300 CREAD = 0x80 CS5 = 0x0 CS6 = 0x10 CS7 = 0x20 CS8 = 0x30 CSIOCGIFCONF = -0x3ff796dc CSIZE = 0x30 CSMAP_DIR = "/usr/lib/nls/csmap/" CSTART = '\021' CSTOP = '\023' CSTOPB = 0x40 CSUSP = 0x1a ECHO = 0x8 ECHOCTL = 0x20000 ECHOE = 0x10 ECHOK = 0x20 ECHOKE = 0x80000 ECHONL = 0x40 ECHOPRT = 0x40000 ECH_ICMPID = 0x2 ETHERNET_CSMACD = 0x6 EVENP = 0x80 EXCONTINUE = 0x0 EXDLOK = 0x3 EXIO = 0x2 EXPGIO = 0x0 EXRESUME = 0x2 EXRETURN = 0x1 EXSIG = 0x4 EXTA = 0xe EXTB = 0xf EXTRAP = 0x1 EYEC_RTENTRYA = 0x257274656e747241 EYEC_RTENTRYF = 0x257274656e747246 E_ACC = 0x0 FD_CLOEXEC = 0x1 FD_SETSIZE = 0xfffe FF0 = 0x0 FF1 = 0x2000 FFDLY = 0x2000 FLUSHBAND = 0x40 FLUSHLOW = 0x8 FLUSHO = 0x100000 FLUSHR = 0x1 FLUSHRW = 0x3 FLUSHW = 0x2 F_CLOSEM = 0xa F_DUP2FD = 0xe F_DUPFD = 0x0 F_GETFD = 0x1 F_GETFL = 0x3 F_GETLK = 0x5 F_GETLK64 = 0xb F_GETOWN = 0x8 F_LOCK = 0x1 F_OK = 0x0 F_RDLCK = 0x1 F_SETFD = 0x2 F_SETFL = 0x4 F_SETLK = 0x6 F_SETLK64 = 0xc F_SETLKW = 0x7 F_SETLKW64 = 0xd F_SETOWN = 0x9 F_TEST = 0x3 F_TLOCK = 0x2 F_TSTLK = 0xf F_ULOCK = 0x0 F_UNLCK = 0x3 F_WRLCK = 0x2 HUPCL = 0x400 IBSHIFT = 0x10 ICANON = 0x2 ICMP6_FILTER = 0x26 ICMP6_SEC_SEND_DEL = 0x46 ICMP6_SEC_SEND_GET = 0x47 ICMP6_SEC_SEND_SET = 0x44 ICMP6_SEC_SEND_SET_CGA_ADDR = 0x45 ICRNL = 0x100 IEXTEN = 0x200000 IFA_FIRSTALIAS = 0x2000 IFA_ROUTE = 0x1 IFF_64BIT = 0x4000000 IFF_ALLCAST = 0x20000 IFF_ALLMULTI = 0x200 IFF_BPF = 0x8000000 IFF_BRIDGE = 0x40000 IFF_BROADCAST = 0x2 IFF_CANTCHANGE = 0x80c52 IFF_CHECKSUM_OFFLOAD = 0x10000000 IFF_D1 = 0x8000 IFF_D2 = 0x4000 IFF_D3 = 0x2000 IFF_D4 = 0x1000 IFF_DEBUG = 0x4 IFF_DEVHEALTH = 0x4000 IFF_DO_HW_LOOPBACK = 0x10000 IFF_GROUP_ROUTING = 0x2000000 IFF_IFBUFMGT = 0x800000 IFF_LINK0 = 0x100000 IFF_LINK1 = 0x200000 IFF_LINK2 = 0x400000 IFF_LOOPBACK = 0x8 IFF_MULTICAST = 0x80000 IFF_NOARP = 0x80 IFF_NOECHO = 0x800 IFF_NOTRAILERS = 0x20 IFF_OACTIVE = 0x400 IFF_POINTOPOINT = 0x10 IFF_PROMISC = 0x100 IFF_PSEG = 0x40000000 IFF_RUNNING = 0x40 IFF_SIMPLEX = 0x800 IFF_SNAP = 0x8000 IFF_TCP_DISABLE_CKSUM = 0x20000000 IFF_TCP_NOCKSUM = 0x1000000 IFF_UP = 0x1 IFF_VIPA = 0x80000000 IFNAMSIZ = 0x10 IFO_FLUSH = 0x1 IFT_1822 = 0x2 IFT_AAL5 = 0x31 IFT_ARCNET = 0x23 IFT_ARCNETPLUS = 0x24 IFT_ATM = 0x25 IFT_CEPT = 0x13 IFT_CLUSTER = 0x3e IFT_DS3 = 0x1e IFT_EON = 0x19 IFT_ETHER = 0x6 IFT_FCS = 0x3a IFT_FDDI = 0xf IFT_FRELAY = 0x20 IFT_FRELAYDCE = 0x2c IFT_GIFTUNNEL = 0x3c IFT_HDH1822 = 0x3 IFT_HF = 0x3d IFT_HIPPI = 0x2f IFT_HSSI = 0x2e IFT_HY = 0xe IFT_IB = 0xc7 IFT_ISDNBASIC = 0x14 IFT_ISDNPRIMARY = 0x15 IFT_ISO88022LLC = 0x29 IFT_ISO88023 = 0x7 IFT_ISO88024 = 0x8 IFT_ISO88025 = 0x9 IFT_ISO88026 = 0xa IFT_LAPB = 0x10 IFT_LOCALTALK = 0x2a IFT_LOOP = 0x18 IFT_MIOX25 = 0x26 IFT_MODEM = 0x30 IFT_NSIP = 0x1b IFT_OTHER = 0x1 IFT_P10 = 0xc IFT_P80 = 0xd IFT_PARA = 0x22 IFT_PPP = 0x17 IFT_PROPMUX = 0x36 IFT_PROPVIRTUAL = 0x35 IFT_PTPSERIAL = 0x16 IFT_RS232 = 0x21 IFT_SDLC = 0x11 IFT_SIP = 0x1f IFT_SLIP = 0x1c IFT_SMDSDXI = 0x2b IFT_SMDSICIP = 0x34 IFT_SN = 0x38 IFT_SONET = 0x27 IFT_SONETPATH = 0x32 IFT_SONETVT = 0x33 IFT_SP = 0x39 IFT_STARLAN = 0xb IFT_T1 = 0x12 IFT_TUNNEL = 0x3b IFT_ULTRA = 0x1d IFT_V35 = 0x2d IFT_VIPA = 0x37 IFT_X25 = 0x5 IFT_X25DDN = 0x4 IFT_X25PLE = 0x28 IFT_XETHER = 0x1a IGNBRK = 0x1 IGNCR = 0x80 IGNPAR = 0x4 IMAXBEL = 0x10000 INLCR = 0x40 INPCK = 0x10 IN_CLASSA_HOST = 0xffffff IN_CLASSA_MAX = 0x80 IN_CLASSA_NET = 0xff000000 IN_CLASSA_NSHIFT = 0x18 IN_CLASSB_HOST = 0xffff IN_CLASSB_MAX = 0x10000 IN_CLASSB_NET = 0xffff0000 IN_CLASSB_NSHIFT = 0x10 IN_CLASSC_HOST = 0xff IN_CLASSC_NET = 0xffffff00 IN_CLASSC_NSHIFT = 0x8 IN_CLASSD_HOST = 0xfffffff IN_CLASSD_NET = 0xf0000000 IN_CLASSD_NSHIFT = 0x1c IN_LOOPBACKNET = 0x7f IN_USE = 0x1 IPPROTO_AH = 0x33 IPPROTO_BIP = 0x53 IPPROTO_DSTOPTS = 0x3c IPPROTO_EGP = 0x8 IPPROTO_EON = 0x50 IPPROTO_ESP = 0x32 IPPROTO_FRAGMENT = 0x2c IPPROTO_GGP = 0x3 IPPROTO_GIF = 0x8c IPPROTO_GRE = 0x2f IPPROTO_HOPOPTS = 0x0 IPPROTO_ICMP = 0x1 IPPROTO_ICMPV6 = 0x3a IPPROTO_IDP = 0x16 IPPROTO_IGMP = 0x2 IPPROTO_IP = 0x0 IPPROTO_IPIP = 0x4 IPPROTO_IPV6 = 0x29 IPPROTO_LOCAL = 0x3f IPPROTO_MAX = 0x100 IPPROTO_MH = 0x87 IPPROTO_NONE = 0x3b IPPROTO_PUP = 0xc IPPROTO_QOS = 0x2d IPPROTO_RAW = 0xff IPPROTO_ROUTING = 0x2b IPPROTO_RSVP = 0x2e IPPROTO_SCTP = 0x84 IPPROTO_TCP = 0x6 IPPROTO_TP = 0x1d IPPROTO_UDP = 0x11 IPV6_ADDRFORM = 0x16 IPV6_ADDR_PREFERENCES = 0x4a IPV6_ADD_MEMBERSHIP = 0xc IPV6_AIXRAWSOCKET = 0x39 IPV6_CHECKSUM = 0x27 IPV6_DONTFRAG = 0x2d IPV6_DROP_MEMBERSHIP = 0xd IPV6_DSTOPTS = 0x36 IPV6_FLOWINFO_FLOWLABEL = 0xffffff IPV6_FLOWINFO_PRIFLOW = 0xfffffff IPV6_FLOWINFO_PRIORITY = 0xf000000 IPV6_FLOWINFO_SRFLAG = 0x10000000 IPV6_FLOWINFO_VERSION = 0xf0000000 IPV6_HOPLIMIT = 0x28 IPV6_HOPOPTS = 0x34 IPV6_JOIN_GROUP = 0xc IPV6_LEAVE_GROUP = 0xd IPV6_MIPDSTOPTS = 0x36 IPV6_MULTICAST_HOPS = 0xa IPV6_MULTICAST_IF = 0x9 IPV6_MULTICAST_LOOP = 0xb IPV6_NEXTHOP = 0x30 IPV6_NOPROBE = 0x1c IPV6_PATHMTU = 0x2e IPV6_PKTINFO = 0x21 IPV6_PKTOPTIONS = 0x24 IPV6_PRIORITY_10 = 0xa000000 IPV6_PRIORITY_11 = 0xb000000 IPV6_PRIORITY_12 = 0xc000000 IPV6_PRIORITY_13 = 0xd000000 IPV6_PRIORITY_14 = 0xe000000 IPV6_PRIORITY_15 = 0xf000000 IPV6_PRIORITY_8 = 0x8000000 IPV6_PRIORITY_9 = 0x9000000 IPV6_PRIORITY_BULK = 0x4000000 IPV6_PRIORITY_CONTROL = 0x7000000 IPV6_PRIORITY_FILLER = 0x1000000 IPV6_PRIORITY_INTERACTIVE = 0x6000000 IPV6_PRIORITY_RESERVED1 = 0x3000000 IPV6_PRIORITY_RESERVED2 = 0x5000000 IPV6_PRIORITY_UNATTENDED = 0x2000000 IPV6_PRIORITY_UNCHARACTERIZED = 0x0 IPV6_RECVDSTOPTS = 0x38 IPV6_RECVHOPLIMIT = 0x29 IPV6_RECVHOPOPTS = 0x35 IPV6_RECVHOPS = 0x22 IPV6_RECVIF = 0x1e IPV6_RECVPATHMTU = 0x2f IPV6_RECVPKTINFO = 0x23 IPV6_RECVRTHDR = 0x33 IPV6_RECVSRCRT = 0x1d IPV6_RECVTCLASS = 0x2a IPV6_RTHDR = 0x32 IPV6_RTHDRDSTOPTS = 0x37 IPV6_RTHDR_TYPE_0 = 0x0 IPV6_RTHDR_TYPE_2 = 0x2 IPV6_SENDIF = 0x1f IPV6_SRFLAG_LOOSE = 0x0 IPV6_SRFLAG_STRICT = 0x10000000 IPV6_TCLASS = 0x2b IPV6_TOKEN_LENGTH = 0x40 IPV6_UNICAST_HOPS = 0x4 IPV6_USE_MIN_MTU = 0x2c IPV6_V6ONLY = 0x25 IPV6_VERSION = 0x60000000 IP_ADDRFORM = 0x16 IP_ADD_MEMBERSHIP = 0xc IP_ADD_SOURCE_MEMBERSHIP = 0x3c IP_BLOCK_SOURCE = 0x3a IP_BROADCAST_IF = 0x10 IP_CACHE_LINE_SIZE = 0x80 IP_DEFAULT_MULTICAST_LOOP = 0x1 IP_DEFAULT_MULTICAST_TTL = 0x1 IP_DF = 0x4000 IP_DHCPMODE = 0x11 IP_DONTFRAG = 0x19 IP_DROP_MEMBERSHIP = 0xd IP_DROP_SOURCE_MEMBERSHIP = 0x3d IP_FINDPMTU = 0x1a IP_HDRINCL = 0x2 IP_INC_MEMBERSHIPS = 0x14 IP_INIT_MEMBERSHIP = 0x14 IP_MAXPACKET = 0xffff IP_MF = 0x2000 IP_MSS = 0x240 IP_MULTICAST_HOPS = 0xa IP_MULTICAST_IF = 0x9 IP_MULTICAST_LOOP = 0xb IP_MULTICAST_TTL = 0xa IP_OPT = 0x1b IP_OPTIONS = 0x1 IP_PMTUAGE = 0x1b IP_RECVDSTADDR = 0x7 IP_RECVIF = 0x14 IP_RECVIFINFO = 0xf IP_RECVINTERFACE = 0x20 IP_RECVMACHDR = 0xe IP_RECVOPTS = 0x5 IP_RECVRETOPTS = 0x6 IP_RECVTTL = 0x22 IP_RETOPTS = 0x8 IP_SOURCE_FILTER = 0x48 IP_TOS = 0x3 IP_TTL = 0x4 IP_UNBLOCK_SOURCE = 0x3b IP_UNICAST_HOPS = 0x4 ISIG = 0x1 ISTRIP = 0x20 IUCLC = 0x800 IXANY = 0x1000 IXOFF = 0x400 IXON = 0x200 I_FLUSH = 0x20005305 LNOFLSH = 0x8000 LOCK_EX = 0x2 LOCK_NB = 0x4 LOCK_SH = 0x1 LOCK_UN = 0x8 MADV_DONTNEED = 0x4 MADV_NORMAL = 0x0 MADV_RANDOM = 0x1 MADV_SEQUENTIAL = 0x2 MADV_SPACEAVAIL = 0x5 MADV_WILLNEED = 0x3 MAP_ANON = 0x10 MAP_ANONYMOUS = 0x10 MAP_FILE = 0x0 MAP_FIXED = 0x100 MAP_PRIVATE = 0x2 MAP_SHARED = 0x1 MAP_TYPE = 0xf0 MAP_VARIABLE = 0x0 MCAST_BLOCK_SOURCE = 0x40 MCAST_EXCLUDE = 0x2 MCAST_INCLUDE = 0x1 MCAST_JOIN_GROUP = 0x3e MCAST_JOIN_SOURCE_GROUP = 0x42 MCAST_LEAVE_GROUP = 0x3f MCAST_LEAVE_SOURCE_GROUP = 0x43 MCAST_SOURCE_FILTER = 0x49 MCAST_UNBLOCK_SOURCE = 0x41 MCL_CURRENT = 0x100 MCL_FUTURE = 0x200 MSG_ANY = 0x4 MSG_ARGEXT = 0x400 MSG_BAND = 0x2 MSG_COMPAT = 0x8000 MSG_CTRUNC = 0x20 MSG_DONTROUTE = 0x4 MSG_EOR = 0x8 MSG_HIPRI = 0x1 MSG_MAXIOVLEN = 0x10 MSG_MPEG2 = 0x80 MSG_NONBLOCK = 0x4000 MSG_NOSIGNAL = 0x100 MSG_OOB = 0x1 MSG_PEEK = 0x2 MSG_TRUNC = 0x10 MSG_WAITALL = 0x40 MSG_WAITFORONE = 0x200 MS_ASYNC = 0x10 MS_EINTR = 0x80 MS_INVALIDATE = 0x40 MS_PER_SEC = 0x3e8 MS_SYNC = 0x20 NFDBITS = 0x20 NL0 = 0x0 NL1 = 0x4000 NL2 = 0x8000 NL3 = 0xc000 NLDLY = 0x4000 NOFLSH = 0x80 NOFLUSH = 0x80000000 OCRNL = 0x8 OFDEL = 0x80 OFILL = 0x40 OLCUC = 0x2 ONLCR = 0x4 ONLRET = 0x20 ONOCR = 0x10 ONOEOT = 0x80000 OPOST = 0x1 OXTABS = 0x40000 O_ACCMODE = 0x23 O_APPEND = 0x8 O_CIO = 0x80 O_CIOR = 0x800000000 O_CLOEXEC = 0x800000 O_CREAT = 0x100 O_DEFER = 0x2000 O_DELAY = 0x4000 O_DIRECT = 0x8000000 O_DIRECTORY = 0x80000 O_DSYNC = 0x400000 O_EFSOFF = 0x400000000 O_EFSON = 0x200000000 O_EXCL = 0x400 O_EXEC = 0x20 O_LARGEFILE = 0x4000000 O_NDELAY = 0x8000 O_NOCACHE = 0x100000 O_NOCTTY = 0x800 O_NOFOLLOW = 0x1000000 O_NONBLOCK = 0x4 O_NONE = 0x3 O_NSHARE = 0x10000 O_RAW = 0x100000000 O_RDONLY = 0x0 O_RDWR = 0x2 O_RSHARE = 0x1000 O_RSYNC = 0x200000 O_SEARCH = 0x20 O_SNAPSHOT = 0x40 O_SYNC = 0x10 O_TRUNC = 0x200 O_TTY_INIT = 0x0 O_WRONLY = 0x1 PARENB = 0x100 PAREXT = 0x100000 PARMRK = 0x8 PARODD = 0x200 PENDIN = 0x20000000 PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 PROT_EXEC = 0x4 PROT_NONE = 0x0 PROT_READ = 0x1 PROT_WRITE = 0x2 PR_64BIT = 0x20 PR_ADDR = 0x2 PR_ARGEXT = 0x400 PR_ATOMIC = 0x1 PR_CONNREQUIRED = 0x4 PR_FASTHZ = 0x5 PR_INP = 0x40 PR_INTRLEVEL = 0x8000 PR_MLS = 0x100 PR_MLS_1_LABEL = 0x200 PR_NOEOR = 0x4000 PR_RIGHTS = 0x10 PR_SLOWHZ = 0x2 PR_WANTRCVD = 0x8 RLIMIT_AS = 0x6 RLIMIT_CORE = 0x4 RLIMIT_CPU = 0x0 RLIMIT_DATA = 0x2 RLIMIT_FSIZE = 0x1 RLIMIT_NOFILE = 0x7 RLIMIT_NPROC = 0x9 RLIMIT_RSS = 0x5 RLIMIT_STACK = 0x3 RLIM_INFINITY = 0x7fffffff RTAX_AUTHOR = 0x6 RTAX_BRD = 0x7 RTAX_DST = 0x0 RTAX_GATEWAY = 0x1 RTAX_GENMASK = 0x3 RTAX_IFA = 0x5 RTAX_IFP = 0x4 RTAX_MAX = 0x8 RTAX_NETMASK = 0x2 RTA_AUTHOR = 0x40 RTA_BRD = 0x80 RTA_DOWNSTREAM = 0x100 RTA_DST = 0x1 RTA_GATEWAY = 0x2 RTA_GENMASK = 0x8 RTA_IFA = 0x20 RTA_IFP = 0x10 RTA_NETMASK = 0x4 RTC_IA64 = 0x3 RTC_POWER = 0x1 RTC_POWER_PC = 0x2 RTF_ACTIVE_DGD = 0x1000000 RTF_BCE = 0x80000 RTF_BLACKHOLE = 0x1000 RTF_BROADCAST = 0x400000 RTF_BUL = 0x2000 RTF_CLONE = 0x10000 RTF_CLONED = 0x20000 RTF_CLONING = 0x100 RTF_DONE = 0x40 RTF_DYNAMIC = 0x10 RTF_FREE_IN_PROG = 0x4000000 RTF_GATEWAY = 0x2 RTF_HOST = 0x4 RTF_LLINFO = 0x400 RTF_LOCAL = 0x200000 RTF_MASK = 0x80 RTF_MODIFIED = 0x20 RTF_MULTICAST = 0x800000 RTF_PERMANENT6 = 0x8000000 RTF_PINNED = 0x100000 RTF_PROTO1 = 0x8000 RTF_PROTO2 = 0x4000 RTF_PROTO3 = 0x40000 RTF_REJECT = 0x8 RTF_SMALLMTU = 0x40000 RTF_STATIC = 0x800 RTF_STOPSRCH = 0x2000000 RTF_UNREACHABLE = 0x10000000 RTF_UP = 0x1 RTF_XRESOLVE = 0x200 RTM_ADD = 0x1 RTM_CHANGE = 0x3 RTM_DELADDR = 0xd RTM_DELETE = 0x2 RTM_EXPIRE = 0xf RTM_GET = 0x4 RTM_GETNEXT = 0x11 RTM_IFINFO = 0xe RTM_LOCK = 0x8 RTM_LOSING = 0x5 RTM_MISS = 0x7 RTM_NEWADDR = 0xc RTM_OLDADD = 0x9 RTM_OLDDEL = 0xa RTM_REDIRECT = 0x6 RTM_RESOLVE = 0xb RTM_RTLOST = 0x10 RTM_RTTUNIT = 0xf4240 RTM_SAMEADDR = 0x12 RTM_SET = 0x13 RTM_VERSION = 0x2 RTM_VERSION_GR = 0x4 RTM_VERSION_GR_COMPAT = 0x3 RTM_VERSION_POLICY = 0x5 RTM_VERSION_POLICY_EXT = 0x6 RTM_VERSION_POLICY_PRFN = 0x7 RTV_EXPIRE = 0x4 RTV_HOPCOUNT = 0x2 RTV_MTU = 0x1 RTV_RPIPE = 0x8 RTV_RTT = 0x40 RTV_RTTVAR = 0x80 RTV_SPIPE = 0x10 RTV_SSTHRESH = 0x20 RUSAGE_CHILDREN = -0x1 RUSAGE_SELF = 0x0 RUSAGE_THREAD = 0x1 SCM_RIGHTS = 0x1 SHUT_RD = 0x0 SHUT_RDWR = 0x2 SHUT_WR = 0x1 SIGMAX64 = 0xff SIGQUEUE_MAX = 0x20 SIOCADDIFVIPA = 0x20006942 SIOCADDMTU = -0x7ffb9690 SIOCADDMULTI = -0x7fdf96cf SIOCADDNETID = -0x7fd796a9 SIOCADDRT = -0x7fcf8df6 SIOCAIFADDR = -0x7fbf96e6 SIOCATMARK = 0x40047307 SIOCDARP = -0x7fb396e0 SIOCDELIFVIPA = 0x20006943 SIOCDELMTU = -0x7ffb968f SIOCDELMULTI = -0x7fdf96ce SIOCDELPMTU = -0x7fd78ff6 SIOCDELRT = -0x7fcf8df5 SIOCDIFADDR = -0x7fd796e7 SIOCDNETOPT = -0x3ffe9680 SIOCDX25XLATE = -0x7fd7969b SIOCFIFADDR = -0x7fdf966d SIOCGARP = -0x3fb396da SIOCGETMTUS = 0x2000696f SIOCGETSGCNT = -0x3feb8acc SIOCGETVIFCNT = -0x3feb8acd SIOCGHIWAT = 0x40047301 SIOCGIFADDR = -0x3fd796df SIOCGIFADDRS = 0x2000698c SIOCGIFBAUDRATE = -0x3fdf9669 SIOCGIFBRDADDR = -0x3fd796dd SIOCGIFCONF = -0x3ff796bb SIOCGIFCONFGLOB = -0x3ff79670 SIOCGIFDSTADDR = -0x3fd796de SIOCGIFFLAGS = -0x3fd796ef SIOCGIFGIDLIST = 0x20006968 SIOCGIFHWADDR = -0x3fab966b SIOCGIFMETRIC = -0x3fd796e9 SIOCGIFMTU = -0x3fd796aa SIOCGIFNETMASK = -0x3fd796db SIOCGIFOPTIONS = -0x3fd796d6 SIOCGISNO = -0x3fd79695 SIOCGLOADF = -0x3ffb967e SIOCGLOWAT = 0x40047303 SIOCGNETOPT = -0x3ffe96a5 SIOCGNETOPT1 = -0x3fdf967f SIOCGNMTUS = 0x2000696e SIOCGPGRP = 0x40047309 SIOCGSIZIFCONF = 0x4004696a SIOCGSRCFILTER = -0x3fe796cb SIOCGTUNEPHASE = -0x3ffb9676 SIOCGX25XLATE = -0x3fd7969c SIOCIFATTACH = -0x7fdf9699 SIOCIFDETACH = -0x7fdf969a SIOCIFGETPKEY = -0x7fdf969b SIOCIF_ATM_DARP = -0x7fdf9683 SIOCIF_ATM_DUMPARP = -0x7fdf9685 SIOCIF_ATM_GARP = -0x7fdf9682 SIOCIF_ATM_IDLE = -0x7fdf9686 SIOCIF_ATM_SARP = -0x7fdf9681 SIOCIF_ATM_SNMPARP = -0x7fdf9687 SIOCIF_ATM_SVC = -0x7fdf9684 SIOCIF_ATM_UBR = -0x7fdf9688 SIOCIF_DEVHEALTH = -0x7ffb966c SIOCIF_IB_ARP_INCOMP = -0x7fdf9677 SIOCIF_IB_ARP_TIMER = -0x7fdf9678 SIOCIF_IB_CLEAR_PINFO = -0x3fdf966f SIOCIF_IB_DEL_ARP = -0x7fdf967f SIOCIF_IB_DEL_PINFO = -0x3fdf9670 SIOCIF_IB_DUMP_ARP = -0x7fdf9680 SIOCIF_IB_GET_ARP = -0x7fdf967e SIOCIF_IB_GET_INFO = -0x3f879675 SIOCIF_IB_GET_STATS = -0x3f879672 SIOCIF_IB_NOTIFY_ADDR_REM = -0x3f87966a SIOCIF_IB_RESET_STATS = -0x3f879671 SIOCIF_IB_RESIZE_CQ = -0x7fdf9679 SIOCIF_IB_SET_ARP = -0x7fdf967d SIOCIF_IB_SET_PKEY = -0x7fdf967c SIOCIF_IB_SET_PORT = -0x7fdf967b SIOCIF_IB_SET_QKEY = -0x7fdf9676 SIOCIF_IB_SET_QSIZE = -0x7fdf967a SIOCLISTIFVIPA = 0x20006944 SIOCSARP = -0x7fb396e2 SIOCSHIWAT = 0x80047300 SIOCSIFADDR = -0x7fd796f4 SIOCSIFADDRORI = -0x7fdb9673 SIOCSIFBRDADDR = -0x7fd796ed SIOCSIFDSTADDR = -0x7fd796f2 SIOCSIFFLAGS = -0x7fd796f0 SIOCSIFGIDLIST = 0x20006969 SIOCSIFMETRIC = -0x7fd796e8 SIOCSIFMTU = -0x7fd796a8 SIOCSIFNETDUMP = -0x7fd796e4 SIOCSIFNETMASK = -0x7fd796ea SIOCSIFOPTIONS = -0x7fd796d7 SIOCSIFSUBCHAN = -0x7fd796e5 SIOCSISNO = -0x7fd79694 SIOCSLOADF = -0x3ffb967d SIOCSLOWAT = 0x80047302 SIOCSNETOPT = -0x7ffe96a6 SIOCSPGRP = 0x80047308 SIOCSX25XLATE = -0x7fd7969d SOCK_CONN_DGRAM = 0x6 SOCK_DGRAM = 0x2 SOCK_RAW = 0x3 SOCK_RDM = 0x4 SOCK_SEQPACKET = 0x5 SOCK_STREAM = 0x1 SOL_SOCKET = 0xffff SOMAXCONN = 0x400 SO_ACCEPTCONN = 0x2 SO_AUDIT = 0x8000 SO_BROADCAST = 0x20 SO_CKSUMRECV = 0x800 SO_DEBUG = 0x1 SO_DONTROUTE = 0x10 SO_ERROR = 0x1007 SO_KEEPALIVE = 0x8 SO_KERNACCEPT = 0x2000 SO_LINGER = 0x80 SO_NOMULTIPATH = 0x4000 SO_NOREUSEADDR = 0x1000 SO_OOBINLINE = 0x100 SO_PEERID = 0x1009 SO_RCVBUF = 0x1002 SO_RCVLOWAT = 0x1004 SO_RCVTIMEO = 0x1006 SO_REUSEADDR = 0x4 SO_REUSEPORT = 0x200 SO_SNDBUF = 0x1001 SO_SNDLOWAT = 0x1003 SO_SNDTIMEO = 0x1005 SO_TIMESTAMPNS = 0x100a SO_TYPE = 0x1008 SO_USELOOPBACK = 0x40 SO_USE_IFBUFS = 0x400 S_BANDURG = 0x400 S_EMODFMT = 0x3c000000 S_ENFMT = 0x400 S_ERROR = 0x100 S_HANGUP = 0x200 S_HIPRI = 0x2 S_ICRYPTO = 0x80000 S_IEXEC = 0x40 S_IFBLK = 0x6000 S_IFCHR = 0x2000 S_IFDIR = 0x4000 S_IFIFO = 0x1000 S_IFJOURNAL = 0x10000 S_IFLNK = 0xa000 S_IFMPX = 0x2200 S_IFMT = 0xf000 S_IFPDIR = 0x4000000 S_IFPSDIR = 0x8000000 S_IFPSSDIR = 0xc000000 S_IFREG = 0x8000 S_IFSOCK = 0xc000 S_IFSYSEA = 0x30000000 S_INPUT = 0x1 S_IREAD = 0x100 S_IRGRP = 0x20 S_IROTH = 0x4 S_IRUSR = 0x100 S_IRWXG = 0x38 S_IRWXO = 0x7 S_IRWXU = 0x1c0 S_ISGID = 0x400 S_ISUID = 0x800 S_ISVTX = 0x200 S_ITCB = 0x1000000 S_ITP = 0x800000 S_IWGRP = 0x10 S_IWOTH = 0x2 S_IWRITE = 0x80 S_IWUSR = 0x80 S_IXACL = 0x2000000 S_IXATTR = 0x40000 S_IXGRP = 0x8 S_IXINTERFACE = 0x100000 S_IXMOD = 0x40000000 S_IXOTH = 0x1 S_IXUSR = 0x40 S_MSG = 0x8 S_OUTPUT = 0x4 S_RDBAND = 0x20 S_RDNORM = 0x10 S_RESERVED1 = 0x20000 S_RESERVED2 = 0x200000 S_RESERVED3 = 0x400000 S_RESERVED4 = 0x80000000 S_RESFMT1 = 0x10000000 S_RESFMT10 = 0x34000000 S_RESFMT11 = 0x38000000 S_RESFMT12 = 0x3c000000 S_RESFMT2 = 0x14000000 S_RESFMT3 = 0x18000000 S_RESFMT4 = 0x1c000000 S_RESFMT5 = 0x20000000 S_RESFMT6 = 0x24000000 S_RESFMT7 = 0x28000000 S_RESFMT8 = 0x2c000000 S_WRBAND = 0x80 S_WRNORM = 0x40 TAB0 = 0x0 TAB1 = 0x400 TAB2 = 0x800 TAB3 = 0xc00 TABDLY = 0xc00 TCFLSH = 0x540c TCGETA = 0x5405 TCGETS = 0x5401 TCIFLUSH = 0x0 TCIOFF = 0x2 TCIOFLUSH = 0x2 TCION = 0x3 TCOFLUSH = 0x1 TCOOFF = 0x0 TCOON = 0x1 TCP_24DAYS_WORTH_OF_SLOWTICKS = 0x3f4800 TCP_ACLADD = 0x23 TCP_ACLBIND = 0x26 TCP_ACLCLEAR = 0x22 TCP_ACLDEL = 0x24 TCP_ACLDENY = 0x8 TCP_ACLFLUSH = 0x21 TCP_ACLGID = 0x1 TCP_ACLLS = 0x25 TCP_ACLSUBNET = 0x4 TCP_ACLUID = 0x2 TCP_CWND_DF = 0x16 TCP_CWND_IF = 0x15 TCP_DELAY_ACK_FIN = 0x2 TCP_DELAY_ACK_SYN = 0x1 TCP_FASTNAME = 0x101080a TCP_KEEPCNT = 0x13 TCP_KEEPIDLE = 0x11 TCP_KEEPINTVL = 0x12 TCP_LSPRIV = 0x29 TCP_LUID = 0x20 TCP_MAXBURST = 0x8 TCP_MAXDF = 0x64 TCP_MAXIF = 0x64 TCP_MAXSEG = 0x2 TCP_MAXWIN = 0xffff TCP_MAXWINDOWSCALE = 0xe TCP_MAX_SACK = 0x4 TCP_MSS = 0x5b4 TCP_NODELAY = 0x1 TCP_NODELAYACK = 0x14 TCP_NOREDUCE_CWND_EXIT_FRXMT = 0x19 TCP_NOREDUCE_CWND_IN_FRXMT = 0x18 TCP_NOTENTER_SSTART = 0x17 TCP_OPT = 0x19 TCP_RFC1323 = 0x4 TCP_SETPRIV = 0x27 TCP_STDURG = 0x10 TCP_TIMESTAMP_OPTLEN = 0xc TCP_UNSETPRIV = 0x28 TCSAFLUSH = 0x2 TCSBRK = 0x5409 TCSETA = 0x5406 TCSETAF = 0x5408 TCSETAW = 0x5407 TCSETS = 0x5402 TCSETSF = 0x5404 TCSETSW = 0x5403 TCXONC = 0x540b TIMER_ABSTIME = 0x3e7 TIMER_MAX = 0x20 TIOC = 0x5400 TIOCCBRK = 0x2000747a TIOCCDTR = 0x20007478 TIOCCONS = 0x80047462 TIOCEXCL = 0x2000740d TIOCFLUSH = 0x80047410 TIOCGETC = 0x40067412 TIOCGETD = 0x40047400 TIOCGETP = 0x40067408 TIOCGLTC = 0x40067474 TIOCGPGRP = 0x40047477 TIOCGSID = 0x40047448 TIOCGSIZE = 0x40087468 TIOCGWINSZ = 0x40087468 TIOCHPCL = 0x20007402 TIOCLBIC = 0x8004747e TIOCLBIS = 0x8004747f TIOCLGET = 0x4004747c TIOCLSET = 0x8004747d TIOCMBIC = 0x8004746b TIOCMBIS = 0x8004746c TIOCMGET = 0x4004746a TIOCMIWAIT = 0x80047464 TIOCMODG = 0x40047403 TIOCMODS = 0x80047404 TIOCMSET = 0x8004746d TIOCM_CAR = 0x40 TIOCM_CD = 0x40 TIOCM_CTS = 0x20 TIOCM_DSR = 0x100 TIOCM_DTR = 0x2 TIOCM_LE = 0x1 TIOCM_RI = 0x80 TIOCM_RNG = 0x80 TIOCM_RTS = 0x4 TIOCM_SR = 0x10 TIOCM_ST = 0x8 TIOCNOTTY = 0x20007471 TIOCNXCL = 0x2000740e TIOCOUTQ = 0x40047473 TIOCPKT = 0x80047470 TIOCPKT_DATA = 0x0 TIOCPKT_DOSTOP = 0x20 TIOCPKT_FLUSHREAD = 0x1 TIOCPKT_FLUSHWRITE = 0x2 TIOCPKT_NOSTOP = 0x10 TIOCPKT_START = 0x8 TIOCPKT_STOP = 0x4 TIOCREMOTE = 0x80047469 TIOCSBRK = 0x2000747b TIOCSDTR = 0x20007479 TIOCSETC = 0x80067411 TIOCSETD = 0x80047401 TIOCSETN = 0x8006740a TIOCSETP = 0x80067409 TIOCSLTC = 0x80067475 TIOCSPGRP = 0x80047476 TIOCSSIZE = 0x80087467 TIOCSTART = 0x2000746e TIOCSTI = 0x80017472 TIOCSTOP = 0x2000746f TIOCSWINSZ = 0x80087467 TIOCUCNTL = 0x80047466 TOSTOP = 0x10000 UTIME_NOW = -0x2 UTIME_OMIT = -0x3 VDISCRD = 0xc VDSUSP = 0xa VEOF = 0x4 VEOL = 0x5 VEOL2 = 0x6 VERASE = 0x2 VINTR = 0x0 VKILL = 0x3 VLNEXT = 0xe VMIN = 0x4 VQUIT = 0x1 VREPRINT = 0xb VSTART = 0x7 VSTOP = 0x8 VSTRT = 0x7 VSUSP = 0x9 VT0 = 0x0 VT1 = 0x8000 VTDELAY = 0x2000 VTDLY = 0x8000 VTIME = 0x5 VWERSE = 0xd WPARSTART = 0x1 WPARSTOP = 0x2 WPARTTYNAME = "Global" XCASE = 0x4 XTABS = 0xc00 _FDATAFLUSH = 0x2000000000 ) // Errors const ( E2BIG = syscall.Errno(0x7) EACCES = syscall.Errno(0xd) EADDRINUSE = syscall.Errno(0x43) EADDRNOTAVAIL = syscall.Errno(0x44) EAFNOSUPPORT = syscall.Errno(0x42) EAGAIN = syscall.Errno(0xb) EALREADY = syscall.Errno(0x38) EBADF = syscall.Errno(0x9) EBADMSG = syscall.Errno(0x78) EBUSY = syscall.Errno(0x10) ECANCELED = syscall.Errno(0x75) ECHILD = syscall.Errno(0xa) ECHRNG = syscall.Errno(0x25) ECLONEME = syscall.Errno(0x52) ECONNABORTED = syscall.Errno(0x48) ECONNREFUSED = syscall.Errno(0x4f) ECONNRESET = syscall.Errno(0x49) ECORRUPT = syscall.Errno(0x59) EDEADLK = syscall.Errno(0x2d) EDESTADDREQ = syscall.Errno(0x3a) EDESTADDRREQ = syscall.Errno(0x3a) EDIST = syscall.Errno(0x35) EDOM = syscall.Errno(0x21) EDQUOT = syscall.Errno(0x58) EEXIST = syscall.Errno(0x11) EFAULT = syscall.Errno(0xe) EFBIG = syscall.Errno(0x1b) EFORMAT = syscall.Errno(0x30) EHOSTDOWN = syscall.Errno(0x50) EHOSTUNREACH = syscall.Errno(0x51) EIDRM = syscall.Errno(0x24) EILSEQ = syscall.Errno(0x74) EINPROGRESS = syscall.Errno(0x37) EINTR = syscall.Errno(0x4) EINVAL = syscall.Errno(0x16) EIO = syscall.Errno(0x5) EISCONN = syscall.Errno(0x4b) EISDIR = syscall.Errno(0x15) EL2HLT = syscall.Errno(0x2c) EL2NSYNC = syscall.Errno(0x26) EL3HLT = syscall.Errno(0x27) EL3RST = syscall.Errno(0x28) ELNRNG = syscall.Errno(0x29) ELOOP = syscall.Errno(0x55) EMEDIA = syscall.Errno(0x6e) EMFILE = syscall.Errno(0x18) EMLINK = syscall.Errno(0x1f) EMSGSIZE = syscall.Errno(0x3b) EMULTIHOP = syscall.Errno(0x7d) ENAMETOOLONG = syscall.Errno(0x56) ENETDOWN = syscall.Errno(0x45) ENETRESET = syscall.Errno(0x47) ENETUNREACH = syscall.Errno(0x46) ENFILE = syscall.Errno(0x17) ENOATTR = syscall.Errno(0x70) ENOBUFS = syscall.Errno(0x4a) ENOCONNECT = syscall.Errno(0x32) ENOCSI = syscall.Errno(0x2b) ENODATA = syscall.Errno(0x7a) ENODEV = syscall.Errno(0x13) ENOENT = syscall.Errno(0x2) ENOEXEC = syscall.Errno(0x8) ENOLCK = syscall.Errno(0x31) ENOLINK = syscall.Errno(0x7e) ENOMEM = syscall.Errno(0xc) ENOMSG = syscall.Errno(0x23) ENOPROTOOPT = syscall.Errno(0x3d) ENOSPC = syscall.Errno(0x1c) ENOSR = syscall.Errno(0x76) ENOSTR = syscall.Errno(0x7b) ENOSYS = syscall.Errno(0x6d) ENOTBLK = syscall.Errno(0xf) ENOTCONN = syscall.Errno(0x4c) ENOTDIR = syscall.Errno(0x14) ENOTEMPTY = syscall.Errno(0x11) ENOTREADY = syscall.Errno(0x2e) ENOTRECOVERABLE = syscall.Errno(0x5e) ENOTRUST = syscall.Errno(0x72) ENOTSOCK = syscall.Errno(0x39) ENOTSUP = syscall.Errno(0x7c) ENOTTY = syscall.Errno(0x19) ENXIO = syscall.Errno(0x6) EOPNOTSUPP = syscall.Errno(0x40) EOVERFLOW = syscall.Errno(0x7f) EOWNERDEAD = syscall.Errno(0x5f) EPERM = syscall.Errno(0x1) EPFNOSUPPORT = syscall.Errno(0x41) EPIPE = syscall.Errno(0x20) EPROCLIM = syscall.Errno(0x53) EPROTO = syscall.Errno(0x79) EPROTONOSUPPORT = syscall.Errno(0x3e) EPROTOTYPE = syscall.Errno(0x3c) ERANGE = syscall.Errno(0x22) EREMOTE = syscall.Errno(0x5d) ERESTART = syscall.Errno(0x52) EROFS = syscall.Errno(0x1e) ESAD = syscall.Errno(0x71) ESHUTDOWN = syscall.Errno(0x4d) ESOCKTNOSUPPORT = syscall.Errno(0x3f) ESOFT = syscall.Errno(0x6f) ESPIPE = syscall.Errno(0x1d) ESRCH = syscall.Errno(0x3) ESTALE = syscall.Errno(0x34) ESYSERROR = syscall.Errno(0x5a) ETIME = syscall.Errno(0x77) ETIMEDOUT = syscall.Errno(0x4e) ETOOMANYREFS = syscall.Errno(0x73) ETXTBSY = syscall.Errno(0x1a) EUNATCH = syscall.Errno(0x2a) EUSERS = syscall.Errno(0x54) EWOULDBLOCK = syscall.Errno(0xb) EWRPROTECT = syscall.Errno(0x2f) EXDEV = syscall.Errno(0x12) ) // Signals const ( SIGABRT = syscall.Signal(0x6) SIGAIO = syscall.Signal(0x17) SIGALRM = syscall.Signal(0xe) SIGALRM1 = syscall.Signal(0x26) SIGBUS = syscall.Signal(0xa) SIGCAPI = syscall.Signal(0x31) SIGCHLD = syscall.Signal(0x14) SIGCLD = syscall.Signal(0x14) SIGCONT = syscall.Signal(0x13) SIGCPUFAIL = syscall.Signal(0x3b) SIGDANGER = syscall.Signal(0x21) SIGEMT = syscall.Signal(0x7) SIGFPE = syscall.Signal(0x8) SIGGRANT = syscall.Signal(0x3c) SIGHUP = syscall.Signal(0x1) SIGILL = syscall.Signal(0x4) SIGINT = syscall.Signal(0x2) SIGIO = syscall.Signal(0x17) SIGIOINT = syscall.Signal(0x10) SIGIOT = syscall.Signal(0x6) SIGKAP = syscall.Signal(0x3c) SIGKILL = syscall.Signal(0x9) SIGLOST = syscall.Signal(0x6) SIGMAX = syscall.Signal(0x3f) SIGMAX32 = syscall.Signal(0x3f) SIGMIGRATE = syscall.Signal(0x23) SIGMSG = syscall.Signal(0x1b) SIGPIPE = syscall.Signal(0xd) SIGPOLL = syscall.Signal(0x17) SIGPRE = syscall.Signal(0x24) SIGPROF = syscall.Signal(0x20) SIGPTY = syscall.Signal(0x17) SIGPWR = syscall.Signal(0x1d) SIGQUIT = syscall.Signal(0x3) SIGRECONFIG = syscall.Signal(0x3a) SIGRETRACT = syscall.Signal(0x3d) SIGSAK = syscall.Signal(0x3f) SIGSEGV = syscall.Signal(0xb) SIGSOUND = syscall.Signal(0x3e) SIGSTOP = syscall.Signal(0x11) SIGSYS = syscall.Signal(0xc) SIGSYSERROR = syscall.Signal(0x30) SIGTALRM = syscall.Signal(0x26) SIGTERM = syscall.Signal(0xf) SIGTRAP = syscall.Signal(0x5) SIGTSTP = syscall.Signal(0x12) SIGTTIN = syscall.Signal(0x15) SIGTTOU = syscall.Signal(0x16) SIGURG = syscall.Signal(0x10) SIGUSR1 = syscall.Signal(0x1e) SIGUSR2 = syscall.Signal(0x1f) SIGVIRT = syscall.Signal(0x25) SIGVTALRM = syscall.Signal(0x22) SIGWAITING = syscall.Signal(0x27) SIGWINCH = syscall.Signal(0x1c) SIGXCPU = syscall.Signal(0x18) SIGXFSZ = syscall.Signal(0x19) ) // Error table var errorList = [...]struct { num syscall.Errno name string desc string }{ {1, "EPERM", "not owner"}, {2, "ENOENT", "no such file or directory"}, {3, "ESRCH", "no such process"}, {4, "EINTR", "interrupted system call"}, {5, "EIO", "I/O error"}, {6, "ENXIO", "no such device or address"}, {7, "E2BIG", "arg list too long"}, {8, "ENOEXEC", "exec format error"}, {9, "EBADF", "bad file number"}, {10, "ECHILD", "no child processes"}, {11, "EWOULDBLOCK", "resource temporarily unavailable"}, {12, "ENOMEM", "not enough space"}, {13, "EACCES", "permission denied"}, {14, "EFAULT", "bad address"}, {15, "ENOTBLK", "block device required"}, {16, "EBUSY", "device busy"}, {17, "ENOTEMPTY", "file exists"}, {18, "EXDEV", "cross-device link"}, {19, "ENODEV", "no such device"}, {20, "ENOTDIR", "not a directory"}, {21, "EISDIR", "is a directory"}, {22, "EINVAL", "invalid argument"}, {23, "ENFILE", "file table overflow"}, {24, "EMFILE", "too many open files"}, {25, "ENOTTY", "not a typewriter"}, {26, "ETXTBSY", "text file busy"}, {27, "EFBIG", "file too large"}, {28, "ENOSPC", "no space left on device"}, {29, "ESPIPE", "illegal seek"}, {30, "EROFS", "read-only file system"}, {31, "EMLINK", "too many links"}, {32, "EPIPE", "broken pipe"}, {33, "EDOM", "argument out of domain"}, {34, "ERANGE", "result too large"}, {35, "ENOMSG", "no message of desired type"}, {36, "EIDRM", "identifier removed"}, {37, "ECHRNG", "channel number out of range"}, {38, "EL2NSYNC", "level 2 not synchronized"}, {39, "EL3HLT", "level 3 halted"}, {40, "EL3RST", "level 3 reset"}, {41, "ELNRNG", "link number out of range"}, {42, "EUNATCH", "protocol driver not attached"}, {43, "ENOCSI", "no CSI structure available"}, {44, "EL2HLT", "level 2 halted"}, {45, "EDEADLK", "deadlock condition if locked"}, {46, "ENOTREADY", "device not ready"}, {47, "EWRPROTECT", "write-protected media"}, {48, "EFORMAT", "unformatted or incompatible media"}, {49, "ENOLCK", "no locks available"}, {50, "ENOCONNECT", "cannot Establish Connection"}, {52, "ESTALE", "missing file or filesystem"}, {53, "EDIST", "requests blocked by Administrator"}, {55, "EINPROGRESS", "operation now in progress"}, {56, "EALREADY", "operation already in progress"}, {57, "ENOTSOCK", "socket operation on non-socket"}, {58, "EDESTADDREQ", "destination address required"}, {59, "EMSGSIZE", "message too long"}, {60, "EPROTOTYPE", "protocol wrong type for socket"}, {61, "ENOPROTOOPT", "protocol not available"}, {62, "EPROTONOSUPPORT", "protocol not supported"}, {63, "ESOCKTNOSUPPORT", "socket type not supported"}, {64, "EOPNOTSUPP", "operation not supported on socket"}, {65, "EPFNOSUPPORT", "protocol family not supported"}, {66, "EAFNOSUPPORT", "addr family not supported by protocol"}, {67, "EADDRINUSE", "address already in use"}, {68, "EADDRNOTAVAIL", "can't assign requested address"}, {69, "ENETDOWN", "network is down"}, {70, "ENETUNREACH", "network is unreachable"}, {71, "ENETRESET", "network dropped connection on reset"}, {72, "ECONNABORTED", "software caused connection abort"}, {73, "ECONNRESET", "connection reset by peer"}, {74, "ENOBUFS", "no buffer space available"}, {75, "EISCONN", "socket is already connected"}, {76, "ENOTCONN", "socket is not connected"}, {77, "ESHUTDOWN", "can't send after socket shutdown"}, {78, "ETIMEDOUT", "connection timed out"}, {79, "ECONNREFUSED", "connection refused"}, {80, "EHOSTDOWN", "host is down"}, {81, "EHOSTUNREACH", "no route to host"}, {82, "ERESTART", "restart the system call"}, {83, "EPROCLIM", "too many processes"}, {84, "EUSERS", "too many users"}, {85, "ELOOP", "too many levels of symbolic links"}, {86, "ENAMETOOLONG", "file name too long"}, {88, "EDQUOT", "disk quota exceeded"}, {89, "ECORRUPT", "invalid file system control data detected"}, {90, "ESYSERROR", "for future use "}, {93, "EREMOTE", "item is not local to host"}, {94, "ENOTRECOVERABLE", "state not recoverable "}, {95, "EOWNERDEAD", "previous owner died "}, {109, "ENOSYS", "function not implemented"}, {110, "EMEDIA", "media surface error"}, {111, "ESOFT", "I/O completed, but needs relocation"}, {112, "ENOATTR", "no attribute found"}, {113, "ESAD", "security Authentication Denied"}, {114, "ENOTRUST", "not a Trusted Program"}, {115, "ETOOMANYREFS", "too many references: can't splice"}, {116, "EILSEQ", "invalid wide character"}, {117, "ECANCELED", "asynchronous I/O cancelled"}, {118, "ENOSR", "out of STREAMS resources"}, {119, "ETIME", "system call timed out"}, {120, "EBADMSG", "next message has wrong type"}, {121, "EPROTO", "error in protocol"}, {122, "ENODATA", "no message on stream head read q"}, {123, "ENOSTR", "fd not associated with a stream"}, {124, "ENOTSUP", "unsupported attribute value"}, {125, "EMULTIHOP", "multihop is not allowed"}, {126, "ENOLINK", "the server link has been severed"}, {127, "EOVERFLOW", "value too large to be stored in data type"}, } // Signal table var signalList = [...]struct { num syscall.Signal name string desc string }{ {1, "SIGHUP", "hangup"}, {2, "SIGINT", "interrupt"}, {3, "SIGQUIT", "quit"}, {4, "SIGILL", "illegal instruction"}, {5, "SIGTRAP", "trace/BPT trap"}, {6, "SIGIOT", "IOT/Abort trap"}, {7, "SIGEMT", "EMT trap"}, {8, "SIGFPE", "floating point exception"}, {9, "SIGKILL", "killed"}, {10, "SIGBUS", "bus error"}, {11, "SIGSEGV", "segmentation fault"}, {12, "SIGSYS", "bad system call"}, {13, "SIGPIPE", "broken pipe"}, {14, "SIGALRM", "alarm clock"}, {15, "SIGTERM", "terminated"}, {16, "SIGURG", "urgent I/O condition"}, {17, "SIGSTOP", "stopped (signal)"}, {18, "SIGTSTP", "stopped"}, {19, "SIGCONT", "continued"}, {20, "SIGCHLD", "child exited"}, {21, "SIGTTIN", "stopped (tty input)"}, {22, "SIGTTOU", "stopped (tty output)"}, {23, "SIGIO", "I/O possible/complete"}, {24, "SIGXCPU", "cputime limit exceeded"}, {25, "SIGXFSZ", "filesize limit exceeded"}, {27, "SIGMSG", "input device data"}, {28, "SIGWINCH", "window size changes"}, {29, "SIGPWR", "power-failure"}, {30, "SIGUSR1", "user defined signal 1"}, {31, "SIGUSR2", "user defined signal 2"}, {32, "SIGPROF", "profiling timer expired"}, {33, "SIGDANGER", "paging space low"}, {34, "SIGVTALRM", "virtual timer expired"}, {35, "SIGMIGRATE", "signal 35"}, {36, "SIGPRE", "signal 36"}, {37, "SIGVIRT", "signal 37"}, {38, "SIGTALRM", "signal 38"}, {39, "SIGWAITING", "signal 39"}, {48, "SIGSYSERROR", "signal 48"}, {49, "SIGCAPI", "signal 49"}, {58, "SIGRECONFIG", "signal 58"}, {59, "SIGCPUFAIL", "CPU Failure Predicted"}, {60, "SIGKAP", "monitor mode granted"}, {61, "SIGRETRACT", "monitor mode retracted"}, {62, "SIGSOUND", "sound completed"}, {63, "SIGSAK", "secure attention"}, } ================================================ FILE: vendor/golang.org/x/sys/unix/zerrors_aix_ppc64.go ================================================ // mkerrors.sh -maix64 // Code generated by the command above; see README.md. DO NOT EDIT. //go:build ppc64 && aix // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -maix64 _const.go package unix import "syscall" const ( AF_APPLETALK = 0x10 AF_BYPASS = 0x19 AF_CCITT = 0xa AF_CHAOS = 0x5 AF_DATAKIT = 0x9 AF_DECnet = 0xc AF_DLI = 0xd AF_ECMA = 0x8 AF_HYLINK = 0xf AF_IMPLINK = 0x3 AF_INET = 0x2 AF_INET6 = 0x18 AF_INTF = 0x14 AF_ISO = 0x7 AF_LAT = 0xe AF_LINK = 0x12 AF_LOCAL = 0x1 AF_MAX = 0x1e AF_NDD = 0x17 AF_NETWARE = 0x16 AF_NS = 0x6 AF_OSI = 0x7 AF_PUP = 0x4 AF_RIF = 0x15 AF_ROUTE = 0x11 AF_SNA = 0xb AF_UNIX = 0x1 AF_UNSPEC = 0x0 ALTWERASE = 0x400000 ARPHRD_802_3 = 0x6 ARPHRD_802_5 = 0x6 ARPHRD_ETHER = 0x1 ARPHRD_FDDI = 0x1 B0 = 0x0 B110 = 0x3 B1200 = 0x9 B134 = 0x4 B150 = 0x5 B1800 = 0xa B19200 = 0xe B200 = 0x6 B2400 = 0xb B300 = 0x7 B38400 = 0xf B4800 = 0xc B50 = 0x1 B600 = 0x8 B75 = 0x2 B9600 = 0xd BRKINT = 0x2 BS0 = 0x0 BS1 = 0x1000 BSDLY = 0x1000 CAP_AACCT = 0x6 CAP_ARM_APPLICATION = 0x5 CAP_BYPASS_RAC_VMM = 0x3 CAP_CLEAR = 0x0 CAP_CREDENTIALS = 0x7 CAP_EFFECTIVE = 0x1 CAP_EWLM_AGENT = 0x4 CAP_INHERITABLE = 0x2 CAP_MAXIMUM = 0x7 CAP_NUMA_ATTACH = 0x2 CAP_PERMITTED = 0x3 CAP_PROPAGATE = 0x1 CAP_PROPOGATE = 0x1 CAP_SET = 0x1 CBAUD = 0xf CFLUSH = 0xf CIBAUD = 0xf0000 CLOCAL = 0x800 CLOCK_MONOTONIC = 0xa CLOCK_PROCESS_CPUTIME_ID = 0xb CLOCK_REALTIME = 0x9 CLOCK_THREAD_CPUTIME_ID = 0xc CR0 = 0x0 CR1 = 0x100 CR2 = 0x200 CR3 = 0x300 CRDLY = 0x300 CREAD = 0x80 CS5 = 0x0 CS6 = 0x10 CS7 = 0x20 CS8 = 0x30 CSIOCGIFCONF = -0x3fef96dc CSIZE = 0x30 CSMAP_DIR = "/usr/lib/nls/csmap/" CSTART = '\021' CSTOP = '\023' CSTOPB = 0x40 CSUSP = 0x1a ECHO = 0x8 ECHOCTL = 0x20000 ECHOE = 0x10 ECHOK = 0x20 ECHOKE = 0x80000 ECHONL = 0x40 ECHOPRT = 0x40000 ECH_ICMPID = 0x2 ETHERNET_CSMACD = 0x6 EVENP = 0x80 EXCONTINUE = 0x0 EXDLOK = 0x3 EXIO = 0x2 EXPGIO = 0x0 EXRESUME = 0x2 EXRETURN = 0x1 EXSIG = 0x4 EXTA = 0xe EXTB = 0xf EXTRAP = 0x1 EYEC_RTENTRYA = 0x257274656e747241 EYEC_RTENTRYF = 0x257274656e747246 E_ACC = 0x0 FD_CLOEXEC = 0x1 FD_SETSIZE = 0xfffe FF0 = 0x0 FF1 = 0x2000 FFDLY = 0x2000 FLUSHBAND = 0x40 FLUSHLOW = 0x8 FLUSHO = 0x100000 FLUSHR = 0x1 FLUSHRW = 0x3 FLUSHW = 0x2 F_CLOSEM = 0xa F_DUP2FD = 0xe F_DUPFD = 0x0 F_GETFD = 0x1 F_GETFL = 0x3 F_GETLK = 0xb F_GETLK64 = 0xb F_GETOWN = 0x8 F_LOCK = 0x1 F_OK = 0x0 F_RDLCK = 0x1 F_SETFD = 0x2 F_SETFL = 0x4 F_SETLK = 0xc F_SETLK64 = 0xc F_SETLKW = 0xd F_SETLKW64 = 0xd F_SETOWN = 0x9 F_TEST = 0x3 F_TLOCK = 0x2 F_TSTLK = 0xf F_ULOCK = 0x0 F_UNLCK = 0x3 F_WRLCK = 0x2 HUPCL = 0x400 IBSHIFT = 0x10 ICANON = 0x2 ICMP6_FILTER = 0x26 ICMP6_SEC_SEND_DEL = 0x46 ICMP6_SEC_SEND_GET = 0x47 ICMP6_SEC_SEND_SET = 0x44 ICMP6_SEC_SEND_SET_CGA_ADDR = 0x45 ICRNL = 0x100 IEXTEN = 0x200000 IFA_FIRSTALIAS = 0x2000 IFA_ROUTE = 0x1 IFF_64BIT = 0x4000000 IFF_ALLCAST = 0x20000 IFF_ALLMULTI = 0x200 IFF_BPF = 0x8000000 IFF_BRIDGE = 0x40000 IFF_BROADCAST = 0x2 IFF_CANTCHANGE = 0x80c52 IFF_CHECKSUM_OFFLOAD = 0x10000000 IFF_D1 = 0x8000 IFF_D2 = 0x4000 IFF_D3 = 0x2000 IFF_D4 = 0x1000 IFF_DEBUG = 0x4 IFF_DEVHEALTH = 0x4000 IFF_DO_HW_LOOPBACK = 0x10000 IFF_GROUP_ROUTING = 0x2000000 IFF_IFBUFMGT = 0x800000 IFF_LINK0 = 0x100000 IFF_LINK1 = 0x200000 IFF_LINK2 = 0x400000 IFF_LOOPBACK = 0x8 IFF_MULTICAST = 0x80000 IFF_NOARP = 0x80 IFF_NOECHO = 0x800 IFF_NOTRAILERS = 0x20 IFF_OACTIVE = 0x400 IFF_POINTOPOINT = 0x10 IFF_PROMISC = 0x100 IFF_PSEG = 0x40000000 IFF_RUNNING = 0x40 IFF_SIMPLEX = 0x800 IFF_SNAP = 0x8000 IFF_TCP_DISABLE_CKSUM = 0x20000000 IFF_TCP_NOCKSUM = 0x1000000 IFF_UP = 0x1 IFF_VIPA = 0x80000000 IFNAMSIZ = 0x10 IFO_FLUSH = 0x1 IFT_1822 = 0x2 IFT_AAL5 = 0x31 IFT_ARCNET = 0x23 IFT_ARCNETPLUS = 0x24 IFT_ATM = 0x25 IFT_CEPT = 0x13 IFT_CLUSTER = 0x3e IFT_DS3 = 0x1e IFT_EON = 0x19 IFT_ETHER = 0x6 IFT_FCS = 0x3a IFT_FDDI = 0xf IFT_FRELAY = 0x20 IFT_FRELAYDCE = 0x2c IFT_GIFTUNNEL = 0x3c IFT_HDH1822 = 0x3 IFT_HF = 0x3d IFT_HIPPI = 0x2f IFT_HSSI = 0x2e IFT_HY = 0xe IFT_IB = 0xc7 IFT_ISDNBASIC = 0x14 IFT_ISDNPRIMARY = 0x15 IFT_ISO88022LLC = 0x29 IFT_ISO88023 = 0x7 IFT_ISO88024 = 0x8 IFT_ISO88025 = 0x9 IFT_ISO88026 = 0xa IFT_LAPB = 0x10 IFT_LOCALTALK = 0x2a IFT_LOOP = 0x18 IFT_MIOX25 = 0x26 IFT_MODEM = 0x30 IFT_NSIP = 0x1b IFT_OTHER = 0x1 IFT_P10 = 0xc IFT_P80 = 0xd IFT_PARA = 0x22 IFT_PPP = 0x17 IFT_PROPMUX = 0x36 IFT_PROPVIRTUAL = 0x35 IFT_PTPSERIAL = 0x16 IFT_RS232 = 0x21 IFT_SDLC = 0x11 IFT_SIP = 0x1f IFT_SLIP = 0x1c IFT_SMDSDXI = 0x2b IFT_SMDSICIP = 0x34 IFT_SN = 0x38 IFT_SONET = 0x27 IFT_SONETPATH = 0x32 IFT_SONETVT = 0x33 IFT_SP = 0x39 IFT_STARLAN = 0xb IFT_T1 = 0x12 IFT_TUNNEL = 0x3b IFT_ULTRA = 0x1d IFT_V35 = 0x2d IFT_VIPA = 0x37 IFT_X25 = 0x5 IFT_X25DDN = 0x4 IFT_X25PLE = 0x28 IFT_XETHER = 0x1a IGNBRK = 0x1 IGNCR = 0x80 IGNPAR = 0x4 IMAXBEL = 0x10000 INLCR = 0x40 INPCK = 0x10 IN_CLASSA_HOST = 0xffffff IN_CLASSA_MAX = 0x80 IN_CLASSA_NET = 0xff000000 IN_CLASSA_NSHIFT = 0x18 IN_CLASSB_HOST = 0xffff IN_CLASSB_MAX = 0x10000 IN_CLASSB_NET = 0xffff0000 IN_CLASSB_NSHIFT = 0x10 IN_CLASSC_HOST = 0xff IN_CLASSC_NET = 0xffffff00 IN_CLASSC_NSHIFT = 0x8 IN_CLASSD_HOST = 0xfffffff IN_CLASSD_NET = 0xf0000000 IN_CLASSD_NSHIFT = 0x1c IN_LOOPBACKNET = 0x7f IN_USE = 0x1 IPPROTO_AH = 0x33 IPPROTO_BIP = 0x53 IPPROTO_DSTOPTS = 0x3c IPPROTO_EGP = 0x8 IPPROTO_EON = 0x50 IPPROTO_ESP = 0x32 IPPROTO_FRAGMENT = 0x2c IPPROTO_GGP = 0x3 IPPROTO_GIF = 0x8c IPPROTO_GRE = 0x2f IPPROTO_HOPOPTS = 0x0 IPPROTO_ICMP = 0x1 IPPROTO_ICMPV6 = 0x3a IPPROTO_IDP = 0x16 IPPROTO_IGMP = 0x2 IPPROTO_IP = 0x0 IPPROTO_IPIP = 0x4 IPPROTO_IPV6 = 0x29 IPPROTO_LOCAL = 0x3f IPPROTO_MAX = 0x100 IPPROTO_MH = 0x87 IPPROTO_NONE = 0x3b IPPROTO_PUP = 0xc IPPROTO_QOS = 0x2d IPPROTO_RAW = 0xff IPPROTO_ROUTING = 0x2b IPPROTO_RSVP = 0x2e IPPROTO_SCTP = 0x84 IPPROTO_TCP = 0x6 IPPROTO_TP = 0x1d IPPROTO_UDP = 0x11 IPV6_ADDRFORM = 0x16 IPV6_ADDR_PREFERENCES = 0x4a IPV6_ADD_MEMBERSHIP = 0xc IPV6_AIXRAWSOCKET = 0x39 IPV6_CHECKSUM = 0x27 IPV6_DONTFRAG = 0x2d IPV6_DROP_MEMBERSHIP = 0xd IPV6_DSTOPTS = 0x36 IPV6_FLOWINFO_FLOWLABEL = 0xffffff IPV6_FLOWINFO_PRIFLOW = 0xfffffff IPV6_FLOWINFO_PRIORITY = 0xf000000 IPV6_FLOWINFO_SRFLAG = 0x10000000 IPV6_FLOWINFO_VERSION = 0xf0000000 IPV6_HOPLIMIT = 0x28 IPV6_HOPOPTS = 0x34 IPV6_JOIN_GROUP = 0xc IPV6_LEAVE_GROUP = 0xd IPV6_MIPDSTOPTS = 0x36 IPV6_MULTICAST_HOPS = 0xa IPV6_MULTICAST_IF = 0x9 IPV6_MULTICAST_LOOP = 0xb IPV6_NEXTHOP = 0x30 IPV6_NOPROBE = 0x1c IPV6_PATHMTU = 0x2e IPV6_PKTINFO = 0x21 IPV6_PKTOPTIONS = 0x24 IPV6_PRIORITY_10 = 0xa000000 IPV6_PRIORITY_11 = 0xb000000 IPV6_PRIORITY_12 = 0xc000000 IPV6_PRIORITY_13 = 0xd000000 IPV6_PRIORITY_14 = 0xe000000 IPV6_PRIORITY_15 = 0xf000000 IPV6_PRIORITY_8 = 0x8000000 IPV6_PRIORITY_9 = 0x9000000 IPV6_PRIORITY_BULK = 0x4000000 IPV6_PRIORITY_CONTROL = 0x7000000 IPV6_PRIORITY_FILLER = 0x1000000 IPV6_PRIORITY_INTERACTIVE = 0x6000000 IPV6_PRIORITY_RESERVED1 = 0x3000000 IPV6_PRIORITY_RESERVED2 = 0x5000000 IPV6_PRIORITY_UNATTENDED = 0x2000000 IPV6_PRIORITY_UNCHARACTERIZED = 0x0 IPV6_RECVDSTOPTS = 0x38 IPV6_RECVHOPLIMIT = 0x29 IPV6_RECVHOPOPTS = 0x35 IPV6_RECVHOPS = 0x22 IPV6_RECVIF = 0x1e IPV6_RECVPATHMTU = 0x2f IPV6_RECVPKTINFO = 0x23 IPV6_RECVRTHDR = 0x33 IPV6_RECVSRCRT = 0x1d IPV6_RECVTCLASS = 0x2a IPV6_RTHDR = 0x32 IPV6_RTHDRDSTOPTS = 0x37 IPV6_RTHDR_TYPE_0 = 0x0 IPV6_RTHDR_TYPE_2 = 0x2 IPV6_SENDIF = 0x1f IPV6_SRFLAG_LOOSE = 0x0 IPV6_SRFLAG_STRICT = 0x10000000 IPV6_TCLASS = 0x2b IPV6_TOKEN_LENGTH = 0x40 IPV6_UNICAST_HOPS = 0x4 IPV6_USE_MIN_MTU = 0x2c IPV6_V6ONLY = 0x25 IPV6_VERSION = 0x60000000 IP_ADDRFORM = 0x16 IP_ADD_MEMBERSHIP = 0xc IP_ADD_SOURCE_MEMBERSHIP = 0x3c IP_BLOCK_SOURCE = 0x3a IP_BROADCAST_IF = 0x10 IP_CACHE_LINE_SIZE = 0x80 IP_DEFAULT_MULTICAST_LOOP = 0x1 IP_DEFAULT_MULTICAST_TTL = 0x1 IP_DF = 0x4000 IP_DHCPMODE = 0x11 IP_DONTFRAG = 0x19 IP_DROP_MEMBERSHIP = 0xd IP_DROP_SOURCE_MEMBERSHIP = 0x3d IP_FINDPMTU = 0x1a IP_HDRINCL = 0x2 IP_INC_MEMBERSHIPS = 0x14 IP_INIT_MEMBERSHIP = 0x14 IP_MAXPACKET = 0xffff IP_MF = 0x2000 IP_MSS = 0x240 IP_MULTICAST_HOPS = 0xa IP_MULTICAST_IF = 0x9 IP_MULTICAST_LOOP = 0xb IP_MULTICAST_TTL = 0xa IP_OPT = 0x1b IP_OPTIONS = 0x1 IP_PMTUAGE = 0x1b IP_RECVDSTADDR = 0x7 IP_RECVIF = 0x14 IP_RECVIFINFO = 0xf IP_RECVINTERFACE = 0x20 IP_RECVMACHDR = 0xe IP_RECVOPTS = 0x5 IP_RECVRETOPTS = 0x6 IP_RECVTTL = 0x22 IP_RETOPTS = 0x8 IP_SOURCE_FILTER = 0x48 IP_TOS = 0x3 IP_TTL = 0x4 IP_UNBLOCK_SOURCE = 0x3b IP_UNICAST_HOPS = 0x4 ISIG = 0x1 ISTRIP = 0x20 IUCLC = 0x800 IXANY = 0x1000 IXOFF = 0x400 IXON = 0x200 I_FLUSH = 0x20005305 LNOFLSH = 0x8000 LOCK_EX = 0x2 LOCK_NB = 0x4 LOCK_SH = 0x1 LOCK_UN = 0x8 MADV_DONTNEED = 0x4 MADV_NORMAL = 0x0 MADV_RANDOM = 0x1 MADV_SEQUENTIAL = 0x2 MADV_SPACEAVAIL = 0x5 MADV_WILLNEED = 0x3 MAP_ANON = 0x10 MAP_ANONYMOUS = 0x10 MAP_FILE = 0x0 MAP_FIXED = 0x100 MAP_PRIVATE = 0x2 MAP_SHARED = 0x1 MAP_TYPE = 0xf0 MAP_VARIABLE = 0x0 MCAST_BLOCK_SOURCE = 0x40 MCAST_EXCLUDE = 0x2 MCAST_INCLUDE = 0x1 MCAST_JOIN_GROUP = 0x3e MCAST_JOIN_SOURCE_GROUP = 0x42 MCAST_LEAVE_GROUP = 0x3f MCAST_LEAVE_SOURCE_GROUP = 0x43 MCAST_SOURCE_FILTER = 0x49 MCAST_UNBLOCK_SOURCE = 0x41 MCL_CURRENT = 0x100 MCL_FUTURE = 0x200 MSG_ANY = 0x4 MSG_ARGEXT = 0x400 MSG_BAND = 0x2 MSG_COMPAT = 0x8000 MSG_CTRUNC = 0x20 MSG_DONTROUTE = 0x4 MSG_EOR = 0x8 MSG_HIPRI = 0x1 MSG_MAXIOVLEN = 0x10 MSG_MPEG2 = 0x80 MSG_NONBLOCK = 0x4000 MSG_NOSIGNAL = 0x100 MSG_OOB = 0x1 MSG_PEEK = 0x2 MSG_TRUNC = 0x10 MSG_WAITALL = 0x40 MSG_WAITFORONE = 0x200 MS_ASYNC = 0x10 MS_EINTR = 0x80 MS_INVALIDATE = 0x40 MS_PER_SEC = 0x3e8 MS_SYNC = 0x20 NFDBITS = 0x40 NL0 = 0x0 NL1 = 0x4000 NL2 = 0x8000 NL3 = 0xc000 NLDLY = 0x4000 NOFLSH = 0x80 NOFLUSH = 0x80000000 OCRNL = 0x8 OFDEL = 0x80 OFILL = 0x40 OLCUC = 0x2 ONLCR = 0x4 ONLRET = 0x20 ONOCR = 0x10 ONOEOT = 0x80000 OPOST = 0x1 OXTABS = 0x40000 O_ACCMODE = 0x23 O_APPEND = 0x8 O_CIO = 0x80 O_CIOR = 0x800000000 O_CLOEXEC = 0x800000 O_CREAT = 0x100 O_DEFER = 0x2000 O_DELAY = 0x4000 O_DIRECT = 0x8000000 O_DIRECTORY = 0x80000 O_DSYNC = 0x400000 O_EFSOFF = 0x400000000 O_EFSON = 0x200000000 O_EXCL = 0x400 O_EXEC = 0x20 O_LARGEFILE = 0x4000000 O_NDELAY = 0x8000 O_NOCACHE = 0x100000 O_NOCTTY = 0x800 O_NOFOLLOW = 0x1000000 O_NONBLOCK = 0x4 O_NONE = 0x3 O_NSHARE = 0x10000 O_RAW = 0x100000000 O_RDONLY = 0x0 O_RDWR = 0x2 O_RSHARE = 0x1000 O_RSYNC = 0x200000 O_SEARCH = 0x20 O_SNAPSHOT = 0x40 O_SYNC = 0x10 O_TRUNC = 0x200 O_TTY_INIT = 0x0 O_WRONLY = 0x1 PARENB = 0x100 PAREXT = 0x100000 PARMRK = 0x8 PARODD = 0x200 PENDIN = 0x20000000 PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 PROT_EXEC = 0x4 PROT_NONE = 0x0 PROT_READ = 0x1 PROT_WRITE = 0x2 PR_64BIT = 0x20 PR_ADDR = 0x2 PR_ARGEXT = 0x400 PR_ATOMIC = 0x1 PR_CONNREQUIRED = 0x4 PR_FASTHZ = 0x5 PR_INP = 0x40 PR_INTRLEVEL = 0x8000 PR_MLS = 0x100 PR_MLS_1_LABEL = 0x200 PR_NOEOR = 0x4000 PR_RIGHTS = 0x10 PR_SLOWHZ = 0x2 PR_WANTRCVD = 0x8 RLIMIT_AS = 0x6 RLIMIT_CORE = 0x4 RLIMIT_CPU = 0x0 RLIMIT_DATA = 0x2 RLIMIT_FSIZE = 0x1 RLIMIT_NOFILE = 0x7 RLIMIT_NPROC = 0x9 RLIMIT_RSS = 0x5 RLIMIT_STACK = 0x3 RLIM_INFINITY = 0x7fffffffffffffff RTAX_AUTHOR = 0x6 RTAX_BRD = 0x7 RTAX_DST = 0x0 RTAX_GATEWAY = 0x1 RTAX_GENMASK = 0x3 RTAX_IFA = 0x5 RTAX_IFP = 0x4 RTAX_MAX = 0x8 RTAX_NETMASK = 0x2 RTA_AUTHOR = 0x40 RTA_BRD = 0x80 RTA_DOWNSTREAM = 0x100 RTA_DST = 0x1 RTA_GATEWAY = 0x2 RTA_GENMASK = 0x8 RTA_IFA = 0x20 RTA_IFP = 0x10 RTA_NETMASK = 0x4 RTC_IA64 = 0x3 RTC_POWER = 0x1 RTC_POWER_PC = 0x2 RTF_ACTIVE_DGD = 0x1000000 RTF_BCE = 0x80000 RTF_BLACKHOLE = 0x1000 RTF_BROADCAST = 0x400000 RTF_BUL = 0x2000 RTF_CLONE = 0x10000 RTF_CLONED = 0x20000 RTF_CLONING = 0x100 RTF_DONE = 0x40 RTF_DYNAMIC = 0x10 RTF_FREE_IN_PROG = 0x4000000 RTF_GATEWAY = 0x2 RTF_HOST = 0x4 RTF_LLINFO = 0x400 RTF_LOCAL = 0x200000 RTF_MASK = 0x80 RTF_MODIFIED = 0x20 RTF_MULTICAST = 0x800000 RTF_PERMANENT6 = 0x8000000 RTF_PINNED = 0x100000 RTF_PROTO1 = 0x8000 RTF_PROTO2 = 0x4000 RTF_PROTO3 = 0x40000 RTF_REJECT = 0x8 RTF_SMALLMTU = 0x40000 RTF_STATIC = 0x800 RTF_STOPSRCH = 0x2000000 RTF_UNREACHABLE = 0x10000000 RTF_UP = 0x1 RTF_XRESOLVE = 0x200 RTM_ADD = 0x1 RTM_CHANGE = 0x3 RTM_DELADDR = 0xd RTM_DELETE = 0x2 RTM_EXPIRE = 0xf RTM_GET = 0x4 RTM_GETNEXT = 0x11 RTM_IFINFO = 0xe RTM_LOCK = 0x8 RTM_LOSING = 0x5 RTM_MISS = 0x7 RTM_NEWADDR = 0xc RTM_OLDADD = 0x9 RTM_OLDDEL = 0xa RTM_REDIRECT = 0x6 RTM_RESOLVE = 0xb RTM_RTLOST = 0x10 RTM_RTTUNIT = 0xf4240 RTM_SAMEADDR = 0x12 RTM_SET = 0x13 RTM_VERSION = 0x2 RTM_VERSION_GR = 0x4 RTM_VERSION_GR_COMPAT = 0x3 RTM_VERSION_POLICY = 0x5 RTM_VERSION_POLICY_EXT = 0x6 RTM_VERSION_POLICY_PRFN = 0x7 RTV_EXPIRE = 0x4 RTV_HOPCOUNT = 0x2 RTV_MTU = 0x1 RTV_RPIPE = 0x8 RTV_RTT = 0x40 RTV_RTTVAR = 0x80 RTV_SPIPE = 0x10 RTV_SSTHRESH = 0x20 RUSAGE_CHILDREN = -0x1 RUSAGE_SELF = 0x0 RUSAGE_THREAD = 0x1 SCM_RIGHTS = 0x1 SHUT_RD = 0x0 SHUT_RDWR = 0x2 SHUT_WR = 0x1 SIGMAX64 = 0xff SIGQUEUE_MAX = 0x20 SIOCADDIFVIPA = 0x20006942 SIOCADDMTU = -0x7ffb9690 SIOCADDMULTI = -0x7fdf96cf SIOCADDNETID = -0x7fd796a9 SIOCADDRT = -0x7fc78df6 SIOCAIFADDR = -0x7fbf96e6 SIOCATMARK = 0x40047307 SIOCDARP = -0x7fb396e0 SIOCDELIFVIPA = 0x20006943 SIOCDELMTU = -0x7ffb968f SIOCDELMULTI = -0x7fdf96ce SIOCDELPMTU = -0x7fd78ff6 SIOCDELRT = -0x7fc78df5 SIOCDIFADDR = -0x7fd796e7 SIOCDNETOPT = -0x3ffe9680 SIOCDX25XLATE = -0x7fd7969b SIOCFIFADDR = -0x7fdf966d SIOCGARP = -0x3fb396da SIOCGETMTUS = 0x2000696f SIOCGETSGCNT = -0x3feb8acc SIOCGETVIFCNT = -0x3feb8acd SIOCGHIWAT = 0x40047301 SIOCGIFADDR = -0x3fd796df SIOCGIFADDRS = 0x2000698c SIOCGIFBAUDRATE = -0x3fdf9669 SIOCGIFBRDADDR = -0x3fd796dd SIOCGIFCONF = -0x3fef96bb SIOCGIFCONFGLOB = -0x3fef9670 SIOCGIFDSTADDR = -0x3fd796de SIOCGIFFLAGS = -0x3fd796ef SIOCGIFGIDLIST = 0x20006968 SIOCGIFHWADDR = -0x3fab966b SIOCGIFMETRIC = -0x3fd796e9 SIOCGIFMTU = -0x3fd796aa SIOCGIFNETMASK = -0x3fd796db SIOCGIFOPTIONS = -0x3fd796d6 SIOCGISNO = -0x3fd79695 SIOCGLOADF = -0x3ffb967e SIOCGLOWAT = 0x40047303 SIOCGNETOPT = -0x3ffe96a5 SIOCGNETOPT1 = -0x3fdf967f SIOCGNMTUS = 0x2000696e SIOCGPGRP = 0x40047309 SIOCGSIZIFCONF = 0x4004696a SIOCGSRCFILTER = -0x3fe796cb SIOCGTUNEPHASE = -0x3ffb9676 SIOCGX25XLATE = -0x3fd7969c SIOCIFATTACH = -0x7fdf9699 SIOCIFDETACH = -0x7fdf969a SIOCIFGETPKEY = -0x7fdf969b SIOCIF_ATM_DARP = -0x7fdf9683 SIOCIF_ATM_DUMPARP = -0x7fdf9685 SIOCIF_ATM_GARP = -0x7fdf9682 SIOCIF_ATM_IDLE = -0x7fdf9686 SIOCIF_ATM_SARP = -0x7fdf9681 SIOCIF_ATM_SNMPARP = -0x7fdf9687 SIOCIF_ATM_SVC = -0x7fdf9684 SIOCIF_ATM_UBR = -0x7fdf9688 SIOCIF_DEVHEALTH = -0x7ffb966c SIOCIF_IB_ARP_INCOMP = -0x7fdf9677 SIOCIF_IB_ARP_TIMER = -0x7fdf9678 SIOCIF_IB_CLEAR_PINFO = -0x3fdf966f SIOCIF_IB_DEL_ARP = -0x7fdf967f SIOCIF_IB_DEL_PINFO = -0x3fdf9670 SIOCIF_IB_DUMP_ARP = -0x7fdf9680 SIOCIF_IB_GET_ARP = -0x7fdf967e SIOCIF_IB_GET_INFO = -0x3f879675 SIOCIF_IB_GET_STATS = -0x3f879672 SIOCIF_IB_NOTIFY_ADDR_REM = -0x3f87966a SIOCIF_IB_RESET_STATS = -0x3f879671 SIOCIF_IB_RESIZE_CQ = -0x7fdf9679 SIOCIF_IB_SET_ARP = -0x7fdf967d SIOCIF_IB_SET_PKEY = -0x7fdf967c SIOCIF_IB_SET_PORT = -0x7fdf967b SIOCIF_IB_SET_QKEY = -0x7fdf9676 SIOCIF_IB_SET_QSIZE = -0x7fdf967a SIOCLISTIFVIPA = 0x20006944 SIOCSARP = -0x7fb396e2 SIOCSHIWAT = 0xffffffff80047300 SIOCSIFADDR = -0x7fd796f4 SIOCSIFADDRORI = -0x7fdb9673 SIOCSIFBRDADDR = -0x7fd796ed SIOCSIFDSTADDR = -0x7fd796f2 SIOCSIFFLAGS = -0x7fd796f0 SIOCSIFGIDLIST = 0x20006969 SIOCSIFMETRIC = -0x7fd796e8 SIOCSIFMTU = -0x7fd796a8 SIOCSIFNETDUMP = -0x7fd796e4 SIOCSIFNETMASK = -0x7fd796ea SIOCSIFOPTIONS = -0x7fd796d7 SIOCSIFSUBCHAN = -0x7fd796e5 SIOCSISNO = -0x7fd79694 SIOCSLOADF = -0x3ffb967d SIOCSLOWAT = 0xffffffff80047302 SIOCSNETOPT = -0x7ffe96a6 SIOCSPGRP = 0xffffffff80047308 SIOCSX25XLATE = -0x7fd7969d SOCK_CONN_DGRAM = 0x6 SOCK_DGRAM = 0x2 SOCK_RAW = 0x3 SOCK_RDM = 0x4 SOCK_SEQPACKET = 0x5 SOCK_STREAM = 0x1 SOL_SOCKET = 0xffff SOMAXCONN = 0x400 SO_ACCEPTCONN = 0x2 SO_AUDIT = 0x8000 SO_BROADCAST = 0x20 SO_CKSUMRECV = 0x800 SO_DEBUG = 0x1 SO_DONTROUTE = 0x10 SO_ERROR = 0x1007 SO_KEEPALIVE = 0x8 SO_KERNACCEPT = 0x2000 SO_LINGER = 0x80 SO_NOMULTIPATH = 0x4000 SO_NOREUSEADDR = 0x1000 SO_OOBINLINE = 0x100 SO_PEERID = 0x1009 SO_RCVBUF = 0x1002 SO_RCVLOWAT = 0x1004 SO_RCVTIMEO = 0x1006 SO_REUSEADDR = 0x4 SO_REUSEPORT = 0x200 SO_SNDBUF = 0x1001 SO_SNDLOWAT = 0x1003 SO_SNDTIMEO = 0x1005 SO_TIMESTAMPNS = 0x100a SO_TYPE = 0x1008 SO_USELOOPBACK = 0x40 SO_USE_IFBUFS = 0x400 S_BANDURG = 0x400 S_EMODFMT = 0x3c000000 S_ENFMT = 0x400 S_ERROR = 0x100 S_HANGUP = 0x200 S_HIPRI = 0x2 S_ICRYPTO = 0x80000 S_IEXEC = 0x40 S_IFBLK = 0x6000 S_IFCHR = 0x2000 S_IFDIR = 0x4000 S_IFIFO = 0x1000 S_IFJOURNAL = 0x10000 S_IFLNK = 0xa000 S_IFMPX = 0x2200 S_IFMT = 0xf000 S_IFPDIR = 0x4000000 S_IFPSDIR = 0x8000000 S_IFPSSDIR = 0xc000000 S_IFREG = 0x8000 S_IFSOCK = 0xc000 S_IFSYSEA = 0x30000000 S_INPUT = 0x1 S_IREAD = 0x100 S_IRGRP = 0x20 S_IROTH = 0x4 S_IRUSR = 0x100 S_IRWXG = 0x38 S_IRWXO = 0x7 S_IRWXU = 0x1c0 S_ISGID = 0x400 S_ISUID = 0x800 S_ISVTX = 0x200 S_ITCB = 0x1000000 S_ITP = 0x800000 S_IWGRP = 0x10 S_IWOTH = 0x2 S_IWRITE = 0x80 S_IWUSR = 0x80 S_IXACL = 0x2000000 S_IXATTR = 0x40000 S_IXGRP = 0x8 S_IXINTERFACE = 0x100000 S_IXMOD = 0x40000000 S_IXOTH = 0x1 S_IXUSR = 0x40 S_MSG = 0x8 S_OUTPUT = 0x4 S_RDBAND = 0x20 S_RDNORM = 0x10 S_RESERVED1 = 0x20000 S_RESERVED2 = 0x200000 S_RESERVED3 = 0x400000 S_RESERVED4 = 0x80000000 S_RESFMT1 = 0x10000000 S_RESFMT10 = 0x34000000 S_RESFMT11 = 0x38000000 S_RESFMT12 = 0x3c000000 S_RESFMT2 = 0x14000000 S_RESFMT3 = 0x18000000 S_RESFMT4 = 0x1c000000 S_RESFMT5 = 0x20000000 S_RESFMT6 = 0x24000000 S_RESFMT7 = 0x28000000 S_RESFMT8 = 0x2c000000 S_WRBAND = 0x80 S_WRNORM = 0x40 TAB0 = 0x0 TAB1 = 0x400 TAB2 = 0x800 TAB3 = 0xc00 TABDLY = 0xc00 TCFLSH = 0x540c TCGETA = 0x5405 TCGETS = 0x5401 TCIFLUSH = 0x0 TCIOFF = 0x2 TCIOFLUSH = 0x2 TCION = 0x3 TCOFLUSH = 0x1 TCOOFF = 0x0 TCOON = 0x1 TCP_24DAYS_WORTH_OF_SLOWTICKS = 0x3f4800 TCP_ACLADD = 0x23 TCP_ACLBIND = 0x26 TCP_ACLCLEAR = 0x22 TCP_ACLDEL = 0x24 TCP_ACLDENY = 0x8 TCP_ACLFLUSH = 0x21 TCP_ACLGID = 0x1 TCP_ACLLS = 0x25 TCP_ACLSUBNET = 0x4 TCP_ACLUID = 0x2 TCP_CWND_DF = 0x16 TCP_CWND_IF = 0x15 TCP_DELAY_ACK_FIN = 0x2 TCP_DELAY_ACK_SYN = 0x1 TCP_FASTNAME = 0x101080a TCP_KEEPCNT = 0x13 TCP_KEEPIDLE = 0x11 TCP_KEEPINTVL = 0x12 TCP_LSPRIV = 0x29 TCP_LUID = 0x20 TCP_MAXBURST = 0x8 TCP_MAXDF = 0x64 TCP_MAXIF = 0x64 TCP_MAXSEG = 0x2 TCP_MAXWIN = 0xffff TCP_MAXWINDOWSCALE = 0xe TCP_MAX_SACK = 0x4 TCP_MSS = 0x5b4 TCP_NODELAY = 0x1 TCP_NODELAYACK = 0x14 TCP_NOREDUCE_CWND_EXIT_FRXMT = 0x19 TCP_NOREDUCE_CWND_IN_FRXMT = 0x18 TCP_NOTENTER_SSTART = 0x17 TCP_OPT = 0x19 TCP_RFC1323 = 0x4 TCP_SETPRIV = 0x27 TCP_STDURG = 0x10 TCP_TIMESTAMP_OPTLEN = 0xc TCP_UNSETPRIV = 0x28 TCSAFLUSH = 0x2 TCSBRK = 0x5409 TCSETA = 0x5406 TCSETAF = 0x5408 TCSETAW = 0x5407 TCSETS = 0x5402 TCSETSF = 0x5404 TCSETSW = 0x5403 TCXONC = 0x540b TIMER_ABSTIME = 0x3e7 TIMER_MAX = 0x20 TIOC = 0x5400 TIOCCBRK = 0x2000747a TIOCCDTR = 0x20007478 TIOCCONS = 0xffffffff80047462 TIOCEXCL = 0x2000740d TIOCFLUSH = 0xffffffff80047410 TIOCGETC = 0x40067412 TIOCGETD = 0x40047400 TIOCGETP = 0x40067408 TIOCGLTC = 0x40067474 TIOCGPGRP = 0x40047477 TIOCGSID = 0x40047448 TIOCGSIZE = 0x40087468 TIOCGWINSZ = 0x40087468 TIOCHPCL = 0x20007402 TIOCLBIC = 0xffffffff8004747e TIOCLBIS = 0xffffffff8004747f TIOCLGET = 0x4004747c TIOCLSET = 0xffffffff8004747d TIOCMBIC = 0xffffffff8004746b TIOCMBIS = 0xffffffff8004746c TIOCMGET = 0x4004746a TIOCMIWAIT = 0xffffffff80047464 TIOCMODG = 0x40047403 TIOCMODS = 0xffffffff80047404 TIOCMSET = 0xffffffff8004746d TIOCM_CAR = 0x40 TIOCM_CD = 0x40 TIOCM_CTS = 0x20 TIOCM_DSR = 0x100 TIOCM_DTR = 0x2 TIOCM_LE = 0x1 TIOCM_RI = 0x80 TIOCM_RNG = 0x80 TIOCM_RTS = 0x4 TIOCM_SR = 0x10 TIOCM_ST = 0x8 TIOCNOTTY = 0x20007471 TIOCNXCL = 0x2000740e TIOCOUTQ = 0x40047473 TIOCPKT = 0xffffffff80047470 TIOCPKT_DATA = 0x0 TIOCPKT_DOSTOP = 0x20 TIOCPKT_FLUSHREAD = 0x1 TIOCPKT_FLUSHWRITE = 0x2 TIOCPKT_NOSTOP = 0x10 TIOCPKT_START = 0x8 TIOCPKT_STOP = 0x4 TIOCREMOTE = 0xffffffff80047469 TIOCSBRK = 0x2000747b TIOCSDTR = 0x20007479 TIOCSETC = 0xffffffff80067411 TIOCSETD = 0xffffffff80047401 TIOCSETN = 0xffffffff8006740a TIOCSETP = 0xffffffff80067409 TIOCSLTC = 0xffffffff80067475 TIOCSPGRP = 0xffffffff80047476 TIOCSSIZE = 0xffffffff80087467 TIOCSTART = 0x2000746e TIOCSTI = 0xffffffff80017472 TIOCSTOP = 0x2000746f TIOCSWINSZ = 0xffffffff80087467 TIOCUCNTL = 0xffffffff80047466 TOSTOP = 0x10000 UTIME_NOW = -0x2 UTIME_OMIT = -0x3 VDISCRD = 0xc VDSUSP = 0xa VEOF = 0x4 VEOL = 0x5 VEOL2 = 0x6 VERASE = 0x2 VINTR = 0x0 VKILL = 0x3 VLNEXT = 0xe VMIN = 0x4 VQUIT = 0x1 VREPRINT = 0xb VSTART = 0x7 VSTOP = 0x8 VSTRT = 0x7 VSUSP = 0x9 VT0 = 0x0 VT1 = 0x8000 VTDELAY = 0x2000 VTDLY = 0x8000 VTIME = 0x5 VWERSE = 0xd WPARSTART = 0x1 WPARSTOP = 0x2 WPARTTYNAME = "Global" XCASE = 0x4 XTABS = 0xc00 _FDATAFLUSH = 0x2000000000 ) // Errors const ( E2BIG = syscall.Errno(0x7) EACCES = syscall.Errno(0xd) EADDRINUSE = syscall.Errno(0x43) EADDRNOTAVAIL = syscall.Errno(0x44) EAFNOSUPPORT = syscall.Errno(0x42) EAGAIN = syscall.Errno(0xb) EALREADY = syscall.Errno(0x38) EBADF = syscall.Errno(0x9) EBADMSG = syscall.Errno(0x78) EBUSY = syscall.Errno(0x10) ECANCELED = syscall.Errno(0x75) ECHILD = syscall.Errno(0xa) ECHRNG = syscall.Errno(0x25) ECLONEME = syscall.Errno(0x52) ECONNABORTED = syscall.Errno(0x48) ECONNREFUSED = syscall.Errno(0x4f) ECONNRESET = syscall.Errno(0x49) ECORRUPT = syscall.Errno(0x59) EDEADLK = syscall.Errno(0x2d) EDESTADDREQ = syscall.Errno(0x3a) EDESTADDRREQ = syscall.Errno(0x3a) EDIST = syscall.Errno(0x35) EDOM = syscall.Errno(0x21) EDQUOT = syscall.Errno(0x58) EEXIST = syscall.Errno(0x11) EFAULT = syscall.Errno(0xe) EFBIG = syscall.Errno(0x1b) EFORMAT = syscall.Errno(0x30) EHOSTDOWN = syscall.Errno(0x50) EHOSTUNREACH = syscall.Errno(0x51) EIDRM = syscall.Errno(0x24) EILSEQ = syscall.Errno(0x74) EINPROGRESS = syscall.Errno(0x37) EINTR = syscall.Errno(0x4) EINVAL = syscall.Errno(0x16) EIO = syscall.Errno(0x5) EISCONN = syscall.Errno(0x4b) EISDIR = syscall.Errno(0x15) EL2HLT = syscall.Errno(0x2c) EL2NSYNC = syscall.Errno(0x26) EL3HLT = syscall.Errno(0x27) EL3RST = syscall.Errno(0x28) ELNRNG = syscall.Errno(0x29) ELOOP = syscall.Errno(0x55) EMEDIA = syscall.Errno(0x6e) EMFILE = syscall.Errno(0x18) EMLINK = syscall.Errno(0x1f) EMSGSIZE = syscall.Errno(0x3b) EMULTIHOP = syscall.Errno(0x7d) ENAMETOOLONG = syscall.Errno(0x56) ENETDOWN = syscall.Errno(0x45) ENETRESET = syscall.Errno(0x47) ENETUNREACH = syscall.Errno(0x46) ENFILE = syscall.Errno(0x17) ENOATTR = syscall.Errno(0x70) ENOBUFS = syscall.Errno(0x4a) ENOCONNECT = syscall.Errno(0x32) ENOCSI = syscall.Errno(0x2b) ENODATA = syscall.Errno(0x7a) ENODEV = syscall.Errno(0x13) ENOENT = syscall.Errno(0x2) ENOEXEC = syscall.Errno(0x8) ENOLCK = syscall.Errno(0x31) ENOLINK = syscall.Errno(0x7e) ENOMEM = syscall.Errno(0xc) ENOMSG = syscall.Errno(0x23) ENOPROTOOPT = syscall.Errno(0x3d) ENOSPC = syscall.Errno(0x1c) ENOSR = syscall.Errno(0x76) ENOSTR = syscall.Errno(0x7b) ENOSYS = syscall.Errno(0x6d) ENOTBLK = syscall.Errno(0xf) ENOTCONN = syscall.Errno(0x4c) ENOTDIR = syscall.Errno(0x14) ENOTEMPTY = syscall.Errno(0x11) ENOTREADY = syscall.Errno(0x2e) ENOTRECOVERABLE = syscall.Errno(0x5e) ENOTRUST = syscall.Errno(0x72) ENOTSOCK = syscall.Errno(0x39) ENOTSUP = syscall.Errno(0x7c) ENOTTY = syscall.Errno(0x19) ENXIO = syscall.Errno(0x6) EOPNOTSUPP = syscall.Errno(0x40) EOVERFLOW = syscall.Errno(0x7f) EOWNERDEAD = syscall.Errno(0x5f) EPERM = syscall.Errno(0x1) EPFNOSUPPORT = syscall.Errno(0x41) EPIPE = syscall.Errno(0x20) EPROCLIM = syscall.Errno(0x53) EPROTO = syscall.Errno(0x79) EPROTONOSUPPORT = syscall.Errno(0x3e) EPROTOTYPE = syscall.Errno(0x3c) ERANGE = syscall.Errno(0x22) EREMOTE = syscall.Errno(0x5d) ERESTART = syscall.Errno(0x52) EROFS = syscall.Errno(0x1e) ESAD = syscall.Errno(0x71) ESHUTDOWN = syscall.Errno(0x4d) ESOCKTNOSUPPORT = syscall.Errno(0x3f) ESOFT = syscall.Errno(0x6f) ESPIPE = syscall.Errno(0x1d) ESRCH = syscall.Errno(0x3) ESTALE = syscall.Errno(0x34) ESYSERROR = syscall.Errno(0x5a) ETIME = syscall.Errno(0x77) ETIMEDOUT = syscall.Errno(0x4e) ETOOMANYREFS = syscall.Errno(0x73) ETXTBSY = syscall.Errno(0x1a) EUNATCH = syscall.Errno(0x2a) EUSERS = syscall.Errno(0x54) EWOULDBLOCK = syscall.Errno(0xb) EWRPROTECT = syscall.Errno(0x2f) EXDEV = syscall.Errno(0x12) ) // Signals const ( SIGABRT = syscall.Signal(0x6) SIGAIO = syscall.Signal(0x17) SIGALRM = syscall.Signal(0xe) SIGALRM1 = syscall.Signal(0x26) SIGBUS = syscall.Signal(0xa) SIGCAPI = syscall.Signal(0x31) SIGCHLD = syscall.Signal(0x14) SIGCLD = syscall.Signal(0x14) SIGCONT = syscall.Signal(0x13) SIGCPUFAIL = syscall.Signal(0x3b) SIGDANGER = syscall.Signal(0x21) SIGEMT = syscall.Signal(0x7) SIGFPE = syscall.Signal(0x8) SIGGRANT = syscall.Signal(0x3c) SIGHUP = syscall.Signal(0x1) SIGILL = syscall.Signal(0x4) SIGINT = syscall.Signal(0x2) SIGIO = syscall.Signal(0x17) SIGIOINT = syscall.Signal(0x10) SIGIOT = syscall.Signal(0x6) SIGKAP = syscall.Signal(0x3c) SIGKILL = syscall.Signal(0x9) SIGLOST = syscall.Signal(0x6) SIGMAX = syscall.Signal(0xff) SIGMAX32 = syscall.Signal(0x3f) SIGMIGRATE = syscall.Signal(0x23) SIGMSG = syscall.Signal(0x1b) SIGPIPE = syscall.Signal(0xd) SIGPOLL = syscall.Signal(0x17) SIGPRE = syscall.Signal(0x24) SIGPROF = syscall.Signal(0x20) SIGPTY = syscall.Signal(0x17) SIGPWR = syscall.Signal(0x1d) SIGQUIT = syscall.Signal(0x3) SIGRECONFIG = syscall.Signal(0x3a) SIGRETRACT = syscall.Signal(0x3d) SIGSAK = syscall.Signal(0x3f) SIGSEGV = syscall.Signal(0xb) SIGSOUND = syscall.Signal(0x3e) SIGSTOP = syscall.Signal(0x11) SIGSYS = syscall.Signal(0xc) SIGSYSERROR = syscall.Signal(0x30) SIGTALRM = syscall.Signal(0x26) SIGTERM = syscall.Signal(0xf) SIGTRAP = syscall.Signal(0x5) SIGTSTP = syscall.Signal(0x12) SIGTTIN = syscall.Signal(0x15) SIGTTOU = syscall.Signal(0x16) SIGURG = syscall.Signal(0x10) SIGUSR1 = syscall.Signal(0x1e) SIGUSR2 = syscall.Signal(0x1f) SIGVIRT = syscall.Signal(0x25) SIGVTALRM = syscall.Signal(0x22) SIGWAITING = syscall.Signal(0x27) SIGWINCH = syscall.Signal(0x1c) SIGXCPU = syscall.Signal(0x18) SIGXFSZ = syscall.Signal(0x19) ) // Error table var errorList = [...]struct { num syscall.Errno name string desc string }{ {1, "EPERM", "not owner"}, {2, "ENOENT", "no such file or directory"}, {3, "ESRCH", "no such process"}, {4, "EINTR", "interrupted system call"}, {5, "EIO", "I/O error"}, {6, "ENXIO", "no such device or address"}, {7, "E2BIG", "arg list too long"}, {8, "ENOEXEC", "exec format error"}, {9, "EBADF", "bad file number"}, {10, "ECHILD", "no child processes"}, {11, "EWOULDBLOCK", "resource temporarily unavailable"}, {12, "ENOMEM", "not enough space"}, {13, "EACCES", "permission denied"}, {14, "EFAULT", "bad address"}, {15, "ENOTBLK", "block device required"}, {16, "EBUSY", "device busy"}, {17, "ENOTEMPTY", "file exists"}, {18, "EXDEV", "cross-device link"}, {19, "ENODEV", "no such device"}, {20, "ENOTDIR", "not a directory"}, {21, "EISDIR", "is a directory"}, {22, "EINVAL", "invalid argument"}, {23, "ENFILE", "file table overflow"}, {24, "EMFILE", "too many open files"}, {25, "ENOTTY", "not a typewriter"}, {26, "ETXTBSY", "text file busy"}, {27, "EFBIG", "file too large"}, {28, "ENOSPC", "no space left on device"}, {29, "ESPIPE", "illegal seek"}, {30, "EROFS", "read-only file system"}, {31, "EMLINK", "too many links"}, {32, "EPIPE", "broken pipe"}, {33, "EDOM", "argument out of domain"}, {34, "ERANGE", "result too large"}, {35, "ENOMSG", "no message of desired type"}, {36, "EIDRM", "identifier removed"}, {37, "ECHRNG", "channel number out of range"}, {38, "EL2NSYNC", "level 2 not synchronized"}, {39, "EL3HLT", "level 3 halted"}, {40, "EL3RST", "level 3 reset"}, {41, "ELNRNG", "link number out of range"}, {42, "EUNATCH", "protocol driver not attached"}, {43, "ENOCSI", "no CSI structure available"}, {44, "EL2HLT", "level 2 halted"}, {45, "EDEADLK", "deadlock condition if locked"}, {46, "ENOTREADY", "device not ready"}, {47, "EWRPROTECT", "write-protected media"}, {48, "EFORMAT", "unformatted or incompatible media"}, {49, "ENOLCK", "no locks available"}, {50, "ENOCONNECT", "cannot Establish Connection"}, {52, "ESTALE", "missing file or filesystem"}, {53, "EDIST", "requests blocked by Administrator"}, {55, "EINPROGRESS", "operation now in progress"}, {56, "EALREADY", "operation already in progress"}, {57, "ENOTSOCK", "socket operation on non-socket"}, {58, "EDESTADDREQ", "destination address required"}, {59, "EMSGSIZE", "message too long"}, {60, "EPROTOTYPE", "protocol wrong type for socket"}, {61, "ENOPROTOOPT", "protocol not available"}, {62, "EPROTONOSUPPORT", "protocol not supported"}, {63, "ESOCKTNOSUPPORT", "socket type not supported"}, {64, "EOPNOTSUPP", "operation not supported on socket"}, {65, "EPFNOSUPPORT", "protocol family not supported"}, {66, "EAFNOSUPPORT", "addr family not supported by protocol"}, {67, "EADDRINUSE", "address already in use"}, {68, "EADDRNOTAVAIL", "can't assign requested address"}, {69, "ENETDOWN", "network is down"}, {70, "ENETUNREACH", "network is unreachable"}, {71, "ENETRESET", "network dropped connection on reset"}, {72, "ECONNABORTED", "software caused connection abort"}, {73, "ECONNRESET", "connection reset by peer"}, {74, "ENOBUFS", "no buffer space available"}, {75, "EISCONN", "socket is already connected"}, {76, "ENOTCONN", "socket is not connected"}, {77, "ESHUTDOWN", "can't send after socket shutdown"}, {78, "ETIMEDOUT", "connection timed out"}, {79, "ECONNREFUSED", "connection refused"}, {80, "EHOSTDOWN", "host is down"}, {81, "EHOSTUNREACH", "no route to host"}, {82, "ERESTART", "restart the system call"}, {83, "EPROCLIM", "too many processes"}, {84, "EUSERS", "too many users"}, {85, "ELOOP", "too many levels of symbolic links"}, {86, "ENAMETOOLONG", "file name too long"}, {88, "EDQUOT", "disk quota exceeded"}, {89, "ECORRUPT", "invalid file system control data detected"}, {90, "ESYSERROR", "for future use "}, {93, "EREMOTE", "item is not local to host"}, {94, "ENOTRECOVERABLE", "state not recoverable "}, {95, "EOWNERDEAD", "previous owner died "}, {109, "ENOSYS", "function not implemented"}, {110, "EMEDIA", "media surface error"}, {111, "ESOFT", "I/O completed, but needs relocation"}, {112, "ENOATTR", "no attribute found"}, {113, "ESAD", "security Authentication Denied"}, {114, "ENOTRUST", "not a Trusted Program"}, {115, "ETOOMANYREFS", "too many references: can't splice"}, {116, "EILSEQ", "invalid wide character"}, {117, "ECANCELED", "asynchronous I/O cancelled"}, {118, "ENOSR", "out of STREAMS resources"}, {119, "ETIME", "system call timed out"}, {120, "EBADMSG", "next message has wrong type"}, {121, "EPROTO", "error in protocol"}, {122, "ENODATA", "no message on stream head read q"}, {123, "ENOSTR", "fd not associated with a stream"}, {124, "ENOTSUP", "unsupported attribute value"}, {125, "EMULTIHOP", "multihop is not allowed"}, {126, "ENOLINK", "the server link has been severed"}, {127, "EOVERFLOW", "value too large to be stored in data type"}, } // Signal table var signalList = [...]struct { num syscall.Signal name string desc string }{ {1, "SIGHUP", "hangup"}, {2, "SIGINT", "interrupt"}, {3, "SIGQUIT", "quit"}, {4, "SIGILL", "illegal instruction"}, {5, "SIGTRAP", "trace/BPT trap"}, {6, "SIGIOT", "IOT/Abort trap"}, {7, "SIGEMT", "EMT trap"}, {8, "SIGFPE", "floating point exception"}, {9, "SIGKILL", "killed"}, {10, "SIGBUS", "bus error"}, {11, "SIGSEGV", "segmentation fault"}, {12, "SIGSYS", "bad system call"}, {13, "SIGPIPE", "broken pipe"}, {14, "SIGALRM", "alarm clock"}, {15, "SIGTERM", "terminated"}, {16, "SIGURG", "urgent I/O condition"}, {17, "SIGSTOP", "stopped (signal)"}, {18, "SIGTSTP", "stopped"}, {19, "SIGCONT", "continued"}, {20, "SIGCHLD", "child exited"}, {21, "SIGTTIN", "stopped (tty input)"}, {22, "SIGTTOU", "stopped (tty output)"}, {23, "SIGIO", "I/O possible/complete"}, {24, "SIGXCPU", "cputime limit exceeded"}, {25, "SIGXFSZ", "filesize limit exceeded"}, {27, "SIGMSG", "input device data"}, {28, "SIGWINCH", "window size changes"}, {29, "SIGPWR", "power-failure"}, {30, "SIGUSR1", "user defined signal 1"}, {31, "SIGUSR2", "user defined signal 2"}, {32, "SIGPROF", "profiling timer expired"}, {33, "SIGDANGER", "paging space low"}, {34, "SIGVTALRM", "virtual timer expired"}, {35, "SIGMIGRATE", "signal 35"}, {36, "SIGPRE", "signal 36"}, {37, "SIGVIRT", "signal 37"}, {38, "SIGTALRM", "signal 38"}, {39, "SIGWAITING", "signal 39"}, {48, "SIGSYSERROR", "signal 48"}, {49, "SIGCAPI", "signal 49"}, {58, "SIGRECONFIG", "signal 58"}, {59, "SIGCPUFAIL", "CPU Failure Predicted"}, {60, "SIGGRANT", "monitor mode granted"}, {61, "SIGRETRACT", "monitor mode retracted"}, {62, "SIGSOUND", "sound completed"}, {63, "SIGMAX32", "secure attention"}, {255, "SIGMAX", "signal 255"}, } ================================================ FILE: vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go ================================================ // mkerrors.sh -m64 // Code generated by the command above; see README.md. DO NOT EDIT. //go:build amd64 && darwin // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -m64 _const.go package unix import "syscall" const ( AF_APPLETALK = 0x10 AF_CCITT = 0xa AF_CHAOS = 0x5 AF_CNT = 0x15 AF_COIP = 0x14 AF_DATAKIT = 0x9 AF_DECnet = 0xc AF_DLI = 0xd AF_E164 = 0x1c AF_ECMA = 0x8 AF_HYLINK = 0xf AF_IEEE80211 = 0x25 AF_IMPLINK = 0x3 AF_INET = 0x2 AF_INET6 = 0x1e AF_IPX = 0x17 AF_ISDN = 0x1c AF_ISO = 0x7 AF_LAT = 0xe AF_LINK = 0x12 AF_LOCAL = 0x1 AF_MAX = 0x29 AF_NATM = 0x1f AF_NDRV = 0x1b AF_NETBIOS = 0x21 AF_NS = 0x6 AF_OSI = 0x7 AF_PPP = 0x22 AF_PUP = 0x4 AF_RESERVED_36 = 0x24 AF_ROUTE = 0x11 AF_SIP = 0x18 AF_SNA = 0xb AF_SYSTEM = 0x20 AF_SYS_CONTROL = 0x2 AF_UNIX = 0x1 AF_UNSPEC = 0x0 AF_UTUN = 0x26 AF_VSOCK = 0x28 ALTWERASE = 0x200 ATTR_BIT_MAP_COUNT = 0x5 ATTR_CMN_ACCESSMASK = 0x20000 ATTR_CMN_ACCTIME = 0x1000 ATTR_CMN_ADDEDTIME = 0x10000000 ATTR_CMN_BKUPTIME = 0x2000 ATTR_CMN_CHGTIME = 0x800 ATTR_CMN_CRTIME = 0x200 ATTR_CMN_DATA_PROTECT_FLAGS = 0x40000000 ATTR_CMN_DEVID = 0x2 ATTR_CMN_DOCUMENT_ID = 0x100000 ATTR_CMN_ERROR = 0x20000000 ATTR_CMN_EXTENDED_SECURITY = 0x400000 ATTR_CMN_FILEID = 0x2000000 ATTR_CMN_FLAGS = 0x40000 ATTR_CMN_FNDRINFO = 0x4000 ATTR_CMN_FSID = 0x4 ATTR_CMN_FULLPATH = 0x8000000 ATTR_CMN_GEN_COUNT = 0x80000 ATTR_CMN_GRPID = 0x10000 ATTR_CMN_GRPUUID = 0x1000000 ATTR_CMN_MODTIME = 0x400 ATTR_CMN_NAME = 0x1 ATTR_CMN_NAMEDATTRCOUNT = 0x80000 ATTR_CMN_NAMEDATTRLIST = 0x100000 ATTR_CMN_OBJID = 0x20 ATTR_CMN_OBJPERMANENTID = 0x40 ATTR_CMN_OBJTAG = 0x10 ATTR_CMN_OBJTYPE = 0x8 ATTR_CMN_OWNERID = 0x8000 ATTR_CMN_PARENTID = 0x4000000 ATTR_CMN_PAROBJID = 0x80 ATTR_CMN_RETURNED_ATTRS = 0x80000000 ATTR_CMN_SCRIPT = 0x100 ATTR_CMN_SETMASK = 0x51c7ff00 ATTR_CMN_USERACCESS = 0x200000 ATTR_CMN_UUID = 0x800000 ATTR_CMN_VALIDMASK = 0xffffffff ATTR_CMN_VOLSETMASK = 0x6700 ATTR_FILE_ALLOCSIZE = 0x4 ATTR_FILE_CLUMPSIZE = 0x10 ATTR_FILE_DATAALLOCSIZE = 0x400 ATTR_FILE_DATAEXTENTS = 0x800 ATTR_FILE_DATALENGTH = 0x200 ATTR_FILE_DEVTYPE = 0x20 ATTR_FILE_FILETYPE = 0x40 ATTR_FILE_FORKCOUNT = 0x80 ATTR_FILE_FORKLIST = 0x100 ATTR_FILE_IOBLOCKSIZE = 0x8 ATTR_FILE_LINKCOUNT = 0x1 ATTR_FILE_RSRCALLOCSIZE = 0x2000 ATTR_FILE_RSRCEXTENTS = 0x4000 ATTR_FILE_RSRCLENGTH = 0x1000 ATTR_FILE_SETMASK = 0x20 ATTR_FILE_TOTALSIZE = 0x2 ATTR_FILE_VALIDMASK = 0x37ff ATTR_VOL_ALLOCATIONCLUMP = 0x40 ATTR_VOL_ATTRIBUTES = 0x40000000 ATTR_VOL_CAPABILITIES = 0x20000 ATTR_VOL_DIRCOUNT = 0x400 ATTR_VOL_ENCODINGSUSED = 0x10000 ATTR_VOL_FILECOUNT = 0x200 ATTR_VOL_FSTYPE = 0x1 ATTR_VOL_INFO = 0x80000000 ATTR_VOL_IOBLOCKSIZE = 0x80 ATTR_VOL_MAXOBJCOUNT = 0x800 ATTR_VOL_MINALLOCATION = 0x20 ATTR_VOL_MOUNTEDDEVICE = 0x8000 ATTR_VOL_MOUNTFLAGS = 0x4000 ATTR_VOL_MOUNTPOINT = 0x1000 ATTR_VOL_NAME = 0x2000 ATTR_VOL_OBJCOUNT = 0x100 ATTR_VOL_QUOTA_SIZE = 0x10000000 ATTR_VOL_RESERVED_SIZE = 0x20000000 ATTR_VOL_SETMASK = 0x80002000 ATTR_VOL_SIGNATURE = 0x2 ATTR_VOL_SIZE = 0x4 ATTR_VOL_SPACEAVAIL = 0x10 ATTR_VOL_SPACEFREE = 0x8 ATTR_VOL_SPACEUSED = 0x800000 ATTR_VOL_UUID = 0x40000 ATTR_VOL_VALIDMASK = 0xf087ffff B0 = 0x0 B110 = 0x6e B115200 = 0x1c200 B1200 = 0x4b0 B134 = 0x86 B14400 = 0x3840 B150 = 0x96 B1800 = 0x708 B19200 = 0x4b00 B200 = 0xc8 B230400 = 0x38400 B2400 = 0x960 B28800 = 0x7080 B300 = 0x12c B38400 = 0x9600 B4800 = 0x12c0 B50 = 0x32 B57600 = 0xe100 B600 = 0x258 B7200 = 0x1c20 B75 = 0x4b B76800 = 0x12c00 B9600 = 0x2580 BIOCFLUSH = 0x20004268 BIOCGBLEN = 0x40044266 BIOCGDLT = 0x4004426a BIOCGDLTLIST = 0xc00c4279 BIOCGETIF = 0x4020426b BIOCGHDRCMPLT = 0x40044274 BIOCGRSIG = 0x40044272 BIOCGRTIMEOUT = 0x4010426e BIOCGSEESENT = 0x40044276 BIOCGSTATS = 0x4008426f BIOCIMMEDIATE = 0x80044270 BIOCPROMISC = 0x20004269 BIOCSBLEN = 0xc0044266 BIOCSDLT = 0x80044278 BIOCSETF = 0x80104267 BIOCSETFNR = 0x8010427e BIOCSETIF = 0x8020426c BIOCSHDRCMPLT = 0x80044275 BIOCSRSIG = 0x80044273 BIOCSRTIMEOUT = 0x8010426d BIOCSSEESENT = 0x80044277 BIOCVERSION = 0x40044271 BPF_A = 0x10 BPF_ABS = 0x20 BPF_ADD = 0x0 BPF_ALIGNMENT = 0x4 BPF_ALU = 0x4 BPF_AND = 0x50 BPF_B = 0x10 BPF_DIV = 0x30 BPF_H = 0x8 BPF_IMM = 0x0 BPF_IND = 0x40 BPF_JA = 0x0 BPF_JEQ = 0x10 BPF_JGE = 0x30 BPF_JGT = 0x20 BPF_JMP = 0x5 BPF_JSET = 0x40 BPF_K = 0x0 BPF_LD = 0x0 BPF_LDX = 0x1 BPF_LEN = 0x80 BPF_LSH = 0x60 BPF_MAJOR_VERSION = 0x1 BPF_MAXBUFSIZE = 0x80000 BPF_MAXINSNS = 0x200 BPF_MEM = 0x60 BPF_MEMWORDS = 0x10 BPF_MINBUFSIZE = 0x20 BPF_MINOR_VERSION = 0x1 BPF_MISC = 0x7 BPF_MSH = 0xa0 BPF_MUL = 0x20 BPF_NEG = 0x80 BPF_OR = 0x40 BPF_RELEASE = 0x30bb6 BPF_RET = 0x6 BPF_RSH = 0x70 BPF_ST = 0x2 BPF_STX = 0x3 BPF_SUB = 0x10 BPF_TAX = 0x0 BPF_TXA = 0x80 BPF_W = 0x0 BPF_X = 0x8 BRKINT = 0x2 BS0 = 0x0 BS1 = 0x8000 BSDLY = 0x8000 CFLUSH = 0xf CLOCAL = 0x8000 CLOCK_MONOTONIC = 0x6 CLOCK_MONOTONIC_RAW = 0x4 CLOCK_MONOTONIC_RAW_APPROX = 0x5 CLOCK_PROCESS_CPUTIME_ID = 0xc CLOCK_REALTIME = 0x0 CLOCK_THREAD_CPUTIME_ID = 0x10 CLOCK_UPTIME_RAW = 0x8 CLOCK_UPTIME_RAW_APPROX = 0x9 CLONE_NOFOLLOW = 0x1 CLONE_NOOWNERCOPY = 0x2 CONNECT_DATA_AUTHENTICATED = 0x4 CONNECT_DATA_IDEMPOTENT = 0x2 CONNECT_RESUME_ON_READ_WRITE = 0x1 CR0 = 0x0 CR1 = 0x1000 CR2 = 0x2000 CR3 = 0x3000 CRDLY = 0x3000 CREAD = 0x800 CRTSCTS = 0x30000 CS5 = 0x0 CS6 = 0x100 CS7 = 0x200 CS8 = 0x300 CSIZE = 0x300 CSTART = 0x11 CSTATUS = 0x14 CSTOP = 0x13 CSTOPB = 0x400 CSUSP = 0x1a CTLIOCGINFO = 0xc0644e03 CTL_HW = 0x6 CTL_KERN = 0x1 CTL_MAXNAME = 0xc CTL_NET = 0x4 DLT_A429 = 0xb8 DLT_A653_ICM = 0xb9 DLT_AIRONET_HEADER = 0x78 DLT_AOS = 0xde DLT_APPLE_IP_OVER_IEEE1394 = 0x8a DLT_ARCNET = 0x7 DLT_ARCNET_LINUX = 0x81 DLT_ATM_CLIP = 0x13 DLT_ATM_RFC1483 = 0xb DLT_AURORA = 0x7e DLT_AX25 = 0x3 DLT_AX25_KISS = 0xca DLT_BACNET_MS_TP = 0xa5 DLT_BLUETOOTH_HCI_H4 = 0xbb DLT_BLUETOOTH_HCI_H4_WITH_PHDR = 0xc9 DLT_CAN20B = 0xbe DLT_CAN_SOCKETCAN = 0xe3 DLT_CHAOS = 0x5 DLT_CHDLC = 0x68 DLT_CISCO_IOS = 0x76 DLT_C_HDLC = 0x68 DLT_C_HDLC_WITH_DIR = 0xcd DLT_DBUS = 0xe7 DLT_DECT = 0xdd DLT_DOCSIS = 0x8f DLT_DVB_CI = 0xeb DLT_ECONET = 0x73 DLT_EN10MB = 0x1 DLT_EN3MB = 0x2 DLT_ENC = 0x6d DLT_ERF = 0xc5 DLT_ERF_ETH = 0xaf DLT_ERF_POS = 0xb0 DLT_FC_2 = 0xe0 DLT_FC_2_WITH_FRAME_DELIMS = 0xe1 DLT_FDDI = 0xa DLT_FLEXRAY = 0xd2 DLT_FRELAY = 0x6b DLT_FRELAY_WITH_DIR = 0xce DLT_GCOM_SERIAL = 0xad DLT_GCOM_T1E1 = 0xac DLT_GPF_F = 0xab DLT_GPF_T = 0xaa DLT_GPRS_LLC = 0xa9 DLT_GSMTAP_ABIS = 0xda DLT_GSMTAP_UM = 0xd9 DLT_HHDLC = 0x79 DLT_IBM_SN = 0x92 DLT_IBM_SP = 0x91 DLT_IEEE802 = 0x6 DLT_IEEE802_11 = 0x69 DLT_IEEE802_11_RADIO = 0x7f DLT_IEEE802_11_RADIO_AVS = 0xa3 DLT_IEEE802_15_4 = 0xc3 DLT_IEEE802_15_4_LINUX = 0xbf DLT_IEEE802_15_4_NOFCS = 0xe6 DLT_IEEE802_15_4_NONASK_PHY = 0xd7 DLT_IEEE802_16_MAC_CPS = 0xbc DLT_IEEE802_16_MAC_CPS_RADIO = 0xc1 DLT_IPFILTER = 0x74 DLT_IPMB = 0xc7 DLT_IPMB_LINUX = 0xd1 DLT_IPNET = 0xe2 DLT_IPOIB = 0xf2 DLT_IPV4 = 0xe4 DLT_IPV6 = 0xe5 DLT_IP_OVER_FC = 0x7a DLT_JUNIPER_ATM1 = 0x89 DLT_JUNIPER_ATM2 = 0x87 DLT_JUNIPER_ATM_CEMIC = 0xee DLT_JUNIPER_CHDLC = 0xb5 DLT_JUNIPER_ES = 0x84 DLT_JUNIPER_ETHER = 0xb2 DLT_JUNIPER_FIBRECHANNEL = 0xea DLT_JUNIPER_FRELAY = 0xb4 DLT_JUNIPER_GGSN = 0x85 DLT_JUNIPER_ISM = 0xc2 DLT_JUNIPER_MFR = 0x86 DLT_JUNIPER_MLFR = 0x83 DLT_JUNIPER_MLPPP = 0x82 DLT_JUNIPER_MONITOR = 0xa4 DLT_JUNIPER_PIC_PEER = 0xae DLT_JUNIPER_PPP = 0xb3 DLT_JUNIPER_PPPOE = 0xa7 DLT_JUNIPER_PPPOE_ATM = 0xa8 DLT_JUNIPER_SERVICES = 0x88 DLT_JUNIPER_SRX_E2E = 0xe9 DLT_JUNIPER_ST = 0xc8 DLT_JUNIPER_VP = 0xb7 DLT_JUNIPER_VS = 0xe8 DLT_LAPB_WITH_DIR = 0xcf DLT_LAPD = 0xcb DLT_LIN = 0xd4 DLT_LINUX_EVDEV = 0xd8 DLT_LINUX_IRDA = 0x90 DLT_LINUX_LAPD = 0xb1 DLT_LINUX_PPP_WITHDIRECTION = 0xa6 DLT_LINUX_SLL = 0x71 DLT_LOOP = 0x6c DLT_LTALK = 0x72 DLT_MATCHING_MAX = 0x10a DLT_MATCHING_MIN = 0x68 DLT_MFR = 0xb6 DLT_MOST = 0xd3 DLT_MPEG_2_TS = 0xf3 DLT_MPLS = 0xdb DLT_MTP2 = 0x8c DLT_MTP2_WITH_PHDR = 0x8b DLT_MTP3 = 0x8d DLT_MUX27010 = 0xec DLT_NETANALYZER = 0xf0 DLT_NETANALYZER_TRANSPARENT = 0xf1 DLT_NFC_LLCP = 0xf5 DLT_NFLOG = 0xef DLT_NG40 = 0xf4 DLT_NULL = 0x0 DLT_PCI_EXP = 0x7d DLT_PFLOG = 0x75 DLT_PFSYNC = 0x12 DLT_PPI = 0xc0 DLT_PPP = 0x9 DLT_PPP_BSDOS = 0x10 DLT_PPP_ETHER = 0x33 DLT_PPP_PPPD = 0xa6 DLT_PPP_SERIAL = 0x32 DLT_PPP_WITH_DIR = 0xcc DLT_PPP_WITH_DIRECTION = 0xa6 DLT_PRISM_HEADER = 0x77 DLT_PRONET = 0x4 DLT_RAIF1 = 0xc6 DLT_RAW = 0xc DLT_RIO = 0x7c DLT_SCCP = 0x8e DLT_SITA = 0xc4 DLT_SLIP = 0x8 DLT_SLIP_BSDOS = 0xf DLT_STANAG_5066_D_PDU = 0xed DLT_SUNATM = 0x7b DLT_SYMANTEC_FIREWALL = 0x63 DLT_TZSP = 0x80 DLT_USB = 0xba DLT_USB_DARWIN = 0x10a DLT_USB_LINUX = 0xbd DLT_USB_LINUX_MMAPPED = 0xdc DLT_USER0 = 0x93 DLT_USER1 = 0x94 DLT_USER10 = 0x9d DLT_USER11 = 0x9e DLT_USER12 = 0x9f DLT_USER13 = 0xa0 DLT_USER14 = 0xa1 DLT_USER15 = 0xa2 DLT_USER2 = 0x95 DLT_USER3 = 0x96 DLT_USER4 = 0x97 DLT_USER5 = 0x98 DLT_USER6 = 0x99 DLT_USER7 = 0x9a DLT_USER8 = 0x9b DLT_USER9 = 0x9c DLT_WIHART = 0xdf DLT_X2E_SERIAL = 0xd5 DLT_X2E_XORAYA = 0xd6 DT_BLK = 0x6 DT_CHR = 0x2 DT_DIR = 0x4 DT_FIFO = 0x1 DT_LNK = 0xa DT_REG = 0x8 DT_SOCK = 0xc DT_UNKNOWN = 0x0 DT_WHT = 0xe ECHO = 0x8 ECHOCTL = 0x40 ECHOE = 0x2 ECHOK = 0x4 ECHOKE = 0x1 ECHONL = 0x10 ECHOPRT = 0x20 EVFILT_AIO = -0x3 EVFILT_EXCEPT = -0xf EVFILT_FS = -0x9 EVFILT_MACHPORT = -0x8 EVFILT_PROC = -0x5 EVFILT_READ = -0x1 EVFILT_SIGNAL = -0x6 EVFILT_SYSCOUNT = 0x11 EVFILT_THREADMARKER = 0x11 EVFILT_TIMER = -0x7 EVFILT_USER = -0xa EVFILT_VM = -0xc EVFILT_VNODE = -0x4 EVFILT_WRITE = -0x2 EV_ADD = 0x1 EV_CLEAR = 0x20 EV_DELETE = 0x2 EV_DISABLE = 0x8 EV_DISPATCH = 0x80 EV_DISPATCH2 = 0x180 EV_ENABLE = 0x4 EV_EOF = 0x8000 EV_ERROR = 0x4000 EV_FLAG0 = 0x1000 EV_FLAG1 = 0x2000 EV_ONESHOT = 0x10 EV_OOBAND = 0x2000 EV_POLL = 0x1000 EV_RECEIPT = 0x40 EV_SYSFLAGS = 0xf000 EV_UDATA_SPECIFIC = 0x100 EV_VANISHED = 0x200 EXTA = 0x4b00 EXTB = 0x9600 EXTPROC = 0x800 FD_CLOEXEC = 0x1 FD_SETSIZE = 0x400 FF0 = 0x0 FF1 = 0x4000 FFDLY = 0x4000 FLUSHO = 0x800000 FSOPT_ATTR_CMN_EXTENDED = 0x20 FSOPT_NOFOLLOW = 0x1 FSOPT_NOINMEMUPDATE = 0x2 FSOPT_PACK_INVAL_ATTRS = 0x8 FSOPT_REPORT_FULLSIZE = 0x4 FSOPT_RETURN_REALDEV = 0x200 F_ADDFILESIGS = 0x3d F_ADDFILESIGS_FOR_DYLD_SIM = 0x53 F_ADDFILESIGS_INFO = 0x67 F_ADDFILESIGS_RETURN = 0x61 F_ADDFILESUPPL = 0x68 F_ADDSIGS = 0x3b F_ALLOCATEALL = 0x4 F_ALLOCATECONTIG = 0x2 F_BARRIERFSYNC = 0x55 F_CHECK_LV = 0x62 F_CHKCLEAN = 0x29 F_DUPFD = 0x0 F_DUPFD_CLOEXEC = 0x43 F_FINDSIGS = 0x4e F_FLUSH_DATA = 0x28 F_FREEZE_FS = 0x35 F_FULLFSYNC = 0x33 F_GETCODEDIR = 0x48 F_GETFD = 0x1 F_GETFL = 0x3 F_GETLK = 0x7 F_GETLKPID = 0x42 F_GETNOSIGPIPE = 0x4a F_GETOWN = 0x5 F_GETPATH = 0x32 F_GETPATH_MTMINFO = 0x47 F_GETPATH_NOFIRMLINK = 0x66 F_GETPROTECTIONCLASS = 0x3f F_GETPROTECTIONLEVEL = 0x4d F_GETSIGSINFO = 0x69 F_GLOBAL_NOCACHE = 0x37 F_LOG2PHYS = 0x31 F_LOG2PHYS_EXT = 0x41 F_NOCACHE = 0x30 F_NODIRECT = 0x3e F_OK = 0x0 F_PATHPKG_CHECK = 0x34 F_PEOFPOSMODE = 0x3 F_PREALLOCATE = 0x2a F_PUNCHHOLE = 0x63 F_RDADVISE = 0x2c F_RDAHEAD = 0x2d F_RDLCK = 0x1 F_SETBACKINGSTORE = 0x46 F_SETFD = 0x2 F_SETFL = 0x4 F_SETLK = 0x8 F_SETLKW = 0x9 F_SETLKWTIMEOUT = 0xa F_SETNOSIGPIPE = 0x49 F_SETOWN = 0x6 F_SETPROTECTIONCLASS = 0x40 F_SETSIZE = 0x2b F_SINGLE_WRITER = 0x4c F_SPECULATIVE_READ = 0x65 F_THAW_FS = 0x36 F_TRANSCODEKEY = 0x4b F_TRIM_ACTIVE_FILE = 0x64 F_UNLCK = 0x2 F_VOLPOSMODE = 0x4 F_WRLCK = 0x3 HUPCL = 0x4000 HW_MACHINE = 0x1 ICANON = 0x100 ICMP6_FILTER = 0x12 ICRNL = 0x100 IEXTEN = 0x400 IFF_ALLMULTI = 0x200 IFF_ALTPHYS = 0x4000 IFF_BROADCAST = 0x2 IFF_DEBUG = 0x4 IFF_LINK0 = 0x1000 IFF_LINK1 = 0x2000 IFF_LINK2 = 0x4000 IFF_LOOPBACK = 0x8 IFF_MULTICAST = 0x8000 IFF_NOARP = 0x80 IFF_NOTRAILERS = 0x20 IFF_OACTIVE = 0x400 IFF_POINTOPOINT = 0x10 IFF_PROMISC = 0x100 IFF_RUNNING = 0x40 IFF_SIMPLEX = 0x800 IFF_UP = 0x1 IFNAMSIZ = 0x10 IFT_1822 = 0x2 IFT_6LOWPAN = 0x40 IFT_AAL5 = 0x31 IFT_ARCNET = 0x23 IFT_ARCNETPLUS = 0x24 IFT_ATM = 0x25 IFT_BRIDGE = 0xd1 IFT_CARP = 0xf8 IFT_CELLULAR = 0xff IFT_CEPT = 0x13 IFT_DS3 = 0x1e IFT_ENC = 0xf4 IFT_EON = 0x19 IFT_ETHER = 0x6 IFT_FAITH = 0x38 IFT_FDDI = 0xf IFT_FRELAY = 0x20 IFT_FRELAYDCE = 0x2c IFT_GIF = 0x37 IFT_HDH1822 = 0x3 IFT_HIPPI = 0x2f IFT_HSSI = 0x2e IFT_HY = 0xe IFT_IEEE1394 = 0x90 IFT_IEEE8023ADLAG = 0x88 IFT_ISDNBASIC = 0x14 IFT_ISDNPRIMARY = 0x15 IFT_ISO88022LLC = 0x29 IFT_ISO88023 = 0x7 IFT_ISO88024 = 0x8 IFT_ISO88025 = 0x9 IFT_ISO88026 = 0xa IFT_L2VLAN = 0x87 IFT_LAPB = 0x10 IFT_LOCALTALK = 0x2a IFT_LOOP = 0x18 IFT_MIOX25 = 0x26 IFT_MODEM = 0x30 IFT_NSIP = 0x1b IFT_OTHER = 0x1 IFT_P10 = 0xc IFT_P80 = 0xd IFT_PARA = 0x22 IFT_PDP = 0xff IFT_PFLOG = 0xf5 IFT_PFSYNC = 0xf6 IFT_PKTAP = 0xfe IFT_PPP = 0x17 IFT_PROPMUX = 0x36 IFT_PROPVIRTUAL = 0x35 IFT_PTPSERIAL = 0x16 IFT_RS232 = 0x21 IFT_SDLC = 0x11 IFT_SIP = 0x1f IFT_SLIP = 0x1c IFT_SMDSDXI = 0x2b IFT_SMDSICIP = 0x34 IFT_SONET = 0x27 IFT_SONETPATH = 0x32 IFT_SONETVT = 0x33 IFT_STARLAN = 0xb IFT_STF = 0x39 IFT_T1 = 0x12 IFT_ULTRA = 0x1d IFT_V35 = 0x2d IFT_X25 = 0x5 IFT_X25DDN = 0x4 IFT_X25PLE = 0x28 IFT_XETHER = 0x1a IGNBRK = 0x1 IGNCR = 0x80 IGNPAR = 0x4 IMAXBEL = 0x2000 INLCR = 0x40 INPCK = 0x10 IN_CLASSA_HOST = 0xffffff IN_CLASSA_MAX = 0x80 IN_CLASSA_NET = 0xff000000 IN_CLASSA_NSHIFT = 0x18 IN_CLASSB_HOST = 0xffff IN_CLASSB_MAX = 0x10000 IN_CLASSB_NET = 0xffff0000 IN_CLASSB_NSHIFT = 0x10 IN_CLASSC_HOST = 0xff IN_CLASSC_NET = 0xffffff00 IN_CLASSC_NSHIFT = 0x8 IN_CLASSD_HOST = 0xfffffff IN_CLASSD_NET = 0xf0000000 IN_CLASSD_NSHIFT = 0x1c IN_LINKLOCALNETNUM = 0xa9fe0000 IN_LOOPBACKNET = 0x7f IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x400473d1 IPPROTO_3PC = 0x22 IPPROTO_ADFS = 0x44 IPPROTO_AH = 0x33 IPPROTO_AHIP = 0x3d IPPROTO_APES = 0x63 IPPROTO_ARGUS = 0xd IPPROTO_AX25 = 0x5d IPPROTO_BHA = 0x31 IPPROTO_BLT = 0x1e IPPROTO_BRSATMON = 0x4c IPPROTO_CFTP = 0x3e IPPROTO_CHAOS = 0x10 IPPROTO_CMTP = 0x26 IPPROTO_CPHB = 0x49 IPPROTO_CPNX = 0x48 IPPROTO_DDP = 0x25 IPPROTO_DGP = 0x56 IPPROTO_DIVERT = 0xfe IPPROTO_DONE = 0x101 IPPROTO_DSTOPTS = 0x3c IPPROTO_EGP = 0x8 IPPROTO_EMCON = 0xe IPPROTO_ENCAP = 0x62 IPPROTO_EON = 0x50 IPPROTO_ESP = 0x32 IPPROTO_ETHERIP = 0x61 IPPROTO_FRAGMENT = 0x2c IPPROTO_GGP = 0x3 IPPROTO_GMTP = 0x64 IPPROTO_GRE = 0x2f IPPROTO_HELLO = 0x3f IPPROTO_HMP = 0x14 IPPROTO_HOPOPTS = 0x0 IPPROTO_ICMP = 0x1 IPPROTO_ICMPV6 = 0x3a IPPROTO_IDP = 0x16 IPPROTO_IDPR = 0x23 IPPROTO_IDRP = 0x2d IPPROTO_IGMP = 0x2 IPPROTO_IGP = 0x55 IPPROTO_IGRP = 0x58 IPPROTO_IL = 0x28 IPPROTO_INLSP = 0x34 IPPROTO_INP = 0x20 IPPROTO_IP = 0x0 IPPROTO_IPCOMP = 0x6c IPPROTO_IPCV = 0x47 IPPROTO_IPEIP = 0x5e IPPROTO_IPIP = 0x4 IPPROTO_IPPC = 0x43 IPPROTO_IPV4 = 0x4 IPPROTO_IPV6 = 0x29 IPPROTO_IRTP = 0x1c IPPROTO_KRYPTOLAN = 0x41 IPPROTO_LARP = 0x5b IPPROTO_LEAF1 = 0x19 IPPROTO_LEAF2 = 0x1a IPPROTO_MAX = 0x100 IPPROTO_MAXID = 0x34 IPPROTO_MEAS = 0x13 IPPROTO_MHRP = 0x30 IPPROTO_MICP = 0x5f IPPROTO_MTP = 0x5c IPPROTO_MUX = 0x12 IPPROTO_ND = 0x4d IPPROTO_NHRP = 0x36 IPPROTO_NONE = 0x3b IPPROTO_NSP = 0x1f IPPROTO_NVPII = 0xb IPPROTO_OSPFIGP = 0x59 IPPROTO_PGM = 0x71 IPPROTO_PIGP = 0x9 IPPROTO_PIM = 0x67 IPPROTO_PRM = 0x15 IPPROTO_PUP = 0xc IPPROTO_PVP = 0x4b IPPROTO_RAW = 0xff IPPROTO_RCCMON = 0xa IPPROTO_RDP = 0x1b IPPROTO_ROUTING = 0x2b IPPROTO_RSVP = 0x2e IPPROTO_RVD = 0x42 IPPROTO_SATEXPAK = 0x40 IPPROTO_SATMON = 0x45 IPPROTO_SCCSP = 0x60 IPPROTO_SCTP = 0x84 IPPROTO_SDRP = 0x2a IPPROTO_SEP = 0x21 IPPROTO_SRPC = 0x5a IPPROTO_ST = 0x7 IPPROTO_SVMTP = 0x52 IPPROTO_SWIPE = 0x35 IPPROTO_TCF = 0x57 IPPROTO_TCP = 0x6 IPPROTO_TP = 0x1d IPPROTO_TPXX = 0x27 IPPROTO_TRUNK1 = 0x17 IPPROTO_TRUNK2 = 0x18 IPPROTO_TTP = 0x54 IPPROTO_UDP = 0x11 IPPROTO_VINES = 0x53 IPPROTO_VISA = 0x46 IPPROTO_VMTP = 0x51 IPPROTO_WBEXPAK = 0x4f IPPROTO_WBMON = 0x4e IPPROTO_WSN = 0x4a IPPROTO_XNET = 0xf IPPROTO_XTP = 0x24 IPV6_2292DSTOPTS = 0x17 IPV6_2292HOPLIMIT = 0x14 IPV6_2292HOPOPTS = 0x16 IPV6_2292NEXTHOP = 0x15 IPV6_2292PKTINFO = 0x13 IPV6_2292PKTOPTIONS = 0x19 IPV6_2292RTHDR = 0x18 IPV6_3542DSTOPTS = 0x32 IPV6_3542HOPLIMIT = 0x2f IPV6_3542HOPOPTS = 0x31 IPV6_3542NEXTHOP = 0x30 IPV6_3542PKTINFO = 0x2e IPV6_3542RTHDR = 0x33 IPV6_ADDR_MC_FLAGS_PREFIX = 0x20 IPV6_ADDR_MC_FLAGS_TRANSIENT = 0x10 IPV6_ADDR_MC_FLAGS_UNICAST_BASED = 0x30 IPV6_AUTOFLOWLABEL = 0x3b IPV6_BINDV6ONLY = 0x1b IPV6_BOUND_IF = 0x7d IPV6_CHECKSUM = 0x1a IPV6_DEFAULT_MULTICAST_HOPS = 0x1 IPV6_DEFAULT_MULTICAST_LOOP = 0x1 IPV6_DEFHLIM = 0x40 IPV6_DONTFRAG = 0x3e IPV6_DSTOPTS = 0x32 IPV6_FAITH = 0x1d IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_MASK = 0xffff0f00 IPV6_FLOW_ECN_MASK = 0x3000 IPV6_FRAGTTL = 0x3c IPV6_FW_ADD = 0x1e IPV6_FW_DEL = 0x1f IPV6_FW_FLUSH = 0x20 IPV6_FW_GET = 0x22 IPV6_FW_ZERO = 0x21 IPV6_HLIMDEC = 0x1 IPV6_HOPLIMIT = 0x2f IPV6_HOPOPTS = 0x31 IPV6_IPSEC_POLICY = 0x1c IPV6_JOIN_GROUP = 0xc IPV6_LEAVE_GROUP = 0xd IPV6_MAXHLIM = 0xff IPV6_MAXOPTHDR = 0x800 IPV6_MAXPACKET = 0xffff IPV6_MAX_GROUP_SRC_FILTER = 0x200 IPV6_MAX_MEMBERSHIPS = 0xfff IPV6_MAX_SOCK_SRC_FILTER = 0x80 IPV6_MIN_MEMBERSHIPS = 0x1f IPV6_MMTU = 0x500 IPV6_MSFILTER = 0x4a IPV6_MULTICAST_HOPS = 0xa IPV6_MULTICAST_IF = 0x9 IPV6_MULTICAST_LOOP = 0xb IPV6_NEXTHOP = 0x30 IPV6_PATHMTU = 0x2c IPV6_PKTINFO = 0x2e IPV6_PORTRANGE = 0xe IPV6_PORTRANGE_DEFAULT = 0x0 IPV6_PORTRANGE_HIGH = 0x1 IPV6_PORTRANGE_LOW = 0x2 IPV6_PREFER_TEMPADDR = 0x3f IPV6_RECVDSTOPTS = 0x28 IPV6_RECVHOPLIMIT = 0x25 IPV6_RECVHOPOPTS = 0x27 IPV6_RECVPATHMTU = 0x2b IPV6_RECVPKTINFO = 0x3d IPV6_RECVRTHDR = 0x26 IPV6_RECVTCLASS = 0x23 IPV6_RTHDR = 0x33 IPV6_RTHDRDSTOPTS = 0x39 IPV6_RTHDR_LOOSE = 0x0 IPV6_RTHDR_STRICT = 0x1 IPV6_RTHDR_TYPE_0 = 0x0 IPV6_SOCKOPT_RESERVED1 = 0x3 IPV6_TCLASS = 0x24 IPV6_UNICAST_HOPS = 0x4 IPV6_USE_MIN_MTU = 0x2a IPV6_V6ONLY = 0x1b IPV6_VERSION = 0x60 IPV6_VERSION_MASK = 0xf0 IP_ADD_MEMBERSHIP = 0xc IP_ADD_SOURCE_MEMBERSHIP = 0x46 IP_BLOCK_SOURCE = 0x48 IP_BOUND_IF = 0x19 IP_DEFAULT_MULTICAST_LOOP = 0x1 IP_DEFAULT_MULTICAST_TTL = 0x1 IP_DF = 0x4000 IP_DONTFRAG = 0x1c IP_DROP_MEMBERSHIP = 0xd IP_DROP_SOURCE_MEMBERSHIP = 0x47 IP_DUMMYNET_CONFIGURE = 0x3c IP_DUMMYNET_DEL = 0x3d IP_DUMMYNET_FLUSH = 0x3e IP_DUMMYNET_GET = 0x40 IP_FAITH = 0x16 IP_FW_ADD = 0x28 IP_FW_DEL = 0x29 IP_FW_FLUSH = 0x2a IP_FW_GET = 0x2c IP_FW_RESETLOG = 0x2d IP_FW_ZERO = 0x2b IP_HDRINCL = 0x2 IP_IPSEC_POLICY = 0x15 IP_MAXPACKET = 0xffff IP_MAX_GROUP_SRC_FILTER = 0x200 IP_MAX_MEMBERSHIPS = 0xfff IP_MAX_SOCK_MUTE_FILTER = 0x80 IP_MAX_SOCK_SRC_FILTER = 0x80 IP_MF = 0x2000 IP_MIN_MEMBERSHIPS = 0x1f IP_MSFILTER = 0x4a IP_MSS = 0x240 IP_MULTICAST_IF = 0x9 IP_MULTICAST_IFINDEX = 0x42 IP_MULTICAST_LOOP = 0xb IP_MULTICAST_TTL = 0xa IP_MULTICAST_VIF = 0xe IP_NAT__XXX = 0x37 IP_OFFMASK = 0x1fff IP_OLD_FW_ADD = 0x32 IP_OLD_FW_DEL = 0x33 IP_OLD_FW_FLUSH = 0x34 IP_OLD_FW_GET = 0x36 IP_OLD_FW_RESETLOG = 0x38 IP_OLD_FW_ZERO = 0x35 IP_OPTIONS = 0x1 IP_PKTINFO = 0x1a IP_PORTRANGE = 0x13 IP_PORTRANGE_DEFAULT = 0x0 IP_PORTRANGE_HIGH = 0x1 IP_PORTRANGE_LOW = 0x2 IP_RECVDSTADDR = 0x7 IP_RECVIF = 0x14 IP_RECVOPTS = 0x5 IP_RECVPKTINFO = 0x1a IP_RECVRETOPTS = 0x6 IP_RECVTOS = 0x1b IP_RECVTTL = 0x18 IP_RETOPTS = 0x8 IP_RF = 0x8000 IP_RSVP_OFF = 0x10 IP_RSVP_ON = 0xf IP_RSVP_VIF_OFF = 0x12 IP_RSVP_VIF_ON = 0x11 IP_STRIPHDR = 0x17 IP_TOS = 0x3 IP_TRAFFIC_MGT_BACKGROUND = 0x41 IP_TTL = 0x4 IP_UNBLOCK_SOURCE = 0x49 ISIG = 0x80 ISTRIP = 0x20 IUTF8 = 0x4000 IXANY = 0x800 IXOFF = 0x400 IXON = 0x200 KERN_HOSTNAME = 0xa KERN_OSRELEASE = 0x2 KERN_OSTYPE = 0x1 KERN_VERSION = 0x4 LOCAL_PEERCRED = 0x1 LOCAL_PEEREPID = 0x3 LOCAL_PEEREUUID = 0x5 LOCAL_PEERPID = 0x2 LOCAL_PEERTOKEN = 0x6 LOCAL_PEERUUID = 0x4 LOCK_EX = 0x2 LOCK_NB = 0x4 LOCK_SH = 0x1 LOCK_UN = 0x8 MADV_CAN_REUSE = 0x9 MADV_DONTNEED = 0x4 MADV_FREE = 0x5 MADV_FREE_REUSABLE = 0x7 MADV_FREE_REUSE = 0x8 MADV_NORMAL = 0x0 MADV_PAGEOUT = 0xa MADV_RANDOM = 0x1 MADV_SEQUENTIAL = 0x2 MADV_WILLNEED = 0x3 MADV_ZERO_WIRED_PAGES = 0x6 MAP_32BIT = 0x8000 MAP_ANON = 0x1000 MAP_ANONYMOUS = 0x1000 MAP_COPY = 0x2 MAP_FILE = 0x0 MAP_FIXED = 0x10 MAP_HASSEMAPHORE = 0x200 MAP_JIT = 0x800 MAP_NOCACHE = 0x400 MAP_NOEXTEND = 0x100 MAP_NORESERVE = 0x40 MAP_PRIVATE = 0x2 MAP_RENAME = 0x20 MAP_RESERVED0080 = 0x80 MAP_RESILIENT_CODESIGN = 0x2000 MAP_RESILIENT_MEDIA = 0x4000 MAP_SHARED = 0x1 MAP_TRANSLATED_ALLOW_EXECUTE = 0x20000 MAP_UNIX03 = 0x40000 MCAST_BLOCK_SOURCE = 0x54 MCAST_EXCLUDE = 0x2 MCAST_INCLUDE = 0x1 MCAST_JOIN_GROUP = 0x50 MCAST_JOIN_SOURCE_GROUP = 0x52 MCAST_LEAVE_GROUP = 0x51 MCAST_LEAVE_SOURCE_GROUP = 0x53 MCAST_UNBLOCK_SOURCE = 0x55 MCAST_UNDEFINED = 0x0 MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MNT_ASYNC = 0x40 MNT_AUTOMOUNTED = 0x400000 MNT_CMDFLAGS = 0xf0000 MNT_CPROTECT = 0x80 MNT_DEFWRITE = 0x2000000 MNT_DONTBROWSE = 0x100000 MNT_DOVOLFS = 0x8000 MNT_DWAIT = 0x4 MNT_EXPORTED = 0x100 MNT_EXT_ROOT_DATA_VOL = 0x1 MNT_FORCE = 0x80000 MNT_IGNORE_OWNERSHIP = 0x200000 MNT_JOURNALED = 0x800000 MNT_LOCAL = 0x1000 MNT_MULTILABEL = 0x4000000 MNT_NOATIME = 0x10000000 MNT_NOBLOCK = 0x20000 MNT_NODEV = 0x10 MNT_NOEXEC = 0x4 MNT_NOSUID = 0x8 MNT_NOUSERXATTR = 0x1000000 MNT_NOWAIT = 0x2 MNT_QUARANTINE = 0x400 MNT_QUOTA = 0x2000 MNT_RDONLY = 0x1 MNT_RELOAD = 0x40000 MNT_REMOVABLE = 0x200 MNT_ROOTFS = 0x4000 MNT_SNAPSHOT = 0x40000000 MNT_STRICTATIME = 0x80000000 MNT_SYNCHRONOUS = 0x2 MNT_UNION = 0x20 MNT_UNKNOWNPERMISSIONS = 0x200000 MNT_UPDATE = 0x10000 MNT_VISFLAGMASK = 0xd7f0f7ff MNT_WAIT = 0x1 MSG_CTRUNC = 0x20 MSG_DONTROUTE = 0x4 MSG_DONTWAIT = 0x80 MSG_EOF = 0x100 MSG_EOR = 0x8 MSG_FLUSH = 0x400 MSG_HAVEMORE = 0x2000 MSG_HOLD = 0x800 MSG_NEEDSA = 0x10000 MSG_NOSIGNAL = 0x80000 MSG_OOB = 0x1 MSG_PEEK = 0x2 MSG_RCVMORE = 0x4000 MSG_SEND = 0x1000 MSG_TRUNC = 0x10 MSG_WAITALL = 0x40 MSG_WAITSTREAM = 0x200 MS_ASYNC = 0x1 MS_DEACTIVATE = 0x8 MS_INVALIDATE = 0x2 MS_KILLPAGES = 0x4 MS_SYNC = 0x10 NAME_MAX = 0xff NET_RT_DUMP = 0x1 NET_RT_DUMP2 = 0x7 NET_RT_FLAGS = 0x2 NET_RT_FLAGS_PRIV = 0xa NET_RT_IFLIST = 0x3 NET_RT_IFLIST2 = 0x6 NET_RT_MAXID = 0xb NET_RT_STAT = 0x4 NET_RT_TRASH = 0x5 NFDBITS = 0x20 NL0 = 0x0 NL1 = 0x100 NL2 = 0x200 NL3 = 0x300 NLDLY = 0x300 NOFLSH = 0x80000000 NOKERNINFO = 0x2000000 NOTE_ABSOLUTE = 0x8 NOTE_ATTRIB = 0x8 NOTE_BACKGROUND = 0x40 NOTE_CHILD = 0x4 NOTE_CRITICAL = 0x20 NOTE_DELETE = 0x1 NOTE_EXEC = 0x20000000 NOTE_EXIT = 0x80000000 NOTE_EXITSTATUS = 0x4000000 NOTE_EXIT_CSERROR = 0x40000 NOTE_EXIT_DECRYPTFAIL = 0x10000 NOTE_EXIT_DETAIL = 0x2000000 NOTE_EXIT_DETAIL_MASK = 0x70000 NOTE_EXIT_MEMORY = 0x20000 NOTE_EXIT_REPARENTED = 0x80000 NOTE_EXTEND = 0x4 NOTE_FFAND = 0x40000000 NOTE_FFCOPY = 0xc0000000 NOTE_FFCTRLMASK = 0xc0000000 NOTE_FFLAGSMASK = 0xffffff NOTE_FFNOP = 0x0 NOTE_FFOR = 0x80000000 NOTE_FORK = 0x40000000 NOTE_FUNLOCK = 0x100 NOTE_LEEWAY = 0x10 NOTE_LINK = 0x10 NOTE_LOWAT = 0x1 NOTE_MACHTIME = 0x100 NOTE_MACH_CONTINUOUS_TIME = 0x80 NOTE_NONE = 0x80 NOTE_NSECONDS = 0x4 NOTE_OOB = 0x2 NOTE_PCTRLMASK = -0x100000 NOTE_PDATAMASK = 0xfffff NOTE_REAP = 0x10000000 NOTE_RENAME = 0x20 NOTE_REVOKE = 0x40 NOTE_SECONDS = 0x1 NOTE_SIGNAL = 0x8000000 NOTE_TRACK = 0x1 NOTE_TRACKERR = 0x2 NOTE_TRIGGER = 0x1000000 NOTE_USECONDS = 0x2 NOTE_VM_ERROR = 0x10000000 NOTE_VM_PRESSURE = 0x80000000 NOTE_VM_PRESSURE_SUDDEN_TERMINATE = 0x20000000 NOTE_VM_PRESSURE_TERMINATE = 0x40000000 NOTE_WRITE = 0x2 OCRNL = 0x10 OFDEL = 0x20000 OFILL = 0x80 ONLCR = 0x2 ONLRET = 0x40 ONOCR = 0x20 ONOEOT = 0x8 OPOST = 0x1 OXTABS = 0x4 O_ACCMODE = 0x3 O_ALERT = 0x20000000 O_APPEND = 0x8 O_ASYNC = 0x40 O_CLOEXEC = 0x1000000 O_CREAT = 0x200 O_DIRECTORY = 0x100000 O_DP_GETRAWENCRYPTED = 0x1 O_DP_GETRAWUNENCRYPTED = 0x2 O_DSYNC = 0x400000 O_EVTONLY = 0x8000 O_EXCL = 0x800 O_EXLOCK = 0x20 O_FSYNC = 0x80 O_NDELAY = 0x4 O_NOCTTY = 0x20000 O_NOFOLLOW = 0x100 O_NOFOLLOW_ANY = 0x20000000 O_NONBLOCK = 0x4 O_POPUP = 0x80000000 O_RDONLY = 0x0 O_RDWR = 0x2 O_SHLOCK = 0x10 O_SYMLINK = 0x200000 O_SYNC = 0x80 O_TRUNC = 0x400 O_WRONLY = 0x1 PARENB = 0x1000 PARMRK = 0x8 PARODD = 0x2000 PENDIN = 0x20000000 PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 PROT_EXEC = 0x4 PROT_NONE = 0x0 PROT_READ = 0x1 PROT_WRITE = 0x2 PT_ATTACH = 0xa PT_ATTACHEXC = 0xe PT_CONTINUE = 0x7 PT_DENY_ATTACH = 0x1f PT_DETACH = 0xb PT_FIRSTMACH = 0x20 PT_FORCEQUOTA = 0x1e PT_KILL = 0x8 PT_READ_D = 0x2 PT_READ_I = 0x1 PT_READ_U = 0x3 PT_SIGEXC = 0xc PT_STEP = 0x9 PT_THUPDATE = 0xd PT_TRACE_ME = 0x0 PT_WRITE_D = 0x5 PT_WRITE_I = 0x4 PT_WRITE_U = 0x6 RENAME_EXCL = 0x4 RENAME_NOFOLLOW_ANY = 0x10 RENAME_RESERVED1 = 0x8 RENAME_SECLUDE = 0x1 RENAME_SWAP = 0x2 RLIMIT_AS = 0x5 RLIMIT_CORE = 0x4 RLIMIT_CPU = 0x0 RLIMIT_CPU_USAGE_MONITOR = 0x2 RLIMIT_DATA = 0x2 RLIMIT_FSIZE = 0x1 RLIMIT_MEMLOCK = 0x6 RLIMIT_NOFILE = 0x8 RLIMIT_NPROC = 0x7 RLIMIT_RSS = 0x5 RLIMIT_STACK = 0x3 RLIM_INFINITY = 0x7fffffffffffffff RTAX_AUTHOR = 0x6 RTAX_BRD = 0x7 RTAX_DST = 0x0 RTAX_GATEWAY = 0x1 RTAX_GENMASK = 0x3 RTAX_IFA = 0x5 RTAX_IFP = 0x4 RTAX_MAX = 0x8 RTAX_NETMASK = 0x2 RTA_AUTHOR = 0x40 RTA_BRD = 0x80 RTA_DST = 0x1 RTA_GATEWAY = 0x2 RTA_GENMASK = 0x8 RTA_IFA = 0x20 RTA_IFP = 0x10 RTA_NETMASK = 0x4 RTF_BLACKHOLE = 0x1000 RTF_BROADCAST = 0x400000 RTF_CLONING = 0x100 RTF_CONDEMNED = 0x2000000 RTF_DEAD = 0x20000000 RTF_DELCLONE = 0x80 RTF_DONE = 0x40 RTF_DYNAMIC = 0x10 RTF_GATEWAY = 0x2 RTF_GLOBAL = 0x40000000 RTF_HOST = 0x4 RTF_IFREF = 0x4000000 RTF_IFSCOPE = 0x1000000 RTF_LLDATA = 0x400 RTF_LLINFO = 0x400 RTF_LOCAL = 0x200000 RTF_MODIFIED = 0x20 RTF_MULTICAST = 0x800000 RTF_NOIFREF = 0x2000 RTF_PINNED = 0x100000 RTF_PRCLONING = 0x10000 RTF_PROTO1 = 0x8000 RTF_PROTO2 = 0x4000 RTF_PROTO3 = 0x40000 RTF_PROXY = 0x8000000 RTF_REJECT = 0x8 RTF_ROUTER = 0x10000000 RTF_STATIC = 0x800 RTF_UP = 0x1 RTF_WASCLONED = 0x20000 RTF_XRESOLVE = 0x200 RTM_ADD = 0x1 RTM_CHANGE = 0x3 RTM_DELADDR = 0xd RTM_DELETE = 0x2 RTM_DELMADDR = 0x10 RTM_GET = 0x4 RTM_GET2 = 0x14 RTM_IFINFO = 0xe RTM_IFINFO2 = 0x12 RTM_LOCK = 0x8 RTM_LOSING = 0x5 RTM_MISS = 0x7 RTM_NEWADDR = 0xc RTM_NEWMADDR = 0xf RTM_NEWMADDR2 = 0x13 RTM_OLDADD = 0x9 RTM_OLDDEL = 0xa RTM_REDIRECT = 0x6 RTM_RESOLVE = 0xb RTM_RTTUNIT = 0xf4240 RTM_VERSION = 0x5 RTV_EXPIRE = 0x4 RTV_HOPCOUNT = 0x2 RTV_MTU = 0x1 RTV_RPIPE = 0x8 RTV_RTT = 0x40 RTV_RTTVAR = 0x80 RTV_SPIPE = 0x10 RTV_SSTHRESH = 0x20 RUSAGE_CHILDREN = -0x1 RUSAGE_SELF = 0x0 SAE_ASSOCID_ALL = 0xffffffff SAE_ASSOCID_ANY = 0x0 SAE_CONNID_ALL = 0xffffffff SAE_CONNID_ANY = 0x0 SCM_CREDS = 0x3 SCM_RIGHTS = 0x1 SCM_TIMESTAMP = 0x2 SCM_TIMESTAMP_MONOTONIC = 0x4 SEEK_CUR = 0x1 SEEK_DATA = 0x4 SEEK_END = 0x2 SEEK_HOLE = 0x3 SEEK_SET = 0x0 SF_APPEND = 0x40000 SF_ARCHIVED = 0x10000 SF_DATALESS = 0x40000000 SF_FIRMLINK = 0x800000 SF_IMMUTABLE = 0x20000 SF_NOUNLINK = 0x100000 SF_RESTRICTED = 0x80000 SF_SETTABLE = 0x3fff0000 SF_SUPPORTED = 0x9f0000 SF_SYNTHETIC = 0xc0000000 SHUT_RD = 0x0 SHUT_RDWR = 0x2 SHUT_WR = 0x1 SIOCADDMULTI = 0x80206931 SIOCAIFADDR = 0x8040691a SIOCARPIPLL = 0xc0206928 SIOCATMARK = 0x40047307 SIOCAUTOADDR = 0xc0206926 SIOCAUTONETMASK = 0x80206927 SIOCDELMULTI = 0x80206932 SIOCDIFADDR = 0x80206919 SIOCDIFPHYADDR = 0x80206941 SIOCGDRVSPEC = 0xc028697b SIOCGETVLAN = 0xc020697f SIOCGHIWAT = 0x40047301 SIOCGIF6LOWPAN = 0xc02069c5 SIOCGIFADDR = 0xc0206921 SIOCGIFALTMTU = 0xc0206948 SIOCGIFASYNCMAP = 0xc020697c SIOCGIFBOND = 0xc0206947 SIOCGIFBRDADDR = 0xc0206923 SIOCGIFCAP = 0xc020695b SIOCGIFCONF = 0xc00c6924 SIOCGIFDEVMTU = 0xc0206944 SIOCGIFDSTADDR = 0xc0206922 SIOCGIFFLAGS = 0xc0206911 SIOCGIFFUNCTIONALTYPE = 0xc02069ad SIOCGIFGENERIC = 0xc020693a SIOCGIFKPI = 0xc0206987 SIOCGIFMAC = 0xc0206982 SIOCGIFMEDIA = 0xc02c6938 SIOCGIFMETRIC = 0xc0206917 SIOCGIFMTU = 0xc0206933 SIOCGIFNETMASK = 0xc0206925 SIOCGIFPDSTADDR = 0xc0206940 SIOCGIFPHYS = 0xc0206935 SIOCGIFPSRCADDR = 0xc020693f SIOCGIFSTATUS = 0xc331693d SIOCGIFVLAN = 0xc020697f SIOCGIFWAKEFLAGS = 0xc0206988 SIOCGIFXMEDIA = 0xc02c6948 SIOCGLOWAT = 0x40047303 SIOCGPGRP = 0x40047309 SIOCIFCREATE = 0xc0206978 SIOCIFCREATE2 = 0xc020697a SIOCIFDESTROY = 0x80206979 SIOCIFGCLONERS = 0xc0106981 SIOCRSLVMULTI = 0xc010693b SIOCSDRVSPEC = 0x8028697b SIOCSETVLAN = 0x8020697e SIOCSHIWAT = 0x80047300 SIOCSIF6LOWPAN = 0x802069c4 SIOCSIFADDR = 0x8020690c SIOCSIFALTMTU = 0x80206945 SIOCSIFASYNCMAP = 0x8020697d SIOCSIFBOND = 0x80206946 SIOCSIFBRDADDR = 0x80206913 SIOCSIFCAP = 0x8020695a SIOCSIFDSTADDR = 0x8020690e SIOCSIFFLAGS = 0x80206910 SIOCSIFGENERIC = 0x80206939 SIOCSIFKPI = 0x80206986 SIOCSIFLLADDR = 0x8020693c SIOCSIFMAC = 0x80206983 SIOCSIFMEDIA = 0xc0206937 SIOCSIFMETRIC = 0x80206918 SIOCSIFMTU = 0x80206934 SIOCSIFNETMASK = 0x80206916 SIOCSIFPHYADDR = 0x8040693e SIOCSIFPHYS = 0x80206936 SIOCSIFVLAN = 0x8020697e SIOCSLOWAT = 0x80047302 SIOCSPGRP = 0x80047308 SOCK_DGRAM = 0x2 SOCK_MAXADDRLEN = 0xff SOCK_RAW = 0x3 SOCK_RDM = 0x4 SOCK_SEQPACKET = 0x5 SOCK_STREAM = 0x1 SOL_LOCAL = 0x0 SOL_SOCKET = 0xffff SOMAXCONN = 0x80 SO_ACCEPTCONN = 0x2 SO_BROADCAST = 0x20 SO_DEBUG = 0x1 SO_DONTROUTE = 0x10 SO_DONTTRUNC = 0x2000 SO_ERROR = 0x1007 SO_KEEPALIVE = 0x8 SO_LABEL = 0x1010 SO_LINGER = 0x80 SO_LINGER_SEC = 0x1080 SO_NETSVC_MARKING_LEVEL = 0x1119 SO_NET_SERVICE_TYPE = 0x1116 SO_NKE = 0x1021 SO_NOADDRERR = 0x1023 SO_NOSIGPIPE = 0x1022 SO_NOTIFYCONFLICT = 0x1026 SO_NP_EXTENSIONS = 0x1083 SO_NREAD = 0x1020 SO_NUMRCVPKT = 0x1112 SO_NWRITE = 0x1024 SO_OOBINLINE = 0x100 SO_PEERLABEL = 0x1011 SO_RANDOMPORT = 0x1082 SO_RCVBUF = 0x1002 SO_RCVLOWAT = 0x1004 SO_RCVTIMEO = 0x1006 SO_REUSEADDR = 0x4 SO_REUSEPORT = 0x200 SO_REUSESHAREUID = 0x1025 SO_SNDBUF = 0x1001 SO_SNDLOWAT = 0x1003 SO_SNDTIMEO = 0x1005 SO_TIMESTAMP = 0x400 SO_TIMESTAMP_MONOTONIC = 0x800 SO_TRACKER_ATTRIBUTE_FLAGS_APP_APPROVED = 0x1 SO_TRACKER_ATTRIBUTE_FLAGS_DOMAIN_SHORT = 0x4 SO_TRACKER_ATTRIBUTE_FLAGS_TRACKER = 0x2 SO_TRACKER_TRANSPARENCY_VERSION = 0x3 SO_TYPE = 0x1008 SO_UPCALLCLOSEWAIT = 0x1027 SO_USELOOPBACK = 0x40 SO_WANTMORE = 0x4000 SO_WANTOOBFLAG = 0x8000 S_IEXEC = 0x40 S_IFBLK = 0x6000 S_IFCHR = 0x2000 S_IFDIR = 0x4000 S_IFIFO = 0x1000 S_IFLNK = 0xa000 S_IFMT = 0xf000 S_IFREG = 0x8000 S_IFSOCK = 0xc000 S_IFWHT = 0xe000 S_IREAD = 0x100 S_IRGRP = 0x20 S_IROTH = 0x4 S_IRUSR = 0x100 S_IRWXG = 0x38 S_IRWXO = 0x7 S_IRWXU = 0x1c0 S_ISGID = 0x400 S_ISTXT = 0x200 S_ISUID = 0x800 S_ISVTX = 0x200 S_IWGRP = 0x10 S_IWOTH = 0x2 S_IWRITE = 0x80 S_IWUSR = 0x80 S_IXGRP = 0x8 S_IXOTH = 0x1 S_IXUSR = 0x40 TAB0 = 0x0 TAB1 = 0x400 TAB2 = 0x800 TAB3 = 0x4 TABDLY = 0xc04 TCIFLUSH = 0x1 TCIOFF = 0x3 TCIOFLUSH = 0x3 TCION = 0x4 TCOFLUSH = 0x2 TCOOFF = 0x1 TCOON = 0x2 TCPOPT_CC = 0xb TCPOPT_CCECHO = 0xd TCPOPT_CCNEW = 0xc TCPOPT_EOL = 0x0 TCPOPT_FASTOPEN = 0x22 TCPOPT_MAXSEG = 0x2 TCPOPT_NOP = 0x1 TCPOPT_SACK = 0x5 TCPOPT_SACK_HDR = 0x1010500 TCPOPT_SACK_PERMITTED = 0x4 TCPOPT_SACK_PERMIT_HDR = 0x1010402 TCPOPT_SIGNATURE = 0x13 TCPOPT_TIMESTAMP = 0x8 TCPOPT_TSTAMP_HDR = 0x101080a TCPOPT_WINDOW = 0x3 TCP_CONNECTIONTIMEOUT = 0x20 TCP_CONNECTION_INFO = 0x106 TCP_ENABLE_ECN = 0x104 TCP_FASTOPEN = 0x105 TCP_KEEPALIVE = 0x10 TCP_KEEPCNT = 0x102 TCP_KEEPINTVL = 0x101 TCP_MAXHLEN = 0x3c TCP_MAXOLEN = 0x28 TCP_MAXSEG = 0x2 TCP_MAXWIN = 0xffff TCP_MAX_SACK = 0x4 TCP_MAX_WINSHIFT = 0xe TCP_MINMSS = 0xd8 TCP_MSS = 0x200 TCP_NODELAY = 0x1 TCP_NOOPT = 0x8 TCP_NOPUSH = 0x4 TCP_NOTSENT_LOWAT = 0x201 TCP_RXT_CONNDROPTIME = 0x80 TCP_RXT_FINDROP = 0x100 TCP_SENDMOREACKS = 0x103 TCSAFLUSH = 0x2 TIOCCBRK = 0x2000747a TIOCCDTR = 0x20007478 TIOCCONS = 0x80047462 TIOCDCDTIMESTAMP = 0x40107458 TIOCDRAIN = 0x2000745e TIOCDSIMICROCODE = 0x20007455 TIOCEXCL = 0x2000740d TIOCEXT = 0x80047460 TIOCFLUSH = 0x80047410 TIOCGDRAINWAIT = 0x40047456 TIOCGETA = 0x40487413 TIOCGETD = 0x4004741a TIOCGPGRP = 0x40047477 TIOCGWINSZ = 0x40087468 TIOCIXOFF = 0x20007480 TIOCIXON = 0x20007481 TIOCMBIC = 0x8004746b TIOCMBIS = 0x8004746c TIOCMGDTRWAIT = 0x4004745a TIOCMGET = 0x4004746a TIOCMODG = 0x40047403 TIOCMODS = 0x80047404 TIOCMSDTRWAIT = 0x8004745b TIOCMSET = 0x8004746d TIOCM_CAR = 0x40 TIOCM_CD = 0x40 TIOCM_CTS = 0x20 TIOCM_DSR = 0x100 TIOCM_DTR = 0x2 TIOCM_LE = 0x1 TIOCM_RI = 0x80 TIOCM_RNG = 0x80 TIOCM_RTS = 0x4 TIOCM_SR = 0x10 TIOCM_ST = 0x8 TIOCNOTTY = 0x20007471 TIOCNXCL = 0x2000740e TIOCOUTQ = 0x40047473 TIOCPKT = 0x80047470 TIOCPKT_DATA = 0x0 TIOCPKT_DOSTOP = 0x20 TIOCPKT_FLUSHREAD = 0x1 TIOCPKT_FLUSHWRITE = 0x2 TIOCPKT_IOCTL = 0x40 TIOCPKT_NOSTOP = 0x10 TIOCPKT_START = 0x8 TIOCPKT_STOP = 0x4 TIOCPTYGNAME = 0x40807453 TIOCPTYGRANT = 0x20007454 TIOCPTYUNLK = 0x20007452 TIOCREMOTE = 0x80047469 TIOCSBRK = 0x2000747b TIOCSCONS = 0x20007463 TIOCSCTTY = 0x20007461 TIOCSDRAINWAIT = 0x80047457 TIOCSDTR = 0x20007479 TIOCSETA = 0x80487414 TIOCSETAF = 0x80487416 TIOCSETAW = 0x80487415 TIOCSETD = 0x8004741b TIOCSIG = 0x2000745f TIOCSPGRP = 0x80047476 TIOCSTART = 0x2000746e TIOCSTAT = 0x20007465 TIOCSTI = 0x80017472 TIOCSTOP = 0x2000746f TIOCSWINSZ = 0x80087467 TIOCTIMESTAMP = 0x40107459 TIOCUCNTL = 0x80047466 TOSTOP = 0x400000 UF_APPEND = 0x4 UF_COMPRESSED = 0x20 UF_DATAVAULT = 0x80 UF_HIDDEN = 0x8000 UF_IMMUTABLE = 0x2 UF_NODUMP = 0x1 UF_OPAQUE = 0x8 UF_SETTABLE = 0xffff UF_TRACKED = 0x40 VDISCARD = 0xf VDSUSP = 0xb VEOF = 0x0 VEOL = 0x1 VEOL2 = 0x2 VERASE = 0x3 VINTR = 0x8 VKILL = 0x5 VLNEXT = 0xe VMADDR_CID_ANY = 0xffffffff VMADDR_CID_HOST = 0x2 VMADDR_CID_HYPERVISOR = 0x0 VMADDR_CID_RESERVED = 0x1 VMADDR_PORT_ANY = 0xffffffff VMIN = 0x10 VM_LOADAVG = 0x2 VM_MACHFACTOR = 0x4 VM_MAXID = 0x6 VM_METER = 0x1 VM_SWAPUSAGE = 0x5 VQUIT = 0x9 VREPRINT = 0x6 VSTART = 0xc VSTATUS = 0x12 VSTOP = 0xd VSUSP = 0xa VT0 = 0x0 VT1 = 0x10000 VTDLY = 0x10000 VTIME = 0x11 VWERASE = 0x4 WCONTINUED = 0x10 WCOREFLAG = 0x80 WEXITED = 0x4 WNOHANG = 0x1 WNOWAIT = 0x20 WORDSIZE = 0x40 WSTOPPED = 0x8 WUNTRACED = 0x2 XATTR_CREATE = 0x2 XATTR_NODEFAULT = 0x10 XATTR_NOFOLLOW = 0x1 XATTR_NOSECURITY = 0x8 XATTR_REPLACE = 0x4 XATTR_SHOWCOMPRESSION = 0x20 ) // Errors const ( E2BIG = syscall.Errno(0x7) EACCES = syscall.Errno(0xd) EADDRINUSE = syscall.Errno(0x30) EADDRNOTAVAIL = syscall.Errno(0x31) EAFNOSUPPORT = syscall.Errno(0x2f) EAGAIN = syscall.Errno(0x23) EALREADY = syscall.Errno(0x25) EAUTH = syscall.Errno(0x50) EBADARCH = syscall.Errno(0x56) EBADEXEC = syscall.Errno(0x55) EBADF = syscall.Errno(0x9) EBADMACHO = syscall.Errno(0x58) EBADMSG = syscall.Errno(0x5e) EBADRPC = syscall.Errno(0x48) EBUSY = syscall.Errno(0x10) ECANCELED = syscall.Errno(0x59) ECHILD = syscall.Errno(0xa) ECONNABORTED = syscall.Errno(0x35) ECONNREFUSED = syscall.Errno(0x3d) ECONNRESET = syscall.Errno(0x36) EDEADLK = syscall.Errno(0xb) EDESTADDRREQ = syscall.Errno(0x27) EDEVERR = syscall.Errno(0x53) EDOM = syscall.Errno(0x21) EDQUOT = syscall.Errno(0x45) EEXIST = syscall.Errno(0x11) EFAULT = syscall.Errno(0xe) EFBIG = syscall.Errno(0x1b) EFTYPE = syscall.Errno(0x4f) EHOSTDOWN = syscall.Errno(0x40) EHOSTUNREACH = syscall.Errno(0x41) EIDRM = syscall.Errno(0x5a) EILSEQ = syscall.Errno(0x5c) EINPROGRESS = syscall.Errno(0x24) EINTR = syscall.Errno(0x4) EINVAL = syscall.Errno(0x16) EIO = syscall.Errno(0x5) EISCONN = syscall.Errno(0x38) EISDIR = syscall.Errno(0x15) ELAST = syscall.Errno(0x6a) ELOOP = syscall.Errno(0x3e) EMFILE = syscall.Errno(0x18) EMLINK = syscall.Errno(0x1f) EMSGSIZE = syscall.Errno(0x28) EMULTIHOP = syscall.Errno(0x5f) ENAMETOOLONG = syscall.Errno(0x3f) ENEEDAUTH = syscall.Errno(0x51) ENETDOWN = syscall.Errno(0x32) ENETRESET = syscall.Errno(0x34) ENETUNREACH = syscall.Errno(0x33) ENFILE = syscall.Errno(0x17) ENOATTR = syscall.Errno(0x5d) ENOBUFS = syscall.Errno(0x37) ENODATA = syscall.Errno(0x60) ENODEV = syscall.Errno(0x13) ENOENT = syscall.Errno(0x2) ENOEXEC = syscall.Errno(0x8) ENOLCK = syscall.Errno(0x4d) ENOLINK = syscall.Errno(0x61) ENOMEM = syscall.Errno(0xc) ENOMSG = syscall.Errno(0x5b) ENOPOLICY = syscall.Errno(0x67) ENOPROTOOPT = syscall.Errno(0x2a) ENOSPC = syscall.Errno(0x1c) ENOSR = syscall.Errno(0x62) ENOSTR = syscall.Errno(0x63) ENOSYS = syscall.Errno(0x4e) ENOTBLK = syscall.Errno(0xf) ENOTCONN = syscall.Errno(0x39) ENOTDIR = syscall.Errno(0x14) ENOTEMPTY = syscall.Errno(0x42) ENOTRECOVERABLE = syscall.Errno(0x68) ENOTSOCK = syscall.Errno(0x26) ENOTSUP = syscall.Errno(0x2d) ENOTTY = syscall.Errno(0x19) ENXIO = syscall.Errno(0x6) EOPNOTSUPP = syscall.Errno(0x66) EOVERFLOW = syscall.Errno(0x54) EOWNERDEAD = syscall.Errno(0x69) EPERM = syscall.Errno(0x1) EPFNOSUPPORT = syscall.Errno(0x2e) EPIPE = syscall.Errno(0x20) EPROCLIM = syscall.Errno(0x43) EPROCUNAVAIL = syscall.Errno(0x4c) EPROGMISMATCH = syscall.Errno(0x4b) EPROGUNAVAIL = syscall.Errno(0x4a) EPROTO = syscall.Errno(0x64) EPROTONOSUPPORT = syscall.Errno(0x2b) EPROTOTYPE = syscall.Errno(0x29) EPWROFF = syscall.Errno(0x52) EQFULL = syscall.Errno(0x6a) ERANGE = syscall.Errno(0x22) EREMOTE = syscall.Errno(0x47) EROFS = syscall.Errno(0x1e) ERPCMISMATCH = syscall.Errno(0x49) ESHLIBVERS = syscall.Errno(0x57) ESHUTDOWN = syscall.Errno(0x3a) ESOCKTNOSUPPORT = syscall.Errno(0x2c) ESPIPE = syscall.Errno(0x1d) ESRCH = syscall.Errno(0x3) ESTALE = syscall.Errno(0x46) ETIME = syscall.Errno(0x65) ETIMEDOUT = syscall.Errno(0x3c) ETOOMANYREFS = syscall.Errno(0x3b) ETXTBSY = syscall.Errno(0x1a) EUSERS = syscall.Errno(0x44) EWOULDBLOCK = syscall.Errno(0x23) EXDEV = syscall.Errno(0x12) ) // Signals const ( SIGABRT = syscall.Signal(0x6) SIGALRM = syscall.Signal(0xe) SIGBUS = syscall.Signal(0xa) SIGCHLD = syscall.Signal(0x14) SIGCONT = syscall.Signal(0x13) SIGEMT = syscall.Signal(0x7) SIGFPE = syscall.Signal(0x8) SIGHUP = syscall.Signal(0x1) SIGILL = syscall.Signal(0x4) SIGINFO = syscall.Signal(0x1d) SIGINT = syscall.Signal(0x2) SIGIO = syscall.Signal(0x17) SIGIOT = syscall.Signal(0x6) SIGKILL = syscall.Signal(0x9) SIGPIPE = syscall.Signal(0xd) SIGPROF = syscall.Signal(0x1b) SIGQUIT = syscall.Signal(0x3) SIGSEGV = syscall.Signal(0xb) SIGSTOP = syscall.Signal(0x11) SIGSYS = syscall.Signal(0xc) SIGTERM = syscall.Signal(0xf) SIGTRAP = syscall.Signal(0x5) SIGTSTP = syscall.Signal(0x12) SIGTTIN = syscall.Signal(0x15) SIGTTOU = syscall.Signal(0x16) SIGURG = syscall.Signal(0x10) SIGUSR1 = syscall.Signal(0x1e) SIGUSR2 = syscall.Signal(0x1f) SIGVTALRM = syscall.Signal(0x1a) SIGWINCH = syscall.Signal(0x1c) SIGXCPU = syscall.Signal(0x18) SIGXFSZ = syscall.Signal(0x19) ) // Error table var errorList = [...]struct { num syscall.Errno name string desc string }{ {1, "EPERM", "operation not permitted"}, {2, "ENOENT", "no such file or directory"}, {3, "ESRCH", "no such process"}, {4, "EINTR", "interrupted system call"}, {5, "EIO", "input/output error"}, {6, "ENXIO", "device not configured"}, {7, "E2BIG", "argument list too long"}, {8, "ENOEXEC", "exec format error"}, {9, "EBADF", "bad file descriptor"}, {10, "ECHILD", "no child processes"}, {11, "EDEADLK", "resource deadlock avoided"}, {12, "ENOMEM", "cannot allocate memory"}, {13, "EACCES", "permission denied"}, {14, "EFAULT", "bad address"}, {15, "ENOTBLK", "block device required"}, {16, "EBUSY", "resource busy"}, {17, "EEXIST", "file exists"}, {18, "EXDEV", "cross-device link"}, {19, "ENODEV", "operation not supported by device"}, {20, "ENOTDIR", "not a directory"}, {21, "EISDIR", "is a directory"}, {22, "EINVAL", "invalid argument"}, {23, "ENFILE", "too many open files in system"}, {24, "EMFILE", "too many open files"}, {25, "ENOTTY", "inappropriate ioctl for device"}, {26, "ETXTBSY", "text file busy"}, {27, "EFBIG", "file too large"}, {28, "ENOSPC", "no space left on device"}, {29, "ESPIPE", "illegal seek"}, {30, "EROFS", "read-only file system"}, {31, "EMLINK", "too many links"}, {32, "EPIPE", "broken pipe"}, {33, "EDOM", "numerical argument out of domain"}, {34, "ERANGE", "result too large"}, {35, "EAGAIN", "resource temporarily unavailable"}, {36, "EINPROGRESS", "operation now in progress"}, {37, "EALREADY", "operation already in progress"}, {38, "ENOTSOCK", "socket operation on non-socket"}, {39, "EDESTADDRREQ", "destination address required"}, {40, "EMSGSIZE", "message too long"}, {41, "EPROTOTYPE", "protocol wrong type for socket"}, {42, "ENOPROTOOPT", "protocol not available"}, {43, "EPROTONOSUPPORT", "protocol not supported"}, {44, "ESOCKTNOSUPPORT", "socket type not supported"}, {45, "ENOTSUP", "operation not supported"}, {46, "EPFNOSUPPORT", "protocol family not supported"}, {47, "EAFNOSUPPORT", "address family not supported by protocol family"}, {48, "EADDRINUSE", "address already in use"}, {49, "EADDRNOTAVAIL", "can't assign requested address"}, {50, "ENETDOWN", "network is down"}, {51, "ENETUNREACH", "network is unreachable"}, {52, "ENETRESET", "network dropped connection on reset"}, {53, "ECONNABORTED", "software caused connection abort"}, {54, "ECONNRESET", "connection reset by peer"}, {55, "ENOBUFS", "no buffer space available"}, {56, "EISCONN", "socket is already connected"}, {57, "ENOTCONN", "socket is not connected"}, {58, "ESHUTDOWN", "can't send after socket shutdown"}, {59, "ETOOMANYREFS", "too many references: can't splice"}, {60, "ETIMEDOUT", "operation timed out"}, {61, "ECONNREFUSED", "connection refused"}, {62, "ELOOP", "too many levels of symbolic links"}, {63, "ENAMETOOLONG", "file name too long"}, {64, "EHOSTDOWN", "host is down"}, {65, "EHOSTUNREACH", "no route to host"}, {66, "ENOTEMPTY", "directory not empty"}, {67, "EPROCLIM", "too many processes"}, {68, "EUSERS", "too many users"}, {69, "EDQUOT", "disc quota exceeded"}, {70, "ESTALE", "stale NFS file handle"}, {71, "EREMOTE", "too many levels of remote in path"}, {72, "EBADRPC", "RPC struct is bad"}, {73, "ERPCMISMATCH", "RPC version wrong"}, {74, "EPROGUNAVAIL", "RPC prog. not avail"}, {75, "EPROGMISMATCH", "program version wrong"}, {76, "EPROCUNAVAIL", "bad procedure for program"}, {77, "ENOLCK", "no locks available"}, {78, "ENOSYS", "function not implemented"}, {79, "EFTYPE", "inappropriate file type or format"}, {80, "EAUTH", "authentication error"}, {81, "ENEEDAUTH", "need authenticator"}, {82, "EPWROFF", "device power is off"}, {83, "EDEVERR", "device error"}, {84, "EOVERFLOW", "value too large to be stored in data type"}, {85, "EBADEXEC", "bad executable (or shared library)"}, {86, "EBADARCH", "bad CPU type in executable"}, {87, "ESHLIBVERS", "shared library version mismatch"}, {88, "EBADMACHO", "malformed Mach-o file"}, {89, "ECANCELED", "operation canceled"}, {90, "EIDRM", "identifier removed"}, {91, "ENOMSG", "no message of desired type"}, {92, "EILSEQ", "illegal byte sequence"}, {93, "ENOATTR", "attribute not found"}, {94, "EBADMSG", "bad message"}, {95, "EMULTIHOP", "EMULTIHOP (Reserved)"}, {96, "ENODATA", "no message available on STREAM"}, {97, "ENOLINK", "ENOLINK (Reserved)"}, {98, "ENOSR", "no STREAM resources"}, {99, "ENOSTR", "not a STREAM"}, {100, "EPROTO", "protocol error"}, {101, "ETIME", "STREAM ioctl timeout"}, {102, "EOPNOTSUPP", "operation not supported on socket"}, {103, "ENOPOLICY", "policy not found"}, {104, "ENOTRECOVERABLE", "state not recoverable"}, {105, "EOWNERDEAD", "previous owner died"}, {106, "EQFULL", "interface output queue is full"}, } // Signal table var signalList = [...]struct { num syscall.Signal name string desc string }{ {1, "SIGHUP", "hangup"}, {2, "SIGINT", "interrupt"}, {3, "SIGQUIT", "quit"}, {4, "SIGILL", "illegal instruction"}, {5, "SIGTRAP", "trace/BPT trap"}, {6, "SIGABRT", "abort trap"}, {7, "SIGEMT", "EMT trap"}, {8, "SIGFPE", "floating point exception"}, {9, "SIGKILL", "killed"}, {10, "SIGBUS", "bus error"}, {11, "SIGSEGV", "segmentation fault"}, {12, "SIGSYS", "bad system call"}, {13, "SIGPIPE", "broken pipe"}, {14, "SIGALRM", "alarm clock"}, {15, "SIGTERM", "terminated"}, {16, "SIGURG", "urgent I/O condition"}, {17, "SIGSTOP", "suspended (signal)"}, {18, "SIGTSTP", "suspended"}, {19, "SIGCONT", "continued"}, {20, "SIGCHLD", "child exited"}, {21, "SIGTTIN", "stopped (tty input)"}, {22, "SIGTTOU", "stopped (tty output)"}, {23, "SIGIO", "I/O possible"}, {24, "SIGXCPU", "cputime limit exceeded"}, {25, "SIGXFSZ", "filesize limit exceeded"}, {26, "SIGVTALRM", "virtual timer expired"}, {27, "SIGPROF", "profiling timer expired"}, {28, "SIGWINCH", "window size changes"}, {29, "SIGINFO", "information request"}, {30, "SIGUSR1", "user defined signal 1"}, {31, "SIGUSR2", "user defined signal 2"}, } ================================================ FILE: vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go ================================================ // mkerrors.sh -m64 // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm64 && darwin // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -m64 _const.go package unix import "syscall" const ( AF_APPLETALK = 0x10 AF_CCITT = 0xa AF_CHAOS = 0x5 AF_CNT = 0x15 AF_COIP = 0x14 AF_DATAKIT = 0x9 AF_DECnet = 0xc AF_DLI = 0xd AF_E164 = 0x1c AF_ECMA = 0x8 AF_HYLINK = 0xf AF_IEEE80211 = 0x25 AF_IMPLINK = 0x3 AF_INET = 0x2 AF_INET6 = 0x1e AF_IPX = 0x17 AF_ISDN = 0x1c AF_ISO = 0x7 AF_LAT = 0xe AF_LINK = 0x12 AF_LOCAL = 0x1 AF_MAX = 0x29 AF_NATM = 0x1f AF_NDRV = 0x1b AF_NETBIOS = 0x21 AF_NS = 0x6 AF_OSI = 0x7 AF_PPP = 0x22 AF_PUP = 0x4 AF_RESERVED_36 = 0x24 AF_ROUTE = 0x11 AF_SIP = 0x18 AF_SNA = 0xb AF_SYSTEM = 0x20 AF_SYS_CONTROL = 0x2 AF_UNIX = 0x1 AF_UNSPEC = 0x0 AF_UTUN = 0x26 AF_VSOCK = 0x28 ALTWERASE = 0x200 ATTR_BIT_MAP_COUNT = 0x5 ATTR_CMN_ACCESSMASK = 0x20000 ATTR_CMN_ACCTIME = 0x1000 ATTR_CMN_ADDEDTIME = 0x10000000 ATTR_CMN_BKUPTIME = 0x2000 ATTR_CMN_CHGTIME = 0x800 ATTR_CMN_CRTIME = 0x200 ATTR_CMN_DATA_PROTECT_FLAGS = 0x40000000 ATTR_CMN_DEVID = 0x2 ATTR_CMN_DOCUMENT_ID = 0x100000 ATTR_CMN_ERROR = 0x20000000 ATTR_CMN_EXTENDED_SECURITY = 0x400000 ATTR_CMN_FILEID = 0x2000000 ATTR_CMN_FLAGS = 0x40000 ATTR_CMN_FNDRINFO = 0x4000 ATTR_CMN_FSID = 0x4 ATTR_CMN_FULLPATH = 0x8000000 ATTR_CMN_GEN_COUNT = 0x80000 ATTR_CMN_GRPID = 0x10000 ATTR_CMN_GRPUUID = 0x1000000 ATTR_CMN_MODTIME = 0x400 ATTR_CMN_NAME = 0x1 ATTR_CMN_NAMEDATTRCOUNT = 0x80000 ATTR_CMN_NAMEDATTRLIST = 0x100000 ATTR_CMN_OBJID = 0x20 ATTR_CMN_OBJPERMANENTID = 0x40 ATTR_CMN_OBJTAG = 0x10 ATTR_CMN_OBJTYPE = 0x8 ATTR_CMN_OWNERID = 0x8000 ATTR_CMN_PARENTID = 0x4000000 ATTR_CMN_PAROBJID = 0x80 ATTR_CMN_RETURNED_ATTRS = 0x80000000 ATTR_CMN_SCRIPT = 0x100 ATTR_CMN_SETMASK = 0x51c7ff00 ATTR_CMN_USERACCESS = 0x200000 ATTR_CMN_UUID = 0x800000 ATTR_CMN_VALIDMASK = 0xffffffff ATTR_CMN_VOLSETMASK = 0x6700 ATTR_FILE_ALLOCSIZE = 0x4 ATTR_FILE_CLUMPSIZE = 0x10 ATTR_FILE_DATAALLOCSIZE = 0x400 ATTR_FILE_DATAEXTENTS = 0x800 ATTR_FILE_DATALENGTH = 0x200 ATTR_FILE_DEVTYPE = 0x20 ATTR_FILE_FILETYPE = 0x40 ATTR_FILE_FORKCOUNT = 0x80 ATTR_FILE_FORKLIST = 0x100 ATTR_FILE_IOBLOCKSIZE = 0x8 ATTR_FILE_LINKCOUNT = 0x1 ATTR_FILE_RSRCALLOCSIZE = 0x2000 ATTR_FILE_RSRCEXTENTS = 0x4000 ATTR_FILE_RSRCLENGTH = 0x1000 ATTR_FILE_SETMASK = 0x20 ATTR_FILE_TOTALSIZE = 0x2 ATTR_FILE_VALIDMASK = 0x37ff ATTR_VOL_ALLOCATIONCLUMP = 0x40 ATTR_VOL_ATTRIBUTES = 0x40000000 ATTR_VOL_CAPABILITIES = 0x20000 ATTR_VOL_DIRCOUNT = 0x400 ATTR_VOL_ENCODINGSUSED = 0x10000 ATTR_VOL_FILECOUNT = 0x200 ATTR_VOL_FSTYPE = 0x1 ATTR_VOL_INFO = 0x80000000 ATTR_VOL_IOBLOCKSIZE = 0x80 ATTR_VOL_MAXOBJCOUNT = 0x800 ATTR_VOL_MINALLOCATION = 0x20 ATTR_VOL_MOUNTEDDEVICE = 0x8000 ATTR_VOL_MOUNTFLAGS = 0x4000 ATTR_VOL_MOUNTPOINT = 0x1000 ATTR_VOL_NAME = 0x2000 ATTR_VOL_OBJCOUNT = 0x100 ATTR_VOL_QUOTA_SIZE = 0x10000000 ATTR_VOL_RESERVED_SIZE = 0x20000000 ATTR_VOL_SETMASK = 0x80002000 ATTR_VOL_SIGNATURE = 0x2 ATTR_VOL_SIZE = 0x4 ATTR_VOL_SPACEAVAIL = 0x10 ATTR_VOL_SPACEFREE = 0x8 ATTR_VOL_SPACEUSED = 0x800000 ATTR_VOL_UUID = 0x40000 ATTR_VOL_VALIDMASK = 0xf087ffff B0 = 0x0 B110 = 0x6e B115200 = 0x1c200 B1200 = 0x4b0 B134 = 0x86 B14400 = 0x3840 B150 = 0x96 B1800 = 0x708 B19200 = 0x4b00 B200 = 0xc8 B230400 = 0x38400 B2400 = 0x960 B28800 = 0x7080 B300 = 0x12c B38400 = 0x9600 B4800 = 0x12c0 B50 = 0x32 B57600 = 0xe100 B600 = 0x258 B7200 = 0x1c20 B75 = 0x4b B76800 = 0x12c00 B9600 = 0x2580 BIOCFLUSH = 0x20004268 BIOCGBLEN = 0x40044266 BIOCGDLT = 0x4004426a BIOCGDLTLIST = 0xc00c4279 BIOCGETIF = 0x4020426b BIOCGHDRCMPLT = 0x40044274 BIOCGRSIG = 0x40044272 BIOCGRTIMEOUT = 0x4010426e BIOCGSEESENT = 0x40044276 BIOCGSTATS = 0x4008426f BIOCIMMEDIATE = 0x80044270 BIOCPROMISC = 0x20004269 BIOCSBLEN = 0xc0044266 BIOCSDLT = 0x80044278 BIOCSETF = 0x80104267 BIOCSETFNR = 0x8010427e BIOCSETIF = 0x8020426c BIOCSHDRCMPLT = 0x80044275 BIOCSRSIG = 0x80044273 BIOCSRTIMEOUT = 0x8010426d BIOCSSEESENT = 0x80044277 BIOCVERSION = 0x40044271 BPF_A = 0x10 BPF_ABS = 0x20 BPF_ADD = 0x0 BPF_ALIGNMENT = 0x4 BPF_ALU = 0x4 BPF_AND = 0x50 BPF_B = 0x10 BPF_DIV = 0x30 BPF_H = 0x8 BPF_IMM = 0x0 BPF_IND = 0x40 BPF_JA = 0x0 BPF_JEQ = 0x10 BPF_JGE = 0x30 BPF_JGT = 0x20 BPF_JMP = 0x5 BPF_JSET = 0x40 BPF_K = 0x0 BPF_LD = 0x0 BPF_LDX = 0x1 BPF_LEN = 0x80 BPF_LSH = 0x60 BPF_MAJOR_VERSION = 0x1 BPF_MAXBUFSIZE = 0x80000 BPF_MAXINSNS = 0x200 BPF_MEM = 0x60 BPF_MEMWORDS = 0x10 BPF_MINBUFSIZE = 0x20 BPF_MINOR_VERSION = 0x1 BPF_MISC = 0x7 BPF_MSH = 0xa0 BPF_MUL = 0x20 BPF_NEG = 0x80 BPF_OR = 0x40 BPF_RELEASE = 0x30bb6 BPF_RET = 0x6 BPF_RSH = 0x70 BPF_ST = 0x2 BPF_STX = 0x3 BPF_SUB = 0x10 BPF_TAX = 0x0 BPF_TXA = 0x80 BPF_W = 0x0 BPF_X = 0x8 BRKINT = 0x2 BS0 = 0x0 BS1 = 0x8000 BSDLY = 0x8000 CFLUSH = 0xf CLOCAL = 0x8000 CLOCK_MONOTONIC = 0x6 CLOCK_MONOTONIC_RAW = 0x4 CLOCK_MONOTONIC_RAW_APPROX = 0x5 CLOCK_PROCESS_CPUTIME_ID = 0xc CLOCK_REALTIME = 0x0 CLOCK_THREAD_CPUTIME_ID = 0x10 CLOCK_UPTIME_RAW = 0x8 CLOCK_UPTIME_RAW_APPROX = 0x9 CLONE_NOFOLLOW = 0x1 CLONE_NOOWNERCOPY = 0x2 CONNECT_DATA_AUTHENTICATED = 0x4 CONNECT_DATA_IDEMPOTENT = 0x2 CONNECT_RESUME_ON_READ_WRITE = 0x1 CR0 = 0x0 CR1 = 0x1000 CR2 = 0x2000 CR3 = 0x3000 CRDLY = 0x3000 CREAD = 0x800 CRTSCTS = 0x30000 CS5 = 0x0 CS6 = 0x100 CS7 = 0x200 CS8 = 0x300 CSIZE = 0x300 CSTART = 0x11 CSTATUS = 0x14 CSTOP = 0x13 CSTOPB = 0x400 CSUSP = 0x1a CTLIOCGINFO = 0xc0644e03 CTL_HW = 0x6 CTL_KERN = 0x1 CTL_MAXNAME = 0xc CTL_NET = 0x4 DLT_A429 = 0xb8 DLT_A653_ICM = 0xb9 DLT_AIRONET_HEADER = 0x78 DLT_AOS = 0xde DLT_APPLE_IP_OVER_IEEE1394 = 0x8a DLT_ARCNET = 0x7 DLT_ARCNET_LINUX = 0x81 DLT_ATM_CLIP = 0x13 DLT_ATM_RFC1483 = 0xb DLT_AURORA = 0x7e DLT_AX25 = 0x3 DLT_AX25_KISS = 0xca DLT_BACNET_MS_TP = 0xa5 DLT_BLUETOOTH_HCI_H4 = 0xbb DLT_BLUETOOTH_HCI_H4_WITH_PHDR = 0xc9 DLT_CAN20B = 0xbe DLT_CAN_SOCKETCAN = 0xe3 DLT_CHAOS = 0x5 DLT_CHDLC = 0x68 DLT_CISCO_IOS = 0x76 DLT_C_HDLC = 0x68 DLT_C_HDLC_WITH_DIR = 0xcd DLT_DBUS = 0xe7 DLT_DECT = 0xdd DLT_DOCSIS = 0x8f DLT_DVB_CI = 0xeb DLT_ECONET = 0x73 DLT_EN10MB = 0x1 DLT_EN3MB = 0x2 DLT_ENC = 0x6d DLT_ERF = 0xc5 DLT_ERF_ETH = 0xaf DLT_ERF_POS = 0xb0 DLT_FC_2 = 0xe0 DLT_FC_2_WITH_FRAME_DELIMS = 0xe1 DLT_FDDI = 0xa DLT_FLEXRAY = 0xd2 DLT_FRELAY = 0x6b DLT_FRELAY_WITH_DIR = 0xce DLT_GCOM_SERIAL = 0xad DLT_GCOM_T1E1 = 0xac DLT_GPF_F = 0xab DLT_GPF_T = 0xaa DLT_GPRS_LLC = 0xa9 DLT_GSMTAP_ABIS = 0xda DLT_GSMTAP_UM = 0xd9 DLT_HHDLC = 0x79 DLT_IBM_SN = 0x92 DLT_IBM_SP = 0x91 DLT_IEEE802 = 0x6 DLT_IEEE802_11 = 0x69 DLT_IEEE802_11_RADIO = 0x7f DLT_IEEE802_11_RADIO_AVS = 0xa3 DLT_IEEE802_15_4 = 0xc3 DLT_IEEE802_15_4_LINUX = 0xbf DLT_IEEE802_15_4_NOFCS = 0xe6 DLT_IEEE802_15_4_NONASK_PHY = 0xd7 DLT_IEEE802_16_MAC_CPS = 0xbc DLT_IEEE802_16_MAC_CPS_RADIO = 0xc1 DLT_IPFILTER = 0x74 DLT_IPMB = 0xc7 DLT_IPMB_LINUX = 0xd1 DLT_IPNET = 0xe2 DLT_IPOIB = 0xf2 DLT_IPV4 = 0xe4 DLT_IPV6 = 0xe5 DLT_IP_OVER_FC = 0x7a DLT_JUNIPER_ATM1 = 0x89 DLT_JUNIPER_ATM2 = 0x87 DLT_JUNIPER_ATM_CEMIC = 0xee DLT_JUNIPER_CHDLC = 0xb5 DLT_JUNIPER_ES = 0x84 DLT_JUNIPER_ETHER = 0xb2 DLT_JUNIPER_FIBRECHANNEL = 0xea DLT_JUNIPER_FRELAY = 0xb4 DLT_JUNIPER_GGSN = 0x85 DLT_JUNIPER_ISM = 0xc2 DLT_JUNIPER_MFR = 0x86 DLT_JUNIPER_MLFR = 0x83 DLT_JUNIPER_MLPPP = 0x82 DLT_JUNIPER_MONITOR = 0xa4 DLT_JUNIPER_PIC_PEER = 0xae DLT_JUNIPER_PPP = 0xb3 DLT_JUNIPER_PPPOE = 0xa7 DLT_JUNIPER_PPPOE_ATM = 0xa8 DLT_JUNIPER_SERVICES = 0x88 DLT_JUNIPER_SRX_E2E = 0xe9 DLT_JUNIPER_ST = 0xc8 DLT_JUNIPER_VP = 0xb7 DLT_JUNIPER_VS = 0xe8 DLT_LAPB_WITH_DIR = 0xcf DLT_LAPD = 0xcb DLT_LIN = 0xd4 DLT_LINUX_EVDEV = 0xd8 DLT_LINUX_IRDA = 0x90 DLT_LINUX_LAPD = 0xb1 DLT_LINUX_PPP_WITHDIRECTION = 0xa6 DLT_LINUX_SLL = 0x71 DLT_LOOP = 0x6c DLT_LTALK = 0x72 DLT_MATCHING_MAX = 0x10a DLT_MATCHING_MIN = 0x68 DLT_MFR = 0xb6 DLT_MOST = 0xd3 DLT_MPEG_2_TS = 0xf3 DLT_MPLS = 0xdb DLT_MTP2 = 0x8c DLT_MTP2_WITH_PHDR = 0x8b DLT_MTP3 = 0x8d DLT_MUX27010 = 0xec DLT_NETANALYZER = 0xf0 DLT_NETANALYZER_TRANSPARENT = 0xf1 DLT_NFC_LLCP = 0xf5 DLT_NFLOG = 0xef DLT_NG40 = 0xf4 DLT_NULL = 0x0 DLT_PCI_EXP = 0x7d DLT_PFLOG = 0x75 DLT_PFSYNC = 0x12 DLT_PPI = 0xc0 DLT_PPP = 0x9 DLT_PPP_BSDOS = 0x10 DLT_PPP_ETHER = 0x33 DLT_PPP_PPPD = 0xa6 DLT_PPP_SERIAL = 0x32 DLT_PPP_WITH_DIR = 0xcc DLT_PPP_WITH_DIRECTION = 0xa6 DLT_PRISM_HEADER = 0x77 DLT_PRONET = 0x4 DLT_RAIF1 = 0xc6 DLT_RAW = 0xc DLT_RIO = 0x7c DLT_SCCP = 0x8e DLT_SITA = 0xc4 DLT_SLIP = 0x8 DLT_SLIP_BSDOS = 0xf DLT_STANAG_5066_D_PDU = 0xed DLT_SUNATM = 0x7b DLT_SYMANTEC_FIREWALL = 0x63 DLT_TZSP = 0x80 DLT_USB = 0xba DLT_USB_DARWIN = 0x10a DLT_USB_LINUX = 0xbd DLT_USB_LINUX_MMAPPED = 0xdc DLT_USER0 = 0x93 DLT_USER1 = 0x94 DLT_USER10 = 0x9d DLT_USER11 = 0x9e DLT_USER12 = 0x9f DLT_USER13 = 0xa0 DLT_USER14 = 0xa1 DLT_USER15 = 0xa2 DLT_USER2 = 0x95 DLT_USER3 = 0x96 DLT_USER4 = 0x97 DLT_USER5 = 0x98 DLT_USER6 = 0x99 DLT_USER7 = 0x9a DLT_USER8 = 0x9b DLT_USER9 = 0x9c DLT_WIHART = 0xdf DLT_X2E_SERIAL = 0xd5 DLT_X2E_XORAYA = 0xd6 DT_BLK = 0x6 DT_CHR = 0x2 DT_DIR = 0x4 DT_FIFO = 0x1 DT_LNK = 0xa DT_REG = 0x8 DT_SOCK = 0xc DT_UNKNOWN = 0x0 DT_WHT = 0xe ECHO = 0x8 ECHOCTL = 0x40 ECHOE = 0x2 ECHOK = 0x4 ECHOKE = 0x1 ECHONL = 0x10 ECHOPRT = 0x20 EVFILT_AIO = -0x3 EVFILT_EXCEPT = -0xf EVFILT_FS = -0x9 EVFILT_MACHPORT = -0x8 EVFILT_PROC = -0x5 EVFILT_READ = -0x1 EVFILT_SIGNAL = -0x6 EVFILT_SYSCOUNT = 0x11 EVFILT_THREADMARKER = 0x11 EVFILT_TIMER = -0x7 EVFILT_USER = -0xa EVFILT_VM = -0xc EVFILT_VNODE = -0x4 EVFILT_WRITE = -0x2 EV_ADD = 0x1 EV_CLEAR = 0x20 EV_DELETE = 0x2 EV_DISABLE = 0x8 EV_DISPATCH = 0x80 EV_DISPATCH2 = 0x180 EV_ENABLE = 0x4 EV_EOF = 0x8000 EV_ERROR = 0x4000 EV_FLAG0 = 0x1000 EV_FLAG1 = 0x2000 EV_ONESHOT = 0x10 EV_OOBAND = 0x2000 EV_POLL = 0x1000 EV_RECEIPT = 0x40 EV_SYSFLAGS = 0xf000 EV_UDATA_SPECIFIC = 0x100 EV_VANISHED = 0x200 EXTA = 0x4b00 EXTB = 0x9600 EXTPROC = 0x800 FD_CLOEXEC = 0x1 FD_SETSIZE = 0x400 FF0 = 0x0 FF1 = 0x4000 FFDLY = 0x4000 FLUSHO = 0x800000 FSOPT_ATTR_CMN_EXTENDED = 0x20 FSOPT_NOFOLLOW = 0x1 FSOPT_NOINMEMUPDATE = 0x2 FSOPT_PACK_INVAL_ATTRS = 0x8 FSOPT_REPORT_FULLSIZE = 0x4 FSOPT_RETURN_REALDEV = 0x200 F_ADDFILESIGS = 0x3d F_ADDFILESIGS_FOR_DYLD_SIM = 0x53 F_ADDFILESIGS_INFO = 0x67 F_ADDFILESIGS_RETURN = 0x61 F_ADDFILESUPPL = 0x68 F_ADDSIGS = 0x3b F_ALLOCATEALL = 0x4 F_ALLOCATECONTIG = 0x2 F_BARRIERFSYNC = 0x55 F_CHECK_LV = 0x62 F_CHKCLEAN = 0x29 F_DUPFD = 0x0 F_DUPFD_CLOEXEC = 0x43 F_FINDSIGS = 0x4e F_FLUSH_DATA = 0x28 F_FREEZE_FS = 0x35 F_FULLFSYNC = 0x33 F_GETCODEDIR = 0x48 F_GETFD = 0x1 F_GETFL = 0x3 F_GETLK = 0x7 F_GETLKPID = 0x42 F_GETNOSIGPIPE = 0x4a F_GETOWN = 0x5 F_GETPATH = 0x32 F_GETPATH_MTMINFO = 0x47 F_GETPATH_NOFIRMLINK = 0x66 F_GETPROTECTIONCLASS = 0x3f F_GETPROTECTIONLEVEL = 0x4d F_GETSIGSINFO = 0x69 F_GLOBAL_NOCACHE = 0x37 F_LOG2PHYS = 0x31 F_LOG2PHYS_EXT = 0x41 F_NOCACHE = 0x30 F_NODIRECT = 0x3e F_OK = 0x0 F_PATHPKG_CHECK = 0x34 F_PEOFPOSMODE = 0x3 F_PREALLOCATE = 0x2a F_PUNCHHOLE = 0x63 F_RDADVISE = 0x2c F_RDAHEAD = 0x2d F_RDLCK = 0x1 F_SETBACKINGSTORE = 0x46 F_SETFD = 0x2 F_SETFL = 0x4 F_SETLK = 0x8 F_SETLKW = 0x9 F_SETLKWTIMEOUT = 0xa F_SETNOSIGPIPE = 0x49 F_SETOWN = 0x6 F_SETPROTECTIONCLASS = 0x40 F_SETSIZE = 0x2b F_SINGLE_WRITER = 0x4c F_SPECULATIVE_READ = 0x65 F_THAW_FS = 0x36 F_TRANSCODEKEY = 0x4b F_TRIM_ACTIVE_FILE = 0x64 F_UNLCK = 0x2 F_VOLPOSMODE = 0x4 F_WRLCK = 0x3 HUPCL = 0x4000 HW_MACHINE = 0x1 ICANON = 0x100 ICMP6_FILTER = 0x12 ICRNL = 0x100 IEXTEN = 0x400 IFF_ALLMULTI = 0x200 IFF_ALTPHYS = 0x4000 IFF_BROADCAST = 0x2 IFF_DEBUG = 0x4 IFF_LINK0 = 0x1000 IFF_LINK1 = 0x2000 IFF_LINK2 = 0x4000 IFF_LOOPBACK = 0x8 IFF_MULTICAST = 0x8000 IFF_NOARP = 0x80 IFF_NOTRAILERS = 0x20 IFF_OACTIVE = 0x400 IFF_POINTOPOINT = 0x10 IFF_PROMISC = 0x100 IFF_RUNNING = 0x40 IFF_SIMPLEX = 0x800 IFF_UP = 0x1 IFNAMSIZ = 0x10 IFT_1822 = 0x2 IFT_6LOWPAN = 0x40 IFT_AAL5 = 0x31 IFT_ARCNET = 0x23 IFT_ARCNETPLUS = 0x24 IFT_ATM = 0x25 IFT_BRIDGE = 0xd1 IFT_CARP = 0xf8 IFT_CELLULAR = 0xff IFT_CEPT = 0x13 IFT_DS3 = 0x1e IFT_ENC = 0xf4 IFT_EON = 0x19 IFT_ETHER = 0x6 IFT_FAITH = 0x38 IFT_FDDI = 0xf IFT_FRELAY = 0x20 IFT_FRELAYDCE = 0x2c IFT_GIF = 0x37 IFT_HDH1822 = 0x3 IFT_HIPPI = 0x2f IFT_HSSI = 0x2e IFT_HY = 0xe IFT_IEEE1394 = 0x90 IFT_IEEE8023ADLAG = 0x88 IFT_ISDNBASIC = 0x14 IFT_ISDNPRIMARY = 0x15 IFT_ISO88022LLC = 0x29 IFT_ISO88023 = 0x7 IFT_ISO88024 = 0x8 IFT_ISO88025 = 0x9 IFT_ISO88026 = 0xa IFT_L2VLAN = 0x87 IFT_LAPB = 0x10 IFT_LOCALTALK = 0x2a IFT_LOOP = 0x18 IFT_MIOX25 = 0x26 IFT_MODEM = 0x30 IFT_NSIP = 0x1b IFT_OTHER = 0x1 IFT_P10 = 0xc IFT_P80 = 0xd IFT_PARA = 0x22 IFT_PDP = 0xff IFT_PFLOG = 0xf5 IFT_PFSYNC = 0xf6 IFT_PKTAP = 0xfe IFT_PPP = 0x17 IFT_PROPMUX = 0x36 IFT_PROPVIRTUAL = 0x35 IFT_PTPSERIAL = 0x16 IFT_RS232 = 0x21 IFT_SDLC = 0x11 IFT_SIP = 0x1f IFT_SLIP = 0x1c IFT_SMDSDXI = 0x2b IFT_SMDSICIP = 0x34 IFT_SONET = 0x27 IFT_SONETPATH = 0x32 IFT_SONETVT = 0x33 IFT_STARLAN = 0xb IFT_STF = 0x39 IFT_T1 = 0x12 IFT_ULTRA = 0x1d IFT_V35 = 0x2d IFT_X25 = 0x5 IFT_X25DDN = 0x4 IFT_X25PLE = 0x28 IFT_XETHER = 0x1a IGNBRK = 0x1 IGNCR = 0x80 IGNPAR = 0x4 IMAXBEL = 0x2000 INLCR = 0x40 INPCK = 0x10 IN_CLASSA_HOST = 0xffffff IN_CLASSA_MAX = 0x80 IN_CLASSA_NET = 0xff000000 IN_CLASSA_NSHIFT = 0x18 IN_CLASSB_HOST = 0xffff IN_CLASSB_MAX = 0x10000 IN_CLASSB_NET = 0xffff0000 IN_CLASSB_NSHIFT = 0x10 IN_CLASSC_HOST = 0xff IN_CLASSC_NET = 0xffffff00 IN_CLASSC_NSHIFT = 0x8 IN_CLASSD_HOST = 0xfffffff IN_CLASSD_NET = 0xf0000000 IN_CLASSD_NSHIFT = 0x1c IN_LINKLOCALNETNUM = 0xa9fe0000 IN_LOOPBACKNET = 0x7f IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x400473d1 IPPROTO_3PC = 0x22 IPPROTO_ADFS = 0x44 IPPROTO_AH = 0x33 IPPROTO_AHIP = 0x3d IPPROTO_APES = 0x63 IPPROTO_ARGUS = 0xd IPPROTO_AX25 = 0x5d IPPROTO_BHA = 0x31 IPPROTO_BLT = 0x1e IPPROTO_BRSATMON = 0x4c IPPROTO_CFTP = 0x3e IPPROTO_CHAOS = 0x10 IPPROTO_CMTP = 0x26 IPPROTO_CPHB = 0x49 IPPROTO_CPNX = 0x48 IPPROTO_DDP = 0x25 IPPROTO_DGP = 0x56 IPPROTO_DIVERT = 0xfe IPPROTO_DONE = 0x101 IPPROTO_DSTOPTS = 0x3c IPPROTO_EGP = 0x8 IPPROTO_EMCON = 0xe IPPROTO_ENCAP = 0x62 IPPROTO_EON = 0x50 IPPROTO_ESP = 0x32 IPPROTO_ETHERIP = 0x61 IPPROTO_FRAGMENT = 0x2c IPPROTO_GGP = 0x3 IPPROTO_GMTP = 0x64 IPPROTO_GRE = 0x2f IPPROTO_HELLO = 0x3f IPPROTO_HMP = 0x14 IPPROTO_HOPOPTS = 0x0 IPPROTO_ICMP = 0x1 IPPROTO_ICMPV6 = 0x3a IPPROTO_IDP = 0x16 IPPROTO_IDPR = 0x23 IPPROTO_IDRP = 0x2d IPPROTO_IGMP = 0x2 IPPROTO_IGP = 0x55 IPPROTO_IGRP = 0x58 IPPROTO_IL = 0x28 IPPROTO_INLSP = 0x34 IPPROTO_INP = 0x20 IPPROTO_IP = 0x0 IPPROTO_IPCOMP = 0x6c IPPROTO_IPCV = 0x47 IPPROTO_IPEIP = 0x5e IPPROTO_IPIP = 0x4 IPPROTO_IPPC = 0x43 IPPROTO_IPV4 = 0x4 IPPROTO_IPV6 = 0x29 IPPROTO_IRTP = 0x1c IPPROTO_KRYPTOLAN = 0x41 IPPROTO_LARP = 0x5b IPPROTO_LEAF1 = 0x19 IPPROTO_LEAF2 = 0x1a IPPROTO_MAX = 0x100 IPPROTO_MAXID = 0x34 IPPROTO_MEAS = 0x13 IPPROTO_MHRP = 0x30 IPPROTO_MICP = 0x5f IPPROTO_MTP = 0x5c IPPROTO_MUX = 0x12 IPPROTO_ND = 0x4d IPPROTO_NHRP = 0x36 IPPROTO_NONE = 0x3b IPPROTO_NSP = 0x1f IPPROTO_NVPII = 0xb IPPROTO_OSPFIGP = 0x59 IPPROTO_PGM = 0x71 IPPROTO_PIGP = 0x9 IPPROTO_PIM = 0x67 IPPROTO_PRM = 0x15 IPPROTO_PUP = 0xc IPPROTO_PVP = 0x4b IPPROTO_RAW = 0xff IPPROTO_RCCMON = 0xa IPPROTO_RDP = 0x1b IPPROTO_ROUTING = 0x2b IPPROTO_RSVP = 0x2e IPPROTO_RVD = 0x42 IPPROTO_SATEXPAK = 0x40 IPPROTO_SATMON = 0x45 IPPROTO_SCCSP = 0x60 IPPROTO_SCTP = 0x84 IPPROTO_SDRP = 0x2a IPPROTO_SEP = 0x21 IPPROTO_SRPC = 0x5a IPPROTO_ST = 0x7 IPPROTO_SVMTP = 0x52 IPPROTO_SWIPE = 0x35 IPPROTO_TCF = 0x57 IPPROTO_TCP = 0x6 IPPROTO_TP = 0x1d IPPROTO_TPXX = 0x27 IPPROTO_TRUNK1 = 0x17 IPPROTO_TRUNK2 = 0x18 IPPROTO_TTP = 0x54 IPPROTO_UDP = 0x11 IPPROTO_VINES = 0x53 IPPROTO_VISA = 0x46 IPPROTO_VMTP = 0x51 IPPROTO_WBEXPAK = 0x4f IPPROTO_WBMON = 0x4e IPPROTO_WSN = 0x4a IPPROTO_XNET = 0xf IPPROTO_XTP = 0x24 IPV6_2292DSTOPTS = 0x17 IPV6_2292HOPLIMIT = 0x14 IPV6_2292HOPOPTS = 0x16 IPV6_2292NEXTHOP = 0x15 IPV6_2292PKTINFO = 0x13 IPV6_2292PKTOPTIONS = 0x19 IPV6_2292RTHDR = 0x18 IPV6_3542DSTOPTS = 0x32 IPV6_3542HOPLIMIT = 0x2f IPV6_3542HOPOPTS = 0x31 IPV6_3542NEXTHOP = 0x30 IPV6_3542PKTINFO = 0x2e IPV6_3542RTHDR = 0x33 IPV6_ADDR_MC_FLAGS_PREFIX = 0x20 IPV6_ADDR_MC_FLAGS_TRANSIENT = 0x10 IPV6_ADDR_MC_FLAGS_UNICAST_BASED = 0x30 IPV6_AUTOFLOWLABEL = 0x3b IPV6_BINDV6ONLY = 0x1b IPV6_BOUND_IF = 0x7d IPV6_CHECKSUM = 0x1a IPV6_DEFAULT_MULTICAST_HOPS = 0x1 IPV6_DEFAULT_MULTICAST_LOOP = 0x1 IPV6_DEFHLIM = 0x40 IPV6_DONTFRAG = 0x3e IPV6_DSTOPTS = 0x32 IPV6_FAITH = 0x1d IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_MASK = 0xffff0f00 IPV6_FLOW_ECN_MASK = 0x3000 IPV6_FRAGTTL = 0x3c IPV6_FW_ADD = 0x1e IPV6_FW_DEL = 0x1f IPV6_FW_FLUSH = 0x20 IPV6_FW_GET = 0x22 IPV6_FW_ZERO = 0x21 IPV6_HLIMDEC = 0x1 IPV6_HOPLIMIT = 0x2f IPV6_HOPOPTS = 0x31 IPV6_IPSEC_POLICY = 0x1c IPV6_JOIN_GROUP = 0xc IPV6_LEAVE_GROUP = 0xd IPV6_MAXHLIM = 0xff IPV6_MAXOPTHDR = 0x800 IPV6_MAXPACKET = 0xffff IPV6_MAX_GROUP_SRC_FILTER = 0x200 IPV6_MAX_MEMBERSHIPS = 0xfff IPV6_MAX_SOCK_SRC_FILTER = 0x80 IPV6_MIN_MEMBERSHIPS = 0x1f IPV6_MMTU = 0x500 IPV6_MSFILTER = 0x4a IPV6_MULTICAST_HOPS = 0xa IPV6_MULTICAST_IF = 0x9 IPV6_MULTICAST_LOOP = 0xb IPV6_NEXTHOP = 0x30 IPV6_PATHMTU = 0x2c IPV6_PKTINFO = 0x2e IPV6_PORTRANGE = 0xe IPV6_PORTRANGE_DEFAULT = 0x0 IPV6_PORTRANGE_HIGH = 0x1 IPV6_PORTRANGE_LOW = 0x2 IPV6_PREFER_TEMPADDR = 0x3f IPV6_RECVDSTOPTS = 0x28 IPV6_RECVHOPLIMIT = 0x25 IPV6_RECVHOPOPTS = 0x27 IPV6_RECVPATHMTU = 0x2b IPV6_RECVPKTINFO = 0x3d IPV6_RECVRTHDR = 0x26 IPV6_RECVTCLASS = 0x23 IPV6_RTHDR = 0x33 IPV6_RTHDRDSTOPTS = 0x39 IPV6_RTHDR_LOOSE = 0x0 IPV6_RTHDR_STRICT = 0x1 IPV6_RTHDR_TYPE_0 = 0x0 IPV6_SOCKOPT_RESERVED1 = 0x3 IPV6_TCLASS = 0x24 IPV6_UNICAST_HOPS = 0x4 IPV6_USE_MIN_MTU = 0x2a IPV6_V6ONLY = 0x1b IPV6_VERSION = 0x60 IPV6_VERSION_MASK = 0xf0 IP_ADD_MEMBERSHIP = 0xc IP_ADD_SOURCE_MEMBERSHIP = 0x46 IP_BLOCK_SOURCE = 0x48 IP_BOUND_IF = 0x19 IP_DEFAULT_MULTICAST_LOOP = 0x1 IP_DEFAULT_MULTICAST_TTL = 0x1 IP_DF = 0x4000 IP_DONTFRAG = 0x1c IP_DROP_MEMBERSHIP = 0xd IP_DROP_SOURCE_MEMBERSHIP = 0x47 IP_DUMMYNET_CONFIGURE = 0x3c IP_DUMMYNET_DEL = 0x3d IP_DUMMYNET_FLUSH = 0x3e IP_DUMMYNET_GET = 0x40 IP_FAITH = 0x16 IP_FW_ADD = 0x28 IP_FW_DEL = 0x29 IP_FW_FLUSH = 0x2a IP_FW_GET = 0x2c IP_FW_RESETLOG = 0x2d IP_FW_ZERO = 0x2b IP_HDRINCL = 0x2 IP_IPSEC_POLICY = 0x15 IP_MAXPACKET = 0xffff IP_MAX_GROUP_SRC_FILTER = 0x200 IP_MAX_MEMBERSHIPS = 0xfff IP_MAX_SOCK_MUTE_FILTER = 0x80 IP_MAX_SOCK_SRC_FILTER = 0x80 IP_MF = 0x2000 IP_MIN_MEMBERSHIPS = 0x1f IP_MSFILTER = 0x4a IP_MSS = 0x240 IP_MULTICAST_IF = 0x9 IP_MULTICAST_IFINDEX = 0x42 IP_MULTICAST_LOOP = 0xb IP_MULTICAST_TTL = 0xa IP_MULTICAST_VIF = 0xe IP_NAT__XXX = 0x37 IP_OFFMASK = 0x1fff IP_OLD_FW_ADD = 0x32 IP_OLD_FW_DEL = 0x33 IP_OLD_FW_FLUSH = 0x34 IP_OLD_FW_GET = 0x36 IP_OLD_FW_RESETLOG = 0x38 IP_OLD_FW_ZERO = 0x35 IP_OPTIONS = 0x1 IP_PKTINFO = 0x1a IP_PORTRANGE = 0x13 IP_PORTRANGE_DEFAULT = 0x0 IP_PORTRANGE_HIGH = 0x1 IP_PORTRANGE_LOW = 0x2 IP_RECVDSTADDR = 0x7 IP_RECVIF = 0x14 IP_RECVOPTS = 0x5 IP_RECVPKTINFO = 0x1a IP_RECVRETOPTS = 0x6 IP_RECVTOS = 0x1b IP_RECVTTL = 0x18 IP_RETOPTS = 0x8 IP_RF = 0x8000 IP_RSVP_OFF = 0x10 IP_RSVP_ON = 0xf IP_RSVP_VIF_OFF = 0x12 IP_RSVP_VIF_ON = 0x11 IP_STRIPHDR = 0x17 IP_TOS = 0x3 IP_TRAFFIC_MGT_BACKGROUND = 0x41 IP_TTL = 0x4 IP_UNBLOCK_SOURCE = 0x49 ISIG = 0x80 ISTRIP = 0x20 IUTF8 = 0x4000 IXANY = 0x800 IXOFF = 0x400 IXON = 0x200 KERN_HOSTNAME = 0xa KERN_OSRELEASE = 0x2 KERN_OSTYPE = 0x1 KERN_VERSION = 0x4 LOCAL_PEERCRED = 0x1 LOCAL_PEEREPID = 0x3 LOCAL_PEEREUUID = 0x5 LOCAL_PEERPID = 0x2 LOCAL_PEERTOKEN = 0x6 LOCAL_PEERUUID = 0x4 LOCK_EX = 0x2 LOCK_NB = 0x4 LOCK_SH = 0x1 LOCK_UN = 0x8 MADV_CAN_REUSE = 0x9 MADV_DONTNEED = 0x4 MADV_FREE = 0x5 MADV_FREE_REUSABLE = 0x7 MADV_FREE_REUSE = 0x8 MADV_NORMAL = 0x0 MADV_PAGEOUT = 0xa MADV_RANDOM = 0x1 MADV_SEQUENTIAL = 0x2 MADV_WILLNEED = 0x3 MADV_ZERO_WIRED_PAGES = 0x6 MAP_32BIT = 0x8000 MAP_ANON = 0x1000 MAP_ANONYMOUS = 0x1000 MAP_COPY = 0x2 MAP_FILE = 0x0 MAP_FIXED = 0x10 MAP_HASSEMAPHORE = 0x200 MAP_JIT = 0x800 MAP_NOCACHE = 0x400 MAP_NOEXTEND = 0x100 MAP_NORESERVE = 0x40 MAP_PRIVATE = 0x2 MAP_RENAME = 0x20 MAP_RESERVED0080 = 0x80 MAP_RESILIENT_CODESIGN = 0x2000 MAP_RESILIENT_MEDIA = 0x4000 MAP_SHARED = 0x1 MAP_TRANSLATED_ALLOW_EXECUTE = 0x20000 MAP_UNIX03 = 0x40000 MCAST_BLOCK_SOURCE = 0x54 MCAST_EXCLUDE = 0x2 MCAST_INCLUDE = 0x1 MCAST_JOIN_GROUP = 0x50 MCAST_JOIN_SOURCE_GROUP = 0x52 MCAST_LEAVE_GROUP = 0x51 MCAST_LEAVE_SOURCE_GROUP = 0x53 MCAST_UNBLOCK_SOURCE = 0x55 MCAST_UNDEFINED = 0x0 MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MNT_ASYNC = 0x40 MNT_AUTOMOUNTED = 0x400000 MNT_CMDFLAGS = 0xf0000 MNT_CPROTECT = 0x80 MNT_DEFWRITE = 0x2000000 MNT_DONTBROWSE = 0x100000 MNT_DOVOLFS = 0x8000 MNT_DWAIT = 0x4 MNT_EXPORTED = 0x100 MNT_EXT_ROOT_DATA_VOL = 0x1 MNT_FORCE = 0x80000 MNT_IGNORE_OWNERSHIP = 0x200000 MNT_JOURNALED = 0x800000 MNT_LOCAL = 0x1000 MNT_MULTILABEL = 0x4000000 MNT_NOATIME = 0x10000000 MNT_NOBLOCK = 0x20000 MNT_NODEV = 0x10 MNT_NOEXEC = 0x4 MNT_NOSUID = 0x8 MNT_NOUSERXATTR = 0x1000000 MNT_NOWAIT = 0x2 MNT_QUARANTINE = 0x400 MNT_QUOTA = 0x2000 MNT_RDONLY = 0x1 MNT_RELOAD = 0x40000 MNT_REMOVABLE = 0x200 MNT_ROOTFS = 0x4000 MNT_SNAPSHOT = 0x40000000 MNT_STRICTATIME = 0x80000000 MNT_SYNCHRONOUS = 0x2 MNT_UNION = 0x20 MNT_UNKNOWNPERMISSIONS = 0x200000 MNT_UPDATE = 0x10000 MNT_VISFLAGMASK = 0xd7f0f7ff MNT_WAIT = 0x1 MSG_CTRUNC = 0x20 MSG_DONTROUTE = 0x4 MSG_DONTWAIT = 0x80 MSG_EOF = 0x100 MSG_EOR = 0x8 MSG_FLUSH = 0x400 MSG_HAVEMORE = 0x2000 MSG_HOLD = 0x800 MSG_NEEDSA = 0x10000 MSG_NOSIGNAL = 0x80000 MSG_OOB = 0x1 MSG_PEEK = 0x2 MSG_RCVMORE = 0x4000 MSG_SEND = 0x1000 MSG_TRUNC = 0x10 MSG_WAITALL = 0x40 MSG_WAITSTREAM = 0x200 MS_ASYNC = 0x1 MS_DEACTIVATE = 0x8 MS_INVALIDATE = 0x2 MS_KILLPAGES = 0x4 MS_SYNC = 0x10 NAME_MAX = 0xff NET_RT_DUMP = 0x1 NET_RT_DUMP2 = 0x7 NET_RT_FLAGS = 0x2 NET_RT_FLAGS_PRIV = 0xa NET_RT_IFLIST = 0x3 NET_RT_IFLIST2 = 0x6 NET_RT_MAXID = 0xb NET_RT_STAT = 0x4 NET_RT_TRASH = 0x5 NFDBITS = 0x20 NL0 = 0x0 NL1 = 0x100 NL2 = 0x200 NL3 = 0x300 NLDLY = 0x300 NOFLSH = 0x80000000 NOKERNINFO = 0x2000000 NOTE_ABSOLUTE = 0x8 NOTE_ATTRIB = 0x8 NOTE_BACKGROUND = 0x40 NOTE_CHILD = 0x4 NOTE_CRITICAL = 0x20 NOTE_DELETE = 0x1 NOTE_EXEC = 0x20000000 NOTE_EXIT = 0x80000000 NOTE_EXITSTATUS = 0x4000000 NOTE_EXIT_CSERROR = 0x40000 NOTE_EXIT_DECRYPTFAIL = 0x10000 NOTE_EXIT_DETAIL = 0x2000000 NOTE_EXIT_DETAIL_MASK = 0x70000 NOTE_EXIT_MEMORY = 0x20000 NOTE_EXIT_REPARENTED = 0x80000 NOTE_EXTEND = 0x4 NOTE_FFAND = 0x40000000 NOTE_FFCOPY = 0xc0000000 NOTE_FFCTRLMASK = 0xc0000000 NOTE_FFLAGSMASK = 0xffffff NOTE_FFNOP = 0x0 NOTE_FFOR = 0x80000000 NOTE_FORK = 0x40000000 NOTE_FUNLOCK = 0x100 NOTE_LEEWAY = 0x10 NOTE_LINK = 0x10 NOTE_LOWAT = 0x1 NOTE_MACHTIME = 0x100 NOTE_MACH_CONTINUOUS_TIME = 0x80 NOTE_NONE = 0x80 NOTE_NSECONDS = 0x4 NOTE_OOB = 0x2 NOTE_PCTRLMASK = -0x100000 NOTE_PDATAMASK = 0xfffff NOTE_REAP = 0x10000000 NOTE_RENAME = 0x20 NOTE_REVOKE = 0x40 NOTE_SECONDS = 0x1 NOTE_SIGNAL = 0x8000000 NOTE_TRACK = 0x1 NOTE_TRACKERR = 0x2 NOTE_TRIGGER = 0x1000000 NOTE_USECONDS = 0x2 NOTE_VM_ERROR = 0x10000000 NOTE_VM_PRESSURE = 0x80000000 NOTE_VM_PRESSURE_SUDDEN_TERMINATE = 0x20000000 NOTE_VM_PRESSURE_TERMINATE = 0x40000000 NOTE_WRITE = 0x2 OCRNL = 0x10 OFDEL = 0x20000 OFILL = 0x80 ONLCR = 0x2 ONLRET = 0x40 ONOCR = 0x20 ONOEOT = 0x8 OPOST = 0x1 OXTABS = 0x4 O_ACCMODE = 0x3 O_ALERT = 0x20000000 O_APPEND = 0x8 O_ASYNC = 0x40 O_CLOEXEC = 0x1000000 O_CREAT = 0x200 O_DIRECTORY = 0x100000 O_DP_GETRAWENCRYPTED = 0x1 O_DP_GETRAWUNENCRYPTED = 0x2 O_DSYNC = 0x400000 O_EVTONLY = 0x8000 O_EXCL = 0x800 O_EXLOCK = 0x20 O_FSYNC = 0x80 O_NDELAY = 0x4 O_NOCTTY = 0x20000 O_NOFOLLOW = 0x100 O_NOFOLLOW_ANY = 0x20000000 O_NONBLOCK = 0x4 O_POPUP = 0x80000000 O_RDONLY = 0x0 O_RDWR = 0x2 O_SHLOCK = 0x10 O_SYMLINK = 0x200000 O_SYNC = 0x80 O_TRUNC = 0x400 O_WRONLY = 0x1 PARENB = 0x1000 PARMRK = 0x8 PARODD = 0x2000 PENDIN = 0x20000000 PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 PROT_EXEC = 0x4 PROT_NONE = 0x0 PROT_READ = 0x1 PROT_WRITE = 0x2 PT_ATTACH = 0xa PT_ATTACHEXC = 0xe PT_CONTINUE = 0x7 PT_DENY_ATTACH = 0x1f PT_DETACH = 0xb PT_FIRSTMACH = 0x20 PT_FORCEQUOTA = 0x1e PT_KILL = 0x8 PT_READ_D = 0x2 PT_READ_I = 0x1 PT_READ_U = 0x3 PT_SIGEXC = 0xc PT_STEP = 0x9 PT_THUPDATE = 0xd PT_TRACE_ME = 0x0 PT_WRITE_D = 0x5 PT_WRITE_I = 0x4 PT_WRITE_U = 0x6 RENAME_EXCL = 0x4 RENAME_NOFOLLOW_ANY = 0x10 RENAME_RESERVED1 = 0x8 RENAME_SECLUDE = 0x1 RENAME_SWAP = 0x2 RLIMIT_AS = 0x5 RLIMIT_CORE = 0x4 RLIMIT_CPU = 0x0 RLIMIT_CPU_USAGE_MONITOR = 0x2 RLIMIT_DATA = 0x2 RLIMIT_FSIZE = 0x1 RLIMIT_MEMLOCK = 0x6 RLIMIT_NOFILE = 0x8 RLIMIT_NPROC = 0x7 RLIMIT_RSS = 0x5 RLIMIT_STACK = 0x3 RLIM_INFINITY = 0x7fffffffffffffff RTAX_AUTHOR = 0x6 RTAX_BRD = 0x7 RTAX_DST = 0x0 RTAX_GATEWAY = 0x1 RTAX_GENMASK = 0x3 RTAX_IFA = 0x5 RTAX_IFP = 0x4 RTAX_MAX = 0x8 RTAX_NETMASK = 0x2 RTA_AUTHOR = 0x40 RTA_BRD = 0x80 RTA_DST = 0x1 RTA_GATEWAY = 0x2 RTA_GENMASK = 0x8 RTA_IFA = 0x20 RTA_IFP = 0x10 RTA_NETMASK = 0x4 RTF_BLACKHOLE = 0x1000 RTF_BROADCAST = 0x400000 RTF_CLONING = 0x100 RTF_CONDEMNED = 0x2000000 RTF_DEAD = 0x20000000 RTF_DELCLONE = 0x80 RTF_DONE = 0x40 RTF_DYNAMIC = 0x10 RTF_GATEWAY = 0x2 RTF_GLOBAL = 0x40000000 RTF_HOST = 0x4 RTF_IFREF = 0x4000000 RTF_IFSCOPE = 0x1000000 RTF_LLDATA = 0x400 RTF_LLINFO = 0x400 RTF_LOCAL = 0x200000 RTF_MODIFIED = 0x20 RTF_MULTICAST = 0x800000 RTF_NOIFREF = 0x2000 RTF_PINNED = 0x100000 RTF_PRCLONING = 0x10000 RTF_PROTO1 = 0x8000 RTF_PROTO2 = 0x4000 RTF_PROTO3 = 0x40000 RTF_PROXY = 0x8000000 RTF_REJECT = 0x8 RTF_ROUTER = 0x10000000 RTF_STATIC = 0x800 RTF_UP = 0x1 RTF_WASCLONED = 0x20000 RTF_XRESOLVE = 0x200 RTM_ADD = 0x1 RTM_CHANGE = 0x3 RTM_DELADDR = 0xd RTM_DELETE = 0x2 RTM_DELMADDR = 0x10 RTM_GET = 0x4 RTM_GET2 = 0x14 RTM_IFINFO = 0xe RTM_IFINFO2 = 0x12 RTM_LOCK = 0x8 RTM_LOSING = 0x5 RTM_MISS = 0x7 RTM_NEWADDR = 0xc RTM_NEWMADDR = 0xf RTM_NEWMADDR2 = 0x13 RTM_OLDADD = 0x9 RTM_OLDDEL = 0xa RTM_REDIRECT = 0x6 RTM_RESOLVE = 0xb RTM_RTTUNIT = 0xf4240 RTM_VERSION = 0x5 RTV_EXPIRE = 0x4 RTV_HOPCOUNT = 0x2 RTV_MTU = 0x1 RTV_RPIPE = 0x8 RTV_RTT = 0x40 RTV_RTTVAR = 0x80 RTV_SPIPE = 0x10 RTV_SSTHRESH = 0x20 RUSAGE_CHILDREN = -0x1 RUSAGE_SELF = 0x0 SAE_ASSOCID_ALL = 0xffffffff SAE_ASSOCID_ANY = 0x0 SAE_CONNID_ALL = 0xffffffff SAE_CONNID_ANY = 0x0 SCM_CREDS = 0x3 SCM_RIGHTS = 0x1 SCM_TIMESTAMP = 0x2 SCM_TIMESTAMP_MONOTONIC = 0x4 SEEK_CUR = 0x1 SEEK_DATA = 0x4 SEEK_END = 0x2 SEEK_HOLE = 0x3 SEEK_SET = 0x0 SF_APPEND = 0x40000 SF_ARCHIVED = 0x10000 SF_DATALESS = 0x40000000 SF_FIRMLINK = 0x800000 SF_IMMUTABLE = 0x20000 SF_NOUNLINK = 0x100000 SF_RESTRICTED = 0x80000 SF_SETTABLE = 0x3fff0000 SF_SUPPORTED = 0x9f0000 SF_SYNTHETIC = 0xc0000000 SHUT_RD = 0x0 SHUT_RDWR = 0x2 SHUT_WR = 0x1 SIOCADDMULTI = 0x80206931 SIOCAIFADDR = 0x8040691a SIOCARPIPLL = 0xc0206928 SIOCATMARK = 0x40047307 SIOCAUTOADDR = 0xc0206926 SIOCAUTONETMASK = 0x80206927 SIOCDELMULTI = 0x80206932 SIOCDIFADDR = 0x80206919 SIOCDIFPHYADDR = 0x80206941 SIOCGDRVSPEC = 0xc028697b SIOCGETVLAN = 0xc020697f SIOCGHIWAT = 0x40047301 SIOCGIF6LOWPAN = 0xc02069c5 SIOCGIFADDR = 0xc0206921 SIOCGIFALTMTU = 0xc0206948 SIOCGIFASYNCMAP = 0xc020697c SIOCGIFBOND = 0xc0206947 SIOCGIFBRDADDR = 0xc0206923 SIOCGIFCAP = 0xc020695b SIOCGIFCONF = 0xc00c6924 SIOCGIFDEVMTU = 0xc0206944 SIOCGIFDSTADDR = 0xc0206922 SIOCGIFFLAGS = 0xc0206911 SIOCGIFFUNCTIONALTYPE = 0xc02069ad SIOCGIFGENERIC = 0xc020693a SIOCGIFKPI = 0xc0206987 SIOCGIFMAC = 0xc0206982 SIOCGIFMEDIA = 0xc02c6938 SIOCGIFMETRIC = 0xc0206917 SIOCGIFMTU = 0xc0206933 SIOCGIFNETMASK = 0xc0206925 SIOCGIFPDSTADDR = 0xc0206940 SIOCGIFPHYS = 0xc0206935 SIOCGIFPSRCADDR = 0xc020693f SIOCGIFSTATUS = 0xc331693d SIOCGIFVLAN = 0xc020697f SIOCGIFWAKEFLAGS = 0xc0206988 SIOCGIFXMEDIA = 0xc02c6948 SIOCGLOWAT = 0x40047303 SIOCGPGRP = 0x40047309 SIOCIFCREATE = 0xc0206978 SIOCIFCREATE2 = 0xc020697a SIOCIFDESTROY = 0x80206979 SIOCIFGCLONERS = 0xc0106981 SIOCRSLVMULTI = 0xc010693b SIOCSDRVSPEC = 0x8028697b SIOCSETVLAN = 0x8020697e SIOCSHIWAT = 0x80047300 SIOCSIF6LOWPAN = 0x802069c4 SIOCSIFADDR = 0x8020690c SIOCSIFALTMTU = 0x80206945 SIOCSIFASYNCMAP = 0x8020697d SIOCSIFBOND = 0x80206946 SIOCSIFBRDADDR = 0x80206913 SIOCSIFCAP = 0x8020695a SIOCSIFDSTADDR = 0x8020690e SIOCSIFFLAGS = 0x80206910 SIOCSIFGENERIC = 0x80206939 SIOCSIFKPI = 0x80206986 SIOCSIFLLADDR = 0x8020693c SIOCSIFMAC = 0x80206983 SIOCSIFMEDIA = 0xc0206937 SIOCSIFMETRIC = 0x80206918 SIOCSIFMTU = 0x80206934 SIOCSIFNETMASK = 0x80206916 SIOCSIFPHYADDR = 0x8040693e SIOCSIFPHYS = 0x80206936 SIOCSIFVLAN = 0x8020697e SIOCSLOWAT = 0x80047302 SIOCSPGRP = 0x80047308 SOCK_DGRAM = 0x2 SOCK_MAXADDRLEN = 0xff SOCK_RAW = 0x3 SOCK_RDM = 0x4 SOCK_SEQPACKET = 0x5 SOCK_STREAM = 0x1 SOL_LOCAL = 0x0 SOL_SOCKET = 0xffff SOMAXCONN = 0x80 SO_ACCEPTCONN = 0x2 SO_BROADCAST = 0x20 SO_DEBUG = 0x1 SO_DONTROUTE = 0x10 SO_DONTTRUNC = 0x2000 SO_ERROR = 0x1007 SO_KEEPALIVE = 0x8 SO_LABEL = 0x1010 SO_LINGER = 0x80 SO_LINGER_SEC = 0x1080 SO_NETSVC_MARKING_LEVEL = 0x1119 SO_NET_SERVICE_TYPE = 0x1116 SO_NKE = 0x1021 SO_NOADDRERR = 0x1023 SO_NOSIGPIPE = 0x1022 SO_NOTIFYCONFLICT = 0x1026 SO_NP_EXTENSIONS = 0x1083 SO_NREAD = 0x1020 SO_NUMRCVPKT = 0x1112 SO_NWRITE = 0x1024 SO_OOBINLINE = 0x100 SO_PEERLABEL = 0x1011 SO_RANDOMPORT = 0x1082 SO_RCVBUF = 0x1002 SO_RCVLOWAT = 0x1004 SO_RCVTIMEO = 0x1006 SO_REUSEADDR = 0x4 SO_REUSEPORT = 0x200 SO_REUSESHAREUID = 0x1025 SO_SNDBUF = 0x1001 SO_SNDLOWAT = 0x1003 SO_SNDTIMEO = 0x1005 SO_TIMESTAMP = 0x400 SO_TIMESTAMP_MONOTONIC = 0x800 SO_TRACKER_ATTRIBUTE_FLAGS_APP_APPROVED = 0x1 SO_TRACKER_ATTRIBUTE_FLAGS_DOMAIN_SHORT = 0x4 SO_TRACKER_ATTRIBUTE_FLAGS_TRACKER = 0x2 SO_TRACKER_TRANSPARENCY_VERSION = 0x3 SO_TYPE = 0x1008 SO_UPCALLCLOSEWAIT = 0x1027 SO_USELOOPBACK = 0x40 SO_WANTMORE = 0x4000 SO_WANTOOBFLAG = 0x8000 S_IEXEC = 0x40 S_IFBLK = 0x6000 S_IFCHR = 0x2000 S_IFDIR = 0x4000 S_IFIFO = 0x1000 S_IFLNK = 0xa000 S_IFMT = 0xf000 S_IFREG = 0x8000 S_IFSOCK = 0xc000 S_IFWHT = 0xe000 S_IREAD = 0x100 S_IRGRP = 0x20 S_IROTH = 0x4 S_IRUSR = 0x100 S_IRWXG = 0x38 S_IRWXO = 0x7 S_IRWXU = 0x1c0 S_ISGID = 0x400 S_ISTXT = 0x200 S_ISUID = 0x800 S_ISVTX = 0x200 S_IWGRP = 0x10 S_IWOTH = 0x2 S_IWRITE = 0x80 S_IWUSR = 0x80 S_IXGRP = 0x8 S_IXOTH = 0x1 S_IXUSR = 0x40 TAB0 = 0x0 TAB1 = 0x400 TAB2 = 0x800 TAB3 = 0x4 TABDLY = 0xc04 TCIFLUSH = 0x1 TCIOFF = 0x3 TCIOFLUSH = 0x3 TCION = 0x4 TCOFLUSH = 0x2 TCOOFF = 0x1 TCOON = 0x2 TCPOPT_CC = 0xb TCPOPT_CCECHO = 0xd TCPOPT_CCNEW = 0xc TCPOPT_EOL = 0x0 TCPOPT_FASTOPEN = 0x22 TCPOPT_MAXSEG = 0x2 TCPOPT_NOP = 0x1 TCPOPT_SACK = 0x5 TCPOPT_SACK_HDR = 0x1010500 TCPOPT_SACK_PERMITTED = 0x4 TCPOPT_SACK_PERMIT_HDR = 0x1010402 TCPOPT_SIGNATURE = 0x13 TCPOPT_TIMESTAMP = 0x8 TCPOPT_TSTAMP_HDR = 0x101080a TCPOPT_WINDOW = 0x3 TCP_CONNECTIONTIMEOUT = 0x20 TCP_CONNECTION_INFO = 0x106 TCP_ENABLE_ECN = 0x104 TCP_FASTOPEN = 0x105 TCP_KEEPALIVE = 0x10 TCP_KEEPCNT = 0x102 TCP_KEEPINTVL = 0x101 TCP_MAXHLEN = 0x3c TCP_MAXOLEN = 0x28 TCP_MAXSEG = 0x2 TCP_MAXWIN = 0xffff TCP_MAX_SACK = 0x4 TCP_MAX_WINSHIFT = 0xe TCP_MINMSS = 0xd8 TCP_MSS = 0x200 TCP_NODELAY = 0x1 TCP_NOOPT = 0x8 TCP_NOPUSH = 0x4 TCP_NOTSENT_LOWAT = 0x201 TCP_RXT_CONNDROPTIME = 0x80 TCP_RXT_FINDROP = 0x100 TCP_SENDMOREACKS = 0x103 TCSAFLUSH = 0x2 TIOCCBRK = 0x2000747a TIOCCDTR = 0x20007478 TIOCCONS = 0x80047462 TIOCDCDTIMESTAMP = 0x40107458 TIOCDRAIN = 0x2000745e TIOCDSIMICROCODE = 0x20007455 TIOCEXCL = 0x2000740d TIOCEXT = 0x80047460 TIOCFLUSH = 0x80047410 TIOCGDRAINWAIT = 0x40047456 TIOCGETA = 0x40487413 TIOCGETD = 0x4004741a TIOCGPGRP = 0x40047477 TIOCGWINSZ = 0x40087468 TIOCIXOFF = 0x20007480 TIOCIXON = 0x20007481 TIOCMBIC = 0x8004746b TIOCMBIS = 0x8004746c TIOCMGDTRWAIT = 0x4004745a TIOCMGET = 0x4004746a TIOCMODG = 0x40047403 TIOCMODS = 0x80047404 TIOCMSDTRWAIT = 0x8004745b TIOCMSET = 0x8004746d TIOCM_CAR = 0x40 TIOCM_CD = 0x40 TIOCM_CTS = 0x20 TIOCM_DSR = 0x100 TIOCM_DTR = 0x2 TIOCM_LE = 0x1 TIOCM_RI = 0x80 TIOCM_RNG = 0x80 TIOCM_RTS = 0x4 TIOCM_SR = 0x10 TIOCM_ST = 0x8 TIOCNOTTY = 0x20007471 TIOCNXCL = 0x2000740e TIOCOUTQ = 0x40047473 TIOCPKT = 0x80047470 TIOCPKT_DATA = 0x0 TIOCPKT_DOSTOP = 0x20 TIOCPKT_FLUSHREAD = 0x1 TIOCPKT_FLUSHWRITE = 0x2 TIOCPKT_IOCTL = 0x40 TIOCPKT_NOSTOP = 0x10 TIOCPKT_START = 0x8 TIOCPKT_STOP = 0x4 TIOCPTYGNAME = 0x40807453 TIOCPTYGRANT = 0x20007454 TIOCPTYUNLK = 0x20007452 TIOCREMOTE = 0x80047469 TIOCSBRK = 0x2000747b TIOCSCONS = 0x20007463 TIOCSCTTY = 0x20007461 TIOCSDRAINWAIT = 0x80047457 TIOCSDTR = 0x20007479 TIOCSETA = 0x80487414 TIOCSETAF = 0x80487416 TIOCSETAW = 0x80487415 TIOCSETD = 0x8004741b TIOCSIG = 0x2000745f TIOCSPGRP = 0x80047476 TIOCSTART = 0x2000746e TIOCSTAT = 0x20007465 TIOCSTI = 0x80017472 TIOCSTOP = 0x2000746f TIOCSWINSZ = 0x80087467 TIOCTIMESTAMP = 0x40107459 TIOCUCNTL = 0x80047466 TOSTOP = 0x400000 UF_APPEND = 0x4 UF_COMPRESSED = 0x20 UF_DATAVAULT = 0x80 UF_HIDDEN = 0x8000 UF_IMMUTABLE = 0x2 UF_NODUMP = 0x1 UF_OPAQUE = 0x8 UF_SETTABLE = 0xffff UF_TRACKED = 0x40 VDISCARD = 0xf VDSUSP = 0xb VEOF = 0x0 VEOL = 0x1 VEOL2 = 0x2 VERASE = 0x3 VINTR = 0x8 VKILL = 0x5 VLNEXT = 0xe VMADDR_CID_ANY = 0xffffffff VMADDR_CID_HOST = 0x2 VMADDR_CID_HYPERVISOR = 0x0 VMADDR_CID_RESERVED = 0x1 VMADDR_PORT_ANY = 0xffffffff VMIN = 0x10 VM_LOADAVG = 0x2 VM_MACHFACTOR = 0x4 VM_MAXID = 0x6 VM_METER = 0x1 VM_SWAPUSAGE = 0x5 VQUIT = 0x9 VREPRINT = 0x6 VSTART = 0xc VSTATUS = 0x12 VSTOP = 0xd VSUSP = 0xa VT0 = 0x0 VT1 = 0x10000 VTDLY = 0x10000 VTIME = 0x11 VWERASE = 0x4 WCONTINUED = 0x10 WCOREFLAG = 0x80 WEXITED = 0x4 WNOHANG = 0x1 WNOWAIT = 0x20 WORDSIZE = 0x40 WSTOPPED = 0x8 WUNTRACED = 0x2 XATTR_CREATE = 0x2 XATTR_NODEFAULT = 0x10 XATTR_NOFOLLOW = 0x1 XATTR_NOSECURITY = 0x8 XATTR_REPLACE = 0x4 XATTR_SHOWCOMPRESSION = 0x20 ) // Errors const ( E2BIG = syscall.Errno(0x7) EACCES = syscall.Errno(0xd) EADDRINUSE = syscall.Errno(0x30) EADDRNOTAVAIL = syscall.Errno(0x31) EAFNOSUPPORT = syscall.Errno(0x2f) EAGAIN = syscall.Errno(0x23) EALREADY = syscall.Errno(0x25) EAUTH = syscall.Errno(0x50) EBADARCH = syscall.Errno(0x56) EBADEXEC = syscall.Errno(0x55) EBADF = syscall.Errno(0x9) EBADMACHO = syscall.Errno(0x58) EBADMSG = syscall.Errno(0x5e) EBADRPC = syscall.Errno(0x48) EBUSY = syscall.Errno(0x10) ECANCELED = syscall.Errno(0x59) ECHILD = syscall.Errno(0xa) ECONNABORTED = syscall.Errno(0x35) ECONNREFUSED = syscall.Errno(0x3d) ECONNRESET = syscall.Errno(0x36) EDEADLK = syscall.Errno(0xb) EDESTADDRREQ = syscall.Errno(0x27) EDEVERR = syscall.Errno(0x53) EDOM = syscall.Errno(0x21) EDQUOT = syscall.Errno(0x45) EEXIST = syscall.Errno(0x11) EFAULT = syscall.Errno(0xe) EFBIG = syscall.Errno(0x1b) EFTYPE = syscall.Errno(0x4f) EHOSTDOWN = syscall.Errno(0x40) EHOSTUNREACH = syscall.Errno(0x41) EIDRM = syscall.Errno(0x5a) EILSEQ = syscall.Errno(0x5c) EINPROGRESS = syscall.Errno(0x24) EINTR = syscall.Errno(0x4) EINVAL = syscall.Errno(0x16) EIO = syscall.Errno(0x5) EISCONN = syscall.Errno(0x38) EISDIR = syscall.Errno(0x15) ELAST = syscall.Errno(0x6a) ELOOP = syscall.Errno(0x3e) EMFILE = syscall.Errno(0x18) EMLINK = syscall.Errno(0x1f) EMSGSIZE = syscall.Errno(0x28) EMULTIHOP = syscall.Errno(0x5f) ENAMETOOLONG = syscall.Errno(0x3f) ENEEDAUTH = syscall.Errno(0x51) ENETDOWN = syscall.Errno(0x32) ENETRESET = syscall.Errno(0x34) ENETUNREACH = syscall.Errno(0x33) ENFILE = syscall.Errno(0x17) ENOATTR = syscall.Errno(0x5d) ENOBUFS = syscall.Errno(0x37) ENODATA = syscall.Errno(0x60) ENODEV = syscall.Errno(0x13) ENOENT = syscall.Errno(0x2) ENOEXEC = syscall.Errno(0x8) ENOLCK = syscall.Errno(0x4d) ENOLINK = syscall.Errno(0x61) ENOMEM = syscall.Errno(0xc) ENOMSG = syscall.Errno(0x5b) ENOPOLICY = syscall.Errno(0x67) ENOPROTOOPT = syscall.Errno(0x2a) ENOSPC = syscall.Errno(0x1c) ENOSR = syscall.Errno(0x62) ENOSTR = syscall.Errno(0x63) ENOSYS = syscall.Errno(0x4e) ENOTBLK = syscall.Errno(0xf) ENOTCONN = syscall.Errno(0x39) ENOTDIR = syscall.Errno(0x14) ENOTEMPTY = syscall.Errno(0x42) ENOTRECOVERABLE = syscall.Errno(0x68) ENOTSOCK = syscall.Errno(0x26) ENOTSUP = syscall.Errno(0x2d) ENOTTY = syscall.Errno(0x19) ENXIO = syscall.Errno(0x6) EOPNOTSUPP = syscall.Errno(0x66) EOVERFLOW = syscall.Errno(0x54) EOWNERDEAD = syscall.Errno(0x69) EPERM = syscall.Errno(0x1) EPFNOSUPPORT = syscall.Errno(0x2e) EPIPE = syscall.Errno(0x20) EPROCLIM = syscall.Errno(0x43) EPROCUNAVAIL = syscall.Errno(0x4c) EPROGMISMATCH = syscall.Errno(0x4b) EPROGUNAVAIL = syscall.Errno(0x4a) EPROTO = syscall.Errno(0x64) EPROTONOSUPPORT = syscall.Errno(0x2b) EPROTOTYPE = syscall.Errno(0x29) EPWROFF = syscall.Errno(0x52) EQFULL = syscall.Errno(0x6a) ERANGE = syscall.Errno(0x22) EREMOTE = syscall.Errno(0x47) EROFS = syscall.Errno(0x1e) ERPCMISMATCH = syscall.Errno(0x49) ESHLIBVERS = syscall.Errno(0x57) ESHUTDOWN = syscall.Errno(0x3a) ESOCKTNOSUPPORT = syscall.Errno(0x2c) ESPIPE = syscall.Errno(0x1d) ESRCH = syscall.Errno(0x3) ESTALE = syscall.Errno(0x46) ETIME = syscall.Errno(0x65) ETIMEDOUT = syscall.Errno(0x3c) ETOOMANYREFS = syscall.Errno(0x3b) ETXTBSY = syscall.Errno(0x1a) EUSERS = syscall.Errno(0x44) EWOULDBLOCK = syscall.Errno(0x23) EXDEV = syscall.Errno(0x12) ) // Signals const ( SIGABRT = syscall.Signal(0x6) SIGALRM = syscall.Signal(0xe) SIGBUS = syscall.Signal(0xa) SIGCHLD = syscall.Signal(0x14) SIGCONT = syscall.Signal(0x13) SIGEMT = syscall.Signal(0x7) SIGFPE = syscall.Signal(0x8) SIGHUP = syscall.Signal(0x1) SIGILL = syscall.Signal(0x4) SIGINFO = syscall.Signal(0x1d) SIGINT = syscall.Signal(0x2) SIGIO = syscall.Signal(0x17) SIGIOT = syscall.Signal(0x6) SIGKILL = syscall.Signal(0x9) SIGPIPE = syscall.Signal(0xd) SIGPROF = syscall.Signal(0x1b) SIGQUIT = syscall.Signal(0x3) SIGSEGV = syscall.Signal(0xb) SIGSTOP = syscall.Signal(0x11) SIGSYS = syscall.Signal(0xc) SIGTERM = syscall.Signal(0xf) SIGTRAP = syscall.Signal(0x5) SIGTSTP = syscall.Signal(0x12) SIGTTIN = syscall.Signal(0x15) SIGTTOU = syscall.Signal(0x16) SIGURG = syscall.Signal(0x10) SIGUSR1 = syscall.Signal(0x1e) SIGUSR2 = syscall.Signal(0x1f) SIGVTALRM = syscall.Signal(0x1a) SIGWINCH = syscall.Signal(0x1c) SIGXCPU = syscall.Signal(0x18) SIGXFSZ = syscall.Signal(0x19) ) // Error table var errorList = [...]struct { num syscall.Errno name string desc string }{ {1, "EPERM", "operation not permitted"}, {2, "ENOENT", "no such file or directory"}, {3, "ESRCH", "no such process"}, {4, "EINTR", "interrupted system call"}, {5, "EIO", "input/output error"}, {6, "ENXIO", "device not configured"}, {7, "E2BIG", "argument list too long"}, {8, "ENOEXEC", "exec format error"}, {9, "EBADF", "bad file descriptor"}, {10, "ECHILD", "no child processes"}, {11, "EDEADLK", "resource deadlock avoided"}, {12, "ENOMEM", "cannot allocate memory"}, {13, "EACCES", "permission denied"}, {14, "EFAULT", "bad address"}, {15, "ENOTBLK", "block device required"}, {16, "EBUSY", "resource busy"}, {17, "EEXIST", "file exists"}, {18, "EXDEV", "cross-device link"}, {19, "ENODEV", "operation not supported by device"}, {20, "ENOTDIR", "not a directory"}, {21, "EISDIR", "is a directory"}, {22, "EINVAL", "invalid argument"}, {23, "ENFILE", "too many open files in system"}, {24, "EMFILE", "too many open files"}, {25, "ENOTTY", "inappropriate ioctl for device"}, {26, "ETXTBSY", "text file busy"}, {27, "EFBIG", "file too large"}, {28, "ENOSPC", "no space left on device"}, {29, "ESPIPE", "illegal seek"}, {30, "EROFS", "read-only file system"}, {31, "EMLINK", "too many links"}, {32, "EPIPE", "broken pipe"}, {33, "EDOM", "numerical argument out of domain"}, {34, "ERANGE", "result too large"}, {35, "EAGAIN", "resource temporarily unavailable"}, {36, "EINPROGRESS", "operation now in progress"}, {37, "EALREADY", "operation already in progress"}, {38, "ENOTSOCK", "socket operation on non-socket"}, {39, "EDESTADDRREQ", "destination address required"}, {40, "EMSGSIZE", "message too long"}, {41, "EPROTOTYPE", "protocol wrong type for socket"}, {42, "ENOPROTOOPT", "protocol not available"}, {43, "EPROTONOSUPPORT", "protocol not supported"}, {44, "ESOCKTNOSUPPORT", "socket type not supported"}, {45, "ENOTSUP", "operation not supported"}, {46, "EPFNOSUPPORT", "protocol family not supported"}, {47, "EAFNOSUPPORT", "address family not supported by protocol family"}, {48, "EADDRINUSE", "address already in use"}, {49, "EADDRNOTAVAIL", "can't assign requested address"}, {50, "ENETDOWN", "network is down"}, {51, "ENETUNREACH", "network is unreachable"}, {52, "ENETRESET", "network dropped connection on reset"}, {53, "ECONNABORTED", "software caused connection abort"}, {54, "ECONNRESET", "connection reset by peer"}, {55, "ENOBUFS", "no buffer space available"}, {56, "EISCONN", "socket is already connected"}, {57, "ENOTCONN", "socket is not connected"}, {58, "ESHUTDOWN", "can't send after socket shutdown"}, {59, "ETOOMANYREFS", "too many references: can't splice"}, {60, "ETIMEDOUT", "operation timed out"}, {61, "ECONNREFUSED", "connection refused"}, {62, "ELOOP", "too many levels of symbolic links"}, {63, "ENAMETOOLONG", "file name too long"}, {64, "EHOSTDOWN", "host is down"}, {65, "EHOSTUNREACH", "no route to host"}, {66, "ENOTEMPTY", "directory not empty"}, {67, "EPROCLIM", "too many processes"}, {68, "EUSERS", "too many users"}, {69, "EDQUOT", "disc quota exceeded"}, {70, "ESTALE", "stale NFS file handle"}, {71, "EREMOTE", "too many levels of remote in path"}, {72, "EBADRPC", "RPC struct is bad"}, {73, "ERPCMISMATCH", "RPC version wrong"}, {74, "EPROGUNAVAIL", "RPC prog. not avail"}, {75, "EPROGMISMATCH", "program version wrong"}, {76, "EPROCUNAVAIL", "bad procedure for program"}, {77, "ENOLCK", "no locks available"}, {78, "ENOSYS", "function not implemented"}, {79, "EFTYPE", "inappropriate file type or format"}, {80, "EAUTH", "authentication error"}, {81, "ENEEDAUTH", "need authenticator"}, {82, "EPWROFF", "device power is off"}, {83, "EDEVERR", "device error"}, {84, "EOVERFLOW", "value too large to be stored in data type"}, {85, "EBADEXEC", "bad executable (or shared library)"}, {86, "EBADARCH", "bad CPU type in executable"}, {87, "ESHLIBVERS", "shared library version mismatch"}, {88, "EBADMACHO", "malformed Mach-o file"}, {89, "ECANCELED", "operation canceled"}, {90, "EIDRM", "identifier removed"}, {91, "ENOMSG", "no message of desired type"}, {92, "EILSEQ", "illegal byte sequence"}, {93, "ENOATTR", "attribute not found"}, {94, "EBADMSG", "bad message"}, {95, "EMULTIHOP", "EMULTIHOP (Reserved)"}, {96, "ENODATA", "no message available on STREAM"}, {97, "ENOLINK", "ENOLINK (Reserved)"}, {98, "ENOSR", "no STREAM resources"}, {99, "ENOSTR", "not a STREAM"}, {100, "EPROTO", "protocol error"}, {101, "ETIME", "STREAM ioctl timeout"}, {102, "EOPNOTSUPP", "operation not supported on socket"}, {103, "ENOPOLICY", "policy not found"}, {104, "ENOTRECOVERABLE", "state not recoverable"}, {105, "EOWNERDEAD", "previous owner died"}, {106, "EQFULL", "interface output queue is full"}, } // Signal table var signalList = [...]struct { num syscall.Signal name string desc string }{ {1, "SIGHUP", "hangup"}, {2, "SIGINT", "interrupt"}, {3, "SIGQUIT", "quit"}, {4, "SIGILL", "illegal instruction"}, {5, "SIGTRAP", "trace/BPT trap"}, {6, "SIGABRT", "abort trap"}, {7, "SIGEMT", "EMT trap"}, {8, "SIGFPE", "floating point exception"}, {9, "SIGKILL", "killed"}, {10, "SIGBUS", "bus error"}, {11, "SIGSEGV", "segmentation fault"}, {12, "SIGSYS", "bad system call"}, {13, "SIGPIPE", "broken pipe"}, {14, "SIGALRM", "alarm clock"}, {15, "SIGTERM", "terminated"}, {16, "SIGURG", "urgent I/O condition"}, {17, "SIGSTOP", "suspended (signal)"}, {18, "SIGTSTP", "suspended"}, {19, "SIGCONT", "continued"}, {20, "SIGCHLD", "child exited"}, {21, "SIGTTIN", "stopped (tty input)"}, {22, "SIGTTOU", "stopped (tty output)"}, {23, "SIGIO", "I/O possible"}, {24, "SIGXCPU", "cputime limit exceeded"}, {25, "SIGXFSZ", "filesize limit exceeded"}, {26, "SIGVTALRM", "virtual timer expired"}, {27, "SIGPROF", "profiling timer expired"}, {28, "SIGWINCH", "window size changes"}, {29, "SIGINFO", "information request"}, {30, "SIGUSR1", "user defined signal 1"}, {31, "SIGUSR2", "user defined signal 2"}, } ================================================ FILE: vendor/golang.org/x/sys/unix/zerrors_dragonfly_amd64.go ================================================ // mkerrors.sh -m64 // Code generated by the command above; see README.md. DO NOT EDIT. //go:build amd64 && dragonfly // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -m64 _const.go package unix import "syscall" const ( AF_APPLETALK = 0x10 AF_ATM = 0x1e AF_BLUETOOTH = 0x21 AF_CCITT = 0xa AF_CHAOS = 0x5 AF_CNT = 0x15 AF_COIP = 0x14 AF_DATAKIT = 0x9 AF_DECnet = 0xc AF_DLI = 0xd AF_E164 = 0x1a AF_ECMA = 0x8 AF_HYLINK = 0xf AF_IEEE80211 = 0x23 AF_IMPLINK = 0x3 AF_INET = 0x2 AF_INET6 = 0x1c AF_IPX = 0x17 AF_ISDN = 0x1a AF_ISO = 0x7 AF_LAT = 0xe AF_LINK = 0x12 AF_LOCAL = 0x1 AF_MAX = 0x24 AF_MPLS = 0x22 AF_NATM = 0x1d AF_NETBIOS = 0x6 AF_NETGRAPH = 0x20 AF_OSI = 0x7 AF_PUP = 0x4 AF_ROUTE = 0x11 AF_SIP = 0x18 AF_SNA = 0xb AF_UNIX = 0x1 AF_UNSPEC = 0x0 ALTWERASE = 0x200 B0 = 0x0 B110 = 0x6e B115200 = 0x1c200 B1200 = 0x4b0 B134 = 0x86 B14400 = 0x3840 B150 = 0x96 B1800 = 0x708 B19200 = 0x4b00 B200 = 0xc8 B230400 = 0x38400 B2400 = 0x960 B28800 = 0x7080 B300 = 0x12c B38400 = 0x9600 B460800 = 0x70800 B4800 = 0x12c0 B50 = 0x32 B57600 = 0xe100 B600 = 0x258 B7200 = 0x1c20 B75 = 0x4b B76800 = 0x12c00 B921600 = 0xe1000 B9600 = 0x2580 BIOCFEEDBACK = 0x8004427d BIOCFLUSH = 0x20004268 BIOCGBLEN = 0x40044266 BIOCGDLT = 0x4004426a BIOCGDLTLIST = 0xc0104279 BIOCGETIF = 0x4020426b BIOCGFEEDBACK = 0x4004427c BIOCGHDRCMPLT = 0x40044274 BIOCGRSIG = 0x40044272 BIOCGRTIMEOUT = 0x4010426e BIOCGSEESENT = 0x40044276 BIOCGSTATS = 0x4008426f BIOCIMMEDIATE = 0x80044270 BIOCLOCK = 0x2000427a BIOCPROMISC = 0x20004269 BIOCSBLEN = 0xc0044266 BIOCSDLT = 0x80044278 BIOCSETF = 0x80104267 BIOCSETIF = 0x8020426c BIOCSETWF = 0x8010427b BIOCSFEEDBACK = 0x8004427d BIOCSHDRCMPLT = 0x80044275 BIOCSRSIG = 0x80044273 BIOCSRTIMEOUT = 0x8010426d BIOCSSEESENT = 0x80044277 BIOCVERSION = 0x40044271 BPF_A = 0x10 BPF_ABS = 0x20 BPF_ADD = 0x0 BPF_ALIGNMENT = 0x8 BPF_ALU = 0x4 BPF_AND = 0x50 BPF_B = 0x10 BPF_DEFAULTBUFSIZE = 0x1000 BPF_DIV = 0x30 BPF_H = 0x8 BPF_IMM = 0x0 BPF_IND = 0x40 BPF_JA = 0x0 BPF_JEQ = 0x10 BPF_JGE = 0x30 BPF_JGT = 0x20 BPF_JMP = 0x5 BPF_JSET = 0x40 BPF_K = 0x0 BPF_LD = 0x0 BPF_LDX = 0x1 BPF_LEN = 0x80 BPF_LSH = 0x60 BPF_MAJOR_VERSION = 0x1 BPF_MAXBUFSIZE = 0x80000 BPF_MAXINSNS = 0x200 BPF_MAX_CLONES = 0x80 BPF_MEM = 0x60 BPF_MEMWORDS = 0x10 BPF_MINBUFSIZE = 0x20 BPF_MINOR_VERSION = 0x1 BPF_MISC = 0x7 BPF_MOD = 0x90 BPF_MSH = 0xa0 BPF_MUL = 0x20 BPF_NEG = 0x80 BPF_OR = 0x40 BPF_RELEASE = 0x30bb6 BPF_RET = 0x6 BPF_RSH = 0x70 BPF_ST = 0x2 BPF_STX = 0x3 BPF_SUB = 0x10 BPF_TAX = 0x0 BPF_TXA = 0x80 BPF_W = 0x0 BPF_X = 0x8 BPF_XOR = 0xa0 BRKINT = 0x2 CFLUSH = 0xf CLOCAL = 0x8000 CLOCK_MONOTONIC = 0x4 CLOCK_MONOTONIC_FAST = 0xc CLOCK_MONOTONIC_PRECISE = 0xb CLOCK_PROCESS_CPUTIME_ID = 0xf CLOCK_PROF = 0x2 CLOCK_REALTIME = 0x0 CLOCK_REALTIME_FAST = 0xa CLOCK_REALTIME_PRECISE = 0x9 CLOCK_SECOND = 0xd CLOCK_THREAD_CPUTIME_ID = 0xe CLOCK_UPTIME = 0x5 CLOCK_UPTIME_FAST = 0x8 CLOCK_UPTIME_PRECISE = 0x7 CLOCK_VIRTUAL = 0x1 CPUSTATES = 0x5 CP_IDLE = 0x4 CP_INTR = 0x3 CP_NICE = 0x1 CP_SYS = 0x2 CP_USER = 0x0 CREAD = 0x800 CRTSCTS = 0x30000 CS5 = 0x0 CS6 = 0x100 CS7 = 0x200 CS8 = 0x300 CSIZE = 0x300 CSTART = 0x11 CSTATUS = 0x14 CSTOP = 0x13 CSTOPB = 0x400 CSUSP = 0x1a CTL_HW = 0x6 CTL_KERN = 0x1 CTL_MAXNAME = 0xc CTL_NET = 0x4 DLT_A429 = 0xb8 DLT_A653_ICM = 0xb9 DLT_AIRONET_HEADER = 0x78 DLT_AOS = 0xde DLT_APPLE_IP_OVER_IEEE1394 = 0x8a DLT_ARCNET = 0x7 DLT_ARCNET_LINUX = 0x81 DLT_ATM_CLIP = 0x13 DLT_ATM_RFC1483 = 0xb DLT_AURORA = 0x7e DLT_AX25 = 0x3 DLT_AX25_KISS = 0xca DLT_BACNET_MS_TP = 0xa5 DLT_BLUETOOTH_BREDR_BB = 0xff DLT_BLUETOOTH_HCI_H4 = 0xbb DLT_BLUETOOTH_HCI_H4_WITH_PHDR = 0xc9 DLT_BLUETOOTH_LE_LL = 0xfb DLT_BLUETOOTH_LE_LL_WITH_PHDR = 0x100 DLT_BLUETOOTH_LINUX_MONITOR = 0xfe DLT_CAN20B = 0xbe DLT_CAN_SOCKETCAN = 0xe3 DLT_CHAOS = 0x5 DLT_CHDLC = 0x68 DLT_CISCO_IOS = 0x76 DLT_C_HDLC = 0x68 DLT_C_HDLC_WITH_DIR = 0xcd DLT_DBUS = 0xe7 DLT_DECT = 0xdd DLT_DOCSIS = 0x8f DLT_DVB_CI = 0xeb DLT_ECONET = 0x73 DLT_EN10MB = 0x1 DLT_EN3MB = 0x2 DLT_ENC = 0x6d DLT_EPON = 0x103 DLT_ERF = 0xc5 DLT_ERF_ETH = 0xaf DLT_ERF_POS = 0xb0 DLT_FC_2 = 0xe0 DLT_FC_2_WITH_FRAME_DELIMS = 0xe1 DLT_FDDI = 0xa DLT_FLEXRAY = 0xd2 DLT_FRELAY = 0x6b DLT_FRELAY_WITH_DIR = 0xce DLT_GCOM_SERIAL = 0xad DLT_GCOM_T1E1 = 0xac DLT_GPF_F = 0xab DLT_GPF_T = 0xaa DLT_GPRS_LLC = 0xa9 DLT_GSMTAP_ABIS = 0xda DLT_GSMTAP_UM = 0xd9 DLT_HHDLC = 0x79 DLT_IBM_SN = 0x92 DLT_IBM_SP = 0x91 DLT_IEEE802 = 0x6 DLT_IEEE802_11 = 0x69 DLT_IEEE802_11_RADIO = 0x7f DLT_IEEE802_11_RADIO_AVS = 0xa3 DLT_IEEE802_15_4 = 0xc3 DLT_IEEE802_15_4_LINUX = 0xbf DLT_IEEE802_15_4_NOFCS = 0xe6 DLT_IEEE802_15_4_NONASK_PHY = 0xd7 DLT_IEEE802_16_MAC_CPS = 0xbc DLT_IEEE802_16_MAC_CPS_RADIO = 0xc1 DLT_INFINIBAND = 0xf7 DLT_IPFILTER = 0x74 DLT_IPMB = 0xc7 DLT_IPMB_LINUX = 0xd1 DLT_IPMI_HPM_2 = 0x104 DLT_IPNET = 0xe2 DLT_IPOIB = 0xf2 DLT_IPV4 = 0xe4 DLT_IPV6 = 0xe5 DLT_IP_OVER_FC = 0x7a DLT_ISO_14443 = 0x108 DLT_JUNIPER_ATM1 = 0x89 DLT_JUNIPER_ATM2 = 0x87 DLT_JUNIPER_ATM_CEMIC = 0xee DLT_JUNIPER_CHDLC = 0xb5 DLT_JUNIPER_ES = 0x84 DLT_JUNIPER_ETHER = 0xb2 DLT_JUNIPER_FIBRECHANNEL = 0xea DLT_JUNIPER_FRELAY = 0xb4 DLT_JUNIPER_GGSN = 0x85 DLT_JUNIPER_ISM = 0xc2 DLT_JUNIPER_MFR = 0x86 DLT_JUNIPER_MLFR = 0x83 DLT_JUNIPER_MLPPP = 0x82 DLT_JUNIPER_MONITOR = 0xa4 DLT_JUNIPER_PIC_PEER = 0xae DLT_JUNIPER_PPP = 0xb3 DLT_JUNIPER_PPPOE = 0xa7 DLT_JUNIPER_PPPOE_ATM = 0xa8 DLT_JUNIPER_SERVICES = 0x88 DLT_JUNIPER_SRX_E2E = 0xe9 DLT_JUNIPER_ST = 0xc8 DLT_JUNIPER_VP = 0xb7 DLT_JUNIPER_VS = 0xe8 DLT_LAPB_WITH_DIR = 0xcf DLT_LAPD = 0xcb DLT_LIN = 0xd4 DLT_LINUX_EVDEV = 0xd8 DLT_LINUX_IRDA = 0x90 DLT_LINUX_LAPD = 0xb1 DLT_LINUX_SLL = 0x71 DLT_LOOP = 0x6c DLT_LTALK = 0x72 DLT_MATCHING_MAX = 0x109 DLT_MATCHING_MIN = 0x68 DLT_MFR = 0xb6 DLT_MOST = 0xd3 DLT_MPEG_2_TS = 0xf3 DLT_MPLS = 0xdb DLT_MTP2 = 0x8c DLT_MTP2_WITH_PHDR = 0x8b DLT_MTP3 = 0x8d DLT_MUX27010 = 0xec DLT_NETANALYZER = 0xf0 DLT_NETANALYZER_TRANSPARENT = 0xf1 DLT_NETLINK = 0xfd DLT_NFC_LLCP = 0xf5 DLT_NFLOG = 0xef DLT_NG40 = 0xf4 DLT_NULL = 0x0 DLT_PCI_EXP = 0x7d DLT_PFLOG = 0x75 DLT_PFSYNC = 0x12 DLT_PKTAP = 0x102 DLT_PPI = 0xc0 DLT_PPP = 0x9 DLT_PPP_BSDOS = 0x10 DLT_PPP_ETHER = 0x33 DLT_PPP_PPPD = 0xa6 DLT_PPP_SERIAL = 0x32 DLT_PPP_WITH_DIR = 0xcc DLT_PRISM_HEADER = 0x77 DLT_PROFIBUS_DL = 0x101 DLT_PRONET = 0x4 DLT_RAIF1 = 0xc6 DLT_RAW = 0xc DLT_RDS = 0x109 DLT_REDBACK_SMARTEDGE = 0x20 DLT_RIO = 0x7c DLT_RTAC_SERIAL = 0xfa DLT_SCCP = 0x8e DLT_SCTP = 0xf8 DLT_SITA = 0xc4 DLT_SLIP = 0x8 DLT_SLIP_BSDOS = 0xf DLT_STANAG_5066_D_PDU = 0xed DLT_SUNATM = 0x7b DLT_SYMANTEC_FIREWALL = 0x63 DLT_TZSP = 0x80 DLT_USB = 0xba DLT_USBPCAP = 0xf9 DLT_USB_FREEBSD = 0xba DLT_USB_LINUX = 0xbd DLT_USB_LINUX_MMAPPED = 0xdc DLT_USER0 = 0x93 DLT_USER1 = 0x94 DLT_USER10 = 0x9d DLT_USER11 = 0x9e DLT_USER12 = 0x9f DLT_USER13 = 0xa0 DLT_USER14 = 0xa1 DLT_USER15 = 0xa2 DLT_USER2 = 0x95 DLT_USER3 = 0x96 DLT_USER4 = 0x97 DLT_USER5 = 0x98 DLT_USER6 = 0x99 DLT_USER7 = 0x9a DLT_USER8 = 0x9b DLT_USER9 = 0x9c DLT_WATTSTOPPER_DLM = 0x107 DLT_WIHART = 0xdf DLT_WIRESHARK_UPPER_PDU = 0xfc DLT_X2E_SERIAL = 0xd5 DLT_X2E_XORAYA = 0xd6 DLT_ZWAVE_R1_R2 = 0x105 DLT_ZWAVE_R3 = 0x106 DT_BLK = 0x6 DT_CHR = 0x2 DT_DBF = 0xf DT_DIR = 0x4 DT_FIFO = 0x1 DT_LNK = 0xa DT_REG = 0x8 DT_SOCK = 0xc DT_UNKNOWN = 0x0 DT_WHT = 0xe ECHO = 0x8 ECHOCTL = 0x40 ECHOE = 0x2 ECHOK = 0x4 ECHOKE = 0x1 ECHONL = 0x10 ECHOPRT = 0x20 EVFILT_AIO = -0x3 EVFILT_EXCEPT = -0x8 EVFILT_FS = -0xa EVFILT_MARKER = 0xf EVFILT_PROC = -0x5 EVFILT_READ = -0x1 EVFILT_SIGNAL = -0x6 EVFILT_SYSCOUNT = 0xa EVFILT_TIMER = -0x7 EVFILT_USER = -0x9 EVFILT_VNODE = -0x4 EVFILT_WRITE = -0x2 EV_ADD = 0x1 EV_CLEAR = 0x20 EV_DELETE = 0x2 EV_DISABLE = 0x8 EV_DISPATCH = 0x80 EV_ENABLE = 0x4 EV_EOF = 0x8000 EV_ERROR = 0x4000 EV_FLAG1 = 0x2000 EV_HUP = 0x800 EV_NODATA = 0x1000 EV_ONESHOT = 0x10 EV_RECEIPT = 0x40 EV_SYSFLAGS = 0xf800 EXTA = 0x4b00 EXTB = 0x9600 EXTEXIT_LWP = 0x10000 EXTEXIT_PROC = 0x0 EXTEXIT_SETINT = 0x1 EXTEXIT_SIMPLE = 0x0 EXTPROC = 0x800 FD_CLOEXEC = 0x1 FD_SETSIZE = 0x400 FLUSHO = 0x800000 F_DUP2FD = 0xa F_DUP2FD_CLOEXEC = 0x12 F_DUPFD = 0x0 F_DUPFD_CLOEXEC = 0x11 F_GETFD = 0x1 F_GETFL = 0x3 F_GETLK = 0x7 F_GETOWN = 0x5 F_OK = 0x0 F_RDLCK = 0x1 F_SETFD = 0x2 F_SETFL = 0x4 F_SETLK = 0x8 F_SETLKW = 0x9 F_SETOWN = 0x6 F_UNLCK = 0x2 F_WRLCK = 0x3 HUPCL = 0x4000 HW_MACHINE = 0x1 ICANON = 0x100 ICMP6_FILTER = 0x12 ICRNL = 0x100 IEXTEN = 0x400 IFAN_ARRIVAL = 0x0 IFAN_DEPARTURE = 0x1 IFF_ALLMULTI = 0x200 IFF_ALTPHYS = 0x4000 IFF_BROADCAST = 0x2 IFF_CANTCHANGE = 0x318e72 IFF_DEBUG = 0x4 IFF_IDIRECT = 0x200000 IFF_LINK0 = 0x1000 IFF_LINK1 = 0x2000 IFF_LINK2 = 0x4000 IFF_LOOPBACK = 0x8 IFF_MONITOR = 0x40000 IFF_MULTICAST = 0x8000 IFF_NOARP = 0x80 IFF_NPOLLING = 0x100000 IFF_OACTIVE = 0x400 IFF_OACTIVE_COMPAT = 0x400 IFF_POINTOPOINT = 0x10 IFF_POLLING = 0x10000 IFF_POLLING_COMPAT = 0x10000 IFF_PPROMISC = 0x20000 IFF_PROMISC = 0x100 IFF_RUNNING = 0x40 IFF_SIMPLEX = 0x800 IFF_SMART = 0x20 IFF_STATICARP = 0x80000 IFF_UP = 0x1 IFNAMSIZ = 0x10 IFT_1822 = 0x2 IFT_A12MPPSWITCH = 0x82 IFT_AAL2 = 0xbb IFT_AAL5 = 0x31 IFT_ADSL = 0x5e IFT_AFLANE8023 = 0x3b IFT_AFLANE8025 = 0x3c IFT_ARAP = 0x58 IFT_ARCNET = 0x23 IFT_ARCNETPLUS = 0x24 IFT_ASYNC = 0x54 IFT_ATM = 0x25 IFT_ATMDXI = 0x69 IFT_ATMFUNI = 0x6a IFT_ATMIMA = 0x6b IFT_ATMLOGICAL = 0x50 IFT_ATMRADIO = 0xbd IFT_ATMSUBINTERFACE = 0x86 IFT_ATMVCIENDPT = 0xc2 IFT_ATMVIRTUAL = 0x95 IFT_BGPPOLICYACCOUNTING = 0xa2 IFT_BRIDGE = 0xd1 IFT_BSC = 0x53 IFT_CARP = 0xf8 IFT_CCTEMUL = 0x3d IFT_CEPT = 0x13 IFT_CES = 0x85 IFT_CHANNEL = 0x46 IFT_CNR = 0x55 IFT_COFFEE = 0x84 IFT_COMPOSITELINK = 0x9b IFT_DCN = 0x8d IFT_DIGITALPOWERLINE = 0x8a IFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba IFT_DLSW = 0x4a IFT_DOCSCABLEDOWNSTREAM = 0x80 IFT_DOCSCABLEMACLAYER = 0x7f IFT_DOCSCABLEUPSTREAM = 0x81 IFT_DS0 = 0x51 IFT_DS0BUNDLE = 0x52 IFT_DS1FDL = 0xaa IFT_DS3 = 0x1e IFT_DTM = 0x8c IFT_DVBASILN = 0xac IFT_DVBASIOUT = 0xad IFT_DVBRCCDOWNSTREAM = 0x93 IFT_DVBRCCMACLAYER = 0x92 IFT_DVBRCCUPSTREAM = 0x94 IFT_ENC = 0xf4 IFT_EON = 0x19 IFT_EPLRS = 0x57 IFT_ESCON = 0x49 IFT_ETHER = 0x6 IFT_FAST = 0x7d IFT_FASTETHER = 0x3e IFT_FASTETHERFX = 0x45 IFT_FDDI = 0xf IFT_FIBRECHANNEL = 0x38 IFT_FRAMERELAYINTERCONNECT = 0x3a IFT_FRAMERELAYMPI = 0x5c IFT_FRDLCIENDPT = 0xc1 IFT_FRELAY = 0x20 IFT_FRELAYDCE = 0x2c IFT_FRF16MFRBUNDLE = 0xa3 IFT_FRFORWARD = 0x9e IFT_G703AT2MB = 0x43 IFT_G703AT64K = 0x42 IFT_GIF = 0xf0 IFT_GIGABITETHERNET = 0x75 IFT_GR303IDT = 0xb2 IFT_GR303RDT = 0xb1 IFT_H323GATEKEEPER = 0xa4 IFT_H323PROXY = 0xa5 IFT_HDH1822 = 0x3 IFT_HDLC = 0x76 IFT_HDSL2 = 0xa8 IFT_HIPERLAN2 = 0xb7 IFT_HIPPI = 0x2f IFT_HIPPIINTERFACE = 0x39 IFT_HOSTPAD = 0x5a IFT_HSSI = 0x2e IFT_HY = 0xe IFT_IBM370PARCHAN = 0x48 IFT_IDSL = 0x9a IFT_IEEE1394 = 0x90 IFT_IEEE80211 = 0x47 IFT_IEEE80212 = 0x37 IFT_IEEE8023ADLAG = 0xa1 IFT_IFGSN = 0x91 IFT_IMT = 0xbe IFT_INTERLEAVE = 0x7c IFT_IP = 0x7e IFT_IPFORWARD = 0x8e IFT_IPOVERATM = 0x72 IFT_IPOVERCDLC = 0x6d IFT_IPOVERCLAW = 0x6e IFT_IPSWITCH = 0x4e IFT_ISDN = 0x3f IFT_ISDNBASIC = 0x14 IFT_ISDNPRIMARY = 0x15 IFT_ISDNS = 0x4b IFT_ISDNU = 0x4c IFT_ISO88022LLC = 0x29 IFT_ISO88023 = 0x7 IFT_ISO88024 = 0x8 IFT_ISO88025 = 0x9 IFT_ISO88025CRFPINT = 0x62 IFT_ISO88025DTR = 0x56 IFT_ISO88025FIBER = 0x73 IFT_ISO88026 = 0xa IFT_ISUP = 0xb3 IFT_L2VLAN = 0x87 IFT_L3IPVLAN = 0x88 IFT_L3IPXVLAN = 0x89 IFT_LAPB = 0x10 IFT_LAPD = 0x4d IFT_LAPF = 0x77 IFT_LOCALTALK = 0x2a IFT_LOOP = 0x18 IFT_MEDIAMAILOVERIP = 0x8b IFT_MFSIGLINK = 0xa7 IFT_MIOX25 = 0x26 IFT_MODEM = 0x30 IFT_MPC = 0x71 IFT_MPLS = 0xa6 IFT_MPLSTUNNEL = 0x96 IFT_MSDSL = 0x8f IFT_MVL = 0xbf IFT_MYRINET = 0x63 IFT_NFAS = 0xaf IFT_NSIP = 0x1b IFT_OPTICALCHANNEL = 0xc3 IFT_OPTICALTRANSPORT = 0xc4 IFT_OTHER = 0x1 IFT_P10 = 0xc IFT_P80 = 0xd IFT_PARA = 0x22 IFT_PFLOG = 0xf5 IFT_PFSYNC = 0xf6 IFT_PLC = 0xae IFT_POS = 0xab IFT_PPP = 0x17 IFT_PPPMULTILINKBUNDLE = 0x6c IFT_PROPBWAP2MP = 0xb8 IFT_PROPCNLS = 0x59 IFT_PROPDOCSWIRELESSDOWNSTREAM = 0xb5 IFT_PROPDOCSWIRELESSMACLAYER = 0xb4 IFT_PROPDOCSWIRELESSUPSTREAM = 0xb6 IFT_PROPMUX = 0x36 IFT_PROPVIRTUAL = 0x35 IFT_PROPWIRELESSP2P = 0x9d IFT_PTPSERIAL = 0x16 IFT_PVC = 0xf1 IFT_QLLC = 0x44 IFT_RADIOMAC = 0xbc IFT_RADSL = 0x5f IFT_REACHDSL = 0xc0 IFT_RFC1483 = 0x9f IFT_RS232 = 0x21 IFT_RSRB = 0x4f IFT_SDLC = 0x11 IFT_SDSL = 0x60 IFT_SHDSL = 0xa9 IFT_SIP = 0x1f IFT_SLIP = 0x1c IFT_SMDSDXI = 0x2b IFT_SMDSICIP = 0x34 IFT_SONET = 0x27 IFT_SONETOVERHEADCHANNEL = 0xb9 IFT_SONETPATH = 0x32 IFT_SONETVT = 0x33 IFT_SRP = 0x97 IFT_SS7SIGLINK = 0x9c IFT_STACKTOSTACK = 0x6f IFT_STARLAN = 0xb IFT_STF = 0xf3 IFT_T1 = 0x12 IFT_TDLC = 0x74 IFT_TERMPAD = 0x5b IFT_TR008 = 0xb0 IFT_TRANSPHDLC = 0x7b IFT_TUNNEL = 0x83 IFT_ULTRA = 0x1d IFT_USB = 0xa0 IFT_V11 = 0x40 IFT_V35 = 0x2d IFT_V36 = 0x41 IFT_V37 = 0x78 IFT_VDSL = 0x61 IFT_VIRTUALIPADDRESS = 0x70 IFT_VOICEEM = 0x64 IFT_VOICEENCAP = 0x67 IFT_VOICEFXO = 0x65 IFT_VOICEFXS = 0x66 IFT_VOICEOVERATM = 0x98 IFT_VOICEOVERFRAMERELAY = 0x99 IFT_VOICEOVERIP = 0x68 IFT_X213 = 0x5d IFT_X25 = 0x5 IFT_X25DDN = 0x4 IFT_X25HUNTGROUP = 0x7a IFT_X25MLP = 0x79 IFT_X25PLE = 0x28 IFT_XETHER = 0x1a IGNBRK = 0x1 IGNCR = 0x80 IGNPAR = 0x4 IMAXBEL = 0x2000 INLCR = 0x40 INPCK = 0x10 IN_CLASSA_HOST = 0xffffff IN_CLASSA_MAX = 0x80 IN_CLASSA_NET = 0xff000000 IN_CLASSA_NSHIFT = 0x18 IN_CLASSB_HOST = 0xffff IN_CLASSB_MAX = 0x10000 IN_CLASSB_NET = 0xffff0000 IN_CLASSB_NSHIFT = 0x10 IN_CLASSC_HOST = 0xff IN_CLASSC_NET = 0xffffff00 IN_CLASSC_NSHIFT = 0x8 IN_CLASSD_HOST = 0xfffffff IN_CLASSD_NET = 0xf0000000 IN_CLASSD_NSHIFT = 0x1c IN_LOOPBACKNET = 0x7f IN_RFC3021_MASK = 0xfffffffe IPPROTO_3PC = 0x22 IPPROTO_ADFS = 0x44 IPPROTO_AH = 0x33 IPPROTO_AHIP = 0x3d IPPROTO_APES = 0x63 IPPROTO_ARGUS = 0xd IPPROTO_AX25 = 0x5d IPPROTO_BHA = 0x31 IPPROTO_BLT = 0x1e IPPROTO_BRSATMON = 0x4c IPPROTO_CARP = 0x70 IPPROTO_CFTP = 0x3e IPPROTO_CHAOS = 0x10 IPPROTO_CMTP = 0x26 IPPROTO_CPHB = 0x49 IPPROTO_CPNX = 0x48 IPPROTO_DDP = 0x25 IPPROTO_DGP = 0x56 IPPROTO_DIVERT = 0xfe IPPROTO_DONE = 0x101 IPPROTO_DSTOPTS = 0x3c IPPROTO_EGP = 0x8 IPPROTO_EMCON = 0xe IPPROTO_ENCAP = 0x62 IPPROTO_EON = 0x50 IPPROTO_ESP = 0x32 IPPROTO_ETHERIP = 0x61 IPPROTO_FRAGMENT = 0x2c IPPROTO_GGP = 0x3 IPPROTO_GMTP = 0x64 IPPROTO_GRE = 0x2f IPPROTO_HELLO = 0x3f IPPROTO_HMP = 0x14 IPPROTO_HOPOPTS = 0x0 IPPROTO_ICMP = 0x1 IPPROTO_ICMPV6 = 0x3a IPPROTO_IDP = 0x16 IPPROTO_IDPR = 0x23 IPPROTO_IDRP = 0x2d IPPROTO_IGMP = 0x2 IPPROTO_IGP = 0x55 IPPROTO_IGRP = 0x58 IPPROTO_IL = 0x28 IPPROTO_INLSP = 0x34 IPPROTO_INP = 0x20 IPPROTO_IP = 0x0 IPPROTO_IPCOMP = 0x6c IPPROTO_IPCV = 0x47 IPPROTO_IPEIP = 0x5e IPPROTO_IPIP = 0x4 IPPROTO_IPPC = 0x43 IPPROTO_IPV4 = 0x4 IPPROTO_IPV6 = 0x29 IPPROTO_IRTP = 0x1c IPPROTO_KRYPTOLAN = 0x41 IPPROTO_LARP = 0x5b IPPROTO_LEAF1 = 0x19 IPPROTO_LEAF2 = 0x1a IPPROTO_MAX = 0x100 IPPROTO_MAXID = 0x34 IPPROTO_MEAS = 0x13 IPPROTO_MHRP = 0x30 IPPROTO_MICP = 0x5f IPPROTO_MOBILE = 0x37 IPPROTO_MTP = 0x5c IPPROTO_MUX = 0x12 IPPROTO_ND = 0x4d IPPROTO_NHRP = 0x36 IPPROTO_NONE = 0x3b IPPROTO_NSP = 0x1f IPPROTO_NVPII = 0xb IPPROTO_OSPFIGP = 0x59 IPPROTO_PFSYNC = 0xf0 IPPROTO_PGM = 0x71 IPPROTO_PIGP = 0x9 IPPROTO_PIM = 0x67 IPPROTO_PRM = 0x15 IPPROTO_PUP = 0xc IPPROTO_PVP = 0x4b IPPROTO_RAW = 0xff IPPROTO_RCCMON = 0xa IPPROTO_RDP = 0x1b IPPROTO_ROUTING = 0x2b IPPROTO_RSVP = 0x2e IPPROTO_RVD = 0x42 IPPROTO_SATEXPAK = 0x40 IPPROTO_SATMON = 0x45 IPPROTO_SCCSP = 0x60 IPPROTO_SDRP = 0x2a IPPROTO_SEP = 0x21 IPPROTO_SKIP = 0x39 IPPROTO_SRPC = 0x5a IPPROTO_ST = 0x7 IPPROTO_SVMTP = 0x52 IPPROTO_SWIPE = 0x35 IPPROTO_TCF = 0x57 IPPROTO_TCP = 0x6 IPPROTO_TLSP = 0x38 IPPROTO_TP = 0x1d IPPROTO_TPXX = 0x27 IPPROTO_TRUNK1 = 0x17 IPPROTO_TRUNK2 = 0x18 IPPROTO_TTP = 0x54 IPPROTO_UDP = 0x11 IPPROTO_UNKNOWN = 0x102 IPPROTO_VINES = 0x53 IPPROTO_VISA = 0x46 IPPROTO_VMTP = 0x51 IPPROTO_WBEXPAK = 0x4f IPPROTO_WBMON = 0x4e IPPROTO_WSN = 0x4a IPPROTO_XNET = 0xf IPPROTO_XTP = 0x24 IPV6_AUTOFLOWLABEL = 0x3b IPV6_BINDV6ONLY = 0x1b IPV6_CHECKSUM = 0x1a IPV6_DEFAULT_MULTICAST_HOPS = 0x1 IPV6_DEFAULT_MULTICAST_LOOP = 0x1 IPV6_DEFHLIM = 0x40 IPV6_DONTFRAG = 0x3e IPV6_DSTOPTS = 0x32 IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_MASK = 0xffff0f00 IPV6_FRAGTTL = 0x78 IPV6_FW_ADD = 0x1e IPV6_FW_DEL = 0x1f IPV6_FW_FLUSH = 0x20 IPV6_FW_GET = 0x22 IPV6_FW_ZERO = 0x21 IPV6_HLIMDEC = 0x1 IPV6_HOPLIMIT = 0x2f IPV6_HOPOPTS = 0x31 IPV6_JOIN_GROUP = 0xc IPV6_LEAVE_GROUP = 0xd IPV6_MAXHLIM = 0xff IPV6_MAXPACKET = 0xffff IPV6_MINHLIM = 0x28 IPV6_MMTU = 0x500 IPV6_MSFILTER = 0x4a IPV6_MULTICAST_HOPS = 0xa IPV6_MULTICAST_IF = 0x9 IPV6_MULTICAST_LOOP = 0xb IPV6_NEXTHOP = 0x30 IPV6_PATHMTU = 0x2c IPV6_PKTINFO = 0x2e IPV6_PKTOPTIONS = 0x34 IPV6_PORTRANGE = 0xe IPV6_PORTRANGE_DEFAULT = 0x0 IPV6_PORTRANGE_HIGH = 0x1 IPV6_PORTRANGE_LOW = 0x2 IPV6_PREFER_TEMPADDR = 0x3f IPV6_RECVDSTOPTS = 0x28 IPV6_RECVHOPLIMIT = 0x25 IPV6_RECVHOPOPTS = 0x27 IPV6_RECVPATHMTU = 0x2b IPV6_RECVPKTINFO = 0x24 IPV6_RECVRTHDR = 0x26 IPV6_RECVTCLASS = 0x39 IPV6_RTHDR = 0x33 IPV6_RTHDRDSTOPTS = 0x23 IPV6_RTHDR_LOOSE = 0x0 IPV6_RTHDR_STRICT = 0x1 IPV6_RTHDR_TYPE_0 = 0x0 IPV6_SOCKOPT_RESERVED1 = 0x3 IPV6_TCLASS = 0x3d IPV6_UNICAST_HOPS = 0x4 IPV6_USE_MIN_MTU = 0x2a IPV6_V6ONLY = 0x1b IPV6_VERSION = 0x60 IPV6_VERSION_MASK = 0xf0 IP_ADD_MEMBERSHIP = 0xc IP_DEFAULT_MULTICAST_LOOP = 0x1 IP_DEFAULT_MULTICAST_TTL = 0x1 IP_DF = 0x4000 IP_DROP_MEMBERSHIP = 0xd IP_DUMMYNET_CONFIGURE = 0x3c IP_DUMMYNET_DEL = 0x3d IP_DUMMYNET_FLUSH = 0x3e IP_DUMMYNET_GET = 0x40 IP_FW_ADD = 0x32 IP_FW_DEL = 0x33 IP_FW_FLUSH = 0x34 IP_FW_GET = 0x36 IP_FW_RESETLOG = 0x37 IP_FW_TBL_ADD = 0x2a IP_FW_TBL_CREATE = 0x28 IP_FW_TBL_DEL = 0x2b IP_FW_TBL_DESTROY = 0x29 IP_FW_TBL_EXPIRE = 0x2f IP_FW_TBL_FLUSH = 0x2c IP_FW_TBL_GET = 0x2d IP_FW_TBL_ZERO = 0x2e IP_FW_X = 0x31 IP_FW_ZERO = 0x35 IP_HDRINCL = 0x2 IP_MAXPACKET = 0xffff IP_MAX_MEMBERSHIPS = 0x14 IP_MF = 0x2000 IP_MINTTL = 0x42 IP_MSS = 0x240 IP_MULTICAST_IF = 0x9 IP_MULTICAST_LOOP = 0xb IP_MULTICAST_TTL = 0xa IP_MULTICAST_VIF = 0xe IP_OFFMASK = 0x1fff IP_OPTIONS = 0x1 IP_PORTRANGE = 0x13 IP_PORTRANGE_DEFAULT = 0x0 IP_PORTRANGE_HIGH = 0x1 IP_PORTRANGE_LOW = 0x2 IP_RECVDSTADDR = 0x7 IP_RECVIF = 0x14 IP_RECVOPTS = 0x5 IP_RECVRETOPTS = 0x6 IP_RECVTTL = 0x41 IP_RETOPTS = 0x8 IP_RF = 0x8000 IP_RSVP_OFF = 0x10 IP_RSVP_ON = 0xf IP_RSVP_VIF_OFF = 0x12 IP_RSVP_VIF_ON = 0x11 IP_TOS = 0x3 IP_TTL = 0x4 ISIG = 0x80 ISTRIP = 0x20 IXANY = 0x800 IXOFF = 0x400 IXON = 0x200 KERN_HOSTNAME = 0xa KERN_OSRELEASE = 0x2 KERN_OSTYPE = 0x1 KERN_VERSION = 0x4 LOCK_EX = 0x2 LOCK_NB = 0x4 LOCK_SH = 0x1 LOCK_UN = 0x8 MADV_AUTOSYNC = 0x7 MADV_CONTROL_END = 0xb MADV_CONTROL_START = 0xa MADV_CORE = 0x9 MADV_DONTNEED = 0x4 MADV_FREE = 0x5 MADV_INVAL = 0xa MADV_NOCORE = 0x8 MADV_NORMAL = 0x0 MADV_NOSYNC = 0x6 MADV_RANDOM = 0x1 MADV_SEQUENTIAL = 0x2 MADV_SETMAP = 0xb MADV_WILLNEED = 0x3 MAP_ANON = 0x1000 MAP_ANONYMOUS = 0x1000 MAP_COPY = 0x2 MAP_FILE = 0x0 MAP_FIXED = 0x10 MAP_HASSEMAPHORE = 0x200 MAP_INHERIT = 0x80 MAP_NOCORE = 0x20000 MAP_NOEXTEND = 0x100 MAP_NORESERVE = 0x40 MAP_NOSYNC = 0x800 MAP_PRIVATE = 0x2 MAP_RENAME = 0x20 MAP_SHARED = 0x1 MAP_SIZEALIGN = 0x40000 MAP_STACK = 0x400 MAP_TRYFIXED = 0x10000 MAP_VPAGETABLE = 0x2000 MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MNT_ASYNC = 0x40 MNT_AUTOMOUNTED = 0x20 MNT_CMDFLAGS = 0xf0000 MNT_DEFEXPORTED = 0x200 MNT_DELEXPORT = 0x20000 MNT_EXKERB = 0x800 MNT_EXPORTANON = 0x400 MNT_EXPORTED = 0x100 MNT_EXPUBLIC = 0x20000000 MNT_EXRDONLY = 0x80 MNT_FORCE = 0x80000 MNT_IGNORE = 0x800000 MNT_LAZY = 0x4 MNT_LOCAL = 0x1000 MNT_NOATIME = 0x10000000 MNT_NOCLUSTERR = 0x40000000 MNT_NOCLUSTERW = 0x80000000 MNT_NODEV = 0x10 MNT_NOEXEC = 0x4 MNT_NOSUID = 0x8 MNT_NOSYMFOLLOW = 0x400000 MNT_NOWAIT = 0x2 MNT_QUOTA = 0x2000 MNT_RDONLY = 0x1 MNT_RELOAD = 0x40000 MNT_ROOTFS = 0x4000 MNT_SOFTDEP = 0x200000 MNT_SUIDDIR = 0x100000 MNT_SYNCHRONOUS = 0x2 MNT_TRIM = 0x1000000 MNT_UPDATE = 0x10000 MNT_USER = 0x8000 MNT_VISFLAGMASK = 0xf1f0ffff MNT_WAIT = 0x1 MSG_CMSG_CLOEXEC = 0x1000 MSG_CTRUNC = 0x20 MSG_DONTROUTE = 0x4 MSG_DONTWAIT = 0x80 MSG_EOF = 0x100 MSG_EOR = 0x8 MSG_FBLOCKING = 0x10000 MSG_FMASK = 0xffff0000 MSG_FNONBLOCKING = 0x20000 MSG_NOSIGNAL = 0x400 MSG_OOB = 0x1 MSG_PEEK = 0x2 MSG_SYNC = 0x800 MSG_TRUNC = 0x10 MSG_UNUSED09 = 0x200 MSG_WAITALL = 0x40 MS_ASYNC = 0x1 MS_INVALIDATE = 0x2 MS_SYNC = 0x0 NAME_MAX = 0xff NET_RT_DUMP = 0x1 NET_RT_FLAGS = 0x2 NET_RT_IFLIST = 0x3 NET_RT_MAXID = 0x4 NFDBITS = 0x40 NOFLSH = 0x80000000 NOKERNINFO = 0x2000000 NOTE_ATTRIB = 0x8 NOTE_CHILD = 0x4 NOTE_DELETE = 0x1 NOTE_EXEC = 0x20000000 NOTE_EXIT = 0x80000000 NOTE_EXTEND = 0x4 NOTE_FFAND = 0x40000000 NOTE_FFCOPY = 0xc0000000 NOTE_FFCTRLMASK = 0xc0000000 NOTE_FFLAGSMASK = 0xffffff NOTE_FFNOP = 0x0 NOTE_FFOR = 0x80000000 NOTE_FORK = 0x40000000 NOTE_LINK = 0x10 NOTE_LOWAT = 0x1 NOTE_OOB = 0x2 NOTE_PCTRLMASK = 0xf0000000 NOTE_PDATAMASK = 0xfffff NOTE_RENAME = 0x20 NOTE_REVOKE = 0x40 NOTE_TRACK = 0x1 NOTE_TRACKERR = 0x2 NOTE_TRIGGER = 0x1000000 NOTE_WRITE = 0x2 OCRNL = 0x10 ONLCR = 0x2 ONLRET = 0x40 ONOCR = 0x20 ONOEOT = 0x8 OPOST = 0x1 OXTABS = 0x4 O_ACCMODE = 0x3 O_APPEND = 0x8 O_ASYNC = 0x40 O_CLOEXEC = 0x20000 O_CREAT = 0x200 O_DIRECT = 0x10000 O_DIRECTORY = 0x8000000 O_EXCL = 0x800 O_EXLOCK = 0x20 O_FAPPEND = 0x100000 O_FASYNCWRITE = 0x800000 O_FBLOCKING = 0x40000 O_FMASK = 0xfc0000 O_FNONBLOCKING = 0x80000 O_FOFFSET = 0x200000 O_FSYNC = 0x80 O_FSYNCWRITE = 0x400000 O_NDELAY = 0x4 O_NOCTTY = 0x8000 O_NOFOLLOW = 0x100 O_NONBLOCK = 0x4 O_RDONLY = 0x0 O_RDWR = 0x2 O_SHLOCK = 0x10 O_SYNC = 0x80 O_TRUNC = 0x400 O_WRONLY = 0x1 PARENB = 0x1000 PARMRK = 0x8 PARODD = 0x2000 PENDIN = 0x20000000 PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 PROT_EXEC = 0x4 PROT_NONE = 0x0 PROT_READ = 0x1 PROT_WRITE = 0x2 RLIMIT_AS = 0xa RLIMIT_CORE = 0x4 RLIMIT_CPU = 0x0 RLIMIT_DATA = 0x2 RLIMIT_FSIZE = 0x1 RLIMIT_MEMLOCK = 0x6 RLIMIT_NOFILE = 0x8 RLIMIT_NPROC = 0x7 RLIMIT_RSS = 0x5 RLIMIT_STACK = 0x3 RLIM_INFINITY = 0x7fffffffffffffff RTAX_AUTHOR = 0x6 RTAX_BRD = 0x7 RTAX_DST = 0x0 RTAX_GATEWAY = 0x1 RTAX_GENMASK = 0x3 RTAX_IFA = 0x5 RTAX_IFP = 0x4 RTAX_MAX = 0xb RTAX_MPLS1 = 0x8 RTAX_MPLS2 = 0x9 RTAX_MPLS3 = 0xa RTAX_NETMASK = 0x2 RTA_AUTHOR = 0x40 RTA_BRD = 0x80 RTA_DST = 0x1 RTA_GATEWAY = 0x2 RTA_GENMASK = 0x8 RTA_IFA = 0x20 RTA_IFP = 0x10 RTA_MPLS1 = 0x100 RTA_MPLS2 = 0x200 RTA_MPLS3 = 0x400 RTA_NETMASK = 0x4 RTF_BLACKHOLE = 0x1000 RTF_BROADCAST = 0x400000 RTF_CLONING = 0x100 RTF_DONE = 0x40 RTF_DYNAMIC = 0x10 RTF_GATEWAY = 0x2 RTF_HOST = 0x4 RTF_LLINFO = 0x400 RTF_LOCAL = 0x200000 RTF_MODIFIED = 0x20 RTF_MPLSOPS = 0x1000000 RTF_MULTICAST = 0x800000 RTF_PINNED = 0x100000 RTF_PRCLONING = 0x10000 RTF_PROTO1 = 0x8000 RTF_PROTO2 = 0x4000 RTF_PROTO3 = 0x40000 RTF_REJECT = 0x8 RTF_STATIC = 0x800 RTF_UP = 0x1 RTF_WASCLONED = 0x20000 RTF_XRESOLVE = 0x200 RTM_ADD = 0x1 RTM_CHANGE = 0x3 RTM_DELADDR = 0xd RTM_DELETE = 0x2 RTM_DELMADDR = 0x10 RTM_GET = 0x4 RTM_IEEE80211 = 0x12 RTM_IFANNOUNCE = 0x11 RTM_IFINFO = 0xe RTM_LOCK = 0x8 RTM_LOSING = 0x5 RTM_MISS = 0x7 RTM_NEWADDR = 0xc RTM_NEWMADDR = 0xf RTM_REDIRECT = 0x6 RTM_RESOLVE = 0xb RTM_RTTUNIT = 0xf4240 RTM_VERSION = 0x7 RTV_EXPIRE = 0x4 RTV_HOPCOUNT = 0x2 RTV_IWCAPSEGS = 0x400 RTV_IWMAXSEGS = 0x200 RTV_MSL = 0x100 RTV_MTU = 0x1 RTV_RPIPE = 0x8 RTV_RTT = 0x40 RTV_RTTVAR = 0x80 RTV_SPIPE = 0x10 RTV_SSTHRESH = 0x20 RUSAGE_CHILDREN = -0x1 RUSAGE_SELF = 0x0 SCM_CREDS = 0x3 SCM_RIGHTS = 0x1 SCM_TIMESTAMP = 0x2 SHUT_RD = 0x0 SHUT_RDWR = 0x2 SHUT_WR = 0x1 SIOCADDMULTI = 0x80206931 SIOCAIFADDR = 0x8040691a SIOCAIFGROUP = 0x80286987 SIOCALIFADDR = 0x8118691b SIOCATMARK = 0x40047307 SIOCDELMULTI = 0x80206932 SIOCDIFADDR = 0x80206919 SIOCDIFGROUP = 0x80286989 SIOCDIFPHYADDR = 0x80206949 SIOCDLIFADDR = 0x8118691d SIOCGDRVSPEC = 0xc028697b SIOCGETSGCNT = 0xc0207210 SIOCGETVIFCNT = 0xc028720f SIOCGHIWAT = 0x40047301 SIOCGIFADDR = 0xc0206921 SIOCGIFALIAS = 0xc0406929 SIOCGIFBRDADDR = 0xc0206923 SIOCGIFCAP = 0xc020691f SIOCGIFCONF = 0xc0106924 SIOCGIFDATA = 0xc0206926 SIOCGIFDSTADDR = 0xc0206922 SIOCGIFFLAGS = 0xc0206911 SIOCGIFGENERIC = 0xc020693a SIOCGIFGMEMB = 0xc028698a SIOCGIFGROUP = 0xc0286988 SIOCGIFINDEX = 0xc0206920 SIOCGIFMEDIA = 0xc0306938 SIOCGIFMETRIC = 0xc0206917 SIOCGIFMTU = 0xc0206933 SIOCGIFNETMASK = 0xc0206925 SIOCGIFPDSTADDR = 0xc0206948 SIOCGIFPHYS = 0xc0206935 SIOCGIFPOLLCPU = 0xc020697e SIOCGIFPSRCADDR = 0xc0206947 SIOCGIFSTATUS = 0xc331693b SIOCGIFTSOLEN = 0xc0206980 SIOCGLIFADDR = 0xc118691c SIOCGLIFPHYADDR = 0xc118694b SIOCGLOWAT = 0x40047303 SIOCGPGRP = 0x40047309 SIOCGPRIVATE_0 = 0xc0206950 SIOCGPRIVATE_1 = 0xc0206951 SIOCIFCREATE = 0xc020697a SIOCIFCREATE2 = 0xc020697c SIOCIFDESTROY = 0x80206979 SIOCIFGCLONERS = 0xc0106978 SIOCSDRVSPEC = 0x8028697b SIOCSHIWAT = 0x80047300 SIOCSIFADDR = 0x8020690c SIOCSIFBRDADDR = 0x80206913 SIOCSIFCAP = 0x8020691e SIOCSIFDSTADDR = 0x8020690e SIOCSIFFLAGS = 0x80206910 SIOCSIFGENERIC = 0x80206939 SIOCSIFLLADDR = 0x8020693c SIOCSIFMEDIA = 0xc0206937 SIOCSIFMETRIC = 0x80206918 SIOCSIFMTU = 0x80206934 SIOCSIFNAME = 0x80206928 SIOCSIFNETMASK = 0x80206916 SIOCSIFPHYADDR = 0x80406946 SIOCSIFPHYS = 0x80206936 SIOCSIFPOLLCPU = 0x8020697d SIOCSIFTSOLEN = 0x8020697f SIOCSLIFPHYADDR = 0x8118694a SIOCSLOWAT = 0x80047302 SIOCSPGRP = 0x80047308 SOCK_CLOEXEC = 0x10000000 SOCK_DGRAM = 0x2 SOCK_MAXADDRLEN = 0xff SOCK_NONBLOCK = 0x20000000 SOCK_RAW = 0x3 SOCK_RDM = 0x4 SOCK_SEQPACKET = 0x5 SOCK_STREAM = 0x1 SOL_SOCKET = 0xffff SOMAXCONN = 0x80 SO_ACCEPTCONN = 0x2 SO_ACCEPTFILTER = 0x1000 SO_BROADCAST = 0x20 SO_CPUHINT = 0x1030 SO_DEBUG = 0x1 SO_DONTROUTE = 0x10 SO_ERROR = 0x1007 SO_KEEPALIVE = 0x8 SO_LINGER = 0x80 SO_NOSIGPIPE = 0x800 SO_OOBINLINE = 0x100 SO_RCVBUF = 0x1002 SO_RCVLOWAT = 0x1004 SO_RCVTIMEO = 0x1006 SO_RERROR = 0x2000 SO_REUSEADDR = 0x4 SO_REUSEPORT = 0x200 SO_SNDBUF = 0x1001 SO_SNDLOWAT = 0x1003 SO_SNDSPACE = 0x100a SO_SNDTIMEO = 0x1005 SO_TIMESTAMP = 0x400 SO_TYPE = 0x1008 SO_USELOOPBACK = 0x40 S_BLKSIZE = 0x200 S_IEXEC = 0x40 S_IFBLK = 0x6000 S_IFCHR = 0x2000 S_IFDB = 0x9000 S_IFDIR = 0x4000 S_IFIFO = 0x1000 S_IFLNK = 0xa000 S_IFMT = 0xf000 S_IFREG = 0x8000 S_IFSOCK = 0xc000 S_IFWHT = 0xe000 S_IREAD = 0x100 S_IRGRP = 0x20 S_IROTH = 0x4 S_IRUSR = 0x100 S_IRWXG = 0x38 S_IRWXO = 0x7 S_IRWXU = 0x1c0 S_ISGID = 0x400 S_ISTXT = 0x200 S_ISUID = 0x800 S_ISVTX = 0x200 S_IWGRP = 0x10 S_IWOTH = 0x2 S_IWRITE = 0x80 S_IWUSR = 0x80 S_IXGRP = 0x8 S_IXOTH = 0x1 S_IXUSR = 0x40 TAB0 = 0x0 TAB3 = 0x4 TABDLY = 0x4 TCIFLUSH = 0x1 TCIOFF = 0x3 TCIOFLUSH = 0x3 TCION = 0x4 TCOFLUSH = 0x2 TCOOFF = 0x1 TCOON = 0x2 TCP_FASTKEEP = 0x80 TCP_KEEPCNT = 0x400 TCP_KEEPIDLE = 0x100 TCP_KEEPINIT = 0x20 TCP_KEEPINTVL = 0x200 TCP_MAXBURST = 0x4 TCP_MAXHLEN = 0x3c TCP_MAXOLEN = 0x28 TCP_MAXSEG = 0x2 TCP_MAXWIN = 0xffff TCP_MAX_WINSHIFT = 0xe TCP_MINMSS = 0x100 TCP_MIN_WINSHIFT = 0x5 TCP_MSS = 0x200 TCP_NODELAY = 0x1 TCP_NOOPT = 0x8 TCP_NOPUSH = 0x4 TCP_SIGNATURE_ENABLE = 0x10 TCSAFLUSH = 0x2 TIMER_ABSTIME = 0x1 TIMER_RELTIME = 0x0 TIOCCBRK = 0x2000747a TIOCCDTR = 0x20007478 TIOCCONS = 0x80047462 TIOCDCDTIMESTAMP = 0x40107458 TIOCDRAIN = 0x2000745e TIOCEXCL = 0x2000740d TIOCEXT = 0x80047460 TIOCFLUSH = 0x80047410 TIOCGDRAINWAIT = 0x40047456 TIOCGETA = 0x402c7413 TIOCGETD = 0x4004741a TIOCGPGRP = 0x40047477 TIOCGSID = 0x40047463 TIOCGWINSZ = 0x40087468 TIOCISPTMASTER = 0x20007455 TIOCMBIC = 0x8004746b TIOCMBIS = 0x8004746c TIOCMGDTRWAIT = 0x4004745a TIOCMGET = 0x4004746a TIOCMODG = 0x40047403 TIOCMODS = 0x80047404 TIOCMSDTRWAIT = 0x8004745b TIOCMSET = 0x8004746d TIOCM_CAR = 0x40 TIOCM_CD = 0x40 TIOCM_CTS = 0x20 TIOCM_DSR = 0x100 TIOCM_DTR = 0x2 TIOCM_LE = 0x1 TIOCM_RI = 0x80 TIOCM_RNG = 0x80 TIOCM_RTS = 0x4 TIOCM_SR = 0x10 TIOCM_ST = 0x8 TIOCNOTTY = 0x20007471 TIOCNXCL = 0x2000740e TIOCOUTQ = 0x40047473 TIOCPKT = 0x80047470 TIOCPKT_DATA = 0x0 TIOCPKT_DOSTOP = 0x20 TIOCPKT_FLUSHREAD = 0x1 TIOCPKT_FLUSHWRITE = 0x2 TIOCPKT_IOCTL = 0x40 TIOCPKT_NOSTOP = 0x10 TIOCPKT_START = 0x8 TIOCPKT_STOP = 0x4 TIOCREMOTE = 0x80047469 TIOCSBRK = 0x2000747b TIOCSCTTY = 0x20007461 TIOCSDRAINWAIT = 0x80047457 TIOCSDTR = 0x20007479 TIOCSETA = 0x802c7414 TIOCSETAF = 0x802c7416 TIOCSETAW = 0x802c7415 TIOCSETD = 0x8004741b TIOCSIG = 0x2000745f TIOCSPGRP = 0x80047476 TIOCSTART = 0x2000746e TIOCSTAT = 0x20007465 TIOCSTI = 0x80017472 TIOCSTOP = 0x2000746f TIOCSWINSZ = 0x80087467 TIOCTIMESTAMP = 0x40107459 TIOCUCNTL = 0x80047466 TOSTOP = 0x400000 UTIME_NOW = -0x1 UTIME_OMIT = -0x2 VCHECKPT = 0x13 VDISCARD = 0xf VDSUSP = 0xb VEOF = 0x0 VEOL = 0x1 VEOL2 = 0x2 VERASE = 0x3 VERASE2 = 0x7 VINTR = 0x8 VKILL = 0x5 VLNEXT = 0xe VMIN = 0x10 VM_BCACHE_SIZE_MAX = 0x0 VM_SWZONE_SIZE_MAX = 0x4000000000 VQUIT = 0x9 VREPRINT = 0x6 VSTART = 0xc VSTATUS = 0x12 VSTOP = 0xd VSUSP = 0xa VTIME = 0x11 VWERASE = 0x4 WCONTINUED = 0x4 WCOREFLAG = 0x80 WEXITED = 0x10 WLINUXCLONE = 0x80000000 WNOHANG = 0x1 WNOWAIT = 0x8 WSTOPPED = 0x2 WTRAPPED = 0x20 WUNTRACED = 0x2 ) // Errors const ( E2BIG = syscall.Errno(0x7) EACCES = syscall.Errno(0xd) EADDRINUSE = syscall.Errno(0x30) EADDRNOTAVAIL = syscall.Errno(0x31) EAFNOSUPPORT = syscall.Errno(0x2f) EAGAIN = syscall.Errno(0x23) EALREADY = syscall.Errno(0x25) EASYNC = syscall.Errno(0x63) EAUTH = syscall.Errno(0x50) EBADF = syscall.Errno(0x9) EBADMSG = syscall.Errno(0x59) EBADRPC = syscall.Errno(0x48) EBUSY = syscall.Errno(0x10) ECANCELED = syscall.Errno(0x55) ECHILD = syscall.Errno(0xa) ECONNABORTED = syscall.Errno(0x35) ECONNREFUSED = syscall.Errno(0x3d) ECONNRESET = syscall.Errno(0x36) EDEADLK = syscall.Errno(0xb) EDESTADDRREQ = syscall.Errno(0x27) EDOM = syscall.Errno(0x21) EDOOFUS = syscall.Errno(0x58) EDQUOT = syscall.Errno(0x45) EEXIST = syscall.Errno(0x11) EFAULT = syscall.Errno(0xe) EFBIG = syscall.Errno(0x1b) EFTYPE = syscall.Errno(0x4f) EHOSTDOWN = syscall.Errno(0x40) EHOSTUNREACH = syscall.Errno(0x41) EIDRM = syscall.Errno(0x52) EILSEQ = syscall.Errno(0x56) EINPROGRESS = syscall.Errno(0x24) EINTR = syscall.Errno(0x4) EINVAL = syscall.Errno(0x16) EIO = syscall.Errno(0x5) EISCONN = syscall.Errno(0x38) EISDIR = syscall.Errno(0x15) ELAST = syscall.Errno(0x63) ELOOP = syscall.Errno(0x3e) EMFILE = syscall.Errno(0x18) EMLINK = syscall.Errno(0x1f) EMSGSIZE = syscall.Errno(0x28) EMULTIHOP = syscall.Errno(0x5a) ENAMETOOLONG = syscall.Errno(0x3f) ENEEDAUTH = syscall.Errno(0x51) ENETDOWN = syscall.Errno(0x32) ENETRESET = syscall.Errno(0x34) ENETUNREACH = syscall.Errno(0x33) ENFILE = syscall.Errno(0x17) ENOATTR = syscall.Errno(0x57) ENOBUFS = syscall.Errno(0x37) ENODEV = syscall.Errno(0x13) ENOENT = syscall.Errno(0x2) ENOEXEC = syscall.Errno(0x8) ENOLCK = syscall.Errno(0x4d) ENOLINK = syscall.Errno(0x5b) ENOMEDIUM = syscall.Errno(0x5d) ENOMEM = syscall.Errno(0xc) ENOMSG = syscall.Errno(0x53) ENOPROTOOPT = syscall.Errno(0x2a) ENOSPC = syscall.Errno(0x1c) ENOSYS = syscall.Errno(0x4e) ENOTBLK = syscall.Errno(0xf) ENOTCONN = syscall.Errno(0x39) ENOTDIR = syscall.Errno(0x14) ENOTEMPTY = syscall.Errno(0x42) ENOTSOCK = syscall.Errno(0x26) ENOTSUP = syscall.Errno(0x2d) ENOTTY = syscall.Errno(0x19) ENXIO = syscall.Errno(0x6) EOPNOTSUPP = syscall.Errno(0x2d) EOVERFLOW = syscall.Errno(0x54) EPERM = syscall.Errno(0x1) EPFNOSUPPORT = syscall.Errno(0x2e) EPIPE = syscall.Errno(0x20) EPROCLIM = syscall.Errno(0x43) EPROCUNAVAIL = syscall.Errno(0x4c) EPROGMISMATCH = syscall.Errno(0x4b) EPROGUNAVAIL = syscall.Errno(0x4a) EPROTO = syscall.Errno(0x5c) EPROTONOSUPPORT = syscall.Errno(0x2b) EPROTOTYPE = syscall.Errno(0x29) ERANGE = syscall.Errno(0x22) EREMOTE = syscall.Errno(0x47) EROFS = syscall.Errno(0x1e) ERPCMISMATCH = syscall.Errno(0x49) ESHUTDOWN = syscall.Errno(0x3a) ESOCKTNOSUPPORT = syscall.Errno(0x2c) ESPIPE = syscall.Errno(0x1d) ESRCH = syscall.Errno(0x3) ESTALE = syscall.Errno(0x46) ETIMEDOUT = syscall.Errno(0x3c) ETOOMANYREFS = syscall.Errno(0x3b) ETXTBSY = syscall.Errno(0x1a) EUSERS = syscall.Errno(0x44) EWOULDBLOCK = syscall.Errno(0x23) EXDEV = syscall.Errno(0x12) ) // Signals const ( SIGABRT = syscall.Signal(0x6) SIGALRM = syscall.Signal(0xe) SIGBUS = syscall.Signal(0xa) SIGCHLD = syscall.Signal(0x14) SIGCKPT = syscall.Signal(0x21) SIGCKPTEXIT = syscall.Signal(0x22) SIGCONT = syscall.Signal(0x13) SIGEMT = syscall.Signal(0x7) SIGFPE = syscall.Signal(0x8) SIGHUP = syscall.Signal(0x1) SIGILL = syscall.Signal(0x4) SIGINFO = syscall.Signal(0x1d) SIGINT = syscall.Signal(0x2) SIGIO = syscall.Signal(0x17) SIGIOT = syscall.Signal(0x6) SIGKILL = syscall.Signal(0x9) SIGPIPE = syscall.Signal(0xd) SIGPROF = syscall.Signal(0x1b) SIGQUIT = syscall.Signal(0x3) SIGSEGV = syscall.Signal(0xb) SIGSTOP = syscall.Signal(0x11) SIGSYS = syscall.Signal(0xc) SIGTERM = syscall.Signal(0xf) SIGTHR = syscall.Signal(0x20) SIGTRAP = syscall.Signal(0x5) SIGTSTP = syscall.Signal(0x12) SIGTTIN = syscall.Signal(0x15) SIGTTOU = syscall.Signal(0x16) SIGURG = syscall.Signal(0x10) SIGUSR1 = syscall.Signal(0x1e) SIGUSR2 = syscall.Signal(0x1f) SIGVTALRM = syscall.Signal(0x1a) SIGWINCH = syscall.Signal(0x1c) SIGXCPU = syscall.Signal(0x18) SIGXFSZ = syscall.Signal(0x19) ) // Error table var errorList = [...]struct { num syscall.Errno name string desc string }{ {1, "EPERM", "operation not permitted"}, {2, "ENOENT", "no such file or directory"}, {3, "ESRCH", "no such process"}, {4, "EINTR", "interrupted system call"}, {5, "EIO", "input/output error"}, {6, "ENXIO", "device not configured"}, {7, "E2BIG", "argument list too long"}, {8, "ENOEXEC", "exec format error"}, {9, "EBADF", "bad file descriptor"}, {10, "ECHILD", "no child processes"}, {11, "EDEADLK", "resource deadlock avoided"}, {12, "ENOMEM", "cannot allocate memory"}, {13, "EACCES", "permission denied"}, {14, "EFAULT", "bad address"}, {15, "ENOTBLK", "block device required"}, {16, "EBUSY", "device busy"}, {17, "EEXIST", "file exists"}, {18, "EXDEV", "cross-device link"}, {19, "ENODEV", "operation not supported by device"}, {20, "ENOTDIR", "not a directory"}, {21, "EISDIR", "is a directory"}, {22, "EINVAL", "invalid argument"}, {23, "ENFILE", "too many open files in system"}, {24, "EMFILE", "too many open files"}, {25, "ENOTTY", "inappropriate ioctl for device"}, {26, "ETXTBSY", "text file busy"}, {27, "EFBIG", "file too large"}, {28, "ENOSPC", "no space left on device"}, {29, "ESPIPE", "illegal seek"}, {30, "EROFS", "read-only file system"}, {31, "EMLINK", "too many links"}, {32, "EPIPE", "broken pipe"}, {33, "EDOM", "numerical argument out of domain"}, {34, "ERANGE", "result too large"}, {35, "EWOULDBLOCK", "resource temporarily unavailable"}, {36, "EINPROGRESS", "operation now in progress"}, {37, "EALREADY", "operation already in progress"}, {38, "ENOTSOCK", "socket operation on non-socket"}, {39, "EDESTADDRREQ", "destination address required"}, {40, "EMSGSIZE", "message too long"}, {41, "EPROTOTYPE", "protocol wrong type for socket"}, {42, "ENOPROTOOPT", "protocol not available"}, {43, "EPROTONOSUPPORT", "protocol not supported"}, {44, "ESOCKTNOSUPPORT", "socket type not supported"}, {45, "EOPNOTSUPP", "operation not supported"}, {46, "EPFNOSUPPORT", "protocol family not supported"}, {47, "EAFNOSUPPORT", "address family not supported by protocol family"}, {48, "EADDRINUSE", "address already in use"}, {49, "EADDRNOTAVAIL", "can't assign requested address"}, {50, "ENETDOWN", "network is down"}, {51, "ENETUNREACH", "network is unreachable"}, {52, "ENETRESET", "network dropped connection on reset"}, {53, "ECONNABORTED", "software caused connection abort"}, {54, "ECONNRESET", "connection reset by peer"}, {55, "ENOBUFS", "no buffer space available"}, {56, "EISCONN", "socket is already connected"}, {57, "ENOTCONN", "socket is not connected"}, {58, "ESHUTDOWN", "can't send after socket shutdown"}, {59, "ETOOMANYREFS", "too many references: can't splice"}, {60, "ETIMEDOUT", "operation timed out"}, {61, "ECONNREFUSED", "connection refused"}, {62, "ELOOP", "too many levels of symbolic links"}, {63, "ENAMETOOLONG", "file name too long"}, {64, "EHOSTDOWN", "host is down"}, {65, "EHOSTUNREACH", "no route to host"}, {66, "ENOTEMPTY", "directory not empty"}, {67, "EPROCLIM", "too many processes"}, {68, "EUSERS", "too many users"}, {69, "EDQUOT", "disc quota exceeded"}, {70, "ESTALE", "stale NFS file handle"}, {71, "EREMOTE", "too many levels of remote in path"}, {72, "EBADRPC", "RPC struct is bad"}, {73, "ERPCMISMATCH", "RPC version wrong"}, {74, "EPROGUNAVAIL", "RPC prog. not avail"}, {75, "EPROGMISMATCH", "program version wrong"}, {76, "EPROCUNAVAIL", "bad procedure for program"}, {77, "ENOLCK", "no locks available"}, {78, "ENOSYS", "function not implemented"}, {79, "EFTYPE", "inappropriate file type or format"}, {80, "EAUTH", "authentication error"}, {81, "ENEEDAUTH", "need authenticator"}, {82, "EIDRM", "identifier removed"}, {83, "ENOMSG", "no message of desired type"}, {84, "EOVERFLOW", "value too large to be stored in data type"}, {85, "ECANCELED", "operation canceled"}, {86, "EILSEQ", "illegal byte sequence"}, {87, "ENOATTR", "attribute not found"}, {88, "EDOOFUS", "programming error"}, {89, "EBADMSG", "bad message"}, {90, "EMULTIHOP", "multihop attempted"}, {91, "ENOLINK", "link has been severed"}, {92, "EPROTO", "protocol error"}, {93, "ENOMEDIUM", "no medium found"}, {99, "EASYNC", "unknown error: 99"}, } // Signal table var signalList = [...]struct { num syscall.Signal name string desc string }{ {1, "SIGHUP", "hangup"}, {2, "SIGINT", "interrupt"}, {3, "SIGQUIT", "quit"}, {4, "SIGILL", "illegal instruction"}, {5, "SIGTRAP", "trace/BPT trap"}, {6, "SIGIOT", "abort trap"}, {7, "SIGEMT", "EMT trap"}, {8, "SIGFPE", "floating point exception"}, {9, "SIGKILL", "killed"}, {10, "SIGBUS", "bus error"}, {11, "SIGSEGV", "segmentation fault"}, {12, "SIGSYS", "bad system call"}, {13, "SIGPIPE", "broken pipe"}, {14, "SIGALRM", "alarm clock"}, {15, "SIGTERM", "terminated"}, {16, "SIGURG", "urgent I/O condition"}, {17, "SIGSTOP", "suspended (signal)"}, {18, "SIGTSTP", "suspended"}, {19, "SIGCONT", "continued"}, {20, "SIGCHLD", "child exited"}, {21, "SIGTTIN", "stopped (tty input)"}, {22, "SIGTTOU", "stopped (tty output)"}, {23, "SIGIO", "I/O possible"}, {24, "SIGXCPU", "cputime limit exceeded"}, {25, "SIGXFSZ", "filesize limit exceeded"}, {26, "SIGVTALRM", "virtual timer expired"}, {27, "SIGPROF", "profiling timer expired"}, {28, "SIGWINCH", "window size changes"}, {29, "SIGINFO", "information request"}, {30, "SIGUSR1", "user defined signal 1"}, {31, "SIGUSR2", "user defined signal 2"}, {32, "SIGTHR", "thread Scheduler"}, {33, "SIGCKPT", "checkPoint"}, {34, "SIGCKPTEXIT", "checkPointExit"}, } ================================================ FILE: vendor/golang.org/x/sys/unix/zerrors_freebsd_386.go ================================================ // mkerrors.sh -m32 // Code generated by the command above; see README.md. DO NOT EDIT. //go:build 386 && freebsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -m32 _const.go package unix import "syscall" const ( AF_APPLETALK = 0x10 AF_ARP = 0x23 AF_ATM = 0x1e AF_BLUETOOTH = 0x24 AF_CCITT = 0xa AF_CHAOS = 0x5 AF_CNT = 0x15 AF_COIP = 0x14 AF_DATAKIT = 0x9 AF_DECnet = 0xc AF_DLI = 0xd AF_E164 = 0x1a AF_ECMA = 0x8 AF_HYLINK = 0xf AF_IEEE80211 = 0x25 AF_IMPLINK = 0x3 AF_INET = 0x2 AF_INET6 = 0x1c AF_INET6_SDP = 0x2a AF_INET_SDP = 0x28 AF_IPX = 0x17 AF_ISDN = 0x1a AF_ISO = 0x7 AF_LAT = 0xe AF_LINK = 0x12 AF_LOCAL = 0x1 AF_MAX = 0x2a AF_NATM = 0x1d AF_NETBIOS = 0x6 AF_NETGRAPH = 0x20 AF_OSI = 0x7 AF_PUP = 0x4 AF_ROUTE = 0x11 AF_SCLUSTER = 0x22 AF_SIP = 0x18 AF_SLOW = 0x21 AF_SNA = 0xb AF_UNIX = 0x1 AF_UNSPEC = 0x0 AF_VENDOR00 = 0x27 AF_VENDOR01 = 0x29 AF_VENDOR02 = 0x2b AF_VENDOR03 = 0x2d AF_VENDOR04 = 0x2f AF_VENDOR05 = 0x31 AF_VENDOR06 = 0x33 AF_VENDOR07 = 0x35 AF_VENDOR08 = 0x37 AF_VENDOR09 = 0x39 AF_VENDOR10 = 0x3b AF_VENDOR11 = 0x3d AF_VENDOR12 = 0x3f AF_VENDOR13 = 0x41 AF_VENDOR14 = 0x43 AF_VENDOR15 = 0x45 AF_VENDOR16 = 0x47 AF_VENDOR17 = 0x49 AF_VENDOR18 = 0x4b AF_VENDOR19 = 0x4d AF_VENDOR20 = 0x4f AF_VENDOR21 = 0x51 AF_VENDOR22 = 0x53 AF_VENDOR23 = 0x55 AF_VENDOR24 = 0x57 AF_VENDOR25 = 0x59 AF_VENDOR26 = 0x5b AF_VENDOR27 = 0x5d AF_VENDOR28 = 0x5f AF_VENDOR29 = 0x61 AF_VENDOR30 = 0x63 AF_VENDOR31 = 0x65 AF_VENDOR32 = 0x67 AF_VENDOR33 = 0x69 AF_VENDOR34 = 0x6b AF_VENDOR35 = 0x6d AF_VENDOR36 = 0x6f AF_VENDOR37 = 0x71 AF_VENDOR38 = 0x73 AF_VENDOR39 = 0x75 AF_VENDOR40 = 0x77 AF_VENDOR41 = 0x79 AF_VENDOR42 = 0x7b AF_VENDOR43 = 0x7d AF_VENDOR44 = 0x7f AF_VENDOR45 = 0x81 AF_VENDOR46 = 0x83 AF_VENDOR47 = 0x85 ALTWERASE = 0x200 B0 = 0x0 B110 = 0x6e B115200 = 0x1c200 B1200 = 0x4b0 B134 = 0x86 B14400 = 0x3840 B150 = 0x96 B1800 = 0x708 B19200 = 0x4b00 B200 = 0xc8 B230400 = 0x38400 B2400 = 0x960 B28800 = 0x7080 B300 = 0x12c B38400 = 0x9600 B460800 = 0x70800 B4800 = 0x12c0 B50 = 0x32 B57600 = 0xe100 B600 = 0x258 B7200 = 0x1c20 B75 = 0x4b B76800 = 0x12c00 B921600 = 0xe1000 B9600 = 0x2580 BIOCFEEDBACK = 0x8004427c BIOCFLUSH = 0x20004268 BIOCGBLEN = 0x40044266 BIOCGDIRECTION = 0x40044276 BIOCGDLT = 0x4004426a BIOCGDLTLIST = 0xc0084279 BIOCGETBUFMODE = 0x4004427d BIOCGETIF = 0x4020426b BIOCGETZMAX = 0x4004427f BIOCGHDRCMPLT = 0x40044274 BIOCGRSIG = 0x40044272 BIOCGRTIMEOUT = 0x4008426e BIOCGSEESENT = 0x40044276 BIOCGSTATS = 0x4008426f BIOCGTSTAMP = 0x40044283 BIOCIMMEDIATE = 0x80044270 BIOCLOCK = 0x2000427a BIOCPROMISC = 0x20004269 BIOCROTZBUF = 0x400c4280 BIOCSBLEN = 0xc0044266 BIOCSDIRECTION = 0x80044277 BIOCSDLT = 0x80044278 BIOCSETBUFMODE = 0x8004427e BIOCSETF = 0x80084267 BIOCSETFNR = 0x80084282 BIOCSETIF = 0x8020426c BIOCSETVLANPCP = 0x80044285 BIOCSETWF = 0x8008427b BIOCSETZBUF = 0x800c4281 BIOCSHDRCMPLT = 0x80044275 BIOCSRSIG = 0x80044273 BIOCSRTIMEOUT = 0x8008426d BIOCSSEESENT = 0x80044277 BIOCSTSTAMP = 0x80044284 BIOCVERSION = 0x40044271 BPF_A = 0x10 BPF_ABS = 0x20 BPF_ADD = 0x0 BPF_ALIGNMENT = 0x4 BPF_ALU = 0x4 BPF_AND = 0x50 BPF_B = 0x10 BPF_BUFMODE_BUFFER = 0x1 BPF_BUFMODE_ZBUF = 0x2 BPF_DIV = 0x30 BPF_H = 0x8 BPF_IMM = 0x0 BPF_IND = 0x40 BPF_JA = 0x0 BPF_JEQ = 0x10 BPF_JGE = 0x30 BPF_JGT = 0x20 BPF_JMP = 0x5 BPF_JSET = 0x40 BPF_K = 0x0 BPF_LD = 0x0 BPF_LDX = 0x1 BPF_LEN = 0x80 BPF_LSH = 0x60 BPF_MAJOR_VERSION = 0x1 BPF_MAXBUFSIZE = 0x80000 BPF_MAXINSNS = 0x200 BPF_MEM = 0x60 BPF_MEMWORDS = 0x10 BPF_MINBUFSIZE = 0x20 BPF_MINOR_VERSION = 0x1 BPF_MISC = 0x7 BPF_MOD = 0x90 BPF_MSH = 0xa0 BPF_MUL = 0x20 BPF_NEG = 0x80 BPF_OR = 0x40 BPF_RELEASE = 0x30bb6 BPF_RET = 0x6 BPF_RSH = 0x70 BPF_ST = 0x2 BPF_STX = 0x3 BPF_SUB = 0x10 BPF_TAX = 0x0 BPF_TXA = 0x80 BPF_T_BINTIME = 0x2 BPF_T_BINTIME_FAST = 0x102 BPF_T_BINTIME_MONOTONIC = 0x202 BPF_T_BINTIME_MONOTONIC_FAST = 0x302 BPF_T_FAST = 0x100 BPF_T_FLAG_MASK = 0x300 BPF_T_FORMAT_MASK = 0x3 BPF_T_MICROTIME = 0x0 BPF_T_MICROTIME_FAST = 0x100 BPF_T_MICROTIME_MONOTONIC = 0x200 BPF_T_MICROTIME_MONOTONIC_FAST = 0x300 BPF_T_MONOTONIC = 0x200 BPF_T_MONOTONIC_FAST = 0x300 BPF_T_NANOTIME = 0x1 BPF_T_NANOTIME_FAST = 0x101 BPF_T_NANOTIME_MONOTONIC = 0x201 BPF_T_NANOTIME_MONOTONIC_FAST = 0x301 BPF_T_NONE = 0x3 BPF_T_NORMAL = 0x0 BPF_W = 0x0 BPF_X = 0x8 BPF_XOR = 0xa0 BRKINT = 0x2 CAP_ACCEPT = 0x200000020000000 CAP_ACL_CHECK = 0x400000000010000 CAP_ACL_DELETE = 0x400000000020000 CAP_ACL_GET = 0x400000000040000 CAP_ACL_SET = 0x400000000080000 CAP_ALL0 = 0x20007ffffffffff CAP_ALL1 = 0x4000000001fffff CAP_BIND = 0x200000040000000 CAP_BINDAT = 0x200008000000400 CAP_CHFLAGSAT = 0x200000000001400 CAP_CONNECT = 0x200000080000000 CAP_CONNECTAT = 0x200010000000400 CAP_CREATE = 0x200000000000040 CAP_EVENT = 0x400000000000020 CAP_EXTATTR_DELETE = 0x400000000001000 CAP_EXTATTR_GET = 0x400000000002000 CAP_EXTATTR_LIST = 0x400000000004000 CAP_EXTATTR_SET = 0x400000000008000 CAP_FCHDIR = 0x200000000000800 CAP_FCHFLAGS = 0x200000000001000 CAP_FCHMOD = 0x200000000002000 CAP_FCHMODAT = 0x200000000002400 CAP_FCHOWN = 0x200000000004000 CAP_FCHOWNAT = 0x200000000004400 CAP_FCNTL = 0x200000000008000 CAP_FCNTL_ALL = 0x78 CAP_FCNTL_GETFL = 0x8 CAP_FCNTL_GETOWN = 0x20 CAP_FCNTL_SETFL = 0x10 CAP_FCNTL_SETOWN = 0x40 CAP_FEXECVE = 0x200000000000080 CAP_FLOCK = 0x200000000010000 CAP_FPATHCONF = 0x200000000020000 CAP_FSCK = 0x200000000040000 CAP_FSTAT = 0x200000000080000 CAP_FSTATAT = 0x200000000080400 CAP_FSTATFS = 0x200000000100000 CAP_FSYNC = 0x200000000000100 CAP_FTRUNCATE = 0x200000000000200 CAP_FUTIMES = 0x200000000200000 CAP_FUTIMESAT = 0x200000000200400 CAP_GETPEERNAME = 0x200000100000000 CAP_GETSOCKNAME = 0x200000200000000 CAP_GETSOCKOPT = 0x200000400000000 CAP_IOCTL = 0x400000000000080 CAP_IOCTLS_ALL = 0x7fffffff CAP_KQUEUE = 0x400000000100040 CAP_KQUEUE_CHANGE = 0x400000000100000 CAP_KQUEUE_EVENT = 0x400000000000040 CAP_LINKAT_SOURCE = 0x200020000000400 CAP_LINKAT_TARGET = 0x200000000400400 CAP_LISTEN = 0x200000800000000 CAP_LOOKUP = 0x200000000000400 CAP_MAC_GET = 0x400000000000001 CAP_MAC_SET = 0x400000000000002 CAP_MKDIRAT = 0x200000000800400 CAP_MKFIFOAT = 0x200000001000400 CAP_MKNODAT = 0x200000002000400 CAP_MMAP = 0x200000000000010 CAP_MMAP_R = 0x20000000000001d CAP_MMAP_RW = 0x20000000000001f CAP_MMAP_RWX = 0x20000000000003f CAP_MMAP_RX = 0x20000000000003d CAP_MMAP_W = 0x20000000000001e CAP_MMAP_WX = 0x20000000000003e CAP_MMAP_X = 0x20000000000003c CAP_PDGETPID = 0x400000000000200 CAP_PDKILL = 0x400000000000800 CAP_PDWAIT = 0x400000000000400 CAP_PEELOFF = 0x200001000000000 CAP_POLL_EVENT = 0x400000000000020 CAP_PREAD = 0x20000000000000d CAP_PWRITE = 0x20000000000000e CAP_READ = 0x200000000000001 CAP_RECV = 0x200000000000001 CAP_RENAMEAT_SOURCE = 0x200000004000400 CAP_RENAMEAT_TARGET = 0x200040000000400 CAP_RIGHTS_VERSION = 0x0 CAP_RIGHTS_VERSION_00 = 0x0 CAP_SEEK = 0x20000000000000c CAP_SEEK_TELL = 0x200000000000004 CAP_SEM_GETVALUE = 0x400000000000004 CAP_SEM_POST = 0x400000000000008 CAP_SEM_WAIT = 0x400000000000010 CAP_SEND = 0x200000000000002 CAP_SETSOCKOPT = 0x200002000000000 CAP_SHUTDOWN = 0x200004000000000 CAP_SOCK_CLIENT = 0x200007780000003 CAP_SOCK_SERVER = 0x200007f60000003 CAP_SYMLINKAT = 0x200000008000400 CAP_TTYHOOK = 0x400000000000100 CAP_UNLINKAT = 0x200000010000400 CAP_UNUSED0_44 = 0x200080000000000 CAP_UNUSED0_57 = 0x300000000000000 CAP_UNUSED1_22 = 0x400000000200000 CAP_UNUSED1_57 = 0x500000000000000 CAP_WRITE = 0x200000000000002 CFLUSH = 0xf CLOCAL = 0x8000 CLOCK_MONOTONIC = 0x4 CLOCK_MONOTONIC_FAST = 0xc CLOCK_MONOTONIC_PRECISE = 0xb CLOCK_PROCESS_CPUTIME_ID = 0xf CLOCK_PROF = 0x2 CLOCK_REALTIME = 0x0 CLOCK_REALTIME_FAST = 0xa CLOCK_REALTIME_PRECISE = 0x9 CLOCK_SECOND = 0xd CLOCK_THREAD_CPUTIME_ID = 0xe CLOCK_UPTIME = 0x5 CLOCK_UPTIME_FAST = 0x8 CLOCK_UPTIME_PRECISE = 0x7 CLOCK_VIRTUAL = 0x1 CPUSTATES = 0x5 CP_IDLE = 0x4 CP_INTR = 0x3 CP_NICE = 0x1 CP_SYS = 0x2 CP_USER = 0x0 CREAD = 0x800 CRTSCTS = 0x30000 CS5 = 0x0 CS6 = 0x100 CS7 = 0x200 CS8 = 0x300 CSIZE = 0x300 CSTART = 0x11 CSTATUS = 0x14 CSTOP = 0x13 CSTOPB = 0x400 CSUSP = 0x1a CTL_HW = 0x6 CTL_KERN = 0x1 CTL_MAXNAME = 0x18 CTL_NET = 0x4 DIOCGATTR = 0xc144648e DIOCGDELETE = 0x80106488 DIOCGFLUSH = 0x20006487 DIOCGFRONTSTUFF = 0x40086486 DIOCGFWHEADS = 0x40046483 DIOCGFWSECTORS = 0x40046482 DIOCGIDENT = 0x41006489 DIOCGMEDIASIZE = 0x40086481 DIOCGPHYSPATH = 0x4400648d DIOCGPROVIDERNAME = 0x4400648a DIOCGSECTORSIZE = 0x40046480 DIOCGSTRIPEOFFSET = 0x4008648c DIOCGSTRIPESIZE = 0x4008648b DIOCSKERNELDUMP = 0x804c6490 DIOCSKERNELDUMP_FREEBSD11 = 0x80046485 DIOCZONECMD = 0xc06c648f DLT_A429 = 0xb8 DLT_A653_ICM = 0xb9 DLT_AIRONET_HEADER = 0x78 DLT_AOS = 0xde DLT_APPLE_IP_OVER_IEEE1394 = 0x8a DLT_ARCNET = 0x7 DLT_ARCNET_LINUX = 0x81 DLT_ATM_CLIP = 0x13 DLT_ATM_RFC1483 = 0xb DLT_AURORA = 0x7e DLT_AX25 = 0x3 DLT_AX25_KISS = 0xca DLT_BACNET_MS_TP = 0xa5 DLT_BLUETOOTH_BREDR_BB = 0xff DLT_BLUETOOTH_HCI_H4 = 0xbb DLT_BLUETOOTH_HCI_H4_WITH_PHDR = 0xc9 DLT_BLUETOOTH_LE_LL = 0xfb DLT_BLUETOOTH_LE_LL_WITH_PHDR = 0x100 DLT_BLUETOOTH_LINUX_MONITOR = 0xfe DLT_CAN20B = 0xbe DLT_CAN_SOCKETCAN = 0xe3 DLT_CHAOS = 0x5 DLT_CHDLC = 0x68 DLT_CISCO_IOS = 0x76 DLT_CLASS_NETBSD_RAWAF = 0x2240000 DLT_C_HDLC = 0x68 DLT_C_HDLC_WITH_DIR = 0xcd DLT_DBUS = 0xe7 DLT_DECT = 0xdd DLT_DISPLAYPORT_AUX = 0x113 DLT_DOCSIS = 0x8f DLT_DOCSIS31_XRA31 = 0x111 DLT_DVB_CI = 0xeb DLT_ECONET = 0x73 DLT_EN10MB = 0x1 DLT_EN3MB = 0x2 DLT_ENC = 0x6d DLT_EPON = 0x103 DLT_ERF = 0xc5 DLT_ERF_ETH = 0xaf DLT_ERF_POS = 0xb0 DLT_ETHERNET_MPACKET = 0x112 DLT_FC_2 = 0xe0 DLT_FC_2_WITH_FRAME_DELIMS = 0xe1 DLT_FDDI = 0xa DLT_FLEXRAY = 0xd2 DLT_FRELAY = 0x6b DLT_FRELAY_WITH_DIR = 0xce DLT_GCOM_SERIAL = 0xad DLT_GCOM_T1E1 = 0xac DLT_GPF_F = 0xab DLT_GPF_T = 0xaa DLT_GPRS_LLC = 0xa9 DLT_GSMTAP_ABIS = 0xda DLT_GSMTAP_UM = 0xd9 DLT_IBM_SN = 0x92 DLT_IBM_SP = 0x91 DLT_IEEE802 = 0x6 DLT_IEEE802_11 = 0x69 DLT_IEEE802_11_RADIO = 0x7f DLT_IEEE802_11_RADIO_AVS = 0xa3 DLT_IEEE802_15_4 = 0xc3 DLT_IEEE802_15_4_LINUX = 0xbf DLT_IEEE802_15_4_NOFCS = 0xe6 DLT_IEEE802_15_4_NONASK_PHY = 0xd7 DLT_IEEE802_16_MAC_CPS = 0xbc DLT_IEEE802_16_MAC_CPS_RADIO = 0xc1 DLT_INFINIBAND = 0xf7 DLT_IPFILTER = 0x74 DLT_IPMB_KONTRON = 0xc7 DLT_IPMB_LINUX = 0xd1 DLT_IPMI_HPM_2 = 0x104 DLT_IPNET = 0xe2 DLT_IPOIB = 0xf2 DLT_IPV4 = 0xe4 DLT_IPV6 = 0xe5 DLT_IP_OVER_FC = 0x7a DLT_ISO_14443 = 0x108 DLT_JUNIPER_ATM1 = 0x89 DLT_JUNIPER_ATM2 = 0x87 DLT_JUNIPER_ATM_CEMIC = 0xee DLT_JUNIPER_CHDLC = 0xb5 DLT_JUNIPER_ES = 0x84 DLT_JUNIPER_ETHER = 0xb2 DLT_JUNIPER_FIBRECHANNEL = 0xea DLT_JUNIPER_FRELAY = 0xb4 DLT_JUNIPER_GGSN = 0x85 DLT_JUNIPER_ISM = 0xc2 DLT_JUNIPER_MFR = 0x86 DLT_JUNIPER_MLFR = 0x83 DLT_JUNIPER_MLPPP = 0x82 DLT_JUNIPER_MONITOR = 0xa4 DLT_JUNIPER_PIC_PEER = 0xae DLT_JUNIPER_PPP = 0xb3 DLT_JUNIPER_PPPOE = 0xa7 DLT_JUNIPER_PPPOE_ATM = 0xa8 DLT_JUNIPER_SERVICES = 0x88 DLT_JUNIPER_SRX_E2E = 0xe9 DLT_JUNIPER_ST = 0xc8 DLT_JUNIPER_VP = 0xb7 DLT_JUNIPER_VS = 0xe8 DLT_LAPB_WITH_DIR = 0xcf DLT_LAPD = 0xcb DLT_LIN = 0xd4 DLT_LINUX_EVDEV = 0xd8 DLT_LINUX_IRDA = 0x90 DLT_LINUX_LAPD = 0xb1 DLT_LINUX_PPP_WITHDIRECTION = 0xa6 DLT_LINUX_SLL = 0x71 DLT_LINUX_SLL2 = 0x114 DLT_LOOP = 0x6c DLT_LORATAP = 0x10e DLT_LTALK = 0x72 DLT_MATCHING_MAX = 0x114 DLT_MATCHING_MIN = 0x68 DLT_MFR = 0xb6 DLT_MOST = 0xd3 DLT_MPEG_2_TS = 0xf3 DLT_MPLS = 0xdb DLT_MTP2 = 0x8c DLT_MTP2_WITH_PHDR = 0x8b DLT_MTP3 = 0x8d DLT_MUX27010 = 0xec DLT_NETANALYZER = 0xf0 DLT_NETANALYZER_TRANSPARENT = 0xf1 DLT_NETLINK = 0xfd DLT_NFC_LLCP = 0xf5 DLT_NFLOG = 0xef DLT_NG40 = 0xf4 DLT_NORDIC_BLE = 0x110 DLT_NULL = 0x0 DLT_OPENFLOW = 0x10b DLT_PCI_EXP = 0x7d DLT_PFLOG = 0x75 DLT_PFSYNC = 0x79 DLT_PKTAP = 0x102 DLT_PPI = 0xc0 DLT_PPP = 0x9 DLT_PPP_BSDOS = 0xe DLT_PPP_ETHER = 0x33 DLT_PPP_PPPD = 0xa6 DLT_PPP_SERIAL = 0x32 DLT_PPP_WITH_DIR = 0xcc DLT_PPP_WITH_DIRECTION = 0xa6 DLT_PRISM_HEADER = 0x77 DLT_PROFIBUS_DL = 0x101 DLT_PRONET = 0x4 DLT_RAIF1 = 0xc6 DLT_RAW = 0xc DLT_RDS = 0x109 DLT_REDBACK_SMARTEDGE = 0x20 DLT_RIO = 0x7c DLT_RTAC_SERIAL = 0xfa DLT_SCCP = 0x8e DLT_SCTP = 0xf8 DLT_SDLC = 0x10c DLT_SITA = 0xc4 DLT_SLIP = 0x8 DLT_SLIP_BSDOS = 0xd DLT_STANAG_5066_D_PDU = 0xed DLT_SUNATM = 0x7b DLT_SYMANTEC_FIREWALL = 0x63 DLT_TI_LLN_SNIFFER = 0x10d DLT_TZSP = 0x80 DLT_USB = 0xba DLT_USBPCAP = 0xf9 DLT_USB_DARWIN = 0x10a DLT_USB_FREEBSD = 0xba DLT_USB_LINUX = 0xbd DLT_USB_LINUX_MMAPPED = 0xdc DLT_USER0 = 0x93 DLT_USER1 = 0x94 DLT_USER10 = 0x9d DLT_USER11 = 0x9e DLT_USER12 = 0x9f DLT_USER13 = 0xa0 DLT_USER14 = 0xa1 DLT_USER15 = 0xa2 DLT_USER2 = 0x95 DLT_USER3 = 0x96 DLT_USER4 = 0x97 DLT_USER5 = 0x98 DLT_USER6 = 0x99 DLT_USER7 = 0x9a DLT_USER8 = 0x9b DLT_USER9 = 0x9c DLT_VSOCK = 0x10f DLT_WATTSTOPPER_DLM = 0x107 DLT_WIHART = 0xdf DLT_WIRESHARK_UPPER_PDU = 0xfc DLT_X2E_SERIAL = 0xd5 DLT_X2E_XORAYA = 0xd6 DLT_ZWAVE_R1_R2 = 0x105 DLT_ZWAVE_R3 = 0x106 DT_BLK = 0x6 DT_CHR = 0x2 DT_DIR = 0x4 DT_FIFO = 0x1 DT_LNK = 0xa DT_REG = 0x8 DT_SOCK = 0xc DT_UNKNOWN = 0x0 DT_WHT = 0xe ECHO = 0x8 ECHOCTL = 0x40 ECHOE = 0x2 ECHOK = 0x4 ECHOKE = 0x1 ECHONL = 0x10 ECHOPRT = 0x20 EVFILT_AIO = -0x3 EVFILT_EMPTY = -0xd EVFILT_FS = -0x9 EVFILT_LIO = -0xa EVFILT_PROC = -0x5 EVFILT_PROCDESC = -0x8 EVFILT_READ = -0x1 EVFILT_SENDFILE = -0xc EVFILT_SIGNAL = -0x6 EVFILT_SYSCOUNT = 0xd EVFILT_TIMER = -0x7 EVFILT_USER = -0xb EVFILT_VNODE = -0x4 EVFILT_WRITE = -0x2 EVNAMEMAP_NAME_SIZE = 0x40 EV_ADD = 0x1 EV_CLEAR = 0x20 EV_DELETE = 0x2 EV_DISABLE = 0x8 EV_DISPATCH = 0x80 EV_DROP = 0x1000 EV_ENABLE = 0x4 EV_EOF = 0x8000 EV_ERROR = 0x4000 EV_FLAG1 = 0x2000 EV_FLAG2 = 0x4000 EV_FORCEONESHOT = 0x100 EV_ONESHOT = 0x10 EV_RECEIPT = 0x40 EV_SYSFLAGS = 0xf000 EXTA = 0x4b00 EXTATTR_MAXNAMELEN = 0xff EXTATTR_NAMESPACE_EMPTY = 0x0 EXTATTR_NAMESPACE_SYSTEM = 0x2 EXTATTR_NAMESPACE_USER = 0x1 EXTB = 0x9600 EXTPROC = 0x800 FD_CLOEXEC = 0x1 FD_SETSIZE = 0x400 FLUSHO = 0x800000 F_CANCEL = 0x5 F_DUP2FD = 0xa F_DUP2FD_CLOEXEC = 0x12 F_DUPFD = 0x0 F_DUPFD_CLOEXEC = 0x11 F_GETFD = 0x1 F_GETFL = 0x3 F_GETLK = 0xb F_GETOWN = 0x5 F_OGETLK = 0x7 F_OK = 0x0 F_OSETLK = 0x8 F_OSETLKW = 0x9 F_RDAHEAD = 0x10 F_RDLCK = 0x1 F_READAHEAD = 0xf F_SETFD = 0x2 F_SETFL = 0x4 F_SETLK = 0xc F_SETLKW = 0xd F_SETLK_REMOTE = 0xe F_SETOWN = 0x6 F_UNLCK = 0x2 F_UNLCKSYS = 0x4 F_WRLCK = 0x3 HUPCL = 0x4000 HW_MACHINE = 0x1 ICANON = 0x100 ICMP6_FILTER = 0x12 ICRNL = 0x100 IEXTEN = 0x400 IFAN_ARRIVAL = 0x0 IFAN_DEPARTURE = 0x1 IFCAP_WOL_MAGIC = 0x2000 IFF_ALLMULTI = 0x200 IFF_ALTPHYS = 0x4000 IFF_BROADCAST = 0x2 IFF_CANTCHANGE = 0x218f52 IFF_CANTCONFIG = 0x10000 IFF_DEBUG = 0x4 IFF_DRV_OACTIVE = 0x400 IFF_DRV_RUNNING = 0x40 IFF_DYING = 0x200000 IFF_LINK0 = 0x1000 IFF_LINK1 = 0x2000 IFF_LINK2 = 0x4000 IFF_LOOPBACK = 0x8 IFF_MONITOR = 0x40000 IFF_MULTICAST = 0x8000 IFF_NOARP = 0x80 IFF_NOGROUP = 0x800000 IFF_OACTIVE = 0x400 IFF_POINTOPOINT = 0x10 IFF_PPROMISC = 0x20000 IFF_PROMISC = 0x100 IFF_RENAMING = 0x400000 IFF_RUNNING = 0x40 IFF_SIMPLEX = 0x800 IFF_STATICARP = 0x80000 IFF_UP = 0x1 IFNAMSIZ = 0x10 IFT_BRIDGE = 0xd1 IFT_CARP = 0xf8 IFT_IEEE1394 = 0x90 IFT_INFINIBAND = 0xc7 IFT_L2VLAN = 0x87 IFT_L3IPVLAN = 0x88 IFT_PPP = 0x17 IFT_PROPVIRTUAL = 0x35 IGNBRK = 0x1 IGNCR = 0x80 IGNPAR = 0x4 IMAXBEL = 0x2000 INLCR = 0x40 INPCK = 0x10 IN_CLASSA_HOST = 0xffffff IN_CLASSA_MAX = 0x80 IN_CLASSA_NET = 0xff000000 IN_CLASSA_NSHIFT = 0x18 IN_CLASSB_HOST = 0xffff IN_CLASSB_MAX = 0x10000 IN_CLASSB_NET = 0xffff0000 IN_CLASSB_NSHIFT = 0x10 IN_CLASSC_HOST = 0xff IN_CLASSC_NET = 0xffffff00 IN_CLASSC_NSHIFT = 0x8 IN_CLASSD_HOST = 0xfffffff IN_CLASSD_NET = 0xf0000000 IN_CLASSD_NSHIFT = 0x1c IN_LOOPBACKNET = 0x7f IN_RFC3021_MASK = 0xfffffffe IPPROTO_3PC = 0x22 IPPROTO_ADFS = 0x44 IPPROTO_AH = 0x33 IPPROTO_AHIP = 0x3d IPPROTO_APES = 0x63 IPPROTO_ARGUS = 0xd IPPROTO_AX25 = 0x5d IPPROTO_BHA = 0x31 IPPROTO_BLT = 0x1e IPPROTO_BRSATMON = 0x4c IPPROTO_CARP = 0x70 IPPROTO_CFTP = 0x3e IPPROTO_CHAOS = 0x10 IPPROTO_CMTP = 0x26 IPPROTO_CPHB = 0x49 IPPROTO_CPNX = 0x48 IPPROTO_DCCP = 0x21 IPPROTO_DDP = 0x25 IPPROTO_DGP = 0x56 IPPROTO_DIVERT = 0x102 IPPROTO_DONE = 0x101 IPPROTO_DSTOPTS = 0x3c IPPROTO_EGP = 0x8 IPPROTO_EMCON = 0xe IPPROTO_ENCAP = 0x62 IPPROTO_EON = 0x50 IPPROTO_ESP = 0x32 IPPROTO_ETHERIP = 0x61 IPPROTO_FRAGMENT = 0x2c IPPROTO_GGP = 0x3 IPPROTO_GMTP = 0x64 IPPROTO_GRE = 0x2f IPPROTO_HELLO = 0x3f IPPROTO_HIP = 0x8b IPPROTO_HMP = 0x14 IPPROTO_HOPOPTS = 0x0 IPPROTO_ICMP = 0x1 IPPROTO_ICMPV6 = 0x3a IPPROTO_IDP = 0x16 IPPROTO_IDPR = 0x23 IPPROTO_IDRP = 0x2d IPPROTO_IGMP = 0x2 IPPROTO_IGP = 0x55 IPPROTO_IGRP = 0x58 IPPROTO_IL = 0x28 IPPROTO_INLSP = 0x34 IPPROTO_INP = 0x20 IPPROTO_IP = 0x0 IPPROTO_IPCOMP = 0x6c IPPROTO_IPCV = 0x47 IPPROTO_IPEIP = 0x5e IPPROTO_IPIP = 0x4 IPPROTO_IPPC = 0x43 IPPROTO_IPV4 = 0x4 IPPROTO_IPV6 = 0x29 IPPROTO_IRTP = 0x1c IPPROTO_KRYPTOLAN = 0x41 IPPROTO_LARP = 0x5b IPPROTO_LEAF1 = 0x19 IPPROTO_LEAF2 = 0x1a IPPROTO_MAX = 0x100 IPPROTO_MEAS = 0x13 IPPROTO_MH = 0x87 IPPROTO_MHRP = 0x30 IPPROTO_MICP = 0x5f IPPROTO_MOBILE = 0x37 IPPROTO_MPLS = 0x89 IPPROTO_MTP = 0x5c IPPROTO_MUX = 0x12 IPPROTO_ND = 0x4d IPPROTO_NHRP = 0x36 IPPROTO_NONE = 0x3b IPPROTO_NSP = 0x1f IPPROTO_NVPII = 0xb IPPROTO_OLD_DIVERT = 0xfe IPPROTO_OSPFIGP = 0x59 IPPROTO_PFSYNC = 0xf0 IPPROTO_PGM = 0x71 IPPROTO_PIGP = 0x9 IPPROTO_PIM = 0x67 IPPROTO_PRM = 0x15 IPPROTO_PUP = 0xc IPPROTO_PVP = 0x4b IPPROTO_RAW = 0xff IPPROTO_RCCMON = 0xa IPPROTO_RDP = 0x1b IPPROTO_RESERVED_253 = 0xfd IPPROTO_RESERVED_254 = 0xfe IPPROTO_ROUTING = 0x2b IPPROTO_RSVP = 0x2e IPPROTO_RVD = 0x42 IPPROTO_SATEXPAK = 0x40 IPPROTO_SATMON = 0x45 IPPROTO_SCCSP = 0x60 IPPROTO_SCTP = 0x84 IPPROTO_SDRP = 0x2a IPPROTO_SEND = 0x103 IPPROTO_SHIM6 = 0x8c IPPROTO_SKIP = 0x39 IPPROTO_SPACER = 0x7fff IPPROTO_SRPC = 0x5a IPPROTO_ST = 0x7 IPPROTO_SVMTP = 0x52 IPPROTO_SWIPE = 0x35 IPPROTO_TCF = 0x57 IPPROTO_TCP = 0x6 IPPROTO_TLSP = 0x38 IPPROTO_TP = 0x1d IPPROTO_TPXX = 0x27 IPPROTO_TRUNK1 = 0x17 IPPROTO_TRUNK2 = 0x18 IPPROTO_TTP = 0x54 IPPROTO_UDP = 0x11 IPPROTO_UDPLITE = 0x88 IPPROTO_VINES = 0x53 IPPROTO_VISA = 0x46 IPPROTO_VMTP = 0x51 IPPROTO_WBEXPAK = 0x4f IPPROTO_WBMON = 0x4e IPPROTO_WSN = 0x4a IPPROTO_XNET = 0xf IPPROTO_XTP = 0x24 IPV6_AUTOFLOWLABEL = 0x3b IPV6_BINDANY = 0x40 IPV6_BINDMULTI = 0x41 IPV6_BINDV6ONLY = 0x1b IPV6_CHECKSUM = 0x1a IPV6_DEFAULT_MULTICAST_HOPS = 0x1 IPV6_DEFAULT_MULTICAST_LOOP = 0x1 IPV6_DEFHLIM = 0x40 IPV6_DONTFRAG = 0x3e IPV6_DSTOPTS = 0x32 IPV6_FLOWID = 0x43 IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_LEN = 0x14 IPV6_FLOWLABEL_MASK = 0xffff0f00 IPV6_FLOWTYPE = 0x44 IPV6_FRAGTTL = 0x78 IPV6_FW_ADD = 0x1e IPV6_FW_DEL = 0x1f IPV6_FW_FLUSH = 0x20 IPV6_FW_GET = 0x22 IPV6_FW_ZERO = 0x21 IPV6_HLIMDEC = 0x1 IPV6_HOPLIMIT = 0x2f IPV6_HOPOPTS = 0x31 IPV6_IPSEC_POLICY = 0x1c IPV6_JOIN_GROUP = 0xc IPV6_LEAVE_GROUP = 0xd IPV6_MAXHLIM = 0xff IPV6_MAXOPTHDR = 0x800 IPV6_MAXPACKET = 0xffff IPV6_MAX_GROUP_SRC_FILTER = 0x200 IPV6_MAX_MEMBERSHIPS = 0xfff IPV6_MAX_SOCK_SRC_FILTER = 0x80 IPV6_MMTU = 0x500 IPV6_MSFILTER = 0x4a IPV6_MULTICAST_HOPS = 0xa IPV6_MULTICAST_IF = 0x9 IPV6_MULTICAST_LOOP = 0xb IPV6_NEXTHOP = 0x30 IPV6_ORIGDSTADDR = 0x48 IPV6_PATHMTU = 0x2c IPV6_PKTINFO = 0x2e IPV6_PORTRANGE = 0xe IPV6_PORTRANGE_DEFAULT = 0x0 IPV6_PORTRANGE_HIGH = 0x1 IPV6_PORTRANGE_LOW = 0x2 IPV6_PREFER_TEMPADDR = 0x3f IPV6_RECVDSTOPTS = 0x28 IPV6_RECVFLOWID = 0x46 IPV6_RECVHOPLIMIT = 0x25 IPV6_RECVHOPOPTS = 0x27 IPV6_RECVORIGDSTADDR = 0x48 IPV6_RECVPATHMTU = 0x2b IPV6_RECVPKTINFO = 0x24 IPV6_RECVRSSBUCKETID = 0x47 IPV6_RECVRTHDR = 0x26 IPV6_RECVTCLASS = 0x39 IPV6_RSSBUCKETID = 0x45 IPV6_RSS_LISTEN_BUCKET = 0x42 IPV6_RTHDR = 0x33 IPV6_RTHDRDSTOPTS = 0x23 IPV6_RTHDR_LOOSE = 0x0 IPV6_RTHDR_STRICT = 0x1 IPV6_RTHDR_TYPE_0 = 0x0 IPV6_SOCKOPT_RESERVED1 = 0x3 IPV6_TCLASS = 0x3d IPV6_UNICAST_HOPS = 0x4 IPV6_USE_MIN_MTU = 0x2a IPV6_V6ONLY = 0x1b IPV6_VERSION = 0x60 IPV6_VERSION_MASK = 0xf0 IPV6_VLAN_PCP = 0x4b IP_ADD_MEMBERSHIP = 0xc IP_ADD_SOURCE_MEMBERSHIP = 0x46 IP_BINDANY = 0x18 IP_BINDMULTI = 0x19 IP_BLOCK_SOURCE = 0x48 IP_DEFAULT_MULTICAST_LOOP = 0x1 IP_DEFAULT_MULTICAST_TTL = 0x1 IP_DF = 0x4000 IP_DONTFRAG = 0x43 IP_DROP_MEMBERSHIP = 0xd IP_DROP_SOURCE_MEMBERSHIP = 0x47 IP_DUMMYNET3 = 0x31 IP_DUMMYNET_CONFIGURE = 0x3c IP_DUMMYNET_DEL = 0x3d IP_DUMMYNET_FLUSH = 0x3e IP_DUMMYNET_GET = 0x40 IP_FLOWID = 0x5a IP_FLOWTYPE = 0x5b IP_FW3 = 0x30 IP_FW_ADD = 0x32 IP_FW_DEL = 0x33 IP_FW_FLUSH = 0x34 IP_FW_GET = 0x36 IP_FW_NAT_CFG = 0x38 IP_FW_NAT_DEL = 0x39 IP_FW_NAT_GET_CONFIG = 0x3a IP_FW_NAT_GET_LOG = 0x3b IP_FW_RESETLOG = 0x37 IP_FW_TABLE_ADD = 0x28 IP_FW_TABLE_DEL = 0x29 IP_FW_TABLE_FLUSH = 0x2a IP_FW_TABLE_GETSIZE = 0x2b IP_FW_TABLE_LIST = 0x2c IP_FW_ZERO = 0x35 IP_HDRINCL = 0x2 IP_IPSEC_POLICY = 0x15 IP_MAXPACKET = 0xffff IP_MAX_GROUP_SRC_FILTER = 0x200 IP_MAX_MEMBERSHIPS = 0xfff IP_MAX_SOCK_MUTE_FILTER = 0x80 IP_MAX_SOCK_SRC_FILTER = 0x80 IP_MF = 0x2000 IP_MINTTL = 0x42 IP_MSFILTER = 0x4a IP_MSS = 0x240 IP_MULTICAST_IF = 0x9 IP_MULTICAST_LOOP = 0xb IP_MULTICAST_TTL = 0xa IP_MULTICAST_VIF = 0xe IP_OFFMASK = 0x1fff IP_ONESBCAST = 0x17 IP_OPTIONS = 0x1 IP_ORIGDSTADDR = 0x1b IP_PORTRANGE = 0x13 IP_PORTRANGE_DEFAULT = 0x0 IP_PORTRANGE_HIGH = 0x1 IP_PORTRANGE_LOW = 0x2 IP_RECVDSTADDR = 0x7 IP_RECVFLOWID = 0x5d IP_RECVIF = 0x14 IP_RECVOPTS = 0x5 IP_RECVORIGDSTADDR = 0x1b IP_RECVRETOPTS = 0x6 IP_RECVRSSBUCKETID = 0x5e IP_RECVTOS = 0x44 IP_RECVTTL = 0x41 IP_RETOPTS = 0x8 IP_RF = 0x8000 IP_RSSBUCKETID = 0x5c IP_RSS_LISTEN_BUCKET = 0x1a IP_RSVP_OFF = 0x10 IP_RSVP_ON = 0xf IP_RSVP_VIF_OFF = 0x12 IP_RSVP_VIF_ON = 0x11 IP_SENDSRCADDR = 0x7 IP_TOS = 0x3 IP_TTL = 0x4 IP_UNBLOCK_SOURCE = 0x49 IP_VLAN_PCP = 0x4b ISIG = 0x80 ISTRIP = 0x20 ITIMER_PROF = 0x2 ITIMER_REAL = 0x0 ITIMER_VIRTUAL = 0x1 IXANY = 0x800 IXOFF = 0x400 IXON = 0x200 KERN_HOSTNAME = 0xa KERN_OSRELEASE = 0x2 KERN_OSTYPE = 0x1 KERN_VERSION = 0x4 LOCAL_CONNWAIT = 0x4 LOCAL_CREDS = 0x2 LOCAL_PEERCRED = 0x1 LOCAL_VENDOR = 0x80000000 LOCK_EX = 0x2 LOCK_NB = 0x4 LOCK_SH = 0x1 LOCK_UN = 0x8 MADV_AUTOSYNC = 0x7 MADV_CORE = 0x9 MADV_DONTNEED = 0x4 MADV_FREE = 0x5 MADV_NOCORE = 0x8 MADV_NORMAL = 0x0 MADV_NOSYNC = 0x6 MADV_PROTECT = 0xa MADV_RANDOM = 0x1 MADV_SEQUENTIAL = 0x2 MADV_WILLNEED = 0x3 MAP_ALIGNED_SUPER = 0x1000000 MAP_ALIGNMENT_MASK = -0x1000000 MAP_ALIGNMENT_SHIFT = 0x18 MAP_ANON = 0x1000 MAP_ANONYMOUS = 0x1000 MAP_COPY = 0x2 MAP_EXCL = 0x4000 MAP_FILE = 0x0 MAP_FIXED = 0x10 MAP_GUARD = 0x2000 MAP_HASSEMAPHORE = 0x200 MAP_NOCORE = 0x20000 MAP_NOSYNC = 0x800 MAP_PREFAULT_READ = 0x40000 MAP_PRIVATE = 0x2 MAP_RESERVED0020 = 0x20 MAP_RESERVED0040 = 0x40 MAP_RESERVED0080 = 0x80 MAP_RESERVED0100 = 0x100 MAP_SHARED = 0x1 MAP_STACK = 0x400 MCAST_BLOCK_SOURCE = 0x54 MCAST_EXCLUDE = 0x2 MCAST_INCLUDE = 0x1 MCAST_JOIN_GROUP = 0x50 MCAST_JOIN_SOURCE_GROUP = 0x52 MCAST_LEAVE_GROUP = 0x51 MCAST_LEAVE_SOURCE_GROUP = 0x53 MCAST_UNBLOCK_SOURCE = 0x55 MCAST_UNDEFINED = 0x0 MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MNT_ACLS = 0x8000000 MNT_ASYNC = 0x40 MNT_AUTOMOUNTED = 0x200000000 MNT_BYFSID = 0x8000000 MNT_CMDFLAGS = 0xd0f0000 MNT_DEFEXPORTED = 0x200 MNT_DELEXPORT = 0x20000 MNT_EXKERB = 0x800 MNT_EXPORTANON = 0x400 MNT_EXPORTED = 0x100 MNT_EXPUBLIC = 0x20000000 MNT_EXRDONLY = 0x80 MNT_FORCE = 0x80000 MNT_GJOURNAL = 0x2000000 MNT_IGNORE = 0x800000 MNT_LAZY = 0x3 MNT_LOCAL = 0x1000 MNT_MULTILABEL = 0x4000000 MNT_NFS4ACLS = 0x10 MNT_NOATIME = 0x10000000 MNT_NOCLUSTERR = 0x40000000 MNT_NOCLUSTERW = 0x80000000 MNT_NOEXEC = 0x4 MNT_NONBUSY = 0x4000000 MNT_NOSUID = 0x8 MNT_NOSYMFOLLOW = 0x400000 MNT_NOWAIT = 0x2 MNT_QUOTA = 0x2000 MNT_RDONLY = 0x1 MNT_RELOAD = 0x40000 MNT_ROOTFS = 0x4000 MNT_SNAPSHOT = 0x1000000 MNT_SOFTDEP = 0x200000 MNT_SUIDDIR = 0x100000 MNT_SUJ = 0x100000000 MNT_SUSPEND = 0x4 MNT_SYNCHRONOUS = 0x2 MNT_UNION = 0x20 MNT_UNTRUSTED = 0x800000000 MNT_UPDATE = 0x10000 MNT_UPDATEMASK = 0xad8d0807e MNT_USER = 0x8000 MNT_VERIFIED = 0x400000000 MNT_VISFLAGMASK = 0xffef0ffff MNT_WAIT = 0x1 MSG_CMSG_CLOEXEC = 0x40000 MSG_COMPAT = 0x8000 MSG_CTRUNC = 0x20 MSG_DONTROUTE = 0x4 MSG_DONTWAIT = 0x80 MSG_EOF = 0x100 MSG_EOR = 0x8 MSG_NBIO = 0x4000 MSG_NOSIGNAL = 0x20000 MSG_NOTIFICATION = 0x2000 MSG_OOB = 0x1 MSG_PEEK = 0x2 MSG_TRUNC = 0x10 MSG_WAITALL = 0x40 MSG_WAITFORONE = 0x80000 MS_ASYNC = 0x1 MS_INVALIDATE = 0x2 MS_SYNC = 0x0 NAME_MAX = 0xff NET_RT_DUMP = 0x1 NET_RT_FLAGS = 0x2 NET_RT_IFLIST = 0x3 NET_RT_IFLISTL = 0x5 NET_RT_IFMALIST = 0x4 NFDBITS = 0x20 NOFLSH = 0x80000000 NOKERNINFO = 0x2000000 NOTE_ABSTIME = 0x10 NOTE_ATTRIB = 0x8 NOTE_CHILD = 0x4 NOTE_CLOSE = 0x100 NOTE_CLOSE_WRITE = 0x200 NOTE_DELETE = 0x1 NOTE_EXEC = 0x20000000 NOTE_EXIT = 0x80000000 NOTE_EXTEND = 0x4 NOTE_FFAND = 0x40000000 NOTE_FFCOPY = 0xc0000000 NOTE_FFCTRLMASK = 0xc0000000 NOTE_FFLAGSMASK = 0xffffff NOTE_FFNOP = 0x0 NOTE_FFOR = 0x80000000 NOTE_FILE_POLL = 0x2 NOTE_FORK = 0x40000000 NOTE_LINK = 0x10 NOTE_LOWAT = 0x1 NOTE_MSECONDS = 0x2 NOTE_NSECONDS = 0x8 NOTE_OPEN = 0x80 NOTE_PCTRLMASK = 0xf0000000 NOTE_PDATAMASK = 0xfffff NOTE_READ = 0x400 NOTE_RENAME = 0x20 NOTE_REVOKE = 0x40 NOTE_SECONDS = 0x1 NOTE_TRACK = 0x1 NOTE_TRACKERR = 0x2 NOTE_TRIGGER = 0x1000000 NOTE_USECONDS = 0x4 NOTE_WRITE = 0x2 OCRNL = 0x10 ONLCR = 0x2 ONLRET = 0x40 ONOCR = 0x20 ONOEOT = 0x8 OPOST = 0x1 OXTABS = 0x4 O_ACCMODE = 0x3 O_APPEND = 0x8 O_ASYNC = 0x40 O_CLOEXEC = 0x100000 O_CREAT = 0x200 O_DIRECT = 0x10000 O_DIRECTORY = 0x20000 O_EXCL = 0x800 O_EXEC = 0x40000 O_EXLOCK = 0x20 O_FSYNC = 0x80 O_NDELAY = 0x4 O_NOCTTY = 0x8000 O_NOFOLLOW = 0x100 O_NONBLOCK = 0x4 O_RDONLY = 0x0 O_RDWR = 0x2 O_RESOLVE_BENEATH = 0x800000 O_SEARCH = 0x40000 O_SHLOCK = 0x10 O_SYNC = 0x80 O_TRUNC = 0x400 O_TTY_INIT = 0x80000 O_VERIFY = 0x200000 O_WRONLY = 0x1 PARENB = 0x1000 PARMRK = 0x8 PARODD = 0x2000 PENDIN = 0x20000000 PIOD_READ_D = 0x1 PIOD_READ_I = 0x3 PIOD_WRITE_D = 0x2 PIOD_WRITE_I = 0x4 PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 PROT_EXEC = 0x4 PROT_NONE = 0x0 PROT_READ = 0x1 PROT_WRITE = 0x2 PTRACE_DEFAULT = 0x1 PTRACE_EXEC = 0x1 PTRACE_FORK = 0x8 PTRACE_LWP = 0x10 PTRACE_SCE = 0x2 PTRACE_SCX = 0x4 PTRACE_SYSCALL = 0x6 PTRACE_VFORK = 0x20 PT_ATTACH = 0xa PT_CLEARSTEP = 0x10 PT_CONTINUE = 0x7 PT_DETACH = 0xb PT_FIRSTMACH = 0x40 PT_FOLLOW_FORK = 0x17 PT_GETDBREGS = 0x25 PT_GETFPREGS = 0x23 PT_GETFSBASE = 0x47 PT_GETGSBASE = 0x49 PT_GETLWPLIST = 0xf PT_GETNUMLWPS = 0xe PT_GETREGS = 0x21 PT_GETXMMREGS = 0x40 PT_GETXSTATE = 0x45 PT_GETXSTATE_INFO = 0x44 PT_GET_EVENT_MASK = 0x19 PT_GET_SC_ARGS = 0x1b PT_GET_SC_RET = 0x1c PT_IO = 0xc PT_KILL = 0x8 PT_LWPINFO = 0xd PT_LWP_EVENTS = 0x18 PT_READ_D = 0x2 PT_READ_I = 0x1 PT_RESUME = 0x13 PT_SETDBREGS = 0x26 PT_SETFPREGS = 0x24 PT_SETFSBASE = 0x48 PT_SETGSBASE = 0x4a PT_SETREGS = 0x22 PT_SETSTEP = 0x11 PT_SETXMMREGS = 0x41 PT_SETXSTATE = 0x46 PT_SET_EVENT_MASK = 0x1a PT_STEP = 0x9 PT_SUSPEND = 0x12 PT_SYSCALL = 0x16 PT_TO_SCE = 0x14 PT_TO_SCX = 0x15 PT_TRACE_ME = 0x0 PT_VM_ENTRY = 0x29 PT_VM_TIMESTAMP = 0x28 PT_WRITE_D = 0x5 PT_WRITE_I = 0x4 P_ZONEID = 0xc RLIMIT_AS = 0xa RLIMIT_CORE = 0x4 RLIMIT_CPU = 0x0 RLIMIT_DATA = 0x2 RLIMIT_FSIZE = 0x1 RLIMIT_MEMLOCK = 0x6 RLIMIT_NOFILE = 0x8 RLIMIT_NPROC = 0x7 RLIMIT_RSS = 0x5 RLIMIT_STACK = 0x3 RLIM_INFINITY = 0x7fffffffffffffff RTAX_AUTHOR = 0x6 RTAX_BRD = 0x7 RTAX_DST = 0x0 RTAX_GATEWAY = 0x1 RTAX_GENMASK = 0x3 RTAX_IFA = 0x5 RTAX_IFP = 0x4 RTAX_MAX = 0x8 RTAX_NETMASK = 0x2 RTA_AUTHOR = 0x40 RTA_BRD = 0x80 RTA_DST = 0x1 RTA_GATEWAY = 0x2 RTA_GENMASK = 0x8 RTA_IFA = 0x20 RTA_IFP = 0x10 RTA_NETMASK = 0x4 RTF_BLACKHOLE = 0x1000 RTF_BROADCAST = 0x400000 RTF_DONE = 0x40 RTF_DYNAMIC = 0x10 RTF_FIXEDMTU = 0x80000 RTF_FMASK = 0x1004d808 RTF_GATEWAY = 0x2 RTF_GWFLAG_COMPAT = 0x80000000 RTF_HOST = 0x4 RTF_LLDATA = 0x400 RTF_LLINFO = 0x400 RTF_LOCAL = 0x200000 RTF_MODIFIED = 0x20 RTF_MULTICAST = 0x800000 RTF_PINNED = 0x100000 RTF_PROTO1 = 0x8000 RTF_PROTO2 = 0x4000 RTF_PROTO3 = 0x40000 RTF_REJECT = 0x8 RTF_RNH_LOCKED = 0x40000000 RTF_STATIC = 0x800 RTF_STICKY = 0x10000000 RTF_UP = 0x1 RTF_XRESOLVE = 0x200 RTM_ADD = 0x1 RTM_CHANGE = 0x3 RTM_DELADDR = 0xd RTM_DELETE = 0x2 RTM_DELMADDR = 0x10 RTM_GET = 0x4 RTM_IEEE80211 = 0x12 RTM_IFANNOUNCE = 0x11 RTM_IFINFO = 0xe RTM_LOCK = 0x8 RTM_LOSING = 0x5 RTM_MISS = 0x7 RTM_NEWADDR = 0xc RTM_NEWMADDR = 0xf RTM_REDIRECT = 0x6 RTM_RESOLVE = 0xb RTM_RTTUNIT = 0xf4240 RTM_VERSION = 0x5 RTV_EXPIRE = 0x4 RTV_HOPCOUNT = 0x2 RTV_MTU = 0x1 RTV_RPIPE = 0x8 RTV_RTT = 0x40 RTV_RTTVAR = 0x80 RTV_SPIPE = 0x10 RTV_SSTHRESH = 0x20 RTV_WEIGHT = 0x100 RT_ALL_FIBS = -0x1 RT_BLACKHOLE = 0x40 RT_DEFAULT_FIB = 0x0 RT_HAS_GW = 0x80 RT_HAS_HEADER = 0x10 RT_HAS_HEADER_BIT = 0x4 RT_L2_ME = 0x4 RT_L2_ME_BIT = 0x2 RT_LLE_CACHE = 0x100 RT_MAY_LOOP = 0x8 RT_MAY_LOOP_BIT = 0x3 RT_REJECT = 0x20 RUSAGE_CHILDREN = -0x1 RUSAGE_SELF = 0x0 RUSAGE_THREAD = 0x1 SCM_BINTIME = 0x4 SCM_CREDS = 0x3 SCM_MONOTONIC = 0x6 SCM_REALTIME = 0x5 SCM_RIGHTS = 0x1 SCM_TIMESTAMP = 0x2 SCM_TIME_INFO = 0x7 SEEK_CUR = 0x1 SEEK_DATA = 0x3 SEEK_END = 0x2 SEEK_HOLE = 0x4 SEEK_SET = 0x0 SHUT_RD = 0x0 SHUT_RDWR = 0x2 SHUT_WR = 0x1 SIOCADDMULTI = 0x80206931 SIOCAIFADDR = 0x8040691a SIOCAIFGROUP = 0x80246987 SIOCATMARK = 0x40047307 SIOCDELMULTI = 0x80206932 SIOCDIFADDR = 0x80206919 SIOCDIFGROUP = 0x80246989 SIOCDIFPHYADDR = 0x80206949 SIOCGDRVSPEC = 0xc01c697b SIOCGETSGCNT = 0xc0147210 SIOCGETVIFCNT = 0xc014720f SIOCGHIWAT = 0x40047301 SIOCGHWADDR = 0xc020693e SIOCGI2C = 0xc020693d SIOCGIFADDR = 0xc0206921 SIOCGIFALIAS = 0xc044692d SIOCGIFBRDADDR = 0xc0206923 SIOCGIFCAP = 0xc020691f SIOCGIFCONF = 0xc0086924 SIOCGIFDESCR = 0xc020692a SIOCGIFDOWNREASON = 0xc058699a SIOCGIFDSTADDR = 0xc0206922 SIOCGIFFIB = 0xc020695c SIOCGIFFLAGS = 0xc0206911 SIOCGIFGENERIC = 0xc020693a SIOCGIFGMEMB = 0xc024698a SIOCGIFGROUP = 0xc0246988 SIOCGIFINDEX = 0xc0206920 SIOCGIFMAC = 0xc0206926 SIOCGIFMEDIA = 0xc0286938 SIOCGIFMETRIC = 0xc0206917 SIOCGIFMTU = 0xc0206933 SIOCGIFNETMASK = 0xc0206925 SIOCGIFPDSTADDR = 0xc0206948 SIOCGIFPHYS = 0xc0206935 SIOCGIFPSRCADDR = 0xc0206947 SIOCGIFRSSHASH = 0xc0186997 SIOCGIFRSSKEY = 0xc0946996 SIOCGIFSTATUS = 0xc331693b SIOCGIFXMEDIA = 0xc028698b SIOCGLANPCP = 0xc0206998 SIOCGLOWAT = 0x40047303 SIOCGPGRP = 0x40047309 SIOCGPRIVATE_0 = 0xc0206950 SIOCGPRIVATE_1 = 0xc0206951 SIOCGTUNFIB = 0xc020695e SIOCIFCREATE = 0xc020697a SIOCIFCREATE2 = 0xc020697c SIOCIFDESTROY = 0x80206979 SIOCIFGCLONERS = 0xc00c6978 SIOCSDRVSPEC = 0x801c697b SIOCSHIWAT = 0x80047300 SIOCSIFADDR = 0x8020690c SIOCSIFBRDADDR = 0x80206913 SIOCSIFCAP = 0x8020691e SIOCSIFDESCR = 0x80206929 SIOCSIFDSTADDR = 0x8020690e SIOCSIFFIB = 0x8020695d SIOCSIFFLAGS = 0x80206910 SIOCSIFGENERIC = 0x80206939 SIOCSIFLLADDR = 0x8020693c SIOCSIFMAC = 0x80206927 SIOCSIFMEDIA = 0xc0206937 SIOCSIFMETRIC = 0x80206918 SIOCSIFMTU = 0x80206934 SIOCSIFNAME = 0x80206928 SIOCSIFNETMASK = 0x80206916 SIOCSIFPHYADDR = 0x80406946 SIOCSIFPHYS = 0x80206936 SIOCSIFRVNET = 0xc020695b SIOCSIFVNET = 0xc020695a SIOCSLANPCP = 0x80206999 SIOCSLOWAT = 0x80047302 SIOCSPGRP = 0x80047308 SIOCSTUNFIB = 0x8020695f SOCK_CLOEXEC = 0x10000000 SOCK_DGRAM = 0x2 SOCK_MAXADDRLEN = 0xff SOCK_NONBLOCK = 0x20000000 SOCK_RAW = 0x3 SOCK_RDM = 0x4 SOCK_SEQPACKET = 0x5 SOCK_STREAM = 0x1 SOL_LOCAL = 0x0 SOL_SOCKET = 0xffff SOMAXCONN = 0x80 SO_ACCEPTCONN = 0x2 SO_ACCEPTFILTER = 0x1000 SO_BINTIME = 0x2000 SO_BROADCAST = 0x20 SO_DEBUG = 0x1 SO_DOMAIN = 0x1019 SO_DONTROUTE = 0x10 SO_ERROR = 0x1007 SO_KEEPALIVE = 0x8 SO_LABEL = 0x1009 SO_LINGER = 0x80 SO_LISTENINCQLEN = 0x1013 SO_LISTENQLEN = 0x1012 SO_LISTENQLIMIT = 0x1011 SO_MAX_PACING_RATE = 0x1018 SO_NOSIGPIPE = 0x800 SO_NO_DDP = 0x8000 SO_NO_OFFLOAD = 0x4000 SO_OOBINLINE = 0x100 SO_PEERLABEL = 0x1010 SO_PROTOCOL = 0x1016 SO_PROTOTYPE = 0x1016 SO_RCVBUF = 0x1002 SO_RCVLOWAT = 0x1004 SO_RCVTIMEO = 0x1006 SO_RERROR = 0x20000 SO_REUSEADDR = 0x4 SO_REUSEPORT = 0x200 SO_REUSEPORT_LB = 0x10000 SO_SETFIB = 0x1014 SO_SNDBUF = 0x1001 SO_SNDLOWAT = 0x1003 SO_SNDTIMEO = 0x1005 SO_TIMESTAMP = 0x400 SO_TS_BINTIME = 0x1 SO_TS_CLOCK = 0x1017 SO_TS_CLOCK_MAX = 0x3 SO_TS_DEFAULT = 0x0 SO_TS_MONOTONIC = 0x3 SO_TS_REALTIME = 0x2 SO_TS_REALTIME_MICRO = 0x0 SO_TYPE = 0x1008 SO_USELOOPBACK = 0x40 SO_USER_COOKIE = 0x1015 SO_VENDOR = 0x80000000 S_BLKSIZE = 0x200 S_IEXEC = 0x40 S_IFBLK = 0x6000 S_IFCHR = 0x2000 S_IFDIR = 0x4000 S_IFIFO = 0x1000 S_IFLNK = 0xa000 S_IFMT = 0xf000 S_IFREG = 0x8000 S_IFSOCK = 0xc000 S_IFWHT = 0xe000 S_IREAD = 0x100 S_IRGRP = 0x20 S_IROTH = 0x4 S_IRUSR = 0x100 S_IRWXG = 0x38 S_IRWXO = 0x7 S_IRWXU = 0x1c0 S_ISGID = 0x400 S_ISTXT = 0x200 S_ISUID = 0x800 S_ISVTX = 0x200 S_IWGRP = 0x10 S_IWOTH = 0x2 S_IWRITE = 0x80 S_IWUSR = 0x80 S_IXGRP = 0x8 S_IXOTH = 0x1 S_IXUSR = 0x40 TAB0 = 0x0 TAB3 = 0x4 TABDLY = 0x4 TCIFLUSH = 0x1 TCIOFF = 0x3 TCIOFLUSH = 0x3 TCION = 0x4 TCOFLUSH = 0x2 TCOOFF = 0x1 TCOON = 0x2 TCPOPT_EOL = 0x0 TCPOPT_FAST_OPEN = 0x22 TCPOPT_MAXSEG = 0x2 TCPOPT_NOP = 0x1 TCPOPT_PAD = 0x0 TCPOPT_SACK = 0x5 TCPOPT_SACK_PERMITTED = 0x4 TCPOPT_SIGNATURE = 0x13 TCPOPT_TIMESTAMP = 0x8 TCPOPT_WINDOW = 0x3 TCP_BBR_ACK_COMP_ALG = 0x448 TCP_BBR_ALGORITHM = 0x43b TCP_BBR_DRAIN_INC_EXTRA = 0x43c TCP_BBR_DRAIN_PG = 0x42e TCP_BBR_EXTRA_GAIN = 0x449 TCP_BBR_EXTRA_STATE = 0x453 TCP_BBR_FLOOR_MIN_TSO = 0x454 TCP_BBR_HDWR_PACE = 0x451 TCP_BBR_HOLD_TARGET = 0x436 TCP_BBR_IWINTSO = 0x42b TCP_BBR_LOWGAIN_FD = 0x436 TCP_BBR_LOWGAIN_HALF = 0x435 TCP_BBR_LOWGAIN_THRESH = 0x434 TCP_BBR_MAX_RTO = 0x439 TCP_BBR_MIN_RTO = 0x438 TCP_BBR_MIN_TOPACEOUT = 0x455 TCP_BBR_ONE_RETRAN = 0x431 TCP_BBR_PACE_CROSS = 0x442 TCP_BBR_PACE_DEL_TAR = 0x43f TCP_BBR_PACE_OH = 0x435 TCP_BBR_PACE_PER_SEC = 0x43e TCP_BBR_PACE_SEG_MAX = 0x440 TCP_BBR_PACE_SEG_MIN = 0x441 TCP_BBR_POLICER_DETECT = 0x457 TCP_BBR_PROBE_RTT_GAIN = 0x44d TCP_BBR_PROBE_RTT_INT = 0x430 TCP_BBR_PROBE_RTT_LEN = 0x44e TCP_BBR_RACK_RTT_USE = 0x44a TCP_BBR_RECFORCE = 0x42c TCP_BBR_REC_OVER_HPTS = 0x43a TCP_BBR_RETRAN_WTSO = 0x44b TCP_BBR_RWND_IS_APP = 0x42f TCP_BBR_SEND_IWND_IN_TSO = 0x44f TCP_BBR_STARTUP_EXIT_EPOCH = 0x43d TCP_BBR_STARTUP_LOSS_EXIT = 0x432 TCP_BBR_STARTUP_PG = 0x42d TCP_BBR_TMR_PACE_OH = 0x448 TCP_BBR_TSLIMITS = 0x434 TCP_BBR_TSTMP_RAISES = 0x456 TCP_BBR_UNLIMITED = 0x43b TCP_BBR_USEDEL_RATE = 0x437 TCP_BBR_USE_LOWGAIN = 0x433 TCP_BBR_USE_RACK_CHEAT = 0x450 TCP_BBR_UTTER_MAX_TSO = 0x452 TCP_CA_NAME_MAX = 0x10 TCP_CCALGOOPT = 0x41 TCP_CONGESTION = 0x40 TCP_DATA_AFTER_CLOSE = 0x44c TCP_DELACK = 0x48 TCP_FASTOPEN = 0x401 TCP_FASTOPEN_MAX_COOKIE_LEN = 0x10 TCP_FASTOPEN_MIN_COOKIE_LEN = 0x4 TCP_FASTOPEN_PSK_LEN = 0x10 TCP_FUNCTION_BLK = 0x2000 TCP_FUNCTION_NAME_LEN_MAX = 0x20 TCP_INFO = 0x20 TCP_KEEPCNT = 0x400 TCP_KEEPIDLE = 0x100 TCP_KEEPINIT = 0x80 TCP_KEEPINTVL = 0x200 TCP_LOG = 0x22 TCP_LOGBUF = 0x23 TCP_LOGDUMP = 0x25 TCP_LOGDUMPID = 0x26 TCP_LOGID = 0x24 TCP_LOG_ID_LEN = 0x40 TCP_MAXBURST = 0x4 TCP_MAXHLEN = 0x3c TCP_MAXOLEN = 0x28 TCP_MAXSEG = 0x2 TCP_MAXWIN = 0xffff TCP_MAX_SACK = 0x4 TCP_MAX_WINSHIFT = 0xe TCP_MD5SIG = 0x10 TCP_MINMSS = 0xd8 TCP_MSS = 0x218 TCP_NODELAY = 0x1 TCP_NOOPT = 0x8 TCP_NOPUSH = 0x4 TCP_PCAP_IN = 0x1000 TCP_PCAP_OUT = 0x800 TCP_RACK_EARLY_RECOV = 0x423 TCP_RACK_EARLY_SEG = 0x424 TCP_RACK_GP_INCREASE = 0x446 TCP_RACK_IDLE_REDUCE_HIGH = 0x444 TCP_RACK_MIN_PACE = 0x445 TCP_RACK_MIN_PACE_SEG = 0x446 TCP_RACK_MIN_TO = 0x422 TCP_RACK_PACE_ALWAYS = 0x41f TCP_RACK_PACE_MAX_SEG = 0x41e TCP_RACK_PACE_REDUCE = 0x41d TCP_RACK_PKT_DELAY = 0x428 TCP_RACK_PROP = 0x41b TCP_RACK_PROP_RATE = 0x420 TCP_RACK_PRR_SENDALOT = 0x421 TCP_RACK_REORD_FADE = 0x426 TCP_RACK_REORD_THRESH = 0x425 TCP_RACK_TLP_INC_VAR = 0x429 TCP_RACK_TLP_REDUCE = 0x41c TCP_RACK_TLP_THRESH = 0x427 TCP_RACK_TLP_USE = 0x447 TCP_VENDOR = 0x80000000 TCSAFLUSH = 0x2 TIMER_ABSTIME = 0x1 TIMER_RELTIME = 0x0 TIOCCBRK = 0x2000747a TIOCCDTR = 0x20007478 TIOCCONS = 0x80047462 TIOCDRAIN = 0x2000745e TIOCEXCL = 0x2000740d TIOCEXT = 0x80047460 TIOCFLUSH = 0x80047410 TIOCGDRAINWAIT = 0x40047456 TIOCGETA = 0x402c7413 TIOCGETD = 0x4004741a TIOCGPGRP = 0x40047477 TIOCGPTN = 0x4004740f TIOCGSID = 0x40047463 TIOCGWINSZ = 0x40087468 TIOCMBIC = 0x8004746b TIOCMBIS = 0x8004746c TIOCMGDTRWAIT = 0x4004745a TIOCMGET = 0x4004746a TIOCMSDTRWAIT = 0x8004745b TIOCMSET = 0x8004746d TIOCM_CAR = 0x40 TIOCM_CD = 0x40 TIOCM_CTS = 0x20 TIOCM_DCD = 0x40 TIOCM_DSR = 0x100 TIOCM_DTR = 0x2 TIOCM_LE = 0x1 TIOCM_RI = 0x80 TIOCM_RNG = 0x80 TIOCM_RTS = 0x4 TIOCM_SR = 0x10 TIOCM_ST = 0x8 TIOCNOTTY = 0x20007471 TIOCNXCL = 0x2000740e TIOCOUTQ = 0x40047473 TIOCPKT = 0x80047470 TIOCPKT_DATA = 0x0 TIOCPKT_DOSTOP = 0x20 TIOCPKT_FLUSHREAD = 0x1 TIOCPKT_FLUSHWRITE = 0x2 TIOCPKT_IOCTL = 0x40 TIOCPKT_NOSTOP = 0x10 TIOCPKT_START = 0x8 TIOCPKT_STOP = 0x4 TIOCPTMASTER = 0x2000741c TIOCSBRK = 0x2000747b TIOCSCTTY = 0x20007461 TIOCSDRAINWAIT = 0x80047457 TIOCSDTR = 0x20007479 TIOCSETA = 0x802c7414 TIOCSETAF = 0x802c7416 TIOCSETAW = 0x802c7415 TIOCSETD = 0x8004741b TIOCSIG = 0x2004745f TIOCSPGRP = 0x80047476 TIOCSTART = 0x2000746e TIOCSTAT = 0x20007465 TIOCSTI = 0x80017472 TIOCSTOP = 0x2000746f TIOCSWINSZ = 0x80087467 TIOCTIMESTAMP = 0x40087459 TIOCUCNTL = 0x80047466 TOSTOP = 0x400000 UTIME_NOW = -0x1 UTIME_OMIT = -0x2 VDISCARD = 0xf VDSUSP = 0xb VEOF = 0x0 VEOL = 0x1 VEOL2 = 0x2 VERASE = 0x3 VERASE2 = 0x7 VINTR = 0x8 VKILL = 0x5 VLNEXT = 0xe VMIN = 0x10 VM_BCACHE_SIZE_MAX = 0x70e0000 VM_SWZONE_SIZE_MAX = 0x2280000 VQUIT = 0x9 VREPRINT = 0x6 VSTART = 0xc VSTATUS = 0x12 VSTOP = 0xd VSUSP = 0xa VTIME = 0x11 VWERASE = 0x4 WCONTINUED = 0x4 WCOREFLAG = 0x80 WEXITED = 0x10 WLINUXCLONE = 0x80000000 WNOHANG = 0x1 WNOWAIT = 0x8 WSTOPPED = 0x2 WTRAPPED = 0x20 WUNTRACED = 0x2 ) // Errors const ( E2BIG = syscall.Errno(0x7) EACCES = syscall.Errno(0xd) EADDRINUSE = syscall.Errno(0x30) EADDRNOTAVAIL = syscall.Errno(0x31) EAFNOSUPPORT = syscall.Errno(0x2f) EAGAIN = syscall.Errno(0x23) EALREADY = syscall.Errno(0x25) EAUTH = syscall.Errno(0x50) EBADF = syscall.Errno(0x9) EBADMSG = syscall.Errno(0x59) EBADRPC = syscall.Errno(0x48) EBUSY = syscall.Errno(0x10) ECANCELED = syscall.Errno(0x55) ECAPMODE = syscall.Errno(0x5e) ECHILD = syscall.Errno(0xa) ECONNABORTED = syscall.Errno(0x35) ECONNREFUSED = syscall.Errno(0x3d) ECONNRESET = syscall.Errno(0x36) EDEADLK = syscall.Errno(0xb) EDESTADDRREQ = syscall.Errno(0x27) EDOM = syscall.Errno(0x21) EDOOFUS = syscall.Errno(0x58) EDQUOT = syscall.Errno(0x45) EEXIST = syscall.Errno(0x11) EFAULT = syscall.Errno(0xe) EFBIG = syscall.Errno(0x1b) EFTYPE = syscall.Errno(0x4f) EHOSTDOWN = syscall.Errno(0x40) EHOSTUNREACH = syscall.Errno(0x41) EIDRM = syscall.Errno(0x52) EILSEQ = syscall.Errno(0x56) EINPROGRESS = syscall.Errno(0x24) EINTEGRITY = syscall.Errno(0x61) EINTR = syscall.Errno(0x4) EINVAL = syscall.Errno(0x16) EIO = syscall.Errno(0x5) EISCONN = syscall.Errno(0x38) EISDIR = syscall.Errno(0x15) ELAST = syscall.Errno(0x61) ELOOP = syscall.Errno(0x3e) EMFILE = syscall.Errno(0x18) EMLINK = syscall.Errno(0x1f) EMSGSIZE = syscall.Errno(0x28) EMULTIHOP = syscall.Errno(0x5a) ENAMETOOLONG = syscall.Errno(0x3f) ENEEDAUTH = syscall.Errno(0x51) ENETDOWN = syscall.Errno(0x32) ENETRESET = syscall.Errno(0x34) ENETUNREACH = syscall.Errno(0x33) ENFILE = syscall.Errno(0x17) ENOATTR = syscall.Errno(0x57) ENOBUFS = syscall.Errno(0x37) ENODEV = syscall.Errno(0x13) ENOENT = syscall.Errno(0x2) ENOEXEC = syscall.Errno(0x8) ENOLCK = syscall.Errno(0x4d) ENOLINK = syscall.Errno(0x5b) ENOMEM = syscall.Errno(0xc) ENOMSG = syscall.Errno(0x53) ENOPROTOOPT = syscall.Errno(0x2a) ENOSPC = syscall.Errno(0x1c) ENOSYS = syscall.Errno(0x4e) ENOTBLK = syscall.Errno(0xf) ENOTCAPABLE = syscall.Errno(0x5d) ENOTCONN = syscall.Errno(0x39) ENOTDIR = syscall.Errno(0x14) ENOTEMPTY = syscall.Errno(0x42) ENOTRECOVERABLE = syscall.Errno(0x5f) ENOTSOCK = syscall.Errno(0x26) ENOTSUP = syscall.Errno(0x2d) ENOTTY = syscall.Errno(0x19) ENXIO = syscall.Errno(0x6) EOPNOTSUPP = syscall.Errno(0x2d) EOVERFLOW = syscall.Errno(0x54) EOWNERDEAD = syscall.Errno(0x60) EPERM = syscall.Errno(0x1) EPFNOSUPPORT = syscall.Errno(0x2e) EPIPE = syscall.Errno(0x20) EPROCLIM = syscall.Errno(0x43) EPROCUNAVAIL = syscall.Errno(0x4c) EPROGMISMATCH = syscall.Errno(0x4b) EPROGUNAVAIL = syscall.Errno(0x4a) EPROTO = syscall.Errno(0x5c) EPROTONOSUPPORT = syscall.Errno(0x2b) EPROTOTYPE = syscall.Errno(0x29) ERANGE = syscall.Errno(0x22) EREMOTE = syscall.Errno(0x47) EROFS = syscall.Errno(0x1e) ERPCMISMATCH = syscall.Errno(0x49) ESHUTDOWN = syscall.Errno(0x3a) ESOCKTNOSUPPORT = syscall.Errno(0x2c) ESPIPE = syscall.Errno(0x1d) ESRCH = syscall.Errno(0x3) ESTALE = syscall.Errno(0x46) ETIMEDOUT = syscall.Errno(0x3c) ETOOMANYREFS = syscall.Errno(0x3b) ETXTBSY = syscall.Errno(0x1a) EUSERS = syscall.Errno(0x44) EWOULDBLOCK = syscall.Errno(0x23) EXDEV = syscall.Errno(0x12) ) // Signals const ( SIGABRT = syscall.Signal(0x6) SIGALRM = syscall.Signal(0xe) SIGBUS = syscall.Signal(0xa) SIGCHLD = syscall.Signal(0x14) SIGCONT = syscall.Signal(0x13) SIGEMT = syscall.Signal(0x7) SIGFPE = syscall.Signal(0x8) SIGHUP = syscall.Signal(0x1) SIGILL = syscall.Signal(0x4) SIGINFO = syscall.Signal(0x1d) SIGINT = syscall.Signal(0x2) SIGIO = syscall.Signal(0x17) SIGIOT = syscall.Signal(0x6) SIGKILL = syscall.Signal(0x9) SIGLIBRT = syscall.Signal(0x21) SIGLWP = syscall.Signal(0x20) SIGPIPE = syscall.Signal(0xd) SIGPROF = syscall.Signal(0x1b) SIGQUIT = syscall.Signal(0x3) SIGSEGV = syscall.Signal(0xb) SIGSTOP = syscall.Signal(0x11) SIGSYS = syscall.Signal(0xc) SIGTERM = syscall.Signal(0xf) SIGTHR = syscall.Signal(0x20) SIGTRAP = syscall.Signal(0x5) SIGTSTP = syscall.Signal(0x12) SIGTTIN = syscall.Signal(0x15) SIGTTOU = syscall.Signal(0x16) SIGURG = syscall.Signal(0x10) SIGUSR1 = syscall.Signal(0x1e) SIGUSR2 = syscall.Signal(0x1f) SIGVTALRM = syscall.Signal(0x1a) SIGWINCH = syscall.Signal(0x1c) SIGXCPU = syscall.Signal(0x18) SIGXFSZ = syscall.Signal(0x19) ) // Error table var errorList = [...]struct { num syscall.Errno name string desc string }{ {1, "EPERM", "operation not permitted"}, {2, "ENOENT", "no such file or directory"}, {3, "ESRCH", "no such process"}, {4, "EINTR", "interrupted system call"}, {5, "EIO", "input/output error"}, {6, "ENXIO", "device not configured"}, {7, "E2BIG", "argument list too long"}, {8, "ENOEXEC", "exec format error"}, {9, "EBADF", "bad file descriptor"}, {10, "ECHILD", "no child processes"}, {11, "EDEADLK", "resource deadlock avoided"}, {12, "ENOMEM", "cannot allocate memory"}, {13, "EACCES", "permission denied"}, {14, "EFAULT", "bad address"}, {15, "ENOTBLK", "block device required"}, {16, "EBUSY", "device busy"}, {17, "EEXIST", "file exists"}, {18, "EXDEV", "cross-device link"}, {19, "ENODEV", "operation not supported by device"}, {20, "ENOTDIR", "not a directory"}, {21, "EISDIR", "is a directory"}, {22, "EINVAL", "invalid argument"}, {23, "ENFILE", "too many open files in system"}, {24, "EMFILE", "too many open files"}, {25, "ENOTTY", "inappropriate ioctl for device"}, {26, "ETXTBSY", "text file busy"}, {27, "EFBIG", "file too large"}, {28, "ENOSPC", "no space left on device"}, {29, "ESPIPE", "illegal seek"}, {30, "EROFS", "read-only file system"}, {31, "EMLINK", "too many links"}, {32, "EPIPE", "broken pipe"}, {33, "EDOM", "numerical argument out of domain"}, {34, "ERANGE", "result too large"}, {35, "EWOULDBLOCK", "resource temporarily unavailable"}, {36, "EINPROGRESS", "operation now in progress"}, {37, "EALREADY", "operation already in progress"}, {38, "ENOTSOCK", "socket operation on non-socket"}, {39, "EDESTADDRREQ", "destination address required"}, {40, "EMSGSIZE", "message too long"}, {41, "EPROTOTYPE", "protocol wrong type for socket"}, {42, "ENOPROTOOPT", "protocol not available"}, {43, "EPROTONOSUPPORT", "protocol not supported"}, {44, "ESOCKTNOSUPPORT", "socket type not supported"}, {45, "EOPNOTSUPP", "operation not supported"}, {46, "EPFNOSUPPORT", "protocol family not supported"}, {47, "EAFNOSUPPORT", "address family not supported by protocol family"}, {48, "EADDRINUSE", "address already in use"}, {49, "EADDRNOTAVAIL", "can't assign requested address"}, {50, "ENETDOWN", "network is down"}, {51, "ENETUNREACH", "network is unreachable"}, {52, "ENETRESET", "network dropped connection on reset"}, {53, "ECONNABORTED", "software caused connection abort"}, {54, "ECONNRESET", "connection reset by peer"}, {55, "ENOBUFS", "no buffer space available"}, {56, "EISCONN", "socket is already connected"}, {57, "ENOTCONN", "socket is not connected"}, {58, "ESHUTDOWN", "can't send after socket shutdown"}, {59, "ETOOMANYREFS", "too many references: can't splice"}, {60, "ETIMEDOUT", "operation timed out"}, {61, "ECONNREFUSED", "connection refused"}, {62, "ELOOP", "too many levels of symbolic links"}, {63, "ENAMETOOLONG", "file name too long"}, {64, "EHOSTDOWN", "host is down"}, {65, "EHOSTUNREACH", "no route to host"}, {66, "ENOTEMPTY", "directory not empty"}, {67, "EPROCLIM", "too many processes"}, {68, "EUSERS", "too many users"}, {69, "EDQUOT", "disc quota exceeded"}, {70, "ESTALE", "stale NFS file handle"}, {71, "EREMOTE", "too many levels of remote in path"}, {72, "EBADRPC", "RPC struct is bad"}, {73, "ERPCMISMATCH", "RPC version wrong"}, {74, "EPROGUNAVAIL", "RPC prog. not avail"}, {75, "EPROGMISMATCH", "program version wrong"}, {76, "EPROCUNAVAIL", "bad procedure for program"}, {77, "ENOLCK", "no locks available"}, {78, "ENOSYS", "function not implemented"}, {79, "EFTYPE", "inappropriate file type or format"}, {80, "EAUTH", "authentication error"}, {81, "ENEEDAUTH", "need authenticator"}, {82, "EIDRM", "identifier removed"}, {83, "ENOMSG", "no message of desired type"}, {84, "EOVERFLOW", "value too large to be stored in data type"}, {85, "ECANCELED", "operation canceled"}, {86, "EILSEQ", "illegal byte sequence"}, {87, "ENOATTR", "attribute not found"}, {88, "EDOOFUS", "programming error"}, {89, "EBADMSG", "bad message"}, {90, "EMULTIHOP", "multihop attempted"}, {91, "ENOLINK", "link has been severed"}, {92, "EPROTO", "protocol error"}, {93, "ENOTCAPABLE", "capabilities insufficient"}, {94, "ECAPMODE", "not permitted in capability mode"}, {95, "ENOTRECOVERABLE", "state not recoverable"}, {96, "EOWNERDEAD", "previous owner died"}, {97, "EINTEGRITY", "integrity check failed"}, } // Signal table var signalList = [...]struct { num syscall.Signal name string desc string }{ {1, "SIGHUP", "hangup"}, {2, "SIGINT", "interrupt"}, {3, "SIGQUIT", "quit"}, {4, "SIGILL", "illegal instruction"}, {5, "SIGTRAP", "trace/BPT trap"}, {6, "SIGIOT", "abort trap"}, {7, "SIGEMT", "EMT trap"}, {8, "SIGFPE", "floating point exception"}, {9, "SIGKILL", "killed"}, {10, "SIGBUS", "bus error"}, {11, "SIGSEGV", "segmentation fault"}, {12, "SIGSYS", "bad system call"}, {13, "SIGPIPE", "broken pipe"}, {14, "SIGALRM", "alarm clock"}, {15, "SIGTERM", "terminated"}, {16, "SIGURG", "urgent I/O condition"}, {17, "SIGSTOP", "suspended (signal)"}, {18, "SIGTSTP", "suspended"}, {19, "SIGCONT", "continued"}, {20, "SIGCHLD", "child exited"}, {21, "SIGTTIN", "stopped (tty input)"}, {22, "SIGTTOU", "stopped (tty output)"}, {23, "SIGIO", "I/O possible"}, {24, "SIGXCPU", "cputime limit exceeded"}, {25, "SIGXFSZ", "filesize limit exceeded"}, {26, "SIGVTALRM", "virtual timer expired"}, {27, "SIGPROF", "profiling timer expired"}, {28, "SIGWINCH", "window size changes"}, {29, "SIGINFO", "information request"}, {30, "SIGUSR1", "user defined signal 1"}, {31, "SIGUSR2", "user defined signal 2"}, {32, "SIGTHR", "unknown signal"}, {33, "SIGLIBRT", "unknown signal"}, } ================================================ FILE: vendor/golang.org/x/sys/unix/zerrors_freebsd_amd64.go ================================================ // mkerrors.sh -m64 // Code generated by the command above; see README.md. DO NOT EDIT. //go:build amd64 && freebsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -m64 _const.go package unix import "syscall" const ( AF_APPLETALK = 0x10 AF_ARP = 0x23 AF_ATM = 0x1e AF_BLUETOOTH = 0x24 AF_CCITT = 0xa AF_CHAOS = 0x5 AF_CNT = 0x15 AF_COIP = 0x14 AF_DATAKIT = 0x9 AF_DECnet = 0xc AF_DLI = 0xd AF_E164 = 0x1a AF_ECMA = 0x8 AF_HYLINK = 0xf AF_IEEE80211 = 0x25 AF_IMPLINK = 0x3 AF_INET = 0x2 AF_INET6 = 0x1c AF_INET6_SDP = 0x2a AF_INET_SDP = 0x28 AF_IPX = 0x17 AF_ISDN = 0x1a AF_ISO = 0x7 AF_LAT = 0xe AF_LINK = 0x12 AF_LOCAL = 0x1 AF_MAX = 0x2a AF_NATM = 0x1d AF_NETBIOS = 0x6 AF_NETGRAPH = 0x20 AF_OSI = 0x7 AF_PUP = 0x4 AF_ROUTE = 0x11 AF_SCLUSTER = 0x22 AF_SIP = 0x18 AF_SLOW = 0x21 AF_SNA = 0xb AF_UNIX = 0x1 AF_UNSPEC = 0x0 AF_VENDOR00 = 0x27 AF_VENDOR01 = 0x29 AF_VENDOR02 = 0x2b AF_VENDOR03 = 0x2d AF_VENDOR04 = 0x2f AF_VENDOR05 = 0x31 AF_VENDOR06 = 0x33 AF_VENDOR07 = 0x35 AF_VENDOR08 = 0x37 AF_VENDOR09 = 0x39 AF_VENDOR10 = 0x3b AF_VENDOR11 = 0x3d AF_VENDOR12 = 0x3f AF_VENDOR13 = 0x41 AF_VENDOR14 = 0x43 AF_VENDOR15 = 0x45 AF_VENDOR16 = 0x47 AF_VENDOR17 = 0x49 AF_VENDOR18 = 0x4b AF_VENDOR19 = 0x4d AF_VENDOR20 = 0x4f AF_VENDOR21 = 0x51 AF_VENDOR22 = 0x53 AF_VENDOR23 = 0x55 AF_VENDOR24 = 0x57 AF_VENDOR25 = 0x59 AF_VENDOR26 = 0x5b AF_VENDOR27 = 0x5d AF_VENDOR28 = 0x5f AF_VENDOR29 = 0x61 AF_VENDOR30 = 0x63 AF_VENDOR31 = 0x65 AF_VENDOR32 = 0x67 AF_VENDOR33 = 0x69 AF_VENDOR34 = 0x6b AF_VENDOR35 = 0x6d AF_VENDOR36 = 0x6f AF_VENDOR37 = 0x71 AF_VENDOR38 = 0x73 AF_VENDOR39 = 0x75 AF_VENDOR40 = 0x77 AF_VENDOR41 = 0x79 AF_VENDOR42 = 0x7b AF_VENDOR43 = 0x7d AF_VENDOR44 = 0x7f AF_VENDOR45 = 0x81 AF_VENDOR46 = 0x83 AF_VENDOR47 = 0x85 ALTWERASE = 0x200 B0 = 0x0 B110 = 0x6e B115200 = 0x1c200 B1200 = 0x4b0 B134 = 0x86 B14400 = 0x3840 B150 = 0x96 B1800 = 0x708 B19200 = 0x4b00 B200 = 0xc8 B230400 = 0x38400 B2400 = 0x960 B28800 = 0x7080 B300 = 0x12c B38400 = 0x9600 B460800 = 0x70800 B4800 = 0x12c0 B50 = 0x32 B57600 = 0xe100 B600 = 0x258 B7200 = 0x1c20 B75 = 0x4b B76800 = 0x12c00 B921600 = 0xe1000 B9600 = 0x2580 BIOCFEEDBACK = 0x8004427c BIOCFLUSH = 0x20004268 BIOCGBLEN = 0x40044266 BIOCGDIRECTION = 0x40044276 BIOCGDLT = 0x4004426a BIOCGDLTLIST = 0xc0104279 BIOCGETBUFMODE = 0x4004427d BIOCGETIF = 0x4020426b BIOCGETZMAX = 0x4008427f BIOCGHDRCMPLT = 0x40044274 BIOCGRSIG = 0x40044272 BIOCGRTIMEOUT = 0x4010426e BIOCGSEESENT = 0x40044276 BIOCGSTATS = 0x4008426f BIOCGTSTAMP = 0x40044283 BIOCIMMEDIATE = 0x80044270 BIOCLOCK = 0x2000427a BIOCPROMISC = 0x20004269 BIOCROTZBUF = 0x40184280 BIOCSBLEN = 0xc0044266 BIOCSDIRECTION = 0x80044277 BIOCSDLT = 0x80044278 BIOCSETBUFMODE = 0x8004427e BIOCSETF = 0x80104267 BIOCSETFNR = 0x80104282 BIOCSETIF = 0x8020426c BIOCSETVLANPCP = 0x80044285 BIOCSETWF = 0x8010427b BIOCSETZBUF = 0x80184281 BIOCSHDRCMPLT = 0x80044275 BIOCSRSIG = 0x80044273 BIOCSRTIMEOUT = 0x8010426d BIOCSSEESENT = 0x80044277 BIOCSTSTAMP = 0x80044284 BIOCVERSION = 0x40044271 BPF_A = 0x10 BPF_ABS = 0x20 BPF_ADD = 0x0 BPF_ALIGNMENT = 0x8 BPF_ALU = 0x4 BPF_AND = 0x50 BPF_B = 0x10 BPF_BUFMODE_BUFFER = 0x1 BPF_BUFMODE_ZBUF = 0x2 BPF_DIV = 0x30 BPF_H = 0x8 BPF_IMM = 0x0 BPF_IND = 0x40 BPF_JA = 0x0 BPF_JEQ = 0x10 BPF_JGE = 0x30 BPF_JGT = 0x20 BPF_JMP = 0x5 BPF_JSET = 0x40 BPF_K = 0x0 BPF_LD = 0x0 BPF_LDX = 0x1 BPF_LEN = 0x80 BPF_LSH = 0x60 BPF_MAJOR_VERSION = 0x1 BPF_MAXBUFSIZE = 0x80000 BPF_MAXINSNS = 0x200 BPF_MEM = 0x60 BPF_MEMWORDS = 0x10 BPF_MINBUFSIZE = 0x20 BPF_MINOR_VERSION = 0x1 BPF_MISC = 0x7 BPF_MOD = 0x90 BPF_MSH = 0xa0 BPF_MUL = 0x20 BPF_NEG = 0x80 BPF_OR = 0x40 BPF_RELEASE = 0x30bb6 BPF_RET = 0x6 BPF_RSH = 0x70 BPF_ST = 0x2 BPF_STX = 0x3 BPF_SUB = 0x10 BPF_TAX = 0x0 BPF_TXA = 0x80 BPF_T_BINTIME = 0x2 BPF_T_BINTIME_FAST = 0x102 BPF_T_BINTIME_MONOTONIC = 0x202 BPF_T_BINTIME_MONOTONIC_FAST = 0x302 BPF_T_FAST = 0x100 BPF_T_FLAG_MASK = 0x300 BPF_T_FORMAT_MASK = 0x3 BPF_T_MICROTIME = 0x0 BPF_T_MICROTIME_FAST = 0x100 BPF_T_MICROTIME_MONOTONIC = 0x200 BPF_T_MICROTIME_MONOTONIC_FAST = 0x300 BPF_T_MONOTONIC = 0x200 BPF_T_MONOTONIC_FAST = 0x300 BPF_T_NANOTIME = 0x1 BPF_T_NANOTIME_FAST = 0x101 BPF_T_NANOTIME_MONOTONIC = 0x201 BPF_T_NANOTIME_MONOTONIC_FAST = 0x301 BPF_T_NONE = 0x3 BPF_T_NORMAL = 0x0 BPF_W = 0x0 BPF_X = 0x8 BPF_XOR = 0xa0 BRKINT = 0x2 CAP_ACCEPT = 0x200000020000000 CAP_ACL_CHECK = 0x400000000010000 CAP_ACL_DELETE = 0x400000000020000 CAP_ACL_GET = 0x400000000040000 CAP_ACL_SET = 0x400000000080000 CAP_ALL0 = 0x20007ffffffffff CAP_ALL1 = 0x4000000001fffff CAP_BIND = 0x200000040000000 CAP_BINDAT = 0x200008000000400 CAP_CHFLAGSAT = 0x200000000001400 CAP_CONNECT = 0x200000080000000 CAP_CONNECTAT = 0x200010000000400 CAP_CREATE = 0x200000000000040 CAP_EVENT = 0x400000000000020 CAP_EXTATTR_DELETE = 0x400000000001000 CAP_EXTATTR_GET = 0x400000000002000 CAP_EXTATTR_LIST = 0x400000000004000 CAP_EXTATTR_SET = 0x400000000008000 CAP_FCHDIR = 0x200000000000800 CAP_FCHFLAGS = 0x200000000001000 CAP_FCHMOD = 0x200000000002000 CAP_FCHMODAT = 0x200000000002400 CAP_FCHOWN = 0x200000000004000 CAP_FCHOWNAT = 0x200000000004400 CAP_FCNTL = 0x200000000008000 CAP_FCNTL_ALL = 0x78 CAP_FCNTL_GETFL = 0x8 CAP_FCNTL_GETOWN = 0x20 CAP_FCNTL_SETFL = 0x10 CAP_FCNTL_SETOWN = 0x40 CAP_FEXECVE = 0x200000000000080 CAP_FLOCK = 0x200000000010000 CAP_FPATHCONF = 0x200000000020000 CAP_FSCK = 0x200000000040000 CAP_FSTAT = 0x200000000080000 CAP_FSTATAT = 0x200000000080400 CAP_FSTATFS = 0x200000000100000 CAP_FSYNC = 0x200000000000100 CAP_FTRUNCATE = 0x200000000000200 CAP_FUTIMES = 0x200000000200000 CAP_FUTIMESAT = 0x200000000200400 CAP_GETPEERNAME = 0x200000100000000 CAP_GETSOCKNAME = 0x200000200000000 CAP_GETSOCKOPT = 0x200000400000000 CAP_IOCTL = 0x400000000000080 CAP_IOCTLS_ALL = 0x7fffffffffffffff CAP_KQUEUE = 0x400000000100040 CAP_KQUEUE_CHANGE = 0x400000000100000 CAP_KQUEUE_EVENT = 0x400000000000040 CAP_LINKAT_SOURCE = 0x200020000000400 CAP_LINKAT_TARGET = 0x200000000400400 CAP_LISTEN = 0x200000800000000 CAP_LOOKUP = 0x200000000000400 CAP_MAC_GET = 0x400000000000001 CAP_MAC_SET = 0x400000000000002 CAP_MKDIRAT = 0x200000000800400 CAP_MKFIFOAT = 0x200000001000400 CAP_MKNODAT = 0x200000002000400 CAP_MMAP = 0x200000000000010 CAP_MMAP_R = 0x20000000000001d CAP_MMAP_RW = 0x20000000000001f CAP_MMAP_RWX = 0x20000000000003f CAP_MMAP_RX = 0x20000000000003d CAP_MMAP_W = 0x20000000000001e CAP_MMAP_WX = 0x20000000000003e CAP_MMAP_X = 0x20000000000003c CAP_PDGETPID = 0x400000000000200 CAP_PDKILL = 0x400000000000800 CAP_PDWAIT = 0x400000000000400 CAP_PEELOFF = 0x200001000000000 CAP_POLL_EVENT = 0x400000000000020 CAP_PREAD = 0x20000000000000d CAP_PWRITE = 0x20000000000000e CAP_READ = 0x200000000000001 CAP_RECV = 0x200000000000001 CAP_RENAMEAT_SOURCE = 0x200000004000400 CAP_RENAMEAT_TARGET = 0x200040000000400 CAP_RIGHTS_VERSION = 0x0 CAP_RIGHTS_VERSION_00 = 0x0 CAP_SEEK = 0x20000000000000c CAP_SEEK_TELL = 0x200000000000004 CAP_SEM_GETVALUE = 0x400000000000004 CAP_SEM_POST = 0x400000000000008 CAP_SEM_WAIT = 0x400000000000010 CAP_SEND = 0x200000000000002 CAP_SETSOCKOPT = 0x200002000000000 CAP_SHUTDOWN = 0x200004000000000 CAP_SOCK_CLIENT = 0x200007780000003 CAP_SOCK_SERVER = 0x200007f60000003 CAP_SYMLINKAT = 0x200000008000400 CAP_TTYHOOK = 0x400000000000100 CAP_UNLINKAT = 0x200000010000400 CAP_UNUSED0_44 = 0x200080000000000 CAP_UNUSED0_57 = 0x300000000000000 CAP_UNUSED1_22 = 0x400000000200000 CAP_UNUSED1_57 = 0x500000000000000 CAP_WRITE = 0x200000000000002 CFLUSH = 0xf CLOCAL = 0x8000 CLOCK_MONOTONIC = 0x4 CLOCK_MONOTONIC_FAST = 0xc CLOCK_MONOTONIC_PRECISE = 0xb CLOCK_PROCESS_CPUTIME_ID = 0xf CLOCK_PROF = 0x2 CLOCK_REALTIME = 0x0 CLOCK_REALTIME_FAST = 0xa CLOCK_REALTIME_PRECISE = 0x9 CLOCK_SECOND = 0xd CLOCK_THREAD_CPUTIME_ID = 0xe CLOCK_UPTIME = 0x5 CLOCK_UPTIME_FAST = 0x8 CLOCK_UPTIME_PRECISE = 0x7 CLOCK_VIRTUAL = 0x1 CPUSTATES = 0x5 CP_IDLE = 0x4 CP_INTR = 0x3 CP_NICE = 0x1 CP_SYS = 0x2 CP_USER = 0x0 CREAD = 0x800 CRTSCTS = 0x30000 CS5 = 0x0 CS6 = 0x100 CS7 = 0x200 CS8 = 0x300 CSIZE = 0x300 CSTART = 0x11 CSTATUS = 0x14 CSTOP = 0x13 CSTOPB = 0x400 CSUSP = 0x1a CTL_HW = 0x6 CTL_KERN = 0x1 CTL_MAXNAME = 0x18 CTL_NET = 0x4 DIOCGATTR = 0xc148648e DIOCGDELETE = 0x80106488 DIOCGFLUSH = 0x20006487 DIOCGFRONTSTUFF = 0x40086486 DIOCGFWHEADS = 0x40046483 DIOCGFWSECTORS = 0x40046482 DIOCGIDENT = 0x41006489 DIOCGMEDIASIZE = 0x40086481 DIOCGPHYSPATH = 0x4400648d DIOCGPROVIDERNAME = 0x4400648a DIOCGSECTORSIZE = 0x40046480 DIOCGSTRIPEOFFSET = 0x4008648c DIOCGSTRIPESIZE = 0x4008648b DIOCSKERNELDUMP = 0x80506490 DIOCSKERNELDUMP_FREEBSD11 = 0x80046485 DIOCZONECMD = 0xc080648f DLT_A429 = 0xb8 DLT_A653_ICM = 0xb9 DLT_AIRONET_HEADER = 0x78 DLT_AOS = 0xde DLT_APPLE_IP_OVER_IEEE1394 = 0x8a DLT_ARCNET = 0x7 DLT_ARCNET_LINUX = 0x81 DLT_ATM_CLIP = 0x13 DLT_ATM_RFC1483 = 0xb DLT_AURORA = 0x7e DLT_AX25 = 0x3 DLT_AX25_KISS = 0xca DLT_BACNET_MS_TP = 0xa5 DLT_BLUETOOTH_BREDR_BB = 0xff DLT_BLUETOOTH_HCI_H4 = 0xbb DLT_BLUETOOTH_HCI_H4_WITH_PHDR = 0xc9 DLT_BLUETOOTH_LE_LL = 0xfb DLT_BLUETOOTH_LE_LL_WITH_PHDR = 0x100 DLT_BLUETOOTH_LINUX_MONITOR = 0xfe DLT_CAN20B = 0xbe DLT_CAN_SOCKETCAN = 0xe3 DLT_CHAOS = 0x5 DLT_CHDLC = 0x68 DLT_CISCO_IOS = 0x76 DLT_CLASS_NETBSD_RAWAF = 0x2240000 DLT_C_HDLC = 0x68 DLT_C_HDLC_WITH_DIR = 0xcd DLT_DBUS = 0xe7 DLT_DECT = 0xdd DLT_DISPLAYPORT_AUX = 0x113 DLT_DOCSIS = 0x8f DLT_DOCSIS31_XRA31 = 0x111 DLT_DVB_CI = 0xeb DLT_ECONET = 0x73 DLT_EN10MB = 0x1 DLT_EN3MB = 0x2 DLT_ENC = 0x6d DLT_EPON = 0x103 DLT_ERF = 0xc5 DLT_ERF_ETH = 0xaf DLT_ERF_POS = 0xb0 DLT_ETHERNET_MPACKET = 0x112 DLT_FC_2 = 0xe0 DLT_FC_2_WITH_FRAME_DELIMS = 0xe1 DLT_FDDI = 0xa DLT_FLEXRAY = 0xd2 DLT_FRELAY = 0x6b DLT_FRELAY_WITH_DIR = 0xce DLT_GCOM_SERIAL = 0xad DLT_GCOM_T1E1 = 0xac DLT_GPF_F = 0xab DLT_GPF_T = 0xaa DLT_GPRS_LLC = 0xa9 DLT_GSMTAP_ABIS = 0xda DLT_GSMTAP_UM = 0xd9 DLT_IBM_SN = 0x92 DLT_IBM_SP = 0x91 DLT_IEEE802 = 0x6 DLT_IEEE802_11 = 0x69 DLT_IEEE802_11_RADIO = 0x7f DLT_IEEE802_11_RADIO_AVS = 0xa3 DLT_IEEE802_15_4 = 0xc3 DLT_IEEE802_15_4_LINUX = 0xbf DLT_IEEE802_15_4_NOFCS = 0xe6 DLT_IEEE802_15_4_NONASK_PHY = 0xd7 DLT_IEEE802_16_MAC_CPS = 0xbc DLT_IEEE802_16_MAC_CPS_RADIO = 0xc1 DLT_INFINIBAND = 0xf7 DLT_IPFILTER = 0x74 DLT_IPMB_KONTRON = 0xc7 DLT_IPMB_LINUX = 0xd1 DLT_IPMI_HPM_2 = 0x104 DLT_IPNET = 0xe2 DLT_IPOIB = 0xf2 DLT_IPV4 = 0xe4 DLT_IPV6 = 0xe5 DLT_IP_OVER_FC = 0x7a DLT_ISO_14443 = 0x108 DLT_JUNIPER_ATM1 = 0x89 DLT_JUNIPER_ATM2 = 0x87 DLT_JUNIPER_ATM_CEMIC = 0xee DLT_JUNIPER_CHDLC = 0xb5 DLT_JUNIPER_ES = 0x84 DLT_JUNIPER_ETHER = 0xb2 DLT_JUNIPER_FIBRECHANNEL = 0xea DLT_JUNIPER_FRELAY = 0xb4 DLT_JUNIPER_GGSN = 0x85 DLT_JUNIPER_ISM = 0xc2 DLT_JUNIPER_MFR = 0x86 DLT_JUNIPER_MLFR = 0x83 DLT_JUNIPER_MLPPP = 0x82 DLT_JUNIPER_MONITOR = 0xa4 DLT_JUNIPER_PIC_PEER = 0xae DLT_JUNIPER_PPP = 0xb3 DLT_JUNIPER_PPPOE = 0xa7 DLT_JUNIPER_PPPOE_ATM = 0xa8 DLT_JUNIPER_SERVICES = 0x88 DLT_JUNIPER_SRX_E2E = 0xe9 DLT_JUNIPER_ST = 0xc8 DLT_JUNIPER_VP = 0xb7 DLT_JUNIPER_VS = 0xe8 DLT_LAPB_WITH_DIR = 0xcf DLT_LAPD = 0xcb DLT_LIN = 0xd4 DLT_LINUX_EVDEV = 0xd8 DLT_LINUX_IRDA = 0x90 DLT_LINUX_LAPD = 0xb1 DLT_LINUX_PPP_WITHDIRECTION = 0xa6 DLT_LINUX_SLL = 0x71 DLT_LINUX_SLL2 = 0x114 DLT_LOOP = 0x6c DLT_LORATAP = 0x10e DLT_LTALK = 0x72 DLT_MATCHING_MAX = 0x114 DLT_MATCHING_MIN = 0x68 DLT_MFR = 0xb6 DLT_MOST = 0xd3 DLT_MPEG_2_TS = 0xf3 DLT_MPLS = 0xdb DLT_MTP2 = 0x8c DLT_MTP2_WITH_PHDR = 0x8b DLT_MTP3 = 0x8d DLT_MUX27010 = 0xec DLT_NETANALYZER = 0xf0 DLT_NETANALYZER_TRANSPARENT = 0xf1 DLT_NETLINK = 0xfd DLT_NFC_LLCP = 0xf5 DLT_NFLOG = 0xef DLT_NG40 = 0xf4 DLT_NORDIC_BLE = 0x110 DLT_NULL = 0x0 DLT_OPENFLOW = 0x10b DLT_PCI_EXP = 0x7d DLT_PFLOG = 0x75 DLT_PFSYNC = 0x79 DLT_PKTAP = 0x102 DLT_PPI = 0xc0 DLT_PPP = 0x9 DLT_PPP_BSDOS = 0xe DLT_PPP_ETHER = 0x33 DLT_PPP_PPPD = 0xa6 DLT_PPP_SERIAL = 0x32 DLT_PPP_WITH_DIR = 0xcc DLT_PPP_WITH_DIRECTION = 0xa6 DLT_PRISM_HEADER = 0x77 DLT_PROFIBUS_DL = 0x101 DLT_PRONET = 0x4 DLT_RAIF1 = 0xc6 DLT_RAW = 0xc DLT_RDS = 0x109 DLT_REDBACK_SMARTEDGE = 0x20 DLT_RIO = 0x7c DLT_RTAC_SERIAL = 0xfa DLT_SCCP = 0x8e DLT_SCTP = 0xf8 DLT_SDLC = 0x10c DLT_SITA = 0xc4 DLT_SLIP = 0x8 DLT_SLIP_BSDOS = 0xd DLT_STANAG_5066_D_PDU = 0xed DLT_SUNATM = 0x7b DLT_SYMANTEC_FIREWALL = 0x63 DLT_TI_LLN_SNIFFER = 0x10d DLT_TZSP = 0x80 DLT_USB = 0xba DLT_USBPCAP = 0xf9 DLT_USB_DARWIN = 0x10a DLT_USB_FREEBSD = 0xba DLT_USB_LINUX = 0xbd DLT_USB_LINUX_MMAPPED = 0xdc DLT_USER0 = 0x93 DLT_USER1 = 0x94 DLT_USER10 = 0x9d DLT_USER11 = 0x9e DLT_USER12 = 0x9f DLT_USER13 = 0xa0 DLT_USER14 = 0xa1 DLT_USER15 = 0xa2 DLT_USER2 = 0x95 DLT_USER3 = 0x96 DLT_USER4 = 0x97 DLT_USER5 = 0x98 DLT_USER6 = 0x99 DLT_USER7 = 0x9a DLT_USER8 = 0x9b DLT_USER9 = 0x9c DLT_VSOCK = 0x10f DLT_WATTSTOPPER_DLM = 0x107 DLT_WIHART = 0xdf DLT_WIRESHARK_UPPER_PDU = 0xfc DLT_X2E_SERIAL = 0xd5 DLT_X2E_XORAYA = 0xd6 DLT_ZWAVE_R1_R2 = 0x105 DLT_ZWAVE_R3 = 0x106 DT_BLK = 0x6 DT_CHR = 0x2 DT_DIR = 0x4 DT_FIFO = 0x1 DT_LNK = 0xa DT_REG = 0x8 DT_SOCK = 0xc DT_UNKNOWN = 0x0 DT_WHT = 0xe ECHO = 0x8 ECHOCTL = 0x40 ECHOE = 0x2 ECHOK = 0x4 ECHOKE = 0x1 ECHONL = 0x10 ECHOPRT = 0x20 EVFILT_AIO = -0x3 EVFILT_EMPTY = -0xd EVFILT_FS = -0x9 EVFILT_LIO = -0xa EVFILT_PROC = -0x5 EVFILT_PROCDESC = -0x8 EVFILT_READ = -0x1 EVFILT_SENDFILE = -0xc EVFILT_SIGNAL = -0x6 EVFILT_SYSCOUNT = 0xd EVFILT_TIMER = -0x7 EVFILT_USER = -0xb EVFILT_VNODE = -0x4 EVFILT_WRITE = -0x2 EVNAMEMAP_NAME_SIZE = 0x40 EV_ADD = 0x1 EV_CLEAR = 0x20 EV_DELETE = 0x2 EV_DISABLE = 0x8 EV_DISPATCH = 0x80 EV_DROP = 0x1000 EV_ENABLE = 0x4 EV_EOF = 0x8000 EV_ERROR = 0x4000 EV_FLAG1 = 0x2000 EV_FLAG2 = 0x4000 EV_FORCEONESHOT = 0x100 EV_ONESHOT = 0x10 EV_RECEIPT = 0x40 EV_SYSFLAGS = 0xf000 EXTA = 0x4b00 EXTATTR_MAXNAMELEN = 0xff EXTATTR_NAMESPACE_EMPTY = 0x0 EXTATTR_NAMESPACE_SYSTEM = 0x2 EXTATTR_NAMESPACE_USER = 0x1 EXTB = 0x9600 EXTPROC = 0x800 FD_CLOEXEC = 0x1 FD_SETSIZE = 0x400 FLUSHO = 0x800000 F_CANCEL = 0x5 F_DUP2FD = 0xa F_DUP2FD_CLOEXEC = 0x12 F_DUPFD = 0x0 F_DUPFD_CLOEXEC = 0x11 F_GETFD = 0x1 F_GETFL = 0x3 F_GETLK = 0xb F_GETOWN = 0x5 F_OGETLK = 0x7 F_OK = 0x0 F_OSETLK = 0x8 F_OSETLKW = 0x9 F_RDAHEAD = 0x10 F_RDLCK = 0x1 F_READAHEAD = 0xf F_SETFD = 0x2 F_SETFL = 0x4 F_SETLK = 0xc F_SETLKW = 0xd F_SETLK_REMOTE = 0xe F_SETOWN = 0x6 F_UNLCK = 0x2 F_UNLCKSYS = 0x4 F_WRLCK = 0x3 HUPCL = 0x4000 HW_MACHINE = 0x1 ICANON = 0x100 ICMP6_FILTER = 0x12 ICRNL = 0x100 IEXTEN = 0x400 IFAN_ARRIVAL = 0x0 IFAN_DEPARTURE = 0x1 IFCAP_WOL_MAGIC = 0x2000 IFF_ALLMULTI = 0x200 IFF_ALTPHYS = 0x4000 IFF_BROADCAST = 0x2 IFF_CANTCHANGE = 0x218f52 IFF_CANTCONFIG = 0x10000 IFF_DEBUG = 0x4 IFF_DRV_OACTIVE = 0x400 IFF_DRV_RUNNING = 0x40 IFF_DYING = 0x200000 IFF_LINK0 = 0x1000 IFF_LINK1 = 0x2000 IFF_LINK2 = 0x4000 IFF_LOOPBACK = 0x8 IFF_MONITOR = 0x40000 IFF_MULTICAST = 0x8000 IFF_NOARP = 0x80 IFF_NOGROUP = 0x800000 IFF_OACTIVE = 0x400 IFF_POINTOPOINT = 0x10 IFF_PPROMISC = 0x20000 IFF_PROMISC = 0x100 IFF_RENAMING = 0x400000 IFF_RUNNING = 0x40 IFF_SIMPLEX = 0x800 IFF_STATICARP = 0x80000 IFF_UP = 0x1 IFNAMSIZ = 0x10 IFT_BRIDGE = 0xd1 IFT_CARP = 0xf8 IFT_IEEE1394 = 0x90 IFT_INFINIBAND = 0xc7 IFT_L2VLAN = 0x87 IFT_L3IPVLAN = 0x88 IFT_PPP = 0x17 IFT_PROPVIRTUAL = 0x35 IGNBRK = 0x1 IGNCR = 0x80 IGNPAR = 0x4 IMAXBEL = 0x2000 INLCR = 0x40 INPCK = 0x10 IN_CLASSA_HOST = 0xffffff IN_CLASSA_MAX = 0x80 IN_CLASSA_NET = 0xff000000 IN_CLASSA_NSHIFT = 0x18 IN_CLASSB_HOST = 0xffff IN_CLASSB_MAX = 0x10000 IN_CLASSB_NET = 0xffff0000 IN_CLASSB_NSHIFT = 0x10 IN_CLASSC_HOST = 0xff IN_CLASSC_NET = 0xffffff00 IN_CLASSC_NSHIFT = 0x8 IN_CLASSD_HOST = 0xfffffff IN_CLASSD_NET = 0xf0000000 IN_CLASSD_NSHIFT = 0x1c IN_LOOPBACKNET = 0x7f IN_RFC3021_MASK = 0xfffffffe IPPROTO_3PC = 0x22 IPPROTO_ADFS = 0x44 IPPROTO_AH = 0x33 IPPROTO_AHIP = 0x3d IPPROTO_APES = 0x63 IPPROTO_ARGUS = 0xd IPPROTO_AX25 = 0x5d IPPROTO_BHA = 0x31 IPPROTO_BLT = 0x1e IPPROTO_BRSATMON = 0x4c IPPROTO_CARP = 0x70 IPPROTO_CFTP = 0x3e IPPROTO_CHAOS = 0x10 IPPROTO_CMTP = 0x26 IPPROTO_CPHB = 0x49 IPPROTO_CPNX = 0x48 IPPROTO_DCCP = 0x21 IPPROTO_DDP = 0x25 IPPROTO_DGP = 0x56 IPPROTO_DIVERT = 0x102 IPPROTO_DONE = 0x101 IPPROTO_DSTOPTS = 0x3c IPPROTO_EGP = 0x8 IPPROTO_EMCON = 0xe IPPROTO_ENCAP = 0x62 IPPROTO_EON = 0x50 IPPROTO_ESP = 0x32 IPPROTO_ETHERIP = 0x61 IPPROTO_FRAGMENT = 0x2c IPPROTO_GGP = 0x3 IPPROTO_GMTP = 0x64 IPPROTO_GRE = 0x2f IPPROTO_HELLO = 0x3f IPPROTO_HIP = 0x8b IPPROTO_HMP = 0x14 IPPROTO_HOPOPTS = 0x0 IPPROTO_ICMP = 0x1 IPPROTO_ICMPV6 = 0x3a IPPROTO_IDP = 0x16 IPPROTO_IDPR = 0x23 IPPROTO_IDRP = 0x2d IPPROTO_IGMP = 0x2 IPPROTO_IGP = 0x55 IPPROTO_IGRP = 0x58 IPPROTO_IL = 0x28 IPPROTO_INLSP = 0x34 IPPROTO_INP = 0x20 IPPROTO_IP = 0x0 IPPROTO_IPCOMP = 0x6c IPPROTO_IPCV = 0x47 IPPROTO_IPEIP = 0x5e IPPROTO_IPIP = 0x4 IPPROTO_IPPC = 0x43 IPPROTO_IPV4 = 0x4 IPPROTO_IPV6 = 0x29 IPPROTO_IRTP = 0x1c IPPROTO_KRYPTOLAN = 0x41 IPPROTO_LARP = 0x5b IPPROTO_LEAF1 = 0x19 IPPROTO_LEAF2 = 0x1a IPPROTO_MAX = 0x100 IPPROTO_MEAS = 0x13 IPPROTO_MH = 0x87 IPPROTO_MHRP = 0x30 IPPROTO_MICP = 0x5f IPPROTO_MOBILE = 0x37 IPPROTO_MPLS = 0x89 IPPROTO_MTP = 0x5c IPPROTO_MUX = 0x12 IPPROTO_ND = 0x4d IPPROTO_NHRP = 0x36 IPPROTO_NONE = 0x3b IPPROTO_NSP = 0x1f IPPROTO_NVPII = 0xb IPPROTO_OLD_DIVERT = 0xfe IPPROTO_OSPFIGP = 0x59 IPPROTO_PFSYNC = 0xf0 IPPROTO_PGM = 0x71 IPPROTO_PIGP = 0x9 IPPROTO_PIM = 0x67 IPPROTO_PRM = 0x15 IPPROTO_PUP = 0xc IPPROTO_PVP = 0x4b IPPROTO_RAW = 0xff IPPROTO_RCCMON = 0xa IPPROTO_RDP = 0x1b IPPROTO_RESERVED_253 = 0xfd IPPROTO_RESERVED_254 = 0xfe IPPROTO_ROUTING = 0x2b IPPROTO_RSVP = 0x2e IPPROTO_RVD = 0x42 IPPROTO_SATEXPAK = 0x40 IPPROTO_SATMON = 0x45 IPPROTO_SCCSP = 0x60 IPPROTO_SCTP = 0x84 IPPROTO_SDRP = 0x2a IPPROTO_SEND = 0x103 IPPROTO_SHIM6 = 0x8c IPPROTO_SKIP = 0x39 IPPROTO_SPACER = 0x7fff IPPROTO_SRPC = 0x5a IPPROTO_ST = 0x7 IPPROTO_SVMTP = 0x52 IPPROTO_SWIPE = 0x35 IPPROTO_TCF = 0x57 IPPROTO_TCP = 0x6 IPPROTO_TLSP = 0x38 IPPROTO_TP = 0x1d IPPROTO_TPXX = 0x27 IPPROTO_TRUNK1 = 0x17 IPPROTO_TRUNK2 = 0x18 IPPROTO_TTP = 0x54 IPPROTO_UDP = 0x11 IPPROTO_UDPLITE = 0x88 IPPROTO_VINES = 0x53 IPPROTO_VISA = 0x46 IPPROTO_VMTP = 0x51 IPPROTO_WBEXPAK = 0x4f IPPROTO_WBMON = 0x4e IPPROTO_WSN = 0x4a IPPROTO_XNET = 0xf IPPROTO_XTP = 0x24 IPV6_AUTOFLOWLABEL = 0x3b IPV6_BINDANY = 0x40 IPV6_BINDMULTI = 0x41 IPV6_BINDV6ONLY = 0x1b IPV6_CHECKSUM = 0x1a IPV6_DEFAULT_MULTICAST_HOPS = 0x1 IPV6_DEFAULT_MULTICAST_LOOP = 0x1 IPV6_DEFHLIM = 0x40 IPV6_DONTFRAG = 0x3e IPV6_DSTOPTS = 0x32 IPV6_FLOWID = 0x43 IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_LEN = 0x14 IPV6_FLOWLABEL_MASK = 0xffff0f00 IPV6_FLOWTYPE = 0x44 IPV6_FRAGTTL = 0x78 IPV6_FW_ADD = 0x1e IPV6_FW_DEL = 0x1f IPV6_FW_FLUSH = 0x20 IPV6_FW_GET = 0x22 IPV6_FW_ZERO = 0x21 IPV6_HLIMDEC = 0x1 IPV6_HOPLIMIT = 0x2f IPV6_HOPOPTS = 0x31 IPV6_IPSEC_POLICY = 0x1c IPV6_JOIN_GROUP = 0xc IPV6_LEAVE_GROUP = 0xd IPV6_MAXHLIM = 0xff IPV6_MAXOPTHDR = 0x800 IPV6_MAXPACKET = 0xffff IPV6_MAX_GROUP_SRC_FILTER = 0x200 IPV6_MAX_MEMBERSHIPS = 0xfff IPV6_MAX_SOCK_SRC_FILTER = 0x80 IPV6_MMTU = 0x500 IPV6_MSFILTER = 0x4a IPV6_MULTICAST_HOPS = 0xa IPV6_MULTICAST_IF = 0x9 IPV6_MULTICAST_LOOP = 0xb IPV6_NEXTHOP = 0x30 IPV6_ORIGDSTADDR = 0x48 IPV6_PATHMTU = 0x2c IPV6_PKTINFO = 0x2e IPV6_PORTRANGE = 0xe IPV6_PORTRANGE_DEFAULT = 0x0 IPV6_PORTRANGE_HIGH = 0x1 IPV6_PORTRANGE_LOW = 0x2 IPV6_PREFER_TEMPADDR = 0x3f IPV6_RECVDSTOPTS = 0x28 IPV6_RECVFLOWID = 0x46 IPV6_RECVHOPLIMIT = 0x25 IPV6_RECVHOPOPTS = 0x27 IPV6_RECVORIGDSTADDR = 0x48 IPV6_RECVPATHMTU = 0x2b IPV6_RECVPKTINFO = 0x24 IPV6_RECVRSSBUCKETID = 0x47 IPV6_RECVRTHDR = 0x26 IPV6_RECVTCLASS = 0x39 IPV6_RSSBUCKETID = 0x45 IPV6_RSS_LISTEN_BUCKET = 0x42 IPV6_RTHDR = 0x33 IPV6_RTHDRDSTOPTS = 0x23 IPV6_RTHDR_LOOSE = 0x0 IPV6_RTHDR_STRICT = 0x1 IPV6_RTHDR_TYPE_0 = 0x0 IPV6_SOCKOPT_RESERVED1 = 0x3 IPV6_TCLASS = 0x3d IPV6_UNICAST_HOPS = 0x4 IPV6_USE_MIN_MTU = 0x2a IPV6_V6ONLY = 0x1b IPV6_VERSION = 0x60 IPV6_VERSION_MASK = 0xf0 IPV6_VLAN_PCP = 0x4b IP_ADD_MEMBERSHIP = 0xc IP_ADD_SOURCE_MEMBERSHIP = 0x46 IP_BINDANY = 0x18 IP_BINDMULTI = 0x19 IP_BLOCK_SOURCE = 0x48 IP_DEFAULT_MULTICAST_LOOP = 0x1 IP_DEFAULT_MULTICAST_TTL = 0x1 IP_DF = 0x4000 IP_DONTFRAG = 0x43 IP_DROP_MEMBERSHIP = 0xd IP_DROP_SOURCE_MEMBERSHIP = 0x47 IP_DUMMYNET3 = 0x31 IP_DUMMYNET_CONFIGURE = 0x3c IP_DUMMYNET_DEL = 0x3d IP_DUMMYNET_FLUSH = 0x3e IP_DUMMYNET_GET = 0x40 IP_FLOWID = 0x5a IP_FLOWTYPE = 0x5b IP_FW3 = 0x30 IP_FW_ADD = 0x32 IP_FW_DEL = 0x33 IP_FW_FLUSH = 0x34 IP_FW_GET = 0x36 IP_FW_NAT_CFG = 0x38 IP_FW_NAT_DEL = 0x39 IP_FW_NAT_GET_CONFIG = 0x3a IP_FW_NAT_GET_LOG = 0x3b IP_FW_RESETLOG = 0x37 IP_FW_TABLE_ADD = 0x28 IP_FW_TABLE_DEL = 0x29 IP_FW_TABLE_FLUSH = 0x2a IP_FW_TABLE_GETSIZE = 0x2b IP_FW_TABLE_LIST = 0x2c IP_FW_ZERO = 0x35 IP_HDRINCL = 0x2 IP_IPSEC_POLICY = 0x15 IP_MAXPACKET = 0xffff IP_MAX_GROUP_SRC_FILTER = 0x200 IP_MAX_MEMBERSHIPS = 0xfff IP_MAX_SOCK_MUTE_FILTER = 0x80 IP_MAX_SOCK_SRC_FILTER = 0x80 IP_MF = 0x2000 IP_MINTTL = 0x42 IP_MSFILTER = 0x4a IP_MSS = 0x240 IP_MULTICAST_IF = 0x9 IP_MULTICAST_LOOP = 0xb IP_MULTICAST_TTL = 0xa IP_MULTICAST_VIF = 0xe IP_OFFMASK = 0x1fff IP_ONESBCAST = 0x17 IP_OPTIONS = 0x1 IP_ORIGDSTADDR = 0x1b IP_PORTRANGE = 0x13 IP_PORTRANGE_DEFAULT = 0x0 IP_PORTRANGE_HIGH = 0x1 IP_PORTRANGE_LOW = 0x2 IP_RECVDSTADDR = 0x7 IP_RECVFLOWID = 0x5d IP_RECVIF = 0x14 IP_RECVOPTS = 0x5 IP_RECVORIGDSTADDR = 0x1b IP_RECVRETOPTS = 0x6 IP_RECVRSSBUCKETID = 0x5e IP_RECVTOS = 0x44 IP_RECVTTL = 0x41 IP_RETOPTS = 0x8 IP_RF = 0x8000 IP_RSSBUCKETID = 0x5c IP_RSS_LISTEN_BUCKET = 0x1a IP_RSVP_OFF = 0x10 IP_RSVP_ON = 0xf IP_RSVP_VIF_OFF = 0x12 IP_RSVP_VIF_ON = 0x11 IP_SENDSRCADDR = 0x7 IP_TOS = 0x3 IP_TTL = 0x4 IP_UNBLOCK_SOURCE = 0x49 IP_VLAN_PCP = 0x4b ISIG = 0x80 ISTRIP = 0x20 ITIMER_PROF = 0x2 ITIMER_REAL = 0x0 ITIMER_VIRTUAL = 0x1 IXANY = 0x800 IXOFF = 0x400 IXON = 0x200 KERN_HOSTNAME = 0xa KERN_OSRELEASE = 0x2 KERN_OSTYPE = 0x1 KERN_VERSION = 0x4 LOCAL_CONNWAIT = 0x4 LOCAL_CREDS = 0x2 LOCAL_PEERCRED = 0x1 LOCAL_VENDOR = 0x80000000 LOCK_EX = 0x2 LOCK_NB = 0x4 LOCK_SH = 0x1 LOCK_UN = 0x8 MADV_AUTOSYNC = 0x7 MADV_CORE = 0x9 MADV_DONTNEED = 0x4 MADV_FREE = 0x5 MADV_NOCORE = 0x8 MADV_NORMAL = 0x0 MADV_NOSYNC = 0x6 MADV_PROTECT = 0xa MADV_RANDOM = 0x1 MADV_SEQUENTIAL = 0x2 MADV_WILLNEED = 0x3 MAP_32BIT = 0x80000 MAP_ALIGNED_SUPER = 0x1000000 MAP_ALIGNMENT_MASK = -0x1000000 MAP_ALIGNMENT_SHIFT = 0x18 MAP_ANON = 0x1000 MAP_ANONYMOUS = 0x1000 MAP_COPY = 0x2 MAP_EXCL = 0x4000 MAP_FILE = 0x0 MAP_FIXED = 0x10 MAP_GUARD = 0x2000 MAP_HASSEMAPHORE = 0x200 MAP_NOCORE = 0x20000 MAP_NOSYNC = 0x800 MAP_PREFAULT_READ = 0x40000 MAP_PRIVATE = 0x2 MAP_RESERVED0020 = 0x20 MAP_RESERVED0040 = 0x40 MAP_RESERVED0080 = 0x80 MAP_RESERVED0100 = 0x100 MAP_SHARED = 0x1 MAP_STACK = 0x400 MCAST_BLOCK_SOURCE = 0x54 MCAST_EXCLUDE = 0x2 MCAST_INCLUDE = 0x1 MCAST_JOIN_GROUP = 0x50 MCAST_JOIN_SOURCE_GROUP = 0x52 MCAST_LEAVE_GROUP = 0x51 MCAST_LEAVE_SOURCE_GROUP = 0x53 MCAST_UNBLOCK_SOURCE = 0x55 MCAST_UNDEFINED = 0x0 MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MNT_ACLS = 0x8000000 MNT_ASYNC = 0x40 MNT_AUTOMOUNTED = 0x200000000 MNT_BYFSID = 0x8000000 MNT_CMDFLAGS = 0xd0f0000 MNT_DEFEXPORTED = 0x200 MNT_DELEXPORT = 0x20000 MNT_EXKERB = 0x800 MNT_EXPORTANON = 0x400 MNT_EXPORTED = 0x100 MNT_EXPUBLIC = 0x20000000 MNT_EXRDONLY = 0x80 MNT_FORCE = 0x80000 MNT_GJOURNAL = 0x2000000 MNT_IGNORE = 0x800000 MNT_LAZY = 0x3 MNT_LOCAL = 0x1000 MNT_MULTILABEL = 0x4000000 MNT_NFS4ACLS = 0x10 MNT_NOATIME = 0x10000000 MNT_NOCLUSTERR = 0x40000000 MNT_NOCLUSTERW = 0x80000000 MNT_NOEXEC = 0x4 MNT_NONBUSY = 0x4000000 MNT_NOSUID = 0x8 MNT_NOSYMFOLLOW = 0x400000 MNT_NOWAIT = 0x2 MNT_QUOTA = 0x2000 MNT_RDONLY = 0x1 MNT_RELOAD = 0x40000 MNT_ROOTFS = 0x4000 MNT_SNAPSHOT = 0x1000000 MNT_SOFTDEP = 0x200000 MNT_SUIDDIR = 0x100000 MNT_SUJ = 0x100000000 MNT_SUSPEND = 0x4 MNT_SYNCHRONOUS = 0x2 MNT_UNION = 0x20 MNT_UNTRUSTED = 0x800000000 MNT_UPDATE = 0x10000 MNT_UPDATEMASK = 0xad8d0807e MNT_USER = 0x8000 MNT_VERIFIED = 0x400000000 MNT_VISFLAGMASK = 0xffef0ffff MNT_WAIT = 0x1 MSG_CMSG_CLOEXEC = 0x40000 MSG_COMPAT = 0x8000 MSG_CTRUNC = 0x20 MSG_DONTROUTE = 0x4 MSG_DONTWAIT = 0x80 MSG_EOF = 0x100 MSG_EOR = 0x8 MSG_NBIO = 0x4000 MSG_NOSIGNAL = 0x20000 MSG_NOTIFICATION = 0x2000 MSG_OOB = 0x1 MSG_PEEK = 0x2 MSG_TRUNC = 0x10 MSG_WAITALL = 0x40 MSG_WAITFORONE = 0x80000 MS_ASYNC = 0x1 MS_INVALIDATE = 0x2 MS_SYNC = 0x0 NAME_MAX = 0xff NET_RT_DUMP = 0x1 NET_RT_FLAGS = 0x2 NET_RT_IFLIST = 0x3 NET_RT_IFLISTL = 0x5 NET_RT_IFMALIST = 0x4 NFDBITS = 0x40 NOFLSH = 0x80000000 NOKERNINFO = 0x2000000 NOTE_ABSTIME = 0x10 NOTE_ATTRIB = 0x8 NOTE_CHILD = 0x4 NOTE_CLOSE = 0x100 NOTE_CLOSE_WRITE = 0x200 NOTE_DELETE = 0x1 NOTE_EXEC = 0x20000000 NOTE_EXIT = 0x80000000 NOTE_EXTEND = 0x4 NOTE_FFAND = 0x40000000 NOTE_FFCOPY = 0xc0000000 NOTE_FFCTRLMASK = 0xc0000000 NOTE_FFLAGSMASK = 0xffffff NOTE_FFNOP = 0x0 NOTE_FFOR = 0x80000000 NOTE_FILE_POLL = 0x2 NOTE_FORK = 0x40000000 NOTE_LINK = 0x10 NOTE_LOWAT = 0x1 NOTE_MSECONDS = 0x2 NOTE_NSECONDS = 0x8 NOTE_OPEN = 0x80 NOTE_PCTRLMASK = 0xf0000000 NOTE_PDATAMASK = 0xfffff NOTE_READ = 0x400 NOTE_RENAME = 0x20 NOTE_REVOKE = 0x40 NOTE_SECONDS = 0x1 NOTE_TRACK = 0x1 NOTE_TRACKERR = 0x2 NOTE_TRIGGER = 0x1000000 NOTE_USECONDS = 0x4 NOTE_WRITE = 0x2 OCRNL = 0x10 ONLCR = 0x2 ONLRET = 0x40 ONOCR = 0x20 ONOEOT = 0x8 OPOST = 0x1 OXTABS = 0x4 O_ACCMODE = 0x3 O_APPEND = 0x8 O_ASYNC = 0x40 O_CLOEXEC = 0x100000 O_CREAT = 0x200 O_DIRECT = 0x10000 O_DIRECTORY = 0x20000 O_EXCL = 0x800 O_EXEC = 0x40000 O_EXLOCK = 0x20 O_FSYNC = 0x80 O_NDELAY = 0x4 O_NOCTTY = 0x8000 O_NOFOLLOW = 0x100 O_NONBLOCK = 0x4 O_RDONLY = 0x0 O_RDWR = 0x2 O_RESOLVE_BENEATH = 0x800000 O_SEARCH = 0x40000 O_SHLOCK = 0x10 O_SYNC = 0x80 O_TRUNC = 0x400 O_TTY_INIT = 0x80000 O_VERIFY = 0x200000 O_WRONLY = 0x1 PARENB = 0x1000 PARMRK = 0x8 PARODD = 0x2000 PENDIN = 0x20000000 PIOD_READ_D = 0x1 PIOD_READ_I = 0x3 PIOD_WRITE_D = 0x2 PIOD_WRITE_I = 0x4 PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 PROT_EXEC = 0x4 PROT_NONE = 0x0 PROT_READ = 0x1 PROT_WRITE = 0x2 PTRACE_DEFAULT = 0x1 PTRACE_EXEC = 0x1 PTRACE_FORK = 0x8 PTRACE_LWP = 0x10 PTRACE_SCE = 0x2 PTRACE_SCX = 0x4 PTRACE_SYSCALL = 0x6 PTRACE_VFORK = 0x20 PT_ATTACH = 0xa PT_CLEARSTEP = 0x10 PT_CONTINUE = 0x7 PT_DETACH = 0xb PT_FIRSTMACH = 0x40 PT_FOLLOW_FORK = 0x17 PT_GETDBREGS = 0x25 PT_GETFPREGS = 0x23 PT_GETFSBASE = 0x47 PT_GETGSBASE = 0x49 PT_GETLWPLIST = 0xf PT_GETNUMLWPS = 0xe PT_GETREGS = 0x21 PT_GETXSTATE = 0x45 PT_GETXSTATE_INFO = 0x44 PT_GET_EVENT_MASK = 0x19 PT_GET_SC_ARGS = 0x1b PT_GET_SC_RET = 0x1c PT_IO = 0xc PT_KILL = 0x8 PT_LWPINFO = 0xd PT_LWP_EVENTS = 0x18 PT_READ_D = 0x2 PT_READ_I = 0x1 PT_RESUME = 0x13 PT_SETDBREGS = 0x26 PT_SETFPREGS = 0x24 PT_SETFSBASE = 0x48 PT_SETGSBASE = 0x4a PT_SETREGS = 0x22 PT_SETSTEP = 0x11 PT_SETXSTATE = 0x46 PT_SET_EVENT_MASK = 0x1a PT_STEP = 0x9 PT_SUSPEND = 0x12 PT_SYSCALL = 0x16 PT_TO_SCE = 0x14 PT_TO_SCX = 0x15 PT_TRACE_ME = 0x0 PT_VM_ENTRY = 0x29 PT_VM_TIMESTAMP = 0x28 PT_WRITE_D = 0x5 PT_WRITE_I = 0x4 P_ZONEID = 0xc RLIMIT_AS = 0xa RLIMIT_CORE = 0x4 RLIMIT_CPU = 0x0 RLIMIT_DATA = 0x2 RLIMIT_FSIZE = 0x1 RLIMIT_MEMLOCK = 0x6 RLIMIT_NOFILE = 0x8 RLIMIT_NPROC = 0x7 RLIMIT_RSS = 0x5 RLIMIT_STACK = 0x3 RLIM_INFINITY = 0x7fffffffffffffff RTAX_AUTHOR = 0x6 RTAX_BRD = 0x7 RTAX_DST = 0x0 RTAX_GATEWAY = 0x1 RTAX_GENMASK = 0x3 RTAX_IFA = 0x5 RTAX_IFP = 0x4 RTAX_MAX = 0x8 RTAX_NETMASK = 0x2 RTA_AUTHOR = 0x40 RTA_BRD = 0x80 RTA_DST = 0x1 RTA_GATEWAY = 0x2 RTA_GENMASK = 0x8 RTA_IFA = 0x20 RTA_IFP = 0x10 RTA_NETMASK = 0x4 RTF_BLACKHOLE = 0x1000 RTF_BROADCAST = 0x400000 RTF_DONE = 0x40 RTF_DYNAMIC = 0x10 RTF_FIXEDMTU = 0x80000 RTF_FMASK = 0x1004d808 RTF_GATEWAY = 0x2 RTF_GWFLAG_COMPAT = 0x80000000 RTF_HOST = 0x4 RTF_LLDATA = 0x400 RTF_LLINFO = 0x400 RTF_LOCAL = 0x200000 RTF_MODIFIED = 0x20 RTF_MULTICAST = 0x800000 RTF_PINNED = 0x100000 RTF_PROTO1 = 0x8000 RTF_PROTO2 = 0x4000 RTF_PROTO3 = 0x40000 RTF_REJECT = 0x8 RTF_RNH_LOCKED = 0x40000000 RTF_STATIC = 0x800 RTF_STICKY = 0x10000000 RTF_UP = 0x1 RTF_XRESOLVE = 0x200 RTM_ADD = 0x1 RTM_CHANGE = 0x3 RTM_DELADDR = 0xd RTM_DELETE = 0x2 RTM_DELMADDR = 0x10 RTM_GET = 0x4 RTM_IEEE80211 = 0x12 RTM_IFANNOUNCE = 0x11 RTM_IFINFO = 0xe RTM_LOCK = 0x8 RTM_LOSING = 0x5 RTM_MISS = 0x7 RTM_NEWADDR = 0xc RTM_NEWMADDR = 0xf RTM_REDIRECT = 0x6 RTM_RESOLVE = 0xb RTM_RTTUNIT = 0xf4240 RTM_VERSION = 0x5 RTV_EXPIRE = 0x4 RTV_HOPCOUNT = 0x2 RTV_MTU = 0x1 RTV_RPIPE = 0x8 RTV_RTT = 0x40 RTV_RTTVAR = 0x80 RTV_SPIPE = 0x10 RTV_SSTHRESH = 0x20 RTV_WEIGHT = 0x100 RT_ALL_FIBS = -0x1 RT_BLACKHOLE = 0x40 RT_DEFAULT_FIB = 0x0 RT_HAS_GW = 0x80 RT_HAS_HEADER = 0x10 RT_HAS_HEADER_BIT = 0x4 RT_L2_ME = 0x4 RT_L2_ME_BIT = 0x2 RT_LLE_CACHE = 0x100 RT_MAY_LOOP = 0x8 RT_MAY_LOOP_BIT = 0x3 RT_REJECT = 0x20 RUSAGE_CHILDREN = -0x1 RUSAGE_SELF = 0x0 RUSAGE_THREAD = 0x1 SCM_BINTIME = 0x4 SCM_CREDS = 0x3 SCM_MONOTONIC = 0x6 SCM_REALTIME = 0x5 SCM_RIGHTS = 0x1 SCM_TIMESTAMP = 0x2 SCM_TIME_INFO = 0x7 SEEK_CUR = 0x1 SEEK_DATA = 0x3 SEEK_END = 0x2 SEEK_HOLE = 0x4 SEEK_SET = 0x0 SHUT_RD = 0x0 SHUT_RDWR = 0x2 SHUT_WR = 0x1 SIOCADDMULTI = 0x80206931 SIOCAIFADDR = 0x8040691a SIOCAIFGROUP = 0x80286987 SIOCATMARK = 0x40047307 SIOCDELMULTI = 0x80206932 SIOCDIFADDR = 0x80206919 SIOCDIFGROUP = 0x80286989 SIOCDIFPHYADDR = 0x80206949 SIOCGDRVSPEC = 0xc028697b SIOCGETSGCNT = 0xc0207210 SIOCGETVIFCNT = 0xc028720f SIOCGHIWAT = 0x40047301 SIOCGHWADDR = 0xc020693e SIOCGI2C = 0xc020693d SIOCGIFADDR = 0xc0206921 SIOCGIFALIAS = 0xc044692d SIOCGIFBRDADDR = 0xc0206923 SIOCGIFCAP = 0xc020691f SIOCGIFCONF = 0xc0106924 SIOCGIFDESCR = 0xc020692a SIOCGIFDOWNREASON = 0xc058699a SIOCGIFDSTADDR = 0xc0206922 SIOCGIFFIB = 0xc020695c SIOCGIFFLAGS = 0xc0206911 SIOCGIFGENERIC = 0xc020693a SIOCGIFGMEMB = 0xc028698a SIOCGIFGROUP = 0xc0286988 SIOCGIFINDEX = 0xc0206920 SIOCGIFMAC = 0xc0206926 SIOCGIFMEDIA = 0xc0306938 SIOCGIFMETRIC = 0xc0206917 SIOCGIFMTU = 0xc0206933 SIOCGIFNETMASK = 0xc0206925 SIOCGIFPDSTADDR = 0xc0206948 SIOCGIFPHYS = 0xc0206935 SIOCGIFPSRCADDR = 0xc0206947 SIOCGIFRSSHASH = 0xc0186997 SIOCGIFRSSKEY = 0xc0946996 SIOCGIFSTATUS = 0xc331693b SIOCGIFXMEDIA = 0xc030698b SIOCGLANPCP = 0xc0206998 SIOCGLOWAT = 0x40047303 SIOCGPGRP = 0x40047309 SIOCGPRIVATE_0 = 0xc0206950 SIOCGPRIVATE_1 = 0xc0206951 SIOCGTUNFIB = 0xc020695e SIOCIFCREATE = 0xc020697a SIOCIFCREATE2 = 0xc020697c SIOCIFDESTROY = 0x80206979 SIOCIFGCLONERS = 0xc0106978 SIOCSDRVSPEC = 0x8028697b SIOCSHIWAT = 0x80047300 SIOCSIFADDR = 0x8020690c SIOCSIFBRDADDR = 0x80206913 SIOCSIFCAP = 0x8020691e SIOCSIFDESCR = 0x80206929 SIOCSIFDSTADDR = 0x8020690e SIOCSIFFIB = 0x8020695d SIOCSIFFLAGS = 0x80206910 SIOCSIFGENERIC = 0x80206939 SIOCSIFLLADDR = 0x8020693c SIOCSIFMAC = 0x80206927 SIOCSIFMEDIA = 0xc0206937 SIOCSIFMETRIC = 0x80206918 SIOCSIFMTU = 0x80206934 SIOCSIFNAME = 0x80206928 SIOCSIFNETMASK = 0x80206916 SIOCSIFPHYADDR = 0x80406946 SIOCSIFPHYS = 0x80206936 SIOCSIFRVNET = 0xc020695b SIOCSIFVNET = 0xc020695a SIOCSLANPCP = 0x80206999 SIOCSLOWAT = 0x80047302 SIOCSPGRP = 0x80047308 SIOCSTUNFIB = 0x8020695f SOCK_CLOEXEC = 0x10000000 SOCK_DGRAM = 0x2 SOCK_MAXADDRLEN = 0xff SOCK_NONBLOCK = 0x20000000 SOCK_RAW = 0x3 SOCK_RDM = 0x4 SOCK_SEQPACKET = 0x5 SOCK_STREAM = 0x1 SOL_LOCAL = 0x0 SOL_SOCKET = 0xffff SOMAXCONN = 0x80 SO_ACCEPTCONN = 0x2 SO_ACCEPTFILTER = 0x1000 SO_BINTIME = 0x2000 SO_BROADCAST = 0x20 SO_DEBUG = 0x1 SO_DOMAIN = 0x1019 SO_DONTROUTE = 0x10 SO_ERROR = 0x1007 SO_KEEPALIVE = 0x8 SO_LABEL = 0x1009 SO_LINGER = 0x80 SO_LISTENINCQLEN = 0x1013 SO_LISTENQLEN = 0x1012 SO_LISTENQLIMIT = 0x1011 SO_MAX_PACING_RATE = 0x1018 SO_NOSIGPIPE = 0x800 SO_NO_DDP = 0x8000 SO_NO_OFFLOAD = 0x4000 SO_OOBINLINE = 0x100 SO_PEERLABEL = 0x1010 SO_PROTOCOL = 0x1016 SO_PROTOTYPE = 0x1016 SO_RCVBUF = 0x1002 SO_RCVLOWAT = 0x1004 SO_RCVTIMEO = 0x1006 SO_RERROR = 0x20000 SO_REUSEADDR = 0x4 SO_REUSEPORT = 0x200 SO_REUSEPORT_LB = 0x10000 SO_SETFIB = 0x1014 SO_SNDBUF = 0x1001 SO_SNDLOWAT = 0x1003 SO_SNDTIMEO = 0x1005 SO_TIMESTAMP = 0x400 SO_TS_BINTIME = 0x1 SO_TS_CLOCK = 0x1017 SO_TS_CLOCK_MAX = 0x3 SO_TS_DEFAULT = 0x0 SO_TS_MONOTONIC = 0x3 SO_TS_REALTIME = 0x2 SO_TS_REALTIME_MICRO = 0x0 SO_TYPE = 0x1008 SO_USELOOPBACK = 0x40 SO_USER_COOKIE = 0x1015 SO_VENDOR = 0x80000000 S_BLKSIZE = 0x200 S_IEXEC = 0x40 S_IFBLK = 0x6000 S_IFCHR = 0x2000 S_IFDIR = 0x4000 S_IFIFO = 0x1000 S_IFLNK = 0xa000 S_IFMT = 0xf000 S_IFREG = 0x8000 S_IFSOCK = 0xc000 S_IFWHT = 0xe000 S_IREAD = 0x100 S_IRGRP = 0x20 S_IROTH = 0x4 S_IRUSR = 0x100 S_IRWXG = 0x38 S_IRWXO = 0x7 S_IRWXU = 0x1c0 S_ISGID = 0x400 S_ISTXT = 0x200 S_ISUID = 0x800 S_ISVTX = 0x200 S_IWGRP = 0x10 S_IWOTH = 0x2 S_IWRITE = 0x80 S_IWUSR = 0x80 S_IXGRP = 0x8 S_IXOTH = 0x1 S_IXUSR = 0x40 TAB0 = 0x0 TAB3 = 0x4 TABDLY = 0x4 TCIFLUSH = 0x1 TCIOFF = 0x3 TCIOFLUSH = 0x3 TCION = 0x4 TCOFLUSH = 0x2 TCOOFF = 0x1 TCOON = 0x2 TCPOPT_EOL = 0x0 TCPOPT_FAST_OPEN = 0x22 TCPOPT_MAXSEG = 0x2 TCPOPT_NOP = 0x1 TCPOPT_PAD = 0x0 TCPOPT_SACK = 0x5 TCPOPT_SACK_PERMITTED = 0x4 TCPOPT_SIGNATURE = 0x13 TCPOPT_TIMESTAMP = 0x8 TCPOPT_WINDOW = 0x3 TCP_BBR_ACK_COMP_ALG = 0x448 TCP_BBR_ALGORITHM = 0x43b TCP_BBR_DRAIN_INC_EXTRA = 0x43c TCP_BBR_DRAIN_PG = 0x42e TCP_BBR_EXTRA_GAIN = 0x449 TCP_BBR_EXTRA_STATE = 0x453 TCP_BBR_FLOOR_MIN_TSO = 0x454 TCP_BBR_HDWR_PACE = 0x451 TCP_BBR_HOLD_TARGET = 0x436 TCP_BBR_IWINTSO = 0x42b TCP_BBR_LOWGAIN_FD = 0x436 TCP_BBR_LOWGAIN_HALF = 0x435 TCP_BBR_LOWGAIN_THRESH = 0x434 TCP_BBR_MAX_RTO = 0x439 TCP_BBR_MIN_RTO = 0x438 TCP_BBR_MIN_TOPACEOUT = 0x455 TCP_BBR_ONE_RETRAN = 0x431 TCP_BBR_PACE_CROSS = 0x442 TCP_BBR_PACE_DEL_TAR = 0x43f TCP_BBR_PACE_OH = 0x435 TCP_BBR_PACE_PER_SEC = 0x43e TCP_BBR_PACE_SEG_MAX = 0x440 TCP_BBR_PACE_SEG_MIN = 0x441 TCP_BBR_POLICER_DETECT = 0x457 TCP_BBR_PROBE_RTT_GAIN = 0x44d TCP_BBR_PROBE_RTT_INT = 0x430 TCP_BBR_PROBE_RTT_LEN = 0x44e TCP_BBR_RACK_RTT_USE = 0x44a TCP_BBR_RECFORCE = 0x42c TCP_BBR_REC_OVER_HPTS = 0x43a TCP_BBR_RETRAN_WTSO = 0x44b TCP_BBR_RWND_IS_APP = 0x42f TCP_BBR_SEND_IWND_IN_TSO = 0x44f TCP_BBR_STARTUP_EXIT_EPOCH = 0x43d TCP_BBR_STARTUP_LOSS_EXIT = 0x432 TCP_BBR_STARTUP_PG = 0x42d TCP_BBR_TMR_PACE_OH = 0x448 TCP_BBR_TSLIMITS = 0x434 TCP_BBR_TSTMP_RAISES = 0x456 TCP_BBR_UNLIMITED = 0x43b TCP_BBR_USEDEL_RATE = 0x437 TCP_BBR_USE_LOWGAIN = 0x433 TCP_BBR_USE_RACK_CHEAT = 0x450 TCP_BBR_UTTER_MAX_TSO = 0x452 TCP_CA_NAME_MAX = 0x10 TCP_CCALGOOPT = 0x41 TCP_CONGESTION = 0x40 TCP_DATA_AFTER_CLOSE = 0x44c TCP_DELACK = 0x48 TCP_FASTOPEN = 0x401 TCP_FASTOPEN_MAX_COOKIE_LEN = 0x10 TCP_FASTOPEN_MIN_COOKIE_LEN = 0x4 TCP_FASTOPEN_PSK_LEN = 0x10 TCP_FUNCTION_BLK = 0x2000 TCP_FUNCTION_NAME_LEN_MAX = 0x20 TCP_INFO = 0x20 TCP_KEEPCNT = 0x400 TCP_KEEPIDLE = 0x100 TCP_KEEPINIT = 0x80 TCP_KEEPINTVL = 0x200 TCP_LOG = 0x22 TCP_LOGBUF = 0x23 TCP_LOGDUMP = 0x25 TCP_LOGDUMPID = 0x26 TCP_LOGID = 0x24 TCP_LOG_ID_LEN = 0x40 TCP_MAXBURST = 0x4 TCP_MAXHLEN = 0x3c TCP_MAXOLEN = 0x28 TCP_MAXSEG = 0x2 TCP_MAXWIN = 0xffff TCP_MAX_SACK = 0x4 TCP_MAX_WINSHIFT = 0xe TCP_MD5SIG = 0x10 TCP_MINMSS = 0xd8 TCP_MSS = 0x218 TCP_NODELAY = 0x1 TCP_NOOPT = 0x8 TCP_NOPUSH = 0x4 TCP_PCAP_IN = 0x1000 TCP_PCAP_OUT = 0x800 TCP_RACK_EARLY_RECOV = 0x423 TCP_RACK_EARLY_SEG = 0x424 TCP_RACK_GP_INCREASE = 0x446 TCP_RACK_IDLE_REDUCE_HIGH = 0x444 TCP_RACK_MIN_PACE = 0x445 TCP_RACK_MIN_PACE_SEG = 0x446 TCP_RACK_MIN_TO = 0x422 TCP_RACK_PACE_ALWAYS = 0x41f TCP_RACK_PACE_MAX_SEG = 0x41e TCP_RACK_PACE_REDUCE = 0x41d TCP_RACK_PKT_DELAY = 0x428 TCP_RACK_PROP = 0x41b TCP_RACK_PROP_RATE = 0x420 TCP_RACK_PRR_SENDALOT = 0x421 TCP_RACK_REORD_FADE = 0x426 TCP_RACK_REORD_THRESH = 0x425 TCP_RACK_TLP_INC_VAR = 0x429 TCP_RACK_TLP_REDUCE = 0x41c TCP_RACK_TLP_THRESH = 0x427 TCP_RACK_TLP_USE = 0x447 TCP_VENDOR = 0x80000000 TCSAFLUSH = 0x2 TIMER_ABSTIME = 0x1 TIMER_RELTIME = 0x0 TIOCCBRK = 0x2000747a TIOCCDTR = 0x20007478 TIOCCONS = 0x80047462 TIOCDRAIN = 0x2000745e TIOCEXCL = 0x2000740d TIOCEXT = 0x80047460 TIOCFLUSH = 0x80047410 TIOCGDRAINWAIT = 0x40047456 TIOCGETA = 0x402c7413 TIOCGETD = 0x4004741a TIOCGPGRP = 0x40047477 TIOCGPTN = 0x4004740f TIOCGSID = 0x40047463 TIOCGWINSZ = 0x40087468 TIOCMBIC = 0x8004746b TIOCMBIS = 0x8004746c TIOCMGDTRWAIT = 0x4004745a TIOCMGET = 0x4004746a TIOCMSDTRWAIT = 0x8004745b TIOCMSET = 0x8004746d TIOCM_CAR = 0x40 TIOCM_CD = 0x40 TIOCM_CTS = 0x20 TIOCM_DCD = 0x40 TIOCM_DSR = 0x100 TIOCM_DTR = 0x2 TIOCM_LE = 0x1 TIOCM_RI = 0x80 TIOCM_RNG = 0x80 TIOCM_RTS = 0x4 TIOCM_SR = 0x10 TIOCM_ST = 0x8 TIOCNOTTY = 0x20007471 TIOCNXCL = 0x2000740e TIOCOUTQ = 0x40047473 TIOCPKT = 0x80047470 TIOCPKT_DATA = 0x0 TIOCPKT_DOSTOP = 0x20 TIOCPKT_FLUSHREAD = 0x1 TIOCPKT_FLUSHWRITE = 0x2 TIOCPKT_IOCTL = 0x40 TIOCPKT_NOSTOP = 0x10 TIOCPKT_START = 0x8 TIOCPKT_STOP = 0x4 TIOCPTMASTER = 0x2000741c TIOCSBRK = 0x2000747b TIOCSCTTY = 0x20007461 TIOCSDRAINWAIT = 0x80047457 TIOCSDTR = 0x20007479 TIOCSETA = 0x802c7414 TIOCSETAF = 0x802c7416 TIOCSETAW = 0x802c7415 TIOCSETD = 0x8004741b TIOCSIG = 0x2004745f TIOCSPGRP = 0x80047476 TIOCSTART = 0x2000746e TIOCSTAT = 0x20007465 TIOCSTI = 0x80017472 TIOCSTOP = 0x2000746f TIOCSWINSZ = 0x80087467 TIOCTIMESTAMP = 0x40107459 TIOCUCNTL = 0x80047466 TOSTOP = 0x400000 UTIME_NOW = -0x1 UTIME_OMIT = -0x2 VDISCARD = 0xf VDSUSP = 0xb VEOF = 0x0 VEOL = 0x1 VEOL2 = 0x2 VERASE = 0x3 VERASE2 = 0x7 VINTR = 0x8 VKILL = 0x5 VLNEXT = 0xe VMIN = 0x10 VQUIT = 0x9 VREPRINT = 0x6 VSTART = 0xc VSTATUS = 0x12 VSTOP = 0xd VSUSP = 0xa VTIME = 0x11 VWERASE = 0x4 WCONTINUED = 0x4 WCOREFLAG = 0x80 WEXITED = 0x10 WLINUXCLONE = 0x80000000 WNOHANG = 0x1 WNOWAIT = 0x8 WSTOPPED = 0x2 WTRAPPED = 0x20 WUNTRACED = 0x2 ) // Errors const ( E2BIG = syscall.Errno(0x7) EACCES = syscall.Errno(0xd) EADDRINUSE = syscall.Errno(0x30) EADDRNOTAVAIL = syscall.Errno(0x31) EAFNOSUPPORT = syscall.Errno(0x2f) EAGAIN = syscall.Errno(0x23) EALREADY = syscall.Errno(0x25) EAUTH = syscall.Errno(0x50) EBADF = syscall.Errno(0x9) EBADMSG = syscall.Errno(0x59) EBADRPC = syscall.Errno(0x48) EBUSY = syscall.Errno(0x10) ECANCELED = syscall.Errno(0x55) ECAPMODE = syscall.Errno(0x5e) ECHILD = syscall.Errno(0xa) ECONNABORTED = syscall.Errno(0x35) ECONNREFUSED = syscall.Errno(0x3d) ECONNRESET = syscall.Errno(0x36) EDEADLK = syscall.Errno(0xb) EDESTADDRREQ = syscall.Errno(0x27) EDOM = syscall.Errno(0x21) EDOOFUS = syscall.Errno(0x58) EDQUOT = syscall.Errno(0x45) EEXIST = syscall.Errno(0x11) EFAULT = syscall.Errno(0xe) EFBIG = syscall.Errno(0x1b) EFTYPE = syscall.Errno(0x4f) EHOSTDOWN = syscall.Errno(0x40) EHOSTUNREACH = syscall.Errno(0x41) EIDRM = syscall.Errno(0x52) EILSEQ = syscall.Errno(0x56) EINPROGRESS = syscall.Errno(0x24) EINTEGRITY = syscall.Errno(0x61) EINTR = syscall.Errno(0x4) EINVAL = syscall.Errno(0x16) EIO = syscall.Errno(0x5) EISCONN = syscall.Errno(0x38) EISDIR = syscall.Errno(0x15) ELAST = syscall.Errno(0x61) ELOOP = syscall.Errno(0x3e) EMFILE = syscall.Errno(0x18) EMLINK = syscall.Errno(0x1f) EMSGSIZE = syscall.Errno(0x28) EMULTIHOP = syscall.Errno(0x5a) ENAMETOOLONG = syscall.Errno(0x3f) ENEEDAUTH = syscall.Errno(0x51) ENETDOWN = syscall.Errno(0x32) ENETRESET = syscall.Errno(0x34) ENETUNREACH = syscall.Errno(0x33) ENFILE = syscall.Errno(0x17) ENOATTR = syscall.Errno(0x57) ENOBUFS = syscall.Errno(0x37) ENODEV = syscall.Errno(0x13) ENOENT = syscall.Errno(0x2) ENOEXEC = syscall.Errno(0x8) ENOLCK = syscall.Errno(0x4d) ENOLINK = syscall.Errno(0x5b) ENOMEM = syscall.Errno(0xc) ENOMSG = syscall.Errno(0x53) ENOPROTOOPT = syscall.Errno(0x2a) ENOSPC = syscall.Errno(0x1c) ENOSYS = syscall.Errno(0x4e) ENOTBLK = syscall.Errno(0xf) ENOTCAPABLE = syscall.Errno(0x5d) ENOTCONN = syscall.Errno(0x39) ENOTDIR = syscall.Errno(0x14) ENOTEMPTY = syscall.Errno(0x42) ENOTRECOVERABLE = syscall.Errno(0x5f) ENOTSOCK = syscall.Errno(0x26) ENOTSUP = syscall.Errno(0x2d) ENOTTY = syscall.Errno(0x19) ENXIO = syscall.Errno(0x6) EOPNOTSUPP = syscall.Errno(0x2d) EOVERFLOW = syscall.Errno(0x54) EOWNERDEAD = syscall.Errno(0x60) EPERM = syscall.Errno(0x1) EPFNOSUPPORT = syscall.Errno(0x2e) EPIPE = syscall.Errno(0x20) EPROCLIM = syscall.Errno(0x43) EPROCUNAVAIL = syscall.Errno(0x4c) EPROGMISMATCH = syscall.Errno(0x4b) EPROGUNAVAIL = syscall.Errno(0x4a) EPROTO = syscall.Errno(0x5c) EPROTONOSUPPORT = syscall.Errno(0x2b) EPROTOTYPE = syscall.Errno(0x29) ERANGE = syscall.Errno(0x22) EREMOTE = syscall.Errno(0x47) EROFS = syscall.Errno(0x1e) ERPCMISMATCH = syscall.Errno(0x49) ESHUTDOWN = syscall.Errno(0x3a) ESOCKTNOSUPPORT = syscall.Errno(0x2c) ESPIPE = syscall.Errno(0x1d) ESRCH = syscall.Errno(0x3) ESTALE = syscall.Errno(0x46) ETIMEDOUT = syscall.Errno(0x3c) ETOOMANYREFS = syscall.Errno(0x3b) ETXTBSY = syscall.Errno(0x1a) EUSERS = syscall.Errno(0x44) EWOULDBLOCK = syscall.Errno(0x23) EXDEV = syscall.Errno(0x12) ) // Signals const ( SIGABRT = syscall.Signal(0x6) SIGALRM = syscall.Signal(0xe) SIGBUS = syscall.Signal(0xa) SIGCHLD = syscall.Signal(0x14) SIGCONT = syscall.Signal(0x13) SIGEMT = syscall.Signal(0x7) SIGFPE = syscall.Signal(0x8) SIGHUP = syscall.Signal(0x1) SIGILL = syscall.Signal(0x4) SIGINFO = syscall.Signal(0x1d) SIGINT = syscall.Signal(0x2) SIGIO = syscall.Signal(0x17) SIGIOT = syscall.Signal(0x6) SIGKILL = syscall.Signal(0x9) SIGLIBRT = syscall.Signal(0x21) SIGLWP = syscall.Signal(0x20) SIGPIPE = syscall.Signal(0xd) SIGPROF = syscall.Signal(0x1b) SIGQUIT = syscall.Signal(0x3) SIGSEGV = syscall.Signal(0xb) SIGSTOP = syscall.Signal(0x11) SIGSYS = syscall.Signal(0xc) SIGTERM = syscall.Signal(0xf) SIGTHR = syscall.Signal(0x20) SIGTRAP = syscall.Signal(0x5) SIGTSTP = syscall.Signal(0x12) SIGTTIN = syscall.Signal(0x15) SIGTTOU = syscall.Signal(0x16) SIGURG = syscall.Signal(0x10) SIGUSR1 = syscall.Signal(0x1e) SIGUSR2 = syscall.Signal(0x1f) SIGVTALRM = syscall.Signal(0x1a) SIGWINCH = syscall.Signal(0x1c) SIGXCPU = syscall.Signal(0x18) SIGXFSZ = syscall.Signal(0x19) ) // Error table var errorList = [...]struct { num syscall.Errno name string desc string }{ {1, "EPERM", "operation not permitted"}, {2, "ENOENT", "no such file or directory"}, {3, "ESRCH", "no such process"}, {4, "EINTR", "interrupted system call"}, {5, "EIO", "input/output error"}, {6, "ENXIO", "device not configured"}, {7, "E2BIG", "argument list too long"}, {8, "ENOEXEC", "exec format error"}, {9, "EBADF", "bad file descriptor"}, {10, "ECHILD", "no child processes"}, {11, "EDEADLK", "resource deadlock avoided"}, {12, "ENOMEM", "cannot allocate memory"}, {13, "EACCES", "permission denied"}, {14, "EFAULT", "bad address"}, {15, "ENOTBLK", "block device required"}, {16, "EBUSY", "device busy"}, {17, "EEXIST", "file exists"}, {18, "EXDEV", "cross-device link"}, {19, "ENODEV", "operation not supported by device"}, {20, "ENOTDIR", "not a directory"}, {21, "EISDIR", "is a directory"}, {22, "EINVAL", "invalid argument"}, {23, "ENFILE", "too many open files in system"}, {24, "EMFILE", "too many open files"}, {25, "ENOTTY", "inappropriate ioctl for device"}, {26, "ETXTBSY", "text file busy"}, {27, "EFBIG", "file too large"}, {28, "ENOSPC", "no space left on device"}, {29, "ESPIPE", "illegal seek"}, {30, "EROFS", "read-only file system"}, {31, "EMLINK", "too many links"}, {32, "EPIPE", "broken pipe"}, {33, "EDOM", "numerical argument out of domain"}, {34, "ERANGE", "result too large"}, {35, "EWOULDBLOCK", "resource temporarily unavailable"}, {36, "EINPROGRESS", "operation now in progress"}, {37, "EALREADY", "operation already in progress"}, {38, "ENOTSOCK", "socket operation on non-socket"}, {39, "EDESTADDRREQ", "destination address required"}, {40, "EMSGSIZE", "message too long"}, {41, "EPROTOTYPE", "protocol wrong type for socket"}, {42, "ENOPROTOOPT", "protocol not available"}, {43, "EPROTONOSUPPORT", "protocol not supported"}, {44, "ESOCKTNOSUPPORT", "socket type not supported"}, {45, "EOPNOTSUPP", "operation not supported"}, {46, "EPFNOSUPPORT", "protocol family not supported"}, {47, "EAFNOSUPPORT", "address family not supported by protocol family"}, {48, "EADDRINUSE", "address already in use"}, {49, "EADDRNOTAVAIL", "can't assign requested address"}, {50, "ENETDOWN", "network is down"}, {51, "ENETUNREACH", "network is unreachable"}, {52, "ENETRESET", "network dropped connection on reset"}, {53, "ECONNABORTED", "software caused connection abort"}, {54, "ECONNRESET", "connection reset by peer"}, {55, "ENOBUFS", "no buffer space available"}, {56, "EISCONN", "socket is already connected"}, {57, "ENOTCONN", "socket is not connected"}, {58, "ESHUTDOWN", "can't send after socket shutdown"}, {59, "ETOOMANYREFS", "too many references: can't splice"}, {60, "ETIMEDOUT", "operation timed out"}, {61, "ECONNREFUSED", "connection refused"}, {62, "ELOOP", "too many levels of symbolic links"}, {63, "ENAMETOOLONG", "file name too long"}, {64, "EHOSTDOWN", "host is down"}, {65, "EHOSTUNREACH", "no route to host"}, {66, "ENOTEMPTY", "directory not empty"}, {67, "EPROCLIM", "too many processes"}, {68, "EUSERS", "too many users"}, {69, "EDQUOT", "disc quota exceeded"}, {70, "ESTALE", "stale NFS file handle"}, {71, "EREMOTE", "too many levels of remote in path"}, {72, "EBADRPC", "RPC struct is bad"}, {73, "ERPCMISMATCH", "RPC version wrong"}, {74, "EPROGUNAVAIL", "RPC prog. not avail"}, {75, "EPROGMISMATCH", "program version wrong"}, {76, "EPROCUNAVAIL", "bad procedure for program"}, {77, "ENOLCK", "no locks available"}, {78, "ENOSYS", "function not implemented"}, {79, "EFTYPE", "inappropriate file type or format"}, {80, "EAUTH", "authentication error"}, {81, "ENEEDAUTH", "need authenticator"}, {82, "EIDRM", "identifier removed"}, {83, "ENOMSG", "no message of desired type"}, {84, "EOVERFLOW", "value too large to be stored in data type"}, {85, "ECANCELED", "operation canceled"}, {86, "EILSEQ", "illegal byte sequence"}, {87, "ENOATTR", "attribute not found"}, {88, "EDOOFUS", "programming error"}, {89, "EBADMSG", "bad message"}, {90, "EMULTIHOP", "multihop attempted"}, {91, "ENOLINK", "link has been severed"}, {92, "EPROTO", "protocol error"}, {93, "ENOTCAPABLE", "capabilities insufficient"}, {94, "ECAPMODE", "not permitted in capability mode"}, {95, "ENOTRECOVERABLE", "state not recoverable"}, {96, "EOWNERDEAD", "previous owner died"}, {97, "EINTEGRITY", "integrity check failed"}, } // Signal table var signalList = [...]struct { num syscall.Signal name string desc string }{ {1, "SIGHUP", "hangup"}, {2, "SIGINT", "interrupt"}, {3, "SIGQUIT", "quit"}, {4, "SIGILL", "illegal instruction"}, {5, "SIGTRAP", "trace/BPT trap"}, {6, "SIGIOT", "abort trap"}, {7, "SIGEMT", "EMT trap"}, {8, "SIGFPE", "floating point exception"}, {9, "SIGKILL", "killed"}, {10, "SIGBUS", "bus error"}, {11, "SIGSEGV", "segmentation fault"}, {12, "SIGSYS", "bad system call"}, {13, "SIGPIPE", "broken pipe"}, {14, "SIGALRM", "alarm clock"}, {15, "SIGTERM", "terminated"}, {16, "SIGURG", "urgent I/O condition"}, {17, "SIGSTOP", "suspended (signal)"}, {18, "SIGTSTP", "suspended"}, {19, "SIGCONT", "continued"}, {20, "SIGCHLD", "child exited"}, {21, "SIGTTIN", "stopped (tty input)"}, {22, "SIGTTOU", "stopped (tty output)"}, {23, "SIGIO", "I/O possible"}, {24, "SIGXCPU", "cputime limit exceeded"}, {25, "SIGXFSZ", "filesize limit exceeded"}, {26, "SIGVTALRM", "virtual timer expired"}, {27, "SIGPROF", "profiling timer expired"}, {28, "SIGWINCH", "window size changes"}, {29, "SIGINFO", "information request"}, {30, "SIGUSR1", "user defined signal 1"}, {31, "SIGUSR2", "user defined signal 2"}, {32, "SIGTHR", "unknown signal"}, {33, "SIGLIBRT", "unknown signal"}, } ================================================ FILE: vendor/golang.org/x/sys/unix/zerrors_freebsd_arm.go ================================================ // mkerrors.sh // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm && freebsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- _const.go package unix import "syscall" const ( AF_APPLETALK = 0x10 AF_ARP = 0x23 AF_ATM = 0x1e AF_BLUETOOTH = 0x24 AF_CCITT = 0xa AF_CHAOS = 0x5 AF_CNT = 0x15 AF_COIP = 0x14 AF_DATAKIT = 0x9 AF_DECnet = 0xc AF_DLI = 0xd AF_E164 = 0x1a AF_ECMA = 0x8 AF_HYLINK = 0xf AF_IEEE80211 = 0x25 AF_IMPLINK = 0x3 AF_INET = 0x2 AF_INET6 = 0x1c AF_INET6_SDP = 0x2a AF_INET_SDP = 0x28 AF_IPX = 0x17 AF_ISDN = 0x1a AF_ISO = 0x7 AF_LAT = 0xe AF_LINK = 0x12 AF_LOCAL = 0x1 AF_MAX = 0x2a AF_NATM = 0x1d AF_NETBIOS = 0x6 AF_NETGRAPH = 0x20 AF_OSI = 0x7 AF_PUP = 0x4 AF_ROUTE = 0x11 AF_SCLUSTER = 0x22 AF_SIP = 0x18 AF_SLOW = 0x21 AF_SNA = 0xb AF_UNIX = 0x1 AF_UNSPEC = 0x0 AF_VENDOR00 = 0x27 AF_VENDOR01 = 0x29 AF_VENDOR02 = 0x2b AF_VENDOR03 = 0x2d AF_VENDOR04 = 0x2f AF_VENDOR05 = 0x31 AF_VENDOR06 = 0x33 AF_VENDOR07 = 0x35 AF_VENDOR08 = 0x37 AF_VENDOR09 = 0x39 AF_VENDOR10 = 0x3b AF_VENDOR11 = 0x3d AF_VENDOR12 = 0x3f AF_VENDOR13 = 0x41 AF_VENDOR14 = 0x43 AF_VENDOR15 = 0x45 AF_VENDOR16 = 0x47 AF_VENDOR17 = 0x49 AF_VENDOR18 = 0x4b AF_VENDOR19 = 0x4d AF_VENDOR20 = 0x4f AF_VENDOR21 = 0x51 AF_VENDOR22 = 0x53 AF_VENDOR23 = 0x55 AF_VENDOR24 = 0x57 AF_VENDOR25 = 0x59 AF_VENDOR26 = 0x5b AF_VENDOR27 = 0x5d AF_VENDOR28 = 0x5f AF_VENDOR29 = 0x61 AF_VENDOR30 = 0x63 AF_VENDOR31 = 0x65 AF_VENDOR32 = 0x67 AF_VENDOR33 = 0x69 AF_VENDOR34 = 0x6b AF_VENDOR35 = 0x6d AF_VENDOR36 = 0x6f AF_VENDOR37 = 0x71 AF_VENDOR38 = 0x73 AF_VENDOR39 = 0x75 AF_VENDOR40 = 0x77 AF_VENDOR41 = 0x79 AF_VENDOR42 = 0x7b AF_VENDOR43 = 0x7d AF_VENDOR44 = 0x7f AF_VENDOR45 = 0x81 AF_VENDOR46 = 0x83 AF_VENDOR47 = 0x85 ALTWERASE = 0x200 B0 = 0x0 B110 = 0x6e B115200 = 0x1c200 B1200 = 0x4b0 B134 = 0x86 B14400 = 0x3840 B150 = 0x96 B1800 = 0x708 B19200 = 0x4b00 B200 = 0xc8 B230400 = 0x38400 B2400 = 0x960 B28800 = 0x7080 B300 = 0x12c B38400 = 0x9600 B460800 = 0x70800 B4800 = 0x12c0 B50 = 0x32 B57600 = 0xe100 B600 = 0x258 B7200 = 0x1c20 B75 = 0x4b B76800 = 0x12c00 B921600 = 0xe1000 B9600 = 0x2580 BIOCFEEDBACK = 0x8004427c BIOCFLUSH = 0x20004268 BIOCGBLEN = 0x40044266 BIOCGDIRECTION = 0x40044276 BIOCGDLT = 0x4004426a BIOCGDLTLIST = 0xc0084279 BIOCGETBUFMODE = 0x4004427d BIOCGETIF = 0x4020426b BIOCGETZMAX = 0x4004427f BIOCGHDRCMPLT = 0x40044274 BIOCGRSIG = 0x40044272 BIOCGRTIMEOUT = 0x4010426e BIOCGSEESENT = 0x40044276 BIOCGSTATS = 0x4008426f BIOCGTSTAMP = 0x40044283 BIOCIMMEDIATE = 0x80044270 BIOCLOCK = 0x2000427a BIOCPROMISC = 0x20004269 BIOCROTZBUF = 0x400c4280 BIOCSBLEN = 0xc0044266 BIOCSDIRECTION = 0x80044277 BIOCSDLT = 0x80044278 BIOCSETBUFMODE = 0x8004427e BIOCSETF = 0x80084267 BIOCSETFNR = 0x80084282 BIOCSETIF = 0x8020426c BIOCSETVLANPCP = 0x80044285 BIOCSETWF = 0x8008427b BIOCSETZBUF = 0x800c4281 BIOCSHDRCMPLT = 0x80044275 BIOCSRSIG = 0x80044273 BIOCSRTIMEOUT = 0x8010426d BIOCSSEESENT = 0x80044277 BIOCSTSTAMP = 0x80044284 BIOCVERSION = 0x40044271 BPF_A = 0x10 BPF_ABS = 0x20 BPF_ADD = 0x0 BPF_ALIGNMENT = 0x4 BPF_ALU = 0x4 BPF_AND = 0x50 BPF_B = 0x10 BPF_BUFMODE_BUFFER = 0x1 BPF_BUFMODE_ZBUF = 0x2 BPF_DIV = 0x30 BPF_H = 0x8 BPF_IMM = 0x0 BPF_IND = 0x40 BPF_JA = 0x0 BPF_JEQ = 0x10 BPF_JGE = 0x30 BPF_JGT = 0x20 BPF_JMP = 0x5 BPF_JSET = 0x40 BPF_K = 0x0 BPF_LD = 0x0 BPF_LDX = 0x1 BPF_LEN = 0x80 BPF_LSH = 0x60 BPF_MAJOR_VERSION = 0x1 BPF_MAXBUFSIZE = 0x80000 BPF_MAXINSNS = 0x200 BPF_MEM = 0x60 BPF_MEMWORDS = 0x10 BPF_MINBUFSIZE = 0x20 BPF_MINOR_VERSION = 0x1 BPF_MISC = 0x7 BPF_MOD = 0x90 BPF_MSH = 0xa0 BPF_MUL = 0x20 BPF_NEG = 0x80 BPF_OR = 0x40 BPF_RELEASE = 0x30bb6 BPF_RET = 0x6 BPF_RSH = 0x70 BPF_ST = 0x2 BPF_STX = 0x3 BPF_SUB = 0x10 BPF_TAX = 0x0 BPF_TXA = 0x80 BPF_T_BINTIME = 0x2 BPF_T_BINTIME_FAST = 0x102 BPF_T_BINTIME_MONOTONIC = 0x202 BPF_T_BINTIME_MONOTONIC_FAST = 0x302 BPF_T_FAST = 0x100 BPF_T_FLAG_MASK = 0x300 BPF_T_FORMAT_MASK = 0x3 BPF_T_MICROTIME = 0x0 BPF_T_MICROTIME_FAST = 0x100 BPF_T_MICROTIME_MONOTONIC = 0x200 BPF_T_MICROTIME_MONOTONIC_FAST = 0x300 BPF_T_MONOTONIC = 0x200 BPF_T_MONOTONIC_FAST = 0x300 BPF_T_NANOTIME = 0x1 BPF_T_NANOTIME_FAST = 0x101 BPF_T_NANOTIME_MONOTONIC = 0x201 BPF_T_NANOTIME_MONOTONIC_FAST = 0x301 BPF_T_NONE = 0x3 BPF_T_NORMAL = 0x0 BPF_W = 0x0 BPF_X = 0x8 BPF_XOR = 0xa0 BRKINT = 0x2 CAP_ACCEPT = 0x200000020000000 CAP_ACL_CHECK = 0x400000000010000 CAP_ACL_DELETE = 0x400000000020000 CAP_ACL_GET = 0x400000000040000 CAP_ACL_SET = 0x400000000080000 CAP_ALL0 = 0x20007ffffffffff CAP_ALL1 = 0x4000000001fffff CAP_BIND = 0x200000040000000 CAP_BINDAT = 0x200008000000400 CAP_CHFLAGSAT = 0x200000000001400 CAP_CONNECT = 0x200000080000000 CAP_CONNECTAT = 0x200010000000400 CAP_CREATE = 0x200000000000040 CAP_EVENT = 0x400000000000020 CAP_EXTATTR_DELETE = 0x400000000001000 CAP_EXTATTR_GET = 0x400000000002000 CAP_EXTATTR_LIST = 0x400000000004000 CAP_EXTATTR_SET = 0x400000000008000 CAP_FCHDIR = 0x200000000000800 CAP_FCHFLAGS = 0x200000000001000 CAP_FCHMOD = 0x200000000002000 CAP_FCHMODAT = 0x200000000002400 CAP_FCHOWN = 0x200000000004000 CAP_FCHOWNAT = 0x200000000004400 CAP_FCNTL = 0x200000000008000 CAP_FCNTL_ALL = 0x78 CAP_FCNTL_GETFL = 0x8 CAP_FCNTL_GETOWN = 0x20 CAP_FCNTL_SETFL = 0x10 CAP_FCNTL_SETOWN = 0x40 CAP_FEXECVE = 0x200000000000080 CAP_FLOCK = 0x200000000010000 CAP_FPATHCONF = 0x200000000020000 CAP_FSCK = 0x200000000040000 CAP_FSTAT = 0x200000000080000 CAP_FSTATAT = 0x200000000080400 CAP_FSTATFS = 0x200000000100000 CAP_FSYNC = 0x200000000000100 CAP_FTRUNCATE = 0x200000000000200 CAP_FUTIMES = 0x200000000200000 CAP_FUTIMESAT = 0x200000000200400 CAP_GETPEERNAME = 0x200000100000000 CAP_GETSOCKNAME = 0x200000200000000 CAP_GETSOCKOPT = 0x200000400000000 CAP_IOCTL = 0x400000000000080 CAP_IOCTLS_ALL = 0x7fffffff CAP_KQUEUE = 0x400000000100040 CAP_KQUEUE_CHANGE = 0x400000000100000 CAP_KQUEUE_EVENT = 0x400000000000040 CAP_LINKAT_SOURCE = 0x200020000000400 CAP_LINKAT_TARGET = 0x200000000400400 CAP_LISTEN = 0x200000800000000 CAP_LOOKUP = 0x200000000000400 CAP_MAC_GET = 0x400000000000001 CAP_MAC_SET = 0x400000000000002 CAP_MKDIRAT = 0x200000000800400 CAP_MKFIFOAT = 0x200000001000400 CAP_MKNODAT = 0x200000002000400 CAP_MMAP = 0x200000000000010 CAP_MMAP_R = 0x20000000000001d CAP_MMAP_RW = 0x20000000000001f CAP_MMAP_RWX = 0x20000000000003f CAP_MMAP_RX = 0x20000000000003d CAP_MMAP_W = 0x20000000000001e CAP_MMAP_WX = 0x20000000000003e CAP_MMAP_X = 0x20000000000003c CAP_PDGETPID = 0x400000000000200 CAP_PDKILL = 0x400000000000800 CAP_PDWAIT = 0x400000000000400 CAP_PEELOFF = 0x200001000000000 CAP_POLL_EVENT = 0x400000000000020 CAP_PREAD = 0x20000000000000d CAP_PWRITE = 0x20000000000000e CAP_READ = 0x200000000000001 CAP_RECV = 0x200000000000001 CAP_RENAMEAT_SOURCE = 0x200000004000400 CAP_RENAMEAT_TARGET = 0x200040000000400 CAP_RIGHTS_VERSION = 0x0 CAP_RIGHTS_VERSION_00 = 0x0 CAP_SEEK = 0x20000000000000c CAP_SEEK_TELL = 0x200000000000004 CAP_SEM_GETVALUE = 0x400000000000004 CAP_SEM_POST = 0x400000000000008 CAP_SEM_WAIT = 0x400000000000010 CAP_SEND = 0x200000000000002 CAP_SETSOCKOPT = 0x200002000000000 CAP_SHUTDOWN = 0x200004000000000 CAP_SOCK_CLIENT = 0x200007780000003 CAP_SOCK_SERVER = 0x200007f60000003 CAP_SYMLINKAT = 0x200000008000400 CAP_TTYHOOK = 0x400000000000100 CAP_UNLINKAT = 0x200000010000400 CAP_UNUSED0_44 = 0x200080000000000 CAP_UNUSED0_57 = 0x300000000000000 CAP_UNUSED1_22 = 0x400000000200000 CAP_UNUSED1_57 = 0x500000000000000 CAP_WRITE = 0x200000000000002 CFLUSH = 0xf CLOCAL = 0x8000 CLOCK_MONOTONIC = 0x4 CLOCK_MONOTONIC_FAST = 0xc CLOCK_MONOTONIC_PRECISE = 0xb CLOCK_PROCESS_CPUTIME_ID = 0xf CLOCK_PROF = 0x2 CLOCK_REALTIME = 0x0 CLOCK_REALTIME_FAST = 0xa CLOCK_REALTIME_PRECISE = 0x9 CLOCK_SECOND = 0xd CLOCK_THREAD_CPUTIME_ID = 0xe CLOCK_UPTIME = 0x5 CLOCK_UPTIME_FAST = 0x8 CLOCK_UPTIME_PRECISE = 0x7 CLOCK_VIRTUAL = 0x1 CPUSTATES = 0x5 CP_IDLE = 0x4 CP_INTR = 0x3 CP_NICE = 0x1 CP_SYS = 0x2 CP_USER = 0x0 CREAD = 0x800 CRTSCTS = 0x30000 CS5 = 0x0 CS6 = 0x100 CS7 = 0x200 CS8 = 0x300 CSIZE = 0x300 CSTART = 0x11 CSTATUS = 0x14 CSTOP = 0x13 CSTOPB = 0x400 CSUSP = 0x1a CTL_HW = 0x6 CTL_KERN = 0x1 CTL_MAXNAME = 0x18 CTL_NET = 0x4 DIOCGATTR = 0xc148648e DIOCGDELETE = 0x80106488 DIOCGFLUSH = 0x20006487 DIOCGFRONTSTUFF = 0x40086486 DIOCGFWHEADS = 0x40046483 DIOCGFWSECTORS = 0x40046482 DIOCGIDENT = 0x41006489 DIOCGMEDIASIZE = 0x40086481 DIOCGPHYSPATH = 0x4400648d DIOCGPROVIDERNAME = 0x4400648a DIOCGSECTORSIZE = 0x40046480 DIOCGSTRIPEOFFSET = 0x4008648c DIOCGSTRIPESIZE = 0x4008648b DIOCSKERNELDUMP = 0x804c6490 DIOCSKERNELDUMP_FREEBSD11 = 0x80046485 DIOCZONECMD = 0xc078648f DLT_A429 = 0xb8 DLT_A653_ICM = 0xb9 DLT_AIRONET_HEADER = 0x78 DLT_AOS = 0xde DLT_APPLE_IP_OVER_IEEE1394 = 0x8a DLT_ARCNET = 0x7 DLT_ARCNET_LINUX = 0x81 DLT_ATM_CLIP = 0x13 DLT_ATM_RFC1483 = 0xb DLT_AURORA = 0x7e DLT_AX25 = 0x3 DLT_AX25_KISS = 0xca DLT_BACNET_MS_TP = 0xa5 DLT_BLUETOOTH_BREDR_BB = 0xff DLT_BLUETOOTH_HCI_H4 = 0xbb DLT_BLUETOOTH_HCI_H4_WITH_PHDR = 0xc9 DLT_BLUETOOTH_LE_LL = 0xfb DLT_BLUETOOTH_LE_LL_WITH_PHDR = 0x100 DLT_BLUETOOTH_LINUX_MONITOR = 0xfe DLT_CAN20B = 0xbe DLT_CAN_SOCKETCAN = 0xe3 DLT_CHAOS = 0x5 DLT_CHDLC = 0x68 DLT_CISCO_IOS = 0x76 DLT_CLASS_NETBSD_RAWAF = 0x2240000 DLT_C_HDLC = 0x68 DLT_C_HDLC_WITH_DIR = 0xcd DLT_DBUS = 0xe7 DLT_DECT = 0xdd DLT_DISPLAYPORT_AUX = 0x113 DLT_DOCSIS = 0x8f DLT_DOCSIS31_XRA31 = 0x111 DLT_DVB_CI = 0xeb DLT_ECONET = 0x73 DLT_EN10MB = 0x1 DLT_EN3MB = 0x2 DLT_ENC = 0x6d DLT_EPON = 0x103 DLT_ERF = 0xc5 DLT_ERF_ETH = 0xaf DLT_ERF_POS = 0xb0 DLT_ETHERNET_MPACKET = 0x112 DLT_FC_2 = 0xe0 DLT_FC_2_WITH_FRAME_DELIMS = 0xe1 DLT_FDDI = 0xa DLT_FLEXRAY = 0xd2 DLT_FRELAY = 0x6b DLT_FRELAY_WITH_DIR = 0xce DLT_GCOM_SERIAL = 0xad DLT_GCOM_T1E1 = 0xac DLT_GPF_F = 0xab DLT_GPF_T = 0xaa DLT_GPRS_LLC = 0xa9 DLT_GSMTAP_ABIS = 0xda DLT_GSMTAP_UM = 0xd9 DLT_IBM_SN = 0x92 DLT_IBM_SP = 0x91 DLT_IEEE802 = 0x6 DLT_IEEE802_11 = 0x69 DLT_IEEE802_11_RADIO = 0x7f DLT_IEEE802_11_RADIO_AVS = 0xa3 DLT_IEEE802_15_4 = 0xc3 DLT_IEEE802_15_4_LINUX = 0xbf DLT_IEEE802_15_4_NOFCS = 0xe6 DLT_IEEE802_15_4_NONASK_PHY = 0xd7 DLT_IEEE802_16_MAC_CPS = 0xbc DLT_IEEE802_16_MAC_CPS_RADIO = 0xc1 DLT_INFINIBAND = 0xf7 DLT_IPFILTER = 0x74 DLT_IPMB_KONTRON = 0xc7 DLT_IPMB_LINUX = 0xd1 DLT_IPMI_HPM_2 = 0x104 DLT_IPNET = 0xe2 DLT_IPOIB = 0xf2 DLT_IPV4 = 0xe4 DLT_IPV6 = 0xe5 DLT_IP_OVER_FC = 0x7a DLT_ISO_14443 = 0x108 DLT_JUNIPER_ATM1 = 0x89 DLT_JUNIPER_ATM2 = 0x87 DLT_JUNIPER_ATM_CEMIC = 0xee DLT_JUNIPER_CHDLC = 0xb5 DLT_JUNIPER_ES = 0x84 DLT_JUNIPER_ETHER = 0xb2 DLT_JUNIPER_FIBRECHANNEL = 0xea DLT_JUNIPER_FRELAY = 0xb4 DLT_JUNIPER_GGSN = 0x85 DLT_JUNIPER_ISM = 0xc2 DLT_JUNIPER_MFR = 0x86 DLT_JUNIPER_MLFR = 0x83 DLT_JUNIPER_MLPPP = 0x82 DLT_JUNIPER_MONITOR = 0xa4 DLT_JUNIPER_PIC_PEER = 0xae DLT_JUNIPER_PPP = 0xb3 DLT_JUNIPER_PPPOE = 0xa7 DLT_JUNIPER_PPPOE_ATM = 0xa8 DLT_JUNIPER_SERVICES = 0x88 DLT_JUNIPER_SRX_E2E = 0xe9 DLT_JUNIPER_ST = 0xc8 DLT_JUNIPER_VP = 0xb7 DLT_JUNIPER_VS = 0xe8 DLT_LAPB_WITH_DIR = 0xcf DLT_LAPD = 0xcb DLT_LIN = 0xd4 DLT_LINUX_EVDEV = 0xd8 DLT_LINUX_IRDA = 0x90 DLT_LINUX_LAPD = 0xb1 DLT_LINUX_PPP_WITHDIRECTION = 0xa6 DLT_LINUX_SLL = 0x71 DLT_LINUX_SLL2 = 0x114 DLT_LOOP = 0x6c DLT_LORATAP = 0x10e DLT_LTALK = 0x72 DLT_MATCHING_MAX = 0x114 DLT_MATCHING_MIN = 0x68 DLT_MFR = 0xb6 DLT_MOST = 0xd3 DLT_MPEG_2_TS = 0xf3 DLT_MPLS = 0xdb DLT_MTP2 = 0x8c DLT_MTP2_WITH_PHDR = 0x8b DLT_MTP3 = 0x8d DLT_MUX27010 = 0xec DLT_NETANALYZER = 0xf0 DLT_NETANALYZER_TRANSPARENT = 0xf1 DLT_NETLINK = 0xfd DLT_NFC_LLCP = 0xf5 DLT_NFLOG = 0xef DLT_NG40 = 0xf4 DLT_NORDIC_BLE = 0x110 DLT_NULL = 0x0 DLT_OPENFLOW = 0x10b DLT_PCI_EXP = 0x7d DLT_PFLOG = 0x75 DLT_PFSYNC = 0x79 DLT_PKTAP = 0x102 DLT_PPI = 0xc0 DLT_PPP = 0x9 DLT_PPP_BSDOS = 0xe DLT_PPP_ETHER = 0x33 DLT_PPP_PPPD = 0xa6 DLT_PPP_SERIAL = 0x32 DLT_PPP_WITH_DIR = 0xcc DLT_PPP_WITH_DIRECTION = 0xa6 DLT_PRISM_HEADER = 0x77 DLT_PROFIBUS_DL = 0x101 DLT_PRONET = 0x4 DLT_RAIF1 = 0xc6 DLT_RAW = 0xc DLT_RDS = 0x109 DLT_REDBACK_SMARTEDGE = 0x20 DLT_RIO = 0x7c DLT_RTAC_SERIAL = 0xfa DLT_SCCP = 0x8e DLT_SCTP = 0xf8 DLT_SDLC = 0x10c DLT_SITA = 0xc4 DLT_SLIP = 0x8 DLT_SLIP_BSDOS = 0xd DLT_STANAG_5066_D_PDU = 0xed DLT_SUNATM = 0x7b DLT_SYMANTEC_FIREWALL = 0x63 DLT_TI_LLN_SNIFFER = 0x10d DLT_TZSP = 0x80 DLT_USB = 0xba DLT_USBPCAP = 0xf9 DLT_USB_DARWIN = 0x10a DLT_USB_FREEBSD = 0xba DLT_USB_LINUX = 0xbd DLT_USB_LINUX_MMAPPED = 0xdc DLT_USER0 = 0x93 DLT_USER1 = 0x94 DLT_USER10 = 0x9d DLT_USER11 = 0x9e DLT_USER12 = 0x9f DLT_USER13 = 0xa0 DLT_USER14 = 0xa1 DLT_USER15 = 0xa2 DLT_USER2 = 0x95 DLT_USER3 = 0x96 DLT_USER4 = 0x97 DLT_USER5 = 0x98 DLT_USER6 = 0x99 DLT_USER7 = 0x9a DLT_USER8 = 0x9b DLT_USER9 = 0x9c DLT_VSOCK = 0x10f DLT_WATTSTOPPER_DLM = 0x107 DLT_WIHART = 0xdf DLT_WIRESHARK_UPPER_PDU = 0xfc DLT_X2E_SERIAL = 0xd5 DLT_X2E_XORAYA = 0xd6 DLT_ZWAVE_R1_R2 = 0x105 DLT_ZWAVE_R3 = 0x106 DT_BLK = 0x6 DT_CHR = 0x2 DT_DIR = 0x4 DT_FIFO = 0x1 DT_LNK = 0xa DT_REG = 0x8 DT_SOCK = 0xc DT_UNKNOWN = 0x0 DT_WHT = 0xe ECHO = 0x8 ECHOCTL = 0x40 ECHOE = 0x2 ECHOK = 0x4 ECHOKE = 0x1 ECHONL = 0x10 ECHOPRT = 0x20 EVFILT_AIO = -0x3 EVFILT_EMPTY = -0xd EVFILT_FS = -0x9 EVFILT_LIO = -0xa EVFILT_PROC = -0x5 EVFILT_PROCDESC = -0x8 EVFILT_READ = -0x1 EVFILT_SENDFILE = -0xc EVFILT_SIGNAL = -0x6 EVFILT_SYSCOUNT = 0xd EVFILT_TIMER = -0x7 EVFILT_USER = -0xb EVFILT_VNODE = -0x4 EVFILT_WRITE = -0x2 EVNAMEMAP_NAME_SIZE = 0x40 EV_ADD = 0x1 EV_CLEAR = 0x20 EV_DELETE = 0x2 EV_DISABLE = 0x8 EV_DISPATCH = 0x80 EV_DROP = 0x1000 EV_ENABLE = 0x4 EV_EOF = 0x8000 EV_ERROR = 0x4000 EV_FLAG1 = 0x2000 EV_FLAG2 = 0x4000 EV_FORCEONESHOT = 0x100 EV_ONESHOT = 0x10 EV_RECEIPT = 0x40 EV_SYSFLAGS = 0xf000 EXTA = 0x4b00 EXTATTR_MAXNAMELEN = 0xff EXTATTR_NAMESPACE_EMPTY = 0x0 EXTATTR_NAMESPACE_SYSTEM = 0x2 EXTATTR_NAMESPACE_USER = 0x1 EXTB = 0x9600 EXTPROC = 0x800 FD_CLOEXEC = 0x1 FD_SETSIZE = 0x400 FLUSHO = 0x800000 F_CANCEL = 0x5 F_DUP2FD = 0xa F_DUP2FD_CLOEXEC = 0x12 F_DUPFD = 0x0 F_DUPFD_CLOEXEC = 0x11 F_GETFD = 0x1 F_GETFL = 0x3 F_GETLK = 0xb F_GETOWN = 0x5 F_OGETLK = 0x7 F_OK = 0x0 F_OSETLK = 0x8 F_OSETLKW = 0x9 F_RDAHEAD = 0x10 F_RDLCK = 0x1 F_READAHEAD = 0xf F_SETFD = 0x2 F_SETFL = 0x4 F_SETLK = 0xc F_SETLKW = 0xd F_SETLK_REMOTE = 0xe F_SETOWN = 0x6 F_UNLCK = 0x2 F_UNLCKSYS = 0x4 F_WRLCK = 0x3 HUPCL = 0x4000 HW_MACHINE = 0x1 ICANON = 0x100 ICMP6_FILTER = 0x12 ICRNL = 0x100 IEXTEN = 0x400 IFAN_ARRIVAL = 0x0 IFAN_DEPARTURE = 0x1 IFCAP_WOL_MAGIC = 0x2000 IFF_ALLMULTI = 0x200 IFF_ALTPHYS = 0x4000 IFF_BROADCAST = 0x2 IFF_CANTCHANGE = 0x218f52 IFF_CANTCONFIG = 0x10000 IFF_DEBUG = 0x4 IFF_DRV_OACTIVE = 0x400 IFF_DRV_RUNNING = 0x40 IFF_DYING = 0x200000 IFF_LINK0 = 0x1000 IFF_LINK1 = 0x2000 IFF_LINK2 = 0x4000 IFF_LOOPBACK = 0x8 IFF_MONITOR = 0x40000 IFF_MULTICAST = 0x8000 IFF_NOARP = 0x80 IFF_NOGROUP = 0x800000 IFF_OACTIVE = 0x400 IFF_POINTOPOINT = 0x10 IFF_PPROMISC = 0x20000 IFF_PROMISC = 0x100 IFF_RENAMING = 0x400000 IFF_RUNNING = 0x40 IFF_SIMPLEX = 0x800 IFF_STATICARP = 0x80000 IFF_UP = 0x1 IFNAMSIZ = 0x10 IFT_BRIDGE = 0xd1 IFT_CARP = 0xf8 IFT_IEEE1394 = 0x90 IFT_INFINIBAND = 0xc7 IFT_L2VLAN = 0x87 IFT_L3IPVLAN = 0x88 IFT_PPP = 0x17 IFT_PROPVIRTUAL = 0x35 IGNBRK = 0x1 IGNCR = 0x80 IGNPAR = 0x4 IMAXBEL = 0x2000 INLCR = 0x40 INPCK = 0x10 IN_CLASSA_HOST = 0xffffff IN_CLASSA_MAX = 0x80 IN_CLASSA_NET = 0xff000000 IN_CLASSA_NSHIFT = 0x18 IN_CLASSB_HOST = 0xffff IN_CLASSB_MAX = 0x10000 IN_CLASSB_NET = 0xffff0000 IN_CLASSB_NSHIFT = 0x10 IN_CLASSC_HOST = 0xff IN_CLASSC_NET = 0xffffff00 IN_CLASSC_NSHIFT = 0x8 IN_CLASSD_HOST = 0xfffffff IN_CLASSD_NET = 0xf0000000 IN_CLASSD_NSHIFT = 0x1c IN_LOOPBACKNET = 0x7f IN_RFC3021_MASK = 0xfffffffe IPPROTO_3PC = 0x22 IPPROTO_ADFS = 0x44 IPPROTO_AH = 0x33 IPPROTO_AHIP = 0x3d IPPROTO_APES = 0x63 IPPROTO_ARGUS = 0xd IPPROTO_AX25 = 0x5d IPPROTO_BHA = 0x31 IPPROTO_BLT = 0x1e IPPROTO_BRSATMON = 0x4c IPPROTO_CARP = 0x70 IPPROTO_CFTP = 0x3e IPPROTO_CHAOS = 0x10 IPPROTO_CMTP = 0x26 IPPROTO_CPHB = 0x49 IPPROTO_CPNX = 0x48 IPPROTO_DCCP = 0x21 IPPROTO_DDP = 0x25 IPPROTO_DGP = 0x56 IPPROTO_DIVERT = 0x102 IPPROTO_DONE = 0x101 IPPROTO_DSTOPTS = 0x3c IPPROTO_EGP = 0x8 IPPROTO_EMCON = 0xe IPPROTO_ENCAP = 0x62 IPPROTO_EON = 0x50 IPPROTO_ESP = 0x32 IPPROTO_ETHERIP = 0x61 IPPROTO_FRAGMENT = 0x2c IPPROTO_GGP = 0x3 IPPROTO_GMTP = 0x64 IPPROTO_GRE = 0x2f IPPROTO_HELLO = 0x3f IPPROTO_HIP = 0x8b IPPROTO_HMP = 0x14 IPPROTO_HOPOPTS = 0x0 IPPROTO_ICMP = 0x1 IPPROTO_ICMPV6 = 0x3a IPPROTO_IDP = 0x16 IPPROTO_IDPR = 0x23 IPPROTO_IDRP = 0x2d IPPROTO_IGMP = 0x2 IPPROTO_IGP = 0x55 IPPROTO_IGRP = 0x58 IPPROTO_IL = 0x28 IPPROTO_INLSP = 0x34 IPPROTO_INP = 0x20 IPPROTO_IP = 0x0 IPPROTO_IPCOMP = 0x6c IPPROTO_IPCV = 0x47 IPPROTO_IPEIP = 0x5e IPPROTO_IPIP = 0x4 IPPROTO_IPPC = 0x43 IPPROTO_IPV4 = 0x4 IPPROTO_IPV6 = 0x29 IPPROTO_IRTP = 0x1c IPPROTO_KRYPTOLAN = 0x41 IPPROTO_LARP = 0x5b IPPROTO_LEAF1 = 0x19 IPPROTO_LEAF2 = 0x1a IPPROTO_MAX = 0x100 IPPROTO_MEAS = 0x13 IPPROTO_MH = 0x87 IPPROTO_MHRP = 0x30 IPPROTO_MICP = 0x5f IPPROTO_MOBILE = 0x37 IPPROTO_MPLS = 0x89 IPPROTO_MTP = 0x5c IPPROTO_MUX = 0x12 IPPROTO_ND = 0x4d IPPROTO_NHRP = 0x36 IPPROTO_NONE = 0x3b IPPROTO_NSP = 0x1f IPPROTO_NVPII = 0xb IPPROTO_OLD_DIVERT = 0xfe IPPROTO_OSPFIGP = 0x59 IPPROTO_PFSYNC = 0xf0 IPPROTO_PGM = 0x71 IPPROTO_PIGP = 0x9 IPPROTO_PIM = 0x67 IPPROTO_PRM = 0x15 IPPROTO_PUP = 0xc IPPROTO_PVP = 0x4b IPPROTO_RAW = 0xff IPPROTO_RCCMON = 0xa IPPROTO_RDP = 0x1b IPPROTO_RESERVED_253 = 0xfd IPPROTO_RESERVED_254 = 0xfe IPPROTO_ROUTING = 0x2b IPPROTO_RSVP = 0x2e IPPROTO_RVD = 0x42 IPPROTO_SATEXPAK = 0x40 IPPROTO_SATMON = 0x45 IPPROTO_SCCSP = 0x60 IPPROTO_SCTP = 0x84 IPPROTO_SDRP = 0x2a IPPROTO_SEND = 0x103 IPPROTO_SHIM6 = 0x8c IPPROTO_SKIP = 0x39 IPPROTO_SPACER = 0x7fff IPPROTO_SRPC = 0x5a IPPROTO_ST = 0x7 IPPROTO_SVMTP = 0x52 IPPROTO_SWIPE = 0x35 IPPROTO_TCF = 0x57 IPPROTO_TCP = 0x6 IPPROTO_TLSP = 0x38 IPPROTO_TP = 0x1d IPPROTO_TPXX = 0x27 IPPROTO_TRUNK1 = 0x17 IPPROTO_TRUNK2 = 0x18 IPPROTO_TTP = 0x54 IPPROTO_UDP = 0x11 IPPROTO_UDPLITE = 0x88 IPPROTO_VINES = 0x53 IPPROTO_VISA = 0x46 IPPROTO_VMTP = 0x51 IPPROTO_WBEXPAK = 0x4f IPPROTO_WBMON = 0x4e IPPROTO_WSN = 0x4a IPPROTO_XNET = 0xf IPPROTO_XTP = 0x24 IPV6_AUTOFLOWLABEL = 0x3b IPV6_BINDANY = 0x40 IPV6_BINDMULTI = 0x41 IPV6_BINDV6ONLY = 0x1b IPV6_CHECKSUM = 0x1a IPV6_DEFAULT_MULTICAST_HOPS = 0x1 IPV6_DEFAULT_MULTICAST_LOOP = 0x1 IPV6_DEFHLIM = 0x40 IPV6_DONTFRAG = 0x3e IPV6_DSTOPTS = 0x32 IPV6_FLOWID = 0x43 IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_LEN = 0x14 IPV6_FLOWLABEL_MASK = 0xffff0f00 IPV6_FLOWTYPE = 0x44 IPV6_FRAGTTL = 0x78 IPV6_FW_ADD = 0x1e IPV6_FW_DEL = 0x1f IPV6_FW_FLUSH = 0x20 IPV6_FW_GET = 0x22 IPV6_FW_ZERO = 0x21 IPV6_HLIMDEC = 0x1 IPV6_HOPLIMIT = 0x2f IPV6_HOPOPTS = 0x31 IPV6_IPSEC_POLICY = 0x1c IPV6_JOIN_GROUP = 0xc IPV6_LEAVE_GROUP = 0xd IPV6_MAXHLIM = 0xff IPV6_MAXOPTHDR = 0x800 IPV6_MAXPACKET = 0xffff IPV6_MAX_GROUP_SRC_FILTER = 0x200 IPV6_MAX_MEMBERSHIPS = 0xfff IPV6_MAX_SOCK_SRC_FILTER = 0x80 IPV6_MMTU = 0x500 IPV6_MSFILTER = 0x4a IPV6_MULTICAST_HOPS = 0xa IPV6_MULTICAST_IF = 0x9 IPV6_MULTICAST_LOOP = 0xb IPV6_NEXTHOP = 0x30 IPV6_ORIGDSTADDR = 0x48 IPV6_PATHMTU = 0x2c IPV6_PKTINFO = 0x2e IPV6_PORTRANGE = 0xe IPV6_PORTRANGE_DEFAULT = 0x0 IPV6_PORTRANGE_HIGH = 0x1 IPV6_PORTRANGE_LOW = 0x2 IPV6_PREFER_TEMPADDR = 0x3f IPV6_RECVDSTOPTS = 0x28 IPV6_RECVFLOWID = 0x46 IPV6_RECVHOPLIMIT = 0x25 IPV6_RECVHOPOPTS = 0x27 IPV6_RECVORIGDSTADDR = 0x48 IPV6_RECVPATHMTU = 0x2b IPV6_RECVPKTINFO = 0x24 IPV6_RECVRSSBUCKETID = 0x47 IPV6_RECVRTHDR = 0x26 IPV6_RECVTCLASS = 0x39 IPV6_RSSBUCKETID = 0x45 IPV6_RSS_LISTEN_BUCKET = 0x42 IPV6_RTHDR = 0x33 IPV6_RTHDRDSTOPTS = 0x23 IPV6_RTHDR_LOOSE = 0x0 IPV6_RTHDR_STRICT = 0x1 IPV6_RTHDR_TYPE_0 = 0x0 IPV6_SOCKOPT_RESERVED1 = 0x3 IPV6_TCLASS = 0x3d IPV6_UNICAST_HOPS = 0x4 IPV6_USE_MIN_MTU = 0x2a IPV6_V6ONLY = 0x1b IPV6_VERSION = 0x60 IPV6_VERSION_MASK = 0xf0 IPV6_VLAN_PCP = 0x4b IP_ADD_MEMBERSHIP = 0xc IP_ADD_SOURCE_MEMBERSHIP = 0x46 IP_BINDANY = 0x18 IP_BINDMULTI = 0x19 IP_BLOCK_SOURCE = 0x48 IP_DEFAULT_MULTICAST_LOOP = 0x1 IP_DEFAULT_MULTICAST_TTL = 0x1 IP_DF = 0x4000 IP_DONTFRAG = 0x43 IP_DROP_MEMBERSHIP = 0xd IP_DROP_SOURCE_MEMBERSHIP = 0x47 IP_DUMMYNET3 = 0x31 IP_DUMMYNET_CONFIGURE = 0x3c IP_DUMMYNET_DEL = 0x3d IP_DUMMYNET_FLUSH = 0x3e IP_DUMMYNET_GET = 0x40 IP_FLOWID = 0x5a IP_FLOWTYPE = 0x5b IP_FW3 = 0x30 IP_FW_ADD = 0x32 IP_FW_DEL = 0x33 IP_FW_FLUSH = 0x34 IP_FW_GET = 0x36 IP_FW_NAT_CFG = 0x38 IP_FW_NAT_DEL = 0x39 IP_FW_NAT_GET_CONFIG = 0x3a IP_FW_NAT_GET_LOG = 0x3b IP_FW_RESETLOG = 0x37 IP_FW_TABLE_ADD = 0x28 IP_FW_TABLE_DEL = 0x29 IP_FW_TABLE_FLUSH = 0x2a IP_FW_TABLE_GETSIZE = 0x2b IP_FW_TABLE_LIST = 0x2c IP_FW_ZERO = 0x35 IP_HDRINCL = 0x2 IP_IPSEC_POLICY = 0x15 IP_MAXPACKET = 0xffff IP_MAX_GROUP_SRC_FILTER = 0x200 IP_MAX_MEMBERSHIPS = 0xfff IP_MAX_SOCK_MUTE_FILTER = 0x80 IP_MAX_SOCK_SRC_FILTER = 0x80 IP_MF = 0x2000 IP_MINTTL = 0x42 IP_MSFILTER = 0x4a IP_MSS = 0x240 IP_MULTICAST_IF = 0x9 IP_MULTICAST_LOOP = 0xb IP_MULTICAST_TTL = 0xa IP_MULTICAST_VIF = 0xe IP_OFFMASK = 0x1fff IP_ONESBCAST = 0x17 IP_OPTIONS = 0x1 IP_ORIGDSTADDR = 0x1b IP_PORTRANGE = 0x13 IP_PORTRANGE_DEFAULT = 0x0 IP_PORTRANGE_HIGH = 0x1 IP_PORTRANGE_LOW = 0x2 IP_RECVDSTADDR = 0x7 IP_RECVFLOWID = 0x5d IP_RECVIF = 0x14 IP_RECVOPTS = 0x5 IP_RECVORIGDSTADDR = 0x1b IP_RECVRETOPTS = 0x6 IP_RECVRSSBUCKETID = 0x5e IP_RECVTOS = 0x44 IP_RECVTTL = 0x41 IP_RETOPTS = 0x8 IP_RF = 0x8000 IP_RSSBUCKETID = 0x5c IP_RSS_LISTEN_BUCKET = 0x1a IP_RSVP_OFF = 0x10 IP_RSVP_ON = 0xf IP_RSVP_VIF_OFF = 0x12 IP_RSVP_VIF_ON = 0x11 IP_SENDSRCADDR = 0x7 IP_TOS = 0x3 IP_TTL = 0x4 IP_UNBLOCK_SOURCE = 0x49 IP_VLAN_PCP = 0x4b ISIG = 0x80 ISTRIP = 0x20 ITIMER_PROF = 0x2 ITIMER_REAL = 0x0 ITIMER_VIRTUAL = 0x1 IXANY = 0x800 IXOFF = 0x400 IXON = 0x200 KERN_HOSTNAME = 0xa KERN_OSRELEASE = 0x2 KERN_OSTYPE = 0x1 KERN_VERSION = 0x4 LOCAL_CONNWAIT = 0x4 LOCAL_CREDS = 0x2 LOCAL_PEERCRED = 0x1 LOCAL_VENDOR = 0x80000000 LOCK_EX = 0x2 LOCK_NB = 0x4 LOCK_SH = 0x1 LOCK_UN = 0x8 MADV_AUTOSYNC = 0x7 MADV_CORE = 0x9 MADV_DONTNEED = 0x4 MADV_FREE = 0x5 MADV_NOCORE = 0x8 MADV_NORMAL = 0x0 MADV_NOSYNC = 0x6 MADV_PROTECT = 0xa MADV_RANDOM = 0x1 MADV_SEQUENTIAL = 0x2 MADV_WILLNEED = 0x3 MAP_ALIGNED_SUPER = 0x1000000 MAP_ALIGNMENT_MASK = -0x1000000 MAP_ALIGNMENT_SHIFT = 0x18 MAP_ANON = 0x1000 MAP_ANONYMOUS = 0x1000 MAP_COPY = 0x2 MAP_EXCL = 0x4000 MAP_FILE = 0x0 MAP_FIXED = 0x10 MAP_GUARD = 0x2000 MAP_HASSEMAPHORE = 0x200 MAP_NOCORE = 0x20000 MAP_NOSYNC = 0x800 MAP_PREFAULT_READ = 0x40000 MAP_PRIVATE = 0x2 MAP_RESERVED0020 = 0x20 MAP_RESERVED0040 = 0x40 MAP_RESERVED0080 = 0x80 MAP_RESERVED0100 = 0x100 MAP_SHARED = 0x1 MAP_STACK = 0x400 MCAST_BLOCK_SOURCE = 0x54 MCAST_EXCLUDE = 0x2 MCAST_INCLUDE = 0x1 MCAST_JOIN_GROUP = 0x50 MCAST_JOIN_SOURCE_GROUP = 0x52 MCAST_LEAVE_GROUP = 0x51 MCAST_LEAVE_SOURCE_GROUP = 0x53 MCAST_UNBLOCK_SOURCE = 0x55 MCAST_UNDEFINED = 0x0 MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MNT_ACLS = 0x8000000 MNT_ASYNC = 0x40 MNT_AUTOMOUNTED = 0x200000000 MNT_BYFSID = 0x8000000 MNT_CMDFLAGS = 0xd0f0000 MNT_DEFEXPORTED = 0x200 MNT_DELEXPORT = 0x20000 MNT_EXKERB = 0x800 MNT_EXPORTANON = 0x400 MNT_EXPORTED = 0x100 MNT_EXPUBLIC = 0x20000000 MNT_EXRDONLY = 0x80 MNT_FORCE = 0x80000 MNT_GJOURNAL = 0x2000000 MNT_IGNORE = 0x800000 MNT_LAZY = 0x3 MNT_LOCAL = 0x1000 MNT_MULTILABEL = 0x4000000 MNT_NFS4ACLS = 0x10 MNT_NOATIME = 0x10000000 MNT_NOCLUSTERR = 0x40000000 MNT_NOCLUSTERW = 0x80000000 MNT_NOEXEC = 0x4 MNT_NONBUSY = 0x4000000 MNT_NOSUID = 0x8 MNT_NOSYMFOLLOW = 0x400000 MNT_NOWAIT = 0x2 MNT_QUOTA = 0x2000 MNT_RDONLY = 0x1 MNT_RELOAD = 0x40000 MNT_ROOTFS = 0x4000 MNT_SNAPSHOT = 0x1000000 MNT_SOFTDEP = 0x200000 MNT_SUIDDIR = 0x100000 MNT_SUJ = 0x100000000 MNT_SUSPEND = 0x4 MNT_SYNCHRONOUS = 0x2 MNT_UNION = 0x20 MNT_UNTRUSTED = 0x800000000 MNT_UPDATE = 0x10000 MNT_UPDATEMASK = 0xad8d0807e MNT_USER = 0x8000 MNT_VERIFIED = 0x400000000 MNT_VISFLAGMASK = 0xffef0ffff MNT_WAIT = 0x1 MSG_CMSG_CLOEXEC = 0x40000 MSG_COMPAT = 0x8000 MSG_CTRUNC = 0x20 MSG_DONTROUTE = 0x4 MSG_DONTWAIT = 0x80 MSG_EOF = 0x100 MSG_EOR = 0x8 MSG_NBIO = 0x4000 MSG_NOSIGNAL = 0x20000 MSG_NOTIFICATION = 0x2000 MSG_OOB = 0x1 MSG_PEEK = 0x2 MSG_TRUNC = 0x10 MSG_WAITALL = 0x40 MSG_WAITFORONE = 0x80000 MS_ASYNC = 0x1 MS_INVALIDATE = 0x2 MS_SYNC = 0x0 NAME_MAX = 0xff NET_RT_DUMP = 0x1 NET_RT_FLAGS = 0x2 NET_RT_IFLIST = 0x3 NET_RT_IFLISTL = 0x5 NET_RT_IFMALIST = 0x4 NFDBITS = 0x20 NOFLSH = 0x80000000 NOKERNINFO = 0x2000000 NOTE_ABSTIME = 0x10 NOTE_ATTRIB = 0x8 NOTE_CHILD = 0x4 NOTE_CLOSE = 0x100 NOTE_CLOSE_WRITE = 0x200 NOTE_DELETE = 0x1 NOTE_EXEC = 0x20000000 NOTE_EXIT = 0x80000000 NOTE_EXTEND = 0x4 NOTE_FFAND = 0x40000000 NOTE_FFCOPY = 0xc0000000 NOTE_FFCTRLMASK = 0xc0000000 NOTE_FFLAGSMASK = 0xffffff NOTE_FFNOP = 0x0 NOTE_FFOR = 0x80000000 NOTE_FILE_POLL = 0x2 NOTE_FORK = 0x40000000 NOTE_LINK = 0x10 NOTE_LOWAT = 0x1 NOTE_MSECONDS = 0x2 NOTE_NSECONDS = 0x8 NOTE_OPEN = 0x80 NOTE_PCTRLMASK = 0xf0000000 NOTE_PDATAMASK = 0xfffff NOTE_READ = 0x400 NOTE_RENAME = 0x20 NOTE_REVOKE = 0x40 NOTE_SECONDS = 0x1 NOTE_TRACK = 0x1 NOTE_TRACKERR = 0x2 NOTE_TRIGGER = 0x1000000 NOTE_USECONDS = 0x4 NOTE_WRITE = 0x2 OCRNL = 0x10 ONLCR = 0x2 ONLRET = 0x40 ONOCR = 0x20 ONOEOT = 0x8 OPOST = 0x1 OXTABS = 0x4 O_ACCMODE = 0x3 O_APPEND = 0x8 O_ASYNC = 0x40 O_CLOEXEC = 0x100000 O_CREAT = 0x200 O_DIRECT = 0x10000 O_DIRECTORY = 0x20000 O_EXCL = 0x800 O_EXEC = 0x40000 O_EXLOCK = 0x20 O_FSYNC = 0x80 O_NDELAY = 0x4 O_NOCTTY = 0x8000 O_NOFOLLOW = 0x100 O_NONBLOCK = 0x4 O_RDONLY = 0x0 O_RDWR = 0x2 O_RESOLVE_BENEATH = 0x800000 O_SEARCH = 0x40000 O_SHLOCK = 0x10 O_SYNC = 0x80 O_TRUNC = 0x400 O_TTY_INIT = 0x80000 O_VERIFY = 0x200000 O_WRONLY = 0x1 PARENB = 0x1000 PARMRK = 0x8 PARODD = 0x2000 PENDIN = 0x20000000 PIOD_READ_D = 0x1 PIOD_READ_I = 0x3 PIOD_WRITE_D = 0x2 PIOD_WRITE_I = 0x4 PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 PROT_EXEC = 0x4 PROT_NONE = 0x0 PROT_READ = 0x1 PROT_WRITE = 0x2 PTRACE_DEFAULT = 0x1 PTRACE_EXEC = 0x1 PTRACE_FORK = 0x8 PTRACE_LWP = 0x10 PTRACE_SCE = 0x2 PTRACE_SCX = 0x4 PTRACE_SYSCALL = 0x6 PTRACE_VFORK = 0x20 PT_ATTACH = 0xa PT_CLEARSTEP = 0x10 PT_CONTINUE = 0x7 PT_DETACH = 0xb PT_FIRSTMACH = 0x40 PT_FOLLOW_FORK = 0x17 PT_GETDBREGS = 0x25 PT_GETFPREGS = 0x23 PT_GETLWPLIST = 0xf PT_GETNUMLWPS = 0xe PT_GETREGS = 0x21 PT_GETVFPREGS = 0x40 PT_GET_EVENT_MASK = 0x19 PT_GET_SC_ARGS = 0x1b PT_GET_SC_RET = 0x1c PT_IO = 0xc PT_KILL = 0x8 PT_LWPINFO = 0xd PT_LWP_EVENTS = 0x18 PT_READ_D = 0x2 PT_READ_I = 0x1 PT_RESUME = 0x13 PT_SETDBREGS = 0x26 PT_SETFPREGS = 0x24 PT_SETREGS = 0x22 PT_SETSTEP = 0x11 PT_SETVFPREGS = 0x41 PT_SET_EVENT_MASK = 0x1a PT_STEP = 0x9 PT_SUSPEND = 0x12 PT_SYSCALL = 0x16 PT_TO_SCE = 0x14 PT_TO_SCX = 0x15 PT_TRACE_ME = 0x0 PT_VM_ENTRY = 0x29 PT_VM_TIMESTAMP = 0x28 PT_WRITE_D = 0x5 PT_WRITE_I = 0x4 P_ZONEID = 0xc RLIMIT_AS = 0xa RLIMIT_CORE = 0x4 RLIMIT_CPU = 0x0 RLIMIT_DATA = 0x2 RLIMIT_FSIZE = 0x1 RLIMIT_MEMLOCK = 0x6 RLIMIT_NOFILE = 0x8 RLIMIT_NPROC = 0x7 RLIMIT_RSS = 0x5 RLIMIT_STACK = 0x3 RLIM_INFINITY = 0x7fffffffffffffff RTAX_AUTHOR = 0x6 RTAX_BRD = 0x7 RTAX_DST = 0x0 RTAX_GATEWAY = 0x1 RTAX_GENMASK = 0x3 RTAX_IFA = 0x5 RTAX_IFP = 0x4 RTAX_MAX = 0x8 RTAX_NETMASK = 0x2 RTA_AUTHOR = 0x40 RTA_BRD = 0x80 RTA_DST = 0x1 RTA_GATEWAY = 0x2 RTA_GENMASK = 0x8 RTA_IFA = 0x20 RTA_IFP = 0x10 RTA_NETMASK = 0x4 RTF_BLACKHOLE = 0x1000 RTF_BROADCAST = 0x400000 RTF_DONE = 0x40 RTF_DYNAMIC = 0x10 RTF_FIXEDMTU = 0x80000 RTF_FMASK = 0x1004d808 RTF_GATEWAY = 0x2 RTF_GWFLAG_COMPAT = 0x80000000 RTF_HOST = 0x4 RTF_LLDATA = 0x400 RTF_LLINFO = 0x400 RTF_LOCAL = 0x200000 RTF_MODIFIED = 0x20 RTF_MULTICAST = 0x800000 RTF_PINNED = 0x100000 RTF_PROTO1 = 0x8000 RTF_PROTO2 = 0x4000 RTF_PROTO3 = 0x40000 RTF_REJECT = 0x8 RTF_RNH_LOCKED = 0x40000000 RTF_STATIC = 0x800 RTF_STICKY = 0x10000000 RTF_UP = 0x1 RTF_XRESOLVE = 0x200 RTM_ADD = 0x1 RTM_CHANGE = 0x3 RTM_DELADDR = 0xd RTM_DELETE = 0x2 RTM_DELMADDR = 0x10 RTM_GET = 0x4 RTM_IEEE80211 = 0x12 RTM_IFANNOUNCE = 0x11 RTM_IFINFO = 0xe RTM_LOCK = 0x8 RTM_LOSING = 0x5 RTM_MISS = 0x7 RTM_NEWADDR = 0xc RTM_NEWMADDR = 0xf RTM_REDIRECT = 0x6 RTM_RESOLVE = 0xb RTM_RTTUNIT = 0xf4240 RTM_VERSION = 0x5 RTV_EXPIRE = 0x4 RTV_HOPCOUNT = 0x2 RTV_MTU = 0x1 RTV_RPIPE = 0x8 RTV_RTT = 0x40 RTV_RTTVAR = 0x80 RTV_SPIPE = 0x10 RTV_SSTHRESH = 0x20 RTV_WEIGHT = 0x100 RT_ALL_FIBS = -0x1 RT_BLACKHOLE = 0x40 RT_DEFAULT_FIB = 0x0 RT_HAS_GW = 0x80 RT_HAS_HEADER = 0x10 RT_HAS_HEADER_BIT = 0x4 RT_L2_ME = 0x4 RT_L2_ME_BIT = 0x2 RT_LLE_CACHE = 0x100 RT_MAY_LOOP = 0x8 RT_MAY_LOOP_BIT = 0x3 RT_REJECT = 0x20 RUSAGE_CHILDREN = -0x1 RUSAGE_SELF = 0x0 RUSAGE_THREAD = 0x1 SCM_BINTIME = 0x4 SCM_CREDS = 0x3 SCM_MONOTONIC = 0x6 SCM_REALTIME = 0x5 SCM_RIGHTS = 0x1 SCM_TIMESTAMP = 0x2 SCM_TIME_INFO = 0x7 SEEK_CUR = 0x1 SEEK_DATA = 0x3 SEEK_END = 0x2 SEEK_HOLE = 0x4 SEEK_SET = 0x0 SHUT_RD = 0x0 SHUT_RDWR = 0x2 SHUT_WR = 0x1 SIOCADDMULTI = 0x80206931 SIOCAIFADDR = 0x8040691a SIOCAIFGROUP = 0x80246987 SIOCATMARK = 0x40047307 SIOCDELMULTI = 0x80206932 SIOCDIFADDR = 0x80206919 SIOCDIFGROUP = 0x80246989 SIOCDIFPHYADDR = 0x80206949 SIOCGDRVSPEC = 0xc01c697b SIOCGETSGCNT = 0xc0147210 SIOCGETVIFCNT = 0xc014720f SIOCGHIWAT = 0x40047301 SIOCGHWADDR = 0xc020693e SIOCGI2C = 0xc020693d SIOCGIFADDR = 0xc0206921 SIOCGIFALIAS = 0xc044692d SIOCGIFBRDADDR = 0xc0206923 SIOCGIFCAP = 0xc020691f SIOCGIFCONF = 0xc0086924 SIOCGIFDESCR = 0xc020692a SIOCGIFDOWNREASON = 0xc058699a SIOCGIFDSTADDR = 0xc0206922 SIOCGIFFIB = 0xc020695c SIOCGIFFLAGS = 0xc0206911 SIOCGIFGENERIC = 0xc020693a SIOCGIFGMEMB = 0xc024698a SIOCGIFGROUP = 0xc0246988 SIOCGIFINDEX = 0xc0206920 SIOCGIFMAC = 0xc0206926 SIOCGIFMEDIA = 0xc0286938 SIOCGIFMETRIC = 0xc0206917 SIOCGIFMTU = 0xc0206933 SIOCGIFNETMASK = 0xc0206925 SIOCGIFPDSTADDR = 0xc0206948 SIOCGIFPHYS = 0xc0206935 SIOCGIFPSRCADDR = 0xc0206947 SIOCGIFRSSHASH = 0xc0186997 SIOCGIFRSSKEY = 0xc0946996 SIOCGIFSTATUS = 0xc331693b SIOCGIFXMEDIA = 0xc028698b SIOCGLANPCP = 0xc0206998 SIOCGLOWAT = 0x40047303 SIOCGPGRP = 0x40047309 SIOCGPRIVATE_0 = 0xc0206950 SIOCGPRIVATE_1 = 0xc0206951 SIOCGTUNFIB = 0xc020695e SIOCIFCREATE = 0xc020697a SIOCIFCREATE2 = 0xc020697c SIOCIFDESTROY = 0x80206979 SIOCIFGCLONERS = 0xc00c6978 SIOCSDRVSPEC = 0x801c697b SIOCSHIWAT = 0x80047300 SIOCSIFADDR = 0x8020690c SIOCSIFBRDADDR = 0x80206913 SIOCSIFCAP = 0x8020691e SIOCSIFDESCR = 0x80206929 SIOCSIFDSTADDR = 0x8020690e SIOCSIFFIB = 0x8020695d SIOCSIFFLAGS = 0x80206910 SIOCSIFGENERIC = 0x80206939 SIOCSIFLLADDR = 0x8020693c SIOCSIFMAC = 0x80206927 SIOCSIFMEDIA = 0xc0206937 SIOCSIFMETRIC = 0x80206918 SIOCSIFMTU = 0x80206934 SIOCSIFNAME = 0x80206928 SIOCSIFNETMASK = 0x80206916 SIOCSIFPHYADDR = 0x80406946 SIOCSIFPHYS = 0x80206936 SIOCSIFRVNET = 0xc020695b SIOCSIFVNET = 0xc020695a SIOCSLANPCP = 0x80206999 SIOCSLOWAT = 0x80047302 SIOCSPGRP = 0x80047308 SIOCSTUNFIB = 0x8020695f SOCK_CLOEXEC = 0x10000000 SOCK_DGRAM = 0x2 SOCK_MAXADDRLEN = 0xff SOCK_NONBLOCK = 0x20000000 SOCK_RAW = 0x3 SOCK_RDM = 0x4 SOCK_SEQPACKET = 0x5 SOCK_STREAM = 0x1 SOL_LOCAL = 0x0 SOL_SOCKET = 0xffff SOMAXCONN = 0x80 SO_ACCEPTCONN = 0x2 SO_ACCEPTFILTER = 0x1000 SO_BINTIME = 0x2000 SO_BROADCAST = 0x20 SO_DEBUG = 0x1 SO_DOMAIN = 0x1019 SO_DONTROUTE = 0x10 SO_ERROR = 0x1007 SO_KEEPALIVE = 0x8 SO_LABEL = 0x1009 SO_LINGER = 0x80 SO_LISTENINCQLEN = 0x1013 SO_LISTENQLEN = 0x1012 SO_LISTENQLIMIT = 0x1011 SO_MAX_PACING_RATE = 0x1018 SO_NOSIGPIPE = 0x800 SO_NO_DDP = 0x8000 SO_NO_OFFLOAD = 0x4000 SO_OOBINLINE = 0x100 SO_PEERLABEL = 0x1010 SO_PROTOCOL = 0x1016 SO_PROTOTYPE = 0x1016 SO_RCVBUF = 0x1002 SO_RCVLOWAT = 0x1004 SO_RCVTIMEO = 0x1006 SO_RERROR = 0x20000 SO_REUSEADDR = 0x4 SO_REUSEPORT = 0x200 SO_REUSEPORT_LB = 0x10000 SO_SETFIB = 0x1014 SO_SNDBUF = 0x1001 SO_SNDLOWAT = 0x1003 SO_SNDTIMEO = 0x1005 SO_TIMESTAMP = 0x400 SO_TS_BINTIME = 0x1 SO_TS_CLOCK = 0x1017 SO_TS_CLOCK_MAX = 0x3 SO_TS_DEFAULT = 0x0 SO_TS_MONOTONIC = 0x3 SO_TS_REALTIME = 0x2 SO_TS_REALTIME_MICRO = 0x0 SO_TYPE = 0x1008 SO_USELOOPBACK = 0x40 SO_USER_COOKIE = 0x1015 SO_VENDOR = 0x80000000 S_BLKSIZE = 0x200 S_IEXEC = 0x40 S_IFBLK = 0x6000 S_IFCHR = 0x2000 S_IFDIR = 0x4000 S_IFIFO = 0x1000 S_IFLNK = 0xa000 S_IFMT = 0xf000 S_IFREG = 0x8000 S_IFSOCK = 0xc000 S_IFWHT = 0xe000 S_IREAD = 0x100 S_IRGRP = 0x20 S_IROTH = 0x4 S_IRUSR = 0x100 S_IRWXG = 0x38 S_IRWXO = 0x7 S_IRWXU = 0x1c0 S_ISGID = 0x400 S_ISTXT = 0x200 S_ISUID = 0x800 S_ISVTX = 0x200 S_IWGRP = 0x10 S_IWOTH = 0x2 S_IWRITE = 0x80 S_IWUSR = 0x80 S_IXGRP = 0x8 S_IXOTH = 0x1 S_IXUSR = 0x40 TAB0 = 0x0 TAB3 = 0x4 TABDLY = 0x4 TCIFLUSH = 0x1 TCIOFF = 0x3 TCIOFLUSH = 0x3 TCION = 0x4 TCOFLUSH = 0x2 TCOOFF = 0x1 TCOON = 0x2 TCPOPT_EOL = 0x0 TCPOPT_FAST_OPEN = 0x22 TCPOPT_MAXSEG = 0x2 TCPOPT_NOP = 0x1 TCPOPT_PAD = 0x0 TCPOPT_SACK = 0x5 TCPOPT_SACK_PERMITTED = 0x4 TCPOPT_SIGNATURE = 0x13 TCPOPT_TIMESTAMP = 0x8 TCPOPT_WINDOW = 0x3 TCP_BBR_ACK_COMP_ALG = 0x448 TCP_BBR_ALGORITHM = 0x43b TCP_BBR_DRAIN_INC_EXTRA = 0x43c TCP_BBR_DRAIN_PG = 0x42e TCP_BBR_EXTRA_GAIN = 0x449 TCP_BBR_EXTRA_STATE = 0x453 TCP_BBR_FLOOR_MIN_TSO = 0x454 TCP_BBR_HDWR_PACE = 0x451 TCP_BBR_HOLD_TARGET = 0x436 TCP_BBR_IWINTSO = 0x42b TCP_BBR_LOWGAIN_FD = 0x436 TCP_BBR_LOWGAIN_HALF = 0x435 TCP_BBR_LOWGAIN_THRESH = 0x434 TCP_BBR_MAX_RTO = 0x439 TCP_BBR_MIN_RTO = 0x438 TCP_BBR_MIN_TOPACEOUT = 0x455 TCP_BBR_ONE_RETRAN = 0x431 TCP_BBR_PACE_CROSS = 0x442 TCP_BBR_PACE_DEL_TAR = 0x43f TCP_BBR_PACE_OH = 0x435 TCP_BBR_PACE_PER_SEC = 0x43e TCP_BBR_PACE_SEG_MAX = 0x440 TCP_BBR_PACE_SEG_MIN = 0x441 TCP_BBR_POLICER_DETECT = 0x457 TCP_BBR_PROBE_RTT_GAIN = 0x44d TCP_BBR_PROBE_RTT_INT = 0x430 TCP_BBR_PROBE_RTT_LEN = 0x44e TCP_BBR_RACK_RTT_USE = 0x44a TCP_BBR_RECFORCE = 0x42c TCP_BBR_REC_OVER_HPTS = 0x43a TCP_BBR_RETRAN_WTSO = 0x44b TCP_BBR_RWND_IS_APP = 0x42f TCP_BBR_SEND_IWND_IN_TSO = 0x44f TCP_BBR_STARTUP_EXIT_EPOCH = 0x43d TCP_BBR_STARTUP_LOSS_EXIT = 0x432 TCP_BBR_STARTUP_PG = 0x42d TCP_BBR_TMR_PACE_OH = 0x448 TCP_BBR_TSLIMITS = 0x434 TCP_BBR_TSTMP_RAISES = 0x456 TCP_BBR_UNLIMITED = 0x43b TCP_BBR_USEDEL_RATE = 0x437 TCP_BBR_USE_LOWGAIN = 0x433 TCP_BBR_USE_RACK_CHEAT = 0x450 TCP_BBR_UTTER_MAX_TSO = 0x452 TCP_CA_NAME_MAX = 0x10 TCP_CCALGOOPT = 0x41 TCP_CONGESTION = 0x40 TCP_DATA_AFTER_CLOSE = 0x44c TCP_DELACK = 0x48 TCP_FASTOPEN = 0x401 TCP_FASTOPEN_MAX_COOKIE_LEN = 0x10 TCP_FASTOPEN_MIN_COOKIE_LEN = 0x4 TCP_FASTOPEN_PSK_LEN = 0x10 TCP_FUNCTION_BLK = 0x2000 TCP_FUNCTION_NAME_LEN_MAX = 0x20 TCP_INFO = 0x20 TCP_KEEPCNT = 0x400 TCP_KEEPIDLE = 0x100 TCP_KEEPINIT = 0x80 TCP_KEEPINTVL = 0x200 TCP_LOG = 0x22 TCP_LOGBUF = 0x23 TCP_LOGDUMP = 0x25 TCP_LOGDUMPID = 0x26 TCP_LOGID = 0x24 TCP_LOG_ID_LEN = 0x40 TCP_MAXBURST = 0x4 TCP_MAXHLEN = 0x3c TCP_MAXOLEN = 0x28 TCP_MAXSEG = 0x2 TCP_MAXWIN = 0xffff TCP_MAX_SACK = 0x4 TCP_MAX_WINSHIFT = 0xe TCP_MD5SIG = 0x10 TCP_MINMSS = 0xd8 TCP_MSS = 0x218 TCP_NODELAY = 0x1 TCP_NOOPT = 0x8 TCP_NOPUSH = 0x4 TCP_PCAP_IN = 0x1000 TCP_PCAP_OUT = 0x800 TCP_RACK_EARLY_RECOV = 0x423 TCP_RACK_EARLY_SEG = 0x424 TCP_RACK_GP_INCREASE = 0x446 TCP_RACK_IDLE_REDUCE_HIGH = 0x444 TCP_RACK_MIN_PACE = 0x445 TCP_RACK_MIN_PACE_SEG = 0x446 TCP_RACK_MIN_TO = 0x422 TCP_RACK_PACE_ALWAYS = 0x41f TCP_RACK_PACE_MAX_SEG = 0x41e TCP_RACK_PACE_REDUCE = 0x41d TCP_RACK_PKT_DELAY = 0x428 TCP_RACK_PROP = 0x41b TCP_RACK_PROP_RATE = 0x420 TCP_RACK_PRR_SENDALOT = 0x421 TCP_RACK_REORD_FADE = 0x426 TCP_RACK_REORD_THRESH = 0x425 TCP_RACK_TLP_INC_VAR = 0x429 TCP_RACK_TLP_REDUCE = 0x41c TCP_RACK_TLP_THRESH = 0x427 TCP_RACK_TLP_USE = 0x447 TCP_VENDOR = 0x80000000 TCSAFLUSH = 0x2 TIMER_ABSTIME = 0x1 TIMER_RELTIME = 0x0 TIOCCBRK = 0x2000747a TIOCCDTR = 0x20007478 TIOCCONS = 0x80047462 TIOCDRAIN = 0x2000745e TIOCEXCL = 0x2000740d TIOCEXT = 0x80047460 TIOCFLUSH = 0x80047410 TIOCGDRAINWAIT = 0x40047456 TIOCGETA = 0x402c7413 TIOCGETD = 0x4004741a TIOCGPGRP = 0x40047477 TIOCGPTN = 0x4004740f TIOCGSID = 0x40047463 TIOCGWINSZ = 0x40087468 TIOCMBIC = 0x8004746b TIOCMBIS = 0x8004746c TIOCMGDTRWAIT = 0x4004745a TIOCMGET = 0x4004746a TIOCMSDTRWAIT = 0x8004745b TIOCMSET = 0x8004746d TIOCM_CAR = 0x40 TIOCM_CD = 0x40 TIOCM_CTS = 0x20 TIOCM_DCD = 0x40 TIOCM_DSR = 0x100 TIOCM_DTR = 0x2 TIOCM_LE = 0x1 TIOCM_RI = 0x80 TIOCM_RNG = 0x80 TIOCM_RTS = 0x4 TIOCM_SR = 0x10 TIOCM_ST = 0x8 TIOCNOTTY = 0x20007471 TIOCNXCL = 0x2000740e TIOCOUTQ = 0x40047473 TIOCPKT = 0x80047470 TIOCPKT_DATA = 0x0 TIOCPKT_DOSTOP = 0x20 TIOCPKT_FLUSHREAD = 0x1 TIOCPKT_FLUSHWRITE = 0x2 TIOCPKT_IOCTL = 0x40 TIOCPKT_NOSTOP = 0x10 TIOCPKT_START = 0x8 TIOCPKT_STOP = 0x4 TIOCPTMASTER = 0x2000741c TIOCSBRK = 0x2000747b TIOCSCTTY = 0x20007461 TIOCSDRAINWAIT = 0x80047457 TIOCSDTR = 0x20007479 TIOCSETA = 0x802c7414 TIOCSETAF = 0x802c7416 TIOCSETAW = 0x802c7415 TIOCSETD = 0x8004741b TIOCSIG = 0x2004745f TIOCSPGRP = 0x80047476 TIOCSTART = 0x2000746e TIOCSTAT = 0x20007465 TIOCSTI = 0x80017472 TIOCSTOP = 0x2000746f TIOCSWINSZ = 0x80087467 TIOCTIMESTAMP = 0x40107459 TIOCUCNTL = 0x80047466 TOSTOP = 0x400000 UTIME_NOW = -0x1 UTIME_OMIT = -0x2 VDISCARD = 0xf VDSUSP = 0xb VEOF = 0x0 VEOL = 0x1 VEOL2 = 0x2 VERASE = 0x3 VERASE2 = 0x7 VINTR = 0x8 VKILL = 0x5 VLNEXT = 0xe VMIN = 0x10 VQUIT = 0x9 VREPRINT = 0x6 VSTART = 0xc VSTATUS = 0x12 VSTOP = 0xd VSUSP = 0xa VTIME = 0x11 VWERASE = 0x4 WCONTINUED = 0x4 WCOREFLAG = 0x80 WEXITED = 0x10 WLINUXCLONE = 0x80000000 WNOHANG = 0x1 WNOWAIT = 0x8 WSTOPPED = 0x2 WTRAPPED = 0x20 WUNTRACED = 0x2 ) // Errors const ( E2BIG = syscall.Errno(0x7) EACCES = syscall.Errno(0xd) EADDRINUSE = syscall.Errno(0x30) EADDRNOTAVAIL = syscall.Errno(0x31) EAFNOSUPPORT = syscall.Errno(0x2f) EAGAIN = syscall.Errno(0x23) EALREADY = syscall.Errno(0x25) EAUTH = syscall.Errno(0x50) EBADF = syscall.Errno(0x9) EBADMSG = syscall.Errno(0x59) EBADRPC = syscall.Errno(0x48) EBUSY = syscall.Errno(0x10) ECANCELED = syscall.Errno(0x55) ECAPMODE = syscall.Errno(0x5e) ECHILD = syscall.Errno(0xa) ECONNABORTED = syscall.Errno(0x35) ECONNREFUSED = syscall.Errno(0x3d) ECONNRESET = syscall.Errno(0x36) EDEADLK = syscall.Errno(0xb) EDESTADDRREQ = syscall.Errno(0x27) EDOM = syscall.Errno(0x21) EDOOFUS = syscall.Errno(0x58) EDQUOT = syscall.Errno(0x45) EEXIST = syscall.Errno(0x11) EFAULT = syscall.Errno(0xe) EFBIG = syscall.Errno(0x1b) EFTYPE = syscall.Errno(0x4f) EHOSTDOWN = syscall.Errno(0x40) EHOSTUNREACH = syscall.Errno(0x41) EIDRM = syscall.Errno(0x52) EILSEQ = syscall.Errno(0x56) EINPROGRESS = syscall.Errno(0x24) EINTEGRITY = syscall.Errno(0x61) EINTR = syscall.Errno(0x4) EINVAL = syscall.Errno(0x16) EIO = syscall.Errno(0x5) EISCONN = syscall.Errno(0x38) EISDIR = syscall.Errno(0x15) ELAST = syscall.Errno(0x61) ELOOP = syscall.Errno(0x3e) EMFILE = syscall.Errno(0x18) EMLINK = syscall.Errno(0x1f) EMSGSIZE = syscall.Errno(0x28) EMULTIHOP = syscall.Errno(0x5a) ENAMETOOLONG = syscall.Errno(0x3f) ENEEDAUTH = syscall.Errno(0x51) ENETDOWN = syscall.Errno(0x32) ENETRESET = syscall.Errno(0x34) ENETUNREACH = syscall.Errno(0x33) ENFILE = syscall.Errno(0x17) ENOATTR = syscall.Errno(0x57) ENOBUFS = syscall.Errno(0x37) ENODEV = syscall.Errno(0x13) ENOENT = syscall.Errno(0x2) ENOEXEC = syscall.Errno(0x8) ENOLCK = syscall.Errno(0x4d) ENOLINK = syscall.Errno(0x5b) ENOMEM = syscall.Errno(0xc) ENOMSG = syscall.Errno(0x53) ENOPROTOOPT = syscall.Errno(0x2a) ENOSPC = syscall.Errno(0x1c) ENOSYS = syscall.Errno(0x4e) ENOTBLK = syscall.Errno(0xf) ENOTCAPABLE = syscall.Errno(0x5d) ENOTCONN = syscall.Errno(0x39) ENOTDIR = syscall.Errno(0x14) ENOTEMPTY = syscall.Errno(0x42) ENOTRECOVERABLE = syscall.Errno(0x5f) ENOTSOCK = syscall.Errno(0x26) ENOTSUP = syscall.Errno(0x2d) ENOTTY = syscall.Errno(0x19) ENXIO = syscall.Errno(0x6) EOPNOTSUPP = syscall.Errno(0x2d) EOVERFLOW = syscall.Errno(0x54) EOWNERDEAD = syscall.Errno(0x60) EPERM = syscall.Errno(0x1) EPFNOSUPPORT = syscall.Errno(0x2e) EPIPE = syscall.Errno(0x20) EPROCLIM = syscall.Errno(0x43) EPROCUNAVAIL = syscall.Errno(0x4c) EPROGMISMATCH = syscall.Errno(0x4b) EPROGUNAVAIL = syscall.Errno(0x4a) EPROTO = syscall.Errno(0x5c) EPROTONOSUPPORT = syscall.Errno(0x2b) EPROTOTYPE = syscall.Errno(0x29) ERANGE = syscall.Errno(0x22) EREMOTE = syscall.Errno(0x47) EROFS = syscall.Errno(0x1e) ERPCMISMATCH = syscall.Errno(0x49) ESHUTDOWN = syscall.Errno(0x3a) ESOCKTNOSUPPORT = syscall.Errno(0x2c) ESPIPE = syscall.Errno(0x1d) ESRCH = syscall.Errno(0x3) ESTALE = syscall.Errno(0x46) ETIMEDOUT = syscall.Errno(0x3c) ETOOMANYREFS = syscall.Errno(0x3b) ETXTBSY = syscall.Errno(0x1a) EUSERS = syscall.Errno(0x44) EWOULDBLOCK = syscall.Errno(0x23) EXDEV = syscall.Errno(0x12) ) // Signals const ( SIGABRT = syscall.Signal(0x6) SIGALRM = syscall.Signal(0xe) SIGBUS = syscall.Signal(0xa) SIGCHLD = syscall.Signal(0x14) SIGCONT = syscall.Signal(0x13) SIGEMT = syscall.Signal(0x7) SIGFPE = syscall.Signal(0x8) SIGHUP = syscall.Signal(0x1) SIGILL = syscall.Signal(0x4) SIGINFO = syscall.Signal(0x1d) SIGINT = syscall.Signal(0x2) SIGIO = syscall.Signal(0x17) SIGIOT = syscall.Signal(0x6) SIGKILL = syscall.Signal(0x9) SIGLIBRT = syscall.Signal(0x21) SIGLWP = syscall.Signal(0x20) SIGPIPE = syscall.Signal(0xd) SIGPROF = syscall.Signal(0x1b) SIGQUIT = syscall.Signal(0x3) SIGSEGV = syscall.Signal(0xb) SIGSTOP = syscall.Signal(0x11) SIGSYS = syscall.Signal(0xc) SIGTERM = syscall.Signal(0xf) SIGTHR = syscall.Signal(0x20) SIGTRAP = syscall.Signal(0x5) SIGTSTP = syscall.Signal(0x12) SIGTTIN = syscall.Signal(0x15) SIGTTOU = syscall.Signal(0x16) SIGURG = syscall.Signal(0x10) SIGUSR1 = syscall.Signal(0x1e) SIGUSR2 = syscall.Signal(0x1f) SIGVTALRM = syscall.Signal(0x1a) SIGWINCH = syscall.Signal(0x1c) SIGXCPU = syscall.Signal(0x18) SIGXFSZ = syscall.Signal(0x19) ) // Error table var errorList = [...]struct { num syscall.Errno name string desc string }{ {1, "EPERM", "operation not permitted"}, {2, "ENOENT", "no such file or directory"}, {3, "ESRCH", "no such process"}, {4, "EINTR", "interrupted system call"}, {5, "EIO", "input/output error"}, {6, "ENXIO", "device not configured"}, {7, "E2BIG", "argument list too long"}, {8, "ENOEXEC", "exec format error"}, {9, "EBADF", "bad file descriptor"}, {10, "ECHILD", "no child processes"}, {11, "EDEADLK", "resource deadlock avoided"}, {12, "ENOMEM", "cannot allocate memory"}, {13, "EACCES", "permission denied"}, {14, "EFAULT", "bad address"}, {15, "ENOTBLK", "block device required"}, {16, "EBUSY", "device busy"}, {17, "EEXIST", "file exists"}, {18, "EXDEV", "cross-device link"}, {19, "ENODEV", "operation not supported by device"}, {20, "ENOTDIR", "not a directory"}, {21, "EISDIR", "is a directory"}, {22, "EINVAL", "invalid argument"}, {23, "ENFILE", "too many open files in system"}, {24, "EMFILE", "too many open files"}, {25, "ENOTTY", "inappropriate ioctl for device"}, {26, "ETXTBSY", "text file busy"}, {27, "EFBIG", "file too large"}, {28, "ENOSPC", "no space left on device"}, {29, "ESPIPE", "illegal seek"}, {30, "EROFS", "read-only file system"}, {31, "EMLINK", "too many links"}, {32, "EPIPE", "broken pipe"}, {33, "EDOM", "numerical argument out of domain"}, {34, "ERANGE", "result too large"}, {35, "EWOULDBLOCK", "resource temporarily unavailable"}, {36, "EINPROGRESS", "operation now in progress"}, {37, "EALREADY", "operation already in progress"}, {38, "ENOTSOCK", "socket operation on non-socket"}, {39, "EDESTADDRREQ", "destination address required"}, {40, "EMSGSIZE", "message too long"}, {41, "EPROTOTYPE", "protocol wrong type for socket"}, {42, "ENOPROTOOPT", "protocol not available"}, {43, "EPROTONOSUPPORT", "protocol not supported"}, {44, "ESOCKTNOSUPPORT", "socket type not supported"}, {45, "EOPNOTSUPP", "operation not supported"}, {46, "EPFNOSUPPORT", "protocol family not supported"}, {47, "EAFNOSUPPORT", "address family not supported by protocol family"}, {48, "EADDRINUSE", "address already in use"}, {49, "EADDRNOTAVAIL", "can't assign requested address"}, {50, "ENETDOWN", "network is down"}, {51, "ENETUNREACH", "network is unreachable"}, {52, "ENETRESET", "network dropped connection on reset"}, {53, "ECONNABORTED", "software caused connection abort"}, {54, "ECONNRESET", "connection reset by peer"}, {55, "ENOBUFS", "no buffer space available"}, {56, "EISCONN", "socket is already connected"}, {57, "ENOTCONN", "socket is not connected"}, {58, "ESHUTDOWN", "can't send after socket shutdown"}, {59, "ETOOMANYREFS", "too many references: can't splice"}, {60, "ETIMEDOUT", "operation timed out"}, {61, "ECONNREFUSED", "connection refused"}, {62, "ELOOP", "too many levels of symbolic links"}, {63, "ENAMETOOLONG", "file name too long"}, {64, "EHOSTDOWN", "host is down"}, {65, "EHOSTUNREACH", "no route to host"}, {66, "ENOTEMPTY", "directory not empty"}, {67, "EPROCLIM", "too many processes"}, {68, "EUSERS", "too many users"}, {69, "EDQUOT", "disc quota exceeded"}, {70, "ESTALE", "stale NFS file handle"}, {71, "EREMOTE", "too many levels of remote in path"}, {72, "EBADRPC", "RPC struct is bad"}, {73, "ERPCMISMATCH", "RPC version wrong"}, {74, "EPROGUNAVAIL", "RPC prog. not avail"}, {75, "EPROGMISMATCH", "program version wrong"}, {76, "EPROCUNAVAIL", "bad procedure for program"}, {77, "ENOLCK", "no locks available"}, {78, "ENOSYS", "function not implemented"}, {79, "EFTYPE", "inappropriate file type or format"}, {80, "EAUTH", "authentication error"}, {81, "ENEEDAUTH", "need authenticator"}, {82, "EIDRM", "identifier removed"}, {83, "ENOMSG", "no message of desired type"}, {84, "EOVERFLOW", "value too large to be stored in data type"}, {85, "ECANCELED", "operation canceled"}, {86, "EILSEQ", "illegal byte sequence"}, {87, "ENOATTR", "attribute not found"}, {88, "EDOOFUS", "programming error"}, {89, "EBADMSG", "bad message"}, {90, "EMULTIHOP", "multihop attempted"}, {91, "ENOLINK", "link has been severed"}, {92, "EPROTO", "protocol error"}, {93, "ENOTCAPABLE", "capabilities insufficient"}, {94, "ECAPMODE", "not permitted in capability mode"}, {95, "ENOTRECOVERABLE", "state not recoverable"}, {96, "EOWNERDEAD", "previous owner died"}, {97, "EINTEGRITY", "integrity check failed"}, } // Signal table var signalList = [...]struct { num syscall.Signal name string desc string }{ {1, "SIGHUP", "hangup"}, {2, "SIGINT", "interrupt"}, {3, "SIGQUIT", "quit"}, {4, "SIGILL", "illegal instruction"}, {5, "SIGTRAP", "trace/BPT trap"}, {6, "SIGIOT", "abort trap"}, {7, "SIGEMT", "EMT trap"}, {8, "SIGFPE", "floating point exception"}, {9, "SIGKILL", "killed"}, {10, "SIGBUS", "bus error"}, {11, "SIGSEGV", "segmentation fault"}, {12, "SIGSYS", "bad system call"}, {13, "SIGPIPE", "broken pipe"}, {14, "SIGALRM", "alarm clock"}, {15, "SIGTERM", "terminated"}, {16, "SIGURG", "urgent I/O condition"}, {17, "SIGSTOP", "suspended (signal)"}, {18, "SIGTSTP", "suspended"}, {19, "SIGCONT", "continued"}, {20, "SIGCHLD", "child exited"}, {21, "SIGTTIN", "stopped (tty input)"}, {22, "SIGTTOU", "stopped (tty output)"}, {23, "SIGIO", "I/O possible"}, {24, "SIGXCPU", "cputime limit exceeded"}, {25, "SIGXFSZ", "filesize limit exceeded"}, {26, "SIGVTALRM", "virtual timer expired"}, {27, "SIGPROF", "profiling timer expired"}, {28, "SIGWINCH", "window size changes"}, {29, "SIGINFO", "information request"}, {30, "SIGUSR1", "user defined signal 1"}, {31, "SIGUSR2", "user defined signal 2"}, {32, "SIGTHR", "unknown signal"}, {33, "SIGLIBRT", "unknown signal"}, } ================================================ FILE: vendor/golang.org/x/sys/unix/zerrors_freebsd_arm64.go ================================================ // mkerrors.sh -m64 // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm64 && freebsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -m64 _const.go package unix import "syscall" const ( AF_APPLETALK = 0x10 AF_ARP = 0x23 AF_ATM = 0x1e AF_BLUETOOTH = 0x24 AF_CCITT = 0xa AF_CHAOS = 0x5 AF_CNT = 0x15 AF_COIP = 0x14 AF_DATAKIT = 0x9 AF_DECnet = 0xc AF_DLI = 0xd AF_E164 = 0x1a AF_ECMA = 0x8 AF_HYLINK = 0xf AF_IEEE80211 = 0x25 AF_IMPLINK = 0x3 AF_INET = 0x2 AF_INET6 = 0x1c AF_INET6_SDP = 0x2a AF_INET_SDP = 0x28 AF_IPX = 0x17 AF_ISDN = 0x1a AF_ISO = 0x7 AF_LAT = 0xe AF_LINK = 0x12 AF_LOCAL = 0x1 AF_MAX = 0x2a AF_NATM = 0x1d AF_NETBIOS = 0x6 AF_NETGRAPH = 0x20 AF_OSI = 0x7 AF_PUP = 0x4 AF_ROUTE = 0x11 AF_SCLUSTER = 0x22 AF_SIP = 0x18 AF_SLOW = 0x21 AF_SNA = 0xb AF_UNIX = 0x1 AF_UNSPEC = 0x0 AF_VENDOR00 = 0x27 AF_VENDOR01 = 0x29 AF_VENDOR02 = 0x2b AF_VENDOR03 = 0x2d AF_VENDOR04 = 0x2f AF_VENDOR05 = 0x31 AF_VENDOR06 = 0x33 AF_VENDOR07 = 0x35 AF_VENDOR08 = 0x37 AF_VENDOR09 = 0x39 AF_VENDOR10 = 0x3b AF_VENDOR11 = 0x3d AF_VENDOR12 = 0x3f AF_VENDOR13 = 0x41 AF_VENDOR14 = 0x43 AF_VENDOR15 = 0x45 AF_VENDOR16 = 0x47 AF_VENDOR17 = 0x49 AF_VENDOR18 = 0x4b AF_VENDOR19 = 0x4d AF_VENDOR20 = 0x4f AF_VENDOR21 = 0x51 AF_VENDOR22 = 0x53 AF_VENDOR23 = 0x55 AF_VENDOR24 = 0x57 AF_VENDOR25 = 0x59 AF_VENDOR26 = 0x5b AF_VENDOR27 = 0x5d AF_VENDOR28 = 0x5f AF_VENDOR29 = 0x61 AF_VENDOR30 = 0x63 AF_VENDOR31 = 0x65 AF_VENDOR32 = 0x67 AF_VENDOR33 = 0x69 AF_VENDOR34 = 0x6b AF_VENDOR35 = 0x6d AF_VENDOR36 = 0x6f AF_VENDOR37 = 0x71 AF_VENDOR38 = 0x73 AF_VENDOR39 = 0x75 AF_VENDOR40 = 0x77 AF_VENDOR41 = 0x79 AF_VENDOR42 = 0x7b AF_VENDOR43 = 0x7d AF_VENDOR44 = 0x7f AF_VENDOR45 = 0x81 AF_VENDOR46 = 0x83 AF_VENDOR47 = 0x85 ALTWERASE = 0x200 B0 = 0x0 B110 = 0x6e B115200 = 0x1c200 B1200 = 0x4b0 B134 = 0x86 B14400 = 0x3840 B150 = 0x96 B1800 = 0x708 B19200 = 0x4b00 B200 = 0xc8 B230400 = 0x38400 B2400 = 0x960 B28800 = 0x7080 B300 = 0x12c B38400 = 0x9600 B460800 = 0x70800 B4800 = 0x12c0 B50 = 0x32 B57600 = 0xe100 B600 = 0x258 B7200 = 0x1c20 B75 = 0x4b B76800 = 0x12c00 B921600 = 0xe1000 B9600 = 0x2580 BIOCFEEDBACK = 0x8004427c BIOCFLUSH = 0x20004268 BIOCGBLEN = 0x40044266 BIOCGDIRECTION = 0x40044276 BIOCGDLT = 0x4004426a BIOCGDLTLIST = 0xc0104279 BIOCGETBUFMODE = 0x4004427d BIOCGETIF = 0x4020426b BIOCGETZMAX = 0x4008427f BIOCGHDRCMPLT = 0x40044274 BIOCGRSIG = 0x40044272 BIOCGRTIMEOUT = 0x4010426e BIOCGSEESENT = 0x40044276 BIOCGSTATS = 0x4008426f BIOCGTSTAMP = 0x40044283 BIOCIMMEDIATE = 0x80044270 BIOCLOCK = 0x2000427a BIOCPROMISC = 0x20004269 BIOCROTZBUF = 0x40184280 BIOCSBLEN = 0xc0044266 BIOCSDIRECTION = 0x80044277 BIOCSDLT = 0x80044278 BIOCSETBUFMODE = 0x8004427e BIOCSETF = 0x80104267 BIOCSETFNR = 0x80104282 BIOCSETIF = 0x8020426c BIOCSETVLANPCP = 0x80044285 BIOCSETWF = 0x8010427b BIOCSETZBUF = 0x80184281 BIOCSHDRCMPLT = 0x80044275 BIOCSRSIG = 0x80044273 BIOCSRTIMEOUT = 0x8010426d BIOCSSEESENT = 0x80044277 BIOCSTSTAMP = 0x80044284 BIOCVERSION = 0x40044271 BPF_A = 0x10 BPF_ABS = 0x20 BPF_ADD = 0x0 BPF_ALIGNMENT = 0x8 BPF_ALU = 0x4 BPF_AND = 0x50 BPF_B = 0x10 BPF_BUFMODE_BUFFER = 0x1 BPF_BUFMODE_ZBUF = 0x2 BPF_DIV = 0x30 BPF_H = 0x8 BPF_IMM = 0x0 BPF_IND = 0x40 BPF_JA = 0x0 BPF_JEQ = 0x10 BPF_JGE = 0x30 BPF_JGT = 0x20 BPF_JMP = 0x5 BPF_JSET = 0x40 BPF_K = 0x0 BPF_LD = 0x0 BPF_LDX = 0x1 BPF_LEN = 0x80 BPF_LSH = 0x60 BPF_MAJOR_VERSION = 0x1 BPF_MAXBUFSIZE = 0x80000 BPF_MAXINSNS = 0x200 BPF_MEM = 0x60 BPF_MEMWORDS = 0x10 BPF_MINBUFSIZE = 0x20 BPF_MINOR_VERSION = 0x1 BPF_MISC = 0x7 BPF_MOD = 0x90 BPF_MSH = 0xa0 BPF_MUL = 0x20 BPF_NEG = 0x80 BPF_OR = 0x40 BPF_RELEASE = 0x30bb6 BPF_RET = 0x6 BPF_RSH = 0x70 BPF_ST = 0x2 BPF_STX = 0x3 BPF_SUB = 0x10 BPF_TAX = 0x0 BPF_TXA = 0x80 BPF_T_BINTIME = 0x2 BPF_T_BINTIME_FAST = 0x102 BPF_T_BINTIME_MONOTONIC = 0x202 BPF_T_BINTIME_MONOTONIC_FAST = 0x302 BPF_T_FAST = 0x100 BPF_T_FLAG_MASK = 0x300 BPF_T_FORMAT_MASK = 0x3 BPF_T_MICROTIME = 0x0 BPF_T_MICROTIME_FAST = 0x100 BPF_T_MICROTIME_MONOTONIC = 0x200 BPF_T_MICROTIME_MONOTONIC_FAST = 0x300 BPF_T_MONOTONIC = 0x200 BPF_T_MONOTONIC_FAST = 0x300 BPF_T_NANOTIME = 0x1 BPF_T_NANOTIME_FAST = 0x101 BPF_T_NANOTIME_MONOTONIC = 0x201 BPF_T_NANOTIME_MONOTONIC_FAST = 0x301 BPF_T_NONE = 0x3 BPF_T_NORMAL = 0x0 BPF_W = 0x0 BPF_X = 0x8 BPF_XOR = 0xa0 BRKINT = 0x2 CAP_ACCEPT = 0x200000020000000 CAP_ACL_CHECK = 0x400000000010000 CAP_ACL_DELETE = 0x400000000020000 CAP_ACL_GET = 0x400000000040000 CAP_ACL_SET = 0x400000000080000 CAP_ALL0 = 0x20007ffffffffff CAP_ALL1 = 0x4000000001fffff CAP_BIND = 0x200000040000000 CAP_BINDAT = 0x200008000000400 CAP_CHFLAGSAT = 0x200000000001400 CAP_CONNECT = 0x200000080000000 CAP_CONNECTAT = 0x200010000000400 CAP_CREATE = 0x200000000000040 CAP_EVENT = 0x400000000000020 CAP_EXTATTR_DELETE = 0x400000000001000 CAP_EXTATTR_GET = 0x400000000002000 CAP_EXTATTR_LIST = 0x400000000004000 CAP_EXTATTR_SET = 0x400000000008000 CAP_FCHDIR = 0x200000000000800 CAP_FCHFLAGS = 0x200000000001000 CAP_FCHMOD = 0x200000000002000 CAP_FCHMODAT = 0x200000000002400 CAP_FCHOWN = 0x200000000004000 CAP_FCHOWNAT = 0x200000000004400 CAP_FCNTL = 0x200000000008000 CAP_FCNTL_ALL = 0x78 CAP_FCNTL_GETFL = 0x8 CAP_FCNTL_GETOWN = 0x20 CAP_FCNTL_SETFL = 0x10 CAP_FCNTL_SETOWN = 0x40 CAP_FEXECVE = 0x200000000000080 CAP_FLOCK = 0x200000000010000 CAP_FPATHCONF = 0x200000000020000 CAP_FSCK = 0x200000000040000 CAP_FSTAT = 0x200000000080000 CAP_FSTATAT = 0x200000000080400 CAP_FSTATFS = 0x200000000100000 CAP_FSYNC = 0x200000000000100 CAP_FTRUNCATE = 0x200000000000200 CAP_FUTIMES = 0x200000000200000 CAP_FUTIMESAT = 0x200000000200400 CAP_GETPEERNAME = 0x200000100000000 CAP_GETSOCKNAME = 0x200000200000000 CAP_GETSOCKOPT = 0x200000400000000 CAP_IOCTL = 0x400000000000080 CAP_IOCTLS_ALL = 0x7fffffffffffffff CAP_KQUEUE = 0x400000000100040 CAP_KQUEUE_CHANGE = 0x400000000100000 CAP_KQUEUE_EVENT = 0x400000000000040 CAP_LINKAT_SOURCE = 0x200020000000400 CAP_LINKAT_TARGET = 0x200000000400400 CAP_LISTEN = 0x200000800000000 CAP_LOOKUP = 0x200000000000400 CAP_MAC_GET = 0x400000000000001 CAP_MAC_SET = 0x400000000000002 CAP_MKDIRAT = 0x200000000800400 CAP_MKFIFOAT = 0x200000001000400 CAP_MKNODAT = 0x200000002000400 CAP_MMAP = 0x200000000000010 CAP_MMAP_R = 0x20000000000001d CAP_MMAP_RW = 0x20000000000001f CAP_MMAP_RWX = 0x20000000000003f CAP_MMAP_RX = 0x20000000000003d CAP_MMAP_W = 0x20000000000001e CAP_MMAP_WX = 0x20000000000003e CAP_MMAP_X = 0x20000000000003c CAP_PDGETPID = 0x400000000000200 CAP_PDKILL = 0x400000000000800 CAP_PDWAIT = 0x400000000000400 CAP_PEELOFF = 0x200001000000000 CAP_POLL_EVENT = 0x400000000000020 CAP_PREAD = 0x20000000000000d CAP_PWRITE = 0x20000000000000e CAP_READ = 0x200000000000001 CAP_RECV = 0x200000000000001 CAP_RENAMEAT_SOURCE = 0x200000004000400 CAP_RENAMEAT_TARGET = 0x200040000000400 CAP_RIGHTS_VERSION = 0x0 CAP_RIGHTS_VERSION_00 = 0x0 CAP_SEEK = 0x20000000000000c CAP_SEEK_TELL = 0x200000000000004 CAP_SEM_GETVALUE = 0x400000000000004 CAP_SEM_POST = 0x400000000000008 CAP_SEM_WAIT = 0x400000000000010 CAP_SEND = 0x200000000000002 CAP_SETSOCKOPT = 0x200002000000000 CAP_SHUTDOWN = 0x200004000000000 CAP_SOCK_CLIENT = 0x200007780000003 CAP_SOCK_SERVER = 0x200007f60000003 CAP_SYMLINKAT = 0x200000008000400 CAP_TTYHOOK = 0x400000000000100 CAP_UNLINKAT = 0x200000010000400 CAP_UNUSED0_44 = 0x200080000000000 CAP_UNUSED0_57 = 0x300000000000000 CAP_UNUSED1_22 = 0x400000000200000 CAP_UNUSED1_57 = 0x500000000000000 CAP_WRITE = 0x200000000000002 CFLUSH = 0xf CLOCAL = 0x8000 CLOCK_MONOTONIC = 0x4 CLOCK_MONOTONIC_FAST = 0xc CLOCK_MONOTONIC_PRECISE = 0xb CLOCK_PROCESS_CPUTIME_ID = 0xf CLOCK_PROF = 0x2 CLOCK_REALTIME = 0x0 CLOCK_REALTIME_FAST = 0xa CLOCK_REALTIME_PRECISE = 0x9 CLOCK_SECOND = 0xd CLOCK_THREAD_CPUTIME_ID = 0xe CLOCK_UPTIME = 0x5 CLOCK_UPTIME_FAST = 0x8 CLOCK_UPTIME_PRECISE = 0x7 CLOCK_VIRTUAL = 0x1 CPUSTATES = 0x5 CP_IDLE = 0x4 CP_INTR = 0x3 CP_NICE = 0x1 CP_SYS = 0x2 CP_USER = 0x0 CREAD = 0x800 CRTSCTS = 0x30000 CS5 = 0x0 CS6 = 0x100 CS7 = 0x200 CS8 = 0x300 CSIZE = 0x300 CSTART = 0x11 CSTATUS = 0x14 CSTOP = 0x13 CSTOPB = 0x400 CSUSP = 0x1a CTL_HW = 0x6 CTL_KERN = 0x1 CTL_MAXNAME = 0x18 CTL_NET = 0x4 DIOCGATTR = 0xc148648e DIOCGDELETE = 0x80106488 DIOCGFLUSH = 0x20006487 DIOCGFRONTSTUFF = 0x40086486 DIOCGFWHEADS = 0x40046483 DIOCGFWSECTORS = 0x40046482 DIOCGIDENT = 0x41006489 DIOCGMEDIASIZE = 0x40086481 DIOCGPHYSPATH = 0x4400648d DIOCGPROVIDERNAME = 0x4400648a DIOCGSECTORSIZE = 0x40046480 DIOCGSTRIPEOFFSET = 0x4008648c DIOCGSTRIPESIZE = 0x4008648b DIOCSKERNELDUMP = 0x80506490 DIOCSKERNELDUMP_FREEBSD11 = 0x80046485 DIOCZONECMD = 0xc080648f DLT_A429 = 0xb8 DLT_A653_ICM = 0xb9 DLT_AIRONET_HEADER = 0x78 DLT_AOS = 0xde DLT_APPLE_IP_OVER_IEEE1394 = 0x8a DLT_ARCNET = 0x7 DLT_ARCNET_LINUX = 0x81 DLT_ATM_CLIP = 0x13 DLT_ATM_RFC1483 = 0xb DLT_AURORA = 0x7e DLT_AX25 = 0x3 DLT_AX25_KISS = 0xca DLT_BACNET_MS_TP = 0xa5 DLT_BLUETOOTH_BREDR_BB = 0xff DLT_BLUETOOTH_HCI_H4 = 0xbb DLT_BLUETOOTH_HCI_H4_WITH_PHDR = 0xc9 DLT_BLUETOOTH_LE_LL = 0xfb DLT_BLUETOOTH_LE_LL_WITH_PHDR = 0x100 DLT_BLUETOOTH_LINUX_MONITOR = 0xfe DLT_CAN20B = 0xbe DLT_CAN_SOCKETCAN = 0xe3 DLT_CHAOS = 0x5 DLT_CHDLC = 0x68 DLT_CISCO_IOS = 0x76 DLT_CLASS_NETBSD_RAWAF = 0x2240000 DLT_C_HDLC = 0x68 DLT_C_HDLC_WITH_DIR = 0xcd DLT_DBUS = 0xe7 DLT_DECT = 0xdd DLT_DISPLAYPORT_AUX = 0x113 DLT_DOCSIS = 0x8f DLT_DOCSIS31_XRA31 = 0x111 DLT_DVB_CI = 0xeb DLT_ECONET = 0x73 DLT_EN10MB = 0x1 DLT_EN3MB = 0x2 DLT_ENC = 0x6d DLT_EPON = 0x103 DLT_ERF = 0xc5 DLT_ERF_ETH = 0xaf DLT_ERF_POS = 0xb0 DLT_ETHERNET_MPACKET = 0x112 DLT_FC_2 = 0xe0 DLT_FC_2_WITH_FRAME_DELIMS = 0xe1 DLT_FDDI = 0xa DLT_FLEXRAY = 0xd2 DLT_FRELAY = 0x6b DLT_FRELAY_WITH_DIR = 0xce DLT_GCOM_SERIAL = 0xad DLT_GCOM_T1E1 = 0xac DLT_GPF_F = 0xab DLT_GPF_T = 0xaa DLT_GPRS_LLC = 0xa9 DLT_GSMTAP_ABIS = 0xda DLT_GSMTAP_UM = 0xd9 DLT_IBM_SN = 0x92 DLT_IBM_SP = 0x91 DLT_IEEE802 = 0x6 DLT_IEEE802_11 = 0x69 DLT_IEEE802_11_RADIO = 0x7f DLT_IEEE802_11_RADIO_AVS = 0xa3 DLT_IEEE802_15_4 = 0xc3 DLT_IEEE802_15_4_LINUX = 0xbf DLT_IEEE802_15_4_NOFCS = 0xe6 DLT_IEEE802_15_4_NONASK_PHY = 0xd7 DLT_IEEE802_16_MAC_CPS = 0xbc DLT_IEEE802_16_MAC_CPS_RADIO = 0xc1 DLT_INFINIBAND = 0xf7 DLT_IPFILTER = 0x74 DLT_IPMB_KONTRON = 0xc7 DLT_IPMB_LINUX = 0xd1 DLT_IPMI_HPM_2 = 0x104 DLT_IPNET = 0xe2 DLT_IPOIB = 0xf2 DLT_IPV4 = 0xe4 DLT_IPV6 = 0xe5 DLT_IP_OVER_FC = 0x7a DLT_ISO_14443 = 0x108 DLT_JUNIPER_ATM1 = 0x89 DLT_JUNIPER_ATM2 = 0x87 DLT_JUNIPER_ATM_CEMIC = 0xee DLT_JUNIPER_CHDLC = 0xb5 DLT_JUNIPER_ES = 0x84 DLT_JUNIPER_ETHER = 0xb2 DLT_JUNIPER_FIBRECHANNEL = 0xea DLT_JUNIPER_FRELAY = 0xb4 DLT_JUNIPER_GGSN = 0x85 DLT_JUNIPER_ISM = 0xc2 DLT_JUNIPER_MFR = 0x86 DLT_JUNIPER_MLFR = 0x83 DLT_JUNIPER_MLPPP = 0x82 DLT_JUNIPER_MONITOR = 0xa4 DLT_JUNIPER_PIC_PEER = 0xae DLT_JUNIPER_PPP = 0xb3 DLT_JUNIPER_PPPOE = 0xa7 DLT_JUNIPER_PPPOE_ATM = 0xa8 DLT_JUNIPER_SERVICES = 0x88 DLT_JUNIPER_SRX_E2E = 0xe9 DLT_JUNIPER_ST = 0xc8 DLT_JUNIPER_VP = 0xb7 DLT_JUNIPER_VS = 0xe8 DLT_LAPB_WITH_DIR = 0xcf DLT_LAPD = 0xcb DLT_LIN = 0xd4 DLT_LINUX_EVDEV = 0xd8 DLT_LINUX_IRDA = 0x90 DLT_LINUX_LAPD = 0xb1 DLT_LINUX_PPP_WITHDIRECTION = 0xa6 DLT_LINUX_SLL = 0x71 DLT_LINUX_SLL2 = 0x114 DLT_LOOP = 0x6c DLT_LORATAP = 0x10e DLT_LTALK = 0x72 DLT_MATCHING_MAX = 0x114 DLT_MATCHING_MIN = 0x68 DLT_MFR = 0xb6 DLT_MOST = 0xd3 DLT_MPEG_2_TS = 0xf3 DLT_MPLS = 0xdb DLT_MTP2 = 0x8c DLT_MTP2_WITH_PHDR = 0x8b DLT_MTP3 = 0x8d DLT_MUX27010 = 0xec DLT_NETANALYZER = 0xf0 DLT_NETANALYZER_TRANSPARENT = 0xf1 DLT_NETLINK = 0xfd DLT_NFC_LLCP = 0xf5 DLT_NFLOG = 0xef DLT_NG40 = 0xf4 DLT_NORDIC_BLE = 0x110 DLT_NULL = 0x0 DLT_OPENFLOW = 0x10b DLT_PCI_EXP = 0x7d DLT_PFLOG = 0x75 DLT_PFSYNC = 0x79 DLT_PKTAP = 0x102 DLT_PPI = 0xc0 DLT_PPP = 0x9 DLT_PPP_BSDOS = 0xe DLT_PPP_ETHER = 0x33 DLT_PPP_PPPD = 0xa6 DLT_PPP_SERIAL = 0x32 DLT_PPP_WITH_DIR = 0xcc DLT_PPP_WITH_DIRECTION = 0xa6 DLT_PRISM_HEADER = 0x77 DLT_PROFIBUS_DL = 0x101 DLT_PRONET = 0x4 DLT_RAIF1 = 0xc6 DLT_RAW = 0xc DLT_RDS = 0x109 DLT_REDBACK_SMARTEDGE = 0x20 DLT_RIO = 0x7c DLT_RTAC_SERIAL = 0xfa DLT_SCCP = 0x8e DLT_SCTP = 0xf8 DLT_SDLC = 0x10c DLT_SITA = 0xc4 DLT_SLIP = 0x8 DLT_SLIP_BSDOS = 0xd DLT_STANAG_5066_D_PDU = 0xed DLT_SUNATM = 0x7b DLT_SYMANTEC_FIREWALL = 0x63 DLT_TI_LLN_SNIFFER = 0x10d DLT_TZSP = 0x80 DLT_USB = 0xba DLT_USBPCAP = 0xf9 DLT_USB_DARWIN = 0x10a DLT_USB_FREEBSD = 0xba DLT_USB_LINUX = 0xbd DLT_USB_LINUX_MMAPPED = 0xdc DLT_USER0 = 0x93 DLT_USER1 = 0x94 DLT_USER10 = 0x9d DLT_USER11 = 0x9e DLT_USER12 = 0x9f DLT_USER13 = 0xa0 DLT_USER14 = 0xa1 DLT_USER15 = 0xa2 DLT_USER2 = 0x95 DLT_USER3 = 0x96 DLT_USER4 = 0x97 DLT_USER5 = 0x98 DLT_USER6 = 0x99 DLT_USER7 = 0x9a DLT_USER8 = 0x9b DLT_USER9 = 0x9c DLT_VSOCK = 0x10f DLT_WATTSTOPPER_DLM = 0x107 DLT_WIHART = 0xdf DLT_WIRESHARK_UPPER_PDU = 0xfc DLT_X2E_SERIAL = 0xd5 DLT_X2E_XORAYA = 0xd6 DLT_ZWAVE_R1_R2 = 0x105 DLT_ZWAVE_R3 = 0x106 DT_BLK = 0x6 DT_CHR = 0x2 DT_DIR = 0x4 DT_FIFO = 0x1 DT_LNK = 0xa DT_REG = 0x8 DT_SOCK = 0xc DT_UNKNOWN = 0x0 DT_WHT = 0xe ECHO = 0x8 ECHOCTL = 0x40 ECHOE = 0x2 ECHOK = 0x4 ECHOKE = 0x1 ECHONL = 0x10 ECHOPRT = 0x20 EVFILT_AIO = -0x3 EVFILT_EMPTY = -0xd EVFILT_FS = -0x9 EVFILT_LIO = -0xa EVFILT_PROC = -0x5 EVFILT_PROCDESC = -0x8 EVFILT_READ = -0x1 EVFILT_SENDFILE = -0xc EVFILT_SIGNAL = -0x6 EVFILT_SYSCOUNT = 0xd EVFILT_TIMER = -0x7 EVFILT_USER = -0xb EVFILT_VNODE = -0x4 EVFILT_WRITE = -0x2 EVNAMEMAP_NAME_SIZE = 0x40 EV_ADD = 0x1 EV_CLEAR = 0x20 EV_DELETE = 0x2 EV_DISABLE = 0x8 EV_DISPATCH = 0x80 EV_DROP = 0x1000 EV_ENABLE = 0x4 EV_EOF = 0x8000 EV_ERROR = 0x4000 EV_FLAG1 = 0x2000 EV_FLAG2 = 0x4000 EV_FORCEONESHOT = 0x100 EV_ONESHOT = 0x10 EV_RECEIPT = 0x40 EV_SYSFLAGS = 0xf000 EXTA = 0x4b00 EXTATTR_MAXNAMELEN = 0xff EXTATTR_NAMESPACE_EMPTY = 0x0 EXTATTR_NAMESPACE_SYSTEM = 0x2 EXTATTR_NAMESPACE_USER = 0x1 EXTB = 0x9600 EXTPROC = 0x800 FD_CLOEXEC = 0x1 FD_SETSIZE = 0x400 FLUSHO = 0x800000 F_CANCEL = 0x5 F_DUP2FD = 0xa F_DUP2FD_CLOEXEC = 0x12 F_DUPFD = 0x0 F_DUPFD_CLOEXEC = 0x11 F_GETFD = 0x1 F_GETFL = 0x3 F_GETLK = 0xb F_GETOWN = 0x5 F_OGETLK = 0x7 F_OK = 0x0 F_OSETLK = 0x8 F_OSETLKW = 0x9 F_RDAHEAD = 0x10 F_RDLCK = 0x1 F_READAHEAD = 0xf F_SETFD = 0x2 F_SETFL = 0x4 F_SETLK = 0xc F_SETLKW = 0xd F_SETLK_REMOTE = 0xe F_SETOWN = 0x6 F_UNLCK = 0x2 F_UNLCKSYS = 0x4 F_WRLCK = 0x3 HUPCL = 0x4000 HW_MACHINE = 0x1 ICANON = 0x100 ICMP6_FILTER = 0x12 ICRNL = 0x100 IEXTEN = 0x400 IFAN_ARRIVAL = 0x0 IFAN_DEPARTURE = 0x1 IFCAP_WOL_MAGIC = 0x2000 IFF_ALLMULTI = 0x200 IFF_ALTPHYS = 0x4000 IFF_BROADCAST = 0x2 IFF_CANTCHANGE = 0x218f52 IFF_CANTCONFIG = 0x10000 IFF_DEBUG = 0x4 IFF_DRV_OACTIVE = 0x400 IFF_DRV_RUNNING = 0x40 IFF_DYING = 0x200000 IFF_LINK0 = 0x1000 IFF_LINK1 = 0x2000 IFF_LINK2 = 0x4000 IFF_LOOPBACK = 0x8 IFF_MONITOR = 0x40000 IFF_MULTICAST = 0x8000 IFF_NOARP = 0x80 IFF_NOGROUP = 0x800000 IFF_OACTIVE = 0x400 IFF_POINTOPOINT = 0x10 IFF_PPROMISC = 0x20000 IFF_PROMISC = 0x100 IFF_RENAMING = 0x400000 IFF_RUNNING = 0x40 IFF_SIMPLEX = 0x800 IFF_STATICARP = 0x80000 IFF_UP = 0x1 IFNAMSIZ = 0x10 IFT_BRIDGE = 0xd1 IFT_CARP = 0xf8 IFT_IEEE1394 = 0x90 IFT_INFINIBAND = 0xc7 IFT_L2VLAN = 0x87 IFT_L3IPVLAN = 0x88 IFT_PPP = 0x17 IFT_PROPVIRTUAL = 0x35 IGNBRK = 0x1 IGNCR = 0x80 IGNPAR = 0x4 IMAXBEL = 0x2000 INLCR = 0x40 INPCK = 0x10 IN_CLASSA_HOST = 0xffffff IN_CLASSA_MAX = 0x80 IN_CLASSA_NET = 0xff000000 IN_CLASSA_NSHIFT = 0x18 IN_CLASSB_HOST = 0xffff IN_CLASSB_MAX = 0x10000 IN_CLASSB_NET = 0xffff0000 IN_CLASSB_NSHIFT = 0x10 IN_CLASSC_HOST = 0xff IN_CLASSC_NET = 0xffffff00 IN_CLASSC_NSHIFT = 0x8 IN_CLASSD_HOST = 0xfffffff IN_CLASSD_NET = 0xf0000000 IN_CLASSD_NSHIFT = 0x1c IN_LOOPBACKNET = 0x7f IN_RFC3021_MASK = 0xfffffffe IPPROTO_3PC = 0x22 IPPROTO_ADFS = 0x44 IPPROTO_AH = 0x33 IPPROTO_AHIP = 0x3d IPPROTO_APES = 0x63 IPPROTO_ARGUS = 0xd IPPROTO_AX25 = 0x5d IPPROTO_BHA = 0x31 IPPROTO_BLT = 0x1e IPPROTO_BRSATMON = 0x4c IPPROTO_CARP = 0x70 IPPROTO_CFTP = 0x3e IPPROTO_CHAOS = 0x10 IPPROTO_CMTP = 0x26 IPPROTO_CPHB = 0x49 IPPROTO_CPNX = 0x48 IPPROTO_DCCP = 0x21 IPPROTO_DDP = 0x25 IPPROTO_DGP = 0x56 IPPROTO_DIVERT = 0x102 IPPROTO_DONE = 0x101 IPPROTO_DSTOPTS = 0x3c IPPROTO_EGP = 0x8 IPPROTO_EMCON = 0xe IPPROTO_ENCAP = 0x62 IPPROTO_EON = 0x50 IPPROTO_ESP = 0x32 IPPROTO_ETHERIP = 0x61 IPPROTO_FRAGMENT = 0x2c IPPROTO_GGP = 0x3 IPPROTO_GMTP = 0x64 IPPROTO_GRE = 0x2f IPPROTO_HELLO = 0x3f IPPROTO_HIP = 0x8b IPPROTO_HMP = 0x14 IPPROTO_HOPOPTS = 0x0 IPPROTO_ICMP = 0x1 IPPROTO_ICMPV6 = 0x3a IPPROTO_IDP = 0x16 IPPROTO_IDPR = 0x23 IPPROTO_IDRP = 0x2d IPPROTO_IGMP = 0x2 IPPROTO_IGP = 0x55 IPPROTO_IGRP = 0x58 IPPROTO_IL = 0x28 IPPROTO_INLSP = 0x34 IPPROTO_INP = 0x20 IPPROTO_IP = 0x0 IPPROTO_IPCOMP = 0x6c IPPROTO_IPCV = 0x47 IPPROTO_IPEIP = 0x5e IPPROTO_IPIP = 0x4 IPPROTO_IPPC = 0x43 IPPROTO_IPV4 = 0x4 IPPROTO_IPV6 = 0x29 IPPROTO_IRTP = 0x1c IPPROTO_KRYPTOLAN = 0x41 IPPROTO_LARP = 0x5b IPPROTO_LEAF1 = 0x19 IPPROTO_LEAF2 = 0x1a IPPROTO_MAX = 0x100 IPPROTO_MEAS = 0x13 IPPROTO_MH = 0x87 IPPROTO_MHRP = 0x30 IPPROTO_MICP = 0x5f IPPROTO_MOBILE = 0x37 IPPROTO_MPLS = 0x89 IPPROTO_MTP = 0x5c IPPROTO_MUX = 0x12 IPPROTO_ND = 0x4d IPPROTO_NHRP = 0x36 IPPROTO_NONE = 0x3b IPPROTO_NSP = 0x1f IPPROTO_NVPII = 0xb IPPROTO_OLD_DIVERT = 0xfe IPPROTO_OSPFIGP = 0x59 IPPROTO_PFSYNC = 0xf0 IPPROTO_PGM = 0x71 IPPROTO_PIGP = 0x9 IPPROTO_PIM = 0x67 IPPROTO_PRM = 0x15 IPPROTO_PUP = 0xc IPPROTO_PVP = 0x4b IPPROTO_RAW = 0xff IPPROTO_RCCMON = 0xa IPPROTO_RDP = 0x1b IPPROTO_RESERVED_253 = 0xfd IPPROTO_RESERVED_254 = 0xfe IPPROTO_ROUTING = 0x2b IPPROTO_RSVP = 0x2e IPPROTO_RVD = 0x42 IPPROTO_SATEXPAK = 0x40 IPPROTO_SATMON = 0x45 IPPROTO_SCCSP = 0x60 IPPROTO_SCTP = 0x84 IPPROTO_SDRP = 0x2a IPPROTO_SEND = 0x103 IPPROTO_SHIM6 = 0x8c IPPROTO_SKIP = 0x39 IPPROTO_SPACER = 0x7fff IPPROTO_SRPC = 0x5a IPPROTO_ST = 0x7 IPPROTO_SVMTP = 0x52 IPPROTO_SWIPE = 0x35 IPPROTO_TCF = 0x57 IPPROTO_TCP = 0x6 IPPROTO_TLSP = 0x38 IPPROTO_TP = 0x1d IPPROTO_TPXX = 0x27 IPPROTO_TRUNK1 = 0x17 IPPROTO_TRUNK2 = 0x18 IPPROTO_TTP = 0x54 IPPROTO_UDP = 0x11 IPPROTO_UDPLITE = 0x88 IPPROTO_VINES = 0x53 IPPROTO_VISA = 0x46 IPPROTO_VMTP = 0x51 IPPROTO_WBEXPAK = 0x4f IPPROTO_WBMON = 0x4e IPPROTO_WSN = 0x4a IPPROTO_XNET = 0xf IPPROTO_XTP = 0x24 IPV6_AUTOFLOWLABEL = 0x3b IPV6_BINDANY = 0x40 IPV6_BINDMULTI = 0x41 IPV6_BINDV6ONLY = 0x1b IPV6_CHECKSUM = 0x1a IPV6_DEFAULT_MULTICAST_HOPS = 0x1 IPV6_DEFAULT_MULTICAST_LOOP = 0x1 IPV6_DEFHLIM = 0x40 IPV6_DONTFRAG = 0x3e IPV6_DSTOPTS = 0x32 IPV6_FLOWID = 0x43 IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_LEN = 0x14 IPV6_FLOWLABEL_MASK = 0xffff0f00 IPV6_FLOWTYPE = 0x44 IPV6_FRAGTTL = 0x78 IPV6_FW_ADD = 0x1e IPV6_FW_DEL = 0x1f IPV6_FW_FLUSH = 0x20 IPV6_FW_GET = 0x22 IPV6_FW_ZERO = 0x21 IPV6_HLIMDEC = 0x1 IPV6_HOPLIMIT = 0x2f IPV6_HOPOPTS = 0x31 IPV6_IPSEC_POLICY = 0x1c IPV6_JOIN_GROUP = 0xc IPV6_LEAVE_GROUP = 0xd IPV6_MAXHLIM = 0xff IPV6_MAXOPTHDR = 0x800 IPV6_MAXPACKET = 0xffff IPV6_MAX_GROUP_SRC_FILTER = 0x200 IPV6_MAX_MEMBERSHIPS = 0xfff IPV6_MAX_SOCK_SRC_FILTER = 0x80 IPV6_MMTU = 0x500 IPV6_MSFILTER = 0x4a IPV6_MULTICAST_HOPS = 0xa IPV6_MULTICAST_IF = 0x9 IPV6_MULTICAST_LOOP = 0xb IPV6_NEXTHOP = 0x30 IPV6_ORIGDSTADDR = 0x48 IPV6_PATHMTU = 0x2c IPV6_PKTINFO = 0x2e IPV6_PORTRANGE = 0xe IPV6_PORTRANGE_DEFAULT = 0x0 IPV6_PORTRANGE_HIGH = 0x1 IPV6_PORTRANGE_LOW = 0x2 IPV6_PREFER_TEMPADDR = 0x3f IPV6_RECVDSTOPTS = 0x28 IPV6_RECVFLOWID = 0x46 IPV6_RECVHOPLIMIT = 0x25 IPV6_RECVHOPOPTS = 0x27 IPV6_RECVORIGDSTADDR = 0x48 IPV6_RECVPATHMTU = 0x2b IPV6_RECVPKTINFO = 0x24 IPV6_RECVRSSBUCKETID = 0x47 IPV6_RECVRTHDR = 0x26 IPV6_RECVTCLASS = 0x39 IPV6_RSSBUCKETID = 0x45 IPV6_RSS_LISTEN_BUCKET = 0x42 IPV6_RTHDR = 0x33 IPV6_RTHDRDSTOPTS = 0x23 IPV6_RTHDR_LOOSE = 0x0 IPV6_RTHDR_STRICT = 0x1 IPV6_RTHDR_TYPE_0 = 0x0 IPV6_SOCKOPT_RESERVED1 = 0x3 IPV6_TCLASS = 0x3d IPV6_UNICAST_HOPS = 0x4 IPV6_USE_MIN_MTU = 0x2a IPV6_V6ONLY = 0x1b IPV6_VERSION = 0x60 IPV6_VERSION_MASK = 0xf0 IPV6_VLAN_PCP = 0x4b IP_ADD_MEMBERSHIP = 0xc IP_ADD_SOURCE_MEMBERSHIP = 0x46 IP_BINDANY = 0x18 IP_BINDMULTI = 0x19 IP_BLOCK_SOURCE = 0x48 IP_DEFAULT_MULTICAST_LOOP = 0x1 IP_DEFAULT_MULTICAST_TTL = 0x1 IP_DF = 0x4000 IP_DONTFRAG = 0x43 IP_DROP_MEMBERSHIP = 0xd IP_DROP_SOURCE_MEMBERSHIP = 0x47 IP_DUMMYNET3 = 0x31 IP_DUMMYNET_CONFIGURE = 0x3c IP_DUMMYNET_DEL = 0x3d IP_DUMMYNET_FLUSH = 0x3e IP_DUMMYNET_GET = 0x40 IP_FLOWID = 0x5a IP_FLOWTYPE = 0x5b IP_FW3 = 0x30 IP_FW_ADD = 0x32 IP_FW_DEL = 0x33 IP_FW_FLUSH = 0x34 IP_FW_GET = 0x36 IP_FW_NAT_CFG = 0x38 IP_FW_NAT_DEL = 0x39 IP_FW_NAT_GET_CONFIG = 0x3a IP_FW_NAT_GET_LOG = 0x3b IP_FW_RESETLOG = 0x37 IP_FW_TABLE_ADD = 0x28 IP_FW_TABLE_DEL = 0x29 IP_FW_TABLE_FLUSH = 0x2a IP_FW_TABLE_GETSIZE = 0x2b IP_FW_TABLE_LIST = 0x2c IP_FW_ZERO = 0x35 IP_HDRINCL = 0x2 IP_IPSEC_POLICY = 0x15 IP_MAXPACKET = 0xffff IP_MAX_GROUP_SRC_FILTER = 0x200 IP_MAX_MEMBERSHIPS = 0xfff IP_MAX_SOCK_MUTE_FILTER = 0x80 IP_MAX_SOCK_SRC_FILTER = 0x80 IP_MF = 0x2000 IP_MINTTL = 0x42 IP_MSFILTER = 0x4a IP_MSS = 0x240 IP_MULTICAST_IF = 0x9 IP_MULTICAST_LOOP = 0xb IP_MULTICAST_TTL = 0xa IP_MULTICAST_VIF = 0xe IP_OFFMASK = 0x1fff IP_ONESBCAST = 0x17 IP_OPTIONS = 0x1 IP_ORIGDSTADDR = 0x1b IP_PORTRANGE = 0x13 IP_PORTRANGE_DEFAULT = 0x0 IP_PORTRANGE_HIGH = 0x1 IP_PORTRANGE_LOW = 0x2 IP_RECVDSTADDR = 0x7 IP_RECVFLOWID = 0x5d IP_RECVIF = 0x14 IP_RECVOPTS = 0x5 IP_RECVORIGDSTADDR = 0x1b IP_RECVRETOPTS = 0x6 IP_RECVRSSBUCKETID = 0x5e IP_RECVTOS = 0x44 IP_RECVTTL = 0x41 IP_RETOPTS = 0x8 IP_RF = 0x8000 IP_RSSBUCKETID = 0x5c IP_RSS_LISTEN_BUCKET = 0x1a IP_RSVP_OFF = 0x10 IP_RSVP_ON = 0xf IP_RSVP_VIF_OFF = 0x12 IP_RSVP_VIF_ON = 0x11 IP_SENDSRCADDR = 0x7 IP_TOS = 0x3 IP_TTL = 0x4 IP_UNBLOCK_SOURCE = 0x49 IP_VLAN_PCP = 0x4b ISIG = 0x80 ISTRIP = 0x20 ITIMER_PROF = 0x2 ITIMER_REAL = 0x0 ITIMER_VIRTUAL = 0x1 IXANY = 0x800 IXOFF = 0x400 IXON = 0x200 KERN_HOSTNAME = 0xa KERN_OSRELEASE = 0x2 KERN_OSTYPE = 0x1 KERN_VERSION = 0x4 LOCAL_CONNWAIT = 0x4 LOCAL_CREDS = 0x2 LOCAL_PEERCRED = 0x1 LOCAL_VENDOR = 0x80000000 LOCK_EX = 0x2 LOCK_NB = 0x4 LOCK_SH = 0x1 LOCK_UN = 0x8 MADV_AUTOSYNC = 0x7 MADV_CORE = 0x9 MADV_DONTNEED = 0x4 MADV_FREE = 0x5 MADV_NOCORE = 0x8 MADV_NORMAL = 0x0 MADV_NOSYNC = 0x6 MADV_PROTECT = 0xa MADV_RANDOM = 0x1 MADV_SEQUENTIAL = 0x2 MADV_WILLNEED = 0x3 MAP_32BIT = 0x80000 MAP_ALIGNED_SUPER = 0x1000000 MAP_ALIGNMENT_MASK = -0x1000000 MAP_ALIGNMENT_SHIFT = 0x18 MAP_ANON = 0x1000 MAP_ANONYMOUS = 0x1000 MAP_COPY = 0x2 MAP_EXCL = 0x4000 MAP_FILE = 0x0 MAP_FIXED = 0x10 MAP_GUARD = 0x2000 MAP_HASSEMAPHORE = 0x200 MAP_NOCORE = 0x20000 MAP_NOSYNC = 0x800 MAP_PREFAULT_READ = 0x40000 MAP_PRIVATE = 0x2 MAP_RESERVED0020 = 0x20 MAP_RESERVED0040 = 0x40 MAP_RESERVED0080 = 0x80 MAP_RESERVED0100 = 0x100 MAP_SHARED = 0x1 MAP_STACK = 0x400 MCAST_BLOCK_SOURCE = 0x54 MCAST_EXCLUDE = 0x2 MCAST_INCLUDE = 0x1 MCAST_JOIN_GROUP = 0x50 MCAST_JOIN_SOURCE_GROUP = 0x52 MCAST_LEAVE_GROUP = 0x51 MCAST_LEAVE_SOURCE_GROUP = 0x53 MCAST_UNBLOCK_SOURCE = 0x55 MCAST_UNDEFINED = 0x0 MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MNT_ACLS = 0x8000000 MNT_ASYNC = 0x40 MNT_AUTOMOUNTED = 0x200000000 MNT_BYFSID = 0x8000000 MNT_CMDFLAGS = 0xd0f0000 MNT_DEFEXPORTED = 0x200 MNT_DELEXPORT = 0x20000 MNT_EXKERB = 0x800 MNT_EXPORTANON = 0x400 MNT_EXPORTED = 0x100 MNT_EXPUBLIC = 0x20000000 MNT_EXRDONLY = 0x80 MNT_FORCE = 0x80000 MNT_GJOURNAL = 0x2000000 MNT_IGNORE = 0x800000 MNT_LAZY = 0x3 MNT_LOCAL = 0x1000 MNT_MULTILABEL = 0x4000000 MNT_NFS4ACLS = 0x10 MNT_NOATIME = 0x10000000 MNT_NOCLUSTERR = 0x40000000 MNT_NOCLUSTERW = 0x80000000 MNT_NOEXEC = 0x4 MNT_NONBUSY = 0x4000000 MNT_NOSUID = 0x8 MNT_NOSYMFOLLOW = 0x400000 MNT_NOWAIT = 0x2 MNT_QUOTA = 0x2000 MNT_RDONLY = 0x1 MNT_RELOAD = 0x40000 MNT_ROOTFS = 0x4000 MNT_SNAPSHOT = 0x1000000 MNT_SOFTDEP = 0x200000 MNT_SUIDDIR = 0x100000 MNT_SUJ = 0x100000000 MNT_SUSPEND = 0x4 MNT_SYNCHRONOUS = 0x2 MNT_UNION = 0x20 MNT_UNTRUSTED = 0x800000000 MNT_UPDATE = 0x10000 MNT_UPDATEMASK = 0xad8d0807e MNT_USER = 0x8000 MNT_VERIFIED = 0x400000000 MNT_VISFLAGMASK = 0xffef0ffff MNT_WAIT = 0x1 MSG_CMSG_CLOEXEC = 0x40000 MSG_COMPAT = 0x8000 MSG_CTRUNC = 0x20 MSG_DONTROUTE = 0x4 MSG_DONTWAIT = 0x80 MSG_EOF = 0x100 MSG_EOR = 0x8 MSG_NBIO = 0x4000 MSG_NOSIGNAL = 0x20000 MSG_NOTIFICATION = 0x2000 MSG_OOB = 0x1 MSG_PEEK = 0x2 MSG_TRUNC = 0x10 MSG_WAITALL = 0x40 MSG_WAITFORONE = 0x80000 MS_ASYNC = 0x1 MS_INVALIDATE = 0x2 MS_SYNC = 0x0 NAME_MAX = 0xff NET_RT_DUMP = 0x1 NET_RT_FLAGS = 0x2 NET_RT_IFLIST = 0x3 NET_RT_IFLISTL = 0x5 NET_RT_IFMALIST = 0x4 NFDBITS = 0x40 NOFLSH = 0x80000000 NOKERNINFO = 0x2000000 NOTE_ABSTIME = 0x10 NOTE_ATTRIB = 0x8 NOTE_CHILD = 0x4 NOTE_CLOSE = 0x100 NOTE_CLOSE_WRITE = 0x200 NOTE_DELETE = 0x1 NOTE_EXEC = 0x20000000 NOTE_EXIT = 0x80000000 NOTE_EXTEND = 0x4 NOTE_FFAND = 0x40000000 NOTE_FFCOPY = 0xc0000000 NOTE_FFCTRLMASK = 0xc0000000 NOTE_FFLAGSMASK = 0xffffff NOTE_FFNOP = 0x0 NOTE_FFOR = 0x80000000 NOTE_FILE_POLL = 0x2 NOTE_FORK = 0x40000000 NOTE_LINK = 0x10 NOTE_LOWAT = 0x1 NOTE_MSECONDS = 0x2 NOTE_NSECONDS = 0x8 NOTE_OPEN = 0x80 NOTE_PCTRLMASK = 0xf0000000 NOTE_PDATAMASK = 0xfffff NOTE_READ = 0x400 NOTE_RENAME = 0x20 NOTE_REVOKE = 0x40 NOTE_SECONDS = 0x1 NOTE_TRACK = 0x1 NOTE_TRACKERR = 0x2 NOTE_TRIGGER = 0x1000000 NOTE_USECONDS = 0x4 NOTE_WRITE = 0x2 OCRNL = 0x10 ONLCR = 0x2 ONLRET = 0x40 ONOCR = 0x20 ONOEOT = 0x8 OPOST = 0x1 OXTABS = 0x4 O_ACCMODE = 0x3 O_APPEND = 0x8 O_ASYNC = 0x40 O_CLOEXEC = 0x100000 O_CREAT = 0x200 O_DIRECT = 0x10000 O_DIRECTORY = 0x20000 O_EXCL = 0x800 O_EXEC = 0x40000 O_EXLOCK = 0x20 O_FSYNC = 0x80 O_NDELAY = 0x4 O_NOCTTY = 0x8000 O_NOFOLLOW = 0x100 O_NONBLOCK = 0x4 O_RDONLY = 0x0 O_RDWR = 0x2 O_RESOLVE_BENEATH = 0x800000 O_SEARCH = 0x40000 O_SHLOCK = 0x10 O_SYNC = 0x80 O_TRUNC = 0x400 O_TTY_INIT = 0x80000 O_VERIFY = 0x200000 O_WRONLY = 0x1 PARENB = 0x1000 PARMRK = 0x8 PARODD = 0x2000 PENDIN = 0x20000000 PIOD_READ_D = 0x1 PIOD_READ_I = 0x3 PIOD_WRITE_D = 0x2 PIOD_WRITE_I = 0x4 PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 PROT_EXEC = 0x4 PROT_NONE = 0x0 PROT_READ = 0x1 PROT_WRITE = 0x2 PTRACE_DEFAULT = 0x1 PTRACE_EXEC = 0x1 PTRACE_FORK = 0x8 PTRACE_LWP = 0x10 PTRACE_SCE = 0x2 PTRACE_SCX = 0x4 PTRACE_SYSCALL = 0x6 PTRACE_VFORK = 0x20 PT_ATTACH = 0xa PT_CLEARSTEP = 0x10 PT_CONTINUE = 0x7 PT_DETACH = 0xb PT_FIRSTMACH = 0x40 PT_FOLLOW_FORK = 0x17 PT_GETDBREGS = 0x25 PT_GETFPREGS = 0x23 PT_GETLWPLIST = 0xf PT_GETNUMLWPS = 0xe PT_GETREGS = 0x21 PT_GET_EVENT_MASK = 0x19 PT_GET_SC_ARGS = 0x1b PT_GET_SC_RET = 0x1c PT_IO = 0xc PT_KILL = 0x8 PT_LWPINFO = 0xd PT_LWP_EVENTS = 0x18 PT_READ_D = 0x2 PT_READ_I = 0x1 PT_RESUME = 0x13 PT_SETDBREGS = 0x26 PT_SETFPREGS = 0x24 PT_SETREGS = 0x22 PT_SETSTEP = 0x11 PT_SET_EVENT_MASK = 0x1a PT_STEP = 0x9 PT_SUSPEND = 0x12 PT_SYSCALL = 0x16 PT_TO_SCE = 0x14 PT_TO_SCX = 0x15 PT_TRACE_ME = 0x0 PT_VM_ENTRY = 0x29 PT_VM_TIMESTAMP = 0x28 PT_WRITE_D = 0x5 PT_WRITE_I = 0x4 P_ZONEID = 0xc RLIMIT_AS = 0xa RLIMIT_CORE = 0x4 RLIMIT_CPU = 0x0 RLIMIT_DATA = 0x2 RLIMIT_FSIZE = 0x1 RLIMIT_MEMLOCK = 0x6 RLIMIT_NOFILE = 0x8 RLIMIT_NPROC = 0x7 RLIMIT_RSS = 0x5 RLIMIT_STACK = 0x3 RLIM_INFINITY = 0x7fffffffffffffff RTAX_AUTHOR = 0x6 RTAX_BRD = 0x7 RTAX_DST = 0x0 RTAX_GATEWAY = 0x1 RTAX_GENMASK = 0x3 RTAX_IFA = 0x5 RTAX_IFP = 0x4 RTAX_MAX = 0x8 RTAX_NETMASK = 0x2 RTA_AUTHOR = 0x40 RTA_BRD = 0x80 RTA_DST = 0x1 RTA_GATEWAY = 0x2 RTA_GENMASK = 0x8 RTA_IFA = 0x20 RTA_IFP = 0x10 RTA_NETMASK = 0x4 RTF_BLACKHOLE = 0x1000 RTF_BROADCAST = 0x400000 RTF_DONE = 0x40 RTF_DYNAMIC = 0x10 RTF_FIXEDMTU = 0x80000 RTF_FMASK = 0x1004d808 RTF_GATEWAY = 0x2 RTF_GWFLAG_COMPAT = 0x80000000 RTF_HOST = 0x4 RTF_LLDATA = 0x400 RTF_LLINFO = 0x400 RTF_LOCAL = 0x200000 RTF_MODIFIED = 0x20 RTF_MULTICAST = 0x800000 RTF_PINNED = 0x100000 RTF_PROTO1 = 0x8000 RTF_PROTO2 = 0x4000 RTF_PROTO3 = 0x40000 RTF_REJECT = 0x8 RTF_RNH_LOCKED = 0x40000000 RTF_STATIC = 0x800 RTF_STICKY = 0x10000000 RTF_UP = 0x1 RTF_XRESOLVE = 0x200 RTM_ADD = 0x1 RTM_CHANGE = 0x3 RTM_DELADDR = 0xd RTM_DELETE = 0x2 RTM_DELMADDR = 0x10 RTM_GET = 0x4 RTM_IEEE80211 = 0x12 RTM_IFANNOUNCE = 0x11 RTM_IFINFO = 0xe RTM_LOCK = 0x8 RTM_LOSING = 0x5 RTM_MISS = 0x7 RTM_NEWADDR = 0xc RTM_NEWMADDR = 0xf RTM_REDIRECT = 0x6 RTM_RESOLVE = 0xb RTM_RTTUNIT = 0xf4240 RTM_VERSION = 0x5 RTV_EXPIRE = 0x4 RTV_HOPCOUNT = 0x2 RTV_MTU = 0x1 RTV_RPIPE = 0x8 RTV_RTT = 0x40 RTV_RTTVAR = 0x80 RTV_SPIPE = 0x10 RTV_SSTHRESH = 0x20 RTV_WEIGHT = 0x100 RT_ALL_FIBS = -0x1 RT_BLACKHOLE = 0x40 RT_DEFAULT_FIB = 0x0 RT_HAS_GW = 0x80 RT_HAS_HEADER = 0x10 RT_HAS_HEADER_BIT = 0x4 RT_L2_ME = 0x4 RT_L2_ME_BIT = 0x2 RT_LLE_CACHE = 0x100 RT_MAY_LOOP = 0x8 RT_MAY_LOOP_BIT = 0x3 RT_REJECT = 0x20 RUSAGE_CHILDREN = -0x1 RUSAGE_SELF = 0x0 RUSAGE_THREAD = 0x1 SCM_BINTIME = 0x4 SCM_CREDS = 0x3 SCM_MONOTONIC = 0x6 SCM_REALTIME = 0x5 SCM_RIGHTS = 0x1 SCM_TIMESTAMP = 0x2 SCM_TIME_INFO = 0x7 SEEK_CUR = 0x1 SEEK_DATA = 0x3 SEEK_END = 0x2 SEEK_HOLE = 0x4 SEEK_SET = 0x0 SHUT_RD = 0x0 SHUT_RDWR = 0x2 SHUT_WR = 0x1 SIOCADDMULTI = 0x80206931 SIOCAIFADDR = 0x8040691a SIOCAIFGROUP = 0x80286987 SIOCATMARK = 0x40047307 SIOCDELMULTI = 0x80206932 SIOCDIFADDR = 0x80206919 SIOCDIFGROUP = 0x80286989 SIOCDIFPHYADDR = 0x80206949 SIOCGDRVSPEC = 0xc028697b SIOCGETSGCNT = 0xc0207210 SIOCGETVIFCNT = 0xc028720f SIOCGHIWAT = 0x40047301 SIOCGHWADDR = 0xc020693e SIOCGI2C = 0xc020693d SIOCGIFADDR = 0xc0206921 SIOCGIFALIAS = 0xc044692d SIOCGIFBRDADDR = 0xc0206923 SIOCGIFCAP = 0xc020691f SIOCGIFCONF = 0xc0106924 SIOCGIFDESCR = 0xc020692a SIOCGIFDOWNREASON = 0xc058699a SIOCGIFDSTADDR = 0xc0206922 SIOCGIFFIB = 0xc020695c SIOCGIFFLAGS = 0xc0206911 SIOCGIFGENERIC = 0xc020693a SIOCGIFGMEMB = 0xc028698a SIOCGIFGROUP = 0xc0286988 SIOCGIFINDEX = 0xc0206920 SIOCGIFMAC = 0xc0206926 SIOCGIFMEDIA = 0xc0306938 SIOCGIFMETRIC = 0xc0206917 SIOCGIFMTU = 0xc0206933 SIOCGIFNETMASK = 0xc0206925 SIOCGIFPDSTADDR = 0xc0206948 SIOCGIFPHYS = 0xc0206935 SIOCGIFPSRCADDR = 0xc0206947 SIOCGIFRSSHASH = 0xc0186997 SIOCGIFRSSKEY = 0xc0946996 SIOCGIFSTATUS = 0xc331693b SIOCGIFXMEDIA = 0xc030698b SIOCGLANPCP = 0xc0206998 SIOCGLOWAT = 0x40047303 SIOCGPGRP = 0x40047309 SIOCGPRIVATE_0 = 0xc0206950 SIOCGPRIVATE_1 = 0xc0206951 SIOCGTUNFIB = 0xc020695e SIOCIFCREATE = 0xc020697a SIOCIFCREATE2 = 0xc020697c SIOCIFDESTROY = 0x80206979 SIOCIFGCLONERS = 0xc0106978 SIOCSDRVSPEC = 0x8028697b SIOCSHIWAT = 0x80047300 SIOCSIFADDR = 0x8020690c SIOCSIFBRDADDR = 0x80206913 SIOCSIFCAP = 0x8020691e SIOCSIFDESCR = 0x80206929 SIOCSIFDSTADDR = 0x8020690e SIOCSIFFIB = 0x8020695d SIOCSIFFLAGS = 0x80206910 SIOCSIFGENERIC = 0x80206939 SIOCSIFLLADDR = 0x8020693c SIOCSIFMAC = 0x80206927 SIOCSIFMEDIA = 0xc0206937 SIOCSIFMETRIC = 0x80206918 SIOCSIFMTU = 0x80206934 SIOCSIFNAME = 0x80206928 SIOCSIFNETMASK = 0x80206916 SIOCSIFPHYADDR = 0x80406946 SIOCSIFPHYS = 0x80206936 SIOCSIFRVNET = 0xc020695b SIOCSIFVNET = 0xc020695a SIOCSLANPCP = 0x80206999 SIOCSLOWAT = 0x80047302 SIOCSPGRP = 0x80047308 SIOCSTUNFIB = 0x8020695f SOCK_CLOEXEC = 0x10000000 SOCK_DGRAM = 0x2 SOCK_MAXADDRLEN = 0xff SOCK_NONBLOCK = 0x20000000 SOCK_RAW = 0x3 SOCK_RDM = 0x4 SOCK_SEQPACKET = 0x5 SOCK_STREAM = 0x1 SOL_LOCAL = 0x0 SOL_SOCKET = 0xffff SOMAXCONN = 0x80 SO_ACCEPTCONN = 0x2 SO_ACCEPTFILTER = 0x1000 SO_BINTIME = 0x2000 SO_BROADCAST = 0x20 SO_DEBUG = 0x1 SO_DOMAIN = 0x1019 SO_DONTROUTE = 0x10 SO_ERROR = 0x1007 SO_KEEPALIVE = 0x8 SO_LABEL = 0x1009 SO_LINGER = 0x80 SO_LISTENINCQLEN = 0x1013 SO_LISTENQLEN = 0x1012 SO_LISTENQLIMIT = 0x1011 SO_MAX_PACING_RATE = 0x1018 SO_NOSIGPIPE = 0x800 SO_NO_DDP = 0x8000 SO_NO_OFFLOAD = 0x4000 SO_OOBINLINE = 0x100 SO_PEERLABEL = 0x1010 SO_PROTOCOL = 0x1016 SO_PROTOTYPE = 0x1016 SO_RCVBUF = 0x1002 SO_RCVLOWAT = 0x1004 SO_RCVTIMEO = 0x1006 SO_RERROR = 0x20000 SO_REUSEADDR = 0x4 SO_REUSEPORT = 0x200 SO_REUSEPORT_LB = 0x10000 SO_SETFIB = 0x1014 SO_SNDBUF = 0x1001 SO_SNDLOWAT = 0x1003 SO_SNDTIMEO = 0x1005 SO_TIMESTAMP = 0x400 SO_TS_BINTIME = 0x1 SO_TS_CLOCK = 0x1017 SO_TS_CLOCK_MAX = 0x3 SO_TS_DEFAULT = 0x0 SO_TS_MONOTONIC = 0x3 SO_TS_REALTIME = 0x2 SO_TS_REALTIME_MICRO = 0x0 SO_TYPE = 0x1008 SO_USELOOPBACK = 0x40 SO_USER_COOKIE = 0x1015 SO_VENDOR = 0x80000000 S_BLKSIZE = 0x200 S_IEXEC = 0x40 S_IFBLK = 0x6000 S_IFCHR = 0x2000 S_IFDIR = 0x4000 S_IFIFO = 0x1000 S_IFLNK = 0xa000 S_IFMT = 0xf000 S_IFREG = 0x8000 S_IFSOCK = 0xc000 S_IFWHT = 0xe000 S_IREAD = 0x100 S_IRGRP = 0x20 S_IROTH = 0x4 S_IRUSR = 0x100 S_IRWXG = 0x38 S_IRWXO = 0x7 S_IRWXU = 0x1c0 S_ISGID = 0x400 S_ISTXT = 0x200 S_ISUID = 0x800 S_ISVTX = 0x200 S_IWGRP = 0x10 S_IWOTH = 0x2 S_IWRITE = 0x80 S_IWUSR = 0x80 S_IXGRP = 0x8 S_IXOTH = 0x1 S_IXUSR = 0x40 TAB0 = 0x0 TAB3 = 0x4 TABDLY = 0x4 TCIFLUSH = 0x1 TCIOFF = 0x3 TCIOFLUSH = 0x3 TCION = 0x4 TCOFLUSH = 0x2 TCOOFF = 0x1 TCOON = 0x2 TCPOPT_EOL = 0x0 TCPOPT_FAST_OPEN = 0x22 TCPOPT_MAXSEG = 0x2 TCPOPT_NOP = 0x1 TCPOPT_PAD = 0x0 TCPOPT_SACK = 0x5 TCPOPT_SACK_PERMITTED = 0x4 TCPOPT_SIGNATURE = 0x13 TCPOPT_TIMESTAMP = 0x8 TCPOPT_WINDOW = 0x3 TCP_BBR_ACK_COMP_ALG = 0x448 TCP_BBR_ALGORITHM = 0x43b TCP_BBR_DRAIN_INC_EXTRA = 0x43c TCP_BBR_DRAIN_PG = 0x42e TCP_BBR_EXTRA_GAIN = 0x449 TCP_BBR_EXTRA_STATE = 0x453 TCP_BBR_FLOOR_MIN_TSO = 0x454 TCP_BBR_HDWR_PACE = 0x451 TCP_BBR_HOLD_TARGET = 0x436 TCP_BBR_IWINTSO = 0x42b TCP_BBR_LOWGAIN_FD = 0x436 TCP_BBR_LOWGAIN_HALF = 0x435 TCP_BBR_LOWGAIN_THRESH = 0x434 TCP_BBR_MAX_RTO = 0x439 TCP_BBR_MIN_RTO = 0x438 TCP_BBR_MIN_TOPACEOUT = 0x455 TCP_BBR_ONE_RETRAN = 0x431 TCP_BBR_PACE_CROSS = 0x442 TCP_BBR_PACE_DEL_TAR = 0x43f TCP_BBR_PACE_OH = 0x435 TCP_BBR_PACE_PER_SEC = 0x43e TCP_BBR_PACE_SEG_MAX = 0x440 TCP_BBR_PACE_SEG_MIN = 0x441 TCP_BBR_POLICER_DETECT = 0x457 TCP_BBR_PROBE_RTT_GAIN = 0x44d TCP_BBR_PROBE_RTT_INT = 0x430 TCP_BBR_PROBE_RTT_LEN = 0x44e TCP_BBR_RACK_RTT_USE = 0x44a TCP_BBR_RECFORCE = 0x42c TCP_BBR_REC_OVER_HPTS = 0x43a TCP_BBR_RETRAN_WTSO = 0x44b TCP_BBR_RWND_IS_APP = 0x42f TCP_BBR_SEND_IWND_IN_TSO = 0x44f TCP_BBR_STARTUP_EXIT_EPOCH = 0x43d TCP_BBR_STARTUP_LOSS_EXIT = 0x432 TCP_BBR_STARTUP_PG = 0x42d TCP_BBR_TMR_PACE_OH = 0x448 TCP_BBR_TSLIMITS = 0x434 TCP_BBR_TSTMP_RAISES = 0x456 TCP_BBR_UNLIMITED = 0x43b TCP_BBR_USEDEL_RATE = 0x437 TCP_BBR_USE_LOWGAIN = 0x433 TCP_BBR_USE_RACK_CHEAT = 0x450 TCP_BBR_UTTER_MAX_TSO = 0x452 TCP_CA_NAME_MAX = 0x10 TCP_CCALGOOPT = 0x41 TCP_CONGESTION = 0x40 TCP_DATA_AFTER_CLOSE = 0x44c TCP_DELACK = 0x48 TCP_FASTOPEN = 0x401 TCP_FASTOPEN_MAX_COOKIE_LEN = 0x10 TCP_FASTOPEN_MIN_COOKIE_LEN = 0x4 TCP_FASTOPEN_PSK_LEN = 0x10 TCP_FUNCTION_BLK = 0x2000 TCP_FUNCTION_NAME_LEN_MAX = 0x20 TCP_INFO = 0x20 TCP_KEEPCNT = 0x400 TCP_KEEPIDLE = 0x100 TCP_KEEPINIT = 0x80 TCP_KEEPINTVL = 0x200 TCP_LOG = 0x22 TCP_LOGBUF = 0x23 TCP_LOGDUMP = 0x25 TCP_LOGDUMPID = 0x26 TCP_LOGID = 0x24 TCP_LOG_ID_LEN = 0x40 TCP_MAXBURST = 0x4 TCP_MAXHLEN = 0x3c TCP_MAXOLEN = 0x28 TCP_MAXSEG = 0x2 TCP_MAXWIN = 0xffff TCP_MAX_SACK = 0x4 TCP_MAX_WINSHIFT = 0xe TCP_MD5SIG = 0x10 TCP_MINMSS = 0xd8 TCP_MSS = 0x218 TCP_NODELAY = 0x1 TCP_NOOPT = 0x8 TCP_NOPUSH = 0x4 TCP_PCAP_IN = 0x1000 TCP_PCAP_OUT = 0x800 TCP_RACK_EARLY_RECOV = 0x423 TCP_RACK_EARLY_SEG = 0x424 TCP_RACK_GP_INCREASE = 0x446 TCP_RACK_IDLE_REDUCE_HIGH = 0x444 TCP_RACK_MIN_PACE = 0x445 TCP_RACK_MIN_PACE_SEG = 0x446 TCP_RACK_MIN_TO = 0x422 TCP_RACK_PACE_ALWAYS = 0x41f TCP_RACK_PACE_MAX_SEG = 0x41e TCP_RACK_PACE_REDUCE = 0x41d TCP_RACK_PKT_DELAY = 0x428 TCP_RACK_PROP = 0x41b TCP_RACK_PROP_RATE = 0x420 TCP_RACK_PRR_SENDALOT = 0x421 TCP_RACK_REORD_FADE = 0x426 TCP_RACK_REORD_THRESH = 0x425 TCP_RACK_TLP_INC_VAR = 0x429 TCP_RACK_TLP_REDUCE = 0x41c TCP_RACK_TLP_THRESH = 0x427 TCP_RACK_TLP_USE = 0x447 TCP_VENDOR = 0x80000000 TCSAFLUSH = 0x2 TIMER_ABSTIME = 0x1 TIMER_RELTIME = 0x0 TIOCCBRK = 0x2000747a TIOCCDTR = 0x20007478 TIOCCONS = 0x80047462 TIOCDRAIN = 0x2000745e TIOCEXCL = 0x2000740d TIOCEXT = 0x80047460 TIOCFLUSH = 0x80047410 TIOCGDRAINWAIT = 0x40047456 TIOCGETA = 0x402c7413 TIOCGETD = 0x4004741a TIOCGPGRP = 0x40047477 TIOCGPTN = 0x4004740f TIOCGSID = 0x40047463 TIOCGWINSZ = 0x40087468 TIOCMBIC = 0x8004746b TIOCMBIS = 0x8004746c TIOCMGDTRWAIT = 0x4004745a TIOCMGET = 0x4004746a TIOCMSDTRWAIT = 0x8004745b TIOCMSET = 0x8004746d TIOCM_CAR = 0x40 TIOCM_CD = 0x40 TIOCM_CTS = 0x20 TIOCM_DCD = 0x40 TIOCM_DSR = 0x100 TIOCM_DTR = 0x2 TIOCM_LE = 0x1 TIOCM_RI = 0x80 TIOCM_RNG = 0x80 TIOCM_RTS = 0x4 TIOCM_SR = 0x10 TIOCM_ST = 0x8 TIOCNOTTY = 0x20007471 TIOCNXCL = 0x2000740e TIOCOUTQ = 0x40047473 TIOCPKT = 0x80047470 TIOCPKT_DATA = 0x0 TIOCPKT_DOSTOP = 0x20 TIOCPKT_FLUSHREAD = 0x1 TIOCPKT_FLUSHWRITE = 0x2 TIOCPKT_IOCTL = 0x40 TIOCPKT_NOSTOP = 0x10 TIOCPKT_START = 0x8 TIOCPKT_STOP = 0x4 TIOCPTMASTER = 0x2000741c TIOCSBRK = 0x2000747b TIOCSCTTY = 0x20007461 TIOCSDRAINWAIT = 0x80047457 TIOCSDTR = 0x20007479 TIOCSETA = 0x802c7414 TIOCSETAF = 0x802c7416 TIOCSETAW = 0x802c7415 TIOCSETD = 0x8004741b TIOCSIG = 0x2004745f TIOCSPGRP = 0x80047476 TIOCSTART = 0x2000746e TIOCSTAT = 0x20007465 TIOCSTI = 0x80017472 TIOCSTOP = 0x2000746f TIOCSWINSZ = 0x80087467 TIOCTIMESTAMP = 0x40107459 TIOCUCNTL = 0x80047466 TOSTOP = 0x400000 UTIME_NOW = -0x1 UTIME_OMIT = -0x2 VDISCARD = 0xf VDSUSP = 0xb VEOF = 0x0 VEOL = 0x1 VEOL2 = 0x2 VERASE = 0x3 VERASE2 = 0x7 VINTR = 0x8 VKILL = 0x5 VLNEXT = 0xe VMIN = 0x10 VM_BCACHE_SIZE_MAX = 0x19000000 VQUIT = 0x9 VREPRINT = 0x6 VSTART = 0xc VSTATUS = 0x12 VSTOP = 0xd VSUSP = 0xa VTIME = 0x11 VWERASE = 0x4 WCONTINUED = 0x4 WCOREFLAG = 0x80 WEXITED = 0x10 WLINUXCLONE = 0x80000000 WNOHANG = 0x1 WNOWAIT = 0x8 WSTOPPED = 0x2 WTRAPPED = 0x20 WUNTRACED = 0x2 ) // Errors const ( E2BIG = syscall.Errno(0x7) EACCES = syscall.Errno(0xd) EADDRINUSE = syscall.Errno(0x30) EADDRNOTAVAIL = syscall.Errno(0x31) EAFNOSUPPORT = syscall.Errno(0x2f) EAGAIN = syscall.Errno(0x23) EALREADY = syscall.Errno(0x25) EAUTH = syscall.Errno(0x50) EBADF = syscall.Errno(0x9) EBADMSG = syscall.Errno(0x59) EBADRPC = syscall.Errno(0x48) EBUSY = syscall.Errno(0x10) ECANCELED = syscall.Errno(0x55) ECAPMODE = syscall.Errno(0x5e) ECHILD = syscall.Errno(0xa) ECONNABORTED = syscall.Errno(0x35) ECONNREFUSED = syscall.Errno(0x3d) ECONNRESET = syscall.Errno(0x36) EDEADLK = syscall.Errno(0xb) EDESTADDRREQ = syscall.Errno(0x27) EDOM = syscall.Errno(0x21) EDOOFUS = syscall.Errno(0x58) EDQUOT = syscall.Errno(0x45) EEXIST = syscall.Errno(0x11) EFAULT = syscall.Errno(0xe) EFBIG = syscall.Errno(0x1b) EFTYPE = syscall.Errno(0x4f) EHOSTDOWN = syscall.Errno(0x40) EHOSTUNREACH = syscall.Errno(0x41) EIDRM = syscall.Errno(0x52) EILSEQ = syscall.Errno(0x56) EINPROGRESS = syscall.Errno(0x24) EINTEGRITY = syscall.Errno(0x61) EINTR = syscall.Errno(0x4) EINVAL = syscall.Errno(0x16) EIO = syscall.Errno(0x5) EISCONN = syscall.Errno(0x38) EISDIR = syscall.Errno(0x15) ELAST = syscall.Errno(0x61) ELOOP = syscall.Errno(0x3e) EMFILE = syscall.Errno(0x18) EMLINK = syscall.Errno(0x1f) EMSGSIZE = syscall.Errno(0x28) EMULTIHOP = syscall.Errno(0x5a) ENAMETOOLONG = syscall.Errno(0x3f) ENEEDAUTH = syscall.Errno(0x51) ENETDOWN = syscall.Errno(0x32) ENETRESET = syscall.Errno(0x34) ENETUNREACH = syscall.Errno(0x33) ENFILE = syscall.Errno(0x17) ENOATTR = syscall.Errno(0x57) ENOBUFS = syscall.Errno(0x37) ENODEV = syscall.Errno(0x13) ENOENT = syscall.Errno(0x2) ENOEXEC = syscall.Errno(0x8) ENOLCK = syscall.Errno(0x4d) ENOLINK = syscall.Errno(0x5b) ENOMEM = syscall.Errno(0xc) ENOMSG = syscall.Errno(0x53) ENOPROTOOPT = syscall.Errno(0x2a) ENOSPC = syscall.Errno(0x1c) ENOSYS = syscall.Errno(0x4e) ENOTBLK = syscall.Errno(0xf) ENOTCAPABLE = syscall.Errno(0x5d) ENOTCONN = syscall.Errno(0x39) ENOTDIR = syscall.Errno(0x14) ENOTEMPTY = syscall.Errno(0x42) ENOTRECOVERABLE = syscall.Errno(0x5f) ENOTSOCK = syscall.Errno(0x26) ENOTSUP = syscall.Errno(0x2d) ENOTTY = syscall.Errno(0x19) ENXIO = syscall.Errno(0x6) EOPNOTSUPP = syscall.Errno(0x2d) EOVERFLOW = syscall.Errno(0x54) EOWNERDEAD = syscall.Errno(0x60) EPERM = syscall.Errno(0x1) EPFNOSUPPORT = syscall.Errno(0x2e) EPIPE = syscall.Errno(0x20) EPROCLIM = syscall.Errno(0x43) EPROCUNAVAIL = syscall.Errno(0x4c) EPROGMISMATCH = syscall.Errno(0x4b) EPROGUNAVAIL = syscall.Errno(0x4a) EPROTO = syscall.Errno(0x5c) EPROTONOSUPPORT = syscall.Errno(0x2b) EPROTOTYPE = syscall.Errno(0x29) ERANGE = syscall.Errno(0x22) EREMOTE = syscall.Errno(0x47) EROFS = syscall.Errno(0x1e) ERPCMISMATCH = syscall.Errno(0x49) ESHUTDOWN = syscall.Errno(0x3a) ESOCKTNOSUPPORT = syscall.Errno(0x2c) ESPIPE = syscall.Errno(0x1d) ESRCH = syscall.Errno(0x3) ESTALE = syscall.Errno(0x46) ETIMEDOUT = syscall.Errno(0x3c) ETOOMANYREFS = syscall.Errno(0x3b) ETXTBSY = syscall.Errno(0x1a) EUSERS = syscall.Errno(0x44) EWOULDBLOCK = syscall.Errno(0x23) EXDEV = syscall.Errno(0x12) ) // Signals const ( SIGABRT = syscall.Signal(0x6) SIGALRM = syscall.Signal(0xe) SIGBUS = syscall.Signal(0xa) SIGCHLD = syscall.Signal(0x14) SIGCONT = syscall.Signal(0x13) SIGEMT = syscall.Signal(0x7) SIGFPE = syscall.Signal(0x8) SIGHUP = syscall.Signal(0x1) SIGILL = syscall.Signal(0x4) SIGINFO = syscall.Signal(0x1d) SIGINT = syscall.Signal(0x2) SIGIO = syscall.Signal(0x17) SIGIOT = syscall.Signal(0x6) SIGKILL = syscall.Signal(0x9) SIGLIBRT = syscall.Signal(0x21) SIGLWP = syscall.Signal(0x20) SIGPIPE = syscall.Signal(0xd) SIGPROF = syscall.Signal(0x1b) SIGQUIT = syscall.Signal(0x3) SIGSEGV = syscall.Signal(0xb) SIGSTOP = syscall.Signal(0x11) SIGSYS = syscall.Signal(0xc) SIGTERM = syscall.Signal(0xf) SIGTHR = syscall.Signal(0x20) SIGTRAP = syscall.Signal(0x5) SIGTSTP = syscall.Signal(0x12) SIGTTIN = syscall.Signal(0x15) SIGTTOU = syscall.Signal(0x16) SIGURG = syscall.Signal(0x10) SIGUSR1 = syscall.Signal(0x1e) SIGUSR2 = syscall.Signal(0x1f) SIGVTALRM = syscall.Signal(0x1a) SIGWINCH = syscall.Signal(0x1c) SIGXCPU = syscall.Signal(0x18) SIGXFSZ = syscall.Signal(0x19) ) // Error table var errorList = [...]struct { num syscall.Errno name string desc string }{ {1, "EPERM", "operation not permitted"}, {2, "ENOENT", "no such file or directory"}, {3, "ESRCH", "no such process"}, {4, "EINTR", "interrupted system call"}, {5, "EIO", "input/output error"}, {6, "ENXIO", "device not configured"}, {7, "E2BIG", "argument list too long"}, {8, "ENOEXEC", "exec format error"}, {9, "EBADF", "bad file descriptor"}, {10, "ECHILD", "no child processes"}, {11, "EDEADLK", "resource deadlock avoided"}, {12, "ENOMEM", "cannot allocate memory"}, {13, "EACCES", "permission denied"}, {14, "EFAULT", "bad address"}, {15, "ENOTBLK", "block device required"}, {16, "EBUSY", "device busy"}, {17, "EEXIST", "file exists"}, {18, "EXDEV", "cross-device link"}, {19, "ENODEV", "operation not supported by device"}, {20, "ENOTDIR", "not a directory"}, {21, "EISDIR", "is a directory"}, {22, "EINVAL", "invalid argument"}, {23, "ENFILE", "too many open files in system"}, {24, "EMFILE", "too many open files"}, {25, "ENOTTY", "inappropriate ioctl for device"}, {26, "ETXTBSY", "text file busy"}, {27, "EFBIG", "file too large"}, {28, "ENOSPC", "no space left on device"}, {29, "ESPIPE", "illegal seek"}, {30, "EROFS", "read-only file system"}, {31, "EMLINK", "too many links"}, {32, "EPIPE", "broken pipe"}, {33, "EDOM", "numerical argument out of domain"}, {34, "ERANGE", "result too large"}, {35, "EWOULDBLOCK", "resource temporarily unavailable"}, {36, "EINPROGRESS", "operation now in progress"}, {37, "EALREADY", "operation already in progress"}, {38, "ENOTSOCK", "socket operation on non-socket"}, {39, "EDESTADDRREQ", "destination address required"}, {40, "EMSGSIZE", "message too long"}, {41, "EPROTOTYPE", "protocol wrong type for socket"}, {42, "ENOPROTOOPT", "protocol not available"}, {43, "EPROTONOSUPPORT", "protocol not supported"}, {44, "ESOCKTNOSUPPORT", "socket type not supported"}, {45, "EOPNOTSUPP", "operation not supported"}, {46, "EPFNOSUPPORT", "protocol family not supported"}, {47, "EAFNOSUPPORT", "address family not supported by protocol family"}, {48, "EADDRINUSE", "address already in use"}, {49, "EADDRNOTAVAIL", "can't assign requested address"}, {50, "ENETDOWN", "network is down"}, {51, "ENETUNREACH", "network is unreachable"}, {52, "ENETRESET", "network dropped connection on reset"}, {53, "ECONNABORTED", "software caused connection abort"}, {54, "ECONNRESET", "connection reset by peer"}, {55, "ENOBUFS", "no buffer space available"}, {56, "EISCONN", "socket is already connected"}, {57, "ENOTCONN", "socket is not connected"}, {58, "ESHUTDOWN", "can't send after socket shutdown"}, {59, "ETOOMANYREFS", "too many references: can't splice"}, {60, "ETIMEDOUT", "operation timed out"}, {61, "ECONNREFUSED", "connection refused"}, {62, "ELOOP", "too many levels of symbolic links"}, {63, "ENAMETOOLONG", "file name too long"}, {64, "EHOSTDOWN", "host is down"}, {65, "EHOSTUNREACH", "no route to host"}, {66, "ENOTEMPTY", "directory not empty"}, {67, "EPROCLIM", "too many processes"}, {68, "EUSERS", "too many users"}, {69, "EDQUOT", "disc quota exceeded"}, {70, "ESTALE", "stale NFS file handle"}, {71, "EREMOTE", "too many levels of remote in path"}, {72, "EBADRPC", "RPC struct is bad"}, {73, "ERPCMISMATCH", "RPC version wrong"}, {74, "EPROGUNAVAIL", "RPC prog. not avail"}, {75, "EPROGMISMATCH", "program version wrong"}, {76, "EPROCUNAVAIL", "bad procedure for program"}, {77, "ENOLCK", "no locks available"}, {78, "ENOSYS", "function not implemented"}, {79, "EFTYPE", "inappropriate file type or format"}, {80, "EAUTH", "authentication error"}, {81, "ENEEDAUTH", "need authenticator"}, {82, "EIDRM", "identifier removed"}, {83, "ENOMSG", "no message of desired type"}, {84, "EOVERFLOW", "value too large to be stored in data type"}, {85, "ECANCELED", "operation canceled"}, {86, "EILSEQ", "illegal byte sequence"}, {87, "ENOATTR", "attribute not found"}, {88, "EDOOFUS", "programming error"}, {89, "EBADMSG", "bad message"}, {90, "EMULTIHOP", "multihop attempted"}, {91, "ENOLINK", "link has been severed"}, {92, "EPROTO", "protocol error"}, {93, "ENOTCAPABLE", "capabilities insufficient"}, {94, "ECAPMODE", "not permitted in capability mode"}, {95, "ENOTRECOVERABLE", "state not recoverable"}, {96, "EOWNERDEAD", "previous owner died"}, {97, "EINTEGRITY", "integrity check failed"}, } // Signal table var signalList = [...]struct { num syscall.Signal name string desc string }{ {1, "SIGHUP", "hangup"}, {2, "SIGINT", "interrupt"}, {3, "SIGQUIT", "quit"}, {4, "SIGILL", "illegal instruction"}, {5, "SIGTRAP", "trace/BPT trap"}, {6, "SIGIOT", "abort trap"}, {7, "SIGEMT", "EMT trap"}, {8, "SIGFPE", "floating point exception"}, {9, "SIGKILL", "killed"}, {10, "SIGBUS", "bus error"}, {11, "SIGSEGV", "segmentation fault"}, {12, "SIGSYS", "bad system call"}, {13, "SIGPIPE", "broken pipe"}, {14, "SIGALRM", "alarm clock"}, {15, "SIGTERM", "terminated"}, {16, "SIGURG", "urgent I/O condition"}, {17, "SIGSTOP", "suspended (signal)"}, {18, "SIGTSTP", "suspended"}, {19, "SIGCONT", "continued"}, {20, "SIGCHLD", "child exited"}, {21, "SIGTTIN", "stopped (tty input)"}, {22, "SIGTTOU", "stopped (tty output)"}, {23, "SIGIO", "I/O possible"}, {24, "SIGXCPU", "cputime limit exceeded"}, {25, "SIGXFSZ", "filesize limit exceeded"}, {26, "SIGVTALRM", "virtual timer expired"}, {27, "SIGPROF", "profiling timer expired"}, {28, "SIGWINCH", "window size changes"}, {29, "SIGINFO", "information request"}, {30, "SIGUSR1", "user defined signal 1"}, {31, "SIGUSR2", "user defined signal 2"}, {32, "SIGTHR", "unknown signal"}, {33, "SIGLIBRT", "unknown signal"}, } ================================================ FILE: vendor/golang.org/x/sys/unix/zerrors_freebsd_riscv64.go ================================================ // mkerrors.sh -m64 // Code generated by the command above; see README.md. DO NOT EDIT. //go:build riscv64 && freebsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -m64 _const.go package unix import "syscall" const ( AF_APPLETALK = 0x10 AF_ARP = 0x23 AF_ATM = 0x1e AF_BLUETOOTH = 0x24 AF_CCITT = 0xa AF_CHAOS = 0x5 AF_CNT = 0x15 AF_COIP = 0x14 AF_DATAKIT = 0x9 AF_DECnet = 0xc AF_DLI = 0xd AF_E164 = 0x1a AF_ECMA = 0x8 AF_HYLINK = 0xf AF_HYPERV = 0x2b AF_IEEE80211 = 0x25 AF_IMPLINK = 0x3 AF_INET = 0x2 AF_INET6 = 0x1c AF_INET6_SDP = 0x2a AF_INET_SDP = 0x28 AF_IPX = 0x17 AF_ISDN = 0x1a AF_ISO = 0x7 AF_LAT = 0xe AF_LINK = 0x12 AF_LOCAL = 0x1 AF_MAX = 0x2b AF_NATM = 0x1d AF_NETBIOS = 0x6 AF_NETGRAPH = 0x20 AF_OSI = 0x7 AF_PUP = 0x4 AF_ROUTE = 0x11 AF_SCLUSTER = 0x22 AF_SIP = 0x18 AF_SLOW = 0x21 AF_SNA = 0xb AF_UNIX = 0x1 AF_UNSPEC = 0x0 AF_VENDOR00 = 0x27 AF_VENDOR01 = 0x29 AF_VENDOR03 = 0x2d AF_VENDOR04 = 0x2f AF_VENDOR05 = 0x31 AF_VENDOR06 = 0x33 AF_VENDOR07 = 0x35 AF_VENDOR08 = 0x37 AF_VENDOR09 = 0x39 AF_VENDOR10 = 0x3b AF_VENDOR11 = 0x3d AF_VENDOR12 = 0x3f AF_VENDOR13 = 0x41 AF_VENDOR14 = 0x43 AF_VENDOR15 = 0x45 AF_VENDOR16 = 0x47 AF_VENDOR17 = 0x49 AF_VENDOR18 = 0x4b AF_VENDOR19 = 0x4d AF_VENDOR20 = 0x4f AF_VENDOR21 = 0x51 AF_VENDOR22 = 0x53 AF_VENDOR23 = 0x55 AF_VENDOR24 = 0x57 AF_VENDOR25 = 0x59 AF_VENDOR26 = 0x5b AF_VENDOR27 = 0x5d AF_VENDOR28 = 0x5f AF_VENDOR29 = 0x61 AF_VENDOR30 = 0x63 AF_VENDOR31 = 0x65 AF_VENDOR32 = 0x67 AF_VENDOR33 = 0x69 AF_VENDOR34 = 0x6b AF_VENDOR35 = 0x6d AF_VENDOR36 = 0x6f AF_VENDOR37 = 0x71 AF_VENDOR38 = 0x73 AF_VENDOR39 = 0x75 AF_VENDOR40 = 0x77 AF_VENDOR41 = 0x79 AF_VENDOR42 = 0x7b AF_VENDOR43 = 0x7d AF_VENDOR44 = 0x7f AF_VENDOR45 = 0x81 AF_VENDOR46 = 0x83 AF_VENDOR47 = 0x85 ALTWERASE = 0x200 B0 = 0x0 B1000000 = 0xf4240 B110 = 0x6e B115200 = 0x1c200 B1200 = 0x4b0 B134 = 0x86 B14400 = 0x3840 B150 = 0x96 B1500000 = 0x16e360 B1800 = 0x708 B19200 = 0x4b00 B200 = 0xc8 B2000000 = 0x1e8480 B230400 = 0x38400 B2400 = 0x960 B2500000 = 0x2625a0 B28800 = 0x7080 B300 = 0x12c B3000000 = 0x2dc6c0 B3500000 = 0x3567e0 B38400 = 0x9600 B4000000 = 0x3d0900 B460800 = 0x70800 B4800 = 0x12c0 B50 = 0x32 B500000 = 0x7a120 B57600 = 0xe100 B600 = 0x258 B7200 = 0x1c20 B75 = 0x4b B76800 = 0x12c00 B921600 = 0xe1000 B9600 = 0x2580 BIOCFEEDBACK = 0x8004427c BIOCFLUSH = 0x20004268 BIOCGBLEN = 0x40044266 BIOCGDIRECTION = 0x40044276 BIOCGDLT = 0x4004426a BIOCGDLTLIST = 0xc0104279 BIOCGETBUFMODE = 0x4004427d BIOCGETIF = 0x4020426b BIOCGETZMAX = 0x4008427f BIOCGHDRCMPLT = 0x40044274 BIOCGRSIG = 0x40044272 BIOCGRTIMEOUT = 0x4010426e BIOCGSEESENT = 0x40044276 BIOCGSTATS = 0x4008426f BIOCGTSTAMP = 0x40044283 BIOCIMMEDIATE = 0x80044270 BIOCLOCK = 0x2000427a BIOCPROMISC = 0x20004269 BIOCROTZBUF = 0x40184280 BIOCSBLEN = 0xc0044266 BIOCSDIRECTION = 0x80044277 BIOCSDLT = 0x80044278 BIOCSETBUFMODE = 0x8004427e BIOCSETF = 0x80104267 BIOCSETFNR = 0x80104282 BIOCSETIF = 0x8020426c BIOCSETVLANPCP = 0x80044285 BIOCSETWF = 0x8010427b BIOCSETZBUF = 0x80184281 BIOCSHDRCMPLT = 0x80044275 BIOCSRSIG = 0x80044273 BIOCSRTIMEOUT = 0x8010426d BIOCSSEESENT = 0x80044277 BIOCSTSTAMP = 0x80044284 BIOCVERSION = 0x40044271 BPF_A = 0x10 BPF_ABS = 0x20 BPF_ADD = 0x0 BPF_ALIGNMENT = 0x8 BPF_ALU = 0x4 BPF_AND = 0x50 BPF_B = 0x10 BPF_BUFMODE_BUFFER = 0x1 BPF_BUFMODE_ZBUF = 0x2 BPF_DIV = 0x30 BPF_H = 0x8 BPF_IMM = 0x0 BPF_IND = 0x40 BPF_JA = 0x0 BPF_JEQ = 0x10 BPF_JGE = 0x30 BPF_JGT = 0x20 BPF_JMP = 0x5 BPF_JSET = 0x40 BPF_K = 0x0 BPF_LD = 0x0 BPF_LDX = 0x1 BPF_LEN = 0x80 BPF_LSH = 0x60 BPF_MAJOR_VERSION = 0x1 BPF_MAXBUFSIZE = 0x80000 BPF_MAXINSNS = 0x200 BPF_MEM = 0x60 BPF_MEMWORDS = 0x10 BPF_MINBUFSIZE = 0x20 BPF_MINOR_VERSION = 0x1 BPF_MISC = 0x7 BPF_MOD = 0x90 BPF_MSH = 0xa0 BPF_MUL = 0x20 BPF_NEG = 0x80 BPF_OR = 0x40 BPF_RELEASE = 0x30bb6 BPF_RET = 0x6 BPF_RSH = 0x70 BPF_ST = 0x2 BPF_STX = 0x3 BPF_SUB = 0x10 BPF_TAX = 0x0 BPF_TXA = 0x80 BPF_T_BINTIME = 0x2 BPF_T_BINTIME_FAST = 0x102 BPF_T_BINTIME_MONOTONIC = 0x202 BPF_T_BINTIME_MONOTONIC_FAST = 0x302 BPF_T_FAST = 0x100 BPF_T_FLAG_MASK = 0x300 BPF_T_FORMAT_MASK = 0x3 BPF_T_MICROTIME = 0x0 BPF_T_MICROTIME_FAST = 0x100 BPF_T_MICROTIME_MONOTONIC = 0x200 BPF_T_MICROTIME_MONOTONIC_FAST = 0x300 BPF_T_MONOTONIC = 0x200 BPF_T_MONOTONIC_FAST = 0x300 BPF_T_NANOTIME = 0x1 BPF_T_NANOTIME_FAST = 0x101 BPF_T_NANOTIME_MONOTONIC = 0x201 BPF_T_NANOTIME_MONOTONIC_FAST = 0x301 BPF_T_NONE = 0x3 BPF_T_NORMAL = 0x0 BPF_W = 0x0 BPF_X = 0x8 BPF_XOR = 0xa0 BRKINT = 0x2 CAP_ACCEPT = 0x200000020000000 CAP_ACL_CHECK = 0x400000000010000 CAP_ACL_DELETE = 0x400000000020000 CAP_ACL_GET = 0x400000000040000 CAP_ACL_SET = 0x400000000080000 CAP_ALL0 = 0x20007ffffffffff CAP_ALL1 = 0x4000000001fffff CAP_BIND = 0x200000040000000 CAP_BINDAT = 0x200008000000400 CAP_CHFLAGSAT = 0x200000000001400 CAP_CONNECT = 0x200000080000000 CAP_CONNECTAT = 0x200010000000400 CAP_CREATE = 0x200000000000040 CAP_EVENT = 0x400000000000020 CAP_EXTATTR_DELETE = 0x400000000001000 CAP_EXTATTR_GET = 0x400000000002000 CAP_EXTATTR_LIST = 0x400000000004000 CAP_EXTATTR_SET = 0x400000000008000 CAP_FCHDIR = 0x200000000000800 CAP_FCHFLAGS = 0x200000000001000 CAP_FCHMOD = 0x200000000002000 CAP_FCHMODAT = 0x200000000002400 CAP_FCHOWN = 0x200000000004000 CAP_FCHOWNAT = 0x200000000004400 CAP_FCNTL = 0x200000000008000 CAP_FCNTL_ALL = 0x78 CAP_FCNTL_GETFL = 0x8 CAP_FCNTL_GETOWN = 0x20 CAP_FCNTL_SETFL = 0x10 CAP_FCNTL_SETOWN = 0x40 CAP_FEXECVE = 0x200000000000080 CAP_FLOCK = 0x200000000010000 CAP_FPATHCONF = 0x200000000020000 CAP_FSCK = 0x200000000040000 CAP_FSTAT = 0x200000000080000 CAP_FSTATAT = 0x200000000080400 CAP_FSTATFS = 0x200000000100000 CAP_FSYNC = 0x200000000000100 CAP_FTRUNCATE = 0x200000000000200 CAP_FUTIMES = 0x200000000200000 CAP_FUTIMESAT = 0x200000000200400 CAP_GETPEERNAME = 0x200000100000000 CAP_GETSOCKNAME = 0x200000200000000 CAP_GETSOCKOPT = 0x200000400000000 CAP_IOCTL = 0x400000000000080 CAP_IOCTLS_ALL = 0x7fffffffffffffff CAP_KQUEUE = 0x400000000100040 CAP_KQUEUE_CHANGE = 0x400000000100000 CAP_KQUEUE_EVENT = 0x400000000000040 CAP_LINKAT_SOURCE = 0x200020000000400 CAP_LINKAT_TARGET = 0x200000000400400 CAP_LISTEN = 0x200000800000000 CAP_LOOKUP = 0x200000000000400 CAP_MAC_GET = 0x400000000000001 CAP_MAC_SET = 0x400000000000002 CAP_MKDIRAT = 0x200000000800400 CAP_MKFIFOAT = 0x200000001000400 CAP_MKNODAT = 0x200000002000400 CAP_MMAP = 0x200000000000010 CAP_MMAP_R = 0x20000000000001d CAP_MMAP_RW = 0x20000000000001f CAP_MMAP_RWX = 0x20000000000003f CAP_MMAP_RX = 0x20000000000003d CAP_MMAP_W = 0x20000000000001e CAP_MMAP_WX = 0x20000000000003e CAP_MMAP_X = 0x20000000000003c CAP_PDGETPID = 0x400000000000200 CAP_PDKILL = 0x400000000000800 CAP_PDWAIT = 0x400000000000400 CAP_PEELOFF = 0x200001000000000 CAP_POLL_EVENT = 0x400000000000020 CAP_PREAD = 0x20000000000000d CAP_PWRITE = 0x20000000000000e CAP_READ = 0x200000000000001 CAP_RECV = 0x200000000000001 CAP_RENAMEAT_SOURCE = 0x200000004000400 CAP_RENAMEAT_TARGET = 0x200040000000400 CAP_RIGHTS_VERSION = 0x0 CAP_RIGHTS_VERSION_00 = 0x0 CAP_SEEK = 0x20000000000000c CAP_SEEK_TELL = 0x200000000000004 CAP_SEM_GETVALUE = 0x400000000000004 CAP_SEM_POST = 0x400000000000008 CAP_SEM_WAIT = 0x400000000000010 CAP_SEND = 0x200000000000002 CAP_SETSOCKOPT = 0x200002000000000 CAP_SHUTDOWN = 0x200004000000000 CAP_SOCK_CLIENT = 0x200007780000003 CAP_SOCK_SERVER = 0x200007f60000003 CAP_SYMLINKAT = 0x200000008000400 CAP_TTYHOOK = 0x400000000000100 CAP_UNLINKAT = 0x200000010000400 CAP_UNUSED0_44 = 0x200080000000000 CAP_UNUSED0_57 = 0x300000000000000 CAP_UNUSED1_22 = 0x400000000200000 CAP_UNUSED1_57 = 0x500000000000000 CAP_WRITE = 0x200000000000002 CFLUSH = 0xf CLOCAL = 0x8000 CLOCK_BOOTTIME = 0x5 CLOCK_MONOTONIC = 0x4 CLOCK_MONOTONIC_COARSE = 0xc CLOCK_MONOTONIC_FAST = 0xc CLOCK_MONOTONIC_PRECISE = 0xb CLOCK_PROCESS_CPUTIME_ID = 0xf CLOCK_PROF = 0x2 CLOCK_REALTIME = 0x0 CLOCK_REALTIME_COARSE = 0xa CLOCK_REALTIME_FAST = 0xa CLOCK_REALTIME_PRECISE = 0x9 CLOCK_SECOND = 0xd CLOCK_THREAD_CPUTIME_ID = 0xe CLOCK_UPTIME = 0x5 CLOCK_UPTIME_FAST = 0x8 CLOCK_UPTIME_PRECISE = 0x7 CLOCK_VIRTUAL = 0x1 CPUSTATES = 0x5 CP_IDLE = 0x4 CP_INTR = 0x3 CP_NICE = 0x1 CP_SYS = 0x2 CP_USER = 0x0 CREAD = 0x800 CRTSCTS = 0x30000 CS5 = 0x0 CS6 = 0x100 CS7 = 0x200 CS8 = 0x300 CSIZE = 0x300 CSTART = 0x11 CSTATUS = 0x14 CSTOP = 0x13 CSTOPB = 0x400 CSUSP = 0x1a CTL_HW = 0x6 CTL_KERN = 0x1 CTL_MAXNAME = 0x18 CTL_NET = 0x4 DIOCGATTR = 0xc148648e DIOCGDELETE = 0x80106488 DIOCGFLUSH = 0x20006487 DIOCGFWHEADS = 0x40046483 DIOCGFWSECTORS = 0x40046482 DIOCGIDENT = 0x41006489 DIOCGKERNELDUMP = 0xc0986492 DIOCGMEDIASIZE = 0x40086481 DIOCGPHYSPATH = 0x4400648d DIOCGPROVIDERNAME = 0x4400648a DIOCGSECTORSIZE = 0x40046480 DIOCGSTRIPEOFFSET = 0x4008648c DIOCGSTRIPESIZE = 0x4008648b DIOCSKERNELDUMP = 0x80986491 DIOCSKERNELDUMP_FREEBSD11 = 0x80046485 DIOCSKERNELDUMP_FREEBSD12 = 0x80506490 DIOCZONECMD = 0xc080648f DLT_A429 = 0xb8 DLT_A653_ICM = 0xb9 DLT_AIRONET_HEADER = 0x78 DLT_AOS = 0xde DLT_APPLE_IP_OVER_IEEE1394 = 0x8a DLT_ARCNET = 0x7 DLT_ARCNET_LINUX = 0x81 DLT_ATM_CLIP = 0x13 DLT_ATM_RFC1483 = 0xb DLT_AURORA = 0x7e DLT_AX25 = 0x3 DLT_AX25_KISS = 0xca DLT_BACNET_MS_TP = 0xa5 DLT_BLUETOOTH_BREDR_BB = 0xff DLT_BLUETOOTH_HCI_H4 = 0xbb DLT_BLUETOOTH_HCI_H4_WITH_PHDR = 0xc9 DLT_BLUETOOTH_LE_LL = 0xfb DLT_BLUETOOTH_LE_LL_WITH_PHDR = 0x100 DLT_BLUETOOTH_LINUX_MONITOR = 0xfe DLT_CAN20B = 0xbe DLT_CAN_SOCKETCAN = 0xe3 DLT_CHAOS = 0x5 DLT_CHDLC = 0x68 DLT_CISCO_IOS = 0x76 DLT_CLASS_NETBSD_RAWAF = 0x2240000 DLT_C_HDLC = 0x68 DLT_C_HDLC_WITH_DIR = 0xcd DLT_DBUS = 0xe7 DLT_DECT = 0xdd DLT_DISPLAYPORT_AUX = 0x113 DLT_DOCSIS = 0x8f DLT_DOCSIS31_XRA31 = 0x111 DLT_DVB_CI = 0xeb DLT_ECONET = 0x73 DLT_EN10MB = 0x1 DLT_EN3MB = 0x2 DLT_ENC = 0x6d DLT_EPON = 0x103 DLT_ERF = 0xc5 DLT_ERF_ETH = 0xaf DLT_ERF_POS = 0xb0 DLT_ETHERNET_MPACKET = 0x112 DLT_FC_2 = 0xe0 DLT_FC_2_WITH_FRAME_DELIMS = 0xe1 DLT_FDDI = 0xa DLT_FLEXRAY = 0xd2 DLT_FRELAY = 0x6b DLT_FRELAY_WITH_DIR = 0xce DLT_GCOM_SERIAL = 0xad DLT_GCOM_T1E1 = 0xac DLT_GPF_F = 0xab DLT_GPF_T = 0xaa DLT_GPRS_LLC = 0xa9 DLT_GSMTAP_ABIS = 0xda DLT_GSMTAP_UM = 0xd9 DLT_IBM_SN = 0x92 DLT_IBM_SP = 0x91 DLT_IEEE802 = 0x6 DLT_IEEE802_11 = 0x69 DLT_IEEE802_11_RADIO = 0x7f DLT_IEEE802_11_RADIO_AVS = 0xa3 DLT_IEEE802_15_4 = 0xc3 DLT_IEEE802_15_4_LINUX = 0xbf DLT_IEEE802_15_4_NOFCS = 0xe6 DLT_IEEE802_15_4_NONASK_PHY = 0xd7 DLT_IEEE802_16_MAC_CPS = 0xbc DLT_IEEE802_16_MAC_CPS_RADIO = 0xc1 DLT_INFINIBAND = 0xf7 DLT_IPFILTER = 0x74 DLT_IPMB_KONTRON = 0xc7 DLT_IPMB_LINUX = 0xd1 DLT_IPMI_HPM_2 = 0x104 DLT_IPNET = 0xe2 DLT_IPOIB = 0xf2 DLT_IPV4 = 0xe4 DLT_IPV6 = 0xe5 DLT_IP_OVER_FC = 0x7a DLT_ISO_14443 = 0x108 DLT_JUNIPER_ATM1 = 0x89 DLT_JUNIPER_ATM2 = 0x87 DLT_JUNIPER_ATM_CEMIC = 0xee DLT_JUNIPER_CHDLC = 0xb5 DLT_JUNIPER_ES = 0x84 DLT_JUNIPER_ETHER = 0xb2 DLT_JUNIPER_FIBRECHANNEL = 0xea DLT_JUNIPER_FRELAY = 0xb4 DLT_JUNIPER_GGSN = 0x85 DLT_JUNIPER_ISM = 0xc2 DLT_JUNIPER_MFR = 0x86 DLT_JUNIPER_MLFR = 0x83 DLT_JUNIPER_MLPPP = 0x82 DLT_JUNIPER_MONITOR = 0xa4 DLT_JUNIPER_PIC_PEER = 0xae DLT_JUNIPER_PPP = 0xb3 DLT_JUNIPER_PPPOE = 0xa7 DLT_JUNIPER_PPPOE_ATM = 0xa8 DLT_JUNIPER_SERVICES = 0x88 DLT_JUNIPER_SRX_E2E = 0xe9 DLT_JUNIPER_ST = 0xc8 DLT_JUNIPER_VP = 0xb7 DLT_JUNIPER_VS = 0xe8 DLT_LAPB_WITH_DIR = 0xcf DLT_LAPD = 0xcb DLT_LIN = 0xd4 DLT_LINUX_EVDEV = 0xd8 DLT_LINUX_IRDA = 0x90 DLT_LINUX_LAPD = 0xb1 DLT_LINUX_PPP_WITHDIRECTION = 0xa6 DLT_LINUX_SLL = 0x71 DLT_LINUX_SLL2 = 0x114 DLT_LOOP = 0x6c DLT_LORATAP = 0x10e DLT_LTALK = 0x72 DLT_MATCHING_MAX = 0x114 DLT_MATCHING_MIN = 0x68 DLT_MFR = 0xb6 DLT_MOST = 0xd3 DLT_MPEG_2_TS = 0xf3 DLT_MPLS = 0xdb DLT_MTP2 = 0x8c DLT_MTP2_WITH_PHDR = 0x8b DLT_MTP3 = 0x8d DLT_MUX27010 = 0xec DLT_NETANALYZER = 0xf0 DLT_NETANALYZER_TRANSPARENT = 0xf1 DLT_NETLINK = 0xfd DLT_NFC_LLCP = 0xf5 DLT_NFLOG = 0xef DLT_NG40 = 0xf4 DLT_NORDIC_BLE = 0x110 DLT_NULL = 0x0 DLT_OPENFLOW = 0x10b DLT_PCI_EXP = 0x7d DLT_PFLOG = 0x75 DLT_PFSYNC = 0x79 DLT_PKTAP = 0x102 DLT_PPI = 0xc0 DLT_PPP = 0x9 DLT_PPP_BSDOS = 0xe DLT_PPP_ETHER = 0x33 DLT_PPP_PPPD = 0xa6 DLT_PPP_SERIAL = 0x32 DLT_PPP_WITH_DIR = 0xcc DLT_PPP_WITH_DIRECTION = 0xa6 DLT_PRISM_HEADER = 0x77 DLT_PROFIBUS_DL = 0x101 DLT_PRONET = 0x4 DLT_RAIF1 = 0xc6 DLT_RAW = 0xc DLT_RDS = 0x109 DLT_REDBACK_SMARTEDGE = 0x20 DLT_RIO = 0x7c DLT_RTAC_SERIAL = 0xfa DLT_SCCP = 0x8e DLT_SCTP = 0xf8 DLT_SDLC = 0x10c DLT_SITA = 0xc4 DLT_SLIP = 0x8 DLT_SLIP_BSDOS = 0xd DLT_STANAG_5066_D_PDU = 0xed DLT_SUNATM = 0x7b DLT_SYMANTEC_FIREWALL = 0x63 DLT_TI_LLN_SNIFFER = 0x10d DLT_TZSP = 0x80 DLT_USB = 0xba DLT_USBPCAP = 0xf9 DLT_USB_DARWIN = 0x10a DLT_USB_FREEBSD = 0xba DLT_USB_LINUX = 0xbd DLT_USB_LINUX_MMAPPED = 0xdc DLT_USER0 = 0x93 DLT_USER1 = 0x94 DLT_USER10 = 0x9d DLT_USER11 = 0x9e DLT_USER12 = 0x9f DLT_USER13 = 0xa0 DLT_USER14 = 0xa1 DLT_USER15 = 0xa2 DLT_USER2 = 0x95 DLT_USER3 = 0x96 DLT_USER4 = 0x97 DLT_USER5 = 0x98 DLT_USER6 = 0x99 DLT_USER7 = 0x9a DLT_USER8 = 0x9b DLT_USER9 = 0x9c DLT_VSOCK = 0x10f DLT_WATTSTOPPER_DLM = 0x107 DLT_WIHART = 0xdf DLT_WIRESHARK_UPPER_PDU = 0xfc DLT_X2E_SERIAL = 0xd5 DLT_X2E_XORAYA = 0xd6 DLT_ZWAVE_R1_R2 = 0x105 DLT_ZWAVE_R3 = 0x106 DT_BLK = 0x6 DT_CHR = 0x2 DT_DIR = 0x4 DT_FIFO = 0x1 DT_LNK = 0xa DT_REG = 0x8 DT_SOCK = 0xc DT_UNKNOWN = 0x0 DT_WHT = 0xe ECHO = 0x8 ECHOCTL = 0x40 ECHOE = 0x2 ECHOK = 0x4 ECHOKE = 0x1 ECHONL = 0x10 ECHOPRT = 0x20 EHE_DEAD_PRIORITY = -0x1 EVFILT_AIO = -0x3 EVFILT_EMPTY = -0xd EVFILT_FS = -0x9 EVFILT_LIO = -0xa EVFILT_PROC = -0x5 EVFILT_PROCDESC = -0x8 EVFILT_READ = -0x1 EVFILT_SENDFILE = -0xc EVFILT_SIGNAL = -0x6 EVFILT_SYSCOUNT = 0xd EVFILT_TIMER = -0x7 EVFILT_USER = -0xb EVFILT_VNODE = -0x4 EVFILT_WRITE = -0x2 EVNAMEMAP_NAME_SIZE = 0x40 EV_ADD = 0x1 EV_CLEAR = 0x20 EV_DELETE = 0x2 EV_DISABLE = 0x8 EV_DISPATCH = 0x80 EV_DROP = 0x1000 EV_ENABLE = 0x4 EV_EOF = 0x8000 EV_ERROR = 0x4000 EV_FLAG1 = 0x2000 EV_FLAG2 = 0x4000 EV_FORCEONESHOT = 0x100 EV_ONESHOT = 0x10 EV_RECEIPT = 0x40 EV_SYSFLAGS = 0xf000 EXTA = 0x4b00 EXTATTR_MAXNAMELEN = 0xff EXTATTR_NAMESPACE_EMPTY = 0x0 EXTATTR_NAMESPACE_SYSTEM = 0x2 EXTATTR_NAMESPACE_USER = 0x1 EXTB = 0x9600 EXTPROC = 0x800 FD_CLOEXEC = 0x1 FD_NONE = -0xc8 FD_SETSIZE = 0x400 FLUSHO = 0x800000 F_ADD_SEALS = 0x13 F_CANCEL = 0x5 F_DUP2FD = 0xa F_DUP2FD_CLOEXEC = 0x12 F_DUPFD = 0x0 F_DUPFD_CLOEXEC = 0x11 F_GETFD = 0x1 F_GETFL = 0x3 F_GETLK = 0xb F_GETOWN = 0x5 F_GET_SEALS = 0x14 F_ISUNIONSTACK = 0x15 F_KINFO = 0x16 F_OGETLK = 0x7 F_OK = 0x0 F_OSETLK = 0x8 F_OSETLKW = 0x9 F_RDAHEAD = 0x10 F_RDLCK = 0x1 F_READAHEAD = 0xf F_SEAL_GROW = 0x4 F_SEAL_SEAL = 0x1 F_SEAL_SHRINK = 0x2 F_SEAL_WRITE = 0x8 F_SETFD = 0x2 F_SETFL = 0x4 F_SETLK = 0xc F_SETLKW = 0xd F_SETLK_REMOTE = 0xe F_SETOWN = 0x6 F_UNLCK = 0x2 F_UNLCKSYS = 0x4 F_WRLCK = 0x3 HUPCL = 0x4000 HW_MACHINE = 0x1 ICANON = 0x100 ICMP6_FILTER = 0x12 ICRNL = 0x100 IEXTEN = 0x400 IFAN_ARRIVAL = 0x0 IFAN_DEPARTURE = 0x1 IFCAP_WOL_MAGIC = 0x2000 IFF_ALLMULTI = 0x200 IFF_ALTPHYS = 0x4000 IFF_BROADCAST = 0x2 IFF_CANTCHANGE = 0x218f72 IFF_CANTCONFIG = 0x10000 IFF_DEBUG = 0x4 IFF_DRV_OACTIVE = 0x400 IFF_DRV_RUNNING = 0x40 IFF_DYING = 0x200000 IFF_KNOWSEPOCH = 0x20 IFF_LINK0 = 0x1000 IFF_LINK1 = 0x2000 IFF_LINK2 = 0x4000 IFF_LOOPBACK = 0x8 IFF_MONITOR = 0x40000 IFF_MULTICAST = 0x8000 IFF_NOARP = 0x80 IFF_NOGROUP = 0x800000 IFF_OACTIVE = 0x400 IFF_POINTOPOINT = 0x10 IFF_PPROMISC = 0x20000 IFF_PROMISC = 0x100 IFF_RENAMING = 0x400000 IFF_RUNNING = 0x40 IFF_SIMPLEX = 0x800 IFF_STATICARP = 0x80000 IFF_UP = 0x1 IFNAMSIZ = 0x10 IFT_BRIDGE = 0xd1 IFT_CARP = 0xf8 IFT_IEEE1394 = 0x90 IFT_INFINIBAND = 0xc7 IFT_L2VLAN = 0x87 IFT_L3IPVLAN = 0x88 IFT_PPP = 0x17 IFT_PROPVIRTUAL = 0x35 IGNBRK = 0x1 IGNCR = 0x80 IGNPAR = 0x4 IMAXBEL = 0x2000 INLCR = 0x40 INPCK = 0x10 IN_CLASSA_HOST = 0xffffff IN_CLASSA_MAX = 0x80 IN_CLASSA_NET = 0xff000000 IN_CLASSA_NSHIFT = 0x18 IN_CLASSB_HOST = 0xffff IN_CLASSB_MAX = 0x10000 IN_CLASSB_NET = 0xffff0000 IN_CLASSB_NSHIFT = 0x10 IN_CLASSC_HOST = 0xff IN_CLASSC_NET = 0xffffff00 IN_CLASSC_NSHIFT = 0x8 IN_CLASSD_HOST = 0xfffffff IN_CLASSD_NET = 0xf0000000 IN_CLASSD_NSHIFT = 0x1c IN_LOOPBACKNET = 0x7f IN_NETMASK_DEFAULT = 0xffffff00 IN_RFC3021_MASK = 0xfffffffe IPPROTO_3PC = 0x22 IPPROTO_ADFS = 0x44 IPPROTO_AH = 0x33 IPPROTO_AHIP = 0x3d IPPROTO_APES = 0x63 IPPROTO_ARGUS = 0xd IPPROTO_AX25 = 0x5d IPPROTO_BHA = 0x31 IPPROTO_BLT = 0x1e IPPROTO_BRSATMON = 0x4c IPPROTO_CARP = 0x70 IPPROTO_CFTP = 0x3e IPPROTO_CHAOS = 0x10 IPPROTO_CMTP = 0x26 IPPROTO_CPHB = 0x49 IPPROTO_CPNX = 0x48 IPPROTO_DCCP = 0x21 IPPROTO_DDP = 0x25 IPPROTO_DGP = 0x56 IPPROTO_DIVERT = 0x102 IPPROTO_DONE = 0x101 IPPROTO_DSTOPTS = 0x3c IPPROTO_EGP = 0x8 IPPROTO_EMCON = 0xe IPPROTO_ENCAP = 0x62 IPPROTO_EON = 0x50 IPPROTO_ESP = 0x32 IPPROTO_ETHERIP = 0x61 IPPROTO_FRAGMENT = 0x2c IPPROTO_GGP = 0x3 IPPROTO_GMTP = 0x64 IPPROTO_GRE = 0x2f IPPROTO_HELLO = 0x3f IPPROTO_HIP = 0x8b IPPROTO_HMP = 0x14 IPPROTO_HOPOPTS = 0x0 IPPROTO_ICMP = 0x1 IPPROTO_ICMPV6 = 0x3a IPPROTO_IDP = 0x16 IPPROTO_IDPR = 0x23 IPPROTO_IDRP = 0x2d IPPROTO_IGMP = 0x2 IPPROTO_IGP = 0x55 IPPROTO_IGRP = 0x58 IPPROTO_IL = 0x28 IPPROTO_INLSP = 0x34 IPPROTO_INP = 0x20 IPPROTO_IP = 0x0 IPPROTO_IPCOMP = 0x6c IPPROTO_IPCV = 0x47 IPPROTO_IPEIP = 0x5e IPPROTO_IPIP = 0x4 IPPROTO_IPPC = 0x43 IPPROTO_IPV4 = 0x4 IPPROTO_IPV6 = 0x29 IPPROTO_IRTP = 0x1c IPPROTO_KRYPTOLAN = 0x41 IPPROTO_LARP = 0x5b IPPROTO_LEAF1 = 0x19 IPPROTO_LEAF2 = 0x1a IPPROTO_MAX = 0x100 IPPROTO_MEAS = 0x13 IPPROTO_MH = 0x87 IPPROTO_MHRP = 0x30 IPPROTO_MICP = 0x5f IPPROTO_MOBILE = 0x37 IPPROTO_MPLS = 0x89 IPPROTO_MTP = 0x5c IPPROTO_MUX = 0x12 IPPROTO_ND = 0x4d IPPROTO_NHRP = 0x36 IPPROTO_NONE = 0x3b IPPROTO_NSP = 0x1f IPPROTO_NVPII = 0xb IPPROTO_OLD_DIVERT = 0xfe IPPROTO_OSPFIGP = 0x59 IPPROTO_PFSYNC = 0xf0 IPPROTO_PGM = 0x71 IPPROTO_PIGP = 0x9 IPPROTO_PIM = 0x67 IPPROTO_PRM = 0x15 IPPROTO_PUP = 0xc IPPROTO_PVP = 0x4b IPPROTO_RAW = 0xff IPPROTO_RCCMON = 0xa IPPROTO_RDP = 0x1b IPPROTO_RESERVED_253 = 0xfd IPPROTO_RESERVED_254 = 0xfe IPPROTO_ROUTING = 0x2b IPPROTO_RSVP = 0x2e IPPROTO_RVD = 0x42 IPPROTO_SATEXPAK = 0x40 IPPROTO_SATMON = 0x45 IPPROTO_SCCSP = 0x60 IPPROTO_SCTP = 0x84 IPPROTO_SDRP = 0x2a IPPROTO_SEND = 0x103 IPPROTO_SHIM6 = 0x8c IPPROTO_SKIP = 0x39 IPPROTO_SPACER = 0x7fff IPPROTO_SRPC = 0x5a IPPROTO_ST = 0x7 IPPROTO_SVMTP = 0x52 IPPROTO_SWIPE = 0x35 IPPROTO_TCF = 0x57 IPPROTO_TCP = 0x6 IPPROTO_TLSP = 0x38 IPPROTO_TP = 0x1d IPPROTO_TPXX = 0x27 IPPROTO_TRUNK1 = 0x17 IPPROTO_TRUNK2 = 0x18 IPPROTO_TTP = 0x54 IPPROTO_UDP = 0x11 IPPROTO_UDPLITE = 0x88 IPPROTO_VINES = 0x53 IPPROTO_VISA = 0x46 IPPROTO_VMTP = 0x51 IPPROTO_WBEXPAK = 0x4f IPPROTO_WBMON = 0x4e IPPROTO_WSN = 0x4a IPPROTO_XNET = 0xf IPPROTO_XTP = 0x24 IPV6_AUTOFLOWLABEL = 0x3b IPV6_BINDANY = 0x40 IPV6_BINDMULTI = 0x41 IPV6_BINDV6ONLY = 0x1b IPV6_CHECKSUM = 0x1a IPV6_DEFAULT_MULTICAST_HOPS = 0x1 IPV6_DEFAULT_MULTICAST_LOOP = 0x1 IPV6_DEFHLIM = 0x40 IPV6_DONTFRAG = 0x3e IPV6_DSTOPTS = 0x32 IPV6_FLOWID = 0x43 IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_LEN = 0x14 IPV6_FLOWLABEL_MASK = 0xffff0f00 IPV6_FLOWTYPE = 0x44 IPV6_FRAGTTL = 0x78 IPV6_FW_ADD = 0x1e IPV6_FW_DEL = 0x1f IPV6_FW_FLUSH = 0x20 IPV6_FW_GET = 0x22 IPV6_FW_ZERO = 0x21 IPV6_HLIMDEC = 0x1 IPV6_HOPLIMIT = 0x2f IPV6_HOPOPTS = 0x31 IPV6_IPSEC_POLICY = 0x1c IPV6_JOIN_GROUP = 0xc IPV6_LEAVE_GROUP = 0xd IPV6_MAXHLIM = 0xff IPV6_MAXOPTHDR = 0x800 IPV6_MAXPACKET = 0xffff IPV6_MAX_GROUP_SRC_FILTER = 0x200 IPV6_MAX_MEMBERSHIPS = 0xfff IPV6_MAX_SOCK_SRC_FILTER = 0x80 IPV6_MMTU = 0x500 IPV6_MSFILTER = 0x4a IPV6_MULTICAST_HOPS = 0xa IPV6_MULTICAST_IF = 0x9 IPV6_MULTICAST_LOOP = 0xb IPV6_NEXTHOP = 0x30 IPV6_ORIGDSTADDR = 0x48 IPV6_PATHMTU = 0x2c IPV6_PKTINFO = 0x2e IPV6_PORTRANGE = 0xe IPV6_PORTRANGE_DEFAULT = 0x0 IPV6_PORTRANGE_HIGH = 0x1 IPV6_PORTRANGE_LOW = 0x2 IPV6_PREFER_TEMPADDR = 0x3f IPV6_RECVDSTOPTS = 0x28 IPV6_RECVFLOWID = 0x46 IPV6_RECVHOPLIMIT = 0x25 IPV6_RECVHOPOPTS = 0x27 IPV6_RECVORIGDSTADDR = 0x48 IPV6_RECVPATHMTU = 0x2b IPV6_RECVPKTINFO = 0x24 IPV6_RECVRSSBUCKETID = 0x47 IPV6_RECVRTHDR = 0x26 IPV6_RECVTCLASS = 0x39 IPV6_RSSBUCKETID = 0x45 IPV6_RSS_LISTEN_BUCKET = 0x42 IPV6_RTHDR = 0x33 IPV6_RTHDRDSTOPTS = 0x23 IPV6_RTHDR_LOOSE = 0x0 IPV6_RTHDR_STRICT = 0x1 IPV6_RTHDR_TYPE_0 = 0x0 IPV6_SOCKOPT_RESERVED1 = 0x3 IPV6_TCLASS = 0x3d IPV6_UNICAST_HOPS = 0x4 IPV6_USE_MIN_MTU = 0x2a IPV6_V6ONLY = 0x1b IPV6_VERSION = 0x60 IPV6_VERSION_MASK = 0xf0 IPV6_VLAN_PCP = 0x4b IP_ADD_MEMBERSHIP = 0xc IP_ADD_SOURCE_MEMBERSHIP = 0x46 IP_BINDANY = 0x18 IP_BINDMULTI = 0x19 IP_BLOCK_SOURCE = 0x48 IP_DEFAULT_MULTICAST_LOOP = 0x1 IP_DEFAULT_MULTICAST_TTL = 0x1 IP_DF = 0x4000 IP_DONTFRAG = 0x43 IP_DROP_MEMBERSHIP = 0xd IP_DROP_SOURCE_MEMBERSHIP = 0x47 IP_DUMMYNET3 = 0x31 IP_DUMMYNET_CONFIGURE = 0x3c IP_DUMMYNET_DEL = 0x3d IP_DUMMYNET_FLUSH = 0x3e IP_DUMMYNET_GET = 0x40 IP_FLOWID = 0x5a IP_FLOWTYPE = 0x5b IP_FW3 = 0x30 IP_FW_ADD = 0x32 IP_FW_DEL = 0x33 IP_FW_FLUSH = 0x34 IP_FW_GET = 0x36 IP_FW_NAT_CFG = 0x38 IP_FW_NAT_DEL = 0x39 IP_FW_NAT_GET_CONFIG = 0x3a IP_FW_NAT_GET_LOG = 0x3b IP_FW_RESETLOG = 0x37 IP_FW_TABLE_ADD = 0x28 IP_FW_TABLE_DEL = 0x29 IP_FW_TABLE_FLUSH = 0x2a IP_FW_TABLE_GETSIZE = 0x2b IP_FW_TABLE_LIST = 0x2c IP_FW_ZERO = 0x35 IP_HDRINCL = 0x2 IP_IPSEC_POLICY = 0x15 IP_MAXPACKET = 0xffff IP_MAX_GROUP_SRC_FILTER = 0x200 IP_MAX_MEMBERSHIPS = 0xfff IP_MAX_SOCK_MUTE_FILTER = 0x80 IP_MAX_SOCK_SRC_FILTER = 0x80 IP_MF = 0x2000 IP_MINTTL = 0x42 IP_MSFILTER = 0x4a IP_MSS = 0x240 IP_MULTICAST_IF = 0x9 IP_MULTICAST_LOOP = 0xb IP_MULTICAST_TTL = 0xa IP_MULTICAST_VIF = 0xe IP_OFFMASK = 0x1fff IP_ONESBCAST = 0x17 IP_OPTIONS = 0x1 IP_ORIGDSTADDR = 0x1b IP_PORTRANGE = 0x13 IP_PORTRANGE_DEFAULT = 0x0 IP_PORTRANGE_HIGH = 0x1 IP_PORTRANGE_LOW = 0x2 IP_RECVDSTADDR = 0x7 IP_RECVFLOWID = 0x5d IP_RECVIF = 0x14 IP_RECVOPTS = 0x5 IP_RECVORIGDSTADDR = 0x1b IP_RECVRETOPTS = 0x6 IP_RECVRSSBUCKETID = 0x5e IP_RECVTOS = 0x44 IP_RECVTTL = 0x41 IP_RETOPTS = 0x8 IP_RF = 0x8000 IP_RSSBUCKETID = 0x5c IP_RSS_LISTEN_BUCKET = 0x1a IP_RSVP_OFF = 0x10 IP_RSVP_ON = 0xf IP_RSVP_VIF_OFF = 0x12 IP_RSVP_VIF_ON = 0x11 IP_SENDSRCADDR = 0x7 IP_TOS = 0x3 IP_TTL = 0x4 IP_UNBLOCK_SOURCE = 0x49 IP_VLAN_PCP = 0x4b ISIG = 0x80 ISTRIP = 0x20 ITIMER_PROF = 0x2 ITIMER_REAL = 0x0 ITIMER_VIRTUAL = 0x1 IXANY = 0x800 IXOFF = 0x400 IXON = 0x200 KERN_HOSTNAME = 0xa KERN_OSRELEASE = 0x2 KERN_OSTYPE = 0x1 KERN_VERSION = 0x4 LOCAL_CONNWAIT = 0x4 LOCAL_CREDS = 0x2 LOCAL_CREDS_PERSISTENT = 0x3 LOCAL_PEERCRED = 0x1 LOCAL_VENDOR = 0x80000000 LOCK_EX = 0x2 LOCK_NB = 0x4 LOCK_SH = 0x1 LOCK_UN = 0x8 MADV_AUTOSYNC = 0x7 MADV_CORE = 0x9 MADV_DONTNEED = 0x4 MADV_FREE = 0x5 MADV_NOCORE = 0x8 MADV_NORMAL = 0x0 MADV_NOSYNC = 0x6 MADV_PROTECT = 0xa MADV_RANDOM = 0x1 MADV_SEQUENTIAL = 0x2 MADV_WILLNEED = 0x3 MAP_32BIT = 0x80000 MAP_ALIGNED_SUPER = 0x1000000 MAP_ALIGNMENT_MASK = -0x1000000 MAP_ALIGNMENT_SHIFT = 0x18 MAP_ANON = 0x1000 MAP_ANONYMOUS = 0x1000 MAP_COPY = 0x2 MAP_EXCL = 0x4000 MAP_FILE = 0x0 MAP_FIXED = 0x10 MAP_GUARD = 0x2000 MAP_HASSEMAPHORE = 0x200 MAP_NOCORE = 0x20000 MAP_NOSYNC = 0x800 MAP_PREFAULT_READ = 0x40000 MAP_PRIVATE = 0x2 MAP_RESERVED0020 = 0x20 MAP_RESERVED0040 = 0x40 MAP_RESERVED0080 = 0x80 MAP_RESERVED0100 = 0x100 MAP_SHARED = 0x1 MAP_STACK = 0x400 MCAST_BLOCK_SOURCE = 0x54 MCAST_EXCLUDE = 0x2 MCAST_INCLUDE = 0x1 MCAST_JOIN_GROUP = 0x50 MCAST_JOIN_SOURCE_GROUP = 0x52 MCAST_LEAVE_GROUP = 0x51 MCAST_LEAVE_SOURCE_GROUP = 0x53 MCAST_UNBLOCK_SOURCE = 0x55 MCAST_UNDEFINED = 0x0 MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MFD_ALLOW_SEALING = 0x2 MFD_CLOEXEC = 0x1 MFD_HUGETLB = 0x4 MFD_HUGE_16GB = -0x78000000 MFD_HUGE_16MB = 0x60000000 MFD_HUGE_1GB = 0x78000000 MFD_HUGE_1MB = 0x50000000 MFD_HUGE_256MB = 0x70000000 MFD_HUGE_2GB = 0x7c000000 MFD_HUGE_2MB = 0x54000000 MFD_HUGE_32MB = 0x64000000 MFD_HUGE_512KB = 0x4c000000 MFD_HUGE_512MB = 0x74000000 MFD_HUGE_64KB = 0x40000000 MFD_HUGE_8MB = 0x5c000000 MFD_HUGE_MASK = 0xfc000000 MFD_HUGE_SHIFT = 0x1a MNT_ACLS = 0x8000000 MNT_ASYNC = 0x40 MNT_AUTOMOUNTED = 0x200000000 MNT_BYFSID = 0x8000000 MNT_CMDFLAGS = 0x300d0f0000 MNT_DEFEXPORTED = 0x200 MNT_DELEXPORT = 0x20000 MNT_EMPTYDIR = 0x2000000000 MNT_EXKERB = 0x800 MNT_EXPORTANON = 0x400 MNT_EXPORTED = 0x100 MNT_EXPUBLIC = 0x20000000 MNT_EXRDONLY = 0x80 MNT_EXTLS = 0x4000000000 MNT_EXTLSCERT = 0x8000000000 MNT_EXTLSCERTUSER = 0x10000000000 MNT_FORCE = 0x80000 MNT_GJOURNAL = 0x2000000 MNT_IGNORE = 0x800000 MNT_LAZY = 0x3 MNT_LOCAL = 0x1000 MNT_MULTILABEL = 0x4000000 MNT_NFS4ACLS = 0x10 MNT_NOATIME = 0x10000000 MNT_NOCLUSTERR = 0x40000000 MNT_NOCLUSTERW = 0x80000000 MNT_NOCOVER = 0x1000000000 MNT_NOEXEC = 0x4 MNT_NONBUSY = 0x4000000 MNT_NOSUID = 0x8 MNT_NOSYMFOLLOW = 0x400000 MNT_NOWAIT = 0x2 MNT_QUOTA = 0x2000 MNT_RDONLY = 0x1 MNT_RELOAD = 0x40000 MNT_ROOTFS = 0x4000 MNT_SNAPSHOT = 0x1000000 MNT_SOFTDEP = 0x200000 MNT_SUIDDIR = 0x100000 MNT_SUJ = 0x100000000 MNT_SUSPEND = 0x4 MNT_SYNCHRONOUS = 0x2 MNT_UNION = 0x20 MNT_UNTRUSTED = 0x800000000 MNT_UPDATE = 0x10000 MNT_UPDATEMASK = 0xad8d0807e MNT_USER = 0x8000 MNT_VERIFIED = 0x400000000 MNT_VISFLAGMASK = 0xffef0ffff MNT_WAIT = 0x1 MSG_CMSG_CLOEXEC = 0x40000 MSG_COMPAT = 0x8000 MSG_CTRUNC = 0x20 MSG_DONTROUTE = 0x4 MSG_DONTWAIT = 0x80 MSG_EOF = 0x100 MSG_EOR = 0x8 MSG_NBIO = 0x4000 MSG_NOSIGNAL = 0x20000 MSG_NOTIFICATION = 0x2000 MSG_OOB = 0x1 MSG_PEEK = 0x2 MSG_TRUNC = 0x10 MSG_WAITALL = 0x40 MSG_WAITFORONE = 0x80000 MS_ASYNC = 0x1 MS_INVALIDATE = 0x2 MS_SYNC = 0x0 NAME_MAX = 0xff NET_RT_DUMP = 0x1 NET_RT_FLAGS = 0x2 NET_RT_IFLIST = 0x3 NET_RT_IFLISTL = 0x5 NET_RT_IFMALIST = 0x4 NET_RT_NHGRP = 0x7 NET_RT_NHOP = 0x6 NFDBITS = 0x40 NOFLSH = 0x80000000 NOKERNINFO = 0x2000000 NOTE_ABSTIME = 0x10 NOTE_ATTRIB = 0x8 NOTE_CHILD = 0x4 NOTE_CLOSE = 0x100 NOTE_CLOSE_WRITE = 0x200 NOTE_DELETE = 0x1 NOTE_EXEC = 0x20000000 NOTE_EXIT = 0x80000000 NOTE_EXTEND = 0x4 NOTE_FFAND = 0x40000000 NOTE_FFCOPY = 0xc0000000 NOTE_FFCTRLMASK = 0xc0000000 NOTE_FFLAGSMASK = 0xffffff NOTE_FFNOP = 0x0 NOTE_FFOR = 0x80000000 NOTE_FILE_POLL = 0x2 NOTE_FORK = 0x40000000 NOTE_LINK = 0x10 NOTE_LOWAT = 0x1 NOTE_MSECONDS = 0x2 NOTE_NSECONDS = 0x8 NOTE_OPEN = 0x80 NOTE_PCTRLMASK = 0xf0000000 NOTE_PDATAMASK = 0xfffff NOTE_READ = 0x400 NOTE_RENAME = 0x20 NOTE_REVOKE = 0x40 NOTE_SECONDS = 0x1 NOTE_TRACK = 0x1 NOTE_TRACKERR = 0x2 NOTE_TRIGGER = 0x1000000 NOTE_USECONDS = 0x4 NOTE_WRITE = 0x2 OCRNL = 0x10 ONLCR = 0x2 ONLRET = 0x40 ONOCR = 0x20 ONOEOT = 0x8 OPOST = 0x1 OXTABS = 0x4 O_ACCMODE = 0x3 O_APPEND = 0x8 O_ASYNC = 0x40 O_CLOEXEC = 0x100000 O_CREAT = 0x200 O_DIRECT = 0x10000 O_DIRECTORY = 0x20000 O_DSYNC = 0x1000000 O_EMPTY_PATH = 0x2000000 O_EXCL = 0x800 O_EXEC = 0x40000 O_EXLOCK = 0x20 O_FSYNC = 0x80 O_NDELAY = 0x4 O_NOCTTY = 0x8000 O_NOFOLLOW = 0x100 O_NONBLOCK = 0x4 O_PATH = 0x400000 O_RDONLY = 0x0 O_RDWR = 0x2 O_RESOLVE_BENEATH = 0x800000 O_SEARCH = 0x40000 O_SHLOCK = 0x10 O_SYNC = 0x80 O_TRUNC = 0x400 O_TTY_INIT = 0x80000 O_VERIFY = 0x200000 O_WRONLY = 0x1 PARENB = 0x1000 PARMRK = 0x8 PARODD = 0x2000 PENDIN = 0x20000000 PIOD_READ_D = 0x1 PIOD_READ_I = 0x3 PIOD_WRITE_D = 0x2 PIOD_WRITE_I = 0x4 PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 PROT_EXEC = 0x4 PROT_NONE = 0x0 PROT_READ = 0x1 PROT_WRITE = 0x2 PTRACE_DEFAULT = 0x1 PTRACE_EXEC = 0x1 PTRACE_FORK = 0x8 PTRACE_LWP = 0x10 PTRACE_SCE = 0x2 PTRACE_SCX = 0x4 PTRACE_SYSCALL = 0x6 PTRACE_VFORK = 0x20 PT_ATTACH = 0xa PT_CLEARSTEP = 0x10 PT_CONTINUE = 0x7 PT_COREDUMP = 0x1d PT_DETACH = 0xb PT_FIRSTMACH = 0x40 PT_FOLLOW_FORK = 0x17 PT_GETDBREGS = 0x25 PT_GETFPREGS = 0x23 PT_GETLWPLIST = 0xf PT_GETNUMLWPS = 0xe PT_GETREGS = 0x21 PT_GET_EVENT_MASK = 0x19 PT_GET_SC_ARGS = 0x1b PT_GET_SC_RET = 0x1c PT_IO = 0xc PT_KILL = 0x8 PT_LWPINFO = 0xd PT_LWP_EVENTS = 0x18 PT_READ_D = 0x2 PT_READ_I = 0x1 PT_RESUME = 0x13 PT_SETDBREGS = 0x26 PT_SETFPREGS = 0x24 PT_SETREGS = 0x22 PT_SETSTEP = 0x11 PT_SET_EVENT_MASK = 0x1a PT_STEP = 0x9 PT_SUSPEND = 0x12 PT_SYSCALL = 0x16 PT_TO_SCE = 0x14 PT_TO_SCX = 0x15 PT_TRACE_ME = 0x0 PT_VM_ENTRY = 0x29 PT_VM_TIMESTAMP = 0x28 PT_WRITE_D = 0x5 PT_WRITE_I = 0x4 P_ZONEID = 0xc RLIMIT_AS = 0xa RLIMIT_CORE = 0x4 RLIMIT_CPU = 0x0 RLIMIT_DATA = 0x2 RLIMIT_FSIZE = 0x1 RLIMIT_MEMLOCK = 0x6 RLIMIT_NOFILE = 0x8 RLIMIT_NPROC = 0x7 RLIMIT_RSS = 0x5 RLIMIT_STACK = 0x3 RLIM_INFINITY = 0x7fffffffffffffff RTAX_AUTHOR = 0x6 RTAX_BRD = 0x7 RTAX_DST = 0x0 RTAX_GATEWAY = 0x1 RTAX_GENMASK = 0x3 RTAX_IFA = 0x5 RTAX_IFP = 0x4 RTAX_MAX = 0x8 RTAX_NETMASK = 0x2 RTA_AUTHOR = 0x40 RTA_BRD = 0x80 RTA_DST = 0x1 RTA_GATEWAY = 0x2 RTA_GENMASK = 0x8 RTA_IFA = 0x20 RTA_IFP = 0x10 RTA_NETMASK = 0x4 RTF_BLACKHOLE = 0x1000 RTF_BROADCAST = 0x400000 RTF_DONE = 0x40 RTF_DYNAMIC = 0x10 RTF_FIXEDMTU = 0x80000 RTF_FMASK = 0x1004d808 RTF_GATEWAY = 0x2 RTF_GWFLAG_COMPAT = 0x80000000 RTF_HOST = 0x4 RTF_LLDATA = 0x400 RTF_LLINFO = 0x400 RTF_LOCAL = 0x200000 RTF_MODIFIED = 0x20 RTF_MULTICAST = 0x800000 RTF_PINNED = 0x100000 RTF_PROTO1 = 0x8000 RTF_PROTO2 = 0x4000 RTF_PROTO3 = 0x40000 RTF_REJECT = 0x8 RTF_STATIC = 0x800 RTF_STICKY = 0x10000000 RTF_UP = 0x1 RTF_XRESOLVE = 0x200 RTM_ADD = 0x1 RTM_CHANGE = 0x3 RTM_DELADDR = 0xd RTM_DELETE = 0x2 RTM_DELMADDR = 0x10 RTM_GET = 0x4 RTM_IEEE80211 = 0x12 RTM_IFANNOUNCE = 0x11 RTM_IFINFO = 0xe RTM_LOCK = 0x8 RTM_LOSING = 0x5 RTM_MISS = 0x7 RTM_NEWADDR = 0xc RTM_NEWMADDR = 0xf RTM_REDIRECT = 0x6 RTM_RESOLVE = 0xb RTM_RTTUNIT = 0xf4240 RTM_VERSION = 0x5 RTV_EXPIRE = 0x4 RTV_HOPCOUNT = 0x2 RTV_MTU = 0x1 RTV_RPIPE = 0x8 RTV_RTT = 0x40 RTV_RTTVAR = 0x80 RTV_SPIPE = 0x10 RTV_SSTHRESH = 0x20 RTV_WEIGHT = 0x100 RT_ALL_FIBS = -0x1 RT_BLACKHOLE = 0x40 RT_DEFAULT_FIB = 0x0 RT_DEFAULT_WEIGHT = 0x1 RT_HAS_GW = 0x80 RT_HAS_HEADER = 0x10 RT_HAS_HEADER_BIT = 0x4 RT_L2_ME = 0x4 RT_L2_ME_BIT = 0x2 RT_LLE_CACHE = 0x100 RT_MAX_WEIGHT = 0xffffff RT_MAY_LOOP = 0x8 RT_MAY_LOOP_BIT = 0x3 RT_REJECT = 0x20 RUSAGE_CHILDREN = -0x1 RUSAGE_SELF = 0x0 RUSAGE_THREAD = 0x1 SCM_BINTIME = 0x4 SCM_CREDS = 0x3 SCM_CREDS2 = 0x8 SCM_MONOTONIC = 0x6 SCM_REALTIME = 0x5 SCM_RIGHTS = 0x1 SCM_TIMESTAMP = 0x2 SCM_TIME_INFO = 0x7 SEEK_CUR = 0x1 SEEK_DATA = 0x3 SEEK_END = 0x2 SEEK_HOLE = 0x4 SEEK_SET = 0x0 SHUT_RD = 0x0 SHUT_RDWR = 0x2 SHUT_WR = 0x1 SIOCADDMULTI = 0x80206931 SIOCAIFADDR = 0x8040691a SIOCAIFGROUP = 0x80286987 SIOCATMARK = 0x40047307 SIOCDELMULTI = 0x80206932 SIOCDIFADDR = 0x80206919 SIOCDIFGROUP = 0x80286989 SIOCDIFPHYADDR = 0x80206949 SIOCGDRVSPEC = 0xc028697b SIOCGETSGCNT = 0xc0207210 SIOCGETVIFCNT = 0xc028720f SIOCGHIWAT = 0x40047301 SIOCGHWADDR = 0xc020693e SIOCGI2C = 0xc020693d SIOCGIFADDR = 0xc0206921 SIOCGIFALIAS = 0xc044692d SIOCGIFBRDADDR = 0xc0206923 SIOCGIFCAP = 0xc020691f SIOCGIFCONF = 0xc0106924 SIOCGIFDATA = 0x8020692c SIOCGIFDESCR = 0xc020692a SIOCGIFDOWNREASON = 0xc058699a SIOCGIFDSTADDR = 0xc0206922 SIOCGIFFIB = 0xc020695c SIOCGIFFLAGS = 0xc0206911 SIOCGIFGENERIC = 0xc020693a SIOCGIFGMEMB = 0xc028698a SIOCGIFGROUP = 0xc0286988 SIOCGIFINDEX = 0xc0206920 SIOCGIFMAC = 0xc0206926 SIOCGIFMEDIA = 0xc0306938 SIOCGIFMETRIC = 0xc0206917 SIOCGIFMTU = 0xc0206933 SIOCGIFNETMASK = 0xc0206925 SIOCGIFPDSTADDR = 0xc0206948 SIOCGIFPHYS = 0xc0206935 SIOCGIFPSRCADDR = 0xc0206947 SIOCGIFRSSHASH = 0xc0186997 SIOCGIFRSSKEY = 0xc0946996 SIOCGIFSTATUS = 0xc331693b SIOCGIFXMEDIA = 0xc030698b SIOCGLANPCP = 0xc0206998 SIOCGLOWAT = 0x40047303 SIOCGPGRP = 0x40047309 SIOCGPRIVATE_0 = 0xc0206950 SIOCGPRIVATE_1 = 0xc0206951 SIOCGTUNFIB = 0xc020695e SIOCIFCREATE = 0xc020697a SIOCIFCREATE2 = 0xc020697c SIOCIFDESTROY = 0x80206979 SIOCIFGCLONERS = 0xc0106978 SIOCSDRVSPEC = 0x8028697b SIOCSHIWAT = 0x80047300 SIOCSIFADDR = 0x8020690c SIOCSIFBRDADDR = 0x80206913 SIOCSIFCAP = 0x8020691e SIOCSIFDESCR = 0x80206929 SIOCSIFDSTADDR = 0x8020690e SIOCSIFFIB = 0x8020695d SIOCSIFFLAGS = 0x80206910 SIOCSIFGENERIC = 0x80206939 SIOCSIFLLADDR = 0x8020693c SIOCSIFMAC = 0x80206927 SIOCSIFMEDIA = 0xc0206937 SIOCSIFMETRIC = 0x80206918 SIOCSIFMTU = 0x80206934 SIOCSIFNAME = 0x80206928 SIOCSIFNETMASK = 0x80206916 SIOCSIFPHYADDR = 0x80406946 SIOCSIFPHYS = 0x80206936 SIOCSIFRVNET = 0xc020695b SIOCSIFVNET = 0xc020695a SIOCSLANPCP = 0x80206999 SIOCSLOWAT = 0x80047302 SIOCSPGRP = 0x80047308 SIOCSTUNFIB = 0x8020695f SOCK_CLOEXEC = 0x10000000 SOCK_DGRAM = 0x2 SOCK_MAXADDRLEN = 0xff SOCK_NONBLOCK = 0x20000000 SOCK_RAW = 0x3 SOCK_RDM = 0x4 SOCK_SEQPACKET = 0x5 SOCK_STREAM = 0x1 SOL_LOCAL = 0x0 SOL_SOCKET = 0xffff SOMAXCONN = 0x80 SO_ACCEPTCONN = 0x2 SO_ACCEPTFILTER = 0x1000 SO_BINTIME = 0x2000 SO_BROADCAST = 0x20 SO_DEBUG = 0x1 SO_DOMAIN = 0x1019 SO_DONTROUTE = 0x10 SO_ERROR = 0x1007 SO_KEEPALIVE = 0x8 SO_LABEL = 0x1009 SO_LINGER = 0x80 SO_LISTENINCQLEN = 0x1013 SO_LISTENQLEN = 0x1012 SO_LISTENQLIMIT = 0x1011 SO_MAX_PACING_RATE = 0x1018 SO_NOSIGPIPE = 0x800 SO_NO_DDP = 0x8000 SO_NO_OFFLOAD = 0x4000 SO_OOBINLINE = 0x100 SO_PEERLABEL = 0x1010 SO_PROTOCOL = 0x1016 SO_PROTOTYPE = 0x1016 SO_RCVBUF = 0x1002 SO_RCVLOWAT = 0x1004 SO_RCVTIMEO = 0x1006 SO_RERROR = 0x20000 SO_REUSEADDR = 0x4 SO_REUSEPORT = 0x200 SO_REUSEPORT_LB = 0x10000 SO_SETFIB = 0x1014 SO_SNDBUF = 0x1001 SO_SNDLOWAT = 0x1003 SO_SNDTIMEO = 0x1005 SO_TIMESTAMP = 0x400 SO_TS_BINTIME = 0x1 SO_TS_CLOCK = 0x1017 SO_TS_CLOCK_MAX = 0x3 SO_TS_DEFAULT = 0x0 SO_TS_MONOTONIC = 0x3 SO_TS_REALTIME = 0x2 SO_TS_REALTIME_MICRO = 0x0 SO_TYPE = 0x1008 SO_USELOOPBACK = 0x40 SO_USER_COOKIE = 0x1015 SO_VENDOR = 0x80000000 S_BLKSIZE = 0x200 S_IEXEC = 0x40 S_IFBLK = 0x6000 S_IFCHR = 0x2000 S_IFDIR = 0x4000 S_IFIFO = 0x1000 S_IFLNK = 0xa000 S_IFMT = 0xf000 S_IFREG = 0x8000 S_IFSOCK = 0xc000 S_IFWHT = 0xe000 S_IREAD = 0x100 S_IRGRP = 0x20 S_IROTH = 0x4 S_IRUSR = 0x100 S_IRWXG = 0x38 S_IRWXO = 0x7 S_IRWXU = 0x1c0 S_ISGID = 0x400 S_ISTXT = 0x200 S_ISUID = 0x800 S_ISVTX = 0x200 S_IWGRP = 0x10 S_IWOTH = 0x2 S_IWRITE = 0x80 S_IWUSR = 0x80 S_IXGRP = 0x8 S_IXOTH = 0x1 S_IXUSR = 0x40 TAB0 = 0x0 TAB3 = 0x4 TABDLY = 0x4 TCIFLUSH = 0x1 TCIOFF = 0x3 TCIOFLUSH = 0x3 TCION = 0x4 TCOFLUSH = 0x2 TCOOFF = 0x1 TCOON = 0x2 TCPOPT_EOL = 0x0 TCPOPT_FAST_OPEN = 0x22 TCPOPT_MAXSEG = 0x2 TCPOPT_NOP = 0x1 TCPOPT_PAD = 0x0 TCPOPT_SACK = 0x5 TCPOPT_SACK_PERMITTED = 0x4 TCPOPT_SIGNATURE = 0x13 TCPOPT_TIMESTAMP = 0x8 TCPOPT_WINDOW = 0x3 TCP_BBR_ACK_COMP_ALG = 0x448 TCP_BBR_ALGORITHM = 0x43b TCP_BBR_DRAIN_INC_EXTRA = 0x43c TCP_BBR_DRAIN_PG = 0x42e TCP_BBR_EXTRA_GAIN = 0x449 TCP_BBR_EXTRA_STATE = 0x453 TCP_BBR_FLOOR_MIN_TSO = 0x454 TCP_BBR_HDWR_PACE = 0x451 TCP_BBR_HOLD_TARGET = 0x436 TCP_BBR_IWINTSO = 0x42b TCP_BBR_LOWGAIN_FD = 0x436 TCP_BBR_LOWGAIN_HALF = 0x435 TCP_BBR_LOWGAIN_THRESH = 0x434 TCP_BBR_MAX_RTO = 0x439 TCP_BBR_MIN_RTO = 0x438 TCP_BBR_MIN_TOPACEOUT = 0x455 TCP_BBR_ONE_RETRAN = 0x431 TCP_BBR_PACE_CROSS = 0x442 TCP_BBR_PACE_DEL_TAR = 0x43f TCP_BBR_PACE_OH = 0x435 TCP_BBR_PACE_PER_SEC = 0x43e TCP_BBR_PACE_SEG_MAX = 0x440 TCP_BBR_PACE_SEG_MIN = 0x441 TCP_BBR_POLICER_DETECT = 0x457 TCP_BBR_PROBE_RTT_GAIN = 0x44d TCP_BBR_PROBE_RTT_INT = 0x430 TCP_BBR_PROBE_RTT_LEN = 0x44e TCP_BBR_RACK_INIT_RATE = 0x458 TCP_BBR_RACK_RTT_USE = 0x44a TCP_BBR_RECFORCE = 0x42c TCP_BBR_REC_OVER_HPTS = 0x43a TCP_BBR_RETRAN_WTSO = 0x44b TCP_BBR_RWND_IS_APP = 0x42f TCP_BBR_SEND_IWND_IN_TSO = 0x44f TCP_BBR_STARTUP_EXIT_EPOCH = 0x43d TCP_BBR_STARTUP_LOSS_EXIT = 0x432 TCP_BBR_STARTUP_PG = 0x42d TCP_BBR_TMR_PACE_OH = 0x448 TCP_BBR_TSLIMITS = 0x434 TCP_BBR_TSTMP_RAISES = 0x456 TCP_BBR_UNLIMITED = 0x43b TCP_BBR_USEDEL_RATE = 0x437 TCP_BBR_USE_LOWGAIN = 0x433 TCP_BBR_USE_RACK_CHEAT = 0x450 TCP_BBR_USE_RACK_RR = 0x450 TCP_BBR_UTTER_MAX_TSO = 0x452 TCP_CA_NAME_MAX = 0x10 TCP_CCALGOOPT = 0x41 TCP_CONGESTION = 0x40 TCP_DATA_AFTER_CLOSE = 0x44c TCP_DEFER_OPTIONS = 0x470 TCP_DELACK = 0x48 TCP_FASTOPEN = 0x401 TCP_FASTOPEN_MAX_COOKIE_LEN = 0x10 TCP_FASTOPEN_MIN_COOKIE_LEN = 0x4 TCP_FASTOPEN_PSK_LEN = 0x10 TCP_FAST_RSM_HACK = 0x471 TCP_FIN_IS_RST = 0x49 TCP_FUNCTION_BLK = 0x2000 TCP_FUNCTION_NAME_LEN_MAX = 0x20 TCP_HDWR_RATE_CAP = 0x46a TCP_HDWR_UP_ONLY = 0x46c TCP_IDLE_REDUCE = 0x46 TCP_INFO = 0x20 TCP_IWND_NB = 0x2b TCP_IWND_NSEG = 0x2c TCP_KEEPCNT = 0x400 TCP_KEEPIDLE = 0x100 TCP_KEEPINIT = 0x80 TCP_KEEPINTVL = 0x200 TCP_LOG = 0x22 TCP_LOGBUF = 0x23 TCP_LOGDUMP = 0x25 TCP_LOGDUMPID = 0x26 TCP_LOGID = 0x24 TCP_LOGID_CNT = 0x2e TCP_LOG_ID_LEN = 0x40 TCP_LOG_LIMIT = 0x4a TCP_LOG_TAG = 0x2f TCP_MAXBURST = 0x4 TCP_MAXHLEN = 0x3c TCP_MAXOLEN = 0x28 TCP_MAXPEAKRATE = 0x45 TCP_MAXSEG = 0x2 TCP_MAXUNACKTIME = 0x44 TCP_MAXWIN = 0xffff TCP_MAX_SACK = 0x4 TCP_MAX_WINSHIFT = 0xe TCP_MD5SIG = 0x10 TCP_MINMSS = 0xd8 TCP_MSS = 0x218 TCP_NODELAY = 0x1 TCP_NOOPT = 0x8 TCP_NOPUSH = 0x4 TCP_NO_PRR = 0x462 TCP_PACING_RATE_CAP = 0x46b TCP_PCAP_IN = 0x1000 TCP_PCAP_OUT = 0x800 TCP_PERF_INFO = 0x4e TCP_PROC_ACCOUNTING = 0x4c TCP_RACK_ABC_VAL = 0x46d TCP_RACK_CHEAT_NOT_CONF_RATE = 0x459 TCP_RACK_DO_DETECTION = 0x449 TCP_RACK_EARLY_RECOV = 0x423 TCP_RACK_EARLY_SEG = 0x424 TCP_RACK_FORCE_MSEG = 0x45d TCP_RACK_GP_INCREASE = 0x446 TCP_RACK_GP_INCREASE_CA = 0x45a TCP_RACK_GP_INCREASE_REC = 0x45c TCP_RACK_GP_INCREASE_SS = 0x45b TCP_RACK_IDLE_REDUCE_HIGH = 0x444 TCP_RACK_MBUF_QUEUE = 0x41a TCP_RACK_MEASURE_CNT = 0x46f TCP_RACK_MIN_PACE = 0x445 TCP_RACK_MIN_PACE_SEG = 0x446 TCP_RACK_MIN_TO = 0x422 TCP_RACK_NONRXT_CFG_RATE = 0x463 TCP_RACK_NO_PUSH_AT_MAX = 0x466 TCP_RACK_PACE_ALWAYS = 0x41f TCP_RACK_PACE_MAX_SEG = 0x41e TCP_RACK_PACE_RATE_CA = 0x45e TCP_RACK_PACE_RATE_REC = 0x460 TCP_RACK_PACE_RATE_SS = 0x45f TCP_RACK_PACE_REDUCE = 0x41d TCP_RACK_PACE_TO_FILL = 0x467 TCP_RACK_PACING_BETA = 0x472 TCP_RACK_PACING_BETA_ECN = 0x473 TCP_RACK_PKT_DELAY = 0x428 TCP_RACK_PROFILE = 0x469 TCP_RACK_PROP = 0x41b TCP_RACK_PROP_RATE = 0x420 TCP_RACK_PRR_SENDALOT = 0x421 TCP_RACK_REORD_FADE = 0x426 TCP_RACK_REORD_THRESH = 0x425 TCP_RACK_RR_CONF = 0x459 TCP_RACK_TIMER_SLOP = 0x474 TCP_RACK_TLP_INC_VAR = 0x429 TCP_RACK_TLP_REDUCE = 0x41c TCP_RACK_TLP_THRESH = 0x427 TCP_RACK_TLP_USE = 0x447 TCP_REC_ABC_VAL = 0x46e TCP_REMOTE_UDP_ENCAPS_PORT = 0x47 TCP_REUSPORT_LB_NUMA = 0x402 TCP_REUSPORT_LB_NUMA_CURDOM = -0x1 TCP_REUSPORT_LB_NUMA_NODOM = -0x2 TCP_RXTLS_ENABLE = 0x29 TCP_RXTLS_MODE = 0x2a TCP_SHARED_CWND_ALLOWED = 0x4b TCP_SHARED_CWND_ENABLE = 0x464 TCP_SHARED_CWND_TIME_LIMIT = 0x468 TCP_STATS = 0x21 TCP_TIMELY_DYN_ADJ = 0x465 TCP_TLS_MODE_IFNET = 0x2 TCP_TLS_MODE_NONE = 0x0 TCP_TLS_MODE_SW = 0x1 TCP_TLS_MODE_TOE = 0x3 TCP_TXTLS_ENABLE = 0x27 TCP_TXTLS_MODE = 0x28 TCP_USER_LOG = 0x30 TCP_USE_CMP_ACKS = 0x4d TCP_VENDOR = 0x80000000 TCSAFLUSH = 0x2 TIMER_ABSTIME = 0x1 TIMER_RELTIME = 0x0 TIOCCBRK = 0x2000747a TIOCCDTR = 0x20007478 TIOCCONS = 0x80047462 TIOCDRAIN = 0x2000745e TIOCEXCL = 0x2000740d TIOCEXT = 0x80047460 TIOCFLUSH = 0x80047410 TIOCGDRAINWAIT = 0x40047456 TIOCGETA = 0x402c7413 TIOCGETD = 0x4004741a TIOCGPGRP = 0x40047477 TIOCGPTN = 0x4004740f TIOCGSID = 0x40047463 TIOCGWINSZ = 0x40087468 TIOCMBIC = 0x8004746b TIOCMBIS = 0x8004746c TIOCMGDTRWAIT = 0x4004745a TIOCMGET = 0x4004746a TIOCMSDTRWAIT = 0x8004745b TIOCMSET = 0x8004746d TIOCM_CAR = 0x40 TIOCM_CD = 0x40 TIOCM_CTS = 0x20 TIOCM_DCD = 0x40 TIOCM_DSR = 0x100 TIOCM_DTR = 0x2 TIOCM_LE = 0x1 TIOCM_RI = 0x80 TIOCM_RNG = 0x80 TIOCM_RTS = 0x4 TIOCM_SR = 0x10 TIOCM_ST = 0x8 TIOCNOTTY = 0x20007471 TIOCNXCL = 0x2000740e TIOCOUTQ = 0x40047473 TIOCPKT = 0x80047470 TIOCPKT_DATA = 0x0 TIOCPKT_DOSTOP = 0x20 TIOCPKT_FLUSHREAD = 0x1 TIOCPKT_FLUSHWRITE = 0x2 TIOCPKT_IOCTL = 0x40 TIOCPKT_NOSTOP = 0x10 TIOCPKT_START = 0x8 TIOCPKT_STOP = 0x4 TIOCPTMASTER = 0x2000741c TIOCSBRK = 0x2000747b TIOCSCTTY = 0x20007461 TIOCSDRAINWAIT = 0x80047457 TIOCSDTR = 0x20007479 TIOCSETA = 0x802c7414 TIOCSETAF = 0x802c7416 TIOCSETAW = 0x802c7415 TIOCSETD = 0x8004741b TIOCSIG = 0x2004745f TIOCSPGRP = 0x80047476 TIOCSTART = 0x2000746e TIOCSTAT = 0x20007465 TIOCSTI = 0x80017472 TIOCSTOP = 0x2000746f TIOCSWINSZ = 0x80087467 TIOCTIMESTAMP = 0x40107459 TIOCUCNTL = 0x80047466 TOSTOP = 0x400000 UTIME_NOW = -0x1 UTIME_OMIT = -0x2 VDISCARD = 0xf VDSUSP = 0xb VEOF = 0x0 VEOL = 0x1 VEOL2 = 0x2 VERASE = 0x3 VERASE2 = 0x7 VINTR = 0x8 VKILL = 0x5 VLNEXT = 0xe VMIN = 0x10 VQUIT = 0x9 VREPRINT = 0x6 VSTART = 0xc VSTATUS = 0x12 VSTOP = 0xd VSUSP = 0xa VTIME = 0x11 VWERASE = 0x4 WCONTINUED = 0x4 WCOREFLAG = 0x80 WEXITED = 0x10 WLINUXCLONE = 0x80000000 WNOHANG = 0x1 WNOWAIT = 0x8 WSTOPPED = 0x2 WTRAPPED = 0x20 WUNTRACED = 0x2 ) // Errors const ( E2BIG = syscall.Errno(0x7) EACCES = syscall.Errno(0xd) EADDRINUSE = syscall.Errno(0x30) EADDRNOTAVAIL = syscall.Errno(0x31) EAFNOSUPPORT = syscall.Errno(0x2f) EAGAIN = syscall.Errno(0x23) EALREADY = syscall.Errno(0x25) EAUTH = syscall.Errno(0x50) EBADF = syscall.Errno(0x9) EBADMSG = syscall.Errno(0x59) EBADRPC = syscall.Errno(0x48) EBUSY = syscall.Errno(0x10) ECANCELED = syscall.Errno(0x55) ECAPMODE = syscall.Errno(0x5e) ECHILD = syscall.Errno(0xa) ECONNABORTED = syscall.Errno(0x35) ECONNREFUSED = syscall.Errno(0x3d) ECONNRESET = syscall.Errno(0x36) EDEADLK = syscall.Errno(0xb) EDESTADDRREQ = syscall.Errno(0x27) EDOM = syscall.Errno(0x21) EDOOFUS = syscall.Errno(0x58) EDQUOT = syscall.Errno(0x45) EEXIST = syscall.Errno(0x11) EFAULT = syscall.Errno(0xe) EFBIG = syscall.Errno(0x1b) EFTYPE = syscall.Errno(0x4f) EHOSTDOWN = syscall.Errno(0x40) EHOSTUNREACH = syscall.Errno(0x41) EIDRM = syscall.Errno(0x52) EILSEQ = syscall.Errno(0x56) EINPROGRESS = syscall.Errno(0x24) EINTEGRITY = syscall.Errno(0x61) EINTR = syscall.Errno(0x4) EINVAL = syscall.Errno(0x16) EIO = syscall.Errno(0x5) EISCONN = syscall.Errno(0x38) EISDIR = syscall.Errno(0x15) ELAST = syscall.Errno(0x61) ELOOP = syscall.Errno(0x3e) EMFILE = syscall.Errno(0x18) EMLINK = syscall.Errno(0x1f) EMSGSIZE = syscall.Errno(0x28) EMULTIHOP = syscall.Errno(0x5a) ENAMETOOLONG = syscall.Errno(0x3f) ENEEDAUTH = syscall.Errno(0x51) ENETDOWN = syscall.Errno(0x32) ENETRESET = syscall.Errno(0x34) ENETUNREACH = syscall.Errno(0x33) ENFILE = syscall.Errno(0x17) ENOATTR = syscall.Errno(0x57) ENOBUFS = syscall.Errno(0x37) ENODEV = syscall.Errno(0x13) ENOENT = syscall.Errno(0x2) ENOEXEC = syscall.Errno(0x8) ENOLCK = syscall.Errno(0x4d) ENOLINK = syscall.Errno(0x5b) ENOMEM = syscall.Errno(0xc) ENOMSG = syscall.Errno(0x53) ENOPROTOOPT = syscall.Errno(0x2a) ENOSPC = syscall.Errno(0x1c) ENOSYS = syscall.Errno(0x4e) ENOTBLK = syscall.Errno(0xf) ENOTCAPABLE = syscall.Errno(0x5d) ENOTCONN = syscall.Errno(0x39) ENOTDIR = syscall.Errno(0x14) ENOTEMPTY = syscall.Errno(0x42) ENOTRECOVERABLE = syscall.Errno(0x5f) ENOTSOCK = syscall.Errno(0x26) ENOTSUP = syscall.Errno(0x2d) ENOTTY = syscall.Errno(0x19) ENXIO = syscall.Errno(0x6) EOPNOTSUPP = syscall.Errno(0x2d) EOVERFLOW = syscall.Errno(0x54) EOWNERDEAD = syscall.Errno(0x60) EPERM = syscall.Errno(0x1) EPFNOSUPPORT = syscall.Errno(0x2e) EPIPE = syscall.Errno(0x20) EPROCLIM = syscall.Errno(0x43) EPROCUNAVAIL = syscall.Errno(0x4c) EPROGMISMATCH = syscall.Errno(0x4b) EPROGUNAVAIL = syscall.Errno(0x4a) EPROTO = syscall.Errno(0x5c) EPROTONOSUPPORT = syscall.Errno(0x2b) EPROTOTYPE = syscall.Errno(0x29) ERANGE = syscall.Errno(0x22) EREMOTE = syscall.Errno(0x47) EROFS = syscall.Errno(0x1e) ERPCMISMATCH = syscall.Errno(0x49) ESHUTDOWN = syscall.Errno(0x3a) ESOCKTNOSUPPORT = syscall.Errno(0x2c) ESPIPE = syscall.Errno(0x1d) ESRCH = syscall.Errno(0x3) ESTALE = syscall.Errno(0x46) ETIMEDOUT = syscall.Errno(0x3c) ETOOMANYREFS = syscall.Errno(0x3b) ETXTBSY = syscall.Errno(0x1a) EUSERS = syscall.Errno(0x44) EWOULDBLOCK = syscall.Errno(0x23) EXDEV = syscall.Errno(0x12) ) // Signals const ( SIGABRT = syscall.Signal(0x6) SIGALRM = syscall.Signal(0xe) SIGBUS = syscall.Signal(0xa) SIGCHLD = syscall.Signal(0x14) SIGCONT = syscall.Signal(0x13) SIGEMT = syscall.Signal(0x7) SIGFPE = syscall.Signal(0x8) SIGHUP = syscall.Signal(0x1) SIGILL = syscall.Signal(0x4) SIGINFO = syscall.Signal(0x1d) SIGINT = syscall.Signal(0x2) SIGIO = syscall.Signal(0x17) SIGIOT = syscall.Signal(0x6) SIGKILL = syscall.Signal(0x9) SIGLIBRT = syscall.Signal(0x21) SIGLWP = syscall.Signal(0x20) SIGPIPE = syscall.Signal(0xd) SIGPROF = syscall.Signal(0x1b) SIGQUIT = syscall.Signal(0x3) SIGSEGV = syscall.Signal(0xb) SIGSTOP = syscall.Signal(0x11) SIGSYS = syscall.Signal(0xc) SIGTERM = syscall.Signal(0xf) SIGTHR = syscall.Signal(0x20) SIGTRAP = syscall.Signal(0x5) SIGTSTP = syscall.Signal(0x12) SIGTTIN = syscall.Signal(0x15) SIGTTOU = syscall.Signal(0x16) SIGURG = syscall.Signal(0x10) SIGUSR1 = syscall.Signal(0x1e) SIGUSR2 = syscall.Signal(0x1f) SIGVTALRM = syscall.Signal(0x1a) SIGWINCH = syscall.Signal(0x1c) SIGXCPU = syscall.Signal(0x18) SIGXFSZ = syscall.Signal(0x19) ) // Error table var errorList = [...]struct { num syscall.Errno name string desc string }{ {1, "EPERM", "operation not permitted"}, {2, "ENOENT", "no such file or directory"}, {3, "ESRCH", "no such process"}, {4, "EINTR", "interrupted system call"}, {5, "EIO", "input/output error"}, {6, "ENXIO", "device not configured"}, {7, "E2BIG", "argument list too long"}, {8, "ENOEXEC", "exec format error"}, {9, "EBADF", "bad file descriptor"}, {10, "ECHILD", "no child processes"}, {11, "EDEADLK", "resource deadlock avoided"}, {12, "ENOMEM", "cannot allocate memory"}, {13, "EACCES", "permission denied"}, {14, "EFAULT", "bad address"}, {15, "ENOTBLK", "block device required"}, {16, "EBUSY", "device busy"}, {17, "EEXIST", "file exists"}, {18, "EXDEV", "cross-device link"}, {19, "ENODEV", "operation not supported by device"}, {20, "ENOTDIR", "not a directory"}, {21, "EISDIR", "is a directory"}, {22, "EINVAL", "invalid argument"}, {23, "ENFILE", "too many open files in system"}, {24, "EMFILE", "too many open files"}, {25, "ENOTTY", "inappropriate ioctl for device"}, {26, "ETXTBSY", "text file busy"}, {27, "EFBIG", "file too large"}, {28, "ENOSPC", "no space left on device"}, {29, "ESPIPE", "illegal seek"}, {30, "EROFS", "read-only file system"}, {31, "EMLINK", "too many links"}, {32, "EPIPE", "broken pipe"}, {33, "EDOM", "numerical argument out of domain"}, {34, "ERANGE", "result too large"}, {35, "EWOULDBLOCK", "resource temporarily unavailable"}, {36, "EINPROGRESS", "operation now in progress"}, {37, "EALREADY", "operation already in progress"}, {38, "ENOTSOCK", "socket operation on non-socket"}, {39, "EDESTADDRREQ", "destination address required"}, {40, "EMSGSIZE", "message too long"}, {41, "EPROTOTYPE", "protocol wrong type for socket"}, {42, "ENOPROTOOPT", "protocol not available"}, {43, "EPROTONOSUPPORT", "protocol not supported"}, {44, "ESOCKTNOSUPPORT", "socket type not supported"}, {45, "EOPNOTSUPP", "operation not supported"}, {46, "EPFNOSUPPORT", "protocol family not supported"}, {47, "EAFNOSUPPORT", "address family not supported by protocol family"}, {48, "EADDRINUSE", "address already in use"}, {49, "EADDRNOTAVAIL", "can't assign requested address"}, {50, "ENETDOWN", "network is down"}, {51, "ENETUNREACH", "network is unreachable"}, {52, "ENETRESET", "network dropped connection on reset"}, {53, "ECONNABORTED", "software caused connection abort"}, {54, "ECONNRESET", "connection reset by peer"}, {55, "ENOBUFS", "no buffer space available"}, {56, "EISCONN", "socket is already connected"}, {57, "ENOTCONN", "socket is not connected"}, {58, "ESHUTDOWN", "can't send after socket shutdown"}, {59, "ETOOMANYREFS", "too many references: can't splice"}, {60, "ETIMEDOUT", "operation timed out"}, {61, "ECONNREFUSED", "connection refused"}, {62, "ELOOP", "too many levels of symbolic links"}, {63, "ENAMETOOLONG", "file name too long"}, {64, "EHOSTDOWN", "host is down"}, {65, "EHOSTUNREACH", "no route to host"}, {66, "ENOTEMPTY", "directory not empty"}, {67, "EPROCLIM", "too many processes"}, {68, "EUSERS", "too many users"}, {69, "EDQUOT", "disc quota exceeded"}, {70, "ESTALE", "stale NFS file handle"}, {71, "EREMOTE", "too many levels of remote in path"}, {72, "EBADRPC", "RPC struct is bad"}, {73, "ERPCMISMATCH", "RPC version wrong"}, {74, "EPROGUNAVAIL", "RPC prog. not avail"}, {75, "EPROGMISMATCH", "program version wrong"}, {76, "EPROCUNAVAIL", "bad procedure for program"}, {77, "ENOLCK", "no locks available"}, {78, "ENOSYS", "function not implemented"}, {79, "EFTYPE", "inappropriate file type or format"}, {80, "EAUTH", "authentication error"}, {81, "ENEEDAUTH", "need authenticator"}, {82, "EIDRM", "identifier removed"}, {83, "ENOMSG", "no message of desired type"}, {84, "EOVERFLOW", "value too large to be stored in data type"}, {85, "ECANCELED", "operation canceled"}, {86, "EILSEQ", "illegal byte sequence"}, {87, "ENOATTR", "attribute not found"}, {88, "EDOOFUS", "programming error"}, {89, "EBADMSG", "bad message"}, {90, "EMULTIHOP", "multihop attempted"}, {91, "ENOLINK", "link has been severed"}, {92, "EPROTO", "protocol error"}, {93, "ENOTCAPABLE", "capabilities insufficient"}, {94, "ECAPMODE", "not permitted in capability mode"}, {95, "ENOTRECOVERABLE", "state not recoverable"}, {96, "EOWNERDEAD", "previous owner died"}, {97, "EINTEGRITY", "integrity check failed"}, } // Signal table var signalList = [...]struct { num syscall.Signal name string desc string }{ {1, "SIGHUP", "hangup"}, {2, "SIGINT", "interrupt"}, {3, "SIGQUIT", "quit"}, {4, "SIGILL", "illegal instruction"}, {5, "SIGTRAP", "trace/BPT trap"}, {6, "SIGIOT", "abort trap"}, {7, "SIGEMT", "EMT trap"}, {8, "SIGFPE", "floating point exception"}, {9, "SIGKILL", "killed"}, {10, "SIGBUS", "bus error"}, {11, "SIGSEGV", "segmentation fault"}, {12, "SIGSYS", "bad system call"}, {13, "SIGPIPE", "broken pipe"}, {14, "SIGALRM", "alarm clock"}, {15, "SIGTERM", "terminated"}, {16, "SIGURG", "urgent I/O condition"}, {17, "SIGSTOP", "suspended (signal)"}, {18, "SIGTSTP", "suspended"}, {19, "SIGCONT", "continued"}, {20, "SIGCHLD", "child exited"}, {21, "SIGTTIN", "stopped (tty input)"}, {22, "SIGTTOU", "stopped (tty output)"}, {23, "SIGIO", "I/O possible"}, {24, "SIGXCPU", "cputime limit exceeded"}, {25, "SIGXFSZ", "filesize limit exceeded"}, {26, "SIGVTALRM", "virtual timer expired"}, {27, "SIGPROF", "profiling timer expired"}, {28, "SIGWINCH", "window size changes"}, {29, "SIGINFO", "information request"}, {30, "SIGUSR1", "user defined signal 1"}, {31, "SIGUSR2", "user defined signal 2"}, {32, "SIGTHR", "unknown signal"}, {33, "SIGLIBRT", "unknown signal"}, } ================================================ FILE: vendor/golang.org/x/sys/unix/zerrors_linux.go ================================================ // Code generated by mkmerge; DO NOT EDIT. //go:build linux package unix import "syscall" const ( AAFS_MAGIC = 0x5a3c69f0 ADFS_SUPER_MAGIC = 0xadf5 AFFS_SUPER_MAGIC = 0xadff AFS_FS_MAGIC = 0x6b414653 AFS_SUPER_MAGIC = 0x5346414f AF_ALG = 0x26 AF_APPLETALK = 0x5 AF_ASH = 0x12 AF_ATMPVC = 0x8 AF_ATMSVC = 0x14 AF_AX25 = 0x3 AF_BLUETOOTH = 0x1f AF_BRIDGE = 0x7 AF_CAIF = 0x25 AF_CAN = 0x1d AF_DECnet = 0xc AF_ECONET = 0x13 AF_FILE = 0x1 AF_IB = 0x1b AF_IEEE802154 = 0x24 AF_INET = 0x2 AF_INET6 = 0xa AF_IPX = 0x4 AF_IRDA = 0x17 AF_ISDN = 0x22 AF_IUCV = 0x20 AF_KCM = 0x29 AF_KEY = 0xf AF_LLC = 0x1a AF_LOCAL = 0x1 AF_MAX = 0x2e AF_MCTP = 0x2d AF_MPLS = 0x1c AF_NETBEUI = 0xd AF_NETLINK = 0x10 AF_NETROM = 0x6 AF_NFC = 0x27 AF_PACKET = 0x11 AF_PHONET = 0x23 AF_PPPOX = 0x18 AF_QIPCRTR = 0x2a AF_RDS = 0x15 AF_ROSE = 0xb AF_ROUTE = 0x10 AF_RXRPC = 0x21 AF_SECURITY = 0xe AF_SMC = 0x2b AF_SNA = 0x16 AF_TIPC = 0x1e AF_UNIX = 0x1 AF_UNSPEC = 0x0 AF_VSOCK = 0x28 AF_WANPIPE = 0x19 AF_X25 = 0x9 AF_XDP = 0x2c ALG_OP_DECRYPT = 0x0 ALG_OP_ENCRYPT = 0x1 ALG_SET_AEAD_ASSOCLEN = 0x4 ALG_SET_AEAD_AUTHSIZE = 0x5 ALG_SET_DRBG_ENTROPY = 0x6 ALG_SET_IV = 0x2 ALG_SET_KEY = 0x1 ALG_SET_KEY_BY_KEY_SERIAL = 0x7 ALG_SET_OP = 0x3 ANON_INODE_FS_MAGIC = 0x9041934 ARPHRD_6LOWPAN = 0x339 ARPHRD_ADAPT = 0x108 ARPHRD_APPLETLK = 0x8 ARPHRD_ARCNET = 0x7 ARPHRD_ASH = 0x30d ARPHRD_ATM = 0x13 ARPHRD_AX25 = 0x3 ARPHRD_BIF = 0x307 ARPHRD_CAIF = 0x336 ARPHRD_CAN = 0x118 ARPHRD_CHAOS = 0x5 ARPHRD_CISCO = 0x201 ARPHRD_CSLIP = 0x101 ARPHRD_CSLIP6 = 0x103 ARPHRD_DDCMP = 0x205 ARPHRD_DLCI = 0xf ARPHRD_ECONET = 0x30e ARPHRD_EETHER = 0x2 ARPHRD_ETHER = 0x1 ARPHRD_EUI64 = 0x1b ARPHRD_FCAL = 0x311 ARPHRD_FCFABRIC = 0x313 ARPHRD_FCPL = 0x312 ARPHRD_FCPP = 0x310 ARPHRD_FDDI = 0x306 ARPHRD_FRAD = 0x302 ARPHRD_HDLC = 0x201 ARPHRD_HIPPI = 0x30c ARPHRD_HWX25 = 0x110 ARPHRD_IEEE1394 = 0x18 ARPHRD_IEEE802 = 0x6 ARPHRD_IEEE80211 = 0x321 ARPHRD_IEEE80211_PRISM = 0x322 ARPHRD_IEEE80211_RADIOTAP = 0x323 ARPHRD_IEEE802154 = 0x324 ARPHRD_IEEE802154_MONITOR = 0x325 ARPHRD_IEEE802_TR = 0x320 ARPHRD_INFINIBAND = 0x20 ARPHRD_IP6GRE = 0x337 ARPHRD_IPDDP = 0x309 ARPHRD_IPGRE = 0x30a ARPHRD_IRDA = 0x30f ARPHRD_LAPB = 0x204 ARPHRD_LOCALTLK = 0x305 ARPHRD_LOOPBACK = 0x304 ARPHRD_MCTP = 0x122 ARPHRD_METRICOM = 0x17 ARPHRD_NETLINK = 0x338 ARPHRD_NETROM = 0x0 ARPHRD_NONE = 0xfffe ARPHRD_PHONET = 0x334 ARPHRD_PHONET_PIPE = 0x335 ARPHRD_PIMREG = 0x30b ARPHRD_PPP = 0x200 ARPHRD_PRONET = 0x4 ARPHRD_RAWHDLC = 0x206 ARPHRD_RAWIP = 0x207 ARPHRD_ROSE = 0x10e ARPHRD_RSRVD = 0x104 ARPHRD_SIT = 0x308 ARPHRD_SKIP = 0x303 ARPHRD_SLIP = 0x100 ARPHRD_SLIP6 = 0x102 ARPHRD_TUNNEL = 0x300 ARPHRD_TUNNEL6 = 0x301 ARPHRD_VOID = 0xffff ARPHRD_VSOCKMON = 0x33a ARPHRD_X25 = 0x10f AUDIT_ADD = 0x3eb AUDIT_ADD_RULE = 0x3f3 AUDIT_ALWAYS = 0x2 AUDIT_ANOM_ABEND = 0x6a5 AUDIT_ANOM_CREAT = 0x6a7 AUDIT_ANOM_LINK = 0x6a6 AUDIT_ANOM_PROMISCUOUS = 0x6a4 AUDIT_ARCH = 0xb AUDIT_ARCH_AARCH64 = 0xc00000b7 AUDIT_ARCH_ALPHA = 0xc0009026 AUDIT_ARCH_ARCOMPACT = 0x4000005d AUDIT_ARCH_ARCOMPACTBE = 0x5d AUDIT_ARCH_ARCV2 = 0x400000c3 AUDIT_ARCH_ARCV2BE = 0xc3 AUDIT_ARCH_ARM = 0x40000028 AUDIT_ARCH_ARMEB = 0x28 AUDIT_ARCH_C6X = 0x4000008c AUDIT_ARCH_C6XBE = 0x8c AUDIT_ARCH_CRIS = 0x4000004c AUDIT_ARCH_CSKY = 0x400000fc AUDIT_ARCH_FRV = 0x5441 AUDIT_ARCH_H8300 = 0x2e AUDIT_ARCH_HEXAGON = 0xa4 AUDIT_ARCH_I386 = 0x40000003 AUDIT_ARCH_IA64 = 0xc0000032 AUDIT_ARCH_LOONGARCH32 = 0x40000102 AUDIT_ARCH_LOONGARCH64 = 0xc0000102 AUDIT_ARCH_M32R = 0x58 AUDIT_ARCH_M68K = 0x4 AUDIT_ARCH_MICROBLAZE = 0xbd AUDIT_ARCH_MIPS = 0x8 AUDIT_ARCH_MIPS64 = 0x80000008 AUDIT_ARCH_MIPS64N32 = 0xa0000008 AUDIT_ARCH_MIPSEL = 0x40000008 AUDIT_ARCH_MIPSEL64 = 0xc0000008 AUDIT_ARCH_MIPSEL64N32 = 0xe0000008 AUDIT_ARCH_NDS32 = 0x400000a7 AUDIT_ARCH_NDS32BE = 0xa7 AUDIT_ARCH_NIOS2 = 0x40000071 AUDIT_ARCH_OPENRISC = 0x5c AUDIT_ARCH_PARISC = 0xf AUDIT_ARCH_PARISC64 = 0x8000000f AUDIT_ARCH_PPC = 0x14 AUDIT_ARCH_PPC64 = 0x80000015 AUDIT_ARCH_PPC64LE = 0xc0000015 AUDIT_ARCH_RISCV32 = 0x400000f3 AUDIT_ARCH_RISCV64 = 0xc00000f3 AUDIT_ARCH_S390 = 0x16 AUDIT_ARCH_S390X = 0x80000016 AUDIT_ARCH_SH = 0x2a AUDIT_ARCH_SH64 = 0x8000002a AUDIT_ARCH_SHEL = 0x4000002a AUDIT_ARCH_SHEL64 = 0xc000002a AUDIT_ARCH_SPARC = 0x2 AUDIT_ARCH_SPARC64 = 0x8000002b AUDIT_ARCH_TILEGX = 0xc00000bf AUDIT_ARCH_TILEGX32 = 0x400000bf AUDIT_ARCH_TILEPRO = 0x400000bc AUDIT_ARCH_UNICORE = 0x4000006e AUDIT_ARCH_X86_64 = 0xc000003e AUDIT_ARCH_XTENSA = 0x5e AUDIT_ARG0 = 0xc8 AUDIT_ARG1 = 0xc9 AUDIT_ARG2 = 0xca AUDIT_ARG3 = 0xcb AUDIT_AVC = 0x578 AUDIT_AVC_PATH = 0x57a AUDIT_BITMASK_SIZE = 0x40 AUDIT_BIT_MASK = 0x8000000 AUDIT_BIT_TEST = 0x48000000 AUDIT_BPF = 0x536 AUDIT_BPRM_FCAPS = 0x529 AUDIT_CAPSET = 0x52a AUDIT_CLASS_CHATTR = 0x2 AUDIT_CLASS_CHATTR_32 = 0x3 AUDIT_CLASS_DIR_WRITE = 0x0 AUDIT_CLASS_DIR_WRITE_32 = 0x1 AUDIT_CLASS_READ = 0x4 AUDIT_CLASS_READ_32 = 0x5 AUDIT_CLASS_SIGNAL = 0x8 AUDIT_CLASS_SIGNAL_32 = 0x9 AUDIT_CLASS_WRITE = 0x6 AUDIT_CLASS_WRITE_32 = 0x7 AUDIT_COMPARE_AUID_TO_EUID = 0x10 AUDIT_COMPARE_AUID_TO_FSUID = 0xe AUDIT_COMPARE_AUID_TO_OBJ_UID = 0x5 AUDIT_COMPARE_AUID_TO_SUID = 0xf AUDIT_COMPARE_EGID_TO_FSGID = 0x17 AUDIT_COMPARE_EGID_TO_OBJ_GID = 0x4 AUDIT_COMPARE_EGID_TO_SGID = 0x18 AUDIT_COMPARE_EUID_TO_FSUID = 0x12 AUDIT_COMPARE_EUID_TO_OBJ_UID = 0x3 AUDIT_COMPARE_EUID_TO_SUID = 0x11 AUDIT_COMPARE_FSGID_TO_OBJ_GID = 0x9 AUDIT_COMPARE_FSUID_TO_OBJ_UID = 0x8 AUDIT_COMPARE_GID_TO_EGID = 0x14 AUDIT_COMPARE_GID_TO_FSGID = 0x15 AUDIT_COMPARE_GID_TO_OBJ_GID = 0x2 AUDIT_COMPARE_GID_TO_SGID = 0x16 AUDIT_COMPARE_SGID_TO_FSGID = 0x19 AUDIT_COMPARE_SGID_TO_OBJ_GID = 0x7 AUDIT_COMPARE_SUID_TO_FSUID = 0x13 AUDIT_COMPARE_SUID_TO_OBJ_UID = 0x6 AUDIT_COMPARE_UID_TO_AUID = 0xa AUDIT_COMPARE_UID_TO_EUID = 0xb AUDIT_COMPARE_UID_TO_FSUID = 0xc AUDIT_COMPARE_UID_TO_OBJ_UID = 0x1 AUDIT_COMPARE_UID_TO_SUID = 0xd AUDIT_CONFIG_CHANGE = 0x519 AUDIT_CWD = 0x51b AUDIT_DAEMON_ABORT = 0x4b2 AUDIT_DAEMON_CONFIG = 0x4b3 AUDIT_DAEMON_END = 0x4b1 AUDIT_DAEMON_START = 0x4b0 AUDIT_DEL = 0x3ec AUDIT_DEL_RULE = 0x3f4 AUDIT_DEVMAJOR = 0x64 AUDIT_DEVMINOR = 0x65 AUDIT_DIR = 0x6b AUDIT_DM_CTRL = 0x53a AUDIT_DM_EVENT = 0x53b AUDIT_EGID = 0x6 AUDIT_EOE = 0x528 AUDIT_EQUAL = 0x40000000 AUDIT_EUID = 0x2 AUDIT_EVENT_LISTENER = 0x537 AUDIT_EXE = 0x70 AUDIT_EXECVE = 0x51d AUDIT_EXIT = 0x67 AUDIT_FAIL_PANIC = 0x2 AUDIT_FAIL_PRINTK = 0x1 AUDIT_FAIL_SILENT = 0x0 AUDIT_FANOTIFY = 0x533 AUDIT_FD_PAIR = 0x525 AUDIT_FEATURE_BITMAP_ALL = 0x7f AUDIT_FEATURE_BITMAP_BACKLOG_LIMIT = 0x1 AUDIT_FEATURE_BITMAP_BACKLOG_WAIT_TIME = 0x2 AUDIT_FEATURE_BITMAP_EXCLUDE_EXTEND = 0x8 AUDIT_FEATURE_BITMAP_EXECUTABLE_PATH = 0x4 AUDIT_FEATURE_BITMAP_FILTER_FS = 0x40 AUDIT_FEATURE_BITMAP_LOST_RESET = 0x20 AUDIT_FEATURE_BITMAP_SESSIONID_FILTER = 0x10 AUDIT_FEATURE_CHANGE = 0x530 AUDIT_FEATURE_LOGINUID_IMMUTABLE = 0x1 AUDIT_FEATURE_ONLY_UNSET_LOGINUID = 0x0 AUDIT_FEATURE_VERSION = 0x1 AUDIT_FIELD_COMPARE = 0x6f AUDIT_FILETYPE = 0x6c AUDIT_FILTERKEY = 0xd2 AUDIT_FILTER_ENTRY = 0x2 AUDIT_FILTER_EXCLUDE = 0x5 AUDIT_FILTER_EXIT = 0x4 AUDIT_FILTER_FS = 0x6 AUDIT_FILTER_PREPEND = 0x10 AUDIT_FILTER_TASK = 0x1 AUDIT_FILTER_TYPE = 0x5 AUDIT_FILTER_URING_EXIT = 0x7 AUDIT_FILTER_USER = 0x0 AUDIT_FILTER_WATCH = 0x3 AUDIT_FIRST_KERN_ANOM_MSG = 0x6a4 AUDIT_FIRST_USER_MSG = 0x44c AUDIT_FIRST_USER_MSG2 = 0x834 AUDIT_FSGID = 0x8 AUDIT_FSTYPE = 0x1a AUDIT_FSUID = 0x4 AUDIT_GET = 0x3e8 AUDIT_GET_FEATURE = 0x3fb AUDIT_GID = 0x5 AUDIT_GREATER_THAN = 0x20000000 AUDIT_GREATER_THAN_OR_EQUAL = 0x60000000 AUDIT_INODE = 0x66 AUDIT_INTEGRITY_DATA = 0x708 AUDIT_INTEGRITY_EVM_XATTR = 0x70e AUDIT_INTEGRITY_HASH = 0x70b AUDIT_INTEGRITY_METADATA = 0x709 AUDIT_INTEGRITY_PCR = 0x70c AUDIT_INTEGRITY_POLICY_RULE = 0x70f AUDIT_INTEGRITY_RULE = 0x70d AUDIT_INTEGRITY_STATUS = 0x70a AUDIT_INTEGRITY_USERSPACE = 0x710 AUDIT_IPC = 0x517 AUDIT_IPC_SET_PERM = 0x51f AUDIT_IPE_ACCESS = 0x58c AUDIT_IPE_CONFIG_CHANGE = 0x58d AUDIT_IPE_POLICY_LOAD = 0x58e AUDIT_KERNEL = 0x7d0 AUDIT_KERNEL_OTHER = 0x524 AUDIT_KERN_MODULE = 0x532 AUDIT_LANDLOCK_ACCESS = 0x58f AUDIT_LANDLOCK_DOMAIN = 0x590 AUDIT_LAST_FEATURE = 0x1 AUDIT_LAST_KERN_ANOM_MSG = 0x707 AUDIT_LAST_USER_MSG = 0x4af AUDIT_LAST_USER_MSG2 = 0xbb7 AUDIT_LESS_THAN = 0x10000000 AUDIT_LESS_THAN_OR_EQUAL = 0x50000000 AUDIT_LIST = 0x3ea AUDIT_LIST_RULES = 0x3f5 AUDIT_LOGIN = 0x3ee AUDIT_LOGINUID = 0x9 AUDIT_LOGINUID_SET = 0x18 AUDIT_MAC_CALIPSO_ADD = 0x58a AUDIT_MAC_CALIPSO_DEL = 0x58b AUDIT_MAC_CIPSOV4_ADD = 0x57f AUDIT_MAC_CIPSOV4_DEL = 0x580 AUDIT_MAC_CONFIG_CHANGE = 0x57d AUDIT_MAC_IPSEC_ADDSA = 0x583 AUDIT_MAC_IPSEC_ADDSPD = 0x585 AUDIT_MAC_IPSEC_DELSA = 0x584 AUDIT_MAC_IPSEC_DELSPD = 0x586 AUDIT_MAC_IPSEC_EVENT = 0x587 AUDIT_MAC_MAP_ADD = 0x581 AUDIT_MAC_MAP_DEL = 0x582 AUDIT_MAC_POLICY_LOAD = 0x57b AUDIT_MAC_STATUS = 0x57c AUDIT_MAC_UNLBL_ALLOW = 0x57e AUDIT_MAC_UNLBL_STCADD = 0x588 AUDIT_MAC_UNLBL_STCDEL = 0x589 AUDIT_MAKE_EQUIV = 0x3f7 AUDIT_MAX_FIELDS = 0x40 AUDIT_MAX_FIELD_COMPARE = 0x19 AUDIT_MAX_KEY_LEN = 0x100 AUDIT_MESSAGE_TEXT_MAX = 0x2170 AUDIT_MMAP = 0x52b AUDIT_MQ_GETSETATTR = 0x523 AUDIT_MQ_NOTIFY = 0x522 AUDIT_MQ_OPEN = 0x520 AUDIT_MQ_SENDRECV = 0x521 AUDIT_MSGTYPE = 0xc AUDIT_NEGATE = 0x80000000 AUDIT_NETFILTER_CFG = 0x52d AUDIT_NETFILTER_PKT = 0x52c AUDIT_NEVER = 0x0 AUDIT_NLGRP_MAX = 0x1 AUDIT_NOT_EQUAL = 0x30000000 AUDIT_NR_FILTERS = 0x8 AUDIT_OBJ_GID = 0x6e AUDIT_OBJ_LEV_HIGH = 0x17 AUDIT_OBJ_LEV_LOW = 0x16 AUDIT_OBJ_PID = 0x526 AUDIT_OBJ_ROLE = 0x14 AUDIT_OBJ_TYPE = 0x15 AUDIT_OBJ_UID = 0x6d AUDIT_OBJ_USER = 0x13 AUDIT_OPENAT2 = 0x539 AUDIT_OPERATORS = 0x78000000 AUDIT_PATH = 0x516 AUDIT_PERM = 0x6a AUDIT_PERM_ATTR = 0x8 AUDIT_PERM_EXEC = 0x1 AUDIT_PERM_READ = 0x4 AUDIT_PERM_WRITE = 0x2 AUDIT_PERS = 0xa AUDIT_PID = 0x0 AUDIT_POSSIBLE = 0x1 AUDIT_PPID = 0x12 AUDIT_PROCTITLE = 0x52f AUDIT_REPLACE = 0x531 AUDIT_SADDR_FAM = 0x71 AUDIT_SECCOMP = 0x52e AUDIT_SELINUX_ERR = 0x579 AUDIT_SESSIONID = 0x19 AUDIT_SET = 0x3e9 AUDIT_SET_FEATURE = 0x3fa AUDIT_SGID = 0x7 AUDIT_SID_UNSET = 0xffffffff AUDIT_SIGNAL_INFO = 0x3f2 AUDIT_SOCKADDR = 0x51a AUDIT_SOCKETCALL = 0x518 AUDIT_STATUS_BACKLOG_LIMIT = 0x10 AUDIT_STATUS_BACKLOG_WAIT_TIME = 0x20 AUDIT_STATUS_BACKLOG_WAIT_TIME_ACTUAL = 0x80 AUDIT_STATUS_ENABLED = 0x1 AUDIT_STATUS_FAILURE = 0x2 AUDIT_STATUS_LOST = 0x40 AUDIT_STATUS_PID = 0x4 AUDIT_STATUS_RATE_LIMIT = 0x8 AUDIT_SUBJ_CLR = 0x11 AUDIT_SUBJ_ROLE = 0xe AUDIT_SUBJ_SEN = 0x10 AUDIT_SUBJ_TYPE = 0xf AUDIT_SUBJ_USER = 0xd AUDIT_SUCCESS = 0x68 AUDIT_SUID = 0x3 AUDIT_SYSCALL = 0x514 AUDIT_SYSCALL_CLASSES = 0x10 AUDIT_TIME_ADJNTPVAL = 0x535 AUDIT_TIME_INJOFFSET = 0x534 AUDIT_TRIM = 0x3f6 AUDIT_TTY = 0x527 AUDIT_TTY_GET = 0x3f8 AUDIT_TTY_SET = 0x3f9 AUDIT_UID = 0x1 AUDIT_UID_UNSET = 0xffffffff AUDIT_UNUSED_BITS = 0x7fffc00 AUDIT_URINGOP = 0x538 AUDIT_USER = 0x3ed AUDIT_USER_AVC = 0x453 AUDIT_USER_TTY = 0x464 AUDIT_VERSION_BACKLOG_LIMIT = 0x1 AUDIT_VERSION_BACKLOG_WAIT_TIME = 0x2 AUDIT_VERSION_LATEST = 0x7f AUDIT_WATCH = 0x69 AUDIT_WATCH_INS = 0x3ef AUDIT_WATCH_LIST = 0x3f1 AUDIT_WATCH_REM = 0x3f0 AUTOFS_SUPER_MAGIC = 0x187 B0 = 0x0 B110 = 0x3 B1200 = 0x9 B134 = 0x4 B150 = 0x5 B1800 = 0xa B19200 = 0xe B200 = 0x6 B2400 = 0xb B300 = 0x7 B38400 = 0xf B4800 = 0xc B50 = 0x1 B600 = 0x8 B75 = 0x2 B9600 = 0xd BCACHEFS_SUPER_MAGIC = 0xca451a4e BDEVFS_MAGIC = 0x62646576 BINDERFS_SUPER_MAGIC = 0x6c6f6f70 BINFMTFS_MAGIC = 0x42494e4d BPF_A = 0x10 BPF_ABS = 0x20 BPF_ADD = 0x0 BPF_ALU = 0x4 BPF_ALU64 = 0x7 BPF_AND = 0x50 BPF_ARSH = 0xc0 BPF_ATOMIC = 0xc0 BPF_B = 0x10 BPF_BUILD_ID_SIZE = 0x14 BPF_CALL = 0x80 BPF_CMPXCHG = 0xf1 BPF_DIV = 0x30 BPF_DW = 0x18 BPF_END = 0xd0 BPF_EXIT = 0x90 BPF_FETCH = 0x1 BPF_FROM_BE = 0x8 BPF_FROM_LE = 0x0 BPF_FS_MAGIC = 0xcafe4a11 BPF_F_AFTER = 0x10 BPF_F_ALLOW_MULTI = 0x2 BPF_F_ALLOW_OVERRIDE = 0x1 BPF_F_ANY_ALIGNMENT = 0x2 BPF_F_BEFORE = 0x8 BPF_F_ID = 0x20 BPF_F_NETFILTER_IP_DEFRAG = 0x1 BPF_F_PREORDER = 0x40 BPF_F_QUERY_EFFECTIVE = 0x1 BPF_F_REDIRECT_FLAGS = 0x19 BPF_F_REPLACE = 0x4 BPF_F_SLEEPABLE = 0x10 BPF_F_STRICT_ALIGNMENT = 0x1 BPF_F_TEST_REG_INVARIANTS = 0x80 BPF_F_TEST_RND_HI32 = 0x4 BPF_F_TEST_RUN_ON_CPU = 0x1 BPF_F_TEST_SKB_CHECKSUM_COMPLETE = 0x4 BPF_F_TEST_STATE_FREQ = 0x8 BPF_F_TEST_XDP_LIVE_FRAMES = 0x2 BPF_F_XDP_DEV_BOUND_ONLY = 0x40 BPF_F_XDP_HAS_FRAGS = 0x20 BPF_H = 0x8 BPF_IMM = 0x0 BPF_IND = 0x40 BPF_JA = 0x0 BPF_JCOND = 0xe0 BPF_JEQ = 0x10 BPF_JGE = 0x30 BPF_JGT = 0x20 BPF_JLE = 0xb0 BPF_JLT = 0xa0 BPF_JMP = 0x5 BPF_JMP32 = 0x6 BPF_JNE = 0x50 BPF_JSET = 0x40 BPF_JSGE = 0x70 BPF_JSGT = 0x60 BPF_JSLE = 0xd0 BPF_JSLT = 0xc0 BPF_K = 0x0 BPF_LD = 0x0 BPF_LDX = 0x1 BPF_LEN = 0x80 BPF_LL_OFF = -0x200000 BPF_LOAD_ACQ = 0x100 BPF_LSH = 0x60 BPF_MAJOR_VERSION = 0x1 BPF_MAXINSNS = 0x1000 BPF_MEM = 0x60 BPF_MEMSX = 0x80 BPF_MEMWORDS = 0x10 BPF_MINOR_VERSION = 0x1 BPF_MISC = 0x7 BPF_MOD = 0x90 BPF_MOV = 0xb0 BPF_MSH = 0xa0 BPF_MUL = 0x20 BPF_NEG = 0x80 BPF_NET_OFF = -0x100000 BPF_OBJ_NAME_LEN = 0x10 BPF_OR = 0x40 BPF_PSEUDO_BTF_ID = 0x3 BPF_PSEUDO_CALL = 0x1 BPF_PSEUDO_FUNC = 0x4 BPF_PSEUDO_KFUNC_CALL = 0x2 BPF_PSEUDO_MAP_FD = 0x1 BPF_PSEUDO_MAP_IDX = 0x5 BPF_PSEUDO_MAP_IDX_VALUE = 0x6 BPF_PSEUDO_MAP_VALUE = 0x2 BPF_RET = 0x6 BPF_RSH = 0x70 BPF_ST = 0x2 BPF_STORE_REL = 0x110 BPF_STX = 0x3 BPF_SUB = 0x10 BPF_TAG_SIZE = 0x8 BPF_TAX = 0x0 BPF_TO_BE = 0x8 BPF_TO_LE = 0x0 BPF_TXA = 0x80 BPF_W = 0x0 BPF_X = 0x8 BPF_XADD = 0xc0 BPF_XCHG = 0xe1 BPF_XOR = 0xa0 BRKINT = 0x2 BS0 = 0x0 BTRFS_SUPER_MAGIC = 0x9123683e BTRFS_TEST_MAGIC = 0x73727279 BUS_BLUETOOTH = 0x5 BUS_HIL = 0x4 BUS_USB = 0x3 BUS_VIRTUAL = 0x6 CAN_BCM = 0x2 CAN_BUS_OFF_THRESHOLD = 0x100 CAN_CTRLMODE_3_SAMPLES = 0x4 CAN_CTRLMODE_BERR_REPORTING = 0x10 CAN_CTRLMODE_CC_LEN8_DLC = 0x100 CAN_CTRLMODE_FD = 0x20 CAN_CTRLMODE_FD_NON_ISO = 0x80 CAN_CTRLMODE_LISTENONLY = 0x2 CAN_CTRLMODE_LOOPBACK = 0x1 CAN_CTRLMODE_ONE_SHOT = 0x8 CAN_CTRLMODE_PRESUME_ACK = 0x40 CAN_CTRLMODE_TDC_AUTO = 0x200 CAN_CTRLMODE_TDC_MANUAL = 0x400 CAN_EFF_FLAG = 0x80000000 CAN_EFF_ID_BITS = 0x1d CAN_EFF_MASK = 0x1fffffff CAN_ERROR_PASSIVE_THRESHOLD = 0x80 CAN_ERROR_WARNING_THRESHOLD = 0x60 CAN_ERR_ACK = 0x20 CAN_ERR_BUSERROR = 0x80 CAN_ERR_BUSOFF = 0x40 CAN_ERR_CNT = 0x200 CAN_ERR_CRTL = 0x4 CAN_ERR_CRTL_ACTIVE = 0x40 CAN_ERR_CRTL_RX_OVERFLOW = 0x1 CAN_ERR_CRTL_RX_PASSIVE = 0x10 CAN_ERR_CRTL_RX_WARNING = 0x4 CAN_ERR_CRTL_TX_OVERFLOW = 0x2 CAN_ERR_CRTL_TX_PASSIVE = 0x20 CAN_ERR_CRTL_TX_WARNING = 0x8 CAN_ERR_CRTL_UNSPEC = 0x0 CAN_ERR_DLC = 0x8 CAN_ERR_FLAG = 0x20000000 CAN_ERR_LOSTARB = 0x2 CAN_ERR_LOSTARB_UNSPEC = 0x0 CAN_ERR_MASK = 0x1fffffff CAN_ERR_PROT = 0x8 CAN_ERR_PROT_ACTIVE = 0x40 CAN_ERR_PROT_BIT = 0x1 CAN_ERR_PROT_BIT0 = 0x8 CAN_ERR_PROT_BIT1 = 0x10 CAN_ERR_PROT_FORM = 0x2 CAN_ERR_PROT_LOC_ACK = 0x19 CAN_ERR_PROT_LOC_ACK_DEL = 0x1b CAN_ERR_PROT_LOC_CRC_DEL = 0x18 CAN_ERR_PROT_LOC_CRC_SEQ = 0x8 CAN_ERR_PROT_LOC_DATA = 0xa CAN_ERR_PROT_LOC_DLC = 0xb CAN_ERR_PROT_LOC_EOF = 0x1a CAN_ERR_PROT_LOC_ID04_00 = 0xe CAN_ERR_PROT_LOC_ID12_05 = 0xf CAN_ERR_PROT_LOC_ID17_13 = 0x7 CAN_ERR_PROT_LOC_ID20_18 = 0x6 CAN_ERR_PROT_LOC_ID28_21 = 0x2 CAN_ERR_PROT_LOC_IDE = 0x5 CAN_ERR_PROT_LOC_INTERM = 0x12 CAN_ERR_PROT_LOC_RES0 = 0x9 CAN_ERR_PROT_LOC_RES1 = 0xd CAN_ERR_PROT_LOC_RTR = 0xc CAN_ERR_PROT_LOC_SOF = 0x3 CAN_ERR_PROT_LOC_SRTR = 0x4 CAN_ERR_PROT_LOC_UNSPEC = 0x0 CAN_ERR_PROT_OVERLOAD = 0x20 CAN_ERR_PROT_STUFF = 0x4 CAN_ERR_PROT_TX = 0x80 CAN_ERR_PROT_UNSPEC = 0x0 CAN_ERR_RESTARTED = 0x100 CAN_ERR_TRX = 0x10 CAN_ERR_TRX_CANH_NO_WIRE = 0x4 CAN_ERR_TRX_CANH_SHORT_TO_BAT = 0x5 CAN_ERR_TRX_CANH_SHORT_TO_GND = 0x7 CAN_ERR_TRX_CANH_SHORT_TO_VCC = 0x6 CAN_ERR_TRX_CANL_NO_WIRE = 0x40 CAN_ERR_TRX_CANL_SHORT_TO_BAT = 0x50 CAN_ERR_TRX_CANL_SHORT_TO_CANH = 0x80 CAN_ERR_TRX_CANL_SHORT_TO_GND = 0x70 CAN_ERR_TRX_CANL_SHORT_TO_VCC = 0x60 CAN_ERR_TRX_UNSPEC = 0x0 CAN_ERR_TX_TIMEOUT = 0x1 CAN_INV_FILTER = 0x20000000 CAN_ISOTP = 0x6 CAN_J1939 = 0x7 CAN_MAX_DLC = 0x8 CAN_MAX_DLEN = 0x8 CAN_MAX_RAW_DLC = 0xf CAN_MCNET = 0x5 CAN_MTU = 0x10 CAN_NPROTO = 0x8 CAN_RAW = 0x1 CAN_RAW_FILTER_MAX = 0x200 CAN_RAW_XL_VCID_RX_FILTER = 0x4 CAN_RAW_XL_VCID_TX_PASS = 0x2 CAN_RAW_XL_VCID_TX_SET = 0x1 CAN_RTR_FLAG = 0x40000000 CAN_SFF_ID_BITS = 0xb CAN_SFF_MASK = 0x7ff CAN_TERMINATION_DISABLED = 0x0 CAN_TP16 = 0x3 CAN_TP20 = 0x4 CAP_AUDIT_CONTROL = 0x1e CAP_AUDIT_READ = 0x25 CAP_AUDIT_WRITE = 0x1d CAP_BLOCK_SUSPEND = 0x24 CAP_BPF = 0x27 CAP_CHECKPOINT_RESTORE = 0x28 CAP_CHOWN = 0x0 CAP_DAC_OVERRIDE = 0x1 CAP_DAC_READ_SEARCH = 0x2 CAP_FOWNER = 0x3 CAP_FSETID = 0x4 CAP_IPC_LOCK = 0xe CAP_IPC_OWNER = 0xf CAP_KILL = 0x5 CAP_LAST_CAP = 0x28 CAP_LEASE = 0x1c CAP_LINUX_IMMUTABLE = 0x9 CAP_MAC_ADMIN = 0x21 CAP_MAC_OVERRIDE = 0x20 CAP_MKNOD = 0x1b CAP_NET_ADMIN = 0xc CAP_NET_BIND_SERVICE = 0xa CAP_NET_BROADCAST = 0xb CAP_NET_RAW = 0xd CAP_PERFMON = 0x26 CAP_SETFCAP = 0x1f CAP_SETGID = 0x6 CAP_SETPCAP = 0x8 CAP_SETUID = 0x7 CAP_SYSLOG = 0x22 CAP_SYS_ADMIN = 0x15 CAP_SYS_BOOT = 0x16 CAP_SYS_CHROOT = 0x12 CAP_SYS_MODULE = 0x10 CAP_SYS_NICE = 0x17 CAP_SYS_PACCT = 0x14 CAP_SYS_PTRACE = 0x13 CAP_SYS_RAWIO = 0x11 CAP_SYS_RESOURCE = 0x18 CAP_SYS_TIME = 0x19 CAP_SYS_TTY_CONFIG = 0x1a CAP_WAKE_ALARM = 0x23 CEPH_SUPER_MAGIC = 0xc36400 CFLUSH = 0xf CGROUP2_SUPER_MAGIC = 0x63677270 CGROUP_SUPER_MAGIC = 0x27e0eb CIFS_SUPER_MAGIC = 0xff534d42 CLOCK_BOOTTIME = 0x7 CLOCK_BOOTTIME_ALARM = 0x9 CLOCK_DEFAULT = 0x0 CLOCK_EXT = 0x1 CLOCK_INT = 0x2 CLOCK_MONOTONIC = 0x1 CLOCK_MONOTONIC_COARSE = 0x6 CLOCK_MONOTONIC_RAW = 0x4 CLOCK_PROCESS_CPUTIME_ID = 0x2 CLOCK_REALTIME = 0x0 CLOCK_REALTIME_ALARM = 0x8 CLOCK_REALTIME_COARSE = 0x5 CLOCK_TAI = 0xb CLOCK_THREAD_CPUTIME_ID = 0x3 CLOCK_TXFROMRX = 0x4 CLOCK_TXINT = 0x3 CLONE_ARGS_SIZE_VER0 = 0x40 CLONE_ARGS_SIZE_VER1 = 0x50 CLONE_ARGS_SIZE_VER2 = 0x58 CLONE_CHILD_CLEARTID = 0x200000 CLONE_CHILD_SETTID = 0x1000000 CLONE_CLEAR_SIGHAND = 0x100000000 CLONE_DETACHED = 0x400000 CLONE_FILES = 0x400 CLONE_FS = 0x200 CLONE_INTO_CGROUP = 0x200000000 CLONE_IO = 0x80000000 CLONE_NEWCGROUP = 0x2000000 CLONE_NEWIPC = 0x8000000 CLONE_NEWNET = 0x40000000 CLONE_NEWNS = 0x20000 CLONE_NEWPID = 0x20000000 CLONE_NEWTIME = 0x80 CLONE_NEWUSER = 0x10000000 CLONE_NEWUTS = 0x4000000 CLONE_PARENT = 0x8000 CLONE_PARENT_SETTID = 0x100000 CLONE_PIDFD = 0x1000 CLONE_PTRACE = 0x2000 CLONE_SETTLS = 0x80000 CLONE_SIGHAND = 0x800 CLONE_SYSVSEM = 0x40000 CLONE_THREAD = 0x10000 CLONE_UNTRACED = 0x800000 CLONE_VFORK = 0x4000 CLONE_VM = 0x100 CMSPAR = 0x40000000 CODA_SUPER_MAGIC = 0x73757245 CR0 = 0x0 CRAMFS_MAGIC = 0x28cd3d45 CRTSCTS = 0x80000000 CRYPTO_MAX_NAME = 0x40 CRYPTO_MSG_MAX = 0x15 CRYPTO_NR_MSGTYPES = 0x6 CRYPTO_REPORT_MAXSIZE = 0x160 CS5 = 0x0 CSIGNAL = 0xff CSTART = 0x11 CSTATUS = 0x0 CSTOP = 0x13 CSUSP = 0x1a DAXFS_MAGIC = 0x64646178 DEBUGFS_MAGIC = 0x64626720 DEVLINK_CMD_ESWITCH_MODE_GET = 0x1d DEVLINK_CMD_ESWITCH_MODE_SET = 0x1e DEVLINK_FLASH_OVERWRITE_IDENTIFIERS = 0x2 DEVLINK_FLASH_OVERWRITE_SETTINGS = 0x1 DEVLINK_GENL_MCGRP_CONFIG_NAME = "config" DEVLINK_GENL_NAME = "devlink" DEVLINK_GENL_VERSION = 0x1 DEVLINK_PORT_FN_CAP_IPSEC_CRYPTO = 0x4 DEVLINK_PORT_FN_CAP_IPSEC_PACKET = 0x8 DEVLINK_PORT_FN_CAP_MIGRATABLE = 0x2 DEVLINK_PORT_FN_CAP_ROCE = 0x1 DEVLINK_SB_THRESHOLD_TO_ALPHA_MAX = 0x14 DEVLINK_SUPPORTED_FLASH_OVERWRITE_SECTIONS = 0x3 DEVMEM_MAGIC = 0x454d444d DEVPTS_SUPER_MAGIC = 0x1cd1 DMA_BUF_MAGIC = 0x444d4142 DM_ACTIVE_PRESENT_FLAG = 0x20 DM_BUFFER_FULL_FLAG = 0x100 DM_CONTROL_NODE = "control" DM_DATA_OUT_FLAG = 0x10000 DM_DEFERRED_REMOVE = 0x20000 DM_DEV_ARM_POLL = 0xc138fd10 DM_DEV_CREATE = 0xc138fd03 DM_DEV_REMOVE = 0xc138fd04 DM_DEV_RENAME = 0xc138fd05 DM_DEV_SET_GEOMETRY = 0xc138fd0f DM_DEV_STATUS = 0xc138fd07 DM_DEV_SUSPEND = 0xc138fd06 DM_DEV_WAIT = 0xc138fd08 DM_DIR = "mapper" DM_GET_TARGET_VERSION = 0xc138fd11 DM_IMA_MEASUREMENT_FLAG = 0x80000 DM_INACTIVE_PRESENT_FLAG = 0x40 DM_INTERNAL_SUSPEND_FLAG = 0x40000 DM_IOCTL = 0xfd DM_LIST_DEVICES = 0xc138fd02 DM_LIST_VERSIONS = 0xc138fd0d DM_MAX_TYPE_NAME = 0x10 DM_NAME_LEN = 0x80 DM_NAME_LIST_FLAG_DOESNT_HAVE_UUID = 0x2 DM_NAME_LIST_FLAG_HAS_UUID = 0x1 DM_NOFLUSH_FLAG = 0x800 DM_PERSISTENT_DEV_FLAG = 0x8 DM_QUERY_INACTIVE_TABLE_FLAG = 0x1000 DM_READONLY_FLAG = 0x1 DM_REMOVE_ALL = 0xc138fd01 DM_SECURE_DATA_FLAG = 0x8000 DM_SKIP_BDGET_FLAG = 0x200 DM_SKIP_LOCKFS_FLAG = 0x400 DM_STATUS_TABLE_FLAG = 0x10 DM_SUSPEND_FLAG = 0x2 DM_TABLE_CLEAR = 0xc138fd0a DM_TABLE_DEPS = 0xc138fd0b DM_TABLE_LOAD = 0xc138fd09 DM_TABLE_STATUS = 0xc138fd0c DM_TARGET_MSG = 0xc138fd0e DM_UEVENT_GENERATED_FLAG = 0x2000 DM_UUID_FLAG = 0x4000 DM_UUID_LEN = 0x81 DM_VERSION = 0xc138fd00 DM_VERSION_EXTRA = "-ioctl (2025-04-28)" DM_VERSION_MAJOR = 0x4 DM_VERSION_MINOR = 0x32 DM_VERSION_PATCHLEVEL = 0x0 DT_ADDRRNGHI = 0x6ffffeff DT_ADDRRNGLO = 0x6ffffe00 DT_BLK = 0x6 DT_CHR = 0x2 DT_DEBUG = 0x15 DT_DIR = 0x4 DT_ENCODING = 0x20 DT_FIFO = 0x1 DT_FINI = 0xd DT_FLAGS_1 = 0x6ffffffb DT_GNU_HASH = 0x6ffffef5 DT_HASH = 0x4 DT_HIOS = 0x6ffff000 DT_HIPROC = 0x7fffffff DT_INIT = 0xc DT_JMPREL = 0x17 DT_LNK = 0xa DT_LOOS = 0x6000000d DT_LOPROC = 0x70000000 DT_NEEDED = 0x1 DT_NULL = 0x0 DT_PLTGOT = 0x3 DT_PLTREL = 0x14 DT_PLTRELSZ = 0x2 DT_REG = 0x8 DT_REL = 0x11 DT_RELA = 0x7 DT_RELACOUNT = 0x6ffffff9 DT_RELAENT = 0x9 DT_RELASZ = 0x8 DT_RELCOUNT = 0x6ffffffa DT_RELENT = 0x13 DT_RELSZ = 0x12 DT_RPATH = 0xf DT_SOCK = 0xc DT_SONAME = 0xe DT_STRSZ = 0xa DT_STRTAB = 0x5 DT_SYMBOLIC = 0x10 DT_SYMENT = 0xb DT_SYMTAB = 0x6 DT_TEXTREL = 0x16 DT_UNKNOWN = 0x0 DT_VALRNGHI = 0x6ffffdff DT_VALRNGLO = 0x6ffffd00 DT_VERDEF = 0x6ffffffc DT_VERDEFNUM = 0x6ffffffd DT_VERNEED = 0x6ffffffe DT_VERNEEDNUM = 0x6fffffff DT_VERSYM = 0x6ffffff0 DT_WHT = 0xe ECHO = 0x8 ECRYPTFS_SUPER_MAGIC = 0xf15f EFD_SEMAPHORE = 0x1 EFIVARFS_MAGIC = 0xde5e81e4 EFS_SUPER_MAGIC = 0x414a53 EI_CLASS = 0x4 EI_DATA = 0x5 EI_MAG0 = 0x0 EI_MAG1 = 0x1 EI_MAG2 = 0x2 EI_MAG3 = 0x3 EI_NIDENT = 0x10 EI_OSABI = 0x7 EI_PAD = 0x8 EI_VERSION = 0x6 ELFCLASS32 = 0x1 ELFCLASS64 = 0x2 ELFCLASSNONE = 0x0 ELFCLASSNUM = 0x3 ELFDATA2LSB = 0x1 ELFDATA2MSB = 0x2 ELFDATANONE = 0x0 ELFMAG = "\177ELF" ELFMAG0 = 0x7f ELFMAG1 = 'E' ELFMAG2 = 'L' ELFMAG3 = 'F' ELFOSABI_LINUX = 0x3 ELFOSABI_NONE = 0x0 EM_386 = 0x3 EM_486 = 0x6 EM_68K = 0x4 EM_860 = 0x7 EM_88K = 0x5 EM_AARCH64 = 0xb7 EM_ALPHA = 0x9026 EM_ALTERA_NIOS2 = 0x71 EM_ARCOMPACT = 0x5d EM_ARCV2 = 0xc3 EM_ARM = 0x28 EM_BLACKFIN = 0x6a EM_BPF = 0xf7 EM_CRIS = 0x4c EM_CSKY = 0xfc EM_CYGNUS_M32R = 0x9041 EM_CYGNUS_MN10300 = 0xbeef EM_FRV = 0x5441 EM_H8_300 = 0x2e EM_HEXAGON = 0xa4 EM_IA_64 = 0x32 EM_LOONGARCH = 0x102 EM_M32 = 0x1 EM_M32R = 0x58 EM_MICROBLAZE = 0xbd EM_MIPS = 0x8 EM_MIPS_RS3_LE = 0xa EM_MIPS_RS4_BE = 0xa EM_MN10300 = 0x59 EM_NDS32 = 0xa7 EM_NONE = 0x0 EM_OPENRISC = 0x5c EM_PARISC = 0xf EM_PPC = 0x14 EM_PPC64 = 0x15 EM_RISCV = 0xf3 EM_S390 = 0x16 EM_S390_OLD = 0xa390 EM_SH = 0x2a EM_SPARC = 0x2 EM_SPARC32PLUS = 0x12 EM_SPARCV9 = 0x2b EM_SPU = 0x17 EM_TILEGX = 0xbf EM_TILEPRO = 0xbc EM_TI_C6000 = 0x8c EM_UNICORE = 0x6e EM_X86_64 = 0x3e EM_XTENSA = 0x5e ENCODING_DEFAULT = 0x0 ENCODING_FM_MARK = 0x3 ENCODING_FM_SPACE = 0x4 ENCODING_MANCHESTER = 0x5 ENCODING_NRZ = 0x1 ENCODING_NRZI = 0x2 EPOLLERR = 0x8 EPOLLET = 0x80000000 EPOLLEXCLUSIVE = 0x10000000 EPOLLHUP = 0x10 EPOLLIN = 0x1 EPOLLMSG = 0x400 EPOLLONESHOT = 0x40000000 EPOLLOUT = 0x4 EPOLLPRI = 0x2 EPOLLRDBAND = 0x80 EPOLLRDHUP = 0x2000 EPOLLRDNORM = 0x40 EPOLLWAKEUP = 0x20000000 EPOLLWRBAND = 0x200 EPOLLWRNORM = 0x100 EPOLL_CTL_ADD = 0x1 EPOLL_CTL_DEL = 0x2 EPOLL_CTL_MOD = 0x3 EPOLL_IOC_TYPE = 0x8a EROFS_SUPER_MAGIC_V1 = 0xe0f5e1e2 ETHTOOL_BUSINFO_LEN = 0x20 ETHTOOL_EROMVERS_LEN = 0x20 ETHTOOL_FAMILY_NAME = "ethtool" ETHTOOL_FAMILY_VERSION = 0x1 ETHTOOL_FEC_AUTO = 0x2 ETHTOOL_FEC_BASER = 0x10 ETHTOOL_FEC_LLRS = 0x20 ETHTOOL_FEC_NONE = 0x1 ETHTOOL_FEC_OFF = 0x4 ETHTOOL_FEC_RS = 0x8 ETHTOOL_FLAG_ALL = 0x7 ETHTOOL_FLASHDEV = 0x33 ETHTOOL_FLASH_MAX_FILENAME = 0x80 ETHTOOL_FWVERS_LEN = 0x20 ETHTOOL_F_COMPAT = 0x4 ETHTOOL_F_UNSUPPORTED = 0x1 ETHTOOL_F_WISH = 0x2 ETHTOOL_GCHANNELS = 0x3c ETHTOOL_GCOALESCE = 0xe ETHTOOL_GDRVINFO = 0x3 ETHTOOL_GEEE = 0x44 ETHTOOL_GEEPROM = 0xb ETHTOOL_GENL_NAME = "ethtool" ETHTOOL_GENL_VERSION = 0x1 ETHTOOL_GET_DUMP_DATA = 0x40 ETHTOOL_GET_DUMP_FLAG = 0x3f ETHTOOL_GET_TS_INFO = 0x41 ETHTOOL_GFEATURES = 0x3a ETHTOOL_GFECPARAM = 0x50 ETHTOOL_GFLAGS = 0x25 ETHTOOL_GGRO = 0x2b ETHTOOL_GGSO = 0x23 ETHTOOL_GLINK = 0xa ETHTOOL_GLINKSETTINGS = 0x4c ETHTOOL_GMODULEEEPROM = 0x43 ETHTOOL_GMODULEINFO = 0x42 ETHTOOL_GMSGLVL = 0x7 ETHTOOL_GPAUSEPARAM = 0x12 ETHTOOL_GPERMADDR = 0x20 ETHTOOL_GPFLAGS = 0x27 ETHTOOL_GPHYSTATS = 0x4a ETHTOOL_GREGS = 0x4 ETHTOOL_GRINGPARAM = 0x10 ETHTOOL_GRSSH = 0x46 ETHTOOL_GRXCLSRLALL = 0x30 ETHTOOL_GRXCLSRLCNT = 0x2e ETHTOOL_GRXCLSRULE = 0x2f ETHTOOL_GRXCSUM = 0x14 ETHTOOL_GRXFH = 0x29 ETHTOOL_GRXFHINDIR = 0x38 ETHTOOL_GRXNTUPLE = 0x36 ETHTOOL_GRXRINGS = 0x2d ETHTOOL_GSET = 0x1 ETHTOOL_GSG = 0x18 ETHTOOL_GSSET_INFO = 0x37 ETHTOOL_GSTATS = 0x1d ETHTOOL_GSTRINGS = 0x1b ETHTOOL_GTSO = 0x1e ETHTOOL_GTUNABLE = 0x48 ETHTOOL_GTXCSUM = 0x16 ETHTOOL_GUFO = 0x21 ETHTOOL_GWOL = 0x5 ETHTOOL_MCGRP_MONITOR_NAME = "monitor" ETHTOOL_NWAY_RST = 0x9 ETHTOOL_PERQUEUE = 0x4b ETHTOOL_PHYS_ID = 0x1c ETHTOOL_PHY_EDPD_DFLT_TX_MSECS = 0xffff ETHTOOL_PHY_EDPD_DISABLE = 0x0 ETHTOOL_PHY_EDPD_NO_TX = 0xfffe ETHTOOL_PHY_FAST_LINK_DOWN_OFF = 0xff ETHTOOL_PHY_FAST_LINK_DOWN_ON = 0x0 ETHTOOL_PHY_GTUNABLE = 0x4e ETHTOOL_PHY_STUNABLE = 0x4f ETHTOOL_RESET = 0x34 ETHTOOL_RXNTUPLE_ACTION_CLEAR = -0x2 ETHTOOL_RXNTUPLE_ACTION_DROP = -0x1 ETHTOOL_RX_FLOW_SPEC_RING = 0xffffffff ETHTOOL_RX_FLOW_SPEC_RING_VF = 0xff00000000 ETHTOOL_RX_FLOW_SPEC_RING_VF_OFF = 0x20 ETHTOOL_SCHANNELS = 0x3d ETHTOOL_SCOALESCE = 0xf ETHTOOL_SEEE = 0x45 ETHTOOL_SEEPROM = 0xc ETHTOOL_SET_DUMP = 0x3e ETHTOOL_SFEATURES = 0x3b ETHTOOL_SFECPARAM = 0x51 ETHTOOL_SFLAGS = 0x26 ETHTOOL_SGRO = 0x2c ETHTOOL_SGSO = 0x24 ETHTOOL_SLINKSETTINGS = 0x4d ETHTOOL_SMSGLVL = 0x8 ETHTOOL_SPAUSEPARAM = 0x13 ETHTOOL_SPFLAGS = 0x28 ETHTOOL_SRINGPARAM = 0x11 ETHTOOL_SRSSH = 0x47 ETHTOOL_SRXCLSRLDEL = 0x31 ETHTOOL_SRXCLSRLINS = 0x32 ETHTOOL_SRXCSUM = 0x15 ETHTOOL_SRXFH = 0x2a ETHTOOL_SRXFHINDIR = 0x39 ETHTOOL_SRXNTUPLE = 0x35 ETHTOOL_SSET = 0x2 ETHTOOL_SSG = 0x19 ETHTOOL_STSO = 0x1f ETHTOOL_STUNABLE = 0x49 ETHTOOL_STXCSUM = 0x17 ETHTOOL_SUFO = 0x22 ETHTOOL_SWOL = 0x6 ETHTOOL_TEST = 0x1a ETH_P_1588 = 0x88f7 ETH_P_8021AD = 0x88a8 ETH_P_8021AH = 0x88e7 ETH_P_8021Q = 0x8100 ETH_P_80221 = 0x8917 ETH_P_802_2 = 0x4 ETH_P_802_3 = 0x1 ETH_P_802_3_MIN = 0x600 ETH_P_802_EX1 = 0x88b5 ETH_P_AARP = 0x80f3 ETH_P_AF_IUCV = 0xfbfb ETH_P_ALL = 0x3 ETH_P_AOE = 0x88a2 ETH_P_ARCNET = 0x1a ETH_P_ARP = 0x806 ETH_P_ATALK = 0x809b ETH_P_ATMFATE = 0x8884 ETH_P_ATMMPOA = 0x884c ETH_P_AX25 = 0x2 ETH_P_BATMAN = 0x4305 ETH_P_BPQ = 0x8ff ETH_P_CAIF = 0xf7 ETH_P_CAN = 0xc ETH_P_CANFD = 0xd ETH_P_CANXL = 0xe ETH_P_CFM = 0x8902 ETH_P_CONTROL = 0x16 ETH_P_CUST = 0x6006 ETH_P_DDCMP = 0x6 ETH_P_DEC = 0x6000 ETH_P_DIAG = 0x6005 ETH_P_DNA_DL = 0x6001 ETH_P_DNA_RC = 0x6002 ETH_P_DNA_RT = 0x6003 ETH_P_DSA = 0x1b ETH_P_DSA_8021Q = 0xdadb ETH_P_DSA_A5PSW = 0xe001 ETH_P_ECONET = 0x18 ETH_P_EDSA = 0xdada ETH_P_ERSPAN = 0x88be ETH_P_ERSPAN2 = 0x22eb ETH_P_ETHERCAT = 0x88a4 ETH_P_FCOE = 0x8906 ETH_P_FIP = 0x8914 ETH_P_HDLC = 0x19 ETH_P_HSR = 0x892f ETH_P_IBOE = 0x8915 ETH_P_IEEE802154 = 0xf6 ETH_P_IEEEPUP = 0xa00 ETH_P_IEEEPUPAT = 0xa01 ETH_P_IFE = 0xed3e ETH_P_IP = 0x800 ETH_P_IPV6 = 0x86dd ETH_P_IPX = 0x8137 ETH_P_IRDA = 0x17 ETH_P_LAT = 0x6004 ETH_P_LINK_CTL = 0x886c ETH_P_LLDP = 0x88cc ETH_P_LOCALTALK = 0x9 ETH_P_LOOP = 0x60 ETH_P_LOOPBACK = 0x9000 ETH_P_MACSEC = 0x88e5 ETH_P_MAP = 0xf9 ETH_P_MCTP = 0xfa ETH_P_MOBITEX = 0x15 ETH_P_MPLS_MC = 0x8848 ETH_P_MPLS_UC = 0x8847 ETH_P_MRP = 0x88e3 ETH_P_MVRP = 0x88f5 ETH_P_NCSI = 0x88f8 ETH_P_NSH = 0x894f ETH_P_PAE = 0x888e ETH_P_PAUSE = 0x8808 ETH_P_PHONET = 0xf5 ETH_P_PPPTALK = 0x10 ETH_P_PPP_DISC = 0x8863 ETH_P_PPP_MP = 0x8 ETH_P_PPP_SES = 0x8864 ETH_P_PREAUTH = 0x88c7 ETH_P_PROFINET = 0x8892 ETH_P_PRP = 0x88fb ETH_P_PUP = 0x200 ETH_P_PUPAT = 0x201 ETH_P_QINQ1 = 0x9100 ETH_P_QINQ2 = 0x9200 ETH_P_QINQ3 = 0x9300 ETH_P_RARP = 0x8035 ETH_P_REALTEK = 0x8899 ETH_P_SCA = 0x6007 ETH_P_SLOW = 0x8809 ETH_P_SNAP = 0x5 ETH_P_TDLS = 0x890d ETH_P_TEB = 0x6558 ETH_P_TIPC = 0x88ca ETH_P_TRAILER = 0x1c ETH_P_TR_802_2 = 0x11 ETH_P_TSN = 0x22f0 ETH_P_WAN_PPP = 0x7 ETH_P_WCCP = 0x883e ETH_P_X25 = 0x805 ETH_P_XDSA = 0xf8 ET_CORE = 0x4 ET_DYN = 0x3 ET_EXEC = 0x2 ET_HIPROC = 0xffff ET_LOPROC = 0xff00 ET_NONE = 0x0 ET_REL = 0x1 EV_ABS = 0x3 EV_CNT = 0x20 EV_CURRENT = 0x1 EV_FF = 0x15 EV_FF_STATUS = 0x17 EV_KEY = 0x1 EV_LED = 0x11 EV_MAX = 0x1f EV_MSC = 0x4 EV_NONE = 0x0 EV_NUM = 0x2 EV_PWR = 0x16 EV_REL = 0x2 EV_REP = 0x14 EV_SND = 0x12 EV_SW = 0x5 EV_SYN = 0x0 EV_VERSION = 0x10001 EXABYTE_ENABLE_NEST = 0xf0 EXFAT_SUPER_MAGIC = 0x2011bab0 EXT2_SUPER_MAGIC = 0xef53 EXT3_SUPER_MAGIC = 0xef53 EXT4_SUPER_MAGIC = 0xef53 EXTA = 0xe EXTB = 0xf F2FS_SUPER_MAGIC = 0xf2f52010 FALLOC_FL_ALLOCATE_RANGE = 0x0 FALLOC_FL_COLLAPSE_RANGE = 0x8 FALLOC_FL_INSERT_RANGE = 0x20 FALLOC_FL_KEEP_SIZE = 0x1 FALLOC_FL_NO_HIDE_STALE = 0x4 FALLOC_FL_PUNCH_HOLE = 0x2 FALLOC_FL_UNSHARE_RANGE = 0x40 FALLOC_FL_ZERO_RANGE = 0x10 FANOTIFY_METADATA_VERSION = 0x3 FAN_ACCESS = 0x1 FAN_ACCESS_PERM = 0x20000 FAN_ALLOW = 0x1 FAN_ALL_CLASS_BITS = 0xc FAN_ALL_EVENTS = 0x3b FAN_ALL_INIT_FLAGS = 0x3f FAN_ALL_MARK_FLAGS = 0xff FAN_ALL_OUTGOING_EVENTS = 0x3403b FAN_ALL_PERM_EVENTS = 0x30000 FAN_ATTRIB = 0x4 FAN_AUDIT = 0x10 FAN_CLASS_CONTENT = 0x4 FAN_CLASS_NOTIF = 0x0 FAN_CLASS_PRE_CONTENT = 0x8 FAN_CLOEXEC = 0x1 FAN_CLOSE = 0x18 FAN_CLOSE_NOWRITE = 0x10 FAN_CLOSE_WRITE = 0x8 FAN_CREATE = 0x100 FAN_DELETE = 0x200 FAN_DELETE_SELF = 0x400 FAN_DENY = 0x2 FAN_ENABLE_AUDIT = 0x40 FAN_EPIDFD = -0x2 FAN_ERRNO_BITS = 0x8 FAN_ERRNO_MASK = 0xff FAN_ERRNO_SHIFT = 0x18 FAN_EVENT_INFO_TYPE_DFID = 0x3 FAN_EVENT_INFO_TYPE_DFID_NAME = 0x2 FAN_EVENT_INFO_TYPE_ERROR = 0x5 FAN_EVENT_INFO_TYPE_FID = 0x1 FAN_EVENT_INFO_TYPE_MNT = 0x7 FAN_EVENT_INFO_TYPE_NEW_DFID_NAME = 0xc FAN_EVENT_INFO_TYPE_OLD_DFID_NAME = 0xa FAN_EVENT_INFO_TYPE_PIDFD = 0x4 FAN_EVENT_INFO_TYPE_RANGE = 0x6 FAN_EVENT_METADATA_LEN = 0x18 FAN_EVENT_ON_CHILD = 0x8000000 FAN_FS_ERROR = 0x8000 FAN_INFO = 0x20 FAN_MARK_ADD = 0x1 FAN_MARK_DONT_FOLLOW = 0x4 FAN_MARK_EVICTABLE = 0x200 FAN_MARK_FILESYSTEM = 0x100 FAN_MARK_FLUSH = 0x80 FAN_MARK_IGNORE = 0x400 FAN_MARK_IGNORED_MASK = 0x20 FAN_MARK_IGNORED_SURV_MODIFY = 0x40 FAN_MARK_IGNORE_SURV = 0x440 FAN_MARK_INODE = 0x0 FAN_MARK_MNTNS = 0x110 FAN_MARK_MOUNT = 0x10 FAN_MARK_ONLYDIR = 0x8 FAN_MARK_REMOVE = 0x2 FAN_MNT_ATTACH = 0x1000000 FAN_MNT_DETACH = 0x2000000 FAN_MODIFY = 0x2 FAN_MOVE = 0xc0 FAN_MOVED_FROM = 0x40 FAN_MOVED_TO = 0x80 FAN_MOVE_SELF = 0x800 FAN_NOFD = -0x1 FAN_NONBLOCK = 0x2 FAN_NOPIDFD = -0x1 FAN_ONDIR = 0x40000000 FAN_OPEN = 0x20 FAN_OPEN_EXEC = 0x1000 FAN_OPEN_EXEC_PERM = 0x40000 FAN_OPEN_PERM = 0x10000 FAN_PRE_ACCESS = 0x100000 FAN_Q_OVERFLOW = 0x4000 FAN_RENAME = 0x10000000 FAN_REPORT_DFID_NAME = 0xc00 FAN_REPORT_DFID_NAME_TARGET = 0x1e00 FAN_REPORT_DIR_FID = 0x400 FAN_REPORT_FD_ERROR = 0x2000 FAN_REPORT_FID = 0x200 FAN_REPORT_MNT = 0x4000 FAN_REPORT_NAME = 0x800 FAN_REPORT_PIDFD = 0x80 FAN_REPORT_TARGET_FID = 0x1000 FAN_REPORT_TID = 0x100 FAN_RESPONSE_INFO_AUDIT_RULE = 0x1 FAN_RESPONSE_INFO_NONE = 0x0 FAN_UNLIMITED_MARKS = 0x20 FAN_UNLIMITED_QUEUE = 0x10 FD_CLOEXEC = 0x1 FD_SETSIZE = 0x400 FF0 = 0x0 FIB_RULE_DEV_DETACHED = 0x8 FIB_RULE_FIND_SADDR = 0x10000 FIB_RULE_IIF_DETACHED = 0x8 FIB_RULE_INVERT = 0x2 FIB_RULE_OIF_DETACHED = 0x10 FIB_RULE_PERMANENT = 0x1 FIB_RULE_UNRESOLVED = 0x4 FIDEDUPERANGE = 0xc0189436 FSCRYPT_ADD_KEY_FLAG_HW_WRAPPED = 0x1 FSCRYPT_KEY_DESCRIPTOR_SIZE = 0x8 FSCRYPT_KEY_DESC_PREFIX = "fscrypt:" FSCRYPT_KEY_DESC_PREFIX_SIZE = 0x8 FSCRYPT_KEY_IDENTIFIER_SIZE = 0x10 FSCRYPT_KEY_REMOVAL_STATUS_FLAG_FILES_BUSY = 0x1 FSCRYPT_KEY_REMOVAL_STATUS_FLAG_OTHER_USERS = 0x2 FSCRYPT_KEY_SPEC_TYPE_DESCRIPTOR = 0x1 FSCRYPT_KEY_SPEC_TYPE_IDENTIFIER = 0x2 FSCRYPT_KEY_STATUS_ABSENT = 0x1 FSCRYPT_KEY_STATUS_FLAG_ADDED_BY_SELF = 0x1 FSCRYPT_KEY_STATUS_INCOMPLETELY_REMOVED = 0x3 FSCRYPT_KEY_STATUS_PRESENT = 0x2 FSCRYPT_MAX_KEY_SIZE = 0x40 FSCRYPT_MODE_ADIANTUM = 0x9 FSCRYPT_MODE_AES_128_CBC = 0x5 FSCRYPT_MODE_AES_128_CTS = 0x6 FSCRYPT_MODE_AES_256_CTS = 0x4 FSCRYPT_MODE_AES_256_HCTR2 = 0xa FSCRYPT_MODE_AES_256_XTS = 0x1 FSCRYPT_MODE_SM4_CTS = 0x8 FSCRYPT_MODE_SM4_XTS = 0x7 FSCRYPT_POLICY_FLAGS_PAD_16 = 0x2 FSCRYPT_POLICY_FLAGS_PAD_32 = 0x3 FSCRYPT_POLICY_FLAGS_PAD_4 = 0x0 FSCRYPT_POLICY_FLAGS_PAD_8 = 0x1 FSCRYPT_POLICY_FLAGS_PAD_MASK = 0x3 FSCRYPT_POLICY_FLAG_DIRECT_KEY = 0x4 FSCRYPT_POLICY_FLAG_IV_INO_LBLK_32 = 0x10 FSCRYPT_POLICY_FLAG_IV_INO_LBLK_64 = 0x8 FSCRYPT_POLICY_V1 = 0x0 FSCRYPT_POLICY_V2 = 0x2 FS_ENCRYPTION_MODE_ADIANTUM = 0x9 FS_ENCRYPTION_MODE_AES_128_CBC = 0x5 FS_ENCRYPTION_MODE_AES_128_CTS = 0x6 FS_ENCRYPTION_MODE_AES_256_CBC = 0x3 FS_ENCRYPTION_MODE_AES_256_CTS = 0x4 FS_ENCRYPTION_MODE_AES_256_GCM = 0x2 FS_ENCRYPTION_MODE_AES_256_XTS = 0x1 FS_ENCRYPTION_MODE_INVALID = 0x0 FS_IOC_ADD_ENCRYPTION_KEY = 0xc0506617 FS_IOC_GET_ENCRYPTION_KEY_STATUS = 0xc080661a FS_IOC_GET_ENCRYPTION_POLICY_EX = 0xc0096616 FS_IOC_MEASURE_VERITY = 0xc0046686 FS_IOC_READ_VERITY_METADATA = 0xc0286687 FS_IOC_REMOVE_ENCRYPTION_KEY = 0xc0406618 FS_IOC_REMOVE_ENCRYPTION_KEY_ALL_USERS = 0xc0406619 FS_KEY_DESCRIPTOR_SIZE = 0x8 FS_KEY_DESC_PREFIX = "fscrypt:" FS_KEY_DESC_PREFIX_SIZE = 0x8 FS_MAX_KEY_SIZE = 0x40 FS_POLICY_FLAGS_PAD_16 = 0x2 FS_POLICY_FLAGS_PAD_32 = 0x3 FS_POLICY_FLAGS_PAD_4 = 0x0 FS_POLICY_FLAGS_PAD_8 = 0x1 FS_POLICY_FLAGS_PAD_MASK = 0x3 FS_POLICY_FLAGS_VALID = 0x7 FS_VERITY_FL = 0x100000 FS_VERITY_HASH_ALG_SHA256 = 0x1 FS_VERITY_HASH_ALG_SHA512 = 0x2 FS_VERITY_METADATA_TYPE_DESCRIPTOR = 0x2 FS_VERITY_METADATA_TYPE_MERKLE_TREE = 0x1 FS_VERITY_METADATA_TYPE_SIGNATURE = 0x3 FUSE_SUPER_MAGIC = 0x65735546 FUTEXFS_SUPER_MAGIC = 0xbad1dea F_ADD_SEALS = 0x409 F_CREATED_QUERY = 0x404 F_DUPFD = 0x0 F_DUPFD_CLOEXEC = 0x406 F_DUPFD_QUERY = 0x403 F_EXLCK = 0x4 F_GETFD = 0x1 F_GETFL = 0x3 F_GETLEASE = 0x401 F_GETOWN_EX = 0x10 F_GETPIPE_SZ = 0x408 F_GETSIG = 0xb F_GET_FILE_RW_HINT = 0x40d F_GET_RW_HINT = 0x40b F_GET_SEALS = 0x40a F_LOCK = 0x1 F_NOTIFY = 0x402 F_OFD_GETLK = 0x24 F_OFD_SETLK = 0x25 F_OFD_SETLKW = 0x26 F_OK = 0x0 F_SEAL_EXEC = 0x20 F_SEAL_FUTURE_WRITE = 0x10 F_SEAL_GROW = 0x4 F_SEAL_SEAL = 0x1 F_SEAL_SHRINK = 0x2 F_SEAL_WRITE = 0x8 F_SETFD = 0x2 F_SETFL = 0x4 F_SETLEASE = 0x400 F_SETOWN_EX = 0xf F_SETPIPE_SZ = 0x407 F_SETSIG = 0xa F_SET_FILE_RW_HINT = 0x40e F_SET_RW_HINT = 0x40c F_SHLCK = 0x8 F_TEST = 0x3 F_TLOCK = 0x2 F_ULOCK = 0x0 GENL_ADMIN_PERM = 0x1 GENL_CMD_CAP_DO = 0x2 GENL_CMD_CAP_DUMP = 0x4 GENL_CMD_CAP_HASPOL = 0x8 GENL_HDRLEN = 0x4 GENL_ID_CTRL = 0x10 GENL_ID_PMCRAID = 0x12 GENL_ID_VFS_DQUOT = 0x11 GENL_MAX_ID = 0x3ff GENL_MIN_ID = 0x10 GENL_NAMSIZ = 0x10 GENL_START_ALLOC = 0x13 GENL_UNS_ADMIN_PERM = 0x10 GRND_INSECURE = 0x4 GRND_NONBLOCK = 0x1 GRND_RANDOM = 0x2 HDIO_DRIVE_CMD = 0x31f HDIO_DRIVE_CMD_AEB = 0x31e HDIO_DRIVE_CMD_HDR_SIZE = 0x4 HDIO_DRIVE_HOB_HDR_SIZE = 0x8 HDIO_DRIVE_RESET = 0x31c HDIO_DRIVE_TASK = 0x31e HDIO_DRIVE_TASKFILE = 0x31d HDIO_DRIVE_TASK_HDR_SIZE = 0x8 HDIO_GETGEO = 0x301 HDIO_GET_32BIT = 0x309 HDIO_GET_ACOUSTIC = 0x30f HDIO_GET_ADDRESS = 0x310 HDIO_GET_BUSSTATE = 0x31a HDIO_GET_DMA = 0x30b HDIO_GET_IDENTITY = 0x30d HDIO_GET_KEEPSETTINGS = 0x308 HDIO_GET_MULTCOUNT = 0x304 HDIO_GET_NICE = 0x30c HDIO_GET_NOWERR = 0x30a HDIO_GET_QDMA = 0x305 HDIO_GET_UNMASKINTR = 0x302 HDIO_GET_WCACHE = 0x30e HDIO_OBSOLETE_IDENTITY = 0x307 HDIO_SCAN_HWIF = 0x328 HDIO_SET_32BIT = 0x324 HDIO_SET_ACOUSTIC = 0x32c HDIO_SET_ADDRESS = 0x32f HDIO_SET_BUSSTATE = 0x32d HDIO_SET_DMA = 0x326 HDIO_SET_KEEPSETTINGS = 0x323 HDIO_SET_MULTCOUNT = 0x321 HDIO_SET_NICE = 0x329 HDIO_SET_NOWERR = 0x325 HDIO_SET_PIO_MODE = 0x327 HDIO_SET_QDMA = 0x32e HDIO_SET_UNMASKINTR = 0x322 HDIO_SET_WCACHE = 0x32b HDIO_SET_XFER = 0x306 HDIO_TRISTATE_HWIF = 0x31b HDIO_UNREGISTER_HWIF = 0x32a HID_MAX_DESCRIPTOR_SIZE = 0x1000 HOSTFS_SUPER_MAGIC = 0xc0ffee HPFS_SUPER_MAGIC = 0xf995e849 HUGETLBFS_MAGIC = 0x958458f6 IBSHIFT = 0x10 ICRNL = 0x100 IFA_F_DADFAILED = 0x8 IFA_F_DEPRECATED = 0x20 IFA_F_HOMEADDRESS = 0x10 IFA_F_MANAGETEMPADDR = 0x100 IFA_F_MCAUTOJOIN = 0x400 IFA_F_NODAD = 0x2 IFA_F_NOPREFIXROUTE = 0x200 IFA_F_OPTIMISTIC = 0x4 IFA_F_PERMANENT = 0x80 IFA_F_SECONDARY = 0x1 IFA_F_STABLE_PRIVACY = 0x800 IFA_F_TEMPORARY = 0x1 IFA_F_TENTATIVE = 0x40 IFA_MAX = 0xb IFF_ALLMULTI = 0x200 IFF_ATTACH_QUEUE = 0x200 IFF_AUTOMEDIA = 0x4000 IFF_BROADCAST = 0x2 IFF_DEBUG = 0x4 IFF_DETACH_QUEUE = 0x400 IFF_DORMANT = 0x20000 IFF_DYNAMIC = 0x8000 IFF_ECHO = 0x40000 IFF_LOOPBACK = 0x8 IFF_LOWER_UP = 0x10000 IFF_MASTER = 0x400 IFF_MULTICAST = 0x1000 IFF_MULTI_QUEUE = 0x100 IFF_NAPI = 0x10 IFF_NAPI_FRAGS = 0x20 IFF_NOARP = 0x80 IFF_NOFILTER = 0x1000 IFF_NOTRAILERS = 0x20 IFF_NO_CARRIER = 0x40 IFF_NO_PI = 0x1000 IFF_ONE_QUEUE = 0x2000 IFF_PERSIST = 0x800 IFF_POINTOPOINT = 0x10 IFF_PORTSEL = 0x2000 IFF_PROMISC = 0x100 IFF_RUNNING = 0x40 IFF_SLAVE = 0x800 IFF_TAP = 0x2 IFF_TUN = 0x1 IFF_TUN_EXCL = 0x8000 IFF_UP = 0x1 IFF_VNET_HDR = 0x4000 IFF_VOLATILE = 0x70c5a IFNAMSIZ = 0x10 IGNBRK = 0x1 IGNCR = 0x80 IGNPAR = 0x4 IMAXBEL = 0x2000 INLCR = 0x40 INPCK = 0x10 IN_ACCESS = 0x1 IN_ALL_EVENTS = 0xfff IN_ATTRIB = 0x4 IN_CLASSA_HOST = 0xffffff IN_CLASSA_MAX = 0x80 IN_CLASSA_NET = 0xff000000 IN_CLASSA_NSHIFT = 0x18 IN_CLASSB_HOST = 0xffff IN_CLASSB_MAX = 0x10000 IN_CLASSB_NET = 0xffff0000 IN_CLASSB_NSHIFT = 0x10 IN_CLASSC_HOST = 0xff IN_CLASSC_NET = 0xffffff00 IN_CLASSC_NSHIFT = 0x8 IN_CLOSE = 0x18 IN_CLOSE_NOWRITE = 0x10 IN_CLOSE_WRITE = 0x8 IN_CREATE = 0x100 IN_DELETE = 0x200 IN_DELETE_SELF = 0x400 IN_DONT_FOLLOW = 0x2000000 IN_EXCL_UNLINK = 0x4000000 IN_IGNORED = 0x8000 IN_ISDIR = 0x40000000 IN_LOOPBACKNET = 0x7f IN_MASK_ADD = 0x20000000 IN_MASK_CREATE = 0x10000000 IN_MODIFY = 0x2 IN_MOVE = 0xc0 IN_MOVED_FROM = 0x40 IN_MOVED_TO = 0x80 IN_MOVE_SELF = 0x800 IN_ONESHOT = 0x80000000 IN_ONLYDIR = 0x1000000 IN_OPEN = 0x20 IN_Q_OVERFLOW = 0x4000 IN_UNMOUNT = 0x2000 IOCTL_MEI_CONNECT_CLIENT = 0xc0104801 IOCTL_MEI_CONNECT_CLIENT_VTAG = 0xc0144804 IPPROTO_AH = 0x33 IPPROTO_BEETPH = 0x5e IPPROTO_COMP = 0x6c IPPROTO_DCCP = 0x21 IPPROTO_DSTOPTS = 0x3c IPPROTO_EGP = 0x8 IPPROTO_ENCAP = 0x62 IPPROTO_ESP = 0x32 IPPROTO_ETHERNET = 0x8f IPPROTO_FRAGMENT = 0x2c IPPROTO_GRE = 0x2f IPPROTO_HOPOPTS = 0x0 IPPROTO_ICMP = 0x1 IPPROTO_ICMPV6 = 0x3a IPPROTO_IDP = 0x16 IPPROTO_IGMP = 0x2 IPPROTO_IP = 0x0 IPPROTO_IPIP = 0x4 IPPROTO_IPV6 = 0x29 IPPROTO_L2TP = 0x73 IPPROTO_MH = 0x87 IPPROTO_MPLS = 0x89 IPPROTO_MPTCP = 0x106 IPPROTO_MTP = 0x5c IPPROTO_NONE = 0x3b IPPROTO_PIM = 0x67 IPPROTO_PUP = 0xc IPPROTO_RAW = 0xff IPPROTO_ROUTING = 0x2b IPPROTO_RSVP = 0x2e IPPROTO_SCTP = 0x84 IPPROTO_SMC = 0x100 IPPROTO_TCP = 0x6 IPPROTO_TP = 0x1d IPPROTO_UDP = 0x11 IPPROTO_UDPLITE = 0x88 IPV6_2292DSTOPTS = 0x4 IPV6_2292HOPLIMIT = 0x8 IPV6_2292HOPOPTS = 0x3 IPV6_2292PKTINFO = 0x2 IPV6_2292PKTOPTIONS = 0x6 IPV6_2292RTHDR = 0x5 IPV6_ADDRFORM = 0x1 IPV6_ADDR_PREFERENCES = 0x48 IPV6_ADD_MEMBERSHIP = 0x14 IPV6_AUTHHDR = 0xa IPV6_AUTOFLOWLABEL = 0x46 IPV6_CHECKSUM = 0x7 IPV6_DONTFRAG = 0x3e IPV6_DROP_MEMBERSHIP = 0x15 IPV6_DSTOPTS = 0x3b IPV6_FREEBIND = 0x4e IPV6_HDRINCL = 0x24 IPV6_HOPLIMIT = 0x34 IPV6_HOPOPTS = 0x36 IPV6_IPSEC_POLICY = 0x22 IPV6_JOIN_ANYCAST = 0x1b IPV6_JOIN_GROUP = 0x14 IPV6_LEAVE_ANYCAST = 0x1c IPV6_LEAVE_GROUP = 0x15 IPV6_MINHOPCOUNT = 0x49 IPV6_MTU = 0x18 IPV6_MTU_DISCOVER = 0x17 IPV6_MULTICAST_ALL = 0x1d IPV6_MULTICAST_HOPS = 0x12 IPV6_MULTICAST_IF = 0x11 IPV6_MULTICAST_LOOP = 0x13 IPV6_NEXTHOP = 0x9 IPV6_ORIGDSTADDR = 0x4a IPV6_PATHMTU = 0x3d IPV6_PKTINFO = 0x32 IPV6_PMTUDISC_DO = 0x2 IPV6_PMTUDISC_DONT = 0x0 IPV6_PMTUDISC_INTERFACE = 0x4 IPV6_PMTUDISC_OMIT = 0x5 IPV6_PMTUDISC_PROBE = 0x3 IPV6_PMTUDISC_WANT = 0x1 IPV6_RECVDSTOPTS = 0x3a IPV6_RECVERR = 0x19 IPV6_RECVERR_RFC4884 = 0x1f IPV6_RECVFRAGSIZE = 0x4d IPV6_RECVHOPLIMIT = 0x33 IPV6_RECVHOPOPTS = 0x35 IPV6_RECVORIGDSTADDR = 0x4a IPV6_RECVPATHMTU = 0x3c IPV6_RECVPKTINFO = 0x31 IPV6_RECVRTHDR = 0x38 IPV6_RECVTCLASS = 0x42 IPV6_ROUTER_ALERT = 0x16 IPV6_ROUTER_ALERT_ISOLATE = 0x1e IPV6_RTHDR = 0x39 IPV6_RTHDRDSTOPTS = 0x37 IPV6_RTHDR_LOOSE = 0x0 IPV6_RTHDR_STRICT = 0x1 IPV6_RTHDR_TYPE_0 = 0x0 IPV6_RXDSTOPTS = 0x3b IPV6_RXHOPOPTS = 0x36 IPV6_TCLASS = 0x43 IPV6_TRANSPARENT = 0x4b IPV6_UNICAST_HOPS = 0x10 IPV6_UNICAST_IF = 0x4c IPV6_V6ONLY = 0x1a IPV6_VERSION = 0x60 IPV6_VERSION_MASK = 0xf0 IPV6_XFRM_POLICY = 0x23 IP_ADD_MEMBERSHIP = 0x23 IP_ADD_SOURCE_MEMBERSHIP = 0x27 IP_BIND_ADDRESS_NO_PORT = 0x18 IP_BLOCK_SOURCE = 0x26 IP_CHECKSUM = 0x17 IP_DEFAULT_MULTICAST_LOOP = 0x1 IP_DEFAULT_MULTICAST_TTL = 0x1 IP_DF = 0x4000 IP_DROP_MEMBERSHIP = 0x24 IP_DROP_SOURCE_MEMBERSHIP = 0x28 IP_FREEBIND = 0xf IP_HDRINCL = 0x3 IP_IPSEC_POLICY = 0x10 IP_LOCAL_PORT_RANGE = 0x33 IP_MAXPACKET = 0xffff IP_MAX_MEMBERSHIPS = 0x14 IP_MF = 0x2000 IP_MINTTL = 0x15 IP_MSFILTER = 0x29 IP_MSS = 0x240 IP_MTU = 0xe IP_MTU_DISCOVER = 0xa IP_MULTICAST_ALL = 0x31 IP_MULTICAST_IF = 0x20 IP_MULTICAST_LOOP = 0x22 IP_MULTICAST_TTL = 0x21 IP_NODEFRAG = 0x16 IP_OFFMASK = 0x1fff IP_OPTIONS = 0x4 IP_ORIGDSTADDR = 0x14 IP_PASSSEC = 0x12 IP_PKTINFO = 0x8 IP_PKTOPTIONS = 0x9 IP_PMTUDISC = 0xa IP_PMTUDISC_DO = 0x2 IP_PMTUDISC_DONT = 0x0 IP_PMTUDISC_INTERFACE = 0x4 IP_PMTUDISC_OMIT = 0x5 IP_PMTUDISC_PROBE = 0x3 IP_PMTUDISC_WANT = 0x1 IP_PROTOCOL = 0x34 IP_RECVERR = 0xb IP_RECVERR_RFC4884 = 0x1a IP_RECVFRAGSIZE = 0x19 IP_RECVOPTS = 0x6 IP_RECVORIGDSTADDR = 0x14 IP_RECVRETOPTS = 0x7 IP_RECVTOS = 0xd IP_RECVTTL = 0xc IP_RETOPTS = 0x7 IP_RF = 0x8000 IP_ROUTER_ALERT = 0x5 IP_TOS = 0x1 IP_TRANSPARENT = 0x13 IP_TTL = 0x2 IP_UNBLOCK_SOURCE = 0x25 IP_UNICAST_IF = 0x32 IP_XFRM_POLICY = 0x11 ISOFS_SUPER_MAGIC = 0x9660 ISTRIP = 0x20 ITIMER_PROF = 0x2 ITIMER_REAL = 0x0 ITIMER_VIRTUAL = 0x1 IUTF8 = 0x4000 IXANY = 0x800 JFFS2_SUPER_MAGIC = 0x72b6 KCMPROTO_CONNECTED = 0x0 KCM_RECV_DISABLE = 0x1 KEXEC_ARCH_386 = 0x30000 KEXEC_ARCH_68K = 0x40000 KEXEC_ARCH_AARCH64 = 0xb70000 KEXEC_ARCH_ARM = 0x280000 KEXEC_ARCH_DEFAULT = 0x0 KEXEC_ARCH_IA_64 = 0x320000 KEXEC_ARCH_LOONGARCH = 0x1020000 KEXEC_ARCH_MASK = 0xffff0000 KEXEC_ARCH_MIPS = 0x80000 KEXEC_ARCH_MIPS_LE = 0xa0000 KEXEC_ARCH_PARISC = 0xf0000 KEXEC_ARCH_PPC = 0x140000 KEXEC_ARCH_PPC64 = 0x150000 KEXEC_ARCH_RISCV = 0xf30000 KEXEC_ARCH_S390 = 0x160000 KEXEC_ARCH_SH = 0x2a0000 KEXEC_ARCH_X86_64 = 0x3e0000 KEXEC_CRASH_HOTPLUG_SUPPORT = 0x8 KEXEC_FILE_DEBUG = 0x8 KEXEC_FILE_NO_INITRAMFS = 0x4 KEXEC_FILE_ON_CRASH = 0x2 KEXEC_FILE_UNLOAD = 0x1 KEXEC_ON_CRASH = 0x1 KEXEC_PRESERVE_CONTEXT = 0x2 KEXEC_SEGMENT_MAX = 0x10 KEXEC_UPDATE_ELFCOREHDR = 0x4 KEYCTL_ASSUME_AUTHORITY = 0x10 KEYCTL_CAPABILITIES = 0x1f KEYCTL_CAPS0_BIG_KEY = 0x10 KEYCTL_CAPS0_CAPABILITIES = 0x1 KEYCTL_CAPS0_DIFFIE_HELLMAN = 0x4 KEYCTL_CAPS0_INVALIDATE = 0x20 KEYCTL_CAPS0_MOVE = 0x80 KEYCTL_CAPS0_PERSISTENT_KEYRINGS = 0x2 KEYCTL_CAPS0_PUBLIC_KEY = 0x8 KEYCTL_CAPS0_RESTRICT_KEYRING = 0x40 KEYCTL_CAPS1_NOTIFICATIONS = 0x4 KEYCTL_CAPS1_NS_KEYRING_NAME = 0x1 KEYCTL_CAPS1_NS_KEY_TAG = 0x2 KEYCTL_CHOWN = 0x4 KEYCTL_CLEAR = 0x7 KEYCTL_DESCRIBE = 0x6 KEYCTL_DH_COMPUTE = 0x17 KEYCTL_GET_KEYRING_ID = 0x0 KEYCTL_GET_PERSISTENT = 0x16 KEYCTL_GET_SECURITY = 0x11 KEYCTL_INSTANTIATE = 0xc KEYCTL_INSTANTIATE_IOV = 0x14 KEYCTL_INVALIDATE = 0x15 KEYCTL_JOIN_SESSION_KEYRING = 0x1 KEYCTL_LINK = 0x8 KEYCTL_MOVE = 0x1e KEYCTL_MOVE_EXCL = 0x1 KEYCTL_NEGATE = 0xd KEYCTL_PKEY_DECRYPT = 0x1a KEYCTL_PKEY_ENCRYPT = 0x19 KEYCTL_PKEY_QUERY = 0x18 KEYCTL_PKEY_SIGN = 0x1b KEYCTL_PKEY_VERIFY = 0x1c KEYCTL_READ = 0xb KEYCTL_REJECT = 0x13 KEYCTL_RESTRICT_KEYRING = 0x1d KEYCTL_REVOKE = 0x3 KEYCTL_SEARCH = 0xa KEYCTL_SESSION_TO_PARENT = 0x12 KEYCTL_SETPERM = 0x5 KEYCTL_SET_REQKEY_KEYRING = 0xe KEYCTL_SET_TIMEOUT = 0xf KEYCTL_SUPPORTS_DECRYPT = 0x2 KEYCTL_SUPPORTS_ENCRYPT = 0x1 KEYCTL_SUPPORTS_SIGN = 0x4 KEYCTL_SUPPORTS_VERIFY = 0x8 KEYCTL_UNLINK = 0x9 KEYCTL_UPDATE = 0x2 KEYCTL_WATCH_KEY = 0x20 KEY_REQKEY_DEFL_DEFAULT = 0x0 KEY_REQKEY_DEFL_GROUP_KEYRING = 0x6 KEY_REQKEY_DEFL_NO_CHANGE = -0x1 KEY_REQKEY_DEFL_PROCESS_KEYRING = 0x2 KEY_REQKEY_DEFL_REQUESTOR_KEYRING = 0x7 KEY_REQKEY_DEFL_SESSION_KEYRING = 0x3 KEY_REQKEY_DEFL_THREAD_KEYRING = 0x1 KEY_REQKEY_DEFL_USER_KEYRING = 0x4 KEY_REQKEY_DEFL_USER_SESSION_KEYRING = 0x5 KEY_SPEC_GROUP_KEYRING = -0x6 KEY_SPEC_PROCESS_KEYRING = -0x2 KEY_SPEC_REQKEY_AUTH_KEY = -0x7 KEY_SPEC_REQUESTOR_KEYRING = -0x8 KEY_SPEC_SESSION_KEYRING = -0x3 KEY_SPEC_THREAD_KEYRING = -0x1 KEY_SPEC_USER_KEYRING = -0x4 KEY_SPEC_USER_SESSION_KEYRING = -0x5 LANDLOCK_ACCESS_FS_EXECUTE = 0x1 LANDLOCK_ACCESS_FS_IOCTL_DEV = 0x8000 LANDLOCK_ACCESS_FS_MAKE_BLOCK = 0x800 LANDLOCK_ACCESS_FS_MAKE_CHAR = 0x40 LANDLOCK_ACCESS_FS_MAKE_DIR = 0x80 LANDLOCK_ACCESS_FS_MAKE_FIFO = 0x400 LANDLOCK_ACCESS_FS_MAKE_REG = 0x100 LANDLOCK_ACCESS_FS_MAKE_SOCK = 0x200 LANDLOCK_ACCESS_FS_MAKE_SYM = 0x1000 LANDLOCK_ACCESS_FS_READ_DIR = 0x8 LANDLOCK_ACCESS_FS_READ_FILE = 0x4 LANDLOCK_ACCESS_FS_REFER = 0x2000 LANDLOCK_ACCESS_FS_REMOVE_DIR = 0x10 LANDLOCK_ACCESS_FS_REMOVE_FILE = 0x20 LANDLOCK_ACCESS_FS_TRUNCATE = 0x4000 LANDLOCK_ACCESS_FS_WRITE_FILE = 0x2 LANDLOCK_ACCESS_NET_BIND_TCP = 0x1 LANDLOCK_ACCESS_NET_CONNECT_TCP = 0x2 LANDLOCK_CREATE_RULESET_ERRATA = 0x2 LANDLOCK_CREATE_RULESET_VERSION = 0x1 LANDLOCK_RESTRICT_SELF_LOG_NEW_EXEC_ON = 0x2 LANDLOCK_RESTRICT_SELF_LOG_SAME_EXEC_OFF = 0x1 LANDLOCK_RESTRICT_SELF_LOG_SUBDOMAINS_OFF = 0x4 LANDLOCK_SCOPE_ABSTRACT_UNIX_SOCKET = 0x1 LANDLOCK_SCOPE_SIGNAL = 0x2 LINUX_REBOOT_CMD_CAD_OFF = 0x0 LINUX_REBOOT_CMD_CAD_ON = 0x89abcdef LINUX_REBOOT_CMD_HALT = 0xcdef0123 LINUX_REBOOT_CMD_KEXEC = 0x45584543 LINUX_REBOOT_CMD_POWER_OFF = 0x4321fedc LINUX_REBOOT_CMD_RESTART = 0x1234567 LINUX_REBOOT_CMD_RESTART2 = 0xa1b2c3d4 LINUX_REBOOT_CMD_SW_SUSPEND = 0xd000fce2 LINUX_REBOOT_MAGIC1 = 0xfee1dead LINUX_REBOOT_MAGIC2 = 0x28121969 LOCK_EX = 0x2 LOCK_NB = 0x4 LOCK_SH = 0x1 LOCK_UN = 0x8 LOOP_CLR_FD = 0x4c01 LOOP_CONFIGURE = 0x4c0a LOOP_CTL_ADD = 0x4c80 LOOP_CTL_GET_FREE = 0x4c82 LOOP_CTL_REMOVE = 0x4c81 LOOP_GET_STATUS = 0x4c03 LOOP_GET_STATUS64 = 0x4c05 LOOP_SET_BLOCK_SIZE = 0x4c09 LOOP_SET_CAPACITY = 0x4c07 LOOP_SET_DIRECT_IO = 0x4c08 LOOP_SET_FD = 0x4c00 LOOP_SET_STATUS = 0x4c02 LOOP_SET_STATUS64 = 0x4c04 LOOP_SET_STATUS_CLEARABLE_FLAGS = 0x4 LOOP_SET_STATUS_SETTABLE_FLAGS = 0xc LO_KEY_SIZE = 0x20 LO_NAME_SIZE = 0x40 LWTUNNEL_IP6_MAX = 0x8 LWTUNNEL_IP_MAX = 0x8 LWTUNNEL_IP_OPTS_MAX = 0x3 LWTUNNEL_IP_OPT_ERSPAN_MAX = 0x4 LWTUNNEL_IP_OPT_GENEVE_MAX = 0x3 LWTUNNEL_IP_OPT_VXLAN_MAX = 0x1 MADV_COLD = 0x14 MADV_COLLAPSE = 0x19 MADV_DODUMP = 0x11 MADV_DOFORK = 0xb MADV_DONTDUMP = 0x10 MADV_DONTFORK = 0xa MADV_DONTNEED = 0x4 MADV_DONTNEED_LOCKED = 0x18 MADV_FREE = 0x8 MADV_HUGEPAGE = 0xe MADV_HWPOISON = 0x64 MADV_KEEPONFORK = 0x13 MADV_MERGEABLE = 0xc MADV_NOHUGEPAGE = 0xf MADV_NORMAL = 0x0 MADV_PAGEOUT = 0x15 MADV_POPULATE_READ = 0x16 MADV_POPULATE_WRITE = 0x17 MADV_RANDOM = 0x1 MADV_REMOVE = 0x9 MADV_SEQUENTIAL = 0x2 MADV_UNMERGEABLE = 0xd MADV_WILLNEED = 0x3 MADV_WIPEONFORK = 0x12 MAP_DROPPABLE = 0x8 MAP_FILE = 0x0 MAP_FIXED = 0x10 MAP_FIXED_NOREPLACE = 0x100000 MAP_HUGE_16GB = 0x88000000 MAP_HUGE_16KB = 0x38000000 MAP_HUGE_16MB = 0x60000000 MAP_HUGE_1GB = 0x78000000 MAP_HUGE_1MB = 0x50000000 MAP_HUGE_256MB = 0x70000000 MAP_HUGE_2GB = 0x7c000000 MAP_HUGE_2MB = 0x54000000 MAP_HUGE_32MB = 0x64000000 MAP_HUGE_512KB = 0x4c000000 MAP_HUGE_512MB = 0x74000000 MAP_HUGE_64KB = 0x40000000 MAP_HUGE_8MB = 0x5c000000 MAP_HUGE_MASK = 0x3f MAP_HUGE_SHIFT = 0x1a MAP_PRIVATE = 0x2 MAP_SHARED = 0x1 MAP_SHARED_VALIDATE = 0x3 MAP_TYPE = 0xf MCAST_BLOCK_SOURCE = 0x2b MCAST_EXCLUDE = 0x0 MCAST_INCLUDE = 0x1 MCAST_JOIN_GROUP = 0x2a MCAST_JOIN_SOURCE_GROUP = 0x2e MCAST_LEAVE_GROUP = 0x2d MCAST_LEAVE_SOURCE_GROUP = 0x2f MCAST_MSFILTER = 0x30 MCAST_UNBLOCK_SOURCE = 0x2c MEMGETREGIONINFO = 0xc0104d08 MEMREADOOB64 = 0xc0184d16 MEMWRITE = 0xc0304d18 MEMWRITEOOB64 = 0xc0184d15 MFD_ALLOW_SEALING = 0x2 MFD_CLOEXEC = 0x1 MFD_EXEC = 0x10 MFD_HUGETLB = 0x4 MFD_HUGE_16GB = 0x88000000 MFD_HUGE_16MB = 0x60000000 MFD_HUGE_1GB = 0x78000000 MFD_HUGE_1MB = 0x50000000 MFD_HUGE_256MB = 0x70000000 MFD_HUGE_2GB = 0x7c000000 MFD_HUGE_2MB = 0x54000000 MFD_HUGE_32MB = 0x64000000 MFD_HUGE_512KB = 0x4c000000 MFD_HUGE_512MB = 0x74000000 MFD_HUGE_64KB = 0x40000000 MFD_HUGE_8MB = 0x5c000000 MFD_HUGE_MASK = 0x3f MFD_HUGE_SHIFT = 0x1a MFD_NOEXEC_SEAL = 0x8 MINIX2_SUPER_MAGIC = 0x2468 MINIX2_SUPER_MAGIC2 = 0x2478 MINIX3_SUPER_MAGIC = 0x4d5a MINIX_SUPER_MAGIC = 0x137f MINIX_SUPER_MAGIC2 = 0x138f MNT_DETACH = 0x2 MNT_EXPIRE = 0x4 MNT_FORCE = 0x1 MNT_ID_REQ_SIZE_VER0 = 0x18 MNT_ID_REQ_SIZE_VER1 = 0x20 MNT_NS_INFO_SIZE_VER0 = 0x10 MODULE_INIT_COMPRESSED_FILE = 0x4 MODULE_INIT_IGNORE_MODVERSIONS = 0x1 MODULE_INIT_IGNORE_VERMAGIC = 0x2 MOUNT_ATTR_IDMAP = 0x100000 MOUNT_ATTR_NOATIME = 0x10 MOUNT_ATTR_NODEV = 0x4 MOUNT_ATTR_NODIRATIME = 0x80 MOUNT_ATTR_NOEXEC = 0x8 MOUNT_ATTR_NOSUID = 0x2 MOUNT_ATTR_NOSYMFOLLOW = 0x200000 MOUNT_ATTR_RDONLY = 0x1 MOUNT_ATTR_RELATIME = 0x0 MOUNT_ATTR_SIZE_VER0 = 0x20 MOUNT_ATTR_STRICTATIME = 0x20 MOUNT_ATTR__ATIME = 0x70 MREMAP_DONTUNMAP = 0x4 MREMAP_FIXED = 0x2 MREMAP_MAYMOVE = 0x1 MSDOS_SUPER_MAGIC = 0x4d44 MSG_BATCH = 0x40000 MSG_CMSG_CLOEXEC = 0x40000000 MSG_CONFIRM = 0x800 MSG_CTRUNC = 0x8 MSG_DONTROUTE = 0x4 MSG_DONTWAIT = 0x40 MSG_EOR = 0x80 MSG_ERRQUEUE = 0x2000 MSG_FASTOPEN = 0x20000000 MSG_FIN = 0x200 MSG_MORE = 0x8000 MSG_NOSIGNAL = 0x4000 MSG_OOB = 0x1 MSG_PEEK = 0x2 MSG_PROXY = 0x10 MSG_RST = 0x1000 MSG_SOCK_DEVMEM = 0x2000000 MSG_SYN = 0x400 MSG_TRUNC = 0x20 MSG_TRYHARD = 0x4 MSG_WAITALL = 0x100 MSG_WAITFORONE = 0x10000 MSG_ZEROCOPY = 0x4000000 MS_ACTIVE = 0x40000000 MS_ASYNC = 0x1 MS_BIND = 0x1000 MS_BORN = 0x20000000 MS_DIRSYNC = 0x80 MS_INVALIDATE = 0x2 MS_I_VERSION = 0x800000 MS_KERNMOUNT = 0x400000 MS_LAZYTIME = 0x2000000 MS_MANDLOCK = 0x40 MS_MGC_MSK = 0xffff0000 MS_MGC_VAL = 0xc0ed0000 MS_MOVE = 0x2000 MS_NOATIME = 0x400 MS_NODEV = 0x4 MS_NODIRATIME = 0x800 MS_NOEXEC = 0x8 MS_NOREMOTELOCK = 0x8000000 MS_NOSEC = 0x10000000 MS_NOSUID = 0x2 MS_NOSYMFOLLOW = 0x100 MS_NOUSER = -0x80000000 MS_POSIXACL = 0x10000 MS_PRIVATE = 0x40000 MS_RDONLY = 0x1 MS_REC = 0x4000 MS_RELATIME = 0x200000 MS_REMOUNT = 0x20 MS_RMT_MASK = 0x2800051 MS_SHARED = 0x100000 MS_SILENT = 0x8000 MS_SLAVE = 0x80000 MS_STRICTATIME = 0x1000000 MS_SUBMOUNT = 0x4000000 MS_SYNC = 0x4 MS_SYNCHRONOUS = 0x10 MS_UNBINDABLE = 0x20000 MS_VERBOSE = 0x8000 MTD_ABSENT = 0x0 MTD_BIT_WRITEABLE = 0x800 MTD_CAP_NANDFLASH = 0x400 MTD_CAP_NORFLASH = 0xc00 MTD_CAP_NVRAM = 0x1c00 MTD_CAP_RAM = 0x1c00 MTD_CAP_ROM = 0x0 MTD_DATAFLASH = 0x6 MTD_INODE_FS_MAGIC = 0x11307854 MTD_MAX_ECCPOS_ENTRIES = 0x40 MTD_MAX_OOBFREE_ENTRIES = 0x8 MTD_MLCNANDFLASH = 0x8 MTD_NANDECC_AUTOPLACE = 0x2 MTD_NANDECC_AUTOPL_USR = 0x4 MTD_NANDECC_OFF = 0x0 MTD_NANDECC_PLACE = 0x1 MTD_NANDECC_PLACEONLY = 0x3 MTD_NANDFLASH = 0x4 MTD_NORFLASH = 0x3 MTD_NO_ERASE = 0x1000 MTD_OTP_FACTORY = 0x1 MTD_OTP_OFF = 0x0 MTD_OTP_USER = 0x2 MTD_POWERUP_LOCK = 0x2000 MTD_RAM = 0x1 MTD_ROM = 0x2 MTD_SLC_ON_MLC_EMULATION = 0x4000 MTD_UBIVOLUME = 0x7 MTD_WRITEABLE = 0x400 NAME_MAX = 0xff NCP_SUPER_MAGIC = 0x564c NETLINK_ADD_MEMBERSHIP = 0x1 NETLINK_AUDIT = 0x9 NETLINK_BROADCAST_ERROR = 0x4 NETLINK_CAP_ACK = 0xa NETLINK_CONNECTOR = 0xb NETLINK_CRYPTO = 0x15 NETLINK_DNRTMSG = 0xe NETLINK_DROP_MEMBERSHIP = 0x2 NETLINK_ECRYPTFS = 0x13 NETLINK_EXT_ACK = 0xb NETLINK_FIB_LOOKUP = 0xa NETLINK_FIREWALL = 0x3 NETLINK_GENERIC = 0x10 NETLINK_GET_STRICT_CHK = 0xc NETLINK_INET_DIAG = 0x4 NETLINK_IP6_FW = 0xd NETLINK_ISCSI = 0x8 NETLINK_KOBJECT_UEVENT = 0xf NETLINK_LISTEN_ALL_NSID = 0x8 NETLINK_LIST_MEMBERSHIPS = 0x9 NETLINK_NETFILTER = 0xc NETLINK_NFLOG = 0x5 NETLINK_NO_ENOBUFS = 0x5 NETLINK_PKTINFO = 0x3 NETLINK_RDMA = 0x14 NETLINK_ROUTE = 0x0 NETLINK_RX_RING = 0x6 NETLINK_SCSITRANSPORT = 0x12 NETLINK_SELINUX = 0x7 NETLINK_SMC = 0x16 NETLINK_SOCK_DIAG = 0x4 NETLINK_TX_RING = 0x7 NETLINK_UNUSED = 0x1 NETLINK_USERSOCK = 0x2 NETLINK_XFRM = 0x6 NETNSA_MAX = 0x5 NETNSA_NSID_NOT_ASSIGNED = -0x1 NFC_ATR_REQ_GB_MAXSIZE = 0x30 NFC_ATR_REQ_MAXSIZE = 0x40 NFC_ATR_RES_GB_MAXSIZE = 0x2f NFC_ATR_RES_MAXSIZE = 0x40 NFC_ATS_MAXSIZE = 0x14 NFC_COMM_ACTIVE = 0x0 NFC_COMM_PASSIVE = 0x1 NFC_DEVICE_NAME_MAXSIZE = 0x8 NFC_DIRECTION_RX = 0x0 NFC_DIRECTION_TX = 0x1 NFC_FIRMWARE_NAME_MAXSIZE = 0x20 NFC_GB_MAXSIZE = 0x30 NFC_GENL_MCAST_EVENT_NAME = "events" NFC_GENL_NAME = "nfc" NFC_GENL_VERSION = 0x1 NFC_HEADER_SIZE = 0x1 NFC_ISO15693_UID_MAXSIZE = 0x8 NFC_LLCP_MAX_SERVICE_NAME = 0x3f NFC_LLCP_MIUX = 0x1 NFC_LLCP_REMOTE_LTO = 0x3 NFC_LLCP_REMOTE_MIU = 0x2 NFC_LLCP_REMOTE_RW = 0x4 NFC_LLCP_RW = 0x0 NFC_NFCID1_MAXSIZE = 0xa NFC_NFCID2_MAXSIZE = 0x8 NFC_NFCID3_MAXSIZE = 0xa NFC_PROTO_FELICA = 0x3 NFC_PROTO_FELICA_MASK = 0x8 NFC_PROTO_ISO14443 = 0x4 NFC_PROTO_ISO14443_B = 0x6 NFC_PROTO_ISO14443_B_MASK = 0x40 NFC_PROTO_ISO14443_MASK = 0x10 NFC_PROTO_ISO15693 = 0x7 NFC_PROTO_ISO15693_MASK = 0x80 NFC_PROTO_JEWEL = 0x1 NFC_PROTO_JEWEL_MASK = 0x2 NFC_PROTO_MAX = 0x8 NFC_PROTO_MIFARE = 0x2 NFC_PROTO_MIFARE_MASK = 0x4 NFC_PROTO_NFC_DEP = 0x5 NFC_PROTO_NFC_DEP_MASK = 0x20 NFC_RAW_HEADER_SIZE = 0x2 NFC_RF_INITIATOR = 0x0 NFC_RF_NONE = 0x2 NFC_RF_TARGET = 0x1 NFC_SENSB_RES_MAXSIZE = 0xc NFC_SENSF_RES_MAXSIZE = 0x12 NFC_SE_DISABLED = 0x0 NFC_SE_EMBEDDED = 0x2 NFC_SE_ENABLED = 0x1 NFC_SE_UICC = 0x1 NFC_SOCKPROTO_LLCP = 0x1 NFC_SOCKPROTO_MAX = 0x2 NFC_SOCKPROTO_RAW = 0x0 NFNETLINK_V0 = 0x0 NFNLGRP_ACCT_QUOTA = 0x8 NFNLGRP_CONNTRACK_DESTROY = 0x3 NFNLGRP_CONNTRACK_EXP_DESTROY = 0x6 NFNLGRP_CONNTRACK_EXP_NEW = 0x4 NFNLGRP_CONNTRACK_EXP_UPDATE = 0x5 NFNLGRP_CONNTRACK_NEW = 0x1 NFNLGRP_CONNTRACK_UPDATE = 0x2 NFNLGRP_MAX = 0x9 NFNLGRP_NFTABLES = 0x7 NFNLGRP_NFTRACE = 0x9 NFNLGRP_NONE = 0x0 NFNL_BATCH_MAX = 0x1 NFNL_MSG_BATCH_BEGIN = 0x10 NFNL_MSG_BATCH_END = 0x11 NFNL_NFA_NEST = 0x8000 NFNL_SUBSYS_ACCT = 0x7 NFNL_SUBSYS_COUNT = 0xd NFNL_SUBSYS_CTHELPER = 0x9 NFNL_SUBSYS_CTNETLINK = 0x1 NFNL_SUBSYS_CTNETLINK_EXP = 0x2 NFNL_SUBSYS_CTNETLINK_TIMEOUT = 0x8 NFNL_SUBSYS_HOOK = 0xc NFNL_SUBSYS_IPSET = 0x6 NFNL_SUBSYS_NFTABLES = 0xa NFNL_SUBSYS_NFT_COMPAT = 0xb NFNL_SUBSYS_NONE = 0x0 NFNL_SUBSYS_OSF = 0x5 NFNL_SUBSYS_QUEUE = 0x3 NFNL_SUBSYS_ULOG = 0x4 NFS_SUPER_MAGIC = 0x6969 NFT_BITWISE_BOOL = 0x0 NFT_CHAIN_FLAGS = 0x7 NFT_CHAIN_MAXNAMELEN = 0x100 NFT_CT_MAX = 0x17 NFT_DATA_RESERVED_MASK = 0xffffff00 NFT_DATA_VALUE_MAXLEN = 0x40 NFT_EXTHDR_OP_MAX = 0x4 NFT_FIB_RESULT_MAX = 0x3 NFT_INNER_MASK = 0xf NFT_LOGLEVEL_MAX = 0x8 NFT_NAME_MAXLEN = 0x100 NFT_NG_MAX = 0x1 NFT_OBJECT_CONNLIMIT = 0x5 NFT_OBJECT_COUNTER = 0x1 NFT_OBJECT_CT_EXPECT = 0x9 NFT_OBJECT_CT_HELPER = 0x3 NFT_OBJECT_CT_TIMEOUT = 0x7 NFT_OBJECT_LIMIT = 0x4 NFT_OBJECT_MAX = 0xa NFT_OBJECT_QUOTA = 0x2 NFT_OBJECT_SECMARK = 0x8 NFT_OBJECT_SYNPROXY = 0xa NFT_OBJECT_TUNNEL = 0x6 NFT_OBJECT_UNSPEC = 0x0 NFT_OBJ_MAXNAMELEN = 0x100 NFT_OSF_MAXGENRELEN = 0x10 NFT_QUEUE_FLAG_BYPASS = 0x1 NFT_QUEUE_FLAG_CPU_FANOUT = 0x2 NFT_QUEUE_FLAG_MASK = 0x3 NFT_REG32_COUNT = 0x10 NFT_REG32_SIZE = 0x4 NFT_REG_MAX = 0x4 NFT_REG_SIZE = 0x10 NFT_REJECT_ICMPX_MAX = 0x3 NFT_RT_MAX = 0x4 NFT_SECMARK_CTX_MAXLEN = 0x1000 NFT_SET_MAXNAMELEN = 0x100 NFT_SOCKET_MAX = 0x3 NFT_TABLE_F_MASK = 0x7 NFT_TABLE_MAXNAMELEN = 0x100 NFT_TRACETYPE_MAX = 0x3 NFT_TUNNEL_F_MASK = 0x7 NFT_TUNNEL_MAX = 0x1 NFT_TUNNEL_MODE_MAX = 0x2 NFT_USERDATA_MAXLEN = 0x100 NFT_XFRM_KEY_MAX = 0x6 NF_NAT_RANGE_MAP_IPS = 0x1 NF_NAT_RANGE_MASK = 0x7f NF_NAT_RANGE_NETMAP = 0x40 NF_NAT_RANGE_PERSISTENT = 0x8 NF_NAT_RANGE_PROTO_OFFSET = 0x20 NF_NAT_RANGE_PROTO_RANDOM = 0x4 NF_NAT_RANGE_PROTO_RANDOM_ALL = 0x14 NF_NAT_RANGE_PROTO_RANDOM_FULLY = 0x10 NF_NAT_RANGE_PROTO_SPECIFIED = 0x2 NILFS_SUPER_MAGIC = 0x3434 NL0 = 0x0 NL1 = 0x100 NLA_ALIGNTO = 0x4 NLA_F_NESTED = 0x8000 NLA_F_NET_BYTEORDER = 0x4000 NLA_HDRLEN = 0x4 NLMSG_ALIGNTO = 0x4 NLMSG_DONE = 0x3 NLMSG_ERROR = 0x2 NLMSG_HDRLEN = 0x10 NLMSG_MIN_TYPE = 0x10 NLMSG_NOOP = 0x1 NLMSG_OVERRUN = 0x4 NLM_F_ACK = 0x4 NLM_F_ACK_TLVS = 0x200 NLM_F_APPEND = 0x800 NLM_F_ATOMIC = 0x400 NLM_F_BULK = 0x200 NLM_F_CAPPED = 0x100 NLM_F_CREATE = 0x400 NLM_F_DUMP = 0x300 NLM_F_DUMP_FILTERED = 0x20 NLM_F_DUMP_INTR = 0x10 NLM_F_ECHO = 0x8 NLM_F_EXCL = 0x200 NLM_F_MATCH = 0x200 NLM_F_MULTI = 0x2 NLM_F_NONREC = 0x100 NLM_F_REPLACE = 0x100 NLM_F_REQUEST = 0x1 NLM_F_ROOT = 0x100 NN_386_IOPERM = "LINUX" NN_386_TLS = "LINUX" NN_ARC_V2 = "LINUX" NN_ARM_FPMR = "LINUX" NN_ARM_GCS = "LINUX" NN_ARM_HW_BREAK = "LINUX" NN_ARM_HW_WATCH = "LINUX" NN_ARM_PACA_KEYS = "LINUX" NN_ARM_PACG_KEYS = "LINUX" NN_ARM_PAC_ENABLED_KEYS = "LINUX" NN_ARM_PAC_MASK = "LINUX" NN_ARM_POE = "LINUX" NN_ARM_SSVE = "LINUX" NN_ARM_SVE = "LINUX" NN_ARM_SYSTEM_CALL = "LINUX" NN_ARM_TAGGED_ADDR_CTRL = "LINUX" NN_ARM_TLS = "LINUX" NN_ARM_VFP = "LINUX" NN_ARM_ZA = "LINUX" NN_ARM_ZT = "LINUX" NN_AUXV = "CORE" NN_FILE = "CORE" NN_GNU_PROPERTY_TYPE_0 = "GNU" NN_LOONGARCH_CPUCFG = "LINUX" NN_LOONGARCH_CSR = "LINUX" NN_LOONGARCH_HW_BREAK = "LINUX" NN_LOONGARCH_HW_WATCH = "LINUX" NN_LOONGARCH_LASX = "LINUX" NN_LOONGARCH_LBT = "LINUX" NN_LOONGARCH_LSX = "LINUX" NN_MIPS_DSP = "LINUX" NN_MIPS_FP_MODE = "LINUX" NN_MIPS_MSA = "LINUX" NN_PPC_DEXCR = "LINUX" NN_PPC_DSCR = "LINUX" NN_PPC_EBB = "LINUX" NN_PPC_HASHKEYR = "LINUX" NN_PPC_PKEY = "LINUX" NN_PPC_PMU = "LINUX" NN_PPC_PPR = "LINUX" NN_PPC_SPE = "LINUX" NN_PPC_TAR = "LINUX" NN_PPC_TM_CDSCR = "LINUX" NN_PPC_TM_CFPR = "LINUX" NN_PPC_TM_CGPR = "LINUX" NN_PPC_TM_CPPR = "LINUX" NN_PPC_TM_CTAR = "LINUX" NN_PPC_TM_CVMX = "LINUX" NN_PPC_TM_CVSX = "LINUX" NN_PPC_TM_SPR = "LINUX" NN_PPC_VMX = "LINUX" NN_PPC_VSX = "LINUX" NN_PRFPREG = "CORE" NN_PRPSINFO = "CORE" NN_PRSTATUS = "CORE" NN_PRXFPREG = "LINUX" NN_RISCV_CSR = "LINUX" NN_RISCV_TAGGED_ADDR_CTRL = "LINUX" NN_RISCV_VECTOR = "LINUX" NN_S390_CTRS = "LINUX" NN_S390_GS_BC = "LINUX" NN_S390_GS_CB = "LINUX" NN_S390_HIGH_GPRS = "LINUX" NN_S390_LAST_BREAK = "LINUX" NN_S390_PREFIX = "LINUX" NN_S390_PV_CPU_DATA = "LINUX" NN_S390_RI_CB = "LINUX" NN_S390_SYSTEM_CALL = "LINUX" NN_S390_TDB = "LINUX" NN_S390_TIMER = "LINUX" NN_S390_TODCMP = "LINUX" NN_S390_TODPREG = "LINUX" NN_S390_VXRS_HIGH = "LINUX" NN_S390_VXRS_LOW = "LINUX" NN_SIGINFO = "CORE" NN_TASKSTRUCT = "CORE" NN_VMCOREDD = "LINUX" NN_X86_SHSTK = "LINUX" NN_X86_XSAVE_LAYOUT = "LINUX" NN_X86_XSTATE = "LINUX" NSFS_MAGIC = 0x6e736673 NT_386_IOPERM = 0x201 NT_386_TLS = 0x200 NT_ARC_V2 = 0x600 NT_ARM_FPMR = 0x40e NT_ARM_GCS = 0x410 NT_ARM_HW_BREAK = 0x402 NT_ARM_HW_WATCH = 0x403 NT_ARM_PACA_KEYS = 0x407 NT_ARM_PACG_KEYS = 0x408 NT_ARM_PAC_ENABLED_KEYS = 0x40a NT_ARM_PAC_MASK = 0x406 NT_ARM_POE = 0x40f NT_ARM_SSVE = 0x40b NT_ARM_SVE = 0x405 NT_ARM_SYSTEM_CALL = 0x404 NT_ARM_TAGGED_ADDR_CTRL = 0x409 NT_ARM_TLS = 0x401 NT_ARM_VFP = 0x400 NT_ARM_ZA = 0x40c NT_ARM_ZT = 0x40d NT_AUXV = 0x6 NT_FILE = 0x46494c45 NT_GNU_PROPERTY_TYPE_0 = 0x5 NT_LOONGARCH_CPUCFG = 0xa00 NT_LOONGARCH_CSR = 0xa01 NT_LOONGARCH_HW_BREAK = 0xa05 NT_LOONGARCH_HW_WATCH = 0xa06 NT_LOONGARCH_LASX = 0xa03 NT_LOONGARCH_LBT = 0xa04 NT_LOONGARCH_LSX = 0xa02 NT_MIPS_DSP = 0x800 NT_MIPS_FP_MODE = 0x801 NT_MIPS_MSA = 0x802 NT_PPC_DEXCR = 0x111 NT_PPC_DSCR = 0x105 NT_PPC_EBB = 0x106 NT_PPC_HASHKEYR = 0x112 NT_PPC_PKEY = 0x110 NT_PPC_PMU = 0x107 NT_PPC_PPR = 0x104 NT_PPC_SPE = 0x101 NT_PPC_TAR = 0x103 NT_PPC_TM_CDSCR = 0x10f NT_PPC_TM_CFPR = 0x109 NT_PPC_TM_CGPR = 0x108 NT_PPC_TM_CPPR = 0x10e NT_PPC_TM_CTAR = 0x10d NT_PPC_TM_CVMX = 0x10a NT_PPC_TM_CVSX = 0x10b NT_PPC_TM_SPR = 0x10c NT_PPC_VMX = 0x100 NT_PPC_VSX = 0x102 NT_PRFPREG = 0x2 NT_PRPSINFO = 0x3 NT_PRSTATUS = 0x1 NT_PRXFPREG = 0x46e62b7f NT_RISCV_CSR = 0x900 NT_RISCV_TAGGED_ADDR_CTRL = 0x902 NT_RISCV_VECTOR = 0x901 NT_S390_CTRS = 0x304 NT_S390_GS_BC = 0x30c NT_S390_GS_CB = 0x30b NT_S390_HIGH_GPRS = 0x300 NT_S390_LAST_BREAK = 0x306 NT_S390_PREFIX = 0x305 NT_S390_PV_CPU_DATA = 0x30e NT_S390_RI_CB = 0x30d NT_S390_SYSTEM_CALL = 0x307 NT_S390_TDB = 0x308 NT_S390_TIMER = 0x301 NT_S390_TODCMP = 0x302 NT_S390_TODPREG = 0x303 NT_S390_VXRS_HIGH = 0x30a NT_S390_VXRS_LOW = 0x309 NT_SIGINFO = 0x53494749 NT_TASKSTRUCT = 0x4 NT_VMCOREDD = 0x700 NT_X86_SHSTK = 0x204 NT_X86_XSAVE_LAYOUT = 0x205 NT_X86_XSTATE = 0x202 OCFS2_SUPER_MAGIC = 0x7461636f OCRNL = 0x8 OFDEL = 0x80 OFILL = 0x40 ONLRET = 0x20 ONOCR = 0x10 OPENPROM_SUPER_MAGIC = 0x9fa1 OPOST = 0x1 OVERLAYFS_SUPER_MAGIC = 0x794c7630 O_ACCMODE = 0x3 O_RDONLY = 0x0 O_RDWR = 0x2 O_WRONLY = 0x1 PACKET_ADD_MEMBERSHIP = 0x1 PACKET_AUXDATA = 0x8 PACKET_BROADCAST = 0x1 PACKET_COPY_THRESH = 0x7 PACKET_DROP_MEMBERSHIP = 0x2 PACKET_FANOUT = 0x12 PACKET_FANOUT_CBPF = 0x6 PACKET_FANOUT_CPU = 0x2 PACKET_FANOUT_DATA = 0x16 PACKET_FANOUT_EBPF = 0x7 PACKET_FANOUT_FLAG_DEFRAG = 0x8000 PACKET_FANOUT_FLAG_IGNORE_OUTGOING = 0x4000 PACKET_FANOUT_FLAG_ROLLOVER = 0x1000 PACKET_FANOUT_FLAG_UNIQUEID = 0x2000 PACKET_FANOUT_HASH = 0x0 PACKET_FANOUT_LB = 0x1 PACKET_FANOUT_QM = 0x5 PACKET_FANOUT_RND = 0x4 PACKET_FANOUT_ROLLOVER = 0x3 PACKET_FASTROUTE = 0x6 PACKET_HDRLEN = 0xb PACKET_HOST = 0x0 PACKET_IGNORE_OUTGOING = 0x17 PACKET_KERNEL = 0x7 PACKET_LOOPBACK = 0x5 PACKET_LOSS = 0xe PACKET_MR_ALLMULTI = 0x2 PACKET_MR_MULTICAST = 0x0 PACKET_MR_PROMISC = 0x1 PACKET_MR_UNICAST = 0x3 PACKET_MULTICAST = 0x2 PACKET_ORIGDEV = 0x9 PACKET_OTHERHOST = 0x3 PACKET_OUTGOING = 0x4 PACKET_QDISC_BYPASS = 0x14 PACKET_RECV_OUTPUT = 0x3 PACKET_RESERVE = 0xc PACKET_ROLLOVER_STATS = 0x15 PACKET_RX_RING = 0x5 PACKET_STATISTICS = 0x6 PACKET_TIMESTAMP = 0x11 PACKET_TX_HAS_OFF = 0x13 PACKET_TX_RING = 0xd PACKET_TX_TIMESTAMP = 0x10 PACKET_USER = 0x6 PACKET_VERSION = 0xa PACKET_VNET_HDR = 0xf PACKET_VNET_HDR_SZ = 0x18 PARITY_CRC16_PR0 = 0x2 PARITY_CRC16_PR0_CCITT = 0x4 PARITY_CRC16_PR1 = 0x3 PARITY_CRC16_PR1_CCITT = 0x5 PARITY_CRC32_PR0_CCITT = 0x6 PARITY_CRC32_PR1_CCITT = 0x7 PARITY_DEFAULT = 0x0 PARITY_NONE = 0x1 PARMRK = 0x8 PERF_ATTR_SIZE_VER0 = 0x40 PERF_ATTR_SIZE_VER1 = 0x48 PERF_ATTR_SIZE_VER2 = 0x50 PERF_ATTR_SIZE_VER3 = 0x60 PERF_ATTR_SIZE_VER4 = 0x68 PERF_ATTR_SIZE_VER5 = 0x70 PERF_ATTR_SIZE_VER6 = 0x78 PERF_ATTR_SIZE_VER7 = 0x80 PERF_ATTR_SIZE_VER8 = 0x88 PERF_AUX_FLAG_COLLISION = 0x8 PERF_AUX_FLAG_CORESIGHT_FORMAT_CORESIGHT = 0x0 PERF_AUX_FLAG_CORESIGHT_FORMAT_RAW = 0x100 PERF_AUX_FLAG_OVERWRITE = 0x2 PERF_AUX_FLAG_PARTIAL = 0x4 PERF_AUX_FLAG_PMU_FORMAT_TYPE_MASK = 0xff00 PERF_AUX_FLAG_TRUNCATED = 0x1 PERF_BRANCH_ENTRY_INFO_BITS_MAX = 0x21 PERF_BR_ARM64_DEBUG_DATA = 0x7 PERF_BR_ARM64_DEBUG_EXIT = 0x5 PERF_BR_ARM64_DEBUG_HALT = 0x4 PERF_BR_ARM64_DEBUG_INST = 0x6 PERF_BR_ARM64_FIQ = 0x3 PERF_FLAG_FD_CLOEXEC = 0x8 PERF_FLAG_FD_NO_GROUP = 0x1 PERF_FLAG_FD_OUTPUT = 0x2 PERF_FLAG_PID_CGROUP = 0x4 PERF_HW_EVENT_MASK = 0xffffffff PERF_MAX_CONTEXTS_PER_STACK = 0x8 PERF_MAX_STACK_DEPTH = 0x7f PERF_MEM_BLK_ADDR = 0x4 PERF_MEM_BLK_DATA = 0x2 PERF_MEM_BLK_NA = 0x1 PERF_MEM_BLK_SHIFT = 0x28 PERF_MEM_HOPS_0 = 0x1 PERF_MEM_HOPS_1 = 0x2 PERF_MEM_HOPS_2 = 0x3 PERF_MEM_HOPS_3 = 0x4 PERF_MEM_HOPS_SHIFT = 0x2b PERF_MEM_LOCK_LOCKED = 0x2 PERF_MEM_LOCK_NA = 0x1 PERF_MEM_LOCK_SHIFT = 0x18 PERF_MEM_LVLNUM_ANY_CACHE = 0xb PERF_MEM_LVLNUM_CXL = 0x9 PERF_MEM_LVLNUM_IO = 0xa PERF_MEM_LVLNUM_L1 = 0x1 PERF_MEM_LVLNUM_L2 = 0x2 PERF_MEM_LVLNUM_L2_MHB = 0x5 PERF_MEM_LVLNUM_L3 = 0x3 PERF_MEM_LVLNUM_L4 = 0x4 PERF_MEM_LVLNUM_LFB = 0xc PERF_MEM_LVLNUM_MSC = 0x6 PERF_MEM_LVLNUM_NA = 0xf PERF_MEM_LVLNUM_PMEM = 0xe PERF_MEM_LVLNUM_RAM = 0xd PERF_MEM_LVLNUM_SHIFT = 0x21 PERF_MEM_LVLNUM_UNC = 0x8 PERF_MEM_LVL_HIT = 0x2 PERF_MEM_LVL_IO = 0x1000 PERF_MEM_LVL_L1 = 0x8 PERF_MEM_LVL_L2 = 0x20 PERF_MEM_LVL_L3 = 0x40 PERF_MEM_LVL_LFB = 0x10 PERF_MEM_LVL_LOC_RAM = 0x80 PERF_MEM_LVL_MISS = 0x4 PERF_MEM_LVL_NA = 0x1 PERF_MEM_LVL_REM_CCE1 = 0x400 PERF_MEM_LVL_REM_CCE2 = 0x800 PERF_MEM_LVL_REM_RAM1 = 0x100 PERF_MEM_LVL_REM_RAM2 = 0x200 PERF_MEM_LVL_SHIFT = 0x5 PERF_MEM_LVL_UNC = 0x2000 PERF_MEM_OP_EXEC = 0x10 PERF_MEM_OP_LOAD = 0x2 PERF_MEM_OP_NA = 0x1 PERF_MEM_OP_PFETCH = 0x8 PERF_MEM_OP_SHIFT = 0x0 PERF_MEM_OP_STORE = 0x4 PERF_MEM_REMOTE_REMOTE = 0x1 PERF_MEM_REMOTE_SHIFT = 0x25 PERF_MEM_SNOOPX_FWD = 0x1 PERF_MEM_SNOOPX_PEER = 0x2 PERF_MEM_SNOOPX_SHIFT = 0x26 PERF_MEM_SNOOP_HIT = 0x4 PERF_MEM_SNOOP_HITM = 0x10 PERF_MEM_SNOOP_MISS = 0x8 PERF_MEM_SNOOP_NA = 0x1 PERF_MEM_SNOOP_NONE = 0x2 PERF_MEM_SNOOP_SHIFT = 0x13 PERF_MEM_TLB_HIT = 0x2 PERF_MEM_TLB_L1 = 0x8 PERF_MEM_TLB_L2 = 0x10 PERF_MEM_TLB_MISS = 0x4 PERF_MEM_TLB_NA = 0x1 PERF_MEM_TLB_OS = 0x40 PERF_MEM_TLB_SHIFT = 0x1a PERF_MEM_TLB_WK = 0x20 PERF_PMU_TYPE_SHIFT = 0x20 PERF_RECORD_KSYMBOL_FLAGS_UNREGISTER = 0x1 PERF_RECORD_MISC_COMM_EXEC = 0x2000 PERF_RECORD_MISC_CPUMODE_MASK = 0x7 PERF_RECORD_MISC_CPUMODE_UNKNOWN = 0x0 PERF_RECORD_MISC_EXACT_IP = 0x4000 PERF_RECORD_MISC_EXT_RESERVED = 0x8000 PERF_RECORD_MISC_FORK_EXEC = 0x2000 PERF_RECORD_MISC_GUEST_KERNEL = 0x4 PERF_RECORD_MISC_GUEST_USER = 0x5 PERF_RECORD_MISC_HYPERVISOR = 0x3 PERF_RECORD_MISC_KERNEL = 0x1 PERF_RECORD_MISC_MMAP_BUILD_ID = 0x4000 PERF_RECORD_MISC_MMAP_DATA = 0x2000 PERF_RECORD_MISC_PROC_MAP_PARSE_TIMEOUT = 0x1000 PERF_RECORD_MISC_SWITCH_OUT = 0x2000 PERF_RECORD_MISC_SWITCH_OUT_PREEMPT = 0x4000 PERF_RECORD_MISC_USER = 0x2 PERF_SAMPLE_BRANCH_PLM_ALL = 0x7 PERF_SAMPLE_WEIGHT_TYPE = 0x1004000 PF_ALG = 0x26 PF_APPLETALK = 0x5 PF_ASH = 0x12 PF_ATMPVC = 0x8 PF_ATMSVC = 0x14 PF_AX25 = 0x3 PF_BLUETOOTH = 0x1f PF_BRIDGE = 0x7 PF_CAIF = 0x25 PF_CAN = 0x1d PF_DECnet = 0xc PF_ECONET = 0x13 PF_FILE = 0x1 PF_IB = 0x1b PF_IEEE802154 = 0x24 PF_INET = 0x2 PF_INET6 = 0xa PF_IPX = 0x4 PF_IRDA = 0x17 PF_ISDN = 0x22 PF_IUCV = 0x20 PF_KCM = 0x29 PF_KEY = 0xf PF_LLC = 0x1a PF_LOCAL = 0x1 PF_MAX = 0x2e PF_MCTP = 0x2d PF_MPLS = 0x1c PF_NETBEUI = 0xd PF_NETLINK = 0x10 PF_NETROM = 0x6 PF_NFC = 0x27 PF_PACKET = 0x11 PF_PHONET = 0x23 PF_PPPOX = 0x18 PF_QIPCRTR = 0x2a PF_R = 0x4 PF_RDS = 0x15 PF_ROSE = 0xb PF_ROUTE = 0x10 PF_RXRPC = 0x21 PF_SECURITY = 0xe PF_SMC = 0x2b PF_SNA = 0x16 PF_TIPC = 0x1e PF_UNIX = 0x1 PF_UNSPEC = 0x0 PF_VSOCK = 0x28 PF_W = 0x2 PF_WANPIPE = 0x19 PF_X = 0x1 PF_X25 = 0x9 PF_XDP = 0x2c PID_FS_MAGIC = 0x50494446 PIPEFS_MAGIC = 0x50495045 PPPIOCGNPMODE = 0xc008744c PPPIOCNEWUNIT = 0xc004743e PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 PROCFS_IOCTL_MAGIC = 'f' PROC_SUPER_MAGIC = 0x9fa0 PROT_EXEC = 0x4 PROT_GROWSDOWN = 0x1000000 PROT_GROWSUP = 0x2000000 PROT_NONE = 0x0 PROT_READ = 0x1 PROT_WRITE = 0x2 PR_CAPBSET_DROP = 0x18 PR_CAPBSET_READ = 0x17 PR_CAP_AMBIENT = 0x2f PR_CAP_AMBIENT_CLEAR_ALL = 0x4 PR_CAP_AMBIENT_IS_SET = 0x1 PR_CAP_AMBIENT_LOWER = 0x3 PR_CAP_AMBIENT_RAISE = 0x2 PR_ENDIAN_BIG = 0x0 PR_ENDIAN_LITTLE = 0x1 PR_ENDIAN_PPC_LITTLE = 0x2 PR_FPEMU_NOPRINT = 0x1 PR_FPEMU_SIGFPE = 0x2 PR_FP_EXC_ASYNC = 0x2 PR_FP_EXC_DISABLED = 0x0 PR_FP_EXC_DIV = 0x10000 PR_FP_EXC_INV = 0x100000 PR_FP_EXC_NONRECOV = 0x1 PR_FP_EXC_OVF = 0x20000 PR_FP_EXC_PRECISE = 0x3 PR_FP_EXC_RES = 0x80000 PR_FP_EXC_SW_ENABLE = 0x80 PR_FP_EXC_UND = 0x40000 PR_FP_MODE_FR = 0x1 PR_FP_MODE_FRE = 0x2 PR_FUTEX_HASH = 0x4e PR_FUTEX_HASH_GET_IMMUTABLE = 0x3 PR_FUTEX_HASH_GET_SLOTS = 0x2 PR_FUTEX_HASH_SET_SLOTS = 0x1 PR_GET_AUXV = 0x41555856 PR_GET_CHILD_SUBREAPER = 0x25 PR_GET_DUMPABLE = 0x3 PR_GET_ENDIAN = 0x13 PR_GET_FPEMU = 0x9 PR_GET_FPEXC = 0xb PR_GET_FP_MODE = 0x2e PR_GET_IO_FLUSHER = 0x3a PR_GET_KEEPCAPS = 0x7 PR_GET_MDWE = 0x42 PR_GET_MEMORY_MERGE = 0x44 PR_GET_NAME = 0x10 PR_GET_NO_NEW_PRIVS = 0x27 PR_GET_PDEATHSIG = 0x2 PR_GET_SECCOMP = 0x15 PR_GET_SECUREBITS = 0x1b PR_GET_SHADOW_STACK_STATUS = 0x4a PR_GET_SPECULATION_CTRL = 0x34 PR_GET_TAGGED_ADDR_CTRL = 0x38 PR_GET_THP_DISABLE = 0x2a PR_GET_TID_ADDRESS = 0x28 PR_GET_TIMERSLACK = 0x1e PR_GET_TIMING = 0xd PR_GET_TSC = 0x19 PR_GET_UNALIGN = 0x5 PR_LOCK_SHADOW_STACK_STATUS = 0x4c PR_MCE_KILL = 0x21 PR_MCE_KILL_CLEAR = 0x0 PR_MCE_KILL_DEFAULT = 0x2 PR_MCE_KILL_EARLY = 0x1 PR_MCE_KILL_GET = 0x22 PR_MCE_KILL_LATE = 0x0 PR_MCE_KILL_SET = 0x1 PR_MDWE_NO_INHERIT = 0x2 PR_MDWE_REFUSE_EXEC_GAIN = 0x1 PR_MPX_DISABLE_MANAGEMENT = 0x2c PR_MPX_ENABLE_MANAGEMENT = 0x2b PR_MTE_TAG_MASK = 0x7fff8 PR_MTE_TAG_SHIFT = 0x3 PR_MTE_TCF_ASYNC = 0x4 PR_MTE_TCF_MASK = 0x6 PR_MTE_TCF_NONE = 0x0 PR_MTE_TCF_SHIFT = 0x1 PR_MTE_TCF_SYNC = 0x2 PR_PAC_APDAKEY = 0x4 PR_PAC_APDBKEY = 0x8 PR_PAC_APGAKEY = 0x10 PR_PAC_APIAKEY = 0x1 PR_PAC_APIBKEY = 0x2 PR_PAC_GET_ENABLED_KEYS = 0x3d PR_PAC_RESET_KEYS = 0x36 PR_PAC_SET_ENABLED_KEYS = 0x3c PR_PMLEN_MASK = 0x7f000000 PR_PMLEN_SHIFT = 0x18 PR_PPC_DEXCR_CTRL_CLEAR = 0x4 PR_PPC_DEXCR_CTRL_CLEAR_ONEXEC = 0x10 PR_PPC_DEXCR_CTRL_EDITABLE = 0x1 PR_PPC_DEXCR_CTRL_MASK = 0x1f PR_PPC_DEXCR_CTRL_SET = 0x2 PR_PPC_DEXCR_CTRL_SET_ONEXEC = 0x8 PR_PPC_DEXCR_IBRTPD = 0x1 PR_PPC_DEXCR_NPHIE = 0x3 PR_PPC_DEXCR_SBHE = 0x0 PR_PPC_DEXCR_SRAPD = 0x2 PR_PPC_GET_DEXCR = 0x48 PR_PPC_SET_DEXCR = 0x49 PR_RISCV_CTX_SW_FENCEI_OFF = 0x1 PR_RISCV_CTX_SW_FENCEI_ON = 0x0 PR_RISCV_SCOPE_PER_PROCESS = 0x0 PR_RISCV_SCOPE_PER_THREAD = 0x1 PR_RISCV_SET_ICACHE_FLUSH_CTX = 0x47 PR_RISCV_V_GET_CONTROL = 0x46 PR_RISCV_V_SET_CONTROL = 0x45 PR_RISCV_V_VSTATE_CTRL_CUR_MASK = 0x3 PR_RISCV_V_VSTATE_CTRL_DEFAULT = 0x0 PR_RISCV_V_VSTATE_CTRL_INHERIT = 0x10 PR_RISCV_V_VSTATE_CTRL_MASK = 0x1f PR_RISCV_V_VSTATE_CTRL_NEXT_MASK = 0xc PR_RISCV_V_VSTATE_CTRL_OFF = 0x1 PR_RISCV_V_VSTATE_CTRL_ON = 0x2 PR_SCHED_CORE = 0x3e PR_SCHED_CORE_CREATE = 0x1 PR_SCHED_CORE_GET = 0x0 PR_SCHED_CORE_MAX = 0x4 PR_SCHED_CORE_SCOPE_PROCESS_GROUP = 0x2 PR_SCHED_CORE_SCOPE_THREAD = 0x0 PR_SCHED_CORE_SCOPE_THREAD_GROUP = 0x1 PR_SCHED_CORE_SHARE_FROM = 0x3 PR_SCHED_CORE_SHARE_TO = 0x2 PR_SET_CHILD_SUBREAPER = 0x24 PR_SET_DUMPABLE = 0x4 PR_SET_ENDIAN = 0x14 PR_SET_FPEMU = 0xa PR_SET_FPEXC = 0xc PR_SET_FP_MODE = 0x2d PR_SET_IO_FLUSHER = 0x39 PR_SET_KEEPCAPS = 0x8 PR_SET_MDWE = 0x41 PR_SET_MEMORY_MERGE = 0x43 PR_SET_MM = 0x23 PR_SET_MM_ARG_END = 0x9 PR_SET_MM_ARG_START = 0x8 PR_SET_MM_AUXV = 0xc PR_SET_MM_BRK = 0x7 PR_SET_MM_END_CODE = 0x2 PR_SET_MM_END_DATA = 0x4 PR_SET_MM_ENV_END = 0xb PR_SET_MM_ENV_START = 0xa PR_SET_MM_EXE_FILE = 0xd PR_SET_MM_MAP = 0xe PR_SET_MM_MAP_SIZE = 0xf PR_SET_MM_START_BRK = 0x6 PR_SET_MM_START_CODE = 0x1 PR_SET_MM_START_DATA = 0x3 PR_SET_MM_START_STACK = 0x5 PR_SET_NAME = 0xf PR_SET_NO_NEW_PRIVS = 0x26 PR_SET_PDEATHSIG = 0x1 PR_SET_PTRACER = 0x59616d61 PR_SET_SECCOMP = 0x16 PR_SET_SECUREBITS = 0x1c PR_SET_SHADOW_STACK_STATUS = 0x4b PR_SET_SPECULATION_CTRL = 0x35 PR_SET_SYSCALL_USER_DISPATCH = 0x3b PR_SET_TAGGED_ADDR_CTRL = 0x37 PR_SET_THP_DISABLE = 0x29 PR_SET_TIMERSLACK = 0x1d PR_SET_TIMING = 0xe PR_SET_TSC = 0x1a PR_SET_UNALIGN = 0x6 PR_SET_VMA = 0x53564d41 PR_SET_VMA_ANON_NAME = 0x0 PR_SHADOW_STACK_ENABLE = 0x1 PR_SHADOW_STACK_PUSH = 0x4 PR_SHADOW_STACK_WRITE = 0x2 PR_SME_GET_VL = 0x40 PR_SME_SET_VL = 0x3f PR_SME_SET_VL_ONEXEC = 0x40000 PR_SME_VL_INHERIT = 0x20000 PR_SME_VL_LEN_MASK = 0xffff PR_SPEC_DISABLE = 0x4 PR_SPEC_DISABLE_NOEXEC = 0x10 PR_SPEC_ENABLE = 0x2 PR_SPEC_FORCE_DISABLE = 0x8 PR_SPEC_INDIRECT_BRANCH = 0x1 PR_SPEC_L1D_FLUSH = 0x2 PR_SPEC_NOT_AFFECTED = 0x0 PR_SPEC_PRCTL = 0x1 PR_SPEC_STORE_BYPASS = 0x0 PR_SVE_GET_VL = 0x33 PR_SVE_SET_VL = 0x32 PR_SVE_SET_VL_ONEXEC = 0x40000 PR_SVE_VL_INHERIT = 0x20000 PR_SVE_VL_LEN_MASK = 0xffff PR_SYS_DISPATCH_OFF = 0x0 PR_SYS_DISPATCH_ON = 0x1 PR_TAGGED_ADDR_ENABLE = 0x1 PR_TASK_PERF_EVENTS_DISABLE = 0x1f PR_TASK_PERF_EVENTS_ENABLE = 0x20 PR_TIMER_CREATE_RESTORE_IDS = 0x4d PR_TIMER_CREATE_RESTORE_IDS_GET = 0x2 PR_TIMER_CREATE_RESTORE_IDS_OFF = 0x0 PR_TIMER_CREATE_RESTORE_IDS_ON = 0x1 PR_TIMING_STATISTICAL = 0x0 PR_TIMING_TIMESTAMP = 0x1 PR_TSC_ENABLE = 0x1 PR_TSC_SIGSEGV = 0x2 PR_UNALIGN_NOPRINT = 0x1 PR_UNALIGN_SIGBUS = 0x2 PSTOREFS_MAGIC = 0x6165676c PTP_CLK_MAGIC = '=' PTP_ENABLE_FEATURE = 0x1 PTP_EXTTS_EDGES = 0x6 PTP_EXTTS_EVENT_VALID = 0x1 PTP_EXTTS_V1_VALID_FLAGS = 0x7 PTP_EXTTS_VALID_FLAGS = 0x1f PTP_EXT_OFFSET = 0x10 PTP_FALLING_EDGE = 0x4 PTP_MAX_SAMPLES = 0x19 PTP_PEROUT_DUTY_CYCLE = 0x2 PTP_PEROUT_ONE_SHOT = 0x1 PTP_PEROUT_PHASE = 0x4 PTP_PEROUT_V1_VALID_FLAGS = 0x0 PTP_PEROUT_VALID_FLAGS = 0x7 PTP_PIN_GETFUNC = 0xc0603d06 PTP_PIN_GETFUNC2 = 0xc0603d0f PTP_RISING_EDGE = 0x2 PTP_STRICT_FLAGS = 0x8 PTP_SYS_OFFSET_EXTENDED = 0xc4c03d09 PTP_SYS_OFFSET_EXTENDED2 = 0xc4c03d12 PTP_SYS_OFFSET_PRECISE = 0xc0403d08 PTP_SYS_OFFSET_PRECISE2 = 0xc0403d11 PTRACE_ATTACH = 0x10 PTRACE_CONT = 0x7 PTRACE_DETACH = 0x11 PTRACE_EVENTMSG_SYSCALL_ENTRY = 0x1 PTRACE_EVENTMSG_SYSCALL_EXIT = 0x2 PTRACE_EVENT_CLONE = 0x3 PTRACE_EVENT_EXEC = 0x4 PTRACE_EVENT_EXIT = 0x6 PTRACE_EVENT_FORK = 0x1 PTRACE_EVENT_SECCOMP = 0x7 PTRACE_EVENT_STOP = 0x80 PTRACE_EVENT_VFORK = 0x2 PTRACE_EVENT_VFORK_DONE = 0x5 PTRACE_GETEVENTMSG = 0x4201 PTRACE_GETREGS = 0xc PTRACE_GETREGSET = 0x4204 PTRACE_GETSIGINFO = 0x4202 PTRACE_GETSIGMASK = 0x420a PTRACE_GET_RSEQ_CONFIGURATION = 0x420f PTRACE_GET_SYSCALL_INFO = 0x420e PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG = 0x4211 PTRACE_INTERRUPT = 0x4207 PTRACE_KILL = 0x8 PTRACE_LISTEN = 0x4208 PTRACE_O_EXITKILL = 0x100000 PTRACE_O_MASK = 0x3000ff PTRACE_O_SUSPEND_SECCOMP = 0x200000 PTRACE_O_TRACECLONE = 0x8 PTRACE_O_TRACEEXEC = 0x10 PTRACE_O_TRACEEXIT = 0x40 PTRACE_O_TRACEFORK = 0x2 PTRACE_O_TRACESECCOMP = 0x80 PTRACE_O_TRACESYSGOOD = 0x1 PTRACE_O_TRACEVFORK = 0x4 PTRACE_O_TRACEVFORKDONE = 0x20 PTRACE_PEEKDATA = 0x2 PTRACE_PEEKSIGINFO = 0x4209 PTRACE_PEEKSIGINFO_SHARED = 0x1 PTRACE_PEEKTEXT = 0x1 PTRACE_PEEKUSR = 0x3 PTRACE_POKEDATA = 0x5 PTRACE_POKETEXT = 0x4 PTRACE_POKEUSR = 0x6 PTRACE_SECCOMP_GET_FILTER = 0x420c PTRACE_SECCOMP_GET_METADATA = 0x420d PTRACE_SEIZE = 0x4206 PTRACE_SETOPTIONS = 0x4200 PTRACE_SETREGS = 0xd PTRACE_SETREGSET = 0x4205 PTRACE_SETSIGINFO = 0x4203 PTRACE_SETSIGMASK = 0x420b PTRACE_SET_SYSCALL_INFO = 0x4212 PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG = 0x4210 PTRACE_SINGLESTEP = 0x9 PTRACE_SYSCALL = 0x18 PTRACE_SYSCALL_INFO_ENTRY = 0x1 PTRACE_SYSCALL_INFO_EXIT = 0x2 PTRACE_SYSCALL_INFO_NONE = 0x0 PTRACE_SYSCALL_INFO_SECCOMP = 0x3 PTRACE_TRACEME = 0x0 PT_AARCH64_MEMTAG_MTE = 0x70000002 PT_DYNAMIC = 0x2 PT_GNU_EH_FRAME = 0x6474e550 PT_GNU_PROPERTY = 0x6474e553 PT_GNU_RELRO = 0x6474e552 PT_GNU_STACK = 0x6474e551 PT_HIOS = 0x6fffffff PT_HIPROC = 0x7fffffff PT_INTERP = 0x3 PT_LOAD = 0x1 PT_LOOS = 0x60000000 PT_LOPROC = 0x70000000 PT_NOTE = 0x4 PT_NULL = 0x0 PT_PHDR = 0x6 PT_SHLIB = 0x5 PT_TLS = 0x7 P_ALL = 0x0 P_PGID = 0x2 P_PID = 0x1 P_PIDFD = 0x3 QNX4_SUPER_MAGIC = 0x2f QNX6_SUPER_MAGIC = 0x68191122 RAMFS_MAGIC = 0x858458f6 RAW_PAYLOAD_DIGITAL = 0x3 RAW_PAYLOAD_HCI = 0x2 RAW_PAYLOAD_LLCP = 0x0 RAW_PAYLOAD_NCI = 0x1 RAW_PAYLOAD_PROPRIETARY = 0x4 RDTGROUP_SUPER_MAGIC = 0x7655821 REISERFS_SUPER_MAGIC = 0x52654973 RENAME_EXCHANGE = 0x2 RENAME_NOREPLACE = 0x1 RENAME_WHITEOUT = 0x4 RLIMIT_CORE = 0x4 RLIMIT_CPU = 0x0 RLIMIT_DATA = 0x2 RLIMIT_FSIZE = 0x1 RLIMIT_LOCKS = 0xa RLIMIT_MSGQUEUE = 0xc RLIMIT_NICE = 0xd RLIMIT_RTPRIO = 0xe RLIMIT_RTTIME = 0xf RLIMIT_SIGPENDING = 0xb RLIMIT_STACK = 0x3 RLIM_INFINITY = 0xffffffffffffffff RTAX_ADVMSS = 0x8 RTAX_CC_ALGO = 0x10 RTAX_CWND = 0x7 RTAX_FASTOPEN_NO_COOKIE = 0x11 RTAX_FEATURES = 0xc RTAX_FEATURE_ALLFRAG = 0x8 RTAX_FEATURE_ECN = 0x1 RTAX_FEATURE_MASK = 0x1f RTAX_FEATURE_SACK = 0x2 RTAX_FEATURE_TCP_USEC_TS = 0x10 RTAX_FEATURE_TIMESTAMP = 0x4 RTAX_HOPLIMIT = 0xa RTAX_INITCWND = 0xb RTAX_INITRWND = 0xe RTAX_LOCK = 0x1 RTAX_MAX = 0x11 RTAX_MTU = 0x2 RTAX_QUICKACK = 0xf RTAX_REORDERING = 0x9 RTAX_RTO_MIN = 0xd RTAX_RTT = 0x4 RTAX_RTTVAR = 0x5 RTAX_SSTHRESH = 0x6 RTAX_UNSPEC = 0x0 RTAX_WINDOW = 0x3 RTA_ALIGNTO = 0x4 RTA_MAX = 0x1f RTCF_DIRECTSRC = 0x4000000 RTCF_DOREDIRECT = 0x1000000 RTCF_LOG = 0x2000000 RTCF_MASQ = 0x400000 RTCF_NAT = 0x800000 RTCF_VALVE = 0x200000 RTC_AF = 0x20 RTC_BSM_DIRECT = 0x1 RTC_BSM_DISABLED = 0x0 RTC_BSM_LEVEL = 0x2 RTC_BSM_STANDBY = 0x3 RTC_FEATURE_ALARM = 0x0 RTC_FEATURE_ALARM_RES_2S = 0x3 RTC_FEATURE_ALARM_RES_MINUTE = 0x1 RTC_FEATURE_ALARM_WAKEUP_ONLY = 0x7 RTC_FEATURE_BACKUP_SWITCH_MODE = 0x6 RTC_FEATURE_CNT = 0x8 RTC_FEATURE_CORRECTION = 0x5 RTC_FEATURE_NEED_WEEK_DAY = 0x2 RTC_FEATURE_UPDATE_INTERRUPT = 0x4 RTC_IRQF = 0x80 RTC_MAX_FREQ = 0x2000 RTC_PARAM_BACKUP_SWITCH_MODE = 0x2 RTC_PARAM_CORRECTION = 0x1 RTC_PARAM_FEATURES = 0x0 RTC_PF = 0x40 RTC_UF = 0x10 RTF_ADDRCLASSMASK = 0xf8000000 RTF_ADDRCONF = 0x40000 RTF_ALLONLINK = 0x20000 RTF_BROADCAST = 0x10000000 RTF_CACHE = 0x1000000 RTF_DEFAULT = 0x10000 RTF_DYNAMIC = 0x10 RTF_FLOW = 0x2000000 RTF_GATEWAY = 0x2 RTF_HOST = 0x4 RTF_INTERFACE = 0x40000000 RTF_IRTT = 0x100 RTF_LINKRT = 0x100000 RTF_LOCAL = 0x80000000 RTF_MODIFIED = 0x20 RTF_MSS = 0x40 RTF_MTU = 0x40 RTF_MULTICAST = 0x20000000 RTF_NAT = 0x8000000 RTF_NOFORWARD = 0x1000 RTF_NONEXTHOP = 0x200000 RTF_NOPMTUDISC = 0x4000 RTF_POLICY = 0x4000000 RTF_REINSTATE = 0x8 RTF_REJECT = 0x200 RTF_STATIC = 0x400 RTF_THROW = 0x2000 RTF_UP = 0x1 RTF_WINDOW = 0x80 RTF_XRESOLVE = 0x800 RTMGRP_DECnet_IFADDR = 0x1000 RTMGRP_DECnet_ROUTE = 0x4000 RTMGRP_IPV4_IFADDR = 0x10 RTMGRP_IPV4_MROUTE = 0x20 RTMGRP_IPV4_ROUTE = 0x40 RTMGRP_IPV4_RULE = 0x80 RTMGRP_IPV6_IFADDR = 0x100 RTMGRP_IPV6_IFINFO = 0x800 RTMGRP_IPV6_MROUTE = 0x200 RTMGRP_IPV6_PREFIX = 0x20000 RTMGRP_IPV6_ROUTE = 0x400 RTMGRP_LINK = 0x1 RTMGRP_NEIGH = 0x4 RTMGRP_NOTIFY = 0x2 RTMGRP_TC = 0x8 RTM_BASE = 0x10 RTM_DELACTION = 0x31 RTM_DELADDR = 0x15 RTM_DELADDRLABEL = 0x49 RTM_DELANYCAST = 0x3d RTM_DELCHAIN = 0x65 RTM_DELLINK = 0x11 RTM_DELLINKPROP = 0x6d RTM_DELMDB = 0x55 RTM_DELMULTICAST = 0x39 RTM_DELNEIGH = 0x1d RTM_DELNETCONF = 0x51 RTM_DELNEXTHOP = 0x69 RTM_DELNEXTHOPBUCKET = 0x75 RTM_DELNSID = 0x59 RTM_DELQDISC = 0x25 RTM_DELROUTE = 0x19 RTM_DELRULE = 0x21 RTM_DELTCLASS = 0x29 RTM_DELTFILTER = 0x2d RTM_DELTUNNEL = 0x79 RTM_DELVLAN = 0x71 RTM_F_CLONED = 0x200 RTM_F_EQUALIZE = 0x400 RTM_F_FIB_MATCH = 0x2000 RTM_F_LOOKUP_TABLE = 0x1000 RTM_F_NOTIFY = 0x100 RTM_F_OFFLOAD = 0x4000 RTM_F_OFFLOAD_FAILED = 0x20000000 RTM_F_PREFIX = 0x800 RTM_F_TRAP = 0x8000 RTM_GETACTION = 0x32 RTM_GETADDR = 0x16 RTM_GETADDRLABEL = 0x4a RTM_GETANYCAST = 0x3e RTM_GETCHAIN = 0x66 RTM_GETDCB = 0x4e RTM_GETLINK = 0x12 RTM_GETLINKPROP = 0x6e RTM_GETMDB = 0x56 RTM_GETMULTICAST = 0x3a RTM_GETNEIGH = 0x1e RTM_GETNEIGHTBL = 0x42 RTM_GETNETCONF = 0x52 RTM_GETNEXTHOP = 0x6a RTM_GETNEXTHOPBUCKET = 0x76 RTM_GETNSID = 0x5a RTM_GETQDISC = 0x26 RTM_GETROUTE = 0x1a RTM_GETRULE = 0x22 RTM_GETSTATS = 0x5e RTM_GETTCLASS = 0x2a RTM_GETTFILTER = 0x2e RTM_GETTUNNEL = 0x7a RTM_GETVLAN = 0x72 RTM_MAX = 0x7b RTM_NEWACTION = 0x30 RTM_NEWADDR = 0x14 RTM_NEWADDRLABEL = 0x48 RTM_NEWANYCAST = 0x3c RTM_NEWCACHEREPORT = 0x60 RTM_NEWCHAIN = 0x64 RTM_NEWLINK = 0x10 RTM_NEWLINKPROP = 0x6c RTM_NEWMDB = 0x54 RTM_NEWMULTICAST = 0x38 RTM_NEWNDUSEROPT = 0x44 RTM_NEWNEIGH = 0x1c RTM_NEWNEIGHTBL = 0x40 RTM_NEWNETCONF = 0x50 RTM_NEWNEXTHOP = 0x68 RTM_NEWNEXTHOPBUCKET = 0x74 RTM_NEWNSID = 0x58 RTM_NEWPREFIX = 0x34 RTM_NEWQDISC = 0x24 RTM_NEWROUTE = 0x18 RTM_NEWRULE = 0x20 RTM_NEWSTATS = 0x5c RTM_NEWTCLASS = 0x28 RTM_NEWTFILTER = 0x2c RTM_NEWTUNNEL = 0x78 RTM_NEWVLAN = 0x70 RTM_NR_FAMILIES = 0x1b RTM_NR_MSGTYPES = 0x6c RTM_SETDCB = 0x4f RTM_SETLINK = 0x13 RTM_SETNEIGHTBL = 0x43 RTM_SETSTATS = 0x5f RTNH_ALIGNTO = 0x4 RTNH_COMPARE_MASK = 0x59 RTNH_F_DEAD = 0x1 RTNH_F_LINKDOWN = 0x10 RTNH_F_OFFLOAD = 0x8 RTNH_F_ONLINK = 0x4 RTNH_F_PERVASIVE = 0x2 RTNH_F_TRAP = 0x40 RTNH_F_UNRESOLVED = 0x20 RTN_MAX = 0xb RTPROT_BABEL = 0x2a RTPROT_BGP = 0xba RTPROT_BIRD = 0xc RTPROT_BOOT = 0x3 RTPROT_DHCP = 0x10 RTPROT_DNROUTED = 0xd RTPROT_EIGRP = 0xc0 RTPROT_GATED = 0x8 RTPROT_ISIS = 0xbb RTPROT_KEEPALIVED = 0x12 RTPROT_KERNEL = 0x2 RTPROT_MROUTED = 0x11 RTPROT_MRT = 0xa RTPROT_NTK = 0xf RTPROT_OPENR = 0x63 RTPROT_OSPF = 0xbc RTPROT_OVN = 0x54 RTPROT_RA = 0x9 RTPROT_REDIRECT = 0x1 RTPROT_RIP = 0xbd RTPROT_STATIC = 0x4 RTPROT_UNSPEC = 0x0 RTPROT_XORP = 0xe RTPROT_ZEBRA = 0xb RT_CLASS_DEFAULT = 0xfd RT_CLASS_LOCAL = 0xff RT_CLASS_MAIN = 0xfe RT_CLASS_MAX = 0xff RT_CLASS_UNSPEC = 0x0 RUSAGE_CHILDREN = -0x1 RUSAGE_SELF = 0x0 RUSAGE_THREAD = 0x1 RWF_APPEND = 0x10 RWF_ATOMIC = 0x40 RWF_DONTCACHE = 0x80 RWF_DSYNC = 0x2 RWF_HIPRI = 0x1 RWF_NOAPPEND = 0x20 RWF_NOWAIT = 0x8 RWF_SUPPORTED = 0xff RWF_SYNC = 0x4 RWF_WRITE_LIFE_NOT_SET = 0x0 SCHED_BATCH = 0x3 SCHED_DEADLINE = 0x6 SCHED_EXT = 0x7 SCHED_FIFO = 0x1 SCHED_FLAG_ALL = 0x7f SCHED_FLAG_DL_OVERRUN = 0x4 SCHED_FLAG_KEEP_ALL = 0x18 SCHED_FLAG_KEEP_PARAMS = 0x10 SCHED_FLAG_KEEP_POLICY = 0x8 SCHED_FLAG_RECLAIM = 0x2 SCHED_FLAG_RESET_ON_FORK = 0x1 SCHED_FLAG_UTIL_CLAMP = 0x60 SCHED_FLAG_UTIL_CLAMP_MAX = 0x40 SCHED_FLAG_UTIL_CLAMP_MIN = 0x20 SCHED_IDLE = 0x5 SCHED_NORMAL = 0x0 SCHED_RESET_ON_FORK = 0x40000000 SCHED_RR = 0x2 SCM_CREDENTIALS = 0x2 SCM_PIDFD = 0x4 SCM_RIGHTS = 0x1 SCM_SECURITY = 0x3 SCM_TIMESTAMP = 0x1d SC_LOG_FLUSH = 0x100000 SECCOMP_ADDFD_FLAG_SEND = 0x2 SECCOMP_ADDFD_FLAG_SETFD = 0x1 SECCOMP_FILTER_FLAG_LOG = 0x2 SECCOMP_FILTER_FLAG_NEW_LISTENER = 0x8 SECCOMP_FILTER_FLAG_SPEC_ALLOW = 0x4 SECCOMP_FILTER_FLAG_TSYNC = 0x1 SECCOMP_FILTER_FLAG_TSYNC_ESRCH = 0x10 SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV = 0x20 SECCOMP_GET_ACTION_AVAIL = 0x2 SECCOMP_GET_NOTIF_SIZES = 0x3 SECCOMP_IOCTL_NOTIF_RECV = 0xc0502100 SECCOMP_IOCTL_NOTIF_SEND = 0xc0182101 SECCOMP_IOC_MAGIC = '!' SECCOMP_MODE_DISABLED = 0x0 SECCOMP_MODE_FILTER = 0x2 SECCOMP_MODE_STRICT = 0x1 SECCOMP_RET_ACTION = 0x7fff0000 SECCOMP_RET_ACTION_FULL = 0xffff0000 SECCOMP_RET_ALLOW = 0x7fff0000 SECCOMP_RET_DATA = 0xffff SECCOMP_RET_ERRNO = 0x50000 SECCOMP_RET_KILL = 0x0 SECCOMP_RET_KILL_PROCESS = 0x80000000 SECCOMP_RET_KILL_THREAD = 0x0 SECCOMP_RET_LOG = 0x7ffc0000 SECCOMP_RET_TRACE = 0x7ff00000 SECCOMP_RET_TRAP = 0x30000 SECCOMP_RET_USER_NOTIF = 0x7fc00000 SECCOMP_SET_MODE_FILTER = 0x1 SECCOMP_SET_MODE_STRICT = 0x0 SECCOMP_USER_NOTIF_FD_SYNC_WAKE_UP = 0x1 SECCOMP_USER_NOTIF_FLAG_CONTINUE = 0x1 SECRETMEM_MAGIC = 0x5345434d SECURITYFS_MAGIC = 0x73636673 SEEK_CUR = 0x1 SEEK_DATA = 0x3 SEEK_END = 0x2 SEEK_HOLE = 0x4 SEEK_MAX = 0x4 SEEK_SET = 0x0 SELINUX_MAGIC = 0xf97cff8c SHF_ALLOC = 0x2 SHF_EXCLUDE = 0x8000000 SHF_EXECINSTR = 0x4 SHF_GROUP = 0x200 SHF_INFO_LINK = 0x40 SHF_LINK_ORDER = 0x80 SHF_MASKOS = 0xff00000 SHF_MASKPROC = 0xf0000000 SHF_MERGE = 0x10 SHF_ORDERED = 0x4000000 SHF_OS_NONCONFORMING = 0x100 SHF_RELA_LIVEPATCH = 0x100000 SHF_RO_AFTER_INIT = 0x200000 SHF_STRINGS = 0x20 SHF_TLS = 0x400 SHF_WRITE = 0x1 SHN_ABS = 0xfff1 SHN_COMMON = 0xfff2 SHN_HIPROC = 0xff1f SHN_HIRESERVE = 0xffff SHN_LIVEPATCH = 0xff20 SHN_LOPROC = 0xff00 SHN_LORESERVE = 0xff00 SHN_UNDEF = 0x0 SHT_DYNAMIC = 0x6 SHT_DYNSYM = 0xb SHT_HASH = 0x5 SHT_HIPROC = 0x7fffffff SHT_HIUSER = 0xffffffff SHT_LOPROC = 0x70000000 SHT_LOUSER = 0x80000000 SHT_NOBITS = 0x8 SHT_NOTE = 0x7 SHT_NULL = 0x0 SHT_NUM = 0xc SHT_PROGBITS = 0x1 SHT_REL = 0x9 SHT_RELA = 0x4 SHT_SHLIB = 0xa SHT_STRTAB = 0x3 SHT_SYMTAB = 0x2 SHUT_RD = 0x0 SHUT_RDWR = 0x2 SHUT_WR = 0x1 SIOCADDDLCI = 0x8980 SIOCADDMULTI = 0x8931 SIOCADDRT = 0x890b SIOCBONDCHANGEACTIVE = 0x8995 SIOCBONDENSLAVE = 0x8990 SIOCBONDINFOQUERY = 0x8994 SIOCBONDRELEASE = 0x8991 SIOCBONDSETHWADDR = 0x8992 SIOCBONDSLAVEINFOQUERY = 0x8993 SIOCBRADDBR = 0x89a0 SIOCBRADDIF = 0x89a2 SIOCBRDELBR = 0x89a1 SIOCBRDELIF = 0x89a3 SIOCDARP = 0x8953 SIOCDELDLCI = 0x8981 SIOCDELMULTI = 0x8932 SIOCDELRT = 0x890c SIOCDEVPRIVATE = 0x89f0 SIOCDIFADDR = 0x8936 SIOCDRARP = 0x8960 SIOCETHTOOL = 0x8946 SIOCGARP = 0x8954 SIOCGETLINKNAME = 0x89e0 SIOCGETNODEID = 0x89e1 SIOCGHWTSTAMP = 0x89b1 SIOCGIFADDR = 0x8915 SIOCGIFBR = 0x8940 SIOCGIFBRDADDR = 0x8919 SIOCGIFCONF = 0x8912 SIOCGIFCOUNT = 0x8938 SIOCGIFDSTADDR = 0x8917 SIOCGIFENCAP = 0x8925 SIOCGIFFLAGS = 0x8913 SIOCGIFHWADDR = 0x8927 SIOCGIFINDEX = 0x8933 SIOCGIFMAP = 0x8970 SIOCGIFMEM = 0x891f SIOCGIFMETRIC = 0x891d SIOCGIFMTU = 0x8921 SIOCGIFNAME = 0x8910 SIOCGIFNETMASK = 0x891b SIOCGIFPFLAGS = 0x8935 SIOCGIFSLAVE = 0x8929 SIOCGIFTXQLEN = 0x8942 SIOCGIFVLAN = 0x8982 SIOCGMIIPHY = 0x8947 SIOCGMIIREG = 0x8948 SIOCGPPPCSTATS = 0x89f2 SIOCGPPPSTATS = 0x89f0 SIOCGPPPVER = 0x89f1 SIOCGRARP = 0x8961 SIOCGSKNS = 0x894c SIOCGSTAMP = 0x8906 SIOCGSTAMPNS = 0x8907 SIOCGSTAMPNS_OLD = 0x8907 SIOCGSTAMP_OLD = 0x8906 SIOCKCMATTACH = 0x89e0 SIOCKCMCLONE = 0x89e2 SIOCKCMUNATTACH = 0x89e1 SIOCOUTQNSD = 0x894b SIOCPROTOPRIVATE = 0x89e0 SIOCRTMSG = 0x890d SIOCSARP = 0x8955 SIOCSHWTSTAMP = 0x89b0 SIOCSIFADDR = 0x8916 SIOCSIFBR = 0x8941 SIOCSIFBRDADDR = 0x891a SIOCSIFDSTADDR = 0x8918 SIOCSIFENCAP = 0x8926 SIOCSIFFLAGS = 0x8914 SIOCSIFHWADDR = 0x8924 SIOCSIFHWBROADCAST = 0x8937 SIOCSIFLINK = 0x8911 SIOCSIFMAP = 0x8971 SIOCSIFMEM = 0x8920 SIOCSIFMETRIC = 0x891e SIOCSIFMTU = 0x8922 SIOCSIFNAME = 0x8923 SIOCSIFNETMASK = 0x891c SIOCSIFPFLAGS = 0x8934 SIOCSIFSLAVE = 0x8930 SIOCSIFTXQLEN = 0x8943 SIOCSIFVLAN = 0x8983 SIOCSMIIREG = 0x8949 SIOCSRARP = 0x8962 SIOCWANDEV = 0x894a SK_DIAG_BPF_STORAGE_MAX = 0x3 SK_DIAG_BPF_STORAGE_REQ_MAX = 0x1 SMACK_MAGIC = 0x43415d53 SMART_AUTOSAVE = 0xd2 SMART_AUTO_OFFLINE = 0xdb SMART_DISABLE = 0xd9 SMART_ENABLE = 0xd8 SMART_HCYL_PASS = 0xc2 SMART_IMMEDIATE_OFFLINE = 0xd4 SMART_LCYL_PASS = 0x4f SMART_READ_LOG_SECTOR = 0xd5 SMART_READ_THRESHOLDS = 0xd1 SMART_READ_VALUES = 0xd0 SMART_SAVE = 0xd3 SMART_STATUS = 0xda SMART_WRITE_LOG_SECTOR = 0xd6 SMART_WRITE_THRESHOLDS = 0xd7 SMB2_SUPER_MAGIC = 0xfe534d42 SMB_SUPER_MAGIC = 0x517b SOCKFS_MAGIC = 0x534f434b SOCK_BUF_LOCK_MASK = 0x3 SOCK_DCCP = 0x6 SOCK_DESTROY = 0x15 SOCK_DIAG_BY_FAMILY = 0x14 SOCK_IOC_TYPE = 0x89 SOCK_PACKET = 0xa SOCK_RAW = 0x3 SOCK_RCVBUF_LOCK = 0x2 SOCK_RDM = 0x4 SOCK_SEQPACKET = 0x5 SOCK_SNDBUF_LOCK = 0x1 SOCK_TXREHASH_DEFAULT = 0xff SOCK_TXREHASH_DISABLED = 0x0 SOCK_TXREHASH_ENABLED = 0x1 SOL_AAL = 0x109 SOL_ALG = 0x117 SOL_ATM = 0x108 SOL_CAIF = 0x116 SOL_CAN_BASE = 0x64 SOL_CAN_RAW = 0x65 SOL_DCCP = 0x10d SOL_DECNET = 0x105 SOL_ICMPV6 = 0x3a SOL_IP = 0x0 SOL_IPV6 = 0x29 SOL_IRDA = 0x10a SOL_IUCV = 0x115 SOL_KCM = 0x119 SOL_LLC = 0x10c SOL_MCTP = 0x11d SOL_MPTCP = 0x11c SOL_NETBEUI = 0x10b SOL_NETLINK = 0x10e SOL_NFC = 0x118 SOL_PACKET = 0x107 SOL_PNPIPE = 0x113 SOL_PPPOL2TP = 0x111 SOL_RAW = 0xff SOL_RDS = 0x114 SOL_RXRPC = 0x110 SOL_SMC = 0x11e SOL_TCP = 0x6 SOL_TIPC = 0x10f SOL_TLS = 0x11a SOL_UDP = 0x11 SOL_VSOCK = 0x11f SOL_X25 = 0x106 SOL_XDP = 0x11b SOMAXCONN = 0x1000 SO_ATTACH_FILTER = 0x1a SO_DEBUG = 0x1 SO_DETACH_BPF = 0x1b SO_DETACH_FILTER = 0x1b SO_EE_CODE_TXTIME_INVALID_PARAM = 0x1 SO_EE_CODE_TXTIME_MISSED = 0x2 SO_EE_CODE_ZEROCOPY_COPIED = 0x1 SO_EE_ORIGIN_ICMP = 0x2 SO_EE_ORIGIN_ICMP6 = 0x3 SO_EE_ORIGIN_LOCAL = 0x1 SO_EE_ORIGIN_NONE = 0x0 SO_EE_ORIGIN_TIMESTAMPING = 0x4 SO_EE_ORIGIN_TXSTATUS = 0x4 SO_EE_ORIGIN_TXTIME = 0x6 SO_EE_ORIGIN_ZEROCOPY = 0x5 SO_EE_RFC4884_FLAG_INVALID = 0x1 SO_GET_FILTER = 0x1a SO_NO_CHECK = 0xb SO_PEERNAME = 0x1c SO_PRIORITY = 0xc SO_TIMESTAMP = 0x1d SO_TIMESTAMP_OLD = 0x1d SO_VM_SOCKETS_BUFFER_MAX_SIZE = 0x2 SO_VM_SOCKETS_BUFFER_MIN_SIZE = 0x1 SO_VM_SOCKETS_BUFFER_SIZE = 0x0 SO_VM_SOCKETS_CONNECT_TIMEOUT = 0x6 SO_VM_SOCKETS_CONNECT_TIMEOUT_NEW = 0x8 SO_VM_SOCKETS_CONNECT_TIMEOUT_OLD = 0x6 SO_VM_SOCKETS_NONBLOCK_TXRX = 0x7 SO_VM_SOCKETS_PEER_HOST_VM_ID = 0x3 SO_VM_SOCKETS_TRUSTED = 0x5 SPLICE_F_GIFT = 0x8 SPLICE_F_MORE = 0x4 SPLICE_F_MOVE = 0x1 SPLICE_F_NONBLOCK = 0x2 SQUASHFS_MAGIC = 0x73717368 STACK_END_MAGIC = 0x57ac6e9d STATX_ALL = 0xfff STATX_ATIME = 0x20 STATX_ATTR_APPEND = 0x20 STATX_ATTR_AUTOMOUNT = 0x1000 STATX_ATTR_COMPRESSED = 0x4 STATX_ATTR_DAX = 0x200000 STATX_ATTR_ENCRYPTED = 0x800 STATX_ATTR_IMMUTABLE = 0x10 STATX_ATTR_MOUNT_ROOT = 0x2000 STATX_ATTR_NODUMP = 0x40 STATX_ATTR_VERITY = 0x100000 STATX_ATTR_WRITE_ATOMIC = 0x400000 STATX_BASIC_STATS = 0x7ff STATX_BLOCKS = 0x400 STATX_BTIME = 0x800 STATX_CTIME = 0x80 STATX_DIOALIGN = 0x2000 STATX_DIO_READ_ALIGN = 0x20000 STATX_GID = 0x10 STATX_INO = 0x100 STATX_MNT_ID = 0x1000 STATX_MNT_ID_UNIQUE = 0x4000 STATX_MODE = 0x2 STATX_MTIME = 0x40 STATX_NLINK = 0x4 STATX_SIZE = 0x200 STATX_SUBVOL = 0x8000 STATX_TYPE = 0x1 STATX_UID = 0x8 STATX_WRITE_ATOMIC = 0x10000 STATX__RESERVED = 0x80000000 STB_GLOBAL = 0x1 STB_LOCAL = 0x0 STB_WEAK = 0x2 STT_COMMON = 0x5 STT_FILE = 0x4 STT_FUNC = 0x2 STT_NOTYPE = 0x0 STT_OBJECT = 0x1 STT_SECTION = 0x3 STT_TLS = 0x6 SYNC_FILE_RANGE_WAIT_AFTER = 0x4 SYNC_FILE_RANGE_WAIT_BEFORE = 0x1 SYNC_FILE_RANGE_WRITE = 0x2 SYNC_FILE_RANGE_WRITE_AND_WAIT = 0x7 SYSFS_MAGIC = 0x62656572 S_BLKSIZE = 0x200 S_IEXEC = 0x40 S_IFBLK = 0x6000 S_IFCHR = 0x2000 S_IFDIR = 0x4000 S_IFIFO = 0x1000 S_IFLNK = 0xa000 S_IFMT = 0xf000 S_IFREG = 0x8000 S_IFSOCK = 0xc000 S_IREAD = 0x100 S_IRGRP = 0x20 S_IROTH = 0x4 S_IRUSR = 0x100 S_IRWXG = 0x38 S_IRWXO = 0x7 S_IRWXU = 0x1c0 S_ISGID = 0x400 S_ISUID = 0x800 S_ISVTX = 0x200 S_IWGRP = 0x10 S_IWOTH = 0x2 S_IWRITE = 0x80 S_IWUSR = 0x80 S_IXGRP = 0x8 S_IXOTH = 0x1 S_IXUSR = 0x40 TAB0 = 0x0 TASKSTATS_CMD_ATTR_MAX = 0x4 TASKSTATS_CMD_MAX = 0x2 TASKSTATS_GENL_NAME = "TASKSTATS" TASKSTATS_GENL_VERSION = 0x1 TASKSTATS_TYPE_MAX = 0x6 TASKSTATS_VERSION = 0x10 TCIFLUSH = 0x0 TCIOFF = 0x2 TCIOFLUSH = 0x2 TCION = 0x3 TCOFLUSH = 0x1 TCOOFF = 0x0 TCOON = 0x1 TCPOPT_EOL = 0x0 TCPOPT_MAXSEG = 0x2 TCPOPT_NOP = 0x1 TCPOPT_SACK = 0x5 TCPOPT_SACK_PERMITTED = 0x4 TCPOPT_TIMESTAMP = 0x8 TCPOPT_TSTAMP_HDR = 0x101080a TCPOPT_WINDOW = 0x3 TCP_CC_INFO = 0x1a TCP_CM_INQ = 0x24 TCP_CONGESTION = 0xd TCP_COOKIE_IN_ALWAYS = 0x1 TCP_COOKIE_MAX = 0x10 TCP_COOKIE_MIN = 0x8 TCP_COOKIE_OUT_NEVER = 0x2 TCP_COOKIE_PAIR_SIZE = 0x20 TCP_COOKIE_TRANSACTIONS = 0xf TCP_CORK = 0x3 TCP_DEFER_ACCEPT = 0x9 TCP_FASTOPEN = 0x17 TCP_FASTOPEN_CONNECT = 0x1e TCP_FASTOPEN_KEY = 0x21 TCP_FASTOPEN_NO_COOKIE = 0x22 TCP_INFO = 0xb TCP_INQ = 0x24 TCP_KEEPCNT = 0x6 TCP_KEEPIDLE = 0x4 TCP_KEEPINTVL = 0x5 TCP_LINGER2 = 0x8 TCP_MAXSEG = 0x2 TCP_MAXWIN = 0xffff TCP_MAX_WINSHIFT = 0xe TCP_MD5SIG = 0xe TCP_MD5SIG_EXT = 0x20 TCP_MD5SIG_FLAG_IFINDEX = 0x2 TCP_MD5SIG_FLAG_PREFIX = 0x1 TCP_MD5SIG_MAXKEYLEN = 0x50 TCP_MSS = 0x200 TCP_MSS_DEFAULT = 0x218 TCP_MSS_DESIRED = 0x4c4 TCP_NODELAY = 0x1 TCP_NOTSENT_LOWAT = 0x19 TCP_QUEUE_SEQ = 0x15 TCP_QUICKACK = 0xc TCP_REPAIR = 0x13 TCP_REPAIR_OFF = 0x0 TCP_REPAIR_OFF_NO_WP = -0x1 TCP_REPAIR_ON = 0x1 TCP_REPAIR_OPTIONS = 0x16 TCP_REPAIR_QUEUE = 0x14 TCP_REPAIR_WINDOW = 0x1d TCP_SAVED_SYN = 0x1c TCP_SAVE_SYN = 0x1b TCP_SYNCNT = 0x7 TCP_S_DATA_IN = 0x4 TCP_S_DATA_OUT = 0x8 TCP_THIN_DUPACK = 0x11 TCP_THIN_LINEAR_TIMEOUTS = 0x10 TCP_TIMESTAMP = 0x18 TCP_TX_DELAY = 0x25 TCP_ULP = 0x1f TCP_USER_TIMEOUT = 0x12 TCP_WINDOW_CLAMP = 0xa TCP_ZEROCOPY_RECEIVE = 0x23 TFD_TIMER_ABSTIME = 0x1 TFD_TIMER_CANCEL_ON_SET = 0x2 TIMER_ABSTIME = 0x1 TIOCM_DTR = 0x2 TIOCM_LE = 0x1 TIOCM_RTS = 0x4 TIOCPKT_DATA = 0x0 TIOCPKT_DOSTOP = 0x20 TIOCPKT_FLUSHREAD = 0x1 TIOCPKT_FLUSHWRITE = 0x2 TIOCPKT_IOCTL = 0x40 TIOCPKT_NOSTOP = 0x10 TIOCPKT_START = 0x8 TIOCPKT_STOP = 0x4 TIPC_ADDR_ID = 0x3 TIPC_ADDR_MCAST = 0x1 TIPC_ADDR_NAME = 0x2 TIPC_ADDR_NAMESEQ = 0x1 TIPC_AEAD_ALG_NAME = 0x20 TIPC_AEAD_KEYLEN_MAX = 0x24 TIPC_AEAD_KEYLEN_MIN = 0x14 TIPC_AEAD_KEY_SIZE_MAX = 0x48 TIPC_CFG_SRV = 0x0 TIPC_CLUSTER_BITS = 0xc TIPC_CLUSTER_MASK = 0xfff000 TIPC_CLUSTER_OFFSET = 0xc TIPC_CLUSTER_SIZE = 0xfff TIPC_CONN_SHUTDOWN = 0x5 TIPC_CONN_TIMEOUT = 0x82 TIPC_CRITICAL_IMPORTANCE = 0x3 TIPC_DESTNAME = 0x3 TIPC_DEST_DROPPABLE = 0x81 TIPC_ERRINFO = 0x1 TIPC_ERR_NO_NAME = 0x1 TIPC_ERR_NO_NODE = 0x3 TIPC_ERR_NO_PORT = 0x2 TIPC_ERR_OVERLOAD = 0x4 TIPC_GROUP_JOIN = 0x87 TIPC_GROUP_LEAVE = 0x88 TIPC_GROUP_LOOPBACK = 0x1 TIPC_GROUP_MEMBER_EVTS = 0x2 TIPC_HIGH_IMPORTANCE = 0x2 TIPC_IMPORTANCE = 0x7f TIPC_LINK_STATE = 0x2 TIPC_LOW_IMPORTANCE = 0x0 TIPC_MAX_BEARER_NAME = 0x20 TIPC_MAX_IF_NAME = 0x10 TIPC_MAX_LINK_NAME = 0x44 TIPC_MAX_MEDIA_NAME = 0x10 TIPC_MAX_USER_MSG_SIZE = 0x101d0 TIPC_MCAST_BROADCAST = 0x85 TIPC_MCAST_REPLICAST = 0x86 TIPC_MEDIUM_IMPORTANCE = 0x1 TIPC_NODEID_LEN = 0x10 TIPC_NODELAY = 0x8a TIPC_NODE_BITS = 0xc TIPC_NODE_MASK = 0xfff TIPC_NODE_OFFSET = 0x0 TIPC_NODE_RECVQ_DEPTH = 0x83 TIPC_NODE_SIZE = 0xfff TIPC_NODE_STATE = 0x0 TIPC_OK = 0x0 TIPC_PUBLISHED = 0x1 TIPC_REKEYING_NOW = 0xffffffff TIPC_RESERVED_TYPES = 0x40 TIPC_RETDATA = 0x2 TIPC_SERVICE_ADDR = 0x2 TIPC_SERVICE_RANGE = 0x1 TIPC_SOCKET_ADDR = 0x3 TIPC_SOCK_RECVQ_DEPTH = 0x84 TIPC_SOCK_RECVQ_USED = 0x89 TIPC_SRC_DROPPABLE = 0x80 TIPC_SUBSCR_TIMEOUT = 0x3 TIPC_SUB_CANCEL = 0x4 TIPC_SUB_PORTS = 0x1 TIPC_SUB_SERVICE = 0x2 TIPC_TOP_SRV = 0x1 TIPC_WAIT_FOREVER = 0xffffffff TIPC_WITHDRAWN = 0x2 TIPC_ZONE_BITS = 0x8 TIPC_ZONE_CLUSTER_MASK = 0xfffff000 TIPC_ZONE_MASK = 0xff000000 TIPC_ZONE_OFFSET = 0x18 TIPC_ZONE_SCOPE = 0x1 TIPC_ZONE_SIZE = 0xff TMPFS_MAGIC = 0x1021994 TPACKET_ALIGNMENT = 0x10 TPACKET_HDRLEN = 0x34 TP_STATUS_AVAILABLE = 0x0 TP_STATUS_BLK_TMO = 0x20 TP_STATUS_COPY = 0x2 TP_STATUS_CSUMNOTREADY = 0x8 TP_STATUS_CSUM_VALID = 0x80 TP_STATUS_GSO_TCP = 0x100 TP_STATUS_KERNEL = 0x0 TP_STATUS_LOSING = 0x4 TP_STATUS_SENDING = 0x2 TP_STATUS_SEND_REQUEST = 0x1 TP_STATUS_TS_RAW_HARDWARE = 0x80000000 TP_STATUS_TS_SOFTWARE = 0x20000000 TP_STATUS_TS_SYS_HARDWARE = 0x40000000 TP_STATUS_USER = 0x1 TP_STATUS_VLAN_TPID_VALID = 0x40 TP_STATUS_VLAN_VALID = 0x10 TP_STATUS_WRONG_FORMAT = 0x4 TRACEFS_MAGIC = 0x74726163 TS_COMM_LEN = 0x20 UBI_IOCECNFO = 0xc01c6f06 UDF_SUPER_MAGIC = 0x15013346 UDP_CORK = 0x1 UDP_ENCAP = 0x64 UDP_ENCAP_ESPINUDP = 0x2 UDP_ENCAP_ESPINUDP_NON_IKE = 0x1 UDP_ENCAP_GTP0 = 0x4 UDP_ENCAP_GTP1U = 0x5 UDP_ENCAP_L2TPINUDP = 0x3 UDP_GRO = 0x68 UDP_NO_CHECK6_RX = 0x66 UDP_NO_CHECK6_TX = 0x65 UDP_SEGMENT = 0x67 UMOUNT_NOFOLLOW = 0x8 USBDEVICE_SUPER_MAGIC = 0x9fa2 UTIME_NOW = 0x3fffffff UTIME_OMIT = 0x3ffffffe V9FS_MAGIC = 0x1021997 VERASE = 0x2 VER_FLG_BASE = 0x1 VER_FLG_WEAK = 0x2 VINTR = 0x0 VKILL = 0x3 VLNEXT = 0xf VMADDR_CID_ANY = 0xffffffff VMADDR_CID_HOST = 0x2 VMADDR_CID_HYPERVISOR = 0x0 VMADDR_CID_LOCAL = 0x1 VMADDR_FLAG_TO_HOST = 0x1 VMADDR_PORT_ANY = 0xffffffff VM_SOCKETS_INVALID_VERSION = 0xffffffff VQUIT = 0x1 VT0 = 0x0 WAKE_MAGIC = 0x20 WALL = 0x40000000 WCLONE = 0x80000000 WCONTINUED = 0x8 WDIOC_SETPRETIMEOUT = 0xc0045708 WDIOC_SETTIMEOUT = 0xc0045706 WDIOF_ALARMONLY = 0x400 WDIOF_CARDRESET = 0x20 WDIOF_EXTERN1 = 0x4 WDIOF_EXTERN2 = 0x8 WDIOF_FANFAULT = 0x2 WDIOF_KEEPALIVEPING = 0x8000 WDIOF_MAGICCLOSE = 0x100 WDIOF_OVERHEAT = 0x1 WDIOF_POWEROVER = 0x40 WDIOF_POWERUNDER = 0x10 WDIOF_PRETIMEOUT = 0x200 WDIOF_SETTIMEOUT = 0x80 WDIOF_UNKNOWN = -0x1 WDIOS_DISABLECARD = 0x1 WDIOS_ENABLECARD = 0x2 WDIOS_TEMPPANIC = 0x4 WDIOS_UNKNOWN = -0x1 WEXITED = 0x4 WGALLOWEDIP_A_MAX = 0x4 WGDEVICE_A_MAX = 0x8 WGPEER_A_MAX = 0xa WG_CMD_MAX = 0x1 WG_GENL_NAME = "wireguard" WG_GENL_VERSION = 0x1 WG_KEY_LEN = 0x20 WIN_ACKMEDIACHANGE = 0xdb WIN_CHECKPOWERMODE1 = 0xe5 WIN_CHECKPOWERMODE2 = 0x98 WIN_DEVICE_RESET = 0x8 WIN_DIAGNOSE = 0x90 WIN_DOORLOCK = 0xde WIN_DOORUNLOCK = 0xdf WIN_DOWNLOAD_MICROCODE = 0x92 WIN_FLUSH_CACHE = 0xe7 WIN_FLUSH_CACHE_EXT = 0xea WIN_FORMAT = 0x50 WIN_GETMEDIASTATUS = 0xda WIN_IDENTIFY = 0xec WIN_IDENTIFY_DMA = 0xee WIN_IDLEIMMEDIATE = 0xe1 WIN_INIT = 0x60 WIN_MEDIAEJECT = 0xed WIN_MULTREAD = 0xc4 WIN_MULTREAD_EXT = 0x29 WIN_MULTWRITE = 0xc5 WIN_MULTWRITE_EXT = 0x39 WIN_NOP = 0x0 WIN_PACKETCMD = 0xa0 WIN_PIDENTIFY = 0xa1 WIN_POSTBOOT = 0xdc WIN_PREBOOT = 0xdd WIN_QUEUED_SERVICE = 0xa2 WIN_READ = 0x20 WIN_READDMA = 0xc8 WIN_READDMA_EXT = 0x25 WIN_READDMA_ONCE = 0xc9 WIN_READDMA_QUEUED = 0xc7 WIN_READDMA_QUEUED_EXT = 0x26 WIN_READ_BUFFER = 0xe4 WIN_READ_EXT = 0x24 WIN_READ_LONG = 0x22 WIN_READ_LONG_ONCE = 0x23 WIN_READ_NATIVE_MAX = 0xf8 WIN_READ_NATIVE_MAX_EXT = 0x27 WIN_READ_ONCE = 0x21 WIN_RECAL = 0x10 WIN_RESTORE = 0x10 WIN_SECURITY_DISABLE = 0xf6 WIN_SECURITY_ERASE_PREPARE = 0xf3 WIN_SECURITY_ERASE_UNIT = 0xf4 WIN_SECURITY_FREEZE_LOCK = 0xf5 WIN_SECURITY_SET_PASS = 0xf1 WIN_SECURITY_UNLOCK = 0xf2 WIN_SEEK = 0x70 WIN_SETFEATURES = 0xef WIN_SETIDLE1 = 0xe3 WIN_SETIDLE2 = 0x97 WIN_SETMULT = 0xc6 WIN_SET_MAX = 0xf9 WIN_SET_MAX_EXT = 0x37 WIN_SLEEPNOW1 = 0xe6 WIN_SLEEPNOW2 = 0x99 WIN_SMART = 0xb0 WIN_SPECIFY = 0x91 WIN_SRST = 0x8 WIN_STANDBY = 0xe2 WIN_STANDBY2 = 0x96 WIN_STANDBYNOW1 = 0xe0 WIN_STANDBYNOW2 = 0x94 WIN_VERIFY = 0x40 WIN_VERIFY_EXT = 0x42 WIN_VERIFY_ONCE = 0x41 WIN_WRITE = 0x30 WIN_WRITEDMA = 0xca WIN_WRITEDMA_EXT = 0x35 WIN_WRITEDMA_ONCE = 0xcb WIN_WRITEDMA_QUEUED = 0xcc WIN_WRITEDMA_QUEUED_EXT = 0x36 WIN_WRITE_BUFFER = 0xe8 WIN_WRITE_EXT = 0x34 WIN_WRITE_LONG = 0x32 WIN_WRITE_LONG_ONCE = 0x33 WIN_WRITE_ONCE = 0x31 WIN_WRITE_SAME = 0xe9 WIN_WRITE_VERIFY = 0x3c WNOHANG = 0x1 WNOTHREAD = 0x20000000 WNOWAIT = 0x1000000 WSTOPPED = 0x2 WUNTRACED = 0x2 XATTR_CREATE = 0x1 XATTR_REPLACE = 0x2 XDP_COPY = 0x2 XDP_FLAGS_DRV_MODE = 0x4 XDP_FLAGS_HW_MODE = 0x8 XDP_FLAGS_MASK = 0x1f XDP_FLAGS_MODES = 0xe XDP_FLAGS_REPLACE = 0x10 XDP_FLAGS_SKB_MODE = 0x2 XDP_FLAGS_UPDATE_IF_NOEXIST = 0x1 XDP_MMAP_OFFSETS = 0x1 XDP_OPTIONS = 0x8 XDP_OPTIONS_ZEROCOPY = 0x1 XDP_PACKET_HEADROOM = 0x100 XDP_PGOFF_RX_RING = 0x0 XDP_PGOFF_TX_RING = 0x80000000 XDP_PKT_CONTD = 0x1 XDP_RING_NEED_WAKEUP = 0x1 XDP_RX_RING = 0x2 XDP_SHARED_UMEM = 0x1 XDP_STATISTICS = 0x7 XDP_TXMD_FLAGS_CHECKSUM = 0x2 XDP_TXMD_FLAGS_LAUNCH_TIME = 0x4 XDP_TXMD_FLAGS_TIMESTAMP = 0x1 XDP_TX_METADATA = 0x2 XDP_TX_RING = 0x3 XDP_UMEM_COMPLETION_RING = 0x6 XDP_UMEM_FILL_RING = 0x5 XDP_UMEM_PGOFF_COMPLETION_RING = 0x180000000 XDP_UMEM_PGOFF_FILL_RING = 0x100000000 XDP_UMEM_REG = 0x4 XDP_UMEM_TX_METADATA_LEN = 0x4 XDP_UMEM_TX_SW_CSUM = 0x2 XDP_UMEM_UNALIGNED_CHUNK_FLAG = 0x1 XDP_USE_NEED_WAKEUP = 0x8 XDP_USE_SG = 0x10 XDP_ZEROCOPY = 0x4 XENFS_SUPER_MAGIC = 0xabba1974 XFS_SUPER_MAGIC = 0x58465342 ZONEFS_MAGIC = 0x5a4f4653 _HIDIOCGRAWNAME_LEN = 0x80 _HIDIOCGRAWPHYS_LEN = 0x40 _HIDIOCGRAWUNIQ_LEN = 0x40 ) // Errors const ( E2BIG = syscall.Errno(0x7) EACCES = syscall.Errno(0xd) EAGAIN = syscall.Errno(0xb) EBADF = syscall.Errno(0x9) EBUSY = syscall.Errno(0x10) ECHILD = syscall.Errno(0xa) EDOM = syscall.Errno(0x21) EEXIST = syscall.Errno(0x11) EFAULT = syscall.Errno(0xe) EFBIG = syscall.Errno(0x1b) EINTR = syscall.Errno(0x4) EINVAL = syscall.Errno(0x16) EIO = syscall.Errno(0x5) EISDIR = syscall.Errno(0x15) EMFILE = syscall.Errno(0x18) EMLINK = syscall.Errno(0x1f) ENFILE = syscall.Errno(0x17) ENODEV = syscall.Errno(0x13) ENOENT = syscall.Errno(0x2) ENOEXEC = syscall.Errno(0x8) ENOMEM = syscall.Errno(0xc) ENOSPC = syscall.Errno(0x1c) ENOTBLK = syscall.Errno(0xf) ENOTDIR = syscall.Errno(0x14) ENOTTY = syscall.Errno(0x19) ENXIO = syscall.Errno(0x6) EPERM = syscall.Errno(0x1) EPIPE = syscall.Errno(0x20) ERANGE = syscall.Errno(0x22) EROFS = syscall.Errno(0x1e) ESPIPE = syscall.Errno(0x1d) ESRCH = syscall.Errno(0x3) ETXTBSY = syscall.Errno(0x1a) EWOULDBLOCK = syscall.Errno(0xb) EXDEV = syscall.Errno(0x12) ) // Signals const ( SIGABRT = syscall.Signal(0x6) SIGALRM = syscall.Signal(0xe) SIGFPE = syscall.Signal(0x8) SIGHUP = syscall.Signal(0x1) SIGILL = syscall.Signal(0x4) SIGINT = syscall.Signal(0x2) SIGIOT = syscall.Signal(0x6) SIGKILL = syscall.Signal(0x9) SIGPIPE = syscall.Signal(0xd) SIGQUIT = syscall.Signal(0x3) SIGSEGV = syscall.Signal(0xb) SIGTERM = syscall.Signal(0xf) SIGTRAP = syscall.Signal(0x5) ) ================================================ FILE: vendor/golang.org/x/sys/unix/zerrors_linux_386.go ================================================ // mkerrors.sh -Wall -Werror -static -I/tmp/386/include -m32 // Code generated by the command above; see README.md. DO NOT EDIT. //go:build 386 && linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -Wall -Werror -static -I/tmp/386/include -m32 _const.go package unix import "syscall" const ( B1000000 = 0x1008 B115200 = 0x1002 B1152000 = 0x1009 B1500000 = 0x100a B2000000 = 0x100b B230400 = 0x1003 B2500000 = 0x100c B3000000 = 0x100d B3500000 = 0x100e B4000000 = 0x100f B460800 = 0x1004 B500000 = 0x1005 B57600 = 0x1001 B576000 = 0x1006 B921600 = 0x1007 BLKALIGNOFF = 0x127a BLKBSZGET = 0x80041270 BLKBSZSET = 0x40041271 BLKDISCARD = 0x1277 BLKDISCARDZEROES = 0x127c BLKFLSBUF = 0x1261 BLKFRAGET = 0x1265 BLKFRASET = 0x1264 BLKGETDISKSEQ = 0x80081280 BLKGETSIZE = 0x1260 BLKGETSIZE64 = 0x80041272 BLKIOMIN = 0x1278 BLKIOOPT = 0x1279 BLKPBSZGET = 0x127b BLKRAGET = 0x1263 BLKRASET = 0x1262 BLKROGET = 0x125e BLKROSET = 0x125d BLKROTATIONAL = 0x127e BLKRRPART = 0x125f BLKSECDISCARD = 0x127d BLKSECTGET = 0x1267 BLKSECTSET = 0x1266 BLKSSZGET = 0x1268 BLKZEROOUT = 0x127f BOTHER = 0x1000 BS1 = 0x2000 BSDLY = 0x2000 CBAUD = 0x100f CBAUDEX = 0x1000 CIBAUD = 0x100f0000 CLOCAL = 0x800 CR1 = 0x200 CR2 = 0x400 CR3 = 0x600 CRDLY = 0x600 CREAD = 0x80 CS6 = 0x10 CS7 = 0x20 CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 DM_MPATH_PROBE_PATHS = 0xfd12 ECCGETLAYOUT = 0x81484d11 ECCGETSTATS = 0x80104d12 ECHOCTL = 0x200 ECHOE = 0x10 ECHOK = 0x20 ECHOKE = 0x800 ECHONL = 0x40 ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 EPIOCGPARAMS = 0x80088a02 EPIOCSPARAMS = 0x40088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 FFDLY = 0x8000 FICLONE = 0x40049409 FICLONERANGE = 0x4020940d FLUSHO = 0x1000 FP_XSTATE_MAGIC2 = 0x46505845 FS_IOC_ENABLE_VERITY = 0x40806685 FS_IOC_GETFLAGS = 0x80046601 FS_IOC_GET_ENCRYPTION_NONCE = 0x8010661b FS_IOC_GET_ENCRYPTION_POLICY = 0x400c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x40106614 FS_IOC_SETFLAGS = 0x40046602 FS_IOC_SET_ENCRYPTION_POLICY = 0x800c6613 F_GETLK = 0xc F_GETLK64 = 0xc F_GETOWN = 0x9 F_RDLCK = 0x0 F_SETLK = 0xd F_SETLK64 = 0xd F_SETLKW = 0xe F_SETLKW64 = 0xe F_SETOWN = 0x8 F_UNLCK = 0x2 F_WRLCK = 0x1 HIDIOCGRAWINFO = 0x80084803 HIDIOCGRDESC = 0x90044802 HIDIOCGRDESCSIZE = 0x80044801 HIDIOCREVOKE = 0x4004480d HUPCL = 0x400 ICANON = 0x2 IEXTEN = 0x8000 IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x800 IOCTL_MEI_NOTIFY_GET = 0x80044803 IOCTL_MEI_NOTIFY_SET = 0x40044802 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x7b9 IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_MASK = 0xffff0f00 ISIG = 0x1 IUCLC = 0x200 IXOFF = 0x1000 IXON = 0x400 MAP_32BIT = 0x40 MAP_ABOVE4G = 0x80 MAP_ANON = 0x20 MAP_ANONYMOUS = 0x20 MAP_DENYWRITE = 0x800 MAP_EXECUTABLE = 0x1000 MAP_GROWSDOWN = 0x100 MAP_HUGETLB = 0x40000 MAP_LOCKED = 0x2000 MAP_NONBLOCK = 0x10000 MAP_NORESERVE = 0x4000 MAP_POPULATE = 0x8000 MAP_STACK = 0x20000 MAP_SYNC = 0x80000 MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MCL_ONFAULT = 0x4 MEMERASE = 0x40084d02 MEMERASE64 = 0x40104d14 MEMGETBADBLOCK = 0x40084d0b MEMGETINFO = 0x80204d01 MEMGETOOBSEL = 0x80c84d0a MEMGETREGIONCOUNT = 0x80044d07 MEMISLOCKED = 0x80084d17 MEMLOCK = 0x40084d05 MEMREAD = 0xc03c4d1a MEMREADOOB = 0xc00c4d04 MEMSETBADBLOCK = 0x40084d0c MEMUNLOCK = 0x40084d06 MEMWRITEOOB = 0xc00c4d03 MTDFILEMODE = 0x4d13 NFDBITS = 0x20 NLDLY = 0x100 NOFLSH = 0x80 NS_GET_MNTNS_ID = 0x8008b705 NS_GET_NSTYPE = 0xb703 NS_GET_OWNER_UID = 0xb704 NS_GET_PARENT = 0xb702 NS_GET_PID_FROM_PIDNS = 0x8004b706 NS_GET_PID_IN_PIDNS = 0x8004b708 NS_GET_TGID_FROM_PIDNS = 0x8004b707 NS_GET_TGID_IN_PIDNS = 0x8004b709 NS_GET_USERNS = 0xb701 OLCUC = 0x2 ONLCR = 0x4 OTPERASE = 0x400c4d19 OTPGETREGIONCOUNT = 0x40044d0e OTPGETREGIONINFO = 0x400c4d0f OTPLOCK = 0x800c4d10 OTPSELECT = 0x80044d0d O_APPEND = 0x400 O_ASYNC = 0x2000 O_CLOEXEC = 0x80000 O_CREAT = 0x40 O_DIRECT = 0x4000 O_DIRECTORY = 0x10000 O_DSYNC = 0x1000 O_EXCL = 0x80 O_FSYNC = 0x101000 O_LARGEFILE = 0x8000 O_NDELAY = 0x800 O_NOATIME = 0x40000 O_NOCTTY = 0x100 O_NOFOLLOW = 0x20000 O_NONBLOCK = 0x800 O_PATH = 0x200000 O_RSYNC = 0x101000 O_SYNC = 0x101000 O_TMPFILE = 0x410000 O_TRUNC = 0x200 PARENB = 0x100 PARODD = 0x200 PENDIN = 0x4000 PERF_EVENT_IOC_DISABLE = 0x2401 PERF_EVENT_IOC_ENABLE = 0x2400 PERF_EVENT_IOC_ID = 0x80042407 PERF_EVENT_IOC_MODIFY_ATTRIBUTES = 0x4004240b PERF_EVENT_IOC_PAUSE_OUTPUT = 0x40042409 PERF_EVENT_IOC_PERIOD = 0x40082404 PERF_EVENT_IOC_QUERY_BPF = 0xc004240a PERF_EVENT_IOC_REFRESH = 0x2402 PERF_EVENT_IOC_RESET = 0x2403 PERF_EVENT_IOC_SET_BPF = 0x40042408 PERF_EVENT_IOC_SET_FILTER = 0x40042406 PERF_EVENT_IOC_SET_OUTPUT = 0x2405 PPPIOCATTACH = 0x4004743d PPPIOCATTCHAN = 0x40047438 PPPIOCBRIDGECHAN = 0x40047435 PPPIOCCONNECT = 0x4004743a PPPIOCDETACH = 0x4004743c PPPIOCDISCONN = 0x7439 PPPIOCGASYNCMAP = 0x80047458 PPPIOCGCHAN = 0x80047437 PPPIOCGDEBUG = 0x80047441 PPPIOCGFLAGS = 0x8004745a PPPIOCGIDLE = 0x8008743f PPPIOCGIDLE32 = 0x8008743f PPPIOCGIDLE64 = 0x8010743f PPPIOCGL2TPSTATS = 0x80487436 PPPIOCGMRU = 0x80047453 PPPIOCGRASYNCMAP = 0x80047455 PPPIOCGUNIT = 0x80047456 PPPIOCGXASYNCMAP = 0x80207450 PPPIOCSACTIVE = 0x40087446 PPPIOCSASYNCMAP = 0x40047457 PPPIOCSCOMPRESS = 0x400c744d PPPIOCSDEBUG = 0x40047440 PPPIOCSFLAGS = 0x40047459 PPPIOCSMAXCID = 0x40047451 PPPIOCSMRRU = 0x4004743b PPPIOCSMRU = 0x40047452 PPPIOCSNPMODE = 0x4008744b PPPIOCSPASS = 0x40087447 PPPIOCSRASYNCMAP = 0x40047454 PPPIOCSXASYNCMAP = 0x4020744f PPPIOCUNBRIDGECHAN = 0x7434 PPPIOCXFERUNIT = 0x744e PR_SET_PTRACER_ANY = 0xffffffff PTP_CLOCK_GETCAPS = 0x80503d01 PTP_CLOCK_GETCAPS2 = 0x80503d0a PTP_ENABLE_PPS = 0x40043d04 PTP_ENABLE_PPS2 = 0x40043d0d PTP_EXTTS_REQUEST = 0x40103d02 PTP_EXTTS_REQUEST2 = 0x40103d0b PTP_MASK_CLEAR_ALL = 0x3d13 PTP_MASK_EN_SINGLE = 0x40043d14 PTP_PEROUT_REQUEST = 0x40383d03 PTP_PEROUT_REQUEST2 = 0x40383d0c PTP_PIN_SETFUNC = 0x40603d07 PTP_PIN_SETFUNC2 = 0x40603d10 PTP_SYS_OFFSET = 0x43403d05 PTP_SYS_OFFSET2 = 0x43403d0e PTRACE_GETFPREGS = 0xe PTRACE_GETFPXREGS = 0x12 PTRACE_GET_THREAD_AREA = 0x19 PTRACE_OLDSETOPTIONS = 0x15 PTRACE_SETFPREGS = 0xf PTRACE_SETFPXREGS = 0x13 PTRACE_SET_THREAD_AREA = 0x1a PTRACE_SINGLEBLOCK = 0x21 PTRACE_SYSEMU = 0x1f PTRACE_SYSEMU_SINGLESTEP = 0x20 RLIMIT_AS = 0x9 RLIMIT_MEMLOCK = 0x8 RLIMIT_NOFILE = 0x7 RLIMIT_NPROC = 0x6 RLIMIT_RSS = 0x5 RNDADDENTROPY = 0x40085203 RNDADDTOENTCNT = 0x40045201 RNDCLEARPOOL = 0x5206 RNDGETENTCNT = 0x80045200 RNDGETPOOL = 0x80085202 RNDRESEEDCRNG = 0x5207 RNDZAPENTCNT = 0x5204 RTC_AIE_OFF = 0x7002 RTC_AIE_ON = 0x7001 RTC_ALM_READ = 0x80247008 RTC_ALM_SET = 0x40247007 RTC_EPOCH_READ = 0x8004700d RTC_EPOCH_SET = 0x4004700e RTC_IRQP_READ = 0x8004700b RTC_IRQP_SET = 0x4004700c RTC_PARAM_GET = 0x40187013 RTC_PARAM_SET = 0x40187014 RTC_PIE_OFF = 0x7006 RTC_PIE_ON = 0x7005 RTC_PLL_GET = 0x801c7011 RTC_PLL_SET = 0x401c7012 RTC_RD_TIME = 0x80247009 RTC_SET_TIME = 0x4024700a RTC_UIE_OFF = 0x7004 RTC_UIE_ON = 0x7003 RTC_VL_CLR = 0x7014 RTC_VL_READ = 0x80047013 RTC_WIE_OFF = 0x7010 RTC_WIE_ON = 0x700f RTC_WKALM_RD = 0x80287010 RTC_WKALM_SET = 0x4028700f SCM_DEVMEM_DMABUF = 0x4f SCM_DEVMEM_LINEAR = 0x4e SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a SCM_TIMESTAMPNS = 0x23 SCM_TS_OPT_ID = 0x51 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 SECCOMP_IOCTL_NOTIF_ADDFD = 0x40182103 SECCOMP_IOCTL_NOTIF_ID_VALID = 0x40082102 SECCOMP_IOCTL_NOTIF_SET_FLAGS = 0x40082104 SFD_CLOEXEC = 0x80000 SFD_NONBLOCK = 0x800 SIOCATMARK = 0x8905 SIOCGPGRP = 0x8904 SIOCGSTAMPNS_NEW = 0x80108907 SIOCGSTAMP_NEW = 0x80108906 SIOCINQ = 0x541b SIOCOUTQ = 0x5411 SIOCSPGRP = 0x8902 SOCK_CLOEXEC = 0x80000 SOCK_DGRAM = 0x2 SOCK_NONBLOCK = 0x800 SOCK_STREAM = 0x1 SOL_SOCKET = 0x1 SO_ACCEPTCONN = 0x1e SO_ATTACH_BPF = 0x32 SO_ATTACH_REUSEPORT_CBPF = 0x33 SO_ATTACH_REUSEPORT_EBPF = 0x34 SO_BINDTODEVICE = 0x19 SO_BINDTOIFINDEX = 0x3e SO_BPF_EXTENSIONS = 0x30 SO_BROADCAST = 0x6 SO_BSDCOMPAT = 0xe SO_BUF_LOCK = 0x48 SO_BUSY_POLL = 0x2e SO_BUSY_POLL_BUDGET = 0x46 SO_CNX_ADVICE = 0x35 SO_COOKIE = 0x39 SO_DETACH_REUSEPORT_BPF = 0x44 SO_DEVMEM_DMABUF = 0x4f SO_DEVMEM_DONTNEED = 0x50 SO_DEVMEM_LINEAR = 0x4e SO_DOMAIN = 0x27 SO_DONTROUTE = 0x5 SO_ERROR = 0x4 SO_INCOMING_CPU = 0x31 SO_INCOMING_NAPI_ID = 0x38 SO_KEEPALIVE = 0x9 SO_LINGER = 0xd SO_LOCK_FILTER = 0x2c SO_MARK = 0x24 SO_MAX_PACING_RATE = 0x2f SO_MEMINFO = 0x37 SO_NETNS_COOKIE = 0x47 SO_NOFCS = 0x2b SO_OOBINLINE = 0xa SO_PASSCRED = 0x10 SO_PASSPIDFD = 0x4c SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x11 SO_PEERGROUPS = 0x3b SO_PEERPIDFD = 0x4d SO_PEERSEC = 0x1f SO_PREFER_BUSY_POLL = 0x45 SO_PROTOCOL = 0x26 SO_RCVBUF = 0x8 SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x12 SO_RCVMARK = 0x4b SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x14 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x14 SO_RESERVE_MEM = 0x49 SO_REUSEADDR = 0x2 SO_REUSEPORT = 0xf SO_RXQ_OVFL = 0x28 SO_SECURITY_AUTHENTICATION = 0x16 SO_SECURITY_ENCRYPTION_NETWORK = 0x18 SO_SECURITY_ENCRYPTION_TRANSPORT = 0x17 SO_SELECT_ERR_QUEUE = 0x2d SO_SNDBUF = 0x7 SO_SNDBUFFORCE = 0x20 SO_SNDLOWAT = 0x13 SO_SNDTIMEO = 0x15 SO_SNDTIMEO_NEW = 0x43 SO_SNDTIMEO_OLD = 0x15 SO_TIMESTAMPING = 0x25 SO_TIMESTAMPING_NEW = 0x41 SO_TIMESTAMPING_OLD = 0x25 SO_TIMESTAMPNS = 0x23 SO_TIMESTAMPNS_NEW = 0x40 SO_TIMESTAMPNS_OLD = 0x23 SO_TIMESTAMP_NEW = 0x3f SO_TXREHASH = 0x4a SO_TXTIME = 0x3d SO_TYPE = 0x3 SO_WIFI_STATUS = 0x29 SO_ZEROCOPY = 0x3c TAB1 = 0x800 TAB2 = 0x1000 TAB3 = 0x1800 TABDLY = 0x1800 TCFLSH = 0x540b TCGETA = 0x5405 TCGETS = 0x5401 TCGETS2 = 0x802c542a TCGETX = 0x5432 TCSAFLUSH = 0x2 TCSBRK = 0x5409 TCSBRKP = 0x5425 TCSETA = 0x5406 TCSETAF = 0x5408 TCSETAW = 0x5407 TCSETS = 0x5402 TCSETS2 = 0x402c542b TCSETSF = 0x5404 TCSETSF2 = 0x402c542d TCSETSW = 0x5403 TCSETSW2 = 0x402c542c TCSETX = 0x5433 TCSETXF = 0x5434 TCSETXW = 0x5435 TCXONC = 0x540a TFD_CLOEXEC = 0x80000 TFD_NONBLOCK = 0x800 TIOCCBRK = 0x5428 TIOCCONS = 0x541d TIOCEXCL = 0x540c TIOCGDEV = 0x80045432 TIOCGETD = 0x5424 TIOCGEXCL = 0x80045440 TIOCGICOUNT = 0x545d TIOCGISO7816 = 0x80285442 TIOCGLCKTRMIOS = 0x5456 TIOCGPGRP = 0x540f TIOCGPKT = 0x80045438 TIOCGPTLCK = 0x80045439 TIOCGPTN = 0x80045430 TIOCGPTPEER = 0x5441 TIOCGRS485 = 0x542e TIOCGSERIAL = 0x541e TIOCGSID = 0x5429 TIOCGSOFTCAR = 0x5419 TIOCGWINSZ = 0x5413 TIOCINQ = 0x541b TIOCLINUX = 0x541c TIOCMBIC = 0x5417 TIOCMBIS = 0x5416 TIOCMGET = 0x5415 TIOCMIWAIT = 0x545c TIOCMSET = 0x5418 TIOCM_CAR = 0x40 TIOCM_CD = 0x40 TIOCM_CTS = 0x20 TIOCM_DSR = 0x100 TIOCM_RI = 0x80 TIOCM_RNG = 0x80 TIOCM_SR = 0x10 TIOCM_ST = 0x8 TIOCNOTTY = 0x5422 TIOCNXCL = 0x540d TIOCOUTQ = 0x5411 TIOCPKT = 0x5420 TIOCSBRK = 0x5427 TIOCSCTTY = 0x540e TIOCSERCONFIG = 0x5453 TIOCSERGETLSR = 0x5459 TIOCSERGETMULTI = 0x545a TIOCSERGSTRUCT = 0x5458 TIOCSERGWILD = 0x5454 TIOCSERSETMULTI = 0x545b TIOCSERSWILD = 0x5455 TIOCSER_TEMT = 0x1 TIOCSETD = 0x5423 TIOCSIG = 0x40045436 TIOCSISO7816 = 0xc0285443 TIOCSLCKTRMIOS = 0x5457 TIOCSPGRP = 0x5410 TIOCSPTLCK = 0x40045431 TIOCSRS485 = 0x542f TIOCSSERIAL = 0x541f TIOCSSOFTCAR = 0x541a TIOCSTI = 0x5412 TIOCSWINSZ = 0x5414 TIOCVHANGUP = 0x5437 TOSTOP = 0x100 TUNATTACHFILTER = 0x400854d5 TUNDETACHFILTER = 0x400854d6 TUNGETDEVNETNS = 0x54e3 TUNGETFEATURES = 0x800454cf TUNGETFILTER = 0x800854db TUNGETIFF = 0x800454d2 TUNGETSNDBUF = 0x800454d3 TUNGETVNETBE = 0x800454df TUNGETVNETHDRSZ = 0x800454d7 TUNGETVNETLE = 0x800454dd TUNSETCARRIER = 0x400454e2 TUNSETDEBUG = 0x400454c9 TUNSETFILTEREBPF = 0x800454e1 TUNSETGROUP = 0x400454ce TUNSETIFF = 0x400454ca TUNSETIFINDEX = 0x400454da TUNSETLINK = 0x400454cd TUNSETNOCSUM = 0x400454c8 TUNSETOFFLOAD = 0x400454d0 TUNSETOWNER = 0x400454cc TUNSETPERSIST = 0x400454cb TUNSETQUEUE = 0x400454d9 TUNSETSNDBUF = 0x400454d4 TUNSETSTEERINGEBPF = 0x800454e0 TUNSETTXFILTER = 0x400454d1 TUNSETVNETBE = 0x400454de TUNSETVNETHDRSZ = 0x400454d8 TUNSETVNETLE = 0x400454dc UBI_IOCATT = 0x40186f40 UBI_IOCDET = 0x40046f41 UBI_IOCEBCH = 0x40044f02 UBI_IOCEBER = 0x40044f01 UBI_IOCEBISMAP = 0x80044f05 UBI_IOCEBMAP = 0x40084f03 UBI_IOCEBUNMAP = 0x40044f04 UBI_IOCMKVOL = 0x40986f00 UBI_IOCRMVOL = 0x40046f01 UBI_IOCRNVOL = 0x51106f03 UBI_IOCRPEB = 0x40046f04 UBI_IOCRSVOL = 0x400c6f02 UBI_IOCSETVOLPROP = 0x40104f06 UBI_IOCSPEB = 0x40046f05 UBI_IOCVOLCRBLK = 0x40804f07 UBI_IOCVOLRMBLK = 0x4f08 UBI_IOCVOLUP = 0x40084f00 VDISCARD = 0xd VEOF = 0x4 VEOL = 0xb VEOL2 = 0x10 VMIN = 0x6 VREPRINT = 0xc VSTART = 0x8 VSTOP = 0x9 VSUSP = 0xa VSWTC = 0x7 VT1 = 0x4000 VTDLY = 0x4000 VTIME = 0x5 VWERASE = 0xe WDIOC_GETBOOTSTATUS = 0x80045702 WDIOC_GETPRETIMEOUT = 0x80045709 WDIOC_GETSTATUS = 0x80045701 WDIOC_GETSUPPORT = 0x80285700 WDIOC_GETTEMP = 0x80045703 WDIOC_GETTIMELEFT = 0x8004570a WDIOC_GETTIMEOUT = 0x80045707 WDIOC_KEEPALIVE = 0x80045705 WDIOC_SETOPTIONS = 0x80045704 WORDSIZE = 0x20 X86_FXSR_MAGIC = 0x0 XCASE = 0x4 XTABS = 0x1800 _HIDIOCGRAWNAME = 0x80804804 _HIDIOCGRAWPHYS = 0x80404805 _HIDIOCGRAWUNIQ = 0x80404808 ) // Errors const ( EADDRINUSE = syscall.Errno(0x62) EADDRNOTAVAIL = syscall.Errno(0x63) EADV = syscall.Errno(0x44) EAFNOSUPPORT = syscall.Errno(0x61) EALREADY = syscall.Errno(0x72) EBADE = syscall.Errno(0x34) EBADFD = syscall.Errno(0x4d) EBADMSG = syscall.Errno(0x4a) EBADR = syscall.Errno(0x35) EBADRQC = syscall.Errno(0x38) EBADSLT = syscall.Errno(0x39) EBFONT = syscall.Errno(0x3b) ECANCELED = syscall.Errno(0x7d) ECHRNG = syscall.Errno(0x2c) ECOMM = syscall.Errno(0x46) ECONNABORTED = syscall.Errno(0x67) ECONNREFUSED = syscall.Errno(0x6f) ECONNRESET = syscall.Errno(0x68) EDEADLK = syscall.Errno(0x23) EDEADLOCK = syscall.Errno(0x23) EDESTADDRREQ = syscall.Errno(0x59) EDOTDOT = syscall.Errno(0x49) EDQUOT = syscall.Errno(0x7a) EHOSTDOWN = syscall.Errno(0x70) EHOSTUNREACH = syscall.Errno(0x71) EHWPOISON = syscall.Errno(0x85) EIDRM = syscall.Errno(0x2b) EILSEQ = syscall.Errno(0x54) EINPROGRESS = syscall.Errno(0x73) EISCONN = syscall.Errno(0x6a) EISNAM = syscall.Errno(0x78) EKEYEXPIRED = syscall.Errno(0x7f) EKEYREJECTED = syscall.Errno(0x81) EKEYREVOKED = syscall.Errno(0x80) EL2HLT = syscall.Errno(0x33) EL2NSYNC = syscall.Errno(0x2d) EL3HLT = syscall.Errno(0x2e) EL3RST = syscall.Errno(0x2f) ELIBACC = syscall.Errno(0x4f) ELIBBAD = syscall.Errno(0x50) ELIBEXEC = syscall.Errno(0x53) ELIBMAX = syscall.Errno(0x52) ELIBSCN = syscall.Errno(0x51) ELNRNG = syscall.Errno(0x30) ELOOP = syscall.Errno(0x28) EMEDIUMTYPE = syscall.Errno(0x7c) EMSGSIZE = syscall.Errno(0x5a) EMULTIHOP = syscall.Errno(0x48) ENAMETOOLONG = syscall.Errno(0x24) ENAVAIL = syscall.Errno(0x77) ENETDOWN = syscall.Errno(0x64) ENETRESET = syscall.Errno(0x66) ENETUNREACH = syscall.Errno(0x65) ENOANO = syscall.Errno(0x37) ENOBUFS = syscall.Errno(0x69) ENOCSI = syscall.Errno(0x32) ENODATA = syscall.Errno(0x3d) ENOKEY = syscall.Errno(0x7e) ENOLCK = syscall.Errno(0x25) ENOLINK = syscall.Errno(0x43) ENOMEDIUM = syscall.Errno(0x7b) ENOMSG = syscall.Errno(0x2a) ENONET = syscall.Errno(0x40) ENOPKG = syscall.Errno(0x41) ENOPROTOOPT = syscall.Errno(0x5c) ENOSR = syscall.Errno(0x3f) ENOSTR = syscall.Errno(0x3c) ENOSYS = syscall.Errno(0x26) ENOTCONN = syscall.Errno(0x6b) ENOTEMPTY = syscall.Errno(0x27) ENOTNAM = syscall.Errno(0x76) ENOTRECOVERABLE = syscall.Errno(0x83) ENOTSOCK = syscall.Errno(0x58) ENOTSUP = syscall.Errno(0x5f) ENOTUNIQ = syscall.Errno(0x4c) EOPNOTSUPP = syscall.Errno(0x5f) EOVERFLOW = syscall.Errno(0x4b) EOWNERDEAD = syscall.Errno(0x82) EPFNOSUPPORT = syscall.Errno(0x60) EPROTO = syscall.Errno(0x47) EPROTONOSUPPORT = syscall.Errno(0x5d) EPROTOTYPE = syscall.Errno(0x5b) EREMCHG = syscall.Errno(0x4e) EREMOTE = syscall.Errno(0x42) EREMOTEIO = syscall.Errno(0x79) ERESTART = syscall.Errno(0x55) ERFKILL = syscall.Errno(0x84) ESHUTDOWN = syscall.Errno(0x6c) ESOCKTNOSUPPORT = syscall.Errno(0x5e) ESRMNT = syscall.Errno(0x45) ESTALE = syscall.Errno(0x74) ESTRPIPE = syscall.Errno(0x56) ETIME = syscall.Errno(0x3e) ETIMEDOUT = syscall.Errno(0x6e) ETOOMANYREFS = syscall.Errno(0x6d) EUCLEAN = syscall.Errno(0x75) EUNATCH = syscall.Errno(0x31) EUSERS = syscall.Errno(0x57) EXFULL = syscall.Errno(0x36) ) // Signals const ( SIGBUS = syscall.Signal(0x7) SIGCHLD = syscall.Signal(0x11) SIGCLD = syscall.Signal(0x11) SIGCONT = syscall.Signal(0x12) SIGIO = syscall.Signal(0x1d) SIGPOLL = syscall.Signal(0x1d) SIGPROF = syscall.Signal(0x1b) SIGPWR = syscall.Signal(0x1e) SIGSTKFLT = syscall.Signal(0x10) SIGSTOP = syscall.Signal(0x13) SIGSYS = syscall.Signal(0x1f) SIGTSTP = syscall.Signal(0x14) SIGTTIN = syscall.Signal(0x15) SIGTTOU = syscall.Signal(0x16) SIGURG = syscall.Signal(0x17) SIGUSR1 = syscall.Signal(0xa) SIGUSR2 = syscall.Signal(0xc) SIGVTALRM = syscall.Signal(0x1a) SIGWINCH = syscall.Signal(0x1c) SIGXCPU = syscall.Signal(0x18) SIGXFSZ = syscall.Signal(0x19) ) // Error table var errorList = [...]struct { num syscall.Errno name string desc string }{ {1, "EPERM", "operation not permitted"}, {2, "ENOENT", "no such file or directory"}, {3, "ESRCH", "no such process"}, {4, "EINTR", "interrupted system call"}, {5, "EIO", "input/output error"}, {6, "ENXIO", "no such device or address"}, {7, "E2BIG", "argument list too long"}, {8, "ENOEXEC", "exec format error"}, {9, "EBADF", "bad file descriptor"}, {10, "ECHILD", "no child processes"}, {11, "EAGAIN", "resource temporarily unavailable"}, {12, "ENOMEM", "cannot allocate memory"}, {13, "EACCES", "permission denied"}, {14, "EFAULT", "bad address"}, {15, "ENOTBLK", "block device required"}, {16, "EBUSY", "device or resource busy"}, {17, "EEXIST", "file exists"}, {18, "EXDEV", "invalid cross-device link"}, {19, "ENODEV", "no such device"}, {20, "ENOTDIR", "not a directory"}, {21, "EISDIR", "is a directory"}, {22, "EINVAL", "invalid argument"}, {23, "ENFILE", "too many open files in system"}, {24, "EMFILE", "too many open files"}, {25, "ENOTTY", "inappropriate ioctl for device"}, {26, "ETXTBSY", "text file busy"}, {27, "EFBIG", "file too large"}, {28, "ENOSPC", "no space left on device"}, {29, "ESPIPE", "illegal seek"}, {30, "EROFS", "read-only file system"}, {31, "EMLINK", "too many links"}, {32, "EPIPE", "broken pipe"}, {33, "EDOM", "numerical argument out of domain"}, {34, "ERANGE", "numerical result out of range"}, {35, "EDEADLK", "resource deadlock avoided"}, {36, "ENAMETOOLONG", "file name too long"}, {37, "ENOLCK", "no locks available"}, {38, "ENOSYS", "function not implemented"}, {39, "ENOTEMPTY", "directory not empty"}, {40, "ELOOP", "too many levels of symbolic links"}, {42, "ENOMSG", "no message of desired type"}, {43, "EIDRM", "identifier removed"}, {44, "ECHRNG", "channel number out of range"}, {45, "EL2NSYNC", "level 2 not synchronized"}, {46, "EL3HLT", "level 3 halted"}, {47, "EL3RST", "level 3 reset"}, {48, "ELNRNG", "link number out of range"}, {49, "EUNATCH", "protocol driver not attached"}, {50, "ENOCSI", "no CSI structure available"}, {51, "EL2HLT", "level 2 halted"}, {52, "EBADE", "invalid exchange"}, {53, "EBADR", "invalid request descriptor"}, {54, "EXFULL", "exchange full"}, {55, "ENOANO", "no anode"}, {56, "EBADRQC", "invalid request code"}, {57, "EBADSLT", "invalid slot"}, {59, "EBFONT", "bad font file format"}, {60, "ENOSTR", "device not a stream"}, {61, "ENODATA", "no data available"}, {62, "ETIME", "timer expired"}, {63, "ENOSR", "out of streams resources"}, {64, "ENONET", "machine is not on the network"}, {65, "ENOPKG", "package not installed"}, {66, "EREMOTE", "object is remote"}, {67, "ENOLINK", "link has been severed"}, {68, "EADV", "advertise error"}, {69, "ESRMNT", "srmount error"}, {70, "ECOMM", "communication error on send"}, {71, "EPROTO", "protocol error"}, {72, "EMULTIHOP", "multihop attempted"}, {73, "EDOTDOT", "RFS specific error"}, {74, "EBADMSG", "bad message"}, {75, "EOVERFLOW", "value too large for defined data type"}, {76, "ENOTUNIQ", "name not unique on network"}, {77, "EBADFD", "file descriptor in bad state"}, {78, "EREMCHG", "remote address changed"}, {79, "ELIBACC", "can not access a needed shared library"}, {80, "ELIBBAD", "accessing a corrupted shared library"}, {81, "ELIBSCN", ".lib section in a.out corrupted"}, {82, "ELIBMAX", "attempting to link in too many shared libraries"}, {83, "ELIBEXEC", "cannot exec a shared library directly"}, {84, "EILSEQ", "invalid or incomplete multibyte or wide character"}, {85, "ERESTART", "interrupted system call should be restarted"}, {86, "ESTRPIPE", "streams pipe error"}, {87, "EUSERS", "too many users"}, {88, "ENOTSOCK", "socket operation on non-socket"}, {89, "EDESTADDRREQ", "destination address required"}, {90, "EMSGSIZE", "message too long"}, {91, "EPROTOTYPE", "protocol wrong type for socket"}, {92, "ENOPROTOOPT", "protocol not available"}, {93, "EPROTONOSUPPORT", "protocol not supported"}, {94, "ESOCKTNOSUPPORT", "socket type not supported"}, {95, "ENOTSUP", "operation not supported"}, {96, "EPFNOSUPPORT", "protocol family not supported"}, {97, "EAFNOSUPPORT", "address family not supported by protocol"}, {98, "EADDRINUSE", "address already in use"}, {99, "EADDRNOTAVAIL", "cannot assign requested address"}, {100, "ENETDOWN", "network is down"}, {101, "ENETUNREACH", "network is unreachable"}, {102, "ENETRESET", "network dropped connection on reset"}, {103, "ECONNABORTED", "software caused connection abort"}, {104, "ECONNRESET", "connection reset by peer"}, {105, "ENOBUFS", "no buffer space available"}, {106, "EISCONN", "transport endpoint is already connected"}, {107, "ENOTCONN", "transport endpoint is not connected"}, {108, "ESHUTDOWN", "cannot send after transport endpoint shutdown"}, {109, "ETOOMANYREFS", "too many references: cannot splice"}, {110, "ETIMEDOUT", "connection timed out"}, {111, "ECONNREFUSED", "connection refused"}, {112, "EHOSTDOWN", "host is down"}, {113, "EHOSTUNREACH", "no route to host"}, {114, "EALREADY", "operation already in progress"}, {115, "EINPROGRESS", "operation now in progress"}, {116, "ESTALE", "stale file handle"}, {117, "EUCLEAN", "structure needs cleaning"}, {118, "ENOTNAM", "not a XENIX named type file"}, {119, "ENAVAIL", "no XENIX semaphores available"}, {120, "EISNAM", "is a named type file"}, {121, "EREMOTEIO", "remote I/O error"}, {122, "EDQUOT", "disk quota exceeded"}, {123, "ENOMEDIUM", "no medium found"}, {124, "EMEDIUMTYPE", "wrong medium type"}, {125, "ECANCELED", "operation canceled"}, {126, "ENOKEY", "required key not available"}, {127, "EKEYEXPIRED", "key has expired"}, {128, "EKEYREVOKED", "key has been revoked"}, {129, "EKEYREJECTED", "key was rejected by service"}, {130, "EOWNERDEAD", "owner died"}, {131, "ENOTRECOVERABLE", "state not recoverable"}, {132, "ERFKILL", "operation not possible due to RF-kill"}, {133, "EHWPOISON", "memory page has hardware error"}, } // Signal table var signalList = [...]struct { num syscall.Signal name string desc string }{ {1, "SIGHUP", "hangup"}, {2, "SIGINT", "interrupt"}, {3, "SIGQUIT", "quit"}, {4, "SIGILL", "illegal instruction"}, {5, "SIGTRAP", "trace/breakpoint trap"}, {6, "SIGABRT", "aborted"}, {7, "SIGBUS", "bus error"}, {8, "SIGFPE", "floating point exception"}, {9, "SIGKILL", "killed"}, {10, "SIGUSR1", "user defined signal 1"}, {11, "SIGSEGV", "segmentation fault"}, {12, "SIGUSR2", "user defined signal 2"}, {13, "SIGPIPE", "broken pipe"}, {14, "SIGALRM", "alarm clock"}, {15, "SIGTERM", "terminated"}, {16, "SIGSTKFLT", "stack fault"}, {17, "SIGCHLD", "child exited"}, {18, "SIGCONT", "continued"}, {19, "SIGSTOP", "stopped (signal)"}, {20, "SIGTSTP", "stopped"}, {21, "SIGTTIN", "stopped (tty input)"}, {22, "SIGTTOU", "stopped (tty output)"}, {23, "SIGURG", "urgent I/O condition"}, {24, "SIGXCPU", "CPU time limit exceeded"}, {25, "SIGXFSZ", "file size limit exceeded"}, {26, "SIGVTALRM", "virtual timer expired"}, {27, "SIGPROF", "profiling timer expired"}, {28, "SIGWINCH", "window changed"}, {29, "SIGIO", "I/O possible"}, {30, "SIGPWR", "power failure"}, {31, "SIGSYS", "bad system call"}, } ================================================ FILE: vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go ================================================ // mkerrors.sh -Wall -Werror -static -I/tmp/amd64/include -m64 // Code generated by the command above; see README.md. DO NOT EDIT. //go:build amd64 && linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -Wall -Werror -static -I/tmp/amd64/include -m64 _const.go package unix import "syscall" const ( B1000000 = 0x1008 B115200 = 0x1002 B1152000 = 0x1009 B1500000 = 0x100a B2000000 = 0x100b B230400 = 0x1003 B2500000 = 0x100c B3000000 = 0x100d B3500000 = 0x100e B4000000 = 0x100f B460800 = 0x1004 B500000 = 0x1005 B57600 = 0x1001 B576000 = 0x1006 B921600 = 0x1007 BLKALIGNOFF = 0x127a BLKBSZGET = 0x80081270 BLKBSZSET = 0x40081271 BLKDISCARD = 0x1277 BLKDISCARDZEROES = 0x127c BLKFLSBUF = 0x1261 BLKFRAGET = 0x1265 BLKFRASET = 0x1264 BLKGETDISKSEQ = 0x80081280 BLKGETSIZE = 0x1260 BLKGETSIZE64 = 0x80081272 BLKIOMIN = 0x1278 BLKIOOPT = 0x1279 BLKPBSZGET = 0x127b BLKRAGET = 0x1263 BLKRASET = 0x1262 BLKROGET = 0x125e BLKROSET = 0x125d BLKROTATIONAL = 0x127e BLKRRPART = 0x125f BLKSECDISCARD = 0x127d BLKSECTGET = 0x1267 BLKSECTSET = 0x1266 BLKSSZGET = 0x1268 BLKZEROOUT = 0x127f BOTHER = 0x1000 BS1 = 0x2000 BSDLY = 0x2000 CBAUD = 0x100f CBAUDEX = 0x1000 CIBAUD = 0x100f0000 CLOCAL = 0x800 CR1 = 0x200 CR2 = 0x400 CR3 = 0x600 CRDLY = 0x600 CREAD = 0x80 CS6 = 0x10 CS7 = 0x20 CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 DM_MPATH_PROBE_PATHS = 0xfd12 ECCGETLAYOUT = 0x81484d11 ECCGETSTATS = 0x80104d12 ECHOCTL = 0x200 ECHOE = 0x10 ECHOK = 0x20 ECHOKE = 0x800 ECHONL = 0x40 ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 EPIOCGPARAMS = 0x80088a02 EPIOCSPARAMS = 0x40088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 FFDLY = 0x8000 FICLONE = 0x40049409 FICLONERANGE = 0x4020940d FLUSHO = 0x1000 FP_XSTATE_MAGIC2 = 0x46505845 FS_IOC_ENABLE_VERITY = 0x40806685 FS_IOC_GETFLAGS = 0x80086601 FS_IOC_GET_ENCRYPTION_NONCE = 0x8010661b FS_IOC_GET_ENCRYPTION_POLICY = 0x400c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x40106614 FS_IOC_SETFLAGS = 0x40086602 FS_IOC_SET_ENCRYPTION_POLICY = 0x800c6613 F_GETLK = 0x5 F_GETLK64 = 0x5 F_GETOWN = 0x9 F_RDLCK = 0x0 F_SETLK = 0x6 F_SETLK64 = 0x6 F_SETLKW = 0x7 F_SETLKW64 = 0x7 F_SETOWN = 0x8 F_UNLCK = 0x2 F_WRLCK = 0x1 HIDIOCGRAWINFO = 0x80084803 HIDIOCGRDESC = 0x90044802 HIDIOCGRDESCSIZE = 0x80044801 HIDIOCREVOKE = 0x4004480d HUPCL = 0x400 ICANON = 0x2 IEXTEN = 0x8000 IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x800 IOCTL_MEI_NOTIFY_GET = 0x80044803 IOCTL_MEI_NOTIFY_SET = 0x40044802 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x7b9 IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_MASK = 0xffff0f00 ISIG = 0x1 IUCLC = 0x200 IXOFF = 0x1000 IXON = 0x400 MAP_32BIT = 0x40 MAP_ABOVE4G = 0x80 MAP_ANON = 0x20 MAP_ANONYMOUS = 0x20 MAP_DENYWRITE = 0x800 MAP_EXECUTABLE = 0x1000 MAP_GROWSDOWN = 0x100 MAP_HUGETLB = 0x40000 MAP_LOCKED = 0x2000 MAP_NONBLOCK = 0x10000 MAP_NORESERVE = 0x4000 MAP_POPULATE = 0x8000 MAP_STACK = 0x20000 MAP_SYNC = 0x80000 MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MCL_ONFAULT = 0x4 MEMERASE = 0x40084d02 MEMERASE64 = 0x40104d14 MEMGETBADBLOCK = 0x40084d0b MEMGETINFO = 0x80204d01 MEMGETOOBSEL = 0x80c84d0a MEMGETREGIONCOUNT = 0x80044d07 MEMISLOCKED = 0x80084d17 MEMLOCK = 0x40084d05 MEMREAD = 0xc0404d1a MEMREADOOB = 0xc0104d04 MEMSETBADBLOCK = 0x40084d0c MEMUNLOCK = 0x40084d06 MEMWRITEOOB = 0xc0104d03 MTDFILEMODE = 0x4d13 NFDBITS = 0x40 NLDLY = 0x100 NOFLSH = 0x80 NS_GET_MNTNS_ID = 0x8008b705 NS_GET_NSTYPE = 0xb703 NS_GET_OWNER_UID = 0xb704 NS_GET_PARENT = 0xb702 NS_GET_PID_FROM_PIDNS = 0x8004b706 NS_GET_PID_IN_PIDNS = 0x8004b708 NS_GET_TGID_FROM_PIDNS = 0x8004b707 NS_GET_TGID_IN_PIDNS = 0x8004b709 NS_GET_USERNS = 0xb701 OLCUC = 0x2 ONLCR = 0x4 OTPERASE = 0x400c4d19 OTPGETREGIONCOUNT = 0x40044d0e OTPGETREGIONINFO = 0x400c4d0f OTPLOCK = 0x800c4d10 OTPSELECT = 0x80044d0d O_APPEND = 0x400 O_ASYNC = 0x2000 O_CLOEXEC = 0x80000 O_CREAT = 0x40 O_DIRECT = 0x4000 O_DIRECTORY = 0x10000 O_DSYNC = 0x1000 O_EXCL = 0x80 O_FSYNC = 0x101000 O_LARGEFILE = 0x0 O_NDELAY = 0x800 O_NOATIME = 0x40000 O_NOCTTY = 0x100 O_NOFOLLOW = 0x20000 O_NONBLOCK = 0x800 O_PATH = 0x200000 O_RSYNC = 0x101000 O_SYNC = 0x101000 O_TMPFILE = 0x410000 O_TRUNC = 0x200 PARENB = 0x100 PARODD = 0x200 PENDIN = 0x4000 PERF_EVENT_IOC_DISABLE = 0x2401 PERF_EVENT_IOC_ENABLE = 0x2400 PERF_EVENT_IOC_ID = 0x80082407 PERF_EVENT_IOC_MODIFY_ATTRIBUTES = 0x4008240b PERF_EVENT_IOC_PAUSE_OUTPUT = 0x40042409 PERF_EVENT_IOC_PERIOD = 0x40082404 PERF_EVENT_IOC_QUERY_BPF = 0xc008240a PERF_EVENT_IOC_REFRESH = 0x2402 PERF_EVENT_IOC_RESET = 0x2403 PERF_EVENT_IOC_SET_BPF = 0x40042408 PERF_EVENT_IOC_SET_FILTER = 0x40082406 PERF_EVENT_IOC_SET_OUTPUT = 0x2405 PPPIOCATTACH = 0x4004743d PPPIOCATTCHAN = 0x40047438 PPPIOCBRIDGECHAN = 0x40047435 PPPIOCCONNECT = 0x4004743a PPPIOCDETACH = 0x4004743c PPPIOCDISCONN = 0x7439 PPPIOCGASYNCMAP = 0x80047458 PPPIOCGCHAN = 0x80047437 PPPIOCGDEBUG = 0x80047441 PPPIOCGFLAGS = 0x8004745a PPPIOCGIDLE = 0x8010743f PPPIOCGIDLE32 = 0x8008743f PPPIOCGIDLE64 = 0x8010743f PPPIOCGL2TPSTATS = 0x80487436 PPPIOCGMRU = 0x80047453 PPPIOCGRASYNCMAP = 0x80047455 PPPIOCGUNIT = 0x80047456 PPPIOCGXASYNCMAP = 0x80207450 PPPIOCSACTIVE = 0x40107446 PPPIOCSASYNCMAP = 0x40047457 PPPIOCSCOMPRESS = 0x4010744d PPPIOCSDEBUG = 0x40047440 PPPIOCSFLAGS = 0x40047459 PPPIOCSMAXCID = 0x40047451 PPPIOCSMRRU = 0x4004743b PPPIOCSMRU = 0x40047452 PPPIOCSNPMODE = 0x4008744b PPPIOCSPASS = 0x40107447 PPPIOCSRASYNCMAP = 0x40047454 PPPIOCSXASYNCMAP = 0x4020744f PPPIOCUNBRIDGECHAN = 0x7434 PPPIOCXFERUNIT = 0x744e PR_SET_PTRACER_ANY = 0xffffffffffffffff PTP_CLOCK_GETCAPS = 0x80503d01 PTP_CLOCK_GETCAPS2 = 0x80503d0a PTP_ENABLE_PPS = 0x40043d04 PTP_ENABLE_PPS2 = 0x40043d0d PTP_EXTTS_REQUEST = 0x40103d02 PTP_EXTTS_REQUEST2 = 0x40103d0b PTP_MASK_CLEAR_ALL = 0x3d13 PTP_MASK_EN_SINGLE = 0x40043d14 PTP_PEROUT_REQUEST = 0x40383d03 PTP_PEROUT_REQUEST2 = 0x40383d0c PTP_PIN_SETFUNC = 0x40603d07 PTP_PIN_SETFUNC2 = 0x40603d10 PTP_SYS_OFFSET = 0x43403d05 PTP_SYS_OFFSET2 = 0x43403d0e PTRACE_ARCH_PRCTL = 0x1e PTRACE_GETFPREGS = 0xe PTRACE_GETFPXREGS = 0x12 PTRACE_GET_THREAD_AREA = 0x19 PTRACE_OLDSETOPTIONS = 0x15 PTRACE_SETFPREGS = 0xf PTRACE_SETFPXREGS = 0x13 PTRACE_SET_THREAD_AREA = 0x1a PTRACE_SINGLEBLOCK = 0x21 PTRACE_SYSEMU = 0x1f PTRACE_SYSEMU_SINGLESTEP = 0x20 RLIMIT_AS = 0x9 RLIMIT_MEMLOCK = 0x8 RLIMIT_NOFILE = 0x7 RLIMIT_NPROC = 0x6 RLIMIT_RSS = 0x5 RNDADDENTROPY = 0x40085203 RNDADDTOENTCNT = 0x40045201 RNDCLEARPOOL = 0x5206 RNDGETENTCNT = 0x80045200 RNDGETPOOL = 0x80085202 RNDRESEEDCRNG = 0x5207 RNDZAPENTCNT = 0x5204 RTC_AIE_OFF = 0x7002 RTC_AIE_ON = 0x7001 RTC_ALM_READ = 0x80247008 RTC_ALM_SET = 0x40247007 RTC_EPOCH_READ = 0x8008700d RTC_EPOCH_SET = 0x4008700e RTC_IRQP_READ = 0x8008700b RTC_IRQP_SET = 0x4008700c RTC_PARAM_GET = 0x40187013 RTC_PARAM_SET = 0x40187014 RTC_PIE_OFF = 0x7006 RTC_PIE_ON = 0x7005 RTC_PLL_GET = 0x80207011 RTC_PLL_SET = 0x40207012 RTC_RD_TIME = 0x80247009 RTC_SET_TIME = 0x4024700a RTC_UIE_OFF = 0x7004 RTC_UIE_ON = 0x7003 RTC_VL_CLR = 0x7014 RTC_VL_READ = 0x80047013 RTC_WIE_OFF = 0x7010 RTC_WIE_ON = 0x700f RTC_WKALM_RD = 0x80287010 RTC_WKALM_SET = 0x4028700f SCM_DEVMEM_DMABUF = 0x4f SCM_DEVMEM_LINEAR = 0x4e SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a SCM_TIMESTAMPNS = 0x23 SCM_TS_OPT_ID = 0x51 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 SECCOMP_IOCTL_NOTIF_ADDFD = 0x40182103 SECCOMP_IOCTL_NOTIF_ID_VALID = 0x40082102 SECCOMP_IOCTL_NOTIF_SET_FLAGS = 0x40082104 SFD_CLOEXEC = 0x80000 SFD_NONBLOCK = 0x800 SIOCATMARK = 0x8905 SIOCGPGRP = 0x8904 SIOCGSTAMPNS_NEW = 0x80108907 SIOCGSTAMP_NEW = 0x80108906 SIOCINQ = 0x541b SIOCOUTQ = 0x5411 SIOCSPGRP = 0x8902 SOCK_CLOEXEC = 0x80000 SOCK_DGRAM = 0x2 SOCK_NONBLOCK = 0x800 SOCK_STREAM = 0x1 SOL_SOCKET = 0x1 SO_ACCEPTCONN = 0x1e SO_ATTACH_BPF = 0x32 SO_ATTACH_REUSEPORT_CBPF = 0x33 SO_ATTACH_REUSEPORT_EBPF = 0x34 SO_BINDTODEVICE = 0x19 SO_BINDTOIFINDEX = 0x3e SO_BPF_EXTENSIONS = 0x30 SO_BROADCAST = 0x6 SO_BSDCOMPAT = 0xe SO_BUF_LOCK = 0x48 SO_BUSY_POLL = 0x2e SO_BUSY_POLL_BUDGET = 0x46 SO_CNX_ADVICE = 0x35 SO_COOKIE = 0x39 SO_DETACH_REUSEPORT_BPF = 0x44 SO_DEVMEM_DMABUF = 0x4f SO_DEVMEM_DONTNEED = 0x50 SO_DEVMEM_LINEAR = 0x4e SO_DOMAIN = 0x27 SO_DONTROUTE = 0x5 SO_ERROR = 0x4 SO_INCOMING_CPU = 0x31 SO_INCOMING_NAPI_ID = 0x38 SO_KEEPALIVE = 0x9 SO_LINGER = 0xd SO_LOCK_FILTER = 0x2c SO_MARK = 0x24 SO_MAX_PACING_RATE = 0x2f SO_MEMINFO = 0x37 SO_NETNS_COOKIE = 0x47 SO_NOFCS = 0x2b SO_OOBINLINE = 0xa SO_PASSCRED = 0x10 SO_PASSPIDFD = 0x4c SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x11 SO_PEERGROUPS = 0x3b SO_PEERPIDFD = 0x4d SO_PEERSEC = 0x1f SO_PREFER_BUSY_POLL = 0x45 SO_PROTOCOL = 0x26 SO_RCVBUF = 0x8 SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x12 SO_RCVMARK = 0x4b SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x14 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x14 SO_RESERVE_MEM = 0x49 SO_REUSEADDR = 0x2 SO_REUSEPORT = 0xf SO_RXQ_OVFL = 0x28 SO_SECURITY_AUTHENTICATION = 0x16 SO_SECURITY_ENCRYPTION_NETWORK = 0x18 SO_SECURITY_ENCRYPTION_TRANSPORT = 0x17 SO_SELECT_ERR_QUEUE = 0x2d SO_SNDBUF = 0x7 SO_SNDBUFFORCE = 0x20 SO_SNDLOWAT = 0x13 SO_SNDTIMEO = 0x15 SO_SNDTIMEO_NEW = 0x43 SO_SNDTIMEO_OLD = 0x15 SO_TIMESTAMPING = 0x25 SO_TIMESTAMPING_NEW = 0x41 SO_TIMESTAMPING_OLD = 0x25 SO_TIMESTAMPNS = 0x23 SO_TIMESTAMPNS_NEW = 0x40 SO_TIMESTAMPNS_OLD = 0x23 SO_TIMESTAMP_NEW = 0x3f SO_TXREHASH = 0x4a SO_TXTIME = 0x3d SO_TYPE = 0x3 SO_WIFI_STATUS = 0x29 SO_ZEROCOPY = 0x3c TAB1 = 0x800 TAB2 = 0x1000 TAB3 = 0x1800 TABDLY = 0x1800 TCFLSH = 0x540b TCGETA = 0x5405 TCGETS = 0x5401 TCGETS2 = 0x802c542a TCGETX = 0x5432 TCSAFLUSH = 0x2 TCSBRK = 0x5409 TCSBRKP = 0x5425 TCSETA = 0x5406 TCSETAF = 0x5408 TCSETAW = 0x5407 TCSETS = 0x5402 TCSETS2 = 0x402c542b TCSETSF = 0x5404 TCSETSF2 = 0x402c542d TCSETSW = 0x5403 TCSETSW2 = 0x402c542c TCSETX = 0x5433 TCSETXF = 0x5434 TCSETXW = 0x5435 TCXONC = 0x540a TFD_CLOEXEC = 0x80000 TFD_NONBLOCK = 0x800 TIOCCBRK = 0x5428 TIOCCONS = 0x541d TIOCEXCL = 0x540c TIOCGDEV = 0x80045432 TIOCGETD = 0x5424 TIOCGEXCL = 0x80045440 TIOCGICOUNT = 0x545d TIOCGISO7816 = 0x80285442 TIOCGLCKTRMIOS = 0x5456 TIOCGPGRP = 0x540f TIOCGPKT = 0x80045438 TIOCGPTLCK = 0x80045439 TIOCGPTN = 0x80045430 TIOCGPTPEER = 0x5441 TIOCGRS485 = 0x542e TIOCGSERIAL = 0x541e TIOCGSID = 0x5429 TIOCGSOFTCAR = 0x5419 TIOCGWINSZ = 0x5413 TIOCINQ = 0x541b TIOCLINUX = 0x541c TIOCMBIC = 0x5417 TIOCMBIS = 0x5416 TIOCMGET = 0x5415 TIOCMIWAIT = 0x545c TIOCMSET = 0x5418 TIOCM_CAR = 0x40 TIOCM_CD = 0x40 TIOCM_CTS = 0x20 TIOCM_DSR = 0x100 TIOCM_RI = 0x80 TIOCM_RNG = 0x80 TIOCM_SR = 0x10 TIOCM_ST = 0x8 TIOCNOTTY = 0x5422 TIOCNXCL = 0x540d TIOCOUTQ = 0x5411 TIOCPKT = 0x5420 TIOCSBRK = 0x5427 TIOCSCTTY = 0x540e TIOCSERCONFIG = 0x5453 TIOCSERGETLSR = 0x5459 TIOCSERGETMULTI = 0x545a TIOCSERGSTRUCT = 0x5458 TIOCSERGWILD = 0x5454 TIOCSERSETMULTI = 0x545b TIOCSERSWILD = 0x5455 TIOCSER_TEMT = 0x1 TIOCSETD = 0x5423 TIOCSIG = 0x40045436 TIOCSISO7816 = 0xc0285443 TIOCSLCKTRMIOS = 0x5457 TIOCSPGRP = 0x5410 TIOCSPTLCK = 0x40045431 TIOCSRS485 = 0x542f TIOCSSERIAL = 0x541f TIOCSSOFTCAR = 0x541a TIOCSTI = 0x5412 TIOCSWINSZ = 0x5414 TIOCVHANGUP = 0x5437 TOSTOP = 0x100 TUNATTACHFILTER = 0x401054d5 TUNDETACHFILTER = 0x401054d6 TUNGETDEVNETNS = 0x54e3 TUNGETFEATURES = 0x800454cf TUNGETFILTER = 0x801054db TUNGETIFF = 0x800454d2 TUNGETSNDBUF = 0x800454d3 TUNGETVNETBE = 0x800454df TUNGETVNETHDRSZ = 0x800454d7 TUNGETVNETLE = 0x800454dd TUNSETCARRIER = 0x400454e2 TUNSETDEBUG = 0x400454c9 TUNSETFILTEREBPF = 0x800454e1 TUNSETGROUP = 0x400454ce TUNSETIFF = 0x400454ca TUNSETIFINDEX = 0x400454da TUNSETLINK = 0x400454cd TUNSETNOCSUM = 0x400454c8 TUNSETOFFLOAD = 0x400454d0 TUNSETOWNER = 0x400454cc TUNSETPERSIST = 0x400454cb TUNSETQUEUE = 0x400454d9 TUNSETSNDBUF = 0x400454d4 TUNSETSTEERINGEBPF = 0x800454e0 TUNSETTXFILTER = 0x400454d1 TUNSETVNETBE = 0x400454de TUNSETVNETHDRSZ = 0x400454d8 TUNSETVNETLE = 0x400454dc UBI_IOCATT = 0x40186f40 UBI_IOCDET = 0x40046f41 UBI_IOCEBCH = 0x40044f02 UBI_IOCEBER = 0x40044f01 UBI_IOCEBISMAP = 0x80044f05 UBI_IOCEBMAP = 0x40084f03 UBI_IOCEBUNMAP = 0x40044f04 UBI_IOCMKVOL = 0x40986f00 UBI_IOCRMVOL = 0x40046f01 UBI_IOCRNVOL = 0x51106f03 UBI_IOCRPEB = 0x40046f04 UBI_IOCRSVOL = 0x400c6f02 UBI_IOCSETVOLPROP = 0x40104f06 UBI_IOCSPEB = 0x40046f05 UBI_IOCVOLCRBLK = 0x40804f07 UBI_IOCVOLRMBLK = 0x4f08 UBI_IOCVOLUP = 0x40084f00 VDISCARD = 0xd VEOF = 0x4 VEOL = 0xb VEOL2 = 0x10 VMIN = 0x6 VREPRINT = 0xc VSTART = 0x8 VSTOP = 0x9 VSUSP = 0xa VSWTC = 0x7 VT1 = 0x4000 VTDLY = 0x4000 VTIME = 0x5 VWERASE = 0xe WDIOC_GETBOOTSTATUS = 0x80045702 WDIOC_GETPRETIMEOUT = 0x80045709 WDIOC_GETSTATUS = 0x80045701 WDIOC_GETSUPPORT = 0x80285700 WDIOC_GETTEMP = 0x80045703 WDIOC_GETTIMELEFT = 0x8004570a WDIOC_GETTIMEOUT = 0x80045707 WDIOC_KEEPALIVE = 0x80045705 WDIOC_SETOPTIONS = 0x80045704 WORDSIZE = 0x40 XCASE = 0x4 XTABS = 0x1800 _HIDIOCGRAWNAME = 0x80804804 _HIDIOCGRAWPHYS = 0x80404805 _HIDIOCGRAWUNIQ = 0x80404808 ) // Errors const ( EADDRINUSE = syscall.Errno(0x62) EADDRNOTAVAIL = syscall.Errno(0x63) EADV = syscall.Errno(0x44) EAFNOSUPPORT = syscall.Errno(0x61) EALREADY = syscall.Errno(0x72) EBADE = syscall.Errno(0x34) EBADFD = syscall.Errno(0x4d) EBADMSG = syscall.Errno(0x4a) EBADR = syscall.Errno(0x35) EBADRQC = syscall.Errno(0x38) EBADSLT = syscall.Errno(0x39) EBFONT = syscall.Errno(0x3b) ECANCELED = syscall.Errno(0x7d) ECHRNG = syscall.Errno(0x2c) ECOMM = syscall.Errno(0x46) ECONNABORTED = syscall.Errno(0x67) ECONNREFUSED = syscall.Errno(0x6f) ECONNRESET = syscall.Errno(0x68) EDEADLK = syscall.Errno(0x23) EDEADLOCK = syscall.Errno(0x23) EDESTADDRREQ = syscall.Errno(0x59) EDOTDOT = syscall.Errno(0x49) EDQUOT = syscall.Errno(0x7a) EHOSTDOWN = syscall.Errno(0x70) EHOSTUNREACH = syscall.Errno(0x71) EHWPOISON = syscall.Errno(0x85) EIDRM = syscall.Errno(0x2b) EILSEQ = syscall.Errno(0x54) EINPROGRESS = syscall.Errno(0x73) EISCONN = syscall.Errno(0x6a) EISNAM = syscall.Errno(0x78) EKEYEXPIRED = syscall.Errno(0x7f) EKEYREJECTED = syscall.Errno(0x81) EKEYREVOKED = syscall.Errno(0x80) EL2HLT = syscall.Errno(0x33) EL2NSYNC = syscall.Errno(0x2d) EL3HLT = syscall.Errno(0x2e) EL3RST = syscall.Errno(0x2f) ELIBACC = syscall.Errno(0x4f) ELIBBAD = syscall.Errno(0x50) ELIBEXEC = syscall.Errno(0x53) ELIBMAX = syscall.Errno(0x52) ELIBSCN = syscall.Errno(0x51) ELNRNG = syscall.Errno(0x30) ELOOP = syscall.Errno(0x28) EMEDIUMTYPE = syscall.Errno(0x7c) EMSGSIZE = syscall.Errno(0x5a) EMULTIHOP = syscall.Errno(0x48) ENAMETOOLONG = syscall.Errno(0x24) ENAVAIL = syscall.Errno(0x77) ENETDOWN = syscall.Errno(0x64) ENETRESET = syscall.Errno(0x66) ENETUNREACH = syscall.Errno(0x65) ENOANO = syscall.Errno(0x37) ENOBUFS = syscall.Errno(0x69) ENOCSI = syscall.Errno(0x32) ENODATA = syscall.Errno(0x3d) ENOKEY = syscall.Errno(0x7e) ENOLCK = syscall.Errno(0x25) ENOLINK = syscall.Errno(0x43) ENOMEDIUM = syscall.Errno(0x7b) ENOMSG = syscall.Errno(0x2a) ENONET = syscall.Errno(0x40) ENOPKG = syscall.Errno(0x41) ENOPROTOOPT = syscall.Errno(0x5c) ENOSR = syscall.Errno(0x3f) ENOSTR = syscall.Errno(0x3c) ENOSYS = syscall.Errno(0x26) ENOTCONN = syscall.Errno(0x6b) ENOTEMPTY = syscall.Errno(0x27) ENOTNAM = syscall.Errno(0x76) ENOTRECOVERABLE = syscall.Errno(0x83) ENOTSOCK = syscall.Errno(0x58) ENOTSUP = syscall.Errno(0x5f) ENOTUNIQ = syscall.Errno(0x4c) EOPNOTSUPP = syscall.Errno(0x5f) EOVERFLOW = syscall.Errno(0x4b) EOWNERDEAD = syscall.Errno(0x82) EPFNOSUPPORT = syscall.Errno(0x60) EPROTO = syscall.Errno(0x47) EPROTONOSUPPORT = syscall.Errno(0x5d) EPROTOTYPE = syscall.Errno(0x5b) EREMCHG = syscall.Errno(0x4e) EREMOTE = syscall.Errno(0x42) EREMOTEIO = syscall.Errno(0x79) ERESTART = syscall.Errno(0x55) ERFKILL = syscall.Errno(0x84) ESHUTDOWN = syscall.Errno(0x6c) ESOCKTNOSUPPORT = syscall.Errno(0x5e) ESRMNT = syscall.Errno(0x45) ESTALE = syscall.Errno(0x74) ESTRPIPE = syscall.Errno(0x56) ETIME = syscall.Errno(0x3e) ETIMEDOUT = syscall.Errno(0x6e) ETOOMANYREFS = syscall.Errno(0x6d) EUCLEAN = syscall.Errno(0x75) EUNATCH = syscall.Errno(0x31) EUSERS = syscall.Errno(0x57) EXFULL = syscall.Errno(0x36) ) // Signals const ( SIGBUS = syscall.Signal(0x7) SIGCHLD = syscall.Signal(0x11) SIGCLD = syscall.Signal(0x11) SIGCONT = syscall.Signal(0x12) SIGIO = syscall.Signal(0x1d) SIGPOLL = syscall.Signal(0x1d) SIGPROF = syscall.Signal(0x1b) SIGPWR = syscall.Signal(0x1e) SIGSTKFLT = syscall.Signal(0x10) SIGSTOP = syscall.Signal(0x13) SIGSYS = syscall.Signal(0x1f) SIGTSTP = syscall.Signal(0x14) SIGTTIN = syscall.Signal(0x15) SIGTTOU = syscall.Signal(0x16) SIGURG = syscall.Signal(0x17) SIGUSR1 = syscall.Signal(0xa) SIGUSR2 = syscall.Signal(0xc) SIGVTALRM = syscall.Signal(0x1a) SIGWINCH = syscall.Signal(0x1c) SIGXCPU = syscall.Signal(0x18) SIGXFSZ = syscall.Signal(0x19) ) // Error table var errorList = [...]struct { num syscall.Errno name string desc string }{ {1, "EPERM", "operation not permitted"}, {2, "ENOENT", "no such file or directory"}, {3, "ESRCH", "no such process"}, {4, "EINTR", "interrupted system call"}, {5, "EIO", "input/output error"}, {6, "ENXIO", "no such device or address"}, {7, "E2BIG", "argument list too long"}, {8, "ENOEXEC", "exec format error"}, {9, "EBADF", "bad file descriptor"}, {10, "ECHILD", "no child processes"}, {11, "EAGAIN", "resource temporarily unavailable"}, {12, "ENOMEM", "cannot allocate memory"}, {13, "EACCES", "permission denied"}, {14, "EFAULT", "bad address"}, {15, "ENOTBLK", "block device required"}, {16, "EBUSY", "device or resource busy"}, {17, "EEXIST", "file exists"}, {18, "EXDEV", "invalid cross-device link"}, {19, "ENODEV", "no such device"}, {20, "ENOTDIR", "not a directory"}, {21, "EISDIR", "is a directory"}, {22, "EINVAL", "invalid argument"}, {23, "ENFILE", "too many open files in system"}, {24, "EMFILE", "too many open files"}, {25, "ENOTTY", "inappropriate ioctl for device"}, {26, "ETXTBSY", "text file busy"}, {27, "EFBIG", "file too large"}, {28, "ENOSPC", "no space left on device"}, {29, "ESPIPE", "illegal seek"}, {30, "EROFS", "read-only file system"}, {31, "EMLINK", "too many links"}, {32, "EPIPE", "broken pipe"}, {33, "EDOM", "numerical argument out of domain"}, {34, "ERANGE", "numerical result out of range"}, {35, "EDEADLK", "resource deadlock avoided"}, {36, "ENAMETOOLONG", "file name too long"}, {37, "ENOLCK", "no locks available"}, {38, "ENOSYS", "function not implemented"}, {39, "ENOTEMPTY", "directory not empty"}, {40, "ELOOP", "too many levels of symbolic links"}, {42, "ENOMSG", "no message of desired type"}, {43, "EIDRM", "identifier removed"}, {44, "ECHRNG", "channel number out of range"}, {45, "EL2NSYNC", "level 2 not synchronized"}, {46, "EL3HLT", "level 3 halted"}, {47, "EL3RST", "level 3 reset"}, {48, "ELNRNG", "link number out of range"}, {49, "EUNATCH", "protocol driver not attached"}, {50, "ENOCSI", "no CSI structure available"}, {51, "EL2HLT", "level 2 halted"}, {52, "EBADE", "invalid exchange"}, {53, "EBADR", "invalid request descriptor"}, {54, "EXFULL", "exchange full"}, {55, "ENOANO", "no anode"}, {56, "EBADRQC", "invalid request code"}, {57, "EBADSLT", "invalid slot"}, {59, "EBFONT", "bad font file format"}, {60, "ENOSTR", "device not a stream"}, {61, "ENODATA", "no data available"}, {62, "ETIME", "timer expired"}, {63, "ENOSR", "out of streams resources"}, {64, "ENONET", "machine is not on the network"}, {65, "ENOPKG", "package not installed"}, {66, "EREMOTE", "object is remote"}, {67, "ENOLINK", "link has been severed"}, {68, "EADV", "advertise error"}, {69, "ESRMNT", "srmount error"}, {70, "ECOMM", "communication error on send"}, {71, "EPROTO", "protocol error"}, {72, "EMULTIHOP", "multihop attempted"}, {73, "EDOTDOT", "RFS specific error"}, {74, "EBADMSG", "bad message"}, {75, "EOVERFLOW", "value too large for defined data type"}, {76, "ENOTUNIQ", "name not unique on network"}, {77, "EBADFD", "file descriptor in bad state"}, {78, "EREMCHG", "remote address changed"}, {79, "ELIBACC", "can not access a needed shared library"}, {80, "ELIBBAD", "accessing a corrupted shared library"}, {81, "ELIBSCN", ".lib section in a.out corrupted"}, {82, "ELIBMAX", "attempting to link in too many shared libraries"}, {83, "ELIBEXEC", "cannot exec a shared library directly"}, {84, "EILSEQ", "invalid or incomplete multibyte or wide character"}, {85, "ERESTART", "interrupted system call should be restarted"}, {86, "ESTRPIPE", "streams pipe error"}, {87, "EUSERS", "too many users"}, {88, "ENOTSOCK", "socket operation on non-socket"}, {89, "EDESTADDRREQ", "destination address required"}, {90, "EMSGSIZE", "message too long"}, {91, "EPROTOTYPE", "protocol wrong type for socket"}, {92, "ENOPROTOOPT", "protocol not available"}, {93, "EPROTONOSUPPORT", "protocol not supported"}, {94, "ESOCKTNOSUPPORT", "socket type not supported"}, {95, "ENOTSUP", "operation not supported"}, {96, "EPFNOSUPPORT", "protocol family not supported"}, {97, "EAFNOSUPPORT", "address family not supported by protocol"}, {98, "EADDRINUSE", "address already in use"}, {99, "EADDRNOTAVAIL", "cannot assign requested address"}, {100, "ENETDOWN", "network is down"}, {101, "ENETUNREACH", "network is unreachable"}, {102, "ENETRESET", "network dropped connection on reset"}, {103, "ECONNABORTED", "software caused connection abort"}, {104, "ECONNRESET", "connection reset by peer"}, {105, "ENOBUFS", "no buffer space available"}, {106, "EISCONN", "transport endpoint is already connected"}, {107, "ENOTCONN", "transport endpoint is not connected"}, {108, "ESHUTDOWN", "cannot send after transport endpoint shutdown"}, {109, "ETOOMANYREFS", "too many references: cannot splice"}, {110, "ETIMEDOUT", "connection timed out"}, {111, "ECONNREFUSED", "connection refused"}, {112, "EHOSTDOWN", "host is down"}, {113, "EHOSTUNREACH", "no route to host"}, {114, "EALREADY", "operation already in progress"}, {115, "EINPROGRESS", "operation now in progress"}, {116, "ESTALE", "stale file handle"}, {117, "EUCLEAN", "structure needs cleaning"}, {118, "ENOTNAM", "not a XENIX named type file"}, {119, "ENAVAIL", "no XENIX semaphores available"}, {120, "EISNAM", "is a named type file"}, {121, "EREMOTEIO", "remote I/O error"}, {122, "EDQUOT", "disk quota exceeded"}, {123, "ENOMEDIUM", "no medium found"}, {124, "EMEDIUMTYPE", "wrong medium type"}, {125, "ECANCELED", "operation canceled"}, {126, "ENOKEY", "required key not available"}, {127, "EKEYEXPIRED", "key has expired"}, {128, "EKEYREVOKED", "key has been revoked"}, {129, "EKEYREJECTED", "key was rejected by service"}, {130, "EOWNERDEAD", "owner died"}, {131, "ENOTRECOVERABLE", "state not recoverable"}, {132, "ERFKILL", "operation not possible due to RF-kill"}, {133, "EHWPOISON", "memory page has hardware error"}, } // Signal table var signalList = [...]struct { num syscall.Signal name string desc string }{ {1, "SIGHUP", "hangup"}, {2, "SIGINT", "interrupt"}, {3, "SIGQUIT", "quit"}, {4, "SIGILL", "illegal instruction"}, {5, "SIGTRAP", "trace/breakpoint trap"}, {6, "SIGABRT", "aborted"}, {7, "SIGBUS", "bus error"}, {8, "SIGFPE", "floating point exception"}, {9, "SIGKILL", "killed"}, {10, "SIGUSR1", "user defined signal 1"}, {11, "SIGSEGV", "segmentation fault"}, {12, "SIGUSR2", "user defined signal 2"}, {13, "SIGPIPE", "broken pipe"}, {14, "SIGALRM", "alarm clock"}, {15, "SIGTERM", "terminated"}, {16, "SIGSTKFLT", "stack fault"}, {17, "SIGCHLD", "child exited"}, {18, "SIGCONT", "continued"}, {19, "SIGSTOP", "stopped (signal)"}, {20, "SIGTSTP", "stopped"}, {21, "SIGTTIN", "stopped (tty input)"}, {22, "SIGTTOU", "stopped (tty output)"}, {23, "SIGURG", "urgent I/O condition"}, {24, "SIGXCPU", "CPU time limit exceeded"}, {25, "SIGXFSZ", "file size limit exceeded"}, {26, "SIGVTALRM", "virtual timer expired"}, {27, "SIGPROF", "profiling timer expired"}, {28, "SIGWINCH", "window changed"}, {29, "SIGIO", "I/O possible"}, {30, "SIGPWR", "power failure"}, {31, "SIGSYS", "bad system call"}, } ================================================ FILE: vendor/golang.org/x/sys/unix/zerrors_linux_arm.go ================================================ // mkerrors.sh -Wall -Werror -static -I/tmp/arm/include // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm && linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -Wall -Werror -static -I/tmp/arm/include _const.go package unix import "syscall" const ( B1000000 = 0x1008 B115200 = 0x1002 B1152000 = 0x1009 B1500000 = 0x100a B2000000 = 0x100b B230400 = 0x1003 B2500000 = 0x100c B3000000 = 0x100d B3500000 = 0x100e B4000000 = 0x100f B460800 = 0x1004 B500000 = 0x1005 B57600 = 0x1001 B576000 = 0x1006 B921600 = 0x1007 BLKALIGNOFF = 0x127a BLKBSZGET = 0x80041270 BLKBSZSET = 0x40041271 BLKDISCARD = 0x1277 BLKDISCARDZEROES = 0x127c BLKFLSBUF = 0x1261 BLKFRAGET = 0x1265 BLKFRASET = 0x1264 BLKGETDISKSEQ = 0x80081280 BLKGETSIZE = 0x1260 BLKGETSIZE64 = 0x80041272 BLKIOMIN = 0x1278 BLKIOOPT = 0x1279 BLKPBSZGET = 0x127b BLKRAGET = 0x1263 BLKRASET = 0x1262 BLKROGET = 0x125e BLKROSET = 0x125d BLKROTATIONAL = 0x127e BLKRRPART = 0x125f BLKSECDISCARD = 0x127d BLKSECTGET = 0x1267 BLKSECTSET = 0x1266 BLKSSZGET = 0x1268 BLKZEROOUT = 0x127f BOTHER = 0x1000 BS1 = 0x2000 BSDLY = 0x2000 CBAUD = 0x100f CBAUDEX = 0x1000 CIBAUD = 0x100f0000 CLOCAL = 0x800 CR1 = 0x200 CR2 = 0x400 CR3 = 0x600 CRDLY = 0x600 CREAD = 0x80 CS6 = 0x10 CS7 = 0x20 CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 DM_MPATH_PROBE_PATHS = 0xfd12 ECCGETLAYOUT = 0x81484d11 ECCGETSTATS = 0x80104d12 ECHOCTL = 0x200 ECHOE = 0x10 ECHOK = 0x20 ECHOKE = 0x800 ECHONL = 0x40 ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 EPIOCGPARAMS = 0x80088a02 EPIOCSPARAMS = 0x40088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 FFDLY = 0x8000 FICLONE = 0x40049409 FICLONERANGE = 0x4020940d FLUSHO = 0x1000 FS_IOC_ENABLE_VERITY = 0x40806685 FS_IOC_GETFLAGS = 0x80046601 FS_IOC_GET_ENCRYPTION_NONCE = 0x8010661b FS_IOC_GET_ENCRYPTION_POLICY = 0x400c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x40106614 FS_IOC_SETFLAGS = 0x40046602 FS_IOC_SET_ENCRYPTION_POLICY = 0x800c6613 F_GETLK = 0xc F_GETLK64 = 0xc F_GETOWN = 0x9 F_RDLCK = 0x0 F_SETLK = 0xd F_SETLK64 = 0xd F_SETLKW = 0xe F_SETLKW64 = 0xe F_SETOWN = 0x8 F_UNLCK = 0x2 F_WRLCK = 0x1 HIDIOCGRAWINFO = 0x80084803 HIDIOCGRDESC = 0x90044802 HIDIOCGRDESCSIZE = 0x80044801 HIDIOCREVOKE = 0x4004480d HUPCL = 0x400 ICANON = 0x2 IEXTEN = 0x8000 IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x800 IOCTL_MEI_NOTIFY_GET = 0x80044803 IOCTL_MEI_NOTIFY_SET = 0x40044802 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x7b9 IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_MASK = 0xffff0f00 ISIG = 0x1 IUCLC = 0x200 IXOFF = 0x1000 IXON = 0x400 MAP_ANON = 0x20 MAP_ANONYMOUS = 0x20 MAP_DENYWRITE = 0x800 MAP_EXECUTABLE = 0x1000 MAP_GROWSDOWN = 0x100 MAP_HUGETLB = 0x40000 MAP_LOCKED = 0x2000 MAP_NONBLOCK = 0x10000 MAP_NORESERVE = 0x4000 MAP_POPULATE = 0x8000 MAP_STACK = 0x20000 MAP_SYNC = 0x80000 MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MCL_ONFAULT = 0x4 MEMERASE = 0x40084d02 MEMERASE64 = 0x40104d14 MEMGETBADBLOCK = 0x40084d0b MEMGETINFO = 0x80204d01 MEMGETOOBSEL = 0x80c84d0a MEMGETREGIONCOUNT = 0x80044d07 MEMISLOCKED = 0x80084d17 MEMLOCK = 0x40084d05 MEMREAD = 0xc0404d1a MEMREADOOB = 0xc00c4d04 MEMSETBADBLOCK = 0x40084d0c MEMUNLOCK = 0x40084d06 MEMWRITEOOB = 0xc00c4d03 MTDFILEMODE = 0x4d13 NFDBITS = 0x20 NLDLY = 0x100 NOFLSH = 0x80 NS_GET_MNTNS_ID = 0x8008b705 NS_GET_NSTYPE = 0xb703 NS_GET_OWNER_UID = 0xb704 NS_GET_PARENT = 0xb702 NS_GET_PID_FROM_PIDNS = 0x8004b706 NS_GET_PID_IN_PIDNS = 0x8004b708 NS_GET_TGID_FROM_PIDNS = 0x8004b707 NS_GET_TGID_IN_PIDNS = 0x8004b709 NS_GET_USERNS = 0xb701 OLCUC = 0x2 ONLCR = 0x4 OTPERASE = 0x400c4d19 OTPGETREGIONCOUNT = 0x40044d0e OTPGETREGIONINFO = 0x400c4d0f OTPLOCK = 0x800c4d10 OTPSELECT = 0x80044d0d O_APPEND = 0x400 O_ASYNC = 0x2000 O_CLOEXEC = 0x80000 O_CREAT = 0x40 O_DIRECT = 0x10000 O_DIRECTORY = 0x4000 O_DSYNC = 0x1000 O_EXCL = 0x80 O_FSYNC = 0x101000 O_LARGEFILE = 0x20000 O_NDELAY = 0x800 O_NOATIME = 0x40000 O_NOCTTY = 0x100 O_NOFOLLOW = 0x8000 O_NONBLOCK = 0x800 O_PATH = 0x200000 O_RSYNC = 0x101000 O_SYNC = 0x101000 O_TMPFILE = 0x404000 O_TRUNC = 0x200 PARENB = 0x100 PARODD = 0x200 PENDIN = 0x4000 PERF_EVENT_IOC_DISABLE = 0x2401 PERF_EVENT_IOC_ENABLE = 0x2400 PERF_EVENT_IOC_ID = 0x80042407 PERF_EVENT_IOC_MODIFY_ATTRIBUTES = 0x4004240b PERF_EVENT_IOC_PAUSE_OUTPUT = 0x40042409 PERF_EVENT_IOC_PERIOD = 0x40082404 PERF_EVENT_IOC_QUERY_BPF = 0xc004240a PERF_EVENT_IOC_REFRESH = 0x2402 PERF_EVENT_IOC_RESET = 0x2403 PERF_EVENT_IOC_SET_BPF = 0x40042408 PERF_EVENT_IOC_SET_FILTER = 0x40042406 PERF_EVENT_IOC_SET_OUTPUT = 0x2405 PPPIOCATTACH = 0x4004743d PPPIOCATTCHAN = 0x40047438 PPPIOCBRIDGECHAN = 0x40047435 PPPIOCCONNECT = 0x4004743a PPPIOCDETACH = 0x4004743c PPPIOCDISCONN = 0x7439 PPPIOCGASYNCMAP = 0x80047458 PPPIOCGCHAN = 0x80047437 PPPIOCGDEBUG = 0x80047441 PPPIOCGFLAGS = 0x8004745a PPPIOCGIDLE = 0x8008743f PPPIOCGIDLE32 = 0x8008743f PPPIOCGIDLE64 = 0x8010743f PPPIOCGL2TPSTATS = 0x80487436 PPPIOCGMRU = 0x80047453 PPPIOCGRASYNCMAP = 0x80047455 PPPIOCGUNIT = 0x80047456 PPPIOCGXASYNCMAP = 0x80207450 PPPIOCSACTIVE = 0x40087446 PPPIOCSASYNCMAP = 0x40047457 PPPIOCSCOMPRESS = 0x400c744d PPPIOCSDEBUG = 0x40047440 PPPIOCSFLAGS = 0x40047459 PPPIOCSMAXCID = 0x40047451 PPPIOCSMRRU = 0x4004743b PPPIOCSMRU = 0x40047452 PPPIOCSNPMODE = 0x4008744b PPPIOCSPASS = 0x40087447 PPPIOCSRASYNCMAP = 0x40047454 PPPIOCSXASYNCMAP = 0x4020744f PPPIOCUNBRIDGECHAN = 0x7434 PPPIOCXFERUNIT = 0x744e PR_SET_PTRACER_ANY = 0xffffffff PTP_CLOCK_GETCAPS = 0x80503d01 PTP_CLOCK_GETCAPS2 = 0x80503d0a PTP_ENABLE_PPS = 0x40043d04 PTP_ENABLE_PPS2 = 0x40043d0d PTP_EXTTS_REQUEST = 0x40103d02 PTP_EXTTS_REQUEST2 = 0x40103d0b PTP_MASK_CLEAR_ALL = 0x3d13 PTP_MASK_EN_SINGLE = 0x40043d14 PTP_PEROUT_REQUEST = 0x40383d03 PTP_PEROUT_REQUEST2 = 0x40383d0c PTP_PIN_SETFUNC = 0x40603d07 PTP_PIN_SETFUNC2 = 0x40603d10 PTP_SYS_OFFSET = 0x43403d05 PTP_SYS_OFFSET2 = 0x43403d0e PTRACE_GETCRUNCHREGS = 0x19 PTRACE_GETFDPIC = 0x1f PTRACE_GETFDPIC_EXEC = 0x0 PTRACE_GETFDPIC_INTERP = 0x1 PTRACE_GETFPREGS = 0xe PTRACE_GETHBPREGS = 0x1d PTRACE_GETVFPREGS = 0x1b PTRACE_GETWMMXREGS = 0x12 PTRACE_GET_THREAD_AREA = 0x16 PTRACE_OLDSETOPTIONS = 0x15 PTRACE_SETCRUNCHREGS = 0x1a PTRACE_SETFPREGS = 0xf PTRACE_SETHBPREGS = 0x1e PTRACE_SETVFPREGS = 0x1c PTRACE_SETWMMXREGS = 0x13 PTRACE_SET_SYSCALL = 0x17 PT_DATA_ADDR = 0x10004 PT_TEXT_ADDR = 0x10000 PT_TEXT_END_ADDR = 0x10008 RLIMIT_AS = 0x9 RLIMIT_MEMLOCK = 0x8 RLIMIT_NOFILE = 0x7 RLIMIT_NPROC = 0x6 RLIMIT_RSS = 0x5 RNDADDENTROPY = 0x40085203 RNDADDTOENTCNT = 0x40045201 RNDCLEARPOOL = 0x5206 RNDGETENTCNT = 0x80045200 RNDGETPOOL = 0x80085202 RNDRESEEDCRNG = 0x5207 RNDZAPENTCNT = 0x5204 RTC_AIE_OFF = 0x7002 RTC_AIE_ON = 0x7001 RTC_ALM_READ = 0x80247008 RTC_ALM_SET = 0x40247007 RTC_EPOCH_READ = 0x8004700d RTC_EPOCH_SET = 0x4004700e RTC_IRQP_READ = 0x8004700b RTC_IRQP_SET = 0x4004700c RTC_PARAM_GET = 0x40187013 RTC_PARAM_SET = 0x40187014 RTC_PIE_OFF = 0x7006 RTC_PIE_ON = 0x7005 RTC_PLL_GET = 0x801c7011 RTC_PLL_SET = 0x401c7012 RTC_RD_TIME = 0x80247009 RTC_SET_TIME = 0x4024700a RTC_UIE_OFF = 0x7004 RTC_UIE_ON = 0x7003 RTC_VL_CLR = 0x7014 RTC_VL_READ = 0x80047013 RTC_WIE_OFF = 0x7010 RTC_WIE_ON = 0x700f RTC_WKALM_RD = 0x80287010 RTC_WKALM_SET = 0x4028700f SCM_DEVMEM_DMABUF = 0x4f SCM_DEVMEM_LINEAR = 0x4e SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a SCM_TIMESTAMPNS = 0x23 SCM_TS_OPT_ID = 0x51 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 SECCOMP_IOCTL_NOTIF_ADDFD = 0x40182103 SECCOMP_IOCTL_NOTIF_ID_VALID = 0x40082102 SECCOMP_IOCTL_NOTIF_SET_FLAGS = 0x40082104 SFD_CLOEXEC = 0x80000 SFD_NONBLOCK = 0x800 SIOCATMARK = 0x8905 SIOCGPGRP = 0x8904 SIOCGSTAMPNS_NEW = 0x80108907 SIOCGSTAMP_NEW = 0x80108906 SIOCINQ = 0x541b SIOCOUTQ = 0x5411 SIOCSPGRP = 0x8902 SOCK_CLOEXEC = 0x80000 SOCK_DGRAM = 0x2 SOCK_NONBLOCK = 0x800 SOCK_STREAM = 0x1 SOL_SOCKET = 0x1 SO_ACCEPTCONN = 0x1e SO_ATTACH_BPF = 0x32 SO_ATTACH_REUSEPORT_CBPF = 0x33 SO_ATTACH_REUSEPORT_EBPF = 0x34 SO_BINDTODEVICE = 0x19 SO_BINDTOIFINDEX = 0x3e SO_BPF_EXTENSIONS = 0x30 SO_BROADCAST = 0x6 SO_BSDCOMPAT = 0xe SO_BUF_LOCK = 0x48 SO_BUSY_POLL = 0x2e SO_BUSY_POLL_BUDGET = 0x46 SO_CNX_ADVICE = 0x35 SO_COOKIE = 0x39 SO_DETACH_REUSEPORT_BPF = 0x44 SO_DEVMEM_DMABUF = 0x4f SO_DEVMEM_DONTNEED = 0x50 SO_DEVMEM_LINEAR = 0x4e SO_DOMAIN = 0x27 SO_DONTROUTE = 0x5 SO_ERROR = 0x4 SO_INCOMING_CPU = 0x31 SO_INCOMING_NAPI_ID = 0x38 SO_KEEPALIVE = 0x9 SO_LINGER = 0xd SO_LOCK_FILTER = 0x2c SO_MARK = 0x24 SO_MAX_PACING_RATE = 0x2f SO_MEMINFO = 0x37 SO_NETNS_COOKIE = 0x47 SO_NOFCS = 0x2b SO_OOBINLINE = 0xa SO_PASSCRED = 0x10 SO_PASSPIDFD = 0x4c SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x11 SO_PEERGROUPS = 0x3b SO_PEERPIDFD = 0x4d SO_PEERSEC = 0x1f SO_PREFER_BUSY_POLL = 0x45 SO_PROTOCOL = 0x26 SO_RCVBUF = 0x8 SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x12 SO_RCVMARK = 0x4b SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x14 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x14 SO_RESERVE_MEM = 0x49 SO_REUSEADDR = 0x2 SO_REUSEPORT = 0xf SO_RXQ_OVFL = 0x28 SO_SECURITY_AUTHENTICATION = 0x16 SO_SECURITY_ENCRYPTION_NETWORK = 0x18 SO_SECURITY_ENCRYPTION_TRANSPORT = 0x17 SO_SELECT_ERR_QUEUE = 0x2d SO_SNDBUF = 0x7 SO_SNDBUFFORCE = 0x20 SO_SNDLOWAT = 0x13 SO_SNDTIMEO = 0x15 SO_SNDTIMEO_NEW = 0x43 SO_SNDTIMEO_OLD = 0x15 SO_TIMESTAMPING = 0x25 SO_TIMESTAMPING_NEW = 0x41 SO_TIMESTAMPING_OLD = 0x25 SO_TIMESTAMPNS = 0x23 SO_TIMESTAMPNS_NEW = 0x40 SO_TIMESTAMPNS_OLD = 0x23 SO_TIMESTAMP_NEW = 0x3f SO_TXREHASH = 0x4a SO_TXTIME = 0x3d SO_TYPE = 0x3 SO_WIFI_STATUS = 0x29 SO_ZEROCOPY = 0x3c TAB1 = 0x800 TAB2 = 0x1000 TAB3 = 0x1800 TABDLY = 0x1800 TCFLSH = 0x540b TCGETA = 0x5405 TCGETS = 0x5401 TCGETS2 = 0x802c542a TCGETX = 0x5432 TCSAFLUSH = 0x2 TCSBRK = 0x5409 TCSBRKP = 0x5425 TCSETA = 0x5406 TCSETAF = 0x5408 TCSETAW = 0x5407 TCSETS = 0x5402 TCSETS2 = 0x402c542b TCSETSF = 0x5404 TCSETSF2 = 0x402c542d TCSETSW = 0x5403 TCSETSW2 = 0x402c542c TCSETX = 0x5433 TCSETXF = 0x5434 TCSETXW = 0x5435 TCXONC = 0x540a TFD_CLOEXEC = 0x80000 TFD_NONBLOCK = 0x800 TIOCCBRK = 0x5428 TIOCCONS = 0x541d TIOCEXCL = 0x540c TIOCGDEV = 0x80045432 TIOCGETD = 0x5424 TIOCGEXCL = 0x80045440 TIOCGICOUNT = 0x545d TIOCGISO7816 = 0x80285442 TIOCGLCKTRMIOS = 0x5456 TIOCGPGRP = 0x540f TIOCGPKT = 0x80045438 TIOCGPTLCK = 0x80045439 TIOCGPTN = 0x80045430 TIOCGPTPEER = 0x5441 TIOCGRS485 = 0x542e TIOCGSERIAL = 0x541e TIOCGSID = 0x5429 TIOCGSOFTCAR = 0x5419 TIOCGWINSZ = 0x5413 TIOCINQ = 0x541b TIOCLINUX = 0x541c TIOCMBIC = 0x5417 TIOCMBIS = 0x5416 TIOCMGET = 0x5415 TIOCMIWAIT = 0x545c TIOCMSET = 0x5418 TIOCM_CAR = 0x40 TIOCM_CD = 0x40 TIOCM_CTS = 0x20 TIOCM_DSR = 0x100 TIOCM_RI = 0x80 TIOCM_RNG = 0x80 TIOCM_SR = 0x10 TIOCM_ST = 0x8 TIOCNOTTY = 0x5422 TIOCNXCL = 0x540d TIOCOUTQ = 0x5411 TIOCPKT = 0x5420 TIOCSBRK = 0x5427 TIOCSCTTY = 0x540e TIOCSERCONFIG = 0x5453 TIOCSERGETLSR = 0x5459 TIOCSERGETMULTI = 0x545a TIOCSERGSTRUCT = 0x5458 TIOCSERGWILD = 0x5454 TIOCSERSETMULTI = 0x545b TIOCSERSWILD = 0x5455 TIOCSER_TEMT = 0x1 TIOCSETD = 0x5423 TIOCSIG = 0x40045436 TIOCSISO7816 = 0xc0285443 TIOCSLCKTRMIOS = 0x5457 TIOCSPGRP = 0x5410 TIOCSPTLCK = 0x40045431 TIOCSRS485 = 0x542f TIOCSSERIAL = 0x541f TIOCSSOFTCAR = 0x541a TIOCSTI = 0x5412 TIOCSWINSZ = 0x5414 TIOCVHANGUP = 0x5437 TOSTOP = 0x100 TUNATTACHFILTER = 0x400854d5 TUNDETACHFILTER = 0x400854d6 TUNGETDEVNETNS = 0x54e3 TUNGETFEATURES = 0x800454cf TUNGETFILTER = 0x800854db TUNGETIFF = 0x800454d2 TUNGETSNDBUF = 0x800454d3 TUNGETVNETBE = 0x800454df TUNGETVNETHDRSZ = 0x800454d7 TUNGETVNETLE = 0x800454dd TUNSETCARRIER = 0x400454e2 TUNSETDEBUG = 0x400454c9 TUNSETFILTEREBPF = 0x800454e1 TUNSETGROUP = 0x400454ce TUNSETIFF = 0x400454ca TUNSETIFINDEX = 0x400454da TUNSETLINK = 0x400454cd TUNSETNOCSUM = 0x400454c8 TUNSETOFFLOAD = 0x400454d0 TUNSETOWNER = 0x400454cc TUNSETPERSIST = 0x400454cb TUNSETQUEUE = 0x400454d9 TUNSETSNDBUF = 0x400454d4 TUNSETSTEERINGEBPF = 0x800454e0 TUNSETTXFILTER = 0x400454d1 TUNSETVNETBE = 0x400454de TUNSETVNETHDRSZ = 0x400454d8 TUNSETVNETLE = 0x400454dc UBI_IOCATT = 0x40186f40 UBI_IOCDET = 0x40046f41 UBI_IOCEBCH = 0x40044f02 UBI_IOCEBER = 0x40044f01 UBI_IOCEBISMAP = 0x80044f05 UBI_IOCEBMAP = 0x40084f03 UBI_IOCEBUNMAP = 0x40044f04 UBI_IOCMKVOL = 0x40986f00 UBI_IOCRMVOL = 0x40046f01 UBI_IOCRNVOL = 0x51106f03 UBI_IOCRPEB = 0x40046f04 UBI_IOCRSVOL = 0x400c6f02 UBI_IOCSETVOLPROP = 0x40104f06 UBI_IOCSPEB = 0x40046f05 UBI_IOCVOLCRBLK = 0x40804f07 UBI_IOCVOLRMBLK = 0x4f08 UBI_IOCVOLUP = 0x40084f00 VDISCARD = 0xd VEOF = 0x4 VEOL = 0xb VEOL2 = 0x10 VMIN = 0x6 VREPRINT = 0xc VSTART = 0x8 VSTOP = 0x9 VSUSP = 0xa VSWTC = 0x7 VT1 = 0x4000 VTDLY = 0x4000 VTIME = 0x5 VWERASE = 0xe WDIOC_GETBOOTSTATUS = 0x80045702 WDIOC_GETPRETIMEOUT = 0x80045709 WDIOC_GETSTATUS = 0x80045701 WDIOC_GETSUPPORT = 0x80285700 WDIOC_GETTEMP = 0x80045703 WDIOC_GETTIMELEFT = 0x8004570a WDIOC_GETTIMEOUT = 0x80045707 WDIOC_KEEPALIVE = 0x80045705 WDIOC_SETOPTIONS = 0x80045704 WORDSIZE = 0x20 XCASE = 0x4 XTABS = 0x1800 _HIDIOCGRAWNAME = 0x80804804 _HIDIOCGRAWPHYS = 0x80404805 _HIDIOCGRAWUNIQ = 0x80404808 ) // Errors const ( EADDRINUSE = syscall.Errno(0x62) EADDRNOTAVAIL = syscall.Errno(0x63) EADV = syscall.Errno(0x44) EAFNOSUPPORT = syscall.Errno(0x61) EALREADY = syscall.Errno(0x72) EBADE = syscall.Errno(0x34) EBADFD = syscall.Errno(0x4d) EBADMSG = syscall.Errno(0x4a) EBADR = syscall.Errno(0x35) EBADRQC = syscall.Errno(0x38) EBADSLT = syscall.Errno(0x39) EBFONT = syscall.Errno(0x3b) ECANCELED = syscall.Errno(0x7d) ECHRNG = syscall.Errno(0x2c) ECOMM = syscall.Errno(0x46) ECONNABORTED = syscall.Errno(0x67) ECONNREFUSED = syscall.Errno(0x6f) ECONNRESET = syscall.Errno(0x68) EDEADLK = syscall.Errno(0x23) EDEADLOCK = syscall.Errno(0x23) EDESTADDRREQ = syscall.Errno(0x59) EDOTDOT = syscall.Errno(0x49) EDQUOT = syscall.Errno(0x7a) EHOSTDOWN = syscall.Errno(0x70) EHOSTUNREACH = syscall.Errno(0x71) EHWPOISON = syscall.Errno(0x85) EIDRM = syscall.Errno(0x2b) EILSEQ = syscall.Errno(0x54) EINPROGRESS = syscall.Errno(0x73) EISCONN = syscall.Errno(0x6a) EISNAM = syscall.Errno(0x78) EKEYEXPIRED = syscall.Errno(0x7f) EKEYREJECTED = syscall.Errno(0x81) EKEYREVOKED = syscall.Errno(0x80) EL2HLT = syscall.Errno(0x33) EL2NSYNC = syscall.Errno(0x2d) EL3HLT = syscall.Errno(0x2e) EL3RST = syscall.Errno(0x2f) ELIBACC = syscall.Errno(0x4f) ELIBBAD = syscall.Errno(0x50) ELIBEXEC = syscall.Errno(0x53) ELIBMAX = syscall.Errno(0x52) ELIBSCN = syscall.Errno(0x51) ELNRNG = syscall.Errno(0x30) ELOOP = syscall.Errno(0x28) EMEDIUMTYPE = syscall.Errno(0x7c) EMSGSIZE = syscall.Errno(0x5a) EMULTIHOP = syscall.Errno(0x48) ENAMETOOLONG = syscall.Errno(0x24) ENAVAIL = syscall.Errno(0x77) ENETDOWN = syscall.Errno(0x64) ENETRESET = syscall.Errno(0x66) ENETUNREACH = syscall.Errno(0x65) ENOANO = syscall.Errno(0x37) ENOBUFS = syscall.Errno(0x69) ENOCSI = syscall.Errno(0x32) ENODATA = syscall.Errno(0x3d) ENOKEY = syscall.Errno(0x7e) ENOLCK = syscall.Errno(0x25) ENOLINK = syscall.Errno(0x43) ENOMEDIUM = syscall.Errno(0x7b) ENOMSG = syscall.Errno(0x2a) ENONET = syscall.Errno(0x40) ENOPKG = syscall.Errno(0x41) ENOPROTOOPT = syscall.Errno(0x5c) ENOSR = syscall.Errno(0x3f) ENOSTR = syscall.Errno(0x3c) ENOSYS = syscall.Errno(0x26) ENOTCONN = syscall.Errno(0x6b) ENOTEMPTY = syscall.Errno(0x27) ENOTNAM = syscall.Errno(0x76) ENOTRECOVERABLE = syscall.Errno(0x83) ENOTSOCK = syscall.Errno(0x58) ENOTSUP = syscall.Errno(0x5f) ENOTUNIQ = syscall.Errno(0x4c) EOPNOTSUPP = syscall.Errno(0x5f) EOVERFLOW = syscall.Errno(0x4b) EOWNERDEAD = syscall.Errno(0x82) EPFNOSUPPORT = syscall.Errno(0x60) EPROTO = syscall.Errno(0x47) EPROTONOSUPPORT = syscall.Errno(0x5d) EPROTOTYPE = syscall.Errno(0x5b) EREMCHG = syscall.Errno(0x4e) EREMOTE = syscall.Errno(0x42) EREMOTEIO = syscall.Errno(0x79) ERESTART = syscall.Errno(0x55) ERFKILL = syscall.Errno(0x84) ESHUTDOWN = syscall.Errno(0x6c) ESOCKTNOSUPPORT = syscall.Errno(0x5e) ESRMNT = syscall.Errno(0x45) ESTALE = syscall.Errno(0x74) ESTRPIPE = syscall.Errno(0x56) ETIME = syscall.Errno(0x3e) ETIMEDOUT = syscall.Errno(0x6e) ETOOMANYREFS = syscall.Errno(0x6d) EUCLEAN = syscall.Errno(0x75) EUNATCH = syscall.Errno(0x31) EUSERS = syscall.Errno(0x57) EXFULL = syscall.Errno(0x36) ) // Signals const ( SIGBUS = syscall.Signal(0x7) SIGCHLD = syscall.Signal(0x11) SIGCLD = syscall.Signal(0x11) SIGCONT = syscall.Signal(0x12) SIGIO = syscall.Signal(0x1d) SIGPOLL = syscall.Signal(0x1d) SIGPROF = syscall.Signal(0x1b) SIGPWR = syscall.Signal(0x1e) SIGSTKFLT = syscall.Signal(0x10) SIGSTOP = syscall.Signal(0x13) SIGSYS = syscall.Signal(0x1f) SIGTSTP = syscall.Signal(0x14) SIGTTIN = syscall.Signal(0x15) SIGTTOU = syscall.Signal(0x16) SIGURG = syscall.Signal(0x17) SIGUSR1 = syscall.Signal(0xa) SIGUSR2 = syscall.Signal(0xc) SIGVTALRM = syscall.Signal(0x1a) SIGWINCH = syscall.Signal(0x1c) SIGXCPU = syscall.Signal(0x18) SIGXFSZ = syscall.Signal(0x19) ) // Error table var errorList = [...]struct { num syscall.Errno name string desc string }{ {1, "EPERM", "operation not permitted"}, {2, "ENOENT", "no such file or directory"}, {3, "ESRCH", "no such process"}, {4, "EINTR", "interrupted system call"}, {5, "EIO", "input/output error"}, {6, "ENXIO", "no such device or address"}, {7, "E2BIG", "argument list too long"}, {8, "ENOEXEC", "exec format error"}, {9, "EBADF", "bad file descriptor"}, {10, "ECHILD", "no child processes"}, {11, "EAGAIN", "resource temporarily unavailable"}, {12, "ENOMEM", "cannot allocate memory"}, {13, "EACCES", "permission denied"}, {14, "EFAULT", "bad address"}, {15, "ENOTBLK", "block device required"}, {16, "EBUSY", "device or resource busy"}, {17, "EEXIST", "file exists"}, {18, "EXDEV", "invalid cross-device link"}, {19, "ENODEV", "no such device"}, {20, "ENOTDIR", "not a directory"}, {21, "EISDIR", "is a directory"}, {22, "EINVAL", "invalid argument"}, {23, "ENFILE", "too many open files in system"}, {24, "EMFILE", "too many open files"}, {25, "ENOTTY", "inappropriate ioctl for device"}, {26, "ETXTBSY", "text file busy"}, {27, "EFBIG", "file too large"}, {28, "ENOSPC", "no space left on device"}, {29, "ESPIPE", "illegal seek"}, {30, "EROFS", "read-only file system"}, {31, "EMLINK", "too many links"}, {32, "EPIPE", "broken pipe"}, {33, "EDOM", "numerical argument out of domain"}, {34, "ERANGE", "numerical result out of range"}, {35, "EDEADLK", "resource deadlock avoided"}, {36, "ENAMETOOLONG", "file name too long"}, {37, "ENOLCK", "no locks available"}, {38, "ENOSYS", "function not implemented"}, {39, "ENOTEMPTY", "directory not empty"}, {40, "ELOOP", "too many levels of symbolic links"}, {42, "ENOMSG", "no message of desired type"}, {43, "EIDRM", "identifier removed"}, {44, "ECHRNG", "channel number out of range"}, {45, "EL2NSYNC", "level 2 not synchronized"}, {46, "EL3HLT", "level 3 halted"}, {47, "EL3RST", "level 3 reset"}, {48, "ELNRNG", "link number out of range"}, {49, "EUNATCH", "protocol driver not attached"}, {50, "ENOCSI", "no CSI structure available"}, {51, "EL2HLT", "level 2 halted"}, {52, "EBADE", "invalid exchange"}, {53, "EBADR", "invalid request descriptor"}, {54, "EXFULL", "exchange full"}, {55, "ENOANO", "no anode"}, {56, "EBADRQC", "invalid request code"}, {57, "EBADSLT", "invalid slot"}, {59, "EBFONT", "bad font file format"}, {60, "ENOSTR", "device not a stream"}, {61, "ENODATA", "no data available"}, {62, "ETIME", "timer expired"}, {63, "ENOSR", "out of streams resources"}, {64, "ENONET", "machine is not on the network"}, {65, "ENOPKG", "package not installed"}, {66, "EREMOTE", "object is remote"}, {67, "ENOLINK", "link has been severed"}, {68, "EADV", "advertise error"}, {69, "ESRMNT", "srmount error"}, {70, "ECOMM", "communication error on send"}, {71, "EPROTO", "protocol error"}, {72, "EMULTIHOP", "multihop attempted"}, {73, "EDOTDOT", "RFS specific error"}, {74, "EBADMSG", "bad message"}, {75, "EOVERFLOW", "value too large for defined data type"}, {76, "ENOTUNIQ", "name not unique on network"}, {77, "EBADFD", "file descriptor in bad state"}, {78, "EREMCHG", "remote address changed"}, {79, "ELIBACC", "can not access a needed shared library"}, {80, "ELIBBAD", "accessing a corrupted shared library"}, {81, "ELIBSCN", ".lib section in a.out corrupted"}, {82, "ELIBMAX", "attempting to link in too many shared libraries"}, {83, "ELIBEXEC", "cannot exec a shared library directly"}, {84, "EILSEQ", "invalid or incomplete multibyte or wide character"}, {85, "ERESTART", "interrupted system call should be restarted"}, {86, "ESTRPIPE", "streams pipe error"}, {87, "EUSERS", "too many users"}, {88, "ENOTSOCK", "socket operation on non-socket"}, {89, "EDESTADDRREQ", "destination address required"}, {90, "EMSGSIZE", "message too long"}, {91, "EPROTOTYPE", "protocol wrong type for socket"}, {92, "ENOPROTOOPT", "protocol not available"}, {93, "EPROTONOSUPPORT", "protocol not supported"}, {94, "ESOCKTNOSUPPORT", "socket type not supported"}, {95, "ENOTSUP", "operation not supported"}, {96, "EPFNOSUPPORT", "protocol family not supported"}, {97, "EAFNOSUPPORT", "address family not supported by protocol"}, {98, "EADDRINUSE", "address already in use"}, {99, "EADDRNOTAVAIL", "cannot assign requested address"}, {100, "ENETDOWN", "network is down"}, {101, "ENETUNREACH", "network is unreachable"}, {102, "ENETRESET", "network dropped connection on reset"}, {103, "ECONNABORTED", "software caused connection abort"}, {104, "ECONNRESET", "connection reset by peer"}, {105, "ENOBUFS", "no buffer space available"}, {106, "EISCONN", "transport endpoint is already connected"}, {107, "ENOTCONN", "transport endpoint is not connected"}, {108, "ESHUTDOWN", "cannot send after transport endpoint shutdown"}, {109, "ETOOMANYREFS", "too many references: cannot splice"}, {110, "ETIMEDOUT", "connection timed out"}, {111, "ECONNREFUSED", "connection refused"}, {112, "EHOSTDOWN", "host is down"}, {113, "EHOSTUNREACH", "no route to host"}, {114, "EALREADY", "operation already in progress"}, {115, "EINPROGRESS", "operation now in progress"}, {116, "ESTALE", "stale file handle"}, {117, "EUCLEAN", "structure needs cleaning"}, {118, "ENOTNAM", "not a XENIX named type file"}, {119, "ENAVAIL", "no XENIX semaphores available"}, {120, "EISNAM", "is a named type file"}, {121, "EREMOTEIO", "remote I/O error"}, {122, "EDQUOT", "disk quota exceeded"}, {123, "ENOMEDIUM", "no medium found"}, {124, "EMEDIUMTYPE", "wrong medium type"}, {125, "ECANCELED", "operation canceled"}, {126, "ENOKEY", "required key not available"}, {127, "EKEYEXPIRED", "key has expired"}, {128, "EKEYREVOKED", "key has been revoked"}, {129, "EKEYREJECTED", "key was rejected by service"}, {130, "EOWNERDEAD", "owner died"}, {131, "ENOTRECOVERABLE", "state not recoverable"}, {132, "ERFKILL", "operation not possible due to RF-kill"}, {133, "EHWPOISON", "memory page has hardware error"}, } // Signal table var signalList = [...]struct { num syscall.Signal name string desc string }{ {1, "SIGHUP", "hangup"}, {2, "SIGINT", "interrupt"}, {3, "SIGQUIT", "quit"}, {4, "SIGILL", "illegal instruction"}, {5, "SIGTRAP", "trace/breakpoint trap"}, {6, "SIGABRT", "aborted"}, {7, "SIGBUS", "bus error"}, {8, "SIGFPE", "floating point exception"}, {9, "SIGKILL", "killed"}, {10, "SIGUSR1", "user defined signal 1"}, {11, "SIGSEGV", "segmentation fault"}, {12, "SIGUSR2", "user defined signal 2"}, {13, "SIGPIPE", "broken pipe"}, {14, "SIGALRM", "alarm clock"}, {15, "SIGTERM", "terminated"}, {16, "SIGSTKFLT", "stack fault"}, {17, "SIGCHLD", "child exited"}, {18, "SIGCONT", "continued"}, {19, "SIGSTOP", "stopped (signal)"}, {20, "SIGTSTP", "stopped"}, {21, "SIGTTIN", "stopped (tty input)"}, {22, "SIGTTOU", "stopped (tty output)"}, {23, "SIGURG", "urgent I/O condition"}, {24, "SIGXCPU", "CPU time limit exceeded"}, {25, "SIGXFSZ", "file size limit exceeded"}, {26, "SIGVTALRM", "virtual timer expired"}, {27, "SIGPROF", "profiling timer expired"}, {28, "SIGWINCH", "window changed"}, {29, "SIGIO", "I/O possible"}, {30, "SIGPWR", "power failure"}, {31, "SIGSYS", "bad system call"}, } ================================================ FILE: vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go ================================================ // mkerrors.sh -Wall -Werror -static -I/tmp/arm64/include -fsigned-char // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm64 && linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -Wall -Werror -static -I/tmp/arm64/include -fsigned-char _const.go package unix import "syscall" const ( B1000000 = 0x1008 B115200 = 0x1002 B1152000 = 0x1009 B1500000 = 0x100a B2000000 = 0x100b B230400 = 0x1003 B2500000 = 0x100c B3000000 = 0x100d B3500000 = 0x100e B4000000 = 0x100f B460800 = 0x1004 B500000 = 0x1005 B57600 = 0x1001 B576000 = 0x1006 B921600 = 0x1007 BLKALIGNOFF = 0x127a BLKBSZGET = 0x80081270 BLKBSZSET = 0x40081271 BLKDISCARD = 0x1277 BLKDISCARDZEROES = 0x127c BLKFLSBUF = 0x1261 BLKFRAGET = 0x1265 BLKFRASET = 0x1264 BLKGETDISKSEQ = 0x80081280 BLKGETSIZE = 0x1260 BLKGETSIZE64 = 0x80081272 BLKIOMIN = 0x1278 BLKIOOPT = 0x1279 BLKPBSZGET = 0x127b BLKRAGET = 0x1263 BLKRASET = 0x1262 BLKROGET = 0x125e BLKROSET = 0x125d BLKROTATIONAL = 0x127e BLKRRPART = 0x125f BLKSECDISCARD = 0x127d BLKSECTGET = 0x1267 BLKSECTSET = 0x1266 BLKSSZGET = 0x1268 BLKZEROOUT = 0x127f BOTHER = 0x1000 BS1 = 0x2000 BSDLY = 0x2000 CBAUD = 0x100f CBAUDEX = 0x1000 CIBAUD = 0x100f0000 CLOCAL = 0x800 CR1 = 0x200 CR2 = 0x400 CR3 = 0x600 CRDLY = 0x600 CREAD = 0x80 CS6 = 0x10 CS7 = 0x20 CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 DM_MPATH_PROBE_PATHS = 0xfd12 ECCGETLAYOUT = 0x81484d11 ECCGETSTATS = 0x80104d12 ECHOCTL = 0x200 ECHOE = 0x10 ECHOK = 0x20 ECHOKE = 0x800 ECHONL = 0x40 ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 EPIOCGPARAMS = 0x80088a02 EPIOCSPARAMS = 0x40088a01 EPOLL_CLOEXEC = 0x80000 ESR_MAGIC = 0x45535201 EXTPROC = 0x10000 EXTRA_MAGIC = 0x45585401 FF1 = 0x8000 FFDLY = 0x8000 FICLONE = 0x40049409 FICLONERANGE = 0x4020940d FLUSHO = 0x1000 FPMR_MAGIC = 0x46504d52 FPSIMD_MAGIC = 0x46508001 FS_IOC_ENABLE_VERITY = 0x40806685 FS_IOC_GETFLAGS = 0x80086601 FS_IOC_GET_ENCRYPTION_NONCE = 0x8010661b FS_IOC_GET_ENCRYPTION_POLICY = 0x400c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x40106614 FS_IOC_SETFLAGS = 0x40086602 FS_IOC_SET_ENCRYPTION_POLICY = 0x800c6613 F_GETLK = 0x5 F_GETLK64 = 0x5 F_GETOWN = 0x9 F_RDLCK = 0x0 F_SETLK = 0x6 F_SETLK64 = 0x6 F_SETLKW = 0x7 F_SETLKW64 = 0x7 F_SETOWN = 0x8 F_UNLCK = 0x2 F_WRLCK = 0x1 GCS_MAGIC = 0x47435300 HIDIOCGRAWINFO = 0x80084803 HIDIOCGRDESC = 0x90044802 HIDIOCGRDESCSIZE = 0x80044801 HIDIOCREVOKE = 0x4004480d HUPCL = 0x400 ICANON = 0x2 IEXTEN = 0x8000 IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x800 IOCTL_MEI_NOTIFY_GET = 0x80044803 IOCTL_MEI_NOTIFY_SET = 0x40044802 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x7b9 IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_MASK = 0xffff0f00 ISIG = 0x1 IUCLC = 0x200 IXOFF = 0x1000 IXON = 0x400 MAP_ANON = 0x20 MAP_ANONYMOUS = 0x20 MAP_DENYWRITE = 0x800 MAP_EXECUTABLE = 0x1000 MAP_GROWSDOWN = 0x100 MAP_HUGETLB = 0x40000 MAP_LOCKED = 0x2000 MAP_NONBLOCK = 0x10000 MAP_NORESERVE = 0x4000 MAP_POPULATE = 0x8000 MAP_STACK = 0x20000 MAP_SYNC = 0x80000 MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MCL_ONFAULT = 0x4 MEMERASE = 0x40084d02 MEMERASE64 = 0x40104d14 MEMGETBADBLOCK = 0x40084d0b MEMGETINFO = 0x80204d01 MEMGETOOBSEL = 0x80c84d0a MEMGETREGIONCOUNT = 0x80044d07 MEMISLOCKED = 0x80084d17 MEMLOCK = 0x40084d05 MEMREAD = 0xc0404d1a MEMREADOOB = 0xc0104d04 MEMSETBADBLOCK = 0x40084d0c MEMUNLOCK = 0x40084d06 MEMWRITEOOB = 0xc0104d03 MTDFILEMODE = 0x4d13 NFDBITS = 0x40 NLDLY = 0x100 NOFLSH = 0x80 NS_GET_MNTNS_ID = 0x8008b705 NS_GET_NSTYPE = 0xb703 NS_GET_OWNER_UID = 0xb704 NS_GET_PARENT = 0xb702 NS_GET_PID_FROM_PIDNS = 0x8004b706 NS_GET_PID_IN_PIDNS = 0x8004b708 NS_GET_TGID_FROM_PIDNS = 0x8004b707 NS_GET_TGID_IN_PIDNS = 0x8004b709 NS_GET_USERNS = 0xb701 OLCUC = 0x2 ONLCR = 0x4 OTPERASE = 0x400c4d19 OTPGETREGIONCOUNT = 0x40044d0e OTPGETREGIONINFO = 0x400c4d0f OTPLOCK = 0x800c4d10 OTPSELECT = 0x80044d0d O_APPEND = 0x400 O_ASYNC = 0x2000 O_CLOEXEC = 0x80000 O_CREAT = 0x40 O_DIRECT = 0x10000 O_DIRECTORY = 0x4000 O_DSYNC = 0x1000 O_EXCL = 0x80 O_FSYNC = 0x101000 O_LARGEFILE = 0x0 O_NDELAY = 0x800 O_NOATIME = 0x40000 O_NOCTTY = 0x100 O_NOFOLLOW = 0x8000 O_NONBLOCK = 0x800 O_PATH = 0x200000 O_RSYNC = 0x101000 O_SYNC = 0x101000 O_TMPFILE = 0x404000 O_TRUNC = 0x200 PARENB = 0x100 PARODD = 0x200 PENDIN = 0x4000 PERF_EVENT_IOC_DISABLE = 0x2401 PERF_EVENT_IOC_ENABLE = 0x2400 PERF_EVENT_IOC_ID = 0x80082407 PERF_EVENT_IOC_MODIFY_ATTRIBUTES = 0x4008240b PERF_EVENT_IOC_PAUSE_OUTPUT = 0x40042409 PERF_EVENT_IOC_PERIOD = 0x40082404 PERF_EVENT_IOC_QUERY_BPF = 0xc008240a PERF_EVENT_IOC_REFRESH = 0x2402 PERF_EVENT_IOC_RESET = 0x2403 PERF_EVENT_IOC_SET_BPF = 0x40042408 PERF_EVENT_IOC_SET_FILTER = 0x40082406 PERF_EVENT_IOC_SET_OUTPUT = 0x2405 POE_MAGIC = 0x504f4530 PPPIOCATTACH = 0x4004743d PPPIOCATTCHAN = 0x40047438 PPPIOCBRIDGECHAN = 0x40047435 PPPIOCCONNECT = 0x4004743a PPPIOCDETACH = 0x4004743c PPPIOCDISCONN = 0x7439 PPPIOCGASYNCMAP = 0x80047458 PPPIOCGCHAN = 0x80047437 PPPIOCGDEBUG = 0x80047441 PPPIOCGFLAGS = 0x8004745a PPPIOCGIDLE = 0x8010743f PPPIOCGIDLE32 = 0x8008743f PPPIOCGIDLE64 = 0x8010743f PPPIOCGL2TPSTATS = 0x80487436 PPPIOCGMRU = 0x80047453 PPPIOCGRASYNCMAP = 0x80047455 PPPIOCGUNIT = 0x80047456 PPPIOCGXASYNCMAP = 0x80207450 PPPIOCSACTIVE = 0x40107446 PPPIOCSASYNCMAP = 0x40047457 PPPIOCSCOMPRESS = 0x4010744d PPPIOCSDEBUG = 0x40047440 PPPIOCSFLAGS = 0x40047459 PPPIOCSMAXCID = 0x40047451 PPPIOCSMRRU = 0x4004743b PPPIOCSMRU = 0x40047452 PPPIOCSNPMODE = 0x4008744b PPPIOCSPASS = 0x40107447 PPPIOCSRASYNCMAP = 0x40047454 PPPIOCSXASYNCMAP = 0x4020744f PPPIOCUNBRIDGECHAN = 0x7434 PPPIOCXFERUNIT = 0x744e PROT_BTI = 0x10 PROT_MTE = 0x20 PR_SET_PTRACER_ANY = 0xffffffffffffffff PTP_CLOCK_GETCAPS = 0x80503d01 PTP_CLOCK_GETCAPS2 = 0x80503d0a PTP_ENABLE_PPS = 0x40043d04 PTP_ENABLE_PPS2 = 0x40043d0d PTP_EXTTS_REQUEST = 0x40103d02 PTP_EXTTS_REQUEST2 = 0x40103d0b PTP_MASK_CLEAR_ALL = 0x3d13 PTP_MASK_EN_SINGLE = 0x40043d14 PTP_PEROUT_REQUEST = 0x40383d03 PTP_PEROUT_REQUEST2 = 0x40383d0c PTP_PIN_SETFUNC = 0x40603d07 PTP_PIN_SETFUNC2 = 0x40603d10 PTP_SYS_OFFSET = 0x43403d05 PTP_SYS_OFFSET2 = 0x43403d0e PTRACE_PEEKMTETAGS = 0x21 PTRACE_POKEMTETAGS = 0x22 PTRACE_SYSEMU = 0x1f PTRACE_SYSEMU_SINGLESTEP = 0x20 RLIMIT_AS = 0x9 RLIMIT_MEMLOCK = 0x8 RLIMIT_NOFILE = 0x7 RLIMIT_NPROC = 0x6 RLIMIT_RSS = 0x5 RNDADDENTROPY = 0x40085203 RNDADDTOENTCNT = 0x40045201 RNDCLEARPOOL = 0x5206 RNDGETENTCNT = 0x80045200 RNDGETPOOL = 0x80085202 RNDRESEEDCRNG = 0x5207 RNDZAPENTCNT = 0x5204 RTC_AIE_OFF = 0x7002 RTC_AIE_ON = 0x7001 RTC_ALM_READ = 0x80247008 RTC_ALM_SET = 0x40247007 RTC_EPOCH_READ = 0x8008700d RTC_EPOCH_SET = 0x4008700e RTC_IRQP_READ = 0x8008700b RTC_IRQP_SET = 0x4008700c RTC_PARAM_GET = 0x40187013 RTC_PARAM_SET = 0x40187014 RTC_PIE_OFF = 0x7006 RTC_PIE_ON = 0x7005 RTC_PLL_GET = 0x80207011 RTC_PLL_SET = 0x40207012 RTC_RD_TIME = 0x80247009 RTC_SET_TIME = 0x4024700a RTC_UIE_OFF = 0x7004 RTC_UIE_ON = 0x7003 RTC_VL_CLR = 0x7014 RTC_VL_READ = 0x80047013 RTC_WIE_OFF = 0x7010 RTC_WIE_ON = 0x700f RTC_WKALM_RD = 0x80287010 RTC_WKALM_SET = 0x4028700f SCM_DEVMEM_DMABUF = 0x4f SCM_DEVMEM_LINEAR = 0x4e SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a SCM_TIMESTAMPNS = 0x23 SCM_TS_OPT_ID = 0x51 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 SECCOMP_IOCTL_NOTIF_ADDFD = 0x40182103 SECCOMP_IOCTL_NOTIF_ID_VALID = 0x40082102 SECCOMP_IOCTL_NOTIF_SET_FLAGS = 0x40082104 SFD_CLOEXEC = 0x80000 SFD_NONBLOCK = 0x800 SIOCATMARK = 0x8905 SIOCGPGRP = 0x8904 SIOCGSTAMPNS_NEW = 0x80108907 SIOCGSTAMP_NEW = 0x80108906 SIOCINQ = 0x541b SIOCOUTQ = 0x5411 SIOCSPGRP = 0x8902 SOCK_CLOEXEC = 0x80000 SOCK_DGRAM = 0x2 SOCK_NONBLOCK = 0x800 SOCK_STREAM = 0x1 SOL_SOCKET = 0x1 SO_ACCEPTCONN = 0x1e SO_ATTACH_BPF = 0x32 SO_ATTACH_REUSEPORT_CBPF = 0x33 SO_ATTACH_REUSEPORT_EBPF = 0x34 SO_BINDTODEVICE = 0x19 SO_BINDTOIFINDEX = 0x3e SO_BPF_EXTENSIONS = 0x30 SO_BROADCAST = 0x6 SO_BSDCOMPAT = 0xe SO_BUF_LOCK = 0x48 SO_BUSY_POLL = 0x2e SO_BUSY_POLL_BUDGET = 0x46 SO_CNX_ADVICE = 0x35 SO_COOKIE = 0x39 SO_DETACH_REUSEPORT_BPF = 0x44 SO_DEVMEM_DMABUF = 0x4f SO_DEVMEM_DONTNEED = 0x50 SO_DEVMEM_LINEAR = 0x4e SO_DOMAIN = 0x27 SO_DONTROUTE = 0x5 SO_ERROR = 0x4 SO_INCOMING_CPU = 0x31 SO_INCOMING_NAPI_ID = 0x38 SO_KEEPALIVE = 0x9 SO_LINGER = 0xd SO_LOCK_FILTER = 0x2c SO_MARK = 0x24 SO_MAX_PACING_RATE = 0x2f SO_MEMINFO = 0x37 SO_NETNS_COOKIE = 0x47 SO_NOFCS = 0x2b SO_OOBINLINE = 0xa SO_PASSCRED = 0x10 SO_PASSPIDFD = 0x4c SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x11 SO_PEERGROUPS = 0x3b SO_PEERPIDFD = 0x4d SO_PEERSEC = 0x1f SO_PREFER_BUSY_POLL = 0x45 SO_PROTOCOL = 0x26 SO_RCVBUF = 0x8 SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x12 SO_RCVMARK = 0x4b SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x14 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x14 SO_RESERVE_MEM = 0x49 SO_REUSEADDR = 0x2 SO_REUSEPORT = 0xf SO_RXQ_OVFL = 0x28 SO_SECURITY_AUTHENTICATION = 0x16 SO_SECURITY_ENCRYPTION_NETWORK = 0x18 SO_SECURITY_ENCRYPTION_TRANSPORT = 0x17 SO_SELECT_ERR_QUEUE = 0x2d SO_SNDBUF = 0x7 SO_SNDBUFFORCE = 0x20 SO_SNDLOWAT = 0x13 SO_SNDTIMEO = 0x15 SO_SNDTIMEO_NEW = 0x43 SO_SNDTIMEO_OLD = 0x15 SO_TIMESTAMPING = 0x25 SO_TIMESTAMPING_NEW = 0x41 SO_TIMESTAMPING_OLD = 0x25 SO_TIMESTAMPNS = 0x23 SO_TIMESTAMPNS_NEW = 0x40 SO_TIMESTAMPNS_OLD = 0x23 SO_TIMESTAMP_NEW = 0x3f SO_TXREHASH = 0x4a SO_TXTIME = 0x3d SO_TYPE = 0x3 SO_WIFI_STATUS = 0x29 SO_ZEROCOPY = 0x3c SVE_MAGIC = 0x53564501 TAB1 = 0x800 TAB2 = 0x1000 TAB3 = 0x1800 TABDLY = 0x1800 TCFLSH = 0x540b TCGETA = 0x5405 TCGETS = 0x5401 TCGETS2 = 0x802c542a TCGETX = 0x5432 TCSAFLUSH = 0x2 TCSBRK = 0x5409 TCSBRKP = 0x5425 TCSETA = 0x5406 TCSETAF = 0x5408 TCSETAW = 0x5407 TCSETS = 0x5402 TCSETS2 = 0x402c542b TCSETSF = 0x5404 TCSETSF2 = 0x402c542d TCSETSW = 0x5403 TCSETSW2 = 0x402c542c TCSETX = 0x5433 TCSETXF = 0x5434 TCSETXW = 0x5435 TCXONC = 0x540a TFD_CLOEXEC = 0x80000 TFD_NONBLOCK = 0x800 TIOCCBRK = 0x5428 TIOCCONS = 0x541d TIOCEXCL = 0x540c TIOCGDEV = 0x80045432 TIOCGETD = 0x5424 TIOCGEXCL = 0x80045440 TIOCGICOUNT = 0x545d TIOCGISO7816 = 0x80285442 TIOCGLCKTRMIOS = 0x5456 TIOCGPGRP = 0x540f TIOCGPKT = 0x80045438 TIOCGPTLCK = 0x80045439 TIOCGPTN = 0x80045430 TIOCGPTPEER = 0x5441 TIOCGRS485 = 0x542e TIOCGSERIAL = 0x541e TIOCGSID = 0x5429 TIOCGSOFTCAR = 0x5419 TIOCGWINSZ = 0x5413 TIOCINQ = 0x541b TIOCLINUX = 0x541c TIOCMBIC = 0x5417 TIOCMBIS = 0x5416 TIOCMGET = 0x5415 TIOCMIWAIT = 0x545c TIOCMSET = 0x5418 TIOCM_CAR = 0x40 TIOCM_CD = 0x40 TIOCM_CTS = 0x20 TIOCM_DSR = 0x100 TIOCM_RI = 0x80 TIOCM_RNG = 0x80 TIOCM_SR = 0x10 TIOCM_ST = 0x8 TIOCNOTTY = 0x5422 TIOCNXCL = 0x540d TIOCOUTQ = 0x5411 TIOCPKT = 0x5420 TIOCSBRK = 0x5427 TIOCSCTTY = 0x540e TIOCSERCONFIG = 0x5453 TIOCSERGETLSR = 0x5459 TIOCSERGETMULTI = 0x545a TIOCSERGSTRUCT = 0x5458 TIOCSERGWILD = 0x5454 TIOCSERSETMULTI = 0x545b TIOCSERSWILD = 0x5455 TIOCSER_TEMT = 0x1 TIOCSETD = 0x5423 TIOCSIG = 0x40045436 TIOCSISO7816 = 0xc0285443 TIOCSLCKTRMIOS = 0x5457 TIOCSPGRP = 0x5410 TIOCSPTLCK = 0x40045431 TIOCSRS485 = 0x542f TIOCSSERIAL = 0x541f TIOCSSOFTCAR = 0x541a TIOCSTI = 0x5412 TIOCSWINSZ = 0x5414 TIOCVHANGUP = 0x5437 TOSTOP = 0x100 TPIDR2_MAGIC = 0x54504902 TUNATTACHFILTER = 0x401054d5 TUNDETACHFILTER = 0x401054d6 TUNGETDEVNETNS = 0x54e3 TUNGETFEATURES = 0x800454cf TUNGETFILTER = 0x801054db TUNGETIFF = 0x800454d2 TUNGETSNDBUF = 0x800454d3 TUNGETVNETBE = 0x800454df TUNGETVNETHDRSZ = 0x800454d7 TUNGETVNETLE = 0x800454dd TUNSETCARRIER = 0x400454e2 TUNSETDEBUG = 0x400454c9 TUNSETFILTEREBPF = 0x800454e1 TUNSETGROUP = 0x400454ce TUNSETIFF = 0x400454ca TUNSETIFINDEX = 0x400454da TUNSETLINK = 0x400454cd TUNSETNOCSUM = 0x400454c8 TUNSETOFFLOAD = 0x400454d0 TUNSETOWNER = 0x400454cc TUNSETPERSIST = 0x400454cb TUNSETQUEUE = 0x400454d9 TUNSETSNDBUF = 0x400454d4 TUNSETSTEERINGEBPF = 0x800454e0 TUNSETTXFILTER = 0x400454d1 TUNSETVNETBE = 0x400454de TUNSETVNETHDRSZ = 0x400454d8 TUNSETVNETLE = 0x400454dc UBI_IOCATT = 0x40186f40 UBI_IOCDET = 0x40046f41 UBI_IOCEBCH = 0x40044f02 UBI_IOCEBER = 0x40044f01 UBI_IOCEBISMAP = 0x80044f05 UBI_IOCEBMAP = 0x40084f03 UBI_IOCEBUNMAP = 0x40044f04 UBI_IOCMKVOL = 0x40986f00 UBI_IOCRMVOL = 0x40046f01 UBI_IOCRNVOL = 0x51106f03 UBI_IOCRPEB = 0x40046f04 UBI_IOCRSVOL = 0x400c6f02 UBI_IOCSETVOLPROP = 0x40104f06 UBI_IOCSPEB = 0x40046f05 UBI_IOCVOLCRBLK = 0x40804f07 UBI_IOCVOLRMBLK = 0x4f08 UBI_IOCVOLUP = 0x40084f00 VDISCARD = 0xd VEOF = 0x4 VEOL = 0xb VEOL2 = 0x10 VMIN = 0x6 VREPRINT = 0xc VSTART = 0x8 VSTOP = 0x9 VSUSP = 0xa VSWTC = 0x7 VT1 = 0x4000 VTDLY = 0x4000 VTIME = 0x5 VWERASE = 0xe WDIOC_GETBOOTSTATUS = 0x80045702 WDIOC_GETPRETIMEOUT = 0x80045709 WDIOC_GETSTATUS = 0x80045701 WDIOC_GETSUPPORT = 0x80285700 WDIOC_GETTEMP = 0x80045703 WDIOC_GETTIMELEFT = 0x8004570a WDIOC_GETTIMEOUT = 0x80045707 WDIOC_KEEPALIVE = 0x80045705 WDIOC_SETOPTIONS = 0x80045704 WORDSIZE = 0x40 XCASE = 0x4 XTABS = 0x1800 ZA_MAGIC = 0x54366345 ZT_MAGIC = 0x5a544e01 _HIDIOCGRAWNAME = 0x80804804 _HIDIOCGRAWPHYS = 0x80404805 _HIDIOCGRAWUNIQ = 0x80404808 ) // Errors const ( EADDRINUSE = syscall.Errno(0x62) EADDRNOTAVAIL = syscall.Errno(0x63) EADV = syscall.Errno(0x44) EAFNOSUPPORT = syscall.Errno(0x61) EALREADY = syscall.Errno(0x72) EBADE = syscall.Errno(0x34) EBADFD = syscall.Errno(0x4d) EBADMSG = syscall.Errno(0x4a) EBADR = syscall.Errno(0x35) EBADRQC = syscall.Errno(0x38) EBADSLT = syscall.Errno(0x39) EBFONT = syscall.Errno(0x3b) ECANCELED = syscall.Errno(0x7d) ECHRNG = syscall.Errno(0x2c) ECOMM = syscall.Errno(0x46) ECONNABORTED = syscall.Errno(0x67) ECONNREFUSED = syscall.Errno(0x6f) ECONNRESET = syscall.Errno(0x68) EDEADLK = syscall.Errno(0x23) EDEADLOCK = syscall.Errno(0x23) EDESTADDRREQ = syscall.Errno(0x59) EDOTDOT = syscall.Errno(0x49) EDQUOT = syscall.Errno(0x7a) EHOSTDOWN = syscall.Errno(0x70) EHOSTUNREACH = syscall.Errno(0x71) EHWPOISON = syscall.Errno(0x85) EIDRM = syscall.Errno(0x2b) EILSEQ = syscall.Errno(0x54) EINPROGRESS = syscall.Errno(0x73) EISCONN = syscall.Errno(0x6a) EISNAM = syscall.Errno(0x78) EKEYEXPIRED = syscall.Errno(0x7f) EKEYREJECTED = syscall.Errno(0x81) EKEYREVOKED = syscall.Errno(0x80) EL2HLT = syscall.Errno(0x33) EL2NSYNC = syscall.Errno(0x2d) EL3HLT = syscall.Errno(0x2e) EL3RST = syscall.Errno(0x2f) ELIBACC = syscall.Errno(0x4f) ELIBBAD = syscall.Errno(0x50) ELIBEXEC = syscall.Errno(0x53) ELIBMAX = syscall.Errno(0x52) ELIBSCN = syscall.Errno(0x51) ELNRNG = syscall.Errno(0x30) ELOOP = syscall.Errno(0x28) EMEDIUMTYPE = syscall.Errno(0x7c) EMSGSIZE = syscall.Errno(0x5a) EMULTIHOP = syscall.Errno(0x48) ENAMETOOLONG = syscall.Errno(0x24) ENAVAIL = syscall.Errno(0x77) ENETDOWN = syscall.Errno(0x64) ENETRESET = syscall.Errno(0x66) ENETUNREACH = syscall.Errno(0x65) ENOANO = syscall.Errno(0x37) ENOBUFS = syscall.Errno(0x69) ENOCSI = syscall.Errno(0x32) ENODATA = syscall.Errno(0x3d) ENOKEY = syscall.Errno(0x7e) ENOLCK = syscall.Errno(0x25) ENOLINK = syscall.Errno(0x43) ENOMEDIUM = syscall.Errno(0x7b) ENOMSG = syscall.Errno(0x2a) ENONET = syscall.Errno(0x40) ENOPKG = syscall.Errno(0x41) ENOPROTOOPT = syscall.Errno(0x5c) ENOSR = syscall.Errno(0x3f) ENOSTR = syscall.Errno(0x3c) ENOSYS = syscall.Errno(0x26) ENOTCONN = syscall.Errno(0x6b) ENOTEMPTY = syscall.Errno(0x27) ENOTNAM = syscall.Errno(0x76) ENOTRECOVERABLE = syscall.Errno(0x83) ENOTSOCK = syscall.Errno(0x58) ENOTSUP = syscall.Errno(0x5f) ENOTUNIQ = syscall.Errno(0x4c) EOPNOTSUPP = syscall.Errno(0x5f) EOVERFLOW = syscall.Errno(0x4b) EOWNERDEAD = syscall.Errno(0x82) EPFNOSUPPORT = syscall.Errno(0x60) EPROTO = syscall.Errno(0x47) EPROTONOSUPPORT = syscall.Errno(0x5d) EPROTOTYPE = syscall.Errno(0x5b) EREMCHG = syscall.Errno(0x4e) EREMOTE = syscall.Errno(0x42) EREMOTEIO = syscall.Errno(0x79) ERESTART = syscall.Errno(0x55) ERFKILL = syscall.Errno(0x84) ESHUTDOWN = syscall.Errno(0x6c) ESOCKTNOSUPPORT = syscall.Errno(0x5e) ESRMNT = syscall.Errno(0x45) ESTALE = syscall.Errno(0x74) ESTRPIPE = syscall.Errno(0x56) ETIME = syscall.Errno(0x3e) ETIMEDOUT = syscall.Errno(0x6e) ETOOMANYREFS = syscall.Errno(0x6d) EUCLEAN = syscall.Errno(0x75) EUNATCH = syscall.Errno(0x31) EUSERS = syscall.Errno(0x57) EXFULL = syscall.Errno(0x36) ) // Signals const ( SIGBUS = syscall.Signal(0x7) SIGCHLD = syscall.Signal(0x11) SIGCLD = syscall.Signal(0x11) SIGCONT = syscall.Signal(0x12) SIGIO = syscall.Signal(0x1d) SIGPOLL = syscall.Signal(0x1d) SIGPROF = syscall.Signal(0x1b) SIGPWR = syscall.Signal(0x1e) SIGSTKFLT = syscall.Signal(0x10) SIGSTOP = syscall.Signal(0x13) SIGSYS = syscall.Signal(0x1f) SIGTSTP = syscall.Signal(0x14) SIGTTIN = syscall.Signal(0x15) SIGTTOU = syscall.Signal(0x16) SIGURG = syscall.Signal(0x17) SIGUSR1 = syscall.Signal(0xa) SIGUSR2 = syscall.Signal(0xc) SIGVTALRM = syscall.Signal(0x1a) SIGWINCH = syscall.Signal(0x1c) SIGXCPU = syscall.Signal(0x18) SIGXFSZ = syscall.Signal(0x19) ) // Error table var errorList = [...]struct { num syscall.Errno name string desc string }{ {1, "EPERM", "operation not permitted"}, {2, "ENOENT", "no such file or directory"}, {3, "ESRCH", "no such process"}, {4, "EINTR", "interrupted system call"}, {5, "EIO", "input/output error"}, {6, "ENXIO", "no such device or address"}, {7, "E2BIG", "argument list too long"}, {8, "ENOEXEC", "exec format error"}, {9, "EBADF", "bad file descriptor"}, {10, "ECHILD", "no child processes"}, {11, "EAGAIN", "resource temporarily unavailable"}, {12, "ENOMEM", "cannot allocate memory"}, {13, "EACCES", "permission denied"}, {14, "EFAULT", "bad address"}, {15, "ENOTBLK", "block device required"}, {16, "EBUSY", "device or resource busy"}, {17, "EEXIST", "file exists"}, {18, "EXDEV", "invalid cross-device link"}, {19, "ENODEV", "no such device"}, {20, "ENOTDIR", "not a directory"}, {21, "EISDIR", "is a directory"}, {22, "EINVAL", "invalid argument"}, {23, "ENFILE", "too many open files in system"}, {24, "EMFILE", "too many open files"}, {25, "ENOTTY", "inappropriate ioctl for device"}, {26, "ETXTBSY", "text file busy"}, {27, "EFBIG", "file too large"}, {28, "ENOSPC", "no space left on device"}, {29, "ESPIPE", "illegal seek"}, {30, "EROFS", "read-only file system"}, {31, "EMLINK", "too many links"}, {32, "EPIPE", "broken pipe"}, {33, "EDOM", "numerical argument out of domain"}, {34, "ERANGE", "numerical result out of range"}, {35, "EDEADLK", "resource deadlock avoided"}, {36, "ENAMETOOLONG", "file name too long"}, {37, "ENOLCK", "no locks available"}, {38, "ENOSYS", "function not implemented"}, {39, "ENOTEMPTY", "directory not empty"}, {40, "ELOOP", "too many levels of symbolic links"}, {42, "ENOMSG", "no message of desired type"}, {43, "EIDRM", "identifier removed"}, {44, "ECHRNG", "channel number out of range"}, {45, "EL2NSYNC", "level 2 not synchronized"}, {46, "EL3HLT", "level 3 halted"}, {47, "EL3RST", "level 3 reset"}, {48, "ELNRNG", "link number out of range"}, {49, "EUNATCH", "protocol driver not attached"}, {50, "ENOCSI", "no CSI structure available"}, {51, "EL2HLT", "level 2 halted"}, {52, "EBADE", "invalid exchange"}, {53, "EBADR", "invalid request descriptor"}, {54, "EXFULL", "exchange full"}, {55, "ENOANO", "no anode"}, {56, "EBADRQC", "invalid request code"}, {57, "EBADSLT", "invalid slot"}, {59, "EBFONT", "bad font file format"}, {60, "ENOSTR", "device not a stream"}, {61, "ENODATA", "no data available"}, {62, "ETIME", "timer expired"}, {63, "ENOSR", "out of streams resources"}, {64, "ENONET", "machine is not on the network"}, {65, "ENOPKG", "package not installed"}, {66, "EREMOTE", "object is remote"}, {67, "ENOLINK", "link has been severed"}, {68, "EADV", "advertise error"}, {69, "ESRMNT", "srmount error"}, {70, "ECOMM", "communication error on send"}, {71, "EPROTO", "protocol error"}, {72, "EMULTIHOP", "multihop attempted"}, {73, "EDOTDOT", "RFS specific error"}, {74, "EBADMSG", "bad message"}, {75, "EOVERFLOW", "value too large for defined data type"}, {76, "ENOTUNIQ", "name not unique on network"}, {77, "EBADFD", "file descriptor in bad state"}, {78, "EREMCHG", "remote address changed"}, {79, "ELIBACC", "can not access a needed shared library"}, {80, "ELIBBAD", "accessing a corrupted shared library"}, {81, "ELIBSCN", ".lib section in a.out corrupted"}, {82, "ELIBMAX", "attempting to link in too many shared libraries"}, {83, "ELIBEXEC", "cannot exec a shared library directly"}, {84, "EILSEQ", "invalid or incomplete multibyte or wide character"}, {85, "ERESTART", "interrupted system call should be restarted"}, {86, "ESTRPIPE", "streams pipe error"}, {87, "EUSERS", "too many users"}, {88, "ENOTSOCK", "socket operation on non-socket"}, {89, "EDESTADDRREQ", "destination address required"}, {90, "EMSGSIZE", "message too long"}, {91, "EPROTOTYPE", "protocol wrong type for socket"}, {92, "ENOPROTOOPT", "protocol not available"}, {93, "EPROTONOSUPPORT", "protocol not supported"}, {94, "ESOCKTNOSUPPORT", "socket type not supported"}, {95, "ENOTSUP", "operation not supported"}, {96, "EPFNOSUPPORT", "protocol family not supported"}, {97, "EAFNOSUPPORT", "address family not supported by protocol"}, {98, "EADDRINUSE", "address already in use"}, {99, "EADDRNOTAVAIL", "cannot assign requested address"}, {100, "ENETDOWN", "network is down"}, {101, "ENETUNREACH", "network is unreachable"}, {102, "ENETRESET", "network dropped connection on reset"}, {103, "ECONNABORTED", "software caused connection abort"}, {104, "ECONNRESET", "connection reset by peer"}, {105, "ENOBUFS", "no buffer space available"}, {106, "EISCONN", "transport endpoint is already connected"}, {107, "ENOTCONN", "transport endpoint is not connected"}, {108, "ESHUTDOWN", "cannot send after transport endpoint shutdown"}, {109, "ETOOMANYREFS", "too many references: cannot splice"}, {110, "ETIMEDOUT", "connection timed out"}, {111, "ECONNREFUSED", "connection refused"}, {112, "EHOSTDOWN", "host is down"}, {113, "EHOSTUNREACH", "no route to host"}, {114, "EALREADY", "operation already in progress"}, {115, "EINPROGRESS", "operation now in progress"}, {116, "ESTALE", "stale file handle"}, {117, "EUCLEAN", "structure needs cleaning"}, {118, "ENOTNAM", "not a XENIX named type file"}, {119, "ENAVAIL", "no XENIX semaphores available"}, {120, "EISNAM", "is a named type file"}, {121, "EREMOTEIO", "remote I/O error"}, {122, "EDQUOT", "disk quota exceeded"}, {123, "ENOMEDIUM", "no medium found"}, {124, "EMEDIUMTYPE", "wrong medium type"}, {125, "ECANCELED", "operation canceled"}, {126, "ENOKEY", "required key not available"}, {127, "EKEYEXPIRED", "key has expired"}, {128, "EKEYREVOKED", "key has been revoked"}, {129, "EKEYREJECTED", "key was rejected by service"}, {130, "EOWNERDEAD", "owner died"}, {131, "ENOTRECOVERABLE", "state not recoverable"}, {132, "ERFKILL", "operation not possible due to RF-kill"}, {133, "EHWPOISON", "memory page has hardware error"}, } // Signal table var signalList = [...]struct { num syscall.Signal name string desc string }{ {1, "SIGHUP", "hangup"}, {2, "SIGINT", "interrupt"}, {3, "SIGQUIT", "quit"}, {4, "SIGILL", "illegal instruction"}, {5, "SIGTRAP", "trace/breakpoint trap"}, {6, "SIGABRT", "aborted"}, {7, "SIGBUS", "bus error"}, {8, "SIGFPE", "floating point exception"}, {9, "SIGKILL", "killed"}, {10, "SIGUSR1", "user defined signal 1"}, {11, "SIGSEGV", "segmentation fault"}, {12, "SIGUSR2", "user defined signal 2"}, {13, "SIGPIPE", "broken pipe"}, {14, "SIGALRM", "alarm clock"}, {15, "SIGTERM", "terminated"}, {16, "SIGSTKFLT", "stack fault"}, {17, "SIGCHLD", "child exited"}, {18, "SIGCONT", "continued"}, {19, "SIGSTOP", "stopped (signal)"}, {20, "SIGTSTP", "stopped"}, {21, "SIGTTIN", "stopped (tty input)"}, {22, "SIGTTOU", "stopped (tty output)"}, {23, "SIGURG", "urgent I/O condition"}, {24, "SIGXCPU", "CPU time limit exceeded"}, {25, "SIGXFSZ", "file size limit exceeded"}, {26, "SIGVTALRM", "virtual timer expired"}, {27, "SIGPROF", "profiling timer expired"}, {28, "SIGWINCH", "window changed"}, {29, "SIGIO", "I/O possible"}, {30, "SIGPWR", "power failure"}, {31, "SIGSYS", "bad system call"}, } ================================================ FILE: vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go ================================================ // mkerrors.sh -Wall -Werror -static -I/tmp/loong64/include // Code generated by the command above; see README.md. DO NOT EDIT. //go:build loong64 && linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -Wall -Werror -static -I/tmp/loong64/include _const.go package unix import "syscall" const ( B1000000 = 0x1008 B115200 = 0x1002 B1152000 = 0x1009 B1500000 = 0x100a B2000000 = 0x100b B230400 = 0x1003 B2500000 = 0x100c B3000000 = 0x100d B3500000 = 0x100e B4000000 = 0x100f B460800 = 0x1004 B500000 = 0x1005 B57600 = 0x1001 B576000 = 0x1006 B921600 = 0x1007 BLKALIGNOFF = 0x127a BLKBSZGET = 0x80081270 BLKBSZSET = 0x40081271 BLKDISCARD = 0x1277 BLKDISCARDZEROES = 0x127c BLKFLSBUF = 0x1261 BLKFRAGET = 0x1265 BLKFRASET = 0x1264 BLKGETDISKSEQ = 0x80081280 BLKGETSIZE = 0x1260 BLKGETSIZE64 = 0x80081272 BLKIOMIN = 0x1278 BLKIOOPT = 0x1279 BLKPBSZGET = 0x127b BLKRAGET = 0x1263 BLKRASET = 0x1262 BLKROGET = 0x125e BLKROSET = 0x125d BLKROTATIONAL = 0x127e BLKRRPART = 0x125f BLKSECDISCARD = 0x127d BLKSECTGET = 0x1267 BLKSECTSET = 0x1266 BLKSSZGET = 0x1268 BLKZEROOUT = 0x127f BOTHER = 0x1000 BS1 = 0x2000 BSDLY = 0x2000 CBAUD = 0x100f CBAUDEX = 0x1000 CIBAUD = 0x100f0000 CLOCAL = 0x800 CR1 = 0x200 CR2 = 0x400 CR3 = 0x600 CRDLY = 0x600 CREAD = 0x80 CS6 = 0x10 CS7 = 0x20 CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 DM_MPATH_PROBE_PATHS = 0xfd12 ECCGETLAYOUT = 0x81484d11 ECCGETSTATS = 0x80104d12 ECHOCTL = 0x200 ECHOE = 0x10 ECHOK = 0x20 ECHOKE = 0x800 ECHONL = 0x40 ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 EPIOCGPARAMS = 0x80088a02 EPIOCSPARAMS = 0x40088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 FFDLY = 0x8000 FICLONE = 0x40049409 FICLONERANGE = 0x4020940d FLUSHO = 0x1000 FPU_CTX_MAGIC = 0x46505501 FS_IOC_ENABLE_VERITY = 0x40806685 FS_IOC_GETFLAGS = 0x80086601 FS_IOC_GET_ENCRYPTION_NONCE = 0x8010661b FS_IOC_GET_ENCRYPTION_POLICY = 0x400c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x40106614 FS_IOC_SETFLAGS = 0x40086602 FS_IOC_SET_ENCRYPTION_POLICY = 0x800c6613 F_GETLK = 0x5 F_GETLK64 = 0x5 F_GETOWN = 0x9 F_RDLCK = 0x0 F_SETLK = 0x6 F_SETLK64 = 0x6 F_SETLKW = 0x7 F_SETLKW64 = 0x7 F_SETOWN = 0x8 F_UNLCK = 0x2 F_WRLCK = 0x1 HIDIOCGRAWINFO = 0x80084803 HIDIOCGRDESC = 0x90044802 HIDIOCGRDESCSIZE = 0x80044801 HIDIOCREVOKE = 0x4004480d HUPCL = 0x400 ICANON = 0x2 IEXTEN = 0x8000 IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x800 IOCTL_MEI_NOTIFY_GET = 0x80044803 IOCTL_MEI_NOTIFY_SET = 0x40044802 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x7b9 IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_MASK = 0xffff0f00 ISIG = 0x1 IUCLC = 0x200 IXOFF = 0x1000 IXON = 0x400 LASX_CTX_MAGIC = 0x41535801 LBT_CTX_MAGIC = 0x42540001 LSX_CTX_MAGIC = 0x53580001 MAP_ANON = 0x20 MAP_ANONYMOUS = 0x20 MAP_DENYWRITE = 0x800 MAP_EXECUTABLE = 0x1000 MAP_GROWSDOWN = 0x100 MAP_HUGETLB = 0x40000 MAP_LOCKED = 0x2000 MAP_NONBLOCK = 0x10000 MAP_NORESERVE = 0x4000 MAP_POPULATE = 0x8000 MAP_STACK = 0x20000 MAP_SYNC = 0x80000 MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MCL_ONFAULT = 0x4 MEMERASE = 0x40084d02 MEMERASE64 = 0x40104d14 MEMGETBADBLOCK = 0x40084d0b MEMGETINFO = 0x80204d01 MEMGETOOBSEL = 0x80c84d0a MEMGETREGIONCOUNT = 0x80044d07 MEMISLOCKED = 0x80084d17 MEMLOCK = 0x40084d05 MEMREAD = 0xc0404d1a MEMREADOOB = 0xc0104d04 MEMSETBADBLOCK = 0x40084d0c MEMUNLOCK = 0x40084d06 MEMWRITEOOB = 0xc0104d03 MTDFILEMODE = 0x4d13 NFDBITS = 0x40 NLDLY = 0x100 NOFLSH = 0x80 NS_GET_MNTNS_ID = 0x8008b705 NS_GET_NSTYPE = 0xb703 NS_GET_OWNER_UID = 0xb704 NS_GET_PARENT = 0xb702 NS_GET_PID_FROM_PIDNS = 0x8004b706 NS_GET_PID_IN_PIDNS = 0x8004b708 NS_GET_TGID_FROM_PIDNS = 0x8004b707 NS_GET_TGID_IN_PIDNS = 0x8004b709 NS_GET_USERNS = 0xb701 OLCUC = 0x2 ONLCR = 0x4 OTPERASE = 0x400c4d19 OTPGETREGIONCOUNT = 0x40044d0e OTPGETREGIONINFO = 0x400c4d0f OTPLOCK = 0x800c4d10 OTPSELECT = 0x80044d0d O_APPEND = 0x400 O_ASYNC = 0x2000 O_CLOEXEC = 0x80000 O_CREAT = 0x40 O_DIRECT = 0x4000 O_DIRECTORY = 0x10000 O_DSYNC = 0x1000 O_EXCL = 0x80 O_FSYNC = 0x101000 O_LARGEFILE = 0x0 O_NDELAY = 0x800 O_NOATIME = 0x40000 O_NOCTTY = 0x100 O_NOFOLLOW = 0x20000 O_NONBLOCK = 0x800 O_PATH = 0x200000 O_RSYNC = 0x101000 O_SYNC = 0x101000 O_TMPFILE = 0x410000 O_TRUNC = 0x200 PARENB = 0x100 PARODD = 0x200 PENDIN = 0x4000 PERF_EVENT_IOC_DISABLE = 0x2401 PERF_EVENT_IOC_ENABLE = 0x2400 PERF_EVENT_IOC_ID = 0x80082407 PERF_EVENT_IOC_MODIFY_ATTRIBUTES = 0x4008240b PERF_EVENT_IOC_PAUSE_OUTPUT = 0x40042409 PERF_EVENT_IOC_PERIOD = 0x40082404 PERF_EVENT_IOC_QUERY_BPF = 0xc008240a PERF_EVENT_IOC_REFRESH = 0x2402 PERF_EVENT_IOC_RESET = 0x2403 PERF_EVENT_IOC_SET_BPF = 0x40042408 PERF_EVENT_IOC_SET_FILTER = 0x40082406 PERF_EVENT_IOC_SET_OUTPUT = 0x2405 PPPIOCATTACH = 0x4004743d PPPIOCATTCHAN = 0x40047438 PPPIOCBRIDGECHAN = 0x40047435 PPPIOCCONNECT = 0x4004743a PPPIOCDETACH = 0x4004743c PPPIOCDISCONN = 0x7439 PPPIOCGASYNCMAP = 0x80047458 PPPIOCGCHAN = 0x80047437 PPPIOCGDEBUG = 0x80047441 PPPIOCGFLAGS = 0x8004745a PPPIOCGIDLE = 0x8010743f PPPIOCGIDLE32 = 0x8008743f PPPIOCGIDLE64 = 0x8010743f PPPIOCGL2TPSTATS = 0x80487436 PPPIOCGMRU = 0x80047453 PPPIOCGRASYNCMAP = 0x80047455 PPPIOCGUNIT = 0x80047456 PPPIOCGXASYNCMAP = 0x80207450 PPPIOCSACTIVE = 0x40107446 PPPIOCSASYNCMAP = 0x40047457 PPPIOCSCOMPRESS = 0x4010744d PPPIOCSDEBUG = 0x40047440 PPPIOCSFLAGS = 0x40047459 PPPIOCSMAXCID = 0x40047451 PPPIOCSMRRU = 0x4004743b PPPIOCSMRU = 0x40047452 PPPIOCSNPMODE = 0x4008744b PPPIOCSPASS = 0x40107447 PPPIOCSRASYNCMAP = 0x40047454 PPPIOCSXASYNCMAP = 0x4020744f PPPIOCUNBRIDGECHAN = 0x7434 PPPIOCXFERUNIT = 0x744e PR_SET_PTRACER_ANY = 0xffffffffffffffff PTP_CLOCK_GETCAPS = 0x80503d01 PTP_CLOCK_GETCAPS2 = 0x80503d0a PTP_ENABLE_PPS = 0x40043d04 PTP_ENABLE_PPS2 = 0x40043d0d PTP_EXTTS_REQUEST = 0x40103d02 PTP_EXTTS_REQUEST2 = 0x40103d0b PTP_MASK_CLEAR_ALL = 0x3d13 PTP_MASK_EN_SINGLE = 0x40043d14 PTP_PEROUT_REQUEST = 0x40383d03 PTP_PEROUT_REQUEST2 = 0x40383d0c PTP_PIN_SETFUNC = 0x40603d07 PTP_PIN_SETFUNC2 = 0x40603d10 PTP_SYS_OFFSET = 0x43403d05 PTP_SYS_OFFSET2 = 0x43403d0e PTRACE_SYSEMU = 0x1f PTRACE_SYSEMU_SINGLESTEP = 0x20 RLIMIT_AS = 0x9 RLIMIT_MEMLOCK = 0x8 RLIMIT_NOFILE = 0x7 RLIMIT_NPROC = 0x6 RLIMIT_RSS = 0x5 RNDADDENTROPY = 0x40085203 RNDADDTOENTCNT = 0x40045201 RNDCLEARPOOL = 0x5206 RNDGETENTCNT = 0x80045200 RNDGETPOOL = 0x80085202 RNDRESEEDCRNG = 0x5207 RNDZAPENTCNT = 0x5204 RTC_AIE_OFF = 0x7002 RTC_AIE_ON = 0x7001 RTC_ALM_READ = 0x80247008 RTC_ALM_SET = 0x40247007 RTC_EPOCH_READ = 0x8008700d RTC_EPOCH_SET = 0x4008700e RTC_IRQP_READ = 0x8008700b RTC_IRQP_SET = 0x4008700c RTC_PARAM_GET = 0x40187013 RTC_PARAM_SET = 0x40187014 RTC_PIE_OFF = 0x7006 RTC_PIE_ON = 0x7005 RTC_PLL_GET = 0x80207011 RTC_PLL_SET = 0x40207012 RTC_RD_TIME = 0x80247009 RTC_SET_TIME = 0x4024700a RTC_UIE_OFF = 0x7004 RTC_UIE_ON = 0x7003 RTC_VL_CLR = 0x7014 RTC_VL_READ = 0x80047013 RTC_WIE_OFF = 0x7010 RTC_WIE_ON = 0x700f RTC_WKALM_RD = 0x80287010 RTC_WKALM_SET = 0x4028700f SCM_DEVMEM_DMABUF = 0x4f SCM_DEVMEM_LINEAR = 0x4e SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a SCM_TIMESTAMPNS = 0x23 SCM_TS_OPT_ID = 0x51 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 SECCOMP_IOCTL_NOTIF_ADDFD = 0x40182103 SECCOMP_IOCTL_NOTIF_ID_VALID = 0x40082102 SECCOMP_IOCTL_NOTIF_SET_FLAGS = 0x40082104 SFD_CLOEXEC = 0x80000 SFD_NONBLOCK = 0x800 SIOCATMARK = 0x8905 SIOCGPGRP = 0x8904 SIOCGSTAMPNS_NEW = 0x80108907 SIOCGSTAMP_NEW = 0x80108906 SIOCINQ = 0x541b SIOCOUTQ = 0x5411 SIOCSPGRP = 0x8902 SOCK_CLOEXEC = 0x80000 SOCK_DGRAM = 0x2 SOCK_NONBLOCK = 0x800 SOCK_STREAM = 0x1 SOL_SOCKET = 0x1 SO_ACCEPTCONN = 0x1e SO_ATTACH_BPF = 0x32 SO_ATTACH_REUSEPORT_CBPF = 0x33 SO_ATTACH_REUSEPORT_EBPF = 0x34 SO_BINDTODEVICE = 0x19 SO_BINDTOIFINDEX = 0x3e SO_BPF_EXTENSIONS = 0x30 SO_BROADCAST = 0x6 SO_BSDCOMPAT = 0xe SO_BUF_LOCK = 0x48 SO_BUSY_POLL = 0x2e SO_BUSY_POLL_BUDGET = 0x46 SO_CNX_ADVICE = 0x35 SO_COOKIE = 0x39 SO_DETACH_REUSEPORT_BPF = 0x44 SO_DEVMEM_DMABUF = 0x4f SO_DEVMEM_DONTNEED = 0x50 SO_DEVMEM_LINEAR = 0x4e SO_DOMAIN = 0x27 SO_DONTROUTE = 0x5 SO_ERROR = 0x4 SO_INCOMING_CPU = 0x31 SO_INCOMING_NAPI_ID = 0x38 SO_KEEPALIVE = 0x9 SO_LINGER = 0xd SO_LOCK_FILTER = 0x2c SO_MARK = 0x24 SO_MAX_PACING_RATE = 0x2f SO_MEMINFO = 0x37 SO_NETNS_COOKIE = 0x47 SO_NOFCS = 0x2b SO_OOBINLINE = 0xa SO_PASSCRED = 0x10 SO_PASSPIDFD = 0x4c SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x11 SO_PEERGROUPS = 0x3b SO_PEERPIDFD = 0x4d SO_PEERSEC = 0x1f SO_PREFER_BUSY_POLL = 0x45 SO_PROTOCOL = 0x26 SO_RCVBUF = 0x8 SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x12 SO_RCVMARK = 0x4b SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x14 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x14 SO_RESERVE_MEM = 0x49 SO_REUSEADDR = 0x2 SO_REUSEPORT = 0xf SO_RXQ_OVFL = 0x28 SO_SECURITY_AUTHENTICATION = 0x16 SO_SECURITY_ENCRYPTION_NETWORK = 0x18 SO_SECURITY_ENCRYPTION_TRANSPORT = 0x17 SO_SELECT_ERR_QUEUE = 0x2d SO_SNDBUF = 0x7 SO_SNDBUFFORCE = 0x20 SO_SNDLOWAT = 0x13 SO_SNDTIMEO = 0x15 SO_SNDTIMEO_NEW = 0x43 SO_SNDTIMEO_OLD = 0x15 SO_TIMESTAMPING = 0x25 SO_TIMESTAMPING_NEW = 0x41 SO_TIMESTAMPING_OLD = 0x25 SO_TIMESTAMPNS = 0x23 SO_TIMESTAMPNS_NEW = 0x40 SO_TIMESTAMPNS_OLD = 0x23 SO_TIMESTAMP_NEW = 0x3f SO_TXREHASH = 0x4a SO_TXTIME = 0x3d SO_TYPE = 0x3 SO_WIFI_STATUS = 0x29 SO_ZEROCOPY = 0x3c TAB1 = 0x800 TAB2 = 0x1000 TAB3 = 0x1800 TABDLY = 0x1800 TCFLSH = 0x540b TCGETA = 0x5405 TCGETS = 0x5401 TCGETS2 = 0x802c542a TCGETX = 0x5432 TCSAFLUSH = 0x2 TCSBRK = 0x5409 TCSBRKP = 0x5425 TCSETA = 0x5406 TCSETAF = 0x5408 TCSETAW = 0x5407 TCSETS = 0x5402 TCSETS2 = 0x402c542b TCSETSF = 0x5404 TCSETSF2 = 0x402c542d TCSETSW = 0x5403 TCSETSW2 = 0x402c542c TCSETX = 0x5433 TCSETXF = 0x5434 TCSETXW = 0x5435 TCXONC = 0x540a TFD_CLOEXEC = 0x80000 TFD_NONBLOCK = 0x800 TIOCCBRK = 0x5428 TIOCCONS = 0x541d TIOCEXCL = 0x540c TIOCGDEV = 0x80045432 TIOCGETD = 0x5424 TIOCGEXCL = 0x80045440 TIOCGICOUNT = 0x545d TIOCGISO7816 = 0x80285442 TIOCGLCKTRMIOS = 0x5456 TIOCGPGRP = 0x540f TIOCGPKT = 0x80045438 TIOCGPTLCK = 0x80045439 TIOCGPTN = 0x80045430 TIOCGPTPEER = 0x5441 TIOCGRS485 = 0x542e TIOCGSERIAL = 0x541e TIOCGSID = 0x5429 TIOCGSOFTCAR = 0x5419 TIOCGWINSZ = 0x5413 TIOCINQ = 0x541b TIOCLINUX = 0x541c TIOCMBIC = 0x5417 TIOCMBIS = 0x5416 TIOCMGET = 0x5415 TIOCMIWAIT = 0x545c TIOCMSET = 0x5418 TIOCM_CAR = 0x40 TIOCM_CD = 0x40 TIOCM_CTS = 0x20 TIOCM_DSR = 0x100 TIOCM_RI = 0x80 TIOCM_RNG = 0x80 TIOCM_SR = 0x10 TIOCM_ST = 0x8 TIOCNOTTY = 0x5422 TIOCNXCL = 0x540d TIOCOUTQ = 0x5411 TIOCPKT = 0x5420 TIOCSBRK = 0x5427 TIOCSCTTY = 0x540e TIOCSERCONFIG = 0x5453 TIOCSERGETLSR = 0x5459 TIOCSERGETMULTI = 0x545a TIOCSERGSTRUCT = 0x5458 TIOCSERGWILD = 0x5454 TIOCSERSETMULTI = 0x545b TIOCSERSWILD = 0x5455 TIOCSER_TEMT = 0x1 TIOCSETD = 0x5423 TIOCSIG = 0x40045436 TIOCSISO7816 = 0xc0285443 TIOCSLCKTRMIOS = 0x5457 TIOCSPGRP = 0x5410 TIOCSPTLCK = 0x40045431 TIOCSRS485 = 0x542f TIOCSSERIAL = 0x541f TIOCSSOFTCAR = 0x541a TIOCSTI = 0x5412 TIOCSWINSZ = 0x5414 TIOCVHANGUP = 0x5437 TOSTOP = 0x100 TUNATTACHFILTER = 0x401054d5 TUNDETACHFILTER = 0x401054d6 TUNGETDEVNETNS = 0x54e3 TUNGETFEATURES = 0x800454cf TUNGETFILTER = 0x801054db TUNGETIFF = 0x800454d2 TUNGETSNDBUF = 0x800454d3 TUNGETVNETBE = 0x800454df TUNGETVNETHDRSZ = 0x800454d7 TUNGETVNETLE = 0x800454dd TUNSETCARRIER = 0x400454e2 TUNSETDEBUG = 0x400454c9 TUNSETFILTEREBPF = 0x800454e1 TUNSETGROUP = 0x400454ce TUNSETIFF = 0x400454ca TUNSETIFINDEX = 0x400454da TUNSETLINK = 0x400454cd TUNSETNOCSUM = 0x400454c8 TUNSETOFFLOAD = 0x400454d0 TUNSETOWNER = 0x400454cc TUNSETPERSIST = 0x400454cb TUNSETQUEUE = 0x400454d9 TUNSETSNDBUF = 0x400454d4 TUNSETSTEERINGEBPF = 0x800454e0 TUNSETTXFILTER = 0x400454d1 TUNSETVNETBE = 0x400454de TUNSETVNETHDRSZ = 0x400454d8 TUNSETVNETLE = 0x400454dc UBI_IOCATT = 0x40186f40 UBI_IOCDET = 0x40046f41 UBI_IOCEBCH = 0x40044f02 UBI_IOCEBER = 0x40044f01 UBI_IOCEBISMAP = 0x80044f05 UBI_IOCEBMAP = 0x40084f03 UBI_IOCEBUNMAP = 0x40044f04 UBI_IOCMKVOL = 0x40986f00 UBI_IOCRMVOL = 0x40046f01 UBI_IOCRNVOL = 0x51106f03 UBI_IOCRPEB = 0x40046f04 UBI_IOCRSVOL = 0x400c6f02 UBI_IOCSETVOLPROP = 0x40104f06 UBI_IOCSPEB = 0x40046f05 UBI_IOCVOLCRBLK = 0x40804f07 UBI_IOCVOLRMBLK = 0x4f08 UBI_IOCVOLUP = 0x40084f00 VDISCARD = 0xd VEOF = 0x4 VEOL = 0xb VEOL2 = 0x10 VMIN = 0x6 VREPRINT = 0xc VSTART = 0x8 VSTOP = 0x9 VSUSP = 0xa VSWTC = 0x7 VT1 = 0x4000 VTDLY = 0x4000 VTIME = 0x5 VWERASE = 0xe WDIOC_GETBOOTSTATUS = 0x80045702 WDIOC_GETPRETIMEOUT = 0x80045709 WDIOC_GETSTATUS = 0x80045701 WDIOC_GETSUPPORT = 0x80285700 WDIOC_GETTEMP = 0x80045703 WDIOC_GETTIMELEFT = 0x8004570a WDIOC_GETTIMEOUT = 0x80045707 WDIOC_KEEPALIVE = 0x80045705 WDIOC_SETOPTIONS = 0x80045704 WORDSIZE = 0x40 XCASE = 0x4 XTABS = 0x1800 _HIDIOCGRAWNAME = 0x80804804 _HIDIOCGRAWPHYS = 0x80404805 _HIDIOCGRAWUNIQ = 0x80404808 ) // Errors const ( EADDRINUSE = syscall.Errno(0x62) EADDRNOTAVAIL = syscall.Errno(0x63) EADV = syscall.Errno(0x44) EAFNOSUPPORT = syscall.Errno(0x61) EALREADY = syscall.Errno(0x72) EBADE = syscall.Errno(0x34) EBADFD = syscall.Errno(0x4d) EBADMSG = syscall.Errno(0x4a) EBADR = syscall.Errno(0x35) EBADRQC = syscall.Errno(0x38) EBADSLT = syscall.Errno(0x39) EBFONT = syscall.Errno(0x3b) ECANCELED = syscall.Errno(0x7d) ECHRNG = syscall.Errno(0x2c) ECOMM = syscall.Errno(0x46) ECONNABORTED = syscall.Errno(0x67) ECONNREFUSED = syscall.Errno(0x6f) ECONNRESET = syscall.Errno(0x68) EDEADLK = syscall.Errno(0x23) EDEADLOCK = syscall.Errno(0x23) EDESTADDRREQ = syscall.Errno(0x59) EDOTDOT = syscall.Errno(0x49) EDQUOT = syscall.Errno(0x7a) EHOSTDOWN = syscall.Errno(0x70) EHOSTUNREACH = syscall.Errno(0x71) EHWPOISON = syscall.Errno(0x85) EIDRM = syscall.Errno(0x2b) EILSEQ = syscall.Errno(0x54) EINPROGRESS = syscall.Errno(0x73) EISCONN = syscall.Errno(0x6a) EISNAM = syscall.Errno(0x78) EKEYEXPIRED = syscall.Errno(0x7f) EKEYREJECTED = syscall.Errno(0x81) EKEYREVOKED = syscall.Errno(0x80) EL2HLT = syscall.Errno(0x33) EL2NSYNC = syscall.Errno(0x2d) EL3HLT = syscall.Errno(0x2e) EL3RST = syscall.Errno(0x2f) ELIBACC = syscall.Errno(0x4f) ELIBBAD = syscall.Errno(0x50) ELIBEXEC = syscall.Errno(0x53) ELIBMAX = syscall.Errno(0x52) ELIBSCN = syscall.Errno(0x51) ELNRNG = syscall.Errno(0x30) ELOOP = syscall.Errno(0x28) EMEDIUMTYPE = syscall.Errno(0x7c) EMSGSIZE = syscall.Errno(0x5a) EMULTIHOP = syscall.Errno(0x48) ENAMETOOLONG = syscall.Errno(0x24) ENAVAIL = syscall.Errno(0x77) ENETDOWN = syscall.Errno(0x64) ENETRESET = syscall.Errno(0x66) ENETUNREACH = syscall.Errno(0x65) ENOANO = syscall.Errno(0x37) ENOBUFS = syscall.Errno(0x69) ENOCSI = syscall.Errno(0x32) ENODATA = syscall.Errno(0x3d) ENOKEY = syscall.Errno(0x7e) ENOLCK = syscall.Errno(0x25) ENOLINK = syscall.Errno(0x43) ENOMEDIUM = syscall.Errno(0x7b) ENOMSG = syscall.Errno(0x2a) ENONET = syscall.Errno(0x40) ENOPKG = syscall.Errno(0x41) ENOPROTOOPT = syscall.Errno(0x5c) ENOSR = syscall.Errno(0x3f) ENOSTR = syscall.Errno(0x3c) ENOSYS = syscall.Errno(0x26) ENOTCONN = syscall.Errno(0x6b) ENOTEMPTY = syscall.Errno(0x27) ENOTNAM = syscall.Errno(0x76) ENOTRECOVERABLE = syscall.Errno(0x83) ENOTSOCK = syscall.Errno(0x58) ENOTSUP = syscall.Errno(0x5f) ENOTUNIQ = syscall.Errno(0x4c) EOPNOTSUPP = syscall.Errno(0x5f) EOVERFLOW = syscall.Errno(0x4b) EOWNERDEAD = syscall.Errno(0x82) EPFNOSUPPORT = syscall.Errno(0x60) EPROTO = syscall.Errno(0x47) EPROTONOSUPPORT = syscall.Errno(0x5d) EPROTOTYPE = syscall.Errno(0x5b) EREMCHG = syscall.Errno(0x4e) EREMOTE = syscall.Errno(0x42) EREMOTEIO = syscall.Errno(0x79) ERESTART = syscall.Errno(0x55) ERFKILL = syscall.Errno(0x84) ESHUTDOWN = syscall.Errno(0x6c) ESOCKTNOSUPPORT = syscall.Errno(0x5e) ESRMNT = syscall.Errno(0x45) ESTALE = syscall.Errno(0x74) ESTRPIPE = syscall.Errno(0x56) ETIME = syscall.Errno(0x3e) ETIMEDOUT = syscall.Errno(0x6e) ETOOMANYREFS = syscall.Errno(0x6d) EUCLEAN = syscall.Errno(0x75) EUNATCH = syscall.Errno(0x31) EUSERS = syscall.Errno(0x57) EXFULL = syscall.Errno(0x36) ) // Signals const ( SIGBUS = syscall.Signal(0x7) SIGCHLD = syscall.Signal(0x11) SIGCLD = syscall.Signal(0x11) SIGCONT = syscall.Signal(0x12) SIGIO = syscall.Signal(0x1d) SIGPOLL = syscall.Signal(0x1d) SIGPROF = syscall.Signal(0x1b) SIGPWR = syscall.Signal(0x1e) SIGSTKFLT = syscall.Signal(0x10) SIGSTOP = syscall.Signal(0x13) SIGSYS = syscall.Signal(0x1f) SIGTSTP = syscall.Signal(0x14) SIGTTIN = syscall.Signal(0x15) SIGTTOU = syscall.Signal(0x16) SIGURG = syscall.Signal(0x17) SIGUSR1 = syscall.Signal(0xa) SIGUSR2 = syscall.Signal(0xc) SIGVTALRM = syscall.Signal(0x1a) SIGWINCH = syscall.Signal(0x1c) SIGXCPU = syscall.Signal(0x18) SIGXFSZ = syscall.Signal(0x19) ) // Error table var errorList = [...]struct { num syscall.Errno name string desc string }{ {1, "EPERM", "operation not permitted"}, {2, "ENOENT", "no such file or directory"}, {3, "ESRCH", "no such process"}, {4, "EINTR", "interrupted system call"}, {5, "EIO", "input/output error"}, {6, "ENXIO", "no such device or address"}, {7, "E2BIG", "argument list too long"}, {8, "ENOEXEC", "exec format error"}, {9, "EBADF", "bad file descriptor"}, {10, "ECHILD", "no child processes"}, {11, "EAGAIN", "resource temporarily unavailable"}, {12, "ENOMEM", "cannot allocate memory"}, {13, "EACCES", "permission denied"}, {14, "EFAULT", "bad address"}, {15, "ENOTBLK", "block device required"}, {16, "EBUSY", "device or resource busy"}, {17, "EEXIST", "file exists"}, {18, "EXDEV", "invalid cross-device link"}, {19, "ENODEV", "no such device"}, {20, "ENOTDIR", "not a directory"}, {21, "EISDIR", "is a directory"}, {22, "EINVAL", "invalid argument"}, {23, "ENFILE", "too many open files in system"}, {24, "EMFILE", "too many open files"}, {25, "ENOTTY", "inappropriate ioctl for device"}, {26, "ETXTBSY", "text file busy"}, {27, "EFBIG", "file too large"}, {28, "ENOSPC", "no space left on device"}, {29, "ESPIPE", "illegal seek"}, {30, "EROFS", "read-only file system"}, {31, "EMLINK", "too many links"}, {32, "EPIPE", "broken pipe"}, {33, "EDOM", "numerical argument out of domain"}, {34, "ERANGE", "numerical result out of range"}, {35, "EDEADLK", "resource deadlock avoided"}, {36, "ENAMETOOLONG", "file name too long"}, {37, "ENOLCK", "no locks available"}, {38, "ENOSYS", "function not implemented"}, {39, "ENOTEMPTY", "directory not empty"}, {40, "ELOOP", "too many levels of symbolic links"}, {42, "ENOMSG", "no message of desired type"}, {43, "EIDRM", "identifier removed"}, {44, "ECHRNG", "channel number out of range"}, {45, "EL2NSYNC", "level 2 not synchronized"}, {46, "EL3HLT", "level 3 halted"}, {47, "EL3RST", "level 3 reset"}, {48, "ELNRNG", "link number out of range"}, {49, "EUNATCH", "protocol driver not attached"}, {50, "ENOCSI", "no CSI structure available"}, {51, "EL2HLT", "level 2 halted"}, {52, "EBADE", "invalid exchange"}, {53, "EBADR", "invalid request descriptor"}, {54, "EXFULL", "exchange full"}, {55, "ENOANO", "no anode"}, {56, "EBADRQC", "invalid request code"}, {57, "EBADSLT", "invalid slot"}, {59, "EBFONT", "bad font file format"}, {60, "ENOSTR", "device not a stream"}, {61, "ENODATA", "no data available"}, {62, "ETIME", "timer expired"}, {63, "ENOSR", "out of streams resources"}, {64, "ENONET", "machine is not on the network"}, {65, "ENOPKG", "package not installed"}, {66, "EREMOTE", "object is remote"}, {67, "ENOLINK", "link has been severed"}, {68, "EADV", "advertise error"}, {69, "ESRMNT", "srmount error"}, {70, "ECOMM", "communication error on send"}, {71, "EPROTO", "protocol error"}, {72, "EMULTIHOP", "multihop attempted"}, {73, "EDOTDOT", "RFS specific error"}, {74, "EBADMSG", "bad message"}, {75, "EOVERFLOW", "value too large for defined data type"}, {76, "ENOTUNIQ", "name not unique on network"}, {77, "EBADFD", "file descriptor in bad state"}, {78, "EREMCHG", "remote address changed"}, {79, "ELIBACC", "can not access a needed shared library"}, {80, "ELIBBAD", "accessing a corrupted shared library"}, {81, "ELIBSCN", ".lib section in a.out corrupted"}, {82, "ELIBMAX", "attempting to link in too many shared libraries"}, {83, "ELIBEXEC", "cannot exec a shared library directly"}, {84, "EILSEQ", "invalid or incomplete multibyte or wide character"}, {85, "ERESTART", "interrupted system call should be restarted"}, {86, "ESTRPIPE", "streams pipe error"}, {87, "EUSERS", "too many users"}, {88, "ENOTSOCK", "socket operation on non-socket"}, {89, "EDESTADDRREQ", "destination address required"}, {90, "EMSGSIZE", "message too long"}, {91, "EPROTOTYPE", "protocol wrong type for socket"}, {92, "ENOPROTOOPT", "protocol not available"}, {93, "EPROTONOSUPPORT", "protocol not supported"}, {94, "ESOCKTNOSUPPORT", "socket type not supported"}, {95, "ENOTSUP", "operation not supported"}, {96, "EPFNOSUPPORT", "protocol family not supported"}, {97, "EAFNOSUPPORT", "address family not supported by protocol"}, {98, "EADDRINUSE", "address already in use"}, {99, "EADDRNOTAVAIL", "cannot assign requested address"}, {100, "ENETDOWN", "network is down"}, {101, "ENETUNREACH", "network is unreachable"}, {102, "ENETRESET", "network dropped connection on reset"}, {103, "ECONNABORTED", "software caused connection abort"}, {104, "ECONNRESET", "connection reset by peer"}, {105, "ENOBUFS", "no buffer space available"}, {106, "EISCONN", "transport endpoint is already connected"}, {107, "ENOTCONN", "transport endpoint is not connected"}, {108, "ESHUTDOWN", "cannot send after transport endpoint shutdown"}, {109, "ETOOMANYREFS", "too many references: cannot splice"}, {110, "ETIMEDOUT", "connection timed out"}, {111, "ECONNREFUSED", "connection refused"}, {112, "EHOSTDOWN", "host is down"}, {113, "EHOSTUNREACH", "no route to host"}, {114, "EALREADY", "operation already in progress"}, {115, "EINPROGRESS", "operation now in progress"}, {116, "ESTALE", "stale file handle"}, {117, "EUCLEAN", "structure needs cleaning"}, {118, "ENOTNAM", "not a XENIX named type file"}, {119, "ENAVAIL", "no XENIX semaphores available"}, {120, "EISNAM", "is a named type file"}, {121, "EREMOTEIO", "remote I/O error"}, {122, "EDQUOT", "disk quota exceeded"}, {123, "ENOMEDIUM", "no medium found"}, {124, "EMEDIUMTYPE", "wrong medium type"}, {125, "ECANCELED", "operation canceled"}, {126, "ENOKEY", "required key not available"}, {127, "EKEYEXPIRED", "key has expired"}, {128, "EKEYREVOKED", "key has been revoked"}, {129, "EKEYREJECTED", "key was rejected by service"}, {130, "EOWNERDEAD", "owner died"}, {131, "ENOTRECOVERABLE", "state not recoverable"}, {132, "ERFKILL", "operation not possible due to RF-kill"}, {133, "EHWPOISON", "memory page has hardware error"}, } // Signal table var signalList = [...]struct { num syscall.Signal name string desc string }{ {1, "SIGHUP", "hangup"}, {2, "SIGINT", "interrupt"}, {3, "SIGQUIT", "quit"}, {4, "SIGILL", "illegal instruction"}, {5, "SIGTRAP", "trace/breakpoint trap"}, {6, "SIGABRT", "aborted"}, {7, "SIGBUS", "bus error"}, {8, "SIGFPE", "floating point exception"}, {9, "SIGKILL", "killed"}, {10, "SIGUSR1", "user defined signal 1"}, {11, "SIGSEGV", "segmentation fault"}, {12, "SIGUSR2", "user defined signal 2"}, {13, "SIGPIPE", "broken pipe"}, {14, "SIGALRM", "alarm clock"}, {15, "SIGTERM", "terminated"}, {16, "SIGSTKFLT", "stack fault"}, {17, "SIGCHLD", "child exited"}, {18, "SIGCONT", "continued"}, {19, "SIGSTOP", "stopped (signal)"}, {20, "SIGTSTP", "stopped"}, {21, "SIGTTIN", "stopped (tty input)"}, {22, "SIGTTOU", "stopped (tty output)"}, {23, "SIGURG", "urgent I/O condition"}, {24, "SIGXCPU", "CPU time limit exceeded"}, {25, "SIGXFSZ", "file size limit exceeded"}, {26, "SIGVTALRM", "virtual timer expired"}, {27, "SIGPROF", "profiling timer expired"}, {28, "SIGWINCH", "window changed"}, {29, "SIGIO", "I/O possible"}, {30, "SIGPWR", "power failure"}, {31, "SIGSYS", "bad system call"}, } ================================================ FILE: vendor/golang.org/x/sys/unix/zerrors_linux_mips.go ================================================ // mkerrors.sh -Wall -Werror -static -I/tmp/mips/include // Code generated by the command above; see README.md. DO NOT EDIT. //go:build mips && linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -Wall -Werror -static -I/tmp/mips/include _const.go package unix import "syscall" const ( B1000000 = 0x1008 B115200 = 0x1002 B1152000 = 0x1009 B1500000 = 0x100a B2000000 = 0x100b B230400 = 0x1003 B2500000 = 0x100c B3000000 = 0x100d B3500000 = 0x100e B4000000 = 0x100f B460800 = 0x1004 B500000 = 0x1005 B57600 = 0x1001 B576000 = 0x1006 B921600 = 0x1007 BLKALIGNOFF = 0x2000127a BLKBSZGET = 0x40041270 BLKBSZSET = 0x80041271 BLKDISCARD = 0x20001277 BLKDISCARDZEROES = 0x2000127c BLKFLSBUF = 0x20001261 BLKFRAGET = 0x20001265 BLKFRASET = 0x20001264 BLKGETDISKSEQ = 0x40081280 BLKGETSIZE = 0x20001260 BLKGETSIZE64 = 0x40041272 BLKIOMIN = 0x20001278 BLKIOOPT = 0x20001279 BLKPBSZGET = 0x2000127b BLKRAGET = 0x20001263 BLKRASET = 0x20001262 BLKROGET = 0x2000125e BLKROSET = 0x2000125d BLKROTATIONAL = 0x2000127e BLKRRPART = 0x2000125f BLKSECDISCARD = 0x2000127d BLKSECTGET = 0x20001267 BLKSECTSET = 0x20001266 BLKSSZGET = 0x20001268 BLKZEROOUT = 0x2000127f BOTHER = 0x1000 BS1 = 0x2000 BSDLY = 0x2000 CBAUD = 0x100f CBAUDEX = 0x1000 CIBAUD = 0x100f0000 CLOCAL = 0x800 CR1 = 0x200 CR2 = 0x400 CR3 = 0x600 CRDLY = 0x600 CREAD = 0x80 CS6 = 0x10 CS7 = 0x20 CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 DM_MPATH_PROBE_PATHS = 0x2000fd12 ECCGETLAYOUT = 0x41484d11 ECCGETSTATS = 0x40104d12 ECHOCTL = 0x200 ECHOE = 0x10 ECHOK = 0x20 ECHOKE = 0x800 ECHONL = 0x40 ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x80 EPIOCGPARAMS = 0x40088a02 EPIOCSPARAMS = 0x80088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 FFDLY = 0x8000 FICLONE = 0x80049409 FICLONERANGE = 0x8020940d FLUSHO = 0x2000 FS_IOC_ENABLE_VERITY = 0x80806685 FS_IOC_GETFLAGS = 0x40046601 FS_IOC_GET_ENCRYPTION_NONCE = 0x4010661b FS_IOC_GET_ENCRYPTION_POLICY = 0x800c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x80106614 FS_IOC_SETFLAGS = 0x80046602 FS_IOC_SET_ENCRYPTION_POLICY = 0x400c6613 F_GETLK = 0x21 F_GETLK64 = 0x21 F_GETOWN = 0x17 F_RDLCK = 0x0 F_SETLK = 0x22 F_SETLK64 = 0x22 F_SETLKW = 0x23 F_SETLKW64 = 0x23 F_SETOWN = 0x18 F_UNLCK = 0x2 F_WRLCK = 0x1 HIDIOCGRAWINFO = 0x40084803 HIDIOCGRDESC = 0x50044802 HIDIOCGRDESCSIZE = 0x40044801 HIDIOCREVOKE = 0x8004480d HUPCL = 0x400 ICANON = 0x2 IEXTEN = 0x100 IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x80 IOCTL_MEI_NOTIFY_GET = 0x40044803 IOCTL_MEI_NOTIFY_SET = 0x80044802 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x200007b9 IPV6_FLOWINFO_MASK = 0xfffffff IPV6_FLOWLABEL_MASK = 0xfffff ISIG = 0x1 IUCLC = 0x200 IXOFF = 0x1000 IXON = 0x400 MAP_ANON = 0x800 MAP_ANONYMOUS = 0x800 MAP_DENYWRITE = 0x2000 MAP_EXECUTABLE = 0x4000 MAP_GROWSDOWN = 0x1000 MAP_HUGETLB = 0x80000 MAP_LOCKED = 0x8000 MAP_NONBLOCK = 0x20000 MAP_NORESERVE = 0x400 MAP_POPULATE = 0x10000 MAP_RENAME = 0x800 MAP_STACK = 0x40000 MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MCL_ONFAULT = 0x4 MEMERASE = 0x80084d02 MEMERASE64 = 0x80104d14 MEMGETBADBLOCK = 0x80084d0b MEMGETINFO = 0x40204d01 MEMGETOOBSEL = 0x40c84d0a MEMGETREGIONCOUNT = 0x40044d07 MEMISLOCKED = 0x40084d17 MEMLOCK = 0x80084d05 MEMREAD = 0xc0404d1a MEMREADOOB = 0xc00c4d04 MEMSETBADBLOCK = 0x80084d0c MEMUNLOCK = 0x80084d06 MEMWRITEOOB = 0xc00c4d03 MTDFILEMODE = 0x20004d13 NFDBITS = 0x20 NLDLY = 0x100 NOFLSH = 0x80 NS_GET_MNTNS_ID = 0x4008b705 NS_GET_NSTYPE = 0x2000b703 NS_GET_OWNER_UID = 0x2000b704 NS_GET_PARENT = 0x2000b702 NS_GET_PID_FROM_PIDNS = 0x4004b706 NS_GET_PID_IN_PIDNS = 0x4004b708 NS_GET_TGID_FROM_PIDNS = 0x4004b707 NS_GET_TGID_IN_PIDNS = 0x4004b709 NS_GET_USERNS = 0x2000b701 OLCUC = 0x2 ONLCR = 0x4 OTPERASE = 0x800c4d19 OTPGETREGIONCOUNT = 0x80044d0e OTPGETREGIONINFO = 0x800c4d0f OTPLOCK = 0x400c4d10 OTPSELECT = 0x40044d0d O_APPEND = 0x8 O_ASYNC = 0x1000 O_CLOEXEC = 0x80000 O_CREAT = 0x100 O_DIRECT = 0x8000 O_DIRECTORY = 0x10000 O_DSYNC = 0x10 O_EXCL = 0x400 O_FSYNC = 0x4010 O_LARGEFILE = 0x2000 O_NDELAY = 0x80 O_NOATIME = 0x40000 O_NOCTTY = 0x800 O_NOFOLLOW = 0x20000 O_NONBLOCK = 0x80 O_PATH = 0x200000 O_RSYNC = 0x4010 O_SYNC = 0x4010 O_TMPFILE = 0x410000 O_TRUNC = 0x200 PARENB = 0x100 PARODD = 0x200 PENDIN = 0x4000 PERF_EVENT_IOC_DISABLE = 0x20002401 PERF_EVENT_IOC_ENABLE = 0x20002400 PERF_EVENT_IOC_ID = 0x40042407 PERF_EVENT_IOC_MODIFY_ATTRIBUTES = 0x8004240b PERF_EVENT_IOC_PAUSE_OUTPUT = 0x80042409 PERF_EVENT_IOC_PERIOD = 0x80082404 PERF_EVENT_IOC_QUERY_BPF = 0xc004240a PERF_EVENT_IOC_REFRESH = 0x20002402 PERF_EVENT_IOC_RESET = 0x20002403 PERF_EVENT_IOC_SET_BPF = 0x80042408 PERF_EVENT_IOC_SET_FILTER = 0x80042406 PERF_EVENT_IOC_SET_OUTPUT = 0x20002405 PPPIOCATTACH = 0x8004743d PPPIOCATTCHAN = 0x80047438 PPPIOCBRIDGECHAN = 0x80047435 PPPIOCCONNECT = 0x8004743a PPPIOCDETACH = 0x8004743c PPPIOCDISCONN = 0x20007439 PPPIOCGASYNCMAP = 0x40047458 PPPIOCGCHAN = 0x40047437 PPPIOCGDEBUG = 0x40047441 PPPIOCGFLAGS = 0x4004745a PPPIOCGIDLE = 0x4008743f PPPIOCGIDLE32 = 0x4008743f PPPIOCGIDLE64 = 0x4010743f PPPIOCGL2TPSTATS = 0x40487436 PPPIOCGMRU = 0x40047453 PPPIOCGRASYNCMAP = 0x40047455 PPPIOCGUNIT = 0x40047456 PPPIOCGXASYNCMAP = 0x40207450 PPPIOCSACTIVE = 0x80087446 PPPIOCSASYNCMAP = 0x80047457 PPPIOCSCOMPRESS = 0x800c744d PPPIOCSDEBUG = 0x80047440 PPPIOCSFLAGS = 0x80047459 PPPIOCSMAXCID = 0x80047451 PPPIOCSMRRU = 0x8004743b PPPIOCSMRU = 0x80047452 PPPIOCSNPMODE = 0x8008744b PPPIOCSPASS = 0x80087447 PPPIOCSRASYNCMAP = 0x80047454 PPPIOCSXASYNCMAP = 0x8020744f PPPIOCUNBRIDGECHAN = 0x20007434 PPPIOCXFERUNIT = 0x2000744e PR_SET_PTRACER_ANY = 0xffffffff PTP_CLOCK_GETCAPS = 0x40503d01 PTP_CLOCK_GETCAPS2 = 0x40503d0a PTP_ENABLE_PPS = 0x80043d04 PTP_ENABLE_PPS2 = 0x80043d0d PTP_EXTTS_REQUEST = 0x80103d02 PTP_EXTTS_REQUEST2 = 0x80103d0b PTP_MASK_CLEAR_ALL = 0x20003d13 PTP_MASK_EN_SINGLE = 0x80043d14 PTP_PEROUT_REQUEST = 0x80383d03 PTP_PEROUT_REQUEST2 = 0x80383d0c PTP_PIN_SETFUNC = 0x80603d07 PTP_PIN_SETFUNC2 = 0x80603d10 PTP_SYS_OFFSET = 0x83403d05 PTP_SYS_OFFSET2 = 0x83403d0e PTRACE_GETFPREGS = 0xe PTRACE_GET_THREAD_AREA = 0x19 PTRACE_GET_THREAD_AREA_3264 = 0xc4 PTRACE_GET_WATCH_REGS = 0xd0 PTRACE_OLDSETOPTIONS = 0x15 PTRACE_PEEKDATA_3264 = 0xc1 PTRACE_PEEKTEXT_3264 = 0xc0 PTRACE_POKEDATA_3264 = 0xc3 PTRACE_POKETEXT_3264 = 0xc2 PTRACE_SETFPREGS = 0xf PTRACE_SET_THREAD_AREA = 0x1a PTRACE_SET_WATCH_REGS = 0xd1 RLIMIT_AS = 0x6 RLIMIT_MEMLOCK = 0x9 RLIMIT_NOFILE = 0x5 RLIMIT_NPROC = 0x8 RLIMIT_RSS = 0x7 RNDADDENTROPY = 0x80085203 RNDADDTOENTCNT = 0x80045201 RNDCLEARPOOL = 0x20005206 RNDGETENTCNT = 0x40045200 RNDGETPOOL = 0x40085202 RNDRESEEDCRNG = 0x20005207 RNDZAPENTCNT = 0x20005204 RTC_AIE_OFF = 0x20007002 RTC_AIE_ON = 0x20007001 RTC_ALM_READ = 0x40247008 RTC_ALM_SET = 0x80247007 RTC_EPOCH_READ = 0x4004700d RTC_EPOCH_SET = 0x8004700e RTC_IRQP_READ = 0x4004700b RTC_IRQP_SET = 0x8004700c RTC_PARAM_GET = 0x80187013 RTC_PARAM_SET = 0x80187014 RTC_PIE_OFF = 0x20007006 RTC_PIE_ON = 0x20007005 RTC_PLL_GET = 0x401c7011 RTC_PLL_SET = 0x801c7012 RTC_RD_TIME = 0x40247009 RTC_SET_TIME = 0x8024700a RTC_UIE_OFF = 0x20007004 RTC_UIE_ON = 0x20007003 RTC_VL_CLR = 0x20007014 RTC_VL_READ = 0x40047013 RTC_WIE_OFF = 0x20007010 RTC_WIE_ON = 0x2000700f RTC_WKALM_RD = 0x40287010 RTC_WKALM_SET = 0x8028700f SCM_DEVMEM_DMABUF = 0x4f SCM_DEVMEM_LINEAR = 0x4e SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a SCM_TIMESTAMPNS = 0x23 SCM_TS_OPT_ID = 0x51 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 SECCOMP_IOCTL_NOTIF_ADDFD = 0x80182103 SECCOMP_IOCTL_NOTIF_ID_VALID = 0x80082102 SECCOMP_IOCTL_NOTIF_SET_FLAGS = 0x80082104 SFD_CLOEXEC = 0x80000 SFD_NONBLOCK = 0x80 SIOCATMARK = 0x40047307 SIOCGPGRP = 0x40047309 SIOCGSTAMPNS_NEW = 0x40108907 SIOCGSTAMP_NEW = 0x40108906 SIOCINQ = 0x467f SIOCOUTQ = 0x7472 SIOCSPGRP = 0x80047308 SOCK_CLOEXEC = 0x80000 SOCK_DGRAM = 0x1 SOCK_NONBLOCK = 0x80 SOCK_STREAM = 0x2 SOL_SOCKET = 0xffff SO_ACCEPTCONN = 0x1009 SO_ATTACH_BPF = 0x32 SO_ATTACH_REUSEPORT_CBPF = 0x33 SO_ATTACH_REUSEPORT_EBPF = 0x34 SO_BINDTODEVICE = 0x19 SO_BINDTOIFINDEX = 0x3e SO_BPF_EXTENSIONS = 0x30 SO_BROADCAST = 0x20 SO_BSDCOMPAT = 0xe SO_BUF_LOCK = 0x48 SO_BUSY_POLL = 0x2e SO_BUSY_POLL_BUDGET = 0x46 SO_CNX_ADVICE = 0x35 SO_COOKIE = 0x39 SO_DETACH_REUSEPORT_BPF = 0x44 SO_DEVMEM_DMABUF = 0x4f SO_DEVMEM_DONTNEED = 0x50 SO_DEVMEM_LINEAR = 0x4e SO_DOMAIN = 0x1029 SO_DONTROUTE = 0x10 SO_ERROR = 0x1007 SO_INCOMING_CPU = 0x31 SO_INCOMING_NAPI_ID = 0x38 SO_KEEPALIVE = 0x8 SO_LINGER = 0x80 SO_LOCK_FILTER = 0x2c SO_MARK = 0x24 SO_MAX_PACING_RATE = 0x2f SO_MEMINFO = 0x37 SO_NETNS_COOKIE = 0x47 SO_NOFCS = 0x2b SO_OOBINLINE = 0x100 SO_PASSCRED = 0x11 SO_PASSPIDFD = 0x4c SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x12 SO_PEERGROUPS = 0x3b SO_PEERPIDFD = 0x4d SO_PEERSEC = 0x1e SO_PREFER_BUSY_POLL = 0x45 SO_PROTOCOL = 0x1028 SO_RCVBUF = 0x1002 SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x1004 SO_RCVMARK = 0x4b SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x1006 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x1006 SO_RESERVE_MEM = 0x49 SO_REUSEADDR = 0x4 SO_REUSEPORT = 0x200 SO_RXQ_OVFL = 0x28 SO_SECURITY_AUTHENTICATION = 0x16 SO_SECURITY_ENCRYPTION_NETWORK = 0x18 SO_SECURITY_ENCRYPTION_TRANSPORT = 0x17 SO_SELECT_ERR_QUEUE = 0x2d SO_SNDBUF = 0x1001 SO_SNDBUFFORCE = 0x1f SO_SNDLOWAT = 0x1003 SO_SNDTIMEO = 0x1005 SO_SNDTIMEO_NEW = 0x43 SO_SNDTIMEO_OLD = 0x1005 SO_STYLE = 0x1008 SO_TIMESTAMPING = 0x25 SO_TIMESTAMPING_NEW = 0x41 SO_TIMESTAMPING_OLD = 0x25 SO_TIMESTAMPNS = 0x23 SO_TIMESTAMPNS_NEW = 0x40 SO_TIMESTAMPNS_OLD = 0x23 SO_TIMESTAMP_NEW = 0x3f SO_TXREHASH = 0x4a SO_TXTIME = 0x3d SO_TYPE = 0x1008 SO_WIFI_STATUS = 0x29 SO_ZEROCOPY = 0x3c TAB1 = 0x800 TAB2 = 0x1000 TAB3 = 0x1800 TABDLY = 0x1800 TCFLSH = 0x5407 TCGETA = 0x5401 TCGETS = 0x540d TCGETS2 = 0x4030542a TCSAFLUSH = 0x5410 TCSBRK = 0x5405 TCSBRKP = 0x5486 TCSETA = 0x5402 TCSETAF = 0x5404 TCSETAW = 0x5403 TCSETS = 0x540e TCSETS2 = 0x8030542b TCSETSF = 0x5410 TCSETSF2 = 0x8030542d TCSETSW = 0x540f TCSETSW2 = 0x8030542c TCXONC = 0x5406 TFD_CLOEXEC = 0x80000 TFD_NONBLOCK = 0x80 TIOCCBRK = 0x5428 TIOCCONS = 0x80047478 TIOCEXCL = 0x740d TIOCGDEV = 0x40045432 TIOCGETD = 0x7400 TIOCGETP = 0x7408 TIOCGEXCL = 0x40045440 TIOCGICOUNT = 0x5492 TIOCGISO7816 = 0x40285442 TIOCGLCKTRMIOS = 0x548b TIOCGLTC = 0x7474 TIOCGPGRP = 0x40047477 TIOCGPKT = 0x40045438 TIOCGPTLCK = 0x40045439 TIOCGPTN = 0x40045430 TIOCGPTPEER = 0x20005441 TIOCGRS485 = 0x4020542e TIOCGSERIAL = 0x5484 TIOCGSID = 0x7416 TIOCGSOFTCAR = 0x5481 TIOCGWINSZ = 0x40087468 TIOCINQ = 0x467f TIOCLINUX = 0x5483 TIOCMBIC = 0x741c TIOCMBIS = 0x741b TIOCMGET = 0x741d TIOCMIWAIT = 0x5491 TIOCMSET = 0x741a TIOCM_CAR = 0x100 TIOCM_CD = 0x100 TIOCM_CTS = 0x40 TIOCM_DSR = 0x400 TIOCM_RI = 0x200 TIOCM_RNG = 0x200 TIOCM_SR = 0x20 TIOCM_ST = 0x10 TIOCNOTTY = 0x5471 TIOCNXCL = 0x740e TIOCOUTQ = 0x7472 TIOCPKT = 0x5470 TIOCSBRK = 0x5427 TIOCSCTTY = 0x5480 TIOCSERCONFIG = 0x5488 TIOCSERGETLSR = 0x548e TIOCSERGETMULTI = 0x548f TIOCSERGSTRUCT = 0x548d TIOCSERGWILD = 0x5489 TIOCSERSETMULTI = 0x5490 TIOCSERSWILD = 0x548a TIOCSER_TEMT = 0x1 TIOCSETD = 0x7401 TIOCSETN = 0x740a TIOCSETP = 0x7409 TIOCSIG = 0x80045436 TIOCSISO7816 = 0xc0285443 TIOCSLCKTRMIOS = 0x548c TIOCSLTC = 0x7475 TIOCSPGRP = 0x80047476 TIOCSPTLCK = 0x80045431 TIOCSRS485 = 0xc020542f TIOCSSERIAL = 0x5485 TIOCSSOFTCAR = 0x5482 TIOCSTI = 0x5472 TIOCSWINSZ = 0x80087467 TIOCVHANGUP = 0x5437 TOSTOP = 0x8000 TUNATTACHFILTER = 0x800854d5 TUNDETACHFILTER = 0x800854d6 TUNGETDEVNETNS = 0x200054e3 TUNGETFEATURES = 0x400454cf TUNGETFILTER = 0x400854db TUNGETIFF = 0x400454d2 TUNGETSNDBUF = 0x400454d3 TUNGETVNETBE = 0x400454df TUNGETVNETHDRSZ = 0x400454d7 TUNGETVNETLE = 0x400454dd TUNSETCARRIER = 0x800454e2 TUNSETDEBUG = 0x800454c9 TUNSETFILTEREBPF = 0x400454e1 TUNSETGROUP = 0x800454ce TUNSETIFF = 0x800454ca TUNSETIFINDEX = 0x800454da TUNSETLINK = 0x800454cd TUNSETNOCSUM = 0x800454c8 TUNSETOFFLOAD = 0x800454d0 TUNSETOWNER = 0x800454cc TUNSETPERSIST = 0x800454cb TUNSETQUEUE = 0x800454d9 TUNSETSNDBUF = 0x800454d4 TUNSETSTEERINGEBPF = 0x400454e0 TUNSETTXFILTER = 0x800454d1 TUNSETVNETBE = 0x800454de TUNSETVNETHDRSZ = 0x800454d8 TUNSETVNETLE = 0x800454dc UBI_IOCATT = 0x80186f40 UBI_IOCDET = 0x80046f41 UBI_IOCEBCH = 0x80044f02 UBI_IOCEBER = 0x80044f01 UBI_IOCEBISMAP = 0x40044f05 UBI_IOCEBMAP = 0x80084f03 UBI_IOCEBUNMAP = 0x80044f04 UBI_IOCMKVOL = 0x80986f00 UBI_IOCRMVOL = 0x80046f01 UBI_IOCRNVOL = 0x91106f03 UBI_IOCRPEB = 0x80046f04 UBI_IOCRSVOL = 0x800c6f02 UBI_IOCSETVOLPROP = 0x80104f06 UBI_IOCSPEB = 0x80046f05 UBI_IOCVOLCRBLK = 0x80804f07 UBI_IOCVOLRMBLK = 0x20004f08 UBI_IOCVOLUP = 0x80084f00 VDISCARD = 0xd VEOF = 0x10 VEOL = 0x11 VEOL2 = 0x6 VMIN = 0x4 VREPRINT = 0xc VSTART = 0x8 VSTOP = 0x9 VSUSP = 0xa VSWTC = 0x7 VSWTCH = 0x7 VT1 = 0x4000 VTDLY = 0x4000 VTIME = 0x5 VWERASE = 0xe WDIOC_GETBOOTSTATUS = 0x40045702 WDIOC_GETPRETIMEOUT = 0x40045709 WDIOC_GETSTATUS = 0x40045701 WDIOC_GETSUPPORT = 0x40285700 WDIOC_GETTEMP = 0x40045703 WDIOC_GETTIMELEFT = 0x4004570a WDIOC_GETTIMEOUT = 0x40045707 WDIOC_KEEPALIVE = 0x40045705 WDIOC_SETOPTIONS = 0x40045704 WORDSIZE = 0x20 XCASE = 0x4 XTABS = 0x1800 _HIDIOCGRAWNAME = 0x40804804 _HIDIOCGRAWPHYS = 0x40404805 _HIDIOCGRAWUNIQ = 0x40404808 ) // Errors const ( EADDRINUSE = syscall.Errno(0x7d) EADDRNOTAVAIL = syscall.Errno(0x7e) EADV = syscall.Errno(0x44) EAFNOSUPPORT = syscall.Errno(0x7c) EALREADY = syscall.Errno(0x95) EBADE = syscall.Errno(0x32) EBADFD = syscall.Errno(0x51) EBADMSG = syscall.Errno(0x4d) EBADR = syscall.Errno(0x33) EBADRQC = syscall.Errno(0x36) EBADSLT = syscall.Errno(0x37) EBFONT = syscall.Errno(0x3b) ECANCELED = syscall.Errno(0x9e) ECHRNG = syscall.Errno(0x25) ECOMM = syscall.Errno(0x46) ECONNABORTED = syscall.Errno(0x82) ECONNREFUSED = syscall.Errno(0x92) ECONNRESET = syscall.Errno(0x83) EDEADLK = syscall.Errno(0x2d) EDEADLOCK = syscall.Errno(0x38) EDESTADDRREQ = syscall.Errno(0x60) EDOTDOT = syscall.Errno(0x49) EDQUOT = syscall.Errno(0x46d) EHOSTDOWN = syscall.Errno(0x93) EHOSTUNREACH = syscall.Errno(0x94) EHWPOISON = syscall.Errno(0xa8) EIDRM = syscall.Errno(0x24) EILSEQ = syscall.Errno(0x58) EINIT = syscall.Errno(0x8d) EINPROGRESS = syscall.Errno(0x96) EISCONN = syscall.Errno(0x85) EISNAM = syscall.Errno(0x8b) EKEYEXPIRED = syscall.Errno(0xa2) EKEYREJECTED = syscall.Errno(0xa4) EKEYREVOKED = syscall.Errno(0xa3) EL2HLT = syscall.Errno(0x2c) EL2NSYNC = syscall.Errno(0x26) EL3HLT = syscall.Errno(0x27) EL3RST = syscall.Errno(0x28) ELIBACC = syscall.Errno(0x53) ELIBBAD = syscall.Errno(0x54) ELIBEXEC = syscall.Errno(0x57) ELIBMAX = syscall.Errno(0x56) ELIBSCN = syscall.Errno(0x55) ELNRNG = syscall.Errno(0x29) ELOOP = syscall.Errno(0x5a) EMEDIUMTYPE = syscall.Errno(0xa0) EMSGSIZE = syscall.Errno(0x61) EMULTIHOP = syscall.Errno(0x4a) ENAMETOOLONG = syscall.Errno(0x4e) ENAVAIL = syscall.Errno(0x8a) ENETDOWN = syscall.Errno(0x7f) ENETRESET = syscall.Errno(0x81) ENETUNREACH = syscall.Errno(0x80) ENOANO = syscall.Errno(0x35) ENOBUFS = syscall.Errno(0x84) ENOCSI = syscall.Errno(0x2b) ENODATA = syscall.Errno(0x3d) ENOKEY = syscall.Errno(0xa1) ENOLCK = syscall.Errno(0x2e) ENOLINK = syscall.Errno(0x43) ENOMEDIUM = syscall.Errno(0x9f) ENOMSG = syscall.Errno(0x23) ENONET = syscall.Errno(0x40) ENOPKG = syscall.Errno(0x41) ENOPROTOOPT = syscall.Errno(0x63) ENOSR = syscall.Errno(0x3f) ENOSTR = syscall.Errno(0x3c) ENOSYS = syscall.Errno(0x59) ENOTCONN = syscall.Errno(0x86) ENOTEMPTY = syscall.Errno(0x5d) ENOTNAM = syscall.Errno(0x89) ENOTRECOVERABLE = syscall.Errno(0xa6) ENOTSOCK = syscall.Errno(0x5f) ENOTSUP = syscall.Errno(0x7a) ENOTUNIQ = syscall.Errno(0x50) EOPNOTSUPP = syscall.Errno(0x7a) EOVERFLOW = syscall.Errno(0x4f) EOWNERDEAD = syscall.Errno(0xa5) EPFNOSUPPORT = syscall.Errno(0x7b) EPROTO = syscall.Errno(0x47) EPROTONOSUPPORT = syscall.Errno(0x78) EPROTOTYPE = syscall.Errno(0x62) EREMCHG = syscall.Errno(0x52) EREMDEV = syscall.Errno(0x8e) EREMOTE = syscall.Errno(0x42) EREMOTEIO = syscall.Errno(0x8c) ERESTART = syscall.Errno(0x5b) ERFKILL = syscall.Errno(0xa7) ESHUTDOWN = syscall.Errno(0x8f) ESOCKTNOSUPPORT = syscall.Errno(0x79) ESRMNT = syscall.Errno(0x45) ESTALE = syscall.Errno(0x97) ESTRPIPE = syscall.Errno(0x5c) ETIME = syscall.Errno(0x3e) ETIMEDOUT = syscall.Errno(0x91) ETOOMANYREFS = syscall.Errno(0x90) EUCLEAN = syscall.Errno(0x87) EUNATCH = syscall.Errno(0x2a) EUSERS = syscall.Errno(0x5e) EXFULL = syscall.Errno(0x34) ) // Signals const ( SIGBUS = syscall.Signal(0xa) SIGCHLD = syscall.Signal(0x12) SIGCLD = syscall.Signal(0x12) SIGCONT = syscall.Signal(0x19) SIGEMT = syscall.Signal(0x7) SIGIO = syscall.Signal(0x16) SIGPOLL = syscall.Signal(0x16) SIGPROF = syscall.Signal(0x1d) SIGPWR = syscall.Signal(0x13) SIGSTOP = syscall.Signal(0x17) SIGSYS = syscall.Signal(0xc) SIGTSTP = syscall.Signal(0x18) SIGTTIN = syscall.Signal(0x1a) SIGTTOU = syscall.Signal(0x1b) SIGURG = syscall.Signal(0x15) SIGUSR1 = syscall.Signal(0x10) SIGUSR2 = syscall.Signal(0x11) SIGVTALRM = syscall.Signal(0x1c) SIGWINCH = syscall.Signal(0x14) SIGXCPU = syscall.Signal(0x1e) SIGXFSZ = syscall.Signal(0x1f) ) // Error table var errorList = [...]struct { num syscall.Errno name string desc string }{ {1, "EPERM", "operation not permitted"}, {2, "ENOENT", "no such file or directory"}, {3, "ESRCH", "no such process"}, {4, "EINTR", "interrupted system call"}, {5, "EIO", "input/output error"}, {6, "ENXIO", "no such device or address"}, {7, "E2BIG", "argument list too long"}, {8, "ENOEXEC", "exec format error"}, {9, "EBADF", "bad file descriptor"}, {10, "ECHILD", "no child processes"}, {11, "EAGAIN", "resource temporarily unavailable"}, {12, "ENOMEM", "cannot allocate memory"}, {13, "EACCES", "permission denied"}, {14, "EFAULT", "bad address"}, {15, "ENOTBLK", "block device required"}, {16, "EBUSY", "device or resource busy"}, {17, "EEXIST", "file exists"}, {18, "EXDEV", "invalid cross-device link"}, {19, "ENODEV", "no such device"}, {20, "ENOTDIR", "not a directory"}, {21, "EISDIR", "is a directory"}, {22, "EINVAL", "invalid argument"}, {23, "ENFILE", "too many open files in system"}, {24, "EMFILE", "too many open files"}, {25, "ENOTTY", "inappropriate ioctl for device"}, {26, "ETXTBSY", "text file busy"}, {27, "EFBIG", "file too large"}, {28, "ENOSPC", "no space left on device"}, {29, "ESPIPE", "illegal seek"}, {30, "EROFS", "read-only file system"}, {31, "EMLINK", "too many links"}, {32, "EPIPE", "broken pipe"}, {33, "EDOM", "numerical argument out of domain"}, {34, "ERANGE", "numerical result out of range"}, {35, "ENOMSG", "no message of desired type"}, {36, "EIDRM", "identifier removed"}, {37, "ECHRNG", "channel number out of range"}, {38, "EL2NSYNC", "level 2 not synchronized"}, {39, "EL3HLT", "level 3 halted"}, {40, "EL3RST", "level 3 reset"}, {41, "ELNRNG", "link number out of range"}, {42, "EUNATCH", "protocol driver not attached"}, {43, "ENOCSI", "no CSI structure available"}, {44, "EL2HLT", "level 2 halted"}, {45, "EDEADLK", "resource deadlock avoided"}, {46, "ENOLCK", "no locks available"}, {50, "EBADE", "invalid exchange"}, {51, "EBADR", "invalid request descriptor"}, {52, "EXFULL", "exchange full"}, {53, "ENOANO", "no anode"}, {54, "EBADRQC", "invalid request code"}, {55, "EBADSLT", "invalid slot"}, {56, "EDEADLOCK", "file locking deadlock error"}, {59, "EBFONT", "bad font file format"}, {60, "ENOSTR", "device not a stream"}, {61, "ENODATA", "no data available"}, {62, "ETIME", "timer expired"}, {63, "ENOSR", "out of streams resources"}, {64, "ENONET", "machine is not on the network"}, {65, "ENOPKG", "package not installed"}, {66, "EREMOTE", "object is remote"}, {67, "ENOLINK", "link has been severed"}, {68, "EADV", "advertise error"}, {69, "ESRMNT", "srmount error"}, {70, "ECOMM", "communication error on send"}, {71, "EPROTO", "protocol error"}, {73, "EDOTDOT", "RFS specific error"}, {74, "EMULTIHOP", "multihop attempted"}, {77, "EBADMSG", "bad message"}, {78, "ENAMETOOLONG", "file name too long"}, {79, "EOVERFLOW", "value too large for defined data type"}, {80, "ENOTUNIQ", "name not unique on network"}, {81, "EBADFD", "file descriptor in bad state"}, {82, "EREMCHG", "remote address changed"}, {83, "ELIBACC", "can not access a needed shared library"}, {84, "ELIBBAD", "accessing a corrupted shared library"}, {85, "ELIBSCN", ".lib section in a.out corrupted"}, {86, "ELIBMAX", "attempting to link in too many shared libraries"}, {87, "ELIBEXEC", "cannot exec a shared library directly"}, {88, "EILSEQ", "invalid or incomplete multibyte or wide character"}, {89, "ENOSYS", "function not implemented"}, {90, "ELOOP", "too many levels of symbolic links"}, {91, "ERESTART", "interrupted system call should be restarted"}, {92, "ESTRPIPE", "streams pipe error"}, {93, "ENOTEMPTY", "directory not empty"}, {94, "EUSERS", "too many users"}, {95, "ENOTSOCK", "socket operation on non-socket"}, {96, "EDESTADDRREQ", "destination address required"}, {97, "EMSGSIZE", "message too long"}, {98, "EPROTOTYPE", "protocol wrong type for socket"}, {99, "ENOPROTOOPT", "protocol not available"}, {120, "EPROTONOSUPPORT", "protocol not supported"}, {121, "ESOCKTNOSUPPORT", "socket type not supported"}, {122, "ENOTSUP", "operation not supported"}, {123, "EPFNOSUPPORT", "protocol family not supported"}, {124, "EAFNOSUPPORT", "address family not supported by protocol"}, {125, "EADDRINUSE", "address already in use"}, {126, "EADDRNOTAVAIL", "cannot assign requested address"}, {127, "ENETDOWN", "network is down"}, {128, "ENETUNREACH", "network is unreachable"}, {129, "ENETRESET", "network dropped connection on reset"}, {130, "ECONNABORTED", "software caused connection abort"}, {131, "ECONNRESET", "connection reset by peer"}, {132, "ENOBUFS", "no buffer space available"}, {133, "EISCONN", "transport endpoint is already connected"}, {134, "ENOTCONN", "transport endpoint is not connected"}, {135, "EUCLEAN", "structure needs cleaning"}, {137, "ENOTNAM", "not a XENIX named type file"}, {138, "ENAVAIL", "no XENIX semaphores available"}, {139, "EISNAM", "is a named type file"}, {140, "EREMOTEIO", "remote I/O error"}, {141, "EINIT", "unknown error 141"}, {142, "EREMDEV", "unknown error 142"}, {143, "ESHUTDOWN", "cannot send after transport endpoint shutdown"}, {144, "ETOOMANYREFS", "too many references: cannot splice"}, {145, "ETIMEDOUT", "connection timed out"}, {146, "ECONNREFUSED", "connection refused"}, {147, "EHOSTDOWN", "host is down"}, {148, "EHOSTUNREACH", "no route to host"}, {149, "EALREADY", "operation already in progress"}, {150, "EINPROGRESS", "operation now in progress"}, {151, "ESTALE", "stale file handle"}, {158, "ECANCELED", "operation canceled"}, {159, "ENOMEDIUM", "no medium found"}, {160, "EMEDIUMTYPE", "wrong medium type"}, {161, "ENOKEY", "required key not available"}, {162, "EKEYEXPIRED", "key has expired"}, {163, "EKEYREVOKED", "key has been revoked"}, {164, "EKEYREJECTED", "key was rejected by service"}, {165, "EOWNERDEAD", "owner died"}, {166, "ENOTRECOVERABLE", "state not recoverable"}, {167, "ERFKILL", "operation not possible due to RF-kill"}, {168, "EHWPOISON", "memory page has hardware error"}, {1133, "EDQUOT", "disk quota exceeded"}, } // Signal table var signalList = [...]struct { num syscall.Signal name string desc string }{ {1, "SIGHUP", "hangup"}, {2, "SIGINT", "interrupt"}, {3, "SIGQUIT", "quit"}, {4, "SIGILL", "illegal instruction"}, {5, "SIGTRAP", "trace/breakpoint trap"}, {6, "SIGABRT", "aborted"}, {7, "SIGEMT", "EMT trap"}, {8, "SIGFPE", "floating point exception"}, {9, "SIGKILL", "killed"}, {10, "SIGBUS", "bus error"}, {11, "SIGSEGV", "segmentation fault"}, {12, "SIGSYS", "bad system call"}, {13, "SIGPIPE", "broken pipe"}, {14, "SIGALRM", "alarm clock"}, {15, "SIGTERM", "terminated"}, {16, "SIGUSR1", "user defined signal 1"}, {17, "SIGUSR2", "user defined signal 2"}, {18, "SIGCHLD", "child exited"}, {19, "SIGPWR", "power failure"}, {20, "SIGWINCH", "window changed"}, {21, "SIGURG", "urgent I/O condition"}, {22, "SIGIO", "I/O possible"}, {23, "SIGSTOP", "stopped (signal)"}, {24, "SIGTSTP", "stopped"}, {25, "SIGCONT", "continued"}, {26, "SIGTTIN", "stopped (tty input)"}, {27, "SIGTTOU", "stopped (tty output)"}, {28, "SIGVTALRM", "virtual timer expired"}, {29, "SIGPROF", "profiling timer expired"}, {30, "SIGXCPU", "CPU time limit exceeded"}, {31, "SIGXFSZ", "file size limit exceeded"}, } ================================================ FILE: vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go ================================================ // mkerrors.sh -Wall -Werror -static -I/tmp/mips64/include // Code generated by the command above; see README.md. DO NOT EDIT. //go:build mips64 && linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -Wall -Werror -static -I/tmp/mips64/include _const.go package unix import "syscall" const ( B1000000 = 0x1008 B115200 = 0x1002 B1152000 = 0x1009 B1500000 = 0x100a B2000000 = 0x100b B230400 = 0x1003 B2500000 = 0x100c B3000000 = 0x100d B3500000 = 0x100e B4000000 = 0x100f B460800 = 0x1004 B500000 = 0x1005 B57600 = 0x1001 B576000 = 0x1006 B921600 = 0x1007 BLKALIGNOFF = 0x2000127a BLKBSZGET = 0x40081270 BLKBSZSET = 0x80081271 BLKDISCARD = 0x20001277 BLKDISCARDZEROES = 0x2000127c BLKFLSBUF = 0x20001261 BLKFRAGET = 0x20001265 BLKFRASET = 0x20001264 BLKGETDISKSEQ = 0x40081280 BLKGETSIZE = 0x20001260 BLKGETSIZE64 = 0x40081272 BLKIOMIN = 0x20001278 BLKIOOPT = 0x20001279 BLKPBSZGET = 0x2000127b BLKRAGET = 0x20001263 BLKRASET = 0x20001262 BLKROGET = 0x2000125e BLKROSET = 0x2000125d BLKROTATIONAL = 0x2000127e BLKRRPART = 0x2000125f BLKSECDISCARD = 0x2000127d BLKSECTGET = 0x20001267 BLKSECTSET = 0x20001266 BLKSSZGET = 0x20001268 BLKZEROOUT = 0x2000127f BOTHER = 0x1000 BS1 = 0x2000 BSDLY = 0x2000 CBAUD = 0x100f CBAUDEX = 0x1000 CIBAUD = 0x100f0000 CLOCAL = 0x800 CR1 = 0x200 CR2 = 0x400 CR3 = 0x600 CRDLY = 0x600 CREAD = 0x80 CS6 = 0x10 CS7 = 0x20 CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 DM_MPATH_PROBE_PATHS = 0x2000fd12 ECCGETLAYOUT = 0x41484d11 ECCGETSTATS = 0x40104d12 ECHOCTL = 0x200 ECHOE = 0x10 ECHOK = 0x20 ECHOKE = 0x800 ECHONL = 0x40 ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x80 EPIOCGPARAMS = 0x40088a02 EPIOCSPARAMS = 0x80088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 FFDLY = 0x8000 FICLONE = 0x80049409 FICLONERANGE = 0x8020940d FLUSHO = 0x2000 FS_IOC_ENABLE_VERITY = 0x80806685 FS_IOC_GETFLAGS = 0x40086601 FS_IOC_GET_ENCRYPTION_NONCE = 0x4010661b FS_IOC_GET_ENCRYPTION_POLICY = 0x800c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x80106614 FS_IOC_SETFLAGS = 0x80086602 FS_IOC_SET_ENCRYPTION_POLICY = 0x400c6613 F_GETLK = 0xe F_GETLK64 = 0xe F_GETOWN = 0x17 F_RDLCK = 0x0 F_SETLK = 0x6 F_SETLK64 = 0x6 F_SETLKW = 0x7 F_SETLKW64 = 0x7 F_SETOWN = 0x18 F_UNLCK = 0x2 F_WRLCK = 0x1 HIDIOCGRAWINFO = 0x40084803 HIDIOCGRDESC = 0x50044802 HIDIOCGRDESCSIZE = 0x40044801 HIDIOCREVOKE = 0x8004480d HUPCL = 0x400 ICANON = 0x2 IEXTEN = 0x100 IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x80 IOCTL_MEI_NOTIFY_GET = 0x40044803 IOCTL_MEI_NOTIFY_SET = 0x80044802 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x200007b9 IPV6_FLOWINFO_MASK = 0xfffffff IPV6_FLOWLABEL_MASK = 0xfffff ISIG = 0x1 IUCLC = 0x200 IXOFF = 0x1000 IXON = 0x400 MAP_ANON = 0x800 MAP_ANONYMOUS = 0x800 MAP_DENYWRITE = 0x2000 MAP_EXECUTABLE = 0x4000 MAP_GROWSDOWN = 0x1000 MAP_HUGETLB = 0x80000 MAP_LOCKED = 0x8000 MAP_NONBLOCK = 0x20000 MAP_NORESERVE = 0x400 MAP_POPULATE = 0x10000 MAP_RENAME = 0x800 MAP_STACK = 0x40000 MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MCL_ONFAULT = 0x4 MEMERASE = 0x80084d02 MEMERASE64 = 0x80104d14 MEMGETBADBLOCK = 0x80084d0b MEMGETINFO = 0x40204d01 MEMGETOOBSEL = 0x40c84d0a MEMGETREGIONCOUNT = 0x40044d07 MEMISLOCKED = 0x40084d17 MEMLOCK = 0x80084d05 MEMREAD = 0xc0404d1a MEMREADOOB = 0xc0104d04 MEMSETBADBLOCK = 0x80084d0c MEMUNLOCK = 0x80084d06 MEMWRITEOOB = 0xc0104d03 MTDFILEMODE = 0x20004d13 NFDBITS = 0x40 NLDLY = 0x100 NOFLSH = 0x80 NS_GET_MNTNS_ID = 0x4008b705 NS_GET_NSTYPE = 0x2000b703 NS_GET_OWNER_UID = 0x2000b704 NS_GET_PARENT = 0x2000b702 NS_GET_PID_FROM_PIDNS = 0x4004b706 NS_GET_PID_IN_PIDNS = 0x4004b708 NS_GET_TGID_FROM_PIDNS = 0x4004b707 NS_GET_TGID_IN_PIDNS = 0x4004b709 NS_GET_USERNS = 0x2000b701 OLCUC = 0x2 ONLCR = 0x4 OTPERASE = 0x800c4d19 OTPGETREGIONCOUNT = 0x80044d0e OTPGETREGIONINFO = 0x800c4d0f OTPLOCK = 0x400c4d10 OTPSELECT = 0x40044d0d O_APPEND = 0x8 O_ASYNC = 0x1000 O_CLOEXEC = 0x80000 O_CREAT = 0x100 O_DIRECT = 0x8000 O_DIRECTORY = 0x10000 O_DSYNC = 0x10 O_EXCL = 0x400 O_FSYNC = 0x4010 O_LARGEFILE = 0x0 O_NDELAY = 0x80 O_NOATIME = 0x40000 O_NOCTTY = 0x800 O_NOFOLLOW = 0x20000 O_NONBLOCK = 0x80 O_PATH = 0x200000 O_RSYNC = 0x4010 O_SYNC = 0x4010 O_TMPFILE = 0x410000 O_TRUNC = 0x200 PARENB = 0x100 PARODD = 0x200 PENDIN = 0x4000 PERF_EVENT_IOC_DISABLE = 0x20002401 PERF_EVENT_IOC_ENABLE = 0x20002400 PERF_EVENT_IOC_ID = 0x40082407 PERF_EVENT_IOC_MODIFY_ATTRIBUTES = 0x8008240b PERF_EVENT_IOC_PAUSE_OUTPUT = 0x80042409 PERF_EVENT_IOC_PERIOD = 0x80082404 PERF_EVENT_IOC_QUERY_BPF = 0xc008240a PERF_EVENT_IOC_REFRESH = 0x20002402 PERF_EVENT_IOC_RESET = 0x20002403 PERF_EVENT_IOC_SET_BPF = 0x80042408 PERF_EVENT_IOC_SET_FILTER = 0x80082406 PERF_EVENT_IOC_SET_OUTPUT = 0x20002405 PPPIOCATTACH = 0x8004743d PPPIOCATTCHAN = 0x80047438 PPPIOCBRIDGECHAN = 0x80047435 PPPIOCCONNECT = 0x8004743a PPPIOCDETACH = 0x8004743c PPPIOCDISCONN = 0x20007439 PPPIOCGASYNCMAP = 0x40047458 PPPIOCGCHAN = 0x40047437 PPPIOCGDEBUG = 0x40047441 PPPIOCGFLAGS = 0x4004745a PPPIOCGIDLE = 0x4010743f PPPIOCGIDLE32 = 0x4008743f PPPIOCGIDLE64 = 0x4010743f PPPIOCGL2TPSTATS = 0x40487436 PPPIOCGMRU = 0x40047453 PPPIOCGRASYNCMAP = 0x40047455 PPPIOCGUNIT = 0x40047456 PPPIOCGXASYNCMAP = 0x40207450 PPPIOCSACTIVE = 0x80107446 PPPIOCSASYNCMAP = 0x80047457 PPPIOCSCOMPRESS = 0x8010744d PPPIOCSDEBUG = 0x80047440 PPPIOCSFLAGS = 0x80047459 PPPIOCSMAXCID = 0x80047451 PPPIOCSMRRU = 0x8004743b PPPIOCSMRU = 0x80047452 PPPIOCSNPMODE = 0x8008744b PPPIOCSPASS = 0x80107447 PPPIOCSRASYNCMAP = 0x80047454 PPPIOCSXASYNCMAP = 0x8020744f PPPIOCUNBRIDGECHAN = 0x20007434 PPPIOCXFERUNIT = 0x2000744e PR_SET_PTRACER_ANY = 0xffffffffffffffff PTP_CLOCK_GETCAPS = 0x40503d01 PTP_CLOCK_GETCAPS2 = 0x40503d0a PTP_ENABLE_PPS = 0x80043d04 PTP_ENABLE_PPS2 = 0x80043d0d PTP_EXTTS_REQUEST = 0x80103d02 PTP_EXTTS_REQUEST2 = 0x80103d0b PTP_MASK_CLEAR_ALL = 0x20003d13 PTP_MASK_EN_SINGLE = 0x80043d14 PTP_PEROUT_REQUEST = 0x80383d03 PTP_PEROUT_REQUEST2 = 0x80383d0c PTP_PIN_SETFUNC = 0x80603d07 PTP_PIN_SETFUNC2 = 0x80603d10 PTP_SYS_OFFSET = 0x83403d05 PTP_SYS_OFFSET2 = 0x83403d0e PTRACE_GETFPREGS = 0xe PTRACE_GET_THREAD_AREA = 0x19 PTRACE_GET_THREAD_AREA_3264 = 0xc4 PTRACE_GET_WATCH_REGS = 0xd0 PTRACE_OLDSETOPTIONS = 0x15 PTRACE_PEEKDATA_3264 = 0xc1 PTRACE_PEEKTEXT_3264 = 0xc0 PTRACE_POKEDATA_3264 = 0xc3 PTRACE_POKETEXT_3264 = 0xc2 PTRACE_SETFPREGS = 0xf PTRACE_SET_THREAD_AREA = 0x1a PTRACE_SET_WATCH_REGS = 0xd1 RLIMIT_AS = 0x6 RLIMIT_MEMLOCK = 0x9 RLIMIT_NOFILE = 0x5 RLIMIT_NPROC = 0x8 RLIMIT_RSS = 0x7 RNDADDENTROPY = 0x80085203 RNDADDTOENTCNT = 0x80045201 RNDCLEARPOOL = 0x20005206 RNDGETENTCNT = 0x40045200 RNDGETPOOL = 0x40085202 RNDRESEEDCRNG = 0x20005207 RNDZAPENTCNT = 0x20005204 RTC_AIE_OFF = 0x20007002 RTC_AIE_ON = 0x20007001 RTC_ALM_READ = 0x40247008 RTC_ALM_SET = 0x80247007 RTC_EPOCH_READ = 0x4008700d RTC_EPOCH_SET = 0x8008700e RTC_IRQP_READ = 0x4008700b RTC_IRQP_SET = 0x8008700c RTC_PARAM_GET = 0x80187013 RTC_PARAM_SET = 0x80187014 RTC_PIE_OFF = 0x20007006 RTC_PIE_ON = 0x20007005 RTC_PLL_GET = 0x40207011 RTC_PLL_SET = 0x80207012 RTC_RD_TIME = 0x40247009 RTC_SET_TIME = 0x8024700a RTC_UIE_OFF = 0x20007004 RTC_UIE_ON = 0x20007003 RTC_VL_CLR = 0x20007014 RTC_VL_READ = 0x40047013 RTC_WIE_OFF = 0x20007010 RTC_WIE_ON = 0x2000700f RTC_WKALM_RD = 0x40287010 RTC_WKALM_SET = 0x8028700f SCM_DEVMEM_DMABUF = 0x4f SCM_DEVMEM_LINEAR = 0x4e SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a SCM_TIMESTAMPNS = 0x23 SCM_TS_OPT_ID = 0x51 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 SECCOMP_IOCTL_NOTIF_ADDFD = 0x80182103 SECCOMP_IOCTL_NOTIF_ID_VALID = 0x80082102 SECCOMP_IOCTL_NOTIF_SET_FLAGS = 0x80082104 SFD_CLOEXEC = 0x80000 SFD_NONBLOCK = 0x80 SIOCATMARK = 0x40047307 SIOCGPGRP = 0x40047309 SIOCGSTAMPNS_NEW = 0x40108907 SIOCGSTAMP_NEW = 0x40108906 SIOCINQ = 0x467f SIOCOUTQ = 0x7472 SIOCSPGRP = 0x80047308 SOCK_CLOEXEC = 0x80000 SOCK_DGRAM = 0x1 SOCK_NONBLOCK = 0x80 SOCK_STREAM = 0x2 SOL_SOCKET = 0xffff SO_ACCEPTCONN = 0x1009 SO_ATTACH_BPF = 0x32 SO_ATTACH_REUSEPORT_CBPF = 0x33 SO_ATTACH_REUSEPORT_EBPF = 0x34 SO_BINDTODEVICE = 0x19 SO_BINDTOIFINDEX = 0x3e SO_BPF_EXTENSIONS = 0x30 SO_BROADCAST = 0x20 SO_BSDCOMPAT = 0xe SO_BUF_LOCK = 0x48 SO_BUSY_POLL = 0x2e SO_BUSY_POLL_BUDGET = 0x46 SO_CNX_ADVICE = 0x35 SO_COOKIE = 0x39 SO_DETACH_REUSEPORT_BPF = 0x44 SO_DEVMEM_DMABUF = 0x4f SO_DEVMEM_DONTNEED = 0x50 SO_DEVMEM_LINEAR = 0x4e SO_DOMAIN = 0x1029 SO_DONTROUTE = 0x10 SO_ERROR = 0x1007 SO_INCOMING_CPU = 0x31 SO_INCOMING_NAPI_ID = 0x38 SO_KEEPALIVE = 0x8 SO_LINGER = 0x80 SO_LOCK_FILTER = 0x2c SO_MARK = 0x24 SO_MAX_PACING_RATE = 0x2f SO_MEMINFO = 0x37 SO_NETNS_COOKIE = 0x47 SO_NOFCS = 0x2b SO_OOBINLINE = 0x100 SO_PASSCRED = 0x11 SO_PASSPIDFD = 0x4c SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x12 SO_PEERGROUPS = 0x3b SO_PEERPIDFD = 0x4d SO_PEERSEC = 0x1e SO_PREFER_BUSY_POLL = 0x45 SO_PROTOCOL = 0x1028 SO_RCVBUF = 0x1002 SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x1004 SO_RCVMARK = 0x4b SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x1006 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x1006 SO_RESERVE_MEM = 0x49 SO_REUSEADDR = 0x4 SO_REUSEPORT = 0x200 SO_RXQ_OVFL = 0x28 SO_SECURITY_AUTHENTICATION = 0x16 SO_SECURITY_ENCRYPTION_NETWORK = 0x18 SO_SECURITY_ENCRYPTION_TRANSPORT = 0x17 SO_SELECT_ERR_QUEUE = 0x2d SO_SNDBUF = 0x1001 SO_SNDBUFFORCE = 0x1f SO_SNDLOWAT = 0x1003 SO_SNDTIMEO = 0x1005 SO_SNDTIMEO_NEW = 0x43 SO_SNDTIMEO_OLD = 0x1005 SO_STYLE = 0x1008 SO_TIMESTAMPING = 0x25 SO_TIMESTAMPING_NEW = 0x41 SO_TIMESTAMPING_OLD = 0x25 SO_TIMESTAMPNS = 0x23 SO_TIMESTAMPNS_NEW = 0x40 SO_TIMESTAMPNS_OLD = 0x23 SO_TIMESTAMP_NEW = 0x3f SO_TXREHASH = 0x4a SO_TXTIME = 0x3d SO_TYPE = 0x1008 SO_WIFI_STATUS = 0x29 SO_ZEROCOPY = 0x3c TAB1 = 0x800 TAB2 = 0x1000 TAB3 = 0x1800 TABDLY = 0x1800 TCFLSH = 0x5407 TCGETA = 0x5401 TCGETS = 0x540d TCGETS2 = 0x4030542a TCSAFLUSH = 0x5410 TCSBRK = 0x5405 TCSBRKP = 0x5486 TCSETA = 0x5402 TCSETAF = 0x5404 TCSETAW = 0x5403 TCSETS = 0x540e TCSETS2 = 0x8030542b TCSETSF = 0x5410 TCSETSF2 = 0x8030542d TCSETSW = 0x540f TCSETSW2 = 0x8030542c TCXONC = 0x5406 TFD_CLOEXEC = 0x80000 TFD_NONBLOCK = 0x80 TIOCCBRK = 0x5428 TIOCCONS = 0x80047478 TIOCEXCL = 0x740d TIOCGDEV = 0x40045432 TIOCGETD = 0x7400 TIOCGETP = 0x7408 TIOCGEXCL = 0x40045440 TIOCGICOUNT = 0x5492 TIOCGISO7816 = 0x40285442 TIOCGLCKTRMIOS = 0x548b TIOCGLTC = 0x7474 TIOCGPGRP = 0x40047477 TIOCGPKT = 0x40045438 TIOCGPTLCK = 0x40045439 TIOCGPTN = 0x40045430 TIOCGPTPEER = 0x20005441 TIOCGRS485 = 0x4020542e TIOCGSERIAL = 0x5484 TIOCGSID = 0x7416 TIOCGSOFTCAR = 0x5481 TIOCGWINSZ = 0x40087468 TIOCINQ = 0x467f TIOCLINUX = 0x5483 TIOCMBIC = 0x741c TIOCMBIS = 0x741b TIOCMGET = 0x741d TIOCMIWAIT = 0x5491 TIOCMSET = 0x741a TIOCM_CAR = 0x100 TIOCM_CD = 0x100 TIOCM_CTS = 0x40 TIOCM_DSR = 0x400 TIOCM_RI = 0x200 TIOCM_RNG = 0x200 TIOCM_SR = 0x20 TIOCM_ST = 0x10 TIOCNOTTY = 0x5471 TIOCNXCL = 0x740e TIOCOUTQ = 0x7472 TIOCPKT = 0x5470 TIOCSBRK = 0x5427 TIOCSCTTY = 0x5480 TIOCSERCONFIG = 0x5488 TIOCSERGETLSR = 0x548e TIOCSERGETMULTI = 0x548f TIOCSERGSTRUCT = 0x548d TIOCSERGWILD = 0x5489 TIOCSERSETMULTI = 0x5490 TIOCSERSWILD = 0x548a TIOCSER_TEMT = 0x1 TIOCSETD = 0x7401 TIOCSETN = 0x740a TIOCSETP = 0x7409 TIOCSIG = 0x80045436 TIOCSISO7816 = 0xc0285443 TIOCSLCKTRMIOS = 0x548c TIOCSLTC = 0x7475 TIOCSPGRP = 0x80047476 TIOCSPTLCK = 0x80045431 TIOCSRS485 = 0xc020542f TIOCSSERIAL = 0x5485 TIOCSSOFTCAR = 0x5482 TIOCSTI = 0x5472 TIOCSWINSZ = 0x80087467 TIOCVHANGUP = 0x5437 TOSTOP = 0x8000 TUNATTACHFILTER = 0x801054d5 TUNDETACHFILTER = 0x801054d6 TUNGETDEVNETNS = 0x200054e3 TUNGETFEATURES = 0x400454cf TUNGETFILTER = 0x401054db TUNGETIFF = 0x400454d2 TUNGETSNDBUF = 0x400454d3 TUNGETVNETBE = 0x400454df TUNGETVNETHDRSZ = 0x400454d7 TUNGETVNETLE = 0x400454dd TUNSETCARRIER = 0x800454e2 TUNSETDEBUG = 0x800454c9 TUNSETFILTEREBPF = 0x400454e1 TUNSETGROUP = 0x800454ce TUNSETIFF = 0x800454ca TUNSETIFINDEX = 0x800454da TUNSETLINK = 0x800454cd TUNSETNOCSUM = 0x800454c8 TUNSETOFFLOAD = 0x800454d0 TUNSETOWNER = 0x800454cc TUNSETPERSIST = 0x800454cb TUNSETQUEUE = 0x800454d9 TUNSETSNDBUF = 0x800454d4 TUNSETSTEERINGEBPF = 0x400454e0 TUNSETTXFILTER = 0x800454d1 TUNSETVNETBE = 0x800454de TUNSETVNETHDRSZ = 0x800454d8 TUNSETVNETLE = 0x800454dc UBI_IOCATT = 0x80186f40 UBI_IOCDET = 0x80046f41 UBI_IOCEBCH = 0x80044f02 UBI_IOCEBER = 0x80044f01 UBI_IOCEBISMAP = 0x40044f05 UBI_IOCEBMAP = 0x80084f03 UBI_IOCEBUNMAP = 0x80044f04 UBI_IOCMKVOL = 0x80986f00 UBI_IOCRMVOL = 0x80046f01 UBI_IOCRNVOL = 0x91106f03 UBI_IOCRPEB = 0x80046f04 UBI_IOCRSVOL = 0x800c6f02 UBI_IOCSETVOLPROP = 0x80104f06 UBI_IOCSPEB = 0x80046f05 UBI_IOCVOLCRBLK = 0x80804f07 UBI_IOCVOLRMBLK = 0x20004f08 UBI_IOCVOLUP = 0x80084f00 VDISCARD = 0xd VEOF = 0x10 VEOL = 0x11 VEOL2 = 0x6 VMIN = 0x4 VREPRINT = 0xc VSTART = 0x8 VSTOP = 0x9 VSUSP = 0xa VSWTC = 0x7 VSWTCH = 0x7 VT1 = 0x4000 VTDLY = 0x4000 VTIME = 0x5 VWERASE = 0xe WDIOC_GETBOOTSTATUS = 0x40045702 WDIOC_GETPRETIMEOUT = 0x40045709 WDIOC_GETSTATUS = 0x40045701 WDIOC_GETSUPPORT = 0x40285700 WDIOC_GETTEMP = 0x40045703 WDIOC_GETTIMELEFT = 0x4004570a WDIOC_GETTIMEOUT = 0x40045707 WDIOC_KEEPALIVE = 0x40045705 WDIOC_SETOPTIONS = 0x40045704 WORDSIZE = 0x40 XCASE = 0x4 XTABS = 0x1800 _HIDIOCGRAWNAME = 0x40804804 _HIDIOCGRAWPHYS = 0x40404805 _HIDIOCGRAWUNIQ = 0x40404808 ) // Errors const ( EADDRINUSE = syscall.Errno(0x7d) EADDRNOTAVAIL = syscall.Errno(0x7e) EADV = syscall.Errno(0x44) EAFNOSUPPORT = syscall.Errno(0x7c) EALREADY = syscall.Errno(0x95) EBADE = syscall.Errno(0x32) EBADFD = syscall.Errno(0x51) EBADMSG = syscall.Errno(0x4d) EBADR = syscall.Errno(0x33) EBADRQC = syscall.Errno(0x36) EBADSLT = syscall.Errno(0x37) EBFONT = syscall.Errno(0x3b) ECANCELED = syscall.Errno(0x9e) ECHRNG = syscall.Errno(0x25) ECOMM = syscall.Errno(0x46) ECONNABORTED = syscall.Errno(0x82) ECONNREFUSED = syscall.Errno(0x92) ECONNRESET = syscall.Errno(0x83) EDEADLK = syscall.Errno(0x2d) EDEADLOCK = syscall.Errno(0x38) EDESTADDRREQ = syscall.Errno(0x60) EDOTDOT = syscall.Errno(0x49) EDQUOT = syscall.Errno(0x46d) EHOSTDOWN = syscall.Errno(0x93) EHOSTUNREACH = syscall.Errno(0x94) EHWPOISON = syscall.Errno(0xa8) EIDRM = syscall.Errno(0x24) EILSEQ = syscall.Errno(0x58) EINIT = syscall.Errno(0x8d) EINPROGRESS = syscall.Errno(0x96) EISCONN = syscall.Errno(0x85) EISNAM = syscall.Errno(0x8b) EKEYEXPIRED = syscall.Errno(0xa2) EKEYREJECTED = syscall.Errno(0xa4) EKEYREVOKED = syscall.Errno(0xa3) EL2HLT = syscall.Errno(0x2c) EL2NSYNC = syscall.Errno(0x26) EL3HLT = syscall.Errno(0x27) EL3RST = syscall.Errno(0x28) ELIBACC = syscall.Errno(0x53) ELIBBAD = syscall.Errno(0x54) ELIBEXEC = syscall.Errno(0x57) ELIBMAX = syscall.Errno(0x56) ELIBSCN = syscall.Errno(0x55) ELNRNG = syscall.Errno(0x29) ELOOP = syscall.Errno(0x5a) EMEDIUMTYPE = syscall.Errno(0xa0) EMSGSIZE = syscall.Errno(0x61) EMULTIHOP = syscall.Errno(0x4a) ENAMETOOLONG = syscall.Errno(0x4e) ENAVAIL = syscall.Errno(0x8a) ENETDOWN = syscall.Errno(0x7f) ENETRESET = syscall.Errno(0x81) ENETUNREACH = syscall.Errno(0x80) ENOANO = syscall.Errno(0x35) ENOBUFS = syscall.Errno(0x84) ENOCSI = syscall.Errno(0x2b) ENODATA = syscall.Errno(0x3d) ENOKEY = syscall.Errno(0xa1) ENOLCK = syscall.Errno(0x2e) ENOLINK = syscall.Errno(0x43) ENOMEDIUM = syscall.Errno(0x9f) ENOMSG = syscall.Errno(0x23) ENONET = syscall.Errno(0x40) ENOPKG = syscall.Errno(0x41) ENOPROTOOPT = syscall.Errno(0x63) ENOSR = syscall.Errno(0x3f) ENOSTR = syscall.Errno(0x3c) ENOSYS = syscall.Errno(0x59) ENOTCONN = syscall.Errno(0x86) ENOTEMPTY = syscall.Errno(0x5d) ENOTNAM = syscall.Errno(0x89) ENOTRECOVERABLE = syscall.Errno(0xa6) ENOTSOCK = syscall.Errno(0x5f) ENOTSUP = syscall.Errno(0x7a) ENOTUNIQ = syscall.Errno(0x50) EOPNOTSUPP = syscall.Errno(0x7a) EOVERFLOW = syscall.Errno(0x4f) EOWNERDEAD = syscall.Errno(0xa5) EPFNOSUPPORT = syscall.Errno(0x7b) EPROTO = syscall.Errno(0x47) EPROTONOSUPPORT = syscall.Errno(0x78) EPROTOTYPE = syscall.Errno(0x62) EREMCHG = syscall.Errno(0x52) EREMDEV = syscall.Errno(0x8e) EREMOTE = syscall.Errno(0x42) EREMOTEIO = syscall.Errno(0x8c) ERESTART = syscall.Errno(0x5b) ERFKILL = syscall.Errno(0xa7) ESHUTDOWN = syscall.Errno(0x8f) ESOCKTNOSUPPORT = syscall.Errno(0x79) ESRMNT = syscall.Errno(0x45) ESTALE = syscall.Errno(0x97) ESTRPIPE = syscall.Errno(0x5c) ETIME = syscall.Errno(0x3e) ETIMEDOUT = syscall.Errno(0x91) ETOOMANYREFS = syscall.Errno(0x90) EUCLEAN = syscall.Errno(0x87) EUNATCH = syscall.Errno(0x2a) EUSERS = syscall.Errno(0x5e) EXFULL = syscall.Errno(0x34) ) // Signals const ( SIGBUS = syscall.Signal(0xa) SIGCHLD = syscall.Signal(0x12) SIGCLD = syscall.Signal(0x12) SIGCONT = syscall.Signal(0x19) SIGEMT = syscall.Signal(0x7) SIGIO = syscall.Signal(0x16) SIGPOLL = syscall.Signal(0x16) SIGPROF = syscall.Signal(0x1d) SIGPWR = syscall.Signal(0x13) SIGSTOP = syscall.Signal(0x17) SIGSYS = syscall.Signal(0xc) SIGTSTP = syscall.Signal(0x18) SIGTTIN = syscall.Signal(0x1a) SIGTTOU = syscall.Signal(0x1b) SIGURG = syscall.Signal(0x15) SIGUSR1 = syscall.Signal(0x10) SIGUSR2 = syscall.Signal(0x11) SIGVTALRM = syscall.Signal(0x1c) SIGWINCH = syscall.Signal(0x14) SIGXCPU = syscall.Signal(0x1e) SIGXFSZ = syscall.Signal(0x1f) ) // Error table var errorList = [...]struct { num syscall.Errno name string desc string }{ {1, "EPERM", "operation not permitted"}, {2, "ENOENT", "no such file or directory"}, {3, "ESRCH", "no such process"}, {4, "EINTR", "interrupted system call"}, {5, "EIO", "input/output error"}, {6, "ENXIO", "no such device or address"}, {7, "E2BIG", "argument list too long"}, {8, "ENOEXEC", "exec format error"}, {9, "EBADF", "bad file descriptor"}, {10, "ECHILD", "no child processes"}, {11, "EAGAIN", "resource temporarily unavailable"}, {12, "ENOMEM", "cannot allocate memory"}, {13, "EACCES", "permission denied"}, {14, "EFAULT", "bad address"}, {15, "ENOTBLK", "block device required"}, {16, "EBUSY", "device or resource busy"}, {17, "EEXIST", "file exists"}, {18, "EXDEV", "invalid cross-device link"}, {19, "ENODEV", "no such device"}, {20, "ENOTDIR", "not a directory"}, {21, "EISDIR", "is a directory"}, {22, "EINVAL", "invalid argument"}, {23, "ENFILE", "too many open files in system"}, {24, "EMFILE", "too many open files"}, {25, "ENOTTY", "inappropriate ioctl for device"}, {26, "ETXTBSY", "text file busy"}, {27, "EFBIG", "file too large"}, {28, "ENOSPC", "no space left on device"}, {29, "ESPIPE", "illegal seek"}, {30, "EROFS", "read-only file system"}, {31, "EMLINK", "too many links"}, {32, "EPIPE", "broken pipe"}, {33, "EDOM", "numerical argument out of domain"}, {34, "ERANGE", "numerical result out of range"}, {35, "ENOMSG", "no message of desired type"}, {36, "EIDRM", "identifier removed"}, {37, "ECHRNG", "channel number out of range"}, {38, "EL2NSYNC", "level 2 not synchronized"}, {39, "EL3HLT", "level 3 halted"}, {40, "EL3RST", "level 3 reset"}, {41, "ELNRNG", "link number out of range"}, {42, "EUNATCH", "protocol driver not attached"}, {43, "ENOCSI", "no CSI structure available"}, {44, "EL2HLT", "level 2 halted"}, {45, "EDEADLK", "resource deadlock avoided"}, {46, "ENOLCK", "no locks available"}, {50, "EBADE", "invalid exchange"}, {51, "EBADR", "invalid request descriptor"}, {52, "EXFULL", "exchange full"}, {53, "ENOANO", "no anode"}, {54, "EBADRQC", "invalid request code"}, {55, "EBADSLT", "invalid slot"}, {56, "EDEADLOCK", "file locking deadlock error"}, {59, "EBFONT", "bad font file format"}, {60, "ENOSTR", "device not a stream"}, {61, "ENODATA", "no data available"}, {62, "ETIME", "timer expired"}, {63, "ENOSR", "out of streams resources"}, {64, "ENONET", "machine is not on the network"}, {65, "ENOPKG", "package not installed"}, {66, "EREMOTE", "object is remote"}, {67, "ENOLINK", "link has been severed"}, {68, "EADV", "advertise error"}, {69, "ESRMNT", "srmount error"}, {70, "ECOMM", "communication error on send"}, {71, "EPROTO", "protocol error"}, {73, "EDOTDOT", "RFS specific error"}, {74, "EMULTIHOP", "multihop attempted"}, {77, "EBADMSG", "bad message"}, {78, "ENAMETOOLONG", "file name too long"}, {79, "EOVERFLOW", "value too large for defined data type"}, {80, "ENOTUNIQ", "name not unique on network"}, {81, "EBADFD", "file descriptor in bad state"}, {82, "EREMCHG", "remote address changed"}, {83, "ELIBACC", "can not access a needed shared library"}, {84, "ELIBBAD", "accessing a corrupted shared library"}, {85, "ELIBSCN", ".lib section in a.out corrupted"}, {86, "ELIBMAX", "attempting to link in too many shared libraries"}, {87, "ELIBEXEC", "cannot exec a shared library directly"}, {88, "EILSEQ", "invalid or incomplete multibyte or wide character"}, {89, "ENOSYS", "function not implemented"}, {90, "ELOOP", "too many levels of symbolic links"}, {91, "ERESTART", "interrupted system call should be restarted"}, {92, "ESTRPIPE", "streams pipe error"}, {93, "ENOTEMPTY", "directory not empty"}, {94, "EUSERS", "too many users"}, {95, "ENOTSOCK", "socket operation on non-socket"}, {96, "EDESTADDRREQ", "destination address required"}, {97, "EMSGSIZE", "message too long"}, {98, "EPROTOTYPE", "protocol wrong type for socket"}, {99, "ENOPROTOOPT", "protocol not available"}, {120, "EPROTONOSUPPORT", "protocol not supported"}, {121, "ESOCKTNOSUPPORT", "socket type not supported"}, {122, "ENOTSUP", "operation not supported"}, {123, "EPFNOSUPPORT", "protocol family not supported"}, {124, "EAFNOSUPPORT", "address family not supported by protocol"}, {125, "EADDRINUSE", "address already in use"}, {126, "EADDRNOTAVAIL", "cannot assign requested address"}, {127, "ENETDOWN", "network is down"}, {128, "ENETUNREACH", "network is unreachable"}, {129, "ENETRESET", "network dropped connection on reset"}, {130, "ECONNABORTED", "software caused connection abort"}, {131, "ECONNRESET", "connection reset by peer"}, {132, "ENOBUFS", "no buffer space available"}, {133, "EISCONN", "transport endpoint is already connected"}, {134, "ENOTCONN", "transport endpoint is not connected"}, {135, "EUCLEAN", "structure needs cleaning"}, {137, "ENOTNAM", "not a XENIX named type file"}, {138, "ENAVAIL", "no XENIX semaphores available"}, {139, "EISNAM", "is a named type file"}, {140, "EREMOTEIO", "remote I/O error"}, {141, "EINIT", "unknown error 141"}, {142, "EREMDEV", "unknown error 142"}, {143, "ESHUTDOWN", "cannot send after transport endpoint shutdown"}, {144, "ETOOMANYREFS", "too many references: cannot splice"}, {145, "ETIMEDOUT", "connection timed out"}, {146, "ECONNREFUSED", "connection refused"}, {147, "EHOSTDOWN", "host is down"}, {148, "EHOSTUNREACH", "no route to host"}, {149, "EALREADY", "operation already in progress"}, {150, "EINPROGRESS", "operation now in progress"}, {151, "ESTALE", "stale file handle"}, {158, "ECANCELED", "operation canceled"}, {159, "ENOMEDIUM", "no medium found"}, {160, "EMEDIUMTYPE", "wrong medium type"}, {161, "ENOKEY", "required key not available"}, {162, "EKEYEXPIRED", "key has expired"}, {163, "EKEYREVOKED", "key has been revoked"}, {164, "EKEYREJECTED", "key was rejected by service"}, {165, "EOWNERDEAD", "owner died"}, {166, "ENOTRECOVERABLE", "state not recoverable"}, {167, "ERFKILL", "operation not possible due to RF-kill"}, {168, "EHWPOISON", "memory page has hardware error"}, {1133, "EDQUOT", "disk quota exceeded"}, } // Signal table var signalList = [...]struct { num syscall.Signal name string desc string }{ {1, "SIGHUP", "hangup"}, {2, "SIGINT", "interrupt"}, {3, "SIGQUIT", "quit"}, {4, "SIGILL", "illegal instruction"}, {5, "SIGTRAP", "trace/breakpoint trap"}, {6, "SIGABRT", "aborted"}, {7, "SIGEMT", "EMT trap"}, {8, "SIGFPE", "floating point exception"}, {9, "SIGKILL", "killed"}, {10, "SIGBUS", "bus error"}, {11, "SIGSEGV", "segmentation fault"}, {12, "SIGSYS", "bad system call"}, {13, "SIGPIPE", "broken pipe"}, {14, "SIGALRM", "alarm clock"}, {15, "SIGTERM", "terminated"}, {16, "SIGUSR1", "user defined signal 1"}, {17, "SIGUSR2", "user defined signal 2"}, {18, "SIGCHLD", "child exited"}, {19, "SIGPWR", "power failure"}, {20, "SIGWINCH", "window changed"}, {21, "SIGURG", "urgent I/O condition"}, {22, "SIGIO", "I/O possible"}, {23, "SIGSTOP", "stopped (signal)"}, {24, "SIGTSTP", "stopped"}, {25, "SIGCONT", "continued"}, {26, "SIGTTIN", "stopped (tty input)"}, {27, "SIGTTOU", "stopped (tty output)"}, {28, "SIGVTALRM", "virtual timer expired"}, {29, "SIGPROF", "profiling timer expired"}, {30, "SIGXCPU", "CPU time limit exceeded"}, {31, "SIGXFSZ", "file size limit exceeded"}, } ================================================ FILE: vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go ================================================ // mkerrors.sh -Wall -Werror -static -I/tmp/mips64le/include // Code generated by the command above; see README.md. DO NOT EDIT. //go:build mips64le && linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -Wall -Werror -static -I/tmp/mips64le/include _const.go package unix import "syscall" const ( B1000000 = 0x1008 B115200 = 0x1002 B1152000 = 0x1009 B1500000 = 0x100a B2000000 = 0x100b B230400 = 0x1003 B2500000 = 0x100c B3000000 = 0x100d B3500000 = 0x100e B4000000 = 0x100f B460800 = 0x1004 B500000 = 0x1005 B57600 = 0x1001 B576000 = 0x1006 B921600 = 0x1007 BLKALIGNOFF = 0x2000127a BLKBSZGET = 0x40081270 BLKBSZSET = 0x80081271 BLKDISCARD = 0x20001277 BLKDISCARDZEROES = 0x2000127c BLKFLSBUF = 0x20001261 BLKFRAGET = 0x20001265 BLKFRASET = 0x20001264 BLKGETDISKSEQ = 0x40081280 BLKGETSIZE = 0x20001260 BLKGETSIZE64 = 0x40081272 BLKIOMIN = 0x20001278 BLKIOOPT = 0x20001279 BLKPBSZGET = 0x2000127b BLKRAGET = 0x20001263 BLKRASET = 0x20001262 BLKROGET = 0x2000125e BLKROSET = 0x2000125d BLKROTATIONAL = 0x2000127e BLKRRPART = 0x2000125f BLKSECDISCARD = 0x2000127d BLKSECTGET = 0x20001267 BLKSECTSET = 0x20001266 BLKSSZGET = 0x20001268 BLKZEROOUT = 0x2000127f BOTHER = 0x1000 BS1 = 0x2000 BSDLY = 0x2000 CBAUD = 0x100f CBAUDEX = 0x1000 CIBAUD = 0x100f0000 CLOCAL = 0x800 CR1 = 0x200 CR2 = 0x400 CR3 = 0x600 CRDLY = 0x600 CREAD = 0x80 CS6 = 0x10 CS7 = 0x20 CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 DM_MPATH_PROBE_PATHS = 0x2000fd12 ECCGETLAYOUT = 0x41484d11 ECCGETSTATS = 0x40104d12 ECHOCTL = 0x200 ECHOE = 0x10 ECHOK = 0x20 ECHOKE = 0x800 ECHONL = 0x40 ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x80 EPIOCGPARAMS = 0x40088a02 EPIOCSPARAMS = 0x80088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 FFDLY = 0x8000 FICLONE = 0x80049409 FICLONERANGE = 0x8020940d FLUSHO = 0x2000 FS_IOC_ENABLE_VERITY = 0x80806685 FS_IOC_GETFLAGS = 0x40086601 FS_IOC_GET_ENCRYPTION_NONCE = 0x4010661b FS_IOC_GET_ENCRYPTION_POLICY = 0x800c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x80106614 FS_IOC_SETFLAGS = 0x80086602 FS_IOC_SET_ENCRYPTION_POLICY = 0x400c6613 F_GETLK = 0xe F_GETLK64 = 0xe F_GETOWN = 0x17 F_RDLCK = 0x0 F_SETLK = 0x6 F_SETLK64 = 0x6 F_SETLKW = 0x7 F_SETLKW64 = 0x7 F_SETOWN = 0x18 F_UNLCK = 0x2 F_WRLCK = 0x1 HIDIOCGRAWINFO = 0x40084803 HIDIOCGRDESC = 0x50044802 HIDIOCGRDESCSIZE = 0x40044801 HIDIOCREVOKE = 0x8004480d HUPCL = 0x400 ICANON = 0x2 IEXTEN = 0x100 IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x80 IOCTL_MEI_NOTIFY_GET = 0x40044803 IOCTL_MEI_NOTIFY_SET = 0x80044802 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x200007b9 IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_MASK = 0xffff0f00 ISIG = 0x1 IUCLC = 0x200 IXOFF = 0x1000 IXON = 0x400 MAP_ANON = 0x800 MAP_ANONYMOUS = 0x800 MAP_DENYWRITE = 0x2000 MAP_EXECUTABLE = 0x4000 MAP_GROWSDOWN = 0x1000 MAP_HUGETLB = 0x80000 MAP_LOCKED = 0x8000 MAP_NONBLOCK = 0x20000 MAP_NORESERVE = 0x400 MAP_POPULATE = 0x10000 MAP_RENAME = 0x800 MAP_STACK = 0x40000 MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MCL_ONFAULT = 0x4 MEMERASE = 0x80084d02 MEMERASE64 = 0x80104d14 MEMGETBADBLOCK = 0x80084d0b MEMGETINFO = 0x40204d01 MEMGETOOBSEL = 0x40c84d0a MEMGETREGIONCOUNT = 0x40044d07 MEMISLOCKED = 0x40084d17 MEMLOCK = 0x80084d05 MEMREAD = 0xc0404d1a MEMREADOOB = 0xc0104d04 MEMSETBADBLOCK = 0x80084d0c MEMUNLOCK = 0x80084d06 MEMWRITEOOB = 0xc0104d03 MTDFILEMODE = 0x20004d13 NFDBITS = 0x40 NLDLY = 0x100 NOFLSH = 0x80 NS_GET_MNTNS_ID = 0x4008b705 NS_GET_NSTYPE = 0x2000b703 NS_GET_OWNER_UID = 0x2000b704 NS_GET_PARENT = 0x2000b702 NS_GET_PID_FROM_PIDNS = 0x4004b706 NS_GET_PID_IN_PIDNS = 0x4004b708 NS_GET_TGID_FROM_PIDNS = 0x4004b707 NS_GET_TGID_IN_PIDNS = 0x4004b709 NS_GET_USERNS = 0x2000b701 OLCUC = 0x2 ONLCR = 0x4 OTPERASE = 0x800c4d19 OTPGETREGIONCOUNT = 0x80044d0e OTPGETREGIONINFO = 0x800c4d0f OTPLOCK = 0x400c4d10 OTPSELECT = 0x40044d0d O_APPEND = 0x8 O_ASYNC = 0x1000 O_CLOEXEC = 0x80000 O_CREAT = 0x100 O_DIRECT = 0x8000 O_DIRECTORY = 0x10000 O_DSYNC = 0x10 O_EXCL = 0x400 O_FSYNC = 0x4010 O_LARGEFILE = 0x0 O_NDELAY = 0x80 O_NOATIME = 0x40000 O_NOCTTY = 0x800 O_NOFOLLOW = 0x20000 O_NONBLOCK = 0x80 O_PATH = 0x200000 O_RSYNC = 0x4010 O_SYNC = 0x4010 O_TMPFILE = 0x410000 O_TRUNC = 0x200 PARENB = 0x100 PARODD = 0x200 PENDIN = 0x4000 PERF_EVENT_IOC_DISABLE = 0x20002401 PERF_EVENT_IOC_ENABLE = 0x20002400 PERF_EVENT_IOC_ID = 0x40082407 PERF_EVENT_IOC_MODIFY_ATTRIBUTES = 0x8008240b PERF_EVENT_IOC_PAUSE_OUTPUT = 0x80042409 PERF_EVENT_IOC_PERIOD = 0x80082404 PERF_EVENT_IOC_QUERY_BPF = 0xc008240a PERF_EVENT_IOC_REFRESH = 0x20002402 PERF_EVENT_IOC_RESET = 0x20002403 PERF_EVENT_IOC_SET_BPF = 0x80042408 PERF_EVENT_IOC_SET_FILTER = 0x80082406 PERF_EVENT_IOC_SET_OUTPUT = 0x20002405 PPPIOCATTACH = 0x8004743d PPPIOCATTCHAN = 0x80047438 PPPIOCBRIDGECHAN = 0x80047435 PPPIOCCONNECT = 0x8004743a PPPIOCDETACH = 0x8004743c PPPIOCDISCONN = 0x20007439 PPPIOCGASYNCMAP = 0x40047458 PPPIOCGCHAN = 0x40047437 PPPIOCGDEBUG = 0x40047441 PPPIOCGFLAGS = 0x4004745a PPPIOCGIDLE = 0x4010743f PPPIOCGIDLE32 = 0x4008743f PPPIOCGIDLE64 = 0x4010743f PPPIOCGL2TPSTATS = 0x40487436 PPPIOCGMRU = 0x40047453 PPPIOCGRASYNCMAP = 0x40047455 PPPIOCGUNIT = 0x40047456 PPPIOCGXASYNCMAP = 0x40207450 PPPIOCSACTIVE = 0x80107446 PPPIOCSASYNCMAP = 0x80047457 PPPIOCSCOMPRESS = 0x8010744d PPPIOCSDEBUG = 0x80047440 PPPIOCSFLAGS = 0x80047459 PPPIOCSMAXCID = 0x80047451 PPPIOCSMRRU = 0x8004743b PPPIOCSMRU = 0x80047452 PPPIOCSNPMODE = 0x8008744b PPPIOCSPASS = 0x80107447 PPPIOCSRASYNCMAP = 0x80047454 PPPIOCSXASYNCMAP = 0x8020744f PPPIOCUNBRIDGECHAN = 0x20007434 PPPIOCXFERUNIT = 0x2000744e PR_SET_PTRACER_ANY = 0xffffffffffffffff PTP_CLOCK_GETCAPS = 0x40503d01 PTP_CLOCK_GETCAPS2 = 0x40503d0a PTP_ENABLE_PPS = 0x80043d04 PTP_ENABLE_PPS2 = 0x80043d0d PTP_EXTTS_REQUEST = 0x80103d02 PTP_EXTTS_REQUEST2 = 0x80103d0b PTP_MASK_CLEAR_ALL = 0x20003d13 PTP_MASK_EN_SINGLE = 0x80043d14 PTP_PEROUT_REQUEST = 0x80383d03 PTP_PEROUT_REQUEST2 = 0x80383d0c PTP_PIN_SETFUNC = 0x80603d07 PTP_PIN_SETFUNC2 = 0x80603d10 PTP_SYS_OFFSET = 0x83403d05 PTP_SYS_OFFSET2 = 0x83403d0e PTRACE_GETFPREGS = 0xe PTRACE_GET_THREAD_AREA = 0x19 PTRACE_GET_THREAD_AREA_3264 = 0xc4 PTRACE_GET_WATCH_REGS = 0xd0 PTRACE_OLDSETOPTIONS = 0x15 PTRACE_PEEKDATA_3264 = 0xc1 PTRACE_PEEKTEXT_3264 = 0xc0 PTRACE_POKEDATA_3264 = 0xc3 PTRACE_POKETEXT_3264 = 0xc2 PTRACE_SETFPREGS = 0xf PTRACE_SET_THREAD_AREA = 0x1a PTRACE_SET_WATCH_REGS = 0xd1 RLIMIT_AS = 0x6 RLIMIT_MEMLOCK = 0x9 RLIMIT_NOFILE = 0x5 RLIMIT_NPROC = 0x8 RLIMIT_RSS = 0x7 RNDADDENTROPY = 0x80085203 RNDADDTOENTCNT = 0x80045201 RNDCLEARPOOL = 0x20005206 RNDGETENTCNT = 0x40045200 RNDGETPOOL = 0x40085202 RNDRESEEDCRNG = 0x20005207 RNDZAPENTCNT = 0x20005204 RTC_AIE_OFF = 0x20007002 RTC_AIE_ON = 0x20007001 RTC_ALM_READ = 0x40247008 RTC_ALM_SET = 0x80247007 RTC_EPOCH_READ = 0x4008700d RTC_EPOCH_SET = 0x8008700e RTC_IRQP_READ = 0x4008700b RTC_IRQP_SET = 0x8008700c RTC_PARAM_GET = 0x80187013 RTC_PARAM_SET = 0x80187014 RTC_PIE_OFF = 0x20007006 RTC_PIE_ON = 0x20007005 RTC_PLL_GET = 0x40207011 RTC_PLL_SET = 0x80207012 RTC_RD_TIME = 0x40247009 RTC_SET_TIME = 0x8024700a RTC_UIE_OFF = 0x20007004 RTC_UIE_ON = 0x20007003 RTC_VL_CLR = 0x20007014 RTC_VL_READ = 0x40047013 RTC_WIE_OFF = 0x20007010 RTC_WIE_ON = 0x2000700f RTC_WKALM_RD = 0x40287010 RTC_WKALM_SET = 0x8028700f SCM_DEVMEM_DMABUF = 0x4f SCM_DEVMEM_LINEAR = 0x4e SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a SCM_TIMESTAMPNS = 0x23 SCM_TS_OPT_ID = 0x51 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 SECCOMP_IOCTL_NOTIF_ADDFD = 0x80182103 SECCOMP_IOCTL_NOTIF_ID_VALID = 0x80082102 SECCOMP_IOCTL_NOTIF_SET_FLAGS = 0x80082104 SFD_CLOEXEC = 0x80000 SFD_NONBLOCK = 0x80 SIOCATMARK = 0x40047307 SIOCGPGRP = 0x40047309 SIOCGSTAMPNS_NEW = 0x40108907 SIOCGSTAMP_NEW = 0x40108906 SIOCINQ = 0x467f SIOCOUTQ = 0x7472 SIOCSPGRP = 0x80047308 SOCK_CLOEXEC = 0x80000 SOCK_DGRAM = 0x1 SOCK_NONBLOCK = 0x80 SOCK_STREAM = 0x2 SOL_SOCKET = 0xffff SO_ACCEPTCONN = 0x1009 SO_ATTACH_BPF = 0x32 SO_ATTACH_REUSEPORT_CBPF = 0x33 SO_ATTACH_REUSEPORT_EBPF = 0x34 SO_BINDTODEVICE = 0x19 SO_BINDTOIFINDEX = 0x3e SO_BPF_EXTENSIONS = 0x30 SO_BROADCAST = 0x20 SO_BSDCOMPAT = 0xe SO_BUF_LOCK = 0x48 SO_BUSY_POLL = 0x2e SO_BUSY_POLL_BUDGET = 0x46 SO_CNX_ADVICE = 0x35 SO_COOKIE = 0x39 SO_DETACH_REUSEPORT_BPF = 0x44 SO_DEVMEM_DMABUF = 0x4f SO_DEVMEM_DONTNEED = 0x50 SO_DEVMEM_LINEAR = 0x4e SO_DOMAIN = 0x1029 SO_DONTROUTE = 0x10 SO_ERROR = 0x1007 SO_INCOMING_CPU = 0x31 SO_INCOMING_NAPI_ID = 0x38 SO_KEEPALIVE = 0x8 SO_LINGER = 0x80 SO_LOCK_FILTER = 0x2c SO_MARK = 0x24 SO_MAX_PACING_RATE = 0x2f SO_MEMINFO = 0x37 SO_NETNS_COOKIE = 0x47 SO_NOFCS = 0x2b SO_OOBINLINE = 0x100 SO_PASSCRED = 0x11 SO_PASSPIDFD = 0x4c SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x12 SO_PEERGROUPS = 0x3b SO_PEERPIDFD = 0x4d SO_PEERSEC = 0x1e SO_PREFER_BUSY_POLL = 0x45 SO_PROTOCOL = 0x1028 SO_RCVBUF = 0x1002 SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x1004 SO_RCVMARK = 0x4b SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x1006 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x1006 SO_RESERVE_MEM = 0x49 SO_REUSEADDR = 0x4 SO_REUSEPORT = 0x200 SO_RXQ_OVFL = 0x28 SO_SECURITY_AUTHENTICATION = 0x16 SO_SECURITY_ENCRYPTION_NETWORK = 0x18 SO_SECURITY_ENCRYPTION_TRANSPORT = 0x17 SO_SELECT_ERR_QUEUE = 0x2d SO_SNDBUF = 0x1001 SO_SNDBUFFORCE = 0x1f SO_SNDLOWAT = 0x1003 SO_SNDTIMEO = 0x1005 SO_SNDTIMEO_NEW = 0x43 SO_SNDTIMEO_OLD = 0x1005 SO_STYLE = 0x1008 SO_TIMESTAMPING = 0x25 SO_TIMESTAMPING_NEW = 0x41 SO_TIMESTAMPING_OLD = 0x25 SO_TIMESTAMPNS = 0x23 SO_TIMESTAMPNS_NEW = 0x40 SO_TIMESTAMPNS_OLD = 0x23 SO_TIMESTAMP_NEW = 0x3f SO_TXREHASH = 0x4a SO_TXTIME = 0x3d SO_TYPE = 0x1008 SO_WIFI_STATUS = 0x29 SO_ZEROCOPY = 0x3c TAB1 = 0x800 TAB2 = 0x1000 TAB3 = 0x1800 TABDLY = 0x1800 TCFLSH = 0x5407 TCGETA = 0x5401 TCGETS = 0x540d TCGETS2 = 0x4030542a TCSAFLUSH = 0x5410 TCSBRK = 0x5405 TCSBRKP = 0x5486 TCSETA = 0x5402 TCSETAF = 0x5404 TCSETAW = 0x5403 TCSETS = 0x540e TCSETS2 = 0x8030542b TCSETSF = 0x5410 TCSETSF2 = 0x8030542d TCSETSW = 0x540f TCSETSW2 = 0x8030542c TCXONC = 0x5406 TFD_CLOEXEC = 0x80000 TFD_NONBLOCK = 0x80 TIOCCBRK = 0x5428 TIOCCONS = 0x80047478 TIOCEXCL = 0x740d TIOCGDEV = 0x40045432 TIOCGETD = 0x7400 TIOCGETP = 0x7408 TIOCGEXCL = 0x40045440 TIOCGICOUNT = 0x5492 TIOCGISO7816 = 0x40285442 TIOCGLCKTRMIOS = 0x548b TIOCGLTC = 0x7474 TIOCGPGRP = 0x40047477 TIOCGPKT = 0x40045438 TIOCGPTLCK = 0x40045439 TIOCGPTN = 0x40045430 TIOCGPTPEER = 0x20005441 TIOCGRS485 = 0x4020542e TIOCGSERIAL = 0x5484 TIOCGSID = 0x7416 TIOCGSOFTCAR = 0x5481 TIOCGWINSZ = 0x40087468 TIOCINQ = 0x467f TIOCLINUX = 0x5483 TIOCMBIC = 0x741c TIOCMBIS = 0x741b TIOCMGET = 0x741d TIOCMIWAIT = 0x5491 TIOCMSET = 0x741a TIOCM_CAR = 0x100 TIOCM_CD = 0x100 TIOCM_CTS = 0x40 TIOCM_DSR = 0x400 TIOCM_RI = 0x200 TIOCM_RNG = 0x200 TIOCM_SR = 0x20 TIOCM_ST = 0x10 TIOCNOTTY = 0x5471 TIOCNXCL = 0x740e TIOCOUTQ = 0x7472 TIOCPKT = 0x5470 TIOCSBRK = 0x5427 TIOCSCTTY = 0x5480 TIOCSERCONFIG = 0x5488 TIOCSERGETLSR = 0x548e TIOCSERGETMULTI = 0x548f TIOCSERGSTRUCT = 0x548d TIOCSERGWILD = 0x5489 TIOCSERSETMULTI = 0x5490 TIOCSERSWILD = 0x548a TIOCSER_TEMT = 0x1 TIOCSETD = 0x7401 TIOCSETN = 0x740a TIOCSETP = 0x7409 TIOCSIG = 0x80045436 TIOCSISO7816 = 0xc0285443 TIOCSLCKTRMIOS = 0x548c TIOCSLTC = 0x7475 TIOCSPGRP = 0x80047476 TIOCSPTLCK = 0x80045431 TIOCSRS485 = 0xc020542f TIOCSSERIAL = 0x5485 TIOCSSOFTCAR = 0x5482 TIOCSTI = 0x5472 TIOCSWINSZ = 0x80087467 TIOCVHANGUP = 0x5437 TOSTOP = 0x8000 TUNATTACHFILTER = 0x801054d5 TUNDETACHFILTER = 0x801054d6 TUNGETDEVNETNS = 0x200054e3 TUNGETFEATURES = 0x400454cf TUNGETFILTER = 0x401054db TUNGETIFF = 0x400454d2 TUNGETSNDBUF = 0x400454d3 TUNGETVNETBE = 0x400454df TUNGETVNETHDRSZ = 0x400454d7 TUNGETVNETLE = 0x400454dd TUNSETCARRIER = 0x800454e2 TUNSETDEBUG = 0x800454c9 TUNSETFILTEREBPF = 0x400454e1 TUNSETGROUP = 0x800454ce TUNSETIFF = 0x800454ca TUNSETIFINDEX = 0x800454da TUNSETLINK = 0x800454cd TUNSETNOCSUM = 0x800454c8 TUNSETOFFLOAD = 0x800454d0 TUNSETOWNER = 0x800454cc TUNSETPERSIST = 0x800454cb TUNSETQUEUE = 0x800454d9 TUNSETSNDBUF = 0x800454d4 TUNSETSTEERINGEBPF = 0x400454e0 TUNSETTXFILTER = 0x800454d1 TUNSETVNETBE = 0x800454de TUNSETVNETHDRSZ = 0x800454d8 TUNSETVNETLE = 0x800454dc UBI_IOCATT = 0x80186f40 UBI_IOCDET = 0x80046f41 UBI_IOCEBCH = 0x80044f02 UBI_IOCEBER = 0x80044f01 UBI_IOCEBISMAP = 0x40044f05 UBI_IOCEBMAP = 0x80084f03 UBI_IOCEBUNMAP = 0x80044f04 UBI_IOCMKVOL = 0x80986f00 UBI_IOCRMVOL = 0x80046f01 UBI_IOCRNVOL = 0x91106f03 UBI_IOCRPEB = 0x80046f04 UBI_IOCRSVOL = 0x800c6f02 UBI_IOCSETVOLPROP = 0x80104f06 UBI_IOCSPEB = 0x80046f05 UBI_IOCVOLCRBLK = 0x80804f07 UBI_IOCVOLRMBLK = 0x20004f08 UBI_IOCVOLUP = 0x80084f00 VDISCARD = 0xd VEOF = 0x10 VEOL = 0x11 VEOL2 = 0x6 VMIN = 0x4 VREPRINT = 0xc VSTART = 0x8 VSTOP = 0x9 VSUSP = 0xa VSWTC = 0x7 VSWTCH = 0x7 VT1 = 0x4000 VTDLY = 0x4000 VTIME = 0x5 VWERASE = 0xe WDIOC_GETBOOTSTATUS = 0x40045702 WDIOC_GETPRETIMEOUT = 0x40045709 WDIOC_GETSTATUS = 0x40045701 WDIOC_GETSUPPORT = 0x40285700 WDIOC_GETTEMP = 0x40045703 WDIOC_GETTIMELEFT = 0x4004570a WDIOC_GETTIMEOUT = 0x40045707 WDIOC_KEEPALIVE = 0x40045705 WDIOC_SETOPTIONS = 0x40045704 WORDSIZE = 0x40 XCASE = 0x4 XTABS = 0x1800 _HIDIOCGRAWNAME = 0x40804804 _HIDIOCGRAWPHYS = 0x40404805 _HIDIOCGRAWUNIQ = 0x40404808 ) // Errors const ( EADDRINUSE = syscall.Errno(0x7d) EADDRNOTAVAIL = syscall.Errno(0x7e) EADV = syscall.Errno(0x44) EAFNOSUPPORT = syscall.Errno(0x7c) EALREADY = syscall.Errno(0x95) EBADE = syscall.Errno(0x32) EBADFD = syscall.Errno(0x51) EBADMSG = syscall.Errno(0x4d) EBADR = syscall.Errno(0x33) EBADRQC = syscall.Errno(0x36) EBADSLT = syscall.Errno(0x37) EBFONT = syscall.Errno(0x3b) ECANCELED = syscall.Errno(0x9e) ECHRNG = syscall.Errno(0x25) ECOMM = syscall.Errno(0x46) ECONNABORTED = syscall.Errno(0x82) ECONNREFUSED = syscall.Errno(0x92) ECONNRESET = syscall.Errno(0x83) EDEADLK = syscall.Errno(0x2d) EDEADLOCK = syscall.Errno(0x38) EDESTADDRREQ = syscall.Errno(0x60) EDOTDOT = syscall.Errno(0x49) EDQUOT = syscall.Errno(0x46d) EHOSTDOWN = syscall.Errno(0x93) EHOSTUNREACH = syscall.Errno(0x94) EHWPOISON = syscall.Errno(0xa8) EIDRM = syscall.Errno(0x24) EILSEQ = syscall.Errno(0x58) EINIT = syscall.Errno(0x8d) EINPROGRESS = syscall.Errno(0x96) EISCONN = syscall.Errno(0x85) EISNAM = syscall.Errno(0x8b) EKEYEXPIRED = syscall.Errno(0xa2) EKEYREJECTED = syscall.Errno(0xa4) EKEYREVOKED = syscall.Errno(0xa3) EL2HLT = syscall.Errno(0x2c) EL2NSYNC = syscall.Errno(0x26) EL3HLT = syscall.Errno(0x27) EL3RST = syscall.Errno(0x28) ELIBACC = syscall.Errno(0x53) ELIBBAD = syscall.Errno(0x54) ELIBEXEC = syscall.Errno(0x57) ELIBMAX = syscall.Errno(0x56) ELIBSCN = syscall.Errno(0x55) ELNRNG = syscall.Errno(0x29) ELOOP = syscall.Errno(0x5a) EMEDIUMTYPE = syscall.Errno(0xa0) EMSGSIZE = syscall.Errno(0x61) EMULTIHOP = syscall.Errno(0x4a) ENAMETOOLONG = syscall.Errno(0x4e) ENAVAIL = syscall.Errno(0x8a) ENETDOWN = syscall.Errno(0x7f) ENETRESET = syscall.Errno(0x81) ENETUNREACH = syscall.Errno(0x80) ENOANO = syscall.Errno(0x35) ENOBUFS = syscall.Errno(0x84) ENOCSI = syscall.Errno(0x2b) ENODATA = syscall.Errno(0x3d) ENOKEY = syscall.Errno(0xa1) ENOLCK = syscall.Errno(0x2e) ENOLINK = syscall.Errno(0x43) ENOMEDIUM = syscall.Errno(0x9f) ENOMSG = syscall.Errno(0x23) ENONET = syscall.Errno(0x40) ENOPKG = syscall.Errno(0x41) ENOPROTOOPT = syscall.Errno(0x63) ENOSR = syscall.Errno(0x3f) ENOSTR = syscall.Errno(0x3c) ENOSYS = syscall.Errno(0x59) ENOTCONN = syscall.Errno(0x86) ENOTEMPTY = syscall.Errno(0x5d) ENOTNAM = syscall.Errno(0x89) ENOTRECOVERABLE = syscall.Errno(0xa6) ENOTSOCK = syscall.Errno(0x5f) ENOTSUP = syscall.Errno(0x7a) ENOTUNIQ = syscall.Errno(0x50) EOPNOTSUPP = syscall.Errno(0x7a) EOVERFLOW = syscall.Errno(0x4f) EOWNERDEAD = syscall.Errno(0xa5) EPFNOSUPPORT = syscall.Errno(0x7b) EPROTO = syscall.Errno(0x47) EPROTONOSUPPORT = syscall.Errno(0x78) EPROTOTYPE = syscall.Errno(0x62) EREMCHG = syscall.Errno(0x52) EREMDEV = syscall.Errno(0x8e) EREMOTE = syscall.Errno(0x42) EREMOTEIO = syscall.Errno(0x8c) ERESTART = syscall.Errno(0x5b) ERFKILL = syscall.Errno(0xa7) ESHUTDOWN = syscall.Errno(0x8f) ESOCKTNOSUPPORT = syscall.Errno(0x79) ESRMNT = syscall.Errno(0x45) ESTALE = syscall.Errno(0x97) ESTRPIPE = syscall.Errno(0x5c) ETIME = syscall.Errno(0x3e) ETIMEDOUT = syscall.Errno(0x91) ETOOMANYREFS = syscall.Errno(0x90) EUCLEAN = syscall.Errno(0x87) EUNATCH = syscall.Errno(0x2a) EUSERS = syscall.Errno(0x5e) EXFULL = syscall.Errno(0x34) ) // Signals const ( SIGBUS = syscall.Signal(0xa) SIGCHLD = syscall.Signal(0x12) SIGCLD = syscall.Signal(0x12) SIGCONT = syscall.Signal(0x19) SIGEMT = syscall.Signal(0x7) SIGIO = syscall.Signal(0x16) SIGPOLL = syscall.Signal(0x16) SIGPROF = syscall.Signal(0x1d) SIGPWR = syscall.Signal(0x13) SIGSTOP = syscall.Signal(0x17) SIGSYS = syscall.Signal(0xc) SIGTSTP = syscall.Signal(0x18) SIGTTIN = syscall.Signal(0x1a) SIGTTOU = syscall.Signal(0x1b) SIGURG = syscall.Signal(0x15) SIGUSR1 = syscall.Signal(0x10) SIGUSR2 = syscall.Signal(0x11) SIGVTALRM = syscall.Signal(0x1c) SIGWINCH = syscall.Signal(0x14) SIGXCPU = syscall.Signal(0x1e) SIGXFSZ = syscall.Signal(0x1f) ) // Error table var errorList = [...]struct { num syscall.Errno name string desc string }{ {1, "EPERM", "operation not permitted"}, {2, "ENOENT", "no such file or directory"}, {3, "ESRCH", "no such process"}, {4, "EINTR", "interrupted system call"}, {5, "EIO", "input/output error"}, {6, "ENXIO", "no such device or address"}, {7, "E2BIG", "argument list too long"}, {8, "ENOEXEC", "exec format error"}, {9, "EBADF", "bad file descriptor"}, {10, "ECHILD", "no child processes"}, {11, "EAGAIN", "resource temporarily unavailable"}, {12, "ENOMEM", "cannot allocate memory"}, {13, "EACCES", "permission denied"}, {14, "EFAULT", "bad address"}, {15, "ENOTBLK", "block device required"}, {16, "EBUSY", "device or resource busy"}, {17, "EEXIST", "file exists"}, {18, "EXDEV", "invalid cross-device link"}, {19, "ENODEV", "no such device"}, {20, "ENOTDIR", "not a directory"}, {21, "EISDIR", "is a directory"}, {22, "EINVAL", "invalid argument"}, {23, "ENFILE", "too many open files in system"}, {24, "EMFILE", "too many open files"}, {25, "ENOTTY", "inappropriate ioctl for device"}, {26, "ETXTBSY", "text file busy"}, {27, "EFBIG", "file too large"}, {28, "ENOSPC", "no space left on device"}, {29, "ESPIPE", "illegal seek"}, {30, "EROFS", "read-only file system"}, {31, "EMLINK", "too many links"}, {32, "EPIPE", "broken pipe"}, {33, "EDOM", "numerical argument out of domain"}, {34, "ERANGE", "numerical result out of range"}, {35, "ENOMSG", "no message of desired type"}, {36, "EIDRM", "identifier removed"}, {37, "ECHRNG", "channel number out of range"}, {38, "EL2NSYNC", "level 2 not synchronized"}, {39, "EL3HLT", "level 3 halted"}, {40, "EL3RST", "level 3 reset"}, {41, "ELNRNG", "link number out of range"}, {42, "EUNATCH", "protocol driver not attached"}, {43, "ENOCSI", "no CSI structure available"}, {44, "EL2HLT", "level 2 halted"}, {45, "EDEADLK", "resource deadlock avoided"}, {46, "ENOLCK", "no locks available"}, {50, "EBADE", "invalid exchange"}, {51, "EBADR", "invalid request descriptor"}, {52, "EXFULL", "exchange full"}, {53, "ENOANO", "no anode"}, {54, "EBADRQC", "invalid request code"}, {55, "EBADSLT", "invalid slot"}, {56, "EDEADLOCK", "file locking deadlock error"}, {59, "EBFONT", "bad font file format"}, {60, "ENOSTR", "device not a stream"}, {61, "ENODATA", "no data available"}, {62, "ETIME", "timer expired"}, {63, "ENOSR", "out of streams resources"}, {64, "ENONET", "machine is not on the network"}, {65, "ENOPKG", "package not installed"}, {66, "EREMOTE", "object is remote"}, {67, "ENOLINK", "link has been severed"}, {68, "EADV", "advertise error"}, {69, "ESRMNT", "srmount error"}, {70, "ECOMM", "communication error on send"}, {71, "EPROTO", "protocol error"}, {73, "EDOTDOT", "RFS specific error"}, {74, "EMULTIHOP", "multihop attempted"}, {77, "EBADMSG", "bad message"}, {78, "ENAMETOOLONG", "file name too long"}, {79, "EOVERFLOW", "value too large for defined data type"}, {80, "ENOTUNIQ", "name not unique on network"}, {81, "EBADFD", "file descriptor in bad state"}, {82, "EREMCHG", "remote address changed"}, {83, "ELIBACC", "can not access a needed shared library"}, {84, "ELIBBAD", "accessing a corrupted shared library"}, {85, "ELIBSCN", ".lib section in a.out corrupted"}, {86, "ELIBMAX", "attempting to link in too many shared libraries"}, {87, "ELIBEXEC", "cannot exec a shared library directly"}, {88, "EILSEQ", "invalid or incomplete multibyte or wide character"}, {89, "ENOSYS", "function not implemented"}, {90, "ELOOP", "too many levels of symbolic links"}, {91, "ERESTART", "interrupted system call should be restarted"}, {92, "ESTRPIPE", "streams pipe error"}, {93, "ENOTEMPTY", "directory not empty"}, {94, "EUSERS", "too many users"}, {95, "ENOTSOCK", "socket operation on non-socket"}, {96, "EDESTADDRREQ", "destination address required"}, {97, "EMSGSIZE", "message too long"}, {98, "EPROTOTYPE", "protocol wrong type for socket"}, {99, "ENOPROTOOPT", "protocol not available"}, {120, "EPROTONOSUPPORT", "protocol not supported"}, {121, "ESOCKTNOSUPPORT", "socket type not supported"}, {122, "ENOTSUP", "operation not supported"}, {123, "EPFNOSUPPORT", "protocol family not supported"}, {124, "EAFNOSUPPORT", "address family not supported by protocol"}, {125, "EADDRINUSE", "address already in use"}, {126, "EADDRNOTAVAIL", "cannot assign requested address"}, {127, "ENETDOWN", "network is down"}, {128, "ENETUNREACH", "network is unreachable"}, {129, "ENETRESET", "network dropped connection on reset"}, {130, "ECONNABORTED", "software caused connection abort"}, {131, "ECONNRESET", "connection reset by peer"}, {132, "ENOBUFS", "no buffer space available"}, {133, "EISCONN", "transport endpoint is already connected"}, {134, "ENOTCONN", "transport endpoint is not connected"}, {135, "EUCLEAN", "structure needs cleaning"}, {137, "ENOTNAM", "not a XENIX named type file"}, {138, "ENAVAIL", "no XENIX semaphores available"}, {139, "EISNAM", "is a named type file"}, {140, "EREMOTEIO", "remote I/O error"}, {141, "EINIT", "unknown error 141"}, {142, "EREMDEV", "unknown error 142"}, {143, "ESHUTDOWN", "cannot send after transport endpoint shutdown"}, {144, "ETOOMANYREFS", "too many references: cannot splice"}, {145, "ETIMEDOUT", "connection timed out"}, {146, "ECONNREFUSED", "connection refused"}, {147, "EHOSTDOWN", "host is down"}, {148, "EHOSTUNREACH", "no route to host"}, {149, "EALREADY", "operation already in progress"}, {150, "EINPROGRESS", "operation now in progress"}, {151, "ESTALE", "stale file handle"}, {158, "ECANCELED", "operation canceled"}, {159, "ENOMEDIUM", "no medium found"}, {160, "EMEDIUMTYPE", "wrong medium type"}, {161, "ENOKEY", "required key not available"}, {162, "EKEYEXPIRED", "key has expired"}, {163, "EKEYREVOKED", "key has been revoked"}, {164, "EKEYREJECTED", "key was rejected by service"}, {165, "EOWNERDEAD", "owner died"}, {166, "ENOTRECOVERABLE", "state not recoverable"}, {167, "ERFKILL", "operation not possible due to RF-kill"}, {168, "EHWPOISON", "memory page has hardware error"}, {1133, "EDQUOT", "disk quota exceeded"}, } // Signal table var signalList = [...]struct { num syscall.Signal name string desc string }{ {1, "SIGHUP", "hangup"}, {2, "SIGINT", "interrupt"}, {3, "SIGQUIT", "quit"}, {4, "SIGILL", "illegal instruction"}, {5, "SIGTRAP", "trace/breakpoint trap"}, {6, "SIGABRT", "aborted"}, {7, "SIGEMT", "EMT trap"}, {8, "SIGFPE", "floating point exception"}, {9, "SIGKILL", "killed"}, {10, "SIGBUS", "bus error"}, {11, "SIGSEGV", "segmentation fault"}, {12, "SIGSYS", "bad system call"}, {13, "SIGPIPE", "broken pipe"}, {14, "SIGALRM", "alarm clock"}, {15, "SIGTERM", "terminated"}, {16, "SIGUSR1", "user defined signal 1"}, {17, "SIGUSR2", "user defined signal 2"}, {18, "SIGCHLD", "child exited"}, {19, "SIGPWR", "power failure"}, {20, "SIGWINCH", "window changed"}, {21, "SIGURG", "urgent I/O condition"}, {22, "SIGIO", "I/O possible"}, {23, "SIGSTOP", "stopped (signal)"}, {24, "SIGTSTP", "stopped"}, {25, "SIGCONT", "continued"}, {26, "SIGTTIN", "stopped (tty input)"}, {27, "SIGTTOU", "stopped (tty output)"}, {28, "SIGVTALRM", "virtual timer expired"}, {29, "SIGPROF", "profiling timer expired"}, {30, "SIGXCPU", "CPU time limit exceeded"}, {31, "SIGXFSZ", "file size limit exceeded"}, } ================================================ FILE: vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go ================================================ // mkerrors.sh -Wall -Werror -static -I/tmp/mipsle/include // Code generated by the command above; see README.md. DO NOT EDIT. //go:build mipsle && linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -Wall -Werror -static -I/tmp/mipsle/include _const.go package unix import "syscall" const ( B1000000 = 0x1008 B115200 = 0x1002 B1152000 = 0x1009 B1500000 = 0x100a B2000000 = 0x100b B230400 = 0x1003 B2500000 = 0x100c B3000000 = 0x100d B3500000 = 0x100e B4000000 = 0x100f B460800 = 0x1004 B500000 = 0x1005 B57600 = 0x1001 B576000 = 0x1006 B921600 = 0x1007 BLKALIGNOFF = 0x2000127a BLKBSZGET = 0x40041270 BLKBSZSET = 0x80041271 BLKDISCARD = 0x20001277 BLKDISCARDZEROES = 0x2000127c BLKFLSBUF = 0x20001261 BLKFRAGET = 0x20001265 BLKFRASET = 0x20001264 BLKGETDISKSEQ = 0x40081280 BLKGETSIZE = 0x20001260 BLKGETSIZE64 = 0x40041272 BLKIOMIN = 0x20001278 BLKIOOPT = 0x20001279 BLKPBSZGET = 0x2000127b BLKRAGET = 0x20001263 BLKRASET = 0x20001262 BLKROGET = 0x2000125e BLKROSET = 0x2000125d BLKROTATIONAL = 0x2000127e BLKRRPART = 0x2000125f BLKSECDISCARD = 0x2000127d BLKSECTGET = 0x20001267 BLKSECTSET = 0x20001266 BLKSSZGET = 0x20001268 BLKZEROOUT = 0x2000127f BOTHER = 0x1000 BS1 = 0x2000 BSDLY = 0x2000 CBAUD = 0x100f CBAUDEX = 0x1000 CIBAUD = 0x100f0000 CLOCAL = 0x800 CR1 = 0x200 CR2 = 0x400 CR3 = 0x600 CRDLY = 0x600 CREAD = 0x80 CS6 = 0x10 CS7 = 0x20 CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 DM_MPATH_PROBE_PATHS = 0x2000fd12 ECCGETLAYOUT = 0x41484d11 ECCGETSTATS = 0x40104d12 ECHOCTL = 0x200 ECHOE = 0x10 ECHOK = 0x20 ECHOKE = 0x800 ECHONL = 0x40 ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x80 EPIOCGPARAMS = 0x40088a02 EPIOCSPARAMS = 0x80088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 FFDLY = 0x8000 FICLONE = 0x80049409 FICLONERANGE = 0x8020940d FLUSHO = 0x2000 FS_IOC_ENABLE_VERITY = 0x80806685 FS_IOC_GETFLAGS = 0x40046601 FS_IOC_GET_ENCRYPTION_NONCE = 0x4010661b FS_IOC_GET_ENCRYPTION_POLICY = 0x800c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x80106614 FS_IOC_SETFLAGS = 0x80046602 FS_IOC_SET_ENCRYPTION_POLICY = 0x400c6613 F_GETLK = 0x21 F_GETLK64 = 0x21 F_GETOWN = 0x17 F_RDLCK = 0x0 F_SETLK = 0x22 F_SETLK64 = 0x22 F_SETLKW = 0x23 F_SETLKW64 = 0x23 F_SETOWN = 0x18 F_UNLCK = 0x2 F_WRLCK = 0x1 HIDIOCGRAWINFO = 0x40084803 HIDIOCGRDESC = 0x50044802 HIDIOCGRDESCSIZE = 0x40044801 HIDIOCREVOKE = 0x8004480d HUPCL = 0x400 ICANON = 0x2 IEXTEN = 0x100 IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x80 IOCTL_MEI_NOTIFY_GET = 0x40044803 IOCTL_MEI_NOTIFY_SET = 0x80044802 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x200007b9 IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_MASK = 0xffff0f00 ISIG = 0x1 IUCLC = 0x200 IXOFF = 0x1000 IXON = 0x400 MAP_ANON = 0x800 MAP_ANONYMOUS = 0x800 MAP_DENYWRITE = 0x2000 MAP_EXECUTABLE = 0x4000 MAP_GROWSDOWN = 0x1000 MAP_HUGETLB = 0x80000 MAP_LOCKED = 0x8000 MAP_NONBLOCK = 0x20000 MAP_NORESERVE = 0x400 MAP_POPULATE = 0x10000 MAP_RENAME = 0x800 MAP_STACK = 0x40000 MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MCL_ONFAULT = 0x4 MEMERASE = 0x80084d02 MEMERASE64 = 0x80104d14 MEMGETBADBLOCK = 0x80084d0b MEMGETINFO = 0x40204d01 MEMGETOOBSEL = 0x40c84d0a MEMGETREGIONCOUNT = 0x40044d07 MEMISLOCKED = 0x40084d17 MEMLOCK = 0x80084d05 MEMREAD = 0xc0404d1a MEMREADOOB = 0xc00c4d04 MEMSETBADBLOCK = 0x80084d0c MEMUNLOCK = 0x80084d06 MEMWRITEOOB = 0xc00c4d03 MTDFILEMODE = 0x20004d13 NFDBITS = 0x20 NLDLY = 0x100 NOFLSH = 0x80 NS_GET_MNTNS_ID = 0x4008b705 NS_GET_NSTYPE = 0x2000b703 NS_GET_OWNER_UID = 0x2000b704 NS_GET_PARENT = 0x2000b702 NS_GET_PID_FROM_PIDNS = 0x4004b706 NS_GET_PID_IN_PIDNS = 0x4004b708 NS_GET_TGID_FROM_PIDNS = 0x4004b707 NS_GET_TGID_IN_PIDNS = 0x4004b709 NS_GET_USERNS = 0x2000b701 OLCUC = 0x2 ONLCR = 0x4 OTPERASE = 0x800c4d19 OTPGETREGIONCOUNT = 0x80044d0e OTPGETREGIONINFO = 0x800c4d0f OTPLOCK = 0x400c4d10 OTPSELECT = 0x40044d0d O_APPEND = 0x8 O_ASYNC = 0x1000 O_CLOEXEC = 0x80000 O_CREAT = 0x100 O_DIRECT = 0x8000 O_DIRECTORY = 0x10000 O_DSYNC = 0x10 O_EXCL = 0x400 O_FSYNC = 0x4010 O_LARGEFILE = 0x2000 O_NDELAY = 0x80 O_NOATIME = 0x40000 O_NOCTTY = 0x800 O_NOFOLLOW = 0x20000 O_NONBLOCK = 0x80 O_PATH = 0x200000 O_RSYNC = 0x4010 O_SYNC = 0x4010 O_TMPFILE = 0x410000 O_TRUNC = 0x200 PARENB = 0x100 PARODD = 0x200 PENDIN = 0x4000 PERF_EVENT_IOC_DISABLE = 0x20002401 PERF_EVENT_IOC_ENABLE = 0x20002400 PERF_EVENT_IOC_ID = 0x40042407 PERF_EVENT_IOC_MODIFY_ATTRIBUTES = 0x8004240b PERF_EVENT_IOC_PAUSE_OUTPUT = 0x80042409 PERF_EVENT_IOC_PERIOD = 0x80082404 PERF_EVENT_IOC_QUERY_BPF = 0xc004240a PERF_EVENT_IOC_REFRESH = 0x20002402 PERF_EVENT_IOC_RESET = 0x20002403 PERF_EVENT_IOC_SET_BPF = 0x80042408 PERF_EVENT_IOC_SET_FILTER = 0x80042406 PERF_EVENT_IOC_SET_OUTPUT = 0x20002405 PPPIOCATTACH = 0x8004743d PPPIOCATTCHAN = 0x80047438 PPPIOCBRIDGECHAN = 0x80047435 PPPIOCCONNECT = 0x8004743a PPPIOCDETACH = 0x8004743c PPPIOCDISCONN = 0x20007439 PPPIOCGASYNCMAP = 0x40047458 PPPIOCGCHAN = 0x40047437 PPPIOCGDEBUG = 0x40047441 PPPIOCGFLAGS = 0x4004745a PPPIOCGIDLE = 0x4008743f PPPIOCGIDLE32 = 0x4008743f PPPIOCGIDLE64 = 0x4010743f PPPIOCGL2TPSTATS = 0x40487436 PPPIOCGMRU = 0x40047453 PPPIOCGRASYNCMAP = 0x40047455 PPPIOCGUNIT = 0x40047456 PPPIOCGXASYNCMAP = 0x40207450 PPPIOCSACTIVE = 0x80087446 PPPIOCSASYNCMAP = 0x80047457 PPPIOCSCOMPRESS = 0x800c744d PPPIOCSDEBUG = 0x80047440 PPPIOCSFLAGS = 0x80047459 PPPIOCSMAXCID = 0x80047451 PPPIOCSMRRU = 0x8004743b PPPIOCSMRU = 0x80047452 PPPIOCSNPMODE = 0x8008744b PPPIOCSPASS = 0x80087447 PPPIOCSRASYNCMAP = 0x80047454 PPPIOCSXASYNCMAP = 0x8020744f PPPIOCUNBRIDGECHAN = 0x20007434 PPPIOCXFERUNIT = 0x2000744e PR_SET_PTRACER_ANY = 0xffffffff PTP_CLOCK_GETCAPS = 0x40503d01 PTP_CLOCK_GETCAPS2 = 0x40503d0a PTP_ENABLE_PPS = 0x80043d04 PTP_ENABLE_PPS2 = 0x80043d0d PTP_EXTTS_REQUEST = 0x80103d02 PTP_EXTTS_REQUEST2 = 0x80103d0b PTP_MASK_CLEAR_ALL = 0x20003d13 PTP_MASK_EN_SINGLE = 0x80043d14 PTP_PEROUT_REQUEST = 0x80383d03 PTP_PEROUT_REQUEST2 = 0x80383d0c PTP_PIN_SETFUNC = 0x80603d07 PTP_PIN_SETFUNC2 = 0x80603d10 PTP_SYS_OFFSET = 0x83403d05 PTP_SYS_OFFSET2 = 0x83403d0e PTRACE_GETFPREGS = 0xe PTRACE_GET_THREAD_AREA = 0x19 PTRACE_GET_THREAD_AREA_3264 = 0xc4 PTRACE_GET_WATCH_REGS = 0xd0 PTRACE_OLDSETOPTIONS = 0x15 PTRACE_PEEKDATA_3264 = 0xc1 PTRACE_PEEKTEXT_3264 = 0xc0 PTRACE_POKEDATA_3264 = 0xc3 PTRACE_POKETEXT_3264 = 0xc2 PTRACE_SETFPREGS = 0xf PTRACE_SET_THREAD_AREA = 0x1a PTRACE_SET_WATCH_REGS = 0xd1 RLIMIT_AS = 0x6 RLIMIT_MEMLOCK = 0x9 RLIMIT_NOFILE = 0x5 RLIMIT_NPROC = 0x8 RLIMIT_RSS = 0x7 RNDADDENTROPY = 0x80085203 RNDADDTOENTCNT = 0x80045201 RNDCLEARPOOL = 0x20005206 RNDGETENTCNT = 0x40045200 RNDGETPOOL = 0x40085202 RNDRESEEDCRNG = 0x20005207 RNDZAPENTCNT = 0x20005204 RTC_AIE_OFF = 0x20007002 RTC_AIE_ON = 0x20007001 RTC_ALM_READ = 0x40247008 RTC_ALM_SET = 0x80247007 RTC_EPOCH_READ = 0x4004700d RTC_EPOCH_SET = 0x8004700e RTC_IRQP_READ = 0x4004700b RTC_IRQP_SET = 0x8004700c RTC_PARAM_GET = 0x80187013 RTC_PARAM_SET = 0x80187014 RTC_PIE_OFF = 0x20007006 RTC_PIE_ON = 0x20007005 RTC_PLL_GET = 0x401c7011 RTC_PLL_SET = 0x801c7012 RTC_RD_TIME = 0x40247009 RTC_SET_TIME = 0x8024700a RTC_UIE_OFF = 0x20007004 RTC_UIE_ON = 0x20007003 RTC_VL_CLR = 0x20007014 RTC_VL_READ = 0x40047013 RTC_WIE_OFF = 0x20007010 RTC_WIE_ON = 0x2000700f RTC_WKALM_RD = 0x40287010 RTC_WKALM_SET = 0x8028700f SCM_DEVMEM_DMABUF = 0x4f SCM_DEVMEM_LINEAR = 0x4e SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a SCM_TIMESTAMPNS = 0x23 SCM_TS_OPT_ID = 0x51 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 SECCOMP_IOCTL_NOTIF_ADDFD = 0x80182103 SECCOMP_IOCTL_NOTIF_ID_VALID = 0x80082102 SECCOMP_IOCTL_NOTIF_SET_FLAGS = 0x80082104 SFD_CLOEXEC = 0x80000 SFD_NONBLOCK = 0x80 SIOCATMARK = 0x40047307 SIOCGPGRP = 0x40047309 SIOCGSTAMPNS_NEW = 0x40108907 SIOCGSTAMP_NEW = 0x40108906 SIOCINQ = 0x467f SIOCOUTQ = 0x7472 SIOCSPGRP = 0x80047308 SOCK_CLOEXEC = 0x80000 SOCK_DGRAM = 0x1 SOCK_NONBLOCK = 0x80 SOCK_STREAM = 0x2 SOL_SOCKET = 0xffff SO_ACCEPTCONN = 0x1009 SO_ATTACH_BPF = 0x32 SO_ATTACH_REUSEPORT_CBPF = 0x33 SO_ATTACH_REUSEPORT_EBPF = 0x34 SO_BINDTODEVICE = 0x19 SO_BINDTOIFINDEX = 0x3e SO_BPF_EXTENSIONS = 0x30 SO_BROADCAST = 0x20 SO_BSDCOMPAT = 0xe SO_BUF_LOCK = 0x48 SO_BUSY_POLL = 0x2e SO_BUSY_POLL_BUDGET = 0x46 SO_CNX_ADVICE = 0x35 SO_COOKIE = 0x39 SO_DETACH_REUSEPORT_BPF = 0x44 SO_DEVMEM_DMABUF = 0x4f SO_DEVMEM_DONTNEED = 0x50 SO_DEVMEM_LINEAR = 0x4e SO_DOMAIN = 0x1029 SO_DONTROUTE = 0x10 SO_ERROR = 0x1007 SO_INCOMING_CPU = 0x31 SO_INCOMING_NAPI_ID = 0x38 SO_KEEPALIVE = 0x8 SO_LINGER = 0x80 SO_LOCK_FILTER = 0x2c SO_MARK = 0x24 SO_MAX_PACING_RATE = 0x2f SO_MEMINFO = 0x37 SO_NETNS_COOKIE = 0x47 SO_NOFCS = 0x2b SO_OOBINLINE = 0x100 SO_PASSCRED = 0x11 SO_PASSPIDFD = 0x4c SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x12 SO_PEERGROUPS = 0x3b SO_PEERPIDFD = 0x4d SO_PEERSEC = 0x1e SO_PREFER_BUSY_POLL = 0x45 SO_PROTOCOL = 0x1028 SO_RCVBUF = 0x1002 SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x1004 SO_RCVMARK = 0x4b SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x1006 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x1006 SO_RESERVE_MEM = 0x49 SO_REUSEADDR = 0x4 SO_REUSEPORT = 0x200 SO_RXQ_OVFL = 0x28 SO_SECURITY_AUTHENTICATION = 0x16 SO_SECURITY_ENCRYPTION_NETWORK = 0x18 SO_SECURITY_ENCRYPTION_TRANSPORT = 0x17 SO_SELECT_ERR_QUEUE = 0x2d SO_SNDBUF = 0x1001 SO_SNDBUFFORCE = 0x1f SO_SNDLOWAT = 0x1003 SO_SNDTIMEO = 0x1005 SO_SNDTIMEO_NEW = 0x43 SO_SNDTIMEO_OLD = 0x1005 SO_STYLE = 0x1008 SO_TIMESTAMPING = 0x25 SO_TIMESTAMPING_NEW = 0x41 SO_TIMESTAMPING_OLD = 0x25 SO_TIMESTAMPNS = 0x23 SO_TIMESTAMPNS_NEW = 0x40 SO_TIMESTAMPNS_OLD = 0x23 SO_TIMESTAMP_NEW = 0x3f SO_TXREHASH = 0x4a SO_TXTIME = 0x3d SO_TYPE = 0x1008 SO_WIFI_STATUS = 0x29 SO_ZEROCOPY = 0x3c TAB1 = 0x800 TAB2 = 0x1000 TAB3 = 0x1800 TABDLY = 0x1800 TCFLSH = 0x5407 TCGETA = 0x5401 TCGETS = 0x540d TCGETS2 = 0x4030542a TCSAFLUSH = 0x5410 TCSBRK = 0x5405 TCSBRKP = 0x5486 TCSETA = 0x5402 TCSETAF = 0x5404 TCSETAW = 0x5403 TCSETS = 0x540e TCSETS2 = 0x8030542b TCSETSF = 0x5410 TCSETSF2 = 0x8030542d TCSETSW = 0x540f TCSETSW2 = 0x8030542c TCXONC = 0x5406 TFD_CLOEXEC = 0x80000 TFD_NONBLOCK = 0x80 TIOCCBRK = 0x5428 TIOCCONS = 0x80047478 TIOCEXCL = 0x740d TIOCGDEV = 0x40045432 TIOCGETD = 0x7400 TIOCGETP = 0x7408 TIOCGEXCL = 0x40045440 TIOCGICOUNT = 0x5492 TIOCGISO7816 = 0x40285442 TIOCGLCKTRMIOS = 0x548b TIOCGLTC = 0x7474 TIOCGPGRP = 0x40047477 TIOCGPKT = 0x40045438 TIOCGPTLCK = 0x40045439 TIOCGPTN = 0x40045430 TIOCGPTPEER = 0x20005441 TIOCGRS485 = 0x4020542e TIOCGSERIAL = 0x5484 TIOCGSID = 0x7416 TIOCGSOFTCAR = 0x5481 TIOCGWINSZ = 0x40087468 TIOCINQ = 0x467f TIOCLINUX = 0x5483 TIOCMBIC = 0x741c TIOCMBIS = 0x741b TIOCMGET = 0x741d TIOCMIWAIT = 0x5491 TIOCMSET = 0x741a TIOCM_CAR = 0x100 TIOCM_CD = 0x100 TIOCM_CTS = 0x40 TIOCM_DSR = 0x400 TIOCM_RI = 0x200 TIOCM_RNG = 0x200 TIOCM_SR = 0x20 TIOCM_ST = 0x10 TIOCNOTTY = 0x5471 TIOCNXCL = 0x740e TIOCOUTQ = 0x7472 TIOCPKT = 0x5470 TIOCSBRK = 0x5427 TIOCSCTTY = 0x5480 TIOCSERCONFIG = 0x5488 TIOCSERGETLSR = 0x548e TIOCSERGETMULTI = 0x548f TIOCSERGSTRUCT = 0x548d TIOCSERGWILD = 0x5489 TIOCSERSETMULTI = 0x5490 TIOCSERSWILD = 0x548a TIOCSER_TEMT = 0x1 TIOCSETD = 0x7401 TIOCSETN = 0x740a TIOCSETP = 0x7409 TIOCSIG = 0x80045436 TIOCSISO7816 = 0xc0285443 TIOCSLCKTRMIOS = 0x548c TIOCSLTC = 0x7475 TIOCSPGRP = 0x80047476 TIOCSPTLCK = 0x80045431 TIOCSRS485 = 0xc020542f TIOCSSERIAL = 0x5485 TIOCSSOFTCAR = 0x5482 TIOCSTI = 0x5472 TIOCSWINSZ = 0x80087467 TIOCVHANGUP = 0x5437 TOSTOP = 0x8000 TUNATTACHFILTER = 0x800854d5 TUNDETACHFILTER = 0x800854d6 TUNGETDEVNETNS = 0x200054e3 TUNGETFEATURES = 0x400454cf TUNGETFILTER = 0x400854db TUNGETIFF = 0x400454d2 TUNGETSNDBUF = 0x400454d3 TUNGETVNETBE = 0x400454df TUNGETVNETHDRSZ = 0x400454d7 TUNGETVNETLE = 0x400454dd TUNSETCARRIER = 0x800454e2 TUNSETDEBUG = 0x800454c9 TUNSETFILTEREBPF = 0x400454e1 TUNSETGROUP = 0x800454ce TUNSETIFF = 0x800454ca TUNSETIFINDEX = 0x800454da TUNSETLINK = 0x800454cd TUNSETNOCSUM = 0x800454c8 TUNSETOFFLOAD = 0x800454d0 TUNSETOWNER = 0x800454cc TUNSETPERSIST = 0x800454cb TUNSETQUEUE = 0x800454d9 TUNSETSNDBUF = 0x800454d4 TUNSETSTEERINGEBPF = 0x400454e0 TUNSETTXFILTER = 0x800454d1 TUNSETVNETBE = 0x800454de TUNSETVNETHDRSZ = 0x800454d8 TUNSETVNETLE = 0x800454dc UBI_IOCATT = 0x80186f40 UBI_IOCDET = 0x80046f41 UBI_IOCEBCH = 0x80044f02 UBI_IOCEBER = 0x80044f01 UBI_IOCEBISMAP = 0x40044f05 UBI_IOCEBMAP = 0x80084f03 UBI_IOCEBUNMAP = 0x80044f04 UBI_IOCMKVOL = 0x80986f00 UBI_IOCRMVOL = 0x80046f01 UBI_IOCRNVOL = 0x91106f03 UBI_IOCRPEB = 0x80046f04 UBI_IOCRSVOL = 0x800c6f02 UBI_IOCSETVOLPROP = 0x80104f06 UBI_IOCSPEB = 0x80046f05 UBI_IOCVOLCRBLK = 0x80804f07 UBI_IOCVOLRMBLK = 0x20004f08 UBI_IOCVOLUP = 0x80084f00 VDISCARD = 0xd VEOF = 0x10 VEOL = 0x11 VEOL2 = 0x6 VMIN = 0x4 VREPRINT = 0xc VSTART = 0x8 VSTOP = 0x9 VSUSP = 0xa VSWTC = 0x7 VSWTCH = 0x7 VT1 = 0x4000 VTDLY = 0x4000 VTIME = 0x5 VWERASE = 0xe WDIOC_GETBOOTSTATUS = 0x40045702 WDIOC_GETPRETIMEOUT = 0x40045709 WDIOC_GETSTATUS = 0x40045701 WDIOC_GETSUPPORT = 0x40285700 WDIOC_GETTEMP = 0x40045703 WDIOC_GETTIMELEFT = 0x4004570a WDIOC_GETTIMEOUT = 0x40045707 WDIOC_KEEPALIVE = 0x40045705 WDIOC_SETOPTIONS = 0x40045704 WORDSIZE = 0x20 XCASE = 0x4 XTABS = 0x1800 _HIDIOCGRAWNAME = 0x40804804 _HIDIOCGRAWPHYS = 0x40404805 _HIDIOCGRAWUNIQ = 0x40404808 ) // Errors const ( EADDRINUSE = syscall.Errno(0x7d) EADDRNOTAVAIL = syscall.Errno(0x7e) EADV = syscall.Errno(0x44) EAFNOSUPPORT = syscall.Errno(0x7c) EALREADY = syscall.Errno(0x95) EBADE = syscall.Errno(0x32) EBADFD = syscall.Errno(0x51) EBADMSG = syscall.Errno(0x4d) EBADR = syscall.Errno(0x33) EBADRQC = syscall.Errno(0x36) EBADSLT = syscall.Errno(0x37) EBFONT = syscall.Errno(0x3b) ECANCELED = syscall.Errno(0x9e) ECHRNG = syscall.Errno(0x25) ECOMM = syscall.Errno(0x46) ECONNABORTED = syscall.Errno(0x82) ECONNREFUSED = syscall.Errno(0x92) ECONNRESET = syscall.Errno(0x83) EDEADLK = syscall.Errno(0x2d) EDEADLOCK = syscall.Errno(0x38) EDESTADDRREQ = syscall.Errno(0x60) EDOTDOT = syscall.Errno(0x49) EDQUOT = syscall.Errno(0x46d) EHOSTDOWN = syscall.Errno(0x93) EHOSTUNREACH = syscall.Errno(0x94) EHWPOISON = syscall.Errno(0xa8) EIDRM = syscall.Errno(0x24) EILSEQ = syscall.Errno(0x58) EINIT = syscall.Errno(0x8d) EINPROGRESS = syscall.Errno(0x96) EISCONN = syscall.Errno(0x85) EISNAM = syscall.Errno(0x8b) EKEYEXPIRED = syscall.Errno(0xa2) EKEYREJECTED = syscall.Errno(0xa4) EKEYREVOKED = syscall.Errno(0xa3) EL2HLT = syscall.Errno(0x2c) EL2NSYNC = syscall.Errno(0x26) EL3HLT = syscall.Errno(0x27) EL3RST = syscall.Errno(0x28) ELIBACC = syscall.Errno(0x53) ELIBBAD = syscall.Errno(0x54) ELIBEXEC = syscall.Errno(0x57) ELIBMAX = syscall.Errno(0x56) ELIBSCN = syscall.Errno(0x55) ELNRNG = syscall.Errno(0x29) ELOOP = syscall.Errno(0x5a) EMEDIUMTYPE = syscall.Errno(0xa0) EMSGSIZE = syscall.Errno(0x61) EMULTIHOP = syscall.Errno(0x4a) ENAMETOOLONG = syscall.Errno(0x4e) ENAVAIL = syscall.Errno(0x8a) ENETDOWN = syscall.Errno(0x7f) ENETRESET = syscall.Errno(0x81) ENETUNREACH = syscall.Errno(0x80) ENOANO = syscall.Errno(0x35) ENOBUFS = syscall.Errno(0x84) ENOCSI = syscall.Errno(0x2b) ENODATA = syscall.Errno(0x3d) ENOKEY = syscall.Errno(0xa1) ENOLCK = syscall.Errno(0x2e) ENOLINK = syscall.Errno(0x43) ENOMEDIUM = syscall.Errno(0x9f) ENOMSG = syscall.Errno(0x23) ENONET = syscall.Errno(0x40) ENOPKG = syscall.Errno(0x41) ENOPROTOOPT = syscall.Errno(0x63) ENOSR = syscall.Errno(0x3f) ENOSTR = syscall.Errno(0x3c) ENOSYS = syscall.Errno(0x59) ENOTCONN = syscall.Errno(0x86) ENOTEMPTY = syscall.Errno(0x5d) ENOTNAM = syscall.Errno(0x89) ENOTRECOVERABLE = syscall.Errno(0xa6) ENOTSOCK = syscall.Errno(0x5f) ENOTSUP = syscall.Errno(0x7a) ENOTUNIQ = syscall.Errno(0x50) EOPNOTSUPP = syscall.Errno(0x7a) EOVERFLOW = syscall.Errno(0x4f) EOWNERDEAD = syscall.Errno(0xa5) EPFNOSUPPORT = syscall.Errno(0x7b) EPROTO = syscall.Errno(0x47) EPROTONOSUPPORT = syscall.Errno(0x78) EPROTOTYPE = syscall.Errno(0x62) EREMCHG = syscall.Errno(0x52) EREMDEV = syscall.Errno(0x8e) EREMOTE = syscall.Errno(0x42) EREMOTEIO = syscall.Errno(0x8c) ERESTART = syscall.Errno(0x5b) ERFKILL = syscall.Errno(0xa7) ESHUTDOWN = syscall.Errno(0x8f) ESOCKTNOSUPPORT = syscall.Errno(0x79) ESRMNT = syscall.Errno(0x45) ESTALE = syscall.Errno(0x97) ESTRPIPE = syscall.Errno(0x5c) ETIME = syscall.Errno(0x3e) ETIMEDOUT = syscall.Errno(0x91) ETOOMANYREFS = syscall.Errno(0x90) EUCLEAN = syscall.Errno(0x87) EUNATCH = syscall.Errno(0x2a) EUSERS = syscall.Errno(0x5e) EXFULL = syscall.Errno(0x34) ) // Signals const ( SIGBUS = syscall.Signal(0xa) SIGCHLD = syscall.Signal(0x12) SIGCLD = syscall.Signal(0x12) SIGCONT = syscall.Signal(0x19) SIGEMT = syscall.Signal(0x7) SIGIO = syscall.Signal(0x16) SIGPOLL = syscall.Signal(0x16) SIGPROF = syscall.Signal(0x1d) SIGPWR = syscall.Signal(0x13) SIGSTOP = syscall.Signal(0x17) SIGSYS = syscall.Signal(0xc) SIGTSTP = syscall.Signal(0x18) SIGTTIN = syscall.Signal(0x1a) SIGTTOU = syscall.Signal(0x1b) SIGURG = syscall.Signal(0x15) SIGUSR1 = syscall.Signal(0x10) SIGUSR2 = syscall.Signal(0x11) SIGVTALRM = syscall.Signal(0x1c) SIGWINCH = syscall.Signal(0x14) SIGXCPU = syscall.Signal(0x1e) SIGXFSZ = syscall.Signal(0x1f) ) // Error table var errorList = [...]struct { num syscall.Errno name string desc string }{ {1, "EPERM", "operation not permitted"}, {2, "ENOENT", "no such file or directory"}, {3, "ESRCH", "no such process"}, {4, "EINTR", "interrupted system call"}, {5, "EIO", "input/output error"}, {6, "ENXIO", "no such device or address"}, {7, "E2BIG", "argument list too long"}, {8, "ENOEXEC", "exec format error"}, {9, "EBADF", "bad file descriptor"}, {10, "ECHILD", "no child processes"}, {11, "EAGAIN", "resource temporarily unavailable"}, {12, "ENOMEM", "cannot allocate memory"}, {13, "EACCES", "permission denied"}, {14, "EFAULT", "bad address"}, {15, "ENOTBLK", "block device required"}, {16, "EBUSY", "device or resource busy"}, {17, "EEXIST", "file exists"}, {18, "EXDEV", "invalid cross-device link"}, {19, "ENODEV", "no such device"}, {20, "ENOTDIR", "not a directory"}, {21, "EISDIR", "is a directory"}, {22, "EINVAL", "invalid argument"}, {23, "ENFILE", "too many open files in system"}, {24, "EMFILE", "too many open files"}, {25, "ENOTTY", "inappropriate ioctl for device"}, {26, "ETXTBSY", "text file busy"}, {27, "EFBIG", "file too large"}, {28, "ENOSPC", "no space left on device"}, {29, "ESPIPE", "illegal seek"}, {30, "EROFS", "read-only file system"}, {31, "EMLINK", "too many links"}, {32, "EPIPE", "broken pipe"}, {33, "EDOM", "numerical argument out of domain"}, {34, "ERANGE", "numerical result out of range"}, {35, "ENOMSG", "no message of desired type"}, {36, "EIDRM", "identifier removed"}, {37, "ECHRNG", "channel number out of range"}, {38, "EL2NSYNC", "level 2 not synchronized"}, {39, "EL3HLT", "level 3 halted"}, {40, "EL3RST", "level 3 reset"}, {41, "ELNRNG", "link number out of range"}, {42, "EUNATCH", "protocol driver not attached"}, {43, "ENOCSI", "no CSI structure available"}, {44, "EL2HLT", "level 2 halted"}, {45, "EDEADLK", "resource deadlock avoided"}, {46, "ENOLCK", "no locks available"}, {50, "EBADE", "invalid exchange"}, {51, "EBADR", "invalid request descriptor"}, {52, "EXFULL", "exchange full"}, {53, "ENOANO", "no anode"}, {54, "EBADRQC", "invalid request code"}, {55, "EBADSLT", "invalid slot"}, {56, "EDEADLOCK", "file locking deadlock error"}, {59, "EBFONT", "bad font file format"}, {60, "ENOSTR", "device not a stream"}, {61, "ENODATA", "no data available"}, {62, "ETIME", "timer expired"}, {63, "ENOSR", "out of streams resources"}, {64, "ENONET", "machine is not on the network"}, {65, "ENOPKG", "package not installed"}, {66, "EREMOTE", "object is remote"}, {67, "ENOLINK", "link has been severed"}, {68, "EADV", "advertise error"}, {69, "ESRMNT", "srmount error"}, {70, "ECOMM", "communication error on send"}, {71, "EPROTO", "protocol error"}, {73, "EDOTDOT", "RFS specific error"}, {74, "EMULTIHOP", "multihop attempted"}, {77, "EBADMSG", "bad message"}, {78, "ENAMETOOLONG", "file name too long"}, {79, "EOVERFLOW", "value too large for defined data type"}, {80, "ENOTUNIQ", "name not unique on network"}, {81, "EBADFD", "file descriptor in bad state"}, {82, "EREMCHG", "remote address changed"}, {83, "ELIBACC", "can not access a needed shared library"}, {84, "ELIBBAD", "accessing a corrupted shared library"}, {85, "ELIBSCN", ".lib section in a.out corrupted"}, {86, "ELIBMAX", "attempting to link in too many shared libraries"}, {87, "ELIBEXEC", "cannot exec a shared library directly"}, {88, "EILSEQ", "invalid or incomplete multibyte or wide character"}, {89, "ENOSYS", "function not implemented"}, {90, "ELOOP", "too many levels of symbolic links"}, {91, "ERESTART", "interrupted system call should be restarted"}, {92, "ESTRPIPE", "streams pipe error"}, {93, "ENOTEMPTY", "directory not empty"}, {94, "EUSERS", "too many users"}, {95, "ENOTSOCK", "socket operation on non-socket"}, {96, "EDESTADDRREQ", "destination address required"}, {97, "EMSGSIZE", "message too long"}, {98, "EPROTOTYPE", "protocol wrong type for socket"}, {99, "ENOPROTOOPT", "protocol not available"}, {120, "EPROTONOSUPPORT", "protocol not supported"}, {121, "ESOCKTNOSUPPORT", "socket type not supported"}, {122, "ENOTSUP", "operation not supported"}, {123, "EPFNOSUPPORT", "protocol family not supported"}, {124, "EAFNOSUPPORT", "address family not supported by protocol"}, {125, "EADDRINUSE", "address already in use"}, {126, "EADDRNOTAVAIL", "cannot assign requested address"}, {127, "ENETDOWN", "network is down"}, {128, "ENETUNREACH", "network is unreachable"}, {129, "ENETRESET", "network dropped connection on reset"}, {130, "ECONNABORTED", "software caused connection abort"}, {131, "ECONNRESET", "connection reset by peer"}, {132, "ENOBUFS", "no buffer space available"}, {133, "EISCONN", "transport endpoint is already connected"}, {134, "ENOTCONN", "transport endpoint is not connected"}, {135, "EUCLEAN", "structure needs cleaning"}, {137, "ENOTNAM", "not a XENIX named type file"}, {138, "ENAVAIL", "no XENIX semaphores available"}, {139, "EISNAM", "is a named type file"}, {140, "EREMOTEIO", "remote I/O error"}, {141, "EINIT", "unknown error 141"}, {142, "EREMDEV", "unknown error 142"}, {143, "ESHUTDOWN", "cannot send after transport endpoint shutdown"}, {144, "ETOOMANYREFS", "too many references: cannot splice"}, {145, "ETIMEDOUT", "connection timed out"}, {146, "ECONNREFUSED", "connection refused"}, {147, "EHOSTDOWN", "host is down"}, {148, "EHOSTUNREACH", "no route to host"}, {149, "EALREADY", "operation already in progress"}, {150, "EINPROGRESS", "operation now in progress"}, {151, "ESTALE", "stale file handle"}, {158, "ECANCELED", "operation canceled"}, {159, "ENOMEDIUM", "no medium found"}, {160, "EMEDIUMTYPE", "wrong medium type"}, {161, "ENOKEY", "required key not available"}, {162, "EKEYEXPIRED", "key has expired"}, {163, "EKEYREVOKED", "key has been revoked"}, {164, "EKEYREJECTED", "key was rejected by service"}, {165, "EOWNERDEAD", "owner died"}, {166, "ENOTRECOVERABLE", "state not recoverable"}, {167, "ERFKILL", "operation not possible due to RF-kill"}, {168, "EHWPOISON", "memory page has hardware error"}, {1133, "EDQUOT", "disk quota exceeded"}, } // Signal table var signalList = [...]struct { num syscall.Signal name string desc string }{ {1, "SIGHUP", "hangup"}, {2, "SIGINT", "interrupt"}, {3, "SIGQUIT", "quit"}, {4, "SIGILL", "illegal instruction"}, {5, "SIGTRAP", "trace/breakpoint trap"}, {6, "SIGABRT", "aborted"}, {7, "SIGEMT", "EMT trap"}, {8, "SIGFPE", "floating point exception"}, {9, "SIGKILL", "killed"}, {10, "SIGBUS", "bus error"}, {11, "SIGSEGV", "segmentation fault"}, {12, "SIGSYS", "bad system call"}, {13, "SIGPIPE", "broken pipe"}, {14, "SIGALRM", "alarm clock"}, {15, "SIGTERM", "terminated"}, {16, "SIGUSR1", "user defined signal 1"}, {17, "SIGUSR2", "user defined signal 2"}, {18, "SIGCHLD", "child exited"}, {19, "SIGPWR", "power failure"}, {20, "SIGWINCH", "window changed"}, {21, "SIGURG", "urgent I/O condition"}, {22, "SIGIO", "I/O possible"}, {23, "SIGSTOP", "stopped (signal)"}, {24, "SIGTSTP", "stopped"}, {25, "SIGCONT", "continued"}, {26, "SIGTTIN", "stopped (tty input)"}, {27, "SIGTTOU", "stopped (tty output)"}, {28, "SIGVTALRM", "virtual timer expired"}, {29, "SIGPROF", "profiling timer expired"}, {30, "SIGXCPU", "CPU time limit exceeded"}, {31, "SIGXFSZ", "file size limit exceeded"}, } ================================================ FILE: vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go ================================================ // mkerrors.sh -Wall -Werror -static -I/tmp/ppc/include // Code generated by the command above; see README.md. DO NOT EDIT. //go:build ppc && linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -Wall -Werror -static -I/tmp/ppc/include _const.go package unix import "syscall" const ( B1000000 = 0x17 B115200 = 0x11 B1152000 = 0x18 B1500000 = 0x19 B2000000 = 0x1a B230400 = 0x12 B2500000 = 0x1b B3000000 = 0x1c B3500000 = 0x1d B4000000 = 0x1e B460800 = 0x13 B500000 = 0x14 B57600 = 0x10 B576000 = 0x15 B921600 = 0x16 BLKALIGNOFF = 0x2000127a BLKBSZGET = 0x40041270 BLKBSZSET = 0x80041271 BLKDISCARD = 0x20001277 BLKDISCARDZEROES = 0x2000127c BLKFLSBUF = 0x20001261 BLKFRAGET = 0x20001265 BLKFRASET = 0x20001264 BLKGETDISKSEQ = 0x40081280 BLKGETSIZE = 0x20001260 BLKGETSIZE64 = 0x40041272 BLKIOMIN = 0x20001278 BLKIOOPT = 0x20001279 BLKPBSZGET = 0x2000127b BLKRAGET = 0x20001263 BLKRASET = 0x20001262 BLKROGET = 0x2000125e BLKROSET = 0x2000125d BLKROTATIONAL = 0x2000127e BLKRRPART = 0x2000125f BLKSECDISCARD = 0x2000127d BLKSECTGET = 0x20001267 BLKSECTSET = 0x20001266 BLKSSZGET = 0x20001268 BLKZEROOUT = 0x2000127f BOTHER = 0x1f BS1 = 0x8000 BSDLY = 0x8000 CBAUD = 0xff CBAUDEX = 0x0 CIBAUD = 0xff0000 CLOCAL = 0x8000 CR1 = 0x1000 CR2 = 0x2000 CR3 = 0x3000 CRDLY = 0x3000 CREAD = 0x800 CS6 = 0x100 CS7 = 0x200 CS8 = 0x300 CSIZE = 0x300 CSTOPB = 0x400 DM_MPATH_PROBE_PATHS = 0x2000fd12 ECCGETLAYOUT = 0x41484d11 ECCGETSTATS = 0x40104d12 ECHOCTL = 0x40 ECHOE = 0x2 ECHOK = 0x4 ECHOKE = 0x1 ECHONL = 0x10 ECHOPRT = 0x20 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 EPIOCGPARAMS = 0x40088a02 EPIOCSPARAMS = 0x80088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000000 FF1 = 0x4000 FFDLY = 0x4000 FICLONE = 0x80049409 FICLONERANGE = 0x8020940d FLUSHO = 0x800000 FS_IOC_ENABLE_VERITY = 0x80806685 FS_IOC_GETFLAGS = 0x40046601 FS_IOC_GET_ENCRYPTION_NONCE = 0x4010661b FS_IOC_GET_ENCRYPTION_POLICY = 0x800c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x80106614 FS_IOC_SETFLAGS = 0x80046602 FS_IOC_SET_ENCRYPTION_POLICY = 0x400c6613 F_GETLK = 0xc F_GETLK64 = 0xc F_GETOWN = 0x9 F_RDLCK = 0x0 F_SETLK = 0xd F_SETLK64 = 0xd F_SETLKW = 0xe F_SETLKW64 = 0xe F_SETOWN = 0x8 F_UNLCK = 0x2 F_WRLCK = 0x1 HIDIOCGRAWINFO = 0x40084803 HIDIOCGRDESC = 0x50044802 HIDIOCGRDESCSIZE = 0x40044801 HIDIOCREVOKE = 0x8004480d HUPCL = 0x4000 ICANON = 0x100 IEXTEN = 0x400 IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x800 IOCTL_MEI_NOTIFY_GET = 0x40044803 IOCTL_MEI_NOTIFY_SET = 0x80044802 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x200007b9 IPV6_FLOWINFO_MASK = 0xfffffff IPV6_FLOWLABEL_MASK = 0xfffff ISIG = 0x80 IUCLC = 0x1000 IXOFF = 0x400 IXON = 0x200 MAP_ANON = 0x20 MAP_ANONYMOUS = 0x20 MAP_DENYWRITE = 0x800 MAP_EXECUTABLE = 0x1000 MAP_GROWSDOWN = 0x100 MAP_HUGETLB = 0x40000 MAP_LOCKED = 0x80 MAP_NONBLOCK = 0x10000 MAP_NORESERVE = 0x40 MAP_POPULATE = 0x8000 MAP_STACK = 0x20000 MAP_SYNC = 0x80000 MCL_CURRENT = 0x2000 MCL_FUTURE = 0x4000 MCL_ONFAULT = 0x8000 MEMERASE = 0x80084d02 MEMERASE64 = 0x80104d14 MEMGETBADBLOCK = 0x80084d0b MEMGETINFO = 0x40204d01 MEMGETOOBSEL = 0x40c84d0a MEMGETREGIONCOUNT = 0x40044d07 MEMISLOCKED = 0x40084d17 MEMLOCK = 0x80084d05 MEMREAD = 0xc0404d1a MEMREADOOB = 0xc00c4d04 MEMSETBADBLOCK = 0x80084d0c MEMUNLOCK = 0x80084d06 MEMWRITEOOB = 0xc00c4d03 MTDFILEMODE = 0x20004d13 NFDBITS = 0x20 NL2 = 0x200 NL3 = 0x300 NLDLY = 0x300 NOFLSH = 0x80000000 NS_GET_MNTNS_ID = 0x4008b705 NS_GET_NSTYPE = 0x2000b703 NS_GET_OWNER_UID = 0x2000b704 NS_GET_PARENT = 0x2000b702 NS_GET_PID_FROM_PIDNS = 0x4004b706 NS_GET_PID_IN_PIDNS = 0x4004b708 NS_GET_TGID_FROM_PIDNS = 0x4004b707 NS_GET_TGID_IN_PIDNS = 0x4004b709 NS_GET_USERNS = 0x2000b701 OLCUC = 0x4 ONLCR = 0x2 OTPERASE = 0x800c4d19 OTPGETREGIONCOUNT = 0x80044d0e OTPGETREGIONINFO = 0x800c4d0f OTPLOCK = 0x400c4d10 OTPSELECT = 0x40044d0d O_APPEND = 0x400 O_ASYNC = 0x2000 O_CLOEXEC = 0x80000 O_CREAT = 0x40 O_DIRECT = 0x20000 O_DIRECTORY = 0x4000 O_DSYNC = 0x1000 O_EXCL = 0x80 O_FSYNC = 0x101000 O_LARGEFILE = 0x10000 O_NDELAY = 0x800 O_NOATIME = 0x40000 O_NOCTTY = 0x100 O_NOFOLLOW = 0x8000 O_NONBLOCK = 0x800 O_PATH = 0x200000 O_RSYNC = 0x101000 O_SYNC = 0x101000 O_TMPFILE = 0x404000 O_TRUNC = 0x200 PARENB = 0x1000 PARODD = 0x2000 PENDIN = 0x20000000 PERF_EVENT_IOC_DISABLE = 0x20002401 PERF_EVENT_IOC_ENABLE = 0x20002400 PERF_EVENT_IOC_ID = 0x40042407 PERF_EVENT_IOC_MODIFY_ATTRIBUTES = 0x8004240b PERF_EVENT_IOC_PAUSE_OUTPUT = 0x80042409 PERF_EVENT_IOC_PERIOD = 0x80082404 PERF_EVENT_IOC_QUERY_BPF = 0xc004240a PERF_EVENT_IOC_REFRESH = 0x20002402 PERF_EVENT_IOC_RESET = 0x20002403 PERF_EVENT_IOC_SET_BPF = 0x80042408 PERF_EVENT_IOC_SET_FILTER = 0x80042406 PERF_EVENT_IOC_SET_OUTPUT = 0x20002405 PPPIOCATTACH = 0x8004743d PPPIOCATTCHAN = 0x80047438 PPPIOCBRIDGECHAN = 0x80047435 PPPIOCCONNECT = 0x8004743a PPPIOCDETACH = 0x8004743c PPPIOCDISCONN = 0x20007439 PPPIOCGASYNCMAP = 0x40047458 PPPIOCGCHAN = 0x40047437 PPPIOCGDEBUG = 0x40047441 PPPIOCGFLAGS = 0x4004745a PPPIOCGIDLE = 0x4008743f PPPIOCGIDLE32 = 0x4008743f PPPIOCGIDLE64 = 0x4010743f PPPIOCGL2TPSTATS = 0x40487436 PPPIOCGMRU = 0x40047453 PPPIOCGRASYNCMAP = 0x40047455 PPPIOCGUNIT = 0x40047456 PPPIOCGXASYNCMAP = 0x40207450 PPPIOCSACTIVE = 0x80087446 PPPIOCSASYNCMAP = 0x80047457 PPPIOCSCOMPRESS = 0x800c744d PPPIOCSDEBUG = 0x80047440 PPPIOCSFLAGS = 0x80047459 PPPIOCSMAXCID = 0x80047451 PPPIOCSMRRU = 0x8004743b PPPIOCSMRU = 0x80047452 PPPIOCSNPMODE = 0x8008744b PPPIOCSPASS = 0x80087447 PPPIOCSRASYNCMAP = 0x80047454 PPPIOCSXASYNCMAP = 0x8020744f PPPIOCUNBRIDGECHAN = 0x20007434 PPPIOCXFERUNIT = 0x2000744e PROT_SAO = 0x10 PR_SET_PTRACER_ANY = 0xffffffff PTP_CLOCK_GETCAPS = 0x40503d01 PTP_CLOCK_GETCAPS2 = 0x40503d0a PTP_ENABLE_PPS = 0x80043d04 PTP_ENABLE_PPS2 = 0x80043d0d PTP_EXTTS_REQUEST = 0x80103d02 PTP_EXTTS_REQUEST2 = 0x80103d0b PTP_MASK_CLEAR_ALL = 0x20003d13 PTP_MASK_EN_SINGLE = 0x80043d14 PTP_PEROUT_REQUEST = 0x80383d03 PTP_PEROUT_REQUEST2 = 0x80383d0c PTP_PIN_SETFUNC = 0x80603d07 PTP_PIN_SETFUNC2 = 0x80603d10 PTP_SYS_OFFSET = 0x83403d05 PTP_SYS_OFFSET2 = 0x83403d0e PTRACE_GETEVRREGS = 0x14 PTRACE_GETFPREGS = 0xe PTRACE_GETREGS64 = 0x16 PTRACE_GETVRREGS = 0x12 PTRACE_GETVSRREGS = 0x1b PTRACE_GET_DEBUGREG = 0x19 PTRACE_SETEVRREGS = 0x15 PTRACE_SETFPREGS = 0xf PTRACE_SETREGS64 = 0x17 PTRACE_SETVRREGS = 0x13 PTRACE_SETVSRREGS = 0x1c PTRACE_SET_DEBUGREG = 0x1a PTRACE_SINGLEBLOCK = 0x100 PTRACE_SYSEMU = 0x1d PTRACE_SYSEMU_SINGLESTEP = 0x1e PT_CCR = 0x26 PT_CTR = 0x23 PT_DAR = 0x29 PT_DSCR = 0x2c PT_DSISR = 0x2a PT_FPR0 = 0x30 PT_FPR31 = 0x6e PT_FPSCR = 0x71 PT_LNK = 0x24 PT_MQ = 0x27 PT_MSR = 0x21 PT_NIP = 0x20 PT_ORIG_R3 = 0x22 PT_R0 = 0x0 PT_R1 = 0x1 PT_R10 = 0xa PT_R11 = 0xb PT_R12 = 0xc PT_R13 = 0xd PT_R14 = 0xe PT_R15 = 0xf PT_R16 = 0x10 PT_R17 = 0x11 PT_R18 = 0x12 PT_R19 = 0x13 PT_R2 = 0x2 PT_R20 = 0x14 PT_R21 = 0x15 PT_R22 = 0x16 PT_R23 = 0x17 PT_R24 = 0x18 PT_R25 = 0x19 PT_R26 = 0x1a PT_R27 = 0x1b PT_R28 = 0x1c PT_R29 = 0x1d PT_R3 = 0x3 PT_R30 = 0x1e PT_R31 = 0x1f PT_R4 = 0x4 PT_R5 = 0x5 PT_R6 = 0x6 PT_R7 = 0x7 PT_R8 = 0x8 PT_R9 = 0x9 PT_REGS_COUNT = 0x2c PT_RESULT = 0x2b PT_TRAP = 0x28 PT_XER = 0x25 RLIMIT_AS = 0x9 RLIMIT_MEMLOCK = 0x8 RLIMIT_NOFILE = 0x7 RLIMIT_NPROC = 0x6 RLIMIT_RSS = 0x5 RNDADDENTROPY = 0x80085203 RNDADDTOENTCNT = 0x80045201 RNDCLEARPOOL = 0x20005206 RNDGETENTCNT = 0x40045200 RNDGETPOOL = 0x40085202 RNDRESEEDCRNG = 0x20005207 RNDZAPENTCNT = 0x20005204 RTC_AIE_OFF = 0x20007002 RTC_AIE_ON = 0x20007001 RTC_ALM_READ = 0x40247008 RTC_ALM_SET = 0x80247007 RTC_EPOCH_READ = 0x4004700d RTC_EPOCH_SET = 0x8004700e RTC_IRQP_READ = 0x4004700b RTC_IRQP_SET = 0x8004700c RTC_PARAM_GET = 0x80187013 RTC_PARAM_SET = 0x80187014 RTC_PIE_OFF = 0x20007006 RTC_PIE_ON = 0x20007005 RTC_PLL_GET = 0x401c7011 RTC_PLL_SET = 0x801c7012 RTC_RD_TIME = 0x40247009 RTC_SET_TIME = 0x8024700a RTC_UIE_OFF = 0x20007004 RTC_UIE_ON = 0x20007003 RTC_VL_CLR = 0x20007014 RTC_VL_READ = 0x40047013 RTC_WIE_OFF = 0x20007010 RTC_WIE_ON = 0x2000700f RTC_WKALM_RD = 0x40287010 RTC_WKALM_SET = 0x8028700f SCM_DEVMEM_DMABUF = 0x4f SCM_DEVMEM_LINEAR = 0x4e SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a SCM_TIMESTAMPNS = 0x23 SCM_TS_OPT_ID = 0x51 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 SECCOMP_IOCTL_NOTIF_ADDFD = 0x80182103 SECCOMP_IOCTL_NOTIF_ID_VALID = 0x80082102 SECCOMP_IOCTL_NOTIF_SET_FLAGS = 0x80082104 SFD_CLOEXEC = 0x80000 SFD_NONBLOCK = 0x800 SIOCATMARK = 0x8905 SIOCGPGRP = 0x8904 SIOCGSTAMPNS_NEW = 0x40108907 SIOCGSTAMP_NEW = 0x40108906 SIOCINQ = 0x4004667f SIOCOUTQ = 0x40047473 SIOCSPGRP = 0x8902 SOCK_CLOEXEC = 0x80000 SOCK_DGRAM = 0x2 SOCK_NONBLOCK = 0x800 SOCK_STREAM = 0x1 SOL_SOCKET = 0x1 SO_ACCEPTCONN = 0x1e SO_ATTACH_BPF = 0x32 SO_ATTACH_REUSEPORT_CBPF = 0x33 SO_ATTACH_REUSEPORT_EBPF = 0x34 SO_BINDTODEVICE = 0x19 SO_BINDTOIFINDEX = 0x3e SO_BPF_EXTENSIONS = 0x30 SO_BROADCAST = 0x6 SO_BSDCOMPAT = 0xe SO_BUF_LOCK = 0x48 SO_BUSY_POLL = 0x2e SO_BUSY_POLL_BUDGET = 0x46 SO_CNX_ADVICE = 0x35 SO_COOKIE = 0x39 SO_DETACH_REUSEPORT_BPF = 0x44 SO_DEVMEM_DMABUF = 0x4f SO_DEVMEM_DONTNEED = 0x50 SO_DEVMEM_LINEAR = 0x4e SO_DOMAIN = 0x27 SO_DONTROUTE = 0x5 SO_ERROR = 0x4 SO_INCOMING_CPU = 0x31 SO_INCOMING_NAPI_ID = 0x38 SO_KEEPALIVE = 0x9 SO_LINGER = 0xd SO_LOCK_FILTER = 0x2c SO_MARK = 0x24 SO_MAX_PACING_RATE = 0x2f SO_MEMINFO = 0x37 SO_NETNS_COOKIE = 0x47 SO_NOFCS = 0x2b SO_OOBINLINE = 0xa SO_PASSCRED = 0x14 SO_PASSPIDFD = 0x4c SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x15 SO_PEERGROUPS = 0x3b SO_PEERPIDFD = 0x4d SO_PEERSEC = 0x1f SO_PREFER_BUSY_POLL = 0x45 SO_PROTOCOL = 0x26 SO_RCVBUF = 0x8 SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x10 SO_RCVMARK = 0x4b SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x12 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x12 SO_RESERVE_MEM = 0x49 SO_REUSEADDR = 0x2 SO_REUSEPORT = 0xf SO_RXQ_OVFL = 0x28 SO_SECURITY_AUTHENTICATION = 0x16 SO_SECURITY_ENCRYPTION_NETWORK = 0x18 SO_SECURITY_ENCRYPTION_TRANSPORT = 0x17 SO_SELECT_ERR_QUEUE = 0x2d SO_SNDBUF = 0x7 SO_SNDBUFFORCE = 0x20 SO_SNDLOWAT = 0x11 SO_SNDTIMEO = 0x13 SO_SNDTIMEO_NEW = 0x43 SO_SNDTIMEO_OLD = 0x13 SO_TIMESTAMPING = 0x25 SO_TIMESTAMPING_NEW = 0x41 SO_TIMESTAMPING_OLD = 0x25 SO_TIMESTAMPNS = 0x23 SO_TIMESTAMPNS_NEW = 0x40 SO_TIMESTAMPNS_OLD = 0x23 SO_TIMESTAMP_NEW = 0x3f SO_TXREHASH = 0x4a SO_TXTIME = 0x3d SO_TYPE = 0x3 SO_WIFI_STATUS = 0x29 SO_ZEROCOPY = 0x3c TAB1 = 0x400 TAB2 = 0x800 TAB3 = 0xc00 TABDLY = 0xc00 TCFLSH = 0x2000741f TCGETA = 0x40147417 TCGETS = 0x402c7413 TCSAFLUSH = 0x2 TCSBRK = 0x2000741d TCSBRKP = 0x5425 TCSETA = 0x80147418 TCSETAF = 0x8014741c TCSETAW = 0x80147419 TCSETS = 0x802c7414 TCSETSF = 0x802c7416 TCSETSW = 0x802c7415 TCXONC = 0x2000741e TFD_CLOEXEC = 0x80000 TFD_NONBLOCK = 0x800 TIOCCBRK = 0x5428 TIOCCONS = 0x541d TIOCEXCL = 0x540c TIOCGDEV = 0x40045432 TIOCGETC = 0x40067412 TIOCGETD = 0x5424 TIOCGETP = 0x40067408 TIOCGEXCL = 0x40045440 TIOCGICOUNT = 0x545d TIOCGISO7816 = 0x40285442 TIOCGLCKTRMIOS = 0x5456 TIOCGLTC = 0x40067474 TIOCGPGRP = 0x40047477 TIOCGPKT = 0x40045438 TIOCGPTLCK = 0x40045439 TIOCGPTN = 0x40045430 TIOCGPTPEER = 0x20005441 TIOCGRS485 = 0x542e TIOCGSERIAL = 0x541e TIOCGSID = 0x5429 TIOCGSOFTCAR = 0x5419 TIOCGWINSZ = 0x40087468 TIOCINQ = 0x4004667f TIOCLINUX = 0x541c TIOCMBIC = 0x5417 TIOCMBIS = 0x5416 TIOCMGET = 0x5415 TIOCMIWAIT = 0x545c TIOCMSET = 0x5418 TIOCM_CAR = 0x40 TIOCM_CD = 0x40 TIOCM_CTS = 0x20 TIOCM_DSR = 0x100 TIOCM_LOOP = 0x8000 TIOCM_OUT1 = 0x2000 TIOCM_OUT2 = 0x4000 TIOCM_RI = 0x80 TIOCM_RNG = 0x80 TIOCM_SR = 0x10 TIOCM_ST = 0x8 TIOCNOTTY = 0x5422 TIOCNXCL = 0x540d TIOCOUTQ = 0x40047473 TIOCPKT = 0x5420 TIOCSBRK = 0x5427 TIOCSCTTY = 0x540e TIOCSERCONFIG = 0x5453 TIOCSERGETLSR = 0x5459 TIOCSERGETMULTI = 0x545a TIOCSERGSTRUCT = 0x5458 TIOCSERGWILD = 0x5454 TIOCSERSETMULTI = 0x545b TIOCSERSWILD = 0x5455 TIOCSER_TEMT = 0x1 TIOCSETC = 0x80067411 TIOCSETD = 0x5423 TIOCSETN = 0x8006740a TIOCSETP = 0x80067409 TIOCSIG = 0x80045436 TIOCSISO7816 = 0xc0285443 TIOCSLCKTRMIOS = 0x5457 TIOCSLTC = 0x80067475 TIOCSPGRP = 0x80047476 TIOCSPTLCK = 0x80045431 TIOCSRS485 = 0x542f TIOCSSERIAL = 0x541f TIOCSSOFTCAR = 0x541a TIOCSTART = 0x2000746e TIOCSTI = 0x5412 TIOCSTOP = 0x2000746f TIOCSWINSZ = 0x80087467 TIOCVHANGUP = 0x5437 TOSTOP = 0x400000 TUNATTACHFILTER = 0x800854d5 TUNDETACHFILTER = 0x800854d6 TUNGETDEVNETNS = 0x200054e3 TUNGETFEATURES = 0x400454cf TUNGETFILTER = 0x400854db TUNGETIFF = 0x400454d2 TUNGETSNDBUF = 0x400454d3 TUNGETVNETBE = 0x400454df TUNGETVNETHDRSZ = 0x400454d7 TUNGETVNETLE = 0x400454dd TUNSETCARRIER = 0x800454e2 TUNSETDEBUG = 0x800454c9 TUNSETFILTEREBPF = 0x400454e1 TUNSETGROUP = 0x800454ce TUNSETIFF = 0x800454ca TUNSETIFINDEX = 0x800454da TUNSETLINK = 0x800454cd TUNSETNOCSUM = 0x800454c8 TUNSETOFFLOAD = 0x800454d0 TUNSETOWNER = 0x800454cc TUNSETPERSIST = 0x800454cb TUNSETQUEUE = 0x800454d9 TUNSETSNDBUF = 0x800454d4 TUNSETSTEERINGEBPF = 0x400454e0 TUNSETTXFILTER = 0x800454d1 TUNSETVNETBE = 0x800454de TUNSETVNETHDRSZ = 0x800454d8 TUNSETVNETLE = 0x800454dc UBI_IOCATT = 0x80186f40 UBI_IOCDET = 0x80046f41 UBI_IOCEBCH = 0x80044f02 UBI_IOCEBER = 0x80044f01 UBI_IOCEBISMAP = 0x40044f05 UBI_IOCEBMAP = 0x80084f03 UBI_IOCEBUNMAP = 0x80044f04 UBI_IOCMKVOL = 0x80986f00 UBI_IOCRMVOL = 0x80046f01 UBI_IOCRNVOL = 0x91106f03 UBI_IOCRPEB = 0x80046f04 UBI_IOCRSVOL = 0x800c6f02 UBI_IOCSETVOLPROP = 0x80104f06 UBI_IOCSPEB = 0x80046f05 UBI_IOCVOLCRBLK = 0x80804f07 UBI_IOCVOLRMBLK = 0x20004f08 UBI_IOCVOLUP = 0x80084f00 VDISCARD = 0x10 VEOF = 0x4 VEOL = 0x6 VEOL2 = 0x8 VMIN = 0x5 VREPRINT = 0xb VSTART = 0xd VSTOP = 0xe VSUSP = 0xc VSWTC = 0x9 VT1 = 0x10000 VTDLY = 0x10000 VTIME = 0x7 VWERASE = 0xa WDIOC_GETBOOTSTATUS = 0x40045702 WDIOC_GETPRETIMEOUT = 0x40045709 WDIOC_GETSTATUS = 0x40045701 WDIOC_GETSUPPORT = 0x40285700 WDIOC_GETTEMP = 0x40045703 WDIOC_GETTIMELEFT = 0x4004570a WDIOC_GETTIMEOUT = 0x40045707 WDIOC_KEEPALIVE = 0x40045705 WDIOC_SETOPTIONS = 0x40045704 WORDSIZE = 0x20 XCASE = 0x4000 XTABS = 0xc00 _HIDIOCGRAWNAME = 0x40804804 _HIDIOCGRAWPHYS = 0x40404805 _HIDIOCGRAWUNIQ = 0x40404808 ) // Errors const ( EADDRINUSE = syscall.Errno(0x62) EADDRNOTAVAIL = syscall.Errno(0x63) EADV = syscall.Errno(0x44) EAFNOSUPPORT = syscall.Errno(0x61) EALREADY = syscall.Errno(0x72) EBADE = syscall.Errno(0x34) EBADFD = syscall.Errno(0x4d) EBADMSG = syscall.Errno(0x4a) EBADR = syscall.Errno(0x35) EBADRQC = syscall.Errno(0x38) EBADSLT = syscall.Errno(0x39) EBFONT = syscall.Errno(0x3b) ECANCELED = syscall.Errno(0x7d) ECHRNG = syscall.Errno(0x2c) ECOMM = syscall.Errno(0x46) ECONNABORTED = syscall.Errno(0x67) ECONNREFUSED = syscall.Errno(0x6f) ECONNRESET = syscall.Errno(0x68) EDEADLK = syscall.Errno(0x23) EDEADLOCK = syscall.Errno(0x3a) EDESTADDRREQ = syscall.Errno(0x59) EDOTDOT = syscall.Errno(0x49) EDQUOT = syscall.Errno(0x7a) EHOSTDOWN = syscall.Errno(0x70) EHOSTUNREACH = syscall.Errno(0x71) EHWPOISON = syscall.Errno(0x85) EIDRM = syscall.Errno(0x2b) EILSEQ = syscall.Errno(0x54) EINPROGRESS = syscall.Errno(0x73) EISCONN = syscall.Errno(0x6a) EISNAM = syscall.Errno(0x78) EKEYEXPIRED = syscall.Errno(0x7f) EKEYREJECTED = syscall.Errno(0x81) EKEYREVOKED = syscall.Errno(0x80) EL2HLT = syscall.Errno(0x33) EL2NSYNC = syscall.Errno(0x2d) EL3HLT = syscall.Errno(0x2e) EL3RST = syscall.Errno(0x2f) ELIBACC = syscall.Errno(0x4f) ELIBBAD = syscall.Errno(0x50) ELIBEXEC = syscall.Errno(0x53) ELIBMAX = syscall.Errno(0x52) ELIBSCN = syscall.Errno(0x51) ELNRNG = syscall.Errno(0x30) ELOOP = syscall.Errno(0x28) EMEDIUMTYPE = syscall.Errno(0x7c) EMSGSIZE = syscall.Errno(0x5a) EMULTIHOP = syscall.Errno(0x48) ENAMETOOLONG = syscall.Errno(0x24) ENAVAIL = syscall.Errno(0x77) ENETDOWN = syscall.Errno(0x64) ENETRESET = syscall.Errno(0x66) ENETUNREACH = syscall.Errno(0x65) ENOANO = syscall.Errno(0x37) ENOBUFS = syscall.Errno(0x69) ENOCSI = syscall.Errno(0x32) ENODATA = syscall.Errno(0x3d) ENOKEY = syscall.Errno(0x7e) ENOLCK = syscall.Errno(0x25) ENOLINK = syscall.Errno(0x43) ENOMEDIUM = syscall.Errno(0x7b) ENOMSG = syscall.Errno(0x2a) ENONET = syscall.Errno(0x40) ENOPKG = syscall.Errno(0x41) ENOPROTOOPT = syscall.Errno(0x5c) ENOSR = syscall.Errno(0x3f) ENOSTR = syscall.Errno(0x3c) ENOSYS = syscall.Errno(0x26) ENOTCONN = syscall.Errno(0x6b) ENOTEMPTY = syscall.Errno(0x27) ENOTNAM = syscall.Errno(0x76) ENOTRECOVERABLE = syscall.Errno(0x83) ENOTSOCK = syscall.Errno(0x58) ENOTSUP = syscall.Errno(0x5f) ENOTUNIQ = syscall.Errno(0x4c) EOPNOTSUPP = syscall.Errno(0x5f) EOVERFLOW = syscall.Errno(0x4b) EOWNERDEAD = syscall.Errno(0x82) EPFNOSUPPORT = syscall.Errno(0x60) EPROTO = syscall.Errno(0x47) EPROTONOSUPPORT = syscall.Errno(0x5d) EPROTOTYPE = syscall.Errno(0x5b) EREMCHG = syscall.Errno(0x4e) EREMOTE = syscall.Errno(0x42) EREMOTEIO = syscall.Errno(0x79) ERESTART = syscall.Errno(0x55) ERFKILL = syscall.Errno(0x84) ESHUTDOWN = syscall.Errno(0x6c) ESOCKTNOSUPPORT = syscall.Errno(0x5e) ESRMNT = syscall.Errno(0x45) ESTALE = syscall.Errno(0x74) ESTRPIPE = syscall.Errno(0x56) ETIME = syscall.Errno(0x3e) ETIMEDOUT = syscall.Errno(0x6e) ETOOMANYREFS = syscall.Errno(0x6d) EUCLEAN = syscall.Errno(0x75) EUNATCH = syscall.Errno(0x31) EUSERS = syscall.Errno(0x57) EXFULL = syscall.Errno(0x36) ) // Signals const ( SIGBUS = syscall.Signal(0x7) SIGCHLD = syscall.Signal(0x11) SIGCLD = syscall.Signal(0x11) SIGCONT = syscall.Signal(0x12) SIGIO = syscall.Signal(0x1d) SIGPOLL = syscall.Signal(0x1d) SIGPROF = syscall.Signal(0x1b) SIGPWR = syscall.Signal(0x1e) SIGSTKFLT = syscall.Signal(0x10) SIGSTOP = syscall.Signal(0x13) SIGSYS = syscall.Signal(0x1f) SIGTSTP = syscall.Signal(0x14) SIGTTIN = syscall.Signal(0x15) SIGTTOU = syscall.Signal(0x16) SIGURG = syscall.Signal(0x17) SIGUSR1 = syscall.Signal(0xa) SIGUSR2 = syscall.Signal(0xc) SIGVTALRM = syscall.Signal(0x1a) SIGWINCH = syscall.Signal(0x1c) SIGXCPU = syscall.Signal(0x18) SIGXFSZ = syscall.Signal(0x19) ) // Error table var errorList = [...]struct { num syscall.Errno name string desc string }{ {1, "EPERM", "operation not permitted"}, {2, "ENOENT", "no such file or directory"}, {3, "ESRCH", "no such process"}, {4, "EINTR", "interrupted system call"}, {5, "EIO", "input/output error"}, {6, "ENXIO", "no such device or address"}, {7, "E2BIG", "argument list too long"}, {8, "ENOEXEC", "exec format error"}, {9, "EBADF", "bad file descriptor"}, {10, "ECHILD", "no child processes"}, {11, "EAGAIN", "resource temporarily unavailable"}, {12, "ENOMEM", "cannot allocate memory"}, {13, "EACCES", "permission denied"}, {14, "EFAULT", "bad address"}, {15, "ENOTBLK", "block device required"}, {16, "EBUSY", "device or resource busy"}, {17, "EEXIST", "file exists"}, {18, "EXDEV", "invalid cross-device link"}, {19, "ENODEV", "no such device"}, {20, "ENOTDIR", "not a directory"}, {21, "EISDIR", "is a directory"}, {22, "EINVAL", "invalid argument"}, {23, "ENFILE", "too many open files in system"}, {24, "EMFILE", "too many open files"}, {25, "ENOTTY", "inappropriate ioctl for device"}, {26, "ETXTBSY", "text file busy"}, {27, "EFBIG", "file too large"}, {28, "ENOSPC", "no space left on device"}, {29, "ESPIPE", "illegal seek"}, {30, "EROFS", "read-only file system"}, {31, "EMLINK", "too many links"}, {32, "EPIPE", "broken pipe"}, {33, "EDOM", "numerical argument out of domain"}, {34, "ERANGE", "numerical result out of range"}, {35, "EDEADLK", "resource deadlock avoided"}, {36, "ENAMETOOLONG", "file name too long"}, {37, "ENOLCK", "no locks available"}, {38, "ENOSYS", "function not implemented"}, {39, "ENOTEMPTY", "directory not empty"}, {40, "ELOOP", "too many levels of symbolic links"}, {42, "ENOMSG", "no message of desired type"}, {43, "EIDRM", "identifier removed"}, {44, "ECHRNG", "channel number out of range"}, {45, "EL2NSYNC", "level 2 not synchronized"}, {46, "EL3HLT", "level 3 halted"}, {47, "EL3RST", "level 3 reset"}, {48, "ELNRNG", "link number out of range"}, {49, "EUNATCH", "protocol driver not attached"}, {50, "ENOCSI", "no CSI structure available"}, {51, "EL2HLT", "level 2 halted"}, {52, "EBADE", "invalid exchange"}, {53, "EBADR", "invalid request descriptor"}, {54, "EXFULL", "exchange full"}, {55, "ENOANO", "no anode"}, {56, "EBADRQC", "invalid request code"}, {57, "EBADSLT", "invalid slot"}, {58, "EDEADLOCK", "file locking deadlock error"}, {59, "EBFONT", "bad font file format"}, {60, "ENOSTR", "device not a stream"}, {61, "ENODATA", "no data available"}, {62, "ETIME", "timer expired"}, {63, "ENOSR", "out of streams resources"}, {64, "ENONET", "machine is not on the network"}, {65, "ENOPKG", "package not installed"}, {66, "EREMOTE", "object is remote"}, {67, "ENOLINK", "link has been severed"}, {68, "EADV", "advertise error"}, {69, "ESRMNT", "srmount error"}, {70, "ECOMM", "communication error on send"}, {71, "EPROTO", "protocol error"}, {72, "EMULTIHOP", "multihop attempted"}, {73, "EDOTDOT", "RFS specific error"}, {74, "EBADMSG", "bad message"}, {75, "EOVERFLOW", "value too large for defined data type"}, {76, "ENOTUNIQ", "name not unique on network"}, {77, "EBADFD", "file descriptor in bad state"}, {78, "EREMCHG", "remote address changed"}, {79, "ELIBACC", "can not access a needed shared library"}, {80, "ELIBBAD", "accessing a corrupted shared library"}, {81, "ELIBSCN", ".lib section in a.out corrupted"}, {82, "ELIBMAX", "attempting to link in too many shared libraries"}, {83, "ELIBEXEC", "cannot exec a shared library directly"}, {84, "EILSEQ", "invalid or incomplete multibyte or wide character"}, {85, "ERESTART", "interrupted system call should be restarted"}, {86, "ESTRPIPE", "streams pipe error"}, {87, "EUSERS", "too many users"}, {88, "ENOTSOCK", "socket operation on non-socket"}, {89, "EDESTADDRREQ", "destination address required"}, {90, "EMSGSIZE", "message too long"}, {91, "EPROTOTYPE", "protocol wrong type for socket"}, {92, "ENOPROTOOPT", "protocol not available"}, {93, "EPROTONOSUPPORT", "protocol not supported"}, {94, "ESOCKTNOSUPPORT", "socket type not supported"}, {95, "ENOTSUP", "operation not supported"}, {96, "EPFNOSUPPORT", "protocol family not supported"}, {97, "EAFNOSUPPORT", "address family not supported by protocol"}, {98, "EADDRINUSE", "address already in use"}, {99, "EADDRNOTAVAIL", "cannot assign requested address"}, {100, "ENETDOWN", "network is down"}, {101, "ENETUNREACH", "network is unreachable"}, {102, "ENETRESET", "network dropped connection on reset"}, {103, "ECONNABORTED", "software caused connection abort"}, {104, "ECONNRESET", "connection reset by peer"}, {105, "ENOBUFS", "no buffer space available"}, {106, "EISCONN", "transport endpoint is already connected"}, {107, "ENOTCONN", "transport endpoint is not connected"}, {108, "ESHUTDOWN", "cannot send after transport endpoint shutdown"}, {109, "ETOOMANYREFS", "too many references: cannot splice"}, {110, "ETIMEDOUT", "connection timed out"}, {111, "ECONNREFUSED", "connection refused"}, {112, "EHOSTDOWN", "host is down"}, {113, "EHOSTUNREACH", "no route to host"}, {114, "EALREADY", "operation already in progress"}, {115, "EINPROGRESS", "operation now in progress"}, {116, "ESTALE", "stale file handle"}, {117, "EUCLEAN", "structure needs cleaning"}, {118, "ENOTNAM", "not a XENIX named type file"}, {119, "ENAVAIL", "no XENIX semaphores available"}, {120, "EISNAM", "is a named type file"}, {121, "EREMOTEIO", "remote I/O error"}, {122, "EDQUOT", "disk quota exceeded"}, {123, "ENOMEDIUM", "no medium found"}, {124, "EMEDIUMTYPE", "wrong medium type"}, {125, "ECANCELED", "operation canceled"}, {126, "ENOKEY", "required key not available"}, {127, "EKEYEXPIRED", "key has expired"}, {128, "EKEYREVOKED", "key has been revoked"}, {129, "EKEYREJECTED", "key was rejected by service"}, {130, "EOWNERDEAD", "owner died"}, {131, "ENOTRECOVERABLE", "state not recoverable"}, {132, "ERFKILL", "operation not possible due to RF-kill"}, {133, "EHWPOISON", "memory page has hardware error"}, } // Signal table var signalList = [...]struct { num syscall.Signal name string desc string }{ {1, "SIGHUP", "hangup"}, {2, "SIGINT", "interrupt"}, {3, "SIGQUIT", "quit"}, {4, "SIGILL", "illegal instruction"}, {5, "SIGTRAP", "trace/breakpoint trap"}, {6, "SIGABRT", "aborted"}, {7, "SIGBUS", "bus error"}, {8, "SIGFPE", "floating point exception"}, {9, "SIGKILL", "killed"}, {10, "SIGUSR1", "user defined signal 1"}, {11, "SIGSEGV", "segmentation fault"}, {12, "SIGUSR2", "user defined signal 2"}, {13, "SIGPIPE", "broken pipe"}, {14, "SIGALRM", "alarm clock"}, {15, "SIGTERM", "terminated"}, {16, "SIGSTKFLT", "stack fault"}, {17, "SIGCHLD", "child exited"}, {18, "SIGCONT", "continued"}, {19, "SIGSTOP", "stopped (signal)"}, {20, "SIGTSTP", "stopped"}, {21, "SIGTTIN", "stopped (tty input)"}, {22, "SIGTTOU", "stopped (tty output)"}, {23, "SIGURG", "urgent I/O condition"}, {24, "SIGXCPU", "CPU time limit exceeded"}, {25, "SIGXFSZ", "file size limit exceeded"}, {26, "SIGVTALRM", "virtual timer expired"}, {27, "SIGPROF", "profiling timer expired"}, {28, "SIGWINCH", "window changed"}, {29, "SIGIO", "I/O possible"}, {30, "SIGPWR", "power failure"}, {31, "SIGSYS", "bad system call"}, } ================================================ FILE: vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go ================================================ // mkerrors.sh -Wall -Werror -static -I/tmp/ppc64/include // Code generated by the command above; see README.md. DO NOT EDIT. //go:build ppc64 && linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -Wall -Werror -static -I/tmp/ppc64/include _const.go package unix import "syscall" const ( B1000000 = 0x17 B115200 = 0x11 B1152000 = 0x18 B1500000 = 0x19 B2000000 = 0x1a B230400 = 0x12 B2500000 = 0x1b B3000000 = 0x1c B3500000 = 0x1d B4000000 = 0x1e B460800 = 0x13 B500000 = 0x14 B57600 = 0x10 B576000 = 0x15 B921600 = 0x16 BLKALIGNOFF = 0x2000127a BLKBSZGET = 0x40081270 BLKBSZSET = 0x80081271 BLKDISCARD = 0x20001277 BLKDISCARDZEROES = 0x2000127c BLKFLSBUF = 0x20001261 BLKFRAGET = 0x20001265 BLKFRASET = 0x20001264 BLKGETDISKSEQ = 0x40081280 BLKGETSIZE = 0x20001260 BLKGETSIZE64 = 0x40081272 BLKIOMIN = 0x20001278 BLKIOOPT = 0x20001279 BLKPBSZGET = 0x2000127b BLKRAGET = 0x20001263 BLKRASET = 0x20001262 BLKROGET = 0x2000125e BLKROSET = 0x2000125d BLKROTATIONAL = 0x2000127e BLKRRPART = 0x2000125f BLKSECDISCARD = 0x2000127d BLKSECTGET = 0x20001267 BLKSECTSET = 0x20001266 BLKSSZGET = 0x20001268 BLKZEROOUT = 0x2000127f BOTHER = 0x1f BS1 = 0x8000 BSDLY = 0x8000 CBAUD = 0xff CBAUDEX = 0x0 CIBAUD = 0xff0000 CLOCAL = 0x8000 CR1 = 0x1000 CR2 = 0x2000 CR3 = 0x3000 CRDLY = 0x3000 CREAD = 0x800 CS6 = 0x100 CS7 = 0x200 CS8 = 0x300 CSIZE = 0x300 CSTOPB = 0x400 DM_MPATH_PROBE_PATHS = 0x2000fd12 ECCGETLAYOUT = 0x41484d11 ECCGETSTATS = 0x40104d12 ECHOCTL = 0x40 ECHOE = 0x2 ECHOK = 0x4 ECHOKE = 0x1 ECHONL = 0x10 ECHOPRT = 0x20 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 EPIOCGPARAMS = 0x40088a02 EPIOCSPARAMS = 0x80088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000000 FF1 = 0x4000 FFDLY = 0x4000 FICLONE = 0x80049409 FICLONERANGE = 0x8020940d FLUSHO = 0x800000 FS_IOC_ENABLE_VERITY = 0x80806685 FS_IOC_GETFLAGS = 0x40086601 FS_IOC_GET_ENCRYPTION_NONCE = 0x4010661b FS_IOC_GET_ENCRYPTION_POLICY = 0x800c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x80106614 FS_IOC_SETFLAGS = 0x80086602 FS_IOC_SET_ENCRYPTION_POLICY = 0x400c6613 F_GETLK = 0x5 F_GETLK64 = 0xc F_GETOWN = 0x9 F_RDLCK = 0x0 F_SETLK = 0x6 F_SETLK64 = 0xd F_SETLKW = 0x7 F_SETLKW64 = 0xe F_SETOWN = 0x8 F_UNLCK = 0x2 F_WRLCK = 0x1 HIDIOCGRAWINFO = 0x40084803 HIDIOCGRDESC = 0x50044802 HIDIOCGRDESCSIZE = 0x40044801 HIDIOCREVOKE = 0x8004480d HUPCL = 0x4000 ICANON = 0x100 IEXTEN = 0x400 IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x800 IOCTL_MEI_NOTIFY_GET = 0x40044803 IOCTL_MEI_NOTIFY_SET = 0x80044802 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x200007b9 IPV6_FLOWINFO_MASK = 0xfffffff IPV6_FLOWLABEL_MASK = 0xfffff ISIG = 0x80 IUCLC = 0x1000 IXOFF = 0x400 IXON = 0x200 MAP_ANON = 0x20 MAP_ANONYMOUS = 0x20 MAP_DENYWRITE = 0x800 MAP_EXECUTABLE = 0x1000 MAP_GROWSDOWN = 0x100 MAP_HUGETLB = 0x40000 MAP_LOCKED = 0x80 MAP_NONBLOCK = 0x10000 MAP_NORESERVE = 0x40 MAP_POPULATE = 0x8000 MAP_STACK = 0x20000 MAP_SYNC = 0x80000 MCL_CURRENT = 0x2000 MCL_FUTURE = 0x4000 MCL_ONFAULT = 0x8000 MEMERASE = 0x80084d02 MEMERASE64 = 0x80104d14 MEMGETBADBLOCK = 0x80084d0b MEMGETINFO = 0x40204d01 MEMGETOOBSEL = 0x40c84d0a MEMGETREGIONCOUNT = 0x40044d07 MEMISLOCKED = 0x40084d17 MEMLOCK = 0x80084d05 MEMREAD = 0xc0404d1a MEMREADOOB = 0xc0104d04 MEMSETBADBLOCK = 0x80084d0c MEMUNLOCK = 0x80084d06 MEMWRITEOOB = 0xc0104d03 MTDFILEMODE = 0x20004d13 NFDBITS = 0x40 NL2 = 0x200 NL3 = 0x300 NLDLY = 0x300 NOFLSH = 0x80000000 NS_GET_MNTNS_ID = 0x4008b705 NS_GET_NSTYPE = 0x2000b703 NS_GET_OWNER_UID = 0x2000b704 NS_GET_PARENT = 0x2000b702 NS_GET_PID_FROM_PIDNS = 0x4004b706 NS_GET_PID_IN_PIDNS = 0x4004b708 NS_GET_TGID_FROM_PIDNS = 0x4004b707 NS_GET_TGID_IN_PIDNS = 0x4004b709 NS_GET_USERNS = 0x2000b701 OLCUC = 0x4 ONLCR = 0x2 OTPERASE = 0x800c4d19 OTPGETREGIONCOUNT = 0x80044d0e OTPGETREGIONINFO = 0x800c4d0f OTPLOCK = 0x400c4d10 OTPSELECT = 0x40044d0d O_APPEND = 0x400 O_ASYNC = 0x2000 O_CLOEXEC = 0x80000 O_CREAT = 0x40 O_DIRECT = 0x20000 O_DIRECTORY = 0x4000 O_DSYNC = 0x1000 O_EXCL = 0x80 O_FSYNC = 0x101000 O_LARGEFILE = 0x0 O_NDELAY = 0x800 O_NOATIME = 0x40000 O_NOCTTY = 0x100 O_NOFOLLOW = 0x8000 O_NONBLOCK = 0x800 O_PATH = 0x200000 O_RSYNC = 0x101000 O_SYNC = 0x101000 O_TMPFILE = 0x404000 O_TRUNC = 0x200 PARENB = 0x1000 PARODD = 0x2000 PENDIN = 0x20000000 PERF_EVENT_IOC_DISABLE = 0x20002401 PERF_EVENT_IOC_ENABLE = 0x20002400 PERF_EVENT_IOC_ID = 0x40082407 PERF_EVENT_IOC_MODIFY_ATTRIBUTES = 0x8008240b PERF_EVENT_IOC_PAUSE_OUTPUT = 0x80042409 PERF_EVENT_IOC_PERIOD = 0x80082404 PERF_EVENT_IOC_QUERY_BPF = 0xc008240a PERF_EVENT_IOC_REFRESH = 0x20002402 PERF_EVENT_IOC_RESET = 0x20002403 PERF_EVENT_IOC_SET_BPF = 0x80042408 PERF_EVENT_IOC_SET_FILTER = 0x80082406 PERF_EVENT_IOC_SET_OUTPUT = 0x20002405 PPPIOCATTACH = 0x8004743d PPPIOCATTCHAN = 0x80047438 PPPIOCBRIDGECHAN = 0x80047435 PPPIOCCONNECT = 0x8004743a PPPIOCDETACH = 0x8004743c PPPIOCDISCONN = 0x20007439 PPPIOCGASYNCMAP = 0x40047458 PPPIOCGCHAN = 0x40047437 PPPIOCGDEBUG = 0x40047441 PPPIOCGFLAGS = 0x4004745a PPPIOCGIDLE = 0x4010743f PPPIOCGIDLE32 = 0x4008743f PPPIOCGIDLE64 = 0x4010743f PPPIOCGL2TPSTATS = 0x40487436 PPPIOCGMRU = 0x40047453 PPPIOCGRASYNCMAP = 0x40047455 PPPIOCGUNIT = 0x40047456 PPPIOCGXASYNCMAP = 0x40207450 PPPIOCSACTIVE = 0x80107446 PPPIOCSASYNCMAP = 0x80047457 PPPIOCSCOMPRESS = 0x8010744d PPPIOCSDEBUG = 0x80047440 PPPIOCSFLAGS = 0x80047459 PPPIOCSMAXCID = 0x80047451 PPPIOCSMRRU = 0x8004743b PPPIOCSMRU = 0x80047452 PPPIOCSNPMODE = 0x8008744b PPPIOCSPASS = 0x80107447 PPPIOCSRASYNCMAP = 0x80047454 PPPIOCSXASYNCMAP = 0x8020744f PPPIOCUNBRIDGECHAN = 0x20007434 PPPIOCXFERUNIT = 0x2000744e PROT_SAO = 0x10 PR_SET_PTRACER_ANY = 0xffffffffffffffff PTP_CLOCK_GETCAPS = 0x40503d01 PTP_CLOCK_GETCAPS2 = 0x40503d0a PTP_ENABLE_PPS = 0x80043d04 PTP_ENABLE_PPS2 = 0x80043d0d PTP_EXTTS_REQUEST = 0x80103d02 PTP_EXTTS_REQUEST2 = 0x80103d0b PTP_MASK_CLEAR_ALL = 0x20003d13 PTP_MASK_EN_SINGLE = 0x80043d14 PTP_PEROUT_REQUEST = 0x80383d03 PTP_PEROUT_REQUEST2 = 0x80383d0c PTP_PIN_SETFUNC = 0x80603d07 PTP_PIN_SETFUNC2 = 0x80603d10 PTP_SYS_OFFSET = 0x83403d05 PTP_SYS_OFFSET2 = 0x83403d0e PTRACE_GETEVRREGS = 0x14 PTRACE_GETFPREGS = 0xe PTRACE_GETREGS64 = 0x16 PTRACE_GETVRREGS = 0x12 PTRACE_GETVSRREGS = 0x1b PTRACE_GET_DEBUGREG = 0x19 PTRACE_SETEVRREGS = 0x15 PTRACE_SETFPREGS = 0xf PTRACE_SETREGS64 = 0x17 PTRACE_SETVRREGS = 0x13 PTRACE_SETVSRREGS = 0x1c PTRACE_SET_DEBUGREG = 0x1a PTRACE_SINGLEBLOCK = 0x100 PTRACE_SYSEMU = 0x1d PTRACE_SYSEMU_SINGLESTEP = 0x1e PT_CCR = 0x26 PT_CTR = 0x23 PT_DAR = 0x29 PT_DSCR = 0x2c PT_DSISR = 0x2a PT_FPR0 = 0x30 PT_FPSCR = 0x50 PT_LNK = 0x24 PT_MSR = 0x21 PT_NIP = 0x20 PT_ORIG_R3 = 0x22 PT_R0 = 0x0 PT_R1 = 0x1 PT_R10 = 0xa PT_R11 = 0xb PT_R12 = 0xc PT_R13 = 0xd PT_R14 = 0xe PT_R15 = 0xf PT_R16 = 0x10 PT_R17 = 0x11 PT_R18 = 0x12 PT_R19 = 0x13 PT_R2 = 0x2 PT_R20 = 0x14 PT_R21 = 0x15 PT_R22 = 0x16 PT_R23 = 0x17 PT_R24 = 0x18 PT_R25 = 0x19 PT_R26 = 0x1a PT_R27 = 0x1b PT_R28 = 0x1c PT_R29 = 0x1d PT_R3 = 0x3 PT_R30 = 0x1e PT_R31 = 0x1f PT_R4 = 0x4 PT_R5 = 0x5 PT_R6 = 0x6 PT_R7 = 0x7 PT_R8 = 0x8 PT_R9 = 0x9 PT_REGS_COUNT = 0x2c PT_RESULT = 0x2b PT_SOFTE = 0x27 PT_TRAP = 0x28 PT_VR0 = 0x52 PT_VRSAVE = 0x94 PT_VSCR = 0x93 PT_VSR0 = 0x96 PT_VSR31 = 0xd4 PT_XER = 0x25 RLIMIT_AS = 0x9 RLIMIT_MEMLOCK = 0x8 RLIMIT_NOFILE = 0x7 RLIMIT_NPROC = 0x6 RLIMIT_RSS = 0x5 RNDADDENTROPY = 0x80085203 RNDADDTOENTCNT = 0x80045201 RNDCLEARPOOL = 0x20005206 RNDGETENTCNT = 0x40045200 RNDGETPOOL = 0x40085202 RNDRESEEDCRNG = 0x20005207 RNDZAPENTCNT = 0x20005204 RTC_AIE_OFF = 0x20007002 RTC_AIE_ON = 0x20007001 RTC_ALM_READ = 0x40247008 RTC_ALM_SET = 0x80247007 RTC_EPOCH_READ = 0x4008700d RTC_EPOCH_SET = 0x8008700e RTC_IRQP_READ = 0x4008700b RTC_IRQP_SET = 0x8008700c RTC_PARAM_GET = 0x80187013 RTC_PARAM_SET = 0x80187014 RTC_PIE_OFF = 0x20007006 RTC_PIE_ON = 0x20007005 RTC_PLL_GET = 0x40207011 RTC_PLL_SET = 0x80207012 RTC_RD_TIME = 0x40247009 RTC_SET_TIME = 0x8024700a RTC_UIE_OFF = 0x20007004 RTC_UIE_ON = 0x20007003 RTC_VL_CLR = 0x20007014 RTC_VL_READ = 0x40047013 RTC_WIE_OFF = 0x20007010 RTC_WIE_ON = 0x2000700f RTC_WKALM_RD = 0x40287010 RTC_WKALM_SET = 0x8028700f SCM_DEVMEM_DMABUF = 0x4f SCM_DEVMEM_LINEAR = 0x4e SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a SCM_TIMESTAMPNS = 0x23 SCM_TS_OPT_ID = 0x51 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 SECCOMP_IOCTL_NOTIF_ADDFD = 0x80182103 SECCOMP_IOCTL_NOTIF_ID_VALID = 0x80082102 SECCOMP_IOCTL_NOTIF_SET_FLAGS = 0x80082104 SFD_CLOEXEC = 0x80000 SFD_NONBLOCK = 0x800 SIOCATMARK = 0x8905 SIOCGPGRP = 0x8904 SIOCGSTAMPNS_NEW = 0x40108907 SIOCGSTAMP_NEW = 0x40108906 SIOCINQ = 0x4004667f SIOCOUTQ = 0x40047473 SIOCSPGRP = 0x8902 SOCK_CLOEXEC = 0x80000 SOCK_DGRAM = 0x2 SOCK_NONBLOCK = 0x800 SOCK_STREAM = 0x1 SOL_SOCKET = 0x1 SO_ACCEPTCONN = 0x1e SO_ATTACH_BPF = 0x32 SO_ATTACH_REUSEPORT_CBPF = 0x33 SO_ATTACH_REUSEPORT_EBPF = 0x34 SO_BINDTODEVICE = 0x19 SO_BINDTOIFINDEX = 0x3e SO_BPF_EXTENSIONS = 0x30 SO_BROADCAST = 0x6 SO_BSDCOMPAT = 0xe SO_BUF_LOCK = 0x48 SO_BUSY_POLL = 0x2e SO_BUSY_POLL_BUDGET = 0x46 SO_CNX_ADVICE = 0x35 SO_COOKIE = 0x39 SO_DETACH_REUSEPORT_BPF = 0x44 SO_DEVMEM_DMABUF = 0x4f SO_DEVMEM_DONTNEED = 0x50 SO_DEVMEM_LINEAR = 0x4e SO_DOMAIN = 0x27 SO_DONTROUTE = 0x5 SO_ERROR = 0x4 SO_INCOMING_CPU = 0x31 SO_INCOMING_NAPI_ID = 0x38 SO_KEEPALIVE = 0x9 SO_LINGER = 0xd SO_LOCK_FILTER = 0x2c SO_MARK = 0x24 SO_MAX_PACING_RATE = 0x2f SO_MEMINFO = 0x37 SO_NETNS_COOKIE = 0x47 SO_NOFCS = 0x2b SO_OOBINLINE = 0xa SO_PASSCRED = 0x14 SO_PASSPIDFD = 0x4c SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x15 SO_PEERGROUPS = 0x3b SO_PEERPIDFD = 0x4d SO_PEERSEC = 0x1f SO_PREFER_BUSY_POLL = 0x45 SO_PROTOCOL = 0x26 SO_RCVBUF = 0x8 SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x10 SO_RCVMARK = 0x4b SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x12 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x12 SO_RESERVE_MEM = 0x49 SO_REUSEADDR = 0x2 SO_REUSEPORT = 0xf SO_RXQ_OVFL = 0x28 SO_SECURITY_AUTHENTICATION = 0x16 SO_SECURITY_ENCRYPTION_NETWORK = 0x18 SO_SECURITY_ENCRYPTION_TRANSPORT = 0x17 SO_SELECT_ERR_QUEUE = 0x2d SO_SNDBUF = 0x7 SO_SNDBUFFORCE = 0x20 SO_SNDLOWAT = 0x11 SO_SNDTIMEO = 0x13 SO_SNDTIMEO_NEW = 0x43 SO_SNDTIMEO_OLD = 0x13 SO_TIMESTAMPING = 0x25 SO_TIMESTAMPING_NEW = 0x41 SO_TIMESTAMPING_OLD = 0x25 SO_TIMESTAMPNS = 0x23 SO_TIMESTAMPNS_NEW = 0x40 SO_TIMESTAMPNS_OLD = 0x23 SO_TIMESTAMP_NEW = 0x3f SO_TXREHASH = 0x4a SO_TXTIME = 0x3d SO_TYPE = 0x3 SO_WIFI_STATUS = 0x29 SO_ZEROCOPY = 0x3c TAB1 = 0x400 TAB2 = 0x800 TAB3 = 0xc00 TABDLY = 0xc00 TCFLSH = 0x2000741f TCGETA = 0x40147417 TCGETS = 0x402c7413 TCSAFLUSH = 0x2 TCSBRK = 0x2000741d TCSBRKP = 0x5425 TCSETA = 0x80147418 TCSETAF = 0x8014741c TCSETAW = 0x80147419 TCSETS = 0x802c7414 TCSETSF = 0x802c7416 TCSETSW = 0x802c7415 TCXONC = 0x2000741e TFD_CLOEXEC = 0x80000 TFD_NONBLOCK = 0x800 TIOCCBRK = 0x5428 TIOCCONS = 0x541d TIOCEXCL = 0x540c TIOCGDEV = 0x40045432 TIOCGETC = 0x40067412 TIOCGETD = 0x5424 TIOCGETP = 0x40067408 TIOCGEXCL = 0x40045440 TIOCGICOUNT = 0x545d TIOCGISO7816 = 0x40285442 TIOCGLCKTRMIOS = 0x5456 TIOCGLTC = 0x40067474 TIOCGPGRP = 0x40047477 TIOCGPKT = 0x40045438 TIOCGPTLCK = 0x40045439 TIOCGPTN = 0x40045430 TIOCGPTPEER = 0x20005441 TIOCGRS485 = 0x542e TIOCGSERIAL = 0x541e TIOCGSID = 0x5429 TIOCGSOFTCAR = 0x5419 TIOCGWINSZ = 0x40087468 TIOCINQ = 0x4004667f TIOCLINUX = 0x541c TIOCMBIC = 0x5417 TIOCMBIS = 0x5416 TIOCMGET = 0x5415 TIOCMIWAIT = 0x545c TIOCMSET = 0x5418 TIOCM_CAR = 0x40 TIOCM_CD = 0x40 TIOCM_CTS = 0x20 TIOCM_DSR = 0x100 TIOCM_LOOP = 0x8000 TIOCM_OUT1 = 0x2000 TIOCM_OUT2 = 0x4000 TIOCM_RI = 0x80 TIOCM_RNG = 0x80 TIOCM_SR = 0x10 TIOCM_ST = 0x8 TIOCNOTTY = 0x5422 TIOCNXCL = 0x540d TIOCOUTQ = 0x40047473 TIOCPKT = 0x5420 TIOCSBRK = 0x5427 TIOCSCTTY = 0x540e TIOCSERCONFIG = 0x5453 TIOCSERGETLSR = 0x5459 TIOCSERGETMULTI = 0x545a TIOCSERGSTRUCT = 0x5458 TIOCSERGWILD = 0x5454 TIOCSERSETMULTI = 0x545b TIOCSERSWILD = 0x5455 TIOCSER_TEMT = 0x1 TIOCSETC = 0x80067411 TIOCSETD = 0x5423 TIOCSETN = 0x8006740a TIOCSETP = 0x80067409 TIOCSIG = 0x80045436 TIOCSISO7816 = 0xc0285443 TIOCSLCKTRMIOS = 0x5457 TIOCSLTC = 0x80067475 TIOCSPGRP = 0x80047476 TIOCSPTLCK = 0x80045431 TIOCSRS485 = 0x542f TIOCSSERIAL = 0x541f TIOCSSOFTCAR = 0x541a TIOCSTART = 0x2000746e TIOCSTI = 0x5412 TIOCSTOP = 0x2000746f TIOCSWINSZ = 0x80087467 TIOCVHANGUP = 0x5437 TOSTOP = 0x400000 TUNATTACHFILTER = 0x801054d5 TUNDETACHFILTER = 0x801054d6 TUNGETDEVNETNS = 0x200054e3 TUNGETFEATURES = 0x400454cf TUNGETFILTER = 0x401054db TUNGETIFF = 0x400454d2 TUNGETSNDBUF = 0x400454d3 TUNGETVNETBE = 0x400454df TUNGETVNETHDRSZ = 0x400454d7 TUNGETVNETLE = 0x400454dd TUNSETCARRIER = 0x800454e2 TUNSETDEBUG = 0x800454c9 TUNSETFILTEREBPF = 0x400454e1 TUNSETGROUP = 0x800454ce TUNSETIFF = 0x800454ca TUNSETIFINDEX = 0x800454da TUNSETLINK = 0x800454cd TUNSETNOCSUM = 0x800454c8 TUNSETOFFLOAD = 0x800454d0 TUNSETOWNER = 0x800454cc TUNSETPERSIST = 0x800454cb TUNSETQUEUE = 0x800454d9 TUNSETSNDBUF = 0x800454d4 TUNSETSTEERINGEBPF = 0x400454e0 TUNSETTXFILTER = 0x800454d1 TUNSETVNETBE = 0x800454de TUNSETVNETHDRSZ = 0x800454d8 TUNSETVNETLE = 0x800454dc UBI_IOCATT = 0x80186f40 UBI_IOCDET = 0x80046f41 UBI_IOCEBCH = 0x80044f02 UBI_IOCEBER = 0x80044f01 UBI_IOCEBISMAP = 0x40044f05 UBI_IOCEBMAP = 0x80084f03 UBI_IOCEBUNMAP = 0x80044f04 UBI_IOCMKVOL = 0x80986f00 UBI_IOCRMVOL = 0x80046f01 UBI_IOCRNVOL = 0x91106f03 UBI_IOCRPEB = 0x80046f04 UBI_IOCRSVOL = 0x800c6f02 UBI_IOCSETVOLPROP = 0x80104f06 UBI_IOCSPEB = 0x80046f05 UBI_IOCVOLCRBLK = 0x80804f07 UBI_IOCVOLRMBLK = 0x20004f08 UBI_IOCVOLUP = 0x80084f00 VDISCARD = 0x10 VEOF = 0x4 VEOL = 0x6 VEOL2 = 0x8 VMIN = 0x5 VREPRINT = 0xb VSTART = 0xd VSTOP = 0xe VSUSP = 0xc VSWTC = 0x9 VT1 = 0x10000 VTDLY = 0x10000 VTIME = 0x7 VWERASE = 0xa WDIOC_GETBOOTSTATUS = 0x40045702 WDIOC_GETPRETIMEOUT = 0x40045709 WDIOC_GETSTATUS = 0x40045701 WDIOC_GETSUPPORT = 0x40285700 WDIOC_GETTEMP = 0x40045703 WDIOC_GETTIMELEFT = 0x4004570a WDIOC_GETTIMEOUT = 0x40045707 WDIOC_KEEPALIVE = 0x40045705 WDIOC_SETOPTIONS = 0x40045704 WORDSIZE = 0x40 XCASE = 0x4000 XTABS = 0xc00 _HIDIOCGRAWNAME = 0x40804804 _HIDIOCGRAWPHYS = 0x40404805 _HIDIOCGRAWUNIQ = 0x40404808 ) // Errors const ( EADDRINUSE = syscall.Errno(0x62) EADDRNOTAVAIL = syscall.Errno(0x63) EADV = syscall.Errno(0x44) EAFNOSUPPORT = syscall.Errno(0x61) EALREADY = syscall.Errno(0x72) EBADE = syscall.Errno(0x34) EBADFD = syscall.Errno(0x4d) EBADMSG = syscall.Errno(0x4a) EBADR = syscall.Errno(0x35) EBADRQC = syscall.Errno(0x38) EBADSLT = syscall.Errno(0x39) EBFONT = syscall.Errno(0x3b) ECANCELED = syscall.Errno(0x7d) ECHRNG = syscall.Errno(0x2c) ECOMM = syscall.Errno(0x46) ECONNABORTED = syscall.Errno(0x67) ECONNREFUSED = syscall.Errno(0x6f) ECONNRESET = syscall.Errno(0x68) EDEADLK = syscall.Errno(0x23) EDEADLOCK = syscall.Errno(0x3a) EDESTADDRREQ = syscall.Errno(0x59) EDOTDOT = syscall.Errno(0x49) EDQUOT = syscall.Errno(0x7a) EHOSTDOWN = syscall.Errno(0x70) EHOSTUNREACH = syscall.Errno(0x71) EHWPOISON = syscall.Errno(0x85) EIDRM = syscall.Errno(0x2b) EILSEQ = syscall.Errno(0x54) EINPROGRESS = syscall.Errno(0x73) EISCONN = syscall.Errno(0x6a) EISNAM = syscall.Errno(0x78) EKEYEXPIRED = syscall.Errno(0x7f) EKEYREJECTED = syscall.Errno(0x81) EKEYREVOKED = syscall.Errno(0x80) EL2HLT = syscall.Errno(0x33) EL2NSYNC = syscall.Errno(0x2d) EL3HLT = syscall.Errno(0x2e) EL3RST = syscall.Errno(0x2f) ELIBACC = syscall.Errno(0x4f) ELIBBAD = syscall.Errno(0x50) ELIBEXEC = syscall.Errno(0x53) ELIBMAX = syscall.Errno(0x52) ELIBSCN = syscall.Errno(0x51) ELNRNG = syscall.Errno(0x30) ELOOP = syscall.Errno(0x28) EMEDIUMTYPE = syscall.Errno(0x7c) EMSGSIZE = syscall.Errno(0x5a) EMULTIHOP = syscall.Errno(0x48) ENAMETOOLONG = syscall.Errno(0x24) ENAVAIL = syscall.Errno(0x77) ENETDOWN = syscall.Errno(0x64) ENETRESET = syscall.Errno(0x66) ENETUNREACH = syscall.Errno(0x65) ENOANO = syscall.Errno(0x37) ENOBUFS = syscall.Errno(0x69) ENOCSI = syscall.Errno(0x32) ENODATA = syscall.Errno(0x3d) ENOKEY = syscall.Errno(0x7e) ENOLCK = syscall.Errno(0x25) ENOLINK = syscall.Errno(0x43) ENOMEDIUM = syscall.Errno(0x7b) ENOMSG = syscall.Errno(0x2a) ENONET = syscall.Errno(0x40) ENOPKG = syscall.Errno(0x41) ENOPROTOOPT = syscall.Errno(0x5c) ENOSR = syscall.Errno(0x3f) ENOSTR = syscall.Errno(0x3c) ENOSYS = syscall.Errno(0x26) ENOTCONN = syscall.Errno(0x6b) ENOTEMPTY = syscall.Errno(0x27) ENOTNAM = syscall.Errno(0x76) ENOTRECOVERABLE = syscall.Errno(0x83) ENOTSOCK = syscall.Errno(0x58) ENOTSUP = syscall.Errno(0x5f) ENOTUNIQ = syscall.Errno(0x4c) EOPNOTSUPP = syscall.Errno(0x5f) EOVERFLOW = syscall.Errno(0x4b) EOWNERDEAD = syscall.Errno(0x82) EPFNOSUPPORT = syscall.Errno(0x60) EPROTO = syscall.Errno(0x47) EPROTONOSUPPORT = syscall.Errno(0x5d) EPROTOTYPE = syscall.Errno(0x5b) EREMCHG = syscall.Errno(0x4e) EREMOTE = syscall.Errno(0x42) EREMOTEIO = syscall.Errno(0x79) ERESTART = syscall.Errno(0x55) ERFKILL = syscall.Errno(0x84) ESHUTDOWN = syscall.Errno(0x6c) ESOCKTNOSUPPORT = syscall.Errno(0x5e) ESRMNT = syscall.Errno(0x45) ESTALE = syscall.Errno(0x74) ESTRPIPE = syscall.Errno(0x56) ETIME = syscall.Errno(0x3e) ETIMEDOUT = syscall.Errno(0x6e) ETOOMANYREFS = syscall.Errno(0x6d) EUCLEAN = syscall.Errno(0x75) EUNATCH = syscall.Errno(0x31) EUSERS = syscall.Errno(0x57) EXFULL = syscall.Errno(0x36) ) // Signals const ( SIGBUS = syscall.Signal(0x7) SIGCHLD = syscall.Signal(0x11) SIGCLD = syscall.Signal(0x11) SIGCONT = syscall.Signal(0x12) SIGIO = syscall.Signal(0x1d) SIGPOLL = syscall.Signal(0x1d) SIGPROF = syscall.Signal(0x1b) SIGPWR = syscall.Signal(0x1e) SIGSTKFLT = syscall.Signal(0x10) SIGSTOP = syscall.Signal(0x13) SIGSYS = syscall.Signal(0x1f) SIGTSTP = syscall.Signal(0x14) SIGTTIN = syscall.Signal(0x15) SIGTTOU = syscall.Signal(0x16) SIGURG = syscall.Signal(0x17) SIGUSR1 = syscall.Signal(0xa) SIGUSR2 = syscall.Signal(0xc) SIGVTALRM = syscall.Signal(0x1a) SIGWINCH = syscall.Signal(0x1c) SIGXCPU = syscall.Signal(0x18) SIGXFSZ = syscall.Signal(0x19) ) // Error table var errorList = [...]struct { num syscall.Errno name string desc string }{ {1, "EPERM", "operation not permitted"}, {2, "ENOENT", "no such file or directory"}, {3, "ESRCH", "no such process"}, {4, "EINTR", "interrupted system call"}, {5, "EIO", "input/output error"}, {6, "ENXIO", "no such device or address"}, {7, "E2BIG", "argument list too long"}, {8, "ENOEXEC", "exec format error"}, {9, "EBADF", "bad file descriptor"}, {10, "ECHILD", "no child processes"}, {11, "EAGAIN", "resource temporarily unavailable"}, {12, "ENOMEM", "cannot allocate memory"}, {13, "EACCES", "permission denied"}, {14, "EFAULT", "bad address"}, {15, "ENOTBLK", "block device required"}, {16, "EBUSY", "device or resource busy"}, {17, "EEXIST", "file exists"}, {18, "EXDEV", "invalid cross-device link"}, {19, "ENODEV", "no such device"}, {20, "ENOTDIR", "not a directory"}, {21, "EISDIR", "is a directory"}, {22, "EINVAL", "invalid argument"}, {23, "ENFILE", "too many open files in system"}, {24, "EMFILE", "too many open files"}, {25, "ENOTTY", "inappropriate ioctl for device"}, {26, "ETXTBSY", "text file busy"}, {27, "EFBIG", "file too large"}, {28, "ENOSPC", "no space left on device"}, {29, "ESPIPE", "illegal seek"}, {30, "EROFS", "read-only file system"}, {31, "EMLINK", "too many links"}, {32, "EPIPE", "broken pipe"}, {33, "EDOM", "numerical argument out of domain"}, {34, "ERANGE", "numerical result out of range"}, {35, "EDEADLK", "resource deadlock avoided"}, {36, "ENAMETOOLONG", "file name too long"}, {37, "ENOLCK", "no locks available"}, {38, "ENOSYS", "function not implemented"}, {39, "ENOTEMPTY", "directory not empty"}, {40, "ELOOP", "too many levels of symbolic links"}, {42, "ENOMSG", "no message of desired type"}, {43, "EIDRM", "identifier removed"}, {44, "ECHRNG", "channel number out of range"}, {45, "EL2NSYNC", "level 2 not synchronized"}, {46, "EL3HLT", "level 3 halted"}, {47, "EL3RST", "level 3 reset"}, {48, "ELNRNG", "link number out of range"}, {49, "EUNATCH", "protocol driver not attached"}, {50, "ENOCSI", "no CSI structure available"}, {51, "EL2HLT", "level 2 halted"}, {52, "EBADE", "invalid exchange"}, {53, "EBADR", "invalid request descriptor"}, {54, "EXFULL", "exchange full"}, {55, "ENOANO", "no anode"}, {56, "EBADRQC", "invalid request code"}, {57, "EBADSLT", "invalid slot"}, {58, "EDEADLOCK", "file locking deadlock error"}, {59, "EBFONT", "bad font file format"}, {60, "ENOSTR", "device not a stream"}, {61, "ENODATA", "no data available"}, {62, "ETIME", "timer expired"}, {63, "ENOSR", "out of streams resources"}, {64, "ENONET", "machine is not on the network"}, {65, "ENOPKG", "package not installed"}, {66, "EREMOTE", "object is remote"}, {67, "ENOLINK", "link has been severed"}, {68, "EADV", "advertise error"}, {69, "ESRMNT", "srmount error"}, {70, "ECOMM", "communication error on send"}, {71, "EPROTO", "protocol error"}, {72, "EMULTIHOP", "multihop attempted"}, {73, "EDOTDOT", "RFS specific error"}, {74, "EBADMSG", "bad message"}, {75, "EOVERFLOW", "value too large for defined data type"}, {76, "ENOTUNIQ", "name not unique on network"}, {77, "EBADFD", "file descriptor in bad state"}, {78, "EREMCHG", "remote address changed"}, {79, "ELIBACC", "can not access a needed shared library"}, {80, "ELIBBAD", "accessing a corrupted shared library"}, {81, "ELIBSCN", ".lib section in a.out corrupted"}, {82, "ELIBMAX", "attempting to link in too many shared libraries"}, {83, "ELIBEXEC", "cannot exec a shared library directly"}, {84, "EILSEQ", "invalid or incomplete multibyte or wide character"}, {85, "ERESTART", "interrupted system call should be restarted"}, {86, "ESTRPIPE", "streams pipe error"}, {87, "EUSERS", "too many users"}, {88, "ENOTSOCK", "socket operation on non-socket"}, {89, "EDESTADDRREQ", "destination address required"}, {90, "EMSGSIZE", "message too long"}, {91, "EPROTOTYPE", "protocol wrong type for socket"}, {92, "ENOPROTOOPT", "protocol not available"}, {93, "EPROTONOSUPPORT", "protocol not supported"}, {94, "ESOCKTNOSUPPORT", "socket type not supported"}, {95, "ENOTSUP", "operation not supported"}, {96, "EPFNOSUPPORT", "protocol family not supported"}, {97, "EAFNOSUPPORT", "address family not supported by protocol"}, {98, "EADDRINUSE", "address already in use"}, {99, "EADDRNOTAVAIL", "cannot assign requested address"}, {100, "ENETDOWN", "network is down"}, {101, "ENETUNREACH", "network is unreachable"}, {102, "ENETRESET", "network dropped connection on reset"}, {103, "ECONNABORTED", "software caused connection abort"}, {104, "ECONNRESET", "connection reset by peer"}, {105, "ENOBUFS", "no buffer space available"}, {106, "EISCONN", "transport endpoint is already connected"}, {107, "ENOTCONN", "transport endpoint is not connected"}, {108, "ESHUTDOWN", "cannot send after transport endpoint shutdown"}, {109, "ETOOMANYREFS", "too many references: cannot splice"}, {110, "ETIMEDOUT", "connection timed out"}, {111, "ECONNREFUSED", "connection refused"}, {112, "EHOSTDOWN", "host is down"}, {113, "EHOSTUNREACH", "no route to host"}, {114, "EALREADY", "operation already in progress"}, {115, "EINPROGRESS", "operation now in progress"}, {116, "ESTALE", "stale file handle"}, {117, "EUCLEAN", "structure needs cleaning"}, {118, "ENOTNAM", "not a XENIX named type file"}, {119, "ENAVAIL", "no XENIX semaphores available"}, {120, "EISNAM", "is a named type file"}, {121, "EREMOTEIO", "remote I/O error"}, {122, "EDQUOT", "disk quota exceeded"}, {123, "ENOMEDIUM", "no medium found"}, {124, "EMEDIUMTYPE", "wrong medium type"}, {125, "ECANCELED", "operation canceled"}, {126, "ENOKEY", "required key not available"}, {127, "EKEYEXPIRED", "key has expired"}, {128, "EKEYREVOKED", "key has been revoked"}, {129, "EKEYREJECTED", "key was rejected by service"}, {130, "EOWNERDEAD", "owner died"}, {131, "ENOTRECOVERABLE", "state not recoverable"}, {132, "ERFKILL", "operation not possible due to RF-kill"}, {133, "EHWPOISON", "memory page has hardware error"}, } // Signal table var signalList = [...]struct { num syscall.Signal name string desc string }{ {1, "SIGHUP", "hangup"}, {2, "SIGINT", "interrupt"}, {3, "SIGQUIT", "quit"}, {4, "SIGILL", "illegal instruction"}, {5, "SIGTRAP", "trace/breakpoint trap"}, {6, "SIGABRT", "aborted"}, {7, "SIGBUS", "bus error"}, {8, "SIGFPE", "floating point exception"}, {9, "SIGKILL", "killed"}, {10, "SIGUSR1", "user defined signal 1"}, {11, "SIGSEGV", "segmentation fault"}, {12, "SIGUSR2", "user defined signal 2"}, {13, "SIGPIPE", "broken pipe"}, {14, "SIGALRM", "alarm clock"}, {15, "SIGTERM", "terminated"}, {16, "SIGSTKFLT", "stack fault"}, {17, "SIGCHLD", "child exited"}, {18, "SIGCONT", "continued"}, {19, "SIGSTOP", "stopped (signal)"}, {20, "SIGTSTP", "stopped"}, {21, "SIGTTIN", "stopped (tty input)"}, {22, "SIGTTOU", "stopped (tty output)"}, {23, "SIGURG", "urgent I/O condition"}, {24, "SIGXCPU", "CPU time limit exceeded"}, {25, "SIGXFSZ", "file size limit exceeded"}, {26, "SIGVTALRM", "virtual timer expired"}, {27, "SIGPROF", "profiling timer expired"}, {28, "SIGWINCH", "window changed"}, {29, "SIGIO", "I/O possible"}, {30, "SIGPWR", "power failure"}, {31, "SIGSYS", "bad system call"}, } ================================================ FILE: vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go ================================================ // mkerrors.sh -Wall -Werror -static -I/tmp/ppc64le/include // Code generated by the command above; see README.md. DO NOT EDIT. //go:build ppc64le && linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -Wall -Werror -static -I/tmp/ppc64le/include _const.go package unix import "syscall" const ( B1000000 = 0x17 B115200 = 0x11 B1152000 = 0x18 B1500000 = 0x19 B2000000 = 0x1a B230400 = 0x12 B2500000 = 0x1b B3000000 = 0x1c B3500000 = 0x1d B4000000 = 0x1e B460800 = 0x13 B500000 = 0x14 B57600 = 0x10 B576000 = 0x15 B921600 = 0x16 BLKALIGNOFF = 0x2000127a BLKBSZGET = 0x40081270 BLKBSZSET = 0x80081271 BLKDISCARD = 0x20001277 BLKDISCARDZEROES = 0x2000127c BLKFLSBUF = 0x20001261 BLKFRAGET = 0x20001265 BLKFRASET = 0x20001264 BLKGETDISKSEQ = 0x40081280 BLKGETSIZE = 0x20001260 BLKGETSIZE64 = 0x40081272 BLKIOMIN = 0x20001278 BLKIOOPT = 0x20001279 BLKPBSZGET = 0x2000127b BLKRAGET = 0x20001263 BLKRASET = 0x20001262 BLKROGET = 0x2000125e BLKROSET = 0x2000125d BLKROTATIONAL = 0x2000127e BLKRRPART = 0x2000125f BLKSECDISCARD = 0x2000127d BLKSECTGET = 0x20001267 BLKSECTSET = 0x20001266 BLKSSZGET = 0x20001268 BLKZEROOUT = 0x2000127f BOTHER = 0x1f BS1 = 0x8000 BSDLY = 0x8000 CBAUD = 0xff CBAUDEX = 0x0 CIBAUD = 0xff0000 CLOCAL = 0x8000 CR1 = 0x1000 CR2 = 0x2000 CR3 = 0x3000 CRDLY = 0x3000 CREAD = 0x800 CS6 = 0x100 CS7 = 0x200 CS8 = 0x300 CSIZE = 0x300 CSTOPB = 0x400 DM_MPATH_PROBE_PATHS = 0x2000fd12 ECCGETLAYOUT = 0x41484d11 ECCGETSTATS = 0x40104d12 ECHOCTL = 0x40 ECHOE = 0x2 ECHOK = 0x4 ECHOKE = 0x1 ECHONL = 0x10 ECHOPRT = 0x20 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 EPIOCGPARAMS = 0x40088a02 EPIOCSPARAMS = 0x80088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000000 FF1 = 0x4000 FFDLY = 0x4000 FICLONE = 0x80049409 FICLONERANGE = 0x8020940d FLUSHO = 0x800000 FS_IOC_ENABLE_VERITY = 0x80806685 FS_IOC_GETFLAGS = 0x40086601 FS_IOC_GET_ENCRYPTION_NONCE = 0x4010661b FS_IOC_GET_ENCRYPTION_POLICY = 0x800c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x80106614 FS_IOC_SETFLAGS = 0x80086602 FS_IOC_SET_ENCRYPTION_POLICY = 0x400c6613 F_GETLK = 0x5 F_GETLK64 = 0xc F_GETOWN = 0x9 F_RDLCK = 0x0 F_SETLK = 0x6 F_SETLK64 = 0xd F_SETLKW = 0x7 F_SETLKW64 = 0xe F_SETOWN = 0x8 F_UNLCK = 0x2 F_WRLCK = 0x1 HIDIOCGRAWINFO = 0x40084803 HIDIOCGRDESC = 0x50044802 HIDIOCGRDESCSIZE = 0x40044801 HIDIOCREVOKE = 0x8004480d HUPCL = 0x4000 ICANON = 0x100 IEXTEN = 0x400 IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x800 IOCTL_MEI_NOTIFY_GET = 0x40044803 IOCTL_MEI_NOTIFY_SET = 0x80044802 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x200007b9 IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_MASK = 0xffff0f00 ISIG = 0x80 IUCLC = 0x1000 IXOFF = 0x400 IXON = 0x200 MAP_ANON = 0x20 MAP_ANONYMOUS = 0x20 MAP_DENYWRITE = 0x800 MAP_EXECUTABLE = 0x1000 MAP_GROWSDOWN = 0x100 MAP_HUGETLB = 0x40000 MAP_LOCKED = 0x80 MAP_NONBLOCK = 0x10000 MAP_NORESERVE = 0x40 MAP_POPULATE = 0x8000 MAP_STACK = 0x20000 MAP_SYNC = 0x80000 MCL_CURRENT = 0x2000 MCL_FUTURE = 0x4000 MCL_ONFAULT = 0x8000 MEMERASE = 0x80084d02 MEMERASE64 = 0x80104d14 MEMGETBADBLOCK = 0x80084d0b MEMGETINFO = 0x40204d01 MEMGETOOBSEL = 0x40c84d0a MEMGETREGIONCOUNT = 0x40044d07 MEMISLOCKED = 0x40084d17 MEMLOCK = 0x80084d05 MEMREAD = 0xc0404d1a MEMREADOOB = 0xc0104d04 MEMSETBADBLOCK = 0x80084d0c MEMUNLOCK = 0x80084d06 MEMWRITEOOB = 0xc0104d03 MTDFILEMODE = 0x20004d13 NFDBITS = 0x40 NL2 = 0x200 NL3 = 0x300 NLDLY = 0x300 NOFLSH = 0x80000000 NS_GET_MNTNS_ID = 0x4008b705 NS_GET_NSTYPE = 0x2000b703 NS_GET_OWNER_UID = 0x2000b704 NS_GET_PARENT = 0x2000b702 NS_GET_PID_FROM_PIDNS = 0x4004b706 NS_GET_PID_IN_PIDNS = 0x4004b708 NS_GET_TGID_FROM_PIDNS = 0x4004b707 NS_GET_TGID_IN_PIDNS = 0x4004b709 NS_GET_USERNS = 0x2000b701 OLCUC = 0x4 ONLCR = 0x2 OTPERASE = 0x800c4d19 OTPGETREGIONCOUNT = 0x80044d0e OTPGETREGIONINFO = 0x800c4d0f OTPLOCK = 0x400c4d10 OTPSELECT = 0x40044d0d O_APPEND = 0x400 O_ASYNC = 0x2000 O_CLOEXEC = 0x80000 O_CREAT = 0x40 O_DIRECT = 0x20000 O_DIRECTORY = 0x4000 O_DSYNC = 0x1000 O_EXCL = 0x80 O_FSYNC = 0x101000 O_LARGEFILE = 0x0 O_NDELAY = 0x800 O_NOATIME = 0x40000 O_NOCTTY = 0x100 O_NOFOLLOW = 0x8000 O_NONBLOCK = 0x800 O_PATH = 0x200000 O_RSYNC = 0x101000 O_SYNC = 0x101000 O_TMPFILE = 0x404000 O_TRUNC = 0x200 PARENB = 0x1000 PARODD = 0x2000 PENDIN = 0x20000000 PERF_EVENT_IOC_DISABLE = 0x20002401 PERF_EVENT_IOC_ENABLE = 0x20002400 PERF_EVENT_IOC_ID = 0x40082407 PERF_EVENT_IOC_MODIFY_ATTRIBUTES = 0x8008240b PERF_EVENT_IOC_PAUSE_OUTPUT = 0x80042409 PERF_EVENT_IOC_PERIOD = 0x80082404 PERF_EVENT_IOC_QUERY_BPF = 0xc008240a PERF_EVENT_IOC_REFRESH = 0x20002402 PERF_EVENT_IOC_RESET = 0x20002403 PERF_EVENT_IOC_SET_BPF = 0x80042408 PERF_EVENT_IOC_SET_FILTER = 0x80082406 PERF_EVENT_IOC_SET_OUTPUT = 0x20002405 PPPIOCATTACH = 0x8004743d PPPIOCATTCHAN = 0x80047438 PPPIOCBRIDGECHAN = 0x80047435 PPPIOCCONNECT = 0x8004743a PPPIOCDETACH = 0x8004743c PPPIOCDISCONN = 0x20007439 PPPIOCGASYNCMAP = 0x40047458 PPPIOCGCHAN = 0x40047437 PPPIOCGDEBUG = 0x40047441 PPPIOCGFLAGS = 0x4004745a PPPIOCGIDLE = 0x4010743f PPPIOCGIDLE32 = 0x4008743f PPPIOCGIDLE64 = 0x4010743f PPPIOCGL2TPSTATS = 0x40487436 PPPIOCGMRU = 0x40047453 PPPIOCGRASYNCMAP = 0x40047455 PPPIOCGUNIT = 0x40047456 PPPIOCGXASYNCMAP = 0x40207450 PPPIOCSACTIVE = 0x80107446 PPPIOCSASYNCMAP = 0x80047457 PPPIOCSCOMPRESS = 0x8010744d PPPIOCSDEBUG = 0x80047440 PPPIOCSFLAGS = 0x80047459 PPPIOCSMAXCID = 0x80047451 PPPIOCSMRRU = 0x8004743b PPPIOCSMRU = 0x80047452 PPPIOCSNPMODE = 0x8008744b PPPIOCSPASS = 0x80107447 PPPIOCSRASYNCMAP = 0x80047454 PPPIOCSXASYNCMAP = 0x8020744f PPPIOCUNBRIDGECHAN = 0x20007434 PPPIOCXFERUNIT = 0x2000744e PROT_SAO = 0x10 PR_SET_PTRACER_ANY = 0xffffffffffffffff PTP_CLOCK_GETCAPS = 0x40503d01 PTP_CLOCK_GETCAPS2 = 0x40503d0a PTP_ENABLE_PPS = 0x80043d04 PTP_ENABLE_PPS2 = 0x80043d0d PTP_EXTTS_REQUEST = 0x80103d02 PTP_EXTTS_REQUEST2 = 0x80103d0b PTP_MASK_CLEAR_ALL = 0x20003d13 PTP_MASK_EN_SINGLE = 0x80043d14 PTP_PEROUT_REQUEST = 0x80383d03 PTP_PEROUT_REQUEST2 = 0x80383d0c PTP_PIN_SETFUNC = 0x80603d07 PTP_PIN_SETFUNC2 = 0x80603d10 PTP_SYS_OFFSET = 0x83403d05 PTP_SYS_OFFSET2 = 0x83403d0e PTRACE_GETEVRREGS = 0x14 PTRACE_GETFPREGS = 0xe PTRACE_GETREGS64 = 0x16 PTRACE_GETVRREGS = 0x12 PTRACE_GETVSRREGS = 0x1b PTRACE_GET_DEBUGREG = 0x19 PTRACE_SETEVRREGS = 0x15 PTRACE_SETFPREGS = 0xf PTRACE_SETREGS64 = 0x17 PTRACE_SETVRREGS = 0x13 PTRACE_SETVSRREGS = 0x1c PTRACE_SET_DEBUGREG = 0x1a PTRACE_SINGLEBLOCK = 0x100 PTRACE_SYSEMU = 0x1d PTRACE_SYSEMU_SINGLESTEP = 0x1e PT_CCR = 0x26 PT_CTR = 0x23 PT_DAR = 0x29 PT_DSCR = 0x2c PT_DSISR = 0x2a PT_FPR0 = 0x30 PT_FPSCR = 0x50 PT_LNK = 0x24 PT_MSR = 0x21 PT_NIP = 0x20 PT_ORIG_R3 = 0x22 PT_R0 = 0x0 PT_R1 = 0x1 PT_R10 = 0xa PT_R11 = 0xb PT_R12 = 0xc PT_R13 = 0xd PT_R14 = 0xe PT_R15 = 0xf PT_R16 = 0x10 PT_R17 = 0x11 PT_R18 = 0x12 PT_R19 = 0x13 PT_R2 = 0x2 PT_R20 = 0x14 PT_R21 = 0x15 PT_R22 = 0x16 PT_R23 = 0x17 PT_R24 = 0x18 PT_R25 = 0x19 PT_R26 = 0x1a PT_R27 = 0x1b PT_R28 = 0x1c PT_R29 = 0x1d PT_R3 = 0x3 PT_R30 = 0x1e PT_R31 = 0x1f PT_R4 = 0x4 PT_R5 = 0x5 PT_R6 = 0x6 PT_R7 = 0x7 PT_R8 = 0x8 PT_R9 = 0x9 PT_REGS_COUNT = 0x2c PT_RESULT = 0x2b PT_SOFTE = 0x27 PT_TRAP = 0x28 PT_VR0 = 0x52 PT_VRSAVE = 0x94 PT_VSCR = 0x93 PT_VSR0 = 0x96 PT_VSR31 = 0xd4 PT_XER = 0x25 RLIMIT_AS = 0x9 RLIMIT_MEMLOCK = 0x8 RLIMIT_NOFILE = 0x7 RLIMIT_NPROC = 0x6 RLIMIT_RSS = 0x5 RNDADDENTROPY = 0x80085203 RNDADDTOENTCNT = 0x80045201 RNDCLEARPOOL = 0x20005206 RNDGETENTCNT = 0x40045200 RNDGETPOOL = 0x40085202 RNDRESEEDCRNG = 0x20005207 RNDZAPENTCNT = 0x20005204 RTC_AIE_OFF = 0x20007002 RTC_AIE_ON = 0x20007001 RTC_ALM_READ = 0x40247008 RTC_ALM_SET = 0x80247007 RTC_EPOCH_READ = 0x4008700d RTC_EPOCH_SET = 0x8008700e RTC_IRQP_READ = 0x4008700b RTC_IRQP_SET = 0x8008700c RTC_PARAM_GET = 0x80187013 RTC_PARAM_SET = 0x80187014 RTC_PIE_OFF = 0x20007006 RTC_PIE_ON = 0x20007005 RTC_PLL_GET = 0x40207011 RTC_PLL_SET = 0x80207012 RTC_RD_TIME = 0x40247009 RTC_SET_TIME = 0x8024700a RTC_UIE_OFF = 0x20007004 RTC_UIE_ON = 0x20007003 RTC_VL_CLR = 0x20007014 RTC_VL_READ = 0x40047013 RTC_WIE_OFF = 0x20007010 RTC_WIE_ON = 0x2000700f RTC_WKALM_RD = 0x40287010 RTC_WKALM_SET = 0x8028700f SCM_DEVMEM_DMABUF = 0x4f SCM_DEVMEM_LINEAR = 0x4e SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a SCM_TIMESTAMPNS = 0x23 SCM_TS_OPT_ID = 0x51 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 SECCOMP_IOCTL_NOTIF_ADDFD = 0x80182103 SECCOMP_IOCTL_NOTIF_ID_VALID = 0x80082102 SECCOMP_IOCTL_NOTIF_SET_FLAGS = 0x80082104 SFD_CLOEXEC = 0x80000 SFD_NONBLOCK = 0x800 SIOCATMARK = 0x8905 SIOCGPGRP = 0x8904 SIOCGSTAMPNS_NEW = 0x40108907 SIOCGSTAMP_NEW = 0x40108906 SIOCINQ = 0x4004667f SIOCOUTQ = 0x40047473 SIOCSPGRP = 0x8902 SOCK_CLOEXEC = 0x80000 SOCK_DGRAM = 0x2 SOCK_NONBLOCK = 0x800 SOCK_STREAM = 0x1 SOL_SOCKET = 0x1 SO_ACCEPTCONN = 0x1e SO_ATTACH_BPF = 0x32 SO_ATTACH_REUSEPORT_CBPF = 0x33 SO_ATTACH_REUSEPORT_EBPF = 0x34 SO_BINDTODEVICE = 0x19 SO_BINDTOIFINDEX = 0x3e SO_BPF_EXTENSIONS = 0x30 SO_BROADCAST = 0x6 SO_BSDCOMPAT = 0xe SO_BUF_LOCK = 0x48 SO_BUSY_POLL = 0x2e SO_BUSY_POLL_BUDGET = 0x46 SO_CNX_ADVICE = 0x35 SO_COOKIE = 0x39 SO_DETACH_REUSEPORT_BPF = 0x44 SO_DEVMEM_DMABUF = 0x4f SO_DEVMEM_DONTNEED = 0x50 SO_DEVMEM_LINEAR = 0x4e SO_DOMAIN = 0x27 SO_DONTROUTE = 0x5 SO_ERROR = 0x4 SO_INCOMING_CPU = 0x31 SO_INCOMING_NAPI_ID = 0x38 SO_KEEPALIVE = 0x9 SO_LINGER = 0xd SO_LOCK_FILTER = 0x2c SO_MARK = 0x24 SO_MAX_PACING_RATE = 0x2f SO_MEMINFO = 0x37 SO_NETNS_COOKIE = 0x47 SO_NOFCS = 0x2b SO_OOBINLINE = 0xa SO_PASSCRED = 0x14 SO_PASSPIDFD = 0x4c SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x15 SO_PEERGROUPS = 0x3b SO_PEERPIDFD = 0x4d SO_PEERSEC = 0x1f SO_PREFER_BUSY_POLL = 0x45 SO_PROTOCOL = 0x26 SO_RCVBUF = 0x8 SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x10 SO_RCVMARK = 0x4b SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x12 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x12 SO_RESERVE_MEM = 0x49 SO_REUSEADDR = 0x2 SO_REUSEPORT = 0xf SO_RXQ_OVFL = 0x28 SO_SECURITY_AUTHENTICATION = 0x16 SO_SECURITY_ENCRYPTION_NETWORK = 0x18 SO_SECURITY_ENCRYPTION_TRANSPORT = 0x17 SO_SELECT_ERR_QUEUE = 0x2d SO_SNDBUF = 0x7 SO_SNDBUFFORCE = 0x20 SO_SNDLOWAT = 0x11 SO_SNDTIMEO = 0x13 SO_SNDTIMEO_NEW = 0x43 SO_SNDTIMEO_OLD = 0x13 SO_TIMESTAMPING = 0x25 SO_TIMESTAMPING_NEW = 0x41 SO_TIMESTAMPING_OLD = 0x25 SO_TIMESTAMPNS = 0x23 SO_TIMESTAMPNS_NEW = 0x40 SO_TIMESTAMPNS_OLD = 0x23 SO_TIMESTAMP_NEW = 0x3f SO_TXREHASH = 0x4a SO_TXTIME = 0x3d SO_TYPE = 0x3 SO_WIFI_STATUS = 0x29 SO_ZEROCOPY = 0x3c TAB1 = 0x400 TAB2 = 0x800 TAB3 = 0xc00 TABDLY = 0xc00 TCFLSH = 0x2000741f TCGETA = 0x40147417 TCGETS = 0x402c7413 TCSAFLUSH = 0x2 TCSBRK = 0x2000741d TCSBRKP = 0x5425 TCSETA = 0x80147418 TCSETAF = 0x8014741c TCSETAW = 0x80147419 TCSETS = 0x802c7414 TCSETSF = 0x802c7416 TCSETSW = 0x802c7415 TCXONC = 0x2000741e TFD_CLOEXEC = 0x80000 TFD_NONBLOCK = 0x800 TIOCCBRK = 0x5428 TIOCCONS = 0x541d TIOCEXCL = 0x540c TIOCGDEV = 0x40045432 TIOCGETC = 0x40067412 TIOCGETD = 0x5424 TIOCGETP = 0x40067408 TIOCGEXCL = 0x40045440 TIOCGICOUNT = 0x545d TIOCGISO7816 = 0x40285442 TIOCGLCKTRMIOS = 0x5456 TIOCGLTC = 0x40067474 TIOCGPGRP = 0x40047477 TIOCGPKT = 0x40045438 TIOCGPTLCK = 0x40045439 TIOCGPTN = 0x40045430 TIOCGPTPEER = 0x20005441 TIOCGRS485 = 0x542e TIOCGSERIAL = 0x541e TIOCGSID = 0x5429 TIOCGSOFTCAR = 0x5419 TIOCGWINSZ = 0x40087468 TIOCINQ = 0x4004667f TIOCLINUX = 0x541c TIOCMBIC = 0x5417 TIOCMBIS = 0x5416 TIOCMGET = 0x5415 TIOCMIWAIT = 0x545c TIOCMSET = 0x5418 TIOCM_CAR = 0x40 TIOCM_CD = 0x40 TIOCM_CTS = 0x20 TIOCM_DSR = 0x100 TIOCM_LOOP = 0x8000 TIOCM_OUT1 = 0x2000 TIOCM_OUT2 = 0x4000 TIOCM_RI = 0x80 TIOCM_RNG = 0x80 TIOCM_SR = 0x10 TIOCM_ST = 0x8 TIOCNOTTY = 0x5422 TIOCNXCL = 0x540d TIOCOUTQ = 0x40047473 TIOCPKT = 0x5420 TIOCSBRK = 0x5427 TIOCSCTTY = 0x540e TIOCSERCONFIG = 0x5453 TIOCSERGETLSR = 0x5459 TIOCSERGETMULTI = 0x545a TIOCSERGSTRUCT = 0x5458 TIOCSERGWILD = 0x5454 TIOCSERSETMULTI = 0x545b TIOCSERSWILD = 0x5455 TIOCSER_TEMT = 0x1 TIOCSETC = 0x80067411 TIOCSETD = 0x5423 TIOCSETN = 0x8006740a TIOCSETP = 0x80067409 TIOCSIG = 0x80045436 TIOCSISO7816 = 0xc0285443 TIOCSLCKTRMIOS = 0x5457 TIOCSLTC = 0x80067475 TIOCSPGRP = 0x80047476 TIOCSPTLCK = 0x80045431 TIOCSRS485 = 0x542f TIOCSSERIAL = 0x541f TIOCSSOFTCAR = 0x541a TIOCSTART = 0x2000746e TIOCSTI = 0x5412 TIOCSTOP = 0x2000746f TIOCSWINSZ = 0x80087467 TIOCVHANGUP = 0x5437 TOSTOP = 0x400000 TUNATTACHFILTER = 0x801054d5 TUNDETACHFILTER = 0x801054d6 TUNGETDEVNETNS = 0x200054e3 TUNGETFEATURES = 0x400454cf TUNGETFILTER = 0x401054db TUNGETIFF = 0x400454d2 TUNGETSNDBUF = 0x400454d3 TUNGETVNETBE = 0x400454df TUNGETVNETHDRSZ = 0x400454d7 TUNGETVNETLE = 0x400454dd TUNSETCARRIER = 0x800454e2 TUNSETDEBUG = 0x800454c9 TUNSETFILTEREBPF = 0x400454e1 TUNSETGROUP = 0x800454ce TUNSETIFF = 0x800454ca TUNSETIFINDEX = 0x800454da TUNSETLINK = 0x800454cd TUNSETNOCSUM = 0x800454c8 TUNSETOFFLOAD = 0x800454d0 TUNSETOWNER = 0x800454cc TUNSETPERSIST = 0x800454cb TUNSETQUEUE = 0x800454d9 TUNSETSNDBUF = 0x800454d4 TUNSETSTEERINGEBPF = 0x400454e0 TUNSETTXFILTER = 0x800454d1 TUNSETVNETBE = 0x800454de TUNSETVNETHDRSZ = 0x800454d8 TUNSETVNETLE = 0x800454dc UBI_IOCATT = 0x80186f40 UBI_IOCDET = 0x80046f41 UBI_IOCEBCH = 0x80044f02 UBI_IOCEBER = 0x80044f01 UBI_IOCEBISMAP = 0x40044f05 UBI_IOCEBMAP = 0x80084f03 UBI_IOCEBUNMAP = 0x80044f04 UBI_IOCMKVOL = 0x80986f00 UBI_IOCRMVOL = 0x80046f01 UBI_IOCRNVOL = 0x91106f03 UBI_IOCRPEB = 0x80046f04 UBI_IOCRSVOL = 0x800c6f02 UBI_IOCSETVOLPROP = 0x80104f06 UBI_IOCSPEB = 0x80046f05 UBI_IOCVOLCRBLK = 0x80804f07 UBI_IOCVOLRMBLK = 0x20004f08 UBI_IOCVOLUP = 0x80084f00 VDISCARD = 0x10 VEOF = 0x4 VEOL = 0x6 VEOL2 = 0x8 VMIN = 0x5 VREPRINT = 0xb VSTART = 0xd VSTOP = 0xe VSUSP = 0xc VSWTC = 0x9 VT1 = 0x10000 VTDLY = 0x10000 VTIME = 0x7 VWERASE = 0xa WDIOC_GETBOOTSTATUS = 0x40045702 WDIOC_GETPRETIMEOUT = 0x40045709 WDIOC_GETSTATUS = 0x40045701 WDIOC_GETSUPPORT = 0x40285700 WDIOC_GETTEMP = 0x40045703 WDIOC_GETTIMELEFT = 0x4004570a WDIOC_GETTIMEOUT = 0x40045707 WDIOC_KEEPALIVE = 0x40045705 WDIOC_SETOPTIONS = 0x40045704 WORDSIZE = 0x40 XCASE = 0x4000 XTABS = 0xc00 _HIDIOCGRAWNAME = 0x40804804 _HIDIOCGRAWPHYS = 0x40404805 _HIDIOCGRAWUNIQ = 0x40404808 ) // Errors const ( EADDRINUSE = syscall.Errno(0x62) EADDRNOTAVAIL = syscall.Errno(0x63) EADV = syscall.Errno(0x44) EAFNOSUPPORT = syscall.Errno(0x61) EALREADY = syscall.Errno(0x72) EBADE = syscall.Errno(0x34) EBADFD = syscall.Errno(0x4d) EBADMSG = syscall.Errno(0x4a) EBADR = syscall.Errno(0x35) EBADRQC = syscall.Errno(0x38) EBADSLT = syscall.Errno(0x39) EBFONT = syscall.Errno(0x3b) ECANCELED = syscall.Errno(0x7d) ECHRNG = syscall.Errno(0x2c) ECOMM = syscall.Errno(0x46) ECONNABORTED = syscall.Errno(0x67) ECONNREFUSED = syscall.Errno(0x6f) ECONNRESET = syscall.Errno(0x68) EDEADLK = syscall.Errno(0x23) EDEADLOCK = syscall.Errno(0x3a) EDESTADDRREQ = syscall.Errno(0x59) EDOTDOT = syscall.Errno(0x49) EDQUOT = syscall.Errno(0x7a) EHOSTDOWN = syscall.Errno(0x70) EHOSTUNREACH = syscall.Errno(0x71) EHWPOISON = syscall.Errno(0x85) EIDRM = syscall.Errno(0x2b) EILSEQ = syscall.Errno(0x54) EINPROGRESS = syscall.Errno(0x73) EISCONN = syscall.Errno(0x6a) EISNAM = syscall.Errno(0x78) EKEYEXPIRED = syscall.Errno(0x7f) EKEYREJECTED = syscall.Errno(0x81) EKEYREVOKED = syscall.Errno(0x80) EL2HLT = syscall.Errno(0x33) EL2NSYNC = syscall.Errno(0x2d) EL3HLT = syscall.Errno(0x2e) EL3RST = syscall.Errno(0x2f) ELIBACC = syscall.Errno(0x4f) ELIBBAD = syscall.Errno(0x50) ELIBEXEC = syscall.Errno(0x53) ELIBMAX = syscall.Errno(0x52) ELIBSCN = syscall.Errno(0x51) ELNRNG = syscall.Errno(0x30) ELOOP = syscall.Errno(0x28) EMEDIUMTYPE = syscall.Errno(0x7c) EMSGSIZE = syscall.Errno(0x5a) EMULTIHOP = syscall.Errno(0x48) ENAMETOOLONG = syscall.Errno(0x24) ENAVAIL = syscall.Errno(0x77) ENETDOWN = syscall.Errno(0x64) ENETRESET = syscall.Errno(0x66) ENETUNREACH = syscall.Errno(0x65) ENOANO = syscall.Errno(0x37) ENOBUFS = syscall.Errno(0x69) ENOCSI = syscall.Errno(0x32) ENODATA = syscall.Errno(0x3d) ENOKEY = syscall.Errno(0x7e) ENOLCK = syscall.Errno(0x25) ENOLINK = syscall.Errno(0x43) ENOMEDIUM = syscall.Errno(0x7b) ENOMSG = syscall.Errno(0x2a) ENONET = syscall.Errno(0x40) ENOPKG = syscall.Errno(0x41) ENOPROTOOPT = syscall.Errno(0x5c) ENOSR = syscall.Errno(0x3f) ENOSTR = syscall.Errno(0x3c) ENOSYS = syscall.Errno(0x26) ENOTCONN = syscall.Errno(0x6b) ENOTEMPTY = syscall.Errno(0x27) ENOTNAM = syscall.Errno(0x76) ENOTRECOVERABLE = syscall.Errno(0x83) ENOTSOCK = syscall.Errno(0x58) ENOTSUP = syscall.Errno(0x5f) ENOTUNIQ = syscall.Errno(0x4c) EOPNOTSUPP = syscall.Errno(0x5f) EOVERFLOW = syscall.Errno(0x4b) EOWNERDEAD = syscall.Errno(0x82) EPFNOSUPPORT = syscall.Errno(0x60) EPROTO = syscall.Errno(0x47) EPROTONOSUPPORT = syscall.Errno(0x5d) EPROTOTYPE = syscall.Errno(0x5b) EREMCHG = syscall.Errno(0x4e) EREMOTE = syscall.Errno(0x42) EREMOTEIO = syscall.Errno(0x79) ERESTART = syscall.Errno(0x55) ERFKILL = syscall.Errno(0x84) ESHUTDOWN = syscall.Errno(0x6c) ESOCKTNOSUPPORT = syscall.Errno(0x5e) ESRMNT = syscall.Errno(0x45) ESTALE = syscall.Errno(0x74) ESTRPIPE = syscall.Errno(0x56) ETIME = syscall.Errno(0x3e) ETIMEDOUT = syscall.Errno(0x6e) ETOOMANYREFS = syscall.Errno(0x6d) EUCLEAN = syscall.Errno(0x75) EUNATCH = syscall.Errno(0x31) EUSERS = syscall.Errno(0x57) EXFULL = syscall.Errno(0x36) ) // Signals const ( SIGBUS = syscall.Signal(0x7) SIGCHLD = syscall.Signal(0x11) SIGCLD = syscall.Signal(0x11) SIGCONT = syscall.Signal(0x12) SIGIO = syscall.Signal(0x1d) SIGPOLL = syscall.Signal(0x1d) SIGPROF = syscall.Signal(0x1b) SIGPWR = syscall.Signal(0x1e) SIGSTKFLT = syscall.Signal(0x10) SIGSTOP = syscall.Signal(0x13) SIGSYS = syscall.Signal(0x1f) SIGTSTP = syscall.Signal(0x14) SIGTTIN = syscall.Signal(0x15) SIGTTOU = syscall.Signal(0x16) SIGURG = syscall.Signal(0x17) SIGUSR1 = syscall.Signal(0xa) SIGUSR2 = syscall.Signal(0xc) SIGVTALRM = syscall.Signal(0x1a) SIGWINCH = syscall.Signal(0x1c) SIGXCPU = syscall.Signal(0x18) SIGXFSZ = syscall.Signal(0x19) ) // Error table var errorList = [...]struct { num syscall.Errno name string desc string }{ {1, "EPERM", "operation not permitted"}, {2, "ENOENT", "no such file or directory"}, {3, "ESRCH", "no such process"}, {4, "EINTR", "interrupted system call"}, {5, "EIO", "input/output error"}, {6, "ENXIO", "no such device or address"}, {7, "E2BIG", "argument list too long"}, {8, "ENOEXEC", "exec format error"}, {9, "EBADF", "bad file descriptor"}, {10, "ECHILD", "no child processes"}, {11, "EAGAIN", "resource temporarily unavailable"}, {12, "ENOMEM", "cannot allocate memory"}, {13, "EACCES", "permission denied"}, {14, "EFAULT", "bad address"}, {15, "ENOTBLK", "block device required"}, {16, "EBUSY", "device or resource busy"}, {17, "EEXIST", "file exists"}, {18, "EXDEV", "invalid cross-device link"}, {19, "ENODEV", "no such device"}, {20, "ENOTDIR", "not a directory"}, {21, "EISDIR", "is a directory"}, {22, "EINVAL", "invalid argument"}, {23, "ENFILE", "too many open files in system"}, {24, "EMFILE", "too many open files"}, {25, "ENOTTY", "inappropriate ioctl for device"}, {26, "ETXTBSY", "text file busy"}, {27, "EFBIG", "file too large"}, {28, "ENOSPC", "no space left on device"}, {29, "ESPIPE", "illegal seek"}, {30, "EROFS", "read-only file system"}, {31, "EMLINK", "too many links"}, {32, "EPIPE", "broken pipe"}, {33, "EDOM", "numerical argument out of domain"}, {34, "ERANGE", "numerical result out of range"}, {35, "EDEADLK", "resource deadlock avoided"}, {36, "ENAMETOOLONG", "file name too long"}, {37, "ENOLCK", "no locks available"}, {38, "ENOSYS", "function not implemented"}, {39, "ENOTEMPTY", "directory not empty"}, {40, "ELOOP", "too many levels of symbolic links"}, {42, "ENOMSG", "no message of desired type"}, {43, "EIDRM", "identifier removed"}, {44, "ECHRNG", "channel number out of range"}, {45, "EL2NSYNC", "level 2 not synchronized"}, {46, "EL3HLT", "level 3 halted"}, {47, "EL3RST", "level 3 reset"}, {48, "ELNRNG", "link number out of range"}, {49, "EUNATCH", "protocol driver not attached"}, {50, "ENOCSI", "no CSI structure available"}, {51, "EL2HLT", "level 2 halted"}, {52, "EBADE", "invalid exchange"}, {53, "EBADR", "invalid request descriptor"}, {54, "EXFULL", "exchange full"}, {55, "ENOANO", "no anode"}, {56, "EBADRQC", "invalid request code"}, {57, "EBADSLT", "invalid slot"}, {58, "EDEADLOCK", "file locking deadlock error"}, {59, "EBFONT", "bad font file format"}, {60, "ENOSTR", "device not a stream"}, {61, "ENODATA", "no data available"}, {62, "ETIME", "timer expired"}, {63, "ENOSR", "out of streams resources"}, {64, "ENONET", "machine is not on the network"}, {65, "ENOPKG", "package not installed"}, {66, "EREMOTE", "object is remote"}, {67, "ENOLINK", "link has been severed"}, {68, "EADV", "advertise error"}, {69, "ESRMNT", "srmount error"}, {70, "ECOMM", "communication error on send"}, {71, "EPROTO", "protocol error"}, {72, "EMULTIHOP", "multihop attempted"}, {73, "EDOTDOT", "RFS specific error"}, {74, "EBADMSG", "bad message"}, {75, "EOVERFLOW", "value too large for defined data type"}, {76, "ENOTUNIQ", "name not unique on network"}, {77, "EBADFD", "file descriptor in bad state"}, {78, "EREMCHG", "remote address changed"}, {79, "ELIBACC", "can not access a needed shared library"}, {80, "ELIBBAD", "accessing a corrupted shared library"}, {81, "ELIBSCN", ".lib section in a.out corrupted"}, {82, "ELIBMAX", "attempting to link in too many shared libraries"}, {83, "ELIBEXEC", "cannot exec a shared library directly"}, {84, "EILSEQ", "invalid or incomplete multibyte or wide character"}, {85, "ERESTART", "interrupted system call should be restarted"}, {86, "ESTRPIPE", "streams pipe error"}, {87, "EUSERS", "too many users"}, {88, "ENOTSOCK", "socket operation on non-socket"}, {89, "EDESTADDRREQ", "destination address required"}, {90, "EMSGSIZE", "message too long"}, {91, "EPROTOTYPE", "protocol wrong type for socket"}, {92, "ENOPROTOOPT", "protocol not available"}, {93, "EPROTONOSUPPORT", "protocol not supported"}, {94, "ESOCKTNOSUPPORT", "socket type not supported"}, {95, "ENOTSUP", "operation not supported"}, {96, "EPFNOSUPPORT", "protocol family not supported"}, {97, "EAFNOSUPPORT", "address family not supported by protocol"}, {98, "EADDRINUSE", "address already in use"}, {99, "EADDRNOTAVAIL", "cannot assign requested address"}, {100, "ENETDOWN", "network is down"}, {101, "ENETUNREACH", "network is unreachable"}, {102, "ENETRESET", "network dropped connection on reset"}, {103, "ECONNABORTED", "software caused connection abort"}, {104, "ECONNRESET", "connection reset by peer"}, {105, "ENOBUFS", "no buffer space available"}, {106, "EISCONN", "transport endpoint is already connected"}, {107, "ENOTCONN", "transport endpoint is not connected"}, {108, "ESHUTDOWN", "cannot send after transport endpoint shutdown"}, {109, "ETOOMANYREFS", "too many references: cannot splice"}, {110, "ETIMEDOUT", "connection timed out"}, {111, "ECONNREFUSED", "connection refused"}, {112, "EHOSTDOWN", "host is down"}, {113, "EHOSTUNREACH", "no route to host"}, {114, "EALREADY", "operation already in progress"}, {115, "EINPROGRESS", "operation now in progress"}, {116, "ESTALE", "stale file handle"}, {117, "EUCLEAN", "structure needs cleaning"}, {118, "ENOTNAM", "not a XENIX named type file"}, {119, "ENAVAIL", "no XENIX semaphores available"}, {120, "EISNAM", "is a named type file"}, {121, "EREMOTEIO", "remote I/O error"}, {122, "EDQUOT", "disk quota exceeded"}, {123, "ENOMEDIUM", "no medium found"}, {124, "EMEDIUMTYPE", "wrong medium type"}, {125, "ECANCELED", "operation canceled"}, {126, "ENOKEY", "required key not available"}, {127, "EKEYEXPIRED", "key has expired"}, {128, "EKEYREVOKED", "key has been revoked"}, {129, "EKEYREJECTED", "key was rejected by service"}, {130, "EOWNERDEAD", "owner died"}, {131, "ENOTRECOVERABLE", "state not recoverable"}, {132, "ERFKILL", "operation not possible due to RF-kill"}, {133, "EHWPOISON", "memory page has hardware error"}, } // Signal table var signalList = [...]struct { num syscall.Signal name string desc string }{ {1, "SIGHUP", "hangup"}, {2, "SIGINT", "interrupt"}, {3, "SIGQUIT", "quit"}, {4, "SIGILL", "illegal instruction"}, {5, "SIGTRAP", "trace/breakpoint trap"}, {6, "SIGABRT", "aborted"}, {7, "SIGBUS", "bus error"}, {8, "SIGFPE", "floating point exception"}, {9, "SIGKILL", "killed"}, {10, "SIGUSR1", "user defined signal 1"}, {11, "SIGSEGV", "segmentation fault"}, {12, "SIGUSR2", "user defined signal 2"}, {13, "SIGPIPE", "broken pipe"}, {14, "SIGALRM", "alarm clock"}, {15, "SIGTERM", "terminated"}, {16, "SIGSTKFLT", "stack fault"}, {17, "SIGCHLD", "child exited"}, {18, "SIGCONT", "continued"}, {19, "SIGSTOP", "stopped (signal)"}, {20, "SIGTSTP", "stopped"}, {21, "SIGTTIN", "stopped (tty input)"}, {22, "SIGTTOU", "stopped (tty output)"}, {23, "SIGURG", "urgent I/O condition"}, {24, "SIGXCPU", "CPU time limit exceeded"}, {25, "SIGXFSZ", "file size limit exceeded"}, {26, "SIGVTALRM", "virtual timer expired"}, {27, "SIGPROF", "profiling timer expired"}, {28, "SIGWINCH", "window changed"}, {29, "SIGIO", "I/O possible"}, {30, "SIGPWR", "power failure"}, {31, "SIGSYS", "bad system call"}, } ================================================ FILE: vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go ================================================ // mkerrors.sh -Wall -Werror -static -I/tmp/riscv64/include // Code generated by the command above; see README.md. DO NOT EDIT. //go:build riscv64 && linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -Wall -Werror -static -I/tmp/riscv64/include _const.go package unix import "syscall" const ( B1000000 = 0x1008 B115200 = 0x1002 B1152000 = 0x1009 B1500000 = 0x100a B2000000 = 0x100b B230400 = 0x1003 B2500000 = 0x100c B3000000 = 0x100d B3500000 = 0x100e B4000000 = 0x100f B460800 = 0x1004 B500000 = 0x1005 B57600 = 0x1001 B576000 = 0x1006 B921600 = 0x1007 BLKALIGNOFF = 0x127a BLKBSZGET = 0x80081270 BLKBSZSET = 0x40081271 BLKDISCARD = 0x1277 BLKDISCARDZEROES = 0x127c BLKFLSBUF = 0x1261 BLKFRAGET = 0x1265 BLKFRASET = 0x1264 BLKGETDISKSEQ = 0x80081280 BLKGETSIZE = 0x1260 BLKGETSIZE64 = 0x80081272 BLKIOMIN = 0x1278 BLKIOOPT = 0x1279 BLKPBSZGET = 0x127b BLKRAGET = 0x1263 BLKRASET = 0x1262 BLKROGET = 0x125e BLKROSET = 0x125d BLKROTATIONAL = 0x127e BLKRRPART = 0x125f BLKSECDISCARD = 0x127d BLKSECTGET = 0x1267 BLKSECTSET = 0x1266 BLKSSZGET = 0x1268 BLKZEROOUT = 0x127f BOTHER = 0x1000 BS1 = 0x2000 BSDLY = 0x2000 CBAUD = 0x100f CBAUDEX = 0x1000 CIBAUD = 0x100f0000 CLOCAL = 0x800 CR1 = 0x200 CR2 = 0x400 CR3 = 0x600 CRDLY = 0x600 CREAD = 0x80 CS6 = 0x10 CS7 = 0x20 CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 DM_MPATH_PROBE_PATHS = 0xfd12 ECCGETLAYOUT = 0x81484d11 ECCGETSTATS = 0x80104d12 ECHOCTL = 0x200 ECHOE = 0x10 ECHOK = 0x20 ECHOKE = 0x800 ECHONL = 0x40 ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 EPIOCGPARAMS = 0x80088a02 EPIOCSPARAMS = 0x40088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 FFDLY = 0x8000 FICLONE = 0x40049409 FICLONERANGE = 0x4020940d FLUSHO = 0x1000 FS_IOC_ENABLE_VERITY = 0x40806685 FS_IOC_GETFLAGS = 0x80086601 FS_IOC_GET_ENCRYPTION_NONCE = 0x8010661b FS_IOC_GET_ENCRYPTION_POLICY = 0x400c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x40106614 FS_IOC_SETFLAGS = 0x40086602 FS_IOC_SET_ENCRYPTION_POLICY = 0x800c6613 F_GETLK = 0x5 F_GETLK64 = 0x5 F_GETOWN = 0x9 F_RDLCK = 0x0 F_SETLK = 0x6 F_SETLK64 = 0x6 F_SETLKW = 0x7 F_SETLKW64 = 0x7 F_SETOWN = 0x8 F_UNLCK = 0x2 F_WRLCK = 0x1 HIDIOCGRAWINFO = 0x80084803 HIDIOCGRDESC = 0x90044802 HIDIOCGRDESCSIZE = 0x80044801 HIDIOCREVOKE = 0x4004480d HUPCL = 0x400 ICANON = 0x2 IEXTEN = 0x8000 IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x800 IOCTL_MEI_NOTIFY_GET = 0x80044803 IOCTL_MEI_NOTIFY_SET = 0x40044802 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x7b9 IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_MASK = 0xffff0f00 ISIG = 0x1 IUCLC = 0x200 IXOFF = 0x1000 IXON = 0x400 MAP_ANON = 0x20 MAP_ANONYMOUS = 0x20 MAP_DENYWRITE = 0x800 MAP_EXECUTABLE = 0x1000 MAP_GROWSDOWN = 0x100 MAP_HUGETLB = 0x40000 MAP_LOCKED = 0x2000 MAP_NONBLOCK = 0x10000 MAP_NORESERVE = 0x4000 MAP_POPULATE = 0x8000 MAP_STACK = 0x20000 MAP_SYNC = 0x80000 MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MCL_ONFAULT = 0x4 MEMERASE = 0x40084d02 MEMERASE64 = 0x40104d14 MEMGETBADBLOCK = 0x40084d0b MEMGETINFO = 0x80204d01 MEMGETOOBSEL = 0x80c84d0a MEMGETREGIONCOUNT = 0x80044d07 MEMISLOCKED = 0x80084d17 MEMLOCK = 0x40084d05 MEMREAD = 0xc0404d1a MEMREADOOB = 0xc0104d04 MEMSETBADBLOCK = 0x40084d0c MEMUNLOCK = 0x40084d06 MEMWRITEOOB = 0xc0104d03 MTDFILEMODE = 0x4d13 NFDBITS = 0x40 NLDLY = 0x100 NOFLSH = 0x80 NS_GET_MNTNS_ID = 0x8008b705 NS_GET_NSTYPE = 0xb703 NS_GET_OWNER_UID = 0xb704 NS_GET_PARENT = 0xb702 NS_GET_PID_FROM_PIDNS = 0x8004b706 NS_GET_PID_IN_PIDNS = 0x8004b708 NS_GET_TGID_FROM_PIDNS = 0x8004b707 NS_GET_TGID_IN_PIDNS = 0x8004b709 NS_GET_USERNS = 0xb701 OLCUC = 0x2 ONLCR = 0x4 OTPERASE = 0x400c4d19 OTPGETREGIONCOUNT = 0x40044d0e OTPGETREGIONINFO = 0x400c4d0f OTPLOCK = 0x800c4d10 OTPSELECT = 0x80044d0d O_APPEND = 0x400 O_ASYNC = 0x2000 O_CLOEXEC = 0x80000 O_CREAT = 0x40 O_DIRECT = 0x4000 O_DIRECTORY = 0x10000 O_DSYNC = 0x1000 O_EXCL = 0x80 O_FSYNC = 0x101000 O_LARGEFILE = 0x0 O_NDELAY = 0x800 O_NOATIME = 0x40000 O_NOCTTY = 0x100 O_NOFOLLOW = 0x20000 O_NONBLOCK = 0x800 O_PATH = 0x200000 O_RSYNC = 0x101000 O_SYNC = 0x101000 O_TMPFILE = 0x410000 O_TRUNC = 0x200 PARENB = 0x100 PARODD = 0x200 PENDIN = 0x4000 PERF_EVENT_IOC_DISABLE = 0x2401 PERF_EVENT_IOC_ENABLE = 0x2400 PERF_EVENT_IOC_ID = 0x80082407 PERF_EVENT_IOC_MODIFY_ATTRIBUTES = 0x4008240b PERF_EVENT_IOC_PAUSE_OUTPUT = 0x40042409 PERF_EVENT_IOC_PERIOD = 0x40082404 PERF_EVENT_IOC_QUERY_BPF = 0xc008240a PERF_EVENT_IOC_REFRESH = 0x2402 PERF_EVENT_IOC_RESET = 0x2403 PERF_EVENT_IOC_SET_BPF = 0x40042408 PERF_EVENT_IOC_SET_FILTER = 0x40082406 PERF_EVENT_IOC_SET_OUTPUT = 0x2405 PPPIOCATTACH = 0x4004743d PPPIOCATTCHAN = 0x40047438 PPPIOCBRIDGECHAN = 0x40047435 PPPIOCCONNECT = 0x4004743a PPPIOCDETACH = 0x4004743c PPPIOCDISCONN = 0x7439 PPPIOCGASYNCMAP = 0x80047458 PPPIOCGCHAN = 0x80047437 PPPIOCGDEBUG = 0x80047441 PPPIOCGFLAGS = 0x8004745a PPPIOCGIDLE = 0x8010743f PPPIOCGIDLE32 = 0x8008743f PPPIOCGIDLE64 = 0x8010743f PPPIOCGL2TPSTATS = 0x80487436 PPPIOCGMRU = 0x80047453 PPPIOCGRASYNCMAP = 0x80047455 PPPIOCGUNIT = 0x80047456 PPPIOCGXASYNCMAP = 0x80207450 PPPIOCSACTIVE = 0x40107446 PPPIOCSASYNCMAP = 0x40047457 PPPIOCSCOMPRESS = 0x4010744d PPPIOCSDEBUG = 0x40047440 PPPIOCSFLAGS = 0x40047459 PPPIOCSMAXCID = 0x40047451 PPPIOCSMRRU = 0x4004743b PPPIOCSMRU = 0x40047452 PPPIOCSNPMODE = 0x4008744b PPPIOCSPASS = 0x40107447 PPPIOCSRASYNCMAP = 0x40047454 PPPIOCSXASYNCMAP = 0x4020744f PPPIOCUNBRIDGECHAN = 0x7434 PPPIOCXFERUNIT = 0x744e PR_SET_PTRACER_ANY = 0xffffffffffffffff PTP_CLOCK_GETCAPS = 0x80503d01 PTP_CLOCK_GETCAPS2 = 0x80503d0a PTP_ENABLE_PPS = 0x40043d04 PTP_ENABLE_PPS2 = 0x40043d0d PTP_EXTTS_REQUEST = 0x40103d02 PTP_EXTTS_REQUEST2 = 0x40103d0b PTP_MASK_CLEAR_ALL = 0x3d13 PTP_MASK_EN_SINGLE = 0x40043d14 PTP_PEROUT_REQUEST = 0x40383d03 PTP_PEROUT_REQUEST2 = 0x40383d0c PTP_PIN_SETFUNC = 0x40603d07 PTP_PIN_SETFUNC2 = 0x40603d10 PTP_SYS_OFFSET = 0x43403d05 PTP_SYS_OFFSET2 = 0x43403d0e PTRACE_GETFDPIC = 0x21 PTRACE_GETFDPIC_EXEC = 0x0 PTRACE_GETFDPIC_INTERP = 0x1 RLIMIT_AS = 0x9 RLIMIT_MEMLOCK = 0x8 RLIMIT_NOFILE = 0x7 RLIMIT_NPROC = 0x6 RLIMIT_RSS = 0x5 RNDADDENTROPY = 0x40085203 RNDADDTOENTCNT = 0x40045201 RNDCLEARPOOL = 0x5206 RNDGETENTCNT = 0x80045200 RNDGETPOOL = 0x80085202 RNDRESEEDCRNG = 0x5207 RNDZAPENTCNT = 0x5204 RTC_AIE_OFF = 0x7002 RTC_AIE_ON = 0x7001 RTC_ALM_READ = 0x80247008 RTC_ALM_SET = 0x40247007 RTC_EPOCH_READ = 0x8008700d RTC_EPOCH_SET = 0x4008700e RTC_IRQP_READ = 0x8008700b RTC_IRQP_SET = 0x4008700c RTC_PARAM_GET = 0x40187013 RTC_PARAM_SET = 0x40187014 RTC_PIE_OFF = 0x7006 RTC_PIE_ON = 0x7005 RTC_PLL_GET = 0x80207011 RTC_PLL_SET = 0x40207012 RTC_RD_TIME = 0x80247009 RTC_SET_TIME = 0x4024700a RTC_UIE_OFF = 0x7004 RTC_UIE_ON = 0x7003 RTC_VL_CLR = 0x7014 RTC_VL_READ = 0x80047013 RTC_WIE_OFF = 0x7010 RTC_WIE_ON = 0x700f RTC_WKALM_RD = 0x80287010 RTC_WKALM_SET = 0x4028700f SCM_DEVMEM_DMABUF = 0x4f SCM_DEVMEM_LINEAR = 0x4e SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a SCM_TIMESTAMPNS = 0x23 SCM_TS_OPT_ID = 0x51 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 SECCOMP_IOCTL_NOTIF_ADDFD = 0x40182103 SECCOMP_IOCTL_NOTIF_ID_VALID = 0x40082102 SECCOMP_IOCTL_NOTIF_SET_FLAGS = 0x40082104 SFD_CLOEXEC = 0x80000 SFD_NONBLOCK = 0x800 SIOCATMARK = 0x8905 SIOCGPGRP = 0x8904 SIOCGSTAMPNS_NEW = 0x80108907 SIOCGSTAMP_NEW = 0x80108906 SIOCINQ = 0x541b SIOCOUTQ = 0x5411 SIOCSPGRP = 0x8902 SOCK_CLOEXEC = 0x80000 SOCK_DGRAM = 0x2 SOCK_NONBLOCK = 0x800 SOCK_STREAM = 0x1 SOL_SOCKET = 0x1 SO_ACCEPTCONN = 0x1e SO_ATTACH_BPF = 0x32 SO_ATTACH_REUSEPORT_CBPF = 0x33 SO_ATTACH_REUSEPORT_EBPF = 0x34 SO_BINDTODEVICE = 0x19 SO_BINDTOIFINDEX = 0x3e SO_BPF_EXTENSIONS = 0x30 SO_BROADCAST = 0x6 SO_BSDCOMPAT = 0xe SO_BUF_LOCK = 0x48 SO_BUSY_POLL = 0x2e SO_BUSY_POLL_BUDGET = 0x46 SO_CNX_ADVICE = 0x35 SO_COOKIE = 0x39 SO_DETACH_REUSEPORT_BPF = 0x44 SO_DEVMEM_DMABUF = 0x4f SO_DEVMEM_DONTNEED = 0x50 SO_DEVMEM_LINEAR = 0x4e SO_DOMAIN = 0x27 SO_DONTROUTE = 0x5 SO_ERROR = 0x4 SO_INCOMING_CPU = 0x31 SO_INCOMING_NAPI_ID = 0x38 SO_KEEPALIVE = 0x9 SO_LINGER = 0xd SO_LOCK_FILTER = 0x2c SO_MARK = 0x24 SO_MAX_PACING_RATE = 0x2f SO_MEMINFO = 0x37 SO_NETNS_COOKIE = 0x47 SO_NOFCS = 0x2b SO_OOBINLINE = 0xa SO_PASSCRED = 0x10 SO_PASSPIDFD = 0x4c SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x11 SO_PEERGROUPS = 0x3b SO_PEERPIDFD = 0x4d SO_PEERSEC = 0x1f SO_PREFER_BUSY_POLL = 0x45 SO_PROTOCOL = 0x26 SO_RCVBUF = 0x8 SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x12 SO_RCVMARK = 0x4b SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x14 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x14 SO_RESERVE_MEM = 0x49 SO_REUSEADDR = 0x2 SO_REUSEPORT = 0xf SO_RXQ_OVFL = 0x28 SO_SECURITY_AUTHENTICATION = 0x16 SO_SECURITY_ENCRYPTION_NETWORK = 0x18 SO_SECURITY_ENCRYPTION_TRANSPORT = 0x17 SO_SELECT_ERR_QUEUE = 0x2d SO_SNDBUF = 0x7 SO_SNDBUFFORCE = 0x20 SO_SNDLOWAT = 0x13 SO_SNDTIMEO = 0x15 SO_SNDTIMEO_NEW = 0x43 SO_SNDTIMEO_OLD = 0x15 SO_TIMESTAMPING = 0x25 SO_TIMESTAMPING_NEW = 0x41 SO_TIMESTAMPING_OLD = 0x25 SO_TIMESTAMPNS = 0x23 SO_TIMESTAMPNS_NEW = 0x40 SO_TIMESTAMPNS_OLD = 0x23 SO_TIMESTAMP_NEW = 0x3f SO_TXREHASH = 0x4a SO_TXTIME = 0x3d SO_TYPE = 0x3 SO_WIFI_STATUS = 0x29 SO_ZEROCOPY = 0x3c TAB1 = 0x800 TAB2 = 0x1000 TAB3 = 0x1800 TABDLY = 0x1800 TCFLSH = 0x540b TCGETA = 0x5405 TCGETS = 0x5401 TCGETS2 = 0x802c542a TCGETX = 0x5432 TCSAFLUSH = 0x2 TCSBRK = 0x5409 TCSBRKP = 0x5425 TCSETA = 0x5406 TCSETAF = 0x5408 TCSETAW = 0x5407 TCSETS = 0x5402 TCSETS2 = 0x402c542b TCSETSF = 0x5404 TCSETSF2 = 0x402c542d TCSETSW = 0x5403 TCSETSW2 = 0x402c542c TCSETX = 0x5433 TCSETXF = 0x5434 TCSETXW = 0x5435 TCXONC = 0x540a TFD_CLOEXEC = 0x80000 TFD_NONBLOCK = 0x800 TIOCCBRK = 0x5428 TIOCCONS = 0x541d TIOCEXCL = 0x540c TIOCGDEV = 0x80045432 TIOCGETD = 0x5424 TIOCGEXCL = 0x80045440 TIOCGICOUNT = 0x545d TIOCGISO7816 = 0x80285442 TIOCGLCKTRMIOS = 0x5456 TIOCGPGRP = 0x540f TIOCGPKT = 0x80045438 TIOCGPTLCK = 0x80045439 TIOCGPTN = 0x80045430 TIOCGPTPEER = 0x5441 TIOCGRS485 = 0x542e TIOCGSERIAL = 0x541e TIOCGSID = 0x5429 TIOCGSOFTCAR = 0x5419 TIOCGWINSZ = 0x5413 TIOCINQ = 0x541b TIOCLINUX = 0x541c TIOCMBIC = 0x5417 TIOCMBIS = 0x5416 TIOCMGET = 0x5415 TIOCMIWAIT = 0x545c TIOCMSET = 0x5418 TIOCM_CAR = 0x40 TIOCM_CD = 0x40 TIOCM_CTS = 0x20 TIOCM_DSR = 0x100 TIOCM_RI = 0x80 TIOCM_RNG = 0x80 TIOCM_SR = 0x10 TIOCM_ST = 0x8 TIOCNOTTY = 0x5422 TIOCNXCL = 0x540d TIOCOUTQ = 0x5411 TIOCPKT = 0x5420 TIOCSBRK = 0x5427 TIOCSCTTY = 0x540e TIOCSERCONFIG = 0x5453 TIOCSERGETLSR = 0x5459 TIOCSERGETMULTI = 0x545a TIOCSERGSTRUCT = 0x5458 TIOCSERGWILD = 0x5454 TIOCSERSETMULTI = 0x545b TIOCSERSWILD = 0x5455 TIOCSER_TEMT = 0x1 TIOCSETD = 0x5423 TIOCSIG = 0x40045436 TIOCSISO7816 = 0xc0285443 TIOCSLCKTRMIOS = 0x5457 TIOCSPGRP = 0x5410 TIOCSPTLCK = 0x40045431 TIOCSRS485 = 0x542f TIOCSSERIAL = 0x541f TIOCSSOFTCAR = 0x541a TIOCSTI = 0x5412 TIOCSWINSZ = 0x5414 TIOCVHANGUP = 0x5437 TOSTOP = 0x100 TUNATTACHFILTER = 0x401054d5 TUNDETACHFILTER = 0x401054d6 TUNGETDEVNETNS = 0x54e3 TUNGETFEATURES = 0x800454cf TUNGETFILTER = 0x801054db TUNGETIFF = 0x800454d2 TUNGETSNDBUF = 0x800454d3 TUNGETVNETBE = 0x800454df TUNGETVNETHDRSZ = 0x800454d7 TUNGETVNETLE = 0x800454dd TUNSETCARRIER = 0x400454e2 TUNSETDEBUG = 0x400454c9 TUNSETFILTEREBPF = 0x800454e1 TUNSETGROUP = 0x400454ce TUNSETIFF = 0x400454ca TUNSETIFINDEX = 0x400454da TUNSETLINK = 0x400454cd TUNSETNOCSUM = 0x400454c8 TUNSETOFFLOAD = 0x400454d0 TUNSETOWNER = 0x400454cc TUNSETPERSIST = 0x400454cb TUNSETQUEUE = 0x400454d9 TUNSETSNDBUF = 0x400454d4 TUNSETSTEERINGEBPF = 0x800454e0 TUNSETTXFILTER = 0x400454d1 TUNSETVNETBE = 0x400454de TUNSETVNETHDRSZ = 0x400454d8 TUNSETVNETLE = 0x400454dc UBI_IOCATT = 0x40186f40 UBI_IOCDET = 0x40046f41 UBI_IOCEBCH = 0x40044f02 UBI_IOCEBER = 0x40044f01 UBI_IOCEBISMAP = 0x80044f05 UBI_IOCEBMAP = 0x40084f03 UBI_IOCEBUNMAP = 0x40044f04 UBI_IOCMKVOL = 0x40986f00 UBI_IOCRMVOL = 0x40046f01 UBI_IOCRNVOL = 0x51106f03 UBI_IOCRPEB = 0x40046f04 UBI_IOCRSVOL = 0x400c6f02 UBI_IOCSETVOLPROP = 0x40104f06 UBI_IOCSPEB = 0x40046f05 UBI_IOCVOLCRBLK = 0x40804f07 UBI_IOCVOLRMBLK = 0x4f08 UBI_IOCVOLUP = 0x40084f00 VDISCARD = 0xd VEOF = 0x4 VEOL = 0xb VEOL2 = 0x10 VMIN = 0x6 VREPRINT = 0xc VSTART = 0x8 VSTOP = 0x9 VSUSP = 0xa VSWTC = 0x7 VT1 = 0x4000 VTDLY = 0x4000 VTIME = 0x5 VWERASE = 0xe WDIOC_GETBOOTSTATUS = 0x80045702 WDIOC_GETPRETIMEOUT = 0x80045709 WDIOC_GETSTATUS = 0x80045701 WDIOC_GETSUPPORT = 0x80285700 WDIOC_GETTEMP = 0x80045703 WDIOC_GETTIMELEFT = 0x8004570a WDIOC_GETTIMEOUT = 0x80045707 WDIOC_KEEPALIVE = 0x80045705 WDIOC_SETOPTIONS = 0x80045704 WORDSIZE = 0x40 XCASE = 0x4 XTABS = 0x1800 _HIDIOCGRAWNAME = 0x80804804 _HIDIOCGRAWPHYS = 0x80404805 _HIDIOCGRAWUNIQ = 0x80404808 ) // Errors const ( EADDRINUSE = syscall.Errno(0x62) EADDRNOTAVAIL = syscall.Errno(0x63) EADV = syscall.Errno(0x44) EAFNOSUPPORT = syscall.Errno(0x61) EALREADY = syscall.Errno(0x72) EBADE = syscall.Errno(0x34) EBADFD = syscall.Errno(0x4d) EBADMSG = syscall.Errno(0x4a) EBADR = syscall.Errno(0x35) EBADRQC = syscall.Errno(0x38) EBADSLT = syscall.Errno(0x39) EBFONT = syscall.Errno(0x3b) ECANCELED = syscall.Errno(0x7d) ECHRNG = syscall.Errno(0x2c) ECOMM = syscall.Errno(0x46) ECONNABORTED = syscall.Errno(0x67) ECONNREFUSED = syscall.Errno(0x6f) ECONNRESET = syscall.Errno(0x68) EDEADLK = syscall.Errno(0x23) EDEADLOCK = syscall.Errno(0x23) EDESTADDRREQ = syscall.Errno(0x59) EDOTDOT = syscall.Errno(0x49) EDQUOT = syscall.Errno(0x7a) EHOSTDOWN = syscall.Errno(0x70) EHOSTUNREACH = syscall.Errno(0x71) EHWPOISON = syscall.Errno(0x85) EIDRM = syscall.Errno(0x2b) EILSEQ = syscall.Errno(0x54) EINPROGRESS = syscall.Errno(0x73) EISCONN = syscall.Errno(0x6a) EISNAM = syscall.Errno(0x78) EKEYEXPIRED = syscall.Errno(0x7f) EKEYREJECTED = syscall.Errno(0x81) EKEYREVOKED = syscall.Errno(0x80) EL2HLT = syscall.Errno(0x33) EL2NSYNC = syscall.Errno(0x2d) EL3HLT = syscall.Errno(0x2e) EL3RST = syscall.Errno(0x2f) ELIBACC = syscall.Errno(0x4f) ELIBBAD = syscall.Errno(0x50) ELIBEXEC = syscall.Errno(0x53) ELIBMAX = syscall.Errno(0x52) ELIBSCN = syscall.Errno(0x51) ELNRNG = syscall.Errno(0x30) ELOOP = syscall.Errno(0x28) EMEDIUMTYPE = syscall.Errno(0x7c) EMSGSIZE = syscall.Errno(0x5a) EMULTIHOP = syscall.Errno(0x48) ENAMETOOLONG = syscall.Errno(0x24) ENAVAIL = syscall.Errno(0x77) ENETDOWN = syscall.Errno(0x64) ENETRESET = syscall.Errno(0x66) ENETUNREACH = syscall.Errno(0x65) ENOANO = syscall.Errno(0x37) ENOBUFS = syscall.Errno(0x69) ENOCSI = syscall.Errno(0x32) ENODATA = syscall.Errno(0x3d) ENOKEY = syscall.Errno(0x7e) ENOLCK = syscall.Errno(0x25) ENOLINK = syscall.Errno(0x43) ENOMEDIUM = syscall.Errno(0x7b) ENOMSG = syscall.Errno(0x2a) ENONET = syscall.Errno(0x40) ENOPKG = syscall.Errno(0x41) ENOPROTOOPT = syscall.Errno(0x5c) ENOSR = syscall.Errno(0x3f) ENOSTR = syscall.Errno(0x3c) ENOSYS = syscall.Errno(0x26) ENOTCONN = syscall.Errno(0x6b) ENOTEMPTY = syscall.Errno(0x27) ENOTNAM = syscall.Errno(0x76) ENOTRECOVERABLE = syscall.Errno(0x83) ENOTSOCK = syscall.Errno(0x58) ENOTSUP = syscall.Errno(0x5f) ENOTUNIQ = syscall.Errno(0x4c) EOPNOTSUPP = syscall.Errno(0x5f) EOVERFLOW = syscall.Errno(0x4b) EOWNERDEAD = syscall.Errno(0x82) EPFNOSUPPORT = syscall.Errno(0x60) EPROTO = syscall.Errno(0x47) EPROTONOSUPPORT = syscall.Errno(0x5d) EPROTOTYPE = syscall.Errno(0x5b) EREMCHG = syscall.Errno(0x4e) EREMOTE = syscall.Errno(0x42) EREMOTEIO = syscall.Errno(0x79) ERESTART = syscall.Errno(0x55) ERFKILL = syscall.Errno(0x84) ESHUTDOWN = syscall.Errno(0x6c) ESOCKTNOSUPPORT = syscall.Errno(0x5e) ESRMNT = syscall.Errno(0x45) ESTALE = syscall.Errno(0x74) ESTRPIPE = syscall.Errno(0x56) ETIME = syscall.Errno(0x3e) ETIMEDOUT = syscall.Errno(0x6e) ETOOMANYREFS = syscall.Errno(0x6d) EUCLEAN = syscall.Errno(0x75) EUNATCH = syscall.Errno(0x31) EUSERS = syscall.Errno(0x57) EXFULL = syscall.Errno(0x36) ) // Signals const ( SIGBUS = syscall.Signal(0x7) SIGCHLD = syscall.Signal(0x11) SIGCLD = syscall.Signal(0x11) SIGCONT = syscall.Signal(0x12) SIGIO = syscall.Signal(0x1d) SIGPOLL = syscall.Signal(0x1d) SIGPROF = syscall.Signal(0x1b) SIGPWR = syscall.Signal(0x1e) SIGSTKFLT = syscall.Signal(0x10) SIGSTOP = syscall.Signal(0x13) SIGSYS = syscall.Signal(0x1f) SIGTSTP = syscall.Signal(0x14) SIGTTIN = syscall.Signal(0x15) SIGTTOU = syscall.Signal(0x16) SIGURG = syscall.Signal(0x17) SIGUSR1 = syscall.Signal(0xa) SIGUSR2 = syscall.Signal(0xc) SIGVTALRM = syscall.Signal(0x1a) SIGWINCH = syscall.Signal(0x1c) SIGXCPU = syscall.Signal(0x18) SIGXFSZ = syscall.Signal(0x19) ) // Error table var errorList = [...]struct { num syscall.Errno name string desc string }{ {1, "EPERM", "operation not permitted"}, {2, "ENOENT", "no such file or directory"}, {3, "ESRCH", "no such process"}, {4, "EINTR", "interrupted system call"}, {5, "EIO", "input/output error"}, {6, "ENXIO", "no such device or address"}, {7, "E2BIG", "argument list too long"}, {8, "ENOEXEC", "exec format error"}, {9, "EBADF", "bad file descriptor"}, {10, "ECHILD", "no child processes"}, {11, "EAGAIN", "resource temporarily unavailable"}, {12, "ENOMEM", "cannot allocate memory"}, {13, "EACCES", "permission denied"}, {14, "EFAULT", "bad address"}, {15, "ENOTBLK", "block device required"}, {16, "EBUSY", "device or resource busy"}, {17, "EEXIST", "file exists"}, {18, "EXDEV", "invalid cross-device link"}, {19, "ENODEV", "no such device"}, {20, "ENOTDIR", "not a directory"}, {21, "EISDIR", "is a directory"}, {22, "EINVAL", "invalid argument"}, {23, "ENFILE", "too many open files in system"}, {24, "EMFILE", "too many open files"}, {25, "ENOTTY", "inappropriate ioctl for device"}, {26, "ETXTBSY", "text file busy"}, {27, "EFBIG", "file too large"}, {28, "ENOSPC", "no space left on device"}, {29, "ESPIPE", "illegal seek"}, {30, "EROFS", "read-only file system"}, {31, "EMLINK", "too many links"}, {32, "EPIPE", "broken pipe"}, {33, "EDOM", "numerical argument out of domain"}, {34, "ERANGE", "numerical result out of range"}, {35, "EDEADLK", "resource deadlock avoided"}, {36, "ENAMETOOLONG", "file name too long"}, {37, "ENOLCK", "no locks available"}, {38, "ENOSYS", "function not implemented"}, {39, "ENOTEMPTY", "directory not empty"}, {40, "ELOOP", "too many levels of symbolic links"}, {42, "ENOMSG", "no message of desired type"}, {43, "EIDRM", "identifier removed"}, {44, "ECHRNG", "channel number out of range"}, {45, "EL2NSYNC", "level 2 not synchronized"}, {46, "EL3HLT", "level 3 halted"}, {47, "EL3RST", "level 3 reset"}, {48, "ELNRNG", "link number out of range"}, {49, "EUNATCH", "protocol driver not attached"}, {50, "ENOCSI", "no CSI structure available"}, {51, "EL2HLT", "level 2 halted"}, {52, "EBADE", "invalid exchange"}, {53, "EBADR", "invalid request descriptor"}, {54, "EXFULL", "exchange full"}, {55, "ENOANO", "no anode"}, {56, "EBADRQC", "invalid request code"}, {57, "EBADSLT", "invalid slot"}, {59, "EBFONT", "bad font file format"}, {60, "ENOSTR", "device not a stream"}, {61, "ENODATA", "no data available"}, {62, "ETIME", "timer expired"}, {63, "ENOSR", "out of streams resources"}, {64, "ENONET", "machine is not on the network"}, {65, "ENOPKG", "package not installed"}, {66, "EREMOTE", "object is remote"}, {67, "ENOLINK", "link has been severed"}, {68, "EADV", "advertise error"}, {69, "ESRMNT", "srmount error"}, {70, "ECOMM", "communication error on send"}, {71, "EPROTO", "protocol error"}, {72, "EMULTIHOP", "multihop attempted"}, {73, "EDOTDOT", "RFS specific error"}, {74, "EBADMSG", "bad message"}, {75, "EOVERFLOW", "value too large for defined data type"}, {76, "ENOTUNIQ", "name not unique on network"}, {77, "EBADFD", "file descriptor in bad state"}, {78, "EREMCHG", "remote address changed"}, {79, "ELIBACC", "can not access a needed shared library"}, {80, "ELIBBAD", "accessing a corrupted shared library"}, {81, "ELIBSCN", ".lib section in a.out corrupted"}, {82, "ELIBMAX", "attempting to link in too many shared libraries"}, {83, "ELIBEXEC", "cannot exec a shared library directly"}, {84, "EILSEQ", "invalid or incomplete multibyte or wide character"}, {85, "ERESTART", "interrupted system call should be restarted"}, {86, "ESTRPIPE", "streams pipe error"}, {87, "EUSERS", "too many users"}, {88, "ENOTSOCK", "socket operation on non-socket"}, {89, "EDESTADDRREQ", "destination address required"}, {90, "EMSGSIZE", "message too long"}, {91, "EPROTOTYPE", "protocol wrong type for socket"}, {92, "ENOPROTOOPT", "protocol not available"}, {93, "EPROTONOSUPPORT", "protocol not supported"}, {94, "ESOCKTNOSUPPORT", "socket type not supported"}, {95, "ENOTSUP", "operation not supported"}, {96, "EPFNOSUPPORT", "protocol family not supported"}, {97, "EAFNOSUPPORT", "address family not supported by protocol"}, {98, "EADDRINUSE", "address already in use"}, {99, "EADDRNOTAVAIL", "cannot assign requested address"}, {100, "ENETDOWN", "network is down"}, {101, "ENETUNREACH", "network is unreachable"}, {102, "ENETRESET", "network dropped connection on reset"}, {103, "ECONNABORTED", "software caused connection abort"}, {104, "ECONNRESET", "connection reset by peer"}, {105, "ENOBUFS", "no buffer space available"}, {106, "EISCONN", "transport endpoint is already connected"}, {107, "ENOTCONN", "transport endpoint is not connected"}, {108, "ESHUTDOWN", "cannot send after transport endpoint shutdown"}, {109, "ETOOMANYREFS", "too many references: cannot splice"}, {110, "ETIMEDOUT", "connection timed out"}, {111, "ECONNREFUSED", "connection refused"}, {112, "EHOSTDOWN", "host is down"}, {113, "EHOSTUNREACH", "no route to host"}, {114, "EALREADY", "operation already in progress"}, {115, "EINPROGRESS", "operation now in progress"}, {116, "ESTALE", "stale file handle"}, {117, "EUCLEAN", "structure needs cleaning"}, {118, "ENOTNAM", "not a XENIX named type file"}, {119, "ENAVAIL", "no XENIX semaphores available"}, {120, "EISNAM", "is a named type file"}, {121, "EREMOTEIO", "remote I/O error"}, {122, "EDQUOT", "disk quota exceeded"}, {123, "ENOMEDIUM", "no medium found"}, {124, "EMEDIUMTYPE", "wrong medium type"}, {125, "ECANCELED", "operation canceled"}, {126, "ENOKEY", "required key not available"}, {127, "EKEYEXPIRED", "key has expired"}, {128, "EKEYREVOKED", "key has been revoked"}, {129, "EKEYREJECTED", "key was rejected by service"}, {130, "EOWNERDEAD", "owner died"}, {131, "ENOTRECOVERABLE", "state not recoverable"}, {132, "ERFKILL", "operation not possible due to RF-kill"}, {133, "EHWPOISON", "memory page has hardware error"}, } // Signal table var signalList = [...]struct { num syscall.Signal name string desc string }{ {1, "SIGHUP", "hangup"}, {2, "SIGINT", "interrupt"}, {3, "SIGQUIT", "quit"}, {4, "SIGILL", "illegal instruction"}, {5, "SIGTRAP", "trace/breakpoint trap"}, {6, "SIGABRT", "aborted"}, {7, "SIGBUS", "bus error"}, {8, "SIGFPE", "floating point exception"}, {9, "SIGKILL", "killed"}, {10, "SIGUSR1", "user defined signal 1"}, {11, "SIGSEGV", "segmentation fault"}, {12, "SIGUSR2", "user defined signal 2"}, {13, "SIGPIPE", "broken pipe"}, {14, "SIGALRM", "alarm clock"}, {15, "SIGTERM", "terminated"}, {16, "SIGSTKFLT", "stack fault"}, {17, "SIGCHLD", "child exited"}, {18, "SIGCONT", "continued"}, {19, "SIGSTOP", "stopped (signal)"}, {20, "SIGTSTP", "stopped"}, {21, "SIGTTIN", "stopped (tty input)"}, {22, "SIGTTOU", "stopped (tty output)"}, {23, "SIGURG", "urgent I/O condition"}, {24, "SIGXCPU", "CPU time limit exceeded"}, {25, "SIGXFSZ", "file size limit exceeded"}, {26, "SIGVTALRM", "virtual timer expired"}, {27, "SIGPROF", "profiling timer expired"}, {28, "SIGWINCH", "window changed"}, {29, "SIGIO", "I/O possible"}, {30, "SIGPWR", "power failure"}, {31, "SIGSYS", "bad system call"}, } ================================================ FILE: vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go ================================================ // mkerrors.sh -Wall -Werror -static -I/tmp/s390x/include -fsigned-char // Code generated by the command above; see README.md. DO NOT EDIT. //go:build s390x && linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -Wall -Werror -static -I/tmp/s390x/include -fsigned-char _const.go package unix import "syscall" const ( B1000000 = 0x1008 B115200 = 0x1002 B1152000 = 0x1009 B1500000 = 0x100a B2000000 = 0x100b B230400 = 0x1003 B2500000 = 0x100c B3000000 = 0x100d B3500000 = 0x100e B4000000 = 0x100f B460800 = 0x1004 B500000 = 0x1005 B57600 = 0x1001 B576000 = 0x1006 B921600 = 0x1007 BLKALIGNOFF = 0x127a BLKBSZGET = 0x80081270 BLKBSZSET = 0x40081271 BLKDISCARD = 0x1277 BLKDISCARDZEROES = 0x127c BLKFLSBUF = 0x1261 BLKFRAGET = 0x1265 BLKFRASET = 0x1264 BLKGETDISKSEQ = 0x80081280 BLKGETSIZE = 0x1260 BLKGETSIZE64 = 0x80081272 BLKIOMIN = 0x1278 BLKIOOPT = 0x1279 BLKPBSZGET = 0x127b BLKRAGET = 0x1263 BLKRASET = 0x1262 BLKROGET = 0x125e BLKROSET = 0x125d BLKROTATIONAL = 0x127e BLKRRPART = 0x125f BLKSECDISCARD = 0x127d BLKSECTGET = 0x1267 BLKSECTSET = 0x1266 BLKSSZGET = 0x1268 BLKZEROOUT = 0x127f BOTHER = 0x1000 BS1 = 0x2000 BSDLY = 0x2000 CBAUD = 0x100f CBAUDEX = 0x1000 CIBAUD = 0x100f0000 CLOCAL = 0x800 CR1 = 0x200 CR2 = 0x400 CR3 = 0x600 CRDLY = 0x600 CREAD = 0x80 CS6 = 0x10 CS7 = 0x20 CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 DM_MPATH_PROBE_PATHS = 0xfd12 ECCGETLAYOUT = 0x81484d11 ECCGETSTATS = 0x80104d12 ECHOCTL = 0x200 ECHOE = 0x10 ECHOK = 0x20 ECHOKE = 0x800 ECHONL = 0x40 ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 EPIOCGPARAMS = 0x80088a02 EPIOCSPARAMS = 0x40088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 FFDLY = 0x8000 FICLONE = 0x40049409 FICLONERANGE = 0x4020940d FLUSHO = 0x1000 FS_IOC_ENABLE_VERITY = 0x40806685 FS_IOC_GETFLAGS = 0x80086601 FS_IOC_GET_ENCRYPTION_NONCE = 0x8010661b FS_IOC_GET_ENCRYPTION_POLICY = 0x400c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x40106614 FS_IOC_SETFLAGS = 0x40086602 FS_IOC_SET_ENCRYPTION_POLICY = 0x800c6613 F_GETLK = 0x5 F_GETLK64 = 0x5 F_GETOWN = 0x9 F_RDLCK = 0x0 F_SETLK = 0x6 F_SETLK64 = 0x6 F_SETLKW = 0x7 F_SETLKW64 = 0x7 F_SETOWN = 0x8 F_UNLCK = 0x2 F_WRLCK = 0x1 HIDIOCGRAWINFO = 0x80084803 HIDIOCGRDESC = 0x90044802 HIDIOCGRDESCSIZE = 0x80044801 HIDIOCREVOKE = 0x4004480d HUPCL = 0x400 ICANON = 0x2 IEXTEN = 0x8000 IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x800 IOCTL_MEI_NOTIFY_GET = 0x80044803 IOCTL_MEI_NOTIFY_SET = 0x40044802 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x7b9 IPV6_FLOWINFO_MASK = 0xfffffff IPV6_FLOWLABEL_MASK = 0xfffff ISIG = 0x1 IUCLC = 0x200 IXOFF = 0x1000 IXON = 0x400 MAP_ANON = 0x20 MAP_ANONYMOUS = 0x20 MAP_DENYWRITE = 0x800 MAP_EXECUTABLE = 0x1000 MAP_GROWSDOWN = 0x100 MAP_HUGETLB = 0x40000 MAP_LOCKED = 0x2000 MAP_NONBLOCK = 0x10000 MAP_NORESERVE = 0x4000 MAP_POPULATE = 0x8000 MAP_STACK = 0x20000 MAP_SYNC = 0x80000 MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MCL_ONFAULT = 0x4 MEMERASE = 0x40084d02 MEMERASE64 = 0x40104d14 MEMGETBADBLOCK = 0x40084d0b MEMGETINFO = 0x80204d01 MEMGETOOBSEL = 0x80c84d0a MEMGETREGIONCOUNT = 0x80044d07 MEMISLOCKED = 0x80084d17 MEMLOCK = 0x40084d05 MEMREAD = 0xc0404d1a MEMREADOOB = 0xc0104d04 MEMSETBADBLOCK = 0x40084d0c MEMUNLOCK = 0x40084d06 MEMWRITEOOB = 0xc0104d03 MTDFILEMODE = 0x4d13 NFDBITS = 0x40 NLDLY = 0x100 NOFLSH = 0x80 NS_GET_MNTNS_ID = 0x8008b705 NS_GET_NSTYPE = 0xb703 NS_GET_OWNER_UID = 0xb704 NS_GET_PARENT = 0xb702 NS_GET_PID_FROM_PIDNS = 0x8004b706 NS_GET_PID_IN_PIDNS = 0x8004b708 NS_GET_TGID_FROM_PIDNS = 0x8004b707 NS_GET_TGID_IN_PIDNS = 0x8004b709 NS_GET_USERNS = 0xb701 OLCUC = 0x2 ONLCR = 0x4 OTPERASE = 0x400c4d19 OTPGETREGIONCOUNT = 0x40044d0e OTPGETREGIONINFO = 0x400c4d0f OTPLOCK = 0x800c4d10 OTPSELECT = 0x80044d0d O_APPEND = 0x400 O_ASYNC = 0x2000 O_CLOEXEC = 0x80000 O_CREAT = 0x40 O_DIRECT = 0x4000 O_DIRECTORY = 0x10000 O_DSYNC = 0x1000 O_EXCL = 0x80 O_FSYNC = 0x101000 O_LARGEFILE = 0x0 O_NDELAY = 0x800 O_NOATIME = 0x40000 O_NOCTTY = 0x100 O_NOFOLLOW = 0x20000 O_NONBLOCK = 0x800 O_PATH = 0x200000 O_RSYNC = 0x101000 O_SYNC = 0x101000 O_TMPFILE = 0x410000 O_TRUNC = 0x200 PARENB = 0x100 PARODD = 0x200 PENDIN = 0x4000 PERF_EVENT_IOC_DISABLE = 0x2401 PERF_EVENT_IOC_ENABLE = 0x2400 PERF_EVENT_IOC_ID = 0x80082407 PERF_EVENT_IOC_MODIFY_ATTRIBUTES = 0x4008240b PERF_EVENT_IOC_PAUSE_OUTPUT = 0x40042409 PERF_EVENT_IOC_PERIOD = 0x40082404 PERF_EVENT_IOC_QUERY_BPF = 0xc008240a PERF_EVENT_IOC_REFRESH = 0x2402 PERF_EVENT_IOC_RESET = 0x2403 PERF_EVENT_IOC_SET_BPF = 0x40042408 PERF_EVENT_IOC_SET_FILTER = 0x40082406 PERF_EVENT_IOC_SET_OUTPUT = 0x2405 PPPIOCATTACH = 0x4004743d PPPIOCATTCHAN = 0x40047438 PPPIOCBRIDGECHAN = 0x40047435 PPPIOCCONNECT = 0x4004743a PPPIOCDETACH = 0x4004743c PPPIOCDISCONN = 0x7439 PPPIOCGASYNCMAP = 0x80047458 PPPIOCGCHAN = 0x80047437 PPPIOCGDEBUG = 0x80047441 PPPIOCGFLAGS = 0x8004745a PPPIOCGIDLE = 0x8010743f PPPIOCGIDLE32 = 0x8008743f PPPIOCGIDLE64 = 0x8010743f PPPIOCGL2TPSTATS = 0x80487436 PPPIOCGMRU = 0x80047453 PPPIOCGRASYNCMAP = 0x80047455 PPPIOCGUNIT = 0x80047456 PPPIOCGXASYNCMAP = 0x80207450 PPPIOCSACTIVE = 0x40107446 PPPIOCSASYNCMAP = 0x40047457 PPPIOCSCOMPRESS = 0x4010744d PPPIOCSDEBUG = 0x40047440 PPPIOCSFLAGS = 0x40047459 PPPIOCSMAXCID = 0x40047451 PPPIOCSMRRU = 0x4004743b PPPIOCSMRU = 0x40047452 PPPIOCSNPMODE = 0x4008744b PPPIOCSPASS = 0x40107447 PPPIOCSRASYNCMAP = 0x40047454 PPPIOCSXASYNCMAP = 0x4020744f PPPIOCUNBRIDGECHAN = 0x7434 PPPIOCXFERUNIT = 0x744e PR_SET_PTRACER_ANY = 0xffffffffffffffff PTP_CLOCK_GETCAPS = 0x80503d01 PTP_CLOCK_GETCAPS2 = 0x80503d0a PTP_ENABLE_PPS = 0x40043d04 PTP_ENABLE_PPS2 = 0x40043d0d PTP_EXTTS_REQUEST = 0x40103d02 PTP_EXTTS_REQUEST2 = 0x40103d0b PTP_MASK_CLEAR_ALL = 0x3d13 PTP_MASK_EN_SINGLE = 0x40043d14 PTP_PEROUT_REQUEST = 0x40383d03 PTP_PEROUT_REQUEST2 = 0x40383d0c PTP_PIN_SETFUNC = 0x40603d07 PTP_PIN_SETFUNC2 = 0x40603d10 PTP_SYS_OFFSET = 0x43403d05 PTP_SYS_OFFSET2 = 0x43403d0e PTRACE_DISABLE_TE = 0x5010 PTRACE_ENABLE_TE = 0x5009 PTRACE_GET_LAST_BREAK = 0x5006 PTRACE_OLDSETOPTIONS = 0x15 PTRACE_PEEKDATA_AREA = 0x5003 PTRACE_PEEKTEXT_AREA = 0x5002 PTRACE_PEEKUSR_AREA = 0x5000 PTRACE_PEEK_SYSTEM_CALL = 0x5007 PTRACE_POKEDATA_AREA = 0x5005 PTRACE_POKETEXT_AREA = 0x5004 PTRACE_POKEUSR_AREA = 0x5001 PTRACE_POKE_SYSTEM_CALL = 0x5008 PTRACE_PROT = 0x15 PTRACE_SINGLEBLOCK = 0xc PTRACE_SYSEMU = 0x1f PTRACE_SYSEMU_SINGLESTEP = 0x20 PTRACE_TE_ABORT_RAND = 0x5011 PT_ACR0 = 0x90 PT_ACR1 = 0x94 PT_ACR10 = 0xb8 PT_ACR11 = 0xbc PT_ACR12 = 0xc0 PT_ACR13 = 0xc4 PT_ACR14 = 0xc8 PT_ACR15 = 0xcc PT_ACR2 = 0x98 PT_ACR3 = 0x9c PT_ACR4 = 0xa0 PT_ACR5 = 0xa4 PT_ACR6 = 0xa8 PT_ACR7 = 0xac PT_ACR8 = 0xb0 PT_ACR9 = 0xb4 PT_CR_10 = 0x168 PT_CR_11 = 0x170 PT_CR_9 = 0x160 PT_ENDREGS = 0x1af PT_FPC = 0xd8 PT_FPR0 = 0xe0 PT_FPR1 = 0xe8 PT_FPR10 = 0x130 PT_FPR11 = 0x138 PT_FPR12 = 0x140 PT_FPR13 = 0x148 PT_FPR14 = 0x150 PT_FPR15 = 0x158 PT_FPR2 = 0xf0 PT_FPR3 = 0xf8 PT_FPR4 = 0x100 PT_FPR5 = 0x108 PT_FPR6 = 0x110 PT_FPR7 = 0x118 PT_FPR8 = 0x120 PT_FPR9 = 0x128 PT_GPR0 = 0x10 PT_GPR1 = 0x18 PT_GPR10 = 0x60 PT_GPR11 = 0x68 PT_GPR12 = 0x70 PT_GPR13 = 0x78 PT_GPR14 = 0x80 PT_GPR15 = 0x88 PT_GPR2 = 0x20 PT_GPR3 = 0x28 PT_GPR4 = 0x30 PT_GPR5 = 0x38 PT_GPR6 = 0x40 PT_GPR7 = 0x48 PT_GPR8 = 0x50 PT_GPR9 = 0x58 PT_IEEE_IP = 0x1a8 PT_LASTOFF = 0x1a8 PT_ORIGGPR2 = 0xd0 PT_PSWADDR = 0x8 PT_PSWMASK = 0x0 RLIMIT_AS = 0x9 RLIMIT_MEMLOCK = 0x8 RLIMIT_NOFILE = 0x7 RLIMIT_NPROC = 0x6 RLIMIT_RSS = 0x5 RNDADDENTROPY = 0x40085203 RNDADDTOENTCNT = 0x40045201 RNDCLEARPOOL = 0x5206 RNDGETENTCNT = 0x80045200 RNDGETPOOL = 0x80085202 RNDRESEEDCRNG = 0x5207 RNDZAPENTCNT = 0x5204 RTC_AIE_OFF = 0x7002 RTC_AIE_ON = 0x7001 RTC_ALM_READ = 0x80247008 RTC_ALM_SET = 0x40247007 RTC_EPOCH_READ = 0x8008700d RTC_EPOCH_SET = 0x4008700e RTC_IRQP_READ = 0x8008700b RTC_IRQP_SET = 0x4008700c RTC_PARAM_GET = 0x40187013 RTC_PARAM_SET = 0x40187014 RTC_PIE_OFF = 0x7006 RTC_PIE_ON = 0x7005 RTC_PLL_GET = 0x80207011 RTC_PLL_SET = 0x40207012 RTC_RD_TIME = 0x80247009 RTC_SET_TIME = 0x4024700a RTC_UIE_OFF = 0x7004 RTC_UIE_ON = 0x7003 RTC_VL_CLR = 0x7014 RTC_VL_READ = 0x80047013 RTC_WIE_OFF = 0x7010 RTC_WIE_ON = 0x700f RTC_WKALM_RD = 0x80287010 RTC_WKALM_SET = 0x4028700f SCM_DEVMEM_DMABUF = 0x4f SCM_DEVMEM_LINEAR = 0x4e SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a SCM_TIMESTAMPNS = 0x23 SCM_TS_OPT_ID = 0x51 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 SECCOMP_IOCTL_NOTIF_ADDFD = 0x40182103 SECCOMP_IOCTL_NOTIF_ID_VALID = 0x40082102 SECCOMP_IOCTL_NOTIF_SET_FLAGS = 0x40082104 SFD_CLOEXEC = 0x80000 SFD_NONBLOCK = 0x800 SIOCATMARK = 0x8905 SIOCGPGRP = 0x8904 SIOCGSTAMPNS_NEW = 0x80108907 SIOCGSTAMP_NEW = 0x80108906 SIOCINQ = 0x541b SIOCOUTQ = 0x5411 SIOCSPGRP = 0x8902 SOCK_CLOEXEC = 0x80000 SOCK_DGRAM = 0x2 SOCK_NONBLOCK = 0x800 SOCK_STREAM = 0x1 SOL_SOCKET = 0x1 SO_ACCEPTCONN = 0x1e SO_ATTACH_BPF = 0x32 SO_ATTACH_REUSEPORT_CBPF = 0x33 SO_ATTACH_REUSEPORT_EBPF = 0x34 SO_BINDTODEVICE = 0x19 SO_BINDTOIFINDEX = 0x3e SO_BPF_EXTENSIONS = 0x30 SO_BROADCAST = 0x6 SO_BSDCOMPAT = 0xe SO_BUF_LOCK = 0x48 SO_BUSY_POLL = 0x2e SO_BUSY_POLL_BUDGET = 0x46 SO_CNX_ADVICE = 0x35 SO_COOKIE = 0x39 SO_DETACH_REUSEPORT_BPF = 0x44 SO_DEVMEM_DMABUF = 0x4f SO_DEVMEM_DONTNEED = 0x50 SO_DEVMEM_LINEAR = 0x4e SO_DOMAIN = 0x27 SO_DONTROUTE = 0x5 SO_ERROR = 0x4 SO_INCOMING_CPU = 0x31 SO_INCOMING_NAPI_ID = 0x38 SO_KEEPALIVE = 0x9 SO_LINGER = 0xd SO_LOCK_FILTER = 0x2c SO_MARK = 0x24 SO_MAX_PACING_RATE = 0x2f SO_MEMINFO = 0x37 SO_NETNS_COOKIE = 0x47 SO_NOFCS = 0x2b SO_OOBINLINE = 0xa SO_PASSCRED = 0x10 SO_PASSPIDFD = 0x4c SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x11 SO_PEERGROUPS = 0x3b SO_PEERPIDFD = 0x4d SO_PEERSEC = 0x1f SO_PREFER_BUSY_POLL = 0x45 SO_PROTOCOL = 0x26 SO_RCVBUF = 0x8 SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x12 SO_RCVMARK = 0x4b SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x14 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x14 SO_RESERVE_MEM = 0x49 SO_REUSEADDR = 0x2 SO_REUSEPORT = 0xf SO_RXQ_OVFL = 0x28 SO_SECURITY_AUTHENTICATION = 0x16 SO_SECURITY_ENCRYPTION_NETWORK = 0x18 SO_SECURITY_ENCRYPTION_TRANSPORT = 0x17 SO_SELECT_ERR_QUEUE = 0x2d SO_SNDBUF = 0x7 SO_SNDBUFFORCE = 0x20 SO_SNDLOWAT = 0x13 SO_SNDTIMEO = 0x15 SO_SNDTIMEO_NEW = 0x43 SO_SNDTIMEO_OLD = 0x15 SO_TIMESTAMPING = 0x25 SO_TIMESTAMPING_NEW = 0x41 SO_TIMESTAMPING_OLD = 0x25 SO_TIMESTAMPNS = 0x23 SO_TIMESTAMPNS_NEW = 0x40 SO_TIMESTAMPNS_OLD = 0x23 SO_TIMESTAMP_NEW = 0x3f SO_TXREHASH = 0x4a SO_TXTIME = 0x3d SO_TYPE = 0x3 SO_WIFI_STATUS = 0x29 SO_ZEROCOPY = 0x3c TAB1 = 0x800 TAB2 = 0x1000 TAB3 = 0x1800 TABDLY = 0x1800 TCFLSH = 0x540b TCGETA = 0x5405 TCGETS = 0x5401 TCGETS2 = 0x802c542a TCGETX = 0x5432 TCSAFLUSH = 0x2 TCSBRK = 0x5409 TCSBRKP = 0x5425 TCSETA = 0x5406 TCSETAF = 0x5408 TCSETAW = 0x5407 TCSETS = 0x5402 TCSETS2 = 0x402c542b TCSETSF = 0x5404 TCSETSF2 = 0x402c542d TCSETSW = 0x5403 TCSETSW2 = 0x402c542c TCSETX = 0x5433 TCSETXF = 0x5434 TCSETXW = 0x5435 TCXONC = 0x540a TFD_CLOEXEC = 0x80000 TFD_NONBLOCK = 0x800 TIOCCBRK = 0x5428 TIOCCONS = 0x541d TIOCEXCL = 0x540c TIOCGDEV = 0x80045432 TIOCGETD = 0x5424 TIOCGEXCL = 0x80045440 TIOCGICOUNT = 0x545d TIOCGISO7816 = 0x80285442 TIOCGLCKTRMIOS = 0x5456 TIOCGPGRP = 0x540f TIOCGPKT = 0x80045438 TIOCGPTLCK = 0x80045439 TIOCGPTN = 0x80045430 TIOCGPTPEER = 0x5441 TIOCGRS485 = 0x542e TIOCGSERIAL = 0x541e TIOCGSID = 0x5429 TIOCGSOFTCAR = 0x5419 TIOCGWINSZ = 0x5413 TIOCINQ = 0x541b TIOCLINUX = 0x541c TIOCMBIC = 0x5417 TIOCMBIS = 0x5416 TIOCMGET = 0x5415 TIOCMIWAIT = 0x545c TIOCMSET = 0x5418 TIOCM_CAR = 0x40 TIOCM_CD = 0x40 TIOCM_CTS = 0x20 TIOCM_DSR = 0x100 TIOCM_RI = 0x80 TIOCM_RNG = 0x80 TIOCM_SR = 0x10 TIOCM_ST = 0x8 TIOCNOTTY = 0x5422 TIOCNXCL = 0x540d TIOCOUTQ = 0x5411 TIOCPKT = 0x5420 TIOCSBRK = 0x5427 TIOCSCTTY = 0x540e TIOCSERCONFIG = 0x5453 TIOCSERGETLSR = 0x5459 TIOCSERGETMULTI = 0x545a TIOCSERGSTRUCT = 0x5458 TIOCSERGWILD = 0x5454 TIOCSERSETMULTI = 0x545b TIOCSERSWILD = 0x5455 TIOCSER_TEMT = 0x1 TIOCSETD = 0x5423 TIOCSIG = 0x40045436 TIOCSISO7816 = 0xc0285443 TIOCSLCKTRMIOS = 0x5457 TIOCSPGRP = 0x5410 TIOCSPTLCK = 0x40045431 TIOCSRS485 = 0x542f TIOCSSERIAL = 0x541f TIOCSSOFTCAR = 0x541a TIOCSTI = 0x5412 TIOCSWINSZ = 0x5414 TIOCVHANGUP = 0x5437 TOSTOP = 0x100 TUNATTACHFILTER = 0x401054d5 TUNDETACHFILTER = 0x401054d6 TUNGETDEVNETNS = 0x54e3 TUNGETFEATURES = 0x800454cf TUNGETFILTER = 0x801054db TUNGETIFF = 0x800454d2 TUNGETSNDBUF = 0x800454d3 TUNGETVNETBE = 0x800454df TUNGETVNETHDRSZ = 0x800454d7 TUNGETVNETLE = 0x800454dd TUNSETCARRIER = 0x400454e2 TUNSETDEBUG = 0x400454c9 TUNSETFILTEREBPF = 0x800454e1 TUNSETGROUP = 0x400454ce TUNSETIFF = 0x400454ca TUNSETIFINDEX = 0x400454da TUNSETLINK = 0x400454cd TUNSETNOCSUM = 0x400454c8 TUNSETOFFLOAD = 0x400454d0 TUNSETOWNER = 0x400454cc TUNSETPERSIST = 0x400454cb TUNSETQUEUE = 0x400454d9 TUNSETSNDBUF = 0x400454d4 TUNSETSTEERINGEBPF = 0x800454e0 TUNSETTXFILTER = 0x400454d1 TUNSETVNETBE = 0x400454de TUNSETVNETHDRSZ = 0x400454d8 TUNSETVNETLE = 0x400454dc UBI_IOCATT = 0x40186f40 UBI_IOCDET = 0x40046f41 UBI_IOCEBCH = 0x40044f02 UBI_IOCEBER = 0x40044f01 UBI_IOCEBISMAP = 0x80044f05 UBI_IOCEBMAP = 0x40084f03 UBI_IOCEBUNMAP = 0x40044f04 UBI_IOCMKVOL = 0x40986f00 UBI_IOCRMVOL = 0x40046f01 UBI_IOCRNVOL = 0x51106f03 UBI_IOCRPEB = 0x40046f04 UBI_IOCRSVOL = 0x400c6f02 UBI_IOCSETVOLPROP = 0x40104f06 UBI_IOCSPEB = 0x40046f05 UBI_IOCVOLCRBLK = 0x40804f07 UBI_IOCVOLRMBLK = 0x4f08 UBI_IOCVOLUP = 0x40084f00 VDISCARD = 0xd VEOF = 0x4 VEOL = 0xb VEOL2 = 0x10 VMIN = 0x6 VREPRINT = 0xc VSTART = 0x8 VSTOP = 0x9 VSUSP = 0xa VSWTC = 0x7 VT1 = 0x4000 VTDLY = 0x4000 VTIME = 0x5 VWERASE = 0xe WDIOC_GETBOOTSTATUS = 0x80045702 WDIOC_GETPRETIMEOUT = 0x80045709 WDIOC_GETSTATUS = 0x80045701 WDIOC_GETSUPPORT = 0x80285700 WDIOC_GETTEMP = 0x80045703 WDIOC_GETTIMELEFT = 0x8004570a WDIOC_GETTIMEOUT = 0x80045707 WDIOC_KEEPALIVE = 0x80045705 WDIOC_SETOPTIONS = 0x80045704 WORDSIZE = 0x40 XCASE = 0x4 XTABS = 0x1800 _HIDIOCGRAWNAME = 0x80804804 _HIDIOCGRAWPHYS = 0x80404805 _HIDIOCGRAWUNIQ = 0x80404808 ) // Errors const ( EADDRINUSE = syscall.Errno(0x62) EADDRNOTAVAIL = syscall.Errno(0x63) EADV = syscall.Errno(0x44) EAFNOSUPPORT = syscall.Errno(0x61) EALREADY = syscall.Errno(0x72) EBADE = syscall.Errno(0x34) EBADFD = syscall.Errno(0x4d) EBADMSG = syscall.Errno(0x4a) EBADR = syscall.Errno(0x35) EBADRQC = syscall.Errno(0x38) EBADSLT = syscall.Errno(0x39) EBFONT = syscall.Errno(0x3b) ECANCELED = syscall.Errno(0x7d) ECHRNG = syscall.Errno(0x2c) ECOMM = syscall.Errno(0x46) ECONNABORTED = syscall.Errno(0x67) ECONNREFUSED = syscall.Errno(0x6f) ECONNRESET = syscall.Errno(0x68) EDEADLK = syscall.Errno(0x23) EDEADLOCK = syscall.Errno(0x23) EDESTADDRREQ = syscall.Errno(0x59) EDOTDOT = syscall.Errno(0x49) EDQUOT = syscall.Errno(0x7a) EHOSTDOWN = syscall.Errno(0x70) EHOSTUNREACH = syscall.Errno(0x71) EHWPOISON = syscall.Errno(0x85) EIDRM = syscall.Errno(0x2b) EILSEQ = syscall.Errno(0x54) EINPROGRESS = syscall.Errno(0x73) EISCONN = syscall.Errno(0x6a) EISNAM = syscall.Errno(0x78) EKEYEXPIRED = syscall.Errno(0x7f) EKEYREJECTED = syscall.Errno(0x81) EKEYREVOKED = syscall.Errno(0x80) EL2HLT = syscall.Errno(0x33) EL2NSYNC = syscall.Errno(0x2d) EL3HLT = syscall.Errno(0x2e) EL3RST = syscall.Errno(0x2f) ELIBACC = syscall.Errno(0x4f) ELIBBAD = syscall.Errno(0x50) ELIBEXEC = syscall.Errno(0x53) ELIBMAX = syscall.Errno(0x52) ELIBSCN = syscall.Errno(0x51) ELNRNG = syscall.Errno(0x30) ELOOP = syscall.Errno(0x28) EMEDIUMTYPE = syscall.Errno(0x7c) EMSGSIZE = syscall.Errno(0x5a) EMULTIHOP = syscall.Errno(0x48) ENAMETOOLONG = syscall.Errno(0x24) ENAVAIL = syscall.Errno(0x77) ENETDOWN = syscall.Errno(0x64) ENETRESET = syscall.Errno(0x66) ENETUNREACH = syscall.Errno(0x65) ENOANO = syscall.Errno(0x37) ENOBUFS = syscall.Errno(0x69) ENOCSI = syscall.Errno(0x32) ENODATA = syscall.Errno(0x3d) ENOKEY = syscall.Errno(0x7e) ENOLCK = syscall.Errno(0x25) ENOLINK = syscall.Errno(0x43) ENOMEDIUM = syscall.Errno(0x7b) ENOMSG = syscall.Errno(0x2a) ENONET = syscall.Errno(0x40) ENOPKG = syscall.Errno(0x41) ENOPROTOOPT = syscall.Errno(0x5c) ENOSR = syscall.Errno(0x3f) ENOSTR = syscall.Errno(0x3c) ENOSYS = syscall.Errno(0x26) ENOTCONN = syscall.Errno(0x6b) ENOTEMPTY = syscall.Errno(0x27) ENOTNAM = syscall.Errno(0x76) ENOTRECOVERABLE = syscall.Errno(0x83) ENOTSOCK = syscall.Errno(0x58) ENOTSUP = syscall.Errno(0x5f) ENOTUNIQ = syscall.Errno(0x4c) EOPNOTSUPP = syscall.Errno(0x5f) EOVERFLOW = syscall.Errno(0x4b) EOWNERDEAD = syscall.Errno(0x82) EPFNOSUPPORT = syscall.Errno(0x60) EPROTO = syscall.Errno(0x47) EPROTONOSUPPORT = syscall.Errno(0x5d) EPROTOTYPE = syscall.Errno(0x5b) EREMCHG = syscall.Errno(0x4e) EREMOTE = syscall.Errno(0x42) EREMOTEIO = syscall.Errno(0x79) ERESTART = syscall.Errno(0x55) ERFKILL = syscall.Errno(0x84) ESHUTDOWN = syscall.Errno(0x6c) ESOCKTNOSUPPORT = syscall.Errno(0x5e) ESRMNT = syscall.Errno(0x45) ESTALE = syscall.Errno(0x74) ESTRPIPE = syscall.Errno(0x56) ETIME = syscall.Errno(0x3e) ETIMEDOUT = syscall.Errno(0x6e) ETOOMANYREFS = syscall.Errno(0x6d) EUCLEAN = syscall.Errno(0x75) EUNATCH = syscall.Errno(0x31) EUSERS = syscall.Errno(0x57) EXFULL = syscall.Errno(0x36) ) // Signals const ( SIGBUS = syscall.Signal(0x7) SIGCHLD = syscall.Signal(0x11) SIGCLD = syscall.Signal(0x11) SIGCONT = syscall.Signal(0x12) SIGIO = syscall.Signal(0x1d) SIGPOLL = syscall.Signal(0x1d) SIGPROF = syscall.Signal(0x1b) SIGPWR = syscall.Signal(0x1e) SIGSTKFLT = syscall.Signal(0x10) SIGSTOP = syscall.Signal(0x13) SIGSYS = syscall.Signal(0x1f) SIGTSTP = syscall.Signal(0x14) SIGTTIN = syscall.Signal(0x15) SIGTTOU = syscall.Signal(0x16) SIGURG = syscall.Signal(0x17) SIGUSR1 = syscall.Signal(0xa) SIGUSR2 = syscall.Signal(0xc) SIGVTALRM = syscall.Signal(0x1a) SIGWINCH = syscall.Signal(0x1c) SIGXCPU = syscall.Signal(0x18) SIGXFSZ = syscall.Signal(0x19) ) // Error table var errorList = [...]struct { num syscall.Errno name string desc string }{ {1, "EPERM", "operation not permitted"}, {2, "ENOENT", "no such file or directory"}, {3, "ESRCH", "no such process"}, {4, "EINTR", "interrupted system call"}, {5, "EIO", "input/output error"}, {6, "ENXIO", "no such device or address"}, {7, "E2BIG", "argument list too long"}, {8, "ENOEXEC", "exec format error"}, {9, "EBADF", "bad file descriptor"}, {10, "ECHILD", "no child processes"}, {11, "EAGAIN", "resource temporarily unavailable"}, {12, "ENOMEM", "cannot allocate memory"}, {13, "EACCES", "permission denied"}, {14, "EFAULT", "bad address"}, {15, "ENOTBLK", "block device required"}, {16, "EBUSY", "device or resource busy"}, {17, "EEXIST", "file exists"}, {18, "EXDEV", "invalid cross-device link"}, {19, "ENODEV", "no such device"}, {20, "ENOTDIR", "not a directory"}, {21, "EISDIR", "is a directory"}, {22, "EINVAL", "invalid argument"}, {23, "ENFILE", "too many open files in system"}, {24, "EMFILE", "too many open files"}, {25, "ENOTTY", "inappropriate ioctl for device"}, {26, "ETXTBSY", "text file busy"}, {27, "EFBIG", "file too large"}, {28, "ENOSPC", "no space left on device"}, {29, "ESPIPE", "illegal seek"}, {30, "EROFS", "read-only file system"}, {31, "EMLINK", "too many links"}, {32, "EPIPE", "broken pipe"}, {33, "EDOM", "numerical argument out of domain"}, {34, "ERANGE", "numerical result out of range"}, {35, "EDEADLK", "resource deadlock avoided"}, {36, "ENAMETOOLONG", "file name too long"}, {37, "ENOLCK", "no locks available"}, {38, "ENOSYS", "function not implemented"}, {39, "ENOTEMPTY", "directory not empty"}, {40, "ELOOP", "too many levels of symbolic links"}, {42, "ENOMSG", "no message of desired type"}, {43, "EIDRM", "identifier removed"}, {44, "ECHRNG", "channel number out of range"}, {45, "EL2NSYNC", "level 2 not synchronized"}, {46, "EL3HLT", "level 3 halted"}, {47, "EL3RST", "level 3 reset"}, {48, "ELNRNG", "link number out of range"}, {49, "EUNATCH", "protocol driver not attached"}, {50, "ENOCSI", "no CSI structure available"}, {51, "EL2HLT", "level 2 halted"}, {52, "EBADE", "invalid exchange"}, {53, "EBADR", "invalid request descriptor"}, {54, "EXFULL", "exchange full"}, {55, "ENOANO", "no anode"}, {56, "EBADRQC", "invalid request code"}, {57, "EBADSLT", "invalid slot"}, {59, "EBFONT", "bad font file format"}, {60, "ENOSTR", "device not a stream"}, {61, "ENODATA", "no data available"}, {62, "ETIME", "timer expired"}, {63, "ENOSR", "out of streams resources"}, {64, "ENONET", "machine is not on the network"}, {65, "ENOPKG", "package not installed"}, {66, "EREMOTE", "object is remote"}, {67, "ENOLINK", "link has been severed"}, {68, "EADV", "advertise error"}, {69, "ESRMNT", "srmount error"}, {70, "ECOMM", "communication error on send"}, {71, "EPROTO", "protocol error"}, {72, "EMULTIHOP", "multihop attempted"}, {73, "EDOTDOT", "RFS specific error"}, {74, "EBADMSG", "bad message"}, {75, "EOVERFLOW", "value too large for defined data type"}, {76, "ENOTUNIQ", "name not unique on network"}, {77, "EBADFD", "file descriptor in bad state"}, {78, "EREMCHG", "remote address changed"}, {79, "ELIBACC", "can not access a needed shared library"}, {80, "ELIBBAD", "accessing a corrupted shared library"}, {81, "ELIBSCN", ".lib section in a.out corrupted"}, {82, "ELIBMAX", "attempting to link in too many shared libraries"}, {83, "ELIBEXEC", "cannot exec a shared library directly"}, {84, "EILSEQ", "invalid or incomplete multibyte or wide character"}, {85, "ERESTART", "interrupted system call should be restarted"}, {86, "ESTRPIPE", "streams pipe error"}, {87, "EUSERS", "too many users"}, {88, "ENOTSOCK", "socket operation on non-socket"}, {89, "EDESTADDRREQ", "destination address required"}, {90, "EMSGSIZE", "message too long"}, {91, "EPROTOTYPE", "protocol wrong type for socket"}, {92, "ENOPROTOOPT", "protocol not available"}, {93, "EPROTONOSUPPORT", "protocol not supported"}, {94, "ESOCKTNOSUPPORT", "socket type not supported"}, {95, "ENOTSUP", "operation not supported"}, {96, "EPFNOSUPPORT", "protocol family not supported"}, {97, "EAFNOSUPPORT", "address family not supported by protocol"}, {98, "EADDRINUSE", "address already in use"}, {99, "EADDRNOTAVAIL", "cannot assign requested address"}, {100, "ENETDOWN", "network is down"}, {101, "ENETUNREACH", "network is unreachable"}, {102, "ENETRESET", "network dropped connection on reset"}, {103, "ECONNABORTED", "software caused connection abort"}, {104, "ECONNRESET", "connection reset by peer"}, {105, "ENOBUFS", "no buffer space available"}, {106, "EISCONN", "transport endpoint is already connected"}, {107, "ENOTCONN", "transport endpoint is not connected"}, {108, "ESHUTDOWN", "cannot send after transport endpoint shutdown"}, {109, "ETOOMANYREFS", "too many references: cannot splice"}, {110, "ETIMEDOUT", "connection timed out"}, {111, "ECONNREFUSED", "connection refused"}, {112, "EHOSTDOWN", "host is down"}, {113, "EHOSTUNREACH", "no route to host"}, {114, "EALREADY", "operation already in progress"}, {115, "EINPROGRESS", "operation now in progress"}, {116, "ESTALE", "stale file handle"}, {117, "EUCLEAN", "structure needs cleaning"}, {118, "ENOTNAM", "not a XENIX named type file"}, {119, "ENAVAIL", "no XENIX semaphores available"}, {120, "EISNAM", "is a named type file"}, {121, "EREMOTEIO", "remote I/O error"}, {122, "EDQUOT", "disk quota exceeded"}, {123, "ENOMEDIUM", "no medium found"}, {124, "EMEDIUMTYPE", "wrong medium type"}, {125, "ECANCELED", "operation canceled"}, {126, "ENOKEY", "required key not available"}, {127, "EKEYEXPIRED", "key has expired"}, {128, "EKEYREVOKED", "key has been revoked"}, {129, "EKEYREJECTED", "key was rejected by service"}, {130, "EOWNERDEAD", "owner died"}, {131, "ENOTRECOVERABLE", "state not recoverable"}, {132, "ERFKILL", "operation not possible due to RF-kill"}, {133, "EHWPOISON", "memory page has hardware error"}, } // Signal table var signalList = [...]struct { num syscall.Signal name string desc string }{ {1, "SIGHUP", "hangup"}, {2, "SIGINT", "interrupt"}, {3, "SIGQUIT", "quit"}, {4, "SIGILL", "illegal instruction"}, {5, "SIGTRAP", "trace/breakpoint trap"}, {6, "SIGABRT", "aborted"}, {7, "SIGBUS", "bus error"}, {8, "SIGFPE", "floating point exception"}, {9, "SIGKILL", "killed"}, {10, "SIGUSR1", "user defined signal 1"}, {11, "SIGSEGV", "segmentation fault"}, {12, "SIGUSR2", "user defined signal 2"}, {13, "SIGPIPE", "broken pipe"}, {14, "SIGALRM", "alarm clock"}, {15, "SIGTERM", "terminated"}, {16, "SIGSTKFLT", "stack fault"}, {17, "SIGCHLD", "child exited"}, {18, "SIGCONT", "continued"}, {19, "SIGSTOP", "stopped (signal)"}, {20, "SIGTSTP", "stopped"}, {21, "SIGTTIN", "stopped (tty input)"}, {22, "SIGTTOU", "stopped (tty output)"}, {23, "SIGURG", "urgent I/O condition"}, {24, "SIGXCPU", "CPU time limit exceeded"}, {25, "SIGXFSZ", "file size limit exceeded"}, {26, "SIGVTALRM", "virtual timer expired"}, {27, "SIGPROF", "profiling timer expired"}, {28, "SIGWINCH", "window changed"}, {29, "SIGIO", "I/O possible"}, {30, "SIGPWR", "power failure"}, {31, "SIGSYS", "bad system call"}, } ================================================ FILE: vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go ================================================ // mkerrors.sh -Wall -Werror -static -I/tmp/sparc64/include // Code generated by the command above; see README.md. DO NOT EDIT. //go:build sparc64 && linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -Wall -Werror -static -I/tmp/sparc64/include _const.go package unix import "syscall" const ( ASI_LEON_DFLUSH = 0x11 ASI_LEON_IFLUSH = 0x10 ASI_LEON_MMUFLUSH = 0x18 B1000000 = 0x1008 B115200 = 0x1002 B1152000 = 0x1009 B1500000 = 0x100a B2000000 = 0x100b B230400 = 0x1003 B2500000 = 0x100c B3000000 = 0x100d B3500000 = 0x100e B4000000 = 0x100f B460800 = 0x1004 B500000 = 0x1005 B57600 = 0x1001 B576000 = 0x1006 B921600 = 0x1007 BLKALIGNOFF = 0x2000127a BLKBSZGET = 0x40081270 BLKBSZSET = 0x80081271 BLKDISCARD = 0x20001277 BLKDISCARDZEROES = 0x2000127c BLKFLSBUF = 0x20001261 BLKFRAGET = 0x20001265 BLKFRASET = 0x20001264 BLKGETDISKSEQ = 0x40081280 BLKGETSIZE = 0x20001260 BLKGETSIZE64 = 0x40081272 BLKIOMIN = 0x20001278 BLKIOOPT = 0x20001279 BLKPBSZGET = 0x2000127b BLKRAGET = 0x20001263 BLKRASET = 0x20001262 BLKROGET = 0x2000125e BLKROSET = 0x2000125d BLKROTATIONAL = 0x2000127e BLKRRPART = 0x2000125f BLKSECDISCARD = 0x2000127d BLKSECTGET = 0x20001267 BLKSECTSET = 0x20001266 BLKSSZGET = 0x20001268 BLKZEROOUT = 0x2000127f BOTHER = 0x1000 BS1 = 0x2000 BSDLY = 0x2000 CBAUD = 0x100f CBAUDEX = 0x1000 CIBAUD = 0x100f0000 CLOCAL = 0x800 CR1 = 0x200 CR2 = 0x400 CR3 = 0x600 CRDLY = 0x600 CREAD = 0x80 CS6 = 0x10 CS7 = 0x20 CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 DM_MPATH_PROBE_PATHS = 0x2000fd12 ECCGETLAYOUT = 0x41484d11 ECCGETSTATS = 0x40104d12 ECHOCTL = 0x200 ECHOE = 0x10 ECHOK = 0x20 ECHOKE = 0x800 ECHONL = 0x40 ECHOPRT = 0x400 EFD_CLOEXEC = 0x400000 EFD_NONBLOCK = 0x4000 EMT_TAGOVF = 0x1 EPIOCGPARAMS = 0x40088a02 EPIOCSPARAMS = 0x80088a01 EPOLL_CLOEXEC = 0x400000 EXTPROC = 0x10000 FF1 = 0x8000 FFDLY = 0x8000 FICLONE = 0x80049409 FICLONERANGE = 0x8020940d FLUSHO = 0x1000 FS_IOC_ENABLE_VERITY = 0x80806685 FS_IOC_GETFLAGS = 0x40086601 FS_IOC_GET_ENCRYPTION_NONCE = 0x4010661b FS_IOC_GET_ENCRYPTION_POLICY = 0x800c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x80106614 FS_IOC_SETFLAGS = 0x80086602 FS_IOC_SET_ENCRYPTION_POLICY = 0x400c6613 F_GETLK = 0x7 F_GETLK64 = 0x7 F_GETOWN = 0x5 F_RDLCK = 0x1 F_SETLK = 0x8 F_SETLK64 = 0x8 F_SETLKW = 0x9 F_SETLKW64 = 0x9 F_SETOWN = 0x6 F_UNLCK = 0x3 F_WRLCK = 0x2 HIDIOCGRAWINFO = 0x40084803 HIDIOCGRDESC = 0x50044802 HIDIOCGRDESCSIZE = 0x40044801 HIDIOCREVOKE = 0x8004480d HUPCL = 0x400 ICANON = 0x2 IEXTEN = 0x8000 IN_CLOEXEC = 0x400000 IN_NONBLOCK = 0x4000 IOCTL_MEI_NOTIFY_GET = 0x40044803 IOCTL_MEI_NOTIFY_SET = 0x80044802 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x200007b9 IPV6_FLOWINFO_MASK = 0xfffffff IPV6_FLOWLABEL_MASK = 0xfffff ISIG = 0x1 IUCLC = 0x200 IXOFF = 0x1000 IXON = 0x400 MAP_ANON = 0x20 MAP_ANONYMOUS = 0x20 MAP_DENYWRITE = 0x800 MAP_EXECUTABLE = 0x1000 MAP_GROWSDOWN = 0x200 MAP_HUGETLB = 0x40000 MAP_LOCKED = 0x100 MAP_NONBLOCK = 0x10000 MAP_NORESERVE = 0x40 MAP_POPULATE = 0x8000 MAP_RENAME = 0x20 MAP_STACK = 0x20000 MAP_SYNC = 0x80000 MCL_CURRENT = 0x2000 MCL_FUTURE = 0x4000 MCL_ONFAULT = 0x8000 MEMERASE = 0x80084d02 MEMERASE64 = 0x80104d14 MEMGETBADBLOCK = 0x80084d0b MEMGETINFO = 0x40204d01 MEMGETOOBSEL = 0x40c84d0a MEMGETREGIONCOUNT = 0x40044d07 MEMISLOCKED = 0x40084d17 MEMLOCK = 0x80084d05 MEMREAD = 0xc0404d1a MEMREADOOB = 0xc0104d04 MEMSETBADBLOCK = 0x80084d0c MEMUNLOCK = 0x80084d06 MEMWRITEOOB = 0xc0104d03 MTDFILEMODE = 0x20004d13 NFDBITS = 0x40 NLDLY = 0x100 NOFLSH = 0x80 NS_GET_MNTNS_ID = 0x4008b705 NS_GET_NSTYPE = 0x2000b703 NS_GET_OWNER_UID = 0x2000b704 NS_GET_PARENT = 0x2000b702 NS_GET_PID_FROM_PIDNS = 0x4004b706 NS_GET_PID_IN_PIDNS = 0x4004b708 NS_GET_TGID_FROM_PIDNS = 0x4004b707 NS_GET_TGID_IN_PIDNS = 0x4004b709 NS_GET_USERNS = 0x2000b701 OLCUC = 0x2 ONLCR = 0x4 OTPERASE = 0x800c4d19 OTPGETREGIONCOUNT = 0x80044d0e OTPGETREGIONINFO = 0x800c4d0f OTPLOCK = 0x400c4d10 OTPSELECT = 0x40044d0d O_APPEND = 0x8 O_ASYNC = 0x40 O_CLOEXEC = 0x400000 O_CREAT = 0x200 O_DIRECT = 0x100000 O_DIRECTORY = 0x10000 O_DSYNC = 0x2000 O_EXCL = 0x800 O_FSYNC = 0x802000 O_LARGEFILE = 0x0 O_NDELAY = 0x4004 O_NOATIME = 0x200000 O_NOCTTY = 0x8000 O_NOFOLLOW = 0x20000 O_NONBLOCK = 0x4000 O_PATH = 0x1000000 O_RSYNC = 0x802000 O_SYNC = 0x802000 O_TMPFILE = 0x2010000 O_TRUNC = 0x400 PARENB = 0x100 PARODD = 0x200 PENDIN = 0x4000 PERF_EVENT_IOC_DISABLE = 0x20002401 PERF_EVENT_IOC_ENABLE = 0x20002400 PERF_EVENT_IOC_ID = 0x40082407 PERF_EVENT_IOC_MODIFY_ATTRIBUTES = 0x8008240b PERF_EVENT_IOC_PAUSE_OUTPUT = 0x80042409 PERF_EVENT_IOC_PERIOD = 0x80082404 PERF_EVENT_IOC_QUERY_BPF = 0xc008240a PERF_EVENT_IOC_REFRESH = 0x20002402 PERF_EVENT_IOC_RESET = 0x20002403 PERF_EVENT_IOC_SET_BPF = 0x80042408 PERF_EVENT_IOC_SET_FILTER = 0x80082406 PERF_EVENT_IOC_SET_OUTPUT = 0x20002405 PPPIOCATTACH = 0x8004743d PPPIOCATTCHAN = 0x80047438 PPPIOCBRIDGECHAN = 0x80047435 PPPIOCCONNECT = 0x8004743a PPPIOCDETACH = 0x8004743c PPPIOCDISCONN = 0x20007439 PPPIOCGASYNCMAP = 0x40047458 PPPIOCGCHAN = 0x40047437 PPPIOCGDEBUG = 0x40047441 PPPIOCGFLAGS = 0x4004745a PPPIOCGIDLE = 0x4010743f PPPIOCGIDLE32 = 0x4008743f PPPIOCGIDLE64 = 0x4010743f PPPIOCGL2TPSTATS = 0x40487436 PPPIOCGMRU = 0x40047453 PPPIOCGRASYNCMAP = 0x40047455 PPPIOCGUNIT = 0x40047456 PPPIOCGXASYNCMAP = 0x40207450 PPPIOCSACTIVE = 0x80107446 PPPIOCSASYNCMAP = 0x80047457 PPPIOCSCOMPRESS = 0x8010744d PPPIOCSDEBUG = 0x80047440 PPPIOCSFLAGS = 0x80047459 PPPIOCSMAXCID = 0x80047451 PPPIOCSMRRU = 0x8004743b PPPIOCSMRU = 0x80047452 PPPIOCSNPMODE = 0x8008744b PPPIOCSPASS = 0x80107447 PPPIOCSRASYNCMAP = 0x80047454 PPPIOCSXASYNCMAP = 0x8020744f PPPIOCUNBRIDGECHAN = 0x20007434 PPPIOCXFERUNIT = 0x2000744e PR_SET_PTRACER_ANY = 0xffffffffffffffff PTP_CLOCK_GETCAPS = 0x40503d01 PTP_CLOCK_GETCAPS2 = 0x40503d0a PTP_ENABLE_PPS = 0x80043d04 PTP_ENABLE_PPS2 = 0x80043d0d PTP_EXTTS_REQUEST = 0x80103d02 PTP_EXTTS_REQUEST2 = 0x80103d0b PTP_MASK_CLEAR_ALL = 0x20003d13 PTP_MASK_EN_SINGLE = 0x80043d14 PTP_PEROUT_REQUEST = 0x80383d03 PTP_PEROUT_REQUEST2 = 0x80383d0c PTP_PIN_SETFUNC = 0x80603d07 PTP_PIN_SETFUNC2 = 0x80603d10 PTP_SYS_OFFSET = 0x83403d05 PTP_SYS_OFFSET2 = 0x83403d0e PTRACE_GETFPAREGS = 0x14 PTRACE_GETFPREGS = 0xe PTRACE_GETFPREGS64 = 0x19 PTRACE_GETREGS64 = 0x16 PTRACE_READDATA = 0x10 PTRACE_READTEXT = 0x12 PTRACE_SETFPAREGS = 0x15 PTRACE_SETFPREGS = 0xf PTRACE_SETFPREGS64 = 0x1a PTRACE_SETREGS64 = 0x17 PTRACE_SPARC_DETACH = 0xb PTRACE_WRITEDATA = 0x11 PTRACE_WRITETEXT = 0x13 PT_FP = 0x48 PT_G0 = 0x10 PT_G1 = 0x14 PT_G2 = 0x18 PT_G3 = 0x1c PT_G4 = 0x20 PT_G5 = 0x24 PT_G6 = 0x28 PT_G7 = 0x2c PT_I0 = 0x30 PT_I1 = 0x34 PT_I2 = 0x38 PT_I3 = 0x3c PT_I4 = 0x40 PT_I5 = 0x44 PT_I6 = 0x48 PT_I7 = 0x4c PT_NPC = 0x8 PT_PC = 0x4 PT_PSR = 0x0 PT_REGS_MAGIC = 0x57ac6c00 PT_TNPC = 0x90 PT_TPC = 0x88 PT_TSTATE = 0x80 PT_V9_FP = 0x70 PT_V9_G0 = 0x0 PT_V9_G1 = 0x8 PT_V9_G2 = 0x10 PT_V9_G3 = 0x18 PT_V9_G4 = 0x20 PT_V9_G5 = 0x28 PT_V9_G6 = 0x30 PT_V9_G7 = 0x38 PT_V9_I0 = 0x40 PT_V9_I1 = 0x48 PT_V9_I2 = 0x50 PT_V9_I3 = 0x58 PT_V9_I4 = 0x60 PT_V9_I5 = 0x68 PT_V9_I6 = 0x70 PT_V9_I7 = 0x78 PT_V9_MAGIC = 0x9c PT_V9_TNPC = 0x90 PT_V9_TPC = 0x88 PT_V9_TSTATE = 0x80 PT_V9_Y = 0x98 PT_WIM = 0x10 PT_Y = 0xc RLIMIT_AS = 0x9 RLIMIT_MEMLOCK = 0x8 RLIMIT_NOFILE = 0x6 RLIMIT_NPROC = 0x7 RLIMIT_RSS = 0x5 RNDADDENTROPY = 0x80085203 RNDADDTOENTCNT = 0x80045201 RNDCLEARPOOL = 0x20005206 RNDGETENTCNT = 0x40045200 RNDGETPOOL = 0x40085202 RNDRESEEDCRNG = 0x20005207 RNDZAPENTCNT = 0x20005204 RTC_AIE_OFF = 0x20007002 RTC_AIE_ON = 0x20007001 RTC_ALM_READ = 0x40247008 RTC_ALM_SET = 0x80247007 RTC_EPOCH_READ = 0x4008700d RTC_EPOCH_SET = 0x8008700e RTC_IRQP_READ = 0x4008700b RTC_IRQP_SET = 0x8008700c RTC_PARAM_GET = 0x80187013 RTC_PARAM_SET = 0x80187014 RTC_PIE_OFF = 0x20007006 RTC_PIE_ON = 0x20007005 RTC_PLL_GET = 0x40207011 RTC_PLL_SET = 0x80207012 RTC_RD_TIME = 0x40247009 RTC_SET_TIME = 0x8024700a RTC_UIE_OFF = 0x20007004 RTC_UIE_ON = 0x20007003 RTC_VL_CLR = 0x20007014 RTC_VL_READ = 0x40047013 RTC_WIE_OFF = 0x20007010 RTC_WIE_ON = 0x2000700f RTC_WKALM_RD = 0x40287010 RTC_WKALM_SET = 0x8028700f SCM_DEVMEM_DMABUF = 0x58 SCM_DEVMEM_LINEAR = 0x57 SCM_TIMESTAMPING = 0x23 SCM_TIMESTAMPING_OPT_STATS = 0x38 SCM_TIMESTAMPING_PKTINFO = 0x3c SCM_TIMESTAMPNS = 0x21 SCM_TS_OPT_ID = 0x5a SCM_TXTIME = 0x3f SCM_WIFI_STATUS = 0x25 SECCOMP_IOCTL_NOTIF_ADDFD = 0x80182103 SECCOMP_IOCTL_NOTIF_ID_VALID = 0x80082102 SECCOMP_IOCTL_NOTIF_SET_FLAGS = 0x80082104 SFD_CLOEXEC = 0x400000 SFD_NONBLOCK = 0x4000 SF_FP = 0x38 SF_I0 = 0x20 SF_I1 = 0x24 SF_I2 = 0x28 SF_I3 = 0x2c SF_I4 = 0x30 SF_I5 = 0x34 SF_L0 = 0x0 SF_L1 = 0x4 SF_L2 = 0x8 SF_L3 = 0xc SF_L4 = 0x10 SF_L5 = 0x14 SF_L6 = 0x18 SF_L7 = 0x1c SF_PC = 0x3c SF_RETP = 0x40 SF_V9_FP = 0x70 SF_V9_I0 = 0x40 SF_V9_I1 = 0x48 SF_V9_I2 = 0x50 SF_V9_I3 = 0x58 SF_V9_I4 = 0x60 SF_V9_I5 = 0x68 SF_V9_L0 = 0x0 SF_V9_L1 = 0x8 SF_V9_L2 = 0x10 SF_V9_L3 = 0x18 SF_V9_L4 = 0x20 SF_V9_L5 = 0x28 SF_V9_L6 = 0x30 SF_V9_L7 = 0x38 SF_V9_PC = 0x78 SF_V9_RETP = 0x80 SF_V9_XARG0 = 0x88 SF_V9_XARG1 = 0x90 SF_V9_XARG2 = 0x98 SF_V9_XARG3 = 0xa0 SF_V9_XARG4 = 0xa8 SF_V9_XARG5 = 0xb0 SF_V9_XXARG = 0xb8 SF_XARG0 = 0x44 SF_XARG1 = 0x48 SF_XARG2 = 0x4c SF_XARG3 = 0x50 SF_XARG4 = 0x54 SF_XARG5 = 0x58 SF_XXARG = 0x5c SIOCATMARK = 0x8905 SIOCGPGRP = 0x8904 SIOCGSTAMPNS_NEW = 0x40108907 SIOCGSTAMP_NEW = 0x40108906 SIOCINQ = 0x4004667f SIOCOUTQ = 0x40047473 SIOCSPGRP = 0x8902 SOCK_CLOEXEC = 0x400000 SOCK_DGRAM = 0x2 SOCK_NONBLOCK = 0x4000 SOCK_STREAM = 0x1 SOL_SOCKET = 0xffff SO_ACCEPTCONN = 0x8000 SO_ATTACH_BPF = 0x34 SO_ATTACH_REUSEPORT_CBPF = 0x35 SO_ATTACH_REUSEPORT_EBPF = 0x36 SO_BINDTODEVICE = 0xd SO_BINDTOIFINDEX = 0x41 SO_BPF_EXTENSIONS = 0x32 SO_BROADCAST = 0x20 SO_BSDCOMPAT = 0x400 SO_BUF_LOCK = 0x51 SO_BUSY_POLL = 0x30 SO_BUSY_POLL_BUDGET = 0x49 SO_CNX_ADVICE = 0x37 SO_COOKIE = 0x3b SO_DETACH_REUSEPORT_BPF = 0x47 SO_DEVMEM_DMABUF = 0x58 SO_DEVMEM_DONTNEED = 0x59 SO_DEVMEM_LINEAR = 0x57 SO_DOMAIN = 0x1029 SO_DONTROUTE = 0x10 SO_ERROR = 0x1007 SO_INCOMING_CPU = 0x33 SO_INCOMING_NAPI_ID = 0x3a SO_KEEPALIVE = 0x8 SO_LINGER = 0x80 SO_LOCK_FILTER = 0x28 SO_MARK = 0x22 SO_MAX_PACING_RATE = 0x31 SO_MEMINFO = 0x39 SO_NETNS_COOKIE = 0x50 SO_NOFCS = 0x27 SO_OOBINLINE = 0x100 SO_PASSCRED = 0x2 SO_PASSPIDFD = 0x55 SO_PASSRIGHTS = 0x5c SO_PASSSEC = 0x1f SO_PEEK_OFF = 0x26 SO_PEERCRED = 0x40 SO_PEERGROUPS = 0x3d SO_PEERPIDFD = 0x56 SO_PEERSEC = 0x1e SO_PREFER_BUSY_POLL = 0x48 SO_PROTOCOL = 0x1028 SO_RCVBUF = 0x1002 SO_RCVBUFFORCE = 0x100b SO_RCVLOWAT = 0x800 SO_RCVMARK = 0x54 SO_RCVPRIORITY = 0x5b SO_RCVTIMEO = 0x2000 SO_RCVTIMEO_NEW = 0x44 SO_RCVTIMEO_OLD = 0x2000 SO_RESERVE_MEM = 0x52 SO_REUSEADDR = 0x4 SO_REUSEPORT = 0x200 SO_RXQ_OVFL = 0x24 SO_SECURITY_AUTHENTICATION = 0x5001 SO_SECURITY_ENCRYPTION_NETWORK = 0x5004 SO_SECURITY_ENCRYPTION_TRANSPORT = 0x5002 SO_SELECT_ERR_QUEUE = 0x29 SO_SNDBUF = 0x1001 SO_SNDBUFFORCE = 0x100a SO_SNDLOWAT = 0x1000 SO_SNDTIMEO = 0x4000 SO_SNDTIMEO_NEW = 0x45 SO_SNDTIMEO_OLD = 0x4000 SO_TIMESTAMPING = 0x23 SO_TIMESTAMPING_NEW = 0x43 SO_TIMESTAMPING_OLD = 0x23 SO_TIMESTAMPNS = 0x21 SO_TIMESTAMPNS_NEW = 0x42 SO_TIMESTAMPNS_OLD = 0x21 SO_TIMESTAMP_NEW = 0x46 SO_TXREHASH = 0x53 SO_TXTIME = 0x3f SO_TYPE = 0x1008 SO_WIFI_STATUS = 0x25 SO_ZEROCOPY = 0x3e TAB1 = 0x800 TAB2 = 0x1000 TAB3 = 0x1800 TABDLY = 0x1800 TCFLSH = 0x20005407 TCGETA = 0x40125401 TCGETS = 0x40245408 TCGETS2 = 0x402c540c TCSAFLUSH = 0x2 TCSBRK = 0x20005405 TCSBRKP = 0x5425 TCSETA = 0x80125402 TCSETAF = 0x80125404 TCSETAW = 0x80125403 TCSETS = 0x80245409 TCSETS2 = 0x802c540d TCSETSF = 0x8024540b TCSETSF2 = 0x802c540f TCSETSW = 0x8024540a TCSETSW2 = 0x802c540e TCXONC = 0x20005406 TFD_CLOEXEC = 0x400000 TFD_NONBLOCK = 0x4000 TIOCCBRK = 0x2000747a TIOCCONS = 0x20007424 TIOCEXCL = 0x2000740d TIOCGDEV = 0x40045432 TIOCGETD = 0x40047400 TIOCGEXCL = 0x40045440 TIOCGICOUNT = 0x545d TIOCGISO7816 = 0x40285443 TIOCGLCKTRMIOS = 0x5456 TIOCGPGRP = 0x40047483 TIOCGPKT = 0x40045438 TIOCGPTLCK = 0x40045439 TIOCGPTN = 0x40047486 TIOCGPTPEER = 0x20007489 TIOCGRS485 = 0x40205441 TIOCGSERIAL = 0x541e TIOCGSID = 0x40047485 TIOCGSOFTCAR = 0x40047464 TIOCGWINSZ = 0x40087468 TIOCINQ = 0x4004667f TIOCLINUX = 0x541c TIOCMBIC = 0x8004746b TIOCMBIS = 0x8004746c TIOCMGET = 0x4004746a TIOCMIWAIT = 0x545c TIOCMSET = 0x8004746d TIOCM_CAR = 0x40 TIOCM_CD = 0x40 TIOCM_CTS = 0x20 TIOCM_DSR = 0x100 TIOCM_RI = 0x80 TIOCM_RNG = 0x80 TIOCM_SR = 0x10 TIOCM_ST = 0x8 TIOCNOTTY = 0x20007471 TIOCNXCL = 0x2000740e TIOCOUTQ = 0x40047473 TIOCPKT = 0x80047470 TIOCSBRK = 0x2000747b TIOCSCTTY = 0x20007484 TIOCSERCONFIG = 0x5453 TIOCSERGETLSR = 0x5459 TIOCSERGETMULTI = 0x545a TIOCSERGSTRUCT = 0x5458 TIOCSERGWILD = 0x5454 TIOCSERSETMULTI = 0x545b TIOCSERSWILD = 0x5455 TIOCSETD = 0x80047401 TIOCSIG = 0x80047488 TIOCSISO7816 = 0xc0285444 TIOCSLCKTRMIOS = 0x5457 TIOCSPGRP = 0x80047482 TIOCSPTLCK = 0x80047487 TIOCSRS485 = 0xc0205442 TIOCSSERIAL = 0x541f TIOCSSOFTCAR = 0x80047465 TIOCSTART = 0x2000746e TIOCSTI = 0x80017472 TIOCSTOP = 0x2000746f TIOCSWINSZ = 0x80087467 TIOCVHANGUP = 0x20005437 TOSTOP = 0x100 TUNATTACHFILTER = 0x801054d5 TUNDETACHFILTER = 0x801054d6 TUNGETDEVNETNS = 0x200054e3 TUNGETFEATURES = 0x400454cf TUNGETFILTER = 0x401054db TUNGETIFF = 0x400454d2 TUNGETSNDBUF = 0x400454d3 TUNGETVNETBE = 0x400454df TUNGETVNETHDRSZ = 0x400454d7 TUNGETVNETLE = 0x400454dd TUNSETCARRIER = 0x800454e2 TUNSETDEBUG = 0x800454c9 TUNSETFILTEREBPF = 0x400454e1 TUNSETGROUP = 0x800454ce TUNSETIFF = 0x800454ca TUNSETIFINDEX = 0x800454da TUNSETLINK = 0x800454cd TUNSETNOCSUM = 0x800454c8 TUNSETOFFLOAD = 0x800454d0 TUNSETOWNER = 0x800454cc TUNSETPERSIST = 0x800454cb TUNSETQUEUE = 0x800454d9 TUNSETSNDBUF = 0x800454d4 TUNSETSTEERINGEBPF = 0x400454e0 TUNSETTXFILTER = 0x800454d1 TUNSETVNETBE = 0x800454de TUNSETVNETHDRSZ = 0x800454d8 TUNSETVNETLE = 0x800454dc UBI_IOCATT = 0x80186f40 UBI_IOCDET = 0x80046f41 UBI_IOCEBCH = 0x80044f02 UBI_IOCEBER = 0x80044f01 UBI_IOCEBISMAP = 0x40044f05 UBI_IOCEBMAP = 0x80084f03 UBI_IOCEBUNMAP = 0x80044f04 UBI_IOCMKVOL = 0x80986f00 UBI_IOCRMVOL = 0x80046f01 UBI_IOCRNVOL = 0x91106f03 UBI_IOCRPEB = 0x80046f04 UBI_IOCRSVOL = 0x800c6f02 UBI_IOCSETVOLPROP = 0x80104f06 UBI_IOCSPEB = 0x80046f05 UBI_IOCVOLCRBLK = 0x80804f07 UBI_IOCVOLRMBLK = 0x20004f08 UBI_IOCVOLUP = 0x80084f00 VDISCARD = 0xd VEOF = 0x4 VEOL = 0xb VEOL2 = 0x10 VMIN = 0x6 VREPRINT = 0xc VSTART = 0x8 VSTOP = 0x9 VSUSP = 0xa VSWTC = 0x7 VT1 = 0x4000 VTDLY = 0x4000 VTIME = 0x5 VWERASE = 0xe WDIOC_GETBOOTSTATUS = 0x40045702 WDIOC_GETPRETIMEOUT = 0x40045709 WDIOC_GETSTATUS = 0x40045701 WDIOC_GETSUPPORT = 0x40285700 WDIOC_GETTEMP = 0x40045703 WDIOC_GETTIMELEFT = 0x4004570a WDIOC_GETTIMEOUT = 0x40045707 WDIOC_KEEPALIVE = 0x40045705 WDIOC_SETOPTIONS = 0x40045704 WORDSIZE = 0x40 XCASE = 0x4 XTABS = 0x1800 _HIDIOCGRAWNAME = 0x40804804 _HIDIOCGRAWPHYS = 0x40404805 _HIDIOCGRAWUNIQ = 0x40404808 __TIOCFLUSH = 0x80047410 ) // Errors const ( EADDRINUSE = syscall.Errno(0x30) EADDRNOTAVAIL = syscall.Errno(0x31) EADV = syscall.Errno(0x53) EAFNOSUPPORT = syscall.Errno(0x2f) EALREADY = syscall.Errno(0x25) EBADE = syscall.Errno(0x66) EBADFD = syscall.Errno(0x5d) EBADMSG = syscall.Errno(0x4c) EBADR = syscall.Errno(0x67) EBADRQC = syscall.Errno(0x6a) EBADSLT = syscall.Errno(0x6b) EBFONT = syscall.Errno(0x6d) ECANCELED = syscall.Errno(0x7f) ECHRNG = syscall.Errno(0x5e) ECOMM = syscall.Errno(0x55) ECONNABORTED = syscall.Errno(0x35) ECONNREFUSED = syscall.Errno(0x3d) ECONNRESET = syscall.Errno(0x36) EDEADLK = syscall.Errno(0x4e) EDEADLOCK = syscall.Errno(0x6c) EDESTADDRREQ = syscall.Errno(0x27) EDOTDOT = syscall.Errno(0x58) EDQUOT = syscall.Errno(0x45) EHOSTDOWN = syscall.Errno(0x40) EHOSTUNREACH = syscall.Errno(0x41) EHWPOISON = syscall.Errno(0x87) EIDRM = syscall.Errno(0x4d) EILSEQ = syscall.Errno(0x7a) EINPROGRESS = syscall.Errno(0x24) EISCONN = syscall.Errno(0x38) EISNAM = syscall.Errno(0x78) EKEYEXPIRED = syscall.Errno(0x81) EKEYREJECTED = syscall.Errno(0x83) EKEYREVOKED = syscall.Errno(0x82) EL2HLT = syscall.Errno(0x65) EL2NSYNC = syscall.Errno(0x5f) EL3HLT = syscall.Errno(0x60) EL3RST = syscall.Errno(0x61) ELIBACC = syscall.Errno(0x72) ELIBBAD = syscall.Errno(0x70) ELIBEXEC = syscall.Errno(0x6e) ELIBMAX = syscall.Errno(0x7b) ELIBSCN = syscall.Errno(0x7c) ELNRNG = syscall.Errno(0x62) ELOOP = syscall.Errno(0x3e) EMEDIUMTYPE = syscall.Errno(0x7e) EMSGSIZE = syscall.Errno(0x28) EMULTIHOP = syscall.Errno(0x57) ENAMETOOLONG = syscall.Errno(0x3f) ENAVAIL = syscall.Errno(0x77) ENETDOWN = syscall.Errno(0x32) ENETRESET = syscall.Errno(0x34) ENETUNREACH = syscall.Errno(0x33) ENOANO = syscall.Errno(0x69) ENOBUFS = syscall.Errno(0x37) ENOCSI = syscall.Errno(0x64) ENODATA = syscall.Errno(0x6f) ENOKEY = syscall.Errno(0x80) ENOLCK = syscall.Errno(0x4f) ENOLINK = syscall.Errno(0x52) ENOMEDIUM = syscall.Errno(0x7d) ENOMSG = syscall.Errno(0x4b) ENONET = syscall.Errno(0x50) ENOPKG = syscall.Errno(0x71) ENOPROTOOPT = syscall.Errno(0x2a) ENOSR = syscall.Errno(0x4a) ENOSTR = syscall.Errno(0x48) ENOSYS = syscall.Errno(0x5a) ENOTCONN = syscall.Errno(0x39) ENOTEMPTY = syscall.Errno(0x42) ENOTNAM = syscall.Errno(0x76) ENOTRECOVERABLE = syscall.Errno(0x85) ENOTSOCK = syscall.Errno(0x26) ENOTSUP = syscall.Errno(0x2d) ENOTUNIQ = syscall.Errno(0x73) EOPNOTSUPP = syscall.Errno(0x2d) EOVERFLOW = syscall.Errno(0x5c) EOWNERDEAD = syscall.Errno(0x84) EPFNOSUPPORT = syscall.Errno(0x2e) EPROCLIM = syscall.Errno(0x43) EPROTO = syscall.Errno(0x56) EPROTONOSUPPORT = syscall.Errno(0x2b) EPROTOTYPE = syscall.Errno(0x29) EREMCHG = syscall.Errno(0x59) EREMOTE = syscall.Errno(0x47) EREMOTEIO = syscall.Errno(0x79) ERESTART = syscall.Errno(0x74) ERFKILL = syscall.Errno(0x86) ERREMOTE = syscall.Errno(0x51) ESHUTDOWN = syscall.Errno(0x3a) ESOCKTNOSUPPORT = syscall.Errno(0x2c) ESRMNT = syscall.Errno(0x54) ESTALE = syscall.Errno(0x46) ESTRPIPE = syscall.Errno(0x5b) ETIME = syscall.Errno(0x49) ETIMEDOUT = syscall.Errno(0x3c) ETOOMANYREFS = syscall.Errno(0x3b) EUCLEAN = syscall.Errno(0x75) EUNATCH = syscall.Errno(0x63) EUSERS = syscall.Errno(0x44) EXFULL = syscall.Errno(0x68) ) // Signals const ( SIGBUS = syscall.Signal(0xa) SIGCHLD = syscall.Signal(0x14) SIGCLD = syscall.Signal(0x14) SIGCONT = syscall.Signal(0x13) SIGEMT = syscall.Signal(0x7) SIGIO = syscall.Signal(0x17) SIGLOST = syscall.Signal(0x1d) SIGPOLL = syscall.Signal(0x17) SIGPROF = syscall.Signal(0x1b) SIGPWR = syscall.Signal(0x1d) SIGSTOP = syscall.Signal(0x11) SIGSYS = syscall.Signal(0xc) SIGTSTP = syscall.Signal(0x12) SIGTTIN = syscall.Signal(0x15) SIGTTOU = syscall.Signal(0x16) SIGURG = syscall.Signal(0x10) SIGUSR1 = syscall.Signal(0x1e) SIGUSR2 = syscall.Signal(0x1f) SIGVTALRM = syscall.Signal(0x1a) SIGWINCH = syscall.Signal(0x1c) SIGXCPU = syscall.Signal(0x18) SIGXFSZ = syscall.Signal(0x19) ) // Error table var errorList = [...]struct { num syscall.Errno name string desc string }{ {1, "EPERM", "operation not permitted"}, {2, "ENOENT", "no such file or directory"}, {3, "ESRCH", "no such process"}, {4, "EINTR", "interrupted system call"}, {5, "EIO", "input/output error"}, {6, "ENXIO", "no such device or address"}, {7, "E2BIG", "argument list too long"}, {8, "ENOEXEC", "exec format error"}, {9, "EBADF", "bad file descriptor"}, {10, "ECHILD", "no child processes"}, {11, "EAGAIN", "resource temporarily unavailable"}, {12, "ENOMEM", "cannot allocate memory"}, {13, "EACCES", "permission denied"}, {14, "EFAULT", "bad address"}, {15, "ENOTBLK", "block device required"}, {16, "EBUSY", "device or resource busy"}, {17, "EEXIST", "file exists"}, {18, "EXDEV", "invalid cross-device link"}, {19, "ENODEV", "no such device"}, {20, "ENOTDIR", "not a directory"}, {21, "EISDIR", "is a directory"}, {22, "EINVAL", "invalid argument"}, {23, "ENFILE", "too many open files in system"}, {24, "EMFILE", "too many open files"}, {25, "ENOTTY", "inappropriate ioctl for device"}, {26, "ETXTBSY", "text file busy"}, {27, "EFBIG", "file too large"}, {28, "ENOSPC", "no space left on device"}, {29, "ESPIPE", "illegal seek"}, {30, "EROFS", "read-only file system"}, {31, "EMLINK", "too many links"}, {32, "EPIPE", "broken pipe"}, {33, "EDOM", "numerical argument out of domain"}, {34, "ERANGE", "numerical result out of range"}, {36, "EINPROGRESS", "operation now in progress"}, {37, "EALREADY", "operation already in progress"}, {38, "ENOTSOCK", "socket operation on non-socket"}, {39, "EDESTADDRREQ", "destination address required"}, {40, "EMSGSIZE", "message too long"}, {41, "EPROTOTYPE", "protocol wrong type for socket"}, {42, "ENOPROTOOPT", "protocol not available"}, {43, "EPROTONOSUPPORT", "protocol not supported"}, {44, "ESOCKTNOSUPPORT", "socket type not supported"}, {45, "ENOTSUP", "operation not supported"}, {46, "EPFNOSUPPORT", "protocol family not supported"}, {47, "EAFNOSUPPORT", "address family not supported by protocol"}, {48, "EADDRINUSE", "address already in use"}, {49, "EADDRNOTAVAIL", "cannot assign requested address"}, {50, "ENETDOWN", "network is down"}, {51, "ENETUNREACH", "network is unreachable"}, {52, "ENETRESET", "network dropped connection on reset"}, {53, "ECONNABORTED", "software caused connection abort"}, {54, "ECONNRESET", "connection reset by peer"}, {55, "ENOBUFS", "no buffer space available"}, {56, "EISCONN", "transport endpoint is already connected"}, {57, "ENOTCONN", "transport endpoint is not connected"}, {58, "ESHUTDOWN", "cannot send after transport endpoint shutdown"}, {59, "ETOOMANYREFS", "too many references: cannot splice"}, {60, "ETIMEDOUT", "connection timed out"}, {61, "ECONNREFUSED", "connection refused"}, {62, "ELOOP", "too many levels of symbolic links"}, {63, "ENAMETOOLONG", "file name too long"}, {64, "EHOSTDOWN", "host is down"}, {65, "EHOSTUNREACH", "no route to host"}, {66, "ENOTEMPTY", "directory not empty"}, {67, "EPROCLIM", "too many processes"}, {68, "EUSERS", "too many users"}, {69, "EDQUOT", "disk quota exceeded"}, {70, "ESTALE", "stale file handle"}, {71, "EREMOTE", "object is remote"}, {72, "ENOSTR", "device not a stream"}, {73, "ETIME", "timer expired"}, {74, "ENOSR", "out of streams resources"}, {75, "ENOMSG", "no message of desired type"}, {76, "EBADMSG", "bad message"}, {77, "EIDRM", "identifier removed"}, {78, "EDEADLK", "resource deadlock avoided"}, {79, "ENOLCK", "no locks available"}, {80, "ENONET", "machine is not on the network"}, {81, "ERREMOTE", "unknown error 81"}, {82, "ENOLINK", "link has been severed"}, {83, "EADV", "advertise error"}, {84, "ESRMNT", "srmount error"}, {85, "ECOMM", "communication error on send"}, {86, "EPROTO", "protocol error"}, {87, "EMULTIHOP", "multihop attempted"}, {88, "EDOTDOT", "RFS specific error"}, {89, "EREMCHG", "remote address changed"}, {90, "ENOSYS", "function not implemented"}, {91, "ESTRPIPE", "streams pipe error"}, {92, "EOVERFLOW", "value too large for defined data type"}, {93, "EBADFD", "file descriptor in bad state"}, {94, "ECHRNG", "channel number out of range"}, {95, "EL2NSYNC", "level 2 not synchronized"}, {96, "EL3HLT", "level 3 halted"}, {97, "EL3RST", "level 3 reset"}, {98, "ELNRNG", "link number out of range"}, {99, "EUNATCH", "protocol driver not attached"}, {100, "ENOCSI", "no CSI structure available"}, {101, "EL2HLT", "level 2 halted"}, {102, "EBADE", "invalid exchange"}, {103, "EBADR", "invalid request descriptor"}, {104, "EXFULL", "exchange full"}, {105, "ENOANO", "no anode"}, {106, "EBADRQC", "invalid request code"}, {107, "EBADSLT", "invalid slot"}, {108, "EDEADLOCK", "file locking deadlock error"}, {109, "EBFONT", "bad font file format"}, {110, "ELIBEXEC", "cannot exec a shared library directly"}, {111, "ENODATA", "no data available"}, {112, "ELIBBAD", "accessing a corrupted shared library"}, {113, "ENOPKG", "package not installed"}, {114, "ELIBACC", "can not access a needed shared library"}, {115, "ENOTUNIQ", "name not unique on network"}, {116, "ERESTART", "interrupted system call should be restarted"}, {117, "EUCLEAN", "structure needs cleaning"}, {118, "ENOTNAM", "not a XENIX named type file"}, {119, "ENAVAIL", "no XENIX semaphores available"}, {120, "EISNAM", "is a named type file"}, {121, "EREMOTEIO", "remote I/O error"}, {122, "EILSEQ", "invalid or incomplete multibyte or wide character"}, {123, "ELIBMAX", "attempting to link in too many shared libraries"}, {124, "ELIBSCN", ".lib section in a.out corrupted"}, {125, "ENOMEDIUM", "no medium found"}, {126, "EMEDIUMTYPE", "wrong medium type"}, {127, "ECANCELED", "operation canceled"}, {128, "ENOKEY", "required key not available"}, {129, "EKEYEXPIRED", "key has expired"}, {130, "EKEYREVOKED", "key has been revoked"}, {131, "EKEYREJECTED", "key was rejected by service"}, {132, "EOWNERDEAD", "owner died"}, {133, "ENOTRECOVERABLE", "state not recoverable"}, {134, "ERFKILL", "operation not possible due to RF-kill"}, {135, "EHWPOISON", "memory page has hardware error"}, } // Signal table var signalList = [...]struct { num syscall.Signal name string desc string }{ {1, "SIGHUP", "hangup"}, {2, "SIGINT", "interrupt"}, {3, "SIGQUIT", "quit"}, {4, "SIGILL", "illegal instruction"}, {5, "SIGTRAP", "trace/breakpoint trap"}, {6, "SIGABRT", "aborted"}, {7, "SIGEMT", "EMT trap"}, {8, "SIGFPE", "floating point exception"}, {9, "SIGKILL", "killed"}, {10, "SIGBUS", "bus error"}, {11, "SIGSEGV", "segmentation fault"}, {12, "SIGSYS", "bad system call"}, {13, "SIGPIPE", "broken pipe"}, {14, "SIGALRM", "alarm clock"}, {15, "SIGTERM", "terminated"}, {16, "SIGURG", "urgent I/O condition"}, {17, "SIGSTOP", "stopped (signal)"}, {18, "SIGTSTP", "stopped"}, {19, "SIGCONT", "continued"}, {20, "SIGCHLD", "child exited"}, {21, "SIGTTIN", "stopped (tty input)"}, {22, "SIGTTOU", "stopped (tty output)"}, {23, "SIGIO", "I/O possible"}, {24, "SIGXCPU", "CPU time limit exceeded"}, {25, "SIGXFSZ", "file size limit exceeded"}, {26, "SIGVTALRM", "virtual timer expired"}, {27, "SIGPROF", "profiling timer expired"}, {28, "SIGWINCH", "window changed"}, {29, "SIGLOST", "power failure"}, {30, "SIGUSR1", "user defined signal 1"}, {31, "SIGUSR2", "user defined signal 2"}, } ================================================ FILE: vendor/golang.org/x/sys/unix/zerrors_netbsd_386.go ================================================ // mkerrors.sh -m32 // Code generated by the command above; see README.md. DO NOT EDIT. //go:build 386 && netbsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -m32 _const.go package unix import "syscall" const ( AF_APPLETALK = 0x10 AF_ARP = 0x1c AF_BLUETOOTH = 0x1f AF_CCITT = 0xa AF_CHAOS = 0x5 AF_CNT = 0x15 AF_COIP = 0x14 AF_DATAKIT = 0x9 AF_DECnet = 0xc AF_DLI = 0xd AF_E164 = 0x1a AF_ECMA = 0x8 AF_HYLINK = 0xf AF_IEEE80211 = 0x20 AF_IMPLINK = 0x3 AF_INET = 0x2 AF_INET6 = 0x18 AF_IPX = 0x17 AF_ISDN = 0x1a AF_ISO = 0x7 AF_LAT = 0xe AF_LINK = 0x12 AF_LOCAL = 0x1 AF_MAX = 0x23 AF_MPLS = 0x21 AF_NATM = 0x1b AF_NS = 0x6 AF_OROUTE = 0x11 AF_OSI = 0x7 AF_PUP = 0x4 AF_ROUTE = 0x22 AF_SNA = 0xb AF_UNIX = 0x1 AF_UNSPEC = 0x0 ARPHRD_ARCNET = 0x7 ARPHRD_ETHER = 0x1 ARPHRD_FRELAY = 0xf ARPHRD_IEEE1394 = 0x18 ARPHRD_IEEE802 = 0x6 ARPHRD_STRIP = 0x17 B0 = 0x0 B110 = 0x6e B115200 = 0x1c200 B1200 = 0x4b0 B134 = 0x86 B14400 = 0x3840 B150 = 0x96 B1800 = 0x708 B19200 = 0x4b00 B200 = 0xc8 B230400 = 0x38400 B2400 = 0x960 B28800 = 0x7080 B300 = 0x12c B38400 = 0x9600 B460800 = 0x70800 B4800 = 0x12c0 B50 = 0x32 B57600 = 0xe100 B600 = 0x258 B7200 = 0x1c20 B75 = 0x4b B76800 = 0x12c00 B921600 = 0xe1000 B9600 = 0x2580 BIOCFEEDBACK = 0x8004427d BIOCFLUSH = 0x20004268 BIOCGBLEN = 0x40044266 BIOCGDLT = 0x4004426a BIOCGDLTLIST = 0xc0084277 BIOCGETIF = 0x4090426b BIOCGFEEDBACK = 0x4004427c BIOCGHDRCMPLT = 0x40044274 BIOCGRTIMEOUT = 0x400c427b BIOCGSEESENT = 0x40044278 BIOCGSTATS = 0x4080426f BIOCGSTATSOLD = 0x4008426f BIOCIMMEDIATE = 0x80044270 BIOCPROMISC = 0x20004269 BIOCSBLEN = 0xc0044266 BIOCSDLT = 0x80044276 BIOCSETF = 0x80084267 BIOCSETIF = 0x8090426c BIOCSFEEDBACK = 0x8004427d BIOCSHDRCMPLT = 0x80044275 BIOCSRTIMEOUT = 0x800c427a BIOCSSEESENT = 0x80044279 BIOCSTCPF = 0x80084272 BIOCSUDPF = 0x80084273 BIOCVERSION = 0x40044271 BPF_A = 0x10 BPF_ABS = 0x20 BPF_ADD = 0x0 BPF_ALIGNMENT = 0x4 BPF_ALIGNMENT32 = 0x4 BPF_ALU = 0x4 BPF_AND = 0x50 BPF_B = 0x10 BPF_DFLTBUFSIZE = 0x100000 BPF_DIV = 0x30 BPF_H = 0x8 BPF_IMM = 0x0 BPF_IND = 0x40 BPF_JA = 0x0 BPF_JEQ = 0x10 BPF_JGE = 0x30 BPF_JGT = 0x20 BPF_JMP = 0x5 BPF_JSET = 0x40 BPF_K = 0x0 BPF_LD = 0x0 BPF_LDX = 0x1 BPF_LEN = 0x80 BPF_LSH = 0x60 BPF_MAJOR_VERSION = 0x1 BPF_MAXBUFSIZE = 0x1000000 BPF_MAXINSNS = 0x200 BPF_MEM = 0x60 BPF_MEMWORDS = 0x10 BPF_MINBUFSIZE = 0x20 BPF_MINOR_VERSION = 0x1 BPF_MISC = 0x7 BPF_MSH = 0xa0 BPF_MUL = 0x20 BPF_NEG = 0x80 BPF_OR = 0x40 BPF_RELEASE = 0x30bb6 BPF_RET = 0x6 BPF_RSH = 0x70 BPF_ST = 0x2 BPF_STX = 0x3 BPF_SUB = 0x10 BPF_TAX = 0x0 BPF_TXA = 0x80 BPF_W = 0x0 BPF_X = 0x8 BRKINT = 0x2 CFLUSH = 0xf CLOCAL = 0x8000 CLONE_CSIGNAL = 0xff CLONE_FILES = 0x400 CLONE_FS = 0x200 CLONE_PID = 0x1000 CLONE_PTRACE = 0x2000 CLONE_SIGHAND = 0x800 CLONE_VFORK = 0x4000 CLONE_VM = 0x100 CPUSTATES = 0x5 CP_IDLE = 0x4 CP_INTR = 0x3 CP_NICE = 0x1 CP_SYS = 0x2 CP_USER = 0x0 CREAD = 0x800 CRTSCTS = 0x10000 CS5 = 0x0 CS6 = 0x100 CS7 = 0x200 CS8 = 0x300 CSIZE = 0x300 CSTART = 0x11 CSTATUS = 0x14 CSTOP = 0x13 CSTOPB = 0x400 CSUSP = 0x1a CTL_HW = 0x6 CTL_KERN = 0x1 CTL_MAXNAME = 0xc CTL_NET = 0x4 CTL_QUERY = -0x2 DIOCBSFLUSH = 0x20006478 DLT_A429 = 0xb8 DLT_A653_ICM = 0xb9 DLT_AIRONET_HEADER = 0x78 DLT_AOS = 0xde DLT_APPLE_IP_OVER_IEEE1394 = 0x8a DLT_ARCNET = 0x7 DLT_ARCNET_LINUX = 0x81 DLT_ATM_CLIP = 0x13 DLT_ATM_RFC1483 = 0xb DLT_AURORA = 0x7e DLT_AX25 = 0x3 DLT_AX25_KISS = 0xca DLT_BACNET_MS_TP = 0xa5 DLT_BLUETOOTH_HCI_H4 = 0xbb DLT_BLUETOOTH_HCI_H4_WITH_PHDR = 0xc9 DLT_CAN20B = 0xbe DLT_CAN_SOCKETCAN = 0xe3 DLT_CHAOS = 0x5 DLT_CISCO_IOS = 0x76 DLT_C_HDLC = 0x68 DLT_C_HDLC_WITH_DIR = 0xcd DLT_DECT = 0xdd DLT_DOCSIS = 0x8f DLT_ECONET = 0x73 DLT_EN10MB = 0x1 DLT_EN3MB = 0x2 DLT_ENC = 0x6d DLT_ERF = 0xc5 DLT_ERF_ETH = 0xaf DLT_ERF_POS = 0xb0 DLT_FC_2 = 0xe0 DLT_FC_2_WITH_FRAME_DELIMS = 0xe1 DLT_FDDI = 0xa DLT_FLEXRAY = 0xd2 DLT_FRELAY = 0x6b DLT_FRELAY_WITH_DIR = 0xce DLT_GCOM_SERIAL = 0xad DLT_GCOM_T1E1 = 0xac DLT_GPF_F = 0xab DLT_GPF_T = 0xaa DLT_GPRS_LLC = 0xa9 DLT_GSMTAP_ABIS = 0xda DLT_GSMTAP_UM = 0xd9 DLT_HDLC = 0x10 DLT_HHDLC = 0x79 DLT_HIPPI = 0xf DLT_IBM_SN = 0x92 DLT_IBM_SP = 0x91 DLT_IEEE802 = 0x6 DLT_IEEE802_11 = 0x69 DLT_IEEE802_11_RADIO = 0x7f DLT_IEEE802_11_RADIO_AVS = 0xa3 DLT_IEEE802_15_4 = 0xc3 DLT_IEEE802_15_4_LINUX = 0xbf DLT_IEEE802_15_4_NONASK_PHY = 0xd7 DLT_IEEE802_16_MAC_CPS = 0xbc DLT_IEEE802_16_MAC_CPS_RADIO = 0xc1 DLT_IPMB = 0xc7 DLT_IPMB_LINUX = 0xd1 DLT_IPNET = 0xe2 DLT_IPV4 = 0xe4 DLT_IPV6 = 0xe5 DLT_IP_OVER_FC = 0x7a DLT_JUNIPER_ATM1 = 0x89 DLT_JUNIPER_ATM2 = 0x87 DLT_JUNIPER_CHDLC = 0xb5 DLT_JUNIPER_ES = 0x84 DLT_JUNIPER_ETHER = 0xb2 DLT_JUNIPER_FRELAY = 0xb4 DLT_JUNIPER_GGSN = 0x85 DLT_JUNIPER_ISM = 0xc2 DLT_JUNIPER_MFR = 0x86 DLT_JUNIPER_MLFR = 0x83 DLT_JUNIPER_MLPPP = 0x82 DLT_JUNIPER_MONITOR = 0xa4 DLT_JUNIPER_PIC_PEER = 0xae DLT_JUNIPER_PPP = 0xb3 DLT_JUNIPER_PPPOE = 0xa7 DLT_JUNIPER_PPPOE_ATM = 0xa8 DLT_JUNIPER_SERVICES = 0x88 DLT_JUNIPER_ST = 0xc8 DLT_JUNIPER_VP = 0xb7 DLT_LAPB_WITH_DIR = 0xcf DLT_LAPD = 0xcb DLT_LIN = 0xd4 DLT_LINUX_EVDEV = 0xd8 DLT_LINUX_IRDA = 0x90 DLT_LINUX_LAPD = 0xb1 DLT_LINUX_SLL = 0x71 DLT_LOOP = 0x6c DLT_LTALK = 0x72 DLT_MFR = 0xb6 DLT_MOST = 0xd3 DLT_MPLS = 0xdb DLT_MTP2 = 0x8c DLT_MTP2_WITH_PHDR = 0x8b DLT_MTP3 = 0x8d DLT_NULL = 0x0 DLT_PCI_EXP = 0x7d DLT_PFLOG = 0x75 DLT_PFSYNC = 0x12 DLT_PPI = 0xc0 DLT_PPP = 0x9 DLT_PPP_BSDOS = 0xe DLT_PPP_ETHER = 0x33 DLT_PPP_PPPD = 0xa6 DLT_PPP_SERIAL = 0x32 DLT_PPP_WITH_DIR = 0xcc DLT_PRISM_HEADER = 0x77 DLT_PRONET = 0x4 DLT_RAIF1 = 0xc6 DLT_RAW = 0xc DLT_RAWAF_MASK = 0x2240000 DLT_RIO = 0x7c DLT_SCCP = 0x8e DLT_SITA = 0xc4 DLT_SLIP = 0x8 DLT_SLIP_BSDOS = 0xd DLT_SUNATM = 0x7b DLT_SYMANTEC_FIREWALL = 0x63 DLT_TZSP = 0x80 DLT_USB = 0xba DLT_USB_LINUX = 0xbd DLT_USB_LINUX_MMAPPED = 0xdc DLT_WIHART = 0xdf DLT_X2E_SERIAL = 0xd5 DLT_X2E_XORAYA = 0xd6 DT_BLK = 0x6 DT_CHR = 0x2 DT_DIR = 0x4 DT_FIFO = 0x1 DT_LNK = 0xa DT_REG = 0x8 DT_SOCK = 0xc DT_UNKNOWN = 0x0 DT_WHT = 0xe ECHO = 0x8 ECHOCTL = 0x40 ECHOE = 0x2 ECHOK = 0x4 ECHOKE = 0x1 ECHONL = 0x10 ECHOPRT = 0x20 EMUL_LINUX = 0x1 EMUL_LINUX32 = 0x5 EMUL_MAXID = 0x6 EN_SW_CTL_INF = 0x1000 EN_SW_CTL_PREC = 0x300 EN_SW_CTL_ROUND = 0xc00 EN_SW_DATACHAIN = 0x80 EN_SW_DENORM = 0x2 EN_SW_INVOP = 0x1 EN_SW_OVERFLOW = 0x8 EN_SW_PRECLOSS = 0x20 EN_SW_UNDERFLOW = 0x10 EN_SW_ZERODIV = 0x4 ETHERCAP_JUMBO_MTU = 0x4 ETHERCAP_VLAN_HWTAGGING = 0x2 ETHERCAP_VLAN_MTU = 0x1 ETHERMIN = 0x2e ETHERMTU = 0x5dc ETHERMTU_JUMBO = 0x2328 ETHERTYPE_8023 = 0x4 ETHERTYPE_AARP = 0x80f3 ETHERTYPE_ACCTON = 0x8390 ETHERTYPE_AEONIC = 0x8036 ETHERTYPE_ALPHA = 0x814a ETHERTYPE_AMBER = 0x6008 ETHERTYPE_AMOEBA = 0x8145 ETHERTYPE_APOLLO = 0x80f7 ETHERTYPE_APOLLODOMAIN = 0x8019 ETHERTYPE_APPLETALK = 0x809b ETHERTYPE_APPLITEK = 0x80c7 ETHERTYPE_ARGONAUT = 0x803a ETHERTYPE_ARP = 0x806 ETHERTYPE_AT = 0x809b ETHERTYPE_ATALK = 0x809b ETHERTYPE_ATOMIC = 0x86df ETHERTYPE_ATT = 0x8069 ETHERTYPE_ATTSTANFORD = 0x8008 ETHERTYPE_AUTOPHON = 0x806a ETHERTYPE_AXIS = 0x8856 ETHERTYPE_BCLOOP = 0x9003 ETHERTYPE_BOFL = 0x8102 ETHERTYPE_CABLETRON = 0x7034 ETHERTYPE_CHAOS = 0x804 ETHERTYPE_COMDESIGN = 0x806c ETHERTYPE_COMPUGRAPHIC = 0x806d ETHERTYPE_COUNTERPOINT = 0x8062 ETHERTYPE_CRONUS = 0x8004 ETHERTYPE_CRONUSVLN = 0x8003 ETHERTYPE_DCA = 0x1234 ETHERTYPE_DDE = 0x807b ETHERTYPE_DEBNI = 0xaaaa ETHERTYPE_DECAM = 0x8048 ETHERTYPE_DECCUST = 0x6006 ETHERTYPE_DECDIAG = 0x6005 ETHERTYPE_DECDNS = 0x803c ETHERTYPE_DECDTS = 0x803e ETHERTYPE_DECEXPER = 0x6000 ETHERTYPE_DECLAST = 0x8041 ETHERTYPE_DECLTM = 0x803f ETHERTYPE_DECMUMPS = 0x6009 ETHERTYPE_DECNETBIOS = 0x8040 ETHERTYPE_DELTACON = 0x86de ETHERTYPE_DIDDLE = 0x4321 ETHERTYPE_DLOG1 = 0x660 ETHERTYPE_DLOG2 = 0x661 ETHERTYPE_DN = 0x6003 ETHERTYPE_DOGFIGHT = 0x1989 ETHERTYPE_DSMD = 0x8039 ETHERTYPE_ECMA = 0x803 ETHERTYPE_ENCRYPT = 0x803d ETHERTYPE_ES = 0x805d ETHERTYPE_EXCELAN = 0x8010 ETHERTYPE_EXPERDATA = 0x8049 ETHERTYPE_FLIP = 0x8146 ETHERTYPE_FLOWCONTROL = 0x8808 ETHERTYPE_FRARP = 0x808 ETHERTYPE_GENDYN = 0x8068 ETHERTYPE_HAYES = 0x8130 ETHERTYPE_HIPPI_FP = 0x8180 ETHERTYPE_HITACHI = 0x8820 ETHERTYPE_HP = 0x8005 ETHERTYPE_IEEEPUP = 0xa00 ETHERTYPE_IEEEPUPAT = 0xa01 ETHERTYPE_IMLBL = 0x4c42 ETHERTYPE_IMLBLDIAG = 0x424c ETHERTYPE_IP = 0x800 ETHERTYPE_IPAS = 0x876c ETHERTYPE_IPV6 = 0x86dd ETHERTYPE_IPX = 0x8137 ETHERTYPE_IPXNEW = 0x8037 ETHERTYPE_KALPANA = 0x8582 ETHERTYPE_LANBRIDGE = 0x8038 ETHERTYPE_LANPROBE = 0x8888 ETHERTYPE_LAT = 0x6004 ETHERTYPE_LBACK = 0x9000 ETHERTYPE_LITTLE = 0x8060 ETHERTYPE_LOGICRAFT = 0x8148 ETHERTYPE_LOOPBACK = 0x9000 ETHERTYPE_MATRA = 0x807a ETHERTYPE_MAX = 0xffff ETHERTYPE_MERIT = 0x807c ETHERTYPE_MICP = 0x873a ETHERTYPE_MOPDL = 0x6001 ETHERTYPE_MOPRC = 0x6002 ETHERTYPE_MOTOROLA = 0x818d ETHERTYPE_MPLS = 0x8847 ETHERTYPE_MPLS_MCAST = 0x8848 ETHERTYPE_MUMPS = 0x813f ETHERTYPE_NBPCC = 0x3c04 ETHERTYPE_NBPCLAIM = 0x3c09 ETHERTYPE_NBPCLREQ = 0x3c05 ETHERTYPE_NBPCLRSP = 0x3c06 ETHERTYPE_NBPCREQ = 0x3c02 ETHERTYPE_NBPCRSP = 0x3c03 ETHERTYPE_NBPDG = 0x3c07 ETHERTYPE_NBPDGB = 0x3c08 ETHERTYPE_NBPDLTE = 0x3c0a ETHERTYPE_NBPRAR = 0x3c0c ETHERTYPE_NBPRAS = 0x3c0b ETHERTYPE_NBPRST = 0x3c0d ETHERTYPE_NBPSCD = 0x3c01 ETHERTYPE_NBPVCD = 0x3c00 ETHERTYPE_NBS = 0x802 ETHERTYPE_NCD = 0x8149 ETHERTYPE_NESTAR = 0x8006 ETHERTYPE_NETBEUI = 0x8191 ETHERTYPE_NOVELL = 0x8138 ETHERTYPE_NS = 0x600 ETHERTYPE_NSAT = 0x601 ETHERTYPE_NSCOMPAT = 0x807 ETHERTYPE_NTRAILER = 0x10 ETHERTYPE_OS9 = 0x7007 ETHERTYPE_OS9NET = 0x7009 ETHERTYPE_PACER = 0x80c6 ETHERTYPE_PAE = 0x888e ETHERTYPE_PCS = 0x4242 ETHERTYPE_PLANNING = 0x8044 ETHERTYPE_PPP = 0x880b ETHERTYPE_PPPOE = 0x8864 ETHERTYPE_PPPOEDISC = 0x8863 ETHERTYPE_PRIMENTS = 0x7031 ETHERTYPE_PUP = 0x200 ETHERTYPE_PUPAT = 0x200 ETHERTYPE_RACAL = 0x7030 ETHERTYPE_RATIONAL = 0x8150 ETHERTYPE_RAWFR = 0x6559 ETHERTYPE_RCL = 0x1995 ETHERTYPE_RDP = 0x8739 ETHERTYPE_RETIX = 0x80f2 ETHERTYPE_REVARP = 0x8035 ETHERTYPE_SCA = 0x6007 ETHERTYPE_SECTRA = 0x86db ETHERTYPE_SECUREDATA = 0x876d ETHERTYPE_SGITW = 0x817e ETHERTYPE_SG_BOUNCE = 0x8016 ETHERTYPE_SG_DIAG = 0x8013 ETHERTYPE_SG_NETGAMES = 0x8014 ETHERTYPE_SG_RESV = 0x8015 ETHERTYPE_SIMNET = 0x5208 ETHERTYPE_SLOWPROTOCOLS = 0x8809 ETHERTYPE_SNA = 0x80d5 ETHERTYPE_SNMP = 0x814c ETHERTYPE_SONIX = 0xfaf5 ETHERTYPE_SPIDER = 0x809f ETHERTYPE_SPRITE = 0x500 ETHERTYPE_STP = 0x8181 ETHERTYPE_TALARIS = 0x812b ETHERTYPE_TALARISMC = 0x852b ETHERTYPE_TCPCOMP = 0x876b ETHERTYPE_TCPSM = 0x9002 ETHERTYPE_TEC = 0x814f ETHERTYPE_TIGAN = 0x802f ETHERTYPE_TRAIL = 0x1000 ETHERTYPE_TRANSETHER = 0x6558 ETHERTYPE_TYMSHARE = 0x802e ETHERTYPE_UBBST = 0x7005 ETHERTYPE_UBDEBUG = 0x900 ETHERTYPE_UBDIAGLOOP = 0x7002 ETHERTYPE_UBDL = 0x7000 ETHERTYPE_UBNIU = 0x7001 ETHERTYPE_UBNMC = 0x7003 ETHERTYPE_VALID = 0x1600 ETHERTYPE_VARIAN = 0x80dd ETHERTYPE_VAXELN = 0x803b ETHERTYPE_VEECO = 0x8067 ETHERTYPE_VEXP = 0x805b ETHERTYPE_VGLAB = 0x8131 ETHERTYPE_VINES = 0xbad ETHERTYPE_VINESECHO = 0xbaf ETHERTYPE_VINESLOOP = 0xbae ETHERTYPE_VITAL = 0xff00 ETHERTYPE_VLAN = 0x8100 ETHERTYPE_VLTLMAN = 0x8080 ETHERTYPE_VPROD = 0x805c ETHERTYPE_VURESERVED = 0x8147 ETHERTYPE_WATERLOO = 0x8130 ETHERTYPE_WELLFLEET = 0x8103 ETHERTYPE_X25 = 0x805 ETHERTYPE_X75 = 0x801 ETHERTYPE_XNSSM = 0x9001 ETHERTYPE_XTP = 0x817d ETHER_ADDR_LEN = 0x6 ETHER_CRC_LEN = 0x4 ETHER_CRC_POLY_BE = 0x4c11db6 ETHER_CRC_POLY_LE = 0xedb88320 ETHER_HDR_LEN = 0xe ETHER_MAX_LEN = 0x5ee ETHER_MAX_LEN_JUMBO = 0x233a ETHER_MIN_LEN = 0x40 ETHER_PPPOE_ENCAP_LEN = 0x8 ETHER_TYPE_LEN = 0x2 ETHER_VLAN_ENCAP_LEN = 0x4 EVFILT_AIO = 0x2 EVFILT_PROC = 0x4 EVFILT_READ = 0x0 EVFILT_SIGNAL = 0x5 EVFILT_SYSCOUNT = 0x7 EVFILT_TIMER = 0x6 EVFILT_VNODE = 0x3 EVFILT_WRITE = 0x1 EV_ADD = 0x1 EV_CLEAR = 0x20 EV_DELETE = 0x2 EV_DISABLE = 0x8 EV_ENABLE = 0x4 EV_EOF = 0x8000 EV_ERROR = 0x4000 EV_FLAG1 = 0x2000 EV_ONESHOT = 0x10 EV_SYSFLAGS = 0xf000 EXTA = 0x4b00 EXTATTR_CMD_START = 0x1 EXTATTR_CMD_STOP = 0x2 EXTATTR_NAMESPACE_SYSTEM = 0x2 EXTATTR_NAMESPACE_USER = 0x1 EXTB = 0x9600 EXTPROC = 0x800 FD_CLOEXEC = 0x1 FD_SETSIZE = 0x100 FLUSHO = 0x800000 F_CLOSEM = 0xa F_DUPFD = 0x0 F_DUPFD_CLOEXEC = 0xc F_FSCTL = -0x80000000 F_FSDIRMASK = 0x70000000 F_FSIN = 0x10000000 F_FSINOUT = 0x30000000 F_FSOUT = 0x20000000 F_FSPRIV = 0x8000 F_FSVOID = 0x40000000 F_GETFD = 0x1 F_GETFL = 0x3 F_GETLK = 0x7 F_GETNOSIGPIPE = 0xd F_GETOWN = 0x5 F_MAXFD = 0xb F_OK = 0x0 F_PARAM_MASK = 0xfff F_PARAM_MAX = 0xfff F_RDLCK = 0x1 F_SETFD = 0x2 F_SETFL = 0x4 F_SETLK = 0x8 F_SETLKW = 0x9 F_SETNOSIGPIPE = 0xe F_SETOWN = 0x6 F_UNLCK = 0x2 F_WRLCK = 0x3 HUPCL = 0x4000 HW_MACHINE = 0x1 ICANON = 0x100 ICMP6_FILTER = 0x12 ICRNL = 0x100 IEXTEN = 0x400 IFAN_ARRIVAL = 0x0 IFAN_DEPARTURE = 0x1 IFA_ROUTE = 0x1 IFF_ALLMULTI = 0x200 IFF_BROADCAST = 0x2 IFF_CANTCHANGE = 0x8f52 IFF_DEBUG = 0x4 IFF_LINK0 = 0x1000 IFF_LINK1 = 0x2000 IFF_LINK2 = 0x4000 IFF_LOOPBACK = 0x8 IFF_MULTICAST = 0x8000 IFF_NOARP = 0x80 IFF_NOTRAILERS = 0x20 IFF_OACTIVE = 0x400 IFF_POINTOPOINT = 0x10 IFF_PROMISC = 0x100 IFF_RUNNING = 0x40 IFF_SIMPLEX = 0x800 IFF_UP = 0x1 IFNAMSIZ = 0x10 IFT_1822 = 0x2 IFT_A12MPPSWITCH = 0x82 IFT_AAL2 = 0xbb IFT_AAL5 = 0x31 IFT_ADSL = 0x5e IFT_AFLANE8023 = 0x3b IFT_AFLANE8025 = 0x3c IFT_ARAP = 0x58 IFT_ARCNET = 0x23 IFT_ARCNETPLUS = 0x24 IFT_ASYNC = 0x54 IFT_ATM = 0x25 IFT_ATMDXI = 0x69 IFT_ATMFUNI = 0x6a IFT_ATMIMA = 0x6b IFT_ATMLOGICAL = 0x50 IFT_ATMRADIO = 0xbd IFT_ATMSUBINTERFACE = 0x86 IFT_ATMVCIENDPT = 0xc2 IFT_ATMVIRTUAL = 0x95 IFT_BGPPOLICYACCOUNTING = 0xa2 IFT_BRIDGE = 0xd1 IFT_BSC = 0x53 IFT_CARP = 0xf8 IFT_CCTEMUL = 0x3d IFT_CEPT = 0x13 IFT_CES = 0x85 IFT_CHANNEL = 0x46 IFT_CNR = 0x55 IFT_COFFEE = 0x84 IFT_COMPOSITELINK = 0x9b IFT_DCN = 0x8d IFT_DIGITALPOWERLINE = 0x8a IFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba IFT_DLSW = 0x4a IFT_DOCSCABLEDOWNSTREAM = 0x80 IFT_DOCSCABLEMACLAYER = 0x7f IFT_DOCSCABLEUPSTREAM = 0x81 IFT_DOCSCABLEUPSTREAMCHANNEL = 0xcd IFT_DS0 = 0x51 IFT_DS0BUNDLE = 0x52 IFT_DS1FDL = 0xaa IFT_DS3 = 0x1e IFT_DTM = 0x8c IFT_DVBASILN = 0xac IFT_DVBASIOUT = 0xad IFT_DVBRCCDOWNSTREAM = 0x93 IFT_DVBRCCMACLAYER = 0x92 IFT_DVBRCCUPSTREAM = 0x94 IFT_ECONET = 0xce IFT_EON = 0x19 IFT_EPLRS = 0x57 IFT_ESCON = 0x49 IFT_ETHER = 0x6 IFT_FAITH = 0xf2 IFT_FAST = 0x7d IFT_FASTETHER = 0x3e IFT_FASTETHERFX = 0x45 IFT_FDDI = 0xf IFT_FIBRECHANNEL = 0x38 IFT_FRAMERELAYINTERCONNECT = 0x3a IFT_FRAMERELAYMPI = 0x5c IFT_FRDLCIENDPT = 0xc1 IFT_FRELAY = 0x20 IFT_FRELAYDCE = 0x2c IFT_FRF16MFRBUNDLE = 0xa3 IFT_FRFORWARD = 0x9e IFT_G703AT2MB = 0x43 IFT_G703AT64K = 0x42 IFT_GIF = 0xf0 IFT_GIGABITETHERNET = 0x75 IFT_GR303IDT = 0xb2 IFT_GR303RDT = 0xb1 IFT_H323GATEKEEPER = 0xa4 IFT_H323PROXY = 0xa5 IFT_HDH1822 = 0x3 IFT_HDLC = 0x76 IFT_HDSL2 = 0xa8 IFT_HIPERLAN2 = 0xb7 IFT_HIPPI = 0x2f IFT_HIPPIINTERFACE = 0x39 IFT_HOSTPAD = 0x5a IFT_HSSI = 0x2e IFT_HY = 0xe IFT_IBM370PARCHAN = 0x48 IFT_IDSL = 0x9a IFT_IEEE1394 = 0x90 IFT_IEEE80211 = 0x47 IFT_IEEE80212 = 0x37 IFT_IEEE8023ADLAG = 0xa1 IFT_IFGSN = 0x91 IFT_IMT = 0xbe IFT_INFINIBAND = 0xc7 IFT_INTERLEAVE = 0x7c IFT_IP = 0x7e IFT_IPFORWARD = 0x8e IFT_IPOVERATM = 0x72 IFT_IPOVERCDLC = 0x6d IFT_IPOVERCLAW = 0x6e IFT_IPSWITCH = 0x4e IFT_ISDN = 0x3f IFT_ISDNBASIC = 0x14 IFT_ISDNPRIMARY = 0x15 IFT_ISDNS = 0x4b IFT_ISDNU = 0x4c IFT_ISO88022LLC = 0x29 IFT_ISO88023 = 0x7 IFT_ISO88024 = 0x8 IFT_ISO88025 = 0x9 IFT_ISO88025CRFPINT = 0x62 IFT_ISO88025DTR = 0x56 IFT_ISO88025FIBER = 0x73 IFT_ISO88026 = 0xa IFT_ISUP = 0xb3 IFT_L2VLAN = 0x87 IFT_L3IPVLAN = 0x88 IFT_L3IPXVLAN = 0x89 IFT_LAPB = 0x10 IFT_LAPD = 0x4d IFT_LAPF = 0x77 IFT_LINEGROUP = 0xd2 IFT_LOCALTALK = 0x2a IFT_LOOP = 0x18 IFT_MEDIAMAILOVERIP = 0x8b IFT_MFSIGLINK = 0xa7 IFT_MIOX25 = 0x26 IFT_MODEM = 0x30 IFT_MPC = 0x71 IFT_MPLS = 0xa6 IFT_MPLSTUNNEL = 0x96 IFT_MSDSL = 0x8f IFT_MVL = 0xbf IFT_MYRINET = 0x63 IFT_NFAS = 0xaf IFT_NSIP = 0x1b IFT_OPTICALCHANNEL = 0xc3 IFT_OPTICALTRANSPORT = 0xc4 IFT_OTHER = 0x1 IFT_P10 = 0xc IFT_P80 = 0xd IFT_PARA = 0x22 IFT_PFLOG = 0xf5 IFT_PFSYNC = 0xf6 IFT_PLC = 0xae IFT_PON155 = 0xcf IFT_PON622 = 0xd0 IFT_POS = 0xab IFT_PPP = 0x17 IFT_PPPMULTILINKBUNDLE = 0x6c IFT_PROPATM = 0xc5 IFT_PROPBWAP2MP = 0xb8 IFT_PROPCNLS = 0x59 IFT_PROPDOCSWIRELESSDOWNSTREAM = 0xb5 IFT_PROPDOCSWIRELESSMACLAYER = 0xb4 IFT_PROPDOCSWIRELESSUPSTREAM = 0xb6 IFT_PROPMUX = 0x36 IFT_PROPVIRTUAL = 0x35 IFT_PROPWIRELESSP2P = 0x9d IFT_PTPSERIAL = 0x16 IFT_PVC = 0xf1 IFT_Q2931 = 0xc9 IFT_QLLC = 0x44 IFT_RADIOMAC = 0xbc IFT_RADSL = 0x5f IFT_REACHDSL = 0xc0 IFT_RFC1483 = 0x9f IFT_RS232 = 0x21 IFT_RSRB = 0x4f IFT_SDLC = 0x11 IFT_SDSL = 0x60 IFT_SHDSL = 0xa9 IFT_SIP = 0x1f IFT_SIPSIG = 0xcc IFT_SIPTG = 0xcb IFT_SLIP = 0x1c IFT_SMDSDXI = 0x2b IFT_SMDSICIP = 0x34 IFT_SONET = 0x27 IFT_SONETOVERHEADCHANNEL = 0xb9 IFT_SONETPATH = 0x32 IFT_SONETVT = 0x33 IFT_SRP = 0x97 IFT_SS7SIGLINK = 0x9c IFT_STACKTOSTACK = 0x6f IFT_STARLAN = 0xb IFT_STF = 0xd7 IFT_T1 = 0x12 IFT_TDLC = 0x74 IFT_TELINK = 0xc8 IFT_TERMPAD = 0x5b IFT_TR008 = 0xb0 IFT_TRANSPHDLC = 0x7b IFT_TUNNEL = 0x83 IFT_ULTRA = 0x1d IFT_USB = 0xa0 IFT_V11 = 0x40 IFT_V35 = 0x2d IFT_V36 = 0x41 IFT_V37 = 0x78 IFT_VDSL = 0x61 IFT_VIRTUALIPADDRESS = 0x70 IFT_VIRTUALTG = 0xca IFT_VOICEDID = 0xd5 IFT_VOICEEM = 0x64 IFT_VOICEEMFGD = 0xd3 IFT_VOICEENCAP = 0x67 IFT_VOICEFGDEANA = 0xd4 IFT_VOICEFXO = 0x65 IFT_VOICEFXS = 0x66 IFT_VOICEOVERATM = 0x98 IFT_VOICEOVERCABLE = 0xc6 IFT_VOICEOVERFRAMERELAY = 0x99 IFT_VOICEOVERIP = 0x68 IFT_X213 = 0x5d IFT_X25 = 0x5 IFT_X25DDN = 0x4 IFT_X25HUNTGROUP = 0x7a IFT_X25MLP = 0x79 IFT_X25PLE = 0x28 IFT_XETHER = 0x1a IGNBRK = 0x1 IGNCR = 0x80 IGNPAR = 0x4 IMAXBEL = 0x2000 INLCR = 0x40 INPCK = 0x10 IN_CLASSA_HOST = 0xffffff IN_CLASSA_MAX = 0x80 IN_CLASSA_NET = 0xff000000 IN_CLASSA_NSHIFT = 0x18 IN_CLASSB_HOST = 0xffff IN_CLASSB_MAX = 0x10000 IN_CLASSB_NET = 0xffff0000 IN_CLASSB_NSHIFT = 0x10 IN_CLASSC_HOST = 0xff IN_CLASSC_NET = 0xffffff00 IN_CLASSC_NSHIFT = 0x8 IN_CLASSD_HOST = 0xfffffff IN_CLASSD_NET = 0xf0000000 IN_CLASSD_NSHIFT = 0x1c IN_LOOPBACKNET = 0x7f IPPROTO_AH = 0x33 IPPROTO_CARP = 0x70 IPPROTO_DONE = 0x101 IPPROTO_DSTOPTS = 0x3c IPPROTO_EGP = 0x8 IPPROTO_ENCAP = 0x62 IPPROTO_EON = 0x50 IPPROTO_ESP = 0x32 IPPROTO_ETHERIP = 0x61 IPPROTO_FRAGMENT = 0x2c IPPROTO_GGP = 0x3 IPPROTO_GRE = 0x2f IPPROTO_HOPOPTS = 0x0 IPPROTO_ICMP = 0x1 IPPROTO_ICMPV6 = 0x3a IPPROTO_IDP = 0x16 IPPROTO_IGMP = 0x2 IPPROTO_IP = 0x0 IPPROTO_IPCOMP = 0x6c IPPROTO_IPIP = 0x4 IPPROTO_IPV4 = 0x4 IPPROTO_IPV6 = 0x29 IPPROTO_IPV6_ICMP = 0x3a IPPROTO_MAX = 0x100 IPPROTO_MAXID = 0x34 IPPROTO_MOBILE = 0x37 IPPROTO_NONE = 0x3b IPPROTO_PFSYNC = 0xf0 IPPROTO_PIM = 0x67 IPPROTO_PUP = 0xc IPPROTO_RAW = 0xff IPPROTO_ROUTING = 0x2b IPPROTO_RSVP = 0x2e IPPROTO_TCP = 0x6 IPPROTO_TP = 0x1d IPPROTO_UDP = 0x11 IPPROTO_VRRP = 0x70 IPV6_CHECKSUM = 0x1a IPV6_DEFAULT_MULTICAST_HOPS = 0x1 IPV6_DEFAULT_MULTICAST_LOOP = 0x1 IPV6_DEFHLIM = 0x40 IPV6_DONTFRAG = 0x3e IPV6_DSTOPTS = 0x32 IPV6_FAITH = 0x1d IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_MASK = 0xffff0f00 IPV6_FRAGTTL = 0x78 IPV6_HLIMDEC = 0x1 IPV6_HOPLIMIT = 0x2f IPV6_HOPOPTS = 0x31 IPV6_IPSEC_POLICY = 0x1c IPV6_JOIN_GROUP = 0xc IPV6_LEAVE_GROUP = 0xd IPV6_MAXHLIM = 0xff IPV6_MAXPACKET = 0xffff IPV6_MMTU = 0x500 IPV6_MULTICAST_HOPS = 0xa IPV6_MULTICAST_IF = 0x9 IPV6_MULTICAST_LOOP = 0xb IPV6_NEXTHOP = 0x30 IPV6_PATHMTU = 0x2c IPV6_PKTINFO = 0x2e IPV6_PORTRANGE = 0xe IPV6_PORTRANGE_DEFAULT = 0x0 IPV6_PORTRANGE_HIGH = 0x1 IPV6_PORTRANGE_LOW = 0x2 IPV6_RECVDSTOPTS = 0x28 IPV6_RECVHOPLIMIT = 0x25 IPV6_RECVHOPOPTS = 0x27 IPV6_RECVPATHMTU = 0x2b IPV6_RECVPKTINFO = 0x24 IPV6_RECVRTHDR = 0x26 IPV6_RECVTCLASS = 0x39 IPV6_RTHDR = 0x33 IPV6_RTHDRDSTOPTS = 0x23 IPV6_RTHDR_LOOSE = 0x0 IPV6_RTHDR_STRICT = 0x1 IPV6_RTHDR_TYPE_0 = 0x0 IPV6_SOCKOPT_RESERVED1 = 0x3 IPV6_TCLASS = 0x3d IPV6_UNICAST_HOPS = 0x4 IPV6_USE_MIN_MTU = 0x2a IPV6_V6ONLY = 0x1b IPV6_VERSION = 0x60 IPV6_VERSION_MASK = 0xf0 IP_ADD_MEMBERSHIP = 0xc IP_DEFAULT_MULTICAST_LOOP = 0x1 IP_DEFAULT_MULTICAST_TTL = 0x1 IP_DF = 0x4000 IP_DROP_MEMBERSHIP = 0xd IP_EF = 0x8000 IP_ERRORMTU = 0x15 IP_HDRINCL = 0x2 IP_IPSEC_POLICY = 0x16 IP_MAXPACKET = 0xffff IP_MAX_MEMBERSHIPS = 0x14 IP_MF = 0x2000 IP_MINFRAGSIZE = 0x45 IP_MINTTL = 0x18 IP_MSS = 0x240 IP_MULTICAST_IF = 0x9 IP_MULTICAST_LOOP = 0xb IP_MULTICAST_TTL = 0xa IP_OFFMASK = 0x1fff IP_OPTIONS = 0x1 IP_PORTRANGE = 0x13 IP_PORTRANGE_DEFAULT = 0x0 IP_PORTRANGE_HIGH = 0x1 IP_PORTRANGE_LOW = 0x2 IP_RECVDSTADDR = 0x7 IP_RECVIF = 0x14 IP_RECVOPTS = 0x5 IP_RECVRETOPTS = 0x6 IP_RECVTTL = 0x17 IP_RETOPTS = 0x8 IP_RF = 0x8000 IP_TOS = 0x3 IP_TTL = 0x4 ISIG = 0x80 ISTRIP = 0x20 IXANY = 0x800 IXOFF = 0x400 IXON = 0x200 KERN_HOSTNAME = 0xa KERN_OSRELEASE = 0x2 KERN_OSTYPE = 0x1 KERN_VERSION = 0x4 LOCK_EX = 0x2 LOCK_NB = 0x4 LOCK_SH = 0x1 LOCK_UN = 0x8 MADV_DONTNEED = 0x4 MADV_FREE = 0x6 MADV_NORMAL = 0x0 MADV_RANDOM = 0x1 MADV_SEQUENTIAL = 0x2 MADV_SPACEAVAIL = 0x5 MADV_WILLNEED = 0x3 MAP_ALIGNMENT_16MB = 0x18000000 MAP_ALIGNMENT_1TB = 0x28000000 MAP_ALIGNMENT_256TB = 0x30000000 MAP_ALIGNMENT_4GB = 0x20000000 MAP_ALIGNMENT_64KB = 0x10000000 MAP_ALIGNMENT_64PB = 0x38000000 MAP_ALIGNMENT_MASK = -0x1000000 MAP_ALIGNMENT_SHIFT = 0x18 MAP_ANON = 0x1000 MAP_FILE = 0x0 MAP_FIXED = 0x10 MAP_HASSEMAPHORE = 0x200 MAP_INHERIT = 0x80 MAP_INHERIT_COPY = 0x1 MAP_INHERIT_DEFAULT = 0x1 MAP_INHERIT_DONATE_COPY = 0x3 MAP_INHERIT_NONE = 0x2 MAP_INHERIT_SHARE = 0x0 MAP_NORESERVE = 0x40 MAP_PRIVATE = 0x2 MAP_RENAME = 0x20 MAP_SHARED = 0x1 MAP_STACK = 0x2000 MAP_TRYFIXED = 0x400 MAP_WIRED = 0x800 MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MNT_ASYNC = 0x40 MNT_BASIC_FLAGS = 0xe782807f MNT_DEFEXPORTED = 0x200 MNT_DISCARD = 0x800000 MNT_EXKERB = 0x800 MNT_EXNORESPORT = 0x8000000 MNT_EXPORTANON = 0x400 MNT_EXPORTED = 0x100 MNT_EXPUBLIC = 0x10000000 MNT_EXRDONLY = 0x80 MNT_EXTATTR = 0x1000000 MNT_FORCE = 0x80000 MNT_GETARGS = 0x400000 MNT_IGNORE = 0x100000 MNT_LAZY = 0x3 MNT_LOCAL = 0x1000 MNT_LOG = 0x2000000 MNT_NOATIME = 0x4000000 MNT_NOCOREDUMP = 0x8000 MNT_NODEV = 0x10 MNT_NODEVMTIME = 0x40000000 MNT_NOEXEC = 0x4 MNT_NOSUID = 0x8 MNT_NOWAIT = 0x2 MNT_OP_FLAGS = 0x4d0000 MNT_QUOTA = 0x2000 MNT_RDONLY = 0x1 MNT_RELATIME = 0x20000 MNT_RELOAD = 0x40000 MNT_ROOTFS = 0x4000 MNT_SOFTDEP = 0x80000000 MNT_SYMPERM = 0x20000000 MNT_SYNCHRONOUS = 0x2 MNT_UNION = 0x20 MNT_UPDATE = 0x10000 MNT_VISFLAGMASK = 0xff90ffff MNT_WAIT = 0x1 MSG_BCAST = 0x100 MSG_CMSG_CLOEXEC = 0x800 MSG_CONTROLMBUF = 0x2000000 MSG_CTRUNC = 0x20 MSG_DONTROUTE = 0x4 MSG_DONTWAIT = 0x80 MSG_EOR = 0x8 MSG_IOVUSRSPACE = 0x4000000 MSG_LENUSRSPACE = 0x8000000 MSG_MCAST = 0x200 MSG_NAMEMBUF = 0x1000000 MSG_NBIO = 0x1000 MSG_NOSIGNAL = 0x400 MSG_OOB = 0x1 MSG_PEEK = 0x2 MSG_TRUNC = 0x10 MSG_USERFLAGS = 0xffffff MSG_WAITALL = 0x40 MS_ASYNC = 0x1 MS_INVALIDATE = 0x2 MS_SYNC = 0x4 NAME_MAX = 0x1ff NET_RT_DUMP = 0x1 NET_RT_FLAGS = 0x2 NET_RT_IFLIST = 0x5 NET_RT_MAXID = 0x6 NET_RT_OIFLIST = 0x4 NET_RT_OOIFLIST = 0x3 NFDBITS = 0x20 NOFLSH = 0x80000000 NOTE_ATTRIB = 0x8 NOTE_CHILD = 0x4 NOTE_DELETE = 0x1 NOTE_EXEC = 0x20000000 NOTE_EXIT = 0x80000000 NOTE_EXTEND = 0x4 NOTE_FORK = 0x40000000 NOTE_LINK = 0x10 NOTE_LOWAT = 0x1 NOTE_PCTRLMASK = 0xf0000000 NOTE_PDATAMASK = 0xfffff NOTE_RENAME = 0x20 NOTE_REVOKE = 0x40 NOTE_TRACK = 0x1 NOTE_TRACKERR = 0x2 NOTE_WRITE = 0x2 OCRNL = 0x10 OFIOGETBMAP = 0xc004667a ONLCR = 0x2 ONLRET = 0x40 ONOCR = 0x20 ONOEOT = 0x8 OPOST = 0x1 O_ACCMODE = 0x3 O_ALT_IO = 0x40000 O_APPEND = 0x8 O_ASYNC = 0x40 O_CLOEXEC = 0x400000 O_CREAT = 0x200 O_DIRECT = 0x80000 O_DIRECTORY = 0x200000 O_DSYNC = 0x10000 O_EXCL = 0x800 O_EXLOCK = 0x20 O_FSYNC = 0x80 O_NDELAY = 0x4 O_NOCTTY = 0x8000 O_NOFOLLOW = 0x100 O_NONBLOCK = 0x4 O_NOSIGPIPE = 0x1000000 O_RDONLY = 0x0 O_RDWR = 0x2 O_RSYNC = 0x20000 O_SHLOCK = 0x10 O_SYNC = 0x80 O_TRUNC = 0x400 O_WRONLY = 0x1 PARENB = 0x1000 PARMRK = 0x8 PARODD = 0x2000 PENDIN = 0x20000000 PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 PRI_IOFLUSH = 0x7c PROT_EXEC = 0x4 PROT_NONE = 0x0 PROT_READ = 0x1 PROT_WRITE = 0x2 RLIMIT_AS = 0xa RLIMIT_CORE = 0x4 RLIMIT_CPU = 0x0 RLIMIT_DATA = 0x2 RLIMIT_FSIZE = 0x1 RLIMIT_MEMLOCK = 0x6 RLIMIT_NOFILE = 0x8 RLIMIT_NPROC = 0x7 RLIMIT_RSS = 0x5 RLIMIT_STACK = 0x3 RLIM_INFINITY = 0x7fffffffffffffff RTAX_AUTHOR = 0x6 RTAX_BRD = 0x7 RTAX_DST = 0x0 RTAX_GATEWAY = 0x1 RTAX_GENMASK = 0x3 RTAX_IFA = 0x5 RTAX_IFP = 0x4 RTAX_MAX = 0x9 RTAX_NETMASK = 0x2 RTAX_TAG = 0x8 RTA_AUTHOR = 0x40 RTA_BRD = 0x80 RTA_DST = 0x1 RTA_GATEWAY = 0x2 RTA_GENMASK = 0x8 RTA_IFA = 0x20 RTA_IFP = 0x10 RTA_NETMASK = 0x4 RTA_TAG = 0x100 RTF_ANNOUNCE = 0x20000 RTF_BLACKHOLE = 0x1000 RTF_CLONED = 0x2000 RTF_CLONING = 0x100 RTF_DONE = 0x40 RTF_DYNAMIC = 0x10 RTF_GATEWAY = 0x2 RTF_HOST = 0x4 RTF_LLINFO = 0x400 RTF_MASK = 0x80 RTF_MODIFIED = 0x20 RTF_PROTO1 = 0x8000 RTF_PROTO2 = 0x4000 RTF_REJECT = 0x8 RTF_SRC = 0x10000 RTF_STATIC = 0x800 RTF_UP = 0x1 RTF_XRESOLVE = 0x200 RTM_ADD = 0x1 RTM_CHANGE = 0x3 RTM_CHGADDR = 0x15 RTM_DELADDR = 0xd RTM_DELETE = 0x2 RTM_GET = 0x4 RTM_IEEE80211 = 0x11 RTM_IFANNOUNCE = 0x10 RTM_IFINFO = 0x14 RTM_LLINFO_UPD = 0x13 RTM_LOCK = 0x8 RTM_LOSING = 0x5 RTM_MISS = 0x7 RTM_NEWADDR = 0xc RTM_OIFINFO = 0xf RTM_OLDADD = 0x9 RTM_OLDDEL = 0xa RTM_OOIFINFO = 0xe RTM_REDIRECT = 0x6 RTM_RESOLVE = 0xb RTM_RTTUNIT = 0xf4240 RTM_SETGATE = 0x12 RTM_VERSION = 0x4 RTV_EXPIRE = 0x4 RTV_HOPCOUNT = 0x2 RTV_MTU = 0x1 RTV_RPIPE = 0x8 RTV_RTT = 0x40 RTV_RTTVAR = 0x80 RTV_SPIPE = 0x10 RTV_SSTHRESH = 0x20 RUSAGE_CHILDREN = -0x1 RUSAGE_SELF = 0x0 SCM_CREDS = 0x4 SCM_RIGHTS = 0x1 SCM_TIMESTAMP = 0x8 SHUT_RD = 0x0 SHUT_RDWR = 0x2 SHUT_WR = 0x1 SIOCADDMULTI = 0x80906931 SIOCADDRT = 0x8030720a SIOCAIFADDR = 0x8040691a SIOCALIFADDR = 0x8118691c SIOCATMARK = 0x40047307 SIOCDELMULTI = 0x80906932 SIOCDELRT = 0x8030720b SIOCDIFADDR = 0x80906919 SIOCDIFPHYADDR = 0x80906949 SIOCDLIFADDR = 0x8118691e SIOCGDRVSPEC = 0xc01c697b SIOCGETPFSYNC = 0xc09069f8 SIOCGETSGCNT = 0xc0147534 SIOCGETVIFCNT = 0xc0147533 SIOCGHIWAT = 0x40047301 SIOCGIFADDR = 0xc0906921 SIOCGIFADDRPREF = 0xc0946920 SIOCGIFALIAS = 0xc040691b SIOCGIFBRDADDR = 0xc0906923 SIOCGIFCAP = 0xc0206976 SIOCGIFCONF = 0xc0086926 SIOCGIFDATA = 0xc0946985 SIOCGIFDLT = 0xc0906977 SIOCGIFDSTADDR = 0xc0906922 SIOCGIFFLAGS = 0xc0906911 SIOCGIFGENERIC = 0xc090693a SIOCGIFMEDIA = 0xc0286936 SIOCGIFMETRIC = 0xc0906917 SIOCGIFMTU = 0xc090697e SIOCGIFNETMASK = 0xc0906925 SIOCGIFPDSTADDR = 0xc0906948 SIOCGIFPSRCADDR = 0xc0906947 SIOCGLIFADDR = 0xc118691d SIOCGLIFPHYADDR = 0xc118694b SIOCGLINKSTR = 0xc01c6987 SIOCGLOWAT = 0x40047303 SIOCGPGRP = 0x40047309 SIOCGVH = 0xc0906983 SIOCIFCREATE = 0x8090697a SIOCIFDESTROY = 0x80906979 SIOCIFGCLONERS = 0xc00c6978 SIOCINITIFADDR = 0xc0446984 SIOCSDRVSPEC = 0x801c697b SIOCSETPFSYNC = 0x809069f7 SIOCSHIWAT = 0x80047300 SIOCSIFADDR = 0x8090690c SIOCSIFADDRPREF = 0x8094691f SIOCSIFBRDADDR = 0x80906913 SIOCSIFCAP = 0x80206975 SIOCSIFDSTADDR = 0x8090690e SIOCSIFFLAGS = 0x80906910 SIOCSIFGENERIC = 0x80906939 SIOCSIFMEDIA = 0xc0906935 SIOCSIFMETRIC = 0x80906918 SIOCSIFMTU = 0x8090697f SIOCSIFNETMASK = 0x80906916 SIOCSIFPHYADDR = 0x80406946 SIOCSLIFPHYADDR = 0x8118694a SIOCSLINKSTR = 0x801c6988 SIOCSLOWAT = 0x80047302 SIOCSPGRP = 0x80047308 SIOCSVH = 0xc0906982 SIOCZIFDATA = 0xc0946986 SOCK_CLOEXEC = 0x10000000 SOCK_DGRAM = 0x2 SOCK_FLAGS_MASK = 0xf0000000 SOCK_NONBLOCK = 0x20000000 SOCK_NOSIGPIPE = 0x40000000 SOCK_RAW = 0x3 SOCK_RDM = 0x4 SOCK_SEQPACKET = 0x5 SOCK_STREAM = 0x1 SOL_SOCKET = 0xffff SOMAXCONN = 0x80 SO_ACCEPTCONN = 0x2 SO_ACCEPTFILTER = 0x1000 SO_BROADCAST = 0x20 SO_DEBUG = 0x1 SO_DONTROUTE = 0x10 SO_ERROR = 0x1007 SO_KEEPALIVE = 0x8 SO_LINGER = 0x80 SO_NOHEADER = 0x100a SO_NOSIGPIPE = 0x800 SO_OOBINLINE = 0x100 SO_OVERFLOWED = 0x1009 SO_RCVBUF = 0x1002 SO_RCVLOWAT = 0x1004 SO_RCVTIMEO = 0x100c SO_REUSEADDR = 0x4 SO_REUSEPORT = 0x200 SO_SNDBUF = 0x1001 SO_SNDLOWAT = 0x1003 SO_SNDTIMEO = 0x100b SO_TIMESTAMP = 0x2000 SO_TYPE = 0x1008 SO_USELOOPBACK = 0x40 SYSCTL_VERSION = 0x1000000 SYSCTL_VERS_0 = 0x0 SYSCTL_VERS_1 = 0x1000000 SYSCTL_VERS_MASK = 0xff000000 S_ARCH1 = 0x10000 S_ARCH2 = 0x20000 S_BLKSIZE = 0x200 S_IEXEC = 0x40 S_IFBLK = 0x6000 S_IFCHR = 0x2000 S_IFDIR = 0x4000 S_IFIFO = 0x1000 S_IFLNK = 0xa000 S_IFMT = 0xf000 S_IFREG = 0x8000 S_IFSOCK = 0xc000 S_IFWHT = 0xe000 S_IREAD = 0x100 S_IRGRP = 0x20 S_IROTH = 0x4 S_IRUSR = 0x100 S_IRWXG = 0x38 S_IRWXO = 0x7 S_IRWXU = 0x1c0 S_ISGID = 0x400 S_ISTXT = 0x200 S_ISUID = 0x800 S_ISVTX = 0x200 S_IWGRP = 0x10 S_IWOTH = 0x2 S_IWRITE = 0x80 S_IWUSR = 0x80 S_IXGRP = 0x8 S_IXOTH = 0x1 S_IXUSR = 0x40 S_LOGIN_SET = 0x1 TCIFLUSH = 0x1 TCIOFLUSH = 0x3 TCOFLUSH = 0x2 TCP_CONGCTL = 0x20 TCP_KEEPCNT = 0x6 TCP_KEEPIDLE = 0x3 TCP_KEEPINIT = 0x7 TCP_KEEPINTVL = 0x5 TCP_MAXBURST = 0x4 TCP_MAXSEG = 0x2 TCP_MAXWIN = 0xffff TCP_MAX_WINSHIFT = 0xe TCP_MD5SIG = 0x10 TCP_MINMSS = 0xd8 TCP_MSS = 0x218 TCP_NODELAY = 0x1 TCSAFLUSH = 0x2 TIOCCBRK = 0x2000747a TIOCCDTR = 0x20007478 TIOCCONS = 0x80047462 TIOCDCDTIMESTAMP = 0x400c7458 TIOCDRAIN = 0x2000745e TIOCEXCL = 0x2000740d TIOCEXT = 0x80047460 TIOCFLAG_CDTRCTS = 0x10 TIOCFLAG_CLOCAL = 0x2 TIOCFLAG_CRTSCTS = 0x4 TIOCFLAG_MDMBUF = 0x8 TIOCFLAG_SOFTCAR = 0x1 TIOCFLUSH = 0x80047410 TIOCGETA = 0x402c7413 TIOCGETD = 0x4004741a TIOCGFLAGS = 0x4004745d TIOCGLINED = 0x40207442 TIOCGPGRP = 0x40047477 TIOCGQSIZE = 0x40047481 TIOCGRANTPT = 0x20007447 TIOCGSID = 0x40047463 TIOCGSIZE = 0x40087468 TIOCGWINSZ = 0x40087468 TIOCMBIC = 0x8004746b TIOCMBIS = 0x8004746c TIOCMGET = 0x4004746a TIOCMSET = 0x8004746d TIOCM_CAR = 0x40 TIOCM_CD = 0x40 TIOCM_CTS = 0x20 TIOCM_DSR = 0x100 TIOCM_DTR = 0x2 TIOCM_LE = 0x1 TIOCM_RI = 0x80 TIOCM_RNG = 0x80 TIOCM_RTS = 0x4 TIOCM_SR = 0x10 TIOCM_ST = 0x8 TIOCNOTTY = 0x20007471 TIOCNXCL = 0x2000740e TIOCOUTQ = 0x40047473 TIOCPKT = 0x80047470 TIOCPKT_DATA = 0x0 TIOCPKT_DOSTOP = 0x20 TIOCPKT_FLUSHREAD = 0x1 TIOCPKT_FLUSHWRITE = 0x2 TIOCPKT_IOCTL = 0x40 TIOCPKT_NOSTOP = 0x10 TIOCPKT_START = 0x8 TIOCPKT_STOP = 0x4 TIOCPTMGET = 0x40287446 TIOCPTSNAME = 0x40287448 TIOCRCVFRAME = 0x80047445 TIOCREMOTE = 0x80047469 TIOCSBRK = 0x2000747b TIOCSCTTY = 0x20007461 TIOCSDTR = 0x20007479 TIOCSETA = 0x802c7414 TIOCSETAF = 0x802c7416 TIOCSETAW = 0x802c7415 TIOCSETD = 0x8004741b TIOCSFLAGS = 0x8004745c TIOCSIG = 0x2000745f TIOCSLINED = 0x80207443 TIOCSPGRP = 0x80047476 TIOCSQSIZE = 0x80047480 TIOCSSIZE = 0x80087467 TIOCSTART = 0x2000746e TIOCSTAT = 0x80047465 TIOCSTI = 0x80017472 TIOCSTOP = 0x2000746f TIOCSWINSZ = 0x80087467 TIOCUCNTL = 0x80047466 TIOCXMTFRAME = 0x80047444 TOSTOP = 0x400000 VDISCARD = 0xf VDSUSP = 0xb VEOF = 0x0 VEOL = 0x1 VEOL2 = 0x2 VERASE = 0x3 VINTR = 0x8 VKILL = 0x5 VLNEXT = 0xe VMIN = 0x10 VQUIT = 0x9 VREPRINT = 0x6 VSTART = 0xc VSTATUS = 0x12 VSTOP = 0xd VSUSP = 0xa VTIME = 0x11 VWERASE = 0x4 WALL = 0x8 WALLSIG = 0x8 WALTSIG = 0x4 WCLONE = 0x4 WCOREFLAG = 0x80 WNOHANG = 0x1 WNOWAIT = 0x10000 WNOZOMBIE = 0x20000 WOPTSCHECKED = 0x40000 WSTOPPED = 0x7f WUNTRACED = 0x2 ) // Errors const ( E2BIG = syscall.Errno(0x7) EACCES = syscall.Errno(0xd) EADDRINUSE = syscall.Errno(0x30) EADDRNOTAVAIL = syscall.Errno(0x31) EAFNOSUPPORT = syscall.Errno(0x2f) EAGAIN = syscall.Errno(0x23) EALREADY = syscall.Errno(0x25) EAUTH = syscall.Errno(0x50) EBADF = syscall.Errno(0x9) EBADMSG = syscall.Errno(0x58) EBADRPC = syscall.Errno(0x48) EBUSY = syscall.Errno(0x10) ECANCELED = syscall.Errno(0x57) ECHILD = syscall.Errno(0xa) ECONNABORTED = syscall.Errno(0x35) ECONNREFUSED = syscall.Errno(0x3d) ECONNRESET = syscall.Errno(0x36) EDEADLK = syscall.Errno(0xb) EDESTADDRREQ = syscall.Errno(0x27) EDOM = syscall.Errno(0x21) EDQUOT = syscall.Errno(0x45) EEXIST = syscall.Errno(0x11) EFAULT = syscall.Errno(0xe) EFBIG = syscall.Errno(0x1b) EFTYPE = syscall.Errno(0x4f) EHOSTDOWN = syscall.Errno(0x40) EHOSTUNREACH = syscall.Errno(0x41) EIDRM = syscall.Errno(0x52) EILSEQ = syscall.Errno(0x55) EINPROGRESS = syscall.Errno(0x24) EINTR = syscall.Errno(0x4) EINVAL = syscall.Errno(0x16) EIO = syscall.Errno(0x5) EISCONN = syscall.Errno(0x38) EISDIR = syscall.Errno(0x15) ELAST = syscall.Errno(0x60) ELOOP = syscall.Errno(0x3e) EMFILE = syscall.Errno(0x18) EMLINK = syscall.Errno(0x1f) EMSGSIZE = syscall.Errno(0x28) EMULTIHOP = syscall.Errno(0x5e) ENAMETOOLONG = syscall.Errno(0x3f) ENEEDAUTH = syscall.Errno(0x51) ENETDOWN = syscall.Errno(0x32) ENETRESET = syscall.Errno(0x34) ENETUNREACH = syscall.Errno(0x33) ENFILE = syscall.Errno(0x17) ENOATTR = syscall.Errno(0x5d) ENOBUFS = syscall.Errno(0x37) ENODATA = syscall.Errno(0x59) ENODEV = syscall.Errno(0x13) ENOENT = syscall.Errno(0x2) ENOEXEC = syscall.Errno(0x8) ENOLCK = syscall.Errno(0x4d) ENOLINK = syscall.Errno(0x5f) ENOMEM = syscall.Errno(0xc) ENOMSG = syscall.Errno(0x53) ENOPROTOOPT = syscall.Errno(0x2a) ENOSPC = syscall.Errno(0x1c) ENOSR = syscall.Errno(0x5a) ENOSTR = syscall.Errno(0x5b) ENOSYS = syscall.Errno(0x4e) ENOTBLK = syscall.Errno(0xf) ENOTCONN = syscall.Errno(0x39) ENOTDIR = syscall.Errno(0x14) ENOTEMPTY = syscall.Errno(0x42) ENOTSOCK = syscall.Errno(0x26) ENOTSUP = syscall.Errno(0x56) ENOTTY = syscall.Errno(0x19) ENXIO = syscall.Errno(0x6) EOPNOTSUPP = syscall.Errno(0x2d) EOVERFLOW = syscall.Errno(0x54) EPERM = syscall.Errno(0x1) EPFNOSUPPORT = syscall.Errno(0x2e) EPIPE = syscall.Errno(0x20) EPROCLIM = syscall.Errno(0x43) EPROCUNAVAIL = syscall.Errno(0x4c) EPROGMISMATCH = syscall.Errno(0x4b) EPROGUNAVAIL = syscall.Errno(0x4a) EPROTO = syscall.Errno(0x60) EPROTONOSUPPORT = syscall.Errno(0x2b) EPROTOTYPE = syscall.Errno(0x29) ERANGE = syscall.Errno(0x22) EREMOTE = syscall.Errno(0x47) EROFS = syscall.Errno(0x1e) ERPCMISMATCH = syscall.Errno(0x49) ESHUTDOWN = syscall.Errno(0x3a) ESOCKTNOSUPPORT = syscall.Errno(0x2c) ESPIPE = syscall.Errno(0x1d) ESRCH = syscall.Errno(0x3) ESTALE = syscall.Errno(0x46) ETIME = syscall.Errno(0x5c) ETIMEDOUT = syscall.Errno(0x3c) ETOOMANYREFS = syscall.Errno(0x3b) ETXTBSY = syscall.Errno(0x1a) EUSERS = syscall.Errno(0x44) EWOULDBLOCK = syscall.Errno(0x23) EXDEV = syscall.Errno(0x12) ) // Signals const ( SIGABRT = syscall.Signal(0x6) SIGALRM = syscall.Signal(0xe) SIGBUS = syscall.Signal(0xa) SIGCHLD = syscall.Signal(0x14) SIGCONT = syscall.Signal(0x13) SIGEMT = syscall.Signal(0x7) SIGFPE = syscall.Signal(0x8) SIGHUP = syscall.Signal(0x1) SIGILL = syscall.Signal(0x4) SIGINFO = syscall.Signal(0x1d) SIGINT = syscall.Signal(0x2) SIGIO = syscall.Signal(0x17) SIGIOT = syscall.Signal(0x6) SIGKILL = syscall.Signal(0x9) SIGPIPE = syscall.Signal(0xd) SIGPROF = syscall.Signal(0x1b) SIGPWR = syscall.Signal(0x20) SIGQUIT = syscall.Signal(0x3) SIGSEGV = syscall.Signal(0xb) SIGSTOP = syscall.Signal(0x11) SIGSYS = syscall.Signal(0xc) SIGTERM = syscall.Signal(0xf) SIGTRAP = syscall.Signal(0x5) SIGTSTP = syscall.Signal(0x12) SIGTTIN = syscall.Signal(0x15) SIGTTOU = syscall.Signal(0x16) SIGURG = syscall.Signal(0x10) SIGUSR1 = syscall.Signal(0x1e) SIGUSR2 = syscall.Signal(0x1f) SIGVTALRM = syscall.Signal(0x1a) SIGWINCH = syscall.Signal(0x1c) SIGXCPU = syscall.Signal(0x18) SIGXFSZ = syscall.Signal(0x19) ) // Error table var errorList = [...]struct { num syscall.Errno name string desc string }{ {1, "EPERM", "operation not permitted"}, {2, "ENOENT", "no such file or directory"}, {3, "ESRCH", "no such process"}, {4, "EINTR", "interrupted system call"}, {5, "EIO", "input/output error"}, {6, "ENXIO", "device not configured"}, {7, "E2BIG", "argument list too long"}, {8, "ENOEXEC", "exec format error"}, {9, "EBADF", "bad file descriptor"}, {10, "ECHILD", "no child processes"}, {11, "EDEADLK", "resource deadlock avoided"}, {12, "ENOMEM", "cannot allocate memory"}, {13, "EACCES", "permission denied"}, {14, "EFAULT", "bad address"}, {15, "ENOTBLK", "block device required"}, {16, "EBUSY", "device busy"}, {17, "EEXIST", "file exists"}, {18, "EXDEV", "cross-device link"}, {19, "ENODEV", "operation not supported by device"}, {20, "ENOTDIR", "not a directory"}, {21, "EISDIR", "is a directory"}, {22, "EINVAL", "invalid argument"}, {23, "ENFILE", "too many open files in system"}, {24, "EMFILE", "too many open files"}, {25, "ENOTTY", "inappropriate ioctl for device"}, {26, "ETXTBSY", "text file busy"}, {27, "EFBIG", "file too large"}, {28, "ENOSPC", "no space left on device"}, {29, "ESPIPE", "illegal seek"}, {30, "EROFS", "read-only file system"}, {31, "EMLINK", "too many links"}, {32, "EPIPE", "broken pipe"}, {33, "EDOM", "numerical argument out of domain"}, {34, "ERANGE", "result too large or too small"}, {35, "EAGAIN", "resource temporarily unavailable"}, {36, "EINPROGRESS", "operation now in progress"}, {37, "EALREADY", "operation already in progress"}, {38, "ENOTSOCK", "socket operation on non-socket"}, {39, "EDESTADDRREQ", "destination address required"}, {40, "EMSGSIZE", "message too long"}, {41, "EPROTOTYPE", "protocol wrong type for socket"}, {42, "ENOPROTOOPT", "protocol option not available"}, {43, "EPROTONOSUPPORT", "protocol not supported"}, {44, "ESOCKTNOSUPPORT", "socket type not supported"}, {45, "EOPNOTSUPP", "operation not supported"}, {46, "EPFNOSUPPORT", "protocol family not supported"}, {47, "EAFNOSUPPORT", "address family not supported by protocol family"}, {48, "EADDRINUSE", "address already in use"}, {49, "EADDRNOTAVAIL", "can't assign requested address"}, {50, "ENETDOWN", "network is down"}, {51, "ENETUNREACH", "network is unreachable"}, {52, "ENETRESET", "network dropped connection on reset"}, {53, "ECONNABORTED", "software caused connection abort"}, {54, "ECONNRESET", "connection reset by peer"}, {55, "ENOBUFS", "no buffer space available"}, {56, "EISCONN", "socket is already connected"}, {57, "ENOTCONN", "socket is not connected"}, {58, "ESHUTDOWN", "can't send after socket shutdown"}, {59, "ETOOMANYREFS", "too many references: can't splice"}, {60, "ETIMEDOUT", "connection timed out"}, {61, "ECONNREFUSED", "connection refused"}, {62, "ELOOP", "too many levels of symbolic links"}, {63, "ENAMETOOLONG", "file name too long"}, {64, "EHOSTDOWN", "host is down"}, {65, "EHOSTUNREACH", "no route to host"}, {66, "ENOTEMPTY", "directory not empty"}, {67, "EPROCLIM", "too many processes"}, {68, "EUSERS", "too many users"}, {69, "EDQUOT", "disc quota exceeded"}, {70, "ESTALE", "stale NFS file handle"}, {71, "EREMOTE", "too many levels of remote in path"}, {72, "EBADRPC", "RPC struct is bad"}, {73, "ERPCMISMATCH", "RPC version wrong"}, {74, "EPROGUNAVAIL", "RPC prog. not avail"}, {75, "EPROGMISMATCH", "program version wrong"}, {76, "EPROCUNAVAIL", "bad procedure for program"}, {77, "ENOLCK", "no locks available"}, {78, "ENOSYS", "function not implemented"}, {79, "EFTYPE", "inappropriate file type or format"}, {80, "EAUTH", "authentication error"}, {81, "ENEEDAUTH", "need authenticator"}, {82, "EIDRM", "identifier removed"}, {83, "ENOMSG", "no message of desired type"}, {84, "EOVERFLOW", "value too large to be stored in data type"}, {85, "EILSEQ", "illegal byte sequence"}, {86, "ENOTSUP", "not supported"}, {87, "ECANCELED", "operation Canceled"}, {88, "EBADMSG", "bad or Corrupt message"}, {89, "ENODATA", "no message available"}, {90, "ENOSR", "no STREAM resources"}, {91, "ENOSTR", "not a STREAM"}, {92, "ETIME", "STREAM ioctl timeout"}, {93, "ENOATTR", "attribute not found"}, {94, "EMULTIHOP", "multihop attempted"}, {95, "ENOLINK", "link has been severed"}, {96, "ELAST", "protocol error"}, } // Signal table var signalList = [...]struct { num syscall.Signal name string desc string }{ {1, "SIGHUP", "hangup"}, {2, "SIGINT", "interrupt"}, {3, "SIGQUIT", "quit"}, {4, "SIGILL", "illegal instruction"}, {5, "SIGTRAP", "trace/BPT trap"}, {6, "SIGIOT", "abort trap"}, {7, "SIGEMT", "EMT trap"}, {8, "SIGFPE", "floating point exception"}, {9, "SIGKILL", "killed"}, {10, "SIGBUS", "bus error"}, {11, "SIGSEGV", "segmentation fault"}, {12, "SIGSYS", "bad system call"}, {13, "SIGPIPE", "broken pipe"}, {14, "SIGALRM", "alarm clock"}, {15, "SIGTERM", "terminated"}, {16, "SIGURG", "urgent I/O condition"}, {17, "SIGSTOP", "stopped (signal)"}, {18, "SIGTSTP", "stopped"}, {19, "SIGCONT", "continued"}, {20, "SIGCHLD", "child exited"}, {21, "SIGTTIN", "stopped (tty input)"}, {22, "SIGTTOU", "stopped (tty output)"}, {23, "SIGIO", "I/O possible"}, {24, "SIGXCPU", "cputime limit exceeded"}, {25, "SIGXFSZ", "filesize limit exceeded"}, {26, "SIGVTALRM", "virtual timer expired"}, {27, "SIGPROF", "profiling timer expired"}, {28, "SIGWINCH", "window size changes"}, {29, "SIGINFO", "information request"}, {30, "SIGUSR1", "user defined signal 1"}, {31, "SIGUSR2", "user defined signal 2"}, {32, "SIGPWR", "power fail/restart"}, } ================================================ FILE: vendor/golang.org/x/sys/unix/zerrors_netbsd_amd64.go ================================================ // mkerrors.sh -m64 // Code generated by the command above; see README.md. DO NOT EDIT. //go:build amd64 && netbsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -m64 _const.go package unix import "syscall" const ( AF_APPLETALK = 0x10 AF_ARP = 0x1c AF_BLUETOOTH = 0x1f AF_CCITT = 0xa AF_CHAOS = 0x5 AF_CNT = 0x15 AF_COIP = 0x14 AF_DATAKIT = 0x9 AF_DECnet = 0xc AF_DLI = 0xd AF_E164 = 0x1a AF_ECMA = 0x8 AF_HYLINK = 0xf AF_IEEE80211 = 0x20 AF_IMPLINK = 0x3 AF_INET = 0x2 AF_INET6 = 0x18 AF_IPX = 0x17 AF_ISDN = 0x1a AF_ISO = 0x7 AF_LAT = 0xe AF_LINK = 0x12 AF_LOCAL = 0x1 AF_MAX = 0x23 AF_MPLS = 0x21 AF_NATM = 0x1b AF_NS = 0x6 AF_OROUTE = 0x11 AF_OSI = 0x7 AF_PUP = 0x4 AF_ROUTE = 0x22 AF_SNA = 0xb AF_UNIX = 0x1 AF_UNSPEC = 0x0 ARPHRD_ARCNET = 0x7 ARPHRD_ETHER = 0x1 ARPHRD_FRELAY = 0xf ARPHRD_IEEE1394 = 0x18 ARPHRD_IEEE802 = 0x6 ARPHRD_STRIP = 0x17 B0 = 0x0 B110 = 0x6e B115200 = 0x1c200 B1200 = 0x4b0 B134 = 0x86 B14400 = 0x3840 B150 = 0x96 B1800 = 0x708 B19200 = 0x4b00 B200 = 0xc8 B230400 = 0x38400 B2400 = 0x960 B28800 = 0x7080 B300 = 0x12c B38400 = 0x9600 B460800 = 0x70800 B4800 = 0x12c0 B50 = 0x32 B57600 = 0xe100 B600 = 0x258 B7200 = 0x1c20 B75 = 0x4b B76800 = 0x12c00 B921600 = 0xe1000 B9600 = 0x2580 BIOCFEEDBACK = 0x8004427d BIOCFLUSH = 0x20004268 BIOCGBLEN = 0x40044266 BIOCGDLT = 0x4004426a BIOCGDLTLIST = 0xc0104277 BIOCGETIF = 0x4090426b BIOCGFEEDBACK = 0x4004427c BIOCGHDRCMPLT = 0x40044274 BIOCGRTIMEOUT = 0x4010427b BIOCGSEESENT = 0x40044278 BIOCGSTATS = 0x4080426f BIOCGSTATSOLD = 0x4008426f BIOCIMMEDIATE = 0x80044270 BIOCPROMISC = 0x20004269 BIOCSBLEN = 0xc0044266 BIOCSDLT = 0x80044276 BIOCSETF = 0x80104267 BIOCSETIF = 0x8090426c BIOCSFEEDBACK = 0x8004427d BIOCSHDRCMPLT = 0x80044275 BIOCSRTIMEOUT = 0x8010427a BIOCSSEESENT = 0x80044279 BIOCSTCPF = 0x80104272 BIOCSUDPF = 0x80104273 BIOCVERSION = 0x40044271 BPF_A = 0x10 BPF_ABS = 0x20 BPF_ADD = 0x0 BPF_ALIGNMENT = 0x8 BPF_ALIGNMENT32 = 0x4 BPF_ALU = 0x4 BPF_AND = 0x50 BPF_B = 0x10 BPF_DFLTBUFSIZE = 0x100000 BPF_DIV = 0x30 BPF_H = 0x8 BPF_IMM = 0x0 BPF_IND = 0x40 BPF_JA = 0x0 BPF_JEQ = 0x10 BPF_JGE = 0x30 BPF_JGT = 0x20 BPF_JMP = 0x5 BPF_JSET = 0x40 BPF_K = 0x0 BPF_LD = 0x0 BPF_LDX = 0x1 BPF_LEN = 0x80 BPF_LSH = 0x60 BPF_MAJOR_VERSION = 0x1 BPF_MAXBUFSIZE = 0x1000000 BPF_MAXINSNS = 0x200 BPF_MEM = 0x60 BPF_MEMWORDS = 0x10 BPF_MINBUFSIZE = 0x20 BPF_MINOR_VERSION = 0x1 BPF_MISC = 0x7 BPF_MSH = 0xa0 BPF_MUL = 0x20 BPF_NEG = 0x80 BPF_OR = 0x40 BPF_RELEASE = 0x30bb6 BPF_RET = 0x6 BPF_RSH = 0x70 BPF_ST = 0x2 BPF_STX = 0x3 BPF_SUB = 0x10 BPF_TAX = 0x0 BPF_TXA = 0x80 BPF_W = 0x0 BPF_X = 0x8 BRKINT = 0x2 CFLUSH = 0xf CLOCAL = 0x8000 CLONE_CSIGNAL = 0xff CLONE_FILES = 0x400 CLONE_FS = 0x200 CLONE_PID = 0x1000 CLONE_PTRACE = 0x2000 CLONE_SIGHAND = 0x800 CLONE_VFORK = 0x4000 CLONE_VM = 0x100 CPUSTATES = 0x5 CP_IDLE = 0x4 CP_INTR = 0x3 CP_NICE = 0x1 CP_SYS = 0x2 CP_USER = 0x0 CREAD = 0x800 CRTSCTS = 0x10000 CS5 = 0x0 CS6 = 0x100 CS7 = 0x200 CS8 = 0x300 CSIZE = 0x300 CSTART = 0x11 CSTATUS = 0x14 CSTOP = 0x13 CSTOPB = 0x400 CSUSP = 0x1a CTL_HW = 0x6 CTL_KERN = 0x1 CTL_MAXNAME = 0xc CTL_NET = 0x4 CTL_QUERY = -0x2 DIOCBSFLUSH = 0x20006478 DLT_A429 = 0xb8 DLT_A653_ICM = 0xb9 DLT_AIRONET_HEADER = 0x78 DLT_AOS = 0xde DLT_APPLE_IP_OVER_IEEE1394 = 0x8a DLT_ARCNET = 0x7 DLT_ARCNET_LINUX = 0x81 DLT_ATM_CLIP = 0x13 DLT_ATM_RFC1483 = 0xb DLT_AURORA = 0x7e DLT_AX25 = 0x3 DLT_AX25_KISS = 0xca DLT_BACNET_MS_TP = 0xa5 DLT_BLUETOOTH_HCI_H4 = 0xbb DLT_BLUETOOTH_HCI_H4_WITH_PHDR = 0xc9 DLT_CAN20B = 0xbe DLT_CAN_SOCKETCAN = 0xe3 DLT_CHAOS = 0x5 DLT_CISCO_IOS = 0x76 DLT_C_HDLC = 0x68 DLT_C_HDLC_WITH_DIR = 0xcd DLT_DECT = 0xdd DLT_DOCSIS = 0x8f DLT_ECONET = 0x73 DLT_EN10MB = 0x1 DLT_EN3MB = 0x2 DLT_ENC = 0x6d DLT_ERF = 0xc5 DLT_ERF_ETH = 0xaf DLT_ERF_POS = 0xb0 DLT_FC_2 = 0xe0 DLT_FC_2_WITH_FRAME_DELIMS = 0xe1 DLT_FDDI = 0xa DLT_FLEXRAY = 0xd2 DLT_FRELAY = 0x6b DLT_FRELAY_WITH_DIR = 0xce DLT_GCOM_SERIAL = 0xad DLT_GCOM_T1E1 = 0xac DLT_GPF_F = 0xab DLT_GPF_T = 0xaa DLT_GPRS_LLC = 0xa9 DLT_GSMTAP_ABIS = 0xda DLT_GSMTAP_UM = 0xd9 DLT_HDLC = 0x10 DLT_HHDLC = 0x79 DLT_HIPPI = 0xf DLT_IBM_SN = 0x92 DLT_IBM_SP = 0x91 DLT_IEEE802 = 0x6 DLT_IEEE802_11 = 0x69 DLT_IEEE802_11_RADIO = 0x7f DLT_IEEE802_11_RADIO_AVS = 0xa3 DLT_IEEE802_15_4 = 0xc3 DLT_IEEE802_15_4_LINUX = 0xbf DLT_IEEE802_15_4_NONASK_PHY = 0xd7 DLT_IEEE802_16_MAC_CPS = 0xbc DLT_IEEE802_16_MAC_CPS_RADIO = 0xc1 DLT_IPMB = 0xc7 DLT_IPMB_LINUX = 0xd1 DLT_IPNET = 0xe2 DLT_IPV4 = 0xe4 DLT_IPV6 = 0xe5 DLT_IP_OVER_FC = 0x7a DLT_JUNIPER_ATM1 = 0x89 DLT_JUNIPER_ATM2 = 0x87 DLT_JUNIPER_CHDLC = 0xb5 DLT_JUNIPER_ES = 0x84 DLT_JUNIPER_ETHER = 0xb2 DLT_JUNIPER_FRELAY = 0xb4 DLT_JUNIPER_GGSN = 0x85 DLT_JUNIPER_ISM = 0xc2 DLT_JUNIPER_MFR = 0x86 DLT_JUNIPER_MLFR = 0x83 DLT_JUNIPER_MLPPP = 0x82 DLT_JUNIPER_MONITOR = 0xa4 DLT_JUNIPER_PIC_PEER = 0xae DLT_JUNIPER_PPP = 0xb3 DLT_JUNIPER_PPPOE = 0xa7 DLT_JUNIPER_PPPOE_ATM = 0xa8 DLT_JUNIPER_SERVICES = 0x88 DLT_JUNIPER_ST = 0xc8 DLT_JUNIPER_VP = 0xb7 DLT_LAPB_WITH_DIR = 0xcf DLT_LAPD = 0xcb DLT_LIN = 0xd4 DLT_LINUX_EVDEV = 0xd8 DLT_LINUX_IRDA = 0x90 DLT_LINUX_LAPD = 0xb1 DLT_LINUX_SLL = 0x71 DLT_LOOP = 0x6c DLT_LTALK = 0x72 DLT_MFR = 0xb6 DLT_MOST = 0xd3 DLT_MPLS = 0xdb DLT_MTP2 = 0x8c DLT_MTP2_WITH_PHDR = 0x8b DLT_MTP3 = 0x8d DLT_NULL = 0x0 DLT_PCI_EXP = 0x7d DLT_PFLOG = 0x75 DLT_PFSYNC = 0x12 DLT_PPI = 0xc0 DLT_PPP = 0x9 DLT_PPP_BSDOS = 0xe DLT_PPP_ETHER = 0x33 DLT_PPP_PPPD = 0xa6 DLT_PPP_SERIAL = 0x32 DLT_PPP_WITH_DIR = 0xcc DLT_PRISM_HEADER = 0x77 DLT_PRONET = 0x4 DLT_RAIF1 = 0xc6 DLT_RAW = 0xc DLT_RAWAF_MASK = 0x2240000 DLT_RIO = 0x7c DLT_SCCP = 0x8e DLT_SITA = 0xc4 DLT_SLIP = 0x8 DLT_SLIP_BSDOS = 0xd DLT_SUNATM = 0x7b DLT_SYMANTEC_FIREWALL = 0x63 DLT_TZSP = 0x80 DLT_USB = 0xba DLT_USB_LINUX = 0xbd DLT_USB_LINUX_MMAPPED = 0xdc DLT_WIHART = 0xdf DLT_X2E_SERIAL = 0xd5 DLT_X2E_XORAYA = 0xd6 DT_BLK = 0x6 DT_CHR = 0x2 DT_DIR = 0x4 DT_FIFO = 0x1 DT_LNK = 0xa DT_REG = 0x8 DT_SOCK = 0xc DT_UNKNOWN = 0x0 DT_WHT = 0xe ECHO = 0x8 ECHOCTL = 0x40 ECHOE = 0x2 ECHOK = 0x4 ECHOKE = 0x1 ECHONL = 0x10 ECHOPRT = 0x20 EMUL_LINUX = 0x1 EMUL_LINUX32 = 0x5 EMUL_MAXID = 0x6 ETHERCAP_JUMBO_MTU = 0x4 ETHERCAP_VLAN_HWTAGGING = 0x2 ETHERCAP_VLAN_MTU = 0x1 ETHERMIN = 0x2e ETHERMTU = 0x5dc ETHERMTU_JUMBO = 0x2328 ETHERTYPE_8023 = 0x4 ETHERTYPE_AARP = 0x80f3 ETHERTYPE_ACCTON = 0x8390 ETHERTYPE_AEONIC = 0x8036 ETHERTYPE_ALPHA = 0x814a ETHERTYPE_AMBER = 0x6008 ETHERTYPE_AMOEBA = 0x8145 ETHERTYPE_APOLLO = 0x80f7 ETHERTYPE_APOLLODOMAIN = 0x8019 ETHERTYPE_APPLETALK = 0x809b ETHERTYPE_APPLITEK = 0x80c7 ETHERTYPE_ARGONAUT = 0x803a ETHERTYPE_ARP = 0x806 ETHERTYPE_AT = 0x809b ETHERTYPE_ATALK = 0x809b ETHERTYPE_ATOMIC = 0x86df ETHERTYPE_ATT = 0x8069 ETHERTYPE_ATTSTANFORD = 0x8008 ETHERTYPE_AUTOPHON = 0x806a ETHERTYPE_AXIS = 0x8856 ETHERTYPE_BCLOOP = 0x9003 ETHERTYPE_BOFL = 0x8102 ETHERTYPE_CABLETRON = 0x7034 ETHERTYPE_CHAOS = 0x804 ETHERTYPE_COMDESIGN = 0x806c ETHERTYPE_COMPUGRAPHIC = 0x806d ETHERTYPE_COUNTERPOINT = 0x8062 ETHERTYPE_CRONUS = 0x8004 ETHERTYPE_CRONUSVLN = 0x8003 ETHERTYPE_DCA = 0x1234 ETHERTYPE_DDE = 0x807b ETHERTYPE_DEBNI = 0xaaaa ETHERTYPE_DECAM = 0x8048 ETHERTYPE_DECCUST = 0x6006 ETHERTYPE_DECDIAG = 0x6005 ETHERTYPE_DECDNS = 0x803c ETHERTYPE_DECDTS = 0x803e ETHERTYPE_DECEXPER = 0x6000 ETHERTYPE_DECLAST = 0x8041 ETHERTYPE_DECLTM = 0x803f ETHERTYPE_DECMUMPS = 0x6009 ETHERTYPE_DECNETBIOS = 0x8040 ETHERTYPE_DELTACON = 0x86de ETHERTYPE_DIDDLE = 0x4321 ETHERTYPE_DLOG1 = 0x660 ETHERTYPE_DLOG2 = 0x661 ETHERTYPE_DN = 0x6003 ETHERTYPE_DOGFIGHT = 0x1989 ETHERTYPE_DSMD = 0x8039 ETHERTYPE_ECMA = 0x803 ETHERTYPE_ENCRYPT = 0x803d ETHERTYPE_ES = 0x805d ETHERTYPE_EXCELAN = 0x8010 ETHERTYPE_EXPERDATA = 0x8049 ETHERTYPE_FLIP = 0x8146 ETHERTYPE_FLOWCONTROL = 0x8808 ETHERTYPE_FRARP = 0x808 ETHERTYPE_GENDYN = 0x8068 ETHERTYPE_HAYES = 0x8130 ETHERTYPE_HIPPI_FP = 0x8180 ETHERTYPE_HITACHI = 0x8820 ETHERTYPE_HP = 0x8005 ETHERTYPE_IEEEPUP = 0xa00 ETHERTYPE_IEEEPUPAT = 0xa01 ETHERTYPE_IMLBL = 0x4c42 ETHERTYPE_IMLBLDIAG = 0x424c ETHERTYPE_IP = 0x800 ETHERTYPE_IPAS = 0x876c ETHERTYPE_IPV6 = 0x86dd ETHERTYPE_IPX = 0x8137 ETHERTYPE_IPXNEW = 0x8037 ETHERTYPE_KALPANA = 0x8582 ETHERTYPE_LANBRIDGE = 0x8038 ETHERTYPE_LANPROBE = 0x8888 ETHERTYPE_LAT = 0x6004 ETHERTYPE_LBACK = 0x9000 ETHERTYPE_LITTLE = 0x8060 ETHERTYPE_LOGICRAFT = 0x8148 ETHERTYPE_LOOPBACK = 0x9000 ETHERTYPE_MATRA = 0x807a ETHERTYPE_MAX = 0xffff ETHERTYPE_MERIT = 0x807c ETHERTYPE_MICP = 0x873a ETHERTYPE_MOPDL = 0x6001 ETHERTYPE_MOPRC = 0x6002 ETHERTYPE_MOTOROLA = 0x818d ETHERTYPE_MPLS = 0x8847 ETHERTYPE_MPLS_MCAST = 0x8848 ETHERTYPE_MUMPS = 0x813f ETHERTYPE_NBPCC = 0x3c04 ETHERTYPE_NBPCLAIM = 0x3c09 ETHERTYPE_NBPCLREQ = 0x3c05 ETHERTYPE_NBPCLRSP = 0x3c06 ETHERTYPE_NBPCREQ = 0x3c02 ETHERTYPE_NBPCRSP = 0x3c03 ETHERTYPE_NBPDG = 0x3c07 ETHERTYPE_NBPDGB = 0x3c08 ETHERTYPE_NBPDLTE = 0x3c0a ETHERTYPE_NBPRAR = 0x3c0c ETHERTYPE_NBPRAS = 0x3c0b ETHERTYPE_NBPRST = 0x3c0d ETHERTYPE_NBPSCD = 0x3c01 ETHERTYPE_NBPVCD = 0x3c00 ETHERTYPE_NBS = 0x802 ETHERTYPE_NCD = 0x8149 ETHERTYPE_NESTAR = 0x8006 ETHERTYPE_NETBEUI = 0x8191 ETHERTYPE_NOVELL = 0x8138 ETHERTYPE_NS = 0x600 ETHERTYPE_NSAT = 0x601 ETHERTYPE_NSCOMPAT = 0x807 ETHERTYPE_NTRAILER = 0x10 ETHERTYPE_OS9 = 0x7007 ETHERTYPE_OS9NET = 0x7009 ETHERTYPE_PACER = 0x80c6 ETHERTYPE_PAE = 0x888e ETHERTYPE_PCS = 0x4242 ETHERTYPE_PLANNING = 0x8044 ETHERTYPE_PPP = 0x880b ETHERTYPE_PPPOE = 0x8864 ETHERTYPE_PPPOEDISC = 0x8863 ETHERTYPE_PRIMENTS = 0x7031 ETHERTYPE_PUP = 0x200 ETHERTYPE_PUPAT = 0x200 ETHERTYPE_RACAL = 0x7030 ETHERTYPE_RATIONAL = 0x8150 ETHERTYPE_RAWFR = 0x6559 ETHERTYPE_RCL = 0x1995 ETHERTYPE_RDP = 0x8739 ETHERTYPE_RETIX = 0x80f2 ETHERTYPE_REVARP = 0x8035 ETHERTYPE_SCA = 0x6007 ETHERTYPE_SECTRA = 0x86db ETHERTYPE_SECUREDATA = 0x876d ETHERTYPE_SGITW = 0x817e ETHERTYPE_SG_BOUNCE = 0x8016 ETHERTYPE_SG_DIAG = 0x8013 ETHERTYPE_SG_NETGAMES = 0x8014 ETHERTYPE_SG_RESV = 0x8015 ETHERTYPE_SIMNET = 0x5208 ETHERTYPE_SLOWPROTOCOLS = 0x8809 ETHERTYPE_SNA = 0x80d5 ETHERTYPE_SNMP = 0x814c ETHERTYPE_SONIX = 0xfaf5 ETHERTYPE_SPIDER = 0x809f ETHERTYPE_SPRITE = 0x500 ETHERTYPE_STP = 0x8181 ETHERTYPE_TALARIS = 0x812b ETHERTYPE_TALARISMC = 0x852b ETHERTYPE_TCPCOMP = 0x876b ETHERTYPE_TCPSM = 0x9002 ETHERTYPE_TEC = 0x814f ETHERTYPE_TIGAN = 0x802f ETHERTYPE_TRAIL = 0x1000 ETHERTYPE_TRANSETHER = 0x6558 ETHERTYPE_TYMSHARE = 0x802e ETHERTYPE_UBBST = 0x7005 ETHERTYPE_UBDEBUG = 0x900 ETHERTYPE_UBDIAGLOOP = 0x7002 ETHERTYPE_UBDL = 0x7000 ETHERTYPE_UBNIU = 0x7001 ETHERTYPE_UBNMC = 0x7003 ETHERTYPE_VALID = 0x1600 ETHERTYPE_VARIAN = 0x80dd ETHERTYPE_VAXELN = 0x803b ETHERTYPE_VEECO = 0x8067 ETHERTYPE_VEXP = 0x805b ETHERTYPE_VGLAB = 0x8131 ETHERTYPE_VINES = 0xbad ETHERTYPE_VINESECHO = 0xbaf ETHERTYPE_VINESLOOP = 0xbae ETHERTYPE_VITAL = 0xff00 ETHERTYPE_VLAN = 0x8100 ETHERTYPE_VLTLMAN = 0x8080 ETHERTYPE_VPROD = 0x805c ETHERTYPE_VURESERVED = 0x8147 ETHERTYPE_WATERLOO = 0x8130 ETHERTYPE_WELLFLEET = 0x8103 ETHERTYPE_X25 = 0x805 ETHERTYPE_X75 = 0x801 ETHERTYPE_XNSSM = 0x9001 ETHERTYPE_XTP = 0x817d ETHER_ADDR_LEN = 0x6 ETHER_CRC_LEN = 0x4 ETHER_CRC_POLY_BE = 0x4c11db6 ETHER_CRC_POLY_LE = 0xedb88320 ETHER_HDR_LEN = 0xe ETHER_MAX_LEN = 0x5ee ETHER_MAX_LEN_JUMBO = 0x233a ETHER_MIN_LEN = 0x40 ETHER_PPPOE_ENCAP_LEN = 0x8 ETHER_TYPE_LEN = 0x2 ETHER_VLAN_ENCAP_LEN = 0x4 EVFILT_AIO = 0x2 EVFILT_PROC = 0x4 EVFILT_READ = 0x0 EVFILT_SIGNAL = 0x5 EVFILT_SYSCOUNT = 0x7 EVFILT_TIMER = 0x6 EVFILT_VNODE = 0x3 EVFILT_WRITE = 0x1 EV_ADD = 0x1 EV_CLEAR = 0x20 EV_DELETE = 0x2 EV_DISABLE = 0x8 EV_ENABLE = 0x4 EV_EOF = 0x8000 EV_ERROR = 0x4000 EV_FLAG1 = 0x2000 EV_ONESHOT = 0x10 EV_SYSFLAGS = 0xf000 EXTA = 0x4b00 EXTATTR_CMD_START = 0x1 EXTATTR_CMD_STOP = 0x2 EXTATTR_NAMESPACE_SYSTEM = 0x2 EXTATTR_NAMESPACE_USER = 0x1 EXTB = 0x9600 EXTPROC = 0x800 FD_CLOEXEC = 0x1 FD_SETSIZE = 0x100 FLUSHO = 0x800000 F_CLOSEM = 0xa F_DUPFD = 0x0 F_DUPFD_CLOEXEC = 0xc F_FSCTL = -0x80000000 F_FSDIRMASK = 0x70000000 F_FSIN = 0x10000000 F_FSINOUT = 0x30000000 F_FSOUT = 0x20000000 F_FSPRIV = 0x8000 F_FSVOID = 0x40000000 F_GETFD = 0x1 F_GETFL = 0x3 F_GETLK = 0x7 F_GETNOSIGPIPE = 0xd F_GETOWN = 0x5 F_MAXFD = 0xb F_OK = 0x0 F_PARAM_MASK = 0xfff F_PARAM_MAX = 0xfff F_RDLCK = 0x1 F_SETFD = 0x2 F_SETFL = 0x4 F_SETLK = 0x8 F_SETLKW = 0x9 F_SETNOSIGPIPE = 0xe F_SETOWN = 0x6 F_UNLCK = 0x2 F_WRLCK = 0x3 HUPCL = 0x4000 HW_MACHINE = 0x1 ICANON = 0x100 ICMP6_FILTER = 0x12 ICRNL = 0x100 IEXTEN = 0x400 IFAN_ARRIVAL = 0x0 IFAN_DEPARTURE = 0x1 IFA_ROUTE = 0x1 IFF_ALLMULTI = 0x200 IFF_BROADCAST = 0x2 IFF_CANTCHANGE = 0x8f52 IFF_DEBUG = 0x4 IFF_LINK0 = 0x1000 IFF_LINK1 = 0x2000 IFF_LINK2 = 0x4000 IFF_LOOPBACK = 0x8 IFF_MULTICAST = 0x8000 IFF_NOARP = 0x80 IFF_NOTRAILERS = 0x20 IFF_OACTIVE = 0x400 IFF_POINTOPOINT = 0x10 IFF_PROMISC = 0x100 IFF_RUNNING = 0x40 IFF_SIMPLEX = 0x800 IFF_UP = 0x1 IFNAMSIZ = 0x10 IFT_1822 = 0x2 IFT_A12MPPSWITCH = 0x82 IFT_AAL2 = 0xbb IFT_AAL5 = 0x31 IFT_ADSL = 0x5e IFT_AFLANE8023 = 0x3b IFT_AFLANE8025 = 0x3c IFT_ARAP = 0x58 IFT_ARCNET = 0x23 IFT_ARCNETPLUS = 0x24 IFT_ASYNC = 0x54 IFT_ATM = 0x25 IFT_ATMDXI = 0x69 IFT_ATMFUNI = 0x6a IFT_ATMIMA = 0x6b IFT_ATMLOGICAL = 0x50 IFT_ATMRADIO = 0xbd IFT_ATMSUBINTERFACE = 0x86 IFT_ATMVCIENDPT = 0xc2 IFT_ATMVIRTUAL = 0x95 IFT_BGPPOLICYACCOUNTING = 0xa2 IFT_BRIDGE = 0xd1 IFT_BSC = 0x53 IFT_CARP = 0xf8 IFT_CCTEMUL = 0x3d IFT_CEPT = 0x13 IFT_CES = 0x85 IFT_CHANNEL = 0x46 IFT_CNR = 0x55 IFT_COFFEE = 0x84 IFT_COMPOSITELINK = 0x9b IFT_DCN = 0x8d IFT_DIGITALPOWERLINE = 0x8a IFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba IFT_DLSW = 0x4a IFT_DOCSCABLEDOWNSTREAM = 0x80 IFT_DOCSCABLEMACLAYER = 0x7f IFT_DOCSCABLEUPSTREAM = 0x81 IFT_DOCSCABLEUPSTREAMCHANNEL = 0xcd IFT_DS0 = 0x51 IFT_DS0BUNDLE = 0x52 IFT_DS1FDL = 0xaa IFT_DS3 = 0x1e IFT_DTM = 0x8c IFT_DVBASILN = 0xac IFT_DVBASIOUT = 0xad IFT_DVBRCCDOWNSTREAM = 0x93 IFT_DVBRCCMACLAYER = 0x92 IFT_DVBRCCUPSTREAM = 0x94 IFT_ECONET = 0xce IFT_EON = 0x19 IFT_EPLRS = 0x57 IFT_ESCON = 0x49 IFT_ETHER = 0x6 IFT_FAITH = 0xf2 IFT_FAST = 0x7d IFT_FASTETHER = 0x3e IFT_FASTETHERFX = 0x45 IFT_FDDI = 0xf IFT_FIBRECHANNEL = 0x38 IFT_FRAMERELAYINTERCONNECT = 0x3a IFT_FRAMERELAYMPI = 0x5c IFT_FRDLCIENDPT = 0xc1 IFT_FRELAY = 0x20 IFT_FRELAYDCE = 0x2c IFT_FRF16MFRBUNDLE = 0xa3 IFT_FRFORWARD = 0x9e IFT_G703AT2MB = 0x43 IFT_G703AT64K = 0x42 IFT_GIF = 0xf0 IFT_GIGABITETHERNET = 0x75 IFT_GR303IDT = 0xb2 IFT_GR303RDT = 0xb1 IFT_H323GATEKEEPER = 0xa4 IFT_H323PROXY = 0xa5 IFT_HDH1822 = 0x3 IFT_HDLC = 0x76 IFT_HDSL2 = 0xa8 IFT_HIPERLAN2 = 0xb7 IFT_HIPPI = 0x2f IFT_HIPPIINTERFACE = 0x39 IFT_HOSTPAD = 0x5a IFT_HSSI = 0x2e IFT_HY = 0xe IFT_IBM370PARCHAN = 0x48 IFT_IDSL = 0x9a IFT_IEEE1394 = 0x90 IFT_IEEE80211 = 0x47 IFT_IEEE80212 = 0x37 IFT_IEEE8023ADLAG = 0xa1 IFT_IFGSN = 0x91 IFT_IMT = 0xbe IFT_INFINIBAND = 0xc7 IFT_INTERLEAVE = 0x7c IFT_IP = 0x7e IFT_IPFORWARD = 0x8e IFT_IPOVERATM = 0x72 IFT_IPOVERCDLC = 0x6d IFT_IPOVERCLAW = 0x6e IFT_IPSWITCH = 0x4e IFT_ISDN = 0x3f IFT_ISDNBASIC = 0x14 IFT_ISDNPRIMARY = 0x15 IFT_ISDNS = 0x4b IFT_ISDNU = 0x4c IFT_ISO88022LLC = 0x29 IFT_ISO88023 = 0x7 IFT_ISO88024 = 0x8 IFT_ISO88025 = 0x9 IFT_ISO88025CRFPINT = 0x62 IFT_ISO88025DTR = 0x56 IFT_ISO88025FIBER = 0x73 IFT_ISO88026 = 0xa IFT_ISUP = 0xb3 IFT_L2VLAN = 0x87 IFT_L3IPVLAN = 0x88 IFT_L3IPXVLAN = 0x89 IFT_LAPB = 0x10 IFT_LAPD = 0x4d IFT_LAPF = 0x77 IFT_LINEGROUP = 0xd2 IFT_LOCALTALK = 0x2a IFT_LOOP = 0x18 IFT_MEDIAMAILOVERIP = 0x8b IFT_MFSIGLINK = 0xa7 IFT_MIOX25 = 0x26 IFT_MODEM = 0x30 IFT_MPC = 0x71 IFT_MPLS = 0xa6 IFT_MPLSTUNNEL = 0x96 IFT_MSDSL = 0x8f IFT_MVL = 0xbf IFT_MYRINET = 0x63 IFT_NFAS = 0xaf IFT_NSIP = 0x1b IFT_OPTICALCHANNEL = 0xc3 IFT_OPTICALTRANSPORT = 0xc4 IFT_OTHER = 0x1 IFT_P10 = 0xc IFT_P80 = 0xd IFT_PARA = 0x22 IFT_PFLOG = 0xf5 IFT_PFSYNC = 0xf6 IFT_PLC = 0xae IFT_PON155 = 0xcf IFT_PON622 = 0xd0 IFT_POS = 0xab IFT_PPP = 0x17 IFT_PPPMULTILINKBUNDLE = 0x6c IFT_PROPATM = 0xc5 IFT_PROPBWAP2MP = 0xb8 IFT_PROPCNLS = 0x59 IFT_PROPDOCSWIRELESSDOWNSTREAM = 0xb5 IFT_PROPDOCSWIRELESSMACLAYER = 0xb4 IFT_PROPDOCSWIRELESSUPSTREAM = 0xb6 IFT_PROPMUX = 0x36 IFT_PROPVIRTUAL = 0x35 IFT_PROPWIRELESSP2P = 0x9d IFT_PTPSERIAL = 0x16 IFT_PVC = 0xf1 IFT_Q2931 = 0xc9 IFT_QLLC = 0x44 IFT_RADIOMAC = 0xbc IFT_RADSL = 0x5f IFT_REACHDSL = 0xc0 IFT_RFC1483 = 0x9f IFT_RS232 = 0x21 IFT_RSRB = 0x4f IFT_SDLC = 0x11 IFT_SDSL = 0x60 IFT_SHDSL = 0xa9 IFT_SIP = 0x1f IFT_SIPSIG = 0xcc IFT_SIPTG = 0xcb IFT_SLIP = 0x1c IFT_SMDSDXI = 0x2b IFT_SMDSICIP = 0x34 IFT_SONET = 0x27 IFT_SONETOVERHEADCHANNEL = 0xb9 IFT_SONETPATH = 0x32 IFT_SONETVT = 0x33 IFT_SRP = 0x97 IFT_SS7SIGLINK = 0x9c IFT_STACKTOSTACK = 0x6f IFT_STARLAN = 0xb IFT_STF = 0xd7 IFT_T1 = 0x12 IFT_TDLC = 0x74 IFT_TELINK = 0xc8 IFT_TERMPAD = 0x5b IFT_TR008 = 0xb0 IFT_TRANSPHDLC = 0x7b IFT_TUNNEL = 0x83 IFT_ULTRA = 0x1d IFT_USB = 0xa0 IFT_V11 = 0x40 IFT_V35 = 0x2d IFT_V36 = 0x41 IFT_V37 = 0x78 IFT_VDSL = 0x61 IFT_VIRTUALIPADDRESS = 0x70 IFT_VIRTUALTG = 0xca IFT_VOICEDID = 0xd5 IFT_VOICEEM = 0x64 IFT_VOICEEMFGD = 0xd3 IFT_VOICEENCAP = 0x67 IFT_VOICEFGDEANA = 0xd4 IFT_VOICEFXO = 0x65 IFT_VOICEFXS = 0x66 IFT_VOICEOVERATM = 0x98 IFT_VOICEOVERCABLE = 0xc6 IFT_VOICEOVERFRAMERELAY = 0x99 IFT_VOICEOVERIP = 0x68 IFT_X213 = 0x5d IFT_X25 = 0x5 IFT_X25DDN = 0x4 IFT_X25HUNTGROUP = 0x7a IFT_X25MLP = 0x79 IFT_X25PLE = 0x28 IFT_XETHER = 0x1a IGNBRK = 0x1 IGNCR = 0x80 IGNPAR = 0x4 IMAXBEL = 0x2000 INLCR = 0x40 INPCK = 0x10 IN_CLASSA_HOST = 0xffffff IN_CLASSA_MAX = 0x80 IN_CLASSA_NET = 0xff000000 IN_CLASSA_NSHIFT = 0x18 IN_CLASSB_HOST = 0xffff IN_CLASSB_MAX = 0x10000 IN_CLASSB_NET = 0xffff0000 IN_CLASSB_NSHIFT = 0x10 IN_CLASSC_HOST = 0xff IN_CLASSC_NET = 0xffffff00 IN_CLASSC_NSHIFT = 0x8 IN_CLASSD_HOST = 0xfffffff IN_CLASSD_NET = 0xf0000000 IN_CLASSD_NSHIFT = 0x1c IN_LOOPBACKNET = 0x7f IPPROTO_AH = 0x33 IPPROTO_CARP = 0x70 IPPROTO_DONE = 0x101 IPPROTO_DSTOPTS = 0x3c IPPROTO_EGP = 0x8 IPPROTO_ENCAP = 0x62 IPPROTO_EON = 0x50 IPPROTO_ESP = 0x32 IPPROTO_ETHERIP = 0x61 IPPROTO_FRAGMENT = 0x2c IPPROTO_GGP = 0x3 IPPROTO_GRE = 0x2f IPPROTO_HOPOPTS = 0x0 IPPROTO_ICMP = 0x1 IPPROTO_ICMPV6 = 0x3a IPPROTO_IDP = 0x16 IPPROTO_IGMP = 0x2 IPPROTO_IP = 0x0 IPPROTO_IPCOMP = 0x6c IPPROTO_IPIP = 0x4 IPPROTO_IPV4 = 0x4 IPPROTO_IPV6 = 0x29 IPPROTO_IPV6_ICMP = 0x3a IPPROTO_MAX = 0x100 IPPROTO_MAXID = 0x34 IPPROTO_MOBILE = 0x37 IPPROTO_NONE = 0x3b IPPROTO_PFSYNC = 0xf0 IPPROTO_PIM = 0x67 IPPROTO_PUP = 0xc IPPROTO_RAW = 0xff IPPROTO_ROUTING = 0x2b IPPROTO_RSVP = 0x2e IPPROTO_TCP = 0x6 IPPROTO_TP = 0x1d IPPROTO_UDP = 0x11 IPPROTO_VRRP = 0x70 IPV6_CHECKSUM = 0x1a IPV6_DEFAULT_MULTICAST_HOPS = 0x1 IPV6_DEFAULT_MULTICAST_LOOP = 0x1 IPV6_DEFHLIM = 0x40 IPV6_DONTFRAG = 0x3e IPV6_DSTOPTS = 0x32 IPV6_FAITH = 0x1d IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_MASK = 0xffff0f00 IPV6_FRAGTTL = 0x78 IPV6_HLIMDEC = 0x1 IPV6_HOPLIMIT = 0x2f IPV6_HOPOPTS = 0x31 IPV6_IPSEC_POLICY = 0x1c IPV6_JOIN_GROUP = 0xc IPV6_LEAVE_GROUP = 0xd IPV6_MAXHLIM = 0xff IPV6_MAXPACKET = 0xffff IPV6_MMTU = 0x500 IPV6_MULTICAST_HOPS = 0xa IPV6_MULTICAST_IF = 0x9 IPV6_MULTICAST_LOOP = 0xb IPV6_NEXTHOP = 0x30 IPV6_PATHMTU = 0x2c IPV6_PKTINFO = 0x2e IPV6_PORTRANGE = 0xe IPV6_PORTRANGE_DEFAULT = 0x0 IPV6_PORTRANGE_HIGH = 0x1 IPV6_PORTRANGE_LOW = 0x2 IPV6_RECVDSTOPTS = 0x28 IPV6_RECVHOPLIMIT = 0x25 IPV6_RECVHOPOPTS = 0x27 IPV6_RECVPATHMTU = 0x2b IPV6_RECVPKTINFO = 0x24 IPV6_RECVRTHDR = 0x26 IPV6_RECVTCLASS = 0x39 IPV6_RTHDR = 0x33 IPV6_RTHDRDSTOPTS = 0x23 IPV6_RTHDR_LOOSE = 0x0 IPV6_RTHDR_STRICT = 0x1 IPV6_RTHDR_TYPE_0 = 0x0 IPV6_SOCKOPT_RESERVED1 = 0x3 IPV6_TCLASS = 0x3d IPV6_UNICAST_HOPS = 0x4 IPV6_USE_MIN_MTU = 0x2a IPV6_V6ONLY = 0x1b IPV6_VERSION = 0x60 IPV6_VERSION_MASK = 0xf0 IP_ADD_MEMBERSHIP = 0xc IP_DEFAULT_MULTICAST_LOOP = 0x1 IP_DEFAULT_MULTICAST_TTL = 0x1 IP_DF = 0x4000 IP_DROP_MEMBERSHIP = 0xd IP_EF = 0x8000 IP_ERRORMTU = 0x15 IP_HDRINCL = 0x2 IP_IPSEC_POLICY = 0x16 IP_MAXPACKET = 0xffff IP_MAX_MEMBERSHIPS = 0x14 IP_MF = 0x2000 IP_MINFRAGSIZE = 0x45 IP_MINTTL = 0x18 IP_MSS = 0x240 IP_MULTICAST_IF = 0x9 IP_MULTICAST_LOOP = 0xb IP_MULTICAST_TTL = 0xa IP_OFFMASK = 0x1fff IP_OPTIONS = 0x1 IP_PORTRANGE = 0x13 IP_PORTRANGE_DEFAULT = 0x0 IP_PORTRANGE_HIGH = 0x1 IP_PORTRANGE_LOW = 0x2 IP_RECVDSTADDR = 0x7 IP_RECVIF = 0x14 IP_RECVOPTS = 0x5 IP_RECVRETOPTS = 0x6 IP_RECVTTL = 0x17 IP_RETOPTS = 0x8 IP_RF = 0x8000 IP_TOS = 0x3 IP_TTL = 0x4 ISIG = 0x80 ISTRIP = 0x20 IXANY = 0x800 IXOFF = 0x400 IXON = 0x200 KERN_HOSTNAME = 0xa KERN_OSRELEASE = 0x2 KERN_OSTYPE = 0x1 KERN_VERSION = 0x4 LOCK_EX = 0x2 LOCK_NB = 0x4 LOCK_SH = 0x1 LOCK_UN = 0x8 MADV_DONTNEED = 0x4 MADV_FREE = 0x6 MADV_NORMAL = 0x0 MADV_RANDOM = 0x1 MADV_SEQUENTIAL = 0x2 MADV_SPACEAVAIL = 0x5 MADV_WILLNEED = 0x3 MAP_ALIGNMENT_16MB = 0x18000000 MAP_ALIGNMENT_1TB = 0x28000000 MAP_ALIGNMENT_256TB = 0x30000000 MAP_ALIGNMENT_4GB = 0x20000000 MAP_ALIGNMENT_64KB = 0x10000000 MAP_ALIGNMENT_64PB = 0x38000000 MAP_ALIGNMENT_MASK = -0x1000000 MAP_ALIGNMENT_SHIFT = 0x18 MAP_ANON = 0x1000 MAP_FILE = 0x0 MAP_FIXED = 0x10 MAP_HASSEMAPHORE = 0x200 MAP_INHERIT = 0x80 MAP_INHERIT_COPY = 0x1 MAP_INHERIT_DEFAULT = 0x1 MAP_INHERIT_DONATE_COPY = 0x3 MAP_INHERIT_NONE = 0x2 MAP_INHERIT_SHARE = 0x0 MAP_NORESERVE = 0x40 MAP_PRIVATE = 0x2 MAP_RENAME = 0x20 MAP_SHARED = 0x1 MAP_STACK = 0x2000 MAP_TRYFIXED = 0x400 MAP_WIRED = 0x800 MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MNT_ASYNC = 0x40 MNT_BASIC_FLAGS = 0xe782807f MNT_DEFEXPORTED = 0x200 MNT_DISCARD = 0x800000 MNT_EXKERB = 0x800 MNT_EXNORESPORT = 0x8000000 MNT_EXPORTANON = 0x400 MNT_EXPORTED = 0x100 MNT_EXPUBLIC = 0x10000000 MNT_EXRDONLY = 0x80 MNT_EXTATTR = 0x1000000 MNT_FORCE = 0x80000 MNT_GETARGS = 0x400000 MNT_IGNORE = 0x100000 MNT_LAZY = 0x3 MNT_LOCAL = 0x1000 MNT_LOG = 0x2000000 MNT_NOATIME = 0x4000000 MNT_NOCOREDUMP = 0x8000 MNT_NODEV = 0x10 MNT_NODEVMTIME = 0x40000000 MNT_NOEXEC = 0x4 MNT_NOSUID = 0x8 MNT_NOWAIT = 0x2 MNT_OP_FLAGS = 0x4d0000 MNT_QUOTA = 0x2000 MNT_RDONLY = 0x1 MNT_RELATIME = 0x20000 MNT_RELOAD = 0x40000 MNT_ROOTFS = 0x4000 MNT_SOFTDEP = 0x80000000 MNT_SYMPERM = 0x20000000 MNT_SYNCHRONOUS = 0x2 MNT_UNION = 0x20 MNT_UPDATE = 0x10000 MNT_VISFLAGMASK = 0xff90ffff MNT_WAIT = 0x1 MSG_BCAST = 0x100 MSG_CMSG_CLOEXEC = 0x800 MSG_CONTROLMBUF = 0x2000000 MSG_CTRUNC = 0x20 MSG_DONTROUTE = 0x4 MSG_DONTWAIT = 0x80 MSG_EOR = 0x8 MSG_IOVUSRSPACE = 0x4000000 MSG_LENUSRSPACE = 0x8000000 MSG_MCAST = 0x200 MSG_NAMEMBUF = 0x1000000 MSG_NBIO = 0x1000 MSG_NOSIGNAL = 0x400 MSG_OOB = 0x1 MSG_PEEK = 0x2 MSG_TRUNC = 0x10 MSG_USERFLAGS = 0xffffff MSG_WAITALL = 0x40 MS_ASYNC = 0x1 MS_INVALIDATE = 0x2 MS_SYNC = 0x4 NAME_MAX = 0x1ff NET_RT_DUMP = 0x1 NET_RT_FLAGS = 0x2 NET_RT_IFLIST = 0x5 NET_RT_MAXID = 0x6 NET_RT_OIFLIST = 0x4 NET_RT_OOIFLIST = 0x3 NFDBITS = 0x20 NOFLSH = 0x80000000 NOTE_ATTRIB = 0x8 NOTE_CHILD = 0x4 NOTE_DELETE = 0x1 NOTE_EXEC = 0x20000000 NOTE_EXIT = 0x80000000 NOTE_EXTEND = 0x4 NOTE_FORK = 0x40000000 NOTE_LINK = 0x10 NOTE_LOWAT = 0x1 NOTE_PCTRLMASK = 0xf0000000 NOTE_PDATAMASK = 0xfffff NOTE_RENAME = 0x20 NOTE_REVOKE = 0x40 NOTE_TRACK = 0x1 NOTE_TRACKERR = 0x2 NOTE_WRITE = 0x2 OCRNL = 0x10 OFIOGETBMAP = 0xc004667a ONLCR = 0x2 ONLRET = 0x40 ONOCR = 0x20 ONOEOT = 0x8 OPOST = 0x1 O_ACCMODE = 0x3 O_ALT_IO = 0x40000 O_APPEND = 0x8 O_ASYNC = 0x40 O_CLOEXEC = 0x400000 O_CREAT = 0x200 O_DIRECT = 0x80000 O_DIRECTORY = 0x200000 O_DSYNC = 0x10000 O_EXCL = 0x800 O_EXLOCK = 0x20 O_FSYNC = 0x80 O_NDELAY = 0x4 O_NOCTTY = 0x8000 O_NOFOLLOW = 0x100 O_NONBLOCK = 0x4 O_NOSIGPIPE = 0x1000000 O_RDONLY = 0x0 O_RDWR = 0x2 O_RSYNC = 0x20000 O_SHLOCK = 0x10 O_SYNC = 0x80 O_TRUNC = 0x400 O_WRONLY = 0x1 PARENB = 0x1000 PARMRK = 0x8 PARODD = 0x2000 PENDIN = 0x20000000 PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 PRI_IOFLUSH = 0x7c PROT_EXEC = 0x4 PROT_NONE = 0x0 PROT_READ = 0x1 PROT_WRITE = 0x2 RLIMIT_AS = 0xa RLIMIT_CORE = 0x4 RLIMIT_CPU = 0x0 RLIMIT_DATA = 0x2 RLIMIT_FSIZE = 0x1 RLIMIT_MEMLOCK = 0x6 RLIMIT_NOFILE = 0x8 RLIMIT_NPROC = 0x7 RLIMIT_RSS = 0x5 RLIMIT_STACK = 0x3 RLIM_INFINITY = 0x7fffffffffffffff RTAX_AUTHOR = 0x6 RTAX_BRD = 0x7 RTAX_DST = 0x0 RTAX_GATEWAY = 0x1 RTAX_GENMASK = 0x3 RTAX_IFA = 0x5 RTAX_IFP = 0x4 RTAX_MAX = 0x9 RTAX_NETMASK = 0x2 RTAX_TAG = 0x8 RTA_AUTHOR = 0x40 RTA_BRD = 0x80 RTA_DST = 0x1 RTA_GATEWAY = 0x2 RTA_GENMASK = 0x8 RTA_IFA = 0x20 RTA_IFP = 0x10 RTA_NETMASK = 0x4 RTA_TAG = 0x100 RTF_ANNOUNCE = 0x20000 RTF_BLACKHOLE = 0x1000 RTF_CLONED = 0x2000 RTF_CLONING = 0x100 RTF_DONE = 0x40 RTF_DYNAMIC = 0x10 RTF_GATEWAY = 0x2 RTF_HOST = 0x4 RTF_LLINFO = 0x400 RTF_MASK = 0x80 RTF_MODIFIED = 0x20 RTF_PROTO1 = 0x8000 RTF_PROTO2 = 0x4000 RTF_REJECT = 0x8 RTF_SRC = 0x10000 RTF_STATIC = 0x800 RTF_UP = 0x1 RTF_XRESOLVE = 0x200 RTM_ADD = 0x1 RTM_CHANGE = 0x3 RTM_CHGADDR = 0x15 RTM_DELADDR = 0xd RTM_DELETE = 0x2 RTM_GET = 0x4 RTM_IEEE80211 = 0x11 RTM_IFANNOUNCE = 0x10 RTM_IFINFO = 0x14 RTM_LLINFO_UPD = 0x13 RTM_LOCK = 0x8 RTM_LOSING = 0x5 RTM_MISS = 0x7 RTM_NEWADDR = 0xc RTM_OIFINFO = 0xf RTM_OLDADD = 0x9 RTM_OLDDEL = 0xa RTM_OOIFINFO = 0xe RTM_REDIRECT = 0x6 RTM_RESOLVE = 0xb RTM_RTTUNIT = 0xf4240 RTM_SETGATE = 0x12 RTM_VERSION = 0x4 RTV_EXPIRE = 0x4 RTV_HOPCOUNT = 0x2 RTV_MTU = 0x1 RTV_RPIPE = 0x8 RTV_RTT = 0x40 RTV_RTTVAR = 0x80 RTV_SPIPE = 0x10 RTV_SSTHRESH = 0x20 RUSAGE_CHILDREN = -0x1 RUSAGE_SELF = 0x0 SCM_CREDS = 0x4 SCM_RIGHTS = 0x1 SCM_TIMESTAMP = 0x8 SHUT_RD = 0x0 SHUT_RDWR = 0x2 SHUT_WR = 0x1 SIOCADDMULTI = 0x80906931 SIOCADDRT = 0x8038720a SIOCAIFADDR = 0x8040691a SIOCALIFADDR = 0x8118691c SIOCATMARK = 0x40047307 SIOCDELMULTI = 0x80906932 SIOCDELRT = 0x8038720b SIOCDIFADDR = 0x80906919 SIOCDIFPHYADDR = 0x80906949 SIOCDLIFADDR = 0x8118691e SIOCGDRVSPEC = 0xc028697b SIOCGETPFSYNC = 0xc09069f8 SIOCGETSGCNT = 0xc0207534 SIOCGETVIFCNT = 0xc0287533 SIOCGHIWAT = 0x40047301 SIOCGIFADDR = 0xc0906921 SIOCGIFADDRPREF = 0xc0986920 SIOCGIFALIAS = 0xc040691b SIOCGIFBRDADDR = 0xc0906923 SIOCGIFCAP = 0xc0206976 SIOCGIFCONF = 0xc0106926 SIOCGIFDATA = 0xc0986985 SIOCGIFDLT = 0xc0906977 SIOCGIFDSTADDR = 0xc0906922 SIOCGIFFLAGS = 0xc0906911 SIOCGIFGENERIC = 0xc090693a SIOCGIFMEDIA = 0xc0306936 SIOCGIFMETRIC = 0xc0906917 SIOCGIFMTU = 0xc090697e SIOCGIFNETMASK = 0xc0906925 SIOCGIFPDSTADDR = 0xc0906948 SIOCGIFPSRCADDR = 0xc0906947 SIOCGLIFADDR = 0xc118691d SIOCGLIFPHYADDR = 0xc118694b SIOCGLINKSTR = 0xc0286987 SIOCGLOWAT = 0x40047303 SIOCGPGRP = 0x40047309 SIOCGVH = 0xc0906983 SIOCIFCREATE = 0x8090697a SIOCIFDESTROY = 0x80906979 SIOCIFGCLONERS = 0xc0106978 SIOCINITIFADDR = 0xc0706984 SIOCSDRVSPEC = 0x8028697b SIOCSETPFSYNC = 0x809069f7 SIOCSHIWAT = 0x80047300 SIOCSIFADDR = 0x8090690c SIOCSIFADDRPREF = 0x8098691f SIOCSIFBRDADDR = 0x80906913 SIOCSIFCAP = 0x80206975 SIOCSIFDSTADDR = 0x8090690e SIOCSIFFLAGS = 0x80906910 SIOCSIFGENERIC = 0x80906939 SIOCSIFMEDIA = 0xc0906935 SIOCSIFMETRIC = 0x80906918 SIOCSIFMTU = 0x8090697f SIOCSIFNETMASK = 0x80906916 SIOCSIFPHYADDR = 0x80406946 SIOCSLIFPHYADDR = 0x8118694a SIOCSLINKSTR = 0x80286988 SIOCSLOWAT = 0x80047302 SIOCSPGRP = 0x80047308 SIOCSVH = 0xc0906982 SIOCZIFDATA = 0xc0986986 SOCK_CLOEXEC = 0x10000000 SOCK_DGRAM = 0x2 SOCK_FLAGS_MASK = 0xf0000000 SOCK_NONBLOCK = 0x20000000 SOCK_NOSIGPIPE = 0x40000000 SOCK_RAW = 0x3 SOCK_RDM = 0x4 SOCK_SEQPACKET = 0x5 SOCK_STREAM = 0x1 SOL_SOCKET = 0xffff SOMAXCONN = 0x80 SO_ACCEPTCONN = 0x2 SO_ACCEPTFILTER = 0x1000 SO_BROADCAST = 0x20 SO_DEBUG = 0x1 SO_DONTROUTE = 0x10 SO_ERROR = 0x1007 SO_KEEPALIVE = 0x8 SO_LINGER = 0x80 SO_NOHEADER = 0x100a SO_NOSIGPIPE = 0x800 SO_OOBINLINE = 0x100 SO_OVERFLOWED = 0x1009 SO_RCVBUF = 0x1002 SO_RCVLOWAT = 0x1004 SO_RCVTIMEO = 0x100c SO_REUSEADDR = 0x4 SO_REUSEPORT = 0x200 SO_SNDBUF = 0x1001 SO_SNDLOWAT = 0x1003 SO_SNDTIMEO = 0x100b SO_TIMESTAMP = 0x2000 SO_TYPE = 0x1008 SO_USELOOPBACK = 0x40 SYSCTL_VERSION = 0x1000000 SYSCTL_VERS_0 = 0x0 SYSCTL_VERS_1 = 0x1000000 SYSCTL_VERS_MASK = 0xff000000 S_ARCH1 = 0x10000 S_ARCH2 = 0x20000 S_BLKSIZE = 0x200 S_IEXEC = 0x40 S_IFBLK = 0x6000 S_IFCHR = 0x2000 S_IFDIR = 0x4000 S_IFIFO = 0x1000 S_IFLNK = 0xa000 S_IFMT = 0xf000 S_IFREG = 0x8000 S_IFSOCK = 0xc000 S_IFWHT = 0xe000 S_IREAD = 0x100 S_IRGRP = 0x20 S_IROTH = 0x4 S_IRUSR = 0x100 S_IRWXG = 0x38 S_IRWXO = 0x7 S_IRWXU = 0x1c0 S_ISGID = 0x400 S_ISTXT = 0x200 S_ISUID = 0x800 S_ISVTX = 0x200 S_IWGRP = 0x10 S_IWOTH = 0x2 S_IWRITE = 0x80 S_IWUSR = 0x80 S_IXGRP = 0x8 S_IXOTH = 0x1 S_IXUSR = 0x40 S_LOGIN_SET = 0x1 TCIFLUSH = 0x1 TCIOFLUSH = 0x3 TCOFLUSH = 0x2 TCP_CONGCTL = 0x20 TCP_KEEPCNT = 0x6 TCP_KEEPIDLE = 0x3 TCP_KEEPINIT = 0x7 TCP_KEEPINTVL = 0x5 TCP_MAXBURST = 0x4 TCP_MAXSEG = 0x2 TCP_MAXWIN = 0xffff TCP_MAX_WINSHIFT = 0xe TCP_MD5SIG = 0x10 TCP_MINMSS = 0xd8 TCP_MSS = 0x218 TCP_NODELAY = 0x1 TCSAFLUSH = 0x2 TIOCCBRK = 0x2000747a TIOCCDTR = 0x20007478 TIOCCONS = 0x80047462 TIOCDCDTIMESTAMP = 0x40107458 TIOCDRAIN = 0x2000745e TIOCEXCL = 0x2000740d TIOCEXT = 0x80047460 TIOCFLAG_CDTRCTS = 0x10 TIOCFLAG_CLOCAL = 0x2 TIOCFLAG_CRTSCTS = 0x4 TIOCFLAG_MDMBUF = 0x8 TIOCFLAG_SOFTCAR = 0x1 TIOCFLUSH = 0x80047410 TIOCGETA = 0x402c7413 TIOCGETD = 0x4004741a TIOCGFLAGS = 0x4004745d TIOCGLINED = 0x40207442 TIOCGPGRP = 0x40047477 TIOCGQSIZE = 0x40047481 TIOCGRANTPT = 0x20007447 TIOCGSID = 0x40047463 TIOCGSIZE = 0x40087468 TIOCGWINSZ = 0x40087468 TIOCMBIC = 0x8004746b TIOCMBIS = 0x8004746c TIOCMGET = 0x4004746a TIOCMSET = 0x8004746d TIOCM_CAR = 0x40 TIOCM_CD = 0x40 TIOCM_CTS = 0x20 TIOCM_DSR = 0x100 TIOCM_DTR = 0x2 TIOCM_LE = 0x1 TIOCM_RI = 0x80 TIOCM_RNG = 0x80 TIOCM_RTS = 0x4 TIOCM_SR = 0x10 TIOCM_ST = 0x8 TIOCNOTTY = 0x20007471 TIOCNXCL = 0x2000740e TIOCOUTQ = 0x40047473 TIOCPKT = 0x80047470 TIOCPKT_DATA = 0x0 TIOCPKT_DOSTOP = 0x20 TIOCPKT_FLUSHREAD = 0x1 TIOCPKT_FLUSHWRITE = 0x2 TIOCPKT_IOCTL = 0x40 TIOCPKT_NOSTOP = 0x10 TIOCPKT_START = 0x8 TIOCPKT_STOP = 0x4 TIOCPTMGET = 0x40287446 TIOCPTSNAME = 0x40287448 TIOCRCVFRAME = 0x80087445 TIOCREMOTE = 0x80047469 TIOCSBRK = 0x2000747b TIOCSCTTY = 0x20007461 TIOCSDTR = 0x20007479 TIOCSETA = 0x802c7414 TIOCSETAF = 0x802c7416 TIOCSETAW = 0x802c7415 TIOCSETD = 0x8004741b TIOCSFLAGS = 0x8004745c TIOCSIG = 0x2000745f TIOCSLINED = 0x80207443 TIOCSPGRP = 0x80047476 TIOCSQSIZE = 0x80047480 TIOCSSIZE = 0x80087467 TIOCSTART = 0x2000746e TIOCSTAT = 0x80047465 TIOCSTI = 0x80017472 TIOCSTOP = 0x2000746f TIOCSWINSZ = 0x80087467 TIOCUCNTL = 0x80047466 TIOCXMTFRAME = 0x80087444 TOSTOP = 0x400000 VDISCARD = 0xf VDSUSP = 0xb VEOF = 0x0 VEOL = 0x1 VEOL2 = 0x2 VERASE = 0x3 VINTR = 0x8 VKILL = 0x5 VLNEXT = 0xe VMIN = 0x10 VQUIT = 0x9 VREPRINT = 0x6 VSTART = 0xc VSTATUS = 0x12 VSTOP = 0xd VSUSP = 0xa VTIME = 0x11 VWERASE = 0x4 WALL = 0x8 WALLSIG = 0x8 WALTSIG = 0x4 WCLONE = 0x4 WCOREFLAG = 0x80 WNOHANG = 0x1 WNOWAIT = 0x10000 WNOZOMBIE = 0x20000 WOPTSCHECKED = 0x40000 WSTOPPED = 0x7f WUNTRACED = 0x2 ) // Errors const ( E2BIG = syscall.Errno(0x7) EACCES = syscall.Errno(0xd) EADDRINUSE = syscall.Errno(0x30) EADDRNOTAVAIL = syscall.Errno(0x31) EAFNOSUPPORT = syscall.Errno(0x2f) EAGAIN = syscall.Errno(0x23) EALREADY = syscall.Errno(0x25) EAUTH = syscall.Errno(0x50) EBADF = syscall.Errno(0x9) EBADMSG = syscall.Errno(0x58) EBADRPC = syscall.Errno(0x48) EBUSY = syscall.Errno(0x10) ECANCELED = syscall.Errno(0x57) ECHILD = syscall.Errno(0xa) ECONNABORTED = syscall.Errno(0x35) ECONNREFUSED = syscall.Errno(0x3d) ECONNRESET = syscall.Errno(0x36) EDEADLK = syscall.Errno(0xb) EDESTADDRREQ = syscall.Errno(0x27) EDOM = syscall.Errno(0x21) EDQUOT = syscall.Errno(0x45) EEXIST = syscall.Errno(0x11) EFAULT = syscall.Errno(0xe) EFBIG = syscall.Errno(0x1b) EFTYPE = syscall.Errno(0x4f) EHOSTDOWN = syscall.Errno(0x40) EHOSTUNREACH = syscall.Errno(0x41) EIDRM = syscall.Errno(0x52) EILSEQ = syscall.Errno(0x55) EINPROGRESS = syscall.Errno(0x24) EINTR = syscall.Errno(0x4) EINVAL = syscall.Errno(0x16) EIO = syscall.Errno(0x5) EISCONN = syscall.Errno(0x38) EISDIR = syscall.Errno(0x15) ELAST = syscall.Errno(0x60) ELOOP = syscall.Errno(0x3e) EMFILE = syscall.Errno(0x18) EMLINK = syscall.Errno(0x1f) EMSGSIZE = syscall.Errno(0x28) EMULTIHOP = syscall.Errno(0x5e) ENAMETOOLONG = syscall.Errno(0x3f) ENEEDAUTH = syscall.Errno(0x51) ENETDOWN = syscall.Errno(0x32) ENETRESET = syscall.Errno(0x34) ENETUNREACH = syscall.Errno(0x33) ENFILE = syscall.Errno(0x17) ENOATTR = syscall.Errno(0x5d) ENOBUFS = syscall.Errno(0x37) ENODATA = syscall.Errno(0x59) ENODEV = syscall.Errno(0x13) ENOENT = syscall.Errno(0x2) ENOEXEC = syscall.Errno(0x8) ENOLCK = syscall.Errno(0x4d) ENOLINK = syscall.Errno(0x5f) ENOMEM = syscall.Errno(0xc) ENOMSG = syscall.Errno(0x53) ENOPROTOOPT = syscall.Errno(0x2a) ENOSPC = syscall.Errno(0x1c) ENOSR = syscall.Errno(0x5a) ENOSTR = syscall.Errno(0x5b) ENOSYS = syscall.Errno(0x4e) ENOTBLK = syscall.Errno(0xf) ENOTCONN = syscall.Errno(0x39) ENOTDIR = syscall.Errno(0x14) ENOTEMPTY = syscall.Errno(0x42) ENOTSOCK = syscall.Errno(0x26) ENOTSUP = syscall.Errno(0x56) ENOTTY = syscall.Errno(0x19) ENXIO = syscall.Errno(0x6) EOPNOTSUPP = syscall.Errno(0x2d) EOVERFLOW = syscall.Errno(0x54) EPERM = syscall.Errno(0x1) EPFNOSUPPORT = syscall.Errno(0x2e) EPIPE = syscall.Errno(0x20) EPROCLIM = syscall.Errno(0x43) EPROCUNAVAIL = syscall.Errno(0x4c) EPROGMISMATCH = syscall.Errno(0x4b) EPROGUNAVAIL = syscall.Errno(0x4a) EPROTO = syscall.Errno(0x60) EPROTONOSUPPORT = syscall.Errno(0x2b) EPROTOTYPE = syscall.Errno(0x29) ERANGE = syscall.Errno(0x22) EREMOTE = syscall.Errno(0x47) EROFS = syscall.Errno(0x1e) ERPCMISMATCH = syscall.Errno(0x49) ESHUTDOWN = syscall.Errno(0x3a) ESOCKTNOSUPPORT = syscall.Errno(0x2c) ESPIPE = syscall.Errno(0x1d) ESRCH = syscall.Errno(0x3) ESTALE = syscall.Errno(0x46) ETIME = syscall.Errno(0x5c) ETIMEDOUT = syscall.Errno(0x3c) ETOOMANYREFS = syscall.Errno(0x3b) ETXTBSY = syscall.Errno(0x1a) EUSERS = syscall.Errno(0x44) EWOULDBLOCK = syscall.Errno(0x23) EXDEV = syscall.Errno(0x12) ) // Signals const ( SIGABRT = syscall.Signal(0x6) SIGALRM = syscall.Signal(0xe) SIGBUS = syscall.Signal(0xa) SIGCHLD = syscall.Signal(0x14) SIGCONT = syscall.Signal(0x13) SIGEMT = syscall.Signal(0x7) SIGFPE = syscall.Signal(0x8) SIGHUP = syscall.Signal(0x1) SIGILL = syscall.Signal(0x4) SIGINFO = syscall.Signal(0x1d) SIGINT = syscall.Signal(0x2) SIGIO = syscall.Signal(0x17) SIGIOT = syscall.Signal(0x6) SIGKILL = syscall.Signal(0x9) SIGPIPE = syscall.Signal(0xd) SIGPROF = syscall.Signal(0x1b) SIGPWR = syscall.Signal(0x20) SIGQUIT = syscall.Signal(0x3) SIGSEGV = syscall.Signal(0xb) SIGSTOP = syscall.Signal(0x11) SIGSYS = syscall.Signal(0xc) SIGTERM = syscall.Signal(0xf) SIGTRAP = syscall.Signal(0x5) SIGTSTP = syscall.Signal(0x12) SIGTTIN = syscall.Signal(0x15) SIGTTOU = syscall.Signal(0x16) SIGURG = syscall.Signal(0x10) SIGUSR1 = syscall.Signal(0x1e) SIGUSR2 = syscall.Signal(0x1f) SIGVTALRM = syscall.Signal(0x1a) SIGWINCH = syscall.Signal(0x1c) SIGXCPU = syscall.Signal(0x18) SIGXFSZ = syscall.Signal(0x19) ) // Error table var errorList = [...]struct { num syscall.Errno name string desc string }{ {1, "EPERM", "operation not permitted"}, {2, "ENOENT", "no such file or directory"}, {3, "ESRCH", "no such process"}, {4, "EINTR", "interrupted system call"}, {5, "EIO", "input/output error"}, {6, "ENXIO", "device not configured"}, {7, "E2BIG", "argument list too long"}, {8, "ENOEXEC", "exec format error"}, {9, "EBADF", "bad file descriptor"}, {10, "ECHILD", "no child processes"}, {11, "EDEADLK", "resource deadlock avoided"}, {12, "ENOMEM", "cannot allocate memory"}, {13, "EACCES", "permission denied"}, {14, "EFAULT", "bad address"}, {15, "ENOTBLK", "block device required"}, {16, "EBUSY", "device busy"}, {17, "EEXIST", "file exists"}, {18, "EXDEV", "cross-device link"}, {19, "ENODEV", "operation not supported by device"}, {20, "ENOTDIR", "not a directory"}, {21, "EISDIR", "is a directory"}, {22, "EINVAL", "invalid argument"}, {23, "ENFILE", "too many open files in system"}, {24, "EMFILE", "too many open files"}, {25, "ENOTTY", "inappropriate ioctl for device"}, {26, "ETXTBSY", "text file busy"}, {27, "EFBIG", "file too large"}, {28, "ENOSPC", "no space left on device"}, {29, "ESPIPE", "illegal seek"}, {30, "EROFS", "read-only file system"}, {31, "EMLINK", "too many links"}, {32, "EPIPE", "broken pipe"}, {33, "EDOM", "numerical argument out of domain"}, {34, "ERANGE", "result too large or too small"}, {35, "EAGAIN", "resource temporarily unavailable"}, {36, "EINPROGRESS", "operation now in progress"}, {37, "EALREADY", "operation already in progress"}, {38, "ENOTSOCK", "socket operation on non-socket"}, {39, "EDESTADDRREQ", "destination address required"}, {40, "EMSGSIZE", "message too long"}, {41, "EPROTOTYPE", "protocol wrong type for socket"}, {42, "ENOPROTOOPT", "protocol option not available"}, {43, "EPROTONOSUPPORT", "protocol not supported"}, {44, "ESOCKTNOSUPPORT", "socket type not supported"}, {45, "EOPNOTSUPP", "operation not supported"}, {46, "EPFNOSUPPORT", "protocol family not supported"}, {47, "EAFNOSUPPORT", "address family not supported by protocol family"}, {48, "EADDRINUSE", "address already in use"}, {49, "EADDRNOTAVAIL", "can't assign requested address"}, {50, "ENETDOWN", "network is down"}, {51, "ENETUNREACH", "network is unreachable"}, {52, "ENETRESET", "network dropped connection on reset"}, {53, "ECONNABORTED", "software caused connection abort"}, {54, "ECONNRESET", "connection reset by peer"}, {55, "ENOBUFS", "no buffer space available"}, {56, "EISCONN", "socket is already connected"}, {57, "ENOTCONN", "socket is not connected"}, {58, "ESHUTDOWN", "can't send after socket shutdown"}, {59, "ETOOMANYREFS", "too many references: can't splice"}, {60, "ETIMEDOUT", "connection timed out"}, {61, "ECONNREFUSED", "connection refused"}, {62, "ELOOP", "too many levels of symbolic links"}, {63, "ENAMETOOLONG", "file name too long"}, {64, "EHOSTDOWN", "host is down"}, {65, "EHOSTUNREACH", "no route to host"}, {66, "ENOTEMPTY", "directory not empty"}, {67, "EPROCLIM", "too many processes"}, {68, "EUSERS", "too many users"}, {69, "EDQUOT", "disc quota exceeded"}, {70, "ESTALE", "stale NFS file handle"}, {71, "EREMOTE", "too many levels of remote in path"}, {72, "EBADRPC", "RPC struct is bad"}, {73, "ERPCMISMATCH", "RPC version wrong"}, {74, "EPROGUNAVAIL", "RPC prog. not avail"}, {75, "EPROGMISMATCH", "program version wrong"}, {76, "EPROCUNAVAIL", "bad procedure for program"}, {77, "ENOLCK", "no locks available"}, {78, "ENOSYS", "function not implemented"}, {79, "EFTYPE", "inappropriate file type or format"}, {80, "EAUTH", "authentication error"}, {81, "ENEEDAUTH", "need authenticator"}, {82, "EIDRM", "identifier removed"}, {83, "ENOMSG", "no message of desired type"}, {84, "EOVERFLOW", "value too large to be stored in data type"}, {85, "EILSEQ", "illegal byte sequence"}, {86, "ENOTSUP", "not supported"}, {87, "ECANCELED", "operation Canceled"}, {88, "EBADMSG", "bad or Corrupt message"}, {89, "ENODATA", "no message available"}, {90, "ENOSR", "no STREAM resources"}, {91, "ENOSTR", "not a STREAM"}, {92, "ETIME", "STREAM ioctl timeout"}, {93, "ENOATTR", "attribute not found"}, {94, "EMULTIHOP", "multihop attempted"}, {95, "ENOLINK", "link has been severed"}, {96, "ELAST", "protocol error"}, } // Signal table var signalList = [...]struct { num syscall.Signal name string desc string }{ {1, "SIGHUP", "hangup"}, {2, "SIGINT", "interrupt"}, {3, "SIGQUIT", "quit"}, {4, "SIGILL", "illegal instruction"}, {5, "SIGTRAP", "trace/BPT trap"}, {6, "SIGIOT", "abort trap"}, {7, "SIGEMT", "EMT trap"}, {8, "SIGFPE", "floating point exception"}, {9, "SIGKILL", "killed"}, {10, "SIGBUS", "bus error"}, {11, "SIGSEGV", "segmentation fault"}, {12, "SIGSYS", "bad system call"}, {13, "SIGPIPE", "broken pipe"}, {14, "SIGALRM", "alarm clock"}, {15, "SIGTERM", "terminated"}, {16, "SIGURG", "urgent I/O condition"}, {17, "SIGSTOP", "stopped (signal)"}, {18, "SIGTSTP", "stopped"}, {19, "SIGCONT", "continued"}, {20, "SIGCHLD", "child exited"}, {21, "SIGTTIN", "stopped (tty input)"}, {22, "SIGTTOU", "stopped (tty output)"}, {23, "SIGIO", "I/O possible"}, {24, "SIGXCPU", "cputime limit exceeded"}, {25, "SIGXFSZ", "filesize limit exceeded"}, {26, "SIGVTALRM", "virtual timer expired"}, {27, "SIGPROF", "profiling timer expired"}, {28, "SIGWINCH", "window size changes"}, {29, "SIGINFO", "information request"}, {30, "SIGUSR1", "user defined signal 1"}, {31, "SIGUSR2", "user defined signal 2"}, {32, "SIGPWR", "power fail/restart"}, } ================================================ FILE: vendor/golang.org/x/sys/unix/zerrors_netbsd_arm.go ================================================ // mkerrors.sh -marm // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm && netbsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -marm _const.go package unix import "syscall" const ( AF_APPLETALK = 0x10 AF_ARP = 0x1c AF_BLUETOOTH = 0x1f AF_CCITT = 0xa AF_CHAOS = 0x5 AF_CNT = 0x15 AF_COIP = 0x14 AF_DATAKIT = 0x9 AF_DECnet = 0xc AF_DLI = 0xd AF_E164 = 0x1a AF_ECMA = 0x8 AF_HYLINK = 0xf AF_IEEE80211 = 0x20 AF_IMPLINK = 0x3 AF_INET = 0x2 AF_INET6 = 0x18 AF_IPX = 0x17 AF_ISDN = 0x1a AF_ISO = 0x7 AF_LAT = 0xe AF_LINK = 0x12 AF_LOCAL = 0x1 AF_MAX = 0x23 AF_MPLS = 0x21 AF_NATM = 0x1b AF_NS = 0x6 AF_OROUTE = 0x11 AF_OSI = 0x7 AF_PUP = 0x4 AF_ROUTE = 0x22 AF_SNA = 0xb AF_UNIX = 0x1 AF_UNSPEC = 0x0 ARPHRD_ARCNET = 0x7 ARPHRD_ETHER = 0x1 ARPHRD_FRELAY = 0xf ARPHRD_IEEE1394 = 0x18 ARPHRD_IEEE802 = 0x6 ARPHRD_STRIP = 0x17 B0 = 0x0 B110 = 0x6e B115200 = 0x1c200 B1200 = 0x4b0 B134 = 0x86 B14400 = 0x3840 B150 = 0x96 B1800 = 0x708 B19200 = 0x4b00 B200 = 0xc8 B230400 = 0x38400 B2400 = 0x960 B28800 = 0x7080 B300 = 0x12c B38400 = 0x9600 B460800 = 0x70800 B4800 = 0x12c0 B50 = 0x32 B57600 = 0xe100 B600 = 0x258 B7200 = 0x1c20 B75 = 0x4b B76800 = 0x12c00 B921600 = 0xe1000 B9600 = 0x2580 BIOCFEEDBACK = 0x8004427d BIOCFLUSH = 0x20004268 BIOCGBLEN = 0x40044266 BIOCGDLT = 0x4004426a BIOCGDLTLIST = 0xc0084277 BIOCGETIF = 0x4090426b BIOCGFEEDBACK = 0x4004427c BIOCGHDRCMPLT = 0x40044274 BIOCGRTIMEOUT = 0x400c427b BIOCGSEESENT = 0x40044278 BIOCGSTATS = 0x4080426f BIOCGSTATSOLD = 0x4008426f BIOCIMMEDIATE = 0x80044270 BIOCPROMISC = 0x20004269 BIOCSBLEN = 0xc0044266 BIOCSDLT = 0x80044276 BIOCSETF = 0x80084267 BIOCSETIF = 0x8090426c BIOCSFEEDBACK = 0x8004427d BIOCSHDRCMPLT = 0x80044275 BIOCSRTIMEOUT = 0x800c427a BIOCSSEESENT = 0x80044279 BIOCSTCPF = 0x80084272 BIOCSUDPF = 0x80084273 BIOCVERSION = 0x40044271 BPF_A = 0x10 BPF_ABS = 0x20 BPF_ADD = 0x0 BPF_ALIGNMENT = 0x4 BPF_ALIGNMENT32 = 0x4 BPF_ALU = 0x4 BPF_AND = 0x50 BPF_B = 0x10 BPF_DFLTBUFSIZE = 0x100000 BPF_DIV = 0x30 BPF_H = 0x8 BPF_IMM = 0x0 BPF_IND = 0x40 BPF_JA = 0x0 BPF_JEQ = 0x10 BPF_JGE = 0x30 BPF_JGT = 0x20 BPF_JMP = 0x5 BPF_JSET = 0x40 BPF_K = 0x0 BPF_LD = 0x0 BPF_LDX = 0x1 BPF_LEN = 0x80 BPF_LSH = 0x60 BPF_MAJOR_VERSION = 0x1 BPF_MAXBUFSIZE = 0x1000000 BPF_MAXINSNS = 0x200 BPF_MEM = 0x60 BPF_MEMWORDS = 0x10 BPF_MINBUFSIZE = 0x20 BPF_MINOR_VERSION = 0x1 BPF_MISC = 0x7 BPF_MSH = 0xa0 BPF_MUL = 0x20 BPF_NEG = 0x80 BPF_OR = 0x40 BPF_RELEASE = 0x30bb6 BPF_RET = 0x6 BPF_RSH = 0x70 BPF_ST = 0x2 BPF_STX = 0x3 BPF_SUB = 0x10 BPF_TAX = 0x0 BPF_TXA = 0x80 BPF_W = 0x0 BPF_X = 0x8 BRKINT = 0x2 CFLUSH = 0xf CLOCAL = 0x8000 CPUSTATES = 0x5 CP_IDLE = 0x4 CP_INTR = 0x3 CP_NICE = 0x1 CP_SYS = 0x2 CP_USER = 0x0 CREAD = 0x800 CRTSCTS = 0x10000 CS5 = 0x0 CS6 = 0x100 CS7 = 0x200 CS8 = 0x300 CSIZE = 0x300 CSTART = 0x11 CSTATUS = 0x14 CSTOP = 0x13 CSTOPB = 0x400 CSUSP = 0x1a CTL_HW = 0x6 CTL_KERN = 0x1 CTL_MAXNAME = 0xc CTL_NET = 0x4 CTL_QUERY = -0x2 DIOCBSFLUSH = 0x20006478 DLT_A429 = 0xb8 DLT_A653_ICM = 0xb9 DLT_AIRONET_HEADER = 0x78 DLT_AOS = 0xde DLT_APPLE_IP_OVER_IEEE1394 = 0x8a DLT_ARCNET = 0x7 DLT_ARCNET_LINUX = 0x81 DLT_ATM_CLIP = 0x13 DLT_ATM_RFC1483 = 0xb DLT_AURORA = 0x7e DLT_AX25 = 0x3 DLT_AX25_KISS = 0xca DLT_BACNET_MS_TP = 0xa5 DLT_BLUETOOTH_HCI_H4 = 0xbb DLT_BLUETOOTH_HCI_H4_WITH_PHDR = 0xc9 DLT_CAN20B = 0xbe DLT_CAN_SOCKETCAN = 0xe3 DLT_CHAOS = 0x5 DLT_CISCO_IOS = 0x76 DLT_C_HDLC = 0x68 DLT_C_HDLC_WITH_DIR = 0xcd DLT_DECT = 0xdd DLT_DOCSIS = 0x8f DLT_ECONET = 0x73 DLT_EN10MB = 0x1 DLT_EN3MB = 0x2 DLT_ENC = 0x6d DLT_ERF = 0xc5 DLT_ERF_ETH = 0xaf DLT_ERF_POS = 0xb0 DLT_FC_2 = 0xe0 DLT_FC_2_WITH_FRAME_DELIMS = 0xe1 DLT_FDDI = 0xa DLT_FLEXRAY = 0xd2 DLT_FRELAY = 0x6b DLT_FRELAY_WITH_DIR = 0xce DLT_GCOM_SERIAL = 0xad DLT_GCOM_T1E1 = 0xac DLT_GPF_F = 0xab DLT_GPF_T = 0xaa DLT_GPRS_LLC = 0xa9 DLT_GSMTAP_ABIS = 0xda DLT_GSMTAP_UM = 0xd9 DLT_HDLC = 0x10 DLT_HHDLC = 0x79 DLT_HIPPI = 0xf DLT_IBM_SN = 0x92 DLT_IBM_SP = 0x91 DLT_IEEE802 = 0x6 DLT_IEEE802_11 = 0x69 DLT_IEEE802_11_RADIO = 0x7f DLT_IEEE802_11_RADIO_AVS = 0xa3 DLT_IEEE802_15_4 = 0xc3 DLT_IEEE802_15_4_LINUX = 0xbf DLT_IEEE802_15_4_NONASK_PHY = 0xd7 DLT_IEEE802_16_MAC_CPS = 0xbc DLT_IEEE802_16_MAC_CPS_RADIO = 0xc1 DLT_IPMB = 0xc7 DLT_IPMB_LINUX = 0xd1 DLT_IPNET = 0xe2 DLT_IPV4 = 0xe4 DLT_IPV6 = 0xe5 DLT_IP_OVER_FC = 0x7a DLT_JUNIPER_ATM1 = 0x89 DLT_JUNIPER_ATM2 = 0x87 DLT_JUNIPER_CHDLC = 0xb5 DLT_JUNIPER_ES = 0x84 DLT_JUNIPER_ETHER = 0xb2 DLT_JUNIPER_FRELAY = 0xb4 DLT_JUNIPER_GGSN = 0x85 DLT_JUNIPER_ISM = 0xc2 DLT_JUNIPER_MFR = 0x86 DLT_JUNIPER_MLFR = 0x83 DLT_JUNIPER_MLPPP = 0x82 DLT_JUNIPER_MONITOR = 0xa4 DLT_JUNIPER_PIC_PEER = 0xae DLT_JUNIPER_PPP = 0xb3 DLT_JUNIPER_PPPOE = 0xa7 DLT_JUNIPER_PPPOE_ATM = 0xa8 DLT_JUNIPER_SERVICES = 0x88 DLT_JUNIPER_ST = 0xc8 DLT_JUNIPER_VP = 0xb7 DLT_LAPB_WITH_DIR = 0xcf DLT_LAPD = 0xcb DLT_LIN = 0xd4 DLT_LINUX_EVDEV = 0xd8 DLT_LINUX_IRDA = 0x90 DLT_LINUX_LAPD = 0xb1 DLT_LINUX_SLL = 0x71 DLT_LOOP = 0x6c DLT_LTALK = 0x72 DLT_MFR = 0xb6 DLT_MOST = 0xd3 DLT_MPLS = 0xdb DLT_MTP2 = 0x8c DLT_MTP2_WITH_PHDR = 0x8b DLT_MTP3 = 0x8d DLT_NULL = 0x0 DLT_PCI_EXP = 0x7d DLT_PFLOG = 0x75 DLT_PFSYNC = 0x12 DLT_PPI = 0xc0 DLT_PPP = 0x9 DLT_PPP_BSDOS = 0xe DLT_PPP_ETHER = 0x33 DLT_PPP_PPPD = 0xa6 DLT_PPP_SERIAL = 0x32 DLT_PPP_WITH_DIR = 0xcc DLT_PRISM_HEADER = 0x77 DLT_PRONET = 0x4 DLT_RAIF1 = 0xc6 DLT_RAW = 0xc DLT_RAWAF_MASK = 0x2240000 DLT_RIO = 0x7c DLT_SCCP = 0x8e DLT_SITA = 0xc4 DLT_SLIP = 0x8 DLT_SLIP_BSDOS = 0xd DLT_SUNATM = 0x7b DLT_SYMANTEC_FIREWALL = 0x63 DLT_TZSP = 0x80 DLT_USB = 0xba DLT_USB_LINUX = 0xbd DLT_USB_LINUX_MMAPPED = 0xdc DLT_WIHART = 0xdf DLT_X2E_SERIAL = 0xd5 DLT_X2E_XORAYA = 0xd6 DT_BLK = 0x6 DT_CHR = 0x2 DT_DIR = 0x4 DT_FIFO = 0x1 DT_LNK = 0xa DT_REG = 0x8 DT_SOCK = 0xc DT_UNKNOWN = 0x0 DT_WHT = 0xe ECHO = 0x8 ECHOCTL = 0x40 ECHOE = 0x2 ECHOK = 0x4 ECHOKE = 0x1 ECHONL = 0x10 ECHOPRT = 0x20 EMUL_LINUX = 0x1 EMUL_LINUX32 = 0x5 EMUL_MAXID = 0x6 ETHERCAP_JUMBO_MTU = 0x4 ETHERCAP_VLAN_HWTAGGING = 0x2 ETHERCAP_VLAN_MTU = 0x1 ETHERMIN = 0x2e ETHERMTU = 0x5dc ETHERMTU_JUMBO = 0x2328 ETHERTYPE_8023 = 0x4 ETHERTYPE_AARP = 0x80f3 ETHERTYPE_ACCTON = 0x8390 ETHERTYPE_AEONIC = 0x8036 ETHERTYPE_ALPHA = 0x814a ETHERTYPE_AMBER = 0x6008 ETHERTYPE_AMOEBA = 0x8145 ETHERTYPE_APOLLO = 0x80f7 ETHERTYPE_APOLLODOMAIN = 0x8019 ETHERTYPE_APPLETALK = 0x809b ETHERTYPE_APPLITEK = 0x80c7 ETHERTYPE_ARGONAUT = 0x803a ETHERTYPE_ARP = 0x806 ETHERTYPE_AT = 0x809b ETHERTYPE_ATALK = 0x809b ETHERTYPE_ATOMIC = 0x86df ETHERTYPE_ATT = 0x8069 ETHERTYPE_ATTSTANFORD = 0x8008 ETHERTYPE_AUTOPHON = 0x806a ETHERTYPE_AXIS = 0x8856 ETHERTYPE_BCLOOP = 0x9003 ETHERTYPE_BOFL = 0x8102 ETHERTYPE_CABLETRON = 0x7034 ETHERTYPE_CHAOS = 0x804 ETHERTYPE_COMDESIGN = 0x806c ETHERTYPE_COMPUGRAPHIC = 0x806d ETHERTYPE_COUNTERPOINT = 0x8062 ETHERTYPE_CRONUS = 0x8004 ETHERTYPE_CRONUSVLN = 0x8003 ETHERTYPE_DCA = 0x1234 ETHERTYPE_DDE = 0x807b ETHERTYPE_DEBNI = 0xaaaa ETHERTYPE_DECAM = 0x8048 ETHERTYPE_DECCUST = 0x6006 ETHERTYPE_DECDIAG = 0x6005 ETHERTYPE_DECDNS = 0x803c ETHERTYPE_DECDTS = 0x803e ETHERTYPE_DECEXPER = 0x6000 ETHERTYPE_DECLAST = 0x8041 ETHERTYPE_DECLTM = 0x803f ETHERTYPE_DECMUMPS = 0x6009 ETHERTYPE_DECNETBIOS = 0x8040 ETHERTYPE_DELTACON = 0x86de ETHERTYPE_DIDDLE = 0x4321 ETHERTYPE_DLOG1 = 0x660 ETHERTYPE_DLOG2 = 0x661 ETHERTYPE_DN = 0x6003 ETHERTYPE_DOGFIGHT = 0x1989 ETHERTYPE_DSMD = 0x8039 ETHERTYPE_ECMA = 0x803 ETHERTYPE_ENCRYPT = 0x803d ETHERTYPE_ES = 0x805d ETHERTYPE_EXCELAN = 0x8010 ETHERTYPE_EXPERDATA = 0x8049 ETHERTYPE_FLIP = 0x8146 ETHERTYPE_FLOWCONTROL = 0x8808 ETHERTYPE_FRARP = 0x808 ETHERTYPE_GENDYN = 0x8068 ETHERTYPE_HAYES = 0x8130 ETHERTYPE_HIPPI_FP = 0x8180 ETHERTYPE_HITACHI = 0x8820 ETHERTYPE_HP = 0x8005 ETHERTYPE_IEEEPUP = 0xa00 ETHERTYPE_IEEEPUPAT = 0xa01 ETHERTYPE_IMLBL = 0x4c42 ETHERTYPE_IMLBLDIAG = 0x424c ETHERTYPE_IP = 0x800 ETHERTYPE_IPAS = 0x876c ETHERTYPE_IPV6 = 0x86dd ETHERTYPE_IPX = 0x8137 ETHERTYPE_IPXNEW = 0x8037 ETHERTYPE_KALPANA = 0x8582 ETHERTYPE_LANBRIDGE = 0x8038 ETHERTYPE_LANPROBE = 0x8888 ETHERTYPE_LAT = 0x6004 ETHERTYPE_LBACK = 0x9000 ETHERTYPE_LITTLE = 0x8060 ETHERTYPE_LOGICRAFT = 0x8148 ETHERTYPE_LOOPBACK = 0x9000 ETHERTYPE_MATRA = 0x807a ETHERTYPE_MAX = 0xffff ETHERTYPE_MERIT = 0x807c ETHERTYPE_MICP = 0x873a ETHERTYPE_MOPDL = 0x6001 ETHERTYPE_MOPRC = 0x6002 ETHERTYPE_MOTOROLA = 0x818d ETHERTYPE_MPLS = 0x8847 ETHERTYPE_MPLS_MCAST = 0x8848 ETHERTYPE_MUMPS = 0x813f ETHERTYPE_NBPCC = 0x3c04 ETHERTYPE_NBPCLAIM = 0x3c09 ETHERTYPE_NBPCLREQ = 0x3c05 ETHERTYPE_NBPCLRSP = 0x3c06 ETHERTYPE_NBPCREQ = 0x3c02 ETHERTYPE_NBPCRSP = 0x3c03 ETHERTYPE_NBPDG = 0x3c07 ETHERTYPE_NBPDGB = 0x3c08 ETHERTYPE_NBPDLTE = 0x3c0a ETHERTYPE_NBPRAR = 0x3c0c ETHERTYPE_NBPRAS = 0x3c0b ETHERTYPE_NBPRST = 0x3c0d ETHERTYPE_NBPSCD = 0x3c01 ETHERTYPE_NBPVCD = 0x3c00 ETHERTYPE_NBS = 0x802 ETHERTYPE_NCD = 0x8149 ETHERTYPE_NESTAR = 0x8006 ETHERTYPE_NETBEUI = 0x8191 ETHERTYPE_NOVELL = 0x8138 ETHERTYPE_NS = 0x600 ETHERTYPE_NSAT = 0x601 ETHERTYPE_NSCOMPAT = 0x807 ETHERTYPE_NTRAILER = 0x10 ETHERTYPE_OS9 = 0x7007 ETHERTYPE_OS9NET = 0x7009 ETHERTYPE_PACER = 0x80c6 ETHERTYPE_PAE = 0x888e ETHERTYPE_PCS = 0x4242 ETHERTYPE_PLANNING = 0x8044 ETHERTYPE_PPP = 0x880b ETHERTYPE_PPPOE = 0x8864 ETHERTYPE_PPPOEDISC = 0x8863 ETHERTYPE_PRIMENTS = 0x7031 ETHERTYPE_PUP = 0x200 ETHERTYPE_PUPAT = 0x200 ETHERTYPE_RACAL = 0x7030 ETHERTYPE_RATIONAL = 0x8150 ETHERTYPE_RAWFR = 0x6559 ETHERTYPE_RCL = 0x1995 ETHERTYPE_RDP = 0x8739 ETHERTYPE_RETIX = 0x80f2 ETHERTYPE_REVARP = 0x8035 ETHERTYPE_SCA = 0x6007 ETHERTYPE_SECTRA = 0x86db ETHERTYPE_SECUREDATA = 0x876d ETHERTYPE_SGITW = 0x817e ETHERTYPE_SG_BOUNCE = 0x8016 ETHERTYPE_SG_DIAG = 0x8013 ETHERTYPE_SG_NETGAMES = 0x8014 ETHERTYPE_SG_RESV = 0x8015 ETHERTYPE_SIMNET = 0x5208 ETHERTYPE_SLOWPROTOCOLS = 0x8809 ETHERTYPE_SNA = 0x80d5 ETHERTYPE_SNMP = 0x814c ETHERTYPE_SONIX = 0xfaf5 ETHERTYPE_SPIDER = 0x809f ETHERTYPE_SPRITE = 0x500 ETHERTYPE_STP = 0x8181 ETHERTYPE_TALARIS = 0x812b ETHERTYPE_TALARISMC = 0x852b ETHERTYPE_TCPCOMP = 0x876b ETHERTYPE_TCPSM = 0x9002 ETHERTYPE_TEC = 0x814f ETHERTYPE_TIGAN = 0x802f ETHERTYPE_TRAIL = 0x1000 ETHERTYPE_TRANSETHER = 0x6558 ETHERTYPE_TYMSHARE = 0x802e ETHERTYPE_UBBST = 0x7005 ETHERTYPE_UBDEBUG = 0x900 ETHERTYPE_UBDIAGLOOP = 0x7002 ETHERTYPE_UBDL = 0x7000 ETHERTYPE_UBNIU = 0x7001 ETHERTYPE_UBNMC = 0x7003 ETHERTYPE_VALID = 0x1600 ETHERTYPE_VARIAN = 0x80dd ETHERTYPE_VAXELN = 0x803b ETHERTYPE_VEECO = 0x8067 ETHERTYPE_VEXP = 0x805b ETHERTYPE_VGLAB = 0x8131 ETHERTYPE_VINES = 0xbad ETHERTYPE_VINESECHO = 0xbaf ETHERTYPE_VINESLOOP = 0xbae ETHERTYPE_VITAL = 0xff00 ETHERTYPE_VLAN = 0x8100 ETHERTYPE_VLTLMAN = 0x8080 ETHERTYPE_VPROD = 0x805c ETHERTYPE_VURESERVED = 0x8147 ETHERTYPE_WATERLOO = 0x8130 ETHERTYPE_WELLFLEET = 0x8103 ETHERTYPE_X25 = 0x805 ETHERTYPE_X75 = 0x801 ETHERTYPE_XNSSM = 0x9001 ETHERTYPE_XTP = 0x817d ETHER_ADDR_LEN = 0x6 ETHER_CRC_LEN = 0x4 ETHER_CRC_POLY_BE = 0x4c11db6 ETHER_CRC_POLY_LE = 0xedb88320 ETHER_HDR_LEN = 0xe ETHER_MAX_LEN = 0x5ee ETHER_MAX_LEN_JUMBO = 0x233a ETHER_MIN_LEN = 0x40 ETHER_PPPOE_ENCAP_LEN = 0x8 ETHER_TYPE_LEN = 0x2 ETHER_VLAN_ENCAP_LEN = 0x4 EVFILT_AIO = 0x2 EVFILT_PROC = 0x4 EVFILT_READ = 0x0 EVFILT_SIGNAL = 0x5 EVFILT_SYSCOUNT = 0x7 EVFILT_TIMER = 0x6 EVFILT_VNODE = 0x3 EVFILT_WRITE = 0x1 EV_ADD = 0x1 EV_CLEAR = 0x20 EV_DELETE = 0x2 EV_DISABLE = 0x8 EV_ENABLE = 0x4 EV_EOF = 0x8000 EV_ERROR = 0x4000 EV_FLAG1 = 0x2000 EV_ONESHOT = 0x10 EV_SYSFLAGS = 0xf000 EXTA = 0x4b00 EXTATTR_CMD_START = 0x1 EXTATTR_CMD_STOP = 0x2 EXTATTR_NAMESPACE_SYSTEM = 0x2 EXTATTR_NAMESPACE_USER = 0x1 EXTB = 0x9600 EXTPROC = 0x800 FD_CLOEXEC = 0x1 FD_SETSIZE = 0x100 FLUSHO = 0x800000 F_CLOSEM = 0xa F_DUPFD = 0x0 F_DUPFD_CLOEXEC = 0xc F_FSCTL = -0x80000000 F_FSDIRMASK = 0x70000000 F_FSIN = 0x10000000 F_FSINOUT = 0x30000000 F_FSOUT = 0x20000000 F_FSPRIV = 0x8000 F_FSVOID = 0x40000000 F_GETFD = 0x1 F_GETFL = 0x3 F_GETLK = 0x7 F_GETNOSIGPIPE = 0xd F_GETOWN = 0x5 F_MAXFD = 0xb F_OK = 0x0 F_PARAM_MASK = 0xfff F_PARAM_MAX = 0xfff F_RDLCK = 0x1 F_SETFD = 0x2 F_SETFL = 0x4 F_SETLK = 0x8 F_SETLKW = 0x9 F_SETNOSIGPIPE = 0xe F_SETOWN = 0x6 F_UNLCK = 0x2 F_WRLCK = 0x3 HUPCL = 0x4000 HW_MACHINE = 0x1 ICANON = 0x100 ICMP6_FILTER = 0x12 ICRNL = 0x100 IEXTEN = 0x400 IFAN_ARRIVAL = 0x0 IFAN_DEPARTURE = 0x1 IFA_ROUTE = 0x1 IFF_ALLMULTI = 0x200 IFF_BROADCAST = 0x2 IFF_CANTCHANGE = 0x8f52 IFF_DEBUG = 0x4 IFF_LINK0 = 0x1000 IFF_LINK1 = 0x2000 IFF_LINK2 = 0x4000 IFF_LOOPBACK = 0x8 IFF_MULTICAST = 0x8000 IFF_NOARP = 0x80 IFF_NOTRAILERS = 0x20 IFF_OACTIVE = 0x400 IFF_POINTOPOINT = 0x10 IFF_PROMISC = 0x100 IFF_RUNNING = 0x40 IFF_SIMPLEX = 0x800 IFF_UP = 0x1 IFNAMSIZ = 0x10 IFT_1822 = 0x2 IFT_A12MPPSWITCH = 0x82 IFT_AAL2 = 0xbb IFT_AAL5 = 0x31 IFT_ADSL = 0x5e IFT_AFLANE8023 = 0x3b IFT_AFLANE8025 = 0x3c IFT_ARAP = 0x58 IFT_ARCNET = 0x23 IFT_ARCNETPLUS = 0x24 IFT_ASYNC = 0x54 IFT_ATM = 0x25 IFT_ATMDXI = 0x69 IFT_ATMFUNI = 0x6a IFT_ATMIMA = 0x6b IFT_ATMLOGICAL = 0x50 IFT_ATMRADIO = 0xbd IFT_ATMSUBINTERFACE = 0x86 IFT_ATMVCIENDPT = 0xc2 IFT_ATMVIRTUAL = 0x95 IFT_BGPPOLICYACCOUNTING = 0xa2 IFT_BRIDGE = 0xd1 IFT_BSC = 0x53 IFT_CARP = 0xf8 IFT_CCTEMUL = 0x3d IFT_CEPT = 0x13 IFT_CES = 0x85 IFT_CHANNEL = 0x46 IFT_CNR = 0x55 IFT_COFFEE = 0x84 IFT_COMPOSITELINK = 0x9b IFT_DCN = 0x8d IFT_DIGITALPOWERLINE = 0x8a IFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba IFT_DLSW = 0x4a IFT_DOCSCABLEDOWNSTREAM = 0x80 IFT_DOCSCABLEMACLAYER = 0x7f IFT_DOCSCABLEUPSTREAM = 0x81 IFT_DOCSCABLEUPSTREAMCHANNEL = 0xcd IFT_DS0 = 0x51 IFT_DS0BUNDLE = 0x52 IFT_DS1FDL = 0xaa IFT_DS3 = 0x1e IFT_DTM = 0x8c IFT_DVBASILN = 0xac IFT_DVBASIOUT = 0xad IFT_DVBRCCDOWNSTREAM = 0x93 IFT_DVBRCCMACLAYER = 0x92 IFT_DVBRCCUPSTREAM = 0x94 IFT_ECONET = 0xce IFT_EON = 0x19 IFT_EPLRS = 0x57 IFT_ESCON = 0x49 IFT_ETHER = 0x6 IFT_FAITH = 0xf2 IFT_FAST = 0x7d IFT_FASTETHER = 0x3e IFT_FASTETHERFX = 0x45 IFT_FDDI = 0xf IFT_FIBRECHANNEL = 0x38 IFT_FRAMERELAYINTERCONNECT = 0x3a IFT_FRAMERELAYMPI = 0x5c IFT_FRDLCIENDPT = 0xc1 IFT_FRELAY = 0x20 IFT_FRELAYDCE = 0x2c IFT_FRF16MFRBUNDLE = 0xa3 IFT_FRFORWARD = 0x9e IFT_G703AT2MB = 0x43 IFT_G703AT64K = 0x42 IFT_GIF = 0xf0 IFT_GIGABITETHERNET = 0x75 IFT_GR303IDT = 0xb2 IFT_GR303RDT = 0xb1 IFT_H323GATEKEEPER = 0xa4 IFT_H323PROXY = 0xa5 IFT_HDH1822 = 0x3 IFT_HDLC = 0x76 IFT_HDSL2 = 0xa8 IFT_HIPERLAN2 = 0xb7 IFT_HIPPI = 0x2f IFT_HIPPIINTERFACE = 0x39 IFT_HOSTPAD = 0x5a IFT_HSSI = 0x2e IFT_HY = 0xe IFT_IBM370PARCHAN = 0x48 IFT_IDSL = 0x9a IFT_IEEE1394 = 0x90 IFT_IEEE80211 = 0x47 IFT_IEEE80212 = 0x37 IFT_IEEE8023ADLAG = 0xa1 IFT_IFGSN = 0x91 IFT_IMT = 0xbe IFT_INFINIBAND = 0xc7 IFT_INTERLEAVE = 0x7c IFT_IP = 0x7e IFT_IPFORWARD = 0x8e IFT_IPOVERATM = 0x72 IFT_IPOVERCDLC = 0x6d IFT_IPOVERCLAW = 0x6e IFT_IPSWITCH = 0x4e IFT_ISDN = 0x3f IFT_ISDNBASIC = 0x14 IFT_ISDNPRIMARY = 0x15 IFT_ISDNS = 0x4b IFT_ISDNU = 0x4c IFT_ISO88022LLC = 0x29 IFT_ISO88023 = 0x7 IFT_ISO88024 = 0x8 IFT_ISO88025 = 0x9 IFT_ISO88025CRFPINT = 0x62 IFT_ISO88025DTR = 0x56 IFT_ISO88025FIBER = 0x73 IFT_ISO88026 = 0xa IFT_ISUP = 0xb3 IFT_L2VLAN = 0x87 IFT_L3IPVLAN = 0x88 IFT_L3IPXVLAN = 0x89 IFT_LAPB = 0x10 IFT_LAPD = 0x4d IFT_LAPF = 0x77 IFT_LINEGROUP = 0xd2 IFT_LOCALTALK = 0x2a IFT_LOOP = 0x18 IFT_MEDIAMAILOVERIP = 0x8b IFT_MFSIGLINK = 0xa7 IFT_MIOX25 = 0x26 IFT_MODEM = 0x30 IFT_MPC = 0x71 IFT_MPLS = 0xa6 IFT_MPLSTUNNEL = 0x96 IFT_MSDSL = 0x8f IFT_MVL = 0xbf IFT_MYRINET = 0x63 IFT_NFAS = 0xaf IFT_NSIP = 0x1b IFT_OPTICALCHANNEL = 0xc3 IFT_OPTICALTRANSPORT = 0xc4 IFT_OTHER = 0x1 IFT_P10 = 0xc IFT_P80 = 0xd IFT_PARA = 0x22 IFT_PFLOG = 0xf5 IFT_PFSYNC = 0xf6 IFT_PLC = 0xae IFT_PON155 = 0xcf IFT_PON622 = 0xd0 IFT_POS = 0xab IFT_PPP = 0x17 IFT_PPPMULTILINKBUNDLE = 0x6c IFT_PROPATM = 0xc5 IFT_PROPBWAP2MP = 0xb8 IFT_PROPCNLS = 0x59 IFT_PROPDOCSWIRELESSDOWNSTREAM = 0xb5 IFT_PROPDOCSWIRELESSMACLAYER = 0xb4 IFT_PROPDOCSWIRELESSUPSTREAM = 0xb6 IFT_PROPMUX = 0x36 IFT_PROPVIRTUAL = 0x35 IFT_PROPWIRELESSP2P = 0x9d IFT_PTPSERIAL = 0x16 IFT_PVC = 0xf1 IFT_Q2931 = 0xc9 IFT_QLLC = 0x44 IFT_RADIOMAC = 0xbc IFT_RADSL = 0x5f IFT_REACHDSL = 0xc0 IFT_RFC1483 = 0x9f IFT_RS232 = 0x21 IFT_RSRB = 0x4f IFT_SDLC = 0x11 IFT_SDSL = 0x60 IFT_SHDSL = 0xa9 IFT_SIP = 0x1f IFT_SIPSIG = 0xcc IFT_SIPTG = 0xcb IFT_SLIP = 0x1c IFT_SMDSDXI = 0x2b IFT_SMDSICIP = 0x34 IFT_SONET = 0x27 IFT_SONETOVERHEADCHANNEL = 0xb9 IFT_SONETPATH = 0x32 IFT_SONETVT = 0x33 IFT_SRP = 0x97 IFT_SS7SIGLINK = 0x9c IFT_STACKTOSTACK = 0x6f IFT_STARLAN = 0xb IFT_STF = 0xd7 IFT_T1 = 0x12 IFT_TDLC = 0x74 IFT_TELINK = 0xc8 IFT_TERMPAD = 0x5b IFT_TR008 = 0xb0 IFT_TRANSPHDLC = 0x7b IFT_TUNNEL = 0x83 IFT_ULTRA = 0x1d IFT_USB = 0xa0 IFT_V11 = 0x40 IFT_V35 = 0x2d IFT_V36 = 0x41 IFT_V37 = 0x78 IFT_VDSL = 0x61 IFT_VIRTUALIPADDRESS = 0x70 IFT_VIRTUALTG = 0xca IFT_VOICEDID = 0xd5 IFT_VOICEEM = 0x64 IFT_VOICEEMFGD = 0xd3 IFT_VOICEENCAP = 0x67 IFT_VOICEFGDEANA = 0xd4 IFT_VOICEFXO = 0x65 IFT_VOICEFXS = 0x66 IFT_VOICEOVERATM = 0x98 IFT_VOICEOVERCABLE = 0xc6 IFT_VOICEOVERFRAMERELAY = 0x99 IFT_VOICEOVERIP = 0x68 IFT_X213 = 0x5d IFT_X25 = 0x5 IFT_X25DDN = 0x4 IFT_X25HUNTGROUP = 0x7a IFT_X25MLP = 0x79 IFT_X25PLE = 0x28 IFT_XETHER = 0x1a IGNBRK = 0x1 IGNCR = 0x80 IGNPAR = 0x4 IMAXBEL = 0x2000 INLCR = 0x40 INPCK = 0x10 IN_CLASSA_HOST = 0xffffff IN_CLASSA_MAX = 0x80 IN_CLASSA_NET = 0xff000000 IN_CLASSA_NSHIFT = 0x18 IN_CLASSB_HOST = 0xffff IN_CLASSB_MAX = 0x10000 IN_CLASSB_NET = 0xffff0000 IN_CLASSB_NSHIFT = 0x10 IN_CLASSC_HOST = 0xff IN_CLASSC_NET = 0xffffff00 IN_CLASSC_NSHIFT = 0x8 IN_CLASSD_HOST = 0xfffffff IN_CLASSD_NET = 0xf0000000 IN_CLASSD_NSHIFT = 0x1c IN_LOOPBACKNET = 0x7f IPPROTO_AH = 0x33 IPPROTO_CARP = 0x70 IPPROTO_DONE = 0x101 IPPROTO_DSTOPTS = 0x3c IPPROTO_EGP = 0x8 IPPROTO_ENCAP = 0x62 IPPROTO_EON = 0x50 IPPROTO_ESP = 0x32 IPPROTO_ETHERIP = 0x61 IPPROTO_FRAGMENT = 0x2c IPPROTO_GGP = 0x3 IPPROTO_GRE = 0x2f IPPROTO_HOPOPTS = 0x0 IPPROTO_ICMP = 0x1 IPPROTO_ICMPV6 = 0x3a IPPROTO_IDP = 0x16 IPPROTO_IGMP = 0x2 IPPROTO_IP = 0x0 IPPROTO_IPCOMP = 0x6c IPPROTO_IPIP = 0x4 IPPROTO_IPV4 = 0x4 IPPROTO_IPV6 = 0x29 IPPROTO_IPV6_ICMP = 0x3a IPPROTO_MAX = 0x100 IPPROTO_MAXID = 0x34 IPPROTO_MOBILE = 0x37 IPPROTO_NONE = 0x3b IPPROTO_PFSYNC = 0xf0 IPPROTO_PIM = 0x67 IPPROTO_PUP = 0xc IPPROTO_RAW = 0xff IPPROTO_ROUTING = 0x2b IPPROTO_RSVP = 0x2e IPPROTO_TCP = 0x6 IPPROTO_TP = 0x1d IPPROTO_UDP = 0x11 IPPROTO_VRRP = 0x70 IPV6_CHECKSUM = 0x1a IPV6_DEFAULT_MULTICAST_HOPS = 0x1 IPV6_DEFAULT_MULTICAST_LOOP = 0x1 IPV6_DEFHLIM = 0x40 IPV6_DONTFRAG = 0x3e IPV6_DSTOPTS = 0x32 IPV6_FAITH = 0x1d IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_MASK = 0xffff0f00 IPV6_FRAGTTL = 0x78 IPV6_HLIMDEC = 0x1 IPV6_HOPLIMIT = 0x2f IPV6_HOPOPTS = 0x31 IPV6_IPSEC_POLICY = 0x1c IPV6_JOIN_GROUP = 0xc IPV6_LEAVE_GROUP = 0xd IPV6_MAXHLIM = 0xff IPV6_MAXPACKET = 0xffff IPV6_MMTU = 0x500 IPV6_MULTICAST_HOPS = 0xa IPV6_MULTICAST_IF = 0x9 IPV6_MULTICAST_LOOP = 0xb IPV6_NEXTHOP = 0x30 IPV6_PATHMTU = 0x2c IPV6_PKTINFO = 0x2e IPV6_PORTRANGE = 0xe IPV6_PORTRANGE_DEFAULT = 0x0 IPV6_PORTRANGE_HIGH = 0x1 IPV6_PORTRANGE_LOW = 0x2 IPV6_RECVDSTOPTS = 0x28 IPV6_RECVHOPLIMIT = 0x25 IPV6_RECVHOPOPTS = 0x27 IPV6_RECVPATHMTU = 0x2b IPV6_RECVPKTINFO = 0x24 IPV6_RECVRTHDR = 0x26 IPV6_RECVTCLASS = 0x39 IPV6_RTHDR = 0x33 IPV6_RTHDRDSTOPTS = 0x23 IPV6_RTHDR_LOOSE = 0x0 IPV6_RTHDR_STRICT = 0x1 IPV6_RTHDR_TYPE_0 = 0x0 IPV6_SOCKOPT_RESERVED1 = 0x3 IPV6_TCLASS = 0x3d IPV6_UNICAST_HOPS = 0x4 IPV6_USE_MIN_MTU = 0x2a IPV6_V6ONLY = 0x1b IPV6_VERSION = 0x60 IPV6_VERSION_MASK = 0xf0 IP_ADD_MEMBERSHIP = 0xc IP_DEFAULT_MULTICAST_LOOP = 0x1 IP_DEFAULT_MULTICAST_TTL = 0x1 IP_DF = 0x4000 IP_DROP_MEMBERSHIP = 0xd IP_EF = 0x8000 IP_ERRORMTU = 0x15 IP_HDRINCL = 0x2 IP_IPSEC_POLICY = 0x16 IP_MAXPACKET = 0xffff IP_MAX_MEMBERSHIPS = 0x14 IP_MF = 0x2000 IP_MINFRAGSIZE = 0x45 IP_MINTTL = 0x18 IP_MSS = 0x240 IP_MULTICAST_IF = 0x9 IP_MULTICAST_LOOP = 0xb IP_MULTICAST_TTL = 0xa IP_OFFMASK = 0x1fff IP_OPTIONS = 0x1 IP_PORTRANGE = 0x13 IP_PORTRANGE_DEFAULT = 0x0 IP_PORTRANGE_HIGH = 0x1 IP_PORTRANGE_LOW = 0x2 IP_RECVDSTADDR = 0x7 IP_RECVIF = 0x14 IP_RECVOPTS = 0x5 IP_RECVRETOPTS = 0x6 IP_RECVTTL = 0x17 IP_RETOPTS = 0x8 IP_RF = 0x8000 IP_TOS = 0x3 IP_TTL = 0x4 ISIG = 0x80 ISTRIP = 0x20 IXANY = 0x800 IXOFF = 0x400 IXON = 0x200 KERN_HOSTNAME = 0xa KERN_OSRELEASE = 0x2 KERN_OSTYPE = 0x1 KERN_VERSION = 0x4 LOCK_EX = 0x2 LOCK_NB = 0x4 LOCK_SH = 0x1 LOCK_UN = 0x8 MADV_DONTNEED = 0x4 MADV_FREE = 0x6 MADV_NORMAL = 0x0 MADV_RANDOM = 0x1 MADV_SEQUENTIAL = 0x2 MADV_SPACEAVAIL = 0x5 MADV_WILLNEED = 0x3 MAP_ALIGNMENT_16MB = 0x18000000 MAP_ALIGNMENT_1TB = 0x28000000 MAP_ALIGNMENT_256TB = 0x30000000 MAP_ALIGNMENT_4GB = 0x20000000 MAP_ALIGNMENT_64KB = 0x10000000 MAP_ALIGNMENT_64PB = 0x38000000 MAP_ALIGNMENT_MASK = -0x1000000 MAP_ALIGNMENT_SHIFT = 0x18 MAP_ANON = 0x1000 MAP_FILE = 0x0 MAP_FIXED = 0x10 MAP_HASSEMAPHORE = 0x200 MAP_INHERIT = 0x80 MAP_INHERIT_COPY = 0x1 MAP_INHERIT_DEFAULT = 0x1 MAP_INHERIT_DONATE_COPY = 0x3 MAP_INHERIT_NONE = 0x2 MAP_INHERIT_SHARE = 0x0 MAP_NORESERVE = 0x40 MAP_PRIVATE = 0x2 MAP_RENAME = 0x20 MAP_SHARED = 0x1 MAP_STACK = 0x2000 MAP_TRYFIXED = 0x400 MAP_WIRED = 0x800 MNT_ASYNC = 0x40 MNT_BASIC_FLAGS = 0xe782807f MNT_DEFEXPORTED = 0x200 MNT_DISCARD = 0x800000 MNT_EXKERB = 0x800 MNT_EXNORESPORT = 0x8000000 MNT_EXPORTANON = 0x400 MNT_EXPORTED = 0x100 MNT_EXPUBLIC = 0x10000000 MNT_EXRDONLY = 0x80 MNT_EXTATTR = 0x1000000 MNT_FORCE = 0x80000 MNT_GETARGS = 0x400000 MNT_IGNORE = 0x100000 MNT_LAZY = 0x3 MNT_LOCAL = 0x1000 MNT_LOG = 0x2000000 MNT_NOATIME = 0x4000000 MNT_NOCOREDUMP = 0x8000 MNT_NODEV = 0x10 MNT_NODEVMTIME = 0x40000000 MNT_NOEXEC = 0x4 MNT_NOSUID = 0x8 MNT_NOWAIT = 0x2 MNT_OP_FLAGS = 0x4d0000 MNT_QUOTA = 0x2000 MNT_RDONLY = 0x1 MNT_RELATIME = 0x20000 MNT_RELOAD = 0x40000 MNT_ROOTFS = 0x4000 MNT_SOFTDEP = 0x80000000 MNT_SYMPERM = 0x20000000 MNT_SYNCHRONOUS = 0x2 MNT_UNION = 0x20 MNT_UPDATE = 0x10000 MNT_VISFLAGMASK = 0xff90ffff MNT_WAIT = 0x1 MSG_BCAST = 0x100 MSG_CMSG_CLOEXEC = 0x800 MSG_CONTROLMBUF = 0x2000000 MSG_CTRUNC = 0x20 MSG_DONTROUTE = 0x4 MSG_DONTWAIT = 0x80 MSG_EOR = 0x8 MSG_IOVUSRSPACE = 0x4000000 MSG_LENUSRSPACE = 0x8000000 MSG_MCAST = 0x200 MSG_NAMEMBUF = 0x1000000 MSG_NBIO = 0x1000 MSG_NOSIGNAL = 0x400 MSG_OOB = 0x1 MSG_PEEK = 0x2 MSG_TRUNC = 0x10 MSG_USERFLAGS = 0xffffff MSG_WAITALL = 0x40 MS_ASYNC = 0x1 MS_INVALIDATE = 0x2 MS_SYNC = 0x4 NAME_MAX = 0x1ff NET_RT_DUMP = 0x1 NET_RT_FLAGS = 0x2 NET_RT_IFLIST = 0x5 NET_RT_MAXID = 0x6 NET_RT_OIFLIST = 0x4 NET_RT_OOIFLIST = 0x3 NFDBITS = 0x20 NOFLSH = 0x80000000 NOTE_ATTRIB = 0x8 NOTE_CHILD = 0x4 NOTE_DELETE = 0x1 NOTE_EXEC = 0x20000000 NOTE_EXIT = 0x80000000 NOTE_EXTEND = 0x4 NOTE_FORK = 0x40000000 NOTE_LINK = 0x10 NOTE_LOWAT = 0x1 NOTE_PCTRLMASK = 0xf0000000 NOTE_PDATAMASK = 0xfffff NOTE_RENAME = 0x20 NOTE_REVOKE = 0x40 NOTE_TRACK = 0x1 NOTE_TRACKERR = 0x2 NOTE_WRITE = 0x2 OCRNL = 0x10 OFIOGETBMAP = 0xc004667a ONLCR = 0x2 ONLRET = 0x40 ONOCR = 0x20 ONOEOT = 0x8 OPOST = 0x1 O_ACCMODE = 0x3 O_ALT_IO = 0x40000 O_APPEND = 0x8 O_ASYNC = 0x40 O_CLOEXEC = 0x400000 O_CREAT = 0x200 O_DIRECT = 0x80000 O_DIRECTORY = 0x200000 O_DSYNC = 0x10000 O_EXCL = 0x800 O_EXLOCK = 0x20 O_FSYNC = 0x80 O_NDELAY = 0x4 O_NOCTTY = 0x8000 O_NOFOLLOW = 0x100 O_NONBLOCK = 0x4 O_NOSIGPIPE = 0x1000000 O_RDONLY = 0x0 O_RDWR = 0x2 O_RSYNC = 0x20000 O_SHLOCK = 0x10 O_SYNC = 0x80 O_TRUNC = 0x400 O_WRONLY = 0x1 PARENB = 0x1000 PARMRK = 0x8 PARODD = 0x2000 PENDIN = 0x20000000 PROT_EXEC = 0x4 PROT_NONE = 0x0 PROT_READ = 0x1 PROT_WRITE = 0x2 PRI_IOFLUSH = 0x7c PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 RLIMIT_AS = 0xa RLIMIT_CORE = 0x4 RLIMIT_CPU = 0x0 RLIMIT_DATA = 0x2 RLIMIT_FSIZE = 0x1 RLIMIT_MEMLOCK = 0x6 RLIMIT_NOFILE = 0x8 RLIMIT_NPROC = 0x7 RLIMIT_RSS = 0x5 RLIMIT_STACK = 0x3 RLIM_INFINITY = 0x7fffffffffffffff RTAX_AUTHOR = 0x6 RTAX_BRD = 0x7 RTAX_DST = 0x0 RTAX_GATEWAY = 0x1 RTAX_GENMASK = 0x3 RTAX_IFA = 0x5 RTAX_IFP = 0x4 RTAX_MAX = 0x9 RTAX_NETMASK = 0x2 RTAX_TAG = 0x8 RTA_AUTHOR = 0x40 RTA_BRD = 0x80 RTA_DST = 0x1 RTA_GATEWAY = 0x2 RTA_GENMASK = 0x8 RTA_IFA = 0x20 RTA_IFP = 0x10 RTA_NETMASK = 0x4 RTA_TAG = 0x100 RTF_ANNOUNCE = 0x20000 RTF_BLACKHOLE = 0x1000 RTF_CLONED = 0x2000 RTF_CLONING = 0x100 RTF_DONE = 0x40 RTF_DYNAMIC = 0x10 RTF_GATEWAY = 0x2 RTF_HOST = 0x4 RTF_LLINFO = 0x400 RTF_MASK = 0x80 RTF_MODIFIED = 0x20 RTF_PROTO1 = 0x8000 RTF_PROTO2 = 0x4000 RTF_REJECT = 0x8 RTF_SRC = 0x10000 RTF_STATIC = 0x800 RTF_UP = 0x1 RTF_XRESOLVE = 0x200 RTM_ADD = 0x1 RTM_CHANGE = 0x3 RTM_CHGADDR = 0x15 RTM_DELADDR = 0xd RTM_DELETE = 0x2 RTM_GET = 0x4 RTM_IEEE80211 = 0x11 RTM_IFANNOUNCE = 0x10 RTM_IFINFO = 0x14 RTM_LLINFO_UPD = 0x13 RTM_LOCK = 0x8 RTM_LOSING = 0x5 RTM_MISS = 0x7 RTM_NEWADDR = 0xc RTM_OIFINFO = 0xf RTM_OLDADD = 0x9 RTM_OLDDEL = 0xa RTM_OOIFINFO = 0xe RTM_REDIRECT = 0x6 RTM_RESOLVE = 0xb RTM_RTTUNIT = 0xf4240 RTM_SETGATE = 0x12 RTM_VERSION = 0x4 RTV_EXPIRE = 0x4 RTV_HOPCOUNT = 0x2 RTV_MTU = 0x1 RTV_RPIPE = 0x8 RTV_RTT = 0x40 RTV_RTTVAR = 0x80 RTV_SPIPE = 0x10 RTV_SSTHRESH = 0x20 RUSAGE_CHILDREN = -0x1 RUSAGE_SELF = 0x0 SCM_CREDS = 0x4 SCM_RIGHTS = 0x1 SCM_TIMESTAMP = 0x8 SHUT_RD = 0x0 SHUT_RDWR = 0x2 SHUT_WR = 0x1 SIOCADDMULTI = 0x80906931 SIOCADDRT = 0x8030720a SIOCAIFADDR = 0x8040691a SIOCALIFADDR = 0x8118691c SIOCATMARK = 0x40047307 SIOCDELMULTI = 0x80906932 SIOCDELRT = 0x8030720b SIOCDIFADDR = 0x80906919 SIOCDIFPHYADDR = 0x80906949 SIOCDLIFADDR = 0x8118691e SIOCGDRVSPEC = 0xc01c697b SIOCGETPFSYNC = 0xc09069f8 SIOCGETSGCNT = 0xc0147534 SIOCGETVIFCNT = 0xc0147533 SIOCGHIWAT = 0x40047301 SIOCGIFADDR = 0xc0906921 SIOCGIFADDRPREF = 0xc0946920 SIOCGIFALIAS = 0xc040691b SIOCGIFBRDADDR = 0xc0906923 SIOCGIFCAP = 0xc0206976 SIOCGIFCONF = 0xc0086926 SIOCGIFDATA = 0xc0946985 SIOCGIFDLT = 0xc0906977 SIOCGIFDSTADDR = 0xc0906922 SIOCGIFFLAGS = 0xc0906911 SIOCGIFGENERIC = 0xc090693a SIOCGIFMEDIA = 0xc0286936 SIOCGIFMETRIC = 0xc0906917 SIOCGIFMTU = 0xc090697e SIOCGIFNETMASK = 0xc0906925 SIOCGIFPDSTADDR = 0xc0906948 SIOCGIFPSRCADDR = 0xc0906947 SIOCGLIFADDR = 0xc118691d SIOCGLIFPHYADDR = 0xc118694b SIOCGLINKSTR = 0xc01c6987 SIOCGLOWAT = 0x40047303 SIOCGPGRP = 0x40047309 SIOCGVH = 0xc0906983 SIOCIFCREATE = 0x8090697a SIOCIFDESTROY = 0x80906979 SIOCIFGCLONERS = 0xc00c6978 SIOCINITIFADDR = 0xc0446984 SIOCSDRVSPEC = 0x801c697b SIOCSETPFSYNC = 0x809069f7 SIOCSHIWAT = 0x80047300 SIOCSIFADDR = 0x8090690c SIOCSIFADDRPREF = 0x8094691f SIOCSIFBRDADDR = 0x80906913 SIOCSIFCAP = 0x80206975 SIOCSIFDSTADDR = 0x8090690e SIOCSIFFLAGS = 0x80906910 SIOCSIFGENERIC = 0x80906939 SIOCSIFMEDIA = 0xc0906935 SIOCSIFMETRIC = 0x80906918 SIOCSIFMTU = 0x8090697f SIOCSIFNETMASK = 0x80906916 SIOCSIFPHYADDR = 0x80406946 SIOCSLIFPHYADDR = 0x8118694a SIOCSLINKSTR = 0x801c6988 SIOCSLOWAT = 0x80047302 SIOCSPGRP = 0x80047308 SIOCSVH = 0xc0906982 SIOCZIFDATA = 0xc0946986 SOCK_CLOEXEC = 0x10000000 SOCK_DGRAM = 0x2 SOCK_FLAGS_MASK = 0xf0000000 SOCK_NONBLOCK = 0x20000000 SOCK_NOSIGPIPE = 0x40000000 SOCK_RAW = 0x3 SOCK_RDM = 0x4 SOCK_SEQPACKET = 0x5 SOCK_STREAM = 0x1 SOL_SOCKET = 0xffff SOMAXCONN = 0x80 SO_ACCEPTCONN = 0x2 SO_ACCEPTFILTER = 0x1000 SO_BROADCAST = 0x20 SO_DEBUG = 0x1 SO_DONTROUTE = 0x10 SO_ERROR = 0x1007 SO_KEEPALIVE = 0x8 SO_LINGER = 0x80 SO_NOHEADER = 0x100a SO_NOSIGPIPE = 0x800 SO_OOBINLINE = 0x100 SO_OVERFLOWED = 0x1009 SO_RCVBUF = 0x1002 SO_RCVLOWAT = 0x1004 SO_RCVTIMEO = 0x100c SO_REUSEADDR = 0x4 SO_REUSEPORT = 0x200 SO_SNDBUF = 0x1001 SO_SNDLOWAT = 0x1003 SO_SNDTIMEO = 0x100b SO_TIMESTAMP = 0x2000 SO_TYPE = 0x1008 SO_USELOOPBACK = 0x40 SYSCTL_VERSION = 0x1000000 SYSCTL_VERS_0 = 0x0 SYSCTL_VERS_1 = 0x1000000 SYSCTL_VERS_MASK = 0xff000000 S_ARCH1 = 0x10000 S_ARCH2 = 0x20000 S_BLKSIZE = 0x200 S_IEXEC = 0x40 S_IFBLK = 0x6000 S_IFCHR = 0x2000 S_IFDIR = 0x4000 S_IFIFO = 0x1000 S_IFLNK = 0xa000 S_IFMT = 0xf000 S_IFREG = 0x8000 S_IFSOCK = 0xc000 S_IFWHT = 0xe000 S_IREAD = 0x100 S_IRGRP = 0x20 S_IROTH = 0x4 S_IRUSR = 0x100 S_IRWXG = 0x38 S_IRWXO = 0x7 S_IRWXU = 0x1c0 S_ISGID = 0x400 S_ISTXT = 0x200 S_ISUID = 0x800 S_ISVTX = 0x200 S_IWGRP = 0x10 S_IWOTH = 0x2 S_IWRITE = 0x80 S_IWUSR = 0x80 S_IXGRP = 0x8 S_IXOTH = 0x1 S_IXUSR = 0x40 TCIFLUSH = 0x1 TCIOFLUSH = 0x3 TCOFLUSH = 0x2 TCP_CONGCTL = 0x20 TCP_KEEPCNT = 0x6 TCP_KEEPIDLE = 0x3 TCP_KEEPINIT = 0x7 TCP_KEEPINTVL = 0x5 TCP_MAXBURST = 0x4 TCP_MAXSEG = 0x2 TCP_MAXWIN = 0xffff TCP_MAX_WINSHIFT = 0xe TCP_MD5SIG = 0x10 TCP_MINMSS = 0xd8 TCP_MSS = 0x218 TCP_NODELAY = 0x1 TCSAFLUSH = 0x2 TIOCCBRK = 0x2000747a TIOCCDTR = 0x20007478 TIOCCONS = 0x80047462 TIOCDCDTIMESTAMP = 0x400c7458 TIOCDRAIN = 0x2000745e TIOCEXCL = 0x2000740d TIOCEXT = 0x80047460 TIOCFLAG_CDTRCTS = 0x10 TIOCFLAG_CLOCAL = 0x2 TIOCFLAG_CRTSCTS = 0x4 TIOCFLAG_MDMBUF = 0x8 TIOCFLAG_SOFTCAR = 0x1 TIOCFLUSH = 0x80047410 TIOCGETA = 0x402c7413 TIOCGETD = 0x4004741a TIOCGFLAGS = 0x4004745d TIOCGLINED = 0x40207442 TIOCGPGRP = 0x40047477 TIOCGQSIZE = 0x40047481 TIOCGRANTPT = 0x20007447 TIOCGSID = 0x40047463 TIOCGSIZE = 0x40087468 TIOCGWINSZ = 0x40087468 TIOCMBIC = 0x8004746b TIOCMBIS = 0x8004746c TIOCMGET = 0x4004746a TIOCMSET = 0x8004746d TIOCM_CAR = 0x40 TIOCM_CD = 0x40 TIOCM_CTS = 0x20 TIOCM_DSR = 0x100 TIOCM_DTR = 0x2 TIOCM_LE = 0x1 TIOCM_RI = 0x80 TIOCM_RNG = 0x80 TIOCM_RTS = 0x4 TIOCM_SR = 0x10 TIOCM_ST = 0x8 TIOCNOTTY = 0x20007471 TIOCNXCL = 0x2000740e TIOCOUTQ = 0x40047473 TIOCPKT = 0x80047470 TIOCPKT_DATA = 0x0 TIOCPKT_DOSTOP = 0x20 TIOCPKT_FLUSHREAD = 0x1 TIOCPKT_FLUSHWRITE = 0x2 TIOCPKT_IOCTL = 0x40 TIOCPKT_NOSTOP = 0x10 TIOCPKT_START = 0x8 TIOCPKT_STOP = 0x4 TIOCPTMGET = 0x48087446 TIOCPTSNAME = 0x48087448 TIOCRCVFRAME = 0x80047445 TIOCREMOTE = 0x80047469 TIOCSBRK = 0x2000747b TIOCSCTTY = 0x20007461 TIOCSDTR = 0x20007479 TIOCSETA = 0x802c7414 TIOCSETAF = 0x802c7416 TIOCSETAW = 0x802c7415 TIOCSETD = 0x8004741b TIOCSFLAGS = 0x8004745c TIOCSIG = 0x2000745f TIOCSLINED = 0x80207443 TIOCSPGRP = 0x80047476 TIOCSQSIZE = 0x80047480 TIOCSSIZE = 0x80087467 TIOCSTART = 0x2000746e TIOCSTAT = 0x80047465 TIOCSTI = 0x80017472 TIOCSTOP = 0x2000746f TIOCSWINSZ = 0x80087467 TIOCUCNTL = 0x80047466 TIOCXMTFRAME = 0x80047444 TOSTOP = 0x400000 VDISCARD = 0xf VDSUSP = 0xb VEOF = 0x0 VEOL = 0x1 VEOL2 = 0x2 VERASE = 0x3 VINTR = 0x8 VKILL = 0x5 VLNEXT = 0xe VMIN = 0x10 VQUIT = 0x9 VREPRINT = 0x6 VSTART = 0xc VSTATUS = 0x12 VSTOP = 0xd VSUSP = 0xa VTIME = 0x11 VWERASE = 0x4 WALL = 0x8 WALLSIG = 0x8 WALTSIG = 0x4 WCLONE = 0x4 WCOREFLAG = 0x80 WNOHANG = 0x1 WNOWAIT = 0x10000 WNOZOMBIE = 0x20000 WOPTSCHECKED = 0x40000 WSTOPPED = 0x7f WUNTRACED = 0x2 ) // Errors const ( E2BIG = syscall.Errno(0x7) EACCES = syscall.Errno(0xd) EADDRINUSE = syscall.Errno(0x30) EADDRNOTAVAIL = syscall.Errno(0x31) EAFNOSUPPORT = syscall.Errno(0x2f) EAGAIN = syscall.Errno(0x23) EALREADY = syscall.Errno(0x25) EAUTH = syscall.Errno(0x50) EBADF = syscall.Errno(0x9) EBADMSG = syscall.Errno(0x58) EBADRPC = syscall.Errno(0x48) EBUSY = syscall.Errno(0x10) ECANCELED = syscall.Errno(0x57) ECHILD = syscall.Errno(0xa) ECONNABORTED = syscall.Errno(0x35) ECONNREFUSED = syscall.Errno(0x3d) ECONNRESET = syscall.Errno(0x36) EDEADLK = syscall.Errno(0xb) EDESTADDRREQ = syscall.Errno(0x27) EDOM = syscall.Errno(0x21) EDQUOT = syscall.Errno(0x45) EEXIST = syscall.Errno(0x11) EFAULT = syscall.Errno(0xe) EFBIG = syscall.Errno(0x1b) EFTYPE = syscall.Errno(0x4f) EHOSTDOWN = syscall.Errno(0x40) EHOSTUNREACH = syscall.Errno(0x41) EIDRM = syscall.Errno(0x52) EILSEQ = syscall.Errno(0x55) EINPROGRESS = syscall.Errno(0x24) EINTR = syscall.Errno(0x4) EINVAL = syscall.Errno(0x16) EIO = syscall.Errno(0x5) EISCONN = syscall.Errno(0x38) EISDIR = syscall.Errno(0x15) ELAST = syscall.Errno(0x60) ELOOP = syscall.Errno(0x3e) EMFILE = syscall.Errno(0x18) EMLINK = syscall.Errno(0x1f) EMSGSIZE = syscall.Errno(0x28) EMULTIHOP = syscall.Errno(0x5e) ENAMETOOLONG = syscall.Errno(0x3f) ENEEDAUTH = syscall.Errno(0x51) ENETDOWN = syscall.Errno(0x32) ENETRESET = syscall.Errno(0x34) ENETUNREACH = syscall.Errno(0x33) ENFILE = syscall.Errno(0x17) ENOATTR = syscall.Errno(0x5d) ENOBUFS = syscall.Errno(0x37) ENODATA = syscall.Errno(0x59) ENODEV = syscall.Errno(0x13) ENOENT = syscall.Errno(0x2) ENOEXEC = syscall.Errno(0x8) ENOLCK = syscall.Errno(0x4d) ENOLINK = syscall.Errno(0x5f) ENOMEM = syscall.Errno(0xc) ENOMSG = syscall.Errno(0x53) ENOPROTOOPT = syscall.Errno(0x2a) ENOSPC = syscall.Errno(0x1c) ENOSR = syscall.Errno(0x5a) ENOSTR = syscall.Errno(0x5b) ENOSYS = syscall.Errno(0x4e) ENOTBLK = syscall.Errno(0xf) ENOTCONN = syscall.Errno(0x39) ENOTDIR = syscall.Errno(0x14) ENOTEMPTY = syscall.Errno(0x42) ENOTSOCK = syscall.Errno(0x26) ENOTSUP = syscall.Errno(0x56) ENOTTY = syscall.Errno(0x19) ENXIO = syscall.Errno(0x6) EOPNOTSUPP = syscall.Errno(0x2d) EOVERFLOW = syscall.Errno(0x54) EPERM = syscall.Errno(0x1) EPFNOSUPPORT = syscall.Errno(0x2e) EPIPE = syscall.Errno(0x20) EPROCLIM = syscall.Errno(0x43) EPROCUNAVAIL = syscall.Errno(0x4c) EPROGMISMATCH = syscall.Errno(0x4b) EPROGUNAVAIL = syscall.Errno(0x4a) EPROTO = syscall.Errno(0x60) EPROTONOSUPPORT = syscall.Errno(0x2b) EPROTOTYPE = syscall.Errno(0x29) ERANGE = syscall.Errno(0x22) EREMOTE = syscall.Errno(0x47) EROFS = syscall.Errno(0x1e) ERPCMISMATCH = syscall.Errno(0x49) ESHUTDOWN = syscall.Errno(0x3a) ESOCKTNOSUPPORT = syscall.Errno(0x2c) ESPIPE = syscall.Errno(0x1d) ESRCH = syscall.Errno(0x3) ESTALE = syscall.Errno(0x46) ETIME = syscall.Errno(0x5c) ETIMEDOUT = syscall.Errno(0x3c) ETOOMANYREFS = syscall.Errno(0x3b) ETXTBSY = syscall.Errno(0x1a) EUSERS = syscall.Errno(0x44) EWOULDBLOCK = syscall.Errno(0x23) EXDEV = syscall.Errno(0x12) ) // Signals const ( SIGABRT = syscall.Signal(0x6) SIGALRM = syscall.Signal(0xe) SIGBUS = syscall.Signal(0xa) SIGCHLD = syscall.Signal(0x14) SIGCONT = syscall.Signal(0x13) SIGEMT = syscall.Signal(0x7) SIGFPE = syscall.Signal(0x8) SIGHUP = syscall.Signal(0x1) SIGILL = syscall.Signal(0x4) SIGINFO = syscall.Signal(0x1d) SIGINT = syscall.Signal(0x2) SIGIO = syscall.Signal(0x17) SIGIOT = syscall.Signal(0x6) SIGKILL = syscall.Signal(0x9) SIGPIPE = syscall.Signal(0xd) SIGPROF = syscall.Signal(0x1b) SIGPWR = syscall.Signal(0x20) SIGQUIT = syscall.Signal(0x3) SIGSEGV = syscall.Signal(0xb) SIGSTOP = syscall.Signal(0x11) SIGSYS = syscall.Signal(0xc) SIGTERM = syscall.Signal(0xf) SIGTRAP = syscall.Signal(0x5) SIGTSTP = syscall.Signal(0x12) SIGTTIN = syscall.Signal(0x15) SIGTTOU = syscall.Signal(0x16) SIGURG = syscall.Signal(0x10) SIGUSR1 = syscall.Signal(0x1e) SIGUSR2 = syscall.Signal(0x1f) SIGVTALRM = syscall.Signal(0x1a) SIGWINCH = syscall.Signal(0x1c) SIGXCPU = syscall.Signal(0x18) SIGXFSZ = syscall.Signal(0x19) ) // Error table var errorList = [...]struct { num syscall.Errno name string desc string }{ {1, "EPERM", "operation not permitted"}, {2, "ENOENT", "no such file or directory"}, {3, "ESRCH", "no such process"}, {4, "EINTR", "interrupted system call"}, {5, "EIO", "input/output error"}, {6, "ENXIO", "device not configured"}, {7, "E2BIG", "argument list too long"}, {8, "ENOEXEC", "exec format error"}, {9, "EBADF", "bad file descriptor"}, {10, "ECHILD", "no child processes"}, {11, "EDEADLK", "resource deadlock avoided"}, {12, "ENOMEM", "cannot allocate memory"}, {13, "EACCES", "permission denied"}, {14, "EFAULT", "bad address"}, {15, "ENOTBLK", "block device required"}, {16, "EBUSY", "device busy"}, {17, "EEXIST", "file exists"}, {18, "EXDEV", "cross-device link"}, {19, "ENODEV", "operation not supported by device"}, {20, "ENOTDIR", "not a directory"}, {21, "EISDIR", "is a directory"}, {22, "EINVAL", "invalid argument"}, {23, "ENFILE", "too many open files in system"}, {24, "EMFILE", "too many open files"}, {25, "ENOTTY", "inappropriate ioctl for device"}, {26, "ETXTBSY", "text file busy"}, {27, "EFBIG", "file too large"}, {28, "ENOSPC", "no space left on device"}, {29, "ESPIPE", "illegal seek"}, {30, "EROFS", "read-only file system"}, {31, "EMLINK", "too many links"}, {32, "EPIPE", "broken pipe"}, {33, "EDOM", "numerical argument out of domain"}, {34, "ERANGE", "result too large or too small"}, {35, "EAGAIN", "resource temporarily unavailable"}, {36, "EINPROGRESS", "operation now in progress"}, {37, "EALREADY", "operation already in progress"}, {38, "ENOTSOCK", "socket operation on non-socket"}, {39, "EDESTADDRREQ", "destination address required"}, {40, "EMSGSIZE", "message too long"}, {41, "EPROTOTYPE", "protocol wrong type for socket"}, {42, "ENOPROTOOPT", "protocol option not available"}, {43, "EPROTONOSUPPORT", "protocol not supported"}, {44, "ESOCKTNOSUPPORT", "socket type not supported"}, {45, "EOPNOTSUPP", "operation not supported"}, {46, "EPFNOSUPPORT", "protocol family not supported"}, {47, "EAFNOSUPPORT", "address family not supported by protocol family"}, {48, "EADDRINUSE", "address already in use"}, {49, "EADDRNOTAVAIL", "can't assign requested address"}, {50, "ENETDOWN", "network is down"}, {51, "ENETUNREACH", "network is unreachable"}, {52, "ENETRESET", "network dropped connection on reset"}, {53, "ECONNABORTED", "software caused connection abort"}, {54, "ECONNRESET", "connection reset by peer"}, {55, "ENOBUFS", "no buffer space available"}, {56, "EISCONN", "socket is already connected"}, {57, "ENOTCONN", "socket is not connected"}, {58, "ESHUTDOWN", "can't send after socket shutdown"}, {59, "ETOOMANYREFS", "too many references: can't splice"}, {60, "ETIMEDOUT", "connection timed out"}, {61, "ECONNREFUSED", "connection refused"}, {62, "ELOOP", "too many levels of symbolic links"}, {63, "ENAMETOOLONG", "file name too long"}, {64, "EHOSTDOWN", "host is down"}, {65, "EHOSTUNREACH", "no route to host"}, {66, "ENOTEMPTY", "directory not empty"}, {67, "EPROCLIM", "too many processes"}, {68, "EUSERS", "too many users"}, {69, "EDQUOT", "disc quota exceeded"}, {70, "ESTALE", "stale NFS file handle"}, {71, "EREMOTE", "too many levels of remote in path"}, {72, "EBADRPC", "RPC struct is bad"}, {73, "ERPCMISMATCH", "RPC version wrong"}, {74, "EPROGUNAVAIL", "RPC prog. not avail"}, {75, "EPROGMISMATCH", "program version wrong"}, {76, "EPROCUNAVAIL", "bad procedure for program"}, {77, "ENOLCK", "no locks available"}, {78, "ENOSYS", "function not implemented"}, {79, "EFTYPE", "inappropriate file type or format"}, {80, "EAUTH", "authentication error"}, {81, "ENEEDAUTH", "need authenticator"}, {82, "EIDRM", "identifier removed"}, {83, "ENOMSG", "no message of desired type"}, {84, "EOVERFLOW", "value too large to be stored in data type"}, {85, "EILSEQ", "illegal byte sequence"}, {86, "ENOTSUP", "not supported"}, {87, "ECANCELED", "operation Canceled"}, {88, "EBADMSG", "bad or Corrupt message"}, {89, "ENODATA", "no message available"}, {90, "ENOSR", "no STREAM resources"}, {91, "ENOSTR", "not a STREAM"}, {92, "ETIME", "STREAM ioctl timeout"}, {93, "ENOATTR", "attribute not found"}, {94, "EMULTIHOP", "multihop attempted"}, {95, "ENOLINK", "link has been severed"}, {96, "ELAST", "protocol error"}, } // Signal table var signalList = [...]struct { num syscall.Signal name string desc string }{ {1, "SIGHUP", "hangup"}, {2, "SIGINT", "interrupt"}, {3, "SIGQUIT", "quit"}, {4, "SIGILL", "illegal instruction"}, {5, "SIGTRAP", "trace/BPT trap"}, {6, "SIGIOT", "abort trap"}, {7, "SIGEMT", "EMT trap"}, {8, "SIGFPE", "floating point exception"}, {9, "SIGKILL", "killed"}, {10, "SIGBUS", "bus error"}, {11, "SIGSEGV", "segmentation fault"}, {12, "SIGSYS", "bad system call"}, {13, "SIGPIPE", "broken pipe"}, {14, "SIGALRM", "alarm clock"}, {15, "SIGTERM", "terminated"}, {16, "SIGURG", "urgent I/O condition"}, {17, "SIGSTOP", "stopped (signal)"}, {18, "SIGTSTP", "stopped"}, {19, "SIGCONT", "continued"}, {20, "SIGCHLD", "child exited"}, {21, "SIGTTIN", "stopped (tty input)"}, {22, "SIGTTOU", "stopped (tty output)"}, {23, "SIGIO", "I/O possible"}, {24, "SIGXCPU", "cputime limit exceeded"}, {25, "SIGXFSZ", "filesize limit exceeded"}, {26, "SIGVTALRM", "virtual timer expired"}, {27, "SIGPROF", "profiling timer expired"}, {28, "SIGWINCH", "window size changes"}, {29, "SIGINFO", "information request"}, {30, "SIGUSR1", "user defined signal 1"}, {31, "SIGUSR2", "user defined signal 2"}, {32, "SIGPWR", "power fail/restart"}, } ================================================ FILE: vendor/golang.org/x/sys/unix/zerrors_netbsd_arm64.go ================================================ // mkerrors.sh -m64 // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm64 && netbsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -m64 _const.go package unix import "syscall" const ( AF_APPLETALK = 0x10 AF_ARP = 0x1c AF_BLUETOOTH = 0x1f AF_CCITT = 0xa AF_CHAOS = 0x5 AF_CNT = 0x15 AF_COIP = 0x14 AF_DATAKIT = 0x9 AF_DECnet = 0xc AF_DLI = 0xd AF_E164 = 0x1a AF_ECMA = 0x8 AF_HYLINK = 0xf AF_IEEE80211 = 0x20 AF_IMPLINK = 0x3 AF_INET = 0x2 AF_INET6 = 0x18 AF_IPX = 0x17 AF_ISDN = 0x1a AF_ISO = 0x7 AF_LAT = 0xe AF_LINK = 0x12 AF_LOCAL = 0x1 AF_MAX = 0x23 AF_MPLS = 0x21 AF_NATM = 0x1b AF_NS = 0x6 AF_OROUTE = 0x11 AF_OSI = 0x7 AF_PUP = 0x4 AF_ROUTE = 0x22 AF_SNA = 0xb AF_UNIX = 0x1 AF_UNSPEC = 0x0 ARPHRD_ARCNET = 0x7 ARPHRD_ETHER = 0x1 ARPHRD_FRELAY = 0xf ARPHRD_IEEE1394 = 0x18 ARPHRD_IEEE802 = 0x6 ARPHRD_STRIP = 0x17 B0 = 0x0 B110 = 0x6e B115200 = 0x1c200 B1200 = 0x4b0 B134 = 0x86 B14400 = 0x3840 B150 = 0x96 B1800 = 0x708 B19200 = 0x4b00 B200 = 0xc8 B230400 = 0x38400 B2400 = 0x960 B28800 = 0x7080 B300 = 0x12c B38400 = 0x9600 B460800 = 0x70800 B4800 = 0x12c0 B50 = 0x32 B57600 = 0xe100 B600 = 0x258 B7200 = 0x1c20 B75 = 0x4b B76800 = 0x12c00 B921600 = 0xe1000 B9600 = 0x2580 BIOCFEEDBACK = 0x8004427d BIOCFLUSH = 0x20004268 BIOCGBLEN = 0x40044266 BIOCGDLT = 0x4004426a BIOCGDLTLIST = 0xc0104277 BIOCGETIF = 0x4090426b BIOCGFEEDBACK = 0x4004427c BIOCGHDRCMPLT = 0x40044274 BIOCGRTIMEOUT = 0x4010427b BIOCGSEESENT = 0x40044278 BIOCGSTATS = 0x4080426f BIOCGSTATSOLD = 0x4008426f BIOCIMMEDIATE = 0x80044270 BIOCPROMISC = 0x20004269 BIOCSBLEN = 0xc0044266 BIOCSDLT = 0x80044276 BIOCSETF = 0x80104267 BIOCSETIF = 0x8090426c BIOCSFEEDBACK = 0x8004427d BIOCSHDRCMPLT = 0x80044275 BIOCSRTIMEOUT = 0x8010427a BIOCSSEESENT = 0x80044279 BIOCSTCPF = 0x80104272 BIOCSUDPF = 0x80104273 BIOCVERSION = 0x40044271 BPF_A = 0x10 BPF_ABS = 0x20 BPF_ADD = 0x0 BPF_ALIGNMENT = 0x8 BPF_ALIGNMENT32 = 0x4 BPF_ALU = 0x4 BPF_AND = 0x50 BPF_B = 0x10 BPF_DFLTBUFSIZE = 0x100000 BPF_DIV = 0x30 BPF_H = 0x8 BPF_IMM = 0x0 BPF_IND = 0x40 BPF_JA = 0x0 BPF_JEQ = 0x10 BPF_JGE = 0x30 BPF_JGT = 0x20 BPF_JMP = 0x5 BPF_JSET = 0x40 BPF_K = 0x0 BPF_LD = 0x0 BPF_LDX = 0x1 BPF_LEN = 0x80 BPF_LSH = 0x60 BPF_MAJOR_VERSION = 0x1 BPF_MAXBUFSIZE = 0x1000000 BPF_MAXINSNS = 0x200 BPF_MEM = 0x60 BPF_MEMWORDS = 0x10 BPF_MINBUFSIZE = 0x20 BPF_MINOR_VERSION = 0x1 BPF_MISC = 0x7 BPF_MSH = 0xa0 BPF_MUL = 0x20 BPF_NEG = 0x80 BPF_OR = 0x40 BPF_RELEASE = 0x30bb6 BPF_RET = 0x6 BPF_RSH = 0x70 BPF_ST = 0x2 BPF_STX = 0x3 BPF_SUB = 0x10 BPF_TAX = 0x0 BPF_TXA = 0x80 BPF_W = 0x0 BPF_X = 0x8 BRKINT = 0x2 CFLUSH = 0xf CLOCAL = 0x8000 CLONE_CSIGNAL = 0xff CLONE_FILES = 0x400 CLONE_FS = 0x200 CLONE_PID = 0x1000 CLONE_PTRACE = 0x2000 CLONE_SIGHAND = 0x800 CLONE_VFORK = 0x4000 CLONE_VM = 0x100 CPUSTATES = 0x5 CP_IDLE = 0x4 CP_INTR = 0x3 CP_NICE = 0x1 CP_SYS = 0x2 CP_USER = 0x0 CREAD = 0x800 CRTSCTS = 0x10000 CS5 = 0x0 CS6 = 0x100 CS7 = 0x200 CS8 = 0x300 CSIZE = 0x300 CSTART = 0x11 CSTATUS = 0x14 CSTOP = 0x13 CSTOPB = 0x400 CSUSP = 0x1a CTL_HW = 0x6 CTL_KERN = 0x1 CTL_MAXNAME = 0xc CTL_NET = 0x4 CTL_QUERY = -0x2 DIOCBSFLUSH = 0x20006478 DLT_A429 = 0xb8 DLT_A653_ICM = 0xb9 DLT_AIRONET_HEADER = 0x78 DLT_AOS = 0xde DLT_APPLE_IP_OVER_IEEE1394 = 0x8a DLT_ARCNET = 0x7 DLT_ARCNET_LINUX = 0x81 DLT_ATM_CLIP = 0x13 DLT_ATM_RFC1483 = 0xb DLT_AURORA = 0x7e DLT_AX25 = 0x3 DLT_AX25_KISS = 0xca DLT_BACNET_MS_TP = 0xa5 DLT_BLUETOOTH_HCI_H4 = 0xbb DLT_BLUETOOTH_HCI_H4_WITH_PHDR = 0xc9 DLT_CAN20B = 0xbe DLT_CAN_SOCKETCAN = 0xe3 DLT_CHAOS = 0x5 DLT_CISCO_IOS = 0x76 DLT_C_HDLC = 0x68 DLT_C_HDLC_WITH_DIR = 0xcd DLT_DECT = 0xdd DLT_DOCSIS = 0x8f DLT_ECONET = 0x73 DLT_EN10MB = 0x1 DLT_EN3MB = 0x2 DLT_ENC = 0x6d DLT_ERF = 0xc5 DLT_ERF_ETH = 0xaf DLT_ERF_POS = 0xb0 DLT_FC_2 = 0xe0 DLT_FC_2_WITH_FRAME_DELIMS = 0xe1 DLT_FDDI = 0xa DLT_FLEXRAY = 0xd2 DLT_FRELAY = 0x6b DLT_FRELAY_WITH_DIR = 0xce DLT_GCOM_SERIAL = 0xad DLT_GCOM_T1E1 = 0xac DLT_GPF_F = 0xab DLT_GPF_T = 0xaa DLT_GPRS_LLC = 0xa9 DLT_GSMTAP_ABIS = 0xda DLT_GSMTAP_UM = 0xd9 DLT_HDLC = 0x10 DLT_HHDLC = 0x79 DLT_HIPPI = 0xf DLT_IBM_SN = 0x92 DLT_IBM_SP = 0x91 DLT_IEEE802 = 0x6 DLT_IEEE802_11 = 0x69 DLT_IEEE802_11_RADIO = 0x7f DLT_IEEE802_11_RADIO_AVS = 0xa3 DLT_IEEE802_15_4 = 0xc3 DLT_IEEE802_15_4_LINUX = 0xbf DLT_IEEE802_15_4_NONASK_PHY = 0xd7 DLT_IEEE802_16_MAC_CPS = 0xbc DLT_IEEE802_16_MAC_CPS_RADIO = 0xc1 DLT_IPMB = 0xc7 DLT_IPMB_LINUX = 0xd1 DLT_IPNET = 0xe2 DLT_IPV4 = 0xe4 DLT_IPV6 = 0xe5 DLT_IP_OVER_FC = 0x7a DLT_JUNIPER_ATM1 = 0x89 DLT_JUNIPER_ATM2 = 0x87 DLT_JUNIPER_CHDLC = 0xb5 DLT_JUNIPER_ES = 0x84 DLT_JUNIPER_ETHER = 0xb2 DLT_JUNIPER_FRELAY = 0xb4 DLT_JUNIPER_GGSN = 0x85 DLT_JUNIPER_ISM = 0xc2 DLT_JUNIPER_MFR = 0x86 DLT_JUNIPER_MLFR = 0x83 DLT_JUNIPER_MLPPP = 0x82 DLT_JUNIPER_MONITOR = 0xa4 DLT_JUNIPER_PIC_PEER = 0xae DLT_JUNIPER_PPP = 0xb3 DLT_JUNIPER_PPPOE = 0xa7 DLT_JUNIPER_PPPOE_ATM = 0xa8 DLT_JUNIPER_SERVICES = 0x88 DLT_JUNIPER_ST = 0xc8 DLT_JUNIPER_VP = 0xb7 DLT_LAPB_WITH_DIR = 0xcf DLT_LAPD = 0xcb DLT_LIN = 0xd4 DLT_LINUX_EVDEV = 0xd8 DLT_LINUX_IRDA = 0x90 DLT_LINUX_LAPD = 0xb1 DLT_LINUX_SLL = 0x71 DLT_LOOP = 0x6c DLT_LTALK = 0x72 DLT_MFR = 0xb6 DLT_MOST = 0xd3 DLT_MPLS = 0xdb DLT_MTP2 = 0x8c DLT_MTP2_WITH_PHDR = 0x8b DLT_MTP3 = 0x8d DLT_NULL = 0x0 DLT_PCI_EXP = 0x7d DLT_PFLOG = 0x75 DLT_PFSYNC = 0x12 DLT_PPI = 0xc0 DLT_PPP = 0x9 DLT_PPP_BSDOS = 0xe DLT_PPP_ETHER = 0x33 DLT_PPP_PPPD = 0xa6 DLT_PPP_SERIAL = 0x32 DLT_PPP_WITH_DIR = 0xcc DLT_PRISM_HEADER = 0x77 DLT_PRONET = 0x4 DLT_RAIF1 = 0xc6 DLT_RAW = 0xc DLT_RAWAF_MASK = 0x2240000 DLT_RIO = 0x7c DLT_SCCP = 0x8e DLT_SITA = 0xc4 DLT_SLIP = 0x8 DLT_SLIP_BSDOS = 0xd DLT_SUNATM = 0x7b DLT_SYMANTEC_FIREWALL = 0x63 DLT_TZSP = 0x80 DLT_USB = 0xba DLT_USB_LINUX = 0xbd DLT_USB_LINUX_MMAPPED = 0xdc DLT_WIHART = 0xdf DLT_X2E_SERIAL = 0xd5 DLT_X2E_XORAYA = 0xd6 DT_BLK = 0x6 DT_CHR = 0x2 DT_DIR = 0x4 DT_FIFO = 0x1 DT_LNK = 0xa DT_REG = 0x8 DT_SOCK = 0xc DT_UNKNOWN = 0x0 DT_WHT = 0xe ECHO = 0x8 ECHOCTL = 0x40 ECHOE = 0x2 ECHOK = 0x4 ECHOKE = 0x1 ECHONL = 0x10 ECHOPRT = 0x20 EMUL_LINUX = 0x1 EMUL_LINUX32 = 0x5 EMUL_MAXID = 0x6 ETHERCAP_JUMBO_MTU = 0x4 ETHERCAP_VLAN_HWTAGGING = 0x2 ETHERCAP_VLAN_MTU = 0x1 ETHERMIN = 0x2e ETHERMTU = 0x5dc ETHERMTU_JUMBO = 0x2328 ETHERTYPE_8023 = 0x4 ETHERTYPE_AARP = 0x80f3 ETHERTYPE_ACCTON = 0x8390 ETHERTYPE_AEONIC = 0x8036 ETHERTYPE_ALPHA = 0x814a ETHERTYPE_AMBER = 0x6008 ETHERTYPE_AMOEBA = 0x8145 ETHERTYPE_APOLLO = 0x80f7 ETHERTYPE_APOLLODOMAIN = 0x8019 ETHERTYPE_APPLETALK = 0x809b ETHERTYPE_APPLITEK = 0x80c7 ETHERTYPE_ARGONAUT = 0x803a ETHERTYPE_ARP = 0x806 ETHERTYPE_AT = 0x809b ETHERTYPE_ATALK = 0x809b ETHERTYPE_ATOMIC = 0x86df ETHERTYPE_ATT = 0x8069 ETHERTYPE_ATTSTANFORD = 0x8008 ETHERTYPE_AUTOPHON = 0x806a ETHERTYPE_AXIS = 0x8856 ETHERTYPE_BCLOOP = 0x9003 ETHERTYPE_BOFL = 0x8102 ETHERTYPE_CABLETRON = 0x7034 ETHERTYPE_CHAOS = 0x804 ETHERTYPE_COMDESIGN = 0x806c ETHERTYPE_COMPUGRAPHIC = 0x806d ETHERTYPE_COUNTERPOINT = 0x8062 ETHERTYPE_CRONUS = 0x8004 ETHERTYPE_CRONUSVLN = 0x8003 ETHERTYPE_DCA = 0x1234 ETHERTYPE_DDE = 0x807b ETHERTYPE_DEBNI = 0xaaaa ETHERTYPE_DECAM = 0x8048 ETHERTYPE_DECCUST = 0x6006 ETHERTYPE_DECDIAG = 0x6005 ETHERTYPE_DECDNS = 0x803c ETHERTYPE_DECDTS = 0x803e ETHERTYPE_DECEXPER = 0x6000 ETHERTYPE_DECLAST = 0x8041 ETHERTYPE_DECLTM = 0x803f ETHERTYPE_DECMUMPS = 0x6009 ETHERTYPE_DECNETBIOS = 0x8040 ETHERTYPE_DELTACON = 0x86de ETHERTYPE_DIDDLE = 0x4321 ETHERTYPE_DLOG1 = 0x660 ETHERTYPE_DLOG2 = 0x661 ETHERTYPE_DN = 0x6003 ETHERTYPE_DOGFIGHT = 0x1989 ETHERTYPE_DSMD = 0x8039 ETHERTYPE_ECMA = 0x803 ETHERTYPE_ENCRYPT = 0x803d ETHERTYPE_ES = 0x805d ETHERTYPE_EXCELAN = 0x8010 ETHERTYPE_EXPERDATA = 0x8049 ETHERTYPE_FLIP = 0x8146 ETHERTYPE_FLOWCONTROL = 0x8808 ETHERTYPE_FRARP = 0x808 ETHERTYPE_GENDYN = 0x8068 ETHERTYPE_HAYES = 0x8130 ETHERTYPE_HIPPI_FP = 0x8180 ETHERTYPE_HITACHI = 0x8820 ETHERTYPE_HP = 0x8005 ETHERTYPE_IEEEPUP = 0xa00 ETHERTYPE_IEEEPUPAT = 0xa01 ETHERTYPE_IMLBL = 0x4c42 ETHERTYPE_IMLBLDIAG = 0x424c ETHERTYPE_IP = 0x800 ETHERTYPE_IPAS = 0x876c ETHERTYPE_IPV6 = 0x86dd ETHERTYPE_IPX = 0x8137 ETHERTYPE_IPXNEW = 0x8037 ETHERTYPE_KALPANA = 0x8582 ETHERTYPE_LANBRIDGE = 0x8038 ETHERTYPE_LANPROBE = 0x8888 ETHERTYPE_LAT = 0x6004 ETHERTYPE_LBACK = 0x9000 ETHERTYPE_LITTLE = 0x8060 ETHERTYPE_LOGICRAFT = 0x8148 ETHERTYPE_LOOPBACK = 0x9000 ETHERTYPE_MATRA = 0x807a ETHERTYPE_MAX = 0xffff ETHERTYPE_MERIT = 0x807c ETHERTYPE_MICP = 0x873a ETHERTYPE_MOPDL = 0x6001 ETHERTYPE_MOPRC = 0x6002 ETHERTYPE_MOTOROLA = 0x818d ETHERTYPE_MPLS = 0x8847 ETHERTYPE_MPLS_MCAST = 0x8848 ETHERTYPE_MUMPS = 0x813f ETHERTYPE_NBPCC = 0x3c04 ETHERTYPE_NBPCLAIM = 0x3c09 ETHERTYPE_NBPCLREQ = 0x3c05 ETHERTYPE_NBPCLRSP = 0x3c06 ETHERTYPE_NBPCREQ = 0x3c02 ETHERTYPE_NBPCRSP = 0x3c03 ETHERTYPE_NBPDG = 0x3c07 ETHERTYPE_NBPDGB = 0x3c08 ETHERTYPE_NBPDLTE = 0x3c0a ETHERTYPE_NBPRAR = 0x3c0c ETHERTYPE_NBPRAS = 0x3c0b ETHERTYPE_NBPRST = 0x3c0d ETHERTYPE_NBPSCD = 0x3c01 ETHERTYPE_NBPVCD = 0x3c00 ETHERTYPE_NBS = 0x802 ETHERTYPE_NCD = 0x8149 ETHERTYPE_NESTAR = 0x8006 ETHERTYPE_NETBEUI = 0x8191 ETHERTYPE_NOVELL = 0x8138 ETHERTYPE_NS = 0x600 ETHERTYPE_NSAT = 0x601 ETHERTYPE_NSCOMPAT = 0x807 ETHERTYPE_NTRAILER = 0x10 ETHERTYPE_OS9 = 0x7007 ETHERTYPE_OS9NET = 0x7009 ETHERTYPE_PACER = 0x80c6 ETHERTYPE_PAE = 0x888e ETHERTYPE_PCS = 0x4242 ETHERTYPE_PLANNING = 0x8044 ETHERTYPE_PPP = 0x880b ETHERTYPE_PPPOE = 0x8864 ETHERTYPE_PPPOEDISC = 0x8863 ETHERTYPE_PRIMENTS = 0x7031 ETHERTYPE_PUP = 0x200 ETHERTYPE_PUPAT = 0x200 ETHERTYPE_RACAL = 0x7030 ETHERTYPE_RATIONAL = 0x8150 ETHERTYPE_RAWFR = 0x6559 ETHERTYPE_RCL = 0x1995 ETHERTYPE_RDP = 0x8739 ETHERTYPE_RETIX = 0x80f2 ETHERTYPE_REVARP = 0x8035 ETHERTYPE_SCA = 0x6007 ETHERTYPE_SECTRA = 0x86db ETHERTYPE_SECUREDATA = 0x876d ETHERTYPE_SGITW = 0x817e ETHERTYPE_SG_BOUNCE = 0x8016 ETHERTYPE_SG_DIAG = 0x8013 ETHERTYPE_SG_NETGAMES = 0x8014 ETHERTYPE_SG_RESV = 0x8015 ETHERTYPE_SIMNET = 0x5208 ETHERTYPE_SLOWPROTOCOLS = 0x8809 ETHERTYPE_SNA = 0x80d5 ETHERTYPE_SNMP = 0x814c ETHERTYPE_SONIX = 0xfaf5 ETHERTYPE_SPIDER = 0x809f ETHERTYPE_SPRITE = 0x500 ETHERTYPE_STP = 0x8181 ETHERTYPE_TALARIS = 0x812b ETHERTYPE_TALARISMC = 0x852b ETHERTYPE_TCPCOMP = 0x876b ETHERTYPE_TCPSM = 0x9002 ETHERTYPE_TEC = 0x814f ETHERTYPE_TIGAN = 0x802f ETHERTYPE_TRAIL = 0x1000 ETHERTYPE_TRANSETHER = 0x6558 ETHERTYPE_TYMSHARE = 0x802e ETHERTYPE_UBBST = 0x7005 ETHERTYPE_UBDEBUG = 0x900 ETHERTYPE_UBDIAGLOOP = 0x7002 ETHERTYPE_UBDL = 0x7000 ETHERTYPE_UBNIU = 0x7001 ETHERTYPE_UBNMC = 0x7003 ETHERTYPE_VALID = 0x1600 ETHERTYPE_VARIAN = 0x80dd ETHERTYPE_VAXELN = 0x803b ETHERTYPE_VEECO = 0x8067 ETHERTYPE_VEXP = 0x805b ETHERTYPE_VGLAB = 0x8131 ETHERTYPE_VINES = 0xbad ETHERTYPE_VINESECHO = 0xbaf ETHERTYPE_VINESLOOP = 0xbae ETHERTYPE_VITAL = 0xff00 ETHERTYPE_VLAN = 0x8100 ETHERTYPE_VLTLMAN = 0x8080 ETHERTYPE_VPROD = 0x805c ETHERTYPE_VURESERVED = 0x8147 ETHERTYPE_WATERLOO = 0x8130 ETHERTYPE_WELLFLEET = 0x8103 ETHERTYPE_X25 = 0x805 ETHERTYPE_X75 = 0x801 ETHERTYPE_XNSSM = 0x9001 ETHERTYPE_XTP = 0x817d ETHER_ADDR_LEN = 0x6 ETHER_CRC_LEN = 0x4 ETHER_CRC_POLY_BE = 0x4c11db6 ETHER_CRC_POLY_LE = 0xedb88320 ETHER_HDR_LEN = 0xe ETHER_MAX_LEN = 0x5ee ETHER_MAX_LEN_JUMBO = 0x233a ETHER_MIN_LEN = 0x40 ETHER_PPPOE_ENCAP_LEN = 0x8 ETHER_TYPE_LEN = 0x2 ETHER_VLAN_ENCAP_LEN = 0x4 EVFILT_AIO = 0x2 EVFILT_PROC = 0x4 EVFILT_READ = 0x0 EVFILT_SIGNAL = 0x5 EVFILT_SYSCOUNT = 0x7 EVFILT_TIMER = 0x6 EVFILT_VNODE = 0x3 EVFILT_WRITE = 0x1 EV_ADD = 0x1 EV_CLEAR = 0x20 EV_DELETE = 0x2 EV_DISABLE = 0x8 EV_ENABLE = 0x4 EV_EOF = 0x8000 EV_ERROR = 0x4000 EV_FLAG1 = 0x2000 EV_ONESHOT = 0x10 EV_SYSFLAGS = 0xf000 EXTA = 0x4b00 EXTATTR_CMD_START = 0x1 EXTATTR_CMD_STOP = 0x2 EXTATTR_NAMESPACE_SYSTEM = 0x2 EXTATTR_NAMESPACE_USER = 0x1 EXTB = 0x9600 EXTPROC = 0x800 FD_CLOEXEC = 0x1 FD_SETSIZE = 0x100 FLUSHO = 0x800000 F_CLOSEM = 0xa F_DUPFD = 0x0 F_DUPFD_CLOEXEC = 0xc F_FSCTL = -0x80000000 F_FSDIRMASK = 0x70000000 F_FSIN = 0x10000000 F_FSINOUT = 0x30000000 F_FSOUT = 0x20000000 F_FSPRIV = 0x8000 F_FSVOID = 0x40000000 F_GETFD = 0x1 F_GETFL = 0x3 F_GETLK = 0x7 F_GETNOSIGPIPE = 0xd F_GETOWN = 0x5 F_MAXFD = 0xb F_OK = 0x0 F_PARAM_MASK = 0xfff F_PARAM_MAX = 0xfff F_RDLCK = 0x1 F_SETFD = 0x2 F_SETFL = 0x4 F_SETLK = 0x8 F_SETLKW = 0x9 F_SETNOSIGPIPE = 0xe F_SETOWN = 0x6 F_UNLCK = 0x2 F_WRLCK = 0x3 HUPCL = 0x4000 HW_MACHINE = 0x1 ICANON = 0x100 ICMP6_FILTER = 0x12 ICRNL = 0x100 IEXTEN = 0x400 IFAN_ARRIVAL = 0x0 IFAN_DEPARTURE = 0x1 IFA_ROUTE = 0x1 IFF_ALLMULTI = 0x200 IFF_BROADCAST = 0x2 IFF_CANTCHANGE = 0x8f52 IFF_DEBUG = 0x4 IFF_LINK0 = 0x1000 IFF_LINK1 = 0x2000 IFF_LINK2 = 0x4000 IFF_LOOPBACK = 0x8 IFF_MULTICAST = 0x8000 IFF_NOARP = 0x80 IFF_NOTRAILERS = 0x20 IFF_OACTIVE = 0x400 IFF_POINTOPOINT = 0x10 IFF_PROMISC = 0x100 IFF_RUNNING = 0x40 IFF_SIMPLEX = 0x800 IFF_UP = 0x1 IFNAMSIZ = 0x10 IFT_1822 = 0x2 IFT_A12MPPSWITCH = 0x82 IFT_AAL2 = 0xbb IFT_AAL5 = 0x31 IFT_ADSL = 0x5e IFT_AFLANE8023 = 0x3b IFT_AFLANE8025 = 0x3c IFT_ARAP = 0x58 IFT_ARCNET = 0x23 IFT_ARCNETPLUS = 0x24 IFT_ASYNC = 0x54 IFT_ATM = 0x25 IFT_ATMDXI = 0x69 IFT_ATMFUNI = 0x6a IFT_ATMIMA = 0x6b IFT_ATMLOGICAL = 0x50 IFT_ATMRADIO = 0xbd IFT_ATMSUBINTERFACE = 0x86 IFT_ATMVCIENDPT = 0xc2 IFT_ATMVIRTUAL = 0x95 IFT_BGPPOLICYACCOUNTING = 0xa2 IFT_BRIDGE = 0xd1 IFT_BSC = 0x53 IFT_CARP = 0xf8 IFT_CCTEMUL = 0x3d IFT_CEPT = 0x13 IFT_CES = 0x85 IFT_CHANNEL = 0x46 IFT_CNR = 0x55 IFT_COFFEE = 0x84 IFT_COMPOSITELINK = 0x9b IFT_DCN = 0x8d IFT_DIGITALPOWERLINE = 0x8a IFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba IFT_DLSW = 0x4a IFT_DOCSCABLEDOWNSTREAM = 0x80 IFT_DOCSCABLEMACLAYER = 0x7f IFT_DOCSCABLEUPSTREAM = 0x81 IFT_DOCSCABLEUPSTREAMCHANNEL = 0xcd IFT_DS0 = 0x51 IFT_DS0BUNDLE = 0x52 IFT_DS1FDL = 0xaa IFT_DS3 = 0x1e IFT_DTM = 0x8c IFT_DVBASILN = 0xac IFT_DVBASIOUT = 0xad IFT_DVBRCCDOWNSTREAM = 0x93 IFT_DVBRCCMACLAYER = 0x92 IFT_DVBRCCUPSTREAM = 0x94 IFT_ECONET = 0xce IFT_EON = 0x19 IFT_EPLRS = 0x57 IFT_ESCON = 0x49 IFT_ETHER = 0x6 IFT_FAITH = 0xf2 IFT_FAST = 0x7d IFT_FASTETHER = 0x3e IFT_FASTETHERFX = 0x45 IFT_FDDI = 0xf IFT_FIBRECHANNEL = 0x38 IFT_FRAMERELAYINTERCONNECT = 0x3a IFT_FRAMERELAYMPI = 0x5c IFT_FRDLCIENDPT = 0xc1 IFT_FRELAY = 0x20 IFT_FRELAYDCE = 0x2c IFT_FRF16MFRBUNDLE = 0xa3 IFT_FRFORWARD = 0x9e IFT_G703AT2MB = 0x43 IFT_G703AT64K = 0x42 IFT_GIF = 0xf0 IFT_GIGABITETHERNET = 0x75 IFT_GR303IDT = 0xb2 IFT_GR303RDT = 0xb1 IFT_H323GATEKEEPER = 0xa4 IFT_H323PROXY = 0xa5 IFT_HDH1822 = 0x3 IFT_HDLC = 0x76 IFT_HDSL2 = 0xa8 IFT_HIPERLAN2 = 0xb7 IFT_HIPPI = 0x2f IFT_HIPPIINTERFACE = 0x39 IFT_HOSTPAD = 0x5a IFT_HSSI = 0x2e IFT_HY = 0xe IFT_IBM370PARCHAN = 0x48 IFT_IDSL = 0x9a IFT_IEEE1394 = 0x90 IFT_IEEE80211 = 0x47 IFT_IEEE80212 = 0x37 IFT_IEEE8023ADLAG = 0xa1 IFT_IFGSN = 0x91 IFT_IMT = 0xbe IFT_INFINIBAND = 0xc7 IFT_INTERLEAVE = 0x7c IFT_IP = 0x7e IFT_IPFORWARD = 0x8e IFT_IPOVERATM = 0x72 IFT_IPOVERCDLC = 0x6d IFT_IPOVERCLAW = 0x6e IFT_IPSWITCH = 0x4e IFT_ISDN = 0x3f IFT_ISDNBASIC = 0x14 IFT_ISDNPRIMARY = 0x15 IFT_ISDNS = 0x4b IFT_ISDNU = 0x4c IFT_ISO88022LLC = 0x29 IFT_ISO88023 = 0x7 IFT_ISO88024 = 0x8 IFT_ISO88025 = 0x9 IFT_ISO88025CRFPINT = 0x62 IFT_ISO88025DTR = 0x56 IFT_ISO88025FIBER = 0x73 IFT_ISO88026 = 0xa IFT_ISUP = 0xb3 IFT_L2VLAN = 0x87 IFT_L3IPVLAN = 0x88 IFT_L3IPXVLAN = 0x89 IFT_LAPB = 0x10 IFT_LAPD = 0x4d IFT_LAPF = 0x77 IFT_LINEGROUP = 0xd2 IFT_LOCALTALK = 0x2a IFT_LOOP = 0x18 IFT_MEDIAMAILOVERIP = 0x8b IFT_MFSIGLINK = 0xa7 IFT_MIOX25 = 0x26 IFT_MODEM = 0x30 IFT_MPC = 0x71 IFT_MPLS = 0xa6 IFT_MPLSTUNNEL = 0x96 IFT_MSDSL = 0x8f IFT_MVL = 0xbf IFT_MYRINET = 0x63 IFT_NFAS = 0xaf IFT_NSIP = 0x1b IFT_OPTICALCHANNEL = 0xc3 IFT_OPTICALTRANSPORT = 0xc4 IFT_OTHER = 0x1 IFT_P10 = 0xc IFT_P80 = 0xd IFT_PARA = 0x22 IFT_PFLOG = 0xf5 IFT_PFSYNC = 0xf6 IFT_PLC = 0xae IFT_PON155 = 0xcf IFT_PON622 = 0xd0 IFT_POS = 0xab IFT_PPP = 0x17 IFT_PPPMULTILINKBUNDLE = 0x6c IFT_PROPATM = 0xc5 IFT_PROPBWAP2MP = 0xb8 IFT_PROPCNLS = 0x59 IFT_PROPDOCSWIRELESSDOWNSTREAM = 0xb5 IFT_PROPDOCSWIRELESSMACLAYER = 0xb4 IFT_PROPDOCSWIRELESSUPSTREAM = 0xb6 IFT_PROPMUX = 0x36 IFT_PROPVIRTUAL = 0x35 IFT_PROPWIRELESSP2P = 0x9d IFT_PTPSERIAL = 0x16 IFT_PVC = 0xf1 IFT_Q2931 = 0xc9 IFT_QLLC = 0x44 IFT_RADIOMAC = 0xbc IFT_RADSL = 0x5f IFT_REACHDSL = 0xc0 IFT_RFC1483 = 0x9f IFT_RS232 = 0x21 IFT_RSRB = 0x4f IFT_SDLC = 0x11 IFT_SDSL = 0x60 IFT_SHDSL = 0xa9 IFT_SIP = 0x1f IFT_SIPSIG = 0xcc IFT_SIPTG = 0xcb IFT_SLIP = 0x1c IFT_SMDSDXI = 0x2b IFT_SMDSICIP = 0x34 IFT_SONET = 0x27 IFT_SONETOVERHEADCHANNEL = 0xb9 IFT_SONETPATH = 0x32 IFT_SONETVT = 0x33 IFT_SRP = 0x97 IFT_SS7SIGLINK = 0x9c IFT_STACKTOSTACK = 0x6f IFT_STARLAN = 0xb IFT_STF = 0xd7 IFT_T1 = 0x12 IFT_TDLC = 0x74 IFT_TELINK = 0xc8 IFT_TERMPAD = 0x5b IFT_TR008 = 0xb0 IFT_TRANSPHDLC = 0x7b IFT_TUNNEL = 0x83 IFT_ULTRA = 0x1d IFT_USB = 0xa0 IFT_V11 = 0x40 IFT_V35 = 0x2d IFT_V36 = 0x41 IFT_V37 = 0x78 IFT_VDSL = 0x61 IFT_VIRTUALIPADDRESS = 0x70 IFT_VIRTUALTG = 0xca IFT_VOICEDID = 0xd5 IFT_VOICEEM = 0x64 IFT_VOICEEMFGD = 0xd3 IFT_VOICEENCAP = 0x67 IFT_VOICEFGDEANA = 0xd4 IFT_VOICEFXO = 0x65 IFT_VOICEFXS = 0x66 IFT_VOICEOVERATM = 0x98 IFT_VOICEOVERCABLE = 0xc6 IFT_VOICEOVERFRAMERELAY = 0x99 IFT_VOICEOVERIP = 0x68 IFT_X213 = 0x5d IFT_X25 = 0x5 IFT_X25DDN = 0x4 IFT_X25HUNTGROUP = 0x7a IFT_X25MLP = 0x79 IFT_X25PLE = 0x28 IFT_XETHER = 0x1a IGNBRK = 0x1 IGNCR = 0x80 IGNPAR = 0x4 IMAXBEL = 0x2000 INLCR = 0x40 INPCK = 0x10 IN_CLASSA_HOST = 0xffffff IN_CLASSA_MAX = 0x80 IN_CLASSA_NET = 0xff000000 IN_CLASSA_NSHIFT = 0x18 IN_CLASSB_HOST = 0xffff IN_CLASSB_MAX = 0x10000 IN_CLASSB_NET = 0xffff0000 IN_CLASSB_NSHIFT = 0x10 IN_CLASSC_HOST = 0xff IN_CLASSC_NET = 0xffffff00 IN_CLASSC_NSHIFT = 0x8 IN_CLASSD_HOST = 0xfffffff IN_CLASSD_NET = 0xf0000000 IN_CLASSD_NSHIFT = 0x1c IN_LOOPBACKNET = 0x7f IPPROTO_AH = 0x33 IPPROTO_CARP = 0x70 IPPROTO_DONE = 0x101 IPPROTO_DSTOPTS = 0x3c IPPROTO_EGP = 0x8 IPPROTO_ENCAP = 0x62 IPPROTO_EON = 0x50 IPPROTO_ESP = 0x32 IPPROTO_ETHERIP = 0x61 IPPROTO_FRAGMENT = 0x2c IPPROTO_GGP = 0x3 IPPROTO_GRE = 0x2f IPPROTO_HOPOPTS = 0x0 IPPROTO_ICMP = 0x1 IPPROTO_ICMPV6 = 0x3a IPPROTO_IDP = 0x16 IPPROTO_IGMP = 0x2 IPPROTO_IP = 0x0 IPPROTO_IPCOMP = 0x6c IPPROTO_IPIP = 0x4 IPPROTO_IPV4 = 0x4 IPPROTO_IPV6 = 0x29 IPPROTO_IPV6_ICMP = 0x3a IPPROTO_MAX = 0x100 IPPROTO_MAXID = 0x34 IPPROTO_MOBILE = 0x37 IPPROTO_NONE = 0x3b IPPROTO_PFSYNC = 0xf0 IPPROTO_PIM = 0x67 IPPROTO_PUP = 0xc IPPROTO_RAW = 0xff IPPROTO_ROUTING = 0x2b IPPROTO_RSVP = 0x2e IPPROTO_TCP = 0x6 IPPROTO_TP = 0x1d IPPROTO_UDP = 0x11 IPPROTO_VRRP = 0x70 IPV6_CHECKSUM = 0x1a IPV6_DEFAULT_MULTICAST_HOPS = 0x1 IPV6_DEFAULT_MULTICAST_LOOP = 0x1 IPV6_DEFHLIM = 0x40 IPV6_DONTFRAG = 0x3e IPV6_DSTOPTS = 0x32 IPV6_FAITH = 0x1d IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_MASK = 0xffff0f00 IPV6_FRAGTTL = 0x78 IPV6_HLIMDEC = 0x1 IPV6_HOPLIMIT = 0x2f IPV6_HOPOPTS = 0x31 IPV6_IPSEC_POLICY = 0x1c IPV6_JOIN_GROUP = 0xc IPV6_LEAVE_GROUP = 0xd IPV6_MAXHLIM = 0xff IPV6_MAXPACKET = 0xffff IPV6_MMTU = 0x500 IPV6_MULTICAST_HOPS = 0xa IPV6_MULTICAST_IF = 0x9 IPV6_MULTICAST_LOOP = 0xb IPV6_NEXTHOP = 0x30 IPV6_PATHMTU = 0x2c IPV6_PKTINFO = 0x2e IPV6_PORTRANGE = 0xe IPV6_PORTRANGE_DEFAULT = 0x0 IPV6_PORTRANGE_HIGH = 0x1 IPV6_PORTRANGE_LOW = 0x2 IPV6_RECVDSTOPTS = 0x28 IPV6_RECVHOPLIMIT = 0x25 IPV6_RECVHOPOPTS = 0x27 IPV6_RECVPATHMTU = 0x2b IPV6_RECVPKTINFO = 0x24 IPV6_RECVRTHDR = 0x26 IPV6_RECVTCLASS = 0x39 IPV6_RTHDR = 0x33 IPV6_RTHDRDSTOPTS = 0x23 IPV6_RTHDR_LOOSE = 0x0 IPV6_RTHDR_STRICT = 0x1 IPV6_RTHDR_TYPE_0 = 0x0 IPV6_SOCKOPT_RESERVED1 = 0x3 IPV6_TCLASS = 0x3d IPV6_UNICAST_HOPS = 0x4 IPV6_USE_MIN_MTU = 0x2a IPV6_V6ONLY = 0x1b IPV6_VERSION = 0x60 IPV6_VERSION_MASK = 0xf0 IP_ADD_MEMBERSHIP = 0xc IP_DEFAULT_MULTICAST_LOOP = 0x1 IP_DEFAULT_MULTICAST_TTL = 0x1 IP_DF = 0x4000 IP_DROP_MEMBERSHIP = 0xd IP_EF = 0x8000 IP_ERRORMTU = 0x15 IP_HDRINCL = 0x2 IP_IPSEC_POLICY = 0x16 IP_MAXPACKET = 0xffff IP_MAX_MEMBERSHIPS = 0x14 IP_MF = 0x2000 IP_MINFRAGSIZE = 0x45 IP_MINTTL = 0x18 IP_MSS = 0x240 IP_MULTICAST_IF = 0x9 IP_MULTICAST_LOOP = 0xb IP_MULTICAST_TTL = 0xa IP_OFFMASK = 0x1fff IP_OPTIONS = 0x1 IP_PORTRANGE = 0x13 IP_PORTRANGE_DEFAULT = 0x0 IP_PORTRANGE_HIGH = 0x1 IP_PORTRANGE_LOW = 0x2 IP_RECVDSTADDR = 0x7 IP_RECVIF = 0x14 IP_RECVOPTS = 0x5 IP_RECVRETOPTS = 0x6 IP_RECVTTL = 0x17 IP_RETOPTS = 0x8 IP_RF = 0x8000 IP_TOS = 0x3 IP_TTL = 0x4 ISIG = 0x80 ISTRIP = 0x20 IXANY = 0x800 IXOFF = 0x400 IXON = 0x200 KERN_HOSTNAME = 0xa KERN_OSRELEASE = 0x2 KERN_OSTYPE = 0x1 KERN_VERSION = 0x4 LOCK_EX = 0x2 LOCK_NB = 0x4 LOCK_SH = 0x1 LOCK_UN = 0x8 MADV_DONTNEED = 0x4 MADV_FREE = 0x6 MADV_NORMAL = 0x0 MADV_RANDOM = 0x1 MADV_SEQUENTIAL = 0x2 MADV_SPACEAVAIL = 0x5 MADV_WILLNEED = 0x3 MAP_ALIGNMENT_16MB = 0x18000000 MAP_ALIGNMENT_1TB = 0x28000000 MAP_ALIGNMENT_256TB = 0x30000000 MAP_ALIGNMENT_4GB = 0x20000000 MAP_ALIGNMENT_64KB = 0x10000000 MAP_ALIGNMENT_64PB = 0x38000000 MAP_ALIGNMENT_MASK = -0x1000000 MAP_ALIGNMENT_SHIFT = 0x18 MAP_ANON = 0x1000 MAP_FILE = 0x0 MAP_FIXED = 0x10 MAP_HASSEMAPHORE = 0x200 MAP_INHERIT = 0x80 MAP_INHERIT_COPY = 0x1 MAP_INHERIT_DEFAULT = 0x1 MAP_INHERIT_DONATE_COPY = 0x3 MAP_INHERIT_NONE = 0x2 MAP_INHERIT_SHARE = 0x0 MAP_NORESERVE = 0x40 MAP_PRIVATE = 0x2 MAP_RENAME = 0x20 MAP_SHARED = 0x1 MAP_STACK = 0x2000 MAP_TRYFIXED = 0x400 MAP_WIRED = 0x800 MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MNT_ASYNC = 0x40 MNT_BASIC_FLAGS = 0xe782807f MNT_DEFEXPORTED = 0x200 MNT_DISCARD = 0x800000 MNT_EXKERB = 0x800 MNT_EXNORESPORT = 0x8000000 MNT_EXPORTANON = 0x400 MNT_EXPORTED = 0x100 MNT_EXPUBLIC = 0x10000000 MNT_EXRDONLY = 0x80 MNT_EXTATTR = 0x1000000 MNT_FORCE = 0x80000 MNT_GETARGS = 0x400000 MNT_IGNORE = 0x100000 MNT_LAZY = 0x3 MNT_LOCAL = 0x1000 MNT_LOG = 0x2000000 MNT_NOATIME = 0x4000000 MNT_NOCOREDUMP = 0x8000 MNT_NODEV = 0x10 MNT_NODEVMTIME = 0x40000000 MNT_NOEXEC = 0x4 MNT_NOSUID = 0x8 MNT_NOWAIT = 0x2 MNT_OP_FLAGS = 0x4d0000 MNT_QUOTA = 0x2000 MNT_RDONLY = 0x1 MNT_RELATIME = 0x20000 MNT_RELOAD = 0x40000 MNT_ROOTFS = 0x4000 MNT_SOFTDEP = 0x80000000 MNT_SYMPERM = 0x20000000 MNT_SYNCHRONOUS = 0x2 MNT_UNION = 0x20 MNT_UPDATE = 0x10000 MNT_VISFLAGMASK = 0xff90ffff MNT_WAIT = 0x1 MSG_BCAST = 0x100 MSG_CMSG_CLOEXEC = 0x800 MSG_CONTROLMBUF = 0x2000000 MSG_CTRUNC = 0x20 MSG_DONTROUTE = 0x4 MSG_DONTWAIT = 0x80 MSG_EOR = 0x8 MSG_IOVUSRSPACE = 0x4000000 MSG_LENUSRSPACE = 0x8000000 MSG_MCAST = 0x200 MSG_NAMEMBUF = 0x1000000 MSG_NBIO = 0x1000 MSG_NOSIGNAL = 0x400 MSG_OOB = 0x1 MSG_PEEK = 0x2 MSG_TRUNC = 0x10 MSG_USERFLAGS = 0xffffff MSG_WAITALL = 0x40 MS_ASYNC = 0x1 MS_INVALIDATE = 0x2 MS_SYNC = 0x4 NAME_MAX = 0x1ff NET_RT_DUMP = 0x1 NET_RT_FLAGS = 0x2 NET_RT_IFLIST = 0x5 NET_RT_MAXID = 0x6 NET_RT_OIFLIST = 0x4 NET_RT_OOIFLIST = 0x3 NFDBITS = 0x20 NOFLSH = 0x80000000 NOTE_ATTRIB = 0x8 NOTE_CHILD = 0x4 NOTE_DELETE = 0x1 NOTE_EXEC = 0x20000000 NOTE_EXIT = 0x80000000 NOTE_EXTEND = 0x4 NOTE_FORK = 0x40000000 NOTE_LINK = 0x10 NOTE_LOWAT = 0x1 NOTE_PCTRLMASK = 0xf0000000 NOTE_PDATAMASK = 0xfffff NOTE_RENAME = 0x20 NOTE_REVOKE = 0x40 NOTE_TRACK = 0x1 NOTE_TRACKERR = 0x2 NOTE_WRITE = 0x2 OCRNL = 0x10 OFIOGETBMAP = 0xc004667a ONLCR = 0x2 ONLRET = 0x40 ONOCR = 0x20 ONOEOT = 0x8 OPOST = 0x1 O_ACCMODE = 0x3 O_ALT_IO = 0x40000 O_APPEND = 0x8 O_ASYNC = 0x40 O_CLOEXEC = 0x400000 O_CREAT = 0x200 O_DIRECT = 0x80000 O_DIRECTORY = 0x200000 O_DSYNC = 0x10000 O_EXCL = 0x800 O_EXLOCK = 0x20 O_FSYNC = 0x80 O_NDELAY = 0x4 O_NOCTTY = 0x8000 O_NOFOLLOW = 0x100 O_NONBLOCK = 0x4 O_NOSIGPIPE = 0x1000000 O_RDONLY = 0x0 O_RDWR = 0x2 O_RSYNC = 0x20000 O_SHLOCK = 0x10 O_SYNC = 0x80 O_TRUNC = 0x400 O_WRONLY = 0x1 PARENB = 0x1000 PARMRK = 0x8 PARODD = 0x2000 PENDIN = 0x20000000 PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 PRI_IOFLUSH = 0x7c PROT_EXEC = 0x4 PROT_NONE = 0x0 PROT_READ = 0x1 PROT_WRITE = 0x2 RLIMIT_AS = 0xa RLIMIT_CORE = 0x4 RLIMIT_CPU = 0x0 RLIMIT_DATA = 0x2 RLIMIT_FSIZE = 0x1 RLIMIT_MEMLOCK = 0x6 RLIMIT_NOFILE = 0x8 RLIMIT_NPROC = 0x7 RLIMIT_RSS = 0x5 RLIMIT_STACK = 0x3 RLIM_INFINITY = 0x7fffffffffffffff RTAX_AUTHOR = 0x6 RTAX_BRD = 0x7 RTAX_DST = 0x0 RTAX_GATEWAY = 0x1 RTAX_GENMASK = 0x3 RTAX_IFA = 0x5 RTAX_IFP = 0x4 RTAX_MAX = 0x9 RTAX_NETMASK = 0x2 RTAX_TAG = 0x8 RTA_AUTHOR = 0x40 RTA_BRD = 0x80 RTA_DST = 0x1 RTA_GATEWAY = 0x2 RTA_GENMASK = 0x8 RTA_IFA = 0x20 RTA_IFP = 0x10 RTA_NETMASK = 0x4 RTA_TAG = 0x100 RTF_ANNOUNCE = 0x20000 RTF_BLACKHOLE = 0x1000 RTF_CLONED = 0x2000 RTF_CLONING = 0x100 RTF_DONE = 0x40 RTF_DYNAMIC = 0x10 RTF_GATEWAY = 0x2 RTF_HOST = 0x4 RTF_LLINFO = 0x400 RTF_MASK = 0x80 RTF_MODIFIED = 0x20 RTF_PROTO1 = 0x8000 RTF_PROTO2 = 0x4000 RTF_REJECT = 0x8 RTF_SRC = 0x10000 RTF_STATIC = 0x800 RTF_UP = 0x1 RTF_XRESOLVE = 0x200 RTM_ADD = 0x1 RTM_CHANGE = 0x3 RTM_CHGADDR = 0x15 RTM_DELADDR = 0xd RTM_DELETE = 0x2 RTM_GET = 0x4 RTM_IEEE80211 = 0x11 RTM_IFANNOUNCE = 0x10 RTM_IFINFO = 0x14 RTM_LLINFO_UPD = 0x13 RTM_LOCK = 0x8 RTM_LOSING = 0x5 RTM_MISS = 0x7 RTM_NEWADDR = 0xc RTM_OIFINFO = 0xf RTM_OLDADD = 0x9 RTM_OLDDEL = 0xa RTM_OOIFINFO = 0xe RTM_REDIRECT = 0x6 RTM_RESOLVE = 0xb RTM_RTTUNIT = 0xf4240 RTM_SETGATE = 0x12 RTM_VERSION = 0x4 RTV_EXPIRE = 0x4 RTV_HOPCOUNT = 0x2 RTV_MTU = 0x1 RTV_RPIPE = 0x8 RTV_RTT = 0x40 RTV_RTTVAR = 0x80 RTV_SPIPE = 0x10 RTV_SSTHRESH = 0x20 RUSAGE_CHILDREN = -0x1 RUSAGE_SELF = 0x0 SCM_CREDS = 0x4 SCM_RIGHTS = 0x1 SCM_TIMESTAMP = 0x8 SHUT_RD = 0x0 SHUT_RDWR = 0x2 SHUT_WR = 0x1 SIOCADDMULTI = 0x80906931 SIOCADDRT = 0x8038720a SIOCAIFADDR = 0x8040691a SIOCALIFADDR = 0x8118691c SIOCATMARK = 0x40047307 SIOCDELMULTI = 0x80906932 SIOCDELRT = 0x8038720b SIOCDIFADDR = 0x80906919 SIOCDIFPHYADDR = 0x80906949 SIOCDLIFADDR = 0x8118691e SIOCGDRVSPEC = 0xc028697b SIOCGETPFSYNC = 0xc09069f8 SIOCGETSGCNT = 0xc0207534 SIOCGETVIFCNT = 0xc0287533 SIOCGHIWAT = 0x40047301 SIOCGIFADDR = 0xc0906921 SIOCGIFADDRPREF = 0xc0986920 SIOCGIFALIAS = 0xc040691b SIOCGIFBRDADDR = 0xc0906923 SIOCGIFCAP = 0xc0206976 SIOCGIFCONF = 0xc0106926 SIOCGIFDATA = 0xc0986985 SIOCGIFDLT = 0xc0906977 SIOCGIFDSTADDR = 0xc0906922 SIOCGIFFLAGS = 0xc0906911 SIOCGIFGENERIC = 0xc090693a SIOCGIFMEDIA = 0xc0306936 SIOCGIFMETRIC = 0xc0906917 SIOCGIFMTU = 0xc090697e SIOCGIFNETMASK = 0xc0906925 SIOCGIFPDSTADDR = 0xc0906948 SIOCGIFPSRCADDR = 0xc0906947 SIOCGLIFADDR = 0xc118691d SIOCGLIFPHYADDR = 0xc118694b SIOCGLINKSTR = 0xc0286987 SIOCGLOWAT = 0x40047303 SIOCGPGRP = 0x40047309 SIOCGVH = 0xc0906983 SIOCIFCREATE = 0x8090697a SIOCIFDESTROY = 0x80906979 SIOCIFGCLONERS = 0xc0106978 SIOCINITIFADDR = 0xc0706984 SIOCSDRVSPEC = 0x8028697b SIOCSETPFSYNC = 0x809069f7 SIOCSHIWAT = 0x80047300 SIOCSIFADDR = 0x8090690c SIOCSIFADDRPREF = 0x8098691f SIOCSIFBRDADDR = 0x80906913 SIOCSIFCAP = 0x80206975 SIOCSIFDSTADDR = 0x8090690e SIOCSIFFLAGS = 0x80906910 SIOCSIFGENERIC = 0x80906939 SIOCSIFMEDIA = 0xc0906935 SIOCSIFMETRIC = 0x80906918 SIOCSIFMTU = 0x8090697f SIOCSIFNETMASK = 0x80906916 SIOCSIFPHYADDR = 0x80406946 SIOCSLIFPHYADDR = 0x8118694a SIOCSLINKSTR = 0x80286988 SIOCSLOWAT = 0x80047302 SIOCSPGRP = 0x80047308 SIOCSVH = 0xc0906982 SIOCZIFDATA = 0xc0986986 SOCK_CLOEXEC = 0x10000000 SOCK_DGRAM = 0x2 SOCK_FLAGS_MASK = 0xf0000000 SOCK_NONBLOCK = 0x20000000 SOCK_NOSIGPIPE = 0x40000000 SOCK_RAW = 0x3 SOCK_RDM = 0x4 SOCK_SEQPACKET = 0x5 SOCK_STREAM = 0x1 SOL_SOCKET = 0xffff SOMAXCONN = 0x80 SO_ACCEPTCONN = 0x2 SO_ACCEPTFILTER = 0x1000 SO_BROADCAST = 0x20 SO_DEBUG = 0x1 SO_DONTROUTE = 0x10 SO_ERROR = 0x1007 SO_KEEPALIVE = 0x8 SO_LINGER = 0x80 SO_NOHEADER = 0x100a SO_NOSIGPIPE = 0x800 SO_OOBINLINE = 0x100 SO_OVERFLOWED = 0x1009 SO_RCVBUF = 0x1002 SO_RCVLOWAT = 0x1004 SO_RCVTIMEO = 0x100c SO_REUSEADDR = 0x4 SO_REUSEPORT = 0x200 SO_SNDBUF = 0x1001 SO_SNDLOWAT = 0x1003 SO_SNDTIMEO = 0x100b SO_TIMESTAMP = 0x2000 SO_TYPE = 0x1008 SO_USELOOPBACK = 0x40 SYSCTL_VERSION = 0x1000000 SYSCTL_VERS_0 = 0x0 SYSCTL_VERS_1 = 0x1000000 SYSCTL_VERS_MASK = 0xff000000 S_ARCH1 = 0x10000 S_ARCH2 = 0x20000 S_BLKSIZE = 0x200 S_IEXEC = 0x40 S_IFBLK = 0x6000 S_IFCHR = 0x2000 S_IFDIR = 0x4000 S_IFIFO = 0x1000 S_IFLNK = 0xa000 S_IFMT = 0xf000 S_IFREG = 0x8000 S_IFSOCK = 0xc000 S_IFWHT = 0xe000 S_IREAD = 0x100 S_IRGRP = 0x20 S_IROTH = 0x4 S_IRUSR = 0x100 S_IRWXG = 0x38 S_IRWXO = 0x7 S_IRWXU = 0x1c0 S_ISGID = 0x400 S_ISTXT = 0x200 S_ISUID = 0x800 S_ISVTX = 0x200 S_IWGRP = 0x10 S_IWOTH = 0x2 S_IWRITE = 0x80 S_IWUSR = 0x80 S_IXGRP = 0x8 S_IXOTH = 0x1 S_IXUSR = 0x40 S_LOGIN_SET = 0x1 TCIFLUSH = 0x1 TCIOFLUSH = 0x3 TCOFLUSH = 0x2 TCP_CONGCTL = 0x20 TCP_KEEPCNT = 0x6 TCP_KEEPIDLE = 0x3 TCP_KEEPINIT = 0x7 TCP_KEEPINTVL = 0x5 TCP_MAXBURST = 0x4 TCP_MAXSEG = 0x2 TCP_MAXWIN = 0xffff TCP_MAX_WINSHIFT = 0xe TCP_MD5SIG = 0x10 TCP_MINMSS = 0xd8 TCP_MSS = 0x218 TCP_NODELAY = 0x1 TCSAFLUSH = 0x2 TIOCCBRK = 0x2000747a TIOCCDTR = 0x20007478 TIOCCONS = 0x80047462 TIOCDCDTIMESTAMP = 0x40107458 TIOCDRAIN = 0x2000745e TIOCEXCL = 0x2000740d TIOCEXT = 0x80047460 TIOCFLAG_CDTRCTS = 0x10 TIOCFLAG_CLOCAL = 0x2 TIOCFLAG_CRTSCTS = 0x4 TIOCFLAG_MDMBUF = 0x8 TIOCFLAG_SOFTCAR = 0x1 TIOCFLUSH = 0x80047410 TIOCGETA = 0x402c7413 TIOCGETD = 0x4004741a TIOCGFLAGS = 0x4004745d TIOCGLINED = 0x40207442 TIOCGPGRP = 0x40047477 TIOCGQSIZE = 0x40047481 TIOCGRANTPT = 0x20007447 TIOCGSID = 0x40047463 TIOCGSIZE = 0x40087468 TIOCGWINSZ = 0x40087468 TIOCMBIC = 0x8004746b TIOCMBIS = 0x8004746c TIOCMGET = 0x4004746a TIOCMSET = 0x8004746d TIOCM_CAR = 0x40 TIOCM_CD = 0x40 TIOCM_CTS = 0x20 TIOCM_DSR = 0x100 TIOCM_DTR = 0x2 TIOCM_LE = 0x1 TIOCM_RI = 0x80 TIOCM_RNG = 0x80 TIOCM_RTS = 0x4 TIOCM_SR = 0x10 TIOCM_ST = 0x8 TIOCNOTTY = 0x20007471 TIOCNXCL = 0x2000740e TIOCOUTQ = 0x40047473 TIOCPKT = 0x80047470 TIOCPKT_DATA = 0x0 TIOCPKT_DOSTOP = 0x20 TIOCPKT_FLUSHREAD = 0x1 TIOCPKT_FLUSHWRITE = 0x2 TIOCPKT_IOCTL = 0x40 TIOCPKT_NOSTOP = 0x10 TIOCPKT_START = 0x8 TIOCPKT_STOP = 0x4 TIOCPTMGET = 0x40287446 TIOCPTSNAME = 0x40287448 TIOCRCVFRAME = 0x80087445 TIOCREMOTE = 0x80047469 TIOCSBRK = 0x2000747b TIOCSCTTY = 0x20007461 TIOCSDTR = 0x20007479 TIOCSETA = 0x802c7414 TIOCSETAF = 0x802c7416 TIOCSETAW = 0x802c7415 TIOCSETD = 0x8004741b TIOCSFLAGS = 0x8004745c TIOCSIG = 0x2000745f TIOCSLINED = 0x80207443 TIOCSPGRP = 0x80047476 TIOCSQSIZE = 0x80047480 TIOCSSIZE = 0x80087467 TIOCSTART = 0x2000746e TIOCSTAT = 0x80047465 TIOCSTI = 0x80017472 TIOCSTOP = 0x2000746f TIOCSWINSZ = 0x80087467 TIOCUCNTL = 0x80047466 TIOCXMTFRAME = 0x80087444 TOSTOP = 0x400000 VDISCARD = 0xf VDSUSP = 0xb VEOF = 0x0 VEOL = 0x1 VEOL2 = 0x2 VERASE = 0x3 VINTR = 0x8 VKILL = 0x5 VLNEXT = 0xe VMIN = 0x10 VQUIT = 0x9 VREPRINT = 0x6 VSTART = 0xc VSTATUS = 0x12 VSTOP = 0xd VSUSP = 0xa VTIME = 0x11 VWERASE = 0x4 WALL = 0x8 WALLSIG = 0x8 WALTSIG = 0x4 WCLONE = 0x4 WCOREFLAG = 0x80 WNOHANG = 0x1 WNOWAIT = 0x10000 WNOZOMBIE = 0x20000 WOPTSCHECKED = 0x40000 WSTOPPED = 0x7f WUNTRACED = 0x2 ) // Errors const ( E2BIG = syscall.Errno(0x7) EACCES = syscall.Errno(0xd) EADDRINUSE = syscall.Errno(0x30) EADDRNOTAVAIL = syscall.Errno(0x31) EAFNOSUPPORT = syscall.Errno(0x2f) EAGAIN = syscall.Errno(0x23) EALREADY = syscall.Errno(0x25) EAUTH = syscall.Errno(0x50) EBADF = syscall.Errno(0x9) EBADMSG = syscall.Errno(0x58) EBADRPC = syscall.Errno(0x48) EBUSY = syscall.Errno(0x10) ECANCELED = syscall.Errno(0x57) ECHILD = syscall.Errno(0xa) ECONNABORTED = syscall.Errno(0x35) ECONNREFUSED = syscall.Errno(0x3d) ECONNRESET = syscall.Errno(0x36) EDEADLK = syscall.Errno(0xb) EDESTADDRREQ = syscall.Errno(0x27) EDOM = syscall.Errno(0x21) EDQUOT = syscall.Errno(0x45) EEXIST = syscall.Errno(0x11) EFAULT = syscall.Errno(0xe) EFBIG = syscall.Errno(0x1b) EFTYPE = syscall.Errno(0x4f) EHOSTDOWN = syscall.Errno(0x40) EHOSTUNREACH = syscall.Errno(0x41) EIDRM = syscall.Errno(0x52) EILSEQ = syscall.Errno(0x55) EINPROGRESS = syscall.Errno(0x24) EINTR = syscall.Errno(0x4) EINVAL = syscall.Errno(0x16) EIO = syscall.Errno(0x5) EISCONN = syscall.Errno(0x38) EISDIR = syscall.Errno(0x15) ELAST = syscall.Errno(0x60) ELOOP = syscall.Errno(0x3e) EMFILE = syscall.Errno(0x18) EMLINK = syscall.Errno(0x1f) EMSGSIZE = syscall.Errno(0x28) EMULTIHOP = syscall.Errno(0x5e) ENAMETOOLONG = syscall.Errno(0x3f) ENEEDAUTH = syscall.Errno(0x51) ENETDOWN = syscall.Errno(0x32) ENETRESET = syscall.Errno(0x34) ENETUNREACH = syscall.Errno(0x33) ENFILE = syscall.Errno(0x17) ENOATTR = syscall.Errno(0x5d) ENOBUFS = syscall.Errno(0x37) ENODATA = syscall.Errno(0x59) ENODEV = syscall.Errno(0x13) ENOENT = syscall.Errno(0x2) ENOEXEC = syscall.Errno(0x8) ENOLCK = syscall.Errno(0x4d) ENOLINK = syscall.Errno(0x5f) ENOMEM = syscall.Errno(0xc) ENOMSG = syscall.Errno(0x53) ENOPROTOOPT = syscall.Errno(0x2a) ENOSPC = syscall.Errno(0x1c) ENOSR = syscall.Errno(0x5a) ENOSTR = syscall.Errno(0x5b) ENOSYS = syscall.Errno(0x4e) ENOTBLK = syscall.Errno(0xf) ENOTCONN = syscall.Errno(0x39) ENOTDIR = syscall.Errno(0x14) ENOTEMPTY = syscall.Errno(0x42) ENOTSOCK = syscall.Errno(0x26) ENOTSUP = syscall.Errno(0x56) ENOTTY = syscall.Errno(0x19) ENXIO = syscall.Errno(0x6) EOPNOTSUPP = syscall.Errno(0x2d) EOVERFLOW = syscall.Errno(0x54) EPERM = syscall.Errno(0x1) EPFNOSUPPORT = syscall.Errno(0x2e) EPIPE = syscall.Errno(0x20) EPROCLIM = syscall.Errno(0x43) EPROCUNAVAIL = syscall.Errno(0x4c) EPROGMISMATCH = syscall.Errno(0x4b) EPROGUNAVAIL = syscall.Errno(0x4a) EPROTO = syscall.Errno(0x60) EPROTONOSUPPORT = syscall.Errno(0x2b) EPROTOTYPE = syscall.Errno(0x29) ERANGE = syscall.Errno(0x22) EREMOTE = syscall.Errno(0x47) EROFS = syscall.Errno(0x1e) ERPCMISMATCH = syscall.Errno(0x49) ESHUTDOWN = syscall.Errno(0x3a) ESOCKTNOSUPPORT = syscall.Errno(0x2c) ESPIPE = syscall.Errno(0x1d) ESRCH = syscall.Errno(0x3) ESTALE = syscall.Errno(0x46) ETIME = syscall.Errno(0x5c) ETIMEDOUT = syscall.Errno(0x3c) ETOOMANYREFS = syscall.Errno(0x3b) ETXTBSY = syscall.Errno(0x1a) EUSERS = syscall.Errno(0x44) EWOULDBLOCK = syscall.Errno(0x23) EXDEV = syscall.Errno(0x12) ) // Signals const ( SIGABRT = syscall.Signal(0x6) SIGALRM = syscall.Signal(0xe) SIGBUS = syscall.Signal(0xa) SIGCHLD = syscall.Signal(0x14) SIGCONT = syscall.Signal(0x13) SIGEMT = syscall.Signal(0x7) SIGFPE = syscall.Signal(0x8) SIGHUP = syscall.Signal(0x1) SIGILL = syscall.Signal(0x4) SIGINFO = syscall.Signal(0x1d) SIGINT = syscall.Signal(0x2) SIGIO = syscall.Signal(0x17) SIGIOT = syscall.Signal(0x6) SIGKILL = syscall.Signal(0x9) SIGPIPE = syscall.Signal(0xd) SIGPROF = syscall.Signal(0x1b) SIGPWR = syscall.Signal(0x20) SIGQUIT = syscall.Signal(0x3) SIGSEGV = syscall.Signal(0xb) SIGSTOP = syscall.Signal(0x11) SIGSYS = syscall.Signal(0xc) SIGTERM = syscall.Signal(0xf) SIGTRAP = syscall.Signal(0x5) SIGTSTP = syscall.Signal(0x12) SIGTTIN = syscall.Signal(0x15) SIGTTOU = syscall.Signal(0x16) SIGURG = syscall.Signal(0x10) SIGUSR1 = syscall.Signal(0x1e) SIGUSR2 = syscall.Signal(0x1f) SIGVTALRM = syscall.Signal(0x1a) SIGWINCH = syscall.Signal(0x1c) SIGXCPU = syscall.Signal(0x18) SIGXFSZ = syscall.Signal(0x19) ) // Error table var errorList = [...]struct { num syscall.Errno name string desc string }{ {1, "EPERM", "operation not permitted"}, {2, "ENOENT", "no such file or directory"}, {3, "ESRCH", "no such process"}, {4, "EINTR", "interrupted system call"}, {5, "EIO", "input/output error"}, {6, "ENXIO", "device not configured"}, {7, "E2BIG", "argument list too long"}, {8, "ENOEXEC", "exec format error"}, {9, "EBADF", "bad file descriptor"}, {10, "ECHILD", "no child processes"}, {11, "EDEADLK", "resource deadlock avoided"}, {12, "ENOMEM", "cannot allocate memory"}, {13, "EACCES", "permission denied"}, {14, "EFAULT", "bad address"}, {15, "ENOTBLK", "block device required"}, {16, "EBUSY", "device busy"}, {17, "EEXIST", "file exists"}, {18, "EXDEV", "cross-device link"}, {19, "ENODEV", "operation not supported by device"}, {20, "ENOTDIR", "not a directory"}, {21, "EISDIR", "is a directory"}, {22, "EINVAL", "invalid argument"}, {23, "ENFILE", "too many open files in system"}, {24, "EMFILE", "too many open files"}, {25, "ENOTTY", "inappropriate ioctl for device"}, {26, "ETXTBSY", "text file busy"}, {27, "EFBIG", "file too large"}, {28, "ENOSPC", "no space left on device"}, {29, "ESPIPE", "illegal seek"}, {30, "EROFS", "read-only file system"}, {31, "EMLINK", "too many links"}, {32, "EPIPE", "broken pipe"}, {33, "EDOM", "numerical argument out of domain"}, {34, "ERANGE", "result too large or too small"}, {35, "EAGAIN", "resource temporarily unavailable"}, {36, "EINPROGRESS", "operation now in progress"}, {37, "EALREADY", "operation already in progress"}, {38, "ENOTSOCK", "socket operation on non-socket"}, {39, "EDESTADDRREQ", "destination address required"}, {40, "EMSGSIZE", "message too long"}, {41, "EPROTOTYPE", "protocol wrong type for socket"}, {42, "ENOPROTOOPT", "protocol option not available"}, {43, "EPROTONOSUPPORT", "protocol not supported"}, {44, "ESOCKTNOSUPPORT", "socket type not supported"}, {45, "EOPNOTSUPP", "operation not supported"}, {46, "EPFNOSUPPORT", "protocol family not supported"}, {47, "EAFNOSUPPORT", "address family not supported by protocol family"}, {48, "EADDRINUSE", "address already in use"}, {49, "EADDRNOTAVAIL", "can't assign requested address"}, {50, "ENETDOWN", "network is down"}, {51, "ENETUNREACH", "network is unreachable"}, {52, "ENETRESET", "network dropped connection on reset"}, {53, "ECONNABORTED", "software caused connection abort"}, {54, "ECONNRESET", "connection reset by peer"}, {55, "ENOBUFS", "no buffer space available"}, {56, "EISCONN", "socket is already connected"}, {57, "ENOTCONN", "socket is not connected"}, {58, "ESHUTDOWN", "can't send after socket shutdown"}, {59, "ETOOMANYREFS", "too many references: can't splice"}, {60, "ETIMEDOUT", "connection timed out"}, {61, "ECONNREFUSED", "connection refused"}, {62, "ELOOP", "too many levels of symbolic links"}, {63, "ENAMETOOLONG", "file name too long"}, {64, "EHOSTDOWN", "host is down"}, {65, "EHOSTUNREACH", "no route to host"}, {66, "ENOTEMPTY", "directory not empty"}, {67, "EPROCLIM", "too many processes"}, {68, "EUSERS", "too many users"}, {69, "EDQUOT", "disc quota exceeded"}, {70, "ESTALE", "stale NFS file handle"}, {71, "EREMOTE", "too many levels of remote in path"}, {72, "EBADRPC", "RPC struct is bad"}, {73, "ERPCMISMATCH", "RPC version wrong"}, {74, "EPROGUNAVAIL", "RPC prog. not avail"}, {75, "EPROGMISMATCH", "program version wrong"}, {76, "EPROCUNAVAIL", "bad procedure for program"}, {77, "ENOLCK", "no locks available"}, {78, "ENOSYS", "function not implemented"}, {79, "EFTYPE", "inappropriate file type or format"}, {80, "EAUTH", "authentication error"}, {81, "ENEEDAUTH", "need authenticator"}, {82, "EIDRM", "identifier removed"}, {83, "ENOMSG", "no message of desired type"}, {84, "EOVERFLOW", "value too large to be stored in data type"}, {85, "EILSEQ", "illegal byte sequence"}, {86, "ENOTSUP", "not supported"}, {87, "ECANCELED", "operation Canceled"}, {88, "EBADMSG", "bad or Corrupt message"}, {89, "ENODATA", "no message available"}, {90, "ENOSR", "no STREAM resources"}, {91, "ENOSTR", "not a STREAM"}, {92, "ETIME", "STREAM ioctl timeout"}, {93, "ENOATTR", "attribute not found"}, {94, "EMULTIHOP", "multihop attempted"}, {95, "ENOLINK", "link has been severed"}, {96, "ELAST", "protocol error"}, } // Signal table var signalList = [...]struct { num syscall.Signal name string desc string }{ {1, "SIGHUP", "hangup"}, {2, "SIGINT", "interrupt"}, {3, "SIGQUIT", "quit"}, {4, "SIGILL", "illegal instruction"}, {5, "SIGTRAP", "trace/BPT trap"}, {6, "SIGIOT", "abort trap"}, {7, "SIGEMT", "EMT trap"}, {8, "SIGFPE", "floating point exception"}, {9, "SIGKILL", "killed"}, {10, "SIGBUS", "bus error"}, {11, "SIGSEGV", "segmentation fault"}, {12, "SIGSYS", "bad system call"}, {13, "SIGPIPE", "broken pipe"}, {14, "SIGALRM", "alarm clock"}, {15, "SIGTERM", "terminated"}, {16, "SIGURG", "urgent I/O condition"}, {17, "SIGSTOP", "stopped (signal)"}, {18, "SIGTSTP", "stopped"}, {19, "SIGCONT", "continued"}, {20, "SIGCHLD", "child exited"}, {21, "SIGTTIN", "stopped (tty input)"}, {22, "SIGTTOU", "stopped (tty output)"}, {23, "SIGIO", "I/O possible"}, {24, "SIGXCPU", "cputime limit exceeded"}, {25, "SIGXFSZ", "filesize limit exceeded"}, {26, "SIGVTALRM", "virtual timer expired"}, {27, "SIGPROF", "profiling timer expired"}, {28, "SIGWINCH", "window size changes"}, {29, "SIGINFO", "information request"}, {30, "SIGUSR1", "user defined signal 1"}, {31, "SIGUSR2", "user defined signal 2"}, {32, "SIGPWR", "power fail/restart"}, } ================================================ FILE: vendor/golang.org/x/sys/unix/zerrors_openbsd_386.go ================================================ // mkerrors.sh -m32 // Code generated by the command above; see README.md. DO NOT EDIT. //go:build 386 && openbsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -m32 _const.go package unix import "syscall" const ( AF_APPLETALK = 0x10 AF_BLUETOOTH = 0x20 AF_CCITT = 0xa AF_CHAOS = 0x5 AF_CNT = 0x15 AF_COIP = 0x14 AF_DATAKIT = 0x9 AF_DECnet = 0xc AF_DLI = 0xd AF_E164 = 0x1a AF_ECMA = 0x8 AF_ENCAP = 0x1c AF_HYLINK = 0xf AF_IMPLINK = 0x3 AF_INET = 0x2 AF_INET6 = 0x18 AF_IPX = 0x17 AF_ISDN = 0x1a AF_ISO = 0x7 AF_KEY = 0x1e AF_LAT = 0xe AF_LINK = 0x12 AF_LOCAL = 0x1 AF_MAX = 0x24 AF_MPLS = 0x21 AF_NATM = 0x1b AF_NS = 0x6 AF_OSI = 0x7 AF_PUP = 0x4 AF_ROUTE = 0x11 AF_SIP = 0x1d AF_SNA = 0xb AF_UNIX = 0x1 AF_UNSPEC = 0x0 ALTWERASE = 0x200 ARPHRD_ETHER = 0x1 ARPHRD_FRELAY = 0xf ARPHRD_IEEE1394 = 0x18 ARPHRD_IEEE802 = 0x6 B0 = 0x0 B110 = 0x6e B115200 = 0x1c200 B1200 = 0x4b0 B134 = 0x86 B14400 = 0x3840 B150 = 0x96 B1800 = 0x708 B19200 = 0x4b00 B200 = 0xc8 B230400 = 0x38400 B2400 = 0x960 B28800 = 0x7080 B300 = 0x12c B38400 = 0x9600 B4800 = 0x12c0 B50 = 0x32 B57600 = 0xe100 B600 = 0x258 B7200 = 0x1c20 B75 = 0x4b B76800 = 0x12c00 B9600 = 0x2580 BIOCFLUSH = 0x20004268 BIOCGBLEN = 0x40044266 BIOCGDIRFILT = 0x4004427c BIOCGDLT = 0x4004426a BIOCGDLTLIST = 0xc008427b BIOCGETIF = 0x4020426b BIOCGFILDROP = 0x40044278 BIOCGHDRCMPLT = 0x40044274 BIOCGRSIG = 0x40044273 BIOCGRTIMEOUT = 0x400c426e BIOCGSTATS = 0x4008426f BIOCIMMEDIATE = 0x80044270 BIOCLOCK = 0x20004276 BIOCPROMISC = 0x20004269 BIOCSBLEN = 0xc0044266 BIOCSDIRFILT = 0x8004427d BIOCSDLT = 0x8004427a BIOCSETF = 0x80084267 BIOCSETIF = 0x8020426c BIOCSETWF = 0x80084277 BIOCSFILDROP = 0x80044279 BIOCSHDRCMPLT = 0x80044275 BIOCSRSIG = 0x80044272 BIOCSRTIMEOUT = 0x800c426d BIOCVERSION = 0x40044271 BPF_A = 0x10 BPF_ABS = 0x20 BPF_ADD = 0x0 BPF_ALIGNMENT = 0x4 BPF_ALU = 0x4 BPF_AND = 0x50 BPF_B = 0x10 BPF_DIRECTION_IN = 0x1 BPF_DIRECTION_OUT = 0x2 BPF_DIV = 0x30 BPF_FILDROP_CAPTURE = 0x1 BPF_FILDROP_DROP = 0x2 BPF_FILDROP_PASS = 0x0 BPF_F_DIR_IN = 0x10 BPF_F_DIR_MASK = 0x30 BPF_F_DIR_OUT = 0x20 BPF_F_DIR_SHIFT = 0x4 BPF_F_FLOWID = 0x8 BPF_F_PRI_MASK = 0x7 BPF_H = 0x8 BPF_IMM = 0x0 BPF_IND = 0x40 BPF_JA = 0x0 BPF_JEQ = 0x10 BPF_JGE = 0x30 BPF_JGT = 0x20 BPF_JMP = 0x5 BPF_JSET = 0x40 BPF_K = 0x0 BPF_LD = 0x0 BPF_LDX = 0x1 BPF_LEN = 0x80 BPF_LSH = 0x60 BPF_MAJOR_VERSION = 0x1 BPF_MAXBUFSIZE = 0x200000 BPF_MAXINSNS = 0x200 BPF_MEM = 0x60 BPF_MEMWORDS = 0x10 BPF_MINBUFSIZE = 0x20 BPF_MINOR_VERSION = 0x1 BPF_MISC = 0x7 BPF_MSH = 0xa0 BPF_MUL = 0x20 BPF_NEG = 0x80 BPF_OR = 0x40 BPF_RELEASE = 0x30bb6 BPF_RET = 0x6 BPF_RND = 0xc0 BPF_RSH = 0x70 BPF_ST = 0x2 BPF_STX = 0x3 BPF_SUB = 0x10 BPF_TAX = 0x0 BPF_TXA = 0x80 BPF_W = 0x0 BPF_X = 0x8 BRKINT = 0x2 CFLUSH = 0xf CLOCAL = 0x8000 CLOCK_BOOTTIME = 0x6 CLOCK_MONOTONIC = 0x3 CLOCK_PROCESS_CPUTIME_ID = 0x2 CLOCK_REALTIME = 0x0 CLOCK_THREAD_CPUTIME_ID = 0x4 CLOCK_UPTIME = 0x5 CPUSTATES = 0x6 CP_IDLE = 0x5 CP_INTR = 0x4 CP_NICE = 0x1 CP_SPIN = 0x3 CP_SYS = 0x2 CP_USER = 0x0 CREAD = 0x800 CRTSCTS = 0x10000 CS5 = 0x0 CS6 = 0x100 CS7 = 0x200 CS8 = 0x300 CSIZE = 0x300 CSTART = 0x11 CSTATUS = 0xff CSTOP = 0x13 CSTOPB = 0x400 CSUSP = 0x1a CTL_HW = 0x6 CTL_KERN = 0x1 CTL_MAXNAME = 0xc CTL_NET = 0x4 DIOCADDQUEUE = 0xc100445d DIOCADDRULE = 0xccc84404 DIOCADDSTATE = 0xc1084425 DIOCCHANGERULE = 0xccc8441a DIOCCLRIFFLAG = 0xc024445a DIOCCLRSRCNODES = 0x20004455 DIOCCLRSTATES = 0xc0d04412 DIOCCLRSTATUS = 0xc0244416 DIOCGETLIMIT = 0xc0084427 DIOCGETQSTATS = 0xc1084460 DIOCGETQUEUE = 0xc100445f DIOCGETQUEUES = 0xc100445e DIOCGETRULE = 0xccc84407 DIOCGETRULES = 0xccc84406 DIOCGETRULESET = 0xc444443b DIOCGETRULESETS = 0xc444443a DIOCGETSRCNODES = 0xc0084454 DIOCGETSTATE = 0xc1084413 DIOCGETSTATES = 0xc0084419 DIOCGETSTATUS = 0xc1e84415 DIOCGETSYNFLWATS = 0xc0084463 DIOCGETTIMEOUT = 0xc008441e DIOCIGETIFACES = 0xc0244457 DIOCKILLSRCNODES = 0xc068445b DIOCKILLSTATES = 0xc0d04429 DIOCNATLOOK = 0xc0504417 DIOCOSFPADD = 0xc084444f DIOCOSFPFLUSH = 0x2000444e DIOCOSFPGET = 0xc0844450 DIOCRADDADDRS = 0xc44c4443 DIOCRADDTABLES = 0xc44c443d DIOCRCLRADDRS = 0xc44c4442 DIOCRCLRASTATS = 0xc44c4448 DIOCRCLRTABLES = 0xc44c443c DIOCRCLRTSTATS = 0xc44c4441 DIOCRDELADDRS = 0xc44c4444 DIOCRDELTABLES = 0xc44c443e DIOCRGETADDRS = 0xc44c4446 DIOCRGETASTATS = 0xc44c4447 DIOCRGETTABLES = 0xc44c443f DIOCRGETTSTATS = 0xc44c4440 DIOCRINADEFINE = 0xc44c444d DIOCRSETADDRS = 0xc44c4445 DIOCRSETTFLAGS = 0xc44c444a DIOCRTSTADDRS = 0xc44c4449 DIOCSETDEBUG = 0xc0044418 DIOCSETHOSTID = 0xc0044456 DIOCSETIFFLAG = 0xc0244459 DIOCSETLIMIT = 0xc0084428 DIOCSETREASS = 0xc004445c DIOCSETSTATUSIF = 0xc0244414 DIOCSETSYNCOOKIES = 0xc0014462 DIOCSETSYNFLWATS = 0xc0084461 DIOCSETTIMEOUT = 0xc008441d DIOCSTART = 0x20004401 DIOCSTOP = 0x20004402 DIOCXBEGIN = 0xc00c4451 DIOCXCOMMIT = 0xc00c4452 DIOCXROLLBACK = 0xc00c4453 DLT_ARCNET = 0x7 DLT_ATM_RFC1483 = 0xb DLT_AX25 = 0x3 DLT_CHAOS = 0x5 DLT_C_HDLC = 0x68 DLT_EN10MB = 0x1 DLT_EN3MB = 0x2 DLT_ENC = 0xd DLT_FDDI = 0xa DLT_IEEE802 = 0x6 DLT_IEEE802_11 = 0x69 DLT_IEEE802_11_RADIO = 0x7f DLT_LOOP = 0xc DLT_MPLS = 0xdb DLT_NULL = 0x0 DLT_OPENFLOW = 0x10b DLT_PFLOG = 0x75 DLT_PFSYNC = 0x12 DLT_PPP = 0x9 DLT_PPP_BSDOS = 0x10 DLT_PPP_ETHER = 0x33 DLT_PPP_SERIAL = 0x32 DLT_PRONET = 0x4 DLT_RAW = 0xe DLT_SLIP = 0x8 DLT_SLIP_BSDOS = 0xf DLT_USBPCAP = 0xf9 DLT_USER0 = 0x93 DLT_USER1 = 0x94 DLT_USER10 = 0x9d DLT_USER11 = 0x9e DLT_USER12 = 0x9f DLT_USER13 = 0xa0 DLT_USER14 = 0xa1 DLT_USER15 = 0xa2 DLT_USER2 = 0x95 DLT_USER3 = 0x96 DLT_USER4 = 0x97 DLT_USER5 = 0x98 DLT_USER6 = 0x99 DLT_USER7 = 0x9a DLT_USER8 = 0x9b DLT_USER9 = 0x9c DT_BLK = 0x6 DT_CHR = 0x2 DT_DIR = 0x4 DT_FIFO = 0x1 DT_LNK = 0xa DT_REG = 0x8 DT_SOCK = 0xc DT_UNKNOWN = 0x0 ECHO = 0x8 ECHOCTL = 0x40 ECHOE = 0x2 ECHOK = 0x4 ECHOKE = 0x1 ECHONL = 0x10 ECHOPRT = 0x20 EMT_TAGOVF = 0x1 EMUL_ENABLED = 0x1 EMUL_NATIVE = 0x2 ENDRUNDISC = 0x9 ETH64_8021_RSVD_MASK = 0xfffffffffff0 ETH64_8021_RSVD_PREFIX = 0x180c2000000 ETHERMIN = 0x2e ETHERMTU = 0x5dc ETHERTYPE_8023 = 0x4 ETHERTYPE_AARP = 0x80f3 ETHERTYPE_ACCTON = 0x8390 ETHERTYPE_AEONIC = 0x8036 ETHERTYPE_ALPHA = 0x814a ETHERTYPE_AMBER = 0x6008 ETHERTYPE_AMOEBA = 0x8145 ETHERTYPE_AOE = 0x88a2 ETHERTYPE_APOLLO = 0x80f7 ETHERTYPE_APOLLODOMAIN = 0x8019 ETHERTYPE_APPLETALK = 0x809b ETHERTYPE_APPLITEK = 0x80c7 ETHERTYPE_ARGONAUT = 0x803a ETHERTYPE_ARP = 0x806 ETHERTYPE_AT = 0x809b ETHERTYPE_ATALK = 0x809b ETHERTYPE_ATOMIC = 0x86df ETHERTYPE_ATT = 0x8069 ETHERTYPE_ATTSTANFORD = 0x8008 ETHERTYPE_AUTOPHON = 0x806a ETHERTYPE_AXIS = 0x8856 ETHERTYPE_BCLOOP = 0x9003 ETHERTYPE_BOFL = 0x8102 ETHERTYPE_CABLETRON = 0x7034 ETHERTYPE_CHAOS = 0x804 ETHERTYPE_COMDESIGN = 0x806c ETHERTYPE_COMPUGRAPHIC = 0x806d ETHERTYPE_COUNTERPOINT = 0x8062 ETHERTYPE_CRONUS = 0x8004 ETHERTYPE_CRONUSVLN = 0x8003 ETHERTYPE_DCA = 0x1234 ETHERTYPE_DDE = 0x807b ETHERTYPE_DEBNI = 0xaaaa ETHERTYPE_DECAM = 0x8048 ETHERTYPE_DECCUST = 0x6006 ETHERTYPE_DECDIAG = 0x6005 ETHERTYPE_DECDNS = 0x803c ETHERTYPE_DECDTS = 0x803e ETHERTYPE_DECEXPER = 0x6000 ETHERTYPE_DECLAST = 0x8041 ETHERTYPE_DECLTM = 0x803f ETHERTYPE_DECMUMPS = 0x6009 ETHERTYPE_DECNETBIOS = 0x8040 ETHERTYPE_DELTACON = 0x86de ETHERTYPE_DIDDLE = 0x4321 ETHERTYPE_DLOG1 = 0x660 ETHERTYPE_DLOG2 = 0x661 ETHERTYPE_DN = 0x6003 ETHERTYPE_DOGFIGHT = 0x1989 ETHERTYPE_DSMD = 0x8039 ETHERTYPE_EAPOL = 0x888e ETHERTYPE_ECMA = 0x803 ETHERTYPE_ENCRYPT = 0x803d ETHERTYPE_ES = 0x805d ETHERTYPE_EXCELAN = 0x8010 ETHERTYPE_EXPERDATA = 0x8049 ETHERTYPE_FLIP = 0x8146 ETHERTYPE_FLOWCONTROL = 0x8808 ETHERTYPE_FRARP = 0x808 ETHERTYPE_GENDYN = 0x8068 ETHERTYPE_HAYES = 0x8130 ETHERTYPE_HIPPI_FP = 0x8180 ETHERTYPE_HITACHI = 0x8820 ETHERTYPE_HP = 0x8005 ETHERTYPE_IEEEPUP = 0xa00 ETHERTYPE_IEEEPUPAT = 0xa01 ETHERTYPE_IMLBL = 0x4c42 ETHERTYPE_IMLBLDIAG = 0x424c ETHERTYPE_IP = 0x800 ETHERTYPE_IPAS = 0x876c ETHERTYPE_IPV6 = 0x86dd ETHERTYPE_IPX = 0x8137 ETHERTYPE_IPXNEW = 0x8037 ETHERTYPE_KALPANA = 0x8582 ETHERTYPE_LANBRIDGE = 0x8038 ETHERTYPE_LANPROBE = 0x8888 ETHERTYPE_LAT = 0x6004 ETHERTYPE_LBACK = 0x9000 ETHERTYPE_LITTLE = 0x8060 ETHERTYPE_LLDP = 0x88cc ETHERTYPE_LOGICRAFT = 0x8148 ETHERTYPE_LOOPBACK = 0x9000 ETHERTYPE_MACSEC = 0x88e5 ETHERTYPE_MATRA = 0x807a ETHERTYPE_MAX = 0xffff ETHERTYPE_MERIT = 0x807c ETHERTYPE_MICP = 0x873a ETHERTYPE_MOPDL = 0x6001 ETHERTYPE_MOPRC = 0x6002 ETHERTYPE_MOTOROLA = 0x818d ETHERTYPE_MPLS = 0x8847 ETHERTYPE_MPLS_MCAST = 0x8848 ETHERTYPE_MUMPS = 0x813f ETHERTYPE_NBPCC = 0x3c04 ETHERTYPE_NBPCLAIM = 0x3c09 ETHERTYPE_NBPCLREQ = 0x3c05 ETHERTYPE_NBPCLRSP = 0x3c06 ETHERTYPE_NBPCREQ = 0x3c02 ETHERTYPE_NBPCRSP = 0x3c03 ETHERTYPE_NBPDG = 0x3c07 ETHERTYPE_NBPDGB = 0x3c08 ETHERTYPE_NBPDLTE = 0x3c0a ETHERTYPE_NBPRAR = 0x3c0c ETHERTYPE_NBPRAS = 0x3c0b ETHERTYPE_NBPRST = 0x3c0d ETHERTYPE_NBPSCD = 0x3c01 ETHERTYPE_NBPVCD = 0x3c00 ETHERTYPE_NBS = 0x802 ETHERTYPE_NCD = 0x8149 ETHERTYPE_NESTAR = 0x8006 ETHERTYPE_NETBEUI = 0x8191 ETHERTYPE_NHRP = 0x2001 ETHERTYPE_NOVELL = 0x8138 ETHERTYPE_NS = 0x600 ETHERTYPE_NSAT = 0x601 ETHERTYPE_NSCOMPAT = 0x807 ETHERTYPE_NSH = 0x984f ETHERTYPE_NTRAILER = 0x10 ETHERTYPE_OS9 = 0x7007 ETHERTYPE_OS9NET = 0x7009 ETHERTYPE_PACER = 0x80c6 ETHERTYPE_PBB = 0x88e7 ETHERTYPE_PCS = 0x4242 ETHERTYPE_PLANNING = 0x8044 ETHERTYPE_PPP = 0x880b ETHERTYPE_PPPOE = 0x8864 ETHERTYPE_PPPOEDISC = 0x8863 ETHERTYPE_PRIMENTS = 0x7031 ETHERTYPE_PUP = 0x200 ETHERTYPE_PUPAT = 0x200 ETHERTYPE_QINQ = 0x88a8 ETHERTYPE_RACAL = 0x7030 ETHERTYPE_RATIONAL = 0x8150 ETHERTYPE_RAWFR = 0x6559 ETHERTYPE_RCL = 0x1995 ETHERTYPE_RDP = 0x8739 ETHERTYPE_RETIX = 0x80f2 ETHERTYPE_REVARP = 0x8035 ETHERTYPE_SCA = 0x6007 ETHERTYPE_SECTRA = 0x86db ETHERTYPE_SECUREDATA = 0x876d ETHERTYPE_SGITW = 0x817e ETHERTYPE_SG_BOUNCE = 0x8016 ETHERTYPE_SG_DIAG = 0x8013 ETHERTYPE_SG_NETGAMES = 0x8014 ETHERTYPE_SG_RESV = 0x8015 ETHERTYPE_SIMNET = 0x5208 ETHERTYPE_SLOW = 0x8809 ETHERTYPE_SNA = 0x80d5 ETHERTYPE_SNMP = 0x814c ETHERTYPE_SONIX = 0xfaf5 ETHERTYPE_SPIDER = 0x809f ETHERTYPE_SPRITE = 0x500 ETHERTYPE_STP = 0x8181 ETHERTYPE_TALARIS = 0x812b ETHERTYPE_TALARISMC = 0x852b ETHERTYPE_TCPCOMP = 0x876b ETHERTYPE_TCPSM = 0x9002 ETHERTYPE_TEC = 0x814f ETHERTYPE_TIGAN = 0x802f ETHERTYPE_TRAIL = 0x1000 ETHERTYPE_TRANSETHER = 0x6558 ETHERTYPE_TYMSHARE = 0x802e ETHERTYPE_UBBST = 0x7005 ETHERTYPE_UBDEBUG = 0x900 ETHERTYPE_UBDIAGLOOP = 0x7002 ETHERTYPE_UBDL = 0x7000 ETHERTYPE_UBNIU = 0x7001 ETHERTYPE_UBNMC = 0x7003 ETHERTYPE_VALID = 0x1600 ETHERTYPE_VARIAN = 0x80dd ETHERTYPE_VAXELN = 0x803b ETHERTYPE_VEECO = 0x8067 ETHERTYPE_VEXP = 0x805b ETHERTYPE_VGLAB = 0x8131 ETHERTYPE_VINES = 0xbad ETHERTYPE_VINESECHO = 0xbaf ETHERTYPE_VINESLOOP = 0xbae ETHERTYPE_VITAL = 0xff00 ETHERTYPE_VLAN = 0x8100 ETHERTYPE_VLTLMAN = 0x8080 ETHERTYPE_VPROD = 0x805c ETHERTYPE_VURESERVED = 0x8147 ETHERTYPE_WATERLOO = 0x8130 ETHERTYPE_WELLFLEET = 0x8103 ETHERTYPE_X25 = 0x805 ETHERTYPE_X75 = 0x801 ETHERTYPE_XNSSM = 0x9001 ETHERTYPE_XTP = 0x817d ETHER_ADDR_LEN = 0x6 ETHER_ALIGN = 0x2 ETHER_CRC_LEN = 0x4 ETHER_CRC_POLY_BE = 0x4c11db6 ETHER_CRC_POLY_LE = 0xedb88320 ETHER_HDR_LEN = 0xe ETHER_MAX_DIX_LEN = 0x600 ETHER_MAX_HARDMTU_LEN = 0xff9b ETHER_MAX_LEN = 0x5ee ETHER_MIN_LEN = 0x40 ETHER_TYPE_LEN = 0x2 ETHER_VLAN_ENCAP_LEN = 0x4 EVFILT_AIO = -0x3 EVFILT_DEVICE = -0x8 EVFILT_EXCEPT = -0x9 EVFILT_PROC = -0x5 EVFILT_READ = -0x1 EVFILT_SIGNAL = -0x6 EVFILT_SYSCOUNT = 0x9 EVFILT_TIMER = -0x7 EVFILT_VNODE = -0x4 EVFILT_WRITE = -0x2 EVL_ENCAPLEN = 0x4 EVL_PRIO_BITS = 0xd EVL_PRIO_MAX = 0x7 EVL_VLID_MASK = 0xfff EVL_VLID_MAX = 0xffe EVL_VLID_MIN = 0x1 EVL_VLID_NULL = 0x0 EV_ADD = 0x1 EV_CLEAR = 0x20 EV_DELETE = 0x2 EV_DISABLE = 0x8 EV_DISPATCH = 0x80 EV_ENABLE = 0x4 EV_EOF = 0x8000 EV_ERROR = 0x4000 EV_FLAG1 = 0x2000 EV_ONESHOT = 0x10 EV_RECEIPT = 0x40 EV_SYSFLAGS = 0xf800 EXTA = 0x4b00 EXTB = 0x9600 EXTPROC = 0x800 FD_CLOEXEC = 0x1 FD_SETSIZE = 0x400 FLUSHO = 0x800000 F_DUPFD = 0x0 F_DUPFD_CLOEXEC = 0xa F_GETFD = 0x1 F_GETFL = 0x3 F_GETLK = 0x7 F_GETOWN = 0x5 F_ISATTY = 0xb F_OK = 0x0 F_RDLCK = 0x1 F_SETFD = 0x2 F_SETFL = 0x4 F_SETLK = 0x8 F_SETLKW = 0x9 F_SETOWN = 0x6 F_UNLCK = 0x2 F_WRLCK = 0x3 HUPCL = 0x4000 HW_MACHINE = 0x1 ICANON = 0x100 ICMP6_FILTER = 0x12 ICRNL = 0x100 IEXTEN = 0x400 IFAN_ARRIVAL = 0x0 IFAN_DEPARTURE = 0x1 IFF_ALLMULTI = 0x200 IFF_BROADCAST = 0x2 IFF_CANTCHANGE = 0x8e52 IFF_DEBUG = 0x4 IFF_LINK0 = 0x1000 IFF_LINK1 = 0x2000 IFF_LINK2 = 0x4000 IFF_LOOPBACK = 0x8 IFF_MULTICAST = 0x8000 IFF_NOARP = 0x80 IFF_OACTIVE = 0x400 IFF_POINTOPOINT = 0x10 IFF_PROMISC = 0x100 IFF_RUNNING = 0x40 IFF_SIMPLEX = 0x800 IFF_STATICARP = 0x20 IFF_UP = 0x1 IFNAMSIZ = 0x10 IFT_1822 = 0x2 IFT_A12MPPSWITCH = 0x82 IFT_AAL2 = 0xbb IFT_AAL5 = 0x31 IFT_ADSL = 0x5e IFT_AFLANE8023 = 0x3b IFT_AFLANE8025 = 0x3c IFT_ARAP = 0x58 IFT_ARCNET = 0x23 IFT_ARCNETPLUS = 0x24 IFT_ASYNC = 0x54 IFT_ATM = 0x25 IFT_ATMDXI = 0x69 IFT_ATMFUNI = 0x6a IFT_ATMIMA = 0x6b IFT_ATMLOGICAL = 0x50 IFT_ATMRADIO = 0xbd IFT_ATMSUBINTERFACE = 0x86 IFT_ATMVCIENDPT = 0xc2 IFT_ATMVIRTUAL = 0x95 IFT_BGPPOLICYACCOUNTING = 0xa2 IFT_BLUETOOTH = 0xf8 IFT_BRIDGE = 0xd1 IFT_BSC = 0x53 IFT_CARP = 0xf7 IFT_CCTEMUL = 0x3d IFT_CEPT = 0x13 IFT_CES = 0x85 IFT_CHANNEL = 0x46 IFT_CNR = 0x55 IFT_COFFEE = 0x84 IFT_COMPOSITELINK = 0x9b IFT_DCN = 0x8d IFT_DIGITALPOWERLINE = 0x8a IFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba IFT_DLSW = 0x4a IFT_DOCSCABLEDOWNSTREAM = 0x80 IFT_DOCSCABLEMACLAYER = 0x7f IFT_DOCSCABLEUPSTREAM = 0x81 IFT_DOCSCABLEUPSTREAMCHANNEL = 0xcd IFT_DS0 = 0x51 IFT_DS0BUNDLE = 0x52 IFT_DS1FDL = 0xaa IFT_DS3 = 0x1e IFT_DTM = 0x8c IFT_DUMMY = 0xf1 IFT_DVBASILN = 0xac IFT_DVBASIOUT = 0xad IFT_DVBRCCDOWNSTREAM = 0x93 IFT_DVBRCCMACLAYER = 0x92 IFT_DVBRCCUPSTREAM = 0x94 IFT_ECONET = 0xce IFT_ENC = 0xf4 IFT_EON = 0x19 IFT_EPLRS = 0x57 IFT_ESCON = 0x49 IFT_ETHER = 0x6 IFT_FAITH = 0xf3 IFT_FAST = 0x7d IFT_FASTETHER = 0x3e IFT_FASTETHERFX = 0x45 IFT_FDDI = 0xf IFT_FIBRECHANNEL = 0x38 IFT_FRAMERELAYINTERCONNECT = 0x3a IFT_FRAMERELAYMPI = 0x5c IFT_FRDLCIENDPT = 0xc1 IFT_FRELAY = 0x20 IFT_FRELAYDCE = 0x2c IFT_FRF16MFRBUNDLE = 0xa3 IFT_FRFORWARD = 0x9e IFT_G703AT2MB = 0x43 IFT_G703AT64K = 0x42 IFT_GIF = 0xf0 IFT_GIGABITETHERNET = 0x75 IFT_GR303IDT = 0xb2 IFT_GR303RDT = 0xb1 IFT_H323GATEKEEPER = 0xa4 IFT_H323PROXY = 0xa5 IFT_HDH1822 = 0x3 IFT_HDLC = 0x76 IFT_HDSL2 = 0xa8 IFT_HIPERLAN2 = 0xb7 IFT_HIPPI = 0x2f IFT_HIPPIINTERFACE = 0x39 IFT_HOSTPAD = 0x5a IFT_HSSI = 0x2e IFT_HY = 0xe IFT_IBM370PARCHAN = 0x48 IFT_IDSL = 0x9a IFT_IEEE1394 = 0x90 IFT_IEEE80211 = 0x47 IFT_IEEE80212 = 0x37 IFT_IEEE8023ADLAG = 0xa1 IFT_IFGSN = 0x91 IFT_IMT = 0xbe IFT_INFINIBAND = 0xc7 IFT_INTERLEAVE = 0x7c IFT_IP = 0x7e IFT_IPFORWARD = 0x8e IFT_IPOVERATM = 0x72 IFT_IPOVERCDLC = 0x6d IFT_IPOVERCLAW = 0x6e IFT_IPSWITCH = 0x4e IFT_ISDN = 0x3f IFT_ISDNBASIC = 0x14 IFT_ISDNPRIMARY = 0x15 IFT_ISDNS = 0x4b IFT_ISDNU = 0x4c IFT_ISO88022LLC = 0x29 IFT_ISO88023 = 0x7 IFT_ISO88024 = 0x8 IFT_ISO88025 = 0x9 IFT_ISO88025CRFPINT = 0x62 IFT_ISO88025DTR = 0x56 IFT_ISO88025FIBER = 0x73 IFT_ISO88026 = 0xa IFT_ISUP = 0xb3 IFT_L2VLAN = 0x87 IFT_L3IPVLAN = 0x88 IFT_L3IPXVLAN = 0x89 IFT_LAPB = 0x10 IFT_LAPD = 0x4d IFT_LAPF = 0x77 IFT_LINEGROUP = 0xd2 IFT_LOCALTALK = 0x2a IFT_LOOP = 0x18 IFT_MBIM = 0xfa IFT_MEDIAMAILOVERIP = 0x8b IFT_MFSIGLINK = 0xa7 IFT_MIOX25 = 0x26 IFT_MODEM = 0x30 IFT_MPC = 0x71 IFT_MPLS = 0xa6 IFT_MPLSTUNNEL = 0x96 IFT_MSDSL = 0x8f IFT_MVL = 0xbf IFT_MYRINET = 0x63 IFT_NFAS = 0xaf IFT_NSIP = 0x1b IFT_OPTICALCHANNEL = 0xc3 IFT_OPTICALTRANSPORT = 0xc4 IFT_OTHER = 0x1 IFT_P10 = 0xc IFT_P80 = 0xd IFT_PARA = 0x22 IFT_PFLOG = 0xf5 IFT_PFLOW = 0xf9 IFT_PFSYNC = 0xf6 IFT_PLC = 0xae IFT_PON155 = 0xcf IFT_PON622 = 0xd0 IFT_POS = 0xab IFT_PPP = 0x17 IFT_PPPMULTILINKBUNDLE = 0x6c IFT_PROPATM = 0xc5 IFT_PROPBWAP2MP = 0xb8 IFT_PROPCNLS = 0x59 IFT_PROPDOCSWIRELESSDOWNSTREAM = 0xb5 IFT_PROPDOCSWIRELESSMACLAYER = 0xb4 IFT_PROPDOCSWIRELESSUPSTREAM = 0xb6 IFT_PROPMUX = 0x36 IFT_PROPVIRTUAL = 0x35 IFT_PROPWIRELESSP2P = 0x9d IFT_PTPSERIAL = 0x16 IFT_PVC = 0xf2 IFT_Q2931 = 0xc9 IFT_QLLC = 0x44 IFT_RADIOMAC = 0xbc IFT_RADSL = 0x5f IFT_REACHDSL = 0xc0 IFT_RFC1483 = 0x9f IFT_RS232 = 0x21 IFT_RSRB = 0x4f IFT_SDLC = 0x11 IFT_SDSL = 0x60 IFT_SHDSL = 0xa9 IFT_SIP = 0x1f IFT_SIPSIG = 0xcc IFT_SIPTG = 0xcb IFT_SLIP = 0x1c IFT_SMDSDXI = 0x2b IFT_SMDSICIP = 0x34 IFT_SONET = 0x27 IFT_SONETOVERHEADCHANNEL = 0xb9 IFT_SONETPATH = 0x32 IFT_SONETVT = 0x33 IFT_SRP = 0x97 IFT_SS7SIGLINK = 0x9c IFT_STACKTOSTACK = 0x6f IFT_STARLAN = 0xb IFT_T1 = 0x12 IFT_TDLC = 0x74 IFT_TELINK = 0xc8 IFT_TERMPAD = 0x5b IFT_TR008 = 0xb0 IFT_TRANSPHDLC = 0x7b IFT_TUNNEL = 0x83 IFT_ULTRA = 0x1d IFT_USB = 0xa0 IFT_V11 = 0x40 IFT_V35 = 0x2d IFT_V36 = 0x41 IFT_V37 = 0x78 IFT_VDSL = 0x61 IFT_VIRTUALIPADDRESS = 0x70 IFT_VIRTUALTG = 0xca IFT_VOICEDID = 0xd5 IFT_VOICEEM = 0x64 IFT_VOICEEMFGD = 0xd3 IFT_VOICEENCAP = 0x67 IFT_VOICEFGDEANA = 0xd4 IFT_VOICEFXO = 0x65 IFT_VOICEFXS = 0x66 IFT_VOICEOVERATM = 0x98 IFT_VOICEOVERCABLE = 0xc6 IFT_VOICEOVERFRAMERELAY = 0x99 IFT_VOICEOVERIP = 0x68 IFT_WIREGUARD = 0xfb IFT_X213 = 0x5d IFT_X25 = 0x5 IFT_X25DDN = 0x4 IFT_X25HUNTGROUP = 0x7a IFT_X25MLP = 0x79 IFT_X25PLE = 0x28 IFT_XETHER = 0x1a IGNBRK = 0x1 IGNCR = 0x80 IGNPAR = 0x4 IMAXBEL = 0x2000 INLCR = 0x40 INPCK = 0x10 IN_CLASSA_HOST = 0xffffff IN_CLASSA_MAX = 0x80 IN_CLASSA_NET = 0xff000000 IN_CLASSA_NSHIFT = 0x18 IN_CLASSB_HOST = 0xffff IN_CLASSB_MAX = 0x10000 IN_CLASSB_NET = 0xffff0000 IN_CLASSB_NSHIFT = 0x10 IN_CLASSC_HOST = 0xff IN_CLASSC_NET = 0xffffff00 IN_CLASSC_NSHIFT = 0x8 IN_CLASSD_HOST = 0xfffffff IN_CLASSD_NET = 0xf0000000 IN_CLASSD_NSHIFT = 0x1c IN_LOOPBACKNET = 0x7f IN_RFC3021_HOST = 0x1 IN_RFC3021_NET = 0xfffffffe IN_RFC3021_NSHIFT = 0x1f IPPROTO_AH = 0x33 IPPROTO_CARP = 0x70 IPPROTO_DIVERT = 0x102 IPPROTO_DONE = 0x101 IPPROTO_DSTOPTS = 0x3c IPPROTO_EGP = 0x8 IPPROTO_ENCAP = 0x62 IPPROTO_EON = 0x50 IPPROTO_ESP = 0x32 IPPROTO_ETHERIP = 0x61 IPPROTO_FRAGMENT = 0x2c IPPROTO_GGP = 0x3 IPPROTO_GRE = 0x2f IPPROTO_HOPOPTS = 0x0 IPPROTO_ICMP = 0x1 IPPROTO_ICMPV6 = 0x3a IPPROTO_IDP = 0x16 IPPROTO_IGMP = 0x2 IPPROTO_IP = 0x0 IPPROTO_IPCOMP = 0x6c IPPROTO_IPIP = 0x4 IPPROTO_IPV4 = 0x4 IPPROTO_IPV6 = 0x29 IPPROTO_MAX = 0x100 IPPROTO_MAXID = 0x103 IPPROTO_MOBILE = 0x37 IPPROTO_MPLS = 0x89 IPPROTO_NONE = 0x3b IPPROTO_PFSYNC = 0xf0 IPPROTO_PIM = 0x67 IPPROTO_PUP = 0xc IPPROTO_RAW = 0xff IPPROTO_ROUTING = 0x2b IPPROTO_RSVP = 0x2e IPPROTO_SCTP = 0x84 IPPROTO_TCP = 0x6 IPPROTO_TP = 0x1d IPPROTO_UDP = 0x11 IPPROTO_UDPLITE = 0x88 IPV6_AUTH_LEVEL = 0x35 IPV6_AUTOFLOWLABEL = 0x3b IPV6_CHECKSUM = 0x1a IPV6_DEFAULT_MULTICAST_HOPS = 0x1 IPV6_DEFAULT_MULTICAST_LOOP = 0x1 IPV6_DEFHLIM = 0x40 IPV6_DONTFRAG = 0x3e IPV6_DSTOPTS = 0x32 IPV6_ESP_NETWORK_LEVEL = 0x37 IPV6_ESP_TRANS_LEVEL = 0x36 IPV6_FAITH = 0x1d IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_MASK = 0xffff0f00 IPV6_FRAGTTL = 0x78 IPV6_HLIMDEC = 0x1 IPV6_HOPLIMIT = 0x2f IPV6_HOPOPTS = 0x31 IPV6_IPCOMP_LEVEL = 0x3c IPV6_JOIN_GROUP = 0xc IPV6_LEAVE_GROUP = 0xd IPV6_MAXHLIM = 0xff IPV6_MAXPACKET = 0xffff IPV6_MINHOPCOUNT = 0x41 IPV6_MMTU = 0x500 IPV6_MULTICAST_HOPS = 0xa IPV6_MULTICAST_IF = 0x9 IPV6_MULTICAST_LOOP = 0xb IPV6_NEXTHOP = 0x30 IPV6_OPTIONS = 0x1 IPV6_PATHMTU = 0x2c IPV6_PIPEX = 0x3f IPV6_PKTINFO = 0x2e IPV6_PORTRANGE = 0xe IPV6_PORTRANGE_DEFAULT = 0x0 IPV6_PORTRANGE_HIGH = 0x1 IPV6_PORTRANGE_LOW = 0x2 IPV6_RECVDSTOPTS = 0x28 IPV6_RECVDSTPORT = 0x40 IPV6_RECVHOPLIMIT = 0x25 IPV6_RECVHOPOPTS = 0x27 IPV6_RECVPATHMTU = 0x2b IPV6_RECVPKTINFO = 0x24 IPV6_RECVRTHDR = 0x26 IPV6_RECVTCLASS = 0x39 IPV6_RTABLE = 0x1021 IPV6_RTHDR = 0x33 IPV6_RTHDRDSTOPTS = 0x23 IPV6_RTHDR_LOOSE = 0x0 IPV6_RTHDR_STRICT = 0x1 IPV6_RTHDR_TYPE_0 = 0x0 IPV6_SOCKOPT_RESERVED1 = 0x3 IPV6_TCLASS = 0x3d IPV6_UNICAST_HOPS = 0x4 IPV6_USE_MIN_MTU = 0x2a IPV6_V6ONLY = 0x1b IPV6_VERSION = 0x60 IPV6_VERSION_MASK = 0xf0 IP_ADD_MEMBERSHIP = 0xc IP_AUTH_LEVEL = 0x14 IP_DEFAULT_MULTICAST_LOOP = 0x1 IP_DEFAULT_MULTICAST_TTL = 0x1 IP_DF = 0x4000 IP_DROP_MEMBERSHIP = 0xd IP_ESP_NETWORK_LEVEL = 0x16 IP_ESP_TRANS_LEVEL = 0x15 IP_HDRINCL = 0x2 IP_IPCOMP_LEVEL = 0x1d IP_IPDEFTTL = 0x25 IP_IPSECFLOWINFO = 0x24 IP_IPSEC_LOCAL_AUTH = 0x1b IP_IPSEC_LOCAL_CRED = 0x19 IP_IPSEC_LOCAL_ID = 0x17 IP_IPSEC_REMOTE_AUTH = 0x1c IP_IPSEC_REMOTE_CRED = 0x1a IP_IPSEC_REMOTE_ID = 0x18 IP_MAXPACKET = 0xffff IP_MAX_MEMBERSHIPS = 0xfff IP_MF = 0x2000 IP_MINTTL = 0x20 IP_MIN_MEMBERSHIPS = 0xf IP_MSS = 0x240 IP_MULTICAST_IF = 0x9 IP_MULTICAST_LOOP = 0xb IP_MULTICAST_TTL = 0xa IP_OFFMASK = 0x1fff IP_OPTIONS = 0x1 IP_PIPEX = 0x22 IP_PORTRANGE = 0x13 IP_PORTRANGE_DEFAULT = 0x0 IP_PORTRANGE_HIGH = 0x1 IP_PORTRANGE_LOW = 0x2 IP_RECVDSTADDR = 0x7 IP_RECVDSTPORT = 0x21 IP_RECVIF = 0x1e IP_RECVOPTS = 0x5 IP_RECVRETOPTS = 0x6 IP_RECVRTABLE = 0x23 IP_RECVTTL = 0x1f IP_RETOPTS = 0x8 IP_RF = 0x8000 IP_RTABLE = 0x1021 IP_SENDSRCADDR = 0x7 IP_TOS = 0x3 IP_TTL = 0x4 ISIG = 0x80 ISTRIP = 0x20 ITIMER_PROF = 0x2 ITIMER_REAL = 0x0 ITIMER_VIRTUAL = 0x1 IUCLC = 0x1000 IXANY = 0x800 IXOFF = 0x400 IXON = 0x200 KERN_HOSTNAME = 0xa KERN_OSRELEASE = 0x2 KERN_OSTYPE = 0x1 KERN_VERSION = 0x4 LCNT_OVERLOAD_FLUSH = 0x6 LOCK_EX = 0x2 LOCK_NB = 0x4 LOCK_SH = 0x1 LOCK_UN = 0x8 MADV_DONTNEED = 0x4 MADV_FREE = 0x6 MADV_NORMAL = 0x0 MADV_RANDOM = 0x1 MADV_SEQUENTIAL = 0x2 MADV_SPACEAVAIL = 0x5 MADV_WILLNEED = 0x3 MAP_ANON = 0x1000 MAP_ANONYMOUS = 0x1000 MAP_CONCEAL = 0x8000 MAP_COPY = 0x2 MAP_FILE = 0x0 MAP_FIXED = 0x10 MAP_FLAGMASK = 0xfff7 MAP_HASSEMAPHORE = 0x0 MAP_INHERIT = 0x0 MAP_INHERIT_COPY = 0x1 MAP_INHERIT_NONE = 0x2 MAP_INHERIT_SHARE = 0x0 MAP_INHERIT_ZERO = 0x3 MAP_NOEXTEND = 0x0 MAP_NORESERVE = 0x0 MAP_PRIVATE = 0x2 MAP_RENAME = 0x0 MAP_SHARED = 0x1 MAP_STACK = 0x4000 MAP_TRYFIXED = 0x0 MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MNT_ASYNC = 0x40 MNT_DEFEXPORTED = 0x200 MNT_DELEXPORT = 0x20000 MNT_DOOMED = 0x8000000 MNT_EXPORTANON = 0x400 MNT_EXPORTED = 0x100 MNT_EXRDONLY = 0x80 MNT_FORCE = 0x80000 MNT_LAZY = 0x3 MNT_LOCAL = 0x1000 MNT_NOATIME = 0x8000 MNT_NODEV = 0x10 MNT_NOEXEC = 0x4 MNT_NOPERM = 0x20 MNT_NOSUID = 0x8 MNT_NOWAIT = 0x2 MNT_QUOTA = 0x2000 MNT_RDONLY = 0x1 MNT_RELOAD = 0x40000 MNT_ROOTFS = 0x4000 MNT_SOFTDEP = 0x4000000 MNT_STALLED = 0x100000 MNT_SWAPPABLE = 0x200000 MNT_SYNCHRONOUS = 0x2 MNT_UPDATE = 0x10000 MNT_VISFLAGMASK = 0x400ffff MNT_WAIT = 0x1 MNT_WANTRDWR = 0x2000000 MNT_WXALLOWED = 0x800 MOUNT_AFS = "afs" MOUNT_CD9660 = "cd9660" MOUNT_EXT2FS = "ext2fs" MOUNT_FFS = "ffs" MOUNT_FUSEFS = "fuse" MOUNT_MFS = "mfs" MOUNT_MSDOS = "msdos" MOUNT_NCPFS = "ncpfs" MOUNT_NFS = "nfs" MOUNT_NTFS = "ntfs" MOUNT_TMPFS = "tmpfs" MOUNT_UDF = "udf" MOUNT_UFS = "ffs" MSG_BCAST = 0x100 MSG_CMSG_CLOEXEC = 0x800 MSG_CTRUNC = 0x20 MSG_DONTROUTE = 0x4 MSG_DONTWAIT = 0x80 MSG_EOR = 0x8 MSG_MCAST = 0x200 MSG_NOSIGNAL = 0x400 MSG_OOB = 0x1 MSG_PEEK = 0x2 MSG_TRUNC = 0x10 MSG_WAITALL = 0x40 MSG_WAITFORONE = 0x1000 MS_ASYNC = 0x1 MS_INVALIDATE = 0x4 MS_SYNC = 0x2 NAME_MAX = 0xff NET_RT_DUMP = 0x1 NET_RT_FLAGS = 0x2 NET_RT_IFLIST = 0x3 NET_RT_IFNAMES = 0x6 NET_RT_MAXID = 0x8 NET_RT_SOURCE = 0x7 NET_RT_STATS = 0x4 NET_RT_TABLE = 0x5 NFDBITS = 0x20 NOFLSH = 0x80000000 NOKERNINFO = 0x2000000 NOTE_ATTRIB = 0x8 NOTE_CHANGE = 0x1 NOTE_CHILD = 0x4 NOTE_DELETE = 0x1 NOTE_EOF = 0x2 NOTE_EXEC = 0x20000000 NOTE_EXIT = 0x80000000 NOTE_EXTEND = 0x4 NOTE_FORK = 0x40000000 NOTE_LINK = 0x10 NOTE_LOWAT = 0x1 NOTE_OOB = 0x4 NOTE_PCTRLMASK = 0xf0000000 NOTE_PDATAMASK = 0xfffff NOTE_RENAME = 0x20 NOTE_REVOKE = 0x40 NOTE_TRACK = 0x1 NOTE_TRACKERR = 0x2 NOTE_TRUNCATE = 0x80 NOTE_WRITE = 0x2 OCRNL = 0x10 OLCUC = 0x20 ONLCR = 0x2 ONLRET = 0x80 ONOCR = 0x40 ONOEOT = 0x8 OPOST = 0x1 OXTABS = 0x4 O_ACCMODE = 0x3 O_APPEND = 0x8 O_ASYNC = 0x40 O_CLOEXEC = 0x10000 O_CREAT = 0x200 O_DIRECTORY = 0x20000 O_DSYNC = 0x80 O_EXCL = 0x800 O_EXLOCK = 0x20 O_FSYNC = 0x80 O_NDELAY = 0x4 O_NOCTTY = 0x8000 O_NOFOLLOW = 0x100 O_NONBLOCK = 0x4 O_RDONLY = 0x0 O_RDWR = 0x2 O_RSYNC = 0x80 O_SHLOCK = 0x10 O_SYNC = 0x80 O_TRUNC = 0x400 O_WRONLY = 0x1 PARENB = 0x1000 PARMRK = 0x8 PARODD = 0x2000 PENDIN = 0x20000000 PF_FLUSH = 0x1 PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 PROT_EXEC = 0x4 PROT_NONE = 0x0 PROT_READ = 0x1 PROT_WRITE = 0x2 RLIMIT_CORE = 0x4 RLIMIT_CPU = 0x0 RLIMIT_DATA = 0x2 RLIMIT_FSIZE = 0x1 RLIMIT_MEMLOCK = 0x6 RLIMIT_NOFILE = 0x8 RLIMIT_NPROC = 0x7 RLIMIT_RSS = 0x5 RLIMIT_STACK = 0x3 RLIM_INFINITY = 0x7fffffffffffffff RTAX_AUTHOR = 0x6 RTAX_BFD = 0xb RTAX_BRD = 0x7 RTAX_DNS = 0xc RTAX_DST = 0x0 RTAX_GATEWAY = 0x1 RTAX_GENMASK = 0x3 RTAX_IFA = 0x5 RTAX_IFP = 0x4 RTAX_LABEL = 0xa RTAX_MAX = 0xf RTAX_NETMASK = 0x2 RTAX_SEARCH = 0xe RTAX_SRC = 0x8 RTAX_SRCMASK = 0x9 RTAX_STATIC = 0xd RTA_AUTHOR = 0x40 RTA_BFD = 0x800 RTA_BRD = 0x80 RTA_DNS = 0x1000 RTA_DST = 0x1 RTA_GATEWAY = 0x2 RTA_GENMASK = 0x8 RTA_IFA = 0x20 RTA_IFP = 0x10 RTA_LABEL = 0x400 RTA_NETMASK = 0x4 RTA_SEARCH = 0x4000 RTA_SRC = 0x100 RTA_SRCMASK = 0x200 RTA_STATIC = 0x2000 RTF_ANNOUNCE = 0x4000 RTF_BFD = 0x1000000 RTF_BLACKHOLE = 0x1000 RTF_BROADCAST = 0x400000 RTF_CACHED = 0x20000 RTF_CLONED = 0x10000 RTF_CLONING = 0x100 RTF_CONNECTED = 0x800000 RTF_DONE = 0x40 RTF_DYNAMIC = 0x10 RTF_FMASK = 0x110fc08 RTF_GATEWAY = 0x2 RTF_HOST = 0x4 RTF_LLINFO = 0x400 RTF_LOCAL = 0x200000 RTF_MODIFIED = 0x20 RTF_MPATH = 0x40000 RTF_MPLS = 0x100000 RTF_MULTICAST = 0x200 RTF_PERMANENT_ARP = 0x2000 RTF_PROTO1 = 0x8000 RTF_PROTO2 = 0x4000 RTF_PROTO3 = 0x2000 RTF_REJECT = 0x8 RTF_STATIC = 0x800 RTF_UP = 0x1 RTF_USETRAILERS = 0x8000 RTM_80211INFO = 0x15 RTM_ADD = 0x1 RTM_BFD = 0x12 RTM_CHANGE = 0x3 RTM_CHGADDRATTR = 0x14 RTM_DELADDR = 0xd RTM_DELETE = 0x2 RTM_DESYNC = 0x10 RTM_GET = 0x4 RTM_IFANNOUNCE = 0xf RTM_IFINFO = 0xe RTM_INVALIDATE = 0x11 RTM_LOSING = 0x5 RTM_MAXSIZE = 0x800 RTM_MISS = 0x7 RTM_NEWADDR = 0xc RTM_PROPOSAL = 0x13 RTM_REDIRECT = 0x6 RTM_RESOLVE = 0xb RTM_SOURCE = 0x16 RTM_VERSION = 0x5 RTV_EXPIRE = 0x4 RTV_HOPCOUNT = 0x2 RTV_MTU = 0x1 RTV_RPIPE = 0x8 RTV_RTT = 0x40 RTV_RTTVAR = 0x80 RTV_SPIPE = 0x10 RTV_SSTHRESH = 0x20 RT_TABLEID_BITS = 0x8 RT_TABLEID_MASK = 0xff RT_TABLEID_MAX = 0xff RUSAGE_CHILDREN = -0x1 RUSAGE_SELF = 0x0 RUSAGE_THREAD = 0x1 SCM_RIGHTS = 0x1 SCM_TIMESTAMP = 0x4 SEEK_CUR = 0x1 SEEK_END = 0x2 SEEK_SET = 0x0 SHUT_RD = 0x0 SHUT_RDWR = 0x2 SHUT_WR = 0x1 SIOCADDMULTI = 0x80206931 SIOCAIFADDR = 0x8040691a SIOCAIFGROUP = 0x80246987 SIOCATMARK = 0x40047307 SIOCBRDGADD = 0x805c693c SIOCBRDGADDL = 0x805c6949 SIOCBRDGADDS = 0x805c6941 SIOCBRDGARL = 0x808c694d SIOCBRDGDADDR = 0x81286947 SIOCBRDGDEL = 0x805c693d SIOCBRDGDELS = 0x805c6942 SIOCBRDGFLUSH = 0x805c6948 SIOCBRDGFRL = 0x808c694e SIOCBRDGGCACHE = 0xc0146941 SIOCBRDGGFD = 0xc0146952 SIOCBRDGGHT = 0xc0146951 SIOCBRDGGIFFLGS = 0xc05c693e SIOCBRDGGMA = 0xc0146953 SIOCBRDGGPARAM = 0xc03c6958 SIOCBRDGGPRI = 0xc0146950 SIOCBRDGGRL = 0xc028694f SIOCBRDGGTO = 0xc0146946 SIOCBRDGIFS = 0xc05c6942 SIOCBRDGRTS = 0xc0186943 SIOCBRDGSADDR = 0xc1286944 SIOCBRDGSCACHE = 0x80146940 SIOCBRDGSFD = 0x80146952 SIOCBRDGSHT = 0x80146951 SIOCBRDGSIFCOST = 0x805c6955 SIOCBRDGSIFFLGS = 0x805c693f SIOCBRDGSIFPRIO = 0x805c6954 SIOCBRDGSIFPROT = 0x805c694a SIOCBRDGSMA = 0x80146953 SIOCBRDGSPRI = 0x80146950 SIOCBRDGSPROTO = 0x8014695a SIOCBRDGSTO = 0x80146945 SIOCBRDGSTXHC = 0x80146959 SIOCDELLABEL = 0x80206997 SIOCDELMULTI = 0x80206932 SIOCDIFADDR = 0x80206919 SIOCDIFGROUP = 0x80246989 SIOCDIFPARENT = 0x802069b4 SIOCDIFPHYADDR = 0x80206949 SIOCDPWE3NEIGHBOR = 0x802069de SIOCDVNETID = 0x802069af SIOCGETKALIVE = 0xc01869a4 SIOCGETLABEL = 0x8020699a SIOCGETMPWCFG = 0xc02069ae SIOCGETPFLOW = 0xc02069fe SIOCGETPFSYNC = 0xc02069f8 SIOCGETSGCNT = 0xc0147534 SIOCGETVIFCNT = 0xc0147533 SIOCGETVLAN = 0xc0206990 SIOCGIFADDR = 0xc0206921 SIOCGIFBRDADDR = 0xc0206923 SIOCGIFCONF = 0xc0086924 SIOCGIFDATA = 0xc020691b SIOCGIFDESCR = 0xc0206981 SIOCGIFDSTADDR = 0xc0206922 SIOCGIFFLAGS = 0xc0206911 SIOCGIFGATTR = 0xc024698b SIOCGIFGENERIC = 0xc020693a SIOCGIFGLIST = 0xc024698d SIOCGIFGMEMB = 0xc024698a SIOCGIFGROUP = 0xc0246988 SIOCGIFHARDMTU = 0xc02069a5 SIOCGIFLLPRIO = 0xc02069b6 SIOCGIFMEDIA = 0xc0386938 SIOCGIFMETRIC = 0xc0206917 SIOCGIFMTU = 0xc020697e SIOCGIFNETMASK = 0xc0206925 SIOCGIFPAIR = 0xc02069b1 SIOCGIFPARENT = 0xc02069b3 SIOCGIFPRIORITY = 0xc020699c SIOCGIFRDOMAIN = 0xc02069a0 SIOCGIFRTLABEL = 0xc0206983 SIOCGIFRXR = 0x802069aa SIOCGIFSFFPAGE = 0xc1126939 SIOCGIFXFLAGS = 0xc020699e SIOCGLIFPHYADDR = 0xc218694b SIOCGLIFPHYDF = 0xc02069c2 SIOCGLIFPHYECN = 0xc02069c8 SIOCGLIFPHYRTABLE = 0xc02069a2 SIOCGLIFPHYTTL = 0xc02069a9 SIOCGPGRP = 0x40047309 SIOCGPWE3 = 0xc0206998 SIOCGPWE3CTRLWORD = 0xc02069dc SIOCGPWE3FAT = 0xc02069dd SIOCGPWE3NEIGHBOR = 0xc21869de SIOCGRXHPRIO = 0xc02069db SIOCGSPPPPARAMS = 0xc0206994 SIOCGTXHPRIO = 0xc02069c6 SIOCGUMBINFO = 0xc02069be SIOCGUMBPARAM = 0xc02069c0 SIOCGVH = 0xc02069f6 SIOCGVNETFLOWID = 0xc02069c4 SIOCGVNETID = 0xc02069a7 SIOCIFAFATTACH = 0x801169ab SIOCIFAFDETACH = 0x801169ac SIOCIFCREATE = 0x8020697a SIOCIFDESTROY = 0x80206979 SIOCIFGCLONERS = 0xc00c6978 SIOCSETKALIVE = 0x801869a3 SIOCSETLABEL = 0x80206999 SIOCSETMPWCFG = 0x802069ad SIOCSETPFLOW = 0x802069fd SIOCSETPFSYNC = 0x802069f7 SIOCSETVLAN = 0x8020698f SIOCSIFADDR = 0x8020690c SIOCSIFBRDADDR = 0x80206913 SIOCSIFDESCR = 0x80206980 SIOCSIFDSTADDR = 0x8020690e SIOCSIFFLAGS = 0x80206910 SIOCSIFGATTR = 0x8024698c SIOCSIFGENERIC = 0x80206939 SIOCSIFLLADDR = 0x8020691f SIOCSIFLLPRIO = 0x802069b5 SIOCSIFMEDIA = 0xc0206937 SIOCSIFMETRIC = 0x80206918 SIOCSIFMTU = 0x8020697f SIOCSIFNETMASK = 0x80206916 SIOCSIFPAIR = 0x802069b0 SIOCSIFPARENT = 0x802069b2 SIOCSIFPRIORITY = 0x8020699b SIOCSIFRDOMAIN = 0x8020699f SIOCSIFRTLABEL = 0x80206982 SIOCSIFXFLAGS = 0x8020699d SIOCSLIFPHYADDR = 0x8218694a SIOCSLIFPHYDF = 0x802069c1 SIOCSLIFPHYECN = 0x802069c7 SIOCSLIFPHYRTABLE = 0x802069a1 SIOCSLIFPHYTTL = 0x802069a8 SIOCSPGRP = 0x80047308 SIOCSPWE3CTRLWORD = 0x802069dc SIOCSPWE3FAT = 0x802069dd SIOCSPWE3NEIGHBOR = 0x821869de SIOCSRXHPRIO = 0x802069db SIOCSSPPPPARAMS = 0x80206993 SIOCSTXHPRIO = 0x802069c5 SIOCSUMBPARAM = 0x802069bf SIOCSVH = 0xc02069f5 SIOCSVNETFLOWID = 0x802069c3 SIOCSVNETID = 0x802069a6 SOCK_CLOEXEC = 0x8000 SOCK_DGRAM = 0x2 SOCK_DNS = 0x1000 SOCK_NONBLOCK = 0x4000 SOCK_RAW = 0x3 SOCK_RDM = 0x4 SOCK_SEQPACKET = 0x5 SOCK_STREAM = 0x1 SOL_SOCKET = 0xffff SOMAXCONN = 0x80 SO_ACCEPTCONN = 0x2 SO_BINDANY = 0x1000 SO_BROADCAST = 0x20 SO_DEBUG = 0x1 SO_DOMAIN = 0x1024 SO_DONTROUTE = 0x10 SO_ERROR = 0x1007 SO_KEEPALIVE = 0x8 SO_LINGER = 0x80 SO_NETPROC = 0x1020 SO_OOBINLINE = 0x100 SO_PEERCRED = 0x1022 SO_PROTOCOL = 0x1025 SO_RCVBUF = 0x1002 SO_RCVLOWAT = 0x1004 SO_RCVTIMEO = 0x1006 SO_REUSEADDR = 0x4 SO_REUSEPORT = 0x200 SO_RTABLE = 0x1021 SO_SNDBUF = 0x1001 SO_SNDLOWAT = 0x1003 SO_SNDTIMEO = 0x1005 SO_SPLICE = 0x1023 SO_TIMESTAMP = 0x800 SO_TYPE = 0x1008 SO_USELOOPBACK = 0x40 SO_ZEROIZE = 0x2000 S_BLKSIZE = 0x200 S_IEXEC = 0x40 S_IFBLK = 0x6000 S_IFCHR = 0x2000 S_IFDIR = 0x4000 S_IFIFO = 0x1000 S_IFLNK = 0xa000 S_IFMT = 0xf000 S_IFREG = 0x8000 S_IFSOCK = 0xc000 S_IREAD = 0x100 S_IRGRP = 0x20 S_IROTH = 0x4 S_IRUSR = 0x100 S_IRWXG = 0x38 S_IRWXO = 0x7 S_IRWXU = 0x1c0 S_ISGID = 0x400 S_ISTXT = 0x200 S_ISUID = 0x800 S_ISVTX = 0x200 S_IWGRP = 0x10 S_IWOTH = 0x2 S_IWRITE = 0x80 S_IWUSR = 0x80 S_IXGRP = 0x8 S_IXOTH = 0x1 S_IXUSR = 0x40 TCIFLUSH = 0x1 TCIOFF = 0x3 TCIOFLUSH = 0x3 TCION = 0x4 TCOFLUSH = 0x2 TCOOFF = 0x1 TCOON = 0x2 TCPOPT_EOL = 0x0 TCPOPT_MAXSEG = 0x2 TCPOPT_NOP = 0x1 TCPOPT_SACK = 0x5 TCPOPT_SACK_HDR = 0x1010500 TCPOPT_SACK_PERMITTED = 0x4 TCPOPT_SACK_PERMIT_HDR = 0x1010402 TCPOPT_SIGNATURE = 0x13 TCPOPT_TIMESTAMP = 0x8 TCPOPT_TSTAMP_HDR = 0x101080a TCPOPT_WINDOW = 0x3 TCP_INFO = 0x9 TCP_MAXSEG = 0x2 TCP_MAXWIN = 0xffff TCP_MAX_SACK = 0x3 TCP_MAX_WINSHIFT = 0xe TCP_MD5SIG = 0x4 TCP_MSS = 0x200 TCP_NODELAY = 0x1 TCP_NOPUSH = 0x10 TCP_SACKHOLE_LIMIT = 0x80 TCP_SACK_ENABLE = 0x8 TCSAFLUSH = 0x2 TIMER_ABSTIME = 0x1 TIMER_RELTIME = 0x0 TIOCCBRK = 0x2000747a TIOCCDTR = 0x20007478 TIOCCHKVERAUTH = 0x2000741e TIOCCLRVERAUTH = 0x2000741d TIOCCONS = 0x80047462 TIOCDRAIN = 0x2000745e TIOCEXCL = 0x2000740d TIOCEXT = 0x80047460 TIOCFLAG_CLOCAL = 0x2 TIOCFLAG_CRTSCTS = 0x4 TIOCFLAG_MDMBUF = 0x8 TIOCFLAG_PPS = 0x10 TIOCFLAG_SOFTCAR = 0x1 TIOCFLUSH = 0x80047410 TIOCGETA = 0x402c7413 TIOCGETD = 0x4004741a TIOCGFLAGS = 0x4004745d TIOCGPGRP = 0x40047477 TIOCGSID = 0x40047463 TIOCGTSTAMP = 0x400c745b TIOCGWINSZ = 0x40087468 TIOCMBIC = 0x8004746b TIOCMBIS = 0x8004746c TIOCMGET = 0x4004746a TIOCMODG = 0x4004746a TIOCMODS = 0x8004746d TIOCMSET = 0x8004746d TIOCM_CAR = 0x40 TIOCM_CD = 0x40 TIOCM_CTS = 0x20 TIOCM_DSR = 0x100 TIOCM_DTR = 0x2 TIOCM_LE = 0x1 TIOCM_RI = 0x80 TIOCM_RNG = 0x80 TIOCM_RTS = 0x4 TIOCM_SR = 0x10 TIOCM_ST = 0x8 TIOCNOTTY = 0x20007471 TIOCNXCL = 0x2000740e TIOCOUTQ = 0x40047473 TIOCPKT = 0x80047470 TIOCPKT_DATA = 0x0 TIOCPKT_DOSTOP = 0x20 TIOCPKT_FLUSHREAD = 0x1 TIOCPKT_FLUSHWRITE = 0x2 TIOCPKT_IOCTL = 0x40 TIOCPKT_NOSTOP = 0x10 TIOCPKT_START = 0x8 TIOCPKT_STOP = 0x4 TIOCREMOTE = 0x80047469 TIOCSBRK = 0x2000747b TIOCSCTTY = 0x20007461 TIOCSDTR = 0x20007479 TIOCSETA = 0x802c7414 TIOCSETAF = 0x802c7416 TIOCSETAW = 0x802c7415 TIOCSETD = 0x8004741b TIOCSETVERAUTH = 0x8004741c TIOCSFLAGS = 0x8004745c TIOCSIG = 0x8004745f TIOCSPGRP = 0x80047476 TIOCSTART = 0x2000746e TIOCSTAT = 0x20007465 TIOCSTOP = 0x2000746f TIOCSTSTAMP = 0x8008745a TIOCSWINSZ = 0x80087467 TIOCUCNTL = 0x80047466 TIOCUCNTL_CBRK = 0x7a TIOCUCNTL_SBRK = 0x7b TOSTOP = 0x400000 UTIME_NOW = -0x2 UTIME_OMIT = -0x1 VDISCARD = 0xf VDSUSP = 0xb VEOF = 0x0 VEOL = 0x1 VEOL2 = 0x2 VERASE = 0x3 VINTR = 0x8 VKILL = 0x5 VLNEXT = 0xe VMIN = 0x10 VM_ANONMIN = 0x7 VM_LOADAVG = 0x2 VM_MALLOC_CONF = 0xc VM_MAXID = 0xd VM_MAXSLP = 0xa VM_METER = 0x1 VM_NKMEMPAGES = 0x6 VM_PSSTRINGS = 0x3 VM_SWAPENCRYPT = 0x5 VM_USPACE = 0xb VM_UVMEXP = 0x4 VM_VNODEMIN = 0x9 VM_VTEXTMIN = 0x8 VQUIT = 0x9 VREPRINT = 0x6 VSTART = 0xc VSTATUS = 0x12 VSTOP = 0xd VSUSP = 0xa VTIME = 0x11 VWERASE = 0x4 WALTSIG = 0x4 WCONTINUED = 0x8 WCOREFLAG = 0x80 WNOHANG = 0x1 WUNTRACED = 0x2 XCASE = 0x1000000 ) // Errors const ( E2BIG = syscall.Errno(0x7) EACCES = syscall.Errno(0xd) EADDRINUSE = syscall.Errno(0x30) EADDRNOTAVAIL = syscall.Errno(0x31) EAFNOSUPPORT = syscall.Errno(0x2f) EAGAIN = syscall.Errno(0x23) EALREADY = syscall.Errno(0x25) EAUTH = syscall.Errno(0x50) EBADF = syscall.Errno(0x9) EBADMSG = syscall.Errno(0x5c) EBADRPC = syscall.Errno(0x48) EBUSY = syscall.Errno(0x10) ECANCELED = syscall.Errno(0x58) ECHILD = syscall.Errno(0xa) ECONNABORTED = syscall.Errno(0x35) ECONNREFUSED = syscall.Errno(0x3d) ECONNRESET = syscall.Errno(0x36) EDEADLK = syscall.Errno(0xb) EDESTADDRREQ = syscall.Errno(0x27) EDOM = syscall.Errno(0x21) EDQUOT = syscall.Errno(0x45) EEXIST = syscall.Errno(0x11) EFAULT = syscall.Errno(0xe) EFBIG = syscall.Errno(0x1b) EFTYPE = syscall.Errno(0x4f) EHOSTDOWN = syscall.Errno(0x40) EHOSTUNREACH = syscall.Errno(0x41) EIDRM = syscall.Errno(0x59) EILSEQ = syscall.Errno(0x54) EINPROGRESS = syscall.Errno(0x24) EINTR = syscall.Errno(0x4) EINVAL = syscall.Errno(0x16) EIO = syscall.Errno(0x5) EIPSEC = syscall.Errno(0x52) EISCONN = syscall.Errno(0x38) EISDIR = syscall.Errno(0x15) ELAST = syscall.Errno(0x5f) ELOOP = syscall.Errno(0x3e) EMEDIUMTYPE = syscall.Errno(0x56) EMFILE = syscall.Errno(0x18) EMLINK = syscall.Errno(0x1f) EMSGSIZE = syscall.Errno(0x28) ENAMETOOLONG = syscall.Errno(0x3f) ENEEDAUTH = syscall.Errno(0x51) ENETDOWN = syscall.Errno(0x32) ENETRESET = syscall.Errno(0x34) ENETUNREACH = syscall.Errno(0x33) ENFILE = syscall.Errno(0x17) ENOATTR = syscall.Errno(0x53) ENOBUFS = syscall.Errno(0x37) ENODEV = syscall.Errno(0x13) ENOENT = syscall.Errno(0x2) ENOEXEC = syscall.Errno(0x8) ENOLCK = syscall.Errno(0x4d) ENOMEDIUM = syscall.Errno(0x55) ENOMEM = syscall.Errno(0xc) ENOMSG = syscall.Errno(0x5a) ENOPROTOOPT = syscall.Errno(0x2a) ENOSPC = syscall.Errno(0x1c) ENOSYS = syscall.Errno(0x4e) ENOTBLK = syscall.Errno(0xf) ENOTCONN = syscall.Errno(0x39) ENOTDIR = syscall.Errno(0x14) ENOTEMPTY = syscall.Errno(0x42) ENOTRECOVERABLE = syscall.Errno(0x5d) ENOTSOCK = syscall.Errno(0x26) ENOTSUP = syscall.Errno(0x5b) ENOTTY = syscall.Errno(0x19) ENXIO = syscall.Errno(0x6) EOPNOTSUPP = syscall.Errno(0x2d) EOVERFLOW = syscall.Errno(0x57) EOWNERDEAD = syscall.Errno(0x5e) EPERM = syscall.Errno(0x1) EPFNOSUPPORT = syscall.Errno(0x2e) EPIPE = syscall.Errno(0x20) EPROCLIM = syscall.Errno(0x43) EPROCUNAVAIL = syscall.Errno(0x4c) EPROGMISMATCH = syscall.Errno(0x4b) EPROGUNAVAIL = syscall.Errno(0x4a) EPROTO = syscall.Errno(0x5f) EPROTONOSUPPORT = syscall.Errno(0x2b) EPROTOTYPE = syscall.Errno(0x29) ERANGE = syscall.Errno(0x22) EREMOTE = syscall.Errno(0x47) EROFS = syscall.Errno(0x1e) ERPCMISMATCH = syscall.Errno(0x49) ESHUTDOWN = syscall.Errno(0x3a) ESOCKTNOSUPPORT = syscall.Errno(0x2c) ESPIPE = syscall.Errno(0x1d) ESRCH = syscall.Errno(0x3) ESTALE = syscall.Errno(0x46) ETIMEDOUT = syscall.Errno(0x3c) ETOOMANYREFS = syscall.Errno(0x3b) ETXTBSY = syscall.Errno(0x1a) EUSERS = syscall.Errno(0x44) EWOULDBLOCK = syscall.Errno(0x23) EXDEV = syscall.Errno(0x12) ) // Signals const ( SIGABRT = syscall.Signal(0x6) SIGALRM = syscall.Signal(0xe) SIGBUS = syscall.Signal(0xa) SIGCHLD = syscall.Signal(0x14) SIGCONT = syscall.Signal(0x13) SIGEMT = syscall.Signal(0x7) SIGFPE = syscall.Signal(0x8) SIGHUP = syscall.Signal(0x1) SIGILL = syscall.Signal(0x4) SIGINFO = syscall.Signal(0x1d) SIGINT = syscall.Signal(0x2) SIGIO = syscall.Signal(0x17) SIGIOT = syscall.Signal(0x6) SIGKILL = syscall.Signal(0x9) SIGPIPE = syscall.Signal(0xd) SIGPROF = syscall.Signal(0x1b) SIGQUIT = syscall.Signal(0x3) SIGSEGV = syscall.Signal(0xb) SIGSTOP = syscall.Signal(0x11) SIGSYS = syscall.Signal(0xc) SIGTERM = syscall.Signal(0xf) SIGTHR = syscall.Signal(0x20) SIGTRAP = syscall.Signal(0x5) SIGTSTP = syscall.Signal(0x12) SIGTTIN = syscall.Signal(0x15) SIGTTOU = syscall.Signal(0x16) SIGURG = syscall.Signal(0x10) SIGUSR1 = syscall.Signal(0x1e) SIGUSR2 = syscall.Signal(0x1f) SIGVTALRM = syscall.Signal(0x1a) SIGWINCH = syscall.Signal(0x1c) SIGXCPU = syscall.Signal(0x18) SIGXFSZ = syscall.Signal(0x19) ) // Error table var errorList = [...]struct { num syscall.Errno name string desc string }{ {1, "EPERM", "operation not permitted"}, {2, "ENOENT", "no such file or directory"}, {3, "ESRCH", "no such process"}, {4, "EINTR", "interrupted system call"}, {5, "EIO", "input/output error"}, {6, "ENXIO", "device not configured"}, {7, "E2BIG", "argument list too long"}, {8, "ENOEXEC", "exec format error"}, {9, "EBADF", "bad file descriptor"}, {10, "ECHILD", "no child processes"}, {11, "EDEADLK", "resource deadlock avoided"}, {12, "ENOMEM", "cannot allocate memory"}, {13, "EACCES", "permission denied"}, {14, "EFAULT", "bad address"}, {15, "ENOTBLK", "block device required"}, {16, "EBUSY", "device busy"}, {17, "EEXIST", "file exists"}, {18, "EXDEV", "cross-device link"}, {19, "ENODEV", "operation not supported by device"}, {20, "ENOTDIR", "not a directory"}, {21, "EISDIR", "is a directory"}, {22, "EINVAL", "invalid argument"}, {23, "ENFILE", "too many open files in system"}, {24, "EMFILE", "too many open files"}, {25, "ENOTTY", "inappropriate ioctl for device"}, {26, "ETXTBSY", "text file busy"}, {27, "EFBIG", "file too large"}, {28, "ENOSPC", "no space left on device"}, {29, "ESPIPE", "illegal seek"}, {30, "EROFS", "read-only file system"}, {31, "EMLINK", "too many links"}, {32, "EPIPE", "broken pipe"}, {33, "EDOM", "numerical argument out of domain"}, {34, "ERANGE", "result too large"}, {35, "EAGAIN", "resource temporarily unavailable"}, {36, "EINPROGRESS", "operation now in progress"}, {37, "EALREADY", "operation already in progress"}, {38, "ENOTSOCK", "socket operation on non-socket"}, {39, "EDESTADDRREQ", "destination address required"}, {40, "EMSGSIZE", "message too long"}, {41, "EPROTOTYPE", "protocol wrong type for socket"}, {42, "ENOPROTOOPT", "protocol not available"}, {43, "EPROTONOSUPPORT", "protocol not supported"}, {44, "ESOCKTNOSUPPORT", "socket type not supported"}, {45, "EOPNOTSUPP", "operation not supported"}, {46, "EPFNOSUPPORT", "protocol family not supported"}, {47, "EAFNOSUPPORT", "address family not supported by protocol family"}, {48, "EADDRINUSE", "address already in use"}, {49, "EADDRNOTAVAIL", "can't assign requested address"}, {50, "ENETDOWN", "network is down"}, {51, "ENETUNREACH", "network is unreachable"}, {52, "ENETRESET", "network dropped connection on reset"}, {53, "ECONNABORTED", "software caused connection abort"}, {54, "ECONNRESET", "connection reset by peer"}, {55, "ENOBUFS", "no buffer space available"}, {56, "EISCONN", "socket is already connected"}, {57, "ENOTCONN", "socket is not connected"}, {58, "ESHUTDOWN", "can't send after socket shutdown"}, {59, "ETOOMANYREFS", "too many references: can't splice"}, {60, "ETIMEDOUT", "operation timed out"}, {61, "ECONNREFUSED", "connection refused"}, {62, "ELOOP", "too many levels of symbolic links"}, {63, "ENAMETOOLONG", "file name too long"}, {64, "EHOSTDOWN", "host is down"}, {65, "EHOSTUNREACH", "no route to host"}, {66, "ENOTEMPTY", "directory not empty"}, {67, "EPROCLIM", "too many processes"}, {68, "EUSERS", "too many users"}, {69, "EDQUOT", "disk quota exceeded"}, {70, "ESTALE", "stale NFS file handle"}, {71, "EREMOTE", "too many levels of remote in path"}, {72, "EBADRPC", "RPC struct is bad"}, {73, "ERPCMISMATCH", "RPC version wrong"}, {74, "EPROGUNAVAIL", "RPC program not available"}, {75, "EPROGMISMATCH", "program version wrong"}, {76, "EPROCUNAVAIL", "bad procedure for program"}, {77, "ENOLCK", "no locks available"}, {78, "ENOSYS", "function not implemented"}, {79, "EFTYPE", "inappropriate file type or format"}, {80, "EAUTH", "authentication error"}, {81, "ENEEDAUTH", "need authenticator"}, {82, "EIPSEC", "IPsec processing failure"}, {83, "ENOATTR", "attribute not found"}, {84, "EILSEQ", "illegal byte sequence"}, {85, "ENOMEDIUM", "no medium found"}, {86, "EMEDIUMTYPE", "wrong medium type"}, {87, "EOVERFLOW", "value too large to be stored in data type"}, {88, "ECANCELED", "operation canceled"}, {89, "EIDRM", "identifier removed"}, {90, "ENOMSG", "no message of desired type"}, {91, "ENOTSUP", "not supported"}, {92, "EBADMSG", "bad message"}, {93, "ENOTRECOVERABLE", "state not recoverable"}, {94, "EOWNERDEAD", "previous owner died"}, {95, "ELAST", "protocol error"}, } // Signal table var signalList = [...]struct { num syscall.Signal name string desc string }{ {1, "SIGHUP", "hangup"}, {2, "SIGINT", "interrupt"}, {3, "SIGQUIT", "quit"}, {4, "SIGILL", "illegal instruction"}, {5, "SIGTRAP", "trace/BPT trap"}, {6, "SIGIOT", "abort trap"}, {7, "SIGEMT", "EMT trap"}, {8, "SIGFPE", "floating point exception"}, {9, "SIGKILL", "killed"}, {10, "SIGBUS", "bus error"}, {11, "SIGSEGV", "segmentation fault"}, {12, "SIGSYS", "bad system call"}, {13, "SIGPIPE", "broken pipe"}, {14, "SIGALRM", "alarm clock"}, {15, "SIGTERM", "terminated"}, {16, "SIGURG", "urgent I/O condition"}, {17, "SIGSTOP", "suspended (signal)"}, {18, "SIGTSTP", "suspended"}, {19, "SIGCONT", "continued"}, {20, "SIGCHLD", "child exited"}, {21, "SIGTTIN", "stopped (tty input)"}, {22, "SIGTTOU", "stopped (tty output)"}, {23, "SIGIO", "I/O possible"}, {24, "SIGXCPU", "cputime limit exceeded"}, {25, "SIGXFSZ", "filesize limit exceeded"}, {26, "SIGVTALRM", "virtual timer expired"}, {27, "SIGPROF", "profiling timer expired"}, {28, "SIGWINCH", "window size changes"}, {29, "SIGINFO", "information request"}, {30, "SIGUSR1", "user defined signal 1"}, {31, "SIGUSR2", "user defined signal 2"}, {32, "SIGTHR", "thread AST"}, {28672, "SIGSTKSZ", "unknown signal"}, } ================================================ FILE: vendor/golang.org/x/sys/unix/zerrors_openbsd_amd64.go ================================================ // mkerrors.sh -m64 // Code generated by the command above; see README.md. DO NOT EDIT. //go:build amd64 && openbsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -m64 _const.go package unix import "syscall" const ( AF_APPLETALK = 0x10 AF_BLUETOOTH = 0x20 AF_CCITT = 0xa AF_CHAOS = 0x5 AF_CNT = 0x15 AF_COIP = 0x14 AF_DATAKIT = 0x9 AF_DECnet = 0xc AF_DLI = 0xd AF_E164 = 0x1a AF_ECMA = 0x8 AF_ENCAP = 0x1c AF_HYLINK = 0xf AF_IMPLINK = 0x3 AF_INET = 0x2 AF_INET6 = 0x18 AF_IPX = 0x17 AF_ISDN = 0x1a AF_ISO = 0x7 AF_KEY = 0x1e AF_LAT = 0xe AF_LINK = 0x12 AF_LOCAL = 0x1 AF_MAX = 0x24 AF_MPLS = 0x21 AF_NATM = 0x1b AF_NS = 0x6 AF_OSI = 0x7 AF_PUP = 0x4 AF_ROUTE = 0x11 AF_SIP = 0x1d AF_SNA = 0xb AF_UNIX = 0x1 AF_UNSPEC = 0x0 ALTWERASE = 0x200 ARPHRD_ETHER = 0x1 ARPHRD_FRELAY = 0xf ARPHRD_IEEE1394 = 0x18 ARPHRD_IEEE802 = 0x6 B0 = 0x0 B110 = 0x6e B115200 = 0x1c200 B1200 = 0x4b0 B134 = 0x86 B14400 = 0x3840 B150 = 0x96 B1800 = 0x708 B19200 = 0x4b00 B200 = 0xc8 B230400 = 0x38400 B2400 = 0x960 B28800 = 0x7080 B300 = 0x12c B38400 = 0x9600 B4800 = 0x12c0 B50 = 0x32 B57600 = 0xe100 B600 = 0x258 B7200 = 0x1c20 B75 = 0x4b B76800 = 0x12c00 B9600 = 0x2580 BIOCFLUSH = 0x20004268 BIOCGBLEN = 0x40044266 BIOCGDIRFILT = 0x4004427c BIOCGDLT = 0x4004426a BIOCGDLTLIST = 0xc010427b BIOCGETIF = 0x4020426b BIOCGFILDROP = 0x40044278 BIOCGHDRCMPLT = 0x40044274 BIOCGRSIG = 0x40044273 BIOCGRTIMEOUT = 0x4010426e BIOCGSTATS = 0x4008426f BIOCIMMEDIATE = 0x80044270 BIOCLOCK = 0x20004276 BIOCPROMISC = 0x20004269 BIOCSBLEN = 0xc0044266 BIOCSDIRFILT = 0x8004427d BIOCSDLT = 0x8004427a BIOCSETF = 0x80104267 BIOCSETIF = 0x8020426c BIOCSETWF = 0x80104277 BIOCSFILDROP = 0x80044279 BIOCSHDRCMPLT = 0x80044275 BIOCSRSIG = 0x80044272 BIOCSRTIMEOUT = 0x8010426d BIOCVERSION = 0x40044271 BPF_A = 0x10 BPF_ABS = 0x20 BPF_ADD = 0x0 BPF_ALIGNMENT = 0x4 BPF_ALU = 0x4 BPF_AND = 0x50 BPF_B = 0x10 BPF_DIRECTION_IN = 0x1 BPF_DIRECTION_OUT = 0x2 BPF_DIV = 0x30 BPF_FILDROP_CAPTURE = 0x1 BPF_FILDROP_DROP = 0x2 BPF_FILDROP_PASS = 0x0 BPF_F_DIR_IN = 0x10 BPF_F_DIR_MASK = 0x30 BPF_F_DIR_OUT = 0x20 BPF_F_DIR_SHIFT = 0x4 BPF_F_FLOWID = 0x8 BPF_F_PRI_MASK = 0x7 BPF_H = 0x8 BPF_IMM = 0x0 BPF_IND = 0x40 BPF_JA = 0x0 BPF_JEQ = 0x10 BPF_JGE = 0x30 BPF_JGT = 0x20 BPF_JMP = 0x5 BPF_JSET = 0x40 BPF_K = 0x0 BPF_LD = 0x0 BPF_LDX = 0x1 BPF_LEN = 0x80 BPF_LSH = 0x60 BPF_MAJOR_VERSION = 0x1 BPF_MAXBUFSIZE = 0x200000 BPF_MAXINSNS = 0x200 BPF_MEM = 0x60 BPF_MEMWORDS = 0x10 BPF_MINBUFSIZE = 0x20 BPF_MINOR_VERSION = 0x1 BPF_MISC = 0x7 BPF_MSH = 0xa0 BPF_MUL = 0x20 BPF_NEG = 0x80 BPF_OR = 0x40 BPF_RELEASE = 0x30bb6 BPF_RET = 0x6 BPF_RND = 0xc0 BPF_RSH = 0x70 BPF_ST = 0x2 BPF_STX = 0x3 BPF_SUB = 0x10 BPF_TAX = 0x0 BPF_TXA = 0x80 BPF_W = 0x0 BPF_X = 0x8 BRKINT = 0x2 CFLUSH = 0xf CLOCAL = 0x8000 CLOCK_BOOTTIME = 0x6 CLOCK_MONOTONIC = 0x3 CLOCK_PROCESS_CPUTIME_ID = 0x2 CLOCK_REALTIME = 0x0 CLOCK_THREAD_CPUTIME_ID = 0x4 CLOCK_UPTIME = 0x5 CPUSTATES = 0x6 CP_IDLE = 0x5 CP_INTR = 0x4 CP_NICE = 0x1 CP_SPIN = 0x3 CP_SYS = 0x2 CP_USER = 0x0 CREAD = 0x800 CRTSCTS = 0x10000 CS5 = 0x0 CS6 = 0x100 CS7 = 0x200 CS8 = 0x300 CSIZE = 0x300 CSTART = 0x11 CSTATUS = 0xff CSTOP = 0x13 CSTOPB = 0x400 CSUSP = 0x1a CTL_HW = 0x6 CTL_KERN = 0x1 CTL_MAXNAME = 0xc CTL_NET = 0x4 DIOCADDQUEUE = 0xc110445d DIOCADDRULE = 0xcd604404 DIOCADDSTATE = 0xc1084425 DIOCCHANGERULE = 0xcd60441a DIOCCLRIFFLAG = 0xc028445a DIOCCLRSRCNODES = 0x20004455 DIOCCLRSTATES = 0xc0e04412 DIOCCLRSTATUS = 0xc0284416 DIOCGETLIMIT = 0xc0084427 DIOCGETQSTATS = 0xc1204460 DIOCGETQUEUE = 0xc110445f DIOCGETQUEUES = 0xc110445e DIOCGETRULE = 0xcd604407 DIOCGETRULES = 0xcd604406 DIOCGETRULESET = 0xc444443b DIOCGETRULESETS = 0xc444443a DIOCGETSRCNODES = 0xc0104454 DIOCGETSTATE = 0xc1084413 DIOCGETSTATES = 0xc0104419 DIOCGETSTATUS = 0xc1e84415 DIOCGETSYNFLWATS = 0xc0084463 DIOCGETTIMEOUT = 0xc008441e DIOCIGETIFACES = 0xc0284457 DIOCKILLSRCNODES = 0xc080445b DIOCKILLSTATES = 0xc0e04429 DIOCNATLOOK = 0xc0504417 DIOCOSFPADD = 0xc088444f DIOCOSFPFLUSH = 0x2000444e DIOCOSFPGET = 0xc0884450 DIOCRADDADDRS = 0xc4504443 DIOCRADDTABLES = 0xc450443d DIOCRCLRADDRS = 0xc4504442 DIOCRCLRASTATS = 0xc4504448 DIOCRCLRTABLES = 0xc450443c DIOCRCLRTSTATS = 0xc4504441 DIOCRDELADDRS = 0xc4504444 DIOCRDELTABLES = 0xc450443e DIOCRGETADDRS = 0xc4504446 DIOCRGETASTATS = 0xc4504447 DIOCRGETTABLES = 0xc450443f DIOCRGETTSTATS = 0xc4504440 DIOCRINADEFINE = 0xc450444d DIOCRSETADDRS = 0xc4504445 DIOCRSETTFLAGS = 0xc450444a DIOCRTSTADDRS = 0xc4504449 DIOCSETDEBUG = 0xc0044418 DIOCSETHOSTID = 0xc0044456 DIOCSETIFFLAG = 0xc0284459 DIOCSETLIMIT = 0xc0084428 DIOCSETREASS = 0xc004445c DIOCSETSTATUSIF = 0xc0284414 DIOCSETSYNCOOKIES = 0xc0014462 DIOCSETSYNFLWATS = 0xc0084461 DIOCSETTIMEOUT = 0xc008441d DIOCSTART = 0x20004401 DIOCSTOP = 0x20004402 DIOCXBEGIN = 0xc0104451 DIOCXCOMMIT = 0xc0104452 DIOCXROLLBACK = 0xc0104453 DLT_ARCNET = 0x7 DLT_ATM_RFC1483 = 0xb DLT_AX25 = 0x3 DLT_CHAOS = 0x5 DLT_C_HDLC = 0x68 DLT_EN10MB = 0x1 DLT_EN3MB = 0x2 DLT_ENC = 0xd DLT_FDDI = 0xa DLT_IEEE802 = 0x6 DLT_IEEE802_11 = 0x69 DLT_IEEE802_11_RADIO = 0x7f DLT_LOOP = 0xc DLT_MPLS = 0xdb DLT_NULL = 0x0 DLT_OPENFLOW = 0x10b DLT_PFLOG = 0x75 DLT_PFSYNC = 0x12 DLT_PPP = 0x9 DLT_PPP_BSDOS = 0x10 DLT_PPP_ETHER = 0x33 DLT_PPP_SERIAL = 0x32 DLT_PRONET = 0x4 DLT_RAW = 0xe DLT_SLIP = 0x8 DLT_SLIP_BSDOS = 0xf DLT_USBPCAP = 0xf9 DLT_USER0 = 0x93 DLT_USER1 = 0x94 DLT_USER10 = 0x9d DLT_USER11 = 0x9e DLT_USER12 = 0x9f DLT_USER13 = 0xa0 DLT_USER14 = 0xa1 DLT_USER15 = 0xa2 DLT_USER2 = 0x95 DLT_USER3 = 0x96 DLT_USER4 = 0x97 DLT_USER5 = 0x98 DLT_USER6 = 0x99 DLT_USER7 = 0x9a DLT_USER8 = 0x9b DLT_USER9 = 0x9c DT_BLK = 0x6 DT_CHR = 0x2 DT_DIR = 0x4 DT_FIFO = 0x1 DT_LNK = 0xa DT_REG = 0x8 DT_SOCK = 0xc DT_UNKNOWN = 0x0 ECHO = 0x8 ECHOCTL = 0x40 ECHOE = 0x2 ECHOK = 0x4 ECHOKE = 0x1 ECHONL = 0x10 ECHOPRT = 0x20 EMT_TAGOVF = 0x1 EMUL_ENABLED = 0x1 EMUL_NATIVE = 0x2 ENDRUNDISC = 0x9 ETH64_8021_RSVD_MASK = 0xfffffffffff0 ETH64_8021_RSVD_PREFIX = 0x180c2000000 ETHERMIN = 0x2e ETHERMTU = 0x5dc ETHERTYPE_8023 = 0x4 ETHERTYPE_AARP = 0x80f3 ETHERTYPE_ACCTON = 0x8390 ETHERTYPE_AEONIC = 0x8036 ETHERTYPE_ALPHA = 0x814a ETHERTYPE_AMBER = 0x6008 ETHERTYPE_AMOEBA = 0x8145 ETHERTYPE_AOE = 0x88a2 ETHERTYPE_APOLLO = 0x80f7 ETHERTYPE_APOLLODOMAIN = 0x8019 ETHERTYPE_APPLETALK = 0x809b ETHERTYPE_APPLITEK = 0x80c7 ETHERTYPE_ARGONAUT = 0x803a ETHERTYPE_ARP = 0x806 ETHERTYPE_AT = 0x809b ETHERTYPE_ATALK = 0x809b ETHERTYPE_ATOMIC = 0x86df ETHERTYPE_ATT = 0x8069 ETHERTYPE_ATTSTANFORD = 0x8008 ETHERTYPE_AUTOPHON = 0x806a ETHERTYPE_AXIS = 0x8856 ETHERTYPE_BCLOOP = 0x9003 ETHERTYPE_BOFL = 0x8102 ETHERTYPE_CABLETRON = 0x7034 ETHERTYPE_CHAOS = 0x804 ETHERTYPE_COMDESIGN = 0x806c ETHERTYPE_COMPUGRAPHIC = 0x806d ETHERTYPE_COUNTERPOINT = 0x8062 ETHERTYPE_CRONUS = 0x8004 ETHERTYPE_CRONUSVLN = 0x8003 ETHERTYPE_DCA = 0x1234 ETHERTYPE_DDE = 0x807b ETHERTYPE_DEBNI = 0xaaaa ETHERTYPE_DECAM = 0x8048 ETHERTYPE_DECCUST = 0x6006 ETHERTYPE_DECDIAG = 0x6005 ETHERTYPE_DECDNS = 0x803c ETHERTYPE_DECDTS = 0x803e ETHERTYPE_DECEXPER = 0x6000 ETHERTYPE_DECLAST = 0x8041 ETHERTYPE_DECLTM = 0x803f ETHERTYPE_DECMUMPS = 0x6009 ETHERTYPE_DECNETBIOS = 0x8040 ETHERTYPE_DELTACON = 0x86de ETHERTYPE_DIDDLE = 0x4321 ETHERTYPE_DLOG1 = 0x660 ETHERTYPE_DLOG2 = 0x661 ETHERTYPE_DN = 0x6003 ETHERTYPE_DOGFIGHT = 0x1989 ETHERTYPE_DSMD = 0x8039 ETHERTYPE_EAPOL = 0x888e ETHERTYPE_ECMA = 0x803 ETHERTYPE_ENCRYPT = 0x803d ETHERTYPE_ES = 0x805d ETHERTYPE_EXCELAN = 0x8010 ETHERTYPE_EXPERDATA = 0x8049 ETHERTYPE_FLIP = 0x8146 ETHERTYPE_FLOWCONTROL = 0x8808 ETHERTYPE_FRARP = 0x808 ETHERTYPE_GENDYN = 0x8068 ETHERTYPE_HAYES = 0x8130 ETHERTYPE_HIPPI_FP = 0x8180 ETHERTYPE_HITACHI = 0x8820 ETHERTYPE_HP = 0x8005 ETHERTYPE_IEEEPUP = 0xa00 ETHERTYPE_IEEEPUPAT = 0xa01 ETHERTYPE_IMLBL = 0x4c42 ETHERTYPE_IMLBLDIAG = 0x424c ETHERTYPE_IP = 0x800 ETHERTYPE_IPAS = 0x876c ETHERTYPE_IPV6 = 0x86dd ETHERTYPE_IPX = 0x8137 ETHERTYPE_IPXNEW = 0x8037 ETHERTYPE_KALPANA = 0x8582 ETHERTYPE_LANBRIDGE = 0x8038 ETHERTYPE_LANPROBE = 0x8888 ETHERTYPE_LAT = 0x6004 ETHERTYPE_LBACK = 0x9000 ETHERTYPE_LITTLE = 0x8060 ETHERTYPE_LLDP = 0x88cc ETHERTYPE_LOGICRAFT = 0x8148 ETHERTYPE_LOOPBACK = 0x9000 ETHERTYPE_MACSEC = 0x88e5 ETHERTYPE_MATRA = 0x807a ETHERTYPE_MAX = 0xffff ETHERTYPE_MERIT = 0x807c ETHERTYPE_MICP = 0x873a ETHERTYPE_MOPDL = 0x6001 ETHERTYPE_MOPRC = 0x6002 ETHERTYPE_MOTOROLA = 0x818d ETHERTYPE_MPLS = 0x8847 ETHERTYPE_MPLS_MCAST = 0x8848 ETHERTYPE_MUMPS = 0x813f ETHERTYPE_NBPCC = 0x3c04 ETHERTYPE_NBPCLAIM = 0x3c09 ETHERTYPE_NBPCLREQ = 0x3c05 ETHERTYPE_NBPCLRSP = 0x3c06 ETHERTYPE_NBPCREQ = 0x3c02 ETHERTYPE_NBPCRSP = 0x3c03 ETHERTYPE_NBPDG = 0x3c07 ETHERTYPE_NBPDGB = 0x3c08 ETHERTYPE_NBPDLTE = 0x3c0a ETHERTYPE_NBPRAR = 0x3c0c ETHERTYPE_NBPRAS = 0x3c0b ETHERTYPE_NBPRST = 0x3c0d ETHERTYPE_NBPSCD = 0x3c01 ETHERTYPE_NBPVCD = 0x3c00 ETHERTYPE_NBS = 0x802 ETHERTYPE_NCD = 0x8149 ETHERTYPE_NESTAR = 0x8006 ETHERTYPE_NETBEUI = 0x8191 ETHERTYPE_NHRP = 0x2001 ETHERTYPE_NOVELL = 0x8138 ETHERTYPE_NS = 0x600 ETHERTYPE_NSAT = 0x601 ETHERTYPE_NSCOMPAT = 0x807 ETHERTYPE_NSH = 0x984f ETHERTYPE_NTRAILER = 0x10 ETHERTYPE_OS9 = 0x7007 ETHERTYPE_OS9NET = 0x7009 ETHERTYPE_PACER = 0x80c6 ETHERTYPE_PBB = 0x88e7 ETHERTYPE_PCS = 0x4242 ETHERTYPE_PLANNING = 0x8044 ETHERTYPE_PPP = 0x880b ETHERTYPE_PPPOE = 0x8864 ETHERTYPE_PPPOEDISC = 0x8863 ETHERTYPE_PRIMENTS = 0x7031 ETHERTYPE_PUP = 0x200 ETHERTYPE_PUPAT = 0x200 ETHERTYPE_QINQ = 0x88a8 ETHERTYPE_RACAL = 0x7030 ETHERTYPE_RATIONAL = 0x8150 ETHERTYPE_RAWFR = 0x6559 ETHERTYPE_RCL = 0x1995 ETHERTYPE_RDP = 0x8739 ETHERTYPE_RETIX = 0x80f2 ETHERTYPE_REVARP = 0x8035 ETHERTYPE_SCA = 0x6007 ETHERTYPE_SECTRA = 0x86db ETHERTYPE_SECUREDATA = 0x876d ETHERTYPE_SGITW = 0x817e ETHERTYPE_SG_BOUNCE = 0x8016 ETHERTYPE_SG_DIAG = 0x8013 ETHERTYPE_SG_NETGAMES = 0x8014 ETHERTYPE_SG_RESV = 0x8015 ETHERTYPE_SIMNET = 0x5208 ETHERTYPE_SLOW = 0x8809 ETHERTYPE_SNA = 0x80d5 ETHERTYPE_SNMP = 0x814c ETHERTYPE_SONIX = 0xfaf5 ETHERTYPE_SPIDER = 0x809f ETHERTYPE_SPRITE = 0x500 ETHERTYPE_STP = 0x8181 ETHERTYPE_TALARIS = 0x812b ETHERTYPE_TALARISMC = 0x852b ETHERTYPE_TCPCOMP = 0x876b ETHERTYPE_TCPSM = 0x9002 ETHERTYPE_TEC = 0x814f ETHERTYPE_TIGAN = 0x802f ETHERTYPE_TRAIL = 0x1000 ETHERTYPE_TRANSETHER = 0x6558 ETHERTYPE_TYMSHARE = 0x802e ETHERTYPE_UBBST = 0x7005 ETHERTYPE_UBDEBUG = 0x900 ETHERTYPE_UBDIAGLOOP = 0x7002 ETHERTYPE_UBDL = 0x7000 ETHERTYPE_UBNIU = 0x7001 ETHERTYPE_UBNMC = 0x7003 ETHERTYPE_VALID = 0x1600 ETHERTYPE_VARIAN = 0x80dd ETHERTYPE_VAXELN = 0x803b ETHERTYPE_VEECO = 0x8067 ETHERTYPE_VEXP = 0x805b ETHERTYPE_VGLAB = 0x8131 ETHERTYPE_VINES = 0xbad ETHERTYPE_VINESECHO = 0xbaf ETHERTYPE_VINESLOOP = 0xbae ETHERTYPE_VITAL = 0xff00 ETHERTYPE_VLAN = 0x8100 ETHERTYPE_VLTLMAN = 0x8080 ETHERTYPE_VPROD = 0x805c ETHERTYPE_VURESERVED = 0x8147 ETHERTYPE_WATERLOO = 0x8130 ETHERTYPE_WELLFLEET = 0x8103 ETHERTYPE_X25 = 0x805 ETHERTYPE_X75 = 0x801 ETHERTYPE_XNSSM = 0x9001 ETHERTYPE_XTP = 0x817d ETHER_ADDR_LEN = 0x6 ETHER_ALIGN = 0x2 ETHER_CRC_LEN = 0x4 ETHER_CRC_POLY_BE = 0x4c11db6 ETHER_CRC_POLY_LE = 0xedb88320 ETHER_HDR_LEN = 0xe ETHER_MAX_DIX_LEN = 0x600 ETHER_MAX_HARDMTU_LEN = 0xff9b ETHER_MAX_LEN = 0x5ee ETHER_MIN_LEN = 0x40 ETHER_TYPE_LEN = 0x2 ETHER_VLAN_ENCAP_LEN = 0x4 EVFILT_AIO = -0x3 EVFILT_DEVICE = -0x8 EVFILT_EXCEPT = -0x9 EVFILT_PROC = -0x5 EVFILT_READ = -0x1 EVFILT_SIGNAL = -0x6 EVFILT_SYSCOUNT = 0x9 EVFILT_TIMER = -0x7 EVFILT_VNODE = -0x4 EVFILT_WRITE = -0x2 EVL_ENCAPLEN = 0x4 EVL_PRIO_BITS = 0xd EVL_PRIO_MAX = 0x7 EVL_VLID_MASK = 0xfff EVL_VLID_MAX = 0xffe EVL_VLID_MIN = 0x1 EVL_VLID_NULL = 0x0 EV_ADD = 0x1 EV_CLEAR = 0x20 EV_DELETE = 0x2 EV_DISABLE = 0x8 EV_DISPATCH = 0x80 EV_ENABLE = 0x4 EV_EOF = 0x8000 EV_ERROR = 0x4000 EV_FLAG1 = 0x2000 EV_ONESHOT = 0x10 EV_RECEIPT = 0x40 EV_SYSFLAGS = 0xf800 EXTA = 0x4b00 EXTB = 0x9600 EXTPROC = 0x800 FD_CLOEXEC = 0x1 FD_SETSIZE = 0x400 FLUSHO = 0x800000 F_DUPFD = 0x0 F_DUPFD_CLOEXEC = 0xa F_GETFD = 0x1 F_GETFL = 0x3 F_GETLK = 0x7 F_GETOWN = 0x5 F_ISATTY = 0xb F_OK = 0x0 F_RDLCK = 0x1 F_SETFD = 0x2 F_SETFL = 0x4 F_SETLK = 0x8 F_SETLKW = 0x9 F_SETOWN = 0x6 F_UNLCK = 0x2 F_WRLCK = 0x3 HUPCL = 0x4000 HW_MACHINE = 0x1 ICANON = 0x100 ICMP6_FILTER = 0x12 ICRNL = 0x100 IEXTEN = 0x400 IFAN_ARRIVAL = 0x0 IFAN_DEPARTURE = 0x1 IFF_ALLMULTI = 0x200 IFF_BROADCAST = 0x2 IFF_CANTCHANGE = 0x8e52 IFF_DEBUG = 0x4 IFF_LINK0 = 0x1000 IFF_LINK1 = 0x2000 IFF_LINK2 = 0x4000 IFF_LOOPBACK = 0x8 IFF_MULTICAST = 0x8000 IFF_NOARP = 0x80 IFF_OACTIVE = 0x400 IFF_POINTOPOINT = 0x10 IFF_PROMISC = 0x100 IFF_RUNNING = 0x40 IFF_SIMPLEX = 0x800 IFF_STATICARP = 0x20 IFF_UP = 0x1 IFNAMSIZ = 0x10 IFT_1822 = 0x2 IFT_A12MPPSWITCH = 0x82 IFT_AAL2 = 0xbb IFT_AAL5 = 0x31 IFT_ADSL = 0x5e IFT_AFLANE8023 = 0x3b IFT_AFLANE8025 = 0x3c IFT_ARAP = 0x58 IFT_ARCNET = 0x23 IFT_ARCNETPLUS = 0x24 IFT_ASYNC = 0x54 IFT_ATM = 0x25 IFT_ATMDXI = 0x69 IFT_ATMFUNI = 0x6a IFT_ATMIMA = 0x6b IFT_ATMLOGICAL = 0x50 IFT_ATMRADIO = 0xbd IFT_ATMSUBINTERFACE = 0x86 IFT_ATMVCIENDPT = 0xc2 IFT_ATMVIRTUAL = 0x95 IFT_BGPPOLICYACCOUNTING = 0xa2 IFT_BLUETOOTH = 0xf8 IFT_BRIDGE = 0xd1 IFT_BSC = 0x53 IFT_CARP = 0xf7 IFT_CCTEMUL = 0x3d IFT_CEPT = 0x13 IFT_CES = 0x85 IFT_CHANNEL = 0x46 IFT_CNR = 0x55 IFT_COFFEE = 0x84 IFT_COMPOSITELINK = 0x9b IFT_DCN = 0x8d IFT_DIGITALPOWERLINE = 0x8a IFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba IFT_DLSW = 0x4a IFT_DOCSCABLEDOWNSTREAM = 0x80 IFT_DOCSCABLEMACLAYER = 0x7f IFT_DOCSCABLEUPSTREAM = 0x81 IFT_DOCSCABLEUPSTREAMCHANNEL = 0xcd IFT_DS0 = 0x51 IFT_DS0BUNDLE = 0x52 IFT_DS1FDL = 0xaa IFT_DS3 = 0x1e IFT_DTM = 0x8c IFT_DUMMY = 0xf1 IFT_DVBASILN = 0xac IFT_DVBASIOUT = 0xad IFT_DVBRCCDOWNSTREAM = 0x93 IFT_DVBRCCMACLAYER = 0x92 IFT_DVBRCCUPSTREAM = 0x94 IFT_ECONET = 0xce IFT_ENC = 0xf4 IFT_EON = 0x19 IFT_EPLRS = 0x57 IFT_ESCON = 0x49 IFT_ETHER = 0x6 IFT_FAITH = 0xf3 IFT_FAST = 0x7d IFT_FASTETHER = 0x3e IFT_FASTETHERFX = 0x45 IFT_FDDI = 0xf IFT_FIBRECHANNEL = 0x38 IFT_FRAMERELAYINTERCONNECT = 0x3a IFT_FRAMERELAYMPI = 0x5c IFT_FRDLCIENDPT = 0xc1 IFT_FRELAY = 0x20 IFT_FRELAYDCE = 0x2c IFT_FRF16MFRBUNDLE = 0xa3 IFT_FRFORWARD = 0x9e IFT_G703AT2MB = 0x43 IFT_G703AT64K = 0x42 IFT_GIF = 0xf0 IFT_GIGABITETHERNET = 0x75 IFT_GR303IDT = 0xb2 IFT_GR303RDT = 0xb1 IFT_H323GATEKEEPER = 0xa4 IFT_H323PROXY = 0xa5 IFT_HDH1822 = 0x3 IFT_HDLC = 0x76 IFT_HDSL2 = 0xa8 IFT_HIPERLAN2 = 0xb7 IFT_HIPPI = 0x2f IFT_HIPPIINTERFACE = 0x39 IFT_HOSTPAD = 0x5a IFT_HSSI = 0x2e IFT_HY = 0xe IFT_IBM370PARCHAN = 0x48 IFT_IDSL = 0x9a IFT_IEEE1394 = 0x90 IFT_IEEE80211 = 0x47 IFT_IEEE80212 = 0x37 IFT_IEEE8023ADLAG = 0xa1 IFT_IFGSN = 0x91 IFT_IMT = 0xbe IFT_INFINIBAND = 0xc7 IFT_INTERLEAVE = 0x7c IFT_IP = 0x7e IFT_IPFORWARD = 0x8e IFT_IPOVERATM = 0x72 IFT_IPOVERCDLC = 0x6d IFT_IPOVERCLAW = 0x6e IFT_IPSWITCH = 0x4e IFT_ISDN = 0x3f IFT_ISDNBASIC = 0x14 IFT_ISDNPRIMARY = 0x15 IFT_ISDNS = 0x4b IFT_ISDNU = 0x4c IFT_ISO88022LLC = 0x29 IFT_ISO88023 = 0x7 IFT_ISO88024 = 0x8 IFT_ISO88025 = 0x9 IFT_ISO88025CRFPINT = 0x62 IFT_ISO88025DTR = 0x56 IFT_ISO88025FIBER = 0x73 IFT_ISO88026 = 0xa IFT_ISUP = 0xb3 IFT_L2VLAN = 0x87 IFT_L3IPVLAN = 0x88 IFT_L3IPXVLAN = 0x89 IFT_LAPB = 0x10 IFT_LAPD = 0x4d IFT_LAPF = 0x77 IFT_LINEGROUP = 0xd2 IFT_LOCALTALK = 0x2a IFT_LOOP = 0x18 IFT_MBIM = 0xfa IFT_MEDIAMAILOVERIP = 0x8b IFT_MFSIGLINK = 0xa7 IFT_MIOX25 = 0x26 IFT_MODEM = 0x30 IFT_MPC = 0x71 IFT_MPLS = 0xa6 IFT_MPLSTUNNEL = 0x96 IFT_MSDSL = 0x8f IFT_MVL = 0xbf IFT_MYRINET = 0x63 IFT_NFAS = 0xaf IFT_NSIP = 0x1b IFT_OPTICALCHANNEL = 0xc3 IFT_OPTICALTRANSPORT = 0xc4 IFT_OTHER = 0x1 IFT_P10 = 0xc IFT_P80 = 0xd IFT_PARA = 0x22 IFT_PFLOG = 0xf5 IFT_PFLOW = 0xf9 IFT_PFSYNC = 0xf6 IFT_PLC = 0xae IFT_PON155 = 0xcf IFT_PON622 = 0xd0 IFT_POS = 0xab IFT_PPP = 0x17 IFT_PPPMULTILINKBUNDLE = 0x6c IFT_PROPATM = 0xc5 IFT_PROPBWAP2MP = 0xb8 IFT_PROPCNLS = 0x59 IFT_PROPDOCSWIRELESSDOWNSTREAM = 0xb5 IFT_PROPDOCSWIRELESSMACLAYER = 0xb4 IFT_PROPDOCSWIRELESSUPSTREAM = 0xb6 IFT_PROPMUX = 0x36 IFT_PROPVIRTUAL = 0x35 IFT_PROPWIRELESSP2P = 0x9d IFT_PTPSERIAL = 0x16 IFT_PVC = 0xf2 IFT_Q2931 = 0xc9 IFT_QLLC = 0x44 IFT_RADIOMAC = 0xbc IFT_RADSL = 0x5f IFT_REACHDSL = 0xc0 IFT_RFC1483 = 0x9f IFT_RS232 = 0x21 IFT_RSRB = 0x4f IFT_SDLC = 0x11 IFT_SDSL = 0x60 IFT_SHDSL = 0xa9 IFT_SIP = 0x1f IFT_SIPSIG = 0xcc IFT_SIPTG = 0xcb IFT_SLIP = 0x1c IFT_SMDSDXI = 0x2b IFT_SMDSICIP = 0x34 IFT_SONET = 0x27 IFT_SONETOVERHEADCHANNEL = 0xb9 IFT_SONETPATH = 0x32 IFT_SONETVT = 0x33 IFT_SRP = 0x97 IFT_SS7SIGLINK = 0x9c IFT_STACKTOSTACK = 0x6f IFT_STARLAN = 0xb IFT_T1 = 0x12 IFT_TDLC = 0x74 IFT_TELINK = 0xc8 IFT_TERMPAD = 0x5b IFT_TR008 = 0xb0 IFT_TRANSPHDLC = 0x7b IFT_TUNNEL = 0x83 IFT_ULTRA = 0x1d IFT_USB = 0xa0 IFT_V11 = 0x40 IFT_V35 = 0x2d IFT_V36 = 0x41 IFT_V37 = 0x78 IFT_VDSL = 0x61 IFT_VIRTUALIPADDRESS = 0x70 IFT_VIRTUALTG = 0xca IFT_VOICEDID = 0xd5 IFT_VOICEEM = 0x64 IFT_VOICEEMFGD = 0xd3 IFT_VOICEENCAP = 0x67 IFT_VOICEFGDEANA = 0xd4 IFT_VOICEFXO = 0x65 IFT_VOICEFXS = 0x66 IFT_VOICEOVERATM = 0x98 IFT_VOICEOVERCABLE = 0xc6 IFT_VOICEOVERFRAMERELAY = 0x99 IFT_VOICEOVERIP = 0x68 IFT_WIREGUARD = 0xfb IFT_X213 = 0x5d IFT_X25 = 0x5 IFT_X25DDN = 0x4 IFT_X25HUNTGROUP = 0x7a IFT_X25MLP = 0x79 IFT_X25PLE = 0x28 IFT_XETHER = 0x1a IGNBRK = 0x1 IGNCR = 0x80 IGNPAR = 0x4 IMAXBEL = 0x2000 INLCR = 0x40 INPCK = 0x10 IN_CLASSA_HOST = 0xffffff IN_CLASSA_MAX = 0x80 IN_CLASSA_NET = 0xff000000 IN_CLASSA_NSHIFT = 0x18 IN_CLASSB_HOST = 0xffff IN_CLASSB_MAX = 0x10000 IN_CLASSB_NET = 0xffff0000 IN_CLASSB_NSHIFT = 0x10 IN_CLASSC_HOST = 0xff IN_CLASSC_NET = 0xffffff00 IN_CLASSC_NSHIFT = 0x8 IN_CLASSD_HOST = 0xfffffff IN_CLASSD_NET = 0xf0000000 IN_CLASSD_NSHIFT = 0x1c IN_LOOPBACKNET = 0x7f IN_RFC3021_HOST = 0x1 IN_RFC3021_NET = 0xfffffffe IN_RFC3021_NSHIFT = 0x1f IPPROTO_AH = 0x33 IPPROTO_CARP = 0x70 IPPROTO_DIVERT = 0x102 IPPROTO_DONE = 0x101 IPPROTO_DSTOPTS = 0x3c IPPROTO_EGP = 0x8 IPPROTO_ENCAP = 0x62 IPPROTO_EON = 0x50 IPPROTO_ESP = 0x32 IPPROTO_ETHERIP = 0x61 IPPROTO_FRAGMENT = 0x2c IPPROTO_GGP = 0x3 IPPROTO_GRE = 0x2f IPPROTO_HOPOPTS = 0x0 IPPROTO_ICMP = 0x1 IPPROTO_ICMPV6 = 0x3a IPPROTO_IDP = 0x16 IPPROTO_IGMP = 0x2 IPPROTO_IP = 0x0 IPPROTO_IPCOMP = 0x6c IPPROTO_IPIP = 0x4 IPPROTO_IPV4 = 0x4 IPPROTO_IPV6 = 0x29 IPPROTO_MAX = 0x100 IPPROTO_MAXID = 0x103 IPPROTO_MOBILE = 0x37 IPPROTO_MPLS = 0x89 IPPROTO_NONE = 0x3b IPPROTO_PFSYNC = 0xf0 IPPROTO_PIM = 0x67 IPPROTO_PUP = 0xc IPPROTO_RAW = 0xff IPPROTO_ROUTING = 0x2b IPPROTO_RSVP = 0x2e IPPROTO_SCTP = 0x84 IPPROTO_TCP = 0x6 IPPROTO_TP = 0x1d IPPROTO_UDP = 0x11 IPPROTO_UDPLITE = 0x88 IPV6_AUTH_LEVEL = 0x35 IPV6_AUTOFLOWLABEL = 0x3b IPV6_CHECKSUM = 0x1a IPV6_DEFAULT_MULTICAST_HOPS = 0x1 IPV6_DEFAULT_MULTICAST_LOOP = 0x1 IPV6_DEFHLIM = 0x40 IPV6_DONTFRAG = 0x3e IPV6_DSTOPTS = 0x32 IPV6_ESP_NETWORK_LEVEL = 0x37 IPV6_ESP_TRANS_LEVEL = 0x36 IPV6_FAITH = 0x1d IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_MASK = 0xffff0f00 IPV6_FRAGTTL = 0x78 IPV6_HLIMDEC = 0x1 IPV6_HOPLIMIT = 0x2f IPV6_HOPOPTS = 0x31 IPV6_IPCOMP_LEVEL = 0x3c IPV6_JOIN_GROUP = 0xc IPV6_LEAVE_GROUP = 0xd IPV6_MAXHLIM = 0xff IPV6_MAXPACKET = 0xffff IPV6_MINHOPCOUNT = 0x41 IPV6_MMTU = 0x500 IPV6_MULTICAST_HOPS = 0xa IPV6_MULTICAST_IF = 0x9 IPV6_MULTICAST_LOOP = 0xb IPV6_NEXTHOP = 0x30 IPV6_OPTIONS = 0x1 IPV6_PATHMTU = 0x2c IPV6_PIPEX = 0x3f IPV6_PKTINFO = 0x2e IPV6_PORTRANGE = 0xe IPV6_PORTRANGE_DEFAULT = 0x0 IPV6_PORTRANGE_HIGH = 0x1 IPV6_PORTRANGE_LOW = 0x2 IPV6_RECVDSTOPTS = 0x28 IPV6_RECVDSTPORT = 0x40 IPV6_RECVHOPLIMIT = 0x25 IPV6_RECVHOPOPTS = 0x27 IPV6_RECVPATHMTU = 0x2b IPV6_RECVPKTINFO = 0x24 IPV6_RECVRTHDR = 0x26 IPV6_RECVTCLASS = 0x39 IPV6_RTABLE = 0x1021 IPV6_RTHDR = 0x33 IPV6_RTHDRDSTOPTS = 0x23 IPV6_RTHDR_LOOSE = 0x0 IPV6_RTHDR_STRICT = 0x1 IPV6_RTHDR_TYPE_0 = 0x0 IPV6_SOCKOPT_RESERVED1 = 0x3 IPV6_TCLASS = 0x3d IPV6_UNICAST_HOPS = 0x4 IPV6_USE_MIN_MTU = 0x2a IPV6_V6ONLY = 0x1b IPV6_VERSION = 0x60 IPV6_VERSION_MASK = 0xf0 IP_ADD_MEMBERSHIP = 0xc IP_AUTH_LEVEL = 0x14 IP_DEFAULT_MULTICAST_LOOP = 0x1 IP_DEFAULT_MULTICAST_TTL = 0x1 IP_DF = 0x4000 IP_DROP_MEMBERSHIP = 0xd IP_ESP_NETWORK_LEVEL = 0x16 IP_ESP_TRANS_LEVEL = 0x15 IP_HDRINCL = 0x2 IP_IPCOMP_LEVEL = 0x1d IP_IPDEFTTL = 0x25 IP_IPSECFLOWINFO = 0x24 IP_IPSEC_LOCAL_AUTH = 0x1b IP_IPSEC_LOCAL_CRED = 0x19 IP_IPSEC_LOCAL_ID = 0x17 IP_IPSEC_REMOTE_AUTH = 0x1c IP_IPSEC_REMOTE_CRED = 0x1a IP_IPSEC_REMOTE_ID = 0x18 IP_MAXPACKET = 0xffff IP_MAX_MEMBERSHIPS = 0xfff IP_MF = 0x2000 IP_MINTTL = 0x20 IP_MIN_MEMBERSHIPS = 0xf IP_MSS = 0x240 IP_MULTICAST_IF = 0x9 IP_MULTICAST_LOOP = 0xb IP_MULTICAST_TTL = 0xa IP_OFFMASK = 0x1fff IP_OPTIONS = 0x1 IP_PIPEX = 0x22 IP_PORTRANGE = 0x13 IP_PORTRANGE_DEFAULT = 0x0 IP_PORTRANGE_HIGH = 0x1 IP_PORTRANGE_LOW = 0x2 IP_RECVDSTADDR = 0x7 IP_RECVDSTPORT = 0x21 IP_RECVIF = 0x1e IP_RECVOPTS = 0x5 IP_RECVRETOPTS = 0x6 IP_RECVRTABLE = 0x23 IP_RECVTTL = 0x1f IP_RETOPTS = 0x8 IP_RF = 0x8000 IP_RTABLE = 0x1021 IP_SENDSRCADDR = 0x7 IP_TOS = 0x3 IP_TTL = 0x4 ISIG = 0x80 ISTRIP = 0x20 ITIMER_PROF = 0x2 ITIMER_REAL = 0x0 ITIMER_VIRTUAL = 0x1 IUCLC = 0x1000 IXANY = 0x800 IXOFF = 0x400 IXON = 0x200 KERN_HOSTNAME = 0xa KERN_OSRELEASE = 0x2 KERN_OSTYPE = 0x1 KERN_VERSION = 0x4 LCNT_OVERLOAD_FLUSH = 0x6 LOCK_EX = 0x2 LOCK_NB = 0x4 LOCK_SH = 0x1 LOCK_UN = 0x8 MADV_DONTNEED = 0x4 MADV_FREE = 0x6 MADV_NORMAL = 0x0 MADV_RANDOM = 0x1 MADV_SEQUENTIAL = 0x2 MADV_SPACEAVAIL = 0x5 MADV_WILLNEED = 0x3 MAP_ANON = 0x1000 MAP_ANONYMOUS = 0x1000 MAP_CONCEAL = 0x8000 MAP_COPY = 0x2 MAP_FILE = 0x0 MAP_FIXED = 0x10 MAP_FLAGMASK = 0xfff7 MAP_HASSEMAPHORE = 0x0 MAP_INHERIT = 0x0 MAP_INHERIT_COPY = 0x1 MAP_INHERIT_NONE = 0x2 MAP_INHERIT_SHARE = 0x0 MAP_INHERIT_ZERO = 0x3 MAP_NOEXTEND = 0x0 MAP_NORESERVE = 0x0 MAP_PRIVATE = 0x2 MAP_RENAME = 0x0 MAP_SHARED = 0x1 MAP_STACK = 0x4000 MAP_TRYFIXED = 0x0 MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MNT_ASYNC = 0x40 MNT_DEFEXPORTED = 0x200 MNT_DELEXPORT = 0x20000 MNT_DOOMED = 0x8000000 MNT_EXPORTANON = 0x400 MNT_EXPORTED = 0x100 MNT_EXRDONLY = 0x80 MNT_FORCE = 0x80000 MNT_LAZY = 0x3 MNT_LOCAL = 0x1000 MNT_NOATIME = 0x8000 MNT_NODEV = 0x10 MNT_NOEXEC = 0x4 MNT_NOPERM = 0x20 MNT_NOSUID = 0x8 MNT_NOWAIT = 0x2 MNT_QUOTA = 0x2000 MNT_RDONLY = 0x1 MNT_RELOAD = 0x40000 MNT_ROOTFS = 0x4000 MNT_SOFTDEP = 0x4000000 MNT_STALLED = 0x100000 MNT_SWAPPABLE = 0x200000 MNT_SYNCHRONOUS = 0x2 MNT_UPDATE = 0x10000 MNT_VISFLAGMASK = 0x400ffff MNT_WAIT = 0x1 MNT_WANTRDWR = 0x2000000 MNT_WXALLOWED = 0x800 MOUNT_AFS = "afs" MOUNT_CD9660 = "cd9660" MOUNT_EXT2FS = "ext2fs" MOUNT_FFS = "ffs" MOUNT_FUSEFS = "fuse" MOUNT_MFS = "mfs" MOUNT_MSDOS = "msdos" MOUNT_NCPFS = "ncpfs" MOUNT_NFS = "nfs" MOUNT_NTFS = "ntfs" MOUNT_TMPFS = "tmpfs" MOUNT_UDF = "udf" MOUNT_UFS = "ffs" MSG_BCAST = 0x100 MSG_CMSG_CLOEXEC = 0x800 MSG_CTRUNC = 0x20 MSG_DONTROUTE = 0x4 MSG_DONTWAIT = 0x80 MSG_EOR = 0x8 MSG_MCAST = 0x200 MSG_NOSIGNAL = 0x400 MSG_OOB = 0x1 MSG_PEEK = 0x2 MSG_TRUNC = 0x10 MSG_WAITALL = 0x40 MSG_WAITFORONE = 0x1000 MS_ASYNC = 0x1 MS_INVALIDATE = 0x4 MS_SYNC = 0x2 NAME_MAX = 0xff NET_RT_DUMP = 0x1 NET_RT_FLAGS = 0x2 NET_RT_IFLIST = 0x3 NET_RT_IFNAMES = 0x6 NET_RT_MAXID = 0x8 NET_RT_SOURCE = 0x7 NET_RT_STATS = 0x4 NET_RT_TABLE = 0x5 NFDBITS = 0x20 NOFLSH = 0x80000000 NOKERNINFO = 0x2000000 NOTE_ATTRIB = 0x8 NOTE_CHANGE = 0x1 NOTE_CHILD = 0x4 NOTE_DELETE = 0x1 NOTE_EOF = 0x2 NOTE_EXEC = 0x20000000 NOTE_EXIT = 0x80000000 NOTE_EXTEND = 0x4 NOTE_FORK = 0x40000000 NOTE_LINK = 0x10 NOTE_LOWAT = 0x1 NOTE_OOB = 0x4 NOTE_PCTRLMASK = 0xf0000000 NOTE_PDATAMASK = 0xfffff NOTE_RENAME = 0x20 NOTE_REVOKE = 0x40 NOTE_TRACK = 0x1 NOTE_TRACKERR = 0x2 NOTE_TRUNCATE = 0x80 NOTE_WRITE = 0x2 OCRNL = 0x10 OLCUC = 0x20 ONLCR = 0x2 ONLRET = 0x80 ONOCR = 0x40 ONOEOT = 0x8 OPOST = 0x1 OXTABS = 0x4 O_ACCMODE = 0x3 O_APPEND = 0x8 O_ASYNC = 0x40 O_CLOEXEC = 0x10000 O_CREAT = 0x200 O_DIRECTORY = 0x20000 O_DSYNC = 0x80 O_EXCL = 0x800 O_EXLOCK = 0x20 O_FSYNC = 0x80 O_NDELAY = 0x4 O_NOCTTY = 0x8000 O_NOFOLLOW = 0x100 O_NONBLOCK = 0x4 O_RDONLY = 0x0 O_RDWR = 0x2 O_RSYNC = 0x80 O_SHLOCK = 0x10 O_SYNC = 0x80 O_TRUNC = 0x400 O_WRONLY = 0x1 PARENB = 0x1000 PARMRK = 0x8 PARODD = 0x2000 PENDIN = 0x20000000 PF_FLUSH = 0x1 PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 PROT_EXEC = 0x4 PROT_NONE = 0x0 PROT_READ = 0x1 PROT_WRITE = 0x2 RLIMIT_CORE = 0x4 RLIMIT_CPU = 0x0 RLIMIT_DATA = 0x2 RLIMIT_FSIZE = 0x1 RLIMIT_MEMLOCK = 0x6 RLIMIT_NOFILE = 0x8 RLIMIT_NPROC = 0x7 RLIMIT_RSS = 0x5 RLIMIT_STACK = 0x3 RLIM_INFINITY = 0x7fffffffffffffff RTAX_AUTHOR = 0x6 RTAX_BFD = 0xb RTAX_BRD = 0x7 RTAX_DNS = 0xc RTAX_DST = 0x0 RTAX_GATEWAY = 0x1 RTAX_GENMASK = 0x3 RTAX_IFA = 0x5 RTAX_IFP = 0x4 RTAX_LABEL = 0xa RTAX_MAX = 0xf RTAX_NETMASK = 0x2 RTAX_SEARCH = 0xe RTAX_SRC = 0x8 RTAX_SRCMASK = 0x9 RTAX_STATIC = 0xd RTA_AUTHOR = 0x40 RTA_BFD = 0x800 RTA_BRD = 0x80 RTA_DNS = 0x1000 RTA_DST = 0x1 RTA_GATEWAY = 0x2 RTA_GENMASK = 0x8 RTA_IFA = 0x20 RTA_IFP = 0x10 RTA_LABEL = 0x400 RTA_NETMASK = 0x4 RTA_SEARCH = 0x4000 RTA_SRC = 0x100 RTA_SRCMASK = 0x200 RTA_STATIC = 0x2000 RTF_ANNOUNCE = 0x4000 RTF_BFD = 0x1000000 RTF_BLACKHOLE = 0x1000 RTF_BROADCAST = 0x400000 RTF_CACHED = 0x20000 RTF_CLONED = 0x10000 RTF_CLONING = 0x100 RTF_CONNECTED = 0x800000 RTF_DONE = 0x40 RTF_DYNAMIC = 0x10 RTF_FMASK = 0x110fc08 RTF_GATEWAY = 0x2 RTF_HOST = 0x4 RTF_LLINFO = 0x400 RTF_LOCAL = 0x200000 RTF_MODIFIED = 0x20 RTF_MPATH = 0x40000 RTF_MPLS = 0x100000 RTF_MULTICAST = 0x200 RTF_PERMANENT_ARP = 0x2000 RTF_PROTO1 = 0x8000 RTF_PROTO2 = 0x4000 RTF_PROTO3 = 0x2000 RTF_REJECT = 0x8 RTF_STATIC = 0x800 RTF_UP = 0x1 RTF_USETRAILERS = 0x8000 RTM_80211INFO = 0x15 RTM_ADD = 0x1 RTM_BFD = 0x12 RTM_CHANGE = 0x3 RTM_CHGADDRATTR = 0x14 RTM_DELADDR = 0xd RTM_DELETE = 0x2 RTM_DESYNC = 0x10 RTM_GET = 0x4 RTM_IFANNOUNCE = 0xf RTM_IFINFO = 0xe RTM_INVALIDATE = 0x11 RTM_LOSING = 0x5 RTM_MAXSIZE = 0x800 RTM_MISS = 0x7 RTM_NEWADDR = 0xc RTM_PROPOSAL = 0x13 RTM_REDIRECT = 0x6 RTM_RESOLVE = 0xb RTM_SOURCE = 0x16 RTM_VERSION = 0x5 RTV_EXPIRE = 0x4 RTV_HOPCOUNT = 0x2 RTV_MTU = 0x1 RTV_RPIPE = 0x8 RTV_RTT = 0x40 RTV_RTTVAR = 0x80 RTV_SPIPE = 0x10 RTV_SSTHRESH = 0x20 RT_TABLEID_BITS = 0x8 RT_TABLEID_MASK = 0xff RT_TABLEID_MAX = 0xff RUSAGE_CHILDREN = -0x1 RUSAGE_SELF = 0x0 RUSAGE_THREAD = 0x1 SCM_RIGHTS = 0x1 SCM_TIMESTAMP = 0x4 SEEK_CUR = 0x1 SEEK_END = 0x2 SEEK_SET = 0x0 SHUT_RD = 0x0 SHUT_RDWR = 0x2 SHUT_WR = 0x1 SIOCADDMULTI = 0x80206931 SIOCAIFADDR = 0x8040691a SIOCAIFGROUP = 0x80286987 SIOCATMARK = 0x40047307 SIOCBRDGADD = 0x8060693c SIOCBRDGADDL = 0x80606949 SIOCBRDGADDS = 0x80606941 SIOCBRDGARL = 0x808c694d SIOCBRDGDADDR = 0x81286947 SIOCBRDGDEL = 0x8060693d SIOCBRDGDELS = 0x80606942 SIOCBRDGFLUSH = 0x80606948 SIOCBRDGFRL = 0x808c694e SIOCBRDGGCACHE = 0xc0146941 SIOCBRDGGFD = 0xc0146952 SIOCBRDGGHT = 0xc0146951 SIOCBRDGGIFFLGS = 0xc060693e SIOCBRDGGMA = 0xc0146953 SIOCBRDGGPARAM = 0xc0406958 SIOCBRDGGPRI = 0xc0146950 SIOCBRDGGRL = 0xc030694f SIOCBRDGGTO = 0xc0146946 SIOCBRDGIFS = 0xc0606942 SIOCBRDGRTS = 0xc0206943 SIOCBRDGSADDR = 0xc1286944 SIOCBRDGSCACHE = 0x80146940 SIOCBRDGSFD = 0x80146952 SIOCBRDGSHT = 0x80146951 SIOCBRDGSIFCOST = 0x80606955 SIOCBRDGSIFFLGS = 0x8060693f SIOCBRDGSIFPRIO = 0x80606954 SIOCBRDGSIFPROT = 0x8060694a SIOCBRDGSMA = 0x80146953 SIOCBRDGSPRI = 0x80146950 SIOCBRDGSPROTO = 0x8014695a SIOCBRDGSTO = 0x80146945 SIOCBRDGSTXHC = 0x80146959 SIOCDELLABEL = 0x80206997 SIOCDELMULTI = 0x80206932 SIOCDIFADDR = 0x80206919 SIOCDIFGROUP = 0x80286989 SIOCDIFPARENT = 0x802069b4 SIOCDIFPHYADDR = 0x80206949 SIOCDPWE3NEIGHBOR = 0x802069de SIOCDVNETID = 0x802069af SIOCGETKALIVE = 0xc01869a4 SIOCGETLABEL = 0x8020699a SIOCGETMPWCFG = 0xc02069ae SIOCGETPFLOW = 0xc02069fe SIOCGETPFSYNC = 0xc02069f8 SIOCGETSGCNT = 0xc0207534 SIOCGETVIFCNT = 0xc0287533 SIOCGETVLAN = 0xc0206990 SIOCGIFADDR = 0xc0206921 SIOCGIFBRDADDR = 0xc0206923 SIOCGIFCONF = 0xc0106924 SIOCGIFDATA = 0xc020691b SIOCGIFDESCR = 0xc0206981 SIOCGIFDSTADDR = 0xc0206922 SIOCGIFFLAGS = 0xc0206911 SIOCGIFGATTR = 0xc028698b SIOCGIFGENERIC = 0xc020693a SIOCGIFGLIST = 0xc028698d SIOCGIFGMEMB = 0xc028698a SIOCGIFGROUP = 0xc0286988 SIOCGIFHARDMTU = 0xc02069a5 SIOCGIFLLPRIO = 0xc02069b6 SIOCGIFMEDIA = 0xc0406938 SIOCGIFMETRIC = 0xc0206917 SIOCGIFMTU = 0xc020697e SIOCGIFNETMASK = 0xc0206925 SIOCGIFPAIR = 0xc02069b1 SIOCGIFPARENT = 0xc02069b3 SIOCGIFPRIORITY = 0xc020699c SIOCGIFRDOMAIN = 0xc02069a0 SIOCGIFRTLABEL = 0xc0206983 SIOCGIFRXR = 0x802069aa SIOCGIFSFFPAGE = 0xc1126939 SIOCGIFXFLAGS = 0xc020699e SIOCGLIFPHYADDR = 0xc218694b SIOCGLIFPHYDF = 0xc02069c2 SIOCGLIFPHYECN = 0xc02069c8 SIOCGLIFPHYRTABLE = 0xc02069a2 SIOCGLIFPHYTTL = 0xc02069a9 SIOCGPGRP = 0x40047309 SIOCGPWE3 = 0xc0206998 SIOCGPWE3CTRLWORD = 0xc02069dc SIOCGPWE3FAT = 0xc02069dd SIOCGPWE3NEIGHBOR = 0xc21869de SIOCGRXHPRIO = 0xc02069db SIOCGSPPPPARAMS = 0xc0206994 SIOCGTXHPRIO = 0xc02069c6 SIOCGUMBINFO = 0xc02069be SIOCGUMBPARAM = 0xc02069c0 SIOCGVH = 0xc02069f6 SIOCGVNETFLOWID = 0xc02069c4 SIOCGVNETID = 0xc02069a7 SIOCIFAFATTACH = 0x801169ab SIOCIFAFDETACH = 0x801169ac SIOCIFCREATE = 0x8020697a SIOCIFDESTROY = 0x80206979 SIOCIFGCLONERS = 0xc0106978 SIOCSETKALIVE = 0x801869a3 SIOCSETLABEL = 0x80206999 SIOCSETMPWCFG = 0x802069ad SIOCSETPFLOW = 0x802069fd SIOCSETPFSYNC = 0x802069f7 SIOCSETVLAN = 0x8020698f SIOCSIFADDR = 0x8020690c SIOCSIFBRDADDR = 0x80206913 SIOCSIFDESCR = 0x80206980 SIOCSIFDSTADDR = 0x8020690e SIOCSIFFLAGS = 0x80206910 SIOCSIFGATTR = 0x8028698c SIOCSIFGENERIC = 0x80206939 SIOCSIFLLADDR = 0x8020691f SIOCSIFLLPRIO = 0x802069b5 SIOCSIFMEDIA = 0xc0206937 SIOCSIFMETRIC = 0x80206918 SIOCSIFMTU = 0x8020697f SIOCSIFNETMASK = 0x80206916 SIOCSIFPAIR = 0x802069b0 SIOCSIFPARENT = 0x802069b2 SIOCSIFPRIORITY = 0x8020699b SIOCSIFRDOMAIN = 0x8020699f SIOCSIFRTLABEL = 0x80206982 SIOCSIFXFLAGS = 0x8020699d SIOCSLIFPHYADDR = 0x8218694a SIOCSLIFPHYDF = 0x802069c1 SIOCSLIFPHYECN = 0x802069c7 SIOCSLIFPHYRTABLE = 0x802069a1 SIOCSLIFPHYTTL = 0x802069a8 SIOCSPGRP = 0x80047308 SIOCSPWE3CTRLWORD = 0x802069dc SIOCSPWE3FAT = 0x802069dd SIOCSPWE3NEIGHBOR = 0x821869de SIOCSRXHPRIO = 0x802069db SIOCSSPPPPARAMS = 0x80206993 SIOCSTXHPRIO = 0x802069c5 SIOCSUMBPARAM = 0x802069bf SIOCSVH = 0xc02069f5 SIOCSVNETFLOWID = 0x802069c3 SIOCSVNETID = 0x802069a6 SOCK_CLOEXEC = 0x8000 SOCK_DGRAM = 0x2 SOCK_DNS = 0x1000 SOCK_NONBLOCK = 0x4000 SOCK_RAW = 0x3 SOCK_RDM = 0x4 SOCK_SEQPACKET = 0x5 SOCK_STREAM = 0x1 SOL_SOCKET = 0xffff SOMAXCONN = 0x80 SO_ACCEPTCONN = 0x2 SO_BINDANY = 0x1000 SO_BROADCAST = 0x20 SO_DEBUG = 0x1 SO_DOMAIN = 0x1024 SO_DONTROUTE = 0x10 SO_ERROR = 0x1007 SO_KEEPALIVE = 0x8 SO_LINGER = 0x80 SO_NETPROC = 0x1020 SO_OOBINLINE = 0x100 SO_PEERCRED = 0x1022 SO_PROTOCOL = 0x1025 SO_RCVBUF = 0x1002 SO_RCVLOWAT = 0x1004 SO_RCVTIMEO = 0x1006 SO_REUSEADDR = 0x4 SO_REUSEPORT = 0x200 SO_RTABLE = 0x1021 SO_SNDBUF = 0x1001 SO_SNDLOWAT = 0x1003 SO_SNDTIMEO = 0x1005 SO_SPLICE = 0x1023 SO_TIMESTAMP = 0x800 SO_TYPE = 0x1008 SO_USELOOPBACK = 0x40 SO_ZEROIZE = 0x2000 S_BLKSIZE = 0x200 S_IEXEC = 0x40 S_IFBLK = 0x6000 S_IFCHR = 0x2000 S_IFDIR = 0x4000 S_IFIFO = 0x1000 S_IFLNK = 0xa000 S_IFMT = 0xf000 S_IFREG = 0x8000 S_IFSOCK = 0xc000 S_IREAD = 0x100 S_IRGRP = 0x20 S_IROTH = 0x4 S_IRUSR = 0x100 S_IRWXG = 0x38 S_IRWXO = 0x7 S_IRWXU = 0x1c0 S_ISGID = 0x400 S_ISTXT = 0x200 S_ISUID = 0x800 S_ISVTX = 0x200 S_IWGRP = 0x10 S_IWOTH = 0x2 S_IWRITE = 0x80 S_IWUSR = 0x80 S_IXGRP = 0x8 S_IXOTH = 0x1 S_IXUSR = 0x40 TCIFLUSH = 0x1 TCIOFF = 0x3 TCIOFLUSH = 0x3 TCION = 0x4 TCOFLUSH = 0x2 TCOOFF = 0x1 TCOON = 0x2 TCPOPT_EOL = 0x0 TCPOPT_MAXSEG = 0x2 TCPOPT_NOP = 0x1 TCPOPT_SACK = 0x5 TCPOPT_SACK_HDR = 0x1010500 TCPOPT_SACK_PERMITTED = 0x4 TCPOPT_SACK_PERMIT_HDR = 0x1010402 TCPOPT_SIGNATURE = 0x13 TCPOPT_TIMESTAMP = 0x8 TCPOPT_TSTAMP_HDR = 0x101080a TCPOPT_WINDOW = 0x3 TCP_INFO = 0x9 TCP_MAXSEG = 0x2 TCP_MAXWIN = 0xffff TCP_MAX_SACK = 0x3 TCP_MAX_WINSHIFT = 0xe TCP_MD5SIG = 0x4 TCP_MSS = 0x200 TCP_NODELAY = 0x1 TCP_NOPUSH = 0x10 TCP_SACKHOLE_LIMIT = 0x80 TCP_SACK_ENABLE = 0x8 TCSAFLUSH = 0x2 TIMER_ABSTIME = 0x1 TIMER_RELTIME = 0x0 TIOCCBRK = 0x2000747a TIOCCDTR = 0x20007478 TIOCCHKVERAUTH = 0x2000741e TIOCCLRVERAUTH = 0x2000741d TIOCCONS = 0x80047462 TIOCDRAIN = 0x2000745e TIOCEXCL = 0x2000740d TIOCEXT = 0x80047460 TIOCFLAG_CLOCAL = 0x2 TIOCFLAG_CRTSCTS = 0x4 TIOCFLAG_MDMBUF = 0x8 TIOCFLAG_PPS = 0x10 TIOCFLAG_SOFTCAR = 0x1 TIOCFLUSH = 0x80047410 TIOCGETA = 0x402c7413 TIOCGETD = 0x4004741a TIOCGFLAGS = 0x4004745d TIOCGPGRP = 0x40047477 TIOCGSID = 0x40047463 TIOCGTSTAMP = 0x4010745b TIOCGWINSZ = 0x40087468 TIOCMBIC = 0x8004746b TIOCMBIS = 0x8004746c TIOCMGET = 0x4004746a TIOCMODG = 0x4004746a TIOCMODS = 0x8004746d TIOCMSET = 0x8004746d TIOCM_CAR = 0x40 TIOCM_CD = 0x40 TIOCM_CTS = 0x20 TIOCM_DSR = 0x100 TIOCM_DTR = 0x2 TIOCM_LE = 0x1 TIOCM_RI = 0x80 TIOCM_RNG = 0x80 TIOCM_RTS = 0x4 TIOCM_SR = 0x10 TIOCM_ST = 0x8 TIOCNOTTY = 0x20007471 TIOCNXCL = 0x2000740e TIOCOUTQ = 0x40047473 TIOCPKT = 0x80047470 TIOCPKT_DATA = 0x0 TIOCPKT_DOSTOP = 0x20 TIOCPKT_FLUSHREAD = 0x1 TIOCPKT_FLUSHWRITE = 0x2 TIOCPKT_IOCTL = 0x40 TIOCPKT_NOSTOP = 0x10 TIOCPKT_START = 0x8 TIOCPKT_STOP = 0x4 TIOCREMOTE = 0x80047469 TIOCSBRK = 0x2000747b TIOCSCTTY = 0x20007461 TIOCSDTR = 0x20007479 TIOCSETA = 0x802c7414 TIOCSETAF = 0x802c7416 TIOCSETAW = 0x802c7415 TIOCSETD = 0x8004741b TIOCSETVERAUTH = 0x8004741c TIOCSFLAGS = 0x8004745c TIOCSIG = 0x8004745f TIOCSPGRP = 0x80047476 TIOCSTART = 0x2000746e TIOCSTAT = 0x20007465 TIOCSTOP = 0x2000746f TIOCSTSTAMP = 0x8008745a TIOCSWINSZ = 0x80087467 TIOCUCNTL = 0x80047466 TIOCUCNTL_CBRK = 0x7a TIOCUCNTL_SBRK = 0x7b TOSTOP = 0x400000 UTIME_NOW = -0x2 UTIME_OMIT = -0x1 VDISCARD = 0xf VDSUSP = 0xb VEOF = 0x0 VEOL = 0x1 VEOL2 = 0x2 VERASE = 0x3 VINTR = 0x8 VKILL = 0x5 VLNEXT = 0xe VMIN = 0x10 VM_ANONMIN = 0x7 VM_LOADAVG = 0x2 VM_MALLOC_CONF = 0xc VM_MAXID = 0xd VM_MAXSLP = 0xa VM_METER = 0x1 VM_NKMEMPAGES = 0x6 VM_PSSTRINGS = 0x3 VM_SWAPENCRYPT = 0x5 VM_USPACE = 0xb VM_UVMEXP = 0x4 VM_VNODEMIN = 0x9 VM_VTEXTMIN = 0x8 VQUIT = 0x9 VREPRINT = 0x6 VSTART = 0xc VSTATUS = 0x12 VSTOP = 0xd VSUSP = 0xa VTIME = 0x11 VWERASE = 0x4 WALTSIG = 0x4 WCONTINUED = 0x8 WCOREFLAG = 0x80 WNOHANG = 0x1 WUNTRACED = 0x2 XCASE = 0x1000000 ) // Errors const ( E2BIG = syscall.Errno(0x7) EACCES = syscall.Errno(0xd) EADDRINUSE = syscall.Errno(0x30) EADDRNOTAVAIL = syscall.Errno(0x31) EAFNOSUPPORT = syscall.Errno(0x2f) EAGAIN = syscall.Errno(0x23) EALREADY = syscall.Errno(0x25) EAUTH = syscall.Errno(0x50) EBADF = syscall.Errno(0x9) EBADMSG = syscall.Errno(0x5c) EBADRPC = syscall.Errno(0x48) EBUSY = syscall.Errno(0x10) ECANCELED = syscall.Errno(0x58) ECHILD = syscall.Errno(0xa) ECONNABORTED = syscall.Errno(0x35) ECONNREFUSED = syscall.Errno(0x3d) ECONNRESET = syscall.Errno(0x36) EDEADLK = syscall.Errno(0xb) EDESTADDRREQ = syscall.Errno(0x27) EDOM = syscall.Errno(0x21) EDQUOT = syscall.Errno(0x45) EEXIST = syscall.Errno(0x11) EFAULT = syscall.Errno(0xe) EFBIG = syscall.Errno(0x1b) EFTYPE = syscall.Errno(0x4f) EHOSTDOWN = syscall.Errno(0x40) EHOSTUNREACH = syscall.Errno(0x41) EIDRM = syscall.Errno(0x59) EILSEQ = syscall.Errno(0x54) EINPROGRESS = syscall.Errno(0x24) EINTR = syscall.Errno(0x4) EINVAL = syscall.Errno(0x16) EIO = syscall.Errno(0x5) EIPSEC = syscall.Errno(0x52) EISCONN = syscall.Errno(0x38) EISDIR = syscall.Errno(0x15) ELAST = syscall.Errno(0x5f) ELOOP = syscall.Errno(0x3e) EMEDIUMTYPE = syscall.Errno(0x56) EMFILE = syscall.Errno(0x18) EMLINK = syscall.Errno(0x1f) EMSGSIZE = syscall.Errno(0x28) ENAMETOOLONG = syscall.Errno(0x3f) ENEEDAUTH = syscall.Errno(0x51) ENETDOWN = syscall.Errno(0x32) ENETRESET = syscall.Errno(0x34) ENETUNREACH = syscall.Errno(0x33) ENFILE = syscall.Errno(0x17) ENOATTR = syscall.Errno(0x53) ENOBUFS = syscall.Errno(0x37) ENODEV = syscall.Errno(0x13) ENOENT = syscall.Errno(0x2) ENOEXEC = syscall.Errno(0x8) ENOLCK = syscall.Errno(0x4d) ENOMEDIUM = syscall.Errno(0x55) ENOMEM = syscall.Errno(0xc) ENOMSG = syscall.Errno(0x5a) ENOPROTOOPT = syscall.Errno(0x2a) ENOSPC = syscall.Errno(0x1c) ENOSYS = syscall.Errno(0x4e) ENOTBLK = syscall.Errno(0xf) ENOTCONN = syscall.Errno(0x39) ENOTDIR = syscall.Errno(0x14) ENOTEMPTY = syscall.Errno(0x42) ENOTRECOVERABLE = syscall.Errno(0x5d) ENOTSOCK = syscall.Errno(0x26) ENOTSUP = syscall.Errno(0x5b) ENOTTY = syscall.Errno(0x19) ENXIO = syscall.Errno(0x6) EOPNOTSUPP = syscall.Errno(0x2d) EOVERFLOW = syscall.Errno(0x57) EOWNERDEAD = syscall.Errno(0x5e) EPERM = syscall.Errno(0x1) EPFNOSUPPORT = syscall.Errno(0x2e) EPIPE = syscall.Errno(0x20) EPROCLIM = syscall.Errno(0x43) EPROCUNAVAIL = syscall.Errno(0x4c) EPROGMISMATCH = syscall.Errno(0x4b) EPROGUNAVAIL = syscall.Errno(0x4a) EPROTO = syscall.Errno(0x5f) EPROTONOSUPPORT = syscall.Errno(0x2b) EPROTOTYPE = syscall.Errno(0x29) ERANGE = syscall.Errno(0x22) EREMOTE = syscall.Errno(0x47) EROFS = syscall.Errno(0x1e) ERPCMISMATCH = syscall.Errno(0x49) ESHUTDOWN = syscall.Errno(0x3a) ESOCKTNOSUPPORT = syscall.Errno(0x2c) ESPIPE = syscall.Errno(0x1d) ESRCH = syscall.Errno(0x3) ESTALE = syscall.Errno(0x46) ETIMEDOUT = syscall.Errno(0x3c) ETOOMANYREFS = syscall.Errno(0x3b) ETXTBSY = syscall.Errno(0x1a) EUSERS = syscall.Errno(0x44) EWOULDBLOCK = syscall.Errno(0x23) EXDEV = syscall.Errno(0x12) ) // Signals const ( SIGABRT = syscall.Signal(0x6) SIGALRM = syscall.Signal(0xe) SIGBUS = syscall.Signal(0xa) SIGCHLD = syscall.Signal(0x14) SIGCONT = syscall.Signal(0x13) SIGEMT = syscall.Signal(0x7) SIGFPE = syscall.Signal(0x8) SIGHUP = syscall.Signal(0x1) SIGILL = syscall.Signal(0x4) SIGINFO = syscall.Signal(0x1d) SIGINT = syscall.Signal(0x2) SIGIO = syscall.Signal(0x17) SIGIOT = syscall.Signal(0x6) SIGKILL = syscall.Signal(0x9) SIGPIPE = syscall.Signal(0xd) SIGPROF = syscall.Signal(0x1b) SIGQUIT = syscall.Signal(0x3) SIGSEGV = syscall.Signal(0xb) SIGSTOP = syscall.Signal(0x11) SIGSYS = syscall.Signal(0xc) SIGTERM = syscall.Signal(0xf) SIGTHR = syscall.Signal(0x20) SIGTRAP = syscall.Signal(0x5) SIGTSTP = syscall.Signal(0x12) SIGTTIN = syscall.Signal(0x15) SIGTTOU = syscall.Signal(0x16) SIGURG = syscall.Signal(0x10) SIGUSR1 = syscall.Signal(0x1e) SIGUSR2 = syscall.Signal(0x1f) SIGVTALRM = syscall.Signal(0x1a) SIGWINCH = syscall.Signal(0x1c) SIGXCPU = syscall.Signal(0x18) SIGXFSZ = syscall.Signal(0x19) ) // Error table var errorList = [...]struct { num syscall.Errno name string desc string }{ {1, "EPERM", "operation not permitted"}, {2, "ENOENT", "no such file or directory"}, {3, "ESRCH", "no such process"}, {4, "EINTR", "interrupted system call"}, {5, "EIO", "input/output error"}, {6, "ENXIO", "device not configured"}, {7, "E2BIG", "argument list too long"}, {8, "ENOEXEC", "exec format error"}, {9, "EBADF", "bad file descriptor"}, {10, "ECHILD", "no child processes"}, {11, "EDEADLK", "resource deadlock avoided"}, {12, "ENOMEM", "cannot allocate memory"}, {13, "EACCES", "permission denied"}, {14, "EFAULT", "bad address"}, {15, "ENOTBLK", "block device required"}, {16, "EBUSY", "device busy"}, {17, "EEXIST", "file exists"}, {18, "EXDEV", "cross-device link"}, {19, "ENODEV", "operation not supported by device"}, {20, "ENOTDIR", "not a directory"}, {21, "EISDIR", "is a directory"}, {22, "EINVAL", "invalid argument"}, {23, "ENFILE", "too many open files in system"}, {24, "EMFILE", "too many open files"}, {25, "ENOTTY", "inappropriate ioctl for device"}, {26, "ETXTBSY", "text file busy"}, {27, "EFBIG", "file too large"}, {28, "ENOSPC", "no space left on device"}, {29, "ESPIPE", "illegal seek"}, {30, "EROFS", "read-only file system"}, {31, "EMLINK", "too many links"}, {32, "EPIPE", "broken pipe"}, {33, "EDOM", "numerical argument out of domain"}, {34, "ERANGE", "result too large"}, {35, "EAGAIN", "resource temporarily unavailable"}, {36, "EINPROGRESS", "operation now in progress"}, {37, "EALREADY", "operation already in progress"}, {38, "ENOTSOCK", "socket operation on non-socket"}, {39, "EDESTADDRREQ", "destination address required"}, {40, "EMSGSIZE", "message too long"}, {41, "EPROTOTYPE", "protocol wrong type for socket"}, {42, "ENOPROTOOPT", "protocol not available"}, {43, "EPROTONOSUPPORT", "protocol not supported"}, {44, "ESOCKTNOSUPPORT", "socket type not supported"}, {45, "EOPNOTSUPP", "operation not supported"}, {46, "EPFNOSUPPORT", "protocol family not supported"}, {47, "EAFNOSUPPORT", "address family not supported by protocol family"}, {48, "EADDRINUSE", "address already in use"}, {49, "EADDRNOTAVAIL", "can't assign requested address"}, {50, "ENETDOWN", "network is down"}, {51, "ENETUNREACH", "network is unreachable"}, {52, "ENETRESET", "network dropped connection on reset"}, {53, "ECONNABORTED", "software caused connection abort"}, {54, "ECONNRESET", "connection reset by peer"}, {55, "ENOBUFS", "no buffer space available"}, {56, "EISCONN", "socket is already connected"}, {57, "ENOTCONN", "socket is not connected"}, {58, "ESHUTDOWN", "can't send after socket shutdown"}, {59, "ETOOMANYREFS", "too many references: can't splice"}, {60, "ETIMEDOUT", "operation timed out"}, {61, "ECONNREFUSED", "connection refused"}, {62, "ELOOP", "too many levels of symbolic links"}, {63, "ENAMETOOLONG", "file name too long"}, {64, "EHOSTDOWN", "host is down"}, {65, "EHOSTUNREACH", "no route to host"}, {66, "ENOTEMPTY", "directory not empty"}, {67, "EPROCLIM", "too many processes"}, {68, "EUSERS", "too many users"}, {69, "EDQUOT", "disk quota exceeded"}, {70, "ESTALE", "stale NFS file handle"}, {71, "EREMOTE", "too many levels of remote in path"}, {72, "EBADRPC", "RPC struct is bad"}, {73, "ERPCMISMATCH", "RPC version wrong"}, {74, "EPROGUNAVAIL", "RPC program not available"}, {75, "EPROGMISMATCH", "program version wrong"}, {76, "EPROCUNAVAIL", "bad procedure for program"}, {77, "ENOLCK", "no locks available"}, {78, "ENOSYS", "function not implemented"}, {79, "EFTYPE", "inappropriate file type or format"}, {80, "EAUTH", "authentication error"}, {81, "ENEEDAUTH", "need authenticator"}, {82, "EIPSEC", "IPsec processing failure"}, {83, "ENOATTR", "attribute not found"}, {84, "EILSEQ", "illegal byte sequence"}, {85, "ENOMEDIUM", "no medium found"}, {86, "EMEDIUMTYPE", "wrong medium type"}, {87, "EOVERFLOW", "value too large to be stored in data type"}, {88, "ECANCELED", "operation canceled"}, {89, "EIDRM", "identifier removed"}, {90, "ENOMSG", "no message of desired type"}, {91, "ENOTSUP", "not supported"}, {92, "EBADMSG", "bad message"}, {93, "ENOTRECOVERABLE", "state not recoverable"}, {94, "EOWNERDEAD", "previous owner died"}, {95, "ELAST", "protocol error"}, } // Signal table var signalList = [...]struct { num syscall.Signal name string desc string }{ {1, "SIGHUP", "hangup"}, {2, "SIGINT", "interrupt"}, {3, "SIGQUIT", "quit"}, {4, "SIGILL", "illegal instruction"}, {5, "SIGTRAP", "trace/BPT trap"}, {6, "SIGIOT", "abort trap"}, {7, "SIGEMT", "EMT trap"}, {8, "SIGFPE", "floating point exception"}, {9, "SIGKILL", "killed"}, {10, "SIGBUS", "bus error"}, {11, "SIGSEGV", "segmentation fault"}, {12, "SIGSYS", "bad system call"}, {13, "SIGPIPE", "broken pipe"}, {14, "SIGALRM", "alarm clock"}, {15, "SIGTERM", "terminated"}, {16, "SIGURG", "urgent I/O condition"}, {17, "SIGSTOP", "suspended (signal)"}, {18, "SIGTSTP", "suspended"}, {19, "SIGCONT", "continued"}, {20, "SIGCHLD", "child exited"}, {21, "SIGTTIN", "stopped (tty input)"}, {22, "SIGTTOU", "stopped (tty output)"}, {23, "SIGIO", "I/O possible"}, {24, "SIGXCPU", "cputime limit exceeded"}, {25, "SIGXFSZ", "filesize limit exceeded"}, {26, "SIGVTALRM", "virtual timer expired"}, {27, "SIGPROF", "profiling timer expired"}, {28, "SIGWINCH", "window size changes"}, {29, "SIGINFO", "information request"}, {30, "SIGUSR1", "user defined signal 1"}, {31, "SIGUSR2", "user defined signal 2"}, {32, "SIGTHR", "thread AST"}, {28672, "SIGSTKSZ", "unknown signal"}, } ================================================ FILE: vendor/golang.org/x/sys/unix/zerrors_openbsd_arm.go ================================================ // mkerrors.sh // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm && openbsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- _const.go package unix import "syscall" const ( AF_APPLETALK = 0x10 AF_BLUETOOTH = 0x20 AF_CCITT = 0xa AF_CHAOS = 0x5 AF_CNT = 0x15 AF_COIP = 0x14 AF_DATAKIT = 0x9 AF_DECnet = 0xc AF_DLI = 0xd AF_E164 = 0x1a AF_ECMA = 0x8 AF_ENCAP = 0x1c AF_HYLINK = 0xf AF_IMPLINK = 0x3 AF_INET = 0x2 AF_INET6 = 0x18 AF_IPX = 0x17 AF_ISDN = 0x1a AF_ISO = 0x7 AF_KEY = 0x1e AF_LAT = 0xe AF_LINK = 0x12 AF_LOCAL = 0x1 AF_MAX = 0x24 AF_MPLS = 0x21 AF_NATM = 0x1b AF_NS = 0x6 AF_OSI = 0x7 AF_PUP = 0x4 AF_ROUTE = 0x11 AF_SIP = 0x1d AF_SNA = 0xb AF_UNIX = 0x1 AF_UNSPEC = 0x0 ALTWERASE = 0x200 ARPHRD_ETHER = 0x1 ARPHRD_FRELAY = 0xf ARPHRD_IEEE1394 = 0x18 ARPHRD_IEEE802 = 0x6 B0 = 0x0 B110 = 0x6e B115200 = 0x1c200 B1200 = 0x4b0 B134 = 0x86 B14400 = 0x3840 B150 = 0x96 B1800 = 0x708 B19200 = 0x4b00 B200 = 0xc8 B230400 = 0x38400 B2400 = 0x960 B28800 = 0x7080 B300 = 0x12c B38400 = 0x9600 B4800 = 0x12c0 B50 = 0x32 B57600 = 0xe100 B600 = 0x258 B7200 = 0x1c20 B75 = 0x4b B76800 = 0x12c00 B9600 = 0x2580 BIOCFLUSH = 0x20004268 BIOCGBLEN = 0x40044266 BIOCGDIRFILT = 0x4004427c BIOCGDLT = 0x4004426a BIOCGDLTLIST = 0xc008427b BIOCGETIF = 0x4020426b BIOCGFILDROP = 0x40044278 BIOCGHDRCMPLT = 0x40044274 BIOCGRSIG = 0x40044273 BIOCGRTIMEOUT = 0x4010426e BIOCGSTATS = 0x4008426f BIOCIMMEDIATE = 0x80044270 BIOCLOCK = 0x20004276 BIOCPROMISC = 0x20004269 BIOCSBLEN = 0xc0044266 BIOCSDIRFILT = 0x8004427d BIOCSDLT = 0x8004427a BIOCSETF = 0x80084267 BIOCSETIF = 0x8020426c BIOCSETWF = 0x80084277 BIOCSFILDROP = 0x80044279 BIOCSHDRCMPLT = 0x80044275 BIOCSRSIG = 0x80044272 BIOCSRTIMEOUT = 0x8010426d BIOCVERSION = 0x40044271 BPF_A = 0x10 BPF_ABS = 0x20 BPF_ADD = 0x0 BPF_ALIGNMENT = 0x4 BPF_ALU = 0x4 BPF_AND = 0x50 BPF_B = 0x10 BPF_DIRECTION_IN = 0x1 BPF_DIRECTION_OUT = 0x2 BPF_DIV = 0x30 BPF_FILDROP_CAPTURE = 0x1 BPF_FILDROP_DROP = 0x2 BPF_FILDROP_PASS = 0x0 BPF_F_DIR_IN = 0x10 BPF_F_DIR_MASK = 0x30 BPF_F_DIR_OUT = 0x20 BPF_F_DIR_SHIFT = 0x4 BPF_F_FLOWID = 0x8 BPF_F_PRI_MASK = 0x7 BPF_H = 0x8 BPF_IMM = 0x0 BPF_IND = 0x40 BPF_JA = 0x0 BPF_JEQ = 0x10 BPF_JGE = 0x30 BPF_JGT = 0x20 BPF_JMP = 0x5 BPF_JSET = 0x40 BPF_K = 0x0 BPF_LD = 0x0 BPF_LDX = 0x1 BPF_LEN = 0x80 BPF_LSH = 0x60 BPF_MAJOR_VERSION = 0x1 BPF_MAXBUFSIZE = 0x200000 BPF_MAXINSNS = 0x200 BPF_MEM = 0x60 BPF_MEMWORDS = 0x10 BPF_MINBUFSIZE = 0x20 BPF_MINOR_VERSION = 0x1 BPF_MISC = 0x7 BPF_MSH = 0xa0 BPF_MUL = 0x20 BPF_NEG = 0x80 BPF_OR = 0x40 BPF_RELEASE = 0x30bb6 BPF_RET = 0x6 BPF_RND = 0xc0 BPF_RSH = 0x70 BPF_ST = 0x2 BPF_STX = 0x3 BPF_SUB = 0x10 BPF_TAX = 0x0 BPF_TXA = 0x80 BPF_W = 0x0 BPF_X = 0x8 BRKINT = 0x2 CFLUSH = 0xf CLOCAL = 0x8000 CLOCK_BOOTTIME = 0x6 CLOCK_MONOTONIC = 0x3 CLOCK_PROCESS_CPUTIME_ID = 0x2 CLOCK_REALTIME = 0x0 CLOCK_THREAD_CPUTIME_ID = 0x4 CLOCK_UPTIME = 0x5 CPUSTATES = 0x6 CP_IDLE = 0x5 CP_INTR = 0x4 CP_NICE = 0x1 CP_SPIN = 0x3 CP_SYS = 0x2 CP_USER = 0x0 CREAD = 0x800 CRTSCTS = 0x10000 CS5 = 0x0 CS6 = 0x100 CS7 = 0x200 CS8 = 0x300 CSIZE = 0x300 CSTART = 0x11 CSTATUS = 0xff CSTOP = 0x13 CSTOPB = 0x400 CSUSP = 0x1a CTL_HW = 0x6 CTL_KERN = 0x1 CTL_MAXNAME = 0xc CTL_NET = 0x4 DIOCADDQUEUE = 0xc100445d DIOCADDRULE = 0xcce04404 DIOCADDSTATE = 0xc1084425 DIOCCHANGERULE = 0xcce0441a DIOCCLRIFFLAG = 0xc024445a DIOCCLRSRCNODES = 0x20004455 DIOCCLRSTATES = 0xc0d04412 DIOCCLRSTATUS = 0xc0244416 DIOCGETLIMIT = 0xc0084427 DIOCGETQSTATS = 0xc1084460 DIOCGETQUEUE = 0xc100445f DIOCGETQUEUES = 0xc100445e DIOCGETRULE = 0xcce04407 DIOCGETRULES = 0xcce04406 DIOCGETRULESET = 0xc444443b DIOCGETRULESETS = 0xc444443a DIOCGETSRCNODES = 0xc0084454 DIOCGETSTATE = 0xc1084413 DIOCGETSTATES = 0xc0084419 DIOCGETSTATUS = 0xc1e84415 DIOCGETSYNFLWATS = 0xc0084463 DIOCGETTIMEOUT = 0xc008441e DIOCIGETIFACES = 0xc0244457 DIOCKILLSRCNODES = 0xc068445b DIOCKILLSTATES = 0xc0d04429 DIOCNATLOOK = 0xc0504417 DIOCOSFPADD = 0xc088444f DIOCOSFPFLUSH = 0x2000444e DIOCOSFPGET = 0xc0884450 DIOCRADDADDRS = 0xc44c4443 DIOCRADDTABLES = 0xc44c443d DIOCRCLRADDRS = 0xc44c4442 DIOCRCLRASTATS = 0xc44c4448 DIOCRCLRTABLES = 0xc44c443c DIOCRCLRTSTATS = 0xc44c4441 DIOCRDELADDRS = 0xc44c4444 DIOCRDELTABLES = 0xc44c443e DIOCRGETADDRS = 0xc44c4446 DIOCRGETASTATS = 0xc44c4447 DIOCRGETTABLES = 0xc44c443f DIOCRGETTSTATS = 0xc44c4440 DIOCRINADEFINE = 0xc44c444d DIOCRSETADDRS = 0xc44c4445 DIOCRSETTFLAGS = 0xc44c444a DIOCRTSTADDRS = 0xc44c4449 DIOCSETDEBUG = 0xc0044418 DIOCSETHOSTID = 0xc0044456 DIOCSETIFFLAG = 0xc0244459 DIOCSETLIMIT = 0xc0084428 DIOCSETREASS = 0xc004445c DIOCSETSTATUSIF = 0xc0244414 DIOCSETSYNCOOKIES = 0xc0014462 DIOCSETSYNFLWATS = 0xc0084461 DIOCSETTIMEOUT = 0xc008441d DIOCSTART = 0x20004401 DIOCSTOP = 0x20004402 DIOCXBEGIN = 0xc00c4451 DIOCXCOMMIT = 0xc00c4452 DIOCXROLLBACK = 0xc00c4453 DLT_ARCNET = 0x7 DLT_ATM_RFC1483 = 0xb DLT_AX25 = 0x3 DLT_CHAOS = 0x5 DLT_C_HDLC = 0x68 DLT_EN10MB = 0x1 DLT_EN3MB = 0x2 DLT_ENC = 0xd DLT_FDDI = 0xa DLT_IEEE802 = 0x6 DLT_IEEE802_11 = 0x69 DLT_IEEE802_11_RADIO = 0x7f DLT_LOOP = 0xc DLT_MPLS = 0xdb DLT_NULL = 0x0 DLT_OPENFLOW = 0x10b DLT_PFLOG = 0x75 DLT_PFSYNC = 0x12 DLT_PPP = 0x9 DLT_PPP_BSDOS = 0x10 DLT_PPP_ETHER = 0x33 DLT_PPP_SERIAL = 0x32 DLT_PRONET = 0x4 DLT_RAW = 0xe DLT_SLIP = 0x8 DLT_SLIP_BSDOS = 0xf DLT_USBPCAP = 0xf9 DLT_USER0 = 0x93 DLT_USER1 = 0x94 DLT_USER10 = 0x9d DLT_USER11 = 0x9e DLT_USER12 = 0x9f DLT_USER13 = 0xa0 DLT_USER14 = 0xa1 DLT_USER15 = 0xa2 DLT_USER2 = 0x95 DLT_USER3 = 0x96 DLT_USER4 = 0x97 DLT_USER5 = 0x98 DLT_USER6 = 0x99 DLT_USER7 = 0x9a DLT_USER8 = 0x9b DLT_USER9 = 0x9c DT_BLK = 0x6 DT_CHR = 0x2 DT_DIR = 0x4 DT_FIFO = 0x1 DT_LNK = 0xa DT_REG = 0x8 DT_SOCK = 0xc DT_UNKNOWN = 0x0 ECHO = 0x8 ECHOCTL = 0x40 ECHOE = 0x2 ECHOK = 0x4 ECHOKE = 0x1 ECHONL = 0x10 ECHOPRT = 0x20 EMT_TAGOVF = 0x1 EMUL_ENABLED = 0x1 EMUL_NATIVE = 0x2 ENDRUNDISC = 0x9 ETH64_8021_RSVD_MASK = 0xfffffffffff0 ETH64_8021_RSVD_PREFIX = 0x180c2000000 ETHERMIN = 0x2e ETHERMTU = 0x5dc ETHERTYPE_8023 = 0x4 ETHERTYPE_AARP = 0x80f3 ETHERTYPE_ACCTON = 0x8390 ETHERTYPE_AEONIC = 0x8036 ETHERTYPE_ALPHA = 0x814a ETHERTYPE_AMBER = 0x6008 ETHERTYPE_AMOEBA = 0x8145 ETHERTYPE_AOE = 0x88a2 ETHERTYPE_APOLLO = 0x80f7 ETHERTYPE_APOLLODOMAIN = 0x8019 ETHERTYPE_APPLETALK = 0x809b ETHERTYPE_APPLITEK = 0x80c7 ETHERTYPE_ARGONAUT = 0x803a ETHERTYPE_ARP = 0x806 ETHERTYPE_AT = 0x809b ETHERTYPE_ATALK = 0x809b ETHERTYPE_ATOMIC = 0x86df ETHERTYPE_ATT = 0x8069 ETHERTYPE_ATTSTANFORD = 0x8008 ETHERTYPE_AUTOPHON = 0x806a ETHERTYPE_AXIS = 0x8856 ETHERTYPE_BCLOOP = 0x9003 ETHERTYPE_BOFL = 0x8102 ETHERTYPE_CABLETRON = 0x7034 ETHERTYPE_CHAOS = 0x804 ETHERTYPE_COMDESIGN = 0x806c ETHERTYPE_COMPUGRAPHIC = 0x806d ETHERTYPE_COUNTERPOINT = 0x8062 ETHERTYPE_CRONUS = 0x8004 ETHERTYPE_CRONUSVLN = 0x8003 ETHERTYPE_DCA = 0x1234 ETHERTYPE_DDE = 0x807b ETHERTYPE_DEBNI = 0xaaaa ETHERTYPE_DECAM = 0x8048 ETHERTYPE_DECCUST = 0x6006 ETHERTYPE_DECDIAG = 0x6005 ETHERTYPE_DECDNS = 0x803c ETHERTYPE_DECDTS = 0x803e ETHERTYPE_DECEXPER = 0x6000 ETHERTYPE_DECLAST = 0x8041 ETHERTYPE_DECLTM = 0x803f ETHERTYPE_DECMUMPS = 0x6009 ETHERTYPE_DECNETBIOS = 0x8040 ETHERTYPE_DELTACON = 0x86de ETHERTYPE_DIDDLE = 0x4321 ETHERTYPE_DLOG1 = 0x660 ETHERTYPE_DLOG2 = 0x661 ETHERTYPE_DN = 0x6003 ETHERTYPE_DOGFIGHT = 0x1989 ETHERTYPE_DSMD = 0x8039 ETHERTYPE_EAPOL = 0x888e ETHERTYPE_ECMA = 0x803 ETHERTYPE_ENCRYPT = 0x803d ETHERTYPE_ES = 0x805d ETHERTYPE_EXCELAN = 0x8010 ETHERTYPE_EXPERDATA = 0x8049 ETHERTYPE_FLIP = 0x8146 ETHERTYPE_FLOWCONTROL = 0x8808 ETHERTYPE_FRARP = 0x808 ETHERTYPE_GENDYN = 0x8068 ETHERTYPE_HAYES = 0x8130 ETHERTYPE_HIPPI_FP = 0x8180 ETHERTYPE_HITACHI = 0x8820 ETHERTYPE_HP = 0x8005 ETHERTYPE_IEEEPUP = 0xa00 ETHERTYPE_IEEEPUPAT = 0xa01 ETHERTYPE_IMLBL = 0x4c42 ETHERTYPE_IMLBLDIAG = 0x424c ETHERTYPE_IP = 0x800 ETHERTYPE_IPAS = 0x876c ETHERTYPE_IPV6 = 0x86dd ETHERTYPE_IPX = 0x8137 ETHERTYPE_IPXNEW = 0x8037 ETHERTYPE_KALPANA = 0x8582 ETHERTYPE_LANBRIDGE = 0x8038 ETHERTYPE_LANPROBE = 0x8888 ETHERTYPE_LAT = 0x6004 ETHERTYPE_LBACK = 0x9000 ETHERTYPE_LITTLE = 0x8060 ETHERTYPE_LLDP = 0x88cc ETHERTYPE_LOGICRAFT = 0x8148 ETHERTYPE_LOOPBACK = 0x9000 ETHERTYPE_MACSEC = 0x88e5 ETHERTYPE_MATRA = 0x807a ETHERTYPE_MAX = 0xffff ETHERTYPE_MERIT = 0x807c ETHERTYPE_MICP = 0x873a ETHERTYPE_MOPDL = 0x6001 ETHERTYPE_MOPRC = 0x6002 ETHERTYPE_MOTOROLA = 0x818d ETHERTYPE_MPLS = 0x8847 ETHERTYPE_MPLS_MCAST = 0x8848 ETHERTYPE_MUMPS = 0x813f ETHERTYPE_NBPCC = 0x3c04 ETHERTYPE_NBPCLAIM = 0x3c09 ETHERTYPE_NBPCLREQ = 0x3c05 ETHERTYPE_NBPCLRSP = 0x3c06 ETHERTYPE_NBPCREQ = 0x3c02 ETHERTYPE_NBPCRSP = 0x3c03 ETHERTYPE_NBPDG = 0x3c07 ETHERTYPE_NBPDGB = 0x3c08 ETHERTYPE_NBPDLTE = 0x3c0a ETHERTYPE_NBPRAR = 0x3c0c ETHERTYPE_NBPRAS = 0x3c0b ETHERTYPE_NBPRST = 0x3c0d ETHERTYPE_NBPSCD = 0x3c01 ETHERTYPE_NBPVCD = 0x3c00 ETHERTYPE_NBS = 0x802 ETHERTYPE_NCD = 0x8149 ETHERTYPE_NESTAR = 0x8006 ETHERTYPE_NETBEUI = 0x8191 ETHERTYPE_NHRP = 0x2001 ETHERTYPE_NOVELL = 0x8138 ETHERTYPE_NS = 0x600 ETHERTYPE_NSAT = 0x601 ETHERTYPE_NSCOMPAT = 0x807 ETHERTYPE_NSH = 0x984f ETHERTYPE_NTRAILER = 0x10 ETHERTYPE_OS9 = 0x7007 ETHERTYPE_OS9NET = 0x7009 ETHERTYPE_PACER = 0x80c6 ETHERTYPE_PBB = 0x88e7 ETHERTYPE_PCS = 0x4242 ETHERTYPE_PLANNING = 0x8044 ETHERTYPE_PPP = 0x880b ETHERTYPE_PPPOE = 0x8864 ETHERTYPE_PPPOEDISC = 0x8863 ETHERTYPE_PRIMENTS = 0x7031 ETHERTYPE_PUP = 0x200 ETHERTYPE_PUPAT = 0x200 ETHERTYPE_QINQ = 0x88a8 ETHERTYPE_RACAL = 0x7030 ETHERTYPE_RATIONAL = 0x8150 ETHERTYPE_RAWFR = 0x6559 ETHERTYPE_RCL = 0x1995 ETHERTYPE_RDP = 0x8739 ETHERTYPE_RETIX = 0x80f2 ETHERTYPE_REVARP = 0x8035 ETHERTYPE_SCA = 0x6007 ETHERTYPE_SECTRA = 0x86db ETHERTYPE_SECUREDATA = 0x876d ETHERTYPE_SGITW = 0x817e ETHERTYPE_SG_BOUNCE = 0x8016 ETHERTYPE_SG_DIAG = 0x8013 ETHERTYPE_SG_NETGAMES = 0x8014 ETHERTYPE_SG_RESV = 0x8015 ETHERTYPE_SIMNET = 0x5208 ETHERTYPE_SLOW = 0x8809 ETHERTYPE_SNA = 0x80d5 ETHERTYPE_SNMP = 0x814c ETHERTYPE_SONIX = 0xfaf5 ETHERTYPE_SPIDER = 0x809f ETHERTYPE_SPRITE = 0x500 ETHERTYPE_STP = 0x8181 ETHERTYPE_TALARIS = 0x812b ETHERTYPE_TALARISMC = 0x852b ETHERTYPE_TCPCOMP = 0x876b ETHERTYPE_TCPSM = 0x9002 ETHERTYPE_TEC = 0x814f ETHERTYPE_TIGAN = 0x802f ETHERTYPE_TRAIL = 0x1000 ETHERTYPE_TRANSETHER = 0x6558 ETHERTYPE_TYMSHARE = 0x802e ETHERTYPE_UBBST = 0x7005 ETHERTYPE_UBDEBUG = 0x900 ETHERTYPE_UBDIAGLOOP = 0x7002 ETHERTYPE_UBDL = 0x7000 ETHERTYPE_UBNIU = 0x7001 ETHERTYPE_UBNMC = 0x7003 ETHERTYPE_VALID = 0x1600 ETHERTYPE_VARIAN = 0x80dd ETHERTYPE_VAXELN = 0x803b ETHERTYPE_VEECO = 0x8067 ETHERTYPE_VEXP = 0x805b ETHERTYPE_VGLAB = 0x8131 ETHERTYPE_VINES = 0xbad ETHERTYPE_VINESECHO = 0xbaf ETHERTYPE_VINESLOOP = 0xbae ETHERTYPE_VITAL = 0xff00 ETHERTYPE_VLAN = 0x8100 ETHERTYPE_VLTLMAN = 0x8080 ETHERTYPE_VPROD = 0x805c ETHERTYPE_VURESERVED = 0x8147 ETHERTYPE_WATERLOO = 0x8130 ETHERTYPE_WELLFLEET = 0x8103 ETHERTYPE_X25 = 0x805 ETHERTYPE_X75 = 0x801 ETHERTYPE_XNSSM = 0x9001 ETHERTYPE_XTP = 0x817d ETHER_ADDR_LEN = 0x6 ETHER_ALIGN = 0x2 ETHER_CRC_LEN = 0x4 ETHER_CRC_POLY_BE = 0x4c11db6 ETHER_CRC_POLY_LE = 0xedb88320 ETHER_HDR_LEN = 0xe ETHER_MAX_DIX_LEN = 0x600 ETHER_MAX_HARDMTU_LEN = 0xff9b ETHER_MAX_LEN = 0x5ee ETHER_MIN_LEN = 0x40 ETHER_TYPE_LEN = 0x2 ETHER_VLAN_ENCAP_LEN = 0x4 EVFILT_AIO = -0x3 EVFILT_DEVICE = -0x8 EVFILT_EXCEPT = -0x9 EVFILT_PROC = -0x5 EVFILT_READ = -0x1 EVFILT_SIGNAL = -0x6 EVFILT_SYSCOUNT = 0x9 EVFILT_TIMER = -0x7 EVFILT_VNODE = -0x4 EVFILT_WRITE = -0x2 EVL_ENCAPLEN = 0x4 EVL_PRIO_BITS = 0xd EVL_PRIO_MAX = 0x7 EVL_VLID_MASK = 0xfff EVL_VLID_MAX = 0xffe EVL_VLID_MIN = 0x1 EVL_VLID_NULL = 0x0 EV_ADD = 0x1 EV_CLEAR = 0x20 EV_DELETE = 0x2 EV_DISABLE = 0x8 EV_DISPATCH = 0x80 EV_ENABLE = 0x4 EV_EOF = 0x8000 EV_ERROR = 0x4000 EV_FLAG1 = 0x2000 EV_ONESHOT = 0x10 EV_RECEIPT = 0x40 EV_SYSFLAGS = 0xf800 EXTA = 0x4b00 EXTB = 0x9600 EXTPROC = 0x800 FD_CLOEXEC = 0x1 FD_SETSIZE = 0x400 FLUSHO = 0x800000 F_DUPFD = 0x0 F_DUPFD_CLOEXEC = 0xa F_GETFD = 0x1 F_GETFL = 0x3 F_GETLK = 0x7 F_GETOWN = 0x5 F_ISATTY = 0xb F_OK = 0x0 F_RDLCK = 0x1 F_SETFD = 0x2 F_SETFL = 0x4 F_SETLK = 0x8 F_SETLKW = 0x9 F_SETOWN = 0x6 F_UNLCK = 0x2 F_WRLCK = 0x3 HUPCL = 0x4000 HW_MACHINE = 0x1 ICANON = 0x100 ICMP6_FILTER = 0x12 ICRNL = 0x100 IEXTEN = 0x400 IFAN_ARRIVAL = 0x0 IFAN_DEPARTURE = 0x1 IFF_ALLMULTI = 0x200 IFF_BROADCAST = 0x2 IFF_CANTCHANGE = 0x8e52 IFF_DEBUG = 0x4 IFF_LINK0 = 0x1000 IFF_LINK1 = 0x2000 IFF_LINK2 = 0x4000 IFF_LOOPBACK = 0x8 IFF_MULTICAST = 0x8000 IFF_NOARP = 0x80 IFF_OACTIVE = 0x400 IFF_POINTOPOINT = 0x10 IFF_PROMISC = 0x100 IFF_RUNNING = 0x40 IFF_SIMPLEX = 0x800 IFF_STATICARP = 0x20 IFF_UP = 0x1 IFNAMSIZ = 0x10 IFT_1822 = 0x2 IFT_A12MPPSWITCH = 0x82 IFT_AAL2 = 0xbb IFT_AAL5 = 0x31 IFT_ADSL = 0x5e IFT_AFLANE8023 = 0x3b IFT_AFLANE8025 = 0x3c IFT_ARAP = 0x58 IFT_ARCNET = 0x23 IFT_ARCNETPLUS = 0x24 IFT_ASYNC = 0x54 IFT_ATM = 0x25 IFT_ATMDXI = 0x69 IFT_ATMFUNI = 0x6a IFT_ATMIMA = 0x6b IFT_ATMLOGICAL = 0x50 IFT_ATMRADIO = 0xbd IFT_ATMSUBINTERFACE = 0x86 IFT_ATMVCIENDPT = 0xc2 IFT_ATMVIRTUAL = 0x95 IFT_BGPPOLICYACCOUNTING = 0xa2 IFT_BLUETOOTH = 0xf8 IFT_BRIDGE = 0xd1 IFT_BSC = 0x53 IFT_CARP = 0xf7 IFT_CCTEMUL = 0x3d IFT_CEPT = 0x13 IFT_CES = 0x85 IFT_CHANNEL = 0x46 IFT_CNR = 0x55 IFT_COFFEE = 0x84 IFT_COMPOSITELINK = 0x9b IFT_DCN = 0x8d IFT_DIGITALPOWERLINE = 0x8a IFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba IFT_DLSW = 0x4a IFT_DOCSCABLEDOWNSTREAM = 0x80 IFT_DOCSCABLEMACLAYER = 0x7f IFT_DOCSCABLEUPSTREAM = 0x81 IFT_DOCSCABLEUPSTREAMCHANNEL = 0xcd IFT_DS0 = 0x51 IFT_DS0BUNDLE = 0x52 IFT_DS1FDL = 0xaa IFT_DS3 = 0x1e IFT_DTM = 0x8c IFT_DUMMY = 0xf1 IFT_DVBASILN = 0xac IFT_DVBASIOUT = 0xad IFT_DVBRCCDOWNSTREAM = 0x93 IFT_DVBRCCMACLAYER = 0x92 IFT_DVBRCCUPSTREAM = 0x94 IFT_ECONET = 0xce IFT_ENC = 0xf4 IFT_EON = 0x19 IFT_EPLRS = 0x57 IFT_ESCON = 0x49 IFT_ETHER = 0x6 IFT_FAITH = 0xf3 IFT_FAST = 0x7d IFT_FASTETHER = 0x3e IFT_FASTETHERFX = 0x45 IFT_FDDI = 0xf IFT_FIBRECHANNEL = 0x38 IFT_FRAMERELAYINTERCONNECT = 0x3a IFT_FRAMERELAYMPI = 0x5c IFT_FRDLCIENDPT = 0xc1 IFT_FRELAY = 0x20 IFT_FRELAYDCE = 0x2c IFT_FRF16MFRBUNDLE = 0xa3 IFT_FRFORWARD = 0x9e IFT_G703AT2MB = 0x43 IFT_G703AT64K = 0x42 IFT_GIF = 0xf0 IFT_GIGABITETHERNET = 0x75 IFT_GR303IDT = 0xb2 IFT_GR303RDT = 0xb1 IFT_H323GATEKEEPER = 0xa4 IFT_H323PROXY = 0xa5 IFT_HDH1822 = 0x3 IFT_HDLC = 0x76 IFT_HDSL2 = 0xa8 IFT_HIPERLAN2 = 0xb7 IFT_HIPPI = 0x2f IFT_HIPPIINTERFACE = 0x39 IFT_HOSTPAD = 0x5a IFT_HSSI = 0x2e IFT_HY = 0xe IFT_IBM370PARCHAN = 0x48 IFT_IDSL = 0x9a IFT_IEEE1394 = 0x90 IFT_IEEE80211 = 0x47 IFT_IEEE80212 = 0x37 IFT_IEEE8023ADLAG = 0xa1 IFT_IFGSN = 0x91 IFT_IMT = 0xbe IFT_INFINIBAND = 0xc7 IFT_INTERLEAVE = 0x7c IFT_IP = 0x7e IFT_IPFORWARD = 0x8e IFT_IPOVERATM = 0x72 IFT_IPOVERCDLC = 0x6d IFT_IPOVERCLAW = 0x6e IFT_IPSWITCH = 0x4e IFT_ISDN = 0x3f IFT_ISDNBASIC = 0x14 IFT_ISDNPRIMARY = 0x15 IFT_ISDNS = 0x4b IFT_ISDNU = 0x4c IFT_ISO88022LLC = 0x29 IFT_ISO88023 = 0x7 IFT_ISO88024 = 0x8 IFT_ISO88025 = 0x9 IFT_ISO88025CRFPINT = 0x62 IFT_ISO88025DTR = 0x56 IFT_ISO88025FIBER = 0x73 IFT_ISO88026 = 0xa IFT_ISUP = 0xb3 IFT_L2VLAN = 0x87 IFT_L3IPVLAN = 0x88 IFT_L3IPXVLAN = 0x89 IFT_LAPB = 0x10 IFT_LAPD = 0x4d IFT_LAPF = 0x77 IFT_LINEGROUP = 0xd2 IFT_LOCALTALK = 0x2a IFT_LOOP = 0x18 IFT_MBIM = 0xfa IFT_MEDIAMAILOVERIP = 0x8b IFT_MFSIGLINK = 0xa7 IFT_MIOX25 = 0x26 IFT_MODEM = 0x30 IFT_MPC = 0x71 IFT_MPLS = 0xa6 IFT_MPLSTUNNEL = 0x96 IFT_MSDSL = 0x8f IFT_MVL = 0xbf IFT_MYRINET = 0x63 IFT_NFAS = 0xaf IFT_NSIP = 0x1b IFT_OPTICALCHANNEL = 0xc3 IFT_OPTICALTRANSPORT = 0xc4 IFT_OTHER = 0x1 IFT_P10 = 0xc IFT_P80 = 0xd IFT_PARA = 0x22 IFT_PFLOG = 0xf5 IFT_PFLOW = 0xf9 IFT_PFSYNC = 0xf6 IFT_PLC = 0xae IFT_PON155 = 0xcf IFT_PON622 = 0xd0 IFT_POS = 0xab IFT_PPP = 0x17 IFT_PPPMULTILINKBUNDLE = 0x6c IFT_PROPATM = 0xc5 IFT_PROPBWAP2MP = 0xb8 IFT_PROPCNLS = 0x59 IFT_PROPDOCSWIRELESSDOWNSTREAM = 0xb5 IFT_PROPDOCSWIRELESSMACLAYER = 0xb4 IFT_PROPDOCSWIRELESSUPSTREAM = 0xb6 IFT_PROPMUX = 0x36 IFT_PROPVIRTUAL = 0x35 IFT_PROPWIRELESSP2P = 0x9d IFT_PTPSERIAL = 0x16 IFT_PVC = 0xf2 IFT_Q2931 = 0xc9 IFT_QLLC = 0x44 IFT_RADIOMAC = 0xbc IFT_RADSL = 0x5f IFT_REACHDSL = 0xc0 IFT_RFC1483 = 0x9f IFT_RS232 = 0x21 IFT_RSRB = 0x4f IFT_SDLC = 0x11 IFT_SDSL = 0x60 IFT_SHDSL = 0xa9 IFT_SIP = 0x1f IFT_SIPSIG = 0xcc IFT_SIPTG = 0xcb IFT_SLIP = 0x1c IFT_SMDSDXI = 0x2b IFT_SMDSICIP = 0x34 IFT_SONET = 0x27 IFT_SONETOVERHEADCHANNEL = 0xb9 IFT_SONETPATH = 0x32 IFT_SONETVT = 0x33 IFT_SRP = 0x97 IFT_SS7SIGLINK = 0x9c IFT_STACKTOSTACK = 0x6f IFT_STARLAN = 0xb IFT_T1 = 0x12 IFT_TDLC = 0x74 IFT_TELINK = 0xc8 IFT_TERMPAD = 0x5b IFT_TR008 = 0xb0 IFT_TRANSPHDLC = 0x7b IFT_TUNNEL = 0x83 IFT_ULTRA = 0x1d IFT_USB = 0xa0 IFT_V11 = 0x40 IFT_V35 = 0x2d IFT_V36 = 0x41 IFT_V37 = 0x78 IFT_VDSL = 0x61 IFT_VIRTUALIPADDRESS = 0x70 IFT_VIRTUALTG = 0xca IFT_VOICEDID = 0xd5 IFT_VOICEEM = 0x64 IFT_VOICEEMFGD = 0xd3 IFT_VOICEENCAP = 0x67 IFT_VOICEFGDEANA = 0xd4 IFT_VOICEFXO = 0x65 IFT_VOICEFXS = 0x66 IFT_VOICEOVERATM = 0x98 IFT_VOICEOVERCABLE = 0xc6 IFT_VOICEOVERFRAMERELAY = 0x99 IFT_VOICEOVERIP = 0x68 IFT_WIREGUARD = 0xfb IFT_X213 = 0x5d IFT_X25 = 0x5 IFT_X25DDN = 0x4 IFT_X25HUNTGROUP = 0x7a IFT_X25MLP = 0x79 IFT_X25PLE = 0x28 IFT_XETHER = 0x1a IGNBRK = 0x1 IGNCR = 0x80 IGNPAR = 0x4 IMAXBEL = 0x2000 INLCR = 0x40 INPCK = 0x10 IN_CLASSA_HOST = 0xffffff IN_CLASSA_MAX = 0x80 IN_CLASSA_NET = 0xff000000 IN_CLASSA_NSHIFT = 0x18 IN_CLASSB_HOST = 0xffff IN_CLASSB_MAX = 0x10000 IN_CLASSB_NET = 0xffff0000 IN_CLASSB_NSHIFT = 0x10 IN_CLASSC_HOST = 0xff IN_CLASSC_NET = 0xffffff00 IN_CLASSC_NSHIFT = 0x8 IN_CLASSD_HOST = 0xfffffff IN_CLASSD_NET = 0xf0000000 IN_CLASSD_NSHIFT = 0x1c IN_LOOPBACKNET = 0x7f IN_RFC3021_HOST = 0x1 IN_RFC3021_NET = 0xfffffffe IN_RFC3021_NSHIFT = 0x1f IPPROTO_AH = 0x33 IPPROTO_CARP = 0x70 IPPROTO_DIVERT = 0x102 IPPROTO_DONE = 0x101 IPPROTO_DSTOPTS = 0x3c IPPROTO_EGP = 0x8 IPPROTO_ENCAP = 0x62 IPPROTO_EON = 0x50 IPPROTO_ESP = 0x32 IPPROTO_ETHERIP = 0x61 IPPROTO_FRAGMENT = 0x2c IPPROTO_GGP = 0x3 IPPROTO_GRE = 0x2f IPPROTO_HOPOPTS = 0x0 IPPROTO_ICMP = 0x1 IPPROTO_ICMPV6 = 0x3a IPPROTO_IDP = 0x16 IPPROTO_IGMP = 0x2 IPPROTO_IP = 0x0 IPPROTO_IPCOMP = 0x6c IPPROTO_IPIP = 0x4 IPPROTO_IPV4 = 0x4 IPPROTO_IPV6 = 0x29 IPPROTO_MAX = 0x100 IPPROTO_MAXID = 0x103 IPPROTO_MOBILE = 0x37 IPPROTO_MPLS = 0x89 IPPROTO_NONE = 0x3b IPPROTO_PFSYNC = 0xf0 IPPROTO_PIM = 0x67 IPPROTO_PUP = 0xc IPPROTO_RAW = 0xff IPPROTO_ROUTING = 0x2b IPPROTO_RSVP = 0x2e IPPROTO_SCTP = 0x84 IPPROTO_TCP = 0x6 IPPROTO_TP = 0x1d IPPROTO_UDP = 0x11 IPPROTO_UDPLITE = 0x88 IPV6_AUTH_LEVEL = 0x35 IPV6_AUTOFLOWLABEL = 0x3b IPV6_CHECKSUM = 0x1a IPV6_DEFAULT_MULTICAST_HOPS = 0x1 IPV6_DEFAULT_MULTICAST_LOOP = 0x1 IPV6_DEFHLIM = 0x40 IPV6_DONTFRAG = 0x3e IPV6_DSTOPTS = 0x32 IPV6_ESP_NETWORK_LEVEL = 0x37 IPV6_ESP_TRANS_LEVEL = 0x36 IPV6_FAITH = 0x1d IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_MASK = 0xffff0f00 IPV6_FRAGTTL = 0x78 IPV6_HLIMDEC = 0x1 IPV6_HOPLIMIT = 0x2f IPV6_HOPOPTS = 0x31 IPV6_IPCOMP_LEVEL = 0x3c IPV6_JOIN_GROUP = 0xc IPV6_LEAVE_GROUP = 0xd IPV6_MAXHLIM = 0xff IPV6_MAXPACKET = 0xffff IPV6_MINHOPCOUNT = 0x41 IPV6_MMTU = 0x500 IPV6_MULTICAST_HOPS = 0xa IPV6_MULTICAST_IF = 0x9 IPV6_MULTICAST_LOOP = 0xb IPV6_NEXTHOP = 0x30 IPV6_OPTIONS = 0x1 IPV6_PATHMTU = 0x2c IPV6_PIPEX = 0x3f IPV6_PKTINFO = 0x2e IPV6_PORTRANGE = 0xe IPV6_PORTRANGE_DEFAULT = 0x0 IPV6_PORTRANGE_HIGH = 0x1 IPV6_PORTRANGE_LOW = 0x2 IPV6_RECVDSTOPTS = 0x28 IPV6_RECVDSTPORT = 0x40 IPV6_RECVHOPLIMIT = 0x25 IPV6_RECVHOPOPTS = 0x27 IPV6_RECVPATHMTU = 0x2b IPV6_RECVPKTINFO = 0x24 IPV6_RECVRTHDR = 0x26 IPV6_RECVTCLASS = 0x39 IPV6_RTABLE = 0x1021 IPV6_RTHDR = 0x33 IPV6_RTHDRDSTOPTS = 0x23 IPV6_RTHDR_LOOSE = 0x0 IPV6_RTHDR_STRICT = 0x1 IPV6_RTHDR_TYPE_0 = 0x0 IPV6_SOCKOPT_RESERVED1 = 0x3 IPV6_TCLASS = 0x3d IPV6_UNICAST_HOPS = 0x4 IPV6_USE_MIN_MTU = 0x2a IPV6_V6ONLY = 0x1b IPV6_VERSION = 0x60 IPV6_VERSION_MASK = 0xf0 IP_ADD_MEMBERSHIP = 0xc IP_AUTH_LEVEL = 0x14 IP_DEFAULT_MULTICAST_LOOP = 0x1 IP_DEFAULT_MULTICAST_TTL = 0x1 IP_DF = 0x4000 IP_DROP_MEMBERSHIP = 0xd IP_ESP_NETWORK_LEVEL = 0x16 IP_ESP_TRANS_LEVEL = 0x15 IP_HDRINCL = 0x2 IP_IPCOMP_LEVEL = 0x1d IP_IPDEFTTL = 0x25 IP_IPSECFLOWINFO = 0x24 IP_IPSEC_LOCAL_AUTH = 0x1b IP_IPSEC_LOCAL_CRED = 0x19 IP_IPSEC_LOCAL_ID = 0x17 IP_IPSEC_REMOTE_AUTH = 0x1c IP_IPSEC_REMOTE_CRED = 0x1a IP_IPSEC_REMOTE_ID = 0x18 IP_MAXPACKET = 0xffff IP_MAX_MEMBERSHIPS = 0xfff IP_MF = 0x2000 IP_MINTTL = 0x20 IP_MIN_MEMBERSHIPS = 0xf IP_MSS = 0x240 IP_MULTICAST_IF = 0x9 IP_MULTICAST_LOOP = 0xb IP_MULTICAST_TTL = 0xa IP_OFFMASK = 0x1fff IP_OPTIONS = 0x1 IP_PIPEX = 0x22 IP_PORTRANGE = 0x13 IP_PORTRANGE_DEFAULT = 0x0 IP_PORTRANGE_HIGH = 0x1 IP_PORTRANGE_LOW = 0x2 IP_RECVDSTADDR = 0x7 IP_RECVDSTPORT = 0x21 IP_RECVIF = 0x1e IP_RECVOPTS = 0x5 IP_RECVRETOPTS = 0x6 IP_RECVRTABLE = 0x23 IP_RECVTTL = 0x1f IP_RETOPTS = 0x8 IP_RF = 0x8000 IP_RTABLE = 0x1021 IP_SENDSRCADDR = 0x7 IP_TOS = 0x3 IP_TTL = 0x4 ISIG = 0x80 ISTRIP = 0x20 ITIMER_PROF = 0x2 ITIMER_REAL = 0x0 ITIMER_VIRTUAL = 0x1 IUCLC = 0x1000 IXANY = 0x800 IXOFF = 0x400 IXON = 0x200 KERN_HOSTNAME = 0xa KERN_OSRELEASE = 0x2 KERN_OSTYPE = 0x1 KERN_VERSION = 0x4 LCNT_OVERLOAD_FLUSH = 0x6 LOCK_EX = 0x2 LOCK_NB = 0x4 LOCK_SH = 0x1 LOCK_UN = 0x8 MADV_DONTNEED = 0x4 MADV_FREE = 0x6 MADV_NORMAL = 0x0 MADV_RANDOM = 0x1 MADV_SEQUENTIAL = 0x2 MADV_SPACEAVAIL = 0x5 MADV_WILLNEED = 0x3 MAP_ANON = 0x1000 MAP_ANONYMOUS = 0x1000 MAP_CONCEAL = 0x8000 MAP_COPY = 0x2 MAP_FILE = 0x0 MAP_FIXED = 0x10 MAP_FLAGMASK = 0xfff7 MAP_HASSEMAPHORE = 0x0 MAP_INHERIT = 0x0 MAP_INHERIT_COPY = 0x1 MAP_INHERIT_NONE = 0x2 MAP_INHERIT_SHARE = 0x0 MAP_INHERIT_ZERO = 0x3 MAP_NOEXTEND = 0x0 MAP_NORESERVE = 0x0 MAP_PRIVATE = 0x2 MAP_RENAME = 0x0 MAP_SHARED = 0x1 MAP_STACK = 0x4000 MAP_TRYFIXED = 0x0 MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MNT_ASYNC = 0x40 MNT_DEFEXPORTED = 0x200 MNT_DELEXPORT = 0x20000 MNT_DOOMED = 0x8000000 MNT_EXPORTANON = 0x400 MNT_EXPORTED = 0x100 MNT_EXRDONLY = 0x80 MNT_FORCE = 0x80000 MNT_LAZY = 0x3 MNT_LOCAL = 0x1000 MNT_NOATIME = 0x8000 MNT_NODEV = 0x10 MNT_NOEXEC = 0x4 MNT_NOPERM = 0x20 MNT_NOSUID = 0x8 MNT_NOWAIT = 0x2 MNT_QUOTA = 0x2000 MNT_RDONLY = 0x1 MNT_RELOAD = 0x40000 MNT_ROOTFS = 0x4000 MNT_SOFTDEP = 0x4000000 MNT_STALLED = 0x100000 MNT_SWAPPABLE = 0x200000 MNT_SYNCHRONOUS = 0x2 MNT_UPDATE = 0x10000 MNT_VISFLAGMASK = 0x400ffff MNT_WAIT = 0x1 MNT_WANTRDWR = 0x2000000 MNT_WXALLOWED = 0x800 MOUNT_AFS = "afs" MOUNT_CD9660 = "cd9660" MOUNT_EXT2FS = "ext2fs" MOUNT_FFS = "ffs" MOUNT_FUSEFS = "fuse" MOUNT_MFS = "mfs" MOUNT_MSDOS = "msdos" MOUNT_NCPFS = "ncpfs" MOUNT_NFS = "nfs" MOUNT_NTFS = "ntfs" MOUNT_TMPFS = "tmpfs" MOUNT_UDF = "udf" MOUNT_UFS = "ffs" MSG_BCAST = 0x100 MSG_CMSG_CLOEXEC = 0x800 MSG_CTRUNC = 0x20 MSG_DONTROUTE = 0x4 MSG_DONTWAIT = 0x80 MSG_EOR = 0x8 MSG_MCAST = 0x200 MSG_NOSIGNAL = 0x400 MSG_OOB = 0x1 MSG_PEEK = 0x2 MSG_TRUNC = 0x10 MSG_WAITALL = 0x40 MSG_WAITFORONE = 0x1000 MS_ASYNC = 0x1 MS_INVALIDATE = 0x4 MS_SYNC = 0x2 NAME_MAX = 0xff NET_RT_DUMP = 0x1 NET_RT_FLAGS = 0x2 NET_RT_IFLIST = 0x3 NET_RT_IFNAMES = 0x6 NET_RT_MAXID = 0x8 NET_RT_SOURCE = 0x7 NET_RT_STATS = 0x4 NET_RT_TABLE = 0x5 NFDBITS = 0x20 NOFLSH = 0x80000000 NOKERNINFO = 0x2000000 NOTE_ATTRIB = 0x8 NOTE_CHANGE = 0x1 NOTE_CHILD = 0x4 NOTE_DELETE = 0x1 NOTE_EOF = 0x2 NOTE_EXEC = 0x20000000 NOTE_EXIT = 0x80000000 NOTE_EXTEND = 0x4 NOTE_FORK = 0x40000000 NOTE_LINK = 0x10 NOTE_LOWAT = 0x1 NOTE_OOB = 0x4 NOTE_PCTRLMASK = 0xf0000000 NOTE_PDATAMASK = 0xfffff NOTE_RENAME = 0x20 NOTE_REVOKE = 0x40 NOTE_TRACK = 0x1 NOTE_TRACKERR = 0x2 NOTE_TRUNCATE = 0x80 NOTE_WRITE = 0x2 OCRNL = 0x10 OLCUC = 0x20 ONLCR = 0x2 ONLRET = 0x80 ONOCR = 0x40 ONOEOT = 0x8 OPOST = 0x1 OXTABS = 0x4 O_ACCMODE = 0x3 O_APPEND = 0x8 O_ASYNC = 0x40 O_CLOEXEC = 0x10000 O_CREAT = 0x200 O_DIRECTORY = 0x20000 O_DSYNC = 0x80 O_EXCL = 0x800 O_EXLOCK = 0x20 O_FSYNC = 0x80 O_NDELAY = 0x4 O_NOCTTY = 0x8000 O_NOFOLLOW = 0x100 O_NONBLOCK = 0x4 O_RDONLY = 0x0 O_RDWR = 0x2 O_RSYNC = 0x80 O_SHLOCK = 0x10 O_SYNC = 0x80 O_TRUNC = 0x400 O_WRONLY = 0x1 PARENB = 0x1000 PARMRK = 0x8 PARODD = 0x2000 PENDIN = 0x20000000 PF_FLUSH = 0x1 PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 PROT_EXEC = 0x4 PROT_NONE = 0x0 PROT_READ = 0x1 PROT_WRITE = 0x2 RLIMIT_CORE = 0x4 RLIMIT_CPU = 0x0 RLIMIT_DATA = 0x2 RLIMIT_FSIZE = 0x1 RLIMIT_MEMLOCK = 0x6 RLIMIT_NOFILE = 0x8 RLIMIT_NPROC = 0x7 RLIMIT_RSS = 0x5 RLIMIT_STACK = 0x3 RLIM_INFINITY = 0x7fffffffffffffff RTAX_AUTHOR = 0x6 RTAX_BFD = 0xb RTAX_BRD = 0x7 RTAX_DNS = 0xc RTAX_DST = 0x0 RTAX_GATEWAY = 0x1 RTAX_GENMASK = 0x3 RTAX_IFA = 0x5 RTAX_IFP = 0x4 RTAX_LABEL = 0xa RTAX_MAX = 0xf RTAX_NETMASK = 0x2 RTAX_SEARCH = 0xe RTAX_SRC = 0x8 RTAX_SRCMASK = 0x9 RTAX_STATIC = 0xd RTA_AUTHOR = 0x40 RTA_BFD = 0x800 RTA_BRD = 0x80 RTA_DNS = 0x1000 RTA_DST = 0x1 RTA_GATEWAY = 0x2 RTA_GENMASK = 0x8 RTA_IFA = 0x20 RTA_IFP = 0x10 RTA_LABEL = 0x400 RTA_NETMASK = 0x4 RTA_SEARCH = 0x4000 RTA_SRC = 0x100 RTA_SRCMASK = 0x200 RTA_STATIC = 0x2000 RTF_ANNOUNCE = 0x4000 RTF_BFD = 0x1000000 RTF_BLACKHOLE = 0x1000 RTF_BROADCAST = 0x400000 RTF_CACHED = 0x20000 RTF_CLONED = 0x10000 RTF_CLONING = 0x100 RTF_CONNECTED = 0x800000 RTF_DONE = 0x40 RTF_DYNAMIC = 0x10 RTF_FMASK = 0x110fc08 RTF_GATEWAY = 0x2 RTF_HOST = 0x4 RTF_LLINFO = 0x400 RTF_LOCAL = 0x200000 RTF_MODIFIED = 0x20 RTF_MPATH = 0x40000 RTF_MPLS = 0x100000 RTF_MULTICAST = 0x200 RTF_PERMANENT_ARP = 0x2000 RTF_PROTO1 = 0x8000 RTF_PROTO2 = 0x4000 RTF_PROTO3 = 0x2000 RTF_REJECT = 0x8 RTF_STATIC = 0x800 RTF_UP = 0x1 RTF_USETRAILERS = 0x8000 RTM_80211INFO = 0x15 RTM_ADD = 0x1 RTM_BFD = 0x12 RTM_CHANGE = 0x3 RTM_CHGADDRATTR = 0x14 RTM_DELADDR = 0xd RTM_DELETE = 0x2 RTM_DESYNC = 0x10 RTM_GET = 0x4 RTM_IFANNOUNCE = 0xf RTM_IFINFO = 0xe RTM_INVALIDATE = 0x11 RTM_LOSING = 0x5 RTM_MAXSIZE = 0x800 RTM_MISS = 0x7 RTM_NEWADDR = 0xc RTM_PROPOSAL = 0x13 RTM_REDIRECT = 0x6 RTM_RESOLVE = 0xb RTM_SOURCE = 0x16 RTM_VERSION = 0x5 RTV_EXPIRE = 0x4 RTV_HOPCOUNT = 0x2 RTV_MTU = 0x1 RTV_RPIPE = 0x8 RTV_RTT = 0x40 RTV_RTTVAR = 0x80 RTV_SPIPE = 0x10 RTV_SSTHRESH = 0x20 RT_TABLEID_BITS = 0x8 RT_TABLEID_MASK = 0xff RT_TABLEID_MAX = 0xff RUSAGE_CHILDREN = -0x1 RUSAGE_SELF = 0x0 RUSAGE_THREAD = 0x1 SCM_RIGHTS = 0x1 SCM_TIMESTAMP = 0x4 SEEK_CUR = 0x1 SEEK_END = 0x2 SEEK_SET = 0x0 SHUT_RD = 0x0 SHUT_RDWR = 0x2 SHUT_WR = 0x1 SIOCADDMULTI = 0x80206931 SIOCAIFADDR = 0x8040691a SIOCAIFGROUP = 0x80246987 SIOCATMARK = 0x40047307 SIOCBRDGADD = 0x8060693c SIOCBRDGADDL = 0x80606949 SIOCBRDGADDS = 0x80606941 SIOCBRDGARL = 0x808c694d SIOCBRDGDADDR = 0x81286947 SIOCBRDGDEL = 0x8060693d SIOCBRDGDELS = 0x80606942 SIOCBRDGFLUSH = 0x80606948 SIOCBRDGFRL = 0x808c694e SIOCBRDGGCACHE = 0xc0146941 SIOCBRDGGFD = 0xc0146952 SIOCBRDGGHT = 0xc0146951 SIOCBRDGGIFFLGS = 0xc060693e SIOCBRDGGMA = 0xc0146953 SIOCBRDGGPARAM = 0xc0406958 SIOCBRDGGPRI = 0xc0146950 SIOCBRDGGRL = 0xc028694f SIOCBRDGGTO = 0xc0146946 SIOCBRDGIFS = 0xc0606942 SIOCBRDGRTS = 0xc0186943 SIOCBRDGSADDR = 0xc1286944 SIOCBRDGSCACHE = 0x80146940 SIOCBRDGSFD = 0x80146952 SIOCBRDGSHT = 0x80146951 SIOCBRDGSIFCOST = 0x80606955 SIOCBRDGSIFFLGS = 0x8060693f SIOCBRDGSIFPRIO = 0x80606954 SIOCBRDGSIFPROT = 0x8060694a SIOCBRDGSMA = 0x80146953 SIOCBRDGSPRI = 0x80146950 SIOCBRDGSPROTO = 0x8014695a SIOCBRDGSTO = 0x80146945 SIOCBRDGSTXHC = 0x80146959 SIOCDELLABEL = 0x80206997 SIOCDELMULTI = 0x80206932 SIOCDIFADDR = 0x80206919 SIOCDIFGROUP = 0x80246989 SIOCDIFPARENT = 0x802069b4 SIOCDIFPHYADDR = 0x80206949 SIOCDPWE3NEIGHBOR = 0x802069de SIOCDVNETID = 0x802069af SIOCGETKALIVE = 0xc01869a4 SIOCGETLABEL = 0x8020699a SIOCGETMPWCFG = 0xc02069ae SIOCGETPFLOW = 0xc02069fe SIOCGETPFSYNC = 0xc02069f8 SIOCGETSGCNT = 0xc0147534 SIOCGETVIFCNT = 0xc0147533 SIOCGETVLAN = 0xc0206990 SIOCGIFADDR = 0xc0206921 SIOCGIFBRDADDR = 0xc0206923 SIOCGIFCONF = 0xc0086924 SIOCGIFDATA = 0xc020691b SIOCGIFDESCR = 0xc0206981 SIOCGIFDSTADDR = 0xc0206922 SIOCGIFFLAGS = 0xc0206911 SIOCGIFGATTR = 0xc024698b SIOCGIFGENERIC = 0xc020693a SIOCGIFGLIST = 0xc024698d SIOCGIFGMEMB = 0xc024698a SIOCGIFGROUP = 0xc0246988 SIOCGIFHARDMTU = 0xc02069a5 SIOCGIFLLPRIO = 0xc02069b6 SIOCGIFMEDIA = 0xc0386938 SIOCGIFMETRIC = 0xc0206917 SIOCGIFMTU = 0xc020697e SIOCGIFNETMASK = 0xc0206925 SIOCGIFPAIR = 0xc02069b1 SIOCGIFPARENT = 0xc02069b3 SIOCGIFPRIORITY = 0xc020699c SIOCGIFRDOMAIN = 0xc02069a0 SIOCGIFRTLABEL = 0xc0206983 SIOCGIFRXR = 0x802069aa SIOCGIFSFFPAGE = 0xc1126939 SIOCGIFXFLAGS = 0xc020699e SIOCGLIFPHYADDR = 0xc218694b SIOCGLIFPHYDF = 0xc02069c2 SIOCGLIFPHYECN = 0xc02069c8 SIOCGLIFPHYRTABLE = 0xc02069a2 SIOCGLIFPHYTTL = 0xc02069a9 SIOCGPGRP = 0x40047309 SIOCGPWE3 = 0xc0206998 SIOCGPWE3CTRLWORD = 0xc02069dc SIOCGPWE3FAT = 0xc02069dd SIOCGPWE3NEIGHBOR = 0xc21869de SIOCGRXHPRIO = 0xc02069db SIOCGSPPPPARAMS = 0xc0206994 SIOCGTXHPRIO = 0xc02069c6 SIOCGUMBINFO = 0xc02069be SIOCGUMBPARAM = 0xc02069c0 SIOCGVH = 0xc02069f6 SIOCGVNETFLOWID = 0xc02069c4 SIOCGVNETID = 0xc02069a7 SIOCIFAFATTACH = 0x801169ab SIOCIFAFDETACH = 0x801169ac SIOCIFCREATE = 0x8020697a SIOCIFDESTROY = 0x80206979 SIOCIFGCLONERS = 0xc00c6978 SIOCSETKALIVE = 0x801869a3 SIOCSETLABEL = 0x80206999 SIOCSETMPWCFG = 0x802069ad SIOCSETPFLOW = 0x802069fd SIOCSETPFSYNC = 0x802069f7 SIOCSETVLAN = 0x8020698f SIOCSIFADDR = 0x8020690c SIOCSIFBRDADDR = 0x80206913 SIOCSIFDESCR = 0x80206980 SIOCSIFDSTADDR = 0x8020690e SIOCSIFFLAGS = 0x80206910 SIOCSIFGATTR = 0x8024698c SIOCSIFGENERIC = 0x80206939 SIOCSIFLLADDR = 0x8020691f SIOCSIFLLPRIO = 0x802069b5 SIOCSIFMEDIA = 0xc0206937 SIOCSIFMETRIC = 0x80206918 SIOCSIFMTU = 0x8020697f SIOCSIFNETMASK = 0x80206916 SIOCSIFPAIR = 0x802069b0 SIOCSIFPARENT = 0x802069b2 SIOCSIFPRIORITY = 0x8020699b SIOCSIFRDOMAIN = 0x8020699f SIOCSIFRTLABEL = 0x80206982 SIOCSIFXFLAGS = 0x8020699d SIOCSLIFPHYADDR = 0x8218694a SIOCSLIFPHYDF = 0x802069c1 SIOCSLIFPHYECN = 0x802069c7 SIOCSLIFPHYRTABLE = 0x802069a1 SIOCSLIFPHYTTL = 0x802069a8 SIOCSPGRP = 0x80047308 SIOCSPWE3CTRLWORD = 0x802069dc SIOCSPWE3FAT = 0x802069dd SIOCSPWE3NEIGHBOR = 0x821869de SIOCSRXHPRIO = 0x802069db SIOCSSPPPPARAMS = 0x80206993 SIOCSTXHPRIO = 0x802069c5 SIOCSUMBPARAM = 0x802069bf SIOCSVH = 0xc02069f5 SIOCSVNETFLOWID = 0x802069c3 SIOCSVNETID = 0x802069a6 SOCK_CLOEXEC = 0x8000 SOCK_DGRAM = 0x2 SOCK_DNS = 0x1000 SOCK_NONBLOCK = 0x4000 SOCK_RAW = 0x3 SOCK_RDM = 0x4 SOCK_SEQPACKET = 0x5 SOCK_STREAM = 0x1 SOL_SOCKET = 0xffff SOMAXCONN = 0x80 SO_ACCEPTCONN = 0x2 SO_BINDANY = 0x1000 SO_BROADCAST = 0x20 SO_DEBUG = 0x1 SO_DOMAIN = 0x1024 SO_DONTROUTE = 0x10 SO_ERROR = 0x1007 SO_KEEPALIVE = 0x8 SO_LINGER = 0x80 SO_NETPROC = 0x1020 SO_OOBINLINE = 0x100 SO_PEERCRED = 0x1022 SO_PROTOCOL = 0x1025 SO_RCVBUF = 0x1002 SO_RCVLOWAT = 0x1004 SO_RCVTIMEO = 0x1006 SO_REUSEADDR = 0x4 SO_REUSEPORT = 0x200 SO_RTABLE = 0x1021 SO_SNDBUF = 0x1001 SO_SNDLOWAT = 0x1003 SO_SNDTIMEO = 0x1005 SO_SPLICE = 0x1023 SO_TIMESTAMP = 0x800 SO_TYPE = 0x1008 SO_USELOOPBACK = 0x40 SO_ZEROIZE = 0x2000 S_BLKSIZE = 0x200 S_IEXEC = 0x40 S_IFBLK = 0x6000 S_IFCHR = 0x2000 S_IFDIR = 0x4000 S_IFIFO = 0x1000 S_IFLNK = 0xa000 S_IFMT = 0xf000 S_IFREG = 0x8000 S_IFSOCK = 0xc000 S_IREAD = 0x100 S_IRGRP = 0x20 S_IROTH = 0x4 S_IRUSR = 0x100 S_IRWXG = 0x38 S_IRWXO = 0x7 S_IRWXU = 0x1c0 S_ISGID = 0x400 S_ISTXT = 0x200 S_ISUID = 0x800 S_ISVTX = 0x200 S_IWGRP = 0x10 S_IWOTH = 0x2 S_IWRITE = 0x80 S_IWUSR = 0x80 S_IXGRP = 0x8 S_IXOTH = 0x1 S_IXUSR = 0x40 TCIFLUSH = 0x1 TCIOFF = 0x3 TCIOFLUSH = 0x3 TCION = 0x4 TCOFLUSH = 0x2 TCOOFF = 0x1 TCOON = 0x2 TCPOPT_EOL = 0x0 TCPOPT_MAXSEG = 0x2 TCPOPT_NOP = 0x1 TCPOPT_SACK = 0x5 TCPOPT_SACK_HDR = 0x1010500 TCPOPT_SACK_PERMITTED = 0x4 TCPOPT_SACK_PERMIT_HDR = 0x1010402 TCPOPT_SIGNATURE = 0x13 TCPOPT_TIMESTAMP = 0x8 TCPOPT_TSTAMP_HDR = 0x101080a TCPOPT_WINDOW = 0x3 TCP_INFO = 0x9 TCP_MAXSEG = 0x2 TCP_MAXWIN = 0xffff TCP_MAX_SACK = 0x3 TCP_MAX_WINSHIFT = 0xe TCP_MD5SIG = 0x4 TCP_MSS = 0x200 TCP_NODELAY = 0x1 TCP_NOPUSH = 0x10 TCP_SACKHOLE_LIMIT = 0x80 TCP_SACK_ENABLE = 0x8 TCSAFLUSH = 0x2 TIMER_ABSTIME = 0x1 TIMER_RELTIME = 0x0 TIOCCBRK = 0x2000747a TIOCCDTR = 0x20007478 TIOCCHKVERAUTH = 0x2000741e TIOCCLRVERAUTH = 0x2000741d TIOCCONS = 0x80047462 TIOCDRAIN = 0x2000745e TIOCEXCL = 0x2000740d TIOCEXT = 0x80047460 TIOCFLAG_CLOCAL = 0x2 TIOCFLAG_CRTSCTS = 0x4 TIOCFLAG_MDMBUF = 0x8 TIOCFLAG_PPS = 0x10 TIOCFLAG_SOFTCAR = 0x1 TIOCFLUSH = 0x80047410 TIOCGETA = 0x402c7413 TIOCGETD = 0x4004741a TIOCGFLAGS = 0x4004745d TIOCGPGRP = 0x40047477 TIOCGSID = 0x40047463 TIOCGTSTAMP = 0x4010745b TIOCGWINSZ = 0x40087468 TIOCMBIC = 0x8004746b TIOCMBIS = 0x8004746c TIOCMGET = 0x4004746a TIOCMODG = 0x4004746a TIOCMODS = 0x8004746d TIOCMSET = 0x8004746d TIOCM_CAR = 0x40 TIOCM_CD = 0x40 TIOCM_CTS = 0x20 TIOCM_DSR = 0x100 TIOCM_DTR = 0x2 TIOCM_LE = 0x1 TIOCM_RI = 0x80 TIOCM_RNG = 0x80 TIOCM_RTS = 0x4 TIOCM_SR = 0x10 TIOCM_ST = 0x8 TIOCNOTTY = 0x20007471 TIOCNXCL = 0x2000740e TIOCOUTQ = 0x40047473 TIOCPKT = 0x80047470 TIOCPKT_DATA = 0x0 TIOCPKT_DOSTOP = 0x20 TIOCPKT_FLUSHREAD = 0x1 TIOCPKT_FLUSHWRITE = 0x2 TIOCPKT_IOCTL = 0x40 TIOCPKT_NOSTOP = 0x10 TIOCPKT_START = 0x8 TIOCPKT_STOP = 0x4 TIOCREMOTE = 0x80047469 TIOCSBRK = 0x2000747b TIOCSCTTY = 0x20007461 TIOCSDTR = 0x20007479 TIOCSETA = 0x802c7414 TIOCSETAF = 0x802c7416 TIOCSETAW = 0x802c7415 TIOCSETD = 0x8004741b TIOCSETVERAUTH = 0x8004741c TIOCSFLAGS = 0x8004745c TIOCSIG = 0x8004745f TIOCSPGRP = 0x80047476 TIOCSTART = 0x2000746e TIOCSTAT = 0x20007465 TIOCSTOP = 0x2000746f TIOCSTSTAMP = 0x8008745a TIOCSWINSZ = 0x80087467 TIOCUCNTL = 0x80047466 TIOCUCNTL_CBRK = 0x7a TIOCUCNTL_SBRK = 0x7b TOSTOP = 0x400000 UTIME_NOW = -0x2 UTIME_OMIT = -0x1 VDISCARD = 0xf VDSUSP = 0xb VEOF = 0x0 VEOL = 0x1 VEOL2 = 0x2 VERASE = 0x3 VINTR = 0x8 VKILL = 0x5 VLNEXT = 0xe VMIN = 0x10 VM_ANONMIN = 0x7 VM_LOADAVG = 0x2 VM_MALLOC_CONF = 0xc VM_MAXID = 0xd VM_MAXSLP = 0xa VM_METER = 0x1 VM_NKMEMPAGES = 0x6 VM_PSSTRINGS = 0x3 VM_SWAPENCRYPT = 0x5 VM_USPACE = 0xb VM_UVMEXP = 0x4 VM_VNODEMIN = 0x9 VM_VTEXTMIN = 0x8 VQUIT = 0x9 VREPRINT = 0x6 VSTART = 0xc VSTATUS = 0x12 VSTOP = 0xd VSUSP = 0xa VTIME = 0x11 VWERASE = 0x4 WALTSIG = 0x4 WCONTINUED = 0x8 WCOREFLAG = 0x80 WNOHANG = 0x1 WUNTRACED = 0x2 XCASE = 0x1000000 ) // Errors const ( E2BIG = syscall.Errno(0x7) EACCES = syscall.Errno(0xd) EADDRINUSE = syscall.Errno(0x30) EADDRNOTAVAIL = syscall.Errno(0x31) EAFNOSUPPORT = syscall.Errno(0x2f) EAGAIN = syscall.Errno(0x23) EALREADY = syscall.Errno(0x25) EAUTH = syscall.Errno(0x50) EBADF = syscall.Errno(0x9) EBADMSG = syscall.Errno(0x5c) EBADRPC = syscall.Errno(0x48) EBUSY = syscall.Errno(0x10) ECANCELED = syscall.Errno(0x58) ECHILD = syscall.Errno(0xa) ECONNABORTED = syscall.Errno(0x35) ECONNREFUSED = syscall.Errno(0x3d) ECONNRESET = syscall.Errno(0x36) EDEADLK = syscall.Errno(0xb) EDESTADDRREQ = syscall.Errno(0x27) EDOM = syscall.Errno(0x21) EDQUOT = syscall.Errno(0x45) EEXIST = syscall.Errno(0x11) EFAULT = syscall.Errno(0xe) EFBIG = syscall.Errno(0x1b) EFTYPE = syscall.Errno(0x4f) EHOSTDOWN = syscall.Errno(0x40) EHOSTUNREACH = syscall.Errno(0x41) EIDRM = syscall.Errno(0x59) EILSEQ = syscall.Errno(0x54) EINPROGRESS = syscall.Errno(0x24) EINTR = syscall.Errno(0x4) EINVAL = syscall.Errno(0x16) EIO = syscall.Errno(0x5) EIPSEC = syscall.Errno(0x52) EISCONN = syscall.Errno(0x38) EISDIR = syscall.Errno(0x15) ELAST = syscall.Errno(0x5f) ELOOP = syscall.Errno(0x3e) EMEDIUMTYPE = syscall.Errno(0x56) EMFILE = syscall.Errno(0x18) EMLINK = syscall.Errno(0x1f) EMSGSIZE = syscall.Errno(0x28) ENAMETOOLONG = syscall.Errno(0x3f) ENEEDAUTH = syscall.Errno(0x51) ENETDOWN = syscall.Errno(0x32) ENETRESET = syscall.Errno(0x34) ENETUNREACH = syscall.Errno(0x33) ENFILE = syscall.Errno(0x17) ENOATTR = syscall.Errno(0x53) ENOBUFS = syscall.Errno(0x37) ENODEV = syscall.Errno(0x13) ENOENT = syscall.Errno(0x2) ENOEXEC = syscall.Errno(0x8) ENOLCK = syscall.Errno(0x4d) ENOMEDIUM = syscall.Errno(0x55) ENOMEM = syscall.Errno(0xc) ENOMSG = syscall.Errno(0x5a) ENOPROTOOPT = syscall.Errno(0x2a) ENOSPC = syscall.Errno(0x1c) ENOSYS = syscall.Errno(0x4e) ENOTBLK = syscall.Errno(0xf) ENOTCONN = syscall.Errno(0x39) ENOTDIR = syscall.Errno(0x14) ENOTEMPTY = syscall.Errno(0x42) ENOTRECOVERABLE = syscall.Errno(0x5d) ENOTSOCK = syscall.Errno(0x26) ENOTSUP = syscall.Errno(0x5b) ENOTTY = syscall.Errno(0x19) ENXIO = syscall.Errno(0x6) EOPNOTSUPP = syscall.Errno(0x2d) EOVERFLOW = syscall.Errno(0x57) EOWNERDEAD = syscall.Errno(0x5e) EPERM = syscall.Errno(0x1) EPFNOSUPPORT = syscall.Errno(0x2e) EPIPE = syscall.Errno(0x20) EPROCLIM = syscall.Errno(0x43) EPROCUNAVAIL = syscall.Errno(0x4c) EPROGMISMATCH = syscall.Errno(0x4b) EPROGUNAVAIL = syscall.Errno(0x4a) EPROTO = syscall.Errno(0x5f) EPROTONOSUPPORT = syscall.Errno(0x2b) EPROTOTYPE = syscall.Errno(0x29) ERANGE = syscall.Errno(0x22) EREMOTE = syscall.Errno(0x47) EROFS = syscall.Errno(0x1e) ERPCMISMATCH = syscall.Errno(0x49) ESHUTDOWN = syscall.Errno(0x3a) ESOCKTNOSUPPORT = syscall.Errno(0x2c) ESPIPE = syscall.Errno(0x1d) ESRCH = syscall.Errno(0x3) ESTALE = syscall.Errno(0x46) ETIMEDOUT = syscall.Errno(0x3c) ETOOMANYREFS = syscall.Errno(0x3b) ETXTBSY = syscall.Errno(0x1a) EUSERS = syscall.Errno(0x44) EWOULDBLOCK = syscall.Errno(0x23) EXDEV = syscall.Errno(0x12) ) // Signals const ( SIGABRT = syscall.Signal(0x6) SIGALRM = syscall.Signal(0xe) SIGBUS = syscall.Signal(0xa) SIGCHLD = syscall.Signal(0x14) SIGCONT = syscall.Signal(0x13) SIGEMT = syscall.Signal(0x7) SIGFPE = syscall.Signal(0x8) SIGHUP = syscall.Signal(0x1) SIGILL = syscall.Signal(0x4) SIGINFO = syscall.Signal(0x1d) SIGINT = syscall.Signal(0x2) SIGIO = syscall.Signal(0x17) SIGIOT = syscall.Signal(0x6) SIGKILL = syscall.Signal(0x9) SIGPIPE = syscall.Signal(0xd) SIGPROF = syscall.Signal(0x1b) SIGQUIT = syscall.Signal(0x3) SIGSEGV = syscall.Signal(0xb) SIGSTOP = syscall.Signal(0x11) SIGSYS = syscall.Signal(0xc) SIGTERM = syscall.Signal(0xf) SIGTHR = syscall.Signal(0x20) SIGTRAP = syscall.Signal(0x5) SIGTSTP = syscall.Signal(0x12) SIGTTIN = syscall.Signal(0x15) SIGTTOU = syscall.Signal(0x16) SIGURG = syscall.Signal(0x10) SIGUSR1 = syscall.Signal(0x1e) SIGUSR2 = syscall.Signal(0x1f) SIGVTALRM = syscall.Signal(0x1a) SIGWINCH = syscall.Signal(0x1c) SIGXCPU = syscall.Signal(0x18) SIGXFSZ = syscall.Signal(0x19) ) // Error table var errorList = [...]struct { num syscall.Errno name string desc string }{ {1, "EPERM", "operation not permitted"}, {2, "ENOENT", "no such file or directory"}, {3, "ESRCH", "no such process"}, {4, "EINTR", "interrupted system call"}, {5, "EIO", "input/output error"}, {6, "ENXIO", "device not configured"}, {7, "E2BIG", "argument list too long"}, {8, "ENOEXEC", "exec format error"}, {9, "EBADF", "bad file descriptor"}, {10, "ECHILD", "no child processes"}, {11, "EDEADLK", "resource deadlock avoided"}, {12, "ENOMEM", "cannot allocate memory"}, {13, "EACCES", "permission denied"}, {14, "EFAULT", "bad address"}, {15, "ENOTBLK", "block device required"}, {16, "EBUSY", "device busy"}, {17, "EEXIST", "file exists"}, {18, "EXDEV", "cross-device link"}, {19, "ENODEV", "operation not supported by device"}, {20, "ENOTDIR", "not a directory"}, {21, "EISDIR", "is a directory"}, {22, "EINVAL", "invalid argument"}, {23, "ENFILE", "too many open files in system"}, {24, "EMFILE", "too many open files"}, {25, "ENOTTY", "inappropriate ioctl for device"}, {26, "ETXTBSY", "text file busy"}, {27, "EFBIG", "file too large"}, {28, "ENOSPC", "no space left on device"}, {29, "ESPIPE", "illegal seek"}, {30, "EROFS", "read-only file system"}, {31, "EMLINK", "too many links"}, {32, "EPIPE", "broken pipe"}, {33, "EDOM", "numerical argument out of domain"}, {34, "ERANGE", "result too large"}, {35, "EAGAIN", "resource temporarily unavailable"}, {36, "EINPROGRESS", "operation now in progress"}, {37, "EALREADY", "operation already in progress"}, {38, "ENOTSOCK", "socket operation on non-socket"}, {39, "EDESTADDRREQ", "destination address required"}, {40, "EMSGSIZE", "message too long"}, {41, "EPROTOTYPE", "protocol wrong type for socket"}, {42, "ENOPROTOOPT", "protocol not available"}, {43, "EPROTONOSUPPORT", "protocol not supported"}, {44, "ESOCKTNOSUPPORT", "socket type not supported"}, {45, "EOPNOTSUPP", "operation not supported"}, {46, "EPFNOSUPPORT", "protocol family not supported"}, {47, "EAFNOSUPPORT", "address family not supported by protocol family"}, {48, "EADDRINUSE", "address already in use"}, {49, "EADDRNOTAVAIL", "can't assign requested address"}, {50, "ENETDOWN", "network is down"}, {51, "ENETUNREACH", "network is unreachable"}, {52, "ENETRESET", "network dropped connection on reset"}, {53, "ECONNABORTED", "software caused connection abort"}, {54, "ECONNRESET", "connection reset by peer"}, {55, "ENOBUFS", "no buffer space available"}, {56, "EISCONN", "socket is already connected"}, {57, "ENOTCONN", "socket is not connected"}, {58, "ESHUTDOWN", "can't send after socket shutdown"}, {59, "ETOOMANYREFS", "too many references: can't splice"}, {60, "ETIMEDOUT", "operation timed out"}, {61, "ECONNREFUSED", "connection refused"}, {62, "ELOOP", "too many levels of symbolic links"}, {63, "ENAMETOOLONG", "file name too long"}, {64, "EHOSTDOWN", "host is down"}, {65, "EHOSTUNREACH", "no route to host"}, {66, "ENOTEMPTY", "directory not empty"}, {67, "EPROCLIM", "too many processes"}, {68, "EUSERS", "too many users"}, {69, "EDQUOT", "disk quota exceeded"}, {70, "ESTALE", "stale NFS file handle"}, {71, "EREMOTE", "too many levels of remote in path"}, {72, "EBADRPC", "RPC struct is bad"}, {73, "ERPCMISMATCH", "RPC version wrong"}, {74, "EPROGUNAVAIL", "RPC program not available"}, {75, "EPROGMISMATCH", "program version wrong"}, {76, "EPROCUNAVAIL", "bad procedure for program"}, {77, "ENOLCK", "no locks available"}, {78, "ENOSYS", "function not implemented"}, {79, "EFTYPE", "inappropriate file type or format"}, {80, "EAUTH", "authentication error"}, {81, "ENEEDAUTH", "need authenticator"}, {82, "EIPSEC", "IPsec processing failure"}, {83, "ENOATTR", "attribute not found"}, {84, "EILSEQ", "illegal byte sequence"}, {85, "ENOMEDIUM", "no medium found"}, {86, "EMEDIUMTYPE", "wrong medium type"}, {87, "EOVERFLOW", "value too large to be stored in data type"}, {88, "ECANCELED", "operation canceled"}, {89, "EIDRM", "identifier removed"}, {90, "ENOMSG", "no message of desired type"}, {91, "ENOTSUP", "not supported"}, {92, "EBADMSG", "bad message"}, {93, "ENOTRECOVERABLE", "state not recoverable"}, {94, "EOWNERDEAD", "previous owner died"}, {95, "ELAST", "protocol error"}, } // Signal table var signalList = [...]struct { num syscall.Signal name string desc string }{ {1, "SIGHUP", "hangup"}, {2, "SIGINT", "interrupt"}, {3, "SIGQUIT", "quit"}, {4, "SIGILL", "illegal instruction"}, {5, "SIGTRAP", "trace/BPT trap"}, {6, "SIGIOT", "abort trap"}, {7, "SIGEMT", "EMT trap"}, {8, "SIGFPE", "floating point exception"}, {9, "SIGKILL", "killed"}, {10, "SIGBUS", "bus error"}, {11, "SIGSEGV", "segmentation fault"}, {12, "SIGSYS", "bad system call"}, {13, "SIGPIPE", "broken pipe"}, {14, "SIGALRM", "alarm clock"}, {15, "SIGTERM", "terminated"}, {16, "SIGURG", "urgent I/O condition"}, {17, "SIGSTOP", "suspended (signal)"}, {18, "SIGTSTP", "suspended"}, {19, "SIGCONT", "continued"}, {20, "SIGCHLD", "child exited"}, {21, "SIGTTIN", "stopped (tty input)"}, {22, "SIGTTOU", "stopped (tty output)"}, {23, "SIGIO", "I/O possible"}, {24, "SIGXCPU", "cputime limit exceeded"}, {25, "SIGXFSZ", "filesize limit exceeded"}, {26, "SIGVTALRM", "virtual timer expired"}, {27, "SIGPROF", "profiling timer expired"}, {28, "SIGWINCH", "window size changes"}, {29, "SIGINFO", "information request"}, {30, "SIGUSR1", "user defined signal 1"}, {31, "SIGUSR2", "user defined signal 2"}, {32, "SIGTHR", "thread AST"}, {28672, "SIGSTKSZ", "unknown signal"}, } ================================================ FILE: vendor/golang.org/x/sys/unix/zerrors_openbsd_arm64.go ================================================ // mkerrors.sh -m64 // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm64 && openbsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -m64 _const.go package unix import "syscall" const ( AF_APPLETALK = 0x10 AF_BLUETOOTH = 0x20 AF_CCITT = 0xa AF_CHAOS = 0x5 AF_CNT = 0x15 AF_COIP = 0x14 AF_DATAKIT = 0x9 AF_DECnet = 0xc AF_DLI = 0xd AF_E164 = 0x1a AF_ECMA = 0x8 AF_ENCAP = 0x1c AF_HYLINK = 0xf AF_IMPLINK = 0x3 AF_INET = 0x2 AF_INET6 = 0x18 AF_IPX = 0x17 AF_ISDN = 0x1a AF_ISO = 0x7 AF_KEY = 0x1e AF_LAT = 0xe AF_LINK = 0x12 AF_LOCAL = 0x1 AF_MAX = 0x24 AF_MPLS = 0x21 AF_NATM = 0x1b AF_NS = 0x6 AF_OSI = 0x7 AF_PUP = 0x4 AF_ROUTE = 0x11 AF_SIP = 0x1d AF_SNA = 0xb AF_UNIX = 0x1 AF_UNSPEC = 0x0 ALTWERASE = 0x200 ARPHRD_ETHER = 0x1 ARPHRD_FRELAY = 0xf ARPHRD_IEEE1394 = 0x18 ARPHRD_IEEE802 = 0x6 B0 = 0x0 B110 = 0x6e B115200 = 0x1c200 B1200 = 0x4b0 B134 = 0x86 B14400 = 0x3840 B150 = 0x96 B1800 = 0x708 B19200 = 0x4b00 B200 = 0xc8 B230400 = 0x38400 B2400 = 0x960 B28800 = 0x7080 B300 = 0x12c B38400 = 0x9600 B4800 = 0x12c0 B50 = 0x32 B57600 = 0xe100 B600 = 0x258 B7200 = 0x1c20 B75 = 0x4b B76800 = 0x12c00 B9600 = 0x2580 BIOCFLUSH = 0x20004268 BIOCGBLEN = 0x40044266 BIOCGDIRFILT = 0x4004427c BIOCGDLT = 0x4004426a BIOCGDLTLIST = 0xc010427b BIOCGETIF = 0x4020426b BIOCGFILDROP = 0x40044278 BIOCGHDRCMPLT = 0x40044274 BIOCGRSIG = 0x40044273 BIOCGRTIMEOUT = 0x4010426e BIOCGSTATS = 0x4008426f BIOCIMMEDIATE = 0x80044270 BIOCLOCK = 0x20004276 BIOCPROMISC = 0x20004269 BIOCSBLEN = 0xc0044266 BIOCSDIRFILT = 0x8004427d BIOCSDLT = 0x8004427a BIOCSETF = 0x80104267 BIOCSETIF = 0x8020426c BIOCSETWF = 0x80104277 BIOCSFILDROP = 0x80044279 BIOCSHDRCMPLT = 0x80044275 BIOCSRSIG = 0x80044272 BIOCSRTIMEOUT = 0x8010426d BIOCVERSION = 0x40044271 BPF_A = 0x10 BPF_ABS = 0x20 BPF_ADD = 0x0 BPF_ALIGNMENT = 0x4 BPF_ALU = 0x4 BPF_AND = 0x50 BPF_B = 0x10 BPF_DIRECTION_IN = 0x1 BPF_DIRECTION_OUT = 0x2 BPF_DIV = 0x30 BPF_FILDROP_CAPTURE = 0x1 BPF_FILDROP_DROP = 0x2 BPF_FILDROP_PASS = 0x0 BPF_F_DIR_IN = 0x10 BPF_F_DIR_MASK = 0x30 BPF_F_DIR_OUT = 0x20 BPF_F_DIR_SHIFT = 0x4 BPF_F_FLOWID = 0x8 BPF_F_PRI_MASK = 0x7 BPF_H = 0x8 BPF_IMM = 0x0 BPF_IND = 0x40 BPF_JA = 0x0 BPF_JEQ = 0x10 BPF_JGE = 0x30 BPF_JGT = 0x20 BPF_JMP = 0x5 BPF_JSET = 0x40 BPF_K = 0x0 BPF_LD = 0x0 BPF_LDX = 0x1 BPF_LEN = 0x80 BPF_LSH = 0x60 BPF_MAJOR_VERSION = 0x1 BPF_MAXBUFSIZE = 0x200000 BPF_MAXINSNS = 0x200 BPF_MEM = 0x60 BPF_MEMWORDS = 0x10 BPF_MINBUFSIZE = 0x20 BPF_MINOR_VERSION = 0x1 BPF_MISC = 0x7 BPF_MSH = 0xa0 BPF_MUL = 0x20 BPF_NEG = 0x80 BPF_OR = 0x40 BPF_RELEASE = 0x30bb6 BPF_RET = 0x6 BPF_RND = 0xc0 BPF_RSH = 0x70 BPF_ST = 0x2 BPF_STX = 0x3 BPF_SUB = 0x10 BPF_TAX = 0x0 BPF_TXA = 0x80 BPF_W = 0x0 BPF_X = 0x8 BRKINT = 0x2 CFLUSH = 0xf CLOCAL = 0x8000 CLOCK_BOOTTIME = 0x6 CLOCK_MONOTONIC = 0x3 CLOCK_PROCESS_CPUTIME_ID = 0x2 CLOCK_REALTIME = 0x0 CLOCK_THREAD_CPUTIME_ID = 0x4 CLOCK_UPTIME = 0x5 CPUSTATES = 0x6 CP_IDLE = 0x5 CP_INTR = 0x4 CP_NICE = 0x1 CP_SPIN = 0x3 CP_SYS = 0x2 CP_USER = 0x0 CREAD = 0x800 CRTSCTS = 0x10000 CS5 = 0x0 CS6 = 0x100 CS7 = 0x200 CS8 = 0x300 CSIZE = 0x300 CSTART = 0x11 CSTATUS = 0xff CSTOP = 0x13 CSTOPB = 0x400 CSUSP = 0x1a CTL_HW = 0x6 CTL_KERN = 0x1 CTL_MAXNAME = 0xc CTL_NET = 0x4 DIOCADDQUEUE = 0xc110445d DIOCADDRULE = 0xcd604404 DIOCADDSTATE = 0xc1084425 DIOCCHANGERULE = 0xcd60441a DIOCCLRIFFLAG = 0xc028445a DIOCCLRSRCNODES = 0x20004455 DIOCCLRSTATES = 0xc0e04412 DIOCCLRSTATUS = 0xc0284416 DIOCGETLIMIT = 0xc0084427 DIOCGETQSTATS = 0xc1204460 DIOCGETQUEUE = 0xc110445f DIOCGETQUEUES = 0xc110445e DIOCGETRULE = 0xcd604407 DIOCGETRULES = 0xcd604406 DIOCGETRULESET = 0xc444443b DIOCGETRULESETS = 0xc444443a DIOCGETSRCNODES = 0xc0104454 DIOCGETSTATE = 0xc1084413 DIOCGETSTATES = 0xc0104419 DIOCGETSTATUS = 0xc1e84415 DIOCGETSYNFLWATS = 0xc0084463 DIOCGETTIMEOUT = 0xc008441e DIOCIGETIFACES = 0xc0284457 DIOCKILLSRCNODES = 0xc080445b DIOCKILLSTATES = 0xc0e04429 DIOCNATLOOK = 0xc0504417 DIOCOSFPADD = 0xc088444f DIOCOSFPFLUSH = 0x2000444e DIOCOSFPGET = 0xc0884450 DIOCRADDADDRS = 0xc4504443 DIOCRADDTABLES = 0xc450443d DIOCRCLRADDRS = 0xc4504442 DIOCRCLRASTATS = 0xc4504448 DIOCRCLRTABLES = 0xc450443c DIOCRCLRTSTATS = 0xc4504441 DIOCRDELADDRS = 0xc4504444 DIOCRDELTABLES = 0xc450443e DIOCRGETADDRS = 0xc4504446 DIOCRGETASTATS = 0xc4504447 DIOCRGETTABLES = 0xc450443f DIOCRGETTSTATS = 0xc4504440 DIOCRINADEFINE = 0xc450444d DIOCRSETADDRS = 0xc4504445 DIOCRSETTFLAGS = 0xc450444a DIOCRTSTADDRS = 0xc4504449 DIOCSETDEBUG = 0xc0044418 DIOCSETHOSTID = 0xc0044456 DIOCSETIFFLAG = 0xc0284459 DIOCSETLIMIT = 0xc0084428 DIOCSETREASS = 0xc004445c DIOCSETSTATUSIF = 0xc0284414 DIOCSETSYNCOOKIES = 0xc0014462 DIOCSETSYNFLWATS = 0xc0084461 DIOCSETTIMEOUT = 0xc008441d DIOCSTART = 0x20004401 DIOCSTOP = 0x20004402 DIOCXBEGIN = 0xc0104451 DIOCXCOMMIT = 0xc0104452 DIOCXROLLBACK = 0xc0104453 DLT_ARCNET = 0x7 DLT_ATM_RFC1483 = 0xb DLT_AX25 = 0x3 DLT_CHAOS = 0x5 DLT_C_HDLC = 0x68 DLT_EN10MB = 0x1 DLT_EN3MB = 0x2 DLT_ENC = 0xd DLT_FDDI = 0xa DLT_IEEE802 = 0x6 DLT_IEEE802_11 = 0x69 DLT_IEEE802_11_RADIO = 0x7f DLT_LOOP = 0xc DLT_MPLS = 0xdb DLT_NULL = 0x0 DLT_OPENFLOW = 0x10b DLT_PFLOG = 0x75 DLT_PFSYNC = 0x12 DLT_PPP = 0x9 DLT_PPP_BSDOS = 0x10 DLT_PPP_ETHER = 0x33 DLT_PPP_SERIAL = 0x32 DLT_PRONET = 0x4 DLT_RAW = 0xe DLT_SLIP = 0x8 DLT_SLIP_BSDOS = 0xf DLT_USBPCAP = 0xf9 DLT_USER0 = 0x93 DLT_USER1 = 0x94 DLT_USER10 = 0x9d DLT_USER11 = 0x9e DLT_USER12 = 0x9f DLT_USER13 = 0xa0 DLT_USER14 = 0xa1 DLT_USER15 = 0xa2 DLT_USER2 = 0x95 DLT_USER3 = 0x96 DLT_USER4 = 0x97 DLT_USER5 = 0x98 DLT_USER6 = 0x99 DLT_USER7 = 0x9a DLT_USER8 = 0x9b DLT_USER9 = 0x9c DT_BLK = 0x6 DT_CHR = 0x2 DT_DIR = 0x4 DT_FIFO = 0x1 DT_LNK = 0xa DT_REG = 0x8 DT_SOCK = 0xc DT_UNKNOWN = 0x0 ECHO = 0x8 ECHOCTL = 0x40 ECHOE = 0x2 ECHOK = 0x4 ECHOKE = 0x1 ECHONL = 0x10 ECHOPRT = 0x20 EMT_TAGOVF = 0x1 EMUL_ENABLED = 0x1 EMUL_NATIVE = 0x2 ENDRUNDISC = 0x9 ETH64_8021_RSVD_MASK = 0xfffffffffff0 ETH64_8021_RSVD_PREFIX = 0x180c2000000 ETHERMIN = 0x2e ETHERMTU = 0x5dc ETHERTYPE_8023 = 0x4 ETHERTYPE_AARP = 0x80f3 ETHERTYPE_ACCTON = 0x8390 ETHERTYPE_AEONIC = 0x8036 ETHERTYPE_ALPHA = 0x814a ETHERTYPE_AMBER = 0x6008 ETHERTYPE_AMOEBA = 0x8145 ETHERTYPE_AOE = 0x88a2 ETHERTYPE_APOLLO = 0x80f7 ETHERTYPE_APOLLODOMAIN = 0x8019 ETHERTYPE_APPLETALK = 0x809b ETHERTYPE_APPLITEK = 0x80c7 ETHERTYPE_ARGONAUT = 0x803a ETHERTYPE_ARP = 0x806 ETHERTYPE_AT = 0x809b ETHERTYPE_ATALK = 0x809b ETHERTYPE_ATOMIC = 0x86df ETHERTYPE_ATT = 0x8069 ETHERTYPE_ATTSTANFORD = 0x8008 ETHERTYPE_AUTOPHON = 0x806a ETHERTYPE_AXIS = 0x8856 ETHERTYPE_BCLOOP = 0x9003 ETHERTYPE_BOFL = 0x8102 ETHERTYPE_CABLETRON = 0x7034 ETHERTYPE_CHAOS = 0x804 ETHERTYPE_COMDESIGN = 0x806c ETHERTYPE_COMPUGRAPHIC = 0x806d ETHERTYPE_COUNTERPOINT = 0x8062 ETHERTYPE_CRONUS = 0x8004 ETHERTYPE_CRONUSVLN = 0x8003 ETHERTYPE_DCA = 0x1234 ETHERTYPE_DDE = 0x807b ETHERTYPE_DEBNI = 0xaaaa ETHERTYPE_DECAM = 0x8048 ETHERTYPE_DECCUST = 0x6006 ETHERTYPE_DECDIAG = 0x6005 ETHERTYPE_DECDNS = 0x803c ETHERTYPE_DECDTS = 0x803e ETHERTYPE_DECEXPER = 0x6000 ETHERTYPE_DECLAST = 0x8041 ETHERTYPE_DECLTM = 0x803f ETHERTYPE_DECMUMPS = 0x6009 ETHERTYPE_DECNETBIOS = 0x8040 ETHERTYPE_DELTACON = 0x86de ETHERTYPE_DIDDLE = 0x4321 ETHERTYPE_DLOG1 = 0x660 ETHERTYPE_DLOG2 = 0x661 ETHERTYPE_DN = 0x6003 ETHERTYPE_DOGFIGHT = 0x1989 ETHERTYPE_DSMD = 0x8039 ETHERTYPE_EAPOL = 0x888e ETHERTYPE_ECMA = 0x803 ETHERTYPE_ENCRYPT = 0x803d ETHERTYPE_ES = 0x805d ETHERTYPE_EXCELAN = 0x8010 ETHERTYPE_EXPERDATA = 0x8049 ETHERTYPE_FLIP = 0x8146 ETHERTYPE_FLOWCONTROL = 0x8808 ETHERTYPE_FRARP = 0x808 ETHERTYPE_GENDYN = 0x8068 ETHERTYPE_HAYES = 0x8130 ETHERTYPE_HIPPI_FP = 0x8180 ETHERTYPE_HITACHI = 0x8820 ETHERTYPE_HP = 0x8005 ETHERTYPE_IEEEPUP = 0xa00 ETHERTYPE_IEEEPUPAT = 0xa01 ETHERTYPE_IMLBL = 0x4c42 ETHERTYPE_IMLBLDIAG = 0x424c ETHERTYPE_IP = 0x800 ETHERTYPE_IPAS = 0x876c ETHERTYPE_IPV6 = 0x86dd ETHERTYPE_IPX = 0x8137 ETHERTYPE_IPXNEW = 0x8037 ETHERTYPE_KALPANA = 0x8582 ETHERTYPE_LANBRIDGE = 0x8038 ETHERTYPE_LANPROBE = 0x8888 ETHERTYPE_LAT = 0x6004 ETHERTYPE_LBACK = 0x9000 ETHERTYPE_LITTLE = 0x8060 ETHERTYPE_LLDP = 0x88cc ETHERTYPE_LOGICRAFT = 0x8148 ETHERTYPE_LOOPBACK = 0x9000 ETHERTYPE_MACSEC = 0x88e5 ETHERTYPE_MATRA = 0x807a ETHERTYPE_MAX = 0xffff ETHERTYPE_MERIT = 0x807c ETHERTYPE_MICP = 0x873a ETHERTYPE_MOPDL = 0x6001 ETHERTYPE_MOPRC = 0x6002 ETHERTYPE_MOTOROLA = 0x818d ETHERTYPE_MPLS = 0x8847 ETHERTYPE_MPLS_MCAST = 0x8848 ETHERTYPE_MUMPS = 0x813f ETHERTYPE_NBPCC = 0x3c04 ETHERTYPE_NBPCLAIM = 0x3c09 ETHERTYPE_NBPCLREQ = 0x3c05 ETHERTYPE_NBPCLRSP = 0x3c06 ETHERTYPE_NBPCREQ = 0x3c02 ETHERTYPE_NBPCRSP = 0x3c03 ETHERTYPE_NBPDG = 0x3c07 ETHERTYPE_NBPDGB = 0x3c08 ETHERTYPE_NBPDLTE = 0x3c0a ETHERTYPE_NBPRAR = 0x3c0c ETHERTYPE_NBPRAS = 0x3c0b ETHERTYPE_NBPRST = 0x3c0d ETHERTYPE_NBPSCD = 0x3c01 ETHERTYPE_NBPVCD = 0x3c00 ETHERTYPE_NBS = 0x802 ETHERTYPE_NCD = 0x8149 ETHERTYPE_NESTAR = 0x8006 ETHERTYPE_NETBEUI = 0x8191 ETHERTYPE_NHRP = 0x2001 ETHERTYPE_NOVELL = 0x8138 ETHERTYPE_NS = 0x600 ETHERTYPE_NSAT = 0x601 ETHERTYPE_NSCOMPAT = 0x807 ETHERTYPE_NSH = 0x984f ETHERTYPE_NTRAILER = 0x10 ETHERTYPE_OS9 = 0x7007 ETHERTYPE_OS9NET = 0x7009 ETHERTYPE_PACER = 0x80c6 ETHERTYPE_PBB = 0x88e7 ETHERTYPE_PCS = 0x4242 ETHERTYPE_PLANNING = 0x8044 ETHERTYPE_PPP = 0x880b ETHERTYPE_PPPOE = 0x8864 ETHERTYPE_PPPOEDISC = 0x8863 ETHERTYPE_PRIMENTS = 0x7031 ETHERTYPE_PUP = 0x200 ETHERTYPE_PUPAT = 0x200 ETHERTYPE_QINQ = 0x88a8 ETHERTYPE_RACAL = 0x7030 ETHERTYPE_RATIONAL = 0x8150 ETHERTYPE_RAWFR = 0x6559 ETHERTYPE_RCL = 0x1995 ETHERTYPE_RDP = 0x8739 ETHERTYPE_RETIX = 0x80f2 ETHERTYPE_REVARP = 0x8035 ETHERTYPE_SCA = 0x6007 ETHERTYPE_SECTRA = 0x86db ETHERTYPE_SECUREDATA = 0x876d ETHERTYPE_SGITW = 0x817e ETHERTYPE_SG_BOUNCE = 0x8016 ETHERTYPE_SG_DIAG = 0x8013 ETHERTYPE_SG_NETGAMES = 0x8014 ETHERTYPE_SG_RESV = 0x8015 ETHERTYPE_SIMNET = 0x5208 ETHERTYPE_SLOW = 0x8809 ETHERTYPE_SNA = 0x80d5 ETHERTYPE_SNMP = 0x814c ETHERTYPE_SONIX = 0xfaf5 ETHERTYPE_SPIDER = 0x809f ETHERTYPE_SPRITE = 0x500 ETHERTYPE_STP = 0x8181 ETHERTYPE_TALARIS = 0x812b ETHERTYPE_TALARISMC = 0x852b ETHERTYPE_TCPCOMP = 0x876b ETHERTYPE_TCPSM = 0x9002 ETHERTYPE_TEC = 0x814f ETHERTYPE_TIGAN = 0x802f ETHERTYPE_TRAIL = 0x1000 ETHERTYPE_TRANSETHER = 0x6558 ETHERTYPE_TYMSHARE = 0x802e ETHERTYPE_UBBST = 0x7005 ETHERTYPE_UBDEBUG = 0x900 ETHERTYPE_UBDIAGLOOP = 0x7002 ETHERTYPE_UBDL = 0x7000 ETHERTYPE_UBNIU = 0x7001 ETHERTYPE_UBNMC = 0x7003 ETHERTYPE_VALID = 0x1600 ETHERTYPE_VARIAN = 0x80dd ETHERTYPE_VAXELN = 0x803b ETHERTYPE_VEECO = 0x8067 ETHERTYPE_VEXP = 0x805b ETHERTYPE_VGLAB = 0x8131 ETHERTYPE_VINES = 0xbad ETHERTYPE_VINESECHO = 0xbaf ETHERTYPE_VINESLOOP = 0xbae ETHERTYPE_VITAL = 0xff00 ETHERTYPE_VLAN = 0x8100 ETHERTYPE_VLTLMAN = 0x8080 ETHERTYPE_VPROD = 0x805c ETHERTYPE_VURESERVED = 0x8147 ETHERTYPE_WATERLOO = 0x8130 ETHERTYPE_WELLFLEET = 0x8103 ETHERTYPE_X25 = 0x805 ETHERTYPE_X75 = 0x801 ETHERTYPE_XNSSM = 0x9001 ETHERTYPE_XTP = 0x817d ETHER_ADDR_LEN = 0x6 ETHER_ALIGN = 0x2 ETHER_CRC_LEN = 0x4 ETHER_CRC_POLY_BE = 0x4c11db6 ETHER_CRC_POLY_LE = 0xedb88320 ETHER_HDR_LEN = 0xe ETHER_MAX_DIX_LEN = 0x600 ETHER_MAX_HARDMTU_LEN = 0xff9b ETHER_MAX_LEN = 0x5ee ETHER_MIN_LEN = 0x40 ETHER_TYPE_LEN = 0x2 ETHER_VLAN_ENCAP_LEN = 0x4 EVFILT_AIO = -0x3 EVFILT_DEVICE = -0x8 EVFILT_EXCEPT = -0x9 EVFILT_PROC = -0x5 EVFILT_READ = -0x1 EVFILT_SIGNAL = -0x6 EVFILT_SYSCOUNT = 0x9 EVFILT_TIMER = -0x7 EVFILT_VNODE = -0x4 EVFILT_WRITE = -0x2 EVL_ENCAPLEN = 0x4 EVL_PRIO_BITS = 0xd EVL_PRIO_MAX = 0x7 EVL_VLID_MASK = 0xfff EVL_VLID_MAX = 0xffe EVL_VLID_MIN = 0x1 EVL_VLID_NULL = 0x0 EV_ADD = 0x1 EV_CLEAR = 0x20 EV_DELETE = 0x2 EV_DISABLE = 0x8 EV_DISPATCH = 0x80 EV_ENABLE = 0x4 EV_EOF = 0x8000 EV_ERROR = 0x4000 EV_FLAG1 = 0x2000 EV_ONESHOT = 0x10 EV_RECEIPT = 0x40 EV_SYSFLAGS = 0xf800 EXTA = 0x4b00 EXTB = 0x9600 EXTPROC = 0x800 FD_CLOEXEC = 0x1 FD_SETSIZE = 0x400 FLUSHO = 0x800000 F_DUPFD = 0x0 F_DUPFD_CLOEXEC = 0xa F_GETFD = 0x1 F_GETFL = 0x3 F_GETLK = 0x7 F_GETOWN = 0x5 F_ISATTY = 0xb F_OK = 0x0 F_RDLCK = 0x1 F_SETFD = 0x2 F_SETFL = 0x4 F_SETLK = 0x8 F_SETLKW = 0x9 F_SETOWN = 0x6 F_UNLCK = 0x2 F_WRLCK = 0x3 HUPCL = 0x4000 HW_MACHINE = 0x1 ICANON = 0x100 ICMP6_FILTER = 0x12 ICRNL = 0x100 IEXTEN = 0x400 IFAN_ARRIVAL = 0x0 IFAN_DEPARTURE = 0x1 IFF_ALLMULTI = 0x200 IFF_BROADCAST = 0x2 IFF_CANTCHANGE = 0x8e52 IFF_DEBUG = 0x4 IFF_LINK0 = 0x1000 IFF_LINK1 = 0x2000 IFF_LINK2 = 0x4000 IFF_LOOPBACK = 0x8 IFF_MULTICAST = 0x8000 IFF_NOARP = 0x80 IFF_OACTIVE = 0x400 IFF_POINTOPOINT = 0x10 IFF_PROMISC = 0x100 IFF_RUNNING = 0x40 IFF_SIMPLEX = 0x800 IFF_STATICARP = 0x20 IFF_UP = 0x1 IFNAMSIZ = 0x10 IFT_1822 = 0x2 IFT_A12MPPSWITCH = 0x82 IFT_AAL2 = 0xbb IFT_AAL5 = 0x31 IFT_ADSL = 0x5e IFT_AFLANE8023 = 0x3b IFT_AFLANE8025 = 0x3c IFT_ARAP = 0x58 IFT_ARCNET = 0x23 IFT_ARCNETPLUS = 0x24 IFT_ASYNC = 0x54 IFT_ATM = 0x25 IFT_ATMDXI = 0x69 IFT_ATMFUNI = 0x6a IFT_ATMIMA = 0x6b IFT_ATMLOGICAL = 0x50 IFT_ATMRADIO = 0xbd IFT_ATMSUBINTERFACE = 0x86 IFT_ATMVCIENDPT = 0xc2 IFT_ATMVIRTUAL = 0x95 IFT_BGPPOLICYACCOUNTING = 0xa2 IFT_BLUETOOTH = 0xf8 IFT_BRIDGE = 0xd1 IFT_BSC = 0x53 IFT_CARP = 0xf7 IFT_CCTEMUL = 0x3d IFT_CEPT = 0x13 IFT_CES = 0x85 IFT_CHANNEL = 0x46 IFT_CNR = 0x55 IFT_COFFEE = 0x84 IFT_COMPOSITELINK = 0x9b IFT_DCN = 0x8d IFT_DIGITALPOWERLINE = 0x8a IFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba IFT_DLSW = 0x4a IFT_DOCSCABLEDOWNSTREAM = 0x80 IFT_DOCSCABLEMACLAYER = 0x7f IFT_DOCSCABLEUPSTREAM = 0x81 IFT_DOCSCABLEUPSTREAMCHANNEL = 0xcd IFT_DS0 = 0x51 IFT_DS0BUNDLE = 0x52 IFT_DS1FDL = 0xaa IFT_DS3 = 0x1e IFT_DTM = 0x8c IFT_DUMMY = 0xf1 IFT_DVBASILN = 0xac IFT_DVBASIOUT = 0xad IFT_DVBRCCDOWNSTREAM = 0x93 IFT_DVBRCCMACLAYER = 0x92 IFT_DVBRCCUPSTREAM = 0x94 IFT_ECONET = 0xce IFT_ENC = 0xf4 IFT_EON = 0x19 IFT_EPLRS = 0x57 IFT_ESCON = 0x49 IFT_ETHER = 0x6 IFT_FAITH = 0xf3 IFT_FAST = 0x7d IFT_FASTETHER = 0x3e IFT_FASTETHERFX = 0x45 IFT_FDDI = 0xf IFT_FIBRECHANNEL = 0x38 IFT_FRAMERELAYINTERCONNECT = 0x3a IFT_FRAMERELAYMPI = 0x5c IFT_FRDLCIENDPT = 0xc1 IFT_FRELAY = 0x20 IFT_FRELAYDCE = 0x2c IFT_FRF16MFRBUNDLE = 0xa3 IFT_FRFORWARD = 0x9e IFT_G703AT2MB = 0x43 IFT_G703AT64K = 0x42 IFT_GIF = 0xf0 IFT_GIGABITETHERNET = 0x75 IFT_GR303IDT = 0xb2 IFT_GR303RDT = 0xb1 IFT_H323GATEKEEPER = 0xa4 IFT_H323PROXY = 0xa5 IFT_HDH1822 = 0x3 IFT_HDLC = 0x76 IFT_HDSL2 = 0xa8 IFT_HIPERLAN2 = 0xb7 IFT_HIPPI = 0x2f IFT_HIPPIINTERFACE = 0x39 IFT_HOSTPAD = 0x5a IFT_HSSI = 0x2e IFT_HY = 0xe IFT_IBM370PARCHAN = 0x48 IFT_IDSL = 0x9a IFT_IEEE1394 = 0x90 IFT_IEEE80211 = 0x47 IFT_IEEE80212 = 0x37 IFT_IEEE8023ADLAG = 0xa1 IFT_IFGSN = 0x91 IFT_IMT = 0xbe IFT_INFINIBAND = 0xc7 IFT_INTERLEAVE = 0x7c IFT_IP = 0x7e IFT_IPFORWARD = 0x8e IFT_IPOVERATM = 0x72 IFT_IPOVERCDLC = 0x6d IFT_IPOVERCLAW = 0x6e IFT_IPSWITCH = 0x4e IFT_ISDN = 0x3f IFT_ISDNBASIC = 0x14 IFT_ISDNPRIMARY = 0x15 IFT_ISDNS = 0x4b IFT_ISDNU = 0x4c IFT_ISO88022LLC = 0x29 IFT_ISO88023 = 0x7 IFT_ISO88024 = 0x8 IFT_ISO88025 = 0x9 IFT_ISO88025CRFPINT = 0x62 IFT_ISO88025DTR = 0x56 IFT_ISO88025FIBER = 0x73 IFT_ISO88026 = 0xa IFT_ISUP = 0xb3 IFT_L2VLAN = 0x87 IFT_L3IPVLAN = 0x88 IFT_L3IPXVLAN = 0x89 IFT_LAPB = 0x10 IFT_LAPD = 0x4d IFT_LAPF = 0x77 IFT_LINEGROUP = 0xd2 IFT_LOCALTALK = 0x2a IFT_LOOP = 0x18 IFT_MBIM = 0xfa IFT_MEDIAMAILOVERIP = 0x8b IFT_MFSIGLINK = 0xa7 IFT_MIOX25 = 0x26 IFT_MODEM = 0x30 IFT_MPC = 0x71 IFT_MPLS = 0xa6 IFT_MPLSTUNNEL = 0x96 IFT_MSDSL = 0x8f IFT_MVL = 0xbf IFT_MYRINET = 0x63 IFT_NFAS = 0xaf IFT_NSIP = 0x1b IFT_OPTICALCHANNEL = 0xc3 IFT_OPTICALTRANSPORT = 0xc4 IFT_OTHER = 0x1 IFT_P10 = 0xc IFT_P80 = 0xd IFT_PARA = 0x22 IFT_PFLOG = 0xf5 IFT_PFLOW = 0xf9 IFT_PFSYNC = 0xf6 IFT_PLC = 0xae IFT_PON155 = 0xcf IFT_PON622 = 0xd0 IFT_POS = 0xab IFT_PPP = 0x17 IFT_PPPMULTILINKBUNDLE = 0x6c IFT_PROPATM = 0xc5 IFT_PROPBWAP2MP = 0xb8 IFT_PROPCNLS = 0x59 IFT_PROPDOCSWIRELESSDOWNSTREAM = 0xb5 IFT_PROPDOCSWIRELESSMACLAYER = 0xb4 IFT_PROPDOCSWIRELESSUPSTREAM = 0xb6 IFT_PROPMUX = 0x36 IFT_PROPVIRTUAL = 0x35 IFT_PROPWIRELESSP2P = 0x9d IFT_PTPSERIAL = 0x16 IFT_PVC = 0xf2 IFT_Q2931 = 0xc9 IFT_QLLC = 0x44 IFT_RADIOMAC = 0xbc IFT_RADSL = 0x5f IFT_REACHDSL = 0xc0 IFT_RFC1483 = 0x9f IFT_RS232 = 0x21 IFT_RSRB = 0x4f IFT_SDLC = 0x11 IFT_SDSL = 0x60 IFT_SHDSL = 0xa9 IFT_SIP = 0x1f IFT_SIPSIG = 0xcc IFT_SIPTG = 0xcb IFT_SLIP = 0x1c IFT_SMDSDXI = 0x2b IFT_SMDSICIP = 0x34 IFT_SONET = 0x27 IFT_SONETOVERHEADCHANNEL = 0xb9 IFT_SONETPATH = 0x32 IFT_SONETVT = 0x33 IFT_SRP = 0x97 IFT_SS7SIGLINK = 0x9c IFT_STACKTOSTACK = 0x6f IFT_STARLAN = 0xb IFT_T1 = 0x12 IFT_TDLC = 0x74 IFT_TELINK = 0xc8 IFT_TERMPAD = 0x5b IFT_TR008 = 0xb0 IFT_TRANSPHDLC = 0x7b IFT_TUNNEL = 0x83 IFT_ULTRA = 0x1d IFT_USB = 0xa0 IFT_V11 = 0x40 IFT_V35 = 0x2d IFT_V36 = 0x41 IFT_V37 = 0x78 IFT_VDSL = 0x61 IFT_VIRTUALIPADDRESS = 0x70 IFT_VIRTUALTG = 0xca IFT_VOICEDID = 0xd5 IFT_VOICEEM = 0x64 IFT_VOICEEMFGD = 0xd3 IFT_VOICEENCAP = 0x67 IFT_VOICEFGDEANA = 0xd4 IFT_VOICEFXO = 0x65 IFT_VOICEFXS = 0x66 IFT_VOICEOVERATM = 0x98 IFT_VOICEOVERCABLE = 0xc6 IFT_VOICEOVERFRAMERELAY = 0x99 IFT_VOICEOVERIP = 0x68 IFT_WIREGUARD = 0xfb IFT_X213 = 0x5d IFT_X25 = 0x5 IFT_X25DDN = 0x4 IFT_X25HUNTGROUP = 0x7a IFT_X25MLP = 0x79 IFT_X25PLE = 0x28 IFT_XETHER = 0x1a IGNBRK = 0x1 IGNCR = 0x80 IGNPAR = 0x4 IMAXBEL = 0x2000 INLCR = 0x40 INPCK = 0x10 IN_CLASSA_HOST = 0xffffff IN_CLASSA_MAX = 0x80 IN_CLASSA_NET = 0xff000000 IN_CLASSA_NSHIFT = 0x18 IN_CLASSB_HOST = 0xffff IN_CLASSB_MAX = 0x10000 IN_CLASSB_NET = 0xffff0000 IN_CLASSB_NSHIFT = 0x10 IN_CLASSC_HOST = 0xff IN_CLASSC_NET = 0xffffff00 IN_CLASSC_NSHIFT = 0x8 IN_CLASSD_HOST = 0xfffffff IN_CLASSD_NET = 0xf0000000 IN_CLASSD_NSHIFT = 0x1c IN_LOOPBACKNET = 0x7f IN_RFC3021_HOST = 0x1 IN_RFC3021_NET = 0xfffffffe IN_RFC3021_NSHIFT = 0x1f IPPROTO_AH = 0x33 IPPROTO_CARP = 0x70 IPPROTO_DIVERT = 0x102 IPPROTO_DONE = 0x101 IPPROTO_DSTOPTS = 0x3c IPPROTO_EGP = 0x8 IPPROTO_ENCAP = 0x62 IPPROTO_EON = 0x50 IPPROTO_ESP = 0x32 IPPROTO_ETHERIP = 0x61 IPPROTO_FRAGMENT = 0x2c IPPROTO_GGP = 0x3 IPPROTO_GRE = 0x2f IPPROTO_HOPOPTS = 0x0 IPPROTO_ICMP = 0x1 IPPROTO_ICMPV6 = 0x3a IPPROTO_IDP = 0x16 IPPROTO_IGMP = 0x2 IPPROTO_IP = 0x0 IPPROTO_IPCOMP = 0x6c IPPROTO_IPIP = 0x4 IPPROTO_IPV4 = 0x4 IPPROTO_IPV6 = 0x29 IPPROTO_MAX = 0x100 IPPROTO_MAXID = 0x103 IPPROTO_MOBILE = 0x37 IPPROTO_MPLS = 0x89 IPPROTO_NONE = 0x3b IPPROTO_PFSYNC = 0xf0 IPPROTO_PIM = 0x67 IPPROTO_PUP = 0xc IPPROTO_RAW = 0xff IPPROTO_ROUTING = 0x2b IPPROTO_RSVP = 0x2e IPPROTO_SCTP = 0x84 IPPROTO_TCP = 0x6 IPPROTO_TP = 0x1d IPPROTO_UDP = 0x11 IPPROTO_UDPLITE = 0x88 IPV6_AUTH_LEVEL = 0x35 IPV6_AUTOFLOWLABEL = 0x3b IPV6_CHECKSUM = 0x1a IPV6_DEFAULT_MULTICAST_HOPS = 0x1 IPV6_DEFAULT_MULTICAST_LOOP = 0x1 IPV6_DEFHLIM = 0x40 IPV6_DONTFRAG = 0x3e IPV6_DSTOPTS = 0x32 IPV6_ESP_NETWORK_LEVEL = 0x37 IPV6_ESP_TRANS_LEVEL = 0x36 IPV6_FAITH = 0x1d IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_MASK = 0xffff0f00 IPV6_FRAGTTL = 0x78 IPV6_HLIMDEC = 0x1 IPV6_HOPLIMIT = 0x2f IPV6_HOPOPTS = 0x31 IPV6_IPCOMP_LEVEL = 0x3c IPV6_JOIN_GROUP = 0xc IPV6_LEAVE_GROUP = 0xd IPV6_MAXHLIM = 0xff IPV6_MAXPACKET = 0xffff IPV6_MINHOPCOUNT = 0x41 IPV6_MMTU = 0x500 IPV6_MULTICAST_HOPS = 0xa IPV6_MULTICAST_IF = 0x9 IPV6_MULTICAST_LOOP = 0xb IPV6_NEXTHOP = 0x30 IPV6_OPTIONS = 0x1 IPV6_PATHMTU = 0x2c IPV6_PIPEX = 0x3f IPV6_PKTINFO = 0x2e IPV6_PORTRANGE = 0xe IPV6_PORTRANGE_DEFAULT = 0x0 IPV6_PORTRANGE_HIGH = 0x1 IPV6_PORTRANGE_LOW = 0x2 IPV6_RECVDSTOPTS = 0x28 IPV6_RECVDSTPORT = 0x40 IPV6_RECVHOPLIMIT = 0x25 IPV6_RECVHOPOPTS = 0x27 IPV6_RECVPATHMTU = 0x2b IPV6_RECVPKTINFO = 0x24 IPV6_RECVRTHDR = 0x26 IPV6_RECVTCLASS = 0x39 IPV6_RTABLE = 0x1021 IPV6_RTHDR = 0x33 IPV6_RTHDRDSTOPTS = 0x23 IPV6_RTHDR_LOOSE = 0x0 IPV6_RTHDR_STRICT = 0x1 IPV6_RTHDR_TYPE_0 = 0x0 IPV6_SOCKOPT_RESERVED1 = 0x3 IPV6_TCLASS = 0x3d IPV6_UNICAST_HOPS = 0x4 IPV6_USE_MIN_MTU = 0x2a IPV6_V6ONLY = 0x1b IPV6_VERSION = 0x60 IPV6_VERSION_MASK = 0xf0 IP_ADD_MEMBERSHIP = 0xc IP_AUTH_LEVEL = 0x14 IP_DEFAULT_MULTICAST_LOOP = 0x1 IP_DEFAULT_MULTICAST_TTL = 0x1 IP_DF = 0x4000 IP_DROP_MEMBERSHIP = 0xd IP_ESP_NETWORK_LEVEL = 0x16 IP_ESP_TRANS_LEVEL = 0x15 IP_HDRINCL = 0x2 IP_IPCOMP_LEVEL = 0x1d IP_IPDEFTTL = 0x25 IP_IPSECFLOWINFO = 0x24 IP_IPSEC_LOCAL_AUTH = 0x1b IP_IPSEC_LOCAL_CRED = 0x19 IP_IPSEC_LOCAL_ID = 0x17 IP_IPSEC_REMOTE_AUTH = 0x1c IP_IPSEC_REMOTE_CRED = 0x1a IP_IPSEC_REMOTE_ID = 0x18 IP_MAXPACKET = 0xffff IP_MAX_MEMBERSHIPS = 0xfff IP_MF = 0x2000 IP_MINTTL = 0x20 IP_MIN_MEMBERSHIPS = 0xf IP_MSS = 0x240 IP_MULTICAST_IF = 0x9 IP_MULTICAST_LOOP = 0xb IP_MULTICAST_TTL = 0xa IP_OFFMASK = 0x1fff IP_OPTIONS = 0x1 IP_PIPEX = 0x22 IP_PORTRANGE = 0x13 IP_PORTRANGE_DEFAULT = 0x0 IP_PORTRANGE_HIGH = 0x1 IP_PORTRANGE_LOW = 0x2 IP_RECVDSTADDR = 0x7 IP_RECVDSTPORT = 0x21 IP_RECVIF = 0x1e IP_RECVOPTS = 0x5 IP_RECVRETOPTS = 0x6 IP_RECVRTABLE = 0x23 IP_RECVTTL = 0x1f IP_RETOPTS = 0x8 IP_RF = 0x8000 IP_RTABLE = 0x1021 IP_SENDSRCADDR = 0x7 IP_TOS = 0x3 IP_TTL = 0x4 ISIG = 0x80 ISTRIP = 0x20 ITIMER_PROF = 0x2 ITIMER_REAL = 0x0 ITIMER_VIRTUAL = 0x1 IUCLC = 0x1000 IXANY = 0x800 IXOFF = 0x400 IXON = 0x200 KERN_HOSTNAME = 0xa KERN_OSRELEASE = 0x2 KERN_OSTYPE = 0x1 KERN_VERSION = 0x4 LCNT_OVERLOAD_FLUSH = 0x6 LOCK_EX = 0x2 LOCK_NB = 0x4 LOCK_SH = 0x1 LOCK_UN = 0x8 MADV_DONTNEED = 0x4 MADV_FREE = 0x6 MADV_NORMAL = 0x0 MADV_RANDOM = 0x1 MADV_SEQUENTIAL = 0x2 MADV_SPACEAVAIL = 0x5 MADV_WILLNEED = 0x3 MAP_ANON = 0x1000 MAP_ANONYMOUS = 0x1000 MAP_CONCEAL = 0x8000 MAP_COPY = 0x2 MAP_FILE = 0x0 MAP_FIXED = 0x10 MAP_FLAGMASK = 0xfff7 MAP_HASSEMAPHORE = 0x0 MAP_INHERIT = 0x0 MAP_INHERIT_COPY = 0x1 MAP_INHERIT_NONE = 0x2 MAP_INHERIT_SHARE = 0x0 MAP_INHERIT_ZERO = 0x3 MAP_NOEXTEND = 0x0 MAP_NORESERVE = 0x0 MAP_PRIVATE = 0x2 MAP_RENAME = 0x0 MAP_SHARED = 0x1 MAP_STACK = 0x4000 MAP_TRYFIXED = 0x0 MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MNT_ASYNC = 0x40 MNT_DEFEXPORTED = 0x200 MNT_DELEXPORT = 0x20000 MNT_DOOMED = 0x8000000 MNT_EXPORTANON = 0x400 MNT_EXPORTED = 0x100 MNT_EXRDONLY = 0x80 MNT_FORCE = 0x80000 MNT_LAZY = 0x3 MNT_LOCAL = 0x1000 MNT_NOATIME = 0x8000 MNT_NODEV = 0x10 MNT_NOEXEC = 0x4 MNT_NOPERM = 0x20 MNT_NOSUID = 0x8 MNT_NOWAIT = 0x2 MNT_QUOTA = 0x2000 MNT_RDONLY = 0x1 MNT_RELOAD = 0x40000 MNT_ROOTFS = 0x4000 MNT_SOFTDEP = 0x4000000 MNT_STALLED = 0x100000 MNT_SWAPPABLE = 0x200000 MNT_SYNCHRONOUS = 0x2 MNT_UPDATE = 0x10000 MNT_VISFLAGMASK = 0x400ffff MNT_WAIT = 0x1 MNT_WANTRDWR = 0x2000000 MNT_WXALLOWED = 0x800 MOUNT_AFS = "afs" MOUNT_CD9660 = "cd9660" MOUNT_EXT2FS = "ext2fs" MOUNT_FFS = "ffs" MOUNT_FUSEFS = "fuse" MOUNT_MFS = "mfs" MOUNT_MSDOS = "msdos" MOUNT_NCPFS = "ncpfs" MOUNT_NFS = "nfs" MOUNT_NTFS = "ntfs" MOUNT_TMPFS = "tmpfs" MOUNT_UDF = "udf" MOUNT_UFS = "ffs" MSG_BCAST = 0x100 MSG_CMSG_CLOEXEC = 0x800 MSG_CTRUNC = 0x20 MSG_DONTROUTE = 0x4 MSG_DONTWAIT = 0x80 MSG_EOR = 0x8 MSG_MCAST = 0x200 MSG_NOSIGNAL = 0x400 MSG_OOB = 0x1 MSG_PEEK = 0x2 MSG_TRUNC = 0x10 MSG_WAITALL = 0x40 MSG_WAITFORONE = 0x1000 MS_ASYNC = 0x1 MS_INVALIDATE = 0x4 MS_SYNC = 0x2 NAME_MAX = 0xff NET_RT_DUMP = 0x1 NET_RT_FLAGS = 0x2 NET_RT_IFLIST = 0x3 NET_RT_IFNAMES = 0x6 NET_RT_MAXID = 0x8 NET_RT_SOURCE = 0x7 NET_RT_STATS = 0x4 NET_RT_TABLE = 0x5 NFDBITS = 0x20 NOFLSH = 0x80000000 NOKERNINFO = 0x2000000 NOTE_ATTRIB = 0x8 NOTE_CHANGE = 0x1 NOTE_CHILD = 0x4 NOTE_DELETE = 0x1 NOTE_EOF = 0x2 NOTE_EXEC = 0x20000000 NOTE_EXIT = 0x80000000 NOTE_EXTEND = 0x4 NOTE_FORK = 0x40000000 NOTE_LINK = 0x10 NOTE_LOWAT = 0x1 NOTE_OOB = 0x4 NOTE_PCTRLMASK = 0xf0000000 NOTE_PDATAMASK = 0xfffff NOTE_RENAME = 0x20 NOTE_REVOKE = 0x40 NOTE_TRACK = 0x1 NOTE_TRACKERR = 0x2 NOTE_TRUNCATE = 0x80 NOTE_WRITE = 0x2 OCRNL = 0x10 OLCUC = 0x20 ONLCR = 0x2 ONLRET = 0x80 ONOCR = 0x40 ONOEOT = 0x8 OPOST = 0x1 OXTABS = 0x4 O_ACCMODE = 0x3 O_APPEND = 0x8 O_ASYNC = 0x40 O_CLOEXEC = 0x10000 O_CREAT = 0x200 O_DIRECTORY = 0x20000 O_DSYNC = 0x80 O_EXCL = 0x800 O_EXLOCK = 0x20 O_FSYNC = 0x80 O_NDELAY = 0x4 O_NOCTTY = 0x8000 O_NOFOLLOW = 0x100 O_NONBLOCK = 0x4 O_RDONLY = 0x0 O_RDWR = 0x2 O_RSYNC = 0x80 O_SHLOCK = 0x10 O_SYNC = 0x80 O_TRUNC = 0x400 O_WRONLY = 0x1 PARENB = 0x1000 PARMRK = 0x8 PARODD = 0x2000 PENDIN = 0x20000000 PF_FLUSH = 0x1 PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 PROT_EXEC = 0x4 PROT_NONE = 0x0 PROT_READ = 0x1 PROT_WRITE = 0x2 RLIMIT_CORE = 0x4 RLIMIT_CPU = 0x0 RLIMIT_DATA = 0x2 RLIMIT_FSIZE = 0x1 RLIMIT_MEMLOCK = 0x6 RLIMIT_NOFILE = 0x8 RLIMIT_NPROC = 0x7 RLIMIT_RSS = 0x5 RLIMIT_STACK = 0x3 RLIM_INFINITY = 0x7fffffffffffffff RTAX_AUTHOR = 0x6 RTAX_BFD = 0xb RTAX_BRD = 0x7 RTAX_DNS = 0xc RTAX_DST = 0x0 RTAX_GATEWAY = 0x1 RTAX_GENMASK = 0x3 RTAX_IFA = 0x5 RTAX_IFP = 0x4 RTAX_LABEL = 0xa RTAX_MAX = 0xf RTAX_NETMASK = 0x2 RTAX_SEARCH = 0xe RTAX_SRC = 0x8 RTAX_SRCMASK = 0x9 RTAX_STATIC = 0xd RTA_AUTHOR = 0x40 RTA_BFD = 0x800 RTA_BRD = 0x80 RTA_DNS = 0x1000 RTA_DST = 0x1 RTA_GATEWAY = 0x2 RTA_GENMASK = 0x8 RTA_IFA = 0x20 RTA_IFP = 0x10 RTA_LABEL = 0x400 RTA_NETMASK = 0x4 RTA_SEARCH = 0x4000 RTA_SRC = 0x100 RTA_SRCMASK = 0x200 RTA_STATIC = 0x2000 RTF_ANNOUNCE = 0x4000 RTF_BFD = 0x1000000 RTF_BLACKHOLE = 0x1000 RTF_BROADCAST = 0x400000 RTF_CACHED = 0x20000 RTF_CLONED = 0x10000 RTF_CLONING = 0x100 RTF_CONNECTED = 0x800000 RTF_DONE = 0x40 RTF_DYNAMIC = 0x10 RTF_FMASK = 0x110fc08 RTF_GATEWAY = 0x2 RTF_HOST = 0x4 RTF_LLINFO = 0x400 RTF_LOCAL = 0x200000 RTF_MODIFIED = 0x20 RTF_MPATH = 0x40000 RTF_MPLS = 0x100000 RTF_MULTICAST = 0x200 RTF_PERMANENT_ARP = 0x2000 RTF_PROTO1 = 0x8000 RTF_PROTO2 = 0x4000 RTF_PROTO3 = 0x2000 RTF_REJECT = 0x8 RTF_STATIC = 0x800 RTF_UP = 0x1 RTF_USETRAILERS = 0x8000 RTM_80211INFO = 0x15 RTM_ADD = 0x1 RTM_BFD = 0x12 RTM_CHANGE = 0x3 RTM_CHGADDRATTR = 0x14 RTM_DELADDR = 0xd RTM_DELETE = 0x2 RTM_DESYNC = 0x10 RTM_GET = 0x4 RTM_IFANNOUNCE = 0xf RTM_IFINFO = 0xe RTM_INVALIDATE = 0x11 RTM_LOSING = 0x5 RTM_MAXSIZE = 0x800 RTM_MISS = 0x7 RTM_NEWADDR = 0xc RTM_PROPOSAL = 0x13 RTM_REDIRECT = 0x6 RTM_RESOLVE = 0xb RTM_SOURCE = 0x16 RTM_VERSION = 0x5 RTV_EXPIRE = 0x4 RTV_HOPCOUNT = 0x2 RTV_MTU = 0x1 RTV_RPIPE = 0x8 RTV_RTT = 0x40 RTV_RTTVAR = 0x80 RTV_SPIPE = 0x10 RTV_SSTHRESH = 0x20 RT_TABLEID_BITS = 0x8 RT_TABLEID_MASK = 0xff RT_TABLEID_MAX = 0xff RUSAGE_CHILDREN = -0x1 RUSAGE_SELF = 0x0 RUSAGE_THREAD = 0x1 SCM_RIGHTS = 0x1 SCM_TIMESTAMP = 0x4 SEEK_CUR = 0x1 SEEK_END = 0x2 SEEK_SET = 0x0 SHUT_RD = 0x0 SHUT_RDWR = 0x2 SHUT_WR = 0x1 SIOCADDMULTI = 0x80206931 SIOCAIFADDR = 0x8040691a SIOCAIFGROUP = 0x80286987 SIOCATMARK = 0x40047307 SIOCBRDGADD = 0x8060693c SIOCBRDGADDL = 0x80606949 SIOCBRDGADDS = 0x80606941 SIOCBRDGARL = 0x808c694d SIOCBRDGDADDR = 0x81286947 SIOCBRDGDEL = 0x8060693d SIOCBRDGDELS = 0x80606942 SIOCBRDGFLUSH = 0x80606948 SIOCBRDGFRL = 0x808c694e SIOCBRDGGCACHE = 0xc0146941 SIOCBRDGGFD = 0xc0146952 SIOCBRDGGHT = 0xc0146951 SIOCBRDGGIFFLGS = 0xc060693e SIOCBRDGGMA = 0xc0146953 SIOCBRDGGPARAM = 0xc0406958 SIOCBRDGGPRI = 0xc0146950 SIOCBRDGGRL = 0xc030694f SIOCBRDGGTO = 0xc0146946 SIOCBRDGIFS = 0xc0606942 SIOCBRDGRTS = 0xc0206943 SIOCBRDGSADDR = 0xc1286944 SIOCBRDGSCACHE = 0x80146940 SIOCBRDGSFD = 0x80146952 SIOCBRDGSHT = 0x80146951 SIOCBRDGSIFCOST = 0x80606955 SIOCBRDGSIFFLGS = 0x8060693f SIOCBRDGSIFPRIO = 0x80606954 SIOCBRDGSIFPROT = 0x8060694a SIOCBRDGSMA = 0x80146953 SIOCBRDGSPRI = 0x80146950 SIOCBRDGSPROTO = 0x8014695a SIOCBRDGSTO = 0x80146945 SIOCBRDGSTXHC = 0x80146959 SIOCDELLABEL = 0x80206997 SIOCDELMULTI = 0x80206932 SIOCDIFADDR = 0x80206919 SIOCDIFGROUP = 0x80286989 SIOCDIFPARENT = 0x802069b4 SIOCDIFPHYADDR = 0x80206949 SIOCDPWE3NEIGHBOR = 0x802069de SIOCDVNETID = 0x802069af SIOCGETKALIVE = 0xc01869a4 SIOCGETLABEL = 0x8020699a SIOCGETMPWCFG = 0xc02069ae SIOCGETPFLOW = 0xc02069fe SIOCGETPFSYNC = 0xc02069f8 SIOCGETSGCNT = 0xc0207534 SIOCGETVIFCNT = 0xc0287533 SIOCGETVLAN = 0xc0206990 SIOCGIFADDR = 0xc0206921 SIOCGIFBRDADDR = 0xc0206923 SIOCGIFCONF = 0xc0106924 SIOCGIFDATA = 0xc020691b SIOCGIFDESCR = 0xc0206981 SIOCGIFDSTADDR = 0xc0206922 SIOCGIFFLAGS = 0xc0206911 SIOCGIFGATTR = 0xc028698b SIOCGIFGENERIC = 0xc020693a SIOCGIFGLIST = 0xc028698d SIOCGIFGMEMB = 0xc028698a SIOCGIFGROUP = 0xc0286988 SIOCGIFHARDMTU = 0xc02069a5 SIOCGIFLLPRIO = 0xc02069b6 SIOCGIFMEDIA = 0xc0406938 SIOCGIFMETRIC = 0xc0206917 SIOCGIFMTU = 0xc020697e SIOCGIFNETMASK = 0xc0206925 SIOCGIFPAIR = 0xc02069b1 SIOCGIFPARENT = 0xc02069b3 SIOCGIFPRIORITY = 0xc020699c SIOCGIFRDOMAIN = 0xc02069a0 SIOCGIFRTLABEL = 0xc0206983 SIOCGIFRXR = 0x802069aa SIOCGIFSFFPAGE = 0xc1126939 SIOCGIFXFLAGS = 0xc020699e SIOCGLIFPHYADDR = 0xc218694b SIOCGLIFPHYDF = 0xc02069c2 SIOCGLIFPHYECN = 0xc02069c8 SIOCGLIFPHYRTABLE = 0xc02069a2 SIOCGLIFPHYTTL = 0xc02069a9 SIOCGPGRP = 0x40047309 SIOCGPWE3 = 0xc0206998 SIOCGPWE3CTRLWORD = 0xc02069dc SIOCGPWE3FAT = 0xc02069dd SIOCGPWE3NEIGHBOR = 0xc21869de SIOCGRXHPRIO = 0xc02069db SIOCGSPPPPARAMS = 0xc0206994 SIOCGTXHPRIO = 0xc02069c6 SIOCGUMBINFO = 0xc02069be SIOCGUMBPARAM = 0xc02069c0 SIOCGVH = 0xc02069f6 SIOCGVNETFLOWID = 0xc02069c4 SIOCGVNETID = 0xc02069a7 SIOCIFAFATTACH = 0x801169ab SIOCIFAFDETACH = 0x801169ac SIOCIFCREATE = 0x8020697a SIOCIFDESTROY = 0x80206979 SIOCIFGCLONERS = 0xc0106978 SIOCSETKALIVE = 0x801869a3 SIOCSETLABEL = 0x80206999 SIOCSETMPWCFG = 0x802069ad SIOCSETPFLOW = 0x802069fd SIOCSETPFSYNC = 0x802069f7 SIOCSETVLAN = 0x8020698f SIOCSIFADDR = 0x8020690c SIOCSIFBRDADDR = 0x80206913 SIOCSIFDESCR = 0x80206980 SIOCSIFDSTADDR = 0x8020690e SIOCSIFFLAGS = 0x80206910 SIOCSIFGATTR = 0x8028698c SIOCSIFGENERIC = 0x80206939 SIOCSIFLLADDR = 0x8020691f SIOCSIFLLPRIO = 0x802069b5 SIOCSIFMEDIA = 0xc0206937 SIOCSIFMETRIC = 0x80206918 SIOCSIFMTU = 0x8020697f SIOCSIFNETMASK = 0x80206916 SIOCSIFPAIR = 0x802069b0 SIOCSIFPARENT = 0x802069b2 SIOCSIFPRIORITY = 0x8020699b SIOCSIFRDOMAIN = 0x8020699f SIOCSIFRTLABEL = 0x80206982 SIOCSIFXFLAGS = 0x8020699d SIOCSLIFPHYADDR = 0x8218694a SIOCSLIFPHYDF = 0x802069c1 SIOCSLIFPHYECN = 0x802069c7 SIOCSLIFPHYRTABLE = 0x802069a1 SIOCSLIFPHYTTL = 0x802069a8 SIOCSPGRP = 0x80047308 SIOCSPWE3CTRLWORD = 0x802069dc SIOCSPWE3FAT = 0x802069dd SIOCSPWE3NEIGHBOR = 0x821869de SIOCSRXHPRIO = 0x802069db SIOCSSPPPPARAMS = 0x80206993 SIOCSTXHPRIO = 0x802069c5 SIOCSUMBPARAM = 0x802069bf SIOCSVH = 0xc02069f5 SIOCSVNETFLOWID = 0x802069c3 SIOCSVNETID = 0x802069a6 SOCK_CLOEXEC = 0x8000 SOCK_DGRAM = 0x2 SOCK_DNS = 0x1000 SOCK_NONBLOCK = 0x4000 SOCK_RAW = 0x3 SOCK_RDM = 0x4 SOCK_SEQPACKET = 0x5 SOCK_STREAM = 0x1 SOL_SOCKET = 0xffff SOMAXCONN = 0x80 SO_ACCEPTCONN = 0x2 SO_BINDANY = 0x1000 SO_BROADCAST = 0x20 SO_DEBUG = 0x1 SO_DOMAIN = 0x1024 SO_DONTROUTE = 0x10 SO_ERROR = 0x1007 SO_KEEPALIVE = 0x8 SO_LINGER = 0x80 SO_NETPROC = 0x1020 SO_OOBINLINE = 0x100 SO_PEERCRED = 0x1022 SO_PROTOCOL = 0x1025 SO_RCVBUF = 0x1002 SO_RCVLOWAT = 0x1004 SO_RCVTIMEO = 0x1006 SO_REUSEADDR = 0x4 SO_REUSEPORT = 0x200 SO_RTABLE = 0x1021 SO_SNDBUF = 0x1001 SO_SNDLOWAT = 0x1003 SO_SNDTIMEO = 0x1005 SO_SPLICE = 0x1023 SO_TIMESTAMP = 0x800 SO_TYPE = 0x1008 SO_USELOOPBACK = 0x40 SO_ZEROIZE = 0x2000 S_BLKSIZE = 0x200 S_IEXEC = 0x40 S_IFBLK = 0x6000 S_IFCHR = 0x2000 S_IFDIR = 0x4000 S_IFIFO = 0x1000 S_IFLNK = 0xa000 S_IFMT = 0xf000 S_IFREG = 0x8000 S_IFSOCK = 0xc000 S_IREAD = 0x100 S_IRGRP = 0x20 S_IROTH = 0x4 S_IRUSR = 0x100 S_IRWXG = 0x38 S_IRWXO = 0x7 S_IRWXU = 0x1c0 S_ISGID = 0x400 S_ISTXT = 0x200 S_ISUID = 0x800 S_ISVTX = 0x200 S_IWGRP = 0x10 S_IWOTH = 0x2 S_IWRITE = 0x80 S_IWUSR = 0x80 S_IXGRP = 0x8 S_IXOTH = 0x1 S_IXUSR = 0x40 TCIFLUSH = 0x1 TCIOFF = 0x3 TCIOFLUSH = 0x3 TCION = 0x4 TCOFLUSH = 0x2 TCOOFF = 0x1 TCOON = 0x2 TCPOPT_EOL = 0x0 TCPOPT_MAXSEG = 0x2 TCPOPT_NOP = 0x1 TCPOPT_SACK = 0x5 TCPOPT_SACK_HDR = 0x1010500 TCPOPT_SACK_PERMITTED = 0x4 TCPOPT_SACK_PERMIT_HDR = 0x1010402 TCPOPT_SIGNATURE = 0x13 TCPOPT_TIMESTAMP = 0x8 TCPOPT_TSTAMP_HDR = 0x101080a TCPOPT_WINDOW = 0x3 TCP_INFO = 0x9 TCP_MAXSEG = 0x2 TCP_MAXWIN = 0xffff TCP_MAX_SACK = 0x3 TCP_MAX_WINSHIFT = 0xe TCP_MD5SIG = 0x4 TCP_MSS = 0x200 TCP_NODELAY = 0x1 TCP_NOPUSH = 0x10 TCP_SACKHOLE_LIMIT = 0x80 TCP_SACK_ENABLE = 0x8 TCSAFLUSH = 0x2 TIMER_ABSTIME = 0x1 TIMER_RELTIME = 0x0 TIOCCBRK = 0x2000747a TIOCCDTR = 0x20007478 TIOCCHKVERAUTH = 0x2000741e TIOCCLRVERAUTH = 0x2000741d TIOCCONS = 0x80047462 TIOCDRAIN = 0x2000745e TIOCEXCL = 0x2000740d TIOCEXT = 0x80047460 TIOCFLAG_CLOCAL = 0x2 TIOCFLAG_CRTSCTS = 0x4 TIOCFLAG_MDMBUF = 0x8 TIOCFLAG_PPS = 0x10 TIOCFLAG_SOFTCAR = 0x1 TIOCFLUSH = 0x80047410 TIOCGETA = 0x402c7413 TIOCGETD = 0x4004741a TIOCGFLAGS = 0x4004745d TIOCGPGRP = 0x40047477 TIOCGSID = 0x40047463 TIOCGTSTAMP = 0x4010745b TIOCGWINSZ = 0x40087468 TIOCMBIC = 0x8004746b TIOCMBIS = 0x8004746c TIOCMGET = 0x4004746a TIOCMODG = 0x4004746a TIOCMODS = 0x8004746d TIOCMSET = 0x8004746d TIOCM_CAR = 0x40 TIOCM_CD = 0x40 TIOCM_CTS = 0x20 TIOCM_DSR = 0x100 TIOCM_DTR = 0x2 TIOCM_LE = 0x1 TIOCM_RI = 0x80 TIOCM_RNG = 0x80 TIOCM_RTS = 0x4 TIOCM_SR = 0x10 TIOCM_ST = 0x8 TIOCNOTTY = 0x20007471 TIOCNXCL = 0x2000740e TIOCOUTQ = 0x40047473 TIOCPKT = 0x80047470 TIOCPKT_DATA = 0x0 TIOCPKT_DOSTOP = 0x20 TIOCPKT_FLUSHREAD = 0x1 TIOCPKT_FLUSHWRITE = 0x2 TIOCPKT_IOCTL = 0x40 TIOCPKT_NOSTOP = 0x10 TIOCPKT_START = 0x8 TIOCPKT_STOP = 0x4 TIOCREMOTE = 0x80047469 TIOCSBRK = 0x2000747b TIOCSCTTY = 0x20007461 TIOCSDTR = 0x20007479 TIOCSETA = 0x802c7414 TIOCSETAF = 0x802c7416 TIOCSETAW = 0x802c7415 TIOCSETD = 0x8004741b TIOCSETVERAUTH = 0x8004741c TIOCSFLAGS = 0x8004745c TIOCSIG = 0x8004745f TIOCSPGRP = 0x80047476 TIOCSTART = 0x2000746e TIOCSTAT = 0x20007465 TIOCSTOP = 0x2000746f TIOCSTSTAMP = 0x8008745a TIOCSWINSZ = 0x80087467 TIOCUCNTL = 0x80047466 TIOCUCNTL_CBRK = 0x7a TIOCUCNTL_SBRK = 0x7b TOSTOP = 0x400000 UTIME_NOW = -0x2 UTIME_OMIT = -0x1 VDISCARD = 0xf VDSUSP = 0xb VEOF = 0x0 VEOL = 0x1 VEOL2 = 0x2 VERASE = 0x3 VINTR = 0x8 VKILL = 0x5 VLNEXT = 0xe VMIN = 0x10 VM_ANONMIN = 0x7 VM_LOADAVG = 0x2 VM_MALLOC_CONF = 0xc VM_MAXID = 0xd VM_MAXSLP = 0xa VM_METER = 0x1 VM_NKMEMPAGES = 0x6 VM_PSSTRINGS = 0x3 VM_SWAPENCRYPT = 0x5 VM_USPACE = 0xb VM_UVMEXP = 0x4 VM_VNODEMIN = 0x9 VM_VTEXTMIN = 0x8 VQUIT = 0x9 VREPRINT = 0x6 VSTART = 0xc VSTATUS = 0x12 VSTOP = 0xd VSUSP = 0xa VTIME = 0x11 VWERASE = 0x4 WALTSIG = 0x4 WCONTINUED = 0x8 WCOREFLAG = 0x80 WNOHANG = 0x1 WUNTRACED = 0x2 XCASE = 0x1000000 ) // Errors const ( E2BIG = syscall.Errno(0x7) EACCES = syscall.Errno(0xd) EADDRINUSE = syscall.Errno(0x30) EADDRNOTAVAIL = syscall.Errno(0x31) EAFNOSUPPORT = syscall.Errno(0x2f) EAGAIN = syscall.Errno(0x23) EALREADY = syscall.Errno(0x25) EAUTH = syscall.Errno(0x50) EBADF = syscall.Errno(0x9) EBADMSG = syscall.Errno(0x5c) EBADRPC = syscall.Errno(0x48) EBUSY = syscall.Errno(0x10) ECANCELED = syscall.Errno(0x58) ECHILD = syscall.Errno(0xa) ECONNABORTED = syscall.Errno(0x35) ECONNREFUSED = syscall.Errno(0x3d) ECONNRESET = syscall.Errno(0x36) EDEADLK = syscall.Errno(0xb) EDESTADDRREQ = syscall.Errno(0x27) EDOM = syscall.Errno(0x21) EDQUOT = syscall.Errno(0x45) EEXIST = syscall.Errno(0x11) EFAULT = syscall.Errno(0xe) EFBIG = syscall.Errno(0x1b) EFTYPE = syscall.Errno(0x4f) EHOSTDOWN = syscall.Errno(0x40) EHOSTUNREACH = syscall.Errno(0x41) EIDRM = syscall.Errno(0x59) EILSEQ = syscall.Errno(0x54) EINPROGRESS = syscall.Errno(0x24) EINTR = syscall.Errno(0x4) EINVAL = syscall.Errno(0x16) EIO = syscall.Errno(0x5) EIPSEC = syscall.Errno(0x52) EISCONN = syscall.Errno(0x38) EISDIR = syscall.Errno(0x15) ELAST = syscall.Errno(0x5f) ELOOP = syscall.Errno(0x3e) EMEDIUMTYPE = syscall.Errno(0x56) EMFILE = syscall.Errno(0x18) EMLINK = syscall.Errno(0x1f) EMSGSIZE = syscall.Errno(0x28) ENAMETOOLONG = syscall.Errno(0x3f) ENEEDAUTH = syscall.Errno(0x51) ENETDOWN = syscall.Errno(0x32) ENETRESET = syscall.Errno(0x34) ENETUNREACH = syscall.Errno(0x33) ENFILE = syscall.Errno(0x17) ENOATTR = syscall.Errno(0x53) ENOBUFS = syscall.Errno(0x37) ENODEV = syscall.Errno(0x13) ENOENT = syscall.Errno(0x2) ENOEXEC = syscall.Errno(0x8) ENOLCK = syscall.Errno(0x4d) ENOMEDIUM = syscall.Errno(0x55) ENOMEM = syscall.Errno(0xc) ENOMSG = syscall.Errno(0x5a) ENOPROTOOPT = syscall.Errno(0x2a) ENOSPC = syscall.Errno(0x1c) ENOSYS = syscall.Errno(0x4e) ENOTBLK = syscall.Errno(0xf) ENOTCONN = syscall.Errno(0x39) ENOTDIR = syscall.Errno(0x14) ENOTEMPTY = syscall.Errno(0x42) ENOTRECOVERABLE = syscall.Errno(0x5d) ENOTSOCK = syscall.Errno(0x26) ENOTSUP = syscall.Errno(0x5b) ENOTTY = syscall.Errno(0x19) ENXIO = syscall.Errno(0x6) EOPNOTSUPP = syscall.Errno(0x2d) EOVERFLOW = syscall.Errno(0x57) EOWNERDEAD = syscall.Errno(0x5e) EPERM = syscall.Errno(0x1) EPFNOSUPPORT = syscall.Errno(0x2e) EPIPE = syscall.Errno(0x20) EPROCLIM = syscall.Errno(0x43) EPROCUNAVAIL = syscall.Errno(0x4c) EPROGMISMATCH = syscall.Errno(0x4b) EPROGUNAVAIL = syscall.Errno(0x4a) EPROTO = syscall.Errno(0x5f) EPROTONOSUPPORT = syscall.Errno(0x2b) EPROTOTYPE = syscall.Errno(0x29) ERANGE = syscall.Errno(0x22) EREMOTE = syscall.Errno(0x47) EROFS = syscall.Errno(0x1e) ERPCMISMATCH = syscall.Errno(0x49) ESHUTDOWN = syscall.Errno(0x3a) ESOCKTNOSUPPORT = syscall.Errno(0x2c) ESPIPE = syscall.Errno(0x1d) ESRCH = syscall.Errno(0x3) ESTALE = syscall.Errno(0x46) ETIMEDOUT = syscall.Errno(0x3c) ETOOMANYREFS = syscall.Errno(0x3b) ETXTBSY = syscall.Errno(0x1a) EUSERS = syscall.Errno(0x44) EWOULDBLOCK = syscall.Errno(0x23) EXDEV = syscall.Errno(0x12) ) // Signals const ( SIGABRT = syscall.Signal(0x6) SIGALRM = syscall.Signal(0xe) SIGBUS = syscall.Signal(0xa) SIGCHLD = syscall.Signal(0x14) SIGCONT = syscall.Signal(0x13) SIGEMT = syscall.Signal(0x7) SIGFPE = syscall.Signal(0x8) SIGHUP = syscall.Signal(0x1) SIGILL = syscall.Signal(0x4) SIGINFO = syscall.Signal(0x1d) SIGINT = syscall.Signal(0x2) SIGIO = syscall.Signal(0x17) SIGIOT = syscall.Signal(0x6) SIGKILL = syscall.Signal(0x9) SIGPIPE = syscall.Signal(0xd) SIGPROF = syscall.Signal(0x1b) SIGQUIT = syscall.Signal(0x3) SIGSEGV = syscall.Signal(0xb) SIGSTOP = syscall.Signal(0x11) SIGSYS = syscall.Signal(0xc) SIGTERM = syscall.Signal(0xf) SIGTHR = syscall.Signal(0x20) SIGTRAP = syscall.Signal(0x5) SIGTSTP = syscall.Signal(0x12) SIGTTIN = syscall.Signal(0x15) SIGTTOU = syscall.Signal(0x16) SIGURG = syscall.Signal(0x10) SIGUSR1 = syscall.Signal(0x1e) SIGUSR2 = syscall.Signal(0x1f) SIGVTALRM = syscall.Signal(0x1a) SIGWINCH = syscall.Signal(0x1c) SIGXCPU = syscall.Signal(0x18) SIGXFSZ = syscall.Signal(0x19) ) // Error table var errorList = [...]struct { num syscall.Errno name string desc string }{ {1, "EPERM", "operation not permitted"}, {2, "ENOENT", "no such file or directory"}, {3, "ESRCH", "no such process"}, {4, "EINTR", "interrupted system call"}, {5, "EIO", "input/output error"}, {6, "ENXIO", "device not configured"}, {7, "E2BIG", "argument list too long"}, {8, "ENOEXEC", "exec format error"}, {9, "EBADF", "bad file descriptor"}, {10, "ECHILD", "no child processes"}, {11, "EDEADLK", "resource deadlock avoided"}, {12, "ENOMEM", "cannot allocate memory"}, {13, "EACCES", "permission denied"}, {14, "EFAULT", "bad address"}, {15, "ENOTBLK", "block device required"}, {16, "EBUSY", "device busy"}, {17, "EEXIST", "file exists"}, {18, "EXDEV", "cross-device link"}, {19, "ENODEV", "operation not supported by device"}, {20, "ENOTDIR", "not a directory"}, {21, "EISDIR", "is a directory"}, {22, "EINVAL", "invalid argument"}, {23, "ENFILE", "too many open files in system"}, {24, "EMFILE", "too many open files"}, {25, "ENOTTY", "inappropriate ioctl for device"}, {26, "ETXTBSY", "text file busy"}, {27, "EFBIG", "file too large"}, {28, "ENOSPC", "no space left on device"}, {29, "ESPIPE", "illegal seek"}, {30, "EROFS", "read-only file system"}, {31, "EMLINK", "too many links"}, {32, "EPIPE", "broken pipe"}, {33, "EDOM", "numerical argument out of domain"}, {34, "ERANGE", "result too large"}, {35, "EAGAIN", "resource temporarily unavailable"}, {36, "EINPROGRESS", "operation now in progress"}, {37, "EALREADY", "operation already in progress"}, {38, "ENOTSOCK", "socket operation on non-socket"}, {39, "EDESTADDRREQ", "destination address required"}, {40, "EMSGSIZE", "message too long"}, {41, "EPROTOTYPE", "protocol wrong type for socket"}, {42, "ENOPROTOOPT", "protocol not available"}, {43, "EPROTONOSUPPORT", "protocol not supported"}, {44, "ESOCKTNOSUPPORT", "socket type not supported"}, {45, "EOPNOTSUPP", "operation not supported"}, {46, "EPFNOSUPPORT", "protocol family not supported"}, {47, "EAFNOSUPPORT", "address family not supported by protocol family"}, {48, "EADDRINUSE", "address already in use"}, {49, "EADDRNOTAVAIL", "can't assign requested address"}, {50, "ENETDOWN", "network is down"}, {51, "ENETUNREACH", "network is unreachable"}, {52, "ENETRESET", "network dropped connection on reset"}, {53, "ECONNABORTED", "software caused connection abort"}, {54, "ECONNRESET", "connection reset by peer"}, {55, "ENOBUFS", "no buffer space available"}, {56, "EISCONN", "socket is already connected"}, {57, "ENOTCONN", "socket is not connected"}, {58, "ESHUTDOWN", "can't send after socket shutdown"}, {59, "ETOOMANYREFS", "too many references: can't splice"}, {60, "ETIMEDOUT", "operation timed out"}, {61, "ECONNREFUSED", "connection refused"}, {62, "ELOOP", "too many levels of symbolic links"}, {63, "ENAMETOOLONG", "file name too long"}, {64, "EHOSTDOWN", "host is down"}, {65, "EHOSTUNREACH", "no route to host"}, {66, "ENOTEMPTY", "directory not empty"}, {67, "EPROCLIM", "too many processes"}, {68, "EUSERS", "too many users"}, {69, "EDQUOT", "disk quota exceeded"}, {70, "ESTALE", "stale NFS file handle"}, {71, "EREMOTE", "too many levels of remote in path"}, {72, "EBADRPC", "RPC struct is bad"}, {73, "ERPCMISMATCH", "RPC version wrong"}, {74, "EPROGUNAVAIL", "RPC program not available"}, {75, "EPROGMISMATCH", "program version wrong"}, {76, "EPROCUNAVAIL", "bad procedure for program"}, {77, "ENOLCK", "no locks available"}, {78, "ENOSYS", "function not implemented"}, {79, "EFTYPE", "inappropriate file type or format"}, {80, "EAUTH", "authentication error"}, {81, "ENEEDAUTH", "need authenticator"}, {82, "EIPSEC", "IPsec processing failure"}, {83, "ENOATTR", "attribute not found"}, {84, "EILSEQ", "illegal byte sequence"}, {85, "ENOMEDIUM", "no medium found"}, {86, "EMEDIUMTYPE", "wrong medium type"}, {87, "EOVERFLOW", "value too large to be stored in data type"}, {88, "ECANCELED", "operation canceled"}, {89, "EIDRM", "identifier removed"}, {90, "ENOMSG", "no message of desired type"}, {91, "ENOTSUP", "not supported"}, {92, "EBADMSG", "bad message"}, {93, "ENOTRECOVERABLE", "state not recoverable"}, {94, "EOWNERDEAD", "previous owner died"}, {95, "ELAST", "protocol error"}, } // Signal table var signalList = [...]struct { num syscall.Signal name string desc string }{ {1, "SIGHUP", "hangup"}, {2, "SIGINT", "interrupt"}, {3, "SIGQUIT", "quit"}, {4, "SIGILL", "illegal instruction"}, {5, "SIGTRAP", "trace/BPT trap"}, {6, "SIGIOT", "abort trap"}, {7, "SIGEMT", "EMT trap"}, {8, "SIGFPE", "floating point exception"}, {9, "SIGKILL", "killed"}, {10, "SIGBUS", "bus error"}, {11, "SIGSEGV", "segmentation fault"}, {12, "SIGSYS", "bad system call"}, {13, "SIGPIPE", "broken pipe"}, {14, "SIGALRM", "alarm clock"}, {15, "SIGTERM", "terminated"}, {16, "SIGURG", "urgent I/O condition"}, {17, "SIGSTOP", "suspended (signal)"}, {18, "SIGTSTP", "suspended"}, {19, "SIGCONT", "continued"}, {20, "SIGCHLD", "child exited"}, {21, "SIGTTIN", "stopped (tty input)"}, {22, "SIGTTOU", "stopped (tty output)"}, {23, "SIGIO", "I/O possible"}, {24, "SIGXCPU", "cputime limit exceeded"}, {25, "SIGXFSZ", "filesize limit exceeded"}, {26, "SIGVTALRM", "virtual timer expired"}, {27, "SIGPROF", "profiling timer expired"}, {28, "SIGWINCH", "window size changes"}, {29, "SIGINFO", "information request"}, {30, "SIGUSR1", "user defined signal 1"}, {31, "SIGUSR2", "user defined signal 2"}, {32, "SIGTHR", "thread AST"}, {28672, "SIGSTKSZ", "unknown signal"}, } ================================================ FILE: vendor/golang.org/x/sys/unix/zerrors_openbsd_mips64.go ================================================ // mkerrors.sh -m64 // Code generated by the command above; see README.md. DO NOT EDIT. //go:build mips64 && openbsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -m64 _const.go package unix import "syscall" const ( AF_APPLETALK = 0x10 AF_BLUETOOTH = 0x20 AF_CCITT = 0xa AF_CHAOS = 0x5 AF_CNT = 0x15 AF_COIP = 0x14 AF_DATAKIT = 0x9 AF_DECnet = 0xc AF_DLI = 0xd AF_E164 = 0x1a AF_ECMA = 0x8 AF_ENCAP = 0x1c AF_HYLINK = 0xf AF_IMPLINK = 0x3 AF_INET = 0x2 AF_INET6 = 0x18 AF_IPX = 0x17 AF_ISDN = 0x1a AF_ISO = 0x7 AF_KEY = 0x1e AF_LAT = 0xe AF_LINK = 0x12 AF_LOCAL = 0x1 AF_MAX = 0x24 AF_MPLS = 0x21 AF_NATM = 0x1b AF_NS = 0x6 AF_OSI = 0x7 AF_PUP = 0x4 AF_ROUTE = 0x11 AF_SIP = 0x1d AF_SNA = 0xb AF_UNIX = 0x1 AF_UNSPEC = 0x0 ALTWERASE = 0x200 ARPHRD_ETHER = 0x1 ARPHRD_FRELAY = 0xf ARPHRD_IEEE1394 = 0x18 ARPHRD_IEEE802 = 0x6 B0 = 0x0 B110 = 0x6e B115200 = 0x1c200 B1200 = 0x4b0 B134 = 0x86 B14400 = 0x3840 B150 = 0x96 B1800 = 0x708 B19200 = 0x4b00 B200 = 0xc8 B230400 = 0x38400 B2400 = 0x960 B28800 = 0x7080 B300 = 0x12c B38400 = 0x9600 B4800 = 0x12c0 B50 = 0x32 B57600 = 0xe100 B600 = 0x258 B7200 = 0x1c20 B75 = 0x4b B76800 = 0x12c00 B9600 = 0x2580 BIOCFLUSH = 0x20004268 BIOCGBLEN = 0x40044266 BIOCGDIRFILT = 0x4004427c BIOCGDLT = 0x4004426a BIOCGDLTLIST = 0xc010427b BIOCGETIF = 0x4020426b BIOCGFILDROP = 0x40044278 BIOCGHDRCMPLT = 0x40044274 BIOCGRSIG = 0x40044273 BIOCGRTIMEOUT = 0x4010426e BIOCGSTATS = 0x4008426f BIOCIMMEDIATE = 0x80044270 BIOCLOCK = 0x20004276 BIOCPROMISC = 0x20004269 BIOCSBLEN = 0xc0044266 BIOCSDIRFILT = 0x8004427d BIOCSDLT = 0x8004427a BIOCSETF = 0x80104267 BIOCSETIF = 0x8020426c BIOCSETWF = 0x80104277 BIOCSFILDROP = 0x80044279 BIOCSHDRCMPLT = 0x80044275 BIOCSRSIG = 0x80044272 BIOCSRTIMEOUT = 0x8010426d BIOCVERSION = 0x40044271 BPF_A = 0x10 BPF_ABS = 0x20 BPF_ADD = 0x0 BPF_ALIGNMENT = 0x4 BPF_ALU = 0x4 BPF_AND = 0x50 BPF_B = 0x10 BPF_DIRECTION_IN = 0x1 BPF_DIRECTION_OUT = 0x2 BPF_DIV = 0x30 BPF_FILDROP_CAPTURE = 0x1 BPF_FILDROP_DROP = 0x2 BPF_FILDROP_PASS = 0x0 BPF_F_DIR_IN = 0x10 BPF_F_DIR_MASK = 0x30 BPF_F_DIR_OUT = 0x20 BPF_F_DIR_SHIFT = 0x4 BPF_F_FLOWID = 0x8 BPF_F_PRI_MASK = 0x7 BPF_H = 0x8 BPF_IMM = 0x0 BPF_IND = 0x40 BPF_JA = 0x0 BPF_JEQ = 0x10 BPF_JGE = 0x30 BPF_JGT = 0x20 BPF_JMP = 0x5 BPF_JSET = 0x40 BPF_K = 0x0 BPF_LD = 0x0 BPF_LDX = 0x1 BPF_LEN = 0x80 BPF_LSH = 0x60 BPF_MAJOR_VERSION = 0x1 BPF_MAXBUFSIZE = 0x200000 BPF_MAXINSNS = 0x200 BPF_MEM = 0x60 BPF_MEMWORDS = 0x10 BPF_MINBUFSIZE = 0x20 BPF_MINOR_VERSION = 0x1 BPF_MISC = 0x7 BPF_MSH = 0xa0 BPF_MUL = 0x20 BPF_NEG = 0x80 BPF_OR = 0x40 BPF_RELEASE = 0x30bb6 BPF_RET = 0x6 BPF_RND = 0xc0 BPF_RSH = 0x70 BPF_ST = 0x2 BPF_STX = 0x3 BPF_SUB = 0x10 BPF_TAX = 0x0 BPF_TXA = 0x80 BPF_W = 0x0 BPF_X = 0x8 BRKINT = 0x2 CFLUSH = 0xf CLOCAL = 0x8000 CLOCK_BOOTTIME = 0x6 CLOCK_MONOTONIC = 0x3 CLOCK_PROCESS_CPUTIME_ID = 0x2 CLOCK_REALTIME = 0x0 CLOCK_THREAD_CPUTIME_ID = 0x4 CLOCK_UPTIME = 0x5 CPUSTATES = 0x6 CP_IDLE = 0x5 CP_INTR = 0x4 CP_NICE = 0x1 CP_SPIN = 0x3 CP_SYS = 0x2 CP_USER = 0x0 CREAD = 0x800 CRTSCTS = 0x10000 CS5 = 0x0 CS6 = 0x100 CS7 = 0x200 CS8 = 0x300 CSIZE = 0x300 CSTART = 0x11 CSTATUS = 0xff CSTOP = 0x13 CSTOPB = 0x400 CSUSP = 0x1a CTL_HW = 0x6 CTL_KERN = 0x1 CTL_MAXNAME = 0xc CTL_NET = 0x4 DIOCADDQUEUE = 0xc110445d DIOCADDRULE = 0xcd604404 DIOCADDSTATE = 0xc1084425 DIOCCHANGERULE = 0xcd60441a DIOCCLRIFFLAG = 0xc028445a DIOCCLRSRCNODES = 0x20004455 DIOCCLRSTATES = 0xc0e04412 DIOCCLRSTATUS = 0xc0284416 DIOCGETLIMIT = 0xc0084427 DIOCGETQSTATS = 0xc1204460 DIOCGETQUEUE = 0xc110445f DIOCGETQUEUES = 0xc110445e DIOCGETRULE = 0xcd604407 DIOCGETRULES = 0xcd604406 DIOCGETRULESET = 0xc444443b DIOCGETRULESETS = 0xc444443a DIOCGETSRCNODES = 0xc0104454 DIOCGETSTATE = 0xc1084413 DIOCGETSTATES = 0xc0104419 DIOCGETSTATUS = 0xc1e84415 DIOCGETSYNFLWATS = 0xc0084463 DIOCGETTIMEOUT = 0xc008441e DIOCIGETIFACES = 0xc0284457 DIOCKILLSRCNODES = 0xc080445b DIOCKILLSTATES = 0xc0e04429 DIOCNATLOOK = 0xc0504417 DIOCOSFPADD = 0xc088444f DIOCOSFPFLUSH = 0x2000444e DIOCOSFPGET = 0xc0884450 DIOCRADDADDRS = 0xc4504443 DIOCRADDTABLES = 0xc450443d DIOCRCLRADDRS = 0xc4504442 DIOCRCLRASTATS = 0xc4504448 DIOCRCLRTABLES = 0xc450443c DIOCRCLRTSTATS = 0xc4504441 DIOCRDELADDRS = 0xc4504444 DIOCRDELTABLES = 0xc450443e DIOCRGETADDRS = 0xc4504446 DIOCRGETASTATS = 0xc4504447 DIOCRGETTABLES = 0xc450443f DIOCRGETTSTATS = 0xc4504440 DIOCRINADEFINE = 0xc450444d DIOCRSETADDRS = 0xc4504445 DIOCRSETTFLAGS = 0xc450444a DIOCRTSTADDRS = 0xc4504449 DIOCSETDEBUG = 0xc0044418 DIOCSETHOSTID = 0xc0044456 DIOCSETIFFLAG = 0xc0284459 DIOCSETLIMIT = 0xc0084428 DIOCSETREASS = 0xc004445c DIOCSETSTATUSIF = 0xc0284414 DIOCSETSYNCOOKIES = 0xc0014462 DIOCSETSYNFLWATS = 0xc0084461 DIOCSETTIMEOUT = 0xc008441d DIOCSTART = 0x20004401 DIOCSTOP = 0x20004402 DIOCXBEGIN = 0xc0104451 DIOCXCOMMIT = 0xc0104452 DIOCXROLLBACK = 0xc0104453 DLT_ARCNET = 0x7 DLT_ATM_RFC1483 = 0xb DLT_AX25 = 0x3 DLT_CHAOS = 0x5 DLT_C_HDLC = 0x68 DLT_EN10MB = 0x1 DLT_EN3MB = 0x2 DLT_ENC = 0xd DLT_FDDI = 0xa DLT_IEEE802 = 0x6 DLT_IEEE802_11 = 0x69 DLT_IEEE802_11_RADIO = 0x7f DLT_LOOP = 0xc DLT_MPLS = 0xdb DLT_NULL = 0x0 DLT_OPENFLOW = 0x10b DLT_PFLOG = 0x75 DLT_PFSYNC = 0x12 DLT_PPP = 0x9 DLT_PPP_BSDOS = 0x10 DLT_PPP_ETHER = 0x33 DLT_PPP_SERIAL = 0x32 DLT_PRONET = 0x4 DLT_RAW = 0xe DLT_SLIP = 0x8 DLT_SLIP_BSDOS = 0xf DLT_USBPCAP = 0xf9 DLT_USER0 = 0x93 DLT_USER1 = 0x94 DLT_USER10 = 0x9d DLT_USER11 = 0x9e DLT_USER12 = 0x9f DLT_USER13 = 0xa0 DLT_USER14 = 0xa1 DLT_USER15 = 0xa2 DLT_USER2 = 0x95 DLT_USER3 = 0x96 DLT_USER4 = 0x97 DLT_USER5 = 0x98 DLT_USER6 = 0x99 DLT_USER7 = 0x9a DLT_USER8 = 0x9b DLT_USER9 = 0x9c DT_BLK = 0x6 DT_CHR = 0x2 DT_DIR = 0x4 DT_FIFO = 0x1 DT_LNK = 0xa DT_REG = 0x8 DT_SOCK = 0xc DT_UNKNOWN = 0x0 ECHO = 0x8 ECHOCTL = 0x40 ECHOE = 0x2 ECHOK = 0x4 ECHOKE = 0x1 ECHONL = 0x10 ECHOPRT = 0x20 EMT_TAGOVF = 0x1 EMUL_ENABLED = 0x1 EMUL_NATIVE = 0x2 ENDRUNDISC = 0x9 ETH64_8021_RSVD_MASK = 0xfffffffffff0 ETH64_8021_RSVD_PREFIX = 0x180c2000000 ETHERMIN = 0x2e ETHERMTU = 0x5dc ETHERTYPE_8023 = 0x4 ETHERTYPE_AARP = 0x80f3 ETHERTYPE_ACCTON = 0x8390 ETHERTYPE_AEONIC = 0x8036 ETHERTYPE_ALPHA = 0x814a ETHERTYPE_AMBER = 0x6008 ETHERTYPE_AMOEBA = 0x8145 ETHERTYPE_AOE = 0x88a2 ETHERTYPE_APOLLO = 0x80f7 ETHERTYPE_APOLLODOMAIN = 0x8019 ETHERTYPE_APPLETALK = 0x809b ETHERTYPE_APPLITEK = 0x80c7 ETHERTYPE_ARGONAUT = 0x803a ETHERTYPE_ARP = 0x806 ETHERTYPE_AT = 0x809b ETHERTYPE_ATALK = 0x809b ETHERTYPE_ATOMIC = 0x86df ETHERTYPE_ATT = 0x8069 ETHERTYPE_ATTSTANFORD = 0x8008 ETHERTYPE_AUTOPHON = 0x806a ETHERTYPE_AXIS = 0x8856 ETHERTYPE_BCLOOP = 0x9003 ETHERTYPE_BOFL = 0x8102 ETHERTYPE_CABLETRON = 0x7034 ETHERTYPE_CHAOS = 0x804 ETHERTYPE_COMDESIGN = 0x806c ETHERTYPE_COMPUGRAPHIC = 0x806d ETHERTYPE_COUNTERPOINT = 0x8062 ETHERTYPE_CRONUS = 0x8004 ETHERTYPE_CRONUSVLN = 0x8003 ETHERTYPE_DCA = 0x1234 ETHERTYPE_DDE = 0x807b ETHERTYPE_DEBNI = 0xaaaa ETHERTYPE_DECAM = 0x8048 ETHERTYPE_DECCUST = 0x6006 ETHERTYPE_DECDIAG = 0x6005 ETHERTYPE_DECDNS = 0x803c ETHERTYPE_DECDTS = 0x803e ETHERTYPE_DECEXPER = 0x6000 ETHERTYPE_DECLAST = 0x8041 ETHERTYPE_DECLTM = 0x803f ETHERTYPE_DECMUMPS = 0x6009 ETHERTYPE_DECNETBIOS = 0x8040 ETHERTYPE_DELTACON = 0x86de ETHERTYPE_DIDDLE = 0x4321 ETHERTYPE_DLOG1 = 0x660 ETHERTYPE_DLOG2 = 0x661 ETHERTYPE_DN = 0x6003 ETHERTYPE_DOGFIGHT = 0x1989 ETHERTYPE_DSMD = 0x8039 ETHERTYPE_EAPOL = 0x888e ETHERTYPE_ECMA = 0x803 ETHERTYPE_ENCRYPT = 0x803d ETHERTYPE_ES = 0x805d ETHERTYPE_EXCELAN = 0x8010 ETHERTYPE_EXPERDATA = 0x8049 ETHERTYPE_FLIP = 0x8146 ETHERTYPE_FLOWCONTROL = 0x8808 ETHERTYPE_FRARP = 0x808 ETHERTYPE_GENDYN = 0x8068 ETHERTYPE_HAYES = 0x8130 ETHERTYPE_HIPPI_FP = 0x8180 ETHERTYPE_HITACHI = 0x8820 ETHERTYPE_HP = 0x8005 ETHERTYPE_IEEEPUP = 0xa00 ETHERTYPE_IEEEPUPAT = 0xa01 ETHERTYPE_IMLBL = 0x4c42 ETHERTYPE_IMLBLDIAG = 0x424c ETHERTYPE_IP = 0x800 ETHERTYPE_IPAS = 0x876c ETHERTYPE_IPV6 = 0x86dd ETHERTYPE_IPX = 0x8137 ETHERTYPE_IPXNEW = 0x8037 ETHERTYPE_KALPANA = 0x8582 ETHERTYPE_LANBRIDGE = 0x8038 ETHERTYPE_LANPROBE = 0x8888 ETHERTYPE_LAT = 0x6004 ETHERTYPE_LBACK = 0x9000 ETHERTYPE_LITTLE = 0x8060 ETHERTYPE_LLDP = 0x88cc ETHERTYPE_LOGICRAFT = 0x8148 ETHERTYPE_LOOPBACK = 0x9000 ETHERTYPE_MACSEC = 0x88e5 ETHERTYPE_MATRA = 0x807a ETHERTYPE_MAX = 0xffff ETHERTYPE_MERIT = 0x807c ETHERTYPE_MICP = 0x873a ETHERTYPE_MOPDL = 0x6001 ETHERTYPE_MOPRC = 0x6002 ETHERTYPE_MOTOROLA = 0x818d ETHERTYPE_MPLS = 0x8847 ETHERTYPE_MPLS_MCAST = 0x8848 ETHERTYPE_MUMPS = 0x813f ETHERTYPE_NBPCC = 0x3c04 ETHERTYPE_NBPCLAIM = 0x3c09 ETHERTYPE_NBPCLREQ = 0x3c05 ETHERTYPE_NBPCLRSP = 0x3c06 ETHERTYPE_NBPCREQ = 0x3c02 ETHERTYPE_NBPCRSP = 0x3c03 ETHERTYPE_NBPDG = 0x3c07 ETHERTYPE_NBPDGB = 0x3c08 ETHERTYPE_NBPDLTE = 0x3c0a ETHERTYPE_NBPRAR = 0x3c0c ETHERTYPE_NBPRAS = 0x3c0b ETHERTYPE_NBPRST = 0x3c0d ETHERTYPE_NBPSCD = 0x3c01 ETHERTYPE_NBPVCD = 0x3c00 ETHERTYPE_NBS = 0x802 ETHERTYPE_NCD = 0x8149 ETHERTYPE_NESTAR = 0x8006 ETHERTYPE_NETBEUI = 0x8191 ETHERTYPE_NHRP = 0x2001 ETHERTYPE_NOVELL = 0x8138 ETHERTYPE_NS = 0x600 ETHERTYPE_NSAT = 0x601 ETHERTYPE_NSCOMPAT = 0x807 ETHERTYPE_NSH = 0x984f ETHERTYPE_NTRAILER = 0x10 ETHERTYPE_OS9 = 0x7007 ETHERTYPE_OS9NET = 0x7009 ETHERTYPE_PACER = 0x80c6 ETHERTYPE_PBB = 0x88e7 ETHERTYPE_PCS = 0x4242 ETHERTYPE_PLANNING = 0x8044 ETHERTYPE_PPP = 0x880b ETHERTYPE_PPPOE = 0x8864 ETHERTYPE_PPPOEDISC = 0x8863 ETHERTYPE_PRIMENTS = 0x7031 ETHERTYPE_PUP = 0x200 ETHERTYPE_PUPAT = 0x200 ETHERTYPE_QINQ = 0x88a8 ETHERTYPE_RACAL = 0x7030 ETHERTYPE_RATIONAL = 0x8150 ETHERTYPE_RAWFR = 0x6559 ETHERTYPE_RCL = 0x1995 ETHERTYPE_RDP = 0x8739 ETHERTYPE_RETIX = 0x80f2 ETHERTYPE_REVARP = 0x8035 ETHERTYPE_SCA = 0x6007 ETHERTYPE_SECTRA = 0x86db ETHERTYPE_SECUREDATA = 0x876d ETHERTYPE_SGITW = 0x817e ETHERTYPE_SG_BOUNCE = 0x8016 ETHERTYPE_SG_DIAG = 0x8013 ETHERTYPE_SG_NETGAMES = 0x8014 ETHERTYPE_SG_RESV = 0x8015 ETHERTYPE_SIMNET = 0x5208 ETHERTYPE_SLOW = 0x8809 ETHERTYPE_SNA = 0x80d5 ETHERTYPE_SNMP = 0x814c ETHERTYPE_SONIX = 0xfaf5 ETHERTYPE_SPIDER = 0x809f ETHERTYPE_SPRITE = 0x500 ETHERTYPE_STP = 0x8181 ETHERTYPE_TALARIS = 0x812b ETHERTYPE_TALARISMC = 0x852b ETHERTYPE_TCPCOMP = 0x876b ETHERTYPE_TCPSM = 0x9002 ETHERTYPE_TEC = 0x814f ETHERTYPE_TIGAN = 0x802f ETHERTYPE_TRAIL = 0x1000 ETHERTYPE_TRANSETHER = 0x6558 ETHERTYPE_TYMSHARE = 0x802e ETHERTYPE_UBBST = 0x7005 ETHERTYPE_UBDEBUG = 0x900 ETHERTYPE_UBDIAGLOOP = 0x7002 ETHERTYPE_UBDL = 0x7000 ETHERTYPE_UBNIU = 0x7001 ETHERTYPE_UBNMC = 0x7003 ETHERTYPE_VALID = 0x1600 ETHERTYPE_VARIAN = 0x80dd ETHERTYPE_VAXELN = 0x803b ETHERTYPE_VEECO = 0x8067 ETHERTYPE_VEXP = 0x805b ETHERTYPE_VGLAB = 0x8131 ETHERTYPE_VINES = 0xbad ETHERTYPE_VINESECHO = 0xbaf ETHERTYPE_VINESLOOP = 0xbae ETHERTYPE_VITAL = 0xff00 ETHERTYPE_VLAN = 0x8100 ETHERTYPE_VLTLMAN = 0x8080 ETHERTYPE_VPROD = 0x805c ETHERTYPE_VURESERVED = 0x8147 ETHERTYPE_WATERLOO = 0x8130 ETHERTYPE_WELLFLEET = 0x8103 ETHERTYPE_X25 = 0x805 ETHERTYPE_X75 = 0x801 ETHERTYPE_XNSSM = 0x9001 ETHERTYPE_XTP = 0x817d ETHER_ADDR_LEN = 0x6 ETHER_ALIGN = 0x2 ETHER_CRC_LEN = 0x4 ETHER_CRC_POLY_BE = 0x4c11db6 ETHER_CRC_POLY_LE = 0xedb88320 ETHER_HDR_LEN = 0xe ETHER_MAX_DIX_LEN = 0x600 ETHER_MAX_HARDMTU_LEN = 0xff9b ETHER_MAX_LEN = 0x5ee ETHER_MIN_LEN = 0x40 ETHER_TYPE_LEN = 0x2 ETHER_VLAN_ENCAP_LEN = 0x4 EVFILT_AIO = -0x3 EVFILT_DEVICE = -0x8 EVFILT_EXCEPT = -0x9 EVFILT_PROC = -0x5 EVFILT_READ = -0x1 EVFILT_SIGNAL = -0x6 EVFILT_SYSCOUNT = 0x9 EVFILT_TIMER = -0x7 EVFILT_VNODE = -0x4 EVFILT_WRITE = -0x2 EVL_ENCAPLEN = 0x4 EVL_PRIO_BITS = 0xd EVL_PRIO_MAX = 0x7 EVL_VLID_MASK = 0xfff EVL_VLID_MAX = 0xffe EVL_VLID_MIN = 0x1 EVL_VLID_NULL = 0x0 EV_ADD = 0x1 EV_CLEAR = 0x20 EV_DELETE = 0x2 EV_DISABLE = 0x8 EV_DISPATCH = 0x80 EV_ENABLE = 0x4 EV_EOF = 0x8000 EV_ERROR = 0x4000 EV_FLAG1 = 0x2000 EV_ONESHOT = 0x10 EV_RECEIPT = 0x40 EV_SYSFLAGS = 0xf800 EXTA = 0x4b00 EXTB = 0x9600 EXTPROC = 0x800 FD_CLOEXEC = 0x1 FD_SETSIZE = 0x400 FLUSHO = 0x800000 F_DUPFD = 0x0 F_DUPFD_CLOEXEC = 0xa F_GETFD = 0x1 F_GETFL = 0x3 F_GETLK = 0x7 F_GETOWN = 0x5 F_ISATTY = 0xb F_OK = 0x0 F_RDLCK = 0x1 F_SETFD = 0x2 F_SETFL = 0x4 F_SETLK = 0x8 F_SETLKW = 0x9 F_SETOWN = 0x6 F_UNLCK = 0x2 F_WRLCK = 0x3 HUPCL = 0x4000 HW_MACHINE = 0x1 ICANON = 0x100 ICMP6_FILTER = 0x12 ICRNL = 0x100 IEXTEN = 0x400 IFAN_ARRIVAL = 0x0 IFAN_DEPARTURE = 0x1 IFF_ALLMULTI = 0x200 IFF_BROADCAST = 0x2 IFF_CANTCHANGE = 0x8e52 IFF_DEBUG = 0x4 IFF_LINK0 = 0x1000 IFF_LINK1 = 0x2000 IFF_LINK2 = 0x4000 IFF_LOOPBACK = 0x8 IFF_MULTICAST = 0x8000 IFF_NOARP = 0x80 IFF_OACTIVE = 0x400 IFF_POINTOPOINT = 0x10 IFF_PROMISC = 0x100 IFF_RUNNING = 0x40 IFF_SIMPLEX = 0x800 IFF_STATICARP = 0x20 IFF_UP = 0x1 IFNAMSIZ = 0x10 IFT_1822 = 0x2 IFT_A12MPPSWITCH = 0x82 IFT_AAL2 = 0xbb IFT_AAL5 = 0x31 IFT_ADSL = 0x5e IFT_AFLANE8023 = 0x3b IFT_AFLANE8025 = 0x3c IFT_ARAP = 0x58 IFT_ARCNET = 0x23 IFT_ARCNETPLUS = 0x24 IFT_ASYNC = 0x54 IFT_ATM = 0x25 IFT_ATMDXI = 0x69 IFT_ATMFUNI = 0x6a IFT_ATMIMA = 0x6b IFT_ATMLOGICAL = 0x50 IFT_ATMRADIO = 0xbd IFT_ATMSUBINTERFACE = 0x86 IFT_ATMVCIENDPT = 0xc2 IFT_ATMVIRTUAL = 0x95 IFT_BGPPOLICYACCOUNTING = 0xa2 IFT_BLUETOOTH = 0xf8 IFT_BRIDGE = 0xd1 IFT_BSC = 0x53 IFT_CARP = 0xf7 IFT_CCTEMUL = 0x3d IFT_CEPT = 0x13 IFT_CES = 0x85 IFT_CHANNEL = 0x46 IFT_CNR = 0x55 IFT_COFFEE = 0x84 IFT_COMPOSITELINK = 0x9b IFT_DCN = 0x8d IFT_DIGITALPOWERLINE = 0x8a IFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba IFT_DLSW = 0x4a IFT_DOCSCABLEDOWNSTREAM = 0x80 IFT_DOCSCABLEMACLAYER = 0x7f IFT_DOCSCABLEUPSTREAM = 0x81 IFT_DOCSCABLEUPSTREAMCHANNEL = 0xcd IFT_DS0 = 0x51 IFT_DS0BUNDLE = 0x52 IFT_DS1FDL = 0xaa IFT_DS3 = 0x1e IFT_DTM = 0x8c IFT_DUMMY = 0xf1 IFT_DVBASILN = 0xac IFT_DVBASIOUT = 0xad IFT_DVBRCCDOWNSTREAM = 0x93 IFT_DVBRCCMACLAYER = 0x92 IFT_DVBRCCUPSTREAM = 0x94 IFT_ECONET = 0xce IFT_ENC = 0xf4 IFT_EON = 0x19 IFT_EPLRS = 0x57 IFT_ESCON = 0x49 IFT_ETHER = 0x6 IFT_FAITH = 0xf3 IFT_FAST = 0x7d IFT_FASTETHER = 0x3e IFT_FASTETHERFX = 0x45 IFT_FDDI = 0xf IFT_FIBRECHANNEL = 0x38 IFT_FRAMERELAYINTERCONNECT = 0x3a IFT_FRAMERELAYMPI = 0x5c IFT_FRDLCIENDPT = 0xc1 IFT_FRELAY = 0x20 IFT_FRELAYDCE = 0x2c IFT_FRF16MFRBUNDLE = 0xa3 IFT_FRFORWARD = 0x9e IFT_G703AT2MB = 0x43 IFT_G703AT64K = 0x42 IFT_GIF = 0xf0 IFT_GIGABITETHERNET = 0x75 IFT_GR303IDT = 0xb2 IFT_GR303RDT = 0xb1 IFT_H323GATEKEEPER = 0xa4 IFT_H323PROXY = 0xa5 IFT_HDH1822 = 0x3 IFT_HDLC = 0x76 IFT_HDSL2 = 0xa8 IFT_HIPERLAN2 = 0xb7 IFT_HIPPI = 0x2f IFT_HIPPIINTERFACE = 0x39 IFT_HOSTPAD = 0x5a IFT_HSSI = 0x2e IFT_HY = 0xe IFT_IBM370PARCHAN = 0x48 IFT_IDSL = 0x9a IFT_IEEE1394 = 0x90 IFT_IEEE80211 = 0x47 IFT_IEEE80212 = 0x37 IFT_IEEE8023ADLAG = 0xa1 IFT_IFGSN = 0x91 IFT_IMT = 0xbe IFT_INFINIBAND = 0xc7 IFT_INTERLEAVE = 0x7c IFT_IP = 0x7e IFT_IPFORWARD = 0x8e IFT_IPOVERATM = 0x72 IFT_IPOVERCDLC = 0x6d IFT_IPOVERCLAW = 0x6e IFT_IPSWITCH = 0x4e IFT_ISDN = 0x3f IFT_ISDNBASIC = 0x14 IFT_ISDNPRIMARY = 0x15 IFT_ISDNS = 0x4b IFT_ISDNU = 0x4c IFT_ISO88022LLC = 0x29 IFT_ISO88023 = 0x7 IFT_ISO88024 = 0x8 IFT_ISO88025 = 0x9 IFT_ISO88025CRFPINT = 0x62 IFT_ISO88025DTR = 0x56 IFT_ISO88025FIBER = 0x73 IFT_ISO88026 = 0xa IFT_ISUP = 0xb3 IFT_L2VLAN = 0x87 IFT_L3IPVLAN = 0x88 IFT_L3IPXVLAN = 0x89 IFT_LAPB = 0x10 IFT_LAPD = 0x4d IFT_LAPF = 0x77 IFT_LINEGROUP = 0xd2 IFT_LOCALTALK = 0x2a IFT_LOOP = 0x18 IFT_MBIM = 0xfa IFT_MEDIAMAILOVERIP = 0x8b IFT_MFSIGLINK = 0xa7 IFT_MIOX25 = 0x26 IFT_MODEM = 0x30 IFT_MPC = 0x71 IFT_MPLS = 0xa6 IFT_MPLSTUNNEL = 0x96 IFT_MSDSL = 0x8f IFT_MVL = 0xbf IFT_MYRINET = 0x63 IFT_NFAS = 0xaf IFT_NSIP = 0x1b IFT_OPTICALCHANNEL = 0xc3 IFT_OPTICALTRANSPORT = 0xc4 IFT_OTHER = 0x1 IFT_P10 = 0xc IFT_P80 = 0xd IFT_PARA = 0x22 IFT_PFLOG = 0xf5 IFT_PFLOW = 0xf9 IFT_PFSYNC = 0xf6 IFT_PLC = 0xae IFT_PON155 = 0xcf IFT_PON622 = 0xd0 IFT_POS = 0xab IFT_PPP = 0x17 IFT_PPPMULTILINKBUNDLE = 0x6c IFT_PROPATM = 0xc5 IFT_PROPBWAP2MP = 0xb8 IFT_PROPCNLS = 0x59 IFT_PROPDOCSWIRELESSDOWNSTREAM = 0xb5 IFT_PROPDOCSWIRELESSMACLAYER = 0xb4 IFT_PROPDOCSWIRELESSUPSTREAM = 0xb6 IFT_PROPMUX = 0x36 IFT_PROPVIRTUAL = 0x35 IFT_PROPWIRELESSP2P = 0x9d IFT_PTPSERIAL = 0x16 IFT_PVC = 0xf2 IFT_Q2931 = 0xc9 IFT_QLLC = 0x44 IFT_RADIOMAC = 0xbc IFT_RADSL = 0x5f IFT_REACHDSL = 0xc0 IFT_RFC1483 = 0x9f IFT_RS232 = 0x21 IFT_RSRB = 0x4f IFT_SDLC = 0x11 IFT_SDSL = 0x60 IFT_SHDSL = 0xa9 IFT_SIP = 0x1f IFT_SIPSIG = 0xcc IFT_SIPTG = 0xcb IFT_SLIP = 0x1c IFT_SMDSDXI = 0x2b IFT_SMDSICIP = 0x34 IFT_SONET = 0x27 IFT_SONETOVERHEADCHANNEL = 0xb9 IFT_SONETPATH = 0x32 IFT_SONETVT = 0x33 IFT_SRP = 0x97 IFT_SS7SIGLINK = 0x9c IFT_STACKTOSTACK = 0x6f IFT_STARLAN = 0xb IFT_T1 = 0x12 IFT_TDLC = 0x74 IFT_TELINK = 0xc8 IFT_TERMPAD = 0x5b IFT_TR008 = 0xb0 IFT_TRANSPHDLC = 0x7b IFT_TUNNEL = 0x83 IFT_ULTRA = 0x1d IFT_USB = 0xa0 IFT_V11 = 0x40 IFT_V35 = 0x2d IFT_V36 = 0x41 IFT_V37 = 0x78 IFT_VDSL = 0x61 IFT_VIRTUALIPADDRESS = 0x70 IFT_VIRTUALTG = 0xca IFT_VOICEDID = 0xd5 IFT_VOICEEM = 0x64 IFT_VOICEEMFGD = 0xd3 IFT_VOICEENCAP = 0x67 IFT_VOICEFGDEANA = 0xd4 IFT_VOICEFXO = 0x65 IFT_VOICEFXS = 0x66 IFT_VOICEOVERATM = 0x98 IFT_VOICEOVERCABLE = 0xc6 IFT_VOICEOVERFRAMERELAY = 0x99 IFT_VOICEOVERIP = 0x68 IFT_WIREGUARD = 0xfb IFT_X213 = 0x5d IFT_X25 = 0x5 IFT_X25DDN = 0x4 IFT_X25HUNTGROUP = 0x7a IFT_X25MLP = 0x79 IFT_X25PLE = 0x28 IFT_XETHER = 0x1a IGNBRK = 0x1 IGNCR = 0x80 IGNPAR = 0x4 IMAXBEL = 0x2000 INLCR = 0x40 INPCK = 0x10 IN_CLASSA_HOST = 0xffffff IN_CLASSA_MAX = 0x80 IN_CLASSA_NET = 0xff000000 IN_CLASSA_NSHIFT = 0x18 IN_CLASSB_HOST = 0xffff IN_CLASSB_MAX = 0x10000 IN_CLASSB_NET = 0xffff0000 IN_CLASSB_NSHIFT = 0x10 IN_CLASSC_HOST = 0xff IN_CLASSC_NET = 0xffffff00 IN_CLASSC_NSHIFT = 0x8 IN_CLASSD_HOST = 0xfffffff IN_CLASSD_NET = 0xf0000000 IN_CLASSD_NSHIFT = 0x1c IN_LOOPBACKNET = 0x7f IN_RFC3021_HOST = 0x1 IN_RFC3021_NET = 0xfffffffe IN_RFC3021_NSHIFT = 0x1f IPPROTO_AH = 0x33 IPPROTO_CARP = 0x70 IPPROTO_DIVERT = 0x102 IPPROTO_DONE = 0x101 IPPROTO_DSTOPTS = 0x3c IPPROTO_EGP = 0x8 IPPROTO_ENCAP = 0x62 IPPROTO_EON = 0x50 IPPROTO_ESP = 0x32 IPPROTO_ETHERIP = 0x61 IPPROTO_FRAGMENT = 0x2c IPPROTO_GGP = 0x3 IPPROTO_GRE = 0x2f IPPROTO_HOPOPTS = 0x0 IPPROTO_ICMP = 0x1 IPPROTO_ICMPV6 = 0x3a IPPROTO_IDP = 0x16 IPPROTO_IGMP = 0x2 IPPROTO_IP = 0x0 IPPROTO_IPCOMP = 0x6c IPPROTO_IPIP = 0x4 IPPROTO_IPV4 = 0x4 IPPROTO_IPV6 = 0x29 IPPROTO_MAX = 0x100 IPPROTO_MAXID = 0x103 IPPROTO_MOBILE = 0x37 IPPROTO_MPLS = 0x89 IPPROTO_NONE = 0x3b IPPROTO_PFSYNC = 0xf0 IPPROTO_PIM = 0x67 IPPROTO_PUP = 0xc IPPROTO_RAW = 0xff IPPROTO_ROUTING = 0x2b IPPROTO_RSVP = 0x2e IPPROTO_SCTP = 0x84 IPPROTO_TCP = 0x6 IPPROTO_TP = 0x1d IPPROTO_UDP = 0x11 IPPROTO_UDPLITE = 0x88 IPV6_AUTH_LEVEL = 0x35 IPV6_AUTOFLOWLABEL = 0x3b IPV6_CHECKSUM = 0x1a IPV6_DEFAULT_MULTICAST_HOPS = 0x1 IPV6_DEFAULT_MULTICAST_LOOP = 0x1 IPV6_DEFHLIM = 0x40 IPV6_DONTFRAG = 0x3e IPV6_DSTOPTS = 0x32 IPV6_ESP_NETWORK_LEVEL = 0x37 IPV6_ESP_TRANS_LEVEL = 0x36 IPV6_FAITH = 0x1d IPV6_FLOWINFO_MASK = 0xfffffff IPV6_FLOWLABEL_MASK = 0xfffff IPV6_FRAGTTL = 0x78 IPV6_HLIMDEC = 0x1 IPV6_HOPLIMIT = 0x2f IPV6_HOPOPTS = 0x31 IPV6_IPCOMP_LEVEL = 0x3c IPV6_JOIN_GROUP = 0xc IPV6_LEAVE_GROUP = 0xd IPV6_MAXHLIM = 0xff IPV6_MAXPACKET = 0xffff IPV6_MINHOPCOUNT = 0x41 IPV6_MMTU = 0x500 IPV6_MULTICAST_HOPS = 0xa IPV6_MULTICAST_IF = 0x9 IPV6_MULTICAST_LOOP = 0xb IPV6_NEXTHOP = 0x30 IPV6_OPTIONS = 0x1 IPV6_PATHMTU = 0x2c IPV6_PIPEX = 0x3f IPV6_PKTINFO = 0x2e IPV6_PORTRANGE = 0xe IPV6_PORTRANGE_DEFAULT = 0x0 IPV6_PORTRANGE_HIGH = 0x1 IPV6_PORTRANGE_LOW = 0x2 IPV6_RECVDSTOPTS = 0x28 IPV6_RECVDSTPORT = 0x40 IPV6_RECVHOPLIMIT = 0x25 IPV6_RECVHOPOPTS = 0x27 IPV6_RECVPATHMTU = 0x2b IPV6_RECVPKTINFO = 0x24 IPV6_RECVRTHDR = 0x26 IPV6_RECVTCLASS = 0x39 IPV6_RTABLE = 0x1021 IPV6_RTHDR = 0x33 IPV6_RTHDRDSTOPTS = 0x23 IPV6_RTHDR_LOOSE = 0x0 IPV6_RTHDR_STRICT = 0x1 IPV6_RTHDR_TYPE_0 = 0x0 IPV6_SOCKOPT_RESERVED1 = 0x3 IPV6_TCLASS = 0x3d IPV6_UNICAST_HOPS = 0x4 IPV6_USE_MIN_MTU = 0x2a IPV6_V6ONLY = 0x1b IPV6_VERSION = 0x60 IPV6_VERSION_MASK = 0xf0 IP_ADD_MEMBERSHIP = 0xc IP_AUTH_LEVEL = 0x14 IP_DEFAULT_MULTICAST_LOOP = 0x1 IP_DEFAULT_MULTICAST_TTL = 0x1 IP_DF = 0x4000 IP_DROP_MEMBERSHIP = 0xd IP_ESP_NETWORK_LEVEL = 0x16 IP_ESP_TRANS_LEVEL = 0x15 IP_HDRINCL = 0x2 IP_IPCOMP_LEVEL = 0x1d IP_IPDEFTTL = 0x25 IP_IPSECFLOWINFO = 0x24 IP_IPSEC_LOCAL_AUTH = 0x1b IP_IPSEC_LOCAL_CRED = 0x19 IP_IPSEC_LOCAL_ID = 0x17 IP_IPSEC_REMOTE_AUTH = 0x1c IP_IPSEC_REMOTE_CRED = 0x1a IP_IPSEC_REMOTE_ID = 0x18 IP_MAXPACKET = 0xffff IP_MAX_MEMBERSHIPS = 0xfff IP_MF = 0x2000 IP_MINTTL = 0x20 IP_MIN_MEMBERSHIPS = 0xf IP_MSS = 0x240 IP_MULTICAST_IF = 0x9 IP_MULTICAST_LOOP = 0xb IP_MULTICAST_TTL = 0xa IP_OFFMASK = 0x1fff IP_OPTIONS = 0x1 IP_PIPEX = 0x22 IP_PORTRANGE = 0x13 IP_PORTRANGE_DEFAULT = 0x0 IP_PORTRANGE_HIGH = 0x1 IP_PORTRANGE_LOW = 0x2 IP_RECVDSTADDR = 0x7 IP_RECVDSTPORT = 0x21 IP_RECVIF = 0x1e IP_RECVOPTS = 0x5 IP_RECVRETOPTS = 0x6 IP_RECVRTABLE = 0x23 IP_RECVTTL = 0x1f IP_RETOPTS = 0x8 IP_RF = 0x8000 IP_RTABLE = 0x1021 IP_SENDSRCADDR = 0x7 IP_TOS = 0x3 IP_TTL = 0x4 ISIG = 0x80 ISTRIP = 0x20 ITIMER_PROF = 0x2 ITIMER_REAL = 0x0 ITIMER_VIRTUAL = 0x1 IUCLC = 0x1000 IXANY = 0x800 IXOFF = 0x400 IXON = 0x200 KERN_HOSTNAME = 0xa KERN_OSRELEASE = 0x2 KERN_OSTYPE = 0x1 KERN_VERSION = 0x4 LCNT_OVERLOAD_FLUSH = 0x6 LOCK_EX = 0x2 LOCK_NB = 0x4 LOCK_SH = 0x1 LOCK_UN = 0x8 MADV_DONTNEED = 0x4 MADV_FREE = 0x6 MADV_NORMAL = 0x0 MADV_RANDOM = 0x1 MADV_SEQUENTIAL = 0x2 MADV_SPACEAVAIL = 0x5 MADV_WILLNEED = 0x3 MAP_ANON = 0x1000 MAP_ANONYMOUS = 0x1000 MAP_CONCEAL = 0x8000 MAP_COPY = 0x2 MAP_FILE = 0x0 MAP_FIXED = 0x10 MAP_FLAGMASK = 0xfff7 MAP_HASSEMAPHORE = 0x0 MAP_INHERIT = 0x0 MAP_INHERIT_COPY = 0x1 MAP_INHERIT_NONE = 0x2 MAP_INHERIT_SHARE = 0x0 MAP_INHERIT_ZERO = 0x3 MAP_NOEXTEND = 0x0 MAP_NORESERVE = 0x0 MAP_PRIVATE = 0x2 MAP_RENAME = 0x0 MAP_SHARED = 0x1 MAP_STACK = 0x4000 MAP_TRYFIXED = 0x0 MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MNT_ASYNC = 0x40 MNT_DEFEXPORTED = 0x200 MNT_DELEXPORT = 0x20000 MNT_DOOMED = 0x8000000 MNT_EXPORTANON = 0x400 MNT_EXPORTED = 0x100 MNT_EXRDONLY = 0x80 MNT_FORCE = 0x80000 MNT_LAZY = 0x3 MNT_LOCAL = 0x1000 MNT_NOATIME = 0x8000 MNT_NODEV = 0x10 MNT_NOEXEC = 0x4 MNT_NOPERM = 0x20 MNT_NOSUID = 0x8 MNT_NOWAIT = 0x2 MNT_QUOTA = 0x2000 MNT_RDONLY = 0x1 MNT_RELOAD = 0x40000 MNT_ROOTFS = 0x4000 MNT_SOFTDEP = 0x4000000 MNT_STALLED = 0x100000 MNT_SWAPPABLE = 0x200000 MNT_SYNCHRONOUS = 0x2 MNT_UPDATE = 0x10000 MNT_VISFLAGMASK = 0x400ffff MNT_WAIT = 0x1 MNT_WANTRDWR = 0x2000000 MNT_WXALLOWED = 0x800 MOUNT_AFS = "afs" MOUNT_CD9660 = "cd9660" MOUNT_EXT2FS = "ext2fs" MOUNT_FFS = "ffs" MOUNT_FUSEFS = "fuse" MOUNT_MFS = "mfs" MOUNT_MSDOS = "msdos" MOUNT_NCPFS = "ncpfs" MOUNT_NFS = "nfs" MOUNT_NTFS = "ntfs" MOUNT_TMPFS = "tmpfs" MOUNT_UDF = "udf" MOUNT_UFS = "ffs" MSG_BCAST = 0x100 MSG_CMSG_CLOEXEC = 0x800 MSG_CTRUNC = 0x20 MSG_DONTROUTE = 0x4 MSG_DONTWAIT = 0x80 MSG_EOR = 0x8 MSG_MCAST = 0x200 MSG_NOSIGNAL = 0x400 MSG_OOB = 0x1 MSG_PEEK = 0x2 MSG_TRUNC = 0x10 MSG_WAITALL = 0x40 MSG_WAITFORONE = 0x1000 MS_ASYNC = 0x1 MS_INVALIDATE = 0x4 MS_SYNC = 0x2 NAME_MAX = 0xff NET_RT_DUMP = 0x1 NET_RT_FLAGS = 0x2 NET_RT_IFLIST = 0x3 NET_RT_IFNAMES = 0x6 NET_RT_MAXID = 0x8 NET_RT_SOURCE = 0x7 NET_RT_STATS = 0x4 NET_RT_TABLE = 0x5 NFDBITS = 0x20 NOFLSH = 0x80000000 NOKERNINFO = 0x2000000 NOTE_ATTRIB = 0x8 NOTE_CHANGE = 0x1 NOTE_CHILD = 0x4 NOTE_DELETE = 0x1 NOTE_EOF = 0x2 NOTE_EXEC = 0x20000000 NOTE_EXIT = 0x80000000 NOTE_EXTEND = 0x4 NOTE_FORK = 0x40000000 NOTE_LINK = 0x10 NOTE_LOWAT = 0x1 NOTE_OOB = 0x4 NOTE_PCTRLMASK = 0xf0000000 NOTE_PDATAMASK = 0xfffff NOTE_RENAME = 0x20 NOTE_REVOKE = 0x40 NOTE_TRACK = 0x1 NOTE_TRACKERR = 0x2 NOTE_TRUNCATE = 0x80 NOTE_WRITE = 0x2 OCRNL = 0x10 OLCUC = 0x20 ONLCR = 0x2 ONLRET = 0x80 ONOCR = 0x40 ONOEOT = 0x8 OPOST = 0x1 OXTABS = 0x4 O_ACCMODE = 0x3 O_APPEND = 0x8 O_ASYNC = 0x40 O_CLOEXEC = 0x10000 O_CREAT = 0x200 O_DIRECTORY = 0x20000 O_DSYNC = 0x80 O_EXCL = 0x800 O_EXLOCK = 0x20 O_FSYNC = 0x80 O_NDELAY = 0x4 O_NOCTTY = 0x8000 O_NOFOLLOW = 0x100 O_NONBLOCK = 0x4 O_RDONLY = 0x0 O_RDWR = 0x2 O_RSYNC = 0x80 O_SHLOCK = 0x10 O_SYNC = 0x80 O_TRUNC = 0x400 O_WRONLY = 0x1 PARENB = 0x1000 PARMRK = 0x8 PARODD = 0x2000 PENDIN = 0x20000000 PF_FLUSH = 0x1 PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 PROT_EXEC = 0x4 PROT_NONE = 0x0 PROT_READ = 0x1 PROT_WRITE = 0x2 RLIMIT_CORE = 0x4 RLIMIT_CPU = 0x0 RLIMIT_DATA = 0x2 RLIMIT_FSIZE = 0x1 RLIMIT_MEMLOCK = 0x6 RLIMIT_NOFILE = 0x8 RLIMIT_NPROC = 0x7 RLIMIT_RSS = 0x5 RLIMIT_STACK = 0x3 RLIM_INFINITY = 0x7fffffffffffffff RTAX_AUTHOR = 0x6 RTAX_BFD = 0xb RTAX_BRD = 0x7 RTAX_DNS = 0xc RTAX_DST = 0x0 RTAX_GATEWAY = 0x1 RTAX_GENMASK = 0x3 RTAX_IFA = 0x5 RTAX_IFP = 0x4 RTAX_LABEL = 0xa RTAX_MAX = 0xf RTAX_NETMASK = 0x2 RTAX_SEARCH = 0xe RTAX_SRC = 0x8 RTAX_SRCMASK = 0x9 RTAX_STATIC = 0xd RTA_AUTHOR = 0x40 RTA_BFD = 0x800 RTA_BRD = 0x80 RTA_DNS = 0x1000 RTA_DST = 0x1 RTA_GATEWAY = 0x2 RTA_GENMASK = 0x8 RTA_IFA = 0x20 RTA_IFP = 0x10 RTA_LABEL = 0x400 RTA_NETMASK = 0x4 RTA_SEARCH = 0x4000 RTA_SRC = 0x100 RTA_SRCMASK = 0x200 RTA_STATIC = 0x2000 RTF_ANNOUNCE = 0x4000 RTF_BFD = 0x1000000 RTF_BLACKHOLE = 0x1000 RTF_BROADCAST = 0x400000 RTF_CACHED = 0x20000 RTF_CLONED = 0x10000 RTF_CLONING = 0x100 RTF_CONNECTED = 0x800000 RTF_DONE = 0x40 RTF_DYNAMIC = 0x10 RTF_FMASK = 0x110fc08 RTF_GATEWAY = 0x2 RTF_HOST = 0x4 RTF_LLINFO = 0x400 RTF_LOCAL = 0x200000 RTF_MODIFIED = 0x20 RTF_MPATH = 0x40000 RTF_MPLS = 0x100000 RTF_MULTICAST = 0x200 RTF_PERMANENT_ARP = 0x2000 RTF_PROTO1 = 0x8000 RTF_PROTO2 = 0x4000 RTF_PROTO3 = 0x2000 RTF_REJECT = 0x8 RTF_STATIC = 0x800 RTF_UP = 0x1 RTF_USETRAILERS = 0x8000 RTM_80211INFO = 0x15 RTM_ADD = 0x1 RTM_BFD = 0x12 RTM_CHANGE = 0x3 RTM_CHGADDRATTR = 0x14 RTM_DELADDR = 0xd RTM_DELETE = 0x2 RTM_DESYNC = 0x10 RTM_GET = 0x4 RTM_IFANNOUNCE = 0xf RTM_IFINFO = 0xe RTM_INVALIDATE = 0x11 RTM_LOSING = 0x5 RTM_MAXSIZE = 0x800 RTM_MISS = 0x7 RTM_NEWADDR = 0xc RTM_PROPOSAL = 0x13 RTM_REDIRECT = 0x6 RTM_RESOLVE = 0xb RTM_SOURCE = 0x16 RTM_VERSION = 0x5 RTV_EXPIRE = 0x4 RTV_HOPCOUNT = 0x2 RTV_MTU = 0x1 RTV_RPIPE = 0x8 RTV_RTT = 0x40 RTV_RTTVAR = 0x80 RTV_SPIPE = 0x10 RTV_SSTHRESH = 0x20 RT_TABLEID_BITS = 0x8 RT_TABLEID_MASK = 0xff RT_TABLEID_MAX = 0xff RUSAGE_CHILDREN = -0x1 RUSAGE_SELF = 0x0 RUSAGE_THREAD = 0x1 SCM_RIGHTS = 0x1 SCM_TIMESTAMP = 0x4 SEEK_CUR = 0x1 SEEK_END = 0x2 SEEK_SET = 0x0 SHUT_RD = 0x0 SHUT_RDWR = 0x2 SHUT_WR = 0x1 SIOCADDMULTI = 0x80206931 SIOCAIFADDR = 0x8040691a SIOCAIFGROUP = 0x80286987 SIOCATMARK = 0x40047307 SIOCBRDGADD = 0x8060693c SIOCBRDGADDL = 0x80606949 SIOCBRDGADDS = 0x80606941 SIOCBRDGARL = 0x808c694d SIOCBRDGDADDR = 0x81286947 SIOCBRDGDEL = 0x8060693d SIOCBRDGDELS = 0x80606942 SIOCBRDGFLUSH = 0x80606948 SIOCBRDGFRL = 0x808c694e SIOCBRDGGCACHE = 0xc0146941 SIOCBRDGGFD = 0xc0146952 SIOCBRDGGHT = 0xc0146951 SIOCBRDGGIFFLGS = 0xc060693e SIOCBRDGGMA = 0xc0146953 SIOCBRDGGPARAM = 0xc0406958 SIOCBRDGGPRI = 0xc0146950 SIOCBRDGGRL = 0xc030694f SIOCBRDGGTO = 0xc0146946 SIOCBRDGIFS = 0xc0606942 SIOCBRDGRTS = 0xc0206943 SIOCBRDGSADDR = 0xc1286944 SIOCBRDGSCACHE = 0x80146940 SIOCBRDGSFD = 0x80146952 SIOCBRDGSHT = 0x80146951 SIOCBRDGSIFCOST = 0x80606955 SIOCBRDGSIFFLGS = 0x8060693f SIOCBRDGSIFPRIO = 0x80606954 SIOCBRDGSIFPROT = 0x8060694a SIOCBRDGSMA = 0x80146953 SIOCBRDGSPRI = 0x80146950 SIOCBRDGSPROTO = 0x8014695a SIOCBRDGSTO = 0x80146945 SIOCBRDGSTXHC = 0x80146959 SIOCDELLABEL = 0x80206997 SIOCDELMULTI = 0x80206932 SIOCDIFADDR = 0x80206919 SIOCDIFGROUP = 0x80286989 SIOCDIFPARENT = 0x802069b4 SIOCDIFPHYADDR = 0x80206949 SIOCDPWE3NEIGHBOR = 0x802069de SIOCDVNETID = 0x802069af SIOCGETKALIVE = 0xc01869a4 SIOCGETLABEL = 0x8020699a SIOCGETMPWCFG = 0xc02069ae SIOCGETPFLOW = 0xc02069fe SIOCGETPFSYNC = 0xc02069f8 SIOCGETSGCNT = 0xc0207534 SIOCGETVIFCNT = 0xc0287533 SIOCGETVLAN = 0xc0206990 SIOCGIFADDR = 0xc0206921 SIOCGIFBRDADDR = 0xc0206923 SIOCGIFCONF = 0xc0106924 SIOCGIFDATA = 0xc020691b SIOCGIFDESCR = 0xc0206981 SIOCGIFDSTADDR = 0xc0206922 SIOCGIFFLAGS = 0xc0206911 SIOCGIFGATTR = 0xc028698b SIOCGIFGENERIC = 0xc020693a SIOCGIFGLIST = 0xc028698d SIOCGIFGMEMB = 0xc028698a SIOCGIFGROUP = 0xc0286988 SIOCGIFHARDMTU = 0xc02069a5 SIOCGIFLLPRIO = 0xc02069b6 SIOCGIFMEDIA = 0xc0406938 SIOCGIFMETRIC = 0xc0206917 SIOCGIFMTU = 0xc020697e SIOCGIFNETMASK = 0xc0206925 SIOCGIFPAIR = 0xc02069b1 SIOCGIFPARENT = 0xc02069b3 SIOCGIFPRIORITY = 0xc020699c SIOCGIFRDOMAIN = 0xc02069a0 SIOCGIFRTLABEL = 0xc0206983 SIOCGIFRXR = 0x802069aa SIOCGIFSFFPAGE = 0xc1126939 SIOCGIFXFLAGS = 0xc020699e SIOCGLIFPHYADDR = 0xc218694b SIOCGLIFPHYDF = 0xc02069c2 SIOCGLIFPHYECN = 0xc02069c8 SIOCGLIFPHYRTABLE = 0xc02069a2 SIOCGLIFPHYTTL = 0xc02069a9 SIOCGPGRP = 0x40047309 SIOCGPWE3 = 0xc0206998 SIOCGPWE3CTRLWORD = 0xc02069dc SIOCGPWE3FAT = 0xc02069dd SIOCGPWE3NEIGHBOR = 0xc21869de SIOCGRXHPRIO = 0xc02069db SIOCGSPPPPARAMS = 0xc0206994 SIOCGTXHPRIO = 0xc02069c6 SIOCGUMBINFO = 0xc02069be SIOCGUMBPARAM = 0xc02069c0 SIOCGVH = 0xc02069f6 SIOCGVNETFLOWID = 0xc02069c4 SIOCGVNETID = 0xc02069a7 SIOCIFAFATTACH = 0x801169ab SIOCIFAFDETACH = 0x801169ac SIOCIFCREATE = 0x8020697a SIOCIFDESTROY = 0x80206979 SIOCIFGCLONERS = 0xc0106978 SIOCSETKALIVE = 0x801869a3 SIOCSETLABEL = 0x80206999 SIOCSETMPWCFG = 0x802069ad SIOCSETPFLOW = 0x802069fd SIOCSETPFSYNC = 0x802069f7 SIOCSETVLAN = 0x8020698f SIOCSIFADDR = 0x8020690c SIOCSIFBRDADDR = 0x80206913 SIOCSIFDESCR = 0x80206980 SIOCSIFDSTADDR = 0x8020690e SIOCSIFFLAGS = 0x80206910 SIOCSIFGATTR = 0x8028698c SIOCSIFGENERIC = 0x80206939 SIOCSIFLLADDR = 0x8020691f SIOCSIFLLPRIO = 0x802069b5 SIOCSIFMEDIA = 0xc0206937 SIOCSIFMETRIC = 0x80206918 SIOCSIFMTU = 0x8020697f SIOCSIFNETMASK = 0x80206916 SIOCSIFPAIR = 0x802069b0 SIOCSIFPARENT = 0x802069b2 SIOCSIFPRIORITY = 0x8020699b SIOCSIFRDOMAIN = 0x8020699f SIOCSIFRTLABEL = 0x80206982 SIOCSIFXFLAGS = 0x8020699d SIOCSLIFPHYADDR = 0x8218694a SIOCSLIFPHYDF = 0x802069c1 SIOCSLIFPHYECN = 0x802069c7 SIOCSLIFPHYRTABLE = 0x802069a1 SIOCSLIFPHYTTL = 0x802069a8 SIOCSPGRP = 0x80047308 SIOCSPWE3CTRLWORD = 0x802069dc SIOCSPWE3FAT = 0x802069dd SIOCSPWE3NEIGHBOR = 0x821869de SIOCSRXHPRIO = 0x802069db SIOCSSPPPPARAMS = 0x80206993 SIOCSTXHPRIO = 0x802069c5 SIOCSUMBPARAM = 0x802069bf SIOCSVH = 0xc02069f5 SIOCSVNETFLOWID = 0x802069c3 SIOCSVNETID = 0x802069a6 SOCK_CLOEXEC = 0x8000 SOCK_DGRAM = 0x2 SOCK_DNS = 0x1000 SOCK_NONBLOCK = 0x4000 SOCK_RAW = 0x3 SOCK_RDM = 0x4 SOCK_SEQPACKET = 0x5 SOCK_STREAM = 0x1 SOL_SOCKET = 0xffff SOMAXCONN = 0x80 SO_ACCEPTCONN = 0x2 SO_BINDANY = 0x1000 SO_BROADCAST = 0x20 SO_DEBUG = 0x1 SO_DOMAIN = 0x1024 SO_DONTROUTE = 0x10 SO_ERROR = 0x1007 SO_KEEPALIVE = 0x8 SO_LINGER = 0x80 SO_NETPROC = 0x1020 SO_OOBINLINE = 0x100 SO_PEERCRED = 0x1022 SO_PROTOCOL = 0x1025 SO_RCVBUF = 0x1002 SO_RCVLOWAT = 0x1004 SO_RCVTIMEO = 0x1006 SO_REUSEADDR = 0x4 SO_REUSEPORT = 0x200 SO_RTABLE = 0x1021 SO_SNDBUF = 0x1001 SO_SNDLOWAT = 0x1003 SO_SNDTIMEO = 0x1005 SO_SPLICE = 0x1023 SO_TIMESTAMP = 0x800 SO_TYPE = 0x1008 SO_USELOOPBACK = 0x40 SO_ZEROIZE = 0x2000 S_BLKSIZE = 0x200 S_IEXEC = 0x40 S_IFBLK = 0x6000 S_IFCHR = 0x2000 S_IFDIR = 0x4000 S_IFIFO = 0x1000 S_IFLNK = 0xa000 S_IFMT = 0xf000 S_IFREG = 0x8000 S_IFSOCK = 0xc000 S_IREAD = 0x100 S_IRGRP = 0x20 S_IROTH = 0x4 S_IRUSR = 0x100 S_IRWXG = 0x38 S_IRWXO = 0x7 S_IRWXU = 0x1c0 S_ISGID = 0x400 S_ISTXT = 0x200 S_ISUID = 0x800 S_ISVTX = 0x200 S_IWGRP = 0x10 S_IWOTH = 0x2 S_IWRITE = 0x80 S_IWUSR = 0x80 S_IXGRP = 0x8 S_IXOTH = 0x1 S_IXUSR = 0x40 TCIFLUSH = 0x1 TCIOFF = 0x3 TCIOFLUSH = 0x3 TCION = 0x4 TCOFLUSH = 0x2 TCOOFF = 0x1 TCOON = 0x2 TCPOPT_EOL = 0x0 TCPOPT_MAXSEG = 0x2 TCPOPT_NOP = 0x1 TCPOPT_SACK = 0x5 TCPOPT_SACK_HDR = 0x1010500 TCPOPT_SACK_PERMITTED = 0x4 TCPOPT_SACK_PERMIT_HDR = 0x1010402 TCPOPT_SIGNATURE = 0x13 TCPOPT_TIMESTAMP = 0x8 TCPOPT_TSTAMP_HDR = 0x101080a TCPOPT_WINDOW = 0x3 TCP_INFO = 0x9 TCP_MAXSEG = 0x2 TCP_MAXWIN = 0xffff TCP_MAX_SACK = 0x3 TCP_MAX_WINSHIFT = 0xe TCP_MD5SIG = 0x4 TCP_MSS = 0x200 TCP_NODELAY = 0x1 TCP_NOPUSH = 0x10 TCP_SACKHOLE_LIMIT = 0x80 TCP_SACK_ENABLE = 0x8 TCSAFLUSH = 0x2 TIMER_ABSTIME = 0x1 TIMER_RELTIME = 0x0 TIOCCBRK = 0x2000747a TIOCCDTR = 0x20007478 TIOCCHKVERAUTH = 0x2000741e TIOCCLRVERAUTH = 0x2000741d TIOCCONS = 0x80047462 TIOCDRAIN = 0x2000745e TIOCEXCL = 0x2000740d TIOCEXT = 0x80047460 TIOCFLAG_CLOCAL = 0x2 TIOCFLAG_CRTSCTS = 0x4 TIOCFLAG_MDMBUF = 0x8 TIOCFLAG_PPS = 0x10 TIOCFLAG_SOFTCAR = 0x1 TIOCFLUSH = 0x80047410 TIOCGETA = 0x402c7413 TIOCGETD = 0x4004741a TIOCGFLAGS = 0x4004745d TIOCGPGRP = 0x40047477 TIOCGSID = 0x40047463 TIOCGTSTAMP = 0x4010745b TIOCGWINSZ = 0x40087468 TIOCMBIC = 0x8004746b TIOCMBIS = 0x8004746c TIOCMGET = 0x4004746a TIOCMODG = 0x4004746a TIOCMODS = 0x8004746d TIOCMSET = 0x8004746d TIOCM_CAR = 0x40 TIOCM_CD = 0x40 TIOCM_CTS = 0x20 TIOCM_DSR = 0x100 TIOCM_DTR = 0x2 TIOCM_LE = 0x1 TIOCM_RI = 0x80 TIOCM_RNG = 0x80 TIOCM_RTS = 0x4 TIOCM_SR = 0x10 TIOCM_ST = 0x8 TIOCNOTTY = 0x20007471 TIOCNXCL = 0x2000740e TIOCOUTQ = 0x40047473 TIOCPKT = 0x80047470 TIOCPKT_DATA = 0x0 TIOCPKT_DOSTOP = 0x20 TIOCPKT_FLUSHREAD = 0x1 TIOCPKT_FLUSHWRITE = 0x2 TIOCPKT_IOCTL = 0x40 TIOCPKT_NOSTOP = 0x10 TIOCPKT_START = 0x8 TIOCPKT_STOP = 0x4 TIOCREMOTE = 0x80047469 TIOCSBRK = 0x2000747b TIOCSCTTY = 0x20007461 TIOCSDTR = 0x20007479 TIOCSETA = 0x802c7414 TIOCSETAF = 0x802c7416 TIOCSETAW = 0x802c7415 TIOCSETD = 0x8004741b TIOCSETVERAUTH = 0x8004741c TIOCSFLAGS = 0x8004745c TIOCSIG = 0x8004745f TIOCSPGRP = 0x80047476 TIOCSTART = 0x2000746e TIOCSTAT = 0x20007465 TIOCSTOP = 0x2000746f TIOCSTSTAMP = 0x8008745a TIOCSWINSZ = 0x80087467 TIOCUCNTL = 0x80047466 TIOCUCNTL_CBRK = 0x7a TIOCUCNTL_SBRK = 0x7b TOSTOP = 0x400000 UTIME_NOW = -0x2 UTIME_OMIT = -0x1 VDISCARD = 0xf VDSUSP = 0xb VEOF = 0x0 VEOL = 0x1 VEOL2 = 0x2 VERASE = 0x3 VINTR = 0x8 VKILL = 0x5 VLNEXT = 0xe VMIN = 0x10 VM_ANONMIN = 0x7 VM_LOADAVG = 0x2 VM_MALLOC_CONF = 0xc VM_MAXID = 0xd VM_MAXSLP = 0xa VM_METER = 0x1 VM_NKMEMPAGES = 0x6 VM_PSSTRINGS = 0x3 VM_SWAPENCRYPT = 0x5 VM_USPACE = 0xb VM_UVMEXP = 0x4 VM_VNODEMIN = 0x9 VM_VTEXTMIN = 0x8 VQUIT = 0x9 VREPRINT = 0x6 VSTART = 0xc VSTATUS = 0x12 VSTOP = 0xd VSUSP = 0xa VTIME = 0x11 VWERASE = 0x4 WALTSIG = 0x4 WCONTINUED = 0x8 WCOREFLAG = 0x80 WNOHANG = 0x1 WUNTRACED = 0x2 XCASE = 0x1000000 ) // Errors const ( E2BIG = syscall.Errno(0x7) EACCES = syscall.Errno(0xd) EADDRINUSE = syscall.Errno(0x30) EADDRNOTAVAIL = syscall.Errno(0x31) EAFNOSUPPORT = syscall.Errno(0x2f) EAGAIN = syscall.Errno(0x23) EALREADY = syscall.Errno(0x25) EAUTH = syscall.Errno(0x50) EBADF = syscall.Errno(0x9) EBADMSG = syscall.Errno(0x5c) EBADRPC = syscall.Errno(0x48) EBUSY = syscall.Errno(0x10) ECANCELED = syscall.Errno(0x58) ECHILD = syscall.Errno(0xa) ECONNABORTED = syscall.Errno(0x35) ECONNREFUSED = syscall.Errno(0x3d) ECONNRESET = syscall.Errno(0x36) EDEADLK = syscall.Errno(0xb) EDESTADDRREQ = syscall.Errno(0x27) EDOM = syscall.Errno(0x21) EDQUOT = syscall.Errno(0x45) EEXIST = syscall.Errno(0x11) EFAULT = syscall.Errno(0xe) EFBIG = syscall.Errno(0x1b) EFTYPE = syscall.Errno(0x4f) EHOSTDOWN = syscall.Errno(0x40) EHOSTUNREACH = syscall.Errno(0x41) EIDRM = syscall.Errno(0x59) EILSEQ = syscall.Errno(0x54) EINPROGRESS = syscall.Errno(0x24) EINTR = syscall.Errno(0x4) EINVAL = syscall.Errno(0x16) EIO = syscall.Errno(0x5) EIPSEC = syscall.Errno(0x52) EISCONN = syscall.Errno(0x38) EISDIR = syscall.Errno(0x15) ELAST = syscall.Errno(0x5f) ELOOP = syscall.Errno(0x3e) EMEDIUMTYPE = syscall.Errno(0x56) EMFILE = syscall.Errno(0x18) EMLINK = syscall.Errno(0x1f) EMSGSIZE = syscall.Errno(0x28) ENAMETOOLONG = syscall.Errno(0x3f) ENEEDAUTH = syscall.Errno(0x51) ENETDOWN = syscall.Errno(0x32) ENETRESET = syscall.Errno(0x34) ENETUNREACH = syscall.Errno(0x33) ENFILE = syscall.Errno(0x17) ENOATTR = syscall.Errno(0x53) ENOBUFS = syscall.Errno(0x37) ENODEV = syscall.Errno(0x13) ENOENT = syscall.Errno(0x2) ENOEXEC = syscall.Errno(0x8) ENOLCK = syscall.Errno(0x4d) ENOMEDIUM = syscall.Errno(0x55) ENOMEM = syscall.Errno(0xc) ENOMSG = syscall.Errno(0x5a) ENOPROTOOPT = syscall.Errno(0x2a) ENOSPC = syscall.Errno(0x1c) ENOSYS = syscall.Errno(0x4e) ENOTBLK = syscall.Errno(0xf) ENOTCONN = syscall.Errno(0x39) ENOTDIR = syscall.Errno(0x14) ENOTEMPTY = syscall.Errno(0x42) ENOTRECOVERABLE = syscall.Errno(0x5d) ENOTSOCK = syscall.Errno(0x26) ENOTSUP = syscall.Errno(0x5b) ENOTTY = syscall.Errno(0x19) ENXIO = syscall.Errno(0x6) EOPNOTSUPP = syscall.Errno(0x2d) EOVERFLOW = syscall.Errno(0x57) EOWNERDEAD = syscall.Errno(0x5e) EPERM = syscall.Errno(0x1) EPFNOSUPPORT = syscall.Errno(0x2e) EPIPE = syscall.Errno(0x20) EPROCLIM = syscall.Errno(0x43) EPROCUNAVAIL = syscall.Errno(0x4c) EPROGMISMATCH = syscall.Errno(0x4b) EPROGUNAVAIL = syscall.Errno(0x4a) EPROTO = syscall.Errno(0x5f) EPROTONOSUPPORT = syscall.Errno(0x2b) EPROTOTYPE = syscall.Errno(0x29) ERANGE = syscall.Errno(0x22) EREMOTE = syscall.Errno(0x47) EROFS = syscall.Errno(0x1e) ERPCMISMATCH = syscall.Errno(0x49) ESHUTDOWN = syscall.Errno(0x3a) ESOCKTNOSUPPORT = syscall.Errno(0x2c) ESPIPE = syscall.Errno(0x1d) ESRCH = syscall.Errno(0x3) ESTALE = syscall.Errno(0x46) ETIMEDOUT = syscall.Errno(0x3c) ETOOMANYREFS = syscall.Errno(0x3b) ETXTBSY = syscall.Errno(0x1a) EUSERS = syscall.Errno(0x44) EWOULDBLOCK = syscall.Errno(0x23) EXDEV = syscall.Errno(0x12) ) // Signals const ( SIGABRT = syscall.Signal(0x6) SIGALRM = syscall.Signal(0xe) SIGBUS = syscall.Signal(0xa) SIGCHLD = syscall.Signal(0x14) SIGCONT = syscall.Signal(0x13) SIGEMT = syscall.Signal(0x7) SIGFPE = syscall.Signal(0x8) SIGHUP = syscall.Signal(0x1) SIGILL = syscall.Signal(0x4) SIGINFO = syscall.Signal(0x1d) SIGINT = syscall.Signal(0x2) SIGIO = syscall.Signal(0x17) SIGIOT = syscall.Signal(0x6) SIGKILL = syscall.Signal(0x9) SIGPIPE = syscall.Signal(0xd) SIGPROF = syscall.Signal(0x1b) SIGQUIT = syscall.Signal(0x3) SIGSEGV = syscall.Signal(0xb) SIGSTOP = syscall.Signal(0x11) SIGSYS = syscall.Signal(0xc) SIGTERM = syscall.Signal(0xf) SIGTHR = syscall.Signal(0x20) SIGTRAP = syscall.Signal(0x5) SIGTSTP = syscall.Signal(0x12) SIGTTIN = syscall.Signal(0x15) SIGTTOU = syscall.Signal(0x16) SIGURG = syscall.Signal(0x10) SIGUSR1 = syscall.Signal(0x1e) SIGUSR2 = syscall.Signal(0x1f) SIGVTALRM = syscall.Signal(0x1a) SIGWINCH = syscall.Signal(0x1c) SIGXCPU = syscall.Signal(0x18) SIGXFSZ = syscall.Signal(0x19) ) // Error table var errorList = [...]struct { num syscall.Errno name string desc string }{ {1, "EPERM", "operation not permitted"}, {2, "ENOENT", "no such file or directory"}, {3, "ESRCH", "no such process"}, {4, "EINTR", "interrupted system call"}, {5, "EIO", "input/output error"}, {6, "ENXIO", "device not configured"}, {7, "E2BIG", "argument list too long"}, {8, "ENOEXEC", "exec format error"}, {9, "EBADF", "bad file descriptor"}, {10, "ECHILD", "no child processes"}, {11, "EDEADLK", "resource deadlock avoided"}, {12, "ENOMEM", "cannot allocate memory"}, {13, "EACCES", "permission denied"}, {14, "EFAULT", "bad address"}, {15, "ENOTBLK", "block device required"}, {16, "EBUSY", "device busy"}, {17, "EEXIST", "file exists"}, {18, "EXDEV", "cross-device link"}, {19, "ENODEV", "operation not supported by device"}, {20, "ENOTDIR", "not a directory"}, {21, "EISDIR", "is a directory"}, {22, "EINVAL", "invalid argument"}, {23, "ENFILE", "too many open files in system"}, {24, "EMFILE", "too many open files"}, {25, "ENOTTY", "inappropriate ioctl for device"}, {26, "ETXTBSY", "text file busy"}, {27, "EFBIG", "file too large"}, {28, "ENOSPC", "no space left on device"}, {29, "ESPIPE", "illegal seek"}, {30, "EROFS", "read-only file system"}, {31, "EMLINK", "too many links"}, {32, "EPIPE", "broken pipe"}, {33, "EDOM", "numerical argument out of domain"}, {34, "ERANGE", "result too large"}, {35, "EAGAIN", "resource temporarily unavailable"}, {36, "EINPROGRESS", "operation now in progress"}, {37, "EALREADY", "operation already in progress"}, {38, "ENOTSOCK", "socket operation on non-socket"}, {39, "EDESTADDRREQ", "destination address required"}, {40, "EMSGSIZE", "message too long"}, {41, "EPROTOTYPE", "protocol wrong type for socket"}, {42, "ENOPROTOOPT", "protocol not available"}, {43, "EPROTONOSUPPORT", "protocol not supported"}, {44, "ESOCKTNOSUPPORT", "socket type not supported"}, {45, "EOPNOTSUPP", "operation not supported"}, {46, "EPFNOSUPPORT", "protocol family not supported"}, {47, "EAFNOSUPPORT", "address family not supported by protocol family"}, {48, "EADDRINUSE", "address already in use"}, {49, "EADDRNOTAVAIL", "can't assign requested address"}, {50, "ENETDOWN", "network is down"}, {51, "ENETUNREACH", "network is unreachable"}, {52, "ENETRESET", "network dropped connection on reset"}, {53, "ECONNABORTED", "software caused connection abort"}, {54, "ECONNRESET", "connection reset by peer"}, {55, "ENOBUFS", "no buffer space available"}, {56, "EISCONN", "socket is already connected"}, {57, "ENOTCONN", "socket is not connected"}, {58, "ESHUTDOWN", "can't send after socket shutdown"}, {59, "ETOOMANYREFS", "too many references: can't splice"}, {60, "ETIMEDOUT", "operation timed out"}, {61, "ECONNREFUSED", "connection refused"}, {62, "ELOOP", "too many levels of symbolic links"}, {63, "ENAMETOOLONG", "file name too long"}, {64, "EHOSTDOWN", "host is down"}, {65, "EHOSTUNREACH", "no route to host"}, {66, "ENOTEMPTY", "directory not empty"}, {67, "EPROCLIM", "too many processes"}, {68, "EUSERS", "too many users"}, {69, "EDQUOT", "disk quota exceeded"}, {70, "ESTALE", "stale NFS file handle"}, {71, "EREMOTE", "too many levels of remote in path"}, {72, "EBADRPC", "RPC struct is bad"}, {73, "ERPCMISMATCH", "RPC version wrong"}, {74, "EPROGUNAVAIL", "RPC program not available"}, {75, "EPROGMISMATCH", "program version wrong"}, {76, "EPROCUNAVAIL", "bad procedure for program"}, {77, "ENOLCK", "no locks available"}, {78, "ENOSYS", "function not implemented"}, {79, "EFTYPE", "inappropriate file type or format"}, {80, "EAUTH", "authentication error"}, {81, "ENEEDAUTH", "need authenticator"}, {82, "EIPSEC", "IPsec processing failure"}, {83, "ENOATTR", "attribute not found"}, {84, "EILSEQ", "illegal byte sequence"}, {85, "ENOMEDIUM", "no medium found"}, {86, "EMEDIUMTYPE", "wrong medium type"}, {87, "EOVERFLOW", "value too large to be stored in data type"}, {88, "ECANCELED", "operation canceled"}, {89, "EIDRM", "identifier removed"}, {90, "ENOMSG", "no message of desired type"}, {91, "ENOTSUP", "not supported"}, {92, "EBADMSG", "bad message"}, {93, "ENOTRECOVERABLE", "state not recoverable"}, {94, "EOWNERDEAD", "previous owner died"}, {95, "ELAST", "protocol error"}, } // Signal table var signalList = [...]struct { num syscall.Signal name string desc string }{ {1, "SIGHUP", "hangup"}, {2, "SIGINT", "interrupt"}, {3, "SIGQUIT", "quit"}, {4, "SIGILL", "illegal instruction"}, {5, "SIGTRAP", "trace/BPT trap"}, {6, "SIGIOT", "abort trap"}, {7, "SIGEMT", "EMT trap"}, {8, "SIGFPE", "floating point exception"}, {9, "SIGKILL", "killed"}, {10, "SIGBUS", "bus error"}, {11, "SIGSEGV", "segmentation fault"}, {12, "SIGSYS", "bad system call"}, {13, "SIGPIPE", "broken pipe"}, {14, "SIGALRM", "alarm clock"}, {15, "SIGTERM", "terminated"}, {16, "SIGURG", "urgent I/O condition"}, {17, "SIGSTOP", "suspended (signal)"}, {18, "SIGTSTP", "suspended"}, {19, "SIGCONT", "continued"}, {20, "SIGCHLD", "child exited"}, {21, "SIGTTIN", "stopped (tty input)"}, {22, "SIGTTOU", "stopped (tty output)"}, {23, "SIGIO", "I/O possible"}, {24, "SIGXCPU", "cputime limit exceeded"}, {25, "SIGXFSZ", "filesize limit exceeded"}, {26, "SIGVTALRM", "virtual timer expired"}, {27, "SIGPROF", "profiling timer expired"}, {28, "SIGWINCH", "window size changes"}, {29, "SIGINFO", "information request"}, {30, "SIGUSR1", "user defined signal 1"}, {31, "SIGUSR2", "user defined signal 2"}, {32, "SIGTHR", "thread AST"}, {81920, "SIGSTKSZ", "unknown signal"}, } ================================================ FILE: vendor/golang.org/x/sys/unix/zerrors_openbsd_ppc64.go ================================================ // mkerrors.sh -m64 // Code generated by the command above; see README.md. DO NOT EDIT. //go:build ppc64 && openbsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -m64 _const.go package unix import "syscall" const ( AF_APPLETALK = 0x10 AF_BLUETOOTH = 0x20 AF_CCITT = 0xa AF_CHAOS = 0x5 AF_CNT = 0x15 AF_COIP = 0x14 AF_DATAKIT = 0x9 AF_DECnet = 0xc AF_DLI = 0xd AF_E164 = 0x1a AF_ECMA = 0x8 AF_ENCAP = 0x1c AF_HYLINK = 0xf AF_IMPLINK = 0x3 AF_INET = 0x2 AF_INET6 = 0x18 AF_IPX = 0x17 AF_ISDN = 0x1a AF_ISO = 0x7 AF_KEY = 0x1e AF_LAT = 0xe AF_LINK = 0x12 AF_LOCAL = 0x1 AF_MAX = 0x24 AF_MPLS = 0x21 AF_NATM = 0x1b AF_NS = 0x6 AF_OSI = 0x7 AF_PUP = 0x4 AF_ROUTE = 0x11 AF_SIP = 0x1d AF_SNA = 0xb AF_UNIX = 0x1 AF_UNSPEC = 0x0 ALTWERASE = 0x200 ARPHRD_ETHER = 0x1 ARPHRD_FRELAY = 0xf ARPHRD_IEEE1394 = 0x18 ARPHRD_IEEE802 = 0x6 B0 = 0x0 B110 = 0x6e B115200 = 0x1c200 B1200 = 0x4b0 B134 = 0x86 B14400 = 0x3840 B150 = 0x96 B1800 = 0x708 B19200 = 0x4b00 B200 = 0xc8 B230400 = 0x38400 B2400 = 0x960 B28800 = 0x7080 B300 = 0x12c B38400 = 0x9600 B4800 = 0x12c0 B50 = 0x32 B57600 = 0xe100 B600 = 0x258 B7200 = 0x1c20 B75 = 0x4b B76800 = 0x12c00 B9600 = 0x2580 BIOCFLUSH = 0x20004268 BIOCGBLEN = 0x40044266 BIOCGDIRFILT = 0x4004427c BIOCGDLT = 0x4004426a BIOCGDLTLIST = 0xc010427b BIOCGETIF = 0x4020426b BIOCGFILDROP = 0x40044278 BIOCGHDRCMPLT = 0x40044274 BIOCGRSIG = 0x40044273 BIOCGRTIMEOUT = 0x4010426e BIOCGSTATS = 0x4008426f BIOCIMMEDIATE = 0x80044270 BIOCLOCK = 0x20004276 BIOCPROMISC = 0x20004269 BIOCSBLEN = 0xc0044266 BIOCSDIRFILT = 0x8004427d BIOCSDLT = 0x8004427a BIOCSETF = 0x80104267 BIOCSETIF = 0x8020426c BIOCSETWF = 0x80104277 BIOCSFILDROP = 0x80044279 BIOCSHDRCMPLT = 0x80044275 BIOCSRSIG = 0x80044272 BIOCSRTIMEOUT = 0x8010426d BIOCVERSION = 0x40044271 BPF_A = 0x10 BPF_ABS = 0x20 BPF_ADD = 0x0 BPF_ALIGNMENT = 0x4 BPF_ALU = 0x4 BPF_AND = 0x50 BPF_B = 0x10 BPF_DIRECTION_IN = 0x1 BPF_DIRECTION_OUT = 0x2 BPF_DIV = 0x30 BPF_FILDROP_CAPTURE = 0x1 BPF_FILDROP_DROP = 0x2 BPF_FILDROP_PASS = 0x0 BPF_F_DIR_IN = 0x10 BPF_F_DIR_MASK = 0x30 BPF_F_DIR_OUT = 0x20 BPF_F_DIR_SHIFT = 0x4 BPF_F_FLOWID = 0x8 BPF_F_PRI_MASK = 0x7 BPF_H = 0x8 BPF_IMM = 0x0 BPF_IND = 0x40 BPF_JA = 0x0 BPF_JEQ = 0x10 BPF_JGE = 0x30 BPF_JGT = 0x20 BPF_JMP = 0x5 BPF_JSET = 0x40 BPF_K = 0x0 BPF_LD = 0x0 BPF_LDX = 0x1 BPF_LEN = 0x80 BPF_LSH = 0x60 BPF_MAJOR_VERSION = 0x1 BPF_MAXBUFSIZE = 0x200000 BPF_MAXINSNS = 0x200 BPF_MEM = 0x60 BPF_MEMWORDS = 0x10 BPF_MINBUFSIZE = 0x20 BPF_MINOR_VERSION = 0x1 BPF_MISC = 0x7 BPF_MSH = 0xa0 BPF_MUL = 0x20 BPF_NEG = 0x80 BPF_OR = 0x40 BPF_RELEASE = 0x30bb6 BPF_RET = 0x6 BPF_RND = 0xc0 BPF_RSH = 0x70 BPF_ST = 0x2 BPF_STX = 0x3 BPF_SUB = 0x10 BPF_TAX = 0x0 BPF_TXA = 0x80 BPF_W = 0x0 BPF_X = 0x8 BRKINT = 0x2 CFLUSH = 0xf CLOCAL = 0x8000 CLOCK_BOOTTIME = 0x6 CLOCK_MONOTONIC = 0x3 CLOCK_PROCESS_CPUTIME_ID = 0x2 CLOCK_REALTIME = 0x0 CLOCK_THREAD_CPUTIME_ID = 0x4 CLOCK_UPTIME = 0x5 CPUSTATES = 0x6 CP_IDLE = 0x5 CP_INTR = 0x4 CP_NICE = 0x1 CP_SPIN = 0x3 CP_SYS = 0x2 CP_USER = 0x0 CREAD = 0x800 CRTSCTS = 0x10000 CS5 = 0x0 CS6 = 0x100 CS7 = 0x200 CS8 = 0x300 CSIZE = 0x300 CSTART = 0x11 CSTATUS = 0xff CSTOP = 0x13 CSTOPB = 0x400 CSUSP = 0x1a CTL_HW = 0x6 CTL_KERN = 0x1 CTL_MAXNAME = 0xc CTL_NET = 0x4 DIOCADDQUEUE = 0xc110445d DIOCADDRULE = 0xcd604404 DIOCADDSTATE = 0xc1084425 DIOCCHANGERULE = 0xcd60441a DIOCCLRIFFLAG = 0xc028445a DIOCCLRSRCNODES = 0x20004455 DIOCCLRSTATES = 0xc0e04412 DIOCCLRSTATUS = 0xc0284416 DIOCGETLIMIT = 0xc0084427 DIOCGETQSTATS = 0xc1204460 DIOCGETQUEUE = 0xc110445f DIOCGETQUEUES = 0xc110445e DIOCGETRULE = 0xcd604407 DIOCGETRULES = 0xcd604406 DIOCGETRULESET = 0xc444443b DIOCGETRULESETS = 0xc444443a DIOCGETSRCNODES = 0xc0104454 DIOCGETSTATE = 0xc1084413 DIOCGETSTATES = 0xc0104419 DIOCGETSTATUS = 0xc1e84415 DIOCGETSYNFLWATS = 0xc0084463 DIOCGETTIMEOUT = 0xc008441e DIOCIGETIFACES = 0xc0284457 DIOCKILLSRCNODES = 0xc080445b DIOCKILLSTATES = 0xc0e04429 DIOCNATLOOK = 0xc0504417 DIOCOSFPADD = 0xc088444f DIOCOSFPFLUSH = 0x2000444e DIOCOSFPGET = 0xc0884450 DIOCRADDADDRS = 0xc4504443 DIOCRADDTABLES = 0xc450443d DIOCRCLRADDRS = 0xc4504442 DIOCRCLRASTATS = 0xc4504448 DIOCRCLRTABLES = 0xc450443c DIOCRCLRTSTATS = 0xc4504441 DIOCRDELADDRS = 0xc4504444 DIOCRDELTABLES = 0xc450443e DIOCRGETADDRS = 0xc4504446 DIOCRGETASTATS = 0xc4504447 DIOCRGETTABLES = 0xc450443f DIOCRGETTSTATS = 0xc4504440 DIOCRINADEFINE = 0xc450444d DIOCRSETADDRS = 0xc4504445 DIOCRSETTFLAGS = 0xc450444a DIOCRTSTADDRS = 0xc4504449 DIOCSETDEBUG = 0xc0044418 DIOCSETHOSTID = 0xc0044456 DIOCSETIFFLAG = 0xc0284459 DIOCSETLIMIT = 0xc0084428 DIOCSETREASS = 0xc004445c DIOCSETSTATUSIF = 0xc0284414 DIOCSETSYNCOOKIES = 0xc0014462 DIOCSETSYNFLWATS = 0xc0084461 DIOCSETTIMEOUT = 0xc008441d DIOCSTART = 0x20004401 DIOCSTOP = 0x20004402 DIOCXBEGIN = 0xc0104451 DIOCXCOMMIT = 0xc0104452 DIOCXROLLBACK = 0xc0104453 DLT_ARCNET = 0x7 DLT_ATM_RFC1483 = 0xb DLT_AX25 = 0x3 DLT_CHAOS = 0x5 DLT_C_HDLC = 0x68 DLT_EN10MB = 0x1 DLT_EN3MB = 0x2 DLT_ENC = 0xd DLT_FDDI = 0xa DLT_IEEE802 = 0x6 DLT_IEEE802_11 = 0x69 DLT_IEEE802_11_RADIO = 0x7f DLT_LOOP = 0xc DLT_MPLS = 0xdb DLT_NULL = 0x0 DLT_OPENFLOW = 0x10b DLT_PFLOG = 0x75 DLT_PFSYNC = 0x12 DLT_PPP = 0x9 DLT_PPP_BSDOS = 0x10 DLT_PPP_ETHER = 0x33 DLT_PPP_SERIAL = 0x32 DLT_PRONET = 0x4 DLT_RAW = 0xe DLT_SLIP = 0x8 DLT_SLIP_BSDOS = 0xf DLT_USBPCAP = 0xf9 DLT_USER0 = 0x93 DLT_USER1 = 0x94 DLT_USER10 = 0x9d DLT_USER11 = 0x9e DLT_USER12 = 0x9f DLT_USER13 = 0xa0 DLT_USER14 = 0xa1 DLT_USER15 = 0xa2 DLT_USER2 = 0x95 DLT_USER3 = 0x96 DLT_USER4 = 0x97 DLT_USER5 = 0x98 DLT_USER6 = 0x99 DLT_USER7 = 0x9a DLT_USER8 = 0x9b DLT_USER9 = 0x9c DT_BLK = 0x6 DT_CHR = 0x2 DT_DIR = 0x4 DT_FIFO = 0x1 DT_LNK = 0xa DT_REG = 0x8 DT_SOCK = 0xc DT_UNKNOWN = 0x0 ECHO = 0x8 ECHOCTL = 0x40 ECHOE = 0x2 ECHOK = 0x4 ECHOKE = 0x1 ECHONL = 0x10 ECHOPRT = 0x20 EMT_TAGOVF = 0x1 EMUL_ENABLED = 0x1 EMUL_NATIVE = 0x2 ENDRUNDISC = 0x9 ETH64_8021_RSVD_MASK = 0xfffffffffff0 ETH64_8021_RSVD_PREFIX = 0x180c2000000 ETHERMIN = 0x2e ETHERMTU = 0x5dc ETHERTYPE_8023 = 0x4 ETHERTYPE_AARP = 0x80f3 ETHERTYPE_ACCTON = 0x8390 ETHERTYPE_AEONIC = 0x8036 ETHERTYPE_ALPHA = 0x814a ETHERTYPE_AMBER = 0x6008 ETHERTYPE_AMOEBA = 0x8145 ETHERTYPE_AOE = 0x88a2 ETHERTYPE_APOLLO = 0x80f7 ETHERTYPE_APOLLODOMAIN = 0x8019 ETHERTYPE_APPLETALK = 0x809b ETHERTYPE_APPLITEK = 0x80c7 ETHERTYPE_ARGONAUT = 0x803a ETHERTYPE_ARP = 0x806 ETHERTYPE_AT = 0x809b ETHERTYPE_ATALK = 0x809b ETHERTYPE_ATOMIC = 0x86df ETHERTYPE_ATT = 0x8069 ETHERTYPE_ATTSTANFORD = 0x8008 ETHERTYPE_AUTOPHON = 0x806a ETHERTYPE_AXIS = 0x8856 ETHERTYPE_BCLOOP = 0x9003 ETHERTYPE_BOFL = 0x8102 ETHERTYPE_CABLETRON = 0x7034 ETHERTYPE_CHAOS = 0x804 ETHERTYPE_COMDESIGN = 0x806c ETHERTYPE_COMPUGRAPHIC = 0x806d ETHERTYPE_COUNTERPOINT = 0x8062 ETHERTYPE_CRONUS = 0x8004 ETHERTYPE_CRONUSVLN = 0x8003 ETHERTYPE_DCA = 0x1234 ETHERTYPE_DDE = 0x807b ETHERTYPE_DEBNI = 0xaaaa ETHERTYPE_DECAM = 0x8048 ETHERTYPE_DECCUST = 0x6006 ETHERTYPE_DECDIAG = 0x6005 ETHERTYPE_DECDNS = 0x803c ETHERTYPE_DECDTS = 0x803e ETHERTYPE_DECEXPER = 0x6000 ETHERTYPE_DECLAST = 0x8041 ETHERTYPE_DECLTM = 0x803f ETHERTYPE_DECMUMPS = 0x6009 ETHERTYPE_DECNETBIOS = 0x8040 ETHERTYPE_DELTACON = 0x86de ETHERTYPE_DIDDLE = 0x4321 ETHERTYPE_DLOG1 = 0x660 ETHERTYPE_DLOG2 = 0x661 ETHERTYPE_DN = 0x6003 ETHERTYPE_DOGFIGHT = 0x1989 ETHERTYPE_DSMD = 0x8039 ETHERTYPE_EAPOL = 0x888e ETHERTYPE_ECMA = 0x803 ETHERTYPE_ENCRYPT = 0x803d ETHERTYPE_ES = 0x805d ETHERTYPE_EXCELAN = 0x8010 ETHERTYPE_EXPERDATA = 0x8049 ETHERTYPE_FLIP = 0x8146 ETHERTYPE_FLOWCONTROL = 0x8808 ETHERTYPE_FRARP = 0x808 ETHERTYPE_GENDYN = 0x8068 ETHERTYPE_HAYES = 0x8130 ETHERTYPE_HIPPI_FP = 0x8180 ETHERTYPE_HITACHI = 0x8820 ETHERTYPE_HP = 0x8005 ETHERTYPE_IEEEPUP = 0xa00 ETHERTYPE_IEEEPUPAT = 0xa01 ETHERTYPE_IMLBL = 0x4c42 ETHERTYPE_IMLBLDIAG = 0x424c ETHERTYPE_IP = 0x800 ETHERTYPE_IPAS = 0x876c ETHERTYPE_IPV6 = 0x86dd ETHERTYPE_IPX = 0x8137 ETHERTYPE_IPXNEW = 0x8037 ETHERTYPE_KALPANA = 0x8582 ETHERTYPE_LANBRIDGE = 0x8038 ETHERTYPE_LANPROBE = 0x8888 ETHERTYPE_LAT = 0x6004 ETHERTYPE_LBACK = 0x9000 ETHERTYPE_LITTLE = 0x8060 ETHERTYPE_LLDP = 0x88cc ETHERTYPE_LOGICRAFT = 0x8148 ETHERTYPE_LOOPBACK = 0x9000 ETHERTYPE_MACSEC = 0x88e5 ETHERTYPE_MATRA = 0x807a ETHERTYPE_MAX = 0xffff ETHERTYPE_MERIT = 0x807c ETHERTYPE_MICP = 0x873a ETHERTYPE_MOPDL = 0x6001 ETHERTYPE_MOPRC = 0x6002 ETHERTYPE_MOTOROLA = 0x818d ETHERTYPE_MPLS = 0x8847 ETHERTYPE_MPLS_MCAST = 0x8848 ETHERTYPE_MUMPS = 0x813f ETHERTYPE_NBPCC = 0x3c04 ETHERTYPE_NBPCLAIM = 0x3c09 ETHERTYPE_NBPCLREQ = 0x3c05 ETHERTYPE_NBPCLRSP = 0x3c06 ETHERTYPE_NBPCREQ = 0x3c02 ETHERTYPE_NBPCRSP = 0x3c03 ETHERTYPE_NBPDG = 0x3c07 ETHERTYPE_NBPDGB = 0x3c08 ETHERTYPE_NBPDLTE = 0x3c0a ETHERTYPE_NBPRAR = 0x3c0c ETHERTYPE_NBPRAS = 0x3c0b ETHERTYPE_NBPRST = 0x3c0d ETHERTYPE_NBPSCD = 0x3c01 ETHERTYPE_NBPVCD = 0x3c00 ETHERTYPE_NBS = 0x802 ETHERTYPE_NCD = 0x8149 ETHERTYPE_NESTAR = 0x8006 ETHERTYPE_NETBEUI = 0x8191 ETHERTYPE_NHRP = 0x2001 ETHERTYPE_NOVELL = 0x8138 ETHERTYPE_NS = 0x600 ETHERTYPE_NSAT = 0x601 ETHERTYPE_NSCOMPAT = 0x807 ETHERTYPE_NSH = 0x984f ETHERTYPE_NTRAILER = 0x10 ETHERTYPE_OS9 = 0x7007 ETHERTYPE_OS9NET = 0x7009 ETHERTYPE_PACER = 0x80c6 ETHERTYPE_PBB = 0x88e7 ETHERTYPE_PCS = 0x4242 ETHERTYPE_PLANNING = 0x8044 ETHERTYPE_PPP = 0x880b ETHERTYPE_PPPOE = 0x8864 ETHERTYPE_PPPOEDISC = 0x8863 ETHERTYPE_PRIMENTS = 0x7031 ETHERTYPE_PUP = 0x200 ETHERTYPE_PUPAT = 0x200 ETHERTYPE_QINQ = 0x88a8 ETHERTYPE_RACAL = 0x7030 ETHERTYPE_RATIONAL = 0x8150 ETHERTYPE_RAWFR = 0x6559 ETHERTYPE_RCL = 0x1995 ETHERTYPE_RDP = 0x8739 ETHERTYPE_RETIX = 0x80f2 ETHERTYPE_REVARP = 0x8035 ETHERTYPE_SCA = 0x6007 ETHERTYPE_SECTRA = 0x86db ETHERTYPE_SECUREDATA = 0x876d ETHERTYPE_SGITW = 0x817e ETHERTYPE_SG_BOUNCE = 0x8016 ETHERTYPE_SG_DIAG = 0x8013 ETHERTYPE_SG_NETGAMES = 0x8014 ETHERTYPE_SG_RESV = 0x8015 ETHERTYPE_SIMNET = 0x5208 ETHERTYPE_SLOW = 0x8809 ETHERTYPE_SNA = 0x80d5 ETHERTYPE_SNMP = 0x814c ETHERTYPE_SONIX = 0xfaf5 ETHERTYPE_SPIDER = 0x809f ETHERTYPE_SPRITE = 0x500 ETHERTYPE_STP = 0x8181 ETHERTYPE_TALARIS = 0x812b ETHERTYPE_TALARISMC = 0x852b ETHERTYPE_TCPCOMP = 0x876b ETHERTYPE_TCPSM = 0x9002 ETHERTYPE_TEC = 0x814f ETHERTYPE_TIGAN = 0x802f ETHERTYPE_TRAIL = 0x1000 ETHERTYPE_TRANSETHER = 0x6558 ETHERTYPE_TYMSHARE = 0x802e ETHERTYPE_UBBST = 0x7005 ETHERTYPE_UBDEBUG = 0x900 ETHERTYPE_UBDIAGLOOP = 0x7002 ETHERTYPE_UBDL = 0x7000 ETHERTYPE_UBNIU = 0x7001 ETHERTYPE_UBNMC = 0x7003 ETHERTYPE_VALID = 0x1600 ETHERTYPE_VARIAN = 0x80dd ETHERTYPE_VAXELN = 0x803b ETHERTYPE_VEECO = 0x8067 ETHERTYPE_VEXP = 0x805b ETHERTYPE_VGLAB = 0x8131 ETHERTYPE_VINES = 0xbad ETHERTYPE_VINESECHO = 0xbaf ETHERTYPE_VINESLOOP = 0xbae ETHERTYPE_VITAL = 0xff00 ETHERTYPE_VLAN = 0x8100 ETHERTYPE_VLTLMAN = 0x8080 ETHERTYPE_VPROD = 0x805c ETHERTYPE_VURESERVED = 0x8147 ETHERTYPE_WATERLOO = 0x8130 ETHERTYPE_WELLFLEET = 0x8103 ETHERTYPE_X25 = 0x805 ETHERTYPE_X75 = 0x801 ETHERTYPE_XNSSM = 0x9001 ETHERTYPE_XTP = 0x817d ETHER_ADDR_LEN = 0x6 ETHER_ALIGN = 0x2 ETHER_CRC_LEN = 0x4 ETHER_CRC_POLY_BE = 0x4c11db6 ETHER_CRC_POLY_LE = 0xedb88320 ETHER_HDR_LEN = 0xe ETHER_MAX_DIX_LEN = 0x600 ETHER_MAX_HARDMTU_LEN = 0xff9b ETHER_MAX_LEN = 0x5ee ETHER_MIN_LEN = 0x40 ETHER_TYPE_LEN = 0x2 ETHER_VLAN_ENCAP_LEN = 0x4 EVFILT_AIO = -0x3 EVFILT_DEVICE = -0x8 EVFILT_EXCEPT = -0x9 EVFILT_PROC = -0x5 EVFILT_READ = -0x1 EVFILT_SIGNAL = -0x6 EVFILT_SYSCOUNT = 0x9 EVFILT_TIMER = -0x7 EVFILT_VNODE = -0x4 EVFILT_WRITE = -0x2 EVL_ENCAPLEN = 0x4 EVL_PRIO_BITS = 0xd EVL_PRIO_MAX = 0x7 EVL_VLID_MASK = 0xfff EVL_VLID_MAX = 0xffe EVL_VLID_MIN = 0x1 EVL_VLID_NULL = 0x0 EV_ADD = 0x1 EV_CLEAR = 0x20 EV_DELETE = 0x2 EV_DISABLE = 0x8 EV_DISPATCH = 0x80 EV_ENABLE = 0x4 EV_EOF = 0x8000 EV_ERROR = 0x4000 EV_FLAG1 = 0x2000 EV_ONESHOT = 0x10 EV_RECEIPT = 0x40 EV_SYSFLAGS = 0xf800 EXTA = 0x4b00 EXTB = 0x9600 EXTPROC = 0x800 FD_CLOEXEC = 0x1 FD_SETSIZE = 0x400 FLUSHO = 0x800000 F_DUPFD = 0x0 F_DUPFD_CLOEXEC = 0xa F_GETFD = 0x1 F_GETFL = 0x3 F_GETLK = 0x7 F_GETOWN = 0x5 F_ISATTY = 0xb F_OK = 0x0 F_RDLCK = 0x1 F_SETFD = 0x2 F_SETFL = 0x4 F_SETLK = 0x8 F_SETLKW = 0x9 F_SETOWN = 0x6 F_UNLCK = 0x2 F_WRLCK = 0x3 HUPCL = 0x4000 HW_MACHINE = 0x1 ICANON = 0x100 ICMP6_FILTER = 0x12 ICRNL = 0x100 IEXTEN = 0x400 IFAN_ARRIVAL = 0x0 IFAN_DEPARTURE = 0x1 IFF_ALLMULTI = 0x200 IFF_BROADCAST = 0x2 IFF_CANTCHANGE = 0x8e52 IFF_DEBUG = 0x4 IFF_LINK0 = 0x1000 IFF_LINK1 = 0x2000 IFF_LINK2 = 0x4000 IFF_LOOPBACK = 0x8 IFF_MULTICAST = 0x8000 IFF_NOARP = 0x80 IFF_OACTIVE = 0x400 IFF_POINTOPOINT = 0x10 IFF_PROMISC = 0x100 IFF_RUNNING = 0x40 IFF_SIMPLEX = 0x800 IFF_STATICARP = 0x20 IFF_UP = 0x1 IFNAMSIZ = 0x10 IFT_1822 = 0x2 IFT_A12MPPSWITCH = 0x82 IFT_AAL2 = 0xbb IFT_AAL5 = 0x31 IFT_ADSL = 0x5e IFT_AFLANE8023 = 0x3b IFT_AFLANE8025 = 0x3c IFT_ARAP = 0x58 IFT_ARCNET = 0x23 IFT_ARCNETPLUS = 0x24 IFT_ASYNC = 0x54 IFT_ATM = 0x25 IFT_ATMDXI = 0x69 IFT_ATMFUNI = 0x6a IFT_ATMIMA = 0x6b IFT_ATMLOGICAL = 0x50 IFT_ATMRADIO = 0xbd IFT_ATMSUBINTERFACE = 0x86 IFT_ATMVCIENDPT = 0xc2 IFT_ATMVIRTUAL = 0x95 IFT_BGPPOLICYACCOUNTING = 0xa2 IFT_BLUETOOTH = 0xf8 IFT_BRIDGE = 0xd1 IFT_BSC = 0x53 IFT_CARP = 0xf7 IFT_CCTEMUL = 0x3d IFT_CEPT = 0x13 IFT_CES = 0x85 IFT_CHANNEL = 0x46 IFT_CNR = 0x55 IFT_COFFEE = 0x84 IFT_COMPOSITELINK = 0x9b IFT_DCN = 0x8d IFT_DIGITALPOWERLINE = 0x8a IFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba IFT_DLSW = 0x4a IFT_DOCSCABLEDOWNSTREAM = 0x80 IFT_DOCSCABLEMACLAYER = 0x7f IFT_DOCSCABLEUPSTREAM = 0x81 IFT_DOCSCABLEUPSTREAMCHANNEL = 0xcd IFT_DS0 = 0x51 IFT_DS0BUNDLE = 0x52 IFT_DS1FDL = 0xaa IFT_DS3 = 0x1e IFT_DTM = 0x8c IFT_DUMMY = 0xf1 IFT_DVBASILN = 0xac IFT_DVBASIOUT = 0xad IFT_DVBRCCDOWNSTREAM = 0x93 IFT_DVBRCCMACLAYER = 0x92 IFT_DVBRCCUPSTREAM = 0x94 IFT_ECONET = 0xce IFT_ENC = 0xf4 IFT_EON = 0x19 IFT_EPLRS = 0x57 IFT_ESCON = 0x49 IFT_ETHER = 0x6 IFT_FAITH = 0xf3 IFT_FAST = 0x7d IFT_FASTETHER = 0x3e IFT_FASTETHERFX = 0x45 IFT_FDDI = 0xf IFT_FIBRECHANNEL = 0x38 IFT_FRAMERELAYINTERCONNECT = 0x3a IFT_FRAMERELAYMPI = 0x5c IFT_FRDLCIENDPT = 0xc1 IFT_FRELAY = 0x20 IFT_FRELAYDCE = 0x2c IFT_FRF16MFRBUNDLE = 0xa3 IFT_FRFORWARD = 0x9e IFT_G703AT2MB = 0x43 IFT_G703AT64K = 0x42 IFT_GIF = 0xf0 IFT_GIGABITETHERNET = 0x75 IFT_GR303IDT = 0xb2 IFT_GR303RDT = 0xb1 IFT_H323GATEKEEPER = 0xa4 IFT_H323PROXY = 0xa5 IFT_HDH1822 = 0x3 IFT_HDLC = 0x76 IFT_HDSL2 = 0xa8 IFT_HIPERLAN2 = 0xb7 IFT_HIPPI = 0x2f IFT_HIPPIINTERFACE = 0x39 IFT_HOSTPAD = 0x5a IFT_HSSI = 0x2e IFT_HY = 0xe IFT_IBM370PARCHAN = 0x48 IFT_IDSL = 0x9a IFT_IEEE1394 = 0x90 IFT_IEEE80211 = 0x47 IFT_IEEE80212 = 0x37 IFT_IEEE8023ADLAG = 0xa1 IFT_IFGSN = 0x91 IFT_IMT = 0xbe IFT_INFINIBAND = 0xc7 IFT_INTERLEAVE = 0x7c IFT_IP = 0x7e IFT_IPFORWARD = 0x8e IFT_IPOVERATM = 0x72 IFT_IPOVERCDLC = 0x6d IFT_IPOVERCLAW = 0x6e IFT_IPSWITCH = 0x4e IFT_ISDN = 0x3f IFT_ISDNBASIC = 0x14 IFT_ISDNPRIMARY = 0x15 IFT_ISDNS = 0x4b IFT_ISDNU = 0x4c IFT_ISO88022LLC = 0x29 IFT_ISO88023 = 0x7 IFT_ISO88024 = 0x8 IFT_ISO88025 = 0x9 IFT_ISO88025CRFPINT = 0x62 IFT_ISO88025DTR = 0x56 IFT_ISO88025FIBER = 0x73 IFT_ISO88026 = 0xa IFT_ISUP = 0xb3 IFT_L2VLAN = 0x87 IFT_L3IPVLAN = 0x88 IFT_L3IPXVLAN = 0x89 IFT_LAPB = 0x10 IFT_LAPD = 0x4d IFT_LAPF = 0x77 IFT_LINEGROUP = 0xd2 IFT_LOCALTALK = 0x2a IFT_LOOP = 0x18 IFT_MBIM = 0xfa IFT_MEDIAMAILOVERIP = 0x8b IFT_MFSIGLINK = 0xa7 IFT_MIOX25 = 0x26 IFT_MODEM = 0x30 IFT_MPC = 0x71 IFT_MPLS = 0xa6 IFT_MPLSTUNNEL = 0x96 IFT_MSDSL = 0x8f IFT_MVL = 0xbf IFT_MYRINET = 0x63 IFT_NFAS = 0xaf IFT_NSIP = 0x1b IFT_OPTICALCHANNEL = 0xc3 IFT_OPTICALTRANSPORT = 0xc4 IFT_OTHER = 0x1 IFT_P10 = 0xc IFT_P80 = 0xd IFT_PARA = 0x22 IFT_PFLOG = 0xf5 IFT_PFLOW = 0xf9 IFT_PFSYNC = 0xf6 IFT_PLC = 0xae IFT_PON155 = 0xcf IFT_PON622 = 0xd0 IFT_POS = 0xab IFT_PPP = 0x17 IFT_PPPMULTILINKBUNDLE = 0x6c IFT_PROPATM = 0xc5 IFT_PROPBWAP2MP = 0xb8 IFT_PROPCNLS = 0x59 IFT_PROPDOCSWIRELESSDOWNSTREAM = 0xb5 IFT_PROPDOCSWIRELESSMACLAYER = 0xb4 IFT_PROPDOCSWIRELESSUPSTREAM = 0xb6 IFT_PROPMUX = 0x36 IFT_PROPVIRTUAL = 0x35 IFT_PROPWIRELESSP2P = 0x9d IFT_PTPSERIAL = 0x16 IFT_PVC = 0xf2 IFT_Q2931 = 0xc9 IFT_QLLC = 0x44 IFT_RADIOMAC = 0xbc IFT_RADSL = 0x5f IFT_REACHDSL = 0xc0 IFT_RFC1483 = 0x9f IFT_RS232 = 0x21 IFT_RSRB = 0x4f IFT_SDLC = 0x11 IFT_SDSL = 0x60 IFT_SHDSL = 0xa9 IFT_SIP = 0x1f IFT_SIPSIG = 0xcc IFT_SIPTG = 0xcb IFT_SLIP = 0x1c IFT_SMDSDXI = 0x2b IFT_SMDSICIP = 0x34 IFT_SONET = 0x27 IFT_SONETOVERHEADCHANNEL = 0xb9 IFT_SONETPATH = 0x32 IFT_SONETVT = 0x33 IFT_SRP = 0x97 IFT_SS7SIGLINK = 0x9c IFT_STACKTOSTACK = 0x6f IFT_STARLAN = 0xb IFT_T1 = 0x12 IFT_TDLC = 0x74 IFT_TELINK = 0xc8 IFT_TERMPAD = 0x5b IFT_TR008 = 0xb0 IFT_TRANSPHDLC = 0x7b IFT_TUNNEL = 0x83 IFT_ULTRA = 0x1d IFT_USB = 0xa0 IFT_V11 = 0x40 IFT_V35 = 0x2d IFT_V36 = 0x41 IFT_V37 = 0x78 IFT_VDSL = 0x61 IFT_VIRTUALIPADDRESS = 0x70 IFT_VIRTUALTG = 0xca IFT_VOICEDID = 0xd5 IFT_VOICEEM = 0x64 IFT_VOICEEMFGD = 0xd3 IFT_VOICEENCAP = 0x67 IFT_VOICEFGDEANA = 0xd4 IFT_VOICEFXO = 0x65 IFT_VOICEFXS = 0x66 IFT_VOICEOVERATM = 0x98 IFT_VOICEOVERCABLE = 0xc6 IFT_VOICEOVERFRAMERELAY = 0x99 IFT_VOICEOVERIP = 0x68 IFT_WIREGUARD = 0xfb IFT_X213 = 0x5d IFT_X25 = 0x5 IFT_X25DDN = 0x4 IFT_X25HUNTGROUP = 0x7a IFT_X25MLP = 0x79 IFT_X25PLE = 0x28 IFT_XETHER = 0x1a IGNBRK = 0x1 IGNCR = 0x80 IGNPAR = 0x4 IMAXBEL = 0x2000 INLCR = 0x40 INPCK = 0x10 IN_CLASSA_HOST = 0xffffff IN_CLASSA_MAX = 0x80 IN_CLASSA_NET = 0xff000000 IN_CLASSA_NSHIFT = 0x18 IN_CLASSB_HOST = 0xffff IN_CLASSB_MAX = 0x10000 IN_CLASSB_NET = 0xffff0000 IN_CLASSB_NSHIFT = 0x10 IN_CLASSC_HOST = 0xff IN_CLASSC_NET = 0xffffff00 IN_CLASSC_NSHIFT = 0x8 IN_CLASSD_HOST = 0xfffffff IN_CLASSD_NET = 0xf0000000 IN_CLASSD_NSHIFT = 0x1c IN_LOOPBACKNET = 0x7f IN_RFC3021_HOST = 0x1 IN_RFC3021_NET = 0xfffffffe IN_RFC3021_NSHIFT = 0x1f IPPROTO_AH = 0x33 IPPROTO_CARP = 0x70 IPPROTO_DIVERT = 0x102 IPPROTO_DONE = 0x101 IPPROTO_DSTOPTS = 0x3c IPPROTO_EGP = 0x8 IPPROTO_ENCAP = 0x62 IPPROTO_EON = 0x50 IPPROTO_ESP = 0x32 IPPROTO_ETHERIP = 0x61 IPPROTO_FRAGMENT = 0x2c IPPROTO_GGP = 0x3 IPPROTO_GRE = 0x2f IPPROTO_HOPOPTS = 0x0 IPPROTO_ICMP = 0x1 IPPROTO_ICMPV6 = 0x3a IPPROTO_IDP = 0x16 IPPROTO_IGMP = 0x2 IPPROTO_IP = 0x0 IPPROTO_IPCOMP = 0x6c IPPROTO_IPIP = 0x4 IPPROTO_IPV4 = 0x4 IPPROTO_IPV6 = 0x29 IPPROTO_MAX = 0x100 IPPROTO_MAXID = 0x103 IPPROTO_MOBILE = 0x37 IPPROTO_MPLS = 0x89 IPPROTO_NONE = 0x3b IPPROTO_PFSYNC = 0xf0 IPPROTO_PIM = 0x67 IPPROTO_PUP = 0xc IPPROTO_RAW = 0xff IPPROTO_ROUTING = 0x2b IPPROTO_RSVP = 0x2e IPPROTO_SCTP = 0x84 IPPROTO_TCP = 0x6 IPPROTO_TP = 0x1d IPPROTO_UDP = 0x11 IPPROTO_UDPLITE = 0x88 IPV6_AUTH_LEVEL = 0x35 IPV6_AUTOFLOWLABEL = 0x3b IPV6_CHECKSUM = 0x1a IPV6_DEFAULT_MULTICAST_HOPS = 0x1 IPV6_DEFAULT_MULTICAST_LOOP = 0x1 IPV6_DEFHLIM = 0x40 IPV6_DONTFRAG = 0x3e IPV6_DSTOPTS = 0x32 IPV6_ESP_NETWORK_LEVEL = 0x37 IPV6_ESP_TRANS_LEVEL = 0x36 IPV6_FAITH = 0x1d IPV6_FLOWINFO_MASK = 0xfffffff IPV6_FLOWLABEL_MASK = 0xfffff IPV6_FRAGTTL = 0x78 IPV6_HLIMDEC = 0x1 IPV6_HOPLIMIT = 0x2f IPV6_HOPOPTS = 0x31 IPV6_IPCOMP_LEVEL = 0x3c IPV6_JOIN_GROUP = 0xc IPV6_LEAVE_GROUP = 0xd IPV6_MAXHLIM = 0xff IPV6_MAXPACKET = 0xffff IPV6_MINHOPCOUNT = 0x41 IPV6_MMTU = 0x500 IPV6_MULTICAST_HOPS = 0xa IPV6_MULTICAST_IF = 0x9 IPV6_MULTICAST_LOOP = 0xb IPV6_NEXTHOP = 0x30 IPV6_OPTIONS = 0x1 IPV6_PATHMTU = 0x2c IPV6_PIPEX = 0x3f IPV6_PKTINFO = 0x2e IPV6_PORTRANGE = 0xe IPV6_PORTRANGE_DEFAULT = 0x0 IPV6_PORTRANGE_HIGH = 0x1 IPV6_PORTRANGE_LOW = 0x2 IPV6_RECVDSTOPTS = 0x28 IPV6_RECVDSTPORT = 0x40 IPV6_RECVHOPLIMIT = 0x25 IPV6_RECVHOPOPTS = 0x27 IPV6_RECVPATHMTU = 0x2b IPV6_RECVPKTINFO = 0x24 IPV6_RECVRTHDR = 0x26 IPV6_RECVTCLASS = 0x39 IPV6_RTABLE = 0x1021 IPV6_RTHDR = 0x33 IPV6_RTHDRDSTOPTS = 0x23 IPV6_RTHDR_LOOSE = 0x0 IPV6_RTHDR_STRICT = 0x1 IPV6_RTHDR_TYPE_0 = 0x0 IPV6_SOCKOPT_RESERVED1 = 0x3 IPV6_TCLASS = 0x3d IPV6_UNICAST_HOPS = 0x4 IPV6_USE_MIN_MTU = 0x2a IPV6_V6ONLY = 0x1b IPV6_VERSION = 0x60 IPV6_VERSION_MASK = 0xf0 IP_ADD_MEMBERSHIP = 0xc IP_AUTH_LEVEL = 0x14 IP_DEFAULT_MULTICAST_LOOP = 0x1 IP_DEFAULT_MULTICAST_TTL = 0x1 IP_DF = 0x4000 IP_DROP_MEMBERSHIP = 0xd IP_ESP_NETWORK_LEVEL = 0x16 IP_ESP_TRANS_LEVEL = 0x15 IP_HDRINCL = 0x2 IP_IPCOMP_LEVEL = 0x1d IP_IPDEFTTL = 0x25 IP_IPSECFLOWINFO = 0x24 IP_IPSEC_LOCAL_AUTH = 0x1b IP_IPSEC_LOCAL_CRED = 0x19 IP_IPSEC_LOCAL_ID = 0x17 IP_IPSEC_REMOTE_AUTH = 0x1c IP_IPSEC_REMOTE_CRED = 0x1a IP_IPSEC_REMOTE_ID = 0x18 IP_MAXPACKET = 0xffff IP_MAX_MEMBERSHIPS = 0xfff IP_MF = 0x2000 IP_MINTTL = 0x20 IP_MIN_MEMBERSHIPS = 0xf IP_MSS = 0x240 IP_MULTICAST_IF = 0x9 IP_MULTICAST_LOOP = 0xb IP_MULTICAST_TTL = 0xa IP_OFFMASK = 0x1fff IP_OPTIONS = 0x1 IP_PIPEX = 0x22 IP_PORTRANGE = 0x13 IP_PORTRANGE_DEFAULT = 0x0 IP_PORTRANGE_HIGH = 0x1 IP_PORTRANGE_LOW = 0x2 IP_RECVDSTADDR = 0x7 IP_RECVDSTPORT = 0x21 IP_RECVIF = 0x1e IP_RECVOPTS = 0x5 IP_RECVRETOPTS = 0x6 IP_RECVRTABLE = 0x23 IP_RECVTTL = 0x1f IP_RETOPTS = 0x8 IP_RF = 0x8000 IP_RTABLE = 0x1021 IP_SENDSRCADDR = 0x7 IP_TOS = 0x3 IP_TTL = 0x4 ISIG = 0x80 ISTRIP = 0x20 ITIMER_PROF = 0x2 ITIMER_REAL = 0x0 ITIMER_VIRTUAL = 0x1 IUCLC = 0x1000 IXANY = 0x800 IXOFF = 0x400 IXON = 0x200 KERN_HOSTNAME = 0xa KERN_OSRELEASE = 0x2 KERN_OSTYPE = 0x1 KERN_VERSION = 0x4 LCNT_OVERLOAD_FLUSH = 0x6 LOCK_EX = 0x2 LOCK_NB = 0x4 LOCK_SH = 0x1 LOCK_UN = 0x8 MADV_DONTNEED = 0x4 MADV_FREE = 0x6 MADV_NORMAL = 0x0 MADV_RANDOM = 0x1 MADV_SEQUENTIAL = 0x2 MADV_SPACEAVAIL = 0x5 MADV_WILLNEED = 0x3 MAP_ANON = 0x1000 MAP_ANONYMOUS = 0x1000 MAP_CONCEAL = 0x8000 MAP_COPY = 0x2 MAP_FILE = 0x0 MAP_FIXED = 0x10 MAP_FLAGMASK = 0xfff7 MAP_HASSEMAPHORE = 0x0 MAP_INHERIT = 0x0 MAP_INHERIT_COPY = 0x1 MAP_INHERIT_NONE = 0x2 MAP_INHERIT_SHARE = 0x0 MAP_INHERIT_ZERO = 0x3 MAP_NOEXTEND = 0x0 MAP_NORESERVE = 0x0 MAP_PRIVATE = 0x2 MAP_RENAME = 0x0 MAP_SHARED = 0x1 MAP_STACK = 0x4000 MAP_TRYFIXED = 0x0 MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MNT_ASYNC = 0x40 MNT_DEFEXPORTED = 0x200 MNT_DELEXPORT = 0x20000 MNT_DOOMED = 0x8000000 MNT_EXPORTANON = 0x400 MNT_EXPORTED = 0x100 MNT_EXRDONLY = 0x80 MNT_FORCE = 0x80000 MNT_LAZY = 0x3 MNT_LOCAL = 0x1000 MNT_NOATIME = 0x8000 MNT_NODEV = 0x10 MNT_NOEXEC = 0x4 MNT_NOPERM = 0x20 MNT_NOSUID = 0x8 MNT_NOWAIT = 0x2 MNT_QUOTA = 0x2000 MNT_RDONLY = 0x1 MNT_RELOAD = 0x40000 MNT_ROOTFS = 0x4000 MNT_SOFTDEP = 0x4000000 MNT_STALLED = 0x100000 MNT_SWAPPABLE = 0x200000 MNT_SYNCHRONOUS = 0x2 MNT_UPDATE = 0x10000 MNT_VISFLAGMASK = 0x400ffff MNT_WAIT = 0x1 MNT_WANTRDWR = 0x2000000 MNT_WXALLOWED = 0x800 MOUNT_AFS = "afs" MOUNT_CD9660 = "cd9660" MOUNT_EXT2FS = "ext2fs" MOUNT_FFS = "ffs" MOUNT_FUSEFS = "fuse" MOUNT_MFS = "mfs" MOUNT_MSDOS = "msdos" MOUNT_NCPFS = "ncpfs" MOUNT_NFS = "nfs" MOUNT_NTFS = "ntfs" MOUNT_TMPFS = "tmpfs" MOUNT_UDF = "udf" MOUNT_UFS = "ffs" MSG_BCAST = 0x100 MSG_CMSG_CLOEXEC = 0x800 MSG_CTRUNC = 0x20 MSG_DONTROUTE = 0x4 MSG_DONTWAIT = 0x80 MSG_EOR = 0x8 MSG_MCAST = 0x200 MSG_NOSIGNAL = 0x400 MSG_OOB = 0x1 MSG_PEEK = 0x2 MSG_TRUNC = 0x10 MSG_WAITALL = 0x40 MSG_WAITFORONE = 0x1000 MS_ASYNC = 0x1 MS_INVALIDATE = 0x4 MS_SYNC = 0x2 NAME_MAX = 0xff NET_RT_DUMP = 0x1 NET_RT_FLAGS = 0x2 NET_RT_IFLIST = 0x3 NET_RT_IFNAMES = 0x6 NET_RT_MAXID = 0x8 NET_RT_SOURCE = 0x7 NET_RT_STATS = 0x4 NET_RT_TABLE = 0x5 NFDBITS = 0x20 NOFLSH = 0x80000000 NOKERNINFO = 0x2000000 NOTE_ATTRIB = 0x8 NOTE_CHANGE = 0x1 NOTE_CHILD = 0x4 NOTE_DELETE = 0x1 NOTE_EOF = 0x2 NOTE_EXEC = 0x20000000 NOTE_EXIT = 0x80000000 NOTE_EXTEND = 0x4 NOTE_FORK = 0x40000000 NOTE_LINK = 0x10 NOTE_LOWAT = 0x1 NOTE_OOB = 0x4 NOTE_PCTRLMASK = 0xf0000000 NOTE_PDATAMASK = 0xfffff NOTE_RENAME = 0x20 NOTE_REVOKE = 0x40 NOTE_TRACK = 0x1 NOTE_TRACKERR = 0x2 NOTE_TRUNCATE = 0x80 NOTE_WRITE = 0x2 OCRNL = 0x10 OLCUC = 0x20 ONLCR = 0x2 ONLRET = 0x80 ONOCR = 0x40 ONOEOT = 0x8 OPOST = 0x1 OXTABS = 0x4 O_ACCMODE = 0x3 O_APPEND = 0x8 O_ASYNC = 0x40 O_CLOEXEC = 0x10000 O_CREAT = 0x200 O_DIRECTORY = 0x20000 O_DSYNC = 0x80 O_EXCL = 0x800 O_EXLOCK = 0x20 O_FSYNC = 0x80 O_NDELAY = 0x4 O_NOCTTY = 0x8000 O_NOFOLLOW = 0x100 O_NONBLOCK = 0x4 O_RDONLY = 0x0 O_RDWR = 0x2 O_RSYNC = 0x80 O_SHLOCK = 0x10 O_SYNC = 0x80 O_TRUNC = 0x400 O_WRONLY = 0x1 PARENB = 0x1000 PARMRK = 0x8 PARODD = 0x2000 PENDIN = 0x20000000 PF_FLUSH = 0x1 PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 PROT_EXEC = 0x4 PROT_NONE = 0x0 PROT_READ = 0x1 PROT_WRITE = 0x2 RLIMIT_CORE = 0x4 RLIMIT_CPU = 0x0 RLIMIT_DATA = 0x2 RLIMIT_FSIZE = 0x1 RLIMIT_MEMLOCK = 0x6 RLIMIT_NOFILE = 0x8 RLIMIT_NPROC = 0x7 RLIMIT_RSS = 0x5 RLIMIT_STACK = 0x3 RLIM_INFINITY = 0x7fffffffffffffff RTAX_AUTHOR = 0x6 RTAX_BFD = 0xb RTAX_BRD = 0x7 RTAX_DNS = 0xc RTAX_DST = 0x0 RTAX_GATEWAY = 0x1 RTAX_GENMASK = 0x3 RTAX_IFA = 0x5 RTAX_IFP = 0x4 RTAX_LABEL = 0xa RTAX_MAX = 0xf RTAX_NETMASK = 0x2 RTAX_SEARCH = 0xe RTAX_SRC = 0x8 RTAX_SRCMASK = 0x9 RTAX_STATIC = 0xd RTA_AUTHOR = 0x40 RTA_BFD = 0x800 RTA_BRD = 0x80 RTA_DNS = 0x1000 RTA_DST = 0x1 RTA_GATEWAY = 0x2 RTA_GENMASK = 0x8 RTA_IFA = 0x20 RTA_IFP = 0x10 RTA_LABEL = 0x400 RTA_NETMASK = 0x4 RTA_SEARCH = 0x4000 RTA_SRC = 0x100 RTA_SRCMASK = 0x200 RTA_STATIC = 0x2000 RTF_ANNOUNCE = 0x4000 RTF_BFD = 0x1000000 RTF_BLACKHOLE = 0x1000 RTF_BROADCAST = 0x400000 RTF_CACHED = 0x20000 RTF_CLONED = 0x10000 RTF_CLONING = 0x100 RTF_CONNECTED = 0x800000 RTF_DONE = 0x40 RTF_DYNAMIC = 0x10 RTF_FMASK = 0x110fc08 RTF_GATEWAY = 0x2 RTF_HOST = 0x4 RTF_LLINFO = 0x400 RTF_LOCAL = 0x200000 RTF_MODIFIED = 0x20 RTF_MPATH = 0x40000 RTF_MPLS = 0x100000 RTF_MULTICAST = 0x200 RTF_PERMANENT_ARP = 0x2000 RTF_PROTO1 = 0x8000 RTF_PROTO2 = 0x4000 RTF_PROTO3 = 0x2000 RTF_REJECT = 0x8 RTF_STATIC = 0x800 RTF_UP = 0x1 RTF_USETRAILERS = 0x8000 RTM_80211INFO = 0x15 RTM_ADD = 0x1 RTM_BFD = 0x12 RTM_CHANGE = 0x3 RTM_CHGADDRATTR = 0x14 RTM_DELADDR = 0xd RTM_DELETE = 0x2 RTM_DESYNC = 0x10 RTM_GET = 0x4 RTM_IFANNOUNCE = 0xf RTM_IFINFO = 0xe RTM_INVALIDATE = 0x11 RTM_LOSING = 0x5 RTM_MAXSIZE = 0x800 RTM_MISS = 0x7 RTM_NEWADDR = 0xc RTM_PROPOSAL = 0x13 RTM_REDIRECT = 0x6 RTM_RESOLVE = 0xb RTM_SOURCE = 0x16 RTM_VERSION = 0x5 RTV_EXPIRE = 0x4 RTV_HOPCOUNT = 0x2 RTV_MTU = 0x1 RTV_RPIPE = 0x8 RTV_RTT = 0x40 RTV_RTTVAR = 0x80 RTV_SPIPE = 0x10 RTV_SSTHRESH = 0x20 RT_TABLEID_BITS = 0x8 RT_TABLEID_MASK = 0xff RT_TABLEID_MAX = 0xff RUSAGE_CHILDREN = -0x1 RUSAGE_SELF = 0x0 RUSAGE_THREAD = 0x1 SCM_RIGHTS = 0x1 SCM_TIMESTAMP = 0x4 SEEK_CUR = 0x1 SEEK_END = 0x2 SEEK_SET = 0x0 SHUT_RD = 0x0 SHUT_RDWR = 0x2 SHUT_WR = 0x1 SIOCADDMULTI = 0x80206931 SIOCAIFADDR = 0x8040691a SIOCAIFGROUP = 0x80286987 SIOCATMARK = 0x40047307 SIOCBRDGADD = 0x8060693c SIOCBRDGADDL = 0x80606949 SIOCBRDGADDS = 0x80606941 SIOCBRDGARL = 0x808c694d SIOCBRDGDADDR = 0x81286947 SIOCBRDGDEL = 0x8060693d SIOCBRDGDELS = 0x80606942 SIOCBRDGFLUSH = 0x80606948 SIOCBRDGFRL = 0x808c694e SIOCBRDGGCACHE = 0xc0146941 SIOCBRDGGFD = 0xc0146952 SIOCBRDGGHT = 0xc0146951 SIOCBRDGGIFFLGS = 0xc060693e SIOCBRDGGMA = 0xc0146953 SIOCBRDGGPARAM = 0xc0406958 SIOCBRDGGPRI = 0xc0146950 SIOCBRDGGRL = 0xc030694f SIOCBRDGGTO = 0xc0146946 SIOCBRDGIFS = 0xc0606942 SIOCBRDGRTS = 0xc0206943 SIOCBRDGSADDR = 0xc1286944 SIOCBRDGSCACHE = 0x80146940 SIOCBRDGSFD = 0x80146952 SIOCBRDGSHT = 0x80146951 SIOCBRDGSIFCOST = 0x80606955 SIOCBRDGSIFFLGS = 0x8060693f SIOCBRDGSIFPRIO = 0x80606954 SIOCBRDGSIFPROT = 0x8060694a SIOCBRDGSMA = 0x80146953 SIOCBRDGSPRI = 0x80146950 SIOCBRDGSPROTO = 0x8014695a SIOCBRDGSTO = 0x80146945 SIOCBRDGSTXHC = 0x80146959 SIOCDELLABEL = 0x80206997 SIOCDELMULTI = 0x80206932 SIOCDIFADDR = 0x80206919 SIOCDIFGROUP = 0x80286989 SIOCDIFPARENT = 0x802069b4 SIOCDIFPHYADDR = 0x80206949 SIOCDPWE3NEIGHBOR = 0x802069de SIOCDVNETID = 0x802069af SIOCGETKALIVE = 0xc01869a4 SIOCGETLABEL = 0x8020699a SIOCGETMPWCFG = 0xc02069ae SIOCGETPFLOW = 0xc02069fe SIOCGETPFSYNC = 0xc02069f8 SIOCGETSGCNT = 0xc0207534 SIOCGETVIFCNT = 0xc0287533 SIOCGETVLAN = 0xc0206990 SIOCGIFADDR = 0xc0206921 SIOCGIFBRDADDR = 0xc0206923 SIOCGIFCONF = 0xc0106924 SIOCGIFDATA = 0xc020691b SIOCGIFDESCR = 0xc0206981 SIOCGIFDSTADDR = 0xc0206922 SIOCGIFFLAGS = 0xc0206911 SIOCGIFGATTR = 0xc028698b SIOCGIFGENERIC = 0xc020693a SIOCGIFGLIST = 0xc028698d SIOCGIFGMEMB = 0xc028698a SIOCGIFGROUP = 0xc0286988 SIOCGIFHARDMTU = 0xc02069a5 SIOCGIFLLPRIO = 0xc02069b6 SIOCGIFMEDIA = 0xc0406938 SIOCGIFMETRIC = 0xc0206917 SIOCGIFMTU = 0xc020697e SIOCGIFNETMASK = 0xc0206925 SIOCGIFPAIR = 0xc02069b1 SIOCGIFPARENT = 0xc02069b3 SIOCGIFPRIORITY = 0xc020699c SIOCGIFRDOMAIN = 0xc02069a0 SIOCGIFRTLABEL = 0xc0206983 SIOCGIFRXR = 0x802069aa SIOCGIFSFFPAGE = 0xc1126939 SIOCGIFXFLAGS = 0xc020699e SIOCGLIFPHYADDR = 0xc218694b SIOCGLIFPHYDF = 0xc02069c2 SIOCGLIFPHYECN = 0xc02069c8 SIOCGLIFPHYRTABLE = 0xc02069a2 SIOCGLIFPHYTTL = 0xc02069a9 SIOCGPGRP = 0x40047309 SIOCGPWE3 = 0xc0206998 SIOCGPWE3CTRLWORD = 0xc02069dc SIOCGPWE3FAT = 0xc02069dd SIOCGPWE3NEIGHBOR = 0xc21869de SIOCGRXHPRIO = 0xc02069db SIOCGSPPPPARAMS = 0xc0206994 SIOCGTXHPRIO = 0xc02069c6 SIOCGUMBINFO = 0xc02069be SIOCGUMBPARAM = 0xc02069c0 SIOCGVH = 0xc02069f6 SIOCGVNETFLOWID = 0xc02069c4 SIOCGVNETID = 0xc02069a7 SIOCIFAFATTACH = 0x801169ab SIOCIFAFDETACH = 0x801169ac SIOCIFCREATE = 0x8020697a SIOCIFDESTROY = 0x80206979 SIOCIFGCLONERS = 0xc0106978 SIOCSETKALIVE = 0x801869a3 SIOCSETLABEL = 0x80206999 SIOCSETMPWCFG = 0x802069ad SIOCSETPFLOW = 0x802069fd SIOCSETPFSYNC = 0x802069f7 SIOCSETVLAN = 0x8020698f SIOCSIFADDR = 0x8020690c SIOCSIFBRDADDR = 0x80206913 SIOCSIFDESCR = 0x80206980 SIOCSIFDSTADDR = 0x8020690e SIOCSIFFLAGS = 0x80206910 SIOCSIFGATTR = 0x8028698c SIOCSIFGENERIC = 0x80206939 SIOCSIFLLADDR = 0x8020691f SIOCSIFLLPRIO = 0x802069b5 SIOCSIFMEDIA = 0xc0206937 SIOCSIFMETRIC = 0x80206918 SIOCSIFMTU = 0x8020697f SIOCSIFNETMASK = 0x80206916 SIOCSIFPAIR = 0x802069b0 SIOCSIFPARENT = 0x802069b2 SIOCSIFPRIORITY = 0x8020699b SIOCSIFRDOMAIN = 0x8020699f SIOCSIFRTLABEL = 0x80206982 SIOCSIFXFLAGS = 0x8020699d SIOCSLIFPHYADDR = 0x8218694a SIOCSLIFPHYDF = 0x802069c1 SIOCSLIFPHYECN = 0x802069c7 SIOCSLIFPHYRTABLE = 0x802069a1 SIOCSLIFPHYTTL = 0x802069a8 SIOCSPGRP = 0x80047308 SIOCSPWE3CTRLWORD = 0x802069dc SIOCSPWE3FAT = 0x802069dd SIOCSPWE3NEIGHBOR = 0x821869de SIOCSRXHPRIO = 0x802069db SIOCSSPPPPARAMS = 0x80206993 SIOCSTXHPRIO = 0x802069c5 SIOCSUMBPARAM = 0x802069bf SIOCSVH = 0xc02069f5 SIOCSVNETFLOWID = 0x802069c3 SIOCSVNETID = 0x802069a6 SOCK_CLOEXEC = 0x8000 SOCK_DGRAM = 0x2 SOCK_DNS = 0x1000 SOCK_NONBLOCK = 0x4000 SOCK_RAW = 0x3 SOCK_RDM = 0x4 SOCK_SEQPACKET = 0x5 SOCK_STREAM = 0x1 SOL_SOCKET = 0xffff SOMAXCONN = 0x80 SO_ACCEPTCONN = 0x2 SO_BINDANY = 0x1000 SO_BROADCAST = 0x20 SO_DEBUG = 0x1 SO_DOMAIN = 0x1024 SO_DONTROUTE = 0x10 SO_ERROR = 0x1007 SO_KEEPALIVE = 0x8 SO_LINGER = 0x80 SO_NETPROC = 0x1020 SO_OOBINLINE = 0x100 SO_PEERCRED = 0x1022 SO_PROTOCOL = 0x1025 SO_RCVBUF = 0x1002 SO_RCVLOWAT = 0x1004 SO_RCVTIMEO = 0x1006 SO_REUSEADDR = 0x4 SO_REUSEPORT = 0x200 SO_RTABLE = 0x1021 SO_SNDBUF = 0x1001 SO_SNDLOWAT = 0x1003 SO_SNDTIMEO = 0x1005 SO_SPLICE = 0x1023 SO_TIMESTAMP = 0x800 SO_TYPE = 0x1008 SO_USELOOPBACK = 0x40 SO_ZEROIZE = 0x2000 S_BLKSIZE = 0x200 S_IEXEC = 0x40 S_IFBLK = 0x6000 S_IFCHR = 0x2000 S_IFDIR = 0x4000 S_IFIFO = 0x1000 S_IFLNK = 0xa000 S_IFMT = 0xf000 S_IFREG = 0x8000 S_IFSOCK = 0xc000 S_IREAD = 0x100 S_IRGRP = 0x20 S_IROTH = 0x4 S_IRUSR = 0x100 S_IRWXG = 0x38 S_IRWXO = 0x7 S_IRWXU = 0x1c0 S_ISGID = 0x400 S_ISTXT = 0x200 S_ISUID = 0x800 S_ISVTX = 0x200 S_IWGRP = 0x10 S_IWOTH = 0x2 S_IWRITE = 0x80 S_IWUSR = 0x80 S_IXGRP = 0x8 S_IXOTH = 0x1 S_IXUSR = 0x40 TCIFLUSH = 0x1 TCIOFF = 0x3 TCIOFLUSH = 0x3 TCION = 0x4 TCOFLUSH = 0x2 TCOOFF = 0x1 TCOON = 0x2 TCPOPT_EOL = 0x0 TCPOPT_MAXSEG = 0x2 TCPOPT_NOP = 0x1 TCPOPT_SACK = 0x5 TCPOPT_SACK_HDR = 0x1010500 TCPOPT_SACK_PERMITTED = 0x4 TCPOPT_SACK_PERMIT_HDR = 0x1010402 TCPOPT_SIGNATURE = 0x13 TCPOPT_TIMESTAMP = 0x8 TCPOPT_TSTAMP_HDR = 0x101080a TCPOPT_WINDOW = 0x3 TCP_INFO = 0x9 TCP_MAXSEG = 0x2 TCP_MAXWIN = 0xffff TCP_MAX_SACK = 0x3 TCP_MAX_WINSHIFT = 0xe TCP_MD5SIG = 0x4 TCP_MSS = 0x200 TCP_NODELAY = 0x1 TCP_NOPUSH = 0x10 TCP_SACKHOLE_LIMIT = 0x80 TCP_SACK_ENABLE = 0x8 TCSAFLUSH = 0x2 TIMER_ABSTIME = 0x1 TIMER_RELTIME = 0x0 TIOCCBRK = 0x2000747a TIOCCDTR = 0x20007478 TIOCCHKVERAUTH = 0x2000741e TIOCCLRVERAUTH = 0x2000741d TIOCCONS = 0x80047462 TIOCDRAIN = 0x2000745e TIOCEXCL = 0x2000740d TIOCEXT = 0x80047460 TIOCFLAG_CLOCAL = 0x2 TIOCFLAG_CRTSCTS = 0x4 TIOCFLAG_MDMBUF = 0x8 TIOCFLAG_PPS = 0x10 TIOCFLAG_SOFTCAR = 0x1 TIOCFLUSH = 0x80047410 TIOCGETA = 0x402c7413 TIOCGETD = 0x4004741a TIOCGFLAGS = 0x4004745d TIOCGPGRP = 0x40047477 TIOCGSID = 0x40047463 TIOCGTSTAMP = 0x4010745b TIOCGWINSZ = 0x40087468 TIOCMBIC = 0x8004746b TIOCMBIS = 0x8004746c TIOCMGET = 0x4004746a TIOCMODG = 0x4004746a TIOCMODS = 0x8004746d TIOCMSET = 0x8004746d TIOCM_CAR = 0x40 TIOCM_CD = 0x40 TIOCM_CTS = 0x20 TIOCM_DSR = 0x100 TIOCM_DTR = 0x2 TIOCM_LE = 0x1 TIOCM_RI = 0x80 TIOCM_RNG = 0x80 TIOCM_RTS = 0x4 TIOCM_SR = 0x10 TIOCM_ST = 0x8 TIOCNOTTY = 0x20007471 TIOCNXCL = 0x2000740e TIOCOUTQ = 0x40047473 TIOCPKT = 0x80047470 TIOCPKT_DATA = 0x0 TIOCPKT_DOSTOP = 0x20 TIOCPKT_FLUSHREAD = 0x1 TIOCPKT_FLUSHWRITE = 0x2 TIOCPKT_IOCTL = 0x40 TIOCPKT_NOSTOP = 0x10 TIOCPKT_START = 0x8 TIOCPKT_STOP = 0x4 TIOCREMOTE = 0x80047469 TIOCSBRK = 0x2000747b TIOCSCTTY = 0x20007461 TIOCSDTR = 0x20007479 TIOCSETA = 0x802c7414 TIOCSETAF = 0x802c7416 TIOCSETAW = 0x802c7415 TIOCSETD = 0x8004741b TIOCSETVERAUTH = 0x8004741c TIOCSFLAGS = 0x8004745c TIOCSIG = 0x8004745f TIOCSPGRP = 0x80047476 TIOCSTART = 0x2000746e TIOCSTAT = 0x20007465 TIOCSTOP = 0x2000746f TIOCSTSTAMP = 0x8008745a TIOCSWINSZ = 0x80087467 TIOCUCNTL = 0x80047466 TIOCUCNTL_CBRK = 0x7a TIOCUCNTL_SBRK = 0x7b TOSTOP = 0x400000 UTIME_NOW = -0x2 UTIME_OMIT = -0x1 VDISCARD = 0xf VDSUSP = 0xb VEOF = 0x0 VEOL = 0x1 VEOL2 = 0x2 VERASE = 0x3 VINTR = 0x8 VKILL = 0x5 VLNEXT = 0xe VMIN = 0x10 VM_ANONMIN = 0x7 VM_LOADAVG = 0x2 VM_MALLOC_CONF = 0xc VM_MAXID = 0xd VM_MAXSLP = 0xa VM_METER = 0x1 VM_NKMEMPAGES = 0x6 VM_PSSTRINGS = 0x3 VM_SWAPENCRYPT = 0x5 VM_USPACE = 0xb VM_UVMEXP = 0x4 VM_VNODEMIN = 0x9 VM_VTEXTMIN = 0x8 VQUIT = 0x9 VREPRINT = 0x6 VSTART = 0xc VSTATUS = 0x12 VSTOP = 0xd VSUSP = 0xa VTIME = 0x11 VWERASE = 0x4 WALTSIG = 0x4 WCONTINUED = 0x8 WCOREFLAG = 0x80 WNOHANG = 0x1 WUNTRACED = 0x2 XCASE = 0x1000000 ) // Errors const ( E2BIG = syscall.Errno(0x7) EACCES = syscall.Errno(0xd) EADDRINUSE = syscall.Errno(0x30) EADDRNOTAVAIL = syscall.Errno(0x31) EAFNOSUPPORT = syscall.Errno(0x2f) EAGAIN = syscall.Errno(0x23) EALREADY = syscall.Errno(0x25) EAUTH = syscall.Errno(0x50) EBADF = syscall.Errno(0x9) EBADMSG = syscall.Errno(0x5c) EBADRPC = syscall.Errno(0x48) EBUSY = syscall.Errno(0x10) ECANCELED = syscall.Errno(0x58) ECHILD = syscall.Errno(0xa) ECONNABORTED = syscall.Errno(0x35) ECONNREFUSED = syscall.Errno(0x3d) ECONNRESET = syscall.Errno(0x36) EDEADLK = syscall.Errno(0xb) EDESTADDRREQ = syscall.Errno(0x27) EDOM = syscall.Errno(0x21) EDQUOT = syscall.Errno(0x45) EEXIST = syscall.Errno(0x11) EFAULT = syscall.Errno(0xe) EFBIG = syscall.Errno(0x1b) EFTYPE = syscall.Errno(0x4f) EHOSTDOWN = syscall.Errno(0x40) EHOSTUNREACH = syscall.Errno(0x41) EIDRM = syscall.Errno(0x59) EILSEQ = syscall.Errno(0x54) EINPROGRESS = syscall.Errno(0x24) EINTR = syscall.Errno(0x4) EINVAL = syscall.Errno(0x16) EIO = syscall.Errno(0x5) EIPSEC = syscall.Errno(0x52) EISCONN = syscall.Errno(0x38) EISDIR = syscall.Errno(0x15) ELAST = syscall.Errno(0x5f) ELOOP = syscall.Errno(0x3e) EMEDIUMTYPE = syscall.Errno(0x56) EMFILE = syscall.Errno(0x18) EMLINK = syscall.Errno(0x1f) EMSGSIZE = syscall.Errno(0x28) ENAMETOOLONG = syscall.Errno(0x3f) ENEEDAUTH = syscall.Errno(0x51) ENETDOWN = syscall.Errno(0x32) ENETRESET = syscall.Errno(0x34) ENETUNREACH = syscall.Errno(0x33) ENFILE = syscall.Errno(0x17) ENOATTR = syscall.Errno(0x53) ENOBUFS = syscall.Errno(0x37) ENODEV = syscall.Errno(0x13) ENOENT = syscall.Errno(0x2) ENOEXEC = syscall.Errno(0x8) ENOLCK = syscall.Errno(0x4d) ENOMEDIUM = syscall.Errno(0x55) ENOMEM = syscall.Errno(0xc) ENOMSG = syscall.Errno(0x5a) ENOPROTOOPT = syscall.Errno(0x2a) ENOSPC = syscall.Errno(0x1c) ENOSYS = syscall.Errno(0x4e) ENOTBLK = syscall.Errno(0xf) ENOTCONN = syscall.Errno(0x39) ENOTDIR = syscall.Errno(0x14) ENOTEMPTY = syscall.Errno(0x42) ENOTRECOVERABLE = syscall.Errno(0x5d) ENOTSOCK = syscall.Errno(0x26) ENOTSUP = syscall.Errno(0x5b) ENOTTY = syscall.Errno(0x19) ENXIO = syscall.Errno(0x6) EOPNOTSUPP = syscall.Errno(0x2d) EOVERFLOW = syscall.Errno(0x57) EOWNERDEAD = syscall.Errno(0x5e) EPERM = syscall.Errno(0x1) EPFNOSUPPORT = syscall.Errno(0x2e) EPIPE = syscall.Errno(0x20) EPROCLIM = syscall.Errno(0x43) EPROCUNAVAIL = syscall.Errno(0x4c) EPROGMISMATCH = syscall.Errno(0x4b) EPROGUNAVAIL = syscall.Errno(0x4a) EPROTO = syscall.Errno(0x5f) EPROTONOSUPPORT = syscall.Errno(0x2b) EPROTOTYPE = syscall.Errno(0x29) ERANGE = syscall.Errno(0x22) EREMOTE = syscall.Errno(0x47) EROFS = syscall.Errno(0x1e) ERPCMISMATCH = syscall.Errno(0x49) ESHUTDOWN = syscall.Errno(0x3a) ESOCKTNOSUPPORT = syscall.Errno(0x2c) ESPIPE = syscall.Errno(0x1d) ESRCH = syscall.Errno(0x3) ESTALE = syscall.Errno(0x46) ETIMEDOUT = syscall.Errno(0x3c) ETOOMANYREFS = syscall.Errno(0x3b) ETXTBSY = syscall.Errno(0x1a) EUSERS = syscall.Errno(0x44) EWOULDBLOCK = syscall.Errno(0x23) EXDEV = syscall.Errno(0x12) ) // Signals const ( SIGABRT = syscall.Signal(0x6) SIGALRM = syscall.Signal(0xe) SIGBUS = syscall.Signal(0xa) SIGCHLD = syscall.Signal(0x14) SIGCONT = syscall.Signal(0x13) SIGEMT = syscall.Signal(0x7) SIGFPE = syscall.Signal(0x8) SIGHUP = syscall.Signal(0x1) SIGILL = syscall.Signal(0x4) SIGINFO = syscall.Signal(0x1d) SIGINT = syscall.Signal(0x2) SIGIO = syscall.Signal(0x17) SIGIOT = syscall.Signal(0x6) SIGKILL = syscall.Signal(0x9) SIGPIPE = syscall.Signal(0xd) SIGPROF = syscall.Signal(0x1b) SIGQUIT = syscall.Signal(0x3) SIGSEGV = syscall.Signal(0xb) SIGSTOP = syscall.Signal(0x11) SIGSYS = syscall.Signal(0xc) SIGTERM = syscall.Signal(0xf) SIGTHR = syscall.Signal(0x20) SIGTRAP = syscall.Signal(0x5) SIGTSTP = syscall.Signal(0x12) SIGTTIN = syscall.Signal(0x15) SIGTTOU = syscall.Signal(0x16) SIGURG = syscall.Signal(0x10) SIGUSR1 = syscall.Signal(0x1e) SIGUSR2 = syscall.Signal(0x1f) SIGVTALRM = syscall.Signal(0x1a) SIGWINCH = syscall.Signal(0x1c) SIGXCPU = syscall.Signal(0x18) SIGXFSZ = syscall.Signal(0x19) ) // Error table var errorList = [...]struct { num syscall.Errno name string desc string }{ {1, "EPERM", "operation not permitted"}, {2, "ENOENT", "no such file or directory"}, {3, "ESRCH", "no such process"}, {4, "EINTR", "interrupted system call"}, {5, "EIO", "input/output error"}, {6, "ENXIO", "device not configured"}, {7, "E2BIG", "argument list too long"}, {8, "ENOEXEC", "exec format error"}, {9, "EBADF", "bad file descriptor"}, {10, "ECHILD", "no child processes"}, {11, "EDEADLK", "resource deadlock avoided"}, {12, "ENOMEM", "cannot allocate memory"}, {13, "EACCES", "permission denied"}, {14, "EFAULT", "bad address"}, {15, "ENOTBLK", "block device required"}, {16, "EBUSY", "device busy"}, {17, "EEXIST", "file exists"}, {18, "EXDEV", "cross-device link"}, {19, "ENODEV", "operation not supported by device"}, {20, "ENOTDIR", "not a directory"}, {21, "EISDIR", "is a directory"}, {22, "EINVAL", "invalid argument"}, {23, "ENFILE", "too many open files in system"}, {24, "EMFILE", "too many open files"}, {25, "ENOTTY", "inappropriate ioctl for device"}, {26, "ETXTBSY", "text file busy"}, {27, "EFBIG", "file too large"}, {28, "ENOSPC", "no space left on device"}, {29, "ESPIPE", "illegal seek"}, {30, "EROFS", "read-only file system"}, {31, "EMLINK", "too many links"}, {32, "EPIPE", "broken pipe"}, {33, "EDOM", "numerical argument out of domain"}, {34, "ERANGE", "result too large"}, {35, "EAGAIN", "resource temporarily unavailable"}, {36, "EINPROGRESS", "operation now in progress"}, {37, "EALREADY", "operation already in progress"}, {38, "ENOTSOCK", "socket operation on non-socket"}, {39, "EDESTADDRREQ", "destination address required"}, {40, "EMSGSIZE", "message too long"}, {41, "EPROTOTYPE", "protocol wrong type for socket"}, {42, "ENOPROTOOPT", "protocol not available"}, {43, "EPROTONOSUPPORT", "protocol not supported"}, {44, "ESOCKTNOSUPPORT", "socket type not supported"}, {45, "EOPNOTSUPP", "operation not supported"}, {46, "EPFNOSUPPORT", "protocol family not supported"}, {47, "EAFNOSUPPORT", "address family not supported by protocol family"}, {48, "EADDRINUSE", "address already in use"}, {49, "EADDRNOTAVAIL", "can't assign requested address"}, {50, "ENETDOWN", "network is down"}, {51, "ENETUNREACH", "network is unreachable"}, {52, "ENETRESET", "network dropped connection on reset"}, {53, "ECONNABORTED", "software caused connection abort"}, {54, "ECONNRESET", "connection reset by peer"}, {55, "ENOBUFS", "no buffer space available"}, {56, "EISCONN", "socket is already connected"}, {57, "ENOTCONN", "socket is not connected"}, {58, "ESHUTDOWN", "can't send after socket shutdown"}, {59, "ETOOMANYREFS", "too many references: can't splice"}, {60, "ETIMEDOUT", "operation timed out"}, {61, "ECONNREFUSED", "connection refused"}, {62, "ELOOP", "too many levels of symbolic links"}, {63, "ENAMETOOLONG", "file name too long"}, {64, "EHOSTDOWN", "host is down"}, {65, "EHOSTUNREACH", "no route to host"}, {66, "ENOTEMPTY", "directory not empty"}, {67, "EPROCLIM", "too many processes"}, {68, "EUSERS", "too many users"}, {69, "EDQUOT", "disk quota exceeded"}, {70, "ESTALE", "stale NFS file handle"}, {71, "EREMOTE", "too many levels of remote in path"}, {72, "EBADRPC", "RPC struct is bad"}, {73, "ERPCMISMATCH", "RPC version wrong"}, {74, "EPROGUNAVAIL", "RPC program not available"}, {75, "EPROGMISMATCH", "program version wrong"}, {76, "EPROCUNAVAIL", "bad procedure for program"}, {77, "ENOLCK", "no locks available"}, {78, "ENOSYS", "function not implemented"}, {79, "EFTYPE", "inappropriate file type or format"}, {80, "EAUTH", "authentication error"}, {81, "ENEEDAUTH", "need authenticator"}, {82, "EIPSEC", "IPsec processing failure"}, {83, "ENOATTR", "attribute not found"}, {84, "EILSEQ", "illegal byte sequence"}, {85, "ENOMEDIUM", "no medium found"}, {86, "EMEDIUMTYPE", "wrong medium type"}, {87, "EOVERFLOW", "value too large to be stored in data type"}, {88, "ECANCELED", "operation canceled"}, {89, "EIDRM", "identifier removed"}, {90, "ENOMSG", "no message of desired type"}, {91, "ENOTSUP", "not supported"}, {92, "EBADMSG", "bad message"}, {93, "ENOTRECOVERABLE", "state not recoverable"}, {94, "EOWNERDEAD", "previous owner died"}, {95, "ELAST", "protocol error"}, } // Signal table var signalList = [...]struct { num syscall.Signal name string desc string }{ {1, "SIGHUP", "hangup"}, {2, "SIGINT", "interrupt"}, {3, "SIGQUIT", "quit"}, {4, "SIGILL", "illegal instruction"}, {5, "SIGTRAP", "trace/BPT trap"}, {6, "SIGABRT", "abort trap"}, {7, "SIGEMT", "EMT trap"}, {8, "SIGFPE", "floating point exception"}, {9, "SIGKILL", "killed"}, {10, "SIGBUS", "bus error"}, {11, "SIGSEGV", "segmentation fault"}, {12, "SIGSYS", "bad system call"}, {13, "SIGPIPE", "broken pipe"}, {14, "SIGALRM", "alarm clock"}, {15, "SIGTERM", "terminated"}, {16, "SIGURG", "urgent I/O condition"}, {17, "SIGSTOP", "suspended (signal)"}, {18, "SIGTSTP", "suspended"}, {19, "SIGCONT", "continued"}, {20, "SIGCHLD", "child exited"}, {21, "SIGTTIN", "stopped (tty input)"}, {22, "SIGTTOU", "stopped (tty output)"}, {23, "SIGIO", "I/O possible"}, {24, "SIGXCPU", "cputime limit exceeded"}, {25, "SIGXFSZ", "filesize limit exceeded"}, {26, "SIGVTALRM", "virtual timer expired"}, {27, "SIGPROF", "profiling timer expired"}, {28, "SIGWINCH", "window size changes"}, {29, "SIGINFO", "information request"}, {30, "SIGUSR1", "user defined signal 1"}, {31, "SIGUSR2", "user defined signal 2"}, {32, "SIGTHR", "thread AST"}, } ================================================ FILE: vendor/golang.org/x/sys/unix/zerrors_openbsd_riscv64.go ================================================ // mkerrors.sh -m64 // Code generated by the command above; see README.md. DO NOT EDIT. //go:build riscv64 && openbsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -m64 _const.go package unix import "syscall" const ( AF_APPLETALK = 0x10 AF_BLUETOOTH = 0x20 AF_CCITT = 0xa AF_CHAOS = 0x5 AF_CNT = 0x15 AF_COIP = 0x14 AF_DATAKIT = 0x9 AF_DECnet = 0xc AF_DLI = 0xd AF_E164 = 0x1a AF_ECMA = 0x8 AF_ENCAP = 0x1c AF_HYLINK = 0xf AF_IMPLINK = 0x3 AF_INET = 0x2 AF_INET6 = 0x18 AF_IPX = 0x17 AF_ISDN = 0x1a AF_ISO = 0x7 AF_KEY = 0x1e AF_LAT = 0xe AF_LINK = 0x12 AF_LOCAL = 0x1 AF_MAX = 0x24 AF_MPLS = 0x21 AF_NATM = 0x1b AF_NS = 0x6 AF_OSI = 0x7 AF_PUP = 0x4 AF_ROUTE = 0x11 AF_SIP = 0x1d AF_SNA = 0xb AF_UNIX = 0x1 AF_UNSPEC = 0x0 ALTWERASE = 0x200 ARPHRD_ETHER = 0x1 ARPHRD_FRELAY = 0xf ARPHRD_IEEE1394 = 0x18 ARPHRD_IEEE802 = 0x6 B0 = 0x0 B110 = 0x6e B115200 = 0x1c200 B1200 = 0x4b0 B134 = 0x86 B14400 = 0x3840 B150 = 0x96 B1800 = 0x708 B19200 = 0x4b00 B200 = 0xc8 B230400 = 0x38400 B2400 = 0x960 B28800 = 0x7080 B300 = 0x12c B38400 = 0x9600 B4800 = 0x12c0 B50 = 0x32 B57600 = 0xe100 B600 = 0x258 B7200 = 0x1c20 B75 = 0x4b B76800 = 0x12c00 B9600 = 0x2580 BIOCFLUSH = 0x20004268 BIOCGBLEN = 0x40044266 BIOCGDIRFILT = 0x4004427c BIOCGDLT = 0x4004426a BIOCGDLTLIST = 0xc010427b BIOCGETIF = 0x4020426b BIOCGFILDROP = 0x40044278 BIOCGHDRCMPLT = 0x40044274 BIOCGRSIG = 0x40044273 BIOCGRTIMEOUT = 0x4010426e BIOCGSTATS = 0x4008426f BIOCIMMEDIATE = 0x80044270 BIOCLOCK = 0x20004276 BIOCPROMISC = 0x20004269 BIOCSBLEN = 0xc0044266 BIOCSDIRFILT = 0x8004427d BIOCSDLT = 0x8004427a BIOCSETF = 0x80104267 BIOCSETIF = 0x8020426c BIOCSETWF = 0x80104277 BIOCSFILDROP = 0x80044279 BIOCSHDRCMPLT = 0x80044275 BIOCSRSIG = 0x80044272 BIOCSRTIMEOUT = 0x8010426d BIOCVERSION = 0x40044271 BPF_A = 0x10 BPF_ABS = 0x20 BPF_ADD = 0x0 BPF_ALIGNMENT = 0x4 BPF_ALU = 0x4 BPF_AND = 0x50 BPF_B = 0x10 BPF_DIRECTION_IN = 0x1 BPF_DIRECTION_OUT = 0x2 BPF_DIV = 0x30 BPF_FILDROP_CAPTURE = 0x1 BPF_FILDROP_DROP = 0x2 BPF_FILDROP_PASS = 0x0 BPF_F_DIR_IN = 0x10 BPF_F_DIR_MASK = 0x30 BPF_F_DIR_OUT = 0x20 BPF_F_DIR_SHIFT = 0x4 BPF_F_FLOWID = 0x8 BPF_F_PRI_MASK = 0x7 BPF_H = 0x8 BPF_IMM = 0x0 BPF_IND = 0x40 BPF_JA = 0x0 BPF_JEQ = 0x10 BPF_JGE = 0x30 BPF_JGT = 0x20 BPF_JMP = 0x5 BPF_JSET = 0x40 BPF_K = 0x0 BPF_LD = 0x0 BPF_LDX = 0x1 BPF_LEN = 0x80 BPF_LSH = 0x60 BPF_MAJOR_VERSION = 0x1 BPF_MAXBUFSIZE = 0x200000 BPF_MAXINSNS = 0x200 BPF_MEM = 0x60 BPF_MEMWORDS = 0x10 BPF_MINBUFSIZE = 0x20 BPF_MINOR_VERSION = 0x1 BPF_MISC = 0x7 BPF_MSH = 0xa0 BPF_MUL = 0x20 BPF_NEG = 0x80 BPF_OR = 0x40 BPF_RELEASE = 0x30bb6 BPF_RET = 0x6 BPF_RND = 0xc0 BPF_RSH = 0x70 BPF_ST = 0x2 BPF_STX = 0x3 BPF_SUB = 0x10 BPF_TAX = 0x0 BPF_TXA = 0x80 BPF_W = 0x0 BPF_X = 0x8 BRKINT = 0x2 CFLUSH = 0xf CLOCAL = 0x8000 CLOCK_BOOTTIME = 0x6 CLOCK_MONOTONIC = 0x3 CLOCK_PROCESS_CPUTIME_ID = 0x2 CLOCK_REALTIME = 0x0 CLOCK_THREAD_CPUTIME_ID = 0x4 CLOCK_UPTIME = 0x5 CPUSTATES = 0x6 CP_IDLE = 0x5 CP_INTR = 0x4 CP_NICE = 0x1 CP_SPIN = 0x3 CP_SYS = 0x2 CP_USER = 0x0 CREAD = 0x800 CRTSCTS = 0x10000 CS5 = 0x0 CS6 = 0x100 CS7 = 0x200 CS8 = 0x300 CSIZE = 0x300 CSTART = 0x11 CSTATUS = 0xff CSTOP = 0x13 CSTOPB = 0x400 CSUSP = 0x1a CTL_HW = 0x6 CTL_KERN = 0x1 CTL_MAXNAME = 0xc CTL_NET = 0x4 DIOCADDQUEUE = 0xc110445d DIOCADDRULE = 0xcd604404 DIOCADDSTATE = 0xc1084425 DIOCCHANGERULE = 0xcd60441a DIOCCLRIFFLAG = 0xc028445a DIOCCLRSRCNODES = 0x20004455 DIOCCLRSTATES = 0xc0e04412 DIOCCLRSTATUS = 0xc0284416 DIOCGETLIMIT = 0xc0084427 DIOCGETQSTATS = 0xc1204460 DIOCGETQUEUE = 0xc110445f DIOCGETQUEUES = 0xc110445e DIOCGETRULE = 0xcd604407 DIOCGETRULES = 0xcd604406 DIOCGETRULESET = 0xc444443b DIOCGETRULESETS = 0xc444443a DIOCGETSRCNODES = 0xc0104454 DIOCGETSTATE = 0xc1084413 DIOCGETSTATES = 0xc0104419 DIOCGETSTATUS = 0xc1e84415 DIOCGETSYNFLWATS = 0xc0084463 DIOCGETTIMEOUT = 0xc008441e DIOCIGETIFACES = 0xc0284457 DIOCKILLSRCNODES = 0xc080445b DIOCKILLSTATES = 0xc0e04429 DIOCNATLOOK = 0xc0504417 DIOCOSFPADD = 0xc088444f DIOCOSFPFLUSH = 0x2000444e DIOCOSFPGET = 0xc0884450 DIOCRADDADDRS = 0xc4504443 DIOCRADDTABLES = 0xc450443d DIOCRCLRADDRS = 0xc4504442 DIOCRCLRASTATS = 0xc4504448 DIOCRCLRTABLES = 0xc450443c DIOCRCLRTSTATS = 0xc4504441 DIOCRDELADDRS = 0xc4504444 DIOCRDELTABLES = 0xc450443e DIOCRGETADDRS = 0xc4504446 DIOCRGETASTATS = 0xc4504447 DIOCRGETTABLES = 0xc450443f DIOCRGETTSTATS = 0xc4504440 DIOCRINADEFINE = 0xc450444d DIOCRSETADDRS = 0xc4504445 DIOCRSETTFLAGS = 0xc450444a DIOCRTSTADDRS = 0xc4504449 DIOCSETDEBUG = 0xc0044418 DIOCSETHOSTID = 0xc0044456 DIOCSETIFFLAG = 0xc0284459 DIOCSETLIMIT = 0xc0084428 DIOCSETREASS = 0xc004445c DIOCSETSTATUSIF = 0xc0284414 DIOCSETSYNCOOKIES = 0xc0014462 DIOCSETSYNFLWATS = 0xc0084461 DIOCSETTIMEOUT = 0xc008441d DIOCSTART = 0x20004401 DIOCSTOP = 0x20004402 DIOCXBEGIN = 0xc0104451 DIOCXCOMMIT = 0xc0104452 DIOCXROLLBACK = 0xc0104453 DLT_ARCNET = 0x7 DLT_ATM_RFC1483 = 0xb DLT_AX25 = 0x3 DLT_CHAOS = 0x5 DLT_C_HDLC = 0x68 DLT_EN10MB = 0x1 DLT_EN3MB = 0x2 DLT_ENC = 0xd DLT_FDDI = 0xa DLT_IEEE802 = 0x6 DLT_IEEE802_11 = 0x69 DLT_IEEE802_11_RADIO = 0x7f DLT_LOOP = 0xc DLT_MPLS = 0xdb DLT_NULL = 0x0 DLT_OPENFLOW = 0x10b DLT_PFLOG = 0x75 DLT_PFSYNC = 0x12 DLT_PPP = 0x9 DLT_PPP_BSDOS = 0x10 DLT_PPP_ETHER = 0x33 DLT_PPP_SERIAL = 0x32 DLT_PRONET = 0x4 DLT_RAW = 0xe DLT_SLIP = 0x8 DLT_SLIP_BSDOS = 0xf DLT_USBPCAP = 0xf9 DLT_USER0 = 0x93 DLT_USER1 = 0x94 DLT_USER10 = 0x9d DLT_USER11 = 0x9e DLT_USER12 = 0x9f DLT_USER13 = 0xa0 DLT_USER14 = 0xa1 DLT_USER15 = 0xa2 DLT_USER2 = 0x95 DLT_USER3 = 0x96 DLT_USER4 = 0x97 DLT_USER5 = 0x98 DLT_USER6 = 0x99 DLT_USER7 = 0x9a DLT_USER8 = 0x9b DLT_USER9 = 0x9c DT_BLK = 0x6 DT_CHR = 0x2 DT_DIR = 0x4 DT_FIFO = 0x1 DT_LNK = 0xa DT_REG = 0x8 DT_SOCK = 0xc DT_UNKNOWN = 0x0 ECHO = 0x8 ECHOCTL = 0x40 ECHOE = 0x2 ECHOK = 0x4 ECHOKE = 0x1 ECHONL = 0x10 ECHOPRT = 0x20 EMT_TAGOVF = 0x1 EMUL_ENABLED = 0x1 EMUL_NATIVE = 0x2 ENDRUNDISC = 0x9 ETH64_8021_RSVD_MASK = 0xfffffffffff0 ETH64_8021_RSVD_PREFIX = 0x180c2000000 ETHERMIN = 0x2e ETHERMTU = 0x5dc ETHERTYPE_8023 = 0x4 ETHERTYPE_AARP = 0x80f3 ETHERTYPE_ACCTON = 0x8390 ETHERTYPE_AEONIC = 0x8036 ETHERTYPE_ALPHA = 0x814a ETHERTYPE_AMBER = 0x6008 ETHERTYPE_AMOEBA = 0x8145 ETHERTYPE_AOE = 0x88a2 ETHERTYPE_APOLLO = 0x80f7 ETHERTYPE_APOLLODOMAIN = 0x8019 ETHERTYPE_APPLETALK = 0x809b ETHERTYPE_APPLITEK = 0x80c7 ETHERTYPE_ARGONAUT = 0x803a ETHERTYPE_ARP = 0x806 ETHERTYPE_AT = 0x809b ETHERTYPE_ATALK = 0x809b ETHERTYPE_ATOMIC = 0x86df ETHERTYPE_ATT = 0x8069 ETHERTYPE_ATTSTANFORD = 0x8008 ETHERTYPE_AUTOPHON = 0x806a ETHERTYPE_AXIS = 0x8856 ETHERTYPE_BCLOOP = 0x9003 ETHERTYPE_BOFL = 0x8102 ETHERTYPE_CABLETRON = 0x7034 ETHERTYPE_CHAOS = 0x804 ETHERTYPE_COMDESIGN = 0x806c ETHERTYPE_COMPUGRAPHIC = 0x806d ETHERTYPE_COUNTERPOINT = 0x8062 ETHERTYPE_CRONUS = 0x8004 ETHERTYPE_CRONUSVLN = 0x8003 ETHERTYPE_DCA = 0x1234 ETHERTYPE_DDE = 0x807b ETHERTYPE_DEBNI = 0xaaaa ETHERTYPE_DECAM = 0x8048 ETHERTYPE_DECCUST = 0x6006 ETHERTYPE_DECDIAG = 0x6005 ETHERTYPE_DECDNS = 0x803c ETHERTYPE_DECDTS = 0x803e ETHERTYPE_DECEXPER = 0x6000 ETHERTYPE_DECLAST = 0x8041 ETHERTYPE_DECLTM = 0x803f ETHERTYPE_DECMUMPS = 0x6009 ETHERTYPE_DECNETBIOS = 0x8040 ETHERTYPE_DELTACON = 0x86de ETHERTYPE_DIDDLE = 0x4321 ETHERTYPE_DLOG1 = 0x660 ETHERTYPE_DLOG2 = 0x661 ETHERTYPE_DN = 0x6003 ETHERTYPE_DOGFIGHT = 0x1989 ETHERTYPE_DSMD = 0x8039 ETHERTYPE_EAPOL = 0x888e ETHERTYPE_ECMA = 0x803 ETHERTYPE_ENCRYPT = 0x803d ETHERTYPE_ES = 0x805d ETHERTYPE_EXCELAN = 0x8010 ETHERTYPE_EXPERDATA = 0x8049 ETHERTYPE_FLIP = 0x8146 ETHERTYPE_FLOWCONTROL = 0x8808 ETHERTYPE_FRARP = 0x808 ETHERTYPE_GENDYN = 0x8068 ETHERTYPE_HAYES = 0x8130 ETHERTYPE_HIPPI_FP = 0x8180 ETHERTYPE_HITACHI = 0x8820 ETHERTYPE_HP = 0x8005 ETHERTYPE_IEEEPUP = 0xa00 ETHERTYPE_IEEEPUPAT = 0xa01 ETHERTYPE_IMLBL = 0x4c42 ETHERTYPE_IMLBLDIAG = 0x424c ETHERTYPE_IP = 0x800 ETHERTYPE_IPAS = 0x876c ETHERTYPE_IPV6 = 0x86dd ETHERTYPE_IPX = 0x8137 ETHERTYPE_IPXNEW = 0x8037 ETHERTYPE_KALPANA = 0x8582 ETHERTYPE_LANBRIDGE = 0x8038 ETHERTYPE_LANPROBE = 0x8888 ETHERTYPE_LAT = 0x6004 ETHERTYPE_LBACK = 0x9000 ETHERTYPE_LITTLE = 0x8060 ETHERTYPE_LLDP = 0x88cc ETHERTYPE_LOGICRAFT = 0x8148 ETHERTYPE_LOOPBACK = 0x9000 ETHERTYPE_MACSEC = 0x88e5 ETHERTYPE_MATRA = 0x807a ETHERTYPE_MAX = 0xffff ETHERTYPE_MERIT = 0x807c ETHERTYPE_MICP = 0x873a ETHERTYPE_MOPDL = 0x6001 ETHERTYPE_MOPRC = 0x6002 ETHERTYPE_MOTOROLA = 0x818d ETHERTYPE_MPLS = 0x8847 ETHERTYPE_MPLS_MCAST = 0x8848 ETHERTYPE_MUMPS = 0x813f ETHERTYPE_NBPCC = 0x3c04 ETHERTYPE_NBPCLAIM = 0x3c09 ETHERTYPE_NBPCLREQ = 0x3c05 ETHERTYPE_NBPCLRSP = 0x3c06 ETHERTYPE_NBPCREQ = 0x3c02 ETHERTYPE_NBPCRSP = 0x3c03 ETHERTYPE_NBPDG = 0x3c07 ETHERTYPE_NBPDGB = 0x3c08 ETHERTYPE_NBPDLTE = 0x3c0a ETHERTYPE_NBPRAR = 0x3c0c ETHERTYPE_NBPRAS = 0x3c0b ETHERTYPE_NBPRST = 0x3c0d ETHERTYPE_NBPSCD = 0x3c01 ETHERTYPE_NBPVCD = 0x3c00 ETHERTYPE_NBS = 0x802 ETHERTYPE_NCD = 0x8149 ETHERTYPE_NESTAR = 0x8006 ETHERTYPE_NETBEUI = 0x8191 ETHERTYPE_NHRP = 0x2001 ETHERTYPE_NOVELL = 0x8138 ETHERTYPE_NS = 0x600 ETHERTYPE_NSAT = 0x601 ETHERTYPE_NSCOMPAT = 0x807 ETHERTYPE_NSH = 0x984f ETHERTYPE_NTRAILER = 0x10 ETHERTYPE_OS9 = 0x7007 ETHERTYPE_OS9NET = 0x7009 ETHERTYPE_PACER = 0x80c6 ETHERTYPE_PBB = 0x88e7 ETHERTYPE_PCS = 0x4242 ETHERTYPE_PLANNING = 0x8044 ETHERTYPE_PPP = 0x880b ETHERTYPE_PPPOE = 0x8864 ETHERTYPE_PPPOEDISC = 0x8863 ETHERTYPE_PRIMENTS = 0x7031 ETHERTYPE_PUP = 0x200 ETHERTYPE_PUPAT = 0x200 ETHERTYPE_QINQ = 0x88a8 ETHERTYPE_RACAL = 0x7030 ETHERTYPE_RATIONAL = 0x8150 ETHERTYPE_RAWFR = 0x6559 ETHERTYPE_RCL = 0x1995 ETHERTYPE_RDP = 0x8739 ETHERTYPE_RETIX = 0x80f2 ETHERTYPE_REVARP = 0x8035 ETHERTYPE_SCA = 0x6007 ETHERTYPE_SECTRA = 0x86db ETHERTYPE_SECUREDATA = 0x876d ETHERTYPE_SGITW = 0x817e ETHERTYPE_SG_BOUNCE = 0x8016 ETHERTYPE_SG_DIAG = 0x8013 ETHERTYPE_SG_NETGAMES = 0x8014 ETHERTYPE_SG_RESV = 0x8015 ETHERTYPE_SIMNET = 0x5208 ETHERTYPE_SLOW = 0x8809 ETHERTYPE_SNA = 0x80d5 ETHERTYPE_SNMP = 0x814c ETHERTYPE_SONIX = 0xfaf5 ETHERTYPE_SPIDER = 0x809f ETHERTYPE_SPRITE = 0x500 ETHERTYPE_STP = 0x8181 ETHERTYPE_TALARIS = 0x812b ETHERTYPE_TALARISMC = 0x852b ETHERTYPE_TCPCOMP = 0x876b ETHERTYPE_TCPSM = 0x9002 ETHERTYPE_TEC = 0x814f ETHERTYPE_TIGAN = 0x802f ETHERTYPE_TRAIL = 0x1000 ETHERTYPE_TRANSETHER = 0x6558 ETHERTYPE_TYMSHARE = 0x802e ETHERTYPE_UBBST = 0x7005 ETHERTYPE_UBDEBUG = 0x900 ETHERTYPE_UBDIAGLOOP = 0x7002 ETHERTYPE_UBDL = 0x7000 ETHERTYPE_UBNIU = 0x7001 ETHERTYPE_UBNMC = 0x7003 ETHERTYPE_VALID = 0x1600 ETHERTYPE_VARIAN = 0x80dd ETHERTYPE_VAXELN = 0x803b ETHERTYPE_VEECO = 0x8067 ETHERTYPE_VEXP = 0x805b ETHERTYPE_VGLAB = 0x8131 ETHERTYPE_VINES = 0xbad ETHERTYPE_VINESECHO = 0xbaf ETHERTYPE_VINESLOOP = 0xbae ETHERTYPE_VITAL = 0xff00 ETHERTYPE_VLAN = 0x8100 ETHERTYPE_VLTLMAN = 0x8080 ETHERTYPE_VPROD = 0x805c ETHERTYPE_VURESERVED = 0x8147 ETHERTYPE_WATERLOO = 0x8130 ETHERTYPE_WELLFLEET = 0x8103 ETHERTYPE_X25 = 0x805 ETHERTYPE_X75 = 0x801 ETHERTYPE_XNSSM = 0x9001 ETHERTYPE_XTP = 0x817d ETHER_ADDR_LEN = 0x6 ETHER_ALIGN = 0x2 ETHER_CRC_LEN = 0x4 ETHER_CRC_POLY_BE = 0x4c11db6 ETHER_CRC_POLY_LE = 0xedb88320 ETHER_HDR_LEN = 0xe ETHER_MAX_DIX_LEN = 0x600 ETHER_MAX_HARDMTU_LEN = 0xff9b ETHER_MAX_LEN = 0x5ee ETHER_MIN_LEN = 0x40 ETHER_TYPE_LEN = 0x2 ETHER_VLAN_ENCAP_LEN = 0x4 EVFILT_AIO = -0x3 EVFILT_DEVICE = -0x8 EVFILT_EXCEPT = -0x9 EVFILT_PROC = -0x5 EVFILT_READ = -0x1 EVFILT_SIGNAL = -0x6 EVFILT_SYSCOUNT = 0x9 EVFILT_TIMER = -0x7 EVFILT_VNODE = -0x4 EVFILT_WRITE = -0x2 EVL_ENCAPLEN = 0x4 EVL_PRIO_BITS = 0xd EVL_PRIO_MAX = 0x7 EVL_VLID_MASK = 0xfff EVL_VLID_MAX = 0xffe EVL_VLID_MIN = 0x1 EVL_VLID_NULL = 0x0 EV_ADD = 0x1 EV_CLEAR = 0x20 EV_DELETE = 0x2 EV_DISABLE = 0x8 EV_DISPATCH = 0x80 EV_ENABLE = 0x4 EV_EOF = 0x8000 EV_ERROR = 0x4000 EV_FLAG1 = 0x2000 EV_ONESHOT = 0x10 EV_RECEIPT = 0x40 EV_SYSFLAGS = 0xf800 EXTA = 0x4b00 EXTB = 0x9600 EXTPROC = 0x800 FD_CLOEXEC = 0x1 FD_SETSIZE = 0x400 FLUSHO = 0x800000 F_DUPFD = 0x0 F_DUPFD_CLOEXEC = 0xa F_GETFD = 0x1 F_GETFL = 0x3 F_GETLK = 0x7 F_GETOWN = 0x5 F_ISATTY = 0xb F_OK = 0x0 F_RDLCK = 0x1 F_SETFD = 0x2 F_SETFL = 0x4 F_SETLK = 0x8 F_SETLKW = 0x9 F_SETOWN = 0x6 F_UNLCK = 0x2 F_WRLCK = 0x3 HUPCL = 0x4000 HW_MACHINE = 0x1 ICANON = 0x100 ICMP6_FILTER = 0x12 ICRNL = 0x100 IEXTEN = 0x400 IFAN_ARRIVAL = 0x0 IFAN_DEPARTURE = 0x1 IFF_ALLMULTI = 0x200 IFF_BROADCAST = 0x2 IFF_CANTCHANGE = 0x8e52 IFF_DEBUG = 0x4 IFF_LINK0 = 0x1000 IFF_LINK1 = 0x2000 IFF_LINK2 = 0x4000 IFF_LOOPBACK = 0x8 IFF_MULTICAST = 0x8000 IFF_NOARP = 0x80 IFF_OACTIVE = 0x400 IFF_POINTOPOINT = 0x10 IFF_PROMISC = 0x100 IFF_RUNNING = 0x40 IFF_SIMPLEX = 0x800 IFF_STATICARP = 0x20 IFF_UP = 0x1 IFNAMSIZ = 0x10 IFT_1822 = 0x2 IFT_A12MPPSWITCH = 0x82 IFT_AAL2 = 0xbb IFT_AAL5 = 0x31 IFT_ADSL = 0x5e IFT_AFLANE8023 = 0x3b IFT_AFLANE8025 = 0x3c IFT_ARAP = 0x58 IFT_ARCNET = 0x23 IFT_ARCNETPLUS = 0x24 IFT_ASYNC = 0x54 IFT_ATM = 0x25 IFT_ATMDXI = 0x69 IFT_ATMFUNI = 0x6a IFT_ATMIMA = 0x6b IFT_ATMLOGICAL = 0x50 IFT_ATMRADIO = 0xbd IFT_ATMSUBINTERFACE = 0x86 IFT_ATMVCIENDPT = 0xc2 IFT_ATMVIRTUAL = 0x95 IFT_BGPPOLICYACCOUNTING = 0xa2 IFT_BLUETOOTH = 0xf8 IFT_BRIDGE = 0xd1 IFT_BSC = 0x53 IFT_CARP = 0xf7 IFT_CCTEMUL = 0x3d IFT_CEPT = 0x13 IFT_CES = 0x85 IFT_CHANNEL = 0x46 IFT_CNR = 0x55 IFT_COFFEE = 0x84 IFT_COMPOSITELINK = 0x9b IFT_DCN = 0x8d IFT_DIGITALPOWERLINE = 0x8a IFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba IFT_DLSW = 0x4a IFT_DOCSCABLEDOWNSTREAM = 0x80 IFT_DOCSCABLEMACLAYER = 0x7f IFT_DOCSCABLEUPSTREAM = 0x81 IFT_DOCSCABLEUPSTREAMCHANNEL = 0xcd IFT_DS0 = 0x51 IFT_DS0BUNDLE = 0x52 IFT_DS1FDL = 0xaa IFT_DS3 = 0x1e IFT_DTM = 0x8c IFT_DUMMY = 0xf1 IFT_DVBASILN = 0xac IFT_DVBASIOUT = 0xad IFT_DVBRCCDOWNSTREAM = 0x93 IFT_DVBRCCMACLAYER = 0x92 IFT_DVBRCCUPSTREAM = 0x94 IFT_ECONET = 0xce IFT_ENC = 0xf4 IFT_EON = 0x19 IFT_EPLRS = 0x57 IFT_ESCON = 0x49 IFT_ETHER = 0x6 IFT_FAITH = 0xf3 IFT_FAST = 0x7d IFT_FASTETHER = 0x3e IFT_FASTETHERFX = 0x45 IFT_FDDI = 0xf IFT_FIBRECHANNEL = 0x38 IFT_FRAMERELAYINTERCONNECT = 0x3a IFT_FRAMERELAYMPI = 0x5c IFT_FRDLCIENDPT = 0xc1 IFT_FRELAY = 0x20 IFT_FRELAYDCE = 0x2c IFT_FRF16MFRBUNDLE = 0xa3 IFT_FRFORWARD = 0x9e IFT_G703AT2MB = 0x43 IFT_G703AT64K = 0x42 IFT_GIF = 0xf0 IFT_GIGABITETHERNET = 0x75 IFT_GR303IDT = 0xb2 IFT_GR303RDT = 0xb1 IFT_H323GATEKEEPER = 0xa4 IFT_H323PROXY = 0xa5 IFT_HDH1822 = 0x3 IFT_HDLC = 0x76 IFT_HDSL2 = 0xa8 IFT_HIPERLAN2 = 0xb7 IFT_HIPPI = 0x2f IFT_HIPPIINTERFACE = 0x39 IFT_HOSTPAD = 0x5a IFT_HSSI = 0x2e IFT_HY = 0xe IFT_IBM370PARCHAN = 0x48 IFT_IDSL = 0x9a IFT_IEEE1394 = 0x90 IFT_IEEE80211 = 0x47 IFT_IEEE80212 = 0x37 IFT_IEEE8023ADLAG = 0xa1 IFT_IFGSN = 0x91 IFT_IMT = 0xbe IFT_INFINIBAND = 0xc7 IFT_INTERLEAVE = 0x7c IFT_IP = 0x7e IFT_IPFORWARD = 0x8e IFT_IPOVERATM = 0x72 IFT_IPOVERCDLC = 0x6d IFT_IPOVERCLAW = 0x6e IFT_IPSWITCH = 0x4e IFT_ISDN = 0x3f IFT_ISDNBASIC = 0x14 IFT_ISDNPRIMARY = 0x15 IFT_ISDNS = 0x4b IFT_ISDNU = 0x4c IFT_ISO88022LLC = 0x29 IFT_ISO88023 = 0x7 IFT_ISO88024 = 0x8 IFT_ISO88025 = 0x9 IFT_ISO88025CRFPINT = 0x62 IFT_ISO88025DTR = 0x56 IFT_ISO88025FIBER = 0x73 IFT_ISO88026 = 0xa IFT_ISUP = 0xb3 IFT_L2VLAN = 0x87 IFT_L3IPVLAN = 0x88 IFT_L3IPXVLAN = 0x89 IFT_LAPB = 0x10 IFT_LAPD = 0x4d IFT_LAPF = 0x77 IFT_LINEGROUP = 0xd2 IFT_LOCALTALK = 0x2a IFT_LOOP = 0x18 IFT_MBIM = 0xfa IFT_MEDIAMAILOVERIP = 0x8b IFT_MFSIGLINK = 0xa7 IFT_MIOX25 = 0x26 IFT_MODEM = 0x30 IFT_MPC = 0x71 IFT_MPLS = 0xa6 IFT_MPLSTUNNEL = 0x96 IFT_MSDSL = 0x8f IFT_MVL = 0xbf IFT_MYRINET = 0x63 IFT_NFAS = 0xaf IFT_NSIP = 0x1b IFT_OPTICALCHANNEL = 0xc3 IFT_OPTICALTRANSPORT = 0xc4 IFT_OTHER = 0x1 IFT_P10 = 0xc IFT_P80 = 0xd IFT_PARA = 0x22 IFT_PFLOG = 0xf5 IFT_PFLOW = 0xf9 IFT_PFSYNC = 0xf6 IFT_PLC = 0xae IFT_PON155 = 0xcf IFT_PON622 = 0xd0 IFT_POS = 0xab IFT_PPP = 0x17 IFT_PPPMULTILINKBUNDLE = 0x6c IFT_PROPATM = 0xc5 IFT_PROPBWAP2MP = 0xb8 IFT_PROPCNLS = 0x59 IFT_PROPDOCSWIRELESSDOWNSTREAM = 0xb5 IFT_PROPDOCSWIRELESSMACLAYER = 0xb4 IFT_PROPDOCSWIRELESSUPSTREAM = 0xb6 IFT_PROPMUX = 0x36 IFT_PROPVIRTUAL = 0x35 IFT_PROPWIRELESSP2P = 0x9d IFT_PTPSERIAL = 0x16 IFT_PVC = 0xf2 IFT_Q2931 = 0xc9 IFT_QLLC = 0x44 IFT_RADIOMAC = 0xbc IFT_RADSL = 0x5f IFT_REACHDSL = 0xc0 IFT_RFC1483 = 0x9f IFT_RS232 = 0x21 IFT_RSRB = 0x4f IFT_SDLC = 0x11 IFT_SDSL = 0x60 IFT_SHDSL = 0xa9 IFT_SIP = 0x1f IFT_SIPSIG = 0xcc IFT_SIPTG = 0xcb IFT_SLIP = 0x1c IFT_SMDSDXI = 0x2b IFT_SMDSICIP = 0x34 IFT_SONET = 0x27 IFT_SONETOVERHEADCHANNEL = 0xb9 IFT_SONETPATH = 0x32 IFT_SONETVT = 0x33 IFT_SRP = 0x97 IFT_SS7SIGLINK = 0x9c IFT_STACKTOSTACK = 0x6f IFT_STARLAN = 0xb IFT_T1 = 0x12 IFT_TDLC = 0x74 IFT_TELINK = 0xc8 IFT_TERMPAD = 0x5b IFT_TR008 = 0xb0 IFT_TRANSPHDLC = 0x7b IFT_TUNNEL = 0x83 IFT_ULTRA = 0x1d IFT_USB = 0xa0 IFT_V11 = 0x40 IFT_V35 = 0x2d IFT_V36 = 0x41 IFT_V37 = 0x78 IFT_VDSL = 0x61 IFT_VIRTUALIPADDRESS = 0x70 IFT_VIRTUALTG = 0xca IFT_VOICEDID = 0xd5 IFT_VOICEEM = 0x64 IFT_VOICEEMFGD = 0xd3 IFT_VOICEENCAP = 0x67 IFT_VOICEFGDEANA = 0xd4 IFT_VOICEFXO = 0x65 IFT_VOICEFXS = 0x66 IFT_VOICEOVERATM = 0x98 IFT_VOICEOVERCABLE = 0xc6 IFT_VOICEOVERFRAMERELAY = 0x99 IFT_VOICEOVERIP = 0x68 IFT_WIREGUARD = 0xfb IFT_X213 = 0x5d IFT_X25 = 0x5 IFT_X25DDN = 0x4 IFT_X25HUNTGROUP = 0x7a IFT_X25MLP = 0x79 IFT_X25PLE = 0x28 IFT_XETHER = 0x1a IGNBRK = 0x1 IGNCR = 0x80 IGNPAR = 0x4 IMAXBEL = 0x2000 INLCR = 0x40 INPCK = 0x10 IN_CLASSA_HOST = 0xffffff IN_CLASSA_MAX = 0x80 IN_CLASSA_NET = 0xff000000 IN_CLASSA_NSHIFT = 0x18 IN_CLASSB_HOST = 0xffff IN_CLASSB_MAX = 0x10000 IN_CLASSB_NET = 0xffff0000 IN_CLASSB_NSHIFT = 0x10 IN_CLASSC_HOST = 0xff IN_CLASSC_NET = 0xffffff00 IN_CLASSC_NSHIFT = 0x8 IN_CLASSD_HOST = 0xfffffff IN_CLASSD_NET = 0xf0000000 IN_CLASSD_NSHIFT = 0x1c IN_LOOPBACKNET = 0x7f IN_RFC3021_HOST = 0x1 IN_RFC3021_NET = 0xfffffffe IN_RFC3021_NSHIFT = 0x1f IPPROTO_AH = 0x33 IPPROTO_CARP = 0x70 IPPROTO_DIVERT = 0x102 IPPROTO_DONE = 0x101 IPPROTO_DSTOPTS = 0x3c IPPROTO_EGP = 0x8 IPPROTO_ENCAP = 0x62 IPPROTO_EON = 0x50 IPPROTO_ESP = 0x32 IPPROTO_ETHERIP = 0x61 IPPROTO_FRAGMENT = 0x2c IPPROTO_GGP = 0x3 IPPROTO_GRE = 0x2f IPPROTO_HOPOPTS = 0x0 IPPROTO_ICMP = 0x1 IPPROTO_ICMPV6 = 0x3a IPPROTO_IDP = 0x16 IPPROTO_IGMP = 0x2 IPPROTO_IP = 0x0 IPPROTO_IPCOMP = 0x6c IPPROTO_IPIP = 0x4 IPPROTO_IPV4 = 0x4 IPPROTO_IPV6 = 0x29 IPPROTO_MAX = 0x100 IPPROTO_MAXID = 0x103 IPPROTO_MOBILE = 0x37 IPPROTO_MPLS = 0x89 IPPROTO_NONE = 0x3b IPPROTO_PFSYNC = 0xf0 IPPROTO_PIM = 0x67 IPPROTO_PUP = 0xc IPPROTO_RAW = 0xff IPPROTO_ROUTING = 0x2b IPPROTO_RSVP = 0x2e IPPROTO_SCTP = 0x84 IPPROTO_TCP = 0x6 IPPROTO_TP = 0x1d IPPROTO_UDP = 0x11 IPPROTO_UDPLITE = 0x88 IPV6_AUTH_LEVEL = 0x35 IPV6_AUTOFLOWLABEL = 0x3b IPV6_CHECKSUM = 0x1a IPV6_DEFAULT_MULTICAST_HOPS = 0x1 IPV6_DEFAULT_MULTICAST_LOOP = 0x1 IPV6_DEFHLIM = 0x40 IPV6_DONTFRAG = 0x3e IPV6_DSTOPTS = 0x32 IPV6_ESP_NETWORK_LEVEL = 0x37 IPV6_ESP_TRANS_LEVEL = 0x36 IPV6_FAITH = 0x1d IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_MASK = 0xffff0f00 IPV6_FRAGTTL = 0x78 IPV6_HLIMDEC = 0x1 IPV6_HOPLIMIT = 0x2f IPV6_HOPOPTS = 0x31 IPV6_IPCOMP_LEVEL = 0x3c IPV6_JOIN_GROUP = 0xc IPV6_LEAVE_GROUP = 0xd IPV6_MAXHLIM = 0xff IPV6_MAXPACKET = 0xffff IPV6_MINHOPCOUNT = 0x41 IPV6_MMTU = 0x500 IPV6_MULTICAST_HOPS = 0xa IPV6_MULTICAST_IF = 0x9 IPV6_MULTICAST_LOOP = 0xb IPV6_NEXTHOP = 0x30 IPV6_OPTIONS = 0x1 IPV6_PATHMTU = 0x2c IPV6_PIPEX = 0x3f IPV6_PKTINFO = 0x2e IPV6_PORTRANGE = 0xe IPV6_PORTRANGE_DEFAULT = 0x0 IPV6_PORTRANGE_HIGH = 0x1 IPV6_PORTRANGE_LOW = 0x2 IPV6_RECVDSTOPTS = 0x28 IPV6_RECVDSTPORT = 0x40 IPV6_RECVHOPLIMIT = 0x25 IPV6_RECVHOPOPTS = 0x27 IPV6_RECVPATHMTU = 0x2b IPV6_RECVPKTINFO = 0x24 IPV6_RECVRTHDR = 0x26 IPV6_RECVTCLASS = 0x39 IPV6_RTABLE = 0x1021 IPV6_RTHDR = 0x33 IPV6_RTHDRDSTOPTS = 0x23 IPV6_RTHDR_LOOSE = 0x0 IPV6_RTHDR_STRICT = 0x1 IPV6_RTHDR_TYPE_0 = 0x0 IPV6_SOCKOPT_RESERVED1 = 0x3 IPV6_TCLASS = 0x3d IPV6_UNICAST_HOPS = 0x4 IPV6_USE_MIN_MTU = 0x2a IPV6_V6ONLY = 0x1b IPV6_VERSION = 0x60 IPV6_VERSION_MASK = 0xf0 IP_ADD_MEMBERSHIP = 0xc IP_AUTH_LEVEL = 0x14 IP_DEFAULT_MULTICAST_LOOP = 0x1 IP_DEFAULT_MULTICAST_TTL = 0x1 IP_DF = 0x4000 IP_DROP_MEMBERSHIP = 0xd IP_ESP_NETWORK_LEVEL = 0x16 IP_ESP_TRANS_LEVEL = 0x15 IP_HDRINCL = 0x2 IP_IPCOMP_LEVEL = 0x1d IP_IPDEFTTL = 0x25 IP_IPSECFLOWINFO = 0x24 IP_IPSEC_LOCAL_AUTH = 0x1b IP_IPSEC_LOCAL_CRED = 0x19 IP_IPSEC_LOCAL_ID = 0x17 IP_IPSEC_REMOTE_AUTH = 0x1c IP_IPSEC_REMOTE_CRED = 0x1a IP_IPSEC_REMOTE_ID = 0x18 IP_MAXPACKET = 0xffff IP_MAX_MEMBERSHIPS = 0xfff IP_MF = 0x2000 IP_MINTTL = 0x20 IP_MIN_MEMBERSHIPS = 0xf IP_MSS = 0x240 IP_MULTICAST_IF = 0x9 IP_MULTICAST_LOOP = 0xb IP_MULTICAST_TTL = 0xa IP_OFFMASK = 0x1fff IP_OPTIONS = 0x1 IP_PIPEX = 0x22 IP_PORTRANGE = 0x13 IP_PORTRANGE_DEFAULT = 0x0 IP_PORTRANGE_HIGH = 0x1 IP_PORTRANGE_LOW = 0x2 IP_RECVDSTADDR = 0x7 IP_RECVDSTPORT = 0x21 IP_RECVIF = 0x1e IP_RECVOPTS = 0x5 IP_RECVRETOPTS = 0x6 IP_RECVRTABLE = 0x23 IP_RECVTTL = 0x1f IP_RETOPTS = 0x8 IP_RF = 0x8000 IP_RTABLE = 0x1021 IP_SENDSRCADDR = 0x7 IP_TOS = 0x3 IP_TTL = 0x4 ISIG = 0x80 ISTRIP = 0x20 ITIMER_PROF = 0x2 ITIMER_REAL = 0x0 ITIMER_VIRTUAL = 0x1 IUCLC = 0x1000 IXANY = 0x800 IXOFF = 0x400 IXON = 0x200 KERN_HOSTNAME = 0xa KERN_OSRELEASE = 0x2 KERN_OSTYPE = 0x1 KERN_VERSION = 0x4 LCNT_OVERLOAD_FLUSH = 0x6 LOCK_EX = 0x2 LOCK_NB = 0x4 LOCK_SH = 0x1 LOCK_UN = 0x8 MADV_DONTNEED = 0x4 MADV_FREE = 0x6 MADV_NORMAL = 0x0 MADV_RANDOM = 0x1 MADV_SEQUENTIAL = 0x2 MADV_SPACEAVAIL = 0x5 MADV_WILLNEED = 0x3 MAP_ANON = 0x1000 MAP_ANONYMOUS = 0x1000 MAP_CONCEAL = 0x8000 MAP_COPY = 0x2 MAP_FILE = 0x0 MAP_FIXED = 0x10 MAP_FLAGMASK = 0xfff7 MAP_HASSEMAPHORE = 0x0 MAP_INHERIT = 0x0 MAP_INHERIT_COPY = 0x1 MAP_INHERIT_NONE = 0x2 MAP_INHERIT_SHARE = 0x0 MAP_INHERIT_ZERO = 0x3 MAP_NOEXTEND = 0x0 MAP_NORESERVE = 0x0 MAP_PRIVATE = 0x2 MAP_RENAME = 0x0 MAP_SHARED = 0x1 MAP_STACK = 0x4000 MAP_TRYFIXED = 0x0 MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MNT_ASYNC = 0x40 MNT_DEFEXPORTED = 0x200 MNT_DELEXPORT = 0x20000 MNT_DOOMED = 0x8000000 MNT_EXPORTANON = 0x400 MNT_EXPORTED = 0x100 MNT_EXRDONLY = 0x80 MNT_FORCE = 0x80000 MNT_LAZY = 0x3 MNT_LOCAL = 0x1000 MNT_NOATIME = 0x8000 MNT_NODEV = 0x10 MNT_NOEXEC = 0x4 MNT_NOPERM = 0x20 MNT_NOSUID = 0x8 MNT_NOWAIT = 0x2 MNT_QUOTA = 0x2000 MNT_RDONLY = 0x1 MNT_RELOAD = 0x40000 MNT_ROOTFS = 0x4000 MNT_SOFTDEP = 0x4000000 MNT_STALLED = 0x100000 MNT_SWAPPABLE = 0x200000 MNT_SYNCHRONOUS = 0x2 MNT_UPDATE = 0x10000 MNT_VISFLAGMASK = 0x400ffff MNT_WAIT = 0x1 MNT_WANTRDWR = 0x2000000 MNT_WXALLOWED = 0x800 MOUNT_AFS = "afs" MOUNT_CD9660 = "cd9660" MOUNT_EXT2FS = "ext2fs" MOUNT_FFS = "ffs" MOUNT_FUSEFS = "fuse" MOUNT_MFS = "mfs" MOUNT_MSDOS = "msdos" MOUNT_NCPFS = "ncpfs" MOUNT_NFS = "nfs" MOUNT_NTFS = "ntfs" MOUNT_TMPFS = "tmpfs" MOUNT_UDF = "udf" MOUNT_UFS = "ffs" MSG_BCAST = 0x100 MSG_CMSG_CLOEXEC = 0x800 MSG_CTRUNC = 0x20 MSG_DONTROUTE = 0x4 MSG_DONTWAIT = 0x80 MSG_EOR = 0x8 MSG_MCAST = 0x200 MSG_NOSIGNAL = 0x400 MSG_OOB = 0x1 MSG_PEEK = 0x2 MSG_TRUNC = 0x10 MSG_WAITALL = 0x40 MS_ASYNC = 0x1 MS_INVALIDATE = 0x4 MS_SYNC = 0x2 NAME_MAX = 0xff NET_RT_DUMP = 0x1 NET_RT_FLAGS = 0x2 NET_RT_IFLIST = 0x3 NET_RT_IFNAMES = 0x6 NET_RT_MAXID = 0x8 NET_RT_SOURCE = 0x7 NET_RT_STATS = 0x4 NET_RT_TABLE = 0x5 NFDBITS = 0x20 NOFLSH = 0x80000000 NOKERNINFO = 0x2000000 NOTE_ATTRIB = 0x8 NOTE_CHANGE = 0x1 NOTE_CHILD = 0x4 NOTE_DELETE = 0x1 NOTE_EOF = 0x2 NOTE_EXEC = 0x20000000 NOTE_EXIT = 0x80000000 NOTE_EXTEND = 0x4 NOTE_FORK = 0x40000000 NOTE_LINK = 0x10 NOTE_LOWAT = 0x1 NOTE_OOB = 0x4 NOTE_PCTRLMASK = 0xf0000000 NOTE_PDATAMASK = 0xfffff NOTE_RENAME = 0x20 NOTE_REVOKE = 0x40 NOTE_TRACK = 0x1 NOTE_TRACKERR = 0x2 NOTE_TRUNCATE = 0x80 NOTE_WRITE = 0x2 OCRNL = 0x10 OLCUC = 0x20 ONLCR = 0x2 ONLRET = 0x80 ONOCR = 0x40 ONOEOT = 0x8 OPOST = 0x1 OXTABS = 0x4 O_ACCMODE = 0x3 O_APPEND = 0x8 O_ASYNC = 0x40 O_CLOEXEC = 0x10000 O_CREAT = 0x200 O_DIRECTORY = 0x20000 O_DSYNC = 0x80 O_EXCL = 0x800 O_EXLOCK = 0x20 O_FSYNC = 0x80 O_NDELAY = 0x4 O_NOCTTY = 0x8000 O_NOFOLLOW = 0x100 O_NONBLOCK = 0x4 O_RDONLY = 0x0 O_RDWR = 0x2 O_RSYNC = 0x80 O_SHLOCK = 0x10 O_SYNC = 0x80 O_TRUNC = 0x400 O_WRONLY = 0x1 PARENB = 0x1000 PARMRK = 0x8 PARODD = 0x2000 PENDIN = 0x20000000 PF_FLUSH = 0x1 PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 PROT_EXEC = 0x4 PROT_NONE = 0x0 PROT_READ = 0x1 PROT_WRITE = 0x2 RLIMIT_CORE = 0x4 RLIMIT_CPU = 0x0 RLIMIT_DATA = 0x2 RLIMIT_FSIZE = 0x1 RLIMIT_MEMLOCK = 0x6 RLIMIT_NOFILE = 0x8 RLIMIT_NPROC = 0x7 RLIMIT_RSS = 0x5 RLIMIT_STACK = 0x3 RLIM_INFINITY = 0x7fffffffffffffff RTAX_AUTHOR = 0x6 RTAX_BFD = 0xb RTAX_BRD = 0x7 RTAX_DNS = 0xc RTAX_DST = 0x0 RTAX_GATEWAY = 0x1 RTAX_GENMASK = 0x3 RTAX_IFA = 0x5 RTAX_IFP = 0x4 RTAX_LABEL = 0xa RTAX_MAX = 0xf RTAX_NETMASK = 0x2 RTAX_SEARCH = 0xe RTAX_SRC = 0x8 RTAX_SRCMASK = 0x9 RTAX_STATIC = 0xd RTA_AUTHOR = 0x40 RTA_BFD = 0x800 RTA_BRD = 0x80 RTA_DNS = 0x1000 RTA_DST = 0x1 RTA_GATEWAY = 0x2 RTA_GENMASK = 0x8 RTA_IFA = 0x20 RTA_IFP = 0x10 RTA_LABEL = 0x400 RTA_NETMASK = 0x4 RTA_SEARCH = 0x4000 RTA_SRC = 0x100 RTA_SRCMASK = 0x200 RTA_STATIC = 0x2000 RTF_ANNOUNCE = 0x4000 RTF_BFD = 0x1000000 RTF_BLACKHOLE = 0x1000 RTF_BROADCAST = 0x400000 RTF_CACHED = 0x20000 RTF_CLONED = 0x10000 RTF_CLONING = 0x100 RTF_CONNECTED = 0x800000 RTF_DONE = 0x40 RTF_DYNAMIC = 0x10 RTF_FMASK = 0x110fc08 RTF_GATEWAY = 0x2 RTF_HOST = 0x4 RTF_LLINFO = 0x400 RTF_LOCAL = 0x200000 RTF_MODIFIED = 0x20 RTF_MPATH = 0x40000 RTF_MPLS = 0x100000 RTF_MULTICAST = 0x200 RTF_PERMANENT_ARP = 0x2000 RTF_PROTO1 = 0x8000 RTF_PROTO2 = 0x4000 RTF_PROTO3 = 0x2000 RTF_REJECT = 0x8 RTF_STATIC = 0x800 RTF_UP = 0x1 RTF_USETRAILERS = 0x8000 RTM_80211INFO = 0x15 RTM_ADD = 0x1 RTM_BFD = 0x12 RTM_CHANGE = 0x3 RTM_CHGADDRATTR = 0x14 RTM_DELADDR = 0xd RTM_DELETE = 0x2 RTM_DESYNC = 0x10 RTM_GET = 0x4 RTM_IFANNOUNCE = 0xf RTM_IFINFO = 0xe RTM_INVALIDATE = 0x11 RTM_LOSING = 0x5 RTM_MAXSIZE = 0x800 RTM_MISS = 0x7 RTM_NEWADDR = 0xc RTM_PROPOSAL = 0x13 RTM_REDIRECT = 0x6 RTM_RESOLVE = 0xb RTM_SOURCE = 0x16 RTM_VERSION = 0x5 RTV_EXPIRE = 0x4 RTV_HOPCOUNT = 0x2 RTV_MTU = 0x1 RTV_RPIPE = 0x8 RTV_RTT = 0x40 RTV_RTTVAR = 0x80 RTV_SPIPE = 0x10 RTV_SSTHRESH = 0x20 RT_TABLEID_BITS = 0x8 RT_TABLEID_MASK = 0xff RT_TABLEID_MAX = 0xff RUSAGE_CHILDREN = -0x1 RUSAGE_SELF = 0x0 RUSAGE_THREAD = 0x1 SCM_RIGHTS = 0x1 SCM_TIMESTAMP = 0x4 SEEK_CUR = 0x1 SEEK_END = 0x2 SEEK_SET = 0x0 SHUT_RD = 0x0 SHUT_RDWR = 0x2 SHUT_WR = 0x1 SIOCADDMULTI = 0x80206931 SIOCAIFADDR = 0x8040691a SIOCAIFGROUP = 0x80286987 SIOCATMARK = 0x40047307 SIOCBRDGADD = 0x8060693c SIOCBRDGADDL = 0x80606949 SIOCBRDGADDS = 0x80606941 SIOCBRDGARL = 0x808c694d SIOCBRDGDADDR = 0x81286947 SIOCBRDGDEL = 0x8060693d SIOCBRDGDELS = 0x80606942 SIOCBRDGFLUSH = 0x80606948 SIOCBRDGFRL = 0x808c694e SIOCBRDGGCACHE = 0xc0146941 SIOCBRDGGFD = 0xc0146952 SIOCBRDGGHT = 0xc0146951 SIOCBRDGGIFFLGS = 0xc060693e SIOCBRDGGMA = 0xc0146953 SIOCBRDGGPARAM = 0xc0406958 SIOCBRDGGPRI = 0xc0146950 SIOCBRDGGRL = 0xc030694f SIOCBRDGGTO = 0xc0146946 SIOCBRDGIFS = 0xc0606942 SIOCBRDGRTS = 0xc0206943 SIOCBRDGSADDR = 0xc1286944 SIOCBRDGSCACHE = 0x80146940 SIOCBRDGSFD = 0x80146952 SIOCBRDGSHT = 0x80146951 SIOCBRDGSIFCOST = 0x80606955 SIOCBRDGSIFFLGS = 0x8060693f SIOCBRDGSIFPRIO = 0x80606954 SIOCBRDGSIFPROT = 0x8060694a SIOCBRDGSMA = 0x80146953 SIOCBRDGSPRI = 0x80146950 SIOCBRDGSPROTO = 0x8014695a SIOCBRDGSTO = 0x80146945 SIOCBRDGSTXHC = 0x80146959 SIOCDELLABEL = 0x80206997 SIOCDELMULTI = 0x80206932 SIOCDIFADDR = 0x80206919 SIOCDIFGROUP = 0x80286989 SIOCDIFPARENT = 0x802069b4 SIOCDIFPHYADDR = 0x80206949 SIOCDPWE3NEIGHBOR = 0x802069de SIOCDVNETID = 0x802069af SIOCGETKALIVE = 0xc01869a4 SIOCGETLABEL = 0x8020699a SIOCGETMPWCFG = 0xc02069ae SIOCGETPFLOW = 0xc02069fe SIOCGETPFSYNC = 0xc02069f8 SIOCGETSGCNT = 0xc0207534 SIOCGETVIFCNT = 0xc0287533 SIOCGETVLAN = 0xc0206990 SIOCGIFADDR = 0xc0206921 SIOCGIFBRDADDR = 0xc0206923 SIOCGIFCONF = 0xc0106924 SIOCGIFDATA = 0xc020691b SIOCGIFDESCR = 0xc0206981 SIOCGIFDSTADDR = 0xc0206922 SIOCGIFFLAGS = 0xc0206911 SIOCGIFGATTR = 0xc028698b SIOCGIFGENERIC = 0xc020693a SIOCGIFGLIST = 0xc028698d SIOCGIFGMEMB = 0xc028698a SIOCGIFGROUP = 0xc0286988 SIOCGIFHARDMTU = 0xc02069a5 SIOCGIFLLPRIO = 0xc02069b6 SIOCGIFMEDIA = 0xc0406938 SIOCGIFMETRIC = 0xc0206917 SIOCGIFMTU = 0xc020697e SIOCGIFNETMASK = 0xc0206925 SIOCGIFPAIR = 0xc02069b1 SIOCGIFPARENT = 0xc02069b3 SIOCGIFPRIORITY = 0xc020699c SIOCGIFRDOMAIN = 0xc02069a0 SIOCGIFRTLABEL = 0xc0206983 SIOCGIFRXR = 0x802069aa SIOCGIFSFFPAGE = 0xc1126939 SIOCGIFXFLAGS = 0xc020699e SIOCGLIFPHYADDR = 0xc218694b SIOCGLIFPHYDF = 0xc02069c2 SIOCGLIFPHYECN = 0xc02069c8 SIOCGLIFPHYRTABLE = 0xc02069a2 SIOCGLIFPHYTTL = 0xc02069a9 SIOCGPGRP = 0x40047309 SIOCGPWE3 = 0xc0206998 SIOCGPWE3CTRLWORD = 0xc02069dc SIOCGPWE3FAT = 0xc02069dd SIOCGPWE3NEIGHBOR = 0xc21869de SIOCGRXHPRIO = 0xc02069db SIOCGSPPPPARAMS = 0xc0206994 SIOCGTXHPRIO = 0xc02069c6 SIOCGUMBINFO = 0xc02069be SIOCGUMBPARAM = 0xc02069c0 SIOCGVH = 0xc02069f6 SIOCGVNETFLOWID = 0xc02069c4 SIOCGVNETID = 0xc02069a7 SIOCIFAFATTACH = 0x801169ab SIOCIFAFDETACH = 0x801169ac SIOCIFCREATE = 0x8020697a SIOCIFDESTROY = 0x80206979 SIOCIFGCLONERS = 0xc0106978 SIOCSETKALIVE = 0x801869a3 SIOCSETLABEL = 0x80206999 SIOCSETMPWCFG = 0x802069ad SIOCSETPFLOW = 0x802069fd SIOCSETPFSYNC = 0x802069f7 SIOCSETVLAN = 0x8020698f SIOCSIFADDR = 0x8020690c SIOCSIFBRDADDR = 0x80206913 SIOCSIFDESCR = 0x80206980 SIOCSIFDSTADDR = 0x8020690e SIOCSIFFLAGS = 0x80206910 SIOCSIFGATTR = 0x8028698c SIOCSIFGENERIC = 0x80206939 SIOCSIFLLADDR = 0x8020691f SIOCSIFLLPRIO = 0x802069b5 SIOCSIFMEDIA = 0xc0206937 SIOCSIFMETRIC = 0x80206918 SIOCSIFMTU = 0x8020697f SIOCSIFNETMASK = 0x80206916 SIOCSIFPAIR = 0x802069b0 SIOCSIFPARENT = 0x802069b2 SIOCSIFPRIORITY = 0x8020699b SIOCSIFRDOMAIN = 0x8020699f SIOCSIFRTLABEL = 0x80206982 SIOCSIFXFLAGS = 0x8020699d SIOCSLIFPHYADDR = 0x8218694a SIOCSLIFPHYDF = 0x802069c1 SIOCSLIFPHYECN = 0x802069c7 SIOCSLIFPHYRTABLE = 0x802069a1 SIOCSLIFPHYTTL = 0x802069a8 SIOCSPGRP = 0x80047308 SIOCSPWE3CTRLWORD = 0x802069dc SIOCSPWE3FAT = 0x802069dd SIOCSPWE3NEIGHBOR = 0x821869de SIOCSRXHPRIO = 0x802069db SIOCSSPPPPARAMS = 0x80206993 SIOCSTXHPRIO = 0x802069c5 SIOCSUMBPARAM = 0x802069bf SIOCSVH = 0xc02069f5 SIOCSVNETFLOWID = 0x802069c3 SIOCSVNETID = 0x802069a6 SOCK_CLOEXEC = 0x8000 SOCK_DGRAM = 0x2 SOCK_DNS = 0x1000 SOCK_NONBLOCK = 0x4000 SOCK_RAW = 0x3 SOCK_RDM = 0x4 SOCK_SEQPACKET = 0x5 SOCK_STREAM = 0x1 SOL_SOCKET = 0xffff SOMAXCONN = 0x80 SO_ACCEPTCONN = 0x2 SO_BINDANY = 0x1000 SO_BROADCAST = 0x20 SO_DEBUG = 0x1 SO_DOMAIN = 0x1024 SO_DONTROUTE = 0x10 SO_ERROR = 0x1007 SO_KEEPALIVE = 0x8 SO_LINGER = 0x80 SO_NETPROC = 0x1020 SO_OOBINLINE = 0x100 SO_PEERCRED = 0x1022 SO_PROTOCOL = 0x1025 SO_RCVBUF = 0x1002 SO_RCVLOWAT = 0x1004 SO_RCVTIMEO = 0x1006 SO_REUSEADDR = 0x4 SO_REUSEPORT = 0x200 SO_RTABLE = 0x1021 SO_SNDBUF = 0x1001 SO_SNDLOWAT = 0x1003 SO_SNDTIMEO = 0x1005 SO_SPLICE = 0x1023 SO_TIMESTAMP = 0x800 SO_TYPE = 0x1008 SO_USELOOPBACK = 0x40 SO_ZEROIZE = 0x2000 S_BLKSIZE = 0x200 S_IEXEC = 0x40 S_IFBLK = 0x6000 S_IFCHR = 0x2000 S_IFDIR = 0x4000 S_IFIFO = 0x1000 S_IFLNK = 0xa000 S_IFMT = 0xf000 S_IFREG = 0x8000 S_IFSOCK = 0xc000 S_IREAD = 0x100 S_IRGRP = 0x20 S_IROTH = 0x4 S_IRUSR = 0x100 S_IRWXG = 0x38 S_IRWXO = 0x7 S_IRWXU = 0x1c0 S_ISGID = 0x400 S_ISTXT = 0x200 S_ISUID = 0x800 S_ISVTX = 0x200 S_IWGRP = 0x10 S_IWOTH = 0x2 S_IWRITE = 0x80 S_IWUSR = 0x80 S_IXGRP = 0x8 S_IXOTH = 0x1 S_IXUSR = 0x40 TCIFLUSH = 0x1 TCIOFF = 0x3 TCIOFLUSH = 0x3 TCION = 0x4 TCOFLUSH = 0x2 TCOOFF = 0x1 TCOON = 0x2 TCPOPT_EOL = 0x0 TCPOPT_MAXSEG = 0x2 TCPOPT_NOP = 0x1 TCPOPT_SACK = 0x5 TCPOPT_SACK_HDR = 0x1010500 TCPOPT_SACK_PERMITTED = 0x4 TCPOPT_SACK_PERMIT_HDR = 0x1010402 TCPOPT_SIGNATURE = 0x13 TCPOPT_TIMESTAMP = 0x8 TCPOPT_TSTAMP_HDR = 0x101080a TCPOPT_WINDOW = 0x3 TCP_INFO = 0x9 TCP_MAXSEG = 0x2 TCP_MAXWIN = 0xffff TCP_MAX_SACK = 0x3 TCP_MAX_WINSHIFT = 0xe TCP_MD5SIG = 0x4 TCP_MSS = 0x200 TCP_NODELAY = 0x1 TCP_NOPUSH = 0x10 TCP_SACKHOLE_LIMIT = 0x80 TCP_SACK_ENABLE = 0x8 TCSAFLUSH = 0x2 TIMER_ABSTIME = 0x1 TIMER_RELTIME = 0x0 TIOCCBRK = 0x2000747a TIOCCDTR = 0x20007478 TIOCCHKVERAUTH = 0x2000741e TIOCCLRVERAUTH = 0x2000741d TIOCCONS = 0x80047462 TIOCDRAIN = 0x2000745e TIOCEXCL = 0x2000740d TIOCEXT = 0x80047460 TIOCFLAG_CLOCAL = 0x2 TIOCFLAG_CRTSCTS = 0x4 TIOCFLAG_MDMBUF = 0x8 TIOCFLAG_PPS = 0x10 TIOCFLAG_SOFTCAR = 0x1 TIOCFLUSH = 0x80047410 TIOCGETA = 0x402c7413 TIOCGETD = 0x4004741a TIOCGFLAGS = 0x4004745d TIOCGPGRP = 0x40047477 TIOCGSID = 0x40047463 TIOCGTSTAMP = 0x4010745b TIOCGWINSZ = 0x40087468 TIOCMBIC = 0x8004746b TIOCMBIS = 0x8004746c TIOCMGET = 0x4004746a TIOCMODG = 0x4004746a TIOCMODS = 0x8004746d TIOCMSET = 0x8004746d TIOCM_CAR = 0x40 TIOCM_CD = 0x40 TIOCM_CTS = 0x20 TIOCM_DSR = 0x100 TIOCM_DTR = 0x2 TIOCM_LE = 0x1 TIOCM_RI = 0x80 TIOCM_RNG = 0x80 TIOCM_RTS = 0x4 TIOCM_SR = 0x10 TIOCM_ST = 0x8 TIOCNOTTY = 0x20007471 TIOCNXCL = 0x2000740e TIOCOUTQ = 0x40047473 TIOCPKT = 0x80047470 TIOCPKT_DATA = 0x0 TIOCPKT_DOSTOP = 0x20 TIOCPKT_FLUSHREAD = 0x1 TIOCPKT_FLUSHWRITE = 0x2 TIOCPKT_IOCTL = 0x40 TIOCPKT_NOSTOP = 0x10 TIOCPKT_START = 0x8 TIOCPKT_STOP = 0x4 TIOCREMOTE = 0x80047469 TIOCSBRK = 0x2000747b TIOCSCTTY = 0x20007461 TIOCSDTR = 0x20007479 TIOCSETA = 0x802c7414 TIOCSETAF = 0x802c7416 TIOCSETAW = 0x802c7415 TIOCSETD = 0x8004741b TIOCSETVERAUTH = 0x8004741c TIOCSFLAGS = 0x8004745c TIOCSIG = 0x8004745f TIOCSPGRP = 0x80047476 TIOCSTART = 0x2000746e TIOCSTAT = 0x20007465 TIOCSTOP = 0x2000746f TIOCSTSTAMP = 0x8008745a TIOCSWINSZ = 0x80087467 TIOCUCNTL = 0x80047466 TIOCUCNTL_CBRK = 0x7a TIOCUCNTL_SBRK = 0x7b TOSTOP = 0x400000 UTIME_NOW = -0x2 UTIME_OMIT = -0x1 VDISCARD = 0xf VDSUSP = 0xb VEOF = 0x0 VEOL = 0x1 VEOL2 = 0x2 VERASE = 0x3 VINTR = 0x8 VKILL = 0x5 VLNEXT = 0xe VMIN = 0x10 VM_ANONMIN = 0x7 VM_LOADAVG = 0x2 VM_MALLOC_CONF = 0xc VM_MAXID = 0xd VM_MAXSLP = 0xa VM_METER = 0x1 VM_NKMEMPAGES = 0x6 VM_PSSTRINGS = 0x3 VM_SWAPENCRYPT = 0x5 VM_USPACE = 0xb VM_UVMEXP = 0x4 VM_VNODEMIN = 0x9 VM_VTEXTMIN = 0x8 VQUIT = 0x9 VREPRINT = 0x6 VSTART = 0xc VSTATUS = 0x12 VSTOP = 0xd VSUSP = 0xa VTIME = 0x11 VWERASE = 0x4 WALTSIG = 0x4 WCONTINUED = 0x8 WCOREFLAG = 0x80 WNOHANG = 0x1 WUNTRACED = 0x2 XCASE = 0x1000000 ) // Errors const ( E2BIG = syscall.Errno(0x7) EACCES = syscall.Errno(0xd) EADDRINUSE = syscall.Errno(0x30) EADDRNOTAVAIL = syscall.Errno(0x31) EAFNOSUPPORT = syscall.Errno(0x2f) EAGAIN = syscall.Errno(0x23) EALREADY = syscall.Errno(0x25) EAUTH = syscall.Errno(0x50) EBADF = syscall.Errno(0x9) EBADMSG = syscall.Errno(0x5c) EBADRPC = syscall.Errno(0x48) EBUSY = syscall.Errno(0x10) ECANCELED = syscall.Errno(0x58) ECHILD = syscall.Errno(0xa) ECONNABORTED = syscall.Errno(0x35) ECONNREFUSED = syscall.Errno(0x3d) ECONNRESET = syscall.Errno(0x36) EDEADLK = syscall.Errno(0xb) EDESTADDRREQ = syscall.Errno(0x27) EDOM = syscall.Errno(0x21) EDQUOT = syscall.Errno(0x45) EEXIST = syscall.Errno(0x11) EFAULT = syscall.Errno(0xe) EFBIG = syscall.Errno(0x1b) EFTYPE = syscall.Errno(0x4f) EHOSTDOWN = syscall.Errno(0x40) EHOSTUNREACH = syscall.Errno(0x41) EIDRM = syscall.Errno(0x59) EILSEQ = syscall.Errno(0x54) EINPROGRESS = syscall.Errno(0x24) EINTR = syscall.Errno(0x4) EINVAL = syscall.Errno(0x16) EIO = syscall.Errno(0x5) EIPSEC = syscall.Errno(0x52) EISCONN = syscall.Errno(0x38) EISDIR = syscall.Errno(0x15) ELAST = syscall.Errno(0x5f) ELOOP = syscall.Errno(0x3e) EMEDIUMTYPE = syscall.Errno(0x56) EMFILE = syscall.Errno(0x18) EMLINK = syscall.Errno(0x1f) EMSGSIZE = syscall.Errno(0x28) ENAMETOOLONG = syscall.Errno(0x3f) ENEEDAUTH = syscall.Errno(0x51) ENETDOWN = syscall.Errno(0x32) ENETRESET = syscall.Errno(0x34) ENETUNREACH = syscall.Errno(0x33) ENFILE = syscall.Errno(0x17) ENOATTR = syscall.Errno(0x53) ENOBUFS = syscall.Errno(0x37) ENODEV = syscall.Errno(0x13) ENOENT = syscall.Errno(0x2) ENOEXEC = syscall.Errno(0x8) ENOLCK = syscall.Errno(0x4d) ENOMEDIUM = syscall.Errno(0x55) ENOMEM = syscall.Errno(0xc) ENOMSG = syscall.Errno(0x5a) ENOPROTOOPT = syscall.Errno(0x2a) ENOSPC = syscall.Errno(0x1c) ENOSYS = syscall.Errno(0x4e) ENOTBLK = syscall.Errno(0xf) ENOTCONN = syscall.Errno(0x39) ENOTDIR = syscall.Errno(0x14) ENOTEMPTY = syscall.Errno(0x42) ENOTRECOVERABLE = syscall.Errno(0x5d) ENOTSOCK = syscall.Errno(0x26) ENOTSUP = syscall.Errno(0x5b) ENOTTY = syscall.Errno(0x19) ENXIO = syscall.Errno(0x6) EOPNOTSUPP = syscall.Errno(0x2d) EOVERFLOW = syscall.Errno(0x57) EOWNERDEAD = syscall.Errno(0x5e) EPERM = syscall.Errno(0x1) EPFNOSUPPORT = syscall.Errno(0x2e) EPIPE = syscall.Errno(0x20) EPROCLIM = syscall.Errno(0x43) EPROCUNAVAIL = syscall.Errno(0x4c) EPROGMISMATCH = syscall.Errno(0x4b) EPROGUNAVAIL = syscall.Errno(0x4a) EPROTO = syscall.Errno(0x5f) EPROTONOSUPPORT = syscall.Errno(0x2b) EPROTOTYPE = syscall.Errno(0x29) ERANGE = syscall.Errno(0x22) EREMOTE = syscall.Errno(0x47) EROFS = syscall.Errno(0x1e) ERPCMISMATCH = syscall.Errno(0x49) ESHUTDOWN = syscall.Errno(0x3a) ESOCKTNOSUPPORT = syscall.Errno(0x2c) ESPIPE = syscall.Errno(0x1d) ESRCH = syscall.Errno(0x3) ESTALE = syscall.Errno(0x46) ETIMEDOUT = syscall.Errno(0x3c) ETOOMANYREFS = syscall.Errno(0x3b) ETXTBSY = syscall.Errno(0x1a) EUSERS = syscall.Errno(0x44) EWOULDBLOCK = syscall.Errno(0x23) EXDEV = syscall.Errno(0x12) ) // Signals const ( SIGABRT = syscall.Signal(0x6) SIGALRM = syscall.Signal(0xe) SIGBUS = syscall.Signal(0xa) SIGCHLD = syscall.Signal(0x14) SIGCONT = syscall.Signal(0x13) SIGEMT = syscall.Signal(0x7) SIGFPE = syscall.Signal(0x8) SIGHUP = syscall.Signal(0x1) SIGILL = syscall.Signal(0x4) SIGINFO = syscall.Signal(0x1d) SIGINT = syscall.Signal(0x2) SIGIO = syscall.Signal(0x17) SIGIOT = syscall.Signal(0x6) SIGKILL = syscall.Signal(0x9) SIGPIPE = syscall.Signal(0xd) SIGPROF = syscall.Signal(0x1b) SIGQUIT = syscall.Signal(0x3) SIGSEGV = syscall.Signal(0xb) SIGSTOP = syscall.Signal(0x11) SIGSYS = syscall.Signal(0xc) SIGTERM = syscall.Signal(0xf) SIGTHR = syscall.Signal(0x20) SIGTRAP = syscall.Signal(0x5) SIGTSTP = syscall.Signal(0x12) SIGTTIN = syscall.Signal(0x15) SIGTTOU = syscall.Signal(0x16) SIGURG = syscall.Signal(0x10) SIGUSR1 = syscall.Signal(0x1e) SIGUSR2 = syscall.Signal(0x1f) SIGVTALRM = syscall.Signal(0x1a) SIGWINCH = syscall.Signal(0x1c) SIGXCPU = syscall.Signal(0x18) SIGXFSZ = syscall.Signal(0x19) ) // Error table var errorList = [...]struct { num syscall.Errno name string desc string }{ {1, "EPERM", "operation not permitted"}, {2, "ENOENT", "no such file or directory"}, {3, "ESRCH", "no such process"}, {4, "EINTR", "interrupted system call"}, {5, "EIO", "input/output error"}, {6, "ENXIO", "device not configured"}, {7, "E2BIG", "argument list too long"}, {8, "ENOEXEC", "exec format error"}, {9, "EBADF", "bad file descriptor"}, {10, "ECHILD", "no child processes"}, {11, "EDEADLK", "resource deadlock avoided"}, {12, "ENOMEM", "cannot allocate memory"}, {13, "EACCES", "permission denied"}, {14, "EFAULT", "bad address"}, {15, "ENOTBLK", "block device required"}, {16, "EBUSY", "device busy"}, {17, "EEXIST", "file exists"}, {18, "EXDEV", "cross-device link"}, {19, "ENODEV", "operation not supported by device"}, {20, "ENOTDIR", "not a directory"}, {21, "EISDIR", "is a directory"}, {22, "EINVAL", "invalid argument"}, {23, "ENFILE", "too many open files in system"}, {24, "EMFILE", "too many open files"}, {25, "ENOTTY", "inappropriate ioctl for device"}, {26, "ETXTBSY", "text file busy"}, {27, "EFBIG", "file too large"}, {28, "ENOSPC", "no space left on device"}, {29, "ESPIPE", "illegal seek"}, {30, "EROFS", "read-only file system"}, {31, "EMLINK", "too many links"}, {32, "EPIPE", "broken pipe"}, {33, "EDOM", "numerical argument out of domain"}, {34, "ERANGE", "result too large"}, {35, "EAGAIN", "resource temporarily unavailable"}, {36, "EINPROGRESS", "operation now in progress"}, {37, "EALREADY", "operation already in progress"}, {38, "ENOTSOCK", "socket operation on non-socket"}, {39, "EDESTADDRREQ", "destination address required"}, {40, "EMSGSIZE", "message too long"}, {41, "EPROTOTYPE", "protocol wrong type for socket"}, {42, "ENOPROTOOPT", "protocol not available"}, {43, "EPROTONOSUPPORT", "protocol not supported"}, {44, "ESOCKTNOSUPPORT", "socket type not supported"}, {45, "EOPNOTSUPP", "operation not supported"}, {46, "EPFNOSUPPORT", "protocol family not supported"}, {47, "EAFNOSUPPORT", "address family not supported by protocol family"}, {48, "EADDRINUSE", "address already in use"}, {49, "EADDRNOTAVAIL", "can't assign requested address"}, {50, "ENETDOWN", "network is down"}, {51, "ENETUNREACH", "network is unreachable"}, {52, "ENETRESET", "network dropped connection on reset"}, {53, "ECONNABORTED", "software caused connection abort"}, {54, "ECONNRESET", "connection reset by peer"}, {55, "ENOBUFS", "no buffer space available"}, {56, "EISCONN", "socket is already connected"}, {57, "ENOTCONN", "socket is not connected"}, {58, "ESHUTDOWN", "can't send after socket shutdown"}, {59, "ETOOMANYREFS", "too many references: can't splice"}, {60, "ETIMEDOUT", "operation timed out"}, {61, "ECONNREFUSED", "connection refused"}, {62, "ELOOP", "too many levels of symbolic links"}, {63, "ENAMETOOLONG", "file name too long"}, {64, "EHOSTDOWN", "host is down"}, {65, "EHOSTUNREACH", "no route to host"}, {66, "ENOTEMPTY", "directory not empty"}, {67, "EPROCLIM", "too many processes"}, {68, "EUSERS", "too many users"}, {69, "EDQUOT", "disk quota exceeded"}, {70, "ESTALE", "stale NFS file handle"}, {71, "EREMOTE", "too many levels of remote in path"}, {72, "EBADRPC", "RPC struct is bad"}, {73, "ERPCMISMATCH", "RPC version wrong"}, {74, "EPROGUNAVAIL", "RPC program not available"}, {75, "EPROGMISMATCH", "program version wrong"}, {76, "EPROCUNAVAIL", "bad procedure for program"}, {77, "ENOLCK", "no locks available"}, {78, "ENOSYS", "function not implemented"}, {79, "EFTYPE", "inappropriate file type or format"}, {80, "EAUTH", "authentication error"}, {81, "ENEEDAUTH", "need authenticator"}, {82, "EIPSEC", "IPsec processing failure"}, {83, "ENOATTR", "attribute not found"}, {84, "EILSEQ", "illegal byte sequence"}, {85, "ENOMEDIUM", "no medium found"}, {86, "EMEDIUMTYPE", "wrong medium type"}, {87, "EOVERFLOW", "value too large to be stored in data type"}, {88, "ECANCELED", "operation canceled"}, {89, "EIDRM", "identifier removed"}, {90, "ENOMSG", "no message of desired type"}, {91, "ENOTSUP", "not supported"}, {92, "EBADMSG", "bad message"}, {93, "ENOTRECOVERABLE", "state not recoverable"}, {94, "EOWNERDEAD", "previous owner died"}, {95, "ELAST", "protocol error"}, } // Signal table var signalList = [...]struct { num syscall.Signal name string desc string }{ {1, "SIGHUP", "hangup"}, {2, "SIGINT", "interrupt"}, {3, "SIGQUIT", "quit"}, {4, "SIGILL", "illegal instruction"}, {5, "SIGTRAP", "trace/BPT trap"}, {6, "SIGABRT", "abort trap"}, {7, "SIGEMT", "EMT trap"}, {8, "SIGFPE", "floating point exception"}, {9, "SIGKILL", "killed"}, {10, "SIGBUS", "bus error"}, {11, "SIGSEGV", "segmentation fault"}, {12, "SIGSYS", "bad system call"}, {13, "SIGPIPE", "broken pipe"}, {14, "SIGALRM", "alarm clock"}, {15, "SIGTERM", "terminated"}, {16, "SIGURG", "urgent I/O condition"}, {17, "SIGSTOP", "suspended (signal)"}, {18, "SIGTSTP", "suspended"}, {19, "SIGCONT", "continued"}, {20, "SIGCHLD", "child exited"}, {21, "SIGTTIN", "stopped (tty input)"}, {22, "SIGTTOU", "stopped (tty output)"}, {23, "SIGIO", "I/O possible"}, {24, "SIGXCPU", "cputime limit exceeded"}, {25, "SIGXFSZ", "filesize limit exceeded"}, {26, "SIGVTALRM", "virtual timer expired"}, {27, "SIGPROF", "profiling timer expired"}, {28, "SIGWINCH", "window size changes"}, {29, "SIGINFO", "information request"}, {30, "SIGUSR1", "user defined signal 1"}, {31, "SIGUSR2", "user defined signal 2"}, {32, "SIGTHR", "thread AST"}, } ================================================ FILE: vendor/golang.org/x/sys/unix/zerrors_solaris_amd64.go ================================================ // mkerrors.sh -m64 // Code generated by the command above; see README.md. DO NOT EDIT. //go:build amd64 && solaris // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -m64 _const.go package unix import "syscall" const ( AF_802 = 0x12 AF_APPLETALK = 0x10 AF_CCITT = 0xa AF_CHAOS = 0x5 AF_DATAKIT = 0x9 AF_DECnet = 0xc AF_DLI = 0xd AF_ECMA = 0x8 AF_FILE = 0x1 AF_GOSIP = 0x16 AF_HYLINK = 0xf AF_IMPLINK = 0x3 AF_INET = 0x2 AF_INET6 = 0x1a AF_INET_OFFLOAD = 0x1e AF_IPX = 0x17 AF_KEY = 0x1b AF_LAT = 0xe AF_LINK = 0x19 AF_LOCAL = 0x1 AF_MAX = 0x20 AF_NBS = 0x7 AF_NCA = 0x1c AF_NIT = 0x11 AF_NS = 0x6 AF_OSI = 0x13 AF_OSINET = 0x15 AF_PACKET = 0x20 AF_POLICY = 0x1d AF_PUP = 0x4 AF_ROUTE = 0x18 AF_SNA = 0xb AF_TRILL = 0x1f AF_UNIX = 0x1 AF_UNSPEC = 0x0 AF_X25 = 0x14 ARPHRD_ARCNET = 0x7 ARPHRD_ATM = 0x10 ARPHRD_AX25 = 0x3 ARPHRD_CHAOS = 0x5 ARPHRD_EETHER = 0x2 ARPHRD_ETHER = 0x1 ARPHRD_FC = 0x12 ARPHRD_FRAME = 0xf ARPHRD_HDLC = 0x11 ARPHRD_IB = 0x20 ARPHRD_IEEE802 = 0x6 ARPHRD_IPATM = 0x13 ARPHRD_METRICOM = 0x17 ARPHRD_TUNNEL = 0x1f B0 = 0x0 B110 = 0x3 B115200 = 0x12 B1200 = 0x9 B134 = 0x4 B150 = 0x5 B153600 = 0x13 B1800 = 0xa B19200 = 0xe B200 = 0x6 B230400 = 0x14 B2400 = 0xb B300 = 0x7 B307200 = 0x15 B38400 = 0xf B460800 = 0x16 B4800 = 0xc B50 = 0x1 B57600 = 0x10 B600 = 0x8 B75 = 0x2 B76800 = 0x11 B921600 = 0x17 B9600 = 0xd BIOCFLUSH = 0x20004268 BIOCGBLEN = 0x40044266 BIOCGDLT = 0x4004426a BIOCGDLTLIST = -0x3fefbd89 BIOCGDLTLIST32 = -0x3ff7bd89 BIOCGETIF = 0x4020426b BIOCGETLIF = 0x4078426b BIOCGHDRCMPLT = 0x40044274 BIOCGRTIMEOUT = 0x4010427b BIOCGRTIMEOUT32 = 0x4008427b BIOCGSEESENT = 0x40044278 BIOCGSTATS = 0x4080426f BIOCGSTATSOLD = 0x4008426f BIOCIMMEDIATE = -0x7ffbbd90 BIOCPROMISC = 0x20004269 BIOCSBLEN = -0x3ffbbd9a BIOCSDLT = -0x7ffbbd8a BIOCSETF = -0x7fefbd99 BIOCSETF32 = -0x7ff7bd99 BIOCSETIF = -0x7fdfbd94 BIOCSETLIF = -0x7f87bd94 BIOCSHDRCMPLT = -0x7ffbbd8b BIOCSRTIMEOUT = -0x7fefbd86 BIOCSRTIMEOUT32 = -0x7ff7bd86 BIOCSSEESENT = -0x7ffbbd87 BIOCSTCPF = -0x7fefbd8e BIOCSUDPF = -0x7fefbd8d BIOCVERSION = 0x40044271 BPF_A = 0x10 BPF_ABS = 0x20 BPF_ADD = 0x0 BPF_ALIGNMENT = 0x4 BPF_ALU = 0x4 BPF_AND = 0x50 BPF_B = 0x10 BPF_DFLTBUFSIZE = 0x100000 BPF_DIV = 0x30 BPF_H = 0x8 BPF_IMM = 0x0 BPF_IND = 0x40 BPF_JA = 0x0 BPF_JEQ = 0x10 BPF_JGE = 0x30 BPF_JGT = 0x20 BPF_JMP = 0x5 BPF_JSET = 0x40 BPF_K = 0x0 BPF_LD = 0x0 BPF_LDX = 0x1 BPF_LEN = 0x80 BPF_LSH = 0x60 BPF_MAJOR_VERSION = 0x1 BPF_MAXBUFSIZE = 0x1000000 BPF_MAXINSNS = 0x200 BPF_MEM = 0x60 BPF_MEMWORDS = 0x10 BPF_MINBUFSIZE = 0x20 BPF_MINOR_VERSION = 0x1 BPF_MISC = 0x7 BPF_MSH = 0xa0 BPF_MUL = 0x20 BPF_NEG = 0x80 BPF_OR = 0x40 BPF_RELEASE = 0x30bb6 BPF_RET = 0x6 BPF_RSH = 0x70 BPF_ST = 0x2 BPF_STX = 0x3 BPF_SUB = 0x10 BPF_TAX = 0x0 BPF_TXA = 0x80 BPF_W = 0x0 BPF_X = 0x8 BRKINT = 0x2 BS0 = 0x0 BS1 = 0x2000 BSDLY = 0x2000 CBAUD = 0xf CFLUSH = 0xf CIBAUD = 0xf0000 CLOCAL = 0x800 CLOCK_HIGHRES = 0x4 CLOCK_LEVEL = 0xa CLOCK_MONOTONIC = 0x4 CLOCK_PROCESS_CPUTIME_ID = 0x5 CLOCK_PROF = 0x2 CLOCK_REALTIME = 0x3 CLOCK_THREAD_CPUTIME_ID = 0x2 CLOCK_VIRTUAL = 0x1 CR0 = 0x0 CR1 = 0x200 CR2 = 0x400 CR3 = 0x600 CRDLY = 0x600 CREAD = 0x80 CRTSCTS = 0x80000000 CS5 = 0x0 CS6 = 0x10 CS7 = 0x20 CS8 = 0x30 CSIZE = 0x30 CSTART = 0x11 CSTATUS = 0x14 CSTOP = 0x13 CSTOPB = 0x40 CSUSP = 0x1a CSWTCH = 0x1a DIOC = 0x6400 DIOCGETB = 0x6402 DIOCGETC = 0x6401 DIOCGETP = 0x6408 DIOCSETE = 0x6403 DIOCSETP = 0x6409 DLT_AIRONET_HEADER = 0x78 DLT_APPLE_IP_OVER_IEEE1394 = 0x8a DLT_ARCNET = 0x7 DLT_ARCNET_LINUX = 0x81 DLT_ATM_CLIP = 0x13 DLT_ATM_RFC1483 = 0xb DLT_AURORA = 0x7e DLT_AX25 = 0x3 DLT_BACNET_MS_TP = 0xa5 DLT_CHAOS = 0x5 DLT_CISCO_IOS = 0x76 DLT_C_HDLC = 0x68 DLT_DOCSIS = 0x8f DLT_ECONET = 0x73 DLT_EN10MB = 0x1 DLT_EN3MB = 0x2 DLT_ENC = 0x6d DLT_ERF_ETH = 0xaf DLT_ERF_POS = 0xb0 DLT_FDDI = 0xa DLT_FRELAY = 0x6b DLT_GCOM_SERIAL = 0xad DLT_GCOM_T1E1 = 0xac DLT_GPF_F = 0xab DLT_GPF_T = 0xaa DLT_GPRS_LLC = 0xa9 DLT_HDLC = 0x10 DLT_HHDLC = 0x79 DLT_HIPPI = 0xf DLT_IBM_SN = 0x92 DLT_IBM_SP = 0x91 DLT_IEEE802 = 0x6 DLT_IEEE802_11 = 0x69 DLT_IEEE802_11_RADIO = 0x7f DLT_IEEE802_11_RADIO_AVS = 0xa3 DLT_IPNET = 0xe2 DLT_IPOIB = 0xa2 DLT_IP_OVER_FC = 0x7a DLT_JUNIPER_ATM1 = 0x89 DLT_JUNIPER_ATM2 = 0x87 DLT_JUNIPER_CHDLC = 0xb5 DLT_JUNIPER_ES = 0x84 DLT_JUNIPER_ETHER = 0xb2 DLT_JUNIPER_FRELAY = 0xb4 DLT_JUNIPER_GGSN = 0x85 DLT_JUNIPER_MFR = 0x86 DLT_JUNIPER_MLFR = 0x83 DLT_JUNIPER_MLPPP = 0x82 DLT_JUNIPER_MONITOR = 0xa4 DLT_JUNIPER_PIC_PEER = 0xae DLT_JUNIPER_PPP = 0xb3 DLT_JUNIPER_PPPOE = 0xa7 DLT_JUNIPER_PPPOE_ATM = 0xa8 DLT_JUNIPER_SERVICES = 0x88 DLT_LINUX_IRDA = 0x90 DLT_LINUX_LAPD = 0xb1 DLT_LINUX_SLL = 0x71 DLT_LOOP = 0x6c DLT_LTALK = 0x72 DLT_MTP2 = 0x8c DLT_MTP2_WITH_PHDR = 0x8b DLT_MTP3 = 0x8d DLT_NULL = 0x0 DLT_PCI_EXP = 0x7d DLT_PFLOG = 0x75 DLT_PFSYNC = 0x12 DLT_PPP = 0x9 DLT_PPP_BSDOS = 0xe DLT_PPP_PPPD = 0xa6 DLT_PRISM_HEADER = 0x77 DLT_PRONET = 0x4 DLT_RAW = 0xc DLT_RAWAF_MASK = 0x2240000 DLT_RIO = 0x7c DLT_SCCP = 0x8e DLT_SLIP = 0x8 DLT_SLIP_BSDOS = 0xd DLT_SUNATM = 0x7b DLT_SYMANTEC_FIREWALL = 0x63 DLT_TZSP = 0x80 ECHO = 0x8 ECHOCTL = 0x200 ECHOE = 0x10 ECHOK = 0x20 ECHOKE = 0x800 ECHONL = 0x40 ECHOPRT = 0x400 EMPTY_SET = 0x0 EMT_CPCOVF = 0x1 EQUALITY_CHECK = 0x0 EXTA = 0xe EXTB = 0xf FD_CLOEXEC = 0x1 FD_NFDBITS = 0x40 FD_SETSIZE = 0x10000 FF0 = 0x0 FF1 = 0x8000 FFDLY = 0x8000 FIORDCHK = 0x6603 FLUSHALL = 0x1 FLUSHDATA = 0x0 FLUSHO = 0x2000 F_ALLOCSP = 0xa F_ALLOCSP64 = 0xa F_BADFD = 0x2e F_BLKSIZE = 0x13 F_BLOCKS = 0x12 F_CHKFL = 0x8 F_COMPAT = 0x8 F_DUP2FD = 0x9 F_DUP2FD_CLOEXEC = 0x24 F_DUPFD = 0x0 F_DUPFD_CLOEXEC = 0x25 F_FLOCK = 0x35 F_FLOCK64 = 0x35 F_FLOCKW = 0x36 F_FLOCKW64 = 0x36 F_FREESP = 0xb F_FREESP64 = 0xb F_GETFD = 0x1 F_GETFL = 0x3 F_GETLK = 0xe F_GETLK64 = 0xe F_GETOWN = 0x17 F_GETXFL = 0x2d F_HASREMOTELOCKS = 0x1a F_ISSTREAM = 0xd F_MANDDNY = 0x10 F_MDACC = 0x20 F_NODNY = 0x0 F_NPRIV = 0x10 F_OFD_GETLK = 0x2f F_OFD_GETLK64 = 0x2f F_OFD_SETLK = 0x30 F_OFD_SETLK64 = 0x30 F_OFD_SETLKW = 0x31 F_OFD_SETLKW64 = 0x31 F_PRIV = 0xf F_QUOTACTL = 0x11 F_RDACC = 0x1 F_RDDNY = 0x1 F_RDLCK = 0x1 F_REVOKE = 0x19 F_RMACC = 0x4 F_RMDNY = 0x4 F_RWACC = 0x3 F_RWDNY = 0x3 F_SETFD = 0x2 F_SETFL = 0x4 F_SETLK = 0x6 F_SETLK64 = 0x6 F_SETLK64_NBMAND = 0x2a F_SETLKW = 0x7 F_SETLKW64 = 0x7 F_SETLK_NBMAND = 0x2a F_SETOWN = 0x18 F_SHARE = 0x28 F_SHARE_NBMAND = 0x2b F_UNLCK = 0x3 F_UNLKSYS = 0x4 F_UNSHARE = 0x29 F_WRACC = 0x2 F_WRDNY = 0x2 F_WRLCK = 0x2 HUPCL = 0x400 IBSHIFT = 0x10 ICANON = 0x2 ICMP6_FILTER = 0x1 ICRNL = 0x100 IEXTEN = 0x8000 IFF_ADDRCONF = 0x80000 IFF_ALLMULTI = 0x200 IFF_ANYCAST = 0x400000 IFF_BROADCAST = 0x2 IFF_CANTCHANGE = 0x7f203003b5a IFF_COS_ENABLED = 0x200000000 IFF_DEBUG = 0x4 IFF_DEPRECATED = 0x40000 IFF_DHCPRUNNING = 0x4000 IFF_DUPLICATE = 0x4000000000 IFF_FAILED = 0x10000000 IFF_FIXEDMTU = 0x1000000000 IFF_INACTIVE = 0x40000000 IFF_INTELLIGENT = 0x400 IFF_IPMP = 0x8000000000 IFF_IPMP_CANTCHANGE = 0x10000000 IFF_IPMP_INVALID = 0x1ec200080 IFF_IPV4 = 0x1000000 IFF_IPV6 = 0x2000000 IFF_L3PROTECT = 0x40000000000 IFF_LOOPBACK = 0x8 IFF_MULTICAST = 0x800 IFF_MULTI_BCAST = 0x1000 IFF_NOACCEPT = 0x4000000 IFF_NOARP = 0x80 IFF_NOFAILOVER = 0x8000000 IFF_NOLINKLOCAL = 0x20000000000 IFF_NOLOCAL = 0x20000 IFF_NONUD = 0x200000 IFF_NORTEXCH = 0x800000 IFF_NOTRAILERS = 0x20 IFF_NOXMIT = 0x10000 IFF_OFFLINE = 0x80000000 IFF_POINTOPOINT = 0x10 IFF_PREFERRED = 0x400000000 IFF_PRIVATE = 0x8000 IFF_PROMISC = 0x100 IFF_ROUTER = 0x100000 IFF_RUNNING = 0x40 IFF_STANDBY = 0x20000000 IFF_TEMPORARY = 0x800000000 IFF_UNNUMBERED = 0x2000 IFF_UP = 0x1 IFF_VIRTUAL = 0x2000000000 IFF_VRRP = 0x10000000000 IFF_XRESOLV = 0x100000000 IFNAMSIZ = 0x10 IFT_1822 = 0x2 IFT_6TO4 = 0xca IFT_AAL5 = 0x31 IFT_ARCNET = 0x23 IFT_ARCNETPLUS = 0x24 IFT_ATM = 0x25 IFT_CEPT = 0x13 IFT_DS3 = 0x1e IFT_EON = 0x19 IFT_ETHER = 0x6 IFT_FDDI = 0xf IFT_FRELAY = 0x20 IFT_FRELAYDCE = 0x2c IFT_HDH1822 = 0x3 IFT_HIPPI = 0x2f IFT_HSSI = 0x2e IFT_HY = 0xe IFT_IB = 0xc7 IFT_IPV4 = 0xc8 IFT_IPV6 = 0xc9 IFT_ISDNBASIC = 0x14 IFT_ISDNPRIMARY = 0x15 IFT_ISO88022LLC = 0x29 IFT_ISO88023 = 0x7 IFT_ISO88024 = 0x8 IFT_ISO88025 = 0x9 IFT_ISO88026 = 0xa IFT_LAPB = 0x10 IFT_LOCALTALK = 0x2a IFT_LOOP = 0x18 IFT_MIOX25 = 0x26 IFT_MODEM = 0x30 IFT_NSIP = 0x1b IFT_OTHER = 0x1 IFT_P10 = 0xc IFT_P80 = 0xd IFT_PARA = 0x22 IFT_PPP = 0x17 IFT_PROPMUX = 0x36 IFT_PROPVIRTUAL = 0x35 IFT_PTPSERIAL = 0x16 IFT_RS232 = 0x21 IFT_SDLC = 0x11 IFT_SIP = 0x1f IFT_SLIP = 0x1c IFT_SMDSDXI = 0x2b IFT_SMDSICIP = 0x34 IFT_SONET = 0x27 IFT_SONETPATH = 0x32 IFT_SONETVT = 0x33 IFT_STARLAN = 0xb IFT_T1 = 0x12 IFT_ULTRA = 0x1d IFT_V35 = 0x2d IFT_X25 = 0x5 IFT_X25DDN = 0x4 IFT_X25PLE = 0x28 IFT_XETHER = 0x1a IGNBRK = 0x1 IGNCR = 0x80 IGNPAR = 0x4 IMAXBEL = 0x2000 INLCR = 0x40 INPCK = 0x10 IN_AUTOCONF_MASK = 0xffff0000 IN_AUTOCONF_NET = 0xa9fe0000 IN_CLASSA_HOST = 0xffffff IN_CLASSA_MAX = 0x80 IN_CLASSA_NET = 0xff000000 IN_CLASSA_NSHIFT = 0x18 IN_CLASSB_HOST = 0xffff IN_CLASSB_MAX = 0x10000 IN_CLASSB_NET = 0xffff0000 IN_CLASSB_NSHIFT = 0x10 IN_CLASSC_HOST = 0xff IN_CLASSC_NET = 0xffffff00 IN_CLASSC_NSHIFT = 0x8 IN_CLASSD_HOST = 0xfffffff IN_CLASSD_NET = 0xf0000000 IN_CLASSD_NSHIFT = 0x1c IN_CLASSE_NET = 0xffffffff IN_LOOPBACKNET = 0x7f IN_PRIVATE12_MASK = 0xfff00000 IN_PRIVATE12_NET = 0xac100000 IN_PRIVATE16_MASK = 0xffff0000 IN_PRIVATE16_NET = 0xc0a80000 IN_PRIVATE8_MASK = 0xff000000 IN_PRIVATE8_NET = 0xa000000 IPPROTO_AH = 0x33 IPPROTO_DSTOPTS = 0x3c IPPROTO_EGP = 0x8 IPPROTO_ENCAP = 0x4 IPPROTO_EON = 0x50 IPPROTO_ESP = 0x32 IPPROTO_FRAGMENT = 0x2c IPPROTO_GGP = 0x3 IPPROTO_HELLO = 0x3f IPPROTO_HOPOPTS = 0x0 IPPROTO_ICMP = 0x1 IPPROTO_ICMPV6 = 0x3a IPPROTO_IDP = 0x16 IPPROTO_IGMP = 0x2 IPPROTO_IP = 0x0 IPPROTO_IPV6 = 0x29 IPPROTO_MAX = 0x100 IPPROTO_ND = 0x4d IPPROTO_NONE = 0x3b IPPROTO_OSPF = 0x59 IPPROTO_PIM = 0x67 IPPROTO_PUP = 0xc IPPROTO_RAW = 0xff IPPROTO_ROUTING = 0x2b IPPROTO_RSVP = 0x2e IPPROTO_SCTP = 0x84 IPPROTO_TCP = 0x6 IPPROTO_UDP = 0x11 IPV6_ADD_MEMBERSHIP = 0x9 IPV6_BOUND_IF = 0x41 IPV6_CHECKSUM = 0x18 IPV6_DONTFRAG = 0x21 IPV6_DROP_MEMBERSHIP = 0xa IPV6_DSTOPTS = 0xf IPV6_FLOWINFO_FLOWLABEL = 0xffff0f00 IPV6_FLOWINFO_TCLASS = 0xf00f IPV6_HOPLIMIT = 0xc IPV6_HOPOPTS = 0xe IPV6_JOIN_GROUP = 0x9 IPV6_LEAVE_GROUP = 0xa IPV6_MULTICAST_HOPS = 0x7 IPV6_MULTICAST_IF = 0x6 IPV6_MULTICAST_LOOP = 0x8 IPV6_NEXTHOP = 0xd IPV6_PAD1_OPT = 0x0 IPV6_PATHMTU = 0x25 IPV6_PKTINFO = 0xb IPV6_PREFER_SRC_CGA = 0x20 IPV6_PREFER_SRC_CGADEFAULT = 0x10 IPV6_PREFER_SRC_CGAMASK = 0x30 IPV6_PREFER_SRC_COA = 0x2 IPV6_PREFER_SRC_DEFAULT = 0x15 IPV6_PREFER_SRC_HOME = 0x1 IPV6_PREFER_SRC_MASK = 0x3f IPV6_PREFER_SRC_MIPDEFAULT = 0x1 IPV6_PREFER_SRC_MIPMASK = 0x3 IPV6_PREFER_SRC_NONCGA = 0x10 IPV6_PREFER_SRC_PUBLIC = 0x4 IPV6_PREFER_SRC_TMP = 0x8 IPV6_PREFER_SRC_TMPDEFAULT = 0x4 IPV6_PREFER_SRC_TMPMASK = 0xc IPV6_RECVDSTOPTS = 0x28 IPV6_RECVHOPLIMIT = 0x13 IPV6_RECVHOPOPTS = 0x14 IPV6_RECVPATHMTU = 0x24 IPV6_RECVPKTINFO = 0x12 IPV6_RECVRTHDR = 0x16 IPV6_RECVRTHDRDSTOPTS = 0x17 IPV6_RECVTCLASS = 0x19 IPV6_RTHDR = 0x10 IPV6_RTHDRDSTOPTS = 0x11 IPV6_RTHDR_TYPE_0 = 0x0 IPV6_SEC_OPT = 0x22 IPV6_SRC_PREFERENCES = 0x23 IPV6_TCLASS = 0x26 IPV6_UNICAST_HOPS = 0x5 IPV6_UNSPEC_SRC = 0x42 IPV6_USE_MIN_MTU = 0x20 IPV6_V6ONLY = 0x27 IP_ADD_MEMBERSHIP = 0x13 IP_ADD_SOURCE_MEMBERSHIP = 0x17 IP_BLOCK_SOURCE = 0x15 IP_BOUND_IF = 0x41 IP_BROADCAST = 0x106 IP_BROADCAST_TTL = 0x43 IP_DEFAULT_MULTICAST_LOOP = 0x1 IP_DEFAULT_MULTICAST_TTL = 0x1 IP_DF = 0x4000 IP_DHCPINIT_IF = 0x45 IP_DONTFRAG = 0x1b IP_DONTROUTE = 0x105 IP_DROP_MEMBERSHIP = 0x14 IP_DROP_SOURCE_MEMBERSHIP = 0x18 IP_HDRINCL = 0x2 IP_MAXPACKET = 0xffff IP_MF = 0x2000 IP_MSS = 0x240 IP_MULTICAST_IF = 0x10 IP_MULTICAST_LOOP = 0x12 IP_MULTICAST_TTL = 0x11 IP_NEXTHOP = 0x19 IP_OPTIONS = 0x1 IP_PKTINFO = 0x1a IP_RECVDSTADDR = 0x7 IP_RECVIF = 0x9 IP_RECVOPTS = 0x5 IP_RECVPKTINFO = 0x1a IP_RECVRETOPTS = 0x6 IP_RECVSLLA = 0xa IP_RECVTOS = 0xc IP_RECVTTL = 0xb IP_RETOPTS = 0x8 IP_REUSEADDR = 0x104 IP_SEC_OPT = 0x22 IP_TOS = 0x3 IP_TTL = 0x4 IP_UNBLOCK_SOURCE = 0x16 IP_UNSPEC_SRC = 0x42 ISIG = 0x1 ISTRIP = 0x20 IUCLC = 0x200 IXANY = 0x800 IXOFF = 0x1000 IXON = 0x400 LOCK_EX = 0x2 LOCK_NB = 0x4 LOCK_SH = 0x1 LOCK_UN = 0x8 MADV_ACCESS_DEFAULT = 0x6 MADV_ACCESS_LWP = 0x7 MADV_ACCESS_MANY = 0x8 MADV_DONTNEED = 0x4 MADV_FREE = 0x5 MADV_NORMAL = 0x0 MADV_PURGE = 0x9 MADV_RANDOM = 0x1 MADV_SEQUENTIAL = 0x2 MADV_WILLNEED = 0x3 MAP_32BIT = 0x80 MAP_ALIGN = 0x200 MAP_ANON = 0x100 MAP_ANONYMOUS = 0x100 MAP_FILE = 0x0 MAP_FIXED = 0x10 MAP_INITDATA = 0x800 MAP_NORESERVE = 0x40 MAP_PRIVATE = 0x2 MAP_RENAME = 0x20 MAP_SHARED = 0x1 MAP_TEXT = 0x400 MAP_TYPE = 0xf MCAST_BLOCK_SOURCE = 0x2b MCAST_EXCLUDE = 0x2 MCAST_INCLUDE = 0x1 MCAST_JOIN_GROUP = 0x29 MCAST_JOIN_SOURCE_GROUP = 0x2d MCAST_LEAVE_GROUP = 0x2a MCAST_LEAVE_SOURCE_GROUP = 0x2e MCAST_UNBLOCK_SOURCE = 0x2c MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MSG_CTRUNC = 0x10 MSG_DONTROUTE = 0x4 MSG_DONTWAIT = 0x80 MSG_DUPCTRL = 0x800 MSG_EOR = 0x8 MSG_MAXIOVLEN = 0x10 MSG_NOSIGNAL = 0x200 MSG_NOTIFICATION = 0x100 MSG_OOB = 0x1 MSG_PEEK = 0x2 MSG_TRUNC = 0x20 MSG_WAITALL = 0x40 MSG_XPG4_2 = 0x8000 MS_ASYNC = 0x1 MS_INVALIDATE = 0x2 MS_OLDSYNC = 0x0 MS_SYNC = 0x4 M_FLUSH = 0x86 NAME_MAX = 0xff NEWDEV = 0x1 NFDBITS = 0x40 NL0 = 0x0 NL1 = 0x100 NLDLY = 0x100 NOFLSH = 0x80 OCRNL = 0x8 OFDEL = 0x80 OFILL = 0x40 OLCUC = 0x2 OLDDEV = 0x0 ONBITSMAJOR = 0x7 ONBITSMINOR = 0x8 ONLCR = 0x4 ONLRET = 0x20 ONOCR = 0x10 OPENFAIL = -0x1 OPOST = 0x1 O_ACCMODE = 0x600003 O_APPEND = 0x8 O_CLOEXEC = 0x800000 O_CREAT = 0x100 O_DIRECT = 0x2000000 O_DIRECTORY = 0x1000000 O_DSYNC = 0x40 O_EXCL = 0x400 O_EXEC = 0x400000 O_LARGEFILE = 0x2000 O_NDELAY = 0x4 O_NOCTTY = 0x800 O_NOFOLLOW = 0x20000 O_NOLINKS = 0x40000 O_NONBLOCK = 0x80 O_RDONLY = 0x0 O_RDWR = 0x2 O_RSYNC = 0x8000 O_SEARCH = 0x200000 O_SIOCGIFCONF = -0x3ff796ec O_SIOCGLIFCONF = -0x3fef9688 O_SYNC = 0x10 O_TRUNC = 0x200 O_WRONLY = 0x1 O_XATTR = 0x4000 PARENB = 0x100 PAREXT = 0x100000 PARMRK = 0x8 PARODD = 0x200 PENDIN = 0x4000 PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 PROT_EXEC = 0x4 PROT_NONE = 0x0 PROT_READ = 0x1 PROT_WRITE = 0x2 RLIMIT_AS = 0x6 RLIMIT_CORE = 0x4 RLIMIT_CPU = 0x0 RLIMIT_DATA = 0x2 RLIMIT_FSIZE = 0x1 RLIMIT_NOFILE = 0x5 RLIMIT_STACK = 0x3 RLIM_INFINITY = 0xfffffffffffffffd RTAX_AUTHOR = 0x6 RTAX_BRD = 0x7 RTAX_DST = 0x0 RTAX_GATEWAY = 0x1 RTAX_GENMASK = 0x3 RTAX_IFA = 0x5 RTAX_IFP = 0x4 RTAX_MAX = 0x9 RTAX_NETMASK = 0x2 RTAX_SRC = 0x8 RTA_AUTHOR = 0x40 RTA_BRD = 0x80 RTA_DST = 0x1 RTA_GATEWAY = 0x2 RTA_GENMASK = 0x8 RTA_IFA = 0x20 RTA_IFP = 0x10 RTA_NETMASK = 0x4 RTA_NUMBITS = 0x9 RTA_SRC = 0x100 RTF_BLACKHOLE = 0x1000 RTF_CLONING = 0x100 RTF_DONE = 0x40 RTF_DYNAMIC = 0x10 RTF_GATEWAY = 0x2 RTF_HOST = 0x4 RTF_INDIRECT = 0x40000 RTF_KERNEL = 0x80000 RTF_LLINFO = 0x400 RTF_MASK = 0x80 RTF_MODIFIED = 0x20 RTF_MULTIRT = 0x10000 RTF_PRIVATE = 0x2000 RTF_PROTO1 = 0x8000 RTF_PROTO2 = 0x4000 RTF_REJECT = 0x8 RTF_SETSRC = 0x20000 RTF_STATIC = 0x800 RTF_UP = 0x1 RTF_XRESOLVE = 0x200 RTF_ZONE = 0x100000 RTM_ADD = 0x1 RTM_CHANGE = 0x3 RTM_CHGADDR = 0xf RTM_DELADDR = 0xd RTM_DELETE = 0x2 RTM_FREEADDR = 0x10 RTM_GET = 0x4 RTM_IFINFO = 0xe RTM_LOCK = 0x8 RTM_LOSING = 0x5 RTM_MISS = 0x7 RTM_NEWADDR = 0xc RTM_OLDADD = 0x9 RTM_OLDDEL = 0xa RTM_REDIRECT = 0x6 RTM_RESOLVE = 0xb RTM_VERSION = 0x3 RTV_EXPIRE = 0x4 RTV_HOPCOUNT = 0x2 RTV_MTU = 0x1 RTV_RPIPE = 0x8 RTV_RTT = 0x40 RTV_RTTVAR = 0x80 RTV_SPIPE = 0x10 RTV_SSTHRESH = 0x20 RT_AWARE = 0x1 RUSAGE_CHILDREN = -0x1 RUSAGE_SELF = 0x0 SCM_RIGHTS = 0x1010 SCM_TIMESTAMP = 0x1013 SCM_UCRED = 0x1012 SHUT_RD = 0x0 SHUT_RDWR = 0x2 SHUT_WR = 0x1 SIG2STR_MAX = 0x20 SIOCADDMULTI = -0x7fdf96cf SIOCADDRT = -0x7fcf8df6 SIOCATMARK = 0x40047307 SIOCDARP = -0x7fdb96e0 SIOCDELMULTI = -0x7fdf96ce SIOCDELRT = -0x7fcf8df5 SIOCDXARP = -0x7fff9658 SIOCGARP = -0x3fdb96e1 SIOCGDSTINFO = -0x3fff965c SIOCGENADDR = -0x3fdf96ab SIOCGENPSTATS = -0x3fdf96c7 SIOCGETLSGCNT = -0x3fef8deb SIOCGETNAME = 0x40107334 SIOCGETPEER = 0x40107335 SIOCGETPROP = -0x3fff8f44 SIOCGETSGCNT = -0x3feb8deb SIOCGETSYNC = -0x3fdf96d3 SIOCGETVIFCNT = -0x3feb8dec SIOCGHIWAT = 0x40047301 SIOCGIFADDR = -0x3fdf96f3 SIOCGIFBRDADDR = -0x3fdf96e9 SIOCGIFCONF = -0x3ff796a4 SIOCGIFDSTADDR = -0x3fdf96f1 SIOCGIFFLAGS = -0x3fdf96ef SIOCGIFHWADDR = -0x3fdf9647 SIOCGIFINDEX = -0x3fdf96a6 SIOCGIFMEM = -0x3fdf96ed SIOCGIFMETRIC = -0x3fdf96e5 SIOCGIFMTU = -0x3fdf96ea SIOCGIFMUXID = -0x3fdf96a8 SIOCGIFNETMASK = -0x3fdf96e7 SIOCGIFNUM = 0x40046957 SIOCGIP6ADDRPOLICY = -0x3fff965e SIOCGIPMSFILTER = -0x3ffb964c SIOCGLIFADDR = -0x3f87968f SIOCGLIFBINDING = -0x3f879666 SIOCGLIFBRDADDR = -0x3f879685 SIOCGLIFCONF = -0x3fef965b SIOCGLIFDADSTATE = -0x3f879642 SIOCGLIFDSTADDR = -0x3f87968d SIOCGLIFFLAGS = -0x3f87968b SIOCGLIFGROUPINFO = -0x3f4b9663 SIOCGLIFGROUPNAME = -0x3f879664 SIOCGLIFHWADDR = -0x3f879640 SIOCGLIFINDEX = -0x3f87967b SIOCGLIFLNKINFO = -0x3f879674 SIOCGLIFMETRIC = -0x3f879681 SIOCGLIFMTU = -0x3f879686 SIOCGLIFMUXID = -0x3f87967d SIOCGLIFNETMASK = -0x3f879683 SIOCGLIFNUM = -0x3ff3967e SIOCGLIFSRCOF = -0x3fef964f SIOCGLIFSUBNET = -0x3f879676 SIOCGLIFTOKEN = -0x3f879678 SIOCGLIFUSESRC = -0x3f879651 SIOCGLIFZONE = -0x3f879656 SIOCGLOWAT = 0x40047303 SIOCGMSFILTER = -0x3ffb964e SIOCGPGRP = 0x40047309 SIOCGSTAMP = -0x3fef9646 SIOCGXARP = -0x3fff9659 SIOCIFDETACH = -0x7fdf96c8 SIOCILB = -0x3ffb9645 SIOCLIFADDIF = -0x3f879691 SIOCLIFDELND = -0x7f879673 SIOCLIFGETND = -0x3f879672 SIOCLIFREMOVEIF = -0x7f879692 SIOCLIFSETND = -0x7f879671 SIOCLOWER = -0x7fdf96d7 SIOCSARP = -0x7fdb96e2 SIOCSCTPGOPT = -0x3fef9653 SIOCSCTPPEELOFF = -0x3ffb9652 SIOCSCTPSOPT = -0x7fef9654 SIOCSENABLESDP = -0x3ffb9649 SIOCSETPROP = -0x7ffb8f43 SIOCSETSYNC = -0x7fdf96d4 SIOCSHIWAT = -0x7ffb8d00 SIOCSIFADDR = -0x7fdf96f4 SIOCSIFBRDADDR = -0x7fdf96e8 SIOCSIFDSTADDR = -0x7fdf96f2 SIOCSIFFLAGS = -0x7fdf96f0 SIOCSIFINDEX = -0x7fdf96a5 SIOCSIFMEM = -0x7fdf96ee SIOCSIFMETRIC = -0x7fdf96e4 SIOCSIFMTU = -0x7fdf96eb SIOCSIFMUXID = -0x7fdf96a7 SIOCSIFNAME = -0x7fdf96b7 SIOCSIFNETMASK = -0x7fdf96e6 SIOCSIP6ADDRPOLICY = -0x7fff965d SIOCSIPMSFILTER = -0x7ffb964b SIOCSLGETREQ = -0x3fdf96b9 SIOCSLIFADDR = -0x7f879690 SIOCSLIFBRDADDR = -0x7f879684 SIOCSLIFDSTADDR = -0x7f87968e SIOCSLIFFLAGS = -0x7f87968c SIOCSLIFGROUPNAME = -0x7f879665 SIOCSLIFINDEX = -0x7f87967a SIOCSLIFLNKINFO = -0x7f879675 SIOCSLIFMETRIC = -0x7f879680 SIOCSLIFMTU = -0x7f879687 SIOCSLIFMUXID = -0x7f87967c SIOCSLIFNAME = -0x3f87967f SIOCSLIFNETMASK = -0x7f879682 SIOCSLIFPREFIX = -0x3f879641 SIOCSLIFSUBNET = -0x7f879677 SIOCSLIFTOKEN = -0x7f879679 SIOCSLIFUSESRC = -0x7f879650 SIOCSLIFZONE = -0x7f879655 SIOCSLOWAT = -0x7ffb8cfe SIOCSLSTAT = -0x7fdf96b8 SIOCSMSFILTER = -0x7ffb964d SIOCSPGRP = -0x7ffb8cf8 SIOCSPROMISC = -0x7ffb96d0 SIOCSQPTR = -0x3ffb9648 SIOCSSDSTATS = -0x3fdf96d2 SIOCSSESTATS = -0x3fdf96d1 SIOCSXARP = -0x7fff965a SIOCTMYADDR = -0x3ff79670 SIOCTMYSITE = -0x3ff7966e SIOCTONLINK = -0x3ff7966f SIOCUPPER = -0x7fdf96d8 SIOCX25RCV = -0x3fdf96c4 SIOCX25TBL = -0x3fdf96c3 SIOCX25XMT = -0x3fdf96c5 SIOCXPROTO = 0x20007337 SOCK_CLOEXEC = 0x80000 SOCK_DGRAM = 0x1 SOCK_NDELAY = 0x200000 SOCK_NONBLOCK = 0x100000 SOCK_RAW = 0x4 SOCK_RDM = 0x5 SOCK_SEQPACKET = 0x6 SOCK_STREAM = 0x2 SOCK_TYPE_MASK = 0xffff SOL_FILTER = 0xfffc SOL_PACKET = 0xfffd SOL_ROUTE = 0xfffe SOL_SOCKET = 0xffff SOMAXCONN = 0x80 SO_ACCEPTCONN = 0x2 SO_ALL = 0x3f SO_ALLZONES = 0x1014 SO_ANON_MLP = 0x100a SO_ATTACH_FILTER = 0x40000001 SO_BAND = 0x4000 SO_BROADCAST = 0x20 SO_COPYOPT = 0x80000 SO_DEBUG = 0x1 SO_DELIM = 0x8000 SO_DETACH_FILTER = 0x40000002 SO_DGRAM_ERRIND = 0x200 SO_DOMAIN = 0x100c SO_DONTLINGER = -0x81 SO_DONTROUTE = 0x10 SO_ERROPT = 0x40000 SO_ERROR = 0x1007 SO_EXCLBIND = 0x1015 SO_HIWAT = 0x10 SO_ISNTTY = 0x800 SO_ISTTY = 0x400 SO_KEEPALIVE = 0x8 SO_LINGER = 0x80 SO_LOWAT = 0x20 SO_MAC_EXEMPT = 0x100b SO_MAC_IMPLICIT = 0x1016 SO_MAXBLK = 0x100000 SO_MAXPSZ = 0x8 SO_MINPSZ = 0x4 SO_MREADOFF = 0x80 SO_MREADON = 0x40 SO_NDELOFF = 0x200 SO_NDELON = 0x100 SO_NODELIM = 0x10000 SO_OOBINLINE = 0x100 SO_PROTOTYPE = 0x1009 SO_RCVBUF = 0x1002 SO_RCVLOWAT = 0x1004 SO_RCVPSH = 0x100d SO_RCVTIMEO = 0x1006 SO_READOPT = 0x1 SO_RECVUCRED = 0x400 SO_REUSEADDR = 0x4 SO_SECATTR = 0x1011 SO_SNDBUF = 0x1001 SO_SNDLOWAT = 0x1003 SO_SNDTIMEO = 0x1005 SO_STRHOLD = 0x20000 SO_TAIL = 0x200000 SO_TIMESTAMP = 0x1013 SO_TONSTOP = 0x2000 SO_TOSTOP = 0x1000 SO_TYPE = 0x1008 SO_USELOOPBACK = 0x40 SO_VRRP = 0x1017 SO_WROFF = 0x2 S_ENFMT = 0x400 S_IAMB = 0x1ff S_IEXEC = 0x40 S_IFBLK = 0x6000 S_IFCHR = 0x2000 S_IFDIR = 0x4000 S_IFDOOR = 0xd000 S_IFIFO = 0x1000 S_IFLNK = 0xa000 S_IFMT = 0xf000 S_IFNAM = 0x5000 S_IFPORT = 0xe000 S_IFREG = 0x8000 S_IFSOCK = 0xc000 S_INSEM = 0x1 S_INSHD = 0x2 S_IREAD = 0x100 S_IRGRP = 0x20 S_IROTH = 0x4 S_IRUSR = 0x100 S_IRWXG = 0x38 S_IRWXO = 0x7 S_IRWXU = 0x1c0 S_ISGID = 0x400 S_ISUID = 0x800 S_ISVTX = 0x200 S_IWGRP = 0x10 S_IWOTH = 0x2 S_IWRITE = 0x80 S_IWUSR = 0x80 S_IXGRP = 0x8 S_IXOTH = 0x1 S_IXUSR = 0x40 TAB0 = 0x0 TAB1 = 0x800 TAB2 = 0x1000 TAB3 = 0x1800 TABDLY = 0x1800 TCFLSH = 0x5407 TCGETA = 0x5401 TCGETS = 0x540d TCIFLUSH = 0x0 TCIOFF = 0x2 TCIOFLUSH = 0x2 TCION = 0x3 TCOFLUSH = 0x1 TCOOFF = 0x0 TCOON = 0x1 TCP_ABORT_THRESHOLD = 0x11 TCP_ANONPRIVBIND = 0x20 TCP_CONGESTION = 0x25 TCP_CONN_ABORT_THRESHOLD = 0x13 TCP_CONN_NOTIFY_THRESHOLD = 0x12 TCP_CORK = 0x18 TCP_EXCLBIND = 0x21 TCP_INIT_CWND = 0x15 TCP_KEEPALIVE = 0x8 TCP_KEEPALIVE_ABORT_THRESHOLD = 0x17 TCP_KEEPALIVE_THRESHOLD = 0x16 TCP_KEEPCNT = 0x23 TCP_KEEPIDLE = 0x22 TCP_KEEPINTVL = 0x24 TCP_LINGER2 = 0x1c TCP_MAXSEG = 0x2 TCP_MSS = 0x218 TCP_NODELAY = 0x1 TCP_NOTIFY_THRESHOLD = 0x10 TCP_RECVDSTADDR = 0x14 TCP_RTO_INITIAL = 0x19 TCP_RTO_MAX = 0x1b TCP_RTO_MIN = 0x1a TCSAFLUSH = 0x5410 TCSBRK = 0x5405 TCSETA = 0x5402 TCSETAF = 0x5404 TCSETAW = 0x5403 TCSETS = 0x540e TCSETSF = 0x5410 TCSETSW = 0x540f TCXONC = 0x5406 TIMER_ABSTIME = 0x1 TIMER_RELTIME = 0x0 TIOC = 0x5400 TIOCCBRK = 0x747a TIOCCDTR = 0x7478 TIOCCILOOP = 0x746c TIOCEXCL = 0x740d TIOCFLUSH = 0x7410 TIOCGETC = 0x7412 TIOCGETD = 0x7400 TIOCGETP = 0x7408 TIOCGLTC = 0x7474 TIOCGPGRP = 0x7414 TIOCGPPS = 0x547d TIOCGPPSEV = 0x547f TIOCGSID = 0x7416 TIOCGSOFTCAR = 0x5469 TIOCGWINSZ = 0x5468 TIOCHPCL = 0x7402 TIOCKBOF = 0x5409 TIOCKBON = 0x5408 TIOCLBIC = 0x747e TIOCLBIS = 0x747f TIOCLGET = 0x747c TIOCLSET = 0x747d TIOCMBIC = 0x741c TIOCMBIS = 0x741b TIOCMGET = 0x741d TIOCMSET = 0x741a TIOCM_CAR = 0x40 TIOCM_CD = 0x40 TIOCM_CTS = 0x20 TIOCM_DSR = 0x100 TIOCM_DTR = 0x2 TIOCM_LE = 0x1 TIOCM_RI = 0x80 TIOCM_RNG = 0x80 TIOCM_RTS = 0x4 TIOCM_SR = 0x10 TIOCM_ST = 0x8 TIOCNOTTY = 0x7471 TIOCNXCL = 0x740e TIOCOUTQ = 0x7473 TIOCREMOTE = 0x741e TIOCSBRK = 0x747b TIOCSCTTY = 0x7484 TIOCSDTR = 0x7479 TIOCSETC = 0x7411 TIOCSETD = 0x7401 TIOCSETN = 0x740a TIOCSETP = 0x7409 TIOCSIGNAL = 0x741f TIOCSILOOP = 0x746d TIOCSLTC = 0x7475 TIOCSPGRP = 0x7415 TIOCSPPS = 0x547e TIOCSSOFTCAR = 0x546a TIOCSTART = 0x746e TIOCSTI = 0x7417 TIOCSTOP = 0x746f TIOCSWINSZ = 0x5467 TOSTOP = 0x100 UTIME_NOW = -0x1 UTIME_OMIT = -0x2 VCEOF = 0x8 VCEOL = 0x9 VDISCARD = 0xd VDSUSP = 0xb VEOF = 0x4 VEOL = 0x5 VEOL2 = 0x6 VERASE = 0x2 VERASE2 = 0x11 VINTR = 0x0 VKILL = 0x3 VLNEXT = 0xf VMIN = 0x4 VQUIT = 0x1 VREPRINT = 0xc VSTART = 0x8 VSTATUS = 0x10 VSTOP = 0x9 VSUSP = 0xa VSWTCH = 0x7 VT0 = 0x0 VT1 = 0x4000 VTDLY = 0x4000 VTIME = 0x5 VWERASE = 0xe WCONTFLG = 0xffff WCONTINUED = 0x8 WCOREFLG = 0x80 WEXITED = 0x1 WNOHANG = 0x40 WNOWAIT = 0x80 WOPTMASK = 0xcf WRAP = 0x20000 WSIGMASK = 0x7f WSTOPFLG = 0x7f WSTOPPED = 0x4 WTRAPPED = 0x2 WUNTRACED = 0x4 XCASE = 0x4 XTABS = 0x1800 ) // Errors const ( E2BIG = syscall.Errno(0x7) EACCES = syscall.Errno(0xd) EADDRINUSE = syscall.Errno(0x7d) EADDRNOTAVAIL = syscall.Errno(0x7e) EADV = syscall.Errno(0x44) EAFNOSUPPORT = syscall.Errno(0x7c) EAGAIN = syscall.Errno(0xb) EALREADY = syscall.Errno(0x95) EBADE = syscall.Errno(0x32) EBADF = syscall.Errno(0x9) EBADFD = syscall.Errno(0x51) EBADMSG = syscall.Errno(0x4d) EBADR = syscall.Errno(0x33) EBADRQC = syscall.Errno(0x36) EBADSLT = syscall.Errno(0x37) EBFONT = syscall.Errno(0x39) EBUSY = syscall.Errno(0x10) ECANCELED = syscall.Errno(0x2f) ECHILD = syscall.Errno(0xa) ECHRNG = syscall.Errno(0x25) ECOMM = syscall.Errno(0x46) ECONNABORTED = syscall.Errno(0x82) ECONNREFUSED = syscall.Errno(0x92) ECONNRESET = syscall.Errno(0x83) EDEADLK = syscall.Errno(0x2d) EDEADLOCK = syscall.Errno(0x38) EDESTADDRREQ = syscall.Errno(0x60) EDOM = syscall.Errno(0x21) EDQUOT = syscall.Errno(0x31) EEXIST = syscall.Errno(0x11) EFAULT = syscall.Errno(0xe) EFBIG = syscall.Errno(0x1b) EHOSTDOWN = syscall.Errno(0x93) EHOSTUNREACH = syscall.Errno(0x94) EIDRM = syscall.Errno(0x24) EILSEQ = syscall.Errno(0x58) EINPROGRESS = syscall.Errno(0x96) EINTR = syscall.Errno(0x4) EINVAL = syscall.Errno(0x16) EIO = syscall.Errno(0x5) EISCONN = syscall.Errno(0x85) EISDIR = syscall.Errno(0x15) EL2HLT = syscall.Errno(0x2c) EL2NSYNC = syscall.Errno(0x26) EL3HLT = syscall.Errno(0x27) EL3RST = syscall.Errno(0x28) ELIBACC = syscall.Errno(0x53) ELIBBAD = syscall.Errno(0x54) ELIBEXEC = syscall.Errno(0x57) ELIBMAX = syscall.Errno(0x56) ELIBSCN = syscall.Errno(0x55) ELNRNG = syscall.Errno(0x29) ELOCKUNMAPPED = syscall.Errno(0x48) ELOOP = syscall.Errno(0x5a) EMFILE = syscall.Errno(0x18) EMLINK = syscall.Errno(0x1f) EMSGSIZE = syscall.Errno(0x61) EMULTIHOP = syscall.Errno(0x4a) ENAMETOOLONG = syscall.Errno(0x4e) ENETDOWN = syscall.Errno(0x7f) ENETRESET = syscall.Errno(0x81) ENETUNREACH = syscall.Errno(0x80) ENFILE = syscall.Errno(0x17) ENOANO = syscall.Errno(0x35) ENOBUFS = syscall.Errno(0x84) ENOCSI = syscall.Errno(0x2b) ENODATA = syscall.Errno(0x3d) ENODEV = syscall.Errno(0x13) ENOENT = syscall.Errno(0x2) ENOEXEC = syscall.Errno(0x8) ENOLCK = syscall.Errno(0x2e) ENOLINK = syscall.Errno(0x43) ENOMEM = syscall.Errno(0xc) ENOMSG = syscall.Errno(0x23) ENONET = syscall.Errno(0x40) ENOPKG = syscall.Errno(0x41) ENOPROTOOPT = syscall.Errno(0x63) ENOSPC = syscall.Errno(0x1c) ENOSR = syscall.Errno(0x3f) ENOSTR = syscall.Errno(0x3c) ENOSYS = syscall.Errno(0x59) ENOTACTIVE = syscall.Errno(0x49) ENOTBLK = syscall.Errno(0xf) ENOTCONN = syscall.Errno(0x86) ENOTDIR = syscall.Errno(0x14) ENOTEMPTY = syscall.Errno(0x5d) ENOTRECOVERABLE = syscall.Errno(0x3b) ENOTSOCK = syscall.Errno(0x5f) ENOTSUP = syscall.Errno(0x30) ENOTTY = syscall.Errno(0x19) ENOTUNIQ = syscall.Errno(0x50) ENXIO = syscall.Errno(0x6) EOPNOTSUPP = syscall.Errno(0x7a) EOVERFLOW = syscall.Errno(0x4f) EOWNERDEAD = syscall.Errno(0x3a) EPERM = syscall.Errno(0x1) EPFNOSUPPORT = syscall.Errno(0x7b) EPIPE = syscall.Errno(0x20) EPROTO = syscall.Errno(0x47) EPROTONOSUPPORT = syscall.Errno(0x78) EPROTOTYPE = syscall.Errno(0x62) ERANGE = syscall.Errno(0x22) EREMCHG = syscall.Errno(0x52) EREMOTE = syscall.Errno(0x42) ERESTART = syscall.Errno(0x5b) EROFS = syscall.Errno(0x1e) ESHUTDOWN = syscall.Errno(0x8f) ESOCKTNOSUPPORT = syscall.Errno(0x79) ESPIPE = syscall.Errno(0x1d) ESRCH = syscall.Errno(0x3) ESRMNT = syscall.Errno(0x45) ESTALE = syscall.Errno(0x97) ESTRPIPE = syscall.Errno(0x5c) ETIME = syscall.Errno(0x3e) ETIMEDOUT = syscall.Errno(0x91) ETOOMANYREFS = syscall.Errno(0x90) ETXTBSY = syscall.Errno(0x1a) EUNATCH = syscall.Errno(0x2a) EUSERS = syscall.Errno(0x5e) EWOULDBLOCK = syscall.Errno(0xb) EXDEV = syscall.Errno(0x12) EXFULL = syscall.Errno(0x34) ) // Signals const ( SIGABRT = syscall.Signal(0x6) SIGALRM = syscall.Signal(0xe) SIGBUS = syscall.Signal(0xa) SIGCANCEL = syscall.Signal(0x24) SIGCHLD = syscall.Signal(0x12) SIGCLD = syscall.Signal(0x12) SIGCONT = syscall.Signal(0x19) SIGEMT = syscall.Signal(0x7) SIGFPE = syscall.Signal(0x8) SIGFREEZE = syscall.Signal(0x22) SIGHUP = syscall.Signal(0x1) SIGILL = syscall.Signal(0x4) SIGINFO = syscall.Signal(0x29) SIGINT = syscall.Signal(0x2) SIGIO = syscall.Signal(0x16) SIGIOT = syscall.Signal(0x6) SIGJVM1 = syscall.Signal(0x27) SIGJVM2 = syscall.Signal(0x28) SIGKILL = syscall.Signal(0x9) SIGLOST = syscall.Signal(0x25) SIGLWP = syscall.Signal(0x21) SIGPIPE = syscall.Signal(0xd) SIGPOLL = syscall.Signal(0x16) SIGPROF = syscall.Signal(0x1d) SIGPWR = syscall.Signal(0x13) SIGQUIT = syscall.Signal(0x3) SIGSEGV = syscall.Signal(0xb) SIGSTOP = syscall.Signal(0x17) SIGSYS = syscall.Signal(0xc) SIGTERM = syscall.Signal(0xf) SIGTHAW = syscall.Signal(0x23) SIGTRAP = syscall.Signal(0x5) SIGTSTP = syscall.Signal(0x18) SIGTTIN = syscall.Signal(0x1a) SIGTTOU = syscall.Signal(0x1b) SIGURG = syscall.Signal(0x15) SIGUSR1 = syscall.Signal(0x10) SIGUSR2 = syscall.Signal(0x11) SIGVTALRM = syscall.Signal(0x1c) SIGWAITING = syscall.Signal(0x20) SIGWINCH = syscall.Signal(0x14) SIGXCPU = syscall.Signal(0x1e) SIGXFSZ = syscall.Signal(0x1f) SIGXRES = syscall.Signal(0x26) ) // Error table var errorList = [...]struct { num syscall.Errno name string desc string }{ {1, "EPERM", "not owner"}, {2, "ENOENT", "no such file or directory"}, {3, "ESRCH", "no such process"}, {4, "EINTR", "interrupted system call"}, {5, "EIO", "I/O error"}, {6, "ENXIO", "no such device or address"}, {7, "E2BIG", "arg list too long"}, {8, "ENOEXEC", "exec format error"}, {9, "EBADF", "bad file number"}, {10, "ECHILD", "no child processes"}, {11, "EAGAIN", "resource temporarily unavailable"}, {12, "ENOMEM", "not enough space"}, {13, "EACCES", "permission denied"}, {14, "EFAULT", "bad address"}, {15, "ENOTBLK", "block device required"}, {16, "EBUSY", "device busy"}, {17, "EEXIST", "file exists"}, {18, "EXDEV", "cross-device link"}, {19, "ENODEV", "no such device"}, {20, "ENOTDIR", "not a directory"}, {21, "EISDIR", "is a directory"}, {22, "EINVAL", "invalid argument"}, {23, "ENFILE", "file table overflow"}, {24, "EMFILE", "too many open files"}, {25, "ENOTTY", "inappropriate ioctl for device"}, {26, "ETXTBSY", "text file busy"}, {27, "EFBIG", "file too large"}, {28, "ENOSPC", "no space left on device"}, {29, "ESPIPE", "illegal seek"}, {30, "EROFS", "read-only file system"}, {31, "EMLINK", "too many links"}, {32, "EPIPE", "broken pipe"}, {33, "EDOM", "argument out of domain"}, {34, "ERANGE", "result too large"}, {35, "ENOMSG", "no message of desired type"}, {36, "EIDRM", "identifier removed"}, {37, "ECHRNG", "channel number out of range"}, {38, "EL2NSYNC", "level 2 not synchronized"}, {39, "EL3HLT", "level 3 halted"}, {40, "EL3RST", "level 3 reset"}, {41, "ELNRNG", "link number out of range"}, {42, "EUNATCH", "protocol driver not attached"}, {43, "ENOCSI", "no CSI structure available"}, {44, "EL2HLT", "level 2 halted"}, {45, "EDEADLK", "deadlock situation detected/avoided"}, {46, "ENOLCK", "no record locks available"}, {47, "ECANCELED", "operation canceled"}, {48, "ENOTSUP", "operation not supported"}, {49, "EDQUOT", "disc quota exceeded"}, {50, "EBADE", "bad exchange descriptor"}, {51, "EBADR", "bad request descriptor"}, {52, "EXFULL", "message tables full"}, {53, "ENOANO", "anode table overflow"}, {54, "EBADRQC", "bad request code"}, {55, "EBADSLT", "invalid slot"}, {56, "EDEADLOCK", "file locking deadlock"}, {57, "EBFONT", "bad font file format"}, {58, "EOWNERDEAD", "owner of the lock died"}, {59, "ENOTRECOVERABLE", "lock is not recoverable"}, {60, "ENOSTR", "not a stream device"}, {61, "ENODATA", "no data available"}, {62, "ETIME", "timer expired"}, {63, "ENOSR", "out of stream resources"}, {64, "ENONET", "machine is not on the network"}, {65, "ENOPKG", "package not installed"}, {66, "EREMOTE", "object is remote"}, {67, "ENOLINK", "link has been severed"}, {68, "EADV", "advertise error"}, {69, "ESRMNT", "srmount error"}, {70, "ECOMM", "communication error on send"}, {71, "EPROTO", "protocol error"}, {72, "ELOCKUNMAPPED", "locked lock was unmapped "}, {73, "ENOTACTIVE", "facility is not active"}, {74, "EMULTIHOP", "multihop attempted"}, {77, "EBADMSG", "not a data message"}, {78, "ENAMETOOLONG", "file name too long"}, {79, "EOVERFLOW", "value too large for defined data type"}, {80, "ENOTUNIQ", "name not unique on network"}, {81, "EBADFD", "file descriptor in bad state"}, {82, "EREMCHG", "remote address changed"}, {83, "ELIBACC", "can not access a needed shared library"}, {84, "ELIBBAD", "accessing a corrupted shared library"}, {85, "ELIBSCN", ".lib section in a.out corrupted"}, {86, "ELIBMAX", "attempting to link in more shared libraries than system limit"}, {87, "ELIBEXEC", "can not exec a shared library directly"}, {88, "EILSEQ", "illegal byte sequence"}, {89, "ENOSYS", "operation not applicable"}, {90, "ELOOP", "number of symbolic links encountered during path name traversal exceeds MAXSYMLINKS"}, {91, "ERESTART", "error 91"}, {92, "ESTRPIPE", "error 92"}, {93, "ENOTEMPTY", "directory not empty"}, {94, "EUSERS", "too many users"}, {95, "ENOTSOCK", "socket operation on non-socket"}, {96, "EDESTADDRREQ", "destination address required"}, {97, "EMSGSIZE", "message too long"}, {98, "EPROTOTYPE", "protocol wrong type for socket"}, {99, "ENOPROTOOPT", "option not supported by protocol"}, {120, "EPROTONOSUPPORT", "protocol not supported"}, {121, "ESOCKTNOSUPPORT", "socket type not supported"}, {122, "EOPNOTSUPP", "operation not supported on transport endpoint"}, {123, "EPFNOSUPPORT", "protocol family not supported"}, {124, "EAFNOSUPPORT", "address family not supported by protocol family"}, {125, "EADDRINUSE", "address already in use"}, {126, "EADDRNOTAVAIL", "cannot assign requested address"}, {127, "ENETDOWN", "network is down"}, {128, "ENETUNREACH", "network is unreachable"}, {129, "ENETRESET", "network dropped connection because of reset"}, {130, "ECONNABORTED", "software caused connection abort"}, {131, "ECONNRESET", "connection reset by peer"}, {132, "ENOBUFS", "no buffer space available"}, {133, "EISCONN", "transport endpoint is already connected"}, {134, "ENOTCONN", "transport endpoint is not connected"}, {143, "ESHUTDOWN", "cannot send after socket shutdown"}, {144, "ETOOMANYREFS", "too many references: cannot splice"}, {145, "ETIMEDOUT", "connection timed out"}, {146, "ECONNREFUSED", "connection refused"}, {147, "EHOSTDOWN", "host is down"}, {148, "EHOSTUNREACH", "no route to host"}, {149, "EALREADY", "operation already in progress"}, {150, "EINPROGRESS", "operation now in progress"}, {151, "ESTALE", "stale NFS file handle"}, } // Signal table var signalList = [...]struct { num syscall.Signal name string desc string }{ {1, "SIGHUP", "hangup"}, {2, "SIGINT", "interrupt"}, {3, "SIGQUIT", "quit"}, {4, "SIGILL", "illegal Instruction"}, {5, "SIGTRAP", "trace/Breakpoint Trap"}, {6, "SIGABRT", "abort"}, {7, "SIGEMT", "emulation Trap"}, {8, "SIGFPE", "arithmetic Exception"}, {9, "SIGKILL", "killed"}, {10, "SIGBUS", "bus Error"}, {11, "SIGSEGV", "segmentation Fault"}, {12, "SIGSYS", "bad System Call"}, {13, "SIGPIPE", "broken Pipe"}, {14, "SIGALRM", "alarm Clock"}, {15, "SIGTERM", "terminated"}, {16, "SIGUSR1", "user Signal 1"}, {17, "SIGUSR2", "user Signal 2"}, {18, "SIGCHLD", "child Status Changed"}, {19, "SIGPWR", "power-Fail/Restart"}, {20, "SIGWINCH", "window Size Change"}, {21, "SIGURG", "urgent Socket Condition"}, {22, "SIGIO", "pollable Event"}, {23, "SIGSTOP", "stopped (signal)"}, {24, "SIGTSTP", "stopped (user)"}, {25, "SIGCONT", "continued"}, {26, "SIGTTIN", "stopped (tty input)"}, {27, "SIGTTOU", "stopped (tty output)"}, {28, "SIGVTALRM", "virtual Timer Expired"}, {29, "SIGPROF", "profiling Timer Expired"}, {30, "SIGXCPU", "cpu Limit Exceeded"}, {31, "SIGXFSZ", "file Size Limit Exceeded"}, {32, "SIGWAITING", "no runnable lwp"}, {33, "SIGLWP", "inter-lwp signal"}, {34, "SIGFREEZE", "checkpoint Freeze"}, {35, "SIGTHAW", "checkpoint Thaw"}, {36, "SIGCANCEL", "thread Cancellation"}, {37, "SIGLOST", "resource Lost"}, {38, "SIGXRES", "resource Control Exceeded"}, {39, "SIGJVM1", "reserved for JVM 1"}, {40, "SIGJVM2", "reserved for JVM 2"}, {41, "SIGINFO", "information Request"}, } ================================================ FILE: vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go ================================================ // Copyright 2020 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build zos && s390x // Hand edited based on zerrors_linux_s390x.go // TODO: auto-generate. package unix const ( BRKINT = 0x0001 CLOCAL = 0x1 CLOCK_MONOTONIC = 0x1 CLOCK_PROCESS_CPUTIME_ID = 0x2 CLOCK_REALTIME = 0x0 CLOCK_THREAD_CPUTIME_ID = 0x3 CLONE_NEWIPC = 0x08000000 CLONE_NEWNET = 0x40000000 CLONE_NEWNS = 0x00020000 CLONE_NEWPID = 0x20000000 CLONE_NEWUTS = 0x04000000 CLONE_PARENT = 0x00008000 CS8 = 0x0030 CSIZE = 0x0030 ECHO = 0x00000008 ECHONL = 0x00000001 EFD_SEMAPHORE = 0x00002000 EFD_CLOEXEC = 0x00001000 EFD_NONBLOCK = 0x00000004 EPOLL_CLOEXEC = 0x00001000 EPOLL_CTL_ADD = 0 EPOLL_CTL_MOD = 1 EPOLL_CTL_DEL = 2 EPOLLRDNORM = 0x0001 EPOLLRDBAND = 0x0002 EPOLLIN = 0x0003 EPOLLOUT = 0x0004 EPOLLWRBAND = 0x0008 EPOLLPRI = 0x0010 EPOLLERR = 0x0020 EPOLLHUP = 0x0040 EPOLLEXCLUSIVE = 0x20000000 EPOLLONESHOT = 0x40000000 FD_CLOEXEC = 0x01 FD_CLOFORK = 0x02 FD_SETSIZE = 0x800 FNDELAY = 0x04 F_CLOSFD = 9 F_CONTROL_CVT = 13 F_DUPFD = 0 F_DUPFD2 = 8 F_GETFD = 1 F_GETFL = 259 F_GETLK = 5 F_GETOWN = 10 F_OK = 0x0 F_RDLCK = 1 F_SETFD = 2 F_SETFL = 4 F_SETLK = 6 F_SETLKW = 7 F_SETOWN = 11 F_SETTAG = 12 F_UNLCK = 3 F_WRLCK = 2 FSTYPE_ZFS = 0xe9 //"Z" FSTYPE_HFS = 0xc8 //"H" FSTYPE_NFS = 0xd5 //"N" FSTYPE_TFS = 0xe3 //"T" FSTYPE_AUTOMOUNT = 0xc1 //"A" GRND_NONBLOCK = 1 GRND_RANDOM = 2 HUPCL = 0x0100 // Hang up on last close IN_CLOEXEC = 0x00001000 IN_NONBLOCK = 0x00000004 IN_ACCESS = 0x00000001 IN_MODIFY = 0x00000002 IN_ATTRIB = 0x00000004 IN_CLOSE_WRITE = 0x00000008 IN_CLOSE_NOWRITE = 0x00000010 IN_OPEN = 0x00000020 IN_MOVED_FROM = 0x00000040 IN_MOVED_TO = 0x00000080 IN_CREATE = 0x00000100 IN_DELETE = 0x00000200 IN_DELETE_SELF = 0x00000400 IN_MOVE_SELF = 0x00000800 IN_UNMOUNT = 0x00002000 IN_Q_OVERFLOW = 0x00004000 IN_IGNORED = 0x00008000 IN_CLOSE = (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) IN_MOVE = (IN_MOVED_FROM | IN_MOVED_TO) IN_ALL_EVENTS = (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE | IN_OPEN | IN_MOVE | IN_CREATE | IN_DELETE | IN_DELETE_SELF | IN_MOVE_SELF) IN_ONLYDIR = 0x01000000 IN_DONT_FOLLOW = 0x02000000 IN_EXCL_UNLINK = 0x04000000 IN_MASK_CREATE = 0x10000000 IN_MASK_ADD = 0x20000000 IN_ISDIR = 0x40000000 IN_ONESHOT = 0x80000000 IP6F_MORE_FRAG = 0x0001 IP6F_OFF_MASK = 0xfff8 IP6F_RESERVED_MASK = 0x0006 IP6OPT_JUMBO = 0xc2 IP6OPT_JUMBO_LEN = 6 IP6OPT_MUTABLE = 0x20 IP6OPT_NSAP_ADDR = 0xc3 IP6OPT_PAD1 = 0x00 IP6OPT_PADN = 0x01 IP6OPT_ROUTER_ALERT = 0x05 IP6OPT_TUNNEL_LIMIT = 0x04 IP6OPT_TYPE_DISCARD = 0x40 IP6OPT_TYPE_FORCEICMP = 0x80 IP6OPT_TYPE_ICMP = 0xc0 IP6OPT_TYPE_SKIP = 0x00 IP6_ALERT_AN = 0x0002 IP6_ALERT_MLD = 0x0000 IP6_ALERT_RSVP = 0x0001 IPPORT_RESERVED = 1024 IPPORT_USERRESERVED = 5000 IPPROTO_AH = 51 SOL_AH = 51 IPPROTO_DSTOPTS = 60 SOL_DSTOPTS = 60 IPPROTO_EGP = 8 SOL_EGP = 8 IPPROTO_ESP = 50 SOL_ESP = 50 IPPROTO_FRAGMENT = 44 SOL_FRAGMENT = 44 IPPROTO_GGP = 2 SOL_GGP = 2 IPPROTO_HOPOPTS = 0 SOL_HOPOPTS = 0 IPPROTO_ICMP = 1 SOL_ICMP = 1 IPPROTO_ICMPV6 = 58 SOL_ICMPV6 = 58 IPPROTO_IDP = 22 SOL_IDP = 22 IPPROTO_IP = 0 SOL_IP = 0 IPPROTO_IPV6 = 41 SOL_IPV6 = 41 IPPROTO_MAX = 256 SOL_MAX = 256 IPPROTO_NONE = 59 SOL_NONE = 59 IPPROTO_PUP = 12 SOL_PUP = 12 IPPROTO_RAW = 255 SOL_RAW = 255 IPPROTO_ROUTING = 43 SOL_ROUTING = 43 IPPROTO_TCP = 6 SOL_TCP = 6 IPPROTO_UDP = 17 SOL_UDP = 17 IPV6_ADDR_PREFERENCES = 32 IPV6_CHECKSUM = 19 IPV6_DONTFRAG = 29 IPV6_DSTOPTS = 23 IPV6_HOPLIMIT = 11 IPV6_HOPOPTS = 22 IPV6_JOIN_GROUP = 5 IPV6_LEAVE_GROUP = 6 IPV6_MULTICAST_HOPS = 9 IPV6_MULTICAST_IF = 7 IPV6_MULTICAST_LOOP = 4 IPV6_NEXTHOP = 20 IPV6_PATHMTU = 12 IPV6_PKTINFO = 13 IPV6_PREFER_SRC_CGA = 0x10 IPV6_PREFER_SRC_COA = 0x02 IPV6_PREFER_SRC_HOME = 0x01 IPV6_PREFER_SRC_NONCGA = 0x20 IPV6_PREFER_SRC_PUBLIC = 0x08 IPV6_PREFER_SRC_TMP = 0x04 IPV6_RECVDSTOPTS = 28 IPV6_RECVHOPLIMIT = 14 IPV6_RECVHOPOPTS = 26 IPV6_RECVPATHMTU = 16 IPV6_RECVPKTINFO = 15 IPV6_RECVRTHDR = 25 IPV6_RECVTCLASS = 31 IPV6_RTHDR = 21 IPV6_RTHDRDSTOPTS = 24 IPV6_RTHDR_TYPE_0 = 0 IPV6_TCLASS = 30 IPV6_UNICAST_HOPS = 3 IPV6_USE_MIN_MTU = 18 IPV6_V6ONLY = 10 IP_ADD_MEMBERSHIP = 5 IP_ADD_SOURCE_MEMBERSHIP = 12 IP_BLOCK_SOURCE = 10 IP_DEFAULT_MULTICAST_LOOP = 1 IP_DEFAULT_MULTICAST_TTL = 1 IP_DROP_MEMBERSHIP = 6 IP_DROP_SOURCE_MEMBERSHIP = 13 IP_MAX_MEMBERSHIPS = 20 IP_MULTICAST_IF = 7 IP_MULTICAST_LOOP = 4 IP_MULTICAST_TTL = 3 IP_OPTIONS = 1 IP_PKTINFO = 101 IP_RECVPKTINFO = 102 IP_TOS = 2 IP_TTL = 14 IP_UNBLOCK_SOURCE = 11 ICMP6_FILTER = 1 MCAST_INCLUDE = 0 MCAST_EXCLUDE = 1 MCAST_JOIN_GROUP = 40 MCAST_LEAVE_GROUP = 41 MCAST_JOIN_SOURCE_GROUP = 42 MCAST_LEAVE_SOURCE_GROUP = 43 MCAST_BLOCK_SOURCE = 44 MCAST_UNBLOCK_SOURCE = 46 ICANON = 0x0010 ICRNL = 0x0002 IEXTEN = 0x0020 IGNBRK = 0x0004 IGNCR = 0x0008 INLCR = 0x0020 ISIG = 0x0040 ISTRIP = 0x0080 IXON = 0x0200 IXOFF = 0x0100 LOCK_SH = 0x1 LOCK_EX = 0x2 LOCK_NB = 0x4 LOCK_UN = 0x8 POLLIN = 0x0003 POLLOUT = 0x0004 POLLPRI = 0x0010 POLLERR = 0x0020 POLLHUP = 0x0040 POLLNVAL = 0x0080 PROT_READ = 0x1 // mmap - page can be read PROT_WRITE = 0x2 // page can be written PROT_NONE = 0x4 // can't be accessed PROT_EXEC = 0x8 // can be executed MAP_PRIVATE = 0x1 // changes are private MAP_SHARED = 0x2 // changes are shared MAP_FIXED = 0x4 // place exactly __MAP_MEGA = 0x8 __MAP_64 = 0x10 MAP_ANON = 0x20 MAP_ANONYMOUS = 0x20 MS_SYNC = 0x1 // msync - synchronous writes MS_ASYNC = 0x2 // asynchronous writes MS_INVALIDATE = 0x4 // invalidate mappings MS_BIND = 0x00001000 MS_MOVE = 0x00002000 MS_NOSUID = 0x00000002 MS_PRIVATE = 0x00040000 MS_REC = 0x00004000 MS_REMOUNT = 0x00008000 MS_RDONLY = 0x00000001 MS_UNBINDABLE = 0x00020000 MNT_DETACH = 0x00000004 ZOSDSFS_SUPER_MAGIC = 0x44534653 // zOS DSFS NFS_SUPER_MAGIC = 0x6969 // NFS NSFS_MAGIC = 0x6e736673 // PROCNS PROC_SUPER_MAGIC = 0x9fa0 // proc FS ZOSTFS_SUPER_MAGIC = 0x544653 // zOS TFS ZOSUFS_SUPER_MAGIC = 0x554653 // zOS UFS ZOSZFS_SUPER_MAGIC = 0x5A4653 // zOS ZFS MTM_RDONLY = 0x80000000 MTM_RDWR = 0x40000000 MTM_UMOUNT = 0x10000000 MTM_IMMED = 0x08000000 MTM_FORCE = 0x04000000 MTM_DRAIN = 0x02000000 MTM_RESET = 0x01000000 MTM_SAMEMODE = 0x00100000 MTM_UNQSEFORCE = 0x00040000 MTM_NOSUID = 0x00000400 MTM_SYNCHONLY = 0x00000200 MTM_REMOUNT = 0x00000100 MTM_NOSECURITY = 0x00000080 NFDBITS = 0x20 ONLRET = 0x0020 // NL performs CR function O_ACCMODE = 0x03 O_APPEND = 0x08 O_ASYNCSIG = 0x0200 O_CREAT = 0x80 O_DIRECT = 0x00002000 O_NOFOLLOW = 0x00004000 O_DIRECTORY = 0x00008000 O_PATH = 0x00080000 O_CLOEXEC = 0x00001000 O_EXCL = 0x40 O_GETFL = 0x0F O_LARGEFILE = 0x0400 O_NDELAY = 0x4 O_NONBLOCK = 0x04 O_RDONLY = 0x02 O_RDWR = 0x03 O_SYNC = 0x0100 O_TRUNC = 0x10 O_WRONLY = 0x01 O_NOCTTY = 0x20 OPOST = 0x0001 ONLCR = 0x0004 PARENB = 0x0200 PARMRK = 0x0400 QUERYCVT = 3 RUSAGE_CHILDREN = -0x1 RUSAGE_SELF = 0x0 // RUSAGE_THREAD unsupported on z/OS SEEK_CUR = 1 SEEK_END = 2 SEEK_SET = 0 SETAUTOCVTALL = 5 SETAUTOCVTON = 2 SETCVTALL = 4 SETCVTOFF = 0 SETCVTON = 1 AF_APPLETALK = 16 AF_CCITT = 10 AF_CHAOS = 5 AF_DATAKIT = 9 AF_DLI = 13 AF_ECMA = 8 AF_HYLINK = 15 AF_IMPLINK = 3 AF_INET = 2 AF_INET6 = 19 AF_INTF = 20 AF_IUCV = 17 AF_LAT = 14 AF_LINK = 18 AF_LOCAL = AF_UNIX // AF_LOCAL is an alias for AF_UNIX AF_MAX = 30 AF_NBS = 7 AF_NDD = 23 AF_NETWARE = 22 AF_NS = 6 AF_PUP = 4 AF_RIF = 21 AF_ROUTE = 20 AF_SNA = 11 AF_UNIX = 1 AF_UNSPEC = 0 IBMTCP_IMAGE = 1 MSG_ACK_EXPECTED = 0x10 MSG_ACK_GEN = 0x40 MSG_ACK_TIMEOUT = 0x20 MSG_CONNTERM = 0x80 MSG_CTRUNC = 0x20 MSG_DONTROUTE = 0x4 MSG_EOF = 0x8000 MSG_EOR = 0x8 MSG_MAXIOVLEN = 16 MSG_NONBLOCK = 0x4000 MSG_OOB = 0x1 MSG_PEEK = 0x2 MSG_TRUNC = 0x10 MSG_WAITALL = 0x40 PRIO_PROCESS = 1 PRIO_PGRP = 2 PRIO_USER = 3 RLIMIT_CPU = 0 RLIMIT_FSIZE = 1 RLIMIT_DATA = 2 RLIMIT_STACK = 3 RLIMIT_CORE = 4 RLIMIT_AS = 5 RLIMIT_NOFILE = 6 RLIMIT_MEMLIMIT = 7 RLIMIT_MEMLOCK = 0x8 RLIM_INFINITY = 2147483647 SCHED_FIFO = 0x2 SCM_CREDENTIALS = 0x2 SCM_RIGHTS = 0x01 SF_CLOSE = 0x00000002 SF_REUSE = 0x00000001 SHM_RND = 0x2 SHM_RDONLY = 0x1 SHMLBA = 0x1000 IPC_STAT = 0x3 IPC_SET = 0x2 IPC_RMID = 0x1 IPC_PRIVATE = 0x0 IPC_CREAT = 0x1000000 __IPC_MEGA = 0x4000000 __IPC_SHAREAS = 0x20000000 __IPC_BELOWBAR = 0x10000000 IPC_EXCL = 0x2000000 __IPC_GIGA = 0x8000000 SHUT_RD = 0 SHUT_RDWR = 2 SHUT_WR = 1 SOCK_CLOEXEC = 0x00001000 SOCK_CONN_DGRAM = 6 SOCK_DGRAM = 2 SOCK_NONBLOCK = 0x800 SOCK_RAW = 3 SOCK_RDM = 4 SOCK_SEQPACKET = 5 SOCK_STREAM = 1 SOL_SOCKET = 0xffff SOMAXCONN = 10 SO_ACCEPTCONN = 0x0002 SO_ACCEPTECONNABORTED = 0x0006 SO_ACKNOW = 0x7700 SO_BROADCAST = 0x0020 SO_BULKMODE = 0x8000 SO_CKSUMRECV = 0x0800 SO_CLOSE = 0x01 SO_CLUSTERCONNTYPE = 0x00004001 SO_CLUSTERCONNTYPE_INTERNAL = 8 SO_CLUSTERCONNTYPE_NOCONN = 0 SO_CLUSTERCONNTYPE_NONE = 1 SO_CLUSTERCONNTYPE_SAME_CLUSTER = 2 SO_CLUSTERCONNTYPE_SAME_IMAGE = 4 SO_DEBUG = 0x0001 SO_DONTROUTE = 0x0010 SO_ERROR = 0x1007 SO_IGNOREINCOMINGPUSH = 0x1 SO_IGNORESOURCEVIPA = 0x0002 SO_KEEPALIVE = 0x0008 SO_LINGER = 0x0080 SO_NONBLOCKLOCAL = 0x8001 SO_NOREUSEADDR = 0x1000 SO_OOBINLINE = 0x0100 SO_OPTACK = 0x8004 SO_OPTMSS = 0x8003 SO_RCVBUF = 0x1002 SO_RCVLOWAT = 0x1004 SO_RCVTIMEO = 0x1006 SO_REUSEADDR = 0x0004 SO_REUSEPORT = 0x0200 SO_SECINFO = 0x00004002 SO_SET = 0x0200 SO_SNDBUF = 0x1001 SO_SNDLOWAT = 0x1003 SO_SNDTIMEO = 0x1005 SO_TYPE = 0x1008 SO_UNSET = 0x0400 SO_USELOOPBACK = 0x0040 SO_USE_IFBUFS = 0x0400 S_ISUID = 0x0800 S_ISGID = 0x0400 S_ISVTX = 0x0200 S_IRUSR = 0x0100 S_IWUSR = 0x0080 S_IXUSR = 0x0040 S_IRWXU = 0x01C0 S_IRGRP = 0x0020 S_IWGRP = 0x0010 S_IXGRP = 0x0008 S_IRWXG = 0x0038 S_IROTH = 0x0004 S_IWOTH = 0x0002 S_IXOTH = 0x0001 S_IRWXO = 0x0007 S_IREAD = S_IRUSR S_IWRITE = S_IWUSR S_IEXEC = S_IXUSR S_IFDIR = 0x01000000 S_IFCHR = 0x02000000 S_IFREG = 0x03000000 S_IFFIFO = 0x04000000 S_IFIFO = 0x04000000 S_IFLNK = 0x05000000 S_IFBLK = 0x06000000 S_IFSOCK = 0x07000000 S_IFVMEXTL = 0xFE000000 S_IFVMEXTL_EXEC = 0x00010000 S_IFVMEXTL_DATA = 0x00020000 S_IFVMEXTL_MEL = 0x00030000 S_IFEXTL = 0x00000001 S_IFPROGCTL = 0x00000002 S_IFAPFCTL = 0x00000004 S_IFNOSHARE = 0x00000008 S_IFSHARELIB = 0x00000010 S_IFMT = 0xFF000000 S_IFMST = 0x00FF0000 TCP_KEEPALIVE = 0x8 TCP_NODELAY = 0x1 TIOCGWINSZ = 0x4008a368 TIOCSWINSZ = 0x8008a367 TIOCSBRK = 0x2000a77b TIOCCBRK = 0x2000a77a TIOCSTI = 0x8001a772 TIOCGPGRP = 0x4004a777 // _IOR(167, 119, int) TCSANOW = 0 TCSETS = 0 // equivalent to TCSANOW for tcsetattr TCSADRAIN = 1 TCSETSW = 1 // equivalent to TCSADRAIN for tcsetattr TCSAFLUSH = 2 TCSETSF = 2 // equivalent to TCSAFLUSH for tcsetattr TCGETS = 3 // not defined in ioctl.h -- zos golang only TCIFLUSH = 0 TCOFLUSH = 1 TCIOFLUSH = 2 TCOOFF = 0 TCOON = 1 TCIOFF = 2 TCION = 3 TIOCSPGRP = 0x8004a776 TIOCNOTTY = 0x2000a771 TIOCEXCL = 0x2000a70d TIOCNXCL = 0x2000a70e TIOCGETD = 0x4004a700 TIOCSETD = 0x8004a701 TIOCPKT = 0x8004a770 TIOCSTOP = 0x2000a76f TIOCSTART = 0x2000a76e TIOCUCNTL = 0x8004a766 TIOCREMOTE = 0x8004a769 TIOCMGET = 0x4004a76a TIOCMSET = 0x8004a76d TIOCMBIC = 0x8004a76b TIOCMBIS = 0x8004a76c VINTR = 0 VQUIT = 1 VERASE = 2 VKILL = 3 VEOF = 4 VEOL = 5 VMIN = 6 VSTART = 7 VSTOP = 8 VSUSP = 9 VTIME = 10 WCONTINUED = 0x4 WEXITED = 0x8 WNOHANG = 0x1 WNOWAIT = 0x20 WSTOPPED = 0x10 WUNTRACED = 0x2 _BPX_SWAP = 1 _BPX_NONSWAP = 2 MCL_CURRENT = 1 // for Linux compatibility -- no zos semantics MCL_FUTURE = 2 // for Linux compatibility -- no zos semantics MCL_ONFAULT = 3 // for Linux compatibility -- no zos semantics MADV_NORMAL = 0 // for Linux compatibility -- no zos semantics MADV_RANDOM = 1 // for Linux compatibility -- no zos semantics MADV_SEQUENTIAL = 2 // for Linux compatibility -- no zos semantics MADV_WILLNEED = 3 // for Linux compatibility -- no zos semantics MADV_REMOVE = 4 // for Linux compatibility -- no zos semantics MADV_DONTFORK = 5 // for Linux compatibility -- no zos semantics MADV_DOFORK = 6 // for Linux compatibility -- no zos semantics MADV_HWPOISON = 7 // for Linux compatibility -- no zos semantics MADV_MERGEABLE = 8 // for Linux compatibility -- no zos semantics MADV_UNMERGEABLE = 9 // for Linux compatibility -- no zos semantics MADV_SOFT_OFFLINE = 10 // for Linux compatibility -- no zos semantics MADV_HUGEPAGE = 11 // for Linux compatibility -- no zos semantics MADV_NOHUGEPAGE = 12 // for Linux compatibility -- no zos semantics MADV_DONTDUMP = 13 // for Linux compatibility -- no zos semantics MADV_DODUMP = 14 // for Linux compatibility -- no zos semantics MADV_FREE = 15 // for Linux compatibility -- no zos semantics MADV_WIPEONFORK = 16 // for Linux compatibility -- no zos semantics MADV_KEEPONFORK = 17 // for Linux compatibility -- no zos semantics AT_SYMLINK_FOLLOW = 0x400 AT_SYMLINK_NOFOLLOW = 0x100 XATTR_CREATE = 0x1 XATTR_REPLACE = 0x2 P_PID = 0 P_PGID = 1 P_ALL = 2 PR_SET_NAME = 15 PR_GET_NAME = 16 PR_SET_NO_NEW_PRIVS = 38 PR_GET_NO_NEW_PRIVS = 39 PR_SET_DUMPABLE = 4 PR_GET_DUMPABLE = 3 PR_SET_PDEATHSIG = 1 PR_GET_PDEATHSIG = 2 PR_SET_CHILD_SUBREAPER = 36 PR_GET_CHILD_SUBREAPER = 37 AT_FDCWD = -100 AT_EACCESS = 0x200 AT_EMPTY_PATH = 0x1000 AT_REMOVEDIR = 0x200 RENAME_NOREPLACE = 1 << 0 ST_RDONLY = 1 ST_NOSUID = 2 ) const ( EDOM = Errno(1) ERANGE = Errno(2) EACCES = Errno(111) EAGAIN = Errno(112) EBADF = Errno(113) EBUSY = Errno(114) ECHILD = Errno(115) EDEADLK = Errno(116) EEXIST = Errno(117) EFAULT = Errno(118) EFBIG = Errno(119) EINTR = Errno(120) EINVAL = Errno(121) EIO = Errno(122) EISDIR = Errno(123) EMFILE = Errno(124) EMLINK = Errno(125) ENAMETOOLONG = Errno(126) ENFILE = Errno(127) ENOATTR = Errno(265) ENODEV = Errno(128) ENOENT = Errno(129) ENOEXEC = Errno(130) ENOLCK = Errno(131) ENOMEM = Errno(132) ENOSPC = Errno(133) ENOSYS = Errno(134) ENOTDIR = Errno(135) ENOTEMPTY = Errno(136) ENOTTY = Errno(137) ENXIO = Errno(138) EPERM = Errno(139) EPIPE = Errno(140) EROFS = Errno(141) ESPIPE = Errno(142) ESRCH = Errno(143) EXDEV = Errno(144) E2BIG = Errno(145) ELOOP = Errno(146) EILSEQ = Errno(147) ENODATA = Errno(148) EOVERFLOW = Errno(149) EMVSNOTUP = Errno(150) ECMSSTORAGE = Errno(151) EMVSDYNALC = Errno(151) EMVSCVAF = Errno(152) EMVSCATLG = Errno(153) ECMSINITIAL = Errno(156) EMVSINITIAL = Errno(156) ECMSERR = Errno(157) EMVSERR = Errno(157) EMVSPARM = Errno(158) ECMSPFSFILE = Errno(159) EMVSPFSFILE = Errno(159) EMVSBADCHAR = Errno(160) ECMSPFSPERM = Errno(162) EMVSPFSPERM = Errno(162) EMVSSAFEXTRERR = Errno(163) EMVSSAF2ERR = Errno(164) EMVSTODNOTSET = Errno(165) EMVSPATHOPTS = Errno(166) EMVSNORTL = Errno(167) EMVSEXPIRE = Errno(168) EMVSPASSWORD = Errno(169) EMVSWLMERROR = Errno(170) EMVSCPLERROR = Errno(171) EMVSARMERROR = Errno(172) ELENOFORK = Errno(200) ELEMSGERR = Errno(201) EFPMASKINV = Errno(202) EFPMODEINV = Errno(203) EBUFLEN = Errno(227) EEXTLINK = Errno(228) ENODD = Errno(229) ECMSESMERR = Errno(230) ECPERR = Errno(231) ELEMULTITHREAD = Errno(232) ELEFENCE = Errno(244) EBADDATA = Errno(245) EUNKNOWN = Errno(246) ENOTSUP = Errno(247) EBADNAME = Errno(248) ENOTSAFE = Errno(249) ELEMULTITHREADFORK = Errno(257) ECUNNOENV = Errno(258) ECUNNOCONV = Errno(259) ECUNNOTALIGNED = Errno(260) ECUNERR = Errno(262) EIBMBADCALL = Errno(1000) EIBMBADPARM = Errno(1001) EIBMSOCKOUTOFRANGE = Errno(1002) EIBMSOCKINUSE = Errno(1003) EIBMIUCVERR = Errno(1004) EOFFLOADboxERROR = Errno(1005) EOFFLOADboxRESTART = Errno(1006) EOFFLOADboxDOWN = Errno(1007) EIBMCONFLICT = Errno(1008) EIBMCANCELLED = Errno(1009) EIBMBADTCPNAME = Errno(1011) ENOTBLK = Errno(1100) ETXTBSY = Errno(1101) EWOULDBLOCK = Errno(1102) EINPROGRESS = Errno(1103) EALREADY = Errno(1104) ENOTSOCK = Errno(1105) EDESTADDRREQ = Errno(1106) EMSGSIZE = Errno(1107) EPROTOTYPE = Errno(1108) ENOPROTOOPT = Errno(1109) EPROTONOSUPPORT = Errno(1110) ESOCKTNOSUPPORT = Errno(1111) EOPNOTSUPP = Errno(1112) EPFNOSUPPORT = Errno(1113) EAFNOSUPPORT = Errno(1114) EADDRINUSE = Errno(1115) EADDRNOTAVAIL = Errno(1116) ENETDOWN = Errno(1117) ENETUNREACH = Errno(1118) ENETRESET = Errno(1119) ECONNABORTED = Errno(1120) ECONNRESET = Errno(1121) ENOBUFS = Errno(1122) EISCONN = Errno(1123) ENOTCONN = Errno(1124) ESHUTDOWN = Errno(1125) ETOOMANYREFS = Errno(1126) ETIMEDOUT = Errno(1127) ECONNREFUSED = Errno(1128) EHOSTDOWN = Errno(1129) EHOSTUNREACH = Errno(1130) EPROCLIM = Errno(1131) EUSERS = Errno(1132) EDQUOT = Errno(1133) ESTALE = Errno(1134) EREMOTE = Errno(1135) ENOSTR = Errno(1136) ETIME = Errno(1137) ENOSR = Errno(1138) ENOMSG = Errno(1139) EBADMSG = Errno(1140) EIDRM = Errno(1141) ENONET = Errno(1142) ERREMOTE = Errno(1143) ENOLINK = Errno(1144) EADV = Errno(1145) ESRMNT = Errno(1146) ECOMM = Errno(1147) EPROTO = Errno(1148) EMULTIHOP = Errno(1149) EDOTDOT = Errno(1150) EREMCHG = Errno(1151) ECANCELED = Errno(1152) EINTRNODATA = Errno(1159) ENOREUSE = Errno(1160) ENOMOVE = Errno(1161) ) // Signals const ( SIGHUP = Signal(1) SIGINT = Signal(2) SIGABRT = Signal(3) SIGILL = Signal(4) SIGPOLL = Signal(5) SIGURG = Signal(6) SIGSTOP = Signal(7) SIGFPE = Signal(8) SIGKILL = Signal(9) SIGBUS = Signal(10) SIGSEGV = Signal(11) SIGSYS = Signal(12) SIGPIPE = Signal(13) SIGALRM = Signal(14) SIGTERM = Signal(15) SIGUSR1 = Signal(16) SIGUSR2 = Signal(17) SIGABND = Signal(18) SIGCONT = Signal(19) SIGCHLD = Signal(20) SIGTTIN = Signal(21) SIGTTOU = Signal(22) SIGIO = Signal(23) SIGQUIT = Signal(24) SIGTSTP = Signal(25) SIGTRAP = Signal(26) SIGIOERR = Signal(27) SIGWINCH = Signal(28) SIGXCPU = Signal(29) SIGXFSZ = Signal(30) SIGVTALRM = Signal(31) SIGPROF = Signal(32) SIGDANGER = Signal(33) SIGTHSTOP = Signal(34) SIGTHCONT = Signal(35) SIGTRACE = Signal(37) SIGDCE = Signal(38) SIGDUMP = Signal(39) ) // Error table var errorList = [...]struct { num Errno name string desc string }{ {1, "EDC5001I", "A domain error occurred."}, {2, "EDC5002I", "A range error occurred."}, {111, "EDC5111I", "Permission denied."}, {112, "EDC5112I", "Resource temporarily unavailable."}, {113, "EDC5113I", "Bad file descriptor."}, {114, "EDC5114I", "Resource busy."}, {115, "EDC5115I", "No child processes."}, {116, "EDC5116I", "Resource deadlock avoided."}, {117, "EDC5117I", "File exists."}, {118, "EDC5118I", "Incorrect address."}, {119, "EDC5119I", "File too large."}, {120, "EDC5120I", "Interrupted function call."}, {121, "EDC5121I", "Invalid argument."}, {122, "EDC5122I", "Input/output error."}, {123, "EDC5123I", "Is a directory."}, {124, "EDC5124I", "Too many open files."}, {125, "EDC5125I", "Too many links."}, {126, "EDC5126I", "Filename too long."}, {127, "EDC5127I", "Too many open files in system."}, {128, "EDC5128I", "No such device."}, {129, "EDC5129I", "No such file or directory."}, {130, "EDC5130I", "Exec format error."}, {131, "EDC5131I", "No locks available."}, {132, "EDC5132I", "Not enough memory."}, {133, "EDC5133I", "No space left on device."}, {134, "EDC5134I", "Function not implemented."}, {135, "EDC5135I", "Not a directory."}, {136, "EDC5136I", "Directory not empty."}, {137, "EDC5137I", "Inappropriate I/O control operation."}, {138, "EDC5138I", "No such device or address."}, {139, "EDC5139I", "Operation not permitted."}, {140, "EDC5140I", "Broken pipe."}, {141, "EDC5141I", "Read-only file system."}, {142, "EDC5142I", "Invalid seek."}, {143, "EDC5143I", "No such process."}, {144, "EDC5144I", "Improper link."}, {145, "EDC5145I", "The parameter list is too long, or the message to receive was too large for the buffer."}, {146, "EDC5146I", "Too many levels of symbolic links."}, {147, "EDC5147I", "Illegal byte sequence."}, {148, "EDC5148I", "The named attribute or data not available."}, {149, "EDC5149I", "Value Overflow Error."}, {150, "EDC5150I", "UNIX System Services is not active."}, {151, "EDC5151I", "Dynamic allocation error."}, {152, "EDC5152I", "Common VTOC access facility (CVAF) error."}, {153, "EDC5153I", "Catalog obtain error."}, {156, "EDC5156I", "Process initialization error."}, {157, "EDC5157I", "An internal error has occurred."}, {158, "EDC5158I", "Bad parameters were passed to the service."}, {159, "EDC5159I", "The Physical File System encountered a permanent file error."}, {160, "EDC5160I", "Bad character in environment variable name."}, {162, "EDC5162I", "The Physical File System encountered a system error."}, {163, "EDC5163I", "SAF/RACF extract error."}, {164, "EDC5164I", "SAF/RACF error."}, {165, "EDC5165I", "System TOD clock not set."}, {166, "EDC5166I", "Access mode argument on function call conflicts with PATHOPTS parameter on JCL DD statement."}, {167, "EDC5167I", "Access to the UNIX System Services version of the C RTL is denied."}, {168, "EDC5168I", "Password has expired."}, {169, "EDC5169I", "Password is invalid."}, {170, "EDC5170I", "An error was encountered with WLM."}, {171, "EDC5171I", "An error was encountered with CPL."}, {172, "EDC5172I", "An error was encountered with Application Response Measurement (ARM) component."}, {200, "EDC5200I", "The application contains a Language Environment member language that cannot tolerate a fork()."}, {201, "EDC5201I", "The Language Environment message file was not found in the hierarchical file system."}, {202, "EDC5202E", "DLL facilities are not supported under SPC environment."}, {203, "EDC5203E", "DLL facilities are not supported under POSIX environment."}, {227, "EDC5227I", "Buffer is not long enough to contain a path definition"}, {228, "EDC5228I", "The file referred to is an external link"}, {229, "EDC5229I", "No path definition for ddname in effect"}, {230, "EDC5230I", "ESM error."}, {231, "EDC5231I", "CP or the external security manager had an error"}, {232, "EDC5232I", "The function failed because it was invoked from a multithread environment."}, {244, "EDC5244I", "The program, module or DLL is not supported in this environment."}, {245, "EDC5245I", "Data is not valid."}, {246, "EDC5246I", "Unknown system state."}, {247, "EDC5247I", "Operation not supported."}, {248, "EDC5248I", "The object name specified is not correct."}, {249, "EDC5249I", "The function is not allowed."}, {257, "EDC5257I", "Function cannot be called in the child process of a fork() from a multithreaded process until exec() is called."}, {258, "EDC5258I", "A CUN_RS_NO_UNI_ENV error was issued by Unicode Services."}, {259, "EDC5259I", "A CUN_RS_NO_CONVERSION error was issued by Unicode Services."}, {260, "EDC5260I", "A CUN_RS_TABLE_NOT_ALIGNED error was issued by Unicode Services."}, {262, "EDC5262I", "An iconv() function encountered an unexpected error while using Unicode Services."}, {265, "EDC5265I", "The named attribute not available."}, {1000, "EDC8000I", "A bad socket-call constant was found in the IUCV header."}, {1001, "EDC8001I", "An error was found in the IUCV header."}, {1002, "EDC8002I", "A socket descriptor is out of range."}, {1003, "EDC8003I", "A socket descriptor is in use."}, {1004, "EDC8004I", "Request failed because of an IUCV error."}, {1005, "EDC8005I", "Offload box error."}, {1006, "EDC8006I", "Offload box restarted."}, {1007, "EDC8007I", "Offload box down."}, {1008, "EDC8008I", "Already a conflicting call outstanding on socket."}, {1009, "EDC8009I", "Request cancelled using a SOCKcallCANCEL request."}, {1011, "EDC8011I", "A name of a PFS was specified that either is not configured or is not a Sockets PFS."}, {1100, "EDC8100I", "Block device required."}, {1101, "EDC8101I", "Text file busy."}, {1102, "EDC8102I", "Operation would block."}, {1103, "EDC8103I", "Operation now in progress."}, {1104, "EDC8104I", "Connection already in progress."}, {1105, "EDC8105I", "Socket operation on non-socket."}, {1106, "EDC8106I", "Destination address required."}, {1107, "EDC8107I", "Message too long."}, {1108, "EDC8108I", "Protocol wrong type for socket."}, {1109, "EDC8109I", "Protocol not available."}, {1110, "EDC8110I", "Protocol not supported."}, {1111, "EDC8111I", "Socket type not supported."}, {1112, "EDC8112I", "Operation not supported on socket."}, {1113, "EDC8113I", "Protocol family not supported."}, {1114, "EDC8114I", "Address family not supported."}, {1115, "EDC8115I", "Address already in use."}, {1116, "EDC8116I", "Address not available."}, {1117, "EDC8117I", "Network is down."}, {1118, "EDC8118I", "Network is unreachable."}, {1119, "EDC8119I", "Network dropped connection on reset."}, {1120, "EDC8120I", "Connection ended abnormally."}, {1121, "EDC8121I", "Connection reset."}, {1122, "EDC8122I", "No buffer space available."}, {1123, "EDC8123I", "Socket already connected."}, {1124, "EDC8124I", "Socket not connected."}, {1125, "EDC8125I", "Can't send after socket shutdown."}, {1126, "EDC8126I", "Too many references; can't splice."}, {1127, "EDC8127I", "Connection timed out."}, {1128, "EDC8128I", "Connection refused."}, {1129, "EDC8129I", "Host is not available."}, {1130, "EDC8130I", "Host cannot be reached."}, {1131, "EDC8131I", "Too many processes."}, {1132, "EDC8132I", "Too many users."}, {1133, "EDC8133I", "Disk quota exceeded."}, {1134, "EDC8134I", "Stale file handle."}, {1135, "", ""}, {1136, "EDC8136I", "File is not a STREAM."}, {1137, "EDC8137I", "STREAMS ioctl() timeout."}, {1138, "EDC8138I", "No STREAMS resources."}, {1139, "EDC8139I", "The message identified by set_id and msg_id is not in the message catalog."}, {1140, "EDC8140I", "Bad message."}, {1141, "EDC8141I", "Identifier removed."}, {1142, "", ""}, {1143, "", ""}, {1144, "EDC8144I", "The link has been severed."}, {1145, "", ""}, {1146, "", ""}, {1147, "", ""}, {1148, "EDC8148I", "Protocol error."}, {1149, "EDC8149I", "Multihop not allowed."}, {1150, "", ""}, {1151, "", ""}, {1152, "EDC8152I", "The asynchronous I/O request has been canceled."}, {1159, "EDC8159I", "Function call was interrupted before any data was received."}, {1160, "EDC8160I", "Socket reuse is not supported."}, {1161, "EDC8161I", "The file system cannot currently be moved."}, } // Signal table var signalList = [...]struct { num Signal name string desc string }{ {1, "SIGHUP", "hangup"}, {2, "SIGINT", "interrupt"}, {3, "SIGABT", "aborted"}, {4, "SIGILL", "illegal instruction"}, {5, "SIGPOLL", "pollable event"}, {6, "SIGURG", "urgent I/O condition"}, {7, "SIGSTOP", "stop process"}, {8, "SIGFPE", "floating point exception"}, {9, "SIGKILL", "killed"}, {10, "SIGBUS", "bus error"}, {11, "SIGSEGV", "segmentation fault"}, {12, "SIGSYS", "bad argument to routine"}, {13, "SIGPIPE", "broken pipe"}, {14, "SIGALRM", "alarm clock"}, {15, "SIGTERM", "terminated"}, {16, "SIGUSR1", "user defined signal 1"}, {17, "SIGUSR2", "user defined signal 2"}, {18, "SIGABND", "abend"}, {19, "SIGCONT", "continued"}, {20, "SIGCHLD", "child exited"}, {21, "SIGTTIN", "stopped (tty input)"}, {22, "SIGTTOU", "stopped (tty output)"}, {23, "SIGIO", "I/O possible"}, {24, "SIGQUIT", "quit"}, {25, "SIGTSTP", "stopped"}, {26, "SIGTRAP", "trace/breakpoint trap"}, {27, "SIGIOER", "I/O error"}, {28, "SIGWINCH", "window changed"}, {29, "SIGXCPU", "CPU time limit exceeded"}, {30, "SIGXFSZ", "file size limit exceeded"}, {31, "SIGVTALRM", "virtual timer expired"}, {32, "SIGPROF", "profiling timer expired"}, {33, "SIGDANGER", "danger"}, {34, "SIGTHSTOP", "stop thread"}, {35, "SIGTHCONT", "continue thread"}, {37, "SIGTRACE", "trace"}, {38, "", "DCE"}, {39, "SIGDUMP", "dump"}, } ================================================ FILE: vendor/golang.org/x/sys/unix/zptrace_armnn_linux.go ================================================ // Code generated by linux/mkall.go generatePtracePair("arm", "arm64"). DO NOT EDIT. //go:build linux && (arm || arm64) package unix import "unsafe" // PtraceRegsArm is the registers used by arm binaries. type PtraceRegsArm struct { Uregs [18]uint32 } // PtraceGetRegsArm fetches the registers used by arm binaries. func PtraceGetRegsArm(pid int, regsout *PtraceRegsArm) error { return ptracePtr(PTRACE_GETREGS, pid, 0, unsafe.Pointer(regsout)) } // PtraceSetRegsArm sets the registers used by arm binaries. func PtraceSetRegsArm(pid int, regs *PtraceRegsArm) error { return ptracePtr(PTRACE_SETREGS, pid, 0, unsafe.Pointer(regs)) } // PtraceRegsArm64 is the registers used by arm64 binaries. type PtraceRegsArm64 struct { Regs [31]uint64 Sp uint64 Pc uint64 Pstate uint64 } // PtraceGetRegsArm64 fetches the registers used by arm64 binaries. func PtraceGetRegsArm64(pid int, regsout *PtraceRegsArm64) error { return ptracePtr(PTRACE_GETREGS, pid, 0, unsafe.Pointer(regsout)) } // PtraceSetRegsArm64 sets the registers used by arm64 binaries. func PtraceSetRegsArm64(pid int, regs *PtraceRegsArm64) error { return ptracePtr(PTRACE_SETREGS, pid, 0, unsafe.Pointer(regs)) } ================================================ FILE: vendor/golang.org/x/sys/unix/zptrace_linux_arm64.go ================================================ // Code generated by linux/mkall.go generatePtraceRegSet("arm64"). DO NOT EDIT. package unix import "unsafe" // PtraceGetRegSetArm64 fetches the registers used by arm64 binaries. func PtraceGetRegSetArm64(pid, addr int, regsout *PtraceRegsArm64) error { iovec := Iovec{(*byte)(unsafe.Pointer(regsout)), uint64(unsafe.Sizeof(*regsout))} return ptracePtr(PTRACE_GETREGSET, pid, uintptr(addr), unsafe.Pointer(&iovec)) } // PtraceSetRegSetArm64 sets the registers used by arm64 binaries. func PtraceSetRegSetArm64(pid, addr int, regs *PtraceRegsArm64) error { iovec := Iovec{(*byte)(unsafe.Pointer(regs)), uint64(unsafe.Sizeof(*regs))} return ptracePtr(PTRACE_SETREGSET, pid, uintptr(addr), unsafe.Pointer(&iovec)) } ================================================ FILE: vendor/golang.org/x/sys/unix/zptrace_mipsnn_linux.go ================================================ // Code generated by linux/mkall.go generatePtracePair("mips", "mips64"). DO NOT EDIT. //go:build linux && (mips || mips64) package unix import "unsafe" // PtraceRegsMips is the registers used by mips binaries. type PtraceRegsMips struct { Regs [32]uint64 Lo uint64 Hi uint64 Epc uint64 Badvaddr uint64 Status uint64 Cause uint64 } // PtraceGetRegsMips fetches the registers used by mips binaries. func PtraceGetRegsMips(pid int, regsout *PtraceRegsMips) error { return ptracePtr(PTRACE_GETREGS, pid, 0, unsafe.Pointer(regsout)) } // PtraceSetRegsMips sets the registers used by mips binaries. func PtraceSetRegsMips(pid int, regs *PtraceRegsMips) error { return ptracePtr(PTRACE_SETREGS, pid, 0, unsafe.Pointer(regs)) } // PtraceRegsMips64 is the registers used by mips64 binaries. type PtraceRegsMips64 struct { Regs [32]uint64 Lo uint64 Hi uint64 Epc uint64 Badvaddr uint64 Status uint64 Cause uint64 } // PtraceGetRegsMips64 fetches the registers used by mips64 binaries. func PtraceGetRegsMips64(pid int, regsout *PtraceRegsMips64) error { return ptracePtr(PTRACE_GETREGS, pid, 0, unsafe.Pointer(regsout)) } // PtraceSetRegsMips64 sets the registers used by mips64 binaries. func PtraceSetRegsMips64(pid int, regs *PtraceRegsMips64) error { return ptracePtr(PTRACE_SETREGS, pid, 0, unsafe.Pointer(regs)) } ================================================ FILE: vendor/golang.org/x/sys/unix/zptrace_mipsnnle_linux.go ================================================ // Code generated by linux/mkall.go generatePtracePair("mipsle", "mips64le"). DO NOT EDIT. //go:build linux && (mipsle || mips64le) package unix import "unsafe" // PtraceRegsMipsle is the registers used by mipsle binaries. type PtraceRegsMipsle struct { Regs [32]uint64 Lo uint64 Hi uint64 Epc uint64 Badvaddr uint64 Status uint64 Cause uint64 } // PtraceGetRegsMipsle fetches the registers used by mipsle binaries. func PtraceGetRegsMipsle(pid int, regsout *PtraceRegsMipsle) error { return ptracePtr(PTRACE_GETREGS, pid, 0, unsafe.Pointer(regsout)) } // PtraceSetRegsMipsle sets the registers used by mipsle binaries. func PtraceSetRegsMipsle(pid int, regs *PtraceRegsMipsle) error { return ptracePtr(PTRACE_SETREGS, pid, 0, unsafe.Pointer(regs)) } // PtraceRegsMips64le is the registers used by mips64le binaries. type PtraceRegsMips64le struct { Regs [32]uint64 Lo uint64 Hi uint64 Epc uint64 Badvaddr uint64 Status uint64 Cause uint64 } // PtraceGetRegsMips64le fetches the registers used by mips64le binaries. func PtraceGetRegsMips64le(pid int, regsout *PtraceRegsMips64le) error { return ptracePtr(PTRACE_GETREGS, pid, 0, unsafe.Pointer(regsout)) } // PtraceSetRegsMips64le sets the registers used by mips64le binaries. func PtraceSetRegsMips64le(pid int, regs *PtraceRegsMips64le) error { return ptracePtr(PTRACE_SETREGS, pid, 0, unsafe.Pointer(regs)) } ================================================ FILE: vendor/golang.org/x/sys/unix/zptrace_x86_linux.go ================================================ // Code generated by linux/mkall.go generatePtracePair("386", "amd64"). DO NOT EDIT. //go:build linux && (386 || amd64) package unix import "unsafe" // PtraceRegs386 is the registers used by 386 binaries. type PtraceRegs386 struct { Ebx int32 Ecx int32 Edx int32 Esi int32 Edi int32 Ebp int32 Eax int32 Xds int32 Xes int32 Xfs int32 Xgs int32 Orig_eax int32 Eip int32 Xcs int32 Eflags int32 Esp int32 Xss int32 } // PtraceGetRegs386 fetches the registers used by 386 binaries. func PtraceGetRegs386(pid int, regsout *PtraceRegs386) error { return ptracePtr(PTRACE_GETREGS, pid, 0, unsafe.Pointer(regsout)) } // PtraceSetRegs386 sets the registers used by 386 binaries. func PtraceSetRegs386(pid int, regs *PtraceRegs386) error { return ptracePtr(PTRACE_SETREGS, pid, 0, unsafe.Pointer(regs)) } // PtraceRegsAmd64 is the registers used by amd64 binaries. type PtraceRegsAmd64 struct { R15 uint64 R14 uint64 R13 uint64 R12 uint64 Rbp uint64 Rbx uint64 R11 uint64 R10 uint64 R9 uint64 R8 uint64 Rax uint64 Rcx uint64 Rdx uint64 Rsi uint64 Rdi uint64 Orig_rax uint64 Rip uint64 Cs uint64 Eflags uint64 Rsp uint64 Ss uint64 Fs_base uint64 Gs_base uint64 Ds uint64 Es uint64 Fs uint64 Gs uint64 } // PtraceGetRegsAmd64 fetches the registers used by amd64 binaries. func PtraceGetRegsAmd64(pid int, regsout *PtraceRegsAmd64) error { return ptracePtr(PTRACE_GETREGS, pid, 0, unsafe.Pointer(regsout)) } // PtraceSetRegsAmd64 sets the registers used by amd64 binaries. func PtraceSetRegsAmd64(pid int, regs *PtraceRegsAmd64) error { return ptracePtr(PTRACE_SETREGS, pid, 0, unsafe.Pointer(regs)) } ================================================ FILE: vendor/golang.org/x/sys/unix/zsymaddr_zos_s390x.s ================================================ // go run mksyscall_zos_s390x.go -o_sysnum zsysnum_zos_s390x.go -o_syscall zsyscall_zos_s390x.go -i_syscall syscall_zos_s390x.go -o_asm zsymaddr_zos_s390x.s // Code generated by the command above; see README.md. DO NOT EDIT. //go:build zos && s390x #include "textflag.h" // provide the address of function variable to be fixed up. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_FlistxattrAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Flistxattr(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_FremovexattrAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Fremovexattr(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_FgetxattrAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Fgetxattr(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_FsetxattrAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Fsetxattr(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_accept4Addr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·accept4(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_RemovexattrAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Removexattr(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_Dup3Addr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Dup3(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_DirfdAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Dirfd(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_EpollCreateAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·EpollCreate(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_EpollCreate1Addr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·EpollCreate1(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_EpollCtlAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·EpollCtl(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_EpollPwaitAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·EpollPwait(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_EpollWaitAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·EpollWait(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_EventfdAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Eventfd(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_FaccessatAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Faccessat(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_FchmodatAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Fchmodat(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_FchownatAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Fchownat(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_FdatasyncAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Fdatasync(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_fstatatAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·fstatat(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_LgetxattrAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Lgetxattr(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_LsetxattrAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Lsetxattr(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_FstatfsAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Fstatfs(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_FutimesAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Futimes(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_FutimesatAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Futimesat(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_GetrandomAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Getrandom(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_InotifyInitAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·InotifyInit(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_InotifyInit1Addr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·InotifyInit1(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_InotifyAddWatchAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·InotifyAddWatch(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_InotifyRmWatchAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·InotifyRmWatch(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_ListxattrAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Listxattr(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_LlistxattrAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Llistxattr(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_LremovexattrAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Lremovexattr(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_LutimesAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Lutimes(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_StatfsAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Statfs(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_SyncfsAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Syncfs(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_UnshareAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Unshare(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_LinkatAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Linkat(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_MkdiratAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Mkdirat(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_MknodatAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Mknodat(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_PivotRootAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·PivotRoot(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_PrctlAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Prctl(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_PrlimitAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Prlimit(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_RenameatAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Renameat(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_Renameat2Addr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Renameat2(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_SethostnameAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Sethostname(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_SetnsAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Setns(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_SymlinkatAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Symlinkat(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_UnlinkatAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·Unlinkat(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_openatAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·openat(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_openat2Addr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·openat2(SB), R8 MOVD R8, ret+0(FP) RET // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT TEXT ·get_utimensatAddr(SB), NOSPLIT|NOFRAME, $0-8 MOVD $·utimensat(SB), R8 MOVD R8, ret+0(FP) RET ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_aix_ppc.go ================================================ // go run mksyscall_aix_ppc.go -aix -tags aix,ppc syscall_aix.go syscall_aix_ppc.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build aix && ppc package unix /* #include #include int utimes(uintptr_t, uintptr_t); int utimensat(int, uintptr_t, uintptr_t, int); int getcwd(uintptr_t, size_t); int accept(int, uintptr_t, uintptr_t); int getdirent(int, uintptr_t, size_t); int wait4(int, uintptr_t, int, uintptr_t); int ioctl(int, int, uintptr_t); int fcntl(uintptr_t, int, uintptr_t); int fsync_range(int, int, long long, long long); int acct(uintptr_t); int chdir(uintptr_t); int chroot(uintptr_t); int close(int); int dup(int); void exit(int); int faccessat(int, uintptr_t, unsigned int, int); int fchdir(int); int fchmod(int, unsigned int); int fchmodat(int, uintptr_t, unsigned int, int); int fchownat(int, uintptr_t, int, int, int); int fdatasync(int); int getpgid(int); int getpgrp(); int getpid(); int getppid(); int getpriority(int, int); int getrusage(int, uintptr_t); int getsid(int); int kill(int, int); int syslog(int, uintptr_t, size_t); int mkdir(int, uintptr_t, unsigned int); int mkdirat(int, uintptr_t, unsigned int); int mkfifo(uintptr_t, unsigned int); int mknod(uintptr_t, unsigned int, int); int mknodat(int, uintptr_t, unsigned int, int); int nanosleep(uintptr_t, uintptr_t); int open64(uintptr_t, int, unsigned int); int openat(int, uintptr_t, int, unsigned int); int read(int, uintptr_t, size_t); int readlink(uintptr_t, uintptr_t, size_t); int renameat(int, uintptr_t, int, uintptr_t); int setdomainname(uintptr_t, size_t); int sethostname(uintptr_t, size_t); int setpgid(int, int); int setsid(); int settimeofday(uintptr_t); int setuid(int); int setgid(int); int setpriority(int, int, int); int statx(int, uintptr_t, int, int, uintptr_t); int sync(); uintptr_t times(uintptr_t); int umask(int); int uname(uintptr_t); int unlink(uintptr_t); int unlinkat(int, uintptr_t, int); int ustat(int, uintptr_t); int write(int, uintptr_t, size_t); int dup2(int, int); int posix_fadvise64(int, long long, long long, int); int fchown(int, int, int); int fstat(int, uintptr_t); int fstatat(int, uintptr_t, uintptr_t, int); int fstatfs(int, uintptr_t); int ftruncate(int, long long); int getegid(); int geteuid(); int getgid(); int getuid(); int lchown(uintptr_t, int, int); int listen(int, int); int lstat(uintptr_t, uintptr_t); int pause(); int pread64(int, uintptr_t, size_t, long long); int pwrite64(int, uintptr_t, size_t, long long); #define c_select select int select(int, uintptr_t, uintptr_t, uintptr_t, uintptr_t); int pselect(int, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); int setregid(int, int); int setreuid(int, int); int shutdown(int, int); long long splice(int, uintptr_t, int, uintptr_t, int, int); int stat(uintptr_t, uintptr_t); int statfs(uintptr_t, uintptr_t); int truncate(uintptr_t, long long); int bind(int, uintptr_t, uintptr_t); int connect(int, uintptr_t, uintptr_t); int getgroups(int, uintptr_t); int setgroups(int, uintptr_t); int getsockopt(int, int, int, uintptr_t, uintptr_t); int setsockopt(int, int, int, uintptr_t, uintptr_t); int socket(int, int, int); int socketpair(int, int, int, uintptr_t); int getpeername(int, uintptr_t, uintptr_t); int getsockname(int, uintptr_t, uintptr_t); int recvfrom(int, uintptr_t, size_t, int, uintptr_t, uintptr_t); int sendto(int, uintptr_t, size_t, int, uintptr_t, uintptr_t); int nrecvmsg(int, uintptr_t, int); int nsendmsg(int, uintptr_t, int); int munmap(uintptr_t, uintptr_t); int madvise(uintptr_t, size_t, int); int mprotect(uintptr_t, size_t, int); int mlock(uintptr_t, size_t); int mlockall(int); int msync(uintptr_t, size_t, int); int munlock(uintptr_t, size_t); int munlockall(); int pipe(uintptr_t); int poll(uintptr_t, int, int); int gettimeofday(uintptr_t, uintptr_t); int time(uintptr_t); int utime(uintptr_t, uintptr_t); unsigned long long getsystemcfg(int); int umount(uintptr_t); int getrlimit64(int, uintptr_t); long long lseek64(int, long long, int); uintptr_t mmap(uintptr_t, uintptr_t, int, int, int, long long); */ import "C" import ( "unsafe" ) // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, times *[2]Timeval) (err error) { _p0 := uintptr(unsafe.Pointer(C.CString(path))) r0, er := C.utimes(C.uintptr_t(_p0), C.uintptr_t(uintptr(unsafe.Pointer(times)))) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimensat(dirfd int, path string, times *[2]Timespec, flag int) (err error) { _p0 := uintptr(unsafe.Pointer(C.CString(path))) r0, er := C.utimensat(C.int(dirfd), C.uintptr_t(_p0), C.uintptr_t(uintptr(unsafe.Pointer(times))), C.int(flag)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getcwd(buf []byte) (err error) { var _p0 *byte if len(buf) > 0 { _p0 = &buf[0] } var _p1 int _p1 = len(buf) r0, er := C.getcwd(C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { r0, er := C.accept(C.int(s), C.uintptr_t(uintptr(unsafe.Pointer(rsa))), C.uintptr_t(uintptr(unsafe.Pointer(addrlen)))) fd = int(r0) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getdirent(fd int, buf []byte) (n int, err error) { var _p0 *byte if len(buf) > 0 { _p0 = &buf[0] } var _p1 int _p1 = len(buf) r0, er := C.getdirent(C.int(fd), C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1)) n = int(r0) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func wait4(pid Pid_t, status *_C_int, options int, rusage *Rusage) (wpid Pid_t, err error) { r0, er := C.wait4(C.int(pid), C.uintptr_t(uintptr(unsafe.Pointer(status))), C.int(options), C.uintptr_t(uintptr(unsafe.Pointer(rusage)))) wpid = Pid_t(r0) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctl(fd int, req int, arg uintptr) (err error) { r0, er := C.ioctl(C.int(fd), C.int(req), C.uintptr_t(arg)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctlPtr(fd int, req int, arg unsafe.Pointer) (err error) { r0, er := C.ioctl(C.int(fd), C.int(req), C.uintptr_t(uintptr(arg))) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func FcntlInt(fd uintptr, cmd int, arg int) (r int, err error) { r0, er := C.fcntl(C.uintptr_t(fd), C.int(cmd), C.uintptr_t(arg)) r = int(r0) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) (err error) { r0, er := C.fcntl(C.uintptr_t(fd), C.int(cmd), C.uintptr_t(uintptr(unsafe.Pointer(lk)))) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fcntl(fd int, cmd int, arg int) (val int, err error) { r0, er := C.fcntl(C.uintptr_t(fd), C.int(cmd), C.uintptr_t(arg)) val = int(r0) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fsyncRange(fd int, how int, start int64, length int64) (err error) { r0, er := C.fsync_range(C.int(fd), C.int(how), C.longlong(start), C.longlong(length)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Acct(path string) (err error) { _p0 := uintptr(unsafe.Pointer(C.CString(path))) r0, er := C.acct(C.uintptr_t(_p0)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chdir(path string) (err error) { _p0 := uintptr(unsafe.Pointer(C.CString(path))) r0, er := C.chdir(C.uintptr_t(_p0)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chroot(path string) (err error) { _p0 := uintptr(unsafe.Pointer(C.CString(path))) r0, er := C.chroot(C.uintptr_t(_p0)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Close(fd int) (err error) { r0, er := C.close(C.int(fd)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(oldfd int) (fd int, err error) { r0, er := C.dup(C.int(oldfd)) fd = int(r0) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Exit(code int) { C.exit(C.int(code)) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { _p0 := uintptr(unsafe.Pointer(C.CString(path))) r0, er := C.faccessat(C.int(dirfd), C.uintptr_t(_p0), C.uint(mode), C.int(flags)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchdir(fd int) (err error) { r0, er := C.fchdir(C.int(fd)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmod(fd int, mode uint32) (err error) { r0, er := C.fchmod(C.int(fd), C.uint(mode)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { _p0 := uintptr(unsafe.Pointer(C.CString(path))) r0, er := C.fchmodat(C.int(dirfd), C.uintptr_t(_p0), C.uint(mode), C.int(flags)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { _p0 := uintptr(unsafe.Pointer(C.CString(path))) r0, er := C.fchownat(C.int(dirfd), C.uintptr_t(_p0), C.int(uid), C.int(gid), C.int(flags)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fdatasync(fd int) (err error) { r0, er := C.fdatasync(C.int(fd)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgid(pid int) (pgid int, err error) { r0, er := C.getpgid(C.int(pid)) pgid = int(r0) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgrp() (pid int) { r0, _ := C.getpgrp() pid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpid() (pid int) { r0, _ := C.getpid() pid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getppid() (ppid int) { r0, _ := C.getppid() ppid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpriority(which int, who int) (prio int, err error) { r0, er := C.getpriority(C.int(which), C.int(who)) prio = int(r0) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrusage(who int, rusage *Rusage) (err error) { r0, er := C.getrusage(C.int(who), C.uintptr_t(uintptr(unsafe.Pointer(rusage)))) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getsid(pid int) (sid int, err error) { r0, er := C.getsid(C.int(pid)) sid = int(r0) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kill(pid int, sig Signal) (err error) { r0, er := C.kill(C.int(pid), C.int(sig)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Klogctl(typ int, buf []byte) (n int, err error) { var _p0 *byte if len(buf) > 0 { _p0 = &buf[0] } var _p1 int _p1 = len(buf) r0, er := C.syslog(C.int(typ), C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1)) n = int(r0) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdir(dirfd int, path string, mode uint32) (err error) { _p0 := uintptr(unsafe.Pointer(C.CString(path))) r0, er := C.mkdir(C.int(dirfd), C.uintptr_t(_p0), C.uint(mode)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdirat(dirfd int, path string, mode uint32) (err error) { _p0 := uintptr(unsafe.Pointer(C.CString(path))) r0, er := C.mkdirat(C.int(dirfd), C.uintptr_t(_p0), C.uint(mode)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifo(path string, mode uint32) (err error) { _p0 := uintptr(unsafe.Pointer(C.CString(path))) r0, er := C.mkfifo(C.uintptr_t(_p0), C.uint(mode)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknod(path string, mode uint32, dev int) (err error) { _p0 := uintptr(unsafe.Pointer(C.CString(path))) r0, er := C.mknod(C.uintptr_t(_p0), C.uint(mode), C.int(dev)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { _p0 := uintptr(unsafe.Pointer(C.CString(path))) r0, er := C.mknodat(C.int(dirfd), C.uintptr_t(_p0), C.uint(mode), C.int(dev)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Nanosleep(time *Timespec, leftover *Timespec) (err error) { r0, er := C.nanosleep(C.uintptr_t(uintptr(unsafe.Pointer(time))), C.uintptr_t(uintptr(unsafe.Pointer(leftover)))) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Open(path string, mode int, perm uint32) (fd int, err error) { _p0 := uintptr(unsafe.Pointer(C.CString(path))) r0, er := C.open64(C.uintptr_t(_p0), C.int(mode), C.uint(perm)) fd = int(r0) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) { _p0 := uintptr(unsafe.Pointer(C.CString(path))) r0, er := C.openat(C.int(dirfd), C.uintptr_t(_p0), C.int(flags), C.uint(mode)) fd = int(r0) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func read(fd int, p []byte) (n int, err error) { var _p0 *byte if len(p) > 0 { _p0 = &p[0] } var _p1 int _p1 = len(p) r0, er := C.read(C.int(fd), C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1)) n = int(r0) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlink(path string, buf []byte) (n int, err error) { _p0 := uintptr(unsafe.Pointer(C.CString(path))) var _p1 *byte if len(buf) > 0 { _p1 = &buf[0] } var _p2 int _p2 = len(buf) r0, er := C.readlink(C.uintptr_t(_p0), C.uintptr_t(uintptr(unsafe.Pointer(_p1))), C.size_t(_p2)) n = int(r0) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) { _p0 := uintptr(unsafe.Pointer(C.CString(oldpath))) _p1 := uintptr(unsafe.Pointer(C.CString(newpath))) r0, er := C.renameat(C.int(olddirfd), C.uintptr_t(_p0), C.int(newdirfd), C.uintptr_t(_p1)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setdomainname(p []byte) (err error) { var _p0 *byte if len(p) > 0 { _p0 = &p[0] } var _p1 int _p1 = len(p) r0, er := C.setdomainname(C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sethostname(p []byte) (err error) { var _p0 *byte if len(p) > 0 { _p0 = &p[0] } var _p1 int _p1 = len(p) r0, er := C.sethostname(C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (err error) { r0, er := C.setpgid(C.int(pid), C.int(pgid)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, err error) { r0, er := C.setsid() pid = int(r0) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Settimeofday(tv *Timeval) (err error) { r0, er := C.settimeofday(C.uintptr_t(uintptr(unsafe.Pointer(tv)))) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setuid(uid int) (err error) { r0, er := C.setuid(C.int(uid)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setgid(uid int) (err error) { r0, er := C.setgid(C.int(uid)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpriority(which int, who int, prio int) (err error) { r0, er := C.setpriority(C.int(which), C.int(who), C.int(prio)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Statx(dirfd int, path string, flags int, mask int, stat *Statx_t) (err error) { _p0 := uintptr(unsafe.Pointer(C.CString(path))) r0, er := C.statx(C.int(dirfd), C.uintptr_t(_p0), C.int(flags), C.int(mask), C.uintptr_t(uintptr(unsafe.Pointer(stat)))) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sync() { C.sync() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Times(tms *Tms) (ticks uintptr, err error) { r0, er := C.times(C.uintptr_t(uintptr(unsafe.Pointer(tms)))) ticks = uintptr(r0) if uintptr(r0) == ^uintptr(0) && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Umask(mask int) (oldmask int) { r0, _ := C.umask(C.int(mask)) oldmask = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Uname(buf *Utsname) (err error) { r0, er := C.uname(C.uintptr_t(uintptr(unsafe.Pointer(buf)))) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlink(path string) (err error) { _p0 := uintptr(unsafe.Pointer(C.CString(path))) r0, er := C.unlink(C.uintptr_t(_p0)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlinkat(dirfd int, path string, flags int) (err error) { _p0 := uintptr(unsafe.Pointer(C.CString(path))) r0, er := C.unlinkat(C.int(dirfd), C.uintptr_t(_p0), C.int(flags)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ustat(dev int, ubuf *Ustat_t) (err error) { r0, er := C.ustat(C.int(dev), C.uintptr_t(uintptr(unsafe.Pointer(ubuf)))) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func write(fd int, p []byte) (n int, err error) { var _p0 *byte if len(p) > 0 { _p0 = &p[0] } var _p1 int _p1 = len(p) r0, er := C.write(C.int(fd), C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1)) n = int(r0) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup2(oldfd int, newfd int) (err error) { r0, er := C.dup2(C.int(oldfd), C.int(newfd)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fadvise(fd int, offset int64, length int64, advice int) (err error) { r0, er := C.posix_fadvise64(C.int(fd), C.longlong(offset), C.longlong(length), C.int(advice)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { r0, er := C.fchown(C.int(fd), C.int(uid), C.int(gid)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fstat(fd int, stat *Stat_t) (err error) { r0, er := C.fstat(C.int(fd), C.uintptr_t(uintptr(unsafe.Pointer(stat)))) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) { _p0 := uintptr(unsafe.Pointer(C.CString(path))) r0, er := C.fstatat(C.int(dirfd), C.uintptr_t(_p0), C.uintptr_t(uintptr(unsafe.Pointer(stat))), C.int(flags)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatfs(fd int, buf *Statfs_t) (err error) { r0, er := C.fstatfs(C.int(fd), C.uintptr_t(uintptr(unsafe.Pointer(buf)))) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { r0, er := C.ftruncate(C.int(fd), C.longlong(length)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { r0, _ := C.getegid() egid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (euid int) { r0, _ := C.geteuid() euid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _ := C.getgid() gid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _ := C.getuid() uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { _p0 := uintptr(unsafe.Pointer(C.CString(path))) r0, er := C.lchown(C.uintptr_t(_p0), C.int(uid), C.int(gid)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, n int) (err error) { r0, er := C.listen(C.int(s), C.int(n)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func lstat(path string, stat *Stat_t) (err error) { _p0 := uintptr(unsafe.Pointer(C.CString(path))) r0, er := C.lstat(C.uintptr_t(_p0), C.uintptr_t(uintptr(unsafe.Pointer(stat)))) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pause() (err error) { r0, er := C.pause() if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 *byte if len(p) > 0 { _p0 = &p[0] } var _p1 int _p1 = len(p) r0, er := C.pread64(C.int(fd), C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1), C.longlong(offset)) n = int(r0) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 *byte if len(p) > 0 { _p0 = &p[0] } var _p1 int _p1 = len(p) r0, er := C.pwrite64(C.int(fd), C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1), C.longlong(offset)) n = int(r0) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { r0, er := C.c_select(C.int(nfd), C.uintptr_t(uintptr(unsafe.Pointer(r))), C.uintptr_t(uintptr(unsafe.Pointer(w))), C.uintptr_t(uintptr(unsafe.Pointer(e))), C.uintptr_t(uintptr(unsafe.Pointer(timeout)))) n = int(r0) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pselect(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { r0, er := C.pselect(C.int(nfd), C.uintptr_t(uintptr(unsafe.Pointer(r))), C.uintptr_t(uintptr(unsafe.Pointer(w))), C.uintptr_t(uintptr(unsafe.Pointer(e))), C.uintptr_t(uintptr(unsafe.Pointer(timeout))), C.uintptr_t(uintptr(unsafe.Pointer(sigmask)))) n = int(r0) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setregid(rgid int, egid int) (err error) { r0, er := C.setregid(C.int(rgid), C.int(egid)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setreuid(ruid int, euid int) (err error) { r0, er := C.setreuid(C.int(ruid), C.int(euid)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(fd int, how int) (err error) { r0, er := C.shutdown(C.int(fd), C.int(how)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) { r0, er := C.splice(C.int(rfd), C.uintptr_t(uintptr(unsafe.Pointer(roff))), C.int(wfd), C.uintptr_t(uintptr(unsafe.Pointer(woff))), C.int(len), C.int(flags)) n = int64(r0) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func stat(path string, statptr *Stat_t) (err error) { _p0 := uintptr(unsafe.Pointer(C.CString(path))) r0, er := C.stat(C.uintptr_t(_p0), C.uintptr_t(uintptr(unsafe.Pointer(statptr)))) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Statfs(path string, buf *Statfs_t) (err error) { _p0 := uintptr(unsafe.Pointer(C.CString(path))) r0, er := C.statfs(C.uintptr_t(_p0), C.uintptr_t(uintptr(unsafe.Pointer(buf)))) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { _p0 := uintptr(unsafe.Pointer(C.CString(path))) r0, er := C.truncate(C.uintptr_t(_p0), C.longlong(length)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { r0, er := C.bind(C.int(s), C.uintptr_t(uintptr(addr)), C.uintptr_t(uintptr(addrlen))) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { r0, er := C.connect(C.int(s), C.uintptr_t(uintptr(addr)), C.uintptr_t(uintptr(addrlen))) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(n int, list *_Gid_t) (nn int, err error) { r0, er := C.getgroups(C.int(n), C.uintptr_t(uintptr(unsafe.Pointer(list)))) nn = int(r0) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(n int, list *_Gid_t) (err error) { r0, er := C.setgroups(C.int(n), C.uintptr_t(uintptr(unsafe.Pointer(list)))) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { r0, er := C.getsockopt(C.int(s), C.int(level), C.int(name), C.uintptr_t(uintptr(val)), C.uintptr_t(uintptr(unsafe.Pointer(vallen)))) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { r0, er := C.setsockopt(C.int(s), C.int(level), C.int(name), C.uintptr_t(uintptr(val)), C.uintptr_t(vallen)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { r0, er := C.socket(C.int(domain), C.int(typ), C.int(proto)) fd = int(r0) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { r0, er := C.socketpair(C.int(domain), C.int(typ), C.int(proto), C.uintptr_t(uintptr(unsafe.Pointer(fd)))) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { r0, er := C.getpeername(C.int(fd), C.uintptr_t(uintptr(unsafe.Pointer(rsa))), C.uintptr_t(uintptr(unsafe.Pointer(addrlen)))) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { r0, er := C.getsockname(C.int(fd), C.uintptr_t(uintptr(unsafe.Pointer(rsa))), C.uintptr_t(uintptr(unsafe.Pointer(addrlen)))) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { var _p0 *byte if len(p) > 0 { _p0 = &p[0] } var _p1 int _p1 = len(p) r0, er := C.recvfrom(C.int(fd), C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1), C.int(flags), C.uintptr_t(uintptr(unsafe.Pointer(from))), C.uintptr_t(uintptr(unsafe.Pointer(fromlen)))) n = int(r0) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { var _p0 *byte if len(buf) > 0 { _p0 = &buf[0] } var _p1 int _p1 = len(buf) r0, er := C.sendto(C.int(s), C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1), C.int(flags), C.uintptr_t(uintptr(to)), C.uintptr_t(uintptr(addrlen))) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, er := C.nrecvmsg(C.int(s), C.uintptr_t(uintptr(unsafe.Pointer(msg))), C.int(flags)) n = int(r0) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, er := C.nsendmsg(C.int(s), C.uintptr_t(uintptr(unsafe.Pointer(msg))), C.int(flags)) n = int(r0) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func munmap(addr uintptr, length uintptr) (err error) { r0, er := C.munmap(C.uintptr_t(addr), C.uintptr_t(length)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Madvise(b []byte, advice int) (err error) { var _p0 *byte if len(b) > 0 { _p0 = &b[0] } var _p1 int _p1 = len(b) r0, er := C.madvise(C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1), C.int(advice)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mprotect(b []byte, prot int) (err error) { var _p0 *byte if len(b) > 0 { _p0 = &b[0] } var _p1 int _p1 = len(b) r0, er := C.mprotect(C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1), C.int(prot)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlock(b []byte) (err error) { var _p0 *byte if len(b) > 0 { _p0 = &b[0] } var _p1 int _p1 = len(b) r0, er := C.mlock(C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlockall(flags int) (err error) { r0, er := C.mlockall(C.int(flags)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Msync(b []byte, flags int) (err error) { var _p0 *byte if len(b) > 0 { _p0 = &b[0] } var _p1 int _p1 = len(b) r0, er := C.msync(C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1), C.int(flags)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlock(b []byte) (err error) { var _p0 *byte if len(b) > 0 { _p0 = &b[0] } var _p1 int _p1 = len(b) r0, er := C.munlock(C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlockall() (err error) { r0, er := C.munlockall() if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe(p *[2]_C_int) (err error) { r0, er := C.pipe(C.uintptr_t(uintptr(unsafe.Pointer(p)))) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, er := C.poll(C.uintptr_t(uintptr(unsafe.Pointer(fds))), C.int(nfds), C.int(timeout)) n = int(r0) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func gettimeofday(tv *Timeval, tzp *Timezone) (err error) { r0, er := C.gettimeofday(C.uintptr_t(uintptr(unsafe.Pointer(tv))), C.uintptr_t(uintptr(unsafe.Pointer(tzp)))) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Time(t *Time_t) (tt Time_t, err error) { r0, er := C.time(C.uintptr_t(uintptr(unsafe.Pointer(t)))) tt = Time_t(r0) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Utime(path string, buf *Utimbuf) (err error) { _p0 := uintptr(unsafe.Pointer(C.CString(path))) r0, er := C.utime(C.uintptr_t(_p0), C.uintptr_t(uintptr(unsafe.Pointer(buf)))) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getsystemcfg(label int) (n uint64) { r0, _ := C.getsystemcfg(C.int(label)) n = uint64(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func umount(target string) (err error) { _p0 := uintptr(unsafe.Pointer(C.CString(target))) r0, er := C.umount(C.uintptr_t(_p0)) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(resource int, rlim *Rlimit) (err error) { r0, er := C.getrlimit64(C.int(resource), C.uintptr_t(uintptr(unsafe.Pointer(rlim)))) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seek(fd int, offset int64, whence int) (off int64, err error) { r0, er := C.lseek64(C.int(fd), C.longlong(offset), C.int(whence)) off = int64(r0) if r0 == -1 && er != nil { err = er } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) { r0, er := C.mmap(C.uintptr_t(addr), C.uintptr_t(length), C.int(prot), C.int(flags), C.int(fd), C.longlong(offset)) xaddr = uintptr(r0) if uintptr(r0) == ^uintptr(0) && er != nil { err = er } return } ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64.go ================================================ // go run mksyscall_aix_ppc64.go -aix -tags aix,ppc64 syscall_aix.go syscall_aix_ppc64.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build aix && ppc64 package unix import ( "unsafe" ) // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, times *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, e1 := callutimes(uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimensat(dirfd int, path string, times *[2]Timespec, flag int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, e1 := callutimensat(dirfd, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), flag) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getcwd(buf []byte) (err error) { var _p0 *byte if len(buf) > 0 { _p0 = &buf[0] } _, e1 := callgetcwd(uintptr(unsafe.Pointer(_p0)), len(buf)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { r0, e1 := callaccept(s, uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getdirent(fd int, buf []byte) (n int, err error) { var _p0 *byte if len(buf) > 0 { _p0 = &buf[0] } r0, e1 := callgetdirent(fd, uintptr(unsafe.Pointer(_p0)), len(buf)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func wait4(pid Pid_t, status *_C_int, options int, rusage *Rusage) (wpid Pid_t, err error) { r0, e1 := callwait4(int(pid), uintptr(unsafe.Pointer(status)), options, uintptr(unsafe.Pointer(rusage))) wpid = Pid_t(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctl(fd int, req int, arg uintptr) (err error) { _, e1 := callioctl(fd, req, arg) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctlPtr(fd int, req int, arg unsafe.Pointer) (err error) { _, e1 := callioctl_ptr(fd, req, arg) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func FcntlInt(fd uintptr, cmd int, arg int) (r int, err error) { r0, e1 := callfcntl(fd, cmd, uintptr(arg)) r = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) (err error) { _, e1 := callfcntl(fd, cmd, uintptr(unsafe.Pointer(lk))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fcntl(fd int, cmd int, arg int) (val int, err error) { r0, e1 := callfcntl(uintptr(fd), cmd, uintptr(arg)) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fsyncRange(fd int, how int, start int64, length int64) (err error) { _, e1 := callfsync_range(fd, how, start, length) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Acct(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, e1 := callacct(uintptr(unsafe.Pointer(_p0))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, e1 := callchdir(uintptr(unsafe.Pointer(_p0))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chroot(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, e1 := callchroot(uintptr(unsafe.Pointer(_p0))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Close(fd int) (err error) { _, e1 := callclose(fd) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(oldfd int) (fd int, err error) { r0, e1 := calldup(oldfd) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Exit(code int) { callexit(code) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, e1 := callfaccessat(dirfd, uintptr(unsafe.Pointer(_p0)), mode, flags) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchdir(fd int) (err error) { _, e1 := callfchdir(fd) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmod(fd int, mode uint32) (err error) { _, e1 := callfchmod(fd, mode) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, e1 := callfchmodat(dirfd, uintptr(unsafe.Pointer(_p0)), mode, flags) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, e1 := callfchownat(dirfd, uintptr(unsafe.Pointer(_p0)), uid, gid, flags) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fdatasync(fd int) (err error) { _, e1 := callfdatasync(fd) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgid(pid int) (pgid int, err error) { r0, e1 := callgetpgid(pid) pgid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgrp() (pid int) { r0, _ := callgetpgrp() pid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpid() (pid int) { r0, _ := callgetpid() pid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getppid() (ppid int) { r0, _ := callgetppid() ppid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpriority(which int, who int) (prio int, err error) { r0, e1 := callgetpriority(which, who) prio = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrusage(who int, rusage *Rusage) (err error) { _, e1 := callgetrusage(who, uintptr(unsafe.Pointer(rusage))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getsid(pid int) (sid int, err error) { r0, e1 := callgetsid(pid) sid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kill(pid int, sig Signal) (err error) { _, e1 := callkill(pid, int(sig)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Klogctl(typ int, buf []byte) (n int, err error) { var _p0 *byte if len(buf) > 0 { _p0 = &buf[0] } r0, e1 := callsyslog(typ, uintptr(unsafe.Pointer(_p0)), len(buf)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdir(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, e1 := callmkdir(dirfd, uintptr(unsafe.Pointer(_p0)), mode) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdirat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, e1 := callmkdirat(dirfd, uintptr(unsafe.Pointer(_p0)), mode) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifo(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, e1 := callmkfifo(uintptr(unsafe.Pointer(_p0)), mode) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknod(path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, e1 := callmknod(uintptr(unsafe.Pointer(_p0)), mode, dev) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, e1 := callmknodat(dirfd, uintptr(unsafe.Pointer(_p0)), mode, dev) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, e1 := callnanosleep(uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Open(path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, e1 := callopen64(uintptr(unsafe.Pointer(_p0)), mode, perm) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, e1 := callopenat(dirfd, uintptr(unsafe.Pointer(_p0)), flags, mode) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func read(fd int, p []byte) (n int, err error) { var _p0 *byte if len(p) > 0 { _p0 = &p[0] } r0, e1 := callread(fd, uintptr(unsafe.Pointer(_p0)), len(p)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlink(path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte if len(buf) > 0 { _p1 = &buf[0] } r0, e1 := callreadlink(uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), len(buf)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, e1 := callrenameat(olddirfd, uintptr(unsafe.Pointer(_p0)), newdirfd, uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setdomainname(p []byte) (err error) { var _p0 *byte if len(p) > 0 { _p0 = &p[0] } _, e1 := callsetdomainname(uintptr(unsafe.Pointer(_p0)), len(p)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sethostname(p []byte) (err error) { var _p0 *byte if len(p) > 0 { _p0 = &p[0] } _, e1 := callsethostname(uintptr(unsafe.Pointer(_p0)), len(p)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (err error) { _, e1 := callsetpgid(pid, pgid) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, err error) { r0, e1 := callsetsid() pid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Settimeofday(tv *Timeval) (err error) { _, e1 := callsettimeofday(uintptr(unsafe.Pointer(tv))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setuid(uid int) (err error) { _, e1 := callsetuid(uid) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setgid(uid int) (err error) { _, e1 := callsetgid(uid) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpriority(which int, who int, prio int) (err error) { _, e1 := callsetpriority(which, who, prio) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Statx(dirfd int, path string, flags int, mask int, stat *Statx_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, e1 := callstatx(dirfd, uintptr(unsafe.Pointer(_p0)), flags, mask, uintptr(unsafe.Pointer(stat))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sync() { callsync() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Times(tms *Tms) (ticks uintptr, err error) { r0, e1 := calltimes(uintptr(unsafe.Pointer(tms))) ticks = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Umask(mask int) (oldmask int) { r0, _ := callumask(mask) oldmask = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Uname(buf *Utsname) (err error) { _, e1 := calluname(uintptr(unsafe.Pointer(buf))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlink(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, e1 := callunlink(uintptr(unsafe.Pointer(_p0))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlinkat(dirfd int, path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, e1 := callunlinkat(dirfd, uintptr(unsafe.Pointer(_p0)), flags) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ustat(dev int, ubuf *Ustat_t) (err error) { _, e1 := callustat(dev, uintptr(unsafe.Pointer(ubuf))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func write(fd int, p []byte) (n int, err error) { var _p0 *byte if len(p) > 0 { _p0 = &p[0] } r0, e1 := callwrite(fd, uintptr(unsafe.Pointer(_p0)), len(p)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup2(oldfd int, newfd int) (err error) { _, e1 := calldup2(oldfd, newfd) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, e1 := callposix_fadvise64(fd, offset, length, advice) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { _, e1 := callfchown(fd, uid, gid) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fstat(fd int, stat *Stat_t) (err error) { _, e1 := callfstat(fd, uintptr(unsafe.Pointer(stat))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, e1 := callfstatat(dirfd, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), flags) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatfs(fd int, buf *Statfs_t) (err error) { _, e1 := callfstatfs(fd, uintptr(unsafe.Pointer(buf))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { _, e1 := callftruncate(fd, length) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { r0, _ := callgetegid() egid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (euid int) { r0, _ := callgeteuid() euid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _ := callgetgid() gid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _ := callgetuid() uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, e1 := calllchown(uintptr(unsafe.Pointer(_p0)), uid, gid) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, n int) (err error) { _, e1 := calllisten(s, n) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func lstat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, e1 := calllstat(uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pause() (err error) { _, e1 := callpause() if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 *byte if len(p) > 0 { _p0 = &p[0] } r0, e1 := callpread64(fd, uintptr(unsafe.Pointer(_p0)), len(p), offset) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 *byte if len(p) > 0 { _p0 = &p[0] } r0, e1 := callpwrite64(fd, uintptr(unsafe.Pointer(_p0)), len(p), offset) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { r0, e1 := callselect(nfd, uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pselect(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { r0, e1 := callpselect(nfd, uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setregid(rgid int, egid int) (err error) { _, e1 := callsetregid(rgid, egid) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setreuid(ruid int, euid int) (err error) { _, e1 := callsetreuid(ruid, euid) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(fd int, how int) (err error) { _, e1 := callshutdown(fd, how) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) { r0, e1 := callsplice(rfd, uintptr(unsafe.Pointer(roff)), wfd, uintptr(unsafe.Pointer(woff)), len, flags) n = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func stat(path string, statptr *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, e1 := callstat(uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(statptr))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Statfs(path string, buf *Statfs_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, e1 := callstatfs(uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, e1 := calltruncate(uintptr(unsafe.Pointer(_p0)), length) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, e1 := callbind(s, uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, e1 := callconnect(s, uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(n int, list *_Gid_t) (nn int, err error) { r0, e1 := callgetgroups(n, uintptr(unsafe.Pointer(list))) nn = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(n int, list *_Gid_t) (err error) { _, e1 := callsetgroups(n, uintptr(unsafe.Pointer(list))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { _, e1 := callgetsockopt(s, level, name, uintptr(val), uintptr(unsafe.Pointer(vallen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { _, e1 := callsetsockopt(s, level, name, uintptr(val), vallen) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { r0, e1 := callsocket(domain, typ, proto) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { _, e1 := callsocketpair(domain, typ, proto, uintptr(unsafe.Pointer(fd))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, e1 := callgetpeername(fd, uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, e1 := callgetsockname(fd, uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { var _p0 *byte if len(p) > 0 { _p0 = &p[0] } r0, e1 := callrecvfrom(fd, uintptr(unsafe.Pointer(_p0)), len(p), flags, uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { var _p0 *byte if len(buf) > 0 { _p0 = &buf[0] } _, e1 := callsendto(s, uintptr(unsafe.Pointer(_p0)), len(buf), flags, uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, e1 := callnrecvmsg(s, uintptr(unsafe.Pointer(msg)), flags) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, e1 := callnsendmsg(s, uintptr(unsafe.Pointer(msg)), flags) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func munmap(addr uintptr, length uintptr) (err error) { _, e1 := callmunmap(addr, length) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Madvise(b []byte, advice int) (err error) { var _p0 *byte if len(b) > 0 { _p0 = &b[0] } _, e1 := callmadvise(uintptr(unsafe.Pointer(_p0)), len(b), advice) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mprotect(b []byte, prot int) (err error) { var _p0 *byte if len(b) > 0 { _p0 = &b[0] } _, e1 := callmprotect(uintptr(unsafe.Pointer(_p0)), len(b), prot) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlock(b []byte) (err error) { var _p0 *byte if len(b) > 0 { _p0 = &b[0] } _, e1 := callmlock(uintptr(unsafe.Pointer(_p0)), len(b)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlockall(flags int) (err error) { _, e1 := callmlockall(flags) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Msync(b []byte, flags int) (err error) { var _p0 *byte if len(b) > 0 { _p0 = &b[0] } _, e1 := callmsync(uintptr(unsafe.Pointer(_p0)), len(b), flags) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlock(b []byte) (err error) { var _p0 *byte if len(b) > 0 { _p0 = &b[0] } _, e1 := callmunlock(uintptr(unsafe.Pointer(_p0)), len(b)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlockall() (err error) { _, e1 := callmunlockall() if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe(p *[2]_C_int) (err error) { _, e1 := callpipe(uintptr(unsafe.Pointer(p))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, e1 := callpoll(uintptr(unsafe.Pointer(fds)), nfds, timeout) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func gettimeofday(tv *Timeval, tzp *Timezone) (err error) { _, e1 := callgettimeofday(uintptr(unsafe.Pointer(tv)), uintptr(unsafe.Pointer(tzp))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Time(t *Time_t) (tt Time_t, err error) { r0, e1 := calltime(uintptr(unsafe.Pointer(t))) tt = Time_t(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Utime(path string, buf *Utimbuf) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, e1 := callutime(uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getsystemcfg(label int) (n uint64) { r0, _ := callgetsystemcfg(label) n = uint64(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func umount(target string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(target) if err != nil { return } _, e1 := callumount(uintptr(unsafe.Pointer(_p0))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(resource int, rlim *Rlimit) (err error) { _, e1 := callgetrlimit(resource, uintptr(unsafe.Pointer(rlim))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seek(fd int, offset int64, whence int) (off int64, err error) { r0, e1 := calllseek(fd, offset, whence) off = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) { r0, e1 := callmmap64(addr, length, prot, flags, fd, offset) xaddr = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gc.go ================================================ // go run mksyscall_aix_ppc64.go -aix -tags aix,ppc64 syscall_aix.go syscall_aix_ppc64.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build aix && ppc64 && gc package unix import ( "unsafe" ) //go:cgo_import_dynamic libc_utimes utimes "libc.a/shr_64.o" //go:cgo_import_dynamic libc_utimensat utimensat "libc.a/shr_64.o" //go:cgo_import_dynamic libc_getcwd getcwd "libc.a/shr_64.o" //go:cgo_import_dynamic libc_accept accept "libc.a/shr_64.o" //go:cgo_import_dynamic libc_getdirent getdirent "libc.a/shr_64.o" //go:cgo_import_dynamic libc_wait4 wait4 "libc.a/shr_64.o" //go:cgo_import_dynamic libc_ioctl ioctl "libc.a/shr_64.o" //go:cgo_import_dynamic libc_fcntl fcntl "libc.a/shr_64.o" //go:cgo_import_dynamic libc_fsync_range fsync_range "libc.a/shr_64.o" //go:cgo_import_dynamic libc_acct acct "libc.a/shr_64.o" //go:cgo_import_dynamic libc_chdir chdir "libc.a/shr_64.o" //go:cgo_import_dynamic libc_chroot chroot "libc.a/shr_64.o" //go:cgo_import_dynamic libc_close close "libc.a/shr_64.o" //go:cgo_import_dynamic libc_dup dup "libc.a/shr_64.o" //go:cgo_import_dynamic libc_exit exit "libc.a/shr_64.o" //go:cgo_import_dynamic libc_faccessat faccessat "libc.a/shr_64.o" //go:cgo_import_dynamic libc_fchdir fchdir "libc.a/shr_64.o" //go:cgo_import_dynamic libc_fchmod fchmod "libc.a/shr_64.o" //go:cgo_import_dynamic libc_fchmodat fchmodat "libc.a/shr_64.o" //go:cgo_import_dynamic libc_fchownat fchownat "libc.a/shr_64.o" //go:cgo_import_dynamic libc_fdatasync fdatasync "libc.a/shr_64.o" //go:cgo_import_dynamic libc_getpgid getpgid "libc.a/shr_64.o" //go:cgo_import_dynamic libc_getpgrp getpgrp "libc.a/shr_64.o" //go:cgo_import_dynamic libc_getpid getpid "libc.a/shr_64.o" //go:cgo_import_dynamic libc_getppid getppid "libc.a/shr_64.o" //go:cgo_import_dynamic libc_getpriority getpriority "libc.a/shr_64.o" //go:cgo_import_dynamic libc_getrusage getrusage "libc.a/shr_64.o" //go:cgo_import_dynamic libc_getsid getsid "libc.a/shr_64.o" //go:cgo_import_dynamic libc_kill kill "libc.a/shr_64.o" //go:cgo_import_dynamic libc_syslog syslog "libc.a/shr_64.o" //go:cgo_import_dynamic libc_mkdir mkdir "libc.a/shr_64.o" //go:cgo_import_dynamic libc_mkdirat mkdirat "libc.a/shr_64.o" //go:cgo_import_dynamic libc_mkfifo mkfifo "libc.a/shr_64.o" //go:cgo_import_dynamic libc_mknod mknod "libc.a/shr_64.o" //go:cgo_import_dynamic libc_mknodat mknodat "libc.a/shr_64.o" //go:cgo_import_dynamic libc_nanosleep nanosleep "libc.a/shr_64.o" //go:cgo_import_dynamic libc_open64 open64 "libc.a/shr_64.o" //go:cgo_import_dynamic libc_openat openat "libc.a/shr_64.o" //go:cgo_import_dynamic libc_read read "libc.a/shr_64.o" //go:cgo_import_dynamic libc_readlink readlink "libc.a/shr_64.o" //go:cgo_import_dynamic libc_renameat renameat "libc.a/shr_64.o" //go:cgo_import_dynamic libc_setdomainname setdomainname "libc.a/shr_64.o" //go:cgo_import_dynamic libc_sethostname sethostname "libc.a/shr_64.o" //go:cgo_import_dynamic libc_setpgid setpgid "libc.a/shr_64.o" //go:cgo_import_dynamic libc_setsid setsid "libc.a/shr_64.o" //go:cgo_import_dynamic libc_settimeofday settimeofday "libc.a/shr_64.o" //go:cgo_import_dynamic libc_setuid setuid "libc.a/shr_64.o" //go:cgo_import_dynamic libc_setgid setgid "libc.a/shr_64.o" //go:cgo_import_dynamic libc_setpriority setpriority "libc.a/shr_64.o" //go:cgo_import_dynamic libc_statx statx "libc.a/shr_64.o" //go:cgo_import_dynamic libc_sync sync "libc.a/shr_64.o" //go:cgo_import_dynamic libc_times times "libc.a/shr_64.o" //go:cgo_import_dynamic libc_umask umask "libc.a/shr_64.o" //go:cgo_import_dynamic libc_uname uname "libc.a/shr_64.o" //go:cgo_import_dynamic libc_unlink unlink "libc.a/shr_64.o" //go:cgo_import_dynamic libc_unlinkat unlinkat "libc.a/shr_64.o" //go:cgo_import_dynamic libc_ustat ustat "libc.a/shr_64.o" //go:cgo_import_dynamic libc_write write "libc.a/shr_64.o" //go:cgo_import_dynamic libc_dup2 dup2 "libc.a/shr_64.o" //go:cgo_import_dynamic libc_posix_fadvise64 posix_fadvise64 "libc.a/shr_64.o" //go:cgo_import_dynamic libc_fchown fchown "libc.a/shr_64.o" //go:cgo_import_dynamic libc_fstat fstat "libc.a/shr_64.o" //go:cgo_import_dynamic libc_fstatat fstatat "libc.a/shr_64.o" //go:cgo_import_dynamic libc_fstatfs fstatfs "libc.a/shr_64.o" //go:cgo_import_dynamic libc_ftruncate ftruncate "libc.a/shr_64.o" //go:cgo_import_dynamic libc_getegid getegid "libc.a/shr_64.o" //go:cgo_import_dynamic libc_geteuid geteuid "libc.a/shr_64.o" //go:cgo_import_dynamic libc_getgid getgid "libc.a/shr_64.o" //go:cgo_import_dynamic libc_getuid getuid "libc.a/shr_64.o" //go:cgo_import_dynamic libc_lchown lchown "libc.a/shr_64.o" //go:cgo_import_dynamic libc_listen listen "libc.a/shr_64.o" //go:cgo_import_dynamic libc_lstat lstat "libc.a/shr_64.o" //go:cgo_import_dynamic libc_pause pause "libc.a/shr_64.o" //go:cgo_import_dynamic libc_pread64 pread64 "libc.a/shr_64.o" //go:cgo_import_dynamic libc_pwrite64 pwrite64 "libc.a/shr_64.o" //go:cgo_import_dynamic libc_select select "libc.a/shr_64.o" //go:cgo_import_dynamic libc_pselect pselect "libc.a/shr_64.o" //go:cgo_import_dynamic libc_setregid setregid "libc.a/shr_64.o" //go:cgo_import_dynamic libc_setreuid setreuid "libc.a/shr_64.o" //go:cgo_import_dynamic libc_shutdown shutdown "libc.a/shr_64.o" //go:cgo_import_dynamic libc_splice splice "libc.a/shr_64.o" //go:cgo_import_dynamic libc_stat stat "libc.a/shr_64.o" //go:cgo_import_dynamic libc_statfs statfs "libc.a/shr_64.o" //go:cgo_import_dynamic libc_truncate truncate "libc.a/shr_64.o" //go:cgo_import_dynamic libc_bind bind "libc.a/shr_64.o" //go:cgo_import_dynamic libc_connect connect "libc.a/shr_64.o" //go:cgo_import_dynamic libc_getgroups getgroups "libc.a/shr_64.o" //go:cgo_import_dynamic libc_setgroups setgroups "libc.a/shr_64.o" //go:cgo_import_dynamic libc_getsockopt getsockopt "libc.a/shr_64.o" //go:cgo_import_dynamic libc_setsockopt setsockopt "libc.a/shr_64.o" //go:cgo_import_dynamic libc_socket socket "libc.a/shr_64.o" //go:cgo_import_dynamic libc_socketpair socketpair "libc.a/shr_64.o" //go:cgo_import_dynamic libc_getpeername getpeername "libc.a/shr_64.o" //go:cgo_import_dynamic libc_getsockname getsockname "libc.a/shr_64.o" //go:cgo_import_dynamic libc_recvfrom recvfrom "libc.a/shr_64.o" //go:cgo_import_dynamic libc_sendto sendto "libc.a/shr_64.o" //go:cgo_import_dynamic libc_nrecvmsg nrecvmsg "libc.a/shr_64.o" //go:cgo_import_dynamic libc_nsendmsg nsendmsg "libc.a/shr_64.o" //go:cgo_import_dynamic libc_munmap munmap "libc.a/shr_64.o" //go:cgo_import_dynamic libc_madvise madvise "libc.a/shr_64.o" //go:cgo_import_dynamic libc_mprotect mprotect "libc.a/shr_64.o" //go:cgo_import_dynamic libc_mlock mlock "libc.a/shr_64.o" //go:cgo_import_dynamic libc_mlockall mlockall "libc.a/shr_64.o" //go:cgo_import_dynamic libc_msync msync "libc.a/shr_64.o" //go:cgo_import_dynamic libc_munlock munlock "libc.a/shr_64.o" //go:cgo_import_dynamic libc_munlockall munlockall "libc.a/shr_64.o" //go:cgo_import_dynamic libc_pipe pipe "libc.a/shr_64.o" //go:cgo_import_dynamic libc_poll poll "libc.a/shr_64.o" //go:cgo_import_dynamic libc_gettimeofday gettimeofday "libc.a/shr_64.o" //go:cgo_import_dynamic libc_time time "libc.a/shr_64.o" //go:cgo_import_dynamic libc_utime utime "libc.a/shr_64.o" //go:cgo_import_dynamic libc_getsystemcfg getsystemcfg "libc.a/shr_64.o" //go:cgo_import_dynamic libc_umount umount "libc.a/shr_64.o" //go:cgo_import_dynamic libc_getrlimit getrlimit "libc.a/shr_64.o" //go:cgo_import_dynamic libc_lseek lseek "libc.a/shr_64.o" //go:cgo_import_dynamic libc_mmap64 mmap64 "libc.a/shr_64.o" //go:linkname libc_utimes libc_utimes //go:linkname libc_utimensat libc_utimensat //go:linkname libc_getcwd libc_getcwd //go:linkname libc_accept libc_accept //go:linkname libc_getdirent libc_getdirent //go:linkname libc_wait4 libc_wait4 //go:linkname libc_ioctl libc_ioctl //go:linkname libc_fcntl libc_fcntl //go:linkname libc_fsync_range libc_fsync_range //go:linkname libc_acct libc_acct //go:linkname libc_chdir libc_chdir //go:linkname libc_chroot libc_chroot //go:linkname libc_close libc_close //go:linkname libc_dup libc_dup //go:linkname libc_exit libc_exit //go:linkname libc_faccessat libc_faccessat //go:linkname libc_fchdir libc_fchdir //go:linkname libc_fchmod libc_fchmod //go:linkname libc_fchmodat libc_fchmodat //go:linkname libc_fchownat libc_fchownat //go:linkname libc_fdatasync libc_fdatasync //go:linkname libc_getpgid libc_getpgid //go:linkname libc_getpgrp libc_getpgrp //go:linkname libc_getpid libc_getpid //go:linkname libc_getppid libc_getppid //go:linkname libc_getpriority libc_getpriority //go:linkname libc_getrusage libc_getrusage //go:linkname libc_getsid libc_getsid //go:linkname libc_kill libc_kill //go:linkname libc_syslog libc_syslog //go:linkname libc_mkdir libc_mkdir //go:linkname libc_mkdirat libc_mkdirat //go:linkname libc_mkfifo libc_mkfifo //go:linkname libc_mknod libc_mknod //go:linkname libc_mknodat libc_mknodat //go:linkname libc_nanosleep libc_nanosleep //go:linkname libc_open64 libc_open64 //go:linkname libc_openat libc_openat //go:linkname libc_read libc_read //go:linkname libc_readlink libc_readlink //go:linkname libc_renameat libc_renameat //go:linkname libc_setdomainname libc_setdomainname //go:linkname libc_sethostname libc_sethostname //go:linkname libc_setpgid libc_setpgid //go:linkname libc_setsid libc_setsid //go:linkname libc_settimeofday libc_settimeofday //go:linkname libc_setuid libc_setuid //go:linkname libc_setgid libc_setgid //go:linkname libc_setpriority libc_setpriority //go:linkname libc_statx libc_statx //go:linkname libc_sync libc_sync //go:linkname libc_times libc_times //go:linkname libc_umask libc_umask //go:linkname libc_uname libc_uname //go:linkname libc_unlink libc_unlink //go:linkname libc_unlinkat libc_unlinkat //go:linkname libc_ustat libc_ustat //go:linkname libc_write libc_write //go:linkname libc_dup2 libc_dup2 //go:linkname libc_posix_fadvise64 libc_posix_fadvise64 //go:linkname libc_fchown libc_fchown //go:linkname libc_fstat libc_fstat //go:linkname libc_fstatat libc_fstatat //go:linkname libc_fstatfs libc_fstatfs //go:linkname libc_ftruncate libc_ftruncate //go:linkname libc_getegid libc_getegid //go:linkname libc_geteuid libc_geteuid //go:linkname libc_getgid libc_getgid //go:linkname libc_getuid libc_getuid //go:linkname libc_lchown libc_lchown //go:linkname libc_listen libc_listen //go:linkname libc_lstat libc_lstat //go:linkname libc_pause libc_pause //go:linkname libc_pread64 libc_pread64 //go:linkname libc_pwrite64 libc_pwrite64 //go:linkname libc_select libc_select //go:linkname libc_pselect libc_pselect //go:linkname libc_setregid libc_setregid //go:linkname libc_setreuid libc_setreuid //go:linkname libc_shutdown libc_shutdown //go:linkname libc_splice libc_splice //go:linkname libc_stat libc_stat //go:linkname libc_statfs libc_statfs //go:linkname libc_truncate libc_truncate //go:linkname libc_bind libc_bind //go:linkname libc_connect libc_connect //go:linkname libc_getgroups libc_getgroups //go:linkname libc_setgroups libc_setgroups //go:linkname libc_getsockopt libc_getsockopt //go:linkname libc_setsockopt libc_setsockopt //go:linkname libc_socket libc_socket //go:linkname libc_socketpair libc_socketpair //go:linkname libc_getpeername libc_getpeername //go:linkname libc_getsockname libc_getsockname //go:linkname libc_recvfrom libc_recvfrom //go:linkname libc_sendto libc_sendto //go:linkname libc_nrecvmsg libc_nrecvmsg //go:linkname libc_nsendmsg libc_nsendmsg //go:linkname libc_munmap libc_munmap //go:linkname libc_madvise libc_madvise //go:linkname libc_mprotect libc_mprotect //go:linkname libc_mlock libc_mlock //go:linkname libc_mlockall libc_mlockall //go:linkname libc_msync libc_msync //go:linkname libc_munlock libc_munlock //go:linkname libc_munlockall libc_munlockall //go:linkname libc_pipe libc_pipe //go:linkname libc_poll libc_poll //go:linkname libc_gettimeofday libc_gettimeofday //go:linkname libc_time libc_time //go:linkname libc_utime libc_utime //go:linkname libc_getsystemcfg libc_getsystemcfg //go:linkname libc_umount libc_umount //go:linkname libc_getrlimit libc_getrlimit //go:linkname libc_lseek libc_lseek //go:linkname libc_mmap64 libc_mmap64 type syscallFunc uintptr var ( libc_utimes, libc_utimensat, libc_getcwd, libc_accept, libc_getdirent, libc_wait4, libc_ioctl, libc_fcntl, libc_fsync_range, libc_acct, libc_chdir, libc_chroot, libc_close, libc_dup, libc_exit, libc_faccessat, libc_fchdir, libc_fchmod, libc_fchmodat, libc_fchownat, libc_fdatasync, libc_getpgid, libc_getpgrp, libc_getpid, libc_getppid, libc_getpriority, libc_getrusage, libc_getsid, libc_kill, libc_syslog, libc_mkdir, libc_mkdirat, libc_mkfifo, libc_mknod, libc_mknodat, libc_nanosleep, libc_open64, libc_openat, libc_read, libc_readlink, libc_renameat, libc_setdomainname, libc_sethostname, libc_setpgid, libc_setsid, libc_settimeofday, libc_setuid, libc_setgid, libc_setpriority, libc_statx, libc_sync, libc_times, libc_umask, libc_uname, libc_unlink, libc_unlinkat, libc_ustat, libc_write, libc_dup2, libc_posix_fadvise64, libc_fchown, libc_fstat, libc_fstatat, libc_fstatfs, libc_ftruncate, libc_getegid, libc_geteuid, libc_getgid, libc_getuid, libc_lchown, libc_listen, libc_lstat, libc_pause, libc_pread64, libc_pwrite64, libc_select, libc_pselect, libc_setregid, libc_setreuid, libc_shutdown, libc_splice, libc_stat, libc_statfs, libc_truncate, libc_bind, libc_connect, libc_getgroups, libc_setgroups, libc_getsockopt, libc_setsockopt, libc_socket, libc_socketpair, libc_getpeername, libc_getsockname, libc_recvfrom, libc_sendto, libc_nrecvmsg, libc_nsendmsg, libc_munmap, libc_madvise, libc_mprotect, libc_mlock, libc_mlockall, libc_msync, libc_munlock, libc_munlockall, libc_pipe, libc_poll, libc_gettimeofday, libc_time, libc_utime, libc_getsystemcfg, libc_umount, libc_getrlimit, libc_lseek, libc_mmap64 syscallFunc ) // Implemented in runtime/syscall_aix.go. func rawSyscall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) func syscall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callutimes(_p0 uintptr, times uintptr) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_utimes)), 2, _p0, times, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callutimensat(dirfd int, _p0 uintptr, times uintptr, flag int) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_utimensat)), 4, uintptr(dirfd), _p0, times, uintptr(flag), 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callgetcwd(_p0 uintptr, _lenp0 int) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_getcwd)), 2, _p0, uintptr(_lenp0), 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callaccept(s int, rsa uintptr, addrlen uintptr) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_accept)), 3, uintptr(s), rsa, addrlen, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callgetdirent(fd int, _p0 uintptr, _lenp0 int) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_getdirent)), 3, uintptr(fd), _p0, uintptr(_lenp0), 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callwait4(pid int, status uintptr, options int, rusage uintptr) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_wait4)), 4, uintptr(pid), status, uintptr(options), rusage, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callioctl(fd int, req int, arg uintptr) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_ioctl)), 3, uintptr(fd), uintptr(req), arg, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callioctl_ptr(fd int, req int, arg unsafe.Pointer) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_ioctl)), 3, uintptr(fd), uintptr(req), uintptr(arg), 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callfcntl(fd uintptr, cmd int, arg uintptr) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_fcntl)), 3, fd, uintptr(cmd), arg, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callfsync_range(fd int, how int, start int64, length int64) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_fsync_range)), 4, uintptr(fd), uintptr(how), uintptr(start), uintptr(length), 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callacct(_p0 uintptr) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_acct)), 1, _p0, 0, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callchdir(_p0 uintptr) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_chdir)), 1, _p0, 0, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callchroot(_p0 uintptr) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_chroot)), 1, _p0, 0, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callclose(fd int) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_close)), 1, uintptr(fd), 0, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func calldup(oldfd int) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_dup)), 1, uintptr(oldfd), 0, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callexit(code int) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_exit)), 1, uintptr(code), 0, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callfaccessat(dirfd int, _p0 uintptr, mode uint32, flags int) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_faccessat)), 4, uintptr(dirfd), _p0, uintptr(mode), uintptr(flags), 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callfchdir(fd int) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_fchdir)), 1, uintptr(fd), 0, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callfchmod(fd int, mode uint32) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_fchmod)), 2, uintptr(fd), uintptr(mode), 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callfchmodat(dirfd int, _p0 uintptr, mode uint32, flags int) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_fchmodat)), 4, uintptr(dirfd), _p0, uintptr(mode), uintptr(flags), 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callfchownat(dirfd int, _p0 uintptr, uid int, gid int, flags int) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_fchownat)), 5, uintptr(dirfd), _p0, uintptr(uid), uintptr(gid), uintptr(flags), 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callfdatasync(fd int) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_fdatasync)), 1, uintptr(fd), 0, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callgetpgid(pid int) (r1 uintptr, e1 Errno) { r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_getpgid)), 1, uintptr(pid), 0, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callgetpgrp() (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_getpgrp)), 0, 0, 0, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callgetpid() (r1 uintptr, e1 Errno) { r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_getpid)), 0, 0, 0, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callgetppid() (r1 uintptr, e1 Errno) { r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_getppid)), 0, 0, 0, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callgetpriority(which int, who int) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_getpriority)), 2, uintptr(which), uintptr(who), 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callgetrusage(who int, rusage uintptr) (r1 uintptr, e1 Errno) { r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_getrusage)), 2, uintptr(who), rusage, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callgetsid(pid int) (r1 uintptr, e1 Errno) { r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_getsid)), 1, uintptr(pid), 0, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callkill(pid int, sig int) (r1 uintptr, e1 Errno) { r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_kill)), 2, uintptr(pid), uintptr(sig), 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callsyslog(typ int, _p0 uintptr, _lenp0 int) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_syslog)), 3, uintptr(typ), _p0, uintptr(_lenp0), 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callmkdir(dirfd int, _p0 uintptr, mode uint32) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_mkdir)), 3, uintptr(dirfd), _p0, uintptr(mode), 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callmkdirat(dirfd int, _p0 uintptr, mode uint32) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_mkdirat)), 3, uintptr(dirfd), _p0, uintptr(mode), 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callmkfifo(_p0 uintptr, mode uint32) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_mkfifo)), 2, _p0, uintptr(mode), 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callmknod(_p0 uintptr, mode uint32, dev int) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_mknod)), 3, _p0, uintptr(mode), uintptr(dev), 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callmknodat(dirfd int, _p0 uintptr, mode uint32, dev int) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_mknodat)), 4, uintptr(dirfd), _p0, uintptr(mode), uintptr(dev), 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callnanosleep(time uintptr, leftover uintptr) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_nanosleep)), 2, time, leftover, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callopen64(_p0 uintptr, mode int, perm uint32) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_open64)), 3, _p0, uintptr(mode), uintptr(perm), 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callopenat(dirfd int, _p0 uintptr, flags int, mode uint32) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_openat)), 4, uintptr(dirfd), _p0, uintptr(flags), uintptr(mode), 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callread(fd int, _p0 uintptr, _lenp0 int) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_read)), 3, uintptr(fd), _p0, uintptr(_lenp0), 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callreadlink(_p0 uintptr, _p1 uintptr, _lenp1 int) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_readlink)), 3, _p0, _p1, uintptr(_lenp1), 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callrenameat(olddirfd int, _p0 uintptr, newdirfd int, _p1 uintptr) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_renameat)), 4, uintptr(olddirfd), _p0, uintptr(newdirfd), _p1, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callsetdomainname(_p0 uintptr, _lenp0 int) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_setdomainname)), 2, _p0, uintptr(_lenp0), 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callsethostname(_p0 uintptr, _lenp0 int) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_sethostname)), 2, _p0, uintptr(_lenp0), 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callsetpgid(pid int, pgid int) (r1 uintptr, e1 Errno) { r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_setpgid)), 2, uintptr(pid), uintptr(pgid), 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callsetsid() (r1 uintptr, e1 Errno) { r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_setsid)), 0, 0, 0, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callsettimeofday(tv uintptr) (r1 uintptr, e1 Errno) { r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_settimeofday)), 1, tv, 0, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callsetuid(uid int) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_setuid)), 1, uintptr(uid), 0, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callsetgid(uid int) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_setgid)), 1, uintptr(uid), 0, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callsetpriority(which int, who int, prio int) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_setpriority)), 3, uintptr(which), uintptr(who), uintptr(prio), 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callstatx(dirfd int, _p0 uintptr, flags int, mask int, stat uintptr) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_statx)), 5, uintptr(dirfd), _p0, uintptr(flags), uintptr(mask), stat, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callsync() (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_sync)), 0, 0, 0, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func calltimes(tms uintptr) (r1 uintptr, e1 Errno) { r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_times)), 1, tms, 0, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callumask(mask int) (r1 uintptr, e1 Errno) { r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_umask)), 1, uintptr(mask), 0, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func calluname(buf uintptr) (r1 uintptr, e1 Errno) { r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_uname)), 1, buf, 0, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callunlink(_p0 uintptr) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_unlink)), 1, _p0, 0, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callunlinkat(dirfd int, _p0 uintptr, flags int) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_unlinkat)), 3, uintptr(dirfd), _p0, uintptr(flags), 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callustat(dev int, ubuf uintptr) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_ustat)), 2, uintptr(dev), ubuf, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callwrite(fd int, _p0 uintptr, _lenp0 int) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_write)), 3, uintptr(fd), _p0, uintptr(_lenp0), 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func calldup2(oldfd int, newfd int) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_dup2)), 2, uintptr(oldfd), uintptr(newfd), 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callposix_fadvise64(fd int, offset int64, length int64, advice int) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_posix_fadvise64)), 4, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callfchown(fd int, uid int, gid int) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_fchown)), 3, uintptr(fd), uintptr(uid), uintptr(gid), 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callfstat(fd int, stat uintptr) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_fstat)), 2, uintptr(fd), stat, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callfstatat(dirfd int, _p0 uintptr, stat uintptr, flags int) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_fstatat)), 4, uintptr(dirfd), _p0, stat, uintptr(flags), 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callfstatfs(fd int, buf uintptr) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_fstatfs)), 2, uintptr(fd), buf, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callftruncate(fd int, length int64) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_ftruncate)), 2, uintptr(fd), uintptr(length), 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callgetegid() (r1 uintptr, e1 Errno) { r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_getegid)), 0, 0, 0, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callgeteuid() (r1 uintptr, e1 Errno) { r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_geteuid)), 0, 0, 0, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callgetgid() (r1 uintptr, e1 Errno) { r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_getgid)), 0, 0, 0, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callgetuid() (r1 uintptr, e1 Errno) { r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_getuid)), 0, 0, 0, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func calllchown(_p0 uintptr, uid int, gid int) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_lchown)), 3, _p0, uintptr(uid), uintptr(gid), 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func calllisten(s int, n int) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_listen)), 2, uintptr(s), uintptr(n), 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func calllstat(_p0 uintptr, stat uintptr) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_lstat)), 2, _p0, stat, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callpause() (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_pause)), 0, 0, 0, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callpread64(fd int, _p0 uintptr, _lenp0 int, offset int64) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_pread64)), 4, uintptr(fd), _p0, uintptr(_lenp0), uintptr(offset), 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callpwrite64(fd int, _p0 uintptr, _lenp0 int, offset int64) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_pwrite64)), 4, uintptr(fd), _p0, uintptr(_lenp0), uintptr(offset), 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callselect(nfd int, r uintptr, w uintptr, e uintptr, timeout uintptr) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_select)), 5, uintptr(nfd), r, w, e, timeout, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callpselect(nfd int, r uintptr, w uintptr, e uintptr, timeout uintptr, sigmask uintptr) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_pselect)), 6, uintptr(nfd), r, w, e, timeout, sigmask) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callsetregid(rgid int, egid int) (r1 uintptr, e1 Errno) { r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_setregid)), 2, uintptr(rgid), uintptr(egid), 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callsetreuid(ruid int, euid int) (r1 uintptr, e1 Errno) { r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_setreuid)), 2, uintptr(ruid), uintptr(euid), 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callshutdown(fd int, how int) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_shutdown)), 2, uintptr(fd), uintptr(how), 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callsplice(rfd int, roff uintptr, wfd int, woff uintptr, len int, flags int) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_splice)), 6, uintptr(rfd), roff, uintptr(wfd), woff, uintptr(len), uintptr(flags)) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callstat(_p0 uintptr, statptr uintptr) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_stat)), 2, _p0, statptr, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callstatfs(_p0 uintptr, buf uintptr) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_statfs)), 2, _p0, buf, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func calltruncate(_p0 uintptr, length int64) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_truncate)), 2, _p0, uintptr(length), 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callbind(s int, addr uintptr, addrlen uintptr) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_bind)), 3, uintptr(s), addr, addrlen, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callconnect(s int, addr uintptr, addrlen uintptr) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_connect)), 3, uintptr(s), addr, addrlen, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callgetgroups(n int, list uintptr) (r1 uintptr, e1 Errno) { r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_getgroups)), 2, uintptr(n), list, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callsetgroups(n int, list uintptr) (r1 uintptr, e1 Errno) { r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_setgroups)), 2, uintptr(n), list, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callgetsockopt(s int, level int, name int, val uintptr, vallen uintptr) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_getsockopt)), 5, uintptr(s), uintptr(level), uintptr(name), val, vallen, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callsetsockopt(s int, level int, name int, val uintptr, vallen uintptr) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_setsockopt)), 5, uintptr(s), uintptr(level), uintptr(name), val, vallen, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callsocket(domain int, typ int, proto int) (r1 uintptr, e1 Errno) { r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_socket)), 3, uintptr(domain), uintptr(typ), uintptr(proto), 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callsocketpair(domain int, typ int, proto int, fd uintptr) (r1 uintptr, e1 Errno) { r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_socketpair)), 4, uintptr(domain), uintptr(typ), uintptr(proto), fd, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callgetpeername(fd int, rsa uintptr, addrlen uintptr) (r1 uintptr, e1 Errno) { r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_getpeername)), 3, uintptr(fd), rsa, addrlen, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callgetsockname(fd int, rsa uintptr, addrlen uintptr) (r1 uintptr, e1 Errno) { r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_getsockname)), 3, uintptr(fd), rsa, addrlen, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callrecvfrom(fd int, _p0 uintptr, _lenp0 int, flags int, from uintptr, fromlen uintptr) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_recvfrom)), 6, uintptr(fd), _p0, uintptr(_lenp0), uintptr(flags), from, fromlen) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callsendto(s int, _p0 uintptr, _lenp0 int, flags int, to uintptr, addrlen uintptr) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_sendto)), 6, uintptr(s), _p0, uintptr(_lenp0), uintptr(flags), to, addrlen) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callnrecvmsg(s int, msg uintptr, flags int) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_nrecvmsg)), 3, uintptr(s), msg, uintptr(flags), 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callnsendmsg(s int, msg uintptr, flags int) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_nsendmsg)), 3, uintptr(s), msg, uintptr(flags), 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callmunmap(addr uintptr, length uintptr) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_munmap)), 2, addr, length, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callmadvise(_p0 uintptr, _lenp0 int, advice int) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_madvise)), 3, _p0, uintptr(_lenp0), uintptr(advice), 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callmprotect(_p0 uintptr, _lenp0 int, prot int) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_mprotect)), 3, _p0, uintptr(_lenp0), uintptr(prot), 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callmlock(_p0 uintptr, _lenp0 int) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_mlock)), 2, _p0, uintptr(_lenp0), 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callmlockall(flags int) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_mlockall)), 1, uintptr(flags), 0, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callmsync(_p0 uintptr, _lenp0 int, flags int) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_msync)), 3, _p0, uintptr(_lenp0), uintptr(flags), 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callmunlock(_p0 uintptr, _lenp0 int) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_munlock)), 2, _p0, uintptr(_lenp0), 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callmunlockall() (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_munlockall)), 0, 0, 0, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callpipe(p uintptr) (r1 uintptr, e1 Errno) { r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_pipe)), 1, p, 0, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callpoll(fds uintptr, nfds int, timeout int) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_poll)), 3, fds, uintptr(nfds), uintptr(timeout), 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callgettimeofday(tv uintptr, tzp uintptr) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_gettimeofday)), 2, tv, tzp, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func calltime(t uintptr) (r1 uintptr, e1 Errno) { r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_time)), 1, t, 0, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callutime(_p0 uintptr, buf uintptr) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_utime)), 2, _p0, buf, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callgetsystemcfg(label int) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_getsystemcfg)), 1, uintptr(label), 0, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callumount(_p0 uintptr) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_umount)), 1, _p0, 0, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callgetrlimit(resource int, rlim uintptr) (r1 uintptr, e1 Errno) { r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_getrlimit)), 2, uintptr(resource), rlim, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func calllseek(fd int, offset int64, whence int) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_lseek)), 3, uintptr(fd), uintptr(offset), uintptr(whence), 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callmmap64(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (r1 uintptr, e1 Errno) { r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_mmap64)), 6, addr, length, uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset)) return } ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gccgo.go ================================================ // go run mksyscall_aix_ppc64.go -aix -tags aix,ppc64 syscall_aix.go syscall_aix_ppc64.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build aix && ppc64 && gccgo package unix /* #include int utimes(uintptr_t, uintptr_t); int utimensat(int, uintptr_t, uintptr_t, int); int getcwd(uintptr_t, size_t); int accept(int, uintptr_t, uintptr_t); int getdirent(int, uintptr_t, size_t); int wait4(int, uintptr_t, int, uintptr_t); int ioctl(int, int, uintptr_t); int fcntl(uintptr_t, int, uintptr_t); int fsync_range(int, int, long long, long long); int acct(uintptr_t); int chdir(uintptr_t); int chroot(uintptr_t); int close(int); int dup(int); void exit(int); int faccessat(int, uintptr_t, unsigned int, int); int fchdir(int); int fchmod(int, unsigned int); int fchmodat(int, uintptr_t, unsigned int, int); int fchownat(int, uintptr_t, int, int, int); int fdatasync(int); int getpgid(int); int getpgrp(); int getpid(); int getppid(); int getpriority(int, int); int getrusage(int, uintptr_t); int getsid(int); int kill(int, int); int syslog(int, uintptr_t, size_t); int mkdir(int, uintptr_t, unsigned int); int mkdirat(int, uintptr_t, unsigned int); int mkfifo(uintptr_t, unsigned int); int mknod(uintptr_t, unsigned int, int); int mknodat(int, uintptr_t, unsigned int, int); int nanosleep(uintptr_t, uintptr_t); int open64(uintptr_t, int, unsigned int); int openat(int, uintptr_t, int, unsigned int); int read(int, uintptr_t, size_t); int readlink(uintptr_t, uintptr_t, size_t); int renameat(int, uintptr_t, int, uintptr_t); int setdomainname(uintptr_t, size_t); int sethostname(uintptr_t, size_t); int setpgid(int, int); int setsid(); int settimeofday(uintptr_t); int setuid(int); int setgid(int); int setpriority(int, int, int); int statx(int, uintptr_t, int, int, uintptr_t); int sync(); uintptr_t times(uintptr_t); int umask(int); int uname(uintptr_t); int unlink(uintptr_t); int unlinkat(int, uintptr_t, int); int ustat(int, uintptr_t); int write(int, uintptr_t, size_t); int dup2(int, int); int posix_fadvise64(int, long long, long long, int); int fchown(int, int, int); int fstat(int, uintptr_t); int fstatat(int, uintptr_t, uintptr_t, int); int fstatfs(int, uintptr_t); int ftruncate(int, long long); int getegid(); int geteuid(); int getgid(); int getuid(); int lchown(uintptr_t, int, int); int listen(int, int); int lstat(uintptr_t, uintptr_t); int pause(); int pread64(int, uintptr_t, size_t, long long); int pwrite64(int, uintptr_t, size_t, long long); #define c_select select int select(int, uintptr_t, uintptr_t, uintptr_t, uintptr_t); int pselect(int, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); int setregid(int, int); int setreuid(int, int); int shutdown(int, int); long long splice(int, uintptr_t, int, uintptr_t, int, int); int stat(uintptr_t, uintptr_t); int statfs(uintptr_t, uintptr_t); int truncate(uintptr_t, long long); int bind(int, uintptr_t, uintptr_t); int connect(int, uintptr_t, uintptr_t); int getgroups(int, uintptr_t); int setgroups(int, uintptr_t); int getsockopt(int, int, int, uintptr_t, uintptr_t); int setsockopt(int, int, int, uintptr_t, uintptr_t); int socket(int, int, int); int socketpair(int, int, int, uintptr_t); int getpeername(int, uintptr_t, uintptr_t); int getsockname(int, uintptr_t, uintptr_t); int recvfrom(int, uintptr_t, size_t, int, uintptr_t, uintptr_t); int sendto(int, uintptr_t, size_t, int, uintptr_t, uintptr_t); int nrecvmsg(int, uintptr_t, int); int nsendmsg(int, uintptr_t, int); int munmap(uintptr_t, uintptr_t); int madvise(uintptr_t, size_t, int); int mprotect(uintptr_t, size_t, int); int mlock(uintptr_t, size_t); int mlockall(int); int msync(uintptr_t, size_t, int); int munlock(uintptr_t, size_t); int munlockall(); int pipe(uintptr_t); int poll(uintptr_t, int, int); int gettimeofday(uintptr_t, uintptr_t); int time(uintptr_t); int utime(uintptr_t, uintptr_t); unsigned long long getsystemcfg(int); int umount(uintptr_t); int getrlimit(int, uintptr_t); long long lseek(int, long long, int); uintptr_t mmap64(uintptr_t, uintptr_t, int, int, int, long long); */ import "C" import ( "syscall" "unsafe" ) // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callutimes(_p0 uintptr, times uintptr) (r1 uintptr, e1 Errno) { r1 = uintptr(C.utimes(C.uintptr_t(_p0), C.uintptr_t(times))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callutimensat(dirfd int, _p0 uintptr, times uintptr, flag int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.utimensat(C.int(dirfd), C.uintptr_t(_p0), C.uintptr_t(times), C.int(flag))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callgetcwd(_p0 uintptr, _lenp0 int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.getcwd(C.uintptr_t(_p0), C.size_t(_lenp0))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callaccept(s int, rsa uintptr, addrlen uintptr) (r1 uintptr, e1 Errno) { r1 = uintptr(C.accept(C.int(s), C.uintptr_t(rsa), C.uintptr_t(addrlen))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callgetdirent(fd int, _p0 uintptr, _lenp0 int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.getdirent(C.int(fd), C.uintptr_t(_p0), C.size_t(_lenp0))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callwait4(pid int, status uintptr, options int, rusage uintptr) (r1 uintptr, e1 Errno) { r1 = uintptr(C.wait4(C.int(pid), C.uintptr_t(status), C.int(options), C.uintptr_t(rusage))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callioctl(fd int, req int, arg uintptr) (r1 uintptr, e1 Errno) { r1 = uintptr(C.ioctl(C.int(fd), C.int(req), C.uintptr_t(arg))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callioctl_ptr(fd int, req int, arg unsafe.Pointer) (r1 uintptr, e1 Errno) { r1 = uintptr(C.ioctl(C.int(fd), C.int(req), C.uintptr_t(uintptr(arg)))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callfcntl(fd uintptr, cmd int, arg uintptr) (r1 uintptr, e1 Errno) { r1 = uintptr(C.fcntl(C.uintptr_t(fd), C.int(cmd), C.uintptr_t(arg))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callfsync_range(fd int, how int, start int64, length int64) (r1 uintptr, e1 Errno) { r1 = uintptr(C.fsync_range(C.int(fd), C.int(how), C.longlong(start), C.longlong(length))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callacct(_p0 uintptr) (r1 uintptr, e1 Errno) { r1 = uintptr(C.acct(C.uintptr_t(_p0))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callchdir(_p0 uintptr) (r1 uintptr, e1 Errno) { r1 = uintptr(C.chdir(C.uintptr_t(_p0))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callchroot(_p0 uintptr) (r1 uintptr, e1 Errno) { r1 = uintptr(C.chroot(C.uintptr_t(_p0))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callclose(fd int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.close(C.int(fd))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func calldup(oldfd int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.dup(C.int(oldfd))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callexit(code int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.exit(C.int(code))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callfaccessat(dirfd int, _p0 uintptr, mode uint32, flags int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.faccessat(C.int(dirfd), C.uintptr_t(_p0), C.uint(mode), C.int(flags))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callfchdir(fd int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.fchdir(C.int(fd))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callfchmod(fd int, mode uint32) (r1 uintptr, e1 Errno) { r1 = uintptr(C.fchmod(C.int(fd), C.uint(mode))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callfchmodat(dirfd int, _p0 uintptr, mode uint32, flags int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.fchmodat(C.int(dirfd), C.uintptr_t(_p0), C.uint(mode), C.int(flags))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callfchownat(dirfd int, _p0 uintptr, uid int, gid int, flags int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.fchownat(C.int(dirfd), C.uintptr_t(_p0), C.int(uid), C.int(gid), C.int(flags))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callfdatasync(fd int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.fdatasync(C.int(fd))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callgetpgid(pid int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.getpgid(C.int(pid))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callgetpgrp() (r1 uintptr, e1 Errno) { r1 = uintptr(C.getpgrp()) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callgetpid() (r1 uintptr, e1 Errno) { r1 = uintptr(C.getpid()) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callgetppid() (r1 uintptr, e1 Errno) { r1 = uintptr(C.getppid()) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callgetpriority(which int, who int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.getpriority(C.int(which), C.int(who))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callgetrusage(who int, rusage uintptr) (r1 uintptr, e1 Errno) { r1 = uintptr(C.getrusage(C.int(who), C.uintptr_t(rusage))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callgetsid(pid int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.getsid(C.int(pid))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callkill(pid int, sig int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.kill(C.int(pid), C.int(sig))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callsyslog(typ int, _p0 uintptr, _lenp0 int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.syslog(C.int(typ), C.uintptr_t(_p0), C.size_t(_lenp0))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callmkdir(dirfd int, _p0 uintptr, mode uint32) (r1 uintptr, e1 Errno) { r1 = uintptr(C.mkdir(C.int(dirfd), C.uintptr_t(_p0), C.uint(mode))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callmkdirat(dirfd int, _p0 uintptr, mode uint32) (r1 uintptr, e1 Errno) { r1 = uintptr(C.mkdirat(C.int(dirfd), C.uintptr_t(_p0), C.uint(mode))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callmkfifo(_p0 uintptr, mode uint32) (r1 uintptr, e1 Errno) { r1 = uintptr(C.mkfifo(C.uintptr_t(_p0), C.uint(mode))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callmknod(_p0 uintptr, mode uint32, dev int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.mknod(C.uintptr_t(_p0), C.uint(mode), C.int(dev))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callmknodat(dirfd int, _p0 uintptr, mode uint32, dev int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.mknodat(C.int(dirfd), C.uintptr_t(_p0), C.uint(mode), C.int(dev))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callnanosleep(time uintptr, leftover uintptr) (r1 uintptr, e1 Errno) { r1 = uintptr(C.nanosleep(C.uintptr_t(time), C.uintptr_t(leftover))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callopen64(_p0 uintptr, mode int, perm uint32) (r1 uintptr, e1 Errno) { r1 = uintptr(C.open64(C.uintptr_t(_p0), C.int(mode), C.uint(perm))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callopenat(dirfd int, _p0 uintptr, flags int, mode uint32) (r1 uintptr, e1 Errno) { r1 = uintptr(C.openat(C.int(dirfd), C.uintptr_t(_p0), C.int(flags), C.uint(mode))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callread(fd int, _p0 uintptr, _lenp0 int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.read(C.int(fd), C.uintptr_t(_p0), C.size_t(_lenp0))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callreadlink(_p0 uintptr, _p1 uintptr, _lenp1 int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.readlink(C.uintptr_t(_p0), C.uintptr_t(_p1), C.size_t(_lenp1))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callrenameat(olddirfd int, _p0 uintptr, newdirfd int, _p1 uintptr) (r1 uintptr, e1 Errno) { r1 = uintptr(C.renameat(C.int(olddirfd), C.uintptr_t(_p0), C.int(newdirfd), C.uintptr_t(_p1))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callsetdomainname(_p0 uintptr, _lenp0 int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.setdomainname(C.uintptr_t(_p0), C.size_t(_lenp0))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callsethostname(_p0 uintptr, _lenp0 int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.sethostname(C.uintptr_t(_p0), C.size_t(_lenp0))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callsetpgid(pid int, pgid int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.setpgid(C.int(pid), C.int(pgid))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callsetsid() (r1 uintptr, e1 Errno) { r1 = uintptr(C.setsid()) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callsettimeofday(tv uintptr) (r1 uintptr, e1 Errno) { r1 = uintptr(C.settimeofday(C.uintptr_t(tv))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callsetuid(uid int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.setuid(C.int(uid))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callsetgid(uid int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.setgid(C.int(uid))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callsetpriority(which int, who int, prio int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.setpriority(C.int(which), C.int(who), C.int(prio))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callstatx(dirfd int, _p0 uintptr, flags int, mask int, stat uintptr) (r1 uintptr, e1 Errno) { r1 = uintptr(C.statx(C.int(dirfd), C.uintptr_t(_p0), C.int(flags), C.int(mask), C.uintptr_t(stat))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callsync() (r1 uintptr, e1 Errno) { r1 = uintptr(C.sync()) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func calltimes(tms uintptr) (r1 uintptr, e1 Errno) { r1 = uintptr(C.times(C.uintptr_t(tms))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callumask(mask int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.umask(C.int(mask))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func calluname(buf uintptr) (r1 uintptr, e1 Errno) { r1 = uintptr(C.uname(C.uintptr_t(buf))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callunlink(_p0 uintptr) (r1 uintptr, e1 Errno) { r1 = uintptr(C.unlink(C.uintptr_t(_p0))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callunlinkat(dirfd int, _p0 uintptr, flags int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.unlinkat(C.int(dirfd), C.uintptr_t(_p0), C.int(flags))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callustat(dev int, ubuf uintptr) (r1 uintptr, e1 Errno) { r1 = uintptr(C.ustat(C.int(dev), C.uintptr_t(ubuf))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callwrite(fd int, _p0 uintptr, _lenp0 int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.write(C.int(fd), C.uintptr_t(_p0), C.size_t(_lenp0))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func calldup2(oldfd int, newfd int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.dup2(C.int(oldfd), C.int(newfd))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callposix_fadvise64(fd int, offset int64, length int64, advice int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.posix_fadvise64(C.int(fd), C.longlong(offset), C.longlong(length), C.int(advice))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callfchown(fd int, uid int, gid int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.fchown(C.int(fd), C.int(uid), C.int(gid))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callfstat(fd int, stat uintptr) (r1 uintptr, e1 Errno) { r1 = uintptr(C.fstat(C.int(fd), C.uintptr_t(stat))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callfstatat(dirfd int, _p0 uintptr, stat uintptr, flags int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.fstatat(C.int(dirfd), C.uintptr_t(_p0), C.uintptr_t(stat), C.int(flags))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callfstatfs(fd int, buf uintptr) (r1 uintptr, e1 Errno) { r1 = uintptr(C.fstatfs(C.int(fd), C.uintptr_t(buf))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callftruncate(fd int, length int64) (r1 uintptr, e1 Errno) { r1 = uintptr(C.ftruncate(C.int(fd), C.longlong(length))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callgetegid() (r1 uintptr, e1 Errno) { r1 = uintptr(C.getegid()) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callgeteuid() (r1 uintptr, e1 Errno) { r1 = uintptr(C.geteuid()) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callgetgid() (r1 uintptr, e1 Errno) { r1 = uintptr(C.getgid()) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callgetuid() (r1 uintptr, e1 Errno) { r1 = uintptr(C.getuid()) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func calllchown(_p0 uintptr, uid int, gid int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.lchown(C.uintptr_t(_p0), C.int(uid), C.int(gid))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func calllisten(s int, n int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.listen(C.int(s), C.int(n))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func calllstat(_p0 uintptr, stat uintptr) (r1 uintptr, e1 Errno) { r1 = uintptr(C.lstat(C.uintptr_t(_p0), C.uintptr_t(stat))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callpause() (r1 uintptr, e1 Errno) { r1 = uintptr(C.pause()) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callpread64(fd int, _p0 uintptr, _lenp0 int, offset int64) (r1 uintptr, e1 Errno) { r1 = uintptr(C.pread64(C.int(fd), C.uintptr_t(_p0), C.size_t(_lenp0), C.longlong(offset))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callpwrite64(fd int, _p0 uintptr, _lenp0 int, offset int64) (r1 uintptr, e1 Errno) { r1 = uintptr(C.pwrite64(C.int(fd), C.uintptr_t(_p0), C.size_t(_lenp0), C.longlong(offset))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callselect(nfd int, r uintptr, w uintptr, e uintptr, timeout uintptr) (r1 uintptr, e1 Errno) { r1 = uintptr(C.c_select(C.int(nfd), C.uintptr_t(r), C.uintptr_t(w), C.uintptr_t(e), C.uintptr_t(timeout))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callpselect(nfd int, r uintptr, w uintptr, e uintptr, timeout uintptr, sigmask uintptr) (r1 uintptr, e1 Errno) { r1 = uintptr(C.pselect(C.int(nfd), C.uintptr_t(r), C.uintptr_t(w), C.uintptr_t(e), C.uintptr_t(timeout), C.uintptr_t(sigmask))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callsetregid(rgid int, egid int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.setregid(C.int(rgid), C.int(egid))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callsetreuid(ruid int, euid int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.setreuid(C.int(ruid), C.int(euid))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callshutdown(fd int, how int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.shutdown(C.int(fd), C.int(how))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callsplice(rfd int, roff uintptr, wfd int, woff uintptr, len int, flags int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.splice(C.int(rfd), C.uintptr_t(roff), C.int(wfd), C.uintptr_t(woff), C.int(len), C.int(flags))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callstat(_p0 uintptr, statptr uintptr) (r1 uintptr, e1 Errno) { r1 = uintptr(C.stat(C.uintptr_t(_p0), C.uintptr_t(statptr))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callstatfs(_p0 uintptr, buf uintptr) (r1 uintptr, e1 Errno) { r1 = uintptr(C.statfs(C.uintptr_t(_p0), C.uintptr_t(buf))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func calltruncate(_p0 uintptr, length int64) (r1 uintptr, e1 Errno) { r1 = uintptr(C.truncate(C.uintptr_t(_p0), C.longlong(length))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callbind(s int, addr uintptr, addrlen uintptr) (r1 uintptr, e1 Errno) { r1 = uintptr(C.bind(C.int(s), C.uintptr_t(addr), C.uintptr_t(addrlen))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callconnect(s int, addr uintptr, addrlen uintptr) (r1 uintptr, e1 Errno) { r1 = uintptr(C.connect(C.int(s), C.uintptr_t(addr), C.uintptr_t(addrlen))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callgetgroups(n int, list uintptr) (r1 uintptr, e1 Errno) { r1 = uintptr(C.getgroups(C.int(n), C.uintptr_t(list))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callsetgroups(n int, list uintptr) (r1 uintptr, e1 Errno) { r1 = uintptr(C.setgroups(C.int(n), C.uintptr_t(list))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callgetsockopt(s int, level int, name int, val uintptr, vallen uintptr) (r1 uintptr, e1 Errno) { r1 = uintptr(C.getsockopt(C.int(s), C.int(level), C.int(name), C.uintptr_t(val), C.uintptr_t(vallen))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callsetsockopt(s int, level int, name int, val uintptr, vallen uintptr) (r1 uintptr, e1 Errno) { r1 = uintptr(C.setsockopt(C.int(s), C.int(level), C.int(name), C.uintptr_t(val), C.uintptr_t(vallen))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callsocket(domain int, typ int, proto int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.socket(C.int(domain), C.int(typ), C.int(proto))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callsocketpair(domain int, typ int, proto int, fd uintptr) (r1 uintptr, e1 Errno) { r1 = uintptr(C.socketpair(C.int(domain), C.int(typ), C.int(proto), C.uintptr_t(fd))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callgetpeername(fd int, rsa uintptr, addrlen uintptr) (r1 uintptr, e1 Errno) { r1 = uintptr(C.getpeername(C.int(fd), C.uintptr_t(rsa), C.uintptr_t(addrlen))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callgetsockname(fd int, rsa uintptr, addrlen uintptr) (r1 uintptr, e1 Errno) { r1 = uintptr(C.getsockname(C.int(fd), C.uintptr_t(rsa), C.uintptr_t(addrlen))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callrecvfrom(fd int, _p0 uintptr, _lenp0 int, flags int, from uintptr, fromlen uintptr) (r1 uintptr, e1 Errno) { r1 = uintptr(C.recvfrom(C.int(fd), C.uintptr_t(_p0), C.size_t(_lenp0), C.int(flags), C.uintptr_t(from), C.uintptr_t(fromlen))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callsendto(s int, _p0 uintptr, _lenp0 int, flags int, to uintptr, addrlen uintptr) (r1 uintptr, e1 Errno) { r1 = uintptr(C.sendto(C.int(s), C.uintptr_t(_p0), C.size_t(_lenp0), C.int(flags), C.uintptr_t(to), C.uintptr_t(addrlen))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callnrecvmsg(s int, msg uintptr, flags int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.nrecvmsg(C.int(s), C.uintptr_t(msg), C.int(flags))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callnsendmsg(s int, msg uintptr, flags int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.nsendmsg(C.int(s), C.uintptr_t(msg), C.int(flags))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callmunmap(addr uintptr, length uintptr) (r1 uintptr, e1 Errno) { r1 = uintptr(C.munmap(C.uintptr_t(addr), C.uintptr_t(length))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callmadvise(_p0 uintptr, _lenp0 int, advice int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.madvise(C.uintptr_t(_p0), C.size_t(_lenp0), C.int(advice))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callmprotect(_p0 uintptr, _lenp0 int, prot int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.mprotect(C.uintptr_t(_p0), C.size_t(_lenp0), C.int(prot))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callmlock(_p0 uintptr, _lenp0 int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.mlock(C.uintptr_t(_p0), C.size_t(_lenp0))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callmlockall(flags int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.mlockall(C.int(flags))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callmsync(_p0 uintptr, _lenp0 int, flags int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.msync(C.uintptr_t(_p0), C.size_t(_lenp0), C.int(flags))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callmunlock(_p0 uintptr, _lenp0 int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.munlock(C.uintptr_t(_p0), C.size_t(_lenp0))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callmunlockall() (r1 uintptr, e1 Errno) { r1 = uintptr(C.munlockall()) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callpipe(p uintptr) (r1 uintptr, e1 Errno) { r1 = uintptr(C.pipe(C.uintptr_t(p))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callpoll(fds uintptr, nfds int, timeout int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.poll(C.uintptr_t(fds), C.int(nfds), C.int(timeout))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callgettimeofday(tv uintptr, tzp uintptr) (r1 uintptr, e1 Errno) { r1 = uintptr(C.gettimeofday(C.uintptr_t(tv), C.uintptr_t(tzp))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func calltime(t uintptr) (r1 uintptr, e1 Errno) { r1 = uintptr(C.time(C.uintptr_t(t))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callutime(_p0 uintptr, buf uintptr) (r1 uintptr, e1 Errno) { r1 = uintptr(C.utime(C.uintptr_t(_p0), C.uintptr_t(buf))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callgetsystemcfg(label int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.getsystemcfg(C.int(label))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callumount(_p0 uintptr) (r1 uintptr, e1 Errno) { r1 = uintptr(C.umount(C.uintptr_t(_p0))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callgetrlimit(resource int, rlim uintptr) (r1 uintptr, e1 Errno) { r1 = uintptr(C.getrlimit(C.int(resource), C.uintptr_t(rlim))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func calllseek(fd int, offset int64, whence int) (r1 uintptr, e1 Errno) { r1 = uintptr(C.lseek(C.int(fd), C.longlong(offset), C.int(whence))) e1 = syscall.GetErrno() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func callmmap64(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (r1 uintptr, e1 Errno) { r1 = uintptr(C.mmap64(C.uintptr_t(addr), C.uintptr_t(length), C.int(prot), C.int(flags), C.int(fd), C.longlong(offset))) e1 = syscall.GetErrno() return } ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go ================================================ // go run mksyscall.go -tags darwin,amd64 syscall_bsd.go syscall_darwin.go syscall_darwin_amd64.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build darwin && amd64 package unix import ( "syscall" "unsafe" ) var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(ngid int, gid *_Gid_t) (n int, err error) { r0, _, e1 := syscall_rawSyscall(libc_getgroups_trampoline_addr, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getgroups_trampoline_addr uintptr //go:cgo_import_dynamic libc_getgroups getgroups "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(ngid int, gid *_Gid_t) (err error) { _, _, e1 := syscall_rawSyscall(libc_setgroups_trampoline_addr, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setgroups_trampoline_addr uintptr //go:cgo_import_dynamic libc_setgroups setgroups "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) { r0, _, e1 := syscall_syscall6(libc_wait4_trampoline_addr, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) wpid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_wait4_trampoline_addr uintptr //go:cgo_import_dynamic libc_wait4 wait4 "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { r0, _, e1 := syscall_syscall(libc_accept_trampoline_addr, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_accept_trampoline_addr uintptr //go:cgo_import_dynamic libc_accept accept "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := syscall_syscall(libc_bind_trampoline_addr, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } var libc_bind_trampoline_addr uintptr //go:cgo_import_dynamic libc_bind bind "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := syscall_syscall(libc_connect_trampoline_addr, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } var libc_connect_trampoline_addr uintptr //go:cgo_import_dynamic libc_connect connect "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { r0, _, e1 := syscall_rawSyscall(libc_socket_trampoline_addr, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_socket_trampoline_addr uintptr //go:cgo_import_dynamic libc_socket socket "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { _, _, e1 := syscall_syscall6(libc_getsockopt_trampoline_addr, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getsockopt_trampoline_addr uintptr //go:cgo_import_dynamic libc_getsockopt getsockopt "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { _, _, e1 := syscall_syscall6(libc_setsockopt_trampoline_addr, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setsockopt_trampoline_addr uintptr //go:cgo_import_dynamic libc_setsockopt setsockopt "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := syscall_rawSyscall(libc_getpeername_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } var libc_getpeername_trampoline_addr uintptr //go:cgo_import_dynamic libc_getpeername getpeername "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := syscall_rawSyscall(libc_getsockname_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } var libc_getsockname_trampoline_addr uintptr //go:cgo_import_dynamic libc_getsockname getsockname "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(s int, how int) (err error) { _, _, e1 := syscall_syscall(libc_shutdown_trampoline_addr, uintptr(s), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_shutdown_trampoline_addr uintptr //go:cgo_import_dynamic libc_shutdown shutdown "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { _, _, e1 := syscall_rawSyscall6(libc_socketpair_trampoline_addr, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_socketpair_trampoline_addr uintptr //go:cgo_import_dynamic libc_socketpair socketpair "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall6(libc_recvfrom_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_recvfrom_trampoline_addr uintptr //go:cgo_import_dynamic libc_recvfrom recvfrom "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall6(libc_sendto_trampoline_addr, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } var libc_sendto_trampoline_addr uintptr //go:cgo_import_dynamic libc_sendto sendto "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := syscall_syscall(libc_recvmsg_trampoline_addr, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_recvmsg_trampoline_addr uintptr //go:cgo_import_dynamic libc_recvmsg recvmsg "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := syscall_syscall(libc_sendmsg_trampoline_addr, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_sendmsg_trampoline_addr uintptr //go:cgo_import_dynamic libc_sendmsg sendmsg "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) { r0, _, e1 := syscall_syscall6(libc_kevent_trampoline_addr, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_kevent_trampoline_addr uintptr //go:cgo_import_dynamic libc_kevent kevent "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, timeval *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_utimes_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_utimes_trampoline_addr uintptr //go:cgo_import_dynamic libc_utimes utimes "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func futimes(fd int, timeval *[2]Timeval) (err error) { _, _, e1 := syscall_syscall(libc_futimes_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_futimes_trampoline_addr uintptr //go:cgo_import_dynamic libc_futimes futimes "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := syscall_syscall(libc_poll_trampoline_addr, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_poll_trampoline_addr uintptr //go:cgo_import_dynamic libc_poll poll "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Madvise(b []byte, behav int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall(libc_madvise_trampoline_addr, uintptr(_p0), uintptr(len(b)), uintptr(behav)) if e1 != 0 { err = errnoErr(e1) } return } var libc_madvise_trampoline_addr uintptr //go:cgo_import_dynamic libc_madvise madvise "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall(libc_mlock_trampoline_addr, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mlock_trampoline_addr uintptr //go:cgo_import_dynamic libc_mlock mlock "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlockall(flags int) (err error) { _, _, e1 := syscall_syscall(libc_mlockall_trampoline_addr, uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mlockall_trampoline_addr uintptr //go:cgo_import_dynamic libc_mlockall mlockall "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mprotect(b []byte, prot int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall(libc_mprotect_trampoline_addr, uintptr(_p0), uintptr(len(b)), uintptr(prot)) if e1 != 0 { err = errnoErr(e1) } return } var libc_mprotect_trampoline_addr uintptr //go:cgo_import_dynamic libc_mprotect mprotect "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Msync(b []byte, flags int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall(libc_msync_trampoline_addr, uintptr(_p0), uintptr(len(b)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } var libc_msync_trampoline_addr uintptr //go:cgo_import_dynamic libc_msync msync "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall(libc_munlock_trampoline_addr, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_munlock_trampoline_addr uintptr //go:cgo_import_dynamic libc_munlock munlock "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlockall() (err error) { _, _, e1 := syscall_syscall(libc_munlockall_trampoline_addr, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_munlockall_trampoline_addr uintptr //go:cgo_import_dynamic libc_munlockall munlockall "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func closedir(dir uintptr) (err error) { _, _, e1 := syscall_syscall(libc_closedir_trampoline_addr, uintptr(dir), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_closedir_trampoline_addr uintptr //go:cgo_import_dynamic libc_closedir closedir "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func readdir_r(dir uintptr, entry *Dirent, result **Dirent) (res Errno) { r0, _, _ := syscall_syscall(libc_readdir_r_trampoline_addr, uintptr(dir), uintptr(unsafe.Pointer(entry)), uintptr(unsafe.Pointer(result))) res = Errno(r0) return } var libc_readdir_r_trampoline_addr uintptr //go:cgo_import_dynamic libc_readdir_r readdir_r "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe(p *[2]int32) (err error) { _, _, e1 := syscall_rawSyscall(libc_pipe_trampoline_addr, uintptr(unsafe.Pointer(p)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pipe_trampoline_addr uintptr //go:cgo_import_dynamic libc_pipe pipe "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getxattr(path string, attr string, dest *byte, size int, position uint32, options int) (sz int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } r0, _, e1 := syscall_syscall6(libc_getxattr_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options)) sz = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getxattr_trampoline_addr uintptr //go:cgo_import_dynamic libc_getxattr getxattr "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fgetxattr(fd int, attr string, dest *byte, size int, position uint32, options int) (sz int, err error) { var _p0 *byte _p0, err = BytePtrFromString(attr) if err != nil { return } r0, _, e1 := syscall_syscall6(libc_fgetxattr_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options)) sz = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fgetxattr_trampoline_addr uintptr //go:cgo_import_dynamic libc_fgetxattr fgetxattr "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setxattr(path string, attr string, data *byte, size int, position uint32, options int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } _, _, e1 := syscall_syscall6(libc_setxattr_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options)) if e1 != 0 { err = errnoErr(e1) } return } var libc_setxattr_trampoline_addr uintptr //go:cgo_import_dynamic libc_setxattr setxattr "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fsetxattr(fd int, attr string, data *byte, size int, position uint32, options int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(attr) if err != nil { return } _, _, e1 := syscall_syscall6(libc_fsetxattr_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options)) if e1 != 0 { err = errnoErr(e1) } return } var libc_fsetxattr_trampoline_addr uintptr //go:cgo_import_dynamic libc_fsetxattr fsetxattr "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func removexattr(path string, attr string, options int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } _, _, e1 := syscall_syscall(libc_removexattr_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options)) if e1 != 0 { err = errnoErr(e1) } return } var libc_removexattr_trampoline_addr uintptr //go:cgo_import_dynamic libc_removexattr removexattr "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fremovexattr(fd int, attr string, options int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(attr) if err != nil { return } _, _, e1 := syscall_syscall(libc_fremovexattr_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(options)) if e1 != 0 { err = errnoErr(e1) } return } var libc_fremovexattr_trampoline_addr uintptr //go:cgo_import_dynamic libc_fremovexattr fremovexattr "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func listxattr(path string, dest *byte, size int, options int) (sz int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := syscall_syscall6(libc_listxattr_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0) sz = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_listxattr_trampoline_addr uintptr //go:cgo_import_dynamic libc_listxattr listxattr "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func flistxattr(fd int, dest *byte, size int, options int) (sz int, err error) { r0, _, e1 := syscall_syscall6(libc_flistxattr_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0) sz = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_flistxattr_trampoline_addr uintptr //go:cgo_import_dynamic libc_flistxattr flistxattr "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_utimensat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_utimensat_trampoline_addr uintptr //go:cgo_import_dynamic libc_utimensat utimensat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fcntl(fd int, cmd int, arg int) (val int, err error) { r0, _, e1 := syscall_syscall(libc_fcntl_trampoline_addr, uintptr(fd), uintptr(cmd), uintptr(arg)) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fcntl_trampoline_addr uintptr //go:cgo_import_dynamic libc_fcntl fcntl "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func kill(pid int, signum int, posix int) (err error) { _, _, e1 := syscall_syscall(libc_kill_trampoline_addr, uintptr(pid), uintptr(signum), uintptr(posix)) if e1 != 0 { err = errnoErr(e1) } return } var libc_kill_trampoline_addr uintptr //go:cgo_import_dynamic libc_kill kill "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctl(fd int, req uint, arg uintptr) (err error) { _, _, e1 := syscall_syscall(libc_ioctl_trampoline_addr, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } var libc_ioctl_trampoline_addr uintptr //go:cgo_import_dynamic libc_ioctl ioctl "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) { _, _, e1 := syscall_syscall(libc_ioctl_trampoline_addr, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func renamexNp(from string, to string, flag uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := syscall_syscall(libc_renamex_np_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flag)) if e1 != 0 { err = errnoErr(e1) } return } var libc_renamex_np_trampoline_addr uintptr //go:cgo_import_dynamic libc_renamex_np renamex_np "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func renameatxNp(fromfd int, from string, tofd int, to string, flag uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := syscall_syscall6(libc_renameatx_np_trampoline_addr, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), uintptr(flag), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_renameatx_np_trampoline_addr uintptr //go:cgo_import_dynamic libc_renameatx_np renameatx_np "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { var _p0 unsafe.Pointer if len(mib) > 0 { _p0 = unsafe.Pointer(&mib[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall6(libc_sysctl_trampoline_addr, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) if e1 != 0 { err = errnoErr(e1) } return } var libc_sysctl_trampoline_addr uintptr //go:cgo_import_dynamic libc_sysctl sysctl "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pthread_chdir_np(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_pthread_chdir_np_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pthread_chdir_np_trampoline_addr uintptr //go:cgo_import_dynamic libc_pthread_chdir_np pthread_chdir_np "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pthread_fchdir_np(fd int) (err error) { _, _, e1 := syscall_syscall(libc_pthread_fchdir_np_trampoline_addr, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pthread_fchdir_np_trampoline_addr uintptr //go:cgo_import_dynamic libc_pthread_fchdir_np pthread_fchdir_np "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connectx(fd int, endpoints *SaEndpoints, associd SaeAssocID, flags uint32, iov []Iovec, n *uintptr, connid *SaeConnID) (err error) { var _p0 unsafe.Pointer if len(iov) > 0 { _p0 = unsafe.Pointer(&iov[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall9(libc_connectx_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(endpoints)), uintptr(associd), uintptr(flags), uintptr(_p0), uintptr(len(iov)), uintptr(unsafe.Pointer(n)), uintptr(unsafe.Pointer(connid)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_connectx_trampoline_addr uintptr //go:cgo_import_dynamic libc_connectx connectx "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) { _, _, e1 := syscall_syscall6(libc_sendfile_trampoline_addr, uintptr(infd), uintptr(outfd), uintptr(offset), uintptr(unsafe.Pointer(len)), uintptr(hdtr), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } var libc_sendfile_trampoline_addr uintptr //go:cgo_import_dynamic libc_sendfile sendfile "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func shmat(id int, addr uintptr, flag int) (ret uintptr, err error) { r0, _, e1 := syscall_syscall(libc_shmat_trampoline_addr, uintptr(id), uintptr(addr), uintptr(flag)) ret = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_shmat_trampoline_addr uintptr //go:cgo_import_dynamic libc_shmat shmat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func shmctl(id int, cmd int, buf *SysvShmDesc) (result int, err error) { r0, _, e1 := syscall_syscall(libc_shmctl_trampoline_addr, uintptr(id), uintptr(cmd), uintptr(unsafe.Pointer(buf))) result = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_shmctl_trampoline_addr uintptr //go:cgo_import_dynamic libc_shmctl shmctl "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func shmdt(addr uintptr) (err error) { _, _, e1 := syscall_syscall(libc_shmdt_trampoline_addr, uintptr(addr), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_shmdt_trampoline_addr uintptr //go:cgo_import_dynamic libc_shmdt shmdt "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func shmget(key int, size int, flag int) (id int, err error) { r0, _, e1 := syscall_syscall(libc_shmget_trampoline_addr, uintptr(key), uintptr(size), uintptr(flag)) id = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_shmget_trampoline_addr uintptr //go:cgo_import_dynamic libc_shmget shmget "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Access(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_access_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_access_trampoline_addr uintptr //go:cgo_import_dynamic libc_access access "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Adjtime(delta *Timeval, olddelta *Timeval) (err error) { _, _, e1 := syscall_syscall(libc_adjtime_trampoline_addr, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_adjtime_trampoline_addr uintptr //go:cgo_import_dynamic libc_adjtime adjtime "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_chdir_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_chdir_trampoline_addr uintptr //go:cgo_import_dynamic libc_chdir chdir "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chflags(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_chflags_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_chflags_trampoline_addr uintptr //go:cgo_import_dynamic libc_chflags chflags "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chmod(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_chmod_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_chmod_trampoline_addr uintptr //go:cgo_import_dynamic libc_chmod chmod "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_chown_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } var libc_chown_trampoline_addr uintptr //go:cgo_import_dynamic libc_chown chown "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chroot(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_chroot_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_chroot_trampoline_addr uintptr //go:cgo_import_dynamic libc_chroot chroot "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ClockGettime(clockid int32, time *Timespec) (err error) { _, _, e1 := syscall_syscall(libc_clock_gettime_trampoline_addr, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_clock_gettime_trampoline_addr uintptr //go:cgo_import_dynamic libc_clock_gettime clock_gettime "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Close(fd int) (err error) { _, _, e1 := syscall_syscall(libc_close_trampoline_addr, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_close_trampoline_addr uintptr //go:cgo_import_dynamic libc_close close "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Clonefile(src string, dst string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(src) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(dst) if err != nil { return } _, _, e1 := syscall_syscall(libc_clonefile_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } var libc_clonefile_trampoline_addr uintptr //go:cgo_import_dynamic libc_clonefile clonefile "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Clonefileat(srcDirfd int, src string, dstDirfd int, dst string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(src) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(dst) if err != nil { return } _, _, e1 := syscall_syscall6(libc_clonefileat_trampoline_addr, uintptr(srcDirfd), uintptr(unsafe.Pointer(_p0)), uintptr(dstDirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_clonefileat_trampoline_addr uintptr //go:cgo_import_dynamic libc_clonefileat clonefileat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(fd int) (nfd int, err error) { r0, _, e1 := syscall_syscall(libc_dup_trampoline_addr, uintptr(fd), 0, 0) nfd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_dup_trampoline_addr uintptr //go:cgo_import_dynamic libc_dup dup "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup2(from int, to int) (err error) { _, _, e1 := syscall_syscall(libc_dup2_trampoline_addr, uintptr(from), uintptr(to), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_dup2_trampoline_addr uintptr //go:cgo_import_dynamic libc_dup2 dup2 "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Exchangedata(path1 string, path2 string, options int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path1) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(path2) if err != nil { return } _, _, e1 := syscall_syscall(libc_exchangedata_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options)) if e1 != 0 { err = errnoErr(e1) } return } var libc_exchangedata_trampoline_addr uintptr //go:cgo_import_dynamic libc_exchangedata exchangedata "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Exit(code int) { syscall_syscall(libc_exit_trampoline_addr, uintptr(code), 0, 0) return } var libc_exit_trampoline_addr uintptr //go:cgo_import_dynamic libc_exit exit "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_faccessat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_faccessat_trampoline_addr uintptr //go:cgo_import_dynamic libc_faccessat faccessat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchdir(fd int) (err error) { _, _, e1 := syscall_syscall(libc_fchdir_trampoline_addr, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchdir_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchdir fchdir "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchflags(fd int, flags int) (err error) { _, _, e1 := syscall_syscall(libc_fchflags_trampoline_addr, uintptr(fd), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchflags_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchflags fchflags "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmod(fd int, mode uint32) (err error) { _, _, e1 := syscall_syscall(libc_fchmod_trampoline_addr, uintptr(fd), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchmod_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchmod fchmod "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_fchmodat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchmodat_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchmodat fchmodat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := syscall_syscall(libc_fchown_trampoline_addr, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchown_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchown fchown "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_fchownat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchownat_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchownat fchownat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fclonefileat(srcDirfd int, dstDirfd int, dst string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(dst) if err != nil { return } _, _, e1 := syscall_syscall6(libc_fclonefileat_trampoline_addr, uintptr(srcDirfd), uintptr(dstDirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fclonefileat_trampoline_addr uintptr //go:cgo_import_dynamic libc_fclonefileat fclonefileat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Flock(fd int, how int) (err error) { _, _, e1 := syscall_syscall(libc_flock_trampoline_addr, uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_flock_trampoline_addr uintptr //go:cgo_import_dynamic libc_flock flock "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fpathconf(fd int, name int) (val int, err error) { r0, _, e1 := syscall_syscall(libc_fpathconf_trampoline_addr, uintptr(fd), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fpathconf_trampoline_addr uintptr //go:cgo_import_dynamic libc_fpathconf fpathconf "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fsync(fd int) (err error) { _, _, e1 := syscall_syscall(libc_fsync_trampoline_addr, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fsync_trampoline_addr uintptr //go:cgo_import_dynamic libc_fsync fsync "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { _, _, e1 := syscall_syscall(libc_ftruncate_trampoline_addr, uintptr(fd), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_ftruncate_trampoline_addr uintptr //go:cgo_import_dynamic libc_ftruncate ftruncate "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getcwd(buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_getcwd_trampoline_addr, uintptr(_p0), uintptr(len(buf)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getcwd_trampoline_addr uintptr //go:cgo_import_dynamic libc_getcwd getcwd "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getdtablesize() (size int) { r0, _, _ := syscall_syscall(libc_getdtablesize_trampoline_addr, 0, 0, 0) size = int(r0) return } var libc_getdtablesize_trampoline_addr uintptr //go:cgo_import_dynamic libc_getdtablesize getdtablesize "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { r0, _, _ := syscall_rawSyscall(libc_getegid_trampoline_addr, 0, 0, 0) egid = int(r0) return } var libc_getegid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getegid getegid "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (uid int) { r0, _, _ := syscall_rawSyscall(libc_geteuid_trampoline_addr, 0, 0, 0) uid = int(r0) return } var libc_geteuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_geteuid geteuid "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _, _ := syscall_rawSyscall(libc_getgid_trampoline_addr, 0, 0, 0) gid = int(r0) return } var libc_getgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getgid getgid "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgid(pid int) (pgid int, err error) { r0, _, e1 := syscall_rawSyscall(libc_getpgid_trampoline_addr, uintptr(pid), 0, 0) pgid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getpgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getpgid getpgid "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgrp() (pgrp int) { r0, _, _ := syscall_rawSyscall(libc_getpgrp_trampoline_addr, 0, 0, 0) pgrp = int(r0) return } var libc_getpgrp_trampoline_addr uintptr //go:cgo_import_dynamic libc_getpgrp getpgrp "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpid() (pid int) { r0, _, _ := syscall_rawSyscall(libc_getpid_trampoline_addr, 0, 0, 0) pid = int(r0) return } var libc_getpid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getpid getpid "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getppid() (ppid int) { r0, _, _ := syscall_rawSyscall(libc_getppid_trampoline_addr, 0, 0, 0) ppid = int(r0) return } var libc_getppid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getppid getppid "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpriority(which int, who int) (prio int, err error) { r0, _, e1 := syscall_syscall(libc_getpriority_trampoline_addr, uintptr(which), uintptr(who), 0) prio = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getpriority_trampoline_addr uintptr //go:cgo_import_dynamic libc_getpriority getpriority "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(which int, lim *Rlimit) (err error) { _, _, e1 := syscall_rawSyscall(libc_getrlimit_trampoline_addr, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getrlimit_trampoline_addr uintptr //go:cgo_import_dynamic libc_getrlimit getrlimit "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrusage(who int, rusage *Rusage) (err error) { _, _, e1 := syscall_rawSyscall(libc_getrusage_trampoline_addr, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getrusage_trampoline_addr uintptr //go:cgo_import_dynamic libc_getrusage getrusage "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getsid(pid int) (sid int, err error) { r0, _, e1 := syscall_rawSyscall(libc_getsid_trampoline_addr, uintptr(pid), 0, 0) sid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getsid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getsid getsid "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tp *Timeval) (err error) { _, _, e1 := syscall_rawSyscall(libc_gettimeofday_trampoline_addr, uintptr(unsafe.Pointer(tp)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_gettimeofday_trampoline_addr uintptr //go:cgo_import_dynamic libc_gettimeofday gettimeofday "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _, _ := syscall_rawSyscall(libc_getuid_trampoline_addr, 0, 0, 0) uid = int(r0) return } var libc_getuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getuid getuid "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Issetugid() (tainted bool) { r0, _, _ := syscall_rawSyscall(libc_issetugid_trampoline_addr, 0, 0, 0) tainted = bool(r0 != 0) return } var libc_issetugid_trampoline_addr uintptr //go:cgo_import_dynamic libc_issetugid issetugid "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kqueue() (fd int, err error) { r0, _, e1 := syscall_syscall(libc_kqueue_trampoline_addr, 0, 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_kqueue_trampoline_addr uintptr //go:cgo_import_dynamic libc_kqueue kqueue "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_lchown_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } var libc_lchown_trampoline_addr uintptr //go:cgo_import_dynamic libc_lchown lchown "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Link(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := syscall_syscall(libc_link_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_link_trampoline_addr uintptr //go:cgo_import_dynamic libc_link link "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := syscall_syscall6(libc_linkat_trampoline_addr, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_linkat_trampoline_addr uintptr //go:cgo_import_dynamic libc_linkat linkat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, backlog int) (err error) { _, _, e1 := syscall_syscall(libc_listen_trampoline_addr, uintptr(s), uintptr(backlog), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_listen_trampoline_addr uintptr //go:cgo_import_dynamic libc_listen listen "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdir(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_mkdir_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mkdir_trampoline_addr uintptr //go:cgo_import_dynamic libc_mkdir mkdir "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdirat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_mkdirat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } var libc_mkdirat_trampoline_addr uintptr //go:cgo_import_dynamic libc_mkdirat mkdirat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifo(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_mkfifo_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mkfifo_trampoline_addr uintptr //go:cgo_import_dynamic libc_mkfifo mkfifo "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknod(path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_mknod_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) if e1 != 0 { err = errnoErr(e1) } return } var libc_mknod_trampoline_addr uintptr //go:cgo_import_dynamic libc_mknod mknod "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) { var _p0 *byte _p0, err = BytePtrFromString(fsType) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(dir) if err != nil { return } _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mount_trampoline_addr uintptr //go:cgo_import_dynamic libc_mount mount "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Open(path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := syscall_syscall(libc_open_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_open_trampoline_addr uintptr //go:cgo_import_dynamic libc_open open "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := syscall_syscall6(libc_openat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_openat_trampoline_addr uintptr //go:cgo_import_dynamic libc_openat openat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pathconf(path string, name int) (val int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := syscall_syscall(libc_pathconf_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pathconf_trampoline_addr uintptr //go:cgo_import_dynamic libc_pathconf pathconf "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall6(libc_pread_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pread_trampoline_addr uintptr //go:cgo_import_dynamic libc_pread pread "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall6(libc_pwrite_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pwrite_trampoline_addr uintptr //go:cgo_import_dynamic libc_pwrite pwrite "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func read(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_read_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_read_trampoline_addr uintptr //go:cgo_import_dynamic libc_read read "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlink(path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_readlink_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_readlink_trampoline_addr uintptr //go:cgo_import_dynamic libc_readlink readlink "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall6(libc_readlinkat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_readlinkat_trampoline_addr uintptr //go:cgo_import_dynamic libc_readlinkat readlinkat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rename(from string, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := syscall_syscall(libc_rename_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_rename_trampoline_addr uintptr //go:cgo_import_dynamic libc_rename rename "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(fromfd int, from string, tofd int, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := syscall_syscall6(libc_renameat_trampoline_addr, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_renameat_trampoline_addr uintptr //go:cgo_import_dynamic libc_renameat renameat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Revoke(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_revoke_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_revoke_trampoline_addr uintptr //go:cgo_import_dynamic libc_revoke revoke "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rmdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_rmdir_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_rmdir_trampoline_addr uintptr //go:cgo_import_dynamic libc_rmdir rmdir "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { r0, _, e1 := syscall_syscall(libc_lseek_trampoline_addr, uintptr(fd), uintptr(offset), uintptr(whence)) newoffset = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_lseek_trampoline_addr uintptr //go:cgo_import_dynamic libc_lseek lseek "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { r0, _, e1 := syscall_syscall6(libc_select_trampoline_addr, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_select_trampoline_addr uintptr //go:cgo_import_dynamic libc_select select "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setattrlist(path string, attrlist *Attrlist, attrBuf []byte, options int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(attrBuf) > 0 { _p1 = unsafe.Pointer(&attrBuf[0]) } else { _p1 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall6(libc_setattrlist_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(attrlist)), uintptr(_p1), uintptr(len(attrBuf)), uintptr(options), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setattrlist_trampoline_addr uintptr //go:cgo_import_dynamic libc_setattrlist setattrlist "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setegid(egid int) (err error) { _, _, e1 := syscall_syscall(libc_setegid_trampoline_addr, uintptr(egid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setegid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setegid setegid "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seteuid(euid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_seteuid_trampoline_addr, uintptr(euid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_seteuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_seteuid seteuid "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setgid(gid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setgid_trampoline_addr, uintptr(gid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setgid setgid "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setlogin(name string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(name) if err != nil { return } _, _, e1 := syscall_syscall(libc_setlogin_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setlogin_trampoline_addr uintptr //go:cgo_import_dynamic libc_setlogin setlogin "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setpgid_trampoline_addr, uintptr(pid), uintptr(pgid), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setpgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setpgid setpgid "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpriority(which int, who int, prio int) (err error) { _, _, e1 := syscall_syscall(libc_setpriority_trampoline_addr, uintptr(which), uintptr(who), uintptr(prio)) if e1 != 0 { err = errnoErr(e1) } return } var libc_setpriority_trampoline_addr uintptr //go:cgo_import_dynamic libc_setpriority setpriority "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setprivexec(flag int) (err error) { _, _, e1 := syscall_syscall(libc_setprivexec_trampoline_addr, uintptr(flag), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setprivexec_trampoline_addr uintptr //go:cgo_import_dynamic libc_setprivexec setprivexec "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setregid(rgid int, egid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setregid_trampoline_addr, uintptr(rgid), uintptr(egid), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setregid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setregid setregid "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setreuid(ruid int, euid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setreuid_trampoline_addr, uintptr(ruid), uintptr(euid), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setreuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setreuid setreuid "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, err error) { r0, _, e1 := syscall_rawSyscall(libc_setsid_trampoline_addr, 0, 0, 0) pid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setsid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setsid setsid "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Settimeofday(tp *Timeval) (err error) { _, _, e1 := syscall_rawSyscall(libc_settimeofday_trampoline_addr, uintptr(unsafe.Pointer(tp)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_settimeofday_trampoline_addr uintptr //go:cgo_import_dynamic libc_settimeofday settimeofday "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setuid(uid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setuid_trampoline_addr, uintptr(uid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setuid setuid "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlink(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := syscall_syscall(libc_symlink_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_symlink_trampoline_addr uintptr //go:cgo_import_dynamic libc_symlink symlink "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := syscall_syscall(libc_symlinkat_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } var libc_symlinkat_trampoline_addr uintptr //go:cgo_import_dynamic libc_symlinkat symlinkat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sync() (err error) { _, _, e1 := syscall_syscall(libc_sync_trampoline_addr, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_sync_trampoline_addr uintptr //go:cgo_import_dynamic libc_sync sync "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_truncate_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_truncate_trampoline_addr uintptr //go:cgo_import_dynamic libc_truncate truncate "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Umask(newmask int) (oldmask int) { r0, _, _ := syscall_syscall(libc_umask_trampoline_addr, uintptr(newmask), 0, 0) oldmask = int(r0) return } var libc_umask_trampoline_addr uintptr //go:cgo_import_dynamic libc_umask umask "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Undelete(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_undelete_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_undelete_trampoline_addr uintptr //go:cgo_import_dynamic libc_undelete undelete "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlink(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_unlink_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_unlink_trampoline_addr uintptr //go:cgo_import_dynamic libc_unlink unlink "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlinkat(dirfd int, path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_unlinkat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } var libc_unlinkat_trampoline_addr uintptr //go:cgo_import_dynamic libc_unlinkat unlinkat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unmount(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_unmount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_unmount_trampoline_addr uintptr //go:cgo_import_dynamic libc_unmount unmount "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func write(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_write_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_write_trampoline_addr uintptr //go:cgo_import_dynamic libc_write write "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { r0, _, e1 := syscall_syscall6(libc_mmap_trampoline_addr, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos)) ret = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mmap_trampoline_addr uintptr //go:cgo_import_dynamic libc_mmap mmap "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func munmap(addr uintptr, length uintptr) (err error) { _, _, e1 := syscall_syscall(libc_munmap_trampoline_addr, uintptr(addr), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_munmap_trampoline_addr uintptr //go:cgo_import_dynamic libc_munmap munmap "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func readv(fd int, iovecs []Iovec) (n int, err error) { var _p0 unsafe.Pointer if len(iovecs) > 0 { _p0 = unsafe.Pointer(&iovecs[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_readv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_readv_trampoline_addr uintptr //go:cgo_import_dynamic libc_readv readv "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func preadv(fd int, iovecs []Iovec, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(iovecs) > 0 { _p0 = unsafe.Pointer(&iovecs[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall6(libc_preadv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_preadv_trampoline_addr uintptr //go:cgo_import_dynamic libc_preadv preadv "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func writev(fd int, iovecs []Iovec) (n int, err error) { var _p0 unsafe.Pointer if len(iovecs) > 0 { _p0 = unsafe.Pointer(&iovecs[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_writev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_writev_trampoline_addr uintptr //go:cgo_import_dynamic libc_writev writev "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pwritev(fd int, iovecs []Iovec, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(iovecs) > 0 { _p0 = unsafe.Pointer(&iovecs[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall6(libc_pwritev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pwritev_trampoline_addr uintptr //go:cgo_import_dynamic libc_pwritev pwritev "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := syscall_syscall(libc_fstat64_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fstat64_trampoline_addr uintptr //go:cgo_import_dynamic libc_fstat64 fstat64 "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_fstatat64_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fstatat64_trampoline_addr uintptr //go:cgo_import_dynamic libc_fstatat64 fstatat64 "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatfs(fd int, stat *Statfs_t) (err error) { _, _, e1 := syscall_syscall(libc_fstatfs64_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fstatfs64_trampoline_addr uintptr //go:cgo_import_dynamic libc_fstatfs64 fstatfs64 "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) { r0, _, e1 := syscall_syscall(libc_getfsstat64_trampoline_addr, uintptr(buf), uintptr(size), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getfsstat64_trampoline_addr uintptr //go:cgo_import_dynamic libc_getfsstat64 getfsstat64 "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lstat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_lstat64_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_lstat64_trampoline_addr uintptr //go:cgo_import_dynamic libc_lstat64 lstat64 "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) { _, _, e1 := syscall_syscall6(libc_ptrace_trampoline_addr, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_ptrace_trampoline_addr uintptr //go:cgo_import_dynamic libc_ptrace ptrace "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Stat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_stat64_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_stat64_trampoline_addr uintptr //go:cgo_import_dynamic libc_stat64 stat64 "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Statfs(path string, stat *Statfs_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_statfs64_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_statfs64_trampoline_addr uintptr //go:cgo_import_dynamic libc_statfs64 statfs64 "/usr/lib/libSystem.B.dylib" ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s ================================================ // go run mkasm.go darwin amd64 // Code generated by the command above; DO NOT EDIT. #include "textflag.h" TEXT libc_fdopendir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fdopendir(SB) GLOBL ·libc_fdopendir_trampoline_addr(SB), RODATA, $8 DATA ·libc_fdopendir_trampoline_addr(SB)/8, $libc_fdopendir_trampoline<>(SB) TEXT libc_getgroups_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getgroups(SB) GLOBL ·libc_getgroups_trampoline_addr(SB), RODATA, $8 DATA ·libc_getgroups_trampoline_addr(SB)/8, $libc_getgroups_trampoline<>(SB) TEXT libc_setgroups_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setgroups(SB) GLOBL ·libc_setgroups_trampoline_addr(SB), RODATA, $8 DATA ·libc_setgroups_trampoline_addr(SB)/8, $libc_setgroups_trampoline<>(SB) TEXT libc_wait4_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_wait4(SB) GLOBL ·libc_wait4_trampoline_addr(SB), RODATA, $8 DATA ·libc_wait4_trampoline_addr(SB)/8, $libc_wait4_trampoline<>(SB) TEXT libc_accept_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_accept(SB) GLOBL ·libc_accept_trampoline_addr(SB), RODATA, $8 DATA ·libc_accept_trampoline_addr(SB)/8, $libc_accept_trampoline<>(SB) TEXT libc_bind_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_bind(SB) GLOBL ·libc_bind_trampoline_addr(SB), RODATA, $8 DATA ·libc_bind_trampoline_addr(SB)/8, $libc_bind_trampoline<>(SB) TEXT libc_connect_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_connect(SB) GLOBL ·libc_connect_trampoline_addr(SB), RODATA, $8 DATA ·libc_connect_trampoline_addr(SB)/8, $libc_connect_trampoline<>(SB) TEXT libc_socket_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_socket(SB) GLOBL ·libc_socket_trampoline_addr(SB), RODATA, $8 DATA ·libc_socket_trampoline_addr(SB)/8, $libc_socket_trampoline<>(SB) TEXT libc_getsockopt_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getsockopt(SB) GLOBL ·libc_getsockopt_trampoline_addr(SB), RODATA, $8 DATA ·libc_getsockopt_trampoline_addr(SB)/8, $libc_getsockopt_trampoline<>(SB) TEXT libc_setsockopt_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setsockopt(SB) GLOBL ·libc_setsockopt_trampoline_addr(SB), RODATA, $8 DATA ·libc_setsockopt_trampoline_addr(SB)/8, $libc_setsockopt_trampoline<>(SB) TEXT libc_getpeername_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpeername(SB) GLOBL ·libc_getpeername_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpeername_trampoline_addr(SB)/8, $libc_getpeername_trampoline<>(SB) TEXT libc_getsockname_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getsockname(SB) GLOBL ·libc_getsockname_trampoline_addr(SB), RODATA, $8 DATA ·libc_getsockname_trampoline_addr(SB)/8, $libc_getsockname_trampoline<>(SB) TEXT libc_shutdown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_shutdown(SB) GLOBL ·libc_shutdown_trampoline_addr(SB), RODATA, $8 DATA ·libc_shutdown_trampoline_addr(SB)/8, $libc_shutdown_trampoline<>(SB) TEXT libc_socketpair_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_socketpair(SB) GLOBL ·libc_socketpair_trampoline_addr(SB), RODATA, $8 DATA ·libc_socketpair_trampoline_addr(SB)/8, $libc_socketpair_trampoline<>(SB) TEXT libc_recvfrom_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_recvfrom(SB) GLOBL ·libc_recvfrom_trampoline_addr(SB), RODATA, $8 DATA ·libc_recvfrom_trampoline_addr(SB)/8, $libc_recvfrom_trampoline<>(SB) TEXT libc_sendto_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sendto(SB) GLOBL ·libc_sendto_trampoline_addr(SB), RODATA, $8 DATA ·libc_sendto_trampoline_addr(SB)/8, $libc_sendto_trampoline<>(SB) TEXT libc_recvmsg_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_recvmsg(SB) GLOBL ·libc_recvmsg_trampoline_addr(SB), RODATA, $8 DATA ·libc_recvmsg_trampoline_addr(SB)/8, $libc_recvmsg_trampoline<>(SB) TEXT libc_sendmsg_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sendmsg(SB) GLOBL ·libc_sendmsg_trampoline_addr(SB), RODATA, $8 DATA ·libc_sendmsg_trampoline_addr(SB)/8, $libc_sendmsg_trampoline<>(SB) TEXT libc_kevent_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_kevent(SB) GLOBL ·libc_kevent_trampoline_addr(SB), RODATA, $8 DATA ·libc_kevent_trampoline_addr(SB)/8, $libc_kevent_trampoline<>(SB) TEXT libc_utimes_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_utimes(SB) GLOBL ·libc_utimes_trampoline_addr(SB), RODATA, $8 DATA ·libc_utimes_trampoline_addr(SB)/8, $libc_utimes_trampoline<>(SB) TEXT libc_futimes_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_futimes(SB) GLOBL ·libc_futimes_trampoline_addr(SB), RODATA, $8 DATA ·libc_futimes_trampoline_addr(SB)/8, $libc_futimes_trampoline<>(SB) TEXT libc_poll_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_poll(SB) GLOBL ·libc_poll_trampoline_addr(SB), RODATA, $8 DATA ·libc_poll_trampoline_addr(SB)/8, $libc_poll_trampoline<>(SB) TEXT libc_madvise_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_madvise(SB) GLOBL ·libc_madvise_trampoline_addr(SB), RODATA, $8 DATA ·libc_madvise_trampoline_addr(SB)/8, $libc_madvise_trampoline<>(SB) TEXT libc_mlock_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mlock(SB) GLOBL ·libc_mlock_trampoline_addr(SB), RODATA, $8 DATA ·libc_mlock_trampoline_addr(SB)/8, $libc_mlock_trampoline<>(SB) TEXT libc_mlockall_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mlockall(SB) GLOBL ·libc_mlockall_trampoline_addr(SB), RODATA, $8 DATA ·libc_mlockall_trampoline_addr(SB)/8, $libc_mlockall_trampoline<>(SB) TEXT libc_mprotect_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mprotect(SB) GLOBL ·libc_mprotect_trampoline_addr(SB), RODATA, $8 DATA ·libc_mprotect_trampoline_addr(SB)/8, $libc_mprotect_trampoline<>(SB) TEXT libc_msync_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_msync(SB) GLOBL ·libc_msync_trampoline_addr(SB), RODATA, $8 DATA ·libc_msync_trampoline_addr(SB)/8, $libc_msync_trampoline<>(SB) TEXT libc_munlock_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_munlock(SB) GLOBL ·libc_munlock_trampoline_addr(SB), RODATA, $8 DATA ·libc_munlock_trampoline_addr(SB)/8, $libc_munlock_trampoline<>(SB) TEXT libc_munlockall_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_munlockall(SB) GLOBL ·libc_munlockall_trampoline_addr(SB), RODATA, $8 DATA ·libc_munlockall_trampoline_addr(SB)/8, $libc_munlockall_trampoline<>(SB) TEXT libc_closedir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_closedir(SB) GLOBL ·libc_closedir_trampoline_addr(SB), RODATA, $8 DATA ·libc_closedir_trampoline_addr(SB)/8, $libc_closedir_trampoline<>(SB) TEXT libc_readdir_r_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_readdir_r(SB) GLOBL ·libc_readdir_r_trampoline_addr(SB), RODATA, $8 DATA ·libc_readdir_r_trampoline_addr(SB)/8, $libc_readdir_r_trampoline<>(SB) TEXT libc_pipe_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pipe(SB) GLOBL ·libc_pipe_trampoline_addr(SB), RODATA, $8 DATA ·libc_pipe_trampoline_addr(SB)/8, $libc_pipe_trampoline<>(SB) TEXT libc_getxattr_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getxattr(SB) GLOBL ·libc_getxattr_trampoline_addr(SB), RODATA, $8 DATA ·libc_getxattr_trampoline_addr(SB)/8, $libc_getxattr_trampoline<>(SB) TEXT libc_fgetxattr_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fgetxattr(SB) GLOBL ·libc_fgetxattr_trampoline_addr(SB), RODATA, $8 DATA ·libc_fgetxattr_trampoline_addr(SB)/8, $libc_fgetxattr_trampoline<>(SB) TEXT libc_setxattr_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setxattr(SB) GLOBL ·libc_setxattr_trampoline_addr(SB), RODATA, $8 DATA ·libc_setxattr_trampoline_addr(SB)/8, $libc_setxattr_trampoline<>(SB) TEXT libc_fsetxattr_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fsetxattr(SB) GLOBL ·libc_fsetxattr_trampoline_addr(SB), RODATA, $8 DATA ·libc_fsetxattr_trampoline_addr(SB)/8, $libc_fsetxattr_trampoline<>(SB) TEXT libc_removexattr_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_removexattr(SB) GLOBL ·libc_removexattr_trampoline_addr(SB), RODATA, $8 DATA ·libc_removexattr_trampoline_addr(SB)/8, $libc_removexattr_trampoline<>(SB) TEXT libc_fremovexattr_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fremovexattr(SB) GLOBL ·libc_fremovexattr_trampoline_addr(SB), RODATA, $8 DATA ·libc_fremovexattr_trampoline_addr(SB)/8, $libc_fremovexattr_trampoline<>(SB) TEXT libc_listxattr_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_listxattr(SB) GLOBL ·libc_listxattr_trampoline_addr(SB), RODATA, $8 DATA ·libc_listxattr_trampoline_addr(SB)/8, $libc_listxattr_trampoline<>(SB) TEXT libc_flistxattr_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_flistxattr(SB) GLOBL ·libc_flistxattr_trampoline_addr(SB), RODATA, $8 DATA ·libc_flistxattr_trampoline_addr(SB)/8, $libc_flistxattr_trampoline<>(SB) TEXT libc_utimensat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_utimensat(SB) GLOBL ·libc_utimensat_trampoline_addr(SB), RODATA, $8 DATA ·libc_utimensat_trampoline_addr(SB)/8, $libc_utimensat_trampoline<>(SB) TEXT libc_fcntl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fcntl(SB) GLOBL ·libc_fcntl_trampoline_addr(SB), RODATA, $8 DATA ·libc_fcntl_trampoline_addr(SB)/8, $libc_fcntl_trampoline<>(SB) TEXT libc_kill_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_kill(SB) GLOBL ·libc_kill_trampoline_addr(SB), RODATA, $8 DATA ·libc_kill_trampoline_addr(SB)/8, $libc_kill_trampoline<>(SB) TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ioctl(SB) GLOBL ·libc_ioctl_trampoline_addr(SB), RODATA, $8 DATA ·libc_ioctl_trampoline_addr(SB)/8, $libc_ioctl_trampoline<>(SB) TEXT libc_renamex_np_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_renamex_np(SB) GLOBL ·libc_renamex_np_trampoline_addr(SB), RODATA, $8 DATA ·libc_renamex_np_trampoline_addr(SB)/8, $libc_renamex_np_trampoline<>(SB) TEXT libc_renameatx_np_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_renameatx_np(SB) GLOBL ·libc_renameatx_np_trampoline_addr(SB), RODATA, $8 DATA ·libc_renameatx_np_trampoline_addr(SB)/8, $libc_renameatx_np_trampoline<>(SB) TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sysctl(SB) GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8 DATA ·libc_sysctl_trampoline_addr(SB)/8, $libc_sysctl_trampoline<>(SB) TEXT libc_pthread_chdir_np_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pthread_chdir_np(SB) GLOBL ·libc_pthread_chdir_np_trampoline_addr(SB), RODATA, $8 DATA ·libc_pthread_chdir_np_trampoline_addr(SB)/8, $libc_pthread_chdir_np_trampoline<>(SB) TEXT libc_pthread_fchdir_np_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pthread_fchdir_np(SB) GLOBL ·libc_pthread_fchdir_np_trampoline_addr(SB), RODATA, $8 DATA ·libc_pthread_fchdir_np_trampoline_addr(SB)/8, $libc_pthread_fchdir_np_trampoline<>(SB) TEXT libc_connectx_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_connectx(SB) GLOBL ·libc_connectx_trampoline_addr(SB), RODATA, $8 DATA ·libc_connectx_trampoline_addr(SB)/8, $libc_connectx_trampoline<>(SB) TEXT libc_sendfile_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sendfile(SB) GLOBL ·libc_sendfile_trampoline_addr(SB), RODATA, $8 DATA ·libc_sendfile_trampoline_addr(SB)/8, $libc_sendfile_trampoline<>(SB) TEXT libc_shmat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_shmat(SB) GLOBL ·libc_shmat_trampoline_addr(SB), RODATA, $8 DATA ·libc_shmat_trampoline_addr(SB)/8, $libc_shmat_trampoline<>(SB) TEXT libc_shmctl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_shmctl(SB) GLOBL ·libc_shmctl_trampoline_addr(SB), RODATA, $8 DATA ·libc_shmctl_trampoline_addr(SB)/8, $libc_shmctl_trampoline<>(SB) TEXT libc_shmdt_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_shmdt(SB) GLOBL ·libc_shmdt_trampoline_addr(SB), RODATA, $8 DATA ·libc_shmdt_trampoline_addr(SB)/8, $libc_shmdt_trampoline<>(SB) TEXT libc_shmget_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_shmget(SB) GLOBL ·libc_shmget_trampoline_addr(SB), RODATA, $8 DATA ·libc_shmget_trampoline_addr(SB)/8, $libc_shmget_trampoline<>(SB) TEXT libc_access_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_access(SB) GLOBL ·libc_access_trampoline_addr(SB), RODATA, $8 DATA ·libc_access_trampoline_addr(SB)/8, $libc_access_trampoline<>(SB) TEXT libc_adjtime_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_adjtime(SB) GLOBL ·libc_adjtime_trampoline_addr(SB), RODATA, $8 DATA ·libc_adjtime_trampoline_addr(SB)/8, $libc_adjtime_trampoline<>(SB) TEXT libc_chdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chdir(SB) GLOBL ·libc_chdir_trampoline_addr(SB), RODATA, $8 DATA ·libc_chdir_trampoline_addr(SB)/8, $libc_chdir_trampoline<>(SB) TEXT libc_chflags_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chflags(SB) GLOBL ·libc_chflags_trampoline_addr(SB), RODATA, $8 DATA ·libc_chflags_trampoline_addr(SB)/8, $libc_chflags_trampoline<>(SB) TEXT libc_chmod_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chmod(SB) GLOBL ·libc_chmod_trampoline_addr(SB), RODATA, $8 DATA ·libc_chmod_trampoline_addr(SB)/8, $libc_chmod_trampoline<>(SB) TEXT libc_chown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chown(SB) GLOBL ·libc_chown_trampoline_addr(SB), RODATA, $8 DATA ·libc_chown_trampoline_addr(SB)/8, $libc_chown_trampoline<>(SB) TEXT libc_chroot_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chroot(SB) GLOBL ·libc_chroot_trampoline_addr(SB), RODATA, $8 DATA ·libc_chroot_trampoline_addr(SB)/8, $libc_chroot_trampoline<>(SB) TEXT libc_clock_gettime_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_clock_gettime(SB) GLOBL ·libc_clock_gettime_trampoline_addr(SB), RODATA, $8 DATA ·libc_clock_gettime_trampoline_addr(SB)/8, $libc_clock_gettime_trampoline<>(SB) TEXT libc_close_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_close(SB) GLOBL ·libc_close_trampoline_addr(SB), RODATA, $8 DATA ·libc_close_trampoline_addr(SB)/8, $libc_close_trampoline<>(SB) TEXT libc_clonefile_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_clonefile(SB) GLOBL ·libc_clonefile_trampoline_addr(SB), RODATA, $8 DATA ·libc_clonefile_trampoline_addr(SB)/8, $libc_clonefile_trampoline<>(SB) TEXT libc_clonefileat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_clonefileat(SB) GLOBL ·libc_clonefileat_trampoline_addr(SB), RODATA, $8 DATA ·libc_clonefileat_trampoline_addr(SB)/8, $libc_clonefileat_trampoline<>(SB) TEXT libc_dup_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_dup(SB) GLOBL ·libc_dup_trampoline_addr(SB), RODATA, $8 DATA ·libc_dup_trampoline_addr(SB)/8, $libc_dup_trampoline<>(SB) TEXT libc_dup2_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_dup2(SB) GLOBL ·libc_dup2_trampoline_addr(SB), RODATA, $8 DATA ·libc_dup2_trampoline_addr(SB)/8, $libc_dup2_trampoline<>(SB) TEXT libc_exchangedata_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_exchangedata(SB) GLOBL ·libc_exchangedata_trampoline_addr(SB), RODATA, $8 DATA ·libc_exchangedata_trampoline_addr(SB)/8, $libc_exchangedata_trampoline<>(SB) TEXT libc_exit_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_exit(SB) GLOBL ·libc_exit_trampoline_addr(SB), RODATA, $8 DATA ·libc_exit_trampoline_addr(SB)/8, $libc_exit_trampoline<>(SB) TEXT libc_faccessat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_faccessat(SB) GLOBL ·libc_faccessat_trampoline_addr(SB), RODATA, $8 DATA ·libc_faccessat_trampoline_addr(SB)/8, $libc_faccessat_trampoline<>(SB) TEXT libc_fchdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchdir(SB) GLOBL ·libc_fchdir_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchdir_trampoline_addr(SB)/8, $libc_fchdir_trampoline<>(SB) TEXT libc_fchflags_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchflags(SB) GLOBL ·libc_fchflags_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchflags_trampoline_addr(SB)/8, $libc_fchflags_trampoline<>(SB) TEXT libc_fchmod_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchmod(SB) GLOBL ·libc_fchmod_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchmod_trampoline_addr(SB)/8, $libc_fchmod_trampoline<>(SB) TEXT libc_fchmodat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchmodat(SB) GLOBL ·libc_fchmodat_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchmodat_trampoline_addr(SB)/8, $libc_fchmodat_trampoline<>(SB) TEXT libc_fchown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchown(SB) GLOBL ·libc_fchown_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchown_trampoline_addr(SB)/8, $libc_fchown_trampoline<>(SB) TEXT libc_fchownat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchownat(SB) GLOBL ·libc_fchownat_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchownat_trampoline_addr(SB)/8, $libc_fchownat_trampoline<>(SB) TEXT libc_fclonefileat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fclonefileat(SB) GLOBL ·libc_fclonefileat_trampoline_addr(SB), RODATA, $8 DATA ·libc_fclonefileat_trampoline_addr(SB)/8, $libc_fclonefileat_trampoline<>(SB) TEXT libc_flock_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_flock(SB) GLOBL ·libc_flock_trampoline_addr(SB), RODATA, $8 DATA ·libc_flock_trampoline_addr(SB)/8, $libc_flock_trampoline<>(SB) TEXT libc_fpathconf_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fpathconf(SB) GLOBL ·libc_fpathconf_trampoline_addr(SB), RODATA, $8 DATA ·libc_fpathconf_trampoline_addr(SB)/8, $libc_fpathconf_trampoline<>(SB) TEXT libc_fsync_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fsync(SB) GLOBL ·libc_fsync_trampoline_addr(SB), RODATA, $8 DATA ·libc_fsync_trampoline_addr(SB)/8, $libc_fsync_trampoline<>(SB) TEXT libc_ftruncate_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ftruncate(SB) GLOBL ·libc_ftruncate_trampoline_addr(SB), RODATA, $8 DATA ·libc_ftruncate_trampoline_addr(SB)/8, $libc_ftruncate_trampoline<>(SB) TEXT libc_getcwd_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getcwd(SB) GLOBL ·libc_getcwd_trampoline_addr(SB), RODATA, $8 DATA ·libc_getcwd_trampoline_addr(SB)/8, $libc_getcwd_trampoline<>(SB) TEXT libc_getdtablesize_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getdtablesize(SB) GLOBL ·libc_getdtablesize_trampoline_addr(SB), RODATA, $8 DATA ·libc_getdtablesize_trampoline_addr(SB)/8, $libc_getdtablesize_trampoline<>(SB) TEXT libc_getegid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getegid(SB) GLOBL ·libc_getegid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getegid_trampoline_addr(SB)/8, $libc_getegid_trampoline<>(SB) TEXT libc_geteuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_geteuid(SB) GLOBL ·libc_geteuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_geteuid_trampoline_addr(SB)/8, $libc_geteuid_trampoline<>(SB) TEXT libc_getgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getgid(SB) GLOBL ·libc_getgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getgid_trampoline_addr(SB)/8, $libc_getgid_trampoline<>(SB) TEXT libc_getpgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpgid(SB) GLOBL ·libc_getpgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpgid_trampoline_addr(SB)/8, $libc_getpgid_trampoline<>(SB) TEXT libc_getpgrp_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpgrp(SB) GLOBL ·libc_getpgrp_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpgrp_trampoline_addr(SB)/8, $libc_getpgrp_trampoline<>(SB) TEXT libc_getpid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpid(SB) GLOBL ·libc_getpid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpid_trampoline_addr(SB)/8, $libc_getpid_trampoline<>(SB) TEXT libc_getppid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getppid(SB) GLOBL ·libc_getppid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getppid_trampoline_addr(SB)/8, $libc_getppid_trampoline<>(SB) TEXT libc_getpriority_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpriority(SB) GLOBL ·libc_getpriority_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpriority_trampoline_addr(SB)/8, $libc_getpriority_trampoline<>(SB) TEXT libc_getrlimit_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getrlimit(SB) GLOBL ·libc_getrlimit_trampoline_addr(SB), RODATA, $8 DATA ·libc_getrlimit_trampoline_addr(SB)/8, $libc_getrlimit_trampoline<>(SB) TEXT libc_getrusage_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getrusage(SB) GLOBL ·libc_getrusage_trampoline_addr(SB), RODATA, $8 DATA ·libc_getrusage_trampoline_addr(SB)/8, $libc_getrusage_trampoline<>(SB) TEXT libc_getsid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getsid(SB) GLOBL ·libc_getsid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getsid_trampoline_addr(SB)/8, $libc_getsid_trampoline<>(SB) TEXT libc_gettimeofday_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_gettimeofday(SB) GLOBL ·libc_gettimeofday_trampoline_addr(SB), RODATA, $8 DATA ·libc_gettimeofday_trampoline_addr(SB)/8, $libc_gettimeofday_trampoline<>(SB) TEXT libc_getuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getuid(SB) GLOBL ·libc_getuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getuid_trampoline_addr(SB)/8, $libc_getuid_trampoline<>(SB) TEXT libc_issetugid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_issetugid(SB) GLOBL ·libc_issetugid_trampoline_addr(SB), RODATA, $8 DATA ·libc_issetugid_trampoline_addr(SB)/8, $libc_issetugid_trampoline<>(SB) TEXT libc_kqueue_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_kqueue(SB) GLOBL ·libc_kqueue_trampoline_addr(SB), RODATA, $8 DATA ·libc_kqueue_trampoline_addr(SB)/8, $libc_kqueue_trampoline<>(SB) TEXT libc_lchown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_lchown(SB) GLOBL ·libc_lchown_trampoline_addr(SB), RODATA, $8 DATA ·libc_lchown_trampoline_addr(SB)/8, $libc_lchown_trampoline<>(SB) TEXT libc_link_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_link(SB) GLOBL ·libc_link_trampoline_addr(SB), RODATA, $8 DATA ·libc_link_trampoline_addr(SB)/8, $libc_link_trampoline<>(SB) TEXT libc_linkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_linkat(SB) GLOBL ·libc_linkat_trampoline_addr(SB), RODATA, $8 DATA ·libc_linkat_trampoline_addr(SB)/8, $libc_linkat_trampoline<>(SB) TEXT libc_listen_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_listen(SB) GLOBL ·libc_listen_trampoline_addr(SB), RODATA, $8 DATA ·libc_listen_trampoline_addr(SB)/8, $libc_listen_trampoline<>(SB) TEXT libc_mkdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkdir(SB) GLOBL ·libc_mkdir_trampoline_addr(SB), RODATA, $8 DATA ·libc_mkdir_trampoline_addr(SB)/8, $libc_mkdir_trampoline<>(SB) TEXT libc_mkdirat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkdirat(SB) GLOBL ·libc_mkdirat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mkdirat_trampoline_addr(SB)/8, $libc_mkdirat_trampoline<>(SB) TEXT libc_mkfifo_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkfifo(SB) GLOBL ·libc_mkfifo_trampoline_addr(SB), RODATA, $8 DATA ·libc_mkfifo_trampoline_addr(SB)/8, $libc_mkfifo_trampoline<>(SB) TEXT libc_mknod_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mknod(SB) GLOBL ·libc_mknod_trampoline_addr(SB), RODATA, $8 DATA ·libc_mknod_trampoline_addr(SB)/8, $libc_mknod_trampoline<>(SB) TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mount(SB) GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $8 DATA ·libc_mount_trampoline_addr(SB)/8, $libc_mount_trampoline<>(SB) TEXT libc_open_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_open(SB) GLOBL ·libc_open_trampoline_addr(SB), RODATA, $8 DATA ·libc_open_trampoline_addr(SB)/8, $libc_open_trampoline<>(SB) TEXT libc_openat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_openat(SB) GLOBL ·libc_openat_trampoline_addr(SB), RODATA, $8 DATA ·libc_openat_trampoline_addr(SB)/8, $libc_openat_trampoline<>(SB) TEXT libc_pathconf_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pathconf(SB) GLOBL ·libc_pathconf_trampoline_addr(SB), RODATA, $8 DATA ·libc_pathconf_trampoline_addr(SB)/8, $libc_pathconf_trampoline<>(SB) TEXT libc_pread_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pread(SB) GLOBL ·libc_pread_trampoline_addr(SB), RODATA, $8 DATA ·libc_pread_trampoline_addr(SB)/8, $libc_pread_trampoline<>(SB) TEXT libc_pwrite_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pwrite(SB) GLOBL ·libc_pwrite_trampoline_addr(SB), RODATA, $8 DATA ·libc_pwrite_trampoline_addr(SB)/8, $libc_pwrite_trampoline<>(SB) TEXT libc_read_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_read(SB) GLOBL ·libc_read_trampoline_addr(SB), RODATA, $8 DATA ·libc_read_trampoline_addr(SB)/8, $libc_read_trampoline<>(SB) TEXT libc_readlink_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_readlink(SB) GLOBL ·libc_readlink_trampoline_addr(SB), RODATA, $8 DATA ·libc_readlink_trampoline_addr(SB)/8, $libc_readlink_trampoline<>(SB) TEXT libc_readlinkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_readlinkat(SB) GLOBL ·libc_readlinkat_trampoline_addr(SB), RODATA, $8 DATA ·libc_readlinkat_trampoline_addr(SB)/8, $libc_readlinkat_trampoline<>(SB) TEXT libc_rename_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_rename(SB) GLOBL ·libc_rename_trampoline_addr(SB), RODATA, $8 DATA ·libc_rename_trampoline_addr(SB)/8, $libc_rename_trampoline<>(SB) TEXT libc_renameat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_renameat(SB) GLOBL ·libc_renameat_trampoline_addr(SB), RODATA, $8 DATA ·libc_renameat_trampoline_addr(SB)/8, $libc_renameat_trampoline<>(SB) TEXT libc_revoke_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_revoke(SB) GLOBL ·libc_revoke_trampoline_addr(SB), RODATA, $8 DATA ·libc_revoke_trampoline_addr(SB)/8, $libc_revoke_trampoline<>(SB) TEXT libc_rmdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_rmdir(SB) GLOBL ·libc_rmdir_trampoline_addr(SB), RODATA, $8 DATA ·libc_rmdir_trampoline_addr(SB)/8, $libc_rmdir_trampoline<>(SB) TEXT libc_lseek_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_lseek(SB) GLOBL ·libc_lseek_trampoline_addr(SB), RODATA, $8 DATA ·libc_lseek_trampoline_addr(SB)/8, $libc_lseek_trampoline<>(SB) TEXT libc_select_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_select(SB) GLOBL ·libc_select_trampoline_addr(SB), RODATA, $8 DATA ·libc_select_trampoline_addr(SB)/8, $libc_select_trampoline<>(SB) TEXT libc_setattrlist_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setattrlist(SB) GLOBL ·libc_setattrlist_trampoline_addr(SB), RODATA, $8 DATA ·libc_setattrlist_trampoline_addr(SB)/8, $libc_setattrlist_trampoline<>(SB) TEXT libc_setegid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setegid(SB) GLOBL ·libc_setegid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setegid_trampoline_addr(SB)/8, $libc_setegid_trampoline<>(SB) TEXT libc_seteuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_seteuid(SB) GLOBL ·libc_seteuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_seteuid_trampoline_addr(SB)/8, $libc_seteuid_trampoline<>(SB) TEXT libc_setgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setgid(SB) GLOBL ·libc_setgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setgid_trampoline_addr(SB)/8, $libc_setgid_trampoline<>(SB) TEXT libc_setlogin_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setlogin(SB) GLOBL ·libc_setlogin_trampoline_addr(SB), RODATA, $8 DATA ·libc_setlogin_trampoline_addr(SB)/8, $libc_setlogin_trampoline<>(SB) TEXT libc_setpgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setpgid(SB) GLOBL ·libc_setpgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setpgid_trampoline_addr(SB)/8, $libc_setpgid_trampoline<>(SB) TEXT libc_setpriority_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setpriority(SB) GLOBL ·libc_setpriority_trampoline_addr(SB), RODATA, $8 DATA ·libc_setpriority_trampoline_addr(SB)/8, $libc_setpriority_trampoline<>(SB) TEXT libc_setprivexec_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setprivexec(SB) GLOBL ·libc_setprivexec_trampoline_addr(SB), RODATA, $8 DATA ·libc_setprivexec_trampoline_addr(SB)/8, $libc_setprivexec_trampoline<>(SB) TEXT libc_setregid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setregid(SB) GLOBL ·libc_setregid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setregid_trampoline_addr(SB)/8, $libc_setregid_trampoline<>(SB) TEXT libc_setreuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setreuid(SB) GLOBL ·libc_setreuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setreuid_trampoline_addr(SB)/8, $libc_setreuid_trampoline<>(SB) TEXT libc_setsid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setsid(SB) GLOBL ·libc_setsid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setsid_trampoline_addr(SB)/8, $libc_setsid_trampoline<>(SB) TEXT libc_settimeofday_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_settimeofday(SB) GLOBL ·libc_settimeofday_trampoline_addr(SB), RODATA, $8 DATA ·libc_settimeofday_trampoline_addr(SB)/8, $libc_settimeofday_trampoline<>(SB) TEXT libc_setuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setuid(SB) GLOBL ·libc_setuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setuid_trampoline_addr(SB)/8, $libc_setuid_trampoline<>(SB) TEXT libc_symlink_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_symlink(SB) GLOBL ·libc_symlink_trampoline_addr(SB), RODATA, $8 DATA ·libc_symlink_trampoline_addr(SB)/8, $libc_symlink_trampoline<>(SB) TEXT libc_symlinkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_symlinkat(SB) GLOBL ·libc_symlinkat_trampoline_addr(SB), RODATA, $8 DATA ·libc_symlinkat_trampoline_addr(SB)/8, $libc_symlinkat_trampoline<>(SB) TEXT libc_sync_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sync(SB) GLOBL ·libc_sync_trampoline_addr(SB), RODATA, $8 DATA ·libc_sync_trampoline_addr(SB)/8, $libc_sync_trampoline<>(SB) TEXT libc_truncate_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_truncate(SB) GLOBL ·libc_truncate_trampoline_addr(SB), RODATA, $8 DATA ·libc_truncate_trampoline_addr(SB)/8, $libc_truncate_trampoline<>(SB) TEXT libc_umask_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_umask(SB) GLOBL ·libc_umask_trampoline_addr(SB), RODATA, $8 DATA ·libc_umask_trampoline_addr(SB)/8, $libc_umask_trampoline<>(SB) TEXT libc_undelete_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_undelete(SB) GLOBL ·libc_undelete_trampoline_addr(SB), RODATA, $8 DATA ·libc_undelete_trampoline_addr(SB)/8, $libc_undelete_trampoline<>(SB) TEXT libc_unlink_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_unlink(SB) GLOBL ·libc_unlink_trampoline_addr(SB), RODATA, $8 DATA ·libc_unlink_trampoline_addr(SB)/8, $libc_unlink_trampoline<>(SB) TEXT libc_unlinkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_unlinkat(SB) GLOBL ·libc_unlinkat_trampoline_addr(SB), RODATA, $8 DATA ·libc_unlinkat_trampoline_addr(SB)/8, $libc_unlinkat_trampoline<>(SB) TEXT libc_unmount_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_unmount(SB) GLOBL ·libc_unmount_trampoline_addr(SB), RODATA, $8 DATA ·libc_unmount_trampoline_addr(SB)/8, $libc_unmount_trampoline<>(SB) TEXT libc_write_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_write(SB) GLOBL ·libc_write_trampoline_addr(SB), RODATA, $8 DATA ·libc_write_trampoline_addr(SB)/8, $libc_write_trampoline<>(SB) TEXT libc_mmap_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mmap(SB) GLOBL ·libc_mmap_trampoline_addr(SB), RODATA, $8 DATA ·libc_mmap_trampoline_addr(SB)/8, $libc_mmap_trampoline<>(SB) TEXT libc_munmap_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_munmap(SB) GLOBL ·libc_munmap_trampoline_addr(SB), RODATA, $8 DATA ·libc_munmap_trampoline_addr(SB)/8, $libc_munmap_trampoline<>(SB) TEXT libc_readv_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_readv(SB) GLOBL ·libc_readv_trampoline_addr(SB), RODATA, $8 DATA ·libc_readv_trampoline_addr(SB)/8, $libc_readv_trampoline<>(SB) TEXT libc_preadv_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_preadv(SB) GLOBL ·libc_preadv_trampoline_addr(SB), RODATA, $8 DATA ·libc_preadv_trampoline_addr(SB)/8, $libc_preadv_trampoline<>(SB) TEXT libc_writev_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_writev(SB) GLOBL ·libc_writev_trampoline_addr(SB), RODATA, $8 DATA ·libc_writev_trampoline_addr(SB)/8, $libc_writev_trampoline<>(SB) TEXT libc_pwritev_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pwritev(SB) GLOBL ·libc_pwritev_trampoline_addr(SB), RODATA, $8 DATA ·libc_pwritev_trampoline_addr(SB)/8, $libc_pwritev_trampoline<>(SB) TEXT libc_fstat64_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fstat64(SB) GLOBL ·libc_fstat64_trampoline_addr(SB), RODATA, $8 DATA ·libc_fstat64_trampoline_addr(SB)/8, $libc_fstat64_trampoline<>(SB) TEXT libc_fstatat64_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fstatat64(SB) GLOBL ·libc_fstatat64_trampoline_addr(SB), RODATA, $8 DATA ·libc_fstatat64_trampoline_addr(SB)/8, $libc_fstatat64_trampoline<>(SB) TEXT libc_fstatfs64_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fstatfs64(SB) GLOBL ·libc_fstatfs64_trampoline_addr(SB), RODATA, $8 DATA ·libc_fstatfs64_trampoline_addr(SB)/8, $libc_fstatfs64_trampoline<>(SB) TEXT libc_getfsstat64_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getfsstat64(SB) GLOBL ·libc_getfsstat64_trampoline_addr(SB), RODATA, $8 DATA ·libc_getfsstat64_trampoline_addr(SB)/8, $libc_getfsstat64_trampoline<>(SB) TEXT libc_lstat64_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_lstat64(SB) GLOBL ·libc_lstat64_trampoline_addr(SB), RODATA, $8 DATA ·libc_lstat64_trampoline_addr(SB)/8, $libc_lstat64_trampoline<>(SB) TEXT libc_ptrace_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ptrace(SB) GLOBL ·libc_ptrace_trampoline_addr(SB), RODATA, $8 DATA ·libc_ptrace_trampoline_addr(SB)/8, $libc_ptrace_trampoline<>(SB) TEXT libc_stat64_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_stat64(SB) GLOBL ·libc_stat64_trampoline_addr(SB), RODATA, $8 DATA ·libc_stat64_trampoline_addr(SB)/8, $libc_stat64_trampoline<>(SB) TEXT libc_statfs64_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_statfs64(SB) GLOBL ·libc_statfs64_trampoline_addr(SB), RODATA, $8 DATA ·libc_statfs64_trampoline_addr(SB)/8, $libc_statfs64_trampoline<>(SB) ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go ================================================ // go run mksyscall.go -tags darwin,arm64 syscall_bsd.go syscall_darwin.go syscall_darwin_arm64.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build darwin && arm64 package unix import ( "syscall" "unsafe" ) var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(ngid int, gid *_Gid_t) (n int, err error) { r0, _, e1 := syscall_rawSyscall(libc_getgroups_trampoline_addr, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getgroups_trampoline_addr uintptr //go:cgo_import_dynamic libc_getgroups getgroups "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(ngid int, gid *_Gid_t) (err error) { _, _, e1 := syscall_rawSyscall(libc_setgroups_trampoline_addr, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setgroups_trampoline_addr uintptr //go:cgo_import_dynamic libc_setgroups setgroups "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) { r0, _, e1 := syscall_syscall6(libc_wait4_trampoline_addr, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) wpid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_wait4_trampoline_addr uintptr //go:cgo_import_dynamic libc_wait4 wait4 "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { r0, _, e1 := syscall_syscall(libc_accept_trampoline_addr, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_accept_trampoline_addr uintptr //go:cgo_import_dynamic libc_accept accept "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := syscall_syscall(libc_bind_trampoline_addr, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } var libc_bind_trampoline_addr uintptr //go:cgo_import_dynamic libc_bind bind "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := syscall_syscall(libc_connect_trampoline_addr, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } var libc_connect_trampoline_addr uintptr //go:cgo_import_dynamic libc_connect connect "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { r0, _, e1 := syscall_rawSyscall(libc_socket_trampoline_addr, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_socket_trampoline_addr uintptr //go:cgo_import_dynamic libc_socket socket "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { _, _, e1 := syscall_syscall6(libc_getsockopt_trampoline_addr, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getsockopt_trampoline_addr uintptr //go:cgo_import_dynamic libc_getsockopt getsockopt "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { _, _, e1 := syscall_syscall6(libc_setsockopt_trampoline_addr, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setsockopt_trampoline_addr uintptr //go:cgo_import_dynamic libc_setsockopt setsockopt "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := syscall_rawSyscall(libc_getpeername_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } var libc_getpeername_trampoline_addr uintptr //go:cgo_import_dynamic libc_getpeername getpeername "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := syscall_rawSyscall(libc_getsockname_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } var libc_getsockname_trampoline_addr uintptr //go:cgo_import_dynamic libc_getsockname getsockname "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(s int, how int) (err error) { _, _, e1 := syscall_syscall(libc_shutdown_trampoline_addr, uintptr(s), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_shutdown_trampoline_addr uintptr //go:cgo_import_dynamic libc_shutdown shutdown "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { _, _, e1 := syscall_rawSyscall6(libc_socketpair_trampoline_addr, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_socketpair_trampoline_addr uintptr //go:cgo_import_dynamic libc_socketpair socketpair "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall6(libc_recvfrom_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_recvfrom_trampoline_addr uintptr //go:cgo_import_dynamic libc_recvfrom recvfrom "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall6(libc_sendto_trampoline_addr, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } var libc_sendto_trampoline_addr uintptr //go:cgo_import_dynamic libc_sendto sendto "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := syscall_syscall(libc_recvmsg_trampoline_addr, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_recvmsg_trampoline_addr uintptr //go:cgo_import_dynamic libc_recvmsg recvmsg "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := syscall_syscall(libc_sendmsg_trampoline_addr, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_sendmsg_trampoline_addr uintptr //go:cgo_import_dynamic libc_sendmsg sendmsg "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) { r0, _, e1 := syscall_syscall6(libc_kevent_trampoline_addr, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_kevent_trampoline_addr uintptr //go:cgo_import_dynamic libc_kevent kevent "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, timeval *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_utimes_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_utimes_trampoline_addr uintptr //go:cgo_import_dynamic libc_utimes utimes "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func futimes(fd int, timeval *[2]Timeval) (err error) { _, _, e1 := syscall_syscall(libc_futimes_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_futimes_trampoline_addr uintptr //go:cgo_import_dynamic libc_futimes futimes "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := syscall_syscall(libc_poll_trampoline_addr, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_poll_trampoline_addr uintptr //go:cgo_import_dynamic libc_poll poll "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Madvise(b []byte, behav int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall(libc_madvise_trampoline_addr, uintptr(_p0), uintptr(len(b)), uintptr(behav)) if e1 != 0 { err = errnoErr(e1) } return } var libc_madvise_trampoline_addr uintptr //go:cgo_import_dynamic libc_madvise madvise "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall(libc_mlock_trampoline_addr, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mlock_trampoline_addr uintptr //go:cgo_import_dynamic libc_mlock mlock "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlockall(flags int) (err error) { _, _, e1 := syscall_syscall(libc_mlockall_trampoline_addr, uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mlockall_trampoline_addr uintptr //go:cgo_import_dynamic libc_mlockall mlockall "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mprotect(b []byte, prot int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall(libc_mprotect_trampoline_addr, uintptr(_p0), uintptr(len(b)), uintptr(prot)) if e1 != 0 { err = errnoErr(e1) } return } var libc_mprotect_trampoline_addr uintptr //go:cgo_import_dynamic libc_mprotect mprotect "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Msync(b []byte, flags int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall(libc_msync_trampoline_addr, uintptr(_p0), uintptr(len(b)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } var libc_msync_trampoline_addr uintptr //go:cgo_import_dynamic libc_msync msync "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall(libc_munlock_trampoline_addr, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_munlock_trampoline_addr uintptr //go:cgo_import_dynamic libc_munlock munlock "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlockall() (err error) { _, _, e1 := syscall_syscall(libc_munlockall_trampoline_addr, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_munlockall_trampoline_addr uintptr //go:cgo_import_dynamic libc_munlockall munlockall "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func closedir(dir uintptr) (err error) { _, _, e1 := syscall_syscall(libc_closedir_trampoline_addr, uintptr(dir), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_closedir_trampoline_addr uintptr //go:cgo_import_dynamic libc_closedir closedir "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func readdir_r(dir uintptr, entry *Dirent, result **Dirent) (res Errno) { r0, _, _ := syscall_syscall(libc_readdir_r_trampoline_addr, uintptr(dir), uintptr(unsafe.Pointer(entry)), uintptr(unsafe.Pointer(result))) res = Errno(r0) return } var libc_readdir_r_trampoline_addr uintptr //go:cgo_import_dynamic libc_readdir_r readdir_r "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe(p *[2]int32) (err error) { _, _, e1 := syscall_rawSyscall(libc_pipe_trampoline_addr, uintptr(unsafe.Pointer(p)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pipe_trampoline_addr uintptr //go:cgo_import_dynamic libc_pipe pipe "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getxattr(path string, attr string, dest *byte, size int, position uint32, options int) (sz int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } r0, _, e1 := syscall_syscall6(libc_getxattr_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options)) sz = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getxattr_trampoline_addr uintptr //go:cgo_import_dynamic libc_getxattr getxattr "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fgetxattr(fd int, attr string, dest *byte, size int, position uint32, options int) (sz int, err error) { var _p0 *byte _p0, err = BytePtrFromString(attr) if err != nil { return } r0, _, e1 := syscall_syscall6(libc_fgetxattr_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options)) sz = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fgetxattr_trampoline_addr uintptr //go:cgo_import_dynamic libc_fgetxattr fgetxattr "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setxattr(path string, attr string, data *byte, size int, position uint32, options int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } _, _, e1 := syscall_syscall6(libc_setxattr_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options)) if e1 != 0 { err = errnoErr(e1) } return } var libc_setxattr_trampoline_addr uintptr //go:cgo_import_dynamic libc_setxattr setxattr "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fsetxattr(fd int, attr string, data *byte, size int, position uint32, options int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(attr) if err != nil { return } _, _, e1 := syscall_syscall6(libc_fsetxattr_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options)) if e1 != 0 { err = errnoErr(e1) } return } var libc_fsetxattr_trampoline_addr uintptr //go:cgo_import_dynamic libc_fsetxattr fsetxattr "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func removexattr(path string, attr string, options int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } _, _, e1 := syscall_syscall(libc_removexattr_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options)) if e1 != 0 { err = errnoErr(e1) } return } var libc_removexattr_trampoline_addr uintptr //go:cgo_import_dynamic libc_removexattr removexattr "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fremovexattr(fd int, attr string, options int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(attr) if err != nil { return } _, _, e1 := syscall_syscall(libc_fremovexattr_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(options)) if e1 != 0 { err = errnoErr(e1) } return } var libc_fremovexattr_trampoline_addr uintptr //go:cgo_import_dynamic libc_fremovexattr fremovexattr "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func listxattr(path string, dest *byte, size int, options int) (sz int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := syscall_syscall6(libc_listxattr_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0) sz = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_listxattr_trampoline_addr uintptr //go:cgo_import_dynamic libc_listxattr listxattr "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func flistxattr(fd int, dest *byte, size int, options int) (sz int, err error) { r0, _, e1 := syscall_syscall6(libc_flistxattr_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0) sz = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_flistxattr_trampoline_addr uintptr //go:cgo_import_dynamic libc_flistxattr flistxattr "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_utimensat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_utimensat_trampoline_addr uintptr //go:cgo_import_dynamic libc_utimensat utimensat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fcntl(fd int, cmd int, arg int) (val int, err error) { r0, _, e1 := syscall_syscall(libc_fcntl_trampoline_addr, uintptr(fd), uintptr(cmd), uintptr(arg)) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fcntl_trampoline_addr uintptr //go:cgo_import_dynamic libc_fcntl fcntl "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func kill(pid int, signum int, posix int) (err error) { _, _, e1 := syscall_syscall(libc_kill_trampoline_addr, uintptr(pid), uintptr(signum), uintptr(posix)) if e1 != 0 { err = errnoErr(e1) } return } var libc_kill_trampoline_addr uintptr //go:cgo_import_dynamic libc_kill kill "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctl(fd int, req uint, arg uintptr) (err error) { _, _, e1 := syscall_syscall(libc_ioctl_trampoline_addr, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } var libc_ioctl_trampoline_addr uintptr //go:cgo_import_dynamic libc_ioctl ioctl "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) { _, _, e1 := syscall_syscall(libc_ioctl_trampoline_addr, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func renamexNp(from string, to string, flag uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := syscall_syscall(libc_renamex_np_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flag)) if e1 != 0 { err = errnoErr(e1) } return } var libc_renamex_np_trampoline_addr uintptr //go:cgo_import_dynamic libc_renamex_np renamex_np "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func renameatxNp(fromfd int, from string, tofd int, to string, flag uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := syscall_syscall6(libc_renameatx_np_trampoline_addr, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), uintptr(flag), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_renameatx_np_trampoline_addr uintptr //go:cgo_import_dynamic libc_renameatx_np renameatx_np "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { var _p0 unsafe.Pointer if len(mib) > 0 { _p0 = unsafe.Pointer(&mib[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall6(libc_sysctl_trampoline_addr, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) if e1 != 0 { err = errnoErr(e1) } return } var libc_sysctl_trampoline_addr uintptr //go:cgo_import_dynamic libc_sysctl sysctl "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pthread_chdir_np(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_pthread_chdir_np_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pthread_chdir_np_trampoline_addr uintptr //go:cgo_import_dynamic libc_pthread_chdir_np pthread_chdir_np "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pthread_fchdir_np(fd int) (err error) { _, _, e1 := syscall_syscall(libc_pthread_fchdir_np_trampoline_addr, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pthread_fchdir_np_trampoline_addr uintptr //go:cgo_import_dynamic libc_pthread_fchdir_np pthread_fchdir_np "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connectx(fd int, endpoints *SaEndpoints, associd SaeAssocID, flags uint32, iov []Iovec, n *uintptr, connid *SaeConnID) (err error) { var _p0 unsafe.Pointer if len(iov) > 0 { _p0 = unsafe.Pointer(&iov[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall9(libc_connectx_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(endpoints)), uintptr(associd), uintptr(flags), uintptr(_p0), uintptr(len(iov)), uintptr(unsafe.Pointer(n)), uintptr(unsafe.Pointer(connid)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_connectx_trampoline_addr uintptr //go:cgo_import_dynamic libc_connectx connectx "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) { _, _, e1 := syscall_syscall6(libc_sendfile_trampoline_addr, uintptr(infd), uintptr(outfd), uintptr(offset), uintptr(unsafe.Pointer(len)), uintptr(hdtr), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } var libc_sendfile_trampoline_addr uintptr //go:cgo_import_dynamic libc_sendfile sendfile "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func shmat(id int, addr uintptr, flag int) (ret uintptr, err error) { r0, _, e1 := syscall_syscall(libc_shmat_trampoline_addr, uintptr(id), uintptr(addr), uintptr(flag)) ret = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_shmat_trampoline_addr uintptr //go:cgo_import_dynamic libc_shmat shmat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func shmctl(id int, cmd int, buf *SysvShmDesc) (result int, err error) { r0, _, e1 := syscall_syscall(libc_shmctl_trampoline_addr, uintptr(id), uintptr(cmd), uintptr(unsafe.Pointer(buf))) result = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_shmctl_trampoline_addr uintptr //go:cgo_import_dynamic libc_shmctl shmctl "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func shmdt(addr uintptr) (err error) { _, _, e1 := syscall_syscall(libc_shmdt_trampoline_addr, uintptr(addr), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_shmdt_trampoline_addr uintptr //go:cgo_import_dynamic libc_shmdt shmdt "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func shmget(key int, size int, flag int) (id int, err error) { r0, _, e1 := syscall_syscall(libc_shmget_trampoline_addr, uintptr(key), uintptr(size), uintptr(flag)) id = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_shmget_trampoline_addr uintptr //go:cgo_import_dynamic libc_shmget shmget "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Access(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_access_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_access_trampoline_addr uintptr //go:cgo_import_dynamic libc_access access "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Adjtime(delta *Timeval, olddelta *Timeval) (err error) { _, _, e1 := syscall_syscall(libc_adjtime_trampoline_addr, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_adjtime_trampoline_addr uintptr //go:cgo_import_dynamic libc_adjtime adjtime "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_chdir_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_chdir_trampoline_addr uintptr //go:cgo_import_dynamic libc_chdir chdir "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chflags(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_chflags_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_chflags_trampoline_addr uintptr //go:cgo_import_dynamic libc_chflags chflags "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chmod(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_chmod_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_chmod_trampoline_addr uintptr //go:cgo_import_dynamic libc_chmod chmod "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_chown_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } var libc_chown_trampoline_addr uintptr //go:cgo_import_dynamic libc_chown chown "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chroot(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_chroot_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_chroot_trampoline_addr uintptr //go:cgo_import_dynamic libc_chroot chroot "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ClockGettime(clockid int32, time *Timespec) (err error) { _, _, e1 := syscall_syscall(libc_clock_gettime_trampoline_addr, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_clock_gettime_trampoline_addr uintptr //go:cgo_import_dynamic libc_clock_gettime clock_gettime "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Close(fd int) (err error) { _, _, e1 := syscall_syscall(libc_close_trampoline_addr, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_close_trampoline_addr uintptr //go:cgo_import_dynamic libc_close close "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Clonefile(src string, dst string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(src) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(dst) if err != nil { return } _, _, e1 := syscall_syscall(libc_clonefile_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } var libc_clonefile_trampoline_addr uintptr //go:cgo_import_dynamic libc_clonefile clonefile "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Clonefileat(srcDirfd int, src string, dstDirfd int, dst string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(src) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(dst) if err != nil { return } _, _, e1 := syscall_syscall6(libc_clonefileat_trampoline_addr, uintptr(srcDirfd), uintptr(unsafe.Pointer(_p0)), uintptr(dstDirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_clonefileat_trampoline_addr uintptr //go:cgo_import_dynamic libc_clonefileat clonefileat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(fd int) (nfd int, err error) { r0, _, e1 := syscall_syscall(libc_dup_trampoline_addr, uintptr(fd), 0, 0) nfd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_dup_trampoline_addr uintptr //go:cgo_import_dynamic libc_dup dup "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup2(from int, to int) (err error) { _, _, e1 := syscall_syscall(libc_dup2_trampoline_addr, uintptr(from), uintptr(to), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_dup2_trampoline_addr uintptr //go:cgo_import_dynamic libc_dup2 dup2 "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Exchangedata(path1 string, path2 string, options int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path1) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(path2) if err != nil { return } _, _, e1 := syscall_syscall(libc_exchangedata_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options)) if e1 != 0 { err = errnoErr(e1) } return } var libc_exchangedata_trampoline_addr uintptr //go:cgo_import_dynamic libc_exchangedata exchangedata "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Exit(code int) { syscall_syscall(libc_exit_trampoline_addr, uintptr(code), 0, 0) return } var libc_exit_trampoline_addr uintptr //go:cgo_import_dynamic libc_exit exit "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_faccessat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_faccessat_trampoline_addr uintptr //go:cgo_import_dynamic libc_faccessat faccessat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchdir(fd int) (err error) { _, _, e1 := syscall_syscall(libc_fchdir_trampoline_addr, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchdir_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchdir fchdir "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchflags(fd int, flags int) (err error) { _, _, e1 := syscall_syscall(libc_fchflags_trampoline_addr, uintptr(fd), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchflags_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchflags fchflags "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmod(fd int, mode uint32) (err error) { _, _, e1 := syscall_syscall(libc_fchmod_trampoline_addr, uintptr(fd), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchmod_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchmod fchmod "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_fchmodat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchmodat_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchmodat fchmodat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := syscall_syscall(libc_fchown_trampoline_addr, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchown_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchown fchown "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_fchownat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchownat_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchownat fchownat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fclonefileat(srcDirfd int, dstDirfd int, dst string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(dst) if err != nil { return } _, _, e1 := syscall_syscall6(libc_fclonefileat_trampoline_addr, uintptr(srcDirfd), uintptr(dstDirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fclonefileat_trampoline_addr uintptr //go:cgo_import_dynamic libc_fclonefileat fclonefileat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Flock(fd int, how int) (err error) { _, _, e1 := syscall_syscall(libc_flock_trampoline_addr, uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_flock_trampoline_addr uintptr //go:cgo_import_dynamic libc_flock flock "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fpathconf(fd int, name int) (val int, err error) { r0, _, e1 := syscall_syscall(libc_fpathconf_trampoline_addr, uintptr(fd), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fpathconf_trampoline_addr uintptr //go:cgo_import_dynamic libc_fpathconf fpathconf "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fsync(fd int) (err error) { _, _, e1 := syscall_syscall(libc_fsync_trampoline_addr, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fsync_trampoline_addr uintptr //go:cgo_import_dynamic libc_fsync fsync "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { _, _, e1 := syscall_syscall(libc_ftruncate_trampoline_addr, uintptr(fd), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_ftruncate_trampoline_addr uintptr //go:cgo_import_dynamic libc_ftruncate ftruncate "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getcwd(buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_getcwd_trampoline_addr, uintptr(_p0), uintptr(len(buf)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getcwd_trampoline_addr uintptr //go:cgo_import_dynamic libc_getcwd getcwd "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getdtablesize() (size int) { r0, _, _ := syscall_syscall(libc_getdtablesize_trampoline_addr, 0, 0, 0) size = int(r0) return } var libc_getdtablesize_trampoline_addr uintptr //go:cgo_import_dynamic libc_getdtablesize getdtablesize "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { r0, _, _ := syscall_rawSyscall(libc_getegid_trampoline_addr, 0, 0, 0) egid = int(r0) return } var libc_getegid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getegid getegid "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (uid int) { r0, _, _ := syscall_rawSyscall(libc_geteuid_trampoline_addr, 0, 0, 0) uid = int(r0) return } var libc_geteuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_geteuid geteuid "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _, _ := syscall_rawSyscall(libc_getgid_trampoline_addr, 0, 0, 0) gid = int(r0) return } var libc_getgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getgid getgid "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgid(pid int) (pgid int, err error) { r0, _, e1 := syscall_rawSyscall(libc_getpgid_trampoline_addr, uintptr(pid), 0, 0) pgid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getpgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getpgid getpgid "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgrp() (pgrp int) { r0, _, _ := syscall_rawSyscall(libc_getpgrp_trampoline_addr, 0, 0, 0) pgrp = int(r0) return } var libc_getpgrp_trampoline_addr uintptr //go:cgo_import_dynamic libc_getpgrp getpgrp "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpid() (pid int) { r0, _, _ := syscall_rawSyscall(libc_getpid_trampoline_addr, 0, 0, 0) pid = int(r0) return } var libc_getpid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getpid getpid "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getppid() (ppid int) { r0, _, _ := syscall_rawSyscall(libc_getppid_trampoline_addr, 0, 0, 0) ppid = int(r0) return } var libc_getppid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getppid getppid "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpriority(which int, who int) (prio int, err error) { r0, _, e1 := syscall_syscall(libc_getpriority_trampoline_addr, uintptr(which), uintptr(who), 0) prio = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getpriority_trampoline_addr uintptr //go:cgo_import_dynamic libc_getpriority getpriority "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(which int, lim *Rlimit) (err error) { _, _, e1 := syscall_rawSyscall(libc_getrlimit_trampoline_addr, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getrlimit_trampoline_addr uintptr //go:cgo_import_dynamic libc_getrlimit getrlimit "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrusage(who int, rusage *Rusage) (err error) { _, _, e1 := syscall_rawSyscall(libc_getrusage_trampoline_addr, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getrusage_trampoline_addr uintptr //go:cgo_import_dynamic libc_getrusage getrusage "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getsid(pid int) (sid int, err error) { r0, _, e1 := syscall_rawSyscall(libc_getsid_trampoline_addr, uintptr(pid), 0, 0) sid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getsid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getsid getsid "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tp *Timeval) (err error) { _, _, e1 := syscall_rawSyscall(libc_gettimeofday_trampoline_addr, uintptr(unsafe.Pointer(tp)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_gettimeofday_trampoline_addr uintptr //go:cgo_import_dynamic libc_gettimeofday gettimeofday "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _, _ := syscall_rawSyscall(libc_getuid_trampoline_addr, 0, 0, 0) uid = int(r0) return } var libc_getuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getuid getuid "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Issetugid() (tainted bool) { r0, _, _ := syscall_rawSyscall(libc_issetugid_trampoline_addr, 0, 0, 0) tainted = bool(r0 != 0) return } var libc_issetugid_trampoline_addr uintptr //go:cgo_import_dynamic libc_issetugid issetugid "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kqueue() (fd int, err error) { r0, _, e1 := syscall_syscall(libc_kqueue_trampoline_addr, 0, 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_kqueue_trampoline_addr uintptr //go:cgo_import_dynamic libc_kqueue kqueue "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_lchown_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } var libc_lchown_trampoline_addr uintptr //go:cgo_import_dynamic libc_lchown lchown "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Link(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := syscall_syscall(libc_link_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_link_trampoline_addr uintptr //go:cgo_import_dynamic libc_link link "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := syscall_syscall6(libc_linkat_trampoline_addr, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_linkat_trampoline_addr uintptr //go:cgo_import_dynamic libc_linkat linkat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, backlog int) (err error) { _, _, e1 := syscall_syscall(libc_listen_trampoline_addr, uintptr(s), uintptr(backlog), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_listen_trampoline_addr uintptr //go:cgo_import_dynamic libc_listen listen "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdir(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_mkdir_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mkdir_trampoline_addr uintptr //go:cgo_import_dynamic libc_mkdir mkdir "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdirat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_mkdirat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } var libc_mkdirat_trampoline_addr uintptr //go:cgo_import_dynamic libc_mkdirat mkdirat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifo(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_mkfifo_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mkfifo_trampoline_addr uintptr //go:cgo_import_dynamic libc_mkfifo mkfifo "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknod(path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_mknod_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) if e1 != 0 { err = errnoErr(e1) } return } var libc_mknod_trampoline_addr uintptr //go:cgo_import_dynamic libc_mknod mknod "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) { var _p0 *byte _p0, err = BytePtrFromString(fsType) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(dir) if err != nil { return } _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mount_trampoline_addr uintptr //go:cgo_import_dynamic libc_mount mount "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Open(path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := syscall_syscall(libc_open_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_open_trampoline_addr uintptr //go:cgo_import_dynamic libc_open open "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := syscall_syscall6(libc_openat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_openat_trampoline_addr uintptr //go:cgo_import_dynamic libc_openat openat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pathconf(path string, name int) (val int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := syscall_syscall(libc_pathconf_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pathconf_trampoline_addr uintptr //go:cgo_import_dynamic libc_pathconf pathconf "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall6(libc_pread_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pread_trampoline_addr uintptr //go:cgo_import_dynamic libc_pread pread "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall6(libc_pwrite_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pwrite_trampoline_addr uintptr //go:cgo_import_dynamic libc_pwrite pwrite "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func read(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_read_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_read_trampoline_addr uintptr //go:cgo_import_dynamic libc_read read "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlink(path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_readlink_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_readlink_trampoline_addr uintptr //go:cgo_import_dynamic libc_readlink readlink "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall6(libc_readlinkat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_readlinkat_trampoline_addr uintptr //go:cgo_import_dynamic libc_readlinkat readlinkat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rename(from string, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := syscall_syscall(libc_rename_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_rename_trampoline_addr uintptr //go:cgo_import_dynamic libc_rename rename "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(fromfd int, from string, tofd int, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := syscall_syscall6(libc_renameat_trampoline_addr, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_renameat_trampoline_addr uintptr //go:cgo_import_dynamic libc_renameat renameat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Revoke(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_revoke_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_revoke_trampoline_addr uintptr //go:cgo_import_dynamic libc_revoke revoke "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rmdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_rmdir_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_rmdir_trampoline_addr uintptr //go:cgo_import_dynamic libc_rmdir rmdir "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { r0, _, e1 := syscall_syscall(libc_lseek_trampoline_addr, uintptr(fd), uintptr(offset), uintptr(whence)) newoffset = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_lseek_trampoline_addr uintptr //go:cgo_import_dynamic libc_lseek lseek "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { r0, _, e1 := syscall_syscall6(libc_select_trampoline_addr, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_select_trampoline_addr uintptr //go:cgo_import_dynamic libc_select select "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setattrlist(path string, attrlist *Attrlist, attrBuf []byte, options int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(attrBuf) > 0 { _p1 = unsafe.Pointer(&attrBuf[0]) } else { _p1 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall6(libc_setattrlist_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(attrlist)), uintptr(_p1), uintptr(len(attrBuf)), uintptr(options), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setattrlist_trampoline_addr uintptr //go:cgo_import_dynamic libc_setattrlist setattrlist "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setegid(egid int) (err error) { _, _, e1 := syscall_syscall(libc_setegid_trampoline_addr, uintptr(egid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setegid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setegid setegid "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seteuid(euid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_seteuid_trampoline_addr, uintptr(euid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_seteuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_seteuid seteuid "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setgid(gid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setgid_trampoline_addr, uintptr(gid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setgid setgid "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setlogin(name string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(name) if err != nil { return } _, _, e1 := syscall_syscall(libc_setlogin_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setlogin_trampoline_addr uintptr //go:cgo_import_dynamic libc_setlogin setlogin "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setpgid_trampoline_addr, uintptr(pid), uintptr(pgid), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setpgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setpgid setpgid "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpriority(which int, who int, prio int) (err error) { _, _, e1 := syscall_syscall(libc_setpriority_trampoline_addr, uintptr(which), uintptr(who), uintptr(prio)) if e1 != 0 { err = errnoErr(e1) } return } var libc_setpriority_trampoline_addr uintptr //go:cgo_import_dynamic libc_setpriority setpriority "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setprivexec(flag int) (err error) { _, _, e1 := syscall_syscall(libc_setprivexec_trampoline_addr, uintptr(flag), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setprivexec_trampoline_addr uintptr //go:cgo_import_dynamic libc_setprivexec setprivexec "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setregid(rgid int, egid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setregid_trampoline_addr, uintptr(rgid), uintptr(egid), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setregid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setregid setregid "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setreuid(ruid int, euid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setreuid_trampoline_addr, uintptr(ruid), uintptr(euid), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setreuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setreuid setreuid "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, err error) { r0, _, e1 := syscall_rawSyscall(libc_setsid_trampoline_addr, 0, 0, 0) pid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setsid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setsid setsid "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Settimeofday(tp *Timeval) (err error) { _, _, e1 := syscall_rawSyscall(libc_settimeofday_trampoline_addr, uintptr(unsafe.Pointer(tp)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_settimeofday_trampoline_addr uintptr //go:cgo_import_dynamic libc_settimeofday settimeofday "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setuid(uid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setuid_trampoline_addr, uintptr(uid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setuid setuid "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlink(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := syscall_syscall(libc_symlink_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_symlink_trampoline_addr uintptr //go:cgo_import_dynamic libc_symlink symlink "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := syscall_syscall(libc_symlinkat_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } var libc_symlinkat_trampoline_addr uintptr //go:cgo_import_dynamic libc_symlinkat symlinkat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sync() (err error) { _, _, e1 := syscall_syscall(libc_sync_trampoline_addr, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_sync_trampoline_addr uintptr //go:cgo_import_dynamic libc_sync sync "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_truncate_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_truncate_trampoline_addr uintptr //go:cgo_import_dynamic libc_truncate truncate "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Umask(newmask int) (oldmask int) { r0, _, _ := syscall_syscall(libc_umask_trampoline_addr, uintptr(newmask), 0, 0) oldmask = int(r0) return } var libc_umask_trampoline_addr uintptr //go:cgo_import_dynamic libc_umask umask "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Undelete(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_undelete_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_undelete_trampoline_addr uintptr //go:cgo_import_dynamic libc_undelete undelete "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlink(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_unlink_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_unlink_trampoline_addr uintptr //go:cgo_import_dynamic libc_unlink unlink "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlinkat(dirfd int, path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_unlinkat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } var libc_unlinkat_trampoline_addr uintptr //go:cgo_import_dynamic libc_unlinkat unlinkat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unmount(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_unmount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_unmount_trampoline_addr uintptr //go:cgo_import_dynamic libc_unmount unmount "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func write(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_write_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_write_trampoline_addr uintptr //go:cgo_import_dynamic libc_write write "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { r0, _, e1 := syscall_syscall6(libc_mmap_trampoline_addr, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos)) ret = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mmap_trampoline_addr uintptr //go:cgo_import_dynamic libc_mmap mmap "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func munmap(addr uintptr, length uintptr) (err error) { _, _, e1 := syscall_syscall(libc_munmap_trampoline_addr, uintptr(addr), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_munmap_trampoline_addr uintptr //go:cgo_import_dynamic libc_munmap munmap "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func readv(fd int, iovecs []Iovec) (n int, err error) { var _p0 unsafe.Pointer if len(iovecs) > 0 { _p0 = unsafe.Pointer(&iovecs[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_readv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_readv_trampoline_addr uintptr //go:cgo_import_dynamic libc_readv readv "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func preadv(fd int, iovecs []Iovec, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(iovecs) > 0 { _p0 = unsafe.Pointer(&iovecs[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall6(libc_preadv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_preadv_trampoline_addr uintptr //go:cgo_import_dynamic libc_preadv preadv "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func writev(fd int, iovecs []Iovec) (n int, err error) { var _p0 unsafe.Pointer if len(iovecs) > 0 { _p0 = unsafe.Pointer(&iovecs[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_writev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_writev_trampoline_addr uintptr //go:cgo_import_dynamic libc_writev writev "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pwritev(fd int, iovecs []Iovec, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(iovecs) > 0 { _p0 = unsafe.Pointer(&iovecs[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall6(libc_pwritev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pwritev_trampoline_addr uintptr //go:cgo_import_dynamic libc_pwritev pwritev "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := syscall_syscall(libc_fstat_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fstat_trampoline_addr uintptr //go:cgo_import_dynamic libc_fstat fstat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_fstatat_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fstatat_trampoline_addr uintptr //go:cgo_import_dynamic libc_fstatat fstatat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatfs(fd int, stat *Statfs_t) (err error) { _, _, e1 := syscall_syscall(libc_fstatfs_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fstatfs_trampoline_addr uintptr //go:cgo_import_dynamic libc_fstatfs fstatfs "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) { r0, _, e1 := syscall_syscall(libc_getfsstat_trampoline_addr, uintptr(buf), uintptr(size), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getfsstat_trampoline_addr uintptr //go:cgo_import_dynamic libc_getfsstat getfsstat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lstat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_lstat_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_lstat_trampoline_addr uintptr //go:cgo_import_dynamic libc_lstat lstat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) { _, _, e1 := syscall_syscall6(libc_ptrace_trampoline_addr, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_ptrace_trampoline_addr uintptr //go:cgo_import_dynamic libc_ptrace ptrace "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Stat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_stat_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_stat_trampoline_addr uintptr //go:cgo_import_dynamic libc_stat stat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Statfs(path string, stat *Statfs_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_statfs_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_statfs_trampoline_addr uintptr //go:cgo_import_dynamic libc_statfs statfs "/usr/lib/libSystem.B.dylib" ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s ================================================ // go run mkasm.go darwin arm64 // Code generated by the command above; DO NOT EDIT. #include "textflag.h" TEXT libc_fdopendir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fdopendir(SB) GLOBL ·libc_fdopendir_trampoline_addr(SB), RODATA, $8 DATA ·libc_fdopendir_trampoline_addr(SB)/8, $libc_fdopendir_trampoline<>(SB) TEXT libc_getgroups_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getgroups(SB) GLOBL ·libc_getgroups_trampoline_addr(SB), RODATA, $8 DATA ·libc_getgroups_trampoline_addr(SB)/8, $libc_getgroups_trampoline<>(SB) TEXT libc_setgroups_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setgroups(SB) GLOBL ·libc_setgroups_trampoline_addr(SB), RODATA, $8 DATA ·libc_setgroups_trampoline_addr(SB)/8, $libc_setgroups_trampoline<>(SB) TEXT libc_wait4_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_wait4(SB) GLOBL ·libc_wait4_trampoline_addr(SB), RODATA, $8 DATA ·libc_wait4_trampoline_addr(SB)/8, $libc_wait4_trampoline<>(SB) TEXT libc_accept_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_accept(SB) GLOBL ·libc_accept_trampoline_addr(SB), RODATA, $8 DATA ·libc_accept_trampoline_addr(SB)/8, $libc_accept_trampoline<>(SB) TEXT libc_bind_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_bind(SB) GLOBL ·libc_bind_trampoline_addr(SB), RODATA, $8 DATA ·libc_bind_trampoline_addr(SB)/8, $libc_bind_trampoline<>(SB) TEXT libc_connect_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_connect(SB) GLOBL ·libc_connect_trampoline_addr(SB), RODATA, $8 DATA ·libc_connect_trampoline_addr(SB)/8, $libc_connect_trampoline<>(SB) TEXT libc_socket_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_socket(SB) GLOBL ·libc_socket_trampoline_addr(SB), RODATA, $8 DATA ·libc_socket_trampoline_addr(SB)/8, $libc_socket_trampoline<>(SB) TEXT libc_getsockopt_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getsockopt(SB) GLOBL ·libc_getsockopt_trampoline_addr(SB), RODATA, $8 DATA ·libc_getsockopt_trampoline_addr(SB)/8, $libc_getsockopt_trampoline<>(SB) TEXT libc_setsockopt_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setsockopt(SB) GLOBL ·libc_setsockopt_trampoline_addr(SB), RODATA, $8 DATA ·libc_setsockopt_trampoline_addr(SB)/8, $libc_setsockopt_trampoline<>(SB) TEXT libc_getpeername_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpeername(SB) GLOBL ·libc_getpeername_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpeername_trampoline_addr(SB)/8, $libc_getpeername_trampoline<>(SB) TEXT libc_getsockname_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getsockname(SB) GLOBL ·libc_getsockname_trampoline_addr(SB), RODATA, $8 DATA ·libc_getsockname_trampoline_addr(SB)/8, $libc_getsockname_trampoline<>(SB) TEXT libc_shutdown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_shutdown(SB) GLOBL ·libc_shutdown_trampoline_addr(SB), RODATA, $8 DATA ·libc_shutdown_trampoline_addr(SB)/8, $libc_shutdown_trampoline<>(SB) TEXT libc_socketpair_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_socketpair(SB) GLOBL ·libc_socketpair_trampoline_addr(SB), RODATA, $8 DATA ·libc_socketpair_trampoline_addr(SB)/8, $libc_socketpair_trampoline<>(SB) TEXT libc_recvfrom_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_recvfrom(SB) GLOBL ·libc_recvfrom_trampoline_addr(SB), RODATA, $8 DATA ·libc_recvfrom_trampoline_addr(SB)/8, $libc_recvfrom_trampoline<>(SB) TEXT libc_sendto_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sendto(SB) GLOBL ·libc_sendto_trampoline_addr(SB), RODATA, $8 DATA ·libc_sendto_trampoline_addr(SB)/8, $libc_sendto_trampoline<>(SB) TEXT libc_recvmsg_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_recvmsg(SB) GLOBL ·libc_recvmsg_trampoline_addr(SB), RODATA, $8 DATA ·libc_recvmsg_trampoline_addr(SB)/8, $libc_recvmsg_trampoline<>(SB) TEXT libc_sendmsg_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sendmsg(SB) GLOBL ·libc_sendmsg_trampoline_addr(SB), RODATA, $8 DATA ·libc_sendmsg_trampoline_addr(SB)/8, $libc_sendmsg_trampoline<>(SB) TEXT libc_kevent_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_kevent(SB) GLOBL ·libc_kevent_trampoline_addr(SB), RODATA, $8 DATA ·libc_kevent_trampoline_addr(SB)/8, $libc_kevent_trampoline<>(SB) TEXT libc_utimes_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_utimes(SB) GLOBL ·libc_utimes_trampoline_addr(SB), RODATA, $8 DATA ·libc_utimes_trampoline_addr(SB)/8, $libc_utimes_trampoline<>(SB) TEXT libc_futimes_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_futimes(SB) GLOBL ·libc_futimes_trampoline_addr(SB), RODATA, $8 DATA ·libc_futimes_trampoline_addr(SB)/8, $libc_futimes_trampoline<>(SB) TEXT libc_poll_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_poll(SB) GLOBL ·libc_poll_trampoline_addr(SB), RODATA, $8 DATA ·libc_poll_trampoline_addr(SB)/8, $libc_poll_trampoline<>(SB) TEXT libc_madvise_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_madvise(SB) GLOBL ·libc_madvise_trampoline_addr(SB), RODATA, $8 DATA ·libc_madvise_trampoline_addr(SB)/8, $libc_madvise_trampoline<>(SB) TEXT libc_mlock_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mlock(SB) GLOBL ·libc_mlock_trampoline_addr(SB), RODATA, $8 DATA ·libc_mlock_trampoline_addr(SB)/8, $libc_mlock_trampoline<>(SB) TEXT libc_mlockall_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mlockall(SB) GLOBL ·libc_mlockall_trampoline_addr(SB), RODATA, $8 DATA ·libc_mlockall_trampoline_addr(SB)/8, $libc_mlockall_trampoline<>(SB) TEXT libc_mprotect_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mprotect(SB) GLOBL ·libc_mprotect_trampoline_addr(SB), RODATA, $8 DATA ·libc_mprotect_trampoline_addr(SB)/8, $libc_mprotect_trampoline<>(SB) TEXT libc_msync_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_msync(SB) GLOBL ·libc_msync_trampoline_addr(SB), RODATA, $8 DATA ·libc_msync_trampoline_addr(SB)/8, $libc_msync_trampoline<>(SB) TEXT libc_munlock_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_munlock(SB) GLOBL ·libc_munlock_trampoline_addr(SB), RODATA, $8 DATA ·libc_munlock_trampoline_addr(SB)/8, $libc_munlock_trampoline<>(SB) TEXT libc_munlockall_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_munlockall(SB) GLOBL ·libc_munlockall_trampoline_addr(SB), RODATA, $8 DATA ·libc_munlockall_trampoline_addr(SB)/8, $libc_munlockall_trampoline<>(SB) TEXT libc_closedir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_closedir(SB) GLOBL ·libc_closedir_trampoline_addr(SB), RODATA, $8 DATA ·libc_closedir_trampoline_addr(SB)/8, $libc_closedir_trampoline<>(SB) TEXT libc_readdir_r_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_readdir_r(SB) GLOBL ·libc_readdir_r_trampoline_addr(SB), RODATA, $8 DATA ·libc_readdir_r_trampoline_addr(SB)/8, $libc_readdir_r_trampoline<>(SB) TEXT libc_pipe_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pipe(SB) GLOBL ·libc_pipe_trampoline_addr(SB), RODATA, $8 DATA ·libc_pipe_trampoline_addr(SB)/8, $libc_pipe_trampoline<>(SB) TEXT libc_getxattr_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getxattr(SB) GLOBL ·libc_getxattr_trampoline_addr(SB), RODATA, $8 DATA ·libc_getxattr_trampoline_addr(SB)/8, $libc_getxattr_trampoline<>(SB) TEXT libc_fgetxattr_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fgetxattr(SB) GLOBL ·libc_fgetxattr_trampoline_addr(SB), RODATA, $8 DATA ·libc_fgetxattr_trampoline_addr(SB)/8, $libc_fgetxattr_trampoline<>(SB) TEXT libc_setxattr_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setxattr(SB) GLOBL ·libc_setxattr_trampoline_addr(SB), RODATA, $8 DATA ·libc_setxattr_trampoline_addr(SB)/8, $libc_setxattr_trampoline<>(SB) TEXT libc_fsetxattr_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fsetxattr(SB) GLOBL ·libc_fsetxattr_trampoline_addr(SB), RODATA, $8 DATA ·libc_fsetxattr_trampoline_addr(SB)/8, $libc_fsetxattr_trampoline<>(SB) TEXT libc_removexattr_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_removexattr(SB) GLOBL ·libc_removexattr_trampoline_addr(SB), RODATA, $8 DATA ·libc_removexattr_trampoline_addr(SB)/8, $libc_removexattr_trampoline<>(SB) TEXT libc_fremovexattr_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fremovexattr(SB) GLOBL ·libc_fremovexattr_trampoline_addr(SB), RODATA, $8 DATA ·libc_fremovexattr_trampoline_addr(SB)/8, $libc_fremovexattr_trampoline<>(SB) TEXT libc_listxattr_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_listxattr(SB) GLOBL ·libc_listxattr_trampoline_addr(SB), RODATA, $8 DATA ·libc_listxattr_trampoline_addr(SB)/8, $libc_listxattr_trampoline<>(SB) TEXT libc_flistxattr_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_flistxattr(SB) GLOBL ·libc_flistxattr_trampoline_addr(SB), RODATA, $8 DATA ·libc_flistxattr_trampoline_addr(SB)/8, $libc_flistxattr_trampoline<>(SB) TEXT libc_utimensat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_utimensat(SB) GLOBL ·libc_utimensat_trampoline_addr(SB), RODATA, $8 DATA ·libc_utimensat_trampoline_addr(SB)/8, $libc_utimensat_trampoline<>(SB) TEXT libc_fcntl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fcntl(SB) GLOBL ·libc_fcntl_trampoline_addr(SB), RODATA, $8 DATA ·libc_fcntl_trampoline_addr(SB)/8, $libc_fcntl_trampoline<>(SB) TEXT libc_kill_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_kill(SB) GLOBL ·libc_kill_trampoline_addr(SB), RODATA, $8 DATA ·libc_kill_trampoline_addr(SB)/8, $libc_kill_trampoline<>(SB) TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ioctl(SB) GLOBL ·libc_ioctl_trampoline_addr(SB), RODATA, $8 DATA ·libc_ioctl_trampoline_addr(SB)/8, $libc_ioctl_trampoline<>(SB) TEXT libc_renamex_np_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_renamex_np(SB) GLOBL ·libc_renamex_np_trampoline_addr(SB), RODATA, $8 DATA ·libc_renamex_np_trampoline_addr(SB)/8, $libc_renamex_np_trampoline<>(SB) TEXT libc_renameatx_np_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_renameatx_np(SB) GLOBL ·libc_renameatx_np_trampoline_addr(SB), RODATA, $8 DATA ·libc_renameatx_np_trampoline_addr(SB)/8, $libc_renameatx_np_trampoline<>(SB) TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sysctl(SB) GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8 DATA ·libc_sysctl_trampoline_addr(SB)/8, $libc_sysctl_trampoline<>(SB) TEXT libc_pthread_chdir_np_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pthread_chdir_np(SB) GLOBL ·libc_pthread_chdir_np_trampoline_addr(SB), RODATA, $8 DATA ·libc_pthread_chdir_np_trampoline_addr(SB)/8, $libc_pthread_chdir_np_trampoline<>(SB) TEXT libc_pthread_fchdir_np_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pthread_fchdir_np(SB) GLOBL ·libc_pthread_fchdir_np_trampoline_addr(SB), RODATA, $8 DATA ·libc_pthread_fchdir_np_trampoline_addr(SB)/8, $libc_pthread_fchdir_np_trampoline<>(SB) TEXT libc_connectx_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_connectx(SB) GLOBL ·libc_connectx_trampoline_addr(SB), RODATA, $8 DATA ·libc_connectx_trampoline_addr(SB)/8, $libc_connectx_trampoline<>(SB) TEXT libc_sendfile_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sendfile(SB) GLOBL ·libc_sendfile_trampoline_addr(SB), RODATA, $8 DATA ·libc_sendfile_trampoline_addr(SB)/8, $libc_sendfile_trampoline<>(SB) TEXT libc_shmat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_shmat(SB) GLOBL ·libc_shmat_trampoline_addr(SB), RODATA, $8 DATA ·libc_shmat_trampoline_addr(SB)/8, $libc_shmat_trampoline<>(SB) TEXT libc_shmctl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_shmctl(SB) GLOBL ·libc_shmctl_trampoline_addr(SB), RODATA, $8 DATA ·libc_shmctl_trampoline_addr(SB)/8, $libc_shmctl_trampoline<>(SB) TEXT libc_shmdt_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_shmdt(SB) GLOBL ·libc_shmdt_trampoline_addr(SB), RODATA, $8 DATA ·libc_shmdt_trampoline_addr(SB)/8, $libc_shmdt_trampoline<>(SB) TEXT libc_shmget_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_shmget(SB) GLOBL ·libc_shmget_trampoline_addr(SB), RODATA, $8 DATA ·libc_shmget_trampoline_addr(SB)/8, $libc_shmget_trampoline<>(SB) TEXT libc_access_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_access(SB) GLOBL ·libc_access_trampoline_addr(SB), RODATA, $8 DATA ·libc_access_trampoline_addr(SB)/8, $libc_access_trampoline<>(SB) TEXT libc_adjtime_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_adjtime(SB) GLOBL ·libc_adjtime_trampoline_addr(SB), RODATA, $8 DATA ·libc_adjtime_trampoline_addr(SB)/8, $libc_adjtime_trampoline<>(SB) TEXT libc_chdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chdir(SB) GLOBL ·libc_chdir_trampoline_addr(SB), RODATA, $8 DATA ·libc_chdir_trampoline_addr(SB)/8, $libc_chdir_trampoline<>(SB) TEXT libc_chflags_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chflags(SB) GLOBL ·libc_chflags_trampoline_addr(SB), RODATA, $8 DATA ·libc_chflags_trampoline_addr(SB)/8, $libc_chflags_trampoline<>(SB) TEXT libc_chmod_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chmod(SB) GLOBL ·libc_chmod_trampoline_addr(SB), RODATA, $8 DATA ·libc_chmod_trampoline_addr(SB)/8, $libc_chmod_trampoline<>(SB) TEXT libc_chown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chown(SB) GLOBL ·libc_chown_trampoline_addr(SB), RODATA, $8 DATA ·libc_chown_trampoline_addr(SB)/8, $libc_chown_trampoline<>(SB) TEXT libc_chroot_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chroot(SB) GLOBL ·libc_chroot_trampoline_addr(SB), RODATA, $8 DATA ·libc_chroot_trampoline_addr(SB)/8, $libc_chroot_trampoline<>(SB) TEXT libc_clock_gettime_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_clock_gettime(SB) GLOBL ·libc_clock_gettime_trampoline_addr(SB), RODATA, $8 DATA ·libc_clock_gettime_trampoline_addr(SB)/8, $libc_clock_gettime_trampoline<>(SB) TEXT libc_close_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_close(SB) GLOBL ·libc_close_trampoline_addr(SB), RODATA, $8 DATA ·libc_close_trampoline_addr(SB)/8, $libc_close_trampoline<>(SB) TEXT libc_clonefile_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_clonefile(SB) GLOBL ·libc_clonefile_trampoline_addr(SB), RODATA, $8 DATA ·libc_clonefile_trampoline_addr(SB)/8, $libc_clonefile_trampoline<>(SB) TEXT libc_clonefileat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_clonefileat(SB) GLOBL ·libc_clonefileat_trampoline_addr(SB), RODATA, $8 DATA ·libc_clonefileat_trampoline_addr(SB)/8, $libc_clonefileat_trampoline<>(SB) TEXT libc_dup_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_dup(SB) GLOBL ·libc_dup_trampoline_addr(SB), RODATA, $8 DATA ·libc_dup_trampoline_addr(SB)/8, $libc_dup_trampoline<>(SB) TEXT libc_dup2_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_dup2(SB) GLOBL ·libc_dup2_trampoline_addr(SB), RODATA, $8 DATA ·libc_dup2_trampoline_addr(SB)/8, $libc_dup2_trampoline<>(SB) TEXT libc_exchangedata_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_exchangedata(SB) GLOBL ·libc_exchangedata_trampoline_addr(SB), RODATA, $8 DATA ·libc_exchangedata_trampoline_addr(SB)/8, $libc_exchangedata_trampoline<>(SB) TEXT libc_exit_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_exit(SB) GLOBL ·libc_exit_trampoline_addr(SB), RODATA, $8 DATA ·libc_exit_trampoline_addr(SB)/8, $libc_exit_trampoline<>(SB) TEXT libc_faccessat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_faccessat(SB) GLOBL ·libc_faccessat_trampoline_addr(SB), RODATA, $8 DATA ·libc_faccessat_trampoline_addr(SB)/8, $libc_faccessat_trampoline<>(SB) TEXT libc_fchdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchdir(SB) GLOBL ·libc_fchdir_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchdir_trampoline_addr(SB)/8, $libc_fchdir_trampoline<>(SB) TEXT libc_fchflags_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchflags(SB) GLOBL ·libc_fchflags_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchflags_trampoline_addr(SB)/8, $libc_fchflags_trampoline<>(SB) TEXT libc_fchmod_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchmod(SB) GLOBL ·libc_fchmod_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchmod_trampoline_addr(SB)/8, $libc_fchmod_trampoline<>(SB) TEXT libc_fchmodat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchmodat(SB) GLOBL ·libc_fchmodat_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchmodat_trampoline_addr(SB)/8, $libc_fchmodat_trampoline<>(SB) TEXT libc_fchown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchown(SB) GLOBL ·libc_fchown_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchown_trampoline_addr(SB)/8, $libc_fchown_trampoline<>(SB) TEXT libc_fchownat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchownat(SB) GLOBL ·libc_fchownat_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchownat_trampoline_addr(SB)/8, $libc_fchownat_trampoline<>(SB) TEXT libc_fclonefileat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fclonefileat(SB) GLOBL ·libc_fclonefileat_trampoline_addr(SB), RODATA, $8 DATA ·libc_fclonefileat_trampoline_addr(SB)/8, $libc_fclonefileat_trampoline<>(SB) TEXT libc_flock_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_flock(SB) GLOBL ·libc_flock_trampoline_addr(SB), RODATA, $8 DATA ·libc_flock_trampoline_addr(SB)/8, $libc_flock_trampoline<>(SB) TEXT libc_fpathconf_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fpathconf(SB) GLOBL ·libc_fpathconf_trampoline_addr(SB), RODATA, $8 DATA ·libc_fpathconf_trampoline_addr(SB)/8, $libc_fpathconf_trampoline<>(SB) TEXT libc_fsync_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fsync(SB) GLOBL ·libc_fsync_trampoline_addr(SB), RODATA, $8 DATA ·libc_fsync_trampoline_addr(SB)/8, $libc_fsync_trampoline<>(SB) TEXT libc_ftruncate_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ftruncate(SB) GLOBL ·libc_ftruncate_trampoline_addr(SB), RODATA, $8 DATA ·libc_ftruncate_trampoline_addr(SB)/8, $libc_ftruncate_trampoline<>(SB) TEXT libc_getcwd_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getcwd(SB) GLOBL ·libc_getcwd_trampoline_addr(SB), RODATA, $8 DATA ·libc_getcwd_trampoline_addr(SB)/8, $libc_getcwd_trampoline<>(SB) TEXT libc_getdtablesize_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getdtablesize(SB) GLOBL ·libc_getdtablesize_trampoline_addr(SB), RODATA, $8 DATA ·libc_getdtablesize_trampoline_addr(SB)/8, $libc_getdtablesize_trampoline<>(SB) TEXT libc_getegid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getegid(SB) GLOBL ·libc_getegid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getegid_trampoline_addr(SB)/8, $libc_getegid_trampoline<>(SB) TEXT libc_geteuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_geteuid(SB) GLOBL ·libc_geteuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_geteuid_trampoline_addr(SB)/8, $libc_geteuid_trampoline<>(SB) TEXT libc_getgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getgid(SB) GLOBL ·libc_getgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getgid_trampoline_addr(SB)/8, $libc_getgid_trampoline<>(SB) TEXT libc_getpgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpgid(SB) GLOBL ·libc_getpgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpgid_trampoline_addr(SB)/8, $libc_getpgid_trampoline<>(SB) TEXT libc_getpgrp_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpgrp(SB) GLOBL ·libc_getpgrp_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpgrp_trampoline_addr(SB)/8, $libc_getpgrp_trampoline<>(SB) TEXT libc_getpid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpid(SB) GLOBL ·libc_getpid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpid_trampoline_addr(SB)/8, $libc_getpid_trampoline<>(SB) TEXT libc_getppid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getppid(SB) GLOBL ·libc_getppid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getppid_trampoline_addr(SB)/8, $libc_getppid_trampoline<>(SB) TEXT libc_getpriority_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpriority(SB) GLOBL ·libc_getpriority_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpriority_trampoline_addr(SB)/8, $libc_getpriority_trampoline<>(SB) TEXT libc_getrlimit_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getrlimit(SB) GLOBL ·libc_getrlimit_trampoline_addr(SB), RODATA, $8 DATA ·libc_getrlimit_trampoline_addr(SB)/8, $libc_getrlimit_trampoline<>(SB) TEXT libc_getrusage_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getrusage(SB) GLOBL ·libc_getrusage_trampoline_addr(SB), RODATA, $8 DATA ·libc_getrusage_trampoline_addr(SB)/8, $libc_getrusage_trampoline<>(SB) TEXT libc_getsid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getsid(SB) GLOBL ·libc_getsid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getsid_trampoline_addr(SB)/8, $libc_getsid_trampoline<>(SB) TEXT libc_gettimeofday_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_gettimeofday(SB) GLOBL ·libc_gettimeofday_trampoline_addr(SB), RODATA, $8 DATA ·libc_gettimeofday_trampoline_addr(SB)/8, $libc_gettimeofday_trampoline<>(SB) TEXT libc_getuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getuid(SB) GLOBL ·libc_getuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getuid_trampoline_addr(SB)/8, $libc_getuid_trampoline<>(SB) TEXT libc_issetugid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_issetugid(SB) GLOBL ·libc_issetugid_trampoline_addr(SB), RODATA, $8 DATA ·libc_issetugid_trampoline_addr(SB)/8, $libc_issetugid_trampoline<>(SB) TEXT libc_kqueue_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_kqueue(SB) GLOBL ·libc_kqueue_trampoline_addr(SB), RODATA, $8 DATA ·libc_kqueue_trampoline_addr(SB)/8, $libc_kqueue_trampoline<>(SB) TEXT libc_lchown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_lchown(SB) GLOBL ·libc_lchown_trampoline_addr(SB), RODATA, $8 DATA ·libc_lchown_trampoline_addr(SB)/8, $libc_lchown_trampoline<>(SB) TEXT libc_link_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_link(SB) GLOBL ·libc_link_trampoline_addr(SB), RODATA, $8 DATA ·libc_link_trampoline_addr(SB)/8, $libc_link_trampoline<>(SB) TEXT libc_linkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_linkat(SB) GLOBL ·libc_linkat_trampoline_addr(SB), RODATA, $8 DATA ·libc_linkat_trampoline_addr(SB)/8, $libc_linkat_trampoline<>(SB) TEXT libc_listen_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_listen(SB) GLOBL ·libc_listen_trampoline_addr(SB), RODATA, $8 DATA ·libc_listen_trampoline_addr(SB)/8, $libc_listen_trampoline<>(SB) TEXT libc_mkdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkdir(SB) GLOBL ·libc_mkdir_trampoline_addr(SB), RODATA, $8 DATA ·libc_mkdir_trampoline_addr(SB)/8, $libc_mkdir_trampoline<>(SB) TEXT libc_mkdirat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkdirat(SB) GLOBL ·libc_mkdirat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mkdirat_trampoline_addr(SB)/8, $libc_mkdirat_trampoline<>(SB) TEXT libc_mkfifo_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkfifo(SB) GLOBL ·libc_mkfifo_trampoline_addr(SB), RODATA, $8 DATA ·libc_mkfifo_trampoline_addr(SB)/8, $libc_mkfifo_trampoline<>(SB) TEXT libc_mknod_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mknod(SB) GLOBL ·libc_mknod_trampoline_addr(SB), RODATA, $8 DATA ·libc_mknod_trampoline_addr(SB)/8, $libc_mknod_trampoline<>(SB) TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mount(SB) GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $8 DATA ·libc_mount_trampoline_addr(SB)/8, $libc_mount_trampoline<>(SB) TEXT libc_open_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_open(SB) GLOBL ·libc_open_trampoline_addr(SB), RODATA, $8 DATA ·libc_open_trampoline_addr(SB)/8, $libc_open_trampoline<>(SB) TEXT libc_openat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_openat(SB) GLOBL ·libc_openat_trampoline_addr(SB), RODATA, $8 DATA ·libc_openat_trampoline_addr(SB)/8, $libc_openat_trampoline<>(SB) TEXT libc_pathconf_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pathconf(SB) GLOBL ·libc_pathconf_trampoline_addr(SB), RODATA, $8 DATA ·libc_pathconf_trampoline_addr(SB)/8, $libc_pathconf_trampoline<>(SB) TEXT libc_pread_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pread(SB) GLOBL ·libc_pread_trampoline_addr(SB), RODATA, $8 DATA ·libc_pread_trampoline_addr(SB)/8, $libc_pread_trampoline<>(SB) TEXT libc_pwrite_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pwrite(SB) GLOBL ·libc_pwrite_trampoline_addr(SB), RODATA, $8 DATA ·libc_pwrite_trampoline_addr(SB)/8, $libc_pwrite_trampoline<>(SB) TEXT libc_read_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_read(SB) GLOBL ·libc_read_trampoline_addr(SB), RODATA, $8 DATA ·libc_read_trampoline_addr(SB)/8, $libc_read_trampoline<>(SB) TEXT libc_readlink_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_readlink(SB) GLOBL ·libc_readlink_trampoline_addr(SB), RODATA, $8 DATA ·libc_readlink_trampoline_addr(SB)/8, $libc_readlink_trampoline<>(SB) TEXT libc_readlinkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_readlinkat(SB) GLOBL ·libc_readlinkat_trampoline_addr(SB), RODATA, $8 DATA ·libc_readlinkat_trampoline_addr(SB)/8, $libc_readlinkat_trampoline<>(SB) TEXT libc_rename_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_rename(SB) GLOBL ·libc_rename_trampoline_addr(SB), RODATA, $8 DATA ·libc_rename_trampoline_addr(SB)/8, $libc_rename_trampoline<>(SB) TEXT libc_renameat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_renameat(SB) GLOBL ·libc_renameat_trampoline_addr(SB), RODATA, $8 DATA ·libc_renameat_trampoline_addr(SB)/8, $libc_renameat_trampoline<>(SB) TEXT libc_revoke_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_revoke(SB) GLOBL ·libc_revoke_trampoline_addr(SB), RODATA, $8 DATA ·libc_revoke_trampoline_addr(SB)/8, $libc_revoke_trampoline<>(SB) TEXT libc_rmdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_rmdir(SB) GLOBL ·libc_rmdir_trampoline_addr(SB), RODATA, $8 DATA ·libc_rmdir_trampoline_addr(SB)/8, $libc_rmdir_trampoline<>(SB) TEXT libc_lseek_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_lseek(SB) GLOBL ·libc_lseek_trampoline_addr(SB), RODATA, $8 DATA ·libc_lseek_trampoline_addr(SB)/8, $libc_lseek_trampoline<>(SB) TEXT libc_select_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_select(SB) GLOBL ·libc_select_trampoline_addr(SB), RODATA, $8 DATA ·libc_select_trampoline_addr(SB)/8, $libc_select_trampoline<>(SB) TEXT libc_setattrlist_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setattrlist(SB) GLOBL ·libc_setattrlist_trampoline_addr(SB), RODATA, $8 DATA ·libc_setattrlist_trampoline_addr(SB)/8, $libc_setattrlist_trampoline<>(SB) TEXT libc_setegid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setegid(SB) GLOBL ·libc_setegid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setegid_trampoline_addr(SB)/8, $libc_setegid_trampoline<>(SB) TEXT libc_seteuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_seteuid(SB) GLOBL ·libc_seteuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_seteuid_trampoline_addr(SB)/8, $libc_seteuid_trampoline<>(SB) TEXT libc_setgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setgid(SB) GLOBL ·libc_setgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setgid_trampoline_addr(SB)/8, $libc_setgid_trampoline<>(SB) TEXT libc_setlogin_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setlogin(SB) GLOBL ·libc_setlogin_trampoline_addr(SB), RODATA, $8 DATA ·libc_setlogin_trampoline_addr(SB)/8, $libc_setlogin_trampoline<>(SB) TEXT libc_setpgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setpgid(SB) GLOBL ·libc_setpgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setpgid_trampoline_addr(SB)/8, $libc_setpgid_trampoline<>(SB) TEXT libc_setpriority_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setpriority(SB) GLOBL ·libc_setpriority_trampoline_addr(SB), RODATA, $8 DATA ·libc_setpriority_trampoline_addr(SB)/8, $libc_setpriority_trampoline<>(SB) TEXT libc_setprivexec_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setprivexec(SB) GLOBL ·libc_setprivexec_trampoline_addr(SB), RODATA, $8 DATA ·libc_setprivexec_trampoline_addr(SB)/8, $libc_setprivexec_trampoline<>(SB) TEXT libc_setregid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setregid(SB) GLOBL ·libc_setregid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setregid_trampoline_addr(SB)/8, $libc_setregid_trampoline<>(SB) TEXT libc_setreuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setreuid(SB) GLOBL ·libc_setreuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setreuid_trampoline_addr(SB)/8, $libc_setreuid_trampoline<>(SB) TEXT libc_setsid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setsid(SB) GLOBL ·libc_setsid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setsid_trampoline_addr(SB)/8, $libc_setsid_trampoline<>(SB) TEXT libc_settimeofday_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_settimeofday(SB) GLOBL ·libc_settimeofday_trampoline_addr(SB), RODATA, $8 DATA ·libc_settimeofday_trampoline_addr(SB)/8, $libc_settimeofday_trampoline<>(SB) TEXT libc_setuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setuid(SB) GLOBL ·libc_setuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setuid_trampoline_addr(SB)/8, $libc_setuid_trampoline<>(SB) TEXT libc_symlink_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_symlink(SB) GLOBL ·libc_symlink_trampoline_addr(SB), RODATA, $8 DATA ·libc_symlink_trampoline_addr(SB)/8, $libc_symlink_trampoline<>(SB) TEXT libc_symlinkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_symlinkat(SB) GLOBL ·libc_symlinkat_trampoline_addr(SB), RODATA, $8 DATA ·libc_symlinkat_trampoline_addr(SB)/8, $libc_symlinkat_trampoline<>(SB) TEXT libc_sync_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sync(SB) GLOBL ·libc_sync_trampoline_addr(SB), RODATA, $8 DATA ·libc_sync_trampoline_addr(SB)/8, $libc_sync_trampoline<>(SB) TEXT libc_truncate_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_truncate(SB) GLOBL ·libc_truncate_trampoline_addr(SB), RODATA, $8 DATA ·libc_truncate_trampoline_addr(SB)/8, $libc_truncate_trampoline<>(SB) TEXT libc_umask_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_umask(SB) GLOBL ·libc_umask_trampoline_addr(SB), RODATA, $8 DATA ·libc_umask_trampoline_addr(SB)/8, $libc_umask_trampoline<>(SB) TEXT libc_undelete_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_undelete(SB) GLOBL ·libc_undelete_trampoline_addr(SB), RODATA, $8 DATA ·libc_undelete_trampoline_addr(SB)/8, $libc_undelete_trampoline<>(SB) TEXT libc_unlink_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_unlink(SB) GLOBL ·libc_unlink_trampoline_addr(SB), RODATA, $8 DATA ·libc_unlink_trampoline_addr(SB)/8, $libc_unlink_trampoline<>(SB) TEXT libc_unlinkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_unlinkat(SB) GLOBL ·libc_unlinkat_trampoline_addr(SB), RODATA, $8 DATA ·libc_unlinkat_trampoline_addr(SB)/8, $libc_unlinkat_trampoline<>(SB) TEXT libc_unmount_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_unmount(SB) GLOBL ·libc_unmount_trampoline_addr(SB), RODATA, $8 DATA ·libc_unmount_trampoline_addr(SB)/8, $libc_unmount_trampoline<>(SB) TEXT libc_write_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_write(SB) GLOBL ·libc_write_trampoline_addr(SB), RODATA, $8 DATA ·libc_write_trampoline_addr(SB)/8, $libc_write_trampoline<>(SB) TEXT libc_mmap_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mmap(SB) GLOBL ·libc_mmap_trampoline_addr(SB), RODATA, $8 DATA ·libc_mmap_trampoline_addr(SB)/8, $libc_mmap_trampoline<>(SB) TEXT libc_munmap_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_munmap(SB) GLOBL ·libc_munmap_trampoline_addr(SB), RODATA, $8 DATA ·libc_munmap_trampoline_addr(SB)/8, $libc_munmap_trampoline<>(SB) TEXT libc_readv_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_readv(SB) GLOBL ·libc_readv_trampoline_addr(SB), RODATA, $8 DATA ·libc_readv_trampoline_addr(SB)/8, $libc_readv_trampoline<>(SB) TEXT libc_preadv_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_preadv(SB) GLOBL ·libc_preadv_trampoline_addr(SB), RODATA, $8 DATA ·libc_preadv_trampoline_addr(SB)/8, $libc_preadv_trampoline<>(SB) TEXT libc_writev_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_writev(SB) GLOBL ·libc_writev_trampoline_addr(SB), RODATA, $8 DATA ·libc_writev_trampoline_addr(SB)/8, $libc_writev_trampoline<>(SB) TEXT libc_pwritev_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pwritev(SB) GLOBL ·libc_pwritev_trampoline_addr(SB), RODATA, $8 DATA ·libc_pwritev_trampoline_addr(SB)/8, $libc_pwritev_trampoline<>(SB) TEXT libc_fstat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fstat(SB) GLOBL ·libc_fstat_trampoline_addr(SB), RODATA, $8 DATA ·libc_fstat_trampoline_addr(SB)/8, $libc_fstat_trampoline<>(SB) TEXT libc_fstatat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fstatat(SB) GLOBL ·libc_fstatat_trampoline_addr(SB), RODATA, $8 DATA ·libc_fstatat_trampoline_addr(SB)/8, $libc_fstatat_trampoline<>(SB) TEXT libc_fstatfs_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fstatfs(SB) GLOBL ·libc_fstatfs_trampoline_addr(SB), RODATA, $8 DATA ·libc_fstatfs_trampoline_addr(SB)/8, $libc_fstatfs_trampoline<>(SB) TEXT libc_getfsstat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getfsstat(SB) GLOBL ·libc_getfsstat_trampoline_addr(SB), RODATA, $8 DATA ·libc_getfsstat_trampoline_addr(SB)/8, $libc_getfsstat_trampoline<>(SB) TEXT libc_lstat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_lstat(SB) GLOBL ·libc_lstat_trampoline_addr(SB), RODATA, $8 DATA ·libc_lstat_trampoline_addr(SB)/8, $libc_lstat_trampoline<>(SB) TEXT libc_ptrace_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ptrace(SB) GLOBL ·libc_ptrace_trampoline_addr(SB), RODATA, $8 DATA ·libc_ptrace_trampoline_addr(SB)/8, $libc_ptrace_trampoline<>(SB) TEXT libc_stat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_stat(SB) GLOBL ·libc_stat_trampoline_addr(SB), RODATA, $8 DATA ·libc_stat_trampoline_addr(SB)/8, $libc_stat_trampoline<>(SB) TEXT libc_statfs_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_statfs(SB) GLOBL ·libc_statfs_trampoline_addr(SB), RODATA, $8 DATA ·libc_statfs_trampoline_addr(SB)/8, $libc_statfs_trampoline<>(SB) ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go ================================================ // go run mksyscall.go -dragonfly -tags dragonfly,amd64 syscall_bsd.go syscall_dragonfly.go syscall_dragonfly_amd64.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build dragonfly && amd64 package unix import ( "syscall" "unsafe" ) var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(ngid int, gid *_Gid_t) (n int, err error) { r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(ngid int, gid *_Gid_t) (err error) { _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) { r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) wpid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(s int, how int) (err error) { _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) { r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, timeval *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func futimes(fd int, timeval *[2]Timeval) (err error) { _, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Madvise(b []byte, behav int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(behav)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlockall(flags int) (err error) { _, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mprotect(b []byte, prot int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Msync(b []byte, flags int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlockall() (err error) { _, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe() (r int, w int, err error) { r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0) r = int(r0) w = int(r1) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe2(p *[2]_C_int, flags int) (r int, w int, err error) { r0, r1, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) r = int(r0) w = int(r1) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func extpread(fd int, p []byte, flags int, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_EXTPREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(offset), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func extpwrite(fd int, p []byte, flags int, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_EXTPWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(offset), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getcwd(buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS___GETCWD, uintptr(_p0), uintptr(len(buf)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctl(fd int, req uint, arg uintptr) (err error) { _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) { _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { var _p0 unsafe.Pointer if len(mib) > 0 { _p0 = unsafe.Pointer(&mib[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Access(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Adjtime(delta *Timeval, olddelta *Timeval) (err error) { _, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chflags(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chmod(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chroot(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ClockGettime(clockid int32, time *Timespec) (err error) { _, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Close(fd int) (err error) { _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(fd int) (nfd int, err error) { r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0) nfd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup2(from int, to int) (err error) { _, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Exit(code int) { Syscall(SYS_EXIT, uintptr(code), 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchdir(fd int) (err error) { _, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchflags(fd int, flags int) (err error) { _, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmod(fd int, mode uint32) (err error) { _, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Flock(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fpathconf(fd int, name int) (val int, err error) { r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FSTATAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatfs(fd int, stat *Statfs_t) (err error) { _, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fsync(fd int) (err error) { _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), 0, uintptr(length)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getdents(fd int, buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_GETDENTS, uintptr(fd), uintptr(_p0), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_GETDIRENTRIES, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getdtablesize() (size int) { r0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0) size = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0) egid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (uid int) { r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0) gid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgid(pid int) (pgid int, err error) { r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0) pgid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgrp() (pgrp int) { r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0) pgrp = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpid() (pid int) { r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0) pid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getppid() (ppid int) { r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0) ppid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpriority(which int, who int) (prio int, err error) { r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0) prio = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(which int, lim *Rlimit) (err error) { _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrusage(who int, rusage *Rusage) (err error) { _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getsid(pid int) (sid int, err error) { r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) sid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tv *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Issetugid() (tainted bool) { r0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0) tainted = bool(r0 != 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kill(pid int, signum syscall.Signal) (err error) { _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kqueue() (fd int, err error) { r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Link(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := Syscall6(SYS_LINKAT, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, backlog int) (err error) { _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lstat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdir(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdirat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifo(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknod(path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknodat(fd int, path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Open(path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pathconf(path string, name int) (val int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func read(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlink(path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rename(from string, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(fromfd int, from string, tofd int, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Revoke(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rmdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { r0, _, e1 := Syscall6(SYS_LSEEK, uintptr(fd), 0, uintptr(offset), uintptr(whence), 0, 0) newoffset = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { r0, _, e1 := Syscall6(SYS_SELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setegid(egid int) (err error) { _, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seteuid(euid int) (err error) { _, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setgid(gid int) (err error) { _, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setlogin(name string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(name) if err != nil { return } _, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (err error) { _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpriority(which int, who int, prio int) (err error) { _, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setregid(rgid int, egid int) (err error) { _, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setreuid(ruid int, euid int) (err error) { _, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresgid(rgid int, egid int, sgid int) (err error) { _, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresuid(ruid int, euid int, suid int) (err error) { _, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, err error) { r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0) pid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Settimeofday(tp *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setuid(uid int) (err error) { _, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Stat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Statfs(path string, stat *Statfs_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlink(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sync() (err error) { _, _, e1 := Syscall(SYS_SYNC, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Umask(newmask int) (oldmask int) { r0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0) oldmask = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Undelete(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlink(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlinkat(dirfd int, path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unmount(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func write(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { r0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), 0, uintptr(pos), 0, 0) ret = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func munmap(addr uintptr, length uintptr) (err error) { _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error) { r0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0) nfd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go ================================================ // go run mksyscall.go -l32 -tags freebsd,386 syscall_bsd.go syscall_freebsd.go syscall_freebsd_386.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build freebsd && 386 package unix import ( "syscall" "unsafe" ) var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(ngid int, gid *_Gid_t) (n int, err error) { r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(ngid int, gid *_Gid_t) (err error) { _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) { r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) wpid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(s int, how int) (err error) { _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) { r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, timeval *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func futimes(fd int, timeval *[2]Timeval) (err error) { _, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Madvise(b []byte, behav int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(behav)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlockall(flags int) (err error) { _, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mprotect(b []byte, prot int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Msync(b []byte, flags int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlockall() (err error) { _, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe2(p *[2]_C_int, flags int) (err error) { _, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getcwd(buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS___GETCWD, uintptr(_p0), uintptr(len(buf)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctl(fd int, req uint, arg uintptr) (err error) { _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) { _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { var _p0 unsafe.Pointer if len(mib) > 0 { _p0 = unsafe.Pointer(&mib[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ptrace(request int, pid int, addr uintptr, data int) (err error) { _, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ptracePtr(request int, pid int, addr unsafe.Pointer, data int) (err error) { _, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Access(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Adjtime(delta *Timeval, olddelta *Timeval) (err error) { _, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func CapEnter() (err error) { _, _, e1 := Syscall(SYS_CAP_ENTER, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func capRightsGet(version int, fd int, rightsp *CapRights) (err error) { _, _, e1 := Syscall(SYS___CAP_RIGHTS_GET, uintptr(version), uintptr(fd), uintptr(unsafe.Pointer(rightsp))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func capRightsLimit(fd int, rightsp *CapRights) (err error) { _, _, e1 := Syscall(SYS_CAP_RIGHTS_LIMIT, uintptr(fd), uintptr(unsafe.Pointer(rightsp)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chflags(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chmod(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chroot(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ClockGettime(clockid int32, time *Timespec) (err error) { _, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Close(fd int) (err error) { _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(fd int) (nfd int, err error) { r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0) nfd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup2(from int, to int) (err error) { _, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Exit(code int) { Syscall(SYS_EXIT, uintptr(code), 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrGetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_GET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrSetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_SET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrDeleteFd(fd int, attrnamespace int, attrname string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(attrname) if err != nil { return } _, _, e1 := Syscall(SYS_EXTATTR_DELETE_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrListFd(fd int, attrnamespace int, data uintptr, nbytes int) (ret int, err error) { r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FD, uintptr(fd), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrGetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(file) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_GET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrSetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(file) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_SET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrDeleteFile(file string, attrnamespace int, attrname string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(file) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } _, _, e1 := Syscall(SYS_EXTATTR_DELETE_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrListFile(file string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(file) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrGetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(link) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_GET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrSetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(link) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_SET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrDeleteLink(link string, attrnamespace int, attrname string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(link) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } _, _, e1 := Syscall(SYS_EXTATTR_DELETE_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrListLink(link string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(link) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall6(SYS_POSIX_FADVISE, uintptr(fd), uintptr(offset), uintptr(offset>>32), uintptr(length), uintptr(length>>32), uintptr(advice)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchdir(fd int) (err error) { _, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchflags(fd int, flags int) (err error) { _, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmod(fd int, mode uint32) (err error) { _, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Flock(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fpathconf(fd int, name int) (val int, err error) { r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FSTATAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatfs(fd int, stat *Statfs_t) (err error) { _, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fsync(fd int) (err error) { _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), uintptr(length>>32)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getdirentries(fd int, buf []byte, basep *uint64) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_GETDIRENTRIES, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getdtablesize() (size int) { r0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0) size = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0) egid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (uid int) { r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0) gid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgid(pid int) (pgid int, err error) { r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0) pgid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgrp() (pgrp int) { r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0) pgrp = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpid() (pid int) { r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0) pid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getppid() (ppid int) { r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0) ppid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpriority(which int, who int) (prio int, err error) { r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0) prio = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(which int, lim *Rlimit) (err error) { _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrusage(who int, rusage *Rusage) (err error) { _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getsid(pid int) (sid int, err error) { r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) sid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tv *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Issetugid() (tainted bool) { r0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0) tainted = bool(r0 != 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kill(pid int, signum syscall.Signal) (err error) { _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kqueue() (fd int, err error) { r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Link(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := Syscall6(SYS_LINKAT, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, backlog int) (err error) { _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdir(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdirat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifo(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknodat(fd int, path string, mode uint32, dev uint64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), uintptr(dev>>32), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Open(path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Openat(fdat int, path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(fdat), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pathconf(path string, name int) (val int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func read(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlink(path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rename(from string, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(fromfd int, from string, tofd int, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Revoke(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rmdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { r0, r1, e1 := Syscall6(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(offset>>32), uintptr(whence), 0, 0) newoffset = int64(int64(r1)<<32 | int64(r0)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { r0, _, e1 := Syscall6(SYS_SELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setegid(egid int) (err error) { _, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seteuid(euid int) (err error) { _, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setgid(gid int) (err error) { _, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setlogin(name string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(name) if err != nil { return } _, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (err error) { _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpriority(which int, who int, prio int) (err error) { _, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setregid(rgid int, egid int) (err error) { _, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setreuid(ruid int, euid int) (err error) { _, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresgid(rgid int, egid int, sgid int) (err error) { _, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresuid(ruid int, euid int, suid int) (err error) { _, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, err error) { r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0) pid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Settimeofday(tp *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setuid(uid int) (err error) { _, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Statfs(path string, stat *Statfs_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlink(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sync() (err error) { _, _, e1 := Syscall(SYS_SYNC, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), uintptr(length>>32)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Umask(newmask int) (oldmask int) { r0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0) oldmask = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Undelete(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlink(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlinkat(dirfd int, path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unmount(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func write(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { r0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos), uintptr(pos>>32), 0, 0) ret = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func munmap(addr uintptr, length uintptr) (err error) { _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error) { r0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0) nfd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go ================================================ // go run mksyscall.go -tags freebsd,amd64 syscall_bsd.go syscall_freebsd.go syscall_freebsd_amd64.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build freebsd && amd64 package unix import ( "syscall" "unsafe" ) var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(ngid int, gid *_Gid_t) (n int, err error) { r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(ngid int, gid *_Gid_t) (err error) { _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) { r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) wpid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(s int, how int) (err error) { _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) { r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, timeval *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func futimes(fd int, timeval *[2]Timeval) (err error) { _, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Madvise(b []byte, behav int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(behav)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlockall(flags int) (err error) { _, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mprotect(b []byte, prot int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Msync(b []byte, flags int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlockall() (err error) { _, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe2(p *[2]_C_int, flags int) (err error) { _, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getcwd(buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS___GETCWD, uintptr(_p0), uintptr(len(buf)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctl(fd int, req uint, arg uintptr) (err error) { _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) { _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { var _p0 unsafe.Pointer if len(mib) > 0 { _p0 = unsafe.Pointer(&mib[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ptrace(request int, pid int, addr uintptr, data int) (err error) { _, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ptracePtr(request int, pid int, addr unsafe.Pointer, data int) (err error) { _, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Access(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Adjtime(delta *Timeval, olddelta *Timeval) (err error) { _, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func CapEnter() (err error) { _, _, e1 := Syscall(SYS_CAP_ENTER, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func capRightsGet(version int, fd int, rightsp *CapRights) (err error) { _, _, e1 := Syscall(SYS___CAP_RIGHTS_GET, uintptr(version), uintptr(fd), uintptr(unsafe.Pointer(rightsp))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func capRightsLimit(fd int, rightsp *CapRights) (err error) { _, _, e1 := Syscall(SYS_CAP_RIGHTS_LIMIT, uintptr(fd), uintptr(unsafe.Pointer(rightsp)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chflags(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chmod(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chroot(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ClockGettime(clockid int32, time *Timespec) (err error) { _, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Close(fd int) (err error) { _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(fd int) (nfd int, err error) { r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0) nfd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup2(from int, to int) (err error) { _, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Exit(code int) { Syscall(SYS_EXIT, uintptr(code), 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrGetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_GET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrSetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_SET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrDeleteFd(fd int, attrnamespace int, attrname string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(attrname) if err != nil { return } _, _, e1 := Syscall(SYS_EXTATTR_DELETE_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrListFd(fd int, attrnamespace int, data uintptr, nbytes int) (ret int, err error) { r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FD, uintptr(fd), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrGetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(file) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_GET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrSetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(file) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_SET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrDeleteFile(file string, attrnamespace int, attrname string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(file) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } _, _, e1 := Syscall(SYS_EXTATTR_DELETE_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrListFile(file string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(file) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrGetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(link) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_GET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrSetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(link) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_SET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrDeleteLink(link string, attrnamespace int, attrname string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(link) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } _, _, e1 := Syscall(SYS_EXTATTR_DELETE_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrListLink(link string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(link) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall6(SYS_POSIX_FADVISE, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchdir(fd int) (err error) { _, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchflags(fd int, flags int) (err error) { _, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmod(fd int, mode uint32) (err error) { _, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Flock(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fpathconf(fd int, name int) (val int, err error) { r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FSTATAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatfs(fd int, stat *Statfs_t) (err error) { _, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fsync(fd int) (err error) { _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getdirentries(fd int, buf []byte, basep *uint64) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_GETDIRENTRIES, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getdtablesize() (size int) { r0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0) size = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0) egid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (uid int) { r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0) gid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgid(pid int) (pgid int, err error) { r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0) pgid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgrp() (pgrp int) { r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0) pgrp = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpid() (pid int) { r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0) pid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getppid() (ppid int) { r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0) ppid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpriority(which int, who int) (prio int, err error) { r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0) prio = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(which int, lim *Rlimit) (err error) { _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrusage(who int, rusage *Rusage) (err error) { _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getsid(pid int) (sid int, err error) { r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) sid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tv *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Issetugid() (tainted bool) { r0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0) tainted = bool(r0 != 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kill(pid int, signum syscall.Signal) (err error) { _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kqueue() (fd int, err error) { r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Link(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := Syscall6(SYS_LINKAT, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, backlog int) (err error) { _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdir(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdirat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifo(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknodat(fd int, path string, mode uint32, dev uint64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Open(path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Openat(fdat int, path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(fdat), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pathconf(path string, name int) (val int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func read(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlink(path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rename(from string, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(fromfd int, from string, tofd int, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Revoke(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rmdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { r0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence)) newoffset = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { r0, _, e1 := Syscall6(SYS_SELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setegid(egid int) (err error) { _, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seteuid(euid int) (err error) { _, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setgid(gid int) (err error) { _, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setlogin(name string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(name) if err != nil { return } _, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (err error) { _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpriority(which int, who int, prio int) (err error) { _, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setregid(rgid int, egid int) (err error) { _, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setreuid(ruid int, euid int) (err error) { _, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresgid(rgid int, egid int, sgid int) (err error) { _, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresuid(ruid int, euid int, suid int) (err error) { _, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, err error) { r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0) pid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Settimeofday(tp *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setuid(uid int) (err error) { _, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Statfs(path string, stat *Statfs_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlink(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sync() (err error) { _, _, e1 := Syscall(SYS_SYNC, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Umask(newmask int) (oldmask int) { r0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0) oldmask = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Undelete(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlink(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlinkat(dirfd int, path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unmount(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func write(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { r0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos)) ret = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func munmap(addr uintptr, length uintptr) (err error) { _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error) { r0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0) nfd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go ================================================ // go run mksyscall.go -l32 -arm -tags freebsd,arm syscall_bsd.go syscall_freebsd.go syscall_freebsd_arm.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build freebsd && arm package unix import ( "syscall" "unsafe" ) var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(ngid int, gid *_Gid_t) (n int, err error) { r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(ngid int, gid *_Gid_t) (err error) { _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) { r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) wpid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(s int, how int) (err error) { _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) { r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, timeval *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func futimes(fd int, timeval *[2]Timeval) (err error) { _, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Madvise(b []byte, behav int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(behav)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlockall(flags int) (err error) { _, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mprotect(b []byte, prot int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Msync(b []byte, flags int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlockall() (err error) { _, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe2(p *[2]_C_int, flags int) (err error) { _, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getcwd(buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS___GETCWD, uintptr(_p0), uintptr(len(buf)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctl(fd int, req uint, arg uintptr) (err error) { _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) { _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { var _p0 unsafe.Pointer if len(mib) > 0 { _p0 = unsafe.Pointer(&mib[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ptrace(request int, pid int, addr uintptr, data int) (err error) { _, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ptracePtr(request int, pid int, addr unsafe.Pointer, data int) (err error) { _, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Access(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Adjtime(delta *Timeval, olddelta *Timeval) (err error) { _, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func CapEnter() (err error) { _, _, e1 := Syscall(SYS_CAP_ENTER, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func capRightsGet(version int, fd int, rightsp *CapRights) (err error) { _, _, e1 := Syscall(SYS___CAP_RIGHTS_GET, uintptr(version), uintptr(fd), uintptr(unsafe.Pointer(rightsp))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func capRightsLimit(fd int, rightsp *CapRights) (err error) { _, _, e1 := Syscall(SYS_CAP_RIGHTS_LIMIT, uintptr(fd), uintptr(unsafe.Pointer(rightsp)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chflags(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chmod(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chroot(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ClockGettime(clockid int32, time *Timespec) (err error) { _, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Close(fd int) (err error) { _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(fd int) (nfd int, err error) { r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0) nfd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup2(from int, to int) (err error) { _, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Exit(code int) { Syscall(SYS_EXIT, uintptr(code), 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrGetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_GET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrSetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_SET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrDeleteFd(fd int, attrnamespace int, attrname string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(attrname) if err != nil { return } _, _, e1 := Syscall(SYS_EXTATTR_DELETE_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrListFd(fd int, attrnamespace int, data uintptr, nbytes int) (ret int, err error) { r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FD, uintptr(fd), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrGetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(file) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_GET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrSetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(file) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_SET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrDeleteFile(file string, attrnamespace int, attrname string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(file) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } _, _, e1 := Syscall(SYS_EXTATTR_DELETE_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrListFile(file string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(file) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrGetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(link) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_GET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrSetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(link) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_SET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrDeleteLink(link string, attrnamespace int, attrname string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(link) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } _, _, e1 := Syscall(SYS_EXTATTR_DELETE_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrListLink(link string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(link) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall9(SYS_POSIX_FADVISE, uintptr(fd), 0, uintptr(offset), uintptr(offset>>32), uintptr(length), uintptr(length>>32), uintptr(advice), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchdir(fd int) (err error) { _, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchflags(fd int, flags int) (err error) { _, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmod(fd int, mode uint32) (err error) { _, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Flock(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fpathconf(fd int, name int) (val int, err error) { r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FSTATAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatfs(fd int, stat *Statfs_t) (err error) { _, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fsync(fd int) (err error) { _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { _, _, e1 := Syscall6(SYS_FTRUNCATE, uintptr(fd), 0, uintptr(length), uintptr(length>>32), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getdirentries(fd int, buf []byte, basep *uint64) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_GETDIRENTRIES, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getdtablesize() (size int) { r0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0) size = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0) egid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (uid int) { r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0) gid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgid(pid int) (pgid int, err error) { r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0) pgid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgrp() (pgrp int) { r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0) pgrp = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpid() (pid int) { r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0) pid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getppid() (ppid int) { r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0) ppid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpriority(which int, who int) (prio int, err error) { r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0) prio = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(which int, lim *Rlimit) (err error) { _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrusage(who int, rusage *Rusage) (err error) { _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getsid(pid int) (sid int, err error) { r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) sid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tv *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Issetugid() (tainted bool) { r0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0) tainted = bool(r0 != 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kill(pid int, signum syscall.Signal) (err error) { _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kqueue() (fd int, err error) { r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Link(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := Syscall6(SYS_LINKAT, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, backlog int) (err error) { _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdir(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdirat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifo(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknodat(fd int, path string, mode uint32, dev uint64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, uintptr(dev), uintptr(dev>>32)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Open(path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Openat(fdat int, path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(fdat), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pathconf(path string, name int) (val int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func read(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlink(path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rename(from string, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(fromfd int, from string, tofd int, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Revoke(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rmdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { r0, r1, e1 := Syscall6(SYS_LSEEK, uintptr(fd), 0, uintptr(offset), uintptr(offset>>32), uintptr(whence), 0) newoffset = int64(int64(r1)<<32 | int64(r0)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { r0, _, e1 := Syscall6(SYS_SELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setegid(egid int) (err error) { _, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seteuid(euid int) (err error) { _, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setgid(gid int) (err error) { _, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setlogin(name string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(name) if err != nil { return } _, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (err error) { _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpriority(which int, who int, prio int) (err error) { _, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setregid(rgid int, egid int) (err error) { _, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setreuid(ruid int, euid int) (err error) { _, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresgid(rgid int, egid int, sgid int) (err error) { _, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresuid(ruid int, euid int, suid int) (err error) { _, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, err error) { r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0) pid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Settimeofday(tp *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setuid(uid int) (err error) { _, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Statfs(path string, stat *Statfs_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlink(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sync() (err error) { _, _, e1 := Syscall(SYS_SYNC, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length), uintptr(length>>32), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Umask(newmask int) (oldmask int) { r0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0) oldmask = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Undelete(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlink(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlinkat(dirfd int, path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unmount(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func write(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { r0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), 0, uintptr(pos), uintptr(pos>>32), 0) ret = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func munmap(addr uintptr, length uintptr) (err error) { _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error) { r0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0) nfd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go ================================================ // go run mksyscall.go -tags freebsd,arm64 syscall_bsd.go syscall_freebsd.go syscall_freebsd_arm64.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build freebsd && arm64 package unix import ( "syscall" "unsafe" ) var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(ngid int, gid *_Gid_t) (n int, err error) { r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(ngid int, gid *_Gid_t) (err error) { _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) { r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) wpid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(s int, how int) (err error) { _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) { r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, timeval *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func futimes(fd int, timeval *[2]Timeval) (err error) { _, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Madvise(b []byte, behav int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(behav)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlockall(flags int) (err error) { _, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mprotect(b []byte, prot int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Msync(b []byte, flags int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlockall() (err error) { _, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe2(p *[2]_C_int, flags int) (err error) { _, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getcwd(buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS___GETCWD, uintptr(_p0), uintptr(len(buf)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctl(fd int, req uint, arg uintptr) (err error) { _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) { _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { var _p0 unsafe.Pointer if len(mib) > 0 { _p0 = unsafe.Pointer(&mib[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ptrace(request int, pid int, addr uintptr, data int) (err error) { _, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ptracePtr(request int, pid int, addr unsafe.Pointer, data int) (err error) { _, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Access(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Adjtime(delta *Timeval, olddelta *Timeval) (err error) { _, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func CapEnter() (err error) { _, _, e1 := Syscall(SYS_CAP_ENTER, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func capRightsGet(version int, fd int, rightsp *CapRights) (err error) { _, _, e1 := Syscall(SYS___CAP_RIGHTS_GET, uintptr(version), uintptr(fd), uintptr(unsafe.Pointer(rightsp))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func capRightsLimit(fd int, rightsp *CapRights) (err error) { _, _, e1 := Syscall(SYS_CAP_RIGHTS_LIMIT, uintptr(fd), uintptr(unsafe.Pointer(rightsp)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chflags(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chmod(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chroot(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ClockGettime(clockid int32, time *Timespec) (err error) { _, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Close(fd int) (err error) { _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(fd int) (nfd int, err error) { r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0) nfd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup2(from int, to int) (err error) { _, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Exit(code int) { Syscall(SYS_EXIT, uintptr(code), 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrGetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_GET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrSetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_SET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrDeleteFd(fd int, attrnamespace int, attrname string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(attrname) if err != nil { return } _, _, e1 := Syscall(SYS_EXTATTR_DELETE_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrListFd(fd int, attrnamespace int, data uintptr, nbytes int) (ret int, err error) { r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FD, uintptr(fd), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrGetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(file) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_GET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrSetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(file) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_SET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrDeleteFile(file string, attrnamespace int, attrname string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(file) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } _, _, e1 := Syscall(SYS_EXTATTR_DELETE_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrListFile(file string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(file) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrGetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(link) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_GET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrSetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(link) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_SET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrDeleteLink(link string, attrnamespace int, attrname string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(link) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } _, _, e1 := Syscall(SYS_EXTATTR_DELETE_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrListLink(link string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(link) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall6(SYS_POSIX_FADVISE, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchdir(fd int) (err error) { _, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchflags(fd int, flags int) (err error) { _, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmod(fd int, mode uint32) (err error) { _, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Flock(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fpathconf(fd int, name int) (val int, err error) { r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FSTATAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatfs(fd int, stat *Statfs_t) (err error) { _, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fsync(fd int) (err error) { _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getdirentries(fd int, buf []byte, basep *uint64) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_GETDIRENTRIES, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getdtablesize() (size int) { r0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0) size = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0) egid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (uid int) { r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0) gid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgid(pid int) (pgid int, err error) { r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0) pgid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgrp() (pgrp int) { r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0) pgrp = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpid() (pid int) { r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0) pid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getppid() (ppid int) { r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0) ppid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpriority(which int, who int) (prio int, err error) { r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0) prio = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(which int, lim *Rlimit) (err error) { _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrusage(who int, rusage *Rusage) (err error) { _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getsid(pid int) (sid int, err error) { r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) sid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tv *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Issetugid() (tainted bool) { r0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0) tainted = bool(r0 != 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kill(pid int, signum syscall.Signal) (err error) { _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kqueue() (fd int, err error) { r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Link(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := Syscall6(SYS_LINKAT, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, backlog int) (err error) { _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdir(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdirat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifo(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknodat(fd int, path string, mode uint32, dev uint64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Open(path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Openat(fdat int, path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(fdat), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pathconf(path string, name int) (val int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func read(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlink(path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rename(from string, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(fromfd int, from string, tofd int, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Revoke(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rmdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { r0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence)) newoffset = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { r0, _, e1 := Syscall6(SYS_SELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setegid(egid int) (err error) { _, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seteuid(euid int) (err error) { _, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setgid(gid int) (err error) { _, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setlogin(name string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(name) if err != nil { return } _, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (err error) { _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpriority(which int, who int, prio int) (err error) { _, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setregid(rgid int, egid int) (err error) { _, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setreuid(ruid int, euid int) (err error) { _, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresgid(rgid int, egid int, sgid int) (err error) { _, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresuid(ruid int, euid int, suid int) (err error) { _, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, err error) { r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0) pid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Settimeofday(tp *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setuid(uid int) (err error) { _, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Statfs(path string, stat *Statfs_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlink(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sync() (err error) { _, _, e1 := Syscall(SYS_SYNC, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Umask(newmask int) (oldmask int) { r0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0) oldmask = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Undelete(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlink(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlinkat(dirfd int, path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unmount(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func write(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { r0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos)) ret = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func munmap(addr uintptr, length uintptr) (err error) { _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error) { r0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0) nfd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_freebsd_riscv64.go ================================================ // go run mksyscall.go -tags freebsd,riscv64 syscall_bsd.go syscall_freebsd.go syscall_freebsd_riscv64.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build freebsd && riscv64 package unix import ( "syscall" "unsafe" ) var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(ngid int, gid *_Gid_t) (n int, err error) { r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(ngid int, gid *_Gid_t) (err error) { _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) { r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) wpid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(s int, how int) (err error) { _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) { r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, timeval *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func futimes(fd int, timeval *[2]Timeval) (err error) { _, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Madvise(b []byte, behav int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(behav)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlockall(flags int) (err error) { _, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mprotect(b []byte, prot int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Msync(b []byte, flags int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlockall() (err error) { _, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe2(p *[2]_C_int, flags int) (err error) { _, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getcwd(buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS___GETCWD, uintptr(_p0), uintptr(len(buf)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctl(fd int, req uint, arg uintptr) (err error) { _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) { _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { var _p0 unsafe.Pointer if len(mib) > 0 { _p0 = unsafe.Pointer(&mib[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ptrace(request int, pid int, addr uintptr, data int) (err error) { _, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ptracePtr(request int, pid int, addr unsafe.Pointer, data int) (err error) { _, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Access(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Adjtime(delta *Timeval, olddelta *Timeval) (err error) { _, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func CapEnter() (err error) { _, _, e1 := Syscall(SYS_CAP_ENTER, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func capRightsGet(version int, fd int, rightsp *CapRights) (err error) { _, _, e1 := Syscall(SYS___CAP_RIGHTS_GET, uintptr(version), uintptr(fd), uintptr(unsafe.Pointer(rightsp))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func capRightsLimit(fd int, rightsp *CapRights) (err error) { _, _, e1 := Syscall(SYS_CAP_RIGHTS_LIMIT, uintptr(fd), uintptr(unsafe.Pointer(rightsp)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chflags(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chmod(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chroot(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ClockGettime(clockid int32, time *Timespec) (err error) { _, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Close(fd int) (err error) { _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(fd int) (nfd int, err error) { r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0) nfd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup2(from int, to int) (err error) { _, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Exit(code int) { Syscall(SYS_EXIT, uintptr(code), 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrGetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_GET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrSetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_SET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrDeleteFd(fd int, attrnamespace int, attrname string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(attrname) if err != nil { return } _, _, e1 := Syscall(SYS_EXTATTR_DELETE_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrListFd(fd int, attrnamespace int, data uintptr, nbytes int) (ret int, err error) { r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FD, uintptr(fd), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrGetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(file) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_GET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrSetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(file) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_SET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrDeleteFile(file string, attrnamespace int, attrname string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(file) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } _, _, e1 := Syscall(SYS_EXTATTR_DELETE_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrListFile(file string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(file) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrGetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(link) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_GET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrSetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(link) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_SET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrDeleteLink(link string, attrnamespace int, attrname string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(link) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } _, _, e1 := Syscall(SYS_EXTATTR_DELETE_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrListLink(link string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(link) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall6(SYS_POSIX_FADVISE, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchdir(fd int) (err error) { _, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchflags(fd int, flags int) (err error) { _, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmod(fd int, mode uint32) (err error) { _, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Flock(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fpathconf(fd int, name int) (val int, err error) { r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FSTATAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatfs(fd int, stat *Statfs_t) (err error) { _, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fsync(fd int) (err error) { _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getdirentries(fd int, buf []byte, basep *uint64) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_GETDIRENTRIES, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getdtablesize() (size int) { r0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0) size = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0) egid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (uid int) { r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0) gid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgid(pid int) (pgid int, err error) { r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0) pgid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgrp() (pgrp int) { r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0) pgrp = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpid() (pid int) { r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0) pid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getppid() (ppid int) { r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0) ppid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpriority(which int, who int) (prio int, err error) { r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0) prio = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(which int, lim *Rlimit) (err error) { _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrusage(who int, rusage *Rusage) (err error) { _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getsid(pid int) (sid int, err error) { r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) sid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tv *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Issetugid() (tainted bool) { r0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0) tainted = bool(r0 != 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kill(pid int, signum syscall.Signal) (err error) { _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kqueue() (fd int, err error) { r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Link(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := Syscall6(SYS_LINKAT, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, backlog int) (err error) { _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdir(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdirat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifo(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknodat(fd int, path string, mode uint32, dev uint64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Open(path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Openat(fdat int, path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(fdat), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pathconf(path string, name int) (val int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func read(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlink(path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rename(from string, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(fromfd int, from string, tofd int, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Revoke(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rmdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { r0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence)) newoffset = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { r0, _, e1 := Syscall6(SYS_SELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setegid(egid int) (err error) { _, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seteuid(euid int) (err error) { _, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setgid(gid int) (err error) { _, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setlogin(name string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(name) if err != nil { return } _, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (err error) { _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpriority(which int, who int, prio int) (err error) { _, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setregid(rgid int, egid int) (err error) { _, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setreuid(ruid int, euid int) (err error) { _, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresgid(rgid int, egid int, sgid int) (err error) { _, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresuid(ruid int, euid int, suid int) (err error) { _, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, err error) { r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0) pid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Settimeofday(tp *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setuid(uid int) (err error) { _, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Statfs(path string, stat *Statfs_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlink(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sync() (err error) { _, _, e1 := Syscall(SYS_SYNC, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Umask(newmask int) (oldmask int) { r0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0) oldmask = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Undelete(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlink(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlinkat(dirfd int, path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unmount(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func write(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { r0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos)) ret = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func munmap(addr uintptr, length uintptr) (err error) { _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error) { r0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0) nfd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_illumos_amd64.go ================================================ // go run mksyscall_solaris.go -illumos -tags illumos,amd64 syscall_illumos.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build illumos && amd64 package unix import ( "unsafe" ) //go:cgo_import_dynamic libc_readv readv "libc.so" //go:cgo_import_dynamic libc_preadv preadv "libc.so" //go:cgo_import_dynamic libc_writev writev "libc.so" //go:cgo_import_dynamic libc_pwritev pwritev "libc.so" //go:cgo_import_dynamic libc_accept4 accept4 "libsocket.so" //go:linkname procreadv libc_readv //go:linkname procpreadv libc_preadv //go:linkname procwritev libc_writev //go:linkname procpwritev libc_pwritev //go:linkname procaccept4 libc_accept4 var ( procreadv, procpreadv, procwritev, procpwritev, procaccept4 syscallFunc ) // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func readv(fd int, iovs []Iovec) (n int, err error) { var _p0 *Iovec if len(iovs) > 0 { _p0 = &iovs[0] } r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procreadv)), 3, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(iovs)), 0, 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func preadv(fd int, iovs []Iovec, off int64) (n int, err error) { var _p0 *Iovec if len(iovs) > 0 { _p0 = &iovs[0] } r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procpreadv)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(iovs)), uintptr(off), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func writev(fd int, iovs []Iovec) (n int, err error) { var _p0 *Iovec if len(iovs) > 0 { _p0 = &iovs[0] } r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procwritev)), 3, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(iovs)), 0, 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pwritev(fd int, iovs []Iovec, off int64) (n int, err error) { var _p0 *Iovec if len(iovs) > 0 { _p0 = &iovs[0] } r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procpwritev)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(iovs)), uintptr(off), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) { r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procaccept4)), 4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_linux.go ================================================ // Code generated by mkmerge; DO NOT EDIT. //go:build linux package unix import ( "syscall" "unsafe" ) // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func FanotifyInit(flags uint, event_f_flags uint) (fd int, err error) { r0, _, e1 := Syscall(SYS_FANOTIFY_INIT, uintptr(flags), uintptr(event_f_flags), 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fchmodat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fchmodat2(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FCHMODAT2, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctl(fd int, req uint, arg uintptr) (err error) { _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) { _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := Syscall6(SYS_LINKAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mode), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func openat2(dirfd int, path string, open_how *OpenHow, size int) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall6(SYS_OPENAT2, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(open_how)), uintptr(size), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe2(p *[2]_C_int, flags int) (err error) { _, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { r0, _, e1 := Syscall6(SYS_PPOLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlinkat(dirfd int, path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getcwd(buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_GETCWD, uintptr(_p0), uintptr(len(buf)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) { r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) wpid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Waitid(idType int, id int, info *Siginfo, options int, rusage *Rusage) (err error) { _, _, e1 := Syscall6(SYS_WAITID, uintptr(idType), uintptr(id), uintptr(unsafe.Pointer(info)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func KeyctlInt(cmd int, arg2 int, arg3 int, arg4 int, arg5 int) (ret int, err error) { r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func KeyctlBuffer(cmd int, arg2 int, buf []byte, arg5 int) (ret int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(_p0), uintptr(len(buf)), uintptr(arg5), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func keyctlJoin(cmd int, arg2 string) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(arg2) if err != nil { return } r0, _, e1 := Syscall(SYS_KEYCTL, uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func keyctlSearch(cmd int, arg2 int, arg3 string, arg4 string, arg5 int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(arg3) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(arg4) if err != nil { return } r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(arg5), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func keyctlIOV(cmd int, arg2 int, payload []Iovec, arg5 int) (err error) { var _p0 unsafe.Pointer if len(payload) > 0 { _p0 = unsafe.Pointer(&payload[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(_p0), uintptr(len(payload)), uintptr(arg5), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func keyctlDH(cmd int, arg2 *KeyctlDHParams, buf []byte) (ret int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(unsafe.Pointer(arg2)), uintptr(_p0), uintptr(len(buf)), 0, 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func keyctlRestrictKeyringByType(cmd int, arg2 int, keyType string, restriction string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(keyType) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(restriction) if err != nil { return } _, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func keyctlRestrictKeyring(cmd int, arg2 int) (err error) { _, _, e1 := Syscall(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) { _, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ptracePtr(request int, pid int, addr uintptr, data unsafe.Pointer) (err error) { _, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(arg) if err != nil { return } _, _, e1 := Syscall6(SYS_REBOOT, uintptr(magic1), uintptr(magic2), uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mount(source string, target string, fstype string, flags uintptr, data *byte) (err error) { var _p0 *byte _p0, err = BytePtrFromString(source) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(target) if err != nil { return } var _p2 *byte _p2, err = BytePtrFromString(fstype) if err != nil { return } _, _, e1 := Syscall6(SYS_MOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(flags), uintptr(unsafe.Pointer(data)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mountSetattr(dirfd int, pathname string, flags uint, attr *MountAttr, size uintptr) (err error) { var _p0 *byte _p0, err = BytePtrFromString(pathname) if err != nil { return } _, _, e1 := Syscall6(SYS_MOUNT_SETATTR, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(unsafe.Pointer(attr)), uintptr(size), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Acct(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_ACCT, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func AddKey(keyType string, description string, payload []byte, ringid int) (id int, err error) { var _p0 *byte _p0, err = BytePtrFromString(keyType) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(description) if err != nil { return } var _p2 unsafe.Pointer if len(payload) > 0 { _p2 = unsafe.Pointer(&payload[0]) } else { _p2 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_ADD_KEY, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(payload)), uintptr(ringid), 0) id = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Adjtimex(buf *Timex) (state int, err error) { r0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0) state = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Capget(hdr *CapUserHeader, data *CapUserData) (err error) { _, _, e1 := RawSyscall(SYS_CAPGET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Capset(hdr *CapUserHeader, data *CapUserData) (err error) { _, _, e1 := RawSyscall(SYS_CAPSET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chroot(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ClockAdjtime(clockid int32, buf *Timex) (state int, err error) { r0, _, e1 := Syscall(SYS_CLOCK_ADJTIME, uintptr(clockid), uintptr(unsafe.Pointer(buf)), 0) state = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ClockGetres(clockid int32, res *Timespec) (err error) { _, _, e1 := Syscall(SYS_CLOCK_GETRES, uintptr(clockid), uintptr(unsafe.Pointer(res)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ClockGettime(clockid int32, time *Timespec) (err error) { _, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ClockSettime(clockid int32, time *Timespec) (err error) { _, _, e1 := Syscall(SYS_CLOCK_SETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ClockNanosleep(clockid int32, flags int, request *Timespec, remain *Timespec) (err error) { _, _, e1 := Syscall6(SYS_CLOCK_NANOSLEEP, uintptr(clockid), uintptr(flags), uintptr(unsafe.Pointer(request)), uintptr(unsafe.Pointer(remain)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Close(fd int) (err error) { _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func CloseRange(first uint, last uint, flags uint) (err error) { _, _, e1 := Syscall(SYS_CLOSE_RANGE, uintptr(first), uintptr(last), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) { r0, _, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func DeleteModule(name string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(name) if err != nil { return } _, _, e1 := Syscall(SYS_DELETE_MODULE, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(oldfd int) (fd int, err error) { r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup3(oldfd int, newfd int, flags int) (err error) { _, _, e1 := Syscall(SYS_DUP3, uintptr(oldfd), uintptr(newfd), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func EpollCreate1(flag int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) { _, _, e1 := RawSyscall6(SYS_EPOLL_CTL, uintptr(epfd), uintptr(op), uintptr(fd), uintptr(unsafe.Pointer(event)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Eventfd(initval uint, flags int) (fd int, err error) { r0, _, e1 := Syscall(SYS_EVENTFD2, uintptr(initval), uintptr(flags), 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Exit(code int) { SyscallNoError(SYS_EXIT_GROUP, uintptr(code), 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchdir(fd int) (err error) { _, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmod(fd int, mode uint32) (err error) { _, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fdatasync(fd int) (err error) { _, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) { var _p0 *byte _p0, err = BytePtrFromString(attr) if err != nil { return } var _p1 unsafe.Pointer if len(dest) > 0 { _p1 = unsafe.Pointer(&dest[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_FGETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)), 0, 0) sz = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func FinitModule(fd int, params string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(params) if err != nil { return } _, _, e1 := Syscall(SYS_FINIT_MODULE, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Flistxattr(fd int, dest []byte) (sz int, err error) { var _p0 unsafe.Pointer if len(dest) > 0 { _p0 = unsafe.Pointer(&dest[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_FLISTXATTR, uintptr(fd), uintptr(_p0), uintptr(len(dest))) sz = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Flock(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fremovexattr(fd int, attr string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(attr) if err != nil { return } _, _, e1 := Syscall(SYS_FREMOVEXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fsetxattr(fd int, attr string, dest []byte, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(attr) if err != nil { return } var _p1 unsafe.Pointer if len(dest) > 0 { _p1 = unsafe.Pointer(&dest[0]) } else { _p1 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_FSETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fsync(fd int) (err error) { _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fsmount(fd int, flags int, mountAttrs int) (fsfd int, err error) { r0, _, e1 := Syscall(SYS_FSMOUNT, uintptr(fd), uintptr(flags), uintptr(mountAttrs)) fsfd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fsopen(fsName string, flags int) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(fsName) if err != nil { return } r0, _, e1 := Syscall(SYS_FSOPEN, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fspick(dirfd int, pathName string, flags int) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(pathName) if err != nil { return } r0, _, e1 := Syscall(SYS_FSPICK, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fsconfig(fd int, cmd uint, key *byte, value *byte, aux int) (err error) { _, _, e1 := Syscall6(SYS_FSCONFIG, uintptr(fd), uintptr(cmd), uintptr(unsafe.Pointer(key)), uintptr(unsafe.Pointer(value)), uintptr(aux), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getdents(fd int, buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_GETDENTS64, uintptr(fd), uintptr(_p0), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgid(pid int) (pgid int, err error) { r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0) pgid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpid() (pid int) { r0, _ := RawSyscallNoError(SYS_GETPID, 0, 0, 0) pid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getppid() (ppid int) { r0, _ := RawSyscallNoError(SYS_GETPPID, 0, 0, 0) ppid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpriority(which int, who int) (prio int, err error) { r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0) prio = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrusage(who int, rusage *Rusage) (err error) { _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getsid(pid int) (sid int, err error) { r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) sid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettid() (tid int) { r0, _ := RawSyscallNoError(SYS_GETTID, 0, 0, 0) tid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getxattr(path string, attr string, dest []byte) (sz int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } var _p2 unsafe.Pointer if len(dest) > 0 { _p2 = unsafe.Pointer(&dest[0]) } else { _p2 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0) sz = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func InitModule(moduleImage []byte, params string) (err error) { var _p0 unsafe.Pointer if len(moduleImage) > 0 { _p0 = unsafe.Pointer(&moduleImage[0]) } else { _p0 = unsafe.Pointer(&_zero) } var _p1 *byte _p1, err = BytePtrFromString(params) if err != nil { return } _, _, e1 := Syscall(SYS_INIT_MODULE, uintptr(_p0), uintptr(len(moduleImage)), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) { var _p0 *byte _p0, err = BytePtrFromString(pathname) if err != nil { return } r0, _, e1 := Syscall(SYS_INOTIFY_ADD_WATCH, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mask)) watchdesc = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func InotifyInit1(flags int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT1, uintptr(flags), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) { r0, _, e1 := RawSyscall(SYS_INOTIFY_RM_WATCH, uintptr(fd), uintptr(watchdesc), 0) success = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kill(pid int, sig syscall.Signal) (err error) { _, _, e1 := RawSyscall(SYS_KILL, uintptr(pid), uintptr(sig), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Klogctl(typ int, buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_SYSLOG, uintptr(typ), uintptr(_p0), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lgetxattr(path string, attr string, dest []byte) (sz int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } var _p2 unsafe.Pointer if len(dest) > 0 { _p2 = unsafe.Pointer(&dest[0]) } else { _p2 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_LGETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0) sz = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listxattr(path string, dest []byte) (sz int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(dest) > 0 { _p1 = unsafe.Pointer(&dest[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest))) sz = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Llistxattr(path string, dest []byte) (sz int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(dest) > 0 { _p1 = unsafe.Pointer(&dest[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_LLISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest))) sz = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lremovexattr(path string, attr string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } _, _, e1 := Syscall(SYS_LREMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lsetxattr(path string, attr string, data []byte, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } var _p2 unsafe.Pointer if len(data) > 0 { _p2 = unsafe.Pointer(&data[0]) } else { _p2 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_LSETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func MemfdCreate(name string, flags int) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(name) if err != nil { return } r0, _, e1 := Syscall(SYS_MEMFD_CREATE, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdirat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func MoveMount(fromDirfd int, fromPathName string, toDirfd int, toPathName string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(fromPathName) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(toPathName) if err != nil { return } _, _, e1 := Syscall6(SYS_MOVE_MOUNT, uintptr(fromDirfd), uintptr(unsafe.Pointer(_p0)), uintptr(toDirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func OpenTree(dfd int, fileName string, flags uint) (r int, err error) { var _p0 *byte _p0, err = BytePtrFromString(fileName) if err != nil { return } r0, _, e1 := Syscall(SYS_OPEN_TREE, uintptr(dfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) r = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func PerfEventOpen(attr *PerfEventAttr, pid int, cpu int, groupFd int, flags int) (fd int, err error) { r0, _, e1 := Syscall6(SYS_PERF_EVENT_OPEN, uintptr(unsafe.Pointer(attr)), uintptr(pid), uintptr(cpu), uintptr(groupFd), uintptr(flags), 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func PivotRoot(newroot string, putold string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(newroot) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(putold) if err != nil { return } _, _, e1 := Syscall(SYS_PIVOT_ROOT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error) { _, _, e1 := Syscall6(SYS_PRCTL, uintptr(option), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pselect6(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timespec, sigmask *sigset_argpack) (n int, err error) { r0, _, e1 := Syscall6(SYS_PSELECT6, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func read(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Removexattr(path string, attr string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } _, _, e1 := Syscall(SYS_REMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := Syscall6(SYS_RENAMEAT2, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func RequestKey(keyType string, description string, callback string, destRingid int) (id int, err error) { var _p0 *byte _p0, err = BytePtrFromString(keyType) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(description) if err != nil { return } var _p2 *byte _p2, err = BytePtrFromString(callback) if err != nil { return } r0, _, e1 := Syscall6(SYS_REQUEST_KEY, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(destRingid), 0, 0) id = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setdomainname(p []byte) (err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_SETDOMAINNAME, uintptr(_p0), uintptr(len(p)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sethostname(p []byte) (err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_SETHOSTNAME, uintptr(_p0), uintptr(len(p)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (err error) { _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, err error) { r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0) pid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Settimeofday(tv *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setns(fd int, nstype int) (err error) { _, _, e1 := Syscall(SYS_SETNS, uintptr(fd), uintptr(nstype), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpriority(which int, who int, prio int) (err error) { _, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setxattr(path string, attr string, data []byte, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } var _p2 unsafe.Pointer if len(data) > 0 { _p2 = unsafe.Pointer(&data[0]) } else { _p2 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func signalfd(fd int, sigmask *Sigset_t, maskSize uintptr, flags int) (newfd int, err error) { r0, _, e1 := Syscall6(SYS_SIGNALFD4, uintptr(fd), uintptr(unsafe.Pointer(sigmask)), uintptr(maskSize), uintptr(flags), 0, 0) newfd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Statx(dirfd int, path string, flags int, mask int, stat *Statx_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_STATX, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mask), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sync() { SyscallNoError(SYS_SYNC, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Syncfs(fd int) (err error) { _, _, e1 := Syscall(SYS_SYNCFS, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sysinfo(info *Sysinfo_t) (err error) { _, _, e1 := RawSyscall(SYS_SYSINFO, uintptr(unsafe.Pointer(info)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func TimerfdCreate(clockid int, flags int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_TIMERFD_CREATE, uintptr(clockid), uintptr(flags), 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func TimerfdGettime(fd int, currValue *ItimerSpec) (err error) { _, _, e1 := RawSyscall(SYS_TIMERFD_GETTIME, uintptr(fd), uintptr(unsafe.Pointer(currValue)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func TimerfdSettime(fd int, flags int, newValue *ItimerSpec, oldValue *ItimerSpec) (err error) { _, _, e1 := RawSyscall6(SYS_TIMERFD_SETTIME, uintptr(fd), uintptr(flags), uintptr(unsafe.Pointer(newValue)), uintptr(unsafe.Pointer(oldValue)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Tgkill(tgid int, tid int, sig syscall.Signal) (err error) { _, _, e1 := RawSyscall(SYS_TGKILL, uintptr(tgid), uintptr(tid), uintptr(sig)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Times(tms *Tms) (ticks uintptr, err error) { r0, _, e1 := RawSyscall(SYS_TIMES, uintptr(unsafe.Pointer(tms)), 0, 0) ticks = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Umask(mask int) (oldmask int) { r0, _ := RawSyscallNoError(SYS_UMASK, uintptr(mask), 0, 0) oldmask = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Uname(buf *Utsname) (err error) { _, _, e1 := RawSyscall(SYS_UNAME, uintptr(unsafe.Pointer(buf)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unmount(target string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(target) if err != nil { return } _, _, e1 := Syscall(SYS_UMOUNT2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unshare(flags int) (err error) { _, _, e1 := Syscall(SYS_UNSHARE, uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func write(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func exitThread(code int) (err error) { _, _, e1 := Syscall(SYS_EXIT, uintptr(code), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func readv(fd int, iovs []Iovec) (n int, err error) { var _p0 unsafe.Pointer if len(iovs) > 0 { _p0 = unsafe.Pointer(&iovs[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READV, uintptr(fd), uintptr(_p0), uintptr(len(iovs))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func writev(fd int, iovs []Iovec) (n int, err error) { var _p0 unsafe.Pointer if len(iovs) > 0 { _p0 = unsafe.Pointer(&iovs[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_WRITEV, uintptr(fd), uintptr(_p0), uintptr(len(iovs))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func preadv(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) { var _p0 unsafe.Pointer if len(iovs) > 0 { _p0 = unsafe.Pointer(&iovs[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PREADV, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pwritev(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) { var _p0 unsafe.Pointer if len(iovs) > 0 { _p0 = unsafe.Pointer(&iovs[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PWRITEV, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func preadv2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) { var _p0 unsafe.Pointer if len(iovs) > 0 { _p0 = unsafe.Pointer(&iovs[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PREADV2, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pwritev2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) { var _p0 unsafe.Pointer if len(iovs) > 0 { _p0 = unsafe.Pointer(&iovs[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PWRITEV2, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func munmap(addr uintptr, length uintptr) (err error) { _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mremap(oldaddr uintptr, oldlength uintptr, newlength uintptr, flags int, newaddr uintptr) (xaddr uintptr, err error) { r0, _, e1 := Syscall6(SYS_MREMAP, uintptr(oldaddr), uintptr(oldlength), uintptr(newlength), uintptr(flags), uintptr(newaddr), 0) xaddr = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Madvise(b []byte, advice int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(advice)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mprotect(b []byte, prot int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlockall(flags int) (err error) { _, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Msync(b []byte, flags int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlockall() (err error) { _, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func faccessat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Faccessat2(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FACCESSAT2, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func nameToHandleAt(dirFD int, pathname string, fh *fileHandle, mountID *_C_int, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(pathname) if err != nil { return } _, _, e1 := Syscall6(SYS_NAME_TO_HANDLE_AT, uintptr(dirFD), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(fh)), uintptr(unsafe.Pointer(mountID)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func openByHandleAt(mountFD int, fh *fileHandle, flags int) (fd int, err error) { r0, _, e1 := Syscall(SYS_OPEN_BY_HANDLE_AT, uintptr(mountFD), uintptr(unsafe.Pointer(fh)), uintptr(flags)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ProcessVMReadv(pid int, localIov []Iovec, remoteIov []RemoteIovec, flags uint) (n int, err error) { var _p0 unsafe.Pointer if len(localIov) > 0 { _p0 = unsafe.Pointer(&localIov[0]) } else { _p0 = unsafe.Pointer(&_zero) } var _p1 unsafe.Pointer if len(remoteIov) > 0 { _p1 = unsafe.Pointer(&remoteIov[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PROCESS_VM_READV, uintptr(pid), uintptr(_p0), uintptr(len(localIov)), uintptr(_p1), uintptr(len(remoteIov)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ProcessVMWritev(pid int, localIov []Iovec, remoteIov []RemoteIovec, flags uint) (n int, err error) { var _p0 unsafe.Pointer if len(localIov) > 0 { _p0 = unsafe.Pointer(&localIov[0]) } else { _p0 = unsafe.Pointer(&_zero) } var _p1 unsafe.Pointer if len(remoteIov) > 0 { _p1 = unsafe.Pointer(&remoteIov[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PROCESS_VM_WRITEV, uintptr(pid), uintptr(_p0), uintptr(len(localIov)), uintptr(_p1), uintptr(len(remoteIov)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func PidfdOpen(pid int, flags int) (fd int, err error) { r0, _, e1 := Syscall(SYS_PIDFD_OPEN, uintptr(pid), uintptr(flags), 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func PidfdGetfd(pidfd int, targetfd int, flags int) (fd int, err error) { r0, _, e1 := Syscall(SYS_PIDFD_GETFD, uintptr(pidfd), uintptr(targetfd), uintptr(flags)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func PidfdSendSignal(pidfd int, sig Signal, info *Siginfo, flags int) (err error) { _, _, e1 := Syscall6(SYS_PIDFD_SEND_SIGNAL, uintptr(pidfd), uintptr(sig), uintptr(unsafe.Pointer(info)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func shmat(id int, addr uintptr, flag int) (ret uintptr, err error) { r0, _, e1 := Syscall(SYS_SHMAT, uintptr(id), uintptr(addr), uintptr(flag)) ret = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func shmctl(id int, cmd int, buf *SysvShmDesc) (result int, err error) { r0, _, e1 := Syscall(SYS_SHMCTL, uintptr(id), uintptr(cmd), uintptr(unsafe.Pointer(buf))) result = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func shmdt(addr uintptr) (err error) { _, _, e1 := Syscall(SYS_SHMDT, uintptr(addr), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func shmget(key int, size int, flag int) (id int, err error) { r0, _, e1 := Syscall(SYS_SHMGET, uintptr(key), uintptr(size), uintptr(flag)) id = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getitimer(which int, currValue *Itimerval) (err error) { _, _, e1 := Syscall(SYS_GETITIMER, uintptr(which), uintptr(unsafe.Pointer(currValue)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setitimer(which int, newValue *Itimerval, oldValue *Itimerval) (err error) { _, _, e1 := Syscall(SYS_SETITIMER, uintptr(which), uintptr(unsafe.Pointer(newValue)), uintptr(unsafe.Pointer(oldValue))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func rtSigprocmask(how int, set *Sigset_t, oldset *Sigset_t, sigsetsize uintptr) (err error) { _, _, e1 := RawSyscall6(SYS_RT_SIGPROCMASK, uintptr(how), uintptr(unsafe.Pointer(set)), uintptr(unsafe.Pointer(oldset)), uintptr(sigsetsize), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getresuid(ruid *_C_int, euid *_C_int, suid *_C_int) { RawSyscallNoError(SYS_GETRESUID, uintptr(unsafe.Pointer(ruid)), uintptr(unsafe.Pointer(euid)), uintptr(unsafe.Pointer(suid))) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getresgid(rgid *_C_int, egid *_C_int, sgid *_C_int) { RawSyscallNoError(SYS_GETRESGID, uintptr(unsafe.Pointer(rgid)), uintptr(unsafe.Pointer(egid)), uintptr(unsafe.Pointer(sgid))) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func schedSetattr(pid int, attr *SchedAttr, flags uint) (err error) { _, _, e1 := Syscall(SYS_SCHED_SETATTR, uintptr(pid), uintptr(unsafe.Pointer(attr)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func schedGetattr(pid int, attr *SchedAttr, size uint, flags uint) (err error) { _, _, e1 := Syscall6(SYS_SCHED_GETATTR, uintptr(pid), uintptr(unsafe.Pointer(attr)), uintptr(size), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Cachestat(fd uint, crange *CachestatRange, cstat *Cachestat_t, flags uint) (err error) { _, _, e1 := Syscall6(SYS_CACHESTAT, uintptr(fd), uintptr(unsafe.Pointer(crange)), uintptr(unsafe.Pointer(cstat)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mseal(b []byte, flags uint) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MSEAL, uintptr(_p0), uintptr(len(b)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setMemPolicy(mode int, mask *CPUSet, size int) (err error) { _, _, e1 := Syscall(SYS_SET_MEMPOLICY, uintptr(mode), uintptr(unsafe.Pointer(mask)), uintptr(size)) if e1 != 0 { err = errnoErr(e1) } return } ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_linux_386.go ================================================ // go run mksyscall.go -l32 -tags linux,386 syscall_linux.go syscall_linux_386.go syscall_linux_alarm.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build linux && 386 package unix import ( "syscall" "unsafe" ) var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fanotifyMark(fd int, flags uint, mask uint64, dirFd int, pathname *byte) (err error) { _, _, e1 := Syscall6(SYS_FANOTIFY_MARK, uintptr(fd), uintptr(flags), uintptr(mask), uintptr(mask>>32), uintptr(dirFd), uintptr(unsafe.Pointer(pathname))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fallocate(fd int, mode uint32, off int64, len int64) (err error) { _, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(off>>32), uintptr(len), uintptr(len>>32)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { r0, r1, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0) n = int64(int64(r1)<<32 | int64(r0)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { var _p0 unsafe.Pointer if len(events) > 0 { _p0 = unsafe.Pointer(&events[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall6(SYS_FADVISE64_64, uintptr(fd), uintptr(offset), uintptr(offset>>32), uintptr(length), uintptr(length>>32), uintptr(advice)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := Syscall(SYS_FCHOWN32, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FSTATAT64, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { _, _, e1 := Syscall(SYS_FTRUNCATE64, uintptr(fd), uintptr(length), uintptr(length>>32)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { r0, _ := RawSyscallNoError(SYS_GETEGID32, 0, 0, 0) egid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (euid int) { r0, _ := RawSyscallNoError(SYS_GETEUID32, 0, 0, 0) euid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _ := RawSyscallNoError(SYS_GETGID32, 0, 0, 0) gid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _ := RawSyscallNoError(SYS_GETUID32, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ioperm(from int, num int, on int) (err error) { _, _, e1 := Syscall(SYS_IOPERM, uintptr(from), uintptr(num), uintptr(on)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Iopl(level int) (err error) { _, _, e1 := Syscall(SYS_IOPL, uintptr(level), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LCHOWN32, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lstat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { r0, _, e1 := Syscall6(SYS_SENDFILE64, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0) written = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setfsgid(gid int) (prev int, err error) { r0, _, e1 := Syscall(SYS_SETFSGID32, uintptr(gid), 0, 0) prev = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setfsuid(uid int) (prev int, err error) { r0, _, e1 := Syscall(SYS_SETFSUID32, uintptr(uid), 0, 0) prev = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) { r0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Stat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func SyncFileRange(fd int, off int64, n int64, flags int) (err error) { _, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE, uintptr(fd), uintptr(off), uintptr(off>>32), uintptr(n), uintptr(n>>32), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_TRUNCATE64, uintptr(unsafe.Pointer(_p0)), uintptr(length), uintptr(length>>32)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ustat(dev int, ubuf *Ustat_t) (err error) { _, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(n int, list *_Gid_t) (nn int, err error) { r0, _, e1 := RawSyscall(SYS_GETGROUPS32, uintptr(n), uintptr(unsafe.Pointer(list)), 0) nn = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(n int, list *_Gid_t) (err error) { _, _, e1 := RawSyscall(SYS_SETGROUPS32, uintptr(n), uintptr(unsafe.Pointer(list)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { r0, _, e1 := Syscall6(SYS__NEWSELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, err error) { r0, _, e1 := Syscall6(SYS_MMAP2, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(pageOffset)) xaddr = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pause() (err error) { _, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getrlimit(resource int, rlim *rlimit32) (err error) { _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func futimesat(dirfd int, path string, times *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tv *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Time(t *Time_t) (tt Time_t, err error) { r0, _, e1 := RawSyscall(SYS_TIME, uintptr(unsafe.Pointer(t)), 0, 0) tt = Time_t(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Utime(path string, buf *Utimbuf) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, times *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Alarm(seconds uint) (remaining uint, err error) { r0, _, e1 := Syscall(SYS_ALARM, uintptr(seconds), 0, 0) remaining = uint(r0) if e1 != 0 { err = errnoErr(e1) } return } ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go ================================================ // go run mksyscall.go -tags linux,amd64 syscall_linux.go syscall_linux_amd64.go syscall_linux_alarm.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build linux && amd64 package unix import ( "syscall" "unsafe" ) var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fanotifyMark(fd int, flags uint, mask uint64, dirFd int, pathname *byte) (err error) { _, _, e1 := Syscall6(SYS_FANOTIFY_MARK, uintptr(fd), uintptr(flags), uintptr(mask), uintptr(dirFd), uintptr(unsafe.Pointer(pathname)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fallocate(fd int, mode uint32, off int64, len int64) (err error) { _, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(len), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { r0, _, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0) n = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { var _p0 unsafe.Pointer if len(events) > 0 { _p0 = unsafe.Pointer(&events[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall6(SYS_FADVISE64, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_NEWFSTATAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatfs(fd int, buf *Statfs_t) (err error) { _, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(buf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { r0, _ := RawSyscallNoError(SYS_GETEGID, 0, 0, 0) egid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (euid int) { r0, _ := RawSyscallNoError(SYS_GETEUID, 0, 0, 0) euid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _ := RawSyscallNoError(SYS_GETGID, 0, 0, 0) gid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(resource int, rlim *Rlimit) (err error) { _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _ := RawSyscallNoError(SYS_GETUID, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ioperm(from int, num int, on int) (err error) { _, _, e1 := Syscall(SYS_IOPERM, uintptr(from), uintptr(num), uintptr(on)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Iopl(level int) (err error) { _, _, e1 := Syscall(SYS_IOPL, uintptr(level), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, n int) (err error) { _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(n), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func MemfdSecret(flags int) (fd int, err error) { r0, _, e1 := Syscall(SYS_MEMFD_SECRET, uintptr(flags), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pause() (err error) { _, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seek(fd int, offset int64, whence int) (off int64, err error) { r0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence)) off = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { r0, _, e1 := Syscall6(SYS_SENDFILE, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0) written = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setfsgid(gid int) (prev int, err error) { r0, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) prev = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setfsuid(uid int) (prev int, err error) { r0, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) prev = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) { r0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags)) n = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Statfs(path string, buf *Statfs_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func SyncFileRange(fd int, off int64, n int64, flags int) (err error) { _, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE, uintptr(fd), uintptr(off), uintptr(n), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ustat(dev int, ubuf *Ustat_t) (err error) { _, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) { r0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(n int, list *_Gid_t) (nn int, err error) { r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) nn = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(n int, list *_Gid_t) (err error) { _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) { r0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset)) xaddr = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func futimesat(dirfd int, path string, times *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Utime(path string, buf *Utimbuf) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, times *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func kexecFileLoad(kernelFd int, initrdFd int, cmdlineLen int, cmdline string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(cmdline) if err != nil { return } _, _, e1 := Syscall6(SYS_KEXEC_FILE_LOAD, uintptr(kernelFd), uintptr(initrdFd), uintptr(cmdlineLen), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Alarm(seconds uint) (remaining uint, err error) { r0, _, e1 := Syscall(SYS_ALARM, uintptr(seconds), 0, 0) remaining = uint(r0) if e1 != 0 { err = errnoErr(e1) } return } ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go ================================================ // go run mksyscall.go -l32 -arm -tags linux,arm syscall_linux.go syscall_linux_arm.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build linux && arm package unix import ( "syscall" "unsafe" ) var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fanotifyMark(fd int, flags uint, mask uint64, dirFd int, pathname *byte) (err error) { _, _, e1 := Syscall6(SYS_FANOTIFY_MARK, uintptr(fd), uintptr(flags), uintptr(mask), uintptr(mask>>32), uintptr(dirFd), uintptr(unsafe.Pointer(pathname))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fallocate(fd int, mode uint32, off int64, len int64) (err error) { _, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(off>>32), uintptr(len), uintptr(len>>32)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { r0, r1, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0) n = int64(int64(r1)<<32 | int64(r0)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) { r0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(n int, list *_Gid_t) (nn int, err error) { r0, _, e1 := RawSyscall(SYS_GETGROUPS32, uintptr(n), uintptr(unsafe.Pointer(list)), 0) nn = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(n int, list *_Gid_t) (err error) { _, _, e1 := RawSyscall(SYS_SETGROUPS32, uintptr(n), uintptr(unsafe.Pointer(list)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, flags int, fd *[2]int32) (err error) { _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(flags), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { var _p0 unsafe.Pointer if len(events) > 0 { _p0 = unsafe.Pointer(&events[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := Syscall(SYS_FCHOWN32, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FSTATAT64, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { r0, _ := RawSyscallNoError(SYS_GETEGID32, 0, 0, 0) egid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (euid int) { r0, _ := RawSyscallNoError(SYS_GETEUID32, 0, 0, 0) euid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _ := RawSyscallNoError(SYS_GETGID32, 0, 0, 0) gid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _ := RawSyscallNoError(SYS_GETUID32, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LCHOWN32, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, n int) (err error) { _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(n), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lstat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pause() (err error) { _, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { r0, _, e1 := Syscall6(SYS_SENDFILE64, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0) written = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { r0, _, e1 := Syscall6(SYS__NEWSELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setfsgid(gid int) (prev int, err error) { r0, _, e1 := Syscall(SYS_SETFSGID32, uintptr(gid), 0, 0) prev = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setfsuid(uid int) (prev int, err error) { r0, _, e1 := Syscall(SYS_SETFSUID32, uintptr(uid), 0, 0) prev = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) { r0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Stat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ustat(dev int, ubuf *Ustat_t) (err error) { _, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func futimesat(dirfd int, path string, times *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tv *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, times *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_TRUNCATE64, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length), uintptr(length>>32), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { _, _, e1 := Syscall6(SYS_FTRUNCATE64, uintptr(fd), 0, uintptr(length), uintptr(length>>32), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, err error) { r0, _, e1 := Syscall6(SYS_MMAP2, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(pageOffset)) xaddr = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getrlimit(resource int, rlim *rlimit32) (err error) { _, _, e1 := RawSyscall(SYS_UGETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func armSyncFileRange(fd int, flags int, off int64, n int64) (err error) { _, _, e1 := Syscall6(SYS_ARM_SYNC_FILE_RANGE, uintptr(fd), uintptr(flags), uintptr(off), uintptr(off>>32), uintptr(n), uintptr(n>>32)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func kexecFileLoad(kernelFd int, initrdFd int, cmdlineLen int, cmdline string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(cmdline) if err != nil { return } _, _, e1 := Syscall6(SYS_KEXEC_FILE_LOAD, uintptr(kernelFd), uintptr(initrdFd), uintptr(cmdlineLen), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go ================================================ // go run mksyscall.go -tags linux,arm64 syscall_linux.go syscall_linux_arm64.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build linux && arm64 package unix import ( "syscall" "unsafe" ) var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fanotifyMark(fd int, flags uint, mask uint64, dirFd int, pathname *byte) (err error) { _, _, e1 := Syscall6(SYS_FANOTIFY_MARK, uintptr(fd), uintptr(flags), uintptr(mask), uintptr(dirFd), uintptr(unsafe.Pointer(pathname)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fallocate(fd int, mode uint32, off int64, len int64) (err error) { _, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(len), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { r0, _, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0) n = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { var _p0 unsafe.Pointer if len(events) > 0 { _p0 = unsafe.Pointer(&events[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_EPOLL_PWAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall6(SYS_FADVISE64, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FSTATAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatfs(fd int, buf *Statfs_t) (err error) { _, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(buf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { r0, _ := RawSyscallNoError(SYS_GETEGID, 0, 0, 0) egid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (euid int) { r0, _ := RawSyscallNoError(SYS_GETEUID, 0, 0, 0) euid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _ := RawSyscallNoError(SYS_GETGID, 0, 0, 0) gid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getrlimit(resource int, rlim *Rlimit) (err error) { _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _ := RawSyscallNoError(SYS_GETUID, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, n int) (err error) { _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(n), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func MemfdSecret(flags int) (fd int, err error) { r0, _, e1 := Syscall(SYS_MEMFD_SECRET, uintptr(flags), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seek(fd int, offset int64, whence int) (off int64, err error) { r0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence)) off = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { r0, _, e1 := Syscall6(SYS_SENDFILE, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0) written = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setfsgid(gid int) (prev int, err error) { r0, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) prev = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setfsuid(uid int) (prev int, err error) { r0, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) prev = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) { r0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags)) n = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Statfs(path string, buf *Statfs_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func SyncFileRange(fd int, off int64, n int64, flags int) (err error) { _, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE, uintptr(fd), uintptr(off), uintptr(n), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) { r0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(n int, list *_Gid_t) (nn int, err error) { r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) nn = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(n int, list *_Gid_t) (err error) { _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) { r0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset)) xaddr = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tv *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func kexecFileLoad(kernelFd int, initrdFd int, cmdlineLen int, cmdline string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(cmdline) if err != nil { return } _, _, e1 := Syscall6(SYS_KEXEC_FILE_LOAD, uintptr(kernelFd), uintptr(initrdFd), uintptr(cmdlineLen), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_linux_loong64.go ================================================ // go run mksyscall.go -tags linux,loong64 syscall_linux.go syscall_linux_loong64.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build linux && loong64 package unix import ( "syscall" "unsafe" ) var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fanotifyMark(fd int, flags uint, mask uint64, dirFd int, pathname *byte) (err error) { _, _, e1 := Syscall6(SYS_FANOTIFY_MARK, uintptr(fd), uintptr(flags), uintptr(mask), uintptr(dirFd), uintptr(unsafe.Pointer(pathname)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fallocate(fd int, mode uint32, off int64, len int64) (err error) { _, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(len), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { r0, _, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0) n = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { var _p0 unsafe.Pointer if len(events) > 0 { _p0 = unsafe.Pointer(&events[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_EPOLL_PWAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall6(SYS_FADVISE64, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatfs(fd int, buf *Statfs_t) (err error) { _, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(buf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { r0, _ := RawSyscallNoError(SYS_GETEGID, 0, 0, 0) egid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (euid int) { r0, _ := RawSyscallNoError(SYS_GETEUID, 0, 0, 0) euid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _ := RawSyscallNoError(SYS_GETGID, 0, 0, 0) gid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _ := RawSyscallNoError(SYS_GETUID, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, n int) (err error) { _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(n), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seek(fd int, offset int64, whence int) (off int64, err error) { r0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence)) off = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { r0, _, e1 := Syscall6(SYS_SENDFILE, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0) written = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setfsgid(gid int) (prev int, err error) { r0, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) prev = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setfsuid(uid int) (prev int, err error) { r0, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) prev = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) { r0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags)) n = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Statfs(path string, buf *Statfs_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func SyncFileRange(fd int, off int64, n int64, flags int) (err error) { _, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE, uintptr(fd), uintptr(off), uintptr(n), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) { r0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(n int, list *_Gid_t) (nn int, err error) { r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) nn = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(n int, list *_Gid_t) (err error) { _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) { r0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset)) xaddr = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tv *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func kexecFileLoad(kernelFd int, initrdFd int, cmdlineLen int, cmdline string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(cmdline) if err != nil { return } _, _, e1 := Syscall6(SYS_KEXEC_FILE_LOAD, uintptr(kernelFd), uintptr(initrdFd), uintptr(cmdlineLen), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go ================================================ // go run mksyscall.go -b32 -arm -tags linux,mips syscall_linux.go syscall_linux_mipsx.go syscall_linux_alarm.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build linux && mips package unix import ( "syscall" "unsafe" ) var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fanotifyMark(fd int, flags uint, mask uint64, dirFd int, pathname *byte) (err error) { _, _, e1 := Syscall6(SYS_FANOTIFY_MARK, uintptr(fd), uintptr(flags), uintptr(mask>>32), uintptr(mask), uintptr(dirFd), uintptr(unsafe.Pointer(pathname))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fallocate(fd int, mode uint32, off int64, len int64) (err error) { _, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off>>32), uintptr(off), uintptr(len>>32), uintptr(len)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { r0, r1, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0) n = int64(int64(r0)<<32 | int64(r1)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { var _p0 unsafe.Pointer if len(events) > 0 { _p0 = unsafe.Pointer(&events[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall9(SYS_FADVISE64, uintptr(fd), 0, uintptr(offset>>32), uintptr(offset), uintptr(length>>32), uintptr(length), uintptr(advice), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { _, _, e1 := Syscall6(SYS_FTRUNCATE64, uintptr(fd), 0, uintptr(length>>32), uintptr(length), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { r0, _ := RawSyscallNoError(SYS_GETEGID, 0, 0, 0) egid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (euid int) { r0, _ := RawSyscallNoError(SYS_GETEUID, 0, 0, 0) euid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _ := RawSyscallNoError(SYS_GETGID, 0, 0, 0) gid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _ := RawSyscallNoError(SYS_GETUID, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, n int) (err error) { _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(n), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset>>32), uintptr(offset)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset>>32), uintptr(offset)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { r0, _, e1 := Syscall6(SYS__NEWSELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { r0, _, e1 := Syscall6(SYS_SENDFILE64, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0) written = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setfsgid(gid int) (prev int, err error) { r0, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) prev = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setfsuid(uid int) (prev int, err error) { r0, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) prev = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) { r0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func SyncFileRange(fd int, off int64, n int64, flags int) (err error) { _, _, e1 := Syscall9(SYS_SYNC_FILE_RANGE, uintptr(fd), 0, uintptr(off>>32), uintptr(off), uintptr(n>>32), uintptr(n), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_TRUNCATE64, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length>>32), uintptr(length), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ustat(dev int, ubuf *Ustat_t) (err error) { _, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) { r0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(n int, list *_Gid_t) (nn int, err error) { r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) nn = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(n int, list *_Gid_t) (err error) { _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ioperm(from int, num int, on int) (err error) { _, _, e1 := Syscall(SYS_IOPERM, uintptr(from), uintptr(num), uintptr(on)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Iopl(level int) (err error) { _, _, e1 := Syscall(SYS_IOPL, uintptr(level), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func futimesat(dirfd int, path string, times *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tv *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Time(t *Time_t) (tt Time_t, err error) { r0, _, e1 := RawSyscall(SYS_TIME, uintptr(unsafe.Pointer(t)), 0, 0) tt = Time_t(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Utime(path string, buf *Utimbuf) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, times *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lstat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FSTATAT64, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Stat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pause() (err error) { _, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, err error) { r0, _, e1 := Syscall6(SYS_MMAP2, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(pageOffset)) xaddr = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getrlimit(resource int, rlim *rlimit32) (err error) { _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Alarm(seconds uint) (remaining uint, err error) { r0, _, e1 := Syscall(SYS_ALARM, uintptr(seconds), 0, 0) remaining = uint(r0) if e1 != 0 { err = errnoErr(e1) } return } ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go ================================================ // go run mksyscall.go -tags linux,mips64 syscall_linux.go syscall_linux_mips64x.go syscall_linux_alarm.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build linux && mips64 package unix import ( "syscall" "unsafe" ) var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fanotifyMark(fd int, flags uint, mask uint64, dirFd int, pathname *byte) (err error) { _, _, e1 := Syscall6(SYS_FANOTIFY_MARK, uintptr(fd), uintptr(flags), uintptr(mask), uintptr(dirFd), uintptr(unsafe.Pointer(pathname)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fallocate(fd int, mode uint32, off int64, len int64) (err error) { _, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(len), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { r0, _, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0) n = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { var _p0 unsafe.Pointer if len(events) > 0 { _p0 = unsafe.Pointer(&events[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall6(SYS_FADVISE64, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatfs(fd int, buf *Statfs_t) (err error) { _, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(buf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { r0, _ := RawSyscallNoError(SYS_GETEGID, 0, 0, 0) egid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (euid int) { r0, _ := RawSyscallNoError(SYS_GETEUID, 0, 0, 0) euid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _ := RawSyscallNoError(SYS_GETGID, 0, 0, 0) gid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(resource int, rlim *Rlimit) (err error) { _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _ := RawSyscallNoError(SYS_GETUID, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, n int) (err error) { _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(n), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pause() (err error) { _, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seek(fd int, offset int64, whence int) (off int64, err error) { r0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence)) off = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { r0, _, e1 := Syscall6(SYS_SENDFILE, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0) written = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setfsgid(gid int) (prev int, err error) { r0, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) prev = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setfsuid(uid int) (prev int, err error) { r0, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) prev = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) { r0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags)) n = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Statfs(path string, buf *Statfs_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func SyncFileRange(fd int, off int64, n int64, flags int) (err error) { _, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE, uintptr(fd), uintptr(off), uintptr(n), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ustat(dev int, ubuf *Ustat_t) (err error) { _, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) { r0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(n int, list *_Gid_t) (nn int, err error) { r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) nn = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(n int, list *_Gid_t) (err error) { _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) { r0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset)) xaddr = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func futimesat(dirfd int, path string, times *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tv *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Utime(path string, buf *Utimbuf) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, times *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fstat(fd int, st *stat_t) (err error) { _, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(st)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fstatat(dirfd int, path string, st *stat_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_NEWFSTATAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(st)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func lstat(path string, st *stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(st)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func stat(path string, st *stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(st)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Alarm(seconds uint) (remaining uint, err error) { r0, _, e1 := Syscall(SYS_ALARM, uintptr(seconds), 0, 0) remaining = uint(r0) if e1 != 0 { err = errnoErr(e1) } return } ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go ================================================ // go run mksyscall.go -tags linux,mips64le syscall_linux.go syscall_linux_mips64x.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build linux && mips64le package unix import ( "syscall" "unsafe" ) var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fanotifyMark(fd int, flags uint, mask uint64, dirFd int, pathname *byte) (err error) { _, _, e1 := Syscall6(SYS_FANOTIFY_MARK, uintptr(fd), uintptr(flags), uintptr(mask), uintptr(dirFd), uintptr(unsafe.Pointer(pathname)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fallocate(fd int, mode uint32, off int64, len int64) (err error) { _, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(len), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { r0, _, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0) n = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { var _p0 unsafe.Pointer if len(events) > 0 { _p0 = unsafe.Pointer(&events[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall6(SYS_FADVISE64, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatfs(fd int, buf *Statfs_t) (err error) { _, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(buf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { r0, _ := RawSyscallNoError(SYS_GETEGID, 0, 0, 0) egid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (euid int) { r0, _ := RawSyscallNoError(SYS_GETEUID, 0, 0, 0) euid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _ := RawSyscallNoError(SYS_GETGID, 0, 0, 0) gid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(resource int, rlim *Rlimit) (err error) { _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _ := RawSyscallNoError(SYS_GETUID, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, n int) (err error) { _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(n), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pause() (err error) { _, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seek(fd int, offset int64, whence int) (off int64, err error) { r0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence)) off = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { r0, _, e1 := Syscall6(SYS_SENDFILE, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0) written = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setfsgid(gid int) (prev int, err error) { r0, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) prev = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setfsuid(uid int) (prev int, err error) { r0, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) prev = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) { r0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags)) n = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Statfs(path string, buf *Statfs_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func SyncFileRange(fd int, off int64, n int64, flags int) (err error) { _, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE, uintptr(fd), uintptr(off), uintptr(n), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ustat(dev int, ubuf *Ustat_t) (err error) { _, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) { r0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(n int, list *_Gid_t) (nn int, err error) { r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) nn = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(n int, list *_Gid_t) (err error) { _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) { r0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset)) xaddr = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func futimesat(dirfd int, path string, times *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tv *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Utime(path string, buf *Utimbuf) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, times *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fstat(fd int, st *stat_t) (err error) { _, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(st)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fstatat(dirfd int, path string, st *stat_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_NEWFSTATAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(st)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func lstat(path string, st *stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(st)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func stat(path string, st *stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(st)), 0) if e1 != 0 { err = errnoErr(e1) } return } ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go ================================================ // go run mksyscall.go -l32 -arm -tags linux,mipsle syscall_linux.go syscall_linux_mipsx.go syscall_linux_alarm.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build linux && mipsle package unix import ( "syscall" "unsafe" ) var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fanotifyMark(fd int, flags uint, mask uint64, dirFd int, pathname *byte) (err error) { _, _, e1 := Syscall6(SYS_FANOTIFY_MARK, uintptr(fd), uintptr(flags), uintptr(mask), uintptr(mask>>32), uintptr(dirFd), uintptr(unsafe.Pointer(pathname))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fallocate(fd int, mode uint32, off int64, len int64) (err error) { _, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(off>>32), uintptr(len), uintptr(len>>32)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { r0, r1, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0) n = int64(int64(r1)<<32 | int64(r0)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { var _p0 unsafe.Pointer if len(events) > 0 { _p0 = unsafe.Pointer(&events[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall9(SYS_FADVISE64, uintptr(fd), 0, uintptr(offset), uintptr(offset>>32), uintptr(length), uintptr(length>>32), uintptr(advice), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { _, _, e1 := Syscall6(SYS_FTRUNCATE64, uintptr(fd), 0, uintptr(length), uintptr(length>>32), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { r0, _ := RawSyscallNoError(SYS_GETEGID, 0, 0, 0) egid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (euid int) { r0, _ := RawSyscallNoError(SYS_GETEUID, 0, 0, 0) euid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _ := RawSyscallNoError(SYS_GETGID, 0, 0, 0) gid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _ := RawSyscallNoError(SYS_GETUID, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, n int) (err error) { _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(n), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { r0, _, e1 := Syscall6(SYS__NEWSELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { r0, _, e1 := Syscall6(SYS_SENDFILE64, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0) written = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setfsgid(gid int) (prev int, err error) { r0, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) prev = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setfsuid(uid int) (prev int, err error) { r0, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) prev = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) { r0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func SyncFileRange(fd int, off int64, n int64, flags int) (err error) { _, _, e1 := Syscall9(SYS_SYNC_FILE_RANGE, uintptr(fd), 0, uintptr(off), uintptr(off>>32), uintptr(n), uintptr(n>>32), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_TRUNCATE64, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length), uintptr(length>>32), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ustat(dev int, ubuf *Ustat_t) (err error) { _, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) { r0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(n int, list *_Gid_t) (nn int, err error) { r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) nn = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(n int, list *_Gid_t) (err error) { _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ioperm(from int, num int, on int) (err error) { _, _, e1 := Syscall(SYS_IOPERM, uintptr(from), uintptr(num), uintptr(on)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Iopl(level int) (err error) { _, _, e1 := Syscall(SYS_IOPL, uintptr(level), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func futimesat(dirfd int, path string, times *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tv *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Time(t *Time_t) (tt Time_t, err error) { r0, _, e1 := RawSyscall(SYS_TIME, uintptr(unsafe.Pointer(t)), 0, 0) tt = Time_t(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Utime(path string, buf *Utimbuf) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, times *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lstat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FSTATAT64, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Stat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pause() (err error) { _, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, err error) { r0, _, e1 := Syscall6(SYS_MMAP2, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(pageOffset)) xaddr = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getrlimit(resource int, rlim *rlimit32) (err error) { _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Alarm(seconds uint) (remaining uint, err error) { r0, _, e1 := Syscall(SYS_ALARM, uintptr(seconds), 0, 0) remaining = uint(r0) if e1 != 0 { err = errnoErr(e1) } return } ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_linux_ppc.go ================================================ // go run mksyscall.go -b32 -tags linux,ppc syscall_linux.go syscall_linux_ppc.go syscall_linux_alarm.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build linux && ppc package unix import ( "syscall" "unsafe" ) var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fanotifyMark(fd int, flags uint, mask uint64, dirFd int, pathname *byte) (err error) { _, _, e1 := Syscall6(SYS_FANOTIFY_MARK, uintptr(fd), uintptr(flags), uintptr(mask>>32), uintptr(mask), uintptr(dirFd), uintptr(unsafe.Pointer(pathname))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fallocate(fd int, mode uint32, off int64, len int64) (err error) { _, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off>>32), uintptr(off), uintptr(len>>32), uintptr(len)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { r0, r1, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0) n = int64(int64(r0)<<32 | int64(r1)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { var _p0 unsafe.Pointer if len(events) > 0 { _p0 = unsafe.Pointer(&events[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FSTATAT64, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { _, _, e1 := Syscall(SYS_FTRUNCATE64, uintptr(fd), uintptr(length>>32), uintptr(length)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { r0, _ := RawSyscallNoError(SYS_GETEGID, 0, 0, 0) egid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (euid int) { r0, _ := RawSyscallNoError(SYS_GETEUID, 0, 0, 0) euid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _ := RawSyscallNoError(SYS_GETGID, 0, 0, 0) gid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _ := RawSyscallNoError(SYS_GETUID, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ioperm(from int, num int, on int) (err error) { _, _, e1 := Syscall(SYS_IOPERM, uintptr(from), uintptr(num), uintptr(on)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Iopl(level int) (err error) { _, _, e1 := Syscall(SYS_IOPL, uintptr(level), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, n int) (err error) { _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(n), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lstat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pause() (err error) { _, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset>>32), uintptr(offset), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset>>32), uintptr(offset), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { r0, _, e1 := Syscall6(SYS__NEWSELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { r0, _, e1 := Syscall6(SYS_SENDFILE64, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0) written = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setfsgid(gid int) (prev int, err error) { r0, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) prev = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setfsuid(uid int) (prev int, err error) { r0, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) prev = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) { r0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Stat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_TRUNCATE64, uintptr(unsafe.Pointer(_p0)), uintptr(length>>32), uintptr(length)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ustat(dev int, ubuf *Ustat_t) (err error) { _, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) { r0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(n int, list *_Gid_t) (nn int, err error) { r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) nn = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(n int, list *_Gid_t) (err error) { _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func futimesat(dirfd int, path string, times *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tv *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Time(t *Time_t) (tt Time_t, err error) { r0, _, e1 := RawSyscall(SYS_TIME, uintptr(unsafe.Pointer(t)), 0, 0) tt = Time_t(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Utime(path string, buf *Utimbuf) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, times *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, err error) { r0, _, e1 := Syscall6(SYS_MMAP2, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(pageOffset)) xaddr = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getrlimit(resource int, rlim *rlimit32) (err error) { _, _, e1 := RawSyscall(SYS_UGETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func syncFileRange2(fd int, flags int, off int64, n int64) (err error) { _, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE2, uintptr(fd), uintptr(flags), uintptr(off>>32), uintptr(off), uintptr(n>>32), uintptr(n)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func kexecFileLoad(kernelFd int, initrdFd int, cmdlineLen int, cmdline string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(cmdline) if err != nil { return } _, _, e1 := Syscall6(SYS_KEXEC_FILE_LOAD, uintptr(kernelFd), uintptr(initrdFd), uintptr(cmdlineLen), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Alarm(seconds uint) (remaining uint, err error) { r0, _, e1 := Syscall(SYS_ALARM, uintptr(seconds), 0, 0) remaining = uint(r0) if e1 != 0 { err = errnoErr(e1) } return } ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go ================================================ // go run mksyscall.go -tags linux,ppc64 syscall_linux.go syscall_linux_ppc64x.go syscall_linux_alarm.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build linux && ppc64 package unix import ( "syscall" "unsafe" ) var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fanotifyMark(fd int, flags uint, mask uint64, dirFd int, pathname *byte) (err error) { _, _, e1 := Syscall6(SYS_FANOTIFY_MARK, uintptr(fd), uintptr(flags), uintptr(mask), uintptr(dirFd), uintptr(unsafe.Pointer(pathname)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fallocate(fd int, mode uint32, off int64, len int64) (err error) { _, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(len), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { r0, _, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0) n = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { var _p0 unsafe.Pointer if len(events) > 0 { _p0 = unsafe.Pointer(&events[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall6(SYS_FADVISE64, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_NEWFSTATAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatfs(fd int, buf *Statfs_t) (err error) { _, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(buf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { r0, _ := RawSyscallNoError(SYS_GETEGID, 0, 0, 0) egid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (euid int) { r0, _ := RawSyscallNoError(SYS_GETEUID, 0, 0, 0) euid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _ := RawSyscallNoError(SYS_GETGID, 0, 0, 0) gid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(resource int, rlim *Rlimit) (err error) { _, _, e1 := RawSyscall(SYS_UGETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _ := RawSyscallNoError(SYS_GETUID, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ioperm(from int, num int, on int) (err error) { _, _, e1 := Syscall(SYS_IOPERM, uintptr(from), uintptr(num), uintptr(on)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Iopl(level int) (err error) { _, _, e1 := Syscall(SYS_IOPL, uintptr(level), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, n int) (err error) { _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(n), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lstat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pause() (err error) { _, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seek(fd int, offset int64, whence int) (off int64, err error) { r0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence)) off = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { r0, _, e1 := Syscall6(SYS__NEWSELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { r0, _, e1 := Syscall6(SYS_SENDFILE, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0) written = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setfsgid(gid int) (prev int, err error) { r0, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) prev = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setfsuid(uid int) (prev int, err error) { r0, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) prev = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) { r0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags)) n = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Stat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Statfs(path string, buf *Statfs_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ustat(dev int, ubuf *Ustat_t) (err error) { _, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) { r0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(n int, list *_Gid_t) (nn int, err error) { r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) nn = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(n int, list *_Gid_t) (err error) { _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) { r0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset)) xaddr = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func futimesat(dirfd int, path string, times *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tv *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Time(t *Time_t) (tt Time_t, err error) { r0, _, e1 := RawSyscall(SYS_TIME, uintptr(unsafe.Pointer(t)), 0, 0) tt = Time_t(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Utime(path string, buf *Utimbuf) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, times *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func syncFileRange2(fd int, flags int, off int64, n int64) (err error) { _, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE2, uintptr(fd), uintptr(flags), uintptr(off), uintptr(n), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func kexecFileLoad(kernelFd int, initrdFd int, cmdlineLen int, cmdline string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(cmdline) if err != nil { return } _, _, e1 := Syscall6(SYS_KEXEC_FILE_LOAD, uintptr(kernelFd), uintptr(initrdFd), uintptr(cmdlineLen), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Alarm(seconds uint) (remaining uint, err error) { r0, _, e1 := Syscall(SYS_ALARM, uintptr(seconds), 0, 0) remaining = uint(r0) if e1 != 0 { err = errnoErr(e1) } return } ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go ================================================ // go run mksyscall.go -tags linux,ppc64le syscall_linux.go syscall_linux_ppc64x.go syscall_linux_alarm.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build linux && ppc64le package unix import ( "syscall" "unsafe" ) var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fanotifyMark(fd int, flags uint, mask uint64, dirFd int, pathname *byte) (err error) { _, _, e1 := Syscall6(SYS_FANOTIFY_MARK, uintptr(fd), uintptr(flags), uintptr(mask), uintptr(dirFd), uintptr(unsafe.Pointer(pathname)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fallocate(fd int, mode uint32, off int64, len int64) (err error) { _, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(len), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { r0, _, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0) n = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { var _p0 unsafe.Pointer if len(events) > 0 { _p0 = unsafe.Pointer(&events[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall6(SYS_FADVISE64, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_NEWFSTATAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatfs(fd int, buf *Statfs_t) (err error) { _, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(buf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { r0, _ := RawSyscallNoError(SYS_GETEGID, 0, 0, 0) egid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (euid int) { r0, _ := RawSyscallNoError(SYS_GETEUID, 0, 0, 0) euid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _ := RawSyscallNoError(SYS_GETGID, 0, 0, 0) gid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(resource int, rlim *Rlimit) (err error) { _, _, e1 := RawSyscall(SYS_UGETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _ := RawSyscallNoError(SYS_GETUID, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ioperm(from int, num int, on int) (err error) { _, _, e1 := Syscall(SYS_IOPERM, uintptr(from), uintptr(num), uintptr(on)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Iopl(level int) (err error) { _, _, e1 := Syscall(SYS_IOPL, uintptr(level), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, n int) (err error) { _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(n), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lstat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pause() (err error) { _, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seek(fd int, offset int64, whence int) (off int64, err error) { r0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence)) off = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { r0, _, e1 := Syscall6(SYS__NEWSELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { r0, _, e1 := Syscall6(SYS_SENDFILE, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0) written = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setfsgid(gid int) (prev int, err error) { r0, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) prev = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setfsuid(uid int) (prev int, err error) { r0, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) prev = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) { r0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags)) n = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Stat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Statfs(path string, buf *Statfs_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ustat(dev int, ubuf *Ustat_t) (err error) { _, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) { r0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(n int, list *_Gid_t) (nn int, err error) { r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) nn = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(n int, list *_Gid_t) (err error) { _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) { r0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset)) xaddr = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func futimesat(dirfd int, path string, times *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tv *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Time(t *Time_t) (tt Time_t, err error) { r0, _, e1 := RawSyscall(SYS_TIME, uintptr(unsafe.Pointer(t)), 0, 0) tt = Time_t(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Utime(path string, buf *Utimbuf) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, times *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func syncFileRange2(fd int, flags int, off int64, n int64) (err error) { _, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE2, uintptr(fd), uintptr(flags), uintptr(off), uintptr(n), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func kexecFileLoad(kernelFd int, initrdFd int, cmdlineLen int, cmdline string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(cmdline) if err != nil { return } _, _, e1 := Syscall6(SYS_KEXEC_FILE_LOAD, uintptr(kernelFd), uintptr(initrdFd), uintptr(cmdlineLen), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Alarm(seconds uint) (remaining uint, err error) { r0, _, e1 := Syscall(SYS_ALARM, uintptr(seconds), 0, 0) remaining = uint(r0) if e1 != 0 { err = errnoErr(e1) } return } ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go ================================================ // go run mksyscall.go -tags linux,riscv64 syscall_linux.go syscall_linux_riscv64.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build linux && riscv64 package unix import ( "syscall" "unsafe" ) var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fanotifyMark(fd int, flags uint, mask uint64, dirFd int, pathname *byte) (err error) { _, _, e1 := Syscall6(SYS_FANOTIFY_MARK, uintptr(fd), uintptr(flags), uintptr(mask), uintptr(dirFd), uintptr(unsafe.Pointer(pathname)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fallocate(fd int, mode uint32, off int64, len int64) (err error) { _, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(len), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { r0, _, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0) n = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { var _p0 unsafe.Pointer if len(events) > 0 { _p0 = unsafe.Pointer(&events[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_EPOLL_PWAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall6(SYS_FADVISE64, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FSTATAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatfs(fd int, buf *Statfs_t) (err error) { _, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(buf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { r0, _ := RawSyscallNoError(SYS_GETEGID, 0, 0, 0) egid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (euid int) { r0, _ := RawSyscallNoError(SYS_GETEUID, 0, 0, 0) euid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _ := RawSyscallNoError(SYS_GETGID, 0, 0, 0) gid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(resource int, rlim *Rlimit) (err error) { _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _ := RawSyscallNoError(SYS_GETUID, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, n int) (err error) { _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(n), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func MemfdSecret(flags int) (fd int, err error) { r0, _, e1 := Syscall(SYS_MEMFD_SECRET, uintptr(flags), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seek(fd int, offset int64, whence int) (off int64, err error) { r0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence)) off = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { r0, _, e1 := Syscall6(SYS_SENDFILE, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0) written = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setfsgid(gid int) (prev int, err error) { r0, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) prev = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setfsuid(uid int) (prev int, err error) { r0, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) prev = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) { r0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags)) n = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Statfs(path string, buf *Statfs_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func SyncFileRange(fd int, off int64, n int64, flags int) (err error) { _, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE, uintptr(fd), uintptr(off), uintptr(n), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) { r0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(n int, list *_Gid_t) (nn int, err error) { r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) nn = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(n int, list *_Gid_t) (err error) { _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) { r0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset)) xaddr = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tv *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func kexecFileLoad(kernelFd int, initrdFd int, cmdlineLen int, cmdline string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(cmdline) if err != nil { return } _, _, e1 := Syscall6(SYS_KEXEC_FILE_LOAD, uintptr(kernelFd), uintptr(initrdFd), uintptr(cmdlineLen), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func riscvHWProbe(pairs []RISCVHWProbePairs, cpuCount uintptr, cpus *CPUSet, flags uint) (err error) { var _p0 unsafe.Pointer if len(pairs) > 0 { _p0 = unsafe.Pointer(&pairs[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_RISCV_HWPROBE, uintptr(_p0), uintptr(len(pairs)), uintptr(cpuCount), uintptr(unsafe.Pointer(cpus)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go ================================================ // go run mksyscall.go -tags linux,s390x syscall_linux.go syscall_linux_s390x.go syscall_linux_alarm.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build linux && s390x package unix import ( "syscall" "unsafe" ) var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fanotifyMark(fd int, flags uint, mask uint64, dirFd int, pathname *byte) (err error) { _, _, e1 := Syscall6(SYS_FANOTIFY_MARK, uintptr(fd), uintptr(flags), uintptr(mask), uintptr(dirFd), uintptr(unsafe.Pointer(pathname)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fallocate(fd int, mode uint32, off int64, len int64) (err error) { _, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(len), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { r0, _, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0) n = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { var _p0 unsafe.Pointer if len(events) > 0 { _p0 = unsafe.Pointer(&events[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall6(SYS_FADVISE64, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_NEWFSTATAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatfs(fd int, buf *Statfs_t) (err error) { _, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(buf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { r0, _ := RawSyscallNoError(SYS_GETEGID, 0, 0, 0) egid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (euid int) { r0, _ := RawSyscallNoError(SYS_GETEUID, 0, 0, 0) euid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _ := RawSyscallNoError(SYS_GETGID, 0, 0, 0) gid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(resource int, rlim *Rlimit) (err error) { _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _ := RawSyscallNoError(SYS_GETUID, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lstat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pause() (err error) { _, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seek(fd int, offset int64, whence int) (off int64, err error) { r0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence)) off = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { r0, _, e1 := Syscall6(SYS_SELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { r0, _, e1 := Syscall6(SYS_SENDFILE, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0) written = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setfsgid(gid int) (prev int, err error) { r0, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) prev = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setfsuid(uid int) (prev int, err error) { r0, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) prev = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) { r0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags)) n = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Stat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Statfs(path string, buf *Statfs_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func SyncFileRange(fd int, off int64, n int64, flags int) (err error) { _, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE, uintptr(fd), uintptr(off), uintptr(n), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ustat(dev int, ubuf *Ustat_t) (err error) { _, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(n int, list *_Gid_t) (nn int, err error) { r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) nn = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(n int, list *_Gid_t) (err error) { _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func futimesat(dirfd int, path string, times *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tv *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Utime(path string, buf *Utimbuf) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, times *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func kexecFileLoad(kernelFd int, initrdFd int, cmdlineLen int, cmdline string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(cmdline) if err != nil { return } _, _, e1 := Syscall6(SYS_KEXEC_FILE_LOAD, uintptr(kernelFd), uintptr(initrdFd), uintptr(cmdlineLen), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Alarm(seconds uint) (remaining uint, err error) { r0, _, e1 := Syscall(SYS_ALARM, uintptr(seconds), 0, 0) remaining = uint(r0) if e1 != 0 { err = errnoErr(e1) } return } ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go ================================================ // go run mksyscall.go -tags linux,sparc64 syscall_linux.go syscall_linux_sparc64.go syscall_linux_alarm.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build linux && sparc64 package unix import ( "syscall" "unsafe" ) var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fanotifyMark(fd int, flags uint, mask uint64, dirFd int, pathname *byte) (err error) { _, _, e1 := Syscall6(SYS_FANOTIFY_MARK, uintptr(fd), uintptr(flags), uintptr(mask), uintptr(dirFd), uintptr(unsafe.Pointer(pathname)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fallocate(fd int, mode uint32, off int64, len int64) (err error) { _, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(len), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { r0, _, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0) n = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { var _p0 unsafe.Pointer if len(events) > 0 { _p0 = unsafe.Pointer(&events[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall6(SYS_FADVISE64, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FSTATAT64, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatfs(fd int, buf *Statfs_t) (err error) { _, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(buf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { r0, _ := RawSyscallNoError(SYS_GETEGID, 0, 0, 0) egid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (euid int) { r0, _ := RawSyscallNoError(SYS_GETEUID, 0, 0, 0) euid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _ := RawSyscallNoError(SYS_GETGID, 0, 0, 0) gid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(resource int, rlim *Rlimit) (err error) { _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _ := RawSyscallNoError(SYS_GETUID, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, n int) (err error) { _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(n), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lstat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pause() (err error) { _, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seek(fd int, offset int64, whence int) (off int64, err error) { r0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence)) off = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { r0, _, e1 := Syscall6(SYS_SELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { r0, _, e1 := Syscall6(SYS_SENDFILE, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0) written = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setfsgid(gid int) (prev int, err error) { r0, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) prev = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setfsuid(uid int) (prev int, err error) { r0, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) prev = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) { r0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags)) n = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Stat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Statfs(path string, buf *Statfs_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func SyncFileRange(fd int, off int64, n int64, flags int) (err error) { _, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE, uintptr(fd), uintptr(off), uintptr(n), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) { r0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(n int, list *_Gid_t) (nn int, err error) { r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) nn = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(n int, list *_Gid_t) (err error) { _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) { r0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset)) xaddr = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func futimesat(dirfd int, path string, times *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tv *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Utime(path string, buf *Utimbuf) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, times *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Alarm(seconds uint) (remaining uint, err error) { r0, _, e1 := Syscall(SYS_ALARM, uintptr(seconds), 0, 0) remaining = uint(r0) if e1 != 0 { err = errnoErr(e1) } return } ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go ================================================ // go run mksyscall.go -l32 -netbsd -tags netbsd,386 syscall_bsd.go syscall_netbsd.go syscall_netbsd_386.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build netbsd && 386 package unix import ( "syscall" "unsafe" ) var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(ngid int, gid *_Gid_t) (n int, err error) { r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(ngid int, gid *_Gid_t) (err error) { _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) { r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) wpid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(s int, how int) (err error) { _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) { r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, timeval *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func futimes(fd int, timeval *[2]Timeval) (err error) { _, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Madvise(b []byte, behav int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(behav)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlockall(flags int) (err error) { _, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mprotect(b []byte, prot int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Msync(b []byte, flags int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlockall() (err error) { _, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe2(p *[2]_C_int, flags int) (err error) { _, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getdents(fd int, buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_GETDENTS, uintptr(fd), uintptr(_p0), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getcwd(buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS___GETCWD, uintptr(_p0), uintptr(len(buf)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctl(fd int, req uint, arg uintptr) (err error) { _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) { _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { var _p0 unsafe.Pointer if len(mib) > 0 { _p0 = unsafe.Pointer(&mib[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Access(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Adjtime(delta *Timeval, olddelta *Timeval) (err error) { _, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chflags(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chmod(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chroot(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ClockGettime(clockid int32, time *Timespec) (err error) { _, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Close(fd int) (err error) { _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(fd int) (nfd int, err error) { r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0) nfd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup2(from int, to int) (err error) { _, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup3(from int, to int, flags int) (err error) { _, _, e1 := Syscall(SYS_DUP3, uintptr(from), uintptr(to), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Exit(code int) { Syscall(SYS_EXIT, uintptr(code), 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrGetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_GET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrSetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_SET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrDeleteFd(fd int, attrnamespace int, attrname string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(attrname) if err != nil { return } _, _, e1 := Syscall(SYS_EXTATTR_DELETE_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrListFd(fd int, attrnamespace int, data uintptr, nbytes int) (ret int, err error) { r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FD, uintptr(fd), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrGetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(file) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_GET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrSetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(file) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_SET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrDeleteFile(file string, attrnamespace int, attrname string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(file) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } _, _, e1 := Syscall(SYS_EXTATTR_DELETE_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrListFile(file string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(file) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrGetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(link) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_GET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrSetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(link) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_SET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrDeleteLink(link string, attrnamespace int, attrname string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(link) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } _, _, e1 := Syscall(SYS_EXTATTR_DELETE_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrListLink(link string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(link) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall9(SYS_POSIX_FADVISE, uintptr(fd), 0, uintptr(offset), uintptr(offset>>32), 0, uintptr(length), uintptr(length>>32), uintptr(advice), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchdir(fd int) (err error) { _, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchflags(fd int, flags int) (err error) { _, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmod(fd int, mode uint32) (err error) { _, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Flock(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fpathconf(fd int, name int) (val int, err error) { r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FSTATAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatvfs1(fd int, buf *Statvfs_t, flags int) (err error) { _, _, e1 := Syscall(SYS_FSTATVFS1, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fsync(fd int) (err error) { _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { _, _, e1 := Syscall6(SYS_FTRUNCATE, uintptr(fd), 0, uintptr(length), uintptr(length>>32), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0) egid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (uid int) { r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0) gid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgid(pid int) (pgid int, err error) { r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0) pgid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgrp() (pgrp int) { r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0) pgrp = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpid() (pid int) { r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0) pid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getppid() (ppid int) { r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0) ppid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpriority(which int, who int) (prio int, err error) { r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0) prio = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(which int, lim *Rlimit) (err error) { _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrusage(who int, rusage *Rusage) (err error) { _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getsid(pid int) (sid int, err error) { r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) sid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tv *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Issetugid() (tainted bool) { r0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0) tainted = bool(r0 != 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kill(pid int, signum syscall.Signal) (err error) { _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kqueue() (fd int, err error) { r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Link(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := Syscall6(SYS_LINKAT, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, backlog int) (err error) { _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lstat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdir(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdirat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifo(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifoat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKFIFOAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknod(path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Open(path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pathconf(path string, name int) (val int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func read(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlink(path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rename(from string, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(fromfd int, from string, tofd int, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Revoke(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rmdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { r0, r1, e1 := Syscall6(SYS_LSEEK, uintptr(fd), 0, uintptr(offset), uintptr(offset>>32), uintptr(whence), 0) newoffset = int64(int64(r1)<<32 | int64(r0)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { r0, _, e1 := Syscall6(SYS_SELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setegid(egid int) (err error) { _, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seteuid(euid int) (err error) { _, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setgid(gid int) (err error) { _, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (err error) { _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpriority(which int, who int, prio int) (err error) { _, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setregid(rgid int, egid int) (err error) { _, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setreuid(ruid int, euid int) (err error) { _, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, err error) { r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0) pid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Settimeofday(tp *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setuid(uid int) (err error) { _, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Stat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Statvfs1(path string, buf *Statvfs_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STATVFS1, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlink(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sync() (err error) { _, _, e1 := Syscall(SYS_SYNC, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length), uintptr(length>>32), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Umask(newmask int) (oldmask int) { r0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0) oldmask = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlink(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlinkat(dirfd int, path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unmount(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func write(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { r0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), 0, uintptr(pos), uintptr(pos>>32), 0) ret = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func munmap(addr uintptr, length uintptr) (err error) { _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mremapNetBSD(oldp uintptr, oldsize uintptr, newp uintptr, newsize uintptr, flags int) (xaddr uintptr, err error) { r0, _, e1 := Syscall6(SYS_MREMAP, uintptr(oldp), uintptr(oldsize), uintptr(newp), uintptr(newsize), uintptr(flags), 0) xaddr = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go ================================================ // go run mksyscall.go -netbsd -tags netbsd,amd64 syscall_bsd.go syscall_netbsd.go syscall_netbsd_amd64.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build netbsd && amd64 package unix import ( "syscall" "unsafe" ) var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(ngid int, gid *_Gid_t) (n int, err error) { r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(ngid int, gid *_Gid_t) (err error) { _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) { r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) wpid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(s int, how int) (err error) { _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) { r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, timeval *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func futimes(fd int, timeval *[2]Timeval) (err error) { _, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Madvise(b []byte, behav int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(behav)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlockall(flags int) (err error) { _, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mprotect(b []byte, prot int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Msync(b []byte, flags int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlockall() (err error) { _, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe2(p *[2]_C_int, flags int) (err error) { _, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getdents(fd int, buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_GETDENTS, uintptr(fd), uintptr(_p0), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getcwd(buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS___GETCWD, uintptr(_p0), uintptr(len(buf)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctl(fd int, req uint, arg uintptr) (err error) { _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) { _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { var _p0 unsafe.Pointer if len(mib) > 0 { _p0 = unsafe.Pointer(&mib[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Access(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Adjtime(delta *Timeval, olddelta *Timeval) (err error) { _, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chflags(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chmod(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chroot(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ClockGettime(clockid int32, time *Timespec) (err error) { _, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Close(fd int) (err error) { _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(fd int) (nfd int, err error) { r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0) nfd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup2(from int, to int) (err error) { _, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup3(from int, to int, flags int) (err error) { _, _, e1 := Syscall(SYS_DUP3, uintptr(from), uintptr(to), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Exit(code int) { Syscall(SYS_EXIT, uintptr(code), 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrGetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_GET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrSetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_SET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrDeleteFd(fd int, attrnamespace int, attrname string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(attrname) if err != nil { return } _, _, e1 := Syscall(SYS_EXTATTR_DELETE_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrListFd(fd int, attrnamespace int, data uintptr, nbytes int) (ret int, err error) { r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FD, uintptr(fd), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrGetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(file) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_GET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrSetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(file) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_SET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrDeleteFile(file string, attrnamespace int, attrname string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(file) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } _, _, e1 := Syscall(SYS_EXTATTR_DELETE_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrListFile(file string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(file) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrGetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(link) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_GET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrSetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(link) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_SET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrDeleteLink(link string, attrnamespace int, attrname string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(link) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } _, _, e1 := Syscall(SYS_EXTATTR_DELETE_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrListLink(link string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(link) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall6(SYS_POSIX_FADVISE, uintptr(fd), 0, uintptr(offset), 0, uintptr(length), uintptr(advice)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchdir(fd int) (err error) { _, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchflags(fd int, flags int) (err error) { _, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmod(fd int, mode uint32) (err error) { _, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Flock(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fpathconf(fd int, name int) (val int, err error) { r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FSTATAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatvfs1(fd int, buf *Statvfs_t, flags int) (err error) { _, _, e1 := Syscall(SYS_FSTATVFS1, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fsync(fd int) (err error) { _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), 0, uintptr(length)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0) egid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (uid int) { r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0) gid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgid(pid int) (pgid int, err error) { r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0) pgid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgrp() (pgrp int) { r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0) pgrp = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpid() (pid int) { r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0) pid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getppid() (ppid int) { r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0) ppid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpriority(which int, who int) (prio int, err error) { r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0) prio = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(which int, lim *Rlimit) (err error) { _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrusage(who int, rusage *Rusage) (err error) { _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getsid(pid int) (sid int, err error) { r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) sid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tv *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Issetugid() (tainted bool) { r0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0) tainted = bool(r0 != 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kill(pid int, signum syscall.Signal) (err error) { _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kqueue() (fd int, err error) { r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Link(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := Syscall6(SYS_LINKAT, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, backlog int) (err error) { _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lstat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdir(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdirat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifo(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifoat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKFIFOAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknod(path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Open(path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pathconf(path string, name int) (val int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func read(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlink(path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rename(from string, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(fromfd int, from string, tofd int, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Revoke(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rmdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { r0, _, e1 := Syscall6(SYS_LSEEK, uintptr(fd), 0, uintptr(offset), uintptr(whence), 0, 0) newoffset = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { r0, _, e1 := Syscall6(SYS_SELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setegid(egid int) (err error) { _, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seteuid(euid int) (err error) { _, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setgid(gid int) (err error) { _, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (err error) { _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpriority(which int, who int, prio int) (err error) { _, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setregid(rgid int, egid int) (err error) { _, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setreuid(ruid int, euid int) (err error) { _, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, err error) { r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0) pid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Settimeofday(tp *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setuid(uid int) (err error) { _, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Stat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Statvfs1(path string, buf *Statvfs_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STATVFS1, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlink(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sync() (err error) { _, _, e1 := Syscall(SYS_SYNC, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Umask(newmask int) (oldmask int) { r0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0) oldmask = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlink(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlinkat(dirfd int, path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unmount(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func write(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { r0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), 0, uintptr(pos), 0, 0) ret = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func munmap(addr uintptr, length uintptr) (err error) { _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mremapNetBSD(oldp uintptr, oldsize uintptr, newp uintptr, newsize uintptr, flags int) (xaddr uintptr, err error) { r0, _, e1 := Syscall6(SYS_MREMAP, uintptr(oldp), uintptr(oldsize), uintptr(newp), uintptr(newsize), uintptr(flags), 0) xaddr = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go ================================================ // go run mksyscall.go -l32 -netbsd -arm -tags netbsd,arm syscall_bsd.go syscall_netbsd.go syscall_netbsd_arm.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build netbsd && arm package unix import ( "syscall" "unsafe" ) var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(ngid int, gid *_Gid_t) (n int, err error) { r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(ngid int, gid *_Gid_t) (err error) { _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) { r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) wpid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(s int, how int) (err error) { _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) { r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, timeval *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func futimes(fd int, timeval *[2]Timeval) (err error) { _, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Madvise(b []byte, behav int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(behav)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlockall(flags int) (err error) { _, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mprotect(b []byte, prot int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Msync(b []byte, flags int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlockall() (err error) { _, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe2(p *[2]_C_int, flags int) (err error) { _, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getdents(fd int, buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_GETDENTS, uintptr(fd), uintptr(_p0), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getcwd(buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS___GETCWD, uintptr(_p0), uintptr(len(buf)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctl(fd int, req uint, arg uintptr) (err error) { _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) { _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { var _p0 unsafe.Pointer if len(mib) > 0 { _p0 = unsafe.Pointer(&mib[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Access(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Adjtime(delta *Timeval, olddelta *Timeval) (err error) { _, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chflags(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chmod(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chroot(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ClockGettime(clockid int32, time *Timespec) (err error) { _, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Close(fd int) (err error) { _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(fd int) (nfd int, err error) { r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0) nfd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup2(from int, to int) (err error) { _, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup3(from int, to int, flags int) (err error) { _, _, e1 := Syscall(SYS_DUP3, uintptr(from), uintptr(to), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Exit(code int) { Syscall(SYS_EXIT, uintptr(code), 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrGetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_GET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrSetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_SET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrDeleteFd(fd int, attrnamespace int, attrname string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(attrname) if err != nil { return } _, _, e1 := Syscall(SYS_EXTATTR_DELETE_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrListFd(fd int, attrnamespace int, data uintptr, nbytes int) (ret int, err error) { r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FD, uintptr(fd), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrGetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(file) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_GET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrSetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(file) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_SET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrDeleteFile(file string, attrnamespace int, attrname string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(file) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } _, _, e1 := Syscall(SYS_EXTATTR_DELETE_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrListFile(file string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(file) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrGetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(link) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_GET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrSetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(link) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_SET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrDeleteLink(link string, attrnamespace int, attrname string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(link) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } _, _, e1 := Syscall(SYS_EXTATTR_DELETE_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrListLink(link string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(link) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall9(SYS_POSIX_FADVISE, uintptr(fd), 0, uintptr(offset), uintptr(offset>>32), 0, uintptr(length), uintptr(length>>32), uintptr(advice), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchdir(fd int) (err error) { _, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchflags(fd int, flags int) (err error) { _, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmod(fd int, mode uint32) (err error) { _, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Flock(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fpathconf(fd int, name int) (val int, err error) { r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FSTATAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatvfs1(fd int, buf *Statvfs_t, flags int) (err error) { _, _, e1 := Syscall(SYS_FSTATVFS1, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fsync(fd int) (err error) { _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { _, _, e1 := Syscall6(SYS_FTRUNCATE, uintptr(fd), 0, uintptr(length), uintptr(length>>32), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0) egid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (uid int) { r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0) gid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgid(pid int) (pgid int, err error) { r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0) pgid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgrp() (pgrp int) { r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0) pgrp = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpid() (pid int) { r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0) pid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getppid() (ppid int) { r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0) ppid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpriority(which int, who int) (prio int, err error) { r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0) prio = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(which int, lim *Rlimit) (err error) { _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrusage(who int, rusage *Rusage) (err error) { _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getsid(pid int) (sid int, err error) { r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) sid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tv *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Issetugid() (tainted bool) { r0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0) tainted = bool(r0 != 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kill(pid int, signum syscall.Signal) (err error) { _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kqueue() (fd int, err error) { r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Link(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := Syscall6(SYS_LINKAT, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, backlog int) (err error) { _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lstat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdir(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdirat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifo(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifoat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKFIFOAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknod(path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Open(path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pathconf(path string, name int) (val int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func read(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlink(path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rename(from string, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(fromfd int, from string, tofd int, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Revoke(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rmdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { r0, r1, e1 := Syscall6(SYS_LSEEK, uintptr(fd), 0, uintptr(offset), uintptr(offset>>32), uintptr(whence), 0) newoffset = int64(int64(r1)<<32 | int64(r0)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { r0, _, e1 := Syscall6(SYS_SELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setegid(egid int) (err error) { _, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seteuid(euid int) (err error) { _, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setgid(gid int) (err error) { _, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (err error) { _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpriority(which int, who int, prio int) (err error) { _, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setregid(rgid int, egid int) (err error) { _, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setreuid(ruid int, euid int) (err error) { _, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, err error) { r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0) pid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Settimeofday(tp *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setuid(uid int) (err error) { _, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Stat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Statvfs1(path string, buf *Statvfs_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STATVFS1, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlink(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sync() (err error) { _, _, e1 := Syscall(SYS_SYNC, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length), uintptr(length>>32), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Umask(newmask int) (oldmask int) { r0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0) oldmask = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlink(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlinkat(dirfd int, path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unmount(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func write(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { r0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), 0, uintptr(pos), uintptr(pos>>32), 0) ret = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func munmap(addr uintptr, length uintptr) (err error) { _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mremapNetBSD(oldp uintptr, oldsize uintptr, newp uintptr, newsize uintptr, flags int) (xaddr uintptr, err error) { r0, _, e1 := Syscall6(SYS_MREMAP, uintptr(oldp), uintptr(oldsize), uintptr(newp), uintptr(newsize), uintptr(flags), 0) xaddr = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go ================================================ // go run mksyscall.go -netbsd -tags netbsd,arm64 syscall_bsd.go syscall_netbsd.go syscall_netbsd_arm64.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build netbsd && arm64 package unix import ( "syscall" "unsafe" ) var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(ngid int, gid *_Gid_t) (n int, err error) { r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(ngid int, gid *_Gid_t) (err error) { _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) { r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) wpid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(s int, how int) (err error) { _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) { r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, timeval *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func futimes(fd int, timeval *[2]Timeval) (err error) { _, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Madvise(b []byte, behav int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(behav)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlockall(flags int) (err error) { _, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mprotect(b []byte, prot int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Msync(b []byte, flags int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlockall() (err error) { _, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe2(p *[2]_C_int, flags int) (err error) { _, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getdents(fd int, buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_GETDENTS, uintptr(fd), uintptr(_p0), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getcwd(buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS___GETCWD, uintptr(_p0), uintptr(len(buf)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctl(fd int, req uint, arg uintptr) (err error) { _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) { _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { var _p0 unsafe.Pointer if len(mib) > 0 { _p0 = unsafe.Pointer(&mib[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Access(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Adjtime(delta *Timeval, olddelta *Timeval) (err error) { _, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chflags(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chmod(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chroot(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ClockGettime(clockid int32, time *Timespec) (err error) { _, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Close(fd int) (err error) { _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(fd int) (nfd int, err error) { r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0) nfd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup2(from int, to int) (err error) { _, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup3(from int, to int, flags int) (err error) { _, _, e1 := Syscall(SYS_DUP3, uintptr(from), uintptr(to), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Exit(code int) { Syscall(SYS_EXIT, uintptr(code), 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrGetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_GET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrSetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_SET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrDeleteFd(fd int, attrnamespace int, attrname string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(attrname) if err != nil { return } _, _, e1 := Syscall(SYS_EXTATTR_DELETE_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrListFd(fd int, attrnamespace int, data uintptr, nbytes int) (ret int, err error) { r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FD, uintptr(fd), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrGetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(file) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_GET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrSetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(file) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_SET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrDeleteFile(file string, attrnamespace int, attrname string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(file) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } _, _, e1 := Syscall(SYS_EXTATTR_DELETE_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrListFile(file string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(file) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrGetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(link) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_GET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrSetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(link) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_SET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrDeleteLink(link string, attrnamespace int, attrname string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(link) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } _, _, e1 := Syscall(SYS_EXTATTR_DELETE_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrListLink(link string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(link) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall6(SYS_POSIX_FADVISE, uintptr(fd), 0, uintptr(offset), 0, uintptr(length), uintptr(advice)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchdir(fd int) (err error) { _, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchflags(fd int, flags int) (err error) { _, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmod(fd int, mode uint32) (err error) { _, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Flock(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fpathconf(fd int, name int) (val int, err error) { r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FSTATAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatvfs1(fd int, buf *Statvfs_t, flags int) (err error) { _, _, e1 := Syscall(SYS_FSTATVFS1, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fsync(fd int) (err error) { _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), 0, uintptr(length)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0) egid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (uid int) { r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0) gid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgid(pid int) (pgid int, err error) { r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0) pgid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgrp() (pgrp int) { r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0) pgrp = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpid() (pid int) { r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0) pid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getppid() (ppid int) { r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0) ppid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpriority(which int, who int) (prio int, err error) { r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0) prio = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(which int, lim *Rlimit) (err error) { _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrusage(who int, rusage *Rusage) (err error) { _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getsid(pid int) (sid int, err error) { r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) sid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tv *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Issetugid() (tainted bool) { r0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0) tainted = bool(r0 != 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kill(pid int, signum syscall.Signal) (err error) { _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kqueue() (fd int, err error) { r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Link(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := Syscall6(SYS_LINKAT, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, backlog int) (err error) { _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lstat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdir(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdirat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifo(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifoat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKFIFOAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknod(path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Open(path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pathconf(path string, name int) (val int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func read(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlink(path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rename(from string, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(fromfd int, from string, tofd int, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Revoke(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rmdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { r0, _, e1 := Syscall6(SYS_LSEEK, uintptr(fd), 0, uintptr(offset), uintptr(whence), 0, 0) newoffset = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { r0, _, e1 := Syscall6(SYS_SELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setegid(egid int) (err error) { _, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seteuid(euid int) (err error) { _, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setgid(gid int) (err error) { _, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (err error) { _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpriority(which int, who int, prio int) (err error) { _, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setregid(rgid int, egid int) (err error) { _, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setreuid(ruid int, euid int) (err error) { _, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, err error) { r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0) pid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Settimeofday(tp *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setuid(uid int) (err error) { _, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Stat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Statvfs1(path string, buf *Statvfs_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STATVFS1, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlink(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sync() (err error) { _, _, e1 := Syscall(SYS_SYNC, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Umask(newmask int) (oldmask int) { r0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0) oldmask = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlink(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlinkat(dirfd int, path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unmount(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func write(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { r0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), 0, uintptr(pos), 0, 0) ret = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func munmap(addr uintptr, length uintptr) (err error) { _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mremapNetBSD(oldp uintptr, oldsize uintptr, newp uintptr, newsize uintptr, flags int) (xaddr uintptr, err error) { r0, _, e1 := Syscall6(SYS_MREMAP, uintptr(oldp), uintptr(oldsize), uintptr(newp), uintptr(newsize), uintptr(flags), 0) xaddr = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go ================================================ // go run mksyscall.go -l32 -openbsd -libc -tags openbsd,386 syscall_bsd.go syscall_openbsd.go syscall_openbsd_386.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build openbsd && 386 package unix import ( "syscall" "unsafe" ) var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(ngid int, gid *_Gid_t) (n int, err error) { r0, _, e1 := syscall_rawSyscall(libc_getgroups_trampoline_addr, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getgroups_trampoline_addr uintptr //go:cgo_import_dynamic libc_getgroups getgroups "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(ngid int, gid *_Gid_t) (err error) { _, _, e1 := syscall_rawSyscall(libc_setgroups_trampoline_addr, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setgroups_trampoline_addr uintptr //go:cgo_import_dynamic libc_setgroups setgroups "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) { r0, _, e1 := syscall_syscall6(libc_wait4_trampoline_addr, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) wpid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_wait4_trampoline_addr uintptr //go:cgo_import_dynamic libc_wait4 wait4 "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { r0, _, e1 := syscall_syscall(libc_accept_trampoline_addr, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_accept_trampoline_addr uintptr //go:cgo_import_dynamic libc_accept accept "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := syscall_syscall(libc_bind_trampoline_addr, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } var libc_bind_trampoline_addr uintptr //go:cgo_import_dynamic libc_bind bind "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := syscall_syscall(libc_connect_trampoline_addr, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } var libc_connect_trampoline_addr uintptr //go:cgo_import_dynamic libc_connect connect "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { r0, _, e1 := syscall_rawSyscall(libc_socket_trampoline_addr, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_socket_trampoline_addr uintptr //go:cgo_import_dynamic libc_socket socket "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { _, _, e1 := syscall_syscall6(libc_getsockopt_trampoline_addr, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getsockopt_trampoline_addr uintptr //go:cgo_import_dynamic libc_getsockopt getsockopt "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { _, _, e1 := syscall_syscall6(libc_setsockopt_trampoline_addr, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setsockopt_trampoline_addr uintptr //go:cgo_import_dynamic libc_setsockopt setsockopt "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := syscall_rawSyscall(libc_getpeername_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } var libc_getpeername_trampoline_addr uintptr //go:cgo_import_dynamic libc_getpeername getpeername "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := syscall_rawSyscall(libc_getsockname_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } var libc_getsockname_trampoline_addr uintptr //go:cgo_import_dynamic libc_getsockname getsockname "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(s int, how int) (err error) { _, _, e1 := syscall_syscall(libc_shutdown_trampoline_addr, uintptr(s), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_shutdown_trampoline_addr uintptr //go:cgo_import_dynamic libc_shutdown shutdown "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { _, _, e1 := syscall_rawSyscall6(libc_socketpair_trampoline_addr, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_socketpair_trampoline_addr uintptr //go:cgo_import_dynamic libc_socketpair socketpair "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall6(libc_recvfrom_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_recvfrom_trampoline_addr uintptr //go:cgo_import_dynamic libc_recvfrom recvfrom "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall6(libc_sendto_trampoline_addr, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } var libc_sendto_trampoline_addr uintptr //go:cgo_import_dynamic libc_sendto sendto "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := syscall_syscall(libc_recvmsg_trampoline_addr, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_recvmsg_trampoline_addr uintptr //go:cgo_import_dynamic libc_recvmsg recvmsg "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := syscall_syscall(libc_sendmsg_trampoline_addr, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_sendmsg_trampoline_addr uintptr //go:cgo_import_dynamic libc_sendmsg sendmsg "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) { r0, _, e1 := syscall_syscall6(libc_kevent_trampoline_addr, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_kevent_trampoline_addr uintptr //go:cgo_import_dynamic libc_kevent kevent "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, timeval *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_utimes_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_utimes_trampoline_addr uintptr //go:cgo_import_dynamic libc_utimes utimes "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func futimes(fd int, timeval *[2]Timeval) (err error) { _, _, e1 := syscall_syscall(libc_futimes_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_futimes_trampoline_addr uintptr //go:cgo_import_dynamic libc_futimes futimes "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := syscall_syscall(libc_poll_trampoline_addr, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_poll_trampoline_addr uintptr //go:cgo_import_dynamic libc_poll poll "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Madvise(b []byte, behav int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall(libc_madvise_trampoline_addr, uintptr(_p0), uintptr(len(b)), uintptr(behav)) if e1 != 0 { err = errnoErr(e1) } return } var libc_madvise_trampoline_addr uintptr //go:cgo_import_dynamic libc_madvise madvise "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall(libc_mlock_trampoline_addr, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mlock_trampoline_addr uintptr //go:cgo_import_dynamic libc_mlock mlock "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlockall(flags int) (err error) { _, _, e1 := syscall_syscall(libc_mlockall_trampoline_addr, uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mlockall_trampoline_addr uintptr //go:cgo_import_dynamic libc_mlockall mlockall "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mprotect(b []byte, prot int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall(libc_mprotect_trampoline_addr, uintptr(_p0), uintptr(len(b)), uintptr(prot)) if e1 != 0 { err = errnoErr(e1) } return } var libc_mprotect_trampoline_addr uintptr //go:cgo_import_dynamic libc_mprotect mprotect "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Msync(b []byte, flags int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall(libc_msync_trampoline_addr, uintptr(_p0), uintptr(len(b)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } var libc_msync_trampoline_addr uintptr //go:cgo_import_dynamic libc_msync msync "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall(libc_munlock_trampoline_addr, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_munlock_trampoline_addr uintptr //go:cgo_import_dynamic libc_munlock munlock "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlockall() (err error) { _, _, e1 := syscall_syscall(libc_munlockall_trampoline_addr, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_munlockall_trampoline_addr uintptr //go:cgo_import_dynamic libc_munlockall munlockall "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe2(p *[2]_C_int, flags int) (err error) { _, _, e1 := syscall_rawSyscall(libc_pipe2_trampoline_addr, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pipe2_trampoline_addr uintptr //go:cgo_import_dynamic libc_pipe2 pipe2 "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getdents(fd int, buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_getdents_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getdents_trampoline_addr uintptr //go:cgo_import_dynamic libc_getdents getdents "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getcwd(buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_getcwd_trampoline_addr, uintptr(_p0), uintptr(len(buf)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getcwd_trampoline_addr uintptr //go:cgo_import_dynamic libc_getcwd getcwd "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getresuid(ruid *_C_int, euid *_C_int, suid *_C_int) { syscall_rawSyscall(libc_getresuid_trampoline_addr, uintptr(unsafe.Pointer(ruid)), uintptr(unsafe.Pointer(euid)), uintptr(unsafe.Pointer(suid))) return } var libc_getresuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getresuid getresuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getresgid(rgid *_C_int, egid *_C_int, sgid *_C_int) { syscall_rawSyscall(libc_getresgid_trampoline_addr, uintptr(unsafe.Pointer(rgid)), uintptr(unsafe.Pointer(egid)), uintptr(unsafe.Pointer(sgid))) return } var libc_getresgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getresgid getresgid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctl(fd int, req uint, arg uintptr) (err error) { _, _, e1 := syscall_syscall(libc_ioctl_trampoline_addr, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } var libc_ioctl_trampoline_addr uintptr //go:cgo_import_dynamic libc_ioctl ioctl "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) { _, _, e1 := syscall_syscall(libc_ioctl_trampoline_addr, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { var _p0 unsafe.Pointer if len(mib) > 0 { _p0 = unsafe.Pointer(&mib[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall6(libc_sysctl_trampoline_addr, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) if e1 != 0 { err = errnoErr(e1) } return } var libc_sysctl_trampoline_addr uintptr //go:cgo_import_dynamic libc_sysctl sysctl "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fcntl(fd int, cmd int, arg int) (n int, err error) { r0, _, e1 := syscall_syscall(libc_fcntl_trampoline_addr, uintptr(fd), uintptr(cmd), uintptr(arg)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fcntl_trampoline_addr uintptr //go:cgo_import_dynamic libc_fcntl fcntl "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fcntlPtr(fd int, cmd int, arg unsafe.Pointer) (n int, err error) { r0, _, e1 := syscall_syscall(libc_fcntl_trampoline_addr, uintptr(fd), uintptr(cmd), uintptr(arg)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { r0, _, e1 := syscall_syscall6(libc_ppoll_trampoline_addr, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_ppoll_trampoline_addr uintptr //go:cgo_import_dynamic libc_ppoll ppoll "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Access(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_access_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_access_trampoline_addr uintptr //go:cgo_import_dynamic libc_access access "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Adjtime(delta *Timeval, olddelta *Timeval) (err error) { _, _, e1 := syscall_syscall(libc_adjtime_trampoline_addr, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_adjtime_trampoline_addr uintptr //go:cgo_import_dynamic libc_adjtime adjtime "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_chdir_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_chdir_trampoline_addr uintptr //go:cgo_import_dynamic libc_chdir chdir "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chflags(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_chflags_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_chflags_trampoline_addr uintptr //go:cgo_import_dynamic libc_chflags chflags "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chmod(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_chmod_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_chmod_trampoline_addr uintptr //go:cgo_import_dynamic libc_chmod chmod "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_chown_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } var libc_chown_trampoline_addr uintptr //go:cgo_import_dynamic libc_chown chown "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chroot(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_chroot_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_chroot_trampoline_addr uintptr //go:cgo_import_dynamic libc_chroot chroot "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ClockGettime(clockid int32, time *Timespec) (err error) { _, _, e1 := syscall_syscall(libc_clock_gettime_trampoline_addr, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_clock_gettime_trampoline_addr uintptr //go:cgo_import_dynamic libc_clock_gettime clock_gettime "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Close(fd int) (err error) { _, _, e1 := syscall_syscall(libc_close_trampoline_addr, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_close_trampoline_addr uintptr //go:cgo_import_dynamic libc_close close "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(fd int) (nfd int, err error) { r0, _, e1 := syscall_syscall(libc_dup_trampoline_addr, uintptr(fd), 0, 0) nfd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_dup_trampoline_addr uintptr //go:cgo_import_dynamic libc_dup dup "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup2(from int, to int) (err error) { _, _, e1 := syscall_syscall(libc_dup2_trampoline_addr, uintptr(from), uintptr(to), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_dup2_trampoline_addr uintptr //go:cgo_import_dynamic libc_dup2 dup2 "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup3(from int, to int, flags int) (err error) { _, _, e1 := syscall_syscall(libc_dup3_trampoline_addr, uintptr(from), uintptr(to), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } var libc_dup3_trampoline_addr uintptr //go:cgo_import_dynamic libc_dup3 dup3 "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Exit(code int) { syscall_syscall(libc_exit_trampoline_addr, uintptr(code), 0, 0) return } var libc_exit_trampoline_addr uintptr //go:cgo_import_dynamic libc_exit exit "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_faccessat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_faccessat_trampoline_addr uintptr //go:cgo_import_dynamic libc_faccessat faccessat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchdir(fd int) (err error) { _, _, e1 := syscall_syscall(libc_fchdir_trampoline_addr, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchdir_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchdir fchdir "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchflags(fd int, flags int) (err error) { _, _, e1 := syscall_syscall(libc_fchflags_trampoline_addr, uintptr(fd), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchflags_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchflags fchflags "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmod(fd int, mode uint32) (err error) { _, _, e1 := syscall_syscall(libc_fchmod_trampoline_addr, uintptr(fd), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchmod_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchmod fchmod "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_fchmodat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchmodat_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchmodat fchmodat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := syscall_syscall(libc_fchown_trampoline_addr, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchown_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchown fchown "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_fchownat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchownat_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchownat fchownat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Flock(fd int, how int) (err error) { _, _, e1 := syscall_syscall(libc_flock_trampoline_addr, uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_flock_trampoline_addr uintptr //go:cgo_import_dynamic libc_flock flock "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fpathconf(fd int, name int) (val int, err error) { r0, _, e1 := syscall_syscall(libc_fpathconf_trampoline_addr, uintptr(fd), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fpathconf_trampoline_addr uintptr //go:cgo_import_dynamic libc_fpathconf fpathconf "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := syscall_syscall(libc_fstat_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fstat_trampoline_addr uintptr //go:cgo_import_dynamic libc_fstat fstat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_fstatat_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fstatat_trampoline_addr uintptr //go:cgo_import_dynamic libc_fstatat fstatat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatfs(fd int, stat *Statfs_t) (err error) { _, _, e1 := syscall_syscall(libc_fstatfs_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fstatfs_trampoline_addr uintptr //go:cgo_import_dynamic libc_fstatfs fstatfs "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fsync(fd int) (err error) { _, _, e1 := syscall_syscall(libc_fsync_trampoline_addr, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fsync_trampoline_addr uintptr //go:cgo_import_dynamic libc_fsync fsync "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { _, _, e1 := syscall_syscall(libc_ftruncate_trampoline_addr, uintptr(fd), uintptr(length), uintptr(length>>32)) if e1 != 0 { err = errnoErr(e1) } return } var libc_ftruncate_trampoline_addr uintptr //go:cgo_import_dynamic libc_ftruncate ftruncate "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { r0, _, _ := syscall_rawSyscall(libc_getegid_trampoline_addr, 0, 0, 0) egid = int(r0) return } var libc_getegid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getegid getegid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (uid int) { r0, _, _ := syscall_rawSyscall(libc_geteuid_trampoline_addr, 0, 0, 0) uid = int(r0) return } var libc_geteuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_geteuid geteuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _, _ := syscall_rawSyscall(libc_getgid_trampoline_addr, 0, 0, 0) gid = int(r0) return } var libc_getgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getgid getgid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgid(pid int) (pgid int, err error) { r0, _, e1 := syscall_rawSyscall(libc_getpgid_trampoline_addr, uintptr(pid), 0, 0) pgid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getpgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getpgid getpgid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgrp() (pgrp int) { r0, _, _ := syscall_rawSyscall(libc_getpgrp_trampoline_addr, 0, 0, 0) pgrp = int(r0) return } var libc_getpgrp_trampoline_addr uintptr //go:cgo_import_dynamic libc_getpgrp getpgrp "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpid() (pid int) { r0, _, _ := syscall_rawSyscall(libc_getpid_trampoline_addr, 0, 0, 0) pid = int(r0) return } var libc_getpid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getpid getpid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getppid() (ppid int) { r0, _, _ := syscall_rawSyscall(libc_getppid_trampoline_addr, 0, 0, 0) ppid = int(r0) return } var libc_getppid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getppid getppid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpriority(which int, who int) (prio int, err error) { r0, _, e1 := syscall_syscall(libc_getpriority_trampoline_addr, uintptr(which), uintptr(who), 0) prio = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getpriority_trampoline_addr uintptr //go:cgo_import_dynamic libc_getpriority getpriority "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(which int, lim *Rlimit) (err error) { _, _, e1 := syscall_rawSyscall(libc_getrlimit_trampoline_addr, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getrlimit_trampoline_addr uintptr //go:cgo_import_dynamic libc_getrlimit getrlimit "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrtable() (rtable int, err error) { r0, _, e1 := syscall_rawSyscall(libc_getrtable_trampoline_addr, 0, 0, 0) rtable = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getrtable_trampoline_addr uintptr //go:cgo_import_dynamic libc_getrtable getrtable "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrusage(who int, rusage *Rusage) (err error) { _, _, e1 := syscall_rawSyscall(libc_getrusage_trampoline_addr, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getrusage_trampoline_addr uintptr //go:cgo_import_dynamic libc_getrusage getrusage "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getsid(pid int) (sid int, err error) { r0, _, e1 := syscall_rawSyscall(libc_getsid_trampoline_addr, uintptr(pid), 0, 0) sid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getsid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getsid getsid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tv *Timeval) (err error) { _, _, e1 := syscall_rawSyscall(libc_gettimeofday_trampoline_addr, uintptr(unsafe.Pointer(tv)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_gettimeofday_trampoline_addr uintptr //go:cgo_import_dynamic libc_gettimeofday gettimeofday "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _, _ := syscall_rawSyscall(libc_getuid_trampoline_addr, 0, 0, 0) uid = int(r0) return } var libc_getuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getuid getuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Issetugid() (tainted bool) { r0, _, _ := syscall_syscall(libc_issetugid_trampoline_addr, 0, 0, 0) tainted = bool(r0 != 0) return } var libc_issetugid_trampoline_addr uintptr //go:cgo_import_dynamic libc_issetugid issetugid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kill(pid int, signum syscall.Signal) (err error) { _, _, e1 := syscall_syscall(libc_kill_trampoline_addr, uintptr(pid), uintptr(signum), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_kill_trampoline_addr uintptr //go:cgo_import_dynamic libc_kill kill "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kqueue() (fd int, err error) { r0, _, e1 := syscall_syscall(libc_kqueue_trampoline_addr, 0, 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_kqueue_trampoline_addr uintptr //go:cgo_import_dynamic libc_kqueue kqueue "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_lchown_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } var libc_lchown_trampoline_addr uintptr //go:cgo_import_dynamic libc_lchown lchown "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Link(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := syscall_syscall(libc_link_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_link_trampoline_addr uintptr //go:cgo_import_dynamic libc_link link "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := syscall_syscall6(libc_linkat_trampoline_addr, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_linkat_trampoline_addr uintptr //go:cgo_import_dynamic libc_linkat linkat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, backlog int) (err error) { _, _, e1 := syscall_syscall(libc_listen_trampoline_addr, uintptr(s), uintptr(backlog), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_listen_trampoline_addr uintptr //go:cgo_import_dynamic libc_listen listen "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lstat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_lstat_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_lstat_trampoline_addr uintptr //go:cgo_import_dynamic libc_lstat lstat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdir(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_mkdir_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mkdir_trampoline_addr uintptr //go:cgo_import_dynamic libc_mkdir mkdir "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdirat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_mkdirat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } var libc_mkdirat_trampoline_addr uintptr //go:cgo_import_dynamic libc_mkdirat mkdirat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifo(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_mkfifo_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mkfifo_trampoline_addr uintptr //go:cgo_import_dynamic libc_mkfifo mkfifo "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifoat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_mkfifoat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } var libc_mkfifoat_trampoline_addr uintptr //go:cgo_import_dynamic libc_mkfifoat mkfifoat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknod(path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_mknod_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) if e1 != 0 { err = errnoErr(e1) } return } var libc_mknod_trampoline_addr uintptr //go:cgo_import_dynamic libc_mknod mknod "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_mknodat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mknodat_trampoline_addr uintptr //go:cgo_import_dynamic libc_mknodat mknodat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) { var _p0 *byte _p0, err = BytePtrFromString(fsType) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(dir) if err != nil { return } _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mount_trampoline_addr uintptr //go:cgo_import_dynamic libc_mount mount "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := syscall_syscall(libc_nanosleep_trampoline_addr, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_nanosleep_trampoline_addr uintptr //go:cgo_import_dynamic libc_nanosleep nanosleep "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Open(path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := syscall_syscall(libc_open_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_open_trampoline_addr uintptr //go:cgo_import_dynamic libc_open open "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := syscall_syscall6(libc_openat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_openat_trampoline_addr uintptr //go:cgo_import_dynamic libc_openat openat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pathconf(path string, name int) (val int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := syscall_syscall(libc_pathconf_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pathconf_trampoline_addr uintptr //go:cgo_import_dynamic libc_pathconf pathconf "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall6(libc_pread_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pread_trampoline_addr uintptr //go:cgo_import_dynamic libc_pread pread "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall6(libc_pwrite_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pwrite_trampoline_addr uintptr //go:cgo_import_dynamic libc_pwrite pwrite "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func read(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_read_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_read_trampoline_addr uintptr //go:cgo_import_dynamic libc_read read "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlink(path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_readlink_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_readlink_trampoline_addr uintptr //go:cgo_import_dynamic libc_readlink readlink "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall6(libc_readlinkat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_readlinkat_trampoline_addr uintptr //go:cgo_import_dynamic libc_readlinkat readlinkat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rename(from string, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := syscall_syscall(libc_rename_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_rename_trampoline_addr uintptr //go:cgo_import_dynamic libc_rename rename "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(fromfd int, from string, tofd int, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := syscall_syscall6(libc_renameat_trampoline_addr, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_renameat_trampoline_addr uintptr //go:cgo_import_dynamic libc_renameat renameat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Revoke(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_revoke_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_revoke_trampoline_addr uintptr //go:cgo_import_dynamic libc_revoke revoke "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rmdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_rmdir_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_rmdir_trampoline_addr uintptr //go:cgo_import_dynamic libc_rmdir rmdir "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { r0, r1, e1 := syscall_syscall6(libc_lseek_trampoline_addr, uintptr(fd), uintptr(offset), uintptr(offset>>32), uintptr(whence), 0, 0) newoffset = int64(int64(r1)<<32 | int64(r0)) if e1 != 0 { err = errnoErr(e1) } return } var libc_lseek_trampoline_addr uintptr //go:cgo_import_dynamic libc_lseek lseek "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { r0, _, e1 := syscall_syscall6(libc_select_trampoline_addr, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_select_trampoline_addr uintptr //go:cgo_import_dynamic libc_select select "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setegid(egid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setegid_trampoline_addr, uintptr(egid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setegid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setegid setegid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seteuid(euid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_seteuid_trampoline_addr, uintptr(euid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_seteuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_seteuid seteuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setgid(gid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setgid_trampoline_addr, uintptr(gid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setgid setgid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setlogin(name string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(name) if err != nil { return } _, _, e1 := syscall_syscall(libc_setlogin_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setlogin_trampoline_addr uintptr //go:cgo_import_dynamic libc_setlogin setlogin "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setpgid_trampoline_addr, uintptr(pid), uintptr(pgid), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setpgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setpgid setpgid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpriority(which int, who int, prio int) (err error) { _, _, e1 := syscall_syscall(libc_setpriority_trampoline_addr, uintptr(which), uintptr(who), uintptr(prio)) if e1 != 0 { err = errnoErr(e1) } return } var libc_setpriority_trampoline_addr uintptr //go:cgo_import_dynamic libc_setpriority setpriority "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setregid(rgid int, egid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setregid_trampoline_addr, uintptr(rgid), uintptr(egid), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setregid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setregid setregid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setreuid(ruid int, euid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setreuid_trampoline_addr, uintptr(ruid), uintptr(euid), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setreuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setreuid setreuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresgid(rgid int, egid int, sgid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setresgid_trampoline_addr, uintptr(rgid), uintptr(egid), uintptr(sgid)) if e1 != 0 { err = errnoErr(e1) } return } var libc_setresgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setresgid setresgid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresuid(ruid int, euid int, suid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setresuid_trampoline_addr, uintptr(ruid), uintptr(euid), uintptr(suid)) if e1 != 0 { err = errnoErr(e1) } return } var libc_setresuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setresuid setresuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setrtable(rtable int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setrtable_trampoline_addr, uintptr(rtable), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setrtable_trampoline_addr uintptr //go:cgo_import_dynamic libc_setrtable setrtable "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, err error) { r0, _, e1 := syscall_rawSyscall(libc_setsid_trampoline_addr, 0, 0, 0) pid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setsid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setsid setsid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Settimeofday(tp *Timeval) (err error) { _, _, e1 := syscall_rawSyscall(libc_settimeofday_trampoline_addr, uintptr(unsafe.Pointer(tp)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_settimeofday_trampoline_addr uintptr //go:cgo_import_dynamic libc_settimeofday settimeofday "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setuid(uid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setuid_trampoline_addr, uintptr(uid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setuid setuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Stat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_stat_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_stat_trampoline_addr uintptr //go:cgo_import_dynamic libc_stat stat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Statfs(path string, stat *Statfs_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_statfs_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_statfs_trampoline_addr uintptr //go:cgo_import_dynamic libc_statfs statfs "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlink(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := syscall_syscall(libc_symlink_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_symlink_trampoline_addr uintptr //go:cgo_import_dynamic libc_symlink symlink "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := syscall_syscall(libc_symlinkat_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } var libc_symlinkat_trampoline_addr uintptr //go:cgo_import_dynamic libc_symlinkat symlinkat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sync() (err error) { _, _, e1 := syscall_syscall(libc_sync_trampoline_addr, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_sync_trampoline_addr uintptr //go:cgo_import_dynamic libc_sync sync "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_truncate_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(length), uintptr(length>>32)) if e1 != 0 { err = errnoErr(e1) } return } var libc_truncate_trampoline_addr uintptr //go:cgo_import_dynamic libc_truncate truncate "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Umask(newmask int) (oldmask int) { r0, _, _ := syscall_syscall(libc_umask_trampoline_addr, uintptr(newmask), 0, 0) oldmask = int(r0) return } var libc_umask_trampoline_addr uintptr //go:cgo_import_dynamic libc_umask umask "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlink(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_unlink_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_unlink_trampoline_addr uintptr //go:cgo_import_dynamic libc_unlink unlink "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlinkat(dirfd int, path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_unlinkat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } var libc_unlinkat_trampoline_addr uintptr //go:cgo_import_dynamic libc_unlinkat unlinkat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unmount(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_unmount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_unmount_trampoline_addr uintptr //go:cgo_import_dynamic libc_unmount unmount "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func write(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_write_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_write_trampoline_addr uintptr //go:cgo_import_dynamic libc_write write "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { r0, _, e1 := syscall_syscall9(libc_mmap_trampoline_addr, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos), uintptr(pos>>32), 0, 0) ret = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mmap_trampoline_addr uintptr //go:cgo_import_dynamic libc_mmap mmap "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func munmap(addr uintptr, length uintptr) (err error) { _, _, e1 := syscall_syscall(libc_munmap_trampoline_addr, uintptr(addr), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_munmap_trampoline_addr uintptr //go:cgo_import_dynamic libc_munmap munmap "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getfsstat(stat *Statfs_t, bufsize uintptr, flags int) (n int, err error) { r0, _, e1 := syscall_syscall(libc_getfsstat_trampoline_addr, uintptr(unsafe.Pointer(stat)), uintptr(bufsize), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getfsstat_trampoline_addr uintptr //go:cgo_import_dynamic libc_getfsstat getfsstat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_utimensat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_utimensat_trampoline_addr uintptr //go:cgo_import_dynamic libc_utimensat utimensat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pledge(promises *byte, execpromises *byte) (err error) { _, _, e1 := syscall_syscall(libc_pledge_trampoline_addr, uintptr(unsafe.Pointer(promises)), uintptr(unsafe.Pointer(execpromises)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pledge_trampoline_addr uintptr //go:cgo_import_dynamic libc_pledge pledge "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func unveil(path *byte, flags *byte) (err error) { _, _, e1 := syscall_syscall(libc_unveil_trampoline_addr, uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(flags)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_unveil_trampoline_addr uintptr //go:cgo_import_dynamic libc_unveil unveil "libc.so" ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s ================================================ // go run mkasm.go openbsd 386 // Code generated by the command above; DO NOT EDIT. #include "textflag.h" TEXT libc_getgroups_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getgroups(SB) GLOBL ·libc_getgroups_trampoline_addr(SB), RODATA, $4 DATA ·libc_getgroups_trampoline_addr(SB)/4, $libc_getgroups_trampoline<>(SB) TEXT libc_setgroups_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setgroups(SB) GLOBL ·libc_setgroups_trampoline_addr(SB), RODATA, $4 DATA ·libc_setgroups_trampoline_addr(SB)/4, $libc_setgroups_trampoline<>(SB) TEXT libc_wait4_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_wait4(SB) GLOBL ·libc_wait4_trampoline_addr(SB), RODATA, $4 DATA ·libc_wait4_trampoline_addr(SB)/4, $libc_wait4_trampoline<>(SB) TEXT libc_accept_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_accept(SB) GLOBL ·libc_accept_trampoline_addr(SB), RODATA, $4 DATA ·libc_accept_trampoline_addr(SB)/4, $libc_accept_trampoline<>(SB) TEXT libc_bind_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_bind(SB) GLOBL ·libc_bind_trampoline_addr(SB), RODATA, $4 DATA ·libc_bind_trampoline_addr(SB)/4, $libc_bind_trampoline<>(SB) TEXT libc_connect_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_connect(SB) GLOBL ·libc_connect_trampoline_addr(SB), RODATA, $4 DATA ·libc_connect_trampoline_addr(SB)/4, $libc_connect_trampoline<>(SB) TEXT libc_socket_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_socket(SB) GLOBL ·libc_socket_trampoline_addr(SB), RODATA, $4 DATA ·libc_socket_trampoline_addr(SB)/4, $libc_socket_trampoline<>(SB) TEXT libc_getsockopt_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getsockopt(SB) GLOBL ·libc_getsockopt_trampoline_addr(SB), RODATA, $4 DATA ·libc_getsockopt_trampoline_addr(SB)/4, $libc_getsockopt_trampoline<>(SB) TEXT libc_setsockopt_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setsockopt(SB) GLOBL ·libc_setsockopt_trampoline_addr(SB), RODATA, $4 DATA ·libc_setsockopt_trampoline_addr(SB)/4, $libc_setsockopt_trampoline<>(SB) TEXT libc_getpeername_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpeername(SB) GLOBL ·libc_getpeername_trampoline_addr(SB), RODATA, $4 DATA ·libc_getpeername_trampoline_addr(SB)/4, $libc_getpeername_trampoline<>(SB) TEXT libc_getsockname_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getsockname(SB) GLOBL ·libc_getsockname_trampoline_addr(SB), RODATA, $4 DATA ·libc_getsockname_trampoline_addr(SB)/4, $libc_getsockname_trampoline<>(SB) TEXT libc_shutdown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_shutdown(SB) GLOBL ·libc_shutdown_trampoline_addr(SB), RODATA, $4 DATA ·libc_shutdown_trampoline_addr(SB)/4, $libc_shutdown_trampoline<>(SB) TEXT libc_socketpair_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_socketpair(SB) GLOBL ·libc_socketpair_trampoline_addr(SB), RODATA, $4 DATA ·libc_socketpair_trampoline_addr(SB)/4, $libc_socketpair_trampoline<>(SB) TEXT libc_recvfrom_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_recvfrom(SB) GLOBL ·libc_recvfrom_trampoline_addr(SB), RODATA, $4 DATA ·libc_recvfrom_trampoline_addr(SB)/4, $libc_recvfrom_trampoline<>(SB) TEXT libc_sendto_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sendto(SB) GLOBL ·libc_sendto_trampoline_addr(SB), RODATA, $4 DATA ·libc_sendto_trampoline_addr(SB)/4, $libc_sendto_trampoline<>(SB) TEXT libc_recvmsg_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_recvmsg(SB) GLOBL ·libc_recvmsg_trampoline_addr(SB), RODATA, $4 DATA ·libc_recvmsg_trampoline_addr(SB)/4, $libc_recvmsg_trampoline<>(SB) TEXT libc_sendmsg_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sendmsg(SB) GLOBL ·libc_sendmsg_trampoline_addr(SB), RODATA, $4 DATA ·libc_sendmsg_trampoline_addr(SB)/4, $libc_sendmsg_trampoline<>(SB) TEXT libc_kevent_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_kevent(SB) GLOBL ·libc_kevent_trampoline_addr(SB), RODATA, $4 DATA ·libc_kevent_trampoline_addr(SB)/4, $libc_kevent_trampoline<>(SB) TEXT libc_utimes_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_utimes(SB) GLOBL ·libc_utimes_trampoline_addr(SB), RODATA, $4 DATA ·libc_utimes_trampoline_addr(SB)/4, $libc_utimes_trampoline<>(SB) TEXT libc_futimes_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_futimes(SB) GLOBL ·libc_futimes_trampoline_addr(SB), RODATA, $4 DATA ·libc_futimes_trampoline_addr(SB)/4, $libc_futimes_trampoline<>(SB) TEXT libc_poll_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_poll(SB) GLOBL ·libc_poll_trampoline_addr(SB), RODATA, $4 DATA ·libc_poll_trampoline_addr(SB)/4, $libc_poll_trampoline<>(SB) TEXT libc_madvise_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_madvise(SB) GLOBL ·libc_madvise_trampoline_addr(SB), RODATA, $4 DATA ·libc_madvise_trampoline_addr(SB)/4, $libc_madvise_trampoline<>(SB) TEXT libc_mlock_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mlock(SB) GLOBL ·libc_mlock_trampoline_addr(SB), RODATA, $4 DATA ·libc_mlock_trampoline_addr(SB)/4, $libc_mlock_trampoline<>(SB) TEXT libc_mlockall_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mlockall(SB) GLOBL ·libc_mlockall_trampoline_addr(SB), RODATA, $4 DATA ·libc_mlockall_trampoline_addr(SB)/4, $libc_mlockall_trampoline<>(SB) TEXT libc_mprotect_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mprotect(SB) GLOBL ·libc_mprotect_trampoline_addr(SB), RODATA, $4 DATA ·libc_mprotect_trampoline_addr(SB)/4, $libc_mprotect_trampoline<>(SB) TEXT libc_msync_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_msync(SB) GLOBL ·libc_msync_trampoline_addr(SB), RODATA, $4 DATA ·libc_msync_trampoline_addr(SB)/4, $libc_msync_trampoline<>(SB) TEXT libc_munlock_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_munlock(SB) GLOBL ·libc_munlock_trampoline_addr(SB), RODATA, $4 DATA ·libc_munlock_trampoline_addr(SB)/4, $libc_munlock_trampoline<>(SB) TEXT libc_munlockall_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_munlockall(SB) GLOBL ·libc_munlockall_trampoline_addr(SB), RODATA, $4 DATA ·libc_munlockall_trampoline_addr(SB)/4, $libc_munlockall_trampoline<>(SB) TEXT libc_pipe2_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pipe2(SB) GLOBL ·libc_pipe2_trampoline_addr(SB), RODATA, $4 DATA ·libc_pipe2_trampoline_addr(SB)/4, $libc_pipe2_trampoline<>(SB) TEXT libc_getdents_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getdents(SB) GLOBL ·libc_getdents_trampoline_addr(SB), RODATA, $4 DATA ·libc_getdents_trampoline_addr(SB)/4, $libc_getdents_trampoline<>(SB) TEXT libc_getcwd_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getcwd(SB) GLOBL ·libc_getcwd_trampoline_addr(SB), RODATA, $4 DATA ·libc_getcwd_trampoline_addr(SB)/4, $libc_getcwd_trampoline<>(SB) TEXT libc_getresuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getresuid(SB) GLOBL ·libc_getresuid_trampoline_addr(SB), RODATA, $4 DATA ·libc_getresuid_trampoline_addr(SB)/4, $libc_getresuid_trampoline<>(SB) TEXT libc_getresgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getresgid(SB) GLOBL ·libc_getresgid_trampoline_addr(SB), RODATA, $4 DATA ·libc_getresgid_trampoline_addr(SB)/4, $libc_getresgid_trampoline<>(SB) TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ioctl(SB) GLOBL ·libc_ioctl_trampoline_addr(SB), RODATA, $4 DATA ·libc_ioctl_trampoline_addr(SB)/4, $libc_ioctl_trampoline<>(SB) TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sysctl(SB) GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $4 DATA ·libc_sysctl_trampoline_addr(SB)/4, $libc_sysctl_trampoline<>(SB) TEXT libc_fcntl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fcntl(SB) GLOBL ·libc_fcntl_trampoline_addr(SB), RODATA, $4 DATA ·libc_fcntl_trampoline_addr(SB)/4, $libc_fcntl_trampoline<>(SB) TEXT libc_ppoll_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ppoll(SB) GLOBL ·libc_ppoll_trampoline_addr(SB), RODATA, $4 DATA ·libc_ppoll_trampoline_addr(SB)/4, $libc_ppoll_trampoline<>(SB) TEXT libc_access_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_access(SB) GLOBL ·libc_access_trampoline_addr(SB), RODATA, $4 DATA ·libc_access_trampoline_addr(SB)/4, $libc_access_trampoline<>(SB) TEXT libc_adjtime_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_adjtime(SB) GLOBL ·libc_adjtime_trampoline_addr(SB), RODATA, $4 DATA ·libc_adjtime_trampoline_addr(SB)/4, $libc_adjtime_trampoline<>(SB) TEXT libc_chdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chdir(SB) GLOBL ·libc_chdir_trampoline_addr(SB), RODATA, $4 DATA ·libc_chdir_trampoline_addr(SB)/4, $libc_chdir_trampoline<>(SB) TEXT libc_chflags_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chflags(SB) GLOBL ·libc_chflags_trampoline_addr(SB), RODATA, $4 DATA ·libc_chflags_trampoline_addr(SB)/4, $libc_chflags_trampoline<>(SB) TEXT libc_chmod_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chmod(SB) GLOBL ·libc_chmod_trampoline_addr(SB), RODATA, $4 DATA ·libc_chmod_trampoline_addr(SB)/4, $libc_chmod_trampoline<>(SB) TEXT libc_chown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chown(SB) GLOBL ·libc_chown_trampoline_addr(SB), RODATA, $4 DATA ·libc_chown_trampoline_addr(SB)/4, $libc_chown_trampoline<>(SB) TEXT libc_chroot_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chroot(SB) GLOBL ·libc_chroot_trampoline_addr(SB), RODATA, $4 DATA ·libc_chroot_trampoline_addr(SB)/4, $libc_chroot_trampoline<>(SB) TEXT libc_clock_gettime_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_clock_gettime(SB) GLOBL ·libc_clock_gettime_trampoline_addr(SB), RODATA, $4 DATA ·libc_clock_gettime_trampoline_addr(SB)/4, $libc_clock_gettime_trampoline<>(SB) TEXT libc_close_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_close(SB) GLOBL ·libc_close_trampoline_addr(SB), RODATA, $4 DATA ·libc_close_trampoline_addr(SB)/4, $libc_close_trampoline<>(SB) TEXT libc_dup_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_dup(SB) GLOBL ·libc_dup_trampoline_addr(SB), RODATA, $4 DATA ·libc_dup_trampoline_addr(SB)/4, $libc_dup_trampoline<>(SB) TEXT libc_dup2_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_dup2(SB) GLOBL ·libc_dup2_trampoline_addr(SB), RODATA, $4 DATA ·libc_dup2_trampoline_addr(SB)/4, $libc_dup2_trampoline<>(SB) TEXT libc_dup3_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_dup3(SB) GLOBL ·libc_dup3_trampoline_addr(SB), RODATA, $4 DATA ·libc_dup3_trampoline_addr(SB)/4, $libc_dup3_trampoline<>(SB) TEXT libc_exit_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_exit(SB) GLOBL ·libc_exit_trampoline_addr(SB), RODATA, $4 DATA ·libc_exit_trampoline_addr(SB)/4, $libc_exit_trampoline<>(SB) TEXT libc_faccessat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_faccessat(SB) GLOBL ·libc_faccessat_trampoline_addr(SB), RODATA, $4 DATA ·libc_faccessat_trampoline_addr(SB)/4, $libc_faccessat_trampoline<>(SB) TEXT libc_fchdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchdir(SB) GLOBL ·libc_fchdir_trampoline_addr(SB), RODATA, $4 DATA ·libc_fchdir_trampoline_addr(SB)/4, $libc_fchdir_trampoline<>(SB) TEXT libc_fchflags_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchflags(SB) GLOBL ·libc_fchflags_trampoline_addr(SB), RODATA, $4 DATA ·libc_fchflags_trampoline_addr(SB)/4, $libc_fchflags_trampoline<>(SB) TEXT libc_fchmod_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchmod(SB) GLOBL ·libc_fchmod_trampoline_addr(SB), RODATA, $4 DATA ·libc_fchmod_trampoline_addr(SB)/4, $libc_fchmod_trampoline<>(SB) TEXT libc_fchmodat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchmodat(SB) GLOBL ·libc_fchmodat_trampoline_addr(SB), RODATA, $4 DATA ·libc_fchmodat_trampoline_addr(SB)/4, $libc_fchmodat_trampoline<>(SB) TEXT libc_fchown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchown(SB) GLOBL ·libc_fchown_trampoline_addr(SB), RODATA, $4 DATA ·libc_fchown_trampoline_addr(SB)/4, $libc_fchown_trampoline<>(SB) TEXT libc_fchownat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchownat(SB) GLOBL ·libc_fchownat_trampoline_addr(SB), RODATA, $4 DATA ·libc_fchownat_trampoline_addr(SB)/4, $libc_fchownat_trampoline<>(SB) TEXT libc_flock_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_flock(SB) GLOBL ·libc_flock_trampoline_addr(SB), RODATA, $4 DATA ·libc_flock_trampoline_addr(SB)/4, $libc_flock_trampoline<>(SB) TEXT libc_fpathconf_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fpathconf(SB) GLOBL ·libc_fpathconf_trampoline_addr(SB), RODATA, $4 DATA ·libc_fpathconf_trampoline_addr(SB)/4, $libc_fpathconf_trampoline<>(SB) TEXT libc_fstat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fstat(SB) GLOBL ·libc_fstat_trampoline_addr(SB), RODATA, $4 DATA ·libc_fstat_trampoline_addr(SB)/4, $libc_fstat_trampoline<>(SB) TEXT libc_fstatat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fstatat(SB) GLOBL ·libc_fstatat_trampoline_addr(SB), RODATA, $4 DATA ·libc_fstatat_trampoline_addr(SB)/4, $libc_fstatat_trampoline<>(SB) TEXT libc_fstatfs_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fstatfs(SB) GLOBL ·libc_fstatfs_trampoline_addr(SB), RODATA, $4 DATA ·libc_fstatfs_trampoline_addr(SB)/4, $libc_fstatfs_trampoline<>(SB) TEXT libc_fsync_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fsync(SB) GLOBL ·libc_fsync_trampoline_addr(SB), RODATA, $4 DATA ·libc_fsync_trampoline_addr(SB)/4, $libc_fsync_trampoline<>(SB) TEXT libc_ftruncate_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ftruncate(SB) GLOBL ·libc_ftruncate_trampoline_addr(SB), RODATA, $4 DATA ·libc_ftruncate_trampoline_addr(SB)/4, $libc_ftruncate_trampoline<>(SB) TEXT libc_getegid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getegid(SB) GLOBL ·libc_getegid_trampoline_addr(SB), RODATA, $4 DATA ·libc_getegid_trampoline_addr(SB)/4, $libc_getegid_trampoline<>(SB) TEXT libc_geteuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_geteuid(SB) GLOBL ·libc_geteuid_trampoline_addr(SB), RODATA, $4 DATA ·libc_geteuid_trampoline_addr(SB)/4, $libc_geteuid_trampoline<>(SB) TEXT libc_getgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getgid(SB) GLOBL ·libc_getgid_trampoline_addr(SB), RODATA, $4 DATA ·libc_getgid_trampoline_addr(SB)/4, $libc_getgid_trampoline<>(SB) TEXT libc_getpgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpgid(SB) GLOBL ·libc_getpgid_trampoline_addr(SB), RODATA, $4 DATA ·libc_getpgid_trampoline_addr(SB)/4, $libc_getpgid_trampoline<>(SB) TEXT libc_getpgrp_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpgrp(SB) GLOBL ·libc_getpgrp_trampoline_addr(SB), RODATA, $4 DATA ·libc_getpgrp_trampoline_addr(SB)/4, $libc_getpgrp_trampoline<>(SB) TEXT libc_getpid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpid(SB) GLOBL ·libc_getpid_trampoline_addr(SB), RODATA, $4 DATA ·libc_getpid_trampoline_addr(SB)/4, $libc_getpid_trampoline<>(SB) TEXT libc_getppid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getppid(SB) GLOBL ·libc_getppid_trampoline_addr(SB), RODATA, $4 DATA ·libc_getppid_trampoline_addr(SB)/4, $libc_getppid_trampoline<>(SB) TEXT libc_getpriority_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpriority(SB) GLOBL ·libc_getpriority_trampoline_addr(SB), RODATA, $4 DATA ·libc_getpriority_trampoline_addr(SB)/4, $libc_getpriority_trampoline<>(SB) TEXT libc_getrlimit_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getrlimit(SB) GLOBL ·libc_getrlimit_trampoline_addr(SB), RODATA, $4 DATA ·libc_getrlimit_trampoline_addr(SB)/4, $libc_getrlimit_trampoline<>(SB) TEXT libc_getrtable_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getrtable(SB) GLOBL ·libc_getrtable_trampoline_addr(SB), RODATA, $4 DATA ·libc_getrtable_trampoline_addr(SB)/4, $libc_getrtable_trampoline<>(SB) TEXT libc_getrusage_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getrusage(SB) GLOBL ·libc_getrusage_trampoline_addr(SB), RODATA, $4 DATA ·libc_getrusage_trampoline_addr(SB)/4, $libc_getrusage_trampoline<>(SB) TEXT libc_getsid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getsid(SB) GLOBL ·libc_getsid_trampoline_addr(SB), RODATA, $4 DATA ·libc_getsid_trampoline_addr(SB)/4, $libc_getsid_trampoline<>(SB) TEXT libc_gettimeofday_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_gettimeofday(SB) GLOBL ·libc_gettimeofday_trampoline_addr(SB), RODATA, $4 DATA ·libc_gettimeofday_trampoline_addr(SB)/4, $libc_gettimeofday_trampoline<>(SB) TEXT libc_getuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getuid(SB) GLOBL ·libc_getuid_trampoline_addr(SB), RODATA, $4 DATA ·libc_getuid_trampoline_addr(SB)/4, $libc_getuid_trampoline<>(SB) TEXT libc_issetugid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_issetugid(SB) GLOBL ·libc_issetugid_trampoline_addr(SB), RODATA, $4 DATA ·libc_issetugid_trampoline_addr(SB)/4, $libc_issetugid_trampoline<>(SB) TEXT libc_kill_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_kill(SB) GLOBL ·libc_kill_trampoline_addr(SB), RODATA, $4 DATA ·libc_kill_trampoline_addr(SB)/4, $libc_kill_trampoline<>(SB) TEXT libc_kqueue_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_kqueue(SB) GLOBL ·libc_kqueue_trampoline_addr(SB), RODATA, $4 DATA ·libc_kqueue_trampoline_addr(SB)/4, $libc_kqueue_trampoline<>(SB) TEXT libc_lchown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_lchown(SB) GLOBL ·libc_lchown_trampoline_addr(SB), RODATA, $4 DATA ·libc_lchown_trampoline_addr(SB)/4, $libc_lchown_trampoline<>(SB) TEXT libc_link_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_link(SB) GLOBL ·libc_link_trampoline_addr(SB), RODATA, $4 DATA ·libc_link_trampoline_addr(SB)/4, $libc_link_trampoline<>(SB) TEXT libc_linkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_linkat(SB) GLOBL ·libc_linkat_trampoline_addr(SB), RODATA, $4 DATA ·libc_linkat_trampoline_addr(SB)/4, $libc_linkat_trampoline<>(SB) TEXT libc_listen_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_listen(SB) GLOBL ·libc_listen_trampoline_addr(SB), RODATA, $4 DATA ·libc_listen_trampoline_addr(SB)/4, $libc_listen_trampoline<>(SB) TEXT libc_lstat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_lstat(SB) GLOBL ·libc_lstat_trampoline_addr(SB), RODATA, $4 DATA ·libc_lstat_trampoline_addr(SB)/4, $libc_lstat_trampoline<>(SB) TEXT libc_mkdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkdir(SB) GLOBL ·libc_mkdir_trampoline_addr(SB), RODATA, $4 DATA ·libc_mkdir_trampoline_addr(SB)/4, $libc_mkdir_trampoline<>(SB) TEXT libc_mkdirat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkdirat(SB) GLOBL ·libc_mkdirat_trampoline_addr(SB), RODATA, $4 DATA ·libc_mkdirat_trampoline_addr(SB)/4, $libc_mkdirat_trampoline<>(SB) TEXT libc_mkfifo_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkfifo(SB) GLOBL ·libc_mkfifo_trampoline_addr(SB), RODATA, $4 DATA ·libc_mkfifo_trampoline_addr(SB)/4, $libc_mkfifo_trampoline<>(SB) TEXT libc_mkfifoat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkfifoat(SB) GLOBL ·libc_mkfifoat_trampoline_addr(SB), RODATA, $4 DATA ·libc_mkfifoat_trampoline_addr(SB)/4, $libc_mkfifoat_trampoline<>(SB) TEXT libc_mknod_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mknod(SB) GLOBL ·libc_mknod_trampoline_addr(SB), RODATA, $4 DATA ·libc_mknod_trampoline_addr(SB)/4, $libc_mknod_trampoline<>(SB) TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mknodat(SB) GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $4 DATA ·libc_mknodat_trampoline_addr(SB)/4, $libc_mknodat_trampoline<>(SB) TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mount(SB) GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $4 DATA ·libc_mount_trampoline_addr(SB)/4, $libc_mount_trampoline<>(SB) TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_nanosleep(SB) GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $4 DATA ·libc_nanosleep_trampoline_addr(SB)/4, $libc_nanosleep_trampoline<>(SB) TEXT libc_open_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_open(SB) GLOBL ·libc_open_trampoline_addr(SB), RODATA, $4 DATA ·libc_open_trampoline_addr(SB)/4, $libc_open_trampoline<>(SB) TEXT libc_openat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_openat(SB) GLOBL ·libc_openat_trampoline_addr(SB), RODATA, $4 DATA ·libc_openat_trampoline_addr(SB)/4, $libc_openat_trampoline<>(SB) TEXT libc_pathconf_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pathconf(SB) GLOBL ·libc_pathconf_trampoline_addr(SB), RODATA, $4 DATA ·libc_pathconf_trampoline_addr(SB)/4, $libc_pathconf_trampoline<>(SB) TEXT libc_pread_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pread(SB) GLOBL ·libc_pread_trampoline_addr(SB), RODATA, $4 DATA ·libc_pread_trampoline_addr(SB)/4, $libc_pread_trampoline<>(SB) TEXT libc_pwrite_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pwrite(SB) GLOBL ·libc_pwrite_trampoline_addr(SB), RODATA, $4 DATA ·libc_pwrite_trampoline_addr(SB)/4, $libc_pwrite_trampoline<>(SB) TEXT libc_read_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_read(SB) GLOBL ·libc_read_trampoline_addr(SB), RODATA, $4 DATA ·libc_read_trampoline_addr(SB)/4, $libc_read_trampoline<>(SB) TEXT libc_readlink_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_readlink(SB) GLOBL ·libc_readlink_trampoline_addr(SB), RODATA, $4 DATA ·libc_readlink_trampoline_addr(SB)/4, $libc_readlink_trampoline<>(SB) TEXT libc_readlinkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_readlinkat(SB) GLOBL ·libc_readlinkat_trampoline_addr(SB), RODATA, $4 DATA ·libc_readlinkat_trampoline_addr(SB)/4, $libc_readlinkat_trampoline<>(SB) TEXT libc_rename_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_rename(SB) GLOBL ·libc_rename_trampoline_addr(SB), RODATA, $4 DATA ·libc_rename_trampoline_addr(SB)/4, $libc_rename_trampoline<>(SB) TEXT libc_renameat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_renameat(SB) GLOBL ·libc_renameat_trampoline_addr(SB), RODATA, $4 DATA ·libc_renameat_trampoline_addr(SB)/4, $libc_renameat_trampoline<>(SB) TEXT libc_revoke_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_revoke(SB) GLOBL ·libc_revoke_trampoline_addr(SB), RODATA, $4 DATA ·libc_revoke_trampoline_addr(SB)/4, $libc_revoke_trampoline<>(SB) TEXT libc_rmdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_rmdir(SB) GLOBL ·libc_rmdir_trampoline_addr(SB), RODATA, $4 DATA ·libc_rmdir_trampoline_addr(SB)/4, $libc_rmdir_trampoline<>(SB) TEXT libc_lseek_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_lseek(SB) GLOBL ·libc_lseek_trampoline_addr(SB), RODATA, $4 DATA ·libc_lseek_trampoline_addr(SB)/4, $libc_lseek_trampoline<>(SB) TEXT libc_select_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_select(SB) GLOBL ·libc_select_trampoline_addr(SB), RODATA, $4 DATA ·libc_select_trampoline_addr(SB)/4, $libc_select_trampoline<>(SB) TEXT libc_setegid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setegid(SB) GLOBL ·libc_setegid_trampoline_addr(SB), RODATA, $4 DATA ·libc_setegid_trampoline_addr(SB)/4, $libc_setegid_trampoline<>(SB) TEXT libc_seteuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_seteuid(SB) GLOBL ·libc_seteuid_trampoline_addr(SB), RODATA, $4 DATA ·libc_seteuid_trampoline_addr(SB)/4, $libc_seteuid_trampoline<>(SB) TEXT libc_setgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setgid(SB) GLOBL ·libc_setgid_trampoline_addr(SB), RODATA, $4 DATA ·libc_setgid_trampoline_addr(SB)/4, $libc_setgid_trampoline<>(SB) TEXT libc_setlogin_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setlogin(SB) GLOBL ·libc_setlogin_trampoline_addr(SB), RODATA, $4 DATA ·libc_setlogin_trampoline_addr(SB)/4, $libc_setlogin_trampoline<>(SB) TEXT libc_setpgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setpgid(SB) GLOBL ·libc_setpgid_trampoline_addr(SB), RODATA, $4 DATA ·libc_setpgid_trampoline_addr(SB)/4, $libc_setpgid_trampoline<>(SB) TEXT libc_setpriority_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setpriority(SB) GLOBL ·libc_setpriority_trampoline_addr(SB), RODATA, $4 DATA ·libc_setpriority_trampoline_addr(SB)/4, $libc_setpriority_trampoline<>(SB) TEXT libc_setregid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setregid(SB) GLOBL ·libc_setregid_trampoline_addr(SB), RODATA, $4 DATA ·libc_setregid_trampoline_addr(SB)/4, $libc_setregid_trampoline<>(SB) TEXT libc_setreuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setreuid(SB) GLOBL ·libc_setreuid_trampoline_addr(SB), RODATA, $4 DATA ·libc_setreuid_trampoline_addr(SB)/4, $libc_setreuid_trampoline<>(SB) TEXT libc_setresgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setresgid(SB) GLOBL ·libc_setresgid_trampoline_addr(SB), RODATA, $4 DATA ·libc_setresgid_trampoline_addr(SB)/4, $libc_setresgid_trampoline<>(SB) TEXT libc_setresuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setresuid(SB) GLOBL ·libc_setresuid_trampoline_addr(SB), RODATA, $4 DATA ·libc_setresuid_trampoline_addr(SB)/4, $libc_setresuid_trampoline<>(SB) TEXT libc_setrtable_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setrtable(SB) GLOBL ·libc_setrtable_trampoline_addr(SB), RODATA, $4 DATA ·libc_setrtable_trampoline_addr(SB)/4, $libc_setrtable_trampoline<>(SB) TEXT libc_setsid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setsid(SB) GLOBL ·libc_setsid_trampoline_addr(SB), RODATA, $4 DATA ·libc_setsid_trampoline_addr(SB)/4, $libc_setsid_trampoline<>(SB) TEXT libc_settimeofday_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_settimeofday(SB) GLOBL ·libc_settimeofday_trampoline_addr(SB), RODATA, $4 DATA ·libc_settimeofday_trampoline_addr(SB)/4, $libc_settimeofday_trampoline<>(SB) TEXT libc_setuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setuid(SB) GLOBL ·libc_setuid_trampoline_addr(SB), RODATA, $4 DATA ·libc_setuid_trampoline_addr(SB)/4, $libc_setuid_trampoline<>(SB) TEXT libc_stat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_stat(SB) GLOBL ·libc_stat_trampoline_addr(SB), RODATA, $4 DATA ·libc_stat_trampoline_addr(SB)/4, $libc_stat_trampoline<>(SB) TEXT libc_statfs_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_statfs(SB) GLOBL ·libc_statfs_trampoline_addr(SB), RODATA, $4 DATA ·libc_statfs_trampoline_addr(SB)/4, $libc_statfs_trampoline<>(SB) TEXT libc_symlink_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_symlink(SB) GLOBL ·libc_symlink_trampoline_addr(SB), RODATA, $4 DATA ·libc_symlink_trampoline_addr(SB)/4, $libc_symlink_trampoline<>(SB) TEXT libc_symlinkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_symlinkat(SB) GLOBL ·libc_symlinkat_trampoline_addr(SB), RODATA, $4 DATA ·libc_symlinkat_trampoline_addr(SB)/4, $libc_symlinkat_trampoline<>(SB) TEXT libc_sync_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sync(SB) GLOBL ·libc_sync_trampoline_addr(SB), RODATA, $4 DATA ·libc_sync_trampoline_addr(SB)/4, $libc_sync_trampoline<>(SB) TEXT libc_truncate_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_truncate(SB) GLOBL ·libc_truncate_trampoline_addr(SB), RODATA, $4 DATA ·libc_truncate_trampoline_addr(SB)/4, $libc_truncate_trampoline<>(SB) TEXT libc_umask_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_umask(SB) GLOBL ·libc_umask_trampoline_addr(SB), RODATA, $4 DATA ·libc_umask_trampoline_addr(SB)/4, $libc_umask_trampoline<>(SB) TEXT libc_unlink_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_unlink(SB) GLOBL ·libc_unlink_trampoline_addr(SB), RODATA, $4 DATA ·libc_unlink_trampoline_addr(SB)/4, $libc_unlink_trampoline<>(SB) TEXT libc_unlinkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_unlinkat(SB) GLOBL ·libc_unlinkat_trampoline_addr(SB), RODATA, $4 DATA ·libc_unlinkat_trampoline_addr(SB)/4, $libc_unlinkat_trampoline<>(SB) TEXT libc_unmount_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_unmount(SB) GLOBL ·libc_unmount_trampoline_addr(SB), RODATA, $4 DATA ·libc_unmount_trampoline_addr(SB)/4, $libc_unmount_trampoline<>(SB) TEXT libc_write_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_write(SB) GLOBL ·libc_write_trampoline_addr(SB), RODATA, $4 DATA ·libc_write_trampoline_addr(SB)/4, $libc_write_trampoline<>(SB) TEXT libc_mmap_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mmap(SB) GLOBL ·libc_mmap_trampoline_addr(SB), RODATA, $4 DATA ·libc_mmap_trampoline_addr(SB)/4, $libc_mmap_trampoline<>(SB) TEXT libc_munmap_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_munmap(SB) GLOBL ·libc_munmap_trampoline_addr(SB), RODATA, $4 DATA ·libc_munmap_trampoline_addr(SB)/4, $libc_munmap_trampoline<>(SB) TEXT libc_getfsstat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getfsstat(SB) GLOBL ·libc_getfsstat_trampoline_addr(SB), RODATA, $4 DATA ·libc_getfsstat_trampoline_addr(SB)/4, $libc_getfsstat_trampoline<>(SB) TEXT libc_utimensat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_utimensat(SB) GLOBL ·libc_utimensat_trampoline_addr(SB), RODATA, $4 DATA ·libc_utimensat_trampoline_addr(SB)/4, $libc_utimensat_trampoline<>(SB) TEXT libc_pledge_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pledge(SB) GLOBL ·libc_pledge_trampoline_addr(SB), RODATA, $4 DATA ·libc_pledge_trampoline_addr(SB)/4, $libc_pledge_trampoline<>(SB) TEXT libc_unveil_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_unveil(SB) GLOBL ·libc_unveil_trampoline_addr(SB), RODATA, $4 DATA ·libc_unveil_trampoline_addr(SB)/4, $libc_unveil_trampoline<>(SB) ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go ================================================ // go run mksyscall.go -openbsd -libc -tags openbsd,amd64 syscall_bsd.go syscall_openbsd.go syscall_openbsd_amd64.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build openbsd && amd64 package unix import ( "syscall" "unsafe" ) var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(ngid int, gid *_Gid_t) (n int, err error) { r0, _, e1 := syscall_rawSyscall(libc_getgroups_trampoline_addr, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getgroups_trampoline_addr uintptr //go:cgo_import_dynamic libc_getgroups getgroups "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(ngid int, gid *_Gid_t) (err error) { _, _, e1 := syscall_rawSyscall(libc_setgroups_trampoline_addr, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setgroups_trampoline_addr uintptr //go:cgo_import_dynamic libc_setgroups setgroups "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) { r0, _, e1 := syscall_syscall6(libc_wait4_trampoline_addr, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) wpid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_wait4_trampoline_addr uintptr //go:cgo_import_dynamic libc_wait4 wait4 "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { r0, _, e1 := syscall_syscall(libc_accept_trampoline_addr, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_accept_trampoline_addr uintptr //go:cgo_import_dynamic libc_accept accept "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := syscall_syscall(libc_bind_trampoline_addr, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } var libc_bind_trampoline_addr uintptr //go:cgo_import_dynamic libc_bind bind "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := syscall_syscall(libc_connect_trampoline_addr, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } var libc_connect_trampoline_addr uintptr //go:cgo_import_dynamic libc_connect connect "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { r0, _, e1 := syscall_rawSyscall(libc_socket_trampoline_addr, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_socket_trampoline_addr uintptr //go:cgo_import_dynamic libc_socket socket "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { _, _, e1 := syscall_syscall6(libc_getsockopt_trampoline_addr, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getsockopt_trampoline_addr uintptr //go:cgo_import_dynamic libc_getsockopt getsockopt "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { _, _, e1 := syscall_syscall6(libc_setsockopt_trampoline_addr, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setsockopt_trampoline_addr uintptr //go:cgo_import_dynamic libc_setsockopt setsockopt "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := syscall_rawSyscall(libc_getpeername_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } var libc_getpeername_trampoline_addr uintptr //go:cgo_import_dynamic libc_getpeername getpeername "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := syscall_rawSyscall(libc_getsockname_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } var libc_getsockname_trampoline_addr uintptr //go:cgo_import_dynamic libc_getsockname getsockname "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(s int, how int) (err error) { _, _, e1 := syscall_syscall(libc_shutdown_trampoline_addr, uintptr(s), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_shutdown_trampoline_addr uintptr //go:cgo_import_dynamic libc_shutdown shutdown "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { _, _, e1 := syscall_rawSyscall6(libc_socketpair_trampoline_addr, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_socketpair_trampoline_addr uintptr //go:cgo_import_dynamic libc_socketpair socketpair "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall6(libc_recvfrom_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_recvfrom_trampoline_addr uintptr //go:cgo_import_dynamic libc_recvfrom recvfrom "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall6(libc_sendto_trampoline_addr, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } var libc_sendto_trampoline_addr uintptr //go:cgo_import_dynamic libc_sendto sendto "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := syscall_syscall(libc_recvmsg_trampoline_addr, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_recvmsg_trampoline_addr uintptr //go:cgo_import_dynamic libc_recvmsg recvmsg "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := syscall_syscall(libc_sendmsg_trampoline_addr, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_sendmsg_trampoline_addr uintptr //go:cgo_import_dynamic libc_sendmsg sendmsg "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) { r0, _, e1 := syscall_syscall6(libc_kevent_trampoline_addr, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_kevent_trampoline_addr uintptr //go:cgo_import_dynamic libc_kevent kevent "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, timeval *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_utimes_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_utimes_trampoline_addr uintptr //go:cgo_import_dynamic libc_utimes utimes "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func futimes(fd int, timeval *[2]Timeval) (err error) { _, _, e1 := syscall_syscall(libc_futimes_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_futimes_trampoline_addr uintptr //go:cgo_import_dynamic libc_futimes futimes "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := syscall_syscall(libc_poll_trampoline_addr, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_poll_trampoline_addr uintptr //go:cgo_import_dynamic libc_poll poll "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Madvise(b []byte, behav int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall(libc_madvise_trampoline_addr, uintptr(_p0), uintptr(len(b)), uintptr(behav)) if e1 != 0 { err = errnoErr(e1) } return } var libc_madvise_trampoline_addr uintptr //go:cgo_import_dynamic libc_madvise madvise "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall(libc_mlock_trampoline_addr, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mlock_trampoline_addr uintptr //go:cgo_import_dynamic libc_mlock mlock "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlockall(flags int) (err error) { _, _, e1 := syscall_syscall(libc_mlockall_trampoline_addr, uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mlockall_trampoline_addr uintptr //go:cgo_import_dynamic libc_mlockall mlockall "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mprotect(b []byte, prot int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall(libc_mprotect_trampoline_addr, uintptr(_p0), uintptr(len(b)), uintptr(prot)) if e1 != 0 { err = errnoErr(e1) } return } var libc_mprotect_trampoline_addr uintptr //go:cgo_import_dynamic libc_mprotect mprotect "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Msync(b []byte, flags int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall(libc_msync_trampoline_addr, uintptr(_p0), uintptr(len(b)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } var libc_msync_trampoline_addr uintptr //go:cgo_import_dynamic libc_msync msync "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall(libc_munlock_trampoline_addr, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_munlock_trampoline_addr uintptr //go:cgo_import_dynamic libc_munlock munlock "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlockall() (err error) { _, _, e1 := syscall_syscall(libc_munlockall_trampoline_addr, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_munlockall_trampoline_addr uintptr //go:cgo_import_dynamic libc_munlockall munlockall "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe2(p *[2]_C_int, flags int) (err error) { _, _, e1 := syscall_rawSyscall(libc_pipe2_trampoline_addr, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pipe2_trampoline_addr uintptr //go:cgo_import_dynamic libc_pipe2 pipe2 "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getdents(fd int, buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_getdents_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getdents_trampoline_addr uintptr //go:cgo_import_dynamic libc_getdents getdents "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getcwd(buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_getcwd_trampoline_addr, uintptr(_p0), uintptr(len(buf)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getcwd_trampoline_addr uintptr //go:cgo_import_dynamic libc_getcwd getcwd "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getresuid(ruid *_C_int, euid *_C_int, suid *_C_int) { syscall_rawSyscall(libc_getresuid_trampoline_addr, uintptr(unsafe.Pointer(ruid)), uintptr(unsafe.Pointer(euid)), uintptr(unsafe.Pointer(suid))) return } var libc_getresuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getresuid getresuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getresgid(rgid *_C_int, egid *_C_int, sgid *_C_int) { syscall_rawSyscall(libc_getresgid_trampoline_addr, uintptr(unsafe.Pointer(rgid)), uintptr(unsafe.Pointer(egid)), uintptr(unsafe.Pointer(sgid))) return } var libc_getresgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getresgid getresgid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctl(fd int, req uint, arg uintptr) (err error) { _, _, e1 := syscall_syscall(libc_ioctl_trampoline_addr, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } var libc_ioctl_trampoline_addr uintptr //go:cgo_import_dynamic libc_ioctl ioctl "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) { _, _, e1 := syscall_syscall(libc_ioctl_trampoline_addr, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { var _p0 unsafe.Pointer if len(mib) > 0 { _p0 = unsafe.Pointer(&mib[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall6(libc_sysctl_trampoline_addr, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) if e1 != 0 { err = errnoErr(e1) } return } var libc_sysctl_trampoline_addr uintptr //go:cgo_import_dynamic libc_sysctl sysctl "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fcntl(fd int, cmd int, arg int) (n int, err error) { r0, _, e1 := syscall_syscall(libc_fcntl_trampoline_addr, uintptr(fd), uintptr(cmd), uintptr(arg)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fcntl_trampoline_addr uintptr //go:cgo_import_dynamic libc_fcntl fcntl "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fcntlPtr(fd int, cmd int, arg unsafe.Pointer) (n int, err error) { r0, _, e1 := syscall_syscall(libc_fcntl_trampoline_addr, uintptr(fd), uintptr(cmd), uintptr(arg)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { r0, _, e1 := syscall_syscall6(libc_ppoll_trampoline_addr, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_ppoll_trampoline_addr uintptr //go:cgo_import_dynamic libc_ppoll ppoll "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Access(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_access_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_access_trampoline_addr uintptr //go:cgo_import_dynamic libc_access access "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Adjtime(delta *Timeval, olddelta *Timeval) (err error) { _, _, e1 := syscall_syscall(libc_adjtime_trampoline_addr, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_adjtime_trampoline_addr uintptr //go:cgo_import_dynamic libc_adjtime adjtime "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_chdir_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_chdir_trampoline_addr uintptr //go:cgo_import_dynamic libc_chdir chdir "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chflags(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_chflags_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_chflags_trampoline_addr uintptr //go:cgo_import_dynamic libc_chflags chflags "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chmod(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_chmod_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_chmod_trampoline_addr uintptr //go:cgo_import_dynamic libc_chmod chmod "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_chown_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } var libc_chown_trampoline_addr uintptr //go:cgo_import_dynamic libc_chown chown "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chroot(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_chroot_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_chroot_trampoline_addr uintptr //go:cgo_import_dynamic libc_chroot chroot "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ClockGettime(clockid int32, time *Timespec) (err error) { _, _, e1 := syscall_syscall(libc_clock_gettime_trampoline_addr, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_clock_gettime_trampoline_addr uintptr //go:cgo_import_dynamic libc_clock_gettime clock_gettime "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Close(fd int) (err error) { _, _, e1 := syscall_syscall(libc_close_trampoline_addr, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_close_trampoline_addr uintptr //go:cgo_import_dynamic libc_close close "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(fd int) (nfd int, err error) { r0, _, e1 := syscall_syscall(libc_dup_trampoline_addr, uintptr(fd), 0, 0) nfd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_dup_trampoline_addr uintptr //go:cgo_import_dynamic libc_dup dup "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup2(from int, to int) (err error) { _, _, e1 := syscall_syscall(libc_dup2_trampoline_addr, uintptr(from), uintptr(to), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_dup2_trampoline_addr uintptr //go:cgo_import_dynamic libc_dup2 dup2 "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup3(from int, to int, flags int) (err error) { _, _, e1 := syscall_syscall(libc_dup3_trampoline_addr, uintptr(from), uintptr(to), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } var libc_dup3_trampoline_addr uintptr //go:cgo_import_dynamic libc_dup3 dup3 "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Exit(code int) { syscall_syscall(libc_exit_trampoline_addr, uintptr(code), 0, 0) return } var libc_exit_trampoline_addr uintptr //go:cgo_import_dynamic libc_exit exit "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_faccessat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_faccessat_trampoline_addr uintptr //go:cgo_import_dynamic libc_faccessat faccessat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchdir(fd int) (err error) { _, _, e1 := syscall_syscall(libc_fchdir_trampoline_addr, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchdir_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchdir fchdir "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchflags(fd int, flags int) (err error) { _, _, e1 := syscall_syscall(libc_fchflags_trampoline_addr, uintptr(fd), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchflags_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchflags fchflags "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmod(fd int, mode uint32) (err error) { _, _, e1 := syscall_syscall(libc_fchmod_trampoline_addr, uintptr(fd), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchmod_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchmod fchmod "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_fchmodat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchmodat_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchmodat fchmodat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := syscall_syscall(libc_fchown_trampoline_addr, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchown_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchown fchown "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_fchownat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchownat_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchownat fchownat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Flock(fd int, how int) (err error) { _, _, e1 := syscall_syscall(libc_flock_trampoline_addr, uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_flock_trampoline_addr uintptr //go:cgo_import_dynamic libc_flock flock "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fpathconf(fd int, name int) (val int, err error) { r0, _, e1 := syscall_syscall(libc_fpathconf_trampoline_addr, uintptr(fd), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fpathconf_trampoline_addr uintptr //go:cgo_import_dynamic libc_fpathconf fpathconf "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := syscall_syscall(libc_fstat_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fstat_trampoline_addr uintptr //go:cgo_import_dynamic libc_fstat fstat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_fstatat_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fstatat_trampoline_addr uintptr //go:cgo_import_dynamic libc_fstatat fstatat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatfs(fd int, stat *Statfs_t) (err error) { _, _, e1 := syscall_syscall(libc_fstatfs_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fstatfs_trampoline_addr uintptr //go:cgo_import_dynamic libc_fstatfs fstatfs "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fsync(fd int) (err error) { _, _, e1 := syscall_syscall(libc_fsync_trampoline_addr, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fsync_trampoline_addr uintptr //go:cgo_import_dynamic libc_fsync fsync "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { _, _, e1 := syscall_syscall(libc_ftruncate_trampoline_addr, uintptr(fd), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_ftruncate_trampoline_addr uintptr //go:cgo_import_dynamic libc_ftruncate ftruncate "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { r0, _, _ := syscall_rawSyscall(libc_getegid_trampoline_addr, 0, 0, 0) egid = int(r0) return } var libc_getegid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getegid getegid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (uid int) { r0, _, _ := syscall_rawSyscall(libc_geteuid_trampoline_addr, 0, 0, 0) uid = int(r0) return } var libc_geteuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_geteuid geteuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _, _ := syscall_rawSyscall(libc_getgid_trampoline_addr, 0, 0, 0) gid = int(r0) return } var libc_getgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getgid getgid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgid(pid int) (pgid int, err error) { r0, _, e1 := syscall_rawSyscall(libc_getpgid_trampoline_addr, uintptr(pid), 0, 0) pgid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getpgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getpgid getpgid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgrp() (pgrp int) { r0, _, _ := syscall_rawSyscall(libc_getpgrp_trampoline_addr, 0, 0, 0) pgrp = int(r0) return } var libc_getpgrp_trampoline_addr uintptr //go:cgo_import_dynamic libc_getpgrp getpgrp "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpid() (pid int) { r0, _, _ := syscall_rawSyscall(libc_getpid_trampoline_addr, 0, 0, 0) pid = int(r0) return } var libc_getpid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getpid getpid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getppid() (ppid int) { r0, _, _ := syscall_rawSyscall(libc_getppid_trampoline_addr, 0, 0, 0) ppid = int(r0) return } var libc_getppid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getppid getppid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpriority(which int, who int) (prio int, err error) { r0, _, e1 := syscall_syscall(libc_getpriority_trampoline_addr, uintptr(which), uintptr(who), 0) prio = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getpriority_trampoline_addr uintptr //go:cgo_import_dynamic libc_getpriority getpriority "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(which int, lim *Rlimit) (err error) { _, _, e1 := syscall_rawSyscall(libc_getrlimit_trampoline_addr, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getrlimit_trampoline_addr uintptr //go:cgo_import_dynamic libc_getrlimit getrlimit "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrtable() (rtable int, err error) { r0, _, e1 := syscall_rawSyscall(libc_getrtable_trampoline_addr, 0, 0, 0) rtable = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getrtable_trampoline_addr uintptr //go:cgo_import_dynamic libc_getrtable getrtable "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrusage(who int, rusage *Rusage) (err error) { _, _, e1 := syscall_rawSyscall(libc_getrusage_trampoline_addr, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getrusage_trampoline_addr uintptr //go:cgo_import_dynamic libc_getrusage getrusage "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getsid(pid int) (sid int, err error) { r0, _, e1 := syscall_rawSyscall(libc_getsid_trampoline_addr, uintptr(pid), 0, 0) sid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getsid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getsid getsid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tv *Timeval) (err error) { _, _, e1 := syscall_rawSyscall(libc_gettimeofday_trampoline_addr, uintptr(unsafe.Pointer(tv)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_gettimeofday_trampoline_addr uintptr //go:cgo_import_dynamic libc_gettimeofday gettimeofday "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _, _ := syscall_rawSyscall(libc_getuid_trampoline_addr, 0, 0, 0) uid = int(r0) return } var libc_getuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getuid getuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Issetugid() (tainted bool) { r0, _, _ := syscall_syscall(libc_issetugid_trampoline_addr, 0, 0, 0) tainted = bool(r0 != 0) return } var libc_issetugid_trampoline_addr uintptr //go:cgo_import_dynamic libc_issetugid issetugid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kill(pid int, signum syscall.Signal) (err error) { _, _, e1 := syscall_syscall(libc_kill_trampoline_addr, uintptr(pid), uintptr(signum), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_kill_trampoline_addr uintptr //go:cgo_import_dynamic libc_kill kill "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kqueue() (fd int, err error) { r0, _, e1 := syscall_syscall(libc_kqueue_trampoline_addr, 0, 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_kqueue_trampoline_addr uintptr //go:cgo_import_dynamic libc_kqueue kqueue "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_lchown_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } var libc_lchown_trampoline_addr uintptr //go:cgo_import_dynamic libc_lchown lchown "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Link(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := syscall_syscall(libc_link_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_link_trampoline_addr uintptr //go:cgo_import_dynamic libc_link link "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := syscall_syscall6(libc_linkat_trampoline_addr, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_linkat_trampoline_addr uintptr //go:cgo_import_dynamic libc_linkat linkat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, backlog int) (err error) { _, _, e1 := syscall_syscall(libc_listen_trampoline_addr, uintptr(s), uintptr(backlog), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_listen_trampoline_addr uintptr //go:cgo_import_dynamic libc_listen listen "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lstat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_lstat_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_lstat_trampoline_addr uintptr //go:cgo_import_dynamic libc_lstat lstat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdir(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_mkdir_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mkdir_trampoline_addr uintptr //go:cgo_import_dynamic libc_mkdir mkdir "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdirat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_mkdirat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } var libc_mkdirat_trampoline_addr uintptr //go:cgo_import_dynamic libc_mkdirat mkdirat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifo(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_mkfifo_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mkfifo_trampoline_addr uintptr //go:cgo_import_dynamic libc_mkfifo mkfifo "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifoat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_mkfifoat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } var libc_mkfifoat_trampoline_addr uintptr //go:cgo_import_dynamic libc_mkfifoat mkfifoat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknod(path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_mknod_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) if e1 != 0 { err = errnoErr(e1) } return } var libc_mknod_trampoline_addr uintptr //go:cgo_import_dynamic libc_mknod mknod "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_mknodat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mknodat_trampoline_addr uintptr //go:cgo_import_dynamic libc_mknodat mknodat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) { var _p0 *byte _p0, err = BytePtrFromString(fsType) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(dir) if err != nil { return } _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mount_trampoline_addr uintptr //go:cgo_import_dynamic libc_mount mount "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := syscall_syscall(libc_nanosleep_trampoline_addr, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_nanosleep_trampoline_addr uintptr //go:cgo_import_dynamic libc_nanosleep nanosleep "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Open(path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := syscall_syscall(libc_open_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_open_trampoline_addr uintptr //go:cgo_import_dynamic libc_open open "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := syscall_syscall6(libc_openat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_openat_trampoline_addr uintptr //go:cgo_import_dynamic libc_openat openat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pathconf(path string, name int) (val int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := syscall_syscall(libc_pathconf_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pathconf_trampoline_addr uintptr //go:cgo_import_dynamic libc_pathconf pathconf "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall6(libc_pread_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pread_trampoline_addr uintptr //go:cgo_import_dynamic libc_pread pread "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall6(libc_pwrite_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pwrite_trampoline_addr uintptr //go:cgo_import_dynamic libc_pwrite pwrite "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func read(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_read_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_read_trampoline_addr uintptr //go:cgo_import_dynamic libc_read read "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlink(path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_readlink_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_readlink_trampoline_addr uintptr //go:cgo_import_dynamic libc_readlink readlink "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall6(libc_readlinkat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_readlinkat_trampoline_addr uintptr //go:cgo_import_dynamic libc_readlinkat readlinkat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rename(from string, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := syscall_syscall(libc_rename_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_rename_trampoline_addr uintptr //go:cgo_import_dynamic libc_rename rename "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(fromfd int, from string, tofd int, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := syscall_syscall6(libc_renameat_trampoline_addr, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_renameat_trampoline_addr uintptr //go:cgo_import_dynamic libc_renameat renameat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Revoke(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_revoke_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_revoke_trampoline_addr uintptr //go:cgo_import_dynamic libc_revoke revoke "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rmdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_rmdir_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_rmdir_trampoline_addr uintptr //go:cgo_import_dynamic libc_rmdir rmdir "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { r0, _, e1 := syscall_syscall(libc_lseek_trampoline_addr, uintptr(fd), uintptr(offset), uintptr(whence)) newoffset = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_lseek_trampoline_addr uintptr //go:cgo_import_dynamic libc_lseek lseek "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { r0, _, e1 := syscall_syscall6(libc_select_trampoline_addr, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_select_trampoline_addr uintptr //go:cgo_import_dynamic libc_select select "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setegid(egid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setegid_trampoline_addr, uintptr(egid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setegid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setegid setegid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seteuid(euid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_seteuid_trampoline_addr, uintptr(euid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_seteuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_seteuid seteuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setgid(gid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setgid_trampoline_addr, uintptr(gid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setgid setgid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setlogin(name string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(name) if err != nil { return } _, _, e1 := syscall_syscall(libc_setlogin_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setlogin_trampoline_addr uintptr //go:cgo_import_dynamic libc_setlogin setlogin "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setpgid_trampoline_addr, uintptr(pid), uintptr(pgid), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setpgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setpgid setpgid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpriority(which int, who int, prio int) (err error) { _, _, e1 := syscall_syscall(libc_setpriority_trampoline_addr, uintptr(which), uintptr(who), uintptr(prio)) if e1 != 0 { err = errnoErr(e1) } return } var libc_setpriority_trampoline_addr uintptr //go:cgo_import_dynamic libc_setpriority setpriority "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setregid(rgid int, egid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setregid_trampoline_addr, uintptr(rgid), uintptr(egid), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setregid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setregid setregid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setreuid(ruid int, euid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setreuid_trampoline_addr, uintptr(ruid), uintptr(euid), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setreuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setreuid setreuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresgid(rgid int, egid int, sgid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setresgid_trampoline_addr, uintptr(rgid), uintptr(egid), uintptr(sgid)) if e1 != 0 { err = errnoErr(e1) } return } var libc_setresgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setresgid setresgid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresuid(ruid int, euid int, suid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setresuid_trampoline_addr, uintptr(ruid), uintptr(euid), uintptr(suid)) if e1 != 0 { err = errnoErr(e1) } return } var libc_setresuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setresuid setresuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setrtable(rtable int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setrtable_trampoline_addr, uintptr(rtable), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setrtable_trampoline_addr uintptr //go:cgo_import_dynamic libc_setrtable setrtable "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, err error) { r0, _, e1 := syscall_rawSyscall(libc_setsid_trampoline_addr, 0, 0, 0) pid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setsid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setsid setsid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Settimeofday(tp *Timeval) (err error) { _, _, e1 := syscall_rawSyscall(libc_settimeofday_trampoline_addr, uintptr(unsafe.Pointer(tp)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_settimeofday_trampoline_addr uintptr //go:cgo_import_dynamic libc_settimeofday settimeofday "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setuid(uid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setuid_trampoline_addr, uintptr(uid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setuid setuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Stat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_stat_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_stat_trampoline_addr uintptr //go:cgo_import_dynamic libc_stat stat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Statfs(path string, stat *Statfs_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_statfs_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_statfs_trampoline_addr uintptr //go:cgo_import_dynamic libc_statfs statfs "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlink(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := syscall_syscall(libc_symlink_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_symlink_trampoline_addr uintptr //go:cgo_import_dynamic libc_symlink symlink "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := syscall_syscall(libc_symlinkat_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } var libc_symlinkat_trampoline_addr uintptr //go:cgo_import_dynamic libc_symlinkat symlinkat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sync() (err error) { _, _, e1 := syscall_syscall(libc_sync_trampoline_addr, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_sync_trampoline_addr uintptr //go:cgo_import_dynamic libc_sync sync "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_truncate_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_truncate_trampoline_addr uintptr //go:cgo_import_dynamic libc_truncate truncate "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Umask(newmask int) (oldmask int) { r0, _, _ := syscall_syscall(libc_umask_trampoline_addr, uintptr(newmask), 0, 0) oldmask = int(r0) return } var libc_umask_trampoline_addr uintptr //go:cgo_import_dynamic libc_umask umask "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlink(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_unlink_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_unlink_trampoline_addr uintptr //go:cgo_import_dynamic libc_unlink unlink "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlinkat(dirfd int, path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_unlinkat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } var libc_unlinkat_trampoline_addr uintptr //go:cgo_import_dynamic libc_unlinkat unlinkat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unmount(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_unmount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_unmount_trampoline_addr uintptr //go:cgo_import_dynamic libc_unmount unmount "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func write(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_write_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_write_trampoline_addr uintptr //go:cgo_import_dynamic libc_write write "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { r0, _, e1 := syscall_syscall6(libc_mmap_trampoline_addr, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos)) ret = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mmap_trampoline_addr uintptr //go:cgo_import_dynamic libc_mmap mmap "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func munmap(addr uintptr, length uintptr) (err error) { _, _, e1 := syscall_syscall(libc_munmap_trampoline_addr, uintptr(addr), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_munmap_trampoline_addr uintptr //go:cgo_import_dynamic libc_munmap munmap "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getfsstat(stat *Statfs_t, bufsize uintptr, flags int) (n int, err error) { r0, _, e1 := syscall_syscall(libc_getfsstat_trampoline_addr, uintptr(unsafe.Pointer(stat)), uintptr(bufsize), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getfsstat_trampoline_addr uintptr //go:cgo_import_dynamic libc_getfsstat getfsstat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_utimensat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_utimensat_trampoline_addr uintptr //go:cgo_import_dynamic libc_utimensat utimensat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pledge(promises *byte, execpromises *byte) (err error) { _, _, e1 := syscall_syscall(libc_pledge_trampoline_addr, uintptr(unsafe.Pointer(promises)), uintptr(unsafe.Pointer(execpromises)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pledge_trampoline_addr uintptr //go:cgo_import_dynamic libc_pledge pledge "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func unveil(path *byte, flags *byte) (err error) { _, _, e1 := syscall_syscall(libc_unveil_trampoline_addr, uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(flags)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_unveil_trampoline_addr uintptr //go:cgo_import_dynamic libc_unveil unveil "libc.so" ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s ================================================ // go run mkasm.go openbsd amd64 // Code generated by the command above; DO NOT EDIT. #include "textflag.h" TEXT libc_getgroups_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getgroups(SB) GLOBL ·libc_getgroups_trampoline_addr(SB), RODATA, $8 DATA ·libc_getgroups_trampoline_addr(SB)/8, $libc_getgroups_trampoline<>(SB) TEXT libc_setgroups_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setgroups(SB) GLOBL ·libc_setgroups_trampoline_addr(SB), RODATA, $8 DATA ·libc_setgroups_trampoline_addr(SB)/8, $libc_setgroups_trampoline<>(SB) TEXT libc_wait4_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_wait4(SB) GLOBL ·libc_wait4_trampoline_addr(SB), RODATA, $8 DATA ·libc_wait4_trampoline_addr(SB)/8, $libc_wait4_trampoline<>(SB) TEXT libc_accept_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_accept(SB) GLOBL ·libc_accept_trampoline_addr(SB), RODATA, $8 DATA ·libc_accept_trampoline_addr(SB)/8, $libc_accept_trampoline<>(SB) TEXT libc_bind_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_bind(SB) GLOBL ·libc_bind_trampoline_addr(SB), RODATA, $8 DATA ·libc_bind_trampoline_addr(SB)/8, $libc_bind_trampoline<>(SB) TEXT libc_connect_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_connect(SB) GLOBL ·libc_connect_trampoline_addr(SB), RODATA, $8 DATA ·libc_connect_trampoline_addr(SB)/8, $libc_connect_trampoline<>(SB) TEXT libc_socket_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_socket(SB) GLOBL ·libc_socket_trampoline_addr(SB), RODATA, $8 DATA ·libc_socket_trampoline_addr(SB)/8, $libc_socket_trampoline<>(SB) TEXT libc_getsockopt_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getsockopt(SB) GLOBL ·libc_getsockopt_trampoline_addr(SB), RODATA, $8 DATA ·libc_getsockopt_trampoline_addr(SB)/8, $libc_getsockopt_trampoline<>(SB) TEXT libc_setsockopt_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setsockopt(SB) GLOBL ·libc_setsockopt_trampoline_addr(SB), RODATA, $8 DATA ·libc_setsockopt_trampoline_addr(SB)/8, $libc_setsockopt_trampoline<>(SB) TEXT libc_getpeername_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpeername(SB) GLOBL ·libc_getpeername_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpeername_trampoline_addr(SB)/8, $libc_getpeername_trampoline<>(SB) TEXT libc_getsockname_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getsockname(SB) GLOBL ·libc_getsockname_trampoline_addr(SB), RODATA, $8 DATA ·libc_getsockname_trampoline_addr(SB)/8, $libc_getsockname_trampoline<>(SB) TEXT libc_shutdown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_shutdown(SB) GLOBL ·libc_shutdown_trampoline_addr(SB), RODATA, $8 DATA ·libc_shutdown_trampoline_addr(SB)/8, $libc_shutdown_trampoline<>(SB) TEXT libc_socketpair_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_socketpair(SB) GLOBL ·libc_socketpair_trampoline_addr(SB), RODATA, $8 DATA ·libc_socketpair_trampoline_addr(SB)/8, $libc_socketpair_trampoline<>(SB) TEXT libc_recvfrom_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_recvfrom(SB) GLOBL ·libc_recvfrom_trampoline_addr(SB), RODATA, $8 DATA ·libc_recvfrom_trampoline_addr(SB)/8, $libc_recvfrom_trampoline<>(SB) TEXT libc_sendto_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sendto(SB) GLOBL ·libc_sendto_trampoline_addr(SB), RODATA, $8 DATA ·libc_sendto_trampoline_addr(SB)/8, $libc_sendto_trampoline<>(SB) TEXT libc_recvmsg_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_recvmsg(SB) GLOBL ·libc_recvmsg_trampoline_addr(SB), RODATA, $8 DATA ·libc_recvmsg_trampoline_addr(SB)/8, $libc_recvmsg_trampoline<>(SB) TEXT libc_sendmsg_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sendmsg(SB) GLOBL ·libc_sendmsg_trampoline_addr(SB), RODATA, $8 DATA ·libc_sendmsg_trampoline_addr(SB)/8, $libc_sendmsg_trampoline<>(SB) TEXT libc_kevent_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_kevent(SB) GLOBL ·libc_kevent_trampoline_addr(SB), RODATA, $8 DATA ·libc_kevent_trampoline_addr(SB)/8, $libc_kevent_trampoline<>(SB) TEXT libc_utimes_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_utimes(SB) GLOBL ·libc_utimes_trampoline_addr(SB), RODATA, $8 DATA ·libc_utimes_trampoline_addr(SB)/8, $libc_utimes_trampoline<>(SB) TEXT libc_futimes_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_futimes(SB) GLOBL ·libc_futimes_trampoline_addr(SB), RODATA, $8 DATA ·libc_futimes_trampoline_addr(SB)/8, $libc_futimes_trampoline<>(SB) TEXT libc_poll_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_poll(SB) GLOBL ·libc_poll_trampoline_addr(SB), RODATA, $8 DATA ·libc_poll_trampoline_addr(SB)/8, $libc_poll_trampoline<>(SB) TEXT libc_madvise_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_madvise(SB) GLOBL ·libc_madvise_trampoline_addr(SB), RODATA, $8 DATA ·libc_madvise_trampoline_addr(SB)/8, $libc_madvise_trampoline<>(SB) TEXT libc_mlock_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mlock(SB) GLOBL ·libc_mlock_trampoline_addr(SB), RODATA, $8 DATA ·libc_mlock_trampoline_addr(SB)/8, $libc_mlock_trampoline<>(SB) TEXT libc_mlockall_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mlockall(SB) GLOBL ·libc_mlockall_trampoline_addr(SB), RODATA, $8 DATA ·libc_mlockall_trampoline_addr(SB)/8, $libc_mlockall_trampoline<>(SB) TEXT libc_mprotect_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mprotect(SB) GLOBL ·libc_mprotect_trampoline_addr(SB), RODATA, $8 DATA ·libc_mprotect_trampoline_addr(SB)/8, $libc_mprotect_trampoline<>(SB) TEXT libc_msync_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_msync(SB) GLOBL ·libc_msync_trampoline_addr(SB), RODATA, $8 DATA ·libc_msync_trampoline_addr(SB)/8, $libc_msync_trampoline<>(SB) TEXT libc_munlock_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_munlock(SB) GLOBL ·libc_munlock_trampoline_addr(SB), RODATA, $8 DATA ·libc_munlock_trampoline_addr(SB)/8, $libc_munlock_trampoline<>(SB) TEXT libc_munlockall_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_munlockall(SB) GLOBL ·libc_munlockall_trampoline_addr(SB), RODATA, $8 DATA ·libc_munlockall_trampoline_addr(SB)/8, $libc_munlockall_trampoline<>(SB) TEXT libc_pipe2_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pipe2(SB) GLOBL ·libc_pipe2_trampoline_addr(SB), RODATA, $8 DATA ·libc_pipe2_trampoline_addr(SB)/8, $libc_pipe2_trampoline<>(SB) TEXT libc_getdents_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getdents(SB) GLOBL ·libc_getdents_trampoline_addr(SB), RODATA, $8 DATA ·libc_getdents_trampoline_addr(SB)/8, $libc_getdents_trampoline<>(SB) TEXT libc_getcwd_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getcwd(SB) GLOBL ·libc_getcwd_trampoline_addr(SB), RODATA, $8 DATA ·libc_getcwd_trampoline_addr(SB)/8, $libc_getcwd_trampoline<>(SB) TEXT libc_getresuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getresuid(SB) GLOBL ·libc_getresuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getresuid_trampoline_addr(SB)/8, $libc_getresuid_trampoline<>(SB) TEXT libc_getresgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getresgid(SB) GLOBL ·libc_getresgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getresgid_trampoline_addr(SB)/8, $libc_getresgid_trampoline<>(SB) TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ioctl(SB) GLOBL ·libc_ioctl_trampoline_addr(SB), RODATA, $8 DATA ·libc_ioctl_trampoline_addr(SB)/8, $libc_ioctl_trampoline<>(SB) TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sysctl(SB) GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8 DATA ·libc_sysctl_trampoline_addr(SB)/8, $libc_sysctl_trampoline<>(SB) TEXT libc_fcntl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fcntl(SB) GLOBL ·libc_fcntl_trampoline_addr(SB), RODATA, $8 DATA ·libc_fcntl_trampoline_addr(SB)/8, $libc_fcntl_trampoline<>(SB) TEXT libc_ppoll_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ppoll(SB) GLOBL ·libc_ppoll_trampoline_addr(SB), RODATA, $8 DATA ·libc_ppoll_trampoline_addr(SB)/8, $libc_ppoll_trampoline<>(SB) TEXT libc_access_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_access(SB) GLOBL ·libc_access_trampoline_addr(SB), RODATA, $8 DATA ·libc_access_trampoline_addr(SB)/8, $libc_access_trampoline<>(SB) TEXT libc_adjtime_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_adjtime(SB) GLOBL ·libc_adjtime_trampoline_addr(SB), RODATA, $8 DATA ·libc_adjtime_trampoline_addr(SB)/8, $libc_adjtime_trampoline<>(SB) TEXT libc_chdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chdir(SB) GLOBL ·libc_chdir_trampoline_addr(SB), RODATA, $8 DATA ·libc_chdir_trampoline_addr(SB)/8, $libc_chdir_trampoline<>(SB) TEXT libc_chflags_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chflags(SB) GLOBL ·libc_chflags_trampoline_addr(SB), RODATA, $8 DATA ·libc_chflags_trampoline_addr(SB)/8, $libc_chflags_trampoline<>(SB) TEXT libc_chmod_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chmod(SB) GLOBL ·libc_chmod_trampoline_addr(SB), RODATA, $8 DATA ·libc_chmod_trampoline_addr(SB)/8, $libc_chmod_trampoline<>(SB) TEXT libc_chown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chown(SB) GLOBL ·libc_chown_trampoline_addr(SB), RODATA, $8 DATA ·libc_chown_trampoline_addr(SB)/8, $libc_chown_trampoline<>(SB) TEXT libc_chroot_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chroot(SB) GLOBL ·libc_chroot_trampoline_addr(SB), RODATA, $8 DATA ·libc_chroot_trampoline_addr(SB)/8, $libc_chroot_trampoline<>(SB) TEXT libc_clock_gettime_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_clock_gettime(SB) GLOBL ·libc_clock_gettime_trampoline_addr(SB), RODATA, $8 DATA ·libc_clock_gettime_trampoline_addr(SB)/8, $libc_clock_gettime_trampoline<>(SB) TEXT libc_close_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_close(SB) GLOBL ·libc_close_trampoline_addr(SB), RODATA, $8 DATA ·libc_close_trampoline_addr(SB)/8, $libc_close_trampoline<>(SB) TEXT libc_dup_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_dup(SB) GLOBL ·libc_dup_trampoline_addr(SB), RODATA, $8 DATA ·libc_dup_trampoline_addr(SB)/8, $libc_dup_trampoline<>(SB) TEXT libc_dup2_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_dup2(SB) GLOBL ·libc_dup2_trampoline_addr(SB), RODATA, $8 DATA ·libc_dup2_trampoline_addr(SB)/8, $libc_dup2_trampoline<>(SB) TEXT libc_dup3_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_dup3(SB) GLOBL ·libc_dup3_trampoline_addr(SB), RODATA, $8 DATA ·libc_dup3_trampoline_addr(SB)/8, $libc_dup3_trampoline<>(SB) TEXT libc_exit_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_exit(SB) GLOBL ·libc_exit_trampoline_addr(SB), RODATA, $8 DATA ·libc_exit_trampoline_addr(SB)/8, $libc_exit_trampoline<>(SB) TEXT libc_faccessat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_faccessat(SB) GLOBL ·libc_faccessat_trampoline_addr(SB), RODATA, $8 DATA ·libc_faccessat_trampoline_addr(SB)/8, $libc_faccessat_trampoline<>(SB) TEXT libc_fchdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchdir(SB) GLOBL ·libc_fchdir_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchdir_trampoline_addr(SB)/8, $libc_fchdir_trampoline<>(SB) TEXT libc_fchflags_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchflags(SB) GLOBL ·libc_fchflags_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchflags_trampoline_addr(SB)/8, $libc_fchflags_trampoline<>(SB) TEXT libc_fchmod_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchmod(SB) GLOBL ·libc_fchmod_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchmod_trampoline_addr(SB)/8, $libc_fchmod_trampoline<>(SB) TEXT libc_fchmodat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchmodat(SB) GLOBL ·libc_fchmodat_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchmodat_trampoline_addr(SB)/8, $libc_fchmodat_trampoline<>(SB) TEXT libc_fchown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchown(SB) GLOBL ·libc_fchown_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchown_trampoline_addr(SB)/8, $libc_fchown_trampoline<>(SB) TEXT libc_fchownat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchownat(SB) GLOBL ·libc_fchownat_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchownat_trampoline_addr(SB)/8, $libc_fchownat_trampoline<>(SB) TEXT libc_flock_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_flock(SB) GLOBL ·libc_flock_trampoline_addr(SB), RODATA, $8 DATA ·libc_flock_trampoline_addr(SB)/8, $libc_flock_trampoline<>(SB) TEXT libc_fpathconf_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fpathconf(SB) GLOBL ·libc_fpathconf_trampoline_addr(SB), RODATA, $8 DATA ·libc_fpathconf_trampoline_addr(SB)/8, $libc_fpathconf_trampoline<>(SB) TEXT libc_fstat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fstat(SB) GLOBL ·libc_fstat_trampoline_addr(SB), RODATA, $8 DATA ·libc_fstat_trampoline_addr(SB)/8, $libc_fstat_trampoline<>(SB) TEXT libc_fstatat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fstatat(SB) GLOBL ·libc_fstatat_trampoline_addr(SB), RODATA, $8 DATA ·libc_fstatat_trampoline_addr(SB)/8, $libc_fstatat_trampoline<>(SB) TEXT libc_fstatfs_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fstatfs(SB) GLOBL ·libc_fstatfs_trampoline_addr(SB), RODATA, $8 DATA ·libc_fstatfs_trampoline_addr(SB)/8, $libc_fstatfs_trampoline<>(SB) TEXT libc_fsync_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fsync(SB) GLOBL ·libc_fsync_trampoline_addr(SB), RODATA, $8 DATA ·libc_fsync_trampoline_addr(SB)/8, $libc_fsync_trampoline<>(SB) TEXT libc_ftruncate_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ftruncate(SB) GLOBL ·libc_ftruncate_trampoline_addr(SB), RODATA, $8 DATA ·libc_ftruncate_trampoline_addr(SB)/8, $libc_ftruncate_trampoline<>(SB) TEXT libc_getegid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getegid(SB) GLOBL ·libc_getegid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getegid_trampoline_addr(SB)/8, $libc_getegid_trampoline<>(SB) TEXT libc_geteuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_geteuid(SB) GLOBL ·libc_geteuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_geteuid_trampoline_addr(SB)/8, $libc_geteuid_trampoline<>(SB) TEXT libc_getgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getgid(SB) GLOBL ·libc_getgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getgid_trampoline_addr(SB)/8, $libc_getgid_trampoline<>(SB) TEXT libc_getpgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpgid(SB) GLOBL ·libc_getpgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpgid_trampoline_addr(SB)/8, $libc_getpgid_trampoline<>(SB) TEXT libc_getpgrp_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpgrp(SB) GLOBL ·libc_getpgrp_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpgrp_trampoline_addr(SB)/8, $libc_getpgrp_trampoline<>(SB) TEXT libc_getpid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpid(SB) GLOBL ·libc_getpid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpid_trampoline_addr(SB)/8, $libc_getpid_trampoline<>(SB) TEXT libc_getppid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getppid(SB) GLOBL ·libc_getppid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getppid_trampoline_addr(SB)/8, $libc_getppid_trampoline<>(SB) TEXT libc_getpriority_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpriority(SB) GLOBL ·libc_getpriority_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpriority_trampoline_addr(SB)/8, $libc_getpriority_trampoline<>(SB) TEXT libc_getrlimit_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getrlimit(SB) GLOBL ·libc_getrlimit_trampoline_addr(SB), RODATA, $8 DATA ·libc_getrlimit_trampoline_addr(SB)/8, $libc_getrlimit_trampoline<>(SB) TEXT libc_getrtable_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getrtable(SB) GLOBL ·libc_getrtable_trampoline_addr(SB), RODATA, $8 DATA ·libc_getrtable_trampoline_addr(SB)/8, $libc_getrtable_trampoline<>(SB) TEXT libc_getrusage_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getrusage(SB) GLOBL ·libc_getrusage_trampoline_addr(SB), RODATA, $8 DATA ·libc_getrusage_trampoline_addr(SB)/8, $libc_getrusage_trampoline<>(SB) TEXT libc_getsid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getsid(SB) GLOBL ·libc_getsid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getsid_trampoline_addr(SB)/8, $libc_getsid_trampoline<>(SB) TEXT libc_gettimeofday_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_gettimeofday(SB) GLOBL ·libc_gettimeofday_trampoline_addr(SB), RODATA, $8 DATA ·libc_gettimeofday_trampoline_addr(SB)/8, $libc_gettimeofday_trampoline<>(SB) TEXT libc_getuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getuid(SB) GLOBL ·libc_getuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getuid_trampoline_addr(SB)/8, $libc_getuid_trampoline<>(SB) TEXT libc_issetugid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_issetugid(SB) GLOBL ·libc_issetugid_trampoline_addr(SB), RODATA, $8 DATA ·libc_issetugid_trampoline_addr(SB)/8, $libc_issetugid_trampoline<>(SB) TEXT libc_kill_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_kill(SB) GLOBL ·libc_kill_trampoline_addr(SB), RODATA, $8 DATA ·libc_kill_trampoline_addr(SB)/8, $libc_kill_trampoline<>(SB) TEXT libc_kqueue_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_kqueue(SB) GLOBL ·libc_kqueue_trampoline_addr(SB), RODATA, $8 DATA ·libc_kqueue_trampoline_addr(SB)/8, $libc_kqueue_trampoline<>(SB) TEXT libc_lchown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_lchown(SB) GLOBL ·libc_lchown_trampoline_addr(SB), RODATA, $8 DATA ·libc_lchown_trampoline_addr(SB)/8, $libc_lchown_trampoline<>(SB) TEXT libc_link_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_link(SB) GLOBL ·libc_link_trampoline_addr(SB), RODATA, $8 DATA ·libc_link_trampoline_addr(SB)/8, $libc_link_trampoline<>(SB) TEXT libc_linkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_linkat(SB) GLOBL ·libc_linkat_trampoline_addr(SB), RODATA, $8 DATA ·libc_linkat_trampoline_addr(SB)/8, $libc_linkat_trampoline<>(SB) TEXT libc_listen_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_listen(SB) GLOBL ·libc_listen_trampoline_addr(SB), RODATA, $8 DATA ·libc_listen_trampoline_addr(SB)/8, $libc_listen_trampoline<>(SB) TEXT libc_lstat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_lstat(SB) GLOBL ·libc_lstat_trampoline_addr(SB), RODATA, $8 DATA ·libc_lstat_trampoline_addr(SB)/8, $libc_lstat_trampoline<>(SB) TEXT libc_mkdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkdir(SB) GLOBL ·libc_mkdir_trampoline_addr(SB), RODATA, $8 DATA ·libc_mkdir_trampoline_addr(SB)/8, $libc_mkdir_trampoline<>(SB) TEXT libc_mkdirat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkdirat(SB) GLOBL ·libc_mkdirat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mkdirat_trampoline_addr(SB)/8, $libc_mkdirat_trampoline<>(SB) TEXT libc_mkfifo_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkfifo(SB) GLOBL ·libc_mkfifo_trampoline_addr(SB), RODATA, $8 DATA ·libc_mkfifo_trampoline_addr(SB)/8, $libc_mkfifo_trampoline<>(SB) TEXT libc_mkfifoat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkfifoat(SB) GLOBL ·libc_mkfifoat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mkfifoat_trampoline_addr(SB)/8, $libc_mkfifoat_trampoline<>(SB) TEXT libc_mknod_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mknod(SB) GLOBL ·libc_mknod_trampoline_addr(SB), RODATA, $8 DATA ·libc_mknod_trampoline_addr(SB)/8, $libc_mknod_trampoline<>(SB) TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mknodat(SB) GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mknodat_trampoline_addr(SB)/8, $libc_mknodat_trampoline<>(SB) TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mount(SB) GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $8 DATA ·libc_mount_trampoline_addr(SB)/8, $libc_mount_trampoline<>(SB) TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_nanosleep(SB) GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $8 DATA ·libc_nanosleep_trampoline_addr(SB)/8, $libc_nanosleep_trampoline<>(SB) TEXT libc_open_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_open(SB) GLOBL ·libc_open_trampoline_addr(SB), RODATA, $8 DATA ·libc_open_trampoline_addr(SB)/8, $libc_open_trampoline<>(SB) TEXT libc_openat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_openat(SB) GLOBL ·libc_openat_trampoline_addr(SB), RODATA, $8 DATA ·libc_openat_trampoline_addr(SB)/8, $libc_openat_trampoline<>(SB) TEXT libc_pathconf_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pathconf(SB) GLOBL ·libc_pathconf_trampoline_addr(SB), RODATA, $8 DATA ·libc_pathconf_trampoline_addr(SB)/8, $libc_pathconf_trampoline<>(SB) TEXT libc_pread_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pread(SB) GLOBL ·libc_pread_trampoline_addr(SB), RODATA, $8 DATA ·libc_pread_trampoline_addr(SB)/8, $libc_pread_trampoline<>(SB) TEXT libc_pwrite_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pwrite(SB) GLOBL ·libc_pwrite_trampoline_addr(SB), RODATA, $8 DATA ·libc_pwrite_trampoline_addr(SB)/8, $libc_pwrite_trampoline<>(SB) TEXT libc_read_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_read(SB) GLOBL ·libc_read_trampoline_addr(SB), RODATA, $8 DATA ·libc_read_trampoline_addr(SB)/8, $libc_read_trampoline<>(SB) TEXT libc_readlink_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_readlink(SB) GLOBL ·libc_readlink_trampoline_addr(SB), RODATA, $8 DATA ·libc_readlink_trampoline_addr(SB)/8, $libc_readlink_trampoline<>(SB) TEXT libc_readlinkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_readlinkat(SB) GLOBL ·libc_readlinkat_trampoline_addr(SB), RODATA, $8 DATA ·libc_readlinkat_trampoline_addr(SB)/8, $libc_readlinkat_trampoline<>(SB) TEXT libc_rename_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_rename(SB) GLOBL ·libc_rename_trampoline_addr(SB), RODATA, $8 DATA ·libc_rename_trampoline_addr(SB)/8, $libc_rename_trampoline<>(SB) TEXT libc_renameat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_renameat(SB) GLOBL ·libc_renameat_trampoline_addr(SB), RODATA, $8 DATA ·libc_renameat_trampoline_addr(SB)/8, $libc_renameat_trampoline<>(SB) TEXT libc_revoke_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_revoke(SB) GLOBL ·libc_revoke_trampoline_addr(SB), RODATA, $8 DATA ·libc_revoke_trampoline_addr(SB)/8, $libc_revoke_trampoline<>(SB) TEXT libc_rmdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_rmdir(SB) GLOBL ·libc_rmdir_trampoline_addr(SB), RODATA, $8 DATA ·libc_rmdir_trampoline_addr(SB)/8, $libc_rmdir_trampoline<>(SB) TEXT libc_lseek_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_lseek(SB) GLOBL ·libc_lseek_trampoline_addr(SB), RODATA, $8 DATA ·libc_lseek_trampoline_addr(SB)/8, $libc_lseek_trampoline<>(SB) TEXT libc_select_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_select(SB) GLOBL ·libc_select_trampoline_addr(SB), RODATA, $8 DATA ·libc_select_trampoline_addr(SB)/8, $libc_select_trampoline<>(SB) TEXT libc_setegid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setegid(SB) GLOBL ·libc_setegid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setegid_trampoline_addr(SB)/8, $libc_setegid_trampoline<>(SB) TEXT libc_seteuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_seteuid(SB) GLOBL ·libc_seteuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_seteuid_trampoline_addr(SB)/8, $libc_seteuid_trampoline<>(SB) TEXT libc_setgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setgid(SB) GLOBL ·libc_setgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setgid_trampoline_addr(SB)/8, $libc_setgid_trampoline<>(SB) TEXT libc_setlogin_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setlogin(SB) GLOBL ·libc_setlogin_trampoline_addr(SB), RODATA, $8 DATA ·libc_setlogin_trampoline_addr(SB)/8, $libc_setlogin_trampoline<>(SB) TEXT libc_setpgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setpgid(SB) GLOBL ·libc_setpgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setpgid_trampoline_addr(SB)/8, $libc_setpgid_trampoline<>(SB) TEXT libc_setpriority_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setpriority(SB) GLOBL ·libc_setpriority_trampoline_addr(SB), RODATA, $8 DATA ·libc_setpriority_trampoline_addr(SB)/8, $libc_setpriority_trampoline<>(SB) TEXT libc_setregid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setregid(SB) GLOBL ·libc_setregid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setregid_trampoline_addr(SB)/8, $libc_setregid_trampoline<>(SB) TEXT libc_setreuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setreuid(SB) GLOBL ·libc_setreuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setreuid_trampoline_addr(SB)/8, $libc_setreuid_trampoline<>(SB) TEXT libc_setresgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setresgid(SB) GLOBL ·libc_setresgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setresgid_trampoline_addr(SB)/8, $libc_setresgid_trampoline<>(SB) TEXT libc_setresuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setresuid(SB) GLOBL ·libc_setresuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setresuid_trampoline_addr(SB)/8, $libc_setresuid_trampoline<>(SB) TEXT libc_setrtable_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setrtable(SB) GLOBL ·libc_setrtable_trampoline_addr(SB), RODATA, $8 DATA ·libc_setrtable_trampoline_addr(SB)/8, $libc_setrtable_trampoline<>(SB) TEXT libc_setsid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setsid(SB) GLOBL ·libc_setsid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setsid_trampoline_addr(SB)/8, $libc_setsid_trampoline<>(SB) TEXT libc_settimeofday_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_settimeofday(SB) GLOBL ·libc_settimeofday_trampoline_addr(SB), RODATA, $8 DATA ·libc_settimeofday_trampoline_addr(SB)/8, $libc_settimeofday_trampoline<>(SB) TEXT libc_setuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setuid(SB) GLOBL ·libc_setuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setuid_trampoline_addr(SB)/8, $libc_setuid_trampoline<>(SB) TEXT libc_stat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_stat(SB) GLOBL ·libc_stat_trampoline_addr(SB), RODATA, $8 DATA ·libc_stat_trampoline_addr(SB)/8, $libc_stat_trampoline<>(SB) TEXT libc_statfs_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_statfs(SB) GLOBL ·libc_statfs_trampoline_addr(SB), RODATA, $8 DATA ·libc_statfs_trampoline_addr(SB)/8, $libc_statfs_trampoline<>(SB) TEXT libc_symlink_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_symlink(SB) GLOBL ·libc_symlink_trampoline_addr(SB), RODATA, $8 DATA ·libc_symlink_trampoline_addr(SB)/8, $libc_symlink_trampoline<>(SB) TEXT libc_symlinkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_symlinkat(SB) GLOBL ·libc_symlinkat_trampoline_addr(SB), RODATA, $8 DATA ·libc_symlinkat_trampoline_addr(SB)/8, $libc_symlinkat_trampoline<>(SB) TEXT libc_sync_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sync(SB) GLOBL ·libc_sync_trampoline_addr(SB), RODATA, $8 DATA ·libc_sync_trampoline_addr(SB)/8, $libc_sync_trampoline<>(SB) TEXT libc_truncate_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_truncate(SB) GLOBL ·libc_truncate_trampoline_addr(SB), RODATA, $8 DATA ·libc_truncate_trampoline_addr(SB)/8, $libc_truncate_trampoline<>(SB) TEXT libc_umask_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_umask(SB) GLOBL ·libc_umask_trampoline_addr(SB), RODATA, $8 DATA ·libc_umask_trampoline_addr(SB)/8, $libc_umask_trampoline<>(SB) TEXT libc_unlink_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_unlink(SB) GLOBL ·libc_unlink_trampoline_addr(SB), RODATA, $8 DATA ·libc_unlink_trampoline_addr(SB)/8, $libc_unlink_trampoline<>(SB) TEXT libc_unlinkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_unlinkat(SB) GLOBL ·libc_unlinkat_trampoline_addr(SB), RODATA, $8 DATA ·libc_unlinkat_trampoline_addr(SB)/8, $libc_unlinkat_trampoline<>(SB) TEXT libc_unmount_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_unmount(SB) GLOBL ·libc_unmount_trampoline_addr(SB), RODATA, $8 DATA ·libc_unmount_trampoline_addr(SB)/8, $libc_unmount_trampoline<>(SB) TEXT libc_write_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_write(SB) GLOBL ·libc_write_trampoline_addr(SB), RODATA, $8 DATA ·libc_write_trampoline_addr(SB)/8, $libc_write_trampoline<>(SB) TEXT libc_mmap_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mmap(SB) GLOBL ·libc_mmap_trampoline_addr(SB), RODATA, $8 DATA ·libc_mmap_trampoline_addr(SB)/8, $libc_mmap_trampoline<>(SB) TEXT libc_munmap_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_munmap(SB) GLOBL ·libc_munmap_trampoline_addr(SB), RODATA, $8 DATA ·libc_munmap_trampoline_addr(SB)/8, $libc_munmap_trampoline<>(SB) TEXT libc_getfsstat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getfsstat(SB) GLOBL ·libc_getfsstat_trampoline_addr(SB), RODATA, $8 DATA ·libc_getfsstat_trampoline_addr(SB)/8, $libc_getfsstat_trampoline<>(SB) TEXT libc_utimensat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_utimensat(SB) GLOBL ·libc_utimensat_trampoline_addr(SB), RODATA, $8 DATA ·libc_utimensat_trampoline_addr(SB)/8, $libc_utimensat_trampoline<>(SB) TEXT libc_pledge_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pledge(SB) GLOBL ·libc_pledge_trampoline_addr(SB), RODATA, $8 DATA ·libc_pledge_trampoline_addr(SB)/8, $libc_pledge_trampoline<>(SB) TEXT libc_unveil_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_unveil(SB) GLOBL ·libc_unveil_trampoline_addr(SB), RODATA, $8 DATA ·libc_unveil_trampoline_addr(SB)/8, $libc_unveil_trampoline<>(SB) ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go ================================================ // go run mksyscall.go -l32 -openbsd -arm -libc -tags openbsd,arm syscall_bsd.go syscall_openbsd.go syscall_openbsd_arm.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build openbsd && arm package unix import ( "syscall" "unsafe" ) var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(ngid int, gid *_Gid_t) (n int, err error) { r0, _, e1 := syscall_rawSyscall(libc_getgroups_trampoline_addr, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getgroups_trampoline_addr uintptr //go:cgo_import_dynamic libc_getgroups getgroups "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(ngid int, gid *_Gid_t) (err error) { _, _, e1 := syscall_rawSyscall(libc_setgroups_trampoline_addr, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setgroups_trampoline_addr uintptr //go:cgo_import_dynamic libc_setgroups setgroups "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) { r0, _, e1 := syscall_syscall6(libc_wait4_trampoline_addr, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) wpid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_wait4_trampoline_addr uintptr //go:cgo_import_dynamic libc_wait4 wait4 "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { r0, _, e1 := syscall_syscall(libc_accept_trampoline_addr, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_accept_trampoline_addr uintptr //go:cgo_import_dynamic libc_accept accept "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := syscall_syscall(libc_bind_trampoline_addr, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } var libc_bind_trampoline_addr uintptr //go:cgo_import_dynamic libc_bind bind "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := syscall_syscall(libc_connect_trampoline_addr, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } var libc_connect_trampoline_addr uintptr //go:cgo_import_dynamic libc_connect connect "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { r0, _, e1 := syscall_rawSyscall(libc_socket_trampoline_addr, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_socket_trampoline_addr uintptr //go:cgo_import_dynamic libc_socket socket "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { _, _, e1 := syscall_syscall6(libc_getsockopt_trampoline_addr, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getsockopt_trampoline_addr uintptr //go:cgo_import_dynamic libc_getsockopt getsockopt "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { _, _, e1 := syscall_syscall6(libc_setsockopt_trampoline_addr, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setsockopt_trampoline_addr uintptr //go:cgo_import_dynamic libc_setsockopt setsockopt "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := syscall_rawSyscall(libc_getpeername_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } var libc_getpeername_trampoline_addr uintptr //go:cgo_import_dynamic libc_getpeername getpeername "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := syscall_rawSyscall(libc_getsockname_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } var libc_getsockname_trampoline_addr uintptr //go:cgo_import_dynamic libc_getsockname getsockname "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(s int, how int) (err error) { _, _, e1 := syscall_syscall(libc_shutdown_trampoline_addr, uintptr(s), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_shutdown_trampoline_addr uintptr //go:cgo_import_dynamic libc_shutdown shutdown "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { _, _, e1 := syscall_rawSyscall6(libc_socketpair_trampoline_addr, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_socketpair_trampoline_addr uintptr //go:cgo_import_dynamic libc_socketpair socketpair "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall6(libc_recvfrom_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_recvfrom_trampoline_addr uintptr //go:cgo_import_dynamic libc_recvfrom recvfrom "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall6(libc_sendto_trampoline_addr, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } var libc_sendto_trampoline_addr uintptr //go:cgo_import_dynamic libc_sendto sendto "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := syscall_syscall(libc_recvmsg_trampoline_addr, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_recvmsg_trampoline_addr uintptr //go:cgo_import_dynamic libc_recvmsg recvmsg "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := syscall_syscall(libc_sendmsg_trampoline_addr, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_sendmsg_trampoline_addr uintptr //go:cgo_import_dynamic libc_sendmsg sendmsg "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) { r0, _, e1 := syscall_syscall6(libc_kevent_trampoline_addr, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_kevent_trampoline_addr uintptr //go:cgo_import_dynamic libc_kevent kevent "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, timeval *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_utimes_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_utimes_trampoline_addr uintptr //go:cgo_import_dynamic libc_utimes utimes "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func futimes(fd int, timeval *[2]Timeval) (err error) { _, _, e1 := syscall_syscall(libc_futimes_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_futimes_trampoline_addr uintptr //go:cgo_import_dynamic libc_futimes futimes "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := syscall_syscall(libc_poll_trampoline_addr, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_poll_trampoline_addr uintptr //go:cgo_import_dynamic libc_poll poll "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Madvise(b []byte, behav int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall(libc_madvise_trampoline_addr, uintptr(_p0), uintptr(len(b)), uintptr(behav)) if e1 != 0 { err = errnoErr(e1) } return } var libc_madvise_trampoline_addr uintptr //go:cgo_import_dynamic libc_madvise madvise "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall(libc_mlock_trampoline_addr, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mlock_trampoline_addr uintptr //go:cgo_import_dynamic libc_mlock mlock "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlockall(flags int) (err error) { _, _, e1 := syscall_syscall(libc_mlockall_trampoline_addr, uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mlockall_trampoline_addr uintptr //go:cgo_import_dynamic libc_mlockall mlockall "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mprotect(b []byte, prot int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall(libc_mprotect_trampoline_addr, uintptr(_p0), uintptr(len(b)), uintptr(prot)) if e1 != 0 { err = errnoErr(e1) } return } var libc_mprotect_trampoline_addr uintptr //go:cgo_import_dynamic libc_mprotect mprotect "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Msync(b []byte, flags int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall(libc_msync_trampoline_addr, uintptr(_p0), uintptr(len(b)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } var libc_msync_trampoline_addr uintptr //go:cgo_import_dynamic libc_msync msync "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall(libc_munlock_trampoline_addr, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_munlock_trampoline_addr uintptr //go:cgo_import_dynamic libc_munlock munlock "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlockall() (err error) { _, _, e1 := syscall_syscall(libc_munlockall_trampoline_addr, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_munlockall_trampoline_addr uintptr //go:cgo_import_dynamic libc_munlockall munlockall "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe2(p *[2]_C_int, flags int) (err error) { _, _, e1 := syscall_rawSyscall(libc_pipe2_trampoline_addr, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pipe2_trampoline_addr uintptr //go:cgo_import_dynamic libc_pipe2 pipe2 "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getdents(fd int, buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_getdents_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getdents_trampoline_addr uintptr //go:cgo_import_dynamic libc_getdents getdents "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getcwd(buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_getcwd_trampoline_addr, uintptr(_p0), uintptr(len(buf)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getcwd_trampoline_addr uintptr //go:cgo_import_dynamic libc_getcwd getcwd "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getresuid(ruid *_C_int, euid *_C_int, suid *_C_int) { syscall_rawSyscall(libc_getresuid_trampoline_addr, uintptr(unsafe.Pointer(ruid)), uintptr(unsafe.Pointer(euid)), uintptr(unsafe.Pointer(suid))) return } var libc_getresuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getresuid getresuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getresgid(rgid *_C_int, egid *_C_int, sgid *_C_int) { syscall_rawSyscall(libc_getresgid_trampoline_addr, uintptr(unsafe.Pointer(rgid)), uintptr(unsafe.Pointer(egid)), uintptr(unsafe.Pointer(sgid))) return } var libc_getresgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getresgid getresgid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctl(fd int, req uint, arg uintptr) (err error) { _, _, e1 := syscall_syscall(libc_ioctl_trampoline_addr, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } var libc_ioctl_trampoline_addr uintptr //go:cgo_import_dynamic libc_ioctl ioctl "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) { _, _, e1 := syscall_syscall(libc_ioctl_trampoline_addr, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { var _p0 unsafe.Pointer if len(mib) > 0 { _p0 = unsafe.Pointer(&mib[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall6(libc_sysctl_trampoline_addr, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) if e1 != 0 { err = errnoErr(e1) } return } var libc_sysctl_trampoline_addr uintptr //go:cgo_import_dynamic libc_sysctl sysctl "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fcntl(fd int, cmd int, arg int) (n int, err error) { r0, _, e1 := syscall_syscall(libc_fcntl_trampoline_addr, uintptr(fd), uintptr(cmd), uintptr(arg)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fcntl_trampoline_addr uintptr //go:cgo_import_dynamic libc_fcntl fcntl "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fcntlPtr(fd int, cmd int, arg unsafe.Pointer) (n int, err error) { r0, _, e1 := syscall_syscall(libc_fcntl_trampoline_addr, uintptr(fd), uintptr(cmd), uintptr(arg)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { r0, _, e1 := syscall_syscall6(libc_ppoll_trampoline_addr, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_ppoll_trampoline_addr uintptr //go:cgo_import_dynamic libc_ppoll ppoll "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Access(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_access_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_access_trampoline_addr uintptr //go:cgo_import_dynamic libc_access access "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Adjtime(delta *Timeval, olddelta *Timeval) (err error) { _, _, e1 := syscall_syscall(libc_adjtime_trampoline_addr, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_adjtime_trampoline_addr uintptr //go:cgo_import_dynamic libc_adjtime adjtime "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_chdir_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_chdir_trampoline_addr uintptr //go:cgo_import_dynamic libc_chdir chdir "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chflags(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_chflags_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_chflags_trampoline_addr uintptr //go:cgo_import_dynamic libc_chflags chflags "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chmod(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_chmod_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_chmod_trampoline_addr uintptr //go:cgo_import_dynamic libc_chmod chmod "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_chown_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } var libc_chown_trampoline_addr uintptr //go:cgo_import_dynamic libc_chown chown "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chroot(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_chroot_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_chroot_trampoline_addr uintptr //go:cgo_import_dynamic libc_chroot chroot "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ClockGettime(clockid int32, time *Timespec) (err error) { _, _, e1 := syscall_syscall(libc_clock_gettime_trampoline_addr, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_clock_gettime_trampoline_addr uintptr //go:cgo_import_dynamic libc_clock_gettime clock_gettime "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Close(fd int) (err error) { _, _, e1 := syscall_syscall(libc_close_trampoline_addr, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_close_trampoline_addr uintptr //go:cgo_import_dynamic libc_close close "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(fd int) (nfd int, err error) { r0, _, e1 := syscall_syscall(libc_dup_trampoline_addr, uintptr(fd), 0, 0) nfd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_dup_trampoline_addr uintptr //go:cgo_import_dynamic libc_dup dup "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup2(from int, to int) (err error) { _, _, e1 := syscall_syscall(libc_dup2_trampoline_addr, uintptr(from), uintptr(to), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_dup2_trampoline_addr uintptr //go:cgo_import_dynamic libc_dup2 dup2 "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup3(from int, to int, flags int) (err error) { _, _, e1 := syscall_syscall(libc_dup3_trampoline_addr, uintptr(from), uintptr(to), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } var libc_dup3_trampoline_addr uintptr //go:cgo_import_dynamic libc_dup3 dup3 "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Exit(code int) { syscall_syscall(libc_exit_trampoline_addr, uintptr(code), 0, 0) return } var libc_exit_trampoline_addr uintptr //go:cgo_import_dynamic libc_exit exit "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_faccessat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_faccessat_trampoline_addr uintptr //go:cgo_import_dynamic libc_faccessat faccessat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchdir(fd int) (err error) { _, _, e1 := syscall_syscall(libc_fchdir_trampoline_addr, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchdir_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchdir fchdir "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchflags(fd int, flags int) (err error) { _, _, e1 := syscall_syscall(libc_fchflags_trampoline_addr, uintptr(fd), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchflags_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchflags fchflags "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmod(fd int, mode uint32) (err error) { _, _, e1 := syscall_syscall(libc_fchmod_trampoline_addr, uintptr(fd), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchmod_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchmod fchmod "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_fchmodat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchmodat_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchmodat fchmodat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := syscall_syscall(libc_fchown_trampoline_addr, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchown_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchown fchown "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_fchownat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchownat_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchownat fchownat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Flock(fd int, how int) (err error) { _, _, e1 := syscall_syscall(libc_flock_trampoline_addr, uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_flock_trampoline_addr uintptr //go:cgo_import_dynamic libc_flock flock "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fpathconf(fd int, name int) (val int, err error) { r0, _, e1 := syscall_syscall(libc_fpathconf_trampoline_addr, uintptr(fd), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fpathconf_trampoline_addr uintptr //go:cgo_import_dynamic libc_fpathconf fpathconf "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := syscall_syscall(libc_fstat_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fstat_trampoline_addr uintptr //go:cgo_import_dynamic libc_fstat fstat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_fstatat_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fstatat_trampoline_addr uintptr //go:cgo_import_dynamic libc_fstatat fstatat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatfs(fd int, stat *Statfs_t) (err error) { _, _, e1 := syscall_syscall(libc_fstatfs_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fstatfs_trampoline_addr uintptr //go:cgo_import_dynamic libc_fstatfs fstatfs "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fsync(fd int) (err error) { _, _, e1 := syscall_syscall(libc_fsync_trampoline_addr, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fsync_trampoline_addr uintptr //go:cgo_import_dynamic libc_fsync fsync "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { _, _, e1 := syscall_syscall6(libc_ftruncate_trampoline_addr, uintptr(fd), 0, uintptr(length), uintptr(length>>32), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_ftruncate_trampoline_addr uintptr //go:cgo_import_dynamic libc_ftruncate ftruncate "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { r0, _, _ := syscall_rawSyscall(libc_getegid_trampoline_addr, 0, 0, 0) egid = int(r0) return } var libc_getegid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getegid getegid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (uid int) { r0, _, _ := syscall_rawSyscall(libc_geteuid_trampoline_addr, 0, 0, 0) uid = int(r0) return } var libc_geteuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_geteuid geteuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _, _ := syscall_rawSyscall(libc_getgid_trampoline_addr, 0, 0, 0) gid = int(r0) return } var libc_getgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getgid getgid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgid(pid int) (pgid int, err error) { r0, _, e1 := syscall_rawSyscall(libc_getpgid_trampoline_addr, uintptr(pid), 0, 0) pgid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getpgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getpgid getpgid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgrp() (pgrp int) { r0, _, _ := syscall_rawSyscall(libc_getpgrp_trampoline_addr, 0, 0, 0) pgrp = int(r0) return } var libc_getpgrp_trampoline_addr uintptr //go:cgo_import_dynamic libc_getpgrp getpgrp "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpid() (pid int) { r0, _, _ := syscall_rawSyscall(libc_getpid_trampoline_addr, 0, 0, 0) pid = int(r0) return } var libc_getpid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getpid getpid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getppid() (ppid int) { r0, _, _ := syscall_rawSyscall(libc_getppid_trampoline_addr, 0, 0, 0) ppid = int(r0) return } var libc_getppid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getppid getppid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpriority(which int, who int) (prio int, err error) { r0, _, e1 := syscall_syscall(libc_getpriority_trampoline_addr, uintptr(which), uintptr(who), 0) prio = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getpriority_trampoline_addr uintptr //go:cgo_import_dynamic libc_getpriority getpriority "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(which int, lim *Rlimit) (err error) { _, _, e1 := syscall_rawSyscall(libc_getrlimit_trampoline_addr, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getrlimit_trampoline_addr uintptr //go:cgo_import_dynamic libc_getrlimit getrlimit "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrtable() (rtable int, err error) { r0, _, e1 := syscall_rawSyscall(libc_getrtable_trampoline_addr, 0, 0, 0) rtable = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getrtable_trampoline_addr uintptr //go:cgo_import_dynamic libc_getrtable getrtable "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrusage(who int, rusage *Rusage) (err error) { _, _, e1 := syscall_rawSyscall(libc_getrusage_trampoline_addr, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getrusage_trampoline_addr uintptr //go:cgo_import_dynamic libc_getrusage getrusage "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getsid(pid int) (sid int, err error) { r0, _, e1 := syscall_rawSyscall(libc_getsid_trampoline_addr, uintptr(pid), 0, 0) sid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getsid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getsid getsid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tv *Timeval) (err error) { _, _, e1 := syscall_rawSyscall(libc_gettimeofday_trampoline_addr, uintptr(unsafe.Pointer(tv)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_gettimeofday_trampoline_addr uintptr //go:cgo_import_dynamic libc_gettimeofday gettimeofday "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _, _ := syscall_rawSyscall(libc_getuid_trampoline_addr, 0, 0, 0) uid = int(r0) return } var libc_getuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getuid getuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Issetugid() (tainted bool) { r0, _, _ := syscall_syscall(libc_issetugid_trampoline_addr, 0, 0, 0) tainted = bool(r0 != 0) return } var libc_issetugid_trampoline_addr uintptr //go:cgo_import_dynamic libc_issetugid issetugid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kill(pid int, signum syscall.Signal) (err error) { _, _, e1 := syscall_syscall(libc_kill_trampoline_addr, uintptr(pid), uintptr(signum), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_kill_trampoline_addr uintptr //go:cgo_import_dynamic libc_kill kill "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kqueue() (fd int, err error) { r0, _, e1 := syscall_syscall(libc_kqueue_trampoline_addr, 0, 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_kqueue_trampoline_addr uintptr //go:cgo_import_dynamic libc_kqueue kqueue "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_lchown_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } var libc_lchown_trampoline_addr uintptr //go:cgo_import_dynamic libc_lchown lchown "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Link(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := syscall_syscall(libc_link_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_link_trampoline_addr uintptr //go:cgo_import_dynamic libc_link link "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := syscall_syscall6(libc_linkat_trampoline_addr, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_linkat_trampoline_addr uintptr //go:cgo_import_dynamic libc_linkat linkat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, backlog int) (err error) { _, _, e1 := syscall_syscall(libc_listen_trampoline_addr, uintptr(s), uintptr(backlog), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_listen_trampoline_addr uintptr //go:cgo_import_dynamic libc_listen listen "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lstat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_lstat_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_lstat_trampoline_addr uintptr //go:cgo_import_dynamic libc_lstat lstat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdir(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_mkdir_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mkdir_trampoline_addr uintptr //go:cgo_import_dynamic libc_mkdir mkdir "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdirat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_mkdirat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } var libc_mkdirat_trampoline_addr uintptr //go:cgo_import_dynamic libc_mkdirat mkdirat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifo(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_mkfifo_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mkfifo_trampoline_addr uintptr //go:cgo_import_dynamic libc_mkfifo mkfifo "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifoat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_mkfifoat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } var libc_mkfifoat_trampoline_addr uintptr //go:cgo_import_dynamic libc_mkfifoat mkfifoat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknod(path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_mknod_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) if e1 != 0 { err = errnoErr(e1) } return } var libc_mknod_trampoline_addr uintptr //go:cgo_import_dynamic libc_mknod mknod "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_mknodat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mknodat_trampoline_addr uintptr //go:cgo_import_dynamic libc_mknodat mknodat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) { var _p0 *byte _p0, err = BytePtrFromString(fsType) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(dir) if err != nil { return } _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mount_trampoline_addr uintptr //go:cgo_import_dynamic libc_mount mount "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := syscall_syscall(libc_nanosleep_trampoline_addr, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_nanosleep_trampoline_addr uintptr //go:cgo_import_dynamic libc_nanosleep nanosleep "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Open(path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := syscall_syscall(libc_open_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_open_trampoline_addr uintptr //go:cgo_import_dynamic libc_open open "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := syscall_syscall6(libc_openat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_openat_trampoline_addr uintptr //go:cgo_import_dynamic libc_openat openat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pathconf(path string, name int) (val int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := syscall_syscall(libc_pathconf_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pathconf_trampoline_addr uintptr //go:cgo_import_dynamic libc_pathconf pathconf "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall6(libc_pread_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pread_trampoline_addr uintptr //go:cgo_import_dynamic libc_pread pread "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall6(libc_pwrite_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pwrite_trampoline_addr uintptr //go:cgo_import_dynamic libc_pwrite pwrite "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func read(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_read_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_read_trampoline_addr uintptr //go:cgo_import_dynamic libc_read read "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlink(path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_readlink_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_readlink_trampoline_addr uintptr //go:cgo_import_dynamic libc_readlink readlink "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall6(libc_readlinkat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_readlinkat_trampoline_addr uintptr //go:cgo_import_dynamic libc_readlinkat readlinkat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rename(from string, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := syscall_syscall(libc_rename_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_rename_trampoline_addr uintptr //go:cgo_import_dynamic libc_rename rename "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(fromfd int, from string, tofd int, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := syscall_syscall6(libc_renameat_trampoline_addr, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_renameat_trampoline_addr uintptr //go:cgo_import_dynamic libc_renameat renameat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Revoke(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_revoke_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_revoke_trampoline_addr uintptr //go:cgo_import_dynamic libc_revoke revoke "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rmdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_rmdir_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_rmdir_trampoline_addr uintptr //go:cgo_import_dynamic libc_rmdir rmdir "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { r0, r1, e1 := syscall_syscall6(libc_lseek_trampoline_addr, uintptr(fd), 0, uintptr(offset), uintptr(offset>>32), uintptr(whence), 0) newoffset = int64(int64(r1)<<32 | int64(r0)) if e1 != 0 { err = errnoErr(e1) } return } var libc_lseek_trampoline_addr uintptr //go:cgo_import_dynamic libc_lseek lseek "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { r0, _, e1 := syscall_syscall6(libc_select_trampoline_addr, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_select_trampoline_addr uintptr //go:cgo_import_dynamic libc_select select "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setegid(egid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setegid_trampoline_addr, uintptr(egid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setegid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setegid setegid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seteuid(euid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_seteuid_trampoline_addr, uintptr(euid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_seteuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_seteuid seteuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setgid(gid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setgid_trampoline_addr, uintptr(gid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setgid setgid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setlogin(name string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(name) if err != nil { return } _, _, e1 := syscall_syscall(libc_setlogin_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setlogin_trampoline_addr uintptr //go:cgo_import_dynamic libc_setlogin setlogin "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setpgid_trampoline_addr, uintptr(pid), uintptr(pgid), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setpgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setpgid setpgid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpriority(which int, who int, prio int) (err error) { _, _, e1 := syscall_syscall(libc_setpriority_trampoline_addr, uintptr(which), uintptr(who), uintptr(prio)) if e1 != 0 { err = errnoErr(e1) } return } var libc_setpriority_trampoline_addr uintptr //go:cgo_import_dynamic libc_setpriority setpriority "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setregid(rgid int, egid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setregid_trampoline_addr, uintptr(rgid), uintptr(egid), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setregid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setregid setregid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setreuid(ruid int, euid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setreuid_trampoline_addr, uintptr(ruid), uintptr(euid), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setreuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setreuid setreuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresgid(rgid int, egid int, sgid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setresgid_trampoline_addr, uintptr(rgid), uintptr(egid), uintptr(sgid)) if e1 != 0 { err = errnoErr(e1) } return } var libc_setresgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setresgid setresgid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresuid(ruid int, euid int, suid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setresuid_trampoline_addr, uintptr(ruid), uintptr(euid), uintptr(suid)) if e1 != 0 { err = errnoErr(e1) } return } var libc_setresuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setresuid setresuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setrtable(rtable int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setrtable_trampoline_addr, uintptr(rtable), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setrtable_trampoline_addr uintptr //go:cgo_import_dynamic libc_setrtable setrtable "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, err error) { r0, _, e1 := syscall_rawSyscall(libc_setsid_trampoline_addr, 0, 0, 0) pid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setsid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setsid setsid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Settimeofday(tp *Timeval) (err error) { _, _, e1 := syscall_rawSyscall(libc_settimeofday_trampoline_addr, uintptr(unsafe.Pointer(tp)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_settimeofday_trampoline_addr uintptr //go:cgo_import_dynamic libc_settimeofday settimeofday "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setuid(uid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setuid_trampoline_addr, uintptr(uid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setuid setuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Stat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_stat_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_stat_trampoline_addr uintptr //go:cgo_import_dynamic libc_stat stat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Statfs(path string, stat *Statfs_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_statfs_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_statfs_trampoline_addr uintptr //go:cgo_import_dynamic libc_statfs statfs "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlink(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := syscall_syscall(libc_symlink_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_symlink_trampoline_addr uintptr //go:cgo_import_dynamic libc_symlink symlink "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := syscall_syscall(libc_symlinkat_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } var libc_symlinkat_trampoline_addr uintptr //go:cgo_import_dynamic libc_symlinkat symlinkat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sync() (err error) { _, _, e1 := syscall_syscall(libc_sync_trampoline_addr, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_sync_trampoline_addr uintptr //go:cgo_import_dynamic libc_sync sync "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_truncate_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length), uintptr(length>>32), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_truncate_trampoline_addr uintptr //go:cgo_import_dynamic libc_truncate truncate "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Umask(newmask int) (oldmask int) { r0, _, _ := syscall_syscall(libc_umask_trampoline_addr, uintptr(newmask), 0, 0) oldmask = int(r0) return } var libc_umask_trampoline_addr uintptr //go:cgo_import_dynamic libc_umask umask "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlink(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_unlink_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_unlink_trampoline_addr uintptr //go:cgo_import_dynamic libc_unlink unlink "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlinkat(dirfd int, path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_unlinkat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } var libc_unlinkat_trampoline_addr uintptr //go:cgo_import_dynamic libc_unlinkat unlinkat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unmount(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_unmount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_unmount_trampoline_addr uintptr //go:cgo_import_dynamic libc_unmount unmount "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func write(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_write_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_write_trampoline_addr uintptr //go:cgo_import_dynamic libc_write write "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { r0, _, e1 := syscall_syscall9(libc_mmap_trampoline_addr, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), 0, uintptr(pos), uintptr(pos>>32), 0) ret = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mmap_trampoline_addr uintptr //go:cgo_import_dynamic libc_mmap mmap "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func munmap(addr uintptr, length uintptr) (err error) { _, _, e1 := syscall_syscall(libc_munmap_trampoline_addr, uintptr(addr), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_munmap_trampoline_addr uintptr //go:cgo_import_dynamic libc_munmap munmap "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getfsstat(stat *Statfs_t, bufsize uintptr, flags int) (n int, err error) { r0, _, e1 := syscall_syscall(libc_getfsstat_trampoline_addr, uintptr(unsafe.Pointer(stat)), uintptr(bufsize), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getfsstat_trampoline_addr uintptr //go:cgo_import_dynamic libc_getfsstat getfsstat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_utimensat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_utimensat_trampoline_addr uintptr //go:cgo_import_dynamic libc_utimensat utimensat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pledge(promises *byte, execpromises *byte) (err error) { _, _, e1 := syscall_syscall(libc_pledge_trampoline_addr, uintptr(unsafe.Pointer(promises)), uintptr(unsafe.Pointer(execpromises)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pledge_trampoline_addr uintptr //go:cgo_import_dynamic libc_pledge pledge "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func unveil(path *byte, flags *byte) (err error) { _, _, e1 := syscall_syscall(libc_unveil_trampoline_addr, uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(flags)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_unveil_trampoline_addr uintptr //go:cgo_import_dynamic libc_unveil unveil "libc.so" ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s ================================================ // go run mkasm.go openbsd arm // Code generated by the command above; DO NOT EDIT. #include "textflag.h" TEXT libc_getgroups_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getgroups(SB) GLOBL ·libc_getgroups_trampoline_addr(SB), RODATA, $4 DATA ·libc_getgroups_trampoline_addr(SB)/4, $libc_getgroups_trampoline<>(SB) TEXT libc_setgroups_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setgroups(SB) GLOBL ·libc_setgroups_trampoline_addr(SB), RODATA, $4 DATA ·libc_setgroups_trampoline_addr(SB)/4, $libc_setgroups_trampoline<>(SB) TEXT libc_wait4_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_wait4(SB) GLOBL ·libc_wait4_trampoline_addr(SB), RODATA, $4 DATA ·libc_wait4_trampoline_addr(SB)/4, $libc_wait4_trampoline<>(SB) TEXT libc_accept_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_accept(SB) GLOBL ·libc_accept_trampoline_addr(SB), RODATA, $4 DATA ·libc_accept_trampoline_addr(SB)/4, $libc_accept_trampoline<>(SB) TEXT libc_bind_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_bind(SB) GLOBL ·libc_bind_trampoline_addr(SB), RODATA, $4 DATA ·libc_bind_trampoline_addr(SB)/4, $libc_bind_trampoline<>(SB) TEXT libc_connect_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_connect(SB) GLOBL ·libc_connect_trampoline_addr(SB), RODATA, $4 DATA ·libc_connect_trampoline_addr(SB)/4, $libc_connect_trampoline<>(SB) TEXT libc_socket_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_socket(SB) GLOBL ·libc_socket_trampoline_addr(SB), RODATA, $4 DATA ·libc_socket_trampoline_addr(SB)/4, $libc_socket_trampoline<>(SB) TEXT libc_getsockopt_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getsockopt(SB) GLOBL ·libc_getsockopt_trampoline_addr(SB), RODATA, $4 DATA ·libc_getsockopt_trampoline_addr(SB)/4, $libc_getsockopt_trampoline<>(SB) TEXT libc_setsockopt_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setsockopt(SB) GLOBL ·libc_setsockopt_trampoline_addr(SB), RODATA, $4 DATA ·libc_setsockopt_trampoline_addr(SB)/4, $libc_setsockopt_trampoline<>(SB) TEXT libc_getpeername_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpeername(SB) GLOBL ·libc_getpeername_trampoline_addr(SB), RODATA, $4 DATA ·libc_getpeername_trampoline_addr(SB)/4, $libc_getpeername_trampoline<>(SB) TEXT libc_getsockname_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getsockname(SB) GLOBL ·libc_getsockname_trampoline_addr(SB), RODATA, $4 DATA ·libc_getsockname_trampoline_addr(SB)/4, $libc_getsockname_trampoline<>(SB) TEXT libc_shutdown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_shutdown(SB) GLOBL ·libc_shutdown_trampoline_addr(SB), RODATA, $4 DATA ·libc_shutdown_trampoline_addr(SB)/4, $libc_shutdown_trampoline<>(SB) TEXT libc_socketpair_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_socketpair(SB) GLOBL ·libc_socketpair_trampoline_addr(SB), RODATA, $4 DATA ·libc_socketpair_trampoline_addr(SB)/4, $libc_socketpair_trampoline<>(SB) TEXT libc_recvfrom_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_recvfrom(SB) GLOBL ·libc_recvfrom_trampoline_addr(SB), RODATA, $4 DATA ·libc_recvfrom_trampoline_addr(SB)/4, $libc_recvfrom_trampoline<>(SB) TEXT libc_sendto_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sendto(SB) GLOBL ·libc_sendto_trampoline_addr(SB), RODATA, $4 DATA ·libc_sendto_trampoline_addr(SB)/4, $libc_sendto_trampoline<>(SB) TEXT libc_recvmsg_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_recvmsg(SB) GLOBL ·libc_recvmsg_trampoline_addr(SB), RODATA, $4 DATA ·libc_recvmsg_trampoline_addr(SB)/4, $libc_recvmsg_trampoline<>(SB) TEXT libc_sendmsg_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sendmsg(SB) GLOBL ·libc_sendmsg_trampoline_addr(SB), RODATA, $4 DATA ·libc_sendmsg_trampoline_addr(SB)/4, $libc_sendmsg_trampoline<>(SB) TEXT libc_kevent_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_kevent(SB) GLOBL ·libc_kevent_trampoline_addr(SB), RODATA, $4 DATA ·libc_kevent_trampoline_addr(SB)/4, $libc_kevent_trampoline<>(SB) TEXT libc_utimes_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_utimes(SB) GLOBL ·libc_utimes_trampoline_addr(SB), RODATA, $4 DATA ·libc_utimes_trampoline_addr(SB)/4, $libc_utimes_trampoline<>(SB) TEXT libc_futimes_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_futimes(SB) GLOBL ·libc_futimes_trampoline_addr(SB), RODATA, $4 DATA ·libc_futimes_trampoline_addr(SB)/4, $libc_futimes_trampoline<>(SB) TEXT libc_poll_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_poll(SB) GLOBL ·libc_poll_trampoline_addr(SB), RODATA, $4 DATA ·libc_poll_trampoline_addr(SB)/4, $libc_poll_trampoline<>(SB) TEXT libc_madvise_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_madvise(SB) GLOBL ·libc_madvise_trampoline_addr(SB), RODATA, $4 DATA ·libc_madvise_trampoline_addr(SB)/4, $libc_madvise_trampoline<>(SB) TEXT libc_mlock_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mlock(SB) GLOBL ·libc_mlock_trampoline_addr(SB), RODATA, $4 DATA ·libc_mlock_trampoline_addr(SB)/4, $libc_mlock_trampoline<>(SB) TEXT libc_mlockall_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mlockall(SB) GLOBL ·libc_mlockall_trampoline_addr(SB), RODATA, $4 DATA ·libc_mlockall_trampoline_addr(SB)/4, $libc_mlockall_trampoline<>(SB) TEXT libc_mprotect_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mprotect(SB) GLOBL ·libc_mprotect_trampoline_addr(SB), RODATA, $4 DATA ·libc_mprotect_trampoline_addr(SB)/4, $libc_mprotect_trampoline<>(SB) TEXT libc_msync_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_msync(SB) GLOBL ·libc_msync_trampoline_addr(SB), RODATA, $4 DATA ·libc_msync_trampoline_addr(SB)/4, $libc_msync_trampoline<>(SB) TEXT libc_munlock_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_munlock(SB) GLOBL ·libc_munlock_trampoline_addr(SB), RODATA, $4 DATA ·libc_munlock_trampoline_addr(SB)/4, $libc_munlock_trampoline<>(SB) TEXT libc_munlockall_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_munlockall(SB) GLOBL ·libc_munlockall_trampoline_addr(SB), RODATA, $4 DATA ·libc_munlockall_trampoline_addr(SB)/4, $libc_munlockall_trampoline<>(SB) TEXT libc_pipe2_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pipe2(SB) GLOBL ·libc_pipe2_trampoline_addr(SB), RODATA, $4 DATA ·libc_pipe2_trampoline_addr(SB)/4, $libc_pipe2_trampoline<>(SB) TEXT libc_getdents_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getdents(SB) GLOBL ·libc_getdents_trampoline_addr(SB), RODATA, $4 DATA ·libc_getdents_trampoline_addr(SB)/4, $libc_getdents_trampoline<>(SB) TEXT libc_getcwd_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getcwd(SB) GLOBL ·libc_getcwd_trampoline_addr(SB), RODATA, $4 DATA ·libc_getcwd_trampoline_addr(SB)/4, $libc_getcwd_trampoline<>(SB) TEXT libc_getresuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getresuid(SB) GLOBL ·libc_getresuid_trampoline_addr(SB), RODATA, $4 DATA ·libc_getresuid_trampoline_addr(SB)/4, $libc_getresuid_trampoline<>(SB) TEXT libc_getresgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getresgid(SB) GLOBL ·libc_getresgid_trampoline_addr(SB), RODATA, $4 DATA ·libc_getresgid_trampoline_addr(SB)/4, $libc_getresgid_trampoline<>(SB) TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ioctl(SB) GLOBL ·libc_ioctl_trampoline_addr(SB), RODATA, $4 DATA ·libc_ioctl_trampoline_addr(SB)/4, $libc_ioctl_trampoline<>(SB) TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sysctl(SB) GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $4 DATA ·libc_sysctl_trampoline_addr(SB)/4, $libc_sysctl_trampoline<>(SB) TEXT libc_fcntl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fcntl(SB) GLOBL ·libc_fcntl_trampoline_addr(SB), RODATA, $4 DATA ·libc_fcntl_trampoline_addr(SB)/4, $libc_fcntl_trampoline<>(SB) TEXT libc_ppoll_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ppoll(SB) GLOBL ·libc_ppoll_trampoline_addr(SB), RODATA, $4 DATA ·libc_ppoll_trampoline_addr(SB)/4, $libc_ppoll_trampoline<>(SB) TEXT libc_access_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_access(SB) GLOBL ·libc_access_trampoline_addr(SB), RODATA, $4 DATA ·libc_access_trampoline_addr(SB)/4, $libc_access_trampoline<>(SB) TEXT libc_adjtime_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_adjtime(SB) GLOBL ·libc_adjtime_trampoline_addr(SB), RODATA, $4 DATA ·libc_adjtime_trampoline_addr(SB)/4, $libc_adjtime_trampoline<>(SB) TEXT libc_chdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chdir(SB) GLOBL ·libc_chdir_trampoline_addr(SB), RODATA, $4 DATA ·libc_chdir_trampoline_addr(SB)/4, $libc_chdir_trampoline<>(SB) TEXT libc_chflags_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chflags(SB) GLOBL ·libc_chflags_trampoline_addr(SB), RODATA, $4 DATA ·libc_chflags_trampoline_addr(SB)/4, $libc_chflags_trampoline<>(SB) TEXT libc_chmod_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chmod(SB) GLOBL ·libc_chmod_trampoline_addr(SB), RODATA, $4 DATA ·libc_chmod_trampoline_addr(SB)/4, $libc_chmod_trampoline<>(SB) TEXT libc_chown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chown(SB) GLOBL ·libc_chown_trampoline_addr(SB), RODATA, $4 DATA ·libc_chown_trampoline_addr(SB)/4, $libc_chown_trampoline<>(SB) TEXT libc_chroot_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chroot(SB) GLOBL ·libc_chroot_trampoline_addr(SB), RODATA, $4 DATA ·libc_chroot_trampoline_addr(SB)/4, $libc_chroot_trampoline<>(SB) TEXT libc_clock_gettime_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_clock_gettime(SB) GLOBL ·libc_clock_gettime_trampoline_addr(SB), RODATA, $4 DATA ·libc_clock_gettime_trampoline_addr(SB)/4, $libc_clock_gettime_trampoline<>(SB) TEXT libc_close_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_close(SB) GLOBL ·libc_close_trampoline_addr(SB), RODATA, $4 DATA ·libc_close_trampoline_addr(SB)/4, $libc_close_trampoline<>(SB) TEXT libc_dup_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_dup(SB) GLOBL ·libc_dup_trampoline_addr(SB), RODATA, $4 DATA ·libc_dup_trampoline_addr(SB)/4, $libc_dup_trampoline<>(SB) TEXT libc_dup2_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_dup2(SB) GLOBL ·libc_dup2_trampoline_addr(SB), RODATA, $4 DATA ·libc_dup2_trampoline_addr(SB)/4, $libc_dup2_trampoline<>(SB) TEXT libc_dup3_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_dup3(SB) GLOBL ·libc_dup3_trampoline_addr(SB), RODATA, $4 DATA ·libc_dup3_trampoline_addr(SB)/4, $libc_dup3_trampoline<>(SB) TEXT libc_exit_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_exit(SB) GLOBL ·libc_exit_trampoline_addr(SB), RODATA, $4 DATA ·libc_exit_trampoline_addr(SB)/4, $libc_exit_trampoline<>(SB) TEXT libc_faccessat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_faccessat(SB) GLOBL ·libc_faccessat_trampoline_addr(SB), RODATA, $4 DATA ·libc_faccessat_trampoline_addr(SB)/4, $libc_faccessat_trampoline<>(SB) TEXT libc_fchdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchdir(SB) GLOBL ·libc_fchdir_trampoline_addr(SB), RODATA, $4 DATA ·libc_fchdir_trampoline_addr(SB)/4, $libc_fchdir_trampoline<>(SB) TEXT libc_fchflags_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchflags(SB) GLOBL ·libc_fchflags_trampoline_addr(SB), RODATA, $4 DATA ·libc_fchflags_trampoline_addr(SB)/4, $libc_fchflags_trampoline<>(SB) TEXT libc_fchmod_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchmod(SB) GLOBL ·libc_fchmod_trampoline_addr(SB), RODATA, $4 DATA ·libc_fchmod_trampoline_addr(SB)/4, $libc_fchmod_trampoline<>(SB) TEXT libc_fchmodat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchmodat(SB) GLOBL ·libc_fchmodat_trampoline_addr(SB), RODATA, $4 DATA ·libc_fchmodat_trampoline_addr(SB)/4, $libc_fchmodat_trampoline<>(SB) TEXT libc_fchown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchown(SB) GLOBL ·libc_fchown_trampoline_addr(SB), RODATA, $4 DATA ·libc_fchown_trampoline_addr(SB)/4, $libc_fchown_trampoline<>(SB) TEXT libc_fchownat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchownat(SB) GLOBL ·libc_fchownat_trampoline_addr(SB), RODATA, $4 DATA ·libc_fchownat_trampoline_addr(SB)/4, $libc_fchownat_trampoline<>(SB) TEXT libc_flock_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_flock(SB) GLOBL ·libc_flock_trampoline_addr(SB), RODATA, $4 DATA ·libc_flock_trampoline_addr(SB)/4, $libc_flock_trampoline<>(SB) TEXT libc_fpathconf_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fpathconf(SB) GLOBL ·libc_fpathconf_trampoline_addr(SB), RODATA, $4 DATA ·libc_fpathconf_trampoline_addr(SB)/4, $libc_fpathconf_trampoline<>(SB) TEXT libc_fstat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fstat(SB) GLOBL ·libc_fstat_trampoline_addr(SB), RODATA, $4 DATA ·libc_fstat_trampoline_addr(SB)/4, $libc_fstat_trampoline<>(SB) TEXT libc_fstatat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fstatat(SB) GLOBL ·libc_fstatat_trampoline_addr(SB), RODATA, $4 DATA ·libc_fstatat_trampoline_addr(SB)/4, $libc_fstatat_trampoline<>(SB) TEXT libc_fstatfs_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fstatfs(SB) GLOBL ·libc_fstatfs_trampoline_addr(SB), RODATA, $4 DATA ·libc_fstatfs_trampoline_addr(SB)/4, $libc_fstatfs_trampoline<>(SB) TEXT libc_fsync_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fsync(SB) GLOBL ·libc_fsync_trampoline_addr(SB), RODATA, $4 DATA ·libc_fsync_trampoline_addr(SB)/4, $libc_fsync_trampoline<>(SB) TEXT libc_ftruncate_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ftruncate(SB) GLOBL ·libc_ftruncate_trampoline_addr(SB), RODATA, $4 DATA ·libc_ftruncate_trampoline_addr(SB)/4, $libc_ftruncate_trampoline<>(SB) TEXT libc_getegid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getegid(SB) GLOBL ·libc_getegid_trampoline_addr(SB), RODATA, $4 DATA ·libc_getegid_trampoline_addr(SB)/4, $libc_getegid_trampoline<>(SB) TEXT libc_geteuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_geteuid(SB) GLOBL ·libc_geteuid_trampoline_addr(SB), RODATA, $4 DATA ·libc_geteuid_trampoline_addr(SB)/4, $libc_geteuid_trampoline<>(SB) TEXT libc_getgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getgid(SB) GLOBL ·libc_getgid_trampoline_addr(SB), RODATA, $4 DATA ·libc_getgid_trampoline_addr(SB)/4, $libc_getgid_trampoline<>(SB) TEXT libc_getpgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpgid(SB) GLOBL ·libc_getpgid_trampoline_addr(SB), RODATA, $4 DATA ·libc_getpgid_trampoline_addr(SB)/4, $libc_getpgid_trampoline<>(SB) TEXT libc_getpgrp_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpgrp(SB) GLOBL ·libc_getpgrp_trampoline_addr(SB), RODATA, $4 DATA ·libc_getpgrp_trampoline_addr(SB)/4, $libc_getpgrp_trampoline<>(SB) TEXT libc_getpid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpid(SB) GLOBL ·libc_getpid_trampoline_addr(SB), RODATA, $4 DATA ·libc_getpid_trampoline_addr(SB)/4, $libc_getpid_trampoline<>(SB) TEXT libc_getppid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getppid(SB) GLOBL ·libc_getppid_trampoline_addr(SB), RODATA, $4 DATA ·libc_getppid_trampoline_addr(SB)/4, $libc_getppid_trampoline<>(SB) TEXT libc_getpriority_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpriority(SB) GLOBL ·libc_getpriority_trampoline_addr(SB), RODATA, $4 DATA ·libc_getpriority_trampoline_addr(SB)/4, $libc_getpriority_trampoline<>(SB) TEXT libc_getrlimit_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getrlimit(SB) GLOBL ·libc_getrlimit_trampoline_addr(SB), RODATA, $4 DATA ·libc_getrlimit_trampoline_addr(SB)/4, $libc_getrlimit_trampoline<>(SB) TEXT libc_getrtable_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getrtable(SB) GLOBL ·libc_getrtable_trampoline_addr(SB), RODATA, $4 DATA ·libc_getrtable_trampoline_addr(SB)/4, $libc_getrtable_trampoline<>(SB) TEXT libc_getrusage_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getrusage(SB) GLOBL ·libc_getrusage_trampoline_addr(SB), RODATA, $4 DATA ·libc_getrusage_trampoline_addr(SB)/4, $libc_getrusage_trampoline<>(SB) TEXT libc_getsid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getsid(SB) GLOBL ·libc_getsid_trampoline_addr(SB), RODATA, $4 DATA ·libc_getsid_trampoline_addr(SB)/4, $libc_getsid_trampoline<>(SB) TEXT libc_gettimeofday_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_gettimeofday(SB) GLOBL ·libc_gettimeofday_trampoline_addr(SB), RODATA, $4 DATA ·libc_gettimeofday_trampoline_addr(SB)/4, $libc_gettimeofday_trampoline<>(SB) TEXT libc_getuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getuid(SB) GLOBL ·libc_getuid_trampoline_addr(SB), RODATA, $4 DATA ·libc_getuid_trampoline_addr(SB)/4, $libc_getuid_trampoline<>(SB) TEXT libc_issetugid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_issetugid(SB) GLOBL ·libc_issetugid_trampoline_addr(SB), RODATA, $4 DATA ·libc_issetugid_trampoline_addr(SB)/4, $libc_issetugid_trampoline<>(SB) TEXT libc_kill_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_kill(SB) GLOBL ·libc_kill_trampoline_addr(SB), RODATA, $4 DATA ·libc_kill_trampoline_addr(SB)/4, $libc_kill_trampoline<>(SB) TEXT libc_kqueue_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_kqueue(SB) GLOBL ·libc_kqueue_trampoline_addr(SB), RODATA, $4 DATA ·libc_kqueue_trampoline_addr(SB)/4, $libc_kqueue_trampoline<>(SB) TEXT libc_lchown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_lchown(SB) GLOBL ·libc_lchown_trampoline_addr(SB), RODATA, $4 DATA ·libc_lchown_trampoline_addr(SB)/4, $libc_lchown_trampoline<>(SB) TEXT libc_link_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_link(SB) GLOBL ·libc_link_trampoline_addr(SB), RODATA, $4 DATA ·libc_link_trampoline_addr(SB)/4, $libc_link_trampoline<>(SB) TEXT libc_linkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_linkat(SB) GLOBL ·libc_linkat_trampoline_addr(SB), RODATA, $4 DATA ·libc_linkat_trampoline_addr(SB)/4, $libc_linkat_trampoline<>(SB) TEXT libc_listen_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_listen(SB) GLOBL ·libc_listen_trampoline_addr(SB), RODATA, $4 DATA ·libc_listen_trampoline_addr(SB)/4, $libc_listen_trampoline<>(SB) TEXT libc_lstat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_lstat(SB) GLOBL ·libc_lstat_trampoline_addr(SB), RODATA, $4 DATA ·libc_lstat_trampoline_addr(SB)/4, $libc_lstat_trampoline<>(SB) TEXT libc_mkdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkdir(SB) GLOBL ·libc_mkdir_trampoline_addr(SB), RODATA, $4 DATA ·libc_mkdir_trampoline_addr(SB)/4, $libc_mkdir_trampoline<>(SB) TEXT libc_mkdirat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkdirat(SB) GLOBL ·libc_mkdirat_trampoline_addr(SB), RODATA, $4 DATA ·libc_mkdirat_trampoline_addr(SB)/4, $libc_mkdirat_trampoline<>(SB) TEXT libc_mkfifo_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkfifo(SB) GLOBL ·libc_mkfifo_trampoline_addr(SB), RODATA, $4 DATA ·libc_mkfifo_trampoline_addr(SB)/4, $libc_mkfifo_trampoline<>(SB) TEXT libc_mkfifoat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkfifoat(SB) GLOBL ·libc_mkfifoat_trampoline_addr(SB), RODATA, $4 DATA ·libc_mkfifoat_trampoline_addr(SB)/4, $libc_mkfifoat_trampoline<>(SB) TEXT libc_mknod_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mknod(SB) GLOBL ·libc_mknod_trampoline_addr(SB), RODATA, $4 DATA ·libc_mknod_trampoline_addr(SB)/4, $libc_mknod_trampoline<>(SB) TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mknodat(SB) GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $4 DATA ·libc_mknodat_trampoline_addr(SB)/4, $libc_mknodat_trampoline<>(SB) TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mount(SB) GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $4 DATA ·libc_mount_trampoline_addr(SB)/4, $libc_mount_trampoline<>(SB) TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_nanosleep(SB) GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $4 DATA ·libc_nanosleep_trampoline_addr(SB)/4, $libc_nanosleep_trampoline<>(SB) TEXT libc_open_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_open(SB) GLOBL ·libc_open_trampoline_addr(SB), RODATA, $4 DATA ·libc_open_trampoline_addr(SB)/4, $libc_open_trampoline<>(SB) TEXT libc_openat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_openat(SB) GLOBL ·libc_openat_trampoline_addr(SB), RODATA, $4 DATA ·libc_openat_trampoline_addr(SB)/4, $libc_openat_trampoline<>(SB) TEXT libc_pathconf_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pathconf(SB) GLOBL ·libc_pathconf_trampoline_addr(SB), RODATA, $4 DATA ·libc_pathconf_trampoline_addr(SB)/4, $libc_pathconf_trampoline<>(SB) TEXT libc_pread_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pread(SB) GLOBL ·libc_pread_trampoline_addr(SB), RODATA, $4 DATA ·libc_pread_trampoline_addr(SB)/4, $libc_pread_trampoline<>(SB) TEXT libc_pwrite_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pwrite(SB) GLOBL ·libc_pwrite_trampoline_addr(SB), RODATA, $4 DATA ·libc_pwrite_trampoline_addr(SB)/4, $libc_pwrite_trampoline<>(SB) TEXT libc_read_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_read(SB) GLOBL ·libc_read_trampoline_addr(SB), RODATA, $4 DATA ·libc_read_trampoline_addr(SB)/4, $libc_read_trampoline<>(SB) TEXT libc_readlink_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_readlink(SB) GLOBL ·libc_readlink_trampoline_addr(SB), RODATA, $4 DATA ·libc_readlink_trampoline_addr(SB)/4, $libc_readlink_trampoline<>(SB) TEXT libc_readlinkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_readlinkat(SB) GLOBL ·libc_readlinkat_trampoline_addr(SB), RODATA, $4 DATA ·libc_readlinkat_trampoline_addr(SB)/4, $libc_readlinkat_trampoline<>(SB) TEXT libc_rename_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_rename(SB) GLOBL ·libc_rename_trampoline_addr(SB), RODATA, $4 DATA ·libc_rename_trampoline_addr(SB)/4, $libc_rename_trampoline<>(SB) TEXT libc_renameat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_renameat(SB) GLOBL ·libc_renameat_trampoline_addr(SB), RODATA, $4 DATA ·libc_renameat_trampoline_addr(SB)/4, $libc_renameat_trampoline<>(SB) TEXT libc_revoke_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_revoke(SB) GLOBL ·libc_revoke_trampoline_addr(SB), RODATA, $4 DATA ·libc_revoke_trampoline_addr(SB)/4, $libc_revoke_trampoline<>(SB) TEXT libc_rmdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_rmdir(SB) GLOBL ·libc_rmdir_trampoline_addr(SB), RODATA, $4 DATA ·libc_rmdir_trampoline_addr(SB)/4, $libc_rmdir_trampoline<>(SB) TEXT libc_lseek_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_lseek(SB) GLOBL ·libc_lseek_trampoline_addr(SB), RODATA, $4 DATA ·libc_lseek_trampoline_addr(SB)/4, $libc_lseek_trampoline<>(SB) TEXT libc_select_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_select(SB) GLOBL ·libc_select_trampoline_addr(SB), RODATA, $4 DATA ·libc_select_trampoline_addr(SB)/4, $libc_select_trampoline<>(SB) TEXT libc_setegid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setegid(SB) GLOBL ·libc_setegid_trampoline_addr(SB), RODATA, $4 DATA ·libc_setegid_trampoline_addr(SB)/4, $libc_setegid_trampoline<>(SB) TEXT libc_seteuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_seteuid(SB) GLOBL ·libc_seteuid_trampoline_addr(SB), RODATA, $4 DATA ·libc_seteuid_trampoline_addr(SB)/4, $libc_seteuid_trampoline<>(SB) TEXT libc_setgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setgid(SB) GLOBL ·libc_setgid_trampoline_addr(SB), RODATA, $4 DATA ·libc_setgid_trampoline_addr(SB)/4, $libc_setgid_trampoline<>(SB) TEXT libc_setlogin_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setlogin(SB) GLOBL ·libc_setlogin_trampoline_addr(SB), RODATA, $4 DATA ·libc_setlogin_trampoline_addr(SB)/4, $libc_setlogin_trampoline<>(SB) TEXT libc_setpgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setpgid(SB) GLOBL ·libc_setpgid_trampoline_addr(SB), RODATA, $4 DATA ·libc_setpgid_trampoline_addr(SB)/4, $libc_setpgid_trampoline<>(SB) TEXT libc_setpriority_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setpriority(SB) GLOBL ·libc_setpriority_trampoline_addr(SB), RODATA, $4 DATA ·libc_setpriority_trampoline_addr(SB)/4, $libc_setpriority_trampoline<>(SB) TEXT libc_setregid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setregid(SB) GLOBL ·libc_setregid_trampoline_addr(SB), RODATA, $4 DATA ·libc_setregid_trampoline_addr(SB)/4, $libc_setregid_trampoline<>(SB) TEXT libc_setreuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setreuid(SB) GLOBL ·libc_setreuid_trampoline_addr(SB), RODATA, $4 DATA ·libc_setreuid_trampoline_addr(SB)/4, $libc_setreuid_trampoline<>(SB) TEXT libc_setresgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setresgid(SB) GLOBL ·libc_setresgid_trampoline_addr(SB), RODATA, $4 DATA ·libc_setresgid_trampoline_addr(SB)/4, $libc_setresgid_trampoline<>(SB) TEXT libc_setresuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setresuid(SB) GLOBL ·libc_setresuid_trampoline_addr(SB), RODATA, $4 DATA ·libc_setresuid_trampoline_addr(SB)/4, $libc_setresuid_trampoline<>(SB) TEXT libc_setrtable_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setrtable(SB) GLOBL ·libc_setrtable_trampoline_addr(SB), RODATA, $4 DATA ·libc_setrtable_trampoline_addr(SB)/4, $libc_setrtable_trampoline<>(SB) TEXT libc_setsid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setsid(SB) GLOBL ·libc_setsid_trampoline_addr(SB), RODATA, $4 DATA ·libc_setsid_trampoline_addr(SB)/4, $libc_setsid_trampoline<>(SB) TEXT libc_settimeofday_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_settimeofday(SB) GLOBL ·libc_settimeofday_trampoline_addr(SB), RODATA, $4 DATA ·libc_settimeofday_trampoline_addr(SB)/4, $libc_settimeofday_trampoline<>(SB) TEXT libc_setuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setuid(SB) GLOBL ·libc_setuid_trampoline_addr(SB), RODATA, $4 DATA ·libc_setuid_trampoline_addr(SB)/4, $libc_setuid_trampoline<>(SB) TEXT libc_stat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_stat(SB) GLOBL ·libc_stat_trampoline_addr(SB), RODATA, $4 DATA ·libc_stat_trampoline_addr(SB)/4, $libc_stat_trampoline<>(SB) TEXT libc_statfs_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_statfs(SB) GLOBL ·libc_statfs_trampoline_addr(SB), RODATA, $4 DATA ·libc_statfs_trampoline_addr(SB)/4, $libc_statfs_trampoline<>(SB) TEXT libc_symlink_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_symlink(SB) GLOBL ·libc_symlink_trampoline_addr(SB), RODATA, $4 DATA ·libc_symlink_trampoline_addr(SB)/4, $libc_symlink_trampoline<>(SB) TEXT libc_symlinkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_symlinkat(SB) GLOBL ·libc_symlinkat_trampoline_addr(SB), RODATA, $4 DATA ·libc_symlinkat_trampoline_addr(SB)/4, $libc_symlinkat_trampoline<>(SB) TEXT libc_sync_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sync(SB) GLOBL ·libc_sync_trampoline_addr(SB), RODATA, $4 DATA ·libc_sync_trampoline_addr(SB)/4, $libc_sync_trampoline<>(SB) TEXT libc_truncate_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_truncate(SB) GLOBL ·libc_truncate_trampoline_addr(SB), RODATA, $4 DATA ·libc_truncate_trampoline_addr(SB)/4, $libc_truncate_trampoline<>(SB) TEXT libc_umask_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_umask(SB) GLOBL ·libc_umask_trampoline_addr(SB), RODATA, $4 DATA ·libc_umask_trampoline_addr(SB)/4, $libc_umask_trampoline<>(SB) TEXT libc_unlink_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_unlink(SB) GLOBL ·libc_unlink_trampoline_addr(SB), RODATA, $4 DATA ·libc_unlink_trampoline_addr(SB)/4, $libc_unlink_trampoline<>(SB) TEXT libc_unlinkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_unlinkat(SB) GLOBL ·libc_unlinkat_trampoline_addr(SB), RODATA, $4 DATA ·libc_unlinkat_trampoline_addr(SB)/4, $libc_unlinkat_trampoline<>(SB) TEXT libc_unmount_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_unmount(SB) GLOBL ·libc_unmount_trampoline_addr(SB), RODATA, $4 DATA ·libc_unmount_trampoline_addr(SB)/4, $libc_unmount_trampoline<>(SB) TEXT libc_write_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_write(SB) GLOBL ·libc_write_trampoline_addr(SB), RODATA, $4 DATA ·libc_write_trampoline_addr(SB)/4, $libc_write_trampoline<>(SB) TEXT libc_mmap_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mmap(SB) GLOBL ·libc_mmap_trampoline_addr(SB), RODATA, $4 DATA ·libc_mmap_trampoline_addr(SB)/4, $libc_mmap_trampoline<>(SB) TEXT libc_munmap_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_munmap(SB) GLOBL ·libc_munmap_trampoline_addr(SB), RODATA, $4 DATA ·libc_munmap_trampoline_addr(SB)/4, $libc_munmap_trampoline<>(SB) TEXT libc_getfsstat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getfsstat(SB) GLOBL ·libc_getfsstat_trampoline_addr(SB), RODATA, $4 DATA ·libc_getfsstat_trampoline_addr(SB)/4, $libc_getfsstat_trampoline<>(SB) TEXT libc_utimensat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_utimensat(SB) GLOBL ·libc_utimensat_trampoline_addr(SB), RODATA, $4 DATA ·libc_utimensat_trampoline_addr(SB)/4, $libc_utimensat_trampoline<>(SB) TEXT libc_pledge_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pledge(SB) GLOBL ·libc_pledge_trampoline_addr(SB), RODATA, $4 DATA ·libc_pledge_trampoline_addr(SB)/4, $libc_pledge_trampoline<>(SB) TEXT libc_unveil_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_unveil(SB) GLOBL ·libc_unveil_trampoline_addr(SB), RODATA, $4 DATA ·libc_unveil_trampoline_addr(SB)/4, $libc_unveil_trampoline<>(SB) ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go ================================================ // go run mksyscall.go -openbsd -libc -tags openbsd,arm64 syscall_bsd.go syscall_openbsd.go syscall_openbsd_arm64.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build openbsd && arm64 package unix import ( "syscall" "unsafe" ) var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(ngid int, gid *_Gid_t) (n int, err error) { r0, _, e1 := syscall_rawSyscall(libc_getgroups_trampoline_addr, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getgroups_trampoline_addr uintptr //go:cgo_import_dynamic libc_getgroups getgroups "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(ngid int, gid *_Gid_t) (err error) { _, _, e1 := syscall_rawSyscall(libc_setgroups_trampoline_addr, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setgroups_trampoline_addr uintptr //go:cgo_import_dynamic libc_setgroups setgroups "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) { r0, _, e1 := syscall_syscall6(libc_wait4_trampoline_addr, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) wpid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_wait4_trampoline_addr uintptr //go:cgo_import_dynamic libc_wait4 wait4 "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { r0, _, e1 := syscall_syscall(libc_accept_trampoline_addr, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_accept_trampoline_addr uintptr //go:cgo_import_dynamic libc_accept accept "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := syscall_syscall(libc_bind_trampoline_addr, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } var libc_bind_trampoline_addr uintptr //go:cgo_import_dynamic libc_bind bind "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := syscall_syscall(libc_connect_trampoline_addr, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } var libc_connect_trampoline_addr uintptr //go:cgo_import_dynamic libc_connect connect "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { r0, _, e1 := syscall_rawSyscall(libc_socket_trampoline_addr, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_socket_trampoline_addr uintptr //go:cgo_import_dynamic libc_socket socket "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { _, _, e1 := syscall_syscall6(libc_getsockopt_trampoline_addr, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getsockopt_trampoline_addr uintptr //go:cgo_import_dynamic libc_getsockopt getsockopt "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { _, _, e1 := syscall_syscall6(libc_setsockopt_trampoline_addr, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setsockopt_trampoline_addr uintptr //go:cgo_import_dynamic libc_setsockopt setsockopt "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := syscall_rawSyscall(libc_getpeername_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } var libc_getpeername_trampoline_addr uintptr //go:cgo_import_dynamic libc_getpeername getpeername "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := syscall_rawSyscall(libc_getsockname_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } var libc_getsockname_trampoline_addr uintptr //go:cgo_import_dynamic libc_getsockname getsockname "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(s int, how int) (err error) { _, _, e1 := syscall_syscall(libc_shutdown_trampoline_addr, uintptr(s), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_shutdown_trampoline_addr uintptr //go:cgo_import_dynamic libc_shutdown shutdown "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { _, _, e1 := syscall_rawSyscall6(libc_socketpair_trampoline_addr, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_socketpair_trampoline_addr uintptr //go:cgo_import_dynamic libc_socketpair socketpair "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall6(libc_recvfrom_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_recvfrom_trampoline_addr uintptr //go:cgo_import_dynamic libc_recvfrom recvfrom "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall6(libc_sendto_trampoline_addr, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } var libc_sendto_trampoline_addr uintptr //go:cgo_import_dynamic libc_sendto sendto "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := syscall_syscall(libc_recvmsg_trampoline_addr, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_recvmsg_trampoline_addr uintptr //go:cgo_import_dynamic libc_recvmsg recvmsg "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := syscall_syscall(libc_sendmsg_trampoline_addr, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_sendmsg_trampoline_addr uintptr //go:cgo_import_dynamic libc_sendmsg sendmsg "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) { r0, _, e1 := syscall_syscall6(libc_kevent_trampoline_addr, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_kevent_trampoline_addr uintptr //go:cgo_import_dynamic libc_kevent kevent "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, timeval *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_utimes_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_utimes_trampoline_addr uintptr //go:cgo_import_dynamic libc_utimes utimes "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func futimes(fd int, timeval *[2]Timeval) (err error) { _, _, e1 := syscall_syscall(libc_futimes_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_futimes_trampoline_addr uintptr //go:cgo_import_dynamic libc_futimes futimes "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := syscall_syscall(libc_poll_trampoline_addr, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_poll_trampoline_addr uintptr //go:cgo_import_dynamic libc_poll poll "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Madvise(b []byte, behav int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall(libc_madvise_trampoline_addr, uintptr(_p0), uintptr(len(b)), uintptr(behav)) if e1 != 0 { err = errnoErr(e1) } return } var libc_madvise_trampoline_addr uintptr //go:cgo_import_dynamic libc_madvise madvise "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall(libc_mlock_trampoline_addr, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mlock_trampoline_addr uintptr //go:cgo_import_dynamic libc_mlock mlock "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlockall(flags int) (err error) { _, _, e1 := syscall_syscall(libc_mlockall_trampoline_addr, uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mlockall_trampoline_addr uintptr //go:cgo_import_dynamic libc_mlockall mlockall "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mprotect(b []byte, prot int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall(libc_mprotect_trampoline_addr, uintptr(_p0), uintptr(len(b)), uintptr(prot)) if e1 != 0 { err = errnoErr(e1) } return } var libc_mprotect_trampoline_addr uintptr //go:cgo_import_dynamic libc_mprotect mprotect "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Msync(b []byte, flags int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall(libc_msync_trampoline_addr, uintptr(_p0), uintptr(len(b)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } var libc_msync_trampoline_addr uintptr //go:cgo_import_dynamic libc_msync msync "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall(libc_munlock_trampoline_addr, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_munlock_trampoline_addr uintptr //go:cgo_import_dynamic libc_munlock munlock "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlockall() (err error) { _, _, e1 := syscall_syscall(libc_munlockall_trampoline_addr, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_munlockall_trampoline_addr uintptr //go:cgo_import_dynamic libc_munlockall munlockall "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe2(p *[2]_C_int, flags int) (err error) { _, _, e1 := syscall_rawSyscall(libc_pipe2_trampoline_addr, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pipe2_trampoline_addr uintptr //go:cgo_import_dynamic libc_pipe2 pipe2 "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getdents(fd int, buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_getdents_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getdents_trampoline_addr uintptr //go:cgo_import_dynamic libc_getdents getdents "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getcwd(buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_getcwd_trampoline_addr, uintptr(_p0), uintptr(len(buf)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getcwd_trampoline_addr uintptr //go:cgo_import_dynamic libc_getcwd getcwd "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getresuid(ruid *_C_int, euid *_C_int, suid *_C_int) { syscall_rawSyscall(libc_getresuid_trampoline_addr, uintptr(unsafe.Pointer(ruid)), uintptr(unsafe.Pointer(euid)), uintptr(unsafe.Pointer(suid))) return } var libc_getresuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getresuid getresuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getresgid(rgid *_C_int, egid *_C_int, sgid *_C_int) { syscall_rawSyscall(libc_getresgid_trampoline_addr, uintptr(unsafe.Pointer(rgid)), uintptr(unsafe.Pointer(egid)), uintptr(unsafe.Pointer(sgid))) return } var libc_getresgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getresgid getresgid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctl(fd int, req uint, arg uintptr) (err error) { _, _, e1 := syscall_syscall(libc_ioctl_trampoline_addr, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } var libc_ioctl_trampoline_addr uintptr //go:cgo_import_dynamic libc_ioctl ioctl "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) { _, _, e1 := syscall_syscall(libc_ioctl_trampoline_addr, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { var _p0 unsafe.Pointer if len(mib) > 0 { _p0 = unsafe.Pointer(&mib[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall6(libc_sysctl_trampoline_addr, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) if e1 != 0 { err = errnoErr(e1) } return } var libc_sysctl_trampoline_addr uintptr //go:cgo_import_dynamic libc_sysctl sysctl "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fcntl(fd int, cmd int, arg int) (n int, err error) { r0, _, e1 := syscall_syscall(libc_fcntl_trampoline_addr, uintptr(fd), uintptr(cmd), uintptr(arg)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fcntl_trampoline_addr uintptr //go:cgo_import_dynamic libc_fcntl fcntl "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fcntlPtr(fd int, cmd int, arg unsafe.Pointer) (n int, err error) { r0, _, e1 := syscall_syscall(libc_fcntl_trampoline_addr, uintptr(fd), uintptr(cmd), uintptr(arg)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { r0, _, e1 := syscall_syscall6(libc_ppoll_trampoline_addr, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_ppoll_trampoline_addr uintptr //go:cgo_import_dynamic libc_ppoll ppoll "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Access(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_access_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_access_trampoline_addr uintptr //go:cgo_import_dynamic libc_access access "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Adjtime(delta *Timeval, olddelta *Timeval) (err error) { _, _, e1 := syscall_syscall(libc_adjtime_trampoline_addr, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_adjtime_trampoline_addr uintptr //go:cgo_import_dynamic libc_adjtime adjtime "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_chdir_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_chdir_trampoline_addr uintptr //go:cgo_import_dynamic libc_chdir chdir "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chflags(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_chflags_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_chflags_trampoline_addr uintptr //go:cgo_import_dynamic libc_chflags chflags "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chmod(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_chmod_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_chmod_trampoline_addr uintptr //go:cgo_import_dynamic libc_chmod chmod "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_chown_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } var libc_chown_trampoline_addr uintptr //go:cgo_import_dynamic libc_chown chown "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chroot(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_chroot_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_chroot_trampoline_addr uintptr //go:cgo_import_dynamic libc_chroot chroot "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ClockGettime(clockid int32, time *Timespec) (err error) { _, _, e1 := syscall_syscall(libc_clock_gettime_trampoline_addr, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_clock_gettime_trampoline_addr uintptr //go:cgo_import_dynamic libc_clock_gettime clock_gettime "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Close(fd int) (err error) { _, _, e1 := syscall_syscall(libc_close_trampoline_addr, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_close_trampoline_addr uintptr //go:cgo_import_dynamic libc_close close "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(fd int) (nfd int, err error) { r0, _, e1 := syscall_syscall(libc_dup_trampoline_addr, uintptr(fd), 0, 0) nfd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_dup_trampoline_addr uintptr //go:cgo_import_dynamic libc_dup dup "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup2(from int, to int) (err error) { _, _, e1 := syscall_syscall(libc_dup2_trampoline_addr, uintptr(from), uintptr(to), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_dup2_trampoline_addr uintptr //go:cgo_import_dynamic libc_dup2 dup2 "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup3(from int, to int, flags int) (err error) { _, _, e1 := syscall_syscall(libc_dup3_trampoline_addr, uintptr(from), uintptr(to), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } var libc_dup3_trampoline_addr uintptr //go:cgo_import_dynamic libc_dup3 dup3 "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Exit(code int) { syscall_syscall(libc_exit_trampoline_addr, uintptr(code), 0, 0) return } var libc_exit_trampoline_addr uintptr //go:cgo_import_dynamic libc_exit exit "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_faccessat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_faccessat_trampoline_addr uintptr //go:cgo_import_dynamic libc_faccessat faccessat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchdir(fd int) (err error) { _, _, e1 := syscall_syscall(libc_fchdir_trampoline_addr, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchdir_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchdir fchdir "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchflags(fd int, flags int) (err error) { _, _, e1 := syscall_syscall(libc_fchflags_trampoline_addr, uintptr(fd), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchflags_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchflags fchflags "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmod(fd int, mode uint32) (err error) { _, _, e1 := syscall_syscall(libc_fchmod_trampoline_addr, uintptr(fd), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchmod_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchmod fchmod "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_fchmodat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchmodat_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchmodat fchmodat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := syscall_syscall(libc_fchown_trampoline_addr, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchown_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchown fchown "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_fchownat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchownat_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchownat fchownat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Flock(fd int, how int) (err error) { _, _, e1 := syscall_syscall(libc_flock_trampoline_addr, uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_flock_trampoline_addr uintptr //go:cgo_import_dynamic libc_flock flock "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fpathconf(fd int, name int) (val int, err error) { r0, _, e1 := syscall_syscall(libc_fpathconf_trampoline_addr, uintptr(fd), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fpathconf_trampoline_addr uintptr //go:cgo_import_dynamic libc_fpathconf fpathconf "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := syscall_syscall(libc_fstat_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fstat_trampoline_addr uintptr //go:cgo_import_dynamic libc_fstat fstat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_fstatat_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fstatat_trampoline_addr uintptr //go:cgo_import_dynamic libc_fstatat fstatat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatfs(fd int, stat *Statfs_t) (err error) { _, _, e1 := syscall_syscall(libc_fstatfs_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fstatfs_trampoline_addr uintptr //go:cgo_import_dynamic libc_fstatfs fstatfs "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fsync(fd int) (err error) { _, _, e1 := syscall_syscall(libc_fsync_trampoline_addr, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fsync_trampoline_addr uintptr //go:cgo_import_dynamic libc_fsync fsync "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { _, _, e1 := syscall_syscall(libc_ftruncate_trampoline_addr, uintptr(fd), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_ftruncate_trampoline_addr uintptr //go:cgo_import_dynamic libc_ftruncate ftruncate "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { r0, _, _ := syscall_rawSyscall(libc_getegid_trampoline_addr, 0, 0, 0) egid = int(r0) return } var libc_getegid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getegid getegid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (uid int) { r0, _, _ := syscall_rawSyscall(libc_geteuid_trampoline_addr, 0, 0, 0) uid = int(r0) return } var libc_geteuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_geteuid geteuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _, _ := syscall_rawSyscall(libc_getgid_trampoline_addr, 0, 0, 0) gid = int(r0) return } var libc_getgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getgid getgid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgid(pid int) (pgid int, err error) { r0, _, e1 := syscall_rawSyscall(libc_getpgid_trampoline_addr, uintptr(pid), 0, 0) pgid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getpgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getpgid getpgid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgrp() (pgrp int) { r0, _, _ := syscall_rawSyscall(libc_getpgrp_trampoline_addr, 0, 0, 0) pgrp = int(r0) return } var libc_getpgrp_trampoline_addr uintptr //go:cgo_import_dynamic libc_getpgrp getpgrp "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpid() (pid int) { r0, _, _ := syscall_rawSyscall(libc_getpid_trampoline_addr, 0, 0, 0) pid = int(r0) return } var libc_getpid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getpid getpid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getppid() (ppid int) { r0, _, _ := syscall_rawSyscall(libc_getppid_trampoline_addr, 0, 0, 0) ppid = int(r0) return } var libc_getppid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getppid getppid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpriority(which int, who int) (prio int, err error) { r0, _, e1 := syscall_syscall(libc_getpriority_trampoline_addr, uintptr(which), uintptr(who), 0) prio = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getpriority_trampoline_addr uintptr //go:cgo_import_dynamic libc_getpriority getpriority "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(which int, lim *Rlimit) (err error) { _, _, e1 := syscall_rawSyscall(libc_getrlimit_trampoline_addr, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getrlimit_trampoline_addr uintptr //go:cgo_import_dynamic libc_getrlimit getrlimit "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrtable() (rtable int, err error) { r0, _, e1 := syscall_rawSyscall(libc_getrtable_trampoline_addr, 0, 0, 0) rtable = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getrtable_trampoline_addr uintptr //go:cgo_import_dynamic libc_getrtable getrtable "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrusage(who int, rusage *Rusage) (err error) { _, _, e1 := syscall_rawSyscall(libc_getrusage_trampoline_addr, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getrusage_trampoline_addr uintptr //go:cgo_import_dynamic libc_getrusage getrusage "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getsid(pid int) (sid int, err error) { r0, _, e1 := syscall_rawSyscall(libc_getsid_trampoline_addr, uintptr(pid), 0, 0) sid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getsid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getsid getsid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tv *Timeval) (err error) { _, _, e1 := syscall_rawSyscall(libc_gettimeofday_trampoline_addr, uintptr(unsafe.Pointer(tv)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_gettimeofday_trampoline_addr uintptr //go:cgo_import_dynamic libc_gettimeofday gettimeofday "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _, _ := syscall_rawSyscall(libc_getuid_trampoline_addr, 0, 0, 0) uid = int(r0) return } var libc_getuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getuid getuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Issetugid() (tainted bool) { r0, _, _ := syscall_syscall(libc_issetugid_trampoline_addr, 0, 0, 0) tainted = bool(r0 != 0) return } var libc_issetugid_trampoline_addr uintptr //go:cgo_import_dynamic libc_issetugid issetugid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kill(pid int, signum syscall.Signal) (err error) { _, _, e1 := syscall_syscall(libc_kill_trampoline_addr, uintptr(pid), uintptr(signum), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_kill_trampoline_addr uintptr //go:cgo_import_dynamic libc_kill kill "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kqueue() (fd int, err error) { r0, _, e1 := syscall_syscall(libc_kqueue_trampoline_addr, 0, 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_kqueue_trampoline_addr uintptr //go:cgo_import_dynamic libc_kqueue kqueue "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_lchown_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } var libc_lchown_trampoline_addr uintptr //go:cgo_import_dynamic libc_lchown lchown "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Link(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := syscall_syscall(libc_link_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_link_trampoline_addr uintptr //go:cgo_import_dynamic libc_link link "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := syscall_syscall6(libc_linkat_trampoline_addr, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_linkat_trampoline_addr uintptr //go:cgo_import_dynamic libc_linkat linkat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, backlog int) (err error) { _, _, e1 := syscall_syscall(libc_listen_trampoline_addr, uintptr(s), uintptr(backlog), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_listen_trampoline_addr uintptr //go:cgo_import_dynamic libc_listen listen "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lstat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_lstat_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_lstat_trampoline_addr uintptr //go:cgo_import_dynamic libc_lstat lstat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdir(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_mkdir_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mkdir_trampoline_addr uintptr //go:cgo_import_dynamic libc_mkdir mkdir "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdirat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_mkdirat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } var libc_mkdirat_trampoline_addr uintptr //go:cgo_import_dynamic libc_mkdirat mkdirat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifo(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_mkfifo_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mkfifo_trampoline_addr uintptr //go:cgo_import_dynamic libc_mkfifo mkfifo "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifoat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_mkfifoat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } var libc_mkfifoat_trampoline_addr uintptr //go:cgo_import_dynamic libc_mkfifoat mkfifoat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknod(path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_mknod_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) if e1 != 0 { err = errnoErr(e1) } return } var libc_mknod_trampoline_addr uintptr //go:cgo_import_dynamic libc_mknod mknod "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_mknodat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mknodat_trampoline_addr uintptr //go:cgo_import_dynamic libc_mknodat mknodat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) { var _p0 *byte _p0, err = BytePtrFromString(fsType) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(dir) if err != nil { return } _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mount_trampoline_addr uintptr //go:cgo_import_dynamic libc_mount mount "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := syscall_syscall(libc_nanosleep_trampoline_addr, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_nanosleep_trampoline_addr uintptr //go:cgo_import_dynamic libc_nanosleep nanosleep "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Open(path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := syscall_syscall(libc_open_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_open_trampoline_addr uintptr //go:cgo_import_dynamic libc_open open "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := syscall_syscall6(libc_openat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_openat_trampoline_addr uintptr //go:cgo_import_dynamic libc_openat openat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pathconf(path string, name int) (val int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := syscall_syscall(libc_pathconf_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pathconf_trampoline_addr uintptr //go:cgo_import_dynamic libc_pathconf pathconf "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall6(libc_pread_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pread_trampoline_addr uintptr //go:cgo_import_dynamic libc_pread pread "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall6(libc_pwrite_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pwrite_trampoline_addr uintptr //go:cgo_import_dynamic libc_pwrite pwrite "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func read(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_read_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_read_trampoline_addr uintptr //go:cgo_import_dynamic libc_read read "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlink(path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_readlink_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_readlink_trampoline_addr uintptr //go:cgo_import_dynamic libc_readlink readlink "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall6(libc_readlinkat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_readlinkat_trampoline_addr uintptr //go:cgo_import_dynamic libc_readlinkat readlinkat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rename(from string, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := syscall_syscall(libc_rename_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_rename_trampoline_addr uintptr //go:cgo_import_dynamic libc_rename rename "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(fromfd int, from string, tofd int, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := syscall_syscall6(libc_renameat_trampoline_addr, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_renameat_trampoline_addr uintptr //go:cgo_import_dynamic libc_renameat renameat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Revoke(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_revoke_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_revoke_trampoline_addr uintptr //go:cgo_import_dynamic libc_revoke revoke "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rmdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_rmdir_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_rmdir_trampoline_addr uintptr //go:cgo_import_dynamic libc_rmdir rmdir "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { r0, _, e1 := syscall_syscall(libc_lseek_trampoline_addr, uintptr(fd), uintptr(offset), uintptr(whence)) newoffset = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_lseek_trampoline_addr uintptr //go:cgo_import_dynamic libc_lseek lseek "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { r0, _, e1 := syscall_syscall6(libc_select_trampoline_addr, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_select_trampoline_addr uintptr //go:cgo_import_dynamic libc_select select "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setegid(egid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setegid_trampoline_addr, uintptr(egid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setegid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setegid setegid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seteuid(euid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_seteuid_trampoline_addr, uintptr(euid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_seteuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_seteuid seteuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setgid(gid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setgid_trampoline_addr, uintptr(gid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setgid setgid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setlogin(name string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(name) if err != nil { return } _, _, e1 := syscall_syscall(libc_setlogin_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setlogin_trampoline_addr uintptr //go:cgo_import_dynamic libc_setlogin setlogin "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setpgid_trampoline_addr, uintptr(pid), uintptr(pgid), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setpgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setpgid setpgid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpriority(which int, who int, prio int) (err error) { _, _, e1 := syscall_syscall(libc_setpriority_trampoline_addr, uintptr(which), uintptr(who), uintptr(prio)) if e1 != 0 { err = errnoErr(e1) } return } var libc_setpriority_trampoline_addr uintptr //go:cgo_import_dynamic libc_setpriority setpriority "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setregid(rgid int, egid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setregid_trampoline_addr, uintptr(rgid), uintptr(egid), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setregid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setregid setregid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setreuid(ruid int, euid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setreuid_trampoline_addr, uintptr(ruid), uintptr(euid), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setreuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setreuid setreuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresgid(rgid int, egid int, sgid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setresgid_trampoline_addr, uintptr(rgid), uintptr(egid), uintptr(sgid)) if e1 != 0 { err = errnoErr(e1) } return } var libc_setresgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setresgid setresgid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresuid(ruid int, euid int, suid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setresuid_trampoline_addr, uintptr(ruid), uintptr(euid), uintptr(suid)) if e1 != 0 { err = errnoErr(e1) } return } var libc_setresuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setresuid setresuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setrtable(rtable int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setrtable_trampoline_addr, uintptr(rtable), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setrtable_trampoline_addr uintptr //go:cgo_import_dynamic libc_setrtable setrtable "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, err error) { r0, _, e1 := syscall_rawSyscall(libc_setsid_trampoline_addr, 0, 0, 0) pid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setsid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setsid setsid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Settimeofday(tp *Timeval) (err error) { _, _, e1 := syscall_rawSyscall(libc_settimeofday_trampoline_addr, uintptr(unsafe.Pointer(tp)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_settimeofday_trampoline_addr uintptr //go:cgo_import_dynamic libc_settimeofday settimeofday "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setuid(uid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setuid_trampoline_addr, uintptr(uid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setuid setuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Stat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_stat_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_stat_trampoline_addr uintptr //go:cgo_import_dynamic libc_stat stat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Statfs(path string, stat *Statfs_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_statfs_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_statfs_trampoline_addr uintptr //go:cgo_import_dynamic libc_statfs statfs "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlink(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := syscall_syscall(libc_symlink_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_symlink_trampoline_addr uintptr //go:cgo_import_dynamic libc_symlink symlink "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := syscall_syscall(libc_symlinkat_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } var libc_symlinkat_trampoline_addr uintptr //go:cgo_import_dynamic libc_symlinkat symlinkat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sync() (err error) { _, _, e1 := syscall_syscall(libc_sync_trampoline_addr, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_sync_trampoline_addr uintptr //go:cgo_import_dynamic libc_sync sync "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_truncate_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_truncate_trampoline_addr uintptr //go:cgo_import_dynamic libc_truncate truncate "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Umask(newmask int) (oldmask int) { r0, _, _ := syscall_syscall(libc_umask_trampoline_addr, uintptr(newmask), 0, 0) oldmask = int(r0) return } var libc_umask_trampoline_addr uintptr //go:cgo_import_dynamic libc_umask umask "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlink(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_unlink_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_unlink_trampoline_addr uintptr //go:cgo_import_dynamic libc_unlink unlink "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlinkat(dirfd int, path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_unlinkat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } var libc_unlinkat_trampoline_addr uintptr //go:cgo_import_dynamic libc_unlinkat unlinkat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unmount(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_unmount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_unmount_trampoline_addr uintptr //go:cgo_import_dynamic libc_unmount unmount "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func write(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_write_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_write_trampoline_addr uintptr //go:cgo_import_dynamic libc_write write "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { r0, _, e1 := syscall_syscall6(libc_mmap_trampoline_addr, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos)) ret = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mmap_trampoline_addr uintptr //go:cgo_import_dynamic libc_mmap mmap "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func munmap(addr uintptr, length uintptr) (err error) { _, _, e1 := syscall_syscall(libc_munmap_trampoline_addr, uintptr(addr), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_munmap_trampoline_addr uintptr //go:cgo_import_dynamic libc_munmap munmap "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getfsstat(stat *Statfs_t, bufsize uintptr, flags int) (n int, err error) { r0, _, e1 := syscall_syscall(libc_getfsstat_trampoline_addr, uintptr(unsafe.Pointer(stat)), uintptr(bufsize), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getfsstat_trampoline_addr uintptr //go:cgo_import_dynamic libc_getfsstat getfsstat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_utimensat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_utimensat_trampoline_addr uintptr //go:cgo_import_dynamic libc_utimensat utimensat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pledge(promises *byte, execpromises *byte) (err error) { _, _, e1 := syscall_syscall(libc_pledge_trampoline_addr, uintptr(unsafe.Pointer(promises)), uintptr(unsafe.Pointer(execpromises)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pledge_trampoline_addr uintptr //go:cgo_import_dynamic libc_pledge pledge "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func unveil(path *byte, flags *byte) (err error) { _, _, e1 := syscall_syscall(libc_unveil_trampoline_addr, uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(flags)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_unveil_trampoline_addr uintptr //go:cgo_import_dynamic libc_unveil unveil "libc.so" ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s ================================================ // go run mkasm.go openbsd arm64 // Code generated by the command above; DO NOT EDIT. #include "textflag.h" TEXT libc_getgroups_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getgroups(SB) GLOBL ·libc_getgroups_trampoline_addr(SB), RODATA, $8 DATA ·libc_getgroups_trampoline_addr(SB)/8, $libc_getgroups_trampoline<>(SB) TEXT libc_setgroups_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setgroups(SB) GLOBL ·libc_setgroups_trampoline_addr(SB), RODATA, $8 DATA ·libc_setgroups_trampoline_addr(SB)/8, $libc_setgroups_trampoline<>(SB) TEXT libc_wait4_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_wait4(SB) GLOBL ·libc_wait4_trampoline_addr(SB), RODATA, $8 DATA ·libc_wait4_trampoline_addr(SB)/8, $libc_wait4_trampoline<>(SB) TEXT libc_accept_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_accept(SB) GLOBL ·libc_accept_trampoline_addr(SB), RODATA, $8 DATA ·libc_accept_trampoline_addr(SB)/8, $libc_accept_trampoline<>(SB) TEXT libc_bind_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_bind(SB) GLOBL ·libc_bind_trampoline_addr(SB), RODATA, $8 DATA ·libc_bind_trampoline_addr(SB)/8, $libc_bind_trampoline<>(SB) TEXT libc_connect_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_connect(SB) GLOBL ·libc_connect_trampoline_addr(SB), RODATA, $8 DATA ·libc_connect_trampoline_addr(SB)/8, $libc_connect_trampoline<>(SB) TEXT libc_socket_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_socket(SB) GLOBL ·libc_socket_trampoline_addr(SB), RODATA, $8 DATA ·libc_socket_trampoline_addr(SB)/8, $libc_socket_trampoline<>(SB) TEXT libc_getsockopt_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getsockopt(SB) GLOBL ·libc_getsockopt_trampoline_addr(SB), RODATA, $8 DATA ·libc_getsockopt_trampoline_addr(SB)/8, $libc_getsockopt_trampoline<>(SB) TEXT libc_setsockopt_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setsockopt(SB) GLOBL ·libc_setsockopt_trampoline_addr(SB), RODATA, $8 DATA ·libc_setsockopt_trampoline_addr(SB)/8, $libc_setsockopt_trampoline<>(SB) TEXT libc_getpeername_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpeername(SB) GLOBL ·libc_getpeername_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpeername_trampoline_addr(SB)/8, $libc_getpeername_trampoline<>(SB) TEXT libc_getsockname_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getsockname(SB) GLOBL ·libc_getsockname_trampoline_addr(SB), RODATA, $8 DATA ·libc_getsockname_trampoline_addr(SB)/8, $libc_getsockname_trampoline<>(SB) TEXT libc_shutdown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_shutdown(SB) GLOBL ·libc_shutdown_trampoline_addr(SB), RODATA, $8 DATA ·libc_shutdown_trampoline_addr(SB)/8, $libc_shutdown_trampoline<>(SB) TEXT libc_socketpair_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_socketpair(SB) GLOBL ·libc_socketpair_trampoline_addr(SB), RODATA, $8 DATA ·libc_socketpair_trampoline_addr(SB)/8, $libc_socketpair_trampoline<>(SB) TEXT libc_recvfrom_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_recvfrom(SB) GLOBL ·libc_recvfrom_trampoline_addr(SB), RODATA, $8 DATA ·libc_recvfrom_trampoline_addr(SB)/8, $libc_recvfrom_trampoline<>(SB) TEXT libc_sendto_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sendto(SB) GLOBL ·libc_sendto_trampoline_addr(SB), RODATA, $8 DATA ·libc_sendto_trampoline_addr(SB)/8, $libc_sendto_trampoline<>(SB) TEXT libc_recvmsg_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_recvmsg(SB) GLOBL ·libc_recvmsg_trampoline_addr(SB), RODATA, $8 DATA ·libc_recvmsg_trampoline_addr(SB)/8, $libc_recvmsg_trampoline<>(SB) TEXT libc_sendmsg_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sendmsg(SB) GLOBL ·libc_sendmsg_trampoline_addr(SB), RODATA, $8 DATA ·libc_sendmsg_trampoline_addr(SB)/8, $libc_sendmsg_trampoline<>(SB) TEXT libc_kevent_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_kevent(SB) GLOBL ·libc_kevent_trampoline_addr(SB), RODATA, $8 DATA ·libc_kevent_trampoline_addr(SB)/8, $libc_kevent_trampoline<>(SB) TEXT libc_utimes_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_utimes(SB) GLOBL ·libc_utimes_trampoline_addr(SB), RODATA, $8 DATA ·libc_utimes_trampoline_addr(SB)/8, $libc_utimes_trampoline<>(SB) TEXT libc_futimes_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_futimes(SB) GLOBL ·libc_futimes_trampoline_addr(SB), RODATA, $8 DATA ·libc_futimes_trampoline_addr(SB)/8, $libc_futimes_trampoline<>(SB) TEXT libc_poll_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_poll(SB) GLOBL ·libc_poll_trampoline_addr(SB), RODATA, $8 DATA ·libc_poll_trampoline_addr(SB)/8, $libc_poll_trampoline<>(SB) TEXT libc_madvise_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_madvise(SB) GLOBL ·libc_madvise_trampoline_addr(SB), RODATA, $8 DATA ·libc_madvise_trampoline_addr(SB)/8, $libc_madvise_trampoline<>(SB) TEXT libc_mlock_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mlock(SB) GLOBL ·libc_mlock_trampoline_addr(SB), RODATA, $8 DATA ·libc_mlock_trampoline_addr(SB)/8, $libc_mlock_trampoline<>(SB) TEXT libc_mlockall_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mlockall(SB) GLOBL ·libc_mlockall_trampoline_addr(SB), RODATA, $8 DATA ·libc_mlockall_trampoline_addr(SB)/8, $libc_mlockall_trampoline<>(SB) TEXT libc_mprotect_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mprotect(SB) GLOBL ·libc_mprotect_trampoline_addr(SB), RODATA, $8 DATA ·libc_mprotect_trampoline_addr(SB)/8, $libc_mprotect_trampoline<>(SB) TEXT libc_msync_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_msync(SB) GLOBL ·libc_msync_trampoline_addr(SB), RODATA, $8 DATA ·libc_msync_trampoline_addr(SB)/8, $libc_msync_trampoline<>(SB) TEXT libc_munlock_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_munlock(SB) GLOBL ·libc_munlock_trampoline_addr(SB), RODATA, $8 DATA ·libc_munlock_trampoline_addr(SB)/8, $libc_munlock_trampoline<>(SB) TEXT libc_munlockall_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_munlockall(SB) GLOBL ·libc_munlockall_trampoline_addr(SB), RODATA, $8 DATA ·libc_munlockall_trampoline_addr(SB)/8, $libc_munlockall_trampoline<>(SB) TEXT libc_pipe2_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pipe2(SB) GLOBL ·libc_pipe2_trampoline_addr(SB), RODATA, $8 DATA ·libc_pipe2_trampoline_addr(SB)/8, $libc_pipe2_trampoline<>(SB) TEXT libc_getdents_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getdents(SB) GLOBL ·libc_getdents_trampoline_addr(SB), RODATA, $8 DATA ·libc_getdents_trampoline_addr(SB)/8, $libc_getdents_trampoline<>(SB) TEXT libc_getcwd_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getcwd(SB) GLOBL ·libc_getcwd_trampoline_addr(SB), RODATA, $8 DATA ·libc_getcwd_trampoline_addr(SB)/8, $libc_getcwd_trampoline<>(SB) TEXT libc_getresuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getresuid(SB) GLOBL ·libc_getresuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getresuid_trampoline_addr(SB)/8, $libc_getresuid_trampoline<>(SB) TEXT libc_getresgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getresgid(SB) GLOBL ·libc_getresgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getresgid_trampoline_addr(SB)/8, $libc_getresgid_trampoline<>(SB) TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ioctl(SB) GLOBL ·libc_ioctl_trampoline_addr(SB), RODATA, $8 DATA ·libc_ioctl_trampoline_addr(SB)/8, $libc_ioctl_trampoline<>(SB) TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sysctl(SB) GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8 DATA ·libc_sysctl_trampoline_addr(SB)/8, $libc_sysctl_trampoline<>(SB) TEXT libc_fcntl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fcntl(SB) GLOBL ·libc_fcntl_trampoline_addr(SB), RODATA, $8 DATA ·libc_fcntl_trampoline_addr(SB)/8, $libc_fcntl_trampoline<>(SB) TEXT libc_ppoll_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ppoll(SB) GLOBL ·libc_ppoll_trampoline_addr(SB), RODATA, $8 DATA ·libc_ppoll_trampoline_addr(SB)/8, $libc_ppoll_trampoline<>(SB) TEXT libc_access_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_access(SB) GLOBL ·libc_access_trampoline_addr(SB), RODATA, $8 DATA ·libc_access_trampoline_addr(SB)/8, $libc_access_trampoline<>(SB) TEXT libc_adjtime_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_adjtime(SB) GLOBL ·libc_adjtime_trampoline_addr(SB), RODATA, $8 DATA ·libc_adjtime_trampoline_addr(SB)/8, $libc_adjtime_trampoline<>(SB) TEXT libc_chdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chdir(SB) GLOBL ·libc_chdir_trampoline_addr(SB), RODATA, $8 DATA ·libc_chdir_trampoline_addr(SB)/8, $libc_chdir_trampoline<>(SB) TEXT libc_chflags_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chflags(SB) GLOBL ·libc_chflags_trampoline_addr(SB), RODATA, $8 DATA ·libc_chflags_trampoline_addr(SB)/8, $libc_chflags_trampoline<>(SB) TEXT libc_chmod_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chmod(SB) GLOBL ·libc_chmod_trampoline_addr(SB), RODATA, $8 DATA ·libc_chmod_trampoline_addr(SB)/8, $libc_chmod_trampoline<>(SB) TEXT libc_chown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chown(SB) GLOBL ·libc_chown_trampoline_addr(SB), RODATA, $8 DATA ·libc_chown_trampoline_addr(SB)/8, $libc_chown_trampoline<>(SB) TEXT libc_chroot_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chroot(SB) GLOBL ·libc_chroot_trampoline_addr(SB), RODATA, $8 DATA ·libc_chroot_trampoline_addr(SB)/8, $libc_chroot_trampoline<>(SB) TEXT libc_clock_gettime_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_clock_gettime(SB) GLOBL ·libc_clock_gettime_trampoline_addr(SB), RODATA, $8 DATA ·libc_clock_gettime_trampoline_addr(SB)/8, $libc_clock_gettime_trampoline<>(SB) TEXT libc_close_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_close(SB) GLOBL ·libc_close_trampoline_addr(SB), RODATA, $8 DATA ·libc_close_trampoline_addr(SB)/8, $libc_close_trampoline<>(SB) TEXT libc_dup_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_dup(SB) GLOBL ·libc_dup_trampoline_addr(SB), RODATA, $8 DATA ·libc_dup_trampoline_addr(SB)/8, $libc_dup_trampoline<>(SB) TEXT libc_dup2_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_dup2(SB) GLOBL ·libc_dup2_trampoline_addr(SB), RODATA, $8 DATA ·libc_dup2_trampoline_addr(SB)/8, $libc_dup2_trampoline<>(SB) TEXT libc_dup3_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_dup3(SB) GLOBL ·libc_dup3_trampoline_addr(SB), RODATA, $8 DATA ·libc_dup3_trampoline_addr(SB)/8, $libc_dup3_trampoline<>(SB) TEXT libc_exit_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_exit(SB) GLOBL ·libc_exit_trampoline_addr(SB), RODATA, $8 DATA ·libc_exit_trampoline_addr(SB)/8, $libc_exit_trampoline<>(SB) TEXT libc_faccessat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_faccessat(SB) GLOBL ·libc_faccessat_trampoline_addr(SB), RODATA, $8 DATA ·libc_faccessat_trampoline_addr(SB)/8, $libc_faccessat_trampoline<>(SB) TEXT libc_fchdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchdir(SB) GLOBL ·libc_fchdir_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchdir_trampoline_addr(SB)/8, $libc_fchdir_trampoline<>(SB) TEXT libc_fchflags_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchflags(SB) GLOBL ·libc_fchflags_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchflags_trampoline_addr(SB)/8, $libc_fchflags_trampoline<>(SB) TEXT libc_fchmod_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchmod(SB) GLOBL ·libc_fchmod_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchmod_trampoline_addr(SB)/8, $libc_fchmod_trampoline<>(SB) TEXT libc_fchmodat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchmodat(SB) GLOBL ·libc_fchmodat_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchmodat_trampoline_addr(SB)/8, $libc_fchmodat_trampoline<>(SB) TEXT libc_fchown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchown(SB) GLOBL ·libc_fchown_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchown_trampoline_addr(SB)/8, $libc_fchown_trampoline<>(SB) TEXT libc_fchownat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchownat(SB) GLOBL ·libc_fchownat_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchownat_trampoline_addr(SB)/8, $libc_fchownat_trampoline<>(SB) TEXT libc_flock_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_flock(SB) GLOBL ·libc_flock_trampoline_addr(SB), RODATA, $8 DATA ·libc_flock_trampoline_addr(SB)/8, $libc_flock_trampoline<>(SB) TEXT libc_fpathconf_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fpathconf(SB) GLOBL ·libc_fpathconf_trampoline_addr(SB), RODATA, $8 DATA ·libc_fpathconf_trampoline_addr(SB)/8, $libc_fpathconf_trampoline<>(SB) TEXT libc_fstat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fstat(SB) GLOBL ·libc_fstat_trampoline_addr(SB), RODATA, $8 DATA ·libc_fstat_trampoline_addr(SB)/8, $libc_fstat_trampoline<>(SB) TEXT libc_fstatat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fstatat(SB) GLOBL ·libc_fstatat_trampoline_addr(SB), RODATA, $8 DATA ·libc_fstatat_trampoline_addr(SB)/8, $libc_fstatat_trampoline<>(SB) TEXT libc_fstatfs_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fstatfs(SB) GLOBL ·libc_fstatfs_trampoline_addr(SB), RODATA, $8 DATA ·libc_fstatfs_trampoline_addr(SB)/8, $libc_fstatfs_trampoline<>(SB) TEXT libc_fsync_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fsync(SB) GLOBL ·libc_fsync_trampoline_addr(SB), RODATA, $8 DATA ·libc_fsync_trampoline_addr(SB)/8, $libc_fsync_trampoline<>(SB) TEXT libc_ftruncate_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ftruncate(SB) GLOBL ·libc_ftruncate_trampoline_addr(SB), RODATA, $8 DATA ·libc_ftruncate_trampoline_addr(SB)/8, $libc_ftruncate_trampoline<>(SB) TEXT libc_getegid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getegid(SB) GLOBL ·libc_getegid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getegid_trampoline_addr(SB)/8, $libc_getegid_trampoline<>(SB) TEXT libc_geteuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_geteuid(SB) GLOBL ·libc_geteuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_geteuid_trampoline_addr(SB)/8, $libc_geteuid_trampoline<>(SB) TEXT libc_getgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getgid(SB) GLOBL ·libc_getgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getgid_trampoline_addr(SB)/8, $libc_getgid_trampoline<>(SB) TEXT libc_getpgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpgid(SB) GLOBL ·libc_getpgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpgid_trampoline_addr(SB)/8, $libc_getpgid_trampoline<>(SB) TEXT libc_getpgrp_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpgrp(SB) GLOBL ·libc_getpgrp_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpgrp_trampoline_addr(SB)/8, $libc_getpgrp_trampoline<>(SB) TEXT libc_getpid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpid(SB) GLOBL ·libc_getpid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpid_trampoline_addr(SB)/8, $libc_getpid_trampoline<>(SB) TEXT libc_getppid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getppid(SB) GLOBL ·libc_getppid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getppid_trampoline_addr(SB)/8, $libc_getppid_trampoline<>(SB) TEXT libc_getpriority_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpriority(SB) GLOBL ·libc_getpriority_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpriority_trampoline_addr(SB)/8, $libc_getpriority_trampoline<>(SB) TEXT libc_getrlimit_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getrlimit(SB) GLOBL ·libc_getrlimit_trampoline_addr(SB), RODATA, $8 DATA ·libc_getrlimit_trampoline_addr(SB)/8, $libc_getrlimit_trampoline<>(SB) TEXT libc_getrtable_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getrtable(SB) GLOBL ·libc_getrtable_trampoline_addr(SB), RODATA, $8 DATA ·libc_getrtable_trampoline_addr(SB)/8, $libc_getrtable_trampoline<>(SB) TEXT libc_getrusage_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getrusage(SB) GLOBL ·libc_getrusage_trampoline_addr(SB), RODATA, $8 DATA ·libc_getrusage_trampoline_addr(SB)/8, $libc_getrusage_trampoline<>(SB) TEXT libc_getsid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getsid(SB) GLOBL ·libc_getsid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getsid_trampoline_addr(SB)/8, $libc_getsid_trampoline<>(SB) TEXT libc_gettimeofday_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_gettimeofday(SB) GLOBL ·libc_gettimeofday_trampoline_addr(SB), RODATA, $8 DATA ·libc_gettimeofday_trampoline_addr(SB)/8, $libc_gettimeofday_trampoline<>(SB) TEXT libc_getuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getuid(SB) GLOBL ·libc_getuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getuid_trampoline_addr(SB)/8, $libc_getuid_trampoline<>(SB) TEXT libc_issetugid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_issetugid(SB) GLOBL ·libc_issetugid_trampoline_addr(SB), RODATA, $8 DATA ·libc_issetugid_trampoline_addr(SB)/8, $libc_issetugid_trampoline<>(SB) TEXT libc_kill_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_kill(SB) GLOBL ·libc_kill_trampoline_addr(SB), RODATA, $8 DATA ·libc_kill_trampoline_addr(SB)/8, $libc_kill_trampoline<>(SB) TEXT libc_kqueue_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_kqueue(SB) GLOBL ·libc_kqueue_trampoline_addr(SB), RODATA, $8 DATA ·libc_kqueue_trampoline_addr(SB)/8, $libc_kqueue_trampoline<>(SB) TEXT libc_lchown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_lchown(SB) GLOBL ·libc_lchown_trampoline_addr(SB), RODATA, $8 DATA ·libc_lchown_trampoline_addr(SB)/8, $libc_lchown_trampoline<>(SB) TEXT libc_link_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_link(SB) GLOBL ·libc_link_trampoline_addr(SB), RODATA, $8 DATA ·libc_link_trampoline_addr(SB)/8, $libc_link_trampoline<>(SB) TEXT libc_linkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_linkat(SB) GLOBL ·libc_linkat_trampoline_addr(SB), RODATA, $8 DATA ·libc_linkat_trampoline_addr(SB)/8, $libc_linkat_trampoline<>(SB) TEXT libc_listen_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_listen(SB) GLOBL ·libc_listen_trampoline_addr(SB), RODATA, $8 DATA ·libc_listen_trampoline_addr(SB)/8, $libc_listen_trampoline<>(SB) TEXT libc_lstat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_lstat(SB) GLOBL ·libc_lstat_trampoline_addr(SB), RODATA, $8 DATA ·libc_lstat_trampoline_addr(SB)/8, $libc_lstat_trampoline<>(SB) TEXT libc_mkdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkdir(SB) GLOBL ·libc_mkdir_trampoline_addr(SB), RODATA, $8 DATA ·libc_mkdir_trampoline_addr(SB)/8, $libc_mkdir_trampoline<>(SB) TEXT libc_mkdirat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkdirat(SB) GLOBL ·libc_mkdirat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mkdirat_trampoline_addr(SB)/8, $libc_mkdirat_trampoline<>(SB) TEXT libc_mkfifo_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkfifo(SB) GLOBL ·libc_mkfifo_trampoline_addr(SB), RODATA, $8 DATA ·libc_mkfifo_trampoline_addr(SB)/8, $libc_mkfifo_trampoline<>(SB) TEXT libc_mkfifoat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkfifoat(SB) GLOBL ·libc_mkfifoat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mkfifoat_trampoline_addr(SB)/8, $libc_mkfifoat_trampoline<>(SB) TEXT libc_mknod_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mknod(SB) GLOBL ·libc_mknod_trampoline_addr(SB), RODATA, $8 DATA ·libc_mknod_trampoline_addr(SB)/8, $libc_mknod_trampoline<>(SB) TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mknodat(SB) GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mknodat_trampoline_addr(SB)/8, $libc_mknodat_trampoline<>(SB) TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mount(SB) GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $8 DATA ·libc_mount_trampoline_addr(SB)/8, $libc_mount_trampoline<>(SB) TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_nanosleep(SB) GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $8 DATA ·libc_nanosleep_trampoline_addr(SB)/8, $libc_nanosleep_trampoline<>(SB) TEXT libc_open_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_open(SB) GLOBL ·libc_open_trampoline_addr(SB), RODATA, $8 DATA ·libc_open_trampoline_addr(SB)/8, $libc_open_trampoline<>(SB) TEXT libc_openat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_openat(SB) GLOBL ·libc_openat_trampoline_addr(SB), RODATA, $8 DATA ·libc_openat_trampoline_addr(SB)/8, $libc_openat_trampoline<>(SB) TEXT libc_pathconf_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pathconf(SB) GLOBL ·libc_pathconf_trampoline_addr(SB), RODATA, $8 DATA ·libc_pathconf_trampoline_addr(SB)/8, $libc_pathconf_trampoline<>(SB) TEXT libc_pread_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pread(SB) GLOBL ·libc_pread_trampoline_addr(SB), RODATA, $8 DATA ·libc_pread_trampoline_addr(SB)/8, $libc_pread_trampoline<>(SB) TEXT libc_pwrite_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pwrite(SB) GLOBL ·libc_pwrite_trampoline_addr(SB), RODATA, $8 DATA ·libc_pwrite_trampoline_addr(SB)/8, $libc_pwrite_trampoline<>(SB) TEXT libc_read_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_read(SB) GLOBL ·libc_read_trampoline_addr(SB), RODATA, $8 DATA ·libc_read_trampoline_addr(SB)/8, $libc_read_trampoline<>(SB) TEXT libc_readlink_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_readlink(SB) GLOBL ·libc_readlink_trampoline_addr(SB), RODATA, $8 DATA ·libc_readlink_trampoline_addr(SB)/8, $libc_readlink_trampoline<>(SB) TEXT libc_readlinkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_readlinkat(SB) GLOBL ·libc_readlinkat_trampoline_addr(SB), RODATA, $8 DATA ·libc_readlinkat_trampoline_addr(SB)/8, $libc_readlinkat_trampoline<>(SB) TEXT libc_rename_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_rename(SB) GLOBL ·libc_rename_trampoline_addr(SB), RODATA, $8 DATA ·libc_rename_trampoline_addr(SB)/8, $libc_rename_trampoline<>(SB) TEXT libc_renameat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_renameat(SB) GLOBL ·libc_renameat_trampoline_addr(SB), RODATA, $8 DATA ·libc_renameat_trampoline_addr(SB)/8, $libc_renameat_trampoline<>(SB) TEXT libc_revoke_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_revoke(SB) GLOBL ·libc_revoke_trampoline_addr(SB), RODATA, $8 DATA ·libc_revoke_trampoline_addr(SB)/8, $libc_revoke_trampoline<>(SB) TEXT libc_rmdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_rmdir(SB) GLOBL ·libc_rmdir_trampoline_addr(SB), RODATA, $8 DATA ·libc_rmdir_trampoline_addr(SB)/8, $libc_rmdir_trampoline<>(SB) TEXT libc_lseek_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_lseek(SB) GLOBL ·libc_lseek_trampoline_addr(SB), RODATA, $8 DATA ·libc_lseek_trampoline_addr(SB)/8, $libc_lseek_trampoline<>(SB) TEXT libc_select_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_select(SB) GLOBL ·libc_select_trampoline_addr(SB), RODATA, $8 DATA ·libc_select_trampoline_addr(SB)/8, $libc_select_trampoline<>(SB) TEXT libc_setegid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setegid(SB) GLOBL ·libc_setegid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setegid_trampoline_addr(SB)/8, $libc_setegid_trampoline<>(SB) TEXT libc_seteuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_seteuid(SB) GLOBL ·libc_seteuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_seteuid_trampoline_addr(SB)/8, $libc_seteuid_trampoline<>(SB) TEXT libc_setgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setgid(SB) GLOBL ·libc_setgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setgid_trampoline_addr(SB)/8, $libc_setgid_trampoline<>(SB) TEXT libc_setlogin_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setlogin(SB) GLOBL ·libc_setlogin_trampoline_addr(SB), RODATA, $8 DATA ·libc_setlogin_trampoline_addr(SB)/8, $libc_setlogin_trampoline<>(SB) TEXT libc_setpgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setpgid(SB) GLOBL ·libc_setpgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setpgid_trampoline_addr(SB)/8, $libc_setpgid_trampoline<>(SB) TEXT libc_setpriority_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setpriority(SB) GLOBL ·libc_setpriority_trampoline_addr(SB), RODATA, $8 DATA ·libc_setpriority_trampoline_addr(SB)/8, $libc_setpriority_trampoline<>(SB) TEXT libc_setregid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setregid(SB) GLOBL ·libc_setregid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setregid_trampoline_addr(SB)/8, $libc_setregid_trampoline<>(SB) TEXT libc_setreuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setreuid(SB) GLOBL ·libc_setreuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setreuid_trampoline_addr(SB)/8, $libc_setreuid_trampoline<>(SB) TEXT libc_setresgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setresgid(SB) GLOBL ·libc_setresgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setresgid_trampoline_addr(SB)/8, $libc_setresgid_trampoline<>(SB) TEXT libc_setresuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setresuid(SB) GLOBL ·libc_setresuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setresuid_trampoline_addr(SB)/8, $libc_setresuid_trampoline<>(SB) TEXT libc_setrtable_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setrtable(SB) GLOBL ·libc_setrtable_trampoline_addr(SB), RODATA, $8 DATA ·libc_setrtable_trampoline_addr(SB)/8, $libc_setrtable_trampoline<>(SB) TEXT libc_setsid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setsid(SB) GLOBL ·libc_setsid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setsid_trampoline_addr(SB)/8, $libc_setsid_trampoline<>(SB) TEXT libc_settimeofday_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_settimeofday(SB) GLOBL ·libc_settimeofday_trampoline_addr(SB), RODATA, $8 DATA ·libc_settimeofday_trampoline_addr(SB)/8, $libc_settimeofday_trampoline<>(SB) TEXT libc_setuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setuid(SB) GLOBL ·libc_setuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setuid_trampoline_addr(SB)/8, $libc_setuid_trampoline<>(SB) TEXT libc_stat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_stat(SB) GLOBL ·libc_stat_trampoline_addr(SB), RODATA, $8 DATA ·libc_stat_trampoline_addr(SB)/8, $libc_stat_trampoline<>(SB) TEXT libc_statfs_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_statfs(SB) GLOBL ·libc_statfs_trampoline_addr(SB), RODATA, $8 DATA ·libc_statfs_trampoline_addr(SB)/8, $libc_statfs_trampoline<>(SB) TEXT libc_symlink_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_symlink(SB) GLOBL ·libc_symlink_trampoline_addr(SB), RODATA, $8 DATA ·libc_symlink_trampoline_addr(SB)/8, $libc_symlink_trampoline<>(SB) TEXT libc_symlinkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_symlinkat(SB) GLOBL ·libc_symlinkat_trampoline_addr(SB), RODATA, $8 DATA ·libc_symlinkat_trampoline_addr(SB)/8, $libc_symlinkat_trampoline<>(SB) TEXT libc_sync_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sync(SB) GLOBL ·libc_sync_trampoline_addr(SB), RODATA, $8 DATA ·libc_sync_trampoline_addr(SB)/8, $libc_sync_trampoline<>(SB) TEXT libc_truncate_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_truncate(SB) GLOBL ·libc_truncate_trampoline_addr(SB), RODATA, $8 DATA ·libc_truncate_trampoline_addr(SB)/8, $libc_truncate_trampoline<>(SB) TEXT libc_umask_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_umask(SB) GLOBL ·libc_umask_trampoline_addr(SB), RODATA, $8 DATA ·libc_umask_trampoline_addr(SB)/8, $libc_umask_trampoline<>(SB) TEXT libc_unlink_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_unlink(SB) GLOBL ·libc_unlink_trampoline_addr(SB), RODATA, $8 DATA ·libc_unlink_trampoline_addr(SB)/8, $libc_unlink_trampoline<>(SB) TEXT libc_unlinkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_unlinkat(SB) GLOBL ·libc_unlinkat_trampoline_addr(SB), RODATA, $8 DATA ·libc_unlinkat_trampoline_addr(SB)/8, $libc_unlinkat_trampoline<>(SB) TEXT libc_unmount_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_unmount(SB) GLOBL ·libc_unmount_trampoline_addr(SB), RODATA, $8 DATA ·libc_unmount_trampoline_addr(SB)/8, $libc_unmount_trampoline<>(SB) TEXT libc_write_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_write(SB) GLOBL ·libc_write_trampoline_addr(SB), RODATA, $8 DATA ·libc_write_trampoline_addr(SB)/8, $libc_write_trampoline<>(SB) TEXT libc_mmap_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mmap(SB) GLOBL ·libc_mmap_trampoline_addr(SB), RODATA, $8 DATA ·libc_mmap_trampoline_addr(SB)/8, $libc_mmap_trampoline<>(SB) TEXT libc_munmap_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_munmap(SB) GLOBL ·libc_munmap_trampoline_addr(SB), RODATA, $8 DATA ·libc_munmap_trampoline_addr(SB)/8, $libc_munmap_trampoline<>(SB) TEXT libc_getfsstat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getfsstat(SB) GLOBL ·libc_getfsstat_trampoline_addr(SB), RODATA, $8 DATA ·libc_getfsstat_trampoline_addr(SB)/8, $libc_getfsstat_trampoline<>(SB) TEXT libc_utimensat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_utimensat(SB) GLOBL ·libc_utimensat_trampoline_addr(SB), RODATA, $8 DATA ·libc_utimensat_trampoline_addr(SB)/8, $libc_utimensat_trampoline<>(SB) TEXT libc_pledge_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pledge(SB) GLOBL ·libc_pledge_trampoline_addr(SB), RODATA, $8 DATA ·libc_pledge_trampoline_addr(SB)/8, $libc_pledge_trampoline<>(SB) TEXT libc_unveil_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_unveil(SB) GLOBL ·libc_unveil_trampoline_addr(SB), RODATA, $8 DATA ·libc_unveil_trampoline_addr(SB)/8, $libc_unveil_trampoline<>(SB) ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go ================================================ // go run mksyscall.go -openbsd -libc -tags openbsd,mips64 syscall_bsd.go syscall_openbsd.go syscall_openbsd_mips64.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build openbsd && mips64 package unix import ( "syscall" "unsafe" ) var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(ngid int, gid *_Gid_t) (n int, err error) { r0, _, e1 := syscall_rawSyscall(libc_getgroups_trampoline_addr, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getgroups_trampoline_addr uintptr //go:cgo_import_dynamic libc_getgroups getgroups "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(ngid int, gid *_Gid_t) (err error) { _, _, e1 := syscall_rawSyscall(libc_setgroups_trampoline_addr, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setgroups_trampoline_addr uintptr //go:cgo_import_dynamic libc_setgroups setgroups "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) { r0, _, e1 := syscall_syscall6(libc_wait4_trampoline_addr, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) wpid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_wait4_trampoline_addr uintptr //go:cgo_import_dynamic libc_wait4 wait4 "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { r0, _, e1 := syscall_syscall(libc_accept_trampoline_addr, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_accept_trampoline_addr uintptr //go:cgo_import_dynamic libc_accept accept "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := syscall_syscall(libc_bind_trampoline_addr, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } var libc_bind_trampoline_addr uintptr //go:cgo_import_dynamic libc_bind bind "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := syscall_syscall(libc_connect_trampoline_addr, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } var libc_connect_trampoline_addr uintptr //go:cgo_import_dynamic libc_connect connect "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { r0, _, e1 := syscall_rawSyscall(libc_socket_trampoline_addr, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_socket_trampoline_addr uintptr //go:cgo_import_dynamic libc_socket socket "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { _, _, e1 := syscall_syscall6(libc_getsockopt_trampoline_addr, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getsockopt_trampoline_addr uintptr //go:cgo_import_dynamic libc_getsockopt getsockopt "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { _, _, e1 := syscall_syscall6(libc_setsockopt_trampoline_addr, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setsockopt_trampoline_addr uintptr //go:cgo_import_dynamic libc_setsockopt setsockopt "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := syscall_rawSyscall(libc_getpeername_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } var libc_getpeername_trampoline_addr uintptr //go:cgo_import_dynamic libc_getpeername getpeername "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := syscall_rawSyscall(libc_getsockname_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } var libc_getsockname_trampoline_addr uintptr //go:cgo_import_dynamic libc_getsockname getsockname "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(s int, how int) (err error) { _, _, e1 := syscall_syscall(libc_shutdown_trampoline_addr, uintptr(s), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_shutdown_trampoline_addr uintptr //go:cgo_import_dynamic libc_shutdown shutdown "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { _, _, e1 := syscall_rawSyscall6(libc_socketpair_trampoline_addr, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_socketpair_trampoline_addr uintptr //go:cgo_import_dynamic libc_socketpair socketpair "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall6(libc_recvfrom_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_recvfrom_trampoline_addr uintptr //go:cgo_import_dynamic libc_recvfrom recvfrom "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall6(libc_sendto_trampoline_addr, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } var libc_sendto_trampoline_addr uintptr //go:cgo_import_dynamic libc_sendto sendto "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := syscall_syscall(libc_recvmsg_trampoline_addr, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_recvmsg_trampoline_addr uintptr //go:cgo_import_dynamic libc_recvmsg recvmsg "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := syscall_syscall(libc_sendmsg_trampoline_addr, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_sendmsg_trampoline_addr uintptr //go:cgo_import_dynamic libc_sendmsg sendmsg "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) { r0, _, e1 := syscall_syscall6(libc_kevent_trampoline_addr, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_kevent_trampoline_addr uintptr //go:cgo_import_dynamic libc_kevent kevent "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, timeval *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_utimes_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_utimes_trampoline_addr uintptr //go:cgo_import_dynamic libc_utimes utimes "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func futimes(fd int, timeval *[2]Timeval) (err error) { _, _, e1 := syscall_syscall(libc_futimes_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_futimes_trampoline_addr uintptr //go:cgo_import_dynamic libc_futimes futimes "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := syscall_syscall(libc_poll_trampoline_addr, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_poll_trampoline_addr uintptr //go:cgo_import_dynamic libc_poll poll "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Madvise(b []byte, behav int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall(libc_madvise_trampoline_addr, uintptr(_p0), uintptr(len(b)), uintptr(behav)) if e1 != 0 { err = errnoErr(e1) } return } var libc_madvise_trampoline_addr uintptr //go:cgo_import_dynamic libc_madvise madvise "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall(libc_mlock_trampoline_addr, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mlock_trampoline_addr uintptr //go:cgo_import_dynamic libc_mlock mlock "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlockall(flags int) (err error) { _, _, e1 := syscall_syscall(libc_mlockall_trampoline_addr, uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mlockall_trampoline_addr uintptr //go:cgo_import_dynamic libc_mlockall mlockall "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mprotect(b []byte, prot int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall(libc_mprotect_trampoline_addr, uintptr(_p0), uintptr(len(b)), uintptr(prot)) if e1 != 0 { err = errnoErr(e1) } return } var libc_mprotect_trampoline_addr uintptr //go:cgo_import_dynamic libc_mprotect mprotect "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Msync(b []byte, flags int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall(libc_msync_trampoline_addr, uintptr(_p0), uintptr(len(b)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } var libc_msync_trampoline_addr uintptr //go:cgo_import_dynamic libc_msync msync "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall(libc_munlock_trampoline_addr, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_munlock_trampoline_addr uintptr //go:cgo_import_dynamic libc_munlock munlock "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlockall() (err error) { _, _, e1 := syscall_syscall(libc_munlockall_trampoline_addr, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_munlockall_trampoline_addr uintptr //go:cgo_import_dynamic libc_munlockall munlockall "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe2(p *[2]_C_int, flags int) (err error) { _, _, e1 := syscall_rawSyscall(libc_pipe2_trampoline_addr, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pipe2_trampoline_addr uintptr //go:cgo_import_dynamic libc_pipe2 pipe2 "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getdents(fd int, buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_getdents_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getdents_trampoline_addr uintptr //go:cgo_import_dynamic libc_getdents getdents "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getcwd(buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_getcwd_trampoline_addr, uintptr(_p0), uintptr(len(buf)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getcwd_trampoline_addr uintptr //go:cgo_import_dynamic libc_getcwd getcwd "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getresuid(ruid *_C_int, euid *_C_int, suid *_C_int) { syscall_rawSyscall(libc_getresuid_trampoline_addr, uintptr(unsafe.Pointer(ruid)), uintptr(unsafe.Pointer(euid)), uintptr(unsafe.Pointer(suid))) return } var libc_getresuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getresuid getresuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getresgid(rgid *_C_int, egid *_C_int, sgid *_C_int) { syscall_rawSyscall(libc_getresgid_trampoline_addr, uintptr(unsafe.Pointer(rgid)), uintptr(unsafe.Pointer(egid)), uintptr(unsafe.Pointer(sgid))) return } var libc_getresgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getresgid getresgid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctl(fd int, req uint, arg uintptr) (err error) { _, _, e1 := syscall_syscall(libc_ioctl_trampoline_addr, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } var libc_ioctl_trampoline_addr uintptr //go:cgo_import_dynamic libc_ioctl ioctl "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) { _, _, e1 := syscall_syscall(libc_ioctl_trampoline_addr, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { var _p0 unsafe.Pointer if len(mib) > 0 { _p0 = unsafe.Pointer(&mib[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall6(libc_sysctl_trampoline_addr, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) if e1 != 0 { err = errnoErr(e1) } return } var libc_sysctl_trampoline_addr uintptr //go:cgo_import_dynamic libc_sysctl sysctl "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fcntl(fd int, cmd int, arg int) (n int, err error) { r0, _, e1 := syscall_syscall(libc_fcntl_trampoline_addr, uintptr(fd), uintptr(cmd), uintptr(arg)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fcntl_trampoline_addr uintptr //go:cgo_import_dynamic libc_fcntl fcntl "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fcntlPtr(fd int, cmd int, arg unsafe.Pointer) (n int, err error) { r0, _, e1 := syscall_syscall(libc_fcntl_trampoline_addr, uintptr(fd), uintptr(cmd), uintptr(arg)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { r0, _, e1 := syscall_syscall6(libc_ppoll_trampoline_addr, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_ppoll_trampoline_addr uintptr //go:cgo_import_dynamic libc_ppoll ppoll "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Access(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_access_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_access_trampoline_addr uintptr //go:cgo_import_dynamic libc_access access "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Adjtime(delta *Timeval, olddelta *Timeval) (err error) { _, _, e1 := syscall_syscall(libc_adjtime_trampoline_addr, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_adjtime_trampoline_addr uintptr //go:cgo_import_dynamic libc_adjtime adjtime "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_chdir_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_chdir_trampoline_addr uintptr //go:cgo_import_dynamic libc_chdir chdir "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chflags(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_chflags_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_chflags_trampoline_addr uintptr //go:cgo_import_dynamic libc_chflags chflags "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chmod(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_chmod_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_chmod_trampoline_addr uintptr //go:cgo_import_dynamic libc_chmod chmod "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_chown_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } var libc_chown_trampoline_addr uintptr //go:cgo_import_dynamic libc_chown chown "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chroot(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_chroot_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_chroot_trampoline_addr uintptr //go:cgo_import_dynamic libc_chroot chroot "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ClockGettime(clockid int32, time *Timespec) (err error) { _, _, e1 := syscall_syscall(libc_clock_gettime_trampoline_addr, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_clock_gettime_trampoline_addr uintptr //go:cgo_import_dynamic libc_clock_gettime clock_gettime "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Close(fd int) (err error) { _, _, e1 := syscall_syscall(libc_close_trampoline_addr, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_close_trampoline_addr uintptr //go:cgo_import_dynamic libc_close close "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(fd int) (nfd int, err error) { r0, _, e1 := syscall_syscall(libc_dup_trampoline_addr, uintptr(fd), 0, 0) nfd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_dup_trampoline_addr uintptr //go:cgo_import_dynamic libc_dup dup "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup2(from int, to int) (err error) { _, _, e1 := syscall_syscall(libc_dup2_trampoline_addr, uintptr(from), uintptr(to), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_dup2_trampoline_addr uintptr //go:cgo_import_dynamic libc_dup2 dup2 "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup3(from int, to int, flags int) (err error) { _, _, e1 := syscall_syscall(libc_dup3_trampoline_addr, uintptr(from), uintptr(to), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } var libc_dup3_trampoline_addr uintptr //go:cgo_import_dynamic libc_dup3 dup3 "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Exit(code int) { syscall_syscall(libc_exit_trampoline_addr, uintptr(code), 0, 0) return } var libc_exit_trampoline_addr uintptr //go:cgo_import_dynamic libc_exit exit "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_faccessat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_faccessat_trampoline_addr uintptr //go:cgo_import_dynamic libc_faccessat faccessat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchdir(fd int) (err error) { _, _, e1 := syscall_syscall(libc_fchdir_trampoline_addr, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchdir_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchdir fchdir "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchflags(fd int, flags int) (err error) { _, _, e1 := syscall_syscall(libc_fchflags_trampoline_addr, uintptr(fd), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchflags_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchflags fchflags "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmod(fd int, mode uint32) (err error) { _, _, e1 := syscall_syscall(libc_fchmod_trampoline_addr, uintptr(fd), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchmod_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchmod fchmod "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_fchmodat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchmodat_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchmodat fchmodat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := syscall_syscall(libc_fchown_trampoline_addr, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchown_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchown fchown "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_fchownat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchownat_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchownat fchownat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Flock(fd int, how int) (err error) { _, _, e1 := syscall_syscall(libc_flock_trampoline_addr, uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_flock_trampoline_addr uintptr //go:cgo_import_dynamic libc_flock flock "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fpathconf(fd int, name int) (val int, err error) { r0, _, e1 := syscall_syscall(libc_fpathconf_trampoline_addr, uintptr(fd), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fpathconf_trampoline_addr uintptr //go:cgo_import_dynamic libc_fpathconf fpathconf "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := syscall_syscall(libc_fstat_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fstat_trampoline_addr uintptr //go:cgo_import_dynamic libc_fstat fstat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_fstatat_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fstatat_trampoline_addr uintptr //go:cgo_import_dynamic libc_fstatat fstatat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatfs(fd int, stat *Statfs_t) (err error) { _, _, e1 := syscall_syscall(libc_fstatfs_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fstatfs_trampoline_addr uintptr //go:cgo_import_dynamic libc_fstatfs fstatfs "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fsync(fd int) (err error) { _, _, e1 := syscall_syscall(libc_fsync_trampoline_addr, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fsync_trampoline_addr uintptr //go:cgo_import_dynamic libc_fsync fsync "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { _, _, e1 := syscall_syscall(libc_ftruncate_trampoline_addr, uintptr(fd), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_ftruncate_trampoline_addr uintptr //go:cgo_import_dynamic libc_ftruncate ftruncate "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { r0, _, _ := syscall_rawSyscall(libc_getegid_trampoline_addr, 0, 0, 0) egid = int(r0) return } var libc_getegid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getegid getegid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (uid int) { r0, _, _ := syscall_rawSyscall(libc_geteuid_trampoline_addr, 0, 0, 0) uid = int(r0) return } var libc_geteuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_geteuid geteuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _, _ := syscall_rawSyscall(libc_getgid_trampoline_addr, 0, 0, 0) gid = int(r0) return } var libc_getgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getgid getgid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgid(pid int) (pgid int, err error) { r0, _, e1 := syscall_rawSyscall(libc_getpgid_trampoline_addr, uintptr(pid), 0, 0) pgid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getpgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getpgid getpgid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgrp() (pgrp int) { r0, _, _ := syscall_rawSyscall(libc_getpgrp_trampoline_addr, 0, 0, 0) pgrp = int(r0) return } var libc_getpgrp_trampoline_addr uintptr //go:cgo_import_dynamic libc_getpgrp getpgrp "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpid() (pid int) { r0, _, _ := syscall_rawSyscall(libc_getpid_trampoline_addr, 0, 0, 0) pid = int(r0) return } var libc_getpid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getpid getpid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getppid() (ppid int) { r0, _, _ := syscall_rawSyscall(libc_getppid_trampoline_addr, 0, 0, 0) ppid = int(r0) return } var libc_getppid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getppid getppid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpriority(which int, who int) (prio int, err error) { r0, _, e1 := syscall_syscall(libc_getpriority_trampoline_addr, uintptr(which), uintptr(who), 0) prio = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getpriority_trampoline_addr uintptr //go:cgo_import_dynamic libc_getpriority getpriority "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(which int, lim *Rlimit) (err error) { _, _, e1 := syscall_rawSyscall(libc_getrlimit_trampoline_addr, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getrlimit_trampoline_addr uintptr //go:cgo_import_dynamic libc_getrlimit getrlimit "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrtable() (rtable int, err error) { r0, _, e1 := syscall_rawSyscall(libc_getrtable_trampoline_addr, 0, 0, 0) rtable = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getrtable_trampoline_addr uintptr //go:cgo_import_dynamic libc_getrtable getrtable "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrusage(who int, rusage *Rusage) (err error) { _, _, e1 := syscall_rawSyscall(libc_getrusage_trampoline_addr, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getrusage_trampoline_addr uintptr //go:cgo_import_dynamic libc_getrusage getrusage "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getsid(pid int) (sid int, err error) { r0, _, e1 := syscall_rawSyscall(libc_getsid_trampoline_addr, uintptr(pid), 0, 0) sid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getsid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getsid getsid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tv *Timeval) (err error) { _, _, e1 := syscall_rawSyscall(libc_gettimeofday_trampoline_addr, uintptr(unsafe.Pointer(tv)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_gettimeofday_trampoline_addr uintptr //go:cgo_import_dynamic libc_gettimeofday gettimeofday "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _, _ := syscall_rawSyscall(libc_getuid_trampoline_addr, 0, 0, 0) uid = int(r0) return } var libc_getuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getuid getuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Issetugid() (tainted bool) { r0, _, _ := syscall_syscall(libc_issetugid_trampoline_addr, 0, 0, 0) tainted = bool(r0 != 0) return } var libc_issetugid_trampoline_addr uintptr //go:cgo_import_dynamic libc_issetugid issetugid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kill(pid int, signum syscall.Signal) (err error) { _, _, e1 := syscall_syscall(libc_kill_trampoline_addr, uintptr(pid), uintptr(signum), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_kill_trampoline_addr uintptr //go:cgo_import_dynamic libc_kill kill "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kqueue() (fd int, err error) { r0, _, e1 := syscall_syscall(libc_kqueue_trampoline_addr, 0, 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_kqueue_trampoline_addr uintptr //go:cgo_import_dynamic libc_kqueue kqueue "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_lchown_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } var libc_lchown_trampoline_addr uintptr //go:cgo_import_dynamic libc_lchown lchown "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Link(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := syscall_syscall(libc_link_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_link_trampoline_addr uintptr //go:cgo_import_dynamic libc_link link "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := syscall_syscall6(libc_linkat_trampoline_addr, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_linkat_trampoline_addr uintptr //go:cgo_import_dynamic libc_linkat linkat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, backlog int) (err error) { _, _, e1 := syscall_syscall(libc_listen_trampoline_addr, uintptr(s), uintptr(backlog), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_listen_trampoline_addr uintptr //go:cgo_import_dynamic libc_listen listen "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lstat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_lstat_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_lstat_trampoline_addr uintptr //go:cgo_import_dynamic libc_lstat lstat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdir(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_mkdir_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mkdir_trampoline_addr uintptr //go:cgo_import_dynamic libc_mkdir mkdir "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdirat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_mkdirat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } var libc_mkdirat_trampoline_addr uintptr //go:cgo_import_dynamic libc_mkdirat mkdirat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifo(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_mkfifo_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mkfifo_trampoline_addr uintptr //go:cgo_import_dynamic libc_mkfifo mkfifo "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifoat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_mkfifoat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } var libc_mkfifoat_trampoline_addr uintptr //go:cgo_import_dynamic libc_mkfifoat mkfifoat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknod(path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_mknod_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) if e1 != 0 { err = errnoErr(e1) } return } var libc_mknod_trampoline_addr uintptr //go:cgo_import_dynamic libc_mknod mknod "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_mknodat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mknodat_trampoline_addr uintptr //go:cgo_import_dynamic libc_mknodat mknodat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) { var _p0 *byte _p0, err = BytePtrFromString(fsType) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(dir) if err != nil { return } _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mount_trampoline_addr uintptr //go:cgo_import_dynamic libc_mount mount "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := syscall_syscall(libc_nanosleep_trampoline_addr, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_nanosleep_trampoline_addr uintptr //go:cgo_import_dynamic libc_nanosleep nanosleep "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Open(path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := syscall_syscall(libc_open_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_open_trampoline_addr uintptr //go:cgo_import_dynamic libc_open open "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := syscall_syscall6(libc_openat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_openat_trampoline_addr uintptr //go:cgo_import_dynamic libc_openat openat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pathconf(path string, name int) (val int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := syscall_syscall(libc_pathconf_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pathconf_trampoline_addr uintptr //go:cgo_import_dynamic libc_pathconf pathconf "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall6(libc_pread_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pread_trampoline_addr uintptr //go:cgo_import_dynamic libc_pread pread "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall6(libc_pwrite_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pwrite_trampoline_addr uintptr //go:cgo_import_dynamic libc_pwrite pwrite "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func read(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_read_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_read_trampoline_addr uintptr //go:cgo_import_dynamic libc_read read "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlink(path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_readlink_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_readlink_trampoline_addr uintptr //go:cgo_import_dynamic libc_readlink readlink "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall6(libc_readlinkat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_readlinkat_trampoline_addr uintptr //go:cgo_import_dynamic libc_readlinkat readlinkat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rename(from string, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := syscall_syscall(libc_rename_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_rename_trampoline_addr uintptr //go:cgo_import_dynamic libc_rename rename "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(fromfd int, from string, tofd int, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := syscall_syscall6(libc_renameat_trampoline_addr, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_renameat_trampoline_addr uintptr //go:cgo_import_dynamic libc_renameat renameat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Revoke(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_revoke_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_revoke_trampoline_addr uintptr //go:cgo_import_dynamic libc_revoke revoke "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rmdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_rmdir_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_rmdir_trampoline_addr uintptr //go:cgo_import_dynamic libc_rmdir rmdir "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { r0, _, e1 := syscall_syscall(libc_lseek_trampoline_addr, uintptr(fd), uintptr(offset), uintptr(whence)) newoffset = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_lseek_trampoline_addr uintptr //go:cgo_import_dynamic libc_lseek lseek "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { r0, _, e1 := syscall_syscall6(libc_select_trampoline_addr, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_select_trampoline_addr uintptr //go:cgo_import_dynamic libc_select select "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setegid(egid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setegid_trampoline_addr, uintptr(egid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setegid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setegid setegid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seteuid(euid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_seteuid_trampoline_addr, uintptr(euid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_seteuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_seteuid seteuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setgid(gid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setgid_trampoline_addr, uintptr(gid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setgid setgid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setlogin(name string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(name) if err != nil { return } _, _, e1 := syscall_syscall(libc_setlogin_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setlogin_trampoline_addr uintptr //go:cgo_import_dynamic libc_setlogin setlogin "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setpgid_trampoline_addr, uintptr(pid), uintptr(pgid), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setpgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setpgid setpgid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpriority(which int, who int, prio int) (err error) { _, _, e1 := syscall_syscall(libc_setpriority_trampoline_addr, uintptr(which), uintptr(who), uintptr(prio)) if e1 != 0 { err = errnoErr(e1) } return } var libc_setpriority_trampoline_addr uintptr //go:cgo_import_dynamic libc_setpriority setpriority "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setregid(rgid int, egid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setregid_trampoline_addr, uintptr(rgid), uintptr(egid), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setregid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setregid setregid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setreuid(ruid int, euid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setreuid_trampoline_addr, uintptr(ruid), uintptr(euid), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setreuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setreuid setreuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresgid(rgid int, egid int, sgid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setresgid_trampoline_addr, uintptr(rgid), uintptr(egid), uintptr(sgid)) if e1 != 0 { err = errnoErr(e1) } return } var libc_setresgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setresgid setresgid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresuid(ruid int, euid int, suid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setresuid_trampoline_addr, uintptr(ruid), uintptr(euid), uintptr(suid)) if e1 != 0 { err = errnoErr(e1) } return } var libc_setresuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setresuid setresuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setrtable(rtable int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setrtable_trampoline_addr, uintptr(rtable), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setrtable_trampoline_addr uintptr //go:cgo_import_dynamic libc_setrtable setrtable "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, err error) { r0, _, e1 := syscall_rawSyscall(libc_setsid_trampoline_addr, 0, 0, 0) pid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setsid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setsid setsid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Settimeofday(tp *Timeval) (err error) { _, _, e1 := syscall_rawSyscall(libc_settimeofday_trampoline_addr, uintptr(unsafe.Pointer(tp)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_settimeofday_trampoline_addr uintptr //go:cgo_import_dynamic libc_settimeofday settimeofday "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setuid(uid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setuid_trampoline_addr, uintptr(uid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setuid setuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Stat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_stat_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_stat_trampoline_addr uintptr //go:cgo_import_dynamic libc_stat stat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Statfs(path string, stat *Statfs_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_statfs_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_statfs_trampoline_addr uintptr //go:cgo_import_dynamic libc_statfs statfs "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlink(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := syscall_syscall(libc_symlink_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_symlink_trampoline_addr uintptr //go:cgo_import_dynamic libc_symlink symlink "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := syscall_syscall(libc_symlinkat_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } var libc_symlinkat_trampoline_addr uintptr //go:cgo_import_dynamic libc_symlinkat symlinkat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sync() (err error) { _, _, e1 := syscall_syscall(libc_sync_trampoline_addr, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_sync_trampoline_addr uintptr //go:cgo_import_dynamic libc_sync sync "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_truncate_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_truncate_trampoline_addr uintptr //go:cgo_import_dynamic libc_truncate truncate "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Umask(newmask int) (oldmask int) { r0, _, _ := syscall_syscall(libc_umask_trampoline_addr, uintptr(newmask), 0, 0) oldmask = int(r0) return } var libc_umask_trampoline_addr uintptr //go:cgo_import_dynamic libc_umask umask "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlink(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_unlink_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_unlink_trampoline_addr uintptr //go:cgo_import_dynamic libc_unlink unlink "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlinkat(dirfd int, path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_unlinkat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } var libc_unlinkat_trampoline_addr uintptr //go:cgo_import_dynamic libc_unlinkat unlinkat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unmount(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_unmount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_unmount_trampoline_addr uintptr //go:cgo_import_dynamic libc_unmount unmount "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func write(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_write_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_write_trampoline_addr uintptr //go:cgo_import_dynamic libc_write write "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { r0, _, e1 := syscall_syscall6(libc_mmap_trampoline_addr, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos)) ret = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mmap_trampoline_addr uintptr //go:cgo_import_dynamic libc_mmap mmap "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func munmap(addr uintptr, length uintptr) (err error) { _, _, e1 := syscall_syscall(libc_munmap_trampoline_addr, uintptr(addr), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_munmap_trampoline_addr uintptr //go:cgo_import_dynamic libc_munmap munmap "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getfsstat(stat *Statfs_t, bufsize uintptr, flags int) (n int, err error) { r0, _, e1 := syscall_syscall(libc_getfsstat_trampoline_addr, uintptr(unsafe.Pointer(stat)), uintptr(bufsize), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getfsstat_trampoline_addr uintptr //go:cgo_import_dynamic libc_getfsstat getfsstat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_utimensat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_utimensat_trampoline_addr uintptr //go:cgo_import_dynamic libc_utimensat utimensat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pledge(promises *byte, execpromises *byte) (err error) { _, _, e1 := syscall_syscall(libc_pledge_trampoline_addr, uintptr(unsafe.Pointer(promises)), uintptr(unsafe.Pointer(execpromises)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pledge_trampoline_addr uintptr //go:cgo_import_dynamic libc_pledge pledge "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func unveil(path *byte, flags *byte) (err error) { _, _, e1 := syscall_syscall(libc_unveil_trampoline_addr, uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(flags)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_unveil_trampoline_addr uintptr //go:cgo_import_dynamic libc_unveil unveil "libc.so" ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s ================================================ // go run mkasm.go openbsd mips64 // Code generated by the command above; DO NOT EDIT. #include "textflag.h" TEXT libc_getgroups_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getgroups(SB) GLOBL ·libc_getgroups_trampoline_addr(SB), RODATA, $8 DATA ·libc_getgroups_trampoline_addr(SB)/8, $libc_getgroups_trampoline<>(SB) TEXT libc_setgroups_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setgroups(SB) GLOBL ·libc_setgroups_trampoline_addr(SB), RODATA, $8 DATA ·libc_setgroups_trampoline_addr(SB)/8, $libc_setgroups_trampoline<>(SB) TEXT libc_wait4_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_wait4(SB) GLOBL ·libc_wait4_trampoline_addr(SB), RODATA, $8 DATA ·libc_wait4_trampoline_addr(SB)/8, $libc_wait4_trampoline<>(SB) TEXT libc_accept_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_accept(SB) GLOBL ·libc_accept_trampoline_addr(SB), RODATA, $8 DATA ·libc_accept_trampoline_addr(SB)/8, $libc_accept_trampoline<>(SB) TEXT libc_bind_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_bind(SB) GLOBL ·libc_bind_trampoline_addr(SB), RODATA, $8 DATA ·libc_bind_trampoline_addr(SB)/8, $libc_bind_trampoline<>(SB) TEXT libc_connect_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_connect(SB) GLOBL ·libc_connect_trampoline_addr(SB), RODATA, $8 DATA ·libc_connect_trampoline_addr(SB)/8, $libc_connect_trampoline<>(SB) TEXT libc_socket_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_socket(SB) GLOBL ·libc_socket_trampoline_addr(SB), RODATA, $8 DATA ·libc_socket_trampoline_addr(SB)/8, $libc_socket_trampoline<>(SB) TEXT libc_getsockopt_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getsockopt(SB) GLOBL ·libc_getsockopt_trampoline_addr(SB), RODATA, $8 DATA ·libc_getsockopt_trampoline_addr(SB)/8, $libc_getsockopt_trampoline<>(SB) TEXT libc_setsockopt_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setsockopt(SB) GLOBL ·libc_setsockopt_trampoline_addr(SB), RODATA, $8 DATA ·libc_setsockopt_trampoline_addr(SB)/8, $libc_setsockopt_trampoline<>(SB) TEXT libc_getpeername_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpeername(SB) GLOBL ·libc_getpeername_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpeername_trampoline_addr(SB)/8, $libc_getpeername_trampoline<>(SB) TEXT libc_getsockname_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getsockname(SB) GLOBL ·libc_getsockname_trampoline_addr(SB), RODATA, $8 DATA ·libc_getsockname_trampoline_addr(SB)/8, $libc_getsockname_trampoline<>(SB) TEXT libc_shutdown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_shutdown(SB) GLOBL ·libc_shutdown_trampoline_addr(SB), RODATA, $8 DATA ·libc_shutdown_trampoline_addr(SB)/8, $libc_shutdown_trampoline<>(SB) TEXT libc_socketpair_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_socketpair(SB) GLOBL ·libc_socketpair_trampoline_addr(SB), RODATA, $8 DATA ·libc_socketpair_trampoline_addr(SB)/8, $libc_socketpair_trampoline<>(SB) TEXT libc_recvfrom_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_recvfrom(SB) GLOBL ·libc_recvfrom_trampoline_addr(SB), RODATA, $8 DATA ·libc_recvfrom_trampoline_addr(SB)/8, $libc_recvfrom_trampoline<>(SB) TEXT libc_sendto_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sendto(SB) GLOBL ·libc_sendto_trampoline_addr(SB), RODATA, $8 DATA ·libc_sendto_trampoline_addr(SB)/8, $libc_sendto_trampoline<>(SB) TEXT libc_recvmsg_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_recvmsg(SB) GLOBL ·libc_recvmsg_trampoline_addr(SB), RODATA, $8 DATA ·libc_recvmsg_trampoline_addr(SB)/8, $libc_recvmsg_trampoline<>(SB) TEXT libc_sendmsg_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sendmsg(SB) GLOBL ·libc_sendmsg_trampoline_addr(SB), RODATA, $8 DATA ·libc_sendmsg_trampoline_addr(SB)/8, $libc_sendmsg_trampoline<>(SB) TEXT libc_kevent_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_kevent(SB) GLOBL ·libc_kevent_trampoline_addr(SB), RODATA, $8 DATA ·libc_kevent_trampoline_addr(SB)/8, $libc_kevent_trampoline<>(SB) TEXT libc_utimes_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_utimes(SB) GLOBL ·libc_utimes_trampoline_addr(SB), RODATA, $8 DATA ·libc_utimes_trampoline_addr(SB)/8, $libc_utimes_trampoline<>(SB) TEXT libc_futimes_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_futimes(SB) GLOBL ·libc_futimes_trampoline_addr(SB), RODATA, $8 DATA ·libc_futimes_trampoline_addr(SB)/8, $libc_futimes_trampoline<>(SB) TEXT libc_poll_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_poll(SB) GLOBL ·libc_poll_trampoline_addr(SB), RODATA, $8 DATA ·libc_poll_trampoline_addr(SB)/8, $libc_poll_trampoline<>(SB) TEXT libc_madvise_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_madvise(SB) GLOBL ·libc_madvise_trampoline_addr(SB), RODATA, $8 DATA ·libc_madvise_trampoline_addr(SB)/8, $libc_madvise_trampoline<>(SB) TEXT libc_mlock_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mlock(SB) GLOBL ·libc_mlock_trampoline_addr(SB), RODATA, $8 DATA ·libc_mlock_trampoline_addr(SB)/8, $libc_mlock_trampoline<>(SB) TEXT libc_mlockall_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mlockall(SB) GLOBL ·libc_mlockall_trampoline_addr(SB), RODATA, $8 DATA ·libc_mlockall_trampoline_addr(SB)/8, $libc_mlockall_trampoline<>(SB) TEXT libc_mprotect_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mprotect(SB) GLOBL ·libc_mprotect_trampoline_addr(SB), RODATA, $8 DATA ·libc_mprotect_trampoline_addr(SB)/8, $libc_mprotect_trampoline<>(SB) TEXT libc_msync_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_msync(SB) GLOBL ·libc_msync_trampoline_addr(SB), RODATA, $8 DATA ·libc_msync_trampoline_addr(SB)/8, $libc_msync_trampoline<>(SB) TEXT libc_munlock_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_munlock(SB) GLOBL ·libc_munlock_trampoline_addr(SB), RODATA, $8 DATA ·libc_munlock_trampoline_addr(SB)/8, $libc_munlock_trampoline<>(SB) TEXT libc_munlockall_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_munlockall(SB) GLOBL ·libc_munlockall_trampoline_addr(SB), RODATA, $8 DATA ·libc_munlockall_trampoline_addr(SB)/8, $libc_munlockall_trampoline<>(SB) TEXT libc_pipe2_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pipe2(SB) GLOBL ·libc_pipe2_trampoline_addr(SB), RODATA, $8 DATA ·libc_pipe2_trampoline_addr(SB)/8, $libc_pipe2_trampoline<>(SB) TEXT libc_getdents_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getdents(SB) GLOBL ·libc_getdents_trampoline_addr(SB), RODATA, $8 DATA ·libc_getdents_trampoline_addr(SB)/8, $libc_getdents_trampoline<>(SB) TEXT libc_getcwd_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getcwd(SB) GLOBL ·libc_getcwd_trampoline_addr(SB), RODATA, $8 DATA ·libc_getcwd_trampoline_addr(SB)/8, $libc_getcwd_trampoline<>(SB) TEXT libc_getresuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getresuid(SB) GLOBL ·libc_getresuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getresuid_trampoline_addr(SB)/8, $libc_getresuid_trampoline<>(SB) TEXT libc_getresgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getresgid(SB) GLOBL ·libc_getresgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getresgid_trampoline_addr(SB)/8, $libc_getresgid_trampoline<>(SB) TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ioctl(SB) GLOBL ·libc_ioctl_trampoline_addr(SB), RODATA, $8 DATA ·libc_ioctl_trampoline_addr(SB)/8, $libc_ioctl_trampoline<>(SB) TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sysctl(SB) GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8 DATA ·libc_sysctl_trampoline_addr(SB)/8, $libc_sysctl_trampoline<>(SB) TEXT libc_fcntl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fcntl(SB) GLOBL ·libc_fcntl_trampoline_addr(SB), RODATA, $8 DATA ·libc_fcntl_trampoline_addr(SB)/8, $libc_fcntl_trampoline<>(SB) TEXT libc_ppoll_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ppoll(SB) GLOBL ·libc_ppoll_trampoline_addr(SB), RODATA, $8 DATA ·libc_ppoll_trampoline_addr(SB)/8, $libc_ppoll_trampoline<>(SB) TEXT libc_access_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_access(SB) GLOBL ·libc_access_trampoline_addr(SB), RODATA, $8 DATA ·libc_access_trampoline_addr(SB)/8, $libc_access_trampoline<>(SB) TEXT libc_adjtime_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_adjtime(SB) GLOBL ·libc_adjtime_trampoline_addr(SB), RODATA, $8 DATA ·libc_adjtime_trampoline_addr(SB)/8, $libc_adjtime_trampoline<>(SB) TEXT libc_chdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chdir(SB) GLOBL ·libc_chdir_trampoline_addr(SB), RODATA, $8 DATA ·libc_chdir_trampoline_addr(SB)/8, $libc_chdir_trampoline<>(SB) TEXT libc_chflags_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chflags(SB) GLOBL ·libc_chflags_trampoline_addr(SB), RODATA, $8 DATA ·libc_chflags_trampoline_addr(SB)/8, $libc_chflags_trampoline<>(SB) TEXT libc_chmod_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chmod(SB) GLOBL ·libc_chmod_trampoline_addr(SB), RODATA, $8 DATA ·libc_chmod_trampoline_addr(SB)/8, $libc_chmod_trampoline<>(SB) TEXT libc_chown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chown(SB) GLOBL ·libc_chown_trampoline_addr(SB), RODATA, $8 DATA ·libc_chown_trampoline_addr(SB)/8, $libc_chown_trampoline<>(SB) TEXT libc_chroot_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chroot(SB) GLOBL ·libc_chroot_trampoline_addr(SB), RODATA, $8 DATA ·libc_chroot_trampoline_addr(SB)/8, $libc_chroot_trampoline<>(SB) TEXT libc_clock_gettime_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_clock_gettime(SB) GLOBL ·libc_clock_gettime_trampoline_addr(SB), RODATA, $8 DATA ·libc_clock_gettime_trampoline_addr(SB)/8, $libc_clock_gettime_trampoline<>(SB) TEXT libc_close_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_close(SB) GLOBL ·libc_close_trampoline_addr(SB), RODATA, $8 DATA ·libc_close_trampoline_addr(SB)/8, $libc_close_trampoline<>(SB) TEXT libc_dup_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_dup(SB) GLOBL ·libc_dup_trampoline_addr(SB), RODATA, $8 DATA ·libc_dup_trampoline_addr(SB)/8, $libc_dup_trampoline<>(SB) TEXT libc_dup2_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_dup2(SB) GLOBL ·libc_dup2_trampoline_addr(SB), RODATA, $8 DATA ·libc_dup2_trampoline_addr(SB)/8, $libc_dup2_trampoline<>(SB) TEXT libc_dup3_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_dup3(SB) GLOBL ·libc_dup3_trampoline_addr(SB), RODATA, $8 DATA ·libc_dup3_trampoline_addr(SB)/8, $libc_dup3_trampoline<>(SB) TEXT libc_exit_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_exit(SB) GLOBL ·libc_exit_trampoline_addr(SB), RODATA, $8 DATA ·libc_exit_trampoline_addr(SB)/8, $libc_exit_trampoline<>(SB) TEXT libc_faccessat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_faccessat(SB) GLOBL ·libc_faccessat_trampoline_addr(SB), RODATA, $8 DATA ·libc_faccessat_trampoline_addr(SB)/8, $libc_faccessat_trampoline<>(SB) TEXT libc_fchdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchdir(SB) GLOBL ·libc_fchdir_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchdir_trampoline_addr(SB)/8, $libc_fchdir_trampoline<>(SB) TEXT libc_fchflags_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchflags(SB) GLOBL ·libc_fchflags_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchflags_trampoline_addr(SB)/8, $libc_fchflags_trampoline<>(SB) TEXT libc_fchmod_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchmod(SB) GLOBL ·libc_fchmod_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchmod_trampoline_addr(SB)/8, $libc_fchmod_trampoline<>(SB) TEXT libc_fchmodat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchmodat(SB) GLOBL ·libc_fchmodat_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchmodat_trampoline_addr(SB)/8, $libc_fchmodat_trampoline<>(SB) TEXT libc_fchown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchown(SB) GLOBL ·libc_fchown_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchown_trampoline_addr(SB)/8, $libc_fchown_trampoline<>(SB) TEXT libc_fchownat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchownat(SB) GLOBL ·libc_fchownat_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchownat_trampoline_addr(SB)/8, $libc_fchownat_trampoline<>(SB) TEXT libc_flock_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_flock(SB) GLOBL ·libc_flock_trampoline_addr(SB), RODATA, $8 DATA ·libc_flock_trampoline_addr(SB)/8, $libc_flock_trampoline<>(SB) TEXT libc_fpathconf_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fpathconf(SB) GLOBL ·libc_fpathconf_trampoline_addr(SB), RODATA, $8 DATA ·libc_fpathconf_trampoline_addr(SB)/8, $libc_fpathconf_trampoline<>(SB) TEXT libc_fstat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fstat(SB) GLOBL ·libc_fstat_trampoline_addr(SB), RODATA, $8 DATA ·libc_fstat_trampoline_addr(SB)/8, $libc_fstat_trampoline<>(SB) TEXT libc_fstatat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fstatat(SB) GLOBL ·libc_fstatat_trampoline_addr(SB), RODATA, $8 DATA ·libc_fstatat_trampoline_addr(SB)/8, $libc_fstatat_trampoline<>(SB) TEXT libc_fstatfs_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fstatfs(SB) GLOBL ·libc_fstatfs_trampoline_addr(SB), RODATA, $8 DATA ·libc_fstatfs_trampoline_addr(SB)/8, $libc_fstatfs_trampoline<>(SB) TEXT libc_fsync_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fsync(SB) GLOBL ·libc_fsync_trampoline_addr(SB), RODATA, $8 DATA ·libc_fsync_trampoline_addr(SB)/8, $libc_fsync_trampoline<>(SB) TEXT libc_ftruncate_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ftruncate(SB) GLOBL ·libc_ftruncate_trampoline_addr(SB), RODATA, $8 DATA ·libc_ftruncate_trampoline_addr(SB)/8, $libc_ftruncate_trampoline<>(SB) TEXT libc_getegid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getegid(SB) GLOBL ·libc_getegid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getegid_trampoline_addr(SB)/8, $libc_getegid_trampoline<>(SB) TEXT libc_geteuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_geteuid(SB) GLOBL ·libc_geteuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_geteuid_trampoline_addr(SB)/8, $libc_geteuid_trampoline<>(SB) TEXT libc_getgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getgid(SB) GLOBL ·libc_getgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getgid_trampoline_addr(SB)/8, $libc_getgid_trampoline<>(SB) TEXT libc_getpgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpgid(SB) GLOBL ·libc_getpgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpgid_trampoline_addr(SB)/8, $libc_getpgid_trampoline<>(SB) TEXT libc_getpgrp_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpgrp(SB) GLOBL ·libc_getpgrp_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpgrp_trampoline_addr(SB)/8, $libc_getpgrp_trampoline<>(SB) TEXT libc_getpid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpid(SB) GLOBL ·libc_getpid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpid_trampoline_addr(SB)/8, $libc_getpid_trampoline<>(SB) TEXT libc_getppid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getppid(SB) GLOBL ·libc_getppid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getppid_trampoline_addr(SB)/8, $libc_getppid_trampoline<>(SB) TEXT libc_getpriority_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpriority(SB) GLOBL ·libc_getpriority_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpriority_trampoline_addr(SB)/8, $libc_getpriority_trampoline<>(SB) TEXT libc_getrlimit_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getrlimit(SB) GLOBL ·libc_getrlimit_trampoline_addr(SB), RODATA, $8 DATA ·libc_getrlimit_trampoline_addr(SB)/8, $libc_getrlimit_trampoline<>(SB) TEXT libc_getrtable_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getrtable(SB) GLOBL ·libc_getrtable_trampoline_addr(SB), RODATA, $8 DATA ·libc_getrtable_trampoline_addr(SB)/8, $libc_getrtable_trampoline<>(SB) TEXT libc_getrusage_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getrusage(SB) GLOBL ·libc_getrusage_trampoline_addr(SB), RODATA, $8 DATA ·libc_getrusage_trampoline_addr(SB)/8, $libc_getrusage_trampoline<>(SB) TEXT libc_getsid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getsid(SB) GLOBL ·libc_getsid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getsid_trampoline_addr(SB)/8, $libc_getsid_trampoline<>(SB) TEXT libc_gettimeofday_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_gettimeofday(SB) GLOBL ·libc_gettimeofday_trampoline_addr(SB), RODATA, $8 DATA ·libc_gettimeofday_trampoline_addr(SB)/8, $libc_gettimeofday_trampoline<>(SB) TEXT libc_getuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getuid(SB) GLOBL ·libc_getuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getuid_trampoline_addr(SB)/8, $libc_getuid_trampoline<>(SB) TEXT libc_issetugid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_issetugid(SB) GLOBL ·libc_issetugid_trampoline_addr(SB), RODATA, $8 DATA ·libc_issetugid_trampoline_addr(SB)/8, $libc_issetugid_trampoline<>(SB) TEXT libc_kill_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_kill(SB) GLOBL ·libc_kill_trampoline_addr(SB), RODATA, $8 DATA ·libc_kill_trampoline_addr(SB)/8, $libc_kill_trampoline<>(SB) TEXT libc_kqueue_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_kqueue(SB) GLOBL ·libc_kqueue_trampoline_addr(SB), RODATA, $8 DATA ·libc_kqueue_trampoline_addr(SB)/8, $libc_kqueue_trampoline<>(SB) TEXT libc_lchown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_lchown(SB) GLOBL ·libc_lchown_trampoline_addr(SB), RODATA, $8 DATA ·libc_lchown_trampoline_addr(SB)/8, $libc_lchown_trampoline<>(SB) TEXT libc_link_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_link(SB) GLOBL ·libc_link_trampoline_addr(SB), RODATA, $8 DATA ·libc_link_trampoline_addr(SB)/8, $libc_link_trampoline<>(SB) TEXT libc_linkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_linkat(SB) GLOBL ·libc_linkat_trampoline_addr(SB), RODATA, $8 DATA ·libc_linkat_trampoline_addr(SB)/8, $libc_linkat_trampoline<>(SB) TEXT libc_listen_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_listen(SB) GLOBL ·libc_listen_trampoline_addr(SB), RODATA, $8 DATA ·libc_listen_trampoline_addr(SB)/8, $libc_listen_trampoline<>(SB) TEXT libc_lstat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_lstat(SB) GLOBL ·libc_lstat_trampoline_addr(SB), RODATA, $8 DATA ·libc_lstat_trampoline_addr(SB)/8, $libc_lstat_trampoline<>(SB) TEXT libc_mkdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkdir(SB) GLOBL ·libc_mkdir_trampoline_addr(SB), RODATA, $8 DATA ·libc_mkdir_trampoline_addr(SB)/8, $libc_mkdir_trampoline<>(SB) TEXT libc_mkdirat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkdirat(SB) GLOBL ·libc_mkdirat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mkdirat_trampoline_addr(SB)/8, $libc_mkdirat_trampoline<>(SB) TEXT libc_mkfifo_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkfifo(SB) GLOBL ·libc_mkfifo_trampoline_addr(SB), RODATA, $8 DATA ·libc_mkfifo_trampoline_addr(SB)/8, $libc_mkfifo_trampoline<>(SB) TEXT libc_mkfifoat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkfifoat(SB) GLOBL ·libc_mkfifoat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mkfifoat_trampoline_addr(SB)/8, $libc_mkfifoat_trampoline<>(SB) TEXT libc_mknod_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mknod(SB) GLOBL ·libc_mknod_trampoline_addr(SB), RODATA, $8 DATA ·libc_mknod_trampoline_addr(SB)/8, $libc_mknod_trampoline<>(SB) TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mknodat(SB) GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mknodat_trampoline_addr(SB)/8, $libc_mknodat_trampoline<>(SB) TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mount(SB) GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $8 DATA ·libc_mount_trampoline_addr(SB)/8, $libc_mount_trampoline<>(SB) TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_nanosleep(SB) GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $8 DATA ·libc_nanosleep_trampoline_addr(SB)/8, $libc_nanosleep_trampoline<>(SB) TEXT libc_open_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_open(SB) GLOBL ·libc_open_trampoline_addr(SB), RODATA, $8 DATA ·libc_open_trampoline_addr(SB)/8, $libc_open_trampoline<>(SB) TEXT libc_openat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_openat(SB) GLOBL ·libc_openat_trampoline_addr(SB), RODATA, $8 DATA ·libc_openat_trampoline_addr(SB)/8, $libc_openat_trampoline<>(SB) TEXT libc_pathconf_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pathconf(SB) GLOBL ·libc_pathconf_trampoline_addr(SB), RODATA, $8 DATA ·libc_pathconf_trampoline_addr(SB)/8, $libc_pathconf_trampoline<>(SB) TEXT libc_pread_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pread(SB) GLOBL ·libc_pread_trampoline_addr(SB), RODATA, $8 DATA ·libc_pread_trampoline_addr(SB)/8, $libc_pread_trampoline<>(SB) TEXT libc_pwrite_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pwrite(SB) GLOBL ·libc_pwrite_trampoline_addr(SB), RODATA, $8 DATA ·libc_pwrite_trampoline_addr(SB)/8, $libc_pwrite_trampoline<>(SB) TEXT libc_read_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_read(SB) GLOBL ·libc_read_trampoline_addr(SB), RODATA, $8 DATA ·libc_read_trampoline_addr(SB)/8, $libc_read_trampoline<>(SB) TEXT libc_readlink_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_readlink(SB) GLOBL ·libc_readlink_trampoline_addr(SB), RODATA, $8 DATA ·libc_readlink_trampoline_addr(SB)/8, $libc_readlink_trampoline<>(SB) TEXT libc_readlinkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_readlinkat(SB) GLOBL ·libc_readlinkat_trampoline_addr(SB), RODATA, $8 DATA ·libc_readlinkat_trampoline_addr(SB)/8, $libc_readlinkat_trampoline<>(SB) TEXT libc_rename_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_rename(SB) GLOBL ·libc_rename_trampoline_addr(SB), RODATA, $8 DATA ·libc_rename_trampoline_addr(SB)/8, $libc_rename_trampoline<>(SB) TEXT libc_renameat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_renameat(SB) GLOBL ·libc_renameat_trampoline_addr(SB), RODATA, $8 DATA ·libc_renameat_trampoline_addr(SB)/8, $libc_renameat_trampoline<>(SB) TEXT libc_revoke_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_revoke(SB) GLOBL ·libc_revoke_trampoline_addr(SB), RODATA, $8 DATA ·libc_revoke_trampoline_addr(SB)/8, $libc_revoke_trampoline<>(SB) TEXT libc_rmdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_rmdir(SB) GLOBL ·libc_rmdir_trampoline_addr(SB), RODATA, $8 DATA ·libc_rmdir_trampoline_addr(SB)/8, $libc_rmdir_trampoline<>(SB) TEXT libc_lseek_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_lseek(SB) GLOBL ·libc_lseek_trampoline_addr(SB), RODATA, $8 DATA ·libc_lseek_trampoline_addr(SB)/8, $libc_lseek_trampoline<>(SB) TEXT libc_select_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_select(SB) GLOBL ·libc_select_trampoline_addr(SB), RODATA, $8 DATA ·libc_select_trampoline_addr(SB)/8, $libc_select_trampoline<>(SB) TEXT libc_setegid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setegid(SB) GLOBL ·libc_setegid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setegid_trampoline_addr(SB)/8, $libc_setegid_trampoline<>(SB) TEXT libc_seteuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_seteuid(SB) GLOBL ·libc_seteuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_seteuid_trampoline_addr(SB)/8, $libc_seteuid_trampoline<>(SB) TEXT libc_setgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setgid(SB) GLOBL ·libc_setgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setgid_trampoline_addr(SB)/8, $libc_setgid_trampoline<>(SB) TEXT libc_setlogin_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setlogin(SB) GLOBL ·libc_setlogin_trampoline_addr(SB), RODATA, $8 DATA ·libc_setlogin_trampoline_addr(SB)/8, $libc_setlogin_trampoline<>(SB) TEXT libc_setpgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setpgid(SB) GLOBL ·libc_setpgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setpgid_trampoline_addr(SB)/8, $libc_setpgid_trampoline<>(SB) TEXT libc_setpriority_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setpriority(SB) GLOBL ·libc_setpriority_trampoline_addr(SB), RODATA, $8 DATA ·libc_setpriority_trampoline_addr(SB)/8, $libc_setpriority_trampoline<>(SB) TEXT libc_setregid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setregid(SB) GLOBL ·libc_setregid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setregid_trampoline_addr(SB)/8, $libc_setregid_trampoline<>(SB) TEXT libc_setreuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setreuid(SB) GLOBL ·libc_setreuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setreuid_trampoline_addr(SB)/8, $libc_setreuid_trampoline<>(SB) TEXT libc_setresgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setresgid(SB) GLOBL ·libc_setresgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setresgid_trampoline_addr(SB)/8, $libc_setresgid_trampoline<>(SB) TEXT libc_setresuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setresuid(SB) GLOBL ·libc_setresuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setresuid_trampoline_addr(SB)/8, $libc_setresuid_trampoline<>(SB) TEXT libc_setrtable_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setrtable(SB) GLOBL ·libc_setrtable_trampoline_addr(SB), RODATA, $8 DATA ·libc_setrtable_trampoline_addr(SB)/8, $libc_setrtable_trampoline<>(SB) TEXT libc_setsid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setsid(SB) GLOBL ·libc_setsid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setsid_trampoline_addr(SB)/8, $libc_setsid_trampoline<>(SB) TEXT libc_settimeofday_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_settimeofday(SB) GLOBL ·libc_settimeofday_trampoline_addr(SB), RODATA, $8 DATA ·libc_settimeofday_trampoline_addr(SB)/8, $libc_settimeofday_trampoline<>(SB) TEXT libc_setuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setuid(SB) GLOBL ·libc_setuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setuid_trampoline_addr(SB)/8, $libc_setuid_trampoline<>(SB) TEXT libc_stat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_stat(SB) GLOBL ·libc_stat_trampoline_addr(SB), RODATA, $8 DATA ·libc_stat_trampoline_addr(SB)/8, $libc_stat_trampoline<>(SB) TEXT libc_statfs_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_statfs(SB) GLOBL ·libc_statfs_trampoline_addr(SB), RODATA, $8 DATA ·libc_statfs_trampoline_addr(SB)/8, $libc_statfs_trampoline<>(SB) TEXT libc_symlink_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_symlink(SB) GLOBL ·libc_symlink_trampoline_addr(SB), RODATA, $8 DATA ·libc_symlink_trampoline_addr(SB)/8, $libc_symlink_trampoline<>(SB) TEXT libc_symlinkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_symlinkat(SB) GLOBL ·libc_symlinkat_trampoline_addr(SB), RODATA, $8 DATA ·libc_symlinkat_trampoline_addr(SB)/8, $libc_symlinkat_trampoline<>(SB) TEXT libc_sync_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sync(SB) GLOBL ·libc_sync_trampoline_addr(SB), RODATA, $8 DATA ·libc_sync_trampoline_addr(SB)/8, $libc_sync_trampoline<>(SB) TEXT libc_truncate_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_truncate(SB) GLOBL ·libc_truncate_trampoline_addr(SB), RODATA, $8 DATA ·libc_truncate_trampoline_addr(SB)/8, $libc_truncate_trampoline<>(SB) TEXT libc_umask_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_umask(SB) GLOBL ·libc_umask_trampoline_addr(SB), RODATA, $8 DATA ·libc_umask_trampoline_addr(SB)/8, $libc_umask_trampoline<>(SB) TEXT libc_unlink_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_unlink(SB) GLOBL ·libc_unlink_trampoline_addr(SB), RODATA, $8 DATA ·libc_unlink_trampoline_addr(SB)/8, $libc_unlink_trampoline<>(SB) TEXT libc_unlinkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_unlinkat(SB) GLOBL ·libc_unlinkat_trampoline_addr(SB), RODATA, $8 DATA ·libc_unlinkat_trampoline_addr(SB)/8, $libc_unlinkat_trampoline<>(SB) TEXT libc_unmount_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_unmount(SB) GLOBL ·libc_unmount_trampoline_addr(SB), RODATA, $8 DATA ·libc_unmount_trampoline_addr(SB)/8, $libc_unmount_trampoline<>(SB) TEXT libc_write_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_write(SB) GLOBL ·libc_write_trampoline_addr(SB), RODATA, $8 DATA ·libc_write_trampoline_addr(SB)/8, $libc_write_trampoline<>(SB) TEXT libc_mmap_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mmap(SB) GLOBL ·libc_mmap_trampoline_addr(SB), RODATA, $8 DATA ·libc_mmap_trampoline_addr(SB)/8, $libc_mmap_trampoline<>(SB) TEXT libc_munmap_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_munmap(SB) GLOBL ·libc_munmap_trampoline_addr(SB), RODATA, $8 DATA ·libc_munmap_trampoline_addr(SB)/8, $libc_munmap_trampoline<>(SB) TEXT libc_getfsstat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getfsstat(SB) GLOBL ·libc_getfsstat_trampoline_addr(SB), RODATA, $8 DATA ·libc_getfsstat_trampoline_addr(SB)/8, $libc_getfsstat_trampoline<>(SB) TEXT libc_utimensat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_utimensat(SB) GLOBL ·libc_utimensat_trampoline_addr(SB), RODATA, $8 DATA ·libc_utimensat_trampoline_addr(SB)/8, $libc_utimensat_trampoline<>(SB) TEXT libc_pledge_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pledge(SB) GLOBL ·libc_pledge_trampoline_addr(SB), RODATA, $8 DATA ·libc_pledge_trampoline_addr(SB)/8, $libc_pledge_trampoline<>(SB) TEXT libc_unveil_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_unveil(SB) GLOBL ·libc_unveil_trampoline_addr(SB), RODATA, $8 DATA ·libc_unveil_trampoline_addr(SB)/8, $libc_unveil_trampoline<>(SB) ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go ================================================ // go run mksyscall.go -openbsd -libc -tags openbsd,ppc64 syscall_bsd.go syscall_openbsd.go syscall_openbsd_ppc64.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build openbsd && ppc64 package unix import ( "syscall" "unsafe" ) var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(ngid int, gid *_Gid_t) (n int, err error) { r0, _, e1 := syscall_rawSyscall(libc_getgroups_trampoline_addr, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getgroups_trampoline_addr uintptr //go:cgo_import_dynamic libc_getgroups getgroups "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(ngid int, gid *_Gid_t) (err error) { _, _, e1 := syscall_rawSyscall(libc_setgroups_trampoline_addr, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setgroups_trampoline_addr uintptr //go:cgo_import_dynamic libc_setgroups setgroups "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) { r0, _, e1 := syscall_syscall6(libc_wait4_trampoline_addr, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) wpid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_wait4_trampoline_addr uintptr //go:cgo_import_dynamic libc_wait4 wait4 "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { r0, _, e1 := syscall_syscall(libc_accept_trampoline_addr, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_accept_trampoline_addr uintptr //go:cgo_import_dynamic libc_accept accept "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := syscall_syscall(libc_bind_trampoline_addr, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } var libc_bind_trampoline_addr uintptr //go:cgo_import_dynamic libc_bind bind "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := syscall_syscall(libc_connect_trampoline_addr, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } var libc_connect_trampoline_addr uintptr //go:cgo_import_dynamic libc_connect connect "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { r0, _, e1 := syscall_rawSyscall(libc_socket_trampoline_addr, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_socket_trampoline_addr uintptr //go:cgo_import_dynamic libc_socket socket "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { _, _, e1 := syscall_syscall6(libc_getsockopt_trampoline_addr, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getsockopt_trampoline_addr uintptr //go:cgo_import_dynamic libc_getsockopt getsockopt "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { _, _, e1 := syscall_syscall6(libc_setsockopt_trampoline_addr, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setsockopt_trampoline_addr uintptr //go:cgo_import_dynamic libc_setsockopt setsockopt "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := syscall_rawSyscall(libc_getpeername_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } var libc_getpeername_trampoline_addr uintptr //go:cgo_import_dynamic libc_getpeername getpeername "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := syscall_rawSyscall(libc_getsockname_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } var libc_getsockname_trampoline_addr uintptr //go:cgo_import_dynamic libc_getsockname getsockname "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(s int, how int) (err error) { _, _, e1 := syscall_syscall(libc_shutdown_trampoline_addr, uintptr(s), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_shutdown_trampoline_addr uintptr //go:cgo_import_dynamic libc_shutdown shutdown "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { _, _, e1 := syscall_rawSyscall6(libc_socketpair_trampoline_addr, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_socketpair_trampoline_addr uintptr //go:cgo_import_dynamic libc_socketpair socketpair "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall6(libc_recvfrom_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_recvfrom_trampoline_addr uintptr //go:cgo_import_dynamic libc_recvfrom recvfrom "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall6(libc_sendto_trampoline_addr, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } var libc_sendto_trampoline_addr uintptr //go:cgo_import_dynamic libc_sendto sendto "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := syscall_syscall(libc_recvmsg_trampoline_addr, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_recvmsg_trampoline_addr uintptr //go:cgo_import_dynamic libc_recvmsg recvmsg "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := syscall_syscall(libc_sendmsg_trampoline_addr, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_sendmsg_trampoline_addr uintptr //go:cgo_import_dynamic libc_sendmsg sendmsg "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) { r0, _, e1 := syscall_syscall6(libc_kevent_trampoline_addr, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_kevent_trampoline_addr uintptr //go:cgo_import_dynamic libc_kevent kevent "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, timeval *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_utimes_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_utimes_trampoline_addr uintptr //go:cgo_import_dynamic libc_utimes utimes "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func futimes(fd int, timeval *[2]Timeval) (err error) { _, _, e1 := syscall_syscall(libc_futimes_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_futimes_trampoline_addr uintptr //go:cgo_import_dynamic libc_futimes futimes "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := syscall_syscall(libc_poll_trampoline_addr, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_poll_trampoline_addr uintptr //go:cgo_import_dynamic libc_poll poll "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Madvise(b []byte, behav int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall(libc_madvise_trampoline_addr, uintptr(_p0), uintptr(len(b)), uintptr(behav)) if e1 != 0 { err = errnoErr(e1) } return } var libc_madvise_trampoline_addr uintptr //go:cgo_import_dynamic libc_madvise madvise "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall(libc_mlock_trampoline_addr, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mlock_trampoline_addr uintptr //go:cgo_import_dynamic libc_mlock mlock "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlockall(flags int) (err error) { _, _, e1 := syscall_syscall(libc_mlockall_trampoline_addr, uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mlockall_trampoline_addr uintptr //go:cgo_import_dynamic libc_mlockall mlockall "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mprotect(b []byte, prot int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall(libc_mprotect_trampoline_addr, uintptr(_p0), uintptr(len(b)), uintptr(prot)) if e1 != 0 { err = errnoErr(e1) } return } var libc_mprotect_trampoline_addr uintptr //go:cgo_import_dynamic libc_mprotect mprotect "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Msync(b []byte, flags int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall(libc_msync_trampoline_addr, uintptr(_p0), uintptr(len(b)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } var libc_msync_trampoline_addr uintptr //go:cgo_import_dynamic libc_msync msync "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall(libc_munlock_trampoline_addr, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_munlock_trampoline_addr uintptr //go:cgo_import_dynamic libc_munlock munlock "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlockall() (err error) { _, _, e1 := syscall_syscall(libc_munlockall_trampoline_addr, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_munlockall_trampoline_addr uintptr //go:cgo_import_dynamic libc_munlockall munlockall "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe2(p *[2]_C_int, flags int) (err error) { _, _, e1 := syscall_rawSyscall(libc_pipe2_trampoline_addr, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pipe2_trampoline_addr uintptr //go:cgo_import_dynamic libc_pipe2 pipe2 "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getdents(fd int, buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_getdents_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getdents_trampoline_addr uintptr //go:cgo_import_dynamic libc_getdents getdents "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getcwd(buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_getcwd_trampoline_addr, uintptr(_p0), uintptr(len(buf)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getcwd_trampoline_addr uintptr //go:cgo_import_dynamic libc_getcwd getcwd "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getresuid(ruid *_C_int, euid *_C_int, suid *_C_int) { syscall_rawSyscall(libc_getresuid_trampoline_addr, uintptr(unsafe.Pointer(ruid)), uintptr(unsafe.Pointer(euid)), uintptr(unsafe.Pointer(suid))) return } var libc_getresuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getresuid getresuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getresgid(rgid *_C_int, egid *_C_int, sgid *_C_int) { syscall_rawSyscall(libc_getresgid_trampoline_addr, uintptr(unsafe.Pointer(rgid)), uintptr(unsafe.Pointer(egid)), uintptr(unsafe.Pointer(sgid))) return } var libc_getresgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getresgid getresgid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctl(fd int, req uint, arg uintptr) (err error) { _, _, e1 := syscall_syscall(libc_ioctl_trampoline_addr, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } var libc_ioctl_trampoline_addr uintptr //go:cgo_import_dynamic libc_ioctl ioctl "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) { _, _, e1 := syscall_syscall(libc_ioctl_trampoline_addr, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { var _p0 unsafe.Pointer if len(mib) > 0 { _p0 = unsafe.Pointer(&mib[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall6(libc_sysctl_trampoline_addr, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) if e1 != 0 { err = errnoErr(e1) } return } var libc_sysctl_trampoline_addr uintptr //go:cgo_import_dynamic libc_sysctl sysctl "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fcntl(fd int, cmd int, arg int) (n int, err error) { r0, _, e1 := syscall_syscall(libc_fcntl_trampoline_addr, uintptr(fd), uintptr(cmd), uintptr(arg)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fcntl_trampoline_addr uintptr //go:cgo_import_dynamic libc_fcntl fcntl "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fcntlPtr(fd int, cmd int, arg unsafe.Pointer) (n int, err error) { r0, _, e1 := syscall_syscall(libc_fcntl_trampoline_addr, uintptr(fd), uintptr(cmd), uintptr(arg)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { r0, _, e1 := syscall_syscall6(libc_ppoll_trampoline_addr, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_ppoll_trampoline_addr uintptr //go:cgo_import_dynamic libc_ppoll ppoll "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Access(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_access_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_access_trampoline_addr uintptr //go:cgo_import_dynamic libc_access access "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Adjtime(delta *Timeval, olddelta *Timeval) (err error) { _, _, e1 := syscall_syscall(libc_adjtime_trampoline_addr, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_adjtime_trampoline_addr uintptr //go:cgo_import_dynamic libc_adjtime adjtime "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_chdir_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_chdir_trampoline_addr uintptr //go:cgo_import_dynamic libc_chdir chdir "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chflags(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_chflags_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_chflags_trampoline_addr uintptr //go:cgo_import_dynamic libc_chflags chflags "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chmod(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_chmod_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_chmod_trampoline_addr uintptr //go:cgo_import_dynamic libc_chmod chmod "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_chown_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } var libc_chown_trampoline_addr uintptr //go:cgo_import_dynamic libc_chown chown "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chroot(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_chroot_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_chroot_trampoline_addr uintptr //go:cgo_import_dynamic libc_chroot chroot "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ClockGettime(clockid int32, time *Timespec) (err error) { _, _, e1 := syscall_syscall(libc_clock_gettime_trampoline_addr, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_clock_gettime_trampoline_addr uintptr //go:cgo_import_dynamic libc_clock_gettime clock_gettime "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Close(fd int) (err error) { _, _, e1 := syscall_syscall(libc_close_trampoline_addr, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_close_trampoline_addr uintptr //go:cgo_import_dynamic libc_close close "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(fd int) (nfd int, err error) { r0, _, e1 := syscall_syscall(libc_dup_trampoline_addr, uintptr(fd), 0, 0) nfd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_dup_trampoline_addr uintptr //go:cgo_import_dynamic libc_dup dup "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup2(from int, to int) (err error) { _, _, e1 := syscall_syscall(libc_dup2_trampoline_addr, uintptr(from), uintptr(to), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_dup2_trampoline_addr uintptr //go:cgo_import_dynamic libc_dup2 dup2 "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup3(from int, to int, flags int) (err error) { _, _, e1 := syscall_syscall(libc_dup3_trampoline_addr, uintptr(from), uintptr(to), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } var libc_dup3_trampoline_addr uintptr //go:cgo_import_dynamic libc_dup3 dup3 "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Exit(code int) { syscall_syscall(libc_exit_trampoline_addr, uintptr(code), 0, 0) return } var libc_exit_trampoline_addr uintptr //go:cgo_import_dynamic libc_exit exit "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_faccessat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_faccessat_trampoline_addr uintptr //go:cgo_import_dynamic libc_faccessat faccessat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchdir(fd int) (err error) { _, _, e1 := syscall_syscall(libc_fchdir_trampoline_addr, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchdir_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchdir fchdir "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchflags(fd int, flags int) (err error) { _, _, e1 := syscall_syscall(libc_fchflags_trampoline_addr, uintptr(fd), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchflags_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchflags fchflags "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmod(fd int, mode uint32) (err error) { _, _, e1 := syscall_syscall(libc_fchmod_trampoline_addr, uintptr(fd), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchmod_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchmod fchmod "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_fchmodat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchmodat_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchmodat fchmodat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := syscall_syscall(libc_fchown_trampoline_addr, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchown_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchown fchown "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_fchownat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchownat_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchownat fchownat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Flock(fd int, how int) (err error) { _, _, e1 := syscall_syscall(libc_flock_trampoline_addr, uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_flock_trampoline_addr uintptr //go:cgo_import_dynamic libc_flock flock "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fpathconf(fd int, name int) (val int, err error) { r0, _, e1 := syscall_syscall(libc_fpathconf_trampoline_addr, uintptr(fd), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fpathconf_trampoline_addr uintptr //go:cgo_import_dynamic libc_fpathconf fpathconf "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := syscall_syscall(libc_fstat_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fstat_trampoline_addr uintptr //go:cgo_import_dynamic libc_fstat fstat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_fstatat_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fstatat_trampoline_addr uintptr //go:cgo_import_dynamic libc_fstatat fstatat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatfs(fd int, stat *Statfs_t) (err error) { _, _, e1 := syscall_syscall(libc_fstatfs_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fstatfs_trampoline_addr uintptr //go:cgo_import_dynamic libc_fstatfs fstatfs "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fsync(fd int) (err error) { _, _, e1 := syscall_syscall(libc_fsync_trampoline_addr, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fsync_trampoline_addr uintptr //go:cgo_import_dynamic libc_fsync fsync "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { _, _, e1 := syscall_syscall(libc_ftruncate_trampoline_addr, uintptr(fd), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_ftruncate_trampoline_addr uintptr //go:cgo_import_dynamic libc_ftruncate ftruncate "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { r0, _, _ := syscall_rawSyscall(libc_getegid_trampoline_addr, 0, 0, 0) egid = int(r0) return } var libc_getegid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getegid getegid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (uid int) { r0, _, _ := syscall_rawSyscall(libc_geteuid_trampoline_addr, 0, 0, 0) uid = int(r0) return } var libc_geteuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_geteuid geteuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _, _ := syscall_rawSyscall(libc_getgid_trampoline_addr, 0, 0, 0) gid = int(r0) return } var libc_getgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getgid getgid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgid(pid int) (pgid int, err error) { r0, _, e1 := syscall_rawSyscall(libc_getpgid_trampoline_addr, uintptr(pid), 0, 0) pgid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getpgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getpgid getpgid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgrp() (pgrp int) { r0, _, _ := syscall_rawSyscall(libc_getpgrp_trampoline_addr, 0, 0, 0) pgrp = int(r0) return } var libc_getpgrp_trampoline_addr uintptr //go:cgo_import_dynamic libc_getpgrp getpgrp "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpid() (pid int) { r0, _, _ := syscall_rawSyscall(libc_getpid_trampoline_addr, 0, 0, 0) pid = int(r0) return } var libc_getpid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getpid getpid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getppid() (ppid int) { r0, _, _ := syscall_rawSyscall(libc_getppid_trampoline_addr, 0, 0, 0) ppid = int(r0) return } var libc_getppid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getppid getppid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpriority(which int, who int) (prio int, err error) { r0, _, e1 := syscall_syscall(libc_getpriority_trampoline_addr, uintptr(which), uintptr(who), 0) prio = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getpriority_trampoline_addr uintptr //go:cgo_import_dynamic libc_getpriority getpriority "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(which int, lim *Rlimit) (err error) { _, _, e1 := syscall_rawSyscall(libc_getrlimit_trampoline_addr, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getrlimit_trampoline_addr uintptr //go:cgo_import_dynamic libc_getrlimit getrlimit "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrtable() (rtable int, err error) { r0, _, e1 := syscall_rawSyscall(libc_getrtable_trampoline_addr, 0, 0, 0) rtable = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getrtable_trampoline_addr uintptr //go:cgo_import_dynamic libc_getrtable getrtable "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrusage(who int, rusage *Rusage) (err error) { _, _, e1 := syscall_rawSyscall(libc_getrusage_trampoline_addr, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getrusage_trampoline_addr uintptr //go:cgo_import_dynamic libc_getrusage getrusage "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getsid(pid int) (sid int, err error) { r0, _, e1 := syscall_rawSyscall(libc_getsid_trampoline_addr, uintptr(pid), 0, 0) sid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getsid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getsid getsid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tv *Timeval) (err error) { _, _, e1 := syscall_rawSyscall(libc_gettimeofday_trampoline_addr, uintptr(unsafe.Pointer(tv)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_gettimeofday_trampoline_addr uintptr //go:cgo_import_dynamic libc_gettimeofday gettimeofday "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _, _ := syscall_rawSyscall(libc_getuid_trampoline_addr, 0, 0, 0) uid = int(r0) return } var libc_getuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getuid getuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Issetugid() (tainted bool) { r0, _, _ := syscall_syscall(libc_issetugid_trampoline_addr, 0, 0, 0) tainted = bool(r0 != 0) return } var libc_issetugid_trampoline_addr uintptr //go:cgo_import_dynamic libc_issetugid issetugid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kill(pid int, signum syscall.Signal) (err error) { _, _, e1 := syscall_syscall(libc_kill_trampoline_addr, uintptr(pid), uintptr(signum), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_kill_trampoline_addr uintptr //go:cgo_import_dynamic libc_kill kill "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kqueue() (fd int, err error) { r0, _, e1 := syscall_syscall(libc_kqueue_trampoline_addr, 0, 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_kqueue_trampoline_addr uintptr //go:cgo_import_dynamic libc_kqueue kqueue "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_lchown_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } var libc_lchown_trampoline_addr uintptr //go:cgo_import_dynamic libc_lchown lchown "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Link(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := syscall_syscall(libc_link_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_link_trampoline_addr uintptr //go:cgo_import_dynamic libc_link link "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := syscall_syscall6(libc_linkat_trampoline_addr, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_linkat_trampoline_addr uintptr //go:cgo_import_dynamic libc_linkat linkat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, backlog int) (err error) { _, _, e1 := syscall_syscall(libc_listen_trampoline_addr, uintptr(s), uintptr(backlog), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_listen_trampoline_addr uintptr //go:cgo_import_dynamic libc_listen listen "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lstat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_lstat_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_lstat_trampoline_addr uintptr //go:cgo_import_dynamic libc_lstat lstat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdir(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_mkdir_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mkdir_trampoline_addr uintptr //go:cgo_import_dynamic libc_mkdir mkdir "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdirat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_mkdirat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } var libc_mkdirat_trampoline_addr uintptr //go:cgo_import_dynamic libc_mkdirat mkdirat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifo(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_mkfifo_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mkfifo_trampoline_addr uintptr //go:cgo_import_dynamic libc_mkfifo mkfifo "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifoat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_mkfifoat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } var libc_mkfifoat_trampoline_addr uintptr //go:cgo_import_dynamic libc_mkfifoat mkfifoat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknod(path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_mknod_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) if e1 != 0 { err = errnoErr(e1) } return } var libc_mknod_trampoline_addr uintptr //go:cgo_import_dynamic libc_mknod mknod "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_mknodat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mknodat_trampoline_addr uintptr //go:cgo_import_dynamic libc_mknodat mknodat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) { var _p0 *byte _p0, err = BytePtrFromString(fsType) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(dir) if err != nil { return } _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mount_trampoline_addr uintptr //go:cgo_import_dynamic libc_mount mount "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := syscall_syscall(libc_nanosleep_trampoline_addr, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_nanosleep_trampoline_addr uintptr //go:cgo_import_dynamic libc_nanosleep nanosleep "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Open(path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := syscall_syscall(libc_open_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_open_trampoline_addr uintptr //go:cgo_import_dynamic libc_open open "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := syscall_syscall6(libc_openat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_openat_trampoline_addr uintptr //go:cgo_import_dynamic libc_openat openat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pathconf(path string, name int) (val int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := syscall_syscall(libc_pathconf_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pathconf_trampoline_addr uintptr //go:cgo_import_dynamic libc_pathconf pathconf "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall6(libc_pread_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pread_trampoline_addr uintptr //go:cgo_import_dynamic libc_pread pread "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall6(libc_pwrite_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pwrite_trampoline_addr uintptr //go:cgo_import_dynamic libc_pwrite pwrite "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func read(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_read_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_read_trampoline_addr uintptr //go:cgo_import_dynamic libc_read read "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlink(path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_readlink_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_readlink_trampoline_addr uintptr //go:cgo_import_dynamic libc_readlink readlink "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall6(libc_readlinkat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_readlinkat_trampoline_addr uintptr //go:cgo_import_dynamic libc_readlinkat readlinkat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rename(from string, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := syscall_syscall(libc_rename_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_rename_trampoline_addr uintptr //go:cgo_import_dynamic libc_rename rename "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(fromfd int, from string, tofd int, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := syscall_syscall6(libc_renameat_trampoline_addr, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_renameat_trampoline_addr uintptr //go:cgo_import_dynamic libc_renameat renameat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Revoke(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_revoke_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_revoke_trampoline_addr uintptr //go:cgo_import_dynamic libc_revoke revoke "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rmdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_rmdir_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_rmdir_trampoline_addr uintptr //go:cgo_import_dynamic libc_rmdir rmdir "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { r0, _, e1 := syscall_syscall(libc_lseek_trampoline_addr, uintptr(fd), uintptr(offset), uintptr(whence)) newoffset = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_lseek_trampoline_addr uintptr //go:cgo_import_dynamic libc_lseek lseek "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { r0, _, e1 := syscall_syscall6(libc_select_trampoline_addr, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_select_trampoline_addr uintptr //go:cgo_import_dynamic libc_select select "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setegid(egid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setegid_trampoline_addr, uintptr(egid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setegid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setegid setegid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seteuid(euid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_seteuid_trampoline_addr, uintptr(euid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_seteuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_seteuid seteuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setgid(gid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setgid_trampoline_addr, uintptr(gid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setgid setgid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setlogin(name string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(name) if err != nil { return } _, _, e1 := syscall_syscall(libc_setlogin_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setlogin_trampoline_addr uintptr //go:cgo_import_dynamic libc_setlogin setlogin "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setpgid_trampoline_addr, uintptr(pid), uintptr(pgid), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setpgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setpgid setpgid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpriority(which int, who int, prio int) (err error) { _, _, e1 := syscall_syscall(libc_setpriority_trampoline_addr, uintptr(which), uintptr(who), uintptr(prio)) if e1 != 0 { err = errnoErr(e1) } return } var libc_setpriority_trampoline_addr uintptr //go:cgo_import_dynamic libc_setpriority setpriority "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setregid(rgid int, egid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setregid_trampoline_addr, uintptr(rgid), uintptr(egid), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setregid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setregid setregid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setreuid(ruid int, euid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setreuid_trampoline_addr, uintptr(ruid), uintptr(euid), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setreuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setreuid setreuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresgid(rgid int, egid int, sgid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setresgid_trampoline_addr, uintptr(rgid), uintptr(egid), uintptr(sgid)) if e1 != 0 { err = errnoErr(e1) } return } var libc_setresgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setresgid setresgid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresuid(ruid int, euid int, suid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setresuid_trampoline_addr, uintptr(ruid), uintptr(euid), uintptr(suid)) if e1 != 0 { err = errnoErr(e1) } return } var libc_setresuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setresuid setresuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setrtable(rtable int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setrtable_trampoline_addr, uintptr(rtable), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setrtable_trampoline_addr uintptr //go:cgo_import_dynamic libc_setrtable setrtable "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, err error) { r0, _, e1 := syscall_rawSyscall(libc_setsid_trampoline_addr, 0, 0, 0) pid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setsid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setsid setsid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Settimeofday(tp *Timeval) (err error) { _, _, e1 := syscall_rawSyscall(libc_settimeofday_trampoline_addr, uintptr(unsafe.Pointer(tp)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_settimeofday_trampoline_addr uintptr //go:cgo_import_dynamic libc_settimeofday settimeofday "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setuid(uid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setuid_trampoline_addr, uintptr(uid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setuid setuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Stat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_stat_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_stat_trampoline_addr uintptr //go:cgo_import_dynamic libc_stat stat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Statfs(path string, stat *Statfs_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_statfs_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_statfs_trampoline_addr uintptr //go:cgo_import_dynamic libc_statfs statfs "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlink(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := syscall_syscall(libc_symlink_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_symlink_trampoline_addr uintptr //go:cgo_import_dynamic libc_symlink symlink "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := syscall_syscall(libc_symlinkat_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } var libc_symlinkat_trampoline_addr uintptr //go:cgo_import_dynamic libc_symlinkat symlinkat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sync() (err error) { _, _, e1 := syscall_syscall(libc_sync_trampoline_addr, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_sync_trampoline_addr uintptr //go:cgo_import_dynamic libc_sync sync "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_truncate_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_truncate_trampoline_addr uintptr //go:cgo_import_dynamic libc_truncate truncate "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Umask(newmask int) (oldmask int) { r0, _, _ := syscall_syscall(libc_umask_trampoline_addr, uintptr(newmask), 0, 0) oldmask = int(r0) return } var libc_umask_trampoline_addr uintptr //go:cgo_import_dynamic libc_umask umask "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlink(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_unlink_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_unlink_trampoline_addr uintptr //go:cgo_import_dynamic libc_unlink unlink "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlinkat(dirfd int, path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_unlinkat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } var libc_unlinkat_trampoline_addr uintptr //go:cgo_import_dynamic libc_unlinkat unlinkat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unmount(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_unmount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_unmount_trampoline_addr uintptr //go:cgo_import_dynamic libc_unmount unmount "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func write(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_write_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_write_trampoline_addr uintptr //go:cgo_import_dynamic libc_write write "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { r0, _, e1 := syscall_syscall6(libc_mmap_trampoline_addr, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos)) ret = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mmap_trampoline_addr uintptr //go:cgo_import_dynamic libc_mmap mmap "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func munmap(addr uintptr, length uintptr) (err error) { _, _, e1 := syscall_syscall(libc_munmap_trampoline_addr, uintptr(addr), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_munmap_trampoline_addr uintptr //go:cgo_import_dynamic libc_munmap munmap "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getfsstat(stat *Statfs_t, bufsize uintptr, flags int) (n int, err error) { r0, _, e1 := syscall_syscall(libc_getfsstat_trampoline_addr, uintptr(unsafe.Pointer(stat)), uintptr(bufsize), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getfsstat_trampoline_addr uintptr //go:cgo_import_dynamic libc_getfsstat getfsstat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_utimensat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_utimensat_trampoline_addr uintptr //go:cgo_import_dynamic libc_utimensat utimensat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pledge(promises *byte, execpromises *byte) (err error) { _, _, e1 := syscall_syscall(libc_pledge_trampoline_addr, uintptr(unsafe.Pointer(promises)), uintptr(unsafe.Pointer(execpromises)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pledge_trampoline_addr uintptr //go:cgo_import_dynamic libc_pledge pledge "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func unveil(path *byte, flags *byte) (err error) { _, _, e1 := syscall_syscall(libc_unveil_trampoline_addr, uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(flags)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_unveil_trampoline_addr uintptr //go:cgo_import_dynamic libc_unveil unveil "libc.so" ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s ================================================ // go run mkasm.go openbsd ppc64 // Code generated by the command above; DO NOT EDIT. #include "textflag.h" TEXT libc_getgroups_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_getgroups(SB) RET GLOBL ·libc_getgroups_trampoline_addr(SB), RODATA, $8 DATA ·libc_getgroups_trampoline_addr(SB)/8, $libc_getgroups_trampoline<>(SB) TEXT libc_setgroups_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_setgroups(SB) RET GLOBL ·libc_setgroups_trampoline_addr(SB), RODATA, $8 DATA ·libc_setgroups_trampoline_addr(SB)/8, $libc_setgroups_trampoline<>(SB) TEXT libc_wait4_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_wait4(SB) RET GLOBL ·libc_wait4_trampoline_addr(SB), RODATA, $8 DATA ·libc_wait4_trampoline_addr(SB)/8, $libc_wait4_trampoline<>(SB) TEXT libc_accept_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_accept(SB) RET GLOBL ·libc_accept_trampoline_addr(SB), RODATA, $8 DATA ·libc_accept_trampoline_addr(SB)/8, $libc_accept_trampoline<>(SB) TEXT libc_bind_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_bind(SB) RET GLOBL ·libc_bind_trampoline_addr(SB), RODATA, $8 DATA ·libc_bind_trampoline_addr(SB)/8, $libc_bind_trampoline<>(SB) TEXT libc_connect_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_connect(SB) RET GLOBL ·libc_connect_trampoline_addr(SB), RODATA, $8 DATA ·libc_connect_trampoline_addr(SB)/8, $libc_connect_trampoline<>(SB) TEXT libc_socket_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_socket(SB) RET GLOBL ·libc_socket_trampoline_addr(SB), RODATA, $8 DATA ·libc_socket_trampoline_addr(SB)/8, $libc_socket_trampoline<>(SB) TEXT libc_getsockopt_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_getsockopt(SB) RET GLOBL ·libc_getsockopt_trampoline_addr(SB), RODATA, $8 DATA ·libc_getsockopt_trampoline_addr(SB)/8, $libc_getsockopt_trampoline<>(SB) TEXT libc_setsockopt_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_setsockopt(SB) RET GLOBL ·libc_setsockopt_trampoline_addr(SB), RODATA, $8 DATA ·libc_setsockopt_trampoline_addr(SB)/8, $libc_setsockopt_trampoline<>(SB) TEXT libc_getpeername_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_getpeername(SB) RET GLOBL ·libc_getpeername_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpeername_trampoline_addr(SB)/8, $libc_getpeername_trampoline<>(SB) TEXT libc_getsockname_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_getsockname(SB) RET GLOBL ·libc_getsockname_trampoline_addr(SB), RODATA, $8 DATA ·libc_getsockname_trampoline_addr(SB)/8, $libc_getsockname_trampoline<>(SB) TEXT libc_shutdown_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_shutdown(SB) RET GLOBL ·libc_shutdown_trampoline_addr(SB), RODATA, $8 DATA ·libc_shutdown_trampoline_addr(SB)/8, $libc_shutdown_trampoline<>(SB) TEXT libc_socketpair_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_socketpair(SB) RET GLOBL ·libc_socketpair_trampoline_addr(SB), RODATA, $8 DATA ·libc_socketpair_trampoline_addr(SB)/8, $libc_socketpair_trampoline<>(SB) TEXT libc_recvfrom_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_recvfrom(SB) RET GLOBL ·libc_recvfrom_trampoline_addr(SB), RODATA, $8 DATA ·libc_recvfrom_trampoline_addr(SB)/8, $libc_recvfrom_trampoline<>(SB) TEXT libc_sendto_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_sendto(SB) RET GLOBL ·libc_sendto_trampoline_addr(SB), RODATA, $8 DATA ·libc_sendto_trampoline_addr(SB)/8, $libc_sendto_trampoline<>(SB) TEXT libc_recvmsg_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_recvmsg(SB) RET GLOBL ·libc_recvmsg_trampoline_addr(SB), RODATA, $8 DATA ·libc_recvmsg_trampoline_addr(SB)/8, $libc_recvmsg_trampoline<>(SB) TEXT libc_sendmsg_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_sendmsg(SB) RET GLOBL ·libc_sendmsg_trampoline_addr(SB), RODATA, $8 DATA ·libc_sendmsg_trampoline_addr(SB)/8, $libc_sendmsg_trampoline<>(SB) TEXT libc_kevent_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_kevent(SB) RET GLOBL ·libc_kevent_trampoline_addr(SB), RODATA, $8 DATA ·libc_kevent_trampoline_addr(SB)/8, $libc_kevent_trampoline<>(SB) TEXT libc_utimes_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_utimes(SB) RET GLOBL ·libc_utimes_trampoline_addr(SB), RODATA, $8 DATA ·libc_utimes_trampoline_addr(SB)/8, $libc_utimes_trampoline<>(SB) TEXT libc_futimes_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_futimes(SB) RET GLOBL ·libc_futimes_trampoline_addr(SB), RODATA, $8 DATA ·libc_futimes_trampoline_addr(SB)/8, $libc_futimes_trampoline<>(SB) TEXT libc_poll_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_poll(SB) RET GLOBL ·libc_poll_trampoline_addr(SB), RODATA, $8 DATA ·libc_poll_trampoline_addr(SB)/8, $libc_poll_trampoline<>(SB) TEXT libc_madvise_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_madvise(SB) RET GLOBL ·libc_madvise_trampoline_addr(SB), RODATA, $8 DATA ·libc_madvise_trampoline_addr(SB)/8, $libc_madvise_trampoline<>(SB) TEXT libc_mlock_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_mlock(SB) RET GLOBL ·libc_mlock_trampoline_addr(SB), RODATA, $8 DATA ·libc_mlock_trampoline_addr(SB)/8, $libc_mlock_trampoline<>(SB) TEXT libc_mlockall_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_mlockall(SB) RET GLOBL ·libc_mlockall_trampoline_addr(SB), RODATA, $8 DATA ·libc_mlockall_trampoline_addr(SB)/8, $libc_mlockall_trampoline<>(SB) TEXT libc_mprotect_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_mprotect(SB) RET GLOBL ·libc_mprotect_trampoline_addr(SB), RODATA, $8 DATA ·libc_mprotect_trampoline_addr(SB)/8, $libc_mprotect_trampoline<>(SB) TEXT libc_msync_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_msync(SB) RET GLOBL ·libc_msync_trampoline_addr(SB), RODATA, $8 DATA ·libc_msync_trampoline_addr(SB)/8, $libc_msync_trampoline<>(SB) TEXT libc_munlock_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_munlock(SB) RET GLOBL ·libc_munlock_trampoline_addr(SB), RODATA, $8 DATA ·libc_munlock_trampoline_addr(SB)/8, $libc_munlock_trampoline<>(SB) TEXT libc_munlockall_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_munlockall(SB) RET GLOBL ·libc_munlockall_trampoline_addr(SB), RODATA, $8 DATA ·libc_munlockall_trampoline_addr(SB)/8, $libc_munlockall_trampoline<>(SB) TEXT libc_pipe2_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_pipe2(SB) RET GLOBL ·libc_pipe2_trampoline_addr(SB), RODATA, $8 DATA ·libc_pipe2_trampoline_addr(SB)/8, $libc_pipe2_trampoline<>(SB) TEXT libc_getdents_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_getdents(SB) RET GLOBL ·libc_getdents_trampoline_addr(SB), RODATA, $8 DATA ·libc_getdents_trampoline_addr(SB)/8, $libc_getdents_trampoline<>(SB) TEXT libc_getcwd_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_getcwd(SB) RET GLOBL ·libc_getcwd_trampoline_addr(SB), RODATA, $8 DATA ·libc_getcwd_trampoline_addr(SB)/8, $libc_getcwd_trampoline<>(SB) TEXT libc_getresuid_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_getresuid(SB) RET GLOBL ·libc_getresuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getresuid_trampoline_addr(SB)/8, $libc_getresuid_trampoline<>(SB) TEXT libc_getresgid_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_getresgid(SB) RET GLOBL ·libc_getresgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getresgid_trampoline_addr(SB)/8, $libc_getresgid_trampoline<>(SB) TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_ioctl(SB) RET GLOBL ·libc_ioctl_trampoline_addr(SB), RODATA, $8 DATA ·libc_ioctl_trampoline_addr(SB)/8, $libc_ioctl_trampoline<>(SB) TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_sysctl(SB) RET GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8 DATA ·libc_sysctl_trampoline_addr(SB)/8, $libc_sysctl_trampoline<>(SB) TEXT libc_fcntl_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_fcntl(SB) RET GLOBL ·libc_fcntl_trampoline_addr(SB), RODATA, $8 DATA ·libc_fcntl_trampoline_addr(SB)/8, $libc_fcntl_trampoline<>(SB) TEXT libc_ppoll_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_ppoll(SB) RET GLOBL ·libc_ppoll_trampoline_addr(SB), RODATA, $8 DATA ·libc_ppoll_trampoline_addr(SB)/8, $libc_ppoll_trampoline<>(SB) TEXT libc_access_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_access(SB) RET GLOBL ·libc_access_trampoline_addr(SB), RODATA, $8 DATA ·libc_access_trampoline_addr(SB)/8, $libc_access_trampoline<>(SB) TEXT libc_adjtime_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_adjtime(SB) RET GLOBL ·libc_adjtime_trampoline_addr(SB), RODATA, $8 DATA ·libc_adjtime_trampoline_addr(SB)/8, $libc_adjtime_trampoline<>(SB) TEXT libc_chdir_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_chdir(SB) RET GLOBL ·libc_chdir_trampoline_addr(SB), RODATA, $8 DATA ·libc_chdir_trampoline_addr(SB)/8, $libc_chdir_trampoline<>(SB) TEXT libc_chflags_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_chflags(SB) RET GLOBL ·libc_chflags_trampoline_addr(SB), RODATA, $8 DATA ·libc_chflags_trampoline_addr(SB)/8, $libc_chflags_trampoline<>(SB) TEXT libc_chmod_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_chmod(SB) RET GLOBL ·libc_chmod_trampoline_addr(SB), RODATA, $8 DATA ·libc_chmod_trampoline_addr(SB)/8, $libc_chmod_trampoline<>(SB) TEXT libc_chown_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_chown(SB) RET GLOBL ·libc_chown_trampoline_addr(SB), RODATA, $8 DATA ·libc_chown_trampoline_addr(SB)/8, $libc_chown_trampoline<>(SB) TEXT libc_chroot_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_chroot(SB) RET GLOBL ·libc_chroot_trampoline_addr(SB), RODATA, $8 DATA ·libc_chroot_trampoline_addr(SB)/8, $libc_chroot_trampoline<>(SB) TEXT libc_clock_gettime_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_clock_gettime(SB) RET GLOBL ·libc_clock_gettime_trampoline_addr(SB), RODATA, $8 DATA ·libc_clock_gettime_trampoline_addr(SB)/8, $libc_clock_gettime_trampoline<>(SB) TEXT libc_close_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_close(SB) RET GLOBL ·libc_close_trampoline_addr(SB), RODATA, $8 DATA ·libc_close_trampoline_addr(SB)/8, $libc_close_trampoline<>(SB) TEXT libc_dup_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_dup(SB) RET GLOBL ·libc_dup_trampoline_addr(SB), RODATA, $8 DATA ·libc_dup_trampoline_addr(SB)/8, $libc_dup_trampoline<>(SB) TEXT libc_dup2_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_dup2(SB) RET GLOBL ·libc_dup2_trampoline_addr(SB), RODATA, $8 DATA ·libc_dup2_trampoline_addr(SB)/8, $libc_dup2_trampoline<>(SB) TEXT libc_dup3_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_dup3(SB) RET GLOBL ·libc_dup3_trampoline_addr(SB), RODATA, $8 DATA ·libc_dup3_trampoline_addr(SB)/8, $libc_dup3_trampoline<>(SB) TEXT libc_exit_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_exit(SB) RET GLOBL ·libc_exit_trampoline_addr(SB), RODATA, $8 DATA ·libc_exit_trampoline_addr(SB)/8, $libc_exit_trampoline<>(SB) TEXT libc_faccessat_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_faccessat(SB) RET GLOBL ·libc_faccessat_trampoline_addr(SB), RODATA, $8 DATA ·libc_faccessat_trampoline_addr(SB)/8, $libc_faccessat_trampoline<>(SB) TEXT libc_fchdir_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_fchdir(SB) RET GLOBL ·libc_fchdir_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchdir_trampoline_addr(SB)/8, $libc_fchdir_trampoline<>(SB) TEXT libc_fchflags_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_fchflags(SB) RET GLOBL ·libc_fchflags_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchflags_trampoline_addr(SB)/8, $libc_fchflags_trampoline<>(SB) TEXT libc_fchmod_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_fchmod(SB) RET GLOBL ·libc_fchmod_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchmod_trampoline_addr(SB)/8, $libc_fchmod_trampoline<>(SB) TEXT libc_fchmodat_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_fchmodat(SB) RET GLOBL ·libc_fchmodat_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchmodat_trampoline_addr(SB)/8, $libc_fchmodat_trampoline<>(SB) TEXT libc_fchown_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_fchown(SB) RET GLOBL ·libc_fchown_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchown_trampoline_addr(SB)/8, $libc_fchown_trampoline<>(SB) TEXT libc_fchownat_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_fchownat(SB) RET GLOBL ·libc_fchownat_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchownat_trampoline_addr(SB)/8, $libc_fchownat_trampoline<>(SB) TEXT libc_flock_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_flock(SB) RET GLOBL ·libc_flock_trampoline_addr(SB), RODATA, $8 DATA ·libc_flock_trampoline_addr(SB)/8, $libc_flock_trampoline<>(SB) TEXT libc_fpathconf_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_fpathconf(SB) RET GLOBL ·libc_fpathconf_trampoline_addr(SB), RODATA, $8 DATA ·libc_fpathconf_trampoline_addr(SB)/8, $libc_fpathconf_trampoline<>(SB) TEXT libc_fstat_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_fstat(SB) RET GLOBL ·libc_fstat_trampoline_addr(SB), RODATA, $8 DATA ·libc_fstat_trampoline_addr(SB)/8, $libc_fstat_trampoline<>(SB) TEXT libc_fstatat_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_fstatat(SB) RET GLOBL ·libc_fstatat_trampoline_addr(SB), RODATA, $8 DATA ·libc_fstatat_trampoline_addr(SB)/8, $libc_fstatat_trampoline<>(SB) TEXT libc_fstatfs_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_fstatfs(SB) RET GLOBL ·libc_fstatfs_trampoline_addr(SB), RODATA, $8 DATA ·libc_fstatfs_trampoline_addr(SB)/8, $libc_fstatfs_trampoline<>(SB) TEXT libc_fsync_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_fsync(SB) RET GLOBL ·libc_fsync_trampoline_addr(SB), RODATA, $8 DATA ·libc_fsync_trampoline_addr(SB)/8, $libc_fsync_trampoline<>(SB) TEXT libc_ftruncate_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_ftruncate(SB) RET GLOBL ·libc_ftruncate_trampoline_addr(SB), RODATA, $8 DATA ·libc_ftruncate_trampoline_addr(SB)/8, $libc_ftruncate_trampoline<>(SB) TEXT libc_getegid_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_getegid(SB) RET GLOBL ·libc_getegid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getegid_trampoline_addr(SB)/8, $libc_getegid_trampoline<>(SB) TEXT libc_geteuid_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_geteuid(SB) RET GLOBL ·libc_geteuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_geteuid_trampoline_addr(SB)/8, $libc_geteuid_trampoline<>(SB) TEXT libc_getgid_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_getgid(SB) RET GLOBL ·libc_getgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getgid_trampoline_addr(SB)/8, $libc_getgid_trampoline<>(SB) TEXT libc_getpgid_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_getpgid(SB) RET GLOBL ·libc_getpgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpgid_trampoline_addr(SB)/8, $libc_getpgid_trampoline<>(SB) TEXT libc_getpgrp_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_getpgrp(SB) RET GLOBL ·libc_getpgrp_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpgrp_trampoline_addr(SB)/8, $libc_getpgrp_trampoline<>(SB) TEXT libc_getpid_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_getpid(SB) RET GLOBL ·libc_getpid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpid_trampoline_addr(SB)/8, $libc_getpid_trampoline<>(SB) TEXT libc_getppid_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_getppid(SB) RET GLOBL ·libc_getppid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getppid_trampoline_addr(SB)/8, $libc_getppid_trampoline<>(SB) TEXT libc_getpriority_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_getpriority(SB) RET GLOBL ·libc_getpriority_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpriority_trampoline_addr(SB)/8, $libc_getpriority_trampoline<>(SB) TEXT libc_getrlimit_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_getrlimit(SB) RET GLOBL ·libc_getrlimit_trampoline_addr(SB), RODATA, $8 DATA ·libc_getrlimit_trampoline_addr(SB)/8, $libc_getrlimit_trampoline<>(SB) TEXT libc_getrtable_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_getrtable(SB) RET GLOBL ·libc_getrtable_trampoline_addr(SB), RODATA, $8 DATA ·libc_getrtable_trampoline_addr(SB)/8, $libc_getrtable_trampoline<>(SB) TEXT libc_getrusage_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_getrusage(SB) RET GLOBL ·libc_getrusage_trampoline_addr(SB), RODATA, $8 DATA ·libc_getrusage_trampoline_addr(SB)/8, $libc_getrusage_trampoline<>(SB) TEXT libc_getsid_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_getsid(SB) RET GLOBL ·libc_getsid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getsid_trampoline_addr(SB)/8, $libc_getsid_trampoline<>(SB) TEXT libc_gettimeofday_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_gettimeofday(SB) RET GLOBL ·libc_gettimeofday_trampoline_addr(SB), RODATA, $8 DATA ·libc_gettimeofday_trampoline_addr(SB)/8, $libc_gettimeofday_trampoline<>(SB) TEXT libc_getuid_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_getuid(SB) RET GLOBL ·libc_getuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getuid_trampoline_addr(SB)/8, $libc_getuid_trampoline<>(SB) TEXT libc_issetugid_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_issetugid(SB) RET GLOBL ·libc_issetugid_trampoline_addr(SB), RODATA, $8 DATA ·libc_issetugid_trampoline_addr(SB)/8, $libc_issetugid_trampoline<>(SB) TEXT libc_kill_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_kill(SB) RET GLOBL ·libc_kill_trampoline_addr(SB), RODATA, $8 DATA ·libc_kill_trampoline_addr(SB)/8, $libc_kill_trampoline<>(SB) TEXT libc_kqueue_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_kqueue(SB) RET GLOBL ·libc_kqueue_trampoline_addr(SB), RODATA, $8 DATA ·libc_kqueue_trampoline_addr(SB)/8, $libc_kqueue_trampoline<>(SB) TEXT libc_lchown_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_lchown(SB) RET GLOBL ·libc_lchown_trampoline_addr(SB), RODATA, $8 DATA ·libc_lchown_trampoline_addr(SB)/8, $libc_lchown_trampoline<>(SB) TEXT libc_link_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_link(SB) RET GLOBL ·libc_link_trampoline_addr(SB), RODATA, $8 DATA ·libc_link_trampoline_addr(SB)/8, $libc_link_trampoline<>(SB) TEXT libc_linkat_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_linkat(SB) RET GLOBL ·libc_linkat_trampoline_addr(SB), RODATA, $8 DATA ·libc_linkat_trampoline_addr(SB)/8, $libc_linkat_trampoline<>(SB) TEXT libc_listen_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_listen(SB) RET GLOBL ·libc_listen_trampoline_addr(SB), RODATA, $8 DATA ·libc_listen_trampoline_addr(SB)/8, $libc_listen_trampoline<>(SB) TEXT libc_lstat_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_lstat(SB) RET GLOBL ·libc_lstat_trampoline_addr(SB), RODATA, $8 DATA ·libc_lstat_trampoline_addr(SB)/8, $libc_lstat_trampoline<>(SB) TEXT libc_mkdir_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_mkdir(SB) RET GLOBL ·libc_mkdir_trampoline_addr(SB), RODATA, $8 DATA ·libc_mkdir_trampoline_addr(SB)/8, $libc_mkdir_trampoline<>(SB) TEXT libc_mkdirat_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_mkdirat(SB) RET GLOBL ·libc_mkdirat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mkdirat_trampoline_addr(SB)/8, $libc_mkdirat_trampoline<>(SB) TEXT libc_mkfifo_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_mkfifo(SB) RET GLOBL ·libc_mkfifo_trampoline_addr(SB), RODATA, $8 DATA ·libc_mkfifo_trampoline_addr(SB)/8, $libc_mkfifo_trampoline<>(SB) TEXT libc_mkfifoat_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_mkfifoat(SB) RET GLOBL ·libc_mkfifoat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mkfifoat_trampoline_addr(SB)/8, $libc_mkfifoat_trampoline<>(SB) TEXT libc_mknod_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_mknod(SB) RET GLOBL ·libc_mknod_trampoline_addr(SB), RODATA, $8 DATA ·libc_mknod_trampoline_addr(SB)/8, $libc_mknod_trampoline<>(SB) TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_mknodat(SB) RET GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mknodat_trampoline_addr(SB)/8, $libc_mknodat_trampoline<>(SB) TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_mount(SB) RET GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $8 DATA ·libc_mount_trampoline_addr(SB)/8, $libc_mount_trampoline<>(SB) TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_nanosleep(SB) RET GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $8 DATA ·libc_nanosleep_trampoline_addr(SB)/8, $libc_nanosleep_trampoline<>(SB) TEXT libc_open_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_open(SB) RET GLOBL ·libc_open_trampoline_addr(SB), RODATA, $8 DATA ·libc_open_trampoline_addr(SB)/8, $libc_open_trampoline<>(SB) TEXT libc_openat_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_openat(SB) RET GLOBL ·libc_openat_trampoline_addr(SB), RODATA, $8 DATA ·libc_openat_trampoline_addr(SB)/8, $libc_openat_trampoline<>(SB) TEXT libc_pathconf_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_pathconf(SB) RET GLOBL ·libc_pathconf_trampoline_addr(SB), RODATA, $8 DATA ·libc_pathconf_trampoline_addr(SB)/8, $libc_pathconf_trampoline<>(SB) TEXT libc_pread_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_pread(SB) RET GLOBL ·libc_pread_trampoline_addr(SB), RODATA, $8 DATA ·libc_pread_trampoline_addr(SB)/8, $libc_pread_trampoline<>(SB) TEXT libc_pwrite_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_pwrite(SB) RET GLOBL ·libc_pwrite_trampoline_addr(SB), RODATA, $8 DATA ·libc_pwrite_trampoline_addr(SB)/8, $libc_pwrite_trampoline<>(SB) TEXT libc_read_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_read(SB) RET GLOBL ·libc_read_trampoline_addr(SB), RODATA, $8 DATA ·libc_read_trampoline_addr(SB)/8, $libc_read_trampoline<>(SB) TEXT libc_readlink_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_readlink(SB) RET GLOBL ·libc_readlink_trampoline_addr(SB), RODATA, $8 DATA ·libc_readlink_trampoline_addr(SB)/8, $libc_readlink_trampoline<>(SB) TEXT libc_readlinkat_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_readlinkat(SB) RET GLOBL ·libc_readlinkat_trampoline_addr(SB), RODATA, $8 DATA ·libc_readlinkat_trampoline_addr(SB)/8, $libc_readlinkat_trampoline<>(SB) TEXT libc_rename_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_rename(SB) RET GLOBL ·libc_rename_trampoline_addr(SB), RODATA, $8 DATA ·libc_rename_trampoline_addr(SB)/8, $libc_rename_trampoline<>(SB) TEXT libc_renameat_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_renameat(SB) RET GLOBL ·libc_renameat_trampoline_addr(SB), RODATA, $8 DATA ·libc_renameat_trampoline_addr(SB)/8, $libc_renameat_trampoline<>(SB) TEXT libc_revoke_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_revoke(SB) RET GLOBL ·libc_revoke_trampoline_addr(SB), RODATA, $8 DATA ·libc_revoke_trampoline_addr(SB)/8, $libc_revoke_trampoline<>(SB) TEXT libc_rmdir_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_rmdir(SB) RET GLOBL ·libc_rmdir_trampoline_addr(SB), RODATA, $8 DATA ·libc_rmdir_trampoline_addr(SB)/8, $libc_rmdir_trampoline<>(SB) TEXT libc_lseek_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_lseek(SB) RET GLOBL ·libc_lseek_trampoline_addr(SB), RODATA, $8 DATA ·libc_lseek_trampoline_addr(SB)/8, $libc_lseek_trampoline<>(SB) TEXT libc_select_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_select(SB) RET GLOBL ·libc_select_trampoline_addr(SB), RODATA, $8 DATA ·libc_select_trampoline_addr(SB)/8, $libc_select_trampoline<>(SB) TEXT libc_setegid_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_setegid(SB) RET GLOBL ·libc_setegid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setegid_trampoline_addr(SB)/8, $libc_setegid_trampoline<>(SB) TEXT libc_seteuid_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_seteuid(SB) RET GLOBL ·libc_seteuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_seteuid_trampoline_addr(SB)/8, $libc_seteuid_trampoline<>(SB) TEXT libc_setgid_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_setgid(SB) RET GLOBL ·libc_setgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setgid_trampoline_addr(SB)/8, $libc_setgid_trampoline<>(SB) TEXT libc_setlogin_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_setlogin(SB) RET GLOBL ·libc_setlogin_trampoline_addr(SB), RODATA, $8 DATA ·libc_setlogin_trampoline_addr(SB)/8, $libc_setlogin_trampoline<>(SB) TEXT libc_setpgid_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_setpgid(SB) RET GLOBL ·libc_setpgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setpgid_trampoline_addr(SB)/8, $libc_setpgid_trampoline<>(SB) TEXT libc_setpriority_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_setpriority(SB) RET GLOBL ·libc_setpriority_trampoline_addr(SB), RODATA, $8 DATA ·libc_setpriority_trampoline_addr(SB)/8, $libc_setpriority_trampoline<>(SB) TEXT libc_setregid_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_setregid(SB) RET GLOBL ·libc_setregid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setregid_trampoline_addr(SB)/8, $libc_setregid_trampoline<>(SB) TEXT libc_setreuid_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_setreuid(SB) RET GLOBL ·libc_setreuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setreuid_trampoline_addr(SB)/8, $libc_setreuid_trampoline<>(SB) TEXT libc_setresgid_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_setresgid(SB) RET GLOBL ·libc_setresgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setresgid_trampoline_addr(SB)/8, $libc_setresgid_trampoline<>(SB) TEXT libc_setresuid_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_setresuid(SB) RET GLOBL ·libc_setresuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setresuid_trampoline_addr(SB)/8, $libc_setresuid_trampoline<>(SB) TEXT libc_setrtable_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_setrtable(SB) RET GLOBL ·libc_setrtable_trampoline_addr(SB), RODATA, $8 DATA ·libc_setrtable_trampoline_addr(SB)/8, $libc_setrtable_trampoline<>(SB) TEXT libc_setsid_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_setsid(SB) RET GLOBL ·libc_setsid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setsid_trampoline_addr(SB)/8, $libc_setsid_trampoline<>(SB) TEXT libc_settimeofday_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_settimeofday(SB) RET GLOBL ·libc_settimeofday_trampoline_addr(SB), RODATA, $8 DATA ·libc_settimeofday_trampoline_addr(SB)/8, $libc_settimeofday_trampoline<>(SB) TEXT libc_setuid_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_setuid(SB) RET GLOBL ·libc_setuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setuid_trampoline_addr(SB)/8, $libc_setuid_trampoline<>(SB) TEXT libc_stat_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_stat(SB) RET GLOBL ·libc_stat_trampoline_addr(SB), RODATA, $8 DATA ·libc_stat_trampoline_addr(SB)/8, $libc_stat_trampoline<>(SB) TEXT libc_statfs_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_statfs(SB) RET GLOBL ·libc_statfs_trampoline_addr(SB), RODATA, $8 DATA ·libc_statfs_trampoline_addr(SB)/8, $libc_statfs_trampoline<>(SB) TEXT libc_symlink_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_symlink(SB) RET GLOBL ·libc_symlink_trampoline_addr(SB), RODATA, $8 DATA ·libc_symlink_trampoline_addr(SB)/8, $libc_symlink_trampoline<>(SB) TEXT libc_symlinkat_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_symlinkat(SB) RET GLOBL ·libc_symlinkat_trampoline_addr(SB), RODATA, $8 DATA ·libc_symlinkat_trampoline_addr(SB)/8, $libc_symlinkat_trampoline<>(SB) TEXT libc_sync_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_sync(SB) RET GLOBL ·libc_sync_trampoline_addr(SB), RODATA, $8 DATA ·libc_sync_trampoline_addr(SB)/8, $libc_sync_trampoline<>(SB) TEXT libc_truncate_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_truncate(SB) RET GLOBL ·libc_truncate_trampoline_addr(SB), RODATA, $8 DATA ·libc_truncate_trampoline_addr(SB)/8, $libc_truncate_trampoline<>(SB) TEXT libc_umask_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_umask(SB) RET GLOBL ·libc_umask_trampoline_addr(SB), RODATA, $8 DATA ·libc_umask_trampoline_addr(SB)/8, $libc_umask_trampoline<>(SB) TEXT libc_unlink_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_unlink(SB) RET GLOBL ·libc_unlink_trampoline_addr(SB), RODATA, $8 DATA ·libc_unlink_trampoline_addr(SB)/8, $libc_unlink_trampoline<>(SB) TEXT libc_unlinkat_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_unlinkat(SB) RET GLOBL ·libc_unlinkat_trampoline_addr(SB), RODATA, $8 DATA ·libc_unlinkat_trampoline_addr(SB)/8, $libc_unlinkat_trampoline<>(SB) TEXT libc_unmount_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_unmount(SB) RET GLOBL ·libc_unmount_trampoline_addr(SB), RODATA, $8 DATA ·libc_unmount_trampoline_addr(SB)/8, $libc_unmount_trampoline<>(SB) TEXT libc_write_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_write(SB) RET GLOBL ·libc_write_trampoline_addr(SB), RODATA, $8 DATA ·libc_write_trampoline_addr(SB)/8, $libc_write_trampoline<>(SB) TEXT libc_mmap_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_mmap(SB) RET GLOBL ·libc_mmap_trampoline_addr(SB), RODATA, $8 DATA ·libc_mmap_trampoline_addr(SB)/8, $libc_mmap_trampoline<>(SB) TEXT libc_munmap_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_munmap(SB) RET GLOBL ·libc_munmap_trampoline_addr(SB), RODATA, $8 DATA ·libc_munmap_trampoline_addr(SB)/8, $libc_munmap_trampoline<>(SB) TEXT libc_getfsstat_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_getfsstat(SB) RET GLOBL ·libc_getfsstat_trampoline_addr(SB), RODATA, $8 DATA ·libc_getfsstat_trampoline_addr(SB)/8, $libc_getfsstat_trampoline<>(SB) TEXT libc_utimensat_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_utimensat(SB) RET GLOBL ·libc_utimensat_trampoline_addr(SB), RODATA, $8 DATA ·libc_utimensat_trampoline_addr(SB)/8, $libc_utimensat_trampoline<>(SB) TEXT libc_pledge_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_pledge(SB) RET GLOBL ·libc_pledge_trampoline_addr(SB), RODATA, $8 DATA ·libc_pledge_trampoline_addr(SB)/8, $libc_pledge_trampoline<>(SB) TEXT libc_unveil_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_unveil(SB) RET GLOBL ·libc_unveil_trampoline_addr(SB), RODATA, $8 DATA ·libc_unveil_trampoline_addr(SB)/8, $libc_unveil_trampoline<>(SB) ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go ================================================ // go run mksyscall.go -openbsd -libc -tags openbsd,riscv64 syscall_bsd.go syscall_openbsd.go syscall_openbsd_riscv64.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build openbsd && riscv64 package unix import ( "syscall" "unsafe" ) var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(ngid int, gid *_Gid_t) (n int, err error) { r0, _, e1 := syscall_rawSyscall(libc_getgroups_trampoline_addr, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getgroups_trampoline_addr uintptr //go:cgo_import_dynamic libc_getgroups getgroups "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(ngid int, gid *_Gid_t) (err error) { _, _, e1 := syscall_rawSyscall(libc_setgroups_trampoline_addr, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setgroups_trampoline_addr uintptr //go:cgo_import_dynamic libc_setgroups setgroups "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) { r0, _, e1 := syscall_syscall6(libc_wait4_trampoline_addr, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) wpid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_wait4_trampoline_addr uintptr //go:cgo_import_dynamic libc_wait4 wait4 "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { r0, _, e1 := syscall_syscall(libc_accept_trampoline_addr, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_accept_trampoline_addr uintptr //go:cgo_import_dynamic libc_accept accept "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := syscall_syscall(libc_bind_trampoline_addr, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } var libc_bind_trampoline_addr uintptr //go:cgo_import_dynamic libc_bind bind "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := syscall_syscall(libc_connect_trampoline_addr, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } var libc_connect_trampoline_addr uintptr //go:cgo_import_dynamic libc_connect connect "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { r0, _, e1 := syscall_rawSyscall(libc_socket_trampoline_addr, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_socket_trampoline_addr uintptr //go:cgo_import_dynamic libc_socket socket "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { _, _, e1 := syscall_syscall6(libc_getsockopt_trampoline_addr, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getsockopt_trampoline_addr uintptr //go:cgo_import_dynamic libc_getsockopt getsockopt "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { _, _, e1 := syscall_syscall6(libc_setsockopt_trampoline_addr, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setsockopt_trampoline_addr uintptr //go:cgo_import_dynamic libc_setsockopt setsockopt "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := syscall_rawSyscall(libc_getpeername_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } var libc_getpeername_trampoline_addr uintptr //go:cgo_import_dynamic libc_getpeername getpeername "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := syscall_rawSyscall(libc_getsockname_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } var libc_getsockname_trampoline_addr uintptr //go:cgo_import_dynamic libc_getsockname getsockname "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(s int, how int) (err error) { _, _, e1 := syscall_syscall(libc_shutdown_trampoline_addr, uintptr(s), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_shutdown_trampoline_addr uintptr //go:cgo_import_dynamic libc_shutdown shutdown "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { _, _, e1 := syscall_rawSyscall6(libc_socketpair_trampoline_addr, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_socketpair_trampoline_addr uintptr //go:cgo_import_dynamic libc_socketpair socketpair "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall6(libc_recvfrom_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_recvfrom_trampoline_addr uintptr //go:cgo_import_dynamic libc_recvfrom recvfrom "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall6(libc_sendto_trampoline_addr, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } var libc_sendto_trampoline_addr uintptr //go:cgo_import_dynamic libc_sendto sendto "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := syscall_syscall(libc_recvmsg_trampoline_addr, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_recvmsg_trampoline_addr uintptr //go:cgo_import_dynamic libc_recvmsg recvmsg "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := syscall_syscall(libc_sendmsg_trampoline_addr, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_sendmsg_trampoline_addr uintptr //go:cgo_import_dynamic libc_sendmsg sendmsg "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) { r0, _, e1 := syscall_syscall6(libc_kevent_trampoline_addr, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_kevent_trampoline_addr uintptr //go:cgo_import_dynamic libc_kevent kevent "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, timeval *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_utimes_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_utimes_trampoline_addr uintptr //go:cgo_import_dynamic libc_utimes utimes "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func futimes(fd int, timeval *[2]Timeval) (err error) { _, _, e1 := syscall_syscall(libc_futimes_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_futimes_trampoline_addr uintptr //go:cgo_import_dynamic libc_futimes futimes "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := syscall_syscall(libc_poll_trampoline_addr, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_poll_trampoline_addr uintptr //go:cgo_import_dynamic libc_poll poll "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Madvise(b []byte, behav int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall(libc_madvise_trampoline_addr, uintptr(_p0), uintptr(len(b)), uintptr(behav)) if e1 != 0 { err = errnoErr(e1) } return } var libc_madvise_trampoline_addr uintptr //go:cgo_import_dynamic libc_madvise madvise "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall(libc_mlock_trampoline_addr, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mlock_trampoline_addr uintptr //go:cgo_import_dynamic libc_mlock mlock "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlockall(flags int) (err error) { _, _, e1 := syscall_syscall(libc_mlockall_trampoline_addr, uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mlockall_trampoline_addr uintptr //go:cgo_import_dynamic libc_mlockall mlockall "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mprotect(b []byte, prot int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall(libc_mprotect_trampoline_addr, uintptr(_p0), uintptr(len(b)), uintptr(prot)) if e1 != 0 { err = errnoErr(e1) } return } var libc_mprotect_trampoline_addr uintptr //go:cgo_import_dynamic libc_mprotect mprotect "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Msync(b []byte, flags int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall(libc_msync_trampoline_addr, uintptr(_p0), uintptr(len(b)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } var libc_msync_trampoline_addr uintptr //go:cgo_import_dynamic libc_msync msync "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall(libc_munlock_trampoline_addr, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_munlock_trampoline_addr uintptr //go:cgo_import_dynamic libc_munlock munlock "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlockall() (err error) { _, _, e1 := syscall_syscall(libc_munlockall_trampoline_addr, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_munlockall_trampoline_addr uintptr //go:cgo_import_dynamic libc_munlockall munlockall "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe2(p *[2]_C_int, flags int) (err error) { _, _, e1 := syscall_rawSyscall(libc_pipe2_trampoline_addr, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pipe2_trampoline_addr uintptr //go:cgo_import_dynamic libc_pipe2 pipe2 "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getdents(fd int, buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_getdents_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getdents_trampoline_addr uintptr //go:cgo_import_dynamic libc_getdents getdents "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getcwd(buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_getcwd_trampoline_addr, uintptr(_p0), uintptr(len(buf)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getcwd_trampoline_addr uintptr //go:cgo_import_dynamic libc_getcwd getcwd "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getresuid(ruid *_C_int, euid *_C_int, suid *_C_int) { syscall_rawSyscall(libc_getresuid_trampoline_addr, uintptr(unsafe.Pointer(ruid)), uintptr(unsafe.Pointer(euid)), uintptr(unsafe.Pointer(suid))) return } var libc_getresuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getresuid getresuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getresgid(rgid *_C_int, egid *_C_int, sgid *_C_int) { syscall_rawSyscall(libc_getresgid_trampoline_addr, uintptr(unsafe.Pointer(rgid)), uintptr(unsafe.Pointer(egid)), uintptr(unsafe.Pointer(sgid))) return } var libc_getresgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getresgid getresgid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctl(fd int, req uint, arg uintptr) (err error) { _, _, e1 := syscall_syscall(libc_ioctl_trampoline_addr, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } var libc_ioctl_trampoline_addr uintptr //go:cgo_import_dynamic libc_ioctl ioctl "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) { _, _, e1 := syscall_syscall(libc_ioctl_trampoline_addr, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { var _p0 unsafe.Pointer if len(mib) > 0 { _p0 = unsafe.Pointer(&mib[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := syscall_syscall6(libc_sysctl_trampoline_addr, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) if e1 != 0 { err = errnoErr(e1) } return } var libc_sysctl_trampoline_addr uintptr //go:cgo_import_dynamic libc_sysctl sysctl "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fcntl(fd int, cmd int, arg int) (n int, err error) { r0, _, e1 := syscall_syscall(libc_fcntl_trampoline_addr, uintptr(fd), uintptr(cmd), uintptr(arg)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fcntl_trampoline_addr uintptr //go:cgo_import_dynamic libc_fcntl fcntl "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fcntlPtr(fd int, cmd int, arg unsafe.Pointer) (n int, err error) { r0, _, e1 := syscall_syscall(libc_fcntl_trampoline_addr, uintptr(fd), uintptr(cmd), uintptr(arg)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { r0, _, e1 := syscall_syscall6(libc_ppoll_trampoline_addr, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_ppoll_trampoline_addr uintptr //go:cgo_import_dynamic libc_ppoll ppoll "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Access(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_access_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_access_trampoline_addr uintptr //go:cgo_import_dynamic libc_access access "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Adjtime(delta *Timeval, olddelta *Timeval) (err error) { _, _, e1 := syscall_syscall(libc_adjtime_trampoline_addr, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_adjtime_trampoline_addr uintptr //go:cgo_import_dynamic libc_adjtime adjtime "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_chdir_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_chdir_trampoline_addr uintptr //go:cgo_import_dynamic libc_chdir chdir "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chflags(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_chflags_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_chflags_trampoline_addr uintptr //go:cgo_import_dynamic libc_chflags chflags "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chmod(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_chmod_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_chmod_trampoline_addr uintptr //go:cgo_import_dynamic libc_chmod chmod "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_chown_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } var libc_chown_trampoline_addr uintptr //go:cgo_import_dynamic libc_chown chown "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chroot(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_chroot_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_chroot_trampoline_addr uintptr //go:cgo_import_dynamic libc_chroot chroot "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ClockGettime(clockid int32, time *Timespec) (err error) { _, _, e1 := syscall_syscall(libc_clock_gettime_trampoline_addr, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_clock_gettime_trampoline_addr uintptr //go:cgo_import_dynamic libc_clock_gettime clock_gettime "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Close(fd int) (err error) { _, _, e1 := syscall_syscall(libc_close_trampoline_addr, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_close_trampoline_addr uintptr //go:cgo_import_dynamic libc_close close "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(fd int) (nfd int, err error) { r0, _, e1 := syscall_syscall(libc_dup_trampoline_addr, uintptr(fd), 0, 0) nfd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_dup_trampoline_addr uintptr //go:cgo_import_dynamic libc_dup dup "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup2(from int, to int) (err error) { _, _, e1 := syscall_syscall(libc_dup2_trampoline_addr, uintptr(from), uintptr(to), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_dup2_trampoline_addr uintptr //go:cgo_import_dynamic libc_dup2 dup2 "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup3(from int, to int, flags int) (err error) { _, _, e1 := syscall_syscall(libc_dup3_trampoline_addr, uintptr(from), uintptr(to), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } var libc_dup3_trampoline_addr uintptr //go:cgo_import_dynamic libc_dup3 dup3 "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Exit(code int) { syscall_syscall(libc_exit_trampoline_addr, uintptr(code), 0, 0) return } var libc_exit_trampoline_addr uintptr //go:cgo_import_dynamic libc_exit exit "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_faccessat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_faccessat_trampoline_addr uintptr //go:cgo_import_dynamic libc_faccessat faccessat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchdir(fd int) (err error) { _, _, e1 := syscall_syscall(libc_fchdir_trampoline_addr, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchdir_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchdir fchdir "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchflags(fd int, flags int) (err error) { _, _, e1 := syscall_syscall(libc_fchflags_trampoline_addr, uintptr(fd), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchflags_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchflags fchflags "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmod(fd int, mode uint32) (err error) { _, _, e1 := syscall_syscall(libc_fchmod_trampoline_addr, uintptr(fd), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchmod_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchmod fchmod "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_fchmodat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchmodat_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchmodat fchmodat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := syscall_syscall(libc_fchown_trampoline_addr, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchown_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchown fchown "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_fchownat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fchownat_trampoline_addr uintptr //go:cgo_import_dynamic libc_fchownat fchownat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Flock(fd int, how int) (err error) { _, _, e1 := syscall_syscall(libc_flock_trampoline_addr, uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_flock_trampoline_addr uintptr //go:cgo_import_dynamic libc_flock flock "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fpathconf(fd int, name int) (val int, err error) { r0, _, e1 := syscall_syscall(libc_fpathconf_trampoline_addr, uintptr(fd), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fpathconf_trampoline_addr uintptr //go:cgo_import_dynamic libc_fpathconf fpathconf "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := syscall_syscall(libc_fstat_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fstat_trampoline_addr uintptr //go:cgo_import_dynamic libc_fstat fstat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_fstatat_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fstatat_trampoline_addr uintptr //go:cgo_import_dynamic libc_fstatat fstatat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatfs(fd int, stat *Statfs_t) (err error) { _, _, e1 := syscall_syscall(libc_fstatfs_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fstatfs_trampoline_addr uintptr //go:cgo_import_dynamic libc_fstatfs fstatfs "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fsync(fd int) (err error) { _, _, e1 := syscall_syscall(libc_fsync_trampoline_addr, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_fsync_trampoline_addr uintptr //go:cgo_import_dynamic libc_fsync fsync "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { _, _, e1 := syscall_syscall(libc_ftruncate_trampoline_addr, uintptr(fd), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_ftruncate_trampoline_addr uintptr //go:cgo_import_dynamic libc_ftruncate ftruncate "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { r0, _, _ := syscall_rawSyscall(libc_getegid_trampoline_addr, 0, 0, 0) egid = int(r0) return } var libc_getegid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getegid getegid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (uid int) { r0, _, _ := syscall_rawSyscall(libc_geteuid_trampoline_addr, 0, 0, 0) uid = int(r0) return } var libc_geteuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_geteuid geteuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _, _ := syscall_rawSyscall(libc_getgid_trampoline_addr, 0, 0, 0) gid = int(r0) return } var libc_getgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getgid getgid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgid(pid int) (pgid int, err error) { r0, _, e1 := syscall_rawSyscall(libc_getpgid_trampoline_addr, uintptr(pid), 0, 0) pgid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getpgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getpgid getpgid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgrp() (pgrp int) { r0, _, _ := syscall_rawSyscall(libc_getpgrp_trampoline_addr, 0, 0, 0) pgrp = int(r0) return } var libc_getpgrp_trampoline_addr uintptr //go:cgo_import_dynamic libc_getpgrp getpgrp "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpid() (pid int) { r0, _, _ := syscall_rawSyscall(libc_getpid_trampoline_addr, 0, 0, 0) pid = int(r0) return } var libc_getpid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getpid getpid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getppid() (ppid int) { r0, _, _ := syscall_rawSyscall(libc_getppid_trampoline_addr, 0, 0, 0) ppid = int(r0) return } var libc_getppid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getppid getppid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpriority(which int, who int) (prio int, err error) { r0, _, e1 := syscall_syscall(libc_getpriority_trampoline_addr, uintptr(which), uintptr(who), 0) prio = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getpriority_trampoline_addr uintptr //go:cgo_import_dynamic libc_getpriority getpriority "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(which int, lim *Rlimit) (err error) { _, _, e1 := syscall_rawSyscall(libc_getrlimit_trampoline_addr, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getrlimit_trampoline_addr uintptr //go:cgo_import_dynamic libc_getrlimit getrlimit "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrtable() (rtable int, err error) { r0, _, e1 := syscall_rawSyscall(libc_getrtable_trampoline_addr, 0, 0, 0) rtable = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getrtable_trampoline_addr uintptr //go:cgo_import_dynamic libc_getrtable getrtable "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrusage(who int, rusage *Rusage) (err error) { _, _, e1 := syscall_rawSyscall(libc_getrusage_trampoline_addr, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getrusage_trampoline_addr uintptr //go:cgo_import_dynamic libc_getrusage getrusage "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getsid(pid int) (sid int, err error) { r0, _, e1 := syscall_rawSyscall(libc_getsid_trampoline_addr, uintptr(pid), 0, 0) sid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getsid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getsid getsid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tv *Timeval) (err error) { _, _, e1 := syscall_rawSyscall(libc_gettimeofday_trampoline_addr, uintptr(unsafe.Pointer(tv)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_gettimeofday_trampoline_addr uintptr //go:cgo_import_dynamic libc_gettimeofday gettimeofday "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _, _ := syscall_rawSyscall(libc_getuid_trampoline_addr, 0, 0, 0) uid = int(r0) return } var libc_getuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_getuid getuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Issetugid() (tainted bool) { r0, _, _ := syscall_syscall(libc_issetugid_trampoline_addr, 0, 0, 0) tainted = bool(r0 != 0) return } var libc_issetugid_trampoline_addr uintptr //go:cgo_import_dynamic libc_issetugid issetugid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kill(pid int, signum syscall.Signal) (err error) { _, _, e1 := syscall_syscall(libc_kill_trampoline_addr, uintptr(pid), uintptr(signum), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_kill_trampoline_addr uintptr //go:cgo_import_dynamic libc_kill kill "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kqueue() (fd int, err error) { r0, _, e1 := syscall_syscall(libc_kqueue_trampoline_addr, 0, 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_kqueue_trampoline_addr uintptr //go:cgo_import_dynamic libc_kqueue kqueue "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_lchown_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } var libc_lchown_trampoline_addr uintptr //go:cgo_import_dynamic libc_lchown lchown "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Link(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := syscall_syscall(libc_link_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_link_trampoline_addr uintptr //go:cgo_import_dynamic libc_link link "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := syscall_syscall6(libc_linkat_trampoline_addr, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_linkat_trampoline_addr uintptr //go:cgo_import_dynamic libc_linkat linkat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, backlog int) (err error) { _, _, e1 := syscall_syscall(libc_listen_trampoline_addr, uintptr(s), uintptr(backlog), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_listen_trampoline_addr uintptr //go:cgo_import_dynamic libc_listen listen "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lstat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_lstat_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_lstat_trampoline_addr uintptr //go:cgo_import_dynamic libc_lstat lstat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdir(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_mkdir_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mkdir_trampoline_addr uintptr //go:cgo_import_dynamic libc_mkdir mkdir "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdirat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_mkdirat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } var libc_mkdirat_trampoline_addr uintptr //go:cgo_import_dynamic libc_mkdirat mkdirat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifo(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_mkfifo_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mkfifo_trampoline_addr uintptr //go:cgo_import_dynamic libc_mkfifo mkfifo "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifoat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_mkfifoat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } var libc_mkfifoat_trampoline_addr uintptr //go:cgo_import_dynamic libc_mkfifoat mkfifoat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknod(path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_mknod_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) if e1 != 0 { err = errnoErr(e1) } return } var libc_mknod_trampoline_addr uintptr //go:cgo_import_dynamic libc_mknod mknod "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_mknodat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mknodat_trampoline_addr uintptr //go:cgo_import_dynamic libc_mknodat mknodat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) { var _p0 *byte _p0, err = BytePtrFromString(fsType) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(dir) if err != nil { return } _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mount_trampoline_addr uintptr //go:cgo_import_dynamic libc_mount mount "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := syscall_syscall(libc_nanosleep_trampoline_addr, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_nanosleep_trampoline_addr uintptr //go:cgo_import_dynamic libc_nanosleep nanosleep "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Open(path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := syscall_syscall(libc_open_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_open_trampoline_addr uintptr //go:cgo_import_dynamic libc_open open "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := syscall_syscall6(libc_openat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_openat_trampoline_addr uintptr //go:cgo_import_dynamic libc_openat openat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pathconf(path string, name int) (val int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := syscall_syscall(libc_pathconf_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pathconf_trampoline_addr uintptr //go:cgo_import_dynamic libc_pathconf pathconf "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall6(libc_pread_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pread_trampoline_addr uintptr //go:cgo_import_dynamic libc_pread pread "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall6(libc_pwrite_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pwrite_trampoline_addr uintptr //go:cgo_import_dynamic libc_pwrite pwrite "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func read(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_read_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_read_trampoline_addr uintptr //go:cgo_import_dynamic libc_read read "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlink(path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_readlink_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_readlink_trampoline_addr uintptr //go:cgo_import_dynamic libc_readlink readlink "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall6(libc_readlinkat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_readlinkat_trampoline_addr uintptr //go:cgo_import_dynamic libc_readlinkat readlinkat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rename(from string, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := syscall_syscall(libc_rename_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_rename_trampoline_addr uintptr //go:cgo_import_dynamic libc_rename rename "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(fromfd int, from string, tofd int, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := syscall_syscall6(libc_renameat_trampoline_addr, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_renameat_trampoline_addr uintptr //go:cgo_import_dynamic libc_renameat renameat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Revoke(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_revoke_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_revoke_trampoline_addr uintptr //go:cgo_import_dynamic libc_revoke revoke "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rmdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_rmdir_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_rmdir_trampoline_addr uintptr //go:cgo_import_dynamic libc_rmdir rmdir "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { r0, _, e1 := syscall_syscall(libc_lseek_trampoline_addr, uintptr(fd), uintptr(offset), uintptr(whence)) newoffset = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_lseek_trampoline_addr uintptr //go:cgo_import_dynamic libc_lseek lseek "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { r0, _, e1 := syscall_syscall6(libc_select_trampoline_addr, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_select_trampoline_addr uintptr //go:cgo_import_dynamic libc_select select "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setegid(egid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setegid_trampoline_addr, uintptr(egid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setegid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setegid setegid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seteuid(euid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_seteuid_trampoline_addr, uintptr(euid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_seteuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_seteuid seteuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setgid(gid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setgid_trampoline_addr, uintptr(gid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setgid setgid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setlogin(name string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(name) if err != nil { return } _, _, e1 := syscall_syscall(libc_setlogin_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setlogin_trampoline_addr uintptr //go:cgo_import_dynamic libc_setlogin setlogin "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setpgid_trampoline_addr, uintptr(pid), uintptr(pgid), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setpgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setpgid setpgid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpriority(which int, who int, prio int) (err error) { _, _, e1 := syscall_syscall(libc_setpriority_trampoline_addr, uintptr(which), uintptr(who), uintptr(prio)) if e1 != 0 { err = errnoErr(e1) } return } var libc_setpriority_trampoline_addr uintptr //go:cgo_import_dynamic libc_setpriority setpriority "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setregid(rgid int, egid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setregid_trampoline_addr, uintptr(rgid), uintptr(egid), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setregid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setregid setregid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setreuid(ruid int, euid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setreuid_trampoline_addr, uintptr(ruid), uintptr(euid), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setreuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setreuid setreuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresgid(rgid int, egid int, sgid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setresgid_trampoline_addr, uintptr(rgid), uintptr(egid), uintptr(sgid)) if e1 != 0 { err = errnoErr(e1) } return } var libc_setresgid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setresgid setresgid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresuid(ruid int, euid int, suid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setresuid_trampoline_addr, uintptr(ruid), uintptr(euid), uintptr(suid)) if e1 != 0 { err = errnoErr(e1) } return } var libc_setresuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setresuid setresuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setrtable(rtable int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setrtable_trampoline_addr, uintptr(rtable), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setrtable_trampoline_addr uintptr //go:cgo_import_dynamic libc_setrtable setrtable "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, err error) { r0, _, e1 := syscall_rawSyscall(libc_setsid_trampoline_addr, 0, 0, 0) pid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setsid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setsid setsid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Settimeofday(tp *Timeval) (err error) { _, _, e1 := syscall_rawSyscall(libc_settimeofday_trampoline_addr, uintptr(unsafe.Pointer(tp)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_settimeofday_trampoline_addr uintptr //go:cgo_import_dynamic libc_settimeofday settimeofday "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setuid(uid int) (err error) { _, _, e1 := syscall_rawSyscall(libc_setuid_trampoline_addr, uintptr(uid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_setuid_trampoline_addr uintptr //go:cgo_import_dynamic libc_setuid setuid "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Stat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_stat_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_stat_trampoline_addr uintptr //go:cgo_import_dynamic libc_stat stat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Statfs(path string, stat *Statfs_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_statfs_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_statfs_trampoline_addr uintptr //go:cgo_import_dynamic libc_statfs statfs "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlink(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := syscall_syscall(libc_symlink_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_symlink_trampoline_addr uintptr //go:cgo_import_dynamic libc_symlink symlink "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := syscall_syscall(libc_symlinkat_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } var libc_symlinkat_trampoline_addr uintptr //go:cgo_import_dynamic libc_symlinkat symlinkat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sync() (err error) { _, _, e1 := syscall_syscall(libc_sync_trampoline_addr, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_sync_trampoline_addr uintptr //go:cgo_import_dynamic libc_sync sync "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_truncate_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_truncate_trampoline_addr uintptr //go:cgo_import_dynamic libc_truncate truncate "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Umask(newmask int) (oldmask int) { r0, _, _ := syscall_syscall(libc_umask_trampoline_addr, uintptr(newmask), 0, 0) oldmask = int(r0) return } var libc_umask_trampoline_addr uintptr //go:cgo_import_dynamic libc_umask umask "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlink(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_unlink_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_unlink_trampoline_addr uintptr //go:cgo_import_dynamic libc_unlink unlink "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlinkat(dirfd int, path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_unlinkat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } var libc_unlinkat_trampoline_addr uintptr //go:cgo_import_dynamic libc_unlinkat unlinkat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unmount(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall(libc_unmount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_unmount_trampoline_addr uintptr //go:cgo_import_dynamic libc_unmount unmount "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func write(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := syscall_syscall(libc_write_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_write_trampoline_addr uintptr //go:cgo_import_dynamic libc_write write "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { r0, _, e1 := syscall_syscall6(libc_mmap_trampoline_addr, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos)) ret = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_mmap_trampoline_addr uintptr //go:cgo_import_dynamic libc_mmap mmap "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func munmap(addr uintptr, length uintptr) (err error) { _, _, e1 := syscall_syscall(libc_munmap_trampoline_addr, uintptr(addr), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_munmap_trampoline_addr uintptr //go:cgo_import_dynamic libc_munmap munmap "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getfsstat(stat *Statfs_t, bufsize uintptr, flags int) (n int, err error) { r0, _, e1 := syscall_syscall(libc_getfsstat_trampoline_addr, uintptr(unsafe.Pointer(stat)), uintptr(bufsize), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } var libc_getfsstat_trampoline_addr uintptr //go:cgo_import_dynamic libc_getfsstat getfsstat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := syscall_syscall6(libc_utimensat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_utimensat_trampoline_addr uintptr //go:cgo_import_dynamic libc_utimensat utimensat "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pledge(promises *byte, execpromises *byte) (err error) { _, _, e1 := syscall_syscall(libc_pledge_trampoline_addr, uintptr(unsafe.Pointer(promises)), uintptr(unsafe.Pointer(execpromises)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_pledge_trampoline_addr uintptr //go:cgo_import_dynamic libc_pledge pledge "libc.so" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func unveil(path *byte, flags *byte) (err error) { _, _, e1 := syscall_syscall(libc_unveil_trampoline_addr, uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(flags)), 0) if e1 != 0 { err = errnoErr(e1) } return } var libc_unveil_trampoline_addr uintptr //go:cgo_import_dynamic libc_unveil unveil "libc.so" ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s ================================================ // go run mkasm.go openbsd riscv64 // Code generated by the command above; DO NOT EDIT. #include "textflag.h" TEXT libc_getgroups_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getgroups(SB) GLOBL ·libc_getgroups_trampoline_addr(SB), RODATA, $8 DATA ·libc_getgroups_trampoline_addr(SB)/8, $libc_getgroups_trampoline<>(SB) TEXT libc_setgroups_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setgroups(SB) GLOBL ·libc_setgroups_trampoline_addr(SB), RODATA, $8 DATA ·libc_setgroups_trampoline_addr(SB)/8, $libc_setgroups_trampoline<>(SB) TEXT libc_wait4_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_wait4(SB) GLOBL ·libc_wait4_trampoline_addr(SB), RODATA, $8 DATA ·libc_wait4_trampoline_addr(SB)/8, $libc_wait4_trampoline<>(SB) TEXT libc_accept_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_accept(SB) GLOBL ·libc_accept_trampoline_addr(SB), RODATA, $8 DATA ·libc_accept_trampoline_addr(SB)/8, $libc_accept_trampoline<>(SB) TEXT libc_bind_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_bind(SB) GLOBL ·libc_bind_trampoline_addr(SB), RODATA, $8 DATA ·libc_bind_trampoline_addr(SB)/8, $libc_bind_trampoline<>(SB) TEXT libc_connect_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_connect(SB) GLOBL ·libc_connect_trampoline_addr(SB), RODATA, $8 DATA ·libc_connect_trampoline_addr(SB)/8, $libc_connect_trampoline<>(SB) TEXT libc_socket_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_socket(SB) GLOBL ·libc_socket_trampoline_addr(SB), RODATA, $8 DATA ·libc_socket_trampoline_addr(SB)/8, $libc_socket_trampoline<>(SB) TEXT libc_getsockopt_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getsockopt(SB) GLOBL ·libc_getsockopt_trampoline_addr(SB), RODATA, $8 DATA ·libc_getsockopt_trampoline_addr(SB)/8, $libc_getsockopt_trampoline<>(SB) TEXT libc_setsockopt_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setsockopt(SB) GLOBL ·libc_setsockopt_trampoline_addr(SB), RODATA, $8 DATA ·libc_setsockopt_trampoline_addr(SB)/8, $libc_setsockopt_trampoline<>(SB) TEXT libc_getpeername_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpeername(SB) GLOBL ·libc_getpeername_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpeername_trampoline_addr(SB)/8, $libc_getpeername_trampoline<>(SB) TEXT libc_getsockname_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getsockname(SB) GLOBL ·libc_getsockname_trampoline_addr(SB), RODATA, $8 DATA ·libc_getsockname_trampoline_addr(SB)/8, $libc_getsockname_trampoline<>(SB) TEXT libc_shutdown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_shutdown(SB) GLOBL ·libc_shutdown_trampoline_addr(SB), RODATA, $8 DATA ·libc_shutdown_trampoline_addr(SB)/8, $libc_shutdown_trampoline<>(SB) TEXT libc_socketpair_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_socketpair(SB) GLOBL ·libc_socketpair_trampoline_addr(SB), RODATA, $8 DATA ·libc_socketpair_trampoline_addr(SB)/8, $libc_socketpair_trampoline<>(SB) TEXT libc_recvfrom_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_recvfrom(SB) GLOBL ·libc_recvfrom_trampoline_addr(SB), RODATA, $8 DATA ·libc_recvfrom_trampoline_addr(SB)/8, $libc_recvfrom_trampoline<>(SB) TEXT libc_sendto_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sendto(SB) GLOBL ·libc_sendto_trampoline_addr(SB), RODATA, $8 DATA ·libc_sendto_trampoline_addr(SB)/8, $libc_sendto_trampoline<>(SB) TEXT libc_recvmsg_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_recvmsg(SB) GLOBL ·libc_recvmsg_trampoline_addr(SB), RODATA, $8 DATA ·libc_recvmsg_trampoline_addr(SB)/8, $libc_recvmsg_trampoline<>(SB) TEXT libc_sendmsg_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sendmsg(SB) GLOBL ·libc_sendmsg_trampoline_addr(SB), RODATA, $8 DATA ·libc_sendmsg_trampoline_addr(SB)/8, $libc_sendmsg_trampoline<>(SB) TEXT libc_kevent_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_kevent(SB) GLOBL ·libc_kevent_trampoline_addr(SB), RODATA, $8 DATA ·libc_kevent_trampoline_addr(SB)/8, $libc_kevent_trampoline<>(SB) TEXT libc_utimes_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_utimes(SB) GLOBL ·libc_utimes_trampoline_addr(SB), RODATA, $8 DATA ·libc_utimes_trampoline_addr(SB)/8, $libc_utimes_trampoline<>(SB) TEXT libc_futimes_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_futimes(SB) GLOBL ·libc_futimes_trampoline_addr(SB), RODATA, $8 DATA ·libc_futimes_trampoline_addr(SB)/8, $libc_futimes_trampoline<>(SB) TEXT libc_poll_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_poll(SB) GLOBL ·libc_poll_trampoline_addr(SB), RODATA, $8 DATA ·libc_poll_trampoline_addr(SB)/8, $libc_poll_trampoline<>(SB) TEXT libc_madvise_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_madvise(SB) GLOBL ·libc_madvise_trampoline_addr(SB), RODATA, $8 DATA ·libc_madvise_trampoline_addr(SB)/8, $libc_madvise_trampoline<>(SB) TEXT libc_mlock_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mlock(SB) GLOBL ·libc_mlock_trampoline_addr(SB), RODATA, $8 DATA ·libc_mlock_trampoline_addr(SB)/8, $libc_mlock_trampoline<>(SB) TEXT libc_mlockall_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mlockall(SB) GLOBL ·libc_mlockall_trampoline_addr(SB), RODATA, $8 DATA ·libc_mlockall_trampoline_addr(SB)/8, $libc_mlockall_trampoline<>(SB) TEXT libc_mprotect_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mprotect(SB) GLOBL ·libc_mprotect_trampoline_addr(SB), RODATA, $8 DATA ·libc_mprotect_trampoline_addr(SB)/8, $libc_mprotect_trampoline<>(SB) TEXT libc_msync_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_msync(SB) GLOBL ·libc_msync_trampoline_addr(SB), RODATA, $8 DATA ·libc_msync_trampoline_addr(SB)/8, $libc_msync_trampoline<>(SB) TEXT libc_munlock_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_munlock(SB) GLOBL ·libc_munlock_trampoline_addr(SB), RODATA, $8 DATA ·libc_munlock_trampoline_addr(SB)/8, $libc_munlock_trampoline<>(SB) TEXT libc_munlockall_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_munlockall(SB) GLOBL ·libc_munlockall_trampoline_addr(SB), RODATA, $8 DATA ·libc_munlockall_trampoline_addr(SB)/8, $libc_munlockall_trampoline<>(SB) TEXT libc_pipe2_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pipe2(SB) GLOBL ·libc_pipe2_trampoline_addr(SB), RODATA, $8 DATA ·libc_pipe2_trampoline_addr(SB)/8, $libc_pipe2_trampoline<>(SB) TEXT libc_getdents_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getdents(SB) GLOBL ·libc_getdents_trampoline_addr(SB), RODATA, $8 DATA ·libc_getdents_trampoline_addr(SB)/8, $libc_getdents_trampoline<>(SB) TEXT libc_getcwd_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getcwd(SB) GLOBL ·libc_getcwd_trampoline_addr(SB), RODATA, $8 DATA ·libc_getcwd_trampoline_addr(SB)/8, $libc_getcwd_trampoline<>(SB) TEXT libc_getresuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getresuid(SB) GLOBL ·libc_getresuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getresuid_trampoline_addr(SB)/8, $libc_getresuid_trampoline<>(SB) TEXT libc_getresgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getresgid(SB) GLOBL ·libc_getresgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getresgid_trampoline_addr(SB)/8, $libc_getresgid_trampoline<>(SB) TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ioctl(SB) GLOBL ·libc_ioctl_trampoline_addr(SB), RODATA, $8 DATA ·libc_ioctl_trampoline_addr(SB)/8, $libc_ioctl_trampoline<>(SB) TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sysctl(SB) GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8 DATA ·libc_sysctl_trampoline_addr(SB)/8, $libc_sysctl_trampoline<>(SB) TEXT libc_fcntl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fcntl(SB) GLOBL ·libc_fcntl_trampoline_addr(SB), RODATA, $8 DATA ·libc_fcntl_trampoline_addr(SB)/8, $libc_fcntl_trampoline<>(SB) TEXT libc_ppoll_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ppoll(SB) GLOBL ·libc_ppoll_trampoline_addr(SB), RODATA, $8 DATA ·libc_ppoll_trampoline_addr(SB)/8, $libc_ppoll_trampoline<>(SB) TEXT libc_access_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_access(SB) GLOBL ·libc_access_trampoline_addr(SB), RODATA, $8 DATA ·libc_access_trampoline_addr(SB)/8, $libc_access_trampoline<>(SB) TEXT libc_adjtime_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_adjtime(SB) GLOBL ·libc_adjtime_trampoline_addr(SB), RODATA, $8 DATA ·libc_adjtime_trampoline_addr(SB)/8, $libc_adjtime_trampoline<>(SB) TEXT libc_chdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chdir(SB) GLOBL ·libc_chdir_trampoline_addr(SB), RODATA, $8 DATA ·libc_chdir_trampoline_addr(SB)/8, $libc_chdir_trampoline<>(SB) TEXT libc_chflags_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chflags(SB) GLOBL ·libc_chflags_trampoline_addr(SB), RODATA, $8 DATA ·libc_chflags_trampoline_addr(SB)/8, $libc_chflags_trampoline<>(SB) TEXT libc_chmod_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chmod(SB) GLOBL ·libc_chmod_trampoline_addr(SB), RODATA, $8 DATA ·libc_chmod_trampoline_addr(SB)/8, $libc_chmod_trampoline<>(SB) TEXT libc_chown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chown(SB) GLOBL ·libc_chown_trampoline_addr(SB), RODATA, $8 DATA ·libc_chown_trampoline_addr(SB)/8, $libc_chown_trampoline<>(SB) TEXT libc_chroot_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_chroot(SB) GLOBL ·libc_chroot_trampoline_addr(SB), RODATA, $8 DATA ·libc_chroot_trampoline_addr(SB)/8, $libc_chroot_trampoline<>(SB) TEXT libc_clock_gettime_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_clock_gettime(SB) GLOBL ·libc_clock_gettime_trampoline_addr(SB), RODATA, $8 DATA ·libc_clock_gettime_trampoline_addr(SB)/8, $libc_clock_gettime_trampoline<>(SB) TEXT libc_close_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_close(SB) GLOBL ·libc_close_trampoline_addr(SB), RODATA, $8 DATA ·libc_close_trampoline_addr(SB)/8, $libc_close_trampoline<>(SB) TEXT libc_dup_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_dup(SB) GLOBL ·libc_dup_trampoline_addr(SB), RODATA, $8 DATA ·libc_dup_trampoline_addr(SB)/8, $libc_dup_trampoline<>(SB) TEXT libc_dup2_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_dup2(SB) GLOBL ·libc_dup2_trampoline_addr(SB), RODATA, $8 DATA ·libc_dup2_trampoline_addr(SB)/8, $libc_dup2_trampoline<>(SB) TEXT libc_dup3_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_dup3(SB) GLOBL ·libc_dup3_trampoline_addr(SB), RODATA, $8 DATA ·libc_dup3_trampoline_addr(SB)/8, $libc_dup3_trampoline<>(SB) TEXT libc_exit_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_exit(SB) GLOBL ·libc_exit_trampoline_addr(SB), RODATA, $8 DATA ·libc_exit_trampoline_addr(SB)/8, $libc_exit_trampoline<>(SB) TEXT libc_faccessat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_faccessat(SB) GLOBL ·libc_faccessat_trampoline_addr(SB), RODATA, $8 DATA ·libc_faccessat_trampoline_addr(SB)/8, $libc_faccessat_trampoline<>(SB) TEXT libc_fchdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchdir(SB) GLOBL ·libc_fchdir_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchdir_trampoline_addr(SB)/8, $libc_fchdir_trampoline<>(SB) TEXT libc_fchflags_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchflags(SB) GLOBL ·libc_fchflags_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchflags_trampoline_addr(SB)/8, $libc_fchflags_trampoline<>(SB) TEXT libc_fchmod_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchmod(SB) GLOBL ·libc_fchmod_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchmod_trampoline_addr(SB)/8, $libc_fchmod_trampoline<>(SB) TEXT libc_fchmodat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchmodat(SB) GLOBL ·libc_fchmodat_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchmodat_trampoline_addr(SB)/8, $libc_fchmodat_trampoline<>(SB) TEXT libc_fchown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchown(SB) GLOBL ·libc_fchown_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchown_trampoline_addr(SB)/8, $libc_fchown_trampoline<>(SB) TEXT libc_fchownat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fchownat(SB) GLOBL ·libc_fchownat_trampoline_addr(SB), RODATA, $8 DATA ·libc_fchownat_trampoline_addr(SB)/8, $libc_fchownat_trampoline<>(SB) TEXT libc_flock_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_flock(SB) GLOBL ·libc_flock_trampoline_addr(SB), RODATA, $8 DATA ·libc_flock_trampoline_addr(SB)/8, $libc_flock_trampoline<>(SB) TEXT libc_fpathconf_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fpathconf(SB) GLOBL ·libc_fpathconf_trampoline_addr(SB), RODATA, $8 DATA ·libc_fpathconf_trampoline_addr(SB)/8, $libc_fpathconf_trampoline<>(SB) TEXT libc_fstat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fstat(SB) GLOBL ·libc_fstat_trampoline_addr(SB), RODATA, $8 DATA ·libc_fstat_trampoline_addr(SB)/8, $libc_fstat_trampoline<>(SB) TEXT libc_fstatat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fstatat(SB) GLOBL ·libc_fstatat_trampoline_addr(SB), RODATA, $8 DATA ·libc_fstatat_trampoline_addr(SB)/8, $libc_fstatat_trampoline<>(SB) TEXT libc_fstatfs_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fstatfs(SB) GLOBL ·libc_fstatfs_trampoline_addr(SB), RODATA, $8 DATA ·libc_fstatfs_trampoline_addr(SB)/8, $libc_fstatfs_trampoline<>(SB) TEXT libc_fsync_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fsync(SB) GLOBL ·libc_fsync_trampoline_addr(SB), RODATA, $8 DATA ·libc_fsync_trampoline_addr(SB)/8, $libc_fsync_trampoline<>(SB) TEXT libc_ftruncate_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ftruncate(SB) GLOBL ·libc_ftruncate_trampoline_addr(SB), RODATA, $8 DATA ·libc_ftruncate_trampoline_addr(SB)/8, $libc_ftruncate_trampoline<>(SB) TEXT libc_getegid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getegid(SB) GLOBL ·libc_getegid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getegid_trampoline_addr(SB)/8, $libc_getegid_trampoline<>(SB) TEXT libc_geteuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_geteuid(SB) GLOBL ·libc_geteuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_geteuid_trampoline_addr(SB)/8, $libc_geteuid_trampoline<>(SB) TEXT libc_getgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getgid(SB) GLOBL ·libc_getgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getgid_trampoline_addr(SB)/8, $libc_getgid_trampoline<>(SB) TEXT libc_getpgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpgid(SB) GLOBL ·libc_getpgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpgid_trampoline_addr(SB)/8, $libc_getpgid_trampoline<>(SB) TEXT libc_getpgrp_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpgrp(SB) GLOBL ·libc_getpgrp_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpgrp_trampoline_addr(SB)/8, $libc_getpgrp_trampoline<>(SB) TEXT libc_getpid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpid(SB) GLOBL ·libc_getpid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpid_trampoline_addr(SB)/8, $libc_getpid_trampoline<>(SB) TEXT libc_getppid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getppid(SB) GLOBL ·libc_getppid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getppid_trampoline_addr(SB)/8, $libc_getppid_trampoline<>(SB) TEXT libc_getpriority_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getpriority(SB) GLOBL ·libc_getpriority_trampoline_addr(SB), RODATA, $8 DATA ·libc_getpriority_trampoline_addr(SB)/8, $libc_getpriority_trampoline<>(SB) TEXT libc_getrlimit_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getrlimit(SB) GLOBL ·libc_getrlimit_trampoline_addr(SB), RODATA, $8 DATA ·libc_getrlimit_trampoline_addr(SB)/8, $libc_getrlimit_trampoline<>(SB) TEXT libc_getrtable_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getrtable(SB) GLOBL ·libc_getrtable_trampoline_addr(SB), RODATA, $8 DATA ·libc_getrtable_trampoline_addr(SB)/8, $libc_getrtable_trampoline<>(SB) TEXT libc_getrusage_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getrusage(SB) GLOBL ·libc_getrusage_trampoline_addr(SB), RODATA, $8 DATA ·libc_getrusage_trampoline_addr(SB)/8, $libc_getrusage_trampoline<>(SB) TEXT libc_getsid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getsid(SB) GLOBL ·libc_getsid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getsid_trampoline_addr(SB)/8, $libc_getsid_trampoline<>(SB) TEXT libc_gettimeofday_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_gettimeofday(SB) GLOBL ·libc_gettimeofday_trampoline_addr(SB), RODATA, $8 DATA ·libc_gettimeofday_trampoline_addr(SB)/8, $libc_gettimeofday_trampoline<>(SB) TEXT libc_getuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getuid(SB) GLOBL ·libc_getuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_getuid_trampoline_addr(SB)/8, $libc_getuid_trampoline<>(SB) TEXT libc_issetugid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_issetugid(SB) GLOBL ·libc_issetugid_trampoline_addr(SB), RODATA, $8 DATA ·libc_issetugid_trampoline_addr(SB)/8, $libc_issetugid_trampoline<>(SB) TEXT libc_kill_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_kill(SB) GLOBL ·libc_kill_trampoline_addr(SB), RODATA, $8 DATA ·libc_kill_trampoline_addr(SB)/8, $libc_kill_trampoline<>(SB) TEXT libc_kqueue_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_kqueue(SB) GLOBL ·libc_kqueue_trampoline_addr(SB), RODATA, $8 DATA ·libc_kqueue_trampoline_addr(SB)/8, $libc_kqueue_trampoline<>(SB) TEXT libc_lchown_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_lchown(SB) GLOBL ·libc_lchown_trampoline_addr(SB), RODATA, $8 DATA ·libc_lchown_trampoline_addr(SB)/8, $libc_lchown_trampoline<>(SB) TEXT libc_link_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_link(SB) GLOBL ·libc_link_trampoline_addr(SB), RODATA, $8 DATA ·libc_link_trampoline_addr(SB)/8, $libc_link_trampoline<>(SB) TEXT libc_linkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_linkat(SB) GLOBL ·libc_linkat_trampoline_addr(SB), RODATA, $8 DATA ·libc_linkat_trampoline_addr(SB)/8, $libc_linkat_trampoline<>(SB) TEXT libc_listen_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_listen(SB) GLOBL ·libc_listen_trampoline_addr(SB), RODATA, $8 DATA ·libc_listen_trampoline_addr(SB)/8, $libc_listen_trampoline<>(SB) TEXT libc_lstat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_lstat(SB) GLOBL ·libc_lstat_trampoline_addr(SB), RODATA, $8 DATA ·libc_lstat_trampoline_addr(SB)/8, $libc_lstat_trampoline<>(SB) TEXT libc_mkdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkdir(SB) GLOBL ·libc_mkdir_trampoline_addr(SB), RODATA, $8 DATA ·libc_mkdir_trampoline_addr(SB)/8, $libc_mkdir_trampoline<>(SB) TEXT libc_mkdirat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkdirat(SB) GLOBL ·libc_mkdirat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mkdirat_trampoline_addr(SB)/8, $libc_mkdirat_trampoline<>(SB) TEXT libc_mkfifo_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkfifo(SB) GLOBL ·libc_mkfifo_trampoline_addr(SB), RODATA, $8 DATA ·libc_mkfifo_trampoline_addr(SB)/8, $libc_mkfifo_trampoline<>(SB) TEXT libc_mkfifoat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mkfifoat(SB) GLOBL ·libc_mkfifoat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mkfifoat_trampoline_addr(SB)/8, $libc_mkfifoat_trampoline<>(SB) TEXT libc_mknod_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mknod(SB) GLOBL ·libc_mknod_trampoline_addr(SB), RODATA, $8 DATA ·libc_mknod_trampoline_addr(SB)/8, $libc_mknod_trampoline<>(SB) TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mknodat(SB) GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mknodat_trampoline_addr(SB)/8, $libc_mknodat_trampoline<>(SB) TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mount(SB) GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $8 DATA ·libc_mount_trampoline_addr(SB)/8, $libc_mount_trampoline<>(SB) TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_nanosleep(SB) GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $8 DATA ·libc_nanosleep_trampoline_addr(SB)/8, $libc_nanosleep_trampoline<>(SB) TEXT libc_open_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_open(SB) GLOBL ·libc_open_trampoline_addr(SB), RODATA, $8 DATA ·libc_open_trampoline_addr(SB)/8, $libc_open_trampoline<>(SB) TEXT libc_openat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_openat(SB) GLOBL ·libc_openat_trampoline_addr(SB), RODATA, $8 DATA ·libc_openat_trampoline_addr(SB)/8, $libc_openat_trampoline<>(SB) TEXT libc_pathconf_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pathconf(SB) GLOBL ·libc_pathconf_trampoline_addr(SB), RODATA, $8 DATA ·libc_pathconf_trampoline_addr(SB)/8, $libc_pathconf_trampoline<>(SB) TEXT libc_pread_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pread(SB) GLOBL ·libc_pread_trampoline_addr(SB), RODATA, $8 DATA ·libc_pread_trampoline_addr(SB)/8, $libc_pread_trampoline<>(SB) TEXT libc_pwrite_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pwrite(SB) GLOBL ·libc_pwrite_trampoline_addr(SB), RODATA, $8 DATA ·libc_pwrite_trampoline_addr(SB)/8, $libc_pwrite_trampoline<>(SB) TEXT libc_read_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_read(SB) GLOBL ·libc_read_trampoline_addr(SB), RODATA, $8 DATA ·libc_read_trampoline_addr(SB)/8, $libc_read_trampoline<>(SB) TEXT libc_readlink_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_readlink(SB) GLOBL ·libc_readlink_trampoline_addr(SB), RODATA, $8 DATA ·libc_readlink_trampoline_addr(SB)/8, $libc_readlink_trampoline<>(SB) TEXT libc_readlinkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_readlinkat(SB) GLOBL ·libc_readlinkat_trampoline_addr(SB), RODATA, $8 DATA ·libc_readlinkat_trampoline_addr(SB)/8, $libc_readlinkat_trampoline<>(SB) TEXT libc_rename_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_rename(SB) GLOBL ·libc_rename_trampoline_addr(SB), RODATA, $8 DATA ·libc_rename_trampoline_addr(SB)/8, $libc_rename_trampoline<>(SB) TEXT libc_renameat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_renameat(SB) GLOBL ·libc_renameat_trampoline_addr(SB), RODATA, $8 DATA ·libc_renameat_trampoline_addr(SB)/8, $libc_renameat_trampoline<>(SB) TEXT libc_revoke_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_revoke(SB) GLOBL ·libc_revoke_trampoline_addr(SB), RODATA, $8 DATA ·libc_revoke_trampoline_addr(SB)/8, $libc_revoke_trampoline<>(SB) TEXT libc_rmdir_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_rmdir(SB) GLOBL ·libc_rmdir_trampoline_addr(SB), RODATA, $8 DATA ·libc_rmdir_trampoline_addr(SB)/8, $libc_rmdir_trampoline<>(SB) TEXT libc_lseek_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_lseek(SB) GLOBL ·libc_lseek_trampoline_addr(SB), RODATA, $8 DATA ·libc_lseek_trampoline_addr(SB)/8, $libc_lseek_trampoline<>(SB) TEXT libc_select_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_select(SB) GLOBL ·libc_select_trampoline_addr(SB), RODATA, $8 DATA ·libc_select_trampoline_addr(SB)/8, $libc_select_trampoline<>(SB) TEXT libc_setegid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setegid(SB) GLOBL ·libc_setegid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setegid_trampoline_addr(SB)/8, $libc_setegid_trampoline<>(SB) TEXT libc_seteuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_seteuid(SB) GLOBL ·libc_seteuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_seteuid_trampoline_addr(SB)/8, $libc_seteuid_trampoline<>(SB) TEXT libc_setgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setgid(SB) GLOBL ·libc_setgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setgid_trampoline_addr(SB)/8, $libc_setgid_trampoline<>(SB) TEXT libc_setlogin_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setlogin(SB) GLOBL ·libc_setlogin_trampoline_addr(SB), RODATA, $8 DATA ·libc_setlogin_trampoline_addr(SB)/8, $libc_setlogin_trampoline<>(SB) TEXT libc_setpgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setpgid(SB) GLOBL ·libc_setpgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setpgid_trampoline_addr(SB)/8, $libc_setpgid_trampoline<>(SB) TEXT libc_setpriority_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setpriority(SB) GLOBL ·libc_setpriority_trampoline_addr(SB), RODATA, $8 DATA ·libc_setpriority_trampoline_addr(SB)/8, $libc_setpriority_trampoline<>(SB) TEXT libc_setregid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setregid(SB) GLOBL ·libc_setregid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setregid_trampoline_addr(SB)/8, $libc_setregid_trampoline<>(SB) TEXT libc_setreuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setreuid(SB) GLOBL ·libc_setreuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setreuid_trampoline_addr(SB)/8, $libc_setreuid_trampoline<>(SB) TEXT libc_setresgid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setresgid(SB) GLOBL ·libc_setresgid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setresgid_trampoline_addr(SB)/8, $libc_setresgid_trampoline<>(SB) TEXT libc_setresuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setresuid(SB) GLOBL ·libc_setresuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setresuid_trampoline_addr(SB)/8, $libc_setresuid_trampoline<>(SB) TEXT libc_setrtable_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setrtable(SB) GLOBL ·libc_setrtable_trampoline_addr(SB), RODATA, $8 DATA ·libc_setrtable_trampoline_addr(SB)/8, $libc_setrtable_trampoline<>(SB) TEXT libc_setsid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setsid(SB) GLOBL ·libc_setsid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setsid_trampoline_addr(SB)/8, $libc_setsid_trampoline<>(SB) TEXT libc_settimeofday_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_settimeofday(SB) GLOBL ·libc_settimeofday_trampoline_addr(SB), RODATA, $8 DATA ·libc_settimeofday_trampoline_addr(SB)/8, $libc_settimeofday_trampoline<>(SB) TEXT libc_setuid_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_setuid(SB) GLOBL ·libc_setuid_trampoline_addr(SB), RODATA, $8 DATA ·libc_setuid_trampoline_addr(SB)/8, $libc_setuid_trampoline<>(SB) TEXT libc_stat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_stat(SB) GLOBL ·libc_stat_trampoline_addr(SB), RODATA, $8 DATA ·libc_stat_trampoline_addr(SB)/8, $libc_stat_trampoline<>(SB) TEXT libc_statfs_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_statfs(SB) GLOBL ·libc_statfs_trampoline_addr(SB), RODATA, $8 DATA ·libc_statfs_trampoline_addr(SB)/8, $libc_statfs_trampoline<>(SB) TEXT libc_symlink_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_symlink(SB) GLOBL ·libc_symlink_trampoline_addr(SB), RODATA, $8 DATA ·libc_symlink_trampoline_addr(SB)/8, $libc_symlink_trampoline<>(SB) TEXT libc_symlinkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_symlinkat(SB) GLOBL ·libc_symlinkat_trampoline_addr(SB), RODATA, $8 DATA ·libc_symlinkat_trampoline_addr(SB)/8, $libc_symlinkat_trampoline<>(SB) TEXT libc_sync_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sync(SB) GLOBL ·libc_sync_trampoline_addr(SB), RODATA, $8 DATA ·libc_sync_trampoline_addr(SB)/8, $libc_sync_trampoline<>(SB) TEXT libc_truncate_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_truncate(SB) GLOBL ·libc_truncate_trampoline_addr(SB), RODATA, $8 DATA ·libc_truncate_trampoline_addr(SB)/8, $libc_truncate_trampoline<>(SB) TEXT libc_umask_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_umask(SB) GLOBL ·libc_umask_trampoline_addr(SB), RODATA, $8 DATA ·libc_umask_trampoline_addr(SB)/8, $libc_umask_trampoline<>(SB) TEXT libc_unlink_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_unlink(SB) GLOBL ·libc_unlink_trampoline_addr(SB), RODATA, $8 DATA ·libc_unlink_trampoline_addr(SB)/8, $libc_unlink_trampoline<>(SB) TEXT libc_unlinkat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_unlinkat(SB) GLOBL ·libc_unlinkat_trampoline_addr(SB), RODATA, $8 DATA ·libc_unlinkat_trampoline_addr(SB)/8, $libc_unlinkat_trampoline<>(SB) TEXT libc_unmount_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_unmount(SB) GLOBL ·libc_unmount_trampoline_addr(SB), RODATA, $8 DATA ·libc_unmount_trampoline_addr(SB)/8, $libc_unmount_trampoline<>(SB) TEXT libc_write_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_write(SB) GLOBL ·libc_write_trampoline_addr(SB), RODATA, $8 DATA ·libc_write_trampoline_addr(SB)/8, $libc_write_trampoline<>(SB) TEXT libc_mmap_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_mmap(SB) GLOBL ·libc_mmap_trampoline_addr(SB), RODATA, $8 DATA ·libc_mmap_trampoline_addr(SB)/8, $libc_mmap_trampoline<>(SB) TEXT libc_munmap_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_munmap(SB) GLOBL ·libc_munmap_trampoline_addr(SB), RODATA, $8 DATA ·libc_munmap_trampoline_addr(SB)/8, $libc_munmap_trampoline<>(SB) TEXT libc_getfsstat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_getfsstat(SB) GLOBL ·libc_getfsstat_trampoline_addr(SB), RODATA, $8 DATA ·libc_getfsstat_trampoline_addr(SB)/8, $libc_getfsstat_trampoline<>(SB) TEXT libc_utimensat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_utimensat(SB) GLOBL ·libc_utimensat_trampoline_addr(SB), RODATA, $8 DATA ·libc_utimensat_trampoline_addr(SB)/8, $libc_utimensat_trampoline<>(SB) TEXT libc_pledge_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_pledge(SB) GLOBL ·libc_pledge_trampoline_addr(SB), RODATA, $8 DATA ·libc_pledge_trampoline_addr(SB)/8, $libc_pledge_trampoline<>(SB) TEXT libc_unveil_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_unveil(SB) GLOBL ·libc_unveil_trampoline_addr(SB), RODATA, $8 DATA ·libc_unveil_trampoline_addr(SB)/8, $libc_unveil_trampoline<>(SB) ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go ================================================ // go run mksyscall_solaris.go -tags solaris,amd64 syscall_solaris.go syscall_solaris_amd64.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build solaris && amd64 package unix import ( "syscall" "unsafe" ) //go:cgo_import_dynamic libc_pipe pipe "libc.so" //go:cgo_import_dynamic libc_pipe2 pipe2 "libc.so" //go:cgo_import_dynamic libc_getsockname getsockname "libsocket.so" //go:cgo_import_dynamic libc_getcwd getcwd "libc.so" //go:cgo_import_dynamic libc_getgroups getgroups "libc.so" //go:cgo_import_dynamic libc_setgroups setgroups "libc.so" //go:cgo_import_dynamic libc_wait4 wait4 "libc.so" //go:cgo_import_dynamic libc_gethostname gethostname "libc.so" //go:cgo_import_dynamic libc_utimes utimes "libc.so" //go:cgo_import_dynamic libc_utimensat utimensat "libc.so" //go:cgo_import_dynamic libc_fcntl fcntl "libc.so" //go:cgo_import_dynamic libc_futimesat futimesat "libc.so" //go:cgo_import_dynamic libc_accept accept "libsocket.so" //go:cgo_import_dynamic libc___xnet_recvmsg __xnet_recvmsg "libsocket.so" //go:cgo_import_dynamic libc___xnet_sendmsg __xnet_sendmsg "libsocket.so" //go:cgo_import_dynamic libc_acct acct "libc.so" //go:cgo_import_dynamic libc___makedev __makedev "libc.so" //go:cgo_import_dynamic libc___major __major "libc.so" //go:cgo_import_dynamic libc___minor __minor "libc.so" //go:cgo_import_dynamic libc_ioctl ioctl "libc.so" //go:cgo_import_dynamic libc_poll poll "libc.so" //go:cgo_import_dynamic libc_access access "libc.so" //go:cgo_import_dynamic libc_adjtime adjtime "libc.so" //go:cgo_import_dynamic libc_chdir chdir "libc.so" //go:cgo_import_dynamic libc_chmod chmod "libc.so" //go:cgo_import_dynamic libc_chown chown "libc.so" //go:cgo_import_dynamic libc_chroot chroot "libc.so" //go:cgo_import_dynamic libc_clockgettime clockgettime "libc.so" //go:cgo_import_dynamic libc_close close "libc.so" //go:cgo_import_dynamic libc_creat creat "libc.so" //go:cgo_import_dynamic libc_dup dup "libc.so" //go:cgo_import_dynamic libc_dup2 dup2 "libc.so" //go:cgo_import_dynamic libc_exit exit "libc.so" //go:cgo_import_dynamic libc_faccessat faccessat "libc.so" //go:cgo_import_dynamic libc_fchdir fchdir "libc.so" //go:cgo_import_dynamic libc_fchmod fchmod "libc.so" //go:cgo_import_dynamic libc_fchmodat fchmodat "libc.so" //go:cgo_import_dynamic libc_fchown fchown "libc.so" //go:cgo_import_dynamic libc_fchownat fchownat "libc.so" //go:cgo_import_dynamic libc_fdatasync fdatasync "libc.so" //go:cgo_import_dynamic libc_flock flock "libc.so" //go:cgo_import_dynamic libc_fpathconf fpathconf "libc.so" //go:cgo_import_dynamic libc_fstat fstat "libc.so" //go:cgo_import_dynamic libc_fstatat fstatat "libc.so" //go:cgo_import_dynamic libc_fstatvfs fstatvfs "libc.so" //go:cgo_import_dynamic libc_getdents getdents "libc.so" //go:cgo_import_dynamic libc_getgid getgid "libc.so" //go:cgo_import_dynamic libc_getpid getpid "libc.so" //go:cgo_import_dynamic libc_getpgid getpgid "libc.so" //go:cgo_import_dynamic libc_getpgrp getpgrp "libc.so" //go:cgo_import_dynamic libc_geteuid geteuid "libc.so" //go:cgo_import_dynamic libc_getegid getegid "libc.so" //go:cgo_import_dynamic libc_getppid getppid "libc.so" //go:cgo_import_dynamic libc_getpriority getpriority "libc.so" //go:cgo_import_dynamic libc_getrlimit getrlimit "libc.so" //go:cgo_import_dynamic libc_getrusage getrusage "libc.so" //go:cgo_import_dynamic libc_getsid getsid "libc.so" //go:cgo_import_dynamic libc_gettimeofday gettimeofday "libc.so" //go:cgo_import_dynamic libc_getuid getuid "libc.so" //go:cgo_import_dynamic libc_kill kill "libc.so" //go:cgo_import_dynamic libc_lchown lchown "libc.so" //go:cgo_import_dynamic libc_link link "libc.so" //go:cgo_import_dynamic libc___xnet_listen __xnet_listen "libsocket.so" //go:cgo_import_dynamic libc_lstat lstat "libc.so" //go:cgo_import_dynamic libc_madvise madvise "libc.so" //go:cgo_import_dynamic libc_mkdir mkdir "libc.so" //go:cgo_import_dynamic libc_mkdirat mkdirat "libc.so" //go:cgo_import_dynamic libc_mkfifo mkfifo "libc.so" //go:cgo_import_dynamic libc_mkfifoat mkfifoat "libc.so" //go:cgo_import_dynamic libc_mknod mknod "libc.so" //go:cgo_import_dynamic libc_mknodat mknodat "libc.so" //go:cgo_import_dynamic libc_mlock mlock "libc.so" //go:cgo_import_dynamic libc_mlockall mlockall "libc.so" //go:cgo_import_dynamic libc_mprotect mprotect "libc.so" //go:cgo_import_dynamic libc_msync msync "libc.so" //go:cgo_import_dynamic libc_munlock munlock "libc.so" //go:cgo_import_dynamic libc_munlockall munlockall "libc.so" //go:cgo_import_dynamic libc_nanosleep nanosleep "libc.so" //go:cgo_import_dynamic libc_open open "libc.so" //go:cgo_import_dynamic libc_openat openat "libc.so" //go:cgo_import_dynamic libc_pathconf pathconf "libc.so" //go:cgo_import_dynamic libc_pause pause "libc.so" //go:cgo_import_dynamic libc_pread pread "libc.so" //go:cgo_import_dynamic libc_pwrite pwrite "libc.so" //go:cgo_import_dynamic libc_read read "libc.so" //go:cgo_import_dynamic libc_readlink readlink "libc.so" //go:cgo_import_dynamic libc_rename rename "libc.so" //go:cgo_import_dynamic libc_renameat renameat "libc.so" //go:cgo_import_dynamic libc_rmdir rmdir "libc.so" //go:cgo_import_dynamic libc_lseek lseek "libc.so" //go:cgo_import_dynamic libc_select select "libc.so" //go:cgo_import_dynamic libc_setegid setegid "libc.so" //go:cgo_import_dynamic libc_seteuid seteuid "libc.so" //go:cgo_import_dynamic libc_setgid setgid "libc.so" //go:cgo_import_dynamic libc_sethostname sethostname "libc.so" //go:cgo_import_dynamic libc_setpgid setpgid "libc.so" //go:cgo_import_dynamic libc_setpriority setpriority "libc.so" //go:cgo_import_dynamic libc_setregid setregid "libc.so" //go:cgo_import_dynamic libc_setreuid setreuid "libc.so" //go:cgo_import_dynamic libc_setsid setsid "libc.so" //go:cgo_import_dynamic libc_setuid setuid "libc.so" //go:cgo_import_dynamic libc_shutdown shutdown "libsocket.so" //go:cgo_import_dynamic libc_stat stat "libc.so" //go:cgo_import_dynamic libc_statvfs statvfs "libc.so" //go:cgo_import_dynamic libc_symlink symlink "libc.so" //go:cgo_import_dynamic libc_sync sync "libc.so" //go:cgo_import_dynamic libc_sysconf sysconf "libc.so" //go:cgo_import_dynamic libc_times times "libc.so" //go:cgo_import_dynamic libc_truncate truncate "libc.so" //go:cgo_import_dynamic libc_fsync fsync "libc.so" //go:cgo_import_dynamic libc_ftruncate ftruncate "libc.so" //go:cgo_import_dynamic libc_umask umask "libc.so" //go:cgo_import_dynamic libc_uname uname "libc.so" //go:cgo_import_dynamic libc_umount umount "libc.so" //go:cgo_import_dynamic libc_unlink unlink "libc.so" //go:cgo_import_dynamic libc_unlinkat unlinkat "libc.so" //go:cgo_import_dynamic libc_ustat ustat "libc.so" //go:cgo_import_dynamic libc_utime utime "libc.so" //go:cgo_import_dynamic libc___xnet_bind __xnet_bind "libsocket.so" //go:cgo_import_dynamic libc___xnet_connect __xnet_connect "libsocket.so" //go:cgo_import_dynamic libc_mmap mmap "libc.so" //go:cgo_import_dynamic libc_munmap munmap "libc.so" //go:cgo_import_dynamic libc_sendfile sendfile "libsendfile.so" //go:cgo_import_dynamic libc___xnet_sendto __xnet_sendto "libsocket.so" //go:cgo_import_dynamic libc___xnet_socket __xnet_socket "libsocket.so" //go:cgo_import_dynamic libc___xnet_socketpair __xnet_socketpair "libsocket.so" //go:cgo_import_dynamic libc_write write "libc.so" //go:cgo_import_dynamic libc___xnet_getsockopt __xnet_getsockopt "libsocket.so" //go:cgo_import_dynamic libc_getpeername getpeername "libsocket.so" //go:cgo_import_dynamic libc_setsockopt setsockopt "libsocket.so" //go:cgo_import_dynamic libc_recvfrom recvfrom "libsocket.so" //go:cgo_import_dynamic libc_getpeerucred getpeerucred "libc.so" //go:cgo_import_dynamic libc_ucred_get ucred_get "libc.so" //go:cgo_import_dynamic libc_ucred_geteuid ucred_geteuid "libc.so" //go:cgo_import_dynamic libc_ucred_getegid ucred_getegid "libc.so" //go:cgo_import_dynamic libc_ucred_getruid ucred_getruid "libc.so" //go:cgo_import_dynamic libc_ucred_getrgid ucred_getrgid "libc.so" //go:cgo_import_dynamic libc_ucred_getsuid ucred_getsuid "libc.so" //go:cgo_import_dynamic libc_ucred_getsgid ucred_getsgid "libc.so" //go:cgo_import_dynamic libc_ucred_getpid ucred_getpid "libc.so" //go:cgo_import_dynamic libc_ucred_free ucred_free "libc.so" //go:cgo_import_dynamic libc_port_create port_create "libc.so" //go:cgo_import_dynamic libc_port_associate port_associate "libc.so" //go:cgo_import_dynamic libc_port_dissociate port_dissociate "libc.so" //go:cgo_import_dynamic libc_port_get port_get "libc.so" //go:cgo_import_dynamic libc_port_getn port_getn "libc.so" //go:cgo_import_dynamic libc_putmsg putmsg "libc.so" //go:cgo_import_dynamic libc_getmsg getmsg "libc.so" //go:linkname procpipe libc_pipe //go:linkname procpipe2 libc_pipe2 //go:linkname procgetsockname libc_getsockname //go:linkname procGetcwd libc_getcwd //go:linkname procgetgroups libc_getgroups //go:linkname procsetgroups libc_setgroups //go:linkname procwait4 libc_wait4 //go:linkname procgethostname libc_gethostname //go:linkname procutimes libc_utimes //go:linkname procutimensat libc_utimensat //go:linkname procfcntl libc_fcntl //go:linkname procfutimesat libc_futimesat //go:linkname procaccept libc_accept //go:linkname proc__xnet_recvmsg libc___xnet_recvmsg //go:linkname proc__xnet_sendmsg libc___xnet_sendmsg //go:linkname procacct libc_acct //go:linkname proc__makedev libc___makedev //go:linkname proc__major libc___major //go:linkname proc__minor libc___minor //go:linkname procioctl libc_ioctl //go:linkname procpoll libc_poll //go:linkname procAccess libc_access //go:linkname procAdjtime libc_adjtime //go:linkname procChdir libc_chdir //go:linkname procChmod libc_chmod //go:linkname procChown libc_chown //go:linkname procChroot libc_chroot //go:linkname procClockGettime libc_clockgettime //go:linkname procClose libc_close //go:linkname procCreat libc_creat //go:linkname procDup libc_dup //go:linkname procDup2 libc_dup2 //go:linkname procExit libc_exit //go:linkname procFaccessat libc_faccessat //go:linkname procFchdir libc_fchdir //go:linkname procFchmod libc_fchmod //go:linkname procFchmodat libc_fchmodat //go:linkname procFchown libc_fchown //go:linkname procFchownat libc_fchownat //go:linkname procFdatasync libc_fdatasync //go:linkname procFlock libc_flock //go:linkname procFpathconf libc_fpathconf //go:linkname procFstat libc_fstat //go:linkname procFstatat libc_fstatat //go:linkname procFstatvfs libc_fstatvfs //go:linkname procGetdents libc_getdents //go:linkname procGetgid libc_getgid //go:linkname procGetpid libc_getpid //go:linkname procGetpgid libc_getpgid //go:linkname procGetpgrp libc_getpgrp //go:linkname procGeteuid libc_geteuid //go:linkname procGetegid libc_getegid //go:linkname procGetppid libc_getppid //go:linkname procGetpriority libc_getpriority //go:linkname procGetrlimit libc_getrlimit //go:linkname procGetrusage libc_getrusage //go:linkname procGetsid libc_getsid //go:linkname procGettimeofday libc_gettimeofday //go:linkname procGetuid libc_getuid //go:linkname procKill libc_kill //go:linkname procLchown libc_lchown //go:linkname procLink libc_link //go:linkname proc__xnet_listen libc___xnet_listen //go:linkname procLstat libc_lstat //go:linkname procMadvise libc_madvise //go:linkname procMkdir libc_mkdir //go:linkname procMkdirat libc_mkdirat //go:linkname procMkfifo libc_mkfifo //go:linkname procMkfifoat libc_mkfifoat //go:linkname procMknod libc_mknod //go:linkname procMknodat libc_mknodat //go:linkname procMlock libc_mlock //go:linkname procMlockall libc_mlockall //go:linkname procMprotect libc_mprotect //go:linkname procMsync libc_msync //go:linkname procMunlock libc_munlock //go:linkname procMunlockall libc_munlockall //go:linkname procNanosleep libc_nanosleep //go:linkname procOpen libc_open //go:linkname procOpenat libc_openat //go:linkname procPathconf libc_pathconf //go:linkname procPause libc_pause //go:linkname procpread libc_pread //go:linkname procpwrite libc_pwrite //go:linkname procread libc_read //go:linkname procReadlink libc_readlink //go:linkname procRename libc_rename //go:linkname procRenameat libc_renameat //go:linkname procRmdir libc_rmdir //go:linkname proclseek libc_lseek //go:linkname procSelect libc_select //go:linkname procSetegid libc_setegid //go:linkname procSeteuid libc_seteuid //go:linkname procSetgid libc_setgid //go:linkname procSethostname libc_sethostname //go:linkname procSetpgid libc_setpgid //go:linkname procSetpriority libc_setpriority //go:linkname procSetregid libc_setregid //go:linkname procSetreuid libc_setreuid //go:linkname procSetsid libc_setsid //go:linkname procSetuid libc_setuid //go:linkname procshutdown libc_shutdown //go:linkname procStat libc_stat //go:linkname procStatvfs libc_statvfs //go:linkname procSymlink libc_symlink //go:linkname procSync libc_sync //go:linkname procSysconf libc_sysconf //go:linkname procTimes libc_times //go:linkname procTruncate libc_truncate //go:linkname procFsync libc_fsync //go:linkname procFtruncate libc_ftruncate //go:linkname procUmask libc_umask //go:linkname procUname libc_uname //go:linkname procumount libc_umount //go:linkname procUnlink libc_unlink //go:linkname procUnlinkat libc_unlinkat //go:linkname procUstat libc_ustat //go:linkname procUtime libc_utime //go:linkname proc__xnet_bind libc___xnet_bind //go:linkname proc__xnet_connect libc___xnet_connect //go:linkname procmmap libc_mmap //go:linkname procmunmap libc_munmap //go:linkname procsendfile libc_sendfile //go:linkname proc__xnet_sendto libc___xnet_sendto //go:linkname proc__xnet_socket libc___xnet_socket //go:linkname proc__xnet_socketpair libc___xnet_socketpair //go:linkname procwrite libc_write //go:linkname proc__xnet_getsockopt libc___xnet_getsockopt //go:linkname procgetpeername libc_getpeername //go:linkname procsetsockopt libc_setsockopt //go:linkname procrecvfrom libc_recvfrom //go:linkname procgetpeerucred libc_getpeerucred //go:linkname procucred_get libc_ucred_get //go:linkname procucred_geteuid libc_ucred_geteuid //go:linkname procucred_getegid libc_ucred_getegid //go:linkname procucred_getruid libc_ucred_getruid //go:linkname procucred_getrgid libc_ucred_getrgid //go:linkname procucred_getsuid libc_ucred_getsuid //go:linkname procucred_getsgid libc_ucred_getsgid //go:linkname procucred_getpid libc_ucred_getpid //go:linkname procucred_free libc_ucred_free //go:linkname procport_create libc_port_create //go:linkname procport_associate libc_port_associate //go:linkname procport_dissociate libc_port_dissociate //go:linkname procport_get libc_port_get //go:linkname procport_getn libc_port_getn //go:linkname procputmsg libc_putmsg //go:linkname procgetmsg libc_getmsg var ( procpipe, procpipe2, procgetsockname, procGetcwd, procgetgroups, procsetgroups, procwait4, procgethostname, procutimes, procutimensat, procfcntl, procfutimesat, procaccept, proc__xnet_recvmsg, proc__xnet_sendmsg, procacct, proc__makedev, proc__major, proc__minor, procioctl, procpoll, procAccess, procAdjtime, procChdir, procChmod, procChown, procChroot, procClockGettime, procClose, procCreat, procDup, procDup2, procExit, procFaccessat, procFchdir, procFchmod, procFchmodat, procFchown, procFchownat, procFdatasync, procFlock, procFpathconf, procFstat, procFstatat, procFstatvfs, procGetdents, procGetgid, procGetpid, procGetpgid, procGetpgrp, procGeteuid, procGetegid, procGetppid, procGetpriority, procGetrlimit, procGetrusage, procGetsid, procGettimeofday, procGetuid, procKill, procLchown, procLink, proc__xnet_listen, procLstat, procMadvise, procMkdir, procMkdirat, procMkfifo, procMkfifoat, procMknod, procMknodat, procMlock, procMlockall, procMprotect, procMsync, procMunlock, procMunlockall, procNanosleep, procOpen, procOpenat, procPathconf, procPause, procpread, procpwrite, procread, procReadlink, procRename, procRenameat, procRmdir, proclseek, procSelect, procSetegid, procSeteuid, procSetgid, procSethostname, procSetpgid, procSetpriority, procSetregid, procSetreuid, procSetsid, procSetuid, procshutdown, procStat, procStatvfs, procSymlink, procSync, procSysconf, procTimes, procTruncate, procFsync, procFtruncate, procUmask, procUname, procumount, procUnlink, procUnlinkat, procUstat, procUtime, proc__xnet_bind, proc__xnet_connect, procmmap, procmunmap, procsendfile, proc__xnet_sendto, proc__xnet_socket, proc__xnet_socketpair, procwrite, proc__xnet_getsockopt, procgetpeername, procsetsockopt, procrecvfrom, procgetpeerucred, procucred_get, procucred_geteuid, procucred_getegid, procucred_getruid, procucred_getrgid, procucred_getsuid, procucred_getsgid, procucred_getpid, procucred_free, procport_create, procport_associate, procport_dissociate, procport_get, procport_getn, procputmsg, procgetmsg syscallFunc ) // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe(p *[2]_C_int) (n int, err error) { r0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procpipe)), 1, uintptr(unsafe.Pointer(p)), 0, 0, 0, 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe2(p *[2]_C_int, flags int) (err error) { _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procpipe2)), 2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procgetsockname)), 3, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getcwd(buf []byte) (n int, err error) { var _p0 *byte if len(buf) > 0 { _p0 = &buf[0] } r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procGetcwd)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), 0, 0, 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(ngid int, gid *_Gid_t) (n int, err error) { r0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procgetgroups)), 2, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0, 0, 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(ngid int, gid *_Gid_t) (err error) { _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procsetgroups)), 2, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func wait4(pid int32, statusp *_C_int, options int, rusage *Rusage) (wpid int32, err error) { r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procwait4)), 4, uintptr(pid), uintptr(unsafe.Pointer(statusp)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) wpid = int32(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func gethostname(buf []byte) (n int, err error) { var _p0 *byte if len(buf) > 0 { _p0 = &buf[0] } r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procgethostname)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), 0, 0, 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, times *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procutimes)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimensat(fd int, path string, times *[2]Timespec, flag int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procutimensat)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flag), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fcntl(fd int, cmd int, arg int) (val int, err error) { r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procfcntl)), 3, uintptr(fd), uintptr(cmd), uintptr(arg), 0, 0, 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func futimesat(fildes int, path *byte, times *[2]Timeval) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procfutimesat)), 3, uintptr(fildes), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(times)), 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procaccept)), 3, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_recvmsg)), 3, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags), 0, 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_sendmsg)), 3, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags), 0, 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func acct(path *byte) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procacct)), 1, uintptr(unsafe.Pointer(path)), 0, 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func __makedev(version int, major uint, minor uint) (val uint64) { r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&proc__makedev)), 3, uintptr(version), uintptr(major), uintptr(minor), 0, 0, 0) val = uint64(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func __major(version int, dev uint64) (val uint) { r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&proc__major)), 2, uintptr(version), uintptr(dev), 0, 0, 0, 0) val = uint(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func __minor(version int, dev uint64) (val uint) { r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&proc__minor)), 2, uintptr(version), uintptr(dev), 0, 0, 0, 0) val = uint(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctlRet(fd int, req int, arg uintptr) (ret int, err error) { r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procioctl)), 3, uintptr(fd), uintptr(req), uintptr(arg), 0, 0, 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctlPtrRet(fd int, req int, arg unsafe.Pointer) (ret int, err error) { r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procioctl)), 3, uintptr(fd), uintptr(req), uintptr(arg), 0, 0, 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procpoll)), 3, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout), 0, 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Access(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procAccess)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Adjtime(delta *Timeval, olddelta *Timeval) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procAdjtime)), 2, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procChdir)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chmod(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procChmod)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procChown)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chroot(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procChroot)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ClockGettime(clockid int32, time *Timespec) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procClockGettime)), 2, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Close(fd int) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procClose)), 1, uintptr(fd), 0, 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Creat(path string, mode uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procCreat)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(fd int) (nfd int, err error) { r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procDup)), 1, uintptr(fd), 0, 0, 0, 0, 0) nfd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup2(oldfd int, newfd int) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procDup2)), 2, uintptr(oldfd), uintptr(newfd), 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Exit(code int) { sysvicall6(uintptr(unsafe.Pointer(&procExit)), 1, uintptr(code), 0, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFaccessat)), 4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchdir(fd int) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFchdir)), 1, uintptr(fd), 0, 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmod(fd int, mode uint32) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFchmod)), 2, uintptr(fd), uintptr(mode), 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFchmodat)), 4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFchown)), 3, uintptr(fd), uintptr(uid), uintptr(gid), 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFchownat)), 5, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fdatasync(fd int) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFdatasync)), 1, uintptr(fd), 0, 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Flock(fd int, how int) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFlock)), 2, uintptr(fd), uintptr(how), 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fpathconf(fd int, name int) (val int, err error) { r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFpathconf)), 2, uintptr(fd), uintptr(name), 0, 0, 0, 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFstat)), 2, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFstatat)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatvfs(fd int, vfsstat *Statvfs_t) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFstatvfs)), 2, uintptr(fd), uintptr(unsafe.Pointer(vfsstat)), 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getdents(fd int, buf []byte, basep *uintptr) (n int, err error) { var _p0 *byte if len(buf) > 0 { _p0 = &buf[0] } r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procGetdents)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _, _ := rawSysvicall6(uintptr(unsafe.Pointer(&procGetgid)), 0, 0, 0, 0, 0, 0, 0) gid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpid() (pid int) { r0, _, _ := rawSysvicall6(uintptr(unsafe.Pointer(&procGetpid)), 0, 0, 0, 0, 0, 0, 0) pid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgid(pid int) (pgid int, err error) { r0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procGetpgid)), 1, uintptr(pid), 0, 0, 0, 0, 0) pgid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgrp() (pgid int, err error) { r0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procGetpgrp)), 0, 0, 0, 0, 0, 0, 0) pgid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (euid int) { r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&procGeteuid)), 0, 0, 0, 0, 0, 0, 0) euid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&procGetegid)), 0, 0, 0, 0, 0, 0, 0) egid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getppid() (ppid int) { r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&procGetppid)), 0, 0, 0, 0, 0, 0, 0) ppid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpriority(which int, who int) (n int, err error) { r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procGetpriority)), 2, uintptr(which), uintptr(who), 0, 0, 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(which int, lim *Rlimit) (err error) { _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procGetrlimit)), 2, uintptr(which), uintptr(unsafe.Pointer(lim)), 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrusage(who int, rusage *Rusage) (err error) { _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procGetrusage)), 2, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getsid(pid int) (sid int, err error) { r0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procGetsid)), 1, uintptr(pid), 0, 0, 0, 0, 0) sid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tv *Timeval) (err error) { _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procGettimeofday)), 1, uintptr(unsafe.Pointer(tv)), 0, 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _, _ := rawSysvicall6(uintptr(unsafe.Pointer(&procGetuid)), 0, 0, 0, 0, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kill(pid int, signum syscall.Signal) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procKill)), 2, uintptr(pid), uintptr(signum), 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procLchown)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Link(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procLink)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, backlog int) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_listen)), 2, uintptr(s), uintptr(backlog), 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lstat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procLstat)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Madvise(b []byte, advice int) (err error) { var _p0 *byte if len(b) > 0 { _p0 = &b[0] } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMadvise)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), uintptr(advice), 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdir(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMkdir)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdirat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMkdirat)), 3, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifo(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMkfifo)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifoat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMkfifoat)), 3, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknod(path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMknod)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMknodat)), 4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlock(b []byte) (err error) { var _p0 *byte if len(b) > 0 { _p0 = &b[0] } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMlock)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlockall(flags int) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMlockall)), 1, uintptr(flags), 0, 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mprotect(b []byte, prot int) (err error) { var _p0 *byte if len(b) > 0 { _p0 = &b[0] } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMprotect)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), uintptr(prot), 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Msync(b []byte, flags int) (err error) { var _p0 *byte if len(b) > 0 { _p0 = &b[0] } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMsync)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), uintptr(flags), 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlock(b []byte) (err error) { var _p0 *byte if len(b) > 0 { _p0 = &b[0] } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMunlock)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlockall() (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMunlockall)), 0, 0, 0, 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procNanosleep)), 2, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Open(path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procOpen)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procOpenat)), 4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mode), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pathconf(path string, name int) (val int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procPathconf)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0, 0, 0, 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pause() (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procPause)), 0, 0, 0, 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 *byte if len(p) > 0 { _p0 = &p[0] } r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procpread)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 *byte if len(p) > 0 { _p0 = &p[0] } r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procpwrite)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func read(fd int, p []byte) (n int, err error) { var _p0 *byte if len(p) > 0 { _p0 = &p[0] } r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procread)), 3, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), 0, 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlink(path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte if len(buf) > 0 { _p1 = &buf[0] } r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procReadlink)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(len(buf)), 0, 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rename(from string, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procRename)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procRenameat)), 4, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rmdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procRmdir)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proclseek)), 3, uintptr(fd), uintptr(offset), uintptr(whence), 0, 0, 0) newoffset = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procSelect)), 5, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setegid(egid int) (err error) { _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetegid)), 1, uintptr(egid), 0, 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seteuid(euid int) (err error) { _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSeteuid)), 1, uintptr(euid), 0, 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setgid(gid int) (err error) { _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetgid)), 1, uintptr(gid), 0, 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sethostname(p []byte) (err error) { var _p0 *byte if len(p) > 0 { _p0 = &p[0] } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procSethostname)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (err error) { _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetpgid)), 2, uintptr(pid), uintptr(pgid), 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpriority(which int, who int, prio int) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procSetpriority)), 3, uintptr(which), uintptr(who), uintptr(prio), 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setregid(rgid int, egid int) (err error) { _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetregid)), 2, uintptr(rgid), uintptr(egid), 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setreuid(ruid int, euid int) (err error) { _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetreuid)), 2, uintptr(ruid), uintptr(euid), 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, err error) { r0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetsid)), 0, 0, 0, 0, 0, 0, 0) pid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setuid(uid int) (err error) { _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetuid)), 1, uintptr(uid), 0, 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(s int, how int) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procshutdown)), 2, uintptr(s), uintptr(how), 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Stat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procStat)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Statvfs(path string, vfsstat *Statvfs_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procStatvfs)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(vfsstat)), 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlink(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procSymlink)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sync() (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procSync)), 0, 0, 0, 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sysconf(which int) (n int64, err error) { r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procSysconf)), 1, uintptr(which), 0, 0, 0, 0, 0) n = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Times(tms *Tms) (ticks uintptr, err error) { r0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procTimes)), 1, uintptr(unsafe.Pointer(tms)), 0, 0, 0, 0, 0) ticks = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procTruncate)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fsync(fd int) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFsync)), 1, uintptr(fd), 0, 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFtruncate)), 2, uintptr(fd), uintptr(length), 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Umask(mask int) (oldmask int) { r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&procUmask)), 1, uintptr(mask), 0, 0, 0, 0, 0) oldmask = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Uname(buf *Utsname) (err error) { _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procUname)), 1, uintptr(unsafe.Pointer(buf)), 0, 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unmount(target string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(target) if err != nil { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procumount)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlink(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procUnlink)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlinkat(dirfd int, path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procUnlinkat)), 3, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ustat(dev int, ubuf *Ustat_t) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procUstat)), 2, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Utime(path string, buf *Utimbuf) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procUtime)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_bind)), 3, uintptr(s), uintptr(addr), uintptr(addrlen), 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_connect)), 3, uintptr(s), uintptr(addr), uintptr(addrlen), 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procmmap)), 6, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos)) ret = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func munmap(addr uintptr, length uintptr) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procmunmap)), 2, uintptr(addr), uintptr(length), 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procsendfile)), 4, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0) written = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { var _p0 *byte if len(buf) > 0 { _p0 = &buf[0] } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_sendto)), 6, uintptr(s), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_socket)), 3, uintptr(domain), uintptr(typ), uintptr(proto), 0, 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&proc__xnet_socketpair)), 4, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func write(fd int, p []byte) (n int, err error) { var _p0 *byte if len(p) > 0 { _p0 = &p[0] } r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procwrite)), 3, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), 0, 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_getsockopt)), 5, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procgetpeername)), 3, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procsetsockopt)), 5, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { var _p0 *byte if len(p) > 0 { _p0 = &p[0] } r0, _, 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 = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeerucred(fd uintptr, ucred *uintptr) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procgetpeerucred)), 2, uintptr(fd), uintptr(unsafe.Pointer(ucred)), 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ucredGet(pid int) (ucred uintptr, err error) { r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procucred_get)), 1, uintptr(pid), 0, 0, 0, 0, 0) ucred = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ucredGeteuid(ucred uintptr) (uid int) { r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&procucred_geteuid)), 1, uintptr(ucred), 0, 0, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ucredGetegid(ucred uintptr) (gid int) { r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&procucred_getegid)), 1, uintptr(ucred), 0, 0, 0, 0, 0) gid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ucredGetruid(ucred uintptr) (uid int) { r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&procucred_getruid)), 1, uintptr(ucred), 0, 0, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ucredGetrgid(ucred uintptr) (gid int) { r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&procucred_getrgid)), 1, uintptr(ucred), 0, 0, 0, 0, 0) gid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ucredGetsuid(ucred uintptr) (uid int) { r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&procucred_getsuid)), 1, uintptr(ucred), 0, 0, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ucredGetsgid(ucred uintptr) (gid int) { r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&procucred_getsgid)), 1, uintptr(ucred), 0, 0, 0, 0, 0) gid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ucredGetpid(ucred uintptr) (pid int) { r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&procucred_getpid)), 1, uintptr(ucred), 0, 0, 0, 0, 0) pid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ucredFree(ucred uintptr) { sysvicall6(uintptr(unsafe.Pointer(&procucred_free)), 1, uintptr(ucred), 0, 0, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func port_create() (n int, err error) { r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procport_create)), 0, 0, 0, 0, 0, 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func port_associate(port int, source int, object uintptr, events int, user *byte) (n int, err error) { r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procport_associate)), 5, uintptr(port), uintptr(source), uintptr(object), uintptr(events), uintptr(unsafe.Pointer(user)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func port_dissociate(port int, source int, object uintptr) (n int, err error) { r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procport_dissociate)), 3, uintptr(port), uintptr(source), uintptr(object), 0, 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func port_get(port int, pe *portEvent, timeout *Timespec) (n int, err error) { r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procport_get)), 3, uintptr(port), uintptr(unsafe.Pointer(pe)), uintptr(unsafe.Pointer(timeout)), 0, 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func port_getn(port int, pe *portEvent, max uint32, nget *uint32, timeout *Timespec) (n int, err error) { r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procport_getn)), 5, uintptr(port), uintptr(unsafe.Pointer(pe)), uintptr(max), uintptr(unsafe.Pointer(nget)), uintptr(unsafe.Pointer(timeout)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func putmsg(fd int, clptr *strbuf, dataptr *strbuf, flags int) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procputmsg)), 4, uintptr(fd), uintptr(unsafe.Pointer(clptr)), uintptr(unsafe.Pointer(dataptr)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getmsg(fd int, clptr *strbuf, dataptr *strbuf, flags *int) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procgetmsg)), 4, uintptr(fd), uintptr(unsafe.Pointer(clptr)), uintptr(unsafe.Pointer(dataptr)), uintptr(unsafe.Pointer(flags)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } ================================================ FILE: vendor/golang.org/x/sys/unix/zsyscall_zos_s390x.go ================================================ // go run mksyscall_zos_s390x.go -o_sysnum zsysnum_zos_s390x.go -o_syscall zsyscall_zos_s390x.go -i_syscall syscall_zos_s390x.go -o_asm zsymaddr_zos_s390x.s // Code generated by the command above; see README.md. DO NOT EDIT. //go:build zos && s390x package unix import ( "runtime" "syscall" "unsafe" ) var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fcntl(fd int, cmd int, arg int) (val int, err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FCNTL<<4, uintptr(fd), uintptr(cmd), uintptr(arg)) runtime.ExitSyscall() val = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_Flistxattr(fd int, dest []byte) (sz int, err error) { var _p0 unsafe.Pointer if len(dest) > 0 { _p0 = unsafe.Pointer(&dest[0]) } else { _p0 = unsafe.Pointer(&_zero) } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___FLISTXATTR_A<<4, uintptr(fd), uintptr(_p0), uintptr(len(dest))) runtime.ExitSyscall() sz = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_FlistxattrAddr() *(func(fd int, dest []byte) (sz int, err error)) var Flistxattr = enter_Flistxattr func enter_Flistxattr(fd int, dest []byte) (sz int, err error) { funcref := get_FlistxattrAddr() if funcptrtest(GetZosLibVec()+SYS___FLISTXATTR_A<<4, "") == 0 { *funcref = impl_Flistxattr } else { *funcref = error_Flistxattr } return (*funcref)(fd, dest) } func error_Flistxattr(fd int, dest []byte) (sz int, err error) { sz = -1 err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_Fremovexattr(fd int, attr string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(attr) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___FREMOVEXATTR_A<<4, uintptr(fd), uintptr(unsafe.Pointer(_p0))) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_FremovexattrAddr() *(func(fd int, attr string) (err error)) var Fremovexattr = enter_Fremovexattr func enter_Fremovexattr(fd int, attr string) (err error) { funcref := get_FremovexattrAddr() if funcptrtest(GetZosLibVec()+SYS___FREMOVEXATTR_A<<4, "") == 0 { *funcref = impl_Fremovexattr } else { *funcref = error_Fremovexattr } return (*funcref)(fd, attr) } func error_Fremovexattr(fd int, attr string) (err error) { err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func read(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_READ<<4, uintptr(fd), uintptr(_p0), uintptr(len(p))) runtime.ExitSyscall() n = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func write(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_WRITE<<4, uintptr(fd), uintptr(_p0), uintptr(len(p))) runtime.ExitSyscall() n = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) { var _p0 *byte _p0, err = BytePtrFromString(attr) if err != nil { return } var _p1 unsafe.Pointer if len(dest) > 0 { _p1 = unsafe.Pointer(&dest[0]) } else { _p1 = unsafe.Pointer(&_zero) } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___FGETXATTR_A<<4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest))) runtime.ExitSyscall() sz = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_FgetxattrAddr() *(func(fd int, attr string, dest []byte) (sz int, err error)) var Fgetxattr = enter_Fgetxattr func enter_Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) { funcref := get_FgetxattrAddr() if funcptrtest(GetZosLibVec()+SYS___FGETXATTR_A<<4, "") == 0 { *funcref = impl_Fgetxattr } else { *funcref = error_Fgetxattr } return (*funcref)(fd, attr, dest) } func error_Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) { sz = -1 err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_Fsetxattr(fd int, attr string, data []byte, flag int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(attr) if err != nil { return } var _p1 unsafe.Pointer if len(data) > 0 { _p1 = unsafe.Pointer(&data[0]) } else { _p1 = unsafe.Pointer(&_zero) } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___FSETXATTR_A<<4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(data)), uintptr(flag)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_FsetxattrAddr() *(func(fd int, attr string, data []byte, flag int) (err error)) var Fsetxattr = enter_Fsetxattr func enter_Fsetxattr(fd int, attr string, data []byte, flag int) (err error) { funcref := get_FsetxattrAddr() if funcptrtest(GetZosLibVec()+SYS___FSETXATTR_A<<4, "") == 0 { *funcref = impl_Fsetxattr } else { *funcref = error_Fsetxattr } return (*funcref)(fd, attr, data, flag) } func error_Fsetxattr(fd int, attr string, data []byte, flag int) (err error) { err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___ACCEPT_A<<4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) runtime.ExitSyscall() fd = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___ACCEPT4_A<<4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags)) runtime.ExitSyscall() fd = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_accept4Addr() *(func(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error)) var accept4 = enter_accept4 func enter_accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) { funcref := get_accept4Addr() if funcptrtest(GetZosLibVec()+SYS___ACCEPT4_A<<4, "") == 0 { *funcref = impl_accept4 } else { *funcref = error_accept4 } return (*funcref)(s, rsa, addrlen, flags) } func error_accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) { fd = -1 err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___BIND_A<<4, uintptr(s), uintptr(addr), uintptr(addrlen)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___CONNECT_A<<4, uintptr(s), uintptr(addr), uintptr(addrlen)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(n int, list *_Gid_t) (nn int, err error) { r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_GETGROUPS<<4, uintptr(n), uintptr(unsafe.Pointer(list))) nn = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(n int, list *_Gid_t) (err error) { r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SETGROUPS<<4, uintptr(n), uintptr(unsafe.Pointer(list))) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_GETSOCKOPT<<4, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen))) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SETSOCKOPT<<4, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SOCKET<<4, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SOCKETPAIR<<4, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd))) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___GETPEERNAME_A<<4, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___GETSOCKNAME_A<<4, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_Removexattr(path string, attr string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___REMOVEXATTR_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1))) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_RemovexattrAddr() *(func(path string, attr string) (err error)) var Removexattr = enter_Removexattr func enter_Removexattr(path string, attr string) (err error) { funcref := get_RemovexattrAddr() if funcptrtest(GetZosLibVec()+SYS___REMOVEXATTR_A<<4, "") == 0 { *funcref = impl_Removexattr } else { *funcref = error_Removexattr } return (*funcref)(path, attr) } func error_Removexattr(path string, attr string) (err error) { err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___RECVFROM_A<<4, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) runtime.ExitSyscall() n = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___SENDTO_A<<4, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___RECVMSG_A<<4, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) runtime.ExitSyscall() n = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___SENDMSG_A<<4, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) runtime.ExitSyscall() n = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_MMAP<<4, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos)) runtime.ExitSyscall() ret = uintptr(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func munmap(addr uintptr, length uintptr) (err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_MUNMAP<<4, uintptr(addr), uintptr(length)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctl(fd int, req int, arg uintptr) (err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_IOCTL<<4, uintptr(fd), uintptr(req), uintptr(arg)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctlPtr(fd int, req int, arg unsafe.Pointer) (err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_IOCTL<<4, uintptr(fd), uintptr(req), uintptr(arg)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func shmat(id int, addr uintptr, flag int) (ret uintptr, err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SHMAT<<4, uintptr(id), uintptr(addr), uintptr(flag)) runtime.ExitSyscall() ret = uintptr(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func shmctl(id int, cmd int, buf *SysvShmDesc) (result int, err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SHMCTL64<<4, uintptr(id), uintptr(cmd), uintptr(unsafe.Pointer(buf))) runtime.ExitSyscall() result = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func shmdt(addr uintptr) (err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SHMDT<<4, uintptr(addr)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func shmget(key int, size int, flag int) (id int, err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SHMGET<<4, uintptr(key), uintptr(size), uintptr(flag)) runtime.ExitSyscall() id = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Access(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___ACCESS_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(mode)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___CHDIR_A<<4, uintptr(unsafe.Pointer(_p0))) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___CHOWN_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chmod(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___CHMOD_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(mode)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Creat(path string, mode uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___CREAT_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(mode)) runtime.ExitSyscall() fd = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(oldfd int) (fd int, err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_DUP<<4, uintptr(oldfd)) runtime.ExitSyscall() fd = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup2(oldfd int, newfd int) (err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_DUP2<<4, uintptr(oldfd), uintptr(newfd)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_Dup3(oldfd int, newfd int, flags int) (err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_DUP3<<4, uintptr(oldfd), uintptr(newfd), uintptr(flags)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_Dup3Addr() *(func(oldfd int, newfd int, flags int) (err error)) var Dup3 = enter_Dup3 func enter_Dup3(oldfd int, newfd int, flags int) (err error) { funcref := get_Dup3Addr() if funcptrtest(GetZosLibVec()+SYS_DUP3<<4, "") == 0 { *funcref = impl_Dup3 } else { *funcref = error_Dup3 } return (*funcref)(oldfd, newfd, flags) } func error_Dup3(oldfd int, newfd int, flags int) (err error) { err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_Dirfd(dirp uintptr) (fd int, err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_DIRFD<<4, uintptr(dirp)) runtime.ExitSyscall() fd = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_DirfdAddr() *(func(dirp uintptr) (fd int, err error)) var Dirfd = enter_Dirfd func enter_Dirfd(dirp uintptr) (fd int, err error) { funcref := get_DirfdAddr() if funcptrtest(GetZosLibVec()+SYS_DIRFD<<4, "") == 0 { *funcref = impl_Dirfd } else { *funcref = error_Dirfd } return (*funcref)(dirp) } func error_Dirfd(dirp uintptr) (fd int, err error) { fd = -1 err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_EpollCreate(size int) (fd int, err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_EPOLL_CREATE<<4, uintptr(size)) runtime.ExitSyscall() fd = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_EpollCreateAddr() *(func(size int) (fd int, err error)) var EpollCreate = enter_EpollCreate func enter_EpollCreate(size int) (fd int, err error) { funcref := get_EpollCreateAddr() if funcptrtest(GetZosLibVec()+SYS_EPOLL_CREATE<<4, "") == 0 { *funcref = impl_EpollCreate } else { *funcref = error_EpollCreate } return (*funcref)(size) } func error_EpollCreate(size int) (fd int, err error) { fd = -1 err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_EpollCreate1(flags int) (fd int, err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_EPOLL_CREATE1<<4, uintptr(flags)) runtime.ExitSyscall() fd = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_EpollCreate1Addr() *(func(flags int) (fd int, err error)) var EpollCreate1 = enter_EpollCreate1 func enter_EpollCreate1(flags int) (fd int, err error) { funcref := get_EpollCreate1Addr() if funcptrtest(GetZosLibVec()+SYS_EPOLL_CREATE1<<4, "") == 0 { *funcref = impl_EpollCreate1 } else { *funcref = error_EpollCreate1 } return (*funcref)(flags) } func error_EpollCreate1(flags int) (fd int, err error) { fd = -1 err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_EPOLL_CTL<<4, uintptr(epfd), uintptr(op), uintptr(fd), uintptr(unsafe.Pointer(event))) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_EpollCtlAddr() *(func(epfd int, op int, fd int, event *EpollEvent) (err error)) var EpollCtl = enter_EpollCtl func enter_EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) { funcref := get_EpollCtlAddr() if funcptrtest(GetZosLibVec()+SYS_EPOLL_CTL<<4, "") == 0 { *funcref = impl_EpollCtl } else { *funcref = error_EpollCtl } return (*funcref)(epfd, op, fd, event) } func error_EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) { err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_EpollPwait(epfd int, events []EpollEvent, msec int, sigmask *int) (n int, err error) { var _p0 unsafe.Pointer if len(events) > 0 { _p0 = unsafe.Pointer(&events[0]) } else { _p0 = unsafe.Pointer(&_zero) } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_EPOLL_PWAIT<<4, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), uintptr(unsafe.Pointer(sigmask))) runtime.ExitSyscall() n = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_EpollPwaitAddr() *(func(epfd int, events []EpollEvent, msec int, sigmask *int) (n int, err error)) var EpollPwait = enter_EpollPwait func enter_EpollPwait(epfd int, events []EpollEvent, msec int, sigmask *int) (n int, err error) { funcref := get_EpollPwaitAddr() if funcptrtest(GetZosLibVec()+SYS_EPOLL_PWAIT<<4, "") == 0 { *funcref = impl_EpollPwait } else { *funcref = error_EpollPwait } return (*funcref)(epfd, events, msec, sigmask) } func error_EpollPwait(epfd int, events []EpollEvent, msec int, sigmask *int) (n int, err error) { n = -1 err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { var _p0 unsafe.Pointer if len(events) > 0 { _p0 = unsafe.Pointer(&events[0]) } else { _p0 = unsafe.Pointer(&_zero) } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_EPOLL_WAIT<<4, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec)) runtime.ExitSyscall() n = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_EpollWaitAddr() *(func(epfd int, events []EpollEvent, msec int) (n int, err error)) var EpollWait = enter_EpollWait func enter_EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { funcref := get_EpollWaitAddr() if funcptrtest(GetZosLibVec()+SYS_EPOLL_WAIT<<4, "") == 0 { *funcref = impl_EpollWait } else { *funcref = error_EpollWait } return (*funcref)(epfd, events, msec) } func error_EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { n = -1 err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Errno2() (er2 int) { runtime.EnterSyscall() r0, _, _ := CallLeFuncWithErr(GetZosLibVec() + SYS___ERRNO2<<4) runtime.ExitSyscall() er2 = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_Eventfd(initval uint, flags int) (fd int, err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_EVENTFD<<4, uintptr(initval), uintptr(flags)) runtime.ExitSyscall() fd = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_EventfdAddr() *(func(initval uint, flags int) (fd int, err error)) var Eventfd = enter_Eventfd func enter_Eventfd(initval uint, flags int) (fd int, err error) { funcref := get_EventfdAddr() if funcptrtest(GetZosLibVec()+SYS_EVENTFD<<4, "") == 0 { *funcref = impl_Eventfd } else { *funcref = error_Eventfd } return (*funcref)(initval, flags) } func error_Eventfd(initval uint, flags int) (fd int, err error) { fd = -1 err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Exit(code int) { runtime.EnterSyscall() CallLeFuncWithErr(GetZosLibVec()+SYS_EXIT<<4, uintptr(code)) runtime.ExitSyscall() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___FACCESSAT_A<<4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_FaccessatAddr() *(func(dirfd int, path string, mode uint32, flags int) (err error)) var Faccessat = enter_Faccessat func enter_Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { funcref := get_FaccessatAddr() if funcptrtest(GetZosLibVec()+SYS___FACCESSAT_A<<4, "") == 0 { *funcref = impl_Faccessat } else { *funcref = error_Faccessat } return (*funcref)(dirfd, path, mode, flags) } func error_Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchdir(fd int) (err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FCHDIR<<4, uintptr(fd)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmod(fd int, mode uint32) (err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FCHMOD<<4, uintptr(fd), uintptr(mode)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___FCHMODAT_A<<4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_FchmodatAddr() *(func(dirfd int, path string, mode uint32, flags int) (err error)) var Fchmodat = enter_Fchmodat func enter_Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { funcref := get_FchmodatAddr() if funcptrtest(GetZosLibVec()+SYS___FCHMODAT_A<<4, "") == 0 { *funcref = impl_Fchmodat } else { *funcref = error_Fchmodat } return (*funcref)(dirfd, path, mode, flags) } func error_Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FCHOWN<<4, uintptr(fd), uintptr(uid), uintptr(gid)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_Fchownat(fd int, path string, uid int, gid int, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___FCHOWNAT_A<<4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_FchownatAddr() *(func(fd int, path string, uid int, gid int, flags int) (err error)) var Fchownat = enter_Fchownat func enter_Fchownat(fd int, path string, uid int, gid int, flags int) (err error) { funcref := get_FchownatAddr() if funcptrtest(GetZosLibVec()+SYS___FCHOWNAT_A<<4, "") == 0 { *funcref = impl_Fchownat } else { *funcref = error_Fchownat } return (*funcref)(fd, path, uid, gid, flags) } func error_Fchownat(fd int, path string, uid int, gid int, flags int) (err error) { err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func FcntlInt(fd uintptr, cmd int, arg int) (retval int, err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FCNTL<<4, uintptr(fd), uintptr(cmd), uintptr(arg)) runtime.ExitSyscall() retval = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_Fdatasync(fd int) (err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FDATASYNC<<4, uintptr(fd)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_FdatasyncAddr() *(func(fd int) (err error)) var Fdatasync = enter_Fdatasync func enter_Fdatasync(fd int) (err error) { funcref := get_FdatasyncAddr() if funcptrtest(GetZosLibVec()+SYS_FDATASYNC<<4, "") == 0 { *funcref = impl_Fdatasync } else { *funcref = error_Fdatasync } return (*funcref)(fd) } func error_Fdatasync(fd int) (err error) { err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fstat(fd int, stat *Stat_LE_t) (err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FSTAT<<4, uintptr(fd), uintptr(unsafe.Pointer(stat))) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_fstatat(dirfd int, path string, stat *Stat_LE_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___FSTATAT_A<<4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_fstatatAddr() *(func(dirfd int, path string, stat *Stat_LE_t, flags int) (err error)) var fstatat = enter_fstatat func enter_fstatat(dirfd int, path string, stat *Stat_LE_t, flags int) (err error) { funcref := get_fstatatAddr() if funcptrtest(GetZosLibVec()+SYS___FSTATAT_A<<4, "") == 0 { *funcref = impl_fstatat } else { *funcref = error_fstatat } return (*funcref)(dirfd, path, stat, flags) } func error_fstatat(dirfd int, path string, stat *Stat_LE_t, flags int) (err error) { err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_Lgetxattr(link string, attr string, dest []byte) (sz int, err error) { var _p0 *byte _p0, err = BytePtrFromString(link) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } var _p2 unsafe.Pointer if len(dest) > 0 { _p2 = unsafe.Pointer(&dest[0]) } else { _p2 = unsafe.Pointer(&_zero) } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___LGETXATTR_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest))) runtime.ExitSyscall() sz = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_LgetxattrAddr() *(func(link string, attr string, dest []byte) (sz int, err error)) var Lgetxattr = enter_Lgetxattr func enter_Lgetxattr(link string, attr string, dest []byte) (sz int, err error) { funcref := get_LgetxattrAddr() if funcptrtest(GetZosLibVec()+SYS___LGETXATTR_A<<4, "") == 0 { *funcref = impl_Lgetxattr } else { *funcref = error_Lgetxattr } return (*funcref)(link, attr, dest) } func error_Lgetxattr(link string, attr string, dest []byte) (sz int, err error) { sz = -1 err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_Lsetxattr(path string, attr string, data []byte, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } var _p2 unsafe.Pointer if len(data) > 0 { _p2 = unsafe.Pointer(&data[0]) } else { _p2 = unsafe.Pointer(&_zero) } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___LSETXATTR_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_LsetxattrAddr() *(func(path string, attr string, data []byte, flags int) (err error)) var Lsetxattr = enter_Lsetxattr func enter_Lsetxattr(path string, attr string, data []byte, flags int) (err error) { funcref := get_LsetxattrAddr() if funcptrtest(GetZosLibVec()+SYS___LSETXATTR_A<<4, "") == 0 { *funcref = impl_Lsetxattr } else { *funcref = error_Lsetxattr } return (*funcref)(path, attr, data, flags) } func error_Lsetxattr(path string, attr string, data []byte, flags int) (err error) { err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_Fstatfs(fd int, buf *Statfs_t) (err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FSTATFS<<4, uintptr(fd), uintptr(unsafe.Pointer(buf))) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_FstatfsAddr() *(func(fd int, buf *Statfs_t) (err error)) var Fstatfs = enter_Fstatfs func enter_Fstatfs(fd int, buf *Statfs_t) (err error) { funcref := get_FstatfsAddr() if funcptrtest(GetZosLibVec()+SYS_FSTATFS<<4, "") == 0 { *funcref = impl_Fstatfs } else { *funcref = error_Fstatfs } return (*funcref)(fd, buf) } func error_Fstatfs(fd int, buf *Statfs_t) (err error) { err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatvfs(fd int, stat *Statvfs_t) (err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FSTATVFS<<4, uintptr(fd), uintptr(unsafe.Pointer(stat))) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fsync(fd int) (err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FSYNC<<4, uintptr(fd)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_Futimes(fd int, tv []Timeval) (err error) { var _p0 unsafe.Pointer if len(tv) > 0 { _p0 = unsafe.Pointer(&tv[0]) } else { _p0 = unsafe.Pointer(&_zero) } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FUTIMES<<4, uintptr(fd), uintptr(_p0), uintptr(len(tv))) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_FutimesAddr() *(func(fd int, tv []Timeval) (err error)) var Futimes = enter_Futimes func enter_Futimes(fd int, tv []Timeval) (err error) { funcref := get_FutimesAddr() if funcptrtest(GetZosLibVec()+SYS_FUTIMES<<4, "") == 0 { *funcref = impl_Futimes } else { *funcref = error_Futimes } return (*funcref)(fd, tv) } func error_Futimes(fd int, tv []Timeval) (err error) { err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_Futimesat(dirfd int, path string, tv []Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(tv) > 0 { _p1 = unsafe.Pointer(&tv[0]) } else { _p1 = unsafe.Pointer(&_zero) } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___FUTIMESAT_A<<4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(tv))) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_FutimesatAddr() *(func(dirfd int, path string, tv []Timeval) (err error)) var Futimesat = enter_Futimesat func enter_Futimesat(dirfd int, path string, tv []Timeval) (err error) { funcref := get_FutimesatAddr() if funcptrtest(GetZosLibVec()+SYS___FUTIMESAT_A<<4, "") == 0 { *funcref = impl_Futimesat } else { *funcref = error_Futimesat } return (*funcref)(dirfd, path, tv) } func error_Futimesat(dirfd int, path string, tv []Timeval) (err error) { err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FTRUNCATE<<4, uintptr(fd), uintptr(length)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_Getrandom(buf []byte, flags int) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_GETRANDOM<<4, uintptr(_p0), uintptr(len(buf)), uintptr(flags)) runtime.ExitSyscall() n = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_GetrandomAddr() *(func(buf []byte, flags int) (n int, err error)) var Getrandom = enter_Getrandom func enter_Getrandom(buf []byte, flags int) (n int, err error) { funcref := get_GetrandomAddr() if funcptrtest(GetZosLibVec()+SYS_GETRANDOM<<4, "") == 0 { *funcref = impl_Getrandom } else { *funcref = error_Getrandom } return (*funcref)(buf, flags) } func error_Getrandom(buf []byte, flags int) (n int, err error) { n = -1 err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_InotifyInit() (fd int, err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec() + SYS_INOTIFY_INIT<<4) runtime.ExitSyscall() fd = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_InotifyInitAddr() *(func() (fd int, err error)) var InotifyInit = enter_InotifyInit func enter_InotifyInit() (fd int, err error) { funcref := get_InotifyInitAddr() if funcptrtest(GetZosLibVec()+SYS_INOTIFY_INIT<<4, "") == 0 { *funcref = impl_InotifyInit } else { *funcref = error_InotifyInit } return (*funcref)() } func error_InotifyInit() (fd int, err error) { fd = -1 err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_InotifyInit1(flags int) (fd int, err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_INOTIFY_INIT1<<4, uintptr(flags)) runtime.ExitSyscall() fd = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_InotifyInit1Addr() *(func(flags int) (fd int, err error)) var InotifyInit1 = enter_InotifyInit1 func enter_InotifyInit1(flags int) (fd int, err error) { funcref := get_InotifyInit1Addr() if funcptrtest(GetZosLibVec()+SYS_INOTIFY_INIT1<<4, "") == 0 { *funcref = impl_InotifyInit1 } else { *funcref = error_InotifyInit1 } return (*funcref)(flags) } func error_InotifyInit1(flags int) (fd int, err error) { fd = -1 err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) { var _p0 *byte _p0, err = BytePtrFromString(pathname) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___INOTIFY_ADD_WATCH_A<<4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mask)) runtime.ExitSyscall() watchdesc = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_InotifyAddWatchAddr() *(func(fd int, pathname string, mask uint32) (watchdesc int, err error)) var InotifyAddWatch = enter_InotifyAddWatch func enter_InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) { funcref := get_InotifyAddWatchAddr() if funcptrtest(GetZosLibVec()+SYS___INOTIFY_ADD_WATCH_A<<4, "") == 0 { *funcref = impl_InotifyAddWatch } else { *funcref = error_InotifyAddWatch } return (*funcref)(fd, pathname, mask) } func error_InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) { watchdesc = -1 err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_INOTIFY_RM_WATCH<<4, uintptr(fd), uintptr(watchdesc)) runtime.ExitSyscall() success = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_InotifyRmWatchAddr() *(func(fd int, watchdesc uint32) (success int, err error)) var InotifyRmWatch = enter_InotifyRmWatch func enter_InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) { funcref := get_InotifyRmWatchAddr() if funcptrtest(GetZosLibVec()+SYS_INOTIFY_RM_WATCH<<4, "") == 0 { *funcref = impl_InotifyRmWatch } else { *funcref = error_InotifyRmWatch } return (*funcref)(fd, watchdesc) } func error_InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) { success = -1 err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_Listxattr(path string, dest []byte) (sz int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(dest) > 0 { _p1 = unsafe.Pointer(&dest[0]) } else { _p1 = unsafe.Pointer(&_zero) } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___LISTXATTR_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest))) runtime.ExitSyscall() sz = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_ListxattrAddr() *(func(path string, dest []byte) (sz int, err error)) var Listxattr = enter_Listxattr func enter_Listxattr(path string, dest []byte) (sz int, err error) { funcref := get_ListxattrAddr() if funcptrtest(GetZosLibVec()+SYS___LISTXATTR_A<<4, "") == 0 { *funcref = impl_Listxattr } else { *funcref = error_Listxattr } return (*funcref)(path, dest) } func error_Listxattr(path string, dest []byte) (sz int, err error) { sz = -1 err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_Llistxattr(path string, dest []byte) (sz int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(dest) > 0 { _p1 = unsafe.Pointer(&dest[0]) } else { _p1 = unsafe.Pointer(&_zero) } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___LLISTXATTR_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest))) runtime.ExitSyscall() sz = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_LlistxattrAddr() *(func(path string, dest []byte) (sz int, err error)) var Llistxattr = enter_Llistxattr func enter_Llistxattr(path string, dest []byte) (sz int, err error) { funcref := get_LlistxattrAddr() if funcptrtest(GetZosLibVec()+SYS___LLISTXATTR_A<<4, "") == 0 { *funcref = impl_Llistxattr } else { *funcref = error_Llistxattr } return (*funcref)(path, dest) } func error_Llistxattr(path string, dest []byte) (sz int, err error) { sz = -1 err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_Lremovexattr(path string, attr string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___LREMOVEXATTR_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1))) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_LremovexattrAddr() *(func(path string, attr string) (err error)) var Lremovexattr = enter_Lremovexattr func enter_Lremovexattr(path string, attr string) (err error) { funcref := get_LremovexattrAddr() if funcptrtest(GetZosLibVec()+SYS___LREMOVEXATTR_A<<4, "") == 0 { *funcref = impl_Lremovexattr } else { *funcref = error_Lremovexattr } return (*funcref)(path, attr) } func error_Lremovexattr(path string, attr string) (err error) { err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_Lutimes(path string, tv []Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(tv) > 0 { _p1 = unsafe.Pointer(&tv[0]) } else { _p1 = unsafe.Pointer(&_zero) } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___LUTIMES_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(tv))) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_LutimesAddr() *(func(path string, tv []Timeval) (err error)) var Lutimes = enter_Lutimes func enter_Lutimes(path string, tv []Timeval) (err error) { funcref := get_LutimesAddr() if funcptrtest(GetZosLibVec()+SYS___LUTIMES_A<<4, "") == 0 { *funcref = impl_Lutimes } else { *funcref = error_Lutimes } return (*funcref)(path, tv) } func error_Lutimes(path string, tv []Timeval) (err error) { err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mprotect(b []byte, prot int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_MPROTECT<<4, uintptr(_p0), uintptr(len(b)), uintptr(prot)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Msync(b []byte, flags int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_MSYNC<<4, uintptr(_p0), uintptr(len(b)), uintptr(flags)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Console2(cmsg *ConsMsg2, modstr *byte, concmd *uint32) (err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___CONSOLE2<<4, uintptr(unsafe.Pointer(cmsg)), uintptr(unsafe.Pointer(modstr)), uintptr(unsafe.Pointer(concmd))) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Poll(fds []PollFd, timeout int) (n int, err error) { var _p0 unsafe.Pointer if len(fds) > 0 { _p0 = unsafe.Pointer(&fds[0]) } else { _p0 = unsafe.Pointer(&_zero) } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_POLL<<4, uintptr(_p0), uintptr(len(fds)), uintptr(timeout)) runtime.ExitSyscall() n = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readdir_r(dirp uintptr, entry *direntLE, result **direntLE) (err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___READDIR_R_A<<4, uintptr(dirp), uintptr(unsafe.Pointer(entry)), uintptr(unsafe.Pointer(result))) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_Statfs(path string, buf *Statfs_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___STATFS_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf))) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_StatfsAddr() *(func(path string, buf *Statfs_t) (err error)) var Statfs = enter_Statfs func enter_Statfs(path string, buf *Statfs_t) (err error) { funcref := get_StatfsAddr() if funcptrtest(GetZosLibVec()+SYS___STATFS_A<<4, "") == 0 { *funcref = impl_Statfs } else { *funcref = error_Statfs } return (*funcref)(path, buf) } func error_Statfs(path string, buf *Statfs_t) (err error) { err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_Syncfs(fd int) (err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SYNCFS<<4, uintptr(fd)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_SyncfsAddr() *(func(fd int) (err error)) var Syncfs = enter_Syncfs func enter_Syncfs(fd int) (err error) { funcref := get_SyncfsAddr() if funcptrtest(GetZosLibVec()+SYS_SYNCFS<<4, "") == 0 { *funcref = impl_Syncfs } else { *funcref = error_Syncfs } return (*funcref)(fd) } func error_Syncfs(fd int) (err error) { err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Times(tms *Tms) (ticks uintptr, err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_TIMES<<4, uintptr(unsafe.Pointer(tms))) runtime.ExitSyscall() ticks = uintptr(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func W_Getmntent(buff *byte, size int) (lastsys int, err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_W_GETMNTENT<<4, uintptr(unsafe.Pointer(buff)), uintptr(size)) runtime.ExitSyscall() lastsys = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func W_Getmntent_A(buff *byte, size int) (lastsys int, err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___W_GETMNTENT_A<<4, uintptr(unsafe.Pointer(buff)), uintptr(size)) runtime.ExitSyscall() lastsys = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mount_LE(path string, filesystem string, fstype string, mtm uint32, parmlen int32, parm string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(filesystem) if err != nil { return } var _p2 *byte _p2, err = BytePtrFromString(fstype) if err != nil { return } var _p3 *byte _p3, err = BytePtrFromString(parm) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___MOUNT_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(mtm), uintptr(parmlen), uintptr(unsafe.Pointer(_p3))) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func unmount_LE(filesystem string, mtm int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(filesystem) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___UMOUNT_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(mtm)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chroot(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___CHROOT_A<<4, uintptr(unsafe.Pointer(_p0))) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Select(nmsgsfds int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (ret int, err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SELECT<<4, uintptr(nmsgsfds), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout))) runtime.ExitSyscall() ret = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Uname(buf *Utsname) (err error) { r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_____OSNAME_A<<4, uintptr(unsafe.Pointer(buf))) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_Unshare(flags int) (err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_UNSHARE<<4, uintptr(flags)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_UnshareAddr() *(func(flags int) (err error)) var Unshare = enter_Unshare func enter_Unshare(flags int) (err error) { funcref := get_UnshareAddr() if funcptrtest(GetZosLibVec()+SYS_UNSHARE<<4, "") == 0 { *funcref = impl_Unshare } else { *funcref = error_Unshare } return (*funcref)(flags) } func error_Unshare(flags int) (err error) { err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gethostname(buf []byte) (err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___GETHOSTNAME_A<<4, uintptr(_p0), uintptr(len(buf))) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _, _ := CallLeFuncWithErr(GetZosLibVec() + SYS_GETGID<<4) gid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpid() (pid int) { r0, _, _ := CallLeFuncWithErr(GetZosLibVec() + SYS_GETPID<<4) pid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgid(pid int) (pgid int, err error) { r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_GETPGID<<4, uintptr(pid)) pgid = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getppid() (pid int) { r0, _, _ := CallLeFuncWithErr(GetZosLibVec() + SYS_GETPPID<<4) pid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpriority(which int, who int) (prio int, err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_GETPRIORITY<<4, uintptr(which), uintptr(who)) runtime.ExitSyscall() prio = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(resource int, rlim *Rlimit) (err error) { r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_GETRLIMIT<<4, uintptr(resource), uintptr(unsafe.Pointer(rlim))) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getrusage(who int, rusage *rusage_zos) (err error) { r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_GETRUSAGE<<4, uintptr(who), uintptr(unsafe.Pointer(rusage))) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { runtime.EnterSyscall() r0, _, _ := CallLeFuncWithErr(GetZosLibVec() + SYS_GETEGID<<4) runtime.ExitSyscall() egid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (euid int) { runtime.EnterSyscall() r0, _, _ := CallLeFuncWithErr(GetZosLibVec() + SYS_GETEUID<<4) runtime.ExitSyscall() euid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getsid(pid int) (sid int, err error) { r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_GETSID<<4, uintptr(pid)) sid = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _, _ := CallLeFuncWithErr(GetZosLibVec() + SYS_GETUID<<4) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kill(pid int, sig Signal) (err error) { r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_KILL<<4, uintptr(pid), uintptr(sig)) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___LCHOWN_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Link(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___LINK_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1))) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_Linkat(oldDirFd int, oldPath string, newDirFd int, newPath string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldPath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newPath) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___LINKAT_A<<4, uintptr(oldDirFd), uintptr(unsafe.Pointer(_p0)), uintptr(newDirFd), uintptr(unsafe.Pointer(_p1)), uintptr(flags)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_LinkatAddr() *(func(oldDirFd int, oldPath string, newDirFd int, newPath string, flags int) (err error)) var Linkat = enter_Linkat func enter_Linkat(oldDirFd int, oldPath string, newDirFd int, newPath string, flags int) (err error) { funcref := get_LinkatAddr() if funcptrtest(GetZosLibVec()+SYS___LINKAT_A<<4, "") == 0 { *funcref = impl_Linkat } else { *funcref = error_Linkat } return (*funcref)(oldDirFd, oldPath, newDirFd, newPath, flags) } func error_Linkat(oldDirFd int, oldPath string, newDirFd int, newPath string, flags int) (err error) { err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, n int) (err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_LISTEN<<4, uintptr(s), uintptr(n)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func lstat(path string, stat *Stat_LE_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___LSTAT_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat))) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdir(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___MKDIR_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(mode)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_Mkdirat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___MKDIRAT_A<<4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_MkdiratAddr() *(func(dirfd int, path string, mode uint32) (err error)) var Mkdirat = enter_Mkdirat func enter_Mkdirat(dirfd int, path string, mode uint32) (err error) { funcref := get_MkdiratAddr() if funcptrtest(GetZosLibVec()+SYS___MKDIRAT_A<<4, "") == 0 { *funcref = impl_Mkdirat } else { *funcref = error_Mkdirat } return (*funcref)(dirfd, path, mode) } func error_Mkdirat(dirfd int, path string, mode uint32) (err error) { err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifo(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___MKFIFO_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(mode)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknod(path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___MKNOD_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___MKNODAT_A<<4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_MknodatAddr() *(func(dirfd int, path string, mode uint32, dev int) (err error)) var Mknodat = enter_Mknodat func enter_Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { funcref := get_MknodatAddr() if funcptrtest(GetZosLibVec()+SYS___MKNODAT_A<<4, "") == 0 { *funcref = impl_Mknodat } else { *funcref = error_Mknodat } return (*funcref)(dirfd, path, mode, dev) } func error_Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_PivotRoot(newroot string, oldroot string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(newroot) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(oldroot) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___PIVOT_ROOT_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1))) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_PivotRootAddr() *(func(newroot string, oldroot string) (err error)) var PivotRoot = enter_PivotRoot func enter_PivotRoot(newroot string, oldroot string) (err error) { funcref := get_PivotRootAddr() if funcptrtest(GetZosLibVec()+SYS___PIVOT_ROOT_A<<4, "") == 0 { *funcref = impl_PivotRoot } else { *funcref = error_PivotRoot } return (*funcref)(newroot, oldroot) } func error_PivotRoot(newroot string, oldroot string) (err error) { err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_PREAD<<4, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset)) runtime.ExitSyscall() n = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_PWRITE<<4, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset)) runtime.ExitSyscall() n = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___PRCTL_A<<4, uintptr(option), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_PrctlAddr() *(func(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error)) var Prctl = enter_Prctl func enter_Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error) { funcref := get_PrctlAddr() if funcptrtest(GetZosLibVec()+SYS___PRCTL_A<<4, "") == 0 { *funcref = impl_Prctl } else { *funcref = error_Prctl } return (*funcref)(option, arg2, arg3, arg4, arg5) } func error_Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error) { err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_Prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) { r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_PRLIMIT<<4, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(newlimit)), uintptr(unsafe.Pointer(old))) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_PrlimitAddr() *(func(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error)) var Prlimit = enter_Prlimit func enter_Prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) { funcref := get_PrlimitAddr() if funcptrtest(GetZosLibVec()+SYS_PRLIMIT<<4, "") == 0 { *funcref = impl_Prlimit } else { *funcref = error_Prlimit } return (*funcref)(pid, resource, newlimit, old) } func error_Prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) { err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rename(from string, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___RENAME_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1))) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___RENAMEAT_A<<4, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_RenameatAddr() *(func(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)) var Renameat = enter_Renameat func enter_Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) { funcref := get_RenameatAddr() if funcptrtest(GetZosLibVec()+SYS___RENAMEAT_A<<4, "") == 0 { *funcref = impl_Renameat } else { *funcref = error_Renameat } return (*funcref)(olddirfd, oldpath, newdirfd, newpath) } func error_Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) { err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___RENAMEAT2_A<<4, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_Renameat2Addr() *(func(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error)) var Renameat2 = enter_Renameat2 func enter_Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error) { funcref := get_Renameat2Addr() if funcptrtest(GetZosLibVec()+SYS___RENAMEAT2_A<<4, "") == 0 { *funcref = impl_Renameat2 } else { *funcref = error_Renameat2 } return (*funcref)(olddirfd, oldpath, newdirfd, newpath, flags) } func error_Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error) { err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rmdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___RMDIR_A<<4, uintptr(unsafe.Pointer(_p0))) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seek(fd int, offset int64, whence int) (off int64, err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_LSEEK<<4, uintptr(fd), uintptr(offset), uintptr(whence)) runtime.ExitSyscall() off = int64(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setegid(egid int) (err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SETEGID<<4, uintptr(egid)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seteuid(euid int) (err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SETEUID<<4, uintptr(euid)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_Sethostname(p []byte) (err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___SETHOSTNAME_A<<4, uintptr(_p0), uintptr(len(p))) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_SethostnameAddr() *(func(p []byte) (err error)) var Sethostname = enter_Sethostname func enter_Sethostname(p []byte) (err error) { funcref := get_SethostnameAddr() if funcptrtest(GetZosLibVec()+SYS___SETHOSTNAME_A<<4, "") == 0 { *funcref = impl_Sethostname } else { *funcref = error_Sethostname } return (*funcref)(p) } func error_Sethostname(p []byte) (err error) { err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_Setns(fd int, nstype int) (err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SETNS<<4, uintptr(fd), uintptr(nstype)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_SetnsAddr() *(func(fd int, nstype int) (err error)) var Setns = enter_Setns func enter_Setns(fd int, nstype int) (err error) { funcref := get_SetnsAddr() if funcptrtest(GetZosLibVec()+SYS_SETNS<<4, "") == 0 { *funcref = impl_Setns } else { *funcref = error_Setns } return (*funcref)(fd, nstype) } func error_Setns(fd int, nstype int) (err error) { err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpriority(which int, who int, prio int) (err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SETPRIORITY<<4, uintptr(which), uintptr(who), uintptr(prio)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (err error) { r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SETPGID<<4, uintptr(pid), uintptr(pgid)) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setrlimit(resource int, lim *Rlimit) (err error) { r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SETRLIMIT<<4, uintptr(resource), uintptr(unsafe.Pointer(lim))) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setregid(rgid int, egid int) (err error) { r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SETREGID<<4, uintptr(rgid), uintptr(egid)) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setreuid(ruid int, euid int) (err error) { r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SETREUID<<4, uintptr(ruid), uintptr(euid)) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, err error) { r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec() + SYS_SETSID<<4) pid = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setuid(uid int) (err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SETUID<<4, uintptr(uid)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setgid(uid int) (err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SETGID<<4, uintptr(uid)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(fd int, how int) (err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SHUTDOWN<<4, uintptr(fd), uintptr(how)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func stat(path string, statLE *Stat_LE_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___STAT_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(statLE))) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlink(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___SYMLINK_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1))) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_Symlinkat(oldPath string, dirfd int, newPath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldPath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newPath) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___SYMLINKAT_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(dirfd), uintptr(unsafe.Pointer(_p1))) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_SymlinkatAddr() *(func(oldPath string, dirfd int, newPath string) (err error)) var Symlinkat = enter_Symlinkat func enter_Symlinkat(oldPath string, dirfd int, newPath string) (err error) { funcref := get_SymlinkatAddr() if funcptrtest(GetZosLibVec()+SYS___SYMLINKAT_A<<4, "") == 0 { *funcref = impl_Symlinkat } else { *funcref = error_Symlinkat } return (*funcref)(oldPath, dirfd, newPath) } func error_Symlinkat(oldPath string, dirfd int, newPath string) (err error) { err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sync() { runtime.EnterSyscall() CallLeFuncWithErr(GetZosLibVec() + SYS_SYNC<<4) runtime.ExitSyscall() return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___TRUNCATE_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(length)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Tcgetattr(fildes int, termptr *Termios) (err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_TCGETATTR<<4, uintptr(fildes), uintptr(unsafe.Pointer(termptr))) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Tcsetattr(fildes int, when int, termptr *Termios) (err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_TCSETATTR<<4, uintptr(fildes), uintptr(when), uintptr(unsafe.Pointer(termptr))) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Umask(mask int) (oldmask int) { runtime.EnterSyscall() r0, _, _ := CallLeFuncWithErr(GetZosLibVec()+SYS_UMASK<<4, uintptr(mask)) runtime.ExitSyscall() oldmask = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlink(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___UNLINK_A<<4, uintptr(unsafe.Pointer(_p0))) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_Unlinkat(dirfd int, path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___UNLINKAT_A<<4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_UnlinkatAddr() *(func(dirfd int, path string, flags int) (err error)) var Unlinkat = enter_Unlinkat func enter_Unlinkat(dirfd int, path string, flags int) (err error) { funcref := get_UnlinkatAddr() if funcptrtest(GetZosLibVec()+SYS___UNLINKAT_A<<4, "") == 0 { *funcref = impl_Unlinkat } else { *funcref = error_Unlinkat } return (*funcref)(dirfd, path, flags) } func error_Unlinkat(dirfd int, path string, flags int) (err error) { err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Utime(path string, utim *Utimbuf) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___UTIME_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(utim))) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func open(path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___OPEN_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) runtime.ExitSyscall() fd = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___OPENAT_A<<4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mode)) runtime.ExitSyscall() fd = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_openatAddr() *(func(dirfd int, path string, flags int, mode uint32) (fd int, err error)) var openat = enter_openat func enter_openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) { funcref := get_openatAddr() if funcptrtest(GetZosLibVec()+SYS___OPENAT_A<<4, "") == 0 { *funcref = impl_openat } else { *funcref = error_openat } return (*funcref)(dirfd, path, flags, mode) } func error_openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) { fd = -1 err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_openat2(dirfd int, path string, open_how *OpenHow, size int) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___OPENAT2_A<<4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(open_how)), uintptr(size)) runtime.ExitSyscall() fd = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_openat2Addr() *(func(dirfd int, path string, open_how *OpenHow, size int) (fd int, err error)) var openat2 = enter_openat2 func enter_openat2(dirfd int, path string, open_how *OpenHow, size int) (fd int, err error) { funcref := get_openat2Addr() if funcptrtest(GetZosLibVec()+SYS___OPENAT2_A<<4, "") == 0 { *funcref = impl_openat2 } else { *funcref = error_openat2 } return (*funcref)(dirfd, path, open_how, size) } func error_openat2(dirfd int, path string, open_how *OpenHow, size int) (fd int, err error) { fd = -1 err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func remove(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_REMOVE<<4, uintptr(unsafe.Pointer(_p0))) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func waitid(idType int, id int, info *Siginfo, options int) (err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_WAITID<<4, uintptr(idType), uintptr(id), uintptr(unsafe.Pointer(info)), uintptr(options)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func waitpid(pid int, wstatus *_C_int, options int) (wpid int, err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_WAITPID<<4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options)) runtime.ExitSyscall() wpid = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func gettimeofday(tv *timeval_zos) (err error) { r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_GETTIMEOFDAY<<4, uintptr(unsafe.Pointer(tv))) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe(p *[2]_C_int) (err error) { r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_PIPE<<4, uintptr(unsafe.Pointer(p))) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, timeval *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___UTIMES_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval))) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func impl_utimensat(dirfd int, path string, ts *[2]Timespec, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___UTIMENSAT_A<<4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(ts)), uintptr(flags)) runtime.ExitSyscall() if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } //go:nosplit func get_utimensatAddr() *(func(dirfd int, path string, ts *[2]Timespec, flags int) (err error)) var utimensat = enter_utimensat func enter_utimensat(dirfd int, path string, ts *[2]Timespec, flags int) (err error) { funcref := get_utimensatAddr() if funcptrtest(GetZosLibVec()+SYS___UTIMENSAT_A<<4, "") == 0 { *funcref = impl_utimensat } else { *funcref = error_utimensat } return (*funcref)(dirfd, path, ts, flags) } func error_utimensat(dirfd int, path string, ts *[2]Timespec, flags int) (err error) { err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Posix_openpt(oflag int) (fd int, err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_POSIX_OPENPT<<4, uintptr(oflag)) runtime.ExitSyscall() fd = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Grantpt(fildes int) (rc int, err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_GRANTPT<<4, uintptr(fildes)) runtime.ExitSyscall() rc = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlockpt(fildes int) (rc int, err error) { runtime.EnterSyscall() r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_UNLOCKPT<<4, uintptr(fildes)) runtime.ExitSyscall() rc = int(r0) if int64(r0) == -1 { err = errnoErr2(e1, e2) } return } ================================================ FILE: vendor/golang.org/x/sys/unix/zsysctl_openbsd_386.go ================================================ // go run mksysctl_openbsd.go // Code generated by the command above; DO NOT EDIT. //go:build 386 && openbsd package unix type mibentry struct { ctlname string ctloid []_C_int } var sysctlMib = []mibentry{ {"ddb.console", []_C_int{9, 6}}, {"ddb.log", []_C_int{9, 7}}, {"ddb.max_line", []_C_int{9, 3}}, {"ddb.max_width", []_C_int{9, 2}}, {"ddb.panic", []_C_int{9, 5}}, {"ddb.profile", []_C_int{9, 9}}, {"ddb.radix", []_C_int{9, 1}}, {"ddb.tab_stop_width", []_C_int{9, 4}}, {"ddb.trigger", []_C_int{9, 8}}, {"fs.posix.setuid", []_C_int{3, 1, 1}}, {"hw.allowpowerdown", []_C_int{6, 22}}, {"hw.byteorder", []_C_int{6, 4}}, {"hw.cpuspeed", []_C_int{6, 12}}, {"hw.diskcount", []_C_int{6, 10}}, {"hw.disknames", []_C_int{6, 8}}, {"hw.diskstats", []_C_int{6, 9}}, {"hw.machine", []_C_int{6, 1}}, {"hw.model", []_C_int{6, 2}}, {"hw.ncpu", []_C_int{6, 3}}, {"hw.ncpufound", []_C_int{6, 21}}, {"hw.ncpuonline", []_C_int{6, 25}}, {"hw.pagesize", []_C_int{6, 7}}, {"hw.perfpolicy", []_C_int{6, 23}}, {"hw.physmem", []_C_int{6, 19}}, {"hw.power", []_C_int{6, 26}}, {"hw.product", []_C_int{6, 15}}, {"hw.serialno", []_C_int{6, 17}}, {"hw.setperf", []_C_int{6, 13}}, {"hw.smt", []_C_int{6, 24}}, {"hw.usermem", []_C_int{6, 20}}, {"hw.uuid", []_C_int{6, 18}}, {"hw.vendor", []_C_int{6, 14}}, {"hw.version", []_C_int{6, 16}}, {"kern.allowdt", []_C_int{1, 65}}, {"kern.allowkmem", []_C_int{1, 52}}, {"kern.argmax", []_C_int{1, 8}}, {"kern.audio", []_C_int{1, 84}}, {"kern.boottime", []_C_int{1, 21}}, {"kern.bufcachepercent", []_C_int{1, 72}}, {"kern.ccpu", []_C_int{1, 45}}, {"kern.clockrate", []_C_int{1, 12}}, {"kern.consbuf", []_C_int{1, 83}}, {"kern.consbufsize", []_C_int{1, 82}}, {"kern.consdev", []_C_int{1, 75}}, {"kern.cp_time", []_C_int{1, 40}}, {"kern.cp_time2", []_C_int{1, 71}}, {"kern.cpustats", []_C_int{1, 85}}, {"kern.domainname", []_C_int{1, 22}}, {"kern.file", []_C_int{1, 73}}, {"kern.forkstat", []_C_int{1, 42}}, {"kern.fscale", []_C_int{1, 46}}, {"kern.fsync", []_C_int{1, 33}}, {"kern.global_ptrace", []_C_int{1, 81}}, {"kern.hostid", []_C_int{1, 11}}, {"kern.hostname", []_C_int{1, 10}}, {"kern.intrcnt.nintrcnt", []_C_int{1, 63, 1}}, {"kern.job_control", []_C_int{1, 19}}, {"kern.malloc.buckets", []_C_int{1, 39, 1}}, {"kern.malloc.kmemnames", []_C_int{1, 39, 3}}, {"kern.maxclusters", []_C_int{1, 67}}, {"kern.maxfiles", []_C_int{1, 7}}, {"kern.maxlocksperuid", []_C_int{1, 70}}, {"kern.maxpartitions", []_C_int{1, 23}}, {"kern.maxproc", []_C_int{1, 6}}, {"kern.maxthread", []_C_int{1, 25}}, {"kern.maxvnodes", []_C_int{1, 5}}, {"kern.mbstat", []_C_int{1, 59}}, {"kern.msgbuf", []_C_int{1, 48}}, {"kern.msgbufsize", []_C_int{1, 38}}, {"kern.nchstats", []_C_int{1, 41}}, {"kern.netlivelocks", []_C_int{1, 76}}, {"kern.nfiles", []_C_int{1, 56}}, {"kern.ngroups", []_C_int{1, 18}}, {"kern.nosuidcoredump", []_C_int{1, 32}}, {"kern.nprocs", []_C_int{1, 47}}, {"kern.nthreads", []_C_int{1, 26}}, {"kern.numvnodes", []_C_int{1, 58}}, {"kern.osrelease", []_C_int{1, 2}}, {"kern.osrevision", []_C_int{1, 3}}, {"kern.ostype", []_C_int{1, 1}}, {"kern.osversion", []_C_int{1, 27}}, {"kern.pfstatus", []_C_int{1, 86}}, {"kern.pool_debug", []_C_int{1, 77}}, {"kern.posix1version", []_C_int{1, 17}}, {"kern.proc", []_C_int{1, 66}}, {"kern.rawpartition", []_C_int{1, 24}}, {"kern.saved_ids", []_C_int{1, 20}}, {"kern.securelevel", []_C_int{1, 9}}, {"kern.seminfo", []_C_int{1, 61}}, {"kern.shminfo", []_C_int{1, 62}}, {"kern.somaxconn", []_C_int{1, 28}}, {"kern.sominconn", []_C_int{1, 29}}, {"kern.splassert", []_C_int{1, 54}}, {"kern.stackgap_random", []_C_int{1, 50}}, {"kern.sysvipc_info", []_C_int{1, 51}}, {"kern.sysvmsg", []_C_int{1, 34}}, {"kern.sysvsem", []_C_int{1, 35}}, {"kern.sysvshm", []_C_int{1, 36}}, {"kern.timecounter.choice", []_C_int{1, 69, 4}}, {"kern.timecounter.hardware", []_C_int{1, 69, 3}}, {"kern.timecounter.tick", []_C_int{1, 69, 1}}, {"kern.timecounter.timestepwarnings", []_C_int{1, 69, 2}}, {"kern.timeout_stats", []_C_int{1, 87}}, {"kern.tty.tk_cancc", []_C_int{1, 44, 4}}, {"kern.tty.tk_nin", []_C_int{1, 44, 1}}, {"kern.tty.tk_nout", []_C_int{1, 44, 2}}, {"kern.tty.tk_rawcc", []_C_int{1, 44, 3}}, {"kern.tty.ttyinfo", []_C_int{1, 44, 5}}, {"kern.ttycount", []_C_int{1, 57}}, {"kern.utc_offset", []_C_int{1, 88}}, {"kern.version", []_C_int{1, 4}}, {"kern.video", []_C_int{1, 89}}, {"kern.watchdog.auto", []_C_int{1, 64, 2}}, {"kern.watchdog.period", []_C_int{1, 64, 1}}, {"kern.witnesswatch", []_C_int{1, 53}}, {"kern.wxabort", []_C_int{1, 74}}, {"net.bpf.bufsize", []_C_int{4, 31, 1}}, {"net.bpf.maxbufsize", []_C_int{4, 31, 2}}, {"net.inet.ah.enable", []_C_int{4, 2, 51, 1}}, {"net.inet.ah.stats", []_C_int{4, 2, 51, 2}}, {"net.inet.carp.allow", []_C_int{4, 2, 112, 1}}, {"net.inet.carp.log", []_C_int{4, 2, 112, 3}}, {"net.inet.carp.preempt", []_C_int{4, 2, 112, 2}}, {"net.inet.carp.stats", []_C_int{4, 2, 112, 4}}, {"net.inet.divert.recvspace", []_C_int{4, 2, 258, 1}}, {"net.inet.divert.sendspace", []_C_int{4, 2, 258, 2}}, {"net.inet.divert.stats", []_C_int{4, 2, 258, 3}}, {"net.inet.esp.enable", []_C_int{4, 2, 50, 1}}, {"net.inet.esp.stats", []_C_int{4, 2, 50, 4}}, {"net.inet.esp.udpencap", []_C_int{4, 2, 50, 2}}, {"net.inet.esp.udpencap_port", []_C_int{4, 2, 50, 3}}, {"net.inet.etherip.allow", []_C_int{4, 2, 97, 1}}, {"net.inet.etherip.stats", []_C_int{4, 2, 97, 2}}, {"net.inet.gre.allow", []_C_int{4, 2, 47, 1}}, {"net.inet.gre.wccp", []_C_int{4, 2, 47, 2}}, {"net.inet.icmp.bmcastecho", []_C_int{4, 2, 1, 2}}, {"net.inet.icmp.errppslimit", []_C_int{4, 2, 1, 3}}, {"net.inet.icmp.maskrepl", []_C_int{4, 2, 1, 1}}, {"net.inet.icmp.rediraccept", []_C_int{4, 2, 1, 4}}, {"net.inet.icmp.redirtimeout", []_C_int{4, 2, 1, 5}}, {"net.inet.icmp.stats", []_C_int{4, 2, 1, 7}}, {"net.inet.icmp.tstamprepl", []_C_int{4, 2, 1, 6}}, {"net.inet.igmp.stats", []_C_int{4, 2, 2, 1}}, {"net.inet.ip.arpdown", []_C_int{4, 2, 0, 40}}, {"net.inet.ip.arpqueued", []_C_int{4, 2, 0, 36}}, {"net.inet.ip.arptimeout", []_C_int{4, 2, 0, 39}}, {"net.inet.ip.encdebug", []_C_int{4, 2, 0, 12}}, {"net.inet.ip.forwarding", []_C_int{4, 2, 0, 1}}, {"net.inet.ip.ifq.congestion", []_C_int{4, 2, 0, 30, 4}}, {"net.inet.ip.ifq.drops", []_C_int{4, 2, 0, 30, 3}}, {"net.inet.ip.ifq.len", []_C_int{4, 2, 0, 30, 1}}, {"net.inet.ip.ifq.maxlen", []_C_int{4, 2, 0, 30, 2}}, {"net.inet.ip.maxqueue", []_C_int{4, 2, 0, 11}}, {"net.inet.ip.mforwarding", []_C_int{4, 2, 0, 31}}, {"net.inet.ip.mrtmfc", []_C_int{4, 2, 0, 37}}, {"net.inet.ip.mrtproto", []_C_int{4, 2, 0, 34}}, {"net.inet.ip.mrtstats", []_C_int{4, 2, 0, 35}}, {"net.inet.ip.mrtvif", []_C_int{4, 2, 0, 38}}, {"net.inet.ip.mtu", []_C_int{4, 2, 0, 4}}, {"net.inet.ip.mtudisc", []_C_int{4, 2, 0, 27}}, {"net.inet.ip.mtudisctimeout", []_C_int{4, 2, 0, 28}}, {"net.inet.ip.multipath", []_C_int{4, 2, 0, 32}}, {"net.inet.ip.portfirst", []_C_int{4, 2, 0, 7}}, {"net.inet.ip.porthifirst", []_C_int{4, 2, 0, 9}}, {"net.inet.ip.porthilast", []_C_int{4, 2, 0, 10}}, {"net.inet.ip.portlast", []_C_int{4, 2, 0, 8}}, {"net.inet.ip.redirect", []_C_int{4, 2, 0, 2}}, {"net.inet.ip.sourceroute", []_C_int{4, 2, 0, 5}}, {"net.inet.ip.stats", []_C_int{4, 2, 0, 33}}, {"net.inet.ip.ttl", []_C_int{4, 2, 0, 3}}, {"net.inet.ipcomp.enable", []_C_int{4, 2, 108, 1}}, {"net.inet.ipcomp.stats", []_C_int{4, 2, 108, 2}}, {"net.inet.ipip.allow", []_C_int{4, 2, 4, 1}}, {"net.inet.ipip.stats", []_C_int{4, 2, 4, 2}}, {"net.inet.pfsync.stats", []_C_int{4, 2, 240, 1}}, {"net.inet.tcp.ackonpush", []_C_int{4, 2, 6, 13}}, {"net.inet.tcp.always_keepalive", []_C_int{4, 2, 6, 22}}, {"net.inet.tcp.baddynamic", []_C_int{4, 2, 6, 6}}, {"net.inet.tcp.drop", []_C_int{4, 2, 6, 19}}, {"net.inet.tcp.ecn", []_C_int{4, 2, 6, 14}}, {"net.inet.tcp.ident", []_C_int{4, 2, 6, 9}}, {"net.inet.tcp.keepidle", []_C_int{4, 2, 6, 3}}, {"net.inet.tcp.keepinittime", []_C_int{4, 2, 6, 2}}, {"net.inet.tcp.keepintvl", []_C_int{4, 2, 6, 4}}, {"net.inet.tcp.mssdflt", []_C_int{4, 2, 6, 11}}, {"net.inet.tcp.reasslimit", []_C_int{4, 2, 6, 18}}, {"net.inet.tcp.rfc1323", []_C_int{4, 2, 6, 1}}, {"net.inet.tcp.rfc3390", []_C_int{4, 2, 6, 17}}, {"net.inet.tcp.rootonly", []_C_int{4, 2, 6, 24}}, {"net.inet.tcp.rstppslimit", []_C_int{4, 2, 6, 12}}, {"net.inet.tcp.sack", []_C_int{4, 2, 6, 10}}, {"net.inet.tcp.sackholelimit", []_C_int{4, 2, 6, 20}}, {"net.inet.tcp.slowhz", []_C_int{4, 2, 6, 5}}, {"net.inet.tcp.stats", []_C_int{4, 2, 6, 21}}, {"net.inet.tcp.synbucketlimit", []_C_int{4, 2, 6, 16}}, {"net.inet.tcp.syncachelimit", []_C_int{4, 2, 6, 15}}, {"net.inet.tcp.synhashsize", []_C_int{4, 2, 6, 25}}, {"net.inet.tcp.synuselimit", []_C_int{4, 2, 6, 23}}, {"net.inet.udp.baddynamic", []_C_int{4, 2, 17, 2}}, {"net.inet.udp.checksum", []_C_int{4, 2, 17, 1}}, {"net.inet.udp.recvspace", []_C_int{4, 2, 17, 3}}, {"net.inet.udp.rootonly", []_C_int{4, 2, 17, 6}}, {"net.inet.udp.sendspace", []_C_int{4, 2, 17, 4}}, {"net.inet.udp.stats", []_C_int{4, 2, 17, 5}}, {"net.inet6.divert.recvspace", []_C_int{4, 24, 86, 1}}, {"net.inet6.divert.sendspace", []_C_int{4, 24, 86, 2}}, {"net.inet6.divert.stats", []_C_int{4, 24, 86, 3}}, {"net.inet6.icmp6.errppslimit", []_C_int{4, 24, 30, 14}}, {"net.inet6.icmp6.mtudisc_hiwat", []_C_int{4, 24, 30, 16}}, {"net.inet6.icmp6.mtudisc_lowat", []_C_int{4, 24, 30, 17}}, {"net.inet6.icmp6.nd6_debug", []_C_int{4, 24, 30, 18}}, {"net.inet6.icmp6.nd6_delay", []_C_int{4, 24, 30, 8}}, {"net.inet6.icmp6.nd6_maxnudhint", []_C_int{4, 24, 30, 15}}, {"net.inet6.icmp6.nd6_mmaxtries", []_C_int{4, 24, 30, 10}}, {"net.inet6.icmp6.nd6_umaxtries", []_C_int{4, 24, 30, 9}}, {"net.inet6.icmp6.redirtimeout", []_C_int{4, 24, 30, 3}}, {"net.inet6.ip6.auto_flowlabel", []_C_int{4, 24, 17, 17}}, {"net.inet6.ip6.dad_count", []_C_int{4, 24, 17, 16}}, {"net.inet6.ip6.dad_pending", []_C_int{4, 24, 17, 49}}, {"net.inet6.ip6.defmcasthlim", []_C_int{4, 24, 17, 18}}, {"net.inet6.ip6.forwarding", []_C_int{4, 24, 17, 1}}, {"net.inet6.ip6.forwsrcrt", []_C_int{4, 24, 17, 5}}, {"net.inet6.ip6.hdrnestlimit", []_C_int{4, 24, 17, 15}}, {"net.inet6.ip6.hlim", []_C_int{4, 24, 17, 3}}, {"net.inet6.ip6.log_interval", []_C_int{4, 24, 17, 14}}, {"net.inet6.ip6.maxdynroutes", []_C_int{4, 24, 17, 48}}, {"net.inet6.ip6.maxfragpackets", []_C_int{4, 24, 17, 9}}, {"net.inet6.ip6.maxfrags", []_C_int{4, 24, 17, 41}}, {"net.inet6.ip6.mforwarding", []_C_int{4, 24, 17, 42}}, {"net.inet6.ip6.mrtmfc", []_C_int{4, 24, 17, 53}}, {"net.inet6.ip6.mrtmif", []_C_int{4, 24, 17, 52}}, {"net.inet6.ip6.mrtproto", []_C_int{4, 24, 17, 8}}, {"net.inet6.ip6.mtudisctimeout", []_C_int{4, 24, 17, 50}}, {"net.inet6.ip6.multicast_mtudisc", []_C_int{4, 24, 17, 44}}, {"net.inet6.ip6.multipath", []_C_int{4, 24, 17, 43}}, {"net.inet6.ip6.neighborgcthresh", []_C_int{4, 24, 17, 45}}, {"net.inet6.ip6.redirect", []_C_int{4, 24, 17, 2}}, {"net.inet6.ip6.soiikey", []_C_int{4, 24, 17, 54}}, {"net.inet6.ip6.sourcecheck", []_C_int{4, 24, 17, 10}}, {"net.inet6.ip6.sourcecheck_logint", []_C_int{4, 24, 17, 11}}, {"net.inet6.ip6.use_deprecated", []_C_int{4, 24, 17, 21}}, {"net.key.sadb_dump", []_C_int{4, 30, 1}}, {"net.key.spd_dump", []_C_int{4, 30, 2}}, {"net.mpls.ifq.congestion", []_C_int{4, 33, 3, 4}}, {"net.mpls.ifq.drops", []_C_int{4, 33, 3, 3}}, {"net.mpls.ifq.len", []_C_int{4, 33, 3, 1}}, {"net.mpls.ifq.maxlen", []_C_int{4, 33, 3, 2}}, {"net.mpls.mapttl_ip", []_C_int{4, 33, 5}}, {"net.mpls.mapttl_ip6", []_C_int{4, 33, 6}}, {"net.mpls.ttl", []_C_int{4, 33, 2}}, {"net.pflow.stats", []_C_int{4, 34, 1}}, {"net.pipex.enable", []_C_int{4, 35, 1}}, {"vm.anonmin", []_C_int{2, 7}}, {"vm.loadavg", []_C_int{2, 2}}, {"vm.malloc_conf", []_C_int{2, 12}}, {"vm.maxslp", []_C_int{2, 10}}, {"vm.nkmempages", []_C_int{2, 6}}, {"vm.psstrings", []_C_int{2, 3}}, {"vm.swapencrypt.enable", []_C_int{2, 5, 0}}, {"vm.swapencrypt.keyscreated", []_C_int{2, 5, 1}}, {"vm.swapencrypt.keysdeleted", []_C_int{2, 5, 2}}, {"vm.uspace", []_C_int{2, 11}}, {"vm.uvmexp", []_C_int{2, 4}}, {"vm.vmmeter", []_C_int{2, 1}}, {"vm.vnodemin", []_C_int{2, 9}}, {"vm.vtextmin", []_C_int{2, 8}}, } ================================================ FILE: vendor/golang.org/x/sys/unix/zsysctl_openbsd_amd64.go ================================================ // go run mksysctl_openbsd.go // Code generated by the command above; DO NOT EDIT. //go:build amd64 && openbsd package unix type mibentry struct { ctlname string ctloid []_C_int } var sysctlMib = []mibentry{ {"ddb.console", []_C_int{9, 6}}, {"ddb.log", []_C_int{9, 7}}, {"ddb.max_line", []_C_int{9, 3}}, {"ddb.max_width", []_C_int{9, 2}}, {"ddb.panic", []_C_int{9, 5}}, {"ddb.profile", []_C_int{9, 9}}, {"ddb.radix", []_C_int{9, 1}}, {"ddb.tab_stop_width", []_C_int{9, 4}}, {"ddb.trigger", []_C_int{9, 8}}, {"fs.posix.setuid", []_C_int{3, 1, 1}}, {"hw.allowpowerdown", []_C_int{6, 22}}, {"hw.byteorder", []_C_int{6, 4}}, {"hw.cpuspeed", []_C_int{6, 12}}, {"hw.diskcount", []_C_int{6, 10}}, {"hw.disknames", []_C_int{6, 8}}, {"hw.diskstats", []_C_int{6, 9}}, {"hw.machine", []_C_int{6, 1}}, {"hw.model", []_C_int{6, 2}}, {"hw.ncpu", []_C_int{6, 3}}, {"hw.ncpufound", []_C_int{6, 21}}, {"hw.ncpuonline", []_C_int{6, 25}}, {"hw.pagesize", []_C_int{6, 7}}, {"hw.perfpolicy", []_C_int{6, 23}}, {"hw.physmem", []_C_int{6, 19}}, {"hw.power", []_C_int{6, 26}}, {"hw.product", []_C_int{6, 15}}, {"hw.serialno", []_C_int{6, 17}}, {"hw.setperf", []_C_int{6, 13}}, {"hw.smt", []_C_int{6, 24}}, {"hw.usermem", []_C_int{6, 20}}, {"hw.uuid", []_C_int{6, 18}}, {"hw.vendor", []_C_int{6, 14}}, {"hw.version", []_C_int{6, 16}}, {"kern.allowdt", []_C_int{1, 65}}, {"kern.allowkmem", []_C_int{1, 52}}, {"kern.argmax", []_C_int{1, 8}}, {"kern.audio", []_C_int{1, 84}}, {"kern.boottime", []_C_int{1, 21}}, {"kern.bufcachepercent", []_C_int{1, 72}}, {"kern.ccpu", []_C_int{1, 45}}, {"kern.clockrate", []_C_int{1, 12}}, {"kern.consbuf", []_C_int{1, 83}}, {"kern.consbufsize", []_C_int{1, 82}}, {"kern.consdev", []_C_int{1, 75}}, {"kern.cp_time", []_C_int{1, 40}}, {"kern.cp_time2", []_C_int{1, 71}}, {"kern.cpustats", []_C_int{1, 85}}, {"kern.domainname", []_C_int{1, 22}}, {"kern.file", []_C_int{1, 73}}, {"kern.forkstat", []_C_int{1, 42}}, {"kern.fscale", []_C_int{1, 46}}, {"kern.fsync", []_C_int{1, 33}}, {"kern.global_ptrace", []_C_int{1, 81}}, {"kern.hostid", []_C_int{1, 11}}, {"kern.hostname", []_C_int{1, 10}}, {"kern.intrcnt.nintrcnt", []_C_int{1, 63, 1}}, {"kern.job_control", []_C_int{1, 19}}, {"kern.malloc.buckets", []_C_int{1, 39, 1}}, {"kern.malloc.kmemnames", []_C_int{1, 39, 3}}, {"kern.maxclusters", []_C_int{1, 67}}, {"kern.maxfiles", []_C_int{1, 7}}, {"kern.maxlocksperuid", []_C_int{1, 70}}, {"kern.maxpartitions", []_C_int{1, 23}}, {"kern.maxproc", []_C_int{1, 6}}, {"kern.maxthread", []_C_int{1, 25}}, {"kern.maxvnodes", []_C_int{1, 5}}, {"kern.mbstat", []_C_int{1, 59}}, {"kern.msgbuf", []_C_int{1, 48}}, {"kern.msgbufsize", []_C_int{1, 38}}, {"kern.nchstats", []_C_int{1, 41}}, {"kern.netlivelocks", []_C_int{1, 76}}, {"kern.nfiles", []_C_int{1, 56}}, {"kern.ngroups", []_C_int{1, 18}}, {"kern.nosuidcoredump", []_C_int{1, 32}}, {"kern.nprocs", []_C_int{1, 47}}, {"kern.nthreads", []_C_int{1, 26}}, {"kern.numvnodes", []_C_int{1, 58}}, {"kern.osrelease", []_C_int{1, 2}}, {"kern.osrevision", []_C_int{1, 3}}, {"kern.ostype", []_C_int{1, 1}}, {"kern.osversion", []_C_int{1, 27}}, {"kern.pfstatus", []_C_int{1, 86}}, {"kern.pool_debug", []_C_int{1, 77}}, {"kern.posix1version", []_C_int{1, 17}}, {"kern.proc", []_C_int{1, 66}}, {"kern.rawpartition", []_C_int{1, 24}}, {"kern.saved_ids", []_C_int{1, 20}}, {"kern.securelevel", []_C_int{1, 9}}, {"kern.seminfo", []_C_int{1, 61}}, {"kern.shminfo", []_C_int{1, 62}}, {"kern.somaxconn", []_C_int{1, 28}}, {"kern.sominconn", []_C_int{1, 29}}, {"kern.splassert", []_C_int{1, 54}}, {"kern.stackgap_random", []_C_int{1, 50}}, {"kern.sysvipc_info", []_C_int{1, 51}}, {"kern.sysvmsg", []_C_int{1, 34}}, {"kern.sysvsem", []_C_int{1, 35}}, {"kern.sysvshm", []_C_int{1, 36}}, {"kern.timecounter.choice", []_C_int{1, 69, 4}}, {"kern.timecounter.hardware", []_C_int{1, 69, 3}}, {"kern.timecounter.tick", []_C_int{1, 69, 1}}, {"kern.timecounter.timestepwarnings", []_C_int{1, 69, 2}}, {"kern.timeout_stats", []_C_int{1, 87}}, {"kern.tty.tk_cancc", []_C_int{1, 44, 4}}, {"kern.tty.tk_nin", []_C_int{1, 44, 1}}, {"kern.tty.tk_nout", []_C_int{1, 44, 2}}, {"kern.tty.tk_rawcc", []_C_int{1, 44, 3}}, {"kern.tty.ttyinfo", []_C_int{1, 44, 5}}, {"kern.ttycount", []_C_int{1, 57}}, {"kern.utc_offset", []_C_int{1, 88}}, {"kern.version", []_C_int{1, 4}}, {"kern.video", []_C_int{1, 89}}, {"kern.watchdog.auto", []_C_int{1, 64, 2}}, {"kern.watchdog.period", []_C_int{1, 64, 1}}, {"kern.witnesswatch", []_C_int{1, 53}}, {"kern.wxabort", []_C_int{1, 74}}, {"net.bpf.bufsize", []_C_int{4, 31, 1}}, {"net.bpf.maxbufsize", []_C_int{4, 31, 2}}, {"net.inet.ah.enable", []_C_int{4, 2, 51, 1}}, {"net.inet.ah.stats", []_C_int{4, 2, 51, 2}}, {"net.inet.carp.allow", []_C_int{4, 2, 112, 1}}, {"net.inet.carp.log", []_C_int{4, 2, 112, 3}}, {"net.inet.carp.preempt", []_C_int{4, 2, 112, 2}}, {"net.inet.carp.stats", []_C_int{4, 2, 112, 4}}, {"net.inet.divert.recvspace", []_C_int{4, 2, 258, 1}}, {"net.inet.divert.sendspace", []_C_int{4, 2, 258, 2}}, {"net.inet.divert.stats", []_C_int{4, 2, 258, 3}}, {"net.inet.esp.enable", []_C_int{4, 2, 50, 1}}, {"net.inet.esp.stats", []_C_int{4, 2, 50, 4}}, {"net.inet.esp.udpencap", []_C_int{4, 2, 50, 2}}, {"net.inet.esp.udpencap_port", []_C_int{4, 2, 50, 3}}, {"net.inet.etherip.allow", []_C_int{4, 2, 97, 1}}, {"net.inet.etherip.stats", []_C_int{4, 2, 97, 2}}, {"net.inet.gre.allow", []_C_int{4, 2, 47, 1}}, {"net.inet.gre.wccp", []_C_int{4, 2, 47, 2}}, {"net.inet.icmp.bmcastecho", []_C_int{4, 2, 1, 2}}, {"net.inet.icmp.errppslimit", []_C_int{4, 2, 1, 3}}, {"net.inet.icmp.maskrepl", []_C_int{4, 2, 1, 1}}, {"net.inet.icmp.rediraccept", []_C_int{4, 2, 1, 4}}, {"net.inet.icmp.redirtimeout", []_C_int{4, 2, 1, 5}}, {"net.inet.icmp.stats", []_C_int{4, 2, 1, 7}}, {"net.inet.icmp.tstamprepl", []_C_int{4, 2, 1, 6}}, {"net.inet.igmp.stats", []_C_int{4, 2, 2, 1}}, {"net.inet.ip.arpdown", []_C_int{4, 2, 0, 40}}, {"net.inet.ip.arpqueued", []_C_int{4, 2, 0, 36}}, {"net.inet.ip.arptimeout", []_C_int{4, 2, 0, 39}}, {"net.inet.ip.encdebug", []_C_int{4, 2, 0, 12}}, {"net.inet.ip.forwarding", []_C_int{4, 2, 0, 1}}, {"net.inet.ip.ifq.congestion", []_C_int{4, 2, 0, 30, 4}}, {"net.inet.ip.ifq.drops", []_C_int{4, 2, 0, 30, 3}}, {"net.inet.ip.ifq.len", []_C_int{4, 2, 0, 30, 1}}, {"net.inet.ip.ifq.maxlen", []_C_int{4, 2, 0, 30, 2}}, {"net.inet.ip.maxqueue", []_C_int{4, 2, 0, 11}}, {"net.inet.ip.mforwarding", []_C_int{4, 2, 0, 31}}, {"net.inet.ip.mrtmfc", []_C_int{4, 2, 0, 37}}, {"net.inet.ip.mrtproto", []_C_int{4, 2, 0, 34}}, {"net.inet.ip.mrtstats", []_C_int{4, 2, 0, 35}}, {"net.inet.ip.mrtvif", []_C_int{4, 2, 0, 38}}, {"net.inet.ip.mtu", []_C_int{4, 2, 0, 4}}, {"net.inet.ip.mtudisc", []_C_int{4, 2, 0, 27}}, {"net.inet.ip.mtudisctimeout", []_C_int{4, 2, 0, 28}}, {"net.inet.ip.multipath", []_C_int{4, 2, 0, 32}}, {"net.inet.ip.portfirst", []_C_int{4, 2, 0, 7}}, {"net.inet.ip.porthifirst", []_C_int{4, 2, 0, 9}}, {"net.inet.ip.porthilast", []_C_int{4, 2, 0, 10}}, {"net.inet.ip.portlast", []_C_int{4, 2, 0, 8}}, {"net.inet.ip.redirect", []_C_int{4, 2, 0, 2}}, {"net.inet.ip.sourceroute", []_C_int{4, 2, 0, 5}}, {"net.inet.ip.stats", []_C_int{4, 2, 0, 33}}, {"net.inet.ip.ttl", []_C_int{4, 2, 0, 3}}, {"net.inet.ipcomp.enable", []_C_int{4, 2, 108, 1}}, {"net.inet.ipcomp.stats", []_C_int{4, 2, 108, 2}}, {"net.inet.ipip.allow", []_C_int{4, 2, 4, 1}}, {"net.inet.ipip.stats", []_C_int{4, 2, 4, 2}}, {"net.inet.pfsync.stats", []_C_int{4, 2, 240, 1}}, {"net.inet.tcp.ackonpush", []_C_int{4, 2, 6, 13}}, {"net.inet.tcp.always_keepalive", []_C_int{4, 2, 6, 22}}, {"net.inet.tcp.baddynamic", []_C_int{4, 2, 6, 6}}, {"net.inet.tcp.drop", []_C_int{4, 2, 6, 19}}, {"net.inet.tcp.ecn", []_C_int{4, 2, 6, 14}}, {"net.inet.tcp.ident", []_C_int{4, 2, 6, 9}}, {"net.inet.tcp.keepidle", []_C_int{4, 2, 6, 3}}, {"net.inet.tcp.keepinittime", []_C_int{4, 2, 6, 2}}, {"net.inet.tcp.keepintvl", []_C_int{4, 2, 6, 4}}, {"net.inet.tcp.mssdflt", []_C_int{4, 2, 6, 11}}, {"net.inet.tcp.reasslimit", []_C_int{4, 2, 6, 18}}, {"net.inet.tcp.rfc1323", []_C_int{4, 2, 6, 1}}, {"net.inet.tcp.rfc3390", []_C_int{4, 2, 6, 17}}, {"net.inet.tcp.rootonly", []_C_int{4, 2, 6, 24}}, {"net.inet.tcp.rstppslimit", []_C_int{4, 2, 6, 12}}, {"net.inet.tcp.sack", []_C_int{4, 2, 6, 10}}, {"net.inet.tcp.sackholelimit", []_C_int{4, 2, 6, 20}}, {"net.inet.tcp.slowhz", []_C_int{4, 2, 6, 5}}, {"net.inet.tcp.stats", []_C_int{4, 2, 6, 21}}, {"net.inet.tcp.synbucketlimit", []_C_int{4, 2, 6, 16}}, {"net.inet.tcp.syncachelimit", []_C_int{4, 2, 6, 15}}, {"net.inet.tcp.synhashsize", []_C_int{4, 2, 6, 25}}, {"net.inet.tcp.synuselimit", []_C_int{4, 2, 6, 23}}, {"net.inet.udp.baddynamic", []_C_int{4, 2, 17, 2}}, {"net.inet.udp.checksum", []_C_int{4, 2, 17, 1}}, {"net.inet.udp.recvspace", []_C_int{4, 2, 17, 3}}, {"net.inet.udp.rootonly", []_C_int{4, 2, 17, 6}}, {"net.inet.udp.sendspace", []_C_int{4, 2, 17, 4}}, {"net.inet.udp.stats", []_C_int{4, 2, 17, 5}}, {"net.inet6.divert.recvspace", []_C_int{4, 24, 86, 1}}, {"net.inet6.divert.sendspace", []_C_int{4, 24, 86, 2}}, {"net.inet6.divert.stats", []_C_int{4, 24, 86, 3}}, {"net.inet6.icmp6.errppslimit", []_C_int{4, 24, 30, 14}}, {"net.inet6.icmp6.mtudisc_hiwat", []_C_int{4, 24, 30, 16}}, {"net.inet6.icmp6.mtudisc_lowat", []_C_int{4, 24, 30, 17}}, {"net.inet6.icmp6.nd6_debug", []_C_int{4, 24, 30, 18}}, {"net.inet6.icmp6.nd6_delay", []_C_int{4, 24, 30, 8}}, {"net.inet6.icmp6.nd6_maxnudhint", []_C_int{4, 24, 30, 15}}, {"net.inet6.icmp6.nd6_mmaxtries", []_C_int{4, 24, 30, 10}}, {"net.inet6.icmp6.nd6_umaxtries", []_C_int{4, 24, 30, 9}}, {"net.inet6.icmp6.redirtimeout", []_C_int{4, 24, 30, 3}}, {"net.inet6.ip6.auto_flowlabel", []_C_int{4, 24, 17, 17}}, {"net.inet6.ip6.dad_count", []_C_int{4, 24, 17, 16}}, {"net.inet6.ip6.dad_pending", []_C_int{4, 24, 17, 49}}, {"net.inet6.ip6.defmcasthlim", []_C_int{4, 24, 17, 18}}, {"net.inet6.ip6.forwarding", []_C_int{4, 24, 17, 1}}, {"net.inet6.ip6.forwsrcrt", []_C_int{4, 24, 17, 5}}, {"net.inet6.ip6.hdrnestlimit", []_C_int{4, 24, 17, 15}}, {"net.inet6.ip6.hlim", []_C_int{4, 24, 17, 3}}, {"net.inet6.ip6.log_interval", []_C_int{4, 24, 17, 14}}, {"net.inet6.ip6.maxdynroutes", []_C_int{4, 24, 17, 48}}, {"net.inet6.ip6.maxfragpackets", []_C_int{4, 24, 17, 9}}, {"net.inet6.ip6.maxfrags", []_C_int{4, 24, 17, 41}}, {"net.inet6.ip6.mforwarding", []_C_int{4, 24, 17, 42}}, {"net.inet6.ip6.mrtmfc", []_C_int{4, 24, 17, 53}}, {"net.inet6.ip6.mrtmif", []_C_int{4, 24, 17, 52}}, {"net.inet6.ip6.mrtproto", []_C_int{4, 24, 17, 8}}, {"net.inet6.ip6.mtudisctimeout", []_C_int{4, 24, 17, 50}}, {"net.inet6.ip6.multicast_mtudisc", []_C_int{4, 24, 17, 44}}, {"net.inet6.ip6.multipath", []_C_int{4, 24, 17, 43}}, {"net.inet6.ip6.neighborgcthresh", []_C_int{4, 24, 17, 45}}, {"net.inet6.ip6.redirect", []_C_int{4, 24, 17, 2}}, {"net.inet6.ip6.soiikey", []_C_int{4, 24, 17, 54}}, {"net.inet6.ip6.sourcecheck", []_C_int{4, 24, 17, 10}}, {"net.inet6.ip6.sourcecheck_logint", []_C_int{4, 24, 17, 11}}, {"net.inet6.ip6.use_deprecated", []_C_int{4, 24, 17, 21}}, {"net.key.sadb_dump", []_C_int{4, 30, 1}}, {"net.key.spd_dump", []_C_int{4, 30, 2}}, {"net.mpls.ifq.congestion", []_C_int{4, 33, 3, 4}}, {"net.mpls.ifq.drops", []_C_int{4, 33, 3, 3}}, {"net.mpls.ifq.len", []_C_int{4, 33, 3, 1}}, {"net.mpls.ifq.maxlen", []_C_int{4, 33, 3, 2}}, {"net.mpls.mapttl_ip", []_C_int{4, 33, 5}}, {"net.mpls.mapttl_ip6", []_C_int{4, 33, 6}}, {"net.mpls.ttl", []_C_int{4, 33, 2}}, {"net.pflow.stats", []_C_int{4, 34, 1}}, {"net.pipex.enable", []_C_int{4, 35, 1}}, {"vm.anonmin", []_C_int{2, 7}}, {"vm.loadavg", []_C_int{2, 2}}, {"vm.malloc_conf", []_C_int{2, 12}}, {"vm.maxslp", []_C_int{2, 10}}, {"vm.nkmempages", []_C_int{2, 6}}, {"vm.psstrings", []_C_int{2, 3}}, {"vm.swapencrypt.enable", []_C_int{2, 5, 0}}, {"vm.swapencrypt.keyscreated", []_C_int{2, 5, 1}}, {"vm.swapencrypt.keysdeleted", []_C_int{2, 5, 2}}, {"vm.uspace", []_C_int{2, 11}}, {"vm.uvmexp", []_C_int{2, 4}}, {"vm.vmmeter", []_C_int{2, 1}}, {"vm.vnodemin", []_C_int{2, 9}}, {"vm.vtextmin", []_C_int{2, 8}}, } ================================================ FILE: vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm.go ================================================ // go run mksysctl_openbsd.go // Code generated by the command above; DO NOT EDIT. //go:build arm && openbsd package unix type mibentry struct { ctlname string ctloid []_C_int } var sysctlMib = []mibentry{ {"ddb.console", []_C_int{9, 6}}, {"ddb.log", []_C_int{9, 7}}, {"ddb.max_line", []_C_int{9, 3}}, {"ddb.max_width", []_C_int{9, 2}}, {"ddb.panic", []_C_int{9, 5}}, {"ddb.profile", []_C_int{9, 9}}, {"ddb.radix", []_C_int{9, 1}}, {"ddb.tab_stop_width", []_C_int{9, 4}}, {"ddb.trigger", []_C_int{9, 8}}, {"fs.posix.setuid", []_C_int{3, 1, 1}}, {"hw.allowpowerdown", []_C_int{6, 22}}, {"hw.byteorder", []_C_int{6, 4}}, {"hw.cpuspeed", []_C_int{6, 12}}, {"hw.diskcount", []_C_int{6, 10}}, {"hw.disknames", []_C_int{6, 8}}, {"hw.diskstats", []_C_int{6, 9}}, {"hw.machine", []_C_int{6, 1}}, {"hw.model", []_C_int{6, 2}}, {"hw.ncpu", []_C_int{6, 3}}, {"hw.ncpufound", []_C_int{6, 21}}, {"hw.ncpuonline", []_C_int{6, 25}}, {"hw.pagesize", []_C_int{6, 7}}, {"hw.perfpolicy", []_C_int{6, 23}}, {"hw.physmem", []_C_int{6, 19}}, {"hw.power", []_C_int{6, 26}}, {"hw.product", []_C_int{6, 15}}, {"hw.serialno", []_C_int{6, 17}}, {"hw.setperf", []_C_int{6, 13}}, {"hw.smt", []_C_int{6, 24}}, {"hw.usermem", []_C_int{6, 20}}, {"hw.uuid", []_C_int{6, 18}}, {"hw.vendor", []_C_int{6, 14}}, {"hw.version", []_C_int{6, 16}}, {"kern.allowdt", []_C_int{1, 65}}, {"kern.allowkmem", []_C_int{1, 52}}, {"kern.argmax", []_C_int{1, 8}}, {"kern.audio", []_C_int{1, 84}}, {"kern.boottime", []_C_int{1, 21}}, {"kern.bufcachepercent", []_C_int{1, 72}}, {"kern.ccpu", []_C_int{1, 45}}, {"kern.clockrate", []_C_int{1, 12}}, {"kern.consbuf", []_C_int{1, 83}}, {"kern.consbufsize", []_C_int{1, 82}}, {"kern.consdev", []_C_int{1, 75}}, {"kern.cp_time", []_C_int{1, 40}}, {"kern.cp_time2", []_C_int{1, 71}}, {"kern.cpustats", []_C_int{1, 85}}, {"kern.domainname", []_C_int{1, 22}}, {"kern.file", []_C_int{1, 73}}, {"kern.forkstat", []_C_int{1, 42}}, {"kern.fscale", []_C_int{1, 46}}, {"kern.fsync", []_C_int{1, 33}}, {"kern.global_ptrace", []_C_int{1, 81}}, {"kern.hostid", []_C_int{1, 11}}, {"kern.hostname", []_C_int{1, 10}}, {"kern.intrcnt.nintrcnt", []_C_int{1, 63, 1}}, {"kern.job_control", []_C_int{1, 19}}, {"kern.malloc.buckets", []_C_int{1, 39, 1}}, {"kern.malloc.kmemnames", []_C_int{1, 39, 3}}, {"kern.maxclusters", []_C_int{1, 67}}, {"kern.maxfiles", []_C_int{1, 7}}, {"kern.maxlocksperuid", []_C_int{1, 70}}, {"kern.maxpartitions", []_C_int{1, 23}}, {"kern.maxproc", []_C_int{1, 6}}, {"kern.maxthread", []_C_int{1, 25}}, {"kern.maxvnodes", []_C_int{1, 5}}, {"kern.mbstat", []_C_int{1, 59}}, {"kern.msgbuf", []_C_int{1, 48}}, {"kern.msgbufsize", []_C_int{1, 38}}, {"kern.nchstats", []_C_int{1, 41}}, {"kern.netlivelocks", []_C_int{1, 76}}, {"kern.nfiles", []_C_int{1, 56}}, {"kern.ngroups", []_C_int{1, 18}}, {"kern.nosuidcoredump", []_C_int{1, 32}}, {"kern.nprocs", []_C_int{1, 47}}, {"kern.nthreads", []_C_int{1, 26}}, {"kern.numvnodes", []_C_int{1, 58}}, {"kern.osrelease", []_C_int{1, 2}}, {"kern.osrevision", []_C_int{1, 3}}, {"kern.ostype", []_C_int{1, 1}}, {"kern.osversion", []_C_int{1, 27}}, {"kern.pfstatus", []_C_int{1, 86}}, {"kern.pool_debug", []_C_int{1, 77}}, {"kern.posix1version", []_C_int{1, 17}}, {"kern.proc", []_C_int{1, 66}}, {"kern.rawpartition", []_C_int{1, 24}}, {"kern.saved_ids", []_C_int{1, 20}}, {"kern.securelevel", []_C_int{1, 9}}, {"kern.seminfo", []_C_int{1, 61}}, {"kern.shminfo", []_C_int{1, 62}}, {"kern.somaxconn", []_C_int{1, 28}}, {"kern.sominconn", []_C_int{1, 29}}, {"kern.splassert", []_C_int{1, 54}}, {"kern.stackgap_random", []_C_int{1, 50}}, {"kern.sysvipc_info", []_C_int{1, 51}}, {"kern.sysvmsg", []_C_int{1, 34}}, {"kern.sysvsem", []_C_int{1, 35}}, {"kern.sysvshm", []_C_int{1, 36}}, {"kern.timecounter.choice", []_C_int{1, 69, 4}}, {"kern.timecounter.hardware", []_C_int{1, 69, 3}}, {"kern.timecounter.tick", []_C_int{1, 69, 1}}, {"kern.timecounter.timestepwarnings", []_C_int{1, 69, 2}}, {"kern.timeout_stats", []_C_int{1, 87}}, {"kern.tty.tk_cancc", []_C_int{1, 44, 4}}, {"kern.tty.tk_nin", []_C_int{1, 44, 1}}, {"kern.tty.tk_nout", []_C_int{1, 44, 2}}, {"kern.tty.tk_rawcc", []_C_int{1, 44, 3}}, {"kern.tty.ttyinfo", []_C_int{1, 44, 5}}, {"kern.ttycount", []_C_int{1, 57}}, {"kern.utc_offset", []_C_int{1, 88}}, {"kern.version", []_C_int{1, 4}}, {"kern.video", []_C_int{1, 89}}, {"kern.watchdog.auto", []_C_int{1, 64, 2}}, {"kern.watchdog.period", []_C_int{1, 64, 1}}, {"kern.witnesswatch", []_C_int{1, 53}}, {"kern.wxabort", []_C_int{1, 74}}, {"net.bpf.bufsize", []_C_int{4, 31, 1}}, {"net.bpf.maxbufsize", []_C_int{4, 31, 2}}, {"net.inet.ah.enable", []_C_int{4, 2, 51, 1}}, {"net.inet.ah.stats", []_C_int{4, 2, 51, 2}}, {"net.inet.carp.allow", []_C_int{4, 2, 112, 1}}, {"net.inet.carp.log", []_C_int{4, 2, 112, 3}}, {"net.inet.carp.preempt", []_C_int{4, 2, 112, 2}}, {"net.inet.carp.stats", []_C_int{4, 2, 112, 4}}, {"net.inet.divert.recvspace", []_C_int{4, 2, 258, 1}}, {"net.inet.divert.sendspace", []_C_int{4, 2, 258, 2}}, {"net.inet.divert.stats", []_C_int{4, 2, 258, 3}}, {"net.inet.esp.enable", []_C_int{4, 2, 50, 1}}, {"net.inet.esp.stats", []_C_int{4, 2, 50, 4}}, {"net.inet.esp.udpencap", []_C_int{4, 2, 50, 2}}, {"net.inet.esp.udpencap_port", []_C_int{4, 2, 50, 3}}, {"net.inet.etherip.allow", []_C_int{4, 2, 97, 1}}, {"net.inet.etherip.stats", []_C_int{4, 2, 97, 2}}, {"net.inet.gre.allow", []_C_int{4, 2, 47, 1}}, {"net.inet.gre.wccp", []_C_int{4, 2, 47, 2}}, {"net.inet.icmp.bmcastecho", []_C_int{4, 2, 1, 2}}, {"net.inet.icmp.errppslimit", []_C_int{4, 2, 1, 3}}, {"net.inet.icmp.maskrepl", []_C_int{4, 2, 1, 1}}, {"net.inet.icmp.rediraccept", []_C_int{4, 2, 1, 4}}, {"net.inet.icmp.redirtimeout", []_C_int{4, 2, 1, 5}}, {"net.inet.icmp.stats", []_C_int{4, 2, 1, 7}}, {"net.inet.icmp.tstamprepl", []_C_int{4, 2, 1, 6}}, {"net.inet.igmp.stats", []_C_int{4, 2, 2, 1}}, {"net.inet.ip.arpdown", []_C_int{4, 2, 0, 40}}, {"net.inet.ip.arpqueued", []_C_int{4, 2, 0, 36}}, {"net.inet.ip.arptimeout", []_C_int{4, 2, 0, 39}}, {"net.inet.ip.encdebug", []_C_int{4, 2, 0, 12}}, {"net.inet.ip.forwarding", []_C_int{4, 2, 0, 1}}, {"net.inet.ip.ifq.congestion", []_C_int{4, 2, 0, 30, 4}}, {"net.inet.ip.ifq.drops", []_C_int{4, 2, 0, 30, 3}}, {"net.inet.ip.ifq.len", []_C_int{4, 2, 0, 30, 1}}, {"net.inet.ip.ifq.maxlen", []_C_int{4, 2, 0, 30, 2}}, {"net.inet.ip.maxqueue", []_C_int{4, 2, 0, 11}}, {"net.inet.ip.mforwarding", []_C_int{4, 2, 0, 31}}, {"net.inet.ip.mrtmfc", []_C_int{4, 2, 0, 37}}, {"net.inet.ip.mrtproto", []_C_int{4, 2, 0, 34}}, {"net.inet.ip.mrtstats", []_C_int{4, 2, 0, 35}}, {"net.inet.ip.mrtvif", []_C_int{4, 2, 0, 38}}, {"net.inet.ip.mtu", []_C_int{4, 2, 0, 4}}, {"net.inet.ip.mtudisc", []_C_int{4, 2, 0, 27}}, {"net.inet.ip.mtudisctimeout", []_C_int{4, 2, 0, 28}}, {"net.inet.ip.multipath", []_C_int{4, 2, 0, 32}}, {"net.inet.ip.portfirst", []_C_int{4, 2, 0, 7}}, {"net.inet.ip.porthifirst", []_C_int{4, 2, 0, 9}}, {"net.inet.ip.porthilast", []_C_int{4, 2, 0, 10}}, {"net.inet.ip.portlast", []_C_int{4, 2, 0, 8}}, {"net.inet.ip.redirect", []_C_int{4, 2, 0, 2}}, {"net.inet.ip.sourceroute", []_C_int{4, 2, 0, 5}}, {"net.inet.ip.stats", []_C_int{4, 2, 0, 33}}, {"net.inet.ip.ttl", []_C_int{4, 2, 0, 3}}, {"net.inet.ipcomp.enable", []_C_int{4, 2, 108, 1}}, {"net.inet.ipcomp.stats", []_C_int{4, 2, 108, 2}}, {"net.inet.ipip.allow", []_C_int{4, 2, 4, 1}}, {"net.inet.ipip.stats", []_C_int{4, 2, 4, 2}}, {"net.inet.pfsync.stats", []_C_int{4, 2, 240, 1}}, {"net.inet.tcp.ackonpush", []_C_int{4, 2, 6, 13}}, {"net.inet.tcp.always_keepalive", []_C_int{4, 2, 6, 22}}, {"net.inet.tcp.baddynamic", []_C_int{4, 2, 6, 6}}, {"net.inet.tcp.drop", []_C_int{4, 2, 6, 19}}, {"net.inet.tcp.ecn", []_C_int{4, 2, 6, 14}}, {"net.inet.tcp.ident", []_C_int{4, 2, 6, 9}}, {"net.inet.tcp.keepidle", []_C_int{4, 2, 6, 3}}, {"net.inet.tcp.keepinittime", []_C_int{4, 2, 6, 2}}, {"net.inet.tcp.keepintvl", []_C_int{4, 2, 6, 4}}, {"net.inet.tcp.mssdflt", []_C_int{4, 2, 6, 11}}, {"net.inet.tcp.reasslimit", []_C_int{4, 2, 6, 18}}, {"net.inet.tcp.rfc1323", []_C_int{4, 2, 6, 1}}, {"net.inet.tcp.rfc3390", []_C_int{4, 2, 6, 17}}, {"net.inet.tcp.rootonly", []_C_int{4, 2, 6, 24}}, {"net.inet.tcp.rstppslimit", []_C_int{4, 2, 6, 12}}, {"net.inet.tcp.sack", []_C_int{4, 2, 6, 10}}, {"net.inet.tcp.sackholelimit", []_C_int{4, 2, 6, 20}}, {"net.inet.tcp.slowhz", []_C_int{4, 2, 6, 5}}, {"net.inet.tcp.stats", []_C_int{4, 2, 6, 21}}, {"net.inet.tcp.synbucketlimit", []_C_int{4, 2, 6, 16}}, {"net.inet.tcp.syncachelimit", []_C_int{4, 2, 6, 15}}, {"net.inet.tcp.synhashsize", []_C_int{4, 2, 6, 25}}, {"net.inet.tcp.synuselimit", []_C_int{4, 2, 6, 23}}, {"net.inet.udp.baddynamic", []_C_int{4, 2, 17, 2}}, {"net.inet.udp.checksum", []_C_int{4, 2, 17, 1}}, {"net.inet.udp.recvspace", []_C_int{4, 2, 17, 3}}, {"net.inet.udp.rootonly", []_C_int{4, 2, 17, 6}}, {"net.inet.udp.sendspace", []_C_int{4, 2, 17, 4}}, {"net.inet.udp.stats", []_C_int{4, 2, 17, 5}}, {"net.inet6.divert.recvspace", []_C_int{4, 24, 86, 1}}, {"net.inet6.divert.sendspace", []_C_int{4, 24, 86, 2}}, {"net.inet6.divert.stats", []_C_int{4, 24, 86, 3}}, {"net.inet6.icmp6.errppslimit", []_C_int{4, 24, 30, 14}}, {"net.inet6.icmp6.mtudisc_hiwat", []_C_int{4, 24, 30, 16}}, {"net.inet6.icmp6.mtudisc_lowat", []_C_int{4, 24, 30, 17}}, {"net.inet6.icmp6.nd6_debug", []_C_int{4, 24, 30, 18}}, {"net.inet6.icmp6.nd6_delay", []_C_int{4, 24, 30, 8}}, {"net.inet6.icmp6.nd6_maxnudhint", []_C_int{4, 24, 30, 15}}, {"net.inet6.icmp6.nd6_mmaxtries", []_C_int{4, 24, 30, 10}}, {"net.inet6.icmp6.nd6_umaxtries", []_C_int{4, 24, 30, 9}}, {"net.inet6.icmp6.redirtimeout", []_C_int{4, 24, 30, 3}}, {"net.inet6.ip6.auto_flowlabel", []_C_int{4, 24, 17, 17}}, {"net.inet6.ip6.dad_count", []_C_int{4, 24, 17, 16}}, {"net.inet6.ip6.dad_pending", []_C_int{4, 24, 17, 49}}, {"net.inet6.ip6.defmcasthlim", []_C_int{4, 24, 17, 18}}, {"net.inet6.ip6.forwarding", []_C_int{4, 24, 17, 1}}, {"net.inet6.ip6.forwsrcrt", []_C_int{4, 24, 17, 5}}, {"net.inet6.ip6.hdrnestlimit", []_C_int{4, 24, 17, 15}}, {"net.inet6.ip6.hlim", []_C_int{4, 24, 17, 3}}, {"net.inet6.ip6.log_interval", []_C_int{4, 24, 17, 14}}, {"net.inet6.ip6.maxdynroutes", []_C_int{4, 24, 17, 48}}, {"net.inet6.ip6.maxfragpackets", []_C_int{4, 24, 17, 9}}, {"net.inet6.ip6.maxfrags", []_C_int{4, 24, 17, 41}}, {"net.inet6.ip6.mforwarding", []_C_int{4, 24, 17, 42}}, {"net.inet6.ip6.mrtmfc", []_C_int{4, 24, 17, 53}}, {"net.inet6.ip6.mrtmif", []_C_int{4, 24, 17, 52}}, {"net.inet6.ip6.mrtproto", []_C_int{4, 24, 17, 8}}, {"net.inet6.ip6.mtudisctimeout", []_C_int{4, 24, 17, 50}}, {"net.inet6.ip6.multicast_mtudisc", []_C_int{4, 24, 17, 44}}, {"net.inet6.ip6.multipath", []_C_int{4, 24, 17, 43}}, {"net.inet6.ip6.neighborgcthresh", []_C_int{4, 24, 17, 45}}, {"net.inet6.ip6.redirect", []_C_int{4, 24, 17, 2}}, {"net.inet6.ip6.soiikey", []_C_int{4, 24, 17, 54}}, {"net.inet6.ip6.sourcecheck", []_C_int{4, 24, 17, 10}}, {"net.inet6.ip6.sourcecheck_logint", []_C_int{4, 24, 17, 11}}, {"net.inet6.ip6.use_deprecated", []_C_int{4, 24, 17, 21}}, {"net.key.sadb_dump", []_C_int{4, 30, 1}}, {"net.key.spd_dump", []_C_int{4, 30, 2}}, {"net.mpls.ifq.congestion", []_C_int{4, 33, 3, 4}}, {"net.mpls.ifq.drops", []_C_int{4, 33, 3, 3}}, {"net.mpls.ifq.len", []_C_int{4, 33, 3, 1}}, {"net.mpls.ifq.maxlen", []_C_int{4, 33, 3, 2}}, {"net.mpls.mapttl_ip", []_C_int{4, 33, 5}}, {"net.mpls.mapttl_ip6", []_C_int{4, 33, 6}}, {"net.mpls.ttl", []_C_int{4, 33, 2}}, {"net.pflow.stats", []_C_int{4, 34, 1}}, {"net.pipex.enable", []_C_int{4, 35, 1}}, {"vm.anonmin", []_C_int{2, 7}}, {"vm.loadavg", []_C_int{2, 2}}, {"vm.malloc_conf", []_C_int{2, 12}}, {"vm.maxslp", []_C_int{2, 10}}, {"vm.nkmempages", []_C_int{2, 6}}, {"vm.psstrings", []_C_int{2, 3}}, {"vm.swapencrypt.enable", []_C_int{2, 5, 0}}, {"vm.swapencrypt.keyscreated", []_C_int{2, 5, 1}}, {"vm.swapencrypt.keysdeleted", []_C_int{2, 5, 2}}, {"vm.uspace", []_C_int{2, 11}}, {"vm.uvmexp", []_C_int{2, 4}}, {"vm.vmmeter", []_C_int{2, 1}}, {"vm.vnodemin", []_C_int{2, 9}}, {"vm.vtextmin", []_C_int{2, 8}}, } ================================================ FILE: vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm64.go ================================================ // go run mksysctl_openbsd.go // Code generated by the command above; DO NOT EDIT. //go:build arm64 && openbsd package unix type mibentry struct { ctlname string ctloid []_C_int } var sysctlMib = []mibentry{ {"ddb.console", []_C_int{9, 6}}, {"ddb.log", []_C_int{9, 7}}, {"ddb.max_line", []_C_int{9, 3}}, {"ddb.max_width", []_C_int{9, 2}}, {"ddb.panic", []_C_int{9, 5}}, {"ddb.profile", []_C_int{9, 9}}, {"ddb.radix", []_C_int{9, 1}}, {"ddb.tab_stop_width", []_C_int{9, 4}}, {"ddb.trigger", []_C_int{9, 8}}, {"fs.posix.setuid", []_C_int{3, 1, 1}}, {"hw.allowpowerdown", []_C_int{6, 22}}, {"hw.byteorder", []_C_int{6, 4}}, {"hw.cpuspeed", []_C_int{6, 12}}, {"hw.diskcount", []_C_int{6, 10}}, {"hw.disknames", []_C_int{6, 8}}, {"hw.diskstats", []_C_int{6, 9}}, {"hw.machine", []_C_int{6, 1}}, {"hw.model", []_C_int{6, 2}}, {"hw.ncpu", []_C_int{6, 3}}, {"hw.ncpufound", []_C_int{6, 21}}, {"hw.ncpuonline", []_C_int{6, 25}}, {"hw.pagesize", []_C_int{6, 7}}, {"hw.perfpolicy", []_C_int{6, 23}}, {"hw.physmem", []_C_int{6, 19}}, {"hw.power", []_C_int{6, 26}}, {"hw.product", []_C_int{6, 15}}, {"hw.serialno", []_C_int{6, 17}}, {"hw.setperf", []_C_int{6, 13}}, {"hw.smt", []_C_int{6, 24}}, {"hw.usermem", []_C_int{6, 20}}, {"hw.uuid", []_C_int{6, 18}}, {"hw.vendor", []_C_int{6, 14}}, {"hw.version", []_C_int{6, 16}}, {"kern.allowdt", []_C_int{1, 65}}, {"kern.allowkmem", []_C_int{1, 52}}, {"kern.argmax", []_C_int{1, 8}}, {"kern.audio", []_C_int{1, 84}}, {"kern.boottime", []_C_int{1, 21}}, {"kern.bufcachepercent", []_C_int{1, 72}}, {"kern.ccpu", []_C_int{1, 45}}, {"kern.clockrate", []_C_int{1, 12}}, {"kern.consbuf", []_C_int{1, 83}}, {"kern.consbufsize", []_C_int{1, 82}}, {"kern.consdev", []_C_int{1, 75}}, {"kern.cp_time", []_C_int{1, 40}}, {"kern.cp_time2", []_C_int{1, 71}}, {"kern.cpustats", []_C_int{1, 85}}, {"kern.domainname", []_C_int{1, 22}}, {"kern.file", []_C_int{1, 73}}, {"kern.forkstat", []_C_int{1, 42}}, {"kern.fscale", []_C_int{1, 46}}, {"kern.fsync", []_C_int{1, 33}}, {"kern.global_ptrace", []_C_int{1, 81}}, {"kern.hostid", []_C_int{1, 11}}, {"kern.hostname", []_C_int{1, 10}}, {"kern.intrcnt.nintrcnt", []_C_int{1, 63, 1}}, {"kern.job_control", []_C_int{1, 19}}, {"kern.malloc.buckets", []_C_int{1, 39, 1}}, {"kern.malloc.kmemnames", []_C_int{1, 39, 3}}, {"kern.maxclusters", []_C_int{1, 67}}, {"kern.maxfiles", []_C_int{1, 7}}, {"kern.maxlocksperuid", []_C_int{1, 70}}, {"kern.maxpartitions", []_C_int{1, 23}}, {"kern.maxproc", []_C_int{1, 6}}, {"kern.maxthread", []_C_int{1, 25}}, {"kern.maxvnodes", []_C_int{1, 5}}, {"kern.mbstat", []_C_int{1, 59}}, {"kern.msgbuf", []_C_int{1, 48}}, {"kern.msgbufsize", []_C_int{1, 38}}, {"kern.nchstats", []_C_int{1, 41}}, {"kern.netlivelocks", []_C_int{1, 76}}, {"kern.nfiles", []_C_int{1, 56}}, {"kern.ngroups", []_C_int{1, 18}}, {"kern.nosuidcoredump", []_C_int{1, 32}}, {"kern.nprocs", []_C_int{1, 47}}, {"kern.nthreads", []_C_int{1, 26}}, {"kern.numvnodes", []_C_int{1, 58}}, {"kern.osrelease", []_C_int{1, 2}}, {"kern.osrevision", []_C_int{1, 3}}, {"kern.ostype", []_C_int{1, 1}}, {"kern.osversion", []_C_int{1, 27}}, {"kern.pfstatus", []_C_int{1, 86}}, {"kern.pool_debug", []_C_int{1, 77}}, {"kern.posix1version", []_C_int{1, 17}}, {"kern.proc", []_C_int{1, 66}}, {"kern.rawpartition", []_C_int{1, 24}}, {"kern.saved_ids", []_C_int{1, 20}}, {"kern.securelevel", []_C_int{1, 9}}, {"kern.seminfo", []_C_int{1, 61}}, {"kern.shminfo", []_C_int{1, 62}}, {"kern.somaxconn", []_C_int{1, 28}}, {"kern.sominconn", []_C_int{1, 29}}, {"kern.splassert", []_C_int{1, 54}}, {"kern.stackgap_random", []_C_int{1, 50}}, {"kern.sysvipc_info", []_C_int{1, 51}}, {"kern.sysvmsg", []_C_int{1, 34}}, {"kern.sysvsem", []_C_int{1, 35}}, {"kern.sysvshm", []_C_int{1, 36}}, {"kern.timecounter.choice", []_C_int{1, 69, 4}}, {"kern.timecounter.hardware", []_C_int{1, 69, 3}}, {"kern.timecounter.tick", []_C_int{1, 69, 1}}, {"kern.timecounter.timestepwarnings", []_C_int{1, 69, 2}}, {"kern.timeout_stats", []_C_int{1, 87}}, {"kern.tty.tk_cancc", []_C_int{1, 44, 4}}, {"kern.tty.tk_nin", []_C_int{1, 44, 1}}, {"kern.tty.tk_nout", []_C_int{1, 44, 2}}, {"kern.tty.tk_rawcc", []_C_int{1, 44, 3}}, {"kern.tty.ttyinfo", []_C_int{1, 44, 5}}, {"kern.ttycount", []_C_int{1, 57}}, {"kern.utc_offset", []_C_int{1, 88}}, {"kern.version", []_C_int{1, 4}}, {"kern.video", []_C_int{1, 89}}, {"kern.watchdog.auto", []_C_int{1, 64, 2}}, {"kern.watchdog.period", []_C_int{1, 64, 1}}, {"kern.witnesswatch", []_C_int{1, 53}}, {"kern.wxabort", []_C_int{1, 74}}, {"net.bpf.bufsize", []_C_int{4, 31, 1}}, {"net.bpf.maxbufsize", []_C_int{4, 31, 2}}, {"net.inet.ah.enable", []_C_int{4, 2, 51, 1}}, {"net.inet.ah.stats", []_C_int{4, 2, 51, 2}}, {"net.inet.carp.allow", []_C_int{4, 2, 112, 1}}, {"net.inet.carp.log", []_C_int{4, 2, 112, 3}}, {"net.inet.carp.preempt", []_C_int{4, 2, 112, 2}}, {"net.inet.carp.stats", []_C_int{4, 2, 112, 4}}, {"net.inet.divert.recvspace", []_C_int{4, 2, 258, 1}}, {"net.inet.divert.sendspace", []_C_int{4, 2, 258, 2}}, {"net.inet.divert.stats", []_C_int{4, 2, 258, 3}}, {"net.inet.esp.enable", []_C_int{4, 2, 50, 1}}, {"net.inet.esp.stats", []_C_int{4, 2, 50, 4}}, {"net.inet.esp.udpencap", []_C_int{4, 2, 50, 2}}, {"net.inet.esp.udpencap_port", []_C_int{4, 2, 50, 3}}, {"net.inet.etherip.allow", []_C_int{4, 2, 97, 1}}, {"net.inet.etherip.stats", []_C_int{4, 2, 97, 2}}, {"net.inet.gre.allow", []_C_int{4, 2, 47, 1}}, {"net.inet.gre.wccp", []_C_int{4, 2, 47, 2}}, {"net.inet.icmp.bmcastecho", []_C_int{4, 2, 1, 2}}, {"net.inet.icmp.errppslimit", []_C_int{4, 2, 1, 3}}, {"net.inet.icmp.maskrepl", []_C_int{4, 2, 1, 1}}, {"net.inet.icmp.rediraccept", []_C_int{4, 2, 1, 4}}, {"net.inet.icmp.redirtimeout", []_C_int{4, 2, 1, 5}}, {"net.inet.icmp.stats", []_C_int{4, 2, 1, 7}}, {"net.inet.icmp.tstamprepl", []_C_int{4, 2, 1, 6}}, {"net.inet.igmp.stats", []_C_int{4, 2, 2, 1}}, {"net.inet.ip.arpdown", []_C_int{4, 2, 0, 40}}, {"net.inet.ip.arpqueued", []_C_int{4, 2, 0, 36}}, {"net.inet.ip.arptimeout", []_C_int{4, 2, 0, 39}}, {"net.inet.ip.encdebug", []_C_int{4, 2, 0, 12}}, {"net.inet.ip.forwarding", []_C_int{4, 2, 0, 1}}, {"net.inet.ip.ifq.congestion", []_C_int{4, 2, 0, 30, 4}}, {"net.inet.ip.ifq.drops", []_C_int{4, 2, 0, 30, 3}}, {"net.inet.ip.ifq.len", []_C_int{4, 2, 0, 30, 1}}, {"net.inet.ip.ifq.maxlen", []_C_int{4, 2, 0, 30, 2}}, {"net.inet.ip.maxqueue", []_C_int{4, 2, 0, 11}}, {"net.inet.ip.mforwarding", []_C_int{4, 2, 0, 31}}, {"net.inet.ip.mrtmfc", []_C_int{4, 2, 0, 37}}, {"net.inet.ip.mrtproto", []_C_int{4, 2, 0, 34}}, {"net.inet.ip.mrtstats", []_C_int{4, 2, 0, 35}}, {"net.inet.ip.mrtvif", []_C_int{4, 2, 0, 38}}, {"net.inet.ip.mtu", []_C_int{4, 2, 0, 4}}, {"net.inet.ip.mtudisc", []_C_int{4, 2, 0, 27}}, {"net.inet.ip.mtudisctimeout", []_C_int{4, 2, 0, 28}}, {"net.inet.ip.multipath", []_C_int{4, 2, 0, 32}}, {"net.inet.ip.portfirst", []_C_int{4, 2, 0, 7}}, {"net.inet.ip.porthifirst", []_C_int{4, 2, 0, 9}}, {"net.inet.ip.porthilast", []_C_int{4, 2, 0, 10}}, {"net.inet.ip.portlast", []_C_int{4, 2, 0, 8}}, {"net.inet.ip.redirect", []_C_int{4, 2, 0, 2}}, {"net.inet.ip.sourceroute", []_C_int{4, 2, 0, 5}}, {"net.inet.ip.stats", []_C_int{4, 2, 0, 33}}, {"net.inet.ip.ttl", []_C_int{4, 2, 0, 3}}, {"net.inet.ipcomp.enable", []_C_int{4, 2, 108, 1}}, {"net.inet.ipcomp.stats", []_C_int{4, 2, 108, 2}}, {"net.inet.ipip.allow", []_C_int{4, 2, 4, 1}}, {"net.inet.ipip.stats", []_C_int{4, 2, 4, 2}}, {"net.inet.pfsync.stats", []_C_int{4, 2, 240, 1}}, {"net.inet.tcp.ackonpush", []_C_int{4, 2, 6, 13}}, {"net.inet.tcp.always_keepalive", []_C_int{4, 2, 6, 22}}, {"net.inet.tcp.baddynamic", []_C_int{4, 2, 6, 6}}, {"net.inet.tcp.drop", []_C_int{4, 2, 6, 19}}, {"net.inet.tcp.ecn", []_C_int{4, 2, 6, 14}}, {"net.inet.tcp.ident", []_C_int{4, 2, 6, 9}}, {"net.inet.tcp.keepidle", []_C_int{4, 2, 6, 3}}, {"net.inet.tcp.keepinittime", []_C_int{4, 2, 6, 2}}, {"net.inet.tcp.keepintvl", []_C_int{4, 2, 6, 4}}, {"net.inet.tcp.mssdflt", []_C_int{4, 2, 6, 11}}, {"net.inet.tcp.reasslimit", []_C_int{4, 2, 6, 18}}, {"net.inet.tcp.rfc1323", []_C_int{4, 2, 6, 1}}, {"net.inet.tcp.rfc3390", []_C_int{4, 2, 6, 17}}, {"net.inet.tcp.rootonly", []_C_int{4, 2, 6, 24}}, {"net.inet.tcp.rstppslimit", []_C_int{4, 2, 6, 12}}, {"net.inet.tcp.sack", []_C_int{4, 2, 6, 10}}, {"net.inet.tcp.sackholelimit", []_C_int{4, 2, 6, 20}}, {"net.inet.tcp.slowhz", []_C_int{4, 2, 6, 5}}, {"net.inet.tcp.stats", []_C_int{4, 2, 6, 21}}, {"net.inet.tcp.synbucketlimit", []_C_int{4, 2, 6, 16}}, {"net.inet.tcp.syncachelimit", []_C_int{4, 2, 6, 15}}, {"net.inet.tcp.synhashsize", []_C_int{4, 2, 6, 25}}, {"net.inet.tcp.synuselimit", []_C_int{4, 2, 6, 23}}, {"net.inet.udp.baddynamic", []_C_int{4, 2, 17, 2}}, {"net.inet.udp.checksum", []_C_int{4, 2, 17, 1}}, {"net.inet.udp.recvspace", []_C_int{4, 2, 17, 3}}, {"net.inet.udp.rootonly", []_C_int{4, 2, 17, 6}}, {"net.inet.udp.sendspace", []_C_int{4, 2, 17, 4}}, {"net.inet.udp.stats", []_C_int{4, 2, 17, 5}}, {"net.inet6.divert.recvspace", []_C_int{4, 24, 86, 1}}, {"net.inet6.divert.sendspace", []_C_int{4, 24, 86, 2}}, {"net.inet6.divert.stats", []_C_int{4, 24, 86, 3}}, {"net.inet6.icmp6.errppslimit", []_C_int{4, 24, 30, 14}}, {"net.inet6.icmp6.mtudisc_hiwat", []_C_int{4, 24, 30, 16}}, {"net.inet6.icmp6.mtudisc_lowat", []_C_int{4, 24, 30, 17}}, {"net.inet6.icmp6.nd6_debug", []_C_int{4, 24, 30, 18}}, {"net.inet6.icmp6.nd6_delay", []_C_int{4, 24, 30, 8}}, {"net.inet6.icmp6.nd6_maxnudhint", []_C_int{4, 24, 30, 15}}, {"net.inet6.icmp6.nd6_mmaxtries", []_C_int{4, 24, 30, 10}}, {"net.inet6.icmp6.nd6_umaxtries", []_C_int{4, 24, 30, 9}}, {"net.inet6.icmp6.redirtimeout", []_C_int{4, 24, 30, 3}}, {"net.inet6.ip6.auto_flowlabel", []_C_int{4, 24, 17, 17}}, {"net.inet6.ip6.dad_count", []_C_int{4, 24, 17, 16}}, {"net.inet6.ip6.dad_pending", []_C_int{4, 24, 17, 49}}, {"net.inet6.ip6.defmcasthlim", []_C_int{4, 24, 17, 18}}, {"net.inet6.ip6.forwarding", []_C_int{4, 24, 17, 1}}, {"net.inet6.ip6.forwsrcrt", []_C_int{4, 24, 17, 5}}, {"net.inet6.ip6.hdrnestlimit", []_C_int{4, 24, 17, 15}}, {"net.inet6.ip6.hlim", []_C_int{4, 24, 17, 3}}, {"net.inet6.ip6.log_interval", []_C_int{4, 24, 17, 14}}, {"net.inet6.ip6.maxdynroutes", []_C_int{4, 24, 17, 48}}, {"net.inet6.ip6.maxfragpackets", []_C_int{4, 24, 17, 9}}, {"net.inet6.ip6.maxfrags", []_C_int{4, 24, 17, 41}}, {"net.inet6.ip6.mforwarding", []_C_int{4, 24, 17, 42}}, {"net.inet6.ip6.mrtmfc", []_C_int{4, 24, 17, 53}}, {"net.inet6.ip6.mrtmif", []_C_int{4, 24, 17, 52}}, {"net.inet6.ip6.mrtproto", []_C_int{4, 24, 17, 8}}, {"net.inet6.ip6.mtudisctimeout", []_C_int{4, 24, 17, 50}}, {"net.inet6.ip6.multicast_mtudisc", []_C_int{4, 24, 17, 44}}, {"net.inet6.ip6.multipath", []_C_int{4, 24, 17, 43}}, {"net.inet6.ip6.neighborgcthresh", []_C_int{4, 24, 17, 45}}, {"net.inet6.ip6.redirect", []_C_int{4, 24, 17, 2}}, {"net.inet6.ip6.soiikey", []_C_int{4, 24, 17, 54}}, {"net.inet6.ip6.sourcecheck", []_C_int{4, 24, 17, 10}}, {"net.inet6.ip6.sourcecheck_logint", []_C_int{4, 24, 17, 11}}, {"net.inet6.ip6.use_deprecated", []_C_int{4, 24, 17, 21}}, {"net.key.sadb_dump", []_C_int{4, 30, 1}}, {"net.key.spd_dump", []_C_int{4, 30, 2}}, {"net.mpls.ifq.congestion", []_C_int{4, 33, 3, 4}}, {"net.mpls.ifq.drops", []_C_int{4, 33, 3, 3}}, {"net.mpls.ifq.len", []_C_int{4, 33, 3, 1}}, {"net.mpls.ifq.maxlen", []_C_int{4, 33, 3, 2}}, {"net.mpls.mapttl_ip", []_C_int{4, 33, 5}}, {"net.mpls.mapttl_ip6", []_C_int{4, 33, 6}}, {"net.mpls.ttl", []_C_int{4, 33, 2}}, {"net.pflow.stats", []_C_int{4, 34, 1}}, {"net.pipex.enable", []_C_int{4, 35, 1}}, {"vm.anonmin", []_C_int{2, 7}}, {"vm.loadavg", []_C_int{2, 2}}, {"vm.malloc_conf", []_C_int{2, 12}}, {"vm.maxslp", []_C_int{2, 10}}, {"vm.nkmempages", []_C_int{2, 6}}, {"vm.psstrings", []_C_int{2, 3}}, {"vm.swapencrypt.enable", []_C_int{2, 5, 0}}, {"vm.swapencrypt.keyscreated", []_C_int{2, 5, 1}}, {"vm.swapencrypt.keysdeleted", []_C_int{2, 5, 2}}, {"vm.uspace", []_C_int{2, 11}}, {"vm.uvmexp", []_C_int{2, 4}}, {"vm.vmmeter", []_C_int{2, 1}}, {"vm.vnodemin", []_C_int{2, 9}}, {"vm.vtextmin", []_C_int{2, 8}}, } ================================================ FILE: vendor/golang.org/x/sys/unix/zsysctl_openbsd_mips64.go ================================================ // go run mksysctl_openbsd.go // Code generated by the command above; DO NOT EDIT. //go:build mips64 && openbsd package unix type mibentry struct { ctlname string ctloid []_C_int } var sysctlMib = []mibentry{ {"ddb.console", []_C_int{9, 6}}, {"ddb.log", []_C_int{9, 7}}, {"ddb.max_line", []_C_int{9, 3}}, {"ddb.max_width", []_C_int{9, 2}}, {"ddb.panic", []_C_int{9, 5}}, {"ddb.profile", []_C_int{9, 9}}, {"ddb.radix", []_C_int{9, 1}}, {"ddb.tab_stop_width", []_C_int{9, 4}}, {"ddb.trigger", []_C_int{9, 8}}, {"fs.posix.setuid", []_C_int{3, 1, 1}}, {"hw.allowpowerdown", []_C_int{6, 22}}, {"hw.byteorder", []_C_int{6, 4}}, {"hw.cpuspeed", []_C_int{6, 12}}, {"hw.diskcount", []_C_int{6, 10}}, {"hw.disknames", []_C_int{6, 8}}, {"hw.diskstats", []_C_int{6, 9}}, {"hw.machine", []_C_int{6, 1}}, {"hw.model", []_C_int{6, 2}}, {"hw.ncpu", []_C_int{6, 3}}, {"hw.ncpufound", []_C_int{6, 21}}, {"hw.ncpuonline", []_C_int{6, 25}}, {"hw.pagesize", []_C_int{6, 7}}, {"hw.perfpolicy", []_C_int{6, 23}}, {"hw.physmem", []_C_int{6, 19}}, {"hw.power", []_C_int{6, 26}}, {"hw.product", []_C_int{6, 15}}, {"hw.serialno", []_C_int{6, 17}}, {"hw.setperf", []_C_int{6, 13}}, {"hw.smt", []_C_int{6, 24}}, {"hw.usermem", []_C_int{6, 20}}, {"hw.uuid", []_C_int{6, 18}}, {"hw.vendor", []_C_int{6, 14}}, {"hw.version", []_C_int{6, 16}}, {"kern.allowdt", []_C_int{1, 65}}, {"kern.allowkmem", []_C_int{1, 52}}, {"kern.argmax", []_C_int{1, 8}}, {"kern.audio", []_C_int{1, 84}}, {"kern.boottime", []_C_int{1, 21}}, {"kern.bufcachepercent", []_C_int{1, 72}}, {"kern.ccpu", []_C_int{1, 45}}, {"kern.clockrate", []_C_int{1, 12}}, {"kern.consbuf", []_C_int{1, 83}}, {"kern.consbufsize", []_C_int{1, 82}}, {"kern.consdev", []_C_int{1, 75}}, {"kern.cp_time", []_C_int{1, 40}}, {"kern.cp_time2", []_C_int{1, 71}}, {"kern.cpustats", []_C_int{1, 85}}, {"kern.domainname", []_C_int{1, 22}}, {"kern.file", []_C_int{1, 73}}, {"kern.forkstat", []_C_int{1, 42}}, {"kern.fscale", []_C_int{1, 46}}, {"kern.fsync", []_C_int{1, 33}}, {"kern.global_ptrace", []_C_int{1, 81}}, {"kern.hostid", []_C_int{1, 11}}, {"kern.hostname", []_C_int{1, 10}}, {"kern.intrcnt.nintrcnt", []_C_int{1, 63, 1}}, {"kern.job_control", []_C_int{1, 19}}, {"kern.malloc.buckets", []_C_int{1, 39, 1}}, {"kern.malloc.kmemnames", []_C_int{1, 39, 3}}, {"kern.maxclusters", []_C_int{1, 67}}, {"kern.maxfiles", []_C_int{1, 7}}, {"kern.maxlocksperuid", []_C_int{1, 70}}, {"kern.maxpartitions", []_C_int{1, 23}}, {"kern.maxproc", []_C_int{1, 6}}, {"kern.maxthread", []_C_int{1, 25}}, {"kern.maxvnodes", []_C_int{1, 5}}, {"kern.mbstat", []_C_int{1, 59}}, {"kern.msgbuf", []_C_int{1, 48}}, {"kern.msgbufsize", []_C_int{1, 38}}, {"kern.nchstats", []_C_int{1, 41}}, {"kern.netlivelocks", []_C_int{1, 76}}, {"kern.nfiles", []_C_int{1, 56}}, {"kern.ngroups", []_C_int{1, 18}}, {"kern.nosuidcoredump", []_C_int{1, 32}}, {"kern.nprocs", []_C_int{1, 47}}, {"kern.nthreads", []_C_int{1, 26}}, {"kern.numvnodes", []_C_int{1, 58}}, {"kern.osrelease", []_C_int{1, 2}}, {"kern.osrevision", []_C_int{1, 3}}, {"kern.ostype", []_C_int{1, 1}}, {"kern.osversion", []_C_int{1, 27}}, {"kern.pfstatus", []_C_int{1, 86}}, {"kern.pool_debug", []_C_int{1, 77}}, {"kern.posix1version", []_C_int{1, 17}}, {"kern.proc", []_C_int{1, 66}}, {"kern.rawpartition", []_C_int{1, 24}}, {"kern.saved_ids", []_C_int{1, 20}}, {"kern.securelevel", []_C_int{1, 9}}, {"kern.seminfo", []_C_int{1, 61}}, {"kern.shminfo", []_C_int{1, 62}}, {"kern.somaxconn", []_C_int{1, 28}}, {"kern.sominconn", []_C_int{1, 29}}, {"kern.splassert", []_C_int{1, 54}}, {"kern.stackgap_random", []_C_int{1, 50}}, {"kern.sysvipc_info", []_C_int{1, 51}}, {"kern.sysvmsg", []_C_int{1, 34}}, {"kern.sysvsem", []_C_int{1, 35}}, {"kern.sysvshm", []_C_int{1, 36}}, {"kern.timecounter.choice", []_C_int{1, 69, 4}}, {"kern.timecounter.hardware", []_C_int{1, 69, 3}}, {"kern.timecounter.tick", []_C_int{1, 69, 1}}, {"kern.timecounter.timestepwarnings", []_C_int{1, 69, 2}}, {"kern.timeout_stats", []_C_int{1, 87}}, {"kern.tty.tk_cancc", []_C_int{1, 44, 4}}, {"kern.tty.tk_nin", []_C_int{1, 44, 1}}, {"kern.tty.tk_nout", []_C_int{1, 44, 2}}, {"kern.tty.tk_rawcc", []_C_int{1, 44, 3}}, {"kern.tty.ttyinfo", []_C_int{1, 44, 5}}, {"kern.ttycount", []_C_int{1, 57}}, {"kern.utc_offset", []_C_int{1, 88}}, {"kern.version", []_C_int{1, 4}}, {"kern.video", []_C_int{1, 89}}, {"kern.watchdog.auto", []_C_int{1, 64, 2}}, {"kern.watchdog.period", []_C_int{1, 64, 1}}, {"kern.witnesswatch", []_C_int{1, 53}}, {"kern.wxabort", []_C_int{1, 74}}, {"net.bpf.bufsize", []_C_int{4, 31, 1}}, {"net.bpf.maxbufsize", []_C_int{4, 31, 2}}, {"net.inet.ah.enable", []_C_int{4, 2, 51, 1}}, {"net.inet.ah.stats", []_C_int{4, 2, 51, 2}}, {"net.inet.carp.allow", []_C_int{4, 2, 112, 1}}, {"net.inet.carp.log", []_C_int{4, 2, 112, 3}}, {"net.inet.carp.preempt", []_C_int{4, 2, 112, 2}}, {"net.inet.carp.stats", []_C_int{4, 2, 112, 4}}, {"net.inet.divert.recvspace", []_C_int{4, 2, 258, 1}}, {"net.inet.divert.sendspace", []_C_int{4, 2, 258, 2}}, {"net.inet.divert.stats", []_C_int{4, 2, 258, 3}}, {"net.inet.esp.enable", []_C_int{4, 2, 50, 1}}, {"net.inet.esp.stats", []_C_int{4, 2, 50, 4}}, {"net.inet.esp.udpencap", []_C_int{4, 2, 50, 2}}, {"net.inet.esp.udpencap_port", []_C_int{4, 2, 50, 3}}, {"net.inet.etherip.allow", []_C_int{4, 2, 97, 1}}, {"net.inet.etherip.stats", []_C_int{4, 2, 97, 2}}, {"net.inet.gre.allow", []_C_int{4, 2, 47, 1}}, {"net.inet.gre.wccp", []_C_int{4, 2, 47, 2}}, {"net.inet.icmp.bmcastecho", []_C_int{4, 2, 1, 2}}, {"net.inet.icmp.errppslimit", []_C_int{4, 2, 1, 3}}, {"net.inet.icmp.maskrepl", []_C_int{4, 2, 1, 1}}, {"net.inet.icmp.rediraccept", []_C_int{4, 2, 1, 4}}, {"net.inet.icmp.redirtimeout", []_C_int{4, 2, 1, 5}}, {"net.inet.icmp.stats", []_C_int{4, 2, 1, 7}}, {"net.inet.icmp.tstamprepl", []_C_int{4, 2, 1, 6}}, {"net.inet.igmp.stats", []_C_int{4, 2, 2, 1}}, {"net.inet.ip.arpdown", []_C_int{4, 2, 0, 40}}, {"net.inet.ip.arpqueued", []_C_int{4, 2, 0, 36}}, {"net.inet.ip.arptimeout", []_C_int{4, 2, 0, 39}}, {"net.inet.ip.encdebug", []_C_int{4, 2, 0, 12}}, {"net.inet.ip.forwarding", []_C_int{4, 2, 0, 1}}, {"net.inet.ip.ifq.congestion", []_C_int{4, 2, 0, 30, 4}}, {"net.inet.ip.ifq.drops", []_C_int{4, 2, 0, 30, 3}}, {"net.inet.ip.ifq.len", []_C_int{4, 2, 0, 30, 1}}, {"net.inet.ip.ifq.maxlen", []_C_int{4, 2, 0, 30, 2}}, {"net.inet.ip.maxqueue", []_C_int{4, 2, 0, 11}}, {"net.inet.ip.mforwarding", []_C_int{4, 2, 0, 31}}, {"net.inet.ip.mrtmfc", []_C_int{4, 2, 0, 37}}, {"net.inet.ip.mrtproto", []_C_int{4, 2, 0, 34}}, {"net.inet.ip.mrtstats", []_C_int{4, 2, 0, 35}}, {"net.inet.ip.mrtvif", []_C_int{4, 2, 0, 38}}, {"net.inet.ip.mtu", []_C_int{4, 2, 0, 4}}, {"net.inet.ip.mtudisc", []_C_int{4, 2, 0, 27}}, {"net.inet.ip.mtudisctimeout", []_C_int{4, 2, 0, 28}}, {"net.inet.ip.multipath", []_C_int{4, 2, 0, 32}}, {"net.inet.ip.portfirst", []_C_int{4, 2, 0, 7}}, {"net.inet.ip.porthifirst", []_C_int{4, 2, 0, 9}}, {"net.inet.ip.porthilast", []_C_int{4, 2, 0, 10}}, {"net.inet.ip.portlast", []_C_int{4, 2, 0, 8}}, {"net.inet.ip.redirect", []_C_int{4, 2, 0, 2}}, {"net.inet.ip.sourceroute", []_C_int{4, 2, 0, 5}}, {"net.inet.ip.stats", []_C_int{4, 2, 0, 33}}, {"net.inet.ip.ttl", []_C_int{4, 2, 0, 3}}, {"net.inet.ipcomp.enable", []_C_int{4, 2, 108, 1}}, {"net.inet.ipcomp.stats", []_C_int{4, 2, 108, 2}}, {"net.inet.ipip.allow", []_C_int{4, 2, 4, 1}}, {"net.inet.ipip.stats", []_C_int{4, 2, 4, 2}}, {"net.inet.pfsync.stats", []_C_int{4, 2, 240, 1}}, {"net.inet.tcp.ackonpush", []_C_int{4, 2, 6, 13}}, {"net.inet.tcp.always_keepalive", []_C_int{4, 2, 6, 22}}, {"net.inet.tcp.baddynamic", []_C_int{4, 2, 6, 6}}, {"net.inet.tcp.drop", []_C_int{4, 2, 6, 19}}, {"net.inet.tcp.ecn", []_C_int{4, 2, 6, 14}}, {"net.inet.tcp.ident", []_C_int{4, 2, 6, 9}}, {"net.inet.tcp.keepidle", []_C_int{4, 2, 6, 3}}, {"net.inet.tcp.keepinittime", []_C_int{4, 2, 6, 2}}, {"net.inet.tcp.keepintvl", []_C_int{4, 2, 6, 4}}, {"net.inet.tcp.mssdflt", []_C_int{4, 2, 6, 11}}, {"net.inet.tcp.reasslimit", []_C_int{4, 2, 6, 18}}, {"net.inet.tcp.rfc1323", []_C_int{4, 2, 6, 1}}, {"net.inet.tcp.rfc3390", []_C_int{4, 2, 6, 17}}, {"net.inet.tcp.rootonly", []_C_int{4, 2, 6, 24}}, {"net.inet.tcp.rstppslimit", []_C_int{4, 2, 6, 12}}, {"net.inet.tcp.sack", []_C_int{4, 2, 6, 10}}, {"net.inet.tcp.sackholelimit", []_C_int{4, 2, 6, 20}}, {"net.inet.tcp.slowhz", []_C_int{4, 2, 6, 5}}, {"net.inet.tcp.stats", []_C_int{4, 2, 6, 21}}, {"net.inet.tcp.synbucketlimit", []_C_int{4, 2, 6, 16}}, {"net.inet.tcp.syncachelimit", []_C_int{4, 2, 6, 15}}, {"net.inet.tcp.synhashsize", []_C_int{4, 2, 6, 25}}, {"net.inet.tcp.synuselimit", []_C_int{4, 2, 6, 23}}, {"net.inet.udp.baddynamic", []_C_int{4, 2, 17, 2}}, {"net.inet.udp.checksum", []_C_int{4, 2, 17, 1}}, {"net.inet.udp.recvspace", []_C_int{4, 2, 17, 3}}, {"net.inet.udp.rootonly", []_C_int{4, 2, 17, 6}}, {"net.inet.udp.sendspace", []_C_int{4, 2, 17, 4}}, {"net.inet.udp.stats", []_C_int{4, 2, 17, 5}}, {"net.inet6.divert.recvspace", []_C_int{4, 24, 86, 1}}, {"net.inet6.divert.sendspace", []_C_int{4, 24, 86, 2}}, {"net.inet6.divert.stats", []_C_int{4, 24, 86, 3}}, {"net.inet6.icmp6.errppslimit", []_C_int{4, 24, 30, 14}}, {"net.inet6.icmp6.mtudisc_hiwat", []_C_int{4, 24, 30, 16}}, {"net.inet6.icmp6.mtudisc_lowat", []_C_int{4, 24, 30, 17}}, {"net.inet6.icmp6.nd6_debug", []_C_int{4, 24, 30, 18}}, {"net.inet6.icmp6.nd6_delay", []_C_int{4, 24, 30, 8}}, {"net.inet6.icmp6.nd6_maxnudhint", []_C_int{4, 24, 30, 15}}, {"net.inet6.icmp6.nd6_mmaxtries", []_C_int{4, 24, 30, 10}}, {"net.inet6.icmp6.nd6_umaxtries", []_C_int{4, 24, 30, 9}}, {"net.inet6.icmp6.redirtimeout", []_C_int{4, 24, 30, 3}}, {"net.inet6.ip6.auto_flowlabel", []_C_int{4, 24, 17, 17}}, {"net.inet6.ip6.dad_count", []_C_int{4, 24, 17, 16}}, {"net.inet6.ip6.dad_pending", []_C_int{4, 24, 17, 49}}, {"net.inet6.ip6.defmcasthlim", []_C_int{4, 24, 17, 18}}, {"net.inet6.ip6.forwarding", []_C_int{4, 24, 17, 1}}, {"net.inet6.ip6.forwsrcrt", []_C_int{4, 24, 17, 5}}, {"net.inet6.ip6.hdrnestlimit", []_C_int{4, 24, 17, 15}}, {"net.inet6.ip6.hlim", []_C_int{4, 24, 17, 3}}, {"net.inet6.ip6.log_interval", []_C_int{4, 24, 17, 14}}, {"net.inet6.ip6.maxdynroutes", []_C_int{4, 24, 17, 48}}, {"net.inet6.ip6.maxfragpackets", []_C_int{4, 24, 17, 9}}, {"net.inet6.ip6.maxfrags", []_C_int{4, 24, 17, 41}}, {"net.inet6.ip6.mforwarding", []_C_int{4, 24, 17, 42}}, {"net.inet6.ip6.mrtmfc", []_C_int{4, 24, 17, 53}}, {"net.inet6.ip6.mrtmif", []_C_int{4, 24, 17, 52}}, {"net.inet6.ip6.mrtproto", []_C_int{4, 24, 17, 8}}, {"net.inet6.ip6.mtudisctimeout", []_C_int{4, 24, 17, 50}}, {"net.inet6.ip6.multicast_mtudisc", []_C_int{4, 24, 17, 44}}, {"net.inet6.ip6.multipath", []_C_int{4, 24, 17, 43}}, {"net.inet6.ip6.neighborgcthresh", []_C_int{4, 24, 17, 45}}, {"net.inet6.ip6.redirect", []_C_int{4, 24, 17, 2}}, {"net.inet6.ip6.soiikey", []_C_int{4, 24, 17, 54}}, {"net.inet6.ip6.sourcecheck", []_C_int{4, 24, 17, 10}}, {"net.inet6.ip6.sourcecheck_logint", []_C_int{4, 24, 17, 11}}, {"net.inet6.ip6.use_deprecated", []_C_int{4, 24, 17, 21}}, {"net.key.sadb_dump", []_C_int{4, 30, 1}}, {"net.key.spd_dump", []_C_int{4, 30, 2}}, {"net.mpls.ifq.congestion", []_C_int{4, 33, 3, 4}}, {"net.mpls.ifq.drops", []_C_int{4, 33, 3, 3}}, {"net.mpls.ifq.len", []_C_int{4, 33, 3, 1}}, {"net.mpls.ifq.maxlen", []_C_int{4, 33, 3, 2}}, {"net.mpls.mapttl_ip", []_C_int{4, 33, 5}}, {"net.mpls.mapttl_ip6", []_C_int{4, 33, 6}}, {"net.mpls.ttl", []_C_int{4, 33, 2}}, {"net.pflow.stats", []_C_int{4, 34, 1}}, {"net.pipex.enable", []_C_int{4, 35, 1}}, {"vm.anonmin", []_C_int{2, 7}}, {"vm.loadavg", []_C_int{2, 2}}, {"vm.malloc_conf", []_C_int{2, 12}}, {"vm.maxslp", []_C_int{2, 10}}, {"vm.nkmempages", []_C_int{2, 6}}, {"vm.psstrings", []_C_int{2, 3}}, {"vm.swapencrypt.enable", []_C_int{2, 5, 0}}, {"vm.swapencrypt.keyscreated", []_C_int{2, 5, 1}}, {"vm.swapencrypt.keysdeleted", []_C_int{2, 5, 2}}, {"vm.uspace", []_C_int{2, 11}}, {"vm.uvmexp", []_C_int{2, 4}}, {"vm.vmmeter", []_C_int{2, 1}}, {"vm.vnodemin", []_C_int{2, 9}}, {"vm.vtextmin", []_C_int{2, 8}}, } ================================================ FILE: vendor/golang.org/x/sys/unix/zsysctl_openbsd_ppc64.go ================================================ // go run mksysctl_openbsd.go // Code generated by the command above; DO NOT EDIT. //go:build ppc64 && openbsd package unix type mibentry struct { ctlname string ctloid []_C_int } var sysctlMib = []mibentry{ {"ddb.console", []_C_int{9, 6}}, {"ddb.log", []_C_int{9, 7}}, {"ddb.max_line", []_C_int{9, 3}}, {"ddb.max_width", []_C_int{9, 2}}, {"ddb.panic", []_C_int{9, 5}}, {"ddb.profile", []_C_int{9, 9}}, {"ddb.radix", []_C_int{9, 1}}, {"ddb.tab_stop_width", []_C_int{9, 4}}, {"ddb.trigger", []_C_int{9, 8}}, {"fs.posix.setuid", []_C_int{3, 1, 1}}, {"hw.allowpowerdown", []_C_int{6, 22}}, {"hw.byteorder", []_C_int{6, 4}}, {"hw.cpuspeed", []_C_int{6, 12}}, {"hw.diskcount", []_C_int{6, 10}}, {"hw.disknames", []_C_int{6, 8}}, {"hw.diskstats", []_C_int{6, 9}}, {"hw.machine", []_C_int{6, 1}}, {"hw.model", []_C_int{6, 2}}, {"hw.ncpu", []_C_int{6, 3}}, {"hw.ncpufound", []_C_int{6, 21}}, {"hw.ncpuonline", []_C_int{6, 25}}, {"hw.pagesize", []_C_int{6, 7}}, {"hw.perfpolicy", []_C_int{6, 23}}, {"hw.physmem", []_C_int{6, 19}}, {"hw.power", []_C_int{6, 26}}, {"hw.product", []_C_int{6, 15}}, {"hw.serialno", []_C_int{6, 17}}, {"hw.setperf", []_C_int{6, 13}}, {"hw.smt", []_C_int{6, 24}}, {"hw.usermem", []_C_int{6, 20}}, {"hw.uuid", []_C_int{6, 18}}, {"hw.vendor", []_C_int{6, 14}}, {"hw.version", []_C_int{6, 16}}, {"kern.allowdt", []_C_int{1, 65}}, {"kern.allowkmem", []_C_int{1, 52}}, {"kern.argmax", []_C_int{1, 8}}, {"kern.audio", []_C_int{1, 84}}, {"kern.boottime", []_C_int{1, 21}}, {"kern.bufcachepercent", []_C_int{1, 72}}, {"kern.ccpu", []_C_int{1, 45}}, {"kern.clockrate", []_C_int{1, 12}}, {"kern.consbuf", []_C_int{1, 83}}, {"kern.consbufsize", []_C_int{1, 82}}, {"kern.consdev", []_C_int{1, 75}}, {"kern.cp_time", []_C_int{1, 40}}, {"kern.cp_time2", []_C_int{1, 71}}, {"kern.cpustats", []_C_int{1, 85}}, {"kern.domainname", []_C_int{1, 22}}, {"kern.file", []_C_int{1, 73}}, {"kern.forkstat", []_C_int{1, 42}}, {"kern.fscale", []_C_int{1, 46}}, {"kern.fsync", []_C_int{1, 33}}, {"kern.global_ptrace", []_C_int{1, 81}}, {"kern.hostid", []_C_int{1, 11}}, {"kern.hostname", []_C_int{1, 10}}, {"kern.intrcnt.nintrcnt", []_C_int{1, 63, 1}}, {"kern.job_control", []_C_int{1, 19}}, {"kern.malloc.buckets", []_C_int{1, 39, 1}}, {"kern.malloc.kmemnames", []_C_int{1, 39, 3}}, {"kern.maxclusters", []_C_int{1, 67}}, {"kern.maxfiles", []_C_int{1, 7}}, {"kern.maxlocksperuid", []_C_int{1, 70}}, {"kern.maxpartitions", []_C_int{1, 23}}, {"kern.maxproc", []_C_int{1, 6}}, {"kern.maxthread", []_C_int{1, 25}}, {"kern.maxvnodes", []_C_int{1, 5}}, {"kern.mbstat", []_C_int{1, 59}}, {"kern.msgbuf", []_C_int{1, 48}}, {"kern.msgbufsize", []_C_int{1, 38}}, {"kern.nchstats", []_C_int{1, 41}}, {"kern.netlivelocks", []_C_int{1, 76}}, {"kern.nfiles", []_C_int{1, 56}}, {"kern.ngroups", []_C_int{1, 18}}, {"kern.nosuidcoredump", []_C_int{1, 32}}, {"kern.nprocs", []_C_int{1, 47}}, {"kern.nthreads", []_C_int{1, 26}}, {"kern.numvnodes", []_C_int{1, 58}}, {"kern.osrelease", []_C_int{1, 2}}, {"kern.osrevision", []_C_int{1, 3}}, {"kern.ostype", []_C_int{1, 1}}, {"kern.osversion", []_C_int{1, 27}}, {"kern.pfstatus", []_C_int{1, 86}}, {"kern.pool_debug", []_C_int{1, 77}}, {"kern.posix1version", []_C_int{1, 17}}, {"kern.proc", []_C_int{1, 66}}, {"kern.rawpartition", []_C_int{1, 24}}, {"kern.saved_ids", []_C_int{1, 20}}, {"kern.securelevel", []_C_int{1, 9}}, {"kern.seminfo", []_C_int{1, 61}}, {"kern.shminfo", []_C_int{1, 62}}, {"kern.somaxconn", []_C_int{1, 28}}, {"kern.sominconn", []_C_int{1, 29}}, {"kern.splassert", []_C_int{1, 54}}, {"kern.stackgap_random", []_C_int{1, 50}}, {"kern.sysvipc_info", []_C_int{1, 51}}, {"kern.sysvmsg", []_C_int{1, 34}}, {"kern.sysvsem", []_C_int{1, 35}}, {"kern.sysvshm", []_C_int{1, 36}}, {"kern.timecounter.choice", []_C_int{1, 69, 4}}, {"kern.timecounter.hardware", []_C_int{1, 69, 3}}, {"kern.timecounter.tick", []_C_int{1, 69, 1}}, {"kern.timecounter.timestepwarnings", []_C_int{1, 69, 2}}, {"kern.timeout_stats", []_C_int{1, 87}}, {"kern.tty.tk_cancc", []_C_int{1, 44, 4}}, {"kern.tty.tk_nin", []_C_int{1, 44, 1}}, {"kern.tty.tk_nout", []_C_int{1, 44, 2}}, {"kern.tty.tk_rawcc", []_C_int{1, 44, 3}}, {"kern.tty.ttyinfo", []_C_int{1, 44, 5}}, {"kern.ttycount", []_C_int{1, 57}}, {"kern.utc_offset", []_C_int{1, 88}}, {"kern.version", []_C_int{1, 4}}, {"kern.video", []_C_int{1, 89}}, {"kern.watchdog.auto", []_C_int{1, 64, 2}}, {"kern.watchdog.period", []_C_int{1, 64, 1}}, {"kern.witnesswatch", []_C_int{1, 53}}, {"kern.wxabort", []_C_int{1, 74}}, {"net.bpf.bufsize", []_C_int{4, 31, 1}}, {"net.bpf.maxbufsize", []_C_int{4, 31, 2}}, {"net.inet.ah.enable", []_C_int{4, 2, 51, 1}}, {"net.inet.ah.stats", []_C_int{4, 2, 51, 2}}, {"net.inet.carp.allow", []_C_int{4, 2, 112, 1}}, {"net.inet.carp.log", []_C_int{4, 2, 112, 3}}, {"net.inet.carp.preempt", []_C_int{4, 2, 112, 2}}, {"net.inet.carp.stats", []_C_int{4, 2, 112, 4}}, {"net.inet.divert.recvspace", []_C_int{4, 2, 258, 1}}, {"net.inet.divert.sendspace", []_C_int{4, 2, 258, 2}}, {"net.inet.divert.stats", []_C_int{4, 2, 258, 3}}, {"net.inet.esp.enable", []_C_int{4, 2, 50, 1}}, {"net.inet.esp.stats", []_C_int{4, 2, 50, 4}}, {"net.inet.esp.udpencap", []_C_int{4, 2, 50, 2}}, {"net.inet.esp.udpencap_port", []_C_int{4, 2, 50, 3}}, {"net.inet.etherip.allow", []_C_int{4, 2, 97, 1}}, {"net.inet.etherip.stats", []_C_int{4, 2, 97, 2}}, {"net.inet.gre.allow", []_C_int{4, 2, 47, 1}}, {"net.inet.gre.wccp", []_C_int{4, 2, 47, 2}}, {"net.inet.icmp.bmcastecho", []_C_int{4, 2, 1, 2}}, {"net.inet.icmp.errppslimit", []_C_int{4, 2, 1, 3}}, {"net.inet.icmp.maskrepl", []_C_int{4, 2, 1, 1}}, {"net.inet.icmp.rediraccept", []_C_int{4, 2, 1, 4}}, {"net.inet.icmp.redirtimeout", []_C_int{4, 2, 1, 5}}, {"net.inet.icmp.stats", []_C_int{4, 2, 1, 7}}, {"net.inet.icmp.tstamprepl", []_C_int{4, 2, 1, 6}}, {"net.inet.igmp.stats", []_C_int{4, 2, 2, 1}}, {"net.inet.ip.arpdown", []_C_int{4, 2, 0, 40}}, {"net.inet.ip.arpqueued", []_C_int{4, 2, 0, 36}}, {"net.inet.ip.arptimeout", []_C_int{4, 2, 0, 39}}, {"net.inet.ip.encdebug", []_C_int{4, 2, 0, 12}}, {"net.inet.ip.forwarding", []_C_int{4, 2, 0, 1}}, {"net.inet.ip.ifq.congestion", []_C_int{4, 2, 0, 30, 4}}, {"net.inet.ip.ifq.drops", []_C_int{4, 2, 0, 30, 3}}, {"net.inet.ip.ifq.len", []_C_int{4, 2, 0, 30, 1}}, {"net.inet.ip.ifq.maxlen", []_C_int{4, 2, 0, 30, 2}}, {"net.inet.ip.maxqueue", []_C_int{4, 2, 0, 11}}, {"net.inet.ip.mforwarding", []_C_int{4, 2, 0, 31}}, {"net.inet.ip.mrtmfc", []_C_int{4, 2, 0, 37}}, {"net.inet.ip.mrtproto", []_C_int{4, 2, 0, 34}}, {"net.inet.ip.mrtstats", []_C_int{4, 2, 0, 35}}, {"net.inet.ip.mrtvif", []_C_int{4, 2, 0, 38}}, {"net.inet.ip.mtu", []_C_int{4, 2, 0, 4}}, {"net.inet.ip.mtudisc", []_C_int{4, 2, 0, 27}}, {"net.inet.ip.mtudisctimeout", []_C_int{4, 2, 0, 28}}, {"net.inet.ip.multipath", []_C_int{4, 2, 0, 32}}, {"net.inet.ip.portfirst", []_C_int{4, 2, 0, 7}}, {"net.inet.ip.porthifirst", []_C_int{4, 2, 0, 9}}, {"net.inet.ip.porthilast", []_C_int{4, 2, 0, 10}}, {"net.inet.ip.portlast", []_C_int{4, 2, 0, 8}}, {"net.inet.ip.redirect", []_C_int{4, 2, 0, 2}}, {"net.inet.ip.sourceroute", []_C_int{4, 2, 0, 5}}, {"net.inet.ip.stats", []_C_int{4, 2, 0, 33}}, {"net.inet.ip.ttl", []_C_int{4, 2, 0, 3}}, {"net.inet.ipcomp.enable", []_C_int{4, 2, 108, 1}}, {"net.inet.ipcomp.stats", []_C_int{4, 2, 108, 2}}, {"net.inet.ipip.allow", []_C_int{4, 2, 4, 1}}, {"net.inet.ipip.stats", []_C_int{4, 2, 4, 2}}, {"net.inet.pfsync.stats", []_C_int{4, 2, 240, 1}}, {"net.inet.tcp.ackonpush", []_C_int{4, 2, 6, 13}}, {"net.inet.tcp.always_keepalive", []_C_int{4, 2, 6, 22}}, {"net.inet.tcp.baddynamic", []_C_int{4, 2, 6, 6}}, {"net.inet.tcp.drop", []_C_int{4, 2, 6, 19}}, {"net.inet.tcp.ecn", []_C_int{4, 2, 6, 14}}, {"net.inet.tcp.ident", []_C_int{4, 2, 6, 9}}, {"net.inet.tcp.keepidle", []_C_int{4, 2, 6, 3}}, {"net.inet.tcp.keepinittime", []_C_int{4, 2, 6, 2}}, {"net.inet.tcp.keepintvl", []_C_int{4, 2, 6, 4}}, {"net.inet.tcp.mssdflt", []_C_int{4, 2, 6, 11}}, {"net.inet.tcp.reasslimit", []_C_int{4, 2, 6, 18}}, {"net.inet.tcp.rfc1323", []_C_int{4, 2, 6, 1}}, {"net.inet.tcp.rfc3390", []_C_int{4, 2, 6, 17}}, {"net.inet.tcp.rootonly", []_C_int{4, 2, 6, 24}}, {"net.inet.tcp.rstppslimit", []_C_int{4, 2, 6, 12}}, {"net.inet.tcp.sack", []_C_int{4, 2, 6, 10}}, {"net.inet.tcp.sackholelimit", []_C_int{4, 2, 6, 20}}, {"net.inet.tcp.slowhz", []_C_int{4, 2, 6, 5}}, {"net.inet.tcp.stats", []_C_int{4, 2, 6, 21}}, {"net.inet.tcp.synbucketlimit", []_C_int{4, 2, 6, 16}}, {"net.inet.tcp.syncachelimit", []_C_int{4, 2, 6, 15}}, {"net.inet.tcp.synhashsize", []_C_int{4, 2, 6, 25}}, {"net.inet.tcp.synuselimit", []_C_int{4, 2, 6, 23}}, {"net.inet.udp.baddynamic", []_C_int{4, 2, 17, 2}}, {"net.inet.udp.checksum", []_C_int{4, 2, 17, 1}}, {"net.inet.udp.recvspace", []_C_int{4, 2, 17, 3}}, {"net.inet.udp.rootonly", []_C_int{4, 2, 17, 6}}, {"net.inet.udp.sendspace", []_C_int{4, 2, 17, 4}}, {"net.inet.udp.stats", []_C_int{4, 2, 17, 5}}, {"net.inet6.divert.recvspace", []_C_int{4, 24, 86, 1}}, {"net.inet6.divert.sendspace", []_C_int{4, 24, 86, 2}}, {"net.inet6.divert.stats", []_C_int{4, 24, 86, 3}}, {"net.inet6.icmp6.errppslimit", []_C_int{4, 24, 30, 14}}, {"net.inet6.icmp6.mtudisc_hiwat", []_C_int{4, 24, 30, 16}}, {"net.inet6.icmp6.mtudisc_lowat", []_C_int{4, 24, 30, 17}}, {"net.inet6.icmp6.nd6_debug", []_C_int{4, 24, 30, 18}}, {"net.inet6.icmp6.nd6_delay", []_C_int{4, 24, 30, 8}}, {"net.inet6.icmp6.nd6_maxnudhint", []_C_int{4, 24, 30, 15}}, {"net.inet6.icmp6.nd6_mmaxtries", []_C_int{4, 24, 30, 10}}, {"net.inet6.icmp6.nd6_umaxtries", []_C_int{4, 24, 30, 9}}, {"net.inet6.icmp6.redirtimeout", []_C_int{4, 24, 30, 3}}, {"net.inet6.ip6.auto_flowlabel", []_C_int{4, 24, 17, 17}}, {"net.inet6.ip6.dad_count", []_C_int{4, 24, 17, 16}}, {"net.inet6.ip6.dad_pending", []_C_int{4, 24, 17, 49}}, {"net.inet6.ip6.defmcasthlim", []_C_int{4, 24, 17, 18}}, {"net.inet6.ip6.forwarding", []_C_int{4, 24, 17, 1}}, {"net.inet6.ip6.forwsrcrt", []_C_int{4, 24, 17, 5}}, {"net.inet6.ip6.hdrnestlimit", []_C_int{4, 24, 17, 15}}, {"net.inet6.ip6.hlim", []_C_int{4, 24, 17, 3}}, {"net.inet6.ip6.log_interval", []_C_int{4, 24, 17, 14}}, {"net.inet6.ip6.maxdynroutes", []_C_int{4, 24, 17, 48}}, {"net.inet6.ip6.maxfragpackets", []_C_int{4, 24, 17, 9}}, {"net.inet6.ip6.maxfrags", []_C_int{4, 24, 17, 41}}, {"net.inet6.ip6.mforwarding", []_C_int{4, 24, 17, 42}}, {"net.inet6.ip6.mrtmfc", []_C_int{4, 24, 17, 53}}, {"net.inet6.ip6.mrtmif", []_C_int{4, 24, 17, 52}}, {"net.inet6.ip6.mrtproto", []_C_int{4, 24, 17, 8}}, {"net.inet6.ip6.mtudisctimeout", []_C_int{4, 24, 17, 50}}, {"net.inet6.ip6.multicast_mtudisc", []_C_int{4, 24, 17, 44}}, {"net.inet6.ip6.multipath", []_C_int{4, 24, 17, 43}}, {"net.inet6.ip6.neighborgcthresh", []_C_int{4, 24, 17, 45}}, {"net.inet6.ip6.redirect", []_C_int{4, 24, 17, 2}}, {"net.inet6.ip6.soiikey", []_C_int{4, 24, 17, 54}}, {"net.inet6.ip6.sourcecheck", []_C_int{4, 24, 17, 10}}, {"net.inet6.ip6.sourcecheck_logint", []_C_int{4, 24, 17, 11}}, {"net.inet6.ip6.use_deprecated", []_C_int{4, 24, 17, 21}}, {"net.key.sadb_dump", []_C_int{4, 30, 1}}, {"net.key.spd_dump", []_C_int{4, 30, 2}}, {"net.mpls.ifq.congestion", []_C_int{4, 33, 3, 4}}, {"net.mpls.ifq.drops", []_C_int{4, 33, 3, 3}}, {"net.mpls.ifq.len", []_C_int{4, 33, 3, 1}}, {"net.mpls.ifq.maxlen", []_C_int{4, 33, 3, 2}}, {"net.mpls.mapttl_ip", []_C_int{4, 33, 5}}, {"net.mpls.mapttl_ip6", []_C_int{4, 33, 6}}, {"net.mpls.ttl", []_C_int{4, 33, 2}}, {"net.pflow.stats", []_C_int{4, 34, 1}}, {"net.pipex.enable", []_C_int{4, 35, 1}}, {"vm.anonmin", []_C_int{2, 7}}, {"vm.loadavg", []_C_int{2, 2}}, {"vm.malloc_conf", []_C_int{2, 12}}, {"vm.maxslp", []_C_int{2, 10}}, {"vm.nkmempages", []_C_int{2, 6}}, {"vm.psstrings", []_C_int{2, 3}}, {"vm.swapencrypt.enable", []_C_int{2, 5, 0}}, {"vm.swapencrypt.keyscreated", []_C_int{2, 5, 1}}, {"vm.swapencrypt.keysdeleted", []_C_int{2, 5, 2}}, {"vm.uspace", []_C_int{2, 11}}, {"vm.uvmexp", []_C_int{2, 4}}, {"vm.vmmeter", []_C_int{2, 1}}, {"vm.vnodemin", []_C_int{2, 9}}, {"vm.vtextmin", []_C_int{2, 8}}, } ================================================ FILE: vendor/golang.org/x/sys/unix/zsysctl_openbsd_riscv64.go ================================================ // go run mksysctl_openbsd.go // Code generated by the command above; DO NOT EDIT. //go:build riscv64 && openbsd package unix type mibentry struct { ctlname string ctloid []_C_int } var sysctlMib = []mibentry{ {"ddb.console", []_C_int{9, 6}}, {"ddb.log", []_C_int{9, 7}}, {"ddb.max_line", []_C_int{9, 3}}, {"ddb.max_width", []_C_int{9, 2}}, {"ddb.panic", []_C_int{9, 5}}, {"ddb.profile", []_C_int{9, 9}}, {"ddb.radix", []_C_int{9, 1}}, {"ddb.tab_stop_width", []_C_int{9, 4}}, {"ddb.trigger", []_C_int{9, 8}}, {"fs.posix.setuid", []_C_int{3, 1, 1}}, {"hw.allowpowerdown", []_C_int{6, 22}}, {"hw.byteorder", []_C_int{6, 4}}, {"hw.cpuspeed", []_C_int{6, 12}}, {"hw.diskcount", []_C_int{6, 10}}, {"hw.disknames", []_C_int{6, 8}}, {"hw.diskstats", []_C_int{6, 9}}, {"hw.machine", []_C_int{6, 1}}, {"hw.model", []_C_int{6, 2}}, {"hw.ncpu", []_C_int{6, 3}}, {"hw.ncpufound", []_C_int{6, 21}}, {"hw.ncpuonline", []_C_int{6, 25}}, {"hw.pagesize", []_C_int{6, 7}}, {"hw.perfpolicy", []_C_int{6, 23}}, {"hw.physmem", []_C_int{6, 19}}, {"hw.power", []_C_int{6, 26}}, {"hw.product", []_C_int{6, 15}}, {"hw.serialno", []_C_int{6, 17}}, {"hw.setperf", []_C_int{6, 13}}, {"hw.smt", []_C_int{6, 24}}, {"hw.usermem", []_C_int{6, 20}}, {"hw.uuid", []_C_int{6, 18}}, {"hw.vendor", []_C_int{6, 14}}, {"hw.version", []_C_int{6, 16}}, {"kern.allowdt", []_C_int{1, 65}}, {"kern.allowkmem", []_C_int{1, 52}}, {"kern.argmax", []_C_int{1, 8}}, {"kern.audio", []_C_int{1, 84}}, {"kern.boottime", []_C_int{1, 21}}, {"kern.bufcachepercent", []_C_int{1, 72}}, {"kern.ccpu", []_C_int{1, 45}}, {"kern.clockrate", []_C_int{1, 12}}, {"kern.consbuf", []_C_int{1, 83}}, {"kern.consbufsize", []_C_int{1, 82}}, {"kern.consdev", []_C_int{1, 75}}, {"kern.cp_time", []_C_int{1, 40}}, {"kern.cp_time2", []_C_int{1, 71}}, {"kern.cpustats", []_C_int{1, 85}}, {"kern.domainname", []_C_int{1, 22}}, {"kern.file", []_C_int{1, 73}}, {"kern.forkstat", []_C_int{1, 42}}, {"kern.fscale", []_C_int{1, 46}}, {"kern.fsync", []_C_int{1, 33}}, {"kern.global_ptrace", []_C_int{1, 81}}, {"kern.hostid", []_C_int{1, 11}}, {"kern.hostname", []_C_int{1, 10}}, {"kern.intrcnt.nintrcnt", []_C_int{1, 63, 1}}, {"kern.job_control", []_C_int{1, 19}}, {"kern.malloc.buckets", []_C_int{1, 39, 1}}, {"kern.malloc.kmemnames", []_C_int{1, 39, 3}}, {"kern.maxclusters", []_C_int{1, 67}}, {"kern.maxfiles", []_C_int{1, 7}}, {"kern.maxlocksperuid", []_C_int{1, 70}}, {"kern.maxpartitions", []_C_int{1, 23}}, {"kern.maxproc", []_C_int{1, 6}}, {"kern.maxthread", []_C_int{1, 25}}, {"kern.maxvnodes", []_C_int{1, 5}}, {"kern.mbstat", []_C_int{1, 59}}, {"kern.msgbuf", []_C_int{1, 48}}, {"kern.msgbufsize", []_C_int{1, 38}}, {"kern.nchstats", []_C_int{1, 41}}, {"kern.netlivelocks", []_C_int{1, 76}}, {"kern.nfiles", []_C_int{1, 56}}, {"kern.ngroups", []_C_int{1, 18}}, {"kern.nosuidcoredump", []_C_int{1, 32}}, {"kern.nprocs", []_C_int{1, 47}}, {"kern.nselcoll", []_C_int{1, 43}}, {"kern.nthreads", []_C_int{1, 26}}, {"kern.numvnodes", []_C_int{1, 58}}, {"kern.osrelease", []_C_int{1, 2}}, {"kern.osrevision", []_C_int{1, 3}}, {"kern.ostype", []_C_int{1, 1}}, {"kern.osversion", []_C_int{1, 27}}, {"kern.pfstatus", []_C_int{1, 86}}, {"kern.pool_debug", []_C_int{1, 77}}, {"kern.posix1version", []_C_int{1, 17}}, {"kern.proc", []_C_int{1, 66}}, {"kern.rawpartition", []_C_int{1, 24}}, {"kern.saved_ids", []_C_int{1, 20}}, {"kern.securelevel", []_C_int{1, 9}}, {"kern.seminfo", []_C_int{1, 61}}, {"kern.shminfo", []_C_int{1, 62}}, {"kern.somaxconn", []_C_int{1, 28}}, {"kern.sominconn", []_C_int{1, 29}}, {"kern.splassert", []_C_int{1, 54}}, {"kern.stackgap_random", []_C_int{1, 50}}, {"kern.sysvipc_info", []_C_int{1, 51}}, {"kern.sysvmsg", []_C_int{1, 34}}, {"kern.sysvsem", []_C_int{1, 35}}, {"kern.sysvshm", []_C_int{1, 36}}, {"kern.timecounter.choice", []_C_int{1, 69, 4}}, {"kern.timecounter.hardware", []_C_int{1, 69, 3}}, {"kern.timecounter.tick", []_C_int{1, 69, 1}}, {"kern.timecounter.timestepwarnings", []_C_int{1, 69, 2}}, {"kern.timeout_stats", []_C_int{1, 87}}, {"kern.tty.tk_cancc", []_C_int{1, 44, 4}}, {"kern.tty.tk_nin", []_C_int{1, 44, 1}}, {"kern.tty.tk_nout", []_C_int{1, 44, 2}}, {"kern.tty.tk_rawcc", []_C_int{1, 44, 3}}, {"kern.tty.ttyinfo", []_C_int{1, 44, 5}}, {"kern.ttycount", []_C_int{1, 57}}, {"kern.utc_offset", []_C_int{1, 88}}, {"kern.version", []_C_int{1, 4}}, {"kern.video", []_C_int{1, 89}}, {"kern.watchdog.auto", []_C_int{1, 64, 2}}, {"kern.watchdog.period", []_C_int{1, 64, 1}}, {"kern.witnesswatch", []_C_int{1, 53}}, {"kern.wxabort", []_C_int{1, 74}}, {"net.bpf.bufsize", []_C_int{4, 31, 1}}, {"net.bpf.maxbufsize", []_C_int{4, 31, 2}}, {"net.inet.ah.enable", []_C_int{4, 2, 51, 1}}, {"net.inet.ah.stats", []_C_int{4, 2, 51, 2}}, {"net.inet.carp.allow", []_C_int{4, 2, 112, 1}}, {"net.inet.carp.log", []_C_int{4, 2, 112, 3}}, {"net.inet.carp.preempt", []_C_int{4, 2, 112, 2}}, {"net.inet.carp.stats", []_C_int{4, 2, 112, 4}}, {"net.inet.divert.recvspace", []_C_int{4, 2, 258, 1}}, {"net.inet.divert.sendspace", []_C_int{4, 2, 258, 2}}, {"net.inet.divert.stats", []_C_int{4, 2, 258, 3}}, {"net.inet.esp.enable", []_C_int{4, 2, 50, 1}}, {"net.inet.esp.stats", []_C_int{4, 2, 50, 4}}, {"net.inet.esp.udpencap", []_C_int{4, 2, 50, 2}}, {"net.inet.esp.udpencap_port", []_C_int{4, 2, 50, 3}}, {"net.inet.etherip.allow", []_C_int{4, 2, 97, 1}}, {"net.inet.etherip.stats", []_C_int{4, 2, 97, 2}}, {"net.inet.gre.allow", []_C_int{4, 2, 47, 1}}, {"net.inet.gre.wccp", []_C_int{4, 2, 47, 2}}, {"net.inet.icmp.bmcastecho", []_C_int{4, 2, 1, 2}}, {"net.inet.icmp.errppslimit", []_C_int{4, 2, 1, 3}}, {"net.inet.icmp.maskrepl", []_C_int{4, 2, 1, 1}}, {"net.inet.icmp.rediraccept", []_C_int{4, 2, 1, 4}}, {"net.inet.icmp.redirtimeout", []_C_int{4, 2, 1, 5}}, {"net.inet.icmp.stats", []_C_int{4, 2, 1, 7}}, {"net.inet.icmp.tstamprepl", []_C_int{4, 2, 1, 6}}, {"net.inet.igmp.stats", []_C_int{4, 2, 2, 1}}, {"net.inet.ip.arpdown", []_C_int{4, 2, 0, 40}}, {"net.inet.ip.arpqueued", []_C_int{4, 2, 0, 36}}, {"net.inet.ip.arptimeout", []_C_int{4, 2, 0, 39}}, {"net.inet.ip.encdebug", []_C_int{4, 2, 0, 12}}, {"net.inet.ip.forwarding", []_C_int{4, 2, 0, 1}}, {"net.inet.ip.ifq.congestion", []_C_int{4, 2, 0, 30, 4}}, {"net.inet.ip.ifq.drops", []_C_int{4, 2, 0, 30, 3}}, {"net.inet.ip.ifq.len", []_C_int{4, 2, 0, 30, 1}}, {"net.inet.ip.ifq.maxlen", []_C_int{4, 2, 0, 30, 2}}, {"net.inet.ip.maxqueue", []_C_int{4, 2, 0, 11}}, {"net.inet.ip.mforwarding", []_C_int{4, 2, 0, 31}}, {"net.inet.ip.mrtmfc", []_C_int{4, 2, 0, 37}}, {"net.inet.ip.mrtproto", []_C_int{4, 2, 0, 34}}, {"net.inet.ip.mrtstats", []_C_int{4, 2, 0, 35}}, {"net.inet.ip.mrtvif", []_C_int{4, 2, 0, 38}}, {"net.inet.ip.mtu", []_C_int{4, 2, 0, 4}}, {"net.inet.ip.mtudisc", []_C_int{4, 2, 0, 27}}, {"net.inet.ip.mtudisctimeout", []_C_int{4, 2, 0, 28}}, {"net.inet.ip.multipath", []_C_int{4, 2, 0, 32}}, {"net.inet.ip.portfirst", []_C_int{4, 2, 0, 7}}, {"net.inet.ip.porthifirst", []_C_int{4, 2, 0, 9}}, {"net.inet.ip.porthilast", []_C_int{4, 2, 0, 10}}, {"net.inet.ip.portlast", []_C_int{4, 2, 0, 8}}, {"net.inet.ip.redirect", []_C_int{4, 2, 0, 2}}, {"net.inet.ip.sourceroute", []_C_int{4, 2, 0, 5}}, {"net.inet.ip.stats", []_C_int{4, 2, 0, 33}}, {"net.inet.ip.ttl", []_C_int{4, 2, 0, 3}}, {"net.inet.ipcomp.enable", []_C_int{4, 2, 108, 1}}, {"net.inet.ipcomp.stats", []_C_int{4, 2, 108, 2}}, {"net.inet.ipip.allow", []_C_int{4, 2, 4, 1}}, {"net.inet.ipip.stats", []_C_int{4, 2, 4, 2}}, {"net.inet.pfsync.stats", []_C_int{4, 2, 240, 1}}, {"net.inet.tcp.ackonpush", []_C_int{4, 2, 6, 13}}, {"net.inet.tcp.always_keepalive", []_C_int{4, 2, 6, 22}}, {"net.inet.tcp.baddynamic", []_C_int{4, 2, 6, 6}}, {"net.inet.tcp.drop", []_C_int{4, 2, 6, 19}}, {"net.inet.tcp.ecn", []_C_int{4, 2, 6, 14}}, {"net.inet.tcp.ident", []_C_int{4, 2, 6, 9}}, {"net.inet.tcp.keepidle", []_C_int{4, 2, 6, 3}}, {"net.inet.tcp.keepinittime", []_C_int{4, 2, 6, 2}}, {"net.inet.tcp.keepintvl", []_C_int{4, 2, 6, 4}}, {"net.inet.tcp.mssdflt", []_C_int{4, 2, 6, 11}}, {"net.inet.tcp.reasslimit", []_C_int{4, 2, 6, 18}}, {"net.inet.tcp.rfc1323", []_C_int{4, 2, 6, 1}}, {"net.inet.tcp.rfc3390", []_C_int{4, 2, 6, 17}}, {"net.inet.tcp.rootonly", []_C_int{4, 2, 6, 24}}, {"net.inet.tcp.rstppslimit", []_C_int{4, 2, 6, 12}}, {"net.inet.tcp.sack", []_C_int{4, 2, 6, 10}}, {"net.inet.tcp.sackholelimit", []_C_int{4, 2, 6, 20}}, {"net.inet.tcp.slowhz", []_C_int{4, 2, 6, 5}}, {"net.inet.tcp.stats", []_C_int{4, 2, 6, 21}}, {"net.inet.tcp.synbucketlimit", []_C_int{4, 2, 6, 16}}, {"net.inet.tcp.syncachelimit", []_C_int{4, 2, 6, 15}}, {"net.inet.tcp.synhashsize", []_C_int{4, 2, 6, 25}}, {"net.inet.tcp.synuselimit", []_C_int{4, 2, 6, 23}}, {"net.inet.udp.baddynamic", []_C_int{4, 2, 17, 2}}, {"net.inet.udp.checksum", []_C_int{4, 2, 17, 1}}, {"net.inet.udp.recvspace", []_C_int{4, 2, 17, 3}}, {"net.inet.udp.rootonly", []_C_int{4, 2, 17, 6}}, {"net.inet.udp.sendspace", []_C_int{4, 2, 17, 4}}, {"net.inet.udp.stats", []_C_int{4, 2, 17, 5}}, {"net.inet6.divert.recvspace", []_C_int{4, 24, 86, 1}}, {"net.inet6.divert.sendspace", []_C_int{4, 24, 86, 2}}, {"net.inet6.divert.stats", []_C_int{4, 24, 86, 3}}, {"net.inet6.icmp6.errppslimit", []_C_int{4, 24, 30, 14}}, {"net.inet6.icmp6.mtudisc_hiwat", []_C_int{4, 24, 30, 16}}, {"net.inet6.icmp6.mtudisc_lowat", []_C_int{4, 24, 30, 17}}, {"net.inet6.icmp6.nd6_debug", []_C_int{4, 24, 30, 18}}, {"net.inet6.icmp6.nd6_delay", []_C_int{4, 24, 30, 8}}, {"net.inet6.icmp6.nd6_maxnudhint", []_C_int{4, 24, 30, 15}}, {"net.inet6.icmp6.nd6_mmaxtries", []_C_int{4, 24, 30, 10}}, {"net.inet6.icmp6.nd6_umaxtries", []_C_int{4, 24, 30, 9}}, {"net.inet6.icmp6.redirtimeout", []_C_int{4, 24, 30, 3}}, {"net.inet6.ip6.auto_flowlabel", []_C_int{4, 24, 17, 17}}, {"net.inet6.ip6.dad_count", []_C_int{4, 24, 17, 16}}, {"net.inet6.ip6.dad_pending", []_C_int{4, 24, 17, 49}}, {"net.inet6.ip6.defmcasthlim", []_C_int{4, 24, 17, 18}}, {"net.inet6.ip6.forwarding", []_C_int{4, 24, 17, 1}}, {"net.inet6.ip6.forwsrcrt", []_C_int{4, 24, 17, 5}}, {"net.inet6.ip6.hdrnestlimit", []_C_int{4, 24, 17, 15}}, {"net.inet6.ip6.hlim", []_C_int{4, 24, 17, 3}}, {"net.inet6.ip6.log_interval", []_C_int{4, 24, 17, 14}}, {"net.inet6.ip6.maxdynroutes", []_C_int{4, 24, 17, 48}}, {"net.inet6.ip6.maxfragpackets", []_C_int{4, 24, 17, 9}}, {"net.inet6.ip6.maxfrags", []_C_int{4, 24, 17, 41}}, {"net.inet6.ip6.mforwarding", []_C_int{4, 24, 17, 42}}, {"net.inet6.ip6.mrtmfc", []_C_int{4, 24, 17, 53}}, {"net.inet6.ip6.mrtmif", []_C_int{4, 24, 17, 52}}, {"net.inet6.ip6.mrtproto", []_C_int{4, 24, 17, 8}}, {"net.inet6.ip6.mtudisctimeout", []_C_int{4, 24, 17, 50}}, {"net.inet6.ip6.multicast_mtudisc", []_C_int{4, 24, 17, 44}}, {"net.inet6.ip6.multipath", []_C_int{4, 24, 17, 43}}, {"net.inet6.ip6.neighborgcthresh", []_C_int{4, 24, 17, 45}}, {"net.inet6.ip6.redirect", []_C_int{4, 24, 17, 2}}, {"net.inet6.ip6.soiikey", []_C_int{4, 24, 17, 54}}, {"net.inet6.ip6.sourcecheck", []_C_int{4, 24, 17, 10}}, {"net.inet6.ip6.sourcecheck_logint", []_C_int{4, 24, 17, 11}}, {"net.inet6.ip6.use_deprecated", []_C_int{4, 24, 17, 21}}, {"net.key.sadb_dump", []_C_int{4, 30, 1}}, {"net.key.spd_dump", []_C_int{4, 30, 2}}, {"net.mpls.ifq.congestion", []_C_int{4, 33, 3, 4}}, {"net.mpls.ifq.drops", []_C_int{4, 33, 3, 3}}, {"net.mpls.ifq.len", []_C_int{4, 33, 3, 1}}, {"net.mpls.ifq.maxlen", []_C_int{4, 33, 3, 2}}, {"net.mpls.mapttl_ip", []_C_int{4, 33, 5}}, {"net.mpls.mapttl_ip6", []_C_int{4, 33, 6}}, {"net.mpls.ttl", []_C_int{4, 33, 2}}, {"net.pflow.stats", []_C_int{4, 34, 1}}, {"net.pipex.enable", []_C_int{4, 35, 1}}, {"vm.anonmin", []_C_int{2, 7}}, {"vm.loadavg", []_C_int{2, 2}}, {"vm.malloc_conf", []_C_int{2, 12}}, {"vm.maxslp", []_C_int{2, 10}}, {"vm.nkmempages", []_C_int{2, 6}}, {"vm.psstrings", []_C_int{2, 3}}, {"vm.swapencrypt.enable", []_C_int{2, 5, 0}}, {"vm.swapencrypt.keyscreated", []_C_int{2, 5, 1}}, {"vm.swapencrypt.keysdeleted", []_C_int{2, 5, 2}}, {"vm.uspace", []_C_int{2, 11}}, {"vm.uvmexp", []_C_int{2, 4}}, {"vm.vmmeter", []_C_int{2, 1}}, {"vm.vnodemin", []_C_int{2, 9}}, {"vm.vtextmin", []_C_int{2, 8}}, } ================================================ FILE: vendor/golang.org/x/sys/unix/zsysnum_darwin_amd64.go ================================================ // go run mksysnum.go /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/sys/syscall.h // Code generated by the command above; see README.md. DO NOT EDIT. //go:build amd64 && darwin package unix // Deprecated: Use libSystem wrappers instead of direct syscalls. const ( SYS_SYSCALL = 0 SYS_EXIT = 1 SYS_FORK = 2 SYS_READ = 3 SYS_WRITE = 4 SYS_OPEN = 5 SYS_CLOSE = 6 SYS_WAIT4 = 7 SYS_LINK = 9 SYS_UNLINK = 10 SYS_CHDIR = 12 SYS_FCHDIR = 13 SYS_MKNOD = 14 SYS_CHMOD = 15 SYS_CHOWN = 16 SYS_GETFSSTAT = 18 SYS_GETPID = 20 SYS_SETUID = 23 SYS_GETUID = 24 SYS_GETEUID = 25 SYS_PTRACE = 26 SYS_RECVMSG = 27 SYS_SENDMSG = 28 SYS_RECVFROM = 29 SYS_ACCEPT = 30 SYS_GETPEERNAME = 31 SYS_GETSOCKNAME = 32 SYS_ACCESS = 33 SYS_CHFLAGS = 34 SYS_FCHFLAGS = 35 SYS_SYNC = 36 SYS_KILL = 37 SYS_GETPPID = 39 SYS_DUP = 41 SYS_PIPE = 42 SYS_GETEGID = 43 SYS_SIGACTION = 46 SYS_GETGID = 47 SYS_SIGPROCMASK = 48 SYS_GETLOGIN = 49 SYS_SETLOGIN = 50 SYS_ACCT = 51 SYS_SIGPENDING = 52 SYS_SIGALTSTACK = 53 SYS_IOCTL = 54 SYS_REBOOT = 55 SYS_REVOKE = 56 SYS_SYMLINK = 57 SYS_READLINK = 58 SYS_EXECVE = 59 SYS_UMASK = 60 SYS_CHROOT = 61 SYS_MSYNC = 65 SYS_VFORK = 66 SYS_MUNMAP = 73 SYS_MPROTECT = 74 SYS_MADVISE = 75 SYS_MINCORE = 78 SYS_GETGROUPS = 79 SYS_SETGROUPS = 80 SYS_GETPGRP = 81 SYS_SETPGID = 82 SYS_SETITIMER = 83 SYS_SWAPON = 85 SYS_GETITIMER = 86 SYS_GETDTABLESIZE = 89 SYS_DUP2 = 90 SYS_FCNTL = 92 SYS_SELECT = 93 SYS_FSYNC = 95 SYS_SETPRIORITY = 96 SYS_SOCKET = 97 SYS_CONNECT = 98 SYS_GETPRIORITY = 100 SYS_BIND = 104 SYS_SETSOCKOPT = 105 SYS_LISTEN = 106 SYS_SIGSUSPEND = 111 SYS_GETTIMEOFDAY = 116 SYS_GETRUSAGE = 117 SYS_GETSOCKOPT = 118 SYS_READV = 120 SYS_WRITEV = 121 SYS_SETTIMEOFDAY = 122 SYS_FCHOWN = 123 SYS_FCHMOD = 124 SYS_SETREUID = 126 SYS_SETREGID = 127 SYS_RENAME = 128 SYS_FLOCK = 131 SYS_MKFIFO = 132 SYS_SENDTO = 133 SYS_SHUTDOWN = 134 SYS_SOCKETPAIR = 135 SYS_MKDIR = 136 SYS_RMDIR = 137 SYS_UTIMES = 138 SYS_FUTIMES = 139 SYS_ADJTIME = 140 SYS_GETHOSTUUID = 142 SYS_SETSID = 147 SYS_GETPGID = 151 SYS_SETPRIVEXEC = 152 SYS_PREAD = 153 SYS_PWRITE = 154 SYS_NFSSVC = 155 SYS_STATFS = 157 SYS_FSTATFS = 158 SYS_UNMOUNT = 159 SYS_GETFH = 161 SYS_QUOTACTL = 165 SYS_MOUNT = 167 SYS_CSOPS = 169 SYS_CSOPS_AUDITTOKEN = 170 SYS_WAITID = 173 SYS_KDEBUG_TYPEFILTER = 177 SYS_KDEBUG_TRACE_STRING = 178 SYS_KDEBUG_TRACE64 = 179 SYS_KDEBUG_TRACE = 180 SYS_SETGID = 181 SYS_SETEGID = 182 SYS_SETEUID = 183 SYS_SIGRETURN = 184 SYS_THREAD_SELFCOUNTS = 186 SYS_FDATASYNC = 187 SYS_STAT = 188 SYS_FSTAT = 189 SYS_LSTAT = 190 SYS_PATHCONF = 191 SYS_FPATHCONF = 192 SYS_GETRLIMIT = 194 SYS_SETRLIMIT = 195 SYS_GETDIRENTRIES = 196 SYS_MMAP = 197 SYS_LSEEK = 199 SYS_TRUNCATE = 200 SYS_FTRUNCATE = 201 SYS_SYSCTL = 202 SYS_MLOCK = 203 SYS_MUNLOCK = 204 SYS_UNDELETE = 205 SYS_OPEN_DPROTECTED_NP = 216 SYS_GETATTRLIST = 220 SYS_SETATTRLIST = 221 SYS_GETDIRENTRIESATTR = 222 SYS_EXCHANGEDATA = 223 SYS_SEARCHFS = 225 SYS_DELETE = 226 SYS_COPYFILE = 227 SYS_FGETATTRLIST = 228 SYS_FSETATTRLIST = 229 SYS_POLL = 230 SYS_WATCHEVENT = 231 SYS_WAITEVENT = 232 SYS_MODWATCH = 233 SYS_GETXATTR = 234 SYS_FGETXATTR = 235 SYS_SETXATTR = 236 SYS_FSETXATTR = 237 SYS_REMOVEXATTR = 238 SYS_FREMOVEXATTR = 239 SYS_LISTXATTR = 240 SYS_FLISTXATTR = 241 SYS_FSCTL = 242 SYS_INITGROUPS = 243 SYS_POSIX_SPAWN = 244 SYS_FFSCTL = 245 SYS_NFSCLNT = 247 SYS_FHOPEN = 248 SYS_MINHERIT = 250 SYS_SEMSYS = 251 SYS_MSGSYS = 252 SYS_SHMSYS = 253 SYS_SEMCTL = 254 SYS_SEMGET = 255 SYS_SEMOP = 256 SYS_MSGCTL = 258 SYS_MSGGET = 259 SYS_MSGSND = 260 SYS_MSGRCV = 261 SYS_SHMAT = 262 SYS_SHMCTL = 263 SYS_SHMDT = 264 SYS_SHMGET = 265 SYS_SHM_OPEN = 266 SYS_SHM_UNLINK = 267 SYS_SEM_OPEN = 268 SYS_SEM_CLOSE = 269 SYS_SEM_UNLINK = 270 SYS_SEM_WAIT = 271 SYS_SEM_TRYWAIT = 272 SYS_SEM_POST = 273 SYS_SYSCTLBYNAME = 274 SYS_OPEN_EXTENDED = 277 SYS_UMASK_EXTENDED = 278 SYS_STAT_EXTENDED = 279 SYS_LSTAT_EXTENDED = 280 SYS_FSTAT_EXTENDED = 281 SYS_CHMOD_EXTENDED = 282 SYS_FCHMOD_EXTENDED = 283 SYS_ACCESS_EXTENDED = 284 SYS_SETTID = 285 SYS_GETTID = 286 SYS_SETSGROUPS = 287 SYS_GETSGROUPS = 288 SYS_SETWGROUPS = 289 SYS_GETWGROUPS = 290 SYS_MKFIFO_EXTENDED = 291 SYS_MKDIR_EXTENDED = 292 SYS_IDENTITYSVC = 293 SYS_SHARED_REGION_CHECK_NP = 294 SYS_VM_PRESSURE_MONITOR = 296 SYS_PSYNCH_RW_LONGRDLOCK = 297 SYS_PSYNCH_RW_YIELDWRLOCK = 298 SYS_PSYNCH_RW_DOWNGRADE = 299 SYS_PSYNCH_RW_UPGRADE = 300 SYS_PSYNCH_MUTEXWAIT = 301 SYS_PSYNCH_MUTEXDROP = 302 SYS_PSYNCH_CVBROAD = 303 SYS_PSYNCH_CVSIGNAL = 304 SYS_PSYNCH_CVWAIT = 305 SYS_PSYNCH_RW_RDLOCK = 306 SYS_PSYNCH_RW_WRLOCK = 307 SYS_PSYNCH_RW_UNLOCK = 308 SYS_PSYNCH_RW_UNLOCK2 = 309 SYS_GETSID = 310 SYS_SETTID_WITH_PID = 311 SYS_PSYNCH_CVCLRPREPOST = 312 SYS_AIO_FSYNC = 313 SYS_AIO_RETURN = 314 SYS_AIO_SUSPEND = 315 SYS_AIO_CANCEL = 316 SYS_AIO_ERROR = 317 SYS_AIO_READ = 318 SYS_AIO_WRITE = 319 SYS_LIO_LISTIO = 320 SYS_IOPOLICYSYS = 322 SYS_PROCESS_POLICY = 323 SYS_MLOCKALL = 324 SYS_MUNLOCKALL = 325 SYS_ISSETUGID = 327 SYS___PTHREAD_KILL = 328 SYS___PTHREAD_SIGMASK = 329 SYS___SIGWAIT = 330 SYS___DISABLE_THREADSIGNAL = 331 SYS___PTHREAD_MARKCANCEL = 332 SYS___PTHREAD_CANCELED = 333 SYS___SEMWAIT_SIGNAL = 334 SYS_PROC_INFO = 336 SYS_SENDFILE = 337 SYS_STAT64 = 338 SYS_FSTAT64 = 339 SYS_LSTAT64 = 340 SYS_STAT64_EXTENDED = 341 SYS_LSTAT64_EXTENDED = 342 SYS_FSTAT64_EXTENDED = 343 SYS_GETDIRENTRIES64 = 344 SYS_STATFS64 = 345 SYS_FSTATFS64 = 346 SYS_GETFSSTAT64 = 347 SYS___PTHREAD_CHDIR = 348 SYS___PTHREAD_FCHDIR = 349 SYS_AUDIT = 350 SYS_AUDITON = 351 SYS_GETAUID = 353 SYS_SETAUID = 354 SYS_GETAUDIT_ADDR = 357 SYS_SETAUDIT_ADDR = 358 SYS_AUDITCTL = 359 SYS_BSDTHREAD_CREATE = 360 SYS_BSDTHREAD_TERMINATE = 361 SYS_KQUEUE = 362 SYS_KEVENT = 363 SYS_LCHOWN = 364 SYS_BSDTHREAD_REGISTER = 366 SYS_WORKQ_OPEN = 367 SYS_WORKQ_KERNRETURN = 368 SYS_KEVENT64 = 369 SYS___OLD_SEMWAIT_SIGNAL = 370 SYS___OLD_SEMWAIT_SIGNAL_NOCANCEL = 371 SYS_THREAD_SELFID = 372 SYS_LEDGER = 373 SYS_KEVENT_QOS = 374 SYS_KEVENT_ID = 375 SYS___MAC_EXECVE = 380 SYS___MAC_SYSCALL = 381 SYS___MAC_GET_FILE = 382 SYS___MAC_SET_FILE = 383 SYS___MAC_GET_LINK = 384 SYS___MAC_SET_LINK = 385 SYS___MAC_GET_PROC = 386 SYS___MAC_SET_PROC = 387 SYS___MAC_GET_FD = 388 SYS___MAC_SET_FD = 389 SYS___MAC_GET_PID = 390 SYS_PSELECT = 394 SYS_PSELECT_NOCANCEL = 395 SYS_READ_NOCANCEL = 396 SYS_WRITE_NOCANCEL = 397 SYS_OPEN_NOCANCEL = 398 SYS_CLOSE_NOCANCEL = 399 SYS_WAIT4_NOCANCEL = 400 SYS_RECVMSG_NOCANCEL = 401 SYS_SENDMSG_NOCANCEL = 402 SYS_RECVFROM_NOCANCEL = 403 SYS_ACCEPT_NOCANCEL = 404 SYS_MSYNC_NOCANCEL = 405 SYS_FCNTL_NOCANCEL = 406 SYS_SELECT_NOCANCEL = 407 SYS_FSYNC_NOCANCEL = 408 SYS_CONNECT_NOCANCEL = 409 SYS_SIGSUSPEND_NOCANCEL = 410 SYS_READV_NOCANCEL = 411 SYS_WRITEV_NOCANCEL = 412 SYS_SENDTO_NOCANCEL = 413 SYS_PREAD_NOCANCEL = 414 SYS_PWRITE_NOCANCEL = 415 SYS_WAITID_NOCANCEL = 416 SYS_POLL_NOCANCEL = 417 SYS_MSGSND_NOCANCEL = 418 SYS_MSGRCV_NOCANCEL = 419 SYS_SEM_WAIT_NOCANCEL = 420 SYS_AIO_SUSPEND_NOCANCEL = 421 SYS___SIGWAIT_NOCANCEL = 422 SYS___SEMWAIT_SIGNAL_NOCANCEL = 423 SYS___MAC_MOUNT = 424 SYS___MAC_GET_MOUNT = 425 SYS___MAC_GETFSSTAT = 426 SYS_FSGETPATH = 427 SYS_AUDIT_SESSION_SELF = 428 SYS_AUDIT_SESSION_JOIN = 429 SYS_FILEPORT_MAKEPORT = 430 SYS_FILEPORT_MAKEFD = 431 SYS_AUDIT_SESSION_PORT = 432 SYS_PID_SUSPEND = 433 SYS_PID_RESUME = 434 SYS_PID_HIBERNATE = 435 SYS_PID_SHUTDOWN_SOCKETS = 436 SYS_SHARED_REGION_MAP_AND_SLIDE_NP = 438 SYS_KAS_INFO = 439 SYS_MEMORYSTATUS_CONTROL = 440 SYS_GUARDED_OPEN_NP = 441 SYS_GUARDED_CLOSE_NP = 442 SYS_GUARDED_KQUEUE_NP = 443 SYS_CHANGE_FDGUARD_NP = 444 SYS_USRCTL = 445 SYS_PROC_RLIMIT_CONTROL = 446 SYS_CONNECTX = 447 SYS_DISCONNECTX = 448 SYS_PEELOFF = 449 SYS_SOCKET_DELEGATE = 450 SYS_TELEMETRY = 451 SYS_PROC_UUID_POLICY = 452 SYS_MEMORYSTATUS_GET_LEVEL = 453 SYS_SYSTEM_OVERRIDE = 454 SYS_VFS_PURGE = 455 SYS_SFI_CTL = 456 SYS_SFI_PIDCTL = 457 SYS_COALITION = 458 SYS_COALITION_INFO = 459 SYS_NECP_MATCH_POLICY = 460 SYS_GETATTRLISTBULK = 461 SYS_CLONEFILEAT = 462 SYS_OPENAT = 463 SYS_OPENAT_NOCANCEL = 464 SYS_RENAMEAT = 465 SYS_FACCESSAT = 466 SYS_FCHMODAT = 467 SYS_FCHOWNAT = 468 SYS_FSTATAT = 469 SYS_FSTATAT64 = 470 SYS_LINKAT = 471 SYS_UNLINKAT = 472 SYS_READLINKAT = 473 SYS_SYMLINKAT = 474 SYS_MKDIRAT = 475 SYS_GETATTRLISTAT = 476 SYS_PROC_TRACE_LOG = 477 SYS_BSDTHREAD_CTL = 478 SYS_OPENBYID_NP = 479 SYS_RECVMSG_X = 480 SYS_SENDMSG_X = 481 SYS_THREAD_SELFUSAGE = 482 SYS_CSRCTL = 483 SYS_GUARDED_OPEN_DPROTECTED_NP = 484 SYS_GUARDED_WRITE_NP = 485 SYS_GUARDED_PWRITE_NP = 486 SYS_GUARDED_WRITEV_NP = 487 SYS_RENAMEATX_NP = 488 SYS_MREMAP_ENCRYPTED = 489 SYS_NETAGENT_TRIGGER = 490 SYS_STACK_SNAPSHOT_WITH_CONFIG = 491 SYS_MICROSTACKSHOT = 492 SYS_GRAB_PGO_DATA = 493 SYS_PERSONA = 494 SYS_WORK_INTERVAL_CTL = 499 SYS_GETENTROPY = 500 SYS_NECP_OPEN = 501 SYS_NECP_CLIENT_ACTION = 502 SYS___NEXUS_OPEN = 503 SYS___NEXUS_REGISTER = 504 SYS___NEXUS_DEREGISTER = 505 SYS___NEXUS_CREATE = 506 SYS___NEXUS_DESTROY = 507 SYS___NEXUS_GET_OPT = 508 SYS___NEXUS_SET_OPT = 509 SYS___CHANNEL_OPEN = 510 SYS___CHANNEL_GET_INFO = 511 SYS___CHANNEL_SYNC = 512 SYS___CHANNEL_GET_OPT = 513 SYS___CHANNEL_SET_OPT = 514 SYS_ULOCK_WAIT = 515 SYS_ULOCK_WAKE = 516 SYS_FCLONEFILEAT = 517 SYS_FS_SNAPSHOT = 518 SYS_TERMINATE_WITH_PAYLOAD = 520 SYS_ABORT_WITH_PAYLOAD = 521 SYS_NECP_SESSION_OPEN = 522 SYS_NECP_SESSION_ACTION = 523 SYS_SETATTRLISTAT = 524 SYS_NET_QOS_GUIDELINE = 525 SYS_FMOUNT = 526 SYS_NTP_ADJTIME = 527 SYS_NTP_GETTIME = 528 SYS_OS_FAULT_WITH_PAYLOAD = 529 SYS_KQUEUE_WORKLOOP_CTL = 530 SYS___MACH_BRIDGE_REMOTE_TIME = 531 SYS_MAXSYSCALL = 532 SYS_INVALID = 63 ) ================================================ FILE: vendor/golang.org/x/sys/unix/zsysnum_darwin_arm64.go ================================================ // go run mksysnum.go /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.1.sdk/usr/include/sys/syscall.h // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm64 && darwin package unix // Deprecated: Use libSystem wrappers instead of direct syscalls. const ( SYS_SYSCALL = 0 SYS_EXIT = 1 SYS_FORK = 2 SYS_READ = 3 SYS_WRITE = 4 SYS_OPEN = 5 SYS_CLOSE = 6 SYS_WAIT4 = 7 SYS_LINK = 9 SYS_UNLINK = 10 SYS_CHDIR = 12 SYS_FCHDIR = 13 SYS_MKNOD = 14 SYS_CHMOD = 15 SYS_CHOWN = 16 SYS_GETFSSTAT = 18 SYS_GETPID = 20 SYS_SETUID = 23 SYS_GETUID = 24 SYS_GETEUID = 25 SYS_PTRACE = 26 SYS_RECVMSG = 27 SYS_SENDMSG = 28 SYS_RECVFROM = 29 SYS_ACCEPT = 30 SYS_GETPEERNAME = 31 SYS_GETSOCKNAME = 32 SYS_ACCESS = 33 SYS_CHFLAGS = 34 SYS_FCHFLAGS = 35 SYS_SYNC = 36 SYS_KILL = 37 SYS_GETPPID = 39 SYS_DUP = 41 SYS_PIPE = 42 SYS_GETEGID = 43 SYS_SIGACTION = 46 SYS_GETGID = 47 SYS_SIGPROCMASK = 48 SYS_GETLOGIN = 49 SYS_SETLOGIN = 50 SYS_ACCT = 51 SYS_SIGPENDING = 52 SYS_SIGALTSTACK = 53 SYS_IOCTL = 54 SYS_REBOOT = 55 SYS_REVOKE = 56 SYS_SYMLINK = 57 SYS_READLINK = 58 SYS_EXECVE = 59 SYS_UMASK = 60 SYS_CHROOT = 61 SYS_MSYNC = 65 SYS_VFORK = 66 SYS_MUNMAP = 73 SYS_MPROTECT = 74 SYS_MADVISE = 75 SYS_MINCORE = 78 SYS_GETGROUPS = 79 SYS_SETGROUPS = 80 SYS_GETPGRP = 81 SYS_SETPGID = 82 SYS_SETITIMER = 83 SYS_SWAPON = 85 SYS_GETITIMER = 86 SYS_GETDTABLESIZE = 89 SYS_DUP2 = 90 SYS_FCNTL = 92 SYS_SELECT = 93 SYS_FSYNC = 95 SYS_SETPRIORITY = 96 SYS_SOCKET = 97 SYS_CONNECT = 98 SYS_GETPRIORITY = 100 SYS_BIND = 104 SYS_SETSOCKOPT = 105 SYS_LISTEN = 106 SYS_SIGSUSPEND = 111 SYS_GETTIMEOFDAY = 116 SYS_GETRUSAGE = 117 SYS_GETSOCKOPT = 118 SYS_READV = 120 SYS_WRITEV = 121 SYS_SETTIMEOFDAY = 122 SYS_FCHOWN = 123 SYS_FCHMOD = 124 SYS_SETREUID = 126 SYS_SETREGID = 127 SYS_RENAME = 128 SYS_FLOCK = 131 SYS_MKFIFO = 132 SYS_SENDTO = 133 SYS_SHUTDOWN = 134 SYS_SOCKETPAIR = 135 SYS_MKDIR = 136 SYS_RMDIR = 137 SYS_UTIMES = 138 SYS_FUTIMES = 139 SYS_ADJTIME = 140 SYS_GETHOSTUUID = 142 SYS_SETSID = 147 SYS_GETPGID = 151 SYS_SETPRIVEXEC = 152 SYS_PREAD = 153 SYS_PWRITE = 154 SYS_NFSSVC = 155 SYS_STATFS = 157 SYS_FSTATFS = 158 SYS_UNMOUNT = 159 SYS_GETFH = 161 SYS_QUOTACTL = 165 SYS_MOUNT = 167 SYS_CSOPS = 169 SYS_CSOPS_AUDITTOKEN = 170 SYS_WAITID = 173 SYS_KDEBUG_TYPEFILTER = 177 SYS_KDEBUG_TRACE_STRING = 178 SYS_KDEBUG_TRACE64 = 179 SYS_KDEBUG_TRACE = 180 SYS_SETGID = 181 SYS_SETEGID = 182 SYS_SETEUID = 183 SYS_SIGRETURN = 184 SYS_THREAD_SELFCOUNTS = 186 SYS_FDATASYNC = 187 SYS_STAT = 188 SYS_FSTAT = 189 SYS_LSTAT = 190 SYS_PATHCONF = 191 SYS_FPATHCONF = 192 SYS_GETRLIMIT = 194 SYS_SETRLIMIT = 195 SYS_GETDIRENTRIES = 196 SYS_MMAP = 197 SYS_LSEEK = 199 SYS_TRUNCATE = 200 SYS_FTRUNCATE = 201 SYS_SYSCTL = 202 SYS_MLOCK = 203 SYS_MUNLOCK = 204 SYS_UNDELETE = 205 SYS_OPEN_DPROTECTED_NP = 216 SYS_GETATTRLIST = 220 SYS_SETATTRLIST = 221 SYS_GETDIRENTRIESATTR = 222 SYS_EXCHANGEDATA = 223 SYS_SEARCHFS = 225 SYS_DELETE = 226 SYS_COPYFILE = 227 SYS_FGETATTRLIST = 228 SYS_FSETATTRLIST = 229 SYS_POLL = 230 SYS_WATCHEVENT = 231 SYS_WAITEVENT = 232 SYS_MODWATCH = 233 SYS_GETXATTR = 234 SYS_FGETXATTR = 235 SYS_SETXATTR = 236 SYS_FSETXATTR = 237 SYS_REMOVEXATTR = 238 SYS_FREMOVEXATTR = 239 SYS_LISTXATTR = 240 SYS_FLISTXATTR = 241 SYS_FSCTL = 242 SYS_INITGROUPS = 243 SYS_POSIX_SPAWN = 244 SYS_FFSCTL = 245 SYS_NFSCLNT = 247 SYS_FHOPEN = 248 SYS_MINHERIT = 250 SYS_SEMSYS = 251 SYS_MSGSYS = 252 SYS_SHMSYS = 253 SYS_SEMCTL = 254 SYS_SEMGET = 255 SYS_SEMOP = 256 SYS_MSGCTL = 258 SYS_MSGGET = 259 SYS_MSGSND = 260 SYS_MSGRCV = 261 SYS_SHMAT = 262 SYS_SHMCTL = 263 SYS_SHMDT = 264 SYS_SHMGET = 265 SYS_SHM_OPEN = 266 SYS_SHM_UNLINK = 267 SYS_SEM_OPEN = 268 SYS_SEM_CLOSE = 269 SYS_SEM_UNLINK = 270 SYS_SEM_WAIT = 271 SYS_SEM_TRYWAIT = 272 SYS_SEM_POST = 273 SYS_SYSCTLBYNAME = 274 SYS_OPEN_EXTENDED = 277 SYS_UMASK_EXTENDED = 278 SYS_STAT_EXTENDED = 279 SYS_LSTAT_EXTENDED = 280 SYS_FSTAT_EXTENDED = 281 SYS_CHMOD_EXTENDED = 282 SYS_FCHMOD_EXTENDED = 283 SYS_ACCESS_EXTENDED = 284 SYS_SETTID = 285 SYS_GETTID = 286 SYS_SETSGROUPS = 287 SYS_GETSGROUPS = 288 SYS_SETWGROUPS = 289 SYS_GETWGROUPS = 290 SYS_MKFIFO_EXTENDED = 291 SYS_MKDIR_EXTENDED = 292 SYS_IDENTITYSVC = 293 SYS_SHARED_REGION_CHECK_NP = 294 SYS_VM_PRESSURE_MONITOR = 296 SYS_PSYNCH_RW_LONGRDLOCK = 297 SYS_PSYNCH_RW_YIELDWRLOCK = 298 SYS_PSYNCH_RW_DOWNGRADE = 299 SYS_PSYNCH_RW_UPGRADE = 300 SYS_PSYNCH_MUTEXWAIT = 301 SYS_PSYNCH_MUTEXDROP = 302 SYS_PSYNCH_CVBROAD = 303 SYS_PSYNCH_CVSIGNAL = 304 SYS_PSYNCH_CVWAIT = 305 SYS_PSYNCH_RW_RDLOCK = 306 SYS_PSYNCH_RW_WRLOCK = 307 SYS_PSYNCH_RW_UNLOCK = 308 SYS_PSYNCH_RW_UNLOCK2 = 309 SYS_GETSID = 310 SYS_SETTID_WITH_PID = 311 SYS_PSYNCH_CVCLRPREPOST = 312 SYS_AIO_FSYNC = 313 SYS_AIO_RETURN = 314 SYS_AIO_SUSPEND = 315 SYS_AIO_CANCEL = 316 SYS_AIO_ERROR = 317 SYS_AIO_READ = 318 SYS_AIO_WRITE = 319 SYS_LIO_LISTIO = 320 SYS_IOPOLICYSYS = 322 SYS_PROCESS_POLICY = 323 SYS_MLOCKALL = 324 SYS_MUNLOCKALL = 325 SYS_ISSETUGID = 327 SYS___PTHREAD_KILL = 328 SYS___PTHREAD_SIGMASK = 329 SYS___SIGWAIT = 330 SYS___DISABLE_THREADSIGNAL = 331 SYS___PTHREAD_MARKCANCEL = 332 SYS___PTHREAD_CANCELED = 333 SYS___SEMWAIT_SIGNAL = 334 SYS_PROC_INFO = 336 SYS_SENDFILE = 337 SYS_STAT64 = 338 SYS_FSTAT64 = 339 SYS_LSTAT64 = 340 SYS_STAT64_EXTENDED = 341 SYS_LSTAT64_EXTENDED = 342 SYS_FSTAT64_EXTENDED = 343 SYS_GETDIRENTRIES64 = 344 SYS_STATFS64 = 345 SYS_FSTATFS64 = 346 SYS_GETFSSTAT64 = 347 SYS___PTHREAD_CHDIR = 348 SYS___PTHREAD_FCHDIR = 349 SYS_AUDIT = 350 SYS_AUDITON = 351 SYS_GETAUID = 353 SYS_SETAUID = 354 SYS_GETAUDIT_ADDR = 357 SYS_SETAUDIT_ADDR = 358 SYS_AUDITCTL = 359 SYS_BSDTHREAD_CREATE = 360 SYS_BSDTHREAD_TERMINATE = 361 SYS_KQUEUE = 362 SYS_KEVENT = 363 SYS_LCHOWN = 364 SYS_BSDTHREAD_REGISTER = 366 SYS_WORKQ_OPEN = 367 SYS_WORKQ_KERNRETURN = 368 SYS_KEVENT64 = 369 SYS___OLD_SEMWAIT_SIGNAL = 370 SYS___OLD_SEMWAIT_SIGNAL_NOCANCEL = 371 SYS_THREAD_SELFID = 372 SYS_LEDGER = 373 SYS_KEVENT_QOS = 374 SYS_KEVENT_ID = 375 SYS___MAC_EXECVE = 380 SYS___MAC_SYSCALL = 381 SYS___MAC_GET_FILE = 382 SYS___MAC_SET_FILE = 383 SYS___MAC_GET_LINK = 384 SYS___MAC_SET_LINK = 385 SYS___MAC_GET_PROC = 386 SYS___MAC_SET_PROC = 387 SYS___MAC_GET_FD = 388 SYS___MAC_SET_FD = 389 SYS___MAC_GET_PID = 390 SYS_PSELECT = 394 SYS_PSELECT_NOCANCEL = 395 SYS_READ_NOCANCEL = 396 SYS_WRITE_NOCANCEL = 397 SYS_OPEN_NOCANCEL = 398 SYS_CLOSE_NOCANCEL = 399 SYS_WAIT4_NOCANCEL = 400 SYS_RECVMSG_NOCANCEL = 401 SYS_SENDMSG_NOCANCEL = 402 SYS_RECVFROM_NOCANCEL = 403 SYS_ACCEPT_NOCANCEL = 404 SYS_MSYNC_NOCANCEL = 405 SYS_FCNTL_NOCANCEL = 406 SYS_SELECT_NOCANCEL = 407 SYS_FSYNC_NOCANCEL = 408 SYS_CONNECT_NOCANCEL = 409 SYS_SIGSUSPEND_NOCANCEL = 410 SYS_READV_NOCANCEL = 411 SYS_WRITEV_NOCANCEL = 412 SYS_SENDTO_NOCANCEL = 413 SYS_PREAD_NOCANCEL = 414 SYS_PWRITE_NOCANCEL = 415 SYS_WAITID_NOCANCEL = 416 SYS_POLL_NOCANCEL = 417 SYS_MSGSND_NOCANCEL = 418 SYS_MSGRCV_NOCANCEL = 419 SYS_SEM_WAIT_NOCANCEL = 420 SYS_AIO_SUSPEND_NOCANCEL = 421 SYS___SIGWAIT_NOCANCEL = 422 SYS___SEMWAIT_SIGNAL_NOCANCEL = 423 SYS___MAC_MOUNT = 424 SYS___MAC_GET_MOUNT = 425 SYS___MAC_GETFSSTAT = 426 SYS_FSGETPATH = 427 SYS_AUDIT_SESSION_SELF = 428 SYS_AUDIT_SESSION_JOIN = 429 SYS_FILEPORT_MAKEPORT = 430 SYS_FILEPORT_MAKEFD = 431 SYS_AUDIT_SESSION_PORT = 432 SYS_PID_SUSPEND = 433 SYS_PID_RESUME = 434 SYS_PID_HIBERNATE = 435 SYS_PID_SHUTDOWN_SOCKETS = 436 SYS_SHARED_REGION_MAP_AND_SLIDE_NP = 438 SYS_KAS_INFO = 439 SYS_MEMORYSTATUS_CONTROL = 440 SYS_GUARDED_OPEN_NP = 441 SYS_GUARDED_CLOSE_NP = 442 SYS_GUARDED_KQUEUE_NP = 443 SYS_CHANGE_FDGUARD_NP = 444 SYS_USRCTL = 445 SYS_PROC_RLIMIT_CONTROL = 446 SYS_CONNECTX = 447 SYS_DISCONNECTX = 448 SYS_PEELOFF = 449 SYS_SOCKET_DELEGATE = 450 SYS_TELEMETRY = 451 SYS_PROC_UUID_POLICY = 452 SYS_MEMORYSTATUS_GET_LEVEL = 453 SYS_SYSTEM_OVERRIDE = 454 SYS_VFS_PURGE = 455 SYS_SFI_CTL = 456 SYS_SFI_PIDCTL = 457 SYS_COALITION = 458 SYS_COALITION_INFO = 459 SYS_NECP_MATCH_POLICY = 460 SYS_GETATTRLISTBULK = 461 SYS_CLONEFILEAT = 462 SYS_OPENAT = 463 SYS_OPENAT_NOCANCEL = 464 SYS_RENAMEAT = 465 SYS_FACCESSAT = 466 SYS_FCHMODAT = 467 SYS_FCHOWNAT = 468 SYS_FSTATAT = 469 SYS_FSTATAT64 = 470 SYS_LINKAT = 471 SYS_UNLINKAT = 472 SYS_READLINKAT = 473 SYS_SYMLINKAT = 474 SYS_MKDIRAT = 475 SYS_GETATTRLISTAT = 476 SYS_PROC_TRACE_LOG = 477 SYS_BSDTHREAD_CTL = 478 SYS_OPENBYID_NP = 479 SYS_RECVMSG_X = 480 SYS_SENDMSG_X = 481 SYS_THREAD_SELFUSAGE = 482 SYS_CSRCTL = 483 SYS_GUARDED_OPEN_DPROTECTED_NP = 484 SYS_GUARDED_WRITE_NP = 485 SYS_GUARDED_PWRITE_NP = 486 SYS_GUARDED_WRITEV_NP = 487 SYS_RENAMEATX_NP = 488 SYS_MREMAP_ENCRYPTED = 489 SYS_NETAGENT_TRIGGER = 490 SYS_STACK_SNAPSHOT_WITH_CONFIG = 491 SYS_MICROSTACKSHOT = 492 SYS_GRAB_PGO_DATA = 493 SYS_PERSONA = 494 SYS_WORK_INTERVAL_CTL = 499 SYS_GETENTROPY = 500 SYS_NECP_OPEN = 501 SYS_NECP_CLIENT_ACTION = 502 SYS___NEXUS_OPEN = 503 SYS___NEXUS_REGISTER = 504 SYS___NEXUS_DEREGISTER = 505 SYS___NEXUS_CREATE = 506 SYS___NEXUS_DESTROY = 507 SYS___NEXUS_GET_OPT = 508 SYS___NEXUS_SET_OPT = 509 SYS___CHANNEL_OPEN = 510 SYS___CHANNEL_GET_INFO = 511 SYS___CHANNEL_SYNC = 512 SYS___CHANNEL_GET_OPT = 513 SYS___CHANNEL_SET_OPT = 514 SYS_ULOCK_WAIT = 515 SYS_ULOCK_WAKE = 516 SYS_FCLONEFILEAT = 517 SYS_FS_SNAPSHOT = 518 SYS_TERMINATE_WITH_PAYLOAD = 520 SYS_ABORT_WITH_PAYLOAD = 521 SYS_NECP_SESSION_OPEN = 522 SYS_NECP_SESSION_ACTION = 523 SYS_SETATTRLISTAT = 524 SYS_NET_QOS_GUIDELINE = 525 SYS_FMOUNT = 526 SYS_NTP_ADJTIME = 527 SYS_NTP_GETTIME = 528 SYS_OS_FAULT_WITH_PAYLOAD = 529 SYS_MAXSYSCALL = 530 SYS_INVALID = 63 ) ================================================ FILE: vendor/golang.org/x/sys/unix/zsysnum_dragonfly_amd64.go ================================================ // go run mksysnum.go https://gitweb.dragonflybsd.org/dragonfly.git/blob_plain/HEAD:/sys/kern/syscalls.master // Code generated by the command above; see README.md. DO NOT EDIT. //go:build amd64 && dragonfly package unix const ( SYS_EXIT = 1 // { void exit(int rval); } SYS_FORK = 2 // { int fork(void); } SYS_READ = 3 // { ssize_t read(int fd, void *buf, size_t nbyte); } SYS_WRITE = 4 // { ssize_t write(int fd, const void *buf, size_t nbyte); } SYS_OPEN = 5 // { int open(char *path, int flags, int mode); } SYS_CLOSE = 6 // { int close(int fd); } SYS_WAIT4 = 7 // { int wait4(int pid, int *status, int options, struct rusage *rusage); } wait4 wait_args int // SYS_NOSYS = 8; // { int nosys(void); } __nosys nosys_args int SYS_LINK = 9 // { int link(char *path, char *link); } SYS_UNLINK = 10 // { int unlink(char *path); } SYS_CHDIR = 12 // { int chdir(char *path); } SYS_FCHDIR = 13 // { int fchdir(int fd); } SYS_MKNOD = 14 // { int mknod(char *path, int mode, int dev); } SYS_CHMOD = 15 // { int chmod(char *path, int mode); } SYS_CHOWN = 16 // { int chown(char *path, int uid, int gid); } SYS_OBREAK = 17 // { int obreak(char *nsize); } break obreak_args int SYS_GETFSSTAT = 18 // { int getfsstat(struct statfs *buf, long bufsize, int flags); } SYS_GETPID = 20 // { pid_t getpid(void); } SYS_MOUNT = 21 // { int mount(char *type, char *path, int flags, caddr_t data); } SYS_UNMOUNT = 22 // { int unmount(char *path, int flags); } SYS_SETUID = 23 // { int setuid(uid_t uid); } SYS_GETUID = 24 // { uid_t getuid(void); } SYS_GETEUID = 25 // { uid_t geteuid(void); } SYS_PTRACE = 26 // { int ptrace(int req, pid_t pid, caddr_t addr, int data); } SYS_RECVMSG = 27 // { int recvmsg(int s, struct msghdr *msg, int flags); } SYS_SENDMSG = 28 // { int sendmsg(int s, caddr_t msg, int flags); } SYS_RECVFROM = 29 // { int recvfrom(int s, caddr_t buf, size_t len, int flags, caddr_t from, int *fromlenaddr); } SYS_ACCEPT = 30 // { int accept(int s, caddr_t name, int *anamelen); } SYS_GETPEERNAME = 31 // { int getpeername(int fdes, caddr_t asa, int *alen); } SYS_GETSOCKNAME = 32 // { int getsockname(int fdes, caddr_t asa, int *alen); } SYS_ACCESS = 33 // { int access(char *path, int flags); } SYS_CHFLAGS = 34 // { int chflags(const char *path, u_long flags); } SYS_FCHFLAGS = 35 // { int fchflags(int fd, u_long flags); } SYS_SYNC = 36 // { int sync(void); } SYS_KILL = 37 // { int kill(int pid, int signum); } SYS_GETPPID = 39 // { pid_t getppid(void); } SYS_DUP = 41 // { int dup(int fd); } SYS_PIPE = 42 // { int pipe(void); } SYS_GETEGID = 43 // { gid_t getegid(void); } SYS_PROFIL = 44 // { int profil(caddr_t samples, size_t size, u_long offset, u_int scale); } SYS_KTRACE = 45 // { int ktrace(const char *fname, int ops, int facs, int pid); } SYS_GETGID = 47 // { gid_t getgid(void); } SYS_GETLOGIN = 49 // { int getlogin(char *namebuf, size_t namelen); } SYS_SETLOGIN = 50 // { int setlogin(char *namebuf); } SYS_ACCT = 51 // { int acct(char *path); } SYS_SIGALTSTACK = 53 // { int sigaltstack(stack_t *ss, stack_t *oss); } SYS_IOCTL = 54 // { int ioctl(int fd, u_long com, caddr_t data); } SYS_REBOOT = 55 // { int reboot(int opt); } SYS_REVOKE = 56 // { int revoke(char *path); } SYS_SYMLINK = 57 // { int symlink(char *path, char *link); } SYS_READLINK = 58 // { int readlink(char *path, char *buf, int count); } SYS_EXECVE = 59 // { int execve(char *fname, char **argv, char **envv); } SYS_UMASK = 60 // { int umask(int newmask); } umask umask_args int SYS_CHROOT = 61 // { int chroot(char *path); } SYS_MSYNC = 65 // { int msync(void *addr, size_t len, int flags); } SYS_VFORK = 66 // { pid_t vfork(void); } SYS_SBRK = 69 // { caddr_t sbrk(size_t incr); } SYS_SSTK = 70 // { int sstk(size_t incr); } SYS_MUNMAP = 73 // { int munmap(void *addr, size_t len); } SYS_MPROTECT = 74 // { int mprotect(void *addr, size_t len, int prot); } SYS_MADVISE = 75 // { int madvise(void *addr, size_t len, int behav); } SYS_MINCORE = 78 // { int mincore(const void *addr, size_t len, char *vec); } SYS_GETGROUPS = 79 // { int getgroups(u_int gidsetsize, gid_t *gidset); } SYS_SETGROUPS = 80 // { int setgroups(u_int gidsetsize, gid_t *gidset); } SYS_GETPGRP = 81 // { int getpgrp(void); } SYS_SETPGID = 82 // { int setpgid(int pid, int pgid); } SYS_SETITIMER = 83 // { int setitimer(u_int which, struct itimerval *itv, struct itimerval *oitv); } SYS_SWAPON = 85 // { int swapon(char *name); } SYS_GETITIMER = 86 // { int getitimer(u_int which, struct itimerval *itv); } SYS_GETDTABLESIZE = 89 // { int getdtablesize(void); } SYS_DUP2 = 90 // { int dup2(int from, int to); } SYS_FCNTL = 92 // { int fcntl(int fd, int cmd, long arg); } SYS_SELECT = 93 // { int select(int nd, fd_set *in, fd_set *ou, fd_set *ex, struct timeval *tv); } SYS_FSYNC = 95 // { int fsync(int fd); } SYS_SETPRIORITY = 96 // { int setpriority(int which, int who, int prio); } SYS_SOCKET = 97 // { int socket(int domain, int type, int protocol); } SYS_CONNECT = 98 // { int connect(int s, caddr_t name, int namelen); } SYS_GETPRIORITY = 100 // { int getpriority(int which, int who); } SYS_BIND = 104 // { int bind(int s, caddr_t name, int namelen); } SYS_SETSOCKOPT = 105 // { int setsockopt(int s, int level, int name, caddr_t val, int valsize); } SYS_LISTEN = 106 // { int listen(int s, int backlog); } SYS_GETTIMEOFDAY = 116 // { int gettimeofday(struct timeval *tp, struct timezone *tzp); } SYS_GETRUSAGE = 117 // { int getrusage(int who, struct rusage *rusage); } SYS_GETSOCKOPT = 118 // { int getsockopt(int s, int level, int name, caddr_t val, int *avalsize); } SYS_READV = 120 // { int readv(int fd, struct iovec *iovp, u_int iovcnt); } SYS_WRITEV = 121 // { int writev(int fd, struct iovec *iovp, u_int iovcnt); } SYS_SETTIMEOFDAY = 122 // { int settimeofday(struct timeval *tv, struct timezone *tzp); } SYS_FCHOWN = 123 // { int fchown(int fd, int uid, int gid); } SYS_FCHMOD = 124 // { int fchmod(int fd, int mode); } SYS_SETREUID = 126 // { int setreuid(int ruid, int euid); } SYS_SETREGID = 127 // { int setregid(int rgid, int egid); } SYS_RENAME = 128 // { int rename(char *from, char *to); } SYS_FLOCK = 131 // { int flock(int fd, int how); } SYS_MKFIFO = 132 // { int mkfifo(char *path, int mode); } SYS_SENDTO = 133 // { int sendto(int s, caddr_t buf, size_t len, int flags, caddr_t to, int tolen); } SYS_SHUTDOWN = 134 // { int shutdown(int s, int how); } SYS_SOCKETPAIR = 135 // { int socketpair(int domain, int type, int protocol, int *rsv); } SYS_MKDIR = 136 // { int mkdir(char *path, int mode); } SYS_RMDIR = 137 // { int rmdir(char *path); } SYS_UTIMES = 138 // { int utimes(char *path, struct timeval *tptr); } SYS_ADJTIME = 140 // { int adjtime(struct timeval *delta, struct timeval *olddelta); } SYS_SETSID = 147 // { int setsid(void); } SYS_QUOTACTL = 148 // { int quotactl(char *path, int cmd, int uid, caddr_t arg); } SYS_STATFS = 157 // { int statfs(char *path, struct statfs *buf); } SYS_FSTATFS = 158 // { int fstatfs(int fd, struct statfs *buf); } SYS_GETFH = 161 // { int getfh(char *fname, struct fhandle *fhp); } SYS_SYSARCH = 165 // { int sysarch(int op, char *parms); } SYS_RTPRIO = 166 // { int rtprio(int function, pid_t pid, struct rtprio *rtp); } SYS_EXTPREAD = 173 // { ssize_t extpread(int fd, void *buf, size_t nbyte, int flags, off_t offset); } SYS_EXTPWRITE = 174 // { ssize_t extpwrite(int fd, const void *buf, size_t nbyte, int flags, off_t offset); } SYS_NTP_ADJTIME = 176 // { int ntp_adjtime(struct timex *tp); } SYS_SETGID = 181 // { int setgid(gid_t gid); } SYS_SETEGID = 182 // { int setegid(gid_t egid); } SYS_SETEUID = 183 // { int seteuid(uid_t euid); } SYS_PATHCONF = 191 // { int pathconf(char *path, int name); } SYS_FPATHCONF = 192 // { int fpathconf(int fd, int name); } SYS_GETRLIMIT = 194 // { int getrlimit(u_int which, struct rlimit *rlp); } getrlimit __getrlimit_args int SYS_SETRLIMIT = 195 // { int setrlimit(u_int which, struct rlimit *rlp); } setrlimit __setrlimit_args int SYS_MMAP = 197 // { caddr_t mmap(caddr_t addr, size_t len, int prot, int flags, int fd, int pad, off_t pos); } SYS_LSEEK = 199 // { off_t lseek(int fd, int pad, off_t offset, int whence); } SYS_TRUNCATE = 200 // { int truncate(char *path, int pad, off_t length); } SYS_FTRUNCATE = 201 // { int ftruncate(int fd, int pad, off_t length); } SYS___SYSCTL = 202 // { int __sysctl(int *name, u_int namelen, void *old, size_t *oldlenp, void *new, size_t newlen); } __sysctl sysctl_args int SYS_MLOCK = 203 // { int mlock(const void *addr, size_t len); } SYS_MUNLOCK = 204 // { int munlock(const void *addr, size_t len); } SYS_UNDELETE = 205 // { int undelete(char *path); } SYS_FUTIMES = 206 // { int futimes(int fd, struct timeval *tptr); } SYS_GETPGID = 207 // { int getpgid(pid_t pid); } SYS_POLL = 209 // { int poll(struct pollfd *fds, u_int nfds, int timeout); } SYS___SEMCTL = 220 // { int __semctl(int semid, int semnum, int cmd, union semun *arg); } SYS_SEMGET = 221 // { int semget(key_t key, int nsems, int semflg); } SYS_SEMOP = 222 // { int semop(int semid, struct sembuf *sops, u_int nsops); } SYS_MSGCTL = 224 // { int msgctl(int msqid, int cmd, struct msqid_ds *buf); } SYS_MSGGET = 225 // { int msgget(key_t key, int msgflg); } SYS_MSGSND = 226 // { int msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg); } SYS_MSGRCV = 227 // { int msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg); } SYS_SHMAT = 228 // { caddr_t shmat(int shmid, const void *shmaddr, int shmflg); } SYS_SHMCTL = 229 // { int shmctl(int shmid, int cmd, struct shmid_ds *buf); } SYS_SHMDT = 230 // { int shmdt(const void *shmaddr); } SYS_SHMGET = 231 // { int shmget(key_t key, size_t size, int shmflg); } SYS_CLOCK_GETTIME = 232 // { int clock_gettime(clockid_t clock_id, struct timespec *tp); } SYS_CLOCK_SETTIME = 233 // { int clock_settime(clockid_t clock_id, const struct timespec *tp); } SYS_CLOCK_GETRES = 234 // { int clock_getres(clockid_t clock_id, struct timespec *tp); } SYS_NANOSLEEP = 240 // { int nanosleep(const struct timespec *rqtp, struct timespec *rmtp); } SYS_MINHERIT = 250 // { int minherit(void *addr, size_t len, int inherit); } SYS_RFORK = 251 // { int rfork(int flags); } SYS_OPENBSD_POLL = 252 // { int openbsd_poll(struct pollfd *fds, u_int nfds, int timeout); } SYS_ISSETUGID = 253 // { int issetugid(void); } SYS_LCHOWN = 254 // { int lchown(char *path, int uid, int gid); } SYS_LCHMOD = 274 // { int lchmod(char *path, mode_t mode); } SYS_LUTIMES = 276 // { int lutimes(char *path, struct timeval *tptr); } SYS_EXTPREADV = 289 // { ssize_t extpreadv(int fd, const struct iovec *iovp, int iovcnt, int flags, off_t offset); } SYS_EXTPWRITEV = 290 // { ssize_t extpwritev(int fd, const struct iovec *iovp, int iovcnt, int flags, off_t offset); } SYS_FHSTATFS = 297 // { int fhstatfs(const struct fhandle *u_fhp, struct statfs *buf); } SYS_FHOPEN = 298 // { int fhopen(const struct fhandle *u_fhp, int flags); } SYS_MODNEXT = 300 // { int modnext(int modid); } SYS_MODSTAT = 301 // { int modstat(int modid, struct module_stat* stat); } SYS_MODFNEXT = 302 // { int modfnext(int modid); } SYS_MODFIND = 303 // { int modfind(const char *name); } SYS_KLDLOAD = 304 // { int kldload(const char *file); } SYS_KLDUNLOAD = 305 // { int kldunload(int fileid); } SYS_KLDFIND = 306 // { int kldfind(const char *file); } SYS_KLDNEXT = 307 // { int kldnext(int fileid); } SYS_KLDSTAT = 308 // { int kldstat(int fileid, struct kld_file_stat* stat); } SYS_KLDFIRSTMOD = 309 // { int kldfirstmod(int fileid); } SYS_GETSID = 310 // { int getsid(pid_t pid); } SYS_SETRESUID = 311 // { int setresuid(uid_t ruid, uid_t euid, uid_t suid); } SYS_SETRESGID = 312 // { int setresgid(gid_t rgid, gid_t egid, gid_t sgid); } SYS_AIO_RETURN = 314 // { int aio_return(struct aiocb *aiocbp); } SYS_AIO_SUSPEND = 315 // { int aio_suspend(struct aiocb * const * aiocbp, int nent, const struct timespec *timeout); } SYS_AIO_CANCEL = 316 // { int aio_cancel(int fd, struct aiocb *aiocbp); } SYS_AIO_ERROR = 317 // { int aio_error(struct aiocb *aiocbp); } SYS_AIO_READ = 318 // { int aio_read(struct aiocb *aiocbp); } SYS_AIO_WRITE = 319 // { int aio_write(struct aiocb *aiocbp); } SYS_LIO_LISTIO = 320 // { int lio_listio(int mode, struct aiocb * const *acb_list, int nent, struct sigevent *sig); } SYS_YIELD = 321 // { int yield(void); } SYS_MLOCKALL = 324 // { int mlockall(int how); } SYS_MUNLOCKALL = 325 // { int munlockall(void); } SYS___GETCWD = 326 // { int __getcwd(u_char *buf, u_int buflen); } SYS_SCHED_SETPARAM = 327 // { int sched_setparam (pid_t pid, const struct sched_param *param); } SYS_SCHED_GETPARAM = 328 // { int sched_getparam (pid_t pid, struct sched_param *param); } SYS_SCHED_SETSCHEDULER = 329 // { int sched_setscheduler (pid_t pid, int policy, const struct sched_param *param); } SYS_SCHED_GETSCHEDULER = 330 // { int sched_getscheduler (pid_t pid); } SYS_SCHED_YIELD = 331 // { int sched_yield (void); } SYS_SCHED_GET_PRIORITY_MAX = 332 // { int sched_get_priority_max (int policy); } SYS_SCHED_GET_PRIORITY_MIN = 333 // { int sched_get_priority_min (int policy); } SYS_SCHED_RR_GET_INTERVAL = 334 // { int sched_rr_get_interval (pid_t pid, struct timespec *interval); } SYS_UTRACE = 335 // { int utrace(const void *addr, size_t len); } SYS_KLDSYM = 337 // { int kldsym(int fileid, int cmd, void *data); } SYS_JAIL = 338 // { int jail(struct jail *jail); } SYS_SIGPROCMASK = 340 // { int sigprocmask(int how, const sigset_t *set, sigset_t *oset); } SYS_SIGSUSPEND = 341 // { int sigsuspend(const sigset_t *sigmask); } SYS_SIGACTION = 342 // { int sigaction(int sig, const struct sigaction *act, struct sigaction *oact); } SYS_SIGPENDING = 343 // { int sigpending(sigset_t *set); } SYS_SIGRETURN = 344 // { int sigreturn(ucontext_t *sigcntxp); } SYS_SIGTIMEDWAIT = 345 // { int sigtimedwait(const sigset_t *set,siginfo_t *info, const struct timespec *timeout); } SYS_SIGWAITINFO = 346 // { int sigwaitinfo(const sigset_t *set,siginfo_t *info); } SYS___ACL_GET_FILE = 347 // { int __acl_get_file(const char *path, acl_type_t type, struct acl *aclp); } SYS___ACL_SET_FILE = 348 // { int __acl_set_file(const char *path, acl_type_t type, struct acl *aclp); } SYS___ACL_GET_FD = 349 // { int __acl_get_fd(int filedes, acl_type_t type, struct acl *aclp); } SYS___ACL_SET_FD = 350 // { int __acl_set_fd(int filedes, acl_type_t type, struct acl *aclp); } SYS___ACL_DELETE_FILE = 351 // { int __acl_delete_file(const char *path, acl_type_t type); } SYS___ACL_DELETE_FD = 352 // { int __acl_delete_fd(int filedes, acl_type_t type); } SYS___ACL_ACLCHECK_FILE = 353 // { int __acl_aclcheck_file(const char *path, acl_type_t type, struct acl *aclp); } SYS___ACL_ACLCHECK_FD = 354 // { int __acl_aclcheck_fd(int filedes, acl_type_t type, struct acl *aclp); } SYS_EXTATTRCTL = 355 // { int extattrctl(const char *path, int cmd, const char *filename, int attrnamespace, const char *attrname); } SYS_EXTATTR_SET_FILE = 356 // { int extattr_set_file(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_GET_FILE = 357 // { int extattr_get_file(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_DELETE_FILE = 358 // { int extattr_delete_file(const char *path, int attrnamespace, const char *attrname); } SYS_AIO_WAITCOMPLETE = 359 // { int aio_waitcomplete(struct aiocb **aiocbp, struct timespec *timeout); } SYS_GETRESUID = 360 // { int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); } SYS_GETRESGID = 361 // { int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); } SYS_KQUEUE = 362 // { int kqueue(void); } SYS_KEVENT = 363 // { int kevent(int fd, const struct kevent *changelist, int nchanges, struct kevent *eventlist, int nevents, const struct timespec *timeout); } SYS_KENV = 390 // { int kenv(int what, const char *name, char *value, int len); } SYS_LCHFLAGS = 391 // { int lchflags(const char *path, u_long flags); } SYS_UUIDGEN = 392 // { int uuidgen(struct uuid *store, int count); } SYS_SENDFILE = 393 // { int sendfile(int fd, int s, off_t offset, size_t nbytes, struct sf_hdtr *hdtr, off_t *sbytes, int flags); } SYS_VARSYM_SET = 450 // { int varsym_set(int level, const char *name, const char *data); } SYS_VARSYM_GET = 451 // { int varsym_get(int mask, const char *wild, char *buf, int bufsize); } SYS_VARSYM_LIST = 452 // { int varsym_list(int level, char *buf, int maxsize, int *marker); } SYS_EXEC_SYS_REGISTER = 465 // { int exec_sys_register(void *entry); } SYS_EXEC_SYS_UNREGISTER = 466 // { int exec_sys_unregister(int id); } SYS_SYS_CHECKPOINT = 467 // { int sys_checkpoint(int type, int fd, pid_t pid, int retval); } SYS_MOUNTCTL = 468 // { int mountctl(const char *path, int op, int fd, const void *ctl, int ctllen, void *buf, int buflen); } SYS_UMTX_SLEEP = 469 // { int umtx_sleep(volatile const int *ptr, int value, int timeout); } SYS_UMTX_WAKEUP = 470 // { int umtx_wakeup(volatile const int *ptr, int count); } SYS_JAIL_ATTACH = 471 // { int jail_attach(int jid); } SYS_SET_TLS_AREA = 472 // { int set_tls_area(int which, struct tls_info *info, size_t infosize); } SYS_GET_TLS_AREA = 473 // { int get_tls_area(int which, struct tls_info *info, size_t infosize); } SYS_CLOSEFROM = 474 // { int closefrom(int fd); } SYS_STAT = 475 // { int stat(const char *path, struct stat *ub); } SYS_FSTAT = 476 // { int fstat(int fd, struct stat *sb); } SYS_LSTAT = 477 // { int lstat(const char *path, struct stat *ub); } SYS_FHSTAT = 478 // { int fhstat(const struct fhandle *u_fhp, struct stat *sb); } SYS_GETDIRENTRIES = 479 // { int getdirentries(int fd, char *buf, u_int count, long *basep); } SYS_GETDENTS = 480 // { int getdents(int fd, char *buf, size_t count); } SYS_USCHED_SET = 481 // { int usched_set(pid_t pid, int cmd, void *data, int bytes); } SYS_EXTACCEPT = 482 // { int extaccept(int s, int flags, caddr_t name, int *anamelen); } SYS_EXTCONNECT = 483 // { int extconnect(int s, int flags, caddr_t name, int namelen); } SYS_MCONTROL = 485 // { int mcontrol(void *addr, size_t len, int behav, off_t value); } SYS_VMSPACE_CREATE = 486 // { int vmspace_create(void *id, int type, void *data); } SYS_VMSPACE_DESTROY = 487 // { int vmspace_destroy(void *id); } SYS_VMSPACE_CTL = 488 // { int vmspace_ctl(void *id, int cmd, struct trapframe *tframe, struct vextframe *vframe); } SYS_VMSPACE_MMAP = 489 // { int vmspace_mmap(void *id, void *addr, size_t len, int prot, int flags, int fd, off_t offset); } SYS_VMSPACE_MUNMAP = 490 // { int vmspace_munmap(void *id, void *addr, size_t len); } SYS_VMSPACE_MCONTROL = 491 // { int vmspace_mcontrol(void *id, void *addr, size_t len, int behav, off_t value); } SYS_VMSPACE_PREAD = 492 // { ssize_t vmspace_pread(void *id, void *buf, size_t nbyte, int flags, off_t offset); } SYS_VMSPACE_PWRITE = 493 // { ssize_t vmspace_pwrite(void *id, const void *buf, size_t nbyte, int flags, off_t offset); } SYS_EXTEXIT = 494 // { void extexit(int how, int status, void *addr); } SYS_LWP_CREATE = 495 // { int lwp_create(struct lwp_params *params); } SYS_LWP_GETTID = 496 // { lwpid_t lwp_gettid(void); } SYS_LWP_KILL = 497 // { int lwp_kill(pid_t pid, lwpid_t tid, int signum); } SYS_LWP_RTPRIO = 498 // { int lwp_rtprio(int function, pid_t pid, lwpid_t tid, struct rtprio *rtp); } SYS_PSELECT = 499 // { int pselect(int nd, fd_set *in, fd_set *ou, fd_set *ex, const struct timespec *ts, const sigset_t *sigmask); } SYS_STATVFS = 500 // { int statvfs(const char *path, struct statvfs *buf); } SYS_FSTATVFS = 501 // { int fstatvfs(int fd, struct statvfs *buf); } SYS_FHSTATVFS = 502 // { int fhstatvfs(const struct fhandle *u_fhp, struct statvfs *buf); } SYS_GETVFSSTAT = 503 // { int getvfsstat(struct statfs *buf, struct statvfs *vbuf, long vbufsize, int flags); } SYS_OPENAT = 504 // { int openat(int fd, char *path, int flags, int mode); } SYS_FSTATAT = 505 // { int fstatat(int fd, char *path, struct stat *sb, int flags); } SYS_FCHMODAT = 506 // { int fchmodat(int fd, char *path, int mode, int flags); } SYS_FCHOWNAT = 507 // { int fchownat(int fd, char *path, int uid, int gid, int flags); } SYS_UNLINKAT = 508 // { int unlinkat(int fd, char *path, int flags); } SYS_FACCESSAT = 509 // { int faccessat(int fd, char *path, int amode, int flags); } SYS_MQ_OPEN = 510 // { mqd_t mq_open(const char * name, int oflag, mode_t mode, struct mq_attr *attr); } SYS_MQ_CLOSE = 511 // { int mq_close(mqd_t mqdes); } SYS_MQ_UNLINK = 512 // { int mq_unlink(const char *name); } SYS_MQ_GETATTR = 513 // { int mq_getattr(mqd_t mqdes, struct mq_attr *mqstat); } SYS_MQ_SETATTR = 514 // { int mq_setattr(mqd_t mqdes, const struct mq_attr *mqstat, struct mq_attr *omqstat); } SYS_MQ_NOTIFY = 515 // { int mq_notify(mqd_t mqdes, const struct sigevent *notification); } SYS_MQ_SEND = 516 // { int mq_send(mqd_t mqdes, const char *msg_ptr, size_t msg_len, unsigned msg_prio); } SYS_MQ_RECEIVE = 517 // { ssize_t mq_receive(mqd_t mqdes, char *msg_ptr, size_t msg_len, unsigned *msg_prio); } SYS_MQ_TIMEDSEND = 518 // { int mq_timedsend(mqd_t mqdes, const char *msg_ptr, size_t msg_len, unsigned msg_prio, const struct timespec *abs_timeout); } SYS_MQ_TIMEDRECEIVE = 519 // { ssize_t mq_timedreceive(mqd_t mqdes, char *msg_ptr, size_t msg_len, unsigned *msg_prio, const struct timespec *abs_timeout); } SYS_IOPRIO_SET = 520 // { int ioprio_set(int which, int who, int prio); } SYS_IOPRIO_GET = 521 // { int ioprio_get(int which, int who); } SYS_CHROOT_KERNEL = 522 // { int chroot_kernel(char *path); } SYS_RENAMEAT = 523 // { int renameat(int oldfd, char *old, int newfd, char *new); } SYS_MKDIRAT = 524 // { int mkdirat(int fd, char *path, mode_t mode); } SYS_MKFIFOAT = 525 // { int mkfifoat(int fd, char *path, mode_t mode); } SYS_MKNODAT = 526 // { int mknodat(int fd, char *path, mode_t mode, dev_t dev); } SYS_READLINKAT = 527 // { int readlinkat(int fd, char *path, char *buf, size_t bufsize); } SYS_SYMLINKAT = 528 // { int symlinkat(char *path1, int fd, char *path2); } SYS_SWAPOFF = 529 // { int swapoff(char *name); } SYS_VQUOTACTL = 530 // { int vquotactl(const char *path, struct plistref *pref); } SYS_LINKAT = 531 // { int linkat(int fd1, char *path1, int fd2, char *path2, int flags); } SYS_EACCESS = 532 // { int eaccess(char *path, int flags); } SYS_LPATHCONF = 533 // { int lpathconf(char *path, int name); } SYS_VMM_GUEST_CTL = 534 // { int vmm_guest_ctl(int op, struct vmm_guest_options *options); } SYS_VMM_GUEST_SYNC_ADDR = 535 // { int vmm_guest_sync_addr(long *dstaddr, long *srcaddr); } SYS_PROCCTL = 536 // { int procctl(idtype_t idtype, id_t id, int cmd, void *data); } SYS_CHFLAGSAT = 537 // { int chflagsat(int fd, const char *path, u_long flags, int atflags);} SYS_PIPE2 = 538 // { int pipe2(int *fildes, int flags); } SYS_UTIMENSAT = 539 // { int utimensat(int fd, const char *path, const struct timespec *ts, int flags); } SYS_FUTIMENS = 540 // { int futimens(int fd, const struct timespec *ts); } SYS_ACCEPT4 = 541 // { int accept4(int s, caddr_t name, int *anamelen, int flags); } SYS_LWP_SETNAME = 542 // { int lwp_setname(lwpid_t tid, const char *name); } SYS_PPOLL = 543 // { int ppoll(struct pollfd *fds, u_int nfds, const struct timespec *ts, const sigset_t *sigmask); } SYS_LWP_SETAFFINITY = 544 // { int lwp_setaffinity(pid_t pid, lwpid_t tid, const cpumask_t *mask); } SYS_LWP_GETAFFINITY = 545 // { int lwp_getaffinity(pid_t pid, lwpid_t tid, cpumask_t *mask); } SYS_LWP_CREATE2 = 546 // { int lwp_create2(struct lwp_params *params, const cpumask_t *mask); } SYS_GETCPUCLOCKID = 547 // { int getcpuclockid(pid_t pid, lwpid_t lwp_id, clockid_t *clock_id); } SYS_WAIT6 = 548 // { int wait6(idtype_t idtype, id_t id, int *status, int options, struct __wrusage *wrusage, siginfo_t *info); } SYS_LWP_GETNAME = 549 // { int lwp_getname(lwpid_t tid, char *name, size_t len); } SYS_GETRANDOM = 550 // { ssize_t getrandom(void *buf, size_t len, unsigned flags); } SYS___REALPATH = 551 // { ssize_t __realpath(const char *path, char *buf, size_t len); } ) ================================================ FILE: vendor/golang.org/x/sys/unix/zsysnum_freebsd_386.go ================================================ // go run mksysnum.go https://cgit.freebsd.org/src/plain/sys/kern/syscalls.master?h=stable/12 // Code generated by the command above; see README.md. DO NOT EDIT. //go:build 386 && freebsd package unix const ( // SYS_NOSYS = 0; // { int nosys(void); } syscall nosys_args int SYS_EXIT = 1 // { void sys_exit(int rval); } exit sys_exit_args void SYS_FORK = 2 // { int fork(void); } SYS_READ = 3 // { ssize_t read(int fd, void *buf, size_t nbyte); } SYS_WRITE = 4 // { ssize_t write(int fd, const void *buf, size_t nbyte); } SYS_OPEN = 5 // { int open(char *path, int flags, int mode); } SYS_CLOSE = 6 // { int close(int fd); } SYS_WAIT4 = 7 // { int wait4(int pid, int *status, int options, struct rusage *rusage); } SYS_LINK = 9 // { int link(char *path, char *link); } SYS_UNLINK = 10 // { int unlink(char *path); } SYS_CHDIR = 12 // { int chdir(char *path); } SYS_FCHDIR = 13 // { int fchdir(int fd); } SYS_CHMOD = 15 // { int chmod(char *path, int mode); } SYS_CHOWN = 16 // { int chown(char *path, int uid, int gid); } SYS_BREAK = 17 // { caddr_t break(char *nsize); } SYS_GETPID = 20 // { pid_t getpid(void); } SYS_MOUNT = 21 // { int mount(char *type, char *path, int flags, caddr_t data); } SYS_UNMOUNT = 22 // { int unmount(char *path, int flags); } SYS_SETUID = 23 // { int setuid(uid_t uid); } SYS_GETUID = 24 // { uid_t getuid(void); } SYS_GETEUID = 25 // { uid_t geteuid(void); } SYS_PTRACE = 26 // { int ptrace(int req, pid_t pid, caddr_t addr, int data); } SYS_RECVMSG = 27 // { int recvmsg(int s, struct msghdr *msg, int flags); } SYS_SENDMSG = 28 // { int sendmsg(int s, struct msghdr *msg, int flags); } SYS_RECVFROM = 29 // { int recvfrom(int s, caddr_t buf, size_t len, int flags, struct sockaddr * __restrict from, __socklen_t * __restrict fromlenaddr); } SYS_ACCEPT = 30 // { int accept(int s, struct sockaddr * __restrict name, __socklen_t * __restrict anamelen); } SYS_GETPEERNAME = 31 // { int getpeername(int fdes, struct sockaddr * __restrict asa, __socklen_t * __restrict alen); } SYS_GETSOCKNAME = 32 // { int getsockname(int fdes, struct sockaddr * __restrict asa, __socklen_t * __restrict alen); } SYS_ACCESS = 33 // { int access(char *path, int amode); } SYS_CHFLAGS = 34 // { int chflags(const char *path, u_long flags); } SYS_FCHFLAGS = 35 // { int fchflags(int fd, u_long flags); } SYS_SYNC = 36 // { int sync(void); } SYS_KILL = 37 // { int kill(int pid, int signum); } SYS_GETPPID = 39 // { pid_t getppid(void); } SYS_DUP = 41 // { int dup(u_int fd); } SYS_GETEGID = 43 // { gid_t getegid(void); } SYS_PROFIL = 44 // { int profil(caddr_t samples, size_t size, size_t offset, u_int scale); } SYS_KTRACE = 45 // { int ktrace(const char *fname, int ops, int facs, int pid); } SYS_GETGID = 47 // { gid_t getgid(void); } SYS_GETLOGIN = 49 // { int getlogin(char *namebuf, u_int namelen); } SYS_SETLOGIN = 50 // { int setlogin(char *namebuf); } SYS_ACCT = 51 // { int acct(char *path); } SYS_SIGALTSTACK = 53 // { int sigaltstack(stack_t *ss, stack_t *oss); } SYS_IOCTL = 54 // { int ioctl(int fd, u_long com, caddr_t data); } SYS_REBOOT = 55 // { int reboot(int opt); } SYS_REVOKE = 56 // { int revoke(char *path); } SYS_SYMLINK = 57 // { int symlink(char *path, char *link); } SYS_READLINK = 58 // { ssize_t readlink(char *path, char *buf, size_t count); } SYS_EXECVE = 59 // { int execve(char *fname, char **argv, char **envv); } SYS_UMASK = 60 // { int umask(int newmask); } SYS_CHROOT = 61 // { int chroot(char *path); } SYS_MSYNC = 65 // { int msync(void *addr, size_t len, int flags); } SYS_VFORK = 66 // { int vfork(void); } SYS_SBRK = 69 // { int sbrk(int incr); } SYS_SSTK = 70 // { int sstk(int incr); } SYS_MUNMAP = 73 // { int munmap(void *addr, size_t len); } SYS_MPROTECT = 74 // { int mprotect(void *addr, size_t len, int prot); } SYS_MADVISE = 75 // { int madvise(void *addr, size_t len, int behav); } SYS_MINCORE = 78 // { int mincore(const void *addr, size_t len, char *vec); } SYS_GETGROUPS = 79 // { int getgroups(u_int gidsetsize, gid_t *gidset); } SYS_SETGROUPS = 80 // { int setgroups(u_int gidsetsize, gid_t *gidset); } SYS_GETPGRP = 81 // { int getpgrp(void); } SYS_SETPGID = 82 // { int setpgid(int pid, int pgid); } SYS_SETITIMER = 83 // { int setitimer(u_int which, struct itimerval *itv, struct itimerval *oitv); } SYS_SWAPON = 85 // { int swapon(char *name); } SYS_GETITIMER = 86 // { int getitimer(u_int which, struct itimerval *itv); } SYS_GETDTABLESIZE = 89 // { int getdtablesize(void); } SYS_DUP2 = 90 // { int dup2(u_int from, u_int to); } SYS_FCNTL = 92 // { int fcntl(int fd, int cmd, long arg); } SYS_SELECT = 93 // { int select(int nd, fd_set *in, fd_set *ou, fd_set *ex, struct timeval *tv); } SYS_FSYNC = 95 // { int fsync(int fd); } SYS_SETPRIORITY = 96 // { int setpriority(int which, int who, int prio); } SYS_SOCKET = 97 // { int socket(int domain, int type, int protocol); } SYS_CONNECT = 98 // { int connect(int s, caddr_t name, int namelen); } SYS_GETPRIORITY = 100 // { int getpriority(int which, int who); } SYS_BIND = 104 // { int bind(int s, caddr_t name, int namelen); } SYS_SETSOCKOPT = 105 // { int setsockopt(int s, int level, int name, caddr_t val, int valsize); } SYS_LISTEN = 106 // { int listen(int s, int backlog); } SYS_GETTIMEOFDAY = 116 // { int gettimeofday(struct timeval *tp, struct timezone *tzp); } SYS_GETRUSAGE = 117 // { int getrusage(int who, struct rusage *rusage); } SYS_GETSOCKOPT = 118 // { int getsockopt(int s, int level, int name, caddr_t val, int *avalsize); } SYS_READV = 120 // { int readv(int fd, struct iovec *iovp, u_int iovcnt); } SYS_WRITEV = 121 // { int writev(int fd, struct iovec *iovp, u_int iovcnt); } SYS_SETTIMEOFDAY = 122 // { int settimeofday(struct timeval *tv, struct timezone *tzp); } SYS_FCHOWN = 123 // { int fchown(int fd, int uid, int gid); } SYS_FCHMOD = 124 // { int fchmod(int fd, int mode); } SYS_SETREUID = 126 // { int setreuid(int ruid, int euid); } SYS_SETREGID = 127 // { int setregid(int rgid, int egid); } SYS_RENAME = 128 // { int rename(char *from, char *to); } SYS_FLOCK = 131 // { int flock(int fd, int how); } SYS_MKFIFO = 132 // { int mkfifo(char *path, int mode); } SYS_SENDTO = 133 // { int sendto(int s, caddr_t buf, size_t len, int flags, caddr_t to, int tolen); } SYS_SHUTDOWN = 134 // { int shutdown(int s, int how); } SYS_SOCKETPAIR = 135 // { int socketpair(int domain, int type, int protocol, int *rsv); } SYS_MKDIR = 136 // { int mkdir(char *path, int mode); } SYS_RMDIR = 137 // { int rmdir(char *path); } SYS_UTIMES = 138 // { int utimes(char *path, struct timeval *tptr); } SYS_ADJTIME = 140 // { int adjtime(struct timeval *delta, struct timeval *olddelta); } SYS_SETSID = 147 // { int setsid(void); } SYS_QUOTACTL = 148 // { int quotactl(char *path, int cmd, int uid, caddr_t arg); } SYS_NLM_SYSCALL = 154 // { int nlm_syscall(int debug_level, int grace_period, int addr_count, char **addrs); } SYS_NFSSVC = 155 // { int nfssvc(int flag, caddr_t argp); } SYS_LGETFH = 160 // { int lgetfh(char *fname, struct fhandle *fhp); } SYS_GETFH = 161 // { int getfh(char *fname, struct fhandle *fhp); } SYS_SYSARCH = 165 // { int sysarch(int op, char *parms); } SYS_RTPRIO = 166 // { int rtprio(int function, pid_t pid, struct rtprio *rtp); } SYS_SEMSYS = 169 // { int semsys(int which, int a2, int a3, int a4, int a5); } SYS_MSGSYS = 170 // { int msgsys(int which, int a2, int a3, int a4, int a5, int a6); } SYS_SHMSYS = 171 // { int shmsys(int which, int a2, int a3, int a4); } SYS_SETFIB = 175 // { int setfib(int fibnum); } SYS_NTP_ADJTIME = 176 // { int ntp_adjtime(struct timex *tp); } SYS_SETGID = 181 // { int setgid(gid_t gid); } SYS_SETEGID = 182 // { int setegid(gid_t egid); } SYS_SETEUID = 183 // { int seteuid(uid_t euid); } SYS_PATHCONF = 191 // { int pathconf(char *path, int name); } SYS_FPATHCONF = 192 // { int fpathconf(int fd, int name); } SYS_GETRLIMIT = 194 // { int getrlimit(u_int which, struct rlimit *rlp); } getrlimit __getrlimit_args int SYS_SETRLIMIT = 195 // { int setrlimit(u_int which, struct rlimit *rlp); } setrlimit __setrlimit_args int SYS___SYSCTL = 202 // { int __sysctl(int *name, u_int namelen, void *old, size_t *oldlenp, void *new, size_t newlen); } __sysctl sysctl_args int SYS_MLOCK = 203 // { int mlock(const void *addr, size_t len); } SYS_MUNLOCK = 204 // { int munlock(const void *addr, size_t len); } SYS_UNDELETE = 205 // { int undelete(char *path); } SYS_FUTIMES = 206 // { int futimes(int fd, struct timeval *tptr); } SYS_GETPGID = 207 // { int getpgid(pid_t pid); } SYS_POLL = 209 // { int poll(struct pollfd *fds, u_int nfds, int timeout); } SYS_SEMGET = 221 // { int semget(key_t key, int nsems, int semflg); } SYS_SEMOP = 222 // { int semop(int semid, struct sembuf *sops, size_t nsops); } SYS_MSGGET = 225 // { int msgget(key_t key, int msgflg); } SYS_MSGSND = 226 // { int msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg); } SYS_MSGRCV = 227 // { ssize_t msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg); } SYS_SHMAT = 228 // { int shmat(int shmid, const void *shmaddr, int shmflg); } SYS_SHMDT = 230 // { int shmdt(const void *shmaddr); } SYS_SHMGET = 231 // { int shmget(key_t key, size_t size, int shmflg); } SYS_CLOCK_GETTIME = 232 // { int clock_gettime(clockid_t clock_id, struct timespec *tp); } SYS_CLOCK_SETTIME = 233 // { int clock_settime(clockid_t clock_id, const struct timespec *tp); } SYS_CLOCK_GETRES = 234 // { int clock_getres(clockid_t clock_id, struct timespec *tp); } SYS_KTIMER_CREATE = 235 // { int ktimer_create(clockid_t clock_id, struct sigevent *evp, int *timerid); } SYS_KTIMER_DELETE = 236 // { int ktimer_delete(int timerid); } SYS_KTIMER_SETTIME = 237 // { int ktimer_settime(int timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue); } SYS_KTIMER_GETTIME = 238 // { int ktimer_gettime(int timerid, struct itimerspec *value); } SYS_KTIMER_GETOVERRUN = 239 // { int ktimer_getoverrun(int timerid); } SYS_NANOSLEEP = 240 // { int nanosleep(const struct timespec *rqtp, struct timespec *rmtp); } SYS_FFCLOCK_GETCOUNTER = 241 // { int ffclock_getcounter(ffcounter *ffcount); } SYS_FFCLOCK_SETESTIMATE = 242 // { int ffclock_setestimate(struct ffclock_estimate *cest); } SYS_FFCLOCK_GETESTIMATE = 243 // { int ffclock_getestimate(struct ffclock_estimate *cest); } SYS_CLOCK_NANOSLEEP = 244 // { int clock_nanosleep(clockid_t clock_id, int flags, const struct timespec *rqtp, struct timespec *rmtp); } SYS_CLOCK_GETCPUCLOCKID2 = 247 // { int clock_getcpuclockid2(id_t id, int which, clockid_t *clock_id); } SYS_NTP_GETTIME = 248 // { int ntp_gettime(struct ntptimeval *ntvp); } SYS_MINHERIT = 250 // { int minherit(void *addr, size_t len, int inherit); } SYS_RFORK = 251 // { int rfork(int flags); } SYS_ISSETUGID = 253 // { int issetugid(void); } SYS_LCHOWN = 254 // { int lchown(char *path, int uid, int gid); } SYS_AIO_READ = 255 // { int aio_read(struct aiocb *aiocbp); } SYS_AIO_WRITE = 256 // { int aio_write(struct aiocb *aiocbp); } SYS_LIO_LISTIO = 257 // { int lio_listio(int mode, struct aiocb* const *acb_list, int nent, struct sigevent *sig); } SYS_LCHMOD = 274 // { int lchmod(char *path, mode_t mode); } SYS_LUTIMES = 276 // { int lutimes(char *path, struct timeval *tptr); } SYS_PREADV = 289 // { ssize_t preadv(int fd, struct iovec *iovp, u_int iovcnt, off_t offset); } SYS_PWRITEV = 290 // { ssize_t pwritev(int fd, struct iovec *iovp, u_int iovcnt, off_t offset); } SYS_FHOPEN = 298 // { int fhopen(const struct fhandle *u_fhp, int flags); } SYS_MODNEXT = 300 // { int modnext(int modid); } SYS_MODSTAT = 301 // { int modstat(int modid, struct module_stat* stat); } SYS_MODFNEXT = 302 // { int modfnext(int modid); } SYS_MODFIND = 303 // { int modfind(const char *name); } SYS_KLDLOAD = 304 // { int kldload(const char *file); } SYS_KLDUNLOAD = 305 // { int kldunload(int fileid); } SYS_KLDFIND = 306 // { int kldfind(const char *file); } SYS_KLDNEXT = 307 // { int kldnext(int fileid); } SYS_KLDSTAT = 308 // { int kldstat(int fileid, struct kld_file_stat *stat); } SYS_KLDFIRSTMOD = 309 // { int kldfirstmod(int fileid); } SYS_GETSID = 310 // { int getsid(pid_t pid); } SYS_SETRESUID = 311 // { int setresuid(uid_t ruid, uid_t euid, uid_t suid); } SYS_SETRESGID = 312 // { int setresgid(gid_t rgid, gid_t egid, gid_t sgid); } SYS_AIO_RETURN = 314 // { ssize_t aio_return(struct aiocb *aiocbp); } SYS_AIO_SUSPEND = 315 // { int aio_suspend(struct aiocb * const * aiocbp, int nent, const struct timespec *timeout); } SYS_AIO_CANCEL = 316 // { int aio_cancel(int fd, struct aiocb *aiocbp); } SYS_AIO_ERROR = 317 // { int aio_error(struct aiocb *aiocbp); } SYS_YIELD = 321 // { int yield(void); } SYS_MLOCKALL = 324 // { int mlockall(int how); } SYS_MUNLOCKALL = 325 // { int munlockall(void); } SYS___GETCWD = 326 // { int __getcwd(char *buf, size_t buflen); } SYS_SCHED_SETPARAM = 327 // { int sched_setparam (pid_t pid, const struct sched_param *param); } SYS_SCHED_GETPARAM = 328 // { int sched_getparam (pid_t pid, struct sched_param *param); } SYS_SCHED_SETSCHEDULER = 329 // { int sched_setscheduler (pid_t pid, int policy, const struct sched_param *param); } SYS_SCHED_GETSCHEDULER = 330 // { int sched_getscheduler (pid_t pid); } SYS_SCHED_YIELD = 331 // { int sched_yield (void); } SYS_SCHED_GET_PRIORITY_MAX = 332 // { int sched_get_priority_max (int policy); } SYS_SCHED_GET_PRIORITY_MIN = 333 // { int sched_get_priority_min (int policy); } SYS_SCHED_RR_GET_INTERVAL = 334 // { int sched_rr_get_interval (pid_t pid, struct timespec *interval); } SYS_UTRACE = 335 // { int utrace(const void *addr, size_t len); } SYS_KLDSYM = 337 // { int kldsym(int fileid, int cmd, void *data); } SYS_JAIL = 338 // { int jail(struct jail *jail); } SYS_SIGPROCMASK = 340 // { int sigprocmask(int how, const sigset_t *set, sigset_t *oset); } SYS_SIGSUSPEND = 341 // { int sigsuspend(const sigset_t *sigmask); } SYS_SIGPENDING = 343 // { int sigpending(sigset_t *set); } SYS_SIGTIMEDWAIT = 345 // { int sigtimedwait(const sigset_t *set, siginfo_t *info, const struct timespec *timeout); } SYS_SIGWAITINFO = 346 // { int sigwaitinfo(const sigset_t *set, siginfo_t *info); } SYS___ACL_GET_FILE = 347 // { int __acl_get_file(const char *path, acl_type_t type, struct acl *aclp); } SYS___ACL_SET_FILE = 348 // { int __acl_set_file(const char *path, acl_type_t type, struct acl *aclp); } SYS___ACL_GET_FD = 349 // { int __acl_get_fd(int filedes, acl_type_t type, struct acl *aclp); } SYS___ACL_SET_FD = 350 // { int __acl_set_fd(int filedes, acl_type_t type, struct acl *aclp); } SYS___ACL_DELETE_FILE = 351 // { int __acl_delete_file(const char *path, acl_type_t type); } SYS___ACL_DELETE_FD = 352 // { int __acl_delete_fd(int filedes, acl_type_t type); } SYS___ACL_ACLCHECK_FILE = 353 // { int __acl_aclcheck_file(const char *path, acl_type_t type, struct acl *aclp); } SYS___ACL_ACLCHECK_FD = 354 // { int __acl_aclcheck_fd(int filedes, acl_type_t type, struct acl *aclp); } SYS_EXTATTRCTL = 355 // { int extattrctl(const char *path, int cmd, const char *filename, int attrnamespace, const char *attrname); } SYS_EXTATTR_SET_FILE = 356 // { ssize_t extattr_set_file(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_GET_FILE = 357 // { ssize_t extattr_get_file(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_DELETE_FILE = 358 // { int extattr_delete_file(const char *path, int attrnamespace, const char *attrname); } SYS_AIO_WAITCOMPLETE = 359 // { ssize_t aio_waitcomplete(struct aiocb **aiocbp, struct timespec *timeout); } SYS_GETRESUID = 360 // { int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); } SYS_GETRESGID = 361 // { int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); } SYS_KQUEUE = 362 // { int kqueue(void); } SYS_EXTATTR_SET_FD = 371 // { ssize_t extattr_set_fd(int fd, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_GET_FD = 372 // { ssize_t extattr_get_fd(int fd, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_DELETE_FD = 373 // { int extattr_delete_fd(int fd, int attrnamespace, const char *attrname); } SYS___SETUGID = 374 // { int __setugid(int flag); } SYS_EACCESS = 376 // { int eaccess(char *path, int amode); } SYS_NMOUNT = 378 // { int nmount(struct iovec *iovp, unsigned int iovcnt, int flags); } SYS___MAC_GET_PROC = 384 // { int __mac_get_proc(struct mac *mac_p); } SYS___MAC_SET_PROC = 385 // { int __mac_set_proc(struct mac *mac_p); } SYS___MAC_GET_FD = 386 // { int __mac_get_fd(int fd, struct mac *mac_p); } SYS___MAC_GET_FILE = 387 // { int __mac_get_file(const char *path_p, struct mac *mac_p); } SYS___MAC_SET_FD = 388 // { int __mac_set_fd(int fd, struct mac *mac_p); } SYS___MAC_SET_FILE = 389 // { int __mac_set_file(const char *path_p, struct mac *mac_p); } SYS_KENV = 390 // { int kenv(int what, const char *name, char *value, int len); } SYS_LCHFLAGS = 391 // { int lchflags(const char *path, u_long flags); } SYS_UUIDGEN = 392 // { int uuidgen(struct uuid *store, int count); } SYS_SENDFILE = 393 // { int sendfile(int fd, int s, off_t offset, size_t nbytes, struct sf_hdtr *hdtr, off_t *sbytes, int flags); } SYS_MAC_SYSCALL = 394 // { int mac_syscall(const char *policy, int call, void *arg); } SYS_KSEM_CLOSE = 400 // { int ksem_close(semid_t id); } SYS_KSEM_POST = 401 // { int ksem_post(semid_t id); } SYS_KSEM_WAIT = 402 // { int ksem_wait(semid_t id); } SYS_KSEM_TRYWAIT = 403 // { int ksem_trywait(semid_t id); } SYS_KSEM_INIT = 404 // { int ksem_init(semid_t *idp, unsigned int value); } SYS_KSEM_OPEN = 405 // { int ksem_open(semid_t *idp, const char *name, int oflag, mode_t mode, unsigned int value); } SYS_KSEM_UNLINK = 406 // { int ksem_unlink(const char *name); } SYS_KSEM_GETVALUE = 407 // { int ksem_getvalue(semid_t id, int *val); } SYS_KSEM_DESTROY = 408 // { int ksem_destroy(semid_t id); } SYS___MAC_GET_PID = 409 // { int __mac_get_pid(pid_t pid, struct mac *mac_p); } SYS___MAC_GET_LINK = 410 // { int __mac_get_link(const char *path_p, struct mac *mac_p); } SYS___MAC_SET_LINK = 411 // { int __mac_set_link(const char *path_p, struct mac *mac_p); } SYS_EXTATTR_SET_LINK = 412 // { ssize_t extattr_set_link(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_GET_LINK = 413 // { ssize_t extattr_get_link(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_DELETE_LINK = 414 // { int extattr_delete_link(const char *path, int attrnamespace, const char *attrname); } SYS___MAC_EXECVE = 415 // { int __mac_execve(char *fname, char **argv, char **envv, struct mac *mac_p); } SYS_SIGACTION = 416 // { int sigaction(int sig, const struct sigaction *act, struct sigaction *oact); } SYS_SIGRETURN = 417 // { int sigreturn(const struct __ucontext *sigcntxp); } SYS_GETCONTEXT = 421 // { int getcontext(struct __ucontext *ucp); } SYS_SETCONTEXT = 422 // { int setcontext(const struct __ucontext *ucp); } SYS_SWAPCONTEXT = 423 // { int swapcontext(struct __ucontext *oucp, const struct __ucontext *ucp); } SYS_SWAPOFF = 424 // { int swapoff(const char *name); } SYS___ACL_GET_LINK = 425 // { int __acl_get_link(const char *path, acl_type_t type, struct acl *aclp); } SYS___ACL_SET_LINK = 426 // { int __acl_set_link(const char *path, acl_type_t type, struct acl *aclp); } SYS___ACL_DELETE_LINK = 427 // { int __acl_delete_link(const char *path, acl_type_t type); } SYS___ACL_ACLCHECK_LINK = 428 // { int __acl_aclcheck_link(const char *path, acl_type_t type, struct acl *aclp); } SYS_SIGWAIT = 429 // { int sigwait(const sigset_t *set, int *sig); } SYS_THR_CREATE = 430 // { int thr_create(ucontext_t *ctx, long *id, int flags); } SYS_THR_EXIT = 431 // { void thr_exit(long *state); } SYS_THR_SELF = 432 // { int thr_self(long *id); } SYS_THR_KILL = 433 // { int thr_kill(long id, int sig); } SYS_JAIL_ATTACH = 436 // { int jail_attach(int jid); } SYS_EXTATTR_LIST_FD = 437 // { ssize_t extattr_list_fd(int fd, int attrnamespace, void *data, size_t nbytes); } SYS_EXTATTR_LIST_FILE = 438 // { ssize_t extattr_list_file(const char *path, int attrnamespace, void *data, size_t nbytes); } SYS_EXTATTR_LIST_LINK = 439 // { ssize_t extattr_list_link(const char *path, int attrnamespace, void *data, size_t nbytes); } SYS_KSEM_TIMEDWAIT = 441 // { int ksem_timedwait(semid_t id, const struct timespec *abstime); } SYS_THR_SUSPEND = 442 // { int thr_suspend(const struct timespec *timeout); } SYS_THR_WAKE = 443 // { int thr_wake(long id); } SYS_KLDUNLOADF = 444 // { int kldunloadf(int fileid, int flags); } SYS_AUDIT = 445 // { int audit(const void *record, u_int length); } SYS_AUDITON = 446 // { int auditon(int cmd, void *data, u_int length); } SYS_GETAUID = 447 // { int getauid(uid_t *auid); } SYS_SETAUID = 448 // { int setauid(uid_t *auid); } SYS_GETAUDIT = 449 // { int getaudit(struct auditinfo *auditinfo); } SYS_SETAUDIT = 450 // { int setaudit(struct auditinfo *auditinfo); } SYS_GETAUDIT_ADDR = 451 // { int getaudit_addr(struct auditinfo_addr *auditinfo_addr, u_int length); } SYS_SETAUDIT_ADDR = 452 // { int setaudit_addr(struct auditinfo_addr *auditinfo_addr, u_int length); } SYS_AUDITCTL = 453 // { int auditctl(char *path); } SYS__UMTX_OP = 454 // { int _umtx_op(void *obj, int op, u_long val, void *uaddr1, void *uaddr2); } SYS_THR_NEW = 455 // { int thr_new(struct thr_param *param, int param_size); } SYS_SIGQUEUE = 456 // { int sigqueue(pid_t pid, int signum, void *value); } SYS_KMQ_OPEN = 457 // { int kmq_open(const char *path, int flags, mode_t mode, const struct mq_attr *attr); } SYS_KMQ_SETATTR = 458 // { int kmq_setattr(int mqd, const struct mq_attr *attr, struct mq_attr *oattr); } SYS_KMQ_TIMEDRECEIVE = 459 // { int kmq_timedreceive(int mqd, char *msg_ptr, size_t msg_len, unsigned *msg_prio, const struct timespec *abs_timeout); } SYS_KMQ_TIMEDSEND = 460 // { int kmq_timedsend(int mqd, const char *msg_ptr, size_t msg_len, unsigned msg_prio, const struct timespec *abs_timeout); } SYS_KMQ_NOTIFY = 461 // { int kmq_notify(int mqd, const struct sigevent *sigev); } SYS_KMQ_UNLINK = 462 // { int kmq_unlink(const char *path); } SYS_ABORT2 = 463 // { int abort2(const char *why, int nargs, void **args); } SYS_THR_SET_NAME = 464 // { int thr_set_name(long id, const char *name); } SYS_AIO_FSYNC = 465 // { int aio_fsync(int op, struct aiocb *aiocbp); } SYS_RTPRIO_THREAD = 466 // { int rtprio_thread(int function, lwpid_t lwpid, struct rtprio *rtp); } SYS_SCTP_PEELOFF = 471 // { int sctp_peeloff(int sd, uint32_t name); } SYS_SCTP_GENERIC_SENDMSG = 472 // { int sctp_generic_sendmsg(int sd, caddr_t msg, int mlen, caddr_t to, __socklen_t tolen, struct sctp_sndrcvinfo *sinfo, int flags); } SYS_SCTP_GENERIC_SENDMSG_IOV = 473 // { int sctp_generic_sendmsg_iov(int sd, struct iovec *iov, int iovlen, caddr_t to, __socklen_t tolen, struct sctp_sndrcvinfo *sinfo, int flags); } SYS_SCTP_GENERIC_RECVMSG = 474 // { int sctp_generic_recvmsg(int sd, struct iovec *iov, int iovlen, struct sockaddr *from, __socklen_t *fromlenaddr, struct sctp_sndrcvinfo *sinfo, int *msg_flags); } SYS_PREAD = 475 // { ssize_t pread(int fd, void *buf, size_t nbyte, off_t offset); } SYS_PWRITE = 476 // { ssize_t pwrite(int fd, const void *buf, size_t nbyte, off_t offset); } SYS_MMAP = 477 // { caddr_t mmap(caddr_t addr, size_t len, int prot, int flags, int fd, off_t pos); } SYS_LSEEK = 478 // { off_t lseek(int fd, off_t offset, int whence); } SYS_TRUNCATE = 479 // { int truncate(char *path, off_t length); } SYS_FTRUNCATE = 480 // { int ftruncate(int fd, off_t length); } SYS_THR_KILL2 = 481 // { int thr_kill2(pid_t pid, long id, int sig); } SYS_SHM_OPEN = 482 // { int shm_open(const char *path, int flags, mode_t mode); } SYS_SHM_UNLINK = 483 // { int shm_unlink(const char *path); } SYS_CPUSET = 484 // { int cpuset(cpusetid_t *setid); } SYS_CPUSET_SETID = 485 // { int cpuset_setid(cpuwhich_t which, id_t id, cpusetid_t setid); } SYS_CPUSET_GETID = 486 // { int cpuset_getid(cpulevel_t level, cpuwhich_t which, id_t id, cpusetid_t *setid); } SYS_CPUSET_GETAFFINITY = 487 // { int cpuset_getaffinity(cpulevel_t level, cpuwhich_t which, id_t id, size_t cpusetsize, cpuset_t *mask); } SYS_CPUSET_SETAFFINITY = 488 // { int cpuset_setaffinity(cpulevel_t level, cpuwhich_t which, id_t id, size_t cpusetsize, const cpuset_t *mask); } SYS_FACCESSAT = 489 // { int faccessat(int fd, char *path, int amode, int flag); } SYS_FCHMODAT = 490 // { int fchmodat(int fd, char *path, mode_t mode, int flag); } SYS_FCHOWNAT = 491 // { int fchownat(int fd, char *path, uid_t uid, gid_t gid, int flag); } SYS_FEXECVE = 492 // { int fexecve(int fd, char **argv, char **envv); } SYS_FUTIMESAT = 494 // { int futimesat(int fd, char *path, struct timeval *times); } SYS_LINKAT = 495 // { int linkat(int fd1, char *path1, int fd2, char *path2, int flag); } SYS_MKDIRAT = 496 // { int mkdirat(int fd, char *path, mode_t mode); } SYS_MKFIFOAT = 497 // { int mkfifoat(int fd, char *path, mode_t mode); } SYS_OPENAT = 499 // { int openat(int fd, char *path, int flag, mode_t mode); } SYS_READLINKAT = 500 // { ssize_t readlinkat(int fd, char *path, char *buf, size_t bufsize); } SYS_RENAMEAT = 501 // { int renameat(int oldfd, char *old, int newfd, char *new); } SYS_SYMLINKAT = 502 // { int symlinkat(char *path1, int fd, char *path2); } SYS_UNLINKAT = 503 // { int unlinkat(int fd, char *path, int flag); } SYS_POSIX_OPENPT = 504 // { int posix_openpt(int flags); } SYS_GSSD_SYSCALL = 505 // { int gssd_syscall(char *path); } SYS_JAIL_GET = 506 // { int jail_get(struct iovec *iovp, unsigned int iovcnt, int flags); } SYS_JAIL_SET = 507 // { int jail_set(struct iovec *iovp, unsigned int iovcnt, int flags); } SYS_JAIL_REMOVE = 508 // { int jail_remove(int jid); } SYS_CLOSEFROM = 509 // { int closefrom(int lowfd); } SYS___SEMCTL = 510 // { int __semctl(int semid, int semnum, int cmd, union semun *arg); } SYS_MSGCTL = 511 // { int msgctl(int msqid, int cmd, struct msqid_ds *buf); } SYS_SHMCTL = 512 // { int shmctl(int shmid, int cmd, struct shmid_ds *buf); } SYS_LPATHCONF = 513 // { int lpathconf(char *path, int name); } SYS___CAP_RIGHTS_GET = 515 // { int __cap_rights_get(int version, int fd, cap_rights_t *rightsp); } SYS_CAP_ENTER = 516 // { int cap_enter(void); } SYS_CAP_GETMODE = 517 // { int cap_getmode(u_int *modep); } SYS_PDFORK = 518 // { int pdfork(int *fdp, int flags); } SYS_PDKILL = 519 // { int pdkill(int fd, int signum); } SYS_PDGETPID = 520 // { int pdgetpid(int fd, pid_t *pidp); } SYS_PSELECT = 522 // { int pselect(int nd, fd_set *in, fd_set *ou, fd_set *ex, const struct timespec *ts, const sigset_t *sm); } SYS_GETLOGINCLASS = 523 // { int getloginclass(char *namebuf, size_t namelen); } SYS_SETLOGINCLASS = 524 // { int setloginclass(const char *namebuf); } SYS_RCTL_GET_RACCT = 525 // { int rctl_get_racct(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); } SYS_RCTL_GET_RULES = 526 // { int rctl_get_rules(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); } SYS_RCTL_GET_LIMITS = 527 // { int rctl_get_limits(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); } SYS_RCTL_ADD_RULE = 528 // { int rctl_add_rule(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); } SYS_RCTL_REMOVE_RULE = 529 // { int rctl_remove_rule(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); } SYS_POSIX_FALLOCATE = 530 // { int posix_fallocate(int fd, off_t offset, off_t len); } SYS_POSIX_FADVISE = 531 // { int posix_fadvise(int fd, off_t offset, off_t len, int advice); } SYS_WAIT6 = 532 // { int wait6(idtype_t idtype, id_t id, int *status, int options, struct __wrusage *wrusage, siginfo_t *info); } SYS_CAP_RIGHTS_LIMIT = 533 // { int cap_rights_limit(int fd, cap_rights_t *rightsp); } SYS_CAP_IOCTLS_LIMIT = 534 // { int cap_ioctls_limit(int fd, const u_long *cmds, size_t ncmds); } SYS_CAP_IOCTLS_GET = 535 // { ssize_t cap_ioctls_get(int fd, u_long *cmds, size_t maxcmds); } SYS_CAP_FCNTLS_LIMIT = 536 // { int cap_fcntls_limit(int fd, uint32_t fcntlrights); } SYS_CAP_FCNTLS_GET = 537 // { int cap_fcntls_get(int fd, uint32_t *fcntlrightsp); } SYS_BINDAT = 538 // { int bindat(int fd, int s, caddr_t name, int namelen); } SYS_CONNECTAT = 539 // { int connectat(int fd, int s, caddr_t name, int namelen); } SYS_CHFLAGSAT = 540 // { int chflagsat(int fd, const char *path, u_long flags, int atflag); } SYS_ACCEPT4 = 541 // { int accept4(int s, struct sockaddr * __restrict name, __socklen_t * __restrict anamelen, int flags); } SYS_PIPE2 = 542 // { int pipe2(int *fildes, int flags); } SYS_AIO_MLOCK = 543 // { int aio_mlock(struct aiocb *aiocbp); } SYS_PROCCTL = 544 // { int procctl(idtype_t idtype, id_t id, int com, void *data); } SYS_PPOLL = 545 // { int ppoll(struct pollfd *fds, u_int nfds, const struct timespec *ts, const sigset_t *set); } SYS_FUTIMENS = 546 // { int futimens(int fd, struct timespec *times); } SYS_UTIMENSAT = 547 // { int utimensat(int fd, char *path, struct timespec *times, int flag); } SYS_FDATASYNC = 550 // { int fdatasync(int fd); } SYS_FSTAT = 551 // { int fstat(int fd, struct stat *sb); } SYS_FSTATAT = 552 // { int fstatat(int fd, char *path, struct stat *buf, int flag); } SYS_FHSTAT = 553 // { int fhstat(const struct fhandle *u_fhp, struct stat *sb); } SYS_GETDIRENTRIES = 554 // { ssize_t getdirentries(int fd, char *buf, size_t count, off_t *basep); } SYS_STATFS = 555 // { int statfs(char *path, struct statfs *buf); } SYS_FSTATFS = 556 // { int fstatfs(int fd, struct statfs *buf); } SYS_GETFSSTAT = 557 // { int getfsstat(struct statfs *buf, long bufsize, int mode); } SYS_FHSTATFS = 558 // { int fhstatfs(const struct fhandle *u_fhp, struct statfs *buf); } SYS_MKNODAT = 559 // { int mknodat(int fd, char *path, mode_t mode, dev_t dev); } SYS_KEVENT = 560 // { int kevent(int fd, struct kevent *changelist, int nchanges, struct kevent *eventlist, int nevents, const struct timespec *timeout); } SYS_CPUSET_GETDOMAIN = 561 // { int cpuset_getdomain(cpulevel_t level, cpuwhich_t which, id_t id, size_t domainsetsize, domainset_t *mask, int *policy); } SYS_CPUSET_SETDOMAIN = 562 // { int cpuset_setdomain(cpulevel_t level, cpuwhich_t which, id_t id, size_t domainsetsize, domainset_t *mask, int policy); } SYS_GETRANDOM = 563 // { int getrandom(void *buf, size_t buflen, unsigned int flags); } SYS_GETFHAT = 564 // { int getfhat(int fd, char *path, struct fhandle *fhp, int flags); } SYS_FHLINK = 565 // { int fhlink(struct fhandle *fhp, const char *to); } SYS_FHLINKAT = 566 // { int fhlinkat(struct fhandle *fhp, int tofd, const char *to,); } SYS_FHREADLINK = 567 // { int fhreadlink(struct fhandle *fhp, char *buf, size_t bufsize); } SYS___SYSCTLBYNAME = 570 // { int __sysctlbyname(const char *name, size_t namelen, void *old, size_t *oldlenp, void *new, size_t newlen); } SYS_CLOSE_RANGE = 575 // { int close_range(u_int lowfd, u_int highfd, int flags); } ) ================================================ FILE: vendor/golang.org/x/sys/unix/zsysnum_freebsd_amd64.go ================================================ // go run mksysnum.go https://cgit.freebsd.org/src/plain/sys/kern/syscalls.master?h=stable/12 // Code generated by the command above; see README.md. DO NOT EDIT. //go:build amd64 && freebsd package unix const ( // SYS_NOSYS = 0; // { int nosys(void); } syscall nosys_args int SYS_EXIT = 1 // { void sys_exit(int rval); } exit sys_exit_args void SYS_FORK = 2 // { int fork(void); } SYS_READ = 3 // { ssize_t read(int fd, void *buf, size_t nbyte); } SYS_WRITE = 4 // { ssize_t write(int fd, const void *buf, size_t nbyte); } SYS_OPEN = 5 // { int open(char *path, int flags, int mode); } SYS_CLOSE = 6 // { int close(int fd); } SYS_WAIT4 = 7 // { int wait4(int pid, int *status, int options, struct rusage *rusage); } SYS_LINK = 9 // { int link(char *path, char *link); } SYS_UNLINK = 10 // { int unlink(char *path); } SYS_CHDIR = 12 // { int chdir(char *path); } SYS_FCHDIR = 13 // { int fchdir(int fd); } SYS_CHMOD = 15 // { int chmod(char *path, int mode); } SYS_CHOWN = 16 // { int chown(char *path, int uid, int gid); } SYS_BREAK = 17 // { caddr_t break(char *nsize); } SYS_GETPID = 20 // { pid_t getpid(void); } SYS_MOUNT = 21 // { int mount(char *type, char *path, int flags, caddr_t data); } SYS_UNMOUNT = 22 // { int unmount(char *path, int flags); } SYS_SETUID = 23 // { int setuid(uid_t uid); } SYS_GETUID = 24 // { uid_t getuid(void); } SYS_GETEUID = 25 // { uid_t geteuid(void); } SYS_PTRACE = 26 // { int ptrace(int req, pid_t pid, caddr_t addr, int data); } SYS_RECVMSG = 27 // { int recvmsg(int s, struct msghdr *msg, int flags); } SYS_SENDMSG = 28 // { int sendmsg(int s, struct msghdr *msg, int flags); } SYS_RECVFROM = 29 // { int recvfrom(int s, caddr_t buf, size_t len, int flags, struct sockaddr * __restrict from, __socklen_t * __restrict fromlenaddr); } SYS_ACCEPT = 30 // { int accept(int s, struct sockaddr * __restrict name, __socklen_t * __restrict anamelen); } SYS_GETPEERNAME = 31 // { int getpeername(int fdes, struct sockaddr * __restrict asa, __socklen_t * __restrict alen); } SYS_GETSOCKNAME = 32 // { int getsockname(int fdes, struct sockaddr * __restrict asa, __socklen_t * __restrict alen); } SYS_ACCESS = 33 // { int access(char *path, int amode); } SYS_CHFLAGS = 34 // { int chflags(const char *path, u_long flags); } SYS_FCHFLAGS = 35 // { int fchflags(int fd, u_long flags); } SYS_SYNC = 36 // { int sync(void); } SYS_KILL = 37 // { int kill(int pid, int signum); } SYS_GETPPID = 39 // { pid_t getppid(void); } SYS_DUP = 41 // { int dup(u_int fd); } SYS_GETEGID = 43 // { gid_t getegid(void); } SYS_PROFIL = 44 // { int profil(caddr_t samples, size_t size, size_t offset, u_int scale); } SYS_KTRACE = 45 // { int ktrace(const char *fname, int ops, int facs, int pid); } SYS_GETGID = 47 // { gid_t getgid(void); } SYS_GETLOGIN = 49 // { int getlogin(char *namebuf, u_int namelen); } SYS_SETLOGIN = 50 // { int setlogin(char *namebuf); } SYS_ACCT = 51 // { int acct(char *path); } SYS_SIGALTSTACK = 53 // { int sigaltstack(stack_t *ss, stack_t *oss); } SYS_IOCTL = 54 // { int ioctl(int fd, u_long com, caddr_t data); } SYS_REBOOT = 55 // { int reboot(int opt); } SYS_REVOKE = 56 // { int revoke(char *path); } SYS_SYMLINK = 57 // { int symlink(char *path, char *link); } SYS_READLINK = 58 // { ssize_t readlink(char *path, char *buf, size_t count); } SYS_EXECVE = 59 // { int execve(char *fname, char **argv, char **envv); } SYS_UMASK = 60 // { int umask(int newmask); } SYS_CHROOT = 61 // { int chroot(char *path); } SYS_MSYNC = 65 // { int msync(void *addr, size_t len, int flags); } SYS_VFORK = 66 // { int vfork(void); } SYS_SBRK = 69 // { int sbrk(int incr); } SYS_SSTK = 70 // { int sstk(int incr); } SYS_MUNMAP = 73 // { int munmap(void *addr, size_t len); } SYS_MPROTECT = 74 // { int mprotect(void *addr, size_t len, int prot); } SYS_MADVISE = 75 // { int madvise(void *addr, size_t len, int behav); } SYS_MINCORE = 78 // { int mincore(const void *addr, size_t len, char *vec); } SYS_GETGROUPS = 79 // { int getgroups(u_int gidsetsize, gid_t *gidset); } SYS_SETGROUPS = 80 // { int setgroups(u_int gidsetsize, gid_t *gidset); } SYS_GETPGRP = 81 // { int getpgrp(void); } SYS_SETPGID = 82 // { int setpgid(int pid, int pgid); } SYS_SETITIMER = 83 // { int setitimer(u_int which, struct itimerval *itv, struct itimerval *oitv); } SYS_SWAPON = 85 // { int swapon(char *name); } SYS_GETITIMER = 86 // { int getitimer(u_int which, struct itimerval *itv); } SYS_GETDTABLESIZE = 89 // { int getdtablesize(void); } SYS_DUP2 = 90 // { int dup2(u_int from, u_int to); } SYS_FCNTL = 92 // { int fcntl(int fd, int cmd, long arg); } SYS_SELECT = 93 // { int select(int nd, fd_set *in, fd_set *ou, fd_set *ex, struct timeval *tv); } SYS_FSYNC = 95 // { int fsync(int fd); } SYS_SETPRIORITY = 96 // { int setpriority(int which, int who, int prio); } SYS_SOCKET = 97 // { int socket(int domain, int type, int protocol); } SYS_CONNECT = 98 // { int connect(int s, caddr_t name, int namelen); } SYS_GETPRIORITY = 100 // { int getpriority(int which, int who); } SYS_BIND = 104 // { int bind(int s, caddr_t name, int namelen); } SYS_SETSOCKOPT = 105 // { int setsockopt(int s, int level, int name, caddr_t val, int valsize); } SYS_LISTEN = 106 // { int listen(int s, int backlog); } SYS_GETTIMEOFDAY = 116 // { int gettimeofday(struct timeval *tp, struct timezone *tzp); } SYS_GETRUSAGE = 117 // { int getrusage(int who, struct rusage *rusage); } SYS_GETSOCKOPT = 118 // { int getsockopt(int s, int level, int name, caddr_t val, int *avalsize); } SYS_READV = 120 // { int readv(int fd, struct iovec *iovp, u_int iovcnt); } SYS_WRITEV = 121 // { int writev(int fd, struct iovec *iovp, u_int iovcnt); } SYS_SETTIMEOFDAY = 122 // { int settimeofday(struct timeval *tv, struct timezone *tzp); } SYS_FCHOWN = 123 // { int fchown(int fd, int uid, int gid); } SYS_FCHMOD = 124 // { int fchmod(int fd, int mode); } SYS_SETREUID = 126 // { int setreuid(int ruid, int euid); } SYS_SETREGID = 127 // { int setregid(int rgid, int egid); } SYS_RENAME = 128 // { int rename(char *from, char *to); } SYS_FLOCK = 131 // { int flock(int fd, int how); } SYS_MKFIFO = 132 // { int mkfifo(char *path, int mode); } SYS_SENDTO = 133 // { int sendto(int s, caddr_t buf, size_t len, int flags, caddr_t to, int tolen); } SYS_SHUTDOWN = 134 // { int shutdown(int s, int how); } SYS_SOCKETPAIR = 135 // { int socketpair(int domain, int type, int protocol, int *rsv); } SYS_MKDIR = 136 // { int mkdir(char *path, int mode); } SYS_RMDIR = 137 // { int rmdir(char *path); } SYS_UTIMES = 138 // { int utimes(char *path, struct timeval *tptr); } SYS_ADJTIME = 140 // { int adjtime(struct timeval *delta, struct timeval *olddelta); } SYS_SETSID = 147 // { int setsid(void); } SYS_QUOTACTL = 148 // { int quotactl(char *path, int cmd, int uid, caddr_t arg); } SYS_NLM_SYSCALL = 154 // { int nlm_syscall(int debug_level, int grace_period, int addr_count, char **addrs); } SYS_NFSSVC = 155 // { int nfssvc(int flag, caddr_t argp); } SYS_LGETFH = 160 // { int lgetfh(char *fname, struct fhandle *fhp); } SYS_GETFH = 161 // { int getfh(char *fname, struct fhandle *fhp); } SYS_SYSARCH = 165 // { int sysarch(int op, char *parms); } SYS_RTPRIO = 166 // { int rtprio(int function, pid_t pid, struct rtprio *rtp); } SYS_SEMSYS = 169 // { int semsys(int which, int a2, int a3, int a4, int a5); } SYS_MSGSYS = 170 // { int msgsys(int which, int a2, int a3, int a4, int a5, int a6); } SYS_SHMSYS = 171 // { int shmsys(int which, int a2, int a3, int a4); } SYS_SETFIB = 175 // { int setfib(int fibnum); } SYS_NTP_ADJTIME = 176 // { int ntp_adjtime(struct timex *tp); } SYS_SETGID = 181 // { int setgid(gid_t gid); } SYS_SETEGID = 182 // { int setegid(gid_t egid); } SYS_SETEUID = 183 // { int seteuid(uid_t euid); } SYS_PATHCONF = 191 // { int pathconf(char *path, int name); } SYS_FPATHCONF = 192 // { int fpathconf(int fd, int name); } SYS_GETRLIMIT = 194 // { int getrlimit(u_int which, struct rlimit *rlp); } getrlimit __getrlimit_args int SYS_SETRLIMIT = 195 // { int setrlimit(u_int which, struct rlimit *rlp); } setrlimit __setrlimit_args int SYS___SYSCTL = 202 // { int __sysctl(int *name, u_int namelen, void *old, size_t *oldlenp, void *new, size_t newlen); } __sysctl sysctl_args int SYS_MLOCK = 203 // { int mlock(const void *addr, size_t len); } SYS_MUNLOCK = 204 // { int munlock(const void *addr, size_t len); } SYS_UNDELETE = 205 // { int undelete(char *path); } SYS_FUTIMES = 206 // { int futimes(int fd, struct timeval *tptr); } SYS_GETPGID = 207 // { int getpgid(pid_t pid); } SYS_POLL = 209 // { int poll(struct pollfd *fds, u_int nfds, int timeout); } SYS_SEMGET = 221 // { int semget(key_t key, int nsems, int semflg); } SYS_SEMOP = 222 // { int semop(int semid, struct sembuf *sops, size_t nsops); } SYS_MSGGET = 225 // { int msgget(key_t key, int msgflg); } SYS_MSGSND = 226 // { int msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg); } SYS_MSGRCV = 227 // { ssize_t msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg); } SYS_SHMAT = 228 // { int shmat(int shmid, const void *shmaddr, int shmflg); } SYS_SHMDT = 230 // { int shmdt(const void *shmaddr); } SYS_SHMGET = 231 // { int shmget(key_t key, size_t size, int shmflg); } SYS_CLOCK_GETTIME = 232 // { int clock_gettime(clockid_t clock_id, struct timespec *tp); } SYS_CLOCK_SETTIME = 233 // { int clock_settime(clockid_t clock_id, const struct timespec *tp); } SYS_CLOCK_GETRES = 234 // { int clock_getres(clockid_t clock_id, struct timespec *tp); } SYS_KTIMER_CREATE = 235 // { int ktimer_create(clockid_t clock_id, struct sigevent *evp, int *timerid); } SYS_KTIMER_DELETE = 236 // { int ktimer_delete(int timerid); } SYS_KTIMER_SETTIME = 237 // { int ktimer_settime(int timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue); } SYS_KTIMER_GETTIME = 238 // { int ktimer_gettime(int timerid, struct itimerspec *value); } SYS_KTIMER_GETOVERRUN = 239 // { int ktimer_getoverrun(int timerid); } SYS_NANOSLEEP = 240 // { int nanosleep(const struct timespec *rqtp, struct timespec *rmtp); } SYS_FFCLOCK_GETCOUNTER = 241 // { int ffclock_getcounter(ffcounter *ffcount); } SYS_FFCLOCK_SETESTIMATE = 242 // { int ffclock_setestimate(struct ffclock_estimate *cest); } SYS_FFCLOCK_GETESTIMATE = 243 // { int ffclock_getestimate(struct ffclock_estimate *cest); } SYS_CLOCK_NANOSLEEP = 244 // { int clock_nanosleep(clockid_t clock_id, int flags, const struct timespec *rqtp, struct timespec *rmtp); } SYS_CLOCK_GETCPUCLOCKID2 = 247 // { int clock_getcpuclockid2(id_t id, int which, clockid_t *clock_id); } SYS_NTP_GETTIME = 248 // { int ntp_gettime(struct ntptimeval *ntvp); } SYS_MINHERIT = 250 // { int minherit(void *addr, size_t len, int inherit); } SYS_RFORK = 251 // { int rfork(int flags); } SYS_ISSETUGID = 253 // { int issetugid(void); } SYS_LCHOWN = 254 // { int lchown(char *path, int uid, int gid); } SYS_AIO_READ = 255 // { int aio_read(struct aiocb *aiocbp); } SYS_AIO_WRITE = 256 // { int aio_write(struct aiocb *aiocbp); } SYS_LIO_LISTIO = 257 // { int lio_listio(int mode, struct aiocb* const *acb_list, int nent, struct sigevent *sig); } SYS_LCHMOD = 274 // { int lchmod(char *path, mode_t mode); } SYS_LUTIMES = 276 // { int lutimes(char *path, struct timeval *tptr); } SYS_PREADV = 289 // { ssize_t preadv(int fd, struct iovec *iovp, u_int iovcnt, off_t offset); } SYS_PWRITEV = 290 // { ssize_t pwritev(int fd, struct iovec *iovp, u_int iovcnt, off_t offset); } SYS_FHOPEN = 298 // { int fhopen(const struct fhandle *u_fhp, int flags); } SYS_MODNEXT = 300 // { int modnext(int modid); } SYS_MODSTAT = 301 // { int modstat(int modid, struct module_stat* stat); } SYS_MODFNEXT = 302 // { int modfnext(int modid); } SYS_MODFIND = 303 // { int modfind(const char *name); } SYS_KLDLOAD = 304 // { int kldload(const char *file); } SYS_KLDUNLOAD = 305 // { int kldunload(int fileid); } SYS_KLDFIND = 306 // { int kldfind(const char *file); } SYS_KLDNEXT = 307 // { int kldnext(int fileid); } SYS_KLDSTAT = 308 // { int kldstat(int fileid, struct kld_file_stat *stat); } SYS_KLDFIRSTMOD = 309 // { int kldfirstmod(int fileid); } SYS_GETSID = 310 // { int getsid(pid_t pid); } SYS_SETRESUID = 311 // { int setresuid(uid_t ruid, uid_t euid, uid_t suid); } SYS_SETRESGID = 312 // { int setresgid(gid_t rgid, gid_t egid, gid_t sgid); } SYS_AIO_RETURN = 314 // { ssize_t aio_return(struct aiocb *aiocbp); } SYS_AIO_SUSPEND = 315 // { int aio_suspend(struct aiocb * const * aiocbp, int nent, const struct timespec *timeout); } SYS_AIO_CANCEL = 316 // { int aio_cancel(int fd, struct aiocb *aiocbp); } SYS_AIO_ERROR = 317 // { int aio_error(struct aiocb *aiocbp); } SYS_YIELD = 321 // { int yield(void); } SYS_MLOCKALL = 324 // { int mlockall(int how); } SYS_MUNLOCKALL = 325 // { int munlockall(void); } SYS___GETCWD = 326 // { int __getcwd(char *buf, size_t buflen); } SYS_SCHED_SETPARAM = 327 // { int sched_setparam (pid_t pid, const struct sched_param *param); } SYS_SCHED_GETPARAM = 328 // { int sched_getparam (pid_t pid, struct sched_param *param); } SYS_SCHED_SETSCHEDULER = 329 // { int sched_setscheduler (pid_t pid, int policy, const struct sched_param *param); } SYS_SCHED_GETSCHEDULER = 330 // { int sched_getscheduler (pid_t pid); } SYS_SCHED_YIELD = 331 // { int sched_yield (void); } SYS_SCHED_GET_PRIORITY_MAX = 332 // { int sched_get_priority_max (int policy); } SYS_SCHED_GET_PRIORITY_MIN = 333 // { int sched_get_priority_min (int policy); } SYS_SCHED_RR_GET_INTERVAL = 334 // { int sched_rr_get_interval (pid_t pid, struct timespec *interval); } SYS_UTRACE = 335 // { int utrace(const void *addr, size_t len); } SYS_KLDSYM = 337 // { int kldsym(int fileid, int cmd, void *data); } SYS_JAIL = 338 // { int jail(struct jail *jail); } SYS_SIGPROCMASK = 340 // { int sigprocmask(int how, const sigset_t *set, sigset_t *oset); } SYS_SIGSUSPEND = 341 // { int sigsuspend(const sigset_t *sigmask); } SYS_SIGPENDING = 343 // { int sigpending(sigset_t *set); } SYS_SIGTIMEDWAIT = 345 // { int sigtimedwait(const sigset_t *set, siginfo_t *info, const struct timespec *timeout); } SYS_SIGWAITINFO = 346 // { int sigwaitinfo(const sigset_t *set, siginfo_t *info); } SYS___ACL_GET_FILE = 347 // { int __acl_get_file(const char *path, acl_type_t type, struct acl *aclp); } SYS___ACL_SET_FILE = 348 // { int __acl_set_file(const char *path, acl_type_t type, struct acl *aclp); } SYS___ACL_GET_FD = 349 // { int __acl_get_fd(int filedes, acl_type_t type, struct acl *aclp); } SYS___ACL_SET_FD = 350 // { int __acl_set_fd(int filedes, acl_type_t type, struct acl *aclp); } SYS___ACL_DELETE_FILE = 351 // { int __acl_delete_file(const char *path, acl_type_t type); } SYS___ACL_DELETE_FD = 352 // { int __acl_delete_fd(int filedes, acl_type_t type); } SYS___ACL_ACLCHECK_FILE = 353 // { int __acl_aclcheck_file(const char *path, acl_type_t type, struct acl *aclp); } SYS___ACL_ACLCHECK_FD = 354 // { int __acl_aclcheck_fd(int filedes, acl_type_t type, struct acl *aclp); } SYS_EXTATTRCTL = 355 // { int extattrctl(const char *path, int cmd, const char *filename, int attrnamespace, const char *attrname); } SYS_EXTATTR_SET_FILE = 356 // { ssize_t extattr_set_file(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_GET_FILE = 357 // { ssize_t extattr_get_file(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_DELETE_FILE = 358 // { int extattr_delete_file(const char *path, int attrnamespace, const char *attrname); } SYS_AIO_WAITCOMPLETE = 359 // { ssize_t aio_waitcomplete(struct aiocb **aiocbp, struct timespec *timeout); } SYS_GETRESUID = 360 // { int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); } SYS_GETRESGID = 361 // { int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); } SYS_KQUEUE = 362 // { int kqueue(void); } SYS_EXTATTR_SET_FD = 371 // { ssize_t extattr_set_fd(int fd, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_GET_FD = 372 // { ssize_t extattr_get_fd(int fd, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_DELETE_FD = 373 // { int extattr_delete_fd(int fd, int attrnamespace, const char *attrname); } SYS___SETUGID = 374 // { int __setugid(int flag); } SYS_EACCESS = 376 // { int eaccess(char *path, int amode); } SYS_NMOUNT = 378 // { int nmount(struct iovec *iovp, unsigned int iovcnt, int flags); } SYS___MAC_GET_PROC = 384 // { int __mac_get_proc(struct mac *mac_p); } SYS___MAC_SET_PROC = 385 // { int __mac_set_proc(struct mac *mac_p); } SYS___MAC_GET_FD = 386 // { int __mac_get_fd(int fd, struct mac *mac_p); } SYS___MAC_GET_FILE = 387 // { int __mac_get_file(const char *path_p, struct mac *mac_p); } SYS___MAC_SET_FD = 388 // { int __mac_set_fd(int fd, struct mac *mac_p); } SYS___MAC_SET_FILE = 389 // { int __mac_set_file(const char *path_p, struct mac *mac_p); } SYS_KENV = 390 // { int kenv(int what, const char *name, char *value, int len); } SYS_LCHFLAGS = 391 // { int lchflags(const char *path, u_long flags); } SYS_UUIDGEN = 392 // { int uuidgen(struct uuid *store, int count); } SYS_SENDFILE = 393 // { int sendfile(int fd, int s, off_t offset, size_t nbytes, struct sf_hdtr *hdtr, off_t *sbytes, int flags); } SYS_MAC_SYSCALL = 394 // { int mac_syscall(const char *policy, int call, void *arg); } SYS_KSEM_CLOSE = 400 // { int ksem_close(semid_t id); } SYS_KSEM_POST = 401 // { int ksem_post(semid_t id); } SYS_KSEM_WAIT = 402 // { int ksem_wait(semid_t id); } SYS_KSEM_TRYWAIT = 403 // { int ksem_trywait(semid_t id); } SYS_KSEM_INIT = 404 // { int ksem_init(semid_t *idp, unsigned int value); } SYS_KSEM_OPEN = 405 // { int ksem_open(semid_t *idp, const char *name, int oflag, mode_t mode, unsigned int value); } SYS_KSEM_UNLINK = 406 // { int ksem_unlink(const char *name); } SYS_KSEM_GETVALUE = 407 // { int ksem_getvalue(semid_t id, int *val); } SYS_KSEM_DESTROY = 408 // { int ksem_destroy(semid_t id); } SYS___MAC_GET_PID = 409 // { int __mac_get_pid(pid_t pid, struct mac *mac_p); } SYS___MAC_GET_LINK = 410 // { int __mac_get_link(const char *path_p, struct mac *mac_p); } SYS___MAC_SET_LINK = 411 // { int __mac_set_link(const char *path_p, struct mac *mac_p); } SYS_EXTATTR_SET_LINK = 412 // { ssize_t extattr_set_link(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_GET_LINK = 413 // { ssize_t extattr_get_link(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_DELETE_LINK = 414 // { int extattr_delete_link(const char *path, int attrnamespace, const char *attrname); } SYS___MAC_EXECVE = 415 // { int __mac_execve(char *fname, char **argv, char **envv, struct mac *mac_p); } SYS_SIGACTION = 416 // { int sigaction(int sig, const struct sigaction *act, struct sigaction *oact); } SYS_SIGRETURN = 417 // { int sigreturn(const struct __ucontext *sigcntxp); } SYS_GETCONTEXT = 421 // { int getcontext(struct __ucontext *ucp); } SYS_SETCONTEXT = 422 // { int setcontext(const struct __ucontext *ucp); } SYS_SWAPCONTEXT = 423 // { int swapcontext(struct __ucontext *oucp, const struct __ucontext *ucp); } SYS_SWAPOFF = 424 // { int swapoff(const char *name); } SYS___ACL_GET_LINK = 425 // { int __acl_get_link(const char *path, acl_type_t type, struct acl *aclp); } SYS___ACL_SET_LINK = 426 // { int __acl_set_link(const char *path, acl_type_t type, struct acl *aclp); } SYS___ACL_DELETE_LINK = 427 // { int __acl_delete_link(const char *path, acl_type_t type); } SYS___ACL_ACLCHECK_LINK = 428 // { int __acl_aclcheck_link(const char *path, acl_type_t type, struct acl *aclp); } SYS_SIGWAIT = 429 // { int sigwait(const sigset_t *set, int *sig); } SYS_THR_CREATE = 430 // { int thr_create(ucontext_t *ctx, long *id, int flags); } SYS_THR_EXIT = 431 // { void thr_exit(long *state); } SYS_THR_SELF = 432 // { int thr_self(long *id); } SYS_THR_KILL = 433 // { int thr_kill(long id, int sig); } SYS_JAIL_ATTACH = 436 // { int jail_attach(int jid); } SYS_EXTATTR_LIST_FD = 437 // { ssize_t extattr_list_fd(int fd, int attrnamespace, void *data, size_t nbytes); } SYS_EXTATTR_LIST_FILE = 438 // { ssize_t extattr_list_file(const char *path, int attrnamespace, void *data, size_t nbytes); } SYS_EXTATTR_LIST_LINK = 439 // { ssize_t extattr_list_link(const char *path, int attrnamespace, void *data, size_t nbytes); } SYS_KSEM_TIMEDWAIT = 441 // { int ksem_timedwait(semid_t id, const struct timespec *abstime); } SYS_THR_SUSPEND = 442 // { int thr_suspend(const struct timespec *timeout); } SYS_THR_WAKE = 443 // { int thr_wake(long id); } SYS_KLDUNLOADF = 444 // { int kldunloadf(int fileid, int flags); } SYS_AUDIT = 445 // { int audit(const void *record, u_int length); } SYS_AUDITON = 446 // { int auditon(int cmd, void *data, u_int length); } SYS_GETAUID = 447 // { int getauid(uid_t *auid); } SYS_SETAUID = 448 // { int setauid(uid_t *auid); } SYS_GETAUDIT = 449 // { int getaudit(struct auditinfo *auditinfo); } SYS_SETAUDIT = 450 // { int setaudit(struct auditinfo *auditinfo); } SYS_GETAUDIT_ADDR = 451 // { int getaudit_addr(struct auditinfo_addr *auditinfo_addr, u_int length); } SYS_SETAUDIT_ADDR = 452 // { int setaudit_addr(struct auditinfo_addr *auditinfo_addr, u_int length); } SYS_AUDITCTL = 453 // { int auditctl(char *path); } SYS__UMTX_OP = 454 // { int _umtx_op(void *obj, int op, u_long val, void *uaddr1, void *uaddr2); } SYS_THR_NEW = 455 // { int thr_new(struct thr_param *param, int param_size); } SYS_SIGQUEUE = 456 // { int sigqueue(pid_t pid, int signum, void *value); } SYS_KMQ_OPEN = 457 // { int kmq_open(const char *path, int flags, mode_t mode, const struct mq_attr *attr); } SYS_KMQ_SETATTR = 458 // { int kmq_setattr(int mqd, const struct mq_attr *attr, struct mq_attr *oattr); } SYS_KMQ_TIMEDRECEIVE = 459 // { int kmq_timedreceive(int mqd, char *msg_ptr, size_t msg_len, unsigned *msg_prio, const struct timespec *abs_timeout); } SYS_KMQ_TIMEDSEND = 460 // { int kmq_timedsend(int mqd, const char *msg_ptr, size_t msg_len, unsigned msg_prio, const struct timespec *abs_timeout); } SYS_KMQ_NOTIFY = 461 // { int kmq_notify(int mqd, const struct sigevent *sigev); } SYS_KMQ_UNLINK = 462 // { int kmq_unlink(const char *path); } SYS_ABORT2 = 463 // { int abort2(const char *why, int nargs, void **args); } SYS_THR_SET_NAME = 464 // { int thr_set_name(long id, const char *name); } SYS_AIO_FSYNC = 465 // { int aio_fsync(int op, struct aiocb *aiocbp); } SYS_RTPRIO_THREAD = 466 // { int rtprio_thread(int function, lwpid_t lwpid, struct rtprio *rtp); } SYS_SCTP_PEELOFF = 471 // { int sctp_peeloff(int sd, uint32_t name); } SYS_SCTP_GENERIC_SENDMSG = 472 // { int sctp_generic_sendmsg(int sd, caddr_t msg, int mlen, caddr_t to, __socklen_t tolen, struct sctp_sndrcvinfo *sinfo, int flags); } SYS_SCTP_GENERIC_SENDMSG_IOV = 473 // { int sctp_generic_sendmsg_iov(int sd, struct iovec *iov, int iovlen, caddr_t to, __socklen_t tolen, struct sctp_sndrcvinfo *sinfo, int flags); } SYS_SCTP_GENERIC_RECVMSG = 474 // { int sctp_generic_recvmsg(int sd, struct iovec *iov, int iovlen, struct sockaddr *from, __socklen_t *fromlenaddr, struct sctp_sndrcvinfo *sinfo, int *msg_flags); } SYS_PREAD = 475 // { ssize_t pread(int fd, void *buf, size_t nbyte, off_t offset); } SYS_PWRITE = 476 // { ssize_t pwrite(int fd, const void *buf, size_t nbyte, off_t offset); } SYS_MMAP = 477 // { caddr_t mmap(caddr_t addr, size_t len, int prot, int flags, int fd, off_t pos); } SYS_LSEEK = 478 // { off_t lseek(int fd, off_t offset, int whence); } SYS_TRUNCATE = 479 // { int truncate(char *path, off_t length); } SYS_FTRUNCATE = 480 // { int ftruncate(int fd, off_t length); } SYS_THR_KILL2 = 481 // { int thr_kill2(pid_t pid, long id, int sig); } SYS_SHM_OPEN = 482 // { int shm_open(const char *path, int flags, mode_t mode); } SYS_SHM_UNLINK = 483 // { int shm_unlink(const char *path); } SYS_CPUSET = 484 // { int cpuset(cpusetid_t *setid); } SYS_CPUSET_SETID = 485 // { int cpuset_setid(cpuwhich_t which, id_t id, cpusetid_t setid); } SYS_CPUSET_GETID = 486 // { int cpuset_getid(cpulevel_t level, cpuwhich_t which, id_t id, cpusetid_t *setid); } SYS_CPUSET_GETAFFINITY = 487 // { int cpuset_getaffinity(cpulevel_t level, cpuwhich_t which, id_t id, size_t cpusetsize, cpuset_t *mask); } SYS_CPUSET_SETAFFINITY = 488 // { int cpuset_setaffinity(cpulevel_t level, cpuwhich_t which, id_t id, size_t cpusetsize, const cpuset_t *mask); } SYS_FACCESSAT = 489 // { int faccessat(int fd, char *path, int amode, int flag); } SYS_FCHMODAT = 490 // { int fchmodat(int fd, char *path, mode_t mode, int flag); } SYS_FCHOWNAT = 491 // { int fchownat(int fd, char *path, uid_t uid, gid_t gid, int flag); } SYS_FEXECVE = 492 // { int fexecve(int fd, char **argv, char **envv); } SYS_FUTIMESAT = 494 // { int futimesat(int fd, char *path, struct timeval *times); } SYS_LINKAT = 495 // { int linkat(int fd1, char *path1, int fd2, char *path2, int flag); } SYS_MKDIRAT = 496 // { int mkdirat(int fd, char *path, mode_t mode); } SYS_MKFIFOAT = 497 // { int mkfifoat(int fd, char *path, mode_t mode); } SYS_OPENAT = 499 // { int openat(int fd, char *path, int flag, mode_t mode); } SYS_READLINKAT = 500 // { ssize_t readlinkat(int fd, char *path, char *buf, size_t bufsize); } SYS_RENAMEAT = 501 // { int renameat(int oldfd, char *old, int newfd, char *new); } SYS_SYMLINKAT = 502 // { int symlinkat(char *path1, int fd, char *path2); } SYS_UNLINKAT = 503 // { int unlinkat(int fd, char *path, int flag); } SYS_POSIX_OPENPT = 504 // { int posix_openpt(int flags); } SYS_GSSD_SYSCALL = 505 // { int gssd_syscall(char *path); } SYS_JAIL_GET = 506 // { int jail_get(struct iovec *iovp, unsigned int iovcnt, int flags); } SYS_JAIL_SET = 507 // { int jail_set(struct iovec *iovp, unsigned int iovcnt, int flags); } SYS_JAIL_REMOVE = 508 // { int jail_remove(int jid); } SYS_CLOSEFROM = 509 // { int closefrom(int lowfd); } SYS___SEMCTL = 510 // { int __semctl(int semid, int semnum, int cmd, union semun *arg); } SYS_MSGCTL = 511 // { int msgctl(int msqid, int cmd, struct msqid_ds *buf); } SYS_SHMCTL = 512 // { int shmctl(int shmid, int cmd, struct shmid_ds *buf); } SYS_LPATHCONF = 513 // { int lpathconf(char *path, int name); } SYS___CAP_RIGHTS_GET = 515 // { int __cap_rights_get(int version, int fd, cap_rights_t *rightsp); } SYS_CAP_ENTER = 516 // { int cap_enter(void); } SYS_CAP_GETMODE = 517 // { int cap_getmode(u_int *modep); } SYS_PDFORK = 518 // { int pdfork(int *fdp, int flags); } SYS_PDKILL = 519 // { int pdkill(int fd, int signum); } SYS_PDGETPID = 520 // { int pdgetpid(int fd, pid_t *pidp); } SYS_PSELECT = 522 // { int pselect(int nd, fd_set *in, fd_set *ou, fd_set *ex, const struct timespec *ts, const sigset_t *sm); } SYS_GETLOGINCLASS = 523 // { int getloginclass(char *namebuf, size_t namelen); } SYS_SETLOGINCLASS = 524 // { int setloginclass(const char *namebuf); } SYS_RCTL_GET_RACCT = 525 // { int rctl_get_racct(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); } SYS_RCTL_GET_RULES = 526 // { int rctl_get_rules(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); } SYS_RCTL_GET_LIMITS = 527 // { int rctl_get_limits(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); } SYS_RCTL_ADD_RULE = 528 // { int rctl_add_rule(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); } SYS_RCTL_REMOVE_RULE = 529 // { int rctl_remove_rule(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); } SYS_POSIX_FALLOCATE = 530 // { int posix_fallocate(int fd, off_t offset, off_t len); } SYS_POSIX_FADVISE = 531 // { int posix_fadvise(int fd, off_t offset, off_t len, int advice); } SYS_WAIT6 = 532 // { int wait6(idtype_t idtype, id_t id, int *status, int options, struct __wrusage *wrusage, siginfo_t *info); } SYS_CAP_RIGHTS_LIMIT = 533 // { int cap_rights_limit(int fd, cap_rights_t *rightsp); } SYS_CAP_IOCTLS_LIMIT = 534 // { int cap_ioctls_limit(int fd, const u_long *cmds, size_t ncmds); } SYS_CAP_IOCTLS_GET = 535 // { ssize_t cap_ioctls_get(int fd, u_long *cmds, size_t maxcmds); } SYS_CAP_FCNTLS_LIMIT = 536 // { int cap_fcntls_limit(int fd, uint32_t fcntlrights); } SYS_CAP_FCNTLS_GET = 537 // { int cap_fcntls_get(int fd, uint32_t *fcntlrightsp); } SYS_BINDAT = 538 // { int bindat(int fd, int s, caddr_t name, int namelen); } SYS_CONNECTAT = 539 // { int connectat(int fd, int s, caddr_t name, int namelen); } SYS_CHFLAGSAT = 540 // { int chflagsat(int fd, const char *path, u_long flags, int atflag); } SYS_ACCEPT4 = 541 // { int accept4(int s, struct sockaddr * __restrict name, __socklen_t * __restrict anamelen, int flags); } SYS_PIPE2 = 542 // { int pipe2(int *fildes, int flags); } SYS_AIO_MLOCK = 543 // { int aio_mlock(struct aiocb *aiocbp); } SYS_PROCCTL = 544 // { int procctl(idtype_t idtype, id_t id, int com, void *data); } SYS_PPOLL = 545 // { int ppoll(struct pollfd *fds, u_int nfds, const struct timespec *ts, const sigset_t *set); } SYS_FUTIMENS = 546 // { int futimens(int fd, struct timespec *times); } SYS_UTIMENSAT = 547 // { int utimensat(int fd, char *path, struct timespec *times, int flag); } SYS_FDATASYNC = 550 // { int fdatasync(int fd); } SYS_FSTAT = 551 // { int fstat(int fd, struct stat *sb); } SYS_FSTATAT = 552 // { int fstatat(int fd, char *path, struct stat *buf, int flag); } SYS_FHSTAT = 553 // { int fhstat(const struct fhandle *u_fhp, struct stat *sb); } SYS_GETDIRENTRIES = 554 // { ssize_t getdirentries(int fd, char *buf, size_t count, off_t *basep); } SYS_STATFS = 555 // { int statfs(char *path, struct statfs *buf); } SYS_FSTATFS = 556 // { int fstatfs(int fd, struct statfs *buf); } SYS_GETFSSTAT = 557 // { int getfsstat(struct statfs *buf, long bufsize, int mode); } SYS_FHSTATFS = 558 // { int fhstatfs(const struct fhandle *u_fhp, struct statfs *buf); } SYS_MKNODAT = 559 // { int mknodat(int fd, char *path, mode_t mode, dev_t dev); } SYS_KEVENT = 560 // { int kevent(int fd, struct kevent *changelist, int nchanges, struct kevent *eventlist, int nevents, const struct timespec *timeout); } SYS_CPUSET_GETDOMAIN = 561 // { int cpuset_getdomain(cpulevel_t level, cpuwhich_t which, id_t id, size_t domainsetsize, domainset_t *mask, int *policy); } SYS_CPUSET_SETDOMAIN = 562 // { int cpuset_setdomain(cpulevel_t level, cpuwhich_t which, id_t id, size_t domainsetsize, domainset_t *mask, int policy); } SYS_GETRANDOM = 563 // { int getrandom(void *buf, size_t buflen, unsigned int flags); } SYS_GETFHAT = 564 // { int getfhat(int fd, char *path, struct fhandle *fhp, int flags); } SYS_FHLINK = 565 // { int fhlink(struct fhandle *fhp, const char *to); } SYS_FHLINKAT = 566 // { int fhlinkat(struct fhandle *fhp, int tofd, const char *to,); } SYS_FHREADLINK = 567 // { int fhreadlink(struct fhandle *fhp, char *buf, size_t bufsize); } SYS___SYSCTLBYNAME = 570 // { int __sysctlbyname(const char *name, size_t namelen, void *old, size_t *oldlenp, void *new, size_t newlen); } SYS_CLOSE_RANGE = 575 // { int close_range(u_int lowfd, u_int highfd, int flags); } ) ================================================ FILE: vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm.go ================================================ // go run mksysnum.go https://cgit.freebsd.org/src/plain/sys/kern/syscalls.master?h=stable/12 // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm && freebsd package unix const ( // SYS_NOSYS = 0; // { int nosys(void); } syscall nosys_args int SYS_EXIT = 1 // { void sys_exit(int rval); } exit sys_exit_args void SYS_FORK = 2 // { int fork(void); } SYS_READ = 3 // { ssize_t read(int fd, void *buf, size_t nbyte); } SYS_WRITE = 4 // { ssize_t write(int fd, const void *buf, size_t nbyte); } SYS_OPEN = 5 // { int open(char *path, int flags, int mode); } SYS_CLOSE = 6 // { int close(int fd); } SYS_WAIT4 = 7 // { int wait4(int pid, int *status, int options, struct rusage *rusage); } SYS_LINK = 9 // { int link(char *path, char *link); } SYS_UNLINK = 10 // { int unlink(char *path); } SYS_CHDIR = 12 // { int chdir(char *path); } SYS_FCHDIR = 13 // { int fchdir(int fd); } SYS_CHMOD = 15 // { int chmod(char *path, int mode); } SYS_CHOWN = 16 // { int chown(char *path, int uid, int gid); } SYS_BREAK = 17 // { caddr_t break(char *nsize); } SYS_GETPID = 20 // { pid_t getpid(void); } SYS_MOUNT = 21 // { int mount(char *type, char *path, int flags, caddr_t data); } SYS_UNMOUNT = 22 // { int unmount(char *path, int flags); } SYS_SETUID = 23 // { int setuid(uid_t uid); } SYS_GETUID = 24 // { uid_t getuid(void); } SYS_GETEUID = 25 // { uid_t geteuid(void); } SYS_PTRACE = 26 // { int ptrace(int req, pid_t pid, caddr_t addr, int data); } SYS_RECVMSG = 27 // { int recvmsg(int s, struct msghdr *msg, int flags); } SYS_SENDMSG = 28 // { int sendmsg(int s, struct msghdr *msg, int flags); } SYS_RECVFROM = 29 // { int recvfrom(int s, caddr_t buf, size_t len, int flags, struct sockaddr * __restrict from, __socklen_t * __restrict fromlenaddr); } SYS_ACCEPT = 30 // { int accept(int s, struct sockaddr * __restrict name, __socklen_t * __restrict anamelen); } SYS_GETPEERNAME = 31 // { int getpeername(int fdes, struct sockaddr * __restrict asa, __socklen_t * __restrict alen); } SYS_GETSOCKNAME = 32 // { int getsockname(int fdes, struct sockaddr * __restrict asa, __socklen_t * __restrict alen); } SYS_ACCESS = 33 // { int access(char *path, int amode); } SYS_CHFLAGS = 34 // { int chflags(const char *path, u_long flags); } SYS_FCHFLAGS = 35 // { int fchflags(int fd, u_long flags); } SYS_SYNC = 36 // { int sync(void); } SYS_KILL = 37 // { int kill(int pid, int signum); } SYS_GETPPID = 39 // { pid_t getppid(void); } SYS_DUP = 41 // { int dup(u_int fd); } SYS_GETEGID = 43 // { gid_t getegid(void); } SYS_PROFIL = 44 // { int profil(caddr_t samples, size_t size, size_t offset, u_int scale); } SYS_KTRACE = 45 // { int ktrace(const char *fname, int ops, int facs, int pid); } SYS_GETGID = 47 // { gid_t getgid(void); } SYS_GETLOGIN = 49 // { int getlogin(char *namebuf, u_int namelen); } SYS_SETLOGIN = 50 // { int setlogin(char *namebuf); } SYS_ACCT = 51 // { int acct(char *path); } SYS_SIGALTSTACK = 53 // { int sigaltstack(stack_t *ss, stack_t *oss); } SYS_IOCTL = 54 // { int ioctl(int fd, u_long com, caddr_t data); } SYS_REBOOT = 55 // { int reboot(int opt); } SYS_REVOKE = 56 // { int revoke(char *path); } SYS_SYMLINK = 57 // { int symlink(char *path, char *link); } SYS_READLINK = 58 // { ssize_t readlink(char *path, char *buf, size_t count); } SYS_EXECVE = 59 // { int execve(char *fname, char **argv, char **envv); } SYS_UMASK = 60 // { int umask(int newmask); } SYS_CHROOT = 61 // { int chroot(char *path); } SYS_MSYNC = 65 // { int msync(void *addr, size_t len, int flags); } SYS_VFORK = 66 // { int vfork(void); } SYS_SBRK = 69 // { int sbrk(int incr); } SYS_SSTK = 70 // { int sstk(int incr); } SYS_MUNMAP = 73 // { int munmap(void *addr, size_t len); } SYS_MPROTECT = 74 // { int mprotect(void *addr, size_t len, int prot); } SYS_MADVISE = 75 // { int madvise(void *addr, size_t len, int behav); } SYS_MINCORE = 78 // { int mincore(const void *addr, size_t len, char *vec); } SYS_GETGROUPS = 79 // { int getgroups(u_int gidsetsize, gid_t *gidset); } SYS_SETGROUPS = 80 // { int setgroups(u_int gidsetsize, gid_t *gidset); } SYS_GETPGRP = 81 // { int getpgrp(void); } SYS_SETPGID = 82 // { int setpgid(int pid, int pgid); } SYS_SETITIMER = 83 // { int setitimer(u_int which, struct itimerval *itv, struct itimerval *oitv); } SYS_SWAPON = 85 // { int swapon(char *name); } SYS_GETITIMER = 86 // { int getitimer(u_int which, struct itimerval *itv); } SYS_GETDTABLESIZE = 89 // { int getdtablesize(void); } SYS_DUP2 = 90 // { int dup2(u_int from, u_int to); } SYS_FCNTL = 92 // { int fcntl(int fd, int cmd, long arg); } SYS_SELECT = 93 // { int select(int nd, fd_set *in, fd_set *ou, fd_set *ex, struct timeval *tv); } SYS_FSYNC = 95 // { int fsync(int fd); } SYS_SETPRIORITY = 96 // { int setpriority(int which, int who, int prio); } SYS_SOCKET = 97 // { int socket(int domain, int type, int protocol); } SYS_CONNECT = 98 // { int connect(int s, caddr_t name, int namelen); } SYS_GETPRIORITY = 100 // { int getpriority(int which, int who); } SYS_BIND = 104 // { int bind(int s, caddr_t name, int namelen); } SYS_SETSOCKOPT = 105 // { int setsockopt(int s, int level, int name, caddr_t val, int valsize); } SYS_LISTEN = 106 // { int listen(int s, int backlog); } SYS_GETTIMEOFDAY = 116 // { int gettimeofday(struct timeval *tp, struct timezone *tzp); } SYS_GETRUSAGE = 117 // { int getrusage(int who, struct rusage *rusage); } SYS_GETSOCKOPT = 118 // { int getsockopt(int s, int level, int name, caddr_t val, int *avalsize); } SYS_READV = 120 // { int readv(int fd, struct iovec *iovp, u_int iovcnt); } SYS_WRITEV = 121 // { int writev(int fd, struct iovec *iovp, u_int iovcnt); } SYS_SETTIMEOFDAY = 122 // { int settimeofday(struct timeval *tv, struct timezone *tzp); } SYS_FCHOWN = 123 // { int fchown(int fd, int uid, int gid); } SYS_FCHMOD = 124 // { int fchmod(int fd, int mode); } SYS_SETREUID = 126 // { int setreuid(int ruid, int euid); } SYS_SETREGID = 127 // { int setregid(int rgid, int egid); } SYS_RENAME = 128 // { int rename(char *from, char *to); } SYS_FLOCK = 131 // { int flock(int fd, int how); } SYS_MKFIFO = 132 // { int mkfifo(char *path, int mode); } SYS_SENDTO = 133 // { int sendto(int s, caddr_t buf, size_t len, int flags, caddr_t to, int tolen); } SYS_SHUTDOWN = 134 // { int shutdown(int s, int how); } SYS_SOCKETPAIR = 135 // { int socketpair(int domain, int type, int protocol, int *rsv); } SYS_MKDIR = 136 // { int mkdir(char *path, int mode); } SYS_RMDIR = 137 // { int rmdir(char *path); } SYS_UTIMES = 138 // { int utimes(char *path, struct timeval *tptr); } SYS_ADJTIME = 140 // { int adjtime(struct timeval *delta, struct timeval *olddelta); } SYS_SETSID = 147 // { int setsid(void); } SYS_QUOTACTL = 148 // { int quotactl(char *path, int cmd, int uid, caddr_t arg); } SYS_NLM_SYSCALL = 154 // { int nlm_syscall(int debug_level, int grace_period, int addr_count, char **addrs); } SYS_NFSSVC = 155 // { int nfssvc(int flag, caddr_t argp); } SYS_LGETFH = 160 // { int lgetfh(char *fname, struct fhandle *fhp); } SYS_GETFH = 161 // { int getfh(char *fname, struct fhandle *fhp); } SYS_SYSARCH = 165 // { int sysarch(int op, char *parms); } SYS_RTPRIO = 166 // { int rtprio(int function, pid_t pid, struct rtprio *rtp); } SYS_SEMSYS = 169 // { int semsys(int which, int a2, int a3, int a4, int a5); } SYS_MSGSYS = 170 // { int msgsys(int which, int a2, int a3, int a4, int a5, int a6); } SYS_SHMSYS = 171 // { int shmsys(int which, int a2, int a3, int a4); } SYS_SETFIB = 175 // { int setfib(int fibnum); } SYS_NTP_ADJTIME = 176 // { int ntp_adjtime(struct timex *tp); } SYS_SETGID = 181 // { int setgid(gid_t gid); } SYS_SETEGID = 182 // { int setegid(gid_t egid); } SYS_SETEUID = 183 // { int seteuid(uid_t euid); } SYS_PATHCONF = 191 // { int pathconf(char *path, int name); } SYS_FPATHCONF = 192 // { int fpathconf(int fd, int name); } SYS_GETRLIMIT = 194 // { int getrlimit(u_int which, struct rlimit *rlp); } getrlimit __getrlimit_args int SYS_SETRLIMIT = 195 // { int setrlimit(u_int which, struct rlimit *rlp); } setrlimit __setrlimit_args int SYS___SYSCTL = 202 // { int __sysctl(int *name, u_int namelen, void *old, size_t *oldlenp, void *new, size_t newlen); } __sysctl sysctl_args int SYS_MLOCK = 203 // { int mlock(const void *addr, size_t len); } SYS_MUNLOCK = 204 // { int munlock(const void *addr, size_t len); } SYS_UNDELETE = 205 // { int undelete(char *path); } SYS_FUTIMES = 206 // { int futimes(int fd, struct timeval *tptr); } SYS_GETPGID = 207 // { int getpgid(pid_t pid); } SYS_POLL = 209 // { int poll(struct pollfd *fds, u_int nfds, int timeout); } SYS_SEMGET = 221 // { int semget(key_t key, int nsems, int semflg); } SYS_SEMOP = 222 // { int semop(int semid, struct sembuf *sops, size_t nsops); } SYS_MSGGET = 225 // { int msgget(key_t key, int msgflg); } SYS_MSGSND = 226 // { int msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg); } SYS_MSGRCV = 227 // { ssize_t msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg); } SYS_SHMAT = 228 // { int shmat(int shmid, const void *shmaddr, int shmflg); } SYS_SHMDT = 230 // { int shmdt(const void *shmaddr); } SYS_SHMGET = 231 // { int shmget(key_t key, size_t size, int shmflg); } SYS_CLOCK_GETTIME = 232 // { int clock_gettime(clockid_t clock_id, struct timespec *tp); } SYS_CLOCK_SETTIME = 233 // { int clock_settime(clockid_t clock_id, const struct timespec *tp); } SYS_CLOCK_GETRES = 234 // { int clock_getres(clockid_t clock_id, struct timespec *tp); } SYS_KTIMER_CREATE = 235 // { int ktimer_create(clockid_t clock_id, struct sigevent *evp, int *timerid); } SYS_KTIMER_DELETE = 236 // { int ktimer_delete(int timerid); } SYS_KTIMER_SETTIME = 237 // { int ktimer_settime(int timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue); } SYS_KTIMER_GETTIME = 238 // { int ktimer_gettime(int timerid, struct itimerspec *value); } SYS_KTIMER_GETOVERRUN = 239 // { int ktimer_getoverrun(int timerid); } SYS_NANOSLEEP = 240 // { int nanosleep(const struct timespec *rqtp, struct timespec *rmtp); } SYS_FFCLOCK_GETCOUNTER = 241 // { int ffclock_getcounter(ffcounter *ffcount); } SYS_FFCLOCK_SETESTIMATE = 242 // { int ffclock_setestimate(struct ffclock_estimate *cest); } SYS_FFCLOCK_GETESTIMATE = 243 // { int ffclock_getestimate(struct ffclock_estimate *cest); } SYS_CLOCK_NANOSLEEP = 244 // { int clock_nanosleep(clockid_t clock_id, int flags, const struct timespec *rqtp, struct timespec *rmtp); } SYS_CLOCK_GETCPUCLOCKID2 = 247 // { int clock_getcpuclockid2(id_t id, int which, clockid_t *clock_id); } SYS_NTP_GETTIME = 248 // { int ntp_gettime(struct ntptimeval *ntvp); } SYS_MINHERIT = 250 // { int minherit(void *addr, size_t len, int inherit); } SYS_RFORK = 251 // { int rfork(int flags); } SYS_ISSETUGID = 253 // { int issetugid(void); } SYS_LCHOWN = 254 // { int lchown(char *path, int uid, int gid); } SYS_AIO_READ = 255 // { int aio_read(struct aiocb *aiocbp); } SYS_AIO_WRITE = 256 // { int aio_write(struct aiocb *aiocbp); } SYS_LIO_LISTIO = 257 // { int lio_listio(int mode, struct aiocb* const *acb_list, int nent, struct sigevent *sig); } SYS_LCHMOD = 274 // { int lchmod(char *path, mode_t mode); } SYS_LUTIMES = 276 // { int lutimes(char *path, struct timeval *tptr); } SYS_PREADV = 289 // { ssize_t preadv(int fd, struct iovec *iovp, u_int iovcnt, off_t offset); } SYS_PWRITEV = 290 // { ssize_t pwritev(int fd, struct iovec *iovp, u_int iovcnt, off_t offset); } SYS_FHOPEN = 298 // { int fhopen(const struct fhandle *u_fhp, int flags); } SYS_MODNEXT = 300 // { int modnext(int modid); } SYS_MODSTAT = 301 // { int modstat(int modid, struct module_stat* stat); } SYS_MODFNEXT = 302 // { int modfnext(int modid); } SYS_MODFIND = 303 // { int modfind(const char *name); } SYS_KLDLOAD = 304 // { int kldload(const char *file); } SYS_KLDUNLOAD = 305 // { int kldunload(int fileid); } SYS_KLDFIND = 306 // { int kldfind(const char *file); } SYS_KLDNEXT = 307 // { int kldnext(int fileid); } SYS_KLDSTAT = 308 // { int kldstat(int fileid, struct kld_file_stat *stat); } SYS_KLDFIRSTMOD = 309 // { int kldfirstmod(int fileid); } SYS_GETSID = 310 // { int getsid(pid_t pid); } SYS_SETRESUID = 311 // { int setresuid(uid_t ruid, uid_t euid, uid_t suid); } SYS_SETRESGID = 312 // { int setresgid(gid_t rgid, gid_t egid, gid_t sgid); } SYS_AIO_RETURN = 314 // { ssize_t aio_return(struct aiocb *aiocbp); } SYS_AIO_SUSPEND = 315 // { int aio_suspend(struct aiocb * const * aiocbp, int nent, const struct timespec *timeout); } SYS_AIO_CANCEL = 316 // { int aio_cancel(int fd, struct aiocb *aiocbp); } SYS_AIO_ERROR = 317 // { int aio_error(struct aiocb *aiocbp); } SYS_YIELD = 321 // { int yield(void); } SYS_MLOCKALL = 324 // { int mlockall(int how); } SYS_MUNLOCKALL = 325 // { int munlockall(void); } SYS___GETCWD = 326 // { int __getcwd(char *buf, size_t buflen); } SYS_SCHED_SETPARAM = 327 // { int sched_setparam (pid_t pid, const struct sched_param *param); } SYS_SCHED_GETPARAM = 328 // { int sched_getparam (pid_t pid, struct sched_param *param); } SYS_SCHED_SETSCHEDULER = 329 // { int sched_setscheduler (pid_t pid, int policy, const struct sched_param *param); } SYS_SCHED_GETSCHEDULER = 330 // { int sched_getscheduler (pid_t pid); } SYS_SCHED_YIELD = 331 // { int sched_yield (void); } SYS_SCHED_GET_PRIORITY_MAX = 332 // { int sched_get_priority_max (int policy); } SYS_SCHED_GET_PRIORITY_MIN = 333 // { int sched_get_priority_min (int policy); } SYS_SCHED_RR_GET_INTERVAL = 334 // { int sched_rr_get_interval (pid_t pid, struct timespec *interval); } SYS_UTRACE = 335 // { int utrace(const void *addr, size_t len); } SYS_KLDSYM = 337 // { int kldsym(int fileid, int cmd, void *data); } SYS_JAIL = 338 // { int jail(struct jail *jail); } SYS_SIGPROCMASK = 340 // { int sigprocmask(int how, const sigset_t *set, sigset_t *oset); } SYS_SIGSUSPEND = 341 // { int sigsuspend(const sigset_t *sigmask); } SYS_SIGPENDING = 343 // { int sigpending(sigset_t *set); } SYS_SIGTIMEDWAIT = 345 // { int sigtimedwait(const sigset_t *set, siginfo_t *info, const struct timespec *timeout); } SYS_SIGWAITINFO = 346 // { int sigwaitinfo(const sigset_t *set, siginfo_t *info); } SYS___ACL_GET_FILE = 347 // { int __acl_get_file(const char *path, acl_type_t type, struct acl *aclp); } SYS___ACL_SET_FILE = 348 // { int __acl_set_file(const char *path, acl_type_t type, struct acl *aclp); } SYS___ACL_GET_FD = 349 // { int __acl_get_fd(int filedes, acl_type_t type, struct acl *aclp); } SYS___ACL_SET_FD = 350 // { int __acl_set_fd(int filedes, acl_type_t type, struct acl *aclp); } SYS___ACL_DELETE_FILE = 351 // { int __acl_delete_file(const char *path, acl_type_t type); } SYS___ACL_DELETE_FD = 352 // { int __acl_delete_fd(int filedes, acl_type_t type); } SYS___ACL_ACLCHECK_FILE = 353 // { int __acl_aclcheck_file(const char *path, acl_type_t type, struct acl *aclp); } SYS___ACL_ACLCHECK_FD = 354 // { int __acl_aclcheck_fd(int filedes, acl_type_t type, struct acl *aclp); } SYS_EXTATTRCTL = 355 // { int extattrctl(const char *path, int cmd, const char *filename, int attrnamespace, const char *attrname); } SYS_EXTATTR_SET_FILE = 356 // { ssize_t extattr_set_file(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_GET_FILE = 357 // { ssize_t extattr_get_file(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_DELETE_FILE = 358 // { int extattr_delete_file(const char *path, int attrnamespace, const char *attrname); } SYS_AIO_WAITCOMPLETE = 359 // { ssize_t aio_waitcomplete(struct aiocb **aiocbp, struct timespec *timeout); } SYS_GETRESUID = 360 // { int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); } SYS_GETRESGID = 361 // { int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); } SYS_KQUEUE = 362 // { int kqueue(void); } SYS_EXTATTR_SET_FD = 371 // { ssize_t extattr_set_fd(int fd, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_GET_FD = 372 // { ssize_t extattr_get_fd(int fd, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_DELETE_FD = 373 // { int extattr_delete_fd(int fd, int attrnamespace, const char *attrname); } SYS___SETUGID = 374 // { int __setugid(int flag); } SYS_EACCESS = 376 // { int eaccess(char *path, int amode); } SYS_NMOUNT = 378 // { int nmount(struct iovec *iovp, unsigned int iovcnt, int flags); } SYS___MAC_GET_PROC = 384 // { int __mac_get_proc(struct mac *mac_p); } SYS___MAC_SET_PROC = 385 // { int __mac_set_proc(struct mac *mac_p); } SYS___MAC_GET_FD = 386 // { int __mac_get_fd(int fd, struct mac *mac_p); } SYS___MAC_GET_FILE = 387 // { int __mac_get_file(const char *path_p, struct mac *mac_p); } SYS___MAC_SET_FD = 388 // { int __mac_set_fd(int fd, struct mac *mac_p); } SYS___MAC_SET_FILE = 389 // { int __mac_set_file(const char *path_p, struct mac *mac_p); } SYS_KENV = 390 // { int kenv(int what, const char *name, char *value, int len); } SYS_LCHFLAGS = 391 // { int lchflags(const char *path, u_long flags); } SYS_UUIDGEN = 392 // { int uuidgen(struct uuid *store, int count); } SYS_SENDFILE = 393 // { int sendfile(int fd, int s, off_t offset, size_t nbytes, struct sf_hdtr *hdtr, off_t *sbytes, int flags); } SYS_MAC_SYSCALL = 394 // { int mac_syscall(const char *policy, int call, void *arg); } SYS_KSEM_CLOSE = 400 // { int ksem_close(semid_t id); } SYS_KSEM_POST = 401 // { int ksem_post(semid_t id); } SYS_KSEM_WAIT = 402 // { int ksem_wait(semid_t id); } SYS_KSEM_TRYWAIT = 403 // { int ksem_trywait(semid_t id); } SYS_KSEM_INIT = 404 // { int ksem_init(semid_t *idp, unsigned int value); } SYS_KSEM_OPEN = 405 // { int ksem_open(semid_t *idp, const char *name, int oflag, mode_t mode, unsigned int value); } SYS_KSEM_UNLINK = 406 // { int ksem_unlink(const char *name); } SYS_KSEM_GETVALUE = 407 // { int ksem_getvalue(semid_t id, int *val); } SYS_KSEM_DESTROY = 408 // { int ksem_destroy(semid_t id); } SYS___MAC_GET_PID = 409 // { int __mac_get_pid(pid_t pid, struct mac *mac_p); } SYS___MAC_GET_LINK = 410 // { int __mac_get_link(const char *path_p, struct mac *mac_p); } SYS___MAC_SET_LINK = 411 // { int __mac_set_link(const char *path_p, struct mac *mac_p); } SYS_EXTATTR_SET_LINK = 412 // { ssize_t extattr_set_link(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_GET_LINK = 413 // { ssize_t extattr_get_link(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_DELETE_LINK = 414 // { int extattr_delete_link(const char *path, int attrnamespace, const char *attrname); } SYS___MAC_EXECVE = 415 // { int __mac_execve(char *fname, char **argv, char **envv, struct mac *mac_p); } SYS_SIGACTION = 416 // { int sigaction(int sig, const struct sigaction *act, struct sigaction *oact); } SYS_SIGRETURN = 417 // { int sigreturn(const struct __ucontext *sigcntxp); } SYS_GETCONTEXT = 421 // { int getcontext(struct __ucontext *ucp); } SYS_SETCONTEXT = 422 // { int setcontext(const struct __ucontext *ucp); } SYS_SWAPCONTEXT = 423 // { int swapcontext(struct __ucontext *oucp, const struct __ucontext *ucp); } SYS_SWAPOFF = 424 // { int swapoff(const char *name); } SYS___ACL_GET_LINK = 425 // { int __acl_get_link(const char *path, acl_type_t type, struct acl *aclp); } SYS___ACL_SET_LINK = 426 // { int __acl_set_link(const char *path, acl_type_t type, struct acl *aclp); } SYS___ACL_DELETE_LINK = 427 // { int __acl_delete_link(const char *path, acl_type_t type); } SYS___ACL_ACLCHECK_LINK = 428 // { int __acl_aclcheck_link(const char *path, acl_type_t type, struct acl *aclp); } SYS_SIGWAIT = 429 // { int sigwait(const sigset_t *set, int *sig); } SYS_THR_CREATE = 430 // { int thr_create(ucontext_t *ctx, long *id, int flags); } SYS_THR_EXIT = 431 // { void thr_exit(long *state); } SYS_THR_SELF = 432 // { int thr_self(long *id); } SYS_THR_KILL = 433 // { int thr_kill(long id, int sig); } SYS_JAIL_ATTACH = 436 // { int jail_attach(int jid); } SYS_EXTATTR_LIST_FD = 437 // { ssize_t extattr_list_fd(int fd, int attrnamespace, void *data, size_t nbytes); } SYS_EXTATTR_LIST_FILE = 438 // { ssize_t extattr_list_file(const char *path, int attrnamespace, void *data, size_t nbytes); } SYS_EXTATTR_LIST_LINK = 439 // { ssize_t extattr_list_link(const char *path, int attrnamespace, void *data, size_t nbytes); } SYS_KSEM_TIMEDWAIT = 441 // { int ksem_timedwait(semid_t id, const struct timespec *abstime); } SYS_THR_SUSPEND = 442 // { int thr_suspend(const struct timespec *timeout); } SYS_THR_WAKE = 443 // { int thr_wake(long id); } SYS_KLDUNLOADF = 444 // { int kldunloadf(int fileid, int flags); } SYS_AUDIT = 445 // { int audit(const void *record, u_int length); } SYS_AUDITON = 446 // { int auditon(int cmd, void *data, u_int length); } SYS_GETAUID = 447 // { int getauid(uid_t *auid); } SYS_SETAUID = 448 // { int setauid(uid_t *auid); } SYS_GETAUDIT = 449 // { int getaudit(struct auditinfo *auditinfo); } SYS_SETAUDIT = 450 // { int setaudit(struct auditinfo *auditinfo); } SYS_GETAUDIT_ADDR = 451 // { int getaudit_addr(struct auditinfo_addr *auditinfo_addr, u_int length); } SYS_SETAUDIT_ADDR = 452 // { int setaudit_addr(struct auditinfo_addr *auditinfo_addr, u_int length); } SYS_AUDITCTL = 453 // { int auditctl(char *path); } SYS__UMTX_OP = 454 // { int _umtx_op(void *obj, int op, u_long val, void *uaddr1, void *uaddr2); } SYS_THR_NEW = 455 // { int thr_new(struct thr_param *param, int param_size); } SYS_SIGQUEUE = 456 // { int sigqueue(pid_t pid, int signum, void *value); } SYS_KMQ_OPEN = 457 // { int kmq_open(const char *path, int flags, mode_t mode, const struct mq_attr *attr); } SYS_KMQ_SETATTR = 458 // { int kmq_setattr(int mqd, const struct mq_attr *attr, struct mq_attr *oattr); } SYS_KMQ_TIMEDRECEIVE = 459 // { int kmq_timedreceive(int mqd, char *msg_ptr, size_t msg_len, unsigned *msg_prio, const struct timespec *abs_timeout); } SYS_KMQ_TIMEDSEND = 460 // { int kmq_timedsend(int mqd, const char *msg_ptr, size_t msg_len, unsigned msg_prio, const struct timespec *abs_timeout); } SYS_KMQ_NOTIFY = 461 // { int kmq_notify(int mqd, const struct sigevent *sigev); } SYS_KMQ_UNLINK = 462 // { int kmq_unlink(const char *path); } SYS_ABORT2 = 463 // { int abort2(const char *why, int nargs, void **args); } SYS_THR_SET_NAME = 464 // { int thr_set_name(long id, const char *name); } SYS_AIO_FSYNC = 465 // { int aio_fsync(int op, struct aiocb *aiocbp); } SYS_RTPRIO_THREAD = 466 // { int rtprio_thread(int function, lwpid_t lwpid, struct rtprio *rtp); } SYS_SCTP_PEELOFF = 471 // { int sctp_peeloff(int sd, uint32_t name); } SYS_SCTP_GENERIC_SENDMSG = 472 // { int sctp_generic_sendmsg(int sd, caddr_t msg, int mlen, caddr_t to, __socklen_t tolen, struct sctp_sndrcvinfo *sinfo, int flags); } SYS_SCTP_GENERIC_SENDMSG_IOV = 473 // { int sctp_generic_sendmsg_iov(int sd, struct iovec *iov, int iovlen, caddr_t to, __socklen_t tolen, struct sctp_sndrcvinfo *sinfo, int flags); } SYS_SCTP_GENERIC_RECVMSG = 474 // { int sctp_generic_recvmsg(int sd, struct iovec *iov, int iovlen, struct sockaddr *from, __socklen_t *fromlenaddr, struct sctp_sndrcvinfo *sinfo, int *msg_flags); } SYS_PREAD = 475 // { ssize_t pread(int fd, void *buf, size_t nbyte, off_t offset); } SYS_PWRITE = 476 // { ssize_t pwrite(int fd, const void *buf, size_t nbyte, off_t offset); } SYS_MMAP = 477 // { caddr_t mmap(caddr_t addr, size_t len, int prot, int flags, int fd, off_t pos); } SYS_LSEEK = 478 // { off_t lseek(int fd, off_t offset, int whence); } SYS_TRUNCATE = 479 // { int truncate(char *path, off_t length); } SYS_FTRUNCATE = 480 // { int ftruncate(int fd, off_t length); } SYS_THR_KILL2 = 481 // { int thr_kill2(pid_t pid, long id, int sig); } SYS_SHM_OPEN = 482 // { int shm_open(const char *path, int flags, mode_t mode); } SYS_SHM_UNLINK = 483 // { int shm_unlink(const char *path); } SYS_CPUSET = 484 // { int cpuset(cpusetid_t *setid); } SYS_CPUSET_SETID = 485 // { int cpuset_setid(cpuwhich_t which, id_t id, cpusetid_t setid); } SYS_CPUSET_GETID = 486 // { int cpuset_getid(cpulevel_t level, cpuwhich_t which, id_t id, cpusetid_t *setid); } SYS_CPUSET_GETAFFINITY = 487 // { int cpuset_getaffinity(cpulevel_t level, cpuwhich_t which, id_t id, size_t cpusetsize, cpuset_t *mask); } SYS_CPUSET_SETAFFINITY = 488 // { int cpuset_setaffinity(cpulevel_t level, cpuwhich_t which, id_t id, size_t cpusetsize, const cpuset_t *mask); } SYS_FACCESSAT = 489 // { int faccessat(int fd, char *path, int amode, int flag); } SYS_FCHMODAT = 490 // { int fchmodat(int fd, char *path, mode_t mode, int flag); } SYS_FCHOWNAT = 491 // { int fchownat(int fd, char *path, uid_t uid, gid_t gid, int flag); } SYS_FEXECVE = 492 // { int fexecve(int fd, char **argv, char **envv); } SYS_FUTIMESAT = 494 // { int futimesat(int fd, char *path, struct timeval *times); } SYS_LINKAT = 495 // { int linkat(int fd1, char *path1, int fd2, char *path2, int flag); } SYS_MKDIRAT = 496 // { int mkdirat(int fd, char *path, mode_t mode); } SYS_MKFIFOAT = 497 // { int mkfifoat(int fd, char *path, mode_t mode); } SYS_OPENAT = 499 // { int openat(int fd, char *path, int flag, mode_t mode); } SYS_READLINKAT = 500 // { ssize_t readlinkat(int fd, char *path, char *buf, size_t bufsize); } SYS_RENAMEAT = 501 // { int renameat(int oldfd, char *old, int newfd, char *new); } SYS_SYMLINKAT = 502 // { int symlinkat(char *path1, int fd, char *path2); } SYS_UNLINKAT = 503 // { int unlinkat(int fd, char *path, int flag); } SYS_POSIX_OPENPT = 504 // { int posix_openpt(int flags); } SYS_GSSD_SYSCALL = 505 // { int gssd_syscall(char *path); } SYS_JAIL_GET = 506 // { int jail_get(struct iovec *iovp, unsigned int iovcnt, int flags); } SYS_JAIL_SET = 507 // { int jail_set(struct iovec *iovp, unsigned int iovcnt, int flags); } SYS_JAIL_REMOVE = 508 // { int jail_remove(int jid); } SYS_CLOSEFROM = 509 // { int closefrom(int lowfd); } SYS___SEMCTL = 510 // { int __semctl(int semid, int semnum, int cmd, union semun *arg); } SYS_MSGCTL = 511 // { int msgctl(int msqid, int cmd, struct msqid_ds *buf); } SYS_SHMCTL = 512 // { int shmctl(int shmid, int cmd, struct shmid_ds *buf); } SYS_LPATHCONF = 513 // { int lpathconf(char *path, int name); } SYS___CAP_RIGHTS_GET = 515 // { int __cap_rights_get(int version, int fd, cap_rights_t *rightsp); } SYS_CAP_ENTER = 516 // { int cap_enter(void); } SYS_CAP_GETMODE = 517 // { int cap_getmode(u_int *modep); } SYS_PDFORK = 518 // { int pdfork(int *fdp, int flags); } SYS_PDKILL = 519 // { int pdkill(int fd, int signum); } SYS_PDGETPID = 520 // { int pdgetpid(int fd, pid_t *pidp); } SYS_PSELECT = 522 // { int pselect(int nd, fd_set *in, fd_set *ou, fd_set *ex, const struct timespec *ts, const sigset_t *sm); } SYS_GETLOGINCLASS = 523 // { int getloginclass(char *namebuf, size_t namelen); } SYS_SETLOGINCLASS = 524 // { int setloginclass(const char *namebuf); } SYS_RCTL_GET_RACCT = 525 // { int rctl_get_racct(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); } SYS_RCTL_GET_RULES = 526 // { int rctl_get_rules(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); } SYS_RCTL_GET_LIMITS = 527 // { int rctl_get_limits(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); } SYS_RCTL_ADD_RULE = 528 // { int rctl_add_rule(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); } SYS_RCTL_REMOVE_RULE = 529 // { int rctl_remove_rule(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); } SYS_POSIX_FALLOCATE = 530 // { int posix_fallocate(int fd, off_t offset, off_t len); } SYS_POSIX_FADVISE = 531 // { int posix_fadvise(int fd, off_t offset, off_t len, int advice); } SYS_WAIT6 = 532 // { int wait6(idtype_t idtype, id_t id, int *status, int options, struct __wrusage *wrusage, siginfo_t *info); } SYS_CAP_RIGHTS_LIMIT = 533 // { int cap_rights_limit(int fd, cap_rights_t *rightsp); } SYS_CAP_IOCTLS_LIMIT = 534 // { int cap_ioctls_limit(int fd, const u_long *cmds, size_t ncmds); } SYS_CAP_IOCTLS_GET = 535 // { ssize_t cap_ioctls_get(int fd, u_long *cmds, size_t maxcmds); } SYS_CAP_FCNTLS_LIMIT = 536 // { int cap_fcntls_limit(int fd, uint32_t fcntlrights); } SYS_CAP_FCNTLS_GET = 537 // { int cap_fcntls_get(int fd, uint32_t *fcntlrightsp); } SYS_BINDAT = 538 // { int bindat(int fd, int s, caddr_t name, int namelen); } SYS_CONNECTAT = 539 // { int connectat(int fd, int s, caddr_t name, int namelen); } SYS_CHFLAGSAT = 540 // { int chflagsat(int fd, const char *path, u_long flags, int atflag); } SYS_ACCEPT4 = 541 // { int accept4(int s, struct sockaddr * __restrict name, __socklen_t * __restrict anamelen, int flags); } SYS_PIPE2 = 542 // { int pipe2(int *fildes, int flags); } SYS_AIO_MLOCK = 543 // { int aio_mlock(struct aiocb *aiocbp); } SYS_PROCCTL = 544 // { int procctl(idtype_t idtype, id_t id, int com, void *data); } SYS_PPOLL = 545 // { int ppoll(struct pollfd *fds, u_int nfds, const struct timespec *ts, const sigset_t *set); } SYS_FUTIMENS = 546 // { int futimens(int fd, struct timespec *times); } SYS_UTIMENSAT = 547 // { int utimensat(int fd, char *path, struct timespec *times, int flag); } SYS_FDATASYNC = 550 // { int fdatasync(int fd); } SYS_FSTAT = 551 // { int fstat(int fd, struct stat *sb); } SYS_FSTATAT = 552 // { int fstatat(int fd, char *path, struct stat *buf, int flag); } SYS_FHSTAT = 553 // { int fhstat(const struct fhandle *u_fhp, struct stat *sb); } SYS_GETDIRENTRIES = 554 // { ssize_t getdirentries(int fd, char *buf, size_t count, off_t *basep); } SYS_STATFS = 555 // { int statfs(char *path, struct statfs *buf); } SYS_FSTATFS = 556 // { int fstatfs(int fd, struct statfs *buf); } SYS_GETFSSTAT = 557 // { int getfsstat(struct statfs *buf, long bufsize, int mode); } SYS_FHSTATFS = 558 // { int fhstatfs(const struct fhandle *u_fhp, struct statfs *buf); } SYS_MKNODAT = 559 // { int mknodat(int fd, char *path, mode_t mode, dev_t dev); } SYS_KEVENT = 560 // { int kevent(int fd, struct kevent *changelist, int nchanges, struct kevent *eventlist, int nevents, const struct timespec *timeout); } SYS_CPUSET_GETDOMAIN = 561 // { int cpuset_getdomain(cpulevel_t level, cpuwhich_t which, id_t id, size_t domainsetsize, domainset_t *mask, int *policy); } SYS_CPUSET_SETDOMAIN = 562 // { int cpuset_setdomain(cpulevel_t level, cpuwhich_t which, id_t id, size_t domainsetsize, domainset_t *mask, int policy); } SYS_GETRANDOM = 563 // { int getrandom(void *buf, size_t buflen, unsigned int flags); } SYS_GETFHAT = 564 // { int getfhat(int fd, char *path, struct fhandle *fhp, int flags); } SYS_FHLINK = 565 // { int fhlink(struct fhandle *fhp, const char *to); } SYS_FHLINKAT = 566 // { int fhlinkat(struct fhandle *fhp, int tofd, const char *to,); } SYS_FHREADLINK = 567 // { int fhreadlink(struct fhandle *fhp, char *buf, size_t bufsize); } SYS___SYSCTLBYNAME = 570 // { int __sysctlbyname(const char *name, size_t namelen, void *old, size_t *oldlenp, void *new, size_t newlen); } SYS_CLOSE_RANGE = 575 // { int close_range(u_int lowfd, u_int highfd, int flags); } ) ================================================ FILE: vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm64.go ================================================ // go run mksysnum.go https://cgit.freebsd.org/src/plain/sys/kern/syscalls.master?h=stable/12 // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm64 && freebsd package unix const ( // SYS_NOSYS = 0; // { int nosys(void); } syscall nosys_args int SYS_EXIT = 1 // { void sys_exit(int rval); } exit sys_exit_args void SYS_FORK = 2 // { int fork(void); } SYS_READ = 3 // { ssize_t read(int fd, void *buf, size_t nbyte); } SYS_WRITE = 4 // { ssize_t write(int fd, const void *buf, size_t nbyte); } SYS_OPEN = 5 // { int open(char *path, int flags, int mode); } SYS_CLOSE = 6 // { int close(int fd); } SYS_WAIT4 = 7 // { int wait4(int pid, int *status, int options, struct rusage *rusage); } SYS_LINK = 9 // { int link(char *path, char *link); } SYS_UNLINK = 10 // { int unlink(char *path); } SYS_CHDIR = 12 // { int chdir(char *path); } SYS_FCHDIR = 13 // { int fchdir(int fd); } SYS_CHMOD = 15 // { int chmod(char *path, int mode); } SYS_CHOWN = 16 // { int chown(char *path, int uid, int gid); } SYS_BREAK = 17 // { caddr_t break(char *nsize); } SYS_GETPID = 20 // { pid_t getpid(void); } SYS_MOUNT = 21 // { int mount(char *type, char *path, int flags, caddr_t data); } SYS_UNMOUNT = 22 // { int unmount(char *path, int flags); } SYS_SETUID = 23 // { int setuid(uid_t uid); } SYS_GETUID = 24 // { uid_t getuid(void); } SYS_GETEUID = 25 // { uid_t geteuid(void); } SYS_PTRACE = 26 // { int ptrace(int req, pid_t pid, caddr_t addr, int data); } SYS_RECVMSG = 27 // { int recvmsg(int s, struct msghdr *msg, int flags); } SYS_SENDMSG = 28 // { int sendmsg(int s, struct msghdr *msg, int flags); } SYS_RECVFROM = 29 // { int recvfrom(int s, caddr_t buf, size_t len, int flags, struct sockaddr * __restrict from, __socklen_t * __restrict fromlenaddr); } SYS_ACCEPT = 30 // { int accept(int s, struct sockaddr * __restrict name, __socklen_t * __restrict anamelen); } SYS_GETPEERNAME = 31 // { int getpeername(int fdes, struct sockaddr * __restrict asa, __socklen_t * __restrict alen); } SYS_GETSOCKNAME = 32 // { int getsockname(int fdes, struct sockaddr * __restrict asa, __socklen_t * __restrict alen); } SYS_ACCESS = 33 // { int access(char *path, int amode); } SYS_CHFLAGS = 34 // { int chflags(const char *path, u_long flags); } SYS_FCHFLAGS = 35 // { int fchflags(int fd, u_long flags); } SYS_SYNC = 36 // { int sync(void); } SYS_KILL = 37 // { int kill(int pid, int signum); } SYS_GETPPID = 39 // { pid_t getppid(void); } SYS_DUP = 41 // { int dup(u_int fd); } SYS_GETEGID = 43 // { gid_t getegid(void); } SYS_PROFIL = 44 // { int profil(caddr_t samples, size_t size, size_t offset, u_int scale); } SYS_KTRACE = 45 // { int ktrace(const char *fname, int ops, int facs, int pid); } SYS_GETGID = 47 // { gid_t getgid(void); } SYS_GETLOGIN = 49 // { int getlogin(char *namebuf, u_int namelen); } SYS_SETLOGIN = 50 // { int setlogin(char *namebuf); } SYS_ACCT = 51 // { int acct(char *path); } SYS_SIGALTSTACK = 53 // { int sigaltstack(stack_t *ss, stack_t *oss); } SYS_IOCTL = 54 // { int ioctl(int fd, u_long com, caddr_t data); } SYS_REBOOT = 55 // { int reboot(int opt); } SYS_REVOKE = 56 // { int revoke(char *path); } SYS_SYMLINK = 57 // { int symlink(char *path, char *link); } SYS_READLINK = 58 // { ssize_t readlink(char *path, char *buf, size_t count); } SYS_EXECVE = 59 // { int execve(char *fname, char **argv, char **envv); } SYS_UMASK = 60 // { int umask(int newmask); } SYS_CHROOT = 61 // { int chroot(char *path); } SYS_MSYNC = 65 // { int msync(void *addr, size_t len, int flags); } SYS_VFORK = 66 // { int vfork(void); } SYS_SBRK = 69 // { int sbrk(int incr); } SYS_SSTK = 70 // { int sstk(int incr); } SYS_MUNMAP = 73 // { int munmap(void *addr, size_t len); } SYS_MPROTECT = 74 // { int mprotect(void *addr, size_t len, int prot); } SYS_MADVISE = 75 // { int madvise(void *addr, size_t len, int behav); } SYS_MINCORE = 78 // { int mincore(const void *addr, size_t len, char *vec); } SYS_GETGROUPS = 79 // { int getgroups(u_int gidsetsize, gid_t *gidset); } SYS_SETGROUPS = 80 // { int setgroups(u_int gidsetsize, gid_t *gidset); } SYS_GETPGRP = 81 // { int getpgrp(void); } SYS_SETPGID = 82 // { int setpgid(int pid, int pgid); } SYS_SETITIMER = 83 // { int setitimer(u_int which, struct itimerval *itv, struct itimerval *oitv); } SYS_SWAPON = 85 // { int swapon(char *name); } SYS_GETITIMER = 86 // { int getitimer(u_int which, struct itimerval *itv); } SYS_GETDTABLESIZE = 89 // { int getdtablesize(void); } SYS_DUP2 = 90 // { int dup2(u_int from, u_int to); } SYS_FCNTL = 92 // { int fcntl(int fd, int cmd, long arg); } SYS_SELECT = 93 // { int select(int nd, fd_set *in, fd_set *ou, fd_set *ex, struct timeval *tv); } SYS_FSYNC = 95 // { int fsync(int fd); } SYS_SETPRIORITY = 96 // { int setpriority(int which, int who, int prio); } SYS_SOCKET = 97 // { int socket(int domain, int type, int protocol); } SYS_CONNECT = 98 // { int connect(int s, caddr_t name, int namelen); } SYS_GETPRIORITY = 100 // { int getpriority(int which, int who); } SYS_BIND = 104 // { int bind(int s, caddr_t name, int namelen); } SYS_SETSOCKOPT = 105 // { int setsockopt(int s, int level, int name, caddr_t val, int valsize); } SYS_LISTEN = 106 // { int listen(int s, int backlog); } SYS_GETTIMEOFDAY = 116 // { int gettimeofday(struct timeval *tp, struct timezone *tzp); } SYS_GETRUSAGE = 117 // { int getrusage(int who, struct rusage *rusage); } SYS_GETSOCKOPT = 118 // { int getsockopt(int s, int level, int name, caddr_t val, int *avalsize); } SYS_READV = 120 // { int readv(int fd, struct iovec *iovp, u_int iovcnt); } SYS_WRITEV = 121 // { int writev(int fd, struct iovec *iovp, u_int iovcnt); } SYS_SETTIMEOFDAY = 122 // { int settimeofday(struct timeval *tv, struct timezone *tzp); } SYS_FCHOWN = 123 // { int fchown(int fd, int uid, int gid); } SYS_FCHMOD = 124 // { int fchmod(int fd, int mode); } SYS_SETREUID = 126 // { int setreuid(int ruid, int euid); } SYS_SETREGID = 127 // { int setregid(int rgid, int egid); } SYS_RENAME = 128 // { int rename(char *from, char *to); } SYS_FLOCK = 131 // { int flock(int fd, int how); } SYS_MKFIFO = 132 // { int mkfifo(char *path, int mode); } SYS_SENDTO = 133 // { int sendto(int s, caddr_t buf, size_t len, int flags, caddr_t to, int tolen); } SYS_SHUTDOWN = 134 // { int shutdown(int s, int how); } SYS_SOCKETPAIR = 135 // { int socketpair(int domain, int type, int protocol, int *rsv); } SYS_MKDIR = 136 // { int mkdir(char *path, int mode); } SYS_RMDIR = 137 // { int rmdir(char *path); } SYS_UTIMES = 138 // { int utimes(char *path, struct timeval *tptr); } SYS_ADJTIME = 140 // { int adjtime(struct timeval *delta, struct timeval *olddelta); } SYS_SETSID = 147 // { int setsid(void); } SYS_QUOTACTL = 148 // { int quotactl(char *path, int cmd, int uid, caddr_t arg); } SYS_NLM_SYSCALL = 154 // { int nlm_syscall(int debug_level, int grace_period, int addr_count, char **addrs); } SYS_NFSSVC = 155 // { int nfssvc(int flag, caddr_t argp); } SYS_LGETFH = 160 // { int lgetfh(char *fname, struct fhandle *fhp); } SYS_GETFH = 161 // { int getfh(char *fname, struct fhandle *fhp); } SYS_SYSARCH = 165 // { int sysarch(int op, char *parms); } SYS_RTPRIO = 166 // { int rtprio(int function, pid_t pid, struct rtprio *rtp); } SYS_SEMSYS = 169 // { int semsys(int which, int a2, int a3, int a4, int a5); } SYS_MSGSYS = 170 // { int msgsys(int which, int a2, int a3, int a4, int a5, int a6); } SYS_SHMSYS = 171 // { int shmsys(int which, int a2, int a3, int a4); } SYS_SETFIB = 175 // { int setfib(int fibnum); } SYS_NTP_ADJTIME = 176 // { int ntp_adjtime(struct timex *tp); } SYS_SETGID = 181 // { int setgid(gid_t gid); } SYS_SETEGID = 182 // { int setegid(gid_t egid); } SYS_SETEUID = 183 // { int seteuid(uid_t euid); } SYS_PATHCONF = 191 // { int pathconf(char *path, int name); } SYS_FPATHCONF = 192 // { int fpathconf(int fd, int name); } SYS_GETRLIMIT = 194 // { int getrlimit(u_int which, struct rlimit *rlp); } getrlimit __getrlimit_args int SYS_SETRLIMIT = 195 // { int setrlimit(u_int which, struct rlimit *rlp); } setrlimit __setrlimit_args int SYS___SYSCTL = 202 // { int __sysctl(int *name, u_int namelen, void *old, size_t *oldlenp, void *new, size_t newlen); } __sysctl sysctl_args int SYS_MLOCK = 203 // { int mlock(const void *addr, size_t len); } SYS_MUNLOCK = 204 // { int munlock(const void *addr, size_t len); } SYS_UNDELETE = 205 // { int undelete(char *path); } SYS_FUTIMES = 206 // { int futimes(int fd, struct timeval *tptr); } SYS_GETPGID = 207 // { int getpgid(pid_t pid); } SYS_POLL = 209 // { int poll(struct pollfd *fds, u_int nfds, int timeout); } SYS_SEMGET = 221 // { int semget(key_t key, int nsems, int semflg); } SYS_SEMOP = 222 // { int semop(int semid, struct sembuf *sops, size_t nsops); } SYS_MSGGET = 225 // { int msgget(key_t key, int msgflg); } SYS_MSGSND = 226 // { int msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg); } SYS_MSGRCV = 227 // { ssize_t msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg); } SYS_SHMAT = 228 // { int shmat(int shmid, const void *shmaddr, int shmflg); } SYS_SHMDT = 230 // { int shmdt(const void *shmaddr); } SYS_SHMGET = 231 // { int shmget(key_t key, size_t size, int shmflg); } SYS_CLOCK_GETTIME = 232 // { int clock_gettime(clockid_t clock_id, struct timespec *tp); } SYS_CLOCK_SETTIME = 233 // { int clock_settime(clockid_t clock_id, const struct timespec *tp); } SYS_CLOCK_GETRES = 234 // { int clock_getres(clockid_t clock_id, struct timespec *tp); } SYS_KTIMER_CREATE = 235 // { int ktimer_create(clockid_t clock_id, struct sigevent *evp, int *timerid); } SYS_KTIMER_DELETE = 236 // { int ktimer_delete(int timerid); } SYS_KTIMER_SETTIME = 237 // { int ktimer_settime(int timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue); } SYS_KTIMER_GETTIME = 238 // { int ktimer_gettime(int timerid, struct itimerspec *value); } SYS_KTIMER_GETOVERRUN = 239 // { int ktimer_getoverrun(int timerid); } SYS_NANOSLEEP = 240 // { int nanosleep(const struct timespec *rqtp, struct timespec *rmtp); } SYS_FFCLOCK_GETCOUNTER = 241 // { int ffclock_getcounter(ffcounter *ffcount); } SYS_FFCLOCK_SETESTIMATE = 242 // { int ffclock_setestimate(struct ffclock_estimate *cest); } SYS_FFCLOCK_GETESTIMATE = 243 // { int ffclock_getestimate(struct ffclock_estimate *cest); } SYS_CLOCK_NANOSLEEP = 244 // { int clock_nanosleep(clockid_t clock_id, int flags, const struct timespec *rqtp, struct timespec *rmtp); } SYS_CLOCK_GETCPUCLOCKID2 = 247 // { int clock_getcpuclockid2(id_t id, int which, clockid_t *clock_id); } SYS_NTP_GETTIME = 248 // { int ntp_gettime(struct ntptimeval *ntvp); } SYS_MINHERIT = 250 // { int minherit(void *addr, size_t len, int inherit); } SYS_RFORK = 251 // { int rfork(int flags); } SYS_ISSETUGID = 253 // { int issetugid(void); } SYS_LCHOWN = 254 // { int lchown(char *path, int uid, int gid); } SYS_AIO_READ = 255 // { int aio_read(struct aiocb *aiocbp); } SYS_AIO_WRITE = 256 // { int aio_write(struct aiocb *aiocbp); } SYS_LIO_LISTIO = 257 // { int lio_listio(int mode, struct aiocb* const *acb_list, int nent, struct sigevent *sig); } SYS_LCHMOD = 274 // { int lchmod(char *path, mode_t mode); } SYS_LUTIMES = 276 // { int lutimes(char *path, struct timeval *tptr); } SYS_PREADV = 289 // { ssize_t preadv(int fd, struct iovec *iovp, u_int iovcnt, off_t offset); } SYS_PWRITEV = 290 // { ssize_t pwritev(int fd, struct iovec *iovp, u_int iovcnt, off_t offset); } SYS_FHOPEN = 298 // { int fhopen(const struct fhandle *u_fhp, int flags); } SYS_MODNEXT = 300 // { int modnext(int modid); } SYS_MODSTAT = 301 // { int modstat(int modid, struct module_stat* stat); } SYS_MODFNEXT = 302 // { int modfnext(int modid); } SYS_MODFIND = 303 // { int modfind(const char *name); } SYS_KLDLOAD = 304 // { int kldload(const char *file); } SYS_KLDUNLOAD = 305 // { int kldunload(int fileid); } SYS_KLDFIND = 306 // { int kldfind(const char *file); } SYS_KLDNEXT = 307 // { int kldnext(int fileid); } SYS_KLDSTAT = 308 // { int kldstat(int fileid, struct kld_file_stat *stat); } SYS_KLDFIRSTMOD = 309 // { int kldfirstmod(int fileid); } SYS_GETSID = 310 // { int getsid(pid_t pid); } SYS_SETRESUID = 311 // { int setresuid(uid_t ruid, uid_t euid, uid_t suid); } SYS_SETRESGID = 312 // { int setresgid(gid_t rgid, gid_t egid, gid_t sgid); } SYS_AIO_RETURN = 314 // { ssize_t aio_return(struct aiocb *aiocbp); } SYS_AIO_SUSPEND = 315 // { int aio_suspend(struct aiocb * const * aiocbp, int nent, const struct timespec *timeout); } SYS_AIO_CANCEL = 316 // { int aio_cancel(int fd, struct aiocb *aiocbp); } SYS_AIO_ERROR = 317 // { int aio_error(struct aiocb *aiocbp); } SYS_YIELD = 321 // { int yield(void); } SYS_MLOCKALL = 324 // { int mlockall(int how); } SYS_MUNLOCKALL = 325 // { int munlockall(void); } SYS___GETCWD = 326 // { int __getcwd(char *buf, size_t buflen); } SYS_SCHED_SETPARAM = 327 // { int sched_setparam (pid_t pid, const struct sched_param *param); } SYS_SCHED_GETPARAM = 328 // { int sched_getparam (pid_t pid, struct sched_param *param); } SYS_SCHED_SETSCHEDULER = 329 // { int sched_setscheduler (pid_t pid, int policy, const struct sched_param *param); } SYS_SCHED_GETSCHEDULER = 330 // { int sched_getscheduler (pid_t pid); } SYS_SCHED_YIELD = 331 // { int sched_yield (void); } SYS_SCHED_GET_PRIORITY_MAX = 332 // { int sched_get_priority_max (int policy); } SYS_SCHED_GET_PRIORITY_MIN = 333 // { int sched_get_priority_min (int policy); } SYS_SCHED_RR_GET_INTERVAL = 334 // { int sched_rr_get_interval (pid_t pid, struct timespec *interval); } SYS_UTRACE = 335 // { int utrace(const void *addr, size_t len); } SYS_KLDSYM = 337 // { int kldsym(int fileid, int cmd, void *data); } SYS_JAIL = 338 // { int jail(struct jail *jail); } SYS_SIGPROCMASK = 340 // { int sigprocmask(int how, const sigset_t *set, sigset_t *oset); } SYS_SIGSUSPEND = 341 // { int sigsuspend(const sigset_t *sigmask); } SYS_SIGPENDING = 343 // { int sigpending(sigset_t *set); } SYS_SIGTIMEDWAIT = 345 // { int sigtimedwait(const sigset_t *set, siginfo_t *info, const struct timespec *timeout); } SYS_SIGWAITINFO = 346 // { int sigwaitinfo(const sigset_t *set, siginfo_t *info); } SYS___ACL_GET_FILE = 347 // { int __acl_get_file(const char *path, acl_type_t type, struct acl *aclp); } SYS___ACL_SET_FILE = 348 // { int __acl_set_file(const char *path, acl_type_t type, struct acl *aclp); } SYS___ACL_GET_FD = 349 // { int __acl_get_fd(int filedes, acl_type_t type, struct acl *aclp); } SYS___ACL_SET_FD = 350 // { int __acl_set_fd(int filedes, acl_type_t type, struct acl *aclp); } SYS___ACL_DELETE_FILE = 351 // { int __acl_delete_file(const char *path, acl_type_t type); } SYS___ACL_DELETE_FD = 352 // { int __acl_delete_fd(int filedes, acl_type_t type); } SYS___ACL_ACLCHECK_FILE = 353 // { int __acl_aclcheck_file(const char *path, acl_type_t type, struct acl *aclp); } SYS___ACL_ACLCHECK_FD = 354 // { int __acl_aclcheck_fd(int filedes, acl_type_t type, struct acl *aclp); } SYS_EXTATTRCTL = 355 // { int extattrctl(const char *path, int cmd, const char *filename, int attrnamespace, const char *attrname); } SYS_EXTATTR_SET_FILE = 356 // { ssize_t extattr_set_file(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_GET_FILE = 357 // { ssize_t extattr_get_file(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_DELETE_FILE = 358 // { int extattr_delete_file(const char *path, int attrnamespace, const char *attrname); } SYS_AIO_WAITCOMPLETE = 359 // { ssize_t aio_waitcomplete(struct aiocb **aiocbp, struct timespec *timeout); } SYS_GETRESUID = 360 // { int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); } SYS_GETRESGID = 361 // { int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); } SYS_KQUEUE = 362 // { int kqueue(void); } SYS_EXTATTR_SET_FD = 371 // { ssize_t extattr_set_fd(int fd, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_GET_FD = 372 // { ssize_t extattr_get_fd(int fd, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_DELETE_FD = 373 // { int extattr_delete_fd(int fd, int attrnamespace, const char *attrname); } SYS___SETUGID = 374 // { int __setugid(int flag); } SYS_EACCESS = 376 // { int eaccess(char *path, int amode); } SYS_NMOUNT = 378 // { int nmount(struct iovec *iovp, unsigned int iovcnt, int flags); } SYS___MAC_GET_PROC = 384 // { int __mac_get_proc(struct mac *mac_p); } SYS___MAC_SET_PROC = 385 // { int __mac_set_proc(struct mac *mac_p); } SYS___MAC_GET_FD = 386 // { int __mac_get_fd(int fd, struct mac *mac_p); } SYS___MAC_GET_FILE = 387 // { int __mac_get_file(const char *path_p, struct mac *mac_p); } SYS___MAC_SET_FD = 388 // { int __mac_set_fd(int fd, struct mac *mac_p); } SYS___MAC_SET_FILE = 389 // { int __mac_set_file(const char *path_p, struct mac *mac_p); } SYS_KENV = 390 // { int kenv(int what, const char *name, char *value, int len); } SYS_LCHFLAGS = 391 // { int lchflags(const char *path, u_long flags); } SYS_UUIDGEN = 392 // { int uuidgen(struct uuid *store, int count); } SYS_SENDFILE = 393 // { int sendfile(int fd, int s, off_t offset, size_t nbytes, struct sf_hdtr *hdtr, off_t *sbytes, int flags); } SYS_MAC_SYSCALL = 394 // { int mac_syscall(const char *policy, int call, void *arg); } SYS_KSEM_CLOSE = 400 // { int ksem_close(semid_t id); } SYS_KSEM_POST = 401 // { int ksem_post(semid_t id); } SYS_KSEM_WAIT = 402 // { int ksem_wait(semid_t id); } SYS_KSEM_TRYWAIT = 403 // { int ksem_trywait(semid_t id); } SYS_KSEM_INIT = 404 // { int ksem_init(semid_t *idp, unsigned int value); } SYS_KSEM_OPEN = 405 // { int ksem_open(semid_t *idp, const char *name, int oflag, mode_t mode, unsigned int value); } SYS_KSEM_UNLINK = 406 // { int ksem_unlink(const char *name); } SYS_KSEM_GETVALUE = 407 // { int ksem_getvalue(semid_t id, int *val); } SYS_KSEM_DESTROY = 408 // { int ksem_destroy(semid_t id); } SYS___MAC_GET_PID = 409 // { int __mac_get_pid(pid_t pid, struct mac *mac_p); } SYS___MAC_GET_LINK = 410 // { int __mac_get_link(const char *path_p, struct mac *mac_p); } SYS___MAC_SET_LINK = 411 // { int __mac_set_link(const char *path_p, struct mac *mac_p); } SYS_EXTATTR_SET_LINK = 412 // { ssize_t extattr_set_link(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_GET_LINK = 413 // { ssize_t extattr_get_link(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_DELETE_LINK = 414 // { int extattr_delete_link(const char *path, int attrnamespace, const char *attrname); } SYS___MAC_EXECVE = 415 // { int __mac_execve(char *fname, char **argv, char **envv, struct mac *mac_p); } SYS_SIGACTION = 416 // { int sigaction(int sig, const struct sigaction *act, struct sigaction *oact); } SYS_SIGRETURN = 417 // { int sigreturn(const struct __ucontext *sigcntxp); } SYS_GETCONTEXT = 421 // { int getcontext(struct __ucontext *ucp); } SYS_SETCONTEXT = 422 // { int setcontext(const struct __ucontext *ucp); } SYS_SWAPCONTEXT = 423 // { int swapcontext(struct __ucontext *oucp, const struct __ucontext *ucp); } SYS_SWAPOFF = 424 // { int swapoff(const char *name); } SYS___ACL_GET_LINK = 425 // { int __acl_get_link(const char *path, acl_type_t type, struct acl *aclp); } SYS___ACL_SET_LINK = 426 // { int __acl_set_link(const char *path, acl_type_t type, struct acl *aclp); } SYS___ACL_DELETE_LINK = 427 // { int __acl_delete_link(const char *path, acl_type_t type); } SYS___ACL_ACLCHECK_LINK = 428 // { int __acl_aclcheck_link(const char *path, acl_type_t type, struct acl *aclp); } SYS_SIGWAIT = 429 // { int sigwait(const sigset_t *set, int *sig); } SYS_THR_CREATE = 430 // { int thr_create(ucontext_t *ctx, long *id, int flags); } SYS_THR_EXIT = 431 // { void thr_exit(long *state); } SYS_THR_SELF = 432 // { int thr_self(long *id); } SYS_THR_KILL = 433 // { int thr_kill(long id, int sig); } SYS_JAIL_ATTACH = 436 // { int jail_attach(int jid); } SYS_EXTATTR_LIST_FD = 437 // { ssize_t extattr_list_fd(int fd, int attrnamespace, void *data, size_t nbytes); } SYS_EXTATTR_LIST_FILE = 438 // { ssize_t extattr_list_file(const char *path, int attrnamespace, void *data, size_t nbytes); } SYS_EXTATTR_LIST_LINK = 439 // { ssize_t extattr_list_link(const char *path, int attrnamespace, void *data, size_t nbytes); } SYS_KSEM_TIMEDWAIT = 441 // { int ksem_timedwait(semid_t id, const struct timespec *abstime); } SYS_THR_SUSPEND = 442 // { int thr_suspend(const struct timespec *timeout); } SYS_THR_WAKE = 443 // { int thr_wake(long id); } SYS_KLDUNLOADF = 444 // { int kldunloadf(int fileid, int flags); } SYS_AUDIT = 445 // { int audit(const void *record, u_int length); } SYS_AUDITON = 446 // { int auditon(int cmd, void *data, u_int length); } SYS_GETAUID = 447 // { int getauid(uid_t *auid); } SYS_SETAUID = 448 // { int setauid(uid_t *auid); } SYS_GETAUDIT = 449 // { int getaudit(struct auditinfo *auditinfo); } SYS_SETAUDIT = 450 // { int setaudit(struct auditinfo *auditinfo); } SYS_GETAUDIT_ADDR = 451 // { int getaudit_addr(struct auditinfo_addr *auditinfo_addr, u_int length); } SYS_SETAUDIT_ADDR = 452 // { int setaudit_addr(struct auditinfo_addr *auditinfo_addr, u_int length); } SYS_AUDITCTL = 453 // { int auditctl(char *path); } SYS__UMTX_OP = 454 // { int _umtx_op(void *obj, int op, u_long val, void *uaddr1, void *uaddr2); } SYS_THR_NEW = 455 // { int thr_new(struct thr_param *param, int param_size); } SYS_SIGQUEUE = 456 // { int sigqueue(pid_t pid, int signum, void *value); } SYS_KMQ_OPEN = 457 // { int kmq_open(const char *path, int flags, mode_t mode, const struct mq_attr *attr); } SYS_KMQ_SETATTR = 458 // { int kmq_setattr(int mqd, const struct mq_attr *attr, struct mq_attr *oattr); } SYS_KMQ_TIMEDRECEIVE = 459 // { int kmq_timedreceive(int mqd, char *msg_ptr, size_t msg_len, unsigned *msg_prio, const struct timespec *abs_timeout); } SYS_KMQ_TIMEDSEND = 460 // { int kmq_timedsend(int mqd, const char *msg_ptr, size_t msg_len, unsigned msg_prio, const struct timespec *abs_timeout); } SYS_KMQ_NOTIFY = 461 // { int kmq_notify(int mqd, const struct sigevent *sigev); } SYS_KMQ_UNLINK = 462 // { int kmq_unlink(const char *path); } SYS_ABORT2 = 463 // { int abort2(const char *why, int nargs, void **args); } SYS_THR_SET_NAME = 464 // { int thr_set_name(long id, const char *name); } SYS_AIO_FSYNC = 465 // { int aio_fsync(int op, struct aiocb *aiocbp); } SYS_RTPRIO_THREAD = 466 // { int rtprio_thread(int function, lwpid_t lwpid, struct rtprio *rtp); } SYS_SCTP_PEELOFF = 471 // { int sctp_peeloff(int sd, uint32_t name); } SYS_SCTP_GENERIC_SENDMSG = 472 // { int sctp_generic_sendmsg(int sd, caddr_t msg, int mlen, caddr_t to, __socklen_t tolen, struct sctp_sndrcvinfo *sinfo, int flags); } SYS_SCTP_GENERIC_SENDMSG_IOV = 473 // { int sctp_generic_sendmsg_iov(int sd, struct iovec *iov, int iovlen, caddr_t to, __socklen_t tolen, struct sctp_sndrcvinfo *sinfo, int flags); } SYS_SCTP_GENERIC_RECVMSG = 474 // { int sctp_generic_recvmsg(int sd, struct iovec *iov, int iovlen, struct sockaddr *from, __socklen_t *fromlenaddr, struct sctp_sndrcvinfo *sinfo, int *msg_flags); } SYS_PREAD = 475 // { ssize_t pread(int fd, void *buf, size_t nbyte, off_t offset); } SYS_PWRITE = 476 // { ssize_t pwrite(int fd, const void *buf, size_t nbyte, off_t offset); } SYS_MMAP = 477 // { caddr_t mmap(caddr_t addr, size_t len, int prot, int flags, int fd, off_t pos); } SYS_LSEEK = 478 // { off_t lseek(int fd, off_t offset, int whence); } SYS_TRUNCATE = 479 // { int truncate(char *path, off_t length); } SYS_FTRUNCATE = 480 // { int ftruncate(int fd, off_t length); } SYS_THR_KILL2 = 481 // { int thr_kill2(pid_t pid, long id, int sig); } SYS_SHM_OPEN = 482 // { int shm_open(const char *path, int flags, mode_t mode); } SYS_SHM_UNLINK = 483 // { int shm_unlink(const char *path); } SYS_CPUSET = 484 // { int cpuset(cpusetid_t *setid); } SYS_CPUSET_SETID = 485 // { int cpuset_setid(cpuwhich_t which, id_t id, cpusetid_t setid); } SYS_CPUSET_GETID = 486 // { int cpuset_getid(cpulevel_t level, cpuwhich_t which, id_t id, cpusetid_t *setid); } SYS_CPUSET_GETAFFINITY = 487 // { int cpuset_getaffinity(cpulevel_t level, cpuwhich_t which, id_t id, size_t cpusetsize, cpuset_t *mask); } SYS_CPUSET_SETAFFINITY = 488 // { int cpuset_setaffinity(cpulevel_t level, cpuwhich_t which, id_t id, size_t cpusetsize, const cpuset_t *mask); } SYS_FACCESSAT = 489 // { int faccessat(int fd, char *path, int amode, int flag); } SYS_FCHMODAT = 490 // { int fchmodat(int fd, char *path, mode_t mode, int flag); } SYS_FCHOWNAT = 491 // { int fchownat(int fd, char *path, uid_t uid, gid_t gid, int flag); } SYS_FEXECVE = 492 // { int fexecve(int fd, char **argv, char **envv); } SYS_FUTIMESAT = 494 // { int futimesat(int fd, char *path, struct timeval *times); } SYS_LINKAT = 495 // { int linkat(int fd1, char *path1, int fd2, char *path2, int flag); } SYS_MKDIRAT = 496 // { int mkdirat(int fd, char *path, mode_t mode); } SYS_MKFIFOAT = 497 // { int mkfifoat(int fd, char *path, mode_t mode); } SYS_OPENAT = 499 // { int openat(int fd, char *path, int flag, mode_t mode); } SYS_READLINKAT = 500 // { ssize_t readlinkat(int fd, char *path, char *buf, size_t bufsize); } SYS_RENAMEAT = 501 // { int renameat(int oldfd, char *old, int newfd, char *new); } SYS_SYMLINKAT = 502 // { int symlinkat(char *path1, int fd, char *path2); } SYS_UNLINKAT = 503 // { int unlinkat(int fd, char *path, int flag); } SYS_POSIX_OPENPT = 504 // { int posix_openpt(int flags); } SYS_GSSD_SYSCALL = 505 // { int gssd_syscall(char *path); } SYS_JAIL_GET = 506 // { int jail_get(struct iovec *iovp, unsigned int iovcnt, int flags); } SYS_JAIL_SET = 507 // { int jail_set(struct iovec *iovp, unsigned int iovcnt, int flags); } SYS_JAIL_REMOVE = 508 // { int jail_remove(int jid); } SYS_CLOSEFROM = 509 // { int closefrom(int lowfd); } SYS___SEMCTL = 510 // { int __semctl(int semid, int semnum, int cmd, union semun *arg); } SYS_MSGCTL = 511 // { int msgctl(int msqid, int cmd, struct msqid_ds *buf); } SYS_SHMCTL = 512 // { int shmctl(int shmid, int cmd, struct shmid_ds *buf); } SYS_LPATHCONF = 513 // { int lpathconf(char *path, int name); } SYS___CAP_RIGHTS_GET = 515 // { int __cap_rights_get(int version, int fd, cap_rights_t *rightsp); } SYS_CAP_ENTER = 516 // { int cap_enter(void); } SYS_CAP_GETMODE = 517 // { int cap_getmode(u_int *modep); } SYS_PDFORK = 518 // { int pdfork(int *fdp, int flags); } SYS_PDKILL = 519 // { int pdkill(int fd, int signum); } SYS_PDGETPID = 520 // { int pdgetpid(int fd, pid_t *pidp); } SYS_PSELECT = 522 // { int pselect(int nd, fd_set *in, fd_set *ou, fd_set *ex, const struct timespec *ts, const sigset_t *sm); } SYS_GETLOGINCLASS = 523 // { int getloginclass(char *namebuf, size_t namelen); } SYS_SETLOGINCLASS = 524 // { int setloginclass(const char *namebuf); } SYS_RCTL_GET_RACCT = 525 // { int rctl_get_racct(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); } SYS_RCTL_GET_RULES = 526 // { int rctl_get_rules(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); } SYS_RCTL_GET_LIMITS = 527 // { int rctl_get_limits(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); } SYS_RCTL_ADD_RULE = 528 // { int rctl_add_rule(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); } SYS_RCTL_REMOVE_RULE = 529 // { int rctl_remove_rule(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); } SYS_POSIX_FALLOCATE = 530 // { int posix_fallocate(int fd, off_t offset, off_t len); } SYS_POSIX_FADVISE = 531 // { int posix_fadvise(int fd, off_t offset, off_t len, int advice); } SYS_WAIT6 = 532 // { int wait6(idtype_t idtype, id_t id, int *status, int options, struct __wrusage *wrusage, siginfo_t *info); } SYS_CAP_RIGHTS_LIMIT = 533 // { int cap_rights_limit(int fd, cap_rights_t *rightsp); } SYS_CAP_IOCTLS_LIMIT = 534 // { int cap_ioctls_limit(int fd, const u_long *cmds, size_t ncmds); } SYS_CAP_IOCTLS_GET = 535 // { ssize_t cap_ioctls_get(int fd, u_long *cmds, size_t maxcmds); } SYS_CAP_FCNTLS_LIMIT = 536 // { int cap_fcntls_limit(int fd, uint32_t fcntlrights); } SYS_CAP_FCNTLS_GET = 537 // { int cap_fcntls_get(int fd, uint32_t *fcntlrightsp); } SYS_BINDAT = 538 // { int bindat(int fd, int s, caddr_t name, int namelen); } SYS_CONNECTAT = 539 // { int connectat(int fd, int s, caddr_t name, int namelen); } SYS_CHFLAGSAT = 540 // { int chflagsat(int fd, const char *path, u_long flags, int atflag); } SYS_ACCEPT4 = 541 // { int accept4(int s, struct sockaddr * __restrict name, __socklen_t * __restrict anamelen, int flags); } SYS_PIPE2 = 542 // { int pipe2(int *fildes, int flags); } SYS_AIO_MLOCK = 543 // { int aio_mlock(struct aiocb *aiocbp); } SYS_PROCCTL = 544 // { int procctl(idtype_t idtype, id_t id, int com, void *data); } SYS_PPOLL = 545 // { int ppoll(struct pollfd *fds, u_int nfds, const struct timespec *ts, const sigset_t *set); } SYS_FUTIMENS = 546 // { int futimens(int fd, struct timespec *times); } SYS_UTIMENSAT = 547 // { int utimensat(int fd, char *path, struct timespec *times, int flag); } SYS_FDATASYNC = 550 // { int fdatasync(int fd); } SYS_FSTAT = 551 // { int fstat(int fd, struct stat *sb); } SYS_FSTATAT = 552 // { int fstatat(int fd, char *path, struct stat *buf, int flag); } SYS_FHSTAT = 553 // { int fhstat(const struct fhandle *u_fhp, struct stat *sb); } SYS_GETDIRENTRIES = 554 // { ssize_t getdirentries(int fd, char *buf, size_t count, off_t *basep); } SYS_STATFS = 555 // { int statfs(char *path, struct statfs *buf); } SYS_FSTATFS = 556 // { int fstatfs(int fd, struct statfs *buf); } SYS_GETFSSTAT = 557 // { int getfsstat(struct statfs *buf, long bufsize, int mode); } SYS_FHSTATFS = 558 // { int fhstatfs(const struct fhandle *u_fhp, struct statfs *buf); } SYS_MKNODAT = 559 // { int mknodat(int fd, char *path, mode_t mode, dev_t dev); } SYS_KEVENT = 560 // { int kevent(int fd, struct kevent *changelist, int nchanges, struct kevent *eventlist, int nevents, const struct timespec *timeout); } SYS_CPUSET_GETDOMAIN = 561 // { int cpuset_getdomain(cpulevel_t level, cpuwhich_t which, id_t id, size_t domainsetsize, domainset_t *mask, int *policy); } SYS_CPUSET_SETDOMAIN = 562 // { int cpuset_setdomain(cpulevel_t level, cpuwhich_t which, id_t id, size_t domainsetsize, domainset_t *mask, int policy); } SYS_GETRANDOM = 563 // { int getrandom(void *buf, size_t buflen, unsigned int flags); } SYS_GETFHAT = 564 // { int getfhat(int fd, char *path, struct fhandle *fhp, int flags); } SYS_FHLINK = 565 // { int fhlink(struct fhandle *fhp, const char *to); } SYS_FHLINKAT = 566 // { int fhlinkat(struct fhandle *fhp, int tofd, const char *to,); } SYS_FHREADLINK = 567 // { int fhreadlink(struct fhandle *fhp, char *buf, size_t bufsize); } SYS___SYSCTLBYNAME = 570 // { int __sysctlbyname(const char *name, size_t namelen, void *old, size_t *oldlenp, void *new, size_t newlen); } SYS_CLOSE_RANGE = 575 // { int close_range(u_int lowfd, u_int highfd, int flags); } ) ================================================ FILE: vendor/golang.org/x/sys/unix/zsysnum_freebsd_riscv64.go ================================================ // go run mksysnum.go https://cgit.freebsd.org/src/plain/sys/kern/syscalls.master?h=stable/12 // Code generated by the command above; see README.md. DO NOT EDIT. //go:build riscv64 && freebsd package unix const ( // SYS_NOSYS = 0; // { int nosys(void); } syscall nosys_args int SYS_EXIT = 1 // { void sys_exit(int rval); } exit sys_exit_args void SYS_FORK = 2 // { int fork(void); } SYS_READ = 3 // { ssize_t read(int fd, void *buf, size_t nbyte); } SYS_WRITE = 4 // { ssize_t write(int fd, const void *buf, size_t nbyte); } SYS_OPEN = 5 // { int open(char *path, int flags, int mode); } SYS_CLOSE = 6 // { int close(int fd); } SYS_WAIT4 = 7 // { int wait4(int pid, int *status, int options, struct rusage *rusage); } SYS_LINK = 9 // { int link(char *path, char *link); } SYS_UNLINK = 10 // { int unlink(char *path); } SYS_CHDIR = 12 // { int chdir(char *path); } SYS_FCHDIR = 13 // { int fchdir(int fd); } SYS_CHMOD = 15 // { int chmod(char *path, int mode); } SYS_CHOWN = 16 // { int chown(char *path, int uid, int gid); } SYS_BREAK = 17 // { caddr_t break(char *nsize); } SYS_GETPID = 20 // { pid_t getpid(void); } SYS_MOUNT = 21 // { int mount(char *type, char *path, int flags, caddr_t data); } SYS_UNMOUNT = 22 // { int unmount(char *path, int flags); } SYS_SETUID = 23 // { int setuid(uid_t uid); } SYS_GETUID = 24 // { uid_t getuid(void); } SYS_GETEUID = 25 // { uid_t geteuid(void); } SYS_PTRACE = 26 // { int ptrace(int req, pid_t pid, caddr_t addr, int data); } SYS_RECVMSG = 27 // { int recvmsg(int s, struct msghdr *msg, int flags); } SYS_SENDMSG = 28 // { int sendmsg(int s, struct msghdr *msg, int flags); } SYS_RECVFROM = 29 // { int recvfrom(int s, caddr_t buf, size_t len, int flags, struct sockaddr * __restrict from, __socklen_t * __restrict fromlenaddr); } SYS_ACCEPT = 30 // { int accept(int s, struct sockaddr * __restrict name, __socklen_t * __restrict anamelen); } SYS_GETPEERNAME = 31 // { int getpeername(int fdes, struct sockaddr * __restrict asa, __socklen_t * __restrict alen); } SYS_GETSOCKNAME = 32 // { int getsockname(int fdes, struct sockaddr * __restrict asa, __socklen_t * __restrict alen); } SYS_ACCESS = 33 // { int access(char *path, int amode); } SYS_CHFLAGS = 34 // { int chflags(const char *path, u_long flags); } SYS_FCHFLAGS = 35 // { int fchflags(int fd, u_long flags); } SYS_SYNC = 36 // { int sync(void); } SYS_KILL = 37 // { int kill(int pid, int signum); } SYS_GETPPID = 39 // { pid_t getppid(void); } SYS_DUP = 41 // { int dup(u_int fd); } SYS_GETEGID = 43 // { gid_t getegid(void); } SYS_PROFIL = 44 // { int profil(caddr_t samples, size_t size, size_t offset, u_int scale); } SYS_KTRACE = 45 // { int ktrace(const char *fname, int ops, int facs, int pid); } SYS_GETGID = 47 // { gid_t getgid(void); } SYS_GETLOGIN = 49 // { int getlogin(char *namebuf, u_int namelen); } SYS_SETLOGIN = 50 // { int setlogin(char *namebuf); } SYS_ACCT = 51 // { int acct(char *path); } SYS_SIGALTSTACK = 53 // { int sigaltstack(stack_t *ss, stack_t *oss); } SYS_IOCTL = 54 // { int ioctl(int fd, u_long com, caddr_t data); } SYS_REBOOT = 55 // { int reboot(int opt); } SYS_REVOKE = 56 // { int revoke(char *path); } SYS_SYMLINK = 57 // { int symlink(char *path, char *link); } SYS_READLINK = 58 // { ssize_t readlink(char *path, char *buf, size_t count); } SYS_EXECVE = 59 // { int execve(char *fname, char **argv, char **envv); } SYS_UMASK = 60 // { int umask(int newmask); } SYS_CHROOT = 61 // { int chroot(char *path); } SYS_MSYNC = 65 // { int msync(void *addr, size_t len, int flags); } SYS_VFORK = 66 // { int vfork(void); } SYS_SBRK = 69 // { int sbrk(int incr); } SYS_SSTK = 70 // { int sstk(int incr); } SYS_MUNMAP = 73 // { int munmap(void *addr, size_t len); } SYS_MPROTECT = 74 // { int mprotect(void *addr, size_t len, int prot); } SYS_MADVISE = 75 // { int madvise(void *addr, size_t len, int behav); } SYS_MINCORE = 78 // { int mincore(const void *addr, size_t len, char *vec); } SYS_GETGROUPS = 79 // { int getgroups(u_int gidsetsize, gid_t *gidset); } SYS_SETGROUPS = 80 // { int setgroups(u_int gidsetsize, gid_t *gidset); } SYS_GETPGRP = 81 // { int getpgrp(void); } SYS_SETPGID = 82 // { int setpgid(int pid, int pgid); } SYS_SETITIMER = 83 // { int setitimer(u_int which, struct itimerval *itv, struct itimerval *oitv); } SYS_SWAPON = 85 // { int swapon(char *name); } SYS_GETITIMER = 86 // { int getitimer(u_int which, struct itimerval *itv); } SYS_GETDTABLESIZE = 89 // { int getdtablesize(void); } SYS_DUP2 = 90 // { int dup2(u_int from, u_int to); } SYS_FCNTL = 92 // { int fcntl(int fd, int cmd, long arg); } SYS_SELECT = 93 // { int select(int nd, fd_set *in, fd_set *ou, fd_set *ex, struct timeval *tv); } SYS_FSYNC = 95 // { int fsync(int fd); } SYS_SETPRIORITY = 96 // { int setpriority(int which, int who, int prio); } SYS_SOCKET = 97 // { int socket(int domain, int type, int protocol); } SYS_CONNECT = 98 // { int connect(int s, caddr_t name, int namelen); } SYS_GETPRIORITY = 100 // { int getpriority(int which, int who); } SYS_BIND = 104 // { int bind(int s, caddr_t name, int namelen); } SYS_SETSOCKOPT = 105 // { int setsockopt(int s, int level, int name, caddr_t val, int valsize); } SYS_LISTEN = 106 // { int listen(int s, int backlog); } SYS_GETTIMEOFDAY = 116 // { int gettimeofday(struct timeval *tp, struct timezone *tzp); } SYS_GETRUSAGE = 117 // { int getrusage(int who, struct rusage *rusage); } SYS_GETSOCKOPT = 118 // { int getsockopt(int s, int level, int name, caddr_t val, int *avalsize); } SYS_READV = 120 // { int readv(int fd, struct iovec *iovp, u_int iovcnt); } SYS_WRITEV = 121 // { int writev(int fd, struct iovec *iovp, u_int iovcnt); } SYS_SETTIMEOFDAY = 122 // { int settimeofday(struct timeval *tv, struct timezone *tzp); } SYS_FCHOWN = 123 // { int fchown(int fd, int uid, int gid); } SYS_FCHMOD = 124 // { int fchmod(int fd, int mode); } SYS_SETREUID = 126 // { int setreuid(int ruid, int euid); } SYS_SETREGID = 127 // { int setregid(int rgid, int egid); } SYS_RENAME = 128 // { int rename(char *from, char *to); } SYS_FLOCK = 131 // { int flock(int fd, int how); } SYS_MKFIFO = 132 // { int mkfifo(char *path, int mode); } SYS_SENDTO = 133 // { int sendto(int s, caddr_t buf, size_t len, int flags, caddr_t to, int tolen); } SYS_SHUTDOWN = 134 // { int shutdown(int s, int how); } SYS_SOCKETPAIR = 135 // { int socketpair(int domain, int type, int protocol, int *rsv); } SYS_MKDIR = 136 // { int mkdir(char *path, int mode); } SYS_RMDIR = 137 // { int rmdir(char *path); } SYS_UTIMES = 138 // { int utimes(char *path, struct timeval *tptr); } SYS_ADJTIME = 140 // { int adjtime(struct timeval *delta, struct timeval *olddelta); } SYS_SETSID = 147 // { int setsid(void); } SYS_QUOTACTL = 148 // { int quotactl(char *path, int cmd, int uid, caddr_t arg); } SYS_NLM_SYSCALL = 154 // { int nlm_syscall(int debug_level, int grace_period, int addr_count, char **addrs); } SYS_NFSSVC = 155 // { int nfssvc(int flag, caddr_t argp); } SYS_LGETFH = 160 // { int lgetfh(char *fname, struct fhandle *fhp); } SYS_GETFH = 161 // { int getfh(char *fname, struct fhandle *fhp); } SYS_SYSARCH = 165 // { int sysarch(int op, char *parms); } SYS_RTPRIO = 166 // { int rtprio(int function, pid_t pid, struct rtprio *rtp); } SYS_SEMSYS = 169 // { int semsys(int which, int a2, int a3, int a4, int a5); } SYS_MSGSYS = 170 // { int msgsys(int which, int a2, int a3, int a4, int a5, int a6); } SYS_SHMSYS = 171 // { int shmsys(int which, int a2, int a3, int a4); } SYS_SETFIB = 175 // { int setfib(int fibnum); } SYS_NTP_ADJTIME = 176 // { int ntp_adjtime(struct timex *tp); } SYS_SETGID = 181 // { int setgid(gid_t gid); } SYS_SETEGID = 182 // { int setegid(gid_t egid); } SYS_SETEUID = 183 // { int seteuid(uid_t euid); } SYS_PATHCONF = 191 // { int pathconf(char *path, int name); } SYS_FPATHCONF = 192 // { int fpathconf(int fd, int name); } SYS_GETRLIMIT = 194 // { int getrlimit(u_int which, struct rlimit *rlp); } getrlimit __getrlimit_args int SYS_SETRLIMIT = 195 // { int setrlimit(u_int which, struct rlimit *rlp); } setrlimit __setrlimit_args int SYS___SYSCTL = 202 // { int __sysctl(int *name, u_int namelen, void *old, size_t *oldlenp, void *new, size_t newlen); } __sysctl sysctl_args int SYS_MLOCK = 203 // { int mlock(const void *addr, size_t len); } SYS_MUNLOCK = 204 // { int munlock(const void *addr, size_t len); } SYS_UNDELETE = 205 // { int undelete(char *path); } SYS_FUTIMES = 206 // { int futimes(int fd, struct timeval *tptr); } SYS_GETPGID = 207 // { int getpgid(pid_t pid); } SYS_POLL = 209 // { int poll(struct pollfd *fds, u_int nfds, int timeout); } SYS_SEMGET = 221 // { int semget(key_t key, int nsems, int semflg); } SYS_SEMOP = 222 // { int semop(int semid, struct sembuf *sops, size_t nsops); } SYS_MSGGET = 225 // { int msgget(key_t key, int msgflg); } SYS_MSGSND = 226 // { int msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg); } SYS_MSGRCV = 227 // { ssize_t msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg); } SYS_SHMAT = 228 // { int shmat(int shmid, const void *shmaddr, int shmflg); } SYS_SHMDT = 230 // { int shmdt(const void *shmaddr); } SYS_SHMGET = 231 // { int shmget(key_t key, size_t size, int shmflg); } SYS_CLOCK_GETTIME = 232 // { int clock_gettime(clockid_t clock_id, struct timespec *tp); } SYS_CLOCK_SETTIME = 233 // { int clock_settime(clockid_t clock_id, const struct timespec *tp); } SYS_CLOCK_GETRES = 234 // { int clock_getres(clockid_t clock_id, struct timespec *tp); } SYS_KTIMER_CREATE = 235 // { int ktimer_create(clockid_t clock_id, struct sigevent *evp, int *timerid); } SYS_KTIMER_DELETE = 236 // { int ktimer_delete(int timerid); } SYS_KTIMER_SETTIME = 237 // { int ktimer_settime(int timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue); } SYS_KTIMER_GETTIME = 238 // { int ktimer_gettime(int timerid, struct itimerspec *value); } SYS_KTIMER_GETOVERRUN = 239 // { int ktimer_getoverrun(int timerid); } SYS_NANOSLEEP = 240 // { int nanosleep(const struct timespec *rqtp, struct timespec *rmtp); } SYS_FFCLOCK_GETCOUNTER = 241 // { int ffclock_getcounter(ffcounter *ffcount); } SYS_FFCLOCK_SETESTIMATE = 242 // { int ffclock_setestimate(struct ffclock_estimate *cest); } SYS_FFCLOCK_GETESTIMATE = 243 // { int ffclock_getestimate(struct ffclock_estimate *cest); } SYS_CLOCK_NANOSLEEP = 244 // { int clock_nanosleep(clockid_t clock_id, int flags, const struct timespec *rqtp, struct timespec *rmtp); } SYS_CLOCK_GETCPUCLOCKID2 = 247 // { int clock_getcpuclockid2(id_t id, int which, clockid_t *clock_id); } SYS_NTP_GETTIME = 248 // { int ntp_gettime(struct ntptimeval *ntvp); } SYS_MINHERIT = 250 // { int minherit(void *addr, size_t len, int inherit); } SYS_RFORK = 251 // { int rfork(int flags); } SYS_ISSETUGID = 253 // { int issetugid(void); } SYS_LCHOWN = 254 // { int lchown(char *path, int uid, int gid); } SYS_AIO_READ = 255 // { int aio_read(struct aiocb *aiocbp); } SYS_AIO_WRITE = 256 // { int aio_write(struct aiocb *aiocbp); } SYS_LIO_LISTIO = 257 // { int lio_listio(int mode, struct aiocb* const *acb_list, int nent, struct sigevent *sig); } SYS_LCHMOD = 274 // { int lchmod(char *path, mode_t mode); } SYS_LUTIMES = 276 // { int lutimes(char *path, struct timeval *tptr); } SYS_PREADV = 289 // { ssize_t preadv(int fd, struct iovec *iovp, u_int iovcnt, off_t offset); } SYS_PWRITEV = 290 // { ssize_t pwritev(int fd, struct iovec *iovp, u_int iovcnt, off_t offset); } SYS_FHOPEN = 298 // { int fhopen(const struct fhandle *u_fhp, int flags); } SYS_MODNEXT = 300 // { int modnext(int modid); } SYS_MODSTAT = 301 // { int modstat(int modid, struct module_stat* stat); } SYS_MODFNEXT = 302 // { int modfnext(int modid); } SYS_MODFIND = 303 // { int modfind(const char *name); } SYS_KLDLOAD = 304 // { int kldload(const char *file); } SYS_KLDUNLOAD = 305 // { int kldunload(int fileid); } SYS_KLDFIND = 306 // { int kldfind(const char *file); } SYS_KLDNEXT = 307 // { int kldnext(int fileid); } SYS_KLDSTAT = 308 // { int kldstat(int fileid, struct kld_file_stat *stat); } SYS_KLDFIRSTMOD = 309 // { int kldfirstmod(int fileid); } SYS_GETSID = 310 // { int getsid(pid_t pid); } SYS_SETRESUID = 311 // { int setresuid(uid_t ruid, uid_t euid, uid_t suid); } SYS_SETRESGID = 312 // { int setresgid(gid_t rgid, gid_t egid, gid_t sgid); } SYS_AIO_RETURN = 314 // { ssize_t aio_return(struct aiocb *aiocbp); } SYS_AIO_SUSPEND = 315 // { int aio_suspend(struct aiocb * const * aiocbp, int nent, const struct timespec *timeout); } SYS_AIO_CANCEL = 316 // { int aio_cancel(int fd, struct aiocb *aiocbp); } SYS_AIO_ERROR = 317 // { int aio_error(struct aiocb *aiocbp); } SYS_YIELD = 321 // { int yield(void); } SYS_MLOCKALL = 324 // { int mlockall(int how); } SYS_MUNLOCKALL = 325 // { int munlockall(void); } SYS___GETCWD = 326 // { int __getcwd(char *buf, size_t buflen); } SYS_SCHED_SETPARAM = 327 // { int sched_setparam (pid_t pid, const struct sched_param *param); } SYS_SCHED_GETPARAM = 328 // { int sched_getparam (pid_t pid, struct sched_param *param); } SYS_SCHED_SETSCHEDULER = 329 // { int sched_setscheduler (pid_t pid, int policy, const struct sched_param *param); } SYS_SCHED_GETSCHEDULER = 330 // { int sched_getscheduler (pid_t pid); } SYS_SCHED_YIELD = 331 // { int sched_yield (void); } SYS_SCHED_GET_PRIORITY_MAX = 332 // { int sched_get_priority_max (int policy); } SYS_SCHED_GET_PRIORITY_MIN = 333 // { int sched_get_priority_min (int policy); } SYS_SCHED_RR_GET_INTERVAL = 334 // { int sched_rr_get_interval (pid_t pid, struct timespec *interval); } SYS_UTRACE = 335 // { int utrace(const void *addr, size_t len); } SYS_KLDSYM = 337 // { int kldsym(int fileid, int cmd, void *data); } SYS_JAIL = 338 // { int jail(struct jail *jail); } SYS_SIGPROCMASK = 340 // { int sigprocmask(int how, const sigset_t *set, sigset_t *oset); } SYS_SIGSUSPEND = 341 // { int sigsuspend(const sigset_t *sigmask); } SYS_SIGPENDING = 343 // { int sigpending(sigset_t *set); } SYS_SIGTIMEDWAIT = 345 // { int sigtimedwait(const sigset_t *set, siginfo_t *info, const struct timespec *timeout); } SYS_SIGWAITINFO = 346 // { int sigwaitinfo(const sigset_t *set, siginfo_t *info); } SYS___ACL_GET_FILE = 347 // { int __acl_get_file(const char *path, acl_type_t type, struct acl *aclp); } SYS___ACL_SET_FILE = 348 // { int __acl_set_file(const char *path, acl_type_t type, struct acl *aclp); } SYS___ACL_GET_FD = 349 // { int __acl_get_fd(int filedes, acl_type_t type, struct acl *aclp); } SYS___ACL_SET_FD = 350 // { int __acl_set_fd(int filedes, acl_type_t type, struct acl *aclp); } SYS___ACL_DELETE_FILE = 351 // { int __acl_delete_file(const char *path, acl_type_t type); } SYS___ACL_DELETE_FD = 352 // { int __acl_delete_fd(int filedes, acl_type_t type); } SYS___ACL_ACLCHECK_FILE = 353 // { int __acl_aclcheck_file(const char *path, acl_type_t type, struct acl *aclp); } SYS___ACL_ACLCHECK_FD = 354 // { int __acl_aclcheck_fd(int filedes, acl_type_t type, struct acl *aclp); } SYS_EXTATTRCTL = 355 // { int extattrctl(const char *path, int cmd, const char *filename, int attrnamespace, const char *attrname); } SYS_EXTATTR_SET_FILE = 356 // { ssize_t extattr_set_file(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_GET_FILE = 357 // { ssize_t extattr_get_file(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_DELETE_FILE = 358 // { int extattr_delete_file(const char *path, int attrnamespace, const char *attrname); } SYS_AIO_WAITCOMPLETE = 359 // { ssize_t aio_waitcomplete(struct aiocb **aiocbp, struct timespec *timeout); } SYS_GETRESUID = 360 // { int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); } SYS_GETRESGID = 361 // { int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); } SYS_KQUEUE = 362 // { int kqueue(void); } SYS_EXTATTR_SET_FD = 371 // { ssize_t extattr_set_fd(int fd, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_GET_FD = 372 // { ssize_t extattr_get_fd(int fd, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_DELETE_FD = 373 // { int extattr_delete_fd(int fd, int attrnamespace, const char *attrname); } SYS___SETUGID = 374 // { int __setugid(int flag); } SYS_EACCESS = 376 // { int eaccess(char *path, int amode); } SYS_NMOUNT = 378 // { int nmount(struct iovec *iovp, unsigned int iovcnt, int flags); } SYS___MAC_GET_PROC = 384 // { int __mac_get_proc(struct mac *mac_p); } SYS___MAC_SET_PROC = 385 // { int __mac_set_proc(struct mac *mac_p); } SYS___MAC_GET_FD = 386 // { int __mac_get_fd(int fd, struct mac *mac_p); } SYS___MAC_GET_FILE = 387 // { int __mac_get_file(const char *path_p, struct mac *mac_p); } SYS___MAC_SET_FD = 388 // { int __mac_set_fd(int fd, struct mac *mac_p); } SYS___MAC_SET_FILE = 389 // { int __mac_set_file(const char *path_p, struct mac *mac_p); } SYS_KENV = 390 // { int kenv(int what, const char *name, char *value, int len); } SYS_LCHFLAGS = 391 // { int lchflags(const char *path, u_long flags); } SYS_UUIDGEN = 392 // { int uuidgen(struct uuid *store, int count); } SYS_SENDFILE = 393 // { int sendfile(int fd, int s, off_t offset, size_t nbytes, struct sf_hdtr *hdtr, off_t *sbytes, int flags); } SYS_MAC_SYSCALL = 394 // { int mac_syscall(const char *policy, int call, void *arg); } SYS_KSEM_CLOSE = 400 // { int ksem_close(semid_t id); } SYS_KSEM_POST = 401 // { int ksem_post(semid_t id); } SYS_KSEM_WAIT = 402 // { int ksem_wait(semid_t id); } SYS_KSEM_TRYWAIT = 403 // { int ksem_trywait(semid_t id); } SYS_KSEM_INIT = 404 // { int ksem_init(semid_t *idp, unsigned int value); } SYS_KSEM_OPEN = 405 // { int ksem_open(semid_t *idp, const char *name, int oflag, mode_t mode, unsigned int value); } SYS_KSEM_UNLINK = 406 // { int ksem_unlink(const char *name); } SYS_KSEM_GETVALUE = 407 // { int ksem_getvalue(semid_t id, int *val); } SYS_KSEM_DESTROY = 408 // { int ksem_destroy(semid_t id); } SYS___MAC_GET_PID = 409 // { int __mac_get_pid(pid_t pid, struct mac *mac_p); } SYS___MAC_GET_LINK = 410 // { int __mac_get_link(const char *path_p, struct mac *mac_p); } SYS___MAC_SET_LINK = 411 // { int __mac_set_link(const char *path_p, struct mac *mac_p); } SYS_EXTATTR_SET_LINK = 412 // { ssize_t extattr_set_link(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_GET_LINK = 413 // { ssize_t extattr_get_link(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_DELETE_LINK = 414 // { int extattr_delete_link(const char *path, int attrnamespace, const char *attrname); } SYS___MAC_EXECVE = 415 // { int __mac_execve(char *fname, char **argv, char **envv, struct mac *mac_p); } SYS_SIGACTION = 416 // { int sigaction(int sig, const struct sigaction *act, struct sigaction *oact); } SYS_SIGRETURN = 417 // { int sigreturn(const struct __ucontext *sigcntxp); } SYS_GETCONTEXT = 421 // { int getcontext(struct __ucontext *ucp); } SYS_SETCONTEXT = 422 // { int setcontext(const struct __ucontext *ucp); } SYS_SWAPCONTEXT = 423 // { int swapcontext(struct __ucontext *oucp, const struct __ucontext *ucp); } SYS_SWAPOFF = 424 // { int swapoff(const char *name); } SYS___ACL_GET_LINK = 425 // { int __acl_get_link(const char *path, acl_type_t type, struct acl *aclp); } SYS___ACL_SET_LINK = 426 // { int __acl_set_link(const char *path, acl_type_t type, struct acl *aclp); } SYS___ACL_DELETE_LINK = 427 // { int __acl_delete_link(const char *path, acl_type_t type); } SYS___ACL_ACLCHECK_LINK = 428 // { int __acl_aclcheck_link(const char *path, acl_type_t type, struct acl *aclp); } SYS_SIGWAIT = 429 // { int sigwait(const sigset_t *set, int *sig); } SYS_THR_CREATE = 430 // { int thr_create(ucontext_t *ctx, long *id, int flags); } SYS_THR_EXIT = 431 // { void thr_exit(long *state); } SYS_THR_SELF = 432 // { int thr_self(long *id); } SYS_THR_KILL = 433 // { int thr_kill(long id, int sig); } SYS_JAIL_ATTACH = 436 // { int jail_attach(int jid); } SYS_EXTATTR_LIST_FD = 437 // { ssize_t extattr_list_fd(int fd, int attrnamespace, void *data, size_t nbytes); } SYS_EXTATTR_LIST_FILE = 438 // { ssize_t extattr_list_file(const char *path, int attrnamespace, void *data, size_t nbytes); } SYS_EXTATTR_LIST_LINK = 439 // { ssize_t extattr_list_link(const char *path, int attrnamespace, void *data, size_t nbytes); } SYS_KSEM_TIMEDWAIT = 441 // { int ksem_timedwait(semid_t id, const struct timespec *abstime); } SYS_THR_SUSPEND = 442 // { int thr_suspend(const struct timespec *timeout); } SYS_THR_WAKE = 443 // { int thr_wake(long id); } SYS_KLDUNLOADF = 444 // { int kldunloadf(int fileid, int flags); } SYS_AUDIT = 445 // { int audit(const void *record, u_int length); } SYS_AUDITON = 446 // { int auditon(int cmd, void *data, u_int length); } SYS_GETAUID = 447 // { int getauid(uid_t *auid); } SYS_SETAUID = 448 // { int setauid(uid_t *auid); } SYS_GETAUDIT = 449 // { int getaudit(struct auditinfo *auditinfo); } SYS_SETAUDIT = 450 // { int setaudit(struct auditinfo *auditinfo); } SYS_GETAUDIT_ADDR = 451 // { int getaudit_addr(struct auditinfo_addr *auditinfo_addr, u_int length); } SYS_SETAUDIT_ADDR = 452 // { int setaudit_addr(struct auditinfo_addr *auditinfo_addr, u_int length); } SYS_AUDITCTL = 453 // { int auditctl(char *path); } SYS__UMTX_OP = 454 // { int _umtx_op(void *obj, int op, u_long val, void *uaddr1, void *uaddr2); } SYS_THR_NEW = 455 // { int thr_new(struct thr_param *param, int param_size); } SYS_SIGQUEUE = 456 // { int sigqueue(pid_t pid, int signum, void *value); } SYS_KMQ_OPEN = 457 // { int kmq_open(const char *path, int flags, mode_t mode, const struct mq_attr *attr); } SYS_KMQ_SETATTR = 458 // { int kmq_setattr(int mqd, const struct mq_attr *attr, struct mq_attr *oattr); } SYS_KMQ_TIMEDRECEIVE = 459 // { int kmq_timedreceive(int mqd, char *msg_ptr, size_t msg_len, unsigned *msg_prio, const struct timespec *abs_timeout); } SYS_KMQ_TIMEDSEND = 460 // { int kmq_timedsend(int mqd, const char *msg_ptr, size_t msg_len, unsigned msg_prio, const struct timespec *abs_timeout); } SYS_KMQ_NOTIFY = 461 // { int kmq_notify(int mqd, const struct sigevent *sigev); } SYS_KMQ_UNLINK = 462 // { int kmq_unlink(const char *path); } SYS_ABORT2 = 463 // { int abort2(const char *why, int nargs, void **args); } SYS_THR_SET_NAME = 464 // { int thr_set_name(long id, const char *name); } SYS_AIO_FSYNC = 465 // { int aio_fsync(int op, struct aiocb *aiocbp); } SYS_RTPRIO_THREAD = 466 // { int rtprio_thread(int function, lwpid_t lwpid, struct rtprio *rtp); } SYS_SCTP_PEELOFF = 471 // { int sctp_peeloff(int sd, uint32_t name); } SYS_SCTP_GENERIC_SENDMSG = 472 // { int sctp_generic_sendmsg(int sd, caddr_t msg, int mlen, caddr_t to, __socklen_t tolen, struct sctp_sndrcvinfo *sinfo, int flags); } SYS_SCTP_GENERIC_SENDMSG_IOV = 473 // { int sctp_generic_sendmsg_iov(int sd, struct iovec *iov, int iovlen, caddr_t to, __socklen_t tolen, struct sctp_sndrcvinfo *sinfo, int flags); } SYS_SCTP_GENERIC_RECVMSG = 474 // { int sctp_generic_recvmsg(int sd, struct iovec *iov, int iovlen, struct sockaddr *from, __socklen_t *fromlenaddr, struct sctp_sndrcvinfo *sinfo, int *msg_flags); } SYS_PREAD = 475 // { ssize_t pread(int fd, void *buf, size_t nbyte, off_t offset); } SYS_PWRITE = 476 // { ssize_t pwrite(int fd, const void *buf, size_t nbyte, off_t offset); } SYS_MMAP = 477 // { caddr_t mmap(caddr_t addr, size_t len, int prot, int flags, int fd, off_t pos); } SYS_LSEEK = 478 // { off_t lseek(int fd, off_t offset, int whence); } SYS_TRUNCATE = 479 // { int truncate(char *path, off_t length); } SYS_FTRUNCATE = 480 // { int ftruncate(int fd, off_t length); } SYS_THR_KILL2 = 481 // { int thr_kill2(pid_t pid, long id, int sig); } SYS_SHM_OPEN = 482 // { int shm_open(const char *path, int flags, mode_t mode); } SYS_SHM_UNLINK = 483 // { int shm_unlink(const char *path); } SYS_CPUSET = 484 // { int cpuset(cpusetid_t *setid); } SYS_CPUSET_SETID = 485 // { int cpuset_setid(cpuwhich_t which, id_t id, cpusetid_t setid); } SYS_CPUSET_GETID = 486 // { int cpuset_getid(cpulevel_t level, cpuwhich_t which, id_t id, cpusetid_t *setid); } SYS_CPUSET_GETAFFINITY = 487 // { int cpuset_getaffinity(cpulevel_t level, cpuwhich_t which, id_t id, size_t cpusetsize, cpuset_t *mask); } SYS_CPUSET_SETAFFINITY = 488 // { int cpuset_setaffinity(cpulevel_t level, cpuwhich_t which, id_t id, size_t cpusetsize, const cpuset_t *mask); } SYS_FACCESSAT = 489 // { int faccessat(int fd, char *path, int amode, int flag); } SYS_FCHMODAT = 490 // { int fchmodat(int fd, char *path, mode_t mode, int flag); } SYS_FCHOWNAT = 491 // { int fchownat(int fd, char *path, uid_t uid, gid_t gid, int flag); } SYS_FEXECVE = 492 // { int fexecve(int fd, char **argv, char **envv); } SYS_FUTIMESAT = 494 // { int futimesat(int fd, char *path, struct timeval *times); } SYS_LINKAT = 495 // { int linkat(int fd1, char *path1, int fd2, char *path2, int flag); } SYS_MKDIRAT = 496 // { int mkdirat(int fd, char *path, mode_t mode); } SYS_MKFIFOAT = 497 // { int mkfifoat(int fd, char *path, mode_t mode); } SYS_OPENAT = 499 // { int openat(int fd, char *path, int flag, mode_t mode); } SYS_READLINKAT = 500 // { ssize_t readlinkat(int fd, char *path, char *buf, size_t bufsize); } SYS_RENAMEAT = 501 // { int renameat(int oldfd, char *old, int newfd, char *new); } SYS_SYMLINKAT = 502 // { int symlinkat(char *path1, int fd, char *path2); } SYS_UNLINKAT = 503 // { int unlinkat(int fd, char *path, int flag); } SYS_POSIX_OPENPT = 504 // { int posix_openpt(int flags); } SYS_GSSD_SYSCALL = 505 // { int gssd_syscall(char *path); } SYS_JAIL_GET = 506 // { int jail_get(struct iovec *iovp, unsigned int iovcnt, int flags); } SYS_JAIL_SET = 507 // { int jail_set(struct iovec *iovp, unsigned int iovcnt, int flags); } SYS_JAIL_REMOVE = 508 // { int jail_remove(int jid); } SYS_CLOSEFROM = 509 // { int closefrom(int lowfd); } SYS___SEMCTL = 510 // { int __semctl(int semid, int semnum, int cmd, union semun *arg); } SYS_MSGCTL = 511 // { int msgctl(int msqid, int cmd, struct msqid_ds *buf); } SYS_SHMCTL = 512 // { int shmctl(int shmid, int cmd, struct shmid_ds *buf); } SYS_LPATHCONF = 513 // { int lpathconf(char *path, int name); } SYS___CAP_RIGHTS_GET = 515 // { int __cap_rights_get(int version, int fd, cap_rights_t *rightsp); } SYS_CAP_ENTER = 516 // { int cap_enter(void); } SYS_CAP_GETMODE = 517 // { int cap_getmode(u_int *modep); } SYS_PDFORK = 518 // { int pdfork(int *fdp, int flags); } SYS_PDKILL = 519 // { int pdkill(int fd, int signum); } SYS_PDGETPID = 520 // { int pdgetpid(int fd, pid_t *pidp); } SYS_PSELECT = 522 // { int pselect(int nd, fd_set *in, fd_set *ou, fd_set *ex, const struct timespec *ts, const sigset_t *sm); } SYS_GETLOGINCLASS = 523 // { int getloginclass(char *namebuf, size_t namelen); } SYS_SETLOGINCLASS = 524 // { int setloginclass(const char *namebuf); } SYS_RCTL_GET_RACCT = 525 // { int rctl_get_racct(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); } SYS_RCTL_GET_RULES = 526 // { int rctl_get_rules(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); } SYS_RCTL_GET_LIMITS = 527 // { int rctl_get_limits(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); } SYS_RCTL_ADD_RULE = 528 // { int rctl_add_rule(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); } SYS_RCTL_REMOVE_RULE = 529 // { int rctl_remove_rule(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); } SYS_POSIX_FALLOCATE = 530 // { int posix_fallocate(int fd, off_t offset, off_t len); } SYS_POSIX_FADVISE = 531 // { int posix_fadvise(int fd, off_t offset, off_t len, int advice); } SYS_WAIT6 = 532 // { int wait6(idtype_t idtype, id_t id, int *status, int options, struct __wrusage *wrusage, siginfo_t *info); } SYS_CAP_RIGHTS_LIMIT = 533 // { int cap_rights_limit(int fd, cap_rights_t *rightsp); } SYS_CAP_IOCTLS_LIMIT = 534 // { int cap_ioctls_limit(int fd, const u_long *cmds, size_t ncmds); } SYS_CAP_IOCTLS_GET = 535 // { ssize_t cap_ioctls_get(int fd, u_long *cmds, size_t maxcmds); } SYS_CAP_FCNTLS_LIMIT = 536 // { int cap_fcntls_limit(int fd, uint32_t fcntlrights); } SYS_CAP_FCNTLS_GET = 537 // { int cap_fcntls_get(int fd, uint32_t *fcntlrightsp); } SYS_BINDAT = 538 // { int bindat(int fd, int s, caddr_t name, int namelen); } SYS_CONNECTAT = 539 // { int connectat(int fd, int s, caddr_t name, int namelen); } SYS_CHFLAGSAT = 540 // { int chflagsat(int fd, const char *path, u_long flags, int atflag); } SYS_ACCEPT4 = 541 // { int accept4(int s, struct sockaddr * __restrict name, __socklen_t * __restrict anamelen, int flags); } SYS_PIPE2 = 542 // { int pipe2(int *fildes, int flags); } SYS_AIO_MLOCK = 543 // { int aio_mlock(struct aiocb *aiocbp); } SYS_PROCCTL = 544 // { int procctl(idtype_t idtype, id_t id, int com, void *data); } SYS_PPOLL = 545 // { int ppoll(struct pollfd *fds, u_int nfds, const struct timespec *ts, const sigset_t *set); } SYS_FUTIMENS = 546 // { int futimens(int fd, struct timespec *times); } SYS_UTIMENSAT = 547 // { int utimensat(int fd, char *path, struct timespec *times, int flag); } SYS_FDATASYNC = 550 // { int fdatasync(int fd); } SYS_FSTAT = 551 // { int fstat(int fd, struct stat *sb); } SYS_FSTATAT = 552 // { int fstatat(int fd, char *path, struct stat *buf, int flag); } SYS_FHSTAT = 553 // { int fhstat(const struct fhandle *u_fhp, struct stat *sb); } SYS_GETDIRENTRIES = 554 // { ssize_t getdirentries(int fd, char *buf, size_t count, off_t *basep); } SYS_STATFS = 555 // { int statfs(char *path, struct statfs *buf); } SYS_FSTATFS = 556 // { int fstatfs(int fd, struct statfs *buf); } SYS_GETFSSTAT = 557 // { int getfsstat(struct statfs *buf, long bufsize, int mode); } SYS_FHSTATFS = 558 // { int fhstatfs(const struct fhandle *u_fhp, struct statfs *buf); } SYS_MKNODAT = 559 // { int mknodat(int fd, char *path, mode_t mode, dev_t dev); } SYS_KEVENT = 560 // { int kevent(int fd, struct kevent *changelist, int nchanges, struct kevent *eventlist, int nevents, const struct timespec *timeout); } SYS_CPUSET_GETDOMAIN = 561 // { int cpuset_getdomain(cpulevel_t level, cpuwhich_t which, id_t id, size_t domainsetsize, domainset_t *mask, int *policy); } SYS_CPUSET_SETDOMAIN = 562 // { int cpuset_setdomain(cpulevel_t level, cpuwhich_t which, id_t id, size_t domainsetsize, domainset_t *mask, int policy); } SYS_GETRANDOM = 563 // { int getrandom(void *buf, size_t buflen, unsigned int flags); } SYS_GETFHAT = 564 // { int getfhat(int fd, char *path, struct fhandle *fhp, int flags); } SYS_FHLINK = 565 // { int fhlink(struct fhandle *fhp, const char *to); } SYS_FHLINKAT = 566 // { int fhlinkat(struct fhandle *fhp, int tofd, const char *to,); } SYS_FHREADLINK = 567 // { int fhreadlink(struct fhandle *fhp, char *buf, size_t bufsize); } SYS___SYSCTLBYNAME = 570 // { int __sysctlbyname(const char *name, size_t namelen, void *old, size_t *oldlenp, void *new, size_t newlen); } SYS_CLOSE_RANGE = 575 // { int close_range(u_int lowfd, u_int highfd, int flags); } ) ================================================ FILE: vendor/golang.org/x/sys/unix/zsysnum_linux_386.go ================================================ // go run linux/mksysnum.go -Wall -Werror -static -I/tmp/386/include -m32 /tmp/386/include/asm/unistd.h // Code generated by the command above; see README.md. DO NOT EDIT. //go:build 386 && linux package unix const ( SYS_RESTART_SYSCALL = 0 SYS_EXIT = 1 SYS_FORK = 2 SYS_READ = 3 SYS_WRITE = 4 SYS_OPEN = 5 SYS_CLOSE = 6 SYS_WAITPID = 7 SYS_CREAT = 8 SYS_LINK = 9 SYS_UNLINK = 10 SYS_EXECVE = 11 SYS_CHDIR = 12 SYS_TIME = 13 SYS_MKNOD = 14 SYS_CHMOD = 15 SYS_LCHOWN = 16 SYS_BREAK = 17 SYS_OLDSTAT = 18 SYS_LSEEK = 19 SYS_GETPID = 20 SYS_MOUNT = 21 SYS_UMOUNT = 22 SYS_SETUID = 23 SYS_GETUID = 24 SYS_STIME = 25 SYS_PTRACE = 26 SYS_ALARM = 27 SYS_OLDFSTAT = 28 SYS_PAUSE = 29 SYS_UTIME = 30 SYS_STTY = 31 SYS_GTTY = 32 SYS_ACCESS = 33 SYS_NICE = 34 SYS_FTIME = 35 SYS_SYNC = 36 SYS_KILL = 37 SYS_RENAME = 38 SYS_MKDIR = 39 SYS_RMDIR = 40 SYS_DUP = 41 SYS_PIPE = 42 SYS_TIMES = 43 SYS_PROF = 44 SYS_BRK = 45 SYS_SETGID = 46 SYS_GETGID = 47 SYS_SIGNAL = 48 SYS_GETEUID = 49 SYS_GETEGID = 50 SYS_ACCT = 51 SYS_UMOUNT2 = 52 SYS_LOCK = 53 SYS_IOCTL = 54 SYS_FCNTL = 55 SYS_MPX = 56 SYS_SETPGID = 57 SYS_ULIMIT = 58 SYS_OLDOLDUNAME = 59 SYS_UMASK = 60 SYS_CHROOT = 61 SYS_USTAT = 62 SYS_DUP2 = 63 SYS_GETPPID = 64 SYS_GETPGRP = 65 SYS_SETSID = 66 SYS_SIGACTION = 67 SYS_SGETMASK = 68 SYS_SSETMASK = 69 SYS_SETREUID = 70 SYS_SETREGID = 71 SYS_SIGSUSPEND = 72 SYS_SIGPENDING = 73 SYS_SETHOSTNAME = 74 SYS_SETRLIMIT = 75 SYS_GETRLIMIT = 76 SYS_GETRUSAGE = 77 SYS_GETTIMEOFDAY = 78 SYS_SETTIMEOFDAY = 79 SYS_GETGROUPS = 80 SYS_SETGROUPS = 81 SYS_SELECT = 82 SYS_SYMLINK = 83 SYS_OLDLSTAT = 84 SYS_READLINK = 85 SYS_USELIB = 86 SYS_SWAPON = 87 SYS_REBOOT = 88 SYS_READDIR = 89 SYS_MMAP = 90 SYS_MUNMAP = 91 SYS_TRUNCATE = 92 SYS_FTRUNCATE = 93 SYS_FCHMOD = 94 SYS_FCHOWN = 95 SYS_GETPRIORITY = 96 SYS_SETPRIORITY = 97 SYS_PROFIL = 98 SYS_STATFS = 99 SYS_FSTATFS = 100 SYS_IOPERM = 101 SYS_SOCKETCALL = 102 SYS_SYSLOG = 103 SYS_SETITIMER = 104 SYS_GETITIMER = 105 SYS_STAT = 106 SYS_LSTAT = 107 SYS_FSTAT = 108 SYS_OLDUNAME = 109 SYS_IOPL = 110 SYS_VHANGUP = 111 SYS_IDLE = 112 SYS_VM86OLD = 113 SYS_WAIT4 = 114 SYS_SWAPOFF = 115 SYS_SYSINFO = 116 SYS_IPC = 117 SYS_FSYNC = 118 SYS_SIGRETURN = 119 SYS_CLONE = 120 SYS_SETDOMAINNAME = 121 SYS_UNAME = 122 SYS_MODIFY_LDT = 123 SYS_ADJTIMEX = 124 SYS_MPROTECT = 125 SYS_SIGPROCMASK = 126 SYS_CREATE_MODULE = 127 SYS_INIT_MODULE = 128 SYS_DELETE_MODULE = 129 SYS_GET_KERNEL_SYMS = 130 SYS_QUOTACTL = 131 SYS_GETPGID = 132 SYS_FCHDIR = 133 SYS_BDFLUSH = 134 SYS_SYSFS = 135 SYS_PERSONALITY = 136 SYS_AFS_SYSCALL = 137 SYS_SETFSUID = 138 SYS_SETFSGID = 139 SYS__LLSEEK = 140 SYS_GETDENTS = 141 SYS__NEWSELECT = 142 SYS_FLOCK = 143 SYS_MSYNC = 144 SYS_READV = 145 SYS_WRITEV = 146 SYS_GETSID = 147 SYS_FDATASYNC = 148 SYS__SYSCTL = 149 SYS_MLOCK = 150 SYS_MUNLOCK = 151 SYS_MLOCKALL = 152 SYS_MUNLOCKALL = 153 SYS_SCHED_SETPARAM = 154 SYS_SCHED_GETPARAM = 155 SYS_SCHED_SETSCHEDULER = 156 SYS_SCHED_GETSCHEDULER = 157 SYS_SCHED_YIELD = 158 SYS_SCHED_GET_PRIORITY_MAX = 159 SYS_SCHED_GET_PRIORITY_MIN = 160 SYS_SCHED_RR_GET_INTERVAL = 161 SYS_NANOSLEEP = 162 SYS_MREMAP = 163 SYS_SETRESUID = 164 SYS_GETRESUID = 165 SYS_VM86 = 166 SYS_QUERY_MODULE = 167 SYS_POLL = 168 SYS_NFSSERVCTL = 169 SYS_SETRESGID = 170 SYS_GETRESGID = 171 SYS_PRCTL = 172 SYS_RT_SIGRETURN = 173 SYS_RT_SIGACTION = 174 SYS_RT_SIGPROCMASK = 175 SYS_RT_SIGPENDING = 176 SYS_RT_SIGTIMEDWAIT = 177 SYS_RT_SIGQUEUEINFO = 178 SYS_RT_SIGSUSPEND = 179 SYS_PREAD64 = 180 SYS_PWRITE64 = 181 SYS_CHOWN = 182 SYS_GETCWD = 183 SYS_CAPGET = 184 SYS_CAPSET = 185 SYS_SIGALTSTACK = 186 SYS_SENDFILE = 187 SYS_GETPMSG = 188 SYS_PUTPMSG = 189 SYS_VFORK = 190 SYS_UGETRLIMIT = 191 SYS_MMAP2 = 192 SYS_TRUNCATE64 = 193 SYS_FTRUNCATE64 = 194 SYS_STAT64 = 195 SYS_LSTAT64 = 196 SYS_FSTAT64 = 197 SYS_LCHOWN32 = 198 SYS_GETUID32 = 199 SYS_GETGID32 = 200 SYS_GETEUID32 = 201 SYS_GETEGID32 = 202 SYS_SETREUID32 = 203 SYS_SETREGID32 = 204 SYS_GETGROUPS32 = 205 SYS_SETGROUPS32 = 206 SYS_FCHOWN32 = 207 SYS_SETRESUID32 = 208 SYS_GETRESUID32 = 209 SYS_SETRESGID32 = 210 SYS_GETRESGID32 = 211 SYS_CHOWN32 = 212 SYS_SETUID32 = 213 SYS_SETGID32 = 214 SYS_SETFSUID32 = 215 SYS_SETFSGID32 = 216 SYS_PIVOT_ROOT = 217 SYS_MINCORE = 218 SYS_MADVISE = 219 SYS_GETDENTS64 = 220 SYS_FCNTL64 = 221 SYS_GETTID = 224 SYS_READAHEAD = 225 SYS_SETXATTR = 226 SYS_LSETXATTR = 227 SYS_FSETXATTR = 228 SYS_GETXATTR = 229 SYS_LGETXATTR = 230 SYS_FGETXATTR = 231 SYS_LISTXATTR = 232 SYS_LLISTXATTR = 233 SYS_FLISTXATTR = 234 SYS_REMOVEXATTR = 235 SYS_LREMOVEXATTR = 236 SYS_FREMOVEXATTR = 237 SYS_TKILL = 238 SYS_SENDFILE64 = 239 SYS_FUTEX = 240 SYS_SCHED_SETAFFINITY = 241 SYS_SCHED_GETAFFINITY = 242 SYS_SET_THREAD_AREA = 243 SYS_GET_THREAD_AREA = 244 SYS_IO_SETUP = 245 SYS_IO_DESTROY = 246 SYS_IO_GETEVENTS = 247 SYS_IO_SUBMIT = 248 SYS_IO_CANCEL = 249 SYS_FADVISE64 = 250 SYS_EXIT_GROUP = 252 SYS_LOOKUP_DCOOKIE = 253 SYS_EPOLL_CREATE = 254 SYS_EPOLL_CTL = 255 SYS_EPOLL_WAIT = 256 SYS_REMAP_FILE_PAGES = 257 SYS_SET_TID_ADDRESS = 258 SYS_TIMER_CREATE = 259 SYS_TIMER_SETTIME = 260 SYS_TIMER_GETTIME = 261 SYS_TIMER_GETOVERRUN = 262 SYS_TIMER_DELETE = 263 SYS_CLOCK_SETTIME = 264 SYS_CLOCK_GETTIME = 265 SYS_CLOCK_GETRES = 266 SYS_CLOCK_NANOSLEEP = 267 SYS_STATFS64 = 268 SYS_FSTATFS64 = 269 SYS_TGKILL = 270 SYS_UTIMES = 271 SYS_FADVISE64_64 = 272 SYS_VSERVER = 273 SYS_MBIND = 274 SYS_GET_MEMPOLICY = 275 SYS_SET_MEMPOLICY = 276 SYS_MQ_OPEN = 277 SYS_MQ_UNLINK = 278 SYS_MQ_TIMEDSEND = 279 SYS_MQ_TIMEDRECEIVE = 280 SYS_MQ_NOTIFY = 281 SYS_MQ_GETSETATTR = 282 SYS_KEXEC_LOAD = 283 SYS_WAITID = 284 SYS_ADD_KEY = 286 SYS_REQUEST_KEY = 287 SYS_KEYCTL = 288 SYS_IOPRIO_SET = 289 SYS_IOPRIO_GET = 290 SYS_INOTIFY_INIT = 291 SYS_INOTIFY_ADD_WATCH = 292 SYS_INOTIFY_RM_WATCH = 293 SYS_MIGRATE_PAGES = 294 SYS_OPENAT = 295 SYS_MKDIRAT = 296 SYS_MKNODAT = 297 SYS_FCHOWNAT = 298 SYS_FUTIMESAT = 299 SYS_FSTATAT64 = 300 SYS_UNLINKAT = 301 SYS_RENAMEAT = 302 SYS_LINKAT = 303 SYS_SYMLINKAT = 304 SYS_READLINKAT = 305 SYS_FCHMODAT = 306 SYS_FACCESSAT = 307 SYS_PSELECT6 = 308 SYS_PPOLL = 309 SYS_UNSHARE = 310 SYS_SET_ROBUST_LIST = 311 SYS_GET_ROBUST_LIST = 312 SYS_SPLICE = 313 SYS_SYNC_FILE_RANGE = 314 SYS_TEE = 315 SYS_VMSPLICE = 316 SYS_MOVE_PAGES = 317 SYS_GETCPU = 318 SYS_EPOLL_PWAIT = 319 SYS_UTIMENSAT = 320 SYS_SIGNALFD = 321 SYS_TIMERFD_CREATE = 322 SYS_EVENTFD = 323 SYS_FALLOCATE = 324 SYS_TIMERFD_SETTIME = 325 SYS_TIMERFD_GETTIME = 326 SYS_SIGNALFD4 = 327 SYS_EVENTFD2 = 328 SYS_EPOLL_CREATE1 = 329 SYS_DUP3 = 330 SYS_PIPE2 = 331 SYS_INOTIFY_INIT1 = 332 SYS_PREADV = 333 SYS_PWRITEV = 334 SYS_RT_TGSIGQUEUEINFO = 335 SYS_PERF_EVENT_OPEN = 336 SYS_RECVMMSG = 337 SYS_FANOTIFY_INIT = 338 SYS_FANOTIFY_MARK = 339 SYS_PRLIMIT64 = 340 SYS_NAME_TO_HANDLE_AT = 341 SYS_OPEN_BY_HANDLE_AT = 342 SYS_CLOCK_ADJTIME = 343 SYS_SYNCFS = 344 SYS_SENDMMSG = 345 SYS_SETNS = 346 SYS_PROCESS_VM_READV = 347 SYS_PROCESS_VM_WRITEV = 348 SYS_KCMP = 349 SYS_FINIT_MODULE = 350 SYS_SCHED_SETATTR = 351 SYS_SCHED_GETATTR = 352 SYS_RENAMEAT2 = 353 SYS_SECCOMP = 354 SYS_GETRANDOM = 355 SYS_MEMFD_CREATE = 356 SYS_BPF = 357 SYS_EXECVEAT = 358 SYS_SOCKET = 359 SYS_SOCKETPAIR = 360 SYS_BIND = 361 SYS_CONNECT = 362 SYS_LISTEN = 363 SYS_ACCEPT4 = 364 SYS_GETSOCKOPT = 365 SYS_SETSOCKOPT = 366 SYS_GETSOCKNAME = 367 SYS_GETPEERNAME = 368 SYS_SENDTO = 369 SYS_SENDMSG = 370 SYS_RECVFROM = 371 SYS_RECVMSG = 372 SYS_SHUTDOWN = 373 SYS_USERFAULTFD = 374 SYS_MEMBARRIER = 375 SYS_MLOCK2 = 376 SYS_COPY_FILE_RANGE = 377 SYS_PREADV2 = 378 SYS_PWRITEV2 = 379 SYS_PKEY_MPROTECT = 380 SYS_PKEY_ALLOC = 381 SYS_PKEY_FREE = 382 SYS_STATX = 383 SYS_ARCH_PRCTL = 384 SYS_IO_PGETEVENTS = 385 SYS_RSEQ = 386 SYS_SEMGET = 393 SYS_SEMCTL = 394 SYS_SHMGET = 395 SYS_SHMCTL = 396 SYS_SHMAT = 397 SYS_SHMDT = 398 SYS_MSGGET = 399 SYS_MSGSND = 400 SYS_MSGRCV = 401 SYS_MSGCTL = 402 SYS_CLOCK_GETTIME64 = 403 SYS_CLOCK_SETTIME64 = 404 SYS_CLOCK_ADJTIME64 = 405 SYS_CLOCK_GETRES_TIME64 = 406 SYS_CLOCK_NANOSLEEP_TIME64 = 407 SYS_TIMER_GETTIME64 = 408 SYS_TIMER_SETTIME64 = 409 SYS_TIMERFD_GETTIME64 = 410 SYS_TIMERFD_SETTIME64 = 411 SYS_UTIMENSAT_TIME64 = 412 SYS_PSELECT6_TIME64 = 413 SYS_PPOLL_TIME64 = 414 SYS_IO_PGETEVENTS_TIME64 = 416 SYS_RECVMMSG_TIME64 = 417 SYS_MQ_TIMEDSEND_TIME64 = 418 SYS_MQ_TIMEDRECEIVE_TIME64 = 419 SYS_SEMTIMEDOP_TIME64 = 420 SYS_RT_SIGTIMEDWAIT_TIME64 = 421 SYS_FUTEX_TIME64 = 422 SYS_SCHED_RR_GET_INTERVAL_TIME64 = 423 SYS_PIDFD_SEND_SIGNAL = 424 SYS_IO_URING_SETUP = 425 SYS_IO_URING_ENTER = 426 SYS_IO_URING_REGISTER = 427 SYS_OPEN_TREE = 428 SYS_MOVE_MOUNT = 429 SYS_FSOPEN = 430 SYS_FSCONFIG = 431 SYS_FSMOUNT = 432 SYS_FSPICK = 433 SYS_PIDFD_OPEN = 434 SYS_CLONE3 = 435 SYS_CLOSE_RANGE = 436 SYS_OPENAT2 = 437 SYS_PIDFD_GETFD = 438 SYS_FACCESSAT2 = 439 SYS_PROCESS_MADVISE = 440 SYS_EPOLL_PWAIT2 = 441 SYS_MOUNT_SETATTR = 442 SYS_QUOTACTL_FD = 443 SYS_LANDLOCK_CREATE_RULESET = 444 SYS_LANDLOCK_ADD_RULE = 445 SYS_LANDLOCK_RESTRICT_SELF = 446 SYS_MEMFD_SECRET = 447 SYS_PROCESS_MRELEASE = 448 SYS_FUTEX_WAITV = 449 SYS_SET_MEMPOLICY_HOME_NODE = 450 SYS_CACHESTAT = 451 SYS_FCHMODAT2 = 452 SYS_MAP_SHADOW_STACK = 453 SYS_FUTEX_WAKE = 454 SYS_FUTEX_WAIT = 455 SYS_FUTEX_REQUEUE = 456 SYS_STATMOUNT = 457 SYS_LISTMOUNT = 458 SYS_LSM_GET_SELF_ATTR = 459 SYS_LSM_SET_SELF_ATTR = 460 SYS_LSM_LIST_MODULES = 461 SYS_MSEAL = 462 SYS_SETXATTRAT = 463 SYS_GETXATTRAT = 464 SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 SYS_OPEN_TREE_ATTR = 467 ) ================================================ FILE: vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go ================================================ // go run linux/mksysnum.go -Wall -Werror -static -I/tmp/amd64/include -m64 /tmp/amd64/include/asm/unistd.h // Code generated by the command above; see README.md. DO NOT EDIT. //go:build amd64 && linux package unix const ( SYS_READ = 0 SYS_WRITE = 1 SYS_OPEN = 2 SYS_CLOSE = 3 SYS_STAT = 4 SYS_FSTAT = 5 SYS_LSTAT = 6 SYS_POLL = 7 SYS_LSEEK = 8 SYS_MMAP = 9 SYS_MPROTECT = 10 SYS_MUNMAP = 11 SYS_BRK = 12 SYS_RT_SIGACTION = 13 SYS_RT_SIGPROCMASK = 14 SYS_RT_SIGRETURN = 15 SYS_IOCTL = 16 SYS_PREAD64 = 17 SYS_PWRITE64 = 18 SYS_READV = 19 SYS_WRITEV = 20 SYS_ACCESS = 21 SYS_PIPE = 22 SYS_SELECT = 23 SYS_SCHED_YIELD = 24 SYS_MREMAP = 25 SYS_MSYNC = 26 SYS_MINCORE = 27 SYS_MADVISE = 28 SYS_SHMGET = 29 SYS_SHMAT = 30 SYS_SHMCTL = 31 SYS_DUP = 32 SYS_DUP2 = 33 SYS_PAUSE = 34 SYS_NANOSLEEP = 35 SYS_GETITIMER = 36 SYS_ALARM = 37 SYS_SETITIMER = 38 SYS_GETPID = 39 SYS_SENDFILE = 40 SYS_SOCKET = 41 SYS_CONNECT = 42 SYS_ACCEPT = 43 SYS_SENDTO = 44 SYS_RECVFROM = 45 SYS_SENDMSG = 46 SYS_RECVMSG = 47 SYS_SHUTDOWN = 48 SYS_BIND = 49 SYS_LISTEN = 50 SYS_GETSOCKNAME = 51 SYS_GETPEERNAME = 52 SYS_SOCKETPAIR = 53 SYS_SETSOCKOPT = 54 SYS_GETSOCKOPT = 55 SYS_CLONE = 56 SYS_FORK = 57 SYS_VFORK = 58 SYS_EXECVE = 59 SYS_EXIT = 60 SYS_WAIT4 = 61 SYS_KILL = 62 SYS_UNAME = 63 SYS_SEMGET = 64 SYS_SEMOP = 65 SYS_SEMCTL = 66 SYS_SHMDT = 67 SYS_MSGGET = 68 SYS_MSGSND = 69 SYS_MSGRCV = 70 SYS_MSGCTL = 71 SYS_FCNTL = 72 SYS_FLOCK = 73 SYS_FSYNC = 74 SYS_FDATASYNC = 75 SYS_TRUNCATE = 76 SYS_FTRUNCATE = 77 SYS_GETDENTS = 78 SYS_GETCWD = 79 SYS_CHDIR = 80 SYS_FCHDIR = 81 SYS_RENAME = 82 SYS_MKDIR = 83 SYS_RMDIR = 84 SYS_CREAT = 85 SYS_LINK = 86 SYS_UNLINK = 87 SYS_SYMLINK = 88 SYS_READLINK = 89 SYS_CHMOD = 90 SYS_FCHMOD = 91 SYS_CHOWN = 92 SYS_FCHOWN = 93 SYS_LCHOWN = 94 SYS_UMASK = 95 SYS_GETTIMEOFDAY = 96 SYS_GETRLIMIT = 97 SYS_GETRUSAGE = 98 SYS_SYSINFO = 99 SYS_TIMES = 100 SYS_PTRACE = 101 SYS_GETUID = 102 SYS_SYSLOG = 103 SYS_GETGID = 104 SYS_SETUID = 105 SYS_SETGID = 106 SYS_GETEUID = 107 SYS_GETEGID = 108 SYS_SETPGID = 109 SYS_GETPPID = 110 SYS_GETPGRP = 111 SYS_SETSID = 112 SYS_SETREUID = 113 SYS_SETREGID = 114 SYS_GETGROUPS = 115 SYS_SETGROUPS = 116 SYS_SETRESUID = 117 SYS_GETRESUID = 118 SYS_SETRESGID = 119 SYS_GETRESGID = 120 SYS_GETPGID = 121 SYS_SETFSUID = 122 SYS_SETFSGID = 123 SYS_GETSID = 124 SYS_CAPGET = 125 SYS_CAPSET = 126 SYS_RT_SIGPENDING = 127 SYS_RT_SIGTIMEDWAIT = 128 SYS_RT_SIGQUEUEINFO = 129 SYS_RT_SIGSUSPEND = 130 SYS_SIGALTSTACK = 131 SYS_UTIME = 132 SYS_MKNOD = 133 SYS_USELIB = 134 SYS_PERSONALITY = 135 SYS_USTAT = 136 SYS_STATFS = 137 SYS_FSTATFS = 138 SYS_SYSFS = 139 SYS_GETPRIORITY = 140 SYS_SETPRIORITY = 141 SYS_SCHED_SETPARAM = 142 SYS_SCHED_GETPARAM = 143 SYS_SCHED_SETSCHEDULER = 144 SYS_SCHED_GETSCHEDULER = 145 SYS_SCHED_GET_PRIORITY_MAX = 146 SYS_SCHED_GET_PRIORITY_MIN = 147 SYS_SCHED_RR_GET_INTERVAL = 148 SYS_MLOCK = 149 SYS_MUNLOCK = 150 SYS_MLOCKALL = 151 SYS_MUNLOCKALL = 152 SYS_VHANGUP = 153 SYS_MODIFY_LDT = 154 SYS_PIVOT_ROOT = 155 SYS__SYSCTL = 156 SYS_PRCTL = 157 SYS_ARCH_PRCTL = 158 SYS_ADJTIMEX = 159 SYS_SETRLIMIT = 160 SYS_CHROOT = 161 SYS_SYNC = 162 SYS_ACCT = 163 SYS_SETTIMEOFDAY = 164 SYS_MOUNT = 165 SYS_UMOUNT2 = 166 SYS_SWAPON = 167 SYS_SWAPOFF = 168 SYS_REBOOT = 169 SYS_SETHOSTNAME = 170 SYS_SETDOMAINNAME = 171 SYS_IOPL = 172 SYS_IOPERM = 173 SYS_CREATE_MODULE = 174 SYS_INIT_MODULE = 175 SYS_DELETE_MODULE = 176 SYS_GET_KERNEL_SYMS = 177 SYS_QUERY_MODULE = 178 SYS_QUOTACTL = 179 SYS_NFSSERVCTL = 180 SYS_GETPMSG = 181 SYS_PUTPMSG = 182 SYS_AFS_SYSCALL = 183 SYS_TUXCALL = 184 SYS_SECURITY = 185 SYS_GETTID = 186 SYS_READAHEAD = 187 SYS_SETXATTR = 188 SYS_LSETXATTR = 189 SYS_FSETXATTR = 190 SYS_GETXATTR = 191 SYS_LGETXATTR = 192 SYS_FGETXATTR = 193 SYS_LISTXATTR = 194 SYS_LLISTXATTR = 195 SYS_FLISTXATTR = 196 SYS_REMOVEXATTR = 197 SYS_LREMOVEXATTR = 198 SYS_FREMOVEXATTR = 199 SYS_TKILL = 200 SYS_TIME = 201 SYS_FUTEX = 202 SYS_SCHED_SETAFFINITY = 203 SYS_SCHED_GETAFFINITY = 204 SYS_SET_THREAD_AREA = 205 SYS_IO_SETUP = 206 SYS_IO_DESTROY = 207 SYS_IO_GETEVENTS = 208 SYS_IO_SUBMIT = 209 SYS_IO_CANCEL = 210 SYS_GET_THREAD_AREA = 211 SYS_LOOKUP_DCOOKIE = 212 SYS_EPOLL_CREATE = 213 SYS_EPOLL_CTL_OLD = 214 SYS_EPOLL_WAIT_OLD = 215 SYS_REMAP_FILE_PAGES = 216 SYS_GETDENTS64 = 217 SYS_SET_TID_ADDRESS = 218 SYS_RESTART_SYSCALL = 219 SYS_SEMTIMEDOP = 220 SYS_FADVISE64 = 221 SYS_TIMER_CREATE = 222 SYS_TIMER_SETTIME = 223 SYS_TIMER_GETTIME = 224 SYS_TIMER_GETOVERRUN = 225 SYS_TIMER_DELETE = 226 SYS_CLOCK_SETTIME = 227 SYS_CLOCK_GETTIME = 228 SYS_CLOCK_GETRES = 229 SYS_CLOCK_NANOSLEEP = 230 SYS_EXIT_GROUP = 231 SYS_EPOLL_WAIT = 232 SYS_EPOLL_CTL = 233 SYS_TGKILL = 234 SYS_UTIMES = 235 SYS_VSERVER = 236 SYS_MBIND = 237 SYS_SET_MEMPOLICY = 238 SYS_GET_MEMPOLICY = 239 SYS_MQ_OPEN = 240 SYS_MQ_UNLINK = 241 SYS_MQ_TIMEDSEND = 242 SYS_MQ_TIMEDRECEIVE = 243 SYS_MQ_NOTIFY = 244 SYS_MQ_GETSETATTR = 245 SYS_KEXEC_LOAD = 246 SYS_WAITID = 247 SYS_ADD_KEY = 248 SYS_REQUEST_KEY = 249 SYS_KEYCTL = 250 SYS_IOPRIO_SET = 251 SYS_IOPRIO_GET = 252 SYS_INOTIFY_INIT = 253 SYS_INOTIFY_ADD_WATCH = 254 SYS_INOTIFY_RM_WATCH = 255 SYS_MIGRATE_PAGES = 256 SYS_OPENAT = 257 SYS_MKDIRAT = 258 SYS_MKNODAT = 259 SYS_FCHOWNAT = 260 SYS_FUTIMESAT = 261 SYS_NEWFSTATAT = 262 SYS_UNLINKAT = 263 SYS_RENAMEAT = 264 SYS_LINKAT = 265 SYS_SYMLINKAT = 266 SYS_READLINKAT = 267 SYS_FCHMODAT = 268 SYS_FACCESSAT = 269 SYS_PSELECT6 = 270 SYS_PPOLL = 271 SYS_UNSHARE = 272 SYS_SET_ROBUST_LIST = 273 SYS_GET_ROBUST_LIST = 274 SYS_SPLICE = 275 SYS_TEE = 276 SYS_SYNC_FILE_RANGE = 277 SYS_VMSPLICE = 278 SYS_MOVE_PAGES = 279 SYS_UTIMENSAT = 280 SYS_EPOLL_PWAIT = 281 SYS_SIGNALFD = 282 SYS_TIMERFD_CREATE = 283 SYS_EVENTFD = 284 SYS_FALLOCATE = 285 SYS_TIMERFD_SETTIME = 286 SYS_TIMERFD_GETTIME = 287 SYS_ACCEPT4 = 288 SYS_SIGNALFD4 = 289 SYS_EVENTFD2 = 290 SYS_EPOLL_CREATE1 = 291 SYS_DUP3 = 292 SYS_PIPE2 = 293 SYS_INOTIFY_INIT1 = 294 SYS_PREADV = 295 SYS_PWRITEV = 296 SYS_RT_TGSIGQUEUEINFO = 297 SYS_PERF_EVENT_OPEN = 298 SYS_RECVMMSG = 299 SYS_FANOTIFY_INIT = 300 SYS_FANOTIFY_MARK = 301 SYS_PRLIMIT64 = 302 SYS_NAME_TO_HANDLE_AT = 303 SYS_OPEN_BY_HANDLE_AT = 304 SYS_CLOCK_ADJTIME = 305 SYS_SYNCFS = 306 SYS_SENDMMSG = 307 SYS_SETNS = 308 SYS_GETCPU = 309 SYS_PROCESS_VM_READV = 310 SYS_PROCESS_VM_WRITEV = 311 SYS_KCMP = 312 SYS_FINIT_MODULE = 313 SYS_SCHED_SETATTR = 314 SYS_SCHED_GETATTR = 315 SYS_RENAMEAT2 = 316 SYS_SECCOMP = 317 SYS_GETRANDOM = 318 SYS_MEMFD_CREATE = 319 SYS_KEXEC_FILE_LOAD = 320 SYS_BPF = 321 SYS_EXECVEAT = 322 SYS_USERFAULTFD = 323 SYS_MEMBARRIER = 324 SYS_MLOCK2 = 325 SYS_COPY_FILE_RANGE = 326 SYS_PREADV2 = 327 SYS_PWRITEV2 = 328 SYS_PKEY_MPROTECT = 329 SYS_PKEY_ALLOC = 330 SYS_PKEY_FREE = 331 SYS_STATX = 332 SYS_IO_PGETEVENTS = 333 SYS_RSEQ = 334 SYS_URETPROBE = 335 SYS_PIDFD_SEND_SIGNAL = 424 SYS_IO_URING_SETUP = 425 SYS_IO_URING_ENTER = 426 SYS_IO_URING_REGISTER = 427 SYS_OPEN_TREE = 428 SYS_MOVE_MOUNT = 429 SYS_FSOPEN = 430 SYS_FSCONFIG = 431 SYS_FSMOUNT = 432 SYS_FSPICK = 433 SYS_PIDFD_OPEN = 434 SYS_CLONE3 = 435 SYS_CLOSE_RANGE = 436 SYS_OPENAT2 = 437 SYS_PIDFD_GETFD = 438 SYS_FACCESSAT2 = 439 SYS_PROCESS_MADVISE = 440 SYS_EPOLL_PWAIT2 = 441 SYS_MOUNT_SETATTR = 442 SYS_QUOTACTL_FD = 443 SYS_LANDLOCK_CREATE_RULESET = 444 SYS_LANDLOCK_ADD_RULE = 445 SYS_LANDLOCK_RESTRICT_SELF = 446 SYS_MEMFD_SECRET = 447 SYS_PROCESS_MRELEASE = 448 SYS_FUTEX_WAITV = 449 SYS_SET_MEMPOLICY_HOME_NODE = 450 SYS_CACHESTAT = 451 SYS_FCHMODAT2 = 452 SYS_MAP_SHADOW_STACK = 453 SYS_FUTEX_WAKE = 454 SYS_FUTEX_WAIT = 455 SYS_FUTEX_REQUEUE = 456 SYS_STATMOUNT = 457 SYS_LISTMOUNT = 458 SYS_LSM_GET_SELF_ATTR = 459 SYS_LSM_SET_SELF_ATTR = 460 SYS_LSM_LIST_MODULES = 461 SYS_MSEAL = 462 SYS_SETXATTRAT = 463 SYS_GETXATTRAT = 464 SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 SYS_OPEN_TREE_ATTR = 467 ) ================================================ FILE: vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go ================================================ // go run linux/mksysnum.go -Wall -Werror -static -I/tmp/arm/include /tmp/arm/include/asm/unistd.h // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm && linux package unix const ( SYS_SYSCALL_MASK = 0 SYS_RESTART_SYSCALL = 0 SYS_EXIT = 1 SYS_FORK = 2 SYS_READ = 3 SYS_WRITE = 4 SYS_OPEN = 5 SYS_CLOSE = 6 SYS_CREAT = 8 SYS_LINK = 9 SYS_UNLINK = 10 SYS_EXECVE = 11 SYS_CHDIR = 12 SYS_MKNOD = 14 SYS_CHMOD = 15 SYS_LCHOWN = 16 SYS_LSEEK = 19 SYS_GETPID = 20 SYS_MOUNT = 21 SYS_SETUID = 23 SYS_GETUID = 24 SYS_PTRACE = 26 SYS_PAUSE = 29 SYS_ACCESS = 33 SYS_NICE = 34 SYS_SYNC = 36 SYS_KILL = 37 SYS_RENAME = 38 SYS_MKDIR = 39 SYS_RMDIR = 40 SYS_DUP = 41 SYS_PIPE = 42 SYS_TIMES = 43 SYS_BRK = 45 SYS_SETGID = 46 SYS_GETGID = 47 SYS_GETEUID = 49 SYS_GETEGID = 50 SYS_ACCT = 51 SYS_UMOUNT2 = 52 SYS_IOCTL = 54 SYS_FCNTL = 55 SYS_SETPGID = 57 SYS_UMASK = 60 SYS_CHROOT = 61 SYS_USTAT = 62 SYS_DUP2 = 63 SYS_GETPPID = 64 SYS_GETPGRP = 65 SYS_SETSID = 66 SYS_SIGACTION = 67 SYS_SETREUID = 70 SYS_SETREGID = 71 SYS_SIGSUSPEND = 72 SYS_SIGPENDING = 73 SYS_SETHOSTNAME = 74 SYS_SETRLIMIT = 75 SYS_GETRUSAGE = 77 SYS_GETTIMEOFDAY = 78 SYS_SETTIMEOFDAY = 79 SYS_GETGROUPS = 80 SYS_SETGROUPS = 81 SYS_SYMLINK = 83 SYS_READLINK = 85 SYS_USELIB = 86 SYS_SWAPON = 87 SYS_REBOOT = 88 SYS_MUNMAP = 91 SYS_TRUNCATE = 92 SYS_FTRUNCATE = 93 SYS_FCHMOD = 94 SYS_FCHOWN = 95 SYS_GETPRIORITY = 96 SYS_SETPRIORITY = 97 SYS_STATFS = 99 SYS_FSTATFS = 100 SYS_SYSLOG = 103 SYS_SETITIMER = 104 SYS_GETITIMER = 105 SYS_STAT = 106 SYS_LSTAT = 107 SYS_FSTAT = 108 SYS_VHANGUP = 111 SYS_WAIT4 = 114 SYS_SWAPOFF = 115 SYS_SYSINFO = 116 SYS_FSYNC = 118 SYS_SIGRETURN = 119 SYS_CLONE = 120 SYS_SETDOMAINNAME = 121 SYS_UNAME = 122 SYS_ADJTIMEX = 124 SYS_MPROTECT = 125 SYS_SIGPROCMASK = 126 SYS_INIT_MODULE = 128 SYS_DELETE_MODULE = 129 SYS_QUOTACTL = 131 SYS_GETPGID = 132 SYS_FCHDIR = 133 SYS_BDFLUSH = 134 SYS_SYSFS = 135 SYS_PERSONALITY = 136 SYS_SETFSUID = 138 SYS_SETFSGID = 139 SYS__LLSEEK = 140 SYS_GETDENTS = 141 SYS__NEWSELECT = 142 SYS_FLOCK = 143 SYS_MSYNC = 144 SYS_READV = 145 SYS_WRITEV = 146 SYS_GETSID = 147 SYS_FDATASYNC = 148 SYS__SYSCTL = 149 SYS_MLOCK = 150 SYS_MUNLOCK = 151 SYS_MLOCKALL = 152 SYS_MUNLOCKALL = 153 SYS_SCHED_SETPARAM = 154 SYS_SCHED_GETPARAM = 155 SYS_SCHED_SETSCHEDULER = 156 SYS_SCHED_GETSCHEDULER = 157 SYS_SCHED_YIELD = 158 SYS_SCHED_GET_PRIORITY_MAX = 159 SYS_SCHED_GET_PRIORITY_MIN = 160 SYS_SCHED_RR_GET_INTERVAL = 161 SYS_NANOSLEEP = 162 SYS_MREMAP = 163 SYS_SETRESUID = 164 SYS_GETRESUID = 165 SYS_POLL = 168 SYS_NFSSERVCTL = 169 SYS_SETRESGID = 170 SYS_GETRESGID = 171 SYS_PRCTL = 172 SYS_RT_SIGRETURN = 173 SYS_RT_SIGACTION = 174 SYS_RT_SIGPROCMASK = 175 SYS_RT_SIGPENDING = 176 SYS_RT_SIGTIMEDWAIT = 177 SYS_RT_SIGQUEUEINFO = 178 SYS_RT_SIGSUSPEND = 179 SYS_PREAD64 = 180 SYS_PWRITE64 = 181 SYS_CHOWN = 182 SYS_GETCWD = 183 SYS_CAPGET = 184 SYS_CAPSET = 185 SYS_SIGALTSTACK = 186 SYS_SENDFILE = 187 SYS_VFORK = 190 SYS_UGETRLIMIT = 191 SYS_MMAP2 = 192 SYS_TRUNCATE64 = 193 SYS_FTRUNCATE64 = 194 SYS_STAT64 = 195 SYS_LSTAT64 = 196 SYS_FSTAT64 = 197 SYS_LCHOWN32 = 198 SYS_GETUID32 = 199 SYS_GETGID32 = 200 SYS_GETEUID32 = 201 SYS_GETEGID32 = 202 SYS_SETREUID32 = 203 SYS_SETREGID32 = 204 SYS_GETGROUPS32 = 205 SYS_SETGROUPS32 = 206 SYS_FCHOWN32 = 207 SYS_SETRESUID32 = 208 SYS_GETRESUID32 = 209 SYS_SETRESGID32 = 210 SYS_GETRESGID32 = 211 SYS_CHOWN32 = 212 SYS_SETUID32 = 213 SYS_SETGID32 = 214 SYS_SETFSUID32 = 215 SYS_SETFSGID32 = 216 SYS_GETDENTS64 = 217 SYS_PIVOT_ROOT = 218 SYS_MINCORE = 219 SYS_MADVISE = 220 SYS_FCNTL64 = 221 SYS_GETTID = 224 SYS_READAHEAD = 225 SYS_SETXATTR = 226 SYS_LSETXATTR = 227 SYS_FSETXATTR = 228 SYS_GETXATTR = 229 SYS_LGETXATTR = 230 SYS_FGETXATTR = 231 SYS_LISTXATTR = 232 SYS_LLISTXATTR = 233 SYS_FLISTXATTR = 234 SYS_REMOVEXATTR = 235 SYS_LREMOVEXATTR = 236 SYS_FREMOVEXATTR = 237 SYS_TKILL = 238 SYS_SENDFILE64 = 239 SYS_FUTEX = 240 SYS_SCHED_SETAFFINITY = 241 SYS_SCHED_GETAFFINITY = 242 SYS_IO_SETUP = 243 SYS_IO_DESTROY = 244 SYS_IO_GETEVENTS = 245 SYS_IO_SUBMIT = 246 SYS_IO_CANCEL = 247 SYS_EXIT_GROUP = 248 SYS_LOOKUP_DCOOKIE = 249 SYS_EPOLL_CREATE = 250 SYS_EPOLL_CTL = 251 SYS_EPOLL_WAIT = 252 SYS_REMAP_FILE_PAGES = 253 SYS_SET_TID_ADDRESS = 256 SYS_TIMER_CREATE = 257 SYS_TIMER_SETTIME = 258 SYS_TIMER_GETTIME = 259 SYS_TIMER_GETOVERRUN = 260 SYS_TIMER_DELETE = 261 SYS_CLOCK_SETTIME = 262 SYS_CLOCK_GETTIME = 263 SYS_CLOCK_GETRES = 264 SYS_CLOCK_NANOSLEEP = 265 SYS_STATFS64 = 266 SYS_FSTATFS64 = 267 SYS_TGKILL = 268 SYS_UTIMES = 269 SYS_ARM_FADVISE64_64 = 270 SYS_PCICONFIG_IOBASE = 271 SYS_PCICONFIG_READ = 272 SYS_PCICONFIG_WRITE = 273 SYS_MQ_OPEN = 274 SYS_MQ_UNLINK = 275 SYS_MQ_TIMEDSEND = 276 SYS_MQ_TIMEDRECEIVE = 277 SYS_MQ_NOTIFY = 278 SYS_MQ_GETSETATTR = 279 SYS_WAITID = 280 SYS_SOCKET = 281 SYS_BIND = 282 SYS_CONNECT = 283 SYS_LISTEN = 284 SYS_ACCEPT = 285 SYS_GETSOCKNAME = 286 SYS_GETPEERNAME = 287 SYS_SOCKETPAIR = 288 SYS_SEND = 289 SYS_SENDTO = 290 SYS_RECV = 291 SYS_RECVFROM = 292 SYS_SHUTDOWN = 293 SYS_SETSOCKOPT = 294 SYS_GETSOCKOPT = 295 SYS_SENDMSG = 296 SYS_RECVMSG = 297 SYS_SEMOP = 298 SYS_SEMGET = 299 SYS_SEMCTL = 300 SYS_MSGSND = 301 SYS_MSGRCV = 302 SYS_MSGGET = 303 SYS_MSGCTL = 304 SYS_SHMAT = 305 SYS_SHMDT = 306 SYS_SHMGET = 307 SYS_SHMCTL = 308 SYS_ADD_KEY = 309 SYS_REQUEST_KEY = 310 SYS_KEYCTL = 311 SYS_SEMTIMEDOP = 312 SYS_VSERVER = 313 SYS_IOPRIO_SET = 314 SYS_IOPRIO_GET = 315 SYS_INOTIFY_INIT = 316 SYS_INOTIFY_ADD_WATCH = 317 SYS_INOTIFY_RM_WATCH = 318 SYS_MBIND = 319 SYS_GET_MEMPOLICY = 320 SYS_SET_MEMPOLICY = 321 SYS_OPENAT = 322 SYS_MKDIRAT = 323 SYS_MKNODAT = 324 SYS_FCHOWNAT = 325 SYS_FUTIMESAT = 326 SYS_FSTATAT64 = 327 SYS_UNLINKAT = 328 SYS_RENAMEAT = 329 SYS_LINKAT = 330 SYS_SYMLINKAT = 331 SYS_READLINKAT = 332 SYS_FCHMODAT = 333 SYS_FACCESSAT = 334 SYS_PSELECT6 = 335 SYS_PPOLL = 336 SYS_UNSHARE = 337 SYS_SET_ROBUST_LIST = 338 SYS_GET_ROBUST_LIST = 339 SYS_SPLICE = 340 SYS_ARM_SYNC_FILE_RANGE = 341 SYS_TEE = 342 SYS_VMSPLICE = 343 SYS_MOVE_PAGES = 344 SYS_GETCPU = 345 SYS_EPOLL_PWAIT = 346 SYS_KEXEC_LOAD = 347 SYS_UTIMENSAT = 348 SYS_SIGNALFD = 349 SYS_TIMERFD_CREATE = 350 SYS_EVENTFD = 351 SYS_FALLOCATE = 352 SYS_TIMERFD_SETTIME = 353 SYS_TIMERFD_GETTIME = 354 SYS_SIGNALFD4 = 355 SYS_EVENTFD2 = 356 SYS_EPOLL_CREATE1 = 357 SYS_DUP3 = 358 SYS_PIPE2 = 359 SYS_INOTIFY_INIT1 = 360 SYS_PREADV = 361 SYS_PWRITEV = 362 SYS_RT_TGSIGQUEUEINFO = 363 SYS_PERF_EVENT_OPEN = 364 SYS_RECVMMSG = 365 SYS_ACCEPT4 = 366 SYS_FANOTIFY_INIT = 367 SYS_FANOTIFY_MARK = 368 SYS_PRLIMIT64 = 369 SYS_NAME_TO_HANDLE_AT = 370 SYS_OPEN_BY_HANDLE_AT = 371 SYS_CLOCK_ADJTIME = 372 SYS_SYNCFS = 373 SYS_SENDMMSG = 374 SYS_SETNS = 375 SYS_PROCESS_VM_READV = 376 SYS_PROCESS_VM_WRITEV = 377 SYS_KCMP = 378 SYS_FINIT_MODULE = 379 SYS_SCHED_SETATTR = 380 SYS_SCHED_GETATTR = 381 SYS_RENAMEAT2 = 382 SYS_SECCOMP = 383 SYS_GETRANDOM = 384 SYS_MEMFD_CREATE = 385 SYS_BPF = 386 SYS_EXECVEAT = 387 SYS_USERFAULTFD = 388 SYS_MEMBARRIER = 389 SYS_MLOCK2 = 390 SYS_COPY_FILE_RANGE = 391 SYS_PREADV2 = 392 SYS_PWRITEV2 = 393 SYS_PKEY_MPROTECT = 394 SYS_PKEY_ALLOC = 395 SYS_PKEY_FREE = 396 SYS_STATX = 397 SYS_RSEQ = 398 SYS_IO_PGETEVENTS = 399 SYS_MIGRATE_PAGES = 400 SYS_KEXEC_FILE_LOAD = 401 SYS_CLOCK_GETTIME64 = 403 SYS_CLOCK_SETTIME64 = 404 SYS_CLOCK_ADJTIME64 = 405 SYS_CLOCK_GETRES_TIME64 = 406 SYS_CLOCK_NANOSLEEP_TIME64 = 407 SYS_TIMER_GETTIME64 = 408 SYS_TIMER_SETTIME64 = 409 SYS_TIMERFD_GETTIME64 = 410 SYS_TIMERFD_SETTIME64 = 411 SYS_UTIMENSAT_TIME64 = 412 SYS_PSELECT6_TIME64 = 413 SYS_PPOLL_TIME64 = 414 SYS_IO_PGETEVENTS_TIME64 = 416 SYS_RECVMMSG_TIME64 = 417 SYS_MQ_TIMEDSEND_TIME64 = 418 SYS_MQ_TIMEDRECEIVE_TIME64 = 419 SYS_SEMTIMEDOP_TIME64 = 420 SYS_RT_SIGTIMEDWAIT_TIME64 = 421 SYS_FUTEX_TIME64 = 422 SYS_SCHED_RR_GET_INTERVAL_TIME64 = 423 SYS_PIDFD_SEND_SIGNAL = 424 SYS_IO_URING_SETUP = 425 SYS_IO_URING_ENTER = 426 SYS_IO_URING_REGISTER = 427 SYS_OPEN_TREE = 428 SYS_MOVE_MOUNT = 429 SYS_FSOPEN = 430 SYS_FSCONFIG = 431 SYS_FSMOUNT = 432 SYS_FSPICK = 433 SYS_PIDFD_OPEN = 434 SYS_CLONE3 = 435 SYS_CLOSE_RANGE = 436 SYS_OPENAT2 = 437 SYS_PIDFD_GETFD = 438 SYS_FACCESSAT2 = 439 SYS_PROCESS_MADVISE = 440 SYS_EPOLL_PWAIT2 = 441 SYS_MOUNT_SETATTR = 442 SYS_QUOTACTL_FD = 443 SYS_LANDLOCK_CREATE_RULESET = 444 SYS_LANDLOCK_ADD_RULE = 445 SYS_LANDLOCK_RESTRICT_SELF = 446 SYS_PROCESS_MRELEASE = 448 SYS_FUTEX_WAITV = 449 SYS_SET_MEMPOLICY_HOME_NODE = 450 SYS_CACHESTAT = 451 SYS_FCHMODAT2 = 452 SYS_MAP_SHADOW_STACK = 453 SYS_FUTEX_WAKE = 454 SYS_FUTEX_WAIT = 455 SYS_FUTEX_REQUEUE = 456 SYS_STATMOUNT = 457 SYS_LISTMOUNT = 458 SYS_LSM_GET_SELF_ATTR = 459 SYS_LSM_SET_SELF_ATTR = 460 SYS_LSM_LIST_MODULES = 461 SYS_MSEAL = 462 SYS_SETXATTRAT = 463 SYS_GETXATTRAT = 464 SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 SYS_OPEN_TREE_ATTR = 467 ) ================================================ FILE: vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go ================================================ // go run linux/mksysnum.go -Wall -Werror -static -I/tmp/arm64/include -fsigned-char /tmp/arm64/include/asm/unistd.h // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm64 && linux package unix const ( SYS_IO_SETUP = 0 SYS_IO_DESTROY = 1 SYS_IO_SUBMIT = 2 SYS_IO_CANCEL = 3 SYS_IO_GETEVENTS = 4 SYS_SETXATTR = 5 SYS_LSETXATTR = 6 SYS_FSETXATTR = 7 SYS_GETXATTR = 8 SYS_LGETXATTR = 9 SYS_FGETXATTR = 10 SYS_LISTXATTR = 11 SYS_LLISTXATTR = 12 SYS_FLISTXATTR = 13 SYS_REMOVEXATTR = 14 SYS_LREMOVEXATTR = 15 SYS_FREMOVEXATTR = 16 SYS_GETCWD = 17 SYS_LOOKUP_DCOOKIE = 18 SYS_EVENTFD2 = 19 SYS_EPOLL_CREATE1 = 20 SYS_EPOLL_CTL = 21 SYS_EPOLL_PWAIT = 22 SYS_DUP = 23 SYS_DUP3 = 24 SYS_FCNTL = 25 SYS_INOTIFY_INIT1 = 26 SYS_INOTIFY_ADD_WATCH = 27 SYS_INOTIFY_RM_WATCH = 28 SYS_IOCTL = 29 SYS_IOPRIO_SET = 30 SYS_IOPRIO_GET = 31 SYS_FLOCK = 32 SYS_MKNODAT = 33 SYS_MKDIRAT = 34 SYS_UNLINKAT = 35 SYS_SYMLINKAT = 36 SYS_LINKAT = 37 SYS_RENAMEAT = 38 SYS_UMOUNT2 = 39 SYS_MOUNT = 40 SYS_PIVOT_ROOT = 41 SYS_NFSSERVCTL = 42 SYS_STATFS = 43 SYS_FSTATFS = 44 SYS_TRUNCATE = 45 SYS_FTRUNCATE = 46 SYS_FALLOCATE = 47 SYS_FACCESSAT = 48 SYS_CHDIR = 49 SYS_FCHDIR = 50 SYS_CHROOT = 51 SYS_FCHMOD = 52 SYS_FCHMODAT = 53 SYS_FCHOWNAT = 54 SYS_FCHOWN = 55 SYS_OPENAT = 56 SYS_CLOSE = 57 SYS_VHANGUP = 58 SYS_PIPE2 = 59 SYS_QUOTACTL = 60 SYS_GETDENTS64 = 61 SYS_LSEEK = 62 SYS_READ = 63 SYS_WRITE = 64 SYS_READV = 65 SYS_WRITEV = 66 SYS_PREAD64 = 67 SYS_PWRITE64 = 68 SYS_PREADV = 69 SYS_PWRITEV = 70 SYS_SENDFILE = 71 SYS_PSELECT6 = 72 SYS_PPOLL = 73 SYS_SIGNALFD4 = 74 SYS_VMSPLICE = 75 SYS_SPLICE = 76 SYS_TEE = 77 SYS_READLINKAT = 78 SYS_NEWFSTATAT = 79 SYS_FSTAT = 80 SYS_SYNC = 81 SYS_FSYNC = 82 SYS_FDATASYNC = 83 SYS_SYNC_FILE_RANGE = 84 SYS_TIMERFD_CREATE = 85 SYS_TIMERFD_SETTIME = 86 SYS_TIMERFD_GETTIME = 87 SYS_UTIMENSAT = 88 SYS_ACCT = 89 SYS_CAPGET = 90 SYS_CAPSET = 91 SYS_PERSONALITY = 92 SYS_EXIT = 93 SYS_EXIT_GROUP = 94 SYS_WAITID = 95 SYS_SET_TID_ADDRESS = 96 SYS_UNSHARE = 97 SYS_FUTEX = 98 SYS_SET_ROBUST_LIST = 99 SYS_GET_ROBUST_LIST = 100 SYS_NANOSLEEP = 101 SYS_GETITIMER = 102 SYS_SETITIMER = 103 SYS_KEXEC_LOAD = 104 SYS_INIT_MODULE = 105 SYS_DELETE_MODULE = 106 SYS_TIMER_CREATE = 107 SYS_TIMER_GETTIME = 108 SYS_TIMER_GETOVERRUN = 109 SYS_TIMER_SETTIME = 110 SYS_TIMER_DELETE = 111 SYS_CLOCK_SETTIME = 112 SYS_CLOCK_GETTIME = 113 SYS_CLOCK_GETRES = 114 SYS_CLOCK_NANOSLEEP = 115 SYS_SYSLOG = 116 SYS_PTRACE = 117 SYS_SCHED_SETPARAM = 118 SYS_SCHED_SETSCHEDULER = 119 SYS_SCHED_GETSCHEDULER = 120 SYS_SCHED_GETPARAM = 121 SYS_SCHED_SETAFFINITY = 122 SYS_SCHED_GETAFFINITY = 123 SYS_SCHED_YIELD = 124 SYS_SCHED_GET_PRIORITY_MAX = 125 SYS_SCHED_GET_PRIORITY_MIN = 126 SYS_SCHED_RR_GET_INTERVAL = 127 SYS_RESTART_SYSCALL = 128 SYS_KILL = 129 SYS_TKILL = 130 SYS_TGKILL = 131 SYS_SIGALTSTACK = 132 SYS_RT_SIGSUSPEND = 133 SYS_RT_SIGACTION = 134 SYS_RT_SIGPROCMASK = 135 SYS_RT_SIGPENDING = 136 SYS_RT_SIGTIMEDWAIT = 137 SYS_RT_SIGQUEUEINFO = 138 SYS_RT_SIGRETURN = 139 SYS_SETPRIORITY = 140 SYS_GETPRIORITY = 141 SYS_REBOOT = 142 SYS_SETREGID = 143 SYS_SETGID = 144 SYS_SETREUID = 145 SYS_SETUID = 146 SYS_SETRESUID = 147 SYS_GETRESUID = 148 SYS_SETRESGID = 149 SYS_GETRESGID = 150 SYS_SETFSUID = 151 SYS_SETFSGID = 152 SYS_TIMES = 153 SYS_SETPGID = 154 SYS_GETPGID = 155 SYS_GETSID = 156 SYS_SETSID = 157 SYS_GETGROUPS = 158 SYS_SETGROUPS = 159 SYS_UNAME = 160 SYS_SETHOSTNAME = 161 SYS_SETDOMAINNAME = 162 SYS_GETRLIMIT = 163 SYS_SETRLIMIT = 164 SYS_GETRUSAGE = 165 SYS_UMASK = 166 SYS_PRCTL = 167 SYS_GETCPU = 168 SYS_GETTIMEOFDAY = 169 SYS_SETTIMEOFDAY = 170 SYS_ADJTIMEX = 171 SYS_GETPID = 172 SYS_GETPPID = 173 SYS_GETUID = 174 SYS_GETEUID = 175 SYS_GETGID = 176 SYS_GETEGID = 177 SYS_GETTID = 178 SYS_SYSINFO = 179 SYS_MQ_OPEN = 180 SYS_MQ_UNLINK = 181 SYS_MQ_TIMEDSEND = 182 SYS_MQ_TIMEDRECEIVE = 183 SYS_MQ_NOTIFY = 184 SYS_MQ_GETSETATTR = 185 SYS_MSGGET = 186 SYS_MSGCTL = 187 SYS_MSGRCV = 188 SYS_MSGSND = 189 SYS_SEMGET = 190 SYS_SEMCTL = 191 SYS_SEMTIMEDOP = 192 SYS_SEMOP = 193 SYS_SHMGET = 194 SYS_SHMCTL = 195 SYS_SHMAT = 196 SYS_SHMDT = 197 SYS_SOCKET = 198 SYS_SOCKETPAIR = 199 SYS_BIND = 200 SYS_LISTEN = 201 SYS_ACCEPT = 202 SYS_CONNECT = 203 SYS_GETSOCKNAME = 204 SYS_GETPEERNAME = 205 SYS_SENDTO = 206 SYS_RECVFROM = 207 SYS_SETSOCKOPT = 208 SYS_GETSOCKOPT = 209 SYS_SHUTDOWN = 210 SYS_SENDMSG = 211 SYS_RECVMSG = 212 SYS_READAHEAD = 213 SYS_BRK = 214 SYS_MUNMAP = 215 SYS_MREMAP = 216 SYS_ADD_KEY = 217 SYS_REQUEST_KEY = 218 SYS_KEYCTL = 219 SYS_CLONE = 220 SYS_EXECVE = 221 SYS_MMAP = 222 SYS_FADVISE64 = 223 SYS_SWAPON = 224 SYS_SWAPOFF = 225 SYS_MPROTECT = 226 SYS_MSYNC = 227 SYS_MLOCK = 228 SYS_MUNLOCK = 229 SYS_MLOCKALL = 230 SYS_MUNLOCKALL = 231 SYS_MINCORE = 232 SYS_MADVISE = 233 SYS_REMAP_FILE_PAGES = 234 SYS_MBIND = 235 SYS_GET_MEMPOLICY = 236 SYS_SET_MEMPOLICY = 237 SYS_MIGRATE_PAGES = 238 SYS_MOVE_PAGES = 239 SYS_RT_TGSIGQUEUEINFO = 240 SYS_PERF_EVENT_OPEN = 241 SYS_ACCEPT4 = 242 SYS_RECVMMSG = 243 SYS_ARCH_SPECIFIC_SYSCALL = 244 SYS_WAIT4 = 260 SYS_PRLIMIT64 = 261 SYS_FANOTIFY_INIT = 262 SYS_FANOTIFY_MARK = 263 SYS_NAME_TO_HANDLE_AT = 264 SYS_OPEN_BY_HANDLE_AT = 265 SYS_CLOCK_ADJTIME = 266 SYS_SYNCFS = 267 SYS_SETNS = 268 SYS_SENDMMSG = 269 SYS_PROCESS_VM_READV = 270 SYS_PROCESS_VM_WRITEV = 271 SYS_KCMP = 272 SYS_FINIT_MODULE = 273 SYS_SCHED_SETATTR = 274 SYS_SCHED_GETATTR = 275 SYS_RENAMEAT2 = 276 SYS_SECCOMP = 277 SYS_GETRANDOM = 278 SYS_MEMFD_CREATE = 279 SYS_BPF = 280 SYS_EXECVEAT = 281 SYS_USERFAULTFD = 282 SYS_MEMBARRIER = 283 SYS_MLOCK2 = 284 SYS_COPY_FILE_RANGE = 285 SYS_PREADV2 = 286 SYS_PWRITEV2 = 287 SYS_PKEY_MPROTECT = 288 SYS_PKEY_ALLOC = 289 SYS_PKEY_FREE = 290 SYS_STATX = 291 SYS_IO_PGETEVENTS = 292 SYS_RSEQ = 293 SYS_KEXEC_FILE_LOAD = 294 SYS_PIDFD_SEND_SIGNAL = 424 SYS_IO_URING_SETUP = 425 SYS_IO_URING_ENTER = 426 SYS_IO_URING_REGISTER = 427 SYS_OPEN_TREE = 428 SYS_MOVE_MOUNT = 429 SYS_FSOPEN = 430 SYS_FSCONFIG = 431 SYS_FSMOUNT = 432 SYS_FSPICK = 433 SYS_PIDFD_OPEN = 434 SYS_CLONE3 = 435 SYS_CLOSE_RANGE = 436 SYS_OPENAT2 = 437 SYS_PIDFD_GETFD = 438 SYS_FACCESSAT2 = 439 SYS_PROCESS_MADVISE = 440 SYS_EPOLL_PWAIT2 = 441 SYS_MOUNT_SETATTR = 442 SYS_QUOTACTL_FD = 443 SYS_LANDLOCK_CREATE_RULESET = 444 SYS_LANDLOCK_ADD_RULE = 445 SYS_LANDLOCK_RESTRICT_SELF = 446 SYS_MEMFD_SECRET = 447 SYS_PROCESS_MRELEASE = 448 SYS_FUTEX_WAITV = 449 SYS_SET_MEMPOLICY_HOME_NODE = 450 SYS_CACHESTAT = 451 SYS_FCHMODAT2 = 452 SYS_MAP_SHADOW_STACK = 453 SYS_FUTEX_WAKE = 454 SYS_FUTEX_WAIT = 455 SYS_FUTEX_REQUEUE = 456 SYS_STATMOUNT = 457 SYS_LISTMOUNT = 458 SYS_LSM_GET_SELF_ATTR = 459 SYS_LSM_SET_SELF_ATTR = 460 SYS_LSM_LIST_MODULES = 461 SYS_MSEAL = 462 SYS_SETXATTRAT = 463 SYS_GETXATTRAT = 464 SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 SYS_OPEN_TREE_ATTR = 467 ) ================================================ FILE: vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go ================================================ // go run linux/mksysnum.go -Wall -Werror -static -I/tmp/loong64/include /tmp/loong64/include/asm/unistd.h // Code generated by the command above; see README.md. DO NOT EDIT. //go:build loong64 && linux package unix const ( SYS_IO_SETUP = 0 SYS_IO_DESTROY = 1 SYS_IO_SUBMIT = 2 SYS_IO_CANCEL = 3 SYS_IO_GETEVENTS = 4 SYS_SETXATTR = 5 SYS_LSETXATTR = 6 SYS_FSETXATTR = 7 SYS_GETXATTR = 8 SYS_LGETXATTR = 9 SYS_FGETXATTR = 10 SYS_LISTXATTR = 11 SYS_LLISTXATTR = 12 SYS_FLISTXATTR = 13 SYS_REMOVEXATTR = 14 SYS_LREMOVEXATTR = 15 SYS_FREMOVEXATTR = 16 SYS_GETCWD = 17 SYS_LOOKUP_DCOOKIE = 18 SYS_EVENTFD2 = 19 SYS_EPOLL_CREATE1 = 20 SYS_EPOLL_CTL = 21 SYS_EPOLL_PWAIT = 22 SYS_DUP = 23 SYS_DUP3 = 24 SYS_FCNTL = 25 SYS_INOTIFY_INIT1 = 26 SYS_INOTIFY_ADD_WATCH = 27 SYS_INOTIFY_RM_WATCH = 28 SYS_IOCTL = 29 SYS_IOPRIO_SET = 30 SYS_IOPRIO_GET = 31 SYS_FLOCK = 32 SYS_MKNODAT = 33 SYS_MKDIRAT = 34 SYS_UNLINKAT = 35 SYS_SYMLINKAT = 36 SYS_LINKAT = 37 SYS_UMOUNT2 = 39 SYS_MOUNT = 40 SYS_PIVOT_ROOT = 41 SYS_NFSSERVCTL = 42 SYS_STATFS = 43 SYS_FSTATFS = 44 SYS_TRUNCATE = 45 SYS_FTRUNCATE = 46 SYS_FALLOCATE = 47 SYS_FACCESSAT = 48 SYS_CHDIR = 49 SYS_FCHDIR = 50 SYS_CHROOT = 51 SYS_FCHMOD = 52 SYS_FCHMODAT = 53 SYS_FCHOWNAT = 54 SYS_FCHOWN = 55 SYS_OPENAT = 56 SYS_CLOSE = 57 SYS_VHANGUP = 58 SYS_PIPE2 = 59 SYS_QUOTACTL = 60 SYS_GETDENTS64 = 61 SYS_LSEEK = 62 SYS_READ = 63 SYS_WRITE = 64 SYS_READV = 65 SYS_WRITEV = 66 SYS_PREAD64 = 67 SYS_PWRITE64 = 68 SYS_PREADV = 69 SYS_PWRITEV = 70 SYS_SENDFILE = 71 SYS_PSELECT6 = 72 SYS_PPOLL = 73 SYS_SIGNALFD4 = 74 SYS_VMSPLICE = 75 SYS_SPLICE = 76 SYS_TEE = 77 SYS_READLINKAT = 78 SYS_NEWFSTATAT = 79 SYS_FSTAT = 80 SYS_SYNC = 81 SYS_FSYNC = 82 SYS_FDATASYNC = 83 SYS_SYNC_FILE_RANGE = 84 SYS_TIMERFD_CREATE = 85 SYS_TIMERFD_SETTIME = 86 SYS_TIMERFD_GETTIME = 87 SYS_UTIMENSAT = 88 SYS_ACCT = 89 SYS_CAPGET = 90 SYS_CAPSET = 91 SYS_PERSONALITY = 92 SYS_EXIT = 93 SYS_EXIT_GROUP = 94 SYS_WAITID = 95 SYS_SET_TID_ADDRESS = 96 SYS_UNSHARE = 97 SYS_FUTEX = 98 SYS_SET_ROBUST_LIST = 99 SYS_GET_ROBUST_LIST = 100 SYS_NANOSLEEP = 101 SYS_GETITIMER = 102 SYS_SETITIMER = 103 SYS_KEXEC_LOAD = 104 SYS_INIT_MODULE = 105 SYS_DELETE_MODULE = 106 SYS_TIMER_CREATE = 107 SYS_TIMER_GETTIME = 108 SYS_TIMER_GETOVERRUN = 109 SYS_TIMER_SETTIME = 110 SYS_TIMER_DELETE = 111 SYS_CLOCK_SETTIME = 112 SYS_CLOCK_GETTIME = 113 SYS_CLOCK_GETRES = 114 SYS_CLOCK_NANOSLEEP = 115 SYS_SYSLOG = 116 SYS_PTRACE = 117 SYS_SCHED_SETPARAM = 118 SYS_SCHED_SETSCHEDULER = 119 SYS_SCHED_GETSCHEDULER = 120 SYS_SCHED_GETPARAM = 121 SYS_SCHED_SETAFFINITY = 122 SYS_SCHED_GETAFFINITY = 123 SYS_SCHED_YIELD = 124 SYS_SCHED_GET_PRIORITY_MAX = 125 SYS_SCHED_GET_PRIORITY_MIN = 126 SYS_SCHED_RR_GET_INTERVAL = 127 SYS_RESTART_SYSCALL = 128 SYS_KILL = 129 SYS_TKILL = 130 SYS_TGKILL = 131 SYS_SIGALTSTACK = 132 SYS_RT_SIGSUSPEND = 133 SYS_RT_SIGACTION = 134 SYS_RT_SIGPROCMASK = 135 SYS_RT_SIGPENDING = 136 SYS_RT_SIGTIMEDWAIT = 137 SYS_RT_SIGQUEUEINFO = 138 SYS_RT_SIGRETURN = 139 SYS_SETPRIORITY = 140 SYS_GETPRIORITY = 141 SYS_REBOOT = 142 SYS_SETREGID = 143 SYS_SETGID = 144 SYS_SETREUID = 145 SYS_SETUID = 146 SYS_SETRESUID = 147 SYS_GETRESUID = 148 SYS_SETRESGID = 149 SYS_GETRESGID = 150 SYS_SETFSUID = 151 SYS_SETFSGID = 152 SYS_TIMES = 153 SYS_SETPGID = 154 SYS_GETPGID = 155 SYS_GETSID = 156 SYS_SETSID = 157 SYS_GETGROUPS = 158 SYS_SETGROUPS = 159 SYS_UNAME = 160 SYS_SETHOSTNAME = 161 SYS_SETDOMAINNAME = 162 SYS_GETRUSAGE = 165 SYS_UMASK = 166 SYS_PRCTL = 167 SYS_GETCPU = 168 SYS_GETTIMEOFDAY = 169 SYS_SETTIMEOFDAY = 170 SYS_ADJTIMEX = 171 SYS_GETPID = 172 SYS_GETPPID = 173 SYS_GETUID = 174 SYS_GETEUID = 175 SYS_GETGID = 176 SYS_GETEGID = 177 SYS_GETTID = 178 SYS_SYSINFO = 179 SYS_MQ_OPEN = 180 SYS_MQ_UNLINK = 181 SYS_MQ_TIMEDSEND = 182 SYS_MQ_TIMEDRECEIVE = 183 SYS_MQ_NOTIFY = 184 SYS_MQ_GETSETATTR = 185 SYS_MSGGET = 186 SYS_MSGCTL = 187 SYS_MSGRCV = 188 SYS_MSGSND = 189 SYS_SEMGET = 190 SYS_SEMCTL = 191 SYS_SEMTIMEDOP = 192 SYS_SEMOP = 193 SYS_SHMGET = 194 SYS_SHMCTL = 195 SYS_SHMAT = 196 SYS_SHMDT = 197 SYS_SOCKET = 198 SYS_SOCKETPAIR = 199 SYS_BIND = 200 SYS_LISTEN = 201 SYS_ACCEPT = 202 SYS_CONNECT = 203 SYS_GETSOCKNAME = 204 SYS_GETPEERNAME = 205 SYS_SENDTO = 206 SYS_RECVFROM = 207 SYS_SETSOCKOPT = 208 SYS_GETSOCKOPT = 209 SYS_SHUTDOWN = 210 SYS_SENDMSG = 211 SYS_RECVMSG = 212 SYS_READAHEAD = 213 SYS_BRK = 214 SYS_MUNMAP = 215 SYS_MREMAP = 216 SYS_ADD_KEY = 217 SYS_REQUEST_KEY = 218 SYS_KEYCTL = 219 SYS_CLONE = 220 SYS_EXECVE = 221 SYS_MMAP = 222 SYS_FADVISE64 = 223 SYS_SWAPON = 224 SYS_SWAPOFF = 225 SYS_MPROTECT = 226 SYS_MSYNC = 227 SYS_MLOCK = 228 SYS_MUNLOCK = 229 SYS_MLOCKALL = 230 SYS_MUNLOCKALL = 231 SYS_MINCORE = 232 SYS_MADVISE = 233 SYS_REMAP_FILE_PAGES = 234 SYS_MBIND = 235 SYS_GET_MEMPOLICY = 236 SYS_SET_MEMPOLICY = 237 SYS_MIGRATE_PAGES = 238 SYS_MOVE_PAGES = 239 SYS_RT_TGSIGQUEUEINFO = 240 SYS_PERF_EVENT_OPEN = 241 SYS_ACCEPT4 = 242 SYS_RECVMMSG = 243 SYS_ARCH_SPECIFIC_SYSCALL = 244 SYS_WAIT4 = 260 SYS_PRLIMIT64 = 261 SYS_FANOTIFY_INIT = 262 SYS_FANOTIFY_MARK = 263 SYS_NAME_TO_HANDLE_AT = 264 SYS_OPEN_BY_HANDLE_AT = 265 SYS_CLOCK_ADJTIME = 266 SYS_SYNCFS = 267 SYS_SETNS = 268 SYS_SENDMMSG = 269 SYS_PROCESS_VM_READV = 270 SYS_PROCESS_VM_WRITEV = 271 SYS_KCMP = 272 SYS_FINIT_MODULE = 273 SYS_SCHED_SETATTR = 274 SYS_SCHED_GETATTR = 275 SYS_RENAMEAT2 = 276 SYS_SECCOMP = 277 SYS_GETRANDOM = 278 SYS_MEMFD_CREATE = 279 SYS_BPF = 280 SYS_EXECVEAT = 281 SYS_USERFAULTFD = 282 SYS_MEMBARRIER = 283 SYS_MLOCK2 = 284 SYS_COPY_FILE_RANGE = 285 SYS_PREADV2 = 286 SYS_PWRITEV2 = 287 SYS_PKEY_MPROTECT = 288 SYS_PKEY_ALLOC = 289 SYS_PKEY_FREE = 290 SYS_STATX = 291 SYS_IO_PGETEVENTS = 292 SYS_RSEQ = 293 SYS_KEXEC_FILE_LOAD = 294 SYS_PIDFD_SEND_SIGNAL = 424 SYS_IO_URING_SETUP = 425 SYS_IO_URING_ENTER = 426 SYS_IO_URING_REGISTER = 427 SYS_OPEN_TREE = 428 SYS_MOVE_MOUNT = 429 SYS_FSOPEN = 430 SYS_FSCONFIG = 431 SYS_FSMOUNT = 432 SYS_FSPICK = 433 SYS_PIDFD_OPEN = 434 SYS_CLONE3 = 435 SYS_CLOSE_RANGE = 436 SYS_OPENAT2 = 437 SYS_PIDFD_GETFD = 438 SYS_FACCESSAT2 = 439 SYS_PROCESS_MADVISE = 440 SYS_EPOLL_PWAIT2 = 441 SYS_MOUNT_SETATTR = 442 SYS_QUOTACTL_FD = 443 SYS_LANDLOCK_CREATE_RULESET = 444 SYS_LANDLOCK_ADD_RULE = 445 SYS_LANDLOCK_RESTRICT_SELF = 446 SYS_PROCESS_MRELEASE = 448 SYS_FUTEX_WAITV = 449 SYS_SET_MEMPOLICY_HOME_NODE = 450 SYS_CACHESTAT = 451 SYS_FCHMODAT2 = 452 SYS_MAP_SHADOW_STACK = 453 SYS_FUTEX_WAKE = 454 SYS_FUTEX_WAIT = 455 SYS_FUTEX_REQUEUE = 456 SYS_STATMOUNT = 457 SYS_LISTMOUNT = 458 SYS_LSM_GET_SELF_ATTR = 459 SYS_LSM_SET_SELF_ATTR = 460 SYS_LSM_LIST_MODULES = 461 SYS_MSEAL = 462 SYS_SETXATTRAT = 463 SYS_GETXATTRAT = 464 SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 SYS_OPEN_TREE_ATTR = 467 ) ================================================ FILE: vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go ================================================ // go run linux/mksysnum.go -Wall -Werror -static -I/tmp/mips/include /tmp/mips/include/asm/unistd.h // Code generated by the command above; see README.md. DO NOT EDIT. //go:build mips && linux package unix const ( SYS_SYSCALL = 4000 SYS_EXIT = 4001 SYS_FORK = 4002 SYS_READ = 4003 SYS_WRITE = 4004 SYS_OPEN = 4005 SYS_CLOSE = 4006 SYS_WAITPID = 4007 SYS_CREAT = 4008 SYS_LINK = 4009 SYS_UNLINK = 4010 SYS_EXECVE = 4011 SYS_CHDIR = 4012 SYS_TIME = 4013 SYS_MKNOD = 4014 SYS_CHMOD = 4015 SYS_LCHOWN = 4016 SYS_BREAK = 4017 SYS_UNUSED18 = 4018 SYS_LSEEK = 4019 SYS_GETPID = 4020 SYS_MOUNT = 4021 SYS_UMOUNT = 4022 SYS_SETUID = 4023 SYS_GETUID = 4024 SYS_STIME = 4025 SYS_PTRACE = 4026 SYS_ALARM = 4027 SYS_UNUSED28 = 4028 SYS_PAUSE = 4029 SYS_UTIME = 4030 SYS_STTY = 4031 SYS_GTTY = 4032 SYS_ACCESS = 4033 SYS_NICE = 4034 SYS_FTIME = 4035 SYS_SYNC = 4036 SYS_KILL = 4037 SYS_RENAME = 4038 SYS_MKDIR = 4039 SYS_RMDIR = 4040 SYS_DUP = 4041 SYS_PIPE = 4042 SYS_TIMES = 4043 SYS_PROF = 4044 SYS_BRK = 4045 SYS_SETGID = 4046 SYS_GETGID = 4047 SYS_SIGNAL = 4048 SYS_GETEUID = 4049 SYS_GETEGID = 4050 SYS_ACCT = 4051 SYS_UMOUNT2 = 4052 SYS_LOCK = 4053 SYS_IOCTL = 4054 SYS_FCNTL = 4055 SYS_MPX = 4056 SYS_SETPGID = 4057 SYS_ULIMIT = 4058 SYS_UNUSED59 = 4059 SYS_UMASK = 4060 SYS_CHROOT = 4061 SYS_USTAT = 4062 SYS_DUP2 = 4063 SYS_GETPPID = 4064 SYS_GETPGRP = 4065 SYS_SETSID = 4066 SYS_SIGACTION = 4067 SYS_SGETMASK = 4068 SYS_SSETMASK = 4069 SYS_SETREUID = 4070 SYS_SETREGID = 4071 SYS_SIGSUSPEND = 4072 SYS_SIGPENDING = 4073 SYS_SETHOSTNAME = 4074 SYS_SETRLIMIT = 4075 SYS_GETRLIMIT = 4076 SYS_GETRUSAGE = 4077 SYS_GETTIMEOFDAY = 4078 SYS_SETTIMEOFDAY = 4079 SYS_GETGROUPS = 4080 SYS_SETGROUPS = 4081 SYS_RESERVED82 = 4082 SYS_SYMLINK = 4083 SYS_UNUSED84 = 4084 SYS_READLINK = 4085 SYS_USELIB = 4086 SYS_SWAPON = 4087 SYS_REBOOT = 4088 SYS_READDIR = 4089 SYS_MMAP = 4090 SYS_MUNMAP = 4091 SYS_TRUNCATE = 4092 SYS_FTRUNCATE = 4093 SYS_FCHMOD = 4094 SYS_FCHOWN = 4095 SYS_GETPRIORITY = 4096 SYS_SETPRIORITY = 4097 SYS_PROFIL = 4098 SYS_STATFS = 4099 SYS_FSTATFS = 4100 SYS_IOPERM = 4101 SYS_SOCKETCALL = 4102 SYS_SYSLOG = 4103 SYS_SETITIMER = 4104 SYS_GETITIMER = 4105 SYS_STAT = 4106 SYS_LSTAT = 4107 SYS_FSTAT = 4108 SYS_UNUSED109 = 4109 SYS_IOPL = 4110 SYS_VHANGUP = 4111 SYS_IDLE = 4112 SYS_VM86 = 4113 SYS_WAIT4 = 4114 SYS_SWAPOFF = 4115 SYS_SYSINFO = 4116 SYS_IPC = 4117 SYS_FSYNC = 4118 SYS_SIGRETURN = 4119 SYS_CLONE = 4120 SYS_SETDOMAINNAME = 4121 SYS_UNAME = 4122 SYS_MODIFY_LDT = 4123 SYS_ADJTIMEX = 4124 SYS_MPROTECT = 4125 SYS_SIGPROCMASK = 4126 SYS_CREATE_MODULE = 4127 SYS_INIT_MODULE = 4128 SYS_DELETE_MODULE = 4129 SYS_GET_KERNEL_SYMS = 4130 SYS_QUOTACTL = 4131 SYS_GETPGID = 4132 SYS_FCHDIR = 4133 SYS_BDFLUSH = 4134 SYS_SYSFS = 4135 SYS_PERSONALITY = 4136 SYS_AFS_SYSCALL = 4137 SYS_SETFSUID = 4138 SYS_SETFSGID = 4139 SYS__LLSEEK = 4140 SYS_GETDENTS = 4141 SYS__NEWSELECT = 4142 SYS_FLOCK = 4143 SYS_MSYNC = 4144 SYS_READV = 4145 SYS_WRITEV = 4146 SYS_CACHEFLUSH = 4147 SYS_CACHECTL = 4148 SYS_SYSMIPS = 4149 SYS_UNUSED150 = 4150 SYS_GETSID = 4151 SYS_FDATASYNC = 4152 SYS__SYSCTL = 4153 SYS_MLOCK = 4154 SYS_MUNLOCK = 4155 SYS_MLOCKALL = 4156 SYS_MUNLOCKALL = 4157 SYS_SCHED_SETPARAM = 4158 SYS_SCHED_GETPARAM = 4159 SYS_SCHED_SETSCHEDULER = 4160 SYS_SCHED_GETSCHEDULER = 4161 SYS_SCHED_YIELD = 4162 SYS_SCHED_GET_PRIORITY_MAX = 4163 SYS_SCHED_GET_PRIORITY_MIN = 4164 SYS_SCHED_RR_GET_INTERVAL = 4165 SYS_NANOSLEEP = 4166 SYS_MREMAP = 4167 SYS_ACCEPT = 4168 SYS_BIND = 4169 SYS_CONNECT = 4170 SYS_GETPEERNAME = 4171 SYS_GETSOCKNAME = 4172 SYS_GETSOCKOPT = 4173 SYS_LISTEN = 4174 SYS_RECV = 4175 SYS_RECVFROM = 4176 SYS_RECVMSG = 4177 SYS_SEND = 4178 SYS_SENDMSG = 4179 SYS_SENDTO = 4180 SYS_SETSOCKOPT = 4181 SYS_SHUTDOWN = 4182 SYS_SOCKET = 4183 SYS_SOCKETPAIR = 4184 SYS_SETRESUID = 4185 SYS_GETRESUID = 4186 SYS_QUERY_MODULE = 4187 SYS_POLL = 4188 SYS_NFSSERVCTL = 4189 SYS_SETRESGID = 4190 SYS_GETRESGID = 4191 SYS_PRCTL = 4192 SYS_RT_SIGRETURN = 4193 SYS_RT_SIGACTION = 4194 SYS_RT_SIGPROCMASK = 4195 SYS_RT_SIGPENDING = 4196 SYS_RT_SIGTIMEDWAIT = 4197 SYS_RT_SIGQUEUEINFO = 4198 SYS_RT_SIGSUSPEND = 4199 SYS_PREAD64 = 4200 SYS_PWRITE64 = 4201 SYS_CHOWN = 4202 SYS_GETCWD = 4203 SYS_CAPGET = 4204 SYS_CAPSET = 4205 SYS_SIGALTSTACK = 4206 SYS_SENDFILE = 4207 SYS_GETPMSG = 4208 SYS_PUTPMSG = 4209 SYS_MMAP2 = 4210 SYS_TRUNCATE64 = 4211 SYS_FTRUNCATE64 = 4212 SYS_STAT64 = 4213 SYS_LSTAT64 = 4214 SYS_FSTAT64 = 4215 SYS_PIVOT_ROOT = 4216 SYS_MINCORE = 4217 SYS_MADVISE = 4218 SYS_GETDENTS64 = 4219 SYS_FCNTL64 = 4220 SYS_RESERVED221 = 4221 SYS_GETTID = 4222 SYS_READAHEAD = 4223 SYS_SETXATTR = 4224 SYS_LSETXATTR = 4225 SYS_FSETXATTR = 4226 SYS_GETXATTR = 4227 SYS_LGETXATTR = 4228 SYS_FGETXATTR = 4229 SYS_LISTXATTR = 4230 SYS_LLISTXATTR = 4231 SYS_FLISTXATTR = 4232 SYS_REMOVEXATTR = 4233 SYS_LREMOVEXATTR = 4234 SYS_FREMOVEXATTR = 4235 SYS_TKILL = 4236 SYS_SENDFILE64 = 4237 SYS_FUTEX = 4238 SYS_SCHED_SETAFFINITY = 4239 SYS_SCHED_GETAFFINITY = 4240 SYS_IO_SETUP = 4241 SYS_IO_DESTROY = 4242 SYS_IO_GETEVENTS = 4243 SYS_IO_SUBMIT = 4244 SYS_IO_CANCEL = 4245 SYS_EXIT_GROUP = 4246 SYS_LOOKUP_DCOOKIE = 4247 SYS_EPOLL_CREATE = 4248 SYS_EPOLL_CTL = 4249 SYS_EPOLL_WAIT = 4250 SYS_REMAP_FILE_PAGES = 4251 SYS_SET_TID_ADDRESS = 4252 SYS_RESTART_SYSCALL = 4253 SYS_FADVISE64 = 4254 SYS_STATFS64 = 4255 SYS_FSTATFS64 = 4256 SYS_TIMER_CREATE = 4257 SYS_TIMER_SETTIME = 4258 SYS_TIMER_GETTIME = 4259 SYS_TIMER_GETOVERRUN = 4260 SYS_TIMER_DELETE = 4261 SYS_CLOCK_SETTIME = 4262 SYS_CLOCK_GETTIME = 4263 SYS_CLOCK_GETRES = 4264 SYS_CLOCK_NANOSLEEP = 4265 SYS_TGKILL = 4266 SYS_UTIMES = 4267 SYS_MBIND = 4268 SYS_GET_MEMPOLICY = 4269 SYS_SET_MEMPOLICY = 4270 SYS_MQ_OPEN = 4271 SYS_MQ_UNLINK = 4272 SYS_MQ_TIMEDSEND = 4273 SYS_MQ_TIMEDRECEIVE = 4274 SYS_MQ_NOTIFY = 4275 SYS_MQ_GETSETATTR = 4276 SYS_VSERVER = 4277 SYS_WAITID = 4278 SYS_ADD_KEY = 4280 SYS_REQUEST_KEY = 4281 SYS_KEYCTL = 4282 SYS_SET_THREAD_AREA = 4283 SYS_INOTIFY_INIT = 4284 SYS_INOTIFY_ADD_WATCH = 4285 SYS_INOTIFY_RM_WATCH = 4286 SYS_MIGRATE_PAGES = 4287 SYS_OPENAT = 4288 SYS_MKDIRAT = 4289 SYS_MKNODAT = 4290 SYS_FCHOWNAT = 4291 SYS_FUTIMESAT = 4292 SYS_FSTATAT64 = 4293 SYS_UNLINKAT = 4294 SYS_RENAMEAT = 4295 SYS_LINKAT = 4296 SYS_SYMLINKAT = 4297 SYS_READLINKAT = 4298 SYS_FCHMODAT = 4299 SYS_FACCESSAT = 4300 SYS_PSELECT6 = 4301 SYS_PPOLL = 4302 SYS_UNSHARE = 4303 SYS_SPLICE = 4304 SYS_SYNC_FILE_RANGE = 4305 SYS_TEE = 4306 SYS_VMSPLICE = 4307 SYS_MOVE_PAGES = 4308 SYS_SET_ROBUST_LIST = 4309 SYS_GET_ROBUST_LIST = 4310 SYS_KEXEC_LOAD = 4311 SYS_GETCPU = 4312 SYS_EPOLL_PWAIT = 4313 SYS_IOPRIO_SET = 4314 SYS_IOPRIO_GET = 4315 SYS_UTIMENSAT = 4316 SYS_SIGNALFD = 4317 SYS_TIMERFD = 4318 SYS_EVENTFD = 4319 SYS_FALLOCATE = 4320 SYS_TIMERFD_CREATE = 4321 SYS_TIMERFD_GETTIME = 4322 SYS_TIMERFD_SETTIME = 4323 SYS_SIGNALFD4 = 4324 SYS_EVENTFD2 = 4325 SYS_EPOLL_CREATE1 = 4326 SYS_DUP3 = 4327 SYS_PIPE2 = 4328 SYS_INOTIFY_INIT1 = 4329 SYS_PREADV = 4330 SYS_PWRITEV = 4331 SYS_RT_TGSIGQUEUEINFO = 4332 SYS_PERF_EVENT_OPEN = 4333 SYS_ACCEPT4 = 4334 SYS_RECVMMSG = 4335 SYS_FANOTIFY_INIT = 4336 SYS_FANOTIFY_MARK = 4337 SYS_PRLIMIT64 = 4338 SYS_NAME_TO_HANDLE_AT = 4339 SYS_OPEN_BY_HANDLE_AT = 4340 SYS_CLOCK_ADJTIME = 4341 SYS_SYNCFS = 4342 SYS_SENDMMSG = 4343 SYS_SETNS = 4344 SYS_PROCESS_VM_READV = 4345 SYS_PROCESS_VM_WRITEV = 4346 SYS_KCMP = 4347 SYS_FINIT_MODULE = 4348 SYS_SCHED_SETATTR = 4349 SYS_SCHED_GETATTR = 4350 SYS_RENAMEAT2 = 4351 SYS_SECCOMP = 4352 SYS_GETRANDOM = 4353 SYS_MEMFD_CREATE = 4354 SYS_BPF = 4355 SYS_EXECVEAT = 4356 SYS_USERFAULTFD = 4357 SYS_MEMBARRIER = 4358 SYS_MLOCK2 = 4359 SYS_COPY_FILE_RANGE = 4360 SYS_PREADV2 = 4361 SYS_PWRITEV2 = 4362 SYS_PKEY_MPROTECT = 4363 SYS_PKEY_ALLOC = 4364 SYS_PKEY_FREE = 4365 SYS_STATX = 4366 SYS_RSEQ = 4367 SYS_IO_PGETEVENTS = 4368 SYS_SEMGET = 4393 SYS_SEMCTL = 4394 SYS_SHMGET = 4395 SYS_SHMCTL = 4396 SYS_SHMAT = 4397 SYS_SHMDT = 4398 SYS_MSGGET = 4399 SYS_MSGSND = 4400 SYS_MSGRCV = 4401 SYS_MSGCTL = 4402 SYS_CLOCK_GETTIME64 = 4403 SYS_CLOCK_SETTIME64 = 4404 SYS_CLOCK_ADJTIME64 = 4405 SYS_CLOCK_GETRES_TIME64 = 4406 SYS_CLOCK_NANOSLEEP_TIME64 = 4407 SYS_TIMER_GETTIME64 = 4408 SYS_TIMER_SETTIME64 = 4409 SYS_TIMERFD_GETTIME64 = 4410 SYS_TIMERFD_SETTIME64 = 4411 SYS_UTIMENSAT_TIME64 = 4412 SYS_PSELECT6_TIME64 = 4413 SYS_PPOLL_TIME64 = 4414 SYS_IO_PGETEVENTS_TIME64 = 4416 SYS_RECVMMSG_TIME64 = 4417 SYS_MQ_TIMEDSEND_TIME64 = 4418 SYS_MQ_TIMEDRECEIVE_TIME64 = 4419 SYS_SEMTIMEDOP_TIME64 = 4420 SYS_RT_SIGTIMEDWAIT_TIME64 = 4421 SYS_FUTEX_TIME64 = 4422 SYS_SCHED_RR_GET_INTERVAL_TIME64 = 4423 SYS_PIDFD_SEND_SIGNAL = 4424 SYS_IO_URING_SETUP = 4425 SYS_IO_URING_ENTER = 4426 SYS_IO_URING_REGISTER = 4427 SYS_OPEN_TREE = 4428 SYS_MOVE_MOUNT = 4429 SYS_FSOPEN = 4430 SYS_FSCONFIG = 4431 SYS_FSMOUNT = 4432 SYS_FSPICK = 4433 SYS_PIDFD_OPEN = 4434 SYS_CLONE3 = 4435 SYS_CLOSE_RANGE = 4436 SYS_OPENAT2 = 4437 SYS_PIDFD_GETFD = 4438 SYS_FACCESSAT2 = 4439 SYS_PROCESS_MADVISE = 4440 SYS_EPOLL_PWAIT2 = 4441 SYS_MOUNT_SETATTR = 4442 SYS_QUOTACTL_FD = 4443 SYS_LANDLOCK_CREATE_RULESET = 4444 SYS_LANDLOCK_ADD_RULE = 4445 SYS_LANDLOCK_RESTRICT_SELF = 4446 SYS_PROCESS_MRELEASE = 4448 SYS_FUTEX_WAITV = 4449 SYS_SET_MEMPOLICY_HOME_NODE = 4450 SYS_CACHESTAT = 4451 SYS_FCHMODAT2 = 4452 SYS_MAP_SHADOW_STACK = 4453 SYS_FUTEX_WAKE = 4454 SYS_FUTEX_WAIT = 4455 SYS_FUTEX_REQUEUE = 4456 SYS_STATMOUNT = 4457 SYS_LISTMOUNT = 4458 SYS_LSM_GET_SELF_ATTR = 4459 SYS_LSM_SET_SELF_ATTR = 4460 SYS_LSM_LIST_MODULES = 4461 SYS_MSEAL = 4462 SYS_SETXATTRAT = 4463 SYS_GETXATTRAT = 4464 SYS_LISTXATTRAT = 4465 SYS_REMOVEXATTRAT = 4466 SYS_OPEN_TREE_ATTR = 4467 ) ================================================ FILE: vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go ================================================ // go run linux/mksysnum.go -Wall -Werror -static -I/tmp/mips64/include /tmp/mips64/include/asm/unistd.h // Code generated by the command above; see README.md. DO NOT EDIT. //go:build mips64 && linux package unix const ( SYS_READ = 5000 SYS_WRITE = 5001 SYS_OPEN = 5002 SYS_CLOSE = 5003 SYS_STAT = 5004 SYS_FSTAT = 5005 SYS_LSTAT = 5006 SYS_POLL = 5007 SYS_LSEEK = 5008 SYS_MMAP = 5009 SYS_MPROTECT = 5010 SYS_MUNMAP = 5011 SYS_BRK = 5012 SYS_RT_SIGACTION = 5013 SYS_RT_SIGPROCMASK = 5014 SYS_IOCTL = 5015 SYS_PREAD64 = 5016 SYS_PWRITE64 = 5017 SYS_READV = 5018 SYS_WRITEV = 5019 SYS_ACCESS = 5020 SYS_PIPE = 5021 SYS__NEWSELECT = 5022 SYS_SCHED_YIELD = 5023 SYS_MREMAP = 5024 SYS_MSYNC = 5025 SYS_MINCORE = 5026 SYS_MADVISE = 5027 SYS_SHMGET = 5028 SYS_SHMAT = 5029 SYS_SHMCTL = 5030 SYS_DUP = 5031 SYS_DUP2 = 5032 SYS_PAUSE = 5033 SYS_NANOSLEEP = 5034 SYS_GETITIMER = 5035 SYS_SETITIMER = 5036 SYS_ALARM = 5037 SYS_GETPID = 5038 SYS_SENDFILE = 5039 SYS_SOCKET = 5040 SYS_CONNECT = 5041 SYS_ACCEPT = 5042 SYS_SENDTO = 5043 SYS_RECVFROM = 5044 SYS_SENDMSG = 5045 SYS_RECVMSG = 5046 SYS_SHUTDOWN = 5047 SYS_BIND = 5048 SYS_LISTEN = 5049 SYS_GETSOCKNAME = 5050 SYS_GETPEERNAME = 5051 SYS_SOCKETPAIR = 5052 SYS_SETSOCKOPT = 5053 SYS_GETSOCKOPT = 5054 SYS_CLONE = 5055 SYS_FORK = 5056 SYS_EXECVE = 5057 SYS_EXIT = 5058 SYS_WAIT4 = 5059 SYS_KILL = 5060 SYS_UNAME = 5061 SYS_SEMGET = 5062 SYS_SEMOP = 5063 SYS_SEMCTL = 5064 SYS_SHMDT = 5065 SYS_MSGGET = 5066 SYS_MSGSND = 5067 SYS_MSGRCV = 5068 SYS_MSGCTL = 5069 SYS_FCNTL = 5070 SYS_FLOCK = 5071 SYS_FSYNC = 5072 SYS_FDATASYNC = 5073 SYS_TRUNCATE = 5074 SYS_FTRUNCATE = 5075 SYS_GETDENTS = 5076 SYS_GETCWD = 5077 SYS_CHDIR = 5078 SYS_FCHDIR = 5079 SYS_RENAME = 5080 SYS_MKDIR = 5081 SYS_RMDIR = 5082 SYS_CREAT = 5083 SYS_LINK = 5084 SYS_UNLINK = 5085 SYS_SYMLINK = 5086 SYS_READLINK = 5087 SYS_CHMOD = 5088 SYS_FCHMOD = 5089 SYS_CHOWN = 5090 SYS_FCHOWN = 5091 SYS_LCHOWN = 5092 SYS_UMASK = 5093 SYS_GETTIMEOFDAY = 5094 SYS_GETRLIMIT = 5095 SYS_GETRUSAGE = 5096 SYS_SYSINFO = 5097 SYS_TIMES = 5098 SYS_PTRACE = 5099 SYS_GETUID = 5100 SYS_SYSLOG = 5101 SYS_GETGID = 5102 SYS_SETUID = 5103 SYS_SETGID = 5104 SYS_GETEUID = 5105 SYS_GETEGID = 5106 SYS_SETPGID = 5107 SYS_GETPPID = 5108 SYS_GETPGRP = 5109 SYS_SETSID = 5110 SYS_SETREUID = 5111 SYS_SETREGID = 5112 SYS_GETGROUPS = 5113 SYS_SETGROUPS = 5114 SYS_SETRESUID = 5115 SYS_GETRESUID = 5116 SYS_SETRESGID = 5117 SYS_GETRESGID = 5118 SYS_GETPGID = 5119 SYS_SETFSUID = 5120 SYS_SETFSGID = 5121 SYS_GETSID = 5122 SYS_CAPGET = 5123 SYS_CAPSET = 5124 SYS_RT_SIGPENDING = 5125 SYS_RT_SIGTIMEDWAIT = 5126 SYS_RT_SIGQUEUEINFO = 5127 SYS_RT_SIGSUSPEND = 5128 SYS_SIGALTSTACK = 5129 SYS_UTIME = 5130 SYS_MKNOD = 5131 SYS_PERSONALITY = 5132 SYS_USTAT = 5133 SYS_STATFS = 5134 SYS_FSTATFS = 5135 SYS_SYSFS = 5136 SYS_GETPRIORITY = 5137 SYS_SETPRIORITY = 5138 SYS_SCHED_SETPARAM = 5139 SYS_SCHED_GETPARAM = 5140 SYS_SCHED_SETSCHEDULER = 5141 SYS_SCHED_GETSCHEDULER = 5142 SYS_SCHED_GET_PRIORITY_MAX = 5143 SYS_SCHED_GET_PRIORITY_MIN = 5144 SYS_SCHED_RR_GET_INTERVAL = 5145 SYS_MLOCK = 5146 SYS_MUNLOCK = 5147 SYS_MLOCKALL = 5148 SYS_MUNLOCKALL = 5149 SYS_VHANGUP = 5150 SYS_PIVOT_ROOT = 5151 SYS__SYSCTL = 5152 SYS_PRCTL = 5153 SYS_ADJTIMEX = 5154 SYS_SETRLIMIT = 5155 SYS_CHROOT = 5156 SYS_SYNC = 5157 SYS_ACCT = 5158 SYS_SETTIMEOFDAY = 5159 SYS_MOUNT = 5160 SYS_UMOUNT2 = 5161 SYS_SWAPON = 5162 SYS_SWAPOFF = 5163 SYS_REBOOT = 5164 SYS_SETHOSTNAME = 5165 SYS_SETDOMAINNAME = 5166 SYS_CREATE_MODULE = 5167 SYS_INIT_MODULE = 5168 SYS_DELETE_MODULE = 5169 SYS_GET_KERNEL_SYMS = 5170 SYS_QUERY_MODULE = 5171 SYS_QUOTACTL = 5172 SYS_NFSSERVCTL = 5173 SYS_GETPMSG = 5174 SYS_PUTPMSG = 5175 SYS_AFS_SYSCALL = 5176 SYS_RESERVED177 = 5177 SYS_GETTID = 5178 SYS_READAHEAD = 5179 SYS_SETXATTR = 5180 SYS_LSETXATTR = 5181 SYS_FSETXATTR = 5182 SYS_GETXATTR = 5183 SYS_LGETXATTR = 5184 SYS_FGETXATTR = 5185 SYS_LISTXATTR = 5186 SYS_LLISTXATTR = 5187 SYS_FLISTXATTR = 5188 SYS_REMOVEXATTR = 5189 SYS_LREMOVEXATTR = 5190 SYS_FREMOVEXATTR = 5191 SYS_TKILL = 5192 SYS_RESERVED193 = 5193 SYS_FUTEX = 5194 SYS_SCHED_SETAFFINITY = 5195 SYS_SCHED_GETAFFINITY = 5196 SYS_CACHEFLUSH = 5197 SYS_CACHECTL = 5198 SYS_SYSMIPS = 5199 SYS_IO_SETUP = 5200 SYS_IO_DESTROY = 5201 SYS_IO_GETEVENTS = 5202 SYS_IO_SUBMIT = 5203 SYS_IO_CANCEL = 5204 SYS_EXIT_GROUP = 5205 SYS_LOOKUP_DCOOKIE = 5206 SYS_EPOLL_CREATE = 5207 SYS_EPOLL_CTL = 5208 SYS_EPOLL_WAIT = 5209 SYS_REMAP_FILE_PAGES = 5210 SYS_RT_SIGRETURN = 5211 SYS_SET_TID_ADDRESS = 5212 SYS_RESTART_SYSCALL = 5213 SYS_SEMTIMEDOP = 5214 SYS_FADVISE64 = 5215 SYS_TIMER_CREATE = 5216 SYS_TIMER_SETTIME = 5217 SYS_TIMER_GETTIME = 5218 SYS_TIMER_GETOVERRUN = 5219 SYS_TIMER_DELETE = 5220 SYS_CLOCK_SETTIME = 5221 SYS_CLOCK_GETTIME = 5222 SYS_CLOCK_GETRES = 5223 SYS_CLOCK_NANOSLEEP = 5224 SYS_TGKILL = 5225 SYS_UTIMES = 5226 SYS_MBIND = 5227 SYS_GET_MEMPOLICY = 5228 SYS_SET_MEMPOLICY = 5229 SYS_MQ_OPEN = 5230 SYS_MQ_UNLINK = 5231 SYS_MQ_TIMEDSEND = 5232 SYS_MQ_TIMEDRECEIVE = 5233 SYS_MQ_NOTIFY = 5234 SYS_MQ_GETSETATTR = 5235 SYS_VSERVER = 5236 SYS_WAITID = 5237 SYS_ADD_KEY = 5239 SYS_REQUEST_KEY = 5240 SYS_KEYCTL = 5241 SYS_SET_THREAD_AREA = 5242 SYS_INOTIFY_INIT = 5243 SYS_INOTIFY_ADD_WATCH = 5244 SYS_INOTIFY_RM_WATCH = 5245 SYS_MIGRATE_PAGES = 5246 SYS_OPENAT = 5247 SYS_MKDIRAT = 5248 SYS_MKNODAT = 5249 SYS_FCHOWNAT = 5250 SYS_FUTIMESAT = 5251 SYS_NEWFSTATAT = 5252 SYS_UNLINKAT = 5253 SYS_RENAMEAT = 5254 SYS_LINKAT = 5255 SYS_SYMLINKAT = 5256 SYS_READLINKAT = 5257 SYS_FCHMODAT = 5258 SYS_FACCESSAT = 5259 SYS_PSELECT6 = 5260 SYS_PPOLL = 5261 SYS_UNSHARE = 5262 SYS_SPLICE = 5263 SYS_SYNC_FILE_RANGE = 5264 SYS_TEE = 5265 SYS_VMSPLICE = 5266 SYS_MOVE_PAGES = 5267 SYS_SET_ROBUST_LIST = 5268 SYS_GET_ROBUST_LIST = 5269 SYS_KEXEC_LOAD = 5270 SYS_GETCPU = 5271 SYS_EPOLL_PWAIT = 5272 SYS_IOPRIO_SET = 5273 SYS_IOPRIO_GET = 5274 SYS_UTIMENSAT = 5275 SYS_SIGNALFD = 5276 SYS_TIMERFD = 5277 SYS_EVENTFD = 5278 SYS_FALLOCATE = 5279 SYS_TIMERFD_CREATE = 5280 SYS_TIMERFD_GETTIME = 5281 SYS_TIMERFD_SETTIME = 5282 SYS_SIGNALFD4 = 5283 SYS_EVENTFD2 = 5284 SYS_EPOLL_CREATE1 = 5285 SYS_DUP3 = 5286 SYS_PIPE2 = 5287 SYS_INOTIFY_INIT1 = 5288 SYS_PREADV = 5289 SYS_PWRITEV = 5290 SYS_RT_TGSIGQUEUEINFO = 5291 SYS_PERF_EVENT_OPEN = 5292 SYS_ACCEPT4 = 5293 SYS_RECVMMSG = 5294 SYS_FANOTIFY_INIT = 5295 SYS_FANOTIFY_MARK = 5296 SYS_PRLIMIT64 = 5297 SYS_NAME_TO_HANDLE_AT = 5298 SYS_OPEN_BY_HANDLE_AT = 5299 SYS_CLOCK_ADJTIME = 5300 SYS_SYNCFS = 5301 SYS_SENDMMSG = 5302 SYS_SETNS = 5303 SYS_PROCESS_VM_READV = 5304 SYS_PROCESS_VM_WRITEV = 5305 SYS_KCMP = 5306 SYS_FINIT_MODULE = 5307 SYS_GETDENTS64 = 5308 SYS_SCHED_SETATTR = 5309 SYS_SCHED_GETATTR = 5310 SYS_RENAMEAT2 = 5311 SYS_SECCOMP = 5312 SYS_GETRANDOM = 5313 SYS_MEMFD_CREATE = 5314 SYS_BPF = 5315 SYS_EXECVEAT = 5316 SYS_USERFAULTFD = 5317 SYS_MEMBARRIER = 5318 SYS_MLOCK2 = 5319 SYS_COPY_FILE_RANGE = 5320 SYS_PREADV2 = 5321 SYS_PWRITEV2 = 5322 SYS_PKEY_MPROTECT = 5323 SYS_PKEY_ALLOC = 5324 SYS_PKEY_FREE = 5325 SYS_STATX = 5326 SYS_RSEQ = 5327 SYS_IO_PGETEVENTS = 5328 SYS_PIDFD_SEND_SIGNAL = 5424 SYS_IO_URING_SETUP = 5425 SYS_IO_URING_ENTER = 5426 SYS_IO_URING_REGISTER = 5427 SYS_OPEN_TREE = 5428 SYS_MOVE_MOUNT = 5429 SYS_FSOPEN = 5430 SYS_FSCONFIG = 5431 SYS_FSMOUNT = 5432 SYS_FSPICK = 5433 SYS_PIDFD_OPEN = 5434 SYS_CLONE3 = 5435 SYS_CLOSE_RANGE = 5436 SYS_OPENAT2 = 5437 SYS_PIDFD_GETFD = 5438 SYS_FACCESSAT2 = 5439 SYS_PROCESS_MADVISE = 5440 SYS_EPOLL_PWAIT2 = 5441 SYS_MOUNT_SETATTR = 5442 SYS_QUOTACTL_FD = 5443 SYS_LANDLOCK_CREATE_RULESET = 5444 SYS_LANDLOCK_ADD_RULE = 5445 SYS_LANDLOCK_RESTRICT_SELF = 5446 SYS_PROCESS_MRELEASE = 5448 SYS_FUTEX_WAITV = 5449 SYS_SET_MEMPOLICY_HOME_NODE = 5450 SYS_CACHESTAT = 5451 SYS_FCHMODAT2 = 5452 SYS_MAP_SHADOW_STACK = 5453 SYS_FUTEX_WAKE = 5454 SYS_FUTEX_WAIT = 5455 SYS_FUTEX_REQUEUE = 5456 SYS_STATMOUNT = 5457 SYS_LISTMOUNT = 5458 SYS_LSM_GET_SELF_ATTR = 5459 SYS_LSM_SET_SELF_ATTR = 5460 SYS_LSM_LIST_MODULES = 5461 SYS_MSEAL = 5462 SYS_SETXATTRAT = 5463 SYS_GETXATTRAT = 5464 SYS_LISTXATTRAT = 5465 SYS_REMOVEXATTRAT = 5466 SYS_OPEN_TREE_ATTR = 5467 ) ================================================ FILE: vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go ================================================ // go run linux/mksysnum.go -Wall -Werror -static -I/tmp/mips64le/include /tmp/mips64le/include/asm/unistd.h // Code generated by the command above; see README.md. DO NOT EDIT. //go:build mips64le && linux package unix const ( SYS_READ = 5000 SYS_WRITE = 5001 SYS_OPEN = 5002 SYS_CLOSE = 5003 SYS_STAT = 5004 SYS_FSTAT = 5005 SYS_LSTAT = 5006 SYS_POLL = 5007 SYS_LSEEK = 5008 SYS_MMAP = 5009 SYS_MPROTECT = 5010 SYS_MUNMAP = 5011 SYS_BRK = 5012 SYS_RT_SIGACTION = 5013 SYS_RT_SIGPROCMASK = 5014 SYS_IOCTL = 5015 SYS_PREAD64 = 5016 SYS_PWRITE64 = 5017 SYS_READV = 5018 SYS_WRITEV = 5019 SYS_ACCESS = 5020 SYS_PIPE = 5021 SYS__NEWSELECT = 5022 SYS_SCHED_YIELD = 5023 SYS_MREMAP = 5024 SYS_MSYNC = 5025 SYS_MINCORE = 5026 SYS_MADVISE = 5027 SYS_SHMGET = 5028 SYS_SHMAT = 5029 SYS_SHMCTL = 5030 SYS_DUP = 5031 SYS_DUP2 = 5032 SYS_PAUSE = 5033 SYS_NANOSLEEP = 5034 SYS_GETITIMER = 5035 SYS_SETITIMER = 5036 SYS_ALARM = 5037 SYS_GETPID = 5038 SYS_SENDFILE = 5039 SYS_SOCKET = 5040 SYS_CONNECT = 5041 SYS_ACCEPT = 5042 SYS_SENDTO = 5043 SYS_RECVFROM = 5044 SYS_SENDMSG = 5045 SYS_RECVMSG = 5046 SYS_SHUTDOWN = 5047 SYS_BIND = 5048 SYS_LISTEN = 5049 SYS_GETSOCKNAME = 5050 SYS_GETPEERNAME = 5051 SYS_SOCKETPAIR = 5052 SYS_SETSOCKOPT = 5053 SYS_GETSOCKOPT = 5054 SYS_CLONE = 5055 SYS_FORK = 5056 SYS_EXECVE = 5057 SYS_EXIT = 5058 SYS_WAIT4 = 5059 SYS_KILL = 5060 SYS_UNAME = 5061 SYS_SEMGET = 5062 SYS_SEMOP = 5063 SYS_SEMCTL = 5064 SYS_SHMDT = 5065 SYS_MSGGET = 5066 SYS_MSGSND = 5067 SYS_MSGRCV = 5068 SYS_MSGCTL = 5069 SYS_FCNTL = 5070 SYS_FLOCK = 5071 SYS_FSYNC = 5072 SYS_FDATASYNC = 5073 SYS_TRUNCATE = 5074 SYS_FTRUNCATE = 5075 SYS_GETDENTS = 5076 SYS_GETCWD = 5077 SYS_CHDIR = 5078 SYS_FCHDIR = 5079 SYS_RENAME = 5080 SYS_MKDIR = 5081 SYS_RMDIR = 5082 SYS_CREAT = 5083 SYS_LINK = 5084 SYS_UNLINK = 5085 SYS_SYMLINK = 5086 SYS_READLINK = 5087 SYS_CHMOD = 5088 SYS_FCHMOD = 5089 SYS_CHOWN = 5090 SYS_FCHOWN = 5091 SYS_LCHOWN = 5092 SYS_UMASK = 5093 SYS_GETTIMEOFDAY = 5094 SYS_GETRLIMIT = 5095 SYS_GETRUSAGE = 5096 SYS_SYSINFO = 5097 SYS_TIMES = 5098 SYS_PTRACE = 5099 SYS_GETUID = 5100 SYS_SYSLOG = 5101 SYS_GETGID = 5102 SYS_SETUID = 5103 SYS_SETGID = 5104 SYS_GETEUID = 5105 SYS_GETEGID = 5106 SYS_SETPGID = 5107 SYS_GETPPID = 5108 SYS_GETPGRP = 5109 SYS_SETSID = 5110 SYS_SETREUID = 5111 SYS_SETREGID = 5112 SYS_GETGROUPS = 5113 SYS_SETGROUPS = 5114 SYS_SETRESUID = 5115 SYS_GETRESUID = 5116 SYS_SETRESGID = 5117 SYS_GETRESGID = 5118 SYS_GETPGID = 5119 SYS_SETFSUID = 5120 SYS_SETFSGID = 5121 SYS_GETSID = 5122 SYS_CAPGET = 5123 SYS_CAPSET = 5124 SYS_RT_SIGPENDING = 5125 SYS_RT_SIGTIMEDWAIT = 5126 SYS_RT_SIGQUEUEINFO = 5127 SYS_RT_SIGSUSPEND = 5128 SYS_SIGALTSTACK = 5129 SYS_UTIME = 5130 SYS_MKNOD = 5131 SYS_PERSONALITY = 5132 SYS_USTAT = 5133 SYS_STATFS = 5134 SYS_FSTATFS = 5135 SYS_SYSFS = 5136 SYS_GETPRIORITY = 5137 SYS_SETPRIORITY = 5138 SYS_SCHED_SETPARAM = 5139 SYS_SCHED_GETPARAM = 5140 SYS_SCHED_SETSCHEDULER = 5141 SYS_SCHED_GETSCHEDULER = 5142 SYS_SCHED_GET_PRIORITY_MAX = 5143 SYS_SCHED_GET_PRIORITY_MIN = 5144 SYS_SCHED_RR_GET_INTERVAL = 5145 SYS_MLOCK = 5146 SYS_MUNLOCK = 5147 SYS_MLOCKALL = 5148 SYS_MUNLOCKALL = 5149 SYS_VHANGUP = 5150 SYS_PIVOT_ROOT = 5151 SYS__SYSCTL = 5152 SYS_PRCTL = 5153 SYS_ADJTIMEX = 5154 SYS_SETRLIMIT = 5155 SYS_CHROOT = 5156 SYS_SYNC = 5157 SYS_ACCT = 5158 SYS_SETTIMEOFDAY = 5159 SYS_MOUNT = 5160 SYS_UMOUNT2 = 5161 SYS_SWAPON = 5162 SYS_SWAPOFF = 5163 SYS_REBOOT = 5164 SYS_SETHOSTNAME = 5165 SYS_SETDOMAINNAME = 5166 SYS_CREATE_MODULE = 5167 SYS_INIT_MODULE = 5168 SYS_DELETE_MODULE = 5169 SYS_GET_KERNEL_SYMS = 5170 SYS_QUERY_MODULE = 5171 SYS_QUOTACTL = 5172 SYS_NFSSERVCTL = 5173 SYS_GETPMSG = 5174 SYS_PUTPMSG = 5175 SYS_AFS_SYSCALL = 5176 SYS_RESERVED177 = 5177 SYS_GETTID = 5178 SYS_READAHEAD = 5179 SYS_SETXATTR = 5180 SYS_LSETXATTR = 5181 SYS_FSETXATTR = 5182 SYS_GETXATTR = 5183 SYS_LGETXATTR = 5184 SYS_FGETXATTR = 5185 SYS_LISTXATTR = 5186 SYS_LLISTXATTR = 5187 SYS_FLISTXATTR = 5188 SYS_REMOVEXATTR = 5189 SYS_LREMOVEXATTR = 5190 SYS_FREMOVEXATTR = 5191 SYS_TKILL = 5192 SYS_RESERVED193 = 5193 SYS_FUTEX = 5194 SYS_SCHED_SETAFFINITY = 5195 SYS_SCHED_GETAFFINITY = 5196 SYS_CACHEFLUSH = 5197 SYS_CACHECTL = 5198 SYS_SYSMIPS = 5199 SYS_IO_SETUP = 5200 SYS_IO_DESTROY = 5201 SYS_IO_GETEVENTS = 5202 SYS_IO_SUBMIT = 5203 SYS_IO_CANCEL = 5204 SYS_EXIT_GROUP = 5205 SYS_LOOKUP_DCOOKIE = 5206 SYS_EPOLL_CREATE = 5207 SYS_EPOLL_CTL = 5208 SYS_EPOLL_WAIT = 5209 SYS_REMAP_FILE_PAGES = 5210 SYS_RT_SIGRETURN = 5211 SYS_SET_TID_ADDRESS = 5212 SYS_RESTART_SYSCALL = 5213 SYS_SEMTIMEDOP = 5214 SYS_FADVISE64 = 5215 SYS_TIMER_CREATE = 5216 SYS_TIMER_SETTIME = 5217 SYS_TIMER_GETTIME = 5218 SYS_TIMER_GETOVERRUN = 5219 SYS_TIMER_DELETE = 5220 SYS_CLOCK_SETTIME = 5221 SYS_CLOCK_GETTIME = 5222 SYS_CLOCK_GETRES = 5223 SYS_CLOCK_NANOSLEEP = 5224 SYS_TGKILL = 5225 SYS_UTIMES = 5226 SYS_MBIND = 5227 SYS_GET_MEMPOLICY = 5228 SYS_SET_MEMPOLICY = 5229 SYS_MQ_OPEN = 5230 SYS_MQ_UNLINK = 5231 SYS_MQ_TIMEDSEND = 5232 SYS_MQ_TIMEDRECEIVE = 5233 SYS_MQ_NOTIFY = 5234 SYS_MQ_GETSETATTR = 5235 SYS_VSERVER = 5236 SYS_WAITID = 5237 SYS_ADD_KEY = 5239 SYS_REQUEST_KEY = 5240 SYS_KEYCTL = 5241 SYS_SET_THREAD_AREA = 5242 SYS_INOTIFY_INIT = 5243 SYS_INOTIFY_ADD_WATCH = 5244 SYS_INOTIFY_RM_WATCH = 5245 SYS_MIGRATE_PAGES = 5246 SYS_OPENAT = 5247 SYS_MKDIRAT = 5248 SYS_MKNODAT = 5249 SYS_FCHOWNAT = 5250 SYS_FUTIMESAT = 5251 SYS_NEWFSTATAT = 5252 SYS_UNLINKAT = 5253 SYS_RENAMEAT = 5254 SYS_LINKAT = 5255 SYS_SYMLINKAT = 5256 SYS_READLINKAT = 5257 SYS_FCHMODAT = 5258 SYS_FACCESSAT = 5259 SYS_PSELECT6 = 5260 SYS_PPOLL = 5261 SYS_UNSHARE = 5262 SYS_SPLICE = 5263 SYS_SYNC_FILE_RANGE = 5264 SYS_TEE = 5265 SYS_VMSPLICE = 5266 SYS_MOVE_PAGES = 5267 SYS_SET_ROBUST_LIST = 5268 SYS_GET_ROBUST_LIST = 5269 SYS_KEXEC_LOAD = 5270 SYS_GETCPU = 5271 SYS_EPOLL_PWAIT = 5272 SYS_IOPRIO_SET = 5273 SYS_IOPRIO_GET = 5274 SYS_UTIMENSAT = 5275 SYS_SIGNALFD = 5276 SYS_TIMERFD = 5277 SYS_EVENTFD = 5278 SYS_FALLOCATE = 5279 SYS_TIMERFD_CREATE = 5280 SYS_TIMERFD_GETTIME = 5281 SYS_TIMERFD_SETTIME = 5282 SYS_SIGNALFD4 = 5283 SYS_EVENTFD2 = 5284 SYS_EPOLL_CREATE1 = 5285 SYS_DUP3 = 5286 SYS_PIPE2 = 5287 SYS_INOTIFY_INIT1 = 5288 SYS_PREADV = 5289 SYS_PWRITEV = 5290 SYS_RT_TGSIGQUEUEINFO = 5291 SYS_PERF_EVENT_OPEN = 5292 SYS_ACCEPT4 = 5293 SYS_RECVMMSG = 5294 SYS_FANOTIFY_INIT = 5295 SYS_FANOTIFY_MARK = 5296 SYS_PRLIMIT64 = 5297 SYS_NAME_TO_HANDLE_AT = 5298 SYS_OPEN_BY_HANDLE_AT = 5299 SYS_CLOCK_ADJTIME = 5300 SYS_SYNCFS = 5301 SYS_SENDMMSG = 5302 SYS_SETNS = 5303 SYS_PROCESS_VM_READV = 5304 SYS_PROCESS_VM_WRITEV = 5305 SYS_KCMP = 5306 SYS_FINIT_MODULE = 5307 SYS_GETDENTS64 = 5308 SYS_SCHED_SETATTR = 5309 SYS_SCHED_GETATTR = 5310 SYS_RENAMEAT2 = 5311 SYS_SECCOMP = 5312 SYS_GETRANDOM = 5313 SYS_MEMFD_CREATE = 5314 SYS_BPF = 5315 SYS_EXECVEAT = 5316 SYS_USERFAULTFD = 5317 SYS_MEMBARRIER = 5318 SYS_MLOCK2 = 5319 SYS_COPY_FILE_RANGE = 5320 SYS_PREADV2 = 5321 SYS_PWRITEV2 = 5322 SYS_PKEY_MPROTECT = 5323 SYS_PKEY_ALLOC = 5324 SYS_PKEY_FREE = 5325 SYS_STATX = 5326 SYS_RSEQ = 5327 SYS_IO_PGETEVENTS = 5328 SYS_PIDFD_SEND_SIGNAL = 5424 SYS_IO_URING_SETUP = 5425 SYS_IO_URING_ENTER = 5426 SYS_IO_URING_REGISTER = 5427 SYS_OPEN_TREE = 5428 SYS_MOVE_MOUNT = 5429 SYS_FSOPEN = 5430 SYS_FSCONFIG = 5431 SYS_FSMOUNT = 5432 SYS_FSPICK = 5433 SYS_PIDFD_OPEN = 5434 SYS_CLONE3 = 5435 SYS_CLOSE_RANGE = 5436 SYS_OPENAT2 = 5437 SYS_PIDFD_GETFD = 5438 SYS_FACCESSAT2 = 5439 SYS_PROCESS_MADVISE = 5440 SYS_EPOLL_PWAIT2 = 5441 SYS_MOUNT_SETATTR = 5442 SYS_QUOTACTL_FD = 5443 SYS_LANDLOCK_CREATE_RULESET = 5444 SYS_LANDLOCK_ADD_RULE = 5445 SYS_LANDLOCK_RESTRICT_SELF = 5446 SYS_PROCESS_MRELEASE = 5448 SYS_FUTEX_WAITV = 5449 SYS_SET_MEMPOLICY_HOME_NODE = 5450 SYS_CACHESTAT = 5451 SYS_FCHMODAT2 = 5452 SYS_MAP_SHADOW_STACK = 5453 SYS_FUTEX_WAKE = 5454 SYS_FUTEX_WAIT = 5455 SYS_FUTEX_REQUEUE = 5456 SYS_STATMOUNT = 5457 SYS_LISTMOUNT = 5458 SYS_LSM_GET_SELF_ATTR = 5459 SYS_LSM_SET_SELF_ATTR = 5460 SYS_LSM_LIST_MODULES = 5461 SYS_MSEAL = 5462 SYS_SETXATTRAT = 5463 SYS_GETXATTRAT = 5464 SYS_LISTXATTRAT = 5465 SYS_REMOVEXATTRAT = 5466 SYS_OPEN_TREE_ATTR = 5467 ) ================================================ FILE: vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go ================================================ // go run linux/mksysnum.go -Wall -Werror -static -I/tmp/mipsle/include /tmp/mipsle/include/asm/unistd.h // Code generated by the command above; see README.md. DO NOT EDIT. //go:build mipsle && linux package unix const ( SYS_SYSCALL = 4000 SYS_EXIT = 4001 SYS_FORK = 4002 SYS_READ = 4003 SYS_WRITE = 4004 SYS_OPEN = 4005 SYS_CLOSE = 4006 SYS_WAITPID = 4007 SYS_CREAT = 4008 SYS_LINK = 4009 SYS_UNLINK = 4010 SYS_EXECVE = 4011 SYS_CHDIR = 4012 SYS_TIME = 4013 SYS_MKNOD = 4014 SYS_CHMOD = 4015 SYS_LCHOWN = 4016 SYS_BREAK = 4017 SYS_UNUSED18 = 4018 SYS_LSEEK = 4019 SYS_GETPID = 4020 SYS_MOUNT = 4021 SYS_UMOUNT = 4022 SYS_SETUID = 4023 SYS_GETUID = 4024 SYS_STIME = 4025 SYS_PTRACE = 4026 SYS_ALARM = 4027 SYS_UNUSED28 = 4028 SYS_PAUSE = 4029 SYS_UTIME = 4030 SYS_STTY = 4031 SYS_GTTY = 4032 SYS_ACCESS = 4033 SYS_NICE = 4034 SYS_FTIME = 4035 SYS_SYNC = 4036 SYS_KILL = 4037 SYS_RENAME = 4038 SYS_MKDIR = 4039 SYS_RMDIR = 4040 SYS_DUP = 4041 SYS_PIPE = 4042 SYS_TIMES = 4043 SYS_PROF = 4044 SYS_BRK = 4045 SYS_SETGID = 4046 SYS_GETGID = 4047 SYS_SIGNAL = 4048 SYS_GETEUID = 4049 SYS_GETEGID = 4050 SYS_ACCT = 4051 SYS_UMOUNT2 = 4052 SYS_LOCK = 4053 SYS_IOCTL = 4054 SYS_FCNTL = 4055 SYS_MPX = 4056 SYS_SETPGID = 4057 SYS_ULIMIT = 4058 SYS_UNUSED59 = 4059 SYS_UMASK = 4060 SYS_CHROOT = 4061 SYS_USTAT = 4062 SYS_DUP2 = 4063 SYS_GETPPID = 4064 SYS_GETPGRP = 4065 SYS_SETSID = 4066 SYS_SIGACTION = 4067 SYS_SGETMASK = 4068 SYS_SSETMASK = 4069 SYS_SETREUID = 4070 SYS_SETREGID = 4071 SYS_SIGSUSPEND = 4072 SYS_SIGPENDING = 4073 SYS_SETHOSTNAME = 4074 SYS_SETRLIMIT = 4075 SYS_GETRLIMIT = 4076 SYS_GETRUSAGE = 4077 SYS_GETTIMEOFDAY = 4078 SYS_SETTIMEOFDAY = 4079 SYS_GETGROUPS = 4080 SYS_SETGROUPS = 4081 SYS_RESERVED82 = 4082 SYS_SYMLINK = 4083 SYS_UNUSED84 = 4084 SYS_READLINK = 4085 SYS_USELIB = 4086 SYS_SWAPON = 4087 SYS_REBOOT = 4088 SYS_READDIR = 4089 SYS_MMAP = 4090 SYS_MUNMAP = 4091 SYS_TRUNCATE = 4092 SYS_FTRUNCATE = 4093 SYS_FCHMOD = 4094 SYS_FCHOWN = 4095 SYS_GETPRIORITY = 4096 SYS_SETPRIORITY = 4097 SYS_PROFIL = 4098 SYS_STATFS = 4099 SYS_FSTATFS = 4100 SYS_IOPERM = 4101 SYS_SOCKETCALL = 4102 SYS_SYSLOG = 4103 SYS_SETITIMER = 4104 SYS_GETITIMER = 4105 SYS_STAT = 4106 SYS_LSTAT = 4107 SYS_FSTAT = 4108 SYS_UNUSED109 = 4109 SYS_IOPL = 4110 SYS_VHANGUP = 4111 SYS_IDLE = 4112 SYS_VM86 = 4113 SYS_WAIT4 = 4114 SYS_SWAPOFF = 4115 SYS_SYSINFO = 4116 SYS_IPC = 4117 SYS_FSYNC = 4118 SYS_SIGRETURN = 4119 SYS_CLONE = 4120 SYS_SETDOMAINNAME = 4121 SYS_UNAME = 4122 SYS_MODIFY_LDT = 4123 SYS_ADJTIMEX = 4124 SYS_MPROTECT = 4125 SYS_SIGPROCMASK = 4126 SYS_CREATE_MODULE = 4127 SYS_INIT_MODULE = 4128 SYS_DELETE_MODULE = 4129 SYS_GET_KERNEL_SYMS = 4130 SYS_QUOTACTL = 4131 SYS_GETPGID = 4132 SYS_FCHDIR = 4133 SYS_BDFLUSH = 4134 SYS_SYSFS = 4135 SYS_PERSONALITY = 4136 SYS_AFS_SYSCALL = 4137 SYS_SETFSUID = 4138 SYS_SETFSGID = 4139 SYS__LLSEEK = 4140 SYS_GETDENTS = 4141 SYS__NEWSELECT = 4142 SYS_FLOCK = 4143 SYS_MSYNC = 4144 SYS_READV = 4145 SYS_WRITEV = 4146 SYS_CACHEFLUSH = 4147 SYS_CACHECTL = 4148 SYS_SYSMIPS = 4149 SYS_UNUSED150 = 4150 SYS_GETSID = 4151 SYS_FDATASYNC = 4152 SYS__SYSCTL = 4153 SYS_MLOCK = 4154 SYS_MUNLOCK = 4155 SYS_MLOCKALL = 4156 SYS_MUNLOCKALL = 4157 SYS_SCHED_SETPARAM = 4158 SYS_SCHED_GETPARAM = 4159 SYS_SCHED_SETSCHEDULER = 4160 SYS_SCHED_GETSCHEDULER = 4161 SYS_SCHED_YIELD = 4162 SYS_SCHED_GET_PRIORITY_MAX = 4163 SYS_SCHED_GET_PRIORITY_MIN = 4164 SYS_SCHED_RR_GET_INTERVAL = 4165 SYS_NANOSLEEP = 4166 SYS_MREMAP = 4167 SYS_ACCEPT = 4168 SYS_BIND = 4169 SYS_CONNECT = 4170 SYS_GETPEERNAME = 4171 SYS_GETSOCKNAME = 4172 SYS_GETSOCKOPT = 4173 SYS_LISTEN = 4174 SYS_RECV = 4175 SYS_RECVFROM = 4176 SYS_RECVMSG = 4177 SYS_SEND = 4178 SYS_SENDMSG = 4179 SYS_SENDTO = 4180 SYS_SETSOCKOPT = 4181 SYS_SHUTDOWN = 4182 SYS_SOCKET = 4183 SYS_SOCKETPAIR = 4184 SYS_SETRESUID = 4185 SYS_GETRESUID = 4186 SYS_QUERY_MODULE = 4187 SYS_POLL = 4188 SYS_NFSSERVCTL = 4189 SYS_SETRESGID = 4190 SYS_GETRESGID = 4191 SYS_PRCTL = 4192 SYS_RT_SIGRETURN = 4193 SYS_RT_SIGACTION = 4194 SYS_RT_SIGPROCMASK = 4195 SYS_RT_SIGPENDING = 4196 SYS_RT_SIGTIMEDWAIT = 4197 SYS_RT_SIGQUEUEINFO = 4198 SYS_RT_SIGSUSPEND = 4199 SYS_PREAD64 = 4200 SYS_PWRITE64 = 4201 SYS_CHOWN = 4202 SYS_GETCWD = 4203 SYS_CAPGET = 4204 SYS_CAPSET = 4205 SYS_SIGALTSTACK = 4206 SYS_SENDFILE = 4207 SYS_GETPMSG = 4208 SYS_PUTPMSG = 4209 SYS_MMAP2 = 4210 SYS_TRUNCATE64 = 4211 SYS_FTRUNCATE64 = 4212 SYS_STAT64 = 4213 SYS_LSTAT64 = 4214 SYS_FSTAT64 = 4215 SYS_PIVOT_ROOT = 4216 SYS_MINCORE = 4217 SYS_MADVISE = 4218 SYS_GETDENTS64 = 4219 SYS_FCNTL64 = 4220 SYS_RESERVED221 = 4221 SYS_GETTID = 4222 SYS_READAHEAD = 4223 SYS_SETXATTR = 4224 SYS_LSETXATTR = 4225 SYS_FSETXATTR = 4226 SYS_GETXATTR = 4227 SYS_LGETXATTR = 4228 SYS_FGETXATTR = 4229 SYS_LISTXATTR = 4230 SYS_LLISTXATTR = 4231 SYS_FLISTXATTR = 4232 SYS_REMOVEXATTR = 4233 SYS_LREMOVEXATTR = 4234 SYS_FREMOVEXATTR = 4235 SYS_TKILL = 4236 SYS_SENDFILE64 = 4237 SYS_FUTEX = 4238 SYS_SCHED_SETAFFINITY = 4239 SYS_SCHED_GETAFFINITY = 4240 SYS_IO_SETUP = 4241 SYS_IO_DESTROY = 4242 SYS_IO_GETEVENTS = 4243 SYS_IO_SUBMIT = 4244 SYS_IO_CANCEL = 4245 SYS_EXIT_GROUP = 4246 SYS_LOOKUP_DCOOKIE = 4247 SYS_EPOLL_CREATE = 4248 SYS_EPOLL_CTL = 4249 SYS_EPOLL_WAIT = 4250 SYS_REMAP_FILE_PAGES = 4251 SYS_SET_TID_ADDRESS = 4252 SYS_RESTART_SYSCALL = 4253 SYS_FADVISE64 = 4254 SYS_STATFS64 = 4255 SYS_FSTATFS64 = 4256 SYS_TIMER_CREATE = 4257 SYS_TIMER_SETTIME = 4258 SYS_TIMER_GETTIME = 4259 SYS_TIMER_GETOVERRUN = 4260 SYS_TIMER_DELETE = 4261 SYS_CLOCK_SETTIME = 4262 SYS_CLOCK_GETTIME = 4263 SYS_CLOCK_GETRES = 4264 SYS_CLOCK_NANOSLEEP = 4265 SYS_TGKILL = 4266 SYS_UTIMES = 4267 SYS_MBIND = 4268 SYS_GET_MEMPOLICY = 4269 SYS_SET_MEMPOLICY = 4270 SYS_MQ_OPEN = 4271 SYS_MQ_UNLINK = 4272 SYS_MQ_TIMEDSEND = 4273 SYS_MQ_TIMEDRECEIVE = 4274 SYS_MQ_NOTIFY = 4275 SYS_MQ_GETSETATTR = 4276 SYS_VSERVER = 4277 SYS_WAITID = 4278 SYS_ADD_KEY = 4280 SYS_REQUEST_KEY = 4281 SYS_KEYCTL = 4282 SYS_SET_THREAD_AREA = 4283 SYS_INOTIFY_INIT = 4284 SYS_INOTIFY_ADD_WATCH = 4285 SYS_INOTIFY_RM_WATCH = 4286 SYS_MIGRATE_PAGES = 4287 SYS_OPENAT = 4288 SYS_MKDIRAT = 4289 SYS_MKNODAT = 4290 SYS_FCHOWNAT = 4291 SYS_FUTIMESAT = 4292 SYS_FSTATAT64 = 4293 SYS_UNLINKAT = 4294 SYS_RENAMEAT = 4295 SYS_LINKAT = 4296 SYS_SYMLINKAT = 4297 SYS_READLINKAT = 4298 SYS_FCHMODAT = 4299 SYS_FACCESSAT = 4300 SYS_PSELECT6 = 4301 SYS_PPOLL = 4302 SYS_UNSHARE = 4303 SYS_SPLICE = 4304 SYS_SYNC_FILE_RANGE = 4305 SYS_TEE = 4306 SYS_VMSPLICE = 4307 SYS_MOVE_PAGES = 4308 SYS_SET_ROBUST_LIST = 4309 SYS_GET_ROBUST_LIST = 4310 SYS_KEXEC_LOAD = 4311 SYS_GETCPU = 4312 SYS_EPOLL_PWAIT = 4313 SYS_IOPRIO_SET = 4314 SYS_IOPRIO_GET = 4315 SYS_UTIMENSAT = 4316 SYS_SIGNALFD = 4317 SYS_TIMERFD = 4318 SYS_EVENTFD = 4319 SYS_FALLOCATE = 4320 SYS_TIMERFD_CREATE = 4321 SYS_TIMERFD_GETTIME = 4322 SYS_TIMERFD_SETTIME = 4323 SYS_SIGNALFD4 = 4324 SYS_EVENTFD2 = 4325 SYS_EPOLL_CREATE1 = 4326 SYS_DUP3 = 4327 SYS_PIPE2 = 4328 SYS_INOTIFY_INIT1 = 4329 SYS_PREADV = 4330 SYS_PWRITEV = 4331 SYS_RT_TGSIGQUEUEINFO = 4332 SYS_PERF_EVENT_OPEN = 4333 SYS_ACCEPT4 = 4334 SYS_RECVMMSG = 4335 SYS_FANOTIFY_INIT = 4336 SYS_FANOTIFY_MARK = 4337 SYS_PRLIMIT64 = 4338 SYS_NAME_TO_HANDLE_AT = 4339 SYS_OPEN_BY_HANDLE_AT = 4340 SYS_CLOCK_ADJTIME = 4341 SYS_SYNCFS = 4342 SYS_SENDMMSG = 4343 SYS_SETNS = 4344 SYS_PROCESS_VM_READV = 4345 SYS_PROCESS_VM_WRITEV = 4346 SYS_KCMP = 4347 SYS_FINIT_MODULE = 4348 SYS_SCHED_SETATTR = 4349 SYS_SCHED_GETATTR = 4350 SYS_RENAMEAT2 = 4351 SYS_SECCOMP = 4352 SYS_GETRANDOM = 4353 SYS_MEMFD_CREATE = 4354 SYS_BPF = 4355 SYS_EXECVEAT = 4356 SYS_USERFAULTFD = 4357 SYS_MEMBARRIER = 4358 SYS_MLOCK2 = 4359 SYS_COPY_FILE_RANGE = 4360 SYS_PREADV2 = 4361 SYS_PWRITEV2 = 4362 SYS_PKEY_MPROTECT = 4363 SYS_PKEY_ALLOC = 4364 SYS_PKEY_FREE = 4365 SYS_STATX = 4366 SYS_RSEQ = 4367 SYS_IO_PGETEVENTS = 4368 SYS_SEMGET = 4393 SYS_SEMCTL = 4394 SYS_SHMGET = 4395 SYS_SHMCTL = 4396 SYS_SHMAT = 4397 SYS_SHMDT = 4398 SYS_MSGGET = 4399 SYS_MSGSND = 4400 SYS_MSGRCV = 4401 SYS_MSGCTL = 4402 SYS_CLOCK_GETTIME64 = 4403 SYS_CLOCK_SETTIME64 = 4404 SYS_CLOCK_ADJTIME64 = 4405 SYS_CLOCK_GETRES_TIME64 = 4406 SYS_CLOCK_NANOSLEEP_TIME64 = 4407 SYS_TIMER_GETTIME64 = 4408 SYS_TIMER_SETTIME64 = 4409 SYS_TIMERFD_GETTIME64 = 4410 SYS_TIMERFD_SETTIME64 = 4411 SYS_UTIMENSAT_TIME64 = 4412 SYS_PSELECT6_TIME64 = 4413 SYS_PPOLL_TIME64 = 4414 SYS_IO_PGETEVENTS_TIME64 = 4416 SYS_RECVMMSG_TIME64 = 4417 SYS_MQ_TIMEDSEND_TIME64 = 4418 SYS_MQ_TIMEDRECEIVE_TIME64 = 4419 SYS_SEMTIMEDOP_TIME64 = 4420 SYS_RT_SIGTIMEDWAIT_TIME64 = 4421 SYS_FUTEX_TIME64 = 4422 SYS_SCHED_RR_GET_INTERVAL_TIME64 = 4423 SYS_PIDFD_SEND_SIGNAL = 4424 SYS_IO_URING_SETUP = 4425 SYS_IO_URING_ENTER = 4426 SYS_IO_URING_REGISTER = 4427 SYS_OPEN_TREE = 4428 SYS_MOVE_MOUNT = 4429 SYS_FSOPEN = 4430 SYS_FSCONFIG = 4431 SYS_FSMOUNT = 4432 SYS_FSPICK = 4433 SYS_PIDFD_OPEN = 4434 SYS_CLONE3 = 4435 SYS_CLOSE_RANGE = 4436 SYS_OPENAT2 = 4437 SYS_PIDFD_GETFD = 4438 SYS_FACCESSAT2 = 4439 SYS_PROCESS_MADVISE = 4440 SYS_EPOLL_PWAIT2 = 4441 SYS_MOUNT_SETATTR = 4442 SYS_QUOTACTL_FD = 4443 SYS_LANDLOCK_CREATE_RULESET = 4444 SYS_LANDLOCK_ADD_RULE = 4445 SYS_LANDLOCK_RESTRICT_SELF = 4446 SYS_PROCESS_MRELEASE = 4448 SYS_FUTEX_WAITV = 4449 SYS_SET_MEMPOLICY_HOME_NODE = 4450 SYS_CACHESTAT = 4451 SYS_FCHMODAT2 = 4452 SYS_MAP_SHADOW_STACK = 4453 SYS_FUTEX_WAKE = 4454 SYS_FUTEX_WAIT = 4455 SYS_FUTEX_REQUEUE = 4456 SYS_STATMOUNT = 4457 SYS_LISTMOUNT = 4458 SYS_LSM_GET_SELF_ATTR = 4459 SYS_LSM_SET_SELF_ATTR = 4460 SYS_LSM_LIST_MODULES = 4461 SYS_MSEAL = 4462 SYS_SETXATTRAT = 4463 SYS_GETXATTRAT = 4464 SYS_LISTXATTRAT = 4465 SYS_REMOVEXATTRAT = 4466 SYS_OPEN_TREE_ATTR = 4467 ) ================================================ FILE: vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go ================================================ // go run linux/mksysnum.go -Wall -Werror -static -I/tmp/ppc/include /tmp/ppc/include/asm/unistd.h // Code generated by the command above; see README.md. DO NOT EDIT. //go:build ppc && linux package unix const ( SYS_RESTART_SYSCALL = 0 SYS_EXIT = 1 SYS_FORK = 2 SYS_READ = 3 SYS_WRITE = 4 SYS_OPEN = 5 SYS_CLOSE = 6 SYS_WAITPID = 7 SYS_CREAT = 8 SYS_LINK = 9 SYS_UNLINK = 10 SYS_EXECVE = 11 SYS_CHDIR = 12 SYS_TIME = 13 SYS_MKNOD = 14 SYS_CHMOD = 15 SYS_LCHOWN = 16 SYS_BREAK = 17 SYS_OLDSTAT = 18 SYS_LSEEK = 19 SYS_GETPID = 20 SYS_MOUNT = 21 SYS_UMOUNT = 22 SYS_SETUID = 23 SYS_GETUID = 24 SYS_STIME = 25 SYS_PTRACE = 26 SYS_ALARM = 27 SYS_OLDFSTAT = 28 SYS_PAUSE = 29 SYS_UTIME = 30 SYS_STTY = 31 SYS_GTTY = 32 SYS_ACCESS = 33 SYS_NICE = 34 SYS_FTIME = 35 SYS_SYNC = 36 SYS_KILL = 37 SYS_RENAME = 38 SYS_MKDIR = 39 SYS_RMDIR = 40 SYS_DUP = 41 SYS_PIPE = 42 SYS_TIMES = 43 SYS_PROF = 44 SYS_BRK = 45 SYS_SETGID = 46 SYS_GETGID = 47 SYS_SIGNAL = 48 SYS_GETEUID = 49 SYS_GETEGID = 50 SYS_ACCT = 51 SYS_UMOUNT2 = 52 SYS_LOCK = 53 SYS_IOCTL = 54 SYS_FCNTL = 55 SYS_MPX = 56 SYS_SETPGID = 57 SYS_ULIMIT = 58 SYS_OLDOLDUNAME = 59 SYS_UMASK = 60 SYS_CHROOT = 61 SYS_USTAT = 62 SYS_DUP2 = 63 SYS_GETPPID = 64 SYS_GETPGRP = 65 SYS_SETSID = 66 SYS_SIGACTION = 67 SYS_SGETMASK = 68 SYS_SSETMASK = 69 SYS_SETREUID = 70 SYS_SETREGID = 71 SYS_SIGSUSPEND = 72 SYS_SIGPENDING = 73 SYS_SETHOSTNAME = 74 SYS_SETRLIMIT = 75 SYS_GETRLIMIT = 76 SYS_GETRUSAGE = 77 SYS_GETTIMEOFDAY = 78 SYS_SETTIMEOFDAY = 79 SYS_GETGROUPS = 80 SYS_SETGROUPS = 81 SYS_SELECT = 82 SYS_SYMLINK = 83 SYS_OLDLSTAT = 84 SYS_READLINK = 85 SYS_USELIB = 86 SYS_SWAPON = 87 SYS_REBOOT = 88 SYS_READDIR = 89 SYS_MMAP = 90 SYS_MUNMAP = 91 SYS_TRUNCATE = 92 SYS_FTRUNCATE = 93 SYS_FCHMOD = 94 SYS_FCHOWN = 95 SYS_GETPRIORITY = 96 SYS_SETPRIORITY = 97 SYS_PROFIL = 98 SYS_STATFS = 99 SYS_FSTATFS = 100 SYS_IOPERM = 101 SYS_SOCKETCALL = 102 SYS_SYSLOG = 103 SYS_SETITIMER = 104 SYS_GETITIMER = 105 SYS_STAT = 106 SYS_LSTAT = 107 SYS_FSTAT = 108 SYS_OLDUNAME = 109 SYS_IOPL = 110 SYS_VHANGUP = 111 SYS_IDLE = 112 SYS_VM86 = 113 SYS_WAIT4 = 114 SYS_SWAPOFF = 115 SYS_SYSINFO = 116 SYS_IPC = 117 SYS_FSYNC = 118 SYS_SIGRETURN = 119 SYS_CLONE = 120 SYS_SETDOMAINNAME = 121 SYS_UNAME = 122 SYS_MODIFY_LDT = 123 SYS_ADJTIMEX = 124 SYS_MPROTECT = 125 SYS_SIGPROCMASK = 126 SYS_CREATE_MODULE = 127 SYS_INIT_MODULE = 128 SYS_DELETE_MODULE = 129 SYS_GET_KERNEL_SYMS = 130 SYS_QUOTACTL = 131 SYS_GETPGID = 132 SYS_FCHDIR = 133 SYS_BDFLUSH = 134 SYS_SYSFS = 135 SYS_PERSONALITY = 136 SYS_AFS_SYSCALL = 137 SYS_SETFSUID = 138 SYS_SETFSGID = 139 SYS__LLSEEK = 140 SYS_GETDENTS = 141 SYS__NEWSELECT = 142 SYS_FLOCK = 143 SYS_MSYNC = 144 SYS_READV = 145 SYS_WRITEV = 146 SYS_GETSID = 147 SYS_FDATASYNC = 148 SYS__SYSCTL = 149 SYS_MLOCK = 150 SYS_MUNLOCK = 151 SYS_MLOCKALL = 152 SYS_MUNLOCKALL = 153 SYS_SCHED_SETPARAM = 154 SYS_SCHED_GETPARAM = 155 SYS_SCHED_SETSCHEDULER = 156 SYS_SCHED_GETSCHEDULER = 157 SYS_SCHED_YIELD = 158 SYS_SCHED_GET_PRIORITY_MAX = 159 SYS_SCHED_GET_PRIORITY_MIN = 160 SYS_SCHED_RR_GET_INTERVAL = 161 SYS_NANOSLEEP = 162 SYS_MREMAP = 163 SYS_SETRESUID = 164 SYS_GETRESUID = 165 SYS_QUERY_MODULE = 166 SYS_POLL = 167 SYS_NFSSERVCTL = 168 SYS_SETRESGID = 169 SYS_GETRESGID = 170 SYS_PRCTL = 171 SYS_RT_SIGRETURN = 172 SYS_RT_SIGACTION = 173 SYS_RT_SIGPROCMASK = 174 SYS_RT_SIGPENDING = 175 SYS_RT_SIGTIMEDWAIT = 176 SYS_RT_SIGQUEUEINFO = 177 SYS_RT_SIGSUSPEND = 178 SYS_PREAD64 = 179 SYS_PWRITE64 = 180 SYS_CHOWN = 181 SYS_GETCWD = 182 SYS_CAPGET = 183 SYS_CAPSET = 184 SYS_SIGALTSTACK = 185 SYS_SENDFILE = 186 SYS_GETPMSG = 187 SYS_PUTPMSG = 188 SYS_VFORK = 189 SYS_UGETRLIMIT = 190 SYS_READAHEAD = 191 SYS_MMAP2 = 192 SYS_TRUNCATE64 = 193 SYS_FTRUNCATE64 = 194 SYS_STAT64 = 195 SYS_LSTAT64 = 196 SYS_FSTAT64 = 197 SYS_PCICONFIG_READ = 198 SYS_PCICONFIG_WRITE = 199 SYS_PCICONFIG_IOBASE = 200 SYS_MULTIPLEXER = 201 SYS_GETDENTS64 = 202 SYS_PIVOT_ROOT = 203 SYS_FCNTL64 = 204 SYS_MADVISE = 205 SYS_MINCORE = 206 SYS_GETTID = 207 SYS_TKILL = 208 SYS_SETXATTR = 209 SYS_LSETXATTR = 210 SYS_FSETXATTR = 211 SYS_GETXATTR = 212 SYS_LGETXATTR = 213 SYS_FGETXATTR = 214 SYS_LISTXATTR = 215 SYS_LLISTXATTR = 216 SYS_FLISTXATTR = 217 SYS_REMOVEXATTR = 218 SYS_LREMOVEXATTR = 219 SYS_FREMOVEXATTR = 220 SYS_FUTEX = 221 SYS_SCHED_SETAFFINITY = 222 SYS_SCHED_GETAFFINITY = 223 SYS_TUXCALL = 225 SYS_SENDFILE64 = 226 SYS_IO_SETUP = 227 SYS_IO_DESTROY = 228 SYS_IO_GETEVENTS = 229 SYS_IO_SUBMIT = 230 SYS_IO_CANCEL = 231 SYS_SET_TID_ADDRESS = 232 SYS_FADVISE64 = 233 SYS_EXIT_GROUP = 234 SYS_LOOKUP_DCOOKIE = 235 SYS_EPOLL_CREATE = 236 SYS_EPOLL_CTL = 237 SYS_EPOLL_WAIT = 238 SYS_REMAP_FILE_PAGES = 239 SYS_TIMER_CREATE = 240 SYS_TIMER_SETTIME = 241 SYS_TIMER_GETTIME = 242 SYS_TIMER_GETOVERRUN = 243 SYS_TIMER_DELETE = 244 SYS_CLOCK_SETTIME = 245 SYS_CLOCK_GETTIME = 246 SYS_CLOCK_GETRES = 247 SYS_CLOCK_NANOSLEEP = 248 SYS_SWAPCONTEXT = 249 SYS_TGKILL = 250 SYS_UTIMES = 251 SYS_STATFS64 = 252 SYS_FSTATFS64 = 253 SYS_FADVISE64_64 = 254 SYS_RTAS = 255 SYS_SYS_DEBUG_SETCONTEXT = 256 SYS_MIGRATE_PAGES = 258 SYS_MBIND = 259 SYS_GET_MEMPOLICY = 260 SYS_SET_MEMPOLICY = 261 SYS_MQ_OPEN = 262 SYS_MQ_UNLINK = 263 SYS_MQ_TIMEDSEND = 264 SYS_MQ_TIMEDRECEIVE = 265 SYS_MQ_NOTIFY = 266 SYS_MQ_GETSETATTR = 267 SYS_KEXEC_LOAD = 268 SYS_ADD_KEY = 269 SYS_REQUEST_KEY = 270 SYS_KEYCTL = 271 SYS_WAITID = 272 SYS_IOPRIO_SET = 273 SYS_IOPRIO_GET = 274 SYS_INOTIFY_INIT = 275 SYS_INOTIFY_ADD_WATCH = 276 SYS_INOTIFY_RM_WATCH = 277 SYS_SPU_RUN = 278 SYS_SPU_CREATE = 279 SYS_PSELECT6 = 280 SYS_PPOLL = 281 SYS_UNSHARE = 282 SYS_SPLICE = 283 SYS_TEE = 284 SYS_VMSPLICE = 285 SYS_OPENAT = 286 SYS_MKDIRAT = 287 SYS_MKNODAT = 288 SYS_FCHOWNAT = 289 SYS_FUTIMESAT = 290 SYS_FSTATAT64 = 291 SYS_UNLINKAT = 292 SYS_RENAMEAT = 293 SYS_LINKAT = 294 SYS_SYMLINKAT = 295 SYS_READLINKAT = 296 SYS_FCHMODAT = 297 SYS_FACCESSAT = 298 SYS_GET_ROBUST_LIST = 299 SYS_SET_ROBUST_LIST = 300 SYS_MOVE_PAGES = 301 SYS_GETCPU = 302 SYS_EPOLL_PWAIT = 303 SYS_UTIMENSAT = 304 SYS_SIGNALFD = 305 SYS_TIMERFD_CREATE = 306 SYS_EVENTFD = 307 SYS_SYNC_FILE_RANGE2 = 308 SYS_FALLOCATE = 309 SYS_SUBPAGE_PROT = 310 SYS_TIMERFD_SETTIME = 311 SYS_TIMERFD_GETTIME = 312 SYS_SIGNALFD4 = 313 SYS_EVENTFD2 = 314 SYS_EPOLL_CREATE1 = 315 SYS_DUP3 = 316 SYS_PIPE2 = 317 SYS_INOTIFY_INIT1 = 318 SYS_PERF_EVENT_OPEN = 319 SYS_PREADV = 320 SYS_PWRITEV = 321 SYS_RT_TGSIGQUEUEINFO = 322 SYS_FANOTIFY_INIT = 323 SYS_FANOTIFY_MARK = 324 SYS_PRLIMIT64 = 325 SYS_SOCKET = 326 SYS_BIND = 327 SYS_CONNECT = 328 SYS_LISTEN = 329 SYS_ACCEPT = 330 SYS_GETSOCKNAME = 331 SYS_GETPEERNAME = 332 SYS_SOCKETPAIR = 333 SYS_SEND = 334 SYS_SENDTO = 335 SYS_RECV = 336 SYS_RECVFROM = 337 SYS_SHUTDOWN = 338 SYS_SETSOCKOPT = 339 SYS_GETSOCKOPT = 340 SYS_SENDMSG = 341 SYS_RECVMSG = 342 SYS_RECVMMSG = 343 SYS_ACCEPT4 = 344 SYS_NAME_TO_HANDLE_AT = 345 SYS_OPEN_BY_HANDLE_AT = 346 SYS_CLOCK_ADJTIME = 347 SYS_SYNCFS = 348 SYS_SENDMMSG = 349 SYS_SETNS = 350 SYS_PROCESS_VM_READV = 351 SYS_PROCESS_VM_WRITEV = 352 SYS_FINIT_MODULE = 353 SYS_KCMP = 354 SYS_SCHED_SETATTR = 355 SYS_SCHED_GETATTR = 356 SYS_RENAMEAT2 = 357 SYS_SECCOMP = 358 SYS_GETRANDOM = 359 SYS_MEMFD_CREATE = 360 SYS_BPF = 361 SYS_EXECVEAT = 362 SYS_SWITCH_ENDIAN = 363 SYS_USERFAULTFD = 364 SYS_MEMBARRIER = 365 SYS_MLOCK2 = 378 SYS_COPY_FILE_RANGE = 379 SYS_PREADV2 = 380 SYS_PWRITEV2 = 381 SYS_KEXEC_FILE_LOAD = 382 SYS_STATX = 383 SYS_PKEY_ALLOC = 384 SYS_PKEY_FREE = 385 SYS_PKEY_MPROTECT = 386 SYS_RSEQ = 387 SYS_IO_PGETEVENTS = 388 SYS_SEMGET = 393 SYS_SEMCTL = 394 SYS_SHMGET = 395 SYS_SHMCTL = 396 SYS_SHMAT = 397 SYS_SHMDT = 398 SYS_MSGGET = 399 SYS_MSGSND = 400 SYS_MSGRCV = 401 SYS_MSGCTL = 402 SYS_CLOCK_GETTIME64 = 403 SYS_CLOCK_SETTIME64 = 404 SYS_CLOCK_ADJTIME64 = 405 SYS_CLOCK_GETRES_TIME64 = 406 SYS_CLOCK_NANOSLEEP_TIME64 = 407 SYS_TIMER_GETTIME64 = 408 SYS_TIMER_SETTIME64 = 409 SYS_TIMERFD_GETTIME64 = 410 SYS_TIMERFD_SETTIME64 = 411 SYS_UTIMENSAT_TIME64 = 412 SYS_PSELECT6_TIME64 = 413 SYS_PPOLL_TIME64 = 414 SYS_IO_PGETEVENTS_TIME64 = 416 SYS_RECVMMSG_TIME64 = 417 SYS_MQ_TIMEDSEND_TIME64 = 418 SYS_MQ_TIMEDRECEIVE_TIME64 = 419 SYS_SEMTIMEDOP_TIME64 = 420 SYS_RT_SIGTIMEDWAIT_TIME64 = 421 SYS_FUTEX_TIME64 = 422 SYS_SCHED_RR_GET_INTERVAL_TIME64 = 423 SYS_PIDFD_SEND_SIGNAL = 424 SYS_IO_URING_SETUP = 425 SYS_IO_URING_ENTER = 426 SYS_IO_URING_REGISTER = 427 SYS_OPEN_TREE = 428 SYS_MOVE_MOUNT = 429 SYS_FSOPEN = 430 SYS_FSCONFIG = 431 SYS_FSMOUNT = 432 SYS_FSPICK = 433 SYS_PIDFD_OPEN = 434 SYS_CLONE3 = 435 SYS_CLOSE_RANGE = 436 SYS_OPENAT2 = 437 SYS_PIDFD_GETFD = 438 SYS_FACCESSAT2 = 439 SYS_PROCESS_MADVISE = 440 SYS_EPOLL_PWAIT2 = 441 SYS_MOUNT_SETATTR = 442 SYS_QUOTACTL_FD = 443 SYS_LANDLOCK_CREATE_RULESET = 444 SYS_LANDLOCK_ADD_RULE = 445 SYS_LANDLOCK_RESTRICT_SELF = 446 SYS_PROCESS_MRELEASE = 448 SYS_FUTEX_WAITV = 449 SYS_SET_MEMPOLICY_HOME_NODE = 450 SYS_CACHESTAT = 451 SYS_FCHMODAT2 = 452 SYS_MAP_SHADOW_STACK = 453 SYS_FUTEX_WAKE = 454 SYS_FUTEX_WAIT = 455 SYS_FUTEX_REQUEUE = 456 SYS_STATMOUNT = 457 SYS_LISTMOUNT = 458 SYS_LSM_GET_SELF_ATTR = 459 SYS_LSM_SET_SELF_ATTR = 460 SYS_LSM_LIST_MODULES = 461 SYS_MSEAL = 462 SYS_SETXATTRAT = 463 SYS_GETXATTRAT = 464 SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 SYS_OPEN_TREE_ATTR = 467 ) ================================================ FILE: vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go ================================================ // go run linux/mksysnum.go -Wall -Werror -static -I/tmp/ppc64/include /tmp/ppc64/include/asm/unistd.h // Code generated by the command above; see README.md. DO NOT EDIT. //go:build ppc64 && linux package unix const ( SYS_RESTART_SYSCALL = 0 SYS_EXIT = 1 SYS_FORK = 2 SYS_READ = 3 SYS_WRITE = 4 SYS_OPEN = 5 SYS_CLOSE = 6 SYS_WAITPID = 7 SYS_CREAT = 8 SYS_LINK = 9 SYS_UNLINK = 10 SYS_EXECVE = 11 SYS_CHDIR = 12 SYS_TIME = 13 SYS_MKNOD = 14 SYS_CHMOD = 15 SYS_LCHOWN = 16 SYS_BREAK = 17 SYS_OLDSTAT = 18 SYS_LSEEK = 19 SYS_GETPID = 20 SYS_MOUNT = 21 SYS_UMOUNT = 22 SYS_SETUID = 23 SYS_GETUID = 24 SYS_STIME = 25 SYS_PTRACE = 26 SYS_ALARM = 27 SYS_OLDFSTAT = 28 SYS_PAUSE = 29 SYS_UTIME = 30 SYS_STTY = 31 SYS_GTTY = 32 SYS_ACCESS = 33 SYS_NICE = 34 SYS_FTIME = 35 SYS_SYNC = 36 SYS_KILL = 37 SYS_RENAME = 38 SYS_MKDIR = 39 SYS_RMDIR = 40 SYS_DUP = 41 SYS_PIPE = 42 SYS_TIMES = 43 SYS_PROF = 44 SYS_BRK = 45 SYS_SETGID = 46 SYS_GETGID = 47 SYS_SIGNAL = 48 SYS_GETEUID = 49 SYS_GETEGID = 50 SYS_ACCT = 51 SYS_UMOUNT2 = 52 SYS_LOCK = 53 SYS_IOCTL = 54 SYS_FCNTL = 55 SYS_MPX = 56 SYS_SETPGID = 57 SYS_ULIMIT = 58 SYS_OLDOLDUNAME = 59 SYS_UMASK = 60 SYS_CHROOT = 61 SYS_USTAT = 62 SYS_DUP2 = 63 SYS_GETPPID = 64 SYS_GETPGRP = 65 SYS_SETSID = 66 SYS_SIGACTION = 67 SYS_SGETMASK = 68 SYS_SSETMASK = 69 SYS_SETREUID = 70 SYS_SETREGID = 71 SYS_SIGSUSPEND = 72 SYS_SIGPENDING = 73 SYS_SETHOSTNAME = 74 SYS_SETRLIMIT = 75 SYS_GETRLIMIT = 76 SYS_GETRUSAGE = 77 SYS_GETTIMEOFDAY = 78 SYS_SETTIMEOFDAY = 79 SYS_GETGROUPS = 80 SYS_SETGROUPS = 81 SYS_SELECT = 82 SYS_SYMLINK = 83 SYS_OLDLSTAT = 84 SYS_READLINK = 85 SYS_USELIB = 86 SYS_SWAPON = 87 SYS_REBOOT = 88 SYS_READDIR = 89 SYS_MMAP = 90 SYS_MUNMAP = 91 SYS_TRUNCATE = 92 SYS_FTRUNCATE = 93 SYS_FCHMOD = 94 SYS_FCHOWN = 95 SYS_GETPRIORITY = 96 SYS_SETPRIORITY = 97 SYS_PROFIL = 98 SYS_STATFS = 99 SYS_FSTATFS = 100 SYS_IOPERM = 101 SYS_SOCKETCALL = 102 SYS_SYSLOG = 103 SYS_SETITIMER = 104 SYS_GETITIMER = 105 SYS_STAT = 106 SYS_LSTAT = 107 SYS_FSTAT = 108 SYS_OLDUNAME = 109 SYS_IOPL = 110 SYS_VHANGUP = 111 SYS_IDLE = 112 SYS_VM86 = 113 SYS_WAIT4 = 114 SYS_SWAPOFF = 115 SYS_SYSINFO = 116 SYS_IPC = 117 SYS_FSYNC = 118 SYS_SIGRETURN = 119 SYS_CLONE = 120 SYS_SETDOMAINNAME = 121 SYS_UNAME = 122 SYS_MODIFY_LDT = 123 SYS_ADJTIMEX = 124 SYS_MPROTECT = 125 SYS_SIGPROCMASK = 126 SYS_CREATE_MODULE = 127 SYS_INIT_MODULE = 128 SYS_DELETE_MODULE = 129 SYS_GET_KERNEL_SYMS = 130 SYS_QUOTACTL = 131 SYS_GETPGID = 132 SYS_FCHDIR = 133 SYS_BDFLUSH = 134 SYS_SYSFS = 135 SYS_PERSONALITY = 136 SYS_AFS_SYSCALL = 137 SYS_SETFSUID = 138 SYS_SETFSGID = 139 SYS__LLSEEK = 140 SYS_GETDENTS = 141 SYS__NEWSELECT = 142 SYS_FLOCK = 143 SYS_MSYNC = 144 SYS_READV = 145 SYS_WRITEV = 146 SYS_GETSID = 147 SYS_FDATASYNC = 148 SYS__SYSCTL = 149 SYS_MLOCK = 150 SYS_MUNLOCK = 151 SYS_MLOCKALL = 152 SYS_MUNLOCKALL = 153 SYS_SCHED_SETPARAM = 154 SYS_SCHED_GETPARAM = 155 SYS_SCHED_SETSCHEDULER = 156 SYS_SCHED_GETSCHEDULER = 157 SYS_SCHED_YIELD = 158 SYS_SCHED_GET_PRIORITY_MAX = 159 SYS_SCHED_GET_PRIORITY_MIN = 160 SYS_SCHED_RR_GET_INTERVAL = 161 SYS_NANOSLEEP = 162 SYS_MREMAP = 163 SYS_SETRESUID = 164 SYS_GETRESUID = 165 SYS_QUERY_MODULE = 166 SYS_POLL = 167 SYS_NFSSERVCTL = 168 SYS_SETRESGID = 169 SYS_GETRESGID = 170 SYS_PRCTL = 171 SYS_RT_SIGRETURN = 172 SYS_RT_SIGACTION = 173 SYS_RT_SIGPROCMASK = 174 SYS_RT_SIGPENDING = 175 SYS_RT_SIGTIMEDWAIT = 176 SYS_RT_SIGQUEUEINFO = 177 SYS_RT_SIGSUSPEND = 178 SYS_PREAD64 = 179 SYS_PWRITE64 = 180 SYS_CHOWN = 181 SYS_GETCWD = 182 SYS_CAPGET = 183 SYS_CAPSET = 184 SYS_SIGALTSTACK = 185 SYS_SENDFILE = 186 SYS_GETPMSG = 187 SYS_PUTPMSG = 188 SYS_VFORK = 189 SYS_UGETRLIMIT = 190 SYS_READAHEAD = 191 SYS_PCICONFIG_READ = 198 SYS_PCICONFIG_WRITE = 199 SYS_PCICONFIG_IOBASE = 200 SYS_MULTIPLEXER = 201 SYS_GETDENTS64 = 202 SYS_PIVOT_ROOT = 203 SYS_MADVISE = 205 SYS_MINCORE = 206 SYS_GETTID = 207 SYS_TKILL = 208 SYS_SETXATTR = 209 SYS_LSETXATTR = 210 SYS_FSETXATTR = 211 SYS_GETXATTR = 212 SYS_LGETXATTR = 213 SYS_FGETXATTR = 214 SYS_LISTXATTR = 215 SYS_LLISTXATTR = 216 SYS_FLISTXATTR = 217 SYS_REMOVEXATTR = 218 SYS_LREMOVEXATTR = 219 SYS_FREMOVEXATTR = 220 SYS_FUTEX = 221 SYS_SCHED_SETAFFINITY = 222 SYS_SCHED_GETAFFINITY = 223 SYS_TUXCALL = 225 SYS_IO_SETUP = 227 SYS_IO_DESTROY = 228 SYS_IO_GETEVENTS = 229 SYS_IO_SUBMIT = 230 SYS_IO_CANCEL = 231 SYS_SET_TID_ADDRESS = 232 SYS_FADVISE64 = 233 SYS_EXIT_GROUP = 234 SYS_LOOKUP_DCOOKIE = 235 SYS_EPOLL_CREATE = 236 SYS_EPOLL_CTL = 237 SYS_EPOLL_WAIT = 238 SYS_REMAP_FILE_PAGES = 239 SYS_TIMER_CREATE = 240 SYS_TIMER_SETTIME = 241 SYS_TIMER_GETTIME = 242 SYS_TIMER_GETOVERRUN = 243 SYS_TIMER_DELETE = 244 SYS_CLOCK_SETTIME = 245 SYS_CLOCK_GETTIME = 246 SYS_CLOCK_GETRES = 247 SYS_CLOCK_NANOSLEEP = 248 SYS_SWAPCONTEXT = 249 SYS_TGKILL = 250 SYS_UTIMES = 251 SYS_STATFS64 = 252 SYS_FSTATFS64 = 253 SYS_RTAS = 255 SYS_SYS_DEBUG_SETCONTEXT = 256 SYS_MIGRATE_PAGES = 258 SYS_MBIND = 259 SYS_GET_MEMPOLICY = 260 SYS_SET_MEMPOLICY = 261 SYS_MQ_OPEN = 262 SYS_MQ_UNLINK = 263 SYS_MQ_TIMEDSEND = 264 SYS_MQ_TIMEDRECEIVE = 265 SYS_MQ_NOTIFY = 266 SYS_MQ_GETSETATTR = 267 SYS_KEXEC_LOAD = 268 SYS_ADD_KEY = 269 SYS_REQUEST_KEY = 270 SYS_KEYCTL = 271 SYS_WAITID = 272 SYS_IOPRIO_SET = 273 SYS_IOPRIO_GET = 274 SYS_INOTIFY_INIT = 275 SYS_INOTIFY_ADD_WATCH = 276 SYS_INOTIFY_RM_WATCH = 277 SYS_SPU_RUN = 278 SYS_SPU_CREATE = 279 SYS_PSELECT6 = 280 SYS_PPOLL = 281 SYS_UNSHARE = 282 SYS_SPLICE = 283 SYS_TEE = 284 SYS_VMSPLICE = 285 SYS_OPENAT = 286 SYS_MKDIRAT = 287 SYS_MKNODAT = 288 SYS_FCHOWNAT = 289 SYS_FUTIMESAT = 290 SYS_NEWFSTATAT = 291 SYS_UNLINKAT = 292 SYS_RENAMEAT = 293 SYS_LINKAT = 294 SYS_SYMLINKAT = 295 SYS_READLINKAT = 296 SYS_FCHMODAT = 297 SYS_FACCESSAT = 298 SYS_GET_ROBUST_LIST = 299 SYS_SET_ROBUST_LIST = 300 SYS_MOVE_PAGES = 301 SYS_GETCPU = 302 SYS_EPOLL_PWAIT = 303 SYS_UTIMENSAT = 304 SYS_SIGNALFD = 305 SYS_TIMERFD_CREATE = 306 SYS_EVENTFD = 307 SYS_SYNC_FILE_RANGE2 = 308 SYS_FALLOCATE = 309 SYS_SUBPAGE_PROT = 310 SYS_TIMERFD_SETTIME = 311 SYS_TIMERFD_GETTIME = 312 SYS_SIGNALFD4 = 313 SYS_EVENTFD2 = 314 SYS_EPOLL_CREATE1 = 315 SYS_DUP3 = 316 SYS_PIPE2 = 317 SYS_INOTIFY_INIT1 = 318 SYS_PERF_EVENT_OPEN = 319 SYS_PREADV = 320 SYS_PWRITEV = 321 SYS_RT_TGSIGQUEUEINFO = 322 SYS_FANOTIFY_INIT = 323 SYS_FANOTIFY_MARK = 324 SYS_PRLIMIT64 = 325 SYS_SOCKET = 326 SYS_BIND = 327 SYS_CONNECT = 328 SYS_LISTEN = 329 SYS_ACCEPT = 330 SYS_GETSOCKNAME = 331 SYS_GETPEERNAME = 332 SYS_SOCKETPAIR = 333 SYS_SEND = 334 SYS_SENDTO = 335 SYS_RECV = 336 SYS_RECVFROM = 337 SYS_SHUTDOWN = 338 SYS_SETSOCKOPT = 339 SYS_GETSOCKOPT = 340 SYS_SENDMSG = 341 SYS_RECVMSG = 342 SYS_RECVMMSG = 343 SYS_ACCEPT4 = 344 SYS_NAME_TO_HANDLE_AT = 345 SYS_OPEN_BY_HANDLE_AT = 346 SYS_CLOCK_ADJTIME = 347 SYS_SYNCFS = 348 SYS_SENDMMSG = 349 SYS_SETNS = 350 SYS_PROCESS_VM_READV = 351 SYS_PROCESS_VM_WRITEV = 352 SYS_FINIT_MODULE = 353 SYS_KCMP = 354 SYS_SCHED_SETATTR = 355 SYS_SCHED_GETATTR = 356 SYS_RENAMEAT2 = 357 SYS_SECCOMP = 358 SYS_GETRANDOM = 359 SYS_MEMFD_CREATE = 360 SYS_BPF = 361 SYS_EXECVEAT = 362 SYS_SWITCH_ENDIAN = 363 SYS_USERFAULTFD = 364 SYS_MEMBARRIER = 365 SYS_MLOCK2 = 378 SYS_COPY_FILE_RANGE = 379 SYS_PREADV2 = 380 SYS_PWRITEV2 = 381 SYS_KEXEC_FILE_LOAD = 382 SYS_STATX = 383 SYS_PKEY_ALLOC = 384 SYS_PKEY_FREE = 385 SYS_PKEY_MPROTECT = 386 SYS_RSEQ = 387 SYS_IO_PGETEVENTS = 388 SYS_SEMTIMEDOP = 392 SYS_SEMGET = 393 SYS_SEMCTL = 394 SYS_SHMGET = 395 SYS_SHMCTL = 396 SYS_SHMAT = 397 SYS_SHMDT = 398 SYS_MSGGET = 399 SYS_MSGSND = 400 SYS_MSGRCV = 401 SYS_MSGCTL = 402 SYS_PIDFD_SEND_SIGNAL = 424 SYS_IO_URING_SETUP = 425 SYS_IO_URING_ENTER = 426 SYS_IO_URING_REGISTER = 427 SYS_OPEN_TREE = 428 SYS_MOVE_MOUNT = 429 SYS_FSOPEN = 430 SYS_FSCONFIG = 431 SYS_FSMOUNT = 432 SYS_FSPICK = 433 SYS_PIDFD_OPEN = 434 SYS_CLONE3 = 435 SYS_CLOSE_RANGE = 436 SYS_OPENAT2 = 437 SYS_PIDFD_GETFD = 438 SYS_FACCESSAT2 = 439 SYS_PROCESS_MADVISE = 440 SYS_EPOLL_PWAIT2 = 441 SYS_MOUNT_SETATTR = 442 SYS_QUOTACTL_FD = 443 SYS_LANDLOCK_CREATE_RULESET = 444 SYS_LANDLOCK_ADD_RULE = 445 SYS_LANDLOCK_RESTRICT_SELF = 446 SYS_PROCESS_MRELEASE = 448 SYS_FUTEX_WAITV = 449 SYS_SET_MEMPOLICY_HOME_NODE = 450 SYS_CACHESTAT = 451 SYS_FCHMODAT2 = 452 SYS_MAP_SHADOW_STACK = 453 SYS_FUTEX_WAKE = 454 SYS_FUTEX_WAIT = 455 SYS_FUTEX_REQUEUE = 456 SYS_STATMOUNT = 457 SYS_LISTMOUNT = 458 SYS_LSM_GET_SELF_ATTR = 459 SYS_LSM_SET_SELF_ATTR = 460 SYS_LSM_LIST_MODULES = 461 SYS_MSEAL = 462 SYS_SETXATTRAT = 463 SYS_GETXATTRAT = 464 SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 SYS_OPEN_TREE_ATTR = 467 ) ================================================ FILE: vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go ================================================ // go run linux/mksysnum.go -Wall -Werror -static -I/tmp/ppc64le/include /tmp/ppc64le/include/asm/unistd.h // Code generated by the command above; see README.md. DO NOT EDIT. //go:build ppc64le && linux package unix const ( SYS_RESTART_SYSCALL = 0 SYS_EXIT = 1 SYS_FORK = 2 SYS_READ = 3 SYS_WRITE = 4 SYS_OPEN = 5 SYS_CLOSE = 6 SYS_WAITPID = 7 SYS_CREAT = 8 SYS_LINK = 9 SYS_UNLINK = 10 SYS_EXECVE = 11 SYS_CHDIR = 12 SYS_TIME = 13 SYS_MKNOD = 14 SYS_CHMOD = 15 SYS_LCHOWN = 16 SYS_BREAK = 17 SYS_OLDSTAT = 18 SYS_LSEEK = 19 SYS_GETPID = 20 SYS_MOUNT = 21 SYS_UMOUNT = 22 SYS_SETUID = 23 SYS_GETUID = 24 SYS_STIME = 25 SYS_PTRACE = 26 SYS_ALARM = 27 SYS_OLDFSTAT = 28 SYS_PAUSE = 29 SYS_UTIME = 30 SYS_STTY = 31 SYS_GTTY = 32 SYS_ACCESS = 33 SYS_NICE = 34 SYS_FTIME = 35 SYS_SYNC = 36 SYS_KILL = 37 SYS_RENAME = 38 SYS_MKDIR = 39 SYS_RMDIR = 40 SYS_DUP = 41 SYS_PIPE = 42 SYS_TIMES = 43 SYS_PROF = 44 SYS_BRK = 45 SYS_SETGID = 46 SYS_GETGID = 47 SYS_SIGNAL = 48 SYS_GETEUID = 49 SYS_GETEGID = 50 SYS_ACCT = 51 SYS_UMOUNT2 = 52 SYS_LOCK = 53 SYS_IOCTL = 54 SYS_FCNTL = 55 SYS_MPX = 56 SYS_SETPGID = 57 SYS_ULIMIT = 58 SYS_OLDOLDUNAME = 59 SYS_UMASK = 60 SYS_CHROOT = 61 SYS_USTAT = 62 SYS_DUP2 = 63 SYS_GETPPID = 64 SYS_GETPGRP = 65 SYS_SETSID = 66 SYS_SIGACTION = 67 SYS_SGETMASK = 68 SYS_SSETMASK = 69 SYS_SETREUID = 70 SYS_SETREGID = 71 SYS_SIGSUSPEND = 72 SYS_SIGPENDING = 73 SYS_SETHOSTNAME = 74 SYS_SETRLIMIT = 75 SYS_GETRLIMIT = 76 SYS_GETRUSAGE = 77 SYS_GETTIMEOFDAY = 78 SYS_SETTIMEOFDAY = 79 SYS_GETGROUPS = 80 SYS_SETGROUPS = 81 SYS_SELECT = 82 SYS_SYMLINK = 83 SYS_OLDLSTAT = 84 SYS_READLINK = 85 SYS_USELIB = 86 SYS_SWAPON = 87 SYS_REBOOT = 88 SYS_READDIR = 89 SYS_MMAP = 90 SYS_MUNMAP = 91 SYS_TRUNCATE = 92 SYS_FTRUNCATE = 93 SYS_FCHMOD = 94 SYS_FCHOWN = 95 SYS_GETPRIORITY = 96 SYS_SETPRIORITY = 97 SYS_PROFIL = 98 SYS_STATFS = 99 SYS_FSTATFS = 100 SYS_IOPERM = 101 SYS_SOCKETCALL = 102 SYS_SYSLOG = 103 SYS_SETITIMER = 104 SYS_GETITIMER = 105 SYS_STAT = 106 SYS_LSTAT = 107 SYS_FSTAT = 108 SYS_OLDUNAME = 109 SYS_IOPL = 110 SYS_VHANGUP = 111 SYS_IDLE = 112 SYS_VM86 = 113 SYS_WAIT4 = 114 SYS_SWAPOFF = 115 SYS_SYSINFO = 116 SYS_IPC = 117 SYS_FSYNC = 118 SYS_SIGRETURN = 119 SYS_CLONE = 120 SYS_SETDOMAINNAME = 121 SYS_UNAME = 122 SYS_MODIFY_LDT = 123 SYS_ADJTIMEX = 124 SYS_MPROTECT = 125 SYS_SIGPROCMASK = 126 SYS_CREATE_MODULE = 127 SYS_INIT_MODULE = 128 SYS_DELETE_MODULE = 129 SYS_GET_KERNEL_SYMS = 130 SYS_QUOTACTL = 131 SYS_GETPGID = 132 SYS_FCHDIR = 133 SYS_BDFLUSH = 134 SYS_SYSFS = 135 SYS_PERSONALITY = 136 SYS_AFS_SYSCALL = 137 SYS_SETFSUID = 138 SYS_SETFSGID = 139 SYS__LLSEEK = 140 SYS_GETDENTS = 141 SYS__NEWSELECT = 142 SYS_FLOCK = 143 SYS_MSYNC = 144 SYS_READV = 145 SYS_WRITEV = 146 SYS_GETSID = 147 SYS_FDATASYNC = 148 SYS__SYSCTL = 149 SYS_MLOCK = 150 SYS_MUNLOCK = 151 SYS_MLOCKALL = 152 SYS_MUNLOCKALL = 153 SYS_SCHED_SETPARAM = 154 SYS_SCHED_GETPARAM = 155 SYS_SCHED_SETSCHEDULER = 156 SYS_SCHED_GETSCHEDULER = 157 SYS_SCHED_YIELD = 158 SYS_SCHED_GET_PRIORITY_MAX = 159 SYS_SCHED_GET_PRIORITY_MIN = 160 SYS_SCHED_RR_GET_INTERVAL = 161 SYS_NANOSLEEP = 162 SYS_MREMAP = 163 SYS_SETRESUID = 164 SYS_GETRESUID = 165 SYS_QUERY_MODULE = 166 SYS_POLL = 167 SYS_NFSSERVCTL = 168 SYS_SETRESGID = 169 SYS_GETRESGID = 170 SYS_PRCTL = 171 SYS_RT_SIGRETURN = 172 SYS_RT_SIGACTION = 173 SYS_RT_SIGPROCMASK = 174 SYS_RT_SIGPENDING = 175 SYS_RT_SIGTIMEDWAIT = 176 SYS_RT_SIGQUEUEINFO = 177 SYS_RT_SIGSUSPEND = 178 SYS_PREAD64 = 179 SYS_PWRITE64 = 180 SYS_CHOWN = 181 SYS_GETCWD = 182 SYS_CAPGET = 183 SYS_CAPSET = 184 SYS_SIGALTSTACK = 185 SYS_SENDFILE = 186 SYS_GETPMSG = 187 SYS_PUTPMSG = 188 SYS_VFORK = 189 SYS_UGETRLIMIT = 190 SYS_READAHEAD = 191 SYS_PCICONFIG_READ = 198 SYS_PCICONFIG_WRITE = 199 SYS_PCICONFIG_IOBASE = 200 SYS_MULTIPLEXER = 201 SYS_GETDENTS64 = 202 SYS_PIVOT_ROOT = 203 SYS_MADVISE = 205 SYS_MINCORE = 206 SYS_GETTID = 207 SYS_TKILL = 208 SYS_SETXATTR = 209 SYS_LSETXATTR = 210 SYS_FSETXATTR = 211 SYS_GETXATTR = 212 SYS_LGETXATTR = 213 SYS_FGETXATTR = 214 SYS_LISTXATTR = 215 SYS_LLISTXATTR = 216 SYS_FLISTXATTR = 217 SYS_REMOVEXATTR = 218 SYS_LREMOVEXATTR = 219 SYS_FREMOVEXATTR = 220 SYS_FUTEX = 221 SYS_SCHED_SETAFFINITY = 222 SYS_SCHED_GETAFFINITY = 223 SYS_TUXCALL = 225 SYS_IO_SETUP = 227 SYS_IO_DESTROY = 228 SYS_IO_GETEVENTS = 229 SYS_IO_SUBMIT = 230 SYS_IO_CANCEL = 231 SYS_SET_TID_ADDRESS = 232 SYS_FADVISE64 = 233 SYS_EXIT_GROUP = 234 SYS_LOOKUP_DCOOKIE = 235 SYS_EPOLL_CREATE = 236 SYS_EPOLL_CTL = 237 SYS_EPOLL_WAIT = 238 SYS_REMAP_FILE_PAGES = 239 SYS_TIMER_CREATE = 240 SYS_TIMER_SETTIME = 241 SYS_TIMER_GETTIME = 242 SYS_TIMER_GETOVERRUN = 243 SYS_TIMER_DELETE = 244 SYS_CLOCK_SETTIME = 245 SYS_CLOCK_GETTIME = 246 SYS_CLOCK_GETRES = 247 SYS_CLOCK_NANOSLEEP = 248 SYS_SWAPCONTEXT = 249 SYS_TGKILL = 250 SYS_UTIMES = 251 SYS_STATFS64 = 252 SYS_FSTATFS64 = 253 SYS_RTAS = 255 SYS_SYS_DEBUG_SETCONTEXT = 256 SYS_MIGRATE_PAGES = 258 SYS_MBIND = 259 SYS_GET_MEMPOLICY = 260 SYS_SET_MEMPOLICY = 261 SYS_MQ_OPEN = 262 SYS_MQ_UNLINK = 263 SYS_MQ_TIMEDSEND = 264 SYS_MQ_TIMEDRECEIVE = 265 SYS_MQ_NOTIFY = 266 SYS_MQ_GETSETATTR = 267 SYS_KEXEC_LOAD = 268 SYS_ADD_KEY = 269 SYS_REQUEST_KEY = 270 SYS_KEYCTL = 271 SYS_WAITID = 272 SYS_IOPRIO_SET = 273 SYS_IOPRIO_GET = 274 SYS_INOTIFY_INIT = 275 SYS_INOTIFY_ADD_WATCH = 276 SYS_INOTIFY_RM_WATCH = 277 SYS_SPU_RUN = 278 SYS_SPU_CREATE = 279 SYS_PSELECT6 = 280 SYS_PPOLL = 281 SYS_UNSHARE = 282 SYS_SPLICE = 283 SYS_TEE = 284 SYS_VMSPLICE = 285 SYS_OPENAT = 286 SYS_MKDIRAT = 287 SYS_MKNODAT = 288 SYS_FCHOWNAT = 289 SYS_FUTIMESAT = 290 SYS_NEWFSTATAT = 291 SYS_UNLINKAT = 292 SYS_RENAMEAT = 293 SYS_LINKAT = 294 SYS_SYMLINKAT = 295 SYS_READLINKAT = 296 SYS_FCHMODAT = 297 SYS_FACCESSAT = 298 SYS_GET_ROBUST_LIST = 299 SYS_SET_ROBUST_LIST = 300 SYS_MOVE_PAGES = 301 SYS_GETCPU = 302 SYS_EPOLL_PWAIT = 303 SYS_UTIMENSAT = 304 SYS_SIGNALFD = 305 SYS_TIMERFD_CREATE = 306 SYS_EVENTFD = 307 SYS_SYNC_FILE_RANGE2 = 308 SYS_FALLOCATE = 309 SYS_SUBPAGE_PROT = 310 SYS_TIMERFD_SETTIME = 311 SYS_TIMERFD_GETTIME = 312 SYS_SIGNALFD4 = 313 SYS_EVENTFD2 = 314 SYS_EPOLL_CREATE1 = 315 SYS_DUP3 = 316 SYS_PIPE2 = 317 SYS_INOTIFY_INIT1 = 318 SYS_PERF_EVENT_OPEN = 319 SYS_PREADV = 320 SYS_PWRITEV = 321 SYS_RT_TGSIGQUEUEINFO = 322 SYS_FANOTIFY_INIT = 323 SYS_FANOTIFY_MARK = 324 SYS_PRLIMIT64 = 325 SYS_SOCKET = 326 SYS_BIND = 327 SYS_CONNECT = 328 SYS_LISTEN = 329 SYS_ACCEPT = 330 SYS_GETSOCKNAME = 331 SYS_GETPEERNAME = 332 SYS_SOCKETPAIR = 333 SYS_SEND = 334 SYS_SENDTO = 335 SYS_RECV = 336 SYS_RECVFROM = 337 SYS_SHUTDOWN = 338 SYS_SETSOCKOPT = 339 SYS_GETSOCKOPT = 340 SYS_SENDMSG = 341 SYS_RECVMSG = 342 SYS_RECVMMSG = 343 SYS_ACCEPT4 = 344 SYS_NAME_TO_HANDLE_AT = 345 SYS_OPEN_BY_HANDLE_AT = 346 SYS_CLOCK_ADJTIME = 347 SYS_SYNCFS = 348 SYS_SENDMMSG = 349 SYS_SETNS = 350 SYS_PROCESS_VM_READV = 351 SYS_PROCESS_VM_WRITEV = 352 SYS_FINIT_MODULE = 353 SYS_KCMP = 354 SYS_SCHED_SETATTR = 355 SYS_SCHED_GETATTR = 356 SYS_RENAMEAT2 = 357 SYS_SECCOMP = 358 SYS_GETRANDOM = 359 SYS_MEMFD_CREATE = 360 SYS_BPF = 361 SYS_EXECVEAT = 362 SYS_SWITCH_ENDIAN = 363 SYS_USERFAULTFD = 364 SYS_MEMBARRIER = 365 SYS_MLOCK2 = 378 SYS_COPY_FILE_RANGE = 379 SYS_PREADV2 = 380 SYS_PWRITEV2 = 381 SYS_KEXEC_FILE_LOAD = 382 SYS_STATX = 383 SYS_PKEY_ALLOC = 384 SYS_PKEY_FREE = 385 SYS_PKEY_MPROTECT = 386 SYS_RSEQ = 387 SYS_IO_PGETEVENTS = 388 SYS_SEMTIMEDOP = 392 SYS_SEMGET = 393 SYS_SEMCTL = 394 SYS_SHMGET = 395 SYS_SHMCTL = 396 SYS_SHMAT = 397 SYS_SHMDT = 398 SYS_MSGGET = 399 SYS_MSGSND = 400 SYS_MSGRCV = 401 SYS_MSGCTL = 402 SYS_PIDFD_SEND_SIGNAL = 424 SYS_IO_URING_SETUP = 425 SYS_IO_URING_ENTER = 426 SYS_IO_URING_REGISTER = 427 SYS_OPEN_TREE = 428 SYS_MOVE_MOUNT = 429 SYS_FSOPEN = 430 SYS_FSCONFIG = 431 SYS_FSMOUNT = 432 SYS_FSPICK = 433 SYS_PIDFD_OPEN = 434 SYS_CLONE3 = 435 SYS_CLOSE_RANGE = 436 SYS_OPENAT2 = 437 SYS_PIDFD_GETFD = 438 SYS_FACCESSAT2 = 439 SYS_PROCESS_MADVISE = 440 SYS_EPOLL_PWAIT2 = 441 SYS_MOUNT_SETATTR = 442 SYS_QUOTACTL_FD = 443 SYS_LANDLOCK_CREATE_RULESET = 444 SYS_LANDLOCK_ADD_RULE = 445 SYS_LANDLOCK_RESTRICT_SELF = 446 SYS_PROCESS_MRELEASE = 448 SYS_FUTEX_WAITV = 449 SYS_SET_MEMPOLICY_HOME_NODE = 450 SYS_CACHESTAT = 451 SYS_FCHMODAT2 = 452 SYS_MAP_SHADOW_STACK = 453 SYS_FUTEX_WAKE = 454 SYS_FUTEX_WAIT = 455 SYS_FUTEX_REQUEUE = 456 SYS_STATMOUNT = 457 SYS_LISTMOUNT = 458 SYS_LSM_GET_SELF_ATTR = 459 SYS_LSM_SET_SELF_ATTR = 460 SYS_LSM_LIST_MODULES = 461 SYS_MSEAL = 462 SYS_SETXATTRAT = 463 SYS_GETXATTRAT = 464 SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 SYS_OPEN_TREE_ATTR = 467 ) ================================================ FILE: vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go ================================================ // go run linux/mksysnum.go -Wall -Werror -static -I/tmp/riscv64/include /tmp/riscv64/include/asm/unistd.h // Code generated by the command above; see README.md. DO NOT EDIT. //go:build riscv64 && linux package unix const ( SYS_IO_SETUP = 0 SYS_IO_DESTROY = 1 SYS_IO_SUBMIT = 2 SYS_IO_CANCEL = 3 SYS_IO_GETEVENTS = 4 SYS_SETXATTR = 5 SYS_LSETXATTR = 6 SYS_FSETXATTR = 7 SYS_GETXATTR = 8 SYS_LGETXATTR = 9 SYS_FGETXATTR = 10 SYS_LISTXATTR = 11 SYS_LLISTXATTR = 12 SYS_FLISTXATTR = 13 SYS_REMOVEXATTR = 14 SYS_LREMOVEXATTR = 15 SYS_FREMOVEXATTR = 16 SYS_GETCWD = 17 SYS_LOOKUP_DCOOKIE = 18 SYS_EVENTFD2 = 19 SYS_EPOLL_CREATE1 = 20 SYS_EPOLL_CTL = 21 SYS_EPOLL_PWAIT = 22 SYS_DUP = 23 SYS_DUP3 = 24 SYS_FCNTL = 25 SYS_INOTIFY_INIT1 = 26 SYS_INOTIFY_ADD_WATCH = 27 SYS_INOTIFY_RM_WATCH = 28 SYS_IOCTL = 29 SYS_IOPRIO_SET = 30 SYS_IOPRIO_GET = 31 SYS_FLOCK = 32 SYS_MKNODAT = 33 SYS_MKDIRAT = 34 SYS_UNLINKAT = 35 SYS_SYMLINKAT = 36 SYS_LINKAT = 37 SYS_UMOUNT2 = 39 SYS_MOUNT = 40 SYS_PIVOT_ROOT = 41 SYS_NFSSERVCTL = 42 SYS_STATFS = 43 SYS_FSTATFS = 44 SYS_TRUNCATE = 45 SYS_FTRUNCATE = 46 SYS_FALLOCATE = 47 SYS_FACCESSAT = 48 SYS_CHDIR = 49 SYS_FCHDIR = 50 SYS_CHROOT = 51 SYS_FCHMOD = 52 SYS_FCHMODAT = 53 SYS_FCHOWNAT = 54 SYS_FCHOWN = 55 SYS_OPENAT = 56 SYS_CLOSE = 57 SYS_VHANGUP = 58 SYS_PIPE2 = 59 SYS_QUOTACTL = 60 SYS_GETDENTS64 = 61 SYS_LSEEK = 62 SYS_READ = 63 SYS_WRITE = 64 SYS_READV = 65 SYS_WRITEV = 66 SYS_PREAD64 = 67 SYS_PWRITE64 = 68 SYS_PREADV = 69 SYS_PWRITEV = 70 SYS_SENDFILE = 71 SYS_PSELECT6 = 72 SYS_PPOLL = 73 SYS_SIGNALFD4 = 74 SYS_VMSPLICE = 75 SYS_SPLICE = 76 SYS_TEE = 77 SYS_READLINKAT = 78 SYS_NEWFSTATAT = 79 SYS_FSTAT = 80 SYS_SYNC = 81 SYS_FSYNC = 82 SYS_FDATASYNC = 83 SYS_SYNC_FILE_RANGE = 84 SYS_TIMERFD_CREATE = 85 SYS_TIMERFD_SETTIME = 86 SYS_TIMERFD_GETTIME = 87 SYS_UTIMENSAT = 88 SYS_ACCT = 89 SYS_CAPGET = 90 SYS_CAPSET = 91 SYS_PERSONALITY = 92 SYS_EXIT = 93 SYS_EXIT_GROUP = 94 SYS_WAITID = 95 SYS_SET_TID_ADDRESS = 96 SYS_UNSHARE = 97 SYS_FUTEX = 98 SYS_SET_ROBUST_LIST = 99 SYS_GET_ROBUST_LIST = 100 SYS_NANOSLEEP = 101 SYS_GETITIMER = 102 SYS_SETITIMER = 103 SYS_KEXEC_LOAD = 104 SYS_INIT_MODULE = 105 SYS_DELETE_MODULE = 106 SYS_TIMER_CREATE = 107 SYS_TIMER_GETTIME = 108 SYS_TIMER_GETOVERRUN = 109 SYS_TIMER_SETTIME = 110 SYS_TIMER_DELETE = 111 SYS_CLOCK_SETTIME = 112 SYS_CLOCK_GETTIME = 113 SYS_CLOCK_GETRES = 114 SYS_CLOCK_NANOSLEEP = 115 SYS_SYSLOG = 116 SYS_PTRACE = 117 SYS_SCHED_SETPARAM = 118 SYS_SCHED_SETSCHEDULER = 119 SYS_SCHED_GETSCHEDULER = 120 SYS_SCHED_GETPARAM = 121 SYS_SCHED_SETAFFINITY = 122 SYS_SCHED_GETAFFINITY = 123 SYS_SCHED_YIELD = 124 SYS_SCHED_GET_PRIORITY_MAX = 125 SYS_SCHED_GET_PRIORITY_MIN = 126 SYS_SCHED_RR_GET_INTERVAL = 127 SYS_RESTART_SYSCALL = 128 SYS_KILL = 129 SYS_TKILL = 130 SYS_TGKILL = 131 SYS_SIGALTSTACK = 132 SYS_RT_SIGSUSPEND = 133 SYS_RT_SIGACTION = 134 SYS_RT_SIGPROCMASK = 135 SYS_RT_SIGPENDING = 136 SYS_RT_SIGTIMEDWAIT = 137 SYS_RT_SIGQUEUEINFO = 138 SYS_RT_SIGRETURN = 139 SYS_SETPRIORITY = 140 SYS_GETPRIORITY = 141 SYS_REBOOT = 142 SYS_SETREGID = 143 SYS_SETGID = 144 SYS_SETREUID = 145 SYS_SETUID = 146 SYS_SETRESUID = 147 SYS_GETRESUID = 148 SYS_SETRESGID = 149 SYS_GETRESGID = 150 SYS_SETFSUID = 151 SYS_SETFSGID = 152 SYS_TIMES = 153 SYS_SETPGID = 154 SYS_GETPGID = 155 SYS_GETSID = 156 SYS_SETSID = 157 SYS_GETGROUPS = 158 SYS_SETGROUPS = 159 SYS_UNAME = 160 SYS_SETHOSTNAME = 161 SYS_SETDOMAINNAME = 162 SYS_GETRLIMIT = 163 SYS_SETRLIMIT = 164 SYS_GETRUSAGE = 165 SYS_UMASK = 166 SYS_PRCTL = 167 SYS_GETCPU = 168 SYS_GETTIMEOFDAY = 169 SYS_SETTIMEOFDAY = 170 SYS_ADJTIMEX = 171 SYS_GETPID = 172 SYS_GETPPID = 173 SYS_GETUID = 174 SYS_GETEUID = 175 SYS_GETGID = 176 SYS_GETEGID = 177 SYS_GETTID = 178 SYS_SYSINFO = 179 SYS_MQ_OPEN = 180 SYS_MQ_UNLINK = 181 SYS_MQ_TIMEDSEND = 182 SYS_MQ_TIMEDRECEIVE = 183 SYS_MQ_NOTIFY = 184 SYS_MQ_GETSETATTR = 185 SYS_MSGGET = 186 SYS_MSGCTL = 187 SYS_MSGRCV = 188 SYS_MSGSND = 189 SYS_SEMGET = 190 SYS_SEMCTL = 191 SYS_SEMTIMEDOP = 192 SYS_SEMOP = 193 SYS_SHMGET = 194 SYS_SHMCTL = 195 SYS_SHMAT = 196 SYS_SHMDT = 197 SYS_SOCKET = 198 SYS_SOCKETPAIR = 199 SYS_BIND = 200 SYS_LISTEN = 201 SYS_ACCEPT = 202 SYS_CONNECT = 203 SYS_GETSOCKNAME = 204 SYS_GETPEERNAME = 205 SYS_SENDTO = 206 SYS_RECVFROM = 207 SYS_SETSOCKOPT = 208 SYS_GETSOCKOPT = 209 SYS_SHUTDOWN = 210 SYS_SENDMSG = 211 SYS_RECVMSG = 212 SYS_READAHEAD = 213 SYS_BRK = 214 SYS_MUNMAP = 215 SYS_MREMAP = 216 SYS_ADD_KEY = 217 SYS_REQUEST_KEY = 218 SYS_KEYCTL = 219 SYS_CLONE = 220 SYS_EXECVE = 221 SYS_MMAP = 222 SYS_FADVISE64 = 223 SYS_SWAPON = 224 SYS_SWAPOFF = 225 SYS_MPROTECT = 226 SYS_MSYNC = 227 SYS_MLOCK = 228 SYS_MUNLOCK = 229 SYS_MLOCKALL = 230 SYS_MUNLOCKALL = 231 SYS_MINCORE = 232 SYS_MADVISE = 233 SYS_REMAP_FILE_PAGES = 234 SYS_MBIND = 235 SYS_GET_MEMPOLICY = 236 SYS_SET_MEMPOLICY = 237 SYS_MIGRATE_PAGES = 238 SYS_MOVE_PAGES = 239 SYS_RT_TGSIGQUEUEINFO = 240 SYS_PERF_EVENT_OPEN = 241 SYS_ACCEPT4 = 242 SYS_RECVMMSG = 243 SYS_ARCH_SPECIFIC_SYSCALL = 244 SYS_RISCV_HWPROBE = 258 SYS_RISCV_FLUSH_ICACHE = 259 SYS_WAIT4 = 260 SYS_PRLIMIT64 = 261 SYS_FANOTIFY_INIT = 262 SYS_FANOTIFY_MARK = 263 SYS_NAME_TO_HANDLE_AT = 264 SYS_OPEN_BY_HANDLE_AT = 265 SYS_CLOCK_ADJTIME = 266 SYS_SYNCFS = 267 SYS_SETNS = 268 SYS_SENDMMSG = 269 SYS_PROCESS_VM_READV = 270 SYS_PROCESS_VM_WRITEV = 271 SYS_KCMP = 272 SYS_FINIT_MODULE = 273 SYS_SCHED_SETATTR = 274 SYS_SCHED_GETATTR = 275 SYS_RENAMEAT2 = 276 SYS_SECCOMP = 277 SYS_GETRANDOM = 278 SYS_MEMFD_CREATE = 279 SYS_BPF = 280 SYS_EXECVEAT = 281 SYS_USERFAULTFD = 282 SYS_MEMBARRIER = 283 SYS_MLOCK2 = 284 SYS_COPY_FILE_RANGE = 285 SYS_PREADV2 = 286 SYS_PWRITEV2 = 287 SYS_PKEY_MPROTECT = 288 SYS_PKEY_ALLOC = 289 SYS_PKEY_FREE = 290 SYS_STATX = 291 SYS_IO_PGETEVENTS = 292 SYS_RSEQ = 293 SYS_KEXEC_FILE_LOAD = 294 SYS_PIDFD_SEND_SIGNAL = 424 SYS_IO_URING_SETUP = 425 SYS_IO_URING_ENTER = 426 SYS_IO_URING_REGISTER = 427 SYS_OPEN_TREE = 428 SYS_MOVE_MOUNT = 429 SYS_FSOPEN = 430 SYS_FSCONFIG = 431 SYS_FSMOUNT = 432 SYS_FSPICK = 433 SYS_PIDFD_OPEN = 434 SYS_CLONE3 = 435 SYS_CLOSE_RANGE = 436 SYS_OPENAT2 = 437 SYS_PIDFD_GETFD = 438 SYS_FACCESSAT2 = 439 SYS_PROCESS_MADVISE = 440 SYS_EPOLL_PWAIT2 = 441 SYS_MOUNT_SETATTR = 442 SYS_QUOTACTL_FD = 443 SYS_LANDLOCK_CREATE_RULESET = 444 SYS_LANDLOCK_ADD_RULE = 445 SYS_LANDLOCK_RESTRICT_SELF = 446 SYS_MEMFD_SECRET = 447 SYS_PROCESS_MRELEASE = 448 SYS_FUTEX_WAITV = 449 SYS_SET_MEMPOLICY_HOME_NODE = 450 SYS_CACHESTAT = 451 SYS_FCHMODAT2 = 452 SYS_MAP_SHADOW_STACK = 453 SYS_FUTEX_WAKE = 454 SYS_FUTEX_WAIT = 455 SYS_FUTEX_REQUEUE = 456 SYS_STATMOUNT = 457 SYS_LISTMOUNT = 458 SYS_LSM_GET_SELF_ATTR = 459 SYS_LSM_SET_SELF_ATTR = 460 SYS_LSM_LIST_MODULES = 461 SYS_MSEAL = 462 SYS_SETXATTRAT = 463 SYS_GETXATTRAT = 464 SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 SYS_OPEN_TREE_ATTR = 467 ) ================================================ FILE: vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go ================================================ // go run linux/mksysnum.go -Wall -Werror -static -I/tmp/s390x/include -fsigned-char /tmp/s390x/include/asm/unistd.h // Code generated by the command above; see README.md. DO NOT EDIT. //go:build s390x && linux package unix const ( SYS_EXIT = 1 SYS_FORK = 2 SYS_READ = 3 SYS_WRITE = 4 SYS_OPEN = 5 SYS_CLOSE = 6 SYS_RESTART_SYSCALL = 7 SYS_CREAT = 8 SYS_LINK = 9 SYS_UNLINK = 10 SYS_EXECVE = 11 SYS_CHDIR = 12 SYS_MKNOD = 14 SYS_CHMOD = 15 SYS_LSEEK = 19 SYS_GETPID = 20 SYS_MOUNT = 21 SYS_UMOUNT = 22 SYS_PTRACE = 26 SYS_ALARM = 27 SYS_PAUSE = 29 SYS_UTIME = 30 SYS_ACCESS = 33 SYS_NICE = 34 SYS_SYNC = 36 SYS_KILL = 37 SYS_RENAME = 38 SYS_MKDIR = 39 SYS_RMDIR = 40 SYS_DUP = 41 SYS_PIPE = 42 SYS_TIMES = 43 SYS_BRK = 45 SYS_SIGNAL = 48 SYS_ACCT = 51 SYS_UMOUNT2 = 52 SYS_IOCTL = 54 SYS_FCNTL = 55 SYS_SETPGID = 57 SYS_UMASK = 60 SYS_CHROOT = 61 SYS_USTAT = 62 SYS_DUP2 = 63 SYS_GETPPID = 64 SYS_GETPGRP = 65 SYS_SETSID = 66 SYS_SIGACTION = 67 SYS_SIGSUSPEND = 72 SYS_SIGPENDING = 73 SYS_SETHOSTNAME = 74 SYS_SETRLIMIT = 75 SYS_GETRUSAGE = 77 SYS_GETTIMEOFDAY = 78 SYS_SETTIMEOFDAY = 79 SYS_SYMLINK = 83 SYS_READLINK = 85 SYS_USELIB = 86 SYS_SWAPON = 87 SYS_REBOOT = 88 SYS_READDIR = 89 SYS_MMAP = 90 SYS_MUNMAP = 91 SYS_TRUNCATE = 92 SYS_FTRUNCATE = 93 SYS_FCHMOD = 94 SYS_GETPRIORITY = 96 SYS_SETPRIORITY = 97 SYS_STATFS = 99 SYS_FSTATFS = 100 SYS_SOCKETCALL = 102 SYS_SYSLOG = 103 SYS_SETITIMER = 104 SYS_GETITIMER = 105 SYS_STAT = 106 SYS_LSTAT = 107 SYS_FSTAT = 108 SYS_LOOKUP_DCOOKIE = 110 SYS_VHANGUP = 111 SYS_IDLE = 112 SYS_WAIT4 = 114 SYS_SWAPOFF = 115 SYS_SYSINFO = 116 SYS_IPC = 117 SYS_FSYNC = 118 SYS_SIGRETURN = 119 SYS_CLONE = 120 SYS_SETDOMAINNAME = 121 SYS_UNAME = 122 SYS_ADJTIMEX = 124 SYS_MPROTECT = 125 SYS_SIGPROCMASK = 126 SYS_CREATE_MODULE = 127 SYS_INIT_MODULE = 128 SYS_DELETE_MODULE = 129 SYS_GET_KERNEL_SYMS = 130 SYS_QUOTACTL = 131 SYS_GETPGID = 132 SYS_FCHDIR = 133 SYS_BDFLUSH = 134 SYS_SYSFS = 135 SYS_PERSONALITY = 136 SYS_AFS_SYSCALL = 137 SYS_GETDENTS = 141 SYS_SELECT = 142 SYS_FLOCK = 143 SYS_MSYNC = 144 SYS_READV = 145 SYS_WRITEV = 146 SYS_GETSID = 147 SYS_FDATASYNC = 148 SYS__SYSCTL = 149 SYS_MLOCK = 150 SYS_MUNLOCK = 151 SYS_MLOCKALL = 152 SYS_MUNLOCKALL = 153 SYS_SCHED_SETPARAM = 154 SYS_SCHED_GETPARAM = 155 SYS_SCHED_SETSCHEDULER = 156 SYS_SCHED_GETSCHEDULER = 157 SYS_SCHED_YIELD = 158 SYS_SCHED_GET_PRIORITY_MAX = 159 SYS_SCHED_GET_PRIORITY_MIN = 160 SYS_SCHED_RR_GET_INTERVAL = 161 SYS_NANOSLEEP = 162 SYS_MREMAP = 163 SYS_QUERY_MODULE = 167 SYS_POLL = 168 SYS_NFSSERVCTL = 169 SYS_PRCTL = 172 SYS_RT_SIGRETURN = 173 SYS_RT_SIGACTION = 174 SYS_RT_SIGPROCMASK = 175 SYS_RT_SIGPENDING = 176 SYS_RT_SIGTIMEDWAIT = 177 SYS_RT_SIGQUEUEINFO = 178 SYS_RT_SIGSUSPEND = 179 SYS_PREAD64 = 180 SYS_PWRITE64 = 181 SYS_GETCWD = 183 SYS_CAPGET = 184 SYS_CAPSET = 185 SYS_SIGALTSTACK = 186 SYS_SENDFILE = 187 SYS_GETPMSG = 188 SYS_PUTPMSG = 189 SYS_VFORK = 190 SYS_GETRLIMIT = 191 SYS_LCHOWN = 198 SYS_GETUID = 199 SYS_GETGID = 200 SYS_GETEUID = 201 SYS_GETEGID = 202 SYS_SETREUID = 203 SYS_SETREGID = 204 SYS_GETGROUPS = 205 SYS_SETGROUPS = 206 SYS_FCHOWN = 207 SYS_SETRESUID = 208 SYS_GETRESUID = 209 SYS_SETRESGID = 210 SYS_GETRESGID = 211 SYS_CHOWN = 212 SYS_SETUID = 213 SYS_SETGID = 214 SYS_SETFSUID = 215 SYS_SETFSGID = 216 SYS_PIVOT_ROOT = 217 SYS_MINCORE = 218 SYS_MADVISE = 219 SYS_GETDENTS64 = 220 SYS_READAHEAD = 222 SYS_SETXATTR = 224 SYS_LSETXATTR = 225 SYS_FSETXATTR = 226 SYS_GETXATTR = 227 SYS_LGETXATTR = 228 SYS_FGETXATTR = 229 SYS_LISTXATTR = 230 SYS_LLISTXATTR = 231 SYS_FLISTXATTR = 232 SYS_REMOVEXATTR = 233 SYS_LREMOVEXATTR = 234 SYS_FREMOVEXATTR = 235 SYS_GETTID = 236 SYS_TKILL = 237 SYS_FUTEX = 238 SYS_SCHED_SETAFFINITY = 239 SYS_SCHED_GETAFFINITY = 240 SYS_TGKILL = 241 SYS_IO_SETUP = 243 SYS_IO_DESTROY = 244 SYS_IO_GETEVENTS = 245 SYS_IO_SUBMIT = 246 SYS_IO_CANCEL = 247 SYS_EXIT_GROUP = 248 SYS_EPOLL_CREATE = 249 SYS_EPOLL_CTL = 250 SYS_EPOLL_WAIT = 251 SYS_SET_TID_ADDRESS = 252 SYS_FADVISE64 = 253 SYS_TIMER_CREATE = 254 SYS_TIMER_SETTIME = 255 SYS_TIMER_GETTIME = 256 SYS_TIMER_GETOVERRUN = 257 SYS_TIMER_DELETE = 258 SYS_CLOCK_SETTIME = 259 SYS_CLOCK_GETTIME = 260 SYS_CLOCK_GETRES = 261 SYS_CLOCK_NANOSLEEP = 262 SYS_STATFS64 = 265 SYS_FSTATFS64 = 266 SYS_REMAP_FILE_PAGES = 267 SYS_MBIND = 268 SYS_GET_MEMPOLICY = 269 SYS_SET_MEMPOLICY = 270 SYS_MQ_OPEN = 271 SYS_MQ_UNLINK = 272 SYS_MQ_TIMEDSEND = 273 SYS_MQ_TIMEDRECEIVE = 274 SYS_MQ_NOTIFY = 275 SYS_MQ_GETSETATTR = 276 SYS_KEXEC_LOAD = 277 SYS_ADD_KEY = 278 SYS_REQUEST_KEY = 279 SYS_KEYCTL = 280 SYS_WAITID = 281 SYS_IOPRIO_SET = 282 SYS_IOPRIO_GET = 283 SYS_INOTIFY_INIT = 284 SYS_INOTIFY_ADD_WATCH = 285 SYS_INOTIFY_RM_WATCH = 286 SYS_MIGRATE_PAGES = 287 SYS_OPENAT = 288 SYS_MKDIRAT = 289 SYS_MKNODAT = 290 SYS_FCHOWNAT = 291 SYS_FUTIMESAT = 292 SYS_NEWFSTATAT = 293 SYS_UNLINKAT = 294 SYS_RENAMEAT = 295 SYS_LINKAT = 296 SYS_SYMLINKAT = 297 SYS_READLINKAT = 298 SYS_FCHMODAT = 299 SYS_FACCESSAT = 300 SYS_PSELECT6 = 301 SYS_PPOLL = 302 SYS_UNSHARE = 303 SYS_SET_ROBUST_LIST = 304 SYS_GET_ROBUST_LIST = 305 SYS_SPLICE = 306 SYS_SYNC_FILE_RANGE = 307 SYS_TEE = 308 SYS_VMSPLICE = 309 SYS_MOVE_PAGES = 310 SYS_GETCPU = 311 SYS_EPOLL_PWAIT = 312 SYS_UTIMES = 313 SYS_FALLOCATE = 314 SYS_UTIMENSAT = 315 SYS_SIGNALFD = 316 SYS_TIMERFD = 317 SYS_EVENTFD = 318 SYS_TIMERFD_CREATE = 319 SYS_TIMERFD_SETTIME = 320 SYS_TIMERFD_GETTIME = 321 SYS_SIGNALFD4 = 322 SYS_EVENTFD2 = 323 SYS_INOTIFY_INIT1 = 324 SYS_PIPE2 = 325 SYS_DUP3 = 326 SYS_EPOLL_CREATE1 = 327 SYS_PREADV = 328 SYS_PWRITEV = 329 SYS_RT_TGSIGQUEUEINFO = 330 SYS_PERF_EVENT_OPEN = 331 SYS_FANOTIFY_INIT = 332 SYS_FANOTIFY_MARK = 333 SYS_PRLIMIT64 = 334 SYS_NAME_TO_HANDLE_AT = 335 SYS_OPEN_BY_HANDLE_AT = 336 SYS_CLOCK_ADJTIME = 337 SYS_SYNCFS = 338 SYS_SETNS = 339 SYS_PROCESS_VM_READV = 340 SYS_PROCESS_VM_WRITEV = 341 SYS_S390_RUNTIME_INSTR = 342 SYS_KCMP = 343 SYS_FINIT_MODULE = 344 SYS_SCHED_SETATTR = 345 SYS_SCHED_GETATTR = 346 SYS_RENAMEAT2 = 347 SYS_SECCOMP = 348 SYS_GETRANDOM = 349 SYS_MEMFD_CREATE = 350 SYS_BPF = 351 SYS_S390_PCI_MMIO_WRITE = 352 SYS_S390_PCI_MMIO_READ = 353 SYS_EXECVEAT = 354 SYS_USERFAULTFD = 355 SYS_MEMBARRIER = 356 SYS_RECVMMSG = 357 SYS_SENDMMSG = 358 SYS_SOCKET = 359 SYS_SOCKETPAIR = 360 SYS_BIND = 361 SYS_CONNECT = 362 SYS_LISTEN = 363 SYS_ACCEPT4 = 364 SYS_GETSOCKOPT = 365 SYS_SETSOCKOPT = 366 SYS_GETSOCKNAME = 367 SYS_GETPEERNAME = 368 SYS_SENDTO = 369 SYS_SENDMSG = 370 SYS_RECVFROM = 371 SYS_RECVMSG = 372 SYS_SHUTDOWN = 373 SYS_MLOCK2 = 374 SYS_COPY_FILE_RANGE = 375 SYS_PREADV2 = 376 SYS_PWRITEV2 = 377 SYS_S390_GUARDED_STORAGE = 378 SYS_STATX = 379 SYS_S390_STHYI = 380 SYS_KEXEC_FILE_LOAD = 381 SYS_IO_PGETEVENTS = 382 SYS_RSEQ = 383 SYS_PKEY_MPROTECT = 384 SYS_PKEY_ALLOC = 385 SYS_PKEY_FREE = 386 SYS_SEMTIMEDOP = 392 SYS_SEMGET = 393 SYS_SEMCTL = 394 SYS_SHMGET = 395 SYS_SHMCTL = 396 SYS_SHMAT = 397 SYS_SHMDT = 398 SYS_MSGGET = 399 SYS_MSGSND = 400 SYS_MSGRCV = 401 SYS_MSGCTL = 402 SYS_PIDFD_SEND_SIGNAL = 424 SYS_IO_URING_SETUP = 425 SYS_IO_URING_ENTER = 426 SYS_IO_URING_REGISTER = 427 SYS_OPEN_TREE = 428 SYS_MOVE_MOUNT = 429 SYS_FSOPEN = 430 SYS_FSCONFIG = 431 SYS_FSMOUNT = 432 SYS_FSPICK = 433 SYS_PIDFD_OPEN = 434 SYS_CLONE3 = 435 SYS_CLOSE_RANGE = 436 SYS_OPENAT2 = 437 SYS_PIDFD_GETFD = 438 SYS_FACCESSAT2 = 439 SYS_PROCESS_MADVISE = 440 SYS_EPOLL_PWAIT2 = 441 SYS_MOUNT_SETATTR = 442 SYS_QUOTACTL_FD = 443 SYS_LANDLOCK_CREATE_RULESET = 444 SYS_LANDLOCK_ADD_RULE = 445 SYS_LANDLOCK_RESTRICT_SELF = 446 SYS_MEMFD_SECRET = 447 SYS_PROCESS_MRELEASE = 448 SYS_FUTEX_WAITV = 449 SYS_SET_MEMPOLICY_HOME_NODE = 450 SYS_CACHESTAT = 451 SYS_FCHMODAT2 = 452 SYS_MAP_SHADOW_STACK = 453 SYS_FUTEX_WAKE = 454 SYS_FUTEX_WAIT = 455 SYS_FUTEX_REQUEUE = 456 SYS_STATMOUNT = 457 SYS_LISTMOUNT = 458 SYS_LSM_GET_SELF_ATTR = 459 SYS_LSM_SET_SELF_ATTR = 460 SYS_LSM_LIST_MODULES = 461 SYS_MSEAL = 462 SYS_SETXATTRAT = 463 SYS_GETXATTRAT = 464 SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 SYS_OPEN_TREE_ATTR = 467 ) ================================================ FILE: vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go ================================================ // go run linux/mksysnum.go -Wall -Werror -static -I/tmp/sparc64/include /tmp/sparc64/include/asm/unistd.h // Code generated by the command above; see README.md. DO NOT EDIT. //go:build sparc64 && linux package unix const ( SYS_RESTART_SYSCALL = 0 SYS_EXIT = 1 SYS_FORK = 2 SYS_READ = 3 SYS_WRITE = 4 SYS_OPEN = 5 SYS_CLOSE = 6 SYS_WAIT4 = 7 SYS_CREAT = 8 SYS_LINK = 9 SYS_UNLINK = 10 SYS_EXECV = 11 SYS_CHDIR = 12 SYS_CHOWN = 13 SYS_MKNOD = 14 SYS_CHMOD = 15 SYS_LCHOWN = 16 SYS_BRK = 17 SYS_PERFCTR = 18 SYS_LSEEK = 19 SYS_GETPID = 20 SYS_CAPGET = 21 SYS_CAPSET = 22 SYS_SETUID = 23 SYS_GETUID = 24 SYS_VMSPLICE = 25 SYS_PTRACE = 26 SYS_ALARM = 27 SYS_SIGALTSTACK = 28 SYS_PAUSE = 29 SYS_UTIME = 30 SYS_ACCESS = 33 SYS_NICE = 34 SYS_SYNC = 36 SYS_KILL = 37 SYS_STAT = 38 SYS_SENDFILE = 39 SYS_LSTAT = 40 SYS_DUP = 41 SYS_PIPE = 42 SYS_TIMES = 43 SYS_UMOUNT2 = 45 SYS_SETGID = 46 SYS_GETGID = 47 SYS_SIGNAL = 48 SYS_GETEUID = 49 SYS_GETEGID = 50 SYS_ACCT = 51 SYS_MEMORY_ORDERING = 52 SYS_IOCTL = 54 SYS_REBOOT = 55 SYS_SYMLINK = 57 SYS_READLINK = 58 SYS_EXECVE = 59 SYS_UMASK = 60 SYS_CHROOT = 61 SYS_FSTAT = 62 SYS_FSTAT64 = 63 SYS_GETPAGESIZE = 64 SYS_MSYNC = 65 SYS_VFORK = 66 SYS_PREAD64 = 67 SYS_PWRITE64 = 68 SYS_MMAP = 71 SYS_MUNMAP = 73 SYS_MPROTECT = 74 SYS_MADVISE = 75 SYS_VHANGUP = 76 SYS_MINCORE = 78 SYS_GETGROUPS = 79 SYS_SETGROUPS = 80 SYS_GETPGRP = 81 SYS_SETITIMER = 83 SYS_SWAPON = 85 SYS_GETITIMER = 86 SYS_SETHOSTNAME = 88 SYS_DUP2 = 90 SYS_FCNTL = 92 SYS_SELECT = 93 SYS_FSYNC = 95 SYS_SETPRIORITY = 96 SYS_SOCKET = 97 SYS_CONNECT = 98 SYS_ACCEPT = 99 SYS_GETPRIORITY = 100 SYS_RT_SIGRETURN = 101 SYS_RT_SIGACTION = 102 SYS_RT_SIGPROCMASK = 103 SYS_RT_SIGPENDING = 104 SYS_RT_SIGTIMEDWAIT = 105 SYS_RT_SIGQUEUEINFO = 106 SYS_RT_SIGSUSPEND = 107 SYS_SETRESUID = 108 SYS_GETRESUID = 109 SYS_SETRESGID = 110 SYS_GETRESGID = 111 SYS_RECVMSG = 113 SYS_SENDMSG = 114 SYS_GETTIMEOFDAY = 116 SYS_GETRUSAGE = 117 SYS_GETSOCKOPT = 118 SYS_GETCWD = 119 SYS_READV = 120 SYS_WRITEV = 121 SYS_SETTIMEOFDAY = 122 SYS_FCHOWN = 123 SYS_FCHMOD = 124 SYS_RECVFROM = 125 SYS_SETREUID = 126 SYS_SETREGID = 127 SYS_RENAME = 128 SYS_TRUNCATE = 129 SYS_FTRUNCATE = 130 SYS_FLOCK = 131 SYS_LSTAT64 = 132 SYS_SENDTO = 133 SYS_SHUTDOWN = 134 SYS_SOCKETPAIR = 135 SYS_MKDIR = 136 SYS_RMDIR = 137 SYS_UTIMES = 138 SYS_STAT64 = 139 SYS_SENDFILE64 = 140 SYS_GETPEERNAME = 141 SYS_FUTEX = 142 SYS_GETTID = 143 SYS_GETRLIMIT = 144 SYS_SETRLIMIT = 145 SYS_PIVOT_ROOT = 146 SYS_PRCTL = 147 SYS_PCICONFIG_READ = 148 SYS_PCICONFIG_WRITE = 149 SYS_GETSOCKNAME = 150 SYS_INOTIFY_INIT = 151 SYS_INOTIFY_ADD_WATCH = 152 SYS_POLL = 153 SYS_GETDENTS64 = 154 SYS_INOTIFY_RM_WATCH = 156 SYS_STATFS = 157 SYS_FSTATFS = 158 SYS_UMOUNT = 159 SYS_SCHED_SET_AFFINITY = 160 SYS_SCHED_GET_AFFINITY = 161 SYS_GETDOMAINNAME = 162 SYS_SETDOMAINNAME = 163 SYS_UTRAP_INSTALL = 164 SYS_QUOTACTL = 165 SYS_SET_TID_ADDRESS = 166 SYS_MOUNT = 167 SYS_USTAT = 168 SYS_SETXATTR = 169 SYS_LSETXATTR = 170 SYS_FSETXATTR = 171 SYS_GETXATTR = 172 SYS_LGETXATTR = 173 SYS_GETDENTS = 174 SYS_SETSID = 175 SYS_FCHDIR = 176 SYS_FGETXATTR = 177 SYS_LISTXATTR = 178 SYS_LLISTXATTR = 179 SYS_FLISTXATTR = 180 SYS_REMOVEXATTR = 181 SYS_LREMOVEXATTR = 182 SYS_SIGPENDING = 183 SYS_QUERY_MODULE = 184 SYS_SETPGID = 185 SYS_FREMOVEXATTR = 186 SYS_TKILL = 187 SYS_EXIT_GROUP = 188 SYS_UNAME = 189 SYS_INIT_MODULE = 190 SYS_PERSONALITY = 191 SYS_REMAP_FILE_PAGES = 192 SYS_EPOLL_CREATE = 193 SYS_EPOLL_CTL = 194 SYS_EPOLL_WAIT = 195 SYS_IOPRIO_SET = 196 SYS_GETPPID = 197 SYS_SIGACTION = 198 SYS_SGETMASK = 199 SYS_SSETMASK = 200 SYS_SIGSUSPEND = 201 SYS_OLDLSTAT = 202 SYS_USELIB = 203 SYS_READDIR = 204 SYS_READAHEAD = 205 SYS_SOCKETCALL = 206 SYS_SYSLOG = 207 SYS_LOOKUP_DCOOKIE = 208 SYS_FADVISE64 = 209 SYS_FADVISE64_64 = 210 SYS_TGKILL = 211 SYS_WAITPID = 212 SYS_SWAPOFF = 213 SYS_SYSINFO = 214 SYS_IPC = 215 SYS_SIGRETURN = 216 SYS_CLONE = 217 SYS_IOPRIO_GET = 218 SYS_ADJTIMEX = 219 SYS_SIGPROCMASK = 220 SYS_CREATE_MODULE = 221 SYS_DELETE_MODULE = 222 SYS_GET_KERNEL_SYMS = 223 SYS_GETPGID = 224 SYS_BDFLUSH = 225 SYS_SYSFS = 226 SYS_AFS_SYSCALL = 227 SYS_SETFSUID = 228 SYS_SETFSGID = 229 SYS__NEWSELECT = 230 SYS_SPLICE = 232 SYS_STIME = 233 SYS_STATFS64 = 234 SYS_FSTATFS64 = 235 SYS__LLSEEK = 236 SYS_MLOCK = 237 SYS_MUNLOCK = 238 SYS_MLOCKALL = 239 SYS_MUNLOCKALL = 240 SYS_SCHED_SETPARAM = 241 SYS_SCHED_GETPARAM = 242 SYS_SCHED_SETSCHEDULER = 243 SYS_SCHED_GETSCHEDULER = 244 SYS_SCHED_YIELD = 245 SYS_SCHED_GET_PRIORITY_MAX = 246 SYS_SCHED_GET_PRIORITY_MIN = 247 SYS_SCHED_RR_GET_INTERVAL = 248 SYS_NANOSLEEP = 249 SYS_MREMAP = 250 SYS__SYSCTL = 251 SYS_GETSID = 252 SYS_FDATASYNC = 253 SYS_NFSSERVCTL = 254 SYS_SYNC_FILE_RANGE = 255 SYS_CLOCK_SETTIME = 256 SYS_CLOCK_GETTIME = 257 SYS_CLOCK_GETRES = 258 SYS_CLOCK_NANOSLEEP = 259 SYS_SCHED_GETAFFINITY = 260 SYS_SCHED_SETAFFINITY = 261 SYS_TIMER_SETTIME = 262 SYS_TIMER_GETTIME = 263 SYS_TIMER_GETOVERRUN = 264 SYS_TIMER_DELETE = 265 SYS_TIMER_CREATE = 266 SYS_VSERVER = 267 SYS_IO_SETUP = 268 SYS_IO_DESTROY = 269 SYS_IO_SUBMIT = 270 SYS_IO_CANCEL = 271 SYS_IO_GETEVENTS = 272 SYS_MQ_OPEN = 273 SYS_MQ_UNLINK = 274 SYS_MQ_TIMEDSEND = 275 SYS_MQ_TIMEDRECEIVE = 276 SYS_MQ_NOTIFY = 277 SYS_MQ_GETSETATTR = 278 SYS_WAITID = 279 SYS_TEE = 280 SYS_ADD_KEY = 281 SYS_REQUEST_KEY = 282 SYS_KEYCTL = 283 SYS_OPENAT = 284 SYS_MKDIRAT = 285 SYS_MKNODAT = 286 SYS_FCHOWNAT = 287 SYS_FUTIMESAT = 288 SYS_FSTATAT64 = 289 SYS_UNLINKAT = 290 SYS_RENAMEAT = 291 SYS_LINKAT = 292 SYS_SYMLINKAT = 293 SYS_READLINKAT = 294 SYS_FCHMODAT = 295 SYS_FACCESSAT = 296 SYS_PSELECT6 = 297 SYS_PPOLL = 298 SYS_UNSHARE = 299 SYS_SET_ROBUST_LIST = 300 SYS_GET_ROBUST_LIST = 301 SYS_MIGRATE_PAGES = 302 SYS_MBIND = 303 SYS_GET_MEMPOLICY = 304 SYS_SET_MEMPOLICY = 305 SYS_KEXEC_LOAD = 306 SYS_MOVE_PAGES = 307 SYS_GETCPU = 308 SYS_EPOLL_PWAIT = 309 SYS_UTIMENSAT = 310 SYS_SIGNALFD = 311 SYS_TIMERFD_CREATE = 312 SYS_EVENTFD = 313 SYS_FALLOCATE = 314 SYS_TIMERFD_SETTIME = 315 SYS_TIMERFD_GETTIME = 316 SYS_SIGNALFD4 = 317 SYS_EVENTFD2 = 318 SYS_EPOLL_CREATE1 = 319 SYS_DUP3 = 320 SYS_PIPE2 = 321 SYS_INOTIFY_INIT1 = 322 SYS_ACCEPT4 = 323 SYS_PREADV = 324 SYS_PWRITEV = 325 SYS_RT_TGSIGQUEUEINFO = 326 SYS_PERF_EVENT_OPEN = 327 SYS_RECVMMSG = 328 SYS_FANOTIFY_INIT = 329 SYS_FANOTIFY_MARK = 330 SYS_PRLIMIT64 = 331 SYS_NAME_TO_HANDLE_AT = 332 SYS_OPEN_BY_HANDLE_AT = 333 SYS_CLOCK_ADJTIME = 334 SYS_SYNCFS = 335 SYS_SENDMMSG = 336 SYS_SETNS = 337 SYS_PROCESS_VM_READV = 338 SYS_PROCESS_VM_WRITEV = 339 SYS_KERN_FEATURES = 340 SYS_KCMP = 341 SYS_FINIT_MODULE = 342 SYS_SCHED_SETATTR = 343 SYS_SCHED_GETATTR = 344 SYS_RENAMEAT2 = 345 SYS_SECCOMP = 346 SYS_GETRANDOM = 347 SYS_MEMFD_CREATE = 348 SYS_BPF = 349 SYS_EXECVEAT = 350 SYS_MEMBARRIER = 351 SYS_USERFAULTFD = 352 SYS_BIND = 353 SYS_LISTEN = 354 SYS_SETSOCKOPT = 355 SYS_MLOCK2 = 356 SYS_COPY_FILE_RANGE = 357 SYS_PREADV2 = 358 SYS_PWRITEV2 = 359 SYS_STATX = 360 SYS_IO_PGETEVENTS = 361 SYS_PKEY_MPROTECT = 362 SYS_PKEY_ALLOC = 363 SYS_PKEY_FREE = 364 SYS_RSEQ = 365 SYS_SEMTIMEDOP = 392 SYS_SEMGET = 393 SYS_SEMCTL = 394 SYS_SHMGET = 395 SYS_SHMCTL = 396 SYS_SHMAT = 397 SYS_SHMDT = 398 SYS_MSGGET = 399 SYS_MSGSND = 400 SYS_MSGRCV = 401 SYS_MSGCTL = 402 SYS_PIDFD_SEND_SIGNAL = 424 SYS_IO_URING_SETUP = 425 SYS_IO_URING_ENTER = 426 SYS_IO_URING_REGISTER = 427 SYS_OPEN_TREE = 428 SYS_MOVE_MOUNT = 429 SYS_FSOPEN = 430 SYS_FSCONFIG = 431 SYS_FSMOUNT = 432 SYS_FSPICK = 433 SYS_PIDFD_OPEN = 434 SYS_CLOSE_RANGE = 436 SYS_OPENAT2 = 437 SYS_PIDFD_GETFD = 438 SYS_FACCESSAT2 = 439 SYS_PROCESS_MADVISE = 440 SYS_EPOLL_PWAIT2 = 441 SYS_MOUNT_SETATTR = 442 SYS_QUOTACTL_FD = 443 SYS_LANDLOCK_CREATE_RULESET = 444 SYS_LANDLOCK_ADD_RULE = 445 SYS_LANDLOCK_RESTRICT_SELF = 446 SYS_PROCESS_MRELEASE = 448 SYS_FUTEX_WAITV = 449 SYS_SET_MEMPOLICY_HOME_NODE = 450 SYS_CACHESTAT = 451 SYS_FCHMODAT2 = 452 SYS_MAP_SHADOW_STACK = 453 SYS_FUTEX_WAKE = 454 SYS_FUTEX_WAIT = 455 SYS_FUTEX_REQUEUE = 456 SYS_STATMOUNT = 457 SYS_LISTMOUNT = 458 SYS_LSM_GET_SELF_ATTR = 459 SYS_LSM_SET_SELF_ATTR = 460 SYS_LSM_LIST_MODULES = 461 SYS_MSEAL = 462 SYS_SETXATTRAT = 463 SYS_GETXATTRAT = 464 SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 SYS_OPEN_TREE_ATTR = 467 ) ================================================ FILE: vendor/golang.org/x/sys/unix/zsysnum_netbsd_386.go ================================================ // go run mksysnum.go http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master // Code generated by the command above; see README.md. DO NOT EDIT. //go:build 386 && netbsd package unix const ( SYS_EXIT = 1 // { void|sys||exit(int rval); } SYS_FORK = 2 // { int|sys||fork(void); } SYS_READ = 3 // { ssize_t|sys||read(int fd, void *buf, size_t nbyte); } SYS_WRITE = 4 // { ssize_t|sys||write(int fd, const void *buf, size_t nbyte); } SYS_OPEN = 5 // { int|sys||open(const char *path, int flags, ... mode_t mode); } SYS_CLOSE = 6 // { int|sys||close(int fd); } SYS_LINK = 9 // { int|sys||link(const char *path, const char *link); } SYS_UNLINK = 10 // { int|sys||unlink(const char *path); } SYS_CHDIR = 12 // { int|sys||chdir(const char *path); } SYS_FCHDIR = 13 // { int|sys||fchdir(int fd); } SYS_CHMOD = 15 // { int|sys||chmod(const char *path, mode_t mode); } SYS_CHOWN = 16 // { int|sys||chown(const char *path, uid_t uid, gid_t gid); } SYS_BREAK = 17 // { int|sys||obreak(char *nsize); } SYS_GETPID = 20 // { pid_t|sys||getpid_with_ppid(void); } SYS_UNMOUNT = 22 // { int|sys||unmount(const char *path, int flags); } SYS_SETUID = 23 // { int|sys||setuid(uid_t uid); } SYS_GETUID = 24 // { uid_t|sys||getuid_with_euid(void); } SYS_GETEUID = 25 // { uid_t|sys||geteuid(void); } SYS_PTRACE = 26 // { int|sys||ptrace(int req, pid_t pid, void *addr, int data); } SYS_RECVMSG = 27 // { ssize_t|sys||recvmsg(int s, struct msghdr *msg, int flags); } SYS_SENDMSG = 28 // { ssize_t|sys||sendmsg(int s, const struct msghdr *msg, int flags); } SYS_RECVFROM = 29 // { ssize_t|sys||recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlenaddr); } SYS_ACCEPT = 30 // { int|sys||accept(int s, struct sockaddr *name, socklen_t *anamelen); } SYS_GETPEERNAME = 31 // { int|sys||getpeername(int fdes, struct sockaddr *asa, socklen_t *alen); } SYS_GETSOCKNAME = 32 // { int|sys||getsockname(int fdes, struct sockaddr *asa, socklen_t *alen); } SYS_ACCESS = 33 // { int|sys||access(const char *path, int flags); } SYS_CHFLAGS = 34 // { int|sys||chflags(const char *path, u_long flags); } SYS_FCHFLAGS = 35 // { int|sys||fchflags(int fd, u_long flags); } SYS_SYNC = 36 // { void|sys||sync(void); } SYS_KILL = 37 // { int|sys||kill(pid_t pid, int signum); } SYS_GETPPID = 39 // { pid_t|sys||getppid(void); } SYS_DUP = 41 // { int|sys||dup(int fd); } SYS_PIPE = 42 // { int|sys||pipe(void); } SYS_GETEGID = 43 // { gid_t|sys||getegid(void); } SYS_PROFIL = 44 // { int|sys||profil(char *samples, size_t size, u_long offset, u_int scale); } SYS_KTRACE = 45 // { int|sys||ktrace(const char *fname, int ops, int facs, pid_t pid); } SYS_GETGID = 47 // { gid_t|sys||getgid_with_egid(void); } SYS___GETLOGIN = 49 // { int|sys||__getlogin(char *namebuf, size_t namelen); } SYS___SETLOGIN = 50 // { int|sys||__setlogin(const char *namebuf); } SYS_ACCT = 51 // { int|sys||acct(const char *path); } SYS_IOCTL = 54 // { int|sys||ioctl(int fd, u_long com, ... void *data); } SYS_REVOKE = 56 // { int|sys||revoke(const char *path); } SYS_SYMLINK = 57 // { int|sys||symlink(const char *path, const char *link); } SYS_READLINK = 58 // { ssize_t|sys||readlink(const char *path, char *buf, size_t count); } SYS_EXECVE = 59 // { int|sys||execve(const char *path, char * const *argp, char * const *envp); } SYS_UMASK = 60 // { mode_t|sys||umask(mode_t newmask); } SYS_CHROOT = 61 // { int|sys||chroot(const char *path); } SYS_VFORK = 66 // { int|sys||vfork(void); } SYS_SBRK = 69 // { int|sys||sbrk(intptr_t incr); } SYS_SSTK = 70 // { int|sys||sstk(int incr); } SYS_VADVISE = 72 // { int|sys||ovadvise(int anom); } SYS_MUNMAP = 73 // { int|sys||munmap(void *addr, size_t len); } SYS_MPROTECT = 74 // { int|sys||mprotect(void *addr, size_t len, int prot); } SYS_MADVISE = 75 // { int|sys||madvise(void *addr, size_t len, int behav); } SYS_MINCORE = 78 // { int|sys||mincore(void *addr, size_t len, char *vec); } SYS_GETGROUPS = 79 // { int|sys||getgroups(int gidsetsize, gid_t *gidset); } SYS_SETGROUPS = 80 // { int|sys||setgroups(int gidsetsize, const gid_t *gidset); } SYS_GETPGRP = 81 // { int|sys||getpgrp(void); } SYS_SETPGID = 82 // { int|sys||setpgid(pid_t pid, pid_t pgid); } SYS_DUP2 = 90 // { int|sys||dup2(int from, int to); } SYS_FCNTL = 92 // { int|sys||fcntl(int fd, int cmd, ... void *arg); } SYS_FSYNC = 95 // { int|sys||fsync(int fd); } SYS_SETPRIORITY = 96 // { int|sys||setpriority(int which, id_t who, int prio); } SYS_CONNECT = 98 // { int|sys||connect(int s, const struct sockaddr *name, socklen_t namelen); } SYS_GETPRIORITY = 100 // { int|sys||getpriority(int which, id_t who); } SYS_BIND = 104 // { int|sys||bind(int s, const struct sockaddr *name, socklen_t namelen); } SYS_SETSOCKOPT = 105 // { int|sys||setsockopt(int s, int level, int name, const void *val, socklen_t valsize); } SYS_LISTEN = 106 // { int|sys||listen(int s, int backlog); } SYS_GETSOCKOPT = 118 // { int|sys||getsockopt(int s, int level, int name, void *val, socklen_t *avalsize); } SYS_READV = 120 // { ssize_t|sys||readv(int fd, const struct iovec *iovp, int iovcnt); } SYS_WRITEV = 121 // { ssize_t|sys||writev(int fd, const struct iovec *iovp, int iovcnt); } SYS_FCHOWN = 123 // { int|sys||fchown(int fd, uid_t uid, gid_t gid); } SYS_FCHMOD = 124 // { int|sys||fchmod(int fd, mode_t mode); } SYS_SETREUID = 126 // { int|sys||setreuid(uid_t ruid, uid_t euid); } SYS_SETREGID = 127 // { int|sys||setregid(gid_t rgid, gid_t egid); } SYS_RENAME = 128 // { int|sys||rename(const char *from, const char *to); } SYS_FLOCK = 131 // { int|sys||flock(int fd, int how); } SYS_MKFIFO = 132 // { int|sys||mkfifo(const char *path, mode_t mode); } SYS_SENDTO = 133 // { ssize_t|sys||sendto(int s, const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen); } SYS_SHUTDOWN = 134 // { int|sys||shutdown(int s, int how); } SYS_SOCKETPAIR = 135 // { int|sys||socketpair(int domain, int type, int protocol, int *rsv); } SYS_MKDIR = 136 // { int|sys||mkdir(const char *path, mode_t mode); } SYS_RMDIR = 137 // { int|sys||rmdir(const char *path); } SYS_SETSID = 147 // { int|sys||setsid(void); } SYS_SYSARCH = 165 // { int|sys||sysarch(int op, void *parms); } SYS_PREAD = 173 // { ssize_t|sys||pread(int fd, void *buf, size_t nbyte, int PAD, off_t offset); } SYS_PWRITE = 174 // { ssize_t|sys||pwrite(int fd, const void *buf, size_t nbyte, int PAD, off_t offset); } SYS_NTP_ADJTIME = 176 // { int|sys||ntp_adjtime(struct timex *tp); } SYS_SETGID = 181 // { int|sys||setgid(gid_t gid); } SYS_SETEGID = 182 // { int|sys||setegid(gid_t egid); } SYS_SETEUID = 183 // { int|sys||seteuid(uid_t euid); } SYS_PATHCONF = 191 // { long|sys||pathconf(const char *path, int name); } SYS_FPATHCONF = 192 // { long|sys||fpathconf(int fd, int name); } SYS_GETRLIMIT = 194 // { int|sys||getrlimit(int which, struct rlimit *rlp); } SYS_SETRLIMIT = 195 // { int|sys||setrlimit(int which, const struct rlimit *rlp); } SYS_MMAP = 197 // { void *|sys||mmap(void *addr, size_t len, int prot, int flags, int fd, long PAD, off_t pos); } SYS_LSEEK = 199 // { off_t|sys||lseek(int fd, int PAD, off_t offset, int whence); } SYS_TRUNCATE = 200 // { int|sys||truncate(const char *path, int PAD, off_t length); } SYS_FTRUNCATE = 201 // { int|sys||ftruncate(int fd, int PAD, off_t length); } SYS___SYSCTL = 202 // { int|sys||__sysctl(const int *name, u_int namelen, void *old, size_t *oldlenp, const void *new, size_t newlen); } SYS_MLOCK = 203 // { int|sys||mlock(const void *addr, size_t len); } SYS_MUNLOCK = 204 // { int|sys||munlock(const void *addr, size_t len); } SYS_UNDELETE = 205 // { int|sys||undelete(const char *path); } SYS_GETPGID = 207 // { pid_t|sys||getpgid(pid_t pid); } SYS_REBOOT = 208 // { int|sys||reboot(int opt, char *bootstr); } SYS_POLL = 209 // { int|sys||poll(struct pollfd *fds, u_int nfds, int timeout); } SYS_SEMGET = 221 // { int|sys||semget(key_t key, int nsems, int semflg); } SYS_SEMOP = 222 // { int|sys||semop(int semid, struct sembuf *sops, size_t nsops); } SYS_SEMCONFIG = 223 // { int|sys||semconfig(int flag); } SYS_MSGGET = 225 // { int|sys||msgget(key_t key, int msgflg); } SYS_MSGSND = 226 // { int|sys||msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg); } SYS_MSGRCV = 227 // { ssize_t|sys||msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg); } SYS_SHMAT = 228 // { void *|sys||shmat(int shmid, const void *shmaddr, int shmflg); } SYS_SHMDT = 230 // { int|sys||shmdt(const void *shmaddr); } SYS_SHMGET = 231 // { int|sys||shmget(key_t key, size_t size, int shmflg); } SYS_TIMER_CREATE = 235 // { int|sys||timer_create(clockid_t clock_id, struct sigevent *evp, timer_t *timerid); } SYS_TIMER_DELETE = 236 // { int|sys||timer_delete(timer_t timerid); } SYS_TIMER_GETOVERRUN = 239 // { int|sys||timer_getoverrun(timer_t timerid); } SYS_FDATASYNC = 241 // { int|sys||fdatasync(int fd); } SYS_MLOCKALL = 242 // { int|sys||mlockall(int flags); } SYS_MUNLOCKALL = 243 // { int|sys||munlockall(void); } SYS_SIGQUEUEINFO = 245 // { int|sys||sigqueueinfo(pid_t pid, const siginfo_t *info); } SYS_MODCTL = 246 // { int|sys||modctl(int cmd, void *arg); } SYS___POSIX_RENAME = 270 // { int|sys||__posix_rename(const char *from, const char *to); } SYS_SWAPCTL = 271 // { int|sys||swapctl(int cmd, void *arg, int misc); } SYS_MINHERIT = 273 // { int|sys||minherit(void *addr, size_t len, int inherit); } SYS_LCHMOD = 274 // { int|sys||lchmod(const char *path, mode_t mode); } SYS_LCHOWN = 275 // { int|sys||lchown(const char *path, uid_t uid, gid_t gid); } SYS_MSYNC = 277 // { int|sys|13|msync(void *addr, size_t len, int flags); } SYS___POSIX_CHOWN = 283 // { int|sys||__posix_chown(const char *path, uid_t uid, gid_t gid); } SYS___POSIX_FCHOWN = 284 // { int|sys||__posix_fchown(int fd, uid_t uid, gid_t gid); } SYS___POSIX_LCHOWN = 285 // { int|sys||__posix_lchown(const char *path, uid_t uid, gid_t gid); } SYS_GETSID = 286 // { pid_t|sys||getsid(pid_t pid); } SYS___CLONE = 287 // { pid_t|sys||__clone(int flags, void *stack); } SYS_FKTRACE = 288 // { int|sys||fktrace(int fd, int ops, int facs, pid_t pid); } SYS_PREADV = 289 // { ssize_t|sys||preadv(int fd, const struct iovec *iovp, int iovcnt, int PAD, off_t offset); } SYS_PWRITEV = 290 // { ssize_t|sys||pwritev(int fd, const struct iovec *iovp, int iovcnt, int PAD, off_t offset); } SYS___GETCWD = 296 // { int|sys||__getcwd(char *bufp, size_t length); } SYS_FCHROOT = 297 // { int|sys||fchroot(int fd); } SYS_LCHFLAGS = 304 // { int|sys||lchflags(const char *path, u_long flags); } SYS_ISSETUGID = 305 // { int|sys||issetugid(void); } SYS_UTRACE = 306 // { int|sys||utrace(const char *label, void *addr, size_t len); } SYS_GETCONTEXT = 307 // { int|sys||getcontext(struct __ucontext *ucp); } SYS_SETCONTEXT = 308 // { int|sys||setcontext(const struct __ucontext *ucp); } SYS__LWP_CREATE = 309 // { int|sys||_lwp_create(const struct __ucontext *ucp, u_long flags, lwpid_t *new_lwp); } SYS__LWP_EXIT = 310 // { int|sys||_lwp_exit(void); } SYS__LWP_SELF = 311 // { lwpid_t|sys||_lwp_self(void); } SYS__LWP_WAIT = 312 // { int|sys||_lwp_wait(lwpid_t wait_for, lwpid_t *departed); } SYS__LWP_SUSPEND = 313 // { int|sys||_lwp_suspend(lwpid_t target); } SYS__LWP_CONTINUE = 314 // { int|sys||_lwp_continue(lwpid_t target); } SYS__LWP_WAKEUP = 315 // { int|sys||_lwp_wakeup(lwpid_t target); } SYS__LWP_GETPRIVATE = 316 // { void *|sys||_lwp_getprivate(void); } SYS__LWP_SETPRIVATE = 317 // { void|sys||_lwp_setprivate(void *ptr); } SYS__LWP_KILL = 318 // { int|sys||_lwp_kill(lwpid_t target, int signo); } SYS__LWP_DETACH = 319 // { int|sys||_lwp_detach(lwpid_t target); } SYS__LWP_UNPARK = 321 // { int|sys||_lwp_unpark(lwpid_t target, const void *hint); } SYS__LWP_UNPARK_ALL = 322 // { ssize_t|sys||_lwp_unpark_all(const lwpid_t *targets, size_t ntargets, const void *hint); } SYS__LWP_SETNAME = 323 // { int|sys||_lwp_setname(lwpid_t target, const char *name); } SYS__LWP_GETNAME = 324 // { int|sys||_lwp_getname(lwpid_t target, char *name, size_t len); } SYS__LWP_CTL = 325 // { int|sys||_lwp_ctl(int features, struct lwpctl **address); } SYS___SIGACTION_SIGTRAMP = 340 // { int|sys||__sigaction_sigtramp(int signum, const struct sigaction *nsa, struct sigaction *osa, const void *tramp, int vers); } SYS_PMC_GET_INFO = 341 // { int|sys||pmc_get_info(int ctr, int op, void *args); } SYS_PMC_CONTROL = 342 // { int|sys||pmc_control(int ctr, int op, void *args); } SYS_RASCTL = 343 // { int|sys||rasctl(void *addr, size_t len, int op); } SYS_KQUEUE = 344 // { int|sys||kqueue(void); } SYS__SCHED_SETPARAM = 346 // { int|sys||_sched_setparam(pid_t pid, lwpid_t lid, int policy, const struct sched_param *params); } SYS__SCHED_GETPARAM = 347 // { int|sys||_sched_getparam(pid_t pid, lwpid_t lid, int *policy, struct sched_param *params); } SYS__SCHED_SETAFFINITY = 348 // { int|sys||_sched_setaffinity(pid_t pid, lwpid_t lid, size_t size, const cpuset_t *cpuset); } SYS__SCHED_GETAFFINITY = 349 // { int|sys||_sched_getaffinity(pid_t pid, lwpid_t lid, size_t size, cpuset_t *cpuset); } SYS_SCHED_YIELD = 350 // { int|sys||sched_yield(void); } SYS_FSYNC_RANGE = 354 // { int|sys||fsync_range(int fd, int flags, off_t start, off_t length); } SYS_UUIDGEN = 355 // { int|sys||uuidgen(struct uuid *store, int count); } SYS_GETVFSSTAT = 356 // { int|sys||getvfsstat(struct statvfs *buf, size_t bufsize, int flags); } SYS_STATVFS1 = 357 // { int|sys||statvfs1(const char *path, struct statvfs *buf, int flags); } SYS_FSTATVFS1 = 358 // { int|sys||fstatvfs1(int fd, struct statvfs *buf, int flags); } SYS_EXTATTRCTL = 360 // { int|sys||extattrctl(const char *path, int cmd, const char *filename, int attrnamespace, const char *attrname); } SYS_EXTATTR_SET_FILE = 361 // { int|sys||extattr_set_file(const char *path, int attrnamespace, const char *attrname, const void *data, size_t nbytes); } SYS_EXTATTR_GET_FILE = 362 // { ssize_t|sys||extattr_get_file(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_DELETE_FILE = 363 // { int|sys||extattr_delete_file(const char *path, int attrnamespace, const char *attrname); } SYS_EXTATTR_SET_FD = 364 // { int|sys||extattr_set_fd(int fd, int attrnamespace, const char *attrname, const void *data, size_t nbytes); } SYS_EXTATTR_GET_FD = 365 // { ssize_t|sys||extattr_get_fd(int fd, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_DELETE_FD = 366 // { int|sys||extattr_delete_fd(int fd, int attrnamespace, const char *attrname); } SYS_EXTATTR_SET_LINK = 367 // { int|sys||extattr_set_link(const char *path, int attrnamespace, const char *attrname, const void *data, size_t nbytes); } SYS_EXTATTR_GET_LINK = 368 // { ssize_t|sys||extattr_get_link(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_DELETE_LINK = 369 // { int|sys||extattr_delete_link(const char *path, int attrnamespace, const char *attrname); } SYS_EXTATTR_LIST_FD = 370 // { ssize_t|sys||extattr_list_fd(int fd, int attrnamespace, void *data, size_t nbytes); } SYS_EXTATTR_LIST_FILE = 371 // { ssize_t|sys||extattr_list_file(const char *path, int attrnamespace, void *data, size_t nbytes); } SYS_EXTATTR_LIST_LINK = 372 // { ssize_t|sys||extattr_list_link(const char *path, int attrnamespace, void *data, size_t nbytes); } SYS_SETXATTR = 375 // { int|sys||setxattr(const char *path, const char *name, const void *value, size_t size, int flags); } SYS_LSETXATTR = 376 // { int|sys||lsetxattr(const char *path, const char *name, const void *value, size_t size, int flags); } SYS_FSETXATTR = 377 // { int|sys||fsetxattr(int fd, const char *name, const void *value, size_t size, int flags); } SYS_GETXATTR = 378 // { int|sys||getxattr(const char *path, const char *name, void *value, size_t size); } SYS_LGETXATTR = 379 // { int|sys||lgetxattr(const char *path, const char *name, void *value, size_t size); } SYS_FGETXATTR = 380 // { int|sys||fgetxattr(int fd, const char *name, void *value, size_t size); } SYS_LISTXATTR = 381 // { int|sys||listxattr(const char *path, char *list, size_t size); } SYS_LLISTXATTR = 382 // { int|sys||llistxattr(const char *path, char *list, size_t size); } SYS_FLISTXATTR = 383 // { int|sys||flistxattr(int fd, char *list, size_t size); } SYS_REMOVEXATTR = 384 // { int|sys||removexattr(const char *path, const char *name); } SYS_LREMOVEXATTR = 385 // { int|sys||lremovexattr(const char *path, const char *name); } SYS_FREMOVEXATTR = 386 // { int|sys||fremovexattr(int fd, const char *name); } SYS_GETDENTS = 390 // { int|sys|30|getdents(int fd, char *buf, size_t count); } SYS_SOCKET = 394 // { int|sys|30|socket(int domain, int type, int protocol); } SYS_GETFH = 395 // { int|sys|30|getfh(const char *fname, void *fhp, size_t *fh_size); } SYS_MOUNT = 410 // { int|sys|50|mount(const char *type, const char *path, int flags, void *data, size_t data_len); } SYS_MREMAP = 411 // { void *|sys||mremap(void *old_address, size_t old_size, void *new_address, size_t new_size, int flags); } SYS_PSET_CREATE = 412 // { int|sys||pset_create(psetid_t *psid); } SYS_PSET_DESTROY = 413 // { int|sys||pset_destroy(psetid_t psid); } SYS_PSET_ASSIGN = 414 // { int|sys||pset_assign(psetid_t psid, cpuid_t cpuid, psetid_t *opsid); } SYS__PSET_BIND = 415 // { int|sys||_pset_bind(idtype_t idtype, id_t first_id, id_t second_id, psetid_t psid, psetid_t *opsid); } SYS_POSIX_FADVISE = 416 // { int|sys|50|posix_fadvise(int fd, int PAD, off_t offset, off_t len, int advice); } SYS_SELECT = 417 // { int|sys|50|select(int nd, fd_set *in, fd_set *ou, fd_set *ex, struct timeval *tv); } SYS_GETTIMEOFDAY = 418 // { int|sys|50|gettimeofday(struct timeval *tp, void *tzp); } SYS_SETTIMEOFDAY = 419 // { int|sys|50|settimeofday(const struct timeval *tv, const void *tzp); } SYS_UTIMES = 420 // { int|sys|50|utimes(const char *path, const struct timeval *tptr); } SYS_ADJTIME = 421 // { int|sys|50|adjtime(const struct timeval *delta, struct timeval *olddelta); } SYS_FUTIMES = 423 // { int|sys|50|futimes(int fd, const struct timeval *tptr); } SYS_LUTIMES = 424 // { int|sys|50|lutimes(const char *path, const struct timeval *tptr); } SYS_SETITIMER = 425 // { int|sys|50|setitimer(int which, const struct itimerval *itv, struct itimerval *oitv); } SYS_GETITIMER = 426 // { int|sys|50|getitimer(int which, struct itimerval *itv); } SYS_CLOCK_GETTIME = 427 // { int|sys|50|clock_gettime(clockid_t clock_id, struct timespec *tp); } SYS_CLOCK_SETTIME = 428 // { int|sys|50|clock_settime(clockid_t clock_id, const struct timespec *tp); } SYS_CLOCK_GETRES = 429 // { int|sys|50|clock_getres(clockid_t clock_id, struct timespec *tp); } SYS_NANOSLEEP = 430 // { int|sys|50|nanosleep(const struct timespec *rqtp, struct timespec *rmtp); } SYS___SIGTIMEDWAIT = 431 // { int|sys|50|__sigtimedwait(const sigset_t *set, siginfo_t *info, struct timespec *timeout); } SYS__LWP_PARK = 434 // { int|sys|50|_lwp_park(const struct timespec *ts, lwpid_t unpark, const void *hint, const void *unparkhint); } SYS_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); } SYS_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); } SYS_POLLTS = 437 // { int|sys|50|pollts(struct pollfd *fds, u_int nfds, const struct timespec *ts, const sigset_t *mask); } SYS_STAT = 439 // { int|sys|50|stat(const char *path, struct stat *ub); } SYS_FSTAT = 440 // { int|sys|50|fstat(int fd, struct stat *sb); } SYS_LSTAT = 441 // { int|sys|50|lstat(const char *path, struct stat *ub); } SYS___SEMCTL = 442 // { int|sys|50|__semctl(int semid, int semnum, int cmd, ... union __semun *arg); } SYS_SHMCTL = 443 // { int|sys|50|shmctl(int shmid, int cmd, struct shmid_ds *buf); } SYS_MSGCTL = 444 // { int|sys|50|msgctl(int msqid, int cmd, struct msqid_ds *buf); } SYS_GETRUSAGE = 445 // { int|sys|50|getrusage(int who, struct rusage *rusage); } SYS_TIMER_SETTIME = 446 // { int|sys|50|timer_settime(timer_t timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue); } SYS_TIMER_GETTIME = 447 // { int|sys|50|timer_gettime(timer_t timerid, struct itimerspec *value); } SYS_NTP_GETTIME = 448 // { int|sys|50|ntp_gettime(struct ntptimeval *ntvp); } SYS_WAIT4 = 449 // { int|sys|50|wait4(pid_t pid, int *status, int options, struct rusage *rusage); } SYS_MKNOD = 450 // { int|sys|50|mknod(const char *path, mode_t mode, dev_t dev); } SYS_FHSTAT = 451 // { int|sys|50|fhstat(const void *fhp, size_t fh_size, struct stat *sb); } SYS_PIPE2 = 453 // { int|sys||pipe2(int *fildes, int flags); } SYS_DUP3 = 454 // { int|sys||dup3(int from, int to, int flags); } SYS_KQUEUE1 = 455 // { int|sys||kqueue1(int flags); } SYS_PACCEPT = 456 // { int|sys||paccept(int s, struct sockaddr *name, socklen_t *anamelen, const sigset_t *mask, int flags); } SYS_LINKAT = 457 // { int|sys||linkat(int fd1, const char *name1, int fd2, const char *name2, int flags); } SYS_RENAMEAT = 458 // { int|sys||renameat(int fromfd, const char *from, int tofd, const char *to); } SYS_MKFIFOAT = 459 // { int|sys||mkfifoat(int fd, const char *path, mode_t mode); } SYS_MKNODAT = 460 // { int|sys||mknodat(int fd, const char *path, mode_t mode, uint32_t dev); } SYS_MKDIRAT = 461 // { int|sys||mkdirat(int fd, const char *path, mode_t mode); } SYS_FACCESSAT = 462 // { int|sys||faccessat(int fd, const char *path, int amode, int flag); } SYS_FCHMODAT = 463 // { int|sys||fchmodat(int fd, const char *path, mode_t mode, int flag); } SYS_FCHOWNAT = 464 // { int|sys||fchownat(int fd, const char *path, uid_t owner, gid_t group, int flag); } SYS_FEXECVE = 465 // { int|sys||fexecve(int fd, char * const *argp, char * const *envp); } SYS_FSTATAT = 466 // { int|sys||fstatat(int fd, const char *path, struct stat *buf, int flag); } SYS_UTIMENSAT = 467 // { int|sys||utimensat(int fd, const char *path, const struct timespec *tptr, int flag); } SYS_OPENAT = 468 // { int|sys||openat(int fd, const char *path, int oflags, ... mode_t mode); } SYS_READLINKAT = 469 // { int|sys||readlinkat(int fd, const char *path, char *buf, size_t bufsize); } SYS_SYMLINKAT = 470 // { int|sys||symlinkat(const char *path1, int fd, const char *path2); } SYS_UNLINKAT = 471 // { int|sys||unlinkat(int fd, const char *path, int flag); } SYS_FUTIMENS = 472 // { int|sys||futimens(int fd, const struct timespec *tptr); } SYS___QUOTACTL = 473 // { int|sys||__quotactl(const char *path, struct quotactl_args *args); } SYS_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); } SYS_RECVMMSG = 475 // { int|sys||recvmmsg(int s, struct mmsghdr *mmsg, unsigned int vlen, unsigned int flags, struct timespec *timeout); } SYS_SENDMMSG = 476 // { int|sys||sendmmsg(int s, struct mmsghdr *mmsg, unsigned int vlen, unsigned int flags); } ) ================================================ FILE: vendor/golang.org/x/sys/unix/zsysnum_netbsd_amd64.go ================================================ // go run mksysnum.go http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master // Code generated by the command above; see README.md. DO NOT EDIT. //go:build amd64 && netbsd package unix const ( SYS_EXIT = 1 // { void|sys||exit(int rval); } SYS_FORK = 2 // { int|sys||fork(void); } SYS_READ = 3 // { ssize_t|sys||read(int fd, void *buf, size_t nbyte); } SYS_WRITE = 4 // { ssize_t|sys||write(int fd, const void *buf, size_t nbyte); } SYS_OPEN = 5 // { int|sys||open(const char *path, int flags, ... mode_t mode); } SYS_CLOSE = 6 // { int|sys||close(int fd); } SYS_LINK = 9 // { int|sys||link(const char *path, const char *link); } SYS_UNLINK = 10 // { int|sys||unlink(const char *path); } SYS_CHDIR = 12 // { int|sys||chdir(const char *path); } SYS_FCHDIR = 13 // { int|sys||fchdir(int fd); } SYS_CHMOD = 15 // { int|sys||chmod(const char *path, mode_t mode); } SYS_CHOWN = 16 // { int|sys||chown(const char *path, uid_t uid, gid_t gid); } SYS_BREAK = 17 // { int|sys||obreak(char *nsize); } SYS_GETPID = 20 // { pid_t|sys||getpid_with_ppid(void); } SYS_UNMOUNT = 22 // { int|sys||unmount(const char *path, int flags); } SYS_SETUID = 23 // { int|sys||setuid(uid_t uid); } SYS_GETUID = 24 // { uid_t|sys||getuid_with_euid(void); } SYS_GETEUID = 25 // { uid_t|sys||geteuid(void); } SYS_PTRACE = 26 // { int|sys||ptrace(int req, pid_t pid, void *addr, int data); } SYS_RECVMSG = 27 // { ssize_t|sys||recvmsg(int s, struct msghdr *msg, int flags); } SYS_SENDMSG = 28 // { ssize_t|sys||sendmsg(int s, const struct msghdr *msg, int flags); } SYS_RECVFROM = 29 // { ssize_t|sys||recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlenaddr); } SYS_ACCEPT = 30 // { int|sys||accept(int s, struct sockaddr *name, socklen_t *anamelen); } SYS_GETPEERNAME = 31 // { int|sys||getpeername(int fdes, struct sockaddr *asa, socklen_t *alen); } SYS_GETSOCKNAME = 32 // { int|sys||getsockname(int fdes, struct sockaddr *asa, socklen_t *alen); } SYS_ACCESS = 33 // { int|sys||access(const char *path, int flags); } SYS_CHFLAGS = 34 // { int|sys||chflags(const char *path, u_long flags); } SYS_FCHFLAGS = 35 // { int|sys||fchflags(int fd, u_long flags); } SYS_SYNC = 36 // { void|sys||sync(void); } SYS_KILL = 37 // { int|sys||kill(pid_t pid, int signum); } SYS_GETPPID = 39 // { pid_t|sys||getppid(void); } SYS_DUP = 41 // { int|sys||dup(int fd); } SYS_PIPE = 42 // { int|sys||pipe(void); } SYS_GETEGID = 43 // { gid_t|sys||getegid(void); } SYS_PROFIL = 44 // { int|sys||profil(char *samples, size_t size, u_long offset, u_int scale); } SYS_KTRACE = 45 // { int|sys||ktrace(const char *fname, int ops, int facs, pid_t pid); } SYS_GETGID = 47 // { gid_t|sys||getgid_with_egid(void); } SYS___GETLOGIN = 49 // { int|sys||__getlogin(char *namebuf, size_t namelen); } SYS___SETLOGIN = 50 // { int|sys||__setlogin(const char *namebuf); } SYS_ACCT = 51 // { int|sys||acct(const char *path); } SYS_IOCTL = 54 // { int|sys||ioctl(int fd, u_long com, ... void *data); } SYS_REVOKE = 56 // { int|sys||revoke(const char *path); } SYS_SYMLINK = 57 // { int|sys||symlink(const char *path, const char *link); } SYS_READLINK = 58 // { ssize_t|sys||readlink(const char *path, char *buf, size_t count); } SYS_EXECVE = 59 // { int|sys||execve(const char *path, char * const *argp, char * const *envp); } SYS_UMASK = 60 // { mode_t|sys||umask(mode_t newmask); } SYS_CHROOT = 61 // { int|sys||chroot(const char *path); } SYS_VFORK = 66 // { int|sys||vfork(void); } SYS_SBRK = 69 // { int|sys||sbrk(intptr_t incr); } SYS_SSTK = 70 // { int|sys||sstk(int incr); } SYS_VADVISE = 72 // { int|sys||ovadvise(int anom); } SYS_MUNMAP = 73 // { int|sys||munmap(void *addr, size_t len); } SYS_MPROTECT = 74 // { int|sys||mprotect(void *addr, size_t len, int prot); } SYS_MADVISE = 75 // { int|sys||madvise(void *addr, size_t len, int behav); } SYS_MINCORE = 78 // { int|sys||mincore(void *addr, size_t len, char *vec); } SYS_GETGROUPS = 79 // { int|sys||getgroups(int gidsetsize, gid_t *gidset); } SYS_SETGROUPS = 80 // { int|sys||setgroups(int gidsetsize, const gid_t *gidset); } SYS_GETPGRP = 81 // { int|sys||getpgrp(void); } SYS_SETPGID = 82 // { int|sys||setpgid(pid_t pid, pid_t pgid); } SYS_DUP2 = 90 // { int|sys||dup2(int from, int to); } SYS_FCNTL = 92 // { int|sys||fcntl(int fd, int cmd, ... void *arg); } SYS_FSYNC = 95 // { int|sys||fsync(int fd); } SYS_SETPRIORITY = 96 // { int|sys||setpriority(int which, id_t who, int prio); } SYS_CONNECT = 98 // { int|sys||connect(int s, const struct sockaddr *name, socklen_t namelen); } SYS_GETPRIORITY = 100 // { int|sys||getpriority(int which, id_t who); } SYS_BIND = 104 // { int|sys||bind(int s, const struct sockaddr *name, socklen_t namelen); } SYS_SETSOCKOPT = 105 // { int|sys||setsockopt(int s, int level, int name, const void *val, socklen_t valsize); } SYS_LISTEN = 106 // { int|sys||listen(int s, int backlog); } SYS_GETSOCKOPT = 118 // { int|sys||getsockopt(int s, int level, int name, void *val, socklen_t *avalsize); } SYS_READV = 120 // { ssize_t|sys||readv(int fd, const struct iovec *iovp, int iovcnt); } SYS_WRITEV = 121 // { ssize_t|sys||writev(int fd, const struct iovec *iovp, int iovcnt); } SYS_FCHOWN = 123 // { int|sys||fchown(int fd, uid_t uid, gid_t gid); } SYS_FCHMOD = 124 // { int|sys||fchmod(int fd, mode_t mode); } SYS_SETREUID = 126 // { int|sys||setreuid(uid_t ruid, uid_t euid); } SYS_SETREGID = 127 // { int|sys||setregid(gid_t rgid, gid_t egid); } SYS_RENAME = 128 // { int|sys||rename(const char *from, const char *to); } SYS_FLOCK = 131 // { int|sys||flock(int fd, int how); } SYS_MKFIFO = 132 // { int|sys||mkfifo(const char *path, mode_t mode); } SYS_SENDTO = 133 // { ssize_t|sys||sendto(int s, const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen); } SYS_SHUTDOWN = 134 // { int|sys||shutdown(int s, int how); } SYS_SOCKETPAIR = 135 // { int|sys||socketpair(int domain, int type, int protocol, int *rsv); } SYS_MKDIR = 136 // { int|sys||mkdir(const char *path, mode_t mode); } SYS_RMDIR = 137 // { int|sys||rmdir(const char *path); } SYS_SETSID = 147 // { int|sys||setsid(void); } SYS_SYSARCH = 165 // { int|sys||sysarch(int op, void *parms); } SYS_PREAD = 173 // { ssize_t|sys||pread(int fd, void *buf, size_t nbyte, int PAD, off_t offset); } SYS_PWRITE = 174 // { ssize_t|sys||pwrite(int fd, const void *buf, size_t nbyte, int PAD, off_t offset); } SYS_NTP_ADJTIME = 176 // { int|sys||ntp_adjtime(struct timex *tp); } SYS_SETGID = 181 // { int|sys||setgid(gid_t gid); } SYS_SETEGID = 182 // { int|sys||setegid(gid_t egid); } SYS_SETEUID = 183 // { int|sys||seteuid(uid_t euid); } SYS_PATHCONF = 191 // { long|sys||pathconf(const char *path, int name); } SYS_FPATHCONF = 192 // { long|sys||fpathconf(int fd, int name); } SYS_GETRLIMIT = 194 // { int|sys||getrlimit(int which, struct rlimit *rlp); } SYS_SETRLIMIT = 195 // { int|sys||setrlimit(int which, const struct rlimit *rlp); } SYS_MMAP = 197 // { void *|sys||mmap(void *addr, size_t len, int prot, int flags, int fd, long PAD, off_t pos); } SYS_LSEEK = 199 // { off_t|sys||lseek(int fd, int PAD, off_t offset, int whence); } SYS_TRUNCATE = 200 // { int|sys||truncate(const char *path, int PAD, off_t length); } SYS_FTRUNCATE = 201 // { int|sys||ftruncate(int fd, int PAD, off_t length); } SYS___SYSCTL = 202 // { int|sys||__sysctl(const int *name, u_int namelen, void *old, size_t *oldlenp, const void *new, size_t newlen); } SYS_MLOCK = 203 // { int|sys||mlock(const void *addr, size_t len); } SYS_MUNLOCK = 204 // { int|sys||munlock(const void *addr, size_t len); } SYS_UNDELETE = 205 // { int|sys||undelete(const char *path); } SYS_GETPGID = 207 // { pid_t|sys||getpgid(pid_t pid); } SYS_REBOOT = 208 // { int|sys||reboot(int opt, char *bootstr); } SYS_POLL = 209 // { int|sys||poll(struct pollfd *fds, u_int nfds, int timeout); } SYS_SEMGET = 221 // { int|sys||semget(key_t key, int nsems, int semflg); } SYS_SEMOP = 222 // { int|sys||semop(int semid, struct sembuf *sops, size_t nsops); } SYS_SEMCONFIG = 223 // { int|sys||semconfig(int flag); } SYS_MSGGET = 225 // { int|sys||msgget(key_t key, int msgflg); } SYS_MSGSND = 226 // { int|sys||msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg); } SYS_MSGRCV = 227 // { ssize_t|sys||msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg); } SYS_SHMAT = 228 // { void *|sys||shmat(int shmid, const void *shmaddr, int shmflg); } SYS_SHMDT = 230 // { int|sys||shmdt(const void *shmaddr); } SYS_SHMGET = 231 // { int|sys||shmget(key_t key, size_t size, int shmflg); } SYS_TIMER_CREATE = 235 // { int|sys||timer_create(clockid_t clock_id, struct sigevent *evp, timer_t *timerid); } SYS_TIMER_DELETE = 236 // { int|sys||timer_delete(timer_t timerid); } SYS_TIMER_GETOVERRUN = 239 // { int|sys||timer_getoverrun(timer_t timerid); } SYS_FDATASYNC = 241 // { int|sys||fdatasync(int fd); } SYS_MLOCKALL = 242 // { int|sys||mlockall(int flags); } SYS_MUNLOCKALL = 243 // { int|sys||munlockall(void); } SYS_SIGQUEUEINFO = 245 // { int|sys||sigqueueinfo(pid_t pid, const siginfo_t *info); } SYS_MODCTL = 246 // { int|sys||modctl(int cmd, void *arg); } SYS___POSIX_RENAME = 270 // { int|sys||__posix_rename(const char *from, const char *to); } SYS_SWAPCTL = 271 // { int|sys||swapctl(int cmd, void *arg, int misc); } SYS_MINHERIT = 273 // { int|sys||minherit(void *addr, size_t len, int inherit); } SYS_LCHMOD = 274 // { int|sys||lchmod(const char *path, mode_t mode); } SYS_LCHOWN = 275 // { int|sys||lchown(const char *path, uid_t uid, gid_t gid); } SYS_MSYNC = 277 // { int|sys|13|msync(void *addr, size_t len, int flags); } SYS___POSIX_CHOWN = 283 // { int|sys||__posix_chown(const char *path, uid_t uid, gid_t gid); } SYS___POSIX_FCHOWN = 284 // { int|sys||__posix_fchown(int fd, uid_t uid, gid_t gid); } SYS___POSIX_LCHOWN = 285 // { int|sys||__posix_lchown(const char *path, uid_t uid, gid_t gid); } SYS_GETSID = 286 // { pid_t|sys||getsid(pid_t pid); } SYS___CLONE = 287 // { pid_t|sys||__clone(int flags, void *stack); } SYS_FKTRACE = 288 // { int|sys||fktrace(int fd, int ops, int facs, pid_t pid); } SYS_PREADV = 289 // { ssize_t|sys||preadv(int fd, const struct iovec *iovp, int iovcnt, int PAD, off_t offset); } SYS_PWRITEV = 290 // { ssize_t|sys||pwritev(int fd, const struct iovec *iovp, int iovcnt, int PAD, off_t offset); } SYS___GETCWD = 296 // { int|sys||__getcwd(char *bufp, size_t length); } SYS_FCHROOT = 297 // { int|sys||fchroot(int fd); } SYS_LCHFLAGS = 304 // { int|sys||lchflags(const char *path, u_long flags); } SYS_ISSETUGID = 305 // { int|sys||issetugid(void); } SYS_UTRACE = 306 // { int|sys||utrace(const char *label, void *addr, size_t len); } SYS_GETCONTEXT = 307 // { int|sys||getcontext(struct __ucontext *ucp); } SYS_SETCONTEXT = 308 // { int|sys||setcontext(const struct __ucontext *ucp); } SYS__LWP_CREATE = 309 // { int|sys||_lwp_create(const struct __ucontext *ucp, u_long flags, lwpid_t *new_lwp); } SYS__LWP_EXIT = 310 // { int|sys||_lwp_exit(void); } SYS__LWP_SELF = 311 // { lwpid_t|sys||_lwp_self(void); } SYS__LWP_WAIT = 312 // { int|sys||_lwp_wait(lwpid_t wait_for, lwpid_t *departed); } SYS__LWP_SUSPEND = 313 // { int|sys||_lwp_suspend(lwpid_t target); } SYS__LWP_CONTINUE = 314 // { int|sys||_lwp_continue(lwpid_t target); } SYS__LWP_WAKEUP = 315 // { int|sys||_lwp_wakeup(lwpid_t target); } SYS__LWP_GETPRIVATE = 316 // { void *|sys||_lwp_getprivate(void); } SYS__LWP_SETPRIVATE = 317 // { void|sys||_lwp_setprivate(void *ptr); } SYS__LWP_KILL = 318 // { int|sys||_lwp_kill(lwpid_t target, int signo); } SYS__LWP_DETACH = 319 // { int|sys||_lwp_detach(lwpid_t target); } SYS__LWP_UNPARK = 321 // { int|sys||_lwp_unpark(lwpid_t target, const void *hint); } SYS__LWP_UNPARK_ALL = 322 // { ssize_t|sys||_lwp_unpark_all(const lwpid_t *targets, size_t ntargets, const void *hint); } SYS__LWP_SETNAME = 323 // { int|sys||_lwp_setname(lwpid_t target, const char *name); } SYS__LWP_GETNAME = 324 // { int|sys||_lwp_getname(lwpid_t target, char *name, size_t len); } SYS__LWP_CTL = 325 // { int|sys||_lwp_ctl(int features, struct lwpctl **address); } SYS___SIGACTION_SIGTRAMP = 340 // { int|sys||__sigaction_sigtramp(int signum, const struct sigaction *nsa, struct sigaction *osa, const void *tramp, int vers); } SYS_PMC_GET_INFO = 341 // { int|sys||pmc_get_info(int ctr, int op, void *args); } SYS_PMC_CONTROL = 342 // { int|sys||pmc_control(int ctr, int op, void *args); } SYS_RASCTL = 343 // { int|sys||rasctl(void *addr, size_t len, int op); } SYS_KQUEUE = 344 // { int|sys||kqueue(void); } SYS__SCHED_SETPARAM = 346 // { int|sys||_sched_setparam(pid_t pid, lwpid_t lid, int policy, const struct sched_param *params); } SYS__SCHED_GETPARAM = 347 // { int|sys||_sched_getparam(pid_t pid, lwpid_t lid, int *policy, struct sched_param *params); } SYS__SCHED_SETAFFINITY = 348 // { int|sys||_sched_setaffinity(pid_t pid, lwpid_t lid, size_t size, const cpuset_t *cpuset); } SYS__SCHED_GETAFFINITY = 349 // { int|sys||_sched_getaffinity(pid_t pid, lwpid_t lid, size_t size, cpuset_t *cpuset); } SYS_SCHED_YIELD = 350 // { int|sys||sched_yield(void); } SYS_FSYNC_RANGE = 354 // { int|sys||fsync_range(int fd, int flags, off_t start, off_t length); } SYS_UUIDGEN = 355 // { int|sys||uuidgen(struct uuid *store, int count); } SYS_GETVFSSTAT = 356 // { int|sys||getvfsstat(struct statvfs *buf, size_t bufsize, int flags); } SYS_STATVFS1 = 357 // { int|sys||statvfs1(const char *path, struct statvfs *buf, int flags); } SYS_FSTATVFS1 = 358 // { int|sys||fstatvfs1(int fd, struct statvfs *buf, int flags); } SYS_EXTATTRCTL = 360 // { int|sys||extattrctl(const char *path, int cmd, const char *filename, int attrnamespace, const char *attrname); } SYS_EXTATTR_SET_FILE = 361 // { int|sys||extattr_set_file(const char *path, int attrnamespace, const char *attrname, const void *data, size_t nbytes); } SYS_EXTATTR_GET_FILE = 362 // { ssize_t|sys||extattr_get_file(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_DELETE_FILE = 363 // { int|sys||extattr_delete_file(const char *path, int attrnamespace, const char *attrname); } SYS_EXTATTR_SET_FD = 364 // { int|sys||extattr_set_fd(int fd, int attrnamespace, const char *attrname, const void *data, size_t nbytes); } SYS_EXTATTR_GET_FD = 365 // { ssize_t|sys||extattr_get_fd(int fd, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_DELETE_FD = 366 // { int|sys||extattr_delete_fd(int fd, int attrnamespace, const char *attrname); } SYS_EXTATTR_SET_LINK = 367 // { int|sys||extattr_set_link(const char *path, int attrnamespace, const char *attrname, const void *data, size_t nbytes); } SYS_EXTATTR_GET_LINK = 368 // { ssize_t|sys||extattr_get_link(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_DELETE_LINK = 369 // { int|sys||extattr_delete_link(const char *path, int attrnamespace, const char *attrname); } SYS_EXTATTR_LIST_FD = 370 // { ssize_t|sys||extattr_list_fd(int fd, int attrnamespace, void *data, size_t nbytes); } SYS_EXTATTR_LIST_FILE = 371 // { ssize_t|sys||extattr_list_file(const char *path, int attrnamespace, void *data, size_t nbytes); } SYS_EXTATTR_LIST_LINK = 372 // { ssize_t|sys||extattr_list_link(const char *path, int attrnamespace, void *data, size_t nbytes); } SYS_SETXATTR = 375 // { int|sys||setxattr(const char *path, const char *name, const void *value, size_t size, int flags); } SYS_LSETXATTR = 376 // { int|sys||lsetxattr(const char *path, const char *name, const void *value, size_t size, int flags); } SYS_FSETXATTR = 377 // { int|sys||fsetxattr(int fd, const char *name, const void *value, size_t size, int flags); } SYS_GETXATTR = 378 // { int|sys||getxattr(const char *path, const char *name, void *value, size_t size); } SYS_LGETXATTR = 379 // { int|sys||lgetxattr(const char *path, const char *name, void *value, size_t size); } SYS_FGETXATTR = 380 // { int|sys||fgetxattr(int fd, const char *name, void *value, size_t size); } SYS_LISTXATTR = 381 // { int|sys||listxattr(const char *path, char *list, size_t size); } SYS_LLISTXATTR = 382 // { int|sys||llistxattr(const char *path, char *list, size_t size); } SYS_FLISTXATTR = 383 // { int|sys||flistxattr(int fd, char *list, size_t size); } SYS_REMOVEXATTR = 384 // { int|sys||removexattr(const char *path, const char *name); } SYS_LREMOVEXATTR = 385 // { int|sys||lremovexattr(const char *path, const char *name); } SYS_FREMOVEXATTR = 386 // { int|sys||fremovexattr(int fd, const char *name); } SYS_GETDENTS = 390 // { int|sys|30|getdents(int fd, char *buf, size_t count); } SYS_SOCKET = 394 // { int|sys|30|socket(int domain, int type, int protocol); } SYS_GETFH = 395 // { int|sys|30|getfh(const char *fname, void *fhp, size_t *fh_size); } SYS_MOUNT = 410 // { int|sys|50|mount(const char *type, const char *path, int flags, void *data, size_t data_len); } SYS_MREMAP = 411 // { void *|sys||mremap(void *old_address, size_t old_size, void *new_address, size_t new_size, int flags); } SYS_PSET_CREATE = 412 // { int|sys||pset_create(psetid_t *psid); } SYS_PSET_DESTROY = 413 // { int|sys||pset_destroy(psetid_t psid); } SYS_PSET_ASSIGN = 414 // { int|sys||pset_assign(psetid_t psid, cpuid_t cpuid, psetid_t *opsid); } SYS__PSET_BIND = 415 // { int|sys||_pset_bind(idtype_t idtype, id_t first_id, id_t second_id, psetid_t psid, psetid_t *opsid); } SYS_POSIX_FADVISE = 416 // { int|sys|50|posix_fadvise(int fd, int PAD, off_t offset, off_t len, int advice); } SYS_SELECT = 417 // { int|sys|50|select(int nd, fd_set *in, fd_set *ou, fd_set *ex, struct timeval *tv); } SYS_GETTIMEOFDAY = 418 // { int|sys|50|gettimeofday(struct timeval *tp, void *tzp); } SYS_SETTIMEOFDAY = 419 // { int|sys|50|settimeofday(const struct timeval *tv, const void *tzp); } SYS_UTIMES = 420 // { int|sys|50|utimes(const char *path, const struct timeval *tptr); } SYS_ADJTIME = 421 // { int|sys|50|adjtime(const struct timeval *delta, struct timeval *olddelta); } SYS_FUTIMES = 423 // { int|sys|50|futimes(int fd, const struct timeval *tptr); } SYS_LUTIMES = 424 // { int|sys|50|lutimes(const char *path, const struct timeval *tptr); } SYS_SETITIMER = 425 // { int|sys|50|setitimer(int which, const struct itimerval *itv, struct itimerval *oitv); } SYS_GETITIMER = 426 // { int|sys|50|getitimer(int which, struct itimerval *itv); } SYS_CLOCK_GETTIME = 427 // { int|sys|50|clock_gettime(clockid_t clock_id, struct timespec *tp); } SYS_CLOCK_SETTIME = 428 // { int|sys|50|clock_settime(clockid_t clock_id, const struct timespec *tp); } SYS_CLOCK_GETRES = 429 // { int|sys|50|clock_getres(clockid_t clock_id, struct timespec *tp); } SYS_NANOSLEEP = 430 // { int|sys|50|nanosleep(const struct timespec *rqtp, struct timespec *rmtp); } SYS___SIGTIMEDWAIT = 431 // { int|sys|50|__sigtimedwait(const sigset_t *set, siginfo_t *info, struct timespec *timeout); } SYS__LWP_PARK = 434 // { int|sys|50|_lwp_park(const struct timespec *ts, lwpid_t unpark, const void *hint, const void *unparkhint); } SYS_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); } SYS_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); } SYS_POLLTS = 437 // { int|sys|50|pollts(struct pollfd *fds, u_int nfds, const struct timespec *ts, const sigset_t *mask); } SYS_STAT = 439 // { int|sys|50|stat(const char *path, struct stat *ub); } SYS_FSTAT = 440 // { int|sys|50|fstat(int fd, struct stat *sb); } SYS_LSTAT = 441 // { int|sys|50|lstat(const char *path, struct stat *ub); } SYS___SEMCTL = 442 // { int|sys|50|__semctl(int semid, int semnum, int cmd, ... union __semun *arg); } SYS_SHMCTL = 443 // { int|sys|50|shmctl(int shmid, int cmd, struct shmid_ds *buf); } SYS_MSGCTL = 444 // { int|sys|50|msgctl(int msqid, int cmd, struct msqid_ds *buf); } SYS_GETRUSAGE = 445 // { int|sys|50|getrusage(int who, struct rusage *rusage); } SYS_TIMER_SETTIME = 446 // { int|sys|50|timer_settime(timer_t timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue); } SYS_TIMER_GETTIME = 447 // { int|sys|50|timer_gettime(timer_t timerid, struct itimerspec *value); } SYS_NTP_GETTIME = 448 // { int|sys|50|ntp_gettime(struct ntptimeval *ntvp); } SYS_WAIT4 = 449 // { int|sys|50|wait4(pid_t pid, int *status, int options, struct rusage *rusage); } SYS_MKNOD = 450 // { int|sys|50|mknod(const char *path, mode_t mode, dev_t dev); } SYS_FHSTAT = 451 // { int|sys|50|fhstat(const void *fhp, size_t fh_size, struct stat *sb); } SYS_PIPE2 = 453 // { int|sys||pipe2(int *fildes, int flags); } SYS_DUP3 = 454 // { int|sys||dup3(int from, int to, int flags); } SYS_KQUEUE1 = 455 // { int|sys||kqueue1(int flags); } SYS_PACCEPT = 456 // { int|sys||paccept(int s, struct sockaddr *name, socklen_t *anamelen, const sigset_t *mask, int flags); } SYS_LINKAT = 457 // { int|sys||linkat(int fd1, const char *name1, int fd2, const char *name2, int flags); } SYS_RENAMEAT = 458 // { int|sys||renameat(int fromfd, const char *from, int tofd, const char *to); } SYS_MKFIFOAT = 459 // { int|sys||mkfifoat(int fd, const char *path, mode_t mode); } SYS_MKNODAT = 460 // { int|sys||mknodat(int fd, const char *path, mode_t mode, uint32_t dev); } SYS_MKDIRAT = 461 // { int|sys||mkdirat(int fd, const char *path, mode_t mode); } SYS_FACCESSAT = 462 // { int|sys||faccessat(int fd, const char *path, int amode, int flag); } SYS_FCHMODAT = 463 // { int|sys||fchmodat(int fd, const char *path, mode_t mode, int flag); } SYS_FCHOWNAT = 464 // { int|sys||fchownat(int fd, const char *path, uid_t owner, gid_t group, int flag); } SYS_FEXECVE = 465 // { int|sys||fexecve(int fd, char * const *argp, char * const *envp); } SYS_FSTATAT = 466 // { int|sys||fstatat(int fd, const char *path, struct stat *buf, int flag); } SYS_UTIMENSAT = 467 // { int|sys||utimensat(int fd, const char *path, const struct timespec *tptr, int flag); } SYS_OPENAT = 468 // { int|sys||openat(int fd, const char *path, int oflags, ... mode_t mode); } SYS_READLINKAT = 469 // { int|sys||readlinkat(int fd, const char *path, char *buf, size_t bufsize); } SYS_SYMLINKAT = 470 // { int|sys||symlinkat(const char *path1, int fd, const char *path2); } SYS_UNLINKAT = 471 // { int|sys||unlinkat(int fd, const char *path, int flag); } SYS_FUTIMENS = 472 // { int|sys||futimens(int fd, const struct timespec *tptr); } SYS___QUOTACTL = 473 // { int|sys||__quotactl(const char *path, struct quotactl_args *args); } SYS_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); } SYS_RECVMMSG = 475 // { int|sys||recvmmsg(int s, struct mmsghdr *mmsg, unsigned int vlen, unsigned int flags, struct timespec *timeout); } SYS_SENDMMSG = 476 // { int|sys||sendmmsg(int s, struct mmsghdr *mmsg, unsigned int vlen, unsigned int flags); } ) ================================================ FILE: vendor/golang.org/x/sys/unix/zsysnum_netbsd_arm.go ================================================ // go run mksysnum.go http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm && netbsd package unix const ( SYS_EXIT = 1 // { void|sys||exit(int rval); } SYS_FORK = 2 // { int|sys||fork(void); } SYS_READ = 3 // { ssize_t|sys||read(int fd, void *buf, size_t nbyte); } SYS_WRITE = 4 // { ssize_t|sys||write(int fd, const void *buf, size_t nbyte); } SYS_OPEN = 5 // { int|sys||open(const char *path, int flags, ... mode_t mode); } SYS_CLOSE = 6 // { int|sys||close(int fd); } SYS_LINK = 9 // { int|sys||link(const char *path, const char *link); } SYS_UNLINK = 10 // { int|sys||unlink(const char *path); } SYS_CHDIR = 12 // { int|sys||chdir(const char *path); } SYS_FCHDIR = 13 // { int|sys||fchdir(int fd); } SYS_CHMOD = 15 // { int|sys||chmod(const char *path, mode_t mode); } SYS_CHOWN = 16 // { int|sys||chown(const char *path, uid_t uid, gid_t gid); } SYS_BREAK = 17 // { int|sys||obreak(char *nsize); } SYS_GETPID = 20 // { pid_t|sys||getpid_with_ppid(void); } SYS_UNMOUNT = 22 // { int|sys||unmount(const char *path, int flags); } SYS_SETUID = 23 // { int|sys||setuid(uid_t uid); } SYS_GETUID = 24 // { uid_t|sys||getuid_with_euid(void); } SYS_GETEUID = 25 // { uid_t|sys||geteuid(void); } SYS_PTRACE = 26 // { int|sys||ptrace(int req, pid_t pid, void *addr, int data); } SYS_RECVMSG = 27 // { ssize_t|sys||recvmsg(int s, struct msghdr *msg, int flags); } SYS_SENDMSG = 28 // { ssize_t|sys||sendmsg(int s, const struct msghdr *msg, int flags); } SYS_RECVFROM = 29 // { ssize_t|sys||recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlenaddr); } SYS_ACCEPT = 30 // { int|sys||accept(int s, struct sockaddr *name, socklen_t *anamelen); } SYS_GETPEERNAME = 31 // { int|sys||getpeername(int fdes, struct sockaddr *asa, socklen_t *alen); } SYS_GETSOCKNAME = 32 // { int|sys||getsockname(int fdes, struct sockaddr *asa, socklen_t *alen); } SYS_ACCESS = 33 // { int|sys||access(const char *path, int flags); } SYS_CHFLAGS = 34 // { int|sys||chflags(const char *path, u_long flags); } SYS_FCHFLAGS = 35 // { int|sys||fchflags(int fd, u_long flags); } SYS_SYNC = 36 // { void|sys||sync(void); } SYS_KILL = 37 // { int|sys||kill(pid_t pid, int signum); } SYS_GETPPID = 39 // { pid_t|sys||getppid(void); } SYS_DUP = 41 // { int|sys||dup(int fd); } SYS_PIPE = 42 // { int|sys||pipe(void); } SYS_GETEGID = 43 // { gid_t|sys||getegid(void); } SYS_PROFIL = 44 // { int|sys||profil(char *samples, size_t size, u_long offset, u_int scale); } SYS_KTRACE = 45 // { int|sys||ktrace(const char *fname, int ops, int facs, pid_t pid); } SYS_GETGID = 47 // { gid_t|sys||getgid_with_egid(void); } SYS___GETLOGIN = 49 // { int|sys||__getlogin(char *namebuf, size_t namelen); } SYS___SETLOGIN = 50 // { int|sys||__setlogin(const char *namebuf); } SYS_ACCT = 51 // { int|sys||acct(const char *path); } SYS_IOCTL = 54 // { int|sys||ioctl(int fd, u_long com, ... void *data); } SYS_REVOKE = 56 // { int|sys||revoke(const char *path); } SYS_SYMLINK = 57 // { int|sys||symlink(const char *path, const char *link); } SYS_READLINK = 58 // { ssize_t|sys||readlink(const char *path, char *buf, size_t count); } SYS_EXECVE = 59 // { int|sys||execve(const char *path, char * const *argp, char * const *envp); } SYS_UMASK = 60 // { mode_t|sys||umask(mode_t newmask); } SYS_CHROOT = 61 // { int|sys||chroot(const char *path); } SYS_VFORK = 66 // { int|sys||vfork(void); } SYS_SBRK = 69 // { int|sys||sbrk(intptr_t incr); } SYS_SSTK = 70 // { int|sys||sstk(int incr); } SYS_VADVISE = 72 // { int|sys||ovadvise(int anom); } SYS_MUNMAP = 73 // { int|sys||munmap(void *addr, size_t len); } SYS_MPROTECT = 74 // { int|sys||mprotect(void *addr, size_t len, int prot); } SYS_MADVISE = 75 // { int|sys||madvise(void *addr, size_t len, int behav); } SYS_MINCORE = 78 // { int|sys||mincore(void *addr, size_t len, char *vec); } SYS_GETGROUPS = 79 // { int|sys||getgroups(int gidsetsize, gid_t *gidset); } SYS_SETGROUPS = 80 // { int|sys||setgroups(int gidsetsize, const gid_t *gidset); } SYS_GETPGRP = 81 // { int|sys||getpgrp(void); } SYS_SETPGID = 82 // { int|sys||setpgid(pid_t pid, pid_t pgid); } SYS_DUP2 = 90 // { int|sys||dup2(int from, int to); } SYS_FCNTL = 92 // { int|sys||fcntl(int fd, int cmd, ... void *arg); } SYS_FSYNC = 95 // { int|sys||fsync(int fd); } SYS_SETPRIORITY = 96 // { int|sys||setpriority(int which, id_t who, int prio); } SYS_CONNECT = 98 // { int|sys||connect(int s, const struct sockaddr *name, socklen_t namelen); } SYS_GETPRIORITY = 100 // { int|sys||getpriority(int which, id_t who); } SYS_BIND = 104 // { int|sys||bind(int s, const struct sockaddr *name, socklen_t namelen); } SYS_SETSOCKOPT = 105 // { int|sys||setsockopt(int s, int level, int name, const void *val, socklen_t valsize); } SYS_LISTEN = 106 // { int|sys||listen(int s, int backlog); } SYS_GETSOCKOPT = 118 // { int|sys||getsockopt(int s, int level, int name, void *val, socklen_t *avalsize); } SYS_READV = 120 // { ssize_t|sys||readv(int fd, const struct iovec *iovp, int iovcnt); } SYS_WRITEV = 121 // { ssize_t|sys||writev(int fd, const struct iovec *iovp, int iovcnt); } SYS_FCHOWN = 123 // { int|sys||fchown(int fd, uid_t uid, gid_t gid); } SYS_FCHMOD = 124 // { int|sys||fchmod(int fd, mode_t mode); } SYS_SETREUID = 126 // { int|sys||setreuid(uid_t ruid, uid_t euid); } SYS_SETREGID = 127 // { int|sys||setregid(gid_t rgid, gid_t egid); } SYS_RENAME = 128 // { int|sys||rename(const char *from, const char *to); } SYS_FLOCK = 131 // { int|sys||flock(int fd, int how); } SYS_MKFIFO = 132 // { int|sys||mkfifo(const char *path, mode_t mode); } SYS_SENDTO = 133 // { ssize_t|sys||sendto(int s, const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen); } SYS_SHUTDOWN = 134 // { int|sys||shutdown(int s, int how); } SYS_SOCKETPAIR = 135 // { int|sys||socketpair(int domain, int type, int protocol, int *rsv); } SYS_MKDIR = 136 // { int|sys||mkdir(const char *path, mode_t mode); } SYS_RMDIR = 137 // { int|sys||rmdir(const char *path); } SYS_SETSID = 147 // { int|sys||setsid(void); } SYS_SYSARCH = 165 // { int|sys||sysarch(int op, void *parms); } SYS_PREAD = 173 // { ssize_t|sys||pread(int fd, void *buf, size_t nbyte, int PAD, off_t offset); } SYS_PWRITE = 174 // { ssize_t|sys||pwrite(int fd, const void *buf, size_t nbyte, int PAD, off_t offset); } SYS_NTP_ADJTIME = 176 // { int|sys||ntp_adjtime(struct timex *tp); } SYS_SETGID = 181 // { int|sys||setgid(gid_t gid); } SYS_SETEGID = 182 // { int|sys||setegid(gid_t egid); } SYS_SETEUID = 183 // { int|sys||seteuid(uid_t euid); } SYS_PATHCONF = 191 // { long|sys||pathconf(const char *path, int name); } SYS_FPATHCONF = 192 // { long|sys||fpathconf(int fd, int name); } SYS_GETRLIMIT = 194 // { int|sys||getrlimit(int which, struct rlimit *rlp); } SYS_SETRLIMIT = 195 // { int|sys||setrlimit(int which, const struct rlimit *rlp); } SYS_MMAP = 197 // { void *|sys||mmap(void *addr, size_t len, int prot, int flags, int fd, long PAD, off_t pos); } SYS_LSEEK = 199 // { off_t|sys||lseek(int fd, int PAD, off_t offset, int whence); } SYS_TRUNCATE = 200 // { int|sys||truncate(const char *path, int PAD, off_t length); } SYS_FTRUNCATE = 201 // { int|sys||ftruncate(int fd, int PAD, off_t length); } SYS___SYSCTL = 202 // { int|sys||__sysctl(const int *name, u_int namelen, void *old, size_t *oldlenp, const void *new, size_t newlen); } SYS_MLOCK = 203 // { int|sys||mlock(const void *addr, size_t len); } SYS_MUNLOCK = 204 // { int|sys||munlock(const void *addr, size_t len); } SYS_UNDELETE = 205 // { int|sys||undelete(const char *path); } SYS_GETPGID = 207 // { pid_t|sys||getpgid(pid_t pid); } SYS_REBOOT = 208 // { int|sys||reboot(int opt, char *bootstr); } SYS_POLL = 209 // { int|sys||poll(struct pollfd *fds, u_int nfds, int timeout); } SYS_SEMGET = 221 // { int|sys||semget(key_t key, int nsems, int semflg); } SYS_SEMOP = 222 // { int|sys||semop(int semid, struct sembuf *sops, size_t nsops); } SYS_SEMCONFIG = 223 // { int|sys||semconfig(int flag); } SYS_MSGGET = 225 // { int|sys||msgget(key_t key, int msgflg); } SYS_MSGSND = 226 // { int|sys||msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg); } SYS_MSGRCV = 227 // { ssize_t|sys||msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg); } SYS_SHMAT = 228 // { void *|sys||shmat(int shmid, const void *shmaddr, int shmflg); } SYS_SHMDT = 230 // { int|sys||shmdt(const void *shmaddr); } SYS_SHMGET = 231 // { int|sys||shmget(key_t key, size_t size, int shmflg); } SYS_TIMER_CREATE = 235 // { int|sys||timer_create(clockid_t clock_id, struct sigevent *evp, timer_t *timerid); } SYS_TIMER_DELETE = 236 // { int|sys||timer_delete(timer_t timerid); } SYS_TIMER_GETOVERRUN = 239 // { int|sys||timer_getoverrun(timer_t timerid); } SYS_FDATASYNC = 241 // { int|sys||fdatasync(int fd); } SYS_MLOCKALL = 242 // { int|sys||mlockall(int flags); } SYS_MUNLOCKALL = 243 // { int|sys||munlockall(void); } SYS_SIGQUEUEINFO = 245 // { int|sys||sigqueueinfo(pid_t pid, const siginfo_t *info); } SYS_MODCTL = 246 // { int|sys||modctl(int cmd, void *arg); } SYS___POSIX_RENAME = 270 // { int|sys||__posix_rename(const char *from, const char *to); } SYS_SWAPCTL = 271 // { int|sys||swapctl(int cmd, void *arg, int misc); } SYS_MINHERIT = 273 // { int|sys||minherit(void *addr, size_t len, int inherit); } SYS_LCHMOD = 274 // { int|sys||lchmod(const char *path, mode_t mode); } SYS_LCHOWN = 275 // { int|sys||lchown(const char *path, uid_t uid, gid_t gid); } SYS_MSYNC = 277 // { int|sys|13|msync(void *addr, size_t len, int flags); } SYS___POSIX_CHOWN = 283 // { int|sys||__posix_chown(const char *path, uid_t uid, gid_t gid); } SYS___POSIX_FCHOWN = 284 // { int|sys||__posix_fchown(int fd, uid_t uid, gid_t gid); } SYS___POSIX_LCHOWN = 285 // { int|sys||__posix_lchown(const char *path, uid_t uid, gid_t gid); } SYS_GETSID = 286 // { pid_t|sys||getsid(pid_t pid); } SYS___CLONE = 287 // { pid_t|sys||__clone(int flags, void *stack); } SYS_FKTRACE = 288 // { int|sys||fktrace(int fd, int ops, int facs, pid_t pid); } SYS_PREADV = 289 // { ssize_t|sys||preadv(int fd, const struct iovec *iovp, int iovcnt, int PAD, off_t offset); } SYS_PWRITEV = 290 // { ssize_t|sys||pwritev(int fd, const struct iovec *iovp, int iovcnt, int PAD, off_t offset); } SYS___GETCWD = 296 // { int|sys||__getcwd(char *bufp, size_t length); } SYS_FCHROOT = 297 // { int|sys||fchroot(int fd); } SYS_LCHFLAGS = 304 // { int|sys||lchflags(const char *path, u_long flags); } SYS_ISSETUGID = 305 // { int|sys||issetugid(void); } SYS_UTRACE = 306 // { int|sys||utrace(const char *label, void *addr, size_t len); } SYS_GETCONTEXT = 307 // { int|sys||getcontext(struct __ucontext *ucp); } SYS_SETCONTEXT = 308 // { int|sys||setcontext(const struct __ucontext *ucp); } SYS__LWP_CREATE = 309 // { int|sys||_lwp_create(const struct __ucontext *ucp, u_long flags, lwpid_t *new_lwp); } SYS__LWP_EXIT = 310 // { int|sys||_lwp_exit(void); } SYS__LWP_SELF = 311 // { lwpid_t|sys||_lwp_self(void); } SYS__LWP_WAIT = 312 // { int|sys||_lwp_wait(lwpid_t wait_for, lwpid_t *departed); } SYS__LWP_SUSPEND = 313 // { int|sys||_lwp_suspend(lwpid_t target); } SYS__LWP_CONTINUE = 314 // { int|sys||_lwp_continue(lwpid_t target); } SYS__LWP_WAKEUP = 315 // { int|sys||_lwp_wakeup(lwpid_t target); } SYS__LWP_GETPRIVATE = 316 // { void *|sys||_lwp_getprivate(void); } SYS__LWP_SETPRIVATE = 317 // { void|sys||_lwp_setprivate(void *ptr); } SYS__LWP_KILL = 318 // { int|sys||_lwp_kill(lwpid_t target, int signo); } SYS__LWP_DETACH = 319 // { int|sys||_lwp_detach(lwpid_t target); } SYS__LWP_UNPARK = 321 // { int|sys||_lwp_unpark(lwpid_t target, const void *hint); } SYS__LWP_UNPARK_ALL = 322 // { ssize_t|sys||_lwp_unpark_all(const lwpid_t *targets, size_t ntargets, const void *hint); } SYS__LWP_SETNAME = 323 // { int|sys||_lwp_setname(lwpid_t target, const char *name); } SYS__LWP_GETNAME = 324 // { int|sys||_lwp_getname(lwpid_t target, char *name, size_t len); } SYS__LWP_CTL = 325 // { int|sys||_lwp_ctl(int features, struct lwpctl **address); } SYS___SIGACTION_SIGTRAMP = 340 // { int|sys||__sigaction_sigtramp(int signum, const struct sigaction *nsa, struct sigaction *osa, const void *tramp, int vers); } SYS_PMC_GET_INFO = 341 // { int|sys||pmc_get_info(int ctr, int op, void *args); } SYS_PMC_CONTROL = 342 // { int|sys||pmc_control(int ctr, int op, void *args); } SYS_RASCTL = 343 // { int|sys||rasctl(void *addr, size_t len, int op); } SYS_KQUEUE = 344 // { int|sys||kqueue(void); } SYS__SCHED_SETPARAM = 346 // { int|sys||_sched_setparam(pid_t pid, lwpid_t lid, int policy, const struct sched_param *params); } SYS__SCHED_GETPARAM = 347 // { int|sys||_sched_getparam(pid_t pid, lwpid_t lid, int *policy, struct sched_param *params); } SYS__SCHED_SETAFFINITY = 348 // { int|sys||_sched_setaffinity(pid_t pid, lwpid_t lid, size_t size, const cpuset_t *cpuset); } SYS__SCHED_GETAFFINITY = 349 // { int|sys||_sched_getaffinity(pid_t pid, lwpid_t lid, size_t size, cpuset_t *cpuset); } SYS_SCHED_YIELD = 350 // { int|sys||sched_yield(void); } SYS_FSYNC_RANGE = 354 // { int|sys||fsync_range(int fd, int flags, off_t start, off_t length); } SYS_UUIDGEN = 355 // { int|sys||uuidgen(struct uuid *store, int count); } SYS_GETVFSSTAT = 356 // { int|sys||getvfsstat(struct statvfs *buf, size_t bufsize, int flags); } SYS_STATVFS1 = 357 // { int|sys||statvfs1(const char *path, struct statvfs *buf, int flags); } SYS_FSTATVFS1 = 358 // { int|sys||fstatvfs1(int fd, struct statvfs *buf, int flags); } SYS_EXTATTRCTL = 360 // { int|sys||extattrctl(const char *path, int cmd, const char *filename, int attrnamespace, const char *attrname); } SYS_EXTATTR_SET_FILE = 361 // { int|sys||extattr_set_file(const char *path, int attrnamespace, const char *attrname, const void *data, size_t nbytes); } SYS_EXTATTR_GET_FILE = 362 // { ssize_t|sys||extattr_get_file(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_DELETE_FILE = 363 // { int|sys||extattr_delete_file(const char *path, int attrnamespace, const char *attrname); } SYS_EXTATTR_SET_FD = 364 // { int|sys||extattr_set_fd(int fd, int attrnamespace, const char *attrname, const void *data, size_t nbytes); } SYS_EXTATTR_GET_FD = 365 // { ssize_t|sys||extattr_get_fd(int fd, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_DELETE_FD = 366 // { int|sys||extattr_delete_fd(int fd, int attrnamespace, const char *attrname); } SYS_EXTATTR_SET_LINK = 367 // { int|sys||extattr_set_link(const char *path, int attrnamespace, const char *attrname, const void *data, size_t nbytes); } SYS_EXTATTR_GET_LINK = 368 // { ssize_t|sys||extattr_get_link(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_DELETE_LINK = 369 // { int|sys||extattr_delete_link(const char *path, int attrnamespace, const char *attrname); } SYS_EXTATTR_LIST_FD = 370 // { ssize_t|sys||extattr_list_fd(int fd, int attrnamespace, void *data, size_t nbytes); } SYS_EXTATTR_LIST_FILE = 371 // { ssize_t|sys||extattr_list_file(const char *path, int attrnamespace, void *data, size_t nbytes); } SYS_EXTATTR_LIST_LINK = 372 // { ssize_t|sys||extattr_list_link(const char *path, int attrnamespace, void *data, size_t nbytes); } SYS_SETXATTR = 375 // { int|sys||setxattr(const char *path, const char *name, const void *value, size_t size, int flags); } SYS_LSETXATTR = 376 // { int|sys||lsetxattr(const char *path, const char *name, const void *value, size_t size, int flags); } SYS_FSETXATTR = 377 // { int|sys||fsetxattr(int fd, const char *name, const void *value, size_t size, int flags); } SYS_GETXATTR = 378 // { int|sys||getxattr(const char *path, const char *name, void *value, size_t size); } SYS_LGETXATTR = 379 // { int|sys||lgetxattr(const char *path, const char *name, void *value, size_t size); } SYS_FGETXATTR = 380 // { int|sys||fgetxattr(int fd, const char *name, void *value, size_t size); } SYS_LISTXATTR = 381 // { int|sys||listxattr(const char *path, char *list, size_t size); } SYS_LLISTXATTR = 382 // { int|sys||llistxattr(const char *path, char *list, size_t size); } SYS_FLISTXATTR = 383 // { int|sys||flistxattr(int fd, char *list, size_t size); } SYS_REMOVEXATTR = 384 // { int|sys||removexattr(const char *path, const char *name); } SYS_LREMOVEXATTR = 385 // { int|sys||lremovexattr(const char *path, const char *name); } SYS_FREMOVEXATTR = 386 // { int|sys||fremovexattr(int fd, const char *name); } SYS_GETDENTS = 390 // { int|sys|30|getdents(int fd, char *buf, size_t count); } SYS_SOCKET = 394 // { int|sys|30|socket(int domain, int type, int protocol); } SYS_GETFH = 395 // { int|sys|30|getfh(const char *fname, void *fhp, size_t *fh_size); } SYS_MOUNT = 410 // { int|sys|50|mount(const char *type, const char *path, int flags, void *data, size_t data_len); } SYS_MREMAP = 411 // { void *|sys||mremap(void *old_address, size_t old_size, void *new_address, size_t new_size, int flags); } SYS_PSET_CREATE = 412 // { int|sys||pset_create(psetid_t *psid); } SYS_PSET_DESTROY = 413 // { int|sys||pset_destroy(psetid_t psid); } SYS_PSET_ASSIGN = 414 // { int|sys||pset_assign(psetid_t psid, cpuid_t cpuid, psetid_t *opsid); } SYS__PSET_BIND = 415 // { int|sys||_pset_bind(idtype_t idtype, id_t first_id, id_t second_id, psetid_t psid, psetid_t *opsid); } SYS_POSIX_FADVISE = 416 // { int|sys|50|posix_fadvise(int fd, int PAD, off_t offset, off_t len, int advice); } SYS_SELECT = 417 // { int|sys|50|select(int nd, fd_set *in, fd_set *ou, fd_set *ex, struct timeval *tv); } SYS_GETTIMEOFDAY = 418 // { int|sys|50|gettimeofday(struct timeval *tp, void *tzp); } SYS_SETTIMEOFDAY = 419 // { int|sys|50|settimeofday(const struct timeval *tv, const void *tzp); } SYS_UTIMES = 420 // { int|sys|50|utimes(const char *path, const struct timeval *tptr); } SYS_ADJTIME = 421 // { int|sys|50|adjtime(const struct timeval *delta, struct timeval *olddelta); } SYS_FUTIMES = 423 // { int|sys|50|futimes(int fd, const struct timeval *tptr); } SYS_LUTIMES = 424 // { int|sys|50|lutimes(const char *path, const struct timeval *tptr); } SYS_SETITIMER = 425 // { int|sys|50|setitimer(int which, const struct itimerval *itv, struct itimerval *oitv); } SYS_GETITIMER = 426 // { int|sys|50|getitimer(int which, struct itimerval *itv); } SYS_CLOCK_GETTIME = 427 // { int|sys|50|clock_gettime(clockid_t clock_id, struct timespec *tp); } SYS_CLOCK_SETTIME = 428 // { int|sys|50|clock_settime(clockid_t clock_id, const struct timespec *tp); } SYS_CLOCK_GETRES = 429 // { int|sys|50|clock_getres(clockid_t clock_id, struct timespec *tp); } SYS_NANOSLEEP = 430 // { int|sys|50|nanosleep(const struct timespec *rqtp, struct timespec *rmtp); } SYS___SIGTIMEDWAIT = 431 // { int|sys|50|__sigtimedwait(const sigset_t *set, siginfo_t *info, struct timespec *timeout); } SYS__LWP_PARK = 434 // { int|sys|50|_lwp_park(const struct timespec *ts, lwpid_t unpark, const void *hint, const void *unparkhint); } SYS_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); } SYS_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); } SYS_POLLTS = 437 // { int|sys|50|pollts(struct pollfd *fds, u_int nfds, const struct timespec *ts, const sigset_t *mask); } SYS_STAT = 439 // { int|sys|50|stat(const char *path, struct stat *ub); } SYS_FSTAT = 440 // { int|sys|50|fstat(int fd, struct stat *sb); } SYS_LSTAT = 441 // { int|sys|50|lstat(const char *path, struct stat *ub); } SYS___SEMCTL = 442 // { int|sys|50|__semctl(int semid, int semnum, int cmd, ... union __semun *arg); } SYS_SHMCTL = 443 // { int|sys|50|shmctl(int shmid, int cmd, struct shmid_ds *buf); } SYS_MSGCTL = 444 // { int|sys|50|msgctl(int msqid, int cmd, struct msqid_ds *buf); } SYS_GETRUSAGE = 445 // { int|sys|50|getrusage(int who, struct rusage *rusage); } SYS_TIMER_SETTIME = 446 // { int|sys|50|timer_settime(timer_t timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue); } SYS_TIMER_GETTIME = 447 // { int|sys|50|timer_gettime(timer_t timerid, struct itimerspec *value); } SYS_NTP_GETTIME = 448 // { int|sys|50|ntp_gettime(struct ntptimeval *ntvp); } SYS_WAIT4 = 449 // { int|sys|50|wait4(pid_t pid, int *status, int options, struct rusage *rusage); } SYS_MKNOD = 450 // { int|sys|50|mknod(const char *path, mode_t mode, dev_t dev); } SYS_FHSTAT = 451 // { int|sys|50|fhstat(const void *fhp, size_t fh_size, struct stat *sb); } SYS_PIPE2 = 453 // { int|sys||pipe2(int *fildes, int flags); } SYS_DUP3 = 454 // { int|sys||dup3(int from, int to, int flags); } SYS_KQUEUE1 = 455 // { int|sys||kqueue1(int flags); } SYS_PACCEPT = 456 // { int|sys||paccept(int s, struct sockaddr *name, socklen_t *anamelen, const sigset_t *mask, int flags); } SYS_LINKAT = 457 // { int|sys||linkat(int fd1, const char *name1, int fd2, const char *name2, int flags); } SYS_RENAMEAT = 458 // { int|sys||renameat(int fromfd, const char *from, int tofd, const char *to); } SYS_MKFIFOAT = 459 // { int|sys||mkfifoat(int fd, const char *path, mode_t mode); } SYS_MKNODAT = 460 // { int|sys||mknodat(int fd, const char *path, mode_t mode, uint32_t dev); } SYS_MKDIRAT = 461 // { int|sys||mkdirat(int fd, const char *path, mode_t mode); } SYS_FACCESSAT = 462 // { int|sys||faccessat(int fd, const char *path, int amode, int flag); } SYS_FCHMODAT = 463 // { int|sys||fchmodat(int fd, const char *path, mode_t mode, int flag); } SYS_FCHOWNAT = 464 // { int|sys||fchownat(int fd, const char *path, uid_t owner, gid_t group, int flag); } SYS_FEXECVE = 465 // { int|sys||fexecve(int fd, char * const *argp, char * const *envp); } SYS_FSTATAT = 466 // { int|sys||fstatat(int fd, const char *path, struct stat *buf, int flag); } SYS_UTIMENSAT = 467 // { int|sys||utimensat(int fd, const char *path, const struct timespec *tptr, int flag); } SYS_OPENAT = 468 // { int|sys||openat(int fd, const char *path, int oflags, ... mode_t mode); } SYS_READLINKAT = 469 // { int|sys||readlinkat(int fd, const char *path, char *buf, size_t bufsize); } SYS_SYMLINKAT = 470 // { int|sys||symlinkat(const char *path1, int fd, const char *path2); } SYS_UNLINKAT = 471 // { int|sys||unlinkat(int fd, const char *path, int flag); } SYS_FUTIMENS = 472 // { int|sys||futimens(int fd, const struct timespec *tptr); } SYS___QUOTACTL = 473 // { int|sys||__quotactl(const char *path, struct quotactl_args *args); } SYS_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); } SYS_RECVMMSG = 475 // { int|sys||recvmmsg(int s, struct mmsghdr *mmsg, unsigned int vlen, unsigned int flags, struct timespec *timeout); } SYS_SENDMMSG = 476 // { int|sys||sendmmsg(int s, struct mmsghdr *mmsg, unsigned int vlen, unsigned int flags); } ) ================================================ FILE: vendor/golang.org/x/sys/unix/zsysnum_netbsd_arm64.go ================================================ // go run mksysnum.go http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master // Code generated by the command above; DO NOT EDIT. //go:build arm64 && netbsd package unix const ( SYS_EXIT = 1 // { void|sys||exit(int rval); } SYS_FORK = 2 // { int|sys||fork(void); } SYS_READ = 3 // { ssize_t|sys||read(int fd, void *buf, size_t nbyte); } SYS_WRITE = 4 // { ssize_t|sys||write(int fd, const void *buf, size_t nbyte); } SYS_OPEN = 5 // { int|sys||open(const char *path, int flags, ... mode_t mode); } SYS_CLOSE = 6 // { int|sys||close(int fd); } SYS_LINK = 9 // { int|sys||link(const char *path, const char *link); } SYS_UNLINK = 10 // { int|sys||unlink(const char *path); } SYS_CHDIR = 12 // { int|sys||chdir(const char *path); } SYS_FCHDIR = 13 // { int|sys||fchdir(int fd); } SYS_CHMOD = 15 // { int|sys||chmod(const char *path, mode_t mode); } SYS_CHOWN = 16 // { int|sys||chown(const char *path, uid_t uid, gid_t gid); } SYS_BREAK = 17 // { int|sys||obreak(char *nsize); } SYS_GETPID = 20 // { pid_t|sys||getpid_with_ppid(void); } SYS_UNMOUNT = 22 // { int|sys||unmount(const char *path, int flags); } SYS_SETUID = 23 // { int|sys||setuid(uid_t uid); } SYS_GETUID = 24 // { uid_t|sys||getuid_with_euid(void); } SYS_GETEUID = 25 // { uid_t|sys||geteuid(void); } SYS_PTRACE = 26 // { int|sys||ptrace(int req, pid_t pid, void *addr, int data); } SYS_RECVMSG = 27 // { ssize_t|sys||recvmsg(int s, struct msghdr *msg, int flags); } SYS_SENDMSG = 28 // { ssize_t|sys||sendmsg(int s, const struct msghdr *msg, int flags); } SYS_RECVFROM = 29 // { ssize_t|sys||recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlenaddr); } SYS_ACCEPT = 30 // { int|sys||accept(int s, struct sockaddr *name, socklen_t *anamelen); } SYS_GETPEERNAME = 31 // { int|sys||getpeername(int fdes, struct sockaddr *asa, socklen_t *alen); } SYS_GETSOCKNAME = 32 // { int|sys||getsockname(int fdes, struct sockaddr *asa, socklen_t *alen); } SYS_ACCESS = 33 // { int|sys||access(const char *path, int flags); } SYS_CHFLAGS = 34 // { int|sys||chflags(const char *path, u_long flags); } SYS_FCHFLAGS = 35 // { int|sys||fchflags(int fd, u_long flags); } SYS_SYNC = 36 // { void|sys||sync(void); } SYS_KILL = 37 // { int|sys||kill(pid_t pid, int signum); } SYS_GETPPID = 39 // { pid_t|sys||getppid(void); } SYS_DUP = 41 // { int|sys||dup(int fd); } SYS_PIPE = 42 // { int|sys||pipe(void); } SYS_GETEGID = 43 // { gid_t|sys||getegid(void); } SYS_PROFIL = 44 // { int|sys||profil(char *samples, size_t size, u_long offset, u_int scale); } SYS_KTRACE = 45 // { int|sys||ktrace(const char *fname, int ops, int facs, pid_t pid); } SYS_GETGID = 47 // { gid_t|sys||getgid_with_egid(void); } SYS___GETLOGIN = 49 // { int|sys||__getlogin(char *namebuf, size_t namelen); } SYS___SETLOGIN = 50 // { int|sys||__setlogin(const char *namebuf); } SYS_ACCT = 51 // { int|sys||acct(const char *path); } SYS_IOCTL = 54 // { int|sys||ioctl(int fd, u_long com, ... void *data); } SYS_REVOKE = 56 // { int|sys||revoke(const char *path); } SYS_SYMLINK = 57 // { int|sys||symlink(const char *path, const char *link); } SYS_READLINK = 58 // { ssize_t|sys||readlink(const char *path, char *buf, size_t count); } SYS_EXECVE = 59 // { int|sys||execve(const char *path, char * const *argp, char * const *envp); } SYS_UMASK = 60 // { mode_t|sys||umask(mode_t newmask); } SYS_CHROOT = 61 // { int|sys||chroot(const char *path); } SYS_VFORK = 66 // { int|sys||vfork(void); } SYS_SBRK = 69 // { int|sys||sbrk(intptr_t incr); } SYS_SSTK = 70 // { int|sys||sstk(int incr); } SYS_VADVISE = 72 // { int|sys||ovadvise(int anom); } SYS_MUNMAP = 73 // { int|sys||munmap(void *addr, size_t len); } SYS_MPROTECT = 74 // { int|sys||mprotect(void *addr, size_t len, int prot); } SYS_MADVISE = 75 // { int|sys||madvise(void *addr, size_t len, int behav); } SYS_MINCORE = 78 // { int|sys||mincore(void *addr, size_t len, char *vec); } SYS_GETGROUPS = 79 // { int|sys||getgroups(int gidsetsize, gid_t *gidset); } SYS_SETGROUPS = 80 // { int|sys||setgroups(int gidsetsize, const gid_t *gidset); } SYS_GETPGRP = 81 // { int|sys||getpgrp(void); } SYS_SETPGID = 82 // { int|sys||setpgid(pid_t pid, pid_t pgid); } SYS_DUP2 = 90 // { int|sys||dup2(int from, int to); } SYS_FCNTL = 92 // { int|sys||fcntl(int fd, int cmd, ... void *arg); } SYS_FSYNC = 95 // { int|sys||fsync(int fd); } SYS_SETPRIORITY = 96 // { int|sys||setpriority(int which, id_t who, int prio); } SYS_CONNECT = 98 // { int|sys||connect(int s, const struct sockaddr *name, socklen_t namelen); } SYS_GETPRIORITY = 100 // { int|sys||getpriority(int which, id_t who); } SYS_BIND = 104 // { int|sys||bind(int s, const struct sockaddr *name, socklen_t namelen); } SYS_SETSOCKOPT = 105 // { int|sys||setsockopt(int s, int level, int name, const void *val, socklen_t valsize); } SYS_LISTEN = 106 // { int|sys||listen(int s, int backlog); } SYS_GETSOCKOPT = 118 // { int|sys||getsockopt(int s, int level, int name, void *val, socklen_t *avalsize); } SYS_READV = 120 // { ssize_t|sys||readv(int fd, const struct iovec *iovp, int iovcnt); } SYS_WRITEV = 121 // { ssize_t|sys||writev(int fd, const struct iovec *iovp, int iovcnt); } SYS_FCHOWN = 123 // { int|sys||fchown(int fd, uid_t uid, gid_t gid); } SYS_FCHMOD = 124 // { int|sys||fchmod(int fd, mode_t mode); } SYS_SETREUID = 126 // { int|sys||setreuid(uid_t ruid, uid_t euid); } SYS_SETREGID = 127 // { int|sys||setregid(gid_t rgid, gid_t egid); } SYS_RENAME = 128 // { int|sys||rename(const char *from, const char *to); } SYS_FLOCK = 131 // { int|sys||flock(int fd, int how); } SYS_MKFIFO = 132 // { int|sys||mkfifo(const char *path, mode_t mode); } SYS_SENDTO = 133 // { ssize_t|sys||sendto(int s, const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen); } SYS_SHUTDOWN = 134 // { int|sys||shutdown(int s, int how); } SYS_SOCKETPAIR = 135 // { int|sys||socketpair(int domain, int type, int protocol, int *rsv); } SYS_MKDIR = 136 // { int|sys||mkdir(const char *path, mode_t mode); } SYS_RMDIR = 137 // { int|sys||rmdir(const char *path); } SYS_SETSID = 147 // { int|sys||setsid(void); } SYS_SYSARCH = 165 // { int|sys||sysarch(int op, void *parms); } SYS_PREAD = 173 // { ssize_t|sys||pread(int fd, void *buf, size_t nbyte, int PAD, off_t offset); } SYS_PWRITE = 174 // { ssize_t|sys||pwrite(int fd, const void *buf, size_t nbyte, int PAD, off_t offset); } SYS_NTP_ADJTIME = 176 // { int|sys||ntp_adjtime(struct timex *tp); } SYS_SETGID = 181 // { int|sys||setgid(gid_t gid); } SYS_SETEGID = 182 // { int|sys||setegid(gid_t egid); } SYS_SETEUID = 183 // { int|sys||seteuid(uid_t euid); } SYS_PATHCONF = 191 // { long|sys||pathconf(const char *path, int name); } SYS_FPATHCONF = 192 // { long|sys||fpathconf(int fd, int name); } SYS_GETRLIMIT = 194 // { int|sys||getrlimit(int which, struct rlimit *rlp); } SYS_SETRLIMIT = 195 // { int|sys||setrlimit(int which, const struct rlimit *rlp); } SYS_MMAP = 197 // { void *|sys||mmap(void *addr, size_t len, int prot, int flags, int fd, long PAD, off_t pos); } SYS_LSEEK = 199 // { off_t|sys||lseek(int fd, int PAD, off_t offset, int whence); } SYS_TRUNCATE = 200 // { int|sys||truncate(const char *path, int PAD, off_t length); } SYS_FTRUNCATE = 201 // { int|sys||ftruncate(int fd, int PAD, off_t length); } SYS___SYSCTL = 202 // { int|sys||__sysctl(const int *name, u_int namelen, void *old, size_t *oldlenp, const void *new, size_t newlen); } SYS_MLOCK = 203 // { int|sys||mlock(const void *addr, size_t len); } SYS_MUNLOCK = 204 // { int|sys||munlock(const void *addr, size_t len); } SYS_UNDELETE = 205 // { int|sys||undelete(const char *path); } SYS_GETPGID = 207 // { pid_t|sys||getpgid(pid_t pid); } SYS_REBOOT = 208 // { int|sys||reboot(int opt, char *bootstr); } SYS_POLL = 209 // { int|sys||poll(struct pollfd *fds, u_int nfds, int timeout); } SYS_SEMGET = 221 // { int|sys||semget(key_t key, int nsems, int semflg); } SYS_SEMOP = 222 // { int|sys||semop(int semid, struct sembuf *sops, size_t nsops); } SYS_SEMCONFIG = 223 // { int|sys||semconfig(int flag); } SYS_MSGGET = 225 // { int|sys||msgget(key_t key, int msgflg); } SYS_MSGSND = 226 // { int|sys||msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg); } SYS_MSGRCV = 227 // { ssize_t|sys||msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg); } SYS_SHMAT = 228 // { void *|sys||shmat(int shmid, const void *shmaddr, int shmflg); } SYS_SHMDT = 230 // { int|sys||shmdt(const void *shmaddr); } SYS_SHMGET = 231 // { int|sys||shmget(key_t key, size_t size, int shmflg); } SYS_TIMER_CREATE = 235 // { int|sys||timer_create(clockid_t clock_id, struct sigevent *evp, timer_t *timerid); } SYS_TIMER_DELETE = 236 // { int|sys||timer_delete(timer_t timerid); } SYS_TIMER_GETOVERRUN = 239 // { int|sys||timer_getoverrun(timer_t timerid); } SYS_FDATASYNC = 241 // { int|sys||fdatasync(int fd); } SYS_MLOCKALL = 242 // { int|sys||mlockall(int flags); } SYS_MUNLOCKALL = 243 // { int|sys||munlockall(void); } SYS_SIGQUEUEINFO = 245 // { int|sys||sigqueueinfo(pid_t pid, const siginfo_t *info); } SYS_MODCTL = 246 // { int|sys||modctl(int cmd, void *arg); } SYS___POSIX_RENAME = 270 // { int|sys||__posix_rename(const char *from, const char *to); } SYS_SWAPCTL = 271 // { int|sys||swapctl(int cmd, void *arg, int misc); } SYS_MINHERIT = 273 // { int|sys||minherit(void *addr, size_t len, int inherit); } SYS_LCHMOD = 274 // { int|sys||lchmod(const char *path, mode_t mode); } SYS_LCHOWN = 275 // { int|sys||lchown(const char *path, uid_t uid, gid_t gid); } SYS_MSYNC = 277 // { int|sys|13|msync(void *addr, size_t len, int flags); } SYS___POSIX_CHOWN = 283 // { int|sys||__posix_chown(const char *path, uid_t uid, gid_t gid); } SYS___POSIX_FCHOWN = 284 // { int|sys||__posix_fchown(int fd, uid_t uid, gid_t gid); } SYS___POSIX_LCHOWN = 285 // { int|sys||__posix_lchown(const char *path, uid_t uid, gid_t gid); } SYS_GETSID = 286 // { pid_t|sys||getsid(pid_t pid); } SYS___CLONE = 287 // { pid_t|sys||__clone(int flags, void *stack); } SYS_FKTRACE = 288 // { int|sys||fktrace(int fd, int ops, int facs, pid_t pid); } SYS_PREADV = 289 // { ssize_t|sys||preadv(int fd, const struct iovec *iovp, int iovcnt, int PAD, off_t offset); } SYS_PWRITEV = 290 // { ssize_t|sys||pwritev(int fd, const struct iovec *iovp, int iovcnt, int PAD, off_t offset); } SYS___GETCWD = 296 // { int|sys||__getcwd(char *bufp, size_t length); } SYS_FCHROOT = 297 // { int|sys||fchroot(int fd); } SYS_LCHFLAGS = 304 // { int|sys||lchflags(const char *path, u_long flags); } SYS_ISSETUGID = 305 // { int|sys||issetugid(void); } SYS_UTRACE = 306 // { int|sys||utrace(const char *label, void *addr, size_t len); } SYS_GETCONTEXT = 307 // { int|sys||getcontext(struct __ucontext *ucp); } SYS_SETCONTEXT = 308 // { int|sys||setcontext(const struct __ucontext *ucp); } SYS__LWP_CREATE = 309 // { int|sys||_lwp_create(const struct __ucontext *ucp, u_long flags, lwpid_t *new_lwp); } SYS__LWP_EXIT = 310 // { int|sys||_lwp_exit(void); } SYS__LWP_SELF = 311 // { lwpid_t|sys||_lwp_self(void); } SYS__LWP_WAIT = 312 // { int|sys||_lwp_wait(lwpid_t wait_for, lwpid_t *departed); } SYS__LWP_SUSPEND = 313 // { int|sys||_lwp_suspend(lwpid_t target); } SYS__LWP_CONTINUE = 314 // { int|sys||_lwp_continue(lwpid_t target); } SYS__LWP_WAKEUP = 315 // { int|sys||_lwp_wakeup(lwpid_t target); } SYS__LWP_GETPRIVATE = 316 // { void *|sys||_lwp_getprivate(void); } SYS__LWP_SETPRIVATE = 317 // { void|sys||_lwp_setprivate(void *ptr); } SYS__LWP_KILL = 318 // { int|sys||_lwp_kill(lwpid_t target, int signo); } SYS__LWP_DETACH = 319 // { int|sys||_lwp_detach(lwpid_t target); } SYS__LWP_UNPARK = 321 // { int|sys||_lwp_unpark(lwpid_t target, const void *hint); } SYS__LWP_UNPARK_ALL = 322 // { ssize_t|sys||_lwp_unpark_all(const lwpid_t *targets, size_t ntargets, const void *hint); } SYS__LWP_SETNAME = 323 // { int|sys||_lwp_setname(lwpid_t target, const char *name); } SYS__LWP_GETNAME = 324 // { int|sys||_lwp_getname(lwpid_t target, char *name, size_t len); } SYS__LWP_CTL = 325 // { int|sys||_lwp_ctl(int features, struct lwpctl **address); } SYS___SIGACTION_SIGTRAMP = 340 // { int|sys||__sigaction_sigtramp(int signum, const struct sigaction *nsa, struct sigaction *osa, const void *tramp, int vers); } SYS_PMC_GET_INFO = 341 // { int|sys||pmc_get_info(int ctr, int op, void *args); } SYS_PMC_CONTROL = 342 // { int|sys||pmc_control(int ctr, int op, void *args); } SYS_RASCTL = 343 // { int|sys||rasctl(void *addr, size_t len, int op); } SYS_KQUEUE = 344 // { int|sys||kqueue(void); } SYS__SCHED_SETPARAM = 346 // { int|sys||_sched_setparam(pid_t pid, lwpid_t lid, int policy, const struct sched_param *params); } SYS__SCHED_GETPARAM = 347 // { int|sys||_sched_getparam(pid_t pid, lwpid_t lid, int *policy, struct sched_param *params); } SYS__SCHED_SETAFFINITY = 348 // { int|sys||_sched_setaffinity(pid_t pid, lwpid_t lid, size_t size, const cpuset_t *cpuset); } SYS__SCHED_GETAFFINITY = 349 // { int|sys||_sched_getaffinity(pid_t pid, lwpid_t lid, size_t size, cpuset_t *cpuset); } SYS_SCHED_YIELD = 350 // { int|sys||sched_yield(void); } SYS_FSYNC_RANGE = 354 // { int|sys||fsync_range(int fd, int flags, off_t start, off_t length); } SYS_UUIDGEN = 355 // { int|sys||uuidgen(struct uuid *store, int count); } SYS_GETVFSSTAT = 356 // { int|sys||getvfsstat(struct statvfs *buf, size_t bufsize, int flags); } SYS_STATVFS1 = 357 // { int|sys||statvfs1(const char *path, struct statvfs *buf, int flags); } SYS_FSTATVFS1 = 358 // { int|sys||fstatvfs1(int fd, struct statvfs *buf, int flags); } SYS_EXTATTRCTL = 360 // { int|sys||extattrctl(const char *path, int cmd, const char *filename, int attrnamespace, const char *attrname); } SYS_EXTATTR_SET_FILE = 361 // { int|sys||extattr_set_file(const char *path, int attrnamespace, const char *attrname, const void *data, size_t nbytes); } SYS_EXTATTR_GET_FILE = 362 // { ssize_t|sys||extattr_get_file(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_DELETE_FILE = 363 // { int|sys||extattr_delete_file(const char *path, int attrnamespace, const char *attrname); } SYS_EXTATTR_SET_FD = 364 // { int|sys||extattr_set_fd(int fd, int attrnamespace, const char *attrname, const void *data, size_t nbytes); } SYS_EXTATTR_GET_FD = 365 // { ssize_t|sys||extattr_get_fd(int fd, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_DELETE_FD = 366 // { int|sys||extattr_delete_fd(int fd, int attrnamespace, const char *attrname); } SYS_EXTATTR_SET_LINK = 367 // { int|sys||extattr_set_link(const char *path, int attrnamespace, const char *attrname, const void *data, size_t nbytes); } SYS_EXTATTR_GET_LINK = 368 // { ssize_t|sys||extattr_get_link(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_DELETE_LINK = 369 // { int|sys||extattr_delete_link(const char *path, int attrnamespace, const char *attrname); } SYS_EXTATTR_LIST_FD = 370 // { ssize_t|sys||extattr_list_fd(int fd, int attrnamespace, void *data, size_t nbytes); } SYS_EXTATTR_LIST_FILE = 371 // { ssize_t|sys||extattr_list_file(const char *path, int attrnamespace, void *data, size_t nbytes); } SYS_EXTATTR_LIST_LINK = 372 // { ssize_t|sys||extattr_list_link(const char *path, int attrnamespace, void *data, size_t nbytes); } SYS_SETXATTR = 375 // { int|sys||setxattr(const char *path, const char *name, const void *value, size_t size, int flags); } SYS_LSETXATTR = 376 // { int|sys||lsetxattr(const char *path, const char *name, const void *value, size_t size, int flags); } SYS_FSETXATTR = 377 // { int|sys||fsetxattr(int fd, const char *name, const void *value, size_t size, int flags); } SYS_GETXATTR = 378 // { int|sys||getxattr(const char *path, const char *name, void *value, size_t size); } SYS_LGETXATTR = 379 // { int|sys||lgetxattr(const char *path, const char *name, void *value, size_t size); } SYS_FGETXATTR = 380 // { int|sys||fgetxattr(int fd, const char *name, void *value, size_t size); } SYS_LISTXATTR = 381 // { int|sys||listxattr(const char *path, char *list, size_t size); } SYS_LLISTXATTR = 382 // { int|sys||llistxattr(const char *path, char *list, size_t size); } SYS_FLISTXATTR = 383 // { int|sys||flistxattr(int fd, char *list, size_t size); } SYS_REMOVEXATTR = 384 // { int|sys||removexattr(const char *path, const char *name); } SYS_LREMOVEXATTR = 385 // { int|sys||lremovexattr(const char *path, const char *name); } SYS_FREMOVEXATTR = 386 // { int|sys||fremovexattr(int fd, const char *name); } SYS_GETDENTS = 390 // { int|sys|30|getdents(int fd, char *buf, size_t count); } SYS_SOCKET = 394 // { int|sys|30|socket(int domain, int type, int protocol); } SYS_GETFH = 395 // { int|sys|30|getfh(const char *fname, void *fhp, size_t *fh_size); } SYS_MOUNT = 410 // { int|sys|50|mount(const char *type, const char *path, int flags, void *data, size_t data_len); } SYS_MREMAP = 411 // { void *|sys||mremap(void *old_address, size_t old_size, void *new_address, size_t new_size, int flags); } SYS_PSET_CREATE = 412 // { int|sys||pset_create(psetid_t *psid); } SYS_PSET_DESTROY = 413 // { int|sys||pset_destroy(psetid_t psid); } SYS_PSET_ASSIGN = 414 // { int|sys||pset_assign(psetid_t psid, cpuid_t cpuid, psetid_t *opsid); } SYS__PSET_BIND = 415 // { int|sys||_pset_bind(idtype_t idtype, id_t first_id, id_t second_id, psetid_t psid, psetid_t *opsid); } SYS_POSIX_FADVISE = 416 // { int|sys|50|posix_fadvise(int fd, int PAD, off_t offset, off_t len, int advice); } SYS_SELECT = 417 // { int|sys|50|select(int nd, fd_set *in, fd_set *ou, fd_set *ex, struct timeval *tv); } SYS_GETTIMEOFDAY = 418 // { int|sys|50|gettimeofday(struct timeval *tp, void *tzp); } SYS_SETTIMEOFDAY = 419 // { int|sys|50|settimeofday(const struct timeval *tv, const void *tzp); } SYS_UTIMES = 420 // { int|sys|50|utimes(const char *path, const struct timeval *tptr); } SYS_ADJTIME = 421 // { int|sys|50|adjtime(const struct timeval *delta, struct timeval *olddelta); } SYS_FUTIMES = 423 // { int|sys|50|futimes(int fd, const struct timeval *tptr); } SYS_LUTIMES = 424 // { int|sys|50|lutimes(const char *path, const struct timeval *tptr); } SYS_SETITIMER = 425 // { int|sys|50|setitimer(int which, const struct itimerval *itv, struct itimerval *oitv); } SYS_GETITIMER = 426 // { int|sys|50|getitimer(int which, struct itimerval *itv); } SYS_CLOCK_GETTIME = 427 // { int|sys|50|clock_gettime(clockid_t clock_id, struct timespec *tp); } SYS_CLOCK_SETTIME = 428 // { int|sys|50|clock_settime(clockid_t clock_id, const struct timespec *tp); } SYS_CLOCK_GETRES = 429 // { int|sys|50|clock_getres(clockid_t clock_id, struct timespec *tp); } SYS_NANOSLEEP = 430 // { int|sys|50|nanosleep(const struct timespec *rqtp, struct timespec *rmtp); } SYS___SIGTIMEDWAIT = 431 // { int|sys|50|__sigtimedwait(const sigset_t *set, siginfo_t *info, struct timespec *timeout); } SYS__LWP_PARK = 434 // { int|sys|50|_lwp_park(const struct timespec *ts, lwpid_t unpark, const void *hint, const void *unparkhint); } SYS_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); } SYS_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); } SYS_POLLTS = 437 // { int|sys|50|pollts(struct pollfd *fds, u_int nfds, const struct timespec *ts, const sigset_t *mask); } SYS_STAT = 439 // { int|sys|50|stat(const char *path, struct stat *ub); } SYS_FSTAT = 440 // { int|sys|50|fstat(int fd, struct stat *sb); } SYS_LSTAT = 441 // { int|sys|50|lstat(const char *path, struct stat *ub); } SYS___SEMCTL = 442 // { int|sys|50|__semctl(int semid, int semnum, int cmd, ... union __semun *arg); } SYS_SHMCTL = 443 // { int|sys|50|shmctl(int shmid, int cmd, struct shmid_ds *buf); } SYS_MSGCTL = 444 // { int|sys|50|msgctl(int msqid, int cmd, struct msqid_ds *buf); } SYS_GETRUSAGE = 445 // { int|sys|50|getrusage(int who, struct rusage *rusage); } SYS_TIMER_SETTIME = 446 // { int|sys|50|timer_settime(timer_t timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue); } SYS_TIMER_GETTIME = 447 // { int|sys|50|timer_gettime(timer_t timerid, struct itimerspec *value); } SYS_NTP_GETTIME = 448 // { int|sys|50|ntp_gettime(struct ntptimeval *ntvp); } SYS_WAIT4 = 449 // { int|sys|50|wait4(pid_t pid, int *status, int options, struct rusage *rusage); } SYS_MKNOD = 450 // { int|sys|50|mknod(const char *path, mode_t mode, dev_t dev); } SYS_FHSTAT = 451 // { int|sys|50|fhstat(const void *fhp, size_t fh_size, struct stat *sb); } SYS_PIPE2 = 453 // { int|sys||pipe2(int *fildes, int flags); } SYS_DUP3 = 454 // { int|sys||dup3(int from, int to, int flags); } SYS_KQUEUE1 = 455 // { int|sys||kqueue1(int flags); } SYS_PACCEPT = 456 // { int|sys||paccept(int s, struct sockaddr *name, socklen_t *anamelen, const sigset_t *mask, int flags); } SYS_LINKAT = 457 // { int|sys||linkat(int fd1, const char *name1, int fd2, const char *name2, int flags); } SYS_RENAMEAT = 458 // { int|sys||renameat(int fromfd, const char *from, int tofd, const char *to); } SYS_MKFIFOAT = 459 // { int|sys||mkfifoat(int fd, const char *path, mode_t mode); } SYS_MKNODAT = 460 // { int|sys||mknodat(int fd, const char *path, mode_t mode, uint32_t dev); } SYS_MKDIRAT = 461 // { int|sys||mkdirat(int fd, const char *path, mode_t mode); } SYS_FACCESSAT = 462 // { int|sys||faccessat(int fd, const char *path, int amode, int flag); } SYS_FCHMODAT = 463 // { int|sys||fchmodat(int fd, const char *path, mode_t mode, int flag); } SYS_FCHOWNAT = 464 // { int|sys||fchownat(int fd, const char *path, uid_t owner, gid_t group, int flag); } SYS_FEXECVE = 465 // { int|sys||fexecve(int fd, char * const *argp, char * const *envp); } SYS_FSTATAT = 466 // { int|sys||fstatat(int fd, const char *path, struct stat *buf, int flag); } SYS_UTIMENSAT = 467 // { int|sys||utimensat(int fd, const char *path, const struct timespec *tptr, int flag); } SYS_OPENAT = 468 // { int|sys||openat(int fd, const char *path, int oflags, ... mode_t mode); } SYS_READLINKAT = 469 // { int|sys||readlinkat(int fd, const char *path, char *buf, size_t bufsize); } SYS_SYMLINKAT = 470 // { int|sys||symlinkat(const char *path1, int fd, const char *path2); } SYS_UNLINKAT = 471 // { int|sys||unlinkat(int fd, const char *path, int flag); } SYS_FUTIMENS = 472 // { int|sys||futimens(int fd, const struct timespec *tptr); } SYS___QUOTACTL = 473 // { int|sys||__quotactl(const char *path, struct quotactl_args *args); } SYS_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); } SYS_RECVMMSG = 475 // { int|sys||recvmmsg(int s, struct mmsghdr *mmsg, unsigned int vlen, unsigned int flags, struct timespec *timeout); } SYS_SENDMMSG = 476 // { int|sys||sendmmsg(int s, struct mmsghdr *mmsg, unsigned int vlen, unsigned int flags); } ) ================================================ FILE: vendor/golang.org/x/sys/unix/zsysnum_openbsd_386.go ================================================ // go run mksysnum.go https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master // Code generated by the command above; see README.md. DO NOT EDIT. //go:build 386 && openbsd package unix // Deprecated: Use libc wrappers instead of direct syscalls. const ( SYS_EXIT = 1 // { void sys_exit(int rval); } SYS_FORK = 2 // { int sys_fork(void); } SYS_READ = 3 // { ssize_t sys_read(int fd, void *buf, size_t nbyte); } SYS_WRITE = 4 // { ssize_t sys_write(int fd, const void *buf, size_t nbyte); } SYS_OPEN = 5 // { int sys_open(const char *path, int flags, ... mode_t mode); } SYS_CLOSE = 6 // { int sys_close(int fd); } SYS_GETENTROPY = 7 // { int sys_getentropy(void *buf, size_t nbyte); } SYS___TFORK = 8 // { int sys___tfork(const struct __tfork *param, size_t psize); } SYS_LINK = 9 // { int sys_link(const char *path, const char *link); } SYS_UNLINK = 10 // { int sys_unlink(const char *path); } SYS_WAIT4 = 11 // { pid_t sys_wait4(pid_t pid, int *status, int options, struct rusage *rusage); } SYS_CHDIR = 12 // { int sys_chdir(const char *path); } SYS_FCHDIR = 13 // { int sys_fchdir(int fd); } SYS_MKNOD = 14 // { int sys_mknod(const char *path, mode_t mode, dev_t dev); } SYS_CHMOD = 15 // { int sys_chmod(const char *path, mode_t mode); } SYS_CHOWN = 16 // { int sys_chown(const char *path, uid_t uid, gid_t gid); } SYS_OBREAK = 17 // { int sys_obreak(char *nsize); } break SYS_GETDTABLECOUNT = 18 // { int sys_getdtablecount(void); } SYS_GETRUSAGE = 19 // { int sys_getrusage(int who, struct rusage *rusage); } SYS_GETPID = 20 // { pid_t sys_getpid(void); } SYS_MOUNT = 21 // { int sys_mount(const char *type, const char *path, int flags, void *data); } SYS_UNMOUNT = 22 // { int sys_unmount(const char *path, int flags); } SYS_SETUID = 23 // { int sys_setuid(uid_t uid); } SYS_GETUID = 24 // { uid_t sys_getuid(void); } SYS_GETEUID = 25 // { uid_t sys_geteuid(void); } SYS_PTRACE = 26 // { int sys_ptrace(int req, pid_t pid, caddr_t addr, int data); } SYS_RECVMSG = 27 // { ssize_t sys_recvmsg(int s, struct msghdr *msg, int flags); } SYS_SENDMSG = 28 // { ssize_t sys_sendmsg(int s, const struct msghdr *msg, int flags); } SYS_RECVFROM = 29 // { ssize_t sys_recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlenaddr); } SYS_ACCEPT = 30 // { int sys_accept(int s, struct sockaddr *name, socklen_t *anamelen); } SYS_GETPEERNAME = 31 // { int sys_getpeername(int fdes, struct sockaddr *asa, socklen_t *alen); } SYS_GETSOCKNAME = 32 // { int sys_getsockname(int fdes, struct sockaddr *asa, socklen_t *alen); } SYS_ACCESS = 33 // { int sys_access(const char *path, int amode); } SYS_CHFLAGS = 34 // { int sys_chflags(const char *path, u_int flags); } SYS_FCHFLAGS = 35 // { int sys_fchflags(int fd, u_int flags); } SYS_SYNC = 36 // { void sys_sync(void); } SYS_STAT = 38 // { int sys_stat(const char *path, struct stat *ub); } SYS_GETPPID = 39 // { pid_t sys_getppid(void); } SYS_LSTAT = 40 // { int sys_lstat(const char *path, struct stat *ub); } SYS_DUP = 41 // { int sys_dup(int fd); } SYS_FSTATAT = 42 // { int sys_fstatat(int fd, const char *path, struct stat *buf, int flag); } SYS_GETEGID = 43 // { gid_t sys_getegid(void); } SYS_PROFIL = 44 // { int sys_profil(caddr_t samples, size_t size, u_long offset, u_int scale); } SYS_KTRACE = 45 // { int sys_ktrace(const char *fname, int ops, int facs, pid_t pid); } SYS_SIGACTION = 46 // { int sys_sigaction(int signum, const struct sigaction *nsa, struct sigaction *osa); } SYS_GETGID = 47 // { gid_t sys_getgid(void); } SYS_SIGPROCMASK = 48 // { int sys_sigprocmask(int how, sigset_t mask); } SYS_SETLOGIN = 50 // { int sys_setlogin(const char *namebuf); } SYS_ACCT = 51 // { int sys_acct(const char *path); } SYS_SIGPENDING = 52 // { int sys_sigpending(void); } SYS_FSTAT = 53 // { int sys_fstat(int fd, struct stat *sb); } SYS_IOCTL = 54 // { int sys_ioctl(int fd, u_long com, ... void *data); } SYS_REBOOT = 55 // { int sys_reboot(int opt); } SYS_REVOKE = 56 // { int sys_revoke(const char *path); } SYS_SYMLINK = 57 // { int sys_symlink(const char *path, const char *link); } SYS_READLINK = 58 // { ssize_t sys_readlink(const char *path, char *buf, size_t count); } SYS_EXECVE = 59 // { int sys_execve(const char *path, char * const *argp, char * const *envp); } SYS_UMASK = 60 // { mode_t sys_umask(mode_t newmask); } SYS_CHROOT = 61 // { int sys_chroot(const char *path); } SYS_GETFSSTAT = 62 // { int sys_getfsstat(struct statfs *buf, size_t bufsize, int flags); } SYS_STATFS = 63 // { int sys_statfs(const char *path, struct statfs *buf); } SYS_FSTATFS = 64 // { int sys_fstatfs(int fd, struct statfs *buf); } SYS_FHSTATFS = 65 // { int sys_fhstatfs(const fhandle_t *fhp, struct statfs *buf); } SYS_VFORK = 66 // { int sys_vfork(void); } SYS_GETTIMEOFDAY = 67 // { int sys_gettimeofday(struct timeval *tp, struct timezone *tzp); } SYS_SETTIMEOFDAY = 68 // { int sys_settimeofday(const struct timeval *tv, const struct timezone *tzp); } SYS_SETITIMER = 69 // { int sys_setitimer(int which, const struct itimerval *itv, struct itimerval *oitv); } SYS_GETITIMER = 70 // { int sys_getitimer(int which, struct itimerval *itv); } SYS_SELECT = 71 // { int sys_select(int nd, fd_set *in, fd_set *ou, fd_set *ex, struct timeval *tv); } SYS_KEVENT = 72 // { int sys_kevent(int fd, const struct kevent *changelist, int nchanges, struct kevent *eventlist, int nevents, const struct timespec *timeout); } SYS_MUNMAP = 73 // { int sys_munmap(void *addr, size_t len); } SYS_MPROTECT = 74 // { int sys_mprotect(void *addr, size_t len, int prot); } SYS_MADVISE = 75 // { int sys_madvise(void *addr, size_t len, int behav); } SYS_UTIMES = 76 // { int sys_utimes(const char *path, const struct timeval *tptr); } SYS_FUTIMES = 77 // { int sys_futimes(int fd, const struct timeval *tptr); } SYS_MINCORE = 78 // { int sys_mincore(void *addr, size_t len, char *vec); } SYS_GETGROUPS = 79 // { int sys_getgroups(int gidsetsize, gid_t *gidset); } SYS_SETGROUPS = 80 // { int sys_setgroups(int gidsetsize, const gid_t *gidset); } SYS_GETPGRP = 81 // { int sys_getpgrp(void); } SYS_SETPGID = 82 // { int sys_setpgid(pid_t pid, pid_t pgid); } SYS_FUTEX = 83 // { int sys_futex(uint32_t *f, int op, int val, const struct timespec *timeout, uint32_t *g); } SYS_UTIMENSAT = 84 // { int sys_utimensat(int fd, const char *path, const struct timespec *times, int flag); } SYS_FUTIMENS = 85 // { int sys_futimens(int fd, const struct timespec *times); } SYS_KBIND = 86 // { int sys_kbind(const struct __kbind *param, size_t psize, int64_t proc_cookie); } SYS_CLOCK_GETTIME = 87 // { int sys_clock_gettime(clockid_t clock_id, struct timespec *tp); } SYS_CLOCK_SETTIME = 88 // { int sys_clock_settime(clockid_t clock_id, const struct timespec *tp); } SYS_CLOCK_GETRES = 89 // { int sys_clock_getres(clockid_t clock_id, struct timespec *tp); } SYS_DUP2 = 90 // { int sys_dup2(int from, int to); } SYS_NANOSLEEP = 91 // { int sys_nanosleep(const struct timespec *rqtp, struct timespec *rmtp); } SYS_FCNTL = 92 // { int sys_fcntl(int fd, int cmd, ... void *arg); } SYS_ACCEPT4 = 93 // { int sys_accept4(int s, struct sockaddr *name, socklen_t *anamelen, int flags); } SYS___THRSLEEP = 94 // { int sys___thrsleep(const volatile void *ident, clockid_t clock_id, const struct timespec *tp, void *lock, const int *abort); } SYS_FSYNC = 95 // { int sys_fsync(int fd); } SYS_SETPRIORITY = 96 // { int sys_setpriority(int which, id_t who, int prio); } SYS_SOCKET = 97 // { int sys_socket(int domain, int type, int protocol); } SYS_CONNECT = 98 // { int sys_connect(int s, const struct sockaddr *name, socklen_t namelen); } SYS_GETDENTS = 99 // { int sys_getdents(int fd, void *buf, size_t buflen); } SYS_GETPRIORITY = 100 // { int sys_getpriority(int which, id_t who); } SYS_PIPE2 = 101 // { int sys_pipe2(int *fdp, int flags); } SYS_DUP3 = 102 // { int sys_dup3(int from, int to, int flags); } SYS_SIGRETURN = 103 // { int sys_sigreturn(struct sigcontext *sigcntxp); } SYS_BIND = 104 // { int sys_bind(int s, const struct sockaddr *name, socklen_t namelen); } SYS_SETSOCKOPT = 105 // { int sys_setsockopt(int s, int level, int name, const void *val, socklen_t valsize); } SYS_LISTEN = 106 // { int sys_listen(int s, int backlog); } SYS_CHFLAGSAT = 107 // { int sys_chflagsat(int fd, const char *path, u_int flags, int atflags); } SYS_PLEDGE = 108 // { int sys_pledge(const char *promises, const char *execpromises); } SYS_PPOLL = 109 // { int sys_ppoll(struct pollfd *fds, u_int nfds, const struct timespec *ts, const sigset_t *mask); } SYS_PSELECT = 110 // { int sys_pselect(int nd, fd_set *in, fd_set *ou, fd_set *ex, const struct timespec *ts, const sigset_t *mask); } SYS_SIGSUSPEND = 111 // { int sys_sigsuspend(int mask); } SYS_SENDSYSLOG = 112 // { int sys_sendsyslog(const char *buf, size_t nbyte, int flags); } SYS_UNVEIL = 114 // { int sys_unveil(const char *path, const char *permissions); } SYS_GETSOCKOPT = 118 // { int sys_getsockopt(int s, int level, int name, void *val, socklen_t *avalsize); } SYS_THRKILL = 119 // { int sys_thrkill(pid_t tid, int signum, void *tcb); } SYS_READV = 120 // { ssize_t sys_readv(int fd, const struct iovec *iovp, int iovcnt); } SYS_WRITEV = 121 // { ssize_t sys_writev(int fd, const struct iovec *iovp, int iovcnt); } SYS_KILL = 122 // { int sys_kill(int pid, int signum); } SYS_FCHOWN = 123 // { int sys_fchown(int fd, uid_t uid, gid_t gid); } SYS_FCHMOD = 124 // { int sys_fchmod(int fd, mode_t mode); } SYS_SETREUID = 126 // { int sys_setreuid(uid_t ruid, uid_t euid); } SYS_SETREGID = 127 // { int sys_setregid(gid_t rgid, gid_t egid); } SYS_RENAME = 128 // { int sys_rename(const char *from, const char *to); } SYS_FLOCK = 131 // { int sys_flock(int fd, int how); } SYS_MKFIFO = 132 // { int sys_mkfifo(const char *path, mode_t mode); } SYS_SENDTO = 133 // { ssize_t sys_sendto(int s, const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen); } SYS_SHUTDOWN = 134 // { int sys_shutdown(int s, int how); } SYS_SOCKETPAIR = 135 // { int sys_socketpair(int domain, int type, int protocol, int *rsv); } SYS_MKDIR = 136 // { int sys_mkdir(const char *path, mode_t mode); } SYS_RMDIR = 137 // { int sys_rmdir(const char *path); } SYS_ADJTIME = 140 // { int sys_adjtime(const struct timeval *delta, struct timeval *olddelta); } SYS_GETLOGIN_R = 141 // { int sys_getlogin_r(char *namebuf, u_int namelen); } SYS_SETSID = 147 // { int sys_setsid(void); } SYS_QUOTACTL = 148 // { int sys_quotactl(const char *path, int cmd, int uid, char *arg); } SYS_NFSSVC = 155 // { int sys_nfssvc(int flag, void *argp); } SYS_GETFH = 161 // { int sys_getfh(const char *fname, fhandle_t *fhp); } SYS_SYSARCH = 165 // { int sys_sysarch(int op, void *parms); } SYS_PREAD = 173 // { ssize_t sys_pread(int fd, void *buf, size_t nbyte, int pad, off_t offset); } SYS_PWRITE = 174 // { ssize_t sys_pwrite(int fd, const void *buf, size_t nbyte, int pad, off_t offset); } SYS_SETGID = 181 // { int sys_setgid(gid_t gid); } SYS_SETEGID = 182 // { int sys_setegid(gid_t egid); } SYS_SETEUID = 183 // { int sys_seteuid(uid_t euid); } SYS_PATHCONF = 191 // { long sys_pathconf(const char *path, int name); } SYS_FPATHCONF = 192 // { long sys_fpathconf(int fd, int name); } SYS_SWAPCTL = 193 // { int sys_swapctl(int cmd, const void *arg, int misc); } SYS_GETRLIMIT = 194 // { int sys_getrlimit(int which, struct rlimit *rlp); } SYS_SETRLIMIT = 195 // { int sys_setrlimit(int which, const struct rlimit *rlp); } SYS_MMAP = 197 // { void *sys_mmap(void *addr, size_t len, int prot, int flags, int fd, long pad, off_t pos); } SYS_LSEEK = 199 // { off_t sys_lseek(int fd, int pad, off_t offset, int whence); } SYS_TRUNCATE = 200 // { int sys_truncate(const char *path, int pad, off_t length); } SYS_FTRUNCATE = 201 // { int sys_ftruncate(int fd, int pad, off_t length); } SYS_SYSCTL = 202 // { int sys_sysctl(const int *name, u_int namelen, void *old, size_t *oldlenp, void *new, size_t newlen); } SYS_MLOCK = 203 // { int sys_mlock(const void *addr, size_t len); } SYS_MUNLOCK = 204 // { int sys_munlock(const void *addr, size_t len); } SYS_GETPGID = 207 // { pid_t sys_getpgid(pid_t pid); } SYS_UTRACE = 209 // { int sys_utrace(const char *label, const void *addr, size_t len); } SYS_SEMGET = 221 // { int sys_semget(key_t key, int nsems, int semflg); } SYS_MSGGET = 225 // { int sys_msgget(key_t key, int msgflg); } SYS_MSGSND = 226 // { int sys_msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg); } SYS_MSGRCV = 227 // { int sys_msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg); } SYS_SHMAT = 228 // { void *sys_shmat(int shmid, const void *shmaddr, int shmflg); } SYS_SHMDT = 230 // { int sys_shmdt(const void *shmaddr); } SYS_MINHERIT = 250 // { int sys_minherit(void *addr, size_t len, int inherit); } SYS_POLL = 252 // { int sys_poll(struct pollfd *fds, u_int nfds, int timeout); } SYS_ISSETUGID = 253 // { int sys_issetugid(void); } SYS_LCHOWN = 254 // { int sys_lchown(const char *path, uid_t uid, gid_t gid); } SYS_GETSID = 255 // { pid_t sys_getsid(pid_t pid); } SYS_MSYNC = 256 // { int sys_msync(void *addr, size_t len, int flags); } SYS_PIPE = 263 // { int sys_pipe(int *fdp); } SYS_FHOPEN = 264 // { int sys_fhopen(const fhandle_t *fhp, int flags); } SYS_PREADV = 267 // { ssize_t sys_preadv(int fd, const struct iovec *iovp, int iovcnt, int pad, off_t offset); } SYS_PWRITEV = 268 // { ssize_t sys_pwritev(int fd, const struct iovec *iovp, int iovcnt, int pad, off_t offset); } SYS_KQUEUE = 269 // { int sys_kqueue(void); } SYS_MLOCKALL = 271 // { int sys_mlockall(int flags); } SYS_MUNLOCKALL = 272 // { int sys_munlockall(void); } SYS_GETRESUID = 281 // { int sys_getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); } SYS_SETRESUID = 282 // { int sys_setresuid(uid_t ruid, uid_t euid, uid_t suid); } SYS_GETRESGID = 283 // { int sys_getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); } SYS_SETRESGID = 284 // { int sys_setresgid(gid_t rgid, gid_t egid, gid_t sgid); } SYS_MQUERY = 286 // { void *sys_mquery(void *addr, size_t len, int prot, int flags, int fd, long pad, off_t pos); } SYS_CLOSEFROM = 287 // { int sys_closefrom(int fd); } SYS_SIGALTSTACK = 288 // { int sys_sigaltstack(const struct sigaltstack *nss, struct sigaltstack *oss); } SYS_SHMGET = 289 // { int sys_shmget(key_t key, size_t size, int shmflg); } SYS_SEMOP = 290 // { int sys_semop(int semid, struct sembuf *sops, size_t nsops); } SYS_FHSTAT = 294 // { int sys_fhstat(const fhandle_t *fhp, struct stat *sb); } SYS___SEMCTL = 295 // { int sys___semctl(int semid, int semnum, int cmd, union semun *arg); } SYS_SHMCTL = 296 // { int sys_shmctl(int shmid, int cmd, struct shmid_ds *buf); } SYS_MSGCTL = 297 // { int sys_msgctl(int msqid, int cmd, struct msqid_ds *buf); } SYS_SCHED_YIELD = 298 // { int sys_sched_yield(void); } SYS_GETTHRID = 299 // { pid_t sys_getthrid(void); } SYS___THRWAKEUP = 301 // { int sys___thrwakeup(const volatile void *ident, int n); } SYS___THREXIT = 302 // { void sys___threxit(pid_t *notdead); } SYS___THRSIGDIVERT = 303 // { int sys___thrsigdivert(sigset_t sigmask, siginfo_t *info, const struct timespec *timeout); } SYS___GETCWD = 304 // { int sys___getcwd(char *buf, size_t len); } SYS_ADJFREQ = 305 // { int sys_adjfreq(const int64_t *freq, int64_t *oldfreq); } SYS_SETRTABLE = 310 // { int sys_setrtable(int rtableid); } SYS_GETRTABLE = 311 // { int sys_getrtable(void); } SYS_FACCESSAT = 313 // { int sys_faccessat(int fd, const char *path, int amode, int flag); } SYS_FCHMODAT = 314 // { int sys_fchmodat(int fd, const char *path, mode_t mode, int flag); } SYS_FCHOWNAT = 315 // { int sys_fchownat(int fd, const char *path, uid_t uid, gid_t gid, int flag); } SYS_LINKAT = 317 // { int sys_linkat(int fd1, const char *path1, int fd2, const char *path2, int flag); } SYS_MKDIRAT = 318 // { int sys_mkdirat(int fd, const char *path, mode_t mode); } SYS_MKFIFOAT = 319 // { int sys_mkfifoat(int fd, const char *path, mode_t mode); } SYS_MKNODAT = 320 // { int sys_mknodat(int fd, const char *path, mode_t mode, dev_t dev); } SYS_OPENAT = 321 // { int sys_openat(int fd, const char *path, int flags, ... mode_t mode); } SYS_READLINKAT = 322 // { ssize_t sys_readlinkat(int fd, const char *path, char *buf, size_t count); } SYS_RENAMEAT = 323 // { int sys_renameat(int fromfd, const char *from, int tofd, const char *to); } SYS_SYMLINKAT = 324 // { int sys_symlinkat(const char *path, int fd, const char *link); } SYS_UNLINKAT = 325 // { int sys_unlinkat(int fd, const char *path, int flag); } SYS___SET_TCB = 329 // { void sys___set_tcb(void *tcb); } SYS___GET_TCB = 330 // { void *sys___get_tcb(void); } ) ================================================ FILE: vendor/golang.org/x/sys/unix/zsysnum_openbsd_amd64.go ================================================ // go run mksysnum.go https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master // Code generated by the command above; see README.md. DO NOT EDIT. //go:build amd64 && openbsd package unix // Deprecated: Use libc wrappers instead of direct syscalls. const ( SYS_EXIT = 1 // { void sys_exit(int rval); } SYS_FORK = 2 // { int sys_fork(void); } SYS_READ = 3 // { ssize_t sys_read(int fd, void *buf, size_t nbyte); } SYS_WRITE = 4 // { ssize_t sys_write(int fd, const void *buf, size_t nbyte); } SYS_OPEN = 5 // { int sys_open(const char *path, int flags, ... mode_t mode); } SYS_CLOSE = 6 // { int sys_close(int fd); } SYS_GETENTROPY = 7 // { int sys_getentropy(void *buf, size_t nbyte); } SYS___TFORK = 8 // { int sys___tfork(const struct __tfork *param, size_t psize); } SYS_LINK = 9 // { int sys_link(const char *path, const char *link); } SYS_UNLINK = 10 // { int sys_unlink(const char *path); } SYS_WAIT4 = 11 // { pid_t sys_wait4(pid_t pid, int *status, int options, struct rusage *rusage); } SYS_CHDIR = 12 // { int sys_chdir(const char *path); } SYS_FCHDIR = 13 // { int sys_fchdir(int fd); } SYS_MKNOD = 14 // { int sys_mknod(const char *path, mode_t mode, dev_t dev); } SYS_CHMOD = 15 // { int sys_chmod(const char *path, mode_t mode); } SYS_CHOWN = 16 // { int sys_chown(const char *path, uid_t uid, gid_t gid); } SYS_OBREAK = 17 // { int sys_obreak(char *nsize); } break SYS_GETDTABLECOUNT = 18 // { int sys_getdtablecount(void); } SYS_GETRUSAGE = 19 // { int sys_getrusage(int who, struct rusage *rusage); } SYS_GETPID = 20 // { pid_t sys_getpid(void); } SYS_MOUNT = 21 // { int sys_mount(const char *type, const char *path, int flags, void *data); } SYS_UNMOUNT = 22 // { int sys_unmount(const char *path, int flags); } SYS_SETUID = 23 // { int sys_setuid(uid_t uid); } SYS_GETUID = 24 // { uid_t sys_getuid(void); } SYS_GETEUID = 25 // { uid_t sys_geteuid(void); } SYS_PTRACE = 26 // { int sys_ptrace(int req, pid_t pid, caddr_t addr, int data); } SYS_RECVMSG = 27 // { ssize_t sys_recvmsg(int s, struct msghdr *msg, int flags); } SYS_SENDMSG = 28 // { ssize_t sys_sendmsg(int s, const struct msghdr *msg, int flags); } SYS_RECVFROM = 29 // { ssize_t sys_recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlenaddr); } SYS_ACCEPT = 30 // { int sys_accept(int s, struct sockaddr *name, socklen_t *anamelen); } SYS_GETPEERNAME = 31 // { int sys_getpeername(int fdes, struct sockaddr *asa, socklen_t *alen); } SYS_GETSOCKNAME = 32 // { int sys_getsockname(int fdes, struct sockaddr *asa, socklen_t *alen); } SYS_ACCESS = 33 // { int sys_access(const char *path, int amode); } SYS_CHFLAGS = 34 // { int sys_chflags(const char *path, u_int flags); } SYS_FCHFLAGS = 35 // { int sys_fchflags(int fd, u_int flags); } SYS_SYNC = 36 // { void sys_sync(void); } SYS_STAT = 38 // { int sys_stat(const char *path, struct stat *ub); } SYS_GETPPID = 39 // { pid_t sys_getppid(void); } SYS_LSTAT = 40 // { int sys_lstat(const char *path, struct stat *ub); } SYS_DUP = 41 // { int sys_dup(int fd); } SYS_FSTATAT = 42 // { int sys_fstatat(int fd, const char *path, struct stat *buf, int flag); } SYS_GETEGID = 43 // { gid_t sys_getegid(void); } SYS_PROFIL = 44 // { int sys_profil(caddr_t samples, size_t size, u_long offset, u_int scale); } SYS_KTRACE = 45 // { int sys_ktrace(const char *fname, int ops, int facs, pid_t pid); } SYS_SIGACTION = 46 // { int sys_sigaction(int signum, const struct sigaction *nsa, struct sigaction *osa); } SYS_GETGID = 47 // { gid_t sys_getgid(void); } SYS_SIGPROCMASK = 48 // { int sys_sigprocmask(int how, sigset_t mask); } SYS_SETLOGIN = 50 // { int sys_setlogin(const char *namebuf); } SYS_ACCT = 51 // { int sys_acct(const char *path); } SYS_SIGPENDING = 52 // { int sys_sigpending(void); } SYS_FSTAT = 53 // { int sys_fstat(int fd, struct stat *sb); } SYS_IOCTL = 54 // { int sys_ioctl(int fd, u_long com, ... void *data); } SYS_REBOOT = 55 // { int sys_reboot(int opt); } SYS_REVOKE = 56 // { int sys_revoke(const char *path); } SYS_SYMLINK = 57 // { int sys_symlink(const char *path, const char *link); } SYS_READLINK = 58 // { ssize_t sys_readlink(const char *path, char *buf, size_t count); } SYS_EXECVE = 59 // { int sys_execve(const char *path, char * const *argp, char * const *envp); } SYS_UMASK = 60 // { mode_t sys_umask(mode_t newmask); } SYS_CHROOT = 61 // { int sys_chroot(const char *path); } SYS_GETFSSTAT = 62 // { int sys_getfsstat(struct statfs *buf, size_t bufsize, int flags); } SYS_STATFS = 63 // { int sys_statfs(const char *path, struct statfs *buf); } SYS_FSTATFS = 64 // { int sys_fstatfs(int fd, struct statfs *buf); } SYS_FHSTATFS = 65 // { int sys_fhstatfs(const fhandle_t *fhp, struct statfs *buf); } SYS_VFORK = 66 // { int sys_vfork(void); } SYS_GETTIMEOFDAY = 67 // { int sys_gettimeofday(struct timeval *tp, struct timezone *tzp); } SYS_SETTIMEOFDAY = 68 // { int sys_settimeofday(const struct timeval *tv, const struct timezone *tzp); } SYS_SETITIMER = 69 // { int sys_setitimer(int which, const struct itimerval *itv, struct itimerval *oitv); } SYS_GETITIMER = 70 // { int sys_getitimer(int which, struct itimerval *itv); } SYS_SELECT = 71 // { int sys_select(int nd, fd_set *in, fd_set *ou, fd_set *ex, struct timeval *tv); } SYS_KEVENT = 72 // { int sys_kevent(int fd, const struct kevent *changelist, int nchanges, struct kevent *eventlist, int nevents, const struct timespec *timeout); } SYS_MUNMAP = 73 // { int sys_munmap(void *addr, size_t len); } SYS_MPROTECT = 74 // { int sys_mprotect(void *addr, size_t len, int prot); } SYS_MADVISE = 75 // { int sys_madvise(void *addr, size_t len, int behav); } SYS_UTIMES = 76 // { int sys_utimes(const char *path, const struct timeval *tptr); } SYS_FUTIMES = 77 // { int sys_futimes(int fd, const struct timeval *tptr); } SYS_MINCORE = 78 // { int sys_mincore(void *addr, size_t len, char *vec); } SYS_GETGROUPS = 79 // { int sys_getgroups(int gidsetsize, gid_t *gidset); } SYS_SETGROUPS = 80 // { int sys_setgroups(int gidsetsize, const gid_t *gidset); } SYS_GETPGRP = 81 // { int sys_getpgrp(void); } SYS_SETPGID = 82 // { int sys_setpgid(pid_t pid, pid_t pgid); } SYS_FUTEX = 83 // { int sys_futex(uint32_t *f, int op, int val, const struct timespec *timeout, uint32_t *g); } SYS_UTIMENSAT = 84 // { int sys_utimensat(int fd, const char *path, const struct timespec *times, int flag); } SYS_FUTIMENS = 85 // { int sys_futimens(int fd, const struct timespec *times); } SYS_KBIND = 86 // { int sys_kbind(const struct __kbind *param, size_t psize, int64_t proc_cookie); } SYS_CLOCK_GETTIME = 87 // { int sys_clock_gettime(clockid_t clock_id, struct timespec *tp); } SYS_CLOCK_SETTIME = 88 // { int sys_clock_settime(clockid_t clock_id, const struct timespec *tp); } SYS_CLOCK_GETRES = 89 // { int sys_clock_getres(clockid_t clock_id, struct timespec *tp); } SYS_DUP2 = 90 // { int sys_dup2(int from, int to); } SYS_NANOSLEEP = 91 // { int sys_nanosleep(const struct timespec *rqtp, struct timespec *rmtp); } SYS_FCNTL = 92 // { int sys_fcntl(int fd, int cmd, ... void *arg); } SYS_ACCEPT4 = 93 // { int sys_accept4(int s, struct sockaddr *name, socklen_t *anamelen, int flags); } SYS___THRSLEEP = 94 // { int sys___thrsleep(const volatile void *ident, clockid_t clock_id, const struct timespec *tp, void *lock, const int *abort); } SYS_FSYNC = 95 // { int sys_fsync(int fd); } SYS_SETPRIORITY = 96 // { int sys_setpriority(int which, id_t who, int prio); } SYS_SOCKET = 97 // { int sys_socket(int domain, int type, int protocol); } SYS_CONNECT = 98 // { int sys_connect(int s, const struct sockaddr *name, socklen_t namelen); } SYS_GETDENTS = 99 // { int sys_getdents(int fd, void *buf, size_t buflen); } SYS_GETPRIORITY = 100 // { int sys_getpriority(int which, id_t who); } SYS_PIPE2 = 101 // { int sys_pipe2(int *fdp, int flags); } SYS_DUP3 = 102 // { int sys_dup3(int from, int to, int flags); } SYS_SIGRETURN = 103 // { int sys_sigreturn(struct sigcontext *sigcntxp); } SYS_BIND = 104 // { int sys_bind(int s, const struct sockaddr *name, socklen_t namelen); } SYS_SETSOCKOPT = 105 // { int sys_setsockopt(int s, int level, int name, const void *val, socklen_t valsize); } SYS_LISTEN = 106 // { int sys_listen(int s, int backlog); } SYS_CHFLAGSAT = 107 // { int sys_chflagsat(int fd, const char *path, u_int flags, int atflags); } SYS_PLEDGE = 108 // { int sys_pledge(const char *promises, const char *execpromises); } SYS_PPOLL = 109 // { int sys_ppoll(struct pollfd *fds, u_int nfds, const struct timespec *ts, const sigset_t *mask); } SYS_PSELECT = 110 // { int sys_pselect(int nd, fd_set *in, fd_set *ou, fd_set *ex, const struct timespec *ts, const sigset_t *mask); } SYS_SIGSUSPEND = 111 // { int sys_sigsuspend(int mask); } SYS_SENDSYSLOG = 112 // { int sys_sendsyslog(const char *buf, size_t nbyte, int flags); } SYS_UNVEIL = 114 // { int sys_unveil(const char *path, const char *permissions); } SYS_GETSOCKOPT = 118 // { int sys_getsockopt(int s, int level, int name, void *val, socklen_t *avalsize); } SYS_THRKILL = 119 // { int sys_thrkill(pid_t tid, int signum, void *tcb); } SYS_READV = 120 // { ssize_t sys_readv(int fd, const struct iovec *iovp, int iovcnt); } SYS_WRITEV = 121 // { ssize_t sys_writev(int fd, const struct iovec *iovp, int iovcnt); } SYS_KILL = 122 // { int sys_kill(int pid, int signum); } SYS_FCHOWN = 123 // { int sys_fchown(int fd, uid_t uid, gid_t gid); } SYS_FCHMOD = 124 // { int sys_fchmod(int fd, mode_t mode); } SYS_SETREUID = 126 // { int sys_setreuid(uid_t ruid, uid_t euid); } SYS_SETREGID = 127 // { int sys_setregid(gid_t rgid, gid_t egid); } SYS_RENAME = 128 // { int sys_rename(const char *from, const char *to); } SYS_FLOCK = 131 // { int sys_flock(int fd, int how); } SYS_MKFIFO = 132 // { int sys_mkfifo(const char *path, mode_t mode); } SYS_SENDTO = 133 // { ssize_t sys_sendto(int s, const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen); } SYS_SHUTDOWN = 134 // { int sys_shutdown(int s, int how); } SYS_SOCKETPAIR = 135 // { int sys_socketpair(int domain, int type, int protocol, int *rsv); } SYS_MKDIR = 136 // { int sys_mkdir(const char *path, mode_t mode); } SYS_RMDIR = 137 // { int sys_rmdir(const char *path); } SYS_ADJTIME = 140 // { int sys_adjtime(const struct timeval *delta, struct timeval *olddelta); } SYS_GETLOGIN_R = 141 // { int sys_getlogin_r(char *namebuf, u_int namelen); } SYS_SETSID = 147 // { int sys_setsid(void); } SYS_QUOTACTL = 148 // { int sys_quotactl(const char *path, int cmd, int uid, char *arg); } SYS_NFSSVC = 155 // { int sys_nfssvc(int flag, void *argp); } SYS_GETFH = 161 // { int sys_getfh(const char *fname, fhandle_t *fhp); } SYS_SYSARCH = 165 // { int sys_sysarch(int op, void *parms); } SYS_PREAD = 173 // { ssize_t sys_pread(int fd, void *buf, size_t nbyte, int pad, off_t offset); } SYS_PWRITE = 174 // { ssize_t sys_pwrite(int fd, const void *buf, size_t nbyte, int pad, off_t offset); } SYS_SETGID = 181 // { int sys_setgid(gid_t gid); } SYS_SETEGID = 182 // { int sys_setegid(gid_t egid); } SYS_SETEUID = 183 // { int sys_seteuid(uid_t euid); } SYS_PATHCONF = 191 // { long sys_pathconf(const char *path, int name); } SYS_FPATHCONF = 192 // { long sys_fpathconf(int fd, int name); } SYS_SWAPCTL = 193 // { int sys_swapctl(int cmd, const void *arg, int misc); } SYS_GETRLIMIT = 194 // { int sys_getrlimit(int which, struct rlimit *rlp); } SYS_SETRLIMIT = 195 // { int sys_setrlimit(int which, const struct rlimit *rlp); } SYS_MMAP = 197 // { void *sys_mmap(void *addr, size_t len, int prot, int flags, int fd, long pad, off_t pos); } SYS_LSEEK = 199 // { off_t sys_lseek(int fd, int pad, off_t offset, int whence); } SYS_TRUNCATE = 200 // { int sys_truncate(const char *path, int pad, off_t length); } SYS_FTRUNCATE = 201 // { int sys_ftruncate(int fd, int pad, off_t length); } SYS_SYSCTL = 202 // { int sys_sysctl(const int *name, u_int namelen, void *old, size_t *oldlenp, void *new, size_t newlen); } SYS_MLOCK = 203 // { int sys_mlock(const void *addr, size_t len); } SYS_MUNLOCK = 204 // { int sys_munlock(const void *addr, size_t len); } SYS_GETPGID = 207 // { pid_t sys_getpgid(pid_t pid); } SYS_UTRACE = 209 // { int sys_utrace(const char *label, const void *addr, size_t len); } SYS_SEMGET = 221 // { int sys_semget(key_t key, int nsems, int semflg); } SYS_MSGGET = 225 // { int sys_msgget(key_t key, int msgflg); } SYS_MSGSND = 226 // { int sys_msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg); } SYS_MSGRCV = 227 // { int sys_msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg); } SYS_SHMAT = 228 // { void *sys_shmat(int shmid, const void *shmaddr, int shmflg); } SYS_SHMDT = 230 // { int sys_shmdt(const void *shmaddr); } SYS_MINHERIT = 250 // { int sys_minherit(void *addr, size_t len, int inherit); } SYS_POLL = 252 // { int sys_poll(struct pollfd *fds, u_int nfds, int timeout); } SYS_ISSETUGID = 253 // { int sys_issetugid(void); } SYS_LCHOWN = 254 // { int sys_lchown(const char *path, uid_t uid, gid_t gid); } SYS_GETSID = 255 // { pid_t sys_getsid(pid_t pid); } SYS_MSYNC = 256 // { int sys_msync(void *addr, size_t len, int flags); } SYS_PIPE = 263 // { int sys_pipe(int *fdp); } SYS_FHOPEN = 264 // { int sys_fhopen(const fhandle_t *fhp, int flags); } SYS_PREADV = 267 // { ssize_t sys_preadv(int fd, const struct iovec *iovp, int iovcnt, int pad, off_t offset); } SYS_PWRITEV = 268 // { ssize_t sys_pwritev(int fd, const struct iovec *iovp, int iovcnt, int pad, off_t offset); } SYS_KQUEUE = 269 // { int sys_kqueue(void); } SYS_MLOCKALL = 271 // { int sys_mlockall(int flags); } SYS_MUNLOCKALL = 272 // { int sys_munlockall(void); } SYS_GETRESUID = 281 // { int sys_getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); } SYS_SETRESUID = 282 // { int sys_setresuid(uid_t ruid, uid_t euid, uid_t suid); } SYS_GETRESGID = 283 // { int sys_getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); } SYS_SETRESGID = 284 // { int sys_setresgid(gid_t rgid, gid_t egid, gid_t sgid); } SYS_MQUERY = 286 // { void *sys_mquery(void *addr, size_t len, int prot, int flags, int fd, long pad, off_t pos); } SYS_CLOSEFROM = 287 // { int sys_closefrom(int fd); } SYS_SIGALTSTACK = 288 // { int sys_sigaltstack(const struct sigaltstack *nss, struct sigaltstack *oss); } SYS_SHMGET = 289 // { int sys_shmget(key_t key, size_t size, int shmflg); } SYS_SEMOP = 290 // { int sys_semop(int semid, struct sembuf *sops, size_t nsops); } SYS_FHSTAT = 294 // { int sys_fhstat(const fhandle_t *fhp, struct stat *sb); } SYS___SEMCTL = 295 // { int sys___semctl(int semid, int semnum, int cmd, union semun *arg); } SYS_SHMCTL = 296 // { int sys_shmctl(int shmid, int cmd, struct shmid_ds *buf); } SYS_MSGCTL = 297 // { int sys_msgctl(int msqid, int cmd, struct msqid_ds *buf); } SYS_SCHED_YIELD = 298 // { int sys_sched_yield(void); } SYS_GETTHRID = 299 // { pid_t sys_getthrid(void); } SYS___THRWAKEUP = 301 // { int sys___thrwakeup(const volatile void *ident, int n); } SYS___THREXIT = 302 // { void sys___threxit(pid_t *notdead); } SYS___THRSIGDIVERT = 303 // { int sys___thrsigdivert(sigset_t sigmask, siginfo_t *info, const struct timespec *timeout); } SYS___GETCWD = 304 // { int sys___getcwd(char *buf, size_t len); } SYS_ADJFREQ = 305 // { int sys_adjfreq(const int64_t *freq, int64_t *oldfreq); } SYS_SETRTABLE = 310 // { int sys_setrtable(int rtableid); } SYS_GETRTABLE = 311 // { int sys_getrtable(void); } SYS_FACCESSAT = 313 // { int sys_faccessat(int fd, const char *path, int amode, int flag); } SYS_FCHMODAT = 314 // { int sys_fchmodat(int fd, const char *path, mode_t mode, int flag); } SYS_FCHOWNAT = 315 // { int sys_fchownat(int fd, const char *path, uid_t uid, gid_t gid, int flag); } SYS_LINKAT = 317 // { int sys_linkat(int fd1, const char *path1, int fd2, const char *path2, int flag); } SYS_MKDIRAT = 318 // { int sys_mkdirat(int fd, const char *path, mode_t mode); } SYS_MKFIFOAT = 319 // { int sys_mkfifoat(int fd, const char *path, mode_t mode); } SYS_MKNODAT = 320 // { int sys_mknodat(int fd, const char *path, mode_t mode, dev_t dev); } SYS_OPENAT = 321 // { int sys_openat(int fd, const char *path, int flags, ... mode_t mode); } SYS_READLINKAT = 322 // { ssize_t sys_readlinkat(int fd, const char *path, char *buf, size_t count); } SYS_RENAMEAT = 323 // { int sys_renameat(int fromfd, const char *from, int tofd, const char *to); } SYS_SYMLINKAT = 324 // { int sys_symlinkat(const char *path, int fd, const char *link); } SYS_UNLINKAT = 325 // { int sys_unlinkat(int fd, const char *path, int flag); } SYS___SET_TCB = 329 // { void sys___set_tcb(void *tcb); } SYS___GET_TCB = 330 // { void *sys___get_tcb(void); } ) ================================================ FILE: vendor/golang.org/x/sys/unix/zsysnum_openbsd_arm.go ================================================ // go run mksysnum.go https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm && openbsd package unix // Deprecated: Use libc wrappers instead of direct syscalls. const ( SYS_EXIT = 1 // { void sys_exit(int rval); } SYS_FORK = 2 // { int sys_fork(void); } SYS_READ = 3 // { ssize_t sys_read(int fd, void *buf, size_t nbyte); } SYS_WRITE = 4 // { ssize_t sys_write(int fd, const void *buf, size_t nbyte); } SYS_OPEN = 5 // { int sys_open(const char *path, int flags, ... mode_t mode); } SYS_CLOSE = 6 // { int sys_close(int fd); } SYS_GETENTROPY = 7 // { int sys_getentropy(void *buf, size_t nbyte); } SYS___TFORK = 8 // { int sys___tfork(const struct __tfork *param, size_t psize); } SYS_LINK = 9 // { int sys_link(const char *path, const char *link); } SYS_UNLINK = 10 // { int sys_unlink(const char *path); } SYS_WAIT4 = 11 // { pid_t sys_wait4(pid_t pid, int *status, int options, struct rusage *rusage); } SYS_CHDIR = 12 // { int sys_chdir(const char *path); } SYS_FCHDIR = 13 // { int sys_fchdir(int fd); } SYS_MKNOD = 14 // { int sys_mknod(const char *path, mode_t mode, dev_t dev); } SYS_CHMOD = 15 // { int sys_chmod(const char *path, mode_t mode); } SYS_CHOWN = 16 // { int sys_chown(const char *path, uid_t uid, gid_t gid); } SYS_OBREAK = 17 // { int sys_obreak(char *nsize); } break SYS_GETDTABLECOUNT = 18 // { int sys_getdtablecount(void); } SYS_GETRUSAGE = 19 // { int sys_getrusage(int who, struct rusage *rusage); } SYS_GETPID = 20 // { pid_t sys_getpid(void); } SYS_MOUNT = 21 // { int sys_mount(const char *type, const char *path, int flags, void *data); } SYS_UNMOUNT = 22 // { int sys_unmount(const char *path, int flags); } SYS_SETUID = 23 // { int sys_setuid(uid_t uid); } SYS_GETUID = 24 // { uid_t sys_getuid(void); } SYS_GETEUID = 25 // { uid_t sys_geteuid(void); } SYS_PTRACE = 26 // { int sys_ptrace(int req, pid_t pid, caddr_t addr, int data); } SYS_RECVMSG = 27 // { ssize_t sys_recvmsg(int s, struct msghdr *msg, int flags); } SYS_SENDMSG = 28 // { ssize_t sys_sendmsg(int s, const struct msghdr *msg, int flags); } SYS_RECVFROM = 29 // { ssize_t sys_recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlenaddr); } SYS_ACCEPT = 30 // { int sys_accept(int s, struct sockaddr *name, socklen_t *anamelen); } SYS_GETPEERNAME = 31 // { int sys_getpeername(int fdes, struct sockaddr *asa, socklen_t *alen); } SYS_GETSOCKNAME = 32 // { int sys_getsockname(int fdes, struct sockaddr *asa, socklen_t *alen); } SYS_ACCESS = 33 // { int sys_access(const char *path, int amode); } SYS_CHFLAGS = 34 // { int sys_chflags(const char *path, u_int flags); } SYS_FCHFLAGS = 35 // { int sys_fchflags(int fd, u_int flags); } SYS_SYNC = 36 // { void sys_sync(void); } SYS_STAT = 38 // { int sys_stat(const char *path, struct stat *ub); } SYS_GETPPID = 39 // { pid_t sys_getppid(void); } SYS_LSTAT = 40 // { int sys_lstat(const char *path, struct stat *ub); } SYS_DUP = 41 // { int sys_dup(int fd); } SYS_FSTATAT = 42 // { int sys_fstatat(int fd, const char *path, struct stat *buf, int flag); } SYS_GETEGID = 43 // { gid_t sys_getegid(void); } SYS_PROFIL = 44 // { int sys_profil(caddr_t samples, size_t size, u_long offset, u_int scale); } SYS_KTRACE = 45 // { int sys_ktrace(const char *fname, int ops, int facs, pid_t pid); } SYS_SIGACTION = 46 // { int sys_sigaction(int signum, const struct sigaction *nsa, struct sigaction *osa); } SYS_GETGID = 47 // { gid_t sys_getgid(void); } SYS_SIGPROCMASK = 48 // { int sys_sigprocmask(int how, sigset_t mask); } SYS_SETLOGIN = 50 // { int sys_setlogin(const char *namebuf); } SYS_ACCT = 51 // { int sys_acct(const char *path); } SYS_SIGPENDING = 52 // { int sys_sigpending(void); } SYS_FSTAT = 53 // { int sys_fstat(int fd, struct stat *sb); } SYS_IOCTL = 54 // { int sys_ioctl(int fd, u_long com, ... void *data); } SYS_REBOOT = 55 // { int sys_reboot(int opt); } SYS_REVOKE = 56 // { int sys_revoke(const char *path); } SYS_SYMLINK = 57 // { int sys_symlink(const char *path, const char *link); } SYS_READLINK = 58 // { ssize_t sys_readlink(const char *path, char *buf, size_t count); } SYS_EXECVE = 59 // { int sys_execve(const char *path, char * const *argp, char * const *envp); } SYS_UMASK = 60 // { mode_t sys_umask(mode_t newmask); } SYS_CHROOT = 61 // { int sys_chroot(const char *path); } SYS_GETFSSTAT = 62 // { int sys_getfsstat(struct statfs *buf, size_t bufsize, int flags); } SYS_STATFS = 63 // { int sys_statfs(const char *path, struct statfs *buf); } SYS_FSTATFS = 64 // { int sys_fstatfs(int fd, struct statfs *buf); } SYS_FHSTATFS = 65 // { int sys_fhstatfs(const fhandle_t *fhp, struct statfs *buf); } SYS_VFORK = 66 // { int sys_vfork(void); } SYS_GETTIMEOFDAY = 67 // { int sys_gettimeofday(struct timeval *tp, struct timezone *tzp); } SYS_SETTIMEOFDAY = 68 // { int sys_settimeofday(const struct timeval *tv, const struct timezone *tzp); } SYS_SETITIMER = 69 // { int sys_setitimer(int which, const struct itimerval *itv, struct itimerval *oitv); } SYS_GETITIMER = 70 // { int sys_getitimer(int which, struct itimerval *itv); } SYS_SELECT = 71 // { int sys_select(int nd, fd_set *in, fd_set *ou, fd_set *ex, struct timeval *tv); } SYS_KEVENT = 72 // { int sys_kevent(int fd, const struct kevent *changelist, int nchanges, struct kevent *eventlist, int nevents, const struct timespec *timeout); } SYS_MUNMAP = 73 // { int sys_munmap(void *addr, size_t len); } SYS_MPROTECT = 74 // { int sys_mprotect(void *addr, size_t len, int prot); } SYS_MADVISE = 75 // { int sys_madvise(void *addr, size_t len, int behav); } SYS_UTIMES = 76 // { int sys_utimes(const char *path, const struct timeval *tptr); } SYS_FUTIMES = 77 // { int sys_futimes(int fd, const struct timeval *tptr); } SYS_MINCORE = 78 // { int sys_mincore(void *addr, size_t len, char *vec); } SYS_GETGROUPS = 79 // { int sys_getgroups(int gidsetsize, gid_t *gidset); } SYS_SETGROUPS = 80 // { int sys_setgroups(int gidsetsize, const gid_t *gidset); } SYS_GETPGRP = 81 // { int sys_getpgrp(void); } SYS_SETPGID = 82 // { int sys_setpgid(pid_t pid, pid_t pgid); } SYS_FUTEX = 83 // { int sys_futex(uint32_t *f, int op, int val, const struct timespec *timeout, uint32_t *g); } SYS_UTIMENSAT = 84 // { int sys_utimensat(int fd, const char *path, const struct timespec *times, int flag); } SYS_FUTIMENS = 85 // { int sys_futimens(int fd, const struct timespec *times); } SYS_KBIND = 86 // { int sys_kbind(const struct __kbind *param, size_t psize, int64_t proc_cookie); } SYS_CLOCK_GETTIME = 87 // { int sys_clock_gettime(clockid_t clock_id, struct timespec *tp); } SYS_CLOCK_SETTIME = 88 // { int sys_clock_settime(clockid_t clock_id, const struct timespec *tp); } SYS_CLOCK_GETRES = 89 // { int sys_clock_getres(clockid_t clock_id, struct timespec *tp); } SYS_DUP2 = 90 // { int sys_dup2(int from, int to); } SYS_NANOSLEEP = 91 // { int sys_nanosleep(const struct timespec *rqtp, struct timespec *rmtp); } SYS_FCNTL = 92 // { int sys_fcntl(int fd, int cmd, ... void *arg); } SYS_ACCEPT4 = 93 // { int sys_accept4(int s, struct sockaddr *name, socklen_t *anamelen, int flags); } SYS___THRSLEEP = 94 // { int sys___thrsleep(const volatile void *ident, clockid_t clock_id, const struct timespec *tp, void *lock, const int *abort); } SYS_FSYNC = 95 // { int sys_fsync(int fd); } SYS_SETPRIORITY = 96 // { int sys_setpriority(int which, id_t who, int prio); } SYS_SOCKET = 97 // { int sys_socket(int domain, int type, int protocol); } SYS_CONNECT = 98 // { int sys_connect(int s, const struct sockaddr *name, socklen_t namelen); } SYS_GETDENTS = 99 // { int sys_getdents(int fd, void *buf, size_t buflen); } SYS_GETPRIORITY = 100 // { int sys_getpriority(int which, id_t who); } SYS_PIPE2 = 101 // { int sys_pipe2(int *fdp, int flags); } SYS_DUP3 = 102 // { int sys_dup3(int from, int to, int flags); } SYS_SIGRETURN = 103 // { int sys_sigreturn(struct sigcontext *sigcntxp); } SYS_BIND = 104 // { int sys_bind(int s, const struct sockaddr *name, socklen_t namelen); } SYS_SETSOCKOPT = 105 // { int sys_setsockopt(int s, int level, int name, const void *val, socklen_t valsize); } SYS_LISTEN = 106 // { int sys_listen(int s, int backlog); } SYS_CHFLAGSAT = 107 // { int sys_chflagsat(int fd, const char *path, u_int flags, int atflags); } SYS_PLEDGE = 108 // { int sys_pledge(const char *promises, const char *execpromises); } SYS_PPOLL = 109 // { int sys_ppoll(struct pollfd *fds, u_int nfds, const struct timespec *ts, const sigset_t *mask); } SYS_PSELECT = 110 // { int sys_pselect(int nd, fd_set *in, fd_set *ou, fd_set *ex, const struct timespec *ts, const sigset_t *mask); } SYS_SIGSUSPEND = 111 // { int sys_sigsuspend(int mask); } SYS_SENDSYSLOG = 112 // { int sys_sendsyslog(const char *buf, size_t nbyte, int flags); } SYS_UNVEIL = 114 // { int sys_unveil(const char *path, const char *permissions); } SYS_GETSOCKOPT = 118 // { int sys_getsockopt(int s, int level, int name, void *val, socklen_t *avalsize); } SYS_THRKILL = 119 // { int sys_thrkill(pid_t tid, int signum, void *tcb); } SYS_READV = 120 // { ssize_t sys_readv(int fd, const struct iovec *iovp, int iovcnt); } SYS_WRITEV = 121 // { ssize_t sys_writev(int fd, const struct iovec *iovp, int iovcnt); } SYS_KILL = 122 // { int sys_kill(int pid, int signum); } SYS_FCHOWN = 123 // { int sys_fchown(int fd, uid_t uid, gid_t gid); } SYS_FCHMOD = 124 // { int sys_fchmod(int fd, mode_t mode); } SYS_SETREUID = 126 // { int sys_setreuid(uid_t ruid, uid_t euid); } SYS_SETREGID = 127 // { int sys_setregid(gid_t rgid, gid_t egid); } SYS_RENAME = 128 // { int sys_rename(const char *from, const char *to); } SYS_FLOCK = 131 // { int sys_flock(int fd, int how); } SYS_MKFIFO = 132 // { int sys_mkfifo(const char *path, mode_t mode); } SYS_SENDTO = 133 // { ssize_t sys_sendto(int s, const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen); } SYS_SHUTDOWN = 134 // { int sys_shutdown(int s, int how); } SYS_SOCKETPAIR = 135 // { int sys_socketpair(int domain, int type, int protocol, int *rsv); } SYS_MKDIR = 136 // { int sys_mkdir(const char *path, mode_t mode); } SYS_RMDIR = 137 // { int sys_rmdir(const char *path); } SYS_ADJTIME = 140 // { int sys_adjtime(const struct timeval *delta, struct timeval *olddelta); } SYS_GETLOGIN_R = 141 // { int sys_getlogin_r(char *namebuf, u_int namelen); } SYS_SETSID = 147 // { int sys_setsid(void); } SYS_QUOTACTL = 148 // { int sys_quotactl(const char *path, int cmd, int uid, char *arg); } SYS_NFSSVC = 155 // { int sys_nfssvc(int flag, void *argp); } SYS_GETFH = 161 // { int sys_getfh(const char *fname, fhandle_t *fhp); } SYS_SYSARCH = 165 // { int sys_sysarch(int op, void *parms); } SYS_PREAD = 173 // { ssize_t sys_pread(int fd, void *buf, size_t nbyte, int pad, off_t offset); } SYS_PWRITE = 174 // { ssize_t sys_pwrite(int fd, const void *buf, size_t nbyte, int pad, off_t offset); } SYS_SETGID = 181 // { int sys_setgid(gid_t gid); } SYS_SETEGID = 182 // { int sys_setegid(gid_t egid); } SYS_SETEUID = 183 // { int sys_seteuid(uid_t euid); } SYS_PATHCONF = 191 // { long sys_pathconf(const char *path, int name); } SYS_FPATHCONF = 192 // { long sys_fpathconf(int fd, int name); } SYS_SWAPCTL = 193 // { int sys_swapctl(int cmd, const void *arg, int misc); } SYS_GETRLIMIT = 194 // { int sys_getrlimit(int which, struct rlimit *rlp); } SYS_SETRLIMIT = 195 // { int sys_setrlimit(int which, const struct rlimit *rlp); } SYS_MMAP = 197 // { void *sys_mmap(void *addr, size_t len, int prot, int flags, int fd, long pad, off_t pos); } SYS_LSEEK = 199 // { off_t sys_lseek(int fd, int pad, off_t offset, int whence); } SYS_TRUNCATE = 200 // { int sys_truncate(const char *path, int pad, off_t length); } SYS_FTRUNCATE = 201 // { int sys_ftruncate(int fd, int pad, off_t length); } SYS_SYSCTL = 202 // { int sys_sysctl(const int *name, u_int namelen, void *old, size_t *oldlenp, void *new, size_t newlen); } SYS_MLOCK = 203 // { int sys_mlock(const void *addr, size_t len); } SYS_MUNLOCK = 204 // { int sys_munlock(const void *addr, size_t len); } SYS_GETPGID = 207 // { pid_t sys_getpgid(pid_t pid); } SYS_UTRACE = 209 // { int sys_utrace(const char *label, const void *addr, size_t len); } SYS_SEMGET = 221 // { int sys_semget(key_t key, int nsems, int semflg); } SYS_MSGGET = 225 // { int sys_msgget(key_t key, int msgflg); } SYS_MSGSND = 226 // { int sys_msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg); } SYS_MSGRCV = 227 // { int sys_msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg); } SYS_SHMAT = 228 // { void *sys_shmat(int shmid, const void *shmaddr, int shmflg); } SYS_SHMDT = 230 // { int sys_shmdt(const void *shmaddr); } SYS_MINHERIT = 250 // { int sys_minherit(void *addr, size_t len, int inherit); } SYS_POLL = 252 // { int sys_poll(struct pollfd *fds, u_int nfds, int timeout); } SYS_ISSETUGID = 253 // { int sys_issetugid(void); } SYS_LCHOWN = 254 // { int sys_lchown(const char *path, uid_t uid, gid_t gid); } SYS_GETSID = 255 // { pid_t sys_getsid(pid_t pid); } SYS_MSYNC = 256 // { int sys_msync(void *addr, size_t len, int flags); } SYS_PIPE = 263 // { int sys_pipe(int *fdp); } SYS_FHOPEN = 264 // { int sys_fhopen(const fhandle_t *fhp, int flags); } SYS_PREADV = 267 // { ssize_t sys_preadv(int fd, const struct iovec *iovp, int iovcnt, int pad, off_t offset); } SYS_PWRITEV = 268 // { ssize_t sys_pwritev(int fd, const struct iovec *iovp, int iovcnt, int pad, off_t offset); } SYS_KQUEUE = 269 // { int sys_kqueue(void); } SYS_MLOCKALL = 271 // { int sys_mlockall(int flags); } SYS_MUNLOCKALL = 272 // { int sys_munlockall(void); } SYS_GETRESUID = 281 // { int sys_getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); } SYS_SETRESUID = 282 // { int sys_setresuid(uid_t ruid, uid_t euid, uid_t suid); } SYS_GETRESGID = 283 // { int sys_getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); } SYS_SETRESGID = 284 // { int sys_setresgid(gid_t rgid, gid_t egid, gid_t sgid); } SYS_MQUERY = 286 // { void *sys_mquery(void *addr, size_t len, int prot, int flags, int fd, long pad, off_t pos); } SYS_CLOSEFROM = 287 // { int sys_closefrom(int fd); } SYS_SIGALTSTACK = 288 // { int sys_sigaltstack(const struct sigaltstack *nss, struct sigaltstack *oss); } SYS_SHMGET = 289 // { int sys_shmget(key_t key, size_t size, int shmflg); } SYS_SEMOP = 290 // { int sys_semop(int semid, struct sembuf *sops, size_t nsops); } SYS_FHSTAT = 294 // { int sys_fhstat(const fhandle_t *fhp, struct stat *sb); } SYS___SEMCTL = 295 // { int sys___semctl(int semid, int semnum, int cmd, union semun *arg); } SYS_SHMCTL = 296 // { int sys_shmctl(int shmid, int cmd, struct shmid_ds *buf); } SYS_MSGCTL = 297 // { int sys_msgctl(int msqid, int cmd, struct msqid_ds *buf); } SYS_SCHED_YIELD = 298 // { int sys_sched_yield(void); } SYS_GETTHRID = 299 // { pid_t sys_getthrid(void); } SYS___THRWAKEUP = 301 // { int sys___thrwakeup(const volatile void *ident, int n); } SYS___THREXIT = 302 // { void sys___threxit(pid_t *notdead); } SYS___THRSIGDIVERT = 303 // { int sys___thrsigdivert(sigset_t sigmask, siginfo_t *info, const struct timespec *timeout); } SYS___GETCWD = 304 // { int sys___getcwd(char *buf, size_t len); } SYS_ADJFREQ = 305 // { int sys_adjfreq(const int64_t *freq, int64_t *oldfreq); } SYS_SETRTABLE = 310 // { int sys_setrtable(int rtableid); } SYS_GETRTABLE = 311 // { int sys_getrtable(void); } SYS_FACCESSAT = 313 // { int sys_faccessat(int fd, const char *path, int amode, int flag); } SYS_FCHMODAT = 314 // { int sys_fchmodat(int fd, const char *path, mode_t mode, int flag); } SYS_FCHOWNAT = 315 // { int sys_fchownat(int fd, const char *path, uid_t uid, gid_t gid, int flag); } SYS_LINKAT = 317 // { int sys_linkat(int fd1, const char *path1, int fd2, const char *path2, int flag); } SYS_MKDIRAT = 318 // { int sys_mkdirat(int fd, const char *path, mode_t mode); } SYS_MKFIFOAT = 319 // { int sys_mkfifoat(int fd, const char *path, mode_t mode); } SYS_MKNODAT = 320 // { int sys_mknodat(int fd, const char *path, mode_t mode, dev_t dev); } SYS_OPENAT = 321 // { int sys_openat(int fd, const char *path, int flags, ... mode_t mode); } SYS_READLINKAT = 322 // { ssize_t sys_readlinkat(int fd, const char *path, char *buf, size_t count); } SYS_RENAMEAT = 323 // { int sys_renameat(int fromfd, const char *from, int tofd, const char *to); } SYS_SYMLINKAT = 324 // { int sys_symlinkat(const char *path, int fd, const char *link); } SYS_UNLINKAT = 325 // { int sys_unlinkat(int fd, const char *path, int flag); } SYS___SET_TCB = 329 // { void sys___set_tcb(void *tcb); } SYS___GET_TCB = 330 // { void *sys___get_tcb(void); } ) ================================================ FILE: vendor/golang.org/x/sys/unix/zsysnum_openbsd_arm64.go ================================================ // go run mksysnum.go https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm64 && openbsd package unix // Deprecated: Use libc wrappers instead of direct syscalls. const ( SYS_EXIT = 1 // { void sys_exit(int rval); } SYS_FORK = 2 // { int sys_fork(void); } SYS_READ = 3 // { ssize_t sys_read(int fd, void *buf, size_t nbyte); } SYS_WRITE = 4 // { ssize_t sys_write(int fd, const void *buf, size_t nbyte); } SYS_OPEN = 5 // { int sys_open(const char *path, int flags, ... mode_t mode); } SYS_CLOSE = 6 // { int sys_close(int fd); } SYS_GETENTROPY = 7 // { int sys_getentropy(void *buf, size_t nbyte); } SYS___TFORK = 8 // { int sys___tfork(const struct __tfork *param, size_t psize); } SYS_LINK = 9 // { int sys_link(const char *path, const char *link); } SYS_UNLINK = 10 // { int sys_unlink(const char *path); } SYS_WAIT4 = 11 // { pid_t sys_wait4(pid_t pid, int *status, int options, struct rusage *rusage); } SYS_CHDIR = 12 // { int sys_chdir(const char *path); } SYS_FCHDIR = 13 // { int sys_fchdir(int fd); } SYS_MKNOD = 14 // { int sys_mknod(const char *path, mode_t mode, dev_t dev); } SYS_CHMOD = 15 // { int sys_chmod(const char *path, mode_t mode); } SYS_CHOWN = 16 // { int sys_chown(const char *path, uid_t uid, gid_t gid); } SYS_OBREAK = 17 // { int sys_obreak(char *nsize); } break SYS_GETDTABLECOUNT = 18 // { int sys_getdtablecount(void); } SYS_GETRUSAGE = 19 // { int sys_getrusage(int who, struct rusage *rusage); } SYS_GETPID = 20 // { pid_t sys_getpid(void); } SYS_MOUNT = 21 // { int sys_mount(const char *type, const char *path, int flags, void *data); } SYS_UNMOUNT = 22 // { int sys_unmount(const char *path, int flags); } SYS_SETUID = 23 // { int sys_setuid(uid_t uid); } SYS_GETUID = 24 // { uid_t sys_getuid(void); } SYS_GETEUID = 25 // { uid_t sys_geteuid(void); } SYS_PTRACE = 26 // { int sys_ptrace(int req, pid_t pid, caddr_t addr, int data); } SYS_RECVMSG = 27 // { ssize_t sys_recvmsg(int s, struct msghdr *msg, int flags); } SYS_SENDMSG = 28 // { ssize_t sys_sendmsg(int s, const struct msghdr *msg, int flags); } SYS_RECVFROM = 29 // { ssize_t sys_recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlenaddr); } SYS_ACCEPT = 30 // { int sys_accept(int s, struct sockaddr *name, socklen_t *anamelen); } SYS_GETPEERNAME = 31 // { int sys_getpeername(int fdes, struct sockaddr *asa, socklen_t *alen); } SYS_GETSOCKNAME = 32 // { int sys_getsockname(int fdes, struct sockaddr *asa, socklen_t *alen); } SYS_ACCESS = 33 // { int sys_access(const char *path, int amode); } SYS_CHFLAGS = 34 // { int sys_chflags(const char *path, u_int flags); } SYS_FCHFLAGS = 35 // { int sys_fchflags(int fd, u_int flags); } SYS_SYNC = 36 // { void sys_sync(void); } SYS_STAT = 38 // { int sys_stat(const char *path, struct stat *ub); } SYS_GETPPID = 39 // { pid_t sys_getppid(void); } SYS_LSTAT = 40 // { int sys_lstat(const char *path, struct stat *ub); } SYS_DUP = 41 // { int sys_dup(int fd); } SYS_FSTATAT = 42 // { int sys_fstatat(int fd, const char *path, struct stat *buf, int flag); } SYS_GETEGID = 43 // { gid_t sys_getegid(void); } SYS_PROFIL = 44 // { int sys_profil(caddr_t samples, size_t size, u_long offset, u_int scale); } SYS_KTRACE = 45 // { int sys_ktrace(const char *fname, int ops, int facs, pid_t pid); } SYS_SIGACTION = 46 // { int sys_sigaction(int signum, const struct sigaction *nsa, struct sigaction *osa); } SYS_GETGID = 47 // { gid_t sys_getgid(void); } SYS_SIGPROCMASK = 48 // { int sys_sigprocmask(int how, sigset_t mask); } SYS_SETLOGIN = 50 // { int sys_setlogin(const char *namebuf); } SYS_ACCT = 51 // { int sys_acct(const char *path); } SYS_SIGPENDING = 52 // { int sys_sigpending(void); } SYS_FSTAT = 53 // { int sys_fstat(int fd, struct stat *sb); } SYS_IOCTL = 54 // { int sys_ioctl(int fd, u_long com, ... void *data); } SYS_REBOOT = 55 // { int sys_reboot(int opt); } SYS_REVOKE = 56 // { int sys_revoke(const char *path); } SYS_SYMLINK = 57 // { int sys_symlink(const char *path, const char *link); } SYS_READLINK = 58 // { ssize_t sys_readlink(const char *path, char *buf, size_t count); } SYS_EXECVE = 59 // { int sys_execve(const char *path, char * const *argp, char * const *envp); } SYS_UMASK = 60 // { mode_t sys_umask(mode_t newmask); } SYS_CHROOT = 61 // { int sys_chroot(const char *path); } SYS_GETFSSTAT = 62 // { int sys_getfsstat(struct statfs *buf, size_t bufsize, int flags); } SYS_STATFS = 63 // { int sys_statfs(const char *path, struct statfs *buf); } SYS_FSTATFS = 64 // { int sys_fstatfs(int fd, struct statfs *buf); } SYS_FHSTATFS = 65 // { int sys_fhstatfs(const fhandle_t *fhp, struct statfs *buf); } SYS_VFORK = 66 // { int sys_vfork(void); } SYS_GETTIMEOFDAY = 67 // { int sys_gettimeofday(struct timeval *tp, struct timezone *tzp); } SYS_SETTIMEOFDAY = 68 // { int sys_settimeofday(const struct timeval *tv, const struct timezone *tzp); } SYS_SETITIMER = 69 // { int sys_setitimer(int which, const struct itimerval *itv, struct itimerval *oitv); } SYS_GETITIMER = 70 // { int sys_getitimer(int which, struct itimerval *itv); } SYS_SELECT = 71 // { int sys_select(int nd, fd_set *in, fd_set *ou, fd_set *ex, struct timeval *tv); } SYS_KEVENT = 72 // { int sys_kevent(int fd, const struct kevent *changelist, int nchanges, struct kevent *eventlist, int nevents, const struct timespec *timeout); } SYS_MUNMAP = 73 // { int sys_munmap(void *addr, size_t len); } SYS_MPROTECT = 74 // { int sys_mprotect(void *addr, size_t len, int prot); } SYS_MADVISE = 75 // { int sys_madvise(void *addr, size_t len, int behav); } SYS_UTIMES = 76 // { int sys_utimes(const char *path, const struct timeval *tptr); } SYS_FUTIMES = 77 // { int sys_futimes(int fd, const struct timeval *tptr); } SYS_GETGROUPS = 79 // { int sys_getgroups(int gidsetsize, gid_t *gidset); } SYS_SETGROUPS = 80 // { int sys_setgroups(int gidsetsize, const gid_t *gidset); } SYS_GETPGRP = 81 // { int sys_getpgrp(void); } SYS_SETPGID = 82 // { int sys_setpgid(pid_t pid, pid_t pgid); } SYS_FUTEX = 83 // { int sys_futex(uint32_t *f, int op, int val, const struct timespec *timeout, uint32_t *g); } SYS_UTIMENSAT = 84 // { int sys_utimensat(int fd, const char *path, const struct timespec *times, int flag); } SYS_FUTIMENS = 85 // { int sys_futimens(int fd, const struct timespec *times); } SYS_KBIND = 86 // { int sys_kbind(const struct __kbind *param, size_t psize, int64_t proc_cookie); } SYS_CLOCK_GETTIME = 87 // { int sys_clock_gettime(clockid_t clock_id, struct timespec *tp); } SYS_CLOCK_SETTIME = 88 // { int sys_clock_settime(clockid_t clock_id, const struct timespec *tp); } SYS_CLOCK_GETRES = 89 // { int sys_clock_getres(clockid_t clock_id, struct timespec *tp); } SYS_DUP2 = 90 // { int sys_dup2(int from, int to); } SYS_NANOSLEEP = 91 // { int sys_nanosleep(const struct timespec *rqtp, struct timespec *rmtp); } SYS_FCNTL = 92 // { int sys_fcntl(int fd, int cmd, ... void *arg); } SYS_ACCEPT4 = 93 // { int sys_accept4(int s, struct sockaddr *name, socklen_t *anamelen, int flags); } SYS___THRSLEEP = 94 // { int sys___thrsleep(const volatile void *ident, clockid_t clock_id, const struct timespec *tp, void *lock, const int *abort); } SYS_FSYNC = 95 // { int sys_fsync(int fd); } SYS_SETPRIORITY = 96 // { int sys_setpriority(int which, id_t who, int prio); } SYS_SOCKET = 97 // { int sys_socket(int domain, int type, int protocol); } SYS_CONNECT = 98 // { int sys_connect(int s, const struct sockaddr *name, socklen_t namelen); } SYS_GETDENTS = 99 // { int sys_getdents(int fd, void *buf, size_t buflen); } SYS_GETPRIORITY = 100 // { int sys_getpriority(int which, id_t who); } SYS_PIPE2 = 101 // { int sys_pipe2(int *fdp, int flags); } SYS_DUP3 = 102 // { int sys_dup3(int from, int to, int flags); } SYS_SIGRETURN = 103 // { int sys_sigreturn(struct sigcontext *sigcntxp); } SYS_BIND = 104 // { int sys_bind(int s, const struct sockaddr *name, socklen_t namelen); } SYS_SETSOCKOPT = 105 // { int sys_setsockopt(int s, int level, int name, const void *val, socklen_t valsize); } SYS_LISTEN = 106 // { int sys_listen(int s, int backlog); } SYS_CHFLAGSAT = 107 // { int sys_chflagsat(int fd, const char *path, u_int flags, int atflags); } SYS_PLEDGE = 108 // { int sys_pledge(const char *promises, const char *execpromises); } SYS_PPOLL = 109 // { int sys_ppoll(struct pollfd *fds, u_int nfds, const struct timespec *ts, const sigset_t *mask); } SYS_PSELECT = 110 // { int sys_pselect(int nd, fd_set *in, fd_set *ou, fd_set *ex, const struct timespec *ts, const sigset_t *mask); } SYS_SIGSUSPEND = 111 // { int sys_sigsuspend(int mask); } SYS_SENDSYSLOG = 112 // { int sys_sendsyslog(const char *buf, size_t nbyte, int flags); } SYS_UNVEIL = 114 // { int sys_unveil(const char *path, const char *permissions); } SYS_GETSOCKOPT = 118 // { int sys_getsockopt(int s, int level, int name, void *val, socklen_t *avalsize); } SYS_THRKILL = 119 // { int sys_thrkill(pid_t tid, int signum, void *tcb); } SYS_READV = 120 // { ssize_t sys_readv(int fd, const struct iovec *iovp, int iovcnt); } SYS_WRITEV = 121 // { ssize_t sys_writev(int fd, const struct iovec *iovp, int iovcnt); } SYS_KILL = 122 // { int sys_kill(int pid, int signum); } SYS_FCHOWN = 123 // { int sys_fchown(int fd, uid_t uid, gid_t gid); } SYS_FCHMOD = 124 // { int sys_fchmod(int fd, mode_t mode); } SYS_SETREUID = 126 // { int sys_setreuid(uid_t ruid, uid_t euid); } SYS_SETREGID = 127 // { int sys_setregid(gid_t rgid, gid_t egid); } SYS_RENAME = 128 // { int sys_rename(const char *from, const char *to); } SYS_FLOCK = 131 // { int sys_flock(int fd, int how); } SYS_MKFIFO = 132 // { int sys_mkfifo(const char *path, mode_t mode); } SYS_SENDTO = 133 // { ssize_t sys_sendto(int s, const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen); } SYS_SHUTDOWN = 134 // { int sys_shutdown(int s, int how); } SYS_SOCKETPAIR = 135 // { int sys_socketpair(int domain, int type, int protocol, int *rsv); } SYS_MKDIR = 136 // { int sys_mkdir(const char *path, mode_t mode); } SYS_RMDIR = 137 // { int sys_rmdir(const char *path); } SYS_ADJTIME = 140 // { int sys_adjtime(const struct timeval *delta, struct timeval *olddelta); } SYS_GETLOGIN_R = 141 // { int sys_getlogin_r(char *namebuf, u_int namelen); } SYS_SETSID = 147 // { int sys_setsid(void); } SYS_QUOTACTL = 148 // { int sys_quotactl(const char *path, int cmd, int uid, char *arg); } SYS_NFSSVC = 155 // { int sys_nfssvc(int flag, void *argp); } SYS_GETFH = 161 // { int sys_getfh(const char *fname, fhandle_t *fhp); } SYS_SYSARCH = 165 // { int sys_sysarch(int op, void *parms); } SYS_PREAD = 173 // { ssize_t sys_pread(int fd, void *buf, size_t nbyte, int pad, off_t offset); } SYS_PWRITE = 174 // { ssize_t sys_pwrite(int fd, const void *buf, size_t nbyte, int pad, off_t offset); } SYS_SETGID = 181 // { int sys_setgid(gid_t gid); } SYS_SETEGID = 182 // { int sys_setegid(gid_t egid); } SYS_SETEUID = 183 // { int sys_seteuid(uid_t euid); } SYS_PATHCONF = 191 // { long sys_pathconf(const char *path, int name); } SYS_FPATHCONF = 192 // { long sys_fpathconf(int fd, int name); } SYS_SWAPCTL = 193 // { int sys_swapctl(int cmd, const void *arg, int misc); } SYS_GETRLIMIT = 194 // { int sys_getrlimit(int which, struct rlimit *rlp); } SYS_SETRLIMIT = 195 // { int sys_setrlimit(int which, const struct rlimit *rlp); } SYS_MMAP = 197 // { void *sys_mmap(void *addr, size_t len, int prot, int flags, int fd, long pad, off_t pos); } SYS_LSEEK = 199 // { off_t sys_lseek(int fd, int pad, off_t offset, int whence); } SYS_TRUNCATE = 200 // { int sys_truncate(const char *path, int pad, off_t length); } SYS_FTRUNCATE = 201 // { int sys_ftruncate(int fd, int pad, off_t length); } SYS_SYSCTL = 202 // { int sys_sysctl(const int *name, u_int namelen, void *old, size_t *oldlenp, void *new, size_t newlen); } SYS_MLOCK = 203 // { int sys_mlock(const void *addr, size_t len); } SYS_MUNLOCK = 204 // { int sys_munlock(const void *addr, size_t len); } SYS_GETPGID = 207 // { pid_t sys_getpgid(pid_t pid); } SYS_UTRACE = 209 // { int sys_utrace(const char *label, const void *addr, size_t len); } SYS_SEMGET = 221 // { int sys_semget(key_t key, int nsems, int semflg); } SYS_MSGGET = 225 // { int sys_msgget(key_t key, int msgflg); } SYS_MSGSND = 226 // { int sys_msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg); } SYS_MSGRCV = 227 // { int sys_msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg); } SYS_SHMAT = 228 // { void *sys_shmat(int shmid, const void *shmaddr, int shmflg); } SYS_SHMDT = 230 // { int sys_shmdt(const void *shmaddr); } SYS_MINHERIT = 250 // { int sys_minherit(void *addr, size_t len, int inherit); } SYS_POLL = 252 // { int sys_poll(struct pollfd *fds, u_int nfds, int timeout); } SYS_ISSETUGID = 253 // { int sys_issetugid(void); } SYS_LCHOWN = 254 // { int sys_lchown(const char *path, uid_t uid, gid_t gid); } SYS_GETSID = 255 // { pid_t sys_getsid(pid_t pid); } SYS_MSYNC = 256 // { int sys_msync(void *addr, size_t len, int flags); } SYS_PIPE = 263 // { int sys_pipe(int *fdp); } SYS_FHOPEN = 264 // { int sys_fhopen(const fhandle_t *fhp, int flags); } SYS_PREADV = 267 // { ssize_t sys_preadv(int fd, const struct iovec *iovp, int iovcnt, int pad, off_t offset); } SYS_PWRITEV = 268 // { ssize_t sys_pwritev(int fd, const struct iovec *iovp, int iovcnt, int pad, off_t offset); } SYS_KQUEUE = 269 // { int sys_kqueue(void); } SYS_MLOCKALL = 271 // { int sys_mlockall(int flags); } SYS_MUNLOCKALL = 272 // { int sys_munlockall(void); } SYS_GETRESUID = 281 // { int sys_getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); } SYS_SETRESUID = 282 // { int sys_setresuid(uid_t ruid, uid_t euid, uid_t suid); } SYS_GETRESGID = 283 // { int sys_getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); } SYS_SETRESGID = 284 // { int sys_setresgid(gid_t rgid, gid_t egid, gid_t sgid); } SYS_MQUERY = 286 // { void *sys_mquery(void *addr, size_t len, int prot, int flags, int fd, long pad, off_t pos); } SYS_CLOSEFROM = 287 // { int sys_closefrom(int fd); } SYS_SIGALTSTACK = 288 // { int sys_sigaltstack(const struct sigaltstack *nss, struct sigaltstack *oss); } SYS_SHMGET = 289 // { int sys_shmget(key_t key, size_t size, int shmflg); } SYS_SEMOP = 290 // { int sys_semop(int semid, struct sembuf *sops, size_t nsops); } SYS_FHSTAT = 294 // { int sys_fhstat(const fhandle_t *fhp, struct stat *sb); } SYS___SEMCTL = 295 // { int sys___semctl(int semid, int semnum, int cmd, union semun *arg); } SYS_SHMCTL = 296 // { int sys_shmctl(int shmid, int cmd, struct shmid_ds *buf); } SYS_MSGCTL = 297 // { int sys_msgctl(int msqid, int cmd, struct msqid_ds *buf); } SYS_SCHED_YIELD = 298 // { int sys_sched_yield(void); } SYS_GETTHRID = 299 // { pid_t sys_getthrid(void); } SYS___THRWAKEUP = 301 // { int sys___thrwakeup(const volatile void *ident, int n); } SYS___THREXIT = 302 // { void sys___threxit(pid_t *notdead); } SYS___THRSIGDIVERT = 303 // { int sys___thrsigdivert(sigset_t sigmask, siginfo_t *info, const struct timespec *timeout); } SYS___GETCWD = 304 // { int sys___getcwd(char *buf, size_t len); } SYS_ADJFREQ = 305 // { int sys_adjfreq(const int64_t *freq, int64_t *oldfreq); } SYS_SETRTABLE = 310 // { int sys_setrtable(int rtableid); } SYS_GETRTABLE = 311 // { int sys_getrtable(void); } SYS_FACCESSAT = 313 // { int sys_faccessat(int fd, const char *path, int amode, int flag); } SYS_FCHMODAT = 314 // { int sys_fchmodat(int fd, const char *path, mode_t mode, int flag); } SYS_FCHOWNAT = 315 // { int sys_fchownat(int fd, const char *path, uid_t uid, gid_t gid, int flag); } SYS_LINKAT = 317 // { int sys_linkat(int fd1, const char *path1, int fd2, const char *path2, int flag); } SYS_MKDIRAT = 318 // { int sys_mkdirat(int fd, const char *path, mode_t mode); } SYS_MKFIFOAT = 319 // { int sys_mkfifoat(int fd, const char *path, mode_t mode); } SYS_MKNODAT = 320 // { int sys_mknodat(int fd, const char *path, mode_t mode, dev_t dev); } SYS_OPENAT = 321 // { int sys_openat(int fd, const char *path, int flags, ... mode_t mode); } SYS_READLINKAT = 322 // { ssize_t sys_readlinkat(int fd, const char *path, char *buf, size_t count); } SYS_RENAMEAT = 323 // { int sys_renameat(int fromfd, const char *from, int tofd, const char *to); } SYS_SYMLINKAT = 324 // { int sys_symlinkat(const char *path, int fd, const char *link); } SYS_UNLINKAT = 325 // { int sys_unlinkat(int fd, const char *path, int flag); } SYS___SET_TCB = 329 // { void sys___set_tcb(void *tcb); } SYS___GET_TCB = 330 // { void *sys___get_tcb(void); } ) ================================================ FILE: vendor/golang.org/x/sys/unix/zsysnum_openbsd_mips64.go ================================================ // go run mksysnum.go https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master // Code generated by the command above; see README.md. DO NOT EDIT. //go:build mips64 && openbsd package unix // Deprecated: Use libc wrappers instead of direct syscalls. const ( SYS_EXIT = 1 // { void sys_exit(int rval); } SYS_FORK = 2 // { int sys_fork(void); } SYS_READ = 3 // { ssize_t sys_read(int fd, void *buf, size_t nbyte); } SYS_WRITE = 4 // { ssize_t sys_write(int fd, const void *buf, size_t nbyte); } SYS_OPEN = 5 // { int sys_open(const char *path, int flags, ... mode_t mode); } SYS_CLOSE = 6 // { int sys_close(int fd); } SYS_GETENTROPY = 7 // { int sys_getentropy(void *buf, size_t nbyte); } SYS___TFORK = 8 // { int sys___tfork(const struct __tfork *param, size_t psize); } SYS_LINK = 9 // { int sys_link(const char *path, const char *link); } SYS_UNLINK = 10 // { int sys_unlink(const char *path); } SYS_WAIT4 = 11 // { pid_t sys_wait4(pid_t pid, int *status, int options, struct rusage *rusage); } SYS_CHDIR = 12 // { int sys_chdir(const char *path); } SYS_FCHDIR = 13 // { int sys_fchdir(int fd); } SYS_MKNOD = 14 // { int sys_mknod(const char *path, mode_t mode, dev_t dev); } SYS_CHMOD = 15 // { int sys_chmod(const char *path, mode_t mode); } SYS_CHOWN = 16 // { int sys_chown(const char *path, uid_t uid, gid_t gid); } SYS_OBREAK = 17 // { int sys_obreak(char *nsize); } break SYS_GETDTABLECOUNT = 18 // { int sys_getdtablecount(void); } SYS_GETRUSAGE = 19 // { int sys_getrusage(int who, struct rusage *rusage); } SYS_GETPID = 20 // { pid_t sys_getpid(void); } SYS_MOUNT = 21 // { int sys_mount(const char *type, const char *path, int flags, void *data); } SYS_UNMOUNT = 22 // { int sys_unmount(const char *path, int flags); } SYS_SETUID = 23 // { int sys_setuid(uid_t uid); } SYS_GETUID = 24 // { uid_t sys_getuid(void); } SYS_GETEUID = 25 // { uid_t sys_geteuid(void); } SYS_PTRACE = 26 // { int sys_ptrace(int req, pid_t pid, caddr_t addr, int data); } SYS_RECVMSG = 27 // { ssize_t sys_recvmsg(int s, struct msghdr *msg, int flags); } SYS_SENDMSG = 28 // { ssize_t sys_sendmsg(int s, const struct msghdr *msg, int flags); } SYS_RECVFROM = 29 // { ssize_t sys_recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlenaddr); } SYS_ACCEPT = 30 // { int sys_accept(int s, struct sockaddr *name, socklen_t *anamelen); } SYS_GETPEERNAME = 31 // { int sys_getpeername(int fdes, struct sockaddr *asa, socklen_t *alen); } SYS_GETSOCKNAME = 32 // { int sys_getsockname(int fdes, struct sockaddr *asa, socklen_t *alen); } SYS_ACCESS = 33 // { int sys_access(const char *path, int amode); } SYS_CHFLAGS = 34 // { int sys_chflags(const char *path, u_int flags); } SYS_FCHFLAGS = 35 // { int sys_fchflags(int fd, u_int flags); } SYS_SYNC = 36 // { void sys_sync(void); } SYS_MSYSCALL = 37 // { int sys_msyscall(void *addr, size_t len); } SYS_STAT = 38 // { int sys_stat(const char *path, struct stat *ub); } SYS_GETPPID = 39 // { pid_t sys_getppid(void); } SYS_LSTAT = 40 // { int sys_lstat(const char *path, struct stat *ub); } SYS_DUP = 41 // { int sys_dup(int fd); } SYS_FSTATAT = 42 // { int sys_fstatat(int fd, const char *path, struct stat *buf, int flag); } SYS_GETEGID = 43 // { gid_t sys_getegid(void); } SYS_PROFIL = 44 // { int sys_profil(caddr_t samples, size_t size, u_long offset, u_int scale); } SYS_KTRACE = 45 // { int sys_ktrace(const char *fname, int ops, int facs, pid_t pid); } SYS_SIGACTION = 46 // { int sys_sigaction(int signum, const struct sigaction *nsa, struct sigaction *osa); } SYS_GETGID = 47 // { gid_t sys_getgid(void); } SYS_SIGPROCMASK = 48 // { int sys_sigprocmask(int how, sigset_t mask); } SYS_SETLOGIN = 50 // { int sys_setlogin(const char *namebuf); } SYS_ACCT = 51 // { int sys_acct(const char *path); } SYS_SIGPENDING = 52 // { int sys_sigpending(void); } SYS_FSTAT = 53 // { int sys_fstat(int fd, struct stat *sb); } SYS_IOCTL = 54 // { int sys_ioctl(int fd, u_long com, ... void *data); } SYS_REBOOT = 55 // { int sys_reboot(int opt); } SYS_REVOKE = 56 // { int sys_revoke(const char *path); } SYS_SYMLINK = 57 // { int sys_symlink(const char *path, const char *link); } SYS_READLINK = 58 // { ssize_t sys_readlink(const char *path, char *buf, size_t count); } SYS_EXECVE = 59 // { int sys_execve(const char *path, char * const *argp, char * const *envp); } SYS_UMASK = 60 // { mode_t sys_umask(mode_t newmask); } SYS_CHROOT = 61 // { int sys_chroot(const char *path); } SYS_GETFSSTAT = 62 // { int sys_getfsstat(struct statfs *buf, size_t bufsize, int flags); } SYS_STATFS = 63 // { int sys_statfs(const char *path, struct statfs *buf); } SYS_FSTATFS = 64 // { int sys_fstatfs(int fd, struct statfs *buf); } SYS_FHSTATFS = 65 // { int sys_fhstatfs(const fhandle_t *fhp, struct statfs *buf); } SYS_VFORK = 66 // { int sys_vfork(void); } SYS_GETTIMEOFDAY = 67 // { int sys_gettimeofday(struct timeval *tp, struct timezone *tzp); } SYS_SETTIMEOFDAY = 68 // { int sys_settimeofday(const struct timeval *tv, const struct timezone *tzp); } SYS_SETITIMER = 69 // { int sys_setitimer(int which, const struct itimerval *itv, struct itimerval *oitv); } SYS_GETITIMER = 70 // { int sys_getitimer(int which, struct itimerval *itv); } SYS_SELECT = 71 // { int sys_select(int nd, fd_set *in, fd_set *ou, fd_set *ex, struct timeval *tv); } SYS_KEVENT = 72 // { int sys_kevent(int fd, const struct kevent *changelist, int nchanges, struct kevent *eventlist, int nevents, const struct timespec *timeout); } SYS_MUNMAP = 73 // { int sys_munmap(void *addr, size_t len); } SYS_MPROTECT = 74 // { int sys_mprotect(void *addr, size_t len, int prot); } SYS_MADVISE = 75 // { int sys_madvise(void *addr, size_t len, int behav); } SYS_UTIMES = 76 // { int sys_utimes(const char *path, const struct timeval *tptr); } SYS_FUTIMES = 77 // { int sys_futimes(int fd, const struct timeval *tptr); } SYS_GETGROUPS = 79 // { int sys_getgroups(int gidsetsize, gid_t *gidset); } SYS_SETGROUPS = 80 // { int sys_setgroups(int gidsetsize, const gid_t *gidset); } SYS_GETPGRP = 81 // { int sys_getpgrp(void); } SYS_SETPGID = 82 // { int sys_setpgid(pid_t pid, pid_t pgid); } SYS_FUTEX = 83 // { int sys_futex(uint32_t *f, int op, int val, const struct timespec *timeout, uint32_t *g); } SYS_UTIMENSAT = 84 // { int sys_utimensat(int fd, const char *path, const struct timespec *times, int flag); } SYS_FUTIMENS = 85 // { int sys_futimens(int fd, const struct timespec *times); } SYS_KBIND = 86 // { int sys_kbind(const struct __kbind *param, size_t psize, int64_t proc_cookie); } SYS_CLOCK_GETTIME = 87 // { int sys_clock_gettime(clockid_t clock_id, struct timespec *tp); } SYS_CLOCK_SETTIME = 88 // { int sys_clock_settime(clockid_t clock_id, const struct timespec *tp); } SYS_CLOCK_GETRES = 89 // { int sys_clock_getres(clockid_t clock_id, struct timespec *tp); } SYS_DUP2 = 90 // { int sys_dup2(int from, int to); } SYS_NANOSLEEP = 91 // { int sys_nanosleep(const struct timespec *rqtp, struct timespec *rmtp); } SYS_FCNTL = 92 // { int sys_fcntl(int fd, int cmd, ... void *arg); } SYS_ACCEPT4 = 93 // { int sys_accept4(int s, struct sockaddr *name, socklen_t *anamelen, int flags); } SYS___THRSLEEP = 94 // { int sys___thrsleep(const volatile void *ident, clockid_t clock_id, const struct timespec *tp, void *lock, const int *abort); } SYS_FSYNC = 95 // { int sys_fsync(int fd); } SYS_SETPRIORITY = 96 // { int sys_setpriority(int which, id_t who, int prio); } SYS_SOCKET = 97 // { int sys_socket(int domain, int type, int protocol); } SYS_CONNECT = 98 // { int sys_connect(int s, const struct sockaddr *name, socklen_t namelen); } SYS_GETDENTS = 99 // { int sys_getdents(int fd, void *buf, size_t buflen); } SYS_GETPRIORITY = 100 // { int sys_getpriority(int which, id_t who); } SYS_PIPE2 = 101 // { int sys_pipe2(int *fdp, int flags); } SYS_DUP3 = 102 // { int sys_dup3(int from, int to, int flags); } SYS_SIGRETURN = 103 // { int sys_sigreturn(struct sigcontext *sigcntxp); } SYS_BIND = 104 // { int sys_bind(int s, const struct sockaddr *name, socklen_t namelen); } SYS_SETSOCKOPT = 105 // { int sys_setsockopt(int s, int level, int name, const void *val, socklen_t valsize); } SYS_LISTEN = 106 // { int sys_listen(int s, int backlog); } SYS_CHFLAGSAT = 107 // { int sys_chflagsat(int fd, const char *path, u_int flags, int atflags); } SYS_PLEDGE = 108 // { int sys_pledge(const char *promises, const char *execpromises); } SYS_PPOLL = 109 // { int sys_ppoll(struct pollfd *fds, u_int nfds, const struct timespec *ts, const sigset_t *mask); } SYS_PSELECT = 110 // { int sys_pselect(int nd, fd_set *in, fd_set *ou, fd_set *ex, const struct timespec *ts, const sigset_t *mask); } SYS_SIGSUSPEND = 111 // { int sys_sigsuspend(int mask); } SYS_SENDSYSLOG = 112 // { int sys_sendsyslog(const char *buf, size_t nbyte, int flags); } SYS_UNVEIL = 114 // { int sys_unveil(const char *path, const char *permissions); } SYS___REALPATH = 115 // { int sys___realpath(const char *pathname, char *resolved); } SYS_GETSOCKOPT = 118 // { int sys_getsockopt(int s, int level, int name, void *val, socklen_t *avalsize); } SYS_THRKILL = 119 // { int sys_thrkill(pid_t tid, int signum, void *tcb); } SYS_READV = 120 // { ssize_t sys_readv(int fd, const struct iovec *iovp, int iovcnt); } SYS_WRITEV = 121 // { ssize_t sys_writev(int fd, const struct iovec *iovp, int iovcnt); } SYS_KILL = 122 // { int sys_kill(int pid, int signum); } SYS_FCHOWN = 123 // { int sys_fchown(int fd, uid_t uid, gid_t gid); } SYS_FCHMOD = 124 // { int sys_fchmod(int fd, mode_t mode); } SYS_SETREUID = 126 // { int sys_setreuid(uid_t ruid, uid_t euid); } SYS_SETREGID = 127 // { int sys_setregid(gid_t rgid, gid_t egid); } SYS_RENAME = 128 // { int sys_rename(const char *from, const char *to); } SYS_FLOCK = 131 // { int sys_flock(int fd, int how); } SYS_MKFIFO = 132 // { int sys_mkfifo(const char *path, mode_t mode); } SYS_SENDTO = 133 // { ssize_t sys_sendto(int s, const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen); } SYS_SHUTDOWN = 134 // { int sys_shutdown(int s, int how); } SYS_SOCKETPAIR = 135 // { int sys_socketpair(int domain, int type, int protocol, int *rsv); } SYS_MKDIR = 136 // { int sys_mkdir(const char *path, mode_t mode); } SYS_RMDIR = 137 // { int sys_rmdir(const char *path); } SYS_ADJTIME = 140 // { int sys_adjtime(const struct timeval *delta, struct timeval *olddelta); } SYS_GETLOGIN_R = 141 // { int sys_getlogin_r(char *namebuf, u_int namelen); } SYS_SETSID = 147 // { int sys_setsid(void); } SYS_QUOTACTL = 148 // { int sys_quotactl(const char *path, int cmd, int uid, char *arg); } SYS_NFSSVC = 155 // { int sys_nfssvc(int flag, void *argp); } SYS_GETFH = 161 // { int sys_getfh(const char *fname, fhandle_t *fhp); } SYS___TMPFD = 164 // { int sys___tmpfd(int flags); } SYS_SYSARCH = 165 // { int sys_sysarch(int op, void *parms); } SYS_PREAD = 173 // { ssize_t sys_pread(int fd, void *buf, size_t nbyte, int pad, off_t offset); } SYS_PWRITE = 174 // { ssize_t sys_pwrite(int fd, const void *buf, size_t nbyte, int pad, off_t offset); } SYS_SETGID = 181 // { int sys_setgid(gid_t gid); } SYS_SETEGID = 182 // { int sys_setegid(gid_t egid); } SYS_SETEUID = 183 // { int sys_seteuid(uid_t euid); } SYS_PATHCONF = 191 // { long sys_pathconf(const char *path, int name); } SYS_FPATHCONF = 192 // { long sys_fpathconf(int fd, int name); } SYS_SWAPCTL = 193 // { int sys_swapctl(int cmd, const void *arg, int misc); } SYS_GETRLIMIT = 194 // { int sys_getrlimit(int which, struct rlimit *rlp); } SYS_SETRLIMIT = 195 // { int sys_setrlimit(int which, const struct rlimit *rlp); } SYS_MMAP = 197 // { void *sys_mmap(void *addr, size_t len, int prot, int flags, int fd, long pad, off_t pos); } SYS_LSEEK = 199 // { off_t sys_lseek(int fd, int pad, off_t offset, int whence); } SYS_TRUNCATE = 200 // { int sys_truncate(const char *path, int pad, off_t length); } SYS_FTRUNCATE = 201 // { int sys_ftruncate(int fd, int pad, off_t length); } SYS_SYSCTL = 202 // { int sys_sysctl(const int *name, u_int namelen, void *old, size_t *oldlenp, void *new, size_t newlen); } SYS_MLOCK = 203 // { int sys_mlock(const void *addr, size_t len); } SYS_MUNLOCK = 204 // { int sys_munlock(const void *addr, size_t len); } SYS_GETPGID = 207 // { pid_t sys_getpgid(pid_t pid); } SYS_UTRACE = 209 // { int sys_utrace(const char *label, const void *addr, size_t len); } SYS_SEMGET = 221 // { int sys_semget(key_t key, int nsems, int semflg); } SYS_MSGGET = 225 // { int sys_msgget(key_t key, int msgflg); } SYS_MSGSND = 226 // { int sys_msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg); } SYS_MSGRCV = 227 // { int sys_msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg); } SYS_SHMAT = 228 // { void *sys_shmat(int shmid, const void *shmaddr, int shmflg); } SYS_SHMDT = 230 // { int sys_shmdt(const void *shmaddr); } SYS_MINHERIT = 250 // { int sys_minherit(void *addr, size_t len, int inherit); } SYS_POLL = 252 // { int sys_poll(struct pollfd *fds, u_int nfds, int timeout); } SYS_ISSETUGID = 253 // { int sys_issetugid(void); } SYS_LCHOWN = 254 // { int sys_lchown(const char *path, uid_t uid, gid_t gid); } SYS_GETSID = 255 // { pid_t sys_getsid(pid_t pid); } SYS_MSYNC = 256 // { int sys_msync(void *addr, size_t len, int flags); } SYS_PIPE = 263 // { int sys_pipe(int *fdp); } SYS_FHOPEN = 264 // { int sys_fhopen(const fhandle_t *fhp, int flags); } SYS_PREADV = 267 // { ssize_t sys_preadv(int fd, const struct iovec *iovp, int iovcnt, int pad, off_t offset); } SYS_PWRITEV = 268 // { ssize_t sys_pwritev(int fd, const struct iovec *iovp, int iovcnt, int pad, off_t offset); } SYS_KQUEUE = 269 // { int sys_kqueue(void); } SYS_MLOCKALL = 271 // { int sys_mlockall(int flags); } SYS_MUNLOCKALL = 272 // { int sys_munlockall(void); } SYS_GETRESUID = 281 // { int sys_getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); } SYS_SETRESUID = 282 // { int sys_setresuid(uid_t ruid, uid_t euid, uid_t suid); } SYS_GETRESGID = 283 // { int sys_getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); } SYS_SETRESGID = 284 // { int sys_setresgid(gid_t rgid, gid_t egid, gid_t sgid); } SYS_MQUERY = 286 // { void *sys_mquery(void *addr, size_t len, int prot, int flags, int fd, long pad, off_t pos); } SYS_CLOSEFROM = 287 // { int sys_closefrom(int fd); } SYS_SIGALTSTACK = 288 // { int sys_sigaltstack(const struct sigaltstack *nss, struct sigaltstack *oss); } SYS_SHMGET = 289 // { int sys_shmget(key_t key, size_t size, int shmflg); } SYS_SEMOP = 290 // { int sys_semop(int semid, struct sembuf *sops, size_t nsops); } SYS_FHSTAT = 294 // { int sys_fhstat(const fhandle_t *fhp, struct stat *sb); } SYS___SEMCTL = 295 // { int sys___semctl(int semid, int semnum, int cmd, union semun *arg); } SYS_SHMCTL = 296 // { int sys_shmctl(int shmid, int cmd, struct shmid_ds *buf); } SYS_MSGCTL = 297 // { int sys_msgctl(int msqid, int cmd, struct msqid_ds *buf); } SYS_SCHED_YIELD = 298 // { int sys_sched_yield(void); } SYS_GETTHRID = 299 // { pid_t sys_getthrid(void); } SYS___THRWAKEUP = 301 // { int sys___thrwakeup(const volatile void *ident, int n); } SYS___THREXIT = 302 // { void sys___threxit(pid_t *notdead); } SYS___THRSIGDIVERT = 303 // { int sys___thrsigdivert(sigset_t sigmask, siginfo_t *info, const struct timespec *timeout); } SYS___GETCWD = 304 // { int sys___getcwd(char *buf, size_t len); } SYS_ADJFREQ = 305 // { int sys_adjfreq(const int64_t *freq, int64_t *oldfreq); } SYS_SETRTABLE = 310 // { int sys_setrtable(int rtableid); } SYS_GETRTABLE = 311 // { int sys_getrtable(void); } SYS_FACCESSAT = 313 // { int sys_faccessat(int fd, const char *path, int amode, int flag); } SYS_FCHMODAT = 314 // { int sys_fchmodat(int fd, const char *path, mode_t mode, int flag); } SYS_FCHOWNAT = 315 // { int sys_fchownat(int fd, const char *path, uid_t uid, gid_t gid, int flag); } SYS_LINKAT = 317 // { int sys_linkat(int fd1, const char *path1, int fd2, const char *path2, int flag); } SYS_MKDIRAT = 318 // { int sys_mkdirat(int fd, const char *path, mode_t mode); } SYS_MKFIFOAT = 319 // { int sys_mkfifoat(int fd, const char *path, mode_t mode); } SYS_MKNODAT = 320 // { int sys_mknodat(int fd, const char *path, mode_t mode, dev_t dev); } SYS_OPENAT = 321 // { int sys_openat(int fd, const char *path, int flags, ... mode_t mode); } SYS_READLINKAT = 322 // { ssize_t sys_readlinkat(int fd, const char *path, char *buf, size_t count); } SYS_RENAMEAT = 323 // { int sys_renameat(int fromfd, const char *from, int tofd, const char *to); } SYS_SYMLINKAT = 324 // { int sys_symlinkat(const char *path, int fd, const char *link); } SYS_UNLINKAT = 325 // { int sys_unlinkat(int fd, const char *path, int flag); } SYS___SET_TCB = 329 // { void sys___set_tcb(void *tcb); } SYS___GET_TCB = 330 // { void *sys___get_tcb(void); } ) ================================================ FILE: vendor/golang.org/x/sys/unix/zsysnum_openbsd_ppc64.go ================================================ // go run mksysnum.go https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master // Code generated by the command above; see README.md. DO NOT EDIT. //go:build ppc64 && openbsd package unix const ( SYS_EXIT = 1 // { void sys_exit(int rval); } SYS_FORK = 2 // { int sys_fork(void); } SYS_READ = 3 // { ssize_t sys_read(int fd, void *buf, size_t nbyte); } SYS_WRITE = 4 // { ssize_t sys_write(int fd, const void *buf, size_t nbyte); } SYS_OPEN = 5 // { int sys_open(const char *path, int flags, ... mode_t mode); } SYS_CLOSE = 6 // { int sys_close(int fd); } SYS_GETENTROPY = 7 // { int sys_getentropy(void *buf, size_t nbyte); } SYS___TFORK = 8 // { int sys___tfork(const struct __tfork *param, size_t psize); } SYS_LINK = 9 // { int sys_link(const char *path, const char *link); } SYS_UNLINK = 10 // { int sys_unlink(const char *path); } SYS_WAIT4 = 11 // { pid_t sys_wait4(pid_t pid, int *status, int options, struct rusage *rusage); } SYS_CHDIR = 12 // { int sys_chdir(const char *path); } SYS_FCHDIR = 13 // { int sys_fchdir(int fd); } SYS_MKNOD = 14 // { int sys_mknod(const char *path, mode_t mode, dev_t dev); } SYS_CHMOD = 15 // { int sys_chmod(const char *path, mode_t mode); } SYS_CHOWN = 16 // { int sys_chown(const char *path, uid_t uid, gid_t gid); } SYS_OBREAK = 17 // { int sys_obreak(char *nsize); } break SYS_GETDTABLECOUNT = 18 // { int sys_getdtablecount(void); } SYS_GETRUSAGE = 19 // { int sys_getrusage(int who, struct rusage *rusage); } SYS_GETPID = 20 // { pid_t sys_getpid(void); } SYS_MOUNT = 21 // { int sys_mount(const char *type, const char *path, int flags, void *data); } SYS_UNMOUNT = 22 // { int sys_unmount(const char *path, int flags); } SYS_SETUID = 23 // { int sys_setuid(uid_t uid); } SYS_GETUID = 24 // { uid_t sys_getuid(void); } SYS_GETEUID = 25 // { uid_t sys_geteuid(void); } SYS_PTRACE = 26 // { int sys_ptrace(int req, pid_t pid, caddr_t addr, int data); } SYS_RECVMSG = 27 // { ssize_t sys_recvmsg(int s, struct msghdr *msg, int flags); } SYS_SENDMSG = 28 // { ssize_t sys_sendmsg(int s, const struct msghdr *msg, int flags); } SYS_RECVFROM = 29 // { ssize_t sys_recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlenaddr); } SYS_ACCEPT = 30 // { int sys_accept(int s, struct sockaddr *name, socklen_t *anamelen); } SYS_GETPEERNAME = 31 // { int sys_getpeername(int fdes, struct sockaddr *asa, socklen_t *alen); } SYS_GETSOCKNAME = 32 // { int sys_getsockname(int fdes, struct sockaddr *asa, socklen_t *alen); } SYS_ACCESS = 33 // { int sys_access(const char *path, int amode); } SYS_CHFLAGS = 34 // { int sys_chflags(const char *path, u_int flags); } SYS_FCHFLAGS = 35 // { int sys_fchflags(int fd, u_int flags); } SYS_SYNC = 36 // { void sys_sync(void); } SYS_STAT = 38 // { int sys_stat(const char *path, struct stat *ub); } SYS_GETPPID = 39 // { pid_t sys_getppid(void); } SYS_LSTAT = 40 // { int sys_lstat(const char *path, struct stat *ub); } SYS_DUP = 41 // { int sys_dup(int fd); } SYS_FSTATAT = 42 // { int sys_fstatat(int fd, const char *path, struct stat *buf, int flag); } SYS_GETEGID = 43 // { gid_t sys_getegid(void); } SYS_PROFIL = 44 // { int sys_profil(caddr_t samples, size_t size, u_long offset, u_int scale); } SYS_KTRACE = 45 // { int sys_ktrace(const char *fname, int ops, int facs, pid_t pid); } SYS_SIGACTION = 46 // { int sys_sigaction(int signum, const struct sigaction *nsa, struct sigaction *osa); } SYS_GETGID = 47 // { gid_t sys_getgid(void); } SYS_SIGPROCMASK = 48 // { int sys_sigprocmask(int how, sigset_t mask); } SYS_SETLOGIN = 50 // { int sys_setlogin(const char *namebuf); } SYS_ACCT = 51 // { int sys_acct(const char *path); } SYS_SIGPENDING = 52 // { int sys_sigpending(void); } SYS_FSTAT = 53 // { int sys_fstat(int fd, struct stat *sb); } SYS_IOCTL = 54 // { int sys_ioctl(int fd, u_long com, ... void *data); } SYS_REBOOT = 55 // { int sys_reboot(int opt); } SYS_REVOKE = 56 // { int sys_revoke(const char *path); } SYS_SYMLINK = 57 // { int sys_symlink(const char *path, const char *link); } SYS_READLINK = 58 // { ssize_t sys_readlink(const char *path, char *buf, size_t count); } SYS_EXECVE = 59 // { int sys_execve(const char *path, char * const *argp, char * const *envp); } SYS_UMASK = 60 // { mode_t sys_umask(mode_t newmask); } SYS_CHROOT = 61 // { int sys_chroot(const char *path); } SYS_GETFSSTAT = 62 // { int sys_getfsstat(struct statfs *buf, size_t bufsize, int flags); } SYS_STATFS = 63 // { int sys_statfs(const char *path, struct statfs *buf); } SYS_FSTATFS = 64 // { int sys_fstatfs(int fd, struct statfs *buf); } SYS_FHSTATFS = 65 // { int sys_fhstatfs(const fhandle_t *fhp, struct statfs *buf); } SYS_VFORK = 66 // { int sys_vfork(void); } SYS_GETTIMEOFDAY = 67 // { int sys_gettimeofday(struct timeval *tp, struct timezone *tzp); } SYS_SETTIMEOFDAY = 68 // { int sys_settimeofday(const struct timeval *tv, const struct timezone *tzp); } SYS_SETITIMER = 69 // { int sys_setitimer(int which, const struct itimerval *itv, struct itimerval *oitv); } SYS_GETITIMER = 70 // { int sys_getitimer(int which, struct itimerval *itv); } SYS_SELECT = 71 // { int sys_select(int nd, fd_set *in, fd_set *ou, fd_set *ex, struct timeval *tv); } SYS_KEVENT = 72 // { int sys_kevent(int fd, const struct kevent *changelist, int nchanges, struct kevent *eventlist, int nevents, const struct timespec *timeout); } SYS_MUNMAP = 73 // { int sys_munmap(void *addr, size_t len); } SYS_MPROTECT = 74 // { int sys_mprotect(void *addr, size_t len, int prot); } SYS_MADVISE = 75 // { int sys_madvise(void *addr, size_t len, int behav); } SYS_UTIMES = 76 // { int sys_utimes(const char *path, const struct timeval *tptr); } SYS_FUTIMES = 77 // { int sys_futimes(int fd, const struct timeval *tptr); } SYS_GETGROUPS = 79 // { int sys_getgroups(int gidsetsize, gid_t *gidset); } SYS_SETGROUPS = 80 // { int sys_setgroups(int gidsetsize, const gid_t *gidset); } SYS_GETPGRP = 81 // { int sys_getpgrp(void); } SYS_SETPGID = 82 // { int sys_setpgid(pid_t pid, pid_t pgid); } SYS_FUTEX = 83 // { int sys_futex(uint32_t *f, int op, int val, const struct timespec *timeout, uint32_t *g); } SYS_UTIMENSAT = 84 // { int sys_utimensat(int fd, const char *path, const struct timespec *times, int flag); } SYS_FUTIMENS = 85 // { int sys_futimens(int fd, const struct timespec *times); } SYS_KBIND = 86 // { int sys_kbind(const struct __kbind *param, size_t psize, int64_t proc_cookie); } SYS_CLOCK_GETTIME = 87 // { int sys_clock_gettime(clockid_t clock_id, struct timespec *tp); } SYS_CLOCK_SETTIME = 88 // { int sys_clock_settime(clockid_t clock_id, const struct timespec *tp); } SYS_CLOCK_GETRES = 89 // { int sys_clock_getres(clockid_t clock_id, struct timespec *tp); } SYS_DUP2 = 90 // { int sys_dup2(int from, int to); } SYS_NANOSLEEP = 91 // { int sys_nanosleep(const struct timespec *rqtp, struct timespec *rmtp); } SYS_FCNTL = 92 // { int sys_fcntl(int fd, int cmd, ... void *arg); } SYS_ACCEPT4 = 93 // { int sys_accept4(int s, struct sockaddr *name, socklen_t *anamelen, int flags); } SYS___THRSLEEP = 94 // { int sys___thrsleep(const volatile void *ident, clockid_t clock_id, const struct timespec *tp, void *lock, const int *abort); } SYS_FSYNC = 95 // { int sys_fsync(int fd); } SYS_SETPRIORITY = 96 // { int sys_setpriority(int which, id_t who, int prio); } SYS_SOCKET = 97 // { int sys_socket(int domain, int type, int protocol); } SYS_CONNECT = 98 // { int sys_connect(int s, const struct sockaddr *name, socklen_t namelen); } SYS_GETDENTS = 99 // { int sys_getdents(int fd, void *buf, size_t buflen); } SYS_GETPRIORITY = 100 // { int sys_getpriority(int which, id_t who); } SYS_PIPE2 = 101 // { int sys_pipe2(int *fdp, int flags); } SYS_DUP3 = 102 // { int sys_dup3(int from, int to, int flags); } SYS_SIGRETURN = 103 // { int sys_sigreturn(struct sigcontext *sigcntxp); } SYS_BIND = 104 // { int sys_bind(int s, const struct sockaddr *name, socklen_t namelen); } SYS_SETSOCKOPT = 105 // { int sys_setsockopt(int s, int level, int name, const void *val, socklen_t valsize); } SYS_LISTEN = 106 // { int sys_listen(int s, int backlog); } SYS_CHFLAGSAT = 107 // { int sys_chflagsat(int fd, const char *path, u_int flags, int atflags); } SYS_PLEDGE = 108 // { int sys_pledge(const char *promises, const char *execpromises); } SYS_PPOLL = 109 // { int sys_ppoll(struct pollfd *fds, u_int nfds, const struct timespec *ts, const sigset_t *mask); } SYS_PSELECT = 110 // { int sys_pselect(int nd, fd_set *in, fd_set *ou, fd_set *ex, const struct timespec *ts, const sigset_t *mask); } SYS_SIGSUSPEND = 111 // { int sys_sigsuspend(int mask); } SYS_SENDSYSLOG = 112 // { int sys_sendsyslog(const char *buf, size_t nbyte, int flags); } SYS_UNVEIL = 114 // { int sys_unveil(const char *path, const char *permissions); } SYS_GETSOCKOPT = 118 // { int sys_getsockopt(int s, int level, int name, void *val, socklen_t *avalsize); } SYS_THRKILL = 119 // { int sys_thrkill(pid_t tid, int signum, void *tcb); } SYS_READV = 120 // { ssize_t sys_readv(int fd, const struct iovec *iovp, int iovcnt); } SYS_WRITEV = 121 // { ssize_t sys_writev(int fd, const struct iovec *iovp, int iovcnt); } SYS_KILL = 122 // { int sys_kill(int pid, int signum); } SYS_FCHOWN = 123 // { int sys_fchown(int fd, uid_t uid, gid_t gid); } SYS_FCHMOD = 124 // { int sys_fchmod(int fd, mode_t mode); } SYS_SETREUID = 126 // { int sys_setreuid(uid_t ruid, uid_t euid); } SYS_SETREGID = 127 // { int sys_setregid(gid_t rgid, gid_t egid); } SYS_RENAME = 128 // { int sys_rename(const char *from, const char *to); } SYS_FLOCK = 131 // { int sys_flock(int fd, int how); } SYS_MKFIFO = 132 // { int sys_mkfifo(const char *path, mode_t mode); } SYS_SENDTO = 133 // { ssize_t sys_sendto(int s, const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen); } SYS_SHUTDOWN = 134 // { int sys_shutdown(int s, int how); } SYS_SOCKETPAIR = 135 // { int sys_socketpair(int domain, int type, int protocol, int *rsv); } SYS_MKDIR = 136 // { int sys_mkdir(const char *path, mode_t mode); } SYS_RMDIR = 137 // { int sys_rmdir(const char *path); } SYS_ADJTIME = 140 // { int sys_adjtime(const struct timeval *delta, struct timeval *olddelta); } SYS_GETLOGIN_R = 141 // { int sys_getlogin_r(char *namebuf, u_int namelen); } SYS_SETSID = 147 // { int sys_setsid(void); } SYS_QUOTACTL = 148 // { int sys_quotactl(const char *path, int cmd, int uid, char *arg); } SYS_NFSSVC = 155 // { int sys_nfssvc(int flag, void *argp); } SYS_GETFH = 161 // { int sys_getfh(const char *fname, fhandle_t *fhp); } SYS_SYSARCH = 165 // { int sys_sysarch(int op, void *parms); } SYS_PREAD = 173 // { ssize_t sys_pread(int fd, void *buf, size_t nbyte, int pad, off_t offset); } SYS_PWRITE = 174 // { ssize_t sys_pwrite(int fd, const void *buf, size_t nbyte, int pad, off_t offset); } SYS_SETGID = 181 // { int sys_setgid(gid_t gid); } SYS_SETEGID = 182 // { int sys_setegid(gid_t egid); } SYS_SETEUID = 183 // { int sys_seteuid(uid_t euid); } SYS_PATHCONF = 191 // { long sys_pathconf(const char *path, int name); } SYS_FPATHCONF = 192 // { long sys_fpathconf(int fd, int name); } SYS_SWAPCTL = 193 // { int sys_swapctl(int cmd, const void *arg, int misc); } SYS_GETRLIMIT = 194 // { int sys_getrlimit(int which, struct rlimit *rlp); } SYS_SETRLIMIT = 195 // { int sys_setrlimit(int which, const struct rlimit *rlp); } SYS_MMAP = 197 // { void *sys_mmap(void *addr, size_t len, int prot, int flags, int fd, long pad, off_t pos); } SYS_LSEEK = 199 // { off_t sys_lseek(int fd, int pad, off_t offset, int whence); } SYS_TRUNCATE = 200 // { int sys_truncate(const char *path, int pad, off_t length); } SYS_FTRUNCATE = 201 // { int sys_ftruncate(int fd, int pad, off_t length); } SYS_SYSCTL = 202 // { int sys_sysctl(const int *name, u_int namelen, void *old, size_t *oldlenp, void *new, size_t newlen); } SYS_MLOCK = 203 // { int sys_mlock(const void *addr, size_t len); } SYS_MUNLOCK = 204 // { int sys_munlock(const void *addr, size_t len); } SYS_GETPGID = 207 // { pid_t sys_getpgid(pid_t pid); } SYS_UTRACE = 209 // { int sys_utrace(const char *label, const void *addr, size_t len); } SYS_SEMGET = 221 // { int sys_semget(key_t key, int nsems, int semflg); } SYS_MSGGET = 225 // { int sys_msgget(key_t key, int msgflg); } SYS_MSGSND = 226 // { int sys_msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg); } SYS_MSGRCV = 227 // { int sys_msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg); } SYS_SHMAT = 228 // { void *sys_shmat(int shmid, const void *shmaddr, int shmflg); } SYS_SHMDT = 230 // { int sys_shmdt(const void *shmaddr); } SYS_MINHERIT = 250 // { int sys_minherit(void *addr, size_t len, int inherit); } SYS_POLL = 252 // { int sys_poll(struct pollfd *fds, u_int nfds, int timeout); } SYS_ISSETUGID = 253 // { int sys_issetugid(void); } SYS_LCHOWN = 254 // { int sys_lchown(const char *path, uid_t uid, gid_t gid); } SYS_GETSID = 255 // { pid_t sys_getsid(pid_t pid); } SYS_MSYNC = 256 // { int sys_msync(void *addr, size_t len, int flags); } SYS_PIPE = 263 // { int sys_pipe(int *fdp); } SYS_FHOPEN = 264 // { int sys_fhopen(const fhandle_t *fhp, int flags); } SYS_PREADV = 267 // { ssize_t sys_preadv(int fd, const struct iovec *iovp, int iovcnt, int pad, off_t offset); } SYS_PWRITEV = 268 // { ssize_t sys_pwritev(int fd, const struct iovec *iovp, int iovcnt, int pad, off_t offset); } SYS_KQUEUE = 269 // { int sys_kqueue(void); } SYS_MLOCKALL = 271 // { int sys_mlockall(int flags); } SYS_MUNLOCKALL = 272 // { int sys_munlockall(void); } SYS_GETRESUID = 281 // { int sys_getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); } SYS_SETRESUID = 282 // { int sys_setresuid(uid_t ruid, uid_t euid, uid_t suid); } SYS_GETRESGID = 283 // { int sys_getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); } SYS_SETRESGID = 284 // { int sys_setresgid(gid_t rgid, gid_t egid, gid_t sgid); } SYS_MQUERY = 286 // { void *sys_mquery(void *addr, size_t len, int prot, int flags, int fd, long pad, off_t pos); } SYS_CLOSEFROM = 287 // { int sys_closefrom(int fd); } SYS_SIGALTSTACK = 288 // { int sys_sigaltstack(const struct sigaltstack *nss, struct sigaltstack *oss); } SYS_SHMGET = 289 // { int sys_shmget(key_t key, size_t size, int shmflg); } SYS_SEMOP = 290 // { int sys_semop(int semid, struct sembuf *sops, size_t nsops); } SYS_FHSTAT = 294 // { int sys_fhstat(const fhandle_t *fhp, struct stat *sb); } SYS___SEMCTL = 295 // { int sys___semctl(int semid, int semnum, int cmd, union semun *arg); } SYS_SHMCTL = 296 // { int sys_shmctl(int shmid, int cmd, struct shmid_ds *buf); } SYS_MSGCTL = 297 // { int sys_msgctl(int msqid, int cmd, struct msqid_ds *buf); } SYS_SCHED_YIELD = 298 // { int sys_sched_yield(void); } SYS_GETTHRID = 299 // { pid_t sys_getthrid(void); } SYS___THRWAKEUP = 301 // { int sys___thrwakeup(const volatile void *ident, int n); } SYS___THREXIT = 302 // { void sys___threxit(pid_t *notdead); } SYS___THRSIGDIVERT = 303 // { int sys___thrsigdivert(sigset_t sigmask, siginfo_t *info, const struct timespec *timeout); } SYS___GETCWD = 304 // { int sys___getcwd(char *buf, size_t len); } SYS_ADJFREQ = 305 // { int sys_adjfreq(const int64_t *freq, int64_t *oldfreq); } SYS_SETRTABLE = 310 // { int sys_setrtable(int rtableid); } SYS_GETRTABLE = 311 // { int sys_getrtable(void); } SYS_FACCESSAT = 313 // { int sys_faccessat(int fd, const char *path, int amode, int flag); } SYS_FCHMODAT = 314 // { int sys_fchmodat(int fd, const char *path, mode_t mode, int flag); } SYS_FCHOWNAT = 315 // { int sys_fchownat(int fd, const char *path, uid_t uid, gid_t gid, int flag); } SYS_LINKAT = 317 // { int sys_linkat(int fd1, const char *path1, int fd2, const char *path2, int flag); } SYS_MKDIRAT = 318 // { int sys_mkdirat(int fd, const char *path, mode_t mode); } SYS_MKFIFOAT = 319 // { int sys_mkfifoat(int fd, const char *path, mode_t mode); } SYS_MKNODAT = 320 // { int sys_mknodat(int fd, const char *path, mode_t mode, dev_t dev); } SYS_OPENAT = 321 // { int sys_openat(int fd, const char *path, int flags, ... mode_t mode); } SYS_READLINKAT = 322 // { ssize_t sys_readlinkat(int fd, const char *path, char *buf, size_t count); } SYS_RENAMEAT = 323 // { int sys_renameat(int fromfd, const char *from, int tofd, const char *to); } SYS_SYMLINKAT = 324 // { int sys_symlinkat(const char *path, int fd, const char *link); } SYS_UNLINKAT = 325 // { int sys_unlinkat(int fd, const char *path, int flag); } SYS___SET_TCB = 329 // { void sys___set_tcb(void *tcb); } SYS___GET_TCB = 330 // { void *sys___get_tcb(void); } ) ================================================ FILE: vendor/golang.org/x/sys/unix/zsysnum_openbsd_riscv64.go ================================================ // go run mksysnum.go https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master // Code generated by the command above; see README.md. DO NOT EDIT. //go:build riscv64 && openbsd package unix // Deprecated: Use libc wrappers instead of direct syscalls. const ( SYS_EXIT = 1 // { void sys_exit(int rval); } SYS_FORK = 2 // { int sys_fork(void); } SYS_READ = 3 // { ssize_t sys_read(int fd, void *buf, size_t nbyte); } SYS_WRITE = 4 // { ssize_t sys_write(int fd, const void *buf, size_t nbyte); } SYS_OPEN = 5 // { int sys_open(const char *path, int flags, ... mode_t mode); } SYS_CLOSE = 6 // { int sys_close(int fd); } SYS_GETENTROPY = 7 // { int sys_getentropy(void *buf, size_t nbyte); } SYS___TFORK = 8 // { int sys___tfork(const struct __tfork *param, size_t psize); } SYS_LINK = 9 // { int sys_link(const char *path, const char *link); } SYS_UNLINK = 10 // { int sys_unlink(const char *path); } SYS_WAIT4 = 11 // { pid_t sys_wait4(pid_t pid, int *status, int options, struct rusage *rusage); } SYS_CHDIR = 12 // { int sys_chdir(const char *path); } SYS_FCHDIR = 13 // { int sys_fchdir(int fd); } SYS_MKNOD = 14 // { int sys_mknod(const char *path, mode_t mode, dev_t dev); } SYS_CHMOD = 15 // { int sys_chmod(const char *path, mode_t mode); } SYS_CHOWN = 16 // { int sys_chown(const char *path, uid_t uid, gid_t gid); } SYS_OBREAK = 17 // { int sys_obreak(char *nsize); } break SYS_GETDTABLECOUNT = 18 // { int sys_getdtablecount(void); } SYS_GETRUSAGE = 19 // { int sys_getrusage(int who, struct rusage *rusage); } SYS_GETPID = 20 // { pid_t sys_getpid(void); } SYS_MOUNT = 21 // { int sys_mount(const char *type, const char *path, int flags, void *data); } SYS_UNMOUNT = 22 // { int sys_unmount(const char *path, int flags); } SYS_SETUID = 23 // { int sys_setuid(uid_t uid); } SYS_GETUID = 24 // { uid_t sys_getuid(void); } SYS_GETEUID = 25 // { uid_t sys_geteuid(void); } SYS_PTRACE = 26 // { int sys_ptrace(int req, pid_t pid, caddr_t addr, int data); } SYS_RECVMSG = 27 // { ssize_t sys_recvmsg(int s, struct msghdr *msg, int flags); } SYS_SENDMSG = 28 // { ssize_t sys_sendmsg(int s, const struct msghdr *msg, int flags); } SYS_RECVFROM = 29 // { ssize_t sys_recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlenaddr); } SYS_ACCEPT = 30 // { int sys_accept(int s, struct sockaddr *name, socklen_t *anamelen); } SYS_GETPEERNAME = 31 // { int sys_getpeername(int fdes, struct sockaddr *asa, socklen_t *alen); } SYS_GETSOCKNAME = 32 // { int sys_getsockname(int fdes, struct sockaddr *asa, socklen_t *alen); } SYS_ACCESS = 33 // { int sys_access(const char *path, int amode); } SYS_CHFLAGS = 34 // { int sys_chflags(const char *path, u_int flags); } SYS_FCHFLAGS = 35 // { int sys_fchflags(int fd, u_int flags); } SYS_SYNC = 36 // { void sys_sync(void); } SYS_STAT = 38 // { int sys_stat(const char *path, struct stat *ub); } SYS_GETPPID = 39 // { pid_t sys_getppid(void); } SYS_LSTAT = 40 // { int sys_lstat(const char *path, struct stat *ub); } SYS_DUP = 41 // { int sys_dup(int fd); } SYS_FSTATAT = 42 // { int sys_fstatat(int fd, const char *path, struct stat *buf, int flag); } SYS_GETEGID = 43 // { gid_t sys_getegid(void); } SYS_PROFIL = 44 // { int sys_profil(caddr_t samples, size_t size, u_long offset, u_int scale); } SYS_KTRACE = 45 // { int sys_ktrace(const char *fname, int ops, int facs, pid_t pid); } SYS_SIGACTION = 46 // { int sys_sigaction(int signum, const struct sigaction *nsa, struct sigaction *osa); } SYS_GETGID = 47 // { gid_t sys_getgid(void); } SYS_SIGPROCMASK = 48 // { int sys_sigprocmask(int how, sigset_t mask); } SYS_SETLOGIN = 50 // { int sys_setlogin(const char *namebuf); } SYS_ACCT = 51 // { int sys_acct(const char *path); } SYS_SIGPENDING = 52 // { int sys_sigpending(void); } SYS_FSTAT = 53 // { int sys_fstat(int fd, struct stat *sb); } SYS_IOCTL = 54 // { int sys_ioctl(int fd, u_long com, ... void *data); } SYS_REBOOT = 55 // { int sys_reboot(int opt); } SYS_REVOKE = 56 // { int sys_revoke(const char *path); } SYS_SYMLINK = 57 // { int sys_symlink(const char *path, const char *link); } SYS_READLINK = 58 // { ssize_t sys_readlink(const char *path, char *buf, size_t count); } SYS_EXECVE = 59 // { int sys_execve(const char *path, char * const *argp, char * const *envp); } SYS_UMASK = 60 // { mode_t sys_umask(mode_t newmask); } SYS_CHROOT = 61 // { int sys_chroot(const char *path); } SYS_GETFSSTAT = 62 // { int sys_getfsstat(struct statfs *buf, size_t bufsize, int flags); } SYS_STATFS = 63 // { int sys_statfs(const char *path, struct statfs *buf); } SYS_FSTATFS = 64 // { int sys_fstatfs(int fd, struct statfs *buf); } SYS_FHSTATFS = 65 // { int sys_fhstatfs(const fhandle_t *fhp, struct statfs *buf); } SYS_VFORK = 66 // { int sys_vfork(void); } SYS_GETTIMEOFDAY = 67 // { int sys_gettimeofday(struct timeval *tp, struct timezone *tzp); } SYS_SETTIMEOFDAY = 68 // { int sys_settimeofday(const struct timeval *tv, const struct timezone *tzp); } SYS_SETITIMER = 69 // { int sys_setitimer(int which, const struct itimerval *itv, struct itimerval *oitv); } SYS_GETITIMER = 70 // { int sys_getitimer(int which, struct itimerval *itv); } SYS_SELECT = 71 // { int sys_select(int nd, fd_set *in, fd_set *ou, fd_set *ex, struct timeval *tv); } SYS_KEVENT = 72 // { int sys_kevent(int fd, const struct kevent *changelist, int nchanges, struct kevent *eventlist, int nevents, const struct timespec *timeout); } SYS_MUNMAP = 73 // { int sys_munmap(void *addr, size_t len); } SYS_MPROTECT = 74 // { int sys_mprotect(void *addr, size_t len, int prot); } SYS_MADVISE = 75 // { int sys_madvise(void *addr, size_t len, int behav); } SYS_UTIMES = 76 // { int sys_utimes(const char *path, const struct timeval *tptr); } SYS_FUTIMES = 77 // { int sys_futimes(int fd, const struct timeval *tptr); } SYS_GETGROUPS = 79 // { int sys_getgroups(int gidsetsize, gid_t *gidset); } SYS_SETGROUPS = 80 // { int sys_setgroups(int gidsetsize, const gid_t *gidset); } SYS_GETPGRP = 81 // { int sys_getpgrp(void); } SYS_SETPGID = 82 // { int sys_setpgid(pid_t pid, pid_t pgid); } SYS_FUTEX = 83 // { int sys_futex(uint32_t *f, int op, int val, const struct timespec *timeout, uint32_t *g); } SYS_UTIMENSAT = 84 // { int sys_utimensat(int fd, const char *path, const struct timespec *times, int flag); } SYS_FUTIMENS = 85 // { int sys_futimens(int fd, const struct timespec *times); } SYS_KBIND = 86 // { int sys_kbind(const struct __kbind *param, size_t psize, int64_t proc_cookie); } SYS_CLOCK_GETTIME = 87 // { int sys_clock_gettime(clockid_t clock_id, struct timespec *tp); } SYS_CLOCK_SETTIME = 88 // { int sys_clock_settime(clockid_t clock_id, const struct timespec *tp); } SYS_CLOCK_GETRES = 89 // { int sys_clock_getres(clockid_t clock_id, struct timespec *tp); } SYS_DUP2 = 90 // { int sys_dup2(int from, int to); } SYS_NANOSLEEP = 91 // { int sys_nanosleep(const struct timespec *rqtp, struct timespec *rmtp); } SYS_FCNTL = 92 // { int sys_fcntl(int fd, int cmd, ... void *arg); } SYS_ACCEPT4 = 93 // { int sys_accept4(int s, struct sockaddr *name, socklen_t *anamelen, int flags); } SYS___THRSLEEP = 94 // { int sys___thrsleep(const volatile void *ident, clockid_t clock_id, const struct timespec *tp, void *lock, const int *abort); } SYS_FSYNC = 95 // { int sys_fsync(int fd); } SYS_SETPRIORITY = 96 // { int sys_setpriority(int which, id_t who, int prio); } SYS_SOCKET = 97 // { int sys_socket(int domain, int type, int protocol); } SYS_CONNECT = 98 // { int sys_connect(int s, const struct sockaddr *name, socklen_t namelen); } SYS_GETDENTS = 99 // { int sys_getdents(int fd, void *buf, size_t buflen); } SYS_GETPRIORITY = 100 // { int sys_getpriority(int which, id_t who); } SYS_PIPE2 = 101 // { int sys_pipe2(int *fdp, int flags); } SYS_DUP3 = 102 // { int sys_dup3(int from, int to, int flags); } SYS_SIGRETURN = 103 // { int sys_sigreturn(struct sigcontext *sigcntxp); } SYS_BIND = 104 // { int sys_bind(int s, const struct sockaddr *name, socklen_t namelen); } SYS_SETSOCKOPT = 105 // { int sys_setsockopt(int s, int level, int name, const void *val, socklen_t valsize); } SYS_LISTEN = 106 // { int sys_listen(int s, int backlog); } SYS_CHFLAGSAT = 107 // { int sys_chflagsat(int fd, const char *path, u_int flags, int atflags); } SYS_PLEDGE = 108 // { int sys_pledge(const char *promises, const char *execpromises); } SYS_PPOLL = 109 // { int sys_ppoll(struct pollfd *fds, u_int nfds, const struct timespec *ts, const sigset_t *mask); } SYS_PSELECT = 110 // { int sys_pselect(int nd, fd_set *in, fd_set *ou, fd_set *ex, const struct timespec *ts, const sigset_t *mask); } SYS_SIGSUSPEND = 111 // { int sys_sigsuspend(int mask); } SYS_SENDSYSLOG = 112 // { int sys_sendsyslog(const char *buf, size_t nbyte, int flags); } SYS_UNVEIL = 114 // { int sys_unveil(const char *path, const char *permissions); } SYS_GETSOCKOPT = 118 // { int sys_getsockopt(int s, int level, int name, void *val, socklen_t *avalsize); } SYS_THRKILL = 119 // { int sys_thrkill(pid_t tid, int signum, void *tcb); } SYS_READV = 120 // { ssize_t sys_readv(int fd, const struct iovec *iovp, int iovcnt); } SYS_WRITEV = 121 // { ssize_t sys_writev(int fd, const struct iovec *iovp, int iovcnt); } SYS_KILL = 122 // { int sys_kill(int pid, int signum); } SYS_FCHOWN = 123 // { int sys_fchown(int fd, uid_t uid, gid_t gid); } SYS_FCHMOD = 124 // { int sys_fchmod(int fd, mode_t mode); } SYS_SETREUID = 126 // { int sys_setreuid(uid_t ruid, uid_t euid); } SYS_SETREGID = 127 // { int sys_setregid(gid_t rgid, gid_t egid); } SYS_RENAME = 128 // { int sys_rename(const char *from, const char *to); } SYS_FLOCK = 131 // { int sys_flock(int fd, int how); } SYS_MKFIFO = 132 // { int sys_mkfifo(const char *path, mode_t mode); } SYS_SENDTO = 133 // { ssize_t sys_sendto(int s, const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen); } SYS_SHUTDOWN = 134 // { int sys_shutdown(int s, int how); } SYS_SOCKETPAIR = 135 // { int sys_socketpair(int domain, int type, int protocol, int *rsv); } SYS_MKDIR = 136 // { int sys_mkdir(const char *path, mode_t mode); } SYS_RMDIR = 137 // { int sys_rmdir(const char *path); } SYS_ADJTIME = 140 // { int sys_adjtime(const struct timeval *delta, struct timeval *olddelta); } SYS_GETLOGIN_R = 141 // { int sys_getlogin_r(char *namebuf, u_int namelen); } SYS_SETSID = 147 // { int sys_setsid(void); } SYS_QUOTACTL = 148 // { int sys_quotactl(const char *path, int cmd, int uid, char *arg); } SYS_NFSSVC = 155 // { int sys_nfssvc(int flag, void *argp); } SYS_GETFH = 161 // { int sys_getfh(const char *fname, fhandle_t *fhp); } SYS_SYSARCH = 165 // { int sys_sysarch(int op, void *parms); } SYS_PREAD = 173 // { ssize_t sys_pread(int fd, void *buf, size_t nbyte, int pad, off_t offset); } SYS_PWRITE = 174 // { ssize_t sys_pwrite(int fd, const void *buf, size_t nbyte, int pad, off_t offset); } SYS_SETGID = 181 // { int sys_setgid(gid_t gid); } SYS_SETEGID = 182 // { int sys_setegid(gid_t egid); } SYS_SETEUID = 183 // { int sys_seteuid(uid_t euid); } SYS_PATHCONF = 191 // { long sys_pathconf(const char *path, int name); } SYS_FPATHCONF = 192 // { long sys_fpathconf(int fd, int name); } SYS_SWAPCTL = 193 // { int sys_swapctl(int cmd, const void *arg, int misc); } SYS_GETRLIMIT = 194 // { int sys_getrlimit(int which, struct rlimit *rlp); } SYS_SETRLIMIT = 195 // { int sys_setrlimit(int which, const struct rlimit *rlp); } SYS_MMAP = 197 // { void *sys_mmap(void *addr, size_t len, int prot, int flags, int fd, long pad, off_t pos); } SYS_LSEEK = 199 // { off_t sys_lseek(int fd, int pad, off_t offset, int whence); } SYS_TRUNCATE = 200 // { int sys_truncate(const char *path, int pad, off_t length); } SYS_FTRUNCATE = 201 // { int sys_ftruncate(int fd, int pad, off_t length); } SYS_SYSCTL = 202 // { int sys_sysctl(const int *name, u_int namelen, void *old, size_t *oldlenp, void *new, size_t newlen); } SYS_MLOCK = 203 // { int sys_mlock(const void *addr, size_t len); } SYS_MUNLOCK = 204 // { int sys_munlock(const void *addr, size_t len); } SYS_GETPGID = 207 // { pid_t sys_getpgid(pid_t pid); } SYS_UTRACE = 209 // { int sys_utrace(const char *label, const void *addr, size_t len); } SYS_SEMGET = 221 // { int sys_semget(key_t key, int nsems, int semflg); } SYS_MSGGET = 225 // { int sys_msgget(key_t key, int msgflg); } SYS_MSGSND = 226 // { int sys_msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg); } SYS_MSGRCV = 227 // { int sys_msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg); } SYS_SHMAT = 228 // { void *sys_shmat(int shmid, const void *shmaddr, int shmflg); } SYS_SHMDT = 230 // { int sys_shmdt(const void *shmaddr); } SYS_MINHERIT = 250 // { int sys_minherit(void *addr, size_t len, int inherit); } SYS_POLL = 252 // { int sys_poll(struct pollfd *fds, u_int nfds, int timeout); } SYS_ISSETUGID = 253 // { int sys_issetugid(void); } SYS_LCHOWN = 254 // { int sys_lchown(const char *path, uid_t uid, gid_t gid); } SYS_GETSID = 255 // { pid_t sys_getsid(pid_t pid); } SYS_MSYNC = 256 // { int sys_msync(void *addr, size_t len, int flags); } SYS_PIPE = 263 // { int sys_pipe(int *fdp); } SYS_FHOPEN = 264 // { int sys_fhopen(const fhandle_t *fhp, int flags); } SYS_PREADV = 267 // { ssize_t sys_preadv(int fd, const struct iovec *iovp, int iovcnt, int pad, off_t offset); } SYS_PWRITEV = 268 // { ssize_t sys_pwritev(int fd, const struct iovec *iovp, int iovcnt, int pad, off_t offset); } SYS_KQUEUE = 269 // { int sys_kqueue(void); } SYS_MLOCKALL = 271 // { int sys_mlockall(int flags); } SYS_MUNLOCKALL = 272 // { int sys_munlockall(void); } SYS_GETRESUID = 281 // { int sys_getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); } SYS_SETRESUID = 282 // { int sys_setresuid(uid_t ruid, uid_t euid, uid_t suid); } SYS_GETRESGID = 283 // { int sys_getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); } SYS_SETRESGID = 284 // { int sys_setresgid(gid_t rgid, gid_t egid, gid_t sgid); } SYS_MQUERY = 286 // { void *sys_mquery(void *addr, size_t len, int prot, int flags, int fd, long pad, off_t pos); } SYS_CLOSEFROM = 287 // { int sys_closefrom(int fd); } SYS_SIGALTSTACK = 288 // { int sys_sigaltstack(const struct sigaltstack *nss, struct sigaltstack *oss); } SYS_SHMGET = 289 // { int sys_shmget(key_t key, size_t size, int shmflg); } SYS_SEMOP = 290 // { int sys_semop(int semid, struct sembuf *sops, size_t nsops); } SYS_FHSTAT = 294 // { int sys_fhstat(const fhandle_t *fhp, struct stat *sb); } SYS___SEMCTL = 295 // { int sys___semctl(int semid, int semnum, int cmd, union semun *arg); } SYS_SHMCTL = 296 // { int sys_shmctl(int shmid, int cmd, struct shmid_ds *buf); } SYS_MSGCTL = 297 // { int sys_msgctl(int msqid, int cmd, struct msqid_ds *buf); } SYS_SCHED_YIELD = 298 // { int sys_sched_yield(void); } SYS_GETTHRID = 299 // { pid_t sys_getthrid(void); } SYS___THRWAKEUP = 301 // { int sys___thrwakeup(const volatile void *ident, int n); } SYS___THREXIT = 302 // { void sys___threxit(pid_t *notdead); } SYS___THRSIGDIVERT = 303 // { int sys___thrsigdivert(sigset_t sigmask, siginfo_t *info, const struct timespec *timeout); } SYS___GETCWD = 304 // { int sys___getcwd(char *buf, size_t len); } SYS_ADJFREQ = 305 // { int sys_adjfreq(const int64_t *freq, int64_t *oldfreq); } SYS_SETRTABLE = 310 // { int sys_setrtable(int rtableid); } SYS_GETRTABLE = 311 // { int sys_getrtable(void); } SYS_FACCESSAT = 313 // { int sys_faccessat(int fd, const char *path, int amode, int flag); } SYS_FCHMODAT = 314 // { int sys_fchmodat(int fd, const char *path, mode_t mode, int flag); } SYS_FCHOWNAT = 315 // { int sys_fchownat(int fd, const char *path, uid_t uid, gid_t gid, int flag); } SYS_LINKAT = 317 // { int sys_linkat(int fd1, const char *path1, int fd2, const char *path2, int flag); } SYS_MKDIRAT = 318 // { int sys_mkdirat(int fd, const char *path, mode_t mode); } SYS_MKFIFOAT = 319 // { int sys_mkfifoat(int fd, const char *path, mode_t mode); } SYS_MKNODAT = 320 // { int sys_mknodat(int fd, const char *path, mode_t mode, dev_t dev); } SYS_OPENAT = 321 // { int sys_openat(int fd, const char *path, int flags, ... mode_t mode); } SYS_READLINKAT = 322 // { ssize_t sys_readlinkat(int fd, const char *path, char *buf, size_t count); } SYS_RENAMEAT = 323 // { int sys_renameat(int fromfd, const char *from, int tofd, const char *to); } SYS_SYMLINKAT = 324 // { int sys_symlinkat(const char *path, int fd, const char *link); } SYS_UNLINKAT = 325 // { int sys_unlinkat(int fd, const char *path, int flag); } SYS___SET_TCB = 329 // { void sys___set_tcb(void *tcb); } SYS___GET_TCB = 330 // { void *sys___get_tcb(void); } ) ================================================ FILE: vendor/golang.org/x/sys/unix/zsysnum_zos_s390x.go ================================================ // go run mksyscall_zos_s390x.go -o_sysnum zsysnum_zos_s390x.go -o_syscall zsyscall_zos_s390x.go -i_syscall syscall_zos_s390x.go -o_asm zsymaddr_zos_s390x.s // Code generated by the command above; see README.md. DO NOT EDIT. //go:build zos && s390x package unix const ( SYS_LOG = 0x17 // 23 SYS_COSH = 0x18 // 24 SYS_TANH = 0x19 // 25 SYS_EXP = 0x1A // 26 SYS_MODF = 0x1B // 27 SYS_LOG10 = 0x1C // 28 SYS_FREXP = 0x1D // 29 SYS_LDEXP = 0x1E // 30 SYS_CEIL = 0x1F // 31 SYS_POW = 0x20 // 32 SYS_SQRT = 0x21 // 33 SYS_FLOOR = 0x22 // 34 SYS_J1 = 0x23 // 35 SYS_FABS = 0x24 // 36 SYS_FMOD = 0x25 // 37 SYS_J0 = 0x26 // 38 SYS_YN = 0x27 // 39 SYS_JN = 0x28 // 40 SYS_Y0 = 0x29 // 41 SYS_Y1 = 0x2A // 42 SYS_HYPOT = 0x2B // 43 SYS_ERF = 0x2C // 44 SYS_ERFC = 0x2D // 45 SYS_GAMMA = 0x2E // 46 SYS_ISALPHA = 0x30 // 48 SYS_ISALNUM = 0x31 // 49 SYS_ISLOWER = 0x32 // 50 SYS_ISCNTRL = 0x33 // 51 SYS_ISDIGIT = 0x34 // 52 SYS_ISGRAPH = 0x35 // 53 SYS_ISUPPER = 0x36 // 54 SYS_ISPRINT = 0x37 // 55 SYS_ISPUNCT = 0x38 // 56 SYS_ISSPACE = 0x39 // 57 SYS_SETLOCAL = 0x3A // 58 SYS_SETLOCALE = 0x3A // 58 SYS_ISXDIGIT = 0x3B // 59 SYS_TOLOWER = 0x3C // 60 SYS_TOUPPER = 0x3D // 61 SYS_ASIN = 0x3E // 62 SYS_SIN = 0x3F // 63 SYS_COS = 0x40 // 64 SYS_TAN = 0x41 // 65 SYS_SINH = 0x42 // 66 SYS_ACOS = 0x43 // 67 SYS_ATAN = 0x44 // 68 SYS_ATAN2 = 0x45 // 69 SYS_FTELL = 0x46 // 70 SYS_FGETPOS = 0x47 // 71 SYS_FSEEK = 0x48 // 72 SYS_FSETPOS = 0x49 // 73 SYS_FERROR = 0x4A // 74 SYS_REWIND = 0x4B // 75 SYS_CLEARERR = 0x4C // 76 SYS_FEOF = 0x4D // 77 SYS_ATOL = 0x4E // 78 SYS_PERROR = 0x4F // 79 SYS_ATOF = 0x50 // 80 SYS_ATOI = 0x51 // 81 SYS_RAND = 0x52 // 82 SYS_STRTOD = 0x53 // 83 SYS_STRTOL = 0x54 // 84 SYS_STRTOUL = 0x55 // 85 SYS_MALLOC = 0x56 // 86 SYS_SRAND = 0x57 // 87 SYS_CALLOC = 0x58 // 88 SYS_FREE = 0x59 // 89 SYS_EXIT = 0x5A // 90 SYS_REALLOC = 0x5B // 91 SYS_ABORT = 0x5C // 92 SYS___ABORT = 0x5C // 92 SYS_ATEXIT = 0x5D // 93 SYS_RAISE = 0x5E // 94 SYS_SETJMP = 0x5F // 95 SYS_LONGJMP = 0x60 // 96 SYS_SIGNAL = 0x61 // 97 SYS_TMPNAM = 0x62 // 98 SYS_REMOVE = 0x63 // 99 SYS_RENAME = 0x64 // 100 SYS_TMPFILE = 0x65 // 101 SYS_FREOPEN = 0x66 // 102 SYS_FCLOSE = 0x67 // 103 SYS_FFLUSH = 0x68 // 104 SYS_FOPEN = 0x69 // 105 SYS_FSCANF = 0x6A // 106 SYS_SETBUF = 0x6B // 107 SYS_SETVBUF = 0x6C // 108 SYS_FPRINTF = 0x6D // 109 SYS_SSCANF = 0x6E // 110 SYS_PRINTF = 0x6F // 111 SYS_SCANF = 0x70 // 112 SYS_SPRINTF = 0x71 // 113 SYS_FGETC = 0x72 // 114 SYS_VFPRINTF = 0x73 // 115 SYS_VPRINTF = 0x74 // 116 SYS_VSPRINTF = 0x75 // 117 SYS_GETC = 0x76 // 118 SYS_FGETS = 0x77 // 119 SYS_FPUTC = 0x78 // 120 SYS_FPUTS = 0x79 // 121 SYS_PUTCHAR = 0x7A // 122 SYS_GETCHAR = 0x7B // 123 SYS_GETS = 0x7C // 124 SYS_PUTC = 0x7D // 125 SYS_FWRITE = 0x7E // 126 SYS_PUTS = 0x7F // 127 SYS_UNGETC = 0x80 // 128 SYS_FREAD = 0x81 // 129 SYS_WCSTOMBS = 0x82 // 130 SYS_MBTOWC = 0x83 // 131 SYS_WCTOMB = 0x84 // 132 SYS_MBSTOWCS = 0x85 // 133 SYS_WCSCPY = 0x86 // 134 SYS_WCSCAT = 0x87 // 135 SYS_WCSCHR = 0x88 // 136 SYS_WCSCMP = 0x89 // 137 SYS_WCSNCMP = 0x8A // 138 SYS_WCSCSPN = 0x8B // 139 SYS_WCSLEN = 0x8C // 140 SYS_WCSNCAT = 0x8D // 141 SYS_WCSSPN = 0x8E // 142 SYS_WCSNCPY = 0x8F // 143 SYS_ABS = 0x90 // 144 SYS_DIV = 0x91 // 145 SYS_LABS = 0x92 // 146 SYS_STRNCPY = 0x93 // 147 SYS_MEMCPY = 0x94 // 148 SYS_MEMMOVE = 0x95 // 149 SYS_STRCPY = 0x96 // 150 SYS_STRCMP = 0x97 // 151 SYS_STRCAT = 0x98 // 152 SYS_STRNCAT = 0x99 // 153 SYS_MEMCMP = 0x9A // 154 SYS_MEMCHR = 0x9B // 155 SYS_STRCOLL = 0x9C // 156 SYS_STRNCMP = 0x9D // 157 SYS_STRXFRM = 0x9E // 158 SYS_STRRCHR = 0x9F // 159 SYS_STRCHR = 0xA0 // 160 SYS_STRCSPN = 0xA1 // 161 SYS_STRPBRK = 0xA2 // 162 SYS_MEMSET = 0xA3 // 163 SYS_STRSPN = 0xA4 // 164 SYS_STRSTR = 0xA5 // 165 SYS_STRTOK = 0xA6 // 166 SYS_DIFFTIME = 0xA7 // 167 SYS_STRERROR = 0xA8 // 168 SYS_STRLEN = 0xA9 // 169 SYS_CLOCK = 0xAA // 170 SYS_CTIME = 0xAB // 171 SYS_MKTIME = 0xAC // 172 SYS_TIME = 0xAD // 173 SYS_ASCTIME = 0xAE // 174 SYS_MBLEN = 0xAF // 175 SYS_GMTIME = 0xB0 // 176 SYS_LOCALTIM = 0xB1 // 177 SYS_LOCALTIME = 0xB1 // 177 SYS_STRFTIME = 0xB2 // 178 SYS___GETCB = 0xB4 // 180 SYS_FUPDATE = 0xB5 // 181 SYS___FUPDT = 0xB5 // 181 SYS_CLRMEMF = 0xBD // 189 SYS___CLRMF = 0xBD // 189 SYS_FETCHEP = 0xBF // 191 SYS___FTCHEP = 0xBF // 191 SYS_FLDATA = 0xC1 // 193 SYS___FLDATA = 0xC1 // 193 SYS_DYNFREE = 0xC2 // 194 SYS___DYNFRE = 0xC2 // 194 SYS_DYNALLOC = 0xC3 // 195 SYS___DYNALL = 0xC3 // 195 SYS___CDUMP = 0xC4 // 196 SYS_CSNAP = 0xC5 // 197 SYS___CSNAP = 0xC5 // 197 SYS_CTRACE = 0xC6 // 198 SYS___CTRACE = 0xC6 // 198 SYS___CTEST = 0xC7 // 199 SYS_SETENV = 0xC8 // 200 SYS___SETENV = 0xC8 // 200 SYS_CLEARENV = 0xC9 // 201 SYS___CLRENV = 0xC9 // 201 SYS___REGCOMP_STD = 0xEA // 234 SYS_NL_LANGINFO = 0xFC // 252 SYS_GETSYNTX = 0xFD // 253 SYS_ISBLANK = 0xFE // 254 SYS___ISBLNK = 0xFE // 254 SYS_ISWALNUM = 0xFF // 255 SYS_ISWALPHA = 0x100 // 256 SYS_ISWBLANK = 0x101 // 257 SYS___ISWBLK = 0x101 // 257 SYS_ISWCNTRL = 0x102 // 258 SYS_ISWDIGIT = 0x103 // 259 SYS_ISWGRAPH = 0x104 // 260 SYS_ISWLOWER = 0x105 // 261 SYS_ISWPRINT = 0x106 // 262 SYS_ISWPUNCT = 0x107 // 263 SYS_ISWSPACE = 0x108 // 264 SYS_ISWUPPER = 0x109 // 265 SYS_ISWXDIGI = 0x10A // 266 SYS_ISWXDIGIT = 0x10A // 266 SYS_WCTYPE = 0x10B // 267 SYS_ISWCTYPE = 0x10C // 268 SYS_TOWLOWER = 0x10D // 269 SYS_TOWUPPER = 0x10E // 270 SYS_MBSINIT = 0x10F // 271 SYS_WCTOB = 0x110 // 272 SYS_MBRLEN = 0x111 // 273 SYS_MBRTOWC = 0x112 // 274 SYS_MBSRTOWC = 0x113 // 275 SYS_MBSRTOWCS = 0x113 // 275 SYS_WCRTOMB = 0x114 // 276 SYS_WCSRTOMB = 0x115 // 277 SYS_WCSRTOMBS = 0x115 // 277 SYS___CSID = 0x116 // 278 SYS___WCSID = 0x117 // 279 SYS_STRPTIME = 0x118 // 280 SYS___STRPTM = 0x118 // 280 SYS_STRFMON = 0x119 // 281 SYS___RPMTCH = 0x11A // 282 SYS_WCSSTR = 0x11B // 283 SYS_WCSTOK = 0x12C // 300 SYS_WCSTOL = 0x12D // 301 SYS_WCSTOD = 0x12E // 302 SYS_WCSTOUL = 0x12F // 303 SYS_WCSCOLL = 0x130 // 304 SYS_WCSXFRM = 0x131 // 305 SYS_WCSWIDTH = 0x132 // 306 SYS_WCWIDTH = 0x133 // 307 SYS_WCSFTIME = 0x134 // 308 SYS_SWPRINTF = 0x135 // 309 SYS_VSWPRINT = 0x136 // 310 SYS_VSWPRINTF = 0x136 // 310 SYS_SWSCANF = 0x137 // 311 SYS_REGCOMP = 0x138 // 312 SYS_REGEXEC = 0x139 // 313 SYS_REGFREE = 0x13A // 314 SYS_REGERROR = 0x13B // 315 SYS_FGETWC = 0x13C // 316 SYS_FGETWS = 0x13D // 317 SYS_FPUTWC = 0x13E // 318 SYS_FPUTWS = 0x13F // 319 SYS_GETWC = 0x140 // 320 SYS_GETWCHAR = 0x141 // 321 SYS_PUTWC = 0x142 // 322 SYS_PUTWCHAR = 0x143 // 323 SYS_UNGETWC = 0x144 // 324 SYS_ICONV_OPEN = 0x145 // 325 SYS_ICONV = 0x146 // 326 SYS_ICONV_CLOSE = 0x147 // 327 SYS_ISMCCOLLEL = 0x14C // 332 SYS_STRTOCOLL = 0x14D // 333 SYS_COLLTOSTR = 0x14E // 334 SYS_COLLEQUIV = 0x14F // 335 SYS_COLLRANGE = 0x150 // 336 SYS_CCLASS = 0x151 // 337 SYS_COLLORDER = 0x152 // 338 SYS___DEMANGLE = 0x154 // 340 SYS_FDOPEN = 0x155 // 341 SYS___ERRNO = 0x156 // 342 SYS___ERRNO2 = 0x157 // 343 SYS___TERROR = 0x158 // 344 SYS_MAXCOLL = 0x169 // 361 SYS_GETMCCOLL = 0x16A // 362 SYS_GETWMCCOLL = 0x16B // 363 SYS___ERR2AD = 0x16C // 364 SYS_DLLQUERYFN = 0x16D // 365 SYS_DLLQUERYVAR = 0x16E // 366 SYS_DLLFREE = 0x16F // 367 SYS_DLLLOAD = 0x170 // 368 SYS__EXIT = 0x174 // 372 SYS_ACCESS = 0x175 // 373 SYS_ALARM = 0x176 // 374 SYS_CFGETISPEED = 0x177 // 375 SYS_CFGETOSPEED = 0x178 // 376 SYS_CFSETISPEED = 0x179 // 377 SYS_CFSETOSPEED = 0x17A // 378 SYS_CHDIR = 0x17B // 379 SYS_CHMOD = 0x17C // 380 SYS_CHOWN = 0x17D // 381 SYS_CLOSE = 0x17E // 382 SYS_CLOSEDIR = 0x17F // 383 SYS_CREAT = 0x180 // 384 SYS_CTERMID = 0x181 // 385 SYS_DUP = 0x182 // 386 SYS_DUP2 = 0x183 // 387 SYS_EXECL = 0x184 // 388 SYS_EXECLE = 0x185 // 389 SYS_EXECLP = 0x186 // 390 SYS_EXECV = 0x187 // 391 SYS_EXECVE = 0x188 // 392 SYS_EXECVP = 0x189 // 393 SYS_FCHMOD = 0x18A // 394 SYS_FCHOWN = 0x18B // 395 SYS_FCNTL = 0x18C // 396 SYS_FILENO = 0x18D // 397 SYS_FORK = 0x18E // 398 SYS_FPATHCONF = 0x18F // 399 SYS_FSTAT = 0x190 // 400 SYS_FSYNC = 0x191 // 401 SYS_FTRUNCATE = 0x192 // 402 SYS_GETCWD = 0x193 // 403 SYS_GETEGID = 0x194 // 404 SYS_GETEUID = 0x195 // 405 SYS_GETGID = 0x196 // 406 SYS_GETGRGID = 0x197 // 407 SYS_GETGRNAM = 0x198 // 408 SYS_GETGROUPS = 0x199 // 409 SYS_GETLOGIN = 0x19A // 410 SYS_W_GETMNTENT = 0x19B // 411 SYS_GETPGRP = 0x19C // 412 SYS_GETPID = 0x19D // 413 SYS_GETPPID = 0x19E // 414 SYS_GETPWNAM = 0x19F // 415 SYS_GETPWUID = 0x1A0 // 416 SYS_GETUID = 0x1A1 // 417 SYS_W_IOCTL = 0x1A2 // 418 SYS_ISATTY = 0x1A3 // 419 SYS_KILL = 0x1A4 // 420 SYS_LINK = 0x1A5 // 421 SYS_LSEEK = 0x1A6 // 422 SYS_LSTAT = 0x1A7 // 423 SYS_MKDIR = 0x1A8 // 424 SYS_MKFIFO = 0x1A9 // 425 SYS_MKNOD = 0x1AA // 426 SYS_MOUNT = 0x1AB // 427 SYS_OPEN = 0x1AC // 428 SYS_OPENDIR = 0x1AD // 429 SYS_PATHCONF = 0x1AE // 430 SYS_PAUSE = 0x1AF // 431 SYS_PIPE = 0x1B0 // 432 SYS_W_GETPSENT = 0x1B1 // 433 SYS_READ = 0x1B2 // 434 SYS_READDIR = 0x1B3 // 435 SYS_READLINK = 0x1B4 // 436 SYS_REWINDDIR = 0x1B5 // 437 SYS_RMDIR = 0x1B6 // 438 SYS_SETEGID = 0x1B7 // 439 SYS_SETEUID = 0x1B8 // 440 SYS_SETGID = 0x1B9 // 441 SYS_SETPGID = 0x1BA // 442 SYS_SETSID = 0x1BB // 443 SYS_SETUID = 0x1BC // 444 SYS_SIGACTION = 0x1BD // 445 SYS_SIGADDSET = 0x1BE // 446 SYS_SIGDELSET = 0x1BF // 447 SYS_SIGEMPTYSET = 0x1C0 // 448 SYS_SIGFILLSET = 0x1C1 // 449 SYS_SIGISMEMBER = 0x1C2 // 450 SYS_SIGLONGJMP = 0x1C3 // 451 SYS_SIGPENDING = 0x1C4 // 452 SYS_SIGPROCMASK = 0x1C5 // 453 SYS_SIGSETJMP = 0x1C6 // 454 SYS_SIGSUSPEND = 0x1C7 // 455 SYS_SLEEP = 0x1C8 // 456 SYS_STAT = 0x1C9 // 457 SYS_W_STATFS = 0x1CA // 458 SYS_SYMLINK = 0x1CB // 459 SYS_SYSCONF = 0x1CC // 460 SYS_TCDRAIN = 0x1CD // 461 SYS_TCFLOW = 0x1CE // 462 SYS_TCFLUSH = 0x1CF // 463 SYS_TCGETATTR = 0x1D0 // 464 SYS_TCGETPGRP = 0x1D1 // 465 SYS_TCSENDBREAK = 0x1D2 // 466 SYS_TCSETATTR = 0x1D3 // 467 SYS_TCSETPGRP = 0x1D4 // 468 SYS_TIMES = 0x1D5 // 469 SYS_TTYNAME = 0x1D6 // 470 SYS_TZSET = 0x1D7 // 471 SYS_UMASK = 0x1D8 // 472 SYS_UMOUNT = 0x1D9 // 473 SYS_UNAME = 0x1DA // 474 SYS_UNLINK = 0x1DB // 475 SYS_UTIME = 0x1DC // 476 SYS_WAIT = 0x1DD // 477 SYS_WAITPID = 0x1DE // 478 SYS_WRITE = 0x1DF // 479 SYS_CHAUDIT = 0x1E0 // 480 SYS_FCHAUDIT = 0x1E1 // 481 SYS_GETGROUPSBYNAME = 0x1E2 // 482 SYS_SIGWAIT = 0x1E3 // 483 SYS_PTHREAD_EXIT = 0x1E4 // 484 SYS_PTHREAD_KILL = 0x1E5 // 485 SYS_PTHREAD_ATTR_INIT = 0x1E6 // 486 SYS_PTHREAD_ATTR_DESTROY = 0x1E7 // 487 SYS_PTHREAD_ATTR_SETSTACKSIZE = 0x1E8 // 488 SYS_PTHREAD_ATTR_GETSTACKSIZE = 0x1E9 // 489 SYS_PTHREAD_ATTR_SETDETACHSTATE = 0x1EA // 490 SYS_PTHREAD_ATTR_GETDETACHSTATE = 0x1EB // 491 SYS_PTHREAD_ATTR_SETWEIGHT_NP = 0x1EC // 492 SYS_PTHREAD_ATTR_GETWEIGHT_NP = 0x1ED // 493 SYS_PTHREAD_CANCEL = 0x1EE // 494 SYS_PTHREAD_CLEANUP_PUSH = 0x1EF // 495 SYS_PTHREAD_CLEANUP_POP = 0x1F0 // 496 SYS_PTHREAD_CONDATTR_INIT = 0x1F1 // 497 SYS_PTHREAD_CONDATTR_DESTROY = 0x1F2 // 498 SYS_PTHREAD_COND_INIT = 0x1F3 // 499 SYS_PTHREAD_COND_DESTROY = 0x1F4 // 500 SYS_PTHREAD_COND_SIGNAL = 0x1F5 // 501 SYS_PTHREAD_COND_BROADCAST = 0x1F6 // 502 SYS_PTHREAD_COND_WAIT = 0x1F7 // 503 SYS_PTHREAD_COND_TIMEDWAIT = 0x1F8 // 504 SYS_PTHREAD_CREATE = 0x1F9 // 505 SYS_PTHREAD_DETACH = 0x1FA // 506 SYS_PTHREAD_EQUAL = 0x1FB // 507 SYS_PTHREAD_GETSPECIFIC = 0x1FC // 508 SYS_PTHREAD_JOIN = 0x1FD // 509 SYS_PTHREAD_KEY_CREATE = 0x1FE // 510 SYS_PTHREAD_MUTEXATTR_INIT = 0x1FF // 511 SYS_PTHREAD_MUTEXATTR_DESTROY = 0x200 // 512 SYS_PTHREAD_MUTEXATTR_SETKIND_NP = 0x201 // 513 SYS_PTHREAD_MUTEXATTR_GETKIND_NP = 0x202 // 514 SYS_PTHREAD_MUTEX_INIT = 0x203 // 515 SYS_PTHREAD_MUTEX_DESTROY = 0x204 // 516 SYS_PTHREAD_MUTEX_LOCK = 0x205 // 517 SYS_PTHREAD_MUTEX_TRYLOCK = 0x206 // 518 SYS_PTHREAD_MUTEX_UNLOCK = 0x207 // 519 SYS_PTHREAD_ONCE = 0x209 // 521 SYS_PTHREAD_SELF = 0x20A // 522 SYS_PTHREAD_SETINTR = 0x20B // 523 SYS_PTHREAD_SETINTRTYPE = 0x20C // 524 SYS_PTHREAD_SETSPECIFIC = 0x20D // 525 SYS_PTHREAD_TESTINTR = 0x20E // 526 SYS_PTHREAD_YIELD = 0x20F // 527 SYS_TW_OPEN = 0x210 // 528 SYS_TW_FCNTL = 0x211 // 529 SYS_PTHREAD_JOIN_D4_NP = 0x212 // 530 SYS_PTHREAD_CONDATTR_SETKIND_NP = 0x213 // 531 SYS_PTHREAD_CONDATTR_GETKIND_NP = 0x214 // 532 SYS_EXTLINK_NP = 0x215 // 533 SYS___PASSWD = 0x216 // 534 SYS_SETGROUPS = 0x217 // 535 SYS_INITGROUPS = 0x218 // 536 SYS_WCSPBRK = 0x23F // 575 SYS_WCSRCHR = 0x240 // 576 SYS_SVC99 = 0x241 // 577 SYS___SVC99 = 0x241 // 577 SYS_WCSWCS = 0x242 // 578 SYS_LOCALECO = 0x243 // 579 SYS_LOCALECONV = 0x243 // 579 SYS___LIBREL = 0x244 // 580 SYS_RELEASE = 0x245 // 581 SYS___RLSE = 0x245 // 581 SYS_FLOCATE = 0x246 // 582 SYS___FLOCT = 0x246 // 582 SYS_FDELREC = 0x247 // 583 SYS___FDLREC = 0x247 // 583 SYS_FETCH = 0x248 // 584 SYS___FETCH = 0x248 // 584 SYS_QSORT = 0x249 // 585 SYS_GETENV = 0x24A // 586 SYS_SYSTEM = 0x24B // 587 SYS_BSEARCH = 0x24C // 588 SYS_LDIV = 0x24D // 589 SYS___THROW = 0x25E // 606 SYS___RETHROW = 0x25F // 607 SYS___CLEANUPCATCH = 0x260 // 608 SYS___CATCHMATCH = 0x261 // 609 SYS___CLEAN2UPCATCH = 0x262 // 610 SYS_PUTENV = 0x26A // 618 SYS___GETENV = 0x26F // 623 SYS_GETPRIORITY = 0x270 // 624 SYS_NICE = 0x271 // 625 SYS_SETPRIORITY = 0x272 // 626 SYS_GETITIMER = 0x273 // 627 SYS_SETITIMER = 0x274 // 628 SYS_MSGCTL = 0x275 // 629 SYS_MSGGET = 0x276 // 630 SYS_MSGRCV = 0x277 // 631 SYS_MSGSND = 0x278 // 632 SYS_MSGXRCV = 0x279 // 633 SYS___MSGXR = 0x279 // 633 SYS_SEMCTL = 0x27A // 634 SYS_SEMGET = 0x27B // 635 SYS_SEMOP = 0x27C // 636 SYS_SHMAT = 0x27D // 637 SYS_SHMCTL = 0x27E // 638 SYS_SHMDT = 0x27F // 639 SYS_SHMGET = 0x280 // 640 SYS___GETIPC = 0x281 // 641 SYS_SETGRENT = 0x282 // 642 SYS_GETGRENT = 0x283 // 643 SYS_ENDGRENT = 0x284 // 644 SYS_SETPWENT = 0x285 // 645 SYS_GETPWENT = 0x286 // 646 SYS_ENDPWENT = 0x287 // 647 SYS_BSD_SIGNAL = 0x288 // 648 SYS_KILLPG = 0x289 // 649 SYS_SIGALTSTACK = 0x28A // 650 SYS_SIGHOLD = 0x28B // 651 SYS_SIGIGNORE = 0x28C // 652 SYS_SIGINTERRUPT = 0x28D // 653 SYS_SIGPAUSE = 0x28E // 654 SYS_SIGRELSE = 0x28F // 655 SYS_SIGSET = 0x290 // 656 SYS_SIGSTACK = 0x291 // 657 SYS_GETRLIMIT = 0x292 // 658 SYS_SETRLIMIT = 0x293 // 659 SYS_GETRUSAGE = 0x294 // 660 SYS_MMAP = 0x295 // 661 SYS_MPROTECT = 0x296 // 662 SYS_MSYNC = 0x297 // 663 SYS_MUNMAP = 0x298 // 664 SYS_CONFSTR = 0x299 // 665 SYS_GETOPT = 0x29A // 666 SYS_LCHOWN = 0x29B // 667 SYS_TRUNCATE = 0x29C // 668 SYS_GETSUBOPT = 0x29D // 669 SYS_SETPGRP = 0x29E // 670 SYS___GDERR = 0x29F // 671 SYS___TZONE = 0x2A0 // 672 SYS___DLGHT = 0x2A1 // 673 SYS___OPARGF = 0x2A2 // 674 SYS___OPOPTF = 0x2A3 // 675 SYS___OPINDF = 0x2A4 // 676 SYS___OPERRF = 0x2A5 // 677 SYS_GETDATE = 0x2A6 // 678 SYS_WAIT3 = 0x2A7 // 679 SYS_WAITID = 0x2A8 // 680 SYS___CATTRM = 0x2A9 // 681 SYS___GDTRM = 0x2AA // 682 SYS___RNDTRM = 0x2AB // 683 SYS_CRYPT = 0x2AC // 684 SYS_ENCRYPT = 0x2AD // 685 SYS_SETKEY = 0x2AE // 686 SYS___CNVBLK = 0x2AF // 687 SYS___CRYTRM = 0x2B0 // 688 SYS___ECRTRM = 0x2B1 // 689 SYS_DRAND48 = 0x2B2 // 690 SYS_ERAND48 = 0x2B3 // 691 SYS_FSTATVFS = 0x2B4 // 692 SYS_STATVFS = 0x2B5 // 693 SYS_CATCLOSE = 0x2B6 // 694 SYS_CATGETS = 0x2B7 // 695 SYS_CATOPEN = 0x2B8 // 696 SYS_BCMP = 0x2B9 // 697 SYS_BCOPY = 0x2BA // 698 SYS_BZERO = 0x2BB // 699 SYS_FFS = 0x2BC // 700 SYS_INDEX = 0x2BD // 701 SYS_RINDEX = 0x2BE // 702 SYS_STRCASECMP = 0x2BF // 703 SYS_STRDUP = 0x2C0 // 704 SYS_STRNCASECMP = 0x2C1 // 705 SYS_INITSTATE = 0x2C2 // 706 SYS_SETSTATE = 0x2C3 // 707 SYS_RANDOM = 0x2C4 // 708 SYS_SRANDOM = 0x2C5 // 709 SYS_HCREATE = 0x2C6 // 710 SYS_HDESTROY = 0x2C7 // 711 SYS_HSEARCH = 0x2C8 // 712 SYS_LFIND = 0x2C9 // 713 SYS_LSEARCH = 0x2CA // 714 SYS_TDELETE = 0x2CB // 715 SYS_TFIND = 0x2CC // 716 SYS_TSEARCH = 0x2CD // 717 SYS_TWALK = 0x2CE // 718 SYS_INSQUE = 0x2CF // 719 SYS_REMQUE = 0x2D0 // 720 SYS_POPEN = 0x2D1 // 721 SYS_PCLOSE = 0x2D2 // 722 SYS_SWAB = 0x2D3 // 723 SYS_MEMCCPY = 0x2D4 // 724 SYS_GETPAGESIZE = 0x2D8 // 728 SYS_FCHDIR = 0x2D9 // 729 SYS___OCLCK = 0x2DA // 730 SYS___ATOE = 0x2DB // 731 SYS___ATOE_L = 0x2DC // 732 SYS___ETOA = 0x2DD // 733 SYS___ETOA_L = 0x2DE // 734 SYS_SETUTXENT = 0x2DF // 735 SYS_GETUTXENT = 0x2E0 // 736 SYS_ENDUTXENT = 0x2E1 // 737 SYS_GETUTXID = 0x2E2 // 738 SYS_GETUTXLINE = 0x2E3 // 739 SYS_PUTUTXLINE = 0x2E4 // 740 SYS_FMTMSG = 0x2E5 // 741 SYS_JRAND48 = 0x2E6 // 742 SYS_LRAND48 = 0x2E7 // 743 SYS_MRAND48 = 0x2E8 // 744 SYS_NRAND48 = 0x2E9 // 745 SYS_LCONG48 = 0x2EA // 746 SYS_SRAND48 = 0x2EB // 747 SYS_SEED48 = 0x2EC // 748 SYS_ISASCII = 0x2ED // 749 SYS_TOASCII = 0x2EE // 750 SYS_A64L = 0x2EF // 751 SYS_L64A = 0x2F0 // 752 SYS_UALARM = 0x2F1 // 753 SYS_USLEEP = 0x2F2 // 754 SYS___UTXTRM = 0x2F3 // 755 SYS___SRCTRM = 0x2F4 // 756 SYS_FTIME = 0x2F5 // 757 SYS_GETTIMEOFDAY = 0x2F6 // 758 SYS_DBM_CLEARERR = 0x2F7 // 759 SYS_DBM_CLOSE = 0x2F8 // 760 SYS_DBM_DELETE = 0x2F9 // 761 SYS_DBM_ERROR = 0x2FA // 762 SYS_DBM_FETCH = 0x2FB // 763 SYS_DBM_FIRSTKEY = 0x2FC // 764 SYS_DBM_NEXTKEY = 0x2FD // 765 SYS_DBM_OPEN = 0x2FE // 766 SYS_DBM_STORE = 0x2FF // 767 SYS___NDMTRM = 0x300 // 768 SYS_FTOK = 0x301 // 769 SYS_BASENAME = 0x302 // 770 SYS_DIRNAME = 0x303 // 771 SYS_GETDTABLESIZE = 0x304 // 772 SYS_MKSTEMP = 0x305 // 773 SYS_MKTEMP = 0x306 // 774 SYS_NFTW = 0x307 // 775 SYS_GETWD = 0x308 // 776 SYS_LOCKF = 0x309 // 777 SYS__LONGJMP = 0x30D // 781 SYS__SETJMP = 0x30E // 782 SYS_VFORK = 0x30F // 783 SYS_WORDEXP = 0x310 // 784 SYS_WORDFREE = 0x311 // 785 SYS_GETPGID = 0x312 // 786 SYS_GETSID = 0x313 // 787 SYS___UTMPXNAME = 0x314 // 788 SYS_CUSERID = 0x315 // 789 SYS_GETPASS = 0x316 // 790 SYS_FNMATCH = 0x317 // 791 SYS_FTW = 0x318 // 792 SYS_GETW = 0x319 // 793 SYS_GLOB = 0x31A // 794 SYS_GLOBFREE = 0x31B // 795 SYS_PUTW = 0x31C // 796 SYS_SEEKDIR = 0x31D // 797 SYS_TELLDIR = 0x31E // 798 SYS_TEMPNAM = 0x31F // 799 SYS_ACOSH = 0x320 // 800 SYS_ASINH = 0x321 // 801 SYS_ATANH = 0x322 // 802 SYS_CBRT = 0x323 // 803 SYS_EXPM1 = 0x324 // 804 SYS_ILOGB = 0x325 // 805 SYS_LOGB = 0x326 // 806 SYS_LOG1P = 0x327 // 807 SYS_NEXTAFTER = 0x328 // 808 SYS_RINT = 0x329 // 809 SYS_REMAINDER = 0x32A // 810 SYS_SCALB = 0x32B // 811 SYS_LGAMMA = 0x32C // 812 SYS_TTYSLOT = 0x32D // 813 SYS_GETTIMEOFDAY_R = 0x32E // 814 SYS_SYNC = 0x32F // 815 SYS_SPAWN = 0x330 // 816 SYS_SPAWNP = 0x331 // 817 SYS_GETLOGIN_UU = 0x332 // 818 SYS_ECVT = 0x333 // 819 SYS_FCVT = 0x334 // 820 SYS_GCVT = 0x335 // 821 SYS_ACCEPT = 0x336 // 822 SYS_BIND = 0x337 // 823 SYS_CONNECT = 0x338 // 824 SYS_ENDHOSTENT = 0x339 // 825 SYS_ENDPROTOENT = 0x33A // 826 SYS_ENDSERVENT = 0x33B // 827 SYS_GETHOSTBYADDR_R = 0x33C // 828 SYS_GETHOSTBYADDR = 0x33D // 829 SYS_GETHOSTBYNAME_R = 0x33E // 830 SYS_GETHOSTBYNAME = 0x33F // 831 SYS_GETHOSTENT = 0x340 // 832 SYS_GETHOSTID = 0x341 // 833 SYS_GETHOSTNAME = 0x342 // 834 SYS_GETNETBYADDR = 0x343 // 835 SYS_GETNETBYNAME = 0x344 // 836 SYS_GETNETENT = 0x345 // 837 SYS_GETPEERNAME = 0x346 // 838 SYS_GETPROTOBYNAME = 0x347 // 839 SYS_GETPROTOBYNUMBER = 0x348 // 840 SYS_GETPROTOENT = 0x349 // 841 SYS_GETSERVBYNAME = 0x34A // 842 SYS_GETSERVBYPORT = 0x34B // 843 SYS_GETSERVENT = 0x34C // 844 SYS_GETSOCKNAME = 0x34D // 845 SYS_GETSOCKOPT = 0x34E // 846 SYS_INET_ADDR = 0x34F // 847 SYS_INET_LNAOF = 0x350 // 848 SYS_INET_MAKEADDR = 0x351 // 849 SYS_INET_NETOF = 0x352 // 850 SYS_INET_NETWORK = 0x353 // 851 SYS_INET_NTOA = 0x354 // 852 SYS_IOCTL = 0x355 // 853 SYS_LISTEN = 0x356 // 854 SYS_READV = 0x357 // 855 SYS_RECV = 0x358 // 856 SYS_RECVFROM = 0x359 // 857 SYS_SELECT = 0x35B // 859 SYS_SELECTEX = 0x35C // 860 SYS_SEND = 0x35D // 861 SYS_SENDTO = 0x35F // 863 SYS_SETHOSTENT = 0x360 // 864 SYS_SETNETENT = 0x361 // 865 SYS_SETPEER = 0x362 // 866 SYS_SETPROTOENT = 0x363 // 867 SYS_SETSERVENT = 0x364 // 868 SYS_SETSOCKOPT = 0x365 // 869 SYS_SHUTDOWN = 0x366 // 870 SYS_SOCKET = 0x367 // 871 SYS_SOCKETPAIR = 0x368 // 872 SYS_WRITEV = 0x369 // 873 SYS_CHROOT = 0x36A // 874 SYS_W_STATVFS = 0x36B // 875 SYS_ULIMIT = 0x36C // 876 SYS_ISNAN = 0x36D // 877 SYS_UTIMES = 0x36E // 878 SYS___H_ERRNO = 0x36F // 879 SYS_ENDNETENT = 0x370 // 880 SYS_CLOSELOG = 0x371 // 881 SYS_OPENLOG = 0x372 // 882 SYS_SETLOGMASK = 0x373 // 883 SYS_SYSLOG = 0x374 // 884 SYS_PTSNAME = 0x375 // 885 SYS_SETREUID = 0x376 // 886 SYS_SETREGID = 0x377 // 887 SYS_REALPATH = 0x378 // 888 SYS___SIGNGAM = 0x379 // 889 SYS_GRANTPT = 0x37A // 890 SYS_UNLOCKPT = 0x37B // 891 SYS_TCGETSID = 0x37C // 892 SYS___TCGETCP = 0x37D // 893 SYS___TCSETCP = 0x37E // 894 SYS___TCSETTABLES = 0x37F // 895 SYS_POLL = 0x380 // 896 SYS_REXEC = 0x381 // 897 SYS___ISASCII2 = 0x382 // 898 SYS___TOASCII2 = 0x383 // 899 SYS_CHPRIORITY = 0x384 // 900 SYS_PTHREAD_ATTR_SETSYNCTYPE_NP = 0x385 // 901 SYS_PTHREAD_ATTR_GETSYNCTYPE_NP = 0x386 // 902 SYS_PTHREAD_SET_LIMIT_NP = 0x387 // 903 SYS___STNETENT = 0x388 // 904 SYS___STPROTOENT = 0x389 // 905 SYS___STSERVENT = 0x38A // 906 SYS___STHOSTENT = 0x38B // 907 SYS_NLIST = 0x38C // 908 SYS___IPDBCS = 0x38D // 909 SYS___IPDSPX = 0x38E // 910 SYS___IPMSGC = 0x38F // 911 SYS___SELECT1 = 0x390 // 912 SYS_PTHREAD_SECURITY_NP = 0x391 // 913 SYS___CHECK_RESOURCE_AUTH_NP = 0x392 // 914 SYS___CONVERT_ID_NP = 0x393 // 915 SYS___OPENVMREL = 0x394 // 916 SYS_WMEMCHR = 0x395 // 917 SYS_WMEMCMP = 0x396 // 918 SYS_WMEMCPY = 0x397 // 919 SYS_WMEMMOVE = 0x398 // 920 SYS_WMEMSET = 0x399 // 921 SYS___FPUTWC = 0x400 // 1024 SYS___PUTWC = 0x401 // 1025 SYS___PWCHAR = 0x402 // 1026 SYS___WCSFTM = 0x403 // 1027 SYS___WCSTOK = 0x404 // 1028 SYS___WCWDTH = 0x405 // 1029 SYS_T_ACCEPT = 0x409 // 1033 SYS_T_ALLOC = 0x40A // 1034 SYS_T_BIND = 0x40B // 1035 SYS_T_CLOSE = 0x40C // 1036 SYS_T_CONNECT = 0x40D // 1037 SYS_T_ERROR = 0x40E // 1038 SYS_T_FREE = 0x40F // 1039 SYS_T_GETINFO = 0x410 // 1040 SYS_T_GETPROTADDR = 0x411 // 1041 SYS_T_GETSTATE = 0x412 // 1042 SYS_T_LISTEN = 0x413 // 1043 SYS_T_LOOK = 0x414 // 1044 SYS_T_OPEN = 0x415 // 1045 SYS_T_OPTMGMT = 0x416 // 1046 SYS_T_RCV = 0x417 // 1047 SYS_T_RCVCONNECT = 0x418 // 1048 SYS_T_RCVDIS = 0x419 // 1049 SYS_T_RCVREL = 0x41A // 1050 SYS_T_RCVUDATA = 0x41B // 1051 SYS_T_RCVUDERR = 0x41C // 1052 SYS_T_SND = 0x41D // 1053 SYS_T_SNDDIS = 0x41E // 1054 SYS_T_SNDREL = 0x41F // 1055 SYS_T_SNDUDATA = 0x420 // 1056 SYS_T_STRERROR = 0x421 // 1057 SYS_T_SYNC = 0x422 // 1058 SYS_T_UNBIND = 0x423 // 1059 SYS___T_ERRNO = 0x424 // 1060 SYS___RECVMSG2 = 0x425 // 1061 SYS___SENDMSG2 = 0x426 // 1062 SYS_FATTACH = 0x427 // 1063 SYS_FDETACH = 0x428 // 1064 SYS_GETMSG = 0x429 // 1065 SYS_GETPMSG = 0x42A // 1066 SYS_ISASTREAM = 0x42B // 1067 SYS_PUTMSG = 0x42C // 1068 SYS_PUTPMSG = 0x42D // 1069 SYS___ISPOSIXON = 0x42E // 1070 SYS___OPENMVSREL = 0x42F // 1071 SYS_GETCONTEXT = 0x430 // 1072 SYS_SETCONTEXT = 0x431 // 1073 SYS_MAKECONTEXT = 0x432 // 1074 SYS_SWAPCONTEXT = 0x433 // 1075 SYS_PTHREAD_GETSPECIFIC_D8_NP = 0x434 // 1076 SYS_GETCLIENTID = 0x470 // 1136 SYS___GETCLIENTID = 0x471 // 1137 SYS_GETSTABLESIZE = 0x472 // 1138 SYS_GETIBMOPT = 0x473 // 1139 SYS_GETIBMSOCKOPT = 0x474 // 1140 SYS_GIVESOCKET = 0x475 // 1141 SYS_IBMSFLUSH = 0x476 // 1142 SYS_MAXDESC = 0x477 // 1143 SYS_SETIBMOPT = 0x478 // 1144 SYS_SETIBMSOCKOPT = 0x479 // 1145 SYS_SOCK_DEBUG = 0x47A // 1146 SYS_SOCK_DO_TESTSTOR = 0x47D // 1149 SYS_TAKESOCKET = 0x47E // 1150 SYS___SERVER_INIT = 0x47F // 1151 SYS___SERVER_PWU = 0x480 // 1152 SYS_PTHREAD_TAG_NP = 0x481 // 1153 SYS___CONSOLE = 0x482 // 1154 SYS___WSINIT = 0x483 // 1155 SYS___IPTCPN = 0x489 // 1161 SYS___SMF_RECORD = 0x48A // 1162 SYS___IPHOST = 0x48B // 1163 SYS___IPNODE = 0x48C // 1164 SYS___SERVER_CLASSIFY_CREATE = 0x48D // 1165 SYS___SERVER_CLASSIFY_DESTROY = 0x48E // 1166 SYS___SERVER_CLASSIFY_RESET = 0x48F // 1167 SYS___SERVER_CLASSIFY = 0x490 // 1168 SYS___HEAPRPT = 0x496 // 1174 SYS___FNWSA = 0x49B // 1179 SYS___SPAWN2 = 0x49D // 1181 SYS___SPAWNP2 = 0x49E // 1182 SYS___GDRR = 0x4A1 // 1185 SYS___HRRNO = 0x4A2 // 1186 SYS___OPRG = 0x4A3 // 1187 SYS___OPRR = 0x4A4 // 1188 SYS___OPND = 0x4A5 // 1189 SYS___OPPT = 0x4A6 // 1190 SYS___SIGGM = 0x4A7 // 1191 SYS___DGHT = 0x4A8 // 1192 SYS___TZNE = 0x4A9 // 1193 SYS___TZZN = 0x4AA // 1194 SYS___TRRNO = 0x4AF // 1199 SYS___ENVN = 0x4B0 // 1200 SYS___MLOCKALL = 0x4B1 // 1201 SYS_CREATEWO = 0x4B2 // 1202 SYS_CREATEWORKUNIT = 0x4B2 // 1202 SYS_CONTINUE = 0x4B3 // 1203 SYS_CONTINUEWORKUNIT = 0x4B3 // 1203 SYS_CONNECTW = 0x4B4 // 1204 SYS_CONNECTWORKMGR = 0x4B4 // 1204 SYS_CONNECTS = 0x4B5 // 1205 SYS_CONNECTSERVER = 0x4B5 // 1205 SYS_DISCONNE = 0x4B6 // 1206 SYS_DISCONNECTSERVER = 0x4B6 // 1206 SYS_JOINWORK = 0x4B7 // 1207 SYS_JOINWORKUNIT = 0x4B7 // 1207 SYS_LEAVEWOR = 0x4B8 // 1208 SYS_LEAVEWORKUNIT = 0x4B8 // 1208 SYS_DELETEWO = 0x4B9 // 1209 SYS_DELETEWORKUNIT = 0x4B9 // 1209 SYS_QUERYMET = 0x4BA // 1210 SYS_QUERYMETRICS = 0x4BA // 1210 SYS_QUERYSCH = 0x4BB // 1211 SYS_QUERYSCHENV = 0x4BB // 1211 SYS_CHECKSCH = 0x4BC // 1212 SYS_CHECKSCHENV = 0x4BC // 1212 SYS___PID_AFFINITY = 0x4BD // 1213 SYS___ASINH_B = 0x4BE // 1214 SYS___ATAN_B = 0x4BF // 1215 SYS___CBRT_B = 0x4C0 // 1216 SYS___CEIL_B = 0x4C1 // 1217 SYS_COPYSIGN = 0x4C2 // 1218 SYS___COS_B = 0x4C3 // 1219 SYS___ERF_B = 0x4C4 // 1220 SYS___ERFC_B = 0x4C5 // 1221 SYS___EXPM1_B = 0x4C6 // 1222 SYS___FABS_B = 0x4C7 // 1223 SYS_FINITE = 0x4C8 // 1224 SYS___FLOOR_B = 0x4C9 // 1225 SYS___FREXP_B = 0x4CA // 1226 SYS___ILOGB_B = 0x4CB // 1227 SYS___ISNAN_B = 0x4CC // 1228 SYS___LDEXP_B = 0x4CD // 1229 SYS___LOG1P_B = 0x4CE // 1230 SYS___LOGB_B = 0x4CF // 1231 SYS_MATHERR = 0x4D0 // 1232 SYS___MODF_B = 0x4D1 // 1233 SYS___NEXTAFTER_B = 0x4D2 // 1234 SYS___RINT_B = 0x4D3 // 1235 SYS_SCALBN = 0x4D4 // 1236 SYS_SIGNIFIC = 0x4D5 // 1237 SYS_SIGNIFICAND = 0x4D5 // 1237 SYS___SIN_B = 0x4D6 // 1238 SYS___TAN_B = 0x4D7 // 1239 SYS___TANH_B = 0x4D8 // 1240 SYS___ACOS_B = 0x4D9 // 1241 SYS___ACOSH_B = 0x4DA // 1242 SYS___ASIN_B = 0x4DB // 1243 SYS___ATAN2_B = 0x4DC // 1244 SYS___ATANH_B = 0x4DD // 1245 SYS___COSH_B = 0x4DE // 1246 SYS___EXP_B = 0x4DF // 1247 SYS___FMOD_B = 0x4E0 // 1248 SYS___GAMMA_B = 0x4E1 // 1249 SYS_GAMMA_R = 0x4E2 // 1250 SYS___HYPOT_B = 0x4E3 // 1251 SYS___J0_B = 0x4E4 // 1252 SYS___Y0_B = 0x4E5 // 1253 SYS___J1_B = 0x4E6 // 1254 SYS___Y1_B = 0x4E7 // 1255 SYS___JN_B = 0x4E8 // 1256 SYS___YN_B = 0x4E9 // 1257 SYS___LGAMMA_B = 0x4EA // 1258 SYS_LGAMMA_R = 0x4EB // 1259 SYS___LOG_B = 0x4EC // 1260 SYS___LOG10_B = 0x4ED // 1261 SYS___POW_B = 0x4EE // 1262 SYS___REMAINDER_B = 0x4EF // 1263 SYS___SCALB_B = 0x4F0 // 1264 SYS___SINH_B = 0x4F1 // 1265 SYS___SQRT_B = 0x4F2 // 1266 SYS___OPENDIR2 = 0x4F3 // 1267 SYS___READDIR2 = 0x4F4 // 1268 SYS___LOGIN = 0x4F5 // 1269 SYS___OPEN_STAT = 0x4F6 // 1270 SYS_ACCEPT_AND_RECV = 0x4F7 // 1271 SYS___FP_SETMODE = 0x4F8 // 1272 SYS___SIGACTIONSET = 0x4FB // 1275 SYS___UCREATE = 0x4FC // 1276 SYS___UMALLOC = 0x4FD // 1277 SYS___UFREE = 0x4FE // 1278 SYS___UHEAPREPORT = 0x4FF // 1279 SYS___ISBFP = 0x500 // 1280 SYS___FP_CAST = 0x501 // 1281 SYS___CERTIFICATE = 0x502 // 1282 SYS_SEND_FILE = 0x503 // 1283 SYS_AIO_CANCEL = 0x504 // 1284 SYS_AIO_ERROR = 0x505 // 1285 SYS_AIO_READ = 0x506 // 1286 SYS_AIO_RETURN = 0x507 // 1287 SYS_AIO_SUSPEND = 0x508 // 1288 SYS_AIO_WRITE = 0x509 // 1289 SYS_PTHREAD_MUTEXATTR_GETPSHARED = 0x50A // 1290 SYS_PTHREAD_MUTEXATTR_SETPSHARED = 0x50B // 1291 SYS_PTHREAD_RWLOCK_DESTROY = 0x50C // 1292 SYS_PTHREAD_RWLOCK_INIT = 0x50D // 1293 SYS_PTHREAD_RWLOCK_RDLOCK = 0x50E // 1294 SYS_PTHREAD_RWLOCK_TRYRDLOCK = 0x50F // 1295 SYS_PTHREAD_RWLOCK_TRYWRLOCK = 0x510 // 1296 SYS_PTHREAD_RWLOCK_UNLOCK = 0x511 // 1297 SYS_PTHREAD_RWLOCK_WRLOCK = 0x512 // 1298 SYS_PTHREAD_RWLOCKATTR_GETPSHARED = 0x513 // 1299 SYS_PTHREAD_RWLOCKATTR_SETPSHARED = 0x514 // 1300 SYS_PTHREAD_RWLOCKATTR_INIT = 0x515 // 1301 SYS_PTHREAD_RWLOCKATTR_DESTROY = 0x516 // 1302 SYS___CTTBL = 0x517 // 1303 SYS_PTHREAD_MUTEXATTR_SETTYPE = 0x518 // 1304 SYS_PTHREAD_MUTEXATTR_GETTYPE = 0x519 // 1305 SYS___FP_CLR_FLAG = 0x51A // 1306 SYS___FP_READ_FLAG = 0x51B // 1307 SYS___FP_RAISE_XCP = 0x51C // 1308 SYS___FP_CLASS = 0x51D // 1309 SYS___FP_FINITE = 0x51E // 1310 SYS___FP_ISNAN = 0x51F // 1311 SYS___FP_UNORDERED = 0x520 // 1312 SYS___FP_READ_RND = 0x521 // 1313 SYS___FP_READ_RND_B = 0x522 // 1314 SYS___FP_SWAP_RND = 0x523 // 1315 SYS___FP_SWAP_RND_B = 0x524 // 1316 SYS___FP_LEVEL = 0x525 // 1317 SYS___FP_BTOH = 0x526 // 1318 SYS___FP_HTOB = 0x527 // 1319 SYS___FPC_RD = 0x528 // 1320 SYS___FPC_WR = 0x529 // 1321 SYS___FPC_RW = 0x52A // 1322 SYS___FPC_SM = 0x52B // 1323 SYS___FPC_RS = 0x52C // 1324 SYS_SIGTIMEDWAIT = 0x52D // 1325 SYS_SIGWAITINFO = 0x52E // 1326 SYS___CHKBFP = 0x52F // 1327 SYS___W_PIOCTL = 0x59E // 1438 SYS___OSENV = 0x59F // 1439 SYS_EXPORTWO = 0x5A1 // 1441 SYS_EXPORTWORKUNIT = 0x5A1 // 1441 SYS_UNDOEXPO = 0x5A2 // 1442 SYS_UNDOEXPORTWORKUNIT = 0x5A2 // 1442 SYS_IMPORTWO = 0x5A3 // 1443 SYS_IMPORTWORKUNIT = 0x5A3 // 1443 SYS_UNDOIMPO = 0x5A4 // 1444 SYS_UNDOIMPORTWORKUNIT = 0x5A4 // 1444 SYS_EXTRACTW = 0x5A5 // 1445 SYS_EXTRACTWORKUNIT = 0x5A5 // 1445 SYS___CPL = 0x5A6 // 1446 SYS___MAP_INIT = 0x5A7 // 1447 SYS___MAP_SERVICE = 0x5A8 // 1448 SYS_SIGQUEUE = 0x5A9 // 1449 SYS___MOUNT = 0x5AA // 1450 SYS___GETUSERID = 0x5AB // 1451 SYS___IPDOMAINNAME = 0x5AC // 1452 SYS_QUERYENC = 0x5AD // 1453 SYS_QUERYWORKUNITCLASSIFICATION = 0x5AD // 1453 SYS_CONNECTE = 0x5AE // 1454 SYS_CONNECTEXPORTIMPORT = 0x5AE // 1454 SYS___FP_SWAPMODE = 0x5AF // 1455 SYS_STRTOLL = 0x5B0 // 1456 SYS_STRTOULL = 0x5B1 // 1457 SYS___DSA_PREV = 0x5B2 // 1458 SYS___EP_FIND = 0x5B3 // 1459 SYS___SERVER_THREADS_QUERY = 0x5B4 // 1460 SYS___MSGRCV_TIMED = 0x5B7 // 1463 SYS___SEMOP_TIMED = 0x5B8 // 1464 SYS___GET_CPUID = 0x5B9 // 1465 SYS___GET_SYSTEM_SETTINGS = 0x5BA // 1466 SYS_FTELLO = 0x5C8 // 1480 SYS_FSEEKO = 0x5C9 // 1481 SYS_LLDIV = 0x5CB // 1483 SYS_WCSTOLL = 0x5CC // 1484 SYS_WCSTOULL = 0x5CD // 1485 SYS_LLABS = 0x5CE // 1486 SYS___CONSOLE2 = 0x5D2 // 1490 SYS_INET_NTOP = 0x5D3 // 1491 SYS_INET_PTON = 0x5D4 // 1492 SYS___RES = 0x5D6 // 1494 SYS_RES_MKQUERY = 0x5D7 // 1495 SYS_RES_INIT = 0x5D8 // 1496 SYS_RES_QUERY = 0x5D9 // 1497 SYS_RES_SEARCH = 0x5DA // 1498 SYS_RES_SEND = 0x5DB // 1499 SYS_RES_QUERYDOMAIN = 0x5DC // 1500 SYS_DN_EXPAND = 0x5DD // 1501 SYS_DN_SKIPNAME = 0x5DE // 1502 SYS_DN_COMP = 0x5DF // 1503 SYS_ASCTIME_R = 0x5E0 // 1504 SYS_CTIME_R = 0x5E1 // 1505 SYS_GMTIME_R = 0x5E2 // 1506 SYS_LOCALTIME_R = 0x5E3 // 1507 SYS_RAND_R = 0x5E4 // 1508 SYS_STRTOK_R = 0x5E5 // 1509 SYS_READDIR_R = 0x5E6 // 1510 SYS_GETGRGID_R = 0x5E7 // 1511 SYS_GETGRNAM_R = 0x5E8 // 1512 SYS_GETLOGIN_R = 0x5E9 // 1513 SYS_GETPWNAM_R = 0x5EA // 1514 SYS_GETPWUID_R = 0x5EB // 1515 SYS_TTYNAME_R = 0x5EC // 1516 SYS_PTHREAD_ATFORK = 0x5ED // 1517 SYS_PTHREAD_ATTR_GETGUARDSIZE = 0x5EE // 1518 SYS_PTHREAD_ATTR_GETSTACKADDR = 0x5EF // 1519 SYS_PTHREAD_ATTR_SETGUARDSIZE = 0x5F0 // 1520 SYS_PTHREAD_ATTR_SETSTACKADDR = 0x5F1 // 1521 SYS_PTHREAD_CONDATTR_GETPSHARED = 0x5F2 // 1522 SYS_PTHREAD_CONDATTR_SETPSHARED = 0x5F3 // 1523 SYS_PTHREAD_GETCONCURRENCY = 0x5F4 // 1524 SYS_PTHREAD_KEY_DELETE = 0x5F5 // 1525 SYS_PTHREAD_SETCONCURRENCY = 0x5F6 // 1526 SYS_PTHREAD_SIGMASK = 0x5F7 // 1527 SYS___DISCARDDATA = 0x5F8 // 1528 SYS_PTHREAD_ATTR_GETSCHEDPARAM = 0x5F9 // 1529 SYS_PTHREAD_ATTR_SETSCHEDPARAM = 0x5FA // 1530 SYS_PTHREAD_ATTR_GETDETACHSTATE_U98 = 0x5FB // 1531 SYS_PTHREAD_ATTR_SETDETACHSTATE_U98 = 0x5FC // 1532 SYS_PTHREAD_DETACH_U98 = 0x5FD // 1533 SYS_PTHREAD_GETSPECIFIC_U98 = 0x5FE // 1534 SYS_PTHREAD_SETCANCELSTATE = 0x5FF // 1535 SYS_PTHREAD_SETCANCELTYPE = 0x600 // 1536 SYS_PTHREAD_TESTCANCEL = 0x601 // 1537 SYS___ATANF_B = 0x602 // 1538 SYS___ATANL_B = 0x603 // 1539 SYS___CEILF_B = 0x604 // 1540 SYS___CEILL_B = 0x605 // 1541 SYS___COSF_B = 0x606 // 1542 SYS___COSL_B = 0x607 // 1543 SYS___FABSF_B = 0x608 // 1544 SYS___FABSL_B = 0x609 // 1545 SYS___FLOORF_B = 0x60A // 1546 SYS___FLOORL_B = 0x60B // 1547 SYS___FREXPF_B = 0x60C // 1548 SYS___FREXPL_B = 0x60D // 1549 SYS___LDEXPF_B = 0x60E // 1550 SYS___LDEXPL_B = 0x60F // 1551 SYS___SINF_B = 0x610 // 1552 SYS___SINL_B = 0x611 // 1553 SYS___TANF_B = 0x612 // 1554 SYS___TANL_B = 0x613 // 1555 SYS___TANHF_B = 0x614 // 1556 SYS___TANHL_B = 0x615 // 1557 SYS___ACOSF_B = 0x616 // 1558 SYS___ACOSL_B = 0x617 // 1559 SYS___ASINF_B = 0x618 // 1560 SYS___ASINL_B = 0x619 // 1561 SYS___ATAN2F_B = 0x61A // 1562 SYS___ATAN2L_B = 0x61B // 1563 SYS___COSHF_B = 0x61C // 1564 SYS___COSHL_B = 0x61D // 1565 SYS___EXPF_B = 0x61E // 1566 SYS___EXPL_B = 0x61F // 1567 SYS___LOGF_B = 0x620 // 1568 SYS___LOGL_B = 0x621 // 1569 SYS___LOG10F_B = 0x622 // 1570 SYS___LOG10L_B = 0x623 // 1571 SYS___POWF_B = 0x624 // 1572 SYS___POWL_B = 0x625 // 1573 SYS___SINHF_B = 0x626 // 1574 SYS___SINHL_B = 0x627 // 1575 SYS___SQRTF_B = 0x628 // 1576 SYS___SQRTL_B = 0x629 // 1577 SYS___ABSF_B = 0x62A // 1578 SYS___ABS_B = 0x62B // 1579 SYS___ABSL_B = 0x62C // 1580 SYS___FMODF_B = 0x62D // 1581 SYS___FMODL_B = 0x62E // 1582 SYS___MODFF_B = 0x62F // 1583 SYS___MODFL_B = 0x630 // 1584 SYS_ABSF = 0x631 // 1585 SYS_ABSL = 0x632 // 1586 SYS_ACOSF = 0x633 // 1587 SYS_ACOSL = 0x634 // 1588 SYS_ASINF = 0x635 // 1589 SYS_ASINL = 0x636 // 1590 SYS_ATAN2F = 0x637 // 1591 SYS_ATAN2L = 0x638 // 1592 SYS_ATANF = 0x639 // 1593 SYS_ATANL = 0x63A // 1594 SYS_CEILF = 0x63B // 1595 SYS_CEILL = 0x63C // 1596 SYS_COSF = 0x63D // 1597 SYS_COSL = 0x63E // 1598 SYS_COSHF = 0x63F // 1599 SYS_COSHL = 0x640 // 1600 SYS_EXPF = 0x641 // 1601 SYS_EXPL = 0x642 // 1602 SYS_TANHF = 0x643 // 1603 SYS_TANHL = 0x644 // 1604 SYS_LOG10F = 0x645 // 1605 SYS_LOG10L = 0x646 // 1606 SYS_LOGF = 0x647 // 1607 SYS_LOGL = 0x648 // 1608 SYS_POWF = 0x649 // 1609 SYS_POWL = 0x64A // 1610 SYS_SINF = 0x64B // 1611 SYS_SINL = 0x64C // 1612 SYS_SQRTF = 0x64D // 1613 SYS_SQRTL = 0x64E // 1614 SYS_SINHF = 0x64F // 1615 SYS_SINHL = 0x650 // 1616 SYS_TANF = 0x651 // 1617 SYS_TANL = 0x652 // 1618 SYS_FABSF = 0x653 // 1619 SYS_FABSL = 0x654 // 1620 SYS_FLOORF = 0x655 // 1621 SYS_FLOORL = 0x656 // 1622 SYS_FMODF = 0x657 // 1623 SYS_FMODL = 0x658 // 1624 SYS_FREXPF = 0x659 // 1625 SYS_FREXPL = 0x65A // 1626 SYS_LDEXPF = 0x65B // 1627 SYS_LDEXPL = 0x65C // 1628 SYS_MODFF = 0x65D // 1629 SYS_MODFL = 0x65E // 1630 SYS_BTOWC = 0x65F // 1631 SYS___CHATTR = 0x660 // 1632 SYS___FCHATTR = 0x661 // 1633 SYS___TOCCSID = 0x662 // 1634 SYS___CSNAMETYPE = 0x663 // 1635 SYS___TOCSNAME = 0x664 // 1636 SYS___CCSIDTYPE = 0x665 // 1637 SYS___AE_CORRESTBL_QUERY = 0x666 // 1638 SYS___AE_AUTOCONVERT_STATE = 0x667 // 1639 SYS_DN_FIND = 0x668 // 1640 SYS___GETHOSTBYADDR_A = 0x669 // 1641 SYS___GETHOSTBYNAME_A = 0x66A // 1642 SYS___RES_INIT_A = 0x66B // 1643 SYS___GETHOSTBYADDR_R_A = 0x66C // 1644 SYS___GETHOSTBYNAME_R_A = 0x66D // 1645 SYS___CHARMAP_INIT_A = 0x66E // 1646 SYS___MBLEN_A = 0x66F // 1647 SYS___MBLEN_SB_A = 0x670 // 1648 SYS___MBLEN_STD_A = 0x671 // 1649 SYS___MBLEN_UTF = 0x672 // 1650 SYS___MBSTOWCS_A = 0x673 // 1651 SYS___MBSTOWCS_STD_A = 0x674 // 1652 SYS___MBTOWC_A = 0x675 // 1653 SYS___MBTOWC_ISO1 = 0x676 // 1654 SYS___MBTOWC_SBCS = 0x677 // 1655 SYS___MBTOWC_MBCS = 0x678 // 1656 SYS___MBTOWC_UTF = 0x679 // 1657 SYS___WCSTOMBS_A = 0x67A // 1658 SYS___WCSTOMBS_STD_A = 0x67B // 1659 SYS___WCSWIDTH_A = 0x67C // 1660 SYS___GETGRGID_R_A = 0x67D // 1661 SYS___WCSWIDTH_STD_A = 0x67E // 1662 SYS___WCSWIDTH_ASIA = 0x67F // 1663 SYS___CSID_A = 0x680 // 1664 SYS___CSID_STD_A = 0x681 // 1665 SYS___WCSID_A = 0x682 // 1666 SYS___WCSID_STD_A = 0x683 // 1667 SYS___WCTOMB_A = 0x684 // 1668 SYS___WCTOMB_ISO1 = 0x685 // 1669 SYS___WCTOMB_STD_A = 0x686 // 1670 SYS___WCTOMB_UTF = 0x687 // 1671 SYS___WCWIDTH_A = 0x688 // 1672 SYS___GETGRNAM_R_A = 0x689 // 1673 SYS___WCWIDTH_STD_A = 0x68A // 1674 SYS___WCWIDTH_ASIA = 0x68B // 1675 SYS___GETPWNAM_R_A = 0x68C // 1676 SYS___GETPWUID_R_A = 0x68D // 1677 SYS___GETLOGIN_R_A = 0x68E // 1678 SYS___TTYNAME_R_A = 0x68F // 1679 SYS___READDIR_R_A = 0x690 // 1680 SYS___E2A_S = 0x691 // 1681 SYS___FNMATCH_A = 0x692 // 1682 SYS___FNMATCH_C_A = 0x693 // 1683 SYS___EXECL_A = 0x694 // 1684 SYS___FNMATCH_STD_A = 0x695 // 1685 SYS___REGCOMP_A = 0x696 // 1686 SYS___REGCOMP_STD_A = 0x697 // 1687 SYS___REGERROR_A = 0x698 // 1688 SYS___REGERROR_STD_A = 0x699 // 1689 SYS___REGEXEC_A = 0x69A // 1690 SYS___REGEXEC_STD_A = 0x69B // 1691 SYS___REGFREE_A = 0x69C // 1692 SYS___REGFREE_STD_A = 0x69D // 1693 SYS___STRCOLL_A = 0x69E // 1694 SYS___STRCOLL_C_A = 0x69F // 1695 SYS___EXECLE_A = 0x6A0 // 1696 SYS___STRCOLL_STD_A = 0x6A1 // 1697 SYS___STRXFRM_A = 0x6A2 // 1698 SYS___STRXFRM_C_A = 0x6A3 // 1699 SYS___EXECLP_A = 0x6A4 // 1700 SYS___STRXFRM_STD_A = 0x6A5 // 1701 SYS___WCSCOLL_A = 0x6A6 // 1702 SYS___WCSCOLL_C_A = 0x6A7 // 1703 SYS___WCSCOLL_STD_A = 0x6A8 // 1704 SYS___WCSXFRM_A = 0x6A9 // 1705 SYS___WCSXFRM_C_A = 0x6AA // 1706 SYS___WCSXFRM_STD_A = 0x6AB // 1707 SYS___COLLATE_INIT_A = 0x6AC // 1708 SYS___WCTYPE_A = 0x6AD // 1709 SYS___GET_WCTYPE_STD_A = 0x6AE // 1710 SYS___CTYPE_INIT_A = 0x6AF // 1711 SYS___ISWCTYPE_A = 0x6B0 // 1712 SYS___EXECV_A = 0x6B1 // 1713 SYS___IS_WCTYPE_STD_A = 0x6B2 // 1714 SYS___TOWLOWER_A = 0x6B3 // 1715 SYS___TOWLOWER_STD_A = 0x6B4 // 1716 SYS___TOWUPPER_A = 0x6B5 // 1717 SYS___TOWUPPER_STD_A = 0x6B6 // 1718 SYS___LOCALE_INIT_A = 0x6B7 // 1719 SYS___LOCALECONV_A = 0x6B8 // 1720 SYS___LOCALECONV_STD_A = 0x6B9 // 1721 SYS___NL_LANGINFO_A = 0x6BA // 1722 SYS___NL_LNAGINFO_STD_A = 0x6BB // 1723 SYS___MONETARY_INIT_A = 0x6BC // 1724 SYS___STRFMON_A = 0x6BD // 1725 SYS___STRFMON_STD_A = 0x6BE // 1726 SYS___GETADDRINFO_A = 0x6BF // 1727 SYS___CATGETS_A = 0x6C0 // 1728 SYS___EXECVE_A = 0x6C1 // 1729 SYS___EXECVP_A = 0x6C2 // 1730 SYS___SPAWN_A = 0x6C3 // 1731 SYS___GETNAMEINFO_A = 0x6C4 // 1732 SYS___SPAWNP_A = 0x6C5 // 1733 SYS___NUMERIC_INIT_A = 0x6C6 // 1734 SYS___RESP_INIT_A = 0x6C7 // 1735 SYS___RPMATCH_A = 0x6C8 // 1736 SYS___RPMATCH_C_A = 0x6C9 // 1737 SYS___RPMATCH_STD_A = 0x6CA // 1738 SYS___TIME_INIT_A = 0x6CB // 1739 SYS___STRFTIME_A = 0x6CC // 1740 SYS___STRFTIME_STD_A = 0x6CD // 1741 SYS___STRPTIME_A = 0x6CE // 1742 SYS___STRPTIME_STD_A = 0x6CF // 1743 SYS___WCSFTIME_A = 0x6D0 // 1744 SYS___WCSFTIME_STD_A = 0x6D1 // 1745 SYS_____SPAWN2_A = 0x6D2 // 1746 SYS_____SPAWNP2_A = 0x6D3 // 1747 SYS___SYNTAX_INIT_A = 0x6D4 // 1748 SYS___TOD_INIT_A = 0x6D5 // 1749 SYS___NL_CSINFO_A = 0x6D6 // 1750 SYS___NL_MONINFO_A = 0x6D7 // 1751 SYS___NL_NUMINFO_A = 0x6D8 // 1752 SYS___NL_RESPINFO_A = 0x6D9 // 1753 SYS___NL_TIMINFO_A = 0x6DA // 1754 SYS___IF_NAMETOINDEX_A = 0x6DB // 1755 SYS___IF_INDEXTONAME_A = 0x6DC // 1756 SYS___PRINTF_A = 0x6DD // 1757 SYS___ICONV_OPEN_A = 0x6DE // 1758 SYS___DLLLOAD_A = 0x6DF // 1759 SYS___DLLQUERYFN_A = 0x6E0 // 1760 SYS___DLLQUERYVAR_A = 0x6E1 // 1761 SYS_____CHATTR_A = 0x6E2 // 1762 SYS___E2A_L = 0x6E3 // 1763 SYS_____TOCCSID_A = 0x6E4 // 1764 SYS_____TOCSNAME_A = 0x6E5 // 1765 SYS_____CCSIDTYPE_A = 0x6E6 // 1766 SYS_____CSNAMETYPE_A = 0x6E7 // 1767 SYS___CHMOD_A = 0x6E8 // 1768 SYS___MKDIR_A = 0x6E9 // 1769 SYS___STAT_A = 0x6EA // 1770 SYS___STAT_O_A = 0x6EB // 1771 SYS___MKFIFO_A = 0x6EC // 1772 SYS_____OPEN_STAT_A = 0x6ED // 1773 SYS___LSTAT_A = 0x6EE // 1774 SYS___LSTAT_O_A = 0x6EF // 1775 SYS___MKNOD_A = 0x6F0 // 1776 SYS___MOUNT_A = 0x6F1 // 1777 SYS___UMOUNT_A = 0x6F2 // 1778 SYS___CHAUDIT_A = 0x6F4 // 1780 SYS___W_GETMNTENT_A = 0x6F5 // 1781 SYS___CREAT_A = 0x6F6 // 1782 SYS___OPEN_A = 0x6F7 // 1783 SYS___SETLOCALE_A = 0x6F9 // 1785 SYS___FPRINTF_A = 0x6FA // 1786 SYS___SPRINTF_A = 0x6FB // 1787 SYS___VFPRINTF_A = 0x6FC // 1788 SYS___VPRINTF_A = 0x6FD // 1789 SYS___VSPRINTF_A = 0x6FE // 1790 SYS___VSWPRINTF_A = 0x6FF // 1791 SYS___SWPRINTF_A = 0x700 // 1792 SYS___FSCANF_A = 0x701 // 1793 SYS___SCANF_A = 0x702 // 1794 SYS___SSCANF_A = 0x703 // 1795 SYS___SWSCANF_A = 0x704 // 1796 SYS___ATOF_A = 0x705 // 1797 SYS___ATOI_A = 0x706 // 1798 SYS___ATOL_A = 0x707 // 1799 SYS___STRTOD_A = 0x708 // 1800 SYS___STRTOL_A = 0x709 // 1801 SYS___STRTOUL_A = 0x70A // 1802 SYS_____AE_CORRESTBL_QUERY_A = 0x70B // 1803 SYS___A64L_A = 0x70C // 1804 SYS___ECVT_A = 0x70D // 1805 SYS___FCVT_A = 0x70E // 1806 SYS___GCVT_A = 0x70F // 1807 SYS___L64A_A = 0x710 // 1808 SYS___STRERROR_A = 0x711 // 1809 SYS___PERROR_A = 0x712 // 1810 SYS___FETCH_A = 0x713 // 1811 SYS___GETENV_A = 0x714 // 1812 SYS___MKSTEMP_A = 0x717 // 1815 SYS___PTSNAME_A = 0x718 // 1816 SYS___PUTENV_A = 0x719 // 1817 SYS___REALPATH_A = 0x71A // 1818 SYS___SETENV_A = 0x71B // 1819 SYS___SYSTEM_A = 0x71C // 1820 SYS___GETOPT_A = 0x71D // 1821 SYS___CATOPEN_A = 0x71E // 1822 SYS___ACCESS_A = 0x71F // 1823 SYS___CHDIR_A = 0x720 // 1824 SYS___CHOWN_A = 0x721 // 1825 SYS___CHROOT_A = 0x722 // 1826 SYS___GETCWD_A = 0x723 // 1827 SYS___GETWD_A = 0x724 // 1828 SYS___LCHOWN_A = 0x725 // 1829 SYS___LINK_A = 0x726 // 1830 SYS___PATHCONF_A = 0x727 // 1831 SYS___IF_NAMEINDEX_A = 0x728 // 1832 SYS___READLINK_A = 0x729 // 1833 SYS___RMDIR_A = 0x72A // 1834 SYS___STATVFS_A = 0x72B // 1835 SYS___SYMLINK_A = 0x72C // 1836 SYS___TRUNCATE_A = 0x72D // 1837 SYS___UNLINK_A = 0x72E // 1838 SYS___GAI_STRERROR_A = 0x72F // 1839 SYS___EXTLINK_NP_A = 0x730 // 1840 SYS___ISALNUM_A = 0x731 // 1841 SYS___ISALPHA_A = 0x732 // 1842 SYS___A2E_S = 0x733 // 1843 SYS___ISCNTRL_A = 0x734 // 1844 SYS___ISDIGIT_A = 0x735 // 1845 SYS___ISGRAPH_A = 0x736 // 1846 SYS___ISLOWER_A = 0x737 // 1847 SYS___ISPRINT_A = 0x738 // 1848 SYS___ISPUNCT_A = 0x739 // 1849 SYS___ISSPACE_A = 0x73A // 1850 SYS___ISUPPER_A = 0x73B // 1851 SYS___ISXDIGIT_A = 0x73C // 1852 SYS___TOLOWER_A = 0x73D // 1853 SYS___TOUPPER_A = 0x73E // 1854 SYS___ISWALNUM_A = 0x73F // 1855 SYS___ISWALPHA_A = 0x740 // 1856 SYS___A2E_L = 0x741 // 1857 SYS___ISWCNTRL_A = 0x742 // 1858 SYS___ISWDIGIT_A = 0x743 // 1859 SYS___ISWGRAPH_A = 0x744 // 1860 SYS___ISWLOWER_A = 0x745 // 1861 SYS___ISWPRINT_A = 0x746 // 1862 SYS___ISWPUNCT_A = 0x747 // 1863 SYS___ISWSPACE_A = 0x748 // 1864 SYS___ISWUPPER_A = 0x749 // 1865 SYS___ISWXDIGIT_A = 0x74A // 1866 SYS___CONFSTR_A = 0x74B // 1867 SYS___FTOK_A = 0x74C // 1868 SYS___MKTEMP_A = 0x74D // 1869 SYS___FDOPEN_A = 0x74E // 1870 SYS___FLDATA_A = 0x74F // 1871 SYS___REMOVE_A = 0x750 // 1872 SYS___RENAME_A = 0x751 // 1873 SYS___TMPNAM_A = 0x752 // 1874 SYS___FOPEN_A = 0x753 // 1875 SYS___FREOPEN_A = 0x754 // 1876 SYS___CUSERID_A = 0x755 // 1877 SYS___POPEN_A = 0x756 // 1878 SYS___TEMPNAM_A = 0x757 // 1879 SYS___FTW_A = 0x758 // 1880 SYS___GETGRENT_A = 0x759 // 1881 SYS___GETGRGID_A = 0x75A // 1882 SYS___GETGRNAM_A = 0x75B // 1883 SYS___GETGROUPSBYNAME_A = 0x75C // 1884 SYS___GETHOSTENT_A = 0x75D // 1885 SYS___GETHOSTNAME_A = 0x75E // 1886 SYS___GETLOGIN_A = 0x75F // 1887 SYS___INET_NTOP_A = 0x760 // 1888 SYS___GETPASS_A = 0x761 // 1889 SYS___GETPWENT_A = 0x762 // 1890 SYS___GETPWNAM_A = 0x763 // 1891 SYS___GETPWUID_A = 0x764 // 1892 SYS_____CHECK_RESOURCE_AUTH_NP_A = 0x765 // 1893 SYS___CHECKSCHENV_A = 0x766 // 1894 SYS___CONNECTSERVER_A = 0x767 // 1895 SYS___CONNECTWORKMGR_A = 0x768 // 1896 SYS_____CONSOLE_A = 0x769 // 1897 SYS___CREATEWORKUNIT_A = 0x76A // 1898 SYS___CTERMID_A = 0x76B // 1899 SYS___FMTMSG_A = 0x76C // 1900 SYS___INITGROUPS_A = 0x76D // 1901 SYS_____LOGIN_A = 0x76E // 1902 SYS___MSGRCV_A = 0x76F // 1903 SYS___MSGSND_A = 0x770 // 1904 SYS___MSGXRCV_A = 0x771 // 1905 SYS___NFTW_A = 0x772 // 1906 SYS_____PASSWD_A = 0x773 // 1907 SYS___PTHREAD_SECURITY_NP_A = 0x774 // 1908 SYS___QUERYMETRICS_A = 0x775 // 1909 SYS___QUERYSCHENV = 0x776 // 1910 SYS___READV_A = 0x777 // 1911 SYS_____SERVER_CLASSIFY_A = 0x778 // 1912 SYS_____SERVER_INIT_A = 0x779 // 1913 SYS_____SERVER_PWU_A = 0x77A // 1914 SYS___STRCASECMP_A = 0x77B // 1915 SYS___STRNCASECMP_A = 0x77C // 1916 SYS___TTYNAME_A = 0x77D // 1917 SYS___UNAME_A = 0x77E // 1918 SYS___UTIMES_A = 0x77F // 1919 SYS___W_GETPSENT_A = 0x780 // 1920 SYS___WRITEV_A = 0x781 // 1921 SYS___W_STATFS_A = 0x782 // 1922 SYS___W_STATVFS_A = 0x783 // 1923 SYS___FPUTC_A = 0x784 // 1924 SYS___PUTCHAR_A = 0x785 // 1925 SYS___PUTS_A = 0x786 // 1926 SYS___FGETS_A = 0x787 // 1927 SYS___GETS_A = 0x788 // 1928 SYS___FPUTS_A = 0x789 // 1929 SYS___FREAD_A = 0x78A // 1930 SYS___FWRITE_A = 0x78B // 1931 SYS___OPEN_O_A = 0x78C // 1932 SYS___ISASCII = 0x78D // 1933 SYS___CREAT_O_A = 0x78E // 1934 SYS___ENVNA = 0x78F // 1935 SYS___PUTC_A = 0x790 // 1936 SYS___AE_THREAD_SETMODE = 0x791 // 1937 SYS___AE_THREAD_SWAPMODE = 0x792 // 1938 SYS___GETNETBYADDR_A = 0x793 // 1939 SYS___GETNETBYNAME_A = 0x794 // 1940 SYS___GETNETENT_A = 0x795 // 1941 SYS___GETPROTOBYNAME_A = 0x796 // 1942 SYS___GETPROTOBYNUMBER_A = 0x797 // 1943 SYS___GETPROTOENT_A = 0x798 // 1944 SYS___GETSERVBYNAME_A = 0x799 // 1945 SYS___GETSERVBYPORT_A = 0x79A // 1946 SYS___GETSERVENT_A = 0x79B // 1947 SYS___ASCTIME_A = 0x79C // 1948 SYS___CTIME_A = 0x79D // 1949 SYS___GETDATE_A = 0x79E // 1950 SYS___TZSET_A = 0x79F // 1951 SYS___UTIME_A = 0x7A0 // 1952 SYS___ASCTIME_R_A = 0x7A1 // 1953 SYS___CTIME_R_A = 0x7A2 // 1954 SYS___STRTOLL_A = 0x7A3 // 1955 SYS___STRTOULL_A = 0x7A4 // 1956 SYS___FPUTWC_A = 0x7A5 // 1957 SYS___PUTWC_A = 0x7A6 // 1958 SYS___PUTWCHAR_A = 0x7A7 // 1959 SYS___FPUTWS_A = 0x7A8 // 1960 SYS___UNGETWC_A = 0x7A9 // 1961 SYS___FGETWC_A = 0x7AA // 1962 SYS___GETWC_A = 0x7AB // 1963 SYS___GETWCHAR_A = 0x7AC // 1964 SYS___FGETWS_A = 0x7AD // 1965 SYS___GETTIMEOFDAY_A = 0x7AE // 1966 SYS___GMTIME_A = 0x7AF // 1967 SYS___GMTIME_R_A = 0x7B0 // 1968 SYS___LOCALTIME_A = 0x7B1 // 1969 SYS___LOCALTIME_R_A = 0x7B2 // 1970 SYS___MKTIME_A = 0x7B3 // 1971 SYS___TZZNA = 0x7B4 // 1972 SYS_UNATEXIT = 0x7B5 // 1973 SYS___CEE3DMP_A = 0x7B6 // 1974 SYS___CDUMP_A = 0x7B7 // 1975 SYS___CSNAP_A = 0x7B8 // 1976 SYS___CTEST_A = 0x7B9 // 1977 SYS___CTRACE_A = 0x7BA // 1978 SYS___VSWPRNTF2_A = 0x7BB // 1979 SYS___INET_PTON_A = 0x7BC // 1980 SYS___SYSLOG_A = 0x7BD // 1981 SYS___CRYPT_A = 0x7BE // 1982 SYS_____OPENDIR2_A = 0x7BF // 1983 SYS_____READDIR2_A = 0x7C0 // 1984 SYS___OPENDIR_A = 0x7C2 // 1986 SYS___READDIR_A = 0x7C3 // 1987 SYS_PREAD = 0x7C7 // 1991 SYS_PWRITE = 0x7C8 // 1992 SYS_M_CREATE_LAYOUT = 0x7C9 // 1993 SYS_M_DESTROY_LAYOUT = 0x7CA // 1994 SYS_M_GETVALUES_LAYOUT = 0x7CB // 1995 SYS_M_SETVALUES_LAYOUT = 0x7CC // 1996 SYS_M_TRANSFORM_LAYOUT = 0x7CD // 1997 SYS_M_WTRANSFORM_LAYOUT = 0x7CE // 1998 SYS_FWPRINTF = 0x7D1 // 2001 SYS_WPRINTF = 0x7D2 // 2002 SYS_VFWPRINT = 0x7D3 // 2003 SYS_VFWPRINTF = 0x7D3 // 2003 SYS_VWPRINTF = 0x7D4 // 2004 SYS_FWSCANF = 0x7D5 // 2005 SYS_WSCANF = 0x7D6 // 2006 SYS_WCTRANS = 0x7D7 // 2007 SYS_TOWCTRAN = 0x7D8 // 2008 SYS_TOWCTRANS = 0x7D8 // 2008 SYS___WCSTOD_A = 0x7D9 // 2009 SYS___WCSTOL_A = 0x7DA // 2010 SYS___WCSTOUL_A = 0x7DB // 2011 SYS___BASENAME_A = 0x7DC // 2012 SYS___DIRNAME_A = 0x7DD // 2013 SYS___GLOB_A = 0x7DE // 2014 SYS_FWIDE = 0x7DF // 2015 SYS___OSNAME = 0x7E0 // 2016 SYS_____OSNAME_A = 0x7E1 // 2017 SYS___BTOWC_A = 0x7E4 // 2020 SYS___WCTOB_A = 0x7E5 // 2021 SYS___DBM_OPEN_A = 0x7E6 // 2022 SYS___VFPRINTF2_A = 0x7E7 // 2023 SYS___VPRINTF2_A = 0x7E8 // 2024 SYS___VSPRINTF2_A = 0x7E9 // 2025 SYS___CEIL_H = 0x7EA // 2026 SYS___FLOOR_H = 0x7EB // 2027 SYS___MODF_H = 0x7EC // 2028 SYS___FABS_H = 0x7ED // 2029 SYS___J0_H = 0x7EE // 2030 SYS___J1_H = 0x7EF // 2031 SYS___JN_H = 0x7F0 // 2032 SYS___Y0_H = 0x7F1 // 2033 SYS___Y1_H = 0x7F2 // 2034 SYS___YN_H = 0x7F3 // 2035 SYS___CEILF_H = 0x7F4 // 2036 SYS___CEILL_H = 0x7F5 // 2037 SYS___FLOORF_H = 0x7F6 // 2038 SYS___FLOORL_H = 0x7F7 // 2039 SYS___MODFF_H = 0x7F8 // 2040 SYS___MODFL_H = 0x7F9 // 2041 SYS___FABSF_H = 0x7FA // 2042 SYS___FABSL_H = 0x7FB // 2043 SYS___MALLOC24 = 0x7FC // 2044 SYS___MALLOC31 = 0x7FD // 2045 SYS_ACL_INIT = 0x7FE // 2046 SYS_ACL_FREE = 0x7FF // 2047 SYS_ACL_FIRST_ENTRY = 0x800 // 2048 SYS_ACL_GET_ENTRY = 0x801 // 2049 SYS_ACL_VALID = 0x802 // 2050 SYS_ACL_CREATE_ENTRY = 0x803 // 2051 SYS_ACL_DELETE_ENTRY = 0x804 // 2052 SYS_ACL_UPDATE_ENTRY = 0x805 // 2053 SYS_ACL_DELETE_FD = 0x806 // 2054 SYS_ACL_DELETE_FILE = 0x807 // 2055 SYS_ACL_GET_FD = 0x808 // 2056 SYS_ACL_GET_FILE = 0x809 // 2057 SYS_ACL_SET_FD = 0x80A // 2058 SYS_ACL_SET_FILE = 0x80B // 2059 SYS_ACL_FROM_TEXT = 0x80C // 2060 SYS_ACL_TO_TEXT = 0x80D // 2061 SYS_ACL_SORT = 0x80E // 2062 SYS___SHUTDOWN_REGISTRATION = 0x80F // 2063 SYS___ERFL_B = 0x810 // 2064 SYS___ERFCL_B = 0x811 // 2065 SYS___LGAMMAL_B = 0x812 // 2066 SYS___SETHOOKEVENTS = 0x813 // 2067 SYS_IF_NAMETOINDEX = 0x814 // 2068 SYS_IF_INDEXTONAME = 0x815 // 2069 SYS_IF_NAMEINDEX = 0x816 // 2070 SYS_IF_FREENAMEINDEX = 0x817 // 2071 SYS_GETADDRINFO = 0x818 // 2072 SYS_GETNAMEINFO = 0x819 // 2073 SYS_FREEADDRINFO = 0x81A // 2074 SYS_GAI_STRERROR = 0x81B // 2075 SYS_REXEC_AF = 0x81C // 2076 SYS___POE = 0x81D // 2077 SYS___DYNALLOC_A = 0x81F // 2079 SYS___DYNFREE_A = 0x820 // 2080 SYS___RES_QUERY_A = 0x821 // 2081 SYS___RES_SEARCH_A = 0x822 // 2082 SYS___RES_QUERYDOMAIN_A = 0x823 // 2083 SYS___RES_MKQUERY_A = 0x824 // 2084 SYS___RES_SEND_A = 0x825 // 2085 SYS___DN_EXPAND_A = 0x826 // 2086 SYS___DN_SKIPNAME_A = 0x827 // 2087 SYS___DN_COMP_A = 0x828 // 2088 SYS___DN_FIND_A = 0x829 // 2089 SYS___NLIST_A = 0x82A // 2090 SYS_____TCGETCP_A = 0x82B // 2091 SYS_____TCSETCP_A = 0x82C // 2092 SYS_____W_PIOCTL_A = 0x82E // 2094 SYS___INET_ADDR_A = 0x82F // 2095 SYS___INET_NTOA_A = 0x830 // 2096 SYS___INET_NETWORK_A = 0x831 // 2097 SYS___ACCEPT_A = 0x832 // 2098 SYS___ACCEPT_AND_RECV_A = 0x833 // 2099 SYS___BIND_A = 0x834 // 2100 SYS___CONNECT_A = 0x835 // 2101 SYS___GETPEERNAME_A = 0x836 // 2102 SYS___GETSOCKNAME_A = 0x837 // 2103 SYS___RECVFROM_A = 0x838 // 2104 SYS___SENDTO_A = 0x839 // 2105 SYS___SENDMSG_A = 0x83A // 2106 SYS___RECVMSG_A = 0x83B // 2107 SYS_____LCHATTR_A = 0x83C // 2108 SYS___CABEND = 0x83D // 2109 SYS___LE_CIB_GET = 0x83E // 2110 SYS___SET_LAA_FOR_JIT = 0x83F // 2111 SYS___LCHATTR = 0x840 // 2112 SYS___WRITEDOWN = 0x841 // 2113 SYS_PTHREAD_MUTEX_INIT2 = 0x842 // 2114 SYS___ACOSHF_B = 0x843 // 2115 SYS___ACOSHL_B = 0x844 // 2116 SYS___ASINHF_B = 0x845 // 2117 SYS___ASINHL_B = 0x846 // 2118 SYS___ATANHF_B = 0x847 // 2119 SYS___ATANHL_B = 0x848 // 2120 SYS___CBRTF_B = 0x849 // 2121 SYS___CBRTL_B = 0x84A // 2122 SYS___COPYSIGNF_B = 0x84B // 2123 SYS___COPYSIGNL_B = 0x84C // 2124 SYS___COTANF_B = 0x84D // 2125 SYS___COTAN_B = 0x84E // 2126 SYS___COTANL_B = 0x84F // 2127 SYS___EXP2F_B = 0x850 // 2128 SYS___EXP2L_B = 0x851 // 2129 SYS___EXPM1F_B = 0x852 // 2130 SYS___EXPM1L_B = 0x853 // 2131 SYS___FDIMF_B = 0x854 // 2132 SYS___FDIM_B = 0x855 // 2133 SYS___FDIML_B = 0x856 // 2134 SYS___HYPOTF_B = 0x857 // 2135 SYS___HYPOTL_B = 0x858 // 2136 SYS___LOG1PF_B = 0x859 // 2137 SYS___LOG1PL_B = 0x85A // 2138 SYS___LOG2F_B = 0x85B // 2139 SYS___LOG2_B = 0x85C // 2140 SYS___LOG2L_B = 0x85D // 2141 SYS___REMAINDERF_B = 0x85E // 2142 SYS___REMAINDERL_B = 0x85F // 2143 SYS___REMQUOF_B = 0x860 // 2144 SYS___REMQUO_B = 0x861 // 2145 SYS___REMQUOL_B = 0x862 // 2146 SYS___TGAMMAF_B = 0x863 // 2147 SYS___TGAMMA_B = 0x864 // 2148 SYS___TGAMMAL_B = 0x865 // 2149 SYS___TRUNCF_B = 0x866 // 2150 SYS___TRUNC_B = 0x867 // 2151 SYS___TRUNCL_B = 0x868 // 2152 SYS___LGAMMAF_B = 0x869 // 2153 SYS___LROUNDF_B = 0x86A // 2154 SYS___LROUND_B = 0x86B // 2155 SYS___ERFF_B = 0x86C // 2156 SYS___ERFCF_B = 0x86D // 2157 SYS_ACOSHF = 0x86E // 2158 SYS_ACOSHL = 0x86F // 2159 SYS_ASINHF = 0x870 // 2160 SYS_ASINHL = 0x871 // 2161 SYS_ATANHF = 0x872 // 2162 SYS_ATANHL = 0x873 // 2163 SYS_CBRTF = 0x874 // 2164 SYS_CBRTL = 0x875 // 2165 SYS_COPYSIGNF = 0x876 // 2166 SYS_CPYSIGNF = 0x876 // 2166 SYS_COPYSIGNL = 0x877 // 2167 SYS_CPYSIGNL = 0x877 // 2167 SYS_COTANF = 0x878 // 2168 SYS___COTANF = 0x878 // 2168 SYS_COTAN = 0x879 // 2169 SYS___COTAN = 0x879 // 2169 SYS_COTANL = 0x87A // 2170 SYS___COTANL = 0x87A // 2170 SYS_EXP2F = 0x87B // 2171 SYS_EXP2L = 0x87C // 2172 SYS_EXPM1F = 0x87D // 2173 SYS_EXPM1L = 0x87E // 2174 SYS_FDIMF = 0x87F // 2175 SYS_FDIM = 0x881 // 2177 SYS_FDIML = 0x882 // 2178 SYS_HYPOTF = 0x883 // 2179 SYS_HYPOTL = 0x884 // 2180 SYS_LOG1PF = 0x885 // 2181 SYS_LOG1PL = 0x886 // 2182 SYS_LOG2F = 0x887 // 2183 SYS_LOG2 = 0x888 // 2184 SYS_LOG2L = 0x889 // 2185 SYS_REMAINDERF = 0x88A // 2186 SYS_REMAINDF = 0x88A // 2186 SYS_REMAINDERL = 0x88B // 2187 SYS_REMAINDL = 0x88B // 2187 SYS_REMQUOF = 0x88C // 2188 SYS_REMQUO = 0x88D // 2189 SYS_REMQUOL = 0x88E // 2190 SYS_TGAMMAF = 0x88F // 2191 SYS_TGAMMA = 0x890 // 2192 SYS_TGAMMAL = 0x891 // 2193 SYS_TRUNCF = 0x892 // 2194 SYS_TRUNC = 0x893 // 2195 SYS_TRUNCL = 0x894 // 2196 SYS_LGAMMAF = 0x895 // 2197 SYS_LGAMMAL = 0x896 // 2198 SYS_LROUNDF = 0x897 // 2199 SYS_LROUND = 0x898 // 2200 SYS_ERFF = 0x899 // 2201 SYS_ERFL = 0x89A // 2202 SYS_ERFCF = 0x89B // 2203 SYS_ERFCL = 0x89C // 2204 SYS___EXP2_B = 0x89D // 2205 SYS_EXP2 = 0x89E // 2206 SYS___FAR_JUMP = 0x89F // 2207 SYS___TCGETATTR_A = 0x8A1 // 2209 SYS___TCSETATTR_A = 0x8A2 // 2210 SYS___SUPERKILL = 0x8A4 // 2212 SYS___LE_CONDITION_TOKEN_BUILD = 0x8A5 // 2213 SYS___LE_MSG_ADD_INSERT = 0x8A6 // 2214 SYS___LE_MSG_GET = 0x8A7 // 2215 SYS___LE_MSG_GET_AND_WRITE = 0x8A8 // 2216 SYS___LE_MSG_WRITE = 0x8A9 // 2217 SYS___ITOA = 0x8AA // 2218 SYS___UTOA = 0x8AB // 2219 SYS___LTOA = 0x8AC // 2220 SYS___ULTOA = 0x8AD // 2221 SYS___LLTOA = 0x8AE // 2222 SYS___ULLTOA = 0x8AF // 2223 SYS___ITOA_A = 0x8B0 // 2224 SYS___UTOA_A = 0x8B1 // 2225 SYS___LTOA_A = 0x8B2 // 2226 SYS___ULTOA_A = 0x8B3 // 2227 SYS___LLTOA_A = 0x8B4 // 2228 SYS___ULLTOA_A = 0x8B5 // 2229 SYS_____GETENV_A = 0x8C3 // 2243 SYS___REXEC_A = 0x8C4 // 2244 SYS___REXEC_AF_A = 0x8C5 // 2245 SYS___GETUTXENT_A = 0x8C6 // 2246 SYS___GETUTXID_A = 0x8C7 // 2247 SYS___GETUTXLINE_A = 0x8C8 // 2248 SYS___PUTUTXLINE_A = 0x8C9 // 2249 SYS_____UTMPXNAME_A = 0x8CA // 2250 SYS___PUTC_UNLOCKED_A = 0x8CB // 2251 SYS___PUTCHAR_UNLOCKED_A = 0x8CC // 2252 SYS___SNPRINTF_A = 0x8CD // 2253 SYS___VSNPRINTF_A = 0x8CE // 2254 SYS___DLOPEN_A = 0x8D0 // 2256 SYS___DLSYM_A = 0x8D1 // 2257 SYS___DLERROR_A = 0x8D2 // 2258 SYS_FLOCKFILE = 0x8D3 // 2259 SYS_FTRYLOCKFILE = 0x8D4 // 2260 SYS_FUNLOCKFILE = 0x8D5 // 2261 SYS_GETC_UNLOCKED = 0x8D6 // 2262 SYS_GETCHAR_UNLOCKED = 0x8D7 // 2263 SYS_PUTC_UNLOCKED = 0x8D8 // 2264 SYS_PUTCHAR_UNLOCKED = 0x8D9 // 2265 SYS_SNPRINTF = 0x8DA // 2266 SYS_VSNPRINTF = 0x8DB // 2267 SYS_DLOPEN = 0x8DD // 2269 SYS_DLSYM = 0x8DE // 2270 SYS_DLCLOSE = 0x8DF // 2271 SYS_DLERROR = 0x8E0 // 2272 SYS___SET_EXCEPTION_HANDLER = 0x8E2 // 2274 SYS___RESET_EXCEPTION_HANDLER = 0x8E3 // 2275 SYS___VHM_EVENT = 0x8E4 // 2276 SYS___ABS_H = 0x8E6 // 2278 SYS___ABSF_H = 0x8E7 // 2279 SYS___ABSL_H = 0x8E8 // 2280 SYS___ACOS_H = 0x8E9 // 2281 SYS___ACOSF_H = 0x8EA // 2282 SYS___ACOSL_H = 0x8EB // 2283 SYS___ACOSH_H = 0x8EC // 2284 SYS___ASIN_H = 0x8ED // 2285 SYS___ASINF_H = 0x8EE // 2286 SYS___ASINL_H = 0x8EF // 2287 SYS___ASINH_H = 0x8F0 // 2288 SYS___ATAN_H = 0x8F1 // 2289 SYS___ATANF_H = 0x8F2 // 2290 SYS___ATANL_H = 0x8F3 // 2291 SYS___ATANH_H = 0x8F4 // 2292 SYS___ATANHF_H = 0x8F5 // 2293 SYS___ATANHL_H = 0x8F6 // 2294 SYS___ATAN2_H = 0x8F7 // 2295 SYS___ATAN2F_H = 0x8F8 // 2296 SYS___ATAN2L_H = 0x8F9 // 2297 SYS___CBRT_H = 0x8FA // 2298 SYS___COPYSIGNF_H = 0x8FB // 2299 SYS___COPYSIGNL_H = 0x8FC // 2300 SYS___COS_H = 0x8FD // 2301 SYS___COSF_H = 0x8FE // 2302 SYS___COSL_H = 0x8FF // 2303 SYS___COSHF_H = 0x900 // 2304 SYS___COSHL_H = 0x901 // 2305 SYS___COTAN_H = 0x902 // 2306 SYS___COTANF_H = 0x903 // 2307 SYS___COTANL_H = 0x904 // 2308 SYS___ERF_H = 0x905 // 2309 SYS___ERFF_H = 0x906 // 2310 SYS___ERFL_H = 0x907 // 2311 SYS___ERFC_H = 0x908 // 2312 SYS___ERFCF_H = 0x909 // 2313 SYS___ERFCL_H = 0x90A // 2314 SYS___EXP_H = 0x90B // 2315 SYS___EXPF_H = 0x90C // 2316 SYS___EXPL_H = 0x90D // 2317 SYS___EXPM1_H = 0x90E // 2318 SYS___FDIM_H = 0x90F // 2319 SYS___FDIMF_H = 0x910 // 2320 SYS___FDIML_H = 0x911 // 2321 SYS___FMOD_H = 0x912 // 2322 SYS___FMODF_H = 0x913 // 2323 SYS___FMODL_H = 0x914 // 2324 SYS___GAMMA_H = 0x915 // 2325 SYS___HYPOT_H = 0x916 // 2326 SYS___ILOGB_H = 0x917 // 2327 SYS___LGAMMA_H = 0x918 // 2328 SYS___LGAMMAF_H = 0x919 // 2329 SYS___LOG_H = 0x91A // 2330 SYS___LOGF_H = 0x91B // 2331 SYS___LOGL_H = 0x91C // 2332 SYS___LOGB_H = 0x91D // 2333 SYS___LOG2_H = 0x91E // 2334 SYS___LOG2F_H = 0x91F // 2335 SYS___LOG2L_H = 0x920 // 2336 SYS___LOG1P_H = 0x921 // 2337 SYS___LOG10_H = 0x922 // 2338 SYS___LOG10F_H = 0x923 // 2339 SYS___LOG10L_H = 0x924 // 2340 SYS___LROUND_H = 0x925 // 2341 SYS___LROUNDF_H = 0x926 // 2342 SYS___NEXTAFTER_H = 0x927 // 2343 SYS___POW_H = 0x928 // 2344 SYS___POWF_H = 0x929 // 2345 SYS___POWL_H = 0x92A // 2346 SYS___REMAINDER_H = 0x92B // 2347 SYS___RINT_H = 0x92C // 2348 SYS___SCALB_H = 0x92D // 2349 SYS___SIN_H = 0x92E // 2350 SYS___SINF_H = 0x92F // 2351 SYS___SINL_H = 0x930 // 2352 SYS___SINH_H = 0x931 // 2353 SYS___SINHF_H = 0x932 // 2354 SYS___SINHL_H = 0x933 // 2355 SYS___SQRT_H = 0x934 // 2356 SYS___SQRTF_H = 0x935 // 2357 SYS___SQRTL_H = 0x936 // 2358 SYS___TAN_H = 0x937 // 2359 SYS___TANF_H = 0x938 // 2360 SYS___TANL_H = 0x939 // 2361 SYS___TANH_H = 0x93A // 2362 SYS___TANHF_H = 0x93B // 2363 SYS___TANHL_H = 0x93C // 2364 SYS___TGAMMA_H = 0x93D // 2365 SYS___TGAMMAF_H = 0x93E // 2366 SYS___TRUNC_H = 0x93F // 2367 SYS___TRUNCF_H = 0x940 // 2368 SYS___TRUNCL_H = 0x941 // 2369 SYS___COSH_H = 0x942 // 2370 SYS___LE_DEBUG_SET_RESUME_MCH = 0x943 // 2371 SYS_VFSCANF = 0x944 // 2372 SYS_VSCANF = 0x946 // 2374 SYS_VSSCANF = 0x948 // 2376 SYS_VFWSCANF = 0x94A // 2378 SYS_VWSCANF = 0x94C // 2380 SYS_VSWSCANF = 0x94E // 2382 SYS_IMAXABS = 0x950 // 2384 SYS_IMAXDIV = 0x951 // 2385 SYS_STRTOIMAX = 0x952 // 2386 SYS_STRTOUMAX = 0x953 // 2387 SYS_WCSTOIMAX = 0x954 // 2388 SYS_WCSTOUMAX = 0x955 // 2389 SYS_ATOLL = 0x956 // 2390 SYS_STRTOF = 0x957 // 2391 SYS_STRTOLD = 0x958 // 2392 SYS_WCSTOF = 0x959 // 2393 SYS_WCSTOLD = 0x95A // 2394 SYS_INET6_RTH_SPACE = 0x95B // 2395 SYS_INET6_RTH_INIT = 0x95C // 2396 SYS_INET6_RTH_ADD = 0x95D // 2397 SYS_INET6_RTH_REVERSE = 0x95E // 2398 SYS_INET6_RTH_SEGMENTS = 0x95F // 2399 SYS_INET6_RTH_GETADDR = 0x960 // 2400 SYS_INET6_OPT_INIT = 0x961 // 2401 SYS_INET6_OPT_APPEND = 0x962 // 2402 SYS_INET6_OPT_FINISH = 0x963 // 2403 SYS_INET6_OPT_SET_VAL = 0x964 // 2404 SYS_INET6_OPT_NEXT = 0x965 // 2405 SYS_INET6_OPT_FIND = 0x966 // 2406 SYS_INET6_OPT_GET_VAL = 0x967 // 2407 SYS___POW_I = 0x987 // 2439 SYS___POW_I_B = 0x988 // 2440 SYS___POW_I_H = 0x989 // 2441 SYS___POW_II = 0x98A // 2442 SYS___POW_II_B = 0x98B // 2443 SYS___POW_II_H = 0x98C // 2444 SYS_CABS = 0x98E // 2446 SYS___CABS_B = 0x98F // 2447 SYS___CABS_H = 0x990 // 2448 SYS_CABSF = 0x991 // 2449 SYS___CABSF_B = 0x992 // 2450 SYS___CABSF_H = 0x993 // 2451 SYS_CABSL = 0x994 // 2452 SYS___CABSL_B = 0x995 // 2453 SYS___CABSL_H = 0x996 // 2454 SYS_CACOS = 0x997 // 2455 SYS___CACOS_B = 0x998 // 2456 SYS___CACOS_H = 0x999 // 2457 SYS_CACOSF = 0x99A // 2458 SYS___CACOSF_B = 0x99B // 2459 SYS___CACOSF_H = 0x99C // 2460 SYS_CACOSL = 0x99D // 2461 SYS___CACOSL_B = 0x99E // 2462 SYS___CACOSL_H = 0x99F // 2463 SYS_CACOSH = 0x9A0 // 2464 SYS___CACOSH_B = 0x9A1 // 2465 SYS___CACOSH_H = 0x9A2 // 2466 SYS_CACOSHF = 0x9A3 // 2467 SYS___CACOSHF_B = 0x9A4 // 2468 SYS___CACOSHF_H = 0x9A5 // 2469 SYS_CACOSHL = 0x9A6 // 2470 SYS___CACOSHL_B = 0x9A7 // 2471 SYS___CACOSHL_H = 0x9A8 // 2472 SYS_CARG = 0x9A9 // 2473 SYS___CARG_B = 0x9AA // 2474 SYS___CARG_H = 0x9AB // 2475 SYS_CARGF = 0x9AC // 2476 SYS___CARGF_B = 0x9AD // 2477 SYS___CARGF_H = 0x9AE // 2478 SYS_CARGL = 0x9AF // 2479 SYS___CARGL_B = 0x9B0 // 2480 SYS___CARGL_H = 0x9B1 // 2481 SYS_CASIN = 0x9B2 // 2482 SYS___CASIN_B = 0x9B3 // 2483 SYS___CASIN_H = 0x9B4 // 2484 SYS_CASINF = 0x9B5 // 2485 SYS___CASINF_B = 0x9B6 // 2486 SYS___CASINF_H = 0x9B7 // 2487 SYS_CASINL = 0x9B8 // 2488 SYS___CASINL_B = 0x9B9 // 2489 SYS___CASINL_H = 0x9BA // 2490 SYS_CASINH = 0x9BB // 2491 SYS___CASINH_B = 0x9BC // 2492 SYS___CASINH_H = 0x9BD // 2493 SYS_CASINHF = 0x9BE // 2494 SYS___CASINHF_B = 0x9BF // 2495 SYS___CASINHF_H = 0x9C0 // 2496 SYS_CASINHL = 0x9C1 // 2497 SYS___CASINHL_B = 0x9C2 // 2498 SYS___CASINHL_H = 0x9C3 // 2499 SYS_CATAN = 0x9C4 // 2500 SYS___CATAN_B = 0x9C5 // 2501 SYS___CATAN_H = 0x9C6 // 2502 SYS_CATANF = 0x9C7 // 2503 SYS___CATANF_B = 0x9C8 // 2504 SYS___CATANF_H = 0x9C9 // 2505 SYS_CATANL = 0x9CA // 2506 SYS___CATANL_B = 0x9CB // 2507 SYS___CATANL_H = 0x9CC // 2508 SYS_CATANH = 0x9CD // 2509 SYS___CATANH_B = 0x9CE // 2510 SYS___CATANH_H = 0x9CF // 2511 SYS_CATANHF = 0x9D0 // 2512 SYS___CATANHF_B = 0x9D1 // 2513 SYS___CATANHF_H = 0x9D2 // 2514 SYS_CATANHL = 0x9D3 // 2515 SYS___CATANHL_B = 0x9D4 // 2516 SYS___CATANHL_H = 0x9D5 // 2517 SYS_CCOS = 0x9D6 // 2518 SYS___CCOS_B = 0x9D7 // 2519 SYS___CCOS_H = 0x9D8 // 2520 SYS_CCOSF = 0x9D9 // 2521 SYS___CCOSF_B = 0x9DA // 2522 SYS___CCOSF_H = 0x9DB // 2523 SYS_CCOSL = 0x9DC // 2524 SYS___CCOSL_B = 0x9DD // 2525 SYS___CCOSL_H = 0x9DE // 2526 SYS_CCOSH = 0x9DF // 2527 SYS___CCOSH_B = 0x9E0 // 2528 SYS___CCOSH_H = 0x9E1 // 2529 SYS_CCOSHF = 0x9E2 // 2530 SYS___CCOSHF_B = 0x9E3 // 2531 SYS___CCOSHF_H = 0x9E4 // 2532 SYS_CCOSHL = 0x9E5 // 2533 SYS___CCOSHL_B = 0x9E6 // 2534 SYS___CCOSHL_H = 0x9E7 // 2535 SYS_CEXP = 0x9E8 // 2536 SYS___CEXP_B = 0x9E9 // 2537 SYS___CEXP_H = 0x9EA // 2538 SYS_CEXPF = 0x9EB // 2539 SYS___CEXPF_B = 0x9EC // 2540 SYS___CEXPF_H = 0x9ED // 2541 SYS_CEXPL = 0x9EE // 2542 SYS___CEXPL_B = 0x9EF // 2543 SYS___CEXPL_H = 0x9F0 // 2544 SYS_CIMAG = 0x9F1 // 2545 SYS___CIMAG_B = 0x9F2 // 2546 SYS___CIMAG_H = 0x9F3 // 2547 SYS_CIMAGF = 0x9F4 // 2548 SYS___CIMAGF_B = 0x9F5 // 2549 SYS___CIMAGF_H = 0x9F6 // 2550 SYS_CIMAGL = 0x9F7 // 2551 SYS___CIMAGL_B = 0x9F8 // 2552 SYS___CIMAGL_H = 0x9F9 // 2553 SYS___CLOG = 0x9FA // 2554 SYS___CLOG_B = 0x9FB // 2555 SYS___CLOG_H = 0x9FC // 2556 SYS_CLOGF = 0x9FD // 2557 SYS___CLOGF_B = 0x9FE // 2558 SYS___CLOGF_H = 0x9FF // 2559 SYS_CLOGL = 0xA00 // 2560 SYS___CLOGL_B = 0xA01 // 2561 SYS___CLOGL_H = 0xA02 // 2562 SYS_CONJ = 0xA03 // 2563 SYS___CONJ_B = 0xA04 // 2564 SYS___CONJ_H = 0xA05 // 2565 SYS_CONJF = 0xA06 // 2566 SYS___CONJF_B = 0xA07 // 2567 SYS___CONJF_H = 0xA08 // 2568 SYS_CONJL = 0xA09 // 2569 SYS___CONJL_B = 0xA0A // 2570 SYS___CONJL_H = 0xA0B // 2571 SYS_CPOW = 0xA0C // 2572 SYS___CPOW_B = 0xA0D // 2573 SYS___CPOW_H = 0xA0E // 2574 SYS_CPOWF = 0xA0F // 2575 SYS___CPOWF_B = 0xA10 // 2576 SYS___CPOWF_H = 0xA11 // 2577 SYS_CPOWL = 0xA12 // 2578 SYS___CPOWL_B = 0xA13 // 2579 SYS___CPOWL_H = 0xA14 // 2580 SYS_CPROJ = 0xA15 // 2581 SYS___CPROJ_B = 0xA16 // 2582 SYS___CPROJ_H = 0xA17 // 2583 SYS_CPROJF = 0xA18 // 2584 SYS___CPROJF_B = 0xA19 // 2585 SYS___CPROJF_H = 0xA1A // 2586 SYS_CPROJL = 0xA1B // 2587 SYS___CPROJL_B = 0xA1C // 2588 SYS___CPROJL_H = 0xA1D // 2589 SYS_CREAL = 0xA1E // 2590 SYS___CREAL_B = 0xA1F // 2591 SYS___CREAL_H = 0xA20 // 2592 SYS_CREALF = 0xA21 // 2593 SYS___CREALF_B = 0xA22 // 2594 SYS___CREALF_H = 0xA23 // 2595 SYS_CREALL = 0xA24 // 2596 SYS___CREALL_B = 0xA25 // 2597 SYS___CREALL_H = 0xA26 // 2598 SYS_CSIN = 0xA27 // 2599 SYS___CSIN_B = 0xA28 // 2600 SYS___CSIN_H = 0xA29 // 2601 SYS_CSINF = 0xA2A // 2602 SYS___CSINF_B = 0xA2B // 2603 SYS___CSINF_H = 0xA2C // 2604 SYS_CSINL = 0xA2D // 2605 SYS___CSINL_B = 0xA2E // 2606 SYS___CSINL_H = 0xA2F // 2607 SYS_CSINH = 0xA30 // 2608 SYS___CSINH_B = 0xA31 // 2609 SYS___CSINH_H = 0xA32 // 2610 SYS_CSINHF = 0xA33 // 2611 SYS___CSINHF_B = 0xA34 // 2612 SYS___CSINHF_H = 0xA35 // 2613 SYS_CSINHL = 0xA36 // 2614 SYS___CSINHL_B = 0xA37 // 2615 SYS___CSINHL_H = 0xA38 // 2616 SYS_CSQRT = 0xA39 // 2617 SYS___CSQRT_B = 0xA3A // 2618 SYS___CSQRT_H = 0xA3B // 2619 SYS_CSQRTF = 0xA3C // 2620 SYS___CSQRTF_B = 0xA3D // 2621 SYS___CSQRTF_H = 0xA3E // 2622 SYS_CSQRTL = 0xA3F // 2623 SYS___CSQRTL_B = 0xA40 // 2624 SYS___CSQRTL_H = 0xA41 // 2625 SYS_CTAN = 0xA42 // 2626 SYS___CTAN_B = 0xA43 // 2627 SYS___CTAN_H = 0xA44 // 2628 SYS_CTANF = 0xA45 // 2629 SYS___CTANF_B = 0xA46 // 2630 SYS___CTANF_H = 0xA47 // 2631 SYS_CTANL = 0xA48 // 2632 SYS___CTANL_B = 0xA49 // 2633 SYS___CTANL_H = 0xA4A // 2634 SYS_CTANH = 0xA4B // 2635 SYS___CTANH_B = 0xA4C // 2636 SYS___CTANH_H = 0xA4D // 2637 SYS_CTANHF = 0xA4E // 2638 SYS___CTANHF_B = 0xA4F // 2639 SYS___CTANHF_H = 0xA50 // 2640 SYS_CTANHL = 0xA51 // 2641 SYS___CTANHL_B = 0xA52 // 2642 SYS___CTANHL_H = 0xA53 // 2643 SYS___ACOSHF_H = 0xA54 // 2644 SYS___ACOSHL_H = 0xA55 // 2645 SYS___ASINHF_H = 0xA56 // 2646 SYS___ASINHL_H = 0xA57 // 2647 SYS___CBRTF_H = 0xA58 // 2648 SYS___CBRTL_H = 0xA59 // 2649 SYS___COPYSIGN_B = 0xA5A // 2650 SYS___EXPM1F_H = 0xA5B // 2651 SYS___EXPM1L_H = 0xA5C // 2652 SYS___EXP2_H = 0xA5D // 2653 SYS___EXP2F_H = 0xA5E // 2654 SYS___EXP2L_H = 0xA5F // 2655 SYS___LOG1PF_H = 0xA60 // 2656 SYS___LOG1PL_H = 0xA61 // 2657 SYS___LGAMMAL_H = 0xA62 // 2658 SYS_FMA = 0xA63 // 2659 SYS___FMA_B = 0xA64 // 2660 SYS___FMA_H = 0xA65 // 2661 SYS_FMAF = 0xA66 // 2662 SYS___FMAF_B = 0xA67 // 2663 SYS___FMAF_H = 0xA68 // 2664 SYS_FMAL = 0xA69 // 2665 SYS___FMAL_B = 0xA6A // 2666 SYS___FMAL_H = 0xA6B // 2667 SYS_FMAX = 0xA6C // 2668 SYS___FMAX_B = 0xA6D // 2669 SYS___FMAX_H = 0xA6E // 2670 SYS_FMAXF = 0xA6F // 2671 SYS___FMAXF_B = 0xA70 // 2672 SYS___FMAXF_H = 0xA71 // 2673 SYS_FMAXL = 0xA72 // 2674 SYS___FMAXL_B = 0xA73 // 2675 SYS___FMAXL_H = 0xA74 // 2676 SYS_FMIN = 0xA75 // 2677 SYS___FMIN_B = 0xA76 // 2678 SYS___FMIN_H = 0xA77 // 2679 SYS_FMINF = 0xA78 // 2680 SYS___FMINF_B = 0xA79 // 2681 SYS___FMINF_H = 0xA7A // 2682 SYS_FMINL = 0xA7B // 2683 SYS___FMINL_B = 0xA7C // 2684 SYS___FMINL_H = 0xA7D // 2685 SYS_ILOGBF = 0xA7E // 2686 SYS___ILOGBF_B = 0xA7F // 2687 SYS___ILOGBF_H = 0xA80 // 2688 SYS_ILOGBL = 0xA81 // 2689 SYS___ILOGBL_B = 0xA82 // 2690 SYS___ILOGBL_H = 0xA83 // 2691 SYS_LLRINT = 0xA84 // 2692 SYS___LLRINT_B = 0xA85 // 2693 SYS___LLRINT_H = 0xA86 // 2694 SYS_LLRINTF = 0xA87 // 2695 SYS___LLRINTF_B = 0xA88 // 2696 SYS___LLRINTF_H = 0xA89 // 2697 SYS_LLRINTL = 0xA8A // 2698 SYS___LLRINTL_B = 0xA8B // 2699 SYS___LLRINTL_H = 0xA8C // 2700 SYS_LLROUND = 0xA8D // 2701 SYS___LLROUND_B = 0xA8E // 2702 SYS___LLROUND_H = 0xA8F // 2703 SYS_LLROUNDF = 0xA90 // 2704 SYS___LLROUNDF_B = 0xA91 // 2705 SYS___LLROUNDF_H = 0xA92 // 2706 SYS_LLROUNDL = 0xA93 // 2707 SYS___LLROUNDL_B = 0xA94 // 2708 SYS___LLROUNDL_H = 0xA95 // 2709 SYS_LOGBF = 0xA96 // 2710 SYS___LOGBF_B = 0xA97 // 2711 SYS___LOGBF_H = 0xA98 // 2712 SYS_LOGBL = 0xA99 // 2713 SYS___LOGBL_B = 0xA9A // 2714 SYS___LOGBL_H = 0xA9B // 2715 SYS_LRINT = 0xA9C // 2716 SYS___LRINT_B = 0xA9D // 2717 SYS___LRINT_H = 0xA9E // 2718 SYS_LRINTF = 0xA9F // 2719 SYS___LRINTF_B = 0xAA0 // 2720 SYS___LRINTF_H = 0xAA1 // 2721 SYS_LRINTL = 0xAA2 // 2722 SYS___LRINTL_B = 0xAA3 // 2723 SYS___LRINTL_H = 0xAA4 // 2724 SYS_LROUNDL = 0xAA5 // 2725 SYS___LROUNDL_B = 0xAA6 // 2726 SYS___LROUNDL_H = 0xAA7 // 2727 SYS_NAN = 0xAA8 // 2728 SYS___NAN_B = 0xAA9 // 2729 SYS_NANF = 0xAAA // 2730 SYS___NANF_B = 0xAAB // 2731 SYS_NANL = 0xAAC // 2732 SYS___NANL_B = 0xAAD // 2733 SYS_NEARBYINT = 0xAAE // 2734 SYS___NEARBYINT_B = 0xAAF // 2735 SYS___NEARBYINT_H = 0xAB0 // 2736 SYS_NEARBYINTF = 0xAB1 // 2737 SYS___NEARBYINTF_B = 0xAB2 // 2738 SYS___NEARBYINTF_H = 0xAB3 // 2739 SYS_NEARBYINTL = 0xAB4 // 2740 SYS___NEARBYINTL_B = 0xAB5 // 2741 SYS___NEARBYINTL_H = 0xAB6 // 2742 SYS_NEXTAFTERF = 0xAB7 // 2743 SYS___NEXTAFTERF_B = 0xAB8 // 2744 SYS___NEXTAFTERF_H = 0xAB9 // 2745 SYS_NEXTAFTERL = 0xABA // 2746 SYS___NEXTAFTERL_B = 0xABB // 2747 SYS___NEXTAFTERL_H = 0xABC // 2748 SYS_NEXTTOWARD = 0xABD // 2749 SYS___NEXTTOWARD_B = 0xABE // 2750 SYS___NEXTTOWARD_H = 0xABF // 2751 SYS_NEXTTOWARDF = 0xAC0 // 2752 SYS___NEXTTOWARDF_B = 0xAC1 // 2753 SYS___NEXTTOWARDF_H = 0xAC2 // 2754 SYS_NEXTTOWARDL = 0xAC3 // 2755 SYS___NEXTTOWARDL_B = 0xAC4 // 2756 SYS___NEXTTOWARDL_H = 0xAC5 // 2757 SYS___REMAINDERF_H = 0xAC6 // 2758 SYS___REMAINDERL_H = 0xAC7 // 2759 SYS___REMQUO_H = 0xAC8 // 2760 SYS___REMQUOF_H = 0xAC9 // 2761 SYS___REMQUOL_H = 0xACA // 2762 SYS_RINTF = 0xACB // 2763 SYS___RINTF_B = 0xACC // 2764 SYS_RINTL = 0xACD // 2765 SYS___RINTL_B = 0xACE // 2766 SYS_ROUND = 0xACF // 2767 SYS___ROUND_B = 0xAD0 // 2768 SYS___ROUND_H = 0xAD1 // 2769 SYS_ROUNDF = 0xAD2 // 2770 SYS___ROUNDF_B = 0xAD3 // 2771 SYS___ROUNDF_H = 0xAD4 // 2772 SYS_ROUNDL = 0xAD5 // 2773 SYS___ROUNDL_B = 0xAD6 // 2774 SYS___ROUNDL_H = 0xAD7 // 2775 SYS_SCALBLN = 0xAD8 // 2776 SYS___SCALBLN_B = 0xAD9 // 2777 SYS___SCALBLN_H = 0xADA // 2778 SYS_SCALBLNF = 0xADB // 2779 SYS___SCALBLNF_B = 0xADC // 2780 SYS___SCALBLNF_H = 0xADD // 2781 SYS_SCALBLNL = 0xADE // 2782 SYS___SCALBLNL_B = 0xADF // 2783 SYS___SCALBLNL_H = 0xAE0 // 2784 SYS___SCALBN_B = 0xAE1 // 2785 SYS___SCALBN_H = 0xAE2 // 2786 SYS_SCALBNF = 0xAE3 // 2787 SYS___SCALBNF_B = 0xAE4 // 2788 SYS___SCALBNF_H = 0xAE5 // 2789 SYS_SCALBNL = 0xAE6 // 2790 SYS___SCALBNL_B = 0xAE7 // 2791 SYS___SCALBNL_H = 0xAE8 // 2792 SYS___TGAMMAL_H = 0xAE9 // 2793 SYS_FECLEAREXCEPT = 0xAEA // 2794 SYS_FEGETENV = 0xAEB // 2795 SYS_FEGETEXCEPTFLAG = 0xAEC // 2796 SYS_FEGETROUND = 0xAED // 2797 SYS_FEHOLDEXCEPT = 0xAEE // 2798 SYS_FERAISEEXCEPT = 0xAEF // 2799 SYS_FESETENV = 0xAF0 // 2800 SYS_FESETEXCEPTFLAG = 0xAF1 // 2801 SYS_FESETROUND = 0xAF2 // 2802 SYS_FETESTEXCEPT = 0xAF3 // 2803 SYS_FEUPDATEENV = 0xAF4 // 2804 SYS___COPYSIGN_H = 0xAF5 // 2805 SYS___HYPOTF_H = 0xAF6 // 2806 SYS___HYPOTL_H = 0xAF7 // 2807 SYS___CLASS = 0xAFA // 2810 SYS___CLASS_B = 0xAFB // 2811 SYS___CLASS_H = 0xAFC // 2812 SYS___ISBLANK_A = 0xB2E // 2862 SYS___ISWBLANK_A = 0xB2F // 2863 SYS___LROUND_FIXUP = 0xB30 // 2864 SYS___LROUNDF_FIXUP = 0xB31 // 2865 SYS_SCHED_YIELD = 0xB32 // 2866 SYS_STRERROR_R = 0xB33 // 2867 SYS_UNSETENV = 0xB34 // 2868 SYS___LGAMMA_H_C99 = 0xB38 // 2872 SYS___LGAMMA_B_C99 = 0xB39 // 2873 SYS___LGAMMA_R_C99 = 0xB3A // 2874 SYS___FTELL2 = 0xB3B // 2875 SYS___FSEEK2 = 0xB3C // 2876 SYS___STATIC_REINIT = 0xB3D // 2877 SYS_PTHREAD_ATTR_GETSTACK = 0xB3E // 2878 SYS_PTHREAD_ATTR_SETSTACK = 0xB3F // 2879 SYS___TGAMMA_H_C99 = 0xB78 // 2936 SYS___TGAMMAF_H_C99 = 0xB79 // 2937 SYS___LE_TRACEBACK = 0xB7A // 2938 SYS___MUST_STAY_CLEAN = 0xB7C // 2940 SYS___O_ENV = 0xB7D // 2941 SYS_ACOSD32 = 0xB7E // 2942 SYS_ACOSD64 = 0xB7F // 2943 SYS_ACOSD128 = 0xB80 // 2944 SYS_ACOSHD32 = 0xB81 // 2945 SYS_ACOSHD64 = 0xB82 // 2946 SYS_ACOSHD128 = 0xB83 // 2947 SYS_ASIND32 = 0xB84 // 2948 SYS_ASIND64 = 0xB85 // 2949 SYS_ASIND128 = 0xB86 // 2950 SYS_ASINHD32 = 0xB87 // 2951 SYS_ASINHD64 = 0xB88 // 2952 SYS_ASINHD128 = 0xB89 // 2953 SYS_ATAND32 = 0xB8A // 2954 SYS_ATAND64 = 0xB8B // 2955 SYS_ATAND128 = 0xB8C // 2956 SYS_ATAN2D32 = 0xB8D // 2957 SYS_ATAN2D64 = 0xB8E // 2958 SYS_ATAN2D128 = 0xB8F // 2959 SYS_ATANHD32 = 0xB90 // 2960 SYS_ATANHD64 = 0xB91 // 2961 SYS_ATANHD128 = 0xB92 // 2962 SYS_CBRTD32 = 0xB93 // 2963 SYS_CBRTD64 = 0xB94 // 2964 SYS_CBRTD128 = 0xB95 // 2965 SYS_CEILD32 = 0xB96 // 2966 SYS_CEILD64 = 0xB97 // 2967 SYS_CEILD128 = 0xB98 // 2968 SYS___CLASS2 = 0xB99 // 2969 SYS___CLASS2_B = 0xB9A // 2970 SYS___CLASS2_H = 0xB9B // 2971 SYS_COPYSIGND32 = 0xB9C // 2972 SYS_COPYSIGND64 = 0xB9D // 2973 SYS_COPYSIGND128 = 0xB9E // 2974 SYS_COSD32 = 0xB9F // 2975 SYS_COSD64 = 0xBA0 // 2976 SYS_COSD128 = 0xBA1 // 2977 SYS_COSHD32 = 0xBA2 // 2978 SYS_COSHD64 = 0xBA3 // 2979 SYS_COSHD128 = 0xBA4 // 2980 SYS_ERFD32 = 0xBA5 // 2981 SYS_ERFD64 = 0xBA6 // 2982 SYS_ERFD128 = 0xBA7 // 2983 SYS_ERFCD32 = 0xBA8 // 2984 SYS_ERFCD64 = 0xBA9 // 2985 SYS_ERFCD128 = 0xBAA // 2986 SYS_EXPD32 = 0xBAB // 2987 SYS_EXPD64 = 0xBAC // 2988 SYS_EXPD128 = 0xBAD // 2989 SYS_EXP2D32 = 0xBAE // 2990 SYS_EXP2D64 = 0xBAF // 2991 SYS_EXP2D128 = 0xBB0 // 2992 SYS_EXPM1D32 = 0xBB1 // 2993 SYS_EXPM1D64 = 0xBB2 // 2994 SYS_EXPM1D128 = 0xBB3 // 2995 SYS_FABSD32 = 0xBB4 // 2996 SYS_FABSD64 = 0xBB5 // 2997 SYS_FABSD128 = 0xBB6 // 2998 SYS_FDIMD32 = 0xBB7 // 2999 SYS_FDIMD64 = 0xBB8 // 3000 SYS_FDIMD128 = 0xBB9 // 3001 SYS_FE_DEC_GETROUND = 0xBBA // 3002 SYS_FE_DEC_SETROUND = 0xBBB // 3003 SYS_FLOORD32 = 0xBBC // 3004 SYS_FLOORD64 = 0xBBD // 3005 SYS_FLOORD128 = 0xBBE // 3006 SYS_FMAD32 = 0xBBF // 3007 SYS_FMAD64 = 0xBC0 // 3008 SYS_FMAD128 = 0xBC1 // 3009 SYS_FMAXD32 = 0xBC2 // 3010 SYS_FMAXD64 = 0xBC3 // 3011 SYS_FMAXD128 = 0xBC4 // 3012 SYS_FMIND32 = 0xBC5 // 3013 SYS_FMIND64 = 0xBC6 // 3014 SYS_FMIND128 = 0xBC7 // 3015 SYS_FMODD32 = 0xBC8 // 3016 SYS_FMODD64 = 0xBC9 // 3017 SYS_FMODD128 = 0xBCA // 3018 SYS___FP_CAST_D = 0xBCB // 3019 SYS_FREXPD32 = 0xBCC // 3020 SYS_FREXPD64 = 0xBCD // 3021 SYS_FREXPD128 = 0xBCE // 3022 SYS_HYPOTD32 = 0xBCF // 3023 SYS_HYPOTD64 = 0xBD0 // 3024 SYS_HYPOTD128 = 0xBD1 // 3025 SYS_ILOGBD32 = 0xBD2 // 3026 SYS_ILOGBD64 = 0xBD3 // 3027 SYS_ILOGBD128 = 0xBD4 // 3028 SYS_LDEXPD32 = 0xBD5 // 3029 SYS_LDEXPD64 = 0xBD6 // 3030 SYS_LDEXPD128 = 0xBD7 // 3031 SYS_LGAMMAD32 = 0xBD8 // 3032 SYS_LGAMMAD64 = 0xBD9 // 3033 SYS_LGAMMAD128 = 0xBDA // 3034 SYS_LLRINTD32 = 0xBDB // 3035 SYS_LLRINTD64 = 0xBDC // 3036 SYS_LLRINTD128 = 0xBDD // 3037 SYS_LLROUNDD32 = 0xBDE // 3038 SYS_LLROUNDD64 = 0xBDF // 3039 SYS_LLROUNDD128 = 0xBE0 // 3040 SYS_LOGD32 = 0xBE1 // 3041 SYS_LOGD64 = 0xBE2 // 3042 SYS_LOGD128 = 0xBE3 // 3043 SYS_LOG10D32 = 0xBE4 // 3044 SYS_LOG10D64 = 0xBE5 // 3045 SYS_LOG10D128 = 0xBE6 // 3046 SYS_LOG1PD32 = 0xBE7 // 3047 SYS_LOG1PD64 = 0xBE8 // 3048 SYS_LOG1PD128 = 0xBE9 // 3049 SYS_LOG2D32 = 0xBEA // 3050 SYS_LOG2D64 = 0xBEB // 3051 SYS_LOG2D128 = 0xBEC // 3052 SYS_LOGBD32 = 0xBED // 3053 SYS_LOGBD64 = 0xBEE // 3054 SYS_LOGBD128 = 0xBEF // 3055 SYS_LRINTD32 = 0xBF0 // 3056 SYS_LRINTD64 = 0xBF1 // 3057 SYS_LRINTD128 = 0xBF2 // 3058 SYS_LROUNDD32 = 0xBF3 // 3059 SYS_LROUNDD64 = 0xBF4 // 3060 SYS_LROUNDD128 = 0xBF5 // 3061 SYS_MODFD32 = 0xBF6 // 3062 SYS_MODFD64 = 0xBF7 // 3063 SYS_MODFD128 = 0xBF8 // 3064 SYS_NAND32 = 0xBF9 // 3065 SYS_NAND64 = 0xBFA // 3066 SYS_NAND128 = 0xBFB // 3067 SYS_NEARBYINTD32 = 0xBFC // 3068 SYS_NEARBYINTD64 = 0xBFD // 3069 SYS_NEARBYINTD128 = 0xBFE // 3070 SYS_NEXTAFTERD32 = 0xBFF // 3071 SYS_NEXTAFTERD64 = 0xC00 // 3072 SYS_NEXTAFTERD128 = 0xC01 // 3073 SYS_NEXTTOWARDD32 = 0xC02 // 3074 SYS_NEXTTOWARDD64 = 0xC03 // 3075 SYS_NEXTTOWARDD128 = 0xC04 // 3076 SYS_POWD32 = 0xC05 // 3077 SYS_POWD64 = 0xC06 // 3078 SYS_POWD128 = 0xC07 // 3079 SYS_QUANTIZED32 = 0xC08 // 3080 SYS_QUANTIZED64 = 0xC09 // 3081 SYS_QUANTIZED128 = 0xC0A // 3082 SYS_REMAINDERD32 = 0xC0B // 3083 SYS_REMAINDERD64 = 0xC0C // 3084 SYS_REMAINDERD128 = 0xC0D // 3085 SYS___REMQUOD32 = 0xC0E // 3086 SYS___REMQUOD64 = 0xC0F // 3087 SYS___REMQUOD128 = 0xC10 // 3088 SYS_RINTD32 = 0xC11 // 3089 SYS_RINTD64 = 0xC12 // 3090 SYS_RINTD128 = 0xC13 // 3091 SYS_ROUNDD32 = 0xC14 // 3092 SYS_ROUNDD64 = 0xC15 // 3093 SYS_ROUNDD128 = 0xC16 // 3094 SYS_SAMEQUANTUMD32 = 0xC17 // 3095 SYS_SAMEQUANTUMD64 = 0xC18 // 3096 SYS_SAMEQUANTUMD128 = 0xC19 // 3097 SYS_SCALBLND32 = 0xC1A // 3098 SYS_SCALBLND64 = 0xC1B // 3099 SYS_SCALBLND128 = 0xC1C // 3100 SYS_SCALBND32 = 0xC1D // 3101 SYS_SCALBND64 = 0xC1E // 3102 SYS_SCALBND128 = 0xC1F // 3103 SYS_SIND32 = 0xC20 // 3104 SYS_SIND64 = 0xC21 // 3105 SYS_SIND128 = 0xC22 // 3106 SYS_SINHD32 = 0xC23 // 3107 SYS_SINHD64 = 0xC24 // 3108 SYS_SINHD128 = 0xC25 // 3109 SYS_SQRTD32 = 0xC26 // 3110 SYS_SQRTD64 = 0xC27 // 3111 SYS_SQRTD128 = 0xC28 // 3112 SYS_STRTOD32 = 0xC29 // 3113 SYS_STRTOD64 = 0xC2A // 3114 SYS_STRTOD128 = 0xC2B // 3115 SYS_TAND32 = 0xC2C // 3116 SYS_TAND64 = 0xC2D // 3117 SYS_TAND128 = 0xC2E // 3118 SYS_TANHD32 = 0xC2F // 3119 SYS_TANHD64 = 0xC30 // 3120 SYS_TANHD128 = 0xC31 // 3121 SYS_TGAMMAD32 = 0xC32 // 3122 SYS_TGAMMAD64 = 0xC33 // 3123 SYS_TGAMMAD128 = 0xC34 // 3124 SYS_TRUNCD32 = 0xC3E // 3134 SYS_TRUNCD64 = 0xC3F // 3135 SYS_TRUNCD128 = 0xC40 // 3136 SYS_WCSTOD32 = 0xC41 // 3137 SYS_WCSTOD64 = 0xC42 // 3138 SYS_WCSTOD128 = 0xC43 // 3139 SYS___CODEPAGE_INFO = 0xC64 // 3172 SYS_POSIX_OPENPT = 0xC66 // 3174 SYS_PSELECT = 0xC67 // 3175 SYS_SOCKATMARK = 0xC68 // 3176 SYS_AIO_FSYNC = 0xC69 // 3177 SYS_LIO_LISTIO = 0xC6A // 3178 SYS___ATANPID32 = 0xC6B // 3179 SYS___ATANPID64 = 0xC6C // 3180 SYS___ATANPID128 = 0xC6D // 3181 SYS___COSPID32 = 0xC6E // 3182 SYS___COSPID64 = 0xC6F // 3183 SYS___COSPID128 = 0xC70 // 3184 SYS___SINPID32 = 0xC71 // 3185 SYS___SINPID64 = 0xC72 // 3186 SYS___SINPID128 = 0xC73 // 3187 SYS_SETIPV4SOURCEFILTER = 0xC76 // 3190 SYS_GETIPV4SOURCEFILTER = 0xC77 // 3191 SYS_SETSOURCEFILTER = 0xC78 // 3192 SYS_GETSOURCEFILTER = 0xC79 // 3193 SYS_FWRITE_UNLOCKED = 0xC7A // 3194 SYS_FREAD_UNLOCKED = 0xC7B // 3195 SYS_FGETS_UNLOCKED = 0xC7C // 3196 SYS_GETS_UNLOCKED = 0xC7D // 3197 SYS_FPUTS_UNLOCKED = 0xC7E // 3198 SYS_PUTS_UNLOCKED = 0xC7F // 3199 SYS_FGETC_UNLOCKED = 0xC80 // 3200 SYS_FPUTC_UNLOCKED = 0xC81 // 3201 SYS_DLADDR = 0xC82 // 3202 SYS_SHM_OPEN = 0xC8C // 3212 SYS_SHM_UNLINK = 0xC8D // 3213 SYS___CLASS2F = 0xC91 // 3217 SYS___CLASS2L = 0xC92 // 3218 SYS___CLASS2F_B = 0xC93 // 3219 SYS___CLASS2F_H = 0xC94 // 3220 SYS___CLASS2L_B = 0xC95 // 3221 SYS___CLASS2L_H = 0xC96 // 3222 SYS___CLASS2D32 = 0xC97 // 3223 SYS___CLASS2D64 = 0xC98 // 3224 SYS___CLASS2D128 = 0xC99 // 3225 SYS___TOCSNAME2 = 0xC9A // 3226 SYS___D1TOP = 0xC9B // 3227 SYS___D2TOP = 0xC9C // 3228 SYS___D4TOP = 0xC9D // 3229 SYS___PTOD1 = 0xC9E // 3230 SYS___PTOD2 = 0xC9F // 3231 SYS___PTOD4 = 0xCA0 // 3232 SYS_CLEARERR_UNLOCKED = 0xCA1 // 3233 SYS_FDELREC_UNLOCKED = 0xCA2 // 3234 SYS_FEOF_UNLOCKED = 0xCA3 // 3235 SYS_FERROR_UNLOCKED = 0xCA4 // 3236 SYS_FFLUSH_UNLOCKED = 0xCA5 // 3237 SYS_FGETPOS_UNLOCKED = 0xCA6 // 3238 SYS_FGETWC_UNLOCKED = 0xCA7 // 3239 SYS_FGETWS_UNLOCKED = 0xCA8 // 3240 SYS_FILENO_UNLOCKED = 0xCA9 // 3241 SYS_FLDATA_UNLOCKED = 0xCAA // 3242 SYS_FLOCATE_UNLOCKED = 0xCAB // 3243 SYS_FPRINTF_UNLOCKED = 0xCAC // 3244 SYS_FPUTWC_UNLOCKED = 0xCAD // 3245 SYS_FPUTWS_UNLOCKED = 0xCAE // 3246 SYS_FSCANF_UNLOCKED = 0xCAF // 3247 SYS_FSEEK_UNLOCKED = 0xCB0 // 3248 SYS_FSEEKO_UNLOCKED = 0xCB1 // 3249 SYS_FSETPOS_UNLOCKED = 0xCB3 // 3251 SYS_FTELL_UNLOCKED = 0xCB4 // 3252 SYS_FTELLO_UNLOCKED = 0xCB5 // 3253 SYS_FUPDATE_UNLOCKED = 0xCB7 // 3255 SYS_FWIDE_UNLOCKED = 0xCB8 // 3256 SYS_FWPRINTF_UNLOCKED = 0xCB9 // 3257 SYS_FWSCANF_UNLOCKED = 0xCBA // 3258 SYS_GETWC_UNLOCKED = 0xCBB // 3259 SYS_GETWCHAR_UNLOCKED = 0xCBC // 3260 SYS_PERROR_UNLOCKED = 0xCBD // 3261 SYS_PRINTF_UNLOCKED = 0xCBE // 3262 SYS_PUTWC_UNLOCKED = 0xCBF // 3263 SYS_PUTWCHAR_UNLOCKED = 0xCC0 // 3264 SYS_REWIND_UNLOCKED = 0xCC1 // 3265 SYS_SCANF_UNLOCKED = 0xCC2 // 3266 SYS_UNGETC_UNLOCKED = 0xCC3 // 3267 SYS_UNGETWC_UNLOCKED = 0xCC4 // 3268 SYS_VFPRINTF_UNLOCKED = 0xCC5 // 3269 SYS_VFSCANF_UNLOCKED = 0xCC7 // 3271 SYS_VFWPRINTF_UNLOCKED = 0xCC9 // 3273 SYS_VFWSCANF_UNLOCKED = 0xCCB // 3275 SYS_VPRINTF_UNLOCKED = 0xCCD // 3277 SYS_VSCANF_UNLOCKED = 0xCCF // 3279 SYS_VWPRINTF_UNLOCKED = 0xCD1 // 3281 SYS_VWSCANF_UNLOCKED = 0xCD3 // 3283 SYS_WPRINTF_UNLOCKED = 0xCD5 // 3285 SYS_WSCANF_UNLOCKED = 0xCD6 // 3286 SYS_ASCTIME64 = 0xCD7 // 3287 SYS_ASCTIME64_R = 0xCD8 // 3288 SYS_CTIME64 = 0xCD9 // 3289 SYS_CTIME64_R = 0xCDA // 3290 SYS_DIFFTIME64 = 0xCDB // 3291 SYS_GMTIME64 = 0xCDC // 3292 SYS_GMTIME64_R = 0xCDD // 3293 SYS_LOCALTIME64 = 0xCDE // 3294 SYS_LOCALTIME64_R = 0xCDF // 3295 SYS_MKTIME64 = 0xCE0 // 3296 SYS_TIME64 = 0xCE1 // 3297 SYS___LOGIN_APPLID = 0xCE2 // 3298 SYS___PASSWD_APPLID = 0xCE3 // 3299 SYS_PTHREAD_SECURITY_APPLID_NP = 0xCE4 // 3300 SYS___GETTHENT = 0xCE5 // 3301 SYS_FREEIFADDRS = 0xCE6 // 3302 SYS_GETIFADDRS = 0xCE7 // 3303 SYS_POSIX_FALLOCATE = 0xCE8 // 3304 SYS_POSIX_MEMALIGN = 0xCE9 // 3305 SYS_SIZEOF_ALLOC = 0xCEA // 3306 SYS_RESIZE_ALLOC = 0xCEB // 3307 SYS_FREAD_NOUPDATE = 0xCEC // 3308 SYS_FREAD_NOUPDATE_UNLOCKED = 0xCED // 3309 SYS_FGETPOS64 = 0xCEE // 3310 SYS_FSEEK64 = 0xCEF // 3311 SYS_FSEEKO64 = 0xCF0 // 3312 SYS_FSETPOS64 = 0xCF1 // 3313 SYS_FTELL64 = 0xCF2 // 3314 SYS_FTELLO64 = 0xCF3 // 3315 SYS_FGETPOS64_UNLOCKED = 0xCF4 // 3316 SYS_FSEEK64_UNLOCKED = 0xCF5 // 3317 SYS_FSEEKO64_UNLOCKED = 0xCF6 // 3318 SYS_FSETPOS64_UNLOCKED = 0xCF7 // 3319 SYS_FTELL64_UNLOCKED = 0xCF8 // 3320 SYS_FTELLO64_UNLOCKED = 0xCF9 // 3321 SYS_FOPEN_UNLOCKED = 0xCFA // 3322 SYS_FREOPEN_UNLOCKED = 0xCFB // 3323 SYS_FDOPEN_UNLOCKED = 0xCFC // 3324 SYS_TMPFILE_UNLOCKED = 0xCFD // 3325 SYS___MOSERVICES = 0xD3D // 3389 SYS___GETTOD = 0xD3E // 3390 SYS_C16RTOMB = 0xD40 // 3392 SYS_C32RTOMB = 0xD41 // 3393 SYS_MBRTOC16 = 0xD42 // 3394 SYS_MBRTOC32 = 0xD43 // 3395 SYS_QUANTEXPD32 = 0xD44 // 3396 SYS_QUANTEXPD64 = 0xD45 // 3397 SYS_QUANTEXPD128 = 0xD46 // 3398 SYS___LOCALE_CTL = 0xD47 // 3399 SYS___SMF_RECORD2 = 0xD48 // 3400 SYS_FOPEN64 = 0xD49 // 3401 SYS_FOPEN64_UNLOCKED = 0xD4A // 3402 SYS_FREOPEN64 = 0xD4B // 3403 SYS_FREOPEN64_UNLOCKED = 0xD4C // 3404 SYS_TMPFILE64 = 0xD4D // 3405 SYS_TMPFILE64_UNLOCKED = 0xD4E // 3406 SYS_GETDATE64 = 0xD4F // 3407 SYS_GETTIMEOFDAY64 = 0xD50 // 3408 SYS_BIND2ADDRSEL = 0xD59 // 3417 SYS_INET6_IS_SRCADDR = 0xD5A // 3418 SYS___GETGRGID1 = 0xD5B // 3419 SYS___GETGRNAM1 = 0xD5C // 3420 SYS___FBUFSIZE = 0xD60 // 3424 SYS___FPENDING = 0xD61 // 3425 SYS___FLBF = 0xD62 // 3426 SYS___FREADABLE = 0xD63 // 3427 SYS___FWRITABLE = 0xD64 // 3428 SYS___FREADING = 0xD65 // 3429 SYS___FWRITING = 0xD66 // 3430 SYS___FSETLOCKING = 0xD67 // 3431 SYS__FLUSHLBF = 0xD68 // 3432 SYS___FPURGE = 0xD69 // 3433 SYS___FREADAHEAD = 0xD6A // 3434 SYS___FSETERR = 0xD6B // 3435 SYS___FPENDING_UNLOCKED = 0xD6C // 3436 SYS___FREADING_UNLOCKED = 0xD6D // 3437 SYS___FWRITING_UNLOCKED = 0xD6E // 3438 SYS__FLUSHLBF_UNLOCKED = 0xD6F // 3439 SYS___FPURGE_UNLOCKED = 0xD70 // 3440 SYS___FREADAHEAD_UNLOCKED = 0xD71 // 3441 SYS___LE_CEEGTJS = 0xD72 // 3442 SYS___LE_RECORD_DUMP = 0xD73 // 3443 SYS_FSTAT64 = 0xD74 // 3444 SYS_LSTAT64 = 0xD75 // 3445 SYS_STAT64 = 0xD76 // 3446 SYS___READDIR2_64 = 0xD77 // 3447 SYS___OPEN_STAT64 = 0xD78 // 3448 SYS_FTW64 = 0xD79 // 3449 SYS_NFTW64 = 0xD7A // 3450 SYS_UTIME64 = 0xD7B // 3451 SYS_UTIMES64 = 0xD7C // 3452 SYS___GETIPC64 = 0xD7D // 3453 SYS_MSGCTL64 = 0xD7E // 3454 SYS_SEMCTL64 = 0xD7F // 3455 SYS_SHMCTL64 = 0xD80 // 3456 SYS_MSGXRCV64 = 0xD81 // 3457 SYS___MGXR64 = 0xD81 // 3457 SYS_W_GETPSENT64 = 0xD82 // 3458 SYS_PTHREAD_COND_TIMEDWAIT64 = 0xD83 // 3459 SYS_FTIME64 = 0xD85 // 3461 SYS_GETUTXENT64 = 0xD86 // 3462 SYS_GETUTXID64 = 0xD87 // 3463 SYS_GETUTXLINE64 = 0xD88 // 3464 SYS_PUTUTXLINE64 = 0xD89 // 3465 SYS_NEWLOCALE = 0xD8A // 3466 SYS_FREELOCALE = 0xD8B // 3467 SYS_USELOCALE = 0xD8C // 3468 SYS_DUPLOCALE = 0xD8D // 3469 SYS___CHATTR64 = 0xD9C // 3484 SYS___LCHATTR64 = 0xD9D // 3485 SYS___FCHATTR64 = 0xD9E // 3486 SYS_____CHATTR64_A = 0xD9F // 3487 SYS_____LCHATTR64_A = 0xDA0 // 3488 SYS___LE_CEEUSGD = 0xDA1 // 3489 SYS___LE_IFAM_CON = 0xDA2 // 3490 SYS___LE_IFAM_DSC = 0xDA3 // 3491 SYS___LE_IFAM_GET = 0xDA4 // 3492 SYS___LE_IFAM_QRY = 0xDA5 // 3493 SYS_ALIGNED_ALLOC = 0xDA6 // 3494 SYS_ACCEPT4 = 0xDA7 // 3495 SYS___ACCEPT4_A = 0xDA8 // 3496 SYS_COPYFILERANGE = 0xDA9 // 3497 SYS_GETLINE = 0xDAA // 3498 SYS___GETLINE_A = 0xDAB // 3499 SYS_DIRFD = 0xDAC // 3500 SYS_CLOCK_GETTIME = 0xDAD // 3501 SYS_DUP3 = 0xDAE // 3502 SYS_EPOLL_CREATE = 0xDAF // 3503 SYS_EPOLL_CREATE1 = 0xDB0 // 3504 SYS_EPOLL_CTL = 0xDB1 // 3505 SYS_EPOLL_WAIT = 0xDB2 // 3506 SYS_EPOLL_PWAIT = 0xDB3 // 3507 SYS_EVENTFD = 0xDB4 // 3508 SYS_STATFS = 0xDB5 // 3509 SYS___STATFS_A = 0xDB6 // 3510 SYS_FSTATFS = 0xDB7 // 3511 SYS_INOTIFY_INIT = 0xDB8 // 3512 SYS_INOTIFY_INIT1 = 0xDB9 // 3513 SYS_INOTIFY_ADD_WATCH = 0xDBA // 3514 SYS___INOTIFY_ADD_WATCH_A = 0xDBB // 3515 SYS_INOTIFY_RM_WATCH = 0xDBC // 3516 SYS_PIPE2 = 0xDBD // 3517 SYS_PIVOT_ROOT = 0xDBE // 3518 SYS___PIVOT_ROOT_A = 0xDBF // 3519 SYS_PRCTL = 0xDC0 // 3520 SYS_PRLIMIT = 0xDC1 // 3521 SYS_SETHOSTNAME = 0xDC2 // 3522 SYS___SETHOSTNAME_A = 0xDC3 // 3523 SYS_SETRESUID = 0xDC4 // 3524 SYS_SETRESGID = 0xDC5 // 3525 SYS_PTHREAD_CONDATTR_GETCLOCK = 0xDC6 // 3526 SYS_FLOCK = 0xDC7 // 3527 SYS_FGETXATTR = 0xDC8 // 3528 SYS___FGETXATTR_A = 0xDC9 // 3529 SYS_FLISTXATTR = 0xDCA // 3530 SYS___FLISTXATTR_A = 0xDCB // 3531 SYS_FREMOVEXATTR = 0xDCC // 3532 SYS___FREMOVEXATTR_A = 0xDCD // 3533 SYS_FSETXATTR = 0xDCE // 3534 SYS___FSETXATTR_A = 0xDCF // 3535 SYS_GETXATTR = 0xDD0 // 3536 SYS___GETXATTR_A = 0xDD1 // 3537 SYS_LGETXATTR = 0xDD2 // 3538 SYS___LGETXATTR_A = 0xDD3 // 3539 SYS_LISTXATTR = 0xDD4 // 3540 SYS___LISTXATTR_A = 0xDD5 // 3541 SYS_LLISTXATTR = 0xDD6 // 3542 SYS___LLISTXATTR_A = 0xDD7 // 3543 SYS_LREMOVEXATTR = 0xDD8 // 3544 SYS___LREMOVEXATTR_A = 0xDD9 // 3545 SYS_LSETXATTR = 0xDDA // 3546 SYS___LSETXATTR_A = 0xDDB // 3547 SYS_REMOVEXATTR = 0xDDC // 3548 SYS___REMOVEXATTR_A = 0xDDD // 3549 SYS_SETXATTR = 0xDDE // 3550 SYS___SETXATTR_A = 0xDDF // 3551 SYS_FDATASYNC = 0xDE0 // 3552 SYS_SYNCFS = 0xDE1 // 3553 SYS_FUTIMES = 0xDE2 // 3554 SYS_FUTIMESAT = 0xDE3 // 3555 SYS___FUTIMESAT_A = 0xDE4 // 3556 SYS_LUTIMES = 0xDE5 // 3557 SYS___LUTIMES_A = 0xDE6 // 3558 SYS_INET_ATON = 0xDE7 // 3559 SYS_GETRANDOM = 0xDE8 // 3560 SYS_GETTID = 0xDE9 // 3561 SYS_MEMFD_CREATE = 0xDEA // 3562 SYS___MEMFD_CREATE_A = 0xDEB // 3563 SYS_FACCESSAT = 0xDEC // 3564 SYS___FACCESSAT_A = 0xDED // 3565 SYS_FCHMODAT = 0xDEE // 3566 SYS___FCHMODAT_A = 0xDEF // 3567 SYS_FCHOWNAT = 0xDF0 // 3568 SYS___FCHOWNAT_A = 0xDF1 // 3569 SYS_FSTATAT = 0xDF2 // 3570 SYS___FSTATAT_A = 0xDF3 // 3571 SYS_LINKAT = 0xDF4 // 3572 SYS___LINKAT_A = 0xDF5 // 3573 SYS_MKDIRAT = 0xDF6 // 3574 SYS___MKDIRAT_A = 0xDF7 // 3575 SYS_MKFIFOAT = 0xDF8 // 3576 SYS___MKFIFOAT_A = 0xDF9 // 3577 SYS_MKNODAT = 0xDFA // 3578 SYS___MKNODAT_A = 0xDFB // 3579 SYS_OPENAT = 0xDFC // 3580 SYS___OPENAT_A = 0xDFD // 3581 SYS_READLINKAT = 0xDFE // 3582 SYS___READLINKAT_A = 0xDFF // 3583 SYS_RENAMEAT = 0xE00 // 3584 SYS___RENAMEAT_A = 0xE01 // 3585 SYS_RENAMEAT2 = 0xE02 // 3586 SYS___RENAMEAT2_A = 0xE03 // 3587 SYS_SYMLINKAT = 0xE04 // 3588 SYS___SYMLINKAT_A = 0xE05 // 3589 SYS_UNLINKAT = 0xE06 // 3590 SYS___UNLINKAT_A = 0xE07 // 3591 SYS_SYSINFO = 0xE08 // 3592 SYS_WAIT4 = 0xE0A // 3594 SYS_CLONE = 0xE0B // 3595 SYS_UNSHARE = 0xE0C // 3596 SYS_SETNS = 0xE0D // 3597 SYS_CAPGET = 0xE0E // 3598 SYS_CAPSET = 0xE0F // 3599 SYS_STRCHRNUL = 0xE10 // 3600 SYS_PTHREAD_CONDATTR_SETCLOCK = 0xE12 // 3602 SYS_OPEN_BY_HANDLE_AT = 0xE13 // 3603 SYS___OPEN_BY_HANDLE_AT_A = 0xE14 // 3604 SYS___INET_ATON_A = 0xE15 // 3605 SYS_MOUNT1 = 0xE16 // 3606 SYS___MOUNT1_A = 0xE17 // 3607 SYS_UMOUNT1 = 0xE18 // 3608 SYS___UMOUNT1_A = 0xE19 // 3609 SYS_UMOUNT2 = 0xE1A // 3610 SYS___UMOUNT2_A = 0xE1B // 3611 SYS___PRCTL_A = 0xE1C // 3612 SYS_LOCALTIME_R2 = 0xE1D // 3613 SYS___LOCALTIME_R2_A = 0xE1E // 3614 SYS_OPENAT2 = 0xE1F // 3615 SYS___OPENAT2_A = 0xE20 // 3616 SYS___LE_CEEMICT = 0xE21 // 3617 SYS_GETENTROPY = 0xE22 // 3618 SYS_NANOSLEEP = 0xE23 // 3619 SYS_UTIMENSAT = 0xE24 // 3620 SYS___UTIMENSAT_A = 0xE25 // 3621 SYS_ASPRINTF = 0xE26 // 3622 SYS___ASPRINTF_A = 0xE27 // 3623 SYS_VASPRINTF = 0xE28 // 3624 SYS___VASPRINTF_A = 0xE29 // 3625 SYS_DPRINTF = 0xE2A // 3626 SYS___DPRINTF_A = 0xE2B // 3627 SYS_GETOPT_LONG = 0xE2C // 3628 SYS___GETOPT_LONG_A = 0xE2D // 3629 SYS_PSIGNAL = 0xE2E // 3630 SYS___PSIGNAL_A = 0xE2F // 3631 SYS_PSIGNAL_UNLOCKED = 0xE30 // 3632 SYS___PSIGNAL_UNLOCKED_A = 0xE31 // 3633 SYS_FSTATAT_O = 0xE32 // 3634 SYS___FSTATAT_O_A = 0xE33 // 3635 SYS_FSTATAT64 = 0xE34 // 3636 SYS___FSTATAT64_A = 0xE35 // 3637 SYS___CHATTRAT = 0xE36 // 3638 SYS_____CHATTRAT_A = 0xE37 // 3639 SYS___CHATTRAT64 = 0xE38 // 3640 SYS_____CHATTRAT64_A = 0xE39 // 3641 SYS_MADVISE = 0xE3A // 3642 SYS___AUTHENTICATE = 0xE3B // 3643 ) ================================================ FILE: vendor/golang.org/x/sys/unix/ztypes_aix_ppc.go ================================================ // cgo -godefs types_aix.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build ppc && aix package unix const ( SizeofPtr = 0x4 SizeofShort = 0x2 SizeofInt = 0x4 SizeofLong = 0x4 SizeofLongLong = 0x8 PathMax = 0x3ff ) type ( _C_short int16 _C_int int32 _C_long int32 _C_long_long int64 ) type off64 int64 type off int32 type Mode_t uint32 type Timespec struct { Sec int32 Nsec int32 } type Timeval struct { Sec int32 Usec int32 } type Timeval32 struct { Sec int32 Usec int32 } type Timex struct{} type Time_t int32 type Tms struct{} type Utimbuf struct { Actime int32 Modtime int32 } type Timezone struct { Minuteswest int32 Dsttime int32 } type Rusage struct { Utime Timeval Stime Timeval Maxrss int32 Ixrss int32 Idrss int32 Isrss int32 Minflt int32 Majflt int32 Nswap int32 Inblock int32 Oublock int32 Msgsnd int32 Msgrcv int32 Nsignals int32 Nvcsw int32 Nivcsw int32 } type Rlimit struct { Cur uint64 Max uint64 } type Pid_t int32 type _Gid_t uint32 type dev_t uint32 type Stat_t struct { Dev uint32 Ino uint32 Mode uint32 Nlink int16 Flag uint16 Uid uint32 Gid uint32 Rdev uint32 Size int32 Atim Timespec Mtim Timespec Ctim Timespec Blksize int32 Blocks int32 Vfstype int32 Vfs uint32 Type uint32 Gen uint32 Reserved [9]uint32 } type StatxTimestamp struct{} type Statx_t struct{} type Dirent struct { Offset uint32 Ino uint32 Reclen uint16 Namlen uint16 Name [256]uint8 } type RawSockaddrInet4 struct { Len uint8 Family uint8 Port uint16 Addr [4]byte /* in_addr */ Zero [8]uint8 } type RawSockaddrInet6 struct { Len uint8 Family uint8 Port uint16 Flowinfo uint32 Addr [16]byte /* in6_addr */ Scope_id uint32 } type RawSockaddrUnix struct { Len uint8 Family uint8 Path [1023]uint8 } type RawSockaddrDatalink struct { Len uint8 Family uint8 Index uint16 Type uint8 Nlen uint8 Alen uint8 Slen uint8 Data [120]uint8 } type RawSockaddr struct { Len uint8 Family uint8 Data [14]uint8 } type RawSockaddrAny struct { Addr RawSockaddr Pad [1012]uint8 } type _Socklen uint32 type Cmsghdr struct { Len uint32 Level int32 Type int32 } type ICMPv6Filter struct { Filt [8]uint32 } type Iovec struct { Base *byte Len uint32 } type IPMreq struct { Multiaddr [4]byte /* in_addr */ Interface [4]byte /* in_addr */ } type IPv6Mreq struct { Multiaddr [16]byte /* in6_addr */ Interface uint32 } type IPv6MTUInfo struct { Addr RawSockaddrInet6 Mtu uint32 } type Linger struct { Onoff int32 Linger int32 } type Msghdr struct { Name *byte Namelen uint32 Iov *Iovec Iovlen int32 Control *byte Controllen uint32 Flags int32 } const ( SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet6 = 0x1c SizeofSockaddrAny = 0x404 SizeofSockaddrUnix = 0x401 SizeofSockaddrDatalink = 0x80 SizeofLinger = 0x8 SizeofIovec = 0x8 SizeofIPMreq = 0x8 SizeofIPv6Mreq = 0x14 SizeofIPv6MTUInfo = 0x20 SizeofMsghdr = 0x1c SizeofCmsghdr = 0xc SizeofICMPv6Filter = 0x20 ) const ( SizeofIfMsghdr = 0x10 ) type IfMsgHdr struct { Msglen uint16 Version uint8 Type uint8 Addrs int32 Flags int32 Index uint16 Addrlen uint8 _ [1]byte } type FdSet struct { Bits [2048]int32 } type Utsname struct { Sysname [32]byte Nodename [32]byte Release [32]byte Version [32]byte Machine [32]byte } type Ustat_t struct{} type Sigset_t struct { Losigs uint32 Hisigs uint32 } const ( AT_FDCWD = -0x2 AT_REMOVEDIR = 0x1 AT_SYMLINK_NOFOLLOW = 0x1 ) type Termios struct { Iflag uint32 Oflag uint32 Cflag uint32 Lflag uint32 Cc [16]uint8 } type Termio struct { Iflag uint16 Oflag uint16 Cflag uint16 Lflag uint16 Line uint8 Cc [8]uint8 _ [1]byte } type Winsize struct { Row uint16 Col uint16 Xpixel uint16 Ypixel uint16 } type PollFd struct { Fd int32 Events uint16 Revents uint16 } const ( POLLERR = 0x4000 POLLHUP = 0x2000 POLLIN = 0x1 POLLNVAL = 0x8000 POLLOUT = 0x2 POLLPRI = 0x4 POLLRDBAND = 0x20 POLLRDNORM = 0x10 POLLWRBAND = 0x40 POLLWRNORM = 0x2 ) type Flock_t struct { Type int16 Whence int16 Sysid uint32 Pid int32 Vfs int32 Start int64 Len int64 } type Fsid_t struct { Val [2]uint32 } type Fsid64_t struct { Val [2]uint64 } type Statfs_t struct { Version int32 Type int32 Bsize uint32 Blocks uint32 Bfree uint32 Bavail uint32 Files uint32 Ffree uint32 Fsid Fsid_t Vfstype int32 Fsize uint32 Vfsnumber int32 Vfsoff int32 Vfslen int32 Vfsvers int32 Fname [32]uint8 Fpack [32]uint8 Name_max int32 } const RNDGETENTCNT = 0x80045200 ================================================ FILE: vendor/golang.org/x/sys/unix/ztypes_aix_ppc64.go ================================================ // cgo -godefs types_aix.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build ppc64 && aix package unix const ( SizeofPtr = 0x8 SizeofShort = 0x2 SizeofInt = 0x4 SizeofLong = 0x8 SizeofLongLong = 0x8 PathMax = 0x3ff ) type ( _C_short int16 _C_int int32 _C_long int64 _C_long_long int64 ) type off64 int64 type off int64 type Mode_t uint32 type Timespec struct { Sec int64 Nsec int64 } type Timeval struct { Sec int64 Usec int32 _ [4]byte } type Timeval32 struct { Sec int32 Usec int32 } type Timex struct{} type Time_t int64 type Tms struct{} type Utimbuf struct { Actime int64 Modtime int64 } type Timezone struct { Minuteswest int32 Dsttime int32 } type Rusage struct { Utime Timeval Stime Timeval Maxrss int64 Ixrss int64 Idrss int64 Isrss int64 Minflt int64 Majflt int64 Nswap int64 Inblock int64 Oublock int64 Msgsnd int64 Msgrcv int64 Nsignals int64 Nvcsw int64 Nivcsw int64 } type Rlimit struct { Cur uint64 Max uint64 } type Pid_t int32 type _Gid_t uint32 type dev_t uint64 type Stat_t struct { Dev uint64 Ino uint64 Mode uint32 Nlink int16 Flag uint16 Uid uint32 Gid uint32 Rdev uint64 Ssize int32 Atim Timespec Mtim Timespec Ctim Timespec Blksize int64 Blocks int64 Vfstype int32 Vfs uint32 Type uint32 Gen uint32 Reserved [9]uint32 Padto_ll uint32 Size int64 } type StatxTimestamp struct{} type Statx_t struct{} type Dirent struct { Offset uint64 Ino uint64 Reclen uint16 Namlen uint16 Name [256]uint8 _ [4]byte } type RawSockaddrInet4 struct { Len uint8 Family uint8 Port uint16 Addr [4]byte /* in_addr */ Zero [8]uint8 } type RawSockaddrInet6 struct { Len uint8 Family uint8 Port uint16 Flowinfo uint32 Addr [16]byte /* in6_addr */ Scope_id uint32 } type RawSockaddrUnix struct { Len uint8 Family uint8 Path [1023]uint8 } type RawSockaddrDatalink struct { Len uint8 Family uint8 Index uint16 Type uint8 Nlen uint8 Alen uint8 Slen uint8 Data [120]uint8 } type RawSockaddr struct { Len uint8 Family uint8 Data [14]uint8 } type RawSockaddrAny struct { Addr RawSockaddr Pad [1012]uint8 } type _Socklen uint32 type Cmsghdr struct { Len uint32 Level int32 Type int32 } type ICMPv6Filter struct { Filt [8]uint32 } type Iovec struct { Base *byte Len uint64 } type IPMreq struct { Multiaddr [4]byte /* in_addr */ Interface [4]byte /* in_addr */ } type IPv6Mreq struct { Multiaddr [16]byte /* in6_addr */ Interface uint32 } type IPv6MTUInfo struct { Addr RawSockaddrInet6 Mtu uint32 } type Linger struct { Onoff int32 Linger int32 } type Msghdr struct { Name *byte Namelen uint32 Iov *Iovec Iovlen int32 Control *byte Controllen uint32 Flags int32 } const ( SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet6 = 0x1c SizeofSockaddrAny = 0x404 SizeofSockaddrUnix = 0x401 SizeofSockaddrDatalink = 0x80 SizeofLinger = 0x8 SizeofIovec = 0x10 SizeofIPMreq = 0x8 SizeofIPv6Mreq = 0x14 SizeofIPv6MTUInfo = 0x20 SizeofMsghdr = 0x30 SizeofCmsghdr = 0xc SizeofICMPv6Filter = 0x20 ) const ( SizeofIfMsghdr = 0x10 ) type IfMsgHdr struct { Msglen uint16 Version uint8 Type uint8 Addrs int32 Flags int32 Index uint16 Addrlen uint8 _ [1]byte } type FdSet struct { Bits [1024]int64 } type Utsname struct { Sysname [32]byte Nodename [32]byte Release [32]byte Version [32]byte Machine [32]byte } type Ustat_t struct{} type Sigset_t struct { Set [4]uint64 } const ( AT_FDCWD = -0x2 AT_REMOVEDIR = 0x1 AT_SYMLINK_NOFOLLOW = 0x1 ) type Termios struct { Iflag uint32 Oflag uint32 Cflag uint32 Lflag uint32 Cc [16]uint8 } type Termio struct { Iflag uint16 Oflag uint16 Cflag uint16 Lflag uint16 Line uint8 Cc [8]uint8 _ [1]byte } type Winsize struct { Row uint16 Col uint16 Xpixel uint16 Ypixel uint16 } type PollFd struct { Fd int32 Events uint16 Revents uint16 } const ( POLLERR = 0x4000 POLLHUP = 0x2000 POLLIN = 0x1 POLLNVAL = 0x8000 POLLOUT = 0x2 POLLPRI = 0x4 POLLRDBAND = 0x20 POLLRDNORM = 0x10 POLLWRBAND = 0x40 POLLWRNORM = 0x2 ) type Flock_t struct { Type int16 Whence int16 Sysid uint32 Pid int32 Vfs int32 Start int64 Len int64 } type Fsid_t struct { Val [2]uint32 } type Fsid64_t struct { Val [2]uint64 } type Statfs_t struct { Version int32 Type int32 Bsize uint64 Blocks uint64 Bfree uint64 Bavail uint64 Files uint64 Ffree uint64 Fsid Fsid64_t Vfstype int32 Fsize uint64 Vfsnumber int32 Vfsoff int32 Vfslen int32 Vfsvers int32 Fname [32]uint8 Fpack [32]uint8 Name_max int32 _ [4]byte } const RNDGETENTCNT = 0x80045200 ================================================ FILE: vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go ================================================ // cgo -godefs types_darwin.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build amd64 && darwin package unix const ( SizeofPtr = 0x8 SizeofShort = 0x2 SizeofInt = 0x4 SizeofLong = 0x8 SizeofLongLong = 0x8 ) type ( _C_short int16 _C_int int32 _C_long int64 _C_long_long int64 ) type Timespec struct { Sec int64 Nsec int64 } type Timeval struct { Sec int64 Usec int32 _ [4]byte } type Timeval32 struct { Sec int32 Usec int32 } type Rusage struct { Utime Timeval Stime Timeval Maxrss int64 Ixrss int64 Idrss int64 Isrss int64 Minflt int64 Majflt int64 Nswap int64 Inblock int64 Oublock int64 Msgsnd int64 Msgrcv int64 Nsignals int64 Nvcsw int64 Nivcsw int64 } type Rlimit struct { Cur uint64 Max uint64 } type _Gid_t uint32 type Stat_t struct { Dev int32 Mode uint16 Nlink uint16 Ino uint64 Uid uint32 Gid uint32 Rdev int32 Atim Timespec Mtim Timespec Ctim Timespec Btim Timespec Size int64 Blocks int64 Blksize int32 Flags uint32 Gen uint32 Lspare int32 Qspare [2]int64 } type Statfs_t struct { Bsize uint32 Iosize int32 Blocks uint64 Bfree uint64 Bavail uint64 Files uint64 Ffree uint64 Fsid Fsid Owner uint32 Type uint32 Flags uint32 Fssubtype uint32 Fstypename [16]byte Mntonname [1024]byte Mntfromname [1024]byte Flags_ext uint32 Reserved [7]uint32 } type Flock_t struct { Start int64 Len int64 Pid int32 Type int16 Whence int16 } type Fstore_t struct { Flags uint32 Posmode int32 Offset int64 Length int64 Bytesalloc int64 } type Radvisory_t struct { Offset int64 Count int32 _ [4]byte } type Fbootstraptransfer_t struct { Offset int64 Length uint64 Buffer *byte } type Log2phys_t struct { Flags uint32 _ [16]byte } type Fsid struct { Val [2]int32 } type Dirent struct { Ino uint64 Seekoff uint64 Reclen uint16 Namlen uint16 Type uint8 Name [1024]int8 _ [3]byte } type Attrlist struct { Bitmapcount uint16 Reserved uint16 Commonattr uint32 Volattr uint32 Dirattr uint32 Fileattr uint32 Forkattr uint32 } const ( PathMax = 0x400 ) type RawSockaddrInet4 struct { Len uint8 Family uint8 Port uint16 Addr [4]byte /* in_addr */ Zero [8]int8 } type RawSockaddrInet6 struct { Len uint8 Family uint8 Port uint16 Flowinfo uint32 Addr [16]byte /* in6_addr */ Scope_id uint32 } type RawSockaddrUnix struct { Len uint8 Family uint8 Path [104]int8 } type RawSockaddrDatalink struct { Len uint8 Family uint8 Index uint16 Type uint8 Nlen uint8 Alen uint8 Slen uint8 Data [12]int8 } type RawSockaddr struct { Len uint8 Family uint8 Data [14]int8 } type RawSockaddrAny struct { Addr RawSockaddr Pad [92]int8 } type RawSockaddrCtl struct { Sc_len uint8 Sc_family uint8 Ss_sysaddr uint16 Sc_id uint32 Sc_unit uint32 Sc_reserved [5]uint32 } type RawSockaddrVM struct { Len uint8 Family uint8 Reserved1 uint16 Port uint32 Cid uint32 } type XVSockPCB struct { Xv_len uint32 Xv_vsockpp uint64 Xvp_local_cid uint32 Xvp_local_port uint32 Xvp_remote_cid uint32 Xvp_remote_port uint32 Xvp_rxcnt uint32 Xvp_txcnt uint32 Xvp_peer_rxhiwat uint32 Xvp_peer_rxcnt uint32 Xvp_last_pid int32 Xvp_gencnt uint64 Xv_socket XSocket _ [4]byte } type XSocket struct { Xso_len uint32 Xso_so uint32 So_type int16 So_options int16 So_linger int16 So_state int16 So_pcb uint32 Xso_protocol int32 Xso_family int32 So_qlen int16 So_incqlen int16 So_qlimit int16 So_timeo int16 So_error uint16 So_pgid int32 So_oobmark uint32 So_rcv XSockbuf So_snd XSockbuf So_uid uint32 } type XSocket64 struct { Xso_len uint32 _ [8]byte So_type int16 So_options int16 So_linger int16 So_state int16 _ [8]byte Xso_protocol int32 Xso_family int32 So_qlen int16 So_incqlen int16 So_qlimit int16 So_timeo int16 So_error uint16 So_pgid int32 So_oobmark uint32 So_rcv XSockbuf So_snd XSockbuf So_uid uint32 } type XSockbuf struct { Cc uint32 Hiwat uint32 Mbcnt uint32 Mbmax uint32 Lowat int32 Flags int16 Timeo int16 } type XVSockPgen struct { Len uint32 Count uint64 Gen uint64 Sogen uint64 } type _Socklen uint32 type SaeAssocID uint32 type SaeConnID uint32 type SaEndpoints struct { Srcif uint32 Srcaddr *RawSockaddr Srcaddrlen uint32 Dstaddr *RawSockaddr Dstaddrlen uint32 _ [4]byte } type Xucred struct { Version uint32 Uid uint32 Ngroups int16 Groups [16]uint32 } type Linger struct { Onoff int32 Linger int32 } type Iovec struct { Base *byte Len uint64 } type IPMreq struct { Multiaddr [4]byte /* in_addr */ Interface [4]byte /* in_addr */ } type IPMreqn struct { Multiaddr [4]byte /* in_addr */ Address [4]byte /* in_addr */ Ifindex int32 } type IPv6Mreq struct { Multiaddr [16]byte /* in6_addr */ Interface uint32 } type Msghdr struct { Name *byte Namelen uint32 Iov *Iovec Iovlen int32 Control *byte Controllen uint32 Flags int32 } type Cmsghdr struct { Len uint32 Level int32 Type int32 } type Inet4Pktinfo struct { Ifindex uint32 Spec_dst [4]byte /* in_addr */ Addr [4]byte /* in_addr */ } type Inet6Pktinfo struct { Addr [16]byte /* in6_addr */ Ifindex uint32 } type IPv6MTUInfo struct { Addr RawSockaddrInet6 Mtu uint32 } type ICMPv6Filter struct { Filt [8]uint32 } type TCPConnectionInfo struct { State uint8 Snd_wscale uint8 Rcv_wscale uint8 _ uint8 Options uint32 Flags uint32 Rto uint32 Maxseg uint32 Snd_ssthresh uint32 Snd_cwnd uint32 Snd_wnd uint32 Snd_sbbytes uint32 Rcv_wnd uint32 Rttcur uint32 Srtt uint32 Rttvar uint32 Txpackets uint64 Txbytes uint64 Txretransmitbytes uint64 Rxpackets uint64 Rxbytes uint64 Rxoutoforderbytes uint64 Txretransmitpackets uint64 } const ( SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet6 = 0x1c SizeofSockaddrAny = 0x6c SizeofSockaddrUnix = 0x6a SizeofSockaddrDatalink = 0x14 SizeofSockaddrCtl = 0x20 SizeofSockaddrVM = 0xc SizeofXvsockpcb = 0xa8 SizeofXSocket = 0x64 SizeofXSockbuf = 0x18 SizeofXVSockPgen = 0x20 SizeofXucred = 0x4c SizeofLinger = 0x8 SizeofIovec = 0x10 SizeofIPMreq = 0x8 SizeofIPMreqn = 0xc SizeofIPv6Mreq = 0x14 SizeofMsghdr = 0x30 SizeofCmsghdr = 0xc SizeofInet4Pktinfo = 0xc SizeofInet6Pktinfo = 0x14 SizeofIPv6MTUInfo = 0x20 SizeofICMPv6Filter = 0x20 SizeofTCPConnectionInfo = 0x70 ) const ( PTRACE_TRACEME = 0x0 PTRACE_CONT = 0x7 PTRACE_KILL = 0x8 ) type Kevent_t struct { Ident uint64 Filter int16 Flags uint16 Fflags uint32 Data int64 Udata *byte } type FdSet struct { Bits [32]int32 } const ( SizeofIfMsghdr = 0x70 SizeofIfMsghdr2 = 0xa0 SizeofIfData = 0x60 SizeofIfData64 = 0x80 SizeofIfaMsghdr = 0x14 SizeofIfmaMsghdr = 0x10 SizeofIfmaMsghdr2 = 0x14 SizeofRtMsghdr = 0x5c SizeofRtMsghdr2 = 0x5c SizeofRtMetrics = 0x38 ) type IfMsghdr struct { Msglen uint16 Version uint8 Type uint8 Addrs int32 Flags int32 Index uint16 Data IfData } type IfMsghdr2 struct { Msglen uint16 Version uint8 Type uint8 Addrs int32 Flags int32 Index uint16 Snd_len int32 Snd_maxlen int32 Snd_drops int32 Timer int32 Data IfData64 } type IfData struct { Type uint8 Typelen uint8 Physical uint8 Addrlen uint8 Hdrlen uint8 Recvquota uint8 Xmitquota uint8 Unused1 uint8 Mtu uint32 Metric uint32 Baudrate uint32 Ipackets uint32 Ierrors uint32 Opackets uint32 Oerrors uint32 Collisions uint32 Ibytes uint32 Obytes uint32 Imcasts uint32 Omcasts uint32 Iqdrops uint32 Noproto uint32 Recvtiming uint32 Xmittiming uint32 Lastchange Timeval32 Unused2 uint32 Hwassist uint32 Reserved1 uint32 Reserved2 uint32 } type IfData64 struct { Type uint8 Typelen uint8 Physical uint8 Addrlen uint8 Hdrlen uint8 Recvquota uint8 Xmitquota uint8 Unused1 uint8 Mtu uint32 Metric uint32 Baudrate uint64 Ipackets uint64 Ierrors uint64 Opackets uint64 Oerrors uint64 Collisions uint64 Ibytes uint64 Obytes uint64 Imcasts uint64 Omcasts uint64 Iqdrops uint64 Noproto uint64 Recvtiming uint32 Xmittiming uint32 Lastchange Timeval32 } type IfaMsghdr struct { Msglen uint16 Version uint8 Type uint8 Addrs int32 Flags int32 Index uint16 Metric int32 } type IfmaMsghdr struct { Msglen uint16 Version uint8 Type uint8 Addrs int32 Flags int32 Index uint16 _ [2]byte } type IfmaMsghdr2 struct { Msglen uint16 Version uint8 Type uint8 Addrs int32 Flags int32 Index uint16 Refcount int32 } type RtMsghdr struct { Msglen uint16 Version uint8 Type uint8 Index uint16 Flags int32 Addrs int32 Pid int32 Seq int32 Errno int32 Use int32 Inits uint32 Rmx RtMetrics } type RtMsghdr2 struct { Msglen uint16 Version uint8 Type uint8 Index uint16 Flags int32 Addrs int32 Refcnt int32 Parentflags int32 Reserved int32 Use int32 Inits uint32 Rmx RtMetrics } type RtMetrics struct { Locks uint32 Mtu uint32 Hopcount uint32 Expire int32 Recvpipe uint32 Sendpipe uint32 Ssthresh uint32 Rtt uint32 Rttvar uint32 Pksent uint32 State uint32 Filler [3]uint32 } const ( SizeofBpfVersion = 0x4 SizeofBpfStat = 0x8 SizeofBpfProgram = 0x10 SizeofBpfInsn = 0x8 SizeofBpfHdr = 0x14 ) type BpfVersion struct { Major uint16 Minor uint16 } type BpfStat struct { Recv uint32 Drop uint32 } type BpfProgram struct { Len uint32 Insns *BpfInsn } type BpfInsn struct { Code uint16 Jt uint8 Jf uint8 K uint32 } type BpfHdr struct { Tstamp Timeval32 Caplen uint32 Datalen uint32 Hdrlen uint16 _ [2]byte } type Termios struct { Iflag uint64 Oflag uint64 Cflag uint64 Lflag uint64 Cc [20]uint8 Ispeed uint64 Ospeed uint64 } type Winsize struct { Row uint16 Col uint16 Xpixel uint16 Ypixel uint16 } const ( AT_FDCWD = -0x2 AT_REMOVEDIR = 0x80 AT_SYMLINK_FOLLOW = 0x40 AT_SYMLINK_NOFOLLOW = 0x20 AT_EACCESS = 0x10 ) type PollFd struct { Fd int32 Events int16 Revents int16 } const ( POLLERR = 0x8 POLLHUP = 0x10 POLLIN = 0x1 POLLNVAL = 0x20 POLLOUT = 0x4 POLLPRI = 0x2 POLLRDBAND = 0x80 POLLRDNORM = 0x40 POLLWRBAND = 0x100 POLLWRNORM = 0x4 ) type Utsname struct { Sysname [256]byte Nodename [256]byte Release [256]byte Version [256]byte Machine [256]byte } const SizeofClockinfo = 0x14 type Clockinfo struct { Hz int32 Tick int32 Tickadj int32 Stathz int32 Profhz int32 } type CtlInfo struct { Id uint32 Name [96]byte } const SizeofKinfoProc = 0x288 type Eproc struct { Paddr uintptr Sess uintptr Pcred Pcred Ucred Ucred Vm Vmspace Ppid int32 Pgid int32 Jobc int16 Tdev int32 Tpgid int32 Tsess uintptr Wmesg [8]byte Xsize int32 Xrssize int16 Xccount int16 Xswrss int16 Flag int32 Login [12]byte Spare [4]int32 _ [4]byte } type ExternProc struct { P_starttime Timeval P_vmspace *Vmspace P_sigacts uintptr P_flag int32 P_stat int8 P_pid int32 P_oppid int32 P_dupfd int32 User_stack *int8 Exit_thread *byte P_debugger int32 Sigwait int32 P_estcpu uint32 P_cpticks int32 P_pctcpu uint32 P_wchan *byte P_wmesg *int8 P_swtime uint32 P_slptime uint32 P_realtimer Itimerval P_rtime Timeval P_uticks uint64 P_sticks uint64 P_iticks uint64 P_traceflag int32 P_tracep uintptr P_siglist int32 P_textvp uintptr P_holdcnt int32 P_sigmask uint32 P_sigignore uint32 P_sigcatch uint32 P_priority uint8 P_usrpri uint8 P_nice int8 P_comm [17]byte P_pgrp uintptr P_addr uintptr P_xstat uint16 P_acflag uint16 P_ru *Rusage } type Itimerval struct { Interval Timeval Value Timeval } type KinfoProc struct { Proc ExternProc Eproc Eproc } type Vmspace struct { Dummy int32 Dummy2 *int8 Dummy3 [5]int32 Dummy4 [3]*int8 } type Pcred struct { Pc_lock [72]int8 Pc_ucred uintptr P_ruid uint32 P_svuid uint32 P_rgid uint32 P_svgid uint32 P_refcnt int32 _ [4]byte } type Ucred struct { Ref int32 Uid uint32 Ngroups int16 Groups [16]uint32 } type SysvIpcPerm struct { Uid uint32 Gid uint32 Cuid uint32 Cgid uint32 Mode uint16 _ uint16 _ int32 } type SysvShmDesc struct { Perm SysvIpcPerm Segsz uint64 Lpid int32 Cpid int32 Nattch uint16 _ [34]byte } const ( IPC_CREAT = 0x200 IPC_EXCL = 0x400 IPC_NOWAIT = 0x800 IPC_PRIVATE = 0x0 ) const ( IPC_RMID = 0x0 IPC_SET = 0x1 IPC_STAT = 0x2 ) const ( SHM_RDONLY = 0x1000 SHM_RND = 0x2000 ) ================================================ FILE: vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go ================================================ // cgo -godefs types_darwin.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm64 && darwin package unix const ( SizeofPtr = 0x8 SizeofShort = 0x2 SizeofInt = 0x4 SizeofLong = 0x8 SizeofLongLong = 0x8 ) type ( _C_short int16 _C_int int32 _C_long int64 _C_long_long int64 ) type Timespec struct { Sec int64 Nsec int64 } type Timeval struct { Sec int64 Usec int32 _ [4]byte } type Timeval32 struct { Sec int32 Usec int32 } type Rusage struct { Utime Timeval Stime Timeval Maxrss int64 Ixrss int64 Idrss int64 Isrss int64 Minflt int64 Majflt int64 Nswap int64 Inblock int64 Oublock int64 Msgsnd int64 Msgrcv int64 Nsignals int64 Nvcsw int64 Nivcsw int64 } type Rlimit struct { Cur uint64 Max uint64 } type _Gid_t uint32 type Stat_t struct { Dev int32 Mode uint16 Nlink uint16 Ino uint64 Uid uint32 Gid uint32 Rdev int32 Atim Timespec Mtim Timespec Ctim Timespec Btim Timespec Size int64 Blocks int64 Blksize int32 Flags uint32 Gen uint32 Lspare int32 Qspare [2]int64 } type Statfs_t struct { Bsize uint32 Iosize int32 Blocks uint64 Bfree uint64 Bavail uint64 Files uint64 Ffree uint64 Fsid Fsid Owner uint32 Type uint32 Flags uint32 Fssubtype uint32 Fstypename [16]byte Mntonname [1024]byte Mntfromname [1024]byte Flags_ext uint32 Reserved [7]uint32 } type Flock_t struct { Start int64 Len int64 Pid int32 Type int16 Whence int16 } type Fstore_t struct { Flags uint32 Posmode int32 Offset int64 Length int64 Bytesalloc int64 } type Radvisory_t struct { Offset int64 Count int32 _ [4]byte } type Fbootstraptransfer_t struct { Offset int64 Length uint64 Buffer *byte } type Log2phys_t struct { Flags uint32 _ [16]byte } type Fsid struct { Val [2]int32 } type Dirent struct { Ino uint64 Seekoff uint64 Reclen uint16 Namlen uint16 Type uint8 Name [1024]int8 _ [3]byte } type Attrlist struct { Bitmapcount uint16 Reserved uint16 Commonattr uint32 Volattr uint32 Dirattr uint32 Fileattr uint32 Forkattr uint32 } const ( PathMax = 0x400 ) type RawSockaddrInet4 struct { Len uint8 Family uint8 Port uint16 Addr [4]byte /* in_addr */ Zero [8]int8 } type RawSockaddrInet6 struct { Len uint8 Family uint8 Port uint16 Flowinfo uint32 Addr [16]byte /* in6_addr */ Scope_id uint32 } type RawSockaddrUnix struct { Len uint8 Family uint8 Path [104]int8 } type RawSockaddrDatalink struct { Len uint8 Family uint8 Index uint16 Type uint8 Nlen uint8 Alen uint8 Slen uint8 Data [12]int8 } type RawSockaddr struct { Len uint8 Family uint8 Data [14]int8 } type RawSockaddrAny struct { Addr RawSockaddr Pad [92]int8 } type RawSockaddrCtl struct { Sc_len uint8 Sc_family uint8 Ss_sysaddr uint16 Sc_id uint32 Sc_unit uint32 Sc_reserved [5]uint32 } type RawSockaddrVM struct { Len uint8 Family uint8 Reserved1 uint16 Port uint32 Cid uint32 } type XVSockPCB struct { Xv_len uint32 Xv_vsockpp uint64 Xvp_local_cid uint32 Xvp_local_port uint32 Xvp_remote_cid uint32 Xvp_remote_port uint32 Xvp_rxcnt uint32 Xvp_txcnt uint32 Xvp_peer_rxhiwat uint32 Xvp_peer_rxcnt uint32 Xvp_last_pid int32 Xvp_gencnt uint64 Xv_socket XSocket _ [4]byte } type XSocket struct { Xso_len uint32 Xso_so uint32 So_type int16 So_options int16 So_linger int16 So_state int16 So_pcb uint32 Xso_protocol int32 Xso_family int32 So_qlen int16 So_incqlen int16 So_qlimit int16 So_timeo int16 So_error uint16 So_pgid int32 So_oobmark uint32 So_rcv XSockbuf So_snd XSockbuf So_uid uint32 } type XSocket64 struct { Xso_len uint32 _ [8]byte So_type int16 So_options int16 So_linger int16 So_state int16 _ [8]byte Xso_protocol int32 Xso_family int32 So_qlen int16 So_incqlen int16 So_qlimit int16 So_timeo int16 So_error uint16 So_pgid int32 So_oobmark uint32 So_rcv XSockbuf So_snd XSockbuf So_uid uint32 } type XSockbuf struct { Cc uint32 Hiwat uint32 Mbcnt uint32 Mbmax uint32 Lowat int32 Flags int16 Timeo int16 } type XVSockPgen struct { Len uint32 Count uint64 Gen uint64 Sogen uint64 } type _Socklen uint32 type SaeAssocID uint32 type SaeConnID uint32 type SaEndpoints struct { Srcif uint32 Srcaddr *RawSockaddr Srcaddrlen uint32 Dstaddr *RawSockaddr Dstaddrlen uint32 _ [4]byte } type Xucred struct { Version uint32 Uid uint32 Ngroups int16 Groups [16]uint32 } type Linger struct { Onoff int32 Linger int32 } type Iovec struct { Base *byte Len uint64 } type IPMreq struct { Multiaddr [4]byte /* in_addr */ Interface [4]byte /* in_addr */ } type IPMreqn struct { Multiaddr [4]byte /* in_addr */ Address [4]byte /* in_addr */ Ifindex int32 } type IPv6Mreq struct { Multiaddr [16]byte /* in6_addr */ Interface uint32 } type Msghdr struct { Name *byte Namelen uint32 Iov *Iovec Iovlen int32 Control *byte Controllen uint32 Flags int32 } type Cmsghdr struct { Len uint32 Level int32 Type int32 } type Inet4Pktinfo struct { Ifindex uint32 Spec_dst [4]byte /* in_addr */ Addr [4]byte /* in_addr */ } type Inet6Pktinfo struct { Addr [16]byte /* in6_addr */ Ifindex uint32 } type IPv6MTUInfo struct { Addr RawSockaddrInet6 Mtu uint32 } type ICMPv6Filter struct { Filt [8]uint32 } type TCPConnectionInfo struct { State uint8 Snd_wscale uint8 Rcv_wscale uint8 _ uint8 Options uint32 Flags uint32 Rto uint32 Maxseg uint32 Snd_ssthresh uint32 Snd_cwnd uint32 Snd_wnd uint32 Snd_sbbytes uint32 Rcv_wnd uint32 Rttcur uint32 Srtt uint32 Rttvar uint32 Txpackets uint64 Txbytes uint64 Txretransmitbytes uint64 Rxpackets uint64 Rxbytes uint64 Rxoutoforderbytes uint64 Txretransmitpackets uint64 } const ( SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet6 = 0x1c SizeofSockaddrAny = 0x6c SizeofSockaddrUnix = 0x6a SizeofSockaddrDatalink = 0x14 SizeofSockaddrCtl = 0x20 SizeofSockaddrVM = 0xc SizeofXvsockpcb = 0xa8 SizeofXSocket = 0x64 SizeofXSockbuf = 0x18 SizeofXVSockPgen = 0x20 SizeofXucred = 0x4c SizeofLinger = 0x8 SizeofIovec = 0x10 SizeofIPMreq = 0x8 SizeofIPMreqn = 0xc SizeofIPv6Mreq = 0x14 SizeofMsghdr = 0x30 SizeofCmsghdr = 0xc SizeofInet4Pktinfo = 0xc SizeofInet6Pktinfo = 0x14 SizeofIPv6MTUInfo = 0x20 SizeofICMPv6Filter = 0x20 SizeofTCPConnectionInfo = 0x70 ) const ( PTRACE_TRACEME = 0x0 PTRACE_CONT = 0x7 PTRACE_KILL = 0x8 ) type Kevent_t struct { Ident uint64 Filter int16 Flags uint16 Fflags uint32 Data int64 Udata *byte } type FdSet struct { Bits [32]int32 } const ( SizeofIfMsghdr = 0x70 SizeofIfMsghdr2 = 0xa0 SizeofIfData = 0x60 SizeofIfData64 = 0x80 SizeofIfaMsghdr = 0x14 SizeofIfmaMsghdr = 0x10 SizeofIfmaMsghdr2 = 0x14 SizeofRtMsghdr = 0x5c SizeofRtMsghdr2 = 0x5c SizeofRtMetrics = 0x38 ) type IfMsghdr struct { Msglen uint16 Version uint8 Type uint8 Addrs int32 Flags int32 Index uint16 Data IfData } type IfMsghdr2 struct { Msglen uint16 Version uint8 Type uint8 Addrs int32 Flags int32 Index uint16 Snd_len int32 Snd_maxlen int32 Snd_drops int32 Timer int32 Data IfData64 } type IfData struct { Type uint8 Typelen uint8 Physical uint8 Addrlen uint8 Hdrlen uint8 Recvquota uint8 Xmitquota uint8 Unused1 uint8 Mtu uint32 Metric uint32 Baudrate uint32 Ipackets uint32 Ierrors uint32 Opackets uint32 Oerrors uint32 Collisions uint32 Ibytes uint32 Obytes uint32 Imcasts uint32 Omcasts uint32 Iqdrops uint32 Noproto uint32 Recvtiming uint32 Xmittiming uint32 Lastchange Timeval32 Unused2 uint32 Hwassist uint32 Reserved1 uint32 Reserved2 uint32 } type IfData64 struct { Type uint8 Typelen uint8 Physical uint8 Addrlen uint8 Hdrlen uint8 Recvquota uint8 Xmitquota uint8 Unused1 uint8 Mtu uint32 Metric uint32 Baudrate uint64 Ipackets uint64 Ierrors uint64 Opackets uint64 Oerrors uint64 Collisions uint64 Ibytes uint64 Obytes uint64 Imcasts uint64 Omcasts uint64 Iqdrops uint64 Noproto uint64 Recvtiming uint32 Xmittiming uint32 Lastchange Timeval32 } type IfaMsghdr struct { Msglen uint16 Version uint8 Type uint8 Addrs int32 Flags int32 Index uint16 Metric int32 } type IfmaMsghdr struct { Msglen uint16 Version uint8 Type uint8 Addrs int32 Flags int32 Index uint16 _ [2]byte } type IfmaMsghdr2 struct { Msglen uint16 Version uint8 Type uint8 Addrs int32 Flags int32 Index uint16 Refcount int32 } type RtMsghdr struct { Msglen uint16 Version uint8 Type uint8 Index uint16 Flags int32 Addrs int32 Pid int32 Seq int32 Errno int32 Use int32 Inits uint32 Rmx RtMetrics } type RtMsghdr2 struct { Msglen uint16 Version uint8 Type uint8 Index uint16 Flags int32 Addrs int32 Refcnt int32 Parentflags int32 Reserved int32 Use int32 Inits uint32 Rmx RtMetrics } type RtMetrics struct { Locks uint32 Mtu uint32 Hopcount uint32 Expire int32 Recvpipe uint32 Sendpipe uint32 Ssthresh uint32 Rtt uint32 Rttvar uint32 Pksent uint32 State uint32 Filler [3]uint32 } const ( SizeofBpfVersion = 0x4 SizeofBpfStat = 0x8 SizeofBpfProgram = 0x10 SizeofBpfInsn = 0x8 SizeofBpfHdr = 0x14 ) type BpfVersion struct { Major uint16 Minor uint16 } type BpfStat struct { Recv uint32 Drop uint32 } type BpfProgram struct { Len uint32 Insns *BpfInsn } type BpfInsn struct { Code uint16 Jt uint8 Jf uint8 K uint32 } type BpfHdr struct { Tstamp Timeval32 Caplen uint32 Datalen uint32 Hdrlen uint16 _ [2]byte } type Termios struct { Iflag uint64 Oflag uint64 Cflag uint64 Lflag uint64 Cc [20]uint8 Ispeed uint64 Ospeed uint64 } type Winsize struct { Row uint16 Col uint16 Xpixel uint16 Ypixel uint16 } const ( AT_FDCWD = -0x2 AT_REMOVEDIR = 0x80 AT_SYMLINK_FOLLOW = 0x40 AT_SYMLINK_NOFOLLOW = 0x20 AT_EACCESS = 0x10 ) type PollFd struct { Fd int32 Events int16 Revents int16 } const ( POLLERR = 0x8 POLLHUP = 0x10 POLLIN = 0x1 POLLNVAL = 0x20 POLLOUT = 0x4 POLLPRI = 0x2 POLLRDBAND = 0x80 POLLRDNORM = 0x40 POLLWRBAND = 0x100 POLLWRNORM = 0x4 ) type Utsname struct { Sysname [256]byte Nodename [256]byte Release [256]byte Version [256]byte Machine [256]byte } const SizeofClockinfo = 0x14 type Clockinfo struct { Hz int32 Tick int32 Tickadj int32 Stathz int32 Profhz int32 } type CtlInfo struct { Id uint32 Name [96]byte } const SizeofKinfoProc = 0x288 type Eproc struct { Paddr uintptr Sess uintptr Pcred Pcred Ucred Ucred Vm Vmspace Ppid int32 Pgid int32 Jobc int16 Tdev int32 Tpgid int32 Tsess uintptr Wmesg [8]byte Xsize int32 Xrssize int16 Xccount int16 Xswrss int16 Flag int32 Login [12]byte Spare [4]int32 _ [4]byte } type ExternProc struct { P_starttime Timeval P_vmspace *Vmspace P_sigacts uintptr P_flag int32 P_stat int8 P_pid int32 P_oppid int32 P_dupfd int32 User_stack *int8 Exit_thread *byte P_debugger int32 Sigwait int32 P_estcpu uint32 P_cpticks int32 P_pctcpu uint32 P_wchan *byte P_wmesg *int8 P_swtime uint32 P_slptime uint32 P_realtimer Itimerval P_rtime Timeval P_uticks uint64 P_sticks uint64 P_iticks uint64 P_traceflag int32 P_tracep uintptr P_siglist int32 P_textvp uintptr P_holdcnt int32 P_sigmask uint32 P_sigignore uint32 P_sigcatch uint32 P_priority uint8 P_usrpri uint8 P_nice int8 P_comm [17]byte P_pgrp uintptr P_addr uintptr P_xstat uint16 P_acflag uint16 P_ru *Rusage } type Itimerval struct { Interval Timeval Value Timeval } type KinfoProc struct { Proc ExternProc Eproc Eproc } type Vmspace struct { Dummy int32 Dummy2 *int8 Dummy3 [5]int32 Dummy4 [3]*int8 } type Pcred struct { Pc_lock [72]int8 Pc_ucred uintptr P_ruid uint32 P_svuid uint32 P_rgid uint32 P_svgid uint32 P_refcnt int32 _ [4]byte } type Ucred struct { Ref int32 Uid uint32 Ngroups int16 Groups [16]uint32 } type SysvIpcPerm struct { Uid uint32 Gid uint32 Cuid uint32 Cgid uint32 Mode uint16 _ uint16 _ int32 } type SysvShmDesc struct { Perm SysvIpcPerm Segsz uint64 Lpid int32 Cpid int32 Nattch uint16 _ [34]byte } const ( IPC_CREAT = 0x200 IPC_EXCL = 0x400 IPC_NOWAIT = 0x800 IPC_PRIVATE = 0x0 ) const ( IPC_RMID = 0x0 IPC_SET = 0x1 IPC_STAT = 0x2 ) const ( SHM_RDONLY = 0x1000 SHM_RND = 0x2000 ) ================================================ FILE: vendor/golang.org/x/sys/unix/ztypes_dragonfly_amd64.go ================================================ // cgo -godefs types_dragonfly.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build amd64 && dragonfly package unix const ( SizeofPtr = 0x8 SizeofShort = 0x2 SizeofInt = 0x4 SizeofLong = 0x8 SizeofLongLong = 0x8 ) type ( _C_short int16 _C_int int32 _C_long int64 _C_long_long int64 ) type Timespec struct { Sec int64 Nsec int64 } type Timeval struct { Sec int64 Usec int64 } type Rusage struct { Utime Timeval Stime Timeval Maxrss int64 Ixrss int64 Idrss int64 Isrss int64 Minflt int64 Majflt int64 Nswap int64 Inblock int64 Oublock int64 Msgsnd int64 Msgrcv int64 Nsignals int64 Nvcsw int64 Nivcsw int64 } type Rlimit struct { Cur int64 Max int64 } type _Gid_t uint32 type Stat_t struct { Ino uint64 Nlink uint32 Dev uint32 Mode uint16 _1 uint16 Uid uint32 Gid uint32 Rdev uint32 Atim Timespec Mtim Timespec Ctim Timespec Size int64 Blocks int64 _ uint32 Flags uint32 Gen uint32 Lspare int32 Blksize int64 Qspare2 int64 } type Statfs_t struct { Spare2 int64 Bsize int64 Iosize int64 Blocks int64 Bfree int64 Bavail int64 Files int64 Ffree int64 Fsid Fsid Owner uint32 Type int32 Flags int32 Syncwrites int64 Asyncwrites int64 Fstypename [16]byte Mntonname [80]byte Syncreads int64 Asyncreads int64 Spares1 int16 Mntfromname [80]byte Spares2 int16 Spare [2]int64 } type Flock_t struct { Start int64 Len int64 Pid int32 Type int16 Whence int16 } type Dirent struct { Fileno uint64 Namlen uint16 Type uint8 Unused1 uint8 Unused2 uint32 Name [256]int8 } type Fsid struct { Val [2]int32 } const ( PathMax = 0x400 ) type RawSockaddrInet4 struct { Len uint8 Family uint8 Port uint16 Addr [4]byte /* in_addr */ Zero [8]int8 } type RawSockaddrInet6 struct { Len uint8 Family uint8 Port uint16 Flowinfo uint32 Addr [16]byte /* in6_addr */ Scope_id uint32 } type RawSockaddrUnix struct { Len uint8 Family uint8 Path [104]int8 } type RawSockaddrDatalink struct { Len uint8 Family uint8 Index uint16 Type uint8 Nlen uint8 Alen uint8 Slen uint8 Data [12]int8 Rcf uint16 Route [16]uint16 } type RawSockaddr struct { Len uint8 Family uint8 Data [14]int8 } type RawSockaddrAny struct { Addr RawSockaddr Pad [92]int8 } type _Socklen uint32 type Linger struct { Onoff int32 Linger int32 } type Iovec struct { Base *byte Len uint64 } type IPMreq struct { Multiaddr [4]byte /* in_addr */ Interface [4]byte /* in_addr */ } type IPv6Mreq struct { Multiaddr [16]byte /* in6_addr */ Interface uint32 } type Msghdr struct { Name *byte Namelen uint32 Iov *Iovec Iovlen int32 Control *byte Controllen uint32 Flags int32 } type Cmsghdr struct { Len uint32 Level int32 Type int32 } type Inet6Pktinfo struct { Addr [16]byte /* in6_addr */ Ifindex uint32 } type IPv6MTUInfo struct { Addr RawSockaddrInet6 Mtu uint32 } type ICMPv6Filter struct { Filt [8]uint32 } const ( SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet6 = 0x1c SizeofSockaddrAny = 0x6c SizeofSockaddrUnix = 0x6a SizeofSockaddrDatalink = 0x36 SizeofLinger = 0x8 SizeofIovec = 0x10 SizeofIPMreq = 0x8 SizeofIPv6Mreq = 0x14 SizeofMsghdr = 0x30 SizeofCmsghdr = 0xc SizeofInet6Pktinfo = 0x14 SizeofIPv6MTUInfo = 0x20 SizeofICMPv6Filter = 0x20 ) const ( PTRACE_TRACEME = 0x0 PTRACE_CONT = 0x7 PTRACE_KILL = 0x8 ) type Kevent_t struct { Ident uint64 Filter int16 Flags uint16 Fflags uint32 Data int64 Udata *byte } type FdSet struct { Bits [16]uint64 } const ( SizeofIfMsghdr = 0xb0 SizeofIfData = 0xa0 SizeofIfaMsghdr = 0x18 SizeofIfmaMsghdr = 0x10 SizeofIfAnnounceMsghdr = 0x18 SizeofRtMsghdr = 0x98 SizeofRtMetrics = 0x70 ) type IfMsghdr struct { Msglen uint16 Version uint8 Type uint8 Index uint16 Flags int32 Addrs int32 Data IfData } type IfData struct { Type uint8 Physical uint8 Addrlen uint8 Hdrlen uint8 Recvquota uint8 Xmitquota uint8 Mtu uint64 Metric uint64 Link_state uint64 Baudrate uint64 Ipackets uint64 Ierrors uint64 Opackets uint64 Oerrors uint64 Collisions uint64 Ibytes uint64 Obytes uint64 Imcasts uint64 Omcasts uint64 Iqdrops uint64 Noproto uint64 Hwassist uint64 Oqdrops uint64 Lastchange Timeval } type IfaMsghdr struct { Msglen uint16 Version uint8 Type uint8 Index uint16 Flags int32 Addrs int32 Addrflags int32 Metric int32 } type IfmaMsghdr struct { Msglen uint16 Version uint8 Type uint8 Index uint16 Flags int32 Addrs int32 } type IfAnnounceMsghdr struct { Msglen uint16 Version uint8 Type uint8 Index uint16 Name [16]int8 What uint16 } type RtMsghdr struct { Msglen uint16 Version uint8 Type uint8 Index uint16 Flags int32 Addrs int32 Pid int32 Seq int32 Errno int32 Use int32 Inits uint64 Rmx RtMetrics } type RtMetrics struct { Locks uint64 Mtu uint64 Pksent uint64 Expire uint64 Sendpipe uint64 Ssthresh uint64 Rtt uint64 Rttvar uint64 Recvpipe uint64 Hopcount uint64 Mssopt uint16 Pad uint16 Msl uint64 Iwmaxsegs uint64 Iwcapsegs uint64 } const ( SizeofBpfVersion = 0x4 SizeofBpfStat = 0x8 SizeofBpfProgram = 0x10 SizeofBpfInsn = 0x8 SizeofBpfHdr = 0x20 ) type BpfVersion struct { Major uint16 Minor uint16 } type BpfStat struct { Recv uint32 Drop uint32 } type BpfProgram struct { Len uint32 Insns *BpfInsn } type BpfInsn struct { Code uint16 Jt uint8 Jf uint8 K uint32 } type BpfHdr struct { Tstamp Timeval Caplen uint32 Datalen uint32 Hdrlen uint16 _ [6]byte } type Termios struct { Iflag uint32 Oflag uint32 Cflag uint32 Lflag uint32 Cc [20]uint8 Ispeed uint32 Ospeed uint32 } type Winsize struct { Row uint16 Col uint16 Xpixel uint16 Ypixel uint16 } const ( AT_FDCWD = 0xfffafdcd AT_SYMLINK_NOFOLLOW = 0x1 AT_REMOVEDIR = 0x2 AT_EACCESS = 0x4 AT_SYMLINK_FOLLOW = 0x8 ) type PollFd struct { Fd int32 Events int16 Revents int16 } const ( POLLERR = 0x8 POLLHUP = 0x10 POLLIN = 0x1 POLLNVAL = 0x20 POLLOUT = 0x4 POLLPRI = 0x2 POLLRDBAND = 0x80 POLLRDNORM = 0x40 POLLWRBAND = 0x100 POLLWRNORM = 0x4 ) type Utsname struct { Sysname [32]byte Nodename [32]byte Release [32]byte Version [32]byte Machine [32]byte } const SizeofClockinfo = 0x14 type Clockinfo struct { Hz int32 Tick int32 Tickadj int32 Stathz int32 Profhz int32 } ================================================ FILE: vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go ================================================ // cgo -godefs types_freebsd.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build 386 && freebsd package unix const ( SizeofPtr = 0x4 SizeofShort = 0x2 SizeofInt = 0x4 SizeofLong = 0x4 SizeofLongLong = 0x8 ) type ( _C_short int16 _C_int int32 _C_long int32 _C_long_long int64 ) type Timespec struct { Sec int32 Nsec int32 } type Timeval struct { Sec int32 Usec int32 } type Time_t int32 type Rusage struct { Utime Timeval Stime Timeval Maxrss int32 Ixrss int32 Idrss int32 Isrss int32 Minflt int32 Majflt int32 Nswap int32 Inblock int32 Oublock int32 Msgsnd int32 Msgrcv int32 Nsignals int32 Nvcsw int32 Nivcsw int32 } type Rlimit struct { Cur int64 Max int64 } type _Gid_t uint32 const ( _statfsVersion = 0x20140518 _dirblksiz = 0x400 ) type Stat_t struct { Dev uint64 Ino uint64 Nlink uint64 Mode uint16 _0 int16 Uid uint32 Gid uint32 _1 int32 Rdev uint64 _ int32 Atim Timespec _ int32 Mtim Timespec _ int32 Ctim Timespec _ int32 Btim Timespec Size int64 Blocks int64 Blksize int32 Flags uint32 Gen uint64 Spare [10]uint64 } type Statfs_t struct { Version uint32 Type uint32 Flags uint64 Bsize uint64 Iosize uint64 Blocks uint64 Bfree uint64 Bavail int64 Files uint64 Ffree int64 Syncwrites uint64 Asyncwrites uint64 Syncreads uint64 Asyncreads uint64 Spare [10]uint64 Namemax uint32 Owner uint32 Fsid Fsid Charspare [80]int8 Fstypename [16]byte Mntfromname [1024]byte Mntonname [1024]byte } type Flock_t struct { Start int64 Len int64 Pid int32 Type int16 Whence int16 Sysid int32 } type Dirent struct { Fileno uint64 Off int64 Reclen uint16 Type uint8 Pad0 uint8 Namlen uint16 Pad1 uint16 Name [256]int8 } type Fsid struct { Val [2]int32 } const ( PathMax = 0x400 ) const ( FADV_NORMAL = 0x0 FADV_RANDOM = 0x1 FADV_SEQUENTIAL = 0x2 FADV_WILLNEED = 0x3 FADV_DONTNEED = 0x4 FADV_NOREUSE = 0x5 ) type RawSockaddrInet4 struct { Len uint8 Family uint8 Port uint16 Addr [4]byte /* in_addr */ Zero [8]int8 } type RawSockaddrInet6 struct { Len uint8 Family uint8 Port uint16 Flowinfo uint32 Addr [16]byte /* in6_addr */ Scope_id uint32 } type RawSockaddrUnix struct { Len uint8 Family uint8 Path [104]int8 } type RawSockaddrDatalink struct { Len uint8 Family uint8 Index uint16 Type uint8 Nlen uint8 Alen uint8 Slen uint8 Data [46]int8 } type RawSockaddr struct { Len uint8 Family uint8 Data [14]int8 } type RawSockaddrAny struct { Addr RawSockaddr Pad [92]int8 } type _Socklen uint32 type Xucred struct { Version uint32 Uid uint32 Ngroups int16 Groups [16]uint32 _ *byte } type Linger struct { Onoff int32 Linger int32 } type Iovec struct { Base *byte Len uint32 } type IPMreq struct { Multiaddr [4]byte /* in_addr */ Interface [4]byte /* in_addr */ } type IPMreqn struct { Multiaddr [4]byte /* in_addr */ Address [4]byte /* in_addr */ Ifindex int32 } type IPv6Mreq struct { Multiaddr [16]byte /* in6_addr */ Interface uint32 } type Msghdr struct { Name *byte Namelen uint32 Iov *Iovec Iovlen int32 Control *byte Controllen uint32 Flags int32 } type Cmsghdr struct { Len uint32 Level int32 Type int32 } type Inet6Pktinfo struct { Addr [16]byte /* in6_addr */ Ifindex uint32 } type IPv6MTUInfo struct { Addr RawSockaddrInet6 Mtu uint32 } type ICMPv6Filter struct { Filt [8]uint32 } const ( SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet6 = 0x1c SizeofSockaddrAny = 0x6c SizeofSockaddrUnix = 0x6a SizeofSockaddrDatalink = 0x36 SizeofXucred = 0x50 SizeofLinger = 0x8 SizeofIovec = 0x8 SizeofIPMreq = 0x8 SizeofIPMreqn = 0xc SizeofIPv6Mreq = 0x14 SizeofMsghdr = 0x1c SizeofCmsghdr = 0xc SizeofInet6Pktinfo = 0x14 SizeofIPv6MTUInfo = 0x20 SizeofICMPv6Filter = 0x20 ) const ( PTRACE_TRACEME = 0x0 PTRACE_CONT = 0x7 PTRACE_KILL = 0x8 ) type PtraceLwpInfoStruct struct { Lwpid int32 Event int32 Flags int32 Sigmask Sigset_t Siglist Sigset_t Siginfo __PtraceSiginfo Tdname [20]int8 Child_pid int32 Syscall_code uint32 Syscall_narg uint32 } type __Siginfo struct { Signo int32 Errno int32 Code int32 Pid int32 Uid uint32 Status int32 Addr *byte Value [4]byte _ [32]byte } type __PtraceSiginfo struct { Signo int32 Errno int32 Code int32 Pid int32 Uid uint32 Status int32 Addr uintptr Value [4]byte _ [32]byte } type Sigset_t struct { Val [4]uint32 } type Reg struct { Fs uint32 Es uint32 Ds uint32 Edi uint32 Esi uint32 Ebp uint32 Isp uint32 Ebx uint32 Edx uint32 Ecx uint32 Eax uint32 Trapno uint32 Err uint32 Eip uint32 Cs uint32 Eflags uint32 Esp uint32 Ss uint32 Gs uint32 } type FpReg struct { Env [7]uint32 Acc [8][10]uint8 Ex_sw uint32 Pad [64]uint8 } type FpExtendedPrecision struct{} type PtraceIoDesc struct { Op int32 Offs uintptr Addr *byte Len uint32 } type Kevent_t struct { Ident uint32 Filter int16 Flags uint16 Fflags uint32 Data int64 Udata *byte Ext [4]uint64 } type FdSet struct { Bits [32]uint32 } const ( sizeofIfMsghdr = 0xa8 SizeofIfMsghdr = 0x60 sizeofIfData = 0x98 SizeofIfData = 0x50 SizeofIfaMsghdr = 0x14 SizeofIfmaMsghdr = 0x10 SizeofIfAnnounceMsghdr = 0x18 SizeofRtMsghdr = 0x5c SizeofRtMetrics = 0x38 ) type ifMsghdr struct { Msglen uint16 Version uint8 Type uint8 Addrs int32 Flags int32 Index uint16 _ uint16 Data ifData } type IfMsghdr struct { Msglen uint16 Version uint8 Type uint8 Addrs int32 Flags int32 Index uint16 Data IfData } type ifData struct { Type uint8 Physical uint8 Addrlen uint8 Hdrlen uint8 Link_state uint8 Vhid uint8 Datalen uint16 Mtu uint32 Metric uint32 Baudrate uint64 Ipackets uint64 Ierrors uint64 Opackets uint64 Oerrors uint64 Collisions uint64 Ibytes uint64 Obytes uint64 Imcasts uint64 Omcasts uint64 Iqdrops uint64 Oqdrops uint64 Noproto uint64 Hwassist uint64 _ [8]byte _ [16]byte } type IfData struct { Type uint8 Physical uint8 Addrlen uint8 Hdrlen uint8 Link_state uint8 Spare_char1 uint8 Spare_char2 uint8 Datalen uint8 Mtu uint32 Metric uint32 Baudrate uint32 Ipackets uint32 Ierrors uint32 Opackets uint32 Oerrors uint32 Collisions uint32 Ibytes uint32 Obytes uint32 Imcasts uint32 Omcasts uint32 Iqdrops uint32 Noproto uint32 Hwassist uint32 Epoch int32 Lastchange Timeval } type IfaMsghdr struct { Msglen uint16 Version uint8 Type uint8 Addrs int32 Flags int32 Index uint16 _ uint16 Metric int32 } type IfmaMsghdr struct { Msglen uint16 Version uint8 Type uint8 Addrs int32 Flags int32 Index uint16 _ uint16 } type IfAnnounceMsghdr struct { Msglen uint16 Version uint8 Type uint8 Index uint16 Name [16]int8 What uint16 } type RtMsghdr struct { Msglen uint16 Version uint8 Type uint8 Index uint16 _ uint16 Flags int32 Addrs int32 Pid int32 Seq int32 Errno int32 Fmask int32 Inits uint32 Rmx RtMetrics } type RtMetrics struct { Locks uint32 Mtu uint32 Hopcount uint32 Expire uint32 Recvpipe uint32 Sendpipe uint32 Ssthresh uint32 Rtt uint32 Rttvar uint32 Pksent uint32 Weight uint32 Filler [3]uint32 } const ( SizeofBpfVersion = 0x4 SizeofBpfStat = 0x8 SizeofBpfZbuf = 0xc SizeofBpfProgram = 0x8 SizeofBpfInsn = 0x8 SizeofBpfHdr = 0x14 SizeofBpfZbufHeader = 0x20 ) type BpfVersion struct { Major uint16 Minor uint16 } type BpfStat struct { Recv uint32 Drop uint32 } type BpfZbuf struct { Bufa *byte Bufb *byte Buflen uint32 } type BpfProgram struct { Len uint32 Insns *BpfInsn } type BpfInsn struct { Code uint16 Jt uint8 Jf uint8 K uint32 } type BpfHdr struct { Tstamp Timeval Caplen uint32 Datalen uint32 Hdrlen uint16 _ [2]byte } type BpfZbufHeader struct { Kernel_gen uint32 Kernel_len uint32 User_gen uint32 _ [5]uint32 } type Termios struct { Iflag uint32 Oflag uint32 Cflag uint32 Lflag uint32 Cc [20]uint8 Ispeed uint32 Ospeed uint32 } type Winsize struct { Row uint16 Col uint16 Xpixel uint16 Ypixel uint16 } const ( AT_FDCWD = -0x64 AT_EACCESS = 0x100 AT_SYMLINK_NOFOLLOW = 0x200 AT_SYMLINK_FOLLOW = 0x400 AT_REMOVEDIR = 0x800 ) type PollFd struct { Fd int32 Events int16 Revents int16 } const ( POLLERR = 0x8 POLLHUP = 0x10 POLLIN = 0x1 POLLINIGNEOF = 0x2000 POLLNVAL = 0x20 POLLOUT = 0x4 POLLPRI = 0x2 POLLRDBAND = 0x80 POLLRDNORM = 0x40 POLLWRBAND = 0x100 POLLWRNORM = 0x4 POLLRDHUP = 0x4000 ) type CapRights struct { Rights [2]uint64 } type Utsname struct { Sysname [256]byte Nodename [256]byte Release [256]byte Version [256]byte Machine [256]byte } const SizeofClockinfo = 0x14 type Clockinfo struct { Hz int32 Tick int32 Spare int32 Stathz int32 Profhz int32 } ================================================ FILE: vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go ================================================ // cgo -godefs types_freebsd.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build amd64 && freebsd package unix const ( SizeofPtr = 0x8 SizeofShort = 0x2 SizeofInt = 0x4 SizeofLong = 0x8 SizeofLongLong = 0x8 ) type ( _C_short int16 _C_int int32 _C_long int64 _C_long_long int64 ) type Timespec struct { Sec int64 Nsec int64 } type Timeval struct { Sec int64 Usec int64 } type Time_t int64 type Rusage struct { Utime Timeval Stime Timeval Maxrss int64 Ixrss int64 Idrss int64 Isrss int64 Minflt int64 Majflt int64 Nswap int64 Inblock int64 Oublock int64 Msgsnd int64 Msgrcv int64 Nsignals int64 Nvcsw int64 Nivcsw int64 } type Rlimit struct { Cur int64 Max int64 } type _Gid_t uint32 const ( _statfsVersion = 0x20140518 _dirblksiz = 0x400 ) type Stat_t struct { Dev uint64 Ino uint64 Nlink uint64 Mode uint16 _0 int16 Uid uint32 Gid uint32 _1 int32 Rdev uint64 Atim Timespec Mtim Timespec Ctim Timespec Btim Timespec Size int64 Blocks int64 Blksize int32 Flags uint32 Gen uint64 Spare [10]uint64 } type Statfs_t struct { Version uint32 Type uint32 Flags uint64 Bsize uint64 Iosize uint64 Blocks uint64 Bfree uint64 Bavail int64 Files uint64 Ffree int64 Syncwrites uint64 Asyncwrites uint64 Syncreads uint64 Asyncreads uint64 Spare [10]uint64 Namemax uint32 Owner uint32 Fsid Fsid Charspare [80]int8 Fstypename [16]byte Mntfromname [1024]byte Mntonname [1024]byte } type Flock_t struct { Start int64 Len int64 Pid int32 Type int16 Whence int16 Sysid int32 _ [4]byte } type Dirent struct { Fileno uint64 Off int64 Reclen uint16 Type uint8 Pad0 uint8 Namlen uint16 Pad1 uint16 Name [256]int8 } type Fsid struct { Val [2]int32 } const ( PathMax = 0x400 ) const ( FADV_NORMAL = 0x0 FADV_RANDOM = 0x1 FADV_SEQUENTIAL = 0x2 FADV_WILLNEED = 0x3 FADV_DONTNEED = 0x4 FADV_NOREUSE = 0x5 ) type RawSockaddrInet4 struct { Len uint8 Family uint8 Port uint16 Addr [4]byte /* in_addr */ Zero [8]int8 } type RawSockaddrInet6 struct { Len uint8 Family uint8 Port uint16 Flowinfo uint32 Addr [16]byte /* in6_addr */ Scope_id uint32 } type RawSockaddrUnix struct { Len uint8 Family uint8 Path [104]int8 } type RawSockaddrDatalink struct { Len uint8 Family uint8 Index uint16 Type uint8 Nlen uint8 Alen uint8 Slen uint8 Data [46]int8 } type RawSockaddr struct { Len uint8 Family uint8 Data [14]int8 } type RawSockaddrAny struct { Addr RawSockaddr Pad [92]int8 } type _Socklen uint32 type Xucred struct { Version uint32 Uid uint32 Ngroups int16 Groups [16]uint32 _ *byte } type Linger struct { Onoff int32 Linger int32 } type Iovec struct { Base *byte Len uint64 } type IPMreq struct { Multiaddr [4]byte /* in_addr */ Interface [4]byte /* in_addr */ } type IPMreqn struct { Multiaddr [4]byte /* in_addr */ Address [4]byte /* in_addr */ Ifindex int32 } type IPv6Mreq struct { Multiaddr [16]byte /* in6_addr */ Interface uint32 } type Msghdr struct { Name *byte Namelen uint32 Iov *Iovec Iovlen int32 Control *byte Controllen uint32 Flags int32 } type Cmsghdr struct { Len uint32 Level int32 Type int32 } type Inet6Pktinfo struct { Addr [16]byte /* in6_addr */ Ifindex uint32 } type IPv6MTUInfo struct { Addr RawSockaddrInet6 Mtu uint32 } type ICMPv6Filter struct { Filt [8]uint32 } const ( SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet6 = 0x1c SizeofSockaddrAny = 0x6c SizeofSockaddrUnix = 0x6a SizeofSockaddrDatalink = 0x36 SizeofXucred = 0x58 SizeofLinger = 0x8 SizeofIovec = 0x10 SizeofIPMreq = 0x8 SizeofIPMreqn = 0xc SizeofIPv6Mreq = 0x14 SizeofMsghdr = 0x30 SizeofCmsghdr = 0xc SizeofInet6Pktinfo = 0x14 SizeofIPv6MTUInfo = 0x20 SizeofICMPv6Filter = 0x20 ) const ( PTRACE_TRACEME = 0x0 PTRACE_CONT = 0x7 PTRACE_KILL = 0x8 ) type PtraceLwpInfoStruct struct { Lwpid int32 Event int32 Flags int32 Sigmask Sigset_t Siglist Sigset_t Siginfo __PtraceSiginfo Tdname [20]int8 Child_pid int32 Syscall_code uint32 Syscall_narg uint32 } type __Siginfo struct { Signo int32 Errno int32 Code int32 Pid int32 Uid uint32 Status int32 Addr *byte Value [8]byte _ [40]byte } type __PtraceSiginfo struct { Signo int32 Errno int32 Code int32 Pid int32 Uid uint32 Status int32 Addr uintptr Value [8]byte _ [40]byte } type Sigset_t struct { Val [4]uint32 } type Reg struct { R15 int64 R14 int64 R13 int64 R12 int64 R11 int64 R10 int64 R9 int64 R8 int64 Rdi int64 Rsi int64 Rbp int64 Rbx int64 Rdx int64 Rcx int64 Rax int64 Trapno uint32 Fs uint16 Gs uint16 Err uint32 Es uint16 Ds uint16 Rip int64 Cs int64 Rflags int64 Rsp int64 Ss int64 } type FpReg struct { Env [4]uint64 Acc [8][16]uint8 Xacc [16][16]uint8 Spare [12]uint64 } type FpExtendedPrecision struct{} type PtraceIoDesc struct { Op int32 Offs uintptr Addr *byte Len uint64 } type Kevent_t struct { Ident uint64 Filter int16 Flags uint16 Fflags uint32 Data int64 Udata *byte Ext [4]uint64 } type FdSet struct { Bits [16]uint64 } const ( sizeofIfMsghdr = 0xa8 SizeofIfMsghdr = 0xa8 sizeofIfData = 0x98 SizeofIfData = 0x98 SizeofIfaMsghdr = 0x14 SizeofIfmaMsghdr = 0x10 SizeofIfAnnounceMsghdr = 0x18 SizeofRtMsghdr = 0x98 SizeofRtMetrics = 0x70 ) type ifMsghdr struct { Msglen uint16 Version uint8 Type uint8 Addrs int32 Flags int32 Index uint16 _ uint16 Data ifData } type IfMsghdr struct { Msglen uint16 Version uint8 Type uint8 Addrs int32 Flags int32 Index uint16 Data IfData } type ifData struct { Type uint8 Physical uint8 Addrlen uint8 Hdrlen uint8 Link_state uint8 Vhid uint8 Datalen uint16 Mtu uint32 Metric uint32 Baudrate uint64 Ipackets uint64 Ierrors uint64 Opackets uint64 Oerrors uint64 Collisions uint64 Ibytes uint64 Obytes uint64 Imcasts uint64 Omcasts uint64 Iqdrops uint64 Oqdrops uint64 Noproto uint64 Hwassist uint64 _ [8]byte _ [16]byte } type IfData struct { Type uint8 Physical uint8 Addrlen uint8 Hdrlen uint8 Link_state uint8 Spare_char1 uint8 Spare_char2 uint8 Datalen uint8 Mtu uint64 Metric uint64 Baudrate uint64 Ipackets uint64 Ierrors uint64 Opackets uint64 Oerrors uint64 Collisions uint64 Ibytes uint64 Obytes uint64 Imcasts uint64 Omcasts uint64 Iqdrops uint64 Noproto uint64 Hwassist uint64 Epoch int64 Lastchange Timeval } type IfaMsghdr struct { Msglen uint16 Version uint8 Type uint8 Addrs int32 Flags int32 Index uint16 _ uint16 Metric int32 } type IfmaMsghdr struct { Msglen uint16 Version uint8 Type uint8 Addrs int32 Flags int32 Index uint16 _ uint16 } type IfAnnounceMsghdr struct { Msglen uint16 Version uint8 Type uint8 Index uint16 Name [16]int8 What uint16 } type RtMsghdr struct { Msglen uint16 Version uint8 Type uint8 Index uint16 _ uint16 Flags int32 Addrs int32 Pid int32 Seq int32 Errno int32 Fmask int32 Inits uint64 Rmx RtMetrics } type RtMetrics struct { Locks uint64 Mtu uint64 Hopcount uint64 Expire uint64 Recvpipe uint64 Sendpipe uint64 Ssthresh uint64 Rtt uint64 Rttvar uint64 Pksent uint64 Weight uint64 Filler [3]uint64 } const ( SizeofBpfVersion = 0x4 SizeofBpfStat = 0x8 SizeofBpfZbuf = 0x18 SizeofBpfProgram = 0x10 SizeofBpfInsn = 0x8 SizeofBpfHdr = 0x20 SizeofBpfZbufHeader = 0x20 ) type BpfVersion struct { Major uint16 Minor uint16 } type BpfStat struct { Recv uint32 Drop uint32 } type BpfZbuf struct { Bufa *byte Bufb *byte Buflen uint64 } type BpfProgram struct { Len uint32 Insns *BpfInsn } type BpfInsn struct { Code uint16 Jt uint8 Jf uint8 K uint32 } type BpfHdr struct { Tstamp Timeval Caplen uint32 Datalen uint32 Hdrlen uint16 _ [6]byte } type BpfZbufHeader struct { Kernel_gen uint32 Kernel_len uint32 User_gen uint32 _ [5]uint32 } type Termios struct { Iflag uint32 Oflag uint32 Cflag uint32 Lflag uint32 Cc [20]uint8 Ispeed uint32 Ospeed uint32 } type Winsize struct { Row uint16 Col uint16 Xpixel uint16 Ypixel uint16 } const ( AT_FDCWD = -0x64 AT_EACCESS = 0x100 AT_SYMLINK_NOFOLLOW = 0x200 AT_SYMLINK_FOLLOW = 0x400 AT_REMOVEDIR = 0x800 ) type PollFd struct { Fd int32 Events int16 Revents int16 } const ( POLLERR = 0x8 POLLHUP = 0x10 POLLIN = 0x1 POLLINIGNEOF = 0x2000 POLLNVAL = 0x20 POLLOUT = 0x4 POLLPRI = 0x2 POLLRDBAND = 0x80 POLLRDNORM = 0x40 POLLWRBAND = 0x100 POLLWRNORM = 0x4 POLLRDHUP = 0x4000 ) type CapRights struct { Rights [2]uint64 } type Utsname struct { Sysname [256]byte Nodename [256]byte Release [256]byte Version [256]byte Machine [256]byte } const SizeofClockinfo = 0x14 type Clockinfo struct { Hz int32 Tick int32 Spare int32 Stathz int32 Profhz int32 } ================================================ FILE: vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go ================================================ // cgo -godefs -- -fsigned-char types_freebsd.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm && freebsd package unix const ( SizeofPtr = 0x4 SizeofShort = 0x2 SizeofInt = 0x4 SizeofLong = 0x4 SizeofLongLong = 0x8 ) type ( _C_short int16 _C_int int32 _C_long int32 _C_long_long int64 ) type Timespec struct { Sec int64 Nsec int32 _ [4]byte } type Timeval struct { Sec int64 Usec int32 _ [4]byte } type Time_t int64 type Rusage struct { Utime Timeval Stime Timeval Maxrss int32 Ixrss int32 Idrss int32 Isrss int32 Minflt int32 Majflt int32 Nswap int32 Inblock int32 Oublock int32 Msgsnd int32 Msgrcv int32 Nsignals int32 Nvcsw int32 Nivcsw int32 } type Rlimit struct { Cur int64 Max int64 } type _Gid_t uint32 const ( _statfsVersion = 0x20140518 _dirblksiz = 0x400 ) type Stat_t struct { Dev uint64 Ino uint64 Nlink uint64 Mode uint16 _0 int16 Uid uint32 Gid uint32 _1 int32 Rdev uint64 Atim Timespec Mtim Timespec Ctim Timespec Btim Timespec Size int64 Blocks int64 Blksize int32 Flags uint32 Gen uint64 Spare [10]uint64 } type Statfs_t struct { Version uint32 Type uint32 Flags uint64 Bsize uint64 Iosize uint64 Blocks uint64 Bfree uint64 Bavail int64 Files uint64 Ffree int64 Syncwrites uint64 Asyncwrites uint64 Syncreads uint64 Asyncreads uint64 Spare [10]uint64 Namemax uint32 Owner uint32 Fsid Fsid Charspare [80]int8 Fstypename [16]byte Mntfromname [1024]byte Mntonname [1024]byte } type Flock_t struct { Start int64 Len int64 Pid int32 Type int16 Whence int16 Sysid int32 _ [4]byte } type Dirent struct { Fileno uint64 Off int64 Reclen uint16 Type uint8 Pad0 uint8 Namlen uint16 Pad1 uint16 Name [256]int8 } type Fsid struct { Val [2]int32 } const ( PathMax = 0x400 ) const ( FADV_NORMAL = 0x0 FADV_RANDOM = 0x1 FADV_SEQUENTIAL = 0x2 FADV_WILLNEED = 0x3 FADV_DONTNEED = 0x4 FADV_NOREUSE = 0x5 ) type RawSockaddrInet4 struct { Len uint8 Family uint8 Port uint16 Addr [4]byte /* in_addr */ Zero [8]int8 } type RawSockaddrInet6 struct { Len uint8 Family uint8 Port uint16 Flowinfo uint32 Addr [16]byte /* in6_addr */ Scope_id uint32 } type RawSockaddrUnix struct { Len uint8 Family uint8 Path [104]int8 } type RawSockaddrDatalink struct { Len uint8 Family uint8 Index uint16 Type uint8 Nlen uint8 Alen uint8 Slen uint8 Data [46]int8 } type RawSockaddr struct { Len uint8 Family uint8 Data [14]int8 } type RawSockaddrAny struct { Addr RawSockaddr Pad [92]int8 } type _Socklen uint32 type Xucred struct { Version uint32 Uid uint32 Ngroups int16 Groups [16]uint32 _ *byte } type Linger struct { Onoff int32 Linger int32 } type Iovec struct { Base *byte Len uint32 } type IPMreq struct { Multiaddr [4]byte /* in_addr */ Interface [4]byte /* in_addr */ } type IPMreqn struct { Multiaddr [4]byte /* in_addr */ Address [4]byte /* in_addr */ Ifindex int32 } type IPv6Mreq struct { Multiaddr [16]byte /* in6_addr */ Interface uint32 } type Msghdr struct { Name *byte Namelen uint32 Iov *Iovec Iovlen int32 Control *byte Controllen uint32 Flags int32 } type Cmsghdr struct { Len uint32 Level int32 Type int32 } type Inet6Pktinfo struct { Addr [16]byte /* in6_addr */ Ifindex uint32 } type IPv6MTUInfo struct { Addr RawSockaddrInet6 Mtu uint32 } type ICMPv6Filter struct { Filt [8]uint32 } const ( SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet6 = 0x1c SizeofSockaddrAny = 0x6c SizeofSockaddrUnix = 0x6a SizeofSockaddrDatalink = 0x36 SizeofXucred = 0x50 SizeofLinger = 0x8 SizeofIovec = 0x8 SizeofIPMreq = 0x8 SizeofIPMreqn = 0xc SizeofIPv6Mreq = 0x14 SizeofMsghdr = 0x1c SizeofCmsghdr = 0xc SizeofInet6Pktinfo = 0x14 SizeofIPv6MTUInfo = 0x20 SizeofICMPv6Filter = 0x20 ) const ( PTRACE_TRACEME = 0x0 PTRACE_CONT = 0x7 PTRACE_KILL = 0x8 ) type PtraceLwpInfoStruct struct { Lwpid int32 Event int32 Flags int32 Sigmask Sigset_t Siglist Sigset_t Siginfo __PtraceSiginfo Tdname [20]int8 Child_pid int32 Syscall_code uint32 Syscall_narg uint32 } type __Siginfo struct { Signo int32 Errno int32 Code int32 Pid int32 Uid uint32 Status int32 Addr *byte Value [4]byte _ [32]byte } type __PtraceSiginfo struct { Signo int32 Errno int32 Code int32 Pid int32 Uid uint32 Status int32 Addr uintptr Value [4]byte _ [32]byte } type Sigset_t struct { Val [4]uint32 } type Reg struct { R [13]uint32 Sp uint32 Lr uint32 Pc uint32 Cpsr uint32 } type FpReg struct { Fpsr uint32 Fpr [8]FpExtendedPrecision } type FpExtendedPrecision struct { Exponent uint32 Mantissa_hi uint32 Mantissa_lo uint32 } type PtraceIoDesc struct { Op int32 Offs uintptr Addr *byte Len uint32 } type Kevent_t struct { Ident uint32 Filter int16 Flags uint16 Fflags uint32 _ [4]byte Data int64 Udata *byte _ [4]byte Ext [4]uint64 } type FdSet struct { Bits [32]uint32 } const ( sizeofIfMsghdr = 0xa8 SizeofIfMsghdr = 0x70 sizeofIfData = 0x98 SizeofIfData = 0x60 SizeofIfaMsghdr = 0x14 SizeofIfmaMsghdr = 0x10 SizeofIfAnnounceMsghdr = 0x18 SizeofRtMsghdr = 0x5c SizeofRtMetrics = 0x38 ) type ifMsghdr struct { Msglen uint16 Version uint8 Type uint8 Addrs int32 Flags int32 Index uint16 _ uint16 Data ifData } type IfMsghdr struct { Msglen uint16 Version uint8 Type uint8 Addrs int32 Flags int32 Index uint16 Data IfData } type ifData struct { Type uint8 Physical uint8 Addrlen uint8 Hdrlen uint8 Link_state uint8 Vhid uint8 Datalen uint16 Mtu uint32 Metric uint32 Baudrate uint64 Ipackets uint64 Ierrors uint64 Opackets uint64 Oerrors uint64 Collisions uint64 Ibytes uint64 Obytes uint64 Imcasts uint64 Omcasts uint64 Iqdrops uint64 Oqdrops uint64 Noproto uint64 Hwassist uint64 _ [8]byte _ [16]byte } type IfData struct { Type uint8 Physical uint8 Addrlen uint8 Hdrlen uint8 Link_state uint8 Spare_char1 uint8 Spare_char2 uint8 Datalen uint8 Mtu uint32 Metric uint32 Baudrate uint32 Ipackets uint32 Ierrors uint32 Opackets uint32 Oerrors uint32 Collisions uint32 Ibytes uint32 Obytes uint32 Imcasts uint32 Omcasts uint32 Iqdrops uint32 Noproto uint32 Hwassist uint32 _ [4]byte Epoch int64 Lastchange Timeval } type IfaMsghdr struct { Msglen uint16 Version uint8 Type uint8 Addrs int32 Flags int32 Index uint16 _ uint16 Metric int32 } type IfmaMsghdr struct { Msglen uint16 Version uint8 Type uint8 Addrs int32 Flags int32 Index uint16 _ uint16 } type IfAnnounceMsghdr struct { Msglen uint16 Version uint8 Type uint8 Index uint16 Name [16]int8 What uint16 } type RtMsghdr struct { Msglen uint16 Version uint8 Type uint8 Index uint16 _ uint16 Flags int32 Addrs int32 Pid int32 Seq int32 Errno int32 Fmask int32 Inits uint32 Rmx RtMetrics } type RtMetrics struct { Locks uint32 Mtu uint32 Hopcount uint32 Expire uint32 Recvpipe uint32 Sendpipe uint32 Ssthresh uint32 Rtt uint32 Rttvar uint32 Pksent uint32 Weight uint32 Filler [3]uint32 } const ( SizeofBpfVersion = 0x4 SizeofBpfStat = 0x8 SizeofBpfZbuf = 0xc SizeofBpfProgram = 0x8 SizeofBpfInsn = 0x8 SizeofBpfHdr = 0x20 SizeofBpfZbufHeader = 0x20 ) type BpfVersion struct { Major uint16 Minor uint16 } type BpfStat struct { Recv uint32 Drop uint32 } type BpfZbuf struct { Bufa *byte Bufb *byte Buflen uint32 } type BpfProgram struct { Len uint32 Insns *BpfInsn } type BpfInsn struct { Code uint16 Jt uint8 Jf uint8 K uint32 } type BpfHdr struct { Tstamp Timeval Caplen uint32 Datalen uint32 Hdrlen uint16 _ [6]byte } type BpfZbufHeader struct { Kernel_gen uint32 Kernel_len uint32 User_gen uint32 _ [5]uint32 } type Termios struct { Iflag uint32 Oflag uint32 Cflag uint32 Lflag uint32 Cc [20]uint8 Ispeed uint32 Ospeed uint32 } type Winsize struct { Row uint16 Col uint16 Xpixel uint16 Ypixel uint16 } const ( AT_FDCWD = -0x64 AT_EACCESS = 0x100 AT_SYMLINK_NOFOLLOW = 0x200 AT_SYMLINK_FOLLOW = 0x400 AT_REMOVEDIR = 0x800 ) type PollFd struct { Fd int32 Events int16 Revents int16 } const ( POLLERR = 0x8 POLLHUP = 0x10 POLLIN = 0x1 POLLINIGNEOF = 0x2000 POLLNVAL = 0x20 POLLOUT = 0x4 POLLPRI = 0x2 POLLRDBAND = 0x80 POLLRDNORM = 0x40 POLLWRBAND = 0x100 POLLWRNORM = 0x4 POLLRDHUP = 0x4000 ) type CapRights struct { Rights [2]uint64 } type Utsname struct { Sysname [256]byte Nodename [256]byte Release [256]byte Version [256]byte Machine [256]byte } const SizeofClockinfo = 0x14 type Clockinfo struct { Hz int32 Tick int32 Spare int32 Stathz int32 Profhz int32 } ================================================ FILE: vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go ================================================ // cgo -godefs -- -fsigned-char types_freebsd.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm64 && freebsd package unix const ( SizeofPtr = 0x8 SizeofShort = 0x2 SizeofInt = 0x4 SizeofLong = 0x8 SizeofLongLong = 0x8 ) type ( _C_short int16 _C_int int32 _C_long int64 _C_long_long int64 ) type Timespec struct { Sec int64 Nsec int64 } type Timeval struct { Sec int64 Usec int64 } type Time_t int64 type Rusage struct { Utime Timeval Stime Timeval Maxrss int64 Ixrss int64 Idrss int64 Isrss int64 Minflt int64 Majflt int64 Nswap int64 Inblock int64 Oublock int64 Msgsnd int64 Msgrcv int64 Nsignals int64 Nvcsw int64 Nivcsw int64 } type Rlimit struct { Cur int64 Max int64 } type _Gid_t uint32 const ( _statfsVersion = 0x20140518 _dirblksiz = 0x400 ) type Stat_t struct { Dev uint64 Ino uint64 Nlink uint64 Mode uint16 _0 int16 Uid uint32 Gid uint32 _1 int32 Rdev uint64 Atim Timespec Mtim Timespec Ctim Timespec Btim Timespec Size int64 Blocks int64 Blksize int32 Flags uint32 Gen uint64 Spare [10]uint64 } type Statfs_t struct { Version uint32 Type uint32 Flags uint64 Bsize uint64 Iosize uint64 Blocks uint64 Bfree uint64 Bavail int64 Files uint64 Ffree int64 Syncwrites uint64 Asyncwrites uint64 Syncreads uint64 Asyncreads uint64 Spare [10]uint64 Namemax uint32 Owner uint32 Fsid Fsid Charspare [80]int8 Fstypename [16]byte Mntfromname [1024]byte Mntonname [1024]byte } type Flock_t struct { Start int64 Len int64 Pid int32 Type int16 Whence int16 Sysid int32 _ [4]byte } type Dirent struct { Fileno uint64 Off int64 Reclen uint16 Type uint8 Pad0 uint8 Namlen uint16 Pad1 uint16 Name [256]int8 } type Fsid struct { Val [2]int32 } const ( PathMax = 0x400 ) const ( FADV_NORMAL = 0x0 FADV_RANDOM = 0x1 FADV_SEQUENTIAL = 0x2 FADV_WILLNEED = 0x3 FADV_DONTNEED = 0x4 FADV_NOREUSE = 0x5 ) type RawSockaddrInet4 struct { Len uint8 Family uint8 Port uint16 Addr [4]byte /* in_addr */ Zero [8]int8 } type RawSockaddrInet6 struct { Len uint8 Family uint8 Port uint16 Flowinfo uint32 Addr [16]byte /* in6_addr */ Scope_id uint32 } type RawSockaddrUnix struct { Len uint8 Family uint8 Path [104]int8 } type RawSockaddrDatalink struct { Len uint8 Family uint8 Index uint16 Type uint8 Nlen uint8 Alen uint8 Slen uint8 Data [46]int8 } type RawSockaddr struct { Len uint8 Family uint8 Data [14]int8 } type RawSockaddrAny struct { Addr RawSockaddr Pad [92]int8 } type _Socklen uint32 type Xucred struct { Version uint32 Uid uint32 Ngroups int16 Groups [16]uint32 _ *byte } type Linger struct { Onoff int32 Linger int32 } type Iovec struct { Base *byte Len uint64 } type IPMreq struct { Multiaddr [4]byte /* in_addr */ Interface [4]byte /* in_addr */ } type IPMreqn struct { Multiaddr [4]byte /* in_addr */ Address [4]byte /* in_addr */ Ifindex int32 } type IPv6Mreq struct { Multiaddr [16]byte /* in6_addr */ Interface uint32 } type Msghdr struct { Name *byte Namelen uint32 Iov *Iovec Iovlen int32 Control *byte Controllen uint32 Flags int32 } type Cmsghdr struct { Len uint32 Level int32 Type int32 } type Inet6Pktinfo struct { Addr [16]byte /* in6_addr */ Ifindex uint32 } type IPv6MTUInfo struct { Addr RawSockaddrInet6 Mtu uint32 } type ICMPv6Filter struct { Filt [8]uint32 } const ( SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet6 = 0x1c SizeofSockaddrAny = 0x6c SizeofSockaddrUnix = 0x6a SizeofSockaddrDatalink = 0x36 SizeofXucred = 0x58 SizeofLinger = 0x8 SizeofIovec = 0x10 SizeofIPMreq = 0x8 SizeofIPMreqn = 0xc SizeofIPv6Mreq = 0x14 SizeofMsghdr = 0x30 SizeofCmsghdr = 0xc SizeofInet6Pktinfo = 0x14 SizeofIPv6MTUInfo = 0x20 SizeofICMPv6Filter = 0x20 ) const ( PTRACE_TRACEME = 0x0 PTRACE_CONT = 0x7 PTRACE_KILL = 0x8 ) type PtraceLwpInfoStruct struct { Lwpid int32 Event int32 Flags int32 Sigmask Sigset_t Siglist Sigset_t Siginfo __PtraceSiginfo Tdname [20]int8 Child_pid int32 Syscall_code uint32 Syscall_narg uint32 } type __Siginfo struct { Signo int32 Errno int32 Code int32 Pid int32 Uid uint32 Status int32 Addr *byte Value [8]byte _ [40]byte } type __PtraceSiginfo struct { Signo int32 Errno int32 Code int32 Pid int32 Uid uint32 Status int32 Addr uintptr Value [8]byte _ [40]byte } type Sigset_t struct { Val [4]uint32 } type Reg struct { X [30]uint64 Lr uint64 Sp uint64 Elr uint64 Spsr uint32 _ [4]byte } type FpReg struct { Q [32][16]uint8 Sr uint32 Cr uint32 _ [8]byte } type FpExtendedPrecision struct{} type PtraceIoDesc struct { Op int32 Offs uintptr Addr *byte Len uint64 } type Kevent_t struct { Ident uint64 Filter int16 Flags uint16 Fflags uint32 Data int64 Udata *byte Ext [4]uint64 } type FdSet struct { Bits [16]uint64 } const ( sizeofIfMsghdr = 0xa8 SizeofIfMsghdr = 0xa8 sizeofIfData = 0x98 SizeofIfData = 0x98 SizeofIfaMsghdr = 0x14 SizeofIfmaMsghdr = 0x10 SizeofIfAnnounceMsghdr = 0x18 SizeofRtMsghdr = 0x98 SizeofRtMetrics = 0x70 ) type ifMsghdr struct { Msglen uint16 Version uint8 Type uint8 Addrs int32 Flags int32 Index uint16 _ uint16 Data ifData } type IfMsghdr struct { Msglen uint16 Version uint8 Type uint8 Addrs int32 Flags int32 Index uint16 Data IfData } type ifData struct { Type uint8 Physical uint8 Addrlen uint8 Hdrlen uint8 Link_state uint8 Vhid uint8 Datalen uint16 Mtu uint32 Metric uint32 Baudrate uint64 Ipackets uint64 Ierrors uint64 Opackets uint64 Oerrors uint64 Collisions uint64 Ibytes uint64 Obytes uint64 Imcasts uint64 Omcasts uint64 Iqdrops uint64 Oqdrops uint64 Noproto uint64 Hwassist uint64 _ [8]byte _ [16]byte } type IfData struct { Type uint8 Physical uint8 Addrlen uint8 Hdrlen uint8 Link_state uint8 Spare_char1 uint8 Spare_char2 uint8 Datalen uint8 Mtu uint64 Metric uint64 Baudrate uint64 Ipackets uint64 Ierrors uint64 Opackets uint64 Oerrors uint64 Collisions uint64 Ibytes uint64 Obytes uint64 Imcasts uint64 Omcasts uint64 Iqdrops uint64 Noproto uint64 Hwassist uint64 Epoch int64 Lastchange Timeval } type IfaMsghdr struct { Msglen uint16 Version uint8 Type uint8 Addrs int32 Flags int32 Index uint16 _ uint16 Metric int32 } type IfmaMsghdr struct { Msglen uint16 Version uint8 Type uint8 Addrs int32 Flags int32 Index uint16 _ uint16 } type IfAnnounceMsghdr struct { Msglen uint16 Version uint8 Type uint8 Index uint16 Name [16]int8 What uint16 } type RtMsghdr struct { Msglen uint16 Version uint8 Type uint8 Index uint16 _ uint16 Flags int32 Addrs int32 Pid int32 Seq int32 Errno int32 Fmask int32 Inits uint64 Rmx RtMetrics } type RtMetrics struct { Locks uint64 Mtu uint64 Hopcount uint64 Expire uint64 Recvpipe uint64 Sendpipe uint64 Ssthresh uint64 Rtt uint64 Rttvar uint64 Pksent uint64 Weight uint64 Filler [3]uint64 } const ( SizeofBpfVersion = 0x4 SizeofBpfStat = 0x8 SizeofBpfZbuf = 0x18 SizeofBpfProgram = 0x10 SizeofBpfInsn = 0x8 SizeofBpfHdr = 0x20 SizeofBpfZbufHeader = 0x20 ) type BpfVersion struct { Major uint16 Minor uint16 } type BpfStat struct { Recv uint32 Drop uint32 } type BpfZbuf struct { Bufa *byte Bufb *byte Buflen uint64 } type BpfProgram struct { Len uint32 Insns *BpfInsn } type BpfInsn struct { Code uint16 Jt uint8 Jf uint8 K uint32 } type BpfHdr struct { Tstamp Timeval Caplen uint32 Datalen uint32 Hdrlen uint16 _ [6]byte } type BpfZbufHeader struct { Kernel_gen uint32 Kernel_len uint32 User_gen uint32 _ [5]uint32 } type Termios struct { Iflag uint32 Oflag uint32 Cflag uint32 Lflag uint32 Cc [20]uint8 Ispeed uint32 Ospeed uint32 } type Winsize struct { Row uint16 Col uint16 Xpixel uint16 Ypixel uint16 } const ( AT_FDCWD = -0x64 AT_EACCESS = 0x100 AT_SYMLINK_NOFOLLOW = 0x200 AT_SYMLINK_FOLLOW = 0x400 AT_REMOVEDIR = 0x800 ) type PollFd struct { Fd int32 Events int16 Revents int16 } const ( POLLERR = 0x8 POLLHUP = 0x10 POLLIN = 0x1 POLLINIGNEOF = 0x2000 POLLNVAL = 0x20 POLLOUT = 0x4 POLLPRI = 0x2 POLLRDBAND = 0x80 POLLRDNORM = 0x40 POLLWRBAND = 0x100 POLLWRNORM = 0x4 POLLRDHUP = 0x4000 ) type CapRights struct { Rights [2]uint64 } type Utsname struct { Sysname [256]byte Nodename [256]byte Release [256]byte Version [256]byte Machine [256]byte } const SizeofClockinfo = 0x14 type Clockinfo struct { Hz int32 Tick int32 Spare int32 Stathz int32 Profhz int32 } ================================================ FILE: vendor/golang.org/x/sys/unix/ztypes_freebsd_riscv64.go ================================================ // cgo -godefs -- -fsigned-char types_freebsd.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build riscv64 && freebsd package unix const ( SizeofPtr = 0x8 SizeofShort = 0x2 SizeofInt = 0x4 SizeofLong = 0x8 SizeofLongLong = 0x8 ) type ( _C_short int16 _C_int int32 _C_long int64 _C_long_long int64 ) type Timespec struct { Sec int64 Nsec int64 } type Timeval struct { Sec int64 Usec int64 } type Time_t int64 type Rusage struct { Utime Timeval Stime Timeval Maxrss int64 Ixrss int64 Idrss int64 Isrss int64 Minflt int64 Majflt int64 Nswap int64 Inblock int64 Oublock int64 Msgsnd int64 Msgrcv int64 Nsignals int64 Nvcsw int64 Nivcsw int64 } type Rlimit struct { Cur int64 Max int64 } type _Gid_t uint32 const ( _statfsVersion = 0x20140518 _dirblksiz = 0x400 ) type Stat_t struct { Dev uint64 Ino uint64 Nlink uint64 Mode uint16 _0 int16 Uid uint32 Gid uint32 _1 int32 Rdev uint64 Atim Timespec Mtim Timespec Ctim Timespec Btim Timespec Size int64 Blocks int64 Blksize int32 Flags uint32 Gen uint64 Spare [10]uint64 } type Statfs_t struct { Version uint32 Type uint32 Flags uint64 Bsize uint64 Iosize uint64 Blocks uint64 Bfree uint64 Bavail int64 Files uint64 Ffree int64 Syncwrites uint64 Asyncwrites uint64 Syncreads uint64 Asyncreads uint64 Spare [10]uint64 Namemax uint32 Owner uint32 Fsid Fsid Charspare [80]int8 Fstypename [16]byte Mntfromname [1024]byte Mntonname [1024]byte } type Flock_t struct { Start int64 Len int64 Pid int32 Type int16 Whence int16 Sysid int32 _ [4]byte } type Dirent struct { Fileno uint64 Off int64 Reclen uint16 Type uint8 Pad0 uint8 Namlen uint16 Pad1 uint16 Name [256]int8 } type Fsid struct { Val [2]int32 } const ( PathMax = 0x400 ) const ( FADV_NORMAL = 0x0 FADV_RANDOM = 0x1 FADV_SEQUENTIAL = 0x2 FADV_WILLNEED = 0x3 FADV_DONTNEED = 0x4 FADV_NOREUSE = 0x5 ) type RawSockaddrInet4 struct { Len uint8 Family uint8 Port uint16 Addr [4]byte /* in_addr */ Zero [8]int8 } type RawSockaddrInet6 struct { Len uint8 Family uint8 Port uint16 Flowinfo uint32 Addr [16]byte /* in6_addr */ Scope_id uint32 } type RawSockaddrUnix struct { Len uint8 Family uint8 Path [104]int8 } type RawSockaddrDatalink struct { Len uint8 Family uint8 Index uint16 Type uint8 Nlen uint8 Alen uint8 Slen uint8 Data [46]int8 } type RawSockaddr struct { Len uint8 Family uint8 Data [14]int8 } type RawSockaddrAny struct { Addr RawSockaddr Pad [92]int8 } type _Socklen uint32 type Xucred struct { Version uint32 Uid uint32 Ngroups int16 Groups [16]uint32 _ *byte } type Linger struct { Onoff int32 Linger int32 } type Iovec struct { Base *byte Len uint64 } type IPMreq struct { Multiaddr [4]byte /* in_addr */ Interface [4]byte /* in_addr */ } type IPMreqn struct { Multiaddr [4]byte /* in_addr */ Address [4]byte /* in_addr */ Ifindex int32 } type IPv6Mreq struct { Multiaddr [16]byte /* in6_addr */ Interface uint32 } type Msghdr struct { Name *byte Namelen uint32 Iov *Iovec Iovlen int32 Control *byte Controllen uint32 Flags int32 } type Cmsghdr struct { Len uint32 Level int32 Type int32 } type Inet6Pktinfo struct { Addr [16]byte /* in6_addr */ Ifindex uint32 } type IPv6MTUInfo struct { Addr RawSockaddrInet6 Mtu uint32 } type ICMPv6Filter struct { Filt [8]uint32 } const ( SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet6 = 0x1c SizeofSockaddrAny = 0x6c SizeofSockaddrUnix = 0x6a SizeofSockaddrDatalink = 0x36 SizeofXucred = 0x58 SizeofLinger = 0x8 SizeofIovec = 0x10 SizeofIPMreq = 0x8 SizeofIPMreqn = 0xc SizeofIPv6Mreq = 0x14 SizeofMsghdr = 0x30 SizeofCmsghdr = 0xc SizeofInet6Pktinfo = 0x14 SizeofIPv6MTUInfo = 0x20 SizeofICMPv6Filter = 0x20 ) const ( PTRACE_TRACEME = 0x0 PTRACE_CONT = 0x7 PTRACE_KILL = 0x8 ) type PtraceLwpInfoStruct struct { Lwpid int32 Event int32 Flags int32 Sigmask Sigset_t Siglist Sigset_t Siginfo __PtraceSiginfo Tdname [20]int8 Child_pid int32 Syscall_code uint32 Syscall_narg uint32 } type __Siginfo struct { Signo int32 Errno int32 Code int32 Pid int32 Uid uint32 Status int32 Addr *byte Value [8]byte _ [40]byte } type __PtraceSiginfo struct { Signo int32 Errno int32 Code int32 Pid int32 Uid uint32 Status int32 Addr uintptr Value [8]byte _ [40]byte } type Sigset_t struct { Val [4]uint32 } type Reg struct { Ra uint64 Sp uint64 Gp uint64 Tp uint64 T [7]uint64 S [12]uint64 A [8]uint64 Sepc uint64 Sstatus uint64 } type FpReg struct { X [32][2]uint64 Fcsr uint64 } type FpExtendedPrecision struct{} type PtraceIoDesc struct { Op int32 Offs uintptr Addr *byte Len uint64 } type Kevent_t struct { Ident uint64 Filter int16 Flags uint16 Fflags uint32 Data int64 Udata *byte Ext [4]uint64 } type FdSet struct { Bits [16]uint64 } const ( sizeofIfMsghdr = 0xa8 SizeofIfMsghdr = 0xa8 sizeofIfData = 0x98 SizeofIfData = 0x98 SizeofIfaMsghdr = 0x14 SizeofIfmaMsghdr = 0x10 SizeofIfAnnounceMsghdr = 0x18 SizeofRtMsghdr = 0x98 SizeofRtMetrics = 0x70 ) type ifMsghdr struct { Msglen uint16 Version uint8 Type uint8 Addrs int32 Flags int32 Index uint16 _ uint16 Data ifData } type IfMsghdr struct { Msglen uint16 Version uint8 Type uint8 Addrs int32 Flags int32 Index uint16 Data IfData } type ifData struct { Type uint8 Physical uint8 Addrlen uint8 Hdrlen uint8 Link_state uint8 Vhid uint8 Datalen uint16 Mtu uint32 Metric uint32 Baudrate uint64 Ipackets uint64 Ierrors uint64 Opackets uint64 Oerrors uint64 Collisions uint64 Ibytes uint64 Obytes uint64 Imcasts uint64 Omcasts uint64 Iqdrops uint64 Oqdrops uint64 Noproto uint64 Hwassist uint64 _ [8]byte _ [16]byte } type IfData struct { Type uint8 Physical uint8 Addrlen uint8 Hdrlen uint8 Link_state uint8 Spare_char1 uint8 Spare_char2 uint8 Datalen uint8 Mtu uint64 Metric uint64 Baudrate uint64 Ipackets uint64 Ierrors uint64 Opackets uint64 Oerrors uint64 Collisions uint64 Ibytes uint64 Obytes uint64 Imcasts uint64 Omcasts uint64 Iqdrops uint64 Noproto uint64 Hwassist uint64 Epoch int64 Lastchange Timeval } type IfaMsghdr struct { Msglen uint16 Version uint8 Type uint8 Addrs int32 Flags int32 Index uint16 _ uint16 Metric int32 } type IfmaMsghdr struct { Msglen uint16 Version uint8 Type uint8 Addrs int32 Flags int32 Index uint16 _ uint16 } type IfAnnounceMsghdr struct { Msglen uint16 Version uint8 Type uint8 Index uint16 Name [16]int8 What uint16 } type RtMsghdr struct { Msglen uint16 Version uint8 Type uint8 Index uint16 _ uint16 Flags int32 Addrs int32 Pid int32 Seq int32 Errno int32 Fmask int32 Inits uint64 Rmx RtMetrics } type RtMetrics struct { Locks uint64 Mtu uint64 Hopcount uint64 Expire uint64 Recvpipe uint64 Sendpipe uint64 Ssthresh uint64 Rtt uint64 Rttvar uint64 Pksent uint64 Weight uint64 Nhidx uint64 Filler [2]uint64 } const ( SizeofBpfVersion = 0x4 SizeofBpfStat = 0x8 SizeofBpfZbuf = 0x18 SizeofBpfProgram = 0x10 SizeofBpfInsn = 0x8 SizeofBpfHdr = 0x20 SizeofBpfZbufHeader = 0x20 ) type BpfVersion struct { Major uint16 Minor uint16 } type BpfStat struct { Recv uint32 Drop uint32 } type BpfZbuf struct { Bufa *byte Bufb *byte Buflen uint64 } type BpfProgram struct { Len uint32 Insns *BpfInsn } type BpfInsn struct { Code uint16 Jt uint8 Jf uint8 K uint32 } type BpfHdr struct { Tstamp Timeval Caplen uint32 Datalen uint32 Hdrlen uint16 _ [6]byte } type BpfZbufHeader struct { Kernel_gen uint32 Kernel_len uint32 User_gen uint32 _ [5]uint32 } type Termios struct { Iflag uint32 Oflag uint32 Cflag uint32 Lflag uint32 Cc [20]uint8 Ispeed uint32 Ospeed uint32 } type Winsize struct { Row uint16 Col uint16 Xpixel uint16 Ypixel uint16 } const ( AT_FDCWD = -0x64 AT_EACCESS = 0x100 AT_SYMLINK_NOFOLLOW = 0x200 AT_SYMLINK_FOLLOW = 0x400 AT_REMOVEDIR = 0x800 ) type PollFd struct { Fd int32 Events int16 Revents int16 } const ( POLLERR = 0x8 POLLHUP = 0x10 POLLIN = 0x1 POLLINIGNEOF = 0x2000 POLLNVAL = 0x20 POLLOUT = 0x4 POLLPRI = 0x2 POLLRDBAND = 0x80 POLLRDNORM = 0x40 POLLWRBAND = 0x100 POLLWRNORM = 0x4 POLLRDHUP = 0x4000 ) type CapRights struct { Rights [2]uint64 } type Utsname struct { Sysname [256]byte Nodename [256]byte Release [256]byte Version [256]byte Machine [256]byte } const SizeofClockinfo = 0x14 type Clockinfo struct { Hz int32 Tick int32 Spare int32 Stathz int32 Profhz int32 } ================================================ FILE: vendor/golang.org/x/sys/unix/ztypes_linux.go ================================================ // Code generated by mkmerge; DO NOT EDIT. //go:build linux package unix const ( SizeofShort = 0x2 SizeofInt = 0x4 SizeofLongLong = 0x8 PathMax = 0x1000 ) type ( _C_short int16 _C_int int32 _C_long_long int64 ) type ItimerSpec struct { Interval Timespec Value Timespec } type Itimerval struct { Interval Timeval Value Timeval } const ( ADJ_OFFSET = 0x1 ADJ_FREQUENCY = 0x2 ADJ_MAXERROR = 0x4 ADJ_ESTERROR = 0x8 ADJ_STATUS = 0x10 ADJ_TIMECONST = 0x20 ADJ_TAI = 0x80 ADJ_SETOFFSET = 0x100 ADJ_MICRO = 0x1000 ADJ_NANO = 0x2000 ADJ_TICK = 0x4000 ADJ_OFFSET_SINGLESHOT = 0x8001 ADJ_OFFSET_SS_READ = 0xa001 ) const ( STA_PLL = 0x1 STA_PPSFREQ = 0x2 STA_PPSTIME = 0x4 STA_FLL = 0x8 STA_INS = 0x10 STA_DEL = 0x20 STA_UNSYNC = 0x40 STA_FREQHOLD = 0x80 STA_PPSSIGNAL = 0x100 STA_PPSJITTER = 0x200 STA_PPSWANDER = 0x400 STA_PPSERROR = 0x800 STA_CLOCKERR = 0x1000 STA_NANO = 0x2000 STA_MODE = 0x4000 STA_CLK = 0x8000 ) const ( TIME_OK = 0x0 TIME_INS = 0x1 TIME_DEL = 0x2 TIME_OOP = 0x3 TIME_WAIT = 0x4 TIME_ERROR = 0x5 TIME_BAD = 0x5 ) type Rlimit struct { Cur uint64 Max uint64 } type _Gid_t uint32 type StatxTimestamp struct { Sec int64 Nsec uint32 _ int32 } type Statx_t struct { Mask uint32 Blksize uint32 Attributes uint64 Nlink uint32 Uid uint32 Gid uint32 Mode uint16 _ [1]uint16 Ino uint64 Size uint64 Blocks uint64 Attributes_mask uint64 Atime StatxTimestamp Btime StatxTimestamp Ctime StatxTimestamp Mtime StatxTimestamp Rdev_major uint32 Rdev_minor uint32 Dev_major uint32 Dev_minor uint32 Mnt_id uint64 Dio_mem_align uint32 Dio_offset_align uint32 Subvol uint64 Atomic_write_unit_min uint32 Atomic_write_unit_max uint32 Atomic_write_segments_max uint32 Dio_read_offset_align uint32 Atomic_write_unit_max_opt uint32 _ [1]uint32 _ [8]uint64 } type Fsid struct { Val [2]int32 } type FileCloneRange struct { Src_fd int64 Src_offset uint64 Src_length uint64 Dest_offset uint64 } type RawFileDedupeRange struct { Src_offset uint64 Src_length uint64 Dest_count uint16 Reserved1 uint16 Reserved2 uint32 } type RawFileDedupeRangeInfo struct { Dest_fd int64 Dest_offset uint64 Bytes_deduped uint64 Status int32 Reserved uint32 } const ( SizeofRawFileDedupeRange = 0x18 SizeofRawFileDedupeRangeInfo = 0x20 FILE_DEDUPE_RANGE_SAME = 0x0 FILE_DEDUPE_RANGE_DIFFERS = 0x1 ) type FscryptPolicy struct { Version uint8 Contents_encryption_mode uint8 Filenames_encryption_mode uint8 Flags uint8 Master_key_descriptor [8]uint8 } type FscryptKey struct { Mode uint32 Raw [64]uint8 Size uint32 } type FscryptPolicyV1 struct { Version uint8 Contents_encryption_mode uint8 Filenames_encryption_mode uint8 Flags uint8 Master_key_descriptor [8]uint8 } type FscryptPolicyV2 struct { Version uint8 Contents_encryption_mode uint8 Filenames_encryption_mode uint8 Flags uint8 Log2_data_unit_size uint8 _ [3]uint8 Master_key_identifier [16]uint8 } type FscryptGetPolicyExArg struct { Size uint64 Policy [24]byte } type FscryptKeySpecifier struct { Type uint32 _ uint32 U [32]byte } type FscryptAddKeyArg struct { Key_spec FscryptKeySpecifier Raw_size uint32 Key_id uint32 Flags uint32 _ [7]uint32 } type FscryptRemoveKeyArg struct { Key_spec FscryptKeySpecifier Removal_status_flags uint32 _ [5]uint32 } type FscryptGetKeyStatusArg struct { Key_spec FscryptKeySpecifier _ [6]uint32 Status uint32 Status_flags uint32 User_count uint32 _ [13]uint32 } type DmIoctl struct { Version [3]uint32 Data_size uint32 Data_start uint32 Target_count uint32 Open_count int32 Flags uint32 Event_nr uint32 _ uint32 Dev uint64 Name [128]byte Uuid [129]byte Data [7]byte } type DmTargetSpec struct { Sector_start uint64 Length uint64 Status int32 Next uint32 Target_type [16]byte } type DmTargetDeps struct { Count uint32 _ uint32 } type DmTargetVersions struct { Next uint32 Version [3]uint32 } type DmTargetMsg struct { Sector uint64 } const ( SizeofDmIoctl = 0x138 SizeofDmTargetSpec = 0x28 ) type KeyctlDHParams struct { Private int32 Prime int32 Base int32 } const ( FADV_NORMAL = 0x0 FADV_RANDOM = 0x1 FADV_SEQUENTIAL = 0x2 FADV_WILLNEED = 0x3 ) type RawSockaddrInet4 struct { Family uint16 Port uint16 Addr [4]byte /* in_addr */ Zero [8]uint8 } type RawSockaddrInet6 struct { Family uint16 Port uint16 Flowinfo uint32 Addr [16]byte /* in6_addr */ Scope_id uint32 } type RawSockaddrUnix struct { Family uint16 Path [108]int8 } type RawSockaddrLinklayer struct { Family uint16 Protocol uint16 Ifindex int32 Hatype uint16 Pkttype uint8 Halen uint8 Addr [8]uint8 } type RawSockaddrNetlink struct { Family uint16 Pad uint16 Pid uint32 Groups uint32 } type RawSockaddrHCI struct { Family uint16 Dev uint16 Channel uint16 } type RawSockaddrL2 struct { Family uint16 Psm uint16 Bdaddr [6]uint8 Cid uint16 Bdaddr_type uint8 _ [1]byte } type RawSockaddrRFCOMM struct { Family uint16 Bdaddr [6]uint8 Channel uint8 _ [1]byte } type RawSockaddrCAN struct { Family uint16 Ifindex int32 Addr [16]byte } type RawSockaddrALG struct { Family uint16 Type [14]uint8 Feat uint32 Mask uint32 Name [64]uint8 } type RawSockaddrVM struct { Family uint16 Reserved1 uint16 Port uint32 Cid uint32 Flags uint8 Zero [3]uint8 } type RawSockaddrXDP struct { Family uint16 Flags uint16 Ifindex uint32 Queue_id uint32 Shared_umem_fd uint32 } type RawSockaddrPPPoX [0x1e]byte type RawSockaddrTIPC struct { Family uint16 Addrtype uint8 Scope int8 Addr [12]byte } type RawSockaddrL2TPIP struct { Family uint16 Unused uint16 Addr [4]byte /* in_addr */ Conn_id uint32 _ [4]uint8 } type RawSockaddrL2TPIP6 struct { Family uint16 Unused uint16 Flowinfo uint32 Addr [16]byte /* in6_addr */ Scope_id uint32 Conn_id uint32 } type RawSockaddrIUCV struct { Family uint16 Port uint16 Addr uint32 Nodeid [8]int8 User_id [8]int8 Name [8]int8 } type RawSockaddrNFC struct { Sa_family uint16 Dev_idx uint32 Target_idx uint32 Nfc_protocol uint32 } type _Socklen uint32 type Linger struct { Onoff int32 Linger int32 } type IPMreq struct { Multiaddr [4]byte /* in_addr */ Interface [4]byte /* in_addr */ } type IPMreqn struct { Multiaddr [4]byte /* in_addr */ Address [4]byte /* in_addr */ Ifindex int32 } type IPv6Mreq struct { Multiaddr [16]byte /* in6_addr */ Interface uint32 } type PacketMreq struct { Ifindex int32 Type uint16 Alen uint16 Address [8]uint8 } type Inet4Pktinfo struct { Ifindex int32 Spec_dst [4]byte /* in_addr */ Addr [4]byte /* in_addr */ } type Inet6Pktinfo struct { Addr [16]byte /* in6_addr */ Ifindex uint32 } type IPv6MTUInfo struct { Addr RawSockaddrInet6 Mtu uint32 } type ICMPv6Filter struct { Data [8]uint32 } type Ucred struct { Pid int32 Uid uint32 Gid uint32 } type TCPInfo struct { State uint8 Ca_state uint8 Retransmits uint8 Probes uint8 Backoff uint8 Options uint8 Rto uint32 Ato uint32 Snd_mss uint32 Rcv_mss uint32 Unacked uint32 Sacked uint32 Lost uint32 Retrans uint32 Fackets uint32 Last_data_sent uint32 Last_ack_sent uint32 Last_data_recv uint32 Last_ack_recv uint32 Pmtu uint32 Rcv_ssthresh uint32 Rtt uint32 Rttvar uint32 Snd_ssthresh uint32 Snd_cwnd uint32 Advmss uint32 Reordering uint32 Rcv_rtt uint32 Rcv_space uint32 Total_retrans uint32 Pacing_rate uint64 Max_pacing_rate uint64 Bytes_acked uint64 Bytes_received uint64 Segs_out uint32 Segs_in uint32 Notsent_bytes uint32 Min_rtt uint32 Data_segs_in uint32 Data_segs_out uint32 Delivery_rate uint64 Busy_time uint64 Rwnd_limited uint64 Sndbuf_limited uint64 Delivered uint32 Delivered_ce uint32 Bytes_sent uint64 Bytes_retrans uint64 Dsack_dups uint32 Reord_seen uint32 Rcv_ooopack uint32 Snd_wnd uint32 Rcv_wnd uint32 Rehash uint32 Total_rto uint16 Total_rto_recoveries uint16 Total_rto_time uint32 } type TCPVegasInfo struct { Enabled uint32 Rttcnt uint32 Rtt uint32 Minrtt uint32 } type TCPDCTCPInfo struct { Enabled uint16 Ce_state uint16 Alpha uint32 Ab_ecn uint32 Ab_tot uint32 } type TCPBBRInfo struct { Bw_lo uint32 Bw_hi uint32 Min_rtt uint32 Pacing_gain uint32 Cwnd_gain uint32 } type CanFilter struct { Id uint32 Mask uint32 } type TCPRepairOpt struct { Code uint32 Val uint32 } const ( SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet6 = 0x1c SizeofSockaddrAny = 0x70 SizeofSockaddrUnix = 0x6e SizeofSockaddrLinklayer = 0x14 SizeofSockaddrNetlink = 0xc SizeofSockaddrHCI = 0x6 SizeofSockaddrL2 = 0xe SizeofSockaddrRFCOMM = 0xa SizeofSockaddrCAN = 0x18 SizeofSockaddrALG = 0x58 SizeofSockaddrVM = 0x10 SizeofSockaddrXDP = 0x10 SizeofSockaddrPPPoX = 0x1e SizeofSockaddrTIPC = 0x10 SizeofSockaddrL2TPIP = 0x10 SizeofSockaddrL2TPIP6 = 0x20 SizeofSockaddrIUCV = 0x20 SizeofSockaddrNFC = 0x10 SizeofLinger = 0x8 SizeofIPMreq = 0x8 SizeofIPMreqn = 0xc SizeofIPv6Mreq = 0x14 SizeofPacketMreq = 0x10 SizeofInet4Pktinfo = 0xc SizeofInet6Pktinfo = 0x14 SizeofIPv6MTUInfo = 0x20 SizeofICMPv6Filter = 0x20 SizeofUcred = 0xc SizeofTCPInfo = 0xf8 SizeofTCPCCInfo = 0x14 SizeofCanFilter = 0x8 SizeofTCPRepairOpt = 0x8 ) const ( NDA_UNSPEC = 0x0 NDA_DST = 0x1 NDA_LLADDR = 0x2 NDA_CACHEINFO = 0x3 NDA_PROBES = 0x4 NDA_VLAN = 0x5 NDA_PORT = 0x6 NDA_VNI = 0x7 NDA_IFINDEX = 0x8 NDA_MASTER = 0x9 NDA_LINK_NETNSID = 0xa NDA_SRC_VNI = 0xb NTF_USE = 0x1 NTF_SELF = 0x2 NTF_MASTER = 0x4 NTF_PROXY = 0x8 NTF_EXT_LEARNED = 0x10 NTF_OFFLOADED = 0x20 NTF_ROUTER = 0x80 NUD_INCOMPLETE = 0x1 NUD_REACHABLE = 0x2 NUD_STALE = 0x4 NUD_DELAY = 0x8 NUD_PROBE = 0x10 NUD_FAILED = 0x20 NUD_NOARP = 0x40 NUD_PERMANENT = 0x80 NUD_NONE = 0x0 IFA_UNSPEC = 0x0 IFA_ADDRESS = 0x1 IFA_LOCAL = 0x2 IFA_LABEL = 0x3 IFA_BROADCAST = 0x4 IFA_ANYCAST = 0x5 IFA_CACHEINFO = 0x6 IFA_MULTICAST = 0x7 IFA_FLAGS = 0x8 IFA_RT_PRIORITY = 0x9 IFA_TARGET_NETNSID = 0xa IFAL_LABEL = 0x2 IFAL_ADDRESS = 0x1 RT_SCOPE_UNIVERSE = 0x0 RT_SCOPE_SITE = 0xc8 RT_SCOPE_LINK = 0xfd RT_SCOPE_HOST = 0xfe RT_SCOPE_NOWHERE = 0xff RT_TABLE_UNSPEC = 0x0 RT_TABLE_COMPAT = 0xfc RT_TABLE_DEFAULT = 0xfd RT_TABLE_MAIN = 0xfe RT_TABLE_LOCAL = 0xff RT_TABLE_MAX = 0xffffffff RTA_UNSPEC = 0x0 RTA_DST = 0x1 RTA_SRC = 0x2 RTA_IIF = 0x3 RTA_OIF = 0x4 RTA_GATEWAY = 0x5 RTA_PRIORITY = 0x6 RTA_PREFSRC = 0x7 RTA_METRICS = 0x8 RTA_MULTIPATH = 0x9 RTA_FLOW = 0xb RTA_CACHEINFO = 0xc RTA_TABLE = 0xf RTA_MARK = 0x10 RTA_MFC_STATS = 0x11 RTA_VIA = 0x12 RTA_NEWDST = 0x13 RTA_PREF = 0x14 RTA_ENCAP_TYPE = 0x15 RTA_ENCAP = 0x16 RTA_EXPIRES = 0x17 RTA_PAD = 0x18 RTA_UID = 0x19 RTA_TTL_PROPAGATE = 0x1a RTA_IP_PROTO = 0x1b RTA_SPORT = 0x1c RTA_DPORT = 0x1d RTN_UNSPEC = 0x0 RTN_UNICAST = 0x1 RTN_LOCAL = 0x2 RTN_BROADCAST = 0x3 RTN_ANYCAST = 0x4 RTN_MULTICAST = 0x5 RTN_BLACKHOLE = 0x6 RTN_UNREACHABLE = 0x7 RTN_PROHIBIT = 0x8 RTN_THROW = 0x9 RTN_NAT = 0xa RTN_XRESOLVE = 0xb PREFIX_UNSPEC = 0x0 PREFIX_ADDRESS = 0x1 PREFIX_CACHEINFO = 0x2 SizeofNlMsghdr = 0x10 SizeofNlMsgerr = 0x14 SizeofRtGenmsg = 0x1 SizeofNlAttr = 0x4 SizeofRtAttr = 0x4 SizeofIfInfomsg = 0x10 SizeofPrefixmsg = 0xc SizeofPrefixCacheinfo = 0x8 SizeofIfAddrmsg = 0x8 SizeofIfAddrlblmsg = 0xc SizeofIfaCacheinfo = 0x10 SizeofRtMsg = 0xc SizeofRtNexthop = 0x8 SizeofNdUseroptmsg = 0x10 SizeofNdMsg = 0xc ) type NlMsghdr struct { Len uint32 Type uint16 Flags uint16 Seq uint32 Pid uint32 } type NlMsgerr struct { Error int32 Msg NlMsghdr } type RtGenmsg struct { Family uint8 } type NlAttr struct { Len uint16 Type uint16 } type RtAttr struct { Len uint16 Type uint16 } type IfInfomsg struct { Family uint8 _ uint8 Type uint16 Index int32 Flags uint32 Change uint32 } type Prefixmsg struct { Family uint8 Pad1 uint8 Pad2 uint16 Ifindex int32 Type uint8 Len uint8 Flags uint8 Pad3 uint8 } type PrefixCacheinfo struct { Preferred_time uint32 Valid_time uint32 } type IfAddrmsg struct { Family uint8 Prefixlen uint8 Flags uint8 Scope uint8 Index uint32 } type IfAddrlblmsg struct { Family uint8 _ uint8 Prefixlen uint8 Flags uint8 Index uint32 Seq uint32 } type IfaCacheinfo struct { Prefered uint32 Valid uint32 Cstamp uint32 Tstamp uint32 } type RtMsg struct { Family uint8 Dst_len uint8 Src_len uint8 Tos uint8 Table uint8 Protocol uint8 Scope uint8 Type uint8 Flags uint32 } type RtNexthop struct { Len uint16 Flags uint8 Hops uint8 Ifindex int32 } type NdUseroptmsg struct { Family uint8 Pad1 uint8 Opts_len uint16 Ifindex int32 Icmp_type uint8 Icmp_code uint8 Pad2 uint16 Pad3 uint32 } type NdMsg struct { Family uint8 Pad1 uint8 Pad2 uint16 Ifindex int32 State uint16 Flags uint8 Type uint8 } const ( ICMP_FILTER = 0x1 ICMPV6_FILTER = 0x1 ICMPV6_FILTER_BLOCK = 0x1 ICMPV6_FILTER_BLOCKOTHERS = 0x3 ICMPV6_FILTER_PASS = 0x2 ICMPV6_FILTER_PASSONLY = 0x4 ) const ( SizeofSockFilter = 0x8 ) type SockFilter struct { Code uint16 Jt uint8 Jf uint8 K uint32 } type SockFprog struct { Len uint16 Filter *SockFilter } type InotifyEvent struct { Wd int32 Mask uint32 Cookie uint32 Len uint32 } const SizeofInotifyEvent = 0x10 const SI_LOAD_SHIFT = 0x10 type Utsname struct { Sysname [65]byte Nodename [65]byte Release [65]byte Version [65]byte Machine [65]byte Domainname [65]byte } const ( AT_EMPTY_PATH = 0x1000 AT_FDCWD = -0x64 AT_NO_AUTOMOUNT = 0x800 AT_REMOVEDIR = 0x200 AT_STATX_SYNC_AS_STAT = 0x0 AT_STATX_FORCE_SYNC = 0x2000 AT_STATX_DONT_SYNC = 0x4000 AT_RECURSIVE = 0x8000 AT_SYMLINK_FOLLOW = 0x400 AT_SYMLINK_NOFOLLOW = 0x100 AT_EACCESS = 0x200 OPEN_TREE_CLONE = 0x1 MOVE_MOUNT_F_SYMLINKS = 0x1 MOVE_MOUNT_F_AUTOMOUNTS = 0x2 MOVE_MOUNT_F_EMPTY_PATH = 0x4 MOVE_MOUNT_T_SYMLINKS = 0x10 MOVE_MOUNT_T_AUTOMOUNTS = 0x20 MOVE_MOUNT_T_EMPTY_PATH = 0x40 MOVE_MOUNT_SET_GROUP = 0x100 FSOPEN_CLOEXEC = 0x1 FSPICK_CLOEXEC = 0x1 FSPICK_SYMLINK_NOFOLLOW = 0x2 FSPICK_NO_AUTOMOUNT = 0x4 FSPICK_EMPTY_PATH = 0x8 FSMOUNT_CLOEXEC = 0x1 FSCONFIG_SET_FLAG = 0x0 FSCONFIG_SET_STRING = 0x1 FSCONFIG_SET_BINARY = 0x2 FSCONFIG_SET_PATH = 0x3 FSCONFIG_SET_PATH_EMPTY = 0x4 FSCONFIG_SET_FD = 0x5 FSCONFIG_CMD_CREATE = 0x6 FSCONFIG_CMD_RECONFIGURE = 0x7 ) type OpenHow struct { Flags uint64 Mode uint64 Resolve uint64 } const SizeofOpenHow = 0x18 const ( RESOLVE_BENEATH = 0x8 RESOLVE_IN_ROOT = 0x10 RESOLVE_NO_MAGICLINKS = 0x2 RESOLVE_NO_SYMLINKS = 0x4 RESOLVE_NO_XDEV = 0x1 ) type PollFd struct { Fd int32 Events int16 Revents int16 } const ( POLLIN = 0x1 POLLPRI = 0x2 POLLOUT = 0x4 POLLERR = 0x8 POLLHUP = 0x10 POLLNVAL = 0x20 ) type sigset_argpack struct { ss *Sigset_t ssLen uintptr } type SignalfdSiginfo struct { Signo uint32 Errno int32 Code int32 Pid uint32 Uid uint32 Fd int32 Tid uint32 Band uint32 Overrun uint32 Trapno uint32 Status int32 Int int32 Ptr uint64 Utime uint64 Stime uint64 Addr uint64 Addr_lsb uint16 _ uint16 Syscall int32 Call_addr uint64 Arch uint32 _ [28]uint8 } type Winsize struct { Row uint16 Col uint16 Xpixel uint16 Ypixel uint16 } const ( TASKSTATS_CMD_UNSPEC = 0x0 TASKSTATS_CMD_GET = 0x1 TASKSTATS_CMD_NEW = 0x2 TASKSTATS_TYPE_UNSPEC = 0x0 TASKSTATS_TYPE_PID = 0x1 TASKSTATS_TYPE_TGID = 0x2 TASKSTATS_TYPE_STATS = 0x3 TASKSTATS_TYPE_AGGR_PID = 0x4 TASKSTATS_TYPE_AGGR_TGID = 0x5 TASKSTATS_TYPE_NULL = 0x6 TASKSTATS_CMD_ATTR_UNSPEC = 0x0 TASKSTATS_CMD_ATTR_PID = 0x1 TASKSTATS_CMD_ATTR_TGID = 0x2 TASKSTATS_CMD_ATTR_REGISTER_CPUMASK = 0x3 TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK = 0x4 ) type CGroupStats struct { Sleeping uint64 Running uint64 Stopped uint64 Uninterruptible uint64 Io_wait uint64 } const ( CGROUPSTATS_CMD_UNSPEC = 0x3 CGROUPSTATS_CMD_GET = 0x4 CGROUPSTATS_CMD_NEW = 0x5 CGROUPSTATS_TYPE_UNSPEC = 0x0 CGROUPSTATS_TYPE_CGROUP_STATS = 0x1 CGROUPSTATS_CMD_ATTR_UNSPEC = 0x0 CGROUPSTATS_CMD_ATTR_FD = 0x1 ) type Genlmsghdr struct { Cmd uint8 Version uint8 Reserved uint16 } const ( CTRL_CMD_UNSPEC = 0x0 CTRL_CMD_NEWFAMILY = 0x1 CTRL_CMD_DELFAMILY = 0x2 CTRL_CMD_GETFAMILY = 0x3 CTRL_CMD_NEWOPS = 0x4 CTRL_CMD_DELOPS = 0x5 CTRL_CMD_GETOPS = 0x6 CTRL_CMD_NEWMCAST_GRP = 0x7 CTRL_CMD_DELMCAST_GRP = 0x8 CTRL_CMD_GETMCAST_GRP = 0x9 CTRL_CMD_GETPOLICY = 0xa CTRL_ATTR_UNSPEC = 0x0 CTRL_ATTR_FAMILY_ID = 0x1 CTRL_ATTR_FAMILY_NAME = 0x2 CTRL_ATTR_VERSION = 0x3 CTRL_ATTR_HDRSIZE = 0x4 CTRL_ATTR_MAXATTR = 0x5 CTRL_ATTR_OPS = 0x6 CTRL_ATTR_MCAST_GROUPS = 0x7 CTRL_ATTR_POLICY = 0x8 CTRL_ATTR_OP_POLICY = 0x9 CTRL_ATTR_OP = 0xa CTRL_ATTR_OP_UNSPEC = 0x0 CTRL_ATTR_OP_ID = 0x1 CTRL_ATTR_OP_FLAGS = 0x2 CTRL_ATTR_MCAST_GRP_UNSPEC = 0x0 CTRL_ATTR_MCAST_GRP_NAME = 0x1 CTRL_ATTR_MCAST_GRP_ID = 0x2 CTRL_ATTR_POLICY_UNSPEC = 0x0 CTRL_ATTR_POLICY_DO = 0x1 CTRL_ATTR_POLICY_DUMP = 0x2 CTRL_ATTR_POLICY_DUMP_MAX = 0x2 ) const ( _CPU_SETSIZE = 0x400 ) const ( BDADDR_BREDR = 0x0 BDADDR_LE_PUBLIC = 0x1 BDADDR_LE_RANDOM = 0x2 ) type PerfEventAttr struct { Type uint32 Size uint32 Config uint64 Sample uint64 Sample_type uint64 Read_format uint64 Bits uint64 Wakeup uint32 Bp_type uint32 Ext1 uint64 Ext2 uint64 Branch_sample_type uint64 Sample_regs_user uint64 Sample_stack_user uint32 Clockid int32 Sample_regs_intr uint64 Aux_watermark uint32 Sample_max_stack uint16 _ uint16 Aux_sample_size uint32 _ uint32 Sig_data uint64 } type PerfEventMmapPage struct { Version uint32 Compat_version uint32 Lock uint32 Index uint32 Offset int64 Time_enabled uint64 Time_running uint64 Capabilities uint64 Pmc_width uint16 Time_shift uint16 Time_mult uint32 Time_offset uint64 Time_zero uint64 Size uint32 _ uint32 Time_cycles uint64 Time_mask uint64 _ [928]uint8 Data_head uint64 Data_tail uint64 Data_offset uint64 Data_size uint64 Aux_head uint64 Aux_tail uint64 Aux_offset uint64 Aux_size uint64 } const ( PerfBitDisabled uint64 = CBitFieldMaskBit0 PerfBitInherit = CBitFieldMaskBit1 PerfBitPinned = CBitFieldMaskBit2 PerfBitExclusive = CBitFieldMaskBit3 PerfBitExcludeUser = CBitFieldMaskBit4 PerfBitExcludeKernel = CBitFieldMaskBit5 PerfBitExcludeHv = CBitFieldMaskBit6 PerfBitExcludeIdle = CBitFieldMaskBit7 PerfBitMmap = CBitFieldMaskBit8 PerfBitComm = CBitFieldMaskBit9 PerfBitFreq = CBitFieldMaskBit10 PerfBitInheritStat = CBitFieldMaskBit11 PerfBitEnableOnExec = CBitFieldMaskBit12 PerfBitTask = CBitFieldMaskBit13 PerfBitWatermark = CBitFieldMaskBit14 PerfBitPreciseIPBit1 = CBitFieldMaskBit15 PerfBitPreciseIPBit2 = CBitFieldMaskBit16 PerfBitMmapData = CBitFieldMaskBit17 PerfBitSampleIDAll = CBitFieldMaskBit18 PerfBitExcludeHost = CBitFieldMaskBit19 PerfBitExcludeGuest = CBitFieldMaskBit20 PerfBitExcludeCallchainKernel = CBitFieldMaskBit21 PerfBitExcludeCallchainUser = CBitFieldMaskBit22 PerfBitMmap2 = CBitFieldMaskBit23 PerfBitCommExec = CBitFieldMaskBit24 PerfBitUseClockID = CBitFieldMaskBit25 PerfBitContextSwitch = CBitFieldMaskBit26 PerfBitWriteBackward = CBitFieldMaskBit27 ) const ( PERF_TYPE_HARDWARE = 0x0 PERF_TYPE_SOFTWARE = 0x1 PERF_TYPE_TRACEPOINT = 0x2 PERF_TYPE_HW_CACHE = 0x3 PERF_TYPE_RAW = 0x4 PERF_TYPE_BREAKPOINT = 0x5 PERF_TYPE_MAX = 0x6 PERF_COUNT_HW_CPU_CYCLES = 0x0 PERF_COUNT_HW_INSTRUCTIONS = 0x1 PERF_COUNT_HW_CACHE_REFERENCES = 0x2 PERF_COUNT_HW_CACHE_MISSES = 0x3 PERF_COUNT_HW_BRANCH_INSTRUCTIONS = 0x4 PERF_COUNT_HW_BRANCH_MISSES = 0x5 PERF_COUNT_HW_BUS_CYCLES = 0x6 PERF_COUNT_HW_STALLED_CYCLES_FRONTEND = 0x7 PERF_COUNT_HW_STALLED_CYCLES_BACKEND = 0x8 PERF_COUNT_HW_REF_CPU_CYCLES = 0x9 PERF_COUNT_HW_MAX = 0xa PERF_COUNT_HW_CACHE_L1D = 0x0 PERF_COUNT_HW_CACHE_L1I = 0x1 PERF_COUNT_HW_CACHE_LL = 0x2 PERF_COUNT_HW_CACHE_DTLB = 0x3 PERF_COUNT_HW_CACHE_ITLB = 0x4 PERF_COUNT_HW_CACHE_BPU = 0x5 PERF_COUNT_HW_CACHE_NODE = 0x6 PERF_COUNT_HW_CACHE_MAX = 0x7 PERF_COUNT_HW_CACHE_OP_READ = 0x0 PERF_COUNT_HW_CACHE_OP_WRITE = 0x1 PERF_COUNT_HW_CACHE_OP_PREFETCH = 0x2 PERF_COUNT_HW_CACHE_OP_MAX = 0x3 PERF_COUNT_HW_CACHE_RESULT_ACCESS = 0x0 PERF_COUNT_HW_CACHE_RESULT_MISS = 0x1 PERF_COUNT_HW_CACHE_RESULT_MAX = 0x2 PERF_COUNT_SW_CPU_CLOCK = 0x0 PERF_COUNT_SW_TASK_CLOCK = 0x1 PERF_COUNT_SW_PAGE_FAULTS = 0x2 PERF_COUNT_SW_CONTEXT_SWITCHES = 0x3 PERF_COUNT_SW_CPU_MIGRATIONS = 0x4 PERF_COUNT_SW_PAGE_FAULTS_MIN = 0x5 PERF_COUNT_SW_PAGE_FAULTS_MAJ = 0x6 PERF_COUNT_SW_ALIGNMENT_FAULTS = 0x7 PERF_COUNT_SW_EMULATION_FAULTS = 0x8 PERF_COUNT_SW_DUMMY = 0x9 PERF_COUNT_SW_BPF_OUTPUT = 0xa PERF_COUNT_SW_MAX = 0xc PERF_SAMPLE_IP = 0x1 PERF_SAMPLE_TID = 0x2 PERF_SAMPLE_TIME = 0x4 PERF_SAMPLE_ADDR = 0x8 PERF_SAMPLE_READ = 0x10 PERF_SAMPLE_CALLCHAIN = 0x20 PERF_SAMPLE_ID = 0x40 PERF_SAMPLE_CPU = 0x80 PERF_SAMPLE_PERIOD = 0x100 PERF_SAMPLE_STREAM_ID = 0x200 PERF_SAMPLE_RAW = 0x400 PERF_SAMPLE_BRANCH_STACK = 0x800 PERF_SAMPLE_REGS_USER = 0x1000 PERF_SAMPLE_STACK_USER = 0x2000 PERF_SAMPLE_WEIGHT = 0x4000 PERF_SAMPLE_DATA_SRC = 0x8000 PERF_SAMPLE_IDENTIFIER = 0x10000 PERF_SAMPLE_TRANSACTION = 0x20000 PERF_SAMPLE_REGS_INTR = 0x40000 PERF_SAMPLE_PHYS_ADDR = 0x80000 PERF_SAMPLE_AUX = 0x100000 PERF_SAMPLE_CGROUP = 0x200000 PERF_SAMPLE_DATA_PAGE_SIZE = 0x400000 PERF_SAMPLE_CODE_PAGE_SIZE = 0x800000 PERF_SAMPLE_WEIGHT_STRUCT = 0x1000000 PERF_SAMPLE_MAX = 0x2000000 PERF_SAMPLE_BRANCH_USER_SHIFT = 0x0 PERF_SAMPLE_BRANCH_KERNEL_SHIFT = 0x1 PERF_SAMPLE_BRANCH_HV_SHIFT = 0x2 PERF_SAMPLE_BRANCH_ANY_SHIFT = 0x3 PERF_SAMPLE_BRANCH_ANY_CALL_SHIFT = 0x4 PERF_SAMPLE_BRANCH_ANY_RETURN_SHIFT = 0x5 PERF_SAMPLE_BRANCH_IND_CALL_SHIFT = 0x6 PERF_SAMPLE_BRANCH_ABORT_TX_SHIFT = 0x7 PERF_SAMPLE_BRANCH_IN_TX_SHIFT = 0x8 PERF_SAMPLE_BRANCH_NO_TX_SHIFT = 0x9 PERF_SAMPLE_BRANCH_COND_SHIFT = 0xa PERF_SAMPLE_BRANCH_CALL_STACK_SHIFT = 0xb PERF_SAMPLE_BRANCH_IND_JUMP_SHIFT = 0xc PERF_SAMPLE_BRANCH_CALL_SHIFT = 0xd PERF_SAMPLE_BRANCH_NO_FLAGS_SHIFT = 0xe PERF_SAMPLE_BRANCH_NO_CYCLES_SHIFT = 0xf PERF_SAMPLE_BRANCH_TYPE_SAVE_SHIFT = 0x10 PERF_SAMPLE_BRANCH_HW_INDEX_SHIFT = 0x11 PERF_SAMPLE_BRANCH_PRIV_SAVE_SHIFT = 0x12 PERF_SAMPLE_BRANCH_COUNTERS = 0x80000 PERF_SAMPLE_BRANCH_MAX_SHIFT = 0x14 PERF_SAMPLE_BRANCH_USER = 0x1 PERF_SAMPLE_BRANCH_KERNEL = 0x2 PERF_SAMPLE_BRANCH_HV = 0x4 PERF_SAMPLE_BRANCH_ANY = 0x8 PERF_SAMPLE_BRANCH_ANY_CALL = 0x10 PERF_SAMPLE_BRANCH_ANY_RETURN = 0x20 PERF_SAMPLE_BRANCH_IND_CALL = 0x40 PERF_SAMPLE_BRANCH_ABORT_TX = 0x80 PERF_SAMPLE_BRANCH_IN_TX = 0x100 PERF_SAMPLE_BRANCH_NO_TX = 0x200 PERF_SAMPLE_BRANCH_COND = 0x400 PERF_SAMPLE_BRANCH_CALL_STACK = 0x800 PERF_SAMPLE_BRANCH_IND_JUMP = 0x1000 PERF_SAMPLE_BRANCH_CALL = 0x2000 PERF_SAMPLE_BRANCH_NO_FLAGS = 0x4000 PERF_SAMPLE_BRANCH_NO_CYCLES = 0x8000 PERF_SAMPLE_BRANCH_TYPE_SAVE = 0x10000 PERF_SAMPLE_BRANCH_HW_INDEX = 0x20000 PERF_SAMPLE_BRANCH_PRIV_SAVE = 0x40000 PERF_SAMPLE_BRANCH_MAX = 0x100000 PERF_BR_UNKNOWN = 0x0 PERF_BR_COND = 0x1 PERF_BR_UNCOND = 0x2 PERF_BR_IND = 0x3 PERF_BR_CALL = 0x4 PERF_BR_IND_CALL = 0x5 PERF_BR_RET = 0x6 PERF_BR_SYSCALL = 0x7 PERF_BR_SYSRET = 0x8 PERF_BR_COND_CALL = 0x9 PERF_BR_COND_RET = 0xa PERF_BR_ERET = 0xb PERF_BR_IRQ = 0xc PERF_BR_SERROR = 0xd PERF_BR_NO_TX = 0xe PERF_BR_EXTEND_ABI = 0xf PERF_BR_MAX = 0x10 PERF_SAMPLE_REGS_ABI_NONE = 0x0 PERF_SAMPLE_REGS_ABI_32 = 0x1 PERF_SAMPLE_REGS_ABI_64 = 0x2 PERF_TXN_ELISION = 0x1 PERF_TXN_TRANSACTION = 0x2 PERF_TXN_SYNC = 0x4 PERF_TXN_ASYNC = 0x8 PERF_TXN_RETRY = 0x10 PERF_TXN_CONFLICT = 0x20 PERF_TXN_CAPACITY_WRITE = 0x40 PERF_TXN_CAPACITY_READ = 0x80 PERF_TXN_MAX = 0x100 PERF_TXN_ABORT_MASK = -0x100000000 PERF_TXN_ABORT_SHIFT = 0x20 PERF_FORMAT_TOTAL_TIME_ENABLED = 0x1 PERF_FORMAT_TOTAL_TIME_RUNNING = 0x2 PERF_FORMAT_ID = 0x4 PERF_FORMAT_GROUP = 0x8 PERF_FORMAT_LOST = 0x10 PERF_FORMAT_MAX = 0x20 PERF_IOC_FLAG_GROUP = 0x1 PERF_RECORD_MMAP = 0x1 PERF_RECORD_LOST = 0x2 PERF_RECORD_COMM = 0x3 PERF_RECORD_EXIT = 0x4 PERF_RECORD_THROTTLE = 0x5 PERF_RECORD_UNTHROTTLE = 0x6 PERF_RECORD_FORK = 0x7 PERF_RECORD_READ = 0x8 PERF_RECORD_SAMPLE = 0x9 PERF_RECORD_MMAP2 = 0xa PERF_RECORD_AUX = 0xb PERF_RECORD_ITRACE_START = 0xc PERF_RECORD_LOST_SAMPLES = 0xd PERF_RECORD_SWITCH = 0xe PERF_RECORD_SWITCH_CPU_WIDE = 0xf PERF_RECORD_NAMESPACES = 0x10 PERF_RECORD_KSYMBOL = 0x11 PERF_RECORD_BPF_EVENT = 0x12 PERF_RECORD_CGROUP = 0x13 PERF_RECORD_TEXT_POKE = 0x14 PERF_RECORD_AUX_OUTPUT_HW_ID = 0x15 PERF_RECORD_MAX = 0x16 PERF_RECORD_KSYMBOL_TYPE_UNKNOWN = 0x0 PERF_RECORD_KSYMBOL_TYPE_BPF = 0x1 PERF_RECORD_KSYMBOL_TYPE_OOL = 0x2 PERF_RECORD_KSYMBOL_TYPE_MAX = 0x3 PERF_BPF_EVENT_UNKNOWN = 0x0 PERF_BPF_EVENT_PROG_LOAD = 0x1 PERF_BPF_EVENT_PROG_UNLOAD = 0x2 PERF_BPF_EVENT_MAX = 0x3 PERF_CONTEXT_HV = -0x20 PERF_CONTEXT_KERNEL = -0x80 PERF_CONTEXT_USER = -0x200 PERF_CONTEXT_GUEST = -0x800 PERF_CONTEXT_GUEST_KERNEL = -0x880 PERF_CONTEXT_GUEST_USER = -0xa00 PERF_CONTEXT_MAX = -0xfff ) type TCPMD5Sig struct { Addr SockaddrStorage Flags uint8 Prefixlen uint8 Keylen uint16 Ifindex int32 Key [80]uint8 } type HDDriveCmdHdr struct { Command uint8 Number uint8 Feature uint8 Count uint8 } type HDDriveID struct { Config uint16 Cyls uint16 Reserved2 uint16 Heads uint16 Track_bytes uint16 Sector_bytes uint16 Sectors uint16 Vendor0 uint16 Vendor1 uint16 Vendor2 uint16 Serial_no [20]uint8 Buf_type uint16 Buf_size uint16 Ecc_bytes uint16 Fw_rev [8]uint8 Model [40]uint8 Max_multsect uint8 Vendor3 uint8 Dword_io uint16 Vendor4 uint8 Capability uint8 Reserved50 uint16 Vendor5 uint8 TPIO uint8 Vendor6 uint8 TDMA uint8 Field_valid uint16 Cur_cyls uint16 Cur_heads uint16 Cur_sectors uint16 Cur_capacity0 uint16 Cur_capacity1 uint16 Multsect uint8 Multsect_valid uint8 Lba_capacity uint32 Dma_1word uint16 Dma_mword uint16 Eide_pio_modes uint16 Eide_dma_min uint16 Eide_dma_time uint16 Eide_pio uint16 Eide_pio_iordy uint16 Words69_70 [2]uint16 Words71_74 [4]uint16 Queue_depth uint16 Words76_79 [4]uint16 Major_rev_num uint16 Minor_rev_num uint16 Command_set_1 uint16 Command_set_2 uint16 Cfsse uint16 Cfs_enable_1 uint16 Cfs_enable_2 uint16 Csf_default uint16 Dma_ultra uint16 Trseuc uint16 TrsEuc uint16 CurAPMvalues uint16 Mprc uint16 Hw_config uint16 Acoustic uint16 Msrqs uint16 Sxfert uint16 Sal uint16 Spg uint32 Lba_capacity_2 uint64 Words104_125 [22]uint16 Last_lun uint16 Word127 uint16 Dlf uint16 Csfo uint16 Words130_155 [26]uint16 Word156 uint16 Words157_159 [3]uint16 Cfa_power uint16 Words161_175 [15]uint16 Words176_205 [30]uint16 Words206_254 [49]uint16 Integrity_word uint16 } const ( ST_MANDLOCK = 0x40 ST_NOATIME = 0x400 ST_NODEV = 0x4 ST_NODIRATIME = 0x800 ST_NOEXEC = 0x8 ST_NOSUID = 0x2 ST_RDONLY = 0x1 ST_RELATIME = 0x1000 ST_SYNCHRONOUS = 0x10 ) type Tpacket2Hdr struct { Status uint32 Len uint32 Snaplen uint32 Mac uint16 Net uint16 Sec uint32 Nsec uint32 Vlan_tci uint16 Vlan_tpid uint16 _ [4]uint8 } type Tpacket3Hdr struct { Next_offset uint32 Sec uint32 Nsec uint32 Snaplen uint32 Len uint32 Status uint32 Mac uint16 Net uint16 Hv1 TpacketHdrVariant1 _ [8]uint8 } type TpacketHdrVariant1 struct { Rxhash uint32 Vlan_tci uint32 Vlan_tpid uint16 _ uint16 } type TpacketBlockDesc struct { Version uint32 To_priv uint32 Hdr [40]byte } type TpacketBDTS struct { Sec uint32 Usec uint32 } type TpacketHdrV1 struct { Block_status uint32 Num_pkts uint32 Offset_to_first_pkt uint32 Blk_len uint32 Seq_num uint64 Ts_first_pkt TpacketBDTS Ts_last_pkt TpacketBDTS } type TpacketReq struct { Block_size uint32 Block_nr uint32 Frame_size uint32 Frame_nr uint32 } type TpacketReq3 struct { Block_size uint32 Block_nr uint32 Frame_size uint32 Frame_nr uint32 Retire_blk_tov uint32 Sizeof_priv uint32 Feature_req_word uint32 } type TpacketStats struct { Packets uint32 Drops uint32 } type TpacketStatsV3 struct { Packets uint32 Drops uint32 Freeze_q_cnt uint32 } type TpacketAuxdata struct { Status uint32 Len uint32 Snaplen uint32 Mac uint16 Net uint16 Vlan_tci uint16 Vlan_tpid uint16 } const ( TPACKET_V1 = 0x0 TPACKET_V2 = 0x1 TPACKET_V3 = 0x2 ) const ( SizeofTpacket2Hdr = 0x20 SizeofTpacket3Hdr = 0x30 SizeofTpacketStats = 0x8 SizeofTpacketStatsV3 = 0xc ) const ( IFLA_UNSPEC = 0x0 IFLA_ADDRESS = 0x1 IFLA_BROADCAST = 0x2 IFLA_IFNAME = 0x3 IFLA_MTU = 0x4 IFLA_LINK = 0x5 IFLA_QDISC = 0x6 IFLA_STATS = 0x7 IFLA_COST = 0x8 IFLA_PRIORITY = 0x9 IFLA_MASTER = 0xa IFLA_WIRELESS = 0xb IFLA_PROTINFO = 0xc IFLA_TXQLEN = 0xd IFLA_MAP = 0xe IFLA_WEIGHT = 0xf IFLA_OPERSTATE = 0x10 IFLA_LINKMODE = 0x11 IFLA_LINKINFO = 0x12 IFLA_NET_NS_PID = 0x13 IFLA_IFALIAS = 0x14 IFLA_NUM_VF = 0x15 IFLA_VFINFO_LIST = 0x16 IFLA_STATS64 = 0x17 IFLA_VF_PORTS = 0x18 IFLA_PORT_SELF = 0x19 IFLA_AF_SPEC = 0x1a IFLA_GROUP = 0x1b IFLA_NET_NS_FD = 0x1c IFLA_EXT_MASK = 0x1d IFLA_PROMISCUITY = 0x1e IFLA_NUM_TX_QUEUES = 0x1f IFLA_NUM_RX_QUEUES = 0x20 IFLA_CARRIER = 0x21 IFLA_PHYS_PORT_ID = 0x22 IFLA_CARRIER_CHANGES = 0x23 IFLA_PHYS_SWITCH_ID = 0x24 IFLA_LINK_NETNSID = 0x25 IFLA_PHYS_PORT_NAME = 0x26 IFLA_PROTO_DOWN = 0x27 IFLA_GSO_MAX_SEGS = 0x28 IFLA_GSO_MAX_SIZE = 0x29 IFLA_PAD = 0x2a IFLA_XDP = 0x2b IFLA_EVENT = 0x2c IFLA_NEW_NETNSID = 0x2d IFLA_IF_NETNSID = 0x2e IFLA_TARGET_NETNSID = 0x2e IFLA_CARRIER_UP_COUNT = 0x2f IFLA_CARRIER_DOWN_COUNT = 0x30 IFLA_NEW_IFINDEX = 0x31 IFLA_MIN_MTU = 0x32 IFLA_MAX_MTU = 0x33 IFLA_PROP_LIST = 0x34 IFLA_ALT_IFNAME = 0x35 IFLA_PERM_ADDRESS = 0x36 IFLA_PROTO_DOWN_REASON = 0x37 IFLA_PARENT_DEV_NAME = 0x38 IFLA_PARENT_DEV_BUS_NAME = 0x39 IFLA_GRO_MAX_SIZE = 0x3a IFLA_TSO_MAX_SIZE = 0x3b IFLA_TSO_MAX_SEGS = 0x3c IFLA_ALLMULTI = 0x3d IFLA_DEVLINK_PORT = 0x3e IFLA_GSO_IPV4_MAX_SIZE = 0x3f IFLA_GRO_IPV4_MAX_SIZE = 0x40 IFLA_DPLL_PIN = 0x41 IFLA_PROTO_DOWN_REASON_UNSPEC = 0x0 IFLA_PROTO_DOWN_REASON_MASK = 0x1 IFLA_PROTO_DOWN_REASON_VALUE = 0x2 IFLA_PROTO_DOWN_REASON_MAX = 0x2 IFLA_INET_UNSPEC = 0x0 IFLA_INET_CONF = 0x1 IFLA_INET6_UNSPEC = 0x0 IFLA_INET6_FLAGS = 0x1 IFLA_INET6_CONF = 0x2 IFLA_INET6_STATS = 0x3 IFLA_INET6_MCAST = 0x4 IFLA_INET6_CACHEINFO = 0x5 IFLA_INET6_ICMP6STATS = 0x6 IFLA_INET6_TOKEN = 0x7 IFLA_INET6_ADDR_GEN_MODE = 0x8 IFLA_INET6_RA_MTU = 0x9 IFLA_BR_UNSPEC = 0x0 IFLA_BR_FORWARD_DELAY = 0x1 IFLA_BR_HELLO_TIME = 0x2 IFLA_BR_MAX_AGE = 0x3 IFLA_BR_AGEING_TIME = 0x4 IFLA_BR_STP_STATE = 0x5 IFLA_BR_PRIORITY = 0x6 IFLA_BR_VLAN_FILTERING = 0x7 IFLA_BR_VLAN_PROTOCOL = 0x8 IFLA_BR_GROUP_FWD_MASK = 0x9 IFLA_BR_ROOT_ID = 0xa IFLA_BR_BRIDGE_ID = 0xb IFLA_BR_ROOT_PORT = 0xc IFLA_BR_ROOT_PATH_COST = 0xd IFLA_BR_TOPOLOGY_CHANGE = 0xe IFLA_BR_TOPOLOGY_CHANGE_DETECTED = 0xf IFLA_BR_HELLO_TIMER = 0x10 IFLA_BR_TCN_TIMER = 0x11 IFLA_BR_TOPOLOGY_CHANGE_TIMER = 0x12 IFLA_BR_GC_TIMER = 0x13 IFLA_BR_GROUP_ADDR = 0x14 IFLA_BR_FDB_FLUSH = 0x15 IFLA_BR_MCAST_ROUTER = 0x16 IFLA_BR_MCAST_SNOOPING = 0x17 IFLA_BR_MCAST_QUERY_USE_IFADDR = 0x18 IFLA_BR_MCAST_QUERIER = 0x19 IFLA_BR_MCAST_HASH_ELASTICITY = 0x1a IFLA_BR_MCAST_HASH_MAX = 0x1b IFLA_BR_MCAST_LAST_MEMBER_CNT = 0x1c IFLA_BR_MCAST_STARTUP_QUERY_CNT = 0x1d IFLA_BR_MCAST_LAST_MEMBER_INTVL = 0x1e IFLA_BR_MCAST_MEMBERSHIP_INTVL = 0x1f IFLA_BR_MCAST_QUERIER_INTVL = 0x20 IFLA_BR_MCAST_QUERY_INTVL = 0x21 IFLA_BR_MCAST_QUERY_RESPONSE_INTVL = 0x22 IFLA_BR_MCAST_STARTUP_QUERY_INTVL = 0x23 IFLA_BR_NF_CALL_IPTABLES = 0x24 IFLA_BR_NF_CALL_IP6TABLES = 0x25 IFLA_BR_NF_CALL_ARPTABLES = 0x26 IFLA_BR_VLAN_DEFAULT_PVID = 0x27 IFLA_BR_PAD = 0x28 IFLA_BR_VLAN_STATS_ENABLED = 0x29 IFLA_BR_MCAST_STATS_ENABLED = 0x2a IFLA_BR_MCAST_IGMP_VERSION = 0x2b IFLA_BR_MCAST_MLD_VERSION = 0x2c IFLA_BR_VLAN_STATS_PER_PORT = 0x2d IFLA_BR_MULTI_BOOLOPT = 0x2e IFLA_BR_MCAST_QUERIER_STATE = 0x2f IFLA_BR_FDB_N_LEARNED = 0x30 IFLA_BR_FDB_MAX_LEARNED = 0x31 IFLA_BRPORT_UNSPEC = 0x0 IFLA_BRPORT_STATE = 0x1 IFLA_BRPORT_PRIORITY = 0x2 IFLA_BRPORT_COST = 0x3 IFLA_BRPORT_MODE = 0x4 IFLA_BRPORT_GUARD = 0x5 IFLA_BRPORT_PROTECT = 0x6 IFLA_BRPORT_FAST_LEAVE = 0x7 IFLA_BRPORT_LEARNING = 0x8 IFLA_BRPORT_UNICAST_FLOOD = 0x9 IFLA_BRPORT_PROXYARP = 0xa IFLA_BRPORT_LEARNING_SYNC = 0xb IFLA_BRPORT_PROXYARP_WIFI = 0xc IFLA_BRPORT_ROOT_ID = 0xd IFLA_BRPORT_BRIDGE_ID = 0xe IFLA_BRPORT_DESIGNATED_PORT = 0xf IFLA_BRPORT_DESIGNATED_COST = 0x10 IFLA_BRPORT_ID = 0x11 IFLA_BRPORT_NO = 0x12 IFLA_BRPORT_TOPOLOGY_CHANGE_ACK = 0x13 IFLA_BRPORT_CONFIG_PENDING = 0x14 IFLA_BRPORT_MESSAGE_AGE_TIMER = 0x15 IFLA_BRPORT_FORWARD_DELAY_TIMER = 0x16 IFLA_BRPORT_HOLD_TIMER = 0x17 IFLA_BRPORT_FLUSH = 0x18 IFLA_BRPORT_MULTICAST_ROUTER = 0x19 IFLA_BRPORT_PAD = 0x1a IFLA_BRPORT_MCAST_FLOOD = 0x1b IFLA_BRPORT_MCAST_TO_UCAST = 0x1c IFLA_BRPORT_VLAN_TUNNEL = 0x1d IFLA_BRPORT_BCAST_FLOOD = 0x1e IFLA_BRPORT_GROUP_FWD_MASK = 0x1f IFLA_BRPORT_NEIGH_SUPPRESS = 0x20 IFLA_BRPORT_ISOLATED = 0x21 IFLA_BRPORT_BACKUP_PORT = 0x22 IFLA_BRPORT_MRP_RING_OPEN = 0x23 IFLA_BRPORT_MRP_IN_OPEN = 0x24 IFLA_BRPORT_MCAST_EHT_HOSTS_LIMIT = 0x25 IFLA_BRPORT_MCAST_EHT_HOSTS_CNT = 0x26 IFLA_BRPORT_LOCKED = 0x27 IFLA_BRPORT_MAB = 0x28 IFLA_BRPORT_MCAST_N_GROUPS = 0x29 IFLA_BRPORT_MCAST_MAX_GROUPS = 0x2a IFLA_BRPORT_NEIGH_VLAN_SUPPRESS = 0x2b IFLA_BRPORT_BACKUP_NHID = 0x2c IFLA_INFO_UNSPEC = 0x0 IFLA_INFO_KIND = 0x1 IFLA_INFO_DATA = 0x2 IFLA_INFO_XSTATS = 0x3 IFLA_INFO_SLAVE_KIND = 0x4 IFLA_INFO_SLAVE_DATA = 0x5 IFLA_VLAN_UNSPEC = 0x0 IFLA_VLAN_ID = 0x1 IFLA_VLAN_FLAGS = 0x2 IFLA_VLAN_EGRESS_QOS = 0x3 IFLA_VLAN_INGRESS_QOS = 0x4 IFLA_VLAN_PROTOCOL = 0x5 IFLA_VLAN_QOS_UNSPEC = 0x0 IFLA_VLAN_QOS_MAPPING = 0x1 IFLA_MACVLAN_UNSPEC = 0x0 IFLA_MACVLAN_MODE = 0x1 IFLA_MACVLAN_FLAGS = 0x2 IFLA_MACVLAN_MACADDR_MODE = 0x3 IFLA_MACVLAN_MACADDR = 0x4 IFLA_MACVLAN_MACADDR_DATA = 0x5 IFLA_MACVLAN_MACADDR_COUNT = 0x6 IFLA_MACVLAN_BC_QUEUE_LEN = 0x7 IFLA_MACVLAN_BC_QUEUE_LEN_USED = 0x8 IFLA_MACVLAN_BC_CUTOFF = 0x9 IFLA_VRF_UNSPEC = 0x0 IFLA_VRF_TABLE = 0x1 IFLA_VRF_PORT_UNSPEC = 0x0 IFLA_VRF_PORT_TABLE = 0x1 IFLA_MACSEC_UNSPEC = 0x0 IFLA_MACSEC_SCI = 0x1 IFLA_MACSEC_PORT = 0x2 IFLA_MACSEC_ICV_LEN = 0x3 IFLA_MACSEC_CIPHER_SUITE = 0x4 IFLA_MACSEC_WINDOW = 0x5 IFLA_MACSEC_ENCODING_SA = 0x6 IFLA_MACSEC_ENCRYPT = 0x7 IFLA_MACSEC_PROTECT = 0x8 IFLA_MACSEC_INC_SCI = 0x9 IFLA_MACSEC_ES = 0xa IFLA_MACSEC_SCB = 0xb IFLA_MACSEC_REPLAY_PROTECT = 0xc IFLA_MACSEC_VALIDATION = 0xd IFLA_MACSEC_PAD = 0xe IFLA_MACSEC_OFFLOAD = 0xf IFLA_XFRM_UNSPEC = 0x0 IFLA_XFRM_LINK = 0x1 IFLA_XFRM_IF_ID = 0x2 IFLA_XFRM_COLLECT_METADATA = 0x3 IFLA_IPVLAN_UNSPEC = 0x0 IFLA_IPVLAN_MODE = 0x1 IFLA_IPVLAN_FLAGS = 0x2 IFLA_NETKIT_UNSPEC = 0x0 IFLA_NETKIT_PEER_INFO = 0x1 IFLA_NETKIT_PRIMARY = 0x2 IFLA_NETKIT_POLICY = 0x3 IFLA_NETKIT_PEER_POLICY = 0x4 IFLA_NETKIT_MODE = 0x5 IFLA_VXLAN_UNSPEC = 0x0 IFLA_VXLAN_ID = 0x1 IFLA_VXLAN_GROUP = 0x2 IFLA_VXLAN_LINK = 0x3 IFLA_VXLAN_LOCAL = 0x4 IFLA_VXLAN_TTL = 0x5 IFLA_VXLAN_TOS = 0x6 IFLA_VXLAN_LEARNING = 0x7 IFLA_VXLAN_AGEING = 0x8 IFLA_VXLAN_LIMIT = 0x9 IFLA_VXLAN_PORT_RANGE = 0xa IFLA_VXLAN_PROXY = 0xb IFLA_VXLAN_RSC = 0xc IFLA_VXLAN_L2MISS = 0xd IFLA_VXLAN_L3MISS = 0xe IFLA_VXLAN_PORT = 0xf IFLA_VXLAN_GROUP6 = 0x10 IFLA_VXLAN_LOCAL6 = 0x11 IFLA_VXLAN_UDP_CSUM = 0x12 IFLA_VXLAN_UDP_ZERO_CSUM6_TX = 0x13 IFLA_VXLAN_UDP_ZERO_CSUM6_RX = 0x14 IFLA_VXLAN_REMCSUM_TX = 0x15 IFLA_VXLAN_REMCSUM_RX = 0x16 IFLA_VXLAN_GBP = 0x17 IFLA_VXLAN_REMCSUM_NOPARTIAL = 0x18 IFLA_VXLAN_COLLECT_METADATA = 0x19 IFLA_VXLAN_LABEL = 0x1a IFLA_VXLAN_GPE = 0x1b IFLA_VXLAN_TTL_INHERIT = 0x1c IFLA_VXLAN_DF = 0x1d IFLA_VXLAN_VNIFILTER = 0x1e IFLA_VXLAN_LOCALBYPASS = 0x1f IFLA_VXLAN_LABEL_POLICY = 0x20 IFLA_GENEVE_UNSPEC = 0x0 IFLA_GENEVE_ID = 0x1 IFLA_GENEVE_REMOTE = 0x2 IFLA_GENEVE_TTL = 0x3 IFLA_GENEVE_TOS = 0x4 IFLA_GENEVE_PORT = 0x5 IFLA_GENEVE_COLLECT_METADATA = 0x6 IFLA_GENEVE_REMOTE6 = 0x7 IFLA_GENEVE_UDP_CSUM = 0x8 IFLA_GENEVE_UDP_ZERO_CSUM6_TX = 0x9 IFLA_GENEVE_UDP_ZERO_CSUM6_RX = 0xa IFLA_GENEVE_LABEL = 0xb IFLA_GENEVE_TTL_INHERIT = 0xc IFLA_GENEVE_DF = 0xd IFLA_GENEVE_INNER_PROTO_INHERIT = 0xe IFLA_BAREUDP_UNSPEC = 0x0 IFLA_BAREUDP_PORT = 0x1 IFLA_BAREUDP_ETHERTYPE = 0x2 IFLA_BAREUDP_SRCPORT_MIN = 0x3 IFLA_BAREUDP_MULTIPROTO_MODE = 0x4 IFLA_PPP_UNSPEC = 0x0 IFLA_PPP_DEV_FD = 0x1 IFLA_GTP_UNSPEC = 0x0 IFLA_GTP_FD0 = 0x1 IFLA_GTP_FD1 = 0x2 IFLA_GTP_PDP_HASHSIZE = 0x3 IFLA_GTP_ROLE = 0x4 IFLA_GTP_CREATE_SOCKETS = 0x5 IFLA_GTP_RESTART_COUNT = 0x6 IFLA_GTP_LOCAL = 0x7 IFLA_GTP_LOCAL6 = 0x8 IFLA_BOND_UNSPEC = 0x0 IFLA_BOND_MODE = 0x1 IFLA_BOND_ACTIVE_SLAVE = 0x2 IFLA_BOND_MIIMON = 0x3 IFLA_BOND_UPDELAY = 0x4 IFLA_BOND_DOWNDELAY = 0x5 IFLA_BOND_USE_CARRIER = 0x6 IFLA_BOND_ARP_INTERVAL = 0x7 IFLA_BOND_ARP_IP_TARGET = 0x8 IFLA_BOND_ARP_VALIDATE = 0x9 IFLA_BOND_ARP_ALL_TARGETS = 0xa IFLA_BOND_PRIMARY = 0xb IFLA_BOND_PRIMARY_RESELECT = 0xc IFLA_BOND_FAIL_OVER_MAC = 0xd IFLA_BOND_XMIT_HASH_POLICY = 0xe IFLA_BOND_RESEND_IGMP = 0xf IFLA_BOND_NUM_PEER_NOTIF = 0x10 IFLA_BOND_ALL_SLAVES_ACTIVE = 0x11 IFLA_BOND_MIN_LINKS = 0x12 IFLA_BOND_LP_INTERVAL = 0x13 IFLA_BOND_PACKETS_PER_SLAVE = 0x14 IFLA_BOND_AD_LACP_RATE = 0x15 IFLA_BOND_AD_SELECT = 0x16 IFLA_BOND_AD_INFO = 0x17 IFLA_BOND_AD_ACTOR_SYS_PRIO = 0x18 IFLA_BOND_AD_USER_PORT_KEY = 0x19 IFLA_BOND_AD_ACTOR_SYSTEM = 0x1a IFLA_BOND_TLB_DYNAMIC_LB = 0x1b IFLA_BOND_PEER_NOTIF_DELAY = 0x1c IFLA_BOND_AD_LACP_ACTIVE = 0x1d IFLA_BOND_MISSED_MAX = 0x1e IFLA_BOND_NS_IP6_TARGET = 0x1f IFLA_BOND_COUPLED_CONTROL = 0x20 IFLA_BOND_AD_INFO_UNSPEC = 0x0 IFLA_BOND_AD_INFO_AGGREGATOR = 0x1 IFLA_BOND_AD_INFO_NUM_PORTS = 0x2 IFLA_BOND_AD_INFO_ACTOR_KEY = 0x3 IFLA_BOND_AD_INFO_PARTNER_KEY = 0x4 IFLA_BOND_AD_INFO_PARTNER_MAC = 0x5 IFLA_BOND_SLAVE_UNSPEC = 0x0 IFLA_BOND_SLAVE_STATE = 0x1 IFLA_BOND_SLAVE_MII_STATUS = 0x2 IFLA_BOND_SLAVE_LINK_FAILURE_COUNT = 0x3 IFLA_BOND_SLAVE_PERM_HWADDR = 0x4 IFLA_BOND_SLAVE_QUEUE_ID = 0x5 IFLA_BOND_SLAVE_AD_AGGREGATOR_ID = 0x6 IFLA_BOND_SLAVE_AD_ACTOR_OPER_PORT_STATE = 0x7 IFLA_BOND_SLAVE_AD_PARTNER_OPER_PORT_STATE = 0x8 IFLA_BOND_SLAVE_PRIO = 0x9 IFLA_VF_INFO_UNSPEC = 0x0 IFLA_VF_INFO = 0x1 IFLA_VF_UNSPEC = 0x0 IFLA_VF_MAC = 0x1 IFLA_VF_VLAN = 0x2 IFLA_VF_TX_RATE = 0x3 IFLA_VF_SPOOFCHK = 0x4 IFLA_VF_LINK_STATE = 0x5 IFLA_VF_RATE = 0x6 IFLA_VF_RSS_QUERY_EN = 0x7 IFLA_VF_STATS = 0x8 IFLA_VF_TRUST = 0x9 IFLA_VF_IB_NODE_GUID = 0xa IFLA_VF_IB_PORT_GUID = 0xb IFLA_VF_VLAN_LIST = 0xc IFLA_VF_BROADCAST = 0xd IFLA_VF_VLAN_INFO_UNSPEC = 0x0 IFLA_VF_VLAN_INFO = 0x1 IFLA_VF_LINK_STATE_AUTO = 0x0 IFLA_VF_LINK_STATE_ENABLE = 0x1 IFLA_VF_LINK_STATE_DISABLE = 0x2 IFLA_VF_STATS_RX_PACKETS = 0x0 IFLA_VF_STATS_TX_PACKETS = 0x1 IFLA_VF_STATS_RX_BYTES = 0x2 IFLA_VF_STATS_TX_BYTES = 0x3 IFLA_VF_STATS_BROADCAST = 0x4 IFLA_VF_STATS_MULTICAST = 0x5 IFLA_VF_STATS_PAD = 0x6 IFLA_VF_STATS_RX_DROPPED = 0x7 IFLA_VF_STATS_TX_DROPPED = 0x8 IFLA_VF_PORT_UNSPEC = 0x0 IFLA_VF_PORT = 0x1 IFLA_PORT_UNSPEC = 0x0 IFLA_PORT_VF = 0x1 IFLA_PORT_PROFILE = 0x2 IFLA_PORT_VSI_TYPE = 0x3 IFLA_PORT_INSTANCE_UUID = 0x4 IFLA_PORT_HOST_UUID = 0x5 IFLA_PORT_REQUEST = 0x6 IFLA_PORT_RESPONSE = 0x7 IFLA_IPOIB_UNSPEC = 0x0 IFLA_IPOIB_PKEY = 0x1 IFLA_IPOIB_MODE = 0x2 IFLA_IPOIB_UMCAST = 0x3 IFLA_HSR_UNSPEC = 0x0 IFLA_HSR_SLAVE1 = 0x1 IFLA_HSR_SLAVE2 = 0x2 IFLA_HSR_MULTICAST_SPEC = 0x3 IFLA_HSR_SUPERVISION_ADDR = 0x4 IFLA_HSR_SEQ_NR = 0x5 IFLA_HSR_VERSION = 0x6 IFLA_HSR_PROTOCOL = 0x7 IFLA_HSR_INTERLINK = 0x8 IFLA_STATS_UNSPEC = 0x0 IFLA_STATS_LINK_64 = 0x1 IFLA_STATS_LINK_XSTATS = 0x2 IFLA_STATS_LINK_XSTATS_SLAVE = 0x3 IFLA_STATS_LINK_OFFLOAD_XSTATS = 0x4 IFLA_STATS_AF_SPEC = 0x5 IFLA_STATS_GETSET_UNSPEC = 0x0 IFLA_STATS_GET_FILTERS = 0x1 IFLA_STATS_SET_OFFLOAD_XSTATS_L3_STATS = 0x2 IFLA_OFFLOAD_XSTATS_UNSPEC = 0x0 IFLA_OFFLOAD_XSTATS_CPU_HIT = 0x1 IFLA_OFFLOAD_XSTATS_HW_S_INFO = 0x2 IFLA_OFFLOAD_XSTATS_L3_STATS = 0x3 IFLA_OFFLOAD_XSTATS_HW_S_INFO_UNSPEC = 0x0 IFLA_OFFLOAD_XSTATS_HW_S_INFO_REQUEST = 0x1 IFLA_OFFLOAD_XSTATS_HW_S_INFO_USED = 0x2 IFLA_XDP_UNSPEC = 0x0 IFLA_XDP_FD = 0x1 IFLA_XDP_ATTACHED = 0x2 IFLA_XDP_FLAGS = 0x3 IFLA_XDP_PROG_ID = 0x4 IFLA_XDP_DRV_PROG_ID = 0x5 IFLA_XDP_SKB_PROG_ID = 0x6 IFLA_XDP_HW_PROG_ID = 0x7 IFLA_XDP_EXPECTED_FD = 0x8 IFLA_EVENT_NONE = 0x0 IFLA_EVENT_REBOOT = 0x1 IFLA_EVENT_FEATURES = 0x2 IFLA_EVENT_BONDING_FAILOVER = 0x3 IFLA_EVENT_NOTIFY_PEERS = 0x4 IFLA_EVENT_IGMP_RESEND = 0x5 IFLA_EVENT_BONDING_OPTIONS = 0x6 IFLA_TUN_UNSPEC = 0x0 IFLA_TUN_OWNER = 0x1 IFLA_TUN_GROUP = 0x2 IFLA_TUN_TYPE = 0x3 IFLA_TUN_PI = 0x4 IFLA_TUN_VNET_HDR = 0x5 IFLA_TUN_PERSIST = 0x6 IFLA_TUN_MULTI_QUEUE = 0x7 IFLA_TUN_NUM_QUEUES = 0x8 IFLA_TUN_NUM_DISABLED_QUEUES = 0x9 IFLA_RMNET_UNSPEC = 0x0 IFLA_RMNET_MUX_ID = 0x1 IFLA_RMNET_FLAGS = 0x2 IFLA_MCTP_UNSPEC = 0x0 IFLA_MCTP_NET = 0x1 IFLA_DSA_UNSPEC = 0x0 IFLA_DSA_CONDUIT = 0x1 IFLA_DSA_MASTER = 0x1 ) const ( NETKIT_NEXT = -0x1 NETKIT_PASS = 0x0 NETKIT_DROP = 0x2 NETKIT_REDIRECT = 0x7 NETKIT_L2 = 0x0 NETKIT_L3 = 0x1 ) const ( NF_INET_PRE_ROUTING = 0x0 NF_INET_LOCAL_IN = 0x1 NF_INET_FORWARD = 0x2 NF_INET_LOCAL_OUT = 0x3 NF_INET_POST_ROUTING = 0x4 NF_INET_NUMHOOKS = 0x5 ) const ( NF_NETDEV_INGRESS = 0x0 NF_NETDEV_EGRESS = 0x1 NF_NETDEV_NUMHOOKS = 0x2 ) const ( NFPROTO_UNSPEC = 0x0 NFPROTO_INET = 0x1 NFPROTO_IPV4 = 0x2 NFPROTO_ARP = 0x3 NFPROTO_NETDEV = 0x5 NFPROTO_BRIDGE = 0x7 NFPROTO_IPV6 = 0xa NFPROTO_DECNET = 0xc NFPROTO_NUMPROTO = 0xd ) const SO_ORIGINAL_DST = 0x50 type Nfgenmsg struct { Nfgen_family uint8 Version uint8 Res_id uint16 } const ( NFNL_BATCH_UNSPEC = 0x0 NFNL_BATCH_GENID = 0x1 ) const ( NFT_REG_VERDICT = 0x0 NFT_REG_1 = 0x1 NFT_REG_2 = 0x2 NFT_REG_3 = 0x3 NFT_REG_4 = 0x4 NFT_REG32_00 = 0x8 NFT_REG32_01 = 0x9 NFT_REG32_02 = 0xa NFT_REG32_03 = 0xb NFT_REG32_04 = 0xc NFT_REG32_05 = 0xd NFT_REG32_06 = 0xe NFT_REG32_07 = 0xf NFT_REG32_08 = 0x10 NFT_REG32_09 = 0x11 NFT_REG32_10 = 0x12 NFT_REG32_11 = 0x13 NFT_REG32_12 = 0x14 NFT_REG32_13 = 0x15 NFT_REG32_14 = 0x16 NFT_REG32_15 = 0x17 NFT_CONTINUE = -0x1 NFT_BREAK = -0x2 NFT_JUMP = -0x3 NFT_GOTO = -0x4 NFT_RETURN = -0x5 NFT_MSG_NEWTABLE = 0x0 NFT_MSG_GETTABLE = 0x1 NFT_MSG_DELTABLE = 0x2 NFT_MSG_NEWCHAIN = 0x3 NFT_MSG_GETCHAIN = 0x4 NFT_MSG_DELCHAIN = 0x5 NFT_MSG_NEWRULE = 0x6 NFT_MSG_GETRULE = 0x7 NFT_MSG_DELRULE = 0x8 NFT_MSG_NEWSET = 0x9 NFT_MSG_GETSET = 0xa NFT_MSG_DELSET = 0xb NFT_MSG_NEWSETELEM = 0xc NFT_MSG_GETSETELEM = 0xd NFT_MSG_DELSETELEM = 0xe NFT_MSG_NEWGEN = 0xf NFT_MSG_GETGEN = 0x10 NFT_MSG_TRACE = 0x11 NFT_MSG_NEWOBJ = 0x12 NFT_MSG_GETOBJ = 0x13 NFT_MSG_DELOBJ = 0x14 NFT_MSG_GETOBJ_RESET = 0x15 NFT_MSG_NEWFLOWTABLE = 0x16 NFT_MSG_GETFLOWTABLE = 0x17 NFT_MSG_DELFLOWTABLE = 0x18 NFT_MSG_GETRULE_RESET = 0x19 NFT_MSG_MAX = 0x22 NFTA_LIST_UNSPEC = 0x0 NFTA_LIST_ELEM = 0x1 NFTA_HOOK_UNSPEC = 0x0 NFTA_HOOK_HOOKNUM = 0x1 NFTA_HOOK_PRIORITY = 0x2 NFTA_HOOK_DEV = 0x3 NFT_TABLE_F_DORMANT = 0x1 NFTA_TABLE_UNSPEC = 0x0 NFTA_TABLE_NAME = 0x1 NFTA_TABLE_FLAGS = 0x2 NFTA_TABLE_USE = 0x3 NFTA_CHAIN_UNSPEC = 0x0 NFTA_CHAIN_TABLE = 0x1 NFTA_CHAIN_HANDLE = 0x2 NFTA_CHAIN_NAME = 0x3 NFTA_CHAIN_HOOK = 0x4 NFTA_CHAIN_POLICY = 0x5 NFTA_CHAIN_USE = 0x6 NFTA_CHAIN_TYPE = 0x7 NFTA_CHAIN_COUNTERS = 0x8 NFTA_CHAIN_PAD = 0x9 NFTA_RULE_UNSPEC = 0x0 NFTA_RULE_TABLE = 0x1 NFTA_RULE_CHAIN = 0x2 NFTA_RULE_HANDLE = 0x3 NFTA_RULE_EXPRESSIONS = 0x4 NFTA_RULE_COMPAT = 0x5 NFTA_RULE_POSITION = 0x6 NFTA_RULE_USERDATA = 0x7 NFTA_RULE_PAD = 0x8 NFTA_RULE_ID = 0x9 NFT_RULE_COMPAT_F_INV = 0x2 NFT_RULE_COMPAT_F_MASK = 0x2 NFTA_RULE_COMPAT_UNSPEC = 0x0 NFTA_RULE_COMPAT_PROTO = 0x1 NFTA_RULE_COMPAT_FLAGS = 0x2 NFT_SET_ANONYMOUS = 0x1 NFT_SET_CONSTANT = 0x2 NFT_SET_INTERVAL = 0x4 NFT_SET_MAP = 0x8 NFT_SET_TIMEOUT = 0x10 NFT_SET_EVAL = 0x20 NFT_SET_OBJECT = 0x40 NFT_SET_POL_PERFORMANCE = 0x0 NFT_SET_POL_MEMORY = 0x1 NFTA_SET_DESC_UNSPEC = 0x0 NFTA_SET_DESC_SIZE = 0x1 NFTA_SET_UNSPEC = 0x0 NFTA_SET_TABLE = 0x1 NFTA_SET_NAME = 0x2 NFTA_SET_FLAGS = 0x3 NFTA_SET_KEY_TYPE = 0x4 NFTA_SET_KEY_LEN = 0x5 NFTA_SET_DATA_TYPE = 0x6 NFTA_SET_DATA_LEN = 0x7 NFTA_SET_POLICY = 0x8 NFTA_SET_DESC = 0x9 NFTA_SET_ID = 0xa NFTA_SET_TIMEOUT = 0xb NFTA_SET_GC_INTERVAL = 0xc NFTA_SET_USERDATA = 0xd NFTA_SET_PAD = 0xe NFTA_SET_OBJ_TYPE = 0xf NFT_SET_ELEM_INTERVAL_END = 0x1 NFTA_SET_ELEM_UNSPEC = 0x0 NFTA_SET_ELEM_KEY = 0x1 NFTA_SET_ELEM_DATA = 0x2 NFTA_SET_ELEM_FLAGS = 0x3 NFTA_SET_ELEM_TIMEOUT = 0x4 NFTA_SET_ELEM_EXPIRATION = 0x5 NFTA_SET_ELEM_USERDATA = 0x6 NFTA_SET_ELEM_EXPR = 0x7 NFTA_SET_ELEM_PAD = 0x8 NFTA_SET_ELEM_OBJREF = 0x9 NFTA_SET_ELEM_LIST_UNSPEC = 0x0 NFTA_SET_ELEM_LIST_TABLE = 0x1 NFTA_SET_ELEM_LIST_SET = 0x2 NFTA_SET_ELEM_LIST_ELEMENTS = 0x3 NFTA_SET_ELEM_LIST_SET_ID = 0x4 NFT_DATA_VALUE = 0x0 NFT_DATA_VERDICT = 0xffffff00 NFTA_DATA_UNSPEC = 0x0 NFTA_DATA_VALUE = 0x1 NFTA_DATA_VERDICT = 0x2 NFTA_VERDICT_UNSPEC = 0x0 NFTA_VERDICT_CODE = 0x1 NFTA_VERDICT_CHAIN = 0x2 NFTA_EXPR_UNSPEC = 0x0 NFTA_EXPR_NAME = 0x1 NFTA_EXPR_DATA = 0x2 NFTA_IMMEDIATE_UNSPEC = 0x0 NFTA_IMMEDIATE_DREG = 0x1 NFTA_IMMEDIATE_DATA = 0x2 NFTA_BITWISE_UNSPEC = 0x0 NFTA_BITWISE_SREG = 0x1 NFTA_BITWISE_DREG = 0x2 NFTA_BITWISE_LEN = 0x3 NFTA_BITWISE_MASK = 0x4 NFTA_BITWISE_XOR = 0x5 NFT_BYTEORDER_NTOH = 0x0 NFT_BYTEORDER_HTON = 0x1 NFTA_BYTEORDER_UNSPEC = 0x0 NFTA_BYTEORDER_SREG = 0x1 NFTA_BYTEORDER_DREG = 0x2 NFTA_BYTEORDER_OP = 0x3 NFTA_BYTEORDER_LEN = 0x4 NFTA_BYTEORDER_SIZE = 0x5 NFT_CMP_EQ = 0x0 NFT_CMP_NEQ = 0x1 NFT_CMP_LT = 0x2 NFT_CMP_LTE = 0x3 NFT_CMP_GT = 0x4 NFT_CMP_GTE = 0x5 NFTA_CMP_UNSPEC = 0x0 NFTA_CMP_SREG = 0x1 NFTA_CMP_OP = 0x2 NFTA_CMP_DATA = 0x3 NFT_RANGE_EQ = 0x0 NFT_RANGE_NEQ = 0x1 NFTA_RANGE_UNSPEC = 0x0 NFTA_RANGE_SREG = 0x1 NFTA_RANGE_OP = 0x2 NFTA_RANGE_FROM_DATA = 0x3 NFTA_RANGE_TO_DATA = 0x4 NFT_LOOKUP_F_INV = 0x1 NFTA_LOOKUP_UNSPEC = 0x0 NFTA_LOOKUP_SET = 0x1 NFTA_LOOKUP_SREG = 0x2 NFTA_LOOKUP_DREG = 0x3 NFTA_LOOKUP_SET_ID = 0x4 NFTA_LOOKUP_FLAGS = 0x5 NFT_DYNSET_OP_ADD = 0x0 NFT_DYNSET_OP_UPDATE = 0x1 NFT_DYNSET_F_INV = 0x1 NFTA_DYNSET_UNSPEC = 0x0 NFTA_DYNSET_SET_NAME = 0x1 NFTA_DYNSET_SET_ID = 0x2 NFTA_DYNSET_OP = 0x3 NFTA_DYNSET_SREG_KEY = 0x4 NFTA_DYNSET_SREG_DATA = 0x5 NFTA_DYNSET_TIMEOUT = 0x6 NFTA_DYNSET_EXPR = 0x7 NFTA_DYNSET_PAD = 0x8 NFTA_DYNSET_FLAGS = 0x9 NFT_PAYLOAD_LL_HEADER = 0x0 NFT_PAYLOAD_NETWORK_HEADER = 0x1 NFT_PAYLOAD_TRANSPORT_HEADER = 0x2 NFT_PAYLOAD_INNER_HEADER = 0x3 NFT_PAYLOAD_TUN_HEADER = 0x4 NFT_PAYLOAD_CSUM_NONE = 0x0 NFT_PAYLOAD_CSUM_INET = 0x1 NFT_PAYLOAD_CSUM_SCTP = 0x2 NFT_PAYLOAD_L4CSUM_PSEUDOHDR = 0x1 NFTA_PAYLOAD_UNSPEC = 0x0 NFTA_PAYLOAD_DREG = 0x1 NFTA_PAYLOAD_BASE = 0x2 NFTA_PAYLOAD_OFFSET = 0x3 NFTA_PAYLOAD_LEN = 0x4 NFTA_PAYLOAD_SREG = 0x5 NFTA_PAYLOAD_CSUM_TYPE = 0x6 NFTA_PAYLOAD_CSUM_OFFSET = 0x7 NFTA_PAYLOAD_CSUM_FLAGS = 0x8 NFT_EXTHDR_F_PRESENT = 0x1 NFT_EXTHDR_OP_IPV6 = 0x0 NFT_EXTHDR_OP_TCPOPT = 0x1 NFTA_EXTHDR_UNSPEC = 0x0 NFTA_EXTHDR_DREG = 0x1 NFTA_EXTHDR_TYPE = 0x2 NFTA_EXTHDR_OFFSET = 0x3 NFTA_EXTHDR_LEN = 0x4 NFTA_EXTHDR_FLAGS = 0x5 NFTA_EXTHDR_OP = 0x6 NFTA_EXTHDR_SREG = 0x7 NFT_META_LEN = 0x0 NFT_META_PROTOCOL = 0x1 NFT_META_PRIORITY = 0x2 NFT_META_MARK = 0x3 NFT_META_IIF = 0x4 NFT_META_OIF = 0x5 NFT_META_IIFNAME = 0x6 NFT_META_OIFNAME = 0x7 NFT_META_IIFTYPE = 0x8 NFT_META_OIFTYPE = 0x9 NFT_META_SKUID = 0xa NFT_META_SKGID = 0xb NFT_META_NFTRACE = 0xc NFT_META_RTCLASSID = 0xd NFT_META_SECMARK = 0xe NFT_META_NFPROTO = 0xf NFT_META_L4PROTO = 0x10 NFT_META_BRI_IIFNAME = 0x11 NFT_META_BRI_OIFNAME = 0x12 NFT_META_PKTTYPE = 0x13 NFT_META_CPU = 0x14 NFT_META_IIFGROUP = 0x15 NFT_META_OIFGROUP = 0x16 NFT_META_CGROUP = 0x17 NFT_META_PRANDOM = 0x18 NFT_RT_CLASSID = 0x0 NFT_RT_NEXTHOP4 = 0x1 NFT_RT_NEXTHOP6 = 0x2 NFT_RT_TCPMSS = 0x3 NFT_HASH_JENKINS = 0x0 NFT_HASH_SYM = 0x1 NFTA_HASH_UNSPEC = 0x0 NFTA_HASH_SREG = 0x1 NFTA_HASH_DREG = 0x2 NFTA_HASH_LEN = 0x3 NFTA_HASH_MODULUS = 0x4 NFTA_HASH_SEED = 0x5 NFTA_HASH_OFFSET = 0x6 NFTA_HASH_TYPE = 0x7 NFTA_META_UNSPEC = 0x0 NFTA_META_DREG = 0x1 NFTA_META_KEY = 0x2 NFTA_META_SREG = 0x3 NFTA_RT_UNSPEC = 0x0 NFTA_RT_DREG = 0x1 NFTA_RT_KEY = 0x2 NFT_CT_STATE = 0x0 NFT_CT_DIRECTION = 0x1 NFT_CT_STATUS = 0x2 NFT_CT_MARK = 0x3 NFT_CT_SECMARK = 0x4 NFT_CT_EXPIRATION = 0x5 NFT_CT_HELPER = 0x6 NFT_CT_L3PROTOCOL = 0x7 NFT_CT_SRC = 0x8 NFT_CT_DST = 0x9 NFT_CT_PROTOCOL = 0xa NFT_CT_PROTO_SRC = 0xb NFT_CT_PROTO_DST = 0xc NFT_CT_LABELS = 0xd NFT_CT_PKTS = 0xe NFT_CT_BYTES = 0xf NFT_CT_AVGPKT = 0x10 NFT_CT_ZONE = 0x11 NFT_CT_EVENTMASK = 0x12 NFT_CT_SRC_IP = 0x13 NFT_CT_DST_IP = 0x14 NFT_CT_SRC_IP6 = 0x15 NFT_CT_DST_IP6 = 0x16 NFT_CT_ID = 0x17 NFTA_CT_UNSPEC = 0x0 NFTA_CT_DREG = 0x1 NFTA_CT_KEY = 0x2 NFTA_CT_DIRECTION = 0x3 NFTA_CT_SREG = 0x4 NFT_LIMIT_PKTS = 0x0 NFT_LIMIT_PKT_BYTES = 0x1 NFT_LIMIT_F_INV = 0x1 NFTA_LIMIT_UNSPEC = 0x0 NFTA_LIMIT_RATE = 0x1 NFTA_LIMIT_UNIT = 0x2 NFTA_LIMIT_BURST = 0x3 NFTA_LIMIT_TYPE = 0x4 NFTA_LIMIT_FLAGS = 0x5 NFTA_LIMIT_PAD = 0x6 NFTA_COUNTER_UNSPEC = 0x0 NFTA_COUNTER_BYTES = 0x1 NFTA_COUNTER_PACKETS = 0x2 NFTA_COUNTER_PAD = 0x3 NFTA_LOG_UNSPEC = 0x0 NFTA_LOG_GROUP = 0x1 NFTA_LOG_PREFIX = 0x2 NFTA_LOG_SNAPLEN = 0x3 NFTA_LOG_QTHRESHOLD = 0x4 NFTA_LOG_LEVEL = 0x5 NFTA_LOG_FLAGS = 0x6 NFTA_QUEUE_UNSPEC = 0x0 NFTA_QUEUE_NUM = 0x1 NFTA_QUEUE_TOTAL = 0x2 NFTA_QUEUE_FLAGS = 0x3 NFTA_QUEUE_SREG_QNUM = 0x4 NFT_QUOTA_F_INV = 0x1 NFT_QUOTA_F_DEPLETED = 0x2 NFTA_QUOTA_UNSPEC = 0x0 NFTA_QUOTA_BYTES = 0x1 NFTA_QUOTA_FLAGS = 0x2 NFTA_QUOTA_PAD = 0x3 NFTA_QUOTA_CONSUMED = 0x4 NFT_REJECT_ICMP_UNREACH = 0x0 NFT_REJECT_TCP_RST = 0x1 NFT_REJECT_ICMPX_UNREACH = 0x2 NFT_REJECT_ICMPX_NO_ROUTE = 0x0 NFT_REJECT_ICMPX_PORT_UNREACH = 0x1 NFT_REJECT_ICMPX_HOST_UNREACH = 0x2 NFT_REJECT_ICMPX_ADMIN_PROHIBITED = 0x3 NFTA_REJECT_UNSPEC = 0x0 NFTA_REJECT_TYPE = 0x1 NFTA_REJECT_ICMP_CODE = 0x2 NFT_NAT_SNAT = 0x0 NFT_NAT_DNAT = 0x1 NFTA_NAT_UNSPEC = 0x0 NFTA_NAT_TYPE = 0x1 NFTA_NAT_FAMILY = 0x2 NFTA_NAT_REG_ADDR_MIN = 0x3 NFTA_NAT_REG_ADDR_MAX = 0x4 NFTA_NAT_REG_PROTO_MIN = 0x5 NFTA_NAT_REG_PROTO_MAX = 0x6 NFTA_NAT_FLAGS = 0x7 NFTA_MASQ_UNSPEC = 0x0 NFTA_MASQ_FLAGS = 0x1 NFTA_MASQ_REG_PROTO_MIN = 0x2 NFTA_MASQ_REG_PROTO_MAX = 0x3 NFTA_REDIR_UNSPEC = 0x0 NFTA_REDIR_REG_PROTO_MIN = 0x1 NFTA_REDIR_REG_PROTO_MAX = 0x2 NFTA_REDIR_FLAGS = 0x3 NFTA_DUP_UNSPEC = 0x0 NFTA_DUP_SREG_ADDR = 0x1 NFTA_DUP_SREG_DEV = 0x2 NFTA_FWD_UNSPEC = 0x0 NFTA_FWD_SREG_DEV = 0x1 NFTA_OBJREF_UNSPEC = 0x0 NFTA_OBJREF_IMM_TYPE = 0x1 NFTA_OBJREF_IMM_NAME = 0x2 NFTA_OBJREF_SET_SREG = 0x3 NFTA_OBJREF_SET_NAME = 0x4 NFTA_OBJREF_SET_ID = 0x5 NFTA_GEN_UNSPEC = 0x0 NFTA_GEN_ID = 0x1 NFTA_GEN_PROC_PID = 0x2 NFTA_GEN_PROC_NAME = 0x3 NFTA_FIB_UNSPEC = 0x0 NFTA_FIB_DREG = 0x1 NFTA_FIB_RESULT = 0x2 NFTA_FIB_FLAGS = 0x3 NFT_FIB_RESULT_UNSPEC = 0x0 NFT_FIB_RESULT_OIF = 0x1 NFT_FIB_RESULT_OIFNAME = 0x2 NFT_FIB_RESULT_ADDRTYPE = 0x3 NFTA_FIB_F_SADDR = 0x1 NFTA_FIB_F_DADDR = 0x2 NFTA_FIB_F_MARK = 0x4 NFTA_FIB_F_IIF = 0x8 NFTA_FIB_F_OIF = 0x10 NFTA_FIB_F_PRESENT = 0x20 NFTA_CT_HELPER_UNSPEC = 0x0 NFTA_CT_HELPER_NAME = 0x1 NFTA_CT_HELPER_L3PROTO = 0x2 NFTA_CT_HELPER_L4PROTO = 0x3 NFTA_OBJ_UNSPEC = 0x0 NFTA_OBJ_TABLE = 0x1 NFTA_OBJ_NAME = 0x2 NFTA_OBJ_TYPE = 0x3 NFTA_OBJ_DATA = 0x4 NFTA_OBJ_USE = 0x5 NFTA_TRACE_UNSPEC = 0x0 NFTA_TRACE_TABLE = 0x1 NFTA_TRACE_CHAIN = 0x2 NFTA_TRACE_RULE_HANDLE = 0x3 NFTA_TRACE_TYPE = 0x4 NFTA_TRACE_VERDICT = 0x5 NFTA_TRACE_ID = 0x6 NFTA_TRACE_LL_HEADER = 0x7 NFTA_TRACE_NETWORK_HEADER = 0x8 NFTA_TRACE_TRANSPORT_HEADER = 0x9 NFTA_TRACE_IIF = 0xa NFTA_TRACE_IIFTYPE = 0xb NFTA_TRACE_OIF = 0xc NFTA_TRACE_OIFTYPE = 0xd NFTA_TRACE_MARK = 0xe NFTA_TRACE_NFPROTO = 0xf NFTA_TRACE_POLICY = 0x10 NFTA_TRACE_PAD = 0x11 NFT_TRACETYPE_UNSPEC = 0x0 NFT_TRACETYPE_POLICY = 0x1 NFT_TRACETYPE_RETURN = 0x2 NFT_TRACETYPE_RULE = 0x3 NFTA_NG_UNSPEC = 0x0 NFTA_NG_DREG = 0x1 NFTA_NG_MODULUS = 0x2 NFTA_NG_TYPE = 0x3 NFTA_NG_OFFSET = 0x4 NFT_NG_INCREMENTAL = 0x0 NFT_NG_RANDOM = 0x1 ) const ( NFTA_TARGET_UNSPEC = 0x0 NFTA_TARGET_NAME = 0x1 NFTA_TARGET_REV = 0x2 NFTA_TARGET_INFO = 0x3 NFTA_MATCH_UNSPEC = 0x0 NFTA_MATCH_NAME = 0x1 NFTA_MATCH_REV = 0x2 NFTA_MATCH_INFO = 0x3 NFTA_COMPAT_UNSPEC = 0x0 NFTA_COMPAT_NAME = 0x1 NFTA_COMPAT_REV = 0x2 NFTA_COMPAT_TYPE = 0x3 ) type RTCTime struct { Sec int32 Min int32 Hour int32 Mday int32 Mon int32 Year int32 Wday int32 Yday int32 Isdst int32 } type RTCWkAlrm struct { Enabled uint8 Pending uint8 Time RTCTime } type BlkpgIoctlArg struct { Op int32 Flags int32 Datalen int32 Data *byte } const ( BLKPG_ADD_PARTITION = 0x1 BLKPG_DEL_PARTITION = 0x2 BLKPG_RESIZE_PARTITION = 0x3 ) const ( NETNSA_NONE = 0x0 NETNSA_NSID = 0x1 NETNSA_PID = 0x2 NETNSA_FD = 0x3 NETNSA_TARGET_NSID = 0x4 NETNSA_CURRENT_NSID = 0x5 ) type XDPRingOffset struct { Producer uint64 Consumer uint64 Desc uint64 Flags uint64 } type XDPMmapOffsets struct { Rx XDPRingOffset Tx XDPRingOffset Fr XDPRingOffset Cr XDPRingOffset } type XDPUmemReg struct { Addr uint64 Len uint64 Size uint32 Headroom uint32 Flags uint32 Tx_metadata_len uint32 } type XDPStatistics struct { Rx_dropped uint64 Rx_invalid_descs uint64 Tx_invalid_descs uint64 Rx_ring_full uint64 Rx_fill_ring_empty_descs uint64 Tx_ring_empty_descs uint64 } type XDPDesc struct { Addr uint64 Len uint32 Options uint32 } const ( NCSI_CMD_UNSPEC = 0x0 NCSI_CMD_PKG_INFO = 0x1 NCSI_CMD_SET_INTERFACE = 0x2 NCSI_CMD_CLEAR_INTERFACE = 0x3 NCSI_ATTR_UNSPEC = 0x0 NCSI_ATTR_IFINDEX = 0x1 NCSI_ATTR_PACKAGE_LIST = 0x2 NCSI_ATTR_PACKAGE_ID = 0x3 NCSI_ATTR_CHANNEL_ID = 0x4 NCSI_PKG_ATTR_UNSPEC = 0x0 NCSI_PKG_ATTR = 0x1 NCSI_PKG_ATTR_ID = 0x2 NCSI_PKG_ATTR_FORCED = 0x3 NCSI_PKG_ATTR_CHANNEL_LIST = 0x4 NCSI_CHANNEL_ATTR_UNSPEC = 0x0 NCSI_CHANNEL_ATTR = 0x1 NCSI_CHANNEL_ATTR_ID = 0x2 NCSI_CHANNEL_ATTR_VERSION_MAJOR = 0x3 NCSI_CHANNEL_ATTR_VERSION_MINOR = 0x4 NCSI_CHANNEL_ATTR_VERSION_STR = 0x5 NCSI_CHANNEL_ATTR_LINK_STATE = 0x6 NCSI_CHANNEL_ATTR_ACTIVE = 0x7 NCSI_CHANNEL_ATTR_FORCED = 0x8 NCSI_CHANNEL_ATTR_VLAN_LIST = 0x9 NCSI_CHANNEL_ATTR_VLAN_ID = 0xa ) type ScmTimestamping struct { Ts [3]Timespec } const ( SOF_TIMESTAMPING_TX_HARDWARE = 0x1 SOF_TIMESTAMPING_TX_SOFTWARE = 0x2 SOF_TIMESTAMPING_RX_HARDWARE = 0x4 SOF_TIMESTAMPING_RX_SOFTWARE = 0x8 SOF_TIMESTAMPING_SOFTWARE = 0x10 SOF_TIMESTAMPING_SYS_HARDWARE = 0x20 SOF_TIMESTAMPING_RAW_HARDWARE = 0x40 SOF_TIMESTAMPING_OPT_ID = 0x80 SOF_TIMESTAMPING_TX_SCHED = 0x100 SOF_TIMESTAMPING_TX_ACK = 0x200 SOF_TIMESTAMPING_OPT_CMSG = 0x400 SOF_TIMESTAMPING_OPT_TSONLY = 0x800 SOF_TIMESTAMPING_OPT_STATS = 0x1000 SOF_TIMESTAMPING_OPT_PKTINFO = 0x2000 SOF_TIMESTAMPING_OPT_TX_SWHW = 0x4000 SOF_TIMESTAMPING_BIND_PHC = 0x8000 SOF_TIMESTAMPING_OPT_ID_TCP = 0x10000 SOF_TIMESTAMPING_LAST = 0x40000 SOF_TIMESTAMPING_MASK = 0x7ffff SCM_TSTAMP_SND = 0x0 SCM_TSTAMP_SCHED = 0x1 SCM_TSTAMP_ACK = 0x2 ) type SockExtendedErr struct { Errno uint32 Origin uint8 Type uint8 Code uint8 Pad uint8 Info uint32 Data uint32 } type FanotifyEventMetadata struct { Event_len uint32 Vers uint8 Reserved uint8 Metadata_len uint16 Mask uint64 Fd int32 Pid int32 } type FanotifyResponse struct { Fd int32 Response uint32 } const ( CRYPTO_MSG_BASE = 0x10 CRYPTO_MSG_NEWALG = 0x10 CRYPTO_MSG_DELALG = 0x11 CRYPTO_MSG_UPDATEALG = 0x12 CRYPTO_MSG_GETALG = 0x13 CRYPTO_MSG_DELRNG = 0x14 CRYPTO_MSG_GETSTAT = 0x15 ) const ( CRYPTOCFGA_UNSPEC = 0x0 CRYPTOCFGA_PRIORITY_VAL = 0x1 CRYPTOCFGA_REPORT_LARVAL = 0x2 CRYPTOCFGA_REPORT_HASH = 0x3 CRYPTOCFGA_REPORT_BLKCIPHER = 0x4 CRYPTOCFGA_REPORT_AEAD = 0x5 CRYPTOCFGA_REPORT_COMPRESS = 0x6 CRYPTOCFGA_REPORT_RNG = 0x7 CRYPTOCFGA_REPORT_CIPHER = 0x8 CRYPTOCFGA_REPORT_AKCIPHER = 0x9 CRYPTOCFGA_REPORT_KPP = 0xa CRYPTOCFGA_REPORT_ACOMP = 0xb CRYPTOCFGA_STAT_LARVAL = 0xc CRYPTOCFGA_STAT_HASH = 0xd CRYPTOCFGA_STAT_BLKCIPHER = 0xe CRYPTOCFGA_STAT_AEAD = 0xf CRYPTOCFGA_STAT_COMPRESS = 0x10 CRYPTOCFGA_STAT_RNG = 0x11 CRYPTOCFGA_STAT_CIPHER = 0x12 CRYPTOCFGA_STAT_AKCIPHER = 0x13 CRYPTOCFGA_STAT_KPP = 0x14 CRYPTOCFGA_STAT_ACOMP = 0x15 ) const ( BPF_REG_0 = 0x0 BPF_REG_1 = 0x1 BPF_REG_2 = 0x2 BPF_REG_3 = 0x3 BPF_REG_4 = 0x4 BPF_REG_5 = 0x5 BPF_REG_6 = 0x6 BPF_REG_7 = 0x7 BPF_REG_8 = 0x8 BPF_REG_9 = 0x9 BPF_REG_10 = 0xa BPF_CGROUP_ITER_ORDER_UNSPEC = 0x0 BPF_CGROUP_ITER_SELF_ONLY = 0x1 BPF_CGROUP_ITER_DESCENDANTS_PRE = 0x2 BPF_CGROUP_ITER_DESCENDANTS_POST = 0x3 BPF_CGROUP_ITER_ANCESTORS_UP = 0x4 BPF_MAP_CREATE = 0x0 BPF_MAP_LOOKUP_ELEM = 0x1 BPF_MAP_UPDATE_ELEM = 0x2 BPF_MAP_DELETE_ELEM = 0x3 BPF_MAP_GET_NEXT_KEY = 0x4 BPF_PROG_LOAD = 0x5 BPF_OBJ_PIN = 0x6 BPF_OBJ_GET = 0x7 BPF_PROG_ATTACH = 0x8 BPF_PROG_DETACH = 0x9 BPF_PROG_TEST_RUN = 0xa BPF_PROG_RUN = 0xa BPF_PROG_GET_NEXT_ID = 0xb BPF_MAP_GET_NEXT_ID = 0xc BPF_PROG_GET_FD_BY_ID = 0xd BPF_MAP_GET_FD_BY_ID = 0xe BPF_OBJ_GET_INFO_BY_FD = 0xf BPF_PROG_QUERY = 0x10 BPF_RAW_TRACEPOINT_OPEN = 0x11 BPF_BTF_LOAD = 0x12 BPF_BTF_GET_FD_BY_ID = 0x13 BPF_TASK_FD_QUERY = 0x14 BPF_MAP_LOOKUP_AND_DELETE_ELEM = 0x15 BPF_MAP_FREEZE = 0x16 BPF_BTF_GET_NEXT_ID = 0x17 BPF_MAP_LOOKUP_BATCH = 0x18 BPF_MAP_LOOKUP_AND_DELETE_BATCH = 0x19 BPF_MAP_UPDATE_BATCH = 0x1a BPF_MAP_DELETE_BATCH = 0x1b BPF_LINK_CREATE = 0x1c BPF_LINK_UPDATE = 0x1d BPF_LINK_GET_FD_BY_ID = 0x1e BPF_LINK_GET_NEXT_ID = 0x1f BPF_ENABLE_STATS = 0x20 BPF_ITER_CREATE = 0x21 BPF_LINK_DETACH = 0x22 BPF_PROG_BIND_MAP = 0x23 BPF_MAP_TYPE_UNSPEC = 0x0 BPF_MAP_TYPE_HASH = 0x1 BPF_MAP_TYPE_ARRAY = 0x2 BPF_MAP_TYPE_PROG_ARRAY = 0x3 BPF_MAP_TYPE_PERF_EVENT_ARRAY = 0x4 BPF_MAP_TYPE_PERCPU_HASH = 0x5 BPF_MAP_TYPE_PERCPU_ARRAY = 0x6 BPF_MAP_TYPE_STACK_TRACE = 0x7 BPF_MAP_TYPE_CGROUP_ARRAY = 0x8 BPF_MAP_TYPE_LRU_HASH = 0x9 BPF_MAP_TYPE_LRU_PERCPU_HASH = 0xa BPF_MAP_TYPE_LPM_TRIE = 0xb BPF_MAP_TYPE_ARRAY_OF_MAPS = 0xc BPF_MAP_TYPE_HASH_OF_MAPS = 0xd BPF_MAP_TYPE_DEVMAP = 0xe BPF_MAP_TYPE_SOCKMAP = 0xf BPF_MAP_TYPE_CPUMAP = 0x10 BPF_MAP_TYPE_XSKMAP = 0x11 BPF_MAP_TYPE_SOCKHASH = 0x12 BPF_MAP_TYPE_CGROUP_STORAGE_DEPRECATED = 0x13 BPF_MAP_TYPE_CGROUP_STORAGE = 0x13 BPF_MAP_TYPE_REUSEPORT_SOCKARRAY = 0x14 BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE = 0x15 BPF_MAP_TYPE_QUEUE = 0x16 BPF_MAP_TYPE_STACK = 0x17 BPF_MAP_TYPE_SK_STORAGE = 0x18 BPF_MAP_TYPE_DEVMAP_HASH = 0x19 BPF_MAP_TYPE_STRUCT_OPS = 0x1a BPF_MAP_TYPE_RINGBUF = 0x1b BPF_MAP_TYPE_INODE_STORAGE = 0x1c BPF_MAP_TYPE_TASK_STORAGE = 0x1d BPF_MAP_TYPE_BLOOM_FILTER = 0x1e BPF_MAP_TYPE_USER_RINGBUF = 0x1f BPF_MAP_TYPE_CGRP_STORAGE = 0x20 BPF_PROG_TYPE_UNSPEC = 0x0 BPF_PROG_TYPE_SOCKET_FILTER = 0x1 BPF_PROG_TYPE_KPROBE = 0x2 BPF_PROG_TYPE_SCHED_CLS = 0x3 BPF_PROG_TYPE_SCHED_ACT = 0x4 BPF_PROG_TYPE_TRACEPOINT = 0x5 BPF_PROG_TYPE_XDP = 0x6 BPF_PROG_TYPE_PERF_EVENT = 0x7 BPF_PROG_TYPE_CGROUP_SKB = 0x8 BPF_PROG_TYPE_CGROUP_SOCK = 0x9 BPF_PROG_TYPE_LWT_IN = 0xa BPF_PROG_TYPE_LWT_OUT = 0xb BPF_PROG_TYPE_LWT_XMIT = 0xc BPF_PROG_TYPE_SOCK_OPS = 0xd BPF_PROG_TYPE_SK_SKB = 0xe BPF_PROG_TYPE_CGROUP_DEVICE = 0xf BPF_PROG_TYPE_SK_MSG = 0x10 BPF_PROG_TYPE_RAW_TRACEPOINT = 0x11 BPF_PROG_TYPE_CGROUP_SOCK_ADDR = 0x12 BPF_PROG_TYPE_LWT_SEG6LOCAL = 0x13 BPF_PROG_TYPE_LIRC_MODE2 = 0x14 BPF_PROG_TYPE_SK_REUSEPORT = 0x15 BPF_PROG_TYPE_FLOW_DISSECTOR = 0x16 BPF_PROG_TYPE_CGROUP_SYSCTL = 0x17 BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE = 0x18 BPF_PROG_TYPE_CGROUP_SOCKOPT = 0x19 BPF_PROG_TYPE_TRACING = 0x1a BPF_PROG_TYPE_STRUCT_OPS = 0x1b BPF_PROG_TYPE_EXT = 0x1c BPF_PROG_TYPE_LSM = 0x1d BPF_PROG_TYPE_SK_LOOKUP = 0x1e BPF_PROG_TYPE_SYSCALL = 0x1f BPF_PROG_TYPE_NETFILTER = 0x20 BPF_CGROUP_INET_INGRESS = 0x0 BPF_CGROUP_INET_EGRESS = 0x1 BPF_CGROUP_INET_SOCK_CREATE = 0x2 BPF_CGROUP_SOCK_OPS = 0x3 BPF_SK_SKB_STREAM_PARSER = 0x4 BPF_SK_SKB_STREAM_VERDICT = 0x5 BPF_CGROUP_DEVICE = 0x6 BPF_SK_MSG_VERDICT = 0x7 BPF_CGROUP_INET4_BIND = 0x8 BPF_CGROUP_INET6_BIND = 0x9 BPF_CGROUP_INET4_CONNECT = 0xa BPF_CGROUP_INET6_CONNECT = 0xb BPF_CGROUP_INET4_POST_BIND = 0xc BPF_CGROUP_INET6_POST_BIND = 0xd BPF_CGROUP_UDP4_SENDMSG = 0xe BPF_CGROUP_UDP6_SENDMSG = 0xf BPF_LIRC_MODE2 = 0x10 BPF_FLOW_DISSECTOR = 0x11 BPF_CGROUP_SYSCTL = 0x12 BPF_CGROUP_UDP4_RECVMSG = 0x13 BPF_CGROUP_UDP6_RECVMSG = 0x14 BPF_CGROUP_GETSOCKOPT = 0x15 BPF_CGROUP_SETSOCKOPT = 0x16 BPF_TRACE_RAW_TP = 0x17 BPF_TRACE_FENTRY = 0x18 BPF_TRACE_FEXIT = 0x19 BPF_MODIFY_RETURN = 0x1a BPF_LSM_MAC = 0x1b BPF_TRACE_ITER = 0x1c BPF_CGROUP_INET4_GETPEERNAME = 0x1d BPF_CGROUP_INET6_GETPEERNAME = 0x1e BPF_CGROUP_INET4_GETSOCKNAME = 0x1f BPF_CGROUP_INET6_GETSOCKNAME = 0x20 BPF_XDP_DEVMAP = 0x21 BPF_CGROUP_INET_SOCK_RELEASE = 0x22 BPF_XDP_CPUMAP = 0x23 BPF_SK_LOOKUP = 0x24 BPF_XDP = 0x25 BPF_SK_SKB_VERDICT = 0x26 BPF_SK_REUSEPORT_SELECT = 0x27 BPF_SK_REUSEPORT_SELECT_OR_MIGRATE = 0x28 BPF_PERF_EVENT = 0x29 BPF_TRACE_KPROBE_MULTI = 0x2a BPF_LSM_CGROUP = 0x2b BPF_STRUCT_OPS = 0x2c BPF_NETFILTER = 0x2d BPF_TCX_INGRESS = 0x2e BPF_TCX_EGRESS = 0x2f BPF_TRACE_UPROBE_MULTI = 0x30 BPF_LINK_TYPE_UNSPEC = 0x0 BPF_LINK_TYPE_RAW_TRACEPOINT = 0x1 BPF_LINK_TYPE_TRACING = 0x2 BPF_LINK_TYPE_CGROUP = 0x3 BPF_LINK_TYPE_ITER = 0x4 BPF_LINK_TYPE_NETNS = 0x5 BPF_LINK_TYPE_XDP = 0x6 BPF_LINK_TYPE_PERF_EVENT = 0x7 BPF_LINK_TYPE_KPROBE_MULTI = 0x8 BPF_LINK_TYPE_STRUCT_OPS = 0x9 BPF_LINK_TYPE_NETFILTER = 0xa BPF_LINK_TYPE_TCX = 0xb BPF_LINK_TYPE_UPROBE_MULTI = 0xc BPF_PERF_EVENT_UNSPEC = 0x0 BPF_PERF_EVENT_UPROBE = 0x1 BPF_PERF_EVENT_URETPROBE = 0x2 BPF_PERF_EVENT_KPROBE = 0x3 BPF_PERF_EVENT_KRETPROBE = 0x4 BPF_PERF_EVENT_TRACEPOINT = 0x5 BPF_PERF_EVENT_EVENT = 0x6 BPF_F_KPROBE_MULTI_RETURN = 0x1 BPF_F_UPROBE_MULTI_RETURN = 0x1 BPF_ANY = 0x0 BPF_NOEXIST = 0x1 BPF_EXIST = 0x2 BPF_F_LOCK = 0x4 BPF_F_NO_PREALLOC = 0x1 BPF_F_NO_COMMON_LRU = 0x2 BPF_F_NUMA_NODE = 0x4 BPF_F_RDONLY = 0x8 BPF_F_WRONLY = 0x10 BPF_F_STACK_BUILD_ID = 0x20 BPF_F_ZERO_SEED = 0x40 BPF_F_RDONLY_PROG = 0x80 BPF_F_WRONLY_PROG = 0x100 BPF_F_CLONE = 0x200 BPF_F_MMAPABLE = 0x400 BPF_F_PRESERVE_ELEMS = 0x800 BPF_F_INNER_MAP = 0x1000 BPF_F_LINK = 0x2000 BPF_F_PATH_FD = 0x4000 BPF_STATS_RUN_TIME = 0x0 BPF_STACK_BUILD_ID_EMPTY = 0x0 BPF_STACK_BUILD_ID_VALID = 0x1 BPF_STACK_BUILD_ID_IP = 0x2 BPF_F_RECOMPUTE_CSUM = 0x1 BPF_F_INVALIDATE_HASH = 0x2 BPF_F_HDR_FIELD_MASK = 0xf BPF_F_PSEUDO_HDR = 0x10 BPF_F_MARK_MANGLED_0 = 0x20 BPF_F_MARK_ENFORCE = 0x40 BPF_F_INGRESS = 0x1 BPF_F_TUNINFO_IPV6 = 0x1 BPF_F_SKIP_FIELD_MASK = 0xff BPF_F_USER_STACK = 0x100 BPF_F_FAST_STACK_CMP = 0x200 BPF_F_REUSE_STACKID = 0x400 BPF_F_USER_BUILD_ID = 0x800 BPF_F_ZERO_CSUM_TX = 0x2 BPF_F_DONT_FRAGMENT = 0x4 BPF_F_SEQ_NUMBER = 0x8 BPF_F_NO_TUNNEL_KEY = 0x10 BPF_F_TUNINFO_FLAGS = 0x10 BPF_F_INDEX_MASK = 0xffffffff BPF_F_CURRENT_CPU = 0xffffffff BPF_F_CTXLEN_MASK = 0xfffff00000000 BPF_F_CURRENT_NETNS = -0x1 BPF_CSUM_LEVEL_QUERY = 0x0 BPF_CSUM_LEVEL_INC = 0x1 BPF_CSUM_LEVEL_DEC = 0x2 BPF_CSUM_LEVEL_RESET = 0x3 BPF_F_ADJ_ROOM_FIXED_GSO = 0x1 BPF_F_ADJ_ROOM_ENCAP_L3_IPV4 = 0x2 BPF_F_ADJ_ROOM_ENCAP_L3_IPV6 = 0x4 BPF_F_ADJ_ROOM_ENCAP_L4_GRE = 0x8 BPF_F_ADJ_ROOM_ENCAP_L4_UDP = 0x10 BPF_F_ADJ_ROOM_NO_CSUM_RESET = 0x20 BPF_F_ADJ_ROOM_ENCAP_L2_ETH = 0x40 BPF_F_ADJ_ROOM_DECAP_L3_IPV4 = 0x80 BPF_F_ADJ_ROOM_DECAP_L3_IPV6 = 0x100 BPF_ADJ_ROOM_ENCAP_L2_MASK = 0xff BPF_ADJ_ROOM_ENCAP_L2_SHIFT = 0x38 BPF_F_SYSCTL_BASE_NAME = 0x1 BPF_LOCAL_STORAGE_GET_F_CREATE = 0x1 BPF_SK_STORAGE_GET_F_CREATE = 0x1 BPF_F_GET_BRANCH_RECORDS_SIZE = 0x1 BPF_RB_NO_WAKEUP = 0x1 BPF_RB_FORCE_WAKEUP = 0x2 BPF_RB_AVAIL_DATA = 0x0 BPF_RB_RING_SIZE = 0x1 BPF_RB_CONS_POS = 0x2 BPF_RB_PROD_POS = 0x3 BPF_RINGBUF_BUSY_BIT = 0x80000000 BPF_RINGBUF_DISCARD_BIT = 0x40000000 BPF_RINGBUF_HDR_SZ = 0x8 BPF_SK_LOOKUP_F_REPLACE = 0x1 BPF_SK_LOOKUP_F_NO_REUSEPORT = 0x2 BPF_ADJ_ROOM_NET = 0x0 BPF_ADJ_ROOM_MAC = 0x1 BPF_HDR_START_MAC = 0x0 BPF_HDR_START_NET = 0x1 BPF_LWT_ENCAP_SEG6 = 0x0 BPF_LWT_ENCAP_SEG6_INLINE = 0x1 BPF_LWT_ENCAP_IP = 0x2 BPF_F_BPRM_SECUREEXEC = 0x1 BPF_F_BROADCAST = 0x8 BPF_F_EXCLUDE_INGRESS = 0x10 BPF_SKB_TSTAMP_UNSPEC = 0x0 BPF_SKB_TSTAMP_DELIVERY_MONO = 0x1 BPF_OK = 0x0 BPF_DROP = 0x2 BPF_REDIRECT = 0x7 BPF_LWT_REROUTE = 0x80 BPF_FLOW_DISSECTOR_CONTINUE = 0x81 BPF_SOCK_OPS_RTO_CB_FLAG = 0x1 BPF_SOCK_OPS_RETRANS_CB_FLAG = 0x2 BPF_SOCK_OPS_STATE_CB_FLAG = 0x4 BPF_SOCK_OPS_RTT_CB_FLAG = 0x8 BPF_SOCK_OPS_PARSE_ALL_HDR_OPT_CB_FLAG = 0x10 BPF_SOCK_OPS_PARSE_UNKNOWN_HDR_OPT_CB_FLAG = 0x20 BPF_SOCK_OPS_WRITE_HDR_OPT_CB_FLAG = 0x40 BPF_SOCK_OPS_ALL_CB_FLAGS = 0x7f BPF_SOCK_OPS_VOID = 0x0 BPF_SOCK_OPS_TIMEOUT_INIT = 0x1 BPF_SOCK_OPS_RWND_INIT = 0x2 BPF_SOCK_OPS_TCP_CONNECT_CB = 0x3 BPF_SOCK_OPS_ACTIVE_ESTABLISHED_CB = 0x4 BPF_SOCK_OPS_PASSIVE_ESTABLISHED_CB = 0x5 BPF_SOCK_OPS_NEEDS_ECN = 0x6 BPF_SOCK_OPS_BASE_RTT = 0x7 BPF_SOCK_OPS_RTO_CB = 0x8 BPF_SOCK_OPS_RETRANS_CB = 0x9 BPF_SOCK_OPS_STATE_CB = 0xa BPF_SOCK_OPS_TCP_LISTEN_CB = 0xb BPF_SOCK_OPS_RTT_CB = 0xc BPF_SOCK_OPS_PARSE_HDR_OPT_CB = 0xd BPF_SOCK_OPS_HDR_OPT_LEN_CB = 0xe BPF_SOCK_OPS_WRITE_HDR_OPT_CB = 0xf BPF_TCP_ESTABLISHED = 0x1 BPF_TCP_SYN_SENT = 0x2 BPF_TCP_SYN_RECV = 0x3 BPF_TCP_FIN_WAIT1 = 0x4 BPF_TCP_FIN_WAIT2 = 0x5 BPF_TCP_TIME_WAIT = 0x6 BPF_TCP_CLOSE = 0x7 BPF_TCP_CLOSE_WAIT = 0x8 BPF_TCP_LAST_ACK = 0x9 BPF_TCP_LISTEN = 0xa BPF_TCP_CLOSING = 0xb BPF_TCP_NEW_SYN_RECV = 0xc BPF_TCP_MAX_STATES = 0xe TCP_BPF_IW = 0x3e9 TCP_BPF_SNDCWND_CLAMP = 0x3ea TCP_BPF_DELACK_MAX = 0x3eb TCP_BPF_RTO_MIN = 0x3ec TCP_BPF_SYN = 0x3ed TCP_BPF_SYN_IP = 0x3ee TCP_BPF_SYN_MAC = 0x3ef BPF_LOAD_HDR_OPT_TCP_SYN = 0x1 BPF_WRITE_HDR_TCP_CURRENT_MSS = 0x1 BPF_WRITE_HDR_TCP_SYNACK_COOKIE = 0x2 BPF_DEVCG_ACC_MKNOD = 0x1 BPF_DEVCG_ACC_READ = 0x2 BPF_DEVCG_ACC_WRITE = 0x4 BPF_DEVCG_DEV_BLOCK = 0x1 BPF_DEVCG_DEV_CHAR = 0x2 BPF_FIB_LOOKUP_DIRECT = 0x1 BPF_FIB_LOOKUP_OUTPUT = 0x2 BPF_FIB_LOOKUP_SKIP_NEIGH = 0x4 BPF_FIB_LOOKUP_TBID = 0x8 BPF_FIB_LKUP_RET_SUCCESS = 0x0 BPF_FIB_LKUP_RET_BLACKHOLE = 0x1 BPF_FIB_LKUP_RET_UNREACHABLE = 0x2 BPF_FIB_LKUP_RET_PROHIBIT = 0x3 BPF_FIB_LKUP_RET_NOT_FWDED = 0x4 BPF_FIB_LKUP_RET_FWD_DISABLED = 0x5 BPF_FIB_LKUP_RET_UNSUPP_LWT = 0x6 BPF_FIB_LKUP_RET_NO_NEIGH = 0x7 BPF_FIB_LKUP_RET_FRAG_NEEDED = 0x8 BPF_MTU_CHK_SEGS = 0x1 BPF_MTU_CHK_RET_SUCCESS = 0x0 BPF_MTU_CHK_RET_FRAG_NEEDED = 0x1 BPF_MTU_CHK_RET_SEGS_TOOBIG = 0x2 BPF_FD_TYPE_RAW_TRACEPOINT = 0x0 BPF_FD_TYPE_TRACEPOINT = 0x1 BPF_FD_TYPE_KPROBE = 0x2 BPF_FD_TYPE_KRETPROBE = 0x3 BPF_FD_TYPE_UPROBE = 0x4 BPF_FD_TYPE_URETPROBE = 0x5 BPF_FLOW_DISSECTOR_F_PARSE_1ST_FRAG = 0x1 BPF_FLOW_DISSECTOR_F_STOP_AT_FLOW_LABEL = 0x2 BPF_FLOW_DISSECTOR_F_STOP_AT_ENCAP = 0x4 BPF_CORE_FIELD_BYTE_OFFSET = 0x0 BPF_CORE_FIELD_BYTE_SIZE = 0x1 BPF_CORE_FIELD_EXISTS = 0x2 BPF_CORE_FIELD_SIGNED = 0x3 BPF_CORE_FIELD_LSHIFT_U64 = 0x4 BPF_CORE_FIELD_RSHIFT_U64 = 0x5 BPF_CORE_TYPE_ID_LOCAL = 0x6 BPF_CORE_TYPE_ID_TARGET = 0x7 BPF_CORE_TYPE_EXISTS = 0x8 BPF_CORE_TYPE_SIZE = 0x9 BPF_CORE_ENUMVAL_EXISTS = 0xa BPF_CORE_ENUMVAL_VALUE = 0xb BPF_CORE_TYPE_MATCHES = 0xc BPF_F_TIMER_ABS = 0x1 ) const ( TCA_UNSPEC = 0x0 TCA_KIND = 0x1 TCA_OPTIONS = 0x2 TCA_STATS = 0x3 TCA_XSTATS = 0x4 TCA_RATE = 0x5 TCA_FCNT = 0x6 TCA_STATS2 = 0x7 TCA_STAB = 0x8 TCA_PAD = 0x9 TCA_DUMP_INVISIBLE = 0xa TCA_CHAIN = 0xb TCA_HW_OFFLOAD = 0xc TCA_INGRESS_BLOCK = 0xd TCA_EGRESS_BLOCK = 0xe TCA_DUMP_FLAGS = 0xf TCA_EXT_WARN_MSG = 0x10 RTNLGRP_NONE = 0x0 RTNLGRP_LINK = 0x1 RTNLGRP_NOTIFY = 0x2 RTNLGRP_NEIGH = 0x3 RTNLGRP_TC = 0x4 RTNLGRP_IPV4_IFADDR = 0x5 RTNLGRP_IPV4_MROUTE = 0x6 RTNLGRP_IPV4_ROUTE = 0x7 RTNLGRP_IPV4_RULE = 0x8 RTNLGRP_IPV6_IFADDR = 0x9 RTNLGRP_IPV6_MROUTE = 0xa RTNLGRP_IPV6_ROUTE = 0xb RTNLGRP_IPV6_IFINFO = 0xc RTNLGRP_DECnet_IFADDR = 0xd RTNLGRP_NOP2 = 0xe RTNLGRP_DECnet_ROUTE = 0xf RTNLGRP_DECnet_RULE = 0x10 RTNLGRP_NOP4 = 0x11 RTNLGRP_IPV6_PREFIX = 0x12 RTNLGRP_IPV6_RULE = 0x13 RTNLGRP_ND_USEROPT = 0x14 RTNLGRP_PHONET_IFADDR = 0x15 RTNLGRP_PHONET_ROUTE = 0x16 RTNLGRP_DCB = 0x17 RTNLGRP_IPV4_NETCONF = 0x18 RTNLGRP_IPV6_NETCONF = 0x19 RTNLGRP_MDB = 0x1a RTNLGRP_MPLS_ROUTE = 0x1b RTNLGRP_NSID = 0x1c RTNLGRP_MPLS_NETCONF = 0x1d RTNLGRP_IPV4_MROUTE_R = 0x1e RTNLGRP_IPV6_MROUTE_R = 0x1f RTNLGRP_NEXTHOP = 0x20 RTNLGRP_BRVLAN = 0x21 RTNLGRP_MCTP_IFADDR = 0x22 RTNLGRP_TUNNEL = 0x23 RTNLGRP_STATS = 0x24 RTNLGRP_IPV4_MCADDR = 0x25 RTNLGRP_IPV6_MCADDR = 0x26 RTNLGRP_IPV6_ACADDR = 0x27 TCA_ROOT_UNSPEC = 0x0 TCA_ROOT_TAB = 0x1 TCA_ROOT_FLAGS = 0x2 TCA_ROOT_COUNT = 0x3 TCA_ROOT_TIME_DELTA = 0x4 TCA_ROOT_EXT_WARN_MSG = 0x5 ) type CapUserHeader struct { Version uint32 Pid int32 } type CapUserData struct { Effective uint32 Permitted uint32 Inheritable uint32 } const ( LINUX_CAPABILITY_VERSION_1 = 0x19980330 LINUX_CAPABILITY_VERSION_2 = 0x20071026 LINUX_CAPABILITY_VERSION_3 = 0x20080522 ) const ( LO_FLAGS_READ_ONLY = 0x1 LO_FLAGS_AUTOCLEAR = 0x4 LO_FLAGS_PARTSCAN = 0x8 LO_FLAGS_DIRECT_IO = 0x10 ) type LoopInfo64 struct { Device uint64 Inode uint64 Rdevice uint64 Offset uint64 Sizelimit uint64 Number uint32 Encrypt_type uint32 Encrypt_key_size uint32 Flags uint32 File_name [64]uint8 Crypt_name [64]uint8 Encrypt_key [32]uint8 Init [2]uint64 } type LoopConfig struct { Fd uint32 Size uint32 Info LoopInfo64 _ [8]uint64 } type TIPCSocketAddr struct { Ref uint32 Node uint32 } type TIPCServiceRange struct { Type uint32 Lower uint32 Upper uint32 } type TIPCServiceName struct { Type uint32 Instance uint32 Domain uint32 } type TIPCEvent struct { Event uint32 Lower uint32 Upper uint32 Port TIPCSocketAddr S TIPCSubscr } type TIPCGroupReq struct { Type uint32 Instance uint32 Scope uint32 Flags uint32 } const ( TIPC_CLUSTER_SCOPE = 0x2 TIPC_NODE_SCOPE = 0x3 ) const ( SYSLOG_ACTION_CLOSE = 0 SYSLOG_ACTION_OPEN = 1 SYSLOG_ACTION_READ = 2 SYSLOG_ACTION_READ_ALL = 3 SYSLOG_ACTION_READ_CLEAR = 4 SYSLOG_ACTION_CLEAR = 5 SYSLOG_ACTION_CONSOLE_OFF = 6 SYSLOG_ACTION_CONSOLE_ON = 7 SYSLOG_ACTION_CONSOLE_LEVEL = 8 SYSLOG_ACTION_SIZE_UNREAD = 9 SYSLOG_ACTION_SIZE_BUFFER = 10 ) const ( DEVLINK_CMD_UNSPEC = 0x0 DEVLINK_CMD_GET = 0x1 DEVLINK_CMD_SET = 0x2 DEVLINK_CMD_NEW = 0x3 DEVLINK_CMD_DEL = 0x4 DEVLINK_CMD_PORT_GET = 0x5 DEVLINK_CMD_PORT_SET = 0x6 DEVLINK_CMD_PORT_NEW = 0x7 DEVLINK_CMD_PORT_DEL = 0x8 DEVLINK_CMD_PORT_SPLIT = 0x9 DEVLINK_CMD_PORT_UNSPLIT = 0xa DEVLINK_CMD_SB_GET = 0xb DEVLINK_CMD_SB_SET = 0xc DEVLINK_CMD_SB_NEW = 0xd DEVLINK_CMD_SB_DEL = 0xe DEVLINK_CMD_SB_POOL_GET = 0xf DEVLINK_CMD_SB_POOL_SET = 0x10 DEVLINK_CMD_SB_POOL_NEW = 0x11 DEVLINK_CMD_SB_POOL_DEL = 0x12 DEVLINK_CMD_SB_PORT_POOL_GET = 0x13 DEVLINK_CMD_SB_PORT_POOL_SET = 0x14 DEVLINK_CMD_SB_PORT_POOL_NEW = 0x15 DEVLINK_CMD_SB_PORT_POOL_DEL = 0x16 DEVLINK_CMD_SB_TC_POOL_BIND_GET = 0x17 DEVLINK_CMD_SB_TC_POOL_BIND_SET = 0x18 DEVLINK_CMD_SB_TC_POOL_BIND_NEW = 0x19 DEVLINK_CMD_SB_TC_POOL_BIND_DEL = 0x1a DEVLINK_CMD_SB_OCC_SNAPSHOT = 0x1b DEVLINK_CMD_SB_OCC_MAX_CLEAR = 0x1c DEVLINK_CMD_ESWITCH_GET = 0x1d DEVLINK_CMD_ESWITCH_SET = 0x1e DEVLINK_CMD_DPIPE_TABLE_GET = 0x1f DEVLINK_CMD_DPIPE_ENTRIES_GET = 0x20 DEVLINK_CMD_DPIPE_HEADERS_GET = 0x21 DEVLINK_CMD_DPIPE_TABLE_COUNTERS_SET = 0x22 DEVLINK_CMD_RESOURCE_SET = 0x23 DEVLINK_CMD_RESOURCE_DUMP = 0x24 DEVLINK_CMD_RELOAD = 0x25 DEVLINK_CMD_PARAM_GET = 0x26 DEVLINK_CMD_PARAM_SET = 0x27 DEVLINK_CMD_PARAM_NEW = 0x28 DEVLINK_CMD_PARAM_DEL = 0x29 DEVLINK_CMD_REGION_GET = 0x2a DEVLINK_CMD_REGION_SET = 0x2b DEVLINK_CMD_REGION_NEW = 0x2c DEVLINK_CMD_REGION_DEL = 0x2d DEVLINK_CMD_REGION_READ = 0x2e DEVLINK_CMD_PORT_PARAM_GET = 0x2f DEVLINK_CMD_PORT_PARAM_SET = 0x30 DEVLINK_CMD_PORT_PARAM_NEW = 0x31 DEVLINK_CMD_PORT_PARAM_DEL = 0x32 DEVLINK_CMD_INFO_GET = 0x33 DEVLINK_CMD_HEALTH_REPORTER_GET = 0x34 DEVLINK_CMD_HEALTH_REPORTER_SET = 0x35 DEVLINK_CMD_HEALTH_REPORTER_RECOVER = 0x36 DEVLINK_CMD_HEALTH_REPORTER_DIAGNOSE = 0x37 DEVLINK_CMD_HEALTH_REPORTER_DUMP_GET = 0x38 DEVLINK_CMD_HEALTH_REPORTER_DUMP_CLEAR = 0x39 DEVLINK_CMD_FLASH_UPDATE = 0x3a DEVLINK_CMD_FLASH_UPDATE_END = 0x3b DEVLINK_CMD_FLASH_UPDATE_STATUS = 0x3c DEVLINK_CMD_TRAP_GET = 0x3d DEVLINK_CMD_TRAP_SET = 0x3e DEVLINK_CMD_TRAP_NEW = 0x3f DEVLINK_CMD_TRAP_DEL = 0x40 DEVLINK_CMD_TRAP_GROUP_GET = 0x41 DEVLINK_CMD_TRAP_GROUP_SET = 0x42 DEVLINK_CMD_TRAP_GROUP_NEW = 0x43 DEVLINK_CMD_TRAP_GROUP_DEL = 0x44 DEVLINK_CMD_TRAP_POLICER_GET = 0x45 DEVLINK_CMD_TRAP_POLICER_SET = 0x46 DEVLINK_CMD_TRAP_POLICER_NEW = 0x47 DEVLINK_CMD_TRAP_POLICER_DEL = 0x48 DEVLINK_CMD_HEALTH_REPORTER_TEST = 0x49 DEVLINK_CMD_RATE_GET = 0x4a DEVLINK_CMD_RATE_SET = 0x4b DEVLINK_CMD_RATE_NEW = 0x4c DEVLINK_CMD_RATE_DEL = 0x4d DEVLINK_CMD_LINECARD_GET = 0x4e DEVLINK_CMD_LINECARD_SET = 0x4f DEVLINK_CMD_LINECARD_NEW = 0x50 DEVLINK_CMD_LINECARD_DEL = 0x51 DEVLINK_CMD_SELFTESTS_GET = 0x52 DEVLINK_CMD_MAX = 0x54 DEVLINK_PORT_TYPE_NOTSET = 0x0 DEVLINK_PORT_TYPE_AUTO = 0x1 DEVLINK_PORT_TYPE_ETH = 0x2 DEVLINK_PORT_TYPE_IB = 0x3 DEVLINK_SB_POOL_TYPE_INGRESS = 0x0 DEVLINK_SB_POOL_TYPE_EGRESS = 0x1 DEVLINK_SB_THRESHOLD_TYPE_STATIC = 0x0 DEVLINK_SB_THRESHOLD_TYPE_DYNAMIC = 0x1 DEVLINK_ESWITCH_MODE_LEGACY = 0x0 DEVLINK_ESWITCH_MODE_SWITCHDEV = 0x1 DEVLINK_ESWITCH_INLINE_MODE_NONE = 0x0 DEVLINK_ESWITCH_INLINE_MODE_LINK = 0x1 DEVLINK_ESWITCH_INLINE_MODE_NETWORK = 0x2 DEVLINK_ESWITCH_INLINE_MODE_TRANSPORT = 0x3 DEVLINK_ESWITCH_ENCAP_MODE_NONE = 0x0 DEVLINK_ESWITCH_ENCAP_MODE_BASIC = 0x1 DEVLINK_PORT_FLAVOUR_PHYSICAL = 0x0 DEVLINK_PORT_FLAVOUR_CPU = 0x1 DEVLINK_PORT_FLAVOUR_DSA = 0x2 DEVLINK_PORT_FLAVOUR_PCI_PF = 0x3 DEVLINK_PORT_FLAVOUR_PCI_VF = 0x4 DEVLINK_PORT_FLAVOUR_VIRTUAL = 0x5 DEVLINK_PORT_FLAVOUR_UNUSED = 0x6 DEVLINK_PARAM_CMODE_RUNTIME = 0x0 DEVLINK_PARAM_CMODE_DRIVERINIT = 0x1 DEVLINK_PARAM_CMODE_PERMANENT = 0x2 DEVLINK_PARAM_CMODE_MAX = 0x2 DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_DRIVER = 0x0 DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_FLASH = 0x1 DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_DISK = 0x2 DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_UNKNOWN = 0x3 DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_VALUE_UNKNOWN = 0x0 DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_VALUE_ALWAYS = 0x1 DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_VALUE_NEVER = 0x2 DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_VALUE_DISK = 0x3 DEVLINK_ATTR_STATS_RX_PACKETS = 0x0 DEVLINK_ATTR_STATS_RX_BYTES = 0x1 DEVLINK_ATTR_STATS_RX_DROPPED = 0x2 DEVLINK_ATTR_STATS_MAX = 0x2 DEVLINK_FLASH_OVERWRITE_SETTINGS_BIT = 0x0 DEVLINK_FLASH_OVERWRITE_IDENTIFIERS_BIT = 0x1 DEVLINK_FLASH_OVERWRITE_MAX_BIT = 0x1 DEVLINK_TRAP_ACTION_DROP = 0x0 DEVLINK_TRAP_ACTION_TRAP = 0x1 DEVLINK_TRAP_ACTION_MIRROR = 0x2 DEVLINK_TRAP_TYPE_DROP = 0x0 DEVLINK_TRAP_TYPE_EXCEPTION = 0x1 DEVLINK_TRAP_TYPE_CONTROL = 0x2 DEVLINK_ATTR_TRAP_METADATA_TYPE_IN_PORT = 0x0 DEVLINK_ATTR_TRAP_METADATA_TYPE_FA_COOKIE = 0x1 DEVLINK_RELOAD_ACTION_UNSPEC = 0x0 DEVLINK_RELOAD_ACTION_DRIVER_REINIT = 0x1 DEVLINK_RELOAD_ACTION_FW_ACTIVATE = 0x2 DEVLINK_RELOAD_ACTION_MAX = 0x2 DEVLINK_RELOAD_LIMIT_UNSPEC = 0x0 DEVLINK_RELOAD_LIMIT_NO_RESET = 0x1 DEVLINK_RELOAD_LIMIT_MAX = 0x1 DEVLINK_ATTR_UNSPEC = 0x0 DEVLINK_ATTR_BUS_NAME = 0x1 DEVLINK_ATTR_DEV_NAME = 0x2 DEVLINK_ATTR_PORT_INDEX = 0x3 DEVLINK_ATTR_PORT_TYPE = 0x4 DEVLINK_ATTR_PORT_DESIRED_TYPE = 0x5 DEVLINK_ATTR_PORT_NETDEV_IFINDEX = 0x6 DEVLINK_ATTR_PORT_NETDEV_NAME = 0x7 DEVLINK_ATTR_PORT_IBDEV_NAME = 0x8 DEVLINK_ATTR_PORT_SPLIT_COUNT = 0x9 DEVLINK_ATTR_PORT_SPLIT_GROUP = 0xa DEVLINK_ATTR_SB_INDEX = 0xb DEVLINK_ATTR_SB_SIZE = 0xc DEVLINK_ATTR_SB_INGRESS_POOL_COUNT = 0xd DEVLINK_ATTR_SB_EGRESS_POOL_COUNT = 0xe DEVLINK_ATTR_SB_INGRESS_TC_COUNT = 0xf DEVLINK_ATTR_SB_EGRESS_TC_COUNT = 0x10 DEVLINK_ATTR_SB_POOL_INDEX = 0x11 DEVLINK_ATTR_SB_POOL_TYPE = 0x12 DEVLINK_ATTR_SB_POOL_SIZE = 0x13 DEVLINK_ATTR_SB_POOL_THRESHOLD_TYPE = 0x14 DEVLINK_ATTR_SB_THRESHOLD = 0x15 DEVLINK_ATTR_SB_TC_INDEX = 0x16 DEVLINK_ATTR_SB_OCC_CUR = 0x17 DEVLINK_ATTR_SB_OCC_MAX = 0x18 DEVLINK_ATTR_ESWITCH_MODE = 0x19 DEVLINK_ATTR_ESWITCH_INLINE_MODE = 0x1a DEVLINK_ATTR_DPIPE_TABLES = 0x1b DEVLINK_ATTR_DPIPE_TABLE = 0x1c DEVLINK_ATTR_DPIPE_TABLE_NAME = 0x1d DEVLINK_ATTR_DPIPE_TABLE_SIZE = 0x1e DEVLINK_ATTR_DPIPE_TABLE_MATCHES = 0x1f DEVLINK_ATTR_DPIPE_TABLE_ACTIONS = 0x20 DEVLINK_ATTR_DPIPE_TABLE_COUNTERS_ENABLED = 0x21 DEVLINK_ATTR_DPIPE_ENTRIES = 0x22 DEVLINK_ATTR_DPIPE_ENTRY = 0x23 DEVLINK_ATTR_DPIPE_ENTRY_INDEX = 0x24 DEVLINK_ATTR_DPIPE_ENTRY_MATCH_VALUES = 0x25 DEVLINK_ATTR_DPIPE_ENTRY_ACTION_VALUES = 0x26 DEVLINK_ATTR_DPIPE_ENTRY_COUNTER = 0x27 DEVLINK_ATTR_DPIPE_MATCH = 0x28 DEVLINK_ATTR_DPIPE_MATCH_VALUE = 0x29 DEVLINK_ATTR_DPIPE_MATCH_TYPE = 0x2a DEVLINK_ATTR_DPIPE_ACTION = 0x2b DEVLINK_ATTR_DPIPE_ACTION_VALUE = 0x2c DEVLINK_ATTR_DPIPE_ACTION_TYPE = 0x2d DEVLINK_ATTR_DPIPE_VALUE = 0x2e DEVLINK_ATTR_DPIPE_VALUE_MASK = 0x2f DEVLINK_ATTR_DPIPE_VALUE_MAPPING = 0x30 DEVLINK_ATTR_DPIPE_HEADERS = 0x31 DEVLINK_ATTR_DPIPE_HEADER = 0x32 DEVLINK_ATTR_DPIPE_HEADER_NAME = 0x33 DEVLINK_ATTR_DPIPE_HEADER_ID = 0x34 DEVLINK_ATTR_DPIPE_HEADER_FIELDS = 0x35 DEVLINK_ATTR_DPIPE_HEADER_GLOBAL = 0x36 DEVLINK_ATTR_DPIPE_HEADER_INDEX = 0x37 DEVLINK_ATTR_DPIPE_FIELD = 0x38 DEVLINK_ATTR_DPIPE_FIELD_NAME = 0x39 DEVLINK_ATTR_DPIPE_FIELD_ID = 0x3a DEVLINK_ATTR_DPIPE_FIELD_BITWIDTH = 0x3b DEVLINK_ATTR_DPIPE_FIELD_MAPPING_TYPE = 0x3c DEVLINK_ATTR_PAD = 0x3d DEVLINK_ATTR_ESWITCH_ENCAP_MODE = 0x3e DEVLINK_ATTR_RESOURCE_LIST = 0x3f DEVLINK_ATTR_RESOURCE = 0x40 DEVLINK_ATTR_RESOURCE_NAME = 0x41 DEVLINK_ATTR_RESOURCE_ID = 0x42 DEVLINK_ATTR_RESOURCE_SIZE = 0x43 DEVLINK_ATTR_RESOURCE_SIZE_NEW = 0x44 DEVLINK_ATTR_RESOURCE_SIZE_VALID = 0x45 DEVLINK_ATTR_RESOURCE_SIZE_MIN = 0x46 DEVLINK_ATTR_RESOURCE_SIZE_MAX = 0x47 DEVLINK_ATTR_RESOURCE_SIZE_GRAN = 0x48 DEVLINK_ATTR_RESOURCE_UNIT = 0x49 DEVLINK_ATTR_RESOURCE_OCC = 0x4a DEVLINK_ATTR_DPIPE_TABLE_RESOURCE_ID = 0x4b DEVLINK_ATTR_DPIPE_TABLE_RESOURCE_UNITS = 0x4c DEVLINK_ATTR_PORT_FLAVOUR = 0x4d DEVLINK_ATTR_PORT_NUMBER = 0x4e DEVLINK_ATTR_PORT_SPLIT_SUBPORT_NUMBER = 0x4f DEVLINK_ATTR_PARAM = 0x50 DEVLINK_ATTR_PARAM_NAME = 0x51 DEVLINK_ATTR_PARAM_GENERIC = 0x52 DEVLINK_ATTR_PARAM_TYPE = 0x53 DEVLINK_ATTR_PARAM_VALUES_LIST = 0x54 DEVLINK_ATTR_PARAM_VALUE = 0x55 DEVLINK_ATTR_PARAM_VALUE_DATA = 0x56 DEVLINK_ATTR_PARAM_VALUE_CMODE = 0x57 DEVLINK_ATTR_REGION_NAME = 0x58 DEVLINK_ATTR_REGION_SIZE = 0x59 DEVLINK_ATTR_REGION_SNAPSHOTS = 0x5a DEVLINK_ATTR_REGION_SNAPSHOT = 0x5b DEVLINK_ATTR_REGION_SNAPSHOT_ID = 0x5c DEVLINK_ATTR_REGION_CHUNKS = 0x5d DEVLINK_ATTR_REGION_CHUNK = 0x5e DEVLINK_ATTR_REGION_CHUNK_DATA = 0x5f DEVLINK_ATTR_REGION_CHUNK_ADDR = 0x60 DEVLINK_ATTR_REGION_CHUNK_LEN = 0x61 DEVLINK_ATTR_INFO_DRIVER_NAME = 0x62 DEVLINK_ATTR_INFO_SERIAL_NUMBER = 0x63 DEVLINK_ATTR_INFO_VERSION_FIXED = 0x64 DEVLINK_ATTR_INFO_VERSION_RUNNING = 0x65 DEVLINK_ATTR_INFO_VERSION_STORED = 0x66 DEVLINK_ATTR_INFO_VERSION_NAME = 0x67 DEVLINK_ATTR_INFO_VERSION_VALUE = 0x68 DEVLINK_ATTR_SB_POOL_CELL_SIZE = 0x69 DEVLINK_ATTR_FMSG = 0x6a DEVLINK_ATTR_FMSG_OBJ_NEST_START = 0x6b DEVLINK_ATTR_FMSG_PAIR_NEST_START = 0x6c DEVLINK_ATTR_FMSG_ARR_NEST_START = 0x6d DEVLINK_ATTR_FMSG_NEST_END = 0x6e DEVLINK_ATTR_FMSG_OBJ_NAME = 0x6f DEVLINK_ATTR_FMSG_OBJ_VALUE_TYPE = 0x70 DEVLINK_ATTR_FMSG_OBJ_VALUE_DATA = 0x71 DEVLINK_ATTR_HEALTH_REPORTER = 0x72 DEVLINK_ATTR_HEALTH_REPORTER_NAME = 0x73 DEVLINK_ATTR_HEALTH_REPORTER_STATE = 0x74 DEVLINK_ATTR_HEALTH_REPORTER_ERR_COUNT = 0x75 DEVLINK_ATTR_HEALTH_REPORTER_RECOVER_COUNT = 0x76 DEVLINK_ATTR_HEALTH_REPORTER_DUMP_TS = 0x77 DEVLINK_ATTR_HEALTH_REPORTER_GRACEFUL_PERIOD = 0x78 DEVLINK_ATTR_HEALTH_REPORTER_AUTO_RECOVER = 0x79 DEVLINK_ATTR_FLASH_UPDATE_FILE_NAME = 0x7a DEVLINK_ATTR_FLASH_UPDATE_COMPONENT = 0x7b DEVLINK_ATTR_FLASH_UPDATE_STATUS_MSG = 0x7c DEVLINK_ATTR_FLASH_UPDATE_STATUS_DONE = 0x7d DEVLINK_ATTR_FLASH_UPDATE_STATUS_TOTAL = 0x7e DEVLINK_ATTR_PORT_PCI_PF_NUMBER = 0x7f DEVLINK_ATTR_PORT_PCI_VF_NUMBER = 0x80 DEVLINK_ATTR_STATS = 0x81 DEVLINK_ATTR_TRAP_NAME = 0x82 DEVLINK_ATTR_TRAP_ACTION = 0x83 DEVLINK_ATTR_TRAP_TYPE = 0x84 DEVLINK_ATTR_TRAP_GENERIC = 0x85 DEVLINK_ATTR_TRAP_METADATA = 0x86 DEVLINK_ATTR_TRAP_GROUP_NAME = 0x87 DEVLINK_ATTR_RELOAD_FAILED = 0x88 DEVLINK_ATTR_HEALTH_REPORTER_DUMP_TS_NS = 0x89 DEVLINK_ATTR_NETNS_FD = 0x8a DEVLINK_ATTR_NETNS_PID = 0x8b DEVLINK_ATTR_NETNS_ID = 0x8c DEVLINK_ATTR_HEALTH_REPORTER_AUTO_DUMP = 0x8d DEVLINK_ATTR_TRAP_POLICER_ID = 0x8e DEVLINK_ATTR_TRAP_POLICER_RATE = 0x8f DEVLINK_ATTR_TRAP_POLICER_BURST = 0x90 DEVLINK_ATTR_PORT_FUNCTION = 0x91 DEVLINK_ATTR_INFO_BOARD_SERIAL_NUMBER = 0x92 DEVLINK_ATTR_PORT_LANES = 0x93 DEVLINK_ATTR_PORT_SPLITTABLE = 0x94 DEVLINK_ATTR_PORT_EXTERNAL = 0x95 DEVLINK_ATTR_PORT_CONTROLLER_NUMBER = 0x96 DEVLINK_ATTR_FLASH_UPDATE_STATUS_TIMEOUT = 0x97 DEVLINK_ATTR_FLASH_UPDATE_OVERWRITE_MASK = 0x98 DEVLINK_ATTR_RELOAD_ACTION = 0x99 DEVLINK_ATTR_RELOAD_ACTIONS_PERFORMED = 0x9a DEVLINK_ATTR_RELOAD_LIMITS = 0x9b DEVLINK_ATTR_DEV_STATS = 0x9c DEVLINK_ATTR_RELOAD_STATS = 0x9d DEVLINK_ATTR_RELOAD_STATS_ENTRY = 0x9e DEVLINK_ATTR_RELOAD_STATS_LIMIT = 0x9f DEVLINK_ATTR_RELOAD_STATS_VALUE = 0xa0 DEVLINK_ATTR_REMOTE_RELOAD_STATS = 0xa1 DEVLINK_ATTR_RELOAD_ACTION_INFO = 0xa2 DEVLINK_ATTR_RELOAD_ACTION_STATS = 0xa3 DEVLINK_ATTR_PORT_PCI_SF_NUMBER = 0xa4 DEVLINK_ATTR_RATE_TYPE = 0xa5 DEVLINK_ATTR_RATE_TX_SHARE = 0xa6 DEVLINK_ATTR_RATE_TX_MAX = 0xa7 DEVLINK_ATTR_RATE_NODE_NAME = 0xa8 DEVLINK_ATTR_RATE_PARENT_NODE_NAME = 0xa9 DEVLINK_ATTR_REGION_MAX_SNAPSHOTS = 0xaa DEVLINK_ATTR_LINECARD_INDEX = 0xab DEVLINK_ATTR_LINECARD_STATE = 0xac DEVLINK_ATTR_LINECARD_TYPE = 0xad DEVLINK_ATTR_LINECARD_SUPPORTED_TYPES = 0xae DEVLINK_ATTR_NESTED_DEVLINK = 0xaf DEVLINK_ATTR_SELFTESTS = 0xb0 DEVLINK_ATTR_MAX = 0xb3 DEVLINK_DPIPE_FIELD_MAPPING_TYPE_NONE = 0x0 DEVLINK_DPIPE_FIELD_MAPPING_TYPE_IFINDEX = 0x1 DEVLINK_DPIPE_MATCH_TYPE_FIELD_EXACT = 0x0 DEVLINK_DPIPE_ACTION_TYPE_FIELD_MODIFY = 0x0 DEVLINK_DPIPE_FIELD_ETHERNET_DST_MAC = 0x0 DEVLINK_DPIPE_FIELD_IPV4_DST_IP = 0x0 DEVLINK_DPIPE_FIELD_IPV6_DST_IP = 0x0 DEVLINK_DPIPE_HEADER_ETHERNET = 0x0 DEVLINK_DPIPE_HEADER_IPV4 = 0x1 DEVLINK_DPIPE_HEADER_IPV6 = 0x2 DEVLINK_RESOURCE_UNIT_ENTRY = 0x0 DEVLINK_PORT_FUNCTION_ATTR_UNSPEC = 0x0 DEVLINK_PORT_FUNCTION_ATTR_HW_ADDR = 0x1 DEVLINK_PORT_FN_ATTR_STATE = 0x2 DEVLINK_PORT_FN_ATTR_OPSTATE = 0x3 DEVLINK_PORT_FN_ATTR_CAPS = 0x4 DEVLINK_PORT_FUNCTION_ATTR_MAX = 0x6 ) type FsverityDigest struct { Algorithm uint16 Size uint16 } type FsverityEnableArg struct { Version uint32 Hash_algorithm uint32 Block_size uint32 Salt_size uint32 Salt_ptr uint64 Sig_size uint32 _ uint32 Sig_ptr uint64 _ [11]uint64 } type Nhmsg struct { Family uint8 Scope uint8 Protocol uint8 Resvd uint8 Flags uint32 } const SizeofNhmsg = 0x8 type NexthopGrp struct { Id uint32 Weight uint8 High uint8 Resvd2 uint16 } const SizeofNexthopGrp = 0x8 const ( NHA_UNSPEC = 0x0 NHA_ID = 0x1 NHA_GROUP = 0x2 NHA_GROUP_TYPE = 0x3 NHA_BLACKHOLE = 0x4 NHA_OIF = 0x5 NHA_GATEWAY = 0x6 NHA_ENCAP_TYPE = 0x7 NHA_ENCAP = 0x8 NHA_GROUPS = 0x9 NHA_MASTER = 0xa ) const ( CAN_RAW_FILTER = 0x1 CAN_RAW_ERR_FILTER = 0x2 CAN_RAW_LOOPBACK = 0x3 CAN_RAW_RECV_OWN_MSGS = 0x4 CAN_RAW_FD_FRAMES = 0x5 CAN_RAW_JOIN_FILTERS = 0x6 ) type WatchdogInfo struct { Options uint32 Version uint32 Identity [32]uint8 } type PPSFData struct { Info PPSKInfo Timeout PPSKTime } type PPSKParams struct { Api_version int32 Mode int32 Assert_off_tu PPSKTime Clear_off_tu PPSKTime } type PPSKTime struct { Sec int64 Nsec int32 Flags uint32 } const ( LWTUNNEL_ENCAP_NONE = 0x0 LWTUNNEL_ENCAP_MPLS = 0x1 LWTUNNEL_ENCAP_IP = 0x2 LWTUNNEL_ENCAP_ILA = 0x3 LWTUNNEL_ENCAP_IP6 = 0x4 LWTUNNEL_ENCAP_SEG6 = 0x5 LWTUNNEL_ENCAP_BPF = 0x6 LWTUNNEL_ENCAP_SEG6_LOCAL = 0x7 LWTUNNEL_ENCAP_RPL = 0x8 LWTUNNEL_ENCAP_IOAM6 = 0x9 LWTUNNEL_ENCAP_XFRM = 0xa LWTUNNEL_ENCAP_MAX = 0xa MPLS_IPTUNNEL_UNSPEC = 0x0 MPLS_IPTUNNEL_DST = 0x1 MPLS_IPTUNNEL_TTL = 0x2 MPLS_IPTUNNEL_MAX = 0x2 ) const ( ETHTOOL_ID_UNSPEC = 0x0 ETHTOOL_RX_COPYBREAK = 0x1 ETHTOOL_TX_COPYBREAK = 0x2 ETHTOOL_PFC_PREVENTION_TOUT = 0x3 ETHTOOL_TUNABLE_UNSPEC = 0x0 ETHTOOL_TUNABLE_U8 = 0x1 ETHTOOL_TUNABLE_U16 = 0x2 ETHTOOL_TUNABLE_U32 = 0x3 ETHTOOL_TUNABLE_U64 = 0x4 ETHTOOL_TUNABLE_STRING = 0x5 ETHTOOL_TUNABLE_S8 = 0x6 ETHTOOL_TUNABLE_S16 = 0x7 ETHTOOL_TUNABLE_S32 = 0x8 ETHTOOL_TUNABLE_S64 = 0x9 ETHTOOL_PHY_ID_UNSPEC = 0x0 ETHTOOL_PHY_DOWNSHIFT = 0x1 ETHTOOL_PHY_FAST_LINK_DOWN = 0x2 ETHTOOL_PHY_EDPD = 0x3 ETHTOOL_LINK_EXT_STATE_AUTONEG = 0x0 ETHTOOL_LINK_EXT_STATE_LINK_TRAINING_FAILURE = 0x1 ETHTOOL_LINK_EXT_STATE_LINK_LOGICAL_MISMATCH = 0x2 ETHTOOL_LINK_EXT_STATE_BAD_SIGNAL_INTEGRITY = 0x3 ETHTOOL_LINK_EXT_STATE_NO_CABLE = 0x4 ETHTOOL_LINK_EXT_STATE_CABLE_ISSUE = 0x5 ETHTOOL_LINK_EXT_STATE_EEPROM_ISSUE = 0x6 ETHTOOL_LINK_EXT_STATE_CALIBRATION_FAILURE = 0x7 ETHTOOL_LINK_EXT_STATE_POWER_BUDGET_EXCEEDED = 0x8 ETHTOOL_LINK_EXT_STATE_OVERHEAT = 0x9 ETHTOOL_LINK_EXT_SUBSTATE_AN_NO_PARTNER_DETECTED = 0x1 ETHTOOL_LINK_EXT_SUBSTATE_AN_ACK_NOT_RECEIVED = 0x2 ETHTOOL_LINK_EXT_SUBSTATE_AN_NEXT_PAGE_EXCHANGE_FAILED = 0x3 ETHTOOL_LINK_EXT_SUBSTATE_AN_NO_PARTNER_DETECTED_FORCE_MODE = 0x4 ETHTOOL_LINK_EXT_SUBSTATE_AN_FEC_MISMATCH_DURING_OVERRIDE = 0x5 ETHTOOL_LINK_EXT_SUBSTATE_AN_NO_HCD = 0x6 ETHTOOL_LINK_EXT_SUBSTATE_LT_KR_FRAME_LOCK_NOT_ACQUIRED = 0x1 ETHTOOL_LINK_EXT_SUBSTATE_LT_KR_LINK_INHIBIT_TIMEOUT = 0x2 ETHTOOL_LINK_EXT_SUBSTATE_LT_KR_LINK_PARTNER_DID_NOT_SET_RECEIVER_READY = 0x3 ETHTOOL_LINK_EXT_SUBSTATE_LT_REMOTE_FAULT = 0x4 ETHTOOL_LINK_EXT_SUBSTATE_LLM_PCS_DID_NOT_ACQUIRE_BLOCK_LOCK = 0x1 ETHTOOL_LINK_EXT_SUBSTATE_LLM_PCS_DID_NOT_ACQUIRE_AM_LOCK = 0x2 ETHTOOL_LINK_EXT_SUBSTATE_LLM_PCS_DID_NOT_GET_ALIGN_STATUS = 0x3 ETHTOOL_LINK_EXT_SUBSTATE_LLM_FC_FEC_IS_NOT_LOCKED = 0x4 ETHTOOL_LINK_EXT_SUBSTATE_LLM_RS_FEC_IS_NOT_LOCKED = 0x5 ETHTOOL_LINK_EXT_SUBSTATE_BSI_LARGE_NUMBER_OF_PHYSICAL_ERRORS = 0x1 ETHTOOL_LINK_EXT_SUBSTATE_BSI_UNSUPPORTED_RATE = 0x2 ETHTOOL_LINK_EXT_SUBSTATE_CI_UNSUPPORTED_CABLE = 0x1 ETHTOOL_LINK_EXT_SUBSTATE_CI_CABLE_TEST_FAILURE = 0x2 ETHTOOL_FLASH_ALL_REGIONS = 0x0 ETHTOOL_F_UNSUPPORTED__BIT = 0x0 ETHTOOL_F_WISH__BIT = 0x1 ETHTOOL_F_COMPAT__BIT = 0x2 ETHTOOL_FEC_NONE_BIT = 0x0 ETHTOOL_FEC_AUTO_BIT = 0x1 ETHTOOL_FEC_OFF_BIT = 0x2 ETHTOOL_FEC_RS_BIT = 0x3 ETHTOOL_FEC_BASER_BIT = 0x4 ETHTOOL_FEC_LLRS_BIT = 0x5 ETHTOOL_LINK_MODE_10baseT_Half_BIT = 0x0 ETHTOOL_LINK_MODE_10baseT_Full_BIT = 0x1 ETHTOOL_LINK_MODE_100baseT_Half_BIT = 0x2 ETHTOOL_LINK_MODE_100baseT_Full_BIT = 0x3 ETHTOOL_LINK_MODE_1000baseT_Half_BIT = 0x4 ETHTOOL_LINK_MODE_1000baseT_Full_BIT = 0x5 ETHTOOL_LINK_MODE_Autoneg_BIT = 0x6 ETHTOOL_LINK_MODE_TP_BIT = 0x7 ETHTOOL_LINK_MODE_AUI_BIT = 0x8 ETHTOOL_LINK_MODE_MII_BIT = 0x9 ETHTOOL_LINK_MODE_FIBRE_BIT = 0xa ETHTOOL_LINK_MODE_BNC_BIT = 0xb ETHTOOL_LINK_MODE_10000baseT_Full_BIT = 0xc ETHTOOL_LINK_MODE_Pause_BIT = 0xd ETHTOOL_LINK_MODE_Asym_Pause_BIT = 0xe ETHTOOL_LINK_MODE_2500baseX_Full_BIT = 0xf ETHTOOL_LINK_MODE_Backplane_BIT = 0x10 ETHTOOL_LINK_MODE_1000baseKX_Full_BIT = 0x11 ETHTOOL_LINK_MODE_10000baseKX4_Full_BIT = 0x12 ETHTOOL_LINK_MODE_10000baseKR_Full_BIT = 0x13 ETHTOOL_LINK_MODE_10000baseR_FEC_BIT = 0x14 ETHTOOL_LINK_MODE_20000baseMLD2_Full_BIT = 0x15 ETHTOOL_LINK_MODE_20000baseKR2_Full_BIT = 0x16 ETHTOOL_LINK_MODE_40000baseKR4_Full_BIT = 0x17 ETHTOOL_LINK_MODE_40000baseCR4_Full_BIT = 0x18 ETHTOOL_LINK_MODE_40000baseSR4_Full_BIT = 0x19 ETHTOOL_LINK_MODE_40000baseLR4_Full_BIT = 0x1a ETHTOOL_LINK_MODE_56000baseKR4_Full_BIT = 0x1b ETHTOOL_LINK_MODE_56000baseCR4_Full_BIT = 0x1c ETHTOOL_LINK_MODE_56000baseSR4_Full_BIT = 0x1d ETHTOOL_LINK_MODE_56000baseLR4_Full_BIT = 0x1e ETHTOOL_LINK_MODE_25000baseCR_Full_BIT = 0x1f ETHTOOL_LINK_MODE_25000baseKR_Full_BIT = 0x20 ETHTOOL_LINK_MODE_25000baseSR_Full_BIT = 0x21 ETHTOOL_LINK_MODE_50000baseCR2_Full_BIT = 0x22 ETHTOOL_LINK_MODE_50000baseKR2_Full_BIT = 0x23 ETHTOOL_LINK_MODE_100000baseKR4_Full_BIT = 0x24 ETHTOOL_LINK_MODE_100000baseSR4_Full_BIT = 0x25 ETHTOOL_LINK_MODE_100000baseCR4_Full_BIT = 0x26 ETHTOOL_LINK_MODE_100000baseLR4_ER4_Full_BIT = 0x27 ETHTOOL_LINK_MODE_50000baseSR2_Full_BIT = 0x28 ETHTOOL_LINK_MODE_1000baseX_Full_BIT = 0x29 ETHTOOL_LINK_MODE_10000baseCR_Full_BIT = 0x2a ETHTOOL_LINK_MODE_10000baseSR_Full_BIT = 0x2b ETHTOOL_LINK_MODE_10000baseLR_Full_BIT = 0x2c ETHTOOL_LINK_MODE_10000baseLRM_Full_BIT = 0x2d ETHTOOL_LINK_MODE_10000baseER_Full_BIT = 0x2e ETHTOOL_LINK_MODE_2500baseT_Full_BIT = 0x2f ETHTOOL_LINK_MODE_5000baseT_Full_BIT = 0x30 ETHTOOL_LINK_MODE_FEC_NONE_BIT = 0x31 ETHTOOL_LINK_MODE_FEC_RS_BIT = 0x32 ETHTOOL_LINK_MODE_FEC_BASER_BIT = 0x33 ETHTOOL_LINK_MODE_50000baseKR_Full_BIT = 0x34 ETHTOOL_LINK_MODE_50000baseSR_Full_BIT = 0x35 ETHTOOL_LINK_MODE_50000baseCR_Full_BIT = 0x36 ETHTOOL_LINK_MODE_50000baseLR_ER_FR_Full_BIT = 0x37 ETHTOOL_LINK_MODE_50000baseDR_Full_BIT = 0x38 ETHTOOL_LINK_MODE_100000baseKR2_Full_BIT = 0x39 ETHTOOL_LINK_MODE_100000baseSR2_Full_BIT = 0x3a ETHTOOL_LINK_MODE_100000baseCR2_Full_BIT = 0x3b ETHTOOL_LINK_MODE_100000baseLR2_ER2_FR2_Full_BIT = 0x3c ETHTOOL_LINK_MODE_100000baseDR2_Full_BIT = 0x3d ETHTOOL_LINK_MODE_200000baseKR4_Full_BIT = 0x3e ETHTOOL_LINK_MODE_200000baseSR4_Full_BIT = 0x3f ETHTOOL_LINK_MODE_200000baseLR4_ER4_FR4_Full_BIT = 0x40 ETHTOOL_LINK_MODE_200000baseDR4_Full_BIT = 0x41 ETHTOOL_LINK_MODE_200000baseCR4_Full_BIT = 0x42 ETHTOOL_LINK_MODE_100baseT1_Full_BIT = 0x43 ETHTOOL_LINK_MODE_1000baseT1_Full_BIT = 0x44 ETHTOOL_LINK_MODE_400000baseKR8_Full_BIT = 0x45 ETHTOOL_LINK_MODE_400000baseSR8_Full_BIT = 0x46 ETHTOOL_LINK_MODE_400000baseLR8_ER8_FR8_Full_BIT = 0x47 ETHTOOL_LINK_MODE_400000baseDR8_Full_BIT = 0x48 ETHTOOL_LINK_MODE_400000baseCR8_Full_BIT = 0x49 ETHTOOL_LINK_MODE_FEC_LLRS_BIT = 0x4a ETHTOOL_LINK_MODE_100000baseKR_Full_BIT = 0x4b ETHTOOL_LINK_MODE_100000baseSR_Full_BIT = 0x4c ETHTOOL_LINK_MODE_100000baseLR_ER_FR_Full_BIT = 0x4d ETHTOOL_LINK_MODE_100000baseCR_Full_BIT = 0x4e ETHTOOL_LINK_MODE_100000baseDR_Full_BIT = 0x4f ETHTOOL_LINK_MODE_200000baseKR2_Full_BIT = 0x50 ETHTOOL_LINK_MODE_200000baseSR2_Full_BIT = 0x51 ETHTOOL_LINK_MODE_200000baseLR2_ER2_FR2_Full_BIT = 0x52 ETHTOOL_LINK_MODE_200000baseDR2_Full_BIT = 0x53 ETHTOOL_LINK_MODE_200000baseCR2_Full_BIT = 0x54 ETHTOOL_LINK_MODE_400000baseKR4_Full_BIT = 0x55 ETHTOOL_LINK_MODE_400000baseSR4_Full_BIT = 0x56 ETHTOOL_LINK_MODE_400000baseLR4_ER4_FR4_Full_BIT = 0x57 ETHTOOL_LINK_MODE_400000baseDR4_Full_BIT = 0x58 ETHTOOL_LINK_MODE_400000baseCR4_Full_BIT = 0x59 ETHTOOL_LINK_MODE_100baseFX_Half_BIT = 0x5a ETHTOOL_LINK_MODE_100baseFX_Full_BIT = 0x5b ETHTOOL_MSG_USER_NONE = 0x0 ETHTOOL_MSG_STRSET_GET = 0x1 ETHTOOL_MSG_LINKINFO_GET = 0x2 ETHTOOL_MSG_LINKINFO_SET = 0x3 ETHTOOL_MSG_LINKMODES_GET = 0x4 ETHTOOL_MSG_LINKMODES_SET = 0x5 ETHTOOL_MSG_LINKSTATE_GET = 0x6 ETHTOOL_MSG_DEBUG_GET = 0x7 ETHTOOL_MSG_DEBUG_SET = 0x8 ETHTOOL_MSG_WOL_GET = 0x9 ETHTOOL_MSG_WOL_SET = 0xa ETHTOOL_MSG_FEATURES_GET = 0xb ETHTOOL_MSG_FEATURES_SET = 0xc ETHTOOL_MSG_PRIVFLAGS_GET = 0xd ETHTOOL_MSG_PRIVFLAGS_SET = 0xe ETHTOOL_MSG_RINGS_GET = 0xf ETHTOOL_MSG_RINGS_SET = 0x10 ETHTOOL_MSG_CHANNELS_GET = 0x11 ETHTOOL_MSG_CHANNELS_SET = 0x12 ETHTOOL_MSG_COALESCE_GET = 0x13 ETHTOOL_MSG_COALESCE_SET = 0x14 ETHTOOL_MSG_PAUSE_GET = 0x15 ETHTOOL_MSG_PAUSE_SET = 0x16 ETHTOOL_MSG_EEE_GET = 0x17 ETHTOOL_MSG_EEE_SET = 0x18 ETHTOOL_MSG_TSINFO_GET = 0x19 ETHTOOL_MSG_CABLE_TEST_ACT = 0x1a ETHTOOL_MSG_CABLE_TEST_TDR_ACT = 0x1b ETHTOOL_MSG_TUNNEL_INFO_GET = 0x1c ETHTOOL_MSG_FEC_GET = 0x1d ETHTOOL_MSG_FEC_SET = 0x1e ETHTOOL_MSG_MODULE_EEPROM_GET = 0x1f ETHTOOL_MSG_STATS_GET = 0x20 ETHTOOL_MSG_PHC_VCLOCKS_GET = 0x21 ETHTOOL_MSG_MODULE_GET = 0x22 ETHTOOL_MSG_MODULE_SET = 0x23 ETHTOOL_MSG_PSE_GET = 0x24 ETHTOOL_MSG_PSE_SET = 0x25 ETHTOOL_MSG_RSS_GET = 0x26 ETHTOOL_MSG_PLCA_GET_CFG = 0x27 ETHTOOL_MSG_PLCA_SET_CFG = 0x28 ETHTOOL_MSG_PLCA_GET_STATUS = 0x29 ETHTOOL_MSG_MM_GET = 0x2a ETHTOOL_MSG_MM_SET = 0x2b ETHTOOL_MSG_MODULE_FW_FLASH_ACT = 0x2c ETHTOOL_MSG_PHY_GET = 0x2d ETHTOOL_MSG_TSCONFIG_GET = 0x2e ETHTOOL_MSG_TSCONFIG_SET = 0x2f ETHTOOL_MSG_USER_MAX = 0x2f ETHTOOL_MSG_KERNEL_NONE = 0x0 ETHTOOL_MSG_STRSET_GET_REPLY = 0x1 ETHTOOL_MSG_LINKINFO_GET_REPLY = 0x2 ETHTOOL_MSG_LINKINFO_NTF = 0x3 ETHTOOL_MSG_LINKMODES_GET_REPLY = 0x4 ETHTOOL_MSG_LINKMODES_NTF = 0x5 ETHTOOL_MSG_LINKSTATE_GET_REPLY = 0x6 ETHTOOL_MSG_DEBUG_GET_REPLY = 0x7 ETHTOOL_MSG_DEBUG_NTF = 0x8 ETHTOOL_MSG_WOL_GET_REPLY = 0x9 ETHTOOL_MSG_WOL_NTF = 0xa ETHTOOL_MSG_FEATURES_GET_REPLY = 0xb ETHTOOL_MSG_FEATURES_SET_REPLY = 0xc ETHTOOL_MSG_FEATURES_NTF = 0xd ETHTOOL_MSG_PRIVFLAGS_GET_REPLY = 0xe ETHTOOL_MSG_PRIVFLAGS_NTF = 0xf ETHTOOL_MSG_RINGS_GET_REPLY = 0x10 ETHTOOL_MSG_RINGS_NTF = 0x11 ETHTOOL_MSG_CHANNELS_GET_REPLY = 0x12 ETHTOOL_MSG_CHANNELS_NTF = 0x13 ETHTOOL_MSG_COALESCE_GET_REPLY = 0x14 ETHTOOL_MSG_COALESCE_NTF = 0x15 ETHTOOL_MSG_PAUSE_GET_REPLY = 0x16 ETHTOOL_MSG_PAUSE_NTF = 0x17 ETHTOOL_MSG_EEE_GET_REPLY = 0x18 ETHTOOL_MSG_EEE_NTF = 0x19 ETHTOOL_MSG_TSINFO_GET_REPLY = 0x1a ETHTOOL_MSG_CABLE_TEST_NTF = 0x1b ETHTOOL_MSG_CABLE_TEST_TDR_NTF = 0x1c ETHTOOL_MSG_TUNNEL_INFO_GET_REPLY = 0x1d ETHTOOL_MSG_FEC_GET_REPLY = 0x1e ETHTOOL_MSG_FEC_NTF = 0x1f ETHTOOL_MSG_MODULE_EEPROM_GET_REPLY = 0x20 ETHTOOL_MSG_STATS_GET_REPLY = 0x21 ETHTOOL_MSG_PHC_VCLOCKS_GET_REPLY = 0x22 ETHTOOL_MSG_MODULE_GET_REPLY = 0x23 ETHTOOL_MSG_MODULE_NTF = 0x24 ETHTOOL_MSG_PSE_GET_REPLY = 0x25 ETHTOOL_MSG_RSS_GET_REPLY = 0x26 ETHTOOL_MSG_PLCA_GET_CFG_REPLY = 0x27 ETHTOOL_MSG_PLCA_GET_STATUS_REPLY = 0x28 ETHTOOL_MSG_PLCA_NTF = 0x29 ETHTOOL_MSG_MM_GET_REPLY = 0x2a ETHTOOL_MSG_MM_NTF = 0x2b ETHTOOL_MSG_MODULE_FW_FLASH_NTF = 0x2c ETHTOOL_MSG_PHY_GET_REPLY = 0x2d ETHTOOL_MSG_PHY_NTF = 0x2e ETHTOOL_MSG_TSCONFIG_GET_REPLY = 0x2f ETHTOOL_MSG_TSCONFIG_SET_REPLY = 0x30 ETHTOOL_MSG_KERNEL_MAX = 0x30 ETHTOOL_FLAG_COMPACT_BITSETS = 0x1 ETHTOOL_FLAG_OMIT_REPLY = 0x2 ETHTOOL_FLAG_STATS = 0x4 ETHTOOL_A_HEADER_UNSPEC = 0x0 ETHTOOL_A_HEADER_DEV_INDEX = 0x1 ETHTOOL_A_HEADER_DEV_NAME = 0x2 ETHTOOL_A_HEADER_FLAGS = 0x3 ETHTOOL_A_HEADER_MAX = 0x4 ETHTOOL_A_BITSET_BIT_UNSPEC = 0x0 ETHTOOL_A_BITSET_BIT_INDEX = 0x1 ETHTOOL_A_BITSET_BIT_NAME = 0x2 ETHTOOL_A_BITSET_BIT_VALUE = 0x3 ETHTOOL_A_BITSET_BIT_MAX = 0x3 ETHTOOL_A_BITSET_BITS_UNSPEC = 0x0 ETHTOOL_A_BITSET_BITS_BIT = 0x1 ETHTOOL_A_BITSET_BITS_MAX = 0x1 ETHTOOL_A_BITSET_UNSPEC = 0x0 ETHTOOL_A_BITSET_NOMASK = 0x1 ETHTOOL_A_BITSET_SIZE = 0x2 ETHTOOL_A_BITSET_BITS = 0x3 ETHTOOL_A_BITSET_VALUE = 0x4 ETHTOOL_A_BITSET_MASK = 0x5 ETHTOOL_A_BITSET_MAX = 0x5 ETHTOOL_A_STRING_UNSPEC = 0x0 ETHTOOL_A_STRING_INDEX = 0x1 ETHTOOL_A_STRING_VALUE = 0x2 ETHTOOL_A_STRING_MAX = 0x2 ETHTOOL_A_STRINGS_UNSPEC = 0x0 ETHTOOL_A_STRINGS_STRING = 0x1 ETHTOOL_A_STRINGS_MAX = 0x1 ETHTOOL_A_STRINGSET_UNSPEC = 0x0 ETHTOOL_A_STRINGSET_ID = 0x1 ETHTOOL_A_STRINGSET_COUNT = 0x2 ETHTOOL_A_STRINGSET_STRINGS = 0x3 ETHTOOL_A_STRINGSET_MAX = 0x3 ETHTOOL_A_STRINGSETS_UNSPEC = 0x0 ETHTOOL_A_STRINGSETS_STRINGSET = 0x1 ETHTOOL_A_STRINGSETS_MAX = 0x1 ETHTOOL_A_STRSET_UNSPEC = 0x0 ETHTOOL_A_STRSET_HEADER = 0x1 ETHTOOL_A_STRSET_STRINGSETS = 0x2 ETHTOOL_A_STRSET_COUNTS_ONLY = 0x3 ETHTOOL_A_STRSET_MAX = 0x3 ETHTOOL_A_LINKINFO_UNSPEC = 0x0 ETHTOOL_A_LINKINFO_HEADER = 0x1 ETHTOOL_A_LINKINFO_PORT = 0x2 ETHTOOL_A_LINKINFO_PHYADDR = 0x3 ETHTOOL_A_LINKINFO_TP_MDIX = 0x4 ETHTOOL_A_LINKINFO_TP_MDIX_CTRL = 0x5 ETHTOOL_A_LINKINFO_TRANSCEIVER = 0x6 ETHTOOL_A_LINKINFO_MAX = 0x6 ETHTOOL_A_LINKMODES_UNSPEC = 0x0 ETHTOOL_A_LINKMODES_HEADER = 0x1 ETHTOOL_A_LINKMODES_AUTONEG = 0x2 ETHTOOL_A_LINKMODES_OURS = 0x3 ETHTOOL_A_LINKMODES_PEER = 0x4 ETHTOOL_A_LINKMODES_SPEED = 0x5 ETHTOOL_A_LINKMODES_DUPLEX = 0x6 ETHTOOL_A_LINKMODES_MASTER_SLAVE_CFG = 0x7 ETHTOOL_A_LINKMODES_MASTER_SLAVE_STATE = 0x8 ETHTOOL_A_LINKMODES_LANES = 0x9 ETHTOOL_A_LINKMODES_RATE_MATCHING = 0xa ETHTOOL_A_LINKMODES_MAX = 0xa ETHTOOL_A_LINKSTATE_UNSPEC = 0x0 ETHTOOL_A_LINKSTATE_HEADER = 0x1 ETHTOOL_A_LINKSTATE_LINK = 0x2 ETHTOOL_A_LINKSTATE_SQI = 0x3 ETHTOOL_A_LINKSTATE_SQI_MAX = 0x4 ETHTOOL_A_LINKSTATE_EXT_STATE = 0x5 ETHTOOL_A_LINKSTATE_EXT_SUBSTATE = 0x6 ETHTOOL_A_LINKSTATE_EXT_DOWN_CNT = 0x7 ETHTOOL_A_LINKSTATE_MAX = 0x7 ETHTOOL_A_DEBUG_UNSPEC = 0x0 ETHTOOL_A_DEBUG_HEADER = 0x1 ETHTOOL_A_DEBUG_MSGMASK = 0x2 ETHTOOL_A_DEBUG_MAX = 0x2 ETHTOOL_A_WOL_UNSPEC = 0x0 ETHTOOL_A_WOL_HEADER = 0x1 ETHTOOL_A_WOL_MODES = 0x2 ETHTOOL_A_WOL_SOPASS = 0x3 ETHTOOL_A_WOL_MAX = 0x3 ETHTOOL_A_FEATURES_UNSPEC = 0x0 ETHTOOL_A_FEATURES_HEADER = 0x1 ETHTOOL_A_FEATURES_HW = 0x2 ETHTOOL_A_FEATURES_WANTED = 0x3 ETHTOOL_A_FEATURES_ACTIVE = 0x4 ETHTOOL_A_FEATURES_NOCHANGE = 0x5 ETHTOOL_A_FEATURES_MAX = 0x5 ETHTOOL_A_PRIVFLAGS_UNSPEC = 0x0 ETHTOOL_A_PRIVFLAGS_HEADER = 0x1 ETHTOOL_A_PRIVFLAGS_FLAGS = 0x2 ETHTOOL_A_PRIVFLAGS_MAX = 0x2 ETHTOOL_A_RINGS_UNSPEC = 0x0 ETHTOOL_A_RINGS_HEADER = 0x1 ETHTOOL_A_RINGS_RX_MAX = 0x2 ETHTOOL_A_RINGS_RX_MINI_MAX = 0x3 ETHTOOL_A_RINGS_RX_JUMBO_MAX = 0x4 ETHTOOL_A_RINGS_TX_MAX = 0x5 ETHTOOL_A_RINGS_RX = 0x6 ETHTOOL_A_RINGS_RX_MINI = 0x7 ETHTOOL_A_RINGS_RX_JUMBO = 0x8 ETHTOOL_A_RINGS_TX = 0x9 ETHTOOL_A_RINGS_RX_BUF_LEN = 0xa ETHTOOL_A_RINGS_TCP_DATA_SPLIT = 0xb ETHTOOL_A_RINGS_CQE_SIZE = 0xc ETHTOOL_A_RINGS_TX_PUSH = 0xd ETHTOOL_A_RINGS_RX_PUSH = 0xe ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN = 0xf ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN_MAX = 0x10 ETHTOOL_A_RINGS_HDS_THRESH = 0x11 ETHTOOL_A_RINGS_HDS_THRESH_MAX = 0x12 ETHTOOL_A_RINGS_MAX = 0x12 ETHTOOL_A_CHANNELS_UNSPEC = 0x0 ETHTOOL_A_CHANNELS_HEADER = 0x1 ETHTOOL_A_CHANNELS_RX_MAX = 0x2 ETHTOOL_A_CHANNELS_TX_MAX = 0x3 ETHTOOL_A_CHANNELS_OTHER_MAX = 0x4 ETHTOOL_A_CHANNELS_COMBINED_MAX = 0x5 ETHTOOL_A_CHANNELS_RX_COUNT = 0x6 ETHTOOL_A_CHANNELS_TX_COUNT = 0x7 ETHTOOL_A_CHANNELS_OTHER_COUNT = 0x8 ETHTOOL_A_CHANNELS_COMBINED_COUNT = 0x9 ETHTOOL_A_CHANNELS_MAX = 0x9 ETHTOOL_A_COALESCE_UNSPEC = 0x0 ETHTOOL_A_COALESCE_HEADER = 0x1 ETHTOOL_A_COALESCE_RX_USECS = 0x2 ETHTOOL_A_COALESCE_RX_MAX_FRAMES = 0x3 ETHTOOL_A_COALESCE_RX_USECS_IRQ = 0x4 ETHTOOL_A_COALESCE_RX_MAX_FRAMES_IRQ = 0x5 ETHTOOL_A_COALESCE_TX_USECS = 0x6 ETHTOOL_A_COALESCE_TX_MAX_FRAMES = 0x7 ETHTOOL_A_COALESCE_TX_USECS_IRQ = 0x8 ETHTOOL_A_COALESCE_TX_MAX_FRAMES_IRQ = 0x9 ETHTOOL_A_COALESCE_STATS_BLOCK_USECS = 0xa ETHTOOL_A_COALESCE_USE_ADAPTIVE_RX = 0xb ETHTOOL_A_COALESCE_USE_ADAPTIVE_TX = 0xc ETHTOOL_A_COALESCE_PKT_RATE_LOW = 0xd ETHTOOL_A_COALESCE_RX_USECS_LOW = 0xe ETHTOOL_A_COALESCE_RX_MAX_FRAMES_LOW = 0xf ETHTOOL_A_COALESCE_TX_USECS_LOW = 0x10 ETHTOOL_A_COALESCE_TX_MAX_FRAMES_LOW = 0x11 ETHTOOL_A_COALESCE_PKT_RATE_HIGH = 0x12 ETHTOOL_A_COALESCE_RX_USECS_HIGH = 0x13 ETHTOOL_A_COALESCE_RX_MAX_FRAMES_HIGH = 0x14 ETHTOOL_A_COALESCE_TX_USECS_HIGH = 0x15 ETHTOOL_A_COALESCE_TX_MAX_FRAMES_HIGH = 0x16 ETHTOOL_A_COALESCE_RATE_SAMPLE_INTERVAL = 0x17 ETHTOOL_A_COALESCE_USE_CQE_MODE_TX = 0x18 ETHTOOL_A_COALESCE_USE_CQE_MODE_RX = 0x19 ETHTOOL_A_COALESCE_MAX = 0x1e ETHTOOL_A_PAUSE_UNSPEC = 0x0 ETHTOOL_A_PAUSE_HEADER = 0x1 ETHTOOL_A_PAUSE_AUTONEG = 0x2 ETHTOOL_A_PAUSE_RX = 0x3 ETHTOOL_A_PAUSE_TX = 0x4 ETHTOOL_A_PAUSE_STATS = 0x5 ETHTOOL_A_PAUSE_MAX = 0x6 ETHTOOL_A_PAUSE_STAT_UNSPEC = 0x0 ETHTOOL_A_PAUSE_STAT_PAD = 0x1 ETHTOOL_A_PAUSE_STAT_TX_FRAMES = 0x2 ETHTOOL_A_PAUSE_STAT_RX_FRAMES = 0x3 ETHTOOL_A_PAUSE_STAT_MAX = 0x3 ETHTOOL_A_EEE_UNSPEC = 0x0 ETHTOOL_A_EEE_HEADER = 0x1 ETHTOOL_A_EEE_MODES_OURS = 0x2 ETHTOOL_A_EEE_MODES_PEER = 0x3 ETHTOOL_A_EEE_ACTIVE = 0x4 ETHTOOL_A_EEE_ENABLED = 0x5 ETHTOOL_A_EEE_TX_LPI_ENABLED = 0x6 ETHTOOL_A_EEE_TX_LPI_TIMER = 0x7 ETHTOOL_A_EEE_MAX = 0x7 ETHTOOL_A_TSINFO_UNSPEC = 0x0 ETHTOOL_A_TSINFO_HEADER = 0x1 ETHTOOL_A_TSINFO_TIMESTAMPING = 0x2 ETHTOOL_A_TSINFO_TX_TYPES = 0x3 ETHTOOL_A_TSINFO_RX_FILTERS = 0x4 ETHTOOL_A_TSINFO_PHC_INDEX = 0x5 ETHTOOL_A_TSINFO_STATS = 0x6 ETHTOOL_A_TSINFO_HWTSTAMP_PROVIDER = 0x7 ETHTOOL_A_TSINFO_MAX = 0x9 ETHTOOL_A_CABLE_TEST_UNSPEC = 0x0 ETHTOOL_A_CABLE_TEST_HEADER = 0x1 ETHTOOL_A_CABLE_TEST_MAX = 0x1 ETHTOOL_A_CABLE_RESULT_CODE_UNSPEC = 0x0 ETHTOOL_A_CABLE_RESULT_CODE_OK = 0x1 ETHTOOL_A_CABLE_RESULT_CODE_OPEN = 0x2 ETHTOOL_A_CABLE_RESULT_CODE_SAME_SHORT = 0x3 ETHTOOL_A_CABLE_RESULT_CODE_CROSS_SHORT = 0x4 ETHTOOL_A_CABLE_PAIR_A = 0x0 ETHTOOL_A_CABLE_PAIR_B = 0x1 ETHTOOL_A_CABLE_PAIR_C = 0x2 ETHTOOL_A_CABLE_PAIR_D = 0x3 ETHTOOL_A_CABLE_RESULT_UNSPEC = 0x0 ETHTOOL_A_CABLE_RESULT_PAIR = 0x1 ETHTOOL_A_CABLE_RESULT_CODE = 0x2 ETHTOOL_A_CABLE_RESULT_MAX = 0x3 ETHTOOL_A_CABLE_FAULT_LENGTH_UNSPEC = 0x0 ETHTOOL_A_CABLE_FAULT_LENGTH_PAIR = 0x1 ETHTOOL_A_CABLE_FAULT_LENGTH_CM = 0x2 ETHTOOL_A_CABLE_FAULT_LENGTH_MAX = 0x3 ETHTOOL_A_CABLE_TEST_NTF_STATUS_UNSPEC = 0x0 ETHTOOL_A_CABLE_TEST_NTF_STATUS_STARTED = 0x1 ETHTOOL_A_CABLE_TEST_NTF_STATUS_COMPLETED = 0x2 ETHTOOL_A_CABLE_NEST_UNSPEC = 0x0 ETHTOOL_A_CABLE_NEST_RESULT = 0x1 ETHTOOL_A_CABLE_NEST_FAULT_LENGTH = 0x2 ETHTOOL_A_CABLE_NEST_MAX = 0x2 ETHTOOL_A_CABLE_TEST_NTF_UNSPEC = 0x0 ETHTOOL_A_CABLE_TEST_NTF_HEADER = 0x1 ETHTOOL_A_CABLE_TEST_NTF_STATUS = 0x2 ETHTOOL_A_CABLE_TEST_NTF_NEST = 0x3 ETHTOOL_A_CABLE_TEST_NTF_MAX = 0x3 ETHTOOL_A_CABLE_TEST_TDR_CFG_UNSPEC = 0x0 ETHTOOL_A_CABLE_TEST_TDR_CFG_FIRST = 0x1 ETHTOOL_A_CABLE_TEST_TDR_CFG_LAST = 0x2 ETHTOOL_A_CABLE_TEST_TDR_CFG_STEP = 0x3 ETHTOOL_A_CABLE_TEST_TDR_CFG_PAIR = 0x4 ETHTOOL_A_CABLE_TEST_TDR_CFG_MAX = 0x4 ETHTOOL_A_CABLE_TEST_TDR_UNSPEC = 0x0 ETHTOOL_A_CABLE_TEST_TDR_HEADER = 0x1 ETHTOOL_A_CABLE_TEST_TDR_CFG = 0x2 ETHTOOL_A_CABLE_TEST_TDR_MAX = 0x2 ETHTOOL_A_CABLE_AMPLITUDE_UNSPEC = 0x0 ETHTOOL_A_CABLE_AMPLITUDE_PAIR = 0x1 ETHTOOL_A_CABLE_AMPLITUDE_mV = 0x2 ETHTOOL_A_CABLE_AMPLITUDE_MAX = 0x2 ETHTOOL_A_CABLE_PULSE_UNSPEC = 0x0 ETHTOOL_A_CABLE_PULSE_mV = 0x1 ETHTOOL_A_CABLE_PULSE_MAX = 0x1 ETHTOOL_A_CABLE_STEP_UNSPEC = 0x0 ETHTOOL_A_CABLE_STEP_FIRST_DISTANCE = 0x1 ETHTOOL_A_CABLE_STEP_LAST_DISTANCE = 0x2 ETHTOOL_A_CABLE_STEP_STEP_DISTANCE = 0x3 ETHTOOL_A_CABLE_STEP_MAX = 0x3 ETHTOOL_A_CABLE_TDR_NEST_UNSPEC = 0x0 ETHTOOL_A_CABLE_TDR_NEST_STEP = 0x1 ETHTOOL_A_CABLE_TDR_NEST_AMPLITUDE = 0x2 ETHTOOL_A_CABLE_TDR_NEST_PULSE = 0x3 ETHTOOL_A_CABLE_TDR_NEST_MAX = 0x3 ETHTOOL_A_CABLE_TEST_TDR_NTF_UNSPEC = 0x0 ETHTOOL_A_CABLE_TEST_TDR_NTF_HEADER = 0x1 ETHTOOL_A_CABLE_TEST_TDR_NTF_STATUS = 0x2 ETHTOOL_A_CABLE_TEST_TDR_NTF_NEST = 0x3 ETHTOOL_A_CABLE_TEST_TDR_NTF_MAX = 0x3 ETHTOOL_UDP_TUNNEL_TYPE_VXLAN = 0x0 ETHTOOL_UDP_TUNNEL_TYPE_GENEVE = 0x1 ETHTOOL_UDP_TUNNEL_TYPE_VXLAN_GPE = 0x2 ETHTOOL_A_TUNNEL_UDP_ENTRY_UNSPEC = 0x0 ETHTOOL_A_TUNNEL_UDP_ENTRY_PORT = 0x1 ETHTOOL_A_TUNNEL_UDP_ENTRY_TYPE = 0x2 ETHTOOL_A_TUNNEL_UDP_ENTRY_MAX = 0x2 ETHTOOL_A_TUNNEL_UDP_TABLE_UNSPEC = 0x0 ETHTOOL_A_TUNNEL_UDP_TABLE_SIZE = 0x1 ETHTOOL_A_TUNNEL_UDP_TABLE_TYPES = 0x2 ETHTOOL_A_TUNNEL_UDP_TABLE_ENTRY = 0x3 ETHTOOL_A_TUNNEL_UDP_TABLE_MAX = 0x3 ETHTOOL_A_TUNNEL_UDP_UNSPEC = 0x0 ETHTOOL_A_TUNNEL_UDP_TABLE = 0x1 ETHTOOL_A_TUNNEL_UDP_MAX = 0x1 ETHTOOL_A_TUNNEL_INFO_UNSPEC = 0x0 ETHTOOL_A_TUNNEL_INFO_HEADER = 0x1 ETHTOOL_A_TUNNEL_INFO_UDP_PORTS = 0x2 ETHTOOL_A_TUNNEL_INFO_MAX = 0x2 ) const ( TCP_V4_FLOW = 0x1 UDP_V4_FLOW = 0x2 TCP_V6_FLOW = 0x5 UDP_V6_FLOW = 0x6 ESP_V4_FLOW = 0xa ESP_V6_FLOW = 0xc IP_USER_FLOW = 0xd IPV6_USER_FLOW = 0xe IPV6_FLOW = 0x11 ETHER_FLOW = 0x12 ) const SPEED_UNKNOWN = -0x1 type EthtoolDrvinfo struct { Cmd uint32 Driver [32]byte Version [32]byte Fw_version [32]byte Bus_info [32]byte Erom_version [32]byte Reserved2 [12]byte N_priv_flags uint32 N_stats uint32 Testinfo_len uint32 Eedump_len uint32 Regdump_len uint32 } type EthtoolTsInfo struct { Cmd uint32 So_timestamping uint32 Phc_index int32 Tx_types uint32 Tx_reserved [3]uint32 Rx_filters uint32 Rx_reserved [3]uint32 } type HwTstampConfig struct { Flags int32 Tx_type int32 Rx_filter int32 } const ( HWTSTAMP_FILTER_NONE = 0x0 HWTSTAMP_FILTER_ALL = 0x1 HWTSTAMP_FILTER_SOME = 0x2 HWTSTAMP_FILTER_PTP_V1_L4_EVENT = 0x3 HWTSTAMP_FILTER_PTP_V2_L4_EVENT = 0x6 HWTSTAMP_FILTER_PTP_V2_L2_EVENT = 0x9 HWTSTAMP_FILTER_PTP_V2_EVENT = 0xc ) const ( HWTSTAMP_TX_OFF = 0x0 HWTSTAMP_TX_ON = 0x1 HWTSTAMP_TX_ONESTEP_SYNC = 0x2 ) type ( PtpClockCaps struct { Max_adj int32 N_alarm int32 N_ext_ts int32 N_per_out int32 Pps int32 N_pins int32 Cross_timestamping int32 Adjust_phase int32 Max_phase_adj int32 Rsv [11]int32 } PtpClockTime struct { Sec int64 Nsec uint32 Reserved uint32 } PtpExttsEvent struct { T PtpClockTime Index uint32 Flags uint32 Rsv [2]uint32 } PtpExttsRequest struct { Index uint32 Flags uint32 Rsv [2]uint32 } PtpPeroutRequest struct { StartOrPhase PtpClockTime Period PtpClockTime Index uint32 Flags uint32 On PtpClockTime } PtpPinDesc struct { Name [64]byte Index uint32 Func uint32 Chan uint32 Rsv [5]uint32 } PtpSysOffset struct { Samples uint32 Rsv [3]uint32 Ts [51]PtpClockTime } PtpSysOffsetExtended struct { Samples uint32 Clockid int32 Rsv [2]uint32 Ts [25][3]PtpClockTime } PtpSysOffsetPrecise struct { Device PtpClockTime Realtime PtpClockTime Monoraw PtpClockTime Rsv [4]uint32 } ) const ( PTP_PF_NONE = 0x0 PTP_PF_EXTTS = 0x1 PTP_PF_PEROUT = 0x2 PTP_PF_PHYSYNC = 0x3 ) type ( HIDRawReportDescriptor struct { Size uint32 Value [4096]uint8 } HIDRawDevInfo struct { Bustype uint32 Vendor int16 Product int16 } ) const ( CLOSE_RANGE_UNSHARE = 0x2 CLOSE_RANGE_CLOEXEC = 0x4 ) const ( NLMSGERR_ATTR_MSG = 0x1 NLMSGERR_ATTR_OFFS = 0x2 NLMSGERR_ATTR_COOKIE = 0x3 ) type ( EraseInfo struct { Start uint32 Length uint32 } EraseInfo64 struct { Start uint64 Length uint64 } MtdOobBuf struct { Start uint32 Length uint32 Ptr *uint8 } MtdOobBuf64 struct { Start uint64 Pad uint32 Length uint32 Ptr uint64 } MtdWriteReq struct { Start uint64 Len uint64 Ooblen uint64 Data uint64 Oob uint64 Mode uint8 _ [7]uint8 } MtdInfo struct { Type uint8 Flags uint32 Size uint32 Erasesize uint32 Writesize uint32 Oobsize uint32 _ uint64 } RegionInfo struct { Offset uint32 Erasesize uint32 Numblocks uint32 Regionindex uint32 } OtpInfo struct { Start uint32 Length uint32 Locked uint32 } NandOobinfo struct { Useecc uint32 Eccbytes uint32 Oobfree [8][2]uint32 Eccpos [32]uint32 } NandOobfree struct { Offset uint32 Length uint32 } NandEcclayout struct { Eccbytes uint32 Eccpos [64]uint32 Oobavail uint32 Oobfree [8]NandOobfree } MtdEccStats struct { Corrected uint32 Failed uint32 Badblocks uint32 Bbtblocks uint32 } ) const ( MTD_OPS_PLACE_OOB = 0x0 MTD_OPS_AUTO_OOB = 0x1 MTD_OPS_RAW = 0x2 ) const ( MTD_FILE_MODE_NORMAL = 0x0 MTD_FILE_MODE_OTP_FACTORY = 0x1 MTD_FILE_MODE_OTP_USER = 0x2 MTD_FILE_MODE_RAW = 0x3 ) const ( NFC_CMD_UNSPEC = 0x0 NFC_CMD_GET_DEVICE = 0x1 NFC_CMD_DEV_UP = 0x2 NFC_CMD_DEV_DOWN = 0x3 NFC_CMD_DEP_LINK_UP = 0x4 NFC_CMD_DEP_LINK_DOWN = 0x5 NFC_CMD_START_POLL = 0x6 NFC_CMD_STOP_POLL = 0x7 NFC_CMD_GET_TARGET = 0x8 NFC_EVENT_TARGETS_FOUND = 0x9 NFC_EVENT_DEVICE_ADDED = 0xa NFC_EVENT_DEVICE_REMOVED = 0xb NFC_EVENT_TARGET_LOST = 0xc NFC_EVENT_TM_ACTIVATED = 0xd NFC_EVENT_TM_DEACTIVATED = 0xe NFC_CMD_LLC_GET_PARAMS = 0xf NFC_CMD_LLC_SET_PARAMS = 0x10 NFC_CMD_ENABLE_SE = 0x11 NFC_CMD_DISABLE_SE = 0x12 NFC_CMD_LLC_SDREQ = 0x13 NFC_EVENT_LLC_SDRES = 0x14 NFC_CMD_FW_DOWNLOAD = 0x15 NFC_EVENT_SE_ADDED = 0x16 NFC_EVENT_SE_REMOVED = 0x17 NFC_EVENT_SE_CONNECTIVITY = 0x18 NFC_EVENT_SE_TRANSACTION = 0x19 NFC_CMD_GET_SE = 0x1a NFC_CMD_SE_IO = 0x1b NFC_CMD_ACTIVATE_TARGET = 0x1c NFC_CMD_VENDOR = 0x1d NFC_CMD_DEACTIVATE_TARGET = 0x1e NFC_ATTR_UNSPEC = 0x0 NFC_ATTR_DEVICE_INDEX = 0x1 NFC_ATTR_DEVICE_NAME = 0x2 NFC_ATTR_PROTOCOLS = 0x3 NFC_ATTR_TARGET_INDEX = 0x4 NFC_ATTR_TARGET_SENS_RES = 0x5 NFC_ATTR_TARGET_SEL_RES = 0x6 NFC_ATTR_TARGET_NFCID1 = 0x7 NFC_ATTR_TARGET_SENSB_RES = 0x8 NFC_ATTR_TARGET_SENSF_RES = 0x9 NFC_ATTR_COMM_MODE = 0xa NFC_ATTR_RF_MODE = 0xb NFC_ATTR_DEVICE_POWERED = 0xc NFC_ATTR_IM_PROTOCOLS = 0xd NFC_ATTR_TM_PROTOCOLS = 0xe NFC_ATTR_LLC_PARAM_LTO = 0xf NFC_ATTR_LLC_PARAM_RW = 0x10 NFC_ATTR_LLC_PARAM_MIUX = 0x11 NFC_ATTR_SE = 0x12 NFC_ATTR_LLC_SDP = 0x13 NFC_ATTR_FIRMWARE_NAME = 0x14 NFC_ATTR_SE_INDEX = 0x15 NFC_ATTR_SE_TYPE = 0x16 NFC_ATTR_SE_AID = 0x17 NFC_ATTR_FIRMWARE_DOWNLOAD_STATUS = 0x18 NFC_ATTR_SE_APDU = 0x19 NFC_ATTR_TARGET_ISO15693_DSFID = 0x1a NFC_ATTR_TARGET_ISO15693_UID = 0x1b NFC_ATTR_SE_PARAMS = 0x1c NFC_ATTR_VENDOR_ID = 0x1d NFC_ATTR_VENDOR_SUBCMD = 0x1e NFC_ATTR_VENDOR_DATA = 0x1f NFC_SDP_ATTR_UNSPEC = 0x0 NFC_SDP_ATTR_URI = 0x1 NFC_SDP_ATTR_SAP = 0x2 ) type LandlockRulesetAttr struct { Access_fs uint64 Access_net uint64 Scoped uint64 } type LandlockPathBeneathAttr struct { Allowed_access uint64 Parent_fd int32 } const ( LANDLOCK_RULE_PATH_BENEATH = 0x1 ) const ( IPC_CREAT = 0x200 IPC_EXCL = 0x400 IPC_NOWAIT = 0x800 IPC_PRIVATE = 0x0 ipc_64 = 0x100 ) const ( IPC_RMID = 0x0 IPC_SET = 0x1 IPC_STAT = 0x2 ) const ( SHM_RDONLY = 0x1000 SHM_RND = 0x2000 ) type MountAttr struct { Attr_set uint64 Attr_clr uint64 Propagation uint64 Userns_fd uint64 } const ( WG_CMD_GET_DEVICE = 0x0 WG_CMD_SET_DEVICE = 0x1 WGDEVICE_F_REPLACE_PEERS = 0x1 WGDEVICE_A_UNSPEC = 0x0 WGDEVICE_A_IFINDEX = 0x1 WGDEVICE_A_IFNAME = 0x2 WGDEVICE_A_PRIVATE_KEY = 0x3 WGDEVICE_A_PUBLIC_KEY = 0x4 WGDEVICE_A_FLAGS = 0x5 WGDEVICE_A_LISTEN_PORT = 0x6 WGDEVICE_A_FWMARK = 0x7 WGDEVICE_A_PEERS = 0x8 WGPEER_F_REMOVE_ME = 0x1 WGPEER_F_REPLACE_ALLOWEDIPS = 0x2 WGPEER_F_UPDATE_ONLY = 0x4 WGPEER_A_UNSPEC = 0x0 WGPEER_A_PUBLIC_KEY = 0x1 WGPEER_A_PRESHARED_KEY = 0x2 WGPEER_A_FLAGS = 0x3 WGPEER_A_ENDPOINT = 0x4 WGPEER_A_PERSISTENT_KEEPALIVE_INTERVAL = 0x5 WGPEER_A_LAST_HANDSHAKE_TIME = 0x6 WGPEER_A_RX_BYTES = 0x7 WGPEER_A_TX_BYTES = 0x8 WGPEER_A_ALLOWEDIPS = 0x9 WGPEER_A_PROTOCOL_VERSION = 0xa WGALLOWEDIP_A_UNSPEC = 0x0 WGALLOWEDIP_A_FAMILY = 0x1 WGALLOWEDIP_A_IPADDR = 0x2 WGALLOWEDIP_A_CIDR_MASK = 0x3 ) const ( NL_ATTR_TYPE_INVALID = 0x0 NL_ATTR_TYPE_FLAG = 0x1 NL_ATTR_TYPE_U8 = 0x2 NL_ATTR_TYPE_U16 = 0x3 NL_ATTR_TYPE_U32 = 0x4 NL_ATTR_TYPE_U64 = 0x5 NL_ATTR_TYPE_S8 = 0x6 NL_ATTR_TYPE_S16 = 0x7 NL_ATTR_TYPE_S32 = 0x8 NL_ATTR_TYPE_S64 = 0x9 NL_ATTR_TYPE_BINARY = 0xa NL_ATTR_TYPE_STRING = 0xb NL_ATTR_TYPE_NUL_STRING = 0xc NL_ATTR_TYPE_NESTED = 0xd NL_ATTR_TYPE_NESTED_ARRAY = 0xe NL_ATTR_TYPE_BITFIELD32 = 0xf NL_POLICY_TYPE_ATTR_UNSPEC = 0x0 NL_POLICY_TYPE_ATTR_TYPE = 0x1 NL_POLICY_TYPE_ATTR_MIN_VALUE_S = 0x2 NL_POLICY_TYPE_ATTR_MAX_VALUE_S = 0x3 NL_POLICY_TYPE_ATTR_MIN_VALUE_U = 0x4 NL_POLICY_TYPE_ATTR_MAX_VALUE_U = 0x5 NL_POLICY_TYPE_ATTR_MIN_LENGTH = 0x6 NL_POLICY_TYPE_ATTR_MAX_LENGTH = 0x7 NL_POLICY_TYPE_ATTR_POLICY_IDX = 0x8 NL_POLICY_TYPE_ATTR_POLICY_MAXTYPE = 0x9 NL_POLICY_TYPE_ATTR_BITFIELD32_MASK = 0xa NL_POLICY_TYPE_ATTR_PAD = 0xb NL_POLICY_TYPE_ATTR_MASK = 0xc NL_POLICY_TYPE_ATTR_MAX = 0xc ) type CANBitTiming struct { Bitrate uint32 Sample_point uint32 Tq uint32 Prop_seg uint32 Phase_seg1 uint32 Phase_seg2 uint32 Sjw uint32 Brp uint32 } type CANBitTimingConst struct { Name [16]uint8 Tseg1_min uint32 Tseg1_max uint32 Tseg2_min uint32 Tseg2_max uint32 Sjw_max uint32 Brp_min uint32 Brp_max uint32 Brp_inc uint32 } type CANClock struct { Freq uint32 } type CANBusErrorCounters struct { Txerr uint16 Rxerr uint16 } type CANCtrlMode struct { Mask uint32 Flags uint32 } type CANDeviceStats struct { Bus_error uint32 Error_warning uint32 Error_passive uint32 Bus_off uint32 Arbitration_lost uint32 Restarts uint32 } const ( CAN_STATE_ERROR_ACTIVE = 0x0 CAN_STATE_ERROR_WARNING = 0x1 CAN_STATE_ERROR_PASSIVE = 0x2 CAN_STATE_BUS_OFF = 0x3 CAN_STATE_STOPPED = 0x4 CAN_STATE_SLEEPING = 0x5 CAN_STATE_MAX = 0x6 ) const ( IFLA_CAN_UNSPEC = 0x0 IFLA_CAN_BITTIMING = 0x1 IFLA_CAN_BITTIMING_CONST = 0x2 IFLA_CAN_CLOCK = 0x3 IFLA_CAN_STATE = 0x4 IFLA_CAN_CTRLMODE = 0x5 IFLA_CAN_RESTART_MS = 0x6 IFLA_CAN_RESTART = 0x7 IFLA_CAN_BERR_COUNTER = 0x8 IFLA_CAN_DATA_BITTIMING = 0x9 IFLA_CAN_DATA_BITTIMING_CONST = 0xa IFLA_CAN_TERMINATION = 0xb IFLA_CAN_TERMINATION_CONST = 0xc IFLA_CAN_BITRATE_CONST = 0xd IFLA_CAN_DATA_BITRATE_CONST = 0xe IFLA_CAN_BITRATE_MAX = 0xf ) type KCMAttach struct { Fd int32 Bpf_fd int32 } type KCMUnattach struct { Fd int32 } type KCMClone struct { Fd int32 } const ( NL80211_AC_BE = 0x2 NL80211_AC_BK = 0x3 NL80211_ACL_POLICY_ACCEPT_UNLESS_LISTED = 0x0 NL80211_ACL_POLICY_DENY_UNLESS_LISTED = 0x1 NL80211_AC_VI = 0x1 NL80211_AC_VO = 0x0 NL80211_AP_SETTINGS_EXTERNAL_AUTH_SUPPORT = 0x1 NL80211_AP_SETTINGS_SA_QUERY_OFFLOAD_SUPPORT = 0x2 NL80211_AP_SME_SA_QUERY_OFFLOAD = 0x1 NL80211_ATTR_4ADDR = 0x53 NL80211_ATTR_ACK = 0x5c NL80211_ATTR_ACK_SIGNAL = 0x107 NL80211_ATTR_ACL_POLICY = 0xa5 NL80211_ATTR_ADMITTED_TIME = 0xd4 NL80211_ATTR_AIRTIME_WEIGHT = 0x112 NL80211_ATTR_AKM_SUITES = 0x4c NL80211_ATTR_AP_ISOLATE = 0x60 NL80211_ATTR_AP_SETTINGS_FLAGS = 0x135 NL80211_ATTR_ASSOC_SPP_AMSDU = 0x14a NL80211_ATTR_AUTH_DATA = 0x9c NL80211_ATTR_AUTH_TYPE = 0x35 NL80211_ATTR_BANDS = 0xef NL80211_ATTR_BEACON_HEAD = 0xe NL80211_ATTR_BEACON_INTERVAL = 0xc NL80211_ATTR_BEACON_TAIL = 0xf NL80211_ATTR_BG_SCAN_PERIOD = 0x98 NL80211_ATTR_BSS_BASIC_RATES = 0x24 NL80211_ATTR_BSS = 0x2f NL80211_ATTR_BSS_CTS_PROT = 0x1c NL80211_ATTR_BSS_DUMP_INCLUDE_USE_DATA = 0x147 NL80211_ATTR_BSS_HT_OPMODE = 0x6d NL80211_ATTR_BSSID = 0xf5 NL80211_ATTR_BSS_SELECT = 0xe3 NL80211_ATTR_BSS_SHORT_PREAMBLE = 0x1d NL80211_ATTR_BSS_SHORT_SLOT_TIME = 0x1e NL80211_ATTR_CENTER_FREQ1 = 0xa0 NL80211_ATTR_CENTER_FREQ1_OFFSET = 0x123 NL80211_ATTR_CENTER_FREQ2 = 0xa1 NL80211_ATTR_CHANNEL_WIDTH = 0x9f NL80211_ATTR_CH_SWITCH_BLOCK_TX = 0xb8 NL80211_ATTR_CH_SWITCH_COUNT = 0xb7 NL80211_ATTR_CIPHER_SUITE_GROUP = 0x4a NL80211_ATTR_CIPHER_SUITES = 0x39 NL80211_ATTR_CIPHER_SUITES_PAIRWISE = 0x49 NL80211_ATTR_CNTDWN_OFFS_BEACON = 0xba NL80211_ATTR_CNTDWN_OFFS_PRESP = 0xbb NL80211_ATTR_COALESCE_RULE = 0xb6 NL80211_ATTR_COALESCE_RULE_CONDITION = 0x2 NL80211_ATTR_COALESCE_RULE_DELAY = 0x1 NL80211_ATTR_COALESCE_RULE_MAX = 0x3 NL80211_ATTR_COALESCE_RULE_PKT_PATTERN = 0x3 NL80211_ATTR_COLOR_CHANGE_COLOR = 0x130 NL80211_ATTR_COLOR_CHANGE_COUNT = 0x12f NL80211_ATTR_COLOR_CHANGE_ELEMS = 0x131 NL80211_ATTR_CONN_FAILED_REASON = 0x9b NL80211_ATTR_CONTROL_PORT = 0x44 NL80211_ATTR_CONTROL_PORT_ETHERTYPE = 0x66 NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT = 0x67 NL80211_ATTR_CONTROL_PORT_NO_PREAUTH = 0x11e NL80211_ATTR_CONTROL_PORT_OVER_NL80211 = 0x108 NL80211_ATTR_COOKIE = 0x58 NL80211_ATTR_CQM_BEACON_LOSS_EVENT = 0x8 NL80211_ATTR_CQM = 0x5e NL80211_ATTR_CQM_MAX = 0x9 NL80211_ATTR_CQM_PKT_LOSS_EVENT = 0x4 NL80211_ATTR_CQM_RSSI_HYST = 0x2 NL80211_ATTR_CQM_RSSI_LEVEL = 0x9 NL80211_ATTR_CQM_RSSI_THOLD = 0x1 NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT = 0x3 NL80211_ATTR_CQM_TXE_INTVL = 0x7 NL80211_ATTR_CQM_TXE_PKTS = 0x6 NL80211_ATTR_CQM_TXE_RATE = 0x5 NL80211_ATTR_CRIT_PROT_ID = 0xb3 NL80211_ATTR_CSA_C_OFF_BEACON = 0xba NL80211_ATTR_CSA_C_OFF_PRESP = 0xbb NL80211_ATTR_CSA_C_OFFSETS_TX = 0xcd NL80211_ATTR_CSA_IES = 0xb9 NL80211_ATTR_DEVICE_AP_SME = 0x8d NL80211_ATTR_DFS_CAC_TIME = 0x7 NL80211_ATTR_DFS_REGION = 0x92 NL80211_ATTR_DISABLE_EHT = 0x137 NL80211_ATTR_DISABLE_HE = 0x12d NL80211_ATTR_DISABLE_HT = 0x93 NL80211_ATTR_DISABLE_VHT = 0xaf NL80211_ATTR_DISCONNECTED_BY_AP = 0x47 NL80211_ATTR_DONT_WAIT_FOR_ACK = 0x8e NL80211_ATTR_DTIM_PERIOD = 0xd NL80211_ATTR_DURATION = 0x57 NL80211_ATTR_EHT_CAPABILITY = 0x136 NL80211_ATTR_EMA_RNR_ELEMS = 0x145 NL80211_ATTR_EML_CAPABILITY = 0x13d NL80211_ATTR_EXT_CAPA = 0xa9 NL80211_ATTR_EXT_CAPA_MASK = 0xaa NL80211_ATTR_EXTERNAL_AUTH_ACTION = 0x104 NL80211_ATTR_EXTERNAL_AUTH_SUPPORT = 0x105 NL80211_ATTR_EXT_FEATURES = 0xd9 NL80211_ATTR_FEATURE_FLAGS = 0x8f NL80211_ATTR_FILS_CACHE_ID = 0xfd NL80211_ATTR_FILS_DISCOVERY = 0x126 NL80211_ATTR_FILS_ERP_NEXT_SEQ_NUM = 0xfb NL80211_ATTR_FILS_ERP_REALM = 0xfa NL80211_ATTR_FILS_ERP_RRK = 0xfc NL80211_ATTR_FILS_ERP_USERNAME = 0xf9 NL80211_ATTR_FILS_KEK = 0xf2 NL80211_ATTR_FILS_NONCES = 0xf3 NL80211_ATTR_FRAME = 0x33 NL80211_ATTR_FRAME_MATCH = 0x5b NL80211_ATTR_FRAME_TYPE = 0x65 NL80211_ATTR_FREQ_AFTER = 0x3b NL80211_ATTR_FREQ_BEFORE = 0x3a NL80211_ATTR_FREQ_FIXED = 0x3c NL80211_ATTR_FREQ_RANGE_END = 0x3 NL80211_ATTR_FREQ_RANGE_MAX_BW = 0x4 NL80211_ATTR_FREQ_RANGE_START = 0x2 NL80211_ATTR_FTM_RESPONDER = 0x10e NL80211_ATTR_FTM_RESPONDER_STATS = 0x10f NL80211_ATTR_GENERATION = 0x2e NL80211_ATTR_HANDLE_DFS = 0xbf NL80211_ATTR_HE_6GHZ_CAPABILITY = 0x125 NL80211_ATTR_HE_BSS_COLOR = 0x11b NL80211_ATTR_HE_CAPABILITY = 0x10d NL80211_ATTR_HE_OBSS_PD = 0x117 NL80211_ATTR_HIDDEN_SSID = 0x7e NL80211_ATTR_HT_CAPABILITY = 0x1f NL80211_ATTR_HT_CAPABILITY_MASK = 0x94 NL80211_ATTR_HW_TIMESTAMP_ENABLED = 0x144 NL80211_ATTR_IE_ASSOC_RESP = 0x80 NL80211_ATTR_IE = 0x2a NL80211_ATTR_IE_PROBE_RESP = 0x7f NL80211_ATTR_IE_RIC = 0xb2 NL80211_ATTR_IFACE_SOCKET_OWNER = 0xcc NL80211_ATTR_IFINDEX = 0x3 NL80211_ATTR_IFNAME = 0x4 NL80211_ATTR_IFTYPE_AKM_SUITES = 0x11c NL80211_ATTR_IFTYPE = 0x5 NL80211_ATTR_IFTYPE_EXT_CAPA = 0xe6 NL80211_ATTR_INACTIVITY_TIMEOUT = 0x96 NL80211_ATTR_INTERFACE_COMBINATIONS = 0x78 NL80211_ATTR_KEY_CIPHER = 0x9 NL80211_ATTR_KEY = 0x50 NL80211_ATTR_KEY_DATA = 0x7 NL80211_ATTR_KEY_DEFAULT = 0xb NL80211_ATTR_KEY_DEFAULT_MGMT = 0x28 NL80211_ATTR_KEY_DEFAULT_TYPES = 0x6e NL80211_ATTR_KEY_IDX = 0x8 NL80211_ATTR_KEYS = 0x51 NL80211_ATTR_KEY_SEQ = 0xa NL80211_ATTR_KEY_TYPE = 0x37 NL80211_ATTR_LOCAL_MESH_POWER_MODE = 0xa4 NL80211_ATTR_LOCAL_STATE_CHANGE = 0x5f NL80211_ATTR_MAC_ACL_MAX = 0xa7 NL80211_ATTR_MAC_ADDRS = 0xa6 NL80211_ATTR_MAC = 0x6 NL80211_ATTR_MAC_HINT = 0xc8 NL80211_ATTR_MAC_MASK = 0xd7 NL80211_ATTR_MAX_AP_ASSOC_STA = 0xca NL80211_ATTR_MAX = 0x151 NL80211_ATTR_MAX_CRIT_PROT_DURATION = 0xb4 NL80211_ATTR_MAX_CSA_COUNTERS = 0xce NL80211_ATTR_MAX_HW_TIMESTAMP_PEERS = 0x143 NL80211_ATTR_MAX_MATCH_SETS = 0x85 NL80211_ATTR_MAX_NUM_AKM_SUITES = 0x13c NL80211_ATTR_MAX_NUM_PMKIDS = 0x56 NL80211_ATTR_MAX_NUM_SCAN_SSIDS = 0x2b NL80211_ATTR_MAX_NUM_SCHED_SCAN_PLANS = 0xde NL80211_ATTR_MAX_NUM_SCHED_SCAN_SSIDS = 0x7b NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION = 0x6f NL80211_ATTR_MAX_SCAN_IE_LEN = 0x38 NL80211_ATTR_MAX_SCAN_PLAN_INTERVAL = 0xdf NL80211_ATTR_MAX_SCAN_PLAN_ITERATIONS = 0xe0 NL80211_ATTR_MAX_SCHED_SCAN_IE_LEN = 0x7c NL80211_ATTR_MBSSID_CONFIG = 0x132 NL80211_ATTR_MBSSID_ELEMS = 0x133 NL80211_ATTR_MCAST_RATE = 0x6b NL80211_ATTR_MDID = 0xb1 NL80211_ATTR_MEASUREMENT_DURATION = 0xeb NL80211_ATTR_MEASUREMENT_DURATION_MANDATORY = 0xec NL80211_ATTR_MESH_CONFIG = 0x23 NL80211_ATTR_MESH_ID = 0x18 NL80211_ATTR_MESH_PEER_AID = 0xed NL80211_ATTR_MESH_SETUP = 0x70 NL80211_ATTR_MGMT_SUBTYPE = 0x29 NL80211_ATTR_MLD_ADDR = 0x13a NL80211_ATTR_MLD_CAPA_AND_OPS = 0x13e NL80211_ATTR_MLO_LINK_DISABLED = 0x146 NL80211_ATTR_MLO_LINK_ID = 0x139 NL80211_ATTR_MLO_LINKS = 0x138 NL80211_ATTR_MLO_SUPPORT = 0x13b NL80211_ATTR_MLO_TTLM_DLINK = 0x148 NL80211_ATTR_MLO_TTLM_ULINK = 0x149 NL80211_ATTR_MNTR_FLAGS = 0x17 NL80211_ATTR_MPATH_INFO = 0x1b NL80211_ATTR_MPATH_NEXT_HOP = 0x1a NL80211_ATTR_MULTICAST_TO_UNICAST_ENABLED = 0xf4 NL80211_ATTR_MU_MIMO_FOLLOW_MAC_ADDR = 0xe8 NL80211_ATTR_MU_MIMO_GROUP_DATA = 0xe7 NL80211_ATTR_NAN_FUNC = 0xf0 NL80211_ATTR_NAN_MASTER_PREF = 0xee NL80211_ATTR_NAN_MATCH = 0xf1 NL80211_ATTR_NETNS_FD = 0xdb NL80211_ATTR_NOACK_MAP = 0x95 NL80211_ATTR_NSS = 0x106 NL80211_ATTR_OBSS_COLOR_BITMAP = 0x12e NL80211_ATTR_OFFCHANNEL_TX_OK = 0x6c NL80211_ATTR_OPER_CLASS = 0xd6 NL80211_ATTR_OPMODE_NOTIF = 0xc2 NL80211_ATTR_P2P_CTWINDOW = 0xa2 NL80211_ATTR_P2P_OPPPS = 0xa3 NL80211_ATTR_PAD = 0xe5 NL80211_ATTR_PBSS = 0xe2 NL80211_ATTR_PEER_AID = 0xb5 NL80211_ATTR_PEER_MEASUREMENTS = 0x111 NL80211_ATTR_PID = 0x52 NL80211_ATTR_PMK = 0xfe NL80211_ATTR_PMKID = 0x55 NL80211_ATTR_PMK_LIFETIME = 0x11f NL80211_ATTR_PMKR0_NAME = 0x102 NL80211_ATTR_PMK_REAUTH_THRESHOLD = 0x120 NL80211_ATTR_PMKSA_CANDIDATE = 0x86 NL80211_ATTR_PORT_AUTHORIZED = 0x103 NL80211_ATTR_POWER_RULE_MAX_ANT_GAIN = 0x5 NL80211_ATTR_POWER_RULE_MAX_EIRP = 0x6 NL80211_ATTR_POWER_RULE_PSD = 0x8 NL80211_ATTR_PREV_BSSID = 0x4f NL80211_ATTR_PRIVACY = 0x46 NL80211_ATTR_PROBE_RESP = 0x91 NL80211_ATTR_PROBE_RESP_OFFLOAD = 0x90 NL80211_ATTR_PROTOCOL_FEATURES = 0xad NL80211_ATTR_PS_STATE = 0x5d NL80211_ATTR_PUNCT_BITMAP = 0x142 NL80211_ATTR_QOS_MAP = 0xc7 NL80211_ATTR_RADAR_BACKGROUND = 0x134 NL80211_ATTR_RADAR_EVENT = 0xa8 NL80211_ATTR_REASON_CODE = 0x36 NL80211_ATTR_RECEIVE_MULTICAST = 0x121 NL80211_ATTR_RECONNECT_REQUESTED = 0x12b NL80211_ATTR_REG_ALPHA2 = 0x21 NL80211_ATTR_REG_INDOOR = 0xdd NL80211_ATTR_REG_INITIATOR = 0x30 NL80211_ATTR_REG_RULE_FLAGS = 0x1 NL80211_ATTR_REG_RULES = 0x22 NL80211_ATTR_REG_TYPE = 0x31 NL80211_ATTR_REKEY_DATA = 0x7a NL80211_ATTR_REQ_IE = 0x4d NL80211_ATTR_RESP_IE = 0x4e NL80211_ATTR_ROAM_SUPPORT = 0x83 NL80211_ATTR_RX_FRAME_TYPES = 0x64 NL80211_ATTR_RX_HW_TIMESTAMP = 0x140 NL80211_ATTR_RXMGMT_FLAGS = 0xbc NL80211_ATTR_RX_SIGNAL_DBM = 0x97 NL80211_ATTR_S1G_CAPABILITY = 0x128 NL80211_ATTR_S1G_CAPABILITY_MASK = 0x129 NL80211_ATTR_SAE_DATA = 0x9c NL80211_ATTR_SAE_PASSWORD = 0x115 NL80211_ATTR_SAE_PWE = 0x12a NL80211_ATTR_SAR_SPEC = 0x12c NL80211_ATTR_SCAN_FLAGS = 0x9e NL80211_ATTR_SCAN_FREQ_KHZ = 0x124 NL80211_ATTR_SCAN_FREQUENCIES = 0x2c NL80211_ATTR_SCAN_GENERATION = 0x2e NL80211_ATTR_SCAN_SSIDS = 0x2d NL80211_ATTR_SCAN_START_TIME_TSF_BSSID = 0xea NL80211_ATTR_SCAN_START_TIME_TSF = 0xe9 NL80211_ATTR_SCAN_SUPP_RATES = 0x7d NL80211_ATTR_SCHED_SCAN_DELAY = 0xdc NL80211_ATTR_SCHED_SCAN_INTERVAL = 0x77 NL80211_ATTR_SCHED_SCAN_MATCH = 0x84 NL80211_ATTR_SCHED_SCAN_MATCH_SSID = 0x1 NL80211_ATTR_SCHED_SCAN_MAX_REQS = 0x100 NL80211_ATTR_SCHED_SCAN_MULTI = 0xff NL80211_ATTR_SCHED_SCAN_PLANS = 0xe1 NL80211_ATTR_SCHED_SCAN_RELATIVE_RSSI = 0xf6 NL80211_ATTR_SCHED_SCAN_RSSI_ADJUST = 0xf7 NL80211_ATTR_SMPS_MODE = 0xd5 NL80211_ATTR_SOCKET_OWNER = 0xcc NL80211_ATTR_SOFTWARE_IFTYPES = 0x79 NL80211_ATTR_SPLIT_WIPHY_DUMP = 0xae NL80211_ATTR_SSID = 0x34 NL80211_ATTR_STA_AID = 0x10 NL80211_ATTR_STA_CAPABILITY = 0xab NL80211_ATTR_STA_EXT_CAPABILITY = 0xac NL80211_ATTR_STA_FLAGS2 = 0x43 NL80211_ATTR_STA_FLAGS = 0x11 NL80211_ATTR_STA_INFO = 0x15 NL80211_ATTR_STA_LISTEN_INTERVAL = 0x12 NL80211_ATTR_STA_PLINK_ACTION = 0x19 NL80211_ATTR_STA_PLINK_STATE = 0x74 NL80211_ATTR_STA_SUPPORTED_CHANNELS = 0xbd NL80211_ATTR_STA_SUPPORTED_OPER_CLASSES = 0xbe NL80211_ATTR_STA_SUPPORTED_RATES = 0x13 NL80211_ATTR_STA_SUPPORT_P2P_PS = 0xe4 NL80211_ATTR_STATUS_CODE = 0x48 NL80211_ATTR_STA_TX_POWER = 0x114 NL80211_ATTR_STA_TX_POWER_SETTING = 0x113 NL80211_ATTR_STA_VLAN = 0x14 NL80211_ATTR_STA_WME = 0x81 NL80211_ATTR_SUPPORT_10_MHZ = 0xc1 NL80211_ATTR_SUPPORT_5_MHZ = 0xc0 NL80211_ATTR_SUPPORT_AP_UAPSD = 0x82 NL80211_ATTR_SUPPORTED_COMMANDS = 0x32 NL80211_ATTR_SUPPORTED_IFTYPES = 0x20 NL80211_ATTR_SUPPORT_IBSS_RSN = 0x68 NL80211_ATTR_SUPPORT_MESH_AUTH = 0x73 NL80211_ATTR_SURVEY_INFO = 0x54 NL80211_ATTR_SURVEY_RADIO_STATS = 0xda NL80211_ATTR_TD_BITMAP = 0x141 NL80211_ATTR_TDLS_ACTION = 0x88 NL80211_ATTR_TDLS_DIALOG_TOKEN = 0x89 NL80211_ATTR_TDLS_EXTERNAL_SETUP = 0x8c NL80211_ATTR_TDLS_INITIATOR = 0xcf NL80211_ATTR_TDLS_OPERATION = 0x8a NL80211_ATTR_TDLS_PEER_CAPABILITY = 0xcb NL80211_ATTR_TDLS_SUPPORT = 0x8b NL80211_ATTR_TESTDATA = 0x45 NL80211_ATTR_TID_CONFIG = 0x11d NL80211_ATTR_TIMED_OUT = 0x41 NL80211_ATTR_TIMEOUT = 0x110 NL80211_ATTR_TIMEOUT_REASON = 0xf8 NL80211_ATTR_TSID = 0xd2 NL80211_ATTR_TWT_RESPONDER = 0x116 NL80211_ATTR_TX_FRAME_TYPES = 0x63 NL80211_ATTR_TX_HW_TIMESTAMP = 0x13f NL80211_ATTR_TX_NO_CCK_RATE = 0x87 NL80211_ATTR_TXQ_LIMIT = 0x10a NL80211_ATTR_TXQ_MEMORY_LIMIT = 0x10b NL80211_ATTR_TXQ_QUANTUM = 0x10c NL80211_ATTR_TXQ_STATS = 0x109 NL80211_ATTR_TX_RATES = 0x5a NL80211_ATTR_UNSOL_BCAST_PROBE_RESP = 0x127 NL80211_ATTR_UNSPEC = 0x0 NL80211_ATTR_USE_MFP = 0x42 NL80211_ATTR_USER_PRIO = 0xd3 NL80211_ATTR_USER_REG_HINT_TYPE = 0x9a NL80211_ATTR_USE_RRM = 0xd0 NL80211_ATTR_VENDOR_DATA = 0xc5 NL80211_ATTR_VENDOR_EVENTS = 0xc6 NL80211_ATTR_VENDOR_ID = 0xc3 NL80211_ATTR_VENDOR_SUBCMD = 0xc4 NL80211_ATTR_VHT_CAPABILITY = 0x9d NL80211_ATTR_VHT_CAPABILITY_MASK = 0xb0 NL80211_ATTR_VLAN_ID = 0x11a NL80211_ATTR_WANT_1X_4WAY_HS = 0x101 NL80211_ATTR_WDEV = 0x99 NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX = 0x72 NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX = 0x71 NL80211_ATTR_WIPHY_ANTENNA_RX = 0x6a NL80211_ATTR_WIPHY_ANTENNA_TX = 0x69 NL80211_ATTR_WIPHY_BANDS = 0x16 NL80211_ATTR_WIPHY_CHANNEL_TYPE = 0x27 NL80211_ATTR_WIPHY = 0x1 NL80211_ATTR_WIPHY_COVERAGE_CLASS = 0x59 NL80211_ATTR_WIPHY_DYN_ACK = 0xd1 NL80211_ATTR_WIPHY_EDMG_BW_CONFIG = 0x119 NL80211_ATTR_WIPHY_EDMG_CHANNELS = 0x118 NL80211_ATTR_WIPHY_FRAG_THRESHOLD = 0x3f NL80211_ATTR_WIPHY_FREQ = 0x26 NL80211_ATTR_WIPHY_FREQ_HINT = 0xc9 NL80211_ATTR_WIPHY_FREQ_OFFSET = 0x122 NL80211_ATTR_WIPHY_INTERFACE_COMBINATIONS = 0x14c NL80211_ATTR_WIPHY_NAME = 0x2 NL80211_ATTR_WIPHY_RADIOS = 0x14b NL80211_ATTR_WIPHY_RETRY_LONG = 0x3e NL80211_ATTR_WIPHY_RETRY_SHORT = 0x3d NL80211_ATTR_WIPHY_RTS_THRESHOLD = 0x40 NL80211_ATTR_WIPHY_SELF_MANAGED_REG = 0xd8 NL80211_ATTR_WIPHY_TX_POWER_LEVEL = 0x62 NL80211_ATTR_WIPHY_TX_POWER_SETTING = 0x61 NL80211_ATTR_WIPHY_TXQ_PARAMS = 0x25 NL80211_ATTR_WOWLAN_TRIGGERS = 0x75 NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED = 0x76 NL80211_ATTR_WPA_VERSIONS = 0x4b NL80211_AUTHTYPE_AUTOMATIC = 0x8 NL80211_AUTHTYPE_FILS_PK = 0x7 NL80211_AUTHTYPE_FILS_SK = 0x5 NL80211_AUTHTYPE_FILS_SK_PFS = 0x6 NL80211_AUTHTYPE_FT = 0x2 NL80211_AUTHTYPE_MAX = 0x7 NL80211_AUTHTYPE_NETWORK_EAP = 0x3 NL80211_AUTHTYPE_OPEN_SYSTEM = 0x0 NL80211_AUTHTYPE_SAE = 0x4 NL80211_AUTHTYPE_SHARED_KEY = 0x1 NL80211_BAND_2GHZ = 0x0 NL80211_BAND_5GHZ = 0x1 NL80211_BAND_60GHZ = 0x2 NL80211_BAND_6GHZ = 0x3 NL80211_BAND_ATTR_EDMG_BW_CONFIG = 0xb NL80211_BAND_ATTR_EDMG_CHANNELS = 0xa NL80211_BAND_ATTR_FREQS = 0x1 NL80211_BAND_ATTR_HT_AMPDU_DENSITY = 0x6 NL80211_BAND_ATTR_HT_AMPDU_FACTOR = 0x5 NL80211_BAND_ATTR_HT_CAPA = 0x4 NL80211_BAND_ATTR_HT_MCS_SET = 0x3 NL80211_BAND_ATTR_IFTYPE_DATA = 0x9 NL80211_BAND_ATTR_MAX = 0xd NL80211_BAND_ATTR_RATES = 0x2 NL80211_BAND_ATTR_S1G_CAPA = 0xd NL80211_BAND_ATTR_S1G_MCS_NSS_SET = 0xc NL80211_BAND_ATTR_VHT_CAPA = 0x8 NL80211_BAND_ATTR_VHT_MCS_SET = 0x7 NL80211_BAND_IFTYPE_ATTR_EHT_CAP_MAC = 0x8 NL80211_BAND_IFTYPE_ATTR_EHT_CAP_MCS_SET = 0xa NL80211_BAND_IFTYPE_ATTR_EHT_CAP_PHY = 0x9 NL80211_BAND_IFTYPE_ATTR_EHT_CAP_PPE = 0xb NL80211_BAND_IFTYPE_ATTR_HE_6GHZ_CAPA = 0x6 NL80211_BAND_IFTYPE_ATTR_HE_CAP_MAC = 0x2 NL80211_BAND_IFTYPE_ATTR_HE_CAP_MCS_SET = 0x4 NL80211_BAND_IFTYPE_ATTR_HE_CAP_PHY = 0x3 NL80211_BAND_IFTYPE_ATTR_HE_CAP_PPE = 0x5 NL80211_BAND_IFTYPE_ATTR_IFTYPES = 0x1 NL80211_BAND_IFTYPE_ATTR_MAX = 0xb NL80211_BAND_IFTYPE_ATTR_VENDOR_ELEMS = 0x7 NL80211_BAND_LC = 0x5 NL80211_BAND_S1GHZ = 0x4 NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE = 0x2 NL80211_BITRATE_ATTR_MAX = 0x2 NL80211_BITRATE_ATTR_RATE = 0x1 NL80211_BSS_BEACON_IES = 0xb NL80211_BSS_BEACON_INTERVAL = 0x4 NL80211_BSS_BEACON_TSF = 0xd NL80211_BSS_BSSID = 0x1 NL80211_BSS_CANNOT_USE_6GHZ_PWR_MISMATCH = 0x2 NL80211_BSS_CANNOT_USE_NSTR_NONPRIMARY = 0x1 NL80211_BSS_CANNOT_USE_REASONS = 0x18 NL80211_BSS_CANNOT_USE_UHB_PWR_MISMATCH = 0x2 NL80211_BSS_CAPABILITY = 0x5 NL80211_BSS_CHAIN_SIGNAL = 0x13 NL80211_BSS_CHAN_WIDTH_10 = 0x1 NL80211_BSS_CHAN_WIDTH_1 = 0x3 NL80211_BSS_CHAN_WIDTH_20 = 0x0 NL80211_BSS_CHAN_WIDTH_2 = 0x4 NL80211_BSS_CHAN_WIDTH_5 = 0x2 NL80211_BSS_CHAN_WIDTH = 0xc NL80211_BSS_FREQUENCY = 0x2 NL80211_BSS_FREQUENCY_OFFSET = 0x14 NL80211_BSS_INFORMATION_ELEMENTS = 0x6 NL80211_BSS_LAST_SEEN_BOOTTIME = 0xf NL80211_BSS_MAX = 0x18 NL80211_BSS_MLD_ADDR = 0x16 NL80211_BSS_MLO_LINK_ID = 0x15 NL80211_BSS_PAD = 0x10 NL80211_BSS_PARENT_BSSID = 0x12 NL80211_BSS_PARENT_TSF = 0x11 NL80211_BSS_PRESP_DATA = 0xe NL80211_BSS_SEEN_MS_AGO = 0xa NL80211_BSS_SELECT_ATTR_BAND_PREF = 0x2 NL80211_BSS_SELECT_ATTR_MAX = 0x3 NL80211_BSS_SELECT_ATTR_RSSI_ADJUST = 0x3 NL80211_BSS_SELECT_ATTR_RSSI = 0x1 NL80211_BSS_SIGNAL_MBM = 0x7 NL80211_BSS_SIGNAL_UNSPEC = 0x8 NL80211_BSS_STATUS_ASSOCIATED = 0x1 NL80211_BSS_STATUS_AUTHENTICATED = 0x0 NL80211_BSS_STATUS = 0x9 NL80211_BSS_STATUS_IBSS_JOINED = 0x2 NL80211_BSS_TSF = 0x3 NL80211_BSS_USE_FOR = 0x17 NL80211_BSS_USE_FOR_MLD_LINK = 0x2 NL80211_BSS_USE_FOR_NORMAL = 0x1 NL80211_CHAN_HT20 = 0x1 NL80211_CHAN_HT40MINUS = 0x2 NL80211_CHAN_HT40PLUS = 0x3 NL80211_CHAN_NO_HT = 0x0 NL80211_CHAN_WIDTH_10 = 0x7 NL80211_CHAN_WIDTH_160 = 0x5 NL80211_CHAN_WIDTH_16 = 0xc NL80211_CHAN_WIDTH_1 = 0x8 NL80211_CHAN_WIDTH_20 = 0x1 NL80211_CHAN_WIDTH_20_NOHT = 0x0 NL80211_CHAN_WIDTH_2 = 0x9 NL80211_CHAN_WIDTH_320 = 0xd NL80211_CHAN_WIDTH_40 = 0x2 NL80211_CHAN_WIDTH_4 = 0xa NL80211_CHAN_WIDTH_5 = 0x6 NL80211_CHAN_WIDTH_80 = 0x3 NL80211_CHAN_WIDTH_80P80 = 0x4 NL80211_CHAN_WIDTH_8 = 0xb NL80211_CMD_ABORT_SCAN = 0x72 NL80211_CMD_ACTION = 0x3b NL80211_CMD_ACTION_TX_STATUS = 0x3c NL80211_CMD_ADD_LINK = 0x94 NL80211_CMD_ADD_LINK_STA = 0x96 NL80211_CMD_ADD_NAN_FUNCTION = 0x75 NL80211_CMD_ADD_TX_TS = 0x69 NL80211_CMD_ASSOC_COMEBACK = 0x93 NL80211_CMD_ASSOCIATE = 0x26 NL80211_CMD_AUTHENTICATE = 0x25 NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL = 0x38 NL80211_CMD_CHANGE_NAN_CONFIG = 0x77 NL80211_CMD_CHANNEL_SWITCH = 0x66 NL80211_CMD_CH_SWITCH_NOTIFY = 0x58 NL80211_CMD_CH_SWITCH_STARTED_NOTIFY = 0x6e NL80211_CMD_COLOR_CHANGE_ABORTED = 0x90 NL80211_CMD_COLOR_CHANGE_COMPLETED = 0x91 NL80211_CMD_COLOR_CHANGE_REQUEST = 0x8e NL80211_CMD_COLOR_CHANGE_STARTED = 0x8f NL80211_CMD_CONNECT = 0x2e NL80211_CMD_CONN_FAILED = 0x5b NL80211_CMD_CONTROL_PORT_FRAME = 0x81 NL80211_CMD_CONTROL_PORT_FRAME_TX_STATUS = 0x8b NL80211_CMD_CRIT_PROTOCOL_START = 0x62 NL80211_CMD_CRIT_PROTOCOL_STOP = 0x63 NL80211_CMD_DEAUTHENTICATE = 0x27 NL80211_CMD_DEL_BEACON = 0x10 NL80211_CMD_DEL_INTERFACE = 0x8 NL80211_CMD_DEL_KEY = 0xc NL80211_CMD_DEL_MPATH = 0x18 NL80211_CMD_DEL_NAN_FUNCTION = 0x76 NL80211_CMD_DEL_PMK = 0x7c NL80211_CMD_DEL_PMKSA = 0x35 NL80211_CMD_DEL_STATION = 0x14 NL80211_CMD_DEL_TX_TS = 0x6a NL80211_CMD_DEL_WIPHY = 0x4 NL80211_CMD_DISASSOCIATE = 0x28 NL80211_CMD_DISCONNECT = 0x30 NL80211_CMD_EXTERNAL_AUTH = 0x7f NL80211_CMD_FLUSH_PMKSA = 0x36 NL80211_CMD_FRAME = 0x3b NL80211_CMD_FRAME_TX_STATUS = 0x3c NL80211_CMD_FRAME_WAIT_CANCEL = 0x43 NL80211_CMD_FT_EVENT = 0x61 NL80211_CMD_GET_BEACON = 0xd NL80211_CMD_GET_COALESCE = 0x64 NL80211_CMD_GET_FTM_RESPONDER_STATS = 0x82 NL80211_CMD_GET_INTERFACE = 0x5 NL80211_CMD_GET_KEY = 0x9 NL80211_CMD_GET_MESH_CONFIG = 0x1c NL80211_CMD_GET_MESH_PARAMS = 0x1c NL80211_CMD_GET_MPATH = 0x15 NL80211_CMD_GET_MPP = 0x6b NL80211_CMD_GET_POWER_SAVE = 0x3e NL80211_CMD_GET_PROTOCOL_FEATURES = 0x5f NL80211_CMD_GET_REG = 0x1f NL80211_CMD_GET_SCAN = 0x20 NL80211_CMD_GET_STATION = 0x11 NL80211_CMD_GET_SURVEY = 0x32 NL80211_CMD_GET_WIPHY = 0x1 NL80211_CMD_GET_WOWLAN = 0x49 NL80211_CMD_JOIN_IBSS = 0x2b NL80211_CMD_JOIN_MESH = 0x44 NL80211_CMD_JOIN_OCB = 0x6c NL80211_CMD_LEAVE_IBSS = 0x2c NL80211_CMD_LEAVE_MESH = 0x45 NL80211_CMD_LEAVE_OCB = 0x6d NL80211_CMD_LINKS_REMOVED = 0x9a NL80211_CMD_MAX = 0x9d NL80211_CMD_MICHAEL_MIC_FAILURE = 0x29 NL80211_CMD_MODIFY_LINK_STA = 0x97 NL80211_CMD_NAN_MATCH = 0x78 NL80211_CMD_NEW_BEACON = 0xf NL80211_CMD_NEW_INTERFACE = 0x7 NL80211_CMD_NEW_KEY = 0xb NL80211_CMD_NEW_MPATH = 0x17 NL80211_CMD_NEW_PEER_CANDIDATE = 0x48 NL80211_CMD_NEW_SCAN_RESULTS = 0x22 NL80211_CMD_NEW_STATION = 0x13 NL80211_CMD_NEW_SURVEY_RESULTS = 0x33 NL80211_CMD_NEW_WIPHY = 0x3 NL80211_CMD_NOTIFY_CQM = 0x40 NL80211_CMD_NOTIFY_RADAR = 0x86 NL80211_CMD_OBSS_COLOR_COLLISION = 0x8d NL80211_CMD_PEER_MEASUREMENT_COMPLETE = 0x85 NL80211_CMD_PEER_MEASUREMENT_RESULT = 0x84 NL80211_CMD_PEER_MEASUREMENT_START = 0x83 NL80211_CMD_PMKSA_CANDIDATE = 0x50 NL80211_CMD_PORT_AUTHORIZED = 0x7d NL80211_CMD_PROBE_CLIENT = 0x54 NL80211_CMD_PROBE_MESH_LINK = 0x88 NL80211_CMD_RADAR_DETECT = 0x5e NL80211_CMD_REG_BEACON_HINT = 0x2a NL80211_CMD_REG_CHANGE = 0x24 NL80211_CMD_REGISTER_ACTION = 0x3a NL80211_CMD_REGISTER_BEACONS = 0x55 NL80211_CMD_REGISTER_FRAME = 0x3a NL80211_CMD_RELOAD_REGDB = 0x7e NL80211_CMD_REMAIN_ON_CHANNEL = 0x37 NL80211_CMD_REMOVE_LINK = 0x95 NL80211_CMD_REMOVE_LINK_STA = 0x98 NL80211_CMD_REQ_SET_REG = 0x1b NL80211_CMD_ROAM = 0x2f NL80211_CMD_SCAN_ABORTED = 0x23 NL80211_CMD_SCHED_SCAN_RESULTS = 0x4d NL80211_CMD_SCHED_SCAN_STOPPED = 0x4e NL80211_CMD_SET_BEACON = 0xe NL80211_CMD_SET_BSS = 0x19 NL80211_CMD_SET_CHANNEL = 0x41 NL80211_CMD_SET_COALESCE = 0x65 NL80211_CMD_SET_CQM = 0x3f NL80211_CMD_SET_FILS_AAD = 0x92 NL80211_CMD_SET_HW_TIMESTAMP = 0x99 NL80211_CMD_SET_INTERFACE = 0x6 NL80211_CMD_SET_KEY = 0xa NL80211_CMD_SET_MAC_ACL = 0x5d NL80211_CMD_SET_MCAST_RATE = 0x5c NL80211_CMD_SET_MESH_CONFIG = 0x1d NL80211_CMD_SET_MESH_PARAMS = 0x1d NL80211_CMD_SET_MGMT_EXTRA_IE = 0x1e NL80211_CMD_SET_MPATH = 0x16 NL80211_CMD_SET_MULTICAST_TO_UNICAST = 0x79 NL80211_CMD_SET_NOACK_MAP = 0x57 NL80211_CMD_SET_PMK = 0x7b NL80211_CMD_SET_PMKSA = 0x34 NL80211_CMD_SET_POWER_SAVE = 0x3d NL80211_CMD_SET_QOS_MAP = 0x68 NL80211_CMD_SET_REG = 0x1a NL80211_CMD_SET_REKEY_OFFLOAD = 0x4f NL80211_CMD_SET_SAR_SPECS = 0x8c NL80211_CMD_SET_STATION = 0x12 NL80211_CMD_SET_TID_CONFIG = 0x89 NL80211_CMD_SET_TID_TO_LINK_MAPPING = 0x9b NL80211_CMD_SET_TX_BITRATE_MASK = 0x39 NL80211_CMD_SET_WDS_PEER = 0x42 NL80211_CMD_SET_WIPHY = 0x2 NL80211_CMD_SET_WIPHY_NETNS = 0x31 NL80211_CMD_SET_WOWLAN = 0x4a NL80211_CMD_STA_OPMODE_CHANGED = 0x80 NL80211_CMD_START_AP = 0xf NL80211_CMD_START_NAN = 0x73 NL80211_CMD_START_P2P_DEVICE = 0x59 NL80211_CMD_START_SCHED_SCAN = 0x4b NL80211_CMD_STOP_AP = 0x10 NL80211_CMD_STOP_NAN = 0x74 NL80211_CMD_STOP_P2P_DEVICE = 0x5a NL80211_CMD_STOP_SCHED_SCAN = 0x4c NL80211_CMD_TDLS_CANCEL_CHANNEL_SWITCH = 0x70 NL80211_CMD_TDLS_CHANNEL_SWITCH = 0x6f NL80211_CMD_TDLS_MGMT = 0x52 NL80211_CMD_TDLS_OPER = 0x51 NL80211_CMD_TESTMODE = 0x2d NL80211_CMD_TRIGGER_SCAN = 0x21 NL80211_CMD_UNEXPECTED_4ADDR_FRAME = 0x56 NL80211_CMD_UNEXPECTED_FRAME = 0x53 NL80211_CMD_UNPROT_BEACON = 0x8a NL80211_CMD_UNPROT_DEAUTHENTICATE = 0x46 NL80211_CMD_UNPROT_DISASSOCIATE = 0x47 NL80211_CMD_UNSPEC = 0x0 NL80211_CMD_UPDATE_CONNECT_PARAMS = 0x7a NL80211_CMD_UPDATE_FT_IES = 0x60 NL80211_CMD_UPDATE_OWE_INFO = 0x87 NL80211_CMD_VENDOR = 0x67 NL80211_CMD_WIPHY_REG_CHANGE = 0x71 NL80211_COALESCE_CONDITION_MATCH = 0x0 NL80211_COALESCE_CONDITION_NO_MATCH = 0x1 NL80211_CONN_FAIL_BLOCKED_CLIENT = 0x1 NL80211_CONN_FAIL_MAX_CLIENTS = 0x0 NL80211_CQM_RSSI_BEACON_LOSS_EVENT = 0x2 NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH = 0x1 NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW = 0x0 NL80211_CQM_TXE_MAX_INTVL = 0x708 NL80211_CRIT_PROTO_APIPA = 0x3 NL80211_CRIT_PROTO_DHCP = 0x1 NL80211_CRIT_PROTO_EAPOL = 0x2 NL80211_CRIT_PROTO_MAX_DURATION = 0x1388 NL80211_CRIT_PROTO_UNSPEC = 0x0 NL80211_DFS_AVAILABLE = 0x2 NL80211_DFS_ETSI = 0x2 NL80211_DFS_FCC = 0x1 NL80211_DFS_JP = 0x3 NL80211_DFS_UNAVAILABLE = 0x1 NL80211_DFS_UNSET = 0x0 NL80211_DFS_USABLE = 0x0 NL80211_EDMG_BW_CONFIG_MAX = 0xf NL80211_EDMG_BW_CONFIG_MIN = 0x4 NL80211_EDMG_CHANNELS_MAX = 0x3c NL80211_EDMG_CHANNELS_MIN = 0x1 NL80211_EHT_MAX_CAPABILITY_LEN = 0x33 NL80211_EHT_MIN_CAPABILITY_LEN = 0xd NL80211_EXTERNAL_AUTH_ABORT = 0x1 NL80211_EXTERNAL_AUTH_START = 0x0 NL80211_EXT_FEATURE_4WAY_HANDSHAKE_AP_PSK = 0x32 NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_1X = 0x10 NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_PSK = 0xf NL80211_EXT_FEATURE_ACCEPT_BCAST_PROBE_RESP = 0x12 NL80211_EXT_FEATURE_ACK_SIGNAL_SUPPORT = 0x1b NL80211_EXT_FEATURE_AIRTIME_FAIRNESS = 0x21 NL80211_EXT_FEATURE_AP_PMKSA_CACHING = 0x22 NL80211_EXT_FEATURE_AQL = 0x28 NL80211_EXT_FEATURE_AUTH_AND_DEAUTH_RANDOM_TA = 0x40 NL80211_EXT_FEATURE_BEACON_PROTECTION_CLIENT = 0x2e NL80211_EXT_FEATURE_BEACON_PROTECTION = 0x29 NL80211_EXT_FEATURE_BEACON_RATE_HE = 0x36 NL80211_EXT_FEATURE_BEACON_RATE_HT = 0x7 NL80211_EXT_FEATURE_BEACON_RATE_LEGACY = 0x6 NL80211_EXT_FEATURE_BEACON_RATE_VHT = 0x8 NL80211_EXT_FEATURE_BSS_COLOR = 0x3a NL80211_EXT_FEATURE_BSS_PARENT_TSF = 0x4 NL80211_EXT_FEATURE_CAN_REPLACE_PTK0 = 0x1f NL80211_EXT_FEATURE_CONTROL_PORT_NO_PREAUTH = 0x2a NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211 = 0x1a NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211_TX_STATUS = 0x30 NL80211_EXT_FEATURE_CQM_RSSI_LIST = 0xd NL80211_EXT_FEATURE_DATA_ACK_SIGNAL_SUPPORT = 0x1b NL80211_EXT_FEATURE_DEL_IBSS_STA = 0x2c NL80211_EXT_FEATURE_DFS_CONCURRENT = 0x43 NL80211_EXT_FEATURE_DFS_OFFLOAD = 0x19 NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER = 0x20 NL80211_EXT_FEATURE_EXT_KEY_ID = 0x24 NL80211_EXT_FEATURE_FILS_CRYPTO_OFFLOAD = 0x3b NL80211_EXT_FEATURE_FILS_DISCOVERY = 0x34 NL80211_EXT_FEATURE_FILS_MAX_CHANNEL_TIME = 0x11 NL80211_EXT_FEATURE_FILS_SK_OFFLOAD = 0xe NL80211_EXT_FEATURE_FILS_STA = 0x9 NL80211_EXT_FEATURE_HIGH_ACCURACY_SCAN = 0x18 NL80211_EXT_FEATURE_LOW_POWER_SCAN = 0x17 NL80211_EXT_FEATURE_LOW_SPAN_SCAN = 0x16 NL80211_EXT_FEATURE_MFP_OPTIONAL = 0x15 NL80211_EXT_FEATURE_MGMT_TX_RANDOM_TA = 0xa NL80211_EXT_FEATURE_MGMT_TX_RANDOM_TA_CONNECTED = 0xb NL80211_EXT_FEATURE_MULTICAST_REGISTRATIONS = 0x2d NL80211_EXT_FEATURE_MU_MIMO_AIR_SNIFFER = 0x2 NL80211_EXT_FEATURE_OCE_PROBE_REQ_DEFERRAL_SUPPRESSION = 0x14 NL80211_EXT_FEATURE_OCE_PROBE_REQ_HIGH_TX_RATE = 0x13 NL80211_EXT_FEATURE_OPERATING_CHANNEL_VALIDATION = 0x31 NL80211_EXT_FEATURE_OWE_OFFLOAD_AP = 0x42 NL80211_EXT_FEATURE_OWE_OFFLOAD = 0x41 NL80211_EXT_FEATURE_POWERED_ADDR_CHANGE = 0x3d NL80211_EXT_FEATURE_PROTECTED_TWT = 0x2b NL80211_EXT_FEATURE_PROT_RANGE_NEGO_AND_MEASURE = 0x39 NL80211_EXT_FEATURE_PUNCT = 0x3e NL80211_EXT_FEATURE_RADAR_BACKGROUND = 0x3c NL80211_EXT_FEATURE_RRM = 0x1 NL80211_EXT_FEATURE_SAE_OFFLOAD_AP = 0x33 NL80211_EXT_FEATURE_SAE_OFFLOAD = 0x26 NL80211_EXT_FEATURE_SCAN_FREQ_KHZ = 0x2f NL80211_EXT_FEATURE_SCAN_MIN_PREQ_CONTENT = 0x1e NL80211_EXT_FEATURE_SCAN_RANDOM_SN = 0x1d NL80211_EXT_FEATURE_SCAN_START_TIME = 0x3 NL80211_EXT_FEATURE_SCHED_SCAN_BAND_SPECIFIC_RSSI_THOLD = 0x23 NL80211_EXT_FEATURE_SCHED_SCAN_RELATIVE_RSSI = 0xc NL80211_EXT_FEATURE_SECURE_LTF = 0x37 NL80211_EXT_FEATURE_SECURE_NAN = 0x3f NL80211_EXT_FEATURE_SECURE_RTT = 0x38 NL80211_EXT_FEATURE_SET_SCAN_DWELL = 0x5 NL80211_EXT_FEATURE_SPP_AMSDU_SUPPORT = 0x44 NL80211_EXT_FEATURE_STA_TX_PWR = 0x25 NL80211_EXT_FEATURE_TXQS = 0x1c NL80211_EXT_FEATURE_UNSOL_BCAST_PROBE_RESP = 0x35 NL80211_EXT_FEATURE_VHT_IBSS = 0x0 NL80211_EXT_FEATURE_VLAN_OFFLOAD = 0x27 NL80211_FEATURE_ACKTO_ESTIMATION = 0x800000 NL80211_FEATURE_ACTIVE_MONITOR = 0x20000 NL80211_FEATURE_ADVERTISE_CHAN_LIMITS = 0x4000 NL80211_FEATURE_AP_MODE_CHAN_WIDTH_CHANGE = 0x40000 NL80211_FEATURE_AP_SCAN = 0x100 NL80211_FEATURE_CELL_BASE_REG_HINTS = 0x8 NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES = 0x80000 NL80211_FEATURE_DYNAMIC_SMPS = 0x2000000 NL80211_FEATURE_FULL_AP_CLIENT_STATE = 0x8000 NL80211_FEATURE_HT_IBSS = 0x2 NL80211_FEATURE_INACTIVITY_TIMER = 0x4 NL80211_FEATURE_LOW_PRIORITY_SCAN = 0x40 NL80211_FEATURE_MAC_ON_CREATE = 0x8000000 NL80211_FEATURE_ND_RANDOM_MAC_ADDR = 0x80000000 NL80211_FEATURE_NEED_OBSS_SCAN = 0x400 NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL = 0x10 NL80211_FEATURE_P2P_GO_CTWIN = 0x800 NL80211_FEATURE_P2P_GO_OPPPS = 0x1000 NL80211_FEATURE_QUIET = 0x200000 NL80211_FEATURE_SAE = 0x20 NL80211_FEATURE_SCAN_FLUSH = 0x80 NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR = 0x20000000 NL80211_FEATURE_SCHED_SCAN_RANDOM_MAC_ADDR = 0x40000000 NL80211_FEATURE_SK_TX_STATUS = 0x1 NL80211_FEATURE_STATIC_SMPS = 0x1000000 NL80211_FEATURE_SUPPORTS_WMM_ADMISSION = 0x4000000 NL80211_FEATURE_TDLS_CHANNEL_SWITCH = 0x10000000 NL80211_FEATURE_TX_POWER_INSERTION = 0x400000 NL80211_FEATURE_USERSPACE_MPM = 0x10000 NL80211_FEATURE_VIF_TXPOWER = 0x200 NL80211_FEATURE_WFA_TPC_IE_IN_PROBES = 0x100000 NL80211_FILS_DISCOVERY_ATTR_INT_MAX = 0x2 NL80211_FILS_DISCOVERY_ATTR_INT_MIN = 0x1 NL80211_FILS_DISCOVERY_ATTR_MAX = 0x3 NL80211_FILS_DISCOVERY_ATTR_TMPL = 0x3 NL80211_FILS_DISCOVERY_TMPL_MIN_LEN = 0x2a NL80211_FREQUENCY_ATTR_16MHZ = 0x19 NL80211_FREQUENCY_ATTR_1MHZ = 0x15 NL80211_FREQUENCY_ATTR_2MHZ = 0x16 NL80211_FREQUENCY_ATTR_4MHZ = 0x17 NL80211_FREQUENCY_ATTR_8MHZ = 0x18 NL80211_FREQUENCY_ATTR_ALLOW_6GHZ_VLP_AP = 0x21 NL80211_FREQUENCY_ATTR_CAN_MONITOR = 0x20 NL80211_FREQUENCY_ATTR_DFS_CAC_TIME = 0xd NL80211_FREQUENCY_ATTR_DFS_CONCURRENT = 0x1d NL80211_FREQUENCY_ATTR_DFS_STATE = 0x7 NL80211_FREQUENCY_ATTR_DFS_TIME = 0x8 NL80211_FREQUENCY_ATTR_DISABLED = 0x2 NL80211_FREQUENCY_ATTR_FREQ = 0x1 NL80211_FREQUENCY_ATTR_GO_CONCURRENT = 0xf NL80211_FREQUENCY_ATTR_INDOOR_ONLY = 0xe NL80211_FREQUENCY_ATTR_IR_CONCURRENT = 0xf NL80211_FREQUENCY_ATTR_MAX = 0x22 NL80211_FREQUENCY_ATTR_MAX_TX_POWER = 0x6 NL80211_FREQUENCY_ATTR_NO_10MHZ = 0x11 NL80211_FREQUENCY_ATTR_NO_160MHZ = 0xc NL80211_FREQUENCY_ATTR_NO_20MHZ = 0x10 NL80211_FREQUENCY_ATTR_NO_320MHZ = 0x1a NL80211_FREQUENCY_ATTR_NO_6GHZ_AFC_CLIENT = 0x1f NL80211_FREQUENCY_ATTR_NO_6GHZ_VLP_CLIENT = 0x1e NL80211_FREQUENCY_ATTR_NO_80MHZ = 0xb NL80211_FREQUENCY_ATTR_NO_EHT = 0x1b NL80211_FREQUENCY_ATTR_NO_HE = 0x13 NL80211_FREQUENCY_ATTR_NO_HT40_MINUS = 0x9 NL80211_FREQUENCY_ATTR_NO_HT40_PLUS = 0xa NL80211_FREQUENCY_ATTR_NO_IBSS = 0x3 NL80211_FREQUENCY_ATTR_NO_IR = 0x3 NL80211_FREQUENCY_ATTR_NO_UHB_AFC_CLIENT = 0x1f NL80211_FREQUENCY_ATTR_NO_UHB_VLP_CLIENT = 0x1e NL80211_FREQUENCY_ATTR_OFFSET = 0x14 NL80211_FREQUENCY_ATTR_PASSIVE_SCAN = 0x3 NL80211_FREQUENCY_ATTR_PSD = 0x1c NL80211_FREQUENCY_ATTR_RADAR = 0x5 NL80211_FREQUENCY_ATTR_WMM = 0x12 NL80211_FTM_RESP_ATTR_CIVICLOC = 0x3 NL80211_FTM_RESP_ATTR_ENABLED = 0x1 NL80211_FTM_RESP_ATTR_LCI = 0x2 NL80211_FTM_RESP_ATTR_MAX = 0x3 NL80211_FTM_STATS_ASAP_NUM = 0x4 NL80211_FTM_STATS_FAILED_NUM = 0x3 NL80211_FTM_STATS_MAX = 0xa NL80211_FTM_STATS_NON_ASAP_NUM = 0x5 NL80211_FTM_STATS_OUT_OF_WINDOW_TRIGGERS_NUM = 0x9 NL80211_FTM_STATS_PAD = 0xa NL80211_FTM_STATS_PARTIAL_NUM = 0x2 NL80211_FTM_STATS_RESCHEDULE_REQUESTS_NUM = 0x8 NL80211_FTM_STATS_SUCCESS_NUM = 0x1 NL80211_FTM_STATS_TOTAL_DURATION_MSEC = 0x6 NL80211_FTM_STATS_UNKNOWN_TRIGGERS_NUM = 0x7 NL80211_GENL_NAME = "nl80211" NL80211_HE_BSS_COLOR_ATTR_COLOR = 0x1 NL80211_HE_BSS_COLOR_ATTR_DISABLED = 0x2 NL80211_HE_BSS_COLOR_ATTR_MAX = 0x3 NL80211_HE_BSS_COLOR_ATTR_PARTIAL = 0x3 NL80211_HE_MAX_CAPABILITY_LEN = 0x36 NL80211_HE_MIN_CAPABILITY_LEN = 0x10 NL80211_HE_NSS_MAX = 0x8 NL80211_HE_OBSS_PD_ATTR_BSS_COLOR_BITMAP = 0x4 NL80211_HE_OBSS_PD_ATTR_MAX = 0x6 NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET = 0x2 NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET = 0x1 NL80211_HE_OBSS_PD_ATTR_NON_SRG_MAX_OFFSET = 0x3 NL80211_HE_OBSS_PD_ATTR_PARTIAL_BSSID_BITMAP = 0x5 NL80211_HE_OBSS_PD_ATTR_SR_CTRL = 0x6 NL80211_HIDDEN_SSID_NOT_IN_USE = 0x0 NL80211_HIDDEN_SSID_ZERO_CONTENTS = 0x2 NL80211_HIDDEN_SSID_ZERO_LEN = 0x1 NL80211_HT_CAPABILITY_LEN = 0x1a NL80211_IFACE_COMB_BI_MIN_GCD = 0x7 NL80211_IFACE_COMB_LIMITS = 0x1 NL80211_IFACE_COMB_MAXNUM = 0x2 NL80211_IFACE_COMB_NUM_CHANNELS = 0x4 NL80211_IFACE_COMB_RADAR_DETECT_REGIONS = 0x6 NL80211_IFACE_COMB_RADAR_DETECT_WIDTHS = 0x5 NL80211_IFACE_COMB_STA_AP_BI_MATCH = 0x3 NL80211_IFACE_COMB_UNSPEC = 0x0 NL80211_IFACE_LIMIT_MAX = 0x1 NL80211_IFACE_LIMIT_TYPES = 0x2 NL80211_IFACE_LIMIT_UNSPEC = 0x0 NL80211_IFTYPE_ADHOC = 0x1 NL80211_IFTYPE_AKM_ATTR_IFTYPES = 0x1 NL80211_IFTYPE_AKM_ATTR_MAX = 0x2 NL80211_IFTYPE_AKM_ATTR_SUITES = 0x2 NL80211_IFTYPE_AP = 0x3 NL80211_IFTYPE_AP_VLAN = 0x4 NL80211_IFTYPE_MAX = 0xc NL80211_IFTYPE_MESH_POINT = 0x7 NL80211_IFTYPE_MONITOR = 0x6 NL80211_IFTYPE_NAN = 0xc NL80211_IFTYPE_OCB = 0xb NL80211_IFTYPE_P2P_CLIENT = 0x8 NL80211_IFTYPE_P2P_DEVICE = 0xa NL80211_IFTYPE_P2P_GO = 0x9 NL80211_IFTYPE_STATION = 0x2 NL80211_IFTYPE_UNSPECIFIED = 0x0 NL80211_IFTYPE_WDS = 0x5 NL80211_KCK_EXT_LEN_32 = 0x20 NL80211_KCK_EXT_LEN = 0x18 NL80211_KCK_LEN = 0x10 NL80211_KEK_EXT_LEN = 0x20 NL80211_KEK_LEN = 0x10 NL80211_KEY_CIPHER = 0x3 NL80211_KEY_DATA = 0x1 NL80211_KEY_DEFAULT_BEACON = 0xa NL80211_KEY_DEFAULT = 0x5 NL80211_KEY_DEFAULT_MGMT = 0x6 NL80211_KEY_DEFAULT_TYPE_MULTICAST = 0x2 NL80211_KEY_DEFAULT_TYPES = 0x8 NL80211_KEY_DEFAULT_TYPE_UNICAST = 0x1 NL80211_KEY_IDX = 0x2 NL80211_KEY_MAX = 0xa NL80211_KEY_MODE = 0x9 NL80211_KEY_NO_TX = 0x1 NL80211_KEY_RX_TX = 0x0 NL80211_KEY_SEQ = 0x4 NL80211_KEY_SET_TX = 0x2 NL80211_KEY_TYPE = 0x7 NL80211_KEYTYPE_GROUP = 0x0 NL80211_KEYTYPE_PAIRWISE = 0x1 NL80211_KEYTYPE_PEERKEY = 0x2 NL80211_MAX_NR_AKM_SUITES = 0x2 NL80211_MAX_NR_CIPHER_SUITES = 0x5 NL80211_MAX_SUPP_HT_RATES = 0x4d NL80211_MAX_SUPP_RATES = 0x20 NL80211_MAX_SUPP_REG_RULES = 0x80 NL80211_MAX_SUPP_SELECTORS = 0x80 NL80211_MBSSID_CONFIG_ATTR_EMA = 0x5 NL80211_MBSSID_CONFIG_ATTR_INDEX = 0x3 NL80211_MBSSID_CONFIG_ATTR_MAX = 0x6 NL80211_MBSSID_CONFIG_ATTR_MAX_EMA_PROFILE_PERIODICITY = 0x2 NL80211_MBSSID_CONFIG_ATTR_MAX_INTERFACES = 0x1 NL80211_MBSSID_CONFIG_ATTR_TX_IFINDEX = 0x4 NL80211_MESHCONF_ATTR_MAX = 0x1f NL80211_MESHCONF_AUTO_OPEN_PLINKS = 0x7 NL80211_MESHCONF_AWAKE_WINDOW = 0x1b NL80211_MESHCONF_CONFIRM_TIMEOUT = 0x2 NL80211_MESHCONF_CONNECTED_TO_AS = 0x1f NL80211_MESHCONF_CONNECTED_TO_GATE = 0x1d NL80211_MESHCONF_ELEMENT_TTL = 0xf NL80211_MESHCONF_FORWARDING = 0x13 NL80211_MESHCONF_GATE_ANNOUNCEMENTS = 0x11 NL80211_MESHCONF_HOLDING_TIMEOUT = 0x3 NL80211_MESHCONF_HT_OPMODE = 0x16 NL80211_MESHCONF_HWMP_ACTIVE_PATH_TIMEOUT = 0xb NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL = 0x19 NL80211_MESHCONF_HWMP_MAX_PREQ_RETRIES = 0x8 NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME = 0xd NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT = 0x17 NL80211_MESHCONF_HWMP_PERR_MIN_INTERVAL = 0x12 NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL = 0xc NL80211_MESHCONF_HWMP_RANN_INTERVAL = 0x10 NL80211_MESHCONF_HWMP_ROOT_INTERVAL = 0x18 NL80211_MESHCONF_HWMP_ROOTMODE = 0xe NL80211_MESHCONF_MAX_PEER_LINKS = 0x4 NL80211_MESHCONF_MAX_RETRIES = 0x5 NL80211_MESHCONF_MIN_DISCOVERY_TIMEOUT = 0xa NL80211_MESHCONF_NOLEARN = 0x1e NL80211_MESHCONF_PATH_REFRESH_TIME = 0x9 NL80211_MESHCONF_PLINK_TIMEOUT = 0x1c NL80211_MESHCONF_POWER_MODE = 0x1a NL80211_MESHCONF_RETRY_TIMEOUT = 0x1 NL80211_MESHCONF_RSSI_THRESHOLD = 0x14 NL80211_MESHCONF_SYNC_OFFSET_MAX_NEIGHBOR = 0x15 NL80211_MESHCONF_TTL = 0x6 NL80211_MESH_POWER_ACTIVE = 0x1 NL80211_MESH_POWER_DEEP_SLEEP = 0x3 NL80211_MESH_POWER_LIGHT_SLEEP = 0x2 NL80211_MESH_POWER_MAX = 0x3 NL80211_MESH_POWER_UNKNOWN = 0x0 NL80211_MESH_SETUP_ATTR_MAX = 0x8 NL80211_MESH_SETUP_AUTH_PROTOCOL = 0x8 NL80211_MESH_SETUP_ENABLE_VENDOR_METRIC = 0x2 NL80211_MESH_SETUP_ENABLE_VENDOR_PATH_SEL = 0x1 NL80211_MESH_SETUP_ENABLE_VENDOR_SYNC = 0x6 NL80211_MESH_SETUP_IE = 0x3 NL80211_MESH_SETUP_USERSPACE_AMPE = 0x5 NL80211_MESH_SETUP_USERSPACE_AUTH = 0x4 NL80211_MESH_SETUP_USERSPACE_MPM = 0x7 NL80211_MESH_SETUP_VENDOR_PATH_SEL_IE = 0x3 NL80211_MFP_NO = 0x0 NL80211_MFP_OPTIONAL = 0x2 NL80211_MFP_REQUIRED = 0x1 NL80211_MIN_REMAIN_ON_CHANNEL_TIME = 0xa NL80211_MNTR_FLAG_ACTIVE = 0x6 NL80211_MNTR_FLAG_CONTROL = 0x3 NL80211_MNTR_FLAG_COOK_FRAMES = 0x5 NL80211_MNTR_FLAG_FCSFAIL = 0x1 NL80211_MNTR_FLAG_MAX = 0x7 NL80211_MNTR_FLAG_OTHER_BSS = 0x4 NL80211_MNTR_FLAG_PLCPFAIL = 0x2 NL80211_MPATH_FLAG_ACTIVE = 0x1 NL80211_MPATH_FLAG_FIXED = 0x8 NL80211_MPATH_FLAG_RESOLVED = 0x10 NL80211_MPATH_FLAG_RESOLVING = 0x2 NL80211_MPATH_FLAG_SN_VALID = 0x4 NL80211_MPATH_INFO_DISCOVERY_RETRIES = 0x7 NL80211_MPATH_INFO_DISCOVERY_TIMEOUT = 0x6 NL80211_MPATH_INFO_EXPTIME = 0x4 NL80211_MPATH_INFO_FLAGS = 0x5 NL80211_MPATH_INFO_FRAME_QLEN = 0x1 NL80211_MPATH_INFO_HOP_COUNT = 0x8 NL80211_MPATH_INFO_MAX = 0x9 NL80211_MPATH_INFO_METRIC = 0x3 NL80211_MPATH_INFO_PATH_CHANGE = 0x9 NL80211_MPATH_INFO_SN = 0x2 NL80211_MULTICAST_GROUP_CONFIG = "config" NL80211_MULTICAST_GROUP_MLME = "mlme" NL80211_MULTICAST_GROUP_NAN = "nan" NL80211_MULTICAST_GROUP_REG = "regulatory" NL80211_MULTICAST_GROUP_SCAN = "scan" NL80211_MULTICAST_GROUP_TESTMODE = "testmode" NL80211_MULTICAST_GROUP_VENDOR = "vendor" NL80211_NAN_FUNC_ATTR_MAX = 0x10 NL80211_NAN_FUNC_CLOSE_RANGE = 0x9 NL80211_NAN_FUNC_FOLLOW_UP = 0x2 NL80211_NAN_FUNC_FOLLOW_UP_DEST = 0x8 NL80211_NAN_FUNC_FOLLOW_UP_ID = 0x6 NL80211_NAN_FUNC_FOLLOW_UP_REQ_ID = 0x7 NL80211_NAN_FUNC_INSTANCE_ID = 0xf NL80211_NAN_FUNC_MAX_TYPE = 0x2 NL80211_NAN_FUNC_PUBLISH_BCAST = 0x4 NL80211_NAN_FUNC_PUBLISH = 0x0 NL80211_NAN_FUNC_PUBLISH_TYPE = 0x3 NL80211_NAN_FUNC_RX_MATCH_FILTER = 0xd NL80211_NAN_FUNC_SERVICE_ID = 0x2 NL80211_NAN_FUNC_SERVICE_ID_LEN = 0x6 NL80211_NAN_FUNC_SERVICE_INFO = 0xb NL80211_NAN_FUNC_SERVICE_SPEC_INFO_MAX_LEN = 0xff NL80211_NAN_FUNC_SRF = 0xc NL80211_NAN_FUNC_SRF_MAX_LEN = 0xff NL80211_NAN_FUNC_SUBSCRIBE_ACTIVE = 0x5 NL80211_NAN_FUNC_SUBSCRIBE = 0x1 NL80211_NAN_FUNC_TERM_REASON = 0x10 NL80211_NAN_FUNC_TERM_REASON_ERROR = 0x2 NL80211_NAN_FUNC_TERM_REASON_TTL_EXPIRED = 0x1 NL80211_NAN_FUNC_TERM_REASON_USER_REQUEST = 0x0 NL80211_NAN_FUNC_TTL = 0xa NL80211_NAN_FUNC_TX_MATCH_FILTER = 0xe NL80211_NAN_FUNC_TYPE = 0x1 NL80211_NAN_MATCH_ATTR_MAX = 0x2 NL80211_NAN_MATCH_FUNC_LOCAL = 0x1 NL80211_NAN_MATCH_FUNC_PEER = 0x2 NL80211_NAN_SOLICITED_PUBLISH = 0x1 NL80211_NAN_SRF_ATTR_MAX = 0x4 NL80211_NAN_SRF_BF = 0x2 NL80211_NAN_SRF_BF_IDX = 0x3 NL80211_NAN_SRF_INCLUDE = 0x1 NL80211_NAN_SRF_MAC_ADDRS = 0x4 NL80211_NAN_UNSOLICITED_PUBLISH = 0x2 NL80211_NUM_ACS = 0x4 NL80211_P2P_PS_SUPPORTED = 0x1 NL80211_P2P_PS_UNSUPPORTED = 0x0 NL80211_PKTPAT_MASK = 0x1 NL80211_PKTPAT_OFFSET = 0x3 NL80211_PKTPAT_PATTERN = 0x2 NL80211_PLINK_ACTION_BLOCK = 0x2 NL80211_PLINK_ACTION_NO_ACTION = 0x0 NL80211_PLINK_ACTION_OPEN = 0x1 NL80211_PLINK_BLOCKED = 0x6 NL80211_PLINK_CNF_RCVD = 0x3 NL80211_PLINK_ESTAB = 0x4 NL80211_PLINK_HOLDING = 0x5 NL80211_PLINK_LISTEN = 0x0 NL80211_PLINK_OPN_RCVD = 0x2 NL80211_PLINK_OPN_SNT = 0x1 NL80211_PMKSA_CANDIDATE_BSSID = 0x2 NL80211_PMKSA_CANDIDATE_INDEX = 0x1 NL80211_PMKSA_CANDIDATE_PREAUTH = 0x3 NL80211_PMSR_ATTR_MAX = 0x5 NL80211_PMSR_ATTR_MAX_PEERS = 0x1 NL80211_PMSR_ATTR_PEERS = 0x5 NL80211_PMSR_ATTR_RANDOMIZE_MAC_ADDR = 0x3 NL80211_PMSR_ATTR_REPORT_AP_TSF = 0x2 NL80211_PMSR_ATTR_TYPE_CAPA = 0x4 NL80211_PMSR_FTM_CAPA_ATTR_ASAP = 0x1 NL80211_PMSR_FTM_CAPA_ATTR_BANDWIDTHS = 0x6 NL80211_PMSR_FTM_CAPA_ATTR_MAX_BURSTS_EXPONENT = 0x7 NL80211_PMSR_FTM_CAPA_ATTR_MAX = 0xa NL80211_PMSR_FTM_CAPA_ATTR_MAX_FTMS_PER_BURST = 0x8 NL80211_PMSR_FTM_CAPA_ATTR_NON_ASAP = 0x2 NL80211_PMSR_FTM_CAPA_ATTR_NON_TRIGGER_BASED = 0xa NL80211_PMSR_FTM_CAPA_ATTR_PREAMBLES = 0x5 NL80211_PMSR_FTM_CAPA_ATTR_REQ_CIVICLOC = 0x4 NL80211_PMSR_FTM_CAPA_ATTR_REQ_LCI = 0x3 NL80211_PMSR_FTM_CAPA_ATTR_TRIGGER_BASED = 0x9 NL80211_PMSR_FTM_FAILURE_BAD_CHANGED_PARAMS = 0x7 NL80211_PMSR_FTM_FAILURE_INVALID_TIMESTAMP = 0x5 NL80211_PMSR_FTM_FAILURE_NO_RESPONSE = 0x1 NL80211_PMSR_FTM_FAILURE_PEER_BUSY = 0x6 NL80211_PMSR_FTM_FAILURE_PEER_NOT_CAPABLE = 0x4 NL80211_PMSR_FTM_FAILURE_REJECTED = 0x2 NL80211_PMSR_FTM_FAILURE_UNSPECIFIED = 0x0 NL80211_PMSR_FTM_FAILURE_WRONG_CHANNEL = 0x3 NL80211_PMSR_FTM_REQ_ATTR_ASAP = 0x1 NL80211_PMSR_FTM_REQ_ATTR_BSS_COLOR = 0xd NL80211_PMSR_FTM_REQ_ATTR_BURST_DURATION = 0x5 NL80211_PMSR_FTM_REQ_ATTR_BURST_PERIOD = 0x4 NL80211_PMSR_FTM_REQ_ATTR_FTMS_PER_BURST = 0x6 NL80211_PMSR_FTM_REQ_ATTR_LMR_FEEDBACK = 0xc NL80211_PMSR_FTM_REQ_ATTR_MAX = 0xd NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED = 0xb NL80211_PMSR_FTM_REQ_ATTR_NUM_BURSTS_EXP = 0x3 NL80211_PMSR_FTM_REQ_ATTR_NUM_FTMR_RETRIES = 0x7 NL80211_PMSR_FTM_REQ_ATTR_PREAMBLE = 0x2 NL80211_PMSR_FTM_REQ_ATTR_REQUEST_CIVICLOC = 0x9 NL80211_PMSR_FTM_REQ_ATTR_REQUEST_LCI = 0x8 NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED = 0xa NL80211_PMSR_FTM_RESP_ATTR_BURST_DURATION = 0x7 NL80211_PMSR_FTM_RESP_ATTR_BURST_INDEX = 0x2 NL80211_PMSR_FTM_RESP_ATTR_BUSY_RETRY_TIME = 0x5 NL80211_PMSR_FTM_RESP_ATTR_CIVICLOC = 0x14 NL80211_PMSR_FTM_RESP_ATTR_DIST_AVG = 0x10 NL80211_PMSR_FTM_RESP_ATTR_DIST_SPREAD = 0x12 NL80211_PMSR_FTM_RESP_ATTR_DIST_VARIANCE = 0x11 NL80211_PMSR_FTM_RESP_ATTR_FAIL_REASON = 0x1 NL80211_PMSR_FTM_RESP_ATTR_FTMS_PER_BURST = 0x8 NL80211_PMSR_FTM_RESP_ATTR_LCI = 0x13 NL80211_PMSR_FTM_RESP_ATTR_MAX = 0x15 NL80211_PMSR_FTM_RESP_ATTR_NUM_BURSTS_EXP = 0x6 NL80211_PMSR_FTM_RESP_ATTR_NUM_FTMR_ATTEMPTS = 0x3 NL80211_PMSR_FTM_RESP_ATTR_NUM_FTMR_SUCCESSES = 0x4 NL80211_PMSR_FTM_RESP_ATTR_PAD = 0x15 NL80211_PMSR_FTM_RESP_ATTR_RSSI_AVG = 0x9 NL80211_PMSR_FTM_RESP_ATTR_RSSI_SPREAD = 0xa NL80211_PMSR_FTM_RESP_ATTR_RTT_AVG = 0xd NL80211_PMSR_FTM_RESP_ATTR_RTT_SPREAD = 0xf NL80211_PMSR_FTM_RESP_ATTR_RTT_VARIANCE = 0xe NL80211_PMSR_FTM_RESP_ATTR_RX_RATE = 0xc NL80211_PMSR_FTM_RESP_ATTR_TX_RATE = 0xb NL80211_PMSR_PEER_ATTR_ADDR = 0x1 NL80211_PMSR_PEER_ATTR_CHAN = 0x2 NL80211_PMSR_PEER_ATTR_MAX = 0x4 NL80211_PMSR_PEER_ATTR_REQ = 0x3 NL80211_PMSR_PEER_ATTR_RESP = 0x4 NL80211_PMSR_REQ_ATTR_DATA = 0x1 NL80211_PMSR_REQ_ATTR_GET_AP_TSF = 0x2 NL80211_PMSR_REQ_ATTR_MAX = 0x2 NL80211_PMSR_RESP_ATTR_AP_TSF = 0x4 NL80211_PMSR_RESP_ATTR_DATA = 0x1 NL80211_PMSR_RESP_ATTR_FINAL = 0x5 NL80211_PMSR_RESP_ATTR_HOST_TIME = 0x3 NL80211_PMSR_RESP_ATTR_MAX = 0x6 NL80211_PMSR_RESP_ATTR_PAD = 0x6 NL80211_PMSR_RESP_ATTR_STATUS = 0x2 NL80211_PMSR_STATUS_FAILURE = 0x3 NL80211_PMSR_STATUS_REFUSED = 0x1 NL80211_PMSR_STATUS_SUCCESS = 0x0 NL80211_PMSR_STATUS_TIMEOUT = 0x2 NL80211_PMSR_TYPE_FTM = 0x1 NL80211_PMSR_TYPE_INVALID = 0x0 NL80211_PMSR_TYPE_MAX = 0x1 NL80211_PREAMBLE_DMG = 0x3 NL80211_PREAMBLE_HE = 0x4 NL80211_PREAMBLE_HT = 0x1 NL80211_PREAMBLE_LEGACY = 0x0 NL80211_PREAMBLE_VHT = 0x2 NL80211_PROBE_RESP_OFFLOAD_SUPPORT_80211U = 0x8 NL80211_PROBE_RESP_OFFLOAD_SUPPORT_P2P = 0x4 NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS2 = 0x2 NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS = 0x1 NL80211_PROTOCOL_FEATURE_SPLIT_WIPHY_DUMP = 0x1 NL80211_PS_DISABLED = 0x0 NL80211_PS_ENABLED = 0x1 NL80211_RADAR_CAC_ABORTED = 0x2 NL80211_RADAR_CAC_FINISHED = 0x1 NL80211_RADAR_CAC_STARTED = 0x5 NL80211_RADAR_DETECTED = 0x0 NL80211_RADAR_NOP_FINISHED = 0x3 NL80211_RADAR_PRE_CAC_EXPIRED = 0x4 NL80211_RATE_INFO_10_MHZ_WIDTH = 0xb NL80211_RATE_INFO_160_MHZ_WIDTH = 0xa NL80211_RATE_INFO_16_MHZ_WIDTH = 0x1d NL80211_RATE_INFO_1_MHZ_WIDTH = 0x19 NL80211_RATE_INFO_2_MHZ_WIDTH = 0x1a NL80211_RATE_INFO_320_MHZ_WIDTH = 0x12 NL80211_RATE_INFO_40_MHZ_WIDTH = 0x3 NL80211_RATE_INFO_4_MHZ_WIDTH = 0x1b NL80211_RATE_INFO_5_MHZ_WIDTH = 0xc NL80211_RATE_INFO_80_MHZ_WIDTH = 0x8 NL80211_RATE_INFO_80P80_MHZ_WIDTH = 0x9 NL80211_RATE_INFO_8_MHZ_WIDTH = 0x1c NL80211_RATE_INFO_BITRATE32 = 0x5 NL80211_RATE_INFO_BITRATE = 0x1 NL80211_RATE_INFO_EHT_GI_0_8 = 0x0 NL80211_RATE_INFO_EHT_GI_1_6 = 0x1 NL80211_RATE_INFO_EHT_GI_3_2 = 0x2 NL80211_RATE_INFO_EHT_GI = 0x15 NL80211_RATE_INFO_EHT_MCS = 0x13 NL80211_RATE_INFO_EHT_NSS = 0x14 NL80211_RATE_INFO_EHT_RU_ALLOC_106 = 0x3 NL80211_RATE_INFO_EHT_RU_ALLOC_106P26 = 0x4 NL80211_RATE_INFO_EHT_RU_ALLOC_242 = 0x5 NL80211_RATE_INFO_EHT_RU_ALLOC_26 = 0x0 NL80211_RATE_INFO_EHT_RU_ALLOC_2x996 = 0xb NL80211_RATE_INFO_EHT_RU_ALLOC_2x996P484 = 0xc NL80211_RATE_INFO_EHT_RU_ALLOC_3x996 = 0xd NL80211_RATE_INFO_EHT_RU_ALLOC_3x996P484 = 0xe NL80211_RATE_INFO_EHT_RU_ALLOC_484 = 0x6 NL80211_RATE_INFO_EHT_RU_ALLOC_484P242 = 0x7 NL80211_RATE_INFO_EHT_RU_ALLOC_4x996 = 0xf NL80211_RATE_INFO_EHT_RU_ALLOC_52 = 0x1 NL80211_RATE_INFO_EHT_RU_ALLOC_52P26 = 0x2 NL80211_RATE_INFO_EHT_RU_ALLOC_996 = 0x8 NL80211_RATE_INFO_EHT_RU_ALLOC_996P484 = 0x9 NL80211_RATE_INFO_EHT_RU_ALLOC_996P484P242 = 0xa NL80211_RATE_INFO_EHT_RU_ALLOC = 0x16 NL80211_RATE_INFO_HE_1XLTF = 0x0 NL80211_RATE_INFO_HE_2XLTF = 0x1 NL80211_RATE_INFO_HE_4XLTF = 0x2 NL80211_RATE_INFO_HE_DCM = 0x10 NL80211_RATE_INFO_HE_GI_0_8 = 0x0 NL80211_RATE_INFO_HE_GI_1_6 = 0x1 NL80211_RATE_INFO_HE_GI_3_2 = 0x2 NL80211_RATE_INFO_HE_GI = 0xf NL80211_RATE_INFO_HE_MCS = 0xd NL80211_RATE_INFO_HE_NSS = 0xe NL80211_RATE_INFO_HE_RU_ALLOC_106 = 0x2 NL80211_RATE_INFO_HE_RU_ALLOC_242 = 0x3 NL80211_RATE_INFO_HE_RU_ALLOC_26 = 0x0 NL80211_RATE_INFO_HE_RU_ALLOC_2x996 = 0x6 NL80211_RATE_INFO_HE_RU_ALLOC_484 = 0x4 NL80211_RATE_INFO_HE_RU_ALLOC_52 = 0x1 NL80211_RATE_INFO_HE_RU_ALLOC_996 = 0x5 NL80211_RATE_INFO_HE_RU_ALLOC = 0x11 NL80211_RATE_INFO_MAX = 0x1d NL80211_RATE_INFO_MCS = 0x2 NL80211_RATE_INFO_S1G_MCS = 0x17 NL80211_RATE_INFO_S1G_NSS = 0x18 NL80211_RATE_INFO_SHORT_GI = 0x4 NL80211_RATE_INFO_VHT_MCS = 0x6 NL80211_RATE_INFO_VHT_NSS = 0x7 NL80211_REGDOM_SET_BY_CORE = 0x0 NL80211_REGDOM_SET_BY_COUNTRY_IE = 0x3 NL80211_REGDOM_SET_BY_DRIVER = 0x2 NL80211_REGDOM_SET_BY_USER = 0x1 NL80211_REGDOM_TYPE_COUNTRY = 0x0 NL80211_REGDOM_TYPE_CUSTOM_WORLD = 0x2 NL80211_REGDOM_TYPE_INTERSECTION = 0x3 NL80211_REGDOM_TYPE_WORLD = 0x1 NL80211_REG_RULE_ATTR_MAX = 0x8 NL80211_REKEY_DATA_AKM = 0x4 NL80211_REKEY_DATA_KCK = 0x2 NL80211_REKEY_DATA_KEK = 0x1 NL80211_REKEY_DATA_REPLAY_CTR = 0x3 NL80211_REPLAY_CTR_LEN = 0x8 NL80211_RRF_ALLOW_6GHZ_VLP_AP = 0x1000000 NL80211_RRF_AUTO_BW = 0x800 NL80211_RRF_DFS = 0x10 NL80211_RRF_DFS_CONCURRENT = 0x200000 NL80211_RRF_GO_CONCURRENT = 0x1000 NL80211_RRF_IR_CONCURRENT = 0x1000 NL80211_RRF_NO_160MHZ = 0x10000 NL80211_RRF_NO_320MHZ = 0x40000 NL80211_RRF_NO_6GHZ_AFC_CLIENT = 0x800000 NL80211_RRF_NO_6GHZ_VLP_CLIENT = 0x400000 NL80211_RRF_NO_80MHZ = 0x8000 NL80211_RRF_NO_CCK = 0x2 NL80211_RRF_NO_EHT = 0x80000 NL80211_RRF_NO_HE = 0x20000 NL80211_RRF_NO_HT40 = 0x6000 NL80211_RRF_NO_HT40MINUS = 0x2000 NL80211_RRF_NO_HT40PLUS = 0x4000 NL80211_RRF_NO_IBSS = 0x80 NL80211_RRF_NO_INDOOR = 0x4 NL80211_RRF_NO_IR_ALL = 0x180 NL80211_RRF_NO_IR = 0x80 NL80211_RRF_NO_OFDM = 0x1 NL80211_RRF_NO_OUTDOOR = 0x8 NL80211_RRF_NO_UHB_AFC_CLIENT = 0x800000 NL80211_RRF_NO_UHB_VLP_CLIENT = 0x400000 NL80211_RRF_PASSIVE_SCAN = 0x80 NL80211_RRF_PSD = 0x100000 NL80211_RRF_PTMP_ONLY = 0x40 NL80211_RRF_PTP_ONLY = 0x20 NL80211_RXMGMT_FLAG_ANSWERED = 0x1 NL80211_RXMGMT_FLAG_EXTERNAL_AUTH = 0x2 NL80211_SAE_PWE_BOTH = 0x3 NL80211_SAE_PWE_HASH_TO_ELEMENT = 0x2 NL80211_SAE_PWE_HUNT_AND_PECK = 0x1 NL80211_SAE_PWE_UNSPECIFIED = 0x0 NL80211_SAR_ATTR_MAX = 0x2 NL80211_SAR_ATTR_SPECS = 0x2 NL80211_SAR_ATTR_SPECS_END_FREQ = 0x4 NL80211_SAR_ATTR_SPECS_MAX = 0x4 NL80211_SAR_ATTR_SPECS_POWER = 0x1 NL80211_SAR_ATTR_SPECS_RANGE_INDEX = 0x2 NL80211_SAR_ATTR_SPECS_START_FREQ = 0x3 NL80211_SAR_ATTR_TYPE = 0x1 NL80211_SAR_TYPE_POWER = 0x0 NL80211_SCAN_FLAG_ACCEPT_BCAST_PROBE_RESP = 0x20 NL80211_SCAN_FLAG_AP = 0x4 NL80211_SCAN_FLAG_COLOCATED_6GHZ = 0x4000 NL80211_SCAN_FLAG_FILS_MAX_CHANNEL_TIME = 0x10 NL80211_SCAN_FLAG_FLUSH = 0x2 NL80211_SCAN_FLAG_FREQ_KHZ = 0x2000 NL80211_SCAN_FLAG_HIGH_ACCURACY = 0x400 NL80211_SCAN_FLAG_LOW_POWER = 0x200 NL80211_SCAN_FLAG_LOW_PRIORITY = 0x1 NL80211_SCAN_FLAG_LOW_SPAN = 0x100 NL80211_SCAN_FLAG_MIN_PREQ_CONTENT = 0x1000 NL80211_SCAN_FLAG_OCE_PROBE_REQ_DEFERRAL_SUPPRESSION = 0x80 NL80211_SCAN_FLAG_OCE_PROBE_REQ_HIGH_TX_RATE = 0x40 NL80211_SCAN_FLAG_RANDOM_ADDR = 0x8 NL80211_SCAN_FLAG_RANDOM_SN = 0x800 NL80211_SCAN_RSSI_THOLD_OFF = -0x12c NL80211_SCHED_SCAN_MATCH_ATTR_BSSID = 0x5 NL80211_SCHED_SCAN_MATCH_ATTR_MAX = 0x6 NL80211_SCHED_SCAN_MATCH_ATTR_RELATIVE_RSSI = 0x3 NL80211_SCHED_SCAN_MATCH_ATTR_RSSI_ADJUST = 0x4 NL80211_SCHED_SCAN_MATCH_ATTR_RSSI = 0x2 NL80211_SCHED_SCAN_MATCH_ATTR_SSID = 0x1 NL80211_SCHED_SCAN_MATCH_PER_BAND_RSSI = 0x6 NL80211_SCHED_SCAN_PLAN_INTERVAL = 0x1 NL80211_SCHED_SCAN_PLAN_ITERATIONS = 0x2 NL80211_SCHED_SCAN_PLAN_MAX = 0x2 NL80211_SMPS_DYNAMIC = 0x2 NL80211_SMPS_MAX = 0x2 NL80211_SMPS_OFF = 0x0 NL80211_SMPS_STATIC = 0x1 NL80211_STA_BSS_PARAM_BEACON_INTERVAL = 0x5 NL80211_STA_BSS_PARAM_CTS_PROT = 0x1 NL80211_STA_BSS_PARAM_DTIM_PERIOD = 0x4 NL80211_STA_BSS_PARAM_MAX = 0x5 NL80211_STA_BSS_PARAM_SHORT_PREAMBLE = 0x2 NL80211_STA_BSS_PARAM_SHORT_SLOT_TIME = 0x3 NL80211_STA_FLAG_ASSOCIATED = 0x7 NL80211_STA_FLAG_AUTHENTICATED = 0x5 NL80211_STA_FLAG_AUTHORIZED = 0x1 NL80211_STA_FLAG_MAX = 0x8 NL80211_STA_FLAG_MAX_OLD_API = 0x6 NL80211_STA_FLAG_MFP = 0x4 NL80211_STA_FLAG_SHORT_PREAMBLE = 0x2 NL80211_STA_FLAG_SPP_AMSDU = 0x8 NL80211_STA_FLAG_TDLS_PEER = 0x6 NL80211_STA_FLAG_WME = 0x3 NL80211_STA_INFO_ACK_SIGNAL_AVG = 0x23 NL80211_STA_INFO_ACK_SIGNAL = 0x22 NL80211_STA_INFO_AIRTIME_LINK_METRIC = 0x29 NL80211_STA_INFO_AIRTIME_WEIGHT = 0x28 NL80211_STA_INFO_ASSOC_AT_BOOTTIME = 0x2a NL80211_STA_INFO_BEACON_LOSS = 0x12 NL80211_STA_INFO_BEACON_RX = 0x1d NL80211_STA_INFO_BEACON_SIGNAL_AVG = 0x1e NL80211_STA_INFO_BSS_PARAM = 0xf NL80211_STA_INFO_CHAIN_SIGNAL_AVG = 0x1a NL80211_STA_INFO_CHAIN_SIGNAL = 0x19 NL80211_STA_INFO_CONNECTED_TIME = 0x10 NL80211_STA_INFO_CONNECTED_TO_AS = 0x2b NL80211_STA_INFO_CONNECTED_TO_GATE = 0x26 NL80211_STA_INFO_DATA_ACK_SIGNAL_AVG = 0x23 NL80211_STA_INFO_EXPECTED_THROUGHPUT = 0x1b NL80211_STA_INFO_FCS_ERROR_COUNT = 0x25 NL80211_STA_INFO_INACTIVE_TIME = 0x1 NL80211_STA_INFO_LLID = 0x4 NL80211_STA_INFO_LOCAL_PM = 0x14 NL80211_STA_INFO_MAX = 0x2b NL80211_STA_INFO_NONPEER_PM = 0x16 NL80211_STA_INFO_PAD = 0x21 NL80211_STA_INFO_PEER_PM = 0x15 NL80211_STA_INFO_PLID = 0x5 NL80211_STA_INFO_PLINK_STATE = 0x6 NL80211_STA_INFO_RX_BITRATE = 0xe NL80211_STA_INFO_RX_BYTES64 = 0x17 NL80211_STA_INFO_RX_BYTES = 0x2 NL80211_STA_INFO_RX_DROP_MISC = 0x1c NL80211_STA_INFO_RX_DURATION = 0x20 NL80211_STA_INFO_RX_MPDUS = 0x24 NL80211_STA_INFO_RX_PACKETS = 0x9 NL80211_STA_INFO_SIGNAL_AVG = 0xd NL80211_STA_INFO_SIGNAL = 0x7 NL80211_STA_INFO_STA_FLAGS = 0x11 NL80211_STA_INFO_TID_STATS = 0x1f NL80211_STA_INFO_T_OFFSET = 0x13 NL80211_STA_INFO_TX_BITRATE = 0x8 NL80211_STA_INFO_TX_BYTES64 = 0x18 NL80211_STA_INFO_TX_BYTES = 0x3 NL80211_STA_INFO_TX_DURATION = 0x27 NL80211_STA_INFO_TX_FAILED = 0xc NL80211_STA_INFO_TX_PACKETS = 0xa NL80211_STA_INFO_TX_RETRIES = 0xb NL80211_STA_WME_MAX = 0x2 NL80211_STA_WME_MAX_SP = 0x2 NL80211_STA_WME_UAPSD_QUEUES = 0x1 NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY = 0x5 NL80211_SURVEY_INFO_CHANNEL_TIME = 0x4 NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY = 0x6 NL80211_SURVEY_INFO_CHANNEL_TIME_RX = 0x7 NL80211_SURVEY_INFO_CHANNEL_TIME_TX = 0x8 NL80211_SURVEY_INFO_FREQUENCY = 0x1 NL80211_SURVEY_INFO_FREQUENCY_OFFSET = 0xc NL80211_SURVEY_INFO_IN_USE = 0x3 NL80211_SURVEY_INFO_MAX = 0xc NL80211_SURVEY_INFO_NOISE = 0x2 NL80211_SURVEY_INFO_PAD = 0xa NL80211_SURVEY_INFO_TIME_BSS_RX = 0xb NL80211_SURVEY_INFO_TIME_BUSY = 0x5 NL80211_SURVEY_INFO_TIME = 0x4 NL80211_SURVEY_INFO_TIME_EXT_BUSY = 0x6 NL80211_SURVEY_INFO_TIME_RX = 0x7 NL80211_SURVEY_INFO_TIME_SCAN = 0x9 NL80211_SURVEY_INFO_TIME_TX = 0x8 NL80211_TDLS_DISABLE_LINK = 0x4 NL80211_TDLS_DISCOVERY_REQ = 0x0 NL80211_TDLS_ENABLE_LINK = 0x3 NL80211_TDLS_PEER_HE = 0x8 NL80211_TDLS_PEER_HT = 0x1 NL80211_TDLS_PEER_VHT = 0x2 NL80211_TDLS_PEER_WMM = 0x4 NL80211_TDLS_SETUP = 0x1 NL80211_TDLS_TEARDOWN = 0x2 NL80211_TID_CONFIG_ATTR_AMPDU_CTRL = 0x9 NL80211_TID_CONFIG_ATTR_AMSDU_CTRL = 0xb NL80211_TID_CONFIG_ATTR_MAX = 0xd NL80211_TID_CONFIG_ATTR_NOACK = 0x6 NL80211_TID_CONFIG_ATTR_OVERRIDE = 0x4 NL80211_TID_CONFIG_ATTR_PAD = 0x1 NL80211_TID_CONFIG_ATTR_PEER_SUPP = 0x3 NL80211_TID_CONFIG_ATTR_RETRY_LONG = 0x8 NL80211_TID_CONFIG_ATTR_RETRY_SHORT = 0x7 NL80211_TID_CONFIG_ATTR_RTSCTS_CTRL = 0xa NL80211_TID_CONFIG_ATTR_TIDS = 0x5 NL80211_TID_CONFIG_ATTR_TX_RATE = 0xd NL80211_TID_CONFIG_ATTR_TX_RATE_TYPE = 0xc NL80211_TID_CONFIG_ATTR_VIF_SUPP = 0x2 NL80211_TID_CONFIG_DISABLE = 0x1 NL80211_TID_CONFIG_ENABLE = 0x0 NL80211_TID_STATS_MAX = 0x6 NL80211_TID_STATS_PAD = 0x5 NL80211_TID_STATS_RX_MSDU = 0x1 NL80211_TID_STATS_TX_MSDU = 0x2 NL80211_TID_STATS_TX_MSDU_FAILED = 0x4 NL80211_TID_STATS_TX_MSDU_RETRIES = 0x3 NL80211_TID_STATS_TXQ_STATS = 0x6 NL80211_TIMEOUT_ASSOC = 0x3 NL80211_TIMEOUT_AUTH = 0x2 NL80211_TIMEOUT_SCAN = 0x1 NL80211_TIMEOUT_UNSPECIFIED = 0x0 NL80211_TKIP_DATA_OFFSET_ENCR_KEY = 0x0 NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY = 0x18 NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY = 0x10 NL80211_TX_POWER_AUTOMATIC = 0x0 NL80211_TX_POWER_FIXED = 0x2 NL80211_TX_POWER_LIMITED = 0x1 NL80211_TXQ_ATTR_AC = 0x1 NL80211_TXQ_ATTR_AIFS = 0x5 NL80211_TXQ_ATTR_CWMAX = 0x4 NL80211_TXQ_ATTR_CWMIN = 0x3 NL80211_TXQ_ATTR_MAX = 0x5 NL80211_TXQ_ATTR_QUEUE = 0x1 NL80211_TXQ_ATTR_TXOP = 0x2 NL80211_TXQ_Q_BE = 0x2 NL80211_TXQ_Q_BK = 0x3 NL80211_TXQ_Q_VI = 0x1 NL80211_TXQ_Q_VO = 0x0 NL80211_TXQ_STATS_BACKLOG_BYTES = 0x1 NL80211_TXQ_STATS_BACKLOG_PACKETS = 0x2 NL80211_TXQ_STATS_COLLISIONS = 0x8 NL80211_TXQ_STATS_DROPS = 0x4 NL80211_TXQ_STATS_ECN_MARKS = 0x5 NL80211_TXQ_STATS_FLOWS = 0x3 NL80211_TXQ_STATS_MAX = 0xb NL80211_TXQ_STATS_MAX_FLOWS = 0xb NL80211_TXQ_STATS_OVERLIMIT = 0x6 NL80211_TXQ_STATS_OVERMEMORY = 0x7 NL80211_TXQ_STATS_TX_BYTES = 0x9 NL80211_TXQ_STATS_TX_PACKETS = 0xa NL80211_TX_RATE_AUTOMATIC = 0x0 NL80211_TXRATE_DEFAULT_GI = 0x0 NL80211_TX_RATE_FIXED = 0x2 NL80211_TXRATE_FORCE_LGI = 0x2 NL80211_TXRATE_FORCE_SGI = 0x1 NL80211_TXRATE_GI = 0x4 NL80211_TXRATE_HE = 0x5 NL80211_TXRATE_HE_GI = 0x6 NL80211_TXRATE_HE_LTF = 0x7 NL80211_TXRATE_HT = 0x2 NL80211_TXRATE_LEGACY = 0x1 NL80211_TX_RATE_LIMITED = 0x1 NL80211_TXRATE_MAX = 0x7 NL80211_TXRATE_MCS = 0x2 NL80211_TXRATE_VHT = 0x3 NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_INT = 0x1 NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_MAX = 0x2 NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_TMPL = 0x2 NL80211_USER_REG_HINT_CELL_BASE = 0x1 NL80211_USER_REG_HINT_INDOOR = 0x2 NL80211_USER_REG_HINT_USER = 0x0 NL80211_VENDOR_ID_IS_LINUX = 0x80000000 NL80211_VHT_CAPABILITY_LEN = 0xc NL80211_VHT_NSS_MAX = 0x8 NL80211_WIPHY_NAME_MAXLEN = 0x40 NL80211_WIPHY_RADIO_ATTR_FREQ_RANGE = 0x2 NL80211_WIPHY_RADIO_ATTR_INDEX = 0x1 NL80211_WIPHY_RADIO_ATTR_INTERFACE_COMBINATION = 0x3 NL80211_WIPHY_RADIO_ATTR_MAX = 0x4 NL80211_WIPHY_RADIO_FREQ_ATTR_END = 0x2 NL80211_WIPHY_RADIO_FREQ_ATTR_MAX = 0x2 NL80211_WIPHY_RADIO_FREQ_ATTR_START = 0x1 NL80211_WMMR_AIFSN = 0x3 NL80211_WMMR_CW_MAX = 0x2 NL80211_WMMR_CW_MIN = 0x1 NL80211_WMMR_MAX = 0x4 NL80211_WMMR_TXOP = 0x4 NL80211_WOWLAN_PKTPAT_MASK = 0x1 NL80211_WOWLAN_PKTPAT_OFFSET = 0x3 NL80211_WOWLAN_PKTPAT_PATTERN = 0x2 NL80211_WOWLAN_TCP_DATA_INTERVAL = 0x9 NL80211_WOWLAN_TCP_DATA_PAYLOAD = 0x6 NL80211_WOWLAN_TCP_DATA_PAYLOAD_SEQ = 0x7 NL80211_WOWLAN_TCP_DATA_PAYLOAD_TOKEN = 0x8 NL80211_WOWLAN_TCP_DST_IPV4 = 0x2 NL80211_WOWLAN_TCP_DST_MAC = 0x3 NL80211_WOWLAN_TCP_DST_PORT = 0x5 NL80211_WOWLAN_TCP_SRC_IPV4 = 0x1 NL80211_WOWLAN_TCP_SRC_PORT = 0x4 NL80211_WOWLAN_TCP_WAKE_MASK = 0xb NL80211_WOWLAN_TCP_WAKE_PAYLOAD = 0xa NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE = 0x8 NL80211_WOWLAN_TRIG_ANY = 0x1 NL80211_WOWLAN_TRIG_DISCONNECT = 0x2 NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST = 0x7 NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE = 0x6 NL80211_WOWLAN_TRIG_GTK_REKEY_SUPPORTED = 0x5 NL80211_WOWLAN_TRIG_MAGIC_PKT = 0x3 NL80211_WOWLAN_TRIG_NET_DETECT = 0x12 NL80211_WOWLAN_TRIG_NET_DETECT_RESULTS = 0x13 NL80211_WOWLAN_TRIG_PKT_PATTERN = 0x4 NL80211_WOWLAN_TRIG_RFKILL_RELEASE = 0x9 NL80211_WOWLAN_TRIG_TCP_CONNECTION = 0xe NL80211_WOWLAN_TRIG_UNPROTECTED_DEAUTH_DISASSOC = 0x14 NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211 = 0xa NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211_LEN = 0xb NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023 = 0xc NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023_LEN = 0xd NL80211_WOWLAN_TRIG_WAKEUP_TCP_CONNLOST = 0x10 NL80211_WOWLAN_TRIG_WAKEUP_TCP_MATCH = 0xf NL80211_WOWLAN_TRIG_WAKEUP_TCP_NOMORETOKENS = 0x11 NL80211_WPA_VERSION_1 = 0x1 NL80211_WPA_VERSION_2 = 0x2 NL80211_WPA_VERSION_3 = 0x4 ) const ( FRA_UNSPEC = 0x0 FRA_DST = 0x1 FRA_SRC = 0x2 FRA_IIFNAME = 0x3 FRA_GOTO = 0x4 FRA_UNUSED2 = 0x5 FRA_PRIORITY = 0x6 FRA_UNUSED3 = 0x7 FRA_UNUSED4 = 0x8 FRA_UNUSED5 = 0x9 FRA_FWMARK = 0xa FRA_FLOW = 0xb FRA_TUN_ID = 0xc FRA_SUPPRESS_IFGROUP = 0xd FRA_SUPPRESS_PREFIXLEN = 0xe FRA_TABLE = 0xf FRA_FWMASK = 0x10 FRA_OIFNAME = 0x11 FRA_PAD = 0x12 FRA_L3MDEV = 0x13 FRA_UID_RANGE = 0x14 FRA_PROTOCOL = 0x15 FRA_IP_PROTO = 0x16 FRA_SPORT_RANGE = 0x17 FRA_DPORT_RANGE = 0x18 FR_ACT_UNSPEC = 0x0 FR_ACT_TO_TBL = 0x1 FR_ACT_GOTO = 0x2 FR_ACT_NOP = 0x3 FR_ACT_RES3 = 0x4 FR_ACT_RES4 = 0x5 FR_ACT_BLACKHOLE = 0x6 FR_ACT_UNREACHABLE = 0x7 FR_ACT_PROHIBIT = 0x8 ) const ( AUDIT_NLGRP_NONE = 0x0 AUDIT_NLGRP_READLOG = 0x1 ) const ( TUN_F_CSUM = 0x1 TUN_F_TSO4 = 0x2 TUN_F_TSO6 = 0x4 TUN_F_TSO_ECN = 0x8 TUN_F_UFO = 0x10 TUN_F_USO4 = 0x20 TUN_F_USO6 = 0x40 ) const ( VIRTIO_NET_HDR_F_NEEDS_CSUM = 0x1 VIRTIO_NET_HDR_F_DATA_VALID = 0x2 VIRTIO_NET_HDR_F_RSC_INFO = 0x4 ) const ( VIRTIO_NET_HDR_GSO_NONE = 0x0 VIRTIO_NET_HDR_GSO_TCPV4 = 0x1 VIRTIO_NET_HDR_GSO_UDP = 0x3 VIRTIO_NET_HDR_GSO_TCPV6 = 0x4 VIRTIO_NET_HDR_GSO_UDP_L4 = 0x5 VIRTIO_NET_HDR_GSO_ECN = 0x80 ) type SchedAttr struct { Size uint32 Policy uint32 Flags uint64 Nice int32 Priority uint32 Runtime uint64 Deadline uint64 Period uint64 Util_min uint32 Util_max uint32 } const SizeofSchedAttr = 0x38 type Cachestat_t struct { Cache uint64 Dirty uint64 Writeback uint64 Evicted uint64 Recently_evicted uint64 } type CachestatRange struct { Off uint64 Len uint64 } const ( SK_MEMINFO_RMEM_ALLOC = 0x0 SK_MEMINFO_RCVBUF = 0x1 SK_MEMINFO_WMEM_ALLOC = 0x2 SK_MEMINFO_SNDBUF = 0x3 SK_MEMINFO_FWD_ALLOC = 0x4 SK_MEMINFO_WMEM_QUEUED = 0x5 SK_MEMINFO_OPTMEM = 0x6 SK_MEMINFO_BACKLOG = 0x7 SK_MEMINFO_DROPS = 0x8 SK_MEMINFO_VARS = 0x9 SKNLGRP_NONE = 0x0 SKNLGRP_INET_TCP_DESTROY = 0x1 SKNLGRP_INET_UDP_DESTROY = 0x2 SKNLGRP_INET6_TCP_DESTROY = 0x3 SKNLGRP_INET6_UDP_DESTROY = 0x4 SK_DIAG_BPF_STORAGE_REQ_NONE = 0x0 SK_DIAG_BPF_STORAGE_REQ_MAP_FD = 0x1 SK_DIAG_BPF_STORAGE_REP_NONE = 0x0 SK_DIAG_BPF_STORAGE = 0x1 SK_DIAG_BPF_STORAGE_NONE = 0x0 SK_DIAG_BPF_STORAGE_PAD = 0x1 SK_DIAG_BPF_STORAGE_MAP_ID = 0x2 SK_DIAG_BPF_STORAGE_MAP_VALUE = 0x3 ) type SockDiagReq struct { Family uint8 Protocol uint8 } const RTM_NEWNVLAN = 0x70 const ( MPOL_BIND = 0x2 MPOL_DEFAULT = 0x0 MPOL_F_ADDR = 0x2 MPOL_F_MEMS_ALLOWED = 0x4 MPOL_F_MOF = 0x8 MPOL_F_MORON = 0x10 MPOL_F_NODE = 0x1 MPOL_F_NUMA_BALANCING = 0x2000 MPOL_F_RELATIVE_NODES = 0x4000 MPOL_F_SHARED = 0x1 MPOL_F_STATIC_NODES = 0x8000 MPOL_INTERLEAVE = 0x3 MPOL_LOCAL = 0x4 MPOL_MAX = 0x7 MPOL_MF_INTERNAL = 0x10 MPOL_MF_LAZY = 0x8 MPOL_MF_MOVE_ALL = 0x4 MPOL_MF_MOVE = 0x2 MPOL_MF_STRICT = 0x1 MPOL_MF_VALID = 0x7 MPOL_MODE_FLAGS = 0xe000 MPOL_PREFERRED = 0x1 MPOL_PREFERRED_MANY = 0x5 MPOL_WEIGHTED_INTERLEAVE = 0x6 ) ================================================ FILE: vendor/golang.org/x/sys/unix/ztypes_linux_386.go ================================================ // cgo -godefs -objdir=/tmp/386/cgo -- -Wall -Werror -static -I/tmp/386/include -m32 linux/types.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build 386 && linux package unix const ( SizeofPtr = 0x4 SizeofLong = 0x4 ) type ( _C_long int32 ) type Timespec struct { Sec int32 Nsec int32 } type Timeval struct { Sec int32 Usec int32 } type Timex struct { Modes uint32 Offset int32 Freq int32 Maxerror int32 Esterror int32 Status int32 Constant int32 Precision int32 Tolerance int32 Time Timeval Tick int32 Ppsfreq int32 Jitter int32 Shift int32 Stabil int32 Jitcnt int32 Calcnt int32 Errcnt int32 Stbcnt int32 Tai int32 _ [44]byte } type Time_t int32 type Tms struct { Utime int32 Stime int32 Cutime int32 Cstime int32 } type Utimbuf struct { Actime int32 Modtime int32 } type Rusage struct { Utime Timeval Stime Timeval Maxrss int32 Ixrss int32 Idrss int32 Isrss int32 Minflt int32 Majflt int32 Nswap int32 Inblock int32 Oublock int32 Msgsnd int32 Msgrcv int32 Nsignals int32 Nvcsw int32 Nivcsw int32 } type Stat_t struct { Dev uint64 _ uint16 _ uint32 Mode uint32 Nlink uint32 Uid uint32 Gid uint32 Rdev uint64 _ uint16 Size int64 Blksize int32 Blocks int64 Atim Timespec Mtim Timespec Ctim Timespec Ino uint64 } type Dirent struct { Ino uint64 Off int64 Reclen uint16 Type uint8 Name [256]int8 _ [1]byte } type Flock_t struct { Type int16 Whence int16 Start int64 Len int64 Pid int32 } type DmNameList struct { Dev uint64 Next uint32 } const ( FADV_DONTNEED = 0x4 FADV_NOREUSE = 0x5 ) type RawSockaddrNFCLLCP struct { Sa_family uint16 Dev_idx uint32 Target_idx uint32 Nfc_protocol uint32 Dsap uint8 Ssap uint8 Service_name [63]uint8 Service_name_len uint32 } type RawSockaddr struct { Family uint16 Data [14]int8 } type RawSockaddrAny struct { Addr RawSockaddr Pad [96]int8 } type Iovec struct { Base *byte Len uint32 } type Msghdr struct { Name *byte Namelen uint32 Iov *Iovec Iovlen uint32 Control *byte Controllen uint32 Flags int32 } type Cmsghdr struct { Len uint32 Level int32 Type int32 } type ifreq struct { Ifrn [16]byte Ifru [16]byte } const ( SizeofSockaddrNFCLLCP = 0x58 SizeofIovec = 0x8 SizeofMsghdr = 0x1c SizeofCmsghdr = 0xc ) const ( SizeofSockFprog = 0x8 ) type PtraceRegs struct { Ebx int32 Ecx int32 Edx int32 Esi int32 Edi int32 Ebp int32 Eax int32 Xds int32 Xes int32 Xfs int32 Xgs int32 Orig_eax int32 Eip int32 Xcs int32 Eflags int32 Esp int32 Xss int32 } type FdSet struct { Bits [32]int32 } type Sysinfo_t struct { Uptime int32 Loads [3]uint32 Totalram uint32 Freeram uint32 Sharedram uint32 Bufferram uint32 Totalswap uint32 Freeswap uint32 Procs uint16 Pad uint16 Totalhigh uint32 Freehigh uint32 Unit uint32 _ [8]int8 } type Ustat_t struct { Tfree int32 Tinode uint32 Fname [6]int8 Fpack [6]int8 } type EpollEvent struct { Events uint32 Fd int32 Pad int32 } const ( OPEN_TREE_CLOEXEC = 0x80000 ) const ( POLLRDHUP = 0x2000 ) type Sigset_t struct { Val [32]uint32 } const _C__NSIG = 0x41 const ( SIG_BLOCK = 0x0 SIG_UNBLOCK = 0x1 SIG_SETMASK = 0x2 ) type Siginfo struct { Signo int32 Errno int32 Code int32 _ [116]byte } type Termios struct { Iflag uint32 Oflag uint32 Cflag uint32 Lflag uint32 Line uint8 Cc [19]uint8 Ispeed uint32 Ospeed uint32 } type Taskstats struct { Version uint16 Ac_exitcode uint32 Ac_flag uint8 Ac_nice uint8 _ [6]byte Cpu_count uint64 Cpu_delay_total uint64 Blkio_count uint64 Blkio_delay_total uint64 Swapin_count uint64 Swapin_delay_total uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]int8 Ac_sched uint8 Ac_pad [3]uint8 _ [4]byte Ac_uid uint32 Ac_gid uint32 Ac_pid uint32 Ac_ppid uint32 Ac_btime uint32 _ [4]byte Ac_etime uint64 Ac_utime uint64 Ac_stime uint64 Ac_minflt uint64 Ac_majflt uint64 Coremem uint64 Virtmem uint64 Hiwater_rss uint64 Hiwater_vm uint64 Read_char uint64 Write_char uint64 Read_syscalls uint64 Write_syscalls uint64 Read_bytes uint64 Write_bytes uint64 Cancelled_write_bytes uint64 Nvcsw uint64 Nivcsw uint64 Ac_utimescaled uint64 Ac_stimescaled uint64 Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 Thrashing_count uint64 Thrashing_delay_total uint64 Ac_btime64 uint64 Compact_count uint64 Compact_delay_total uint64 Ac_tgid uint32 _ [4]byte Ac_tgetime uint64 Ac_exe_dev uint64 Ac_exe_inode uint64 Wpcopy_count uint64 Wpcopy_delay_total uint64 Irq_count uint64 Irq_delay_total uint64 Cpu_delay_max uint64 Cpu_delay_min uint64 Blkio_delay_max uint64 Blkio_delay_min uint64 Swapin_delay_max uint64 Swapin_delay_min uint64 Freepages_delay_max uint64 Freepages_delay_min uint64 Thrashing_delay_max uint64 Thrashing_delay_min uint64 Compact_delay_max uint64 Compact_delay_min uint64 Wpcopy_delay_max uint64 Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 } type cpuMask uint32 const ( _NCPUBITS = 0x20 ) const ( CBitFieldMaskBit0 = 0x1 CBitFieldMaskBit1 = 0x2 CBitFieldMaskBit2 = 0x4 CBitFieldMaskBit3 = 0x8 CBitFieldMaskBit4 = 0x10 CBitFieldMaskBit5 = 0x20 CBitFieldMaskBit6 = 0x40 CBitFieldMaskBit7 = 0x80 CBitFieldMaskBit8 = 0x100 CBitFieldMaskBit9 = 0x200 CBitFieldMaskBit10 = 0x400 CBitFieldMaskBit11 = 0x800 CBitFieldMaskBit12 = 0x1000 CBitFieldMaskBit13 = 0x2000 CBitFieldMaskBit14 = 0x4000 CBitFieldMaskBit15 = 0x8000 CBitFieldMaskBit16 = 0x10000 CBitFieldMaskBit17 = 0x20000 CBitFieldMaskBit18 = 0x40000 CBitFieldMaskBit19 = 0x80000 CBitFieldMaskBit20 = 0x100000 CBitFieldMaskBit21 = 0x200000 CBitFieldMaskBit22 = 0x400000 CBitFieldMaskBit23 = 0x800000 CBitFieldMaskBit24 = 0x1000000 CBitFieldMaskBit25 = 0x2000000 CBitFieldMaskBit26 = 0x4000000 CBitFieldMaskBit27 = 0x8000000 CBitFieldMaskBit28 = 0x10000000 CBitFieldMaskBit29 = 0x20000000 CBitFieldMaskBit30 = 0x40000000 CBitFieldMaskBit31 = 0x80000000 CBitFieldMaskBit32 = 0x100000000 CBitFieldMaskBit33 = 0x200000000 CBitFieldMaskBit34 = 0x400000000 CBitFieldMaskBit35 = 0x800000000 CBitFieldMaskBit36 = 0x1000000000 CBitFieldMaskBit37 = 0x2000000000 CBitFieldMaskBit38 = 0x4000000000 CBitFieldMaskBit39 = 0x8000000000 CBitFieldMaskBit40 = 0x10000000000 CBitFieldMaskBit41 = 0x20000000000 CBitFieldMaskBit42 = 0x40000000000 CBitFieldMaskBit43 = 0x80000000000 CBitFieldMaskBit44 = 0x100000000000 CBitFieldMaskBit45 = 0x200000000000 CBitFieldMaskBit46 = 0x400000000000 CBitFieldMaskBit47 = 0x800000000000 CBitFieldMaskBit48 = 0x1000000000000 CBitFieldMaskBit49 = 0x2000000000000 CBitFieldMaskBit50 = 0x4000000000000 CBitFieldMaskBit51 = 0x8000000000000 CBitFieldMaskBit52 = 0x10000000000000 CBitFieldMaskBit53 = 0x20000000000000 CBitFieldMaskBit54 = 0x40000000000000 CBitFieldMaskBit55 = 0x80000000000000 CBitFieldMaskBit56 = 0x100000000000000 CBitFieldMaskBit57 = 0x200000000000000 CBitFieldMaskBit58 = 0x400000000000000 CBitFieldMaskBit59 = 0x800000000000000 CBitFieldMaskBit60 = 0x1000000000000000 CBitFieldMaskBit61 = 0x2000000000000000 CBitFieldMaskBit62 = 0x4000000000000000 CBitFieldMaskBit63 = 0x8000000000000000 ) type SockaddrStorage struct { Family uint16 Data [122]byte _ uint32 } type HDGeometry struct { Heads uint8 Sectors uint8 Cylinders uint16 Start uint32 } type Statfs_t struct { Type int32 Bsize int32 Blocks uint64 Bfree uint64 Bavail uint64 Files uint64 Ffree uint64 Fsid Fsid Namelen int32 Frsize int32 Flags int32 Spare [4]int32 } type TpacketHdr struct { Status uint32 Len uint32 Snaplen uint32 Mac uint16 Net uint16 Sec uint32 Usec uint32 } const ( SizeofTpacketHdr = 0x18 ) type RTCPLLInfo struct { Ctrl int32 Value int32 Max int32 Min int32 Posmult int32 Negmult int32 Clock int32 } type BlkpgPartition struct { Start int64 Length int64 Pno int32 Devname [64]uint8 Volname [64]uint8 } const ( BLKPG = 0x1269 ) type CryptoUserAlg struct { Name [64]int8 Driver_name [64]int8 Module_name [64]int8 Type uint32 Mask uint32 Refcnt uint32 Flags uint32 } type CryptoStatAEAD struct { Type [64]int8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Err_cnt uint64 } type CryptoStatAKCipher struct { Type [64]int8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Verify_cnt uint64 Sign_cnt uint64 Err_cnt uint64 } type CryptoStatCipher struct { Type [64]int8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Err_cnt uint64 } type CryptoStatCompress struct { Type [64]int8 Compress_cnt uint64 Compress_tlen uint64 Decompress_cnt uint64 Decompress_tlen uint64 Err_cnt uint64 } type CryptoStatHash struct { Type [64]int8 Hash_cnt uint64 Hash_tlen uint64 Err_cnt uint64 } type CryptoStatKPP struct { Type [64]int8 Setsecret_cnt uint64 Generate_public_key_cnt uint64 Compute_shared_secret_cnt uint64 Err_cnt uint64 } type CryptoStatRNG struct { Type [64]int8 Generate_cnt uint64 Generate_tlen uint64 Seed_cnt uint64 Err_cnt uint64 } type CryptoStatLarval struct { Type [64]int8 } type CryptoReportLarval struct { Type [64]int8 } type CryptoReportHash struct { Type [64]int8 Blocksize uint32 Digestsize uint32 } type CryptoReportCipher struct { Type [64]int8 Blocksize uint32 Min_keysize uint32 Max_keysize uint32 } type CryptoReportBlkCipher struct { Type [64]int8 Geniv [64]int8 Blocksize uint32 Min_keysize uint32 Max_keysize uint32 Ivsize uint32 } type CryptoReportAEAD struct { Type [64]int8 Geniv [64]int8 Blocksize uint32 Maxauthsize uint32 Ivsize uint32 } type CryptoReportComp struct { Type [64]int8 } type CryptoReportRNG struct { Type [64]int8 Seedsize uint32 } type CryptoReportAKCipher struct { Type [64]int8 } type CryptoReportKPP struct { Type [64]int8 } type CryptoReportAcomp struct { Type [64]int8 } type LoopInfo struct { Number int32 Device uint16 Inode uint32 Rdevice uint16 Offset int32 Encrypt_type int32 Encrypt_key_size int32 Flags int32 Name [64]int8 Encrypt_key [32]uint8 Init [2]uint32 Reserved [4]int8 } type TIPCSubscr struct { Seq TIPCServiceRange Timeout uint32 Filter uint32 Handle [8]int8 } type TIPCSIOCLNReq struct { Peer uint32 Id uint32 Linkname [68]int8 } type TIPCSIOCNodeIDReq struct { Peer uint32 Id [16]int8 } type PPSKInfo struct { Assert_sequence uint32 Clear_sequence uint32 Assert_tu PPSKTime Clear_tu PPSKTime Current_mode int32 } const ( PPS_GETPARAMS = 0x800470a1 PPS_SETPARAMS = 0x400470a2 PPS_GETCAP = 0x800470a3 PPS_FETCH = 0xc00470a4 ) const ( PIDFD_NONBLOCK = 0x800 ) type SysvIpcPerm struct { Key int32 Uid uint32 Gid uint32 Cuid uint32 Cgid uint32 Mode uint16 _ [2]uint8 Seq uint16 _ uint16 _ uint32 _ uint32 } type SysvShmDesc struct { Perm SysvIpcPerm Segsz uint32 Atime uint32 Atime_high uint32 Dtime uint32 Dtime_high uint32 Ctime uint32 Ctime_high uint32 Cpid int32 Lpid int32 Nattch uint32 _ uint32 _ uint32 } ================================================ FILE: vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go ================================================ // cgo -godefs -objdir=/tmp/amd64/cgo -- -Wall -Werror -static -I/tmp/amd64/include -m64 linux/types.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build amd64 && linux package unix const ( SizeofPtr = 0x8 SizeofLong = 0x8 ) type ( _C_long int64 ) type Timespec struct { Sec int64 Nsec int64 } type Timeval struct { Sec int64 Usec int64 } type Timex struct { Modes uint32 Offset int64 Freq int64 Maxerror int64 Esterror int64 Status int32 Constant int64 Precision int64 Tolerance int64 Time Timeval Tick int64 Ppsfreq int64 Jitter int64 Shift int32 Stabil int64 Jitcnt int64 Calcnt int64 Errcnt int64 Stbcnt int64 Tai int32 _ [44]byte } type Time_t int64 type Tms struct { Utime int64 Stime int64 Cutime int64 Cstime int64 } type Utimbuf struct { Actime int64 Modtime int64 } type Rusage struct { Utime Timeval Stime Timeval Maxrss int64 Ixrss int64 Idrss int64 Isrss int64 Minflt int64 Majflt int64 Nswap int64 Inblock int64 Oublock int64 Msgsnd int64 Msgrcv int64 Nsignals int64 Nvcsw int64 Nivcsw int64 } type Stat_t struct { Dev uint64 Ino uint64 Nlink uint64 Mode uint32 Uid uint32 Gid uint32 _ int32 Rdev uint64 Size int64 Blksize int64 Blocks int64 Atim Timespec Mtim Timespec Ctim Timespec _ [3]int64 } type Dirent struct { Ino uint64 Off int64 Reclen uint16 Type uint8 Name [256]int8 _ [5]byte } type Flock_t struct { Type int16 Whence int16 Start int64 Len int64 Pid int32 _ [4]byte } type DmNameList struct { Dev uint64 Next uint32 Name [0]byte _ [4]byte } const ( FADV_DONTNEED = 0x4 FADV_NOREUSE = 0x5 ) type RawSockaddrNFCLLCP struct { Sa_family uint16 Dev_idx uint32 Target_idx uint32 Nfc_protocol uint32 Dsap uint8 Ssap uint8 Service_name [63]uint8 Service_name_len uint64 } type RawSockaddr struct { Family uint16 Data [14]int8 } type RawSockaddrAny struct { Addr RawSockaddr Pad [96]int8 } type Iovec struct { Base *byte Len uint64 } type Msghdr struct { Name *byte Namelen uint32 Iov *Iovec Iovlen uint64 Control *byte Controllen uint64 Flags int32 _ [4]byte } type Cmsghdr struct { Len uint64 Level int32 Type int32 } type ifreq struct { Ifrn [16]byte Ifru [24]byte } const ( SizeofSockaddrNFCLLCP = 0x60 SizeofIovec = 0x10 SizeofMsghdr = 0x38 SizeofCmsghdr = 0x10 ) const ( SizeofSockFprog = 0x10 ) type PtraceRegs struct { R15 uint64 R14 uint64 R13 uint64 R12 uint64 Rbp uint64 Rbx uint64 R11 uint64 R10 uint64 R9 uint64 R8 uint64 Rax uint64 Rcx uint64 Rdx uint64 Rsi uint64 Rdi uint64 Orig_rax uint64 Rip uint64 Cs uint64 Eflags uint64 Rsp uint64 Ss uint64 Fs_base uint64 Gs_base uint64 Ds uint64 Es uint64 Fs uint64 Gs uint64 } type FdSet struct { Bits [16]int64 } type Sysinfo_t struct { Uptime int64 Loads [3]uint64 Totalram uint64 Freeram uint64 Sharedram uint64 Bufferram uint64 Totalswap uint64 Freeswap uint64 Procs uint16 Pad uint16 Totalhigh uint64 Freehigh uint64 Unit uint32 _ [0]int8 _ [4]byte } type Ustat_t struct { Tfree int32 Tinode uint64 Fname [6]int8 Fpack [6]int8 _ [4]byte } type EpollEvent struct { Events uint32 Fd int32 Pad int32 } const ( OPEN_TREE_CLOEXEC = 0x80000 ) const ( POLLRDHUP = 0x2000 ) type Sigset_t struct { Val [16]uint64 } const _C__NSIG = 0x41 const ( SIG_BLOCK = 0x0 SIG_UNBLOCK = 0x1 SIG_SETMASK = 0x2 ) type Siginfo struct { Signo int32 Errno int32 Code int32 _ int32 _ [112]byte } type Termios struct { Iflag uint32 Oflag uint32 Cflag uint32 Lflag uint32 Line uint8 Cc [19]uint8 Ispeed uint32 Ospeed uint32 } type Taskstats struct { Version uint16 Ac_exitcode uint32 Ac_flag uint8 Ac_nice uint8 Cpu_count uint64 Cpu_delay_total uint64 Blkio_count uint64 Blkio_delay_total uint64 Swapin_count uint64 Swapin_delay_total uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]int8 Ac_sched uint8 Ac_pad [3]uint8 _ [4]byte Ac_uid uint32 Ac_gid uint32 Ac_pid uint32 Ac_ppid uint32 Ac_btime uint32 Ac_etime uint64 Ac_utime uint64 Ac_stime uint64 Ac_minflt uint64 Ac_majflt uint64 Coremem uint64 Virtmem uint64 Hiwater_rss uint64 Hiwater_vm uint64 Read_char uint64 Write_char uint64 Read_syscalls uint64 Write_syscalls uint64 Read_bytes uint64 Write_bytes uint64 Cancelled_write_bytes uint64 Nvcsw uint64 Nivcsw uint64 Ac_utimescaled uint64 Ac_stimescaled uint64 Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 Thrashing_count uint64 Thrashing_delay_total uint64 Ac_btime64 uint64 Compact_count uint64 Compact_delay_total uint64 Ac_tgid uint32 Ac_tgetime uint64 Ac_exe_dev uint64 Ac_exe_inode uint64 Wpcopy_count uint64 Wpcopy_delay_total uint64 Irq_count uint64 Irq_delay_total uint64 Cpu_delay_max uint64 Cpu_delay_min uint64 Blkio_delay_max uint64 Blkio_delay_min uint64 Swapin_delay_max uint64 Swapin_delay_min uint64 Freepages_delay_max uint64 Freepages_delay_min uint64 Thrashing_delay_max uint64 Thrashing_delay_min uint64 Compact_delay_max uint64 Compact_delay_min uint64 Wpcopy_delay_max uint64 Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 } type cpuMask uint64 const ( _NCPUBITS = 0x40 ) const ( CBitFieldMaskBit0 = 0x1 CBitFieldMaskBit1 = 0x2 CBitFieldMaskBit2 = 0x4 CBitFieldMaskBit3 = 0x8 CBitFieldMaskBit4 = 0x10 CBitFieldMaskBit5 = 0x20 CBitFieldMaskBit6 = 0x40 CBitFieldMaskBit7 = 0x80 CBitFieldMaskBit8 = 0x100 CBitFieldMaskBit9 = 0x200 CBitFieldMaskBit10 = 0x400 CBitFieldMaskBit11 = 0x800 CBitFieldMaskBit12 = 0x1000 CBitFieldMaskBit13 = 0x2000 CBitFieldMaskBit14 = 0x4000 CBitFieldMaskBit15 = 0x8000 CBitFieldMaskBit16 = 0x10000 CBitFieldMaskBit17 = 0x20000 CBitFieldMaskBit18 = 0x40000 CBitFieldMaskBit19 = 0x80000 CBitFieldMaskBit20 = 0x100000 CBitFieldMaskBit21 = 0x200000 CBitFieldMaskBit22 = 0x400000 CBitFieldMaskBit23 = 0x800000 CBitFieldMaskBit24 = 0x1000000 CBitFieldMaskBit25 = 0x2000000 CBitFieldMaskBit26 = 0x4000000 CBitFieldMaskBit27 = 0x8000000 CBitFieldMaskBit28 = 0x10000000 CBitFieldMaskBit29 = 0x20000000 CBitFieldMaskBit30 = 0x40000000 CBitFieldMaskBit31 = 0x80000000 CBitFieldMaskBit32 = 0x100000000 CBitFieldMaskBit33 = 0x200000000 CBitFieldMaskBit34 = 0x400000000 CBitFieldMaskBit35 = 0x800000000 CBitFieldMaskBit36 = 0x1000000000 CBitFieldMaskBit37 = 0x2000000000 CBitFieldMaskBit38 = 0x4000000000 CBitFieldMaskBit39 = 0x8000000000 CBitFieldMaskBit40 = 0x10000000000 CBitFieldMaskBit41 = 0x20000000000 CBitFieldMaskBit42 = 0x40000000000 CBitFieldMaskBit43 = 0x80000000000 CBitFieldMaskBit44 = 0x100000000000 CBitFieldMaskBit45 = 0x200000000000 CBitFieldMaskBit46 = 0x400000000000 CBitFieldMaskBit47 = 0x800000000000 CBitFieldMaskBit48 = 0x1000000000000 CBitFieldMaskBit49 = 0x2000000000000 CBitFieldMaskBit50 = 0x4000000000000 CBitFieldMaskBit51 = 0x8000000000000 CBitFieldMaskBit52 = 0x10000000000000 CBitFieldMaskBit53 = 0x20000000000000 CBitFieldMaskBit54 = 0x40000000000000 CBitFieldMaskBit55 = 0x80000000000000 CBitFieldMaskBit56 = 0x100000000000000 CBitFieldMaskBit57 = 0x200000000000000 CBitFieldMaskBit58 = 0x400000000000000 CBitFieldMaskBit59 = 0x800000000000000 CBitFieldMaskBit60 = 0x1000000000000000 CBitFieldMaskBit61 = 0x2000000000000000 CBitFieldMaskBit62 = 0x4000000000000000 CBitFieldMaskBit63 = 0x8000000000000000 ) type SockaddrStorage struct { Family uint16 Data [118]byte _ uint64 } type HDGeometry struct { Heads uint8 Sectors uint8 Cylinders uint16 Start uint64 } type Statfs_t struct { Type int64 Bsize int64 Blocks uint64 Bfree uint64 Bavail uint64 Files uint64 Ffree uint64 Fsid Fsid Namelen int64 Frsize int64 Flags int64 Spare [4]int64 } type TpacketHdr struct { Status uint64 Len uint32 Snaplen uint32 Mac uint16 Net uint16 Sec uint32 Usec uint32 _ [4]byte } const ( SizeofTpacketHdr = 0x20 ) type RTCPLLInfo struct { Ctrl int32 Value int32 Max int32 Min int32 Posmult int32 Negmult int32 Clock int64 } type BlkpgPartition struct { Start int64 Length int64 Pno int32 Devname [64]uint8 Volname [64]uint8 _ [4]byte } const ( BLKPG = 0x1269 ) type CryptoUserAlg struct { Name [64]int8 Driver_name [64]int8 Module_name [64]int8 Type uint32 Mask uint32 Refcnt uint32 Flags uint32 } type CryptoStatAEAD struct { Type [64]int8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Err_cnt uint64 } type CryptoStatAKCipher struct { Type [64]int8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Verify_cnt uint64 Sign_cnt uint64 Err_cnt uint64 } type CryptoStatCipher struct { Type [64]int8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Err_cnt uint64 } type CryptoStatCompress struct { Type [64]int8 Compress_cnt uint64 Compress_tlen uint64 Decompress_cnt uint64 Decompress_tlen uint64 Err_cnt uint64 } type CryptoStatHash struct { Type [64]int8 Hash_cnt uint64 Hash_tlen uint64 Err_cnt uint64 } type CryptoStatKPP struct { Type [64]int8 Setsecret_cnt uint64 Generate_public_key_cnt uint64 Compute_shared_secret_cnt uint64 Err_cnt uint64 } type CryptoStatRNG struct { Type [64]int8 Generate_cnt uint64 Generate_tlen uint64 Seed_cnt uint64 Err_cnt uint64 } type CryptoStatLarval struct { Type [64]int8 } type CryptoReportLarval struct { Type [64]int8 } type CryptoReportHash struct { Type [64]int8 Blocksize uint32 Digestsize uint32 } type CryptoReportCipher struct { Type [64]int8 Blocksize uint32 Min_keysize uint32 Max_keysize uint32 } type CryptoReportBlkCipher struct { Type [64]int8 Geniv [64]int8 Blocksize uint32 Min_keysize uint32 Max_keysize uint32 Ivsize uint32 } type CryptoReportAEAD struct { Type [64]int8 Geniv [64]int8 Blocksize uint32 Maxauthsize uint32 Ivsize uint32 } type CryptoReportComp struct { Type [64]int8 } type CryptoReportRNG struct { Type [64]int8 Seedsize uint32 } type CryptoReportAKCipher struct { Type [64]int8 } type CryptoReportKPP struct { Type [64]int8 } type CryptoReportAcomp struct { Type [64]int8 } type LoopInfo struct { Number int32 Device uint64 Inode uint64 Rdevice uint64 Offset int32 Encrypt_type int32 Encrypt_key_size int32 Flags int32 Name [64]int8 Encrypt_key [32]uint8 Init [2]uint64 Reserved [4]int8 _ [4]byte } type TIPCSubscr struct { Seq TIPCServiceRange Timeout uint32 Filter uint32 Handle [8]int8 } type TIPCSIOCLNReq struct { Peer uint32 Id uint32 Linkname [68]int8 } type TIPCSIOCNodeIDReq struct { Peer uint32 Id [16]int8 } type PPSKInfo struct { Assert_sequence uint32 Clear_sequence uint32 Assert_tu PPSKTime Clear_tu PPSKTime Current_mode int32 _ [4]byte } const ( PPS_GETPARAMS = 0x800870a1 PPS_SETPARAMS = 0x400870a2 PPS_GETCAP = 0x800870a3 PPS_FETCH = 0xc00870a4 ) const ( PIDFD_NONBLOCK = 0x800 ) type SysvIpcPerm struct { Key int32 Uid uint32 Gid uint32 Cuid uint32 Cgid uint32 Mode uint32 _ [0]uint8 Seq uint16 _ uint16 _ uint64 _ uint64 } type SysvShmDesc struct { Perm SysvIpcPerm Segsz uint64 Atime int64 Dtime int64 Ctime int64 Cpid int32 Lpid int32 Nattch uint64 _ uint64 _ uint64 } ================================================ FILE: vendor/golang.org/x/sys/unix/ztypes_linux_arm.go ================================================ // cgo -godefs -objdir=/tmp/arm/cgo -- -Wall -Werror -static -I/tmp/arm/include linux/types.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm && linux package unix const ( SizeofPtr = 0x4 SizeofLong = 0x4 ) type ( _C_long int32 ) type Timespec struct { Sec int32 Nsec int32 } type Timeval struct { Sec int32 Usec int32 } type Timex struct { Modes uint32 Offset int32 Freq int32 Maxerror int32 Esterror int32 Status int32 Constant int32 Precision int32 Tolerance int32 Time Timeval Tick int32 Ppsfreq int32 Jitter int32 Shift int32 Stabil int32 Jitcnt int32 Calcnt int32 Errcnt int32 Stbcnt int32 Tai int32 _ [44]byte } type Time_t int32 type Tms struct { Utime int32 Stime int32 Cutime int32 Cstime int32 } type Utimbuf struct { Actime int32 Modtime int32 } type Rusage struct { Utime Timeval Stime Timeval Maxrss int32 Ixrss int32 Idrss int32 Isrss int32 Minflt int32 Majflt int32 Nswap int32 Inblock int32 Oublock int32 Msgsnd int32 Msgrcv int32 Nsignals int32 Nvcsw int32 Nivcsw int32 } type Stat_t struct { Dev uint64 _ uint16 _ uint32 Mode uint32 Nlink uint32 Uid uint32 Gid uint32 Rdev uint64 _ uint16 _ [6]byte Size int64 Blksize int32 _ [4]byte Blocks int64 Atim Timespec Mtim Timespec Ctim Timespec Ino uint64 } type Dirent struct { Ino uint64 Off int64 Reclen uint16 Type uint8 Name [256]uint8 _ [5]byte } type Flock_t struct { Type int16 Whence int16 _ [4]byte Start int64 Len int64 Pid int32 _ [4]byte } type DmNameList struct { Dev uint64 Next uint32 Name [0]byte _ [4]byte } const ( FADV_DONTNEED = 0x4 FADV_NOREUSE = 0x5 ) type RawSockaddrNFCLLCP struct { Sa_family uint16 Dev_idx uint32 Target_idx uint32 Nfc_protocol uint32 Dsap uint8 Ssap uint8 Service_name [63]uint8 Service_name_len uint32 } type RawSockaddr struct { Family uint16 Data [14]uint8 } type RawSockaddrAny struct { Addr RawSockaddr Pad [96]uint8 } type Iovec struct { Base *byte Len uint32 } type Msghdr struct { Name *byte Namelen uint32 Iov *Iovec Iovlen uint32 Control *byte Controllen uint32 Flags int32 } type Cmsghdr struct { Len uint32 Level int32 Type int32 } type ifreq struct { Ifrn [16]byte Ifru [16]byte } const ( SizeofSockaddrNFCLLCP = 0x58 SizeofIovec = 0x8 SizeofMsghdr = 0x1c SizeofCmsghdr = 0xc ) const ( SizeofSockFprog = 0x8 ) type PtraceRegs struct { Uregs [18]uint32 } type FdSet struct { Bits [32]int32 } type Sysinfo_t struct { Uptime int32 Loads [3]uint32 Totalram uint32 Freeram uint32 Sharedram uint32 Bufferram uint32 Totalswap uint32 Freeswap uint32 Procs uint16 Pad uint16 Totalhigh uint32 Freehigh uint32 Unit uint32 _ [8]uint8 } type Ustat_t struct { Tfree int32 Tinode uint32 Fname [6]uint8 Fpack [6]uint8 } type EpollEvent struct { Events uint32 PadFd int32 Fd int32 Pad int32 } const ( OPEN_TREE_CLOEXEC = 0x80000 ) const ( POLLRDHUP = 0x2000 ) type Sigset_t struct { Val [32]uint32 } const _C__NSIG = 0x41 const ( SIG_BLOCK = 0x0 SIG_UNBLOCK = 0x1 SIG_SETMASK = 0x2 ) type Siginfo struct { Signo int32 Errno int32 Code int32 _ [116]byte } type Termios struct { Iflag uint32 Oflag uint32 Cflag uint32 Lflag uint32 Line uint8 Cc [19]uint8 Ispeed uint32 Ospeed uint32 } type Taskstats struct { Version uint16 Ac_exitcode uint32 Ac_flag uint8 Ac_nice uint8 _ [6]byte Cpu_count uint64 Cpu_delay_total uint64 Blkio_count uint64 Blkio_delay_total uint64 Swapin_count uint64 Swapin_delay_total uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]uint8 Ac_sched uint8 Ac_pad [3]uint8 _ [4]byte Ac_uid uint32 Ac_gid uint32 Ac_pid uint32 Ac_ppid uint32 Ac_btime uint32 _ [4]byte Ac_etime uint64 Ac_utime uint64 Ac_stime uint64 Ac_minflt uint64 Ac_majflt uint64 Coremem uint64 Virtmem uint64 Hiwater_rss uint64 Hiwater_vm uint64 Read_char uint64 Write_char uint64 Read_syscalls uint64 Write_syscalls uint64 Read_bytes uint64 Write_bytes uint64 Cancelled_write_bytes uint64 Nvcsw uint64 Nivcsw uint64 Ac_utimescaled uint64 Ac_stimescaled uint64 Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 Thrashing_count uint64 Thrashing_delay_total uint64 Ac_btime64 uint64 Compact_count uint64 Compact_delay_total uint64 Ac_tgid uint32 _ [4]byte Ac_tgetime uint64 Ac_exe_dev uint64 Ac_exe_inode uint64 Wpcopy_count uint64 Wpcopy_delay_total uint64 Irq_count uint64 Irq_delay_total uint64 Cpu_delay_max uint64 Cpu_delay_min uint64 Blkio_delay_max uint64 Blkio_delay_min uint64 Swapin_delay_max uint64 Swapin_delay_min uint64 Freepages_delay_max uint64 Freepages_delay_min uint64 Thrashing_delay_max uint64 Thrashing_delay_min uint64 Compact_delay_max uint64 Compact_delay_min uint64 Wpcopy_delay_max uint64 Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 } type cpuMask uint32 const ( _NCPUBITS = 0x20 ) const ( CBitFieldMaskBit0 = 0x1 CBitFieldMaskBit1 = 0x2 CBitFieldMaskBit2 = 0x4 CBitFieldMaskBit3 = 0x8 CBitFieldMaskBit4 = 0x10 CBitFieldMaskBit5 = 0x20 CBitFieldMaskBit6 = 0x40 CBitFieldMaskBit7 = 0x80 CBitFieldMaskBit8 = 0x100 CBitFieldMaskBit9 = 0x200 CBitFieldMaskBit10 = 0x400 CBitFieldMaskBit11 = 0x800 CBitFieldMaskBit12 = 0x1000 CBitFieldMaskBit13 = 0x2000 CBitFieldMaskBit14 = 0x4000 CBitFieldMaskBit15 = 0x8000 CBitFieldMaskBit16 = 0x10000 CBitFieldMaskBit17 = 0x20000 CBitFieldMaskBit18 = 0x40000 CBitFieldMaskBit19 = 0x80000 CBitFieldMaskBit20 = 0x100000 CBitFieldMaskBit21 = 0x200000 CBitFieldMaskBit22 = 0x400000 CBitFieldMaskBit23 = 0x800000 CBitFieldMaskBit24 = 0x1000000 CBitFieldMaskBit25 = 0x2000000 CBitFieldMaskBit26 = 0x4000000 CBitFieldMaskBit27 = 0x8000000 CBitFieldMaskBit28 = 0x10000000 CBitFieldMaskBit29 = 0x20000000 CBitFieldMaskBit30 = 0x40000000 CBitFieldMaskBit31 = 0x80000000 CBitFieldMaskBit32 = 0x100000000 CBitFieldMaskBit33 = 0x200000000 CBitFieldMaskBit34 = 0x400000000 CBitFieldMaskBit35 = 0x800000000 CBitFieldMaskBit36 = 0x1000000000 CBitFieldMaskBit37 = 0x2000000000 CBitFieldMaskBit38 = 0x4000000000 CBitFieldMaskBit39 = 0x8000000000 CBitFieldMaskBit40 = 0x10000000000 CBitFieldMaskBit41 = 0x20000000000 CBitFieldMaskBit42 = 0x40000000000 CBitFieldMaskBit43 = 0x80000000000 CBitFieldMaskBit44 = 0x100000000000 CBitFieldMaskBit45 = 0x200000000000 CBitFieldMaskBit46 = 0x400000000000 CBitFieldMaskBit47 = 0x800000000000 CBitFieldMaskBit48 = 0x1000000000000 CBitFieldMaskBit49 = 0x2000000000000 CBitFieldMaskBit50 = 0x4000000000000 CBitFieldMaskBit51 = 0x8000000000000 CBitFieldMaskBit52 = 0x10000000000000 CBitFieldMaskBit53 = 0x20000000000000 CBitFieldMaskBit54 = 0x40000000000000 CBitFieldMaskBit55 = 0x80000000000000 CBitFieldMaskBit56 = 0x100000000000000 CBitFieldMaskBit57 = 0x200000000000000 CBitFieldMaskBit58 = 0x400000000000000 CBitFieldMaskBit59 = 0x800000000000000 CBitFieldMaskBit60 = 0x1000000000000000 CBitFieldMaskBit61 = 0x2000000000000000 CBitFieldMaskBit62 = 0x4000000000000000 CBitFieldMaskBit63 = 0x8000000000000000 ) type SockaddrStorage struct { Family uint16 Data [122]byte _ uint32 } type HDGeometry struct { Heads uint8 Sectors uint8 Cylinders uint16 Start uint32 } type Statfs_t struct { Type int32 Bsize int32 Blocks uint64 Bfree uint64 Bavail uint64 Files uint64 Ffree uint64 Fsid Fsid Namelen int32 Frsize int32 Flags int32 Spare [4]int32 _ [4]byte } type TpacketHdr struct { Status uint32 Len uint32 Snaplen uint32 Mac uint16 Net uint16 Sec uint32 Usec uint32 } const ( SizeofTpacketHdr = 0x18 ) type RTCPLLInfo struct { Ctrl int32 Value int32 Max int32 Min int32 Posmult int32 Negmult int32 Clock int32 } type BlkpgPartition struct { Start int64 Length int64 Pno int32 Devname [64]uint8 Volname [64]uint8 _ [4]byte } const ( BLKPG = 0x1269 ) type CryptoUserAlg struct { Name [64]uint8 Driver_name [64]uint8 Module_name [64]uint8 Type uint32 Mask uint32 Refcnt uint32 Flags uint32 } type CryptoStatAEAD struct { Type [64]uint8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Err_cnt uint64 } type CryptoStatAKCipher struct { Type [64]uint8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Verify_cnt uint64 Sign_cnt uint64 Err_cnt uint64 } type CryptoStatCipher struct { Type [64]uint8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Err_cnt uint64 } type CryptoStatCompress struct { Type [64]uint8 Compress_cnt uint64 Compress_tlen uint64 Decompress_cnt uint64 Decompress_tlen uint64 Err_cnt uint64 } type CryptoStatHash struct { Type [64]uint8 Hash_cnt uint64 Hash_tlen uint64 Err_cnt uint64 } type CryptoStatKPP struct { Type [64]uint8 Setsecret_cnt uint64 Generate_public_key_cnt uint64 Compute_shared_secret_cnt uint64 Err_cnt uint64 } type CryptoStatRNG struct { Type [64]uint8 Generate_cnt uint64 Generate_tlen uint64 Seed_cnt uint64 Err_cnt uint64 } type CryptoStatLarval struct { Type [64]uint8 } type CryptoReportLarval struct { Type [64]uint8 } type CryptoReportHash struct { Type [64]uint8 Blocksize uint32 Digestsize uint32 } type CryptoReportCipher struct { Type [64]uint8 Blocksize uint32 Min_keysize uint32 Max_keysize uint32 } type CryptoReportBlkCipher struct { Type [64]uint8 Geniv [64]uint8 Blocksize uint32 Min_keysize uint32 Max_keysize uint32 Ivsize uint32 } type CryptoReportAEAD struct { Type [64]uint8 Geniv [64]uint8 Blocksize uint32 Maxauthsize uint32 Ivsize uint32 } type CryptoReportComp struct { Type [64]uint8 } type CryptoReportRNG struct { Type [64]uint8 Seedsize uint32 } type CryptoReportAKCipher struct { Type [64]uint8 } type CryptoReportKPP struct { Type [64]uint8 } type CryptoReportAcomp struct { Type [64]uint8 } type LoopInfo struct { Number int32 Device uint16 Inode uint32 Rdevice uint16 Offset int32 Encrypt_type int32 Encrypt_key_size int32 Flags int32 Name [64]uint8 Encrypt_key [32]uint8 Init [2]uint32 Reserved [4]uint8 } type TIPCSubscr struct { Seq TIPCServiceRange Timeout uint32 Filter uint32 Handle [8]uint8 } type TIPCSIOCLNReq struct { Peer uint32 Id uint32 Linkname [68]uint8 } type TIPCSIOCNodeIDReq struct { Peer uint32 Id [16]uint8 } type PPSKInfo struct { Assert_sequence uint32 Clear_sequence uint32 Assert_tu PPSKTime Clear_tu PPSKTime Current_mode int32 _ [4]byte } const ( PPS_GETPARAMS = 0x800470a1 PPS_SETPARAMS = 0x400470a2 PPS_GETCAP = 0x800470a3 PPS_FETCH = 0xc00470a4 ) const ( PIDFD_NONBLOCK = 0x800 ) type SysvIpcPerm struct { Key int32 Uid uint32 Gid uint32 Cuid uint32 Cgid uint32 Mode uint16 _ [2]uint8 Seq uint16 _ uint16 _ uint32 _ uint32 } type SysvShmDesc struct { Perm SysvIpcPerm Segsz uint32 Atime uint32 Atime_high uint32 Dtime uint32 Dtime_high uint32 Ctime uint32 Ctime_high uint32 Cpid int32 Lpid int32 Nattch uint32 _ uint32 _ uint32 } ================================================ FILE: vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go ================================================ // cgo -godefs -objdir=/tmp/arm64/cgo -- -Wall -Werror -static -I/tmp/arm64/include -fsigned-char linux/types.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm64 && linux package unix const ( SizeofPtr = 0x8 SizeofLong = 0x8 ) type ( _C_long int64 ) type Timespec struct { Sec int64 Nsec int64 } type Timeval struct { Sec int64 Usec int64 } type Timex struct { Modes uint32 Offset int64 Freq int64 Maxerror int64 Esterror int64 Status int32 Constant int64 Precision int64 Tolerance int64 Time Timeval Tick int64 Ppsfreq int64 Jitter int64 Shift int32 Stabil int64 Jitcnt int64 Calcnt int64 Errcnt int64 Stbcnt int64 Tai int32 _ [44]byte } type Time_t int64 type Tms struct { Utime int64 Stime int64 Cutime int64 Cstime int64 } type Utimbuf struct { Actime int64 Modtime int64 } type Rusage struct { Utime Timeval Stime Timeval Maxrss int64 Ixrss int64 Idrss int64 Isrss int64 Minflt int64 Majflt int64 Nswap int64 Inblock int64 Oublock int64 Msgsnd int64 Msgrcv int64 Nsignals int64 Nvcsw int64 Nivcsw int64 } type Stat_t struct { Dev uint64 Ino uint64 Mode uint32 Nlink uint32 Uid uint32 Gid uint32 Rdev uint64 _ uint64 Size int64 Blksize int32 _ int32 Blocks int64 Atim Timespec Mtim Timespec Ctim Timespec _ [2]int32 } type Dirent struct { Ino uint64 Off int64 Reclen uint16 Type uint8 Name [256]int8 _ [5]byte } type Flock_t struct { Type int16 Whence int16 Start int64 Len int64 Pid int32 _ [4]byte } type DmNameList struct { Dev uint64 Next uint32 Name [0]byte _ [4]byte } const ( FADV_DONTNEED = 0x4 FADV_NOREUSE = 0x5 ) type RawSockaddrNFCLLCP struct { Sa_family uint16 Dev_idx uint32 Target_idx uint32 Nfc_protocol uint32 Dsap uint8 Ssap uint8 Service_name [63]uint8 Service_name_len uint64 } type RawSockaddr struct { Family uint16 Data [14]int8 } type RawSockaddrAny struct { Addr RawSockaddr Pad [96]int8 } type Iovec struct { Base *byte Len uint64 } type Msghdr struct { Name *byte Namelen uint32 Iov *Iovec Iovlen uint64 Control *byte Controllen uint64 Flags int32 _ [4]byte } type Cmsghdr struct { Len uint64 Level int32 Type int32 } type ifreq struct { Ifrn [16]byte Ifru [24]byte } const ( SizeofSockaddrNFCLLCP = 0x60 SizeofIovec = 0x10 SizeofMsghdr = 0x38 SizeofCmsghdr = 0x10 ) const ( SizeofSockFprog = 0x10 ) type PtraceRegs struct { Regs [31]uint64 Sp uint64 Pc uint64 Pstate uint64 } type FdSet struct { Bits [16]int64 } type Sysinfo_t struct { Uptime int64 Loads [3]uint64 Totalram uint64 Freeram uint64 Sharedram uint64 Bufferram uint64 Totalswap uint64 Freeswap uint64 Procs uint16 Pad uint16 Totalhigh uint64 Freehigh uint64 Unit uint32 _ [0]int8 _ [4]byte } type Ustat_t struct { Tfree int32 Tinode uint64 Fname [6]int8 Fpack [6]int8 _ [4]byte } type EpollEvent struct { Events uint32 PadFd int32 Fd int32 Pad int32 } const ( OPEN_TREE_CLOEXEC = 0x80000 ) const ( POLLRDHUP = 0x2000 ) type Sigset_t struct { Val [16]uint64 } const _C__NSIG = 0x41 const ( SIG_BLOCK = 0x0 SIG_UNBLOCK = 0x1 SIG_SETMASK = 0x2 ) type Siginfo struct { Signo int32 Errno int32 Code int32 _ int32 _ [112]byte } type Termios struct { Iflag uint32 Oflag uint32 Cflag uint32 Lflag uint32 Line uint8 Cc [19]uint8 Ispeed uint32 Ospeed uint32 } type Taskstats struct { Version uint16 Ac_exitcode uint32 Ac_flag uint8 Ac_nice uint8 Cpu_count uint64 Cpu_delay_total uint64 Blkio_count uint64 Blkio_delay_total uint64 Swapin_count uint64 Swapin_delay_total uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]int8 Ac_sched uint8 Ac_pad [3]uint8 _ [4]byte Ac_uid uint32 Ac_gid uint32 Ac_pid uint32 Ac_ppid uint32 Ac_btime uint32 Ac_etime uint64 Ac_utime uint64 Ac_stime uint64 Ac_minflt uint64 Ac_majflt uint64 Coremem uint64 Virtmem uint64 Hiwater_rss uint64 Hiwater_vm uint64 Read_char uint64 Write_char uint64 Read_syscalls uint64 Write_syscalls uint64 Read_bytes uint64 Write_bytes uint64 Cancelled_write_bytes uint64 Nvcsw uint64 Nivcsw uint64 Ac_utimescaled uint64 Ac_stimescaled uint64 Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 Thrashing_count uint64 Thrashing_delay_total uint64 Ac_btime64 uint64 Compact_count uint64 Compact_delay_total uint64 Ac_tgid uint32 Ac_tgetime uint64 Ac_exe_dev uint64 Ac_exe_inode uint64 Wpcopy_count uint64 Wpcopy_delay_total uint64 Irq_count uint64 Irq_delay_total uint64 Cpu_delay_max uint64 Cpu_delay_min uint64 Blkio_delay_max uint64 Blkio_delay_min uint64 Swapin_delay_max uint64 Swapin_delay_min uint64 Freepages_delay_max uint64 Freepages_delay_min uint64 Thrashing_delay_max uint64 Thrashing_delay_min uint64 Compact_delay_max uint64 Compact_delay_min uint64 Wpcopy_delay_max uint64 Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 } type cpuMask uint64 const ( _NCPUBITS = 0x40 ) const ( CBitFieldMaskBit0 = 0x1 CBitFieldMaskBit1 = 0x2 CBitFieldMaskBit2 = 0x4 CBitFieldMaskBit3 = 0x8 CBitFieldMaskBit4 = 0x10 CBitFieldMaskBit5 = 0x20 CBitFieldMaskBit6 = 0x40 CBitFieldMaskBit7 = 0x80 CBitFieldMaskBit8 = 0x100 CBitFieldMaskBit9 = 0x200 CBitFieldMaskBit10 = 0x400 CBitFieldMaskBit11 = 0x800 CBitFieldMaskBit12 = 0x1000 CBitFieldMaskBit13 = 0x2000 CBitFieldMaskBit14 = 0x4000 CBitFieldMaskBit15 = 0x8000 CBitFieldMaskBit16 = 0x10000 CBitFieldMaskBit17 = 0x20000 CBitFieldMaskBit18 = 0x40000 CBitFieldMaskBit19 = 0x80000 CBitFieldMaskBit20 = 0x100000 CBitFieldMaskBit21 = 0x200000 CBitFieldMaskBit22 = 0x400000 CBitFieldMaskBit23 = 0x800000 CBitFieldMaskBit24 = 0x1000000 CBitFieldMaskBit25 = 0x2000000 CBitFieldMaskBit26 = 0x4000000 CBitFieldMaskBit27 = 0x8000000 CBitFieldMaskBit28 = 0x10000000 CBitFieldMaskBit29 = 0x20000000 CBitFieldMaskBit30 = 0x40000000 CBitFieldMaskBit31 = 0x80000000 CBitFieldMaskBit32 = 0x100000000 CBitFieldMaskBit33 = 0x200000000 CBitFieldMaskBit34 = 0x400000000 CBitFieldMaskBit35 = 0x800000000 CBitFieldMaskBit36 = 0x1000000000 CBitFieldMaskBit37 = 0x2000000000 CBitFieldMaskBit38 = 0x4000000000 CBitFieldMaskBit39 = 0x8000000000 CBitFieldMaskBit40 = 0x10000000000 CBitFieldMaskBit41 = 0x20000000000 CBitFieldMaskBit42 = 0x40000000000 CBitFieldMaskBit43 = 0x80000000000 CBitFieldMaskBit44 = 0x100000000000 CBitFieldMaskBit45 = 0x200000000000 CBitFieldMaskBit46 = 0x400000000000 CBitFieldMaskBit47 = 0x800000000000 CBitFieldMaskBit48 = 0x1000000000000 CBitFieldMaskBit49 = 0x2000000000000 CBitFieldMaskBit50 = 0x4000000000000 CBitFieldMaskBit51 = 0x8000000000000 CBitFieldMaskBit52 = 0x10000000000000 CBitFieldMaskBit53 = 0x20000000000000 CBitFieldMaskBit54 = 0x40000000000000 CBitFieldMaskBit55 = 0x80000000000000 CBitFieldMaskBit56 = 0x100000000000000 CBitFieldMaskBit57 = 0x200000000000000 CBitFieldMaskBit58 = 0x400000000000000 CBitFieldMaskBit59 = 0x800000000000000 CBitFieldMaskBit60 = 0x1000000000000000 CBitFieldMaskBit61 = 0x2000000000000000 CBitFieldMaskBit62 = 0x4000000000000000 CBitFieldMaskBit63 = 0x8000000000000000 ) type SockaddrStorage struct { Family uint16 Data [118]byte _ uint64 } type HDGeometry struct { Heads uint8 Sectors uint8 Cylinders uint16 Start uint64 } type Statfs_t struct { Type int64 Bsize int64 Blocks uint64 Bfree uint64 Bavail uint64 Files uint64 Ffree uint64 Fsid Fsid Namelen int64 Frsize int64 Flags int64 Spare [4]int64 } type TpacketHdr struct { Status uint64 Len uint32 Snaplen uint32 Mac uint16 Net uint16 Sec uint32 Usec uint32 _ [4]byte } const ( SizeofTpacketHdr = 0x20 ) type RTCPLLInfo struct { Ctrl int32 Value int32 Max int32 Min int32 Posmult int32 Negmult int32 Clock int64 } type BlkpgPartition struct { Start int64 Length int64 Pno int32 Devname [64]uint8 Volname [64]uint8 _ [4]byte } const ( BLKPG = 0x1269 ) type CryptoUserAlg struct { Name [64]int8 Driver_name [64]int8 Module_name [64]int8 Type uint32 Mask uint32 Refcnt uint32 Flags uint32 } type CryptoStatAEAD struct { Type [64]int8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Err_cnt uint64 } type CryptoStatAKCipher struct { Type [64]int8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Verify_cnt uint64 Sign_cnt uint64 Err_cnt uint64 } type CryptoStatCipher struct { Type [64]int8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Err_cnt uint64 } type CryptoStatCompress struct { Type [64]int8 Compress_cnt uint64 Compress_tlen uint64 Decompress_cnt uint64 Decompress_tlen uint64 Err_cnt uint64 } type CryptoStatHash struct { Type [64]int8 Hash_cnt uint64 Hash_tlen uint64 Err_cnt uint64 } type CryptoStatKPP struct { Type [64]int8 Setsecret_cnt uint64 Generate_public_key_cnt uint64 Compute_shared_secret_cnt uint64 Err_cnt uint64 } type CryptoStatRNG struct { Type [64]int8 Generate_cnt uint64 Generate_tlen uint64 Seed_cnt uint64 Err_cnt uint64 } type CryptoStatLarval struct { Type [64]int8 } type CryptoReportLarval struct { Type [64]int8 } type CryptoReportHash struct { Type [64]int8 Blocksize uint32 Digestsize uint32 } type CryptoReportCipher struct { Type [64]int8 Blocksize uint32 Min_keysize uint32 Max_keysize uint32 } type CryptoReportBlkCipher struct { Type [64]int8 Geniv [64]int8 Blocksize uint32 Min_keysize uint32 Max_keysize uint32 Ivsize uint32 } type CryptoReportAEAD struct { Type [64]int8 Geniv [64]int8 Blocksize uint32 Maxauthsize uint32 Ivsize uint32 } type CryptoReportComp struct { Type [64]int8 } type CryptoReportRNG struct { Type [64]int8 Seedsize uint32 } type CryptoReportAKCipher struct { Type [64]int8 } type CryptoReportKPP struct { Type [64]int8 } type CryptoReportAcomp struct { Type [64]int8 } type LoopInfo struct { Number int32 Device uint32 Inode uint64 Rdevice uint32 Offset int32 Encrypt_type int32 Encrypt_key_size int32 Flags int32 Name [64]int8 Encrypt_key [32]uint8 Init [2]uint64 Reserved [4]int8 _ [4]byte } type TIPCSubscr struct { Seq TIPCServiceRange Timeout uint32 Filter uint32 Handle [8]int8 } type TIPCSIOCLNReq struct { Peer uint32 Id uint32 Linkname [68]int8 } type TIPCSIOCNodeIDReq struct { Peer uint32 Id [16]int8 } type PPSKInfo struct { Assert_sequence uint32 Clear_sequence uint32 Assert_tu PPSKTime Clear_tu PPSKTime Current_mode int32 _ [4]byte } const ( PPS_GETPARAMS = 0x800870a1 PPS_SETPARAMS = 0x400870a2 PPS_GETCAP = 0x800870a3 PPS_FETCH = 0xc00870a4 ) const ( PIDFD_NONBLOCK = 0x800 ) type SysvIpcPerm struct { Key int32 Uid uint32 Gid uint32 Cuid uint32 Cgid uint32 Mode uint32 _ [0]uint8 Seq uint16 _ uint16 _ uint64 _ uint64 } type SysvShmDesc struct { Perm SysvIpcPerm Segsz uint64 Atime int64 Dtime int64 Ctime int64 Cpid int32 Lpid int32 Nattch uint64 _ uint64 _ uint64 } ================================================ FILE: vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go ================================================ // cgo -godefs -objdir=/tmp/loong64/cgo -- -Wall -Werror -static -I/tmp/loong64/include linux/types.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build loong64 && linux package unix const ( SizeofPtr = 0x8 SizeofLong = 0x8 ) type ( _C_long int64 ) type Timespec struct { Sec int64 Nsec int64 } type Timeval struct { Sec int64 Usec int64 } type Timex struct { Modes uint32 Offset int64 Freq int64 Maxerror int64 Esterror int64 Status int32 Constant int64 Precision int64 Tolerance int64 Time Timeval Tick int64 Ppsfreq int64 Jitter int64 Shift int32 Stabil int64 Jitcnt int64 Calcnt int64 Errcnt int64 Stbcnt int64 Tai int32 _ [44]byte } type Time_t int64 type Tms struct { Utime int64 Stime int64 Cutime int64 Cstime int64 } type Utimbuf struct { Actime int64 Modtime int64 } type Rusage struct { Utime Timeval Stime Timeval Maxrss int64 Ixrss int64 Idrss int64 Isrss int64 Minflt int64 Majflt int64 Nswap int64 Inblock int64 Oublock int64 Msgsnd int64 Msgrcv int64 Nsignals int64 Nvcsw int64 Nivcsw int64 } type Stat_t struct { Dev uint64 Ino uint64 Mode uint32 Nlink uint32 Uid uint32 Gid uint32 Rdev uint64 _ uint64 Size int64 Blksize int32 _ int32 Blocks int64 Atim Timespec Mtim Timespec Ctim Timespec _ [2]int32 } type Dirent struct { Ino uint64 Off int64 Reclen uint16 Type uint8 Name [256]int8 _ [5]byte } type Flock_t struct { Type int16 Whence int16 Start int64 Len int64 Pid int32 _ [4]byte } type DmNameList struct { Dev uint64 Next uint32 Name [0]byte _ [4]byte } const ( FADV_DONTNEED = 0x4 FADV_NOREUSE = 0x5 ) type RawSockaddrNFCLLCP struct { Sa_family uint16 Dev_idx uint32 Target_idx uint32 Nfc_protocol uint32 Dsap uint8 Ssap uint8 Service_name [63]uint8 Service_name_len uint64 } type RawSockaddr struct { Family uint16 Data [14]int8 } type RawSockaddrAny struct { Addr RawSockaddr Pad [96]int8 } type Iovec struct { Base *byte Len uint64 } type Msghdr struct { Name *byte Namelen uint32 Iov *Iovec Iovlen uint64 Control *byte Controllen uint64 Flags int32 _ [4]byte } type Cmsghdr struct { Len uint64 Level int32 Type int32 } type ifreq struct { Ifrn [16]byte Ifru [24]byte } const ( SizeofSockaddrNFCLLCP = 0x60 SizeofIovec = 0x10 SizeofMsghdr = 0x38 SizeofCmsghdr = 0x10 ) const ( SizeofSockFprog = 0x10 ) type PtraceRegs struct { Regs [32]uint64 Orig_a0 uint64 Era uint64 Badv uint64 Reserved [10]uint64 } type FdSet struct { Bits [16]int64 } type Sysinfo_t struct { Uptime int64 Loads [3]uint64 Totalram uint64 Freeram uint64 Sharedram uint64 Bufferram uint64 Totalswap uint64 Freeswap uint64 Procs uint16 Pad uint16 Totalhigh uint64 Freehigh uint64 Unit uint32 _ [0]int8 _ [4]byte } type Ustat_t struct { Tfree int32 Tinode uint64 Fname [6]int8 Fpack [6]int8 _ [4]byte } type EpollEvent struct { Events uint32 _ int32 Fd int32 Pad int32 } const ( OPEN_TREE_CLOEXEC = 0x80000 ) const ( POLLRDHUP = 0x2000 ) type Sigset_t struct { Val [16]uint64 } const _C__NSIG = 0x41 const ( SIG_BLOCK = 0x0 SIG_UNBLOCK = 0x1 SIG_SETMASK = 0x2 ) type Siginfo struct { Signo int32 Errno int32 Code int32 _ int32 _ [112]byte } type Termios struct { Iflag uint32 Oflag uint32 Cflag uint32 Lflag uint32 Line uint8 Cc [19]uint8 Ispeed uint32 Ospeed uint32 } type Taskstats struct { Version uint16 Ac_exitcode uint32 Ac_flag uint8 Ac_nice uint8 Cpu_count uint64 Cpu_delay_total uint64 Blkio_count uint64 Blkio_delay_total uint64 Swapin_count uint64 Swapin_delay_total uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]int8 Ac_sched uint8 Ac_pad [3]uint8 _ [4]byte Ac_uid uint32 Ac_gid uint32 Ac_pid uint32 Ac_ppid uint32 Ac_btime uint32 Ac_etime uint64 Ac_utime uint64 Ac_stime uint64 Ac_minflt uint64 Ac_majflt uint64 Coremem uint64 Virtmem uint64 Hiwater_rss uint64 Hiwater_vm uint64 Read_char uint64 Write_char uint64 Read_syscalls uint64 Write_syscalls uint64 Read_bytes uint64 Write_bytes uint64 Cancelled_write_bytes uint64 Nvcsw uint64 Nivcsw uint64 Ac_utimescaled uint64 Ac_stimescaled uint64 Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 Thrashing_count uint64 Thrashing_delay_total uint64 Ac_btime64 uint64 Compact_count uint64 Compact_delay_total uint64 Ac_tgid uint32 Ac_tgetime uint64 Ac_exe_dev uint64 Ac_exe_inode uint64 Wpcopy_count uint64 Wpcopy_delay_total uint64 Irq_count uint64 Irq_delay_total uint64 Cpu_delay_max uint64 Cpu_delay_min uint64 Blkio_delay_max uint64 Blkio_delay_min uint64 Swapin_delay_max uint64 Swapin_delay_min uint64 Freepages_delay_max uint64 Freepages_delay_min uint64 Thrashing_delay_max uint64 Thrashing_delay_min uint64 Compact_delay_max uint64 Compact_delay_min uint64 Wpcopy_delay_max uint64 Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 } type cpuMask uint64 const ( _NCPUBITS = 0x40 ) const ( CBitFieldMaskBit0 = 0x1 CBitFieldMaskBit1 = 0x2 CBitFieldMaskBit2 = 0x4 CBitFieldMaskBit3 = 0x8 CBitFieldMaskBit4 = 0x10 CBitFieldMaskBit5 = 0x20 CBitFieldMaskBit6 = 0x40 CBitFieldMaskBit7 = 0x80 CBitFieldMaskBit8 = 0x100 CBitFieldMaskBit9 = 0x200 CBitFieldMaskBit10 = 0x400 CBitFieldMaskBit11 = 0x800 CBitFieldMaskBit12 = 0x1000 CBitFieldMaskBit13 = 0x2000 CBitFieldMaskBit14 = 0x4000 CBitFieldMaskBit15 = 0x8000 CBitFieldMaskBit16 = 0x10000 CBitFieldMaskBit17 = 0x20000 CBitFieldMaskBit18 = 0x40000 CBitFieldMaskBit19 = 0x80000 CBitFieldMaskBit20 = 0x100000 CBitFieldMaskBit21 = 0x200000 CBitFieldMaskBit22 = 0x400000 CBitFieldMaskBit23 = 0x800000 CBitFieldMaskBit24 = 0x1000000 CBitFieldMaskBit25 = 0x2000000 CBitFieldMaskBit26 = 0x4000000 CBitFieldMaskBit27 = 0x8000000 CBitFieldMaskBit28 = 0x10000000 CBitFieldMaskBit29 = 0x20000000 CBitFieldMaskBit30 = 0x40000000 CBitFieldMaskBit31 = 0x80000000 CBitFieldMaskBit32 = 0x100000000 CBitFieldMaskBit33 = 0x200000000 CBitFieldMaskBit34 = 0x400000000 CBitFieldMaskBit35 = 0x800000000 CBitFieldMaskBit36 = 0x1000000000 CBitFieldMaskBit37 = 0x2000000000 CBitFieldMaskBit38 = 0x4000000000 CBitFieldMaskBit39 = 0x8000000000 CBitFieldMaskBit40 = 0x10000000000 CBitFieldMaskBit41 = 0x20000000000 CBitFieldMaskBit42 = 0x40000000000 CBitFieldMaskBit43 = 0x80000000000 CBitFieldMaskBit44 = 0x100000000000 CBitFieldMaskBit45 = 0x200000000000 CBitFieldMaskBit46 = 0x400000000000 CBitFieldMaskBit47 = 0x800000000000 CBitFieldMaskBit48 = 0x1000000000000 CBitFieldMaskBit49 = 0x2000000000000 CBitFieldMaskBit50 = 0x4000000000000 CBitFieldMaskBit51 = 0x8000000000000 CBitFieldMaskBit52 = 0x10000000000000 CBitFieldMaskBit53 = 0x20000000000000 CBitFieldMaskBit54 = 0x40000000000000 CBitFieldMaskBit55 = 0x80000000000000 CBitFieldMaskBit56 = 0x100000000000000 CBitFieldMaskBit57 = 0x200000000000000 CBitFieldMaskBit58 = 0x400000000000000 CBitFieldMaskBit59 = 0x800000000000000 CBitFieldMaskBit60 = 0x1000000000000000 CBitFieldMaskBit61 = 0x2000000000000000 CBitFieldMaskBit62 = 0x4000000000000000 CBitFieldMaskBit63 = 0x8000000000000000 ) type SockaddrStorage struct { Family uint16 Data [118]byte _ uint64 } type HDGeometry struct { Heads uint8 Sectors uint8 Cylinders uint16 Start uint64 } type Statfs_t struct { Type int64 Bsize int64 Blocks uint64 Bfree uint64 Bavail uint64 Files uint64 Ffree uint64 Fsid Fsid Namelen int64 Frsize int64 Flags int64 Spare [4]int64 } type TpacketHdr struct { Status uint64 Len uint32 Snaplen uint32 Mac uint16 Net uint16 Sec uint32 Usec uint32 _ [4]byte } const ( SizeofTpacketHdr = 0x20 ) type RTCPLLInfo struct { Ctrl int32 Value int32 Max int32 Min int32 Posmult int32 Negmult int32 Clock int64 } type BlkpgPartition struct { Start int64 Length int64 Pno int32 Devname [64]uint8 Volname [64]uint8 _ [4]byte } const ( BLKPG = 0x1269 ) type CryptoUserAlg struct { Name [64]int8 Driver_name [64]int8 Module_name [64]int8 Type uint32 Mask uint32 Refcnt uint32 Flags uint32 } type CryptoStatAEAD struct { Type [64]int8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Err_cnt uint64 } type CryptoStatAKCipher struct { Type [64]int8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Verify_cnt uint64 Sign_cnt uint64 Err_cnt uint64 } type CryptoStatCipher struct { Type [64]int8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Err_cnt uint64 } type CryptoStatCompress struct { Type [64]int8 Compress_cnt uint64 Compress_tlen uint64 Decompress_cnt uint64 Decompress_tlen uint64 Err_cnt uint64 } type CryptoStatHash struct { Type [64]int8 Hash_cnt uint64 Hash_tlen uint64 Err_cnt uint64 } type CryptoStatKPP struct { Type [64]int8 Setsecret_cnt uint64 Generate_public_key_cnt uint64 Compute_shared_secret_cnt uint64 Err_cnt uint64 } type CryptoStatRNG struct { Type [64]int8 Generate_cnt uint64 Generate_tlen uint64 Seed_cnt uint64 Err_cnt uint64 } type CryptoStatLarval struct { Type [64]int8 } type CryptoReportLarval struct { Type [64]int8 } type CryptoReportHash struct { Type [64]int8 Blocksize uint32 Digestsize uint32 } type CryptoReportCipher struct { Type [64]int8 Blocksize uint32 Min_keysize uint32 Max_keysize uint32 } type CryptoReportBlkCipher struct { Type [64]int8 Geniv [64]int8 Blocksize uint32 Min_keysize uint32 Max_keysize uint32 Ivsize uint32 } type CryptoReportAEAD struct { Type [64]int8 Geniv [64]int8 Blocksize uint32 Maxauthsize uint32 Ivsize uint32 } type CryptoReportComp struct { Type [64]int8 } type CryptoReportRNG struct { Type [64]int8 Seedsize uint32 } type CryptoReportAKCipher struct { Type [64]int8 } type CryptoReportKPP struct { Type [64]int8 } type CryptoReportAcomp struct { Type [64]int8 } type LoopInfo struct { Number int32 Device uint32 Inode uint64 Rdevice uint32 Offset int32 Encrypt_type int32 Encrypt_key_size int32 Flags int32 Name [64]int8 Encrypt_key [32]uint8 Init [2]uint64 Reserved [4]int8 _ [4]byte } type TIPCSubscr struct { Seq TIPCServiceRange Timeout uint32 Filter uint32 Handle [8]int8 } type TIPCSIOCLNReq struct { Peer uint32 Id uint32 Linkname [68]int8 } type TIPCSIOCNodeIDReq struct { Peer uint32 Id [16]int8 } type PPSKInfo struct { Assert_sequence uint32 Clear_sequence uint32 Assert_tu PPSKTime Clear_tu PPSKTime Current_mode int32 _ [4]byte } const ( PPS_GETPARAMS = 0x800870a1 PPS_SETPARAMS = 0x400870a2 PPS_GETCAP = 0x800870a3 PPS_FETCH = 0xc00870a4 ) const ( PIDFD_NONBLOCK = 0x800 ) type SysvIpcPerm struct { Key int32 Uid uint32 Gid uint32 Cuid uint32 Cgid uint32 Mode uint32 _ [0]uint8 Seq uint16 _ uint16 _ uint64 _ uint64 } type SysvShmDesc struct { Perm SysvIpcPerm Segsz uint64 Atime int64 Dtime int64 Ctime int64 Cpid int32 Lpid int32 Nattch uint64 _ uint64 _ uint64 } ================================================ FILE: vendor/golang.org/x/sys/unix/ztypes_linux_mips.go ================================================ // cgo -godefs -objdir=/tmp/mips/cgo -- -Wall -Werror -static -I/tmp/mips/include linux/types.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build mips && linux package unix const ( SizeofPtr = 0x4 SizeofLong = 0x4 ) type ( _C_long int32 ) type Timespec struct { Sec int32 Nsec int32 } type Timeval struct { Sec int32 Usec int32 } type Timex struct { Modes uint32 Offset int32 Freq int32 Maxerror int32 Esterror int32 Status int32 Constant int32 Precision int32 Tolerance int32 Time Timeval Tick int32 Ppsfreq int32 Jitter int32 Shift int32 Stabil int32 Jitcnt int32 Calcnt int32 Errcnt int32 Stbcnt int32 Tai int32 _ [44]byte } type Time_t int32 type Tms struct { Utime int32 Stime int32 Cutime int32 Cstime int32 } type Utimbuf struct { Actime int32 Modtime int32 } type Rusage struct { Utime Timeval Stime Timeval Maxrss int32 Ixrss int32 Idrss int32 Isrss int32 Minflt int32 Majflt int32 Nswap int32 Inblock int32 Oublock int32 Msgsnd int32 Msgrcv int32 Nsignals int32 Nvcsw int32 Nivcsw int32 } type Stat_t struct { Dev uint32 Pad1 [3]int32 Ino uint64 Mode uint32 Nlink uint32 Uid uint32 Gid uint32 Rdev uint32 Pad2 [3]int32 Size int64 Atim Timespec Mtim Timespec Ctim Timespec Blksize int32 Pad4 int32 Blocks int64 Pad5 [14]int32 } type Dirent struct { Ino uint64 Off int64 Reclen uint16 Type uint8 Name [256]int8 _ [5]byte } type Flock_t struct { Type int16 Whence int16 _ [4]byte Start int64 Len int64 Pid int32 _ [4]byte } type DmNameList struct { Dev uint64 Next uint32 Name [0]byte _ [4]byte } const ( FADV_DONTNEED = 0x4 FADV_NOREUSE = 0x5 ) type RawSockaddrNFCLLCP struct { Sa_family uint16 Dev_idx uint32 Target_idx uint32 Nfc_protocol uint32 Dsap uint8 Ssap uint8 Service_name [63]uint8 Service_name_len uint32 } type RawSockaddr struct { Family uint16 Data [14]int8 } type RawSockaddrAny struct { Addr RawSockaddr Pad [96]int8 } type Iovec struct { Base *byte Len uint32 } type Msghdr struct { Name *byte Namelen uint32 Iov *Iovec Iovlen uint32 Control *byte Controllen uint32 Flags int32 } type Cmsghdr struct { Len uint32 Level int32 Type int32 } type ifreq struct { Ifrn [16]byte Ifru [16]byte } const ( SizeofSockaddrNFCLLCP = 0x58 SizeofIovec = 0x8 SizeofMsghdr = 0x1c SizeofCmsghdr = 0xc ) const ( SizeofSockFprog = 0x8 ) type PtraceRegs struct { Regs [32]uint64 Lo uint64 Hi uint64 Epc uint64 Badvaddr uint64 Status uint64 Cause uint64 } type FdSet struct { Bits [32]int32 } type Sysinfo_t struct { Uptime int32 Loads [3]uint32 Totalram uint32 Freeram uint32 Sharedram uint32 Bufferram uint32 Totalswap uint32 Freeswap uint32 Procs uint16 Pad uint16 Totalhigh uint32 Freehigh uint32 Unit uint32 _ [8]int8 } type Ustat_t struct { Tfree int32 Tinode uint32 Fname [6]int8 Fpack [6]int8 } type EpollEvent struct { Events uint32 PadFd int32 Fd int32 Pad int32 } const ( OPEN_TREE_CLOEXEC = 0x80000 ) const ( POLLRDHUP = 0x2000 ) type Sigset_t struct { Val [32]uint32 } const _C__NSIG = 0x80 const ( SIG_BLOCK = 0x1 SIG_UNBLOCK = 0x2 SIG_SETMASK = 0x3 ) type Siginfo struct { Signo int32 Code int32 Errno int32 _ [116]byte } type Termios struct { Iflag uint32 Oflag uint32 Cflag uint32 Lflag uint32 Line uint8 Cc [23]uint8 Ispeed uint32 Ospeed uint32 } type Taskstats struct { Version uint16 Ac_exitcode uint32 Ac_flag uint8 Ac_nice uint8 _ [6]byte Cpu_count uint64 Cpu_delay_total uint64 Blkio_count uint64 Blkio_delay_total uint64 Swapin_count uint64 Swapin_delay_total uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]int8 Ac_sched uint8 Ac_pad [3]uint8 _ [4]byte Ac_uid uint32 Ac_gid uint32 Ac_pid uint32 Ac_ppid uint32 Ac_btime uint32 _ [4]byte Ac_etime uint64 Ac_utime uint64 Ac_stime uint64 Ac_minflt uint64 Ac_majflt uint64 Coremem uint64 Virtmem uint64 Hiwater_rss uint64 Hiwater_vm uint64 Read_char uint64 Write_char uint64 Read_syscalls uint64 Write_syscalls uint64 Read_bytes uint64 Write_bytes uint64 Cancelled_write_bytes uint64 Nvcsw uint64 Nivcsw uint64 Ac_utimescaled uint64 Ac_stimescaled uint64 Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 Thrashing_count uint64 Thrashing_delay_total uint64 Ac_btime64 uint64 Compact_count uint64 Compact_delay_total uint64 Ac_tgid uint32 _ [4]byte Ac_tgetime uint64 Ac_exe_dev uint64 Ac_exe_inode uint64 Wpcopy_count uint64 Wpcopy_delay_total uint64 Irq_count uint64 Irq_delay_total uint64 Cpu_delay_max uint64 Cpu_delay_min uint64 Blkio_delay_max uint64 Blkio_delay_min uint64 Swapin_delay_max uint64 Swapin_delay_min uint64 Freepages_delay_max uint64 Freepages_delay_min uint64 Thrashing_delay_max uint64 Thrashing_delay_min uint64 Compact_delay_max uint64 Compact_delay_min uint64 Wpcopy_delay_max uint64 Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 } type cpuMask uint32 const ( _NCPUBITS = 0x20 ) const ( CBitFieldMaskBit0 = 0x8000000000000000 CBitFieldMaskBit1 = 0x4000000000000000 CBitFieldMaskBit2 = 0x2000000000000000 CBitFieldMaskBit3 = 0x1000000000000000 CBitFieldMaskBit4 = 0x800000000000000 CBitFieldMaskBit5 = 0x400000000000000 CBitFieldMaskBit6 = 0x200000000000000 CBitFieldMaskBit7 = 0x100000000000000 CBitFieldMaskBit8 = 0x80000000000000 CBitFieldMaskBit9 = 0x40000000000000 CBitFieldMaskBit10 = 0x20000000000000 CBitFieldMaskBit11 = 0x10000000000000 CBitFieldMaskBit12 = 0x8000000000000 CBitFieldMaskBit13 = 0x4000000000000 CBitFieldMaskBit14 = 0x2000000000000 CBitFieldMaskBit15 = 0x1000000000000 CBitFieldMaskBit16 = 0x800000000000 CBitFieldMaskBit17 = 0x400000000000 CBitFieldMaskBit18 = 0x200000000000 CBitFieldMaskBit19 = 0x100000000000 CBitFieldMaskBit20 = 0x80000000000 CBitFieldMaskBit21 = 0x40000000000 CBitFieldMaskBit22 = 0x20000000000 CBitFieldMaskBit23 = 0x10000000000 CBitFieldMaskBit24 = 0x8000000000 CBitFieldMaskBit25 = 0x4000000000 CBitFieldMaskBit26 = 0x2000000000 CBitFieldMaskBit27 = 0x1000000000 CBitFieldMaskBit28 = 0x800000000 CBitFieldMaskBit29 = 0x400000000 CBitFieldMaskBit30 = 0x200000000 CBitFieldMaskBit31 = 0x100000000 CBitFieldMaskBit32 = 0x80000000 CBitFieldMaskBit33 = 0x40000000 CBitFieldMaskBit34 = 0x20000000 CBitFieldMaskBit35 = 0x10000000 CBitFieldMaskBit36 = 0x8000000 CBitFieldMaskBit37 = 0x4000000 CBitFieldMaskBit38 = 0x2000000 CBitFieldMaskBit39 = 0x1000000 CBitFieldMaskBit40 = 0x800000 CBitFieldMaskBit41 = 0x400000 CBitFieldMaskBit42 = 0x200000 CBitFieldMaskBit43 = 0x100000 CBitFieldMaskBit44 = 0x80000 CBitFieldMaskBit45 = 0x40000 CBitFieldMaskBit46 = 0x20000 CBitFieldMaskBit47 = 0x10000 CBitFieldMaskBit48 = 0x8000 CBitFieldMaskBit49 = 0x4000 CBitFieldMaskBit50 = 0x2000 CBitFieldMaskBit51 = 0x1000 CBitFieldMaskBit52 = 0x800 CBitFieldMaskBit53 = 0x400 CBitFieldMaskBit54 = 0x200 CBitFieldMaskBit55 = 0x100 CBitFieldMaskBit56 = 0x80 CBitFieldMaskBit57 = 0x40 CBitFieldMaskBit58 = 0x20 CBitFieldMaskBit59 = 0x10 CBitFieldMaskBit60 = 0x8 CBitFieldMaskBit61 = 0x4 CBitFieldMaskBit62 = 0x2 CBitFieldMaskBit63 = 0x1 ) type SockaddrStorage struct { Family uint16 Data [122]byte _ uint32 } type HDGeometry struct { Heads uint8 Sectors uint8 Cylinders uint16 Start uint32 } type Statfs_t struct { Type int32 Bsize int32 Frsize int32 _ [4]byte Blocks uint64 Bfree uint64 Files uint64 Ffree uint64 Bavail uint64 Fsid Fsid Namelen int32 Flags int32 Spare [5]int32 _ [4]byte } type TpacketHdr struct { Status uint32 Len uint32 Snaplen uint32 Mac uint16 Net uint16 Sec uint32 Usec uint32 } const ( SizeofTpacketHdr = 0x18 ) type RTCPLLInfo struct { Ctrl int32 Value int32 Max int32 Min int32 Posmult int32 Negmult int32 Clock int32 } type BlkpgPartition struct { Start int64 Length int64 Pno int32 Devname [64]uint8 Volname [64]uint8 _ [4]byte } const ( BLKPG = 0x20001269 ) type CryptoUserAlg struct { Name [64]int8 Driver_name [64]int8 Module_name [64]int8 Type uint32 Mask uint32 Refcnt uint32 Flags uint32 } type CryptoStatAEAD struct { Type [64]int8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Err_cnt uint64 } type CryptoStatAKCipher struct { Type [64]int8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Verify_cnt uint64 Sign_cnt uint64 Err_cnt uint64 } type CryptoStatCipher struct { Type [64]int8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Err_cnt uint64 } type CryptoStatCompress struct { Type [64]int8 Compress_cnt uint64 Compress_tlen uint64 Decompress_cnt uint64 Decompress_tlen uint64 Err_cnt uint64 } type CryptoStatHash struct { Type [64]int8 Hash_cnt uint64 Hash_tlen uint64 Err_cnt uint64 } type CryptoStatKPP struct { Type [64]int8 Setsecret_cnt uint64 Generate_public_key_cnt uint64 Compute_shared_secret_cnt uint64 Err_cnt uint64 } type CryptoStatRNG struct { Type [64]int8 Generate_cnt uint64 Generate_tlen uint64 Seed_cnt uint64 Err_cnt uint64 } type CryptoStatLarval struct { Type [64]int8 } type CryptoReportLarval struct { Type [64]int8 } type CryptoReportHash struct { Type [64]int8 Blocksize uint32 Digestsize uint32 } type CryptoReportCipher struct { Type [64]int8 Blocksize uint32 Min_keysize uint32 Max_keysize uint32 } type CryptoReportBlkCipher struct { Type [64]int8 Geniv [64]int8 Blocksize uint32 Min_keysize uint32 Max_keysize uint32 Ivsize uint32 } type CryptoReportAEAD struct { Type [64]int8 Geniv [64]int8 Blocksize uint32 Maxauthsize uint32 Ivsize uint32 } type CryptoReportComp struct { Type [64]int8 } type CryptoReportRNG struct { Type [64]int8 Seedsize uint32 } type CryptoReportAKCipher struct { Type [64]int8 } type CryptoReportKPP struct { Type [64]int8 } type CryptoReportAcomp struct { Type [64]int8 } type LoopInfo struct { Number int32 Device uint32 Inode uint32 Rdevice uint32 Offset int32 Encrypt_type int32 Encrypt_key_size int32 Flags int32 Name [64]int8 Encrypt_key [32]uint8 Init [2]uint32 Reserved [4]int8 } type TIPCSubscr struct { Seq TIPCServiceRange Timeout uint32 Filter uint32 Handle [8]int8 } type TIPCSIOCLNReq struct { Peer uint32 Id uint32 Linkname [68]int8 } type TIPCSIOCNodeIDReq struct { Peer uint32 Id [16]int8 } type PPSKInfo struct { Assert_sequence uint32 Clear_sequence uint32 Assert_tu PPSKTime Clear_tu PPSKTime Current_mode int32 _ [4]byte } const ( PPS_GETPARAMS = 0x400470a1 PPS_SETPARAMS = 0x800470a2 PPS_GETCAP = 0x400470a3 PPS_FETCH = 0xc00470a4 ) const ( PIDFD_NONBLOCK = 0x80 ) type SysvIpcPerm struct { Key int32 Uid uint32 Gid uint32 Cuid uint32 Cgid uint32 Mode uint32 _ [0]uint8 Seq uint16 _ uint16 _ uint32 _ uint32 } type SysvShmDesc struct { Perm SysvIpcPerm Segsz uint32 Atime uint32 Dtime uint32 Ctime uint32 Cpid int32 Lpid int32 Nattch uint32 Atime_high uint16 Dtime_high uint16 Ctime_high uint16 _ uint16 } ================================================ FILE: vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go ================================================ // cgo -godefs -objdir=/tmp/mips64/cgo -- -Wall -Werror -static -I/tmp/mips64/include linux/types.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build mips64 && linux package unix const ( SizeofPtr = 0x8 SizeofLong = 0x8 ) type ( _C_long int64 ) type Timespec struct { Sec int64 Nsec int64 } type Timeval struct { Sec int64 Usec int64 } type Timex struct { Modes uint32 Offset int64 Freq int64 Maxerror int64 Esterror int64 Status int32 Constant int64 Precision int64 Tolerance int64 Time Timeval Tick int64 Ppsfreq int64 Jitter int64 Shift int32 Stabil int64 Jitcnt int64 Calcnt int64 Errcnt int64 Stbcnt int64 Tai int32 _ [44]byte } type Time_t int64 type Tms struct { Utime int64 Stime int64 Cutime int64 Cstime int64 } type Utimbuf struct { Actime int64 Modtime int64 } type Rusage struct { Utime Timeval Stime Timeval Maxrss int64 Ixrss int64 Idrss int64 Isrss int64 Minflt int64 Majflt int64 Nswap int64 Inblock int64 Oublock int64 Msgsnd int64 Msgrcv int64 Nsignals int64 Nvcsw int64 Nivcsw int64 } type Stat_t struct { Dev uint32 Pad1 [3]uint32 Ino uint64 Mode uint32 Nlink uint32 Uid uint32 Gid uint32 Rdev uint32 Pad2 [3]uint32 Size int64 Atim Timespec Mtim Timespec Ctim Timespec Blksize uint32 Pad4 uint32 Blocks int64 } type Dirent struct { Ino uint64 Off int64 Reclen uint16 Type uint8 Name [256]int8 _ [5]byte } type Flock_t struct { Type int16 Whence int16 Start int64 Len int64 Pid int32 _ [4]byte } type DmNameList struct { Dev uint64 Next uint32 Name [0]byte _ [4]byte } const ( FADV_DONTNEED = 0x4 FADV_NOREUSE = 0x5 ) type RawSockaddrNFCLLCP struct { Sa_family uint16 Dev_idx uint32 Target_idx uint32 Nfc_protocol uint32 Dsap uint8 Ssap uint8 Service_name [63]uint8 Service_name_len uint64 } type RawSockaddr struct { Family uint16 Data [14]int8 } type RawSockaddrAny struct { Addr RawSockaddr Pad [96]int8 } type Iovec struct { Base *byte Len uint64 } type Msghdr struct { Name *byte Namelen uint32 Iov *Iovec Iovlen uint64 Control *byte Controllen uint64 Flags int32 _ [4]byte } type Cmsghdr struct { Len uint64 Level int32 Type int32 } type ifreq struct { Ifrn [16]byte Ifru [24]byte } const ( SizeofSockaddrNFCLLCP = 0x60 SizeofIovec = 0x10 SizeofMsghdr = 0x38 SizeofCmsghdr = 0x10 ) const ( SizeofSockFprog = 0x10 ) type PtraceRegs struct { Regs [32]uint64 Lo uint64 Hi uint64 Epc uint64 Badvaddr uint64 Status uint64 Cause uint64 } type FdSet struct { Bits [16]int64 } type Sysinfo_t struct { Uptime int64 Loads [3]uint64 Totalram uint64 Freeram uint64 Sharedram uint64 Bufferram uint64 Totalswap uint64 Freeswap uint64 Procs uint16 Pad uint16 Totalhigh uint64 Freehigh uint64 Unit uint32 _ [0]int8 _ [4]byte } type Ustat_t struct { Tfree int32 Tinode uint64 Fname [6]int8 Fpack [6]int8 _ [4]byte } type EpollEvent struct { Events uint32 _ int32 Fd int32 Pad int32 } const ( OPEN_TREE_CLOEXEC = 0x80000 ) const ( POLLRDHUP = 0x2000 ) type Sigset_t struct { Val [16]uint64 } const _C__NSIG = 0x80 const ( SIG_BLOCK = 0x1 SIG_UNBLOCK = 0x2 SIG_SETMASK = 0x3 ) type Siginfo struct { Signo int32 Code int32 Errno int32 _ int32 _ [112]byte } type Termios struct { Iflag uint32 Oflag uint32 Cflag uint32 Lflag uint32 Line uint8 Cc [23]uint8 Ispeed uint32 Ospeed uint32 } type Taskstats struct { Version uint16 Ac_exitcode uint32 Ac_flag uint8 Ac_nice uint8 Cpu_count uint64 Cpu_delay_total uint64 Blkio_count uint64 Blkio_delay_total uint64 Swapin_count uint64 Swapin_delay_total uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]int8 Ac_sched uint8 Ac_pad [3]uint8 _ [4]byte Ac_uid uint32 Ac_gid uint32 Ac_pid uint32 Ac_ppid uint32 Ac_btime uint32 Ac_etime uint64 Ac_utime uint64 Ac_stime uint64 Ac_minflt uint64 Ac_majflt uint64 Coremem uint64 Virtmem uint64 Hiwater_rss uint64 Hiwater_vm uint64 Read_char uint64 Write_char uint64 Read_syscalls uint64 Write_syscalls uint64 Read_bytes uint64 Write_bytes uint64 Cancelled_write_bytes uint64 Nvcsw uint64 Nivcsw uint64 Ac_utimescaled uint64 Ac_stimescaled uint64 Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 Thrashing_count uint64 Thrashing_delay_total uint64 Ac_btime64 uint64 Compact_count uint64 Compact_delay_total uint64 Ac_tgid uint32 Ac_tgetime uint64 Ac_exe_dev uint64 Ac_exe_inode uint64 Wpcopy_count uint64 Wpcopy_delay_total uint64 Irq_count uint64 Irq_delay_total uint64 Cpu_delay_max uint64 Cpu_delay_min uint64 Blkio_delay_max uint64 Blkio_delay_min uint64 Swapin_delay_max uint64 Swapin_delay_min uint64 Freepages_delay_max uint64 Freepages_delay_min uint64 Thrashing_delay_max uint64 Thrashing_delay_min uint64 Compact_delay_max uint64 Compact_delay_min uint64 Wpcopy_delay_max uint64 Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 } type cpuMask uint64 const ( _NCPUBITS = 0x40 ) const ( CBitFieldMaskBit0 = 0x8000000000000000 CBitFieldMaskBit1 = 0x4000000000000000 CBitFieldMaskBit2 = 0x2000000000000000 CBitFieldMaskBit3 = 0x1000000000000000 CBitFieldMaskBit4 = 0x800000000000000 CBitFieldMaskBit5 = 0x400000000000000 CBitFieldMaskBit6 = 0x200000000000000 CBitFieldMaskBit7 = 0x100000000000000 CBitFieldMaskBit8 = 0x80000000000000 CBitFieldMaskBit9 = 0x40000000000000 CBitFieldMaskBit10 = 0x20000000000000 CBitFieldMaskBit11 = 0x10000000000000 CBitFieldMaskBit12 = 0x8000000000000 CBitFieldMaskBit13 = 0x4000000000000 CBitFieldMaskBit14 = 0x2000000000000 CBitFieldMaskBit15 = 0x1000000000000 CBitFieldMaskBit16 = 0x800000000000 CBitFieldMaskBit17 = 0x400000000000 CBitFieldMaskBit18 = 0x200000000000 CBitFieldMaskBit19 = 0x100000000000 CBitFieldMaskBit20 = 0x80000000000 CBitFieldMaskBit21 = 0x40000000000 CBitFieldMaskBit22 = 0x20000000000 CBitFieldMaskBit23 = 0x10000000000 CBitFieldMaskBit24 = 0x8000000000 CBitFieldMaskBit25 = 0x4000000000 CBitFieldMaskBit26 = 0x2000000000 CBitFieldMaskBit27 = 0x1000000000 CBitFieldMaskBit28 = 0x800000000 CBitFieldMaskBit29 = 0x400000000 CBitFieldMaskBit30 = 0x200000000 CBitFieldMaskBit31 = 0x100000000 CBitFieldMaskBit32 = 0x80000000 CBitFieldMaskBit33 = 0x40000000 CBitFieldMaskBit34 = 0x20000000 CBitFieldMaskBit35 = 0x10000000 CBitFieldMaskBit36 = 0x8000000 CBitFieldMaskBit37 = 0x4000000 CBitFieldMaskBit38 = 0x2000000 CBitFieldMaskBit39 = 0x1000000 CBitFieldMaskBit40 = 0x800000 CBitFieldMaskBit41 = 0x400000 CBitFieldMaskBit42 = 0x200000 CBitFieldMaskBit43 = 0x100000 CBitFieldMaskBit44 = 0x80000 CBitFieldMaskBit45 = 0x40000 CBitFieldMaskBit46 = 0x20000 CBitFieldMaskBit47 = 0x10000 CBitFieldMaskBit48 = 0x8000 CBitFieldMaskBit49 = 0x4000 CBitFieldMaskBit50 = 0x2000 CBitFieldMaskBit51 = 0x1000 CBitFieldMaskBit52 = 0x800 CBitFieldMaskBit53 = 0x400 CBitFieldMaskBit54 = 0x200 CBitFieldMaskBit55 = 0x100 CBitFieldMaskBit56 = 0x80 CBitFieldMaskBit57 = 0x40 CBitFieldMaskBit58 = 0x20 CBitFieldMaskBit59 = 0x10 CBitFieldMaskBit60 = 0x8 CBitFieldMaskBit61 = 0x4 CBitFieldMaskBit62 = 0x2 CBitFieldMaskBit63 = 0x1 ) type SockaddrStorage struct { Family uint16 Data [118]byte _ uint64 } type HDGeometry struct { Heads uint8 Sectors uint8 Cylinders uint16 Start uint64 } type Statfs_t struct { Type int64 Bsize int64 Frsize int64 Blocks uint64 Bfree uint64 Files uint64 Ffree uint64 Bavail uint64 Fsid Fsid Namelen int64 Flags int64 Spare [5]int64 } type TpacketHdr struct { Status uint64 Len uint32 Snaplen uint32 Mac uint16 Net uint16 Sec uint32 Usec uint32 _ [4]byte } const ( SizeofTpacketHdr = 0x20 ) type RTCPLLInfo struct { Ctrl int32 Value int32 Max int32 Min int32 Posmult int32 Negmult int32 Clock int64 } type BlkpgPartition struct { Start int64 Length int64 Pno int32 Devname [64]uint8 Volname [64]uint8 _ [4]byte } const ( BLKPG = 0x20001269 ) type CryptoUserAlg struct { Name [64]int8 Driver_name [64]int8 Module_name [64]int8 Type uint32 Mask uint32 Refcnt uint32 Flags uint32 } type CryptoStatAEAD struct { Type [64]int8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Err_cnt uint64 } type CryptoStatAKCipher struct { Type [64]int8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Verify_cnt uint64 Sign_cnt uint64 Err_cnt uint64 } type CryptoStatCipher struct { Type [64]int8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Err_cnt uint64 } type CryptoStatCompress struct { Type [64]int8 Compress_cnt uint64 Compress_tlen uint64 Decompress_cnt uint64 Decompress_tlen uint64 Err_cnt uint64 } type CryptoStatHash struct { Type [64]int8 Hash_cnt uint64 Hash_tlen uint64 Err_cnt uint64 } type CryptoStatKPP struct { Type [64]int8 Setsecret_cnt uint64 Generate_public_key_cnt uint64 Compute_shared_secret_cnt uint64 Err_cnt uint64 } type CryptoStatRNG struct { Type [64]int8 Generate_cnt uint64 Generate_tlen uint64 Seed_cnt uint64 Err_cnt uint64 } type CryptoStatLarval struct { Type [64]int8 } type CryptoReportLarval struct { Type [64]int8 } type CryptoReportHash struct { Type [64]int8 Blocksize uint32 Digestsize uint32 } type CryptoReportCipher struct { Type [64]int8 Blocksize uint32 Min_keysize uint32 Max_keysize uint32 } type CryptoReportBlkCipher struct { Type [64]int8 Geniv [64]int8 Blocksize uint32 Min_keysize uint32 Max_keysize uint32 Ivsize uint32 } type CryptoReportAEAD struct { Type [64]int8 Geniv [64]int8 Blocksize uint32 Maxauthsize uint32 Ivsize uint32 } type CryptoReportComp struct { Type [64]int8 } type CryptoReportRNG struct { Type [64]int8 Seedsize uint32 } type CryptoReportAKCipher struct { Type [64]int8 } type CryptoReportKPP struct { Type [64]int8 } type CryptoReportAcomp struct { Type [64]int8 } type LoopInfo struct { Number int32 Device uint32 Inode uint64 Rdevice uint32 Offset int32 Encrypt_type int32 Encrypt_key_size int32 Flags int32 Name [64]int8 Encrypt_key [32]uint8 Init [2]uint64 Reserved [4]int8 _ [4]byte } type TIPCSubscr struct { Seq TIPCServiceRange Timeout uint32 Filter uint32 Handle [8]int8 } type TIPCSIOCLNReq struct { Peer uint32 Id uint32 Linkname [68]int8 } type TIPCSIOCNodeIDReq struct { Peer uint32 Id [16]int8 } type PPSKInfo struct { Assert_sequence uint32 Clear_sequence uint32 Assert_tu PPSKTime Clear_tu PPSKTime Current_mode int32 _ [4]byte } const ( PPS_GETPARAMS = 0x400870a1 PPS_SETPARAMS = 0x800870a2 PPS_GETCAP = 0x400870a3 PPS_FETCH = 0xc00870a4 ) const ( PIDFD_NONBLOCK = 0x80 ) type SysvIpcPerm struct { Key int32 Uid uint32 Gid uint32 Cuid uint32 Cgid uint32 Mode uint32 _ [0]uint8 Seq uint16 _ uint16 _ uint64 _ uint64 } type SysvShmDesc struct { Perm SysvIpcPerm Segsz uint64 Atime int64 Dtime int64 Ctime int64 Cpid int32 Lpid int32 Nattch uint64 _ uint64 _ uint64 } ================================================ FILE: vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go ================================================ // cgo -godefs -objdir=/tmp/mips64le/cgo -- -Wall -Werror -static -I/tmp/mips64le/include linux/types.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build mips64le && linux package unix const ( SizeofPtr = 0x8 SizeofLong = 0x8 ) type ( _C_long int64 ) type Timespec struct { Sec int64 Nsec int64 } type Timeval struct { Sec int64 Usec int64 } type Timex struct { Modes uint32 Offset int64 Freq int64 Maxerror int64 Esterror int64 Status int32 Constant int64 Precision int64 Tolerance int64 Time Timeval Tick int64 Ppsfreq int64 Jitter int64 Shift int32 Stabil int64 Jitcnt int64 Calcnt int64 Errcnt int64 Stbcnt int64 Tai int32 _ [44]byte } type Time_t int64 type Tms struct { Utime int64 Stime int64 Cutime int64 Cstime int64 } type Utimbuf struct { Actime int64 Modtime int64 } type Rusage struct { Utime Timeval Stime Timeval Maxrss int64 Ixrss int64 Idrss int64 Isrss int64 Minflt int64 Majflt int64 Nswap int64 Inblock int64 Oublock int64 Msgsnd int64 Msgrcv int64 Nsignals int64 Nvcsw int64 Nivcsw int64 } type Stat_t struct { Dev uint32 Pad1 [3]uint32 Ino uint64 Mode uint32 Nlink uint32 Uid uint32 Gid uint32 Rdev uint32 Pad2 [3]uint32 Size int64 Atim Timespec Mtim Timespec Ctim Timespec Blksize uint32 Pad4 uint32 Blocks int64 } type Dirent struct { Ino uint64 Off int64 Reclen uint16 Type uint8 Name [256]int8 _ [5]byte } type Flock_t struct { Type int16 Whence int16 Start int64 Len int64 Pid int32 _ [4]byte } type DmNameList struct { Dev uint64 Next uint32 Name [0]byte _ [4]byte } const ( FADV_DONTNEED = 0x4 FADV_NOREUSE = 0x5 ) type RawSockaddrNFCLLCP struct { Sa_family uint16 Dev_idx uint32 Target_idx uint32 Nfc_protocol uint32 Dsap uint8 Ssap uint8 Service_name [63]uint8 Service_name_len uint64 } type RawSockaddr struct { Family uint16 Data [14]int8 } type RawSockaddrAny struct { Addr RawSockaddr Pad [96]int8 } type Iovec struct { Base *byte Len uint64 } type Msghdr struct { Name *byte Namelen uint32 Iov *Iovec Iovlen uint64 Control *byte Controllen uint64 Flags int32 _ [4]byte } type Cmsghdr struct { Len uint64 Level int32 Type int32 } type ifreq struct { Ifrn [16]byte Ifru [24]byte } const ( SizeofSockaddrNFCLLCP = 0x60 SizeofIovec = 0x10 SizeofMsghdr = 0x38 SizeofCmsghdr = 0x10 ) const ( SizeofSockFprog = 0x10 ) type PtraceRegs struct { Regs [32]uint64 Lo uint64 Hi uint64 Epc uint64 Badvaddr uint64 Status uint64 Cause uint64 } type FdSet struct { Bits [16]int64 } type Sysinfo_t struct { Uptime int64 Loads [3]uint64 Totalram uint64 Freeram uint64 Sharedram uint64 Bufferram uint64 Totalswap uint64 Freeswap uint64 Procs uint16 Pad uint16 Totalhigh uint64 Freehigh uint64 Unit uint32 _ [0]int8 _ [4]byte } type Ustat_t struct { Tfree int32 Tinode uint64 Fname [6]int8 Fpack [6]int8 _ [4]byte } type EpollEvent struct { Events uint32 _ int32 Fd int32 Pad int32 } const ( OPEN_TREE_CLOEXEC = 0x80000 ) const ( POLLRDHUP = 0x2000 ) type Sigset_t struct { Val [16]uint64 } const _C__NSIG = 0x80 const ( SIG_BLOCK = 0x1 SIG_UNBLOCK = 0x2 SIG_SETMASK = 0x3 ) type Siginfo struct { Signo int32 Code int32 Errno int32 _ int32 _ [112]byte } type Termios struct { Iflag uint32 Oflag uint32 Cflag uint32 Lflag uint32 Line uint8 Cc [23]uint8 Ispeed uint32 Ospeed uint32 } type Taskstats struct { Version uint16 Ac_exitcode uint32 Ac_flag uint8 Ac_nice uint8 Cpu_count uint64 Cpu_delay_total uint64 Blkio_count uint64 Blkio_delay_total uint64 Swapin_count uint64 Swapin_delay_total uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]int8 Ac_sched uint8 Ac_pad [3]uint8 _ [4]byte Ac_uid uint32 Ac_gid uint32 Ac_pid uint32 Ac_ppid uint32 Ac_btime uint32 Ac_etime uint64 Ac_utime uint64 Ac_stime uint64 Ac_minflt uint64 Ac_majflt uint64 Coremem uint64 Virtmem uint64 Hiwater_rss uint64 Hiwater_vm uint64 Read_char uint64 Write_char uint64 Read_syscalls uint64 Write_syscalls uint64 Read_bytes uint64 Write_bytes uint64 Cancelled_write_bytes uint64 Nvcsw uint64 Nivcsw uint64 Ac_utimescaled uint64 Ac_stimescaled uint64 Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 Thrashing_count uint64 Thrashing_delay_total uint64 Ac_btime64 uint64 Compact_count uint64 Compact_delay_total uint64 Ac_tgid uint32 Ac_tgetime uint64 Ac_exe_dev uint64 Ac_exe_inode uint64 Wpcopy_count uint64 Wpcopy_delay_total uint64 Irq_count uint64 Irq_delay_total uint64 Cpu_delay_max uint64 Cpu_delay_min uint64 Blkio_delay_max uint64 Blkio_delay_min uint64 Swapin_delay_max uint64 Swapin_delay_min uint64 Freepages_delay_max uint64 Freepages_delay_min uint64 Thrashing_delay_max uint64 Thrashing_delay_min uint64 Compact_delay_max uint64 Compact_delay_min uint64 Wpcopy_delay_max uint64 Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 } type cpuMask uint64 const ( _NCPUBITS = 0x40 ) const ( CBitFieldMaskBit0 = 0x1 CBitFieldMaskBit1 = 0x2 CBitFieldMaskBit2 = 0x4 CBitFieldMaskBit3 = 0x8 CBitFieldMaskBit4 = 0x10 CBitFieldMaskBit5 = 0x20 CBitFieldMaskBit6 = 0x40 CBitFieldMaskBit7 = 0x80 CBitFieldMaskBit8 = 0x100 CBitFieldMaskBit9 = 0x200 CBitFieldMaskBit10 = 0x400 CBitFieldMaskBit11 = 0x800 CBitFieldMaskBit12 = 0x1000 CBitFieldMaskBit13 = 0x2000 CBitFieldMaskBit14 = 0x4000 CBitFieldMaskBit15 = 0x8000 CBitFieldMaskBit16 = 0x10000 CBitFieldMaskBit17 = 0x20000 CBitFieldMaskBit18 = 0x40000 CBitFieldMaskBit19 = 0x80000 CBitFieldMaskBit20 = 0x100000 CBitFieldMaskBit21 = 0x200000 CBitFieldMaskBit22 = 0x400000 CBitFieldMaskBit23 = 0x800000 CBitFieldMaskBit24 = 0x1000000 CBitFieldMaskBit25 = 0x2000000 CBitFieldMaskBit26 = 0x4000000 CBitFieldMaskBit27 = 0x8000000 CBitFieldMaskBit28 = 0x10000000 CBitFieldMaskBit29 = 0x20000000 CBitFieldMaskBit30 = 0x40000000 CBitFieldMaskBit31 = 0x80000000 CBitFieldMaskBit32 = 0x100000000 CBitFieldMaskBit33 = 0x200000000 CBitFieldMaskBit34 = 0x400000000 CBitFieldMaskBit35 = 0x800000000 CBitFieldMaskBit36 = 0x1000000000 CBitFieldMaskBit37 = 0x2000000000 CBitFieldMaskBit38 = 0x4000000000 CBitFieldMaskBit39 = 0x8000000000 CBitFieldMaskBit40 = 0x10000000000 CBitFieldMaskBit41 = 0x20000000000 CBitFieldMaskBit42 = 0x40000000000 CBitFieldMaskBit43 = 0x80000000000 CBitFieldMaskBit44 = 0x100000000000 CBitFieldMaskBit45 = 0x200000000000 CBitFieldMaskBit46 = 0x400000000000 CBitFieldMaskBit47 = 0x800000000000 CBitFieldMaskBit48 = 0x1000000000000 CBitFieldMaskBit49 = 0x2000000000000 CBitFieldMaskBit50 = 0x4000000000000 CBitFieldMaskBit51 = 0x8000000000000 CBitFieldMaskBit52 = 0x10000000000000 CBitFieldMaskBit53 = 0x20000000000000 CBitFieldMaskBit54 = 0x40000000000000 CBitFieldMaskBit55 = 0x80000000000000 CBitFieldMaskBit56 = 0x100000000000000 CBitFieldMaskBit57 = 0x200000000000000 CBitFieldMaskBit58 = 0x400000000000000 CBitFieldMaskBit59 = 0x800000000000000 CBitFieldMaskBit60 = 0x1000000000000000 CBitFieldMaskBit61 = 0x2000000000000000 CBitFieldMaskBit62 = 0x4000000000000000 CBitFieldMaskBit63 = 0x8000000000000000 ) type SockaddrStorage struct { Family uint16 Data [118]byte _ uint64 } type HDGeometry struct { Heads uint8 Sectors uint8 Cylinders uint16 Start uint64 } type Statfs_t struct { Type int64 Bsize int64 Frsize int64 Blocks uint64 Bfree uint64 Files uint64 Ffree uint64 Bavail uint64 Fsid Fsid Namelen int64 Flags int64 Spare [5]int64 } type TpacketHdr struct { Status uint64 Len uint32 Snaplen uint32 Mac uint16 Net uint16 Sec uint32 Usec uint32 _ [4]byte } const ( SizeofTpacketHdr = 0x20 ) type RTCPLLInfo struct { Ctrl int32 Value int32 Max int32 Min int32 Posmult int32 Negmult int32 Clock int64 } type BlkpgPartition struct { Start int64 Length int64 Pno int32 Devname [64]uint8 Volname [64]uint8 _ [4]byte } const ( BLKPG = 0x20001269 ) type CryptoUserAlg struct { Name [64]int8 Driver_name [64]int8 Module_name [64]int8 Type uint32 Mask uint32 Refcnt uint32 Flags uint32 } type CryptoStatAEAD struct { Type [64]int8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Err_cnt uint64 } type CryptoStatAKCipher struct { Type [64]int8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Verify_cnt uint64 Sign_cnt uint64 Err_cnt uint64 } type CryptoStatCipher struct { Type [64]int8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Err_cnt uint64 } type CryptoStatCompress struct { Type [64]int8 Compress_cnt uint64 Compress_tlen uint64 Decompress_cnt uint64 Decompress_tlen uint64 Err_cnt uint64 } type CryptoStatHash struct { Type [64]int8 Hash_cnt uint64 Hash_tlen uint64 Err_cnt uint64 } type CryptoStatKPP struct { Type [64]int8 Setsecret_cnt uint64 Generate_public_key_cnt uint64 Compute_shared_secret_cnt uint64 Err_cnt uint64 } type CryptoStatRNG struct { Type [64]int8 Generate_cnt uint64 Generate_tlen uint64 Seed_cnt uint64 Err_cnt uint64 } type CryptoStatLarval struct { Type [64]int8 } type CryptoReportLarval struct { Type [64]int8 } type CryptoReportHash struct { Type [64]int8 Blocksize uint32 Digestsize uint32 } type CryptoReportCipher struct { Type [64]int8 Blocksize uint32 Min_keysize uint32 Max_keysize uint32 } type CryptoReportBlkCipher struct { Type [64]int8 Geniv [64]int8 Blocksize uint32 Min_keysize uint32 Max_keysize uint32 Ivsize uint32 } type CryptoReportAEAD struct { Type [64]int8 Geniv [64]int8 Blocksize uint32 Maxauthsize uint32 Ivsize uint32 } type CryptoReportComp struct { Type [64]int8 } type CryptoReportRNG struct { Type [64]int8 Seedsize uint32 } type CryptoReportAKCipher struct { Type [64]int8 } type CryptoReportKPP struct { Type [64]int8 } type CryptoReportAcomp struct { Type [64]int8 } type LoopInfo struct { Number int32 Device uint32 Inode uint64 Rdevice uint32 Offset int32 Encrypt_type int32 Encrypt_key_size int32 Flags int32 Name [64]int8 Encrypt_key [32]uint8 Init [2]uint64 Reserved [4]int8 _ [4]byte } type TIPCSubscr struct { Seq TIPCServiceRange Timeout uint32 Filter uint32 Handle [8]int8 } type TIPCSIOCLNReq struct { Peer uint32 Id uint32 Linkname [68]int8 } type TIPCSIOCNodeIDReq struct { Peer uint32 Id [16]int8 } type PPSKInfo struct { Assert_sequence uint32 Clear_sequence uint32 Assert_tu PPSKTime Clear_tu PPSKTime Current_mode int32 _ [4]byte } const ( PPS_GETPARAMS = 0x400870a1 PPS_SETPARAMS = 0x800870a2 PPS_GETCAP = 0x400870a3 PPS_FETCH = 0xc00870a4 ) const ( PIDFD_NONBLOCK = 0x80 ) type SysvIpcPerm struct { Key int32 Uid uint32 Gid uint32 Cuid uint32 Cgid uint32 Mode uint32 _ [0]uint8 Seq uint16 _ uint16 _ uint64 _ uint64 } type SysvShmDesc struct { Perm SysvIpcPerm Segsz uint64 Atime int64 Dtime int64 Ctime int64 Cpid int32 Lpid int32 Nattch uint64 _ uint64 _ uint64 } ================================================ FILE: vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go ================================================ // cgo -godefs -objdir=/tmp/mipsle/cgo -- -Wall -Werror -static -I/tmp/mipsle/include linux/types.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build mipsle && linux package unix const ( SizeofPtr = 0x4 SizeofLong = 0x4 ) type ( _C_long int32 ) type Timespec struct { Sec int32 Nsec int32 } type Timeval struct { Sec int32 Usec int32 } type Timex struct { Modes uint32 Offset int32 Freq int32 Maxerror int32 Esterror int32 Status int32 Constant int32 Precision int32 Tolerance int32 Time Timeval Tick int32 Ppsfreq int32 Jitter int32 Shift int32 Stabil int32 Jitcnt int32 Calcnt int32 Errcnt int32 Stbcnt int32 Tai int32 _ [44]byte } type Time_t int32 type Tms struct { Utime int32 Stime int32 Cutime int32 Cstime int32 } type Utimbuf struct { Actime int32 Modtime int32 } type Rusage struct { Utime Timeval Stime Timeval Maxrss int32 Ixrss int32 Idrss int32 Isrss int32 Minflt int32 Majflt int32 Nswap int32 Inblock int32 Oublock int32 Msgsnd int32 Msgrcv int32 Nsignals int32 Nvcsw int32 Nivcsw int32 } type Stat_t struct { Dev uint32 Pad1 [3]int32 Ino uint64 Mode uint32 Nlink uint32 Uid uint32 Gid uint32 Rdev uint32 Pad2 [3]int32 Size int64 Atim Timespec Mtim Timespec Ctim Timespec Blksize int32 Pad4 int32 Blocks int64 Pad5 [14]int32 } type Dirent struct { Ino uint64 Off int64 Reclen uint16 Type uint8 Name [256]int8 _ [5]byte } type Flock_t struct { Type int16 Whence int16 _ [4]byte Start int64 Len int64 Pid int32 _ [4]byte } type DmNameList struct { Dev uint64 Next uint32 Name [0]byte _ [4]byte } const ( FADV_DONTNEED = 0x4 FADV_NOREUSE = 0x5 ) type RawSockaddrNFCLLCP struct { Sa_family uint16 Dev_idx uint32 Target_idx uint32 Nfc_protocol uint32 Dsap uint8 Ssap uint8 Service_name [63]uint8 Service_name_len uint32 } type RawSockaddr struct { Family uint16 Data [14]int8 } type RawSockaddrAny struct { Addr RawSockaddr Pad [96]int8 } type Iovec struct { Base *byte Len uint32 } type Msghdr struct { Name *byte Namelen uint32 Iov *Iovec Iovlen uint32 Control *byte Controllen uint32 Flags int32 } type Cmsghdr struct { Len uint32 Level int32 Type int32 } type ifreq struct { Ifrn [16]byte Ifru [16]byte } const ( SizeofSockaddrNFCLLCP = 0x58 SizeofIovec = 0x8 SizeofMsghdr = 0x1c SizeofCmsghdr = 0xc ) const ( SizeofSockFprog = 0x8 ) type PtraceRegs struct { Regs [32]uint64 Lo uint64 Hi uint64 Epc uint64 Badvaddr uint64 Status uint64 Cause uint64 } type FdSet struct { Bits [32]int32 } type Sysinfo_t struct { Uptime int32 Loads [3]uint32 Totalram uint32 Freeram uint32 Sharedram uint32 Bufferram uint32 Totalswap uint32 Freeswap uint32 Procs uint16 Pad uint16 Totalhigh uint32 Freehigh uint32 Unit uint32 _ [8]int8 } type Ustat_t struct { Tfree int32 Tinode uint32 Fname [6]int8 Fpack [6]int8 } type EpollEvent struct { Events uint32 PadFd int32 Fd int32 Pad int32 } const ( OPEN_TREE_CLOEXEC = 0x80000 ) const ( POLLRDHUP = 0x2000 ) type Sigset_t struct { Val [32]uint32 } const _C__NSIG = 0x80 const ( SIG_BLOCK = 0x1 SIG_UNBLOCK = 0x2 SIG_SETMASK = 0x3 ) type Siginfo struct { Signo int32 Code int32 Errno int32 _ [116]byte } type Termios struct { Iflag uint32 Oflag uint32 Cflag uint32 Lflag uint32 Line uint8 Cc [23]uint8 Ispeed uint32 Ospeed uint32 } type Taskstats struct { Version uint16 Ac_exitcode uint32 Ac_flag uint8 Ac_nice uint8 _ [6]byte Cpu_count uint64 Cpu_delay_total uint64 Blkio_count uint64 Blkio_delay_total uint64 Swapin_count uint64 Swapin_delay_total uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]int8 Ac_sched uint8 Ac_pad [3]uint8 _ [4]byte Ac_uid uint32 Ac_gid uint32 Ac_pid uint32 Ac_ppid uint32 Ac_btime uint32 _ [4]byte Ac_etime uint64 Ac_utime uint64 Ac_stime uint64 Ac_minflt uint64 Ac_majflt uint64 Coremem uint64 Virtmem uint64 Hiwater_rss uint64 Hiwater_vm uint64 Read_char uint64 Write_char uint64 Read_syscalls uint64 Write_syscalls uint64 Read_bytes uint64 Write_bytes uint64 Cancelled_write_bytes uint64 Nvcsw uint64 Nivcsw uint64 Ac_utimescaled uint64 Ac_stimescaled uint64 Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 Thrashing_count uint64 Thrashing_delay_total uint64 Ac_btime64 uint64 Compact_count uint64 Compact_delay_total uint64 Ac_tgid uint32 _ [4]byte Ac_tgetime uint64 Ac_exe_dev uint64 Ac_exe_inode uint64 Wpcopy_count uint64 Wpcopy_delay_total uint64 Irq_count uint64 Irq_delay_total uint64 Cpu_delay_max uint64 Cpu_delay_min uint64 Blkio_delay_max uint64 Blkio_delay_min uint64 Swapin_delay_max uint64 Swapin_delay_min uint64 Freepages_delay_max uint64 Freepages_delay_min uint64 Thrashing_delay_max uint64 Thrashing_delay_min uint64 Compact_delay_max uint64 Compact_delay_min uint64 Wpcopy_delay_max uint64 Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 } type cpuMask uint32 const ( _NCPUBITS = 0x20 ) const ( CBitFieldMaskBit0 = 0x1 CBitFieldMaskBit1 = 0x2 CBitFieldMaskBit2 = 0x4 CBitFieldMaskBit3 = 0x8 CBitFieldMaskBit4 = 0x10 CBitFieldMaskBit5 = 0x20 CBitFieldMaskBit6 = 0x40 CBitFieldMaskBit7 = 0x80 CBitFieldMaskBit8 = 0x100 CBitFieldMaskBit9 = 0x200 CBitFieldMaskBit10 = 0x400 CBitFieldMaskBit11 = 0x800 CBitFieldMaskBit12 = 0x1000 CBitFieldMaskBit13 = 0x2000 CBitFieldMaskBit14 = 0x4000 CBitFieldMaskBit15 = 0x8000 CBitFieldMaskBit16 = 0x10000 CBitFieldMaskBit17 = 0x20000 CBitFieldMaskBit18 = 0x40000 CBitFieldMaskBit19 = 0x80000 CBitFieldMaskBit20 = 0x100000 CBitFieldMaskBit21 = 0x200000 CBitFieldMaskBit22 = 0x400000 CBitFieldMaskBit23 = 0x800000 CBitFieldMaskBit24 = 0x1000000 CBitFieldMaskBit25 = 0x2000000 CBitFieldMaskBit26 = 0x4000000 CBitFieldMaskBit27 = 0x8000000 CBitFieldMaskBit28 = 0x10000000 CBitFieldMaskBit29 = 0x20000000 CBitFieldMaskBit30 = 0x40000000 CBitFieldMaskBit31 = 0x80000000 CBitFieldMaskBit32 = 0x100000000 CBitFieldMaskBit33 = 0x200000000 CBitFieldMaskBit34 = 0x400000000 CBitFieldMaskBit35 = 0x800000000 CBitFieldMaskBit36 = 0x1000000000 CBitFieldMaskBit37 = 0x2000000000 CBitFieldMaskBit38 = 0x4000000000 CBitFieldMaskBit39 = 0x8000000000 CBitFieldMaskBit40 = 0x10000000000 CBitFieldMaskBit41 = 0x20000000000 CBitFieldMaskBit42 = 0x40000000000 CBitFieldMaskBit43 = 0x80000000000 CBitFieldMaskBit44 = 0x100000000000 CBitFieldMaskBit45 = 0x200000000000 CBitFieldMaskBit46 = 0x400000000000 CBitFieldMaskBit47 = 0x800000000000 CBitFieldMaskBit48 = 0x1000000000000 CBitFieldMaskBit49 = 0x2000000000000 CBitFieldMaskBit50 = 0x4000000000000 CBitFieldMaskBit51 = 0x8000000000000 CBitFieldMaskBit52 = 0x10000000000000 CBitFieldMaskBit53 = 0x20000000000000 CBitFieldMaskBit54 = 0x40000000000000 CBitFieldMaskBit55 = 0x80000000000000 CBitFieldMaskBit56 = 0x100000000000000 CBitFieldMaskBit57 = 0x200000000000000 CBitFieldMaskBit58 = 0x400000000000000 CBitFieldMaskBit59 = 0x800000000000000 CBitFieldMaskBit60 = 0x1000000000000000 CBitFieldMaskBit61 = 0x2000000000000000 CBitFieldMaskBit62 = 0x4000000000000000 CBitFieldMaskBit63 = 0x8000000000000000 ) type SockaddrStorage struct { Family uint16 Data [122]byte _ uint32 } type HDGeometry struct { Heads uint8 Sectors uint8 Cylinders uint16 Start uint32 } type Statfs_t struct { Type int32 Bsize int32 Frsize int32 _ [4]byte Blocks uint64 Bfree uint64 Files uint64 Ffree uint64 Bavail uint64 Fsid Fsid Namelen int32 Flags int32 Spare [5]int32 _ [4]byte } type TpacketHdr struct { Status uint32 Len uint32 Snaplen uint32 Mac uint16 Net uint16 Sec uint32 Usec uint32 } const ( SizeofTpacketHdr = 0x18 ) type RTCPLLInfo struct { Ctrl int32 Value int32 Max int32 Min int32 Posmult int32 Negmult int32 Clock int32 } type BlkpgPartition struct { Start int64 Length int64 Pno int32 Devname [64]uint8 Volname [64]uint8 _ [4]byte } const ( BLKPG = 0x20001269 ) type CryptoUserAlg struct { Name [64]int8 Driver_name [64]int8 Module_name [64]int8 Type uint32 Mask uint32 Refcnt uint32 Flags uint32 } type CryptoStatAEAD struct { Type [64]int8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Err_cnt uint64 } type CryptoStatAKCipher struct { Type [64]int8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Verify_cnt uint64 Sign_cnt uint64 Err_cnt uint64 } type CryptoStatCipher struct { Type [64]int8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Err_cnt uint64 } type CryptoStatCompress struct { Type [64]int8 Compress_cnt uint64 Compress_tlen uint64 Decompress_cnt uint64 Decompress_tlen uint64 Err_cnt uint64 } type CryptoStatHash struct { Type [64]int8 Hash_cnt uint64 Hash_tlen uint64 Err_cnt uint64 } type CryptoStatKPP struct { Type [64]int8 Setsecret_cnt uint64 Generate_public_key_cnt uint64 Compute_shared_secret_cnt uint64 Err_cnt uint64 } type CryptoStatRNG struct { Type [64]int8 Generate_cnt uint64 Generate_tlen uint64 Seed_cnt uint64 Err_cnt uint64 } type CryptoStatLarval struct { Type [64]int8 } type CryptoReportLarval struct { Type [64]int8 } type CryptoReportHash struct { Type [64]int8 Blocksize uint32 Digestsize uint32 } type CryptoReportCipher struct { Type [64]int8 Blocksize uint32 Min_keysize uint32 Max_keysize uint32 } type CryptoReportBlkCipher struct { Type [64]int8 Geniv [64]int8 Blocksize uint32 Min_keysize uint32 Max_keysize uint32 Ivsize uint32 } type CryptoReportAEAD struct { Type [64]int8 Geniv [64]int8 Blocksize uint32 Maxauthsize uint32 Ivsize uint32 } type CryptoReportComp struct { Type [64]int8 } type CryptoReportRNG struct { Type [64]int8 Seedsize uint32 } type CryptoReportAKCipher struct { Type [64]int8 } type CryptoReportKPP struct { Type [64]int8 } type CryptoReportAcomp struct { Type [64]int8 } type LoopInfo struct { Number int32 Device uint32 Inode uint32 Rdevice uint32 Offset int32 Encrypt_type int32 Encrypt_key_size int32 Flags int32 Name [64]int8 Encrypt_key [32]uint8 Init [2]uint32 Reserved [4]int8 } type TIPCSubscr struct { Seq TIPCServiceRange Timeout uint32 Filter uint32 Handle [8]int8 } type TIPCSIOCLNReq struct { Peer uint32 Id uint32 Linkname [68]int8 } type TIPCSIOCNodeIDReq struct { Peer uint32 Id [16]int8 } type PPSKInfo struct { Assert_sequence uint32 Clear_sequence uint32 Assert_tu PPSKTime Clear_tu PPSKTime Current_mode int32 _ [4]byte } const ( PPS_GETPARAMS = 0x400470a1 PPS_SETPARAMS = 0x800470a2 PPS_GETCAP = 0x400470a3 PPS_FETCH = 0xc00470a4 ) const ( PIDFD_NONBLOCK = 0x80 ) type SysvIpcPerm struct { Key int32 Uid uint32 Gid uint32 Cuid uint32 Cgid uint32 Mode uint32 _ [0]uint8 Seq uint16 _ uint16 _ uint32 _ uint32 } type SysvShmDesc struct { Perm SysvIpcPerm Segsz uint32 Atime uint32 Dtime uint32 Ctime uint32 Cpid int32 Lpid int32 Nattch uint32 Atime_high uint16 Dtime_high uint16 Ctime_high uint16 _ uint16 } ================================================ FILE: vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go ================================================ // cgo -godefs -objdir=/tmp/ppc/cgo -- -Wall -Werror -static -I/tmp/ppc/include linux/types.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build ppc && linux package unix const ( SizeofPtr = 0x4 SizeofLong = 0x4 ) type ( _C_long int32 ) type Timespec struct { Sec int32 Nsec int32 } type Timeval struct { Sec int32 Usec int32 } type Timex struct { Modes uint32 Offset int32 Freq int32 Maxerror int32 Esterror int32 Status int32 Constant int32 Precision int32 Tolerance int32 Time Timeval Tick int32 Ppsfreq int32 Jitter int32 Shift int32 Stabil int32 Jitcnt int32 Calcnt int32 Errcnt int32 Stbcnt int32 Tai int32 _ [44]byte } type Time_t int32 type Tms struct { Utime int32 Stime int32 Cutime int32 Cstime int32 } type Utimbuf struct { Actime int32 Modtime int32 } type Rusage struct { Utime Timeval Stime Timeval Maxrss int32 Ixrss int32 Idrss int32 Isrss int32 Minflt int32 Majflt int32 Nswap int32 Inblock int32 Oublock int32 Msgsnd int32 Msgrcv int32 Nsignals int32 Nvcsw int32 Nivcsw int32 } type Stat_t struct { Dev uint64 Ino uint64 Mode uint32 Nlink uint32 Uid uint32 Gid uint32 Rdev uint64 _ uint16 _ [6]byte Size int64 Blksize int32 _ [4]byte Blocks int64 Atim Timespec Mtim Timespec Ctim Timespec _ uint32 _ uint32 } type Dirent struct { Ino uint64 Off int64 Reclen uint16 Type uint8 Name [256]uint8 _ [5]byte } type Flock_t struct { Type int16 Whence int16 _ [4]byte Start int64 Len int64 Pid int32 _ [4]byte } type DmNameList struct { Dev uint64 Next uint32 Name [0]byte _ [4]byte } const ( FADV_DONTNEED = 0x4 FADV_NOREUSE = 0x5 ) type RawSockaddrNFCLLCP struct { Sa_family uint16 Dev_idx uint32 Target_idx uint32 Nfc_protocol uint32 Dsap uint8 Ssap uint8 Service_name [63]uint8 Service_name_len uint32 } type RawSockaddr struct { Family uint16 Data [14]uint8 } type RawSockaddrAny struct { Addr RawSockaddr Pad [96]uint8 } type Iovec struct { Base *byte Len uint32 } type Msghdr struct { Name *byte Namelen uint32 Iov *Iovec Iovlen uint32 Control *byte Controllen uint32 Flags int32 } type Cmsghdr struct { Len uint32 Level int32 Type int32 } type ifreq struct { Ifrn [16]byte Ifru [16]byte } const ( SizeofSockaddrNFCLLCP = 0x58 SizeofIovec = 0x8 SizeofMsghdr = 0x1c SizeofCmsghdr = 0xc ) const ( SizeofSockFprog = 0x8 ) type PtraceRegs struct { Gpr [32]uint32 Nip uint32 Msr uint32 Orig_gpr3 uint32 Ctr uint32 Link uint32 Xer uint32 Ccr uint32 Mq uint32 Trap uint32 Dar uint32 Dsisr uint32 Result uint32 } type FdSet struct { Bits [32]int32 } type Sysinfo_t struct { Uptime int32 Loads [3]uint32 Totalram uint32 Freeram uint32 Sharedram uint32 Bufferram uint32 Totalswap uint32 Freeswap uint32 Procs uint16 Pad uint16 Totalhigh uint32 Freehigh uint32 Unit uint32 _ [8]uint8 } type Ustat_t struct { Tfree int32 Tinode uint32 Fname [6]uint8 Fpack [6]uint8 } type EpollEvent struct { Events uint32 _ int32 Fd int32 Pad int32 } const ( OPEN_TREE_CLOEXEC = 0x80000 ) const ( POLLRDHUP = 0x2000 ) type Sigset_t struct { Val [32]uint32 } const _C__NSIG = 0x41 const ( SIG_BLOCK = 0x0 SIG_UNBLOCK = 0x1 SIG_SETMASK = 0x2 ) type Siginfo struct { Signo int32 Errno int32 Code int32 _ [116]byte } type Termios struct { Iflag uint32 Oflag uint32 Cflag uint32 Lflag uint32 Cc [19]uint8 Line uint8 Ispeed uint32 Ospeed uint32 } type Taskstats struct { Version uint16 Ac_exitcode uint32 Ac_flag uint8 Ac_nice uint8 _ [6]byte Cpu_count uint64 Cpu_delay_total uint64 Blkio_count uint64 Blkio_delay_total uint64 Swapin_count uint64 Swapin_delay_total uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]uint8 Ac_sched uint8 Ac_pad [3]uint8 _ [4]byte Ac_uid uint32 Ac_gid uint32 Ac_pid uint32 Ac_ppid uint32 Ac_btime uint32 _ [4]byte Ac_etime uint64 Ac_utime uint64 Ac_stime uint64 Ac_minflt uint64 Ac_majflt uint64 Coremem uint64 Virtmem uint64 Hiwater_rss uint64 Hiwater_vm uint64 Read_char uint64 Write_char uint64 Read_syscalls uint64 Write_syscalls uint64 Read_bytes uint64 Write_bytes uint64 Cancelled_write_bytes uint64 Nvcsw uint64 Nivcsw uint64 Ac_utimescaled uint64 Ac_stimescaled uint64 Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 Thrashing_count uint64 Thrashing_delay_total uint64 Ac_btime64 uint64 Compact_count uint64 Compact_delay_total uint64 Ac_tgid uint32 _ [4]byte Ac_tgetime uint64 Ac_exe_dev uint64 Ac_exe_inode uint64 Wpcopy_count uint64 Wpcopy_delay_total uint64 Irq_count uint64 Irq_delay_total uint64 Cpu_delay_max uint64 Cpu_delay_min uint64 Blkio_delay_max uint64 Blkio_delay_min uint64 Swapin_delay_max uint64 Swapin_delay_min uint64 Freepages_delay_max uint64 Freepages_delay_min uint64 Thrashing_delay_max uint64 Thrashing_delay_min uint64 Compact_delay_max uint64 Compact_delay_min uint64 Wpcopy_delay_max uint64 Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 } type cpuMask uint32 const ( _NCPUBITS = 0x20 ) const ( CBitFieldMaskBit0 = 0x8000000000000000 CBitFieldMaskBit1 = 0x4000000000000000 CBitFieldMaskBit2 = 0x2000000000000000 CBitFieldMaskBit3 = 0x1000000000000000 CBitFieldMaskBit4 = 0x800000000000000 CBitFieldMaskBit5 = 0x400000000000000 CBitFieldMaskBit6 = 0x200000000000000 CBitFieldMaskBit7 = 0x100000000000000 CBitFieldMaskBit8 = 0x80000000000000 CBitFieldMaskBit9 = 0x40000000000000 CBitFieldMaskBit10 = 0x20000000000000 CBitFieldMaskBit11 = 0x10000000000000 CBitFieldMaskBit12 = 0x8000000000000 CBitFieldMaskBit13 = 0x4000000000000 CBitFieldMaskBit14 = 0x2000000000000 CBitFieldMaskBit15 = 0x1000000000000 CBitFieldMaskBit16 = 0x800000000000 CBitFieldMaskBit17 = 0x400000000000 CBitFieldMaskBit18 = 0x200000000000 CBitFieldMaskBit19 = 0x100000000000 CBitFieldMaskBit20 = 0x80000000000 CBitFieldMaskBit21 = 0x40000000000 CBitFieldMaskBit22 = 0x20000000000 CBitFieldMaskBit23 = 0x10000000000 CBitFieldMaskBit24 = 0x8000000000 CBitFieldMaskBit25 = 0x4000000000 CBitFieldMaskBit26 = 0x2000000000 CBitFieldMaskBit27 = 0x1000000000 CBitFieldMaskBit28 = 0x800000000 CBitFieldMaskBit29 = 0x400000000 CBitFieldMaskBit30 = 0x200000000 CBitFieldMaskBit31 = 0x100000000 CBitFieldMaskBit32 = 0x80000000 CBitFieldMaskBit33 = 0x40000000 CBitFieldMaskBit34 = 0x20000000 CBitFieldMaskBit35 = 0x10000000 CBitFieldMaskBit36 = 0x8000000 CBitFieldMaskBit37 = 0x4000000 CBitFieldMaskBit38 = 0x2000000 CBitFieldMaskBit39 = 0x1000000 CBitFieldMaskBit40 = 0x800000 CBitFieldMaskBit41 = 0x400000 CBitFieldMaskBit42 = 0x200000 CBitFieldMaskBit43 = 0x100000 CBitFieldMaskBit44 = 0x80000 CBitFieldMaskBit45 = 0x40000 CBitFieldMaskBit46 = 0x20000 CBitFieldMaskBit47 = 0x10000 CBitFieldMaskBit48 = 0x8000 CBitFieldMaskBit49 = 0x4000 CBitFieldMaskBit50 = 0x2000 CBitFieldMaskBit51 = 0x1000 CBitFieldMaskBit52 = 0x800 CBitFieldMaskBit53 = 0x400 CBitFieldMaskBit54 = 0x200 CBitFieldMaskBit55 = 0x100 CBitFieldMaskBit56 = 0x80 CBitFieldMaskBit57 = 0x40 CBitFieldMaskBit58 = 0x20 CBitFieldMaskBit59 = 0x10 CBitFieldMaskBit60 = 0x8 CBitFieldMaskBit61 = 0x4 CBitFieldMaskBit62 = 0x2 CBitFieldMaskBit63 = 0x1 ) type SockaddrStorage struct { Family uint16 Data [122]byte _ uint32 } type HDGeometry struct { Heads uint8 Sectors uint8 Cylinders uint16 Start uint32 } type Statfs_t struct { Type int32 Bsize int32 Blocks uint64 Bfree uint64 Bavail uint64 Files uint64 Ffree uint64 Fsid Fsid Namelen int32 Frsize int32 Flags int32 Spare [4]int32 _ [4]byte } type TpacketHdr struct { Status uint32 Len uint32 Snaplen uint32 Mac uint16 Net uint16 Sec uint32 Usec uint32 } const ( SizeofTpacketHdr = 0x18 ) type RTCPLLInfo struct { Ctrl int32 Value int32 Max int32 Min int32 Posmult int32 Negmult int32 Clock int32 } type BlkpgPartition struct { Start int64 Length int64 Pno int32 Devname [64]uint8 Volname [64]uint8 _ [4]byte } const ( BLKPG = 0x20001269 ) type CryptoUserAlg struct { Name [64]uint8 Driver_name [64]uint8 Module_name [64]uint8 Type uint32 Mask uint32 Refcnt uint32 Flags uint32 } type CryptoStatAEAD struct { Type [64]uint8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Err_cnt uint64 } type CryptoStatAKCipher struct { Type [64]uint8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Verify_cnt uint64 Sign_cnt uint64 Err_cnt uint64 } type CryptoStatCipher struct { Type [64]uint8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Err_cnt uint64 } type CryptoStatCompress struct { Type [64]uint8 Compress_cnt uint64 Compress_tlen uint64 Decompress_cnt uint64 Decompress_tlen uint64 Err_cnt uint64 } type CryptoStatHash struct { Type [64]uint8 Hash_cnt uint64 Hash_tlen uint64 Err_cnt uint64 } type CryptoStatKPP struct { Type [64]uint8 Setsecret_cnt uint64 Generate_public_key_cnt uint64 Compute_shared_secret_cnt uint64 Err_cnt uint64 } type CryptoStatRNG struct { Type [64]uint8 Generate_cnt uint64 Generate_tlen uint64 Seed_cnt uint64 Err_cnt uint64 } type CryptoStatLarval struct { Type [64]uint8 } type CryptoReportLarval struct { Type [64]uint8 } type CryptoReportHash struct { Type [64]uint8 Blocksize uint32 Digestsize uint32 } type CryptoReportCipher struct { Type [64]uint8 Blocksize uint32 Min_keysize uint32 Max_keysize uint32 } type CryptoReportBlkCipher struct { Type [64]uint8 Geniv [64]uint8 Blocksize uint32 Min_keysize uint32 Max_keysize uint32 Ivsize uint32 } type CryptoReportAEAD struct { Type [64]uint8 Geniv [64]uint8 Blocksize uint32 Maxauthsize uint32 Ivsize uint32 } type CryptoReportComp struct { Type [64]uint8 } type CryptoReportRNG struct { Type [64]uint8 Seedsize uint32 } type CryptoReportAKCipher struct { Type [64]uint8 } type CryptoReportKPP struct { Type [64]uint8 } type CryptoReportAcomp struct { Type [64]uint8 } type LoopInfo struct { Number int32 Device uint32 Inode uint32 Rdevice uint32 Offset int32 Encrypt_type int32 Encrypt_key_size int32 Flags int32 Name [64]uint8 Encrypt_key [32]uint8 Init [2]uint32 Reserved [4]uint8 } type TIPCSubscr struct { Seq TIPCServiceRange Timeout uint32 Filter uint32 Handle [8]uint8 } type TIPCSIOCLNReq struct { Peer uint32 Id uint32 Linkname [68]uint8 } type TIPCSIOCNodeIDReq struct { Peer uint32 Id [16]uint8 } type PPSKInfo struct { Assert_sequence uint32 Clear_sequence uint32 Assert_tu PPSKTime Clear_tu PPSKTime Current_mode int32 _ [4]byte } const ( PPS_GETPARAMS = 0x400470a1 PPS_SETPARAMS = 0x800470a2 PPS_GETCAP = 0x400470a3 PPS_FETCH = 0xc00470a4 ) const ( PIDFD_NONBLOCK = 0x800 ) type SysvIpcPerm struct { Key int32 Uid uint32 Gid uint32 Cuid uint32 Cgid uint32 Mode uint32 Seq uint32 _ uint32 _ uint64 _ uint64 } type SysvShmDesc struct { Perm SysvIpcPerm Atime_high uint32 Atime uint32 Dtime_high uint32 Dtime uint32 Ctime_high uint32 Ctime uint32 _ uint32 Segsz uint32 Cpid int32 Lpid int32 Nattch uint32 _ uint32 _ uint32 _ [4]byte } ================================================ FILE: vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go ================================================ // cgo -godefs -objdir=/tmp/ppc64/cgo -- -Wall -Werror -static -I/tmp/ppc64/include linux/types.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build ppc64 && linux package unix const ( SizeofPtr = 0x8 SizeofLong = 0x8 ) type ( _C_long int64 ) type Timespec struct { Sec int64 Nsec int64 } type Timeval struct { Sec int64 Usec int64 } type Timex struct { Modes uint32 Offset int64 Freq int64 Maxerror int64 Esterror int64 Status int32 Constant int64 Precision int64 Tolerance int64 Time Timeval Tick int64 Ppsfreq int64 Jitter int64 Shift int32 Stabil int64 Jitcnt int64 Calcnt int64 Errcnt int64 Stbcnt int64 Tai int32 _ [44]byte } type Time_t int64 type Tms struct { Utime int64 Stime int64 Cutime int64 Cstime int64 } type Utimbuf struct { Actime int64 Modtime int64 } type Rusage struct { Utime Timeval Stime Timeval Maxrss int64 Ixrss int64 Idrss int64 Isrss int64 Minflt int64 Majflt int64 Nswap int64 Inblock int64 Oublock int64 Msgsnd int64 Msgrcv int64 Nsignals int64 Nvcsw int64 Nivcsw int64 } type Stat_t struct { Dev uint64 Ino uint64 Nlink uint64 Mode uint32 Uid uint32 Gid uint32 _ int32 Rdev uint64 Size int64 Blksize int64 Blocks int64 Atim Timespec Mtim Timespec Ctim Timespec _ uint64 _ uint64 _ uint64 } type Dirent struct { Ino uint64 Off int64 Reclen uint16 Type uint8 Name [256]uint8 _ [5]byte } type Flock_t struct { Type int16 Whence int16 Start int64 Len int64 Pid int32 _ [4]byte } type DmNameList struct { Dev uint64 Next uint32 Name [0]byte _ [4]byte } const ( FADV_DONTNEED = 0x4 FADV_NOREUSE = 0x5 ) type RawSockaddrNFCLLCP struct { Sa_family uint16 Dev_idx uint32 Target_idx uint32 Nfc_protocol uint32 Dsap uint8 Ssap uint8 Service_name [63]uint8 Service_name_len uint64 } type RawSockaddr struct { Family uint16 Data [14]uint8 } type RawSockaddrAny struct { Addr RawSockaddr Pad [96]uint8 } type Iovec struct { Base *byte Len uint64 } type Msghdr struct { Name *byte Namelen uint32 Iov *Iovec Iovlen uint64 Control *byte Controllen uint64 Flags int32 _ [4]byte } type Cmsghdr struct { Len uint64 Level int32 Type int32 } type ifreq struct { Ifrn [16]byte Ifru [24]byte } const ( SizeofSockaddrNFCLLCP = 0x60 SizeofIovec = 0x10 SizeofMsghdr = 0x38 SizeofCmsghdr = 0x10 ) const ( SizeofSockFprog = 0x10 ) type PtraceRegs struct { Gpr [32]uint64 Nip uint64 Msr uint64 Orig_gpr3 uint64 Ctr uint64 Link uint64 Xer uint64 Ccr uint64 Softe uint64 Trap uint64 Dar uint64 Dsisr uint64 Result uint64 } type FdSet struct { Bits [16]int64 } type Sysinfo_t struct { Uptime int64 Loads [3]uint64 Totalram uint64 Freeram uint64 Sharedram uint64 Bufferram uint64 Totalswap uint64 Freeswap uint64 Procs uint16 Pad uint16 Totalhigh uint64 Freehigh uint64 Unit uint32 _ [0]uint8 _ [4]byte } type Ustat_t struct { Tfree int32 Tinode uint64 Fname [6]uint8 Fpack [6]uint8 _ [4]byte } type EpollEvent struct { Events uint32 _ int32 Fd int32 Pad int32 } const ( OPEN_TREE_CLOEXEC = 0x80000 ) const ( POLLRDHUP = 0x2000 ) type Sigset_t struct { Val [16]uint64 } const _C__NSIG = 0x41 const ( SIG_BLOCK = 0x0 SIG_UNBLOCK = 0x1 SIG_SETMASK = 0x2 ) type Siginfo struct { Signo int32 Errno int32 Code int32 _ int32 _ [112]byte } type Termios struct { Iflag uint32 Oflag uint32 Cflag uint32 Lflag uint32 Cc [19]uint8 Line uint8 Ispeed uint32 Ospeed uint32 } type Taskstats struct { Version uint16 Ac_exitcode uint32 Ac_flag uint8 Ac_nice uint8 Cpu_count uint64 Cpu_delay_total uint64 Blkio_count uint64 Blkio_delay_total uint64 Swapin_count uint64 Swapin_delay_total uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]uint8 Ac_sched uint8 Ac_pad [3]uint8 _ [4]byte Ac_uid uint32 Ac_gid uint32 Ac_pid uint32 Ac_ppid uint32 Ac_btime uint32 Ac_etime uint64 Ac_utime uint64 Ac_stime uint64 Ac_minflt uint64 Ac_majflt uint64 Coremem uint64 Virtmem uint64 Hiwater_rss uint64 Hiwater_vm uint64 Read_char uint64 Write_char uint64 Read_syscalls uint64 Write_syscalls uint64 Read_bytes uint64 Write_bytes uint64 Cancelled_write_bytes uint64 Nvcsw uint64 Nivcsw uint64 Ac_utimescaled uint64 Ac_stimescaled uint64 Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 Thrashing_count uint64 Thrashing_delay_total uint64 Ac_btime64 uint64 Compact_count uint64 Compact_delay_total uint64 Ac_tgid uint32 Ac_tgetime uint64 Ac_exe_dev uint64 Ac_exe_inode uint64 Wpcopy_count uint64 Wpcopy_delay_total uint64 Irq_count uint64 Irq_delay_total uint64 Cpu_delay_max uint64 Cpu_delay_min uint64 Blkio_delay_max uint64 Blkio_delay_min uint64 Swapin_delay_max uint64 Swapin_delay_min uint64 Freepages_delay_max uint64 Freepages_delay_min uint64 Thrashing_delay_max uint64 Thrashing_delay_min uint64 Compact_delay_max uint64 Compact_delay_min uint64 Wpcopy_delay_max uint64 Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 } type cpuMask uint64 const ( _NCPUBITS = 0x40 ) const ( CBitFieldMaskBit0 = 0x8000000000000000 CBitFieldMaskBit1 = 0x4000000000000000 CBitFieldMaskBit2 = 0x2000000000000000 CBitFieldMaskBit3 = 0x1000000000000000 CBitFieldMaskBit4 = 0x800000000000000 CBitFieldMaskBit5 = 0x400000000000000 CBitFieldMaskBit6 = 0x200000000000000 CBitFieldMaskBit7 = 0x100000000000000 CBitFieldMaskBit8 = 0x80000000000000 CBitFieldMaskBit9 = 0x40000000000000 CBitFieldMaskBit10 = 0x20000000000000 CBitFieldMaskBit11 = 0x10000000000000 CBitFieldMaskBit12 = 0x8000000000000 CBitFieldMaskBit13 = 0x4000000000000 CBitFieldMaskBit14 = 0x2000000000000 CBitFieldMaskBit15 = 0x1000000000000 CBitFieldMaskBit16 = 0x800000000000 CBitFieldMaskBit17 = 0x400000000000 CBitFieldMaskBit18 = 0x200000000000 CBitFieldMaskBit19 = 0x100000000000 CBitFieldMaskBit20 = 0x80000000000 CBitFieldMaskBit21 = 0x40000000000 CBitFieldMaskBit22 = 0x20000000000 CBitFieldMaskBit23 = 0x10000000000 CBitFieldMaskBit24 = 0x8000000000 CBitFieldMaskBit25 = 0x4000000000 CBitFieldMaskBit26 = 0x2000000000 CBitFieldMaskBit27 = 0x1000000000 CBitFieldMaskBit28 = 0x800000000 CBitFieldMaskBit29 = 0x400000000 CBitFieldMaskBit30 = 0x200000000 CBitFieldMaskBit31 = 0x100000000 CBitFieldMaskBit32 = 0x80000000 CBitFieldMaskBit33 = 0x40000000 CBitFieldMaskBit34 = 0x20000000 CBitFieldMaskBit35 = 0x10000000 CBitFieldMaskBit36 = 0x8000000 CBitFieldMaskBit37 = 0x4000000 CBitFieldMaskBit38 = 0x2000000 CBitFieldMaskBit39 = 0x1000000 CBitFieldMaskBit40 = 0x800000 CBitFieldMaskBit41 = 0x400000 CBitFieldMaskBit42 = 0x200000 CBitFieldMaskBit43 = 0x100000 CBitFieldMaskBit44 = 0x80000 CBitFieldMaskBit45 = 0x40000 CBitFieldMaskBit46 = 0x20000 CBitFieldMaskBit47 = 0x10000 CBitFieldMaskBit48 = 0x8000 CBitFieldMaskBit49 = 0x4000 CBitFieldMaskBit50 = 0x2000 CBitFieldMaskBit51 = 0x1000 CBitFieldMaskBit52 = 0x800 CBitFieldMaskBit53 = 0x400 CBitFieldMaskBit54 = 0x200 CBitFieldMaskBit55 = 0x100 CBitFieldMaskBit56 = 0x80 CBitFieldMaskBit57 = 0x40 CBitFieldMaskBit58 = 0x20 CBitFieldMaskBit59 = 0x10 CBitFieldMaskBit60 = 0x8 CBitFieldMaskBit61 = 0x4 CBitFieldMaskBit62 = 0x2 CBitFieldMaskBit63 = 0x1 ) type SockaddrStorage struct { Family uint16 Data [118]byte _ uint64 } type HDGeometry struct { Heads uint8 Sectors uint8 Cylinders uint16 Start uint64 } type Statfs_t struct { Type int64 Bsize int64 Blocks uint64 Bfree uint64 Bavail uint64 Files uint64 Ffree uint64 Fsid Fsid Namelen int64 Frsize int64 Flags int64 Spare [4]int64 } type TpacketHdr struct { Status uint64 Len uint32 Snaplen uint32 Mac uint16 Net uint16 Sec uint32 Usec uint32 _ [4]byte } const ( SizeofTpacketHdr = 0x20 ) type RTCPLLInfo struct { Ctrl int32 Value int32 Max int32 Min int32 Posmult int32 Negmult int32 Clock int64 } type BlkpgPartition struct { Start int64 Length int64 Pno int32 Devname [64]uint8 Volname [64]uint8 _ [4]byte } const ( BLKPG = 0x20001269 ) type CryptoUserAlg struct { Name [64]uint8 Driver_name [64]uint8 Module_name [64]uint8 Type uint32 Mask uint32 Refcnt uint32 Flags uint32 } type CryptoStatAEAD struct { Type [64]uint8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Err_cnt uint64 } type CryptoStatAKCipher struct { Type [64]uint8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Verify_cnt uint64 Sign_cnt uint64 Err_cnt uint64 } type CryptoStatCipher struct { Type [64]uint8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Err_cnt uint64 } type CryptoStatCompress struct { Type [64]uint8 Compress_cnt uint64 Compress_tlen uint64 Decompress_cnt uint64 Decompress_tlen uint64 Err_cnt uint64 } type CryptoStatHash struct { Type [64]uint8 Hash_cnt uint64 Hash_tlen uint64 Err_cnt uint64 } type CryptoStatKPP struct { Type [64]uint8 Setsecret_cnt uint64 Generate_public_key_cnt uint64 Compute_shared_secret_cnt uint64 Err_cnt uint64 } type CryptoStatRNG struct { Type [64]uint8 Generate_cnt uint64 Generate_tlen uint64 Seed_cnt uint64 Err_cnt uint64 } type CryptoStatLarval struct { Type [64]uint8 } type CryptoReportLarval struct { Type [64]uint8 } type CryptoReportHash struct { Type [64]uint8 Blocksize uint32 Digestsize uint32 } type CryptoReportCipher struct { Type [64]uint8 Blocksize uint32 Min_keysize uint32 Max_keysize uint32 } type CryptoReportBlkCipher struct { Type [64]uint8 Geniv [64]uint8 Blocksize uint32 Min_keysize uint32 Max_keysize uint32 Ivsize uint32 } type CryptoReportAEAD struct { Type [64]uint8 Geniv [64]uint8 Blocksize uint32 Maxauthsize uint32 Ivsize uint32 } type CryptoReportComp struct { Type [64]uint8 } type CryptoReportRNG struct { Type [64]uint8 Seedsize uint32 } type CryptoReportAKCipher struct { Type [64]uint8 } type CryptoReportKPP struct { Type [64]uint8 } type CryptoReportAcomp struct { Type [64]uint8 } type LoopInfo struct { Number int32 Device uint64 Inode uint64 Rdevice uint64 Offset int32 Encrypt_type int32 Encrypt_key_size int32 Flags int32 Name [64]uint8 Encrypt_key [32]uint8 Init [2]uint64 Reserved [4]uint8 _ [4]byte } type TIPCSubscr struct { Seq TIPCServiceRange Timeout uint32 Filter uint32 Handle [8]uint8 } type TIPCSIOCLNReq struct { Peer uint32 Id uint32 Linkname [68]uint8 } type TIPCSIOCNodeIDReq struct { Peer uint32 Id [16]uint8 } type PPSKInfo struct { Assert_sequence uint32 Clear_sequence uint32 Assert_tu PPSKTime Clear_tu PPSKTime Current_mode int32 _ [4]byte } const ( PPS_GETPARAMS = 0x400870a1 PPS_SETPARAMS = 0x800870a2 PPS_GETCAP = 0x400870a3 PPS_FETCH = 0xc00870a4 ) const ( PIDFD_NONBLOCK = 0x800 ) type SysvIpcPerm struct { Key int32 Uid uint32 Gid uint32 Cuid uint32 Cgid uint32 Mode uint32 Seq uint32 _ uint32 _ uint64 _ uint64 } type SysvShmDesc struct { Perm SysvIpcPerm Atime int64 Dtime int64 Ctime int64 Segsz uint64 Cpid int32 Lpid int32 Nattch uint64 _ uint64 _ uint64 } ================================================ FILE: vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go ================================================ // cgo -godefs -objdir=/tmp/ppc64le/cgo -- -Wall -Werror -static -I/tmp/ppc64le/include linux/types.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build ppc64le && linux package unix const ( SizeofPtr = 0x8 SizeofLong = 0x8 ) type ( _C_long int64 ) type Timespec struct { Sec int64 Nsec int64 } type Timeval struct { Sec int64 Usec int64 } type Timex struct { Modes uint32 Offset int64 Freq int64 Maxerror int64 Esterror int64 Status int32 Constant int64 Precision int64 Tolerance int64 Time Timeval Tick int64 Ppsfreq int64 Jitter int64 Shift int32 Stabil int64 Jitcnt int64 Calcnt int64 Errcnt int64 Stbcnt int64 Tai int32 _ [44]byte } type Time_t int64 type Tms struct { Utime int64 Stime int64 Cutime int64 Cstime int64 } type Utimbuf struct { Actime int64 Modtime int64 } type Rusage struct { Utime Timeval Stime Timeval Maxrss int64 Ixrss int64 Idrss int64 Isrss int64 Minflt int64 Majflt int64 Nswap int64 Inblock int64 Oublock int64 Msgsnd int64 Msgrcv int64 Nsignals int64 Nvcsw int64 Nivcsw int64 } type Stat_t struct { Dev uint64 Ino uint64 Nlink uint64 Mode uint32 Uid uint32 Gid uint32 _ int32 Rdev uint64 Size int64 Blksize int64 Blocks int64 Atim Timespec Mtim Timespec Ctim Timespec _ uint64 _ uint64 _ uint64 } type Dirent struct { Ino uint64 Off int64 Reclen uint16 Type uint8 Name [256]uint8 _ [5]byte } type Flock_t struct { Type int16 Whence int16 Start int64 Len int64 Pid int32 _ [4]byte } type DmNameList struct { Dev uint64 Next uint32 Name [0]byte _ [4]byte } const ( FADV_DONTNEED = 0x4 FADV_NOREUSE = 0x5 ) type RawSockaddrNFCLLCP struct { Sa_family uint16 Dev_idx uint32 Target_idx uint32 Nfc_protocol uint32 Dsap uint8 Ssap uint8 Service_name [63]uint8 Service_name_len uint64 } type RawSockaddr struct { Family uint16 Data [14]uint8 } type RawSockaddrAny struct { Addr RawSockaddr Pad [96]uint8 } type Iovec struct { Base *byte Len uint64 } type Msghdr struct { Name *byte Namelen uint32 Iov *Iovec Iovlen uint64 Control *byte Controllen uint64 Flags int32 _ [4]byte } type Cmsghdr struct { Len uint64 Level int32 Type int32 } type ifreq struct { Ifrn [16]byte Ifru [24]byte } const ( SizeofSockaddrNFCLLCP = 0x60 SizeofIovec = 0x10 SizeofMsghdr = 0x38 SizeofCmsghdr = 0x10 ) const ( SizeofSockFprog = 0x10 ) type PtraceRegs struct { Gpr [32]uint64 Nip uint64 Msr uint64 Orig_gpr3 uint64 Ctr uint64 Link uint64 Xer uint64 Ccr uint64 Softe uint64 Trap uint64 Dar uint64 Dsisr uint64 Result uint64 } type FdSet struct { Bits [16]int64 } type Sysinfo_t struct { Uptime int64 Loads [3]uint64 Totalram uint64 Freeram uint64 Sharedram uint64 Bufferram uint64 Totalswap uint64 Freeswap uint64 Procs uint16 Pad uint16 Totalhigh uint64 Freehigh uint64 Unit uint32 _ [0]uint8 _ [4]byte } type Ustat_t struct { Tfree int32 Tinode uint64 Fname [6]uint8 Fpack [6]uint8 _ [4]byte } type EpollEvent struct { Events uint32 _ int32 Fd int32 Pad int32 } const ( OPEN_TREE_CLOEXEC = 0x80000 ) const ( POLLRDHUP = 0x2000 ) type Sigset_t struct { Val [16]uint64 } const _C__NSIG = 0x41 const ( SIG_BLOCK = 0x0 SIG_UNBLOCK = 0x1 SIG_SETMASK = 0x2 ) type Siginfo struct { Signo int32 Errno int32 Code int32 _ int32 _ [112]byte } type Termios struct { Iflag uint32 Oflag uint32 Cflag uint32 Lflag uint32 Cc [19]uint8 Line uint8 Ispeed uint32 Ospeed uint32 } type Taskstats struct { Version uint16 Ac_exitcode uint32 Ac_flag uint8 Ac_nice uint8 Cpu_count uint64 Cpu_delay_total uint64 Blkio_count uint64 Blkio_delay_total uint64 Swapin_count uint64 Swapin_delay_total uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]uint8 Ac_sched uint8 Ac_pad [3]uint8 _ [4]byte Ac_uid uint32 Ac_gid uint32 Ac_pid uint32 Ac_ppid uint32 Ac_btime uint32 Ac_etime uint64 Ac_utime uint64 Ac_stime uint64 Ac_minflt uint64 Ac_majflt uint64 Coremem uint64 Virtmem uint64 Hiwater_rss uint64 Hiwater_vm uint64 Read_char uint64 Write_char uint64 Read_syscalls uint64 Write_syscalls uint64 Read_bytes uint64 Write_bytes uint64 Cancelled_write_bytes uint64 Nvcsw uint64 Nivcsw uint64 Ac_utimescaled uint64 Ac_stimescaled uint64 Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 Thrashing_count uint64 Thrashing_delay_total uint64 Ac_btime64 uint64 Compact_count uint64 Compact_delay_total uint64 Ac_tgid uint32 Ac_tgetime uint64 Ac_exe_dev uint64 Ac_exe_inode uint64 Wpcopy_count uint64 Wpcopy_delay_total uint64 Irq_count uint64 Irq_delay_total uint64 Cpu_delay_max uint64 Cpu_delay_min uint64 Blkio_delay_max uint64 Blkio_delay_min uint64 Swapin_delay_max uint64 Swapin_delay_min uint64 Freepages_delay_max uint64 Freepages_delay_min uint64 Thrashing_delay_max uint64 Thrashing_delay_min uint64 Compact_delay_max uint64 Compact_delay_min uint64 Wpcopy_delay_max uint64 Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 } type cpuMask uint64 const ( _NCPUBITS = 0x40 ) const ( CBitFieldMaskBit0 = 0x1 CBitFieldMaskBit1 = 0x2 CBitFieldMaskBit2 = 0x4 CBitFieldMaskBit3 = 0x8 CBitFieldMaskBit4 = 0x10 CBitFieldMaskBit5 = 0x20 CBitFieldMaskBit6 = 0x40 CBitFieldMaskBit7 = 0x80 CBitFieldMaskBit8 = 0x100 CBitFieldMaskBit9 = 0x200 CBitFieldMaskBit10 = 0x400 CBitFieldMaskBit11 = 0x800 CBitFieldMaskBit12 = 0x1000 CBitFieldMaskBit13 = 0x2000 CBitFieldMaskBit14 = 0x4000 CBitFieldMaskBit15 = 0x8000 CBitFieldMaskBit16 = 0x10000 CBitFieldMaskBit17 = 0x20000 CBitFieldMaskBit18 = 0x40000 CBitFieldMaskBit19 = 0x80000 CBitFieldMaskBit20 = 0x100000 CBitFieldMaskBit21 = 0x200000 CBitFieldMaskBit22 = 0x400000 CBitFieldMaskBit23 = 0x800000 CBitFieldMaskBit24 = 0x1000000 CBitFieldMaskBit25 = 0x2000000 CBitFieldMaskBit26 = 0x4000000 CBitFieldMaskBit27 = 0x8000000 CBitFieldMaskBit28 = 0x10000000 CBitFieldMaskBit29 = 0x20000000 CBitFieldMaskBit30 = 0x40000000 CBitFieldMaskBit31 = 0x80000000 CBitFieldMaskBit32 = 0x100000000 CBitFieldMaskBit33 = 0x200000000 CBitFieldMaskBit34 = 0x400000000 CBitFieldMaskBit35 = 0x800000000 CBitFieldMaskBit36 = 0x1000000000 CBitFieldMaskBit37 = 0x2000000000 CBitFieldMaskBit38 = 0x4000000000 CBitFieldMaskBit39 = 0x8000000000 CBitFieldMaskBit40 = 0x10000000000 CBitFieldMaskBit41 = 0x20000000000 CBitFieldMaskBit42 = 0x40000000000 CBitFieldMaskBit43 = 0x80000000000 CBitFieldMaskBit44 = 0x100000000000 CBitFieldMaskBit45 = 0x200000000000 CBitFieldMaskBit46 = 0x400000000000 CBitFieldMaskBit47 = 0x800000000000 CBitFieldMaskBit48 = 0x1000000000000 CBitFieldMaskBit49 = 0x2000000000000 CBitFieldMaskBit50 = 0x4000000000000 CBitFieldMaskBit51 = 0x8000000000000 CBitFieldMaskBit52 = 0x10000000000000 CBitFieldMaskBit53 = 0x20000000000000 CBitFieldMaskBit54 = 0x40000000000000 CBitFieldMaskBit55 = 0x80000000000000 CBitFieldMaskBit56 = 0x100000000000000 CBitFieldMaskBit57 = 0x200000000000000 CBitFieldMaskBit58 = 0x400000000000000 CBitFieldMaskBit59 = 0x800000000000000 CBitFieldMaskBit60 = 0x1000000000000000 CBitFieldMaskBit61 = 0x2000000000000000 CBitFieldMaskBit62 = 0x4000000000000000 CBitFieldMaskBit63 = 0x8000000000000000 ) type SockaddrStorage struct { Family uint16 Data [118]byte _ uint64 } type HDGeometry struct { Heads uint8 Sectors uint8 Cylinders uint16 Start uint64 } type Statfs_t struct { Type int64 Bsize int64 Blocks uint64 Bfree uint64 Bavail uint64 Files uint64 Ffree uint64 Fsid Fsid Namelen int64 Frsize int64 Flags int64 Spare [4]int64 } type TpacketHdr struct { Status uint64 Len uint32 Snaplen uint32 Mac uint16 Net uint16 Sec uint32 Usec uint32 _ [4]byte } const ( SizeofTpacketHdr = 0x20 ) type RTCPLLInfo struct { Ctrl int32 Value int32 Max int32 Min int32 Posmult int32 Negmult int32 Clock int64 } type BlkpgPartition struct { Start int64 Length int64 Pno int32 Devname [64]uint8 Volname [64]uint8 _ [4]byte } const ( BLKPG = 0x20001269 ) type CryptoUserAlg struct { Name [64]uint8 Driver_name [64]uint8 Module_name [64]uint8 Type uint32 Mask uint32 Refcnt uint32 Flags uint32 } type CryptoStatAEAD struct { Type [64]uint8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Err_cnt uint64 } type CryptoStatAKCipher struct { Type [64]uint8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Verify_cnt uint64 Sign_cnt uint64 Err_cnt uint64 } type CryptoStatCipher struct { Type [64]uint8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Err_cnt uint64 } type CryptoStatCompress struct { Type [64]uint8 Compress_cnt uint64 Compress_tlen uint64 Decompress_cnt uint64 Decompress_tlen uint64 Err_cnt uint64 } type CryptoStatHash struct { Type [64]uint8 Hash_cnt uint64 Hash_tlen uint64 Err_cnt uint64 } type CryptoStatKPP struct { Type [64]uint8 Setsecret_cnt uint64 Generate_public_key_cnt uint64 Compute_shared_secret_cnt uint64 Err_cnt uint64 } type CryptoStatRNG struct { Type [64]uint8 Generate_cnt uint64 Generate_tlen uint64 Seed_cnt uint64 Err_cnt uint64 } type CryptoStatLarval struct { Type [64]uint8 } type CryptoReportLarval struct { Type [64]uint8 } type CryptoReportHash struct { Type [64]uint8 Blocksize uint32 Digestsize uint32 } type CryptoReportCipher struct { Type [64]uint8 Blocksize uint32 Min_keysize uint32 Max_keysize uint32 } type CryptoReportBlkCipher struct { Type [64]uint8 Geniv [64]uint8 Blocksize uint32 Min_keysize uint32 Max_keysize uint32 Ivsize uint32 } type CryptoReportAEAD struct { Type [64]uint8 Geniv [64]uint8 Blocksize uint32 Maxauthsize uint32 Ivsize uint32 } type CryptoReportComp struct { Type [64]uint8 } type CryptoReportRNG struct { Type [64]uint8 Seedsize uint32 } type CryptoReportAKCipher struct { Type [64]uint8 } type CryptoReportKPP struct { Type [64]uint8 } type CryptoReportAcomp struct { Type [64]uint8 } type LoopInfo struct { Number int32 Device uint64 Inode uint64 Rdevice uint64 Offset int32 Encrypt_type int32 Encrypt_key_size int32 Flags int32 Name [64]uint8 Encrypt_key [32]uint8 Init [2]uint64 Reserved [4]uint8 _ [4]byte } type TIPCSubscr struct { Seq TIPCServiceRange Timeout uint32 Filter uint32 Handle [8]uint8 } type TIPCSIOCLNReq struct { Peer uint32 Id uint32 Linkname [68]uint8 } type TIPCSIOCNodeIDReq struct { Peer uint32 Id [16]uint8 } type PPSKInfo struct { Assert_sequence uint32 Clear_sequence uint32 Assert_tu PPSKTime Clear_tu PPSKTime Current_mode int32 _ [4]byte } const ( PPS_GETPARAMS = 0x400870a1 PPS_SETPARAMS = 0x800870a2 PPS_GETCAP = 0x400870a3 PPS_FETCH = 0xc00870a4 ) const ( PIDFD_NONBLOCK = 0x800 ) type SysvIpcPerm struct { Key int32 Uid uint32 Gid uint32 Cuid uint32 Cgid uint32 Mode uint32 Seq uint32 _ uint32 _ uint64 _ uint64 } type SysvShmDesc struct { Perm SysvIpcPerm Atime int64 Dtime int64 Ctime int64 Segsz uint64 Cpid int32 Lpid int32 Nattch uint64 _ uint64 _ uint64 } ================================================ FILE: vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go ================================================ // cgo -godefs -objdir=/tmp/riscv64/cgo -- -Wall -Werror -static -I/tmp/riscv64/include linux/types.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build riscv64 && linux package unix const ( SizeofPtr = 0x8 SizeofLong = 0x8 ) type ( _C_long int64 ) type Timespec struct { Sec int64 Nsec int64 } type Timeval struct { Sec int64 Usec int64 } type Timex struct { Modes uint32 Offset int64 Freq int64 Maxerror int64 Esterror int64 Status int32 Constant int64 Precision int64 Tolerance int64 Time Timeval Tick int64 Ppsfreq int64 Jitter int64 Shift int32 Stabil int64 Jitcnt int64 Calcnt int64 Errcnt int64 Stbcnt int64 Tai int32 _ [44]byte } type Time_t int64 type Tms struct { Utime int64 Stime int64 Cutime int64 Cstime int64 } type Utimbuf struct { Actime int64 Modtime int64 } type Rusage struct { Utime Timeval Stime Timeval Maxrss int64 Ixrss int64 Idrss int64 Isrss int64 Minflt int64 Majflt int64 Nswap int64 Inblock int64 Oublock int64 Msgsnd int64 Msgrcv int64 Nsignals int64 Nvcsw int64 Nivcsw int64 } type Stat_t struct { Dev uint64 Ino uint64 Mode uint32 Nlink uint32 Uid uint32 Gid uint32 Rdev uint64 _ uint64 Size int64 Blksize int32 _ int32 Blocks int64 Atim Timespec Mtim Timespec Ctim Timespec _ [2]int32 } type Dirent struct { Ino uint64 Off int64 Reclen uint16 Type uint8 Name [256]uint8 _ [5]byte } type Flock_t struct { Type int16 Whence int16 Start int64 Len int64 Pid int32 _ [4]byte } type DmNameList struct { Dev uint64 Next uint32 Name [0]byte _ [4]byte } const ( FADV_DONTNEED = 0x4 FADV_NOREUSE = 0x5 ) type RawSockaddrNFCLLCP struct { Sa_family uint16 Dev_idx uint32 Target_idx uint32 Nfc_protocol uint32 Dsap uint8 Ssap uint8 Service_name [63]uint8 Service_name_len uint64 } type RawSockaddr struct { Family uint16 Data [14]uint8 } type RawSockaddrAny struct { Addr RawSockaddr Pad [96]uint8 } type Iovec struct { Base *byte Len uint64 } type Msghdr struct { Name *byte Namelen uint32 Iov *Iovec Iovlen uint64 Control *byte Controllen uint64 Flags int32 _ [4]byte } type Cmsghdr struct { Len uint64 Level int32 Type int32 } type ifreq struct { Ifrn [16]byte Ifru [24]byte } const ( SizeofSockaddrNFCLLCP = 0x60 SizeofIovec = 0x10 SizeofMsghdr = 0x38 SizeofCmsghdr = 0x10 ) const ( SizeofSockFprog = 0x10 ) type PtraceRegs struct { Pc uint64 Ra uint64 Sp uint64 Gp uint64 Tp uint64 T0 uint64 T1 uint64 T2 uint64 S0 uint64 S1 uint64 A0 uint64 A1 uint64 A2 uint64 A3 uint64 A4 uint64 A5 uint64 A6 uint64 A7 uint64 S2 uint64 S3 uint64 S4 uint64 S5 uint64 S6 uint64 S7 uint64 S8 uint64 S9 uint64 S10 uint64 S11 uint64 T3 uint64 T4 uint64 T5 uint64 T6 uint64 } type FdSet struct { Bits [16]int64 } type Sysinfo_t struct { Uptime int64 Loads [3]uint64 Totalram uint64 Freeram uint64 Sharedram uint64 Bufferram uint64 Totalswap uint64 Freeswap uint64 Procs uint16 Pad uint16 Totalhigh uint64 Freehigh uint64 Unit uint32 _ [0]uint8 _ [4]byte } type Ustat_t struct { Tfree int32 Tinode uint64 Fname [6]uint8 Fpack [6]uint8 _ [4]byte } type EpollEvent struct { Events uint32 _ int32 Fd int32 Pad int32 } const ( OPEN_TREE_CLOEXEC = 0x80000 ) const ( POLLRDHUP = 0x2000 ) type Sigset_t struct { Val [16]uint64 } const _C__NSIG = 0x41 const ( SIG_BLOCK = 0x0 SIG_UNBLOCK = 0x1 SIG_SETMASK = 0x2 ) type Siginfo struct { Signo int32 Errno int32 Code int32 _ int32 _ [112]byte } type Termios struct { Iflag uint32 Oflag uint32 Cflag uint32 Lflag uint32 Line uint8 Cc [19]uint8 Ispeed uint32 Ospeed uint32 } type Taskstats struct { Version uint16 Ac_exitcode uint32 Ac_flag uint8 Ac_nice uint8 Cpu_count uint64 Cpu_delay_total uint64 Blkio_count uint64 Blkio_delay_total uint64 Swapin_count uint64 Swapin_delay_total uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]uint8 Ac_sched uint8 Ac_pad [3]uint8 _ [4]byte Ac_uid uint32 Ac_gid uint32 Ac_pid uint32 Ac_ppid uint32 Ac_btime uint32 Ac_etime uint64 Ac_utime uint64 Ac_stime uint64 Ac_minflt uint64 Ac_majflt uint64 Coremem uint64 Virtmem uint64 Hiwater_rss uint64 Hiwater_vm uint64 Read_char uint64 Write_char uint64 Read_syscalls uint64 Write_syscalls uint64 Read_bytes uint64 Write_bytes uint64 Cancelled_write_bytes uint64 Nvcsw uint64 Nivcsw uint64 Ac_utimescaled uint64 Ac_stimescaled uint64 Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 Thrashing_count uint64 Thrashing_delay_total uint64 Ac_btime64 uint64 Compact_count uint64 Compact_delay_total uint64 Ac_tgid uint32 Ac_tgetime uint64 Ac_exe_dev uint64 Ac_exe_inode uint64 Wpcopy_count uint64 Wpcopy_delay_total uint64 Irq_count uint64 Irq_delay_total uint64 Cpu_delay_max uint64 Cpu_delay_min uint64 Blkio_delay_max uint64 Blkio_delay_min uint64 Swapin_delay_max uint64 Swapin_delay_min uint64 Freepages_delay_max uint64 Freepages_delay_min uint64 Thrashing_delay_max uint64 Thrashing_delay_min uint64 Compact_delay_max uint64 Compact_delay_min uint64 Wpcopy_delay_max uint64 Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 } type cpuMask uint64 const ( _NCPUBITS = 0x40 ) const ( CBitFieldMaskBit0 = 0x1 CBitFieldMaskBit1 = 0x2 CBitFieldMaskBit2 = 0x4 CBitFieldMaskBit3 = 0x8 CBitFieldMaskBit4 = 0x10 CBitFieldMaskBit5 = 0x20 CBitFieldMaskBit6 = 0x40 CBitFieldMaskBit7 = 0x80 CBitFieldMaskBit8 = 0x100 CBitFieldMaskBit9 = 0x200 CBitFieldMaskBit10 = 0x400 CBitFieldMaskBit11 = 0x800 CBitFieldMaskBit12 = 0x1000 CBitFieldMaskBit13 = 0x2000 CBitFieldMaskBit14 = 0x4000 CBitFieldMaskBit15 = 0x8000 CBitFieldMaskBit16 = 0x10000 CBitFieldMaskBit17 = 0x20000 CBitFieldMaskBit18 = 0x40000 CBitFieldMaskBit19 = 0x80000 CBitFieldMaskBit20 = 0x100000 CBitFieldMaskBit21 = 0x200000 CBitFieldMaskBit22 = 0x400000 CBitFieldMaskBit23 = 0x800000 CBitFieldMaskBit24 = 0x1000000 CBitFieldMaskBit25 = 0x2000000 CBitFieldMaskBit26 = 0x4000000 CBitFieldMaskBit27 = 0x8000000 CBitFieldMaskBit28 = 0x10000000 CBitFieldMaskBit29 = 0x20000000 CBitFieldMaskBit30 = 0x40000000 CBitFieldMaskBit31 = 0x80000000 CBitFieldMaskBit32 = 0x100000000 CBitFieldMaskBit33 = 0x200000000 CBitFieldMaskBit34 = 0x400000000 CBitFieldMaskBit35 = 0x800000000 CBitFieldMaskBit36 = 0x1000000000 CBitFieldMaskBit37 = 0x2000000000 CBitFieldMaskBit38 = 0x4000000000 CBitFieldMaskBit39 = 0x8000000000 CBitFieldMaskBit40 = 0x10000000000 CBitFieldMaskBit41 = 0x20000000000 CBitFieldMaskBit42 = 0x40000000000 CBitFieldMaskBit43 = 0x80000000000 CBitFieldMaskBit44 = 0x100000000000 CBitFieldMaskBit45 = 0x200000000000 CBitFieldMaskBit46 = 0x400000000000 CBitFieldMaskBit47 = 0x800000000000 CBitFieldMaskBit48 = 0x1000000000000 CBitFieldMaskBit49 = 0x2000000000000 CBitFieldMaskBit50 = 0x4000000000000 CBitFieldMaskBit51 = 0x8000000000000 CBitFieldMaskBit52 = 0x10000000000000 CBitFieldMaskBit53 = 0x20000000000000 CBitFieldMaskBit54 = 0x40000000000000 CBitFieldMaskBit55 = 0x80000000000000 CBitFieldMaskBit56 = 0x100000000000000 CBitFieldMaskBit57 = 0x200000000000000 CBitFieldMaskBit58 = 0x400000000000000 CBitFieldMaskBit59 = 0x800000000000000 CBitFieldMaskBit60 = 0x1000000000000000 CBitFieldMaskBit61 = 0x2000000000000000 CBitFieldMaskBit62 = 0x4000000000000000 CBitFieldMaskBit63 = 0x8000000000000000 ) type SockaddrStorage struct { Family uint16 Data [118]byte _ uint64 } type HDGeometry struct { Heads uint8 Sectors uint8 Cylinders uint16 Start uint64 } type Statfs_t struct { Type int64 Bsize int64 Blocks uint64 Bfree uint64 Bavail uint64 Files uint64 Ffree uint64 Fsid Fsid Namelen int64 Frsize int64 Flags int64 Spare [4]int64 } type TpacketHdr struct { Status uint64 Len uint32 Snaplen uint32 Mac uint16 Net uint16 Sec uint32 Usec uint32 _ [4]byte } const ( SizeofTpacketHdr = 0x20 ) type RTCPLLInfo struct { Ctrl int32 Value int32 Max int32 Min int32 Posmult int32 Negmult int32 Clock int64 } type BlkpgPartition struct { Start int64 Length int64 Pno int32 Devname [64]uint8 Volname [64]uint8 _ [4]byte } const ( BLKPG = 0x1269 ) type CryptoUserAlg struct { Name [64]uint8 Driver_name [64]uint8 Module_name [64]uint8 Type uint32 Mask uint32 Refcnt uint32 Flags uint32 } type CryptoStatAEAD struct { Type [64]uint8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Err_cnt uint64 } type CryptoStatAKCipher struct { Type [64]uint8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Verify_cnt uint64 Sign_cnt uint64 Err_cnt uint64 } type CryptoStatCipher struct { Type [64]uint8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Err_cnt uint64 } type CryptoStatCompress struct { Type [64]uint8 Compress_cnt uint64 Compress_tlen uint64 Decompress_cnt uint64 Decompress_tlen uint64 Err_cnt uint64 } type CryptoStatHash struct { Type [64]uint8 Hash_cnt uint64 Hash_tlen uint64 Err_cnt uint64 } type CryptoStatKPP struct { Type [64]uint8 Setsecret_cnt uint64 Generate_public_key_cnt uint64 Compute_shared_secret_cnt uint64 Err_cnt uint64 } type CryptoStatRNG struct { Type [64]uint8 Generate_cnt uint64 Generate_tlen uint64 Seed_cnt uint64 Err_cnt uint64 } type CryptoStatLarval struct { Type [64]uint8 } type CryptoReportLarval struct { Type [64]uint8 } type CryptoReportHash struct { Type [64]uint8 Blocksize uint32 Digestsize uint32 } type CryptoReportCipher struct { Type [64]uint8 Blocksize uint32 Min_keysize uint32 Max_keysize uint32 } type CryptoReportBlkCipher struct { Type [64]uint8 Geniv [64]uint8 Blocksize uint32 Min_keysize uint32 Max_keysize uint32 Ivsize uint32 } type CryptoReportAEAD struct { Type [64]uint8 Geniv [64]uint8 Blocksize uint32 Maxauthsize uint32 Ivsize uint32 } type CryptoReportComp struct { Type [64]uint8 } type CryptoReportRNG struct { Type [64]uint8 Seedsize uint32 } type CryptoReportAKCipher struct { Type [64]uint8 } type CryptoReportKPP struct { Type [64]uint8 } type CryptoReportAcomp struct { Type [64]uint8 } type LoopInfo struct { Number int32 Device uint32 Inode uint64 Rdevice uint32 Offset int32 Encrypt_type int32 Encrypt_key_size int32 Flags int32 Name [64]uint8 Encrypt_key [32]uint8 Init [2]uint64 Reserved [4]uint8 _ [4]byte } type TIPCSubscr struct { Seq TIPCServiceRange Timeout uint32 Filter uint32 Handle [8]uint8 } type TIPCSIOCLNReq struct { Peer uint32 Id uint32 Linkname [68]uint8 } type TIPCSIOCNodeIDReq struct { Peer uint32 Id [16]uint8 } type PPSKInfo struct { Assert_sequence uint32 Clear_sequence uint32 Assert_tu PPSKTime Clear_tu PPSKTime Current_mode int32 _ [4]byte } const ( PPS_GETPARAMS = 0x800870a1 PPS_SETPARAMS = 0x400870a2 PPS_GETCAP = 0x800870a3 PPS_FETCH = 0xc00870a4 ) const ( PIDFD_NONBLOCK = 0x800 ) type SysvIpcPerm struct { Key int32 Uid uint32 Gid uint32 Cuid uint32 Cgid uint32 Mode uint32 _ [0]uint8 Seq uint16 _ uint16 _ uint64 _ uint64 } type SysvShmDesc struct { Perm SysvIpcPerm Segsz uint64 Atime int64 Dtime int64 Ctime int64 Cpid int32 Lpid int32 Nattch uint64 _ uint64 _ uint64 } type RISCVHWProbePairs struct { Key int64 Value uint64 } const ( RISCV_HWPROBE_KEY_MVENDORID = 0x0 RISCV_HWPROBE_KEY_MARCHID = 0x1 RISCV_HWPROBE_KEY_MIMPID = 0x2 RISCV_HWPROBE_KEY_BASE_BEHAVIOR = 0x3 RISCV_HWPROBE_BASE_BEHAVIOR_IMA = 0x1 RISCV_HWPROBE_KEY_IMA_EXT_0 = 0x4 RISCV_HWPROBE_IMA_FD = 0x1 RISCV_HWPROBE_IMA_C = 0x2 RISCV_HWPROBE_IMA_V = 0x4 RISCV_HWPROBE_EXT_ZBA = 0x8 RISCV_HWPROBE_EXT_ZBB = 0x10 RISCV_HWPROBE_EXT_ZBS = 0x20 RISCV_HWPROBE_EXT_ZICBOZ = 0x40 RISCV_HWPROBE_EXT_ZBC = 0x80 RISCV_HWPROBE_EXT_ZBKB = 0x100 RISCV_HWPROBE_EXT_ZBKC = 0x200 RISCV_HWPROBE_EXT_ZBKX = 0x400 RISCV_HWPROBE_EXT_ZKND = 0x800 RISCV_HWPROBE_EXT_ZKNE = 0x1000 RISCV_HWPROBE_EXT_ZKNH = 0x2000 RISCV_HWPROBE_EXT_ZKSED = 0x4000 RISCV_HWPROBE_EXT_ZKSH = 0x8000 RISCV_HWPROBE_EXT_ZKT = 0x10000 RISCV_HWPROBE_EXT_ZVBB = 0x20000 RISCV_HWPROBE_EXT_ZVBC = 0x40000 RISCV_HWPROBE_EXT_ZVKB = 0x80000 RISCV_HWPROBE_EXT_ZVKG = 0x100000 RISCV_HWPROBE_EXT_ZVKNED = 0x200000 RISCV_HWPROBE_EXT_ZVKNHA = 0x400000 RISCV_HWPROBE_EXT_ZVKNHB = 0x800000 RISCV_HWPROBE_EXT_ZVKSED = 0x1000000 RISCV_HWPROBE_EXT_ZVKSH = 0x2000000 RISCV_HWPROBE_EXT_ZVKT = 0x4000000 RISCV_HWPROBE_EXT_ZFH = 0x8000000 RISCV_HWPROBE_EXT_ZFHMIN = 0x10000000 RISCV_HWPROBE_EXT_ZIHINTNTL = 0x20000000 RISCV_HWPROBE_EXT_ZVFH = 0x40000000 RISCV_HWPROBE_EXT_ZVFHMIN = 0x80000000 RISCV_HWPROBE_EXT_ZFA = 0x100000000 RISCV_HWPROBE_EXT_ZTSO = 0x200000000 RISCV_HWPROBE_EXT_ZACAS = 0x400000000 RISCV_HWPROBE_EXT_ZICOND = 0x800000000 RISCV_HWPROBE_EXT_ZIHINTPAUSE = 0x1000000000 RISCV_HWPROBE_KEY_CPUPERF_0 = 0x5 RISCV_HWPROBE_MISALIGNED_UNKNOWN = 0x0 RISCV_HWPROBE_MISALIGNED_EMULATED = 0x1 RISCV_HWPROBE_MISALIGNED_SLOW = 0x2 RISCV_HWPROBE_MISALIGNED_FAST = 0x3 RISCV_HWPROBE_MISALIGNED_UNSUPPORTED = 0x4 RISCV_HWPROBE_MISALIGNED_MASK = 0x7 RISCV_HWPROBE_KEY_ZICBOZ_BLOCK_SIZE = 0x6 RISCV_HWPROBE_WHICH_CPUS = 0x1 ) ================================================ FILE: vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go ================================================ // cgo -godefs -objdir=/tmp/s390x/cgo -- -Wall -Werror -static -I/tmp/s390x/include -fsigned-char linux/types.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build s390x && linux package unix const ( SizeofPtr = 0x8 SizeofLong = 0x8 ) type ( _C_long int64 ) type Timespec struct { Sec int64 Nsec int64 } type Timeval struct { Sec int64 Usec int64 } type Timex struct { Modes uint32 Offset int64 Freq int64 Maxerror int64 Esterror int64 Status int32 Constant int64 Precision int64 Tolerance int64 Time Timeval Tick int64 Ppsfreq int64 Jitter int64 Shift int32 Stabil int64 Jitcnt int64 Calcnt int64 Errcnt int64 Stbcnt int64 Tai int32 _ [44]byte } type Time_t int64 type Tms struct { Utime int64 Stime int64 Cutime int64 Cstime int64 } type Utimbuf struct { Actime int64 Modtime int64 } type Rusage struct { Utime Timeval Stime Timeval Maxrss int64 Ixrss int64 Idrss int64 Isrss int64 Minflt int64 Majflt int64 Nswap int64 Inblock int64 Oublock int64 Msgsnd int64 Msgrcv int64 Nsignals int64 Nvcsw int64 Nivcsw int64 } type Stat_t struct { Dev uint64 Ino uint64 Nlink uint64 Mode uint32 Uid uint32 Gid uint32 _ int32 Rdev uint64 Size int64 Atim Timespec Mtim Timespec Ctim Timespec Blksize int64 Blocks int64 _ [3]int64 } type Dirent struct { Ino uint64 Off int64 Reclen uint16 Type uint8 Name [256]int8 _ [5]byte } type Flock_t struct { Type int16 Whence int16 Start int64 Len int64 Pid int32 _ [4]byte } type DmNameList struct { Dev uint64 Next uint32 Name [0]byte _ [4]byte } const ( FADV_DONTNEED = 0x6 FADV_NOREUSE = 0x7 ) type RawSockaddrNFCLLCP struct { Sa_family uint16 Dev_idx uint32 Target_idx uint32 Nfc_protocol uint32 Dsap uint8 Ssap uint8 Service_name [63]uint8 Service_name_len uint64 } type RawSockaddr struct { Family uint16 Data [14]int8 } type RawSockaddrAny struct { Addr RawSockaddr Pad [96]int8 } type Iovec struct { Base *byte Len uint64 } type Msghdr struct { Name *byte Namelen uint32 Iov *Iovec Iovlen uint64 Control *byte Controllen uint64 Flags int32 _ [4]byte } type Cmsghdr struct { Len uint64 Level int32 Type int32 } type ifreq struct { Ifrn [16]byte Ifru [24]byte } const ( SizeofSockaddrNFCLLCP = 0x60 SizeofIovec = 0x10 SizeofMsghdr = 0x38 SizeofCmsghdr = 0x10 ) const ( SizeofSockFprog = 0x10 ) type PtraceRegs struct { Psw PtracePsw Gprs [16]uint64 Acrs [16]uint32 Orig_gpr2 uint64 Fp_regs PtraceFpregs Per_info PtracePer Ieee_instruction_pointer uint64 } type PtracePsw struct { Mask uint64 Addr uint64 } type PtraceFpregs struct { Fpc uint32 Fprs [16]float64 } type PtracePer struct { Control_regs [3]uint64 _ [8]byte Starting_addr uint64 Ending_addr uint64 Perc_atmid uint16 Address uint64 Access_id uint8 _ [7]byte } type FdSet struct { Bits [16]int64 } type Sysinfo_t struct { Uptime int64 Loads [3]uint64 Totalram uint64 Freeram uint64 Sharedram uint64 Bufferram uint64 Totalswap uint64 Freeswap uint64 Procs uint16 Pad uint16 Totalhigh uint64 Freehigh uint64 Unit uint32 _ [0]int8 _ [4]byte } type Ustat_t struct { Tfree int32 Tinode uint64 Fname [6]int8 Fpack [6]int8 _ [4]byte } type EpollEvent struct { Events uint32 _ int32 Fd int32 Pad int32 } const ( OPEN_TREE_CLOEXEC = 0x80000 ) const ( POLLRDHUP = 0x2000 ) type Sigset_t struct { Val [16]uint64 } const _C__NSIG = 0x41 const ( SIG_BLOCK = 0x0 SIG_UNBLOCK = 0x1 SIG_SETMASK = 0x2 ) type Siginfo struct { Signo int32 Errno int32 Code int32 _ int32 _ [112]byte } type Termios struct { Iflag uint32 Oflag uint32 Cflag uint32 Lflag uint32 Line uint8 Cc [19]uint8 Ispeed uint32 Ospeed uint32 } type Taskstats struct { Version uint16 Ac_exitcode uint32 Ac_flag uint8 Ac_nice uint8 Cpu_count uint64 Cpu_delay_total uint64 Blkio_count uint64 Blkio_delay_total uint64 Swapin_count uint64 Swapin_delay_total uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]int8 Ac_sched uint8 Ac_pad [3]uint8 _ [4]byte Ac_uid uint32 Ac_gid uint32 Ac_pid uint32 Ac_ppid uint32 Ac_btime uint32 Ac_etime uint64 Ac_utime uint64 Ac_stime uint64 Ac_minflt uint64 Ac_majflt uint64 Coremem uint64 Virtmem uint64 Hiwater_rss uint64 Hiwater_vm uint64 Read_char uint64 Write_char uint64 Read_syscalls uint64 Write_syscalls uint64 Read_bytes uint64 Write_bytes uint64 Cancelled_write_bytes uint64 Nvcsw uint64 Nivcsw uint64 Ac_utimescaled uint64 Ac_stimescaled uint64 Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 Thrashing_count uint64 Thrashing_delay_total uint64 Ac_btime64 uint64 Compact_count uint64 Compact_delay_total uint64 Ac_tgid uint32 Ac_tgetime uint64 Ac_exe_dev uint64 Ac_exe_inode uint64 Wpcopy_count uint64 Wpcopy_delay_total uint64 Irq_count uint64 Irq_delay_total uint64 Cpu_delay_max uint64 Cpu_delay_min uint64 Blkio_delay_max uint64 Blkio_delay_min uint64 Swapin_delay_max uint64 Swapin_delay_min uint64 Freepages_delay_max uint64 Freepages_delay_min uint64 Thrashing_delay_max uint64 Thrashing_delay_min uint64 Compact_delay_max uint64 Compact_delay_min uint64 Wpcopy_delay_max uint64 Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 } type cpuMask uint64 const ( _NCPUBITS = 0x40 ) const ( CBitFieldMaskBit0 = 0x8000000000000000 CBitFieldMaskBit1 = 0x4000000000000000 CBitFieldMaskBit2 = 0x2000000000000000 CBitFieldMaskBit3 = 0x1000000000000000 CBitFieldMaskBit4 = 0x800000000000000 CBitFieldMaskBit5 = 0x400000000000000 CBitFieldMaskBit6 = 0x200000000000000 CBitFieldMaskBit7 = 0x100000000000000 CBitFieldMaskBit8 = 0x80000000000000 CBitFieldMaskBit9 = 0x40000000000000 CBitFieldMaskBit10 = 0x20000000000000 CBitFieldMaskBit11 = 0x10000000000000 CBitFieldMaskBit12 = 0x8000000000000 CBitFieldMaskBit13 = 0x4000000000000 CBitFieldMaskBit14 = 0x2000000000000 CBitFieldMaskBit15 = 0x1000000000000 CBitFieldMaskBit16 = 0x800000000000 CBitFieldMaskBit17 = 0x400000000000 CBitFieldMaskBit18 = 0x200000000000 CBitFieldMaskBit19 = 0x100000000000 CBitFieldMaskBit20 = 0x80000000000 CBitFieldMaskBit21 = 0x40000000000 CBitFieldMaskBit22 = 0x20000000000 CBitFieldMaskBit23 = 0x10000000000 CBitFieldMaskBit24 = 0x8000000000 CBitFieldMaskBit25 = 0x4000000000 CBitFieldMaskBit26 = 0x2000000000 CBitFieldMaskBit27 = 0x1000000000 CBitFieldMaskBit28 = 0x800000000 CBitFieldMaskBit29 = 0x400000000 CBitFieldMaskBit30 = 0x200000000 CBitFieldMaskBit31 = 0x100000000 CBitFieldMaskBit32 = 0x80000000 CBitFieldMaskBit33 = 0x40000000 CBitFieldMaskBit34 = 0x20000000 CBitFieldMaskBit35 = 0x10000000 CBitFieldMaskBit36 = 0x8000000 CBitFieldMaskBit37 = 0x4000000 CBitFieldMaskBit38 = 0x2000000 CBitFieldMaskBit39 = 0x1000000 CBitFieldMaskBit40 = 0x800000 CBitFieldMaskBit41 = 0x400000 CBitFieldMaskBit42 = 0x200000 CBitFieldMaskBit43 = 0x100000 CBitFieldMaskBit44 = 0x80000 CBitFieldMaskBit45 = 0x40000 CBitFieldMaskBit46 = 0x20000 CBitFieldMaskBit47 = 0x10000 CBitFieldMaskBit48 = 0x8000 CBitFieldMaskBit49 = 0x4000 CBitFieldMaskBit50 = 0x2000 CBitFieldMaskBit51 = 0x1000 CBitFieldMaskBit52 = 0x800 CBitFieldMaskBit53 = 0x400 CBitFieldMaskBit54 = 0x200 CBitFieldMaskBit55 = 0x100 CBitFieldMaskBit56 = 0x80 CBitFieldMaskBit57 = 0x40 CBitFieldMaskBit58 = 0x20 CBitFieldMaskBit59 = 0x10 CBitFieldMaskBit60 = 0x8 CBitFieldMaskBit61 = 0x4 CBitFieldMaskBit62 = 0x2 CBitFieldMaskBit63 = 0x1 ) type SockaddrStorage struct { Family uint16 Data [118]byte _ uint64 } type HDGeometry struct { Heads uint8 Sectors uint8 Cylinders uint16 Start uint64 } type Statfs_t struct { Type uint32 Bsize uint32 Blocks uint64 Bfree uint64 Bavail uint64 Files uint64 Ffree uint64 Fsid Fsid Namelen uint32 Frsize uint32 Flags uint32 Spare [4]uint32 _ [4]byte } type TpacketHdr struct { Status uint64 Len uint32 Snaplen uint32 Mac uint16 Net uint16 Sec uint32 Usec uint32 _ [4]byte } const ( SizeofTpacketHdr = 0x20 ) type RTCPLLInfo struct { Ctrl int32 Value int32 Max int32 Min int32 Posmult int32 Negmult int32 Clock int64 } type BlkpgPartition struct { Start int64 Length int64 Pno int32 Devname [64]uint8 Volname [64]uint8 _ [4]byte } const ( BLKPG = 0x1269 ) type CryptoUserAlg struct { Name [64]int8 Driver_name [64]int8 Module_name [64]int8 Type uint32 Mask uint32 Refcnt uint32 Flags uint32 } type CryptoStatAEAD struct { Type [64]int8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Err_cnt uint64 } type CryptoStatAKCipher struct { Type [64]int8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Verify_cnt uint64 Sign_cnt uint64 Err_cnt uint64 } type CryptoStatCipher struct { Type [64]int8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Err_cnt uint64 } type CryptoStatCompress struct { Type [64]int8 Compress_cnt uint64 Compress_tlen uint64 Decompress_cnt uint64 Decompress_tlen uint64 Err_cnt uint64 } type CryptoStatHash struct { Type [64]int8 Hash_cnt uint64 Hash_tlen uint64 Err_cnt uint64 } type CryptoStatKPP struct { Type [64]int8 Setsecret_cnt uint64 Generate_public_key_cnt uint64 Compute_shared_secret_cnt uint64 Err_cnt uint64 } type CryptoStatRNG struct { Type [64]int8 Generate_cnt uint64 Generate_tlen uint64 Seed_cnt uint64 Err_cnt uint64 } type CryptoStatLarval struct { Type [64]int8 } type CryptoReportLarval struct { Type [64]int8 } type CryptoReportHash struct { Type [64]int8 Blocksize uint32 Digestsize uint32 } type CryptoReportCipher struct { Type [64]int8 Blocksize uint32 Min_keysize uint32 Max_keysize uint32 } type CryptoReportBlkCipher struct { Type [64]int8 Geniv [64]int8 Blocksize uint32 Min_keysize uint32 Max_keysize uint32 Ivsize uint32 } type CryptoReportAEAD struct { Type [64]int8 Geniv [64]int8 Blocksize uint32 Maxauthsize uint32 Ivsize uint32 } type CryptoReportComp struct { Type [64]int8 } type CryptoReportRNG struct { Type [64]int8 Seedsize uint32 } type CryptoReportAKCipher struct { Type [64]int8 } type CryptoReportKPP struct { Type [64]int8 } type CryptoReportAcomp struct { Type [64]int8 } type LoopInfo struct { Number int32 Device uint16 Inode uint64 Rdevice uint16 Offset int32 Encrypt_type int32 Encrypt_key_size int32 Flags int32 Name [64]int8 Encrypt_key [32]uint8 Init [2]uint64 Reserved [4]int8 _ [4]byte } type TIPCSubscr struct { Seq TIPCServiceRange Timeout uint32 Filter uint32 Handle [8]int8 } type TIPCSIOCLNReq struct { Peer uint32 Id uint32 Linkname [68]int8 } type TIPCSIOCNodeIDReq struct { Peer uint32 Id [16]int8 } type PPSKInfo struct { Assert_sequence uint32 Clear_sequence uint32 Assert_tu PPSKTime Clear_tu PPSKTime Current_mode int32 _ [4]byte } const ( PPS_GETPARAMS = 0x800870a1 PPS_SETPARAMS = 0x400870a2 PPS_GETCAP = 0x800870a3 PPS_FETCH = 0xc00870a4 ) const ( PIDFD_NONBLOCK = 0x800 ) type SysvIpcPerm struct { Key int32 Uid uint32 Gid uint32 Cuid uint32 Cgid uint32 Mode uint32 _ uint16 Seq uint16 _ uint64 _ uint64 } type SysvShmDesc struct { Perm SysvIpcPerm Segsz uint64 Atime int64 Dtime int64 Ctime int64 Cpid int32 Lpid int32 Nattch uint64 _ uint64 _ uint64 } ================================================ FILE: vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go ================================================ // cgo -godefs -objdir=/tmp/sparc64/cgo -- -Wall -Werror -static -I/tmp/sparc64/include linux/types.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build sparc64 && linux package unix const ( SizeofPtr = 0x8 SizeofLong = 0x8 ) type ( _C_long int64 ) type Timespec struct { Sec int64 Nsec int64 } type Timeval struct { Sec int64 Usec int32 _ [4]byte } type Timex struct { Modes uint32 Offset int64 Freq int64 Maxerror int64 Esterror int64 Status int32 Constant int64 Precision int64 Tolerance int64 Time Timeval Tick int64 Ppsfreq int64 Jitter int64 Shift int32 Stabil int64 Jitcnt int64 Calcnt int64 Errcnt int64 Stbcnt int64 Tai int32 _ [44]byte } type Time_t int64 type Tms struct { Utime int64 Stime int64 Cutime int64 Cstime int64 } type Utimbuf struct { Actime int64 Modtime int64 } type Rusage struct { Utime Timeval Stime Timeval Maxrss int64 Ixrss int64 Idrss int64 Isrss int64 Minflt int64 Majflt int64 Nswap int64 Inblock int64 Oublock int64 Msgsnd int64 Msgrcv int64 Nsignals int64 Nvcsw int64 Nivcsw int64 } type Stat_t struct { Dev uint64 _ uint16 Ino uint64 Mode uint32 Nlink uint32 Uid uint32 Gid uint32 Rdev uint64 _ uint16 Size int64 Blksize int64 Blocks int64 Atim Timespec Mtim Timespec Ctim Timespec _ uint64 _ uint64 } type Dirent struct { Ino uint64 Off int64 Reclen uint16 Type uint8 Name [256]int8 _ [5]byte } type Flock_t struct { Type int16 Whence int16 Start int64 Len int64 Pid int32 _ int16 _ [2]byte } type DmNameList struct { Dev uint64 Next uint32 Name [0]byte _ [4]byte } const ( FADV_DONTNEED = 0x4 FADV_NOREUSE = 0x5 ) type RawSockaddrNFCLLCP struct { Sa_family uint16 Dev_idx uint32 Target_idx uint32 Nfc_protocol uint32 Dsap uint8 Ssap uint8 Service_name [63]uint8 Service_name_len uint64 } type RawSockaddr struct { Family uint16 Data [14]int8 } type RawSockaddrAny struct { Addr RawSockaddr Pad [96]int8 } type Iovec struct { Base *byte Len uint64 } type Msghdr struct { Name *byte Namelen uint32 Iov *Iovec Iovlen uint64 Control *byte Controllen uint64 Flags int32 _ [4]byte } type Cmsghdr struct { Len uint64 Level int32 Type int32 } type ifreq struct { Ifrn [16]byte Ifru [24]byte } const ( SizeofSockaddrNFCLLCP = 0x60 SizeofIovec = 0x10 SizeofMsghdr = 0x38 SizeofCmsghdr = 0x10 ) const ( SizeofSockFprog = 0x10 ) type PtraceRegs struct { Regs [16]uint64 Tstate uint64 Tpc uint64 Tnpc uint64 Y uint32 Magic uint32 } type FdSet struct { Bits [16]int64 } type Sysinfo_t struct { Uptime int64 Loads [3]uint64 Totalram uint64 Freeram uint64 Sharedram uint64 Bufferram uint64 Totalswap uint64 Freeswap uint64 Procs uint16 Pad uint16 Totalhigh uint64 Freehigh uint64 Unit uint32 _ [0]int8 _ [4]byte } type Ustat_t struct { Tfree int32 Tinode uint64 Fname [6]int8 Fpack [6]int8 _ [4]byte } type EpollEvent struct { Events uint32 _ int32 Fd int32 Pad int32 } const ( OPEN_TREE_CLOEXEC = 0x400000 ) const ( POLLRDHUP = 0x800 ) type Sigset_t struct { Val [16]uint64 } const _C__NSIG = 0x41 const ( SIG_BLOCK = 0x1 SIG_UNBLOCK = 0x2 SIG_SETMASK = 0x4 ) type Siginfo struct { Signo int32 Errno int32 Code int32 _ int32 _ [112]byte } type Termios struct { Iflag uint32 Oflag uint32 Cflag uint32 Lflag uint32 Line uint8 Cc [19]uint8 Ispeed uint32 Ospeed uint32 } type Taskstats struct { Version uint16 Ac_exitcode uint32 Ac_flag uint8 Ac_nice uint8 Cpu_count uint64 Cpu_delay_total uint64 Blkio_count uint64 Blkio_delay_total uint64 Swapin_count uint64 Swapin_delay_total uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]int8 Ac_sched uint8 Ac_pad [3]uint8 _ [4]byte Ac_uid uint32 Ac_gid uint32 Ac_pid uint32 Ac_ppid uint32 Ac_btime uint32 Ac_etime uint64 Ac_utime uint64 Ac_stime uint64 Ac_minflt uint64 Ac_majflt uint64 Coremem uint64 Virtmem uint64 Hiwater_rss uint64 Hiwater_vm uint64 Read_char uint64 Write_char uint64 Read_syscalls uint64 Write_syscalls uint64 Read_bytes uint64 Write_bytes uint64 Cancelled_write_bytes uint64 Nvcsw uint64 Nivcsw uint64 Ac_utimescaled uint64 Ac_stimescaled uint64 Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 Thrashing_count uint64 Thrashing_delay_total uint64 Ac_btime64 uint64 Compact_count uint64 Compact_delay_total uint64 Ac_tgid uint32 Ac_tgetime uint64 Ac_exe_dev uint64 Ac_exe_inode uint64 Wpcopy_count uint64 Wpcopy_delay_total uint64 Irq_count uint64 Irq_delay_total uint64 Cpu_delay_max uint64 Cpu_delay_min uint64 Blkio_delay_max uint64 Blkio_delay_min uint64 Swapin_delay_max uint64 Swapin_delay_min uint64 Freepages_delay_max uint64 Freepages_delay_min uint64 Thrashing_delay_max uint64 Thrashing_delay_min uint64 Compact_delay_max uint64 Compact_delay_min uint64 Wpcopy_delay_max uint64 Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 } type cpuMask uint64 const ( _NCPUBITS = 0x40 ) const ( CBitFieldMaskBit0 = 0x8000000000000000 CBitFieldMaskBit1 = 0x4000000000000000 CBitFieldMaskBit2 = 0x2000000000000000 CBitFieldMaskBit3 = 0x1000000000000000 CBitFieldMaskBit4 = 0x800000000000000 CBitFieldMaskBit5 = 0x400000000000000 CBitFieldMaskBit6 = 0x200000000000000 CBitFieldMaskBit7 = 0x100000000000000 CBitFieldMaskBit8 = 0x80000000000000 CBitFieldMaskBit9 = 0x40000000000000 CBitFieldMaskBit10 = 0x20000000000000 CBitFieldMaskBit11 = 0x10000000000000 CBitFieldMaskBit12 = 0x8000000000000 CBitFieldMaskBit13 = 0x4000000000000 CBitFieldMaskBit14 = 0x2000000000000 CBitFieldMaskBit15 = 0x1000000000000 CBitFieldMaskBit16 = 0x800000000000 CBitFieldMaskBit17 = 0x400000000000 CBitFieldMaskBit18 = 0x200000000000 CBitFieldMaskBit19 = 0x100000000000 CBitFieldMaskBit20 = 0x80000000000 CBitFieldMaskBit21 = 0x40000000000 CBitFieldMaskBit22 = 0x20000000000 CBitFieldMaskBit23 = 0x10000000000 CBitFieldMaskBit24 = 0x8000000000 CBitFieldMaskBit25 = 0x4000000000 CBitFieldMaskBit26 = 0x2000000000 CBitFieldMaskBit27 = 0x1000000000 CBitFieldMaskBit28 = 0x800000000 CBitFieldMaskBit29 = 0x400000000 CBitFieldMaskBit30 = 0x200000000 CBitFieldMaskBit31 = 0x100000000 CBitFieldMaskBit32 = 0x80000000 CBitFieldMaskBit33 = 0x40000000 CBitFieldMaskBit34 = 0x20000000 CBitFieldMaskBit35 = 0x10000000 CBitFieldMaskBit36 = 0x8000000 CBitFieldMaskBit37 = 0x4000000 CBitFieldMaskBit38 = 0x2000000 CBitFieldMaskBit39 = 0x1000000 CBitFieldMaskBit40 = 0x800000 CBitFieldMaskBit41 = 0x400000 CBitFieldMaskBit42 = 0x200000 CBitFieldMaskBit43 = 0x100000 CBitFieldMaskBit44 = 0x80000 CBitFieldMaskBit45 = 0x40000 CBitFieldMaskBit46 = 0x20000 CBitFieldMaskBit47 = 0x10000 CBitFieldMaskBit48 = 0x8000 CBitFieldMaskBit49 = 0x4000 CBitFieldMaskBit50 = 0x2000 CBitFieldMaskBit51 = 0x1000 CBitFieldMaskBit52 = 0x800 CBitFieldMaskBit53 = 0x400 CBitFieldMaskBit54 = 0x200 CBitFieldMaskBit55 = 0x100 CBitFieldMaskBit56 = 0x80 CBitFieldMaskBit57 = 0x40 CBitFieldMaskBit58 = 0x20 CBitFieldMaskBit59 = 0x10 CBitFieldMaskBit60 = 0x8 CBitFieldMaskBit61 = 0x4 CBitFieldMaskBit62 = 0x2 CBitFieldMaskBit63 = 0x1 ) type SockaddrStorage struct { Family uint16 Data [118]byte _ uint64 } type HDGeometry struct { Heads uint8 Sectors uint8 Cylinders uint16 Start uint64 } type Statfs_t struct { Type int64 Bsize int64 Blocks uint64 Bfree uint64 Bavail uint64 Files uint64 Ffree uint64 Fsid Fsid Namelen int64 Frsize int64 Flags int64 Spare [4]int64 } type TpacketHdr struct { Status uint64 Len uint32 Snaplen uint32 Mac uint16 Net uint16 Sec uint32 Usec uint32 _ [4]byte } const ( SizeofTpacketHdr = 0x20 ) type RTCPLLInfo struct { Ctrl int32 Value int32 Max int32 Min int32 Posmult int32 Negmult int32 Clock int64 } type BlkpgPartition struct { Start int64 Length int64 Pno int32 Devname [64]uint8 Volname [64]uint8 _ [4]byte } const ( BLKPG = 0x20001269 ) type CryptoUserAlg struct { Name [64]int8 Driver_name [64]int8 Module_name [64]int8 Type uint32 Mask uint32 Refcnt uint32 Flags uint32 } type CryptoStatAEAD struct { Type [64]int8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Err_cnt uint64 } type CryptoStatAKCipher struct { Type [64]int8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Verify_cnt uint64 Sign_cnt uint64 Err_cnt uint64 } type CryptoStatCipher struct { Type [64]int8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Err_cnt uint64 } type CryptoStatCompress struct { Type [64]int8 Compress_cnt uint64 Compress_tlen uint64 Decompress_cnt uint64 Decompress_tlen uint64 Err_cnt uint64 } type CryptoStatHash struct { Type [64]int8 Hash_cnt uint64 Hash_tlen uint64 Err_cnt uint64 } type CryptoStatKPP struct { Type [64]int8 Setsecret_cnt uint64 Generate_public_key_cnt uint64 Compute_shared_secret_cnt uint64 Err_cnt uint64 } type CryptoStatRNG struct { Type [64]int8 Generate_cnt uint64 Generate_tlen uint64 Seed_cnt uint64 Err_cnt uint64 } type CryptoStatLarval struct { Type [64]int8 } type CryptoReportLarval struct { Type [64]int8 } type CryptoReportHash struct { Type [64]int8 Blocksize uint32 Digestsize uint32 } type CryptoReportCipher struct { Type [64]int8 Blocksize uint32 Min_keysize uint32 Max_keysize uint32 } type CryptoReportBlkCipher struct { Type [64]int8 Geniv [64]int8 Blocksize uint32 Min_keysize uint32 Max_keysize uint32 Ivsize uint32 } type CryptoReportAEAD struct { Type [64]int8 Geniv [64]int8 Blocksize uint32 Maxauthsize uint32 Ivsize uint32 } type CryptoReportComp struct { Type [64]int8 } type CryptoReportRNG struct { Type [64]int8 Seedsize uint32 } type CryptoReportAKCipher struct { Type [64]int8 } type CryptoReportKPP struct { Type [64]int8 } type CryptoReportAcomp struct { Type [64]int8 } type LoopInfo struct { Number int32 Device uint32 Inode uint64 Rdevice uint32 Offset int32 Encrypt_type int32 Encrypt_key_size int32 Flags int32 Name [64]int8 Encrypt_key [32]uint8 Init [2]uint64 Reserved [4]int8 _ [4]byte } type TIPCSubscr struct { Seq TIPCServiceRange Timeout uint32 Filter uint32 Handle [8]int8 } type TIPCSIOCLNReq struct { Peer uint32 Id uint32 Linkname [68]int8 } type TIPCSIOCNodeIDReq struct { Peer uint32 Id [16]int8 } type PPSKInfo struct { Assert_sequence uint32 Clear_sequence uint32 Assert_tu PPSKTime Clear_tu PPSKTime Current_mode int32 _ [4]byte } const ( PPS_GETPARAMS = 0x400870a1 PPS_SETPARAMS = 0x800870a2 PPS_GETCAP = 0x400870a3 PPS_FETCH = 0xc00870a4 ) const ( PIDFD_NONBLOCK = 0x4000 ) type SysvIpcPerm struct { Key int32 Uid uint32 Gid uint32 Cuid uint32 Cgid uint32 Mode uint32 _ uint16 Seq uint16 _ uint64 _ uint64 } type SysvShmDesc struct { Perm SysvIpcPerm Atime int64 Dtime int64 Ctime int64 Segsz uint64 Cpid int32 Lpid int32 Nattch uint64 _ uint64 _ uint64 } ================================================ FILE: vendor/golang.org/x/sys/unix/ztypes_netbsd_386.go ================================================ // cgo -godefs types_netbsd.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build 386 && netbsd package unix const ( SizeofPtr = 0x4 SizeofShort = 0x2 SizeofInt = 0x4 SizeofLong = 0x4 SizeofLongLong = 0x8 ) type ( _C_short int16 _C_int int32 _C_long int32 _C_long_long int64 ) type Timespec struct { Sec int64 Nsec int32 } type Timeval struct { Sec int64 Usec int32 } type Rusage struct { Utime Timeval Stime Timeval Maxrss int32 Ixrss int32 Idrss int32 Isrss int32 Minflt int32 Majflt int32 Nswap int32 Inblock int32 Oublock int32 Msgsnd int32 Msgrcv int32 Nsignals int32 Nvcsw int32 Nivcsw int32 } type Rlimit struct { Cur uint64 Max uint64 } type _Gid_t uint32 type Stat_t struct { Dev uint64 Mode uint32 Ino uint64 Nlink uint32 Uid uint32 Gid uint32 Rdev uint64 Atim Timespec Mtim Timespec Ctim Timespec Btim Timespec Size int64 Blocks int64 Blksize uint32 Flags uint32 Gen uint32 Spare [2]uint32 } type Statfs_t [0]byte type Statvfs_t struct { Flag uint32 Bsize uint32 Frsize uint32 Iosize uint32 Blocks uint64 Bfree uint64 Bavail uint64 Bresvd uint64 Files uint64 Ffree uint64 Favail uint64 Fresvd uint64 Syncreads uint64 Syncwrites uint64 Asyncreads uint64 Asyncwrites uint64 Fsidx Fsid Fsid uint32 Namemax uint32 Owner uint32 Spare [4]uint32 Fstypename [32]byte Mntonname [1024]byte Mntfromname [1024]byte } type Flock_t struct { Start int64 Len int64 Pid int32 Type int16 Whence int16 } type Dirent struct { Fileno uint64 Reclen uint16 Namlen uint16 Type uint8 Name [512]int8 Pad_cgo_0 [3]byte } type Fsid struct { X__fsid_val [2]int32 } const ( PathMax = 0x400 ) const ( ST_WAIT = 0x1 ST_NOWAIT = 0x2 ) const ( FADV_NORMAL = 0x0 FADV_RANDOM = 0x1 FADV_SEQUENTIAL = 0x2 FADV_WILLNEED = 0x3 FADV_DONTNEED = 0x4 FADV_NOREUSE = 0x5 ) type RawSockaddrInet4 struct { Len uint8 Family uint8 Port uint16 Addr [4]byte /* in_addr */ Zero [8]int8 } type RawSockaddrInet6 struct { Len uint8 Family uint8 Port uint16 Flowinfo uint32 Addr [16]byte /* in6_addr */ Scope_id uint32 } type RawSockaddrUnix struct { Len uint8 Family uint8 Path [104]int8 } type RawSockaddrDatalink struct { Len uint8 Family uint8 Index uint16 Type uint8 Nlen uint8 Alen uint8 Slen uint8 Data [12]int8 } type RawSockaddr struct { Len uint8 Family uint8 Data [14]int8 } type RawSockaddrAny struct { Addr RawSockaddr Pad [92]int8 } type _Socklen uint32 type Linger struct { Onoff int32 Linger int32 } type Iovec struct { Base *byte Len uint32 } type IPMreq struct { Multiaddr [4]byte /* in_addr */ Interface [4]byte /* in_addr */ } type IPv6Mreq struct { Multiaddr [16]byte /* in6_addr */ Interface uint32 } type Msghdr struct { Name *byte Namelen uint32 Iov *Iovec Iovlen int32 Control *byte Controllen uint32 Flags int32 } type Cmsghdr struct { Len uint32 Level int32 Type int32 } type Inet6Pktinfo struct { Addr [16]byte /* in6_addr */ Ifindex uint32 } type IPv6MTUInfo struct { Addr RawSockaddrInet6 Mtu uint32 } type ICMPv6Filter struct { Filt [8]uint32 } const ( SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet6 = 0x1c SizeofSockaddrAny = 0x6c SizeofSockaddrUnix = 0x6a SizeofSockaddrDatalink = 0x14 SizeofLinger = 0x8 SizeofIovec = 0x8 SizeofIPMreq = 0x8 SizeofIPv6Mreq = 0x14 SizeofMsghdr = 0x1c SizeofCmsghdr = 0xc SizeofInet6Pktinfo = 0x14 SizeofIPv6MTUInfo = 0x20 SizeofICMPv6Filter = 0x20 ) const ( PTRACE_TRACEME = 0x0 PTRACE_CONT = 0x7 PTRACE_KILL = 0x8 ) type Kevent_t struct { Ident uint32 Filter uint32 Flags uint32 Fflags uint32 Data int64 Udata int32 } type FdSet struct { Bits [8]uint32 } const ( SizeofIfMsghdr = 0x98 SizeofIfData = 0x84 SizeofIfaMsghdr = 0x18 SizeofIfAnnounceMsghdr = 0x18 SizeofRtMsghdr = 0x78 SizeofRtMetrics = 0x50 ) type IfMsghdr struct { Msglen uint16 Version uint8 Type uint8 Addrs int32 Flags int32 Index uint16 Pad_cgo_0 [2]byte Data IfData Pad_cgo_1 [4]byte } type IfData struct { Type uint8 Addrlen uint8 Hdrlen uint8 Pad_cgo_0 [1]byte Link_state int32 Mtu uint64 Metric uint64 Baudrate uint64 Ipackets uint64 Ierrors uint64 Opackets uint64 Oerrors uint64 Collisions uint64 Ibytes uint64 Obytes uint64 Imcasts uint64 Omcasts uint64 Iqdrops uint64 Noproto uint64 Lastchange Timespec } type IfaMsghdr struct { Msglen uint16 Version uint8 Type uint8 Addrs int32 Flags int32 Metric int32 Index uint16 Pad_cgo_0 [6]byte } type IfAnnounceMsghdr struct { Msglen uint16 Version uint8 Type uint8 Index uint16 Name [16]int8 What uint16 } type RtMsghdr struct { Msglen uint16 Version uint8 Type uint8 Index uint16 Pad_cgo_0 [2]byte Flags int32 Addrs int32 Pid int32 Seq int32 Errno int32 Use int32 Inits int32 Pad_cgo_1 [4]byte Rmx RtMetrics } type RtMetrics struct { Locks uint64 Mtu uint64 Hopcount uint64 Recvpipe uint64 Sendpipe uint64 Ssthresh uint64 Rtt uint64 Rttvar uint64 Expire int64 Pksent int64 } type Mclpool [0]byte const ( SizeofBpfVersion = 0x4 SizeofBpfStat = 0x80 SizeofBpfProgram = 0x8 SizeofBpfInsn = 0x8 SizeofBpfHdr = 0x14 ) type BpfVersion struct { Major uint16 Minor uint16 } type BpfStat struct { Recv uint64 Drop uint64 Capt uint64 Padding [13]uint64 } type BpfProgram struct { Len uint32 Insns *BpfInsn } type BpfInsn struct { Code uint16 Jt uint8 Jf uint8 K uint32 } type BpfHdr struct { Tstamp BpfTimeval Caplen uint32 Datalen uint32 Hdrlen uint16 Pad_cgo_0 [2]byte } type BpfTimeval struct { Sec int32 Usec int32 } type Termios struct { Iflag uint32 Oflag uint32 Cflag uint32 Lflag uint32 Cc [20]uint8 Ispeed int32 Ospeed int32 } type Winsize struct { Row uint16 Col uint16 Xpixel uint16 Ypixel uint16 } type Ptmget struct { Cfd int32 Sfd int32 Cn [1024]byte Sn [1024]byte } const ( AT_FDCWD = -0x64 AT_EACCESS = 0x100 AT_SYMLINK_NOFOLLOW = 0x200 AT_SYMLINK_FOLLOW = 0x400 AT_REMOVEDIR = 0x800 ) type PollFd struct { Fd int32 Events int16 Revents int16 } const ( POLLERR = 0x8 POLLHUP = 0x10 POLLIN = 0x1 POLLNVAL = 0x20 POLLOUT = 0x4 POLLPRI = 0x2 POLLRDBAND = 0x80 POLLRDNORM = 0x40 POLLWRBAND = 0x100 POLLWRNORM = 0x4 ) type Sysctlnode struct { Flags uint32 Num int32 Name [32]int8 Ver uint32 X__rsvd uint32 Un [16]byte X_sysctl_size [8]byte X_sysctl_func [8]byte X_sysctl_parent [8]byte X_sysctl_desc [8]byte } type Utsname struct { Sysname [256]byte Nodename [256]byte Release [256]byte Version [256]byte Machine [256]byte } const SizeofUvmexp = 0x278 type Uvmexp struct { Pagesize int64 Pagemask int64 Pageshift int64 Npages int64 Free int64 Active int64 Inactive int64 Paging int64 Wired int64 Zeropages int64 Reserve_pagedaemon int64 Reserve_kernel int64 Freemin int64 Freetarg int64 Inactarg int64 Wiredmax int64 Nswapdev int64 Swpages int64 Swpginuse int64 Swpgonly int64 Nswget int64 Unused1 int64 Cpuhit int64 Cpumiss int64 Faults int64 Traps int64 Intrs int64 Swtch int64 Softs int64 Syscalls int64 Pageins int64 Swapins int64 Swapouts int64 Pgswapin int64 Pgswapout int64 Forks int64 Forks_ppwait int64 Forks_sharevm int64 Pga_zerohit int64 Pga_zeromiss int64 Zeroaborts int64 Fltnoram int64 Fltnoanon int64 Fltpgwait int64 Fltpgrele int64 Fltrelck int64 Fltrelckok int64 Fltanget int64 Fltanretry int64 Fltamcopy int64 Fltnamap int64 Fltnomap int64 Fltlget int64 Fltget int64 Flt_anon int64 Flt_acow int64 Flt_obj int64 Flt_prcopy int64 Flt_przero int64 Pdwoke int64 Pdrevs int64 Unused4 int64 Pdfreed int64 Pdscans int64 Pdanscan int64 Pdobscan int64 Pdreact int64 Pdbusy int64 Pdpageouts int64 Pdpending int64 Pddeact int64 Anonpages int64 Filepages int64 Execpages int64 Colorhit int64 Colormiss int64 Ncolors int64 Bootpages int64 Poolpages int64 } const SizeofClockinfo = 0x14 type Clockinfo struct { Hz int32 Tick int32 Tickadj int32 Stathz int32 Profhz int32 } ================================================ FILE: vendor/golang.org/x/sys/unix/ztypes_netbsd_amd64.go ================================================ // cgo -godefs types_netbsd.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build amd64 && netbsd package unix const ( SizeofPtr = 0x8 SizeofShort = 0x2 SizeofInt = 0x4 SizeofLong = 0x8 SizeofLongLong = 0x8 ) type ( _C_short int16 _C_int int32 _C_long int64 _C_long_long int64 ) type Timespec struct { Sec int64 Nsec int64 } type Timeval struct { Sec int64 Usec int32 Pad_cgo_0 [4]byte } type Rusage struct { Utime Timeval Stime Timeval Maxrss int64 Ixrss int64 Idrss int64 Isrss int64 Minflt int64 Majflt int64 Nswap int64 Inblock int64 Oublock int64 Msgsnd int64 Msgrcv int64 Nsignals int64 Nvcsw int64 Nivcsw int64 } type Rlimit struct { Cur uint64 Max uint64 } type _Gid_t uint32 type Stat_t struct { Dev uint64 Mode uint32 _ [4]byte Ino uint64 Nlink uint32 Uid uint32 Gid uint32 _ [4]byte Rdev uint64 Atim Timespec Mtim Timespec Ctim Timespec Btim Timespec Size int64 Blocks int64 Blksize uint32 Flags uint32 Gen uint32 Spare [2]uint32 _ [4]byte } type Statfs_t [0]byte type Statvfs_t struct { Flag uint64 Bsize uint64 Frsize uint64 Iosize uint64 Blocks uint64 Bfree uint64 Bavail uint64 Bresvd uint64 Files uint64 Ffree uint64 Favail uint64 Fresvd uint64 Syncreads uint64 Syncwrites uint64 Asyncreads uint64 Asyncwrites uint64 Fsidx Fsid Fsid uint64 Namemax uint64 Owner uint32 Spare [4]uint32 Fstypename [32]byte Mntonname [1024]byte Mntfromname [1024]byte _ [4]byte } type Flock_t struct { Start int64 Len int64 Pid int32 Type int16 Whence int16 } type Dirent struct { Fileno uint64 Reclen uint16 Namlen uint16 Type uint8 Name [512]int8 Pad_cgo_0 [3]byte } type Fsid struct { X__fsid_val [2]int32 } const ( PathMax = 0x400 ) const ( ST_WAIT = 0x1 ST_NOWAIT = 0x2 ) const ( FADV_NORMAL = 0x0 FADV_RANDOM = 0x1 FADV_SEQUENTIAL = 0x2 FADV_WILLNEED = 0x3 FADV_DONTNEED = 0x4 FADV_NOREUSE = 0x5 ) type RawSockaddrInet4 struct { Len uint8 Family uint8 Port uint16 Addr [4]byte /* in_addr */ Zero [8]int8 } type RawSockaddrInet6 struct { Len uint8 Family uint8 Port uint16 Flowinfo uint32 Addr [16]byte /* in6_addr */ Scope_id uint32 } type RawSockaddrUnix struct { Len uint8 Family uint8 Path [104]int8 } type RawSockaddrDatalink struct { Len uint8 Family uint8 Index uint16 Type uint8 Nlen uint8 Alen uint8 Slen uint8 Data [12]int8 } type RawSockaddr struct { Len uint8 Family uint8 Data [14]int8 } type RawSockaddrAny struct { Addr RawSockaddr Pad [92]int8 } type _Socklen uint32 type Linger struct { Onoff int32 Linger int32 } type Iovec struct { Base *byte Len uint64 } type IPMreq struct { Multiaddr [4]byte /* in_addr */ Interface [4]byte /* in_addr */ } type IPv6Mreq struct { Multiaddr [16]byte /* in6_addr */ Interface uint32 } type Msghdr struct { Name *byte Namelen uint32 Pad_cgo_0 [4]byte Iov *Iovec Iovlen int32 Pad_cgo_1 [4]byte Control *byte Controllen uint32 Flags int32 } type Cmsghdr struct { Len uint32 Level int32 Type int32 } type Inet6Pktinfo struct { Addr [16]byte /* in6_addr */ Ifindex uint32 } type IPv6MTUInfo struct { Addr RawSockaddrInet6 Mtu uint32 } type ICMPv6Filter struct { Filt [8]uint32 } const ( SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet6 = 0x1c SizeofSockaddrAny = 0x6c SizeofSockaddrUnix = 0x6a SizeofSockaddrDatalink = 0x14 SizeofLinger = 0x8 SizeofIovec = 0x10 SizeofIPMreq = 0x8 SizeofIPv6Mreq = 0x14 SizeofMsghdr = 0x30 SizeofCmsghdr = 0xc SizeofInet6Pktinfo = 0x14 SizeofIPv6MTUInfo = 0x20 SizeofICMPv6Filter = 0x20 ) const ( PTRACE_TRACEME = 0x0 PTRACE_CONT = 0x7 PTRACE_KILL = 0x8 ) type Kevent_t struct { Ident uint64 Filter uint32 Flags uint32 Fflags uint32 Pad_cgo_0 [4]byte Data int64 Udata int64 } type FdSet struct { Bits [8]uint32 } const ( SizeofIfMsghdr = 0x98 SizeofIfData = 0x88 SizeofIfaMsghdr = 0x18 SizeofIfAnnounceMsghdr = 0x18 SizeofRtMsghdr = 0x78 SizeofRtMetrics = 0x50 ) type IfMsghdr struct { Msglen uint16 Version uint8 Type uint8 Addrs int32 Flags int32 Index uint16 Pad_cgo_0 [2]byte Data IfData } type IfData struct { Type uint8 Addrlen uint8 Hdrlen uint8 Pad_cgo_0 [1]byte Link_state int32 Mtu uint64 Metric uint64 Baudrate uint64 Ipackets uint64 Ierrors uint64 Opackets uint64 Oerrors uint64 Collisions uint64 Ibytes uint64 Obytes uint64 Imcasts uint64 Omcasts uint64 Iqdrops uint64 Noproto uint64 Lastchange Timespec } type IfaMsghdr struct { Msglen uint16 Version uint8 Type uint8 Addrs int32 Flags int32 Metric int32 Index uint16 Pad_cgo_0 [6]byte } type IfAnnounceMsghdr struct { Msglen uint16 Version uint8 Type uint8 Index uint16 Name [16]int8 What uint16 } type RtMsghdr struct { Msglen uint16 Version uint8 Type uint8 Index uint16 Pad_cgo_0 [2]byte Flags int32 Addrs int32 Pid int32 Seq int32 Errno int32 Use int32 Inits int32 Pad_cgo_1 [4]byte Rmx RtMetrics } type RtMetrics struct { Locks uint64 Mtu uint64 Hopcount uint64 Recvpipe uint64 Sendpipe uint64 Ssthresh uint64 Rtt uint64 Rttvar uint64 Expire int64 Pksent int64 } type Mclpool [0]byte const ( SizeofBpfVersion = 0x4 SizeofBpfStat = 0x80 SizeofBpfProgram = 0x10 SizeofBpfInsn = 0x8 SizeofBpfHdr = 0x20 ) type BpfVersion struct { Major uint16 Minor uint16 } type BpfStat struct { Recv uint64 Drop uint64 Capt uint64 Padding [13]uint64 } type BpfProgram struct { Len uint32 Pad_cgo_0 [4]byte Insns *BpfInsn } type BpfInsn struct { Code uint16 Jt uint8 Jf uint8 K uint32 } type BpfHdr struct { Tstamp BpfTimeval Caplen uint32 Datalen uint32 Hdrlen uint16 Pad_cgo_0 [6]byte } type BpfTimeval struct { Sec int64 Usec int64 } type Termios struct { Iflag uint32 Oflag uint32 Cflag uint32 Lflag uint32 Cc [20]uint8 Ispeed int32 Ospeed int32 } type Winsize struct { Row uint16 Col uint16 Xpixel uint16 Ypixel uint16 } type Ptmget struct { Cfd int32 Sfd int32 Cn [1024]byte Sn [1024]byte } const ( AT_FDCWD = -0x64 AT_EACCESS = 0x100 AT_SYMLINK_NOFOLLOW = 0x200 AT_SYMLINK_FOLLOW = 0x400 AT_REMOVEDIR = 0x800 ) type PollFd struct { Fd int32 Events int16 Revents int16 } const ( POLLERR = 0x8 POLLHUP = 0x10 POLLIN = 0x1 POLLNVAL = 0x20 POLLOUT = 0x4 POLLPRI = 0x2 POLLRDBAND = 0x80 POLLRDNORM = 0x40 POLLWRBAND = 0x100 POLLWRNORM = 0x4 ) type Sysctlnode struct { Flags uint32 Num int32 Name [32]int8 Ver uint32 X__rsvd uint32 Un [16]byte X_sysctl_size [8]byte X_sysctl_func [8]byte X_sysctl_parent [8]byte X_sysctl_desc [8]byte } type Utsname struct { Sysname [256]byte Nodename [256]byte Release [256]byte Version [256]byte Machine [256]byte } const SizeofUvmexp = 0x278 type Uvmexp struct { Pagesize int64 Pagemask int64 Pageshift int64 Npages int64 Free int64 Active int64 Inactive int64 Paging int64 Wired int64 Zeropages int64 Reserve_pagedaemon int64 Reserve_kernel int64 Freemin int64 Freetarg int64 Inactarg int64 Wiredmax int64 Nswapdev int64 Swpages int64 Swpginuse int64 Swpgonly int64 Nswget int64 Unused1 int64 Cpuhit int64 Cpumiss int64 Faults int64 Traps int64 Intrs int64 Swtch int64 Softs int64 Syscalls int64 Pageins int64 Swapins int64 Swapouts int64 Pgswapin int64 Pgswapout int64 Forks int64 Forks_ppwait int64 Forks_sharevm int64 Pga_zerohit int64 Pga_zeromiss int64 Zeroaborts int64 Fltnoram int64 Fltnoanon int64 Fltpgwait int64 Fltpgrele int64 Fltrelck int64 Fltrelckok int64 Fltanget int64 Fltanretry int64 Fltamcopy int64 Fltnamap int64 Fltnomap int64 Fltlget int64 Fltget int64 Flt_anon int64 Flt_acow int64 Flt_obj int64 Flt_prcopy int64 Flt_przero int64 Pdwoke int64 Pdrevs int64 Unused4 int64 Pdfreed int64 Pdscans int64 Pdanscan int64 Pdobscan int64 Pdreact int64 Pdbusy int64 Pdpageouts int64 Pdpending int64 Pddeact int64 Anonpages int64 Filepages int64 Execpages int64 Colorhit int64 Colormiss int64 Ncolors int64 Bootpages int64 Poolpages int64 } const SizeofClockinfo = 0x14 type Clockinfo struct { Hz int32 Tick int32 Tickadj int32 Stathz int32 Profhz int32 } ================================================ FILE: vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go ================================================ // cgo -godefs types_netbsd.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm && netbsd package unix const ( SizeofPtr = 0x4 SizeofShort = 0x2 SizeofInt = 0x4 SizeofLong = 0x4 SizeofLongLong = 0x8 ) type ( _C_short int16 _C_int int32 _C_long int32 _C_long_long int64 ) type Timespec struct { Sec int64 Nsec int32 Pad_cgo_0 [4]byte } type Timeval struct { Sec int64 Usec int32 Pad_cgo_0 [4]byte } type Rusage struct { Utime Timeval Stime Timeval Maxrss int32 Ixrss int32 Idrss int32 Isrss int32 Minflt int32 Majflt int32 Nswap int32 Inblock int32 Oublock int32 Msgsnd int32 Msgrcv int32 Nsignals int32 Nvcsw int32 Nivcsw int32 } type Rlimit struct { Cur uint64 Max uint64 } type _Gid_t uint32 type Stat_t struct { Dev uint64 Mode uint32 _ [4]byte Ino uint64 Nlink uint32 Uid uint32 Gid uint32 _ [4]byte Rdev uint64 Atim Timespec Mtim Timespec Ctim Timespec Btim Timespec Size int64 Blocks int64 Blksize uint32 Flags uint32 Gen uint32 Spare [2]uint32 _ [4]byte } type Statfs_t [0]byte type Statvfs_t struct { Flag uint32 Bsize uint32 Frsize uint32 Iosize uint32 Blocks uint64 Bfree uint64 Bavail uint64 Bresvd uint64 Files uint64 Ffree uint64 Favail uint64 Fresvd uint64 Syncreads uint64 Syncwrites uint64 Asyncreads uint64 Asyncwrites uint64 Fsidx Fsid Fsid uint32 Namemax uint32 Owner uint32 Spare [4]uint64 Fstypename [32]byte Mntonname [1024]byte Mntfromname [1024]byte } type Flock_t struct { Start int64 Len int64 Pid int32 Type int16 Whence int16 } type Dirent struct { Fileno uint64 Reclen uint16 Namlen uint16 Type uint8 Name [512]int8 Pad_cgo_0 [3]byte } type Fsid struct { X__fsid_val [2]int32 } const ( PathMax = 0x400 ) const ( ST_WAIT = 0x1 ST_NOWAIT = 0x2 ) const ( FADV_NORMAL = 0x0 FADV_RANDOM = 0x1 FADV_SEQUENTIAL = 0x2 FADV_WILLNEED = 0x3 FADV_DONTNEED = 0x4 FADV_NOREUSE = 0x5 ) type RawSockaddrInet4 struct { Len uint8 Family uint8 Port uint16 Addr [4]byte /* in_addr */ Zero [8]int8 } type RawSockaddrInet6 struct { Len uint8 Family uint8 Port uint16 Flowinfo uint32 Addr [16]byte /* in6_addr */ Scope_id uint32 } type RawSockaddrUnix struct { Len uint8 Family uint8 Path [104]int8 } type RawSockaddrDatalink struct { Len uint8 Family uint8 Index uint16 Type uint8 Nlen uint8 Alen uint8 Slen uint8 Data [12]int8 } type RawSockaddr struct { Len uint8 Family uint8 Data [14]int8 } type RawSockaddrAny struct { Addr RawSockaddr Pad [92]int8 } type _Socklen uint32 type Linger struct { Onoff int32 Linger int32 } type Iovec struct { Base *byte Len uint32 } type IPMreq struct { Multiaddr [4]byte /* in_addr */ Interface [4]byte /* in_addr */ } type IPv6Mreq struct { Multiaddr [16]byte /* in6_addr */ Interface uint32 } type Msghdr struct { Name *byte Namelen uint32 Iov *Iovec Iovlen int32 Control *byte Controllen uint32 Flags int32 } type Cmsghdr struct { Len uint32 Level int32 Type int32 } type Inet6Pktinfo struct { Addr [16]byte /* in6_addr */ Ifindex uint32 } type IPv6MTUInfo struct { Addr RawSockaddrInet6 Mtu uint32 } type ICMPv6Filter struct { Filt [8]uint32 } const ( SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet6 = 0x1c SizeofSockaddrAny = 0x6c SizeofSockaddrUnix = 0x6a SizeofSockaddrDatalink = 0x14 SizeofLinger = 0x8 SizeofIovec = 0x8 SizeofIPMreq = 0x8 SizeofIPv6Mreq = 0x14 SizeofMsghdr = 0x1c SizeofCmsghdr = 0xc SizeofInet6Pktinfo = 0x14 SizeofIPv6MTUInfo = 0x20 SizeofICMPv6Filter = 0x20 ) const ( PTRACE_TRACEME = 0x0 PTRACE_CONT = 0x7 PTRACE_KILL = 0x8 ) type Kevent_t struct { Ident uint32 Filter uint32 Flags uint32 Fflags uint32 Data int64 Udata int32 Pad_cgo_0 [4]byte } type FdSet struct { Bits [8]uint32 } const ( SizeofIfMsghdr = 0x98 SizeofIfData = 0x88 SizeofIfaMsghdr = 0x18 SizeofIfAnnounceMsghdr = 0x18 SizeofRtMsghdr = 0x78 SizeofRtMetrics = 0x50 ) type IfMsghdr struct { Msglen uint16 Version uint8 Type uint8 Addrs int32 Flags int32 Index uint16 Pad_cgo_0 [2]byte Data IfData } type IfData struct { Type uint8 Addrlen uint8 Hdrlen uint8 Pad_cgo_0 [1]byte Link_state int32 Mtu uint64 Metric uint64 Baudrate uint64 Ipackets uint64 Ierrors uint64 Opackets uint64 Oerrors uint64 Collisions uint64 Ibytes uint64 Obytes uint64 Imcasts uint64 Omcasts uint64 Iqdrops uint64 Noproto uint64 Lastchange Timespec } type IfaMsghdr struct { Msglen uint16 Version uint8 Type uint8 Addrs int32 Flags int32 Metric int32 Index uint16 Pad_cgo_0 [6]byte } type IfAnnounceMsghdr struct { Msglen uint16 Version uint8 Type uint8 Index uint16 Name [16]int8 What uint16 } type RtMsghdr struct { Msglen uint16 Version uint8 Type uint8 Index uint16 Pad_cgo_0 [2]byte Flags int32 Addrs int32 Pid int32 Seq int32 Errno int32 Use int32 Inits int32 Pad_cgo_1 [4]byte Rmx RtMetrics } type RtMetrics struct { Locks uint64 Mtu uint64 Hopcount uint64 Recvpipe uint64 Sendpipe uint64 Ssthresh uint64 Rtt uint64 Rttvar uint64 Expire int64 Pksent int64 } type Mclpool [0]byte const ( SizeofBpfVersion = 0x4 SizeofBpfStat = 0x80 SizeofBpfProgram = 0x8 SizeofBpfInsn = 0x8 SizeofBpfHdr = 0x14 ) type BpfVersion struct { Major uint16 Minor uint16 } type BpfStat struct { Recv uint64 Drop uint64 Capt uint64 Padding [13]uint64 } type BpfProgram struct { Len uint32 Insns *BpfInsn } type BpfInsn struct { Code uint16 Jt uint8 Jf uint8 K uint32 } type BpfHdr struct { Tstamp BpfTimeval Caplen uint32 Datalen uint32 Hdrlen uint16 Pad_cgo_0 [2]byte } type BpfTimeval struct { Sec int32 Usec int32 } type Termios struct { Iflag uint32 Oflag uint32 Cflag uint32 Lflag uint32 Cc [20]uint8 Ispeed int32 Ospeed int32 } type Winsize struct { Row uint16 Col uint16 Xpixel uint16 Ypixel uint16 } type Ptmget struct { Cfd int32 Sfd int32 Cn [1024]byte Sn [1024]byte } const ( AT_FDCWD = -0x64 AT_EACCESS = 0x100 AT_SYMLINK_NOFOLLOW = 0x200 AT_SYMLINK_FOLLOW = 0x400 AT_REMOVEDIR = 0x800 ) type PollFd struct { Fd int32 Events int16 Revents int16 } const ( POLLERR = 0x8 POLLHUP = 0x10 POLLIN = 0x1 POLLNVAL = 0x20 POLLOUT = 0x4 POLLPRI = 0x2 POLLRDBAND = 0x80 POLLRDNORM = 0x40 POLLWRBAND = 0x100 POLLWRNORM = 0x4 ) type Sysctlnode struct { Flags uint32 Num int32 Name [32]int8 Ver uint32 X__rsvd uint32 Un [16]byte X_sysctl_size [8]byte X_sysctl_func [8]byte X_sysctl_parent [8]byte X_sysctl_desc [8]byte } type Utsname struct { Sysname [256]byte Nodename [256]byte Release [256]byte Version [256]byte Machine [256]byte } const SizeofUvmexp = 0x278 type Uvmexp struct { Pagesize int64 Pagemask int64 Pageshift int64 Npages int64 Free int64 Active int64 Inactive int64 Paging int64 Wired int64 Zeropages int64 Reserve_pagedaemon int64 Reserve_kernel int64 Freemin int64 Freetarg int64 Inactarg int64 Wiredmax int64 Nswapdev int64 Swpages int64 Swpginuse int64 Swpgonly int64 Nswget int64 Unused1 int64 Cpuhit int64 Cpumiss int64 Faults int64 Traps int64 Intrs int64 Swtch int64 Softs int64 Syscalls int64 Pageins int64 Swapins int64 Swapouts int64 Pgswapin int64 Pgswapout int64 Forks int64 Forks_ppwait int64 Forks_sharevm int64 Pga_zerohit int64 Pga_zeromiss int64 Zeroaborts int64 Fltnoram int64 Fltnoanon int64 Fltpgwait int64 Fltpgrele int64 Fltrelck int64 Fltrelckok int64 Fltanget int64 Fltanretry int64 Fltamcopy int64 Fltnamap int64 Fltnomap int64 Fltlget int64 Fltget int64 Flt_anon int64 Flt_acow int64 Flt_obj int64 Flt_prcopy int64 Flt_przero int64 Pdwoke int64 Pdrevs int64 Unused4 int64 Pdfreed int64 Pdscans int64 Pdanscan int64 Pdobscan int64 Pdreact int64 Pdbusy int64 Pdpageouts int64 Pdpending int64 Pddeact int64 Anonpages int64 Filepages int64 Execpages int64 Colorhit int64 Colormiss int64 Ncolors int64 Bootpages int64 Poolpages int64 } const SizeofClockinfo = 0x14 type Clockinfo struct { Hz int32 Tick int32 Tickadj int32 Stathz int32 Profhz int32 } ================================================ FILE: vendor/golang.org/x/sys/unix/ztypes_netbsd_arm64.go ================================================ // cgo -godefs types_netbsd.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm64 && netbsd package unix const ( SizeofPtr = 0x8 SizeofShort = 0x2 SizeofInt = 0x4 SizeofLong = 0x8 SizeofLongLong = 0x8 ) type ( _C_short int16 _C_int int32 _C_long int64 _C_long_long int64 ) type Timespec struct { Sec int64 Nsec int64 } type Timeval struct { Sec int64 Usec int32 Pad_cgo_0 [4]byte } type Rusage struct { Utime Timeval Stime Timeval Maxrss int64 Ixrss int64 Idrss int64 Isrss int64 Minflt int64 Majflt int64 Nswap int64 Inblock int64 Oublock int64 Msgsnd int64 Msgrcv int64 Nsignals int64 Nvcsw int64 Nivcsw int64 } type Rlimit struct { Cur uint64 Max uint64 } type _Gid_t uint32 type Stat_t struct { Dev uint64 Mode uint32 _ [4]byte Ino uint64 Nlink uint32 Uid uint32 Gid uint32 _ [4]byte Rdev uint64 Atim Timespec Mtim Timespec Ctim Timespec Btim Timespec Size int64 Blocks int64 Blksize uint32 Flags uint32 Gen uint32 Spare [2]uint32 _ [4]byte } type Statfs_t [0]byte type Statvfs_t struct { Flag uint64 Bsize uint64 Frsize uint64 Iosize uint64 Blocks uint64 Bfree uint64 Bavail uint64 Bresvd uint64 Files uint64 Ffree uint64 Favail uint64 Fresvd uint64 Syncreads uint64 Syncwrites uint64 Asyncreads uint64 Asyncwrites uint64 Fsidx Fsid Fsid uint64 Namemax uint64 Owner uint32 Spare [4]uint32 Fstypename [32]byte Mntonname [1024]byte Mntfromname [1024]byte _ [4]byte } type Flock_t struct { Start int64 Len int64 Pid int32 Type int16 Whence int16 } type Dirent struct { Fileno uint64 Reclen uint16 Namlen uint16 Type uint8 Name [512]int8 Pad_cgo_0 [3]byte } type Fsid struct { X__fsid_val [2]int32 } const ( PathMax = 0x400 ) const ( ST_WAIT = 0x1 ST_NOWAIT = 0x2 ) const ( FADV_NORMAL = 0x0 FADV_RANDOM = 0x1 FADV_SEQUENTIAL = 0x2 FADV_WILLNEED = 0x3 FADV_DONTNEED = 0x4 FADV_NOREUSE = 0x5 ) type RawSockaddrInet4 struct { Len uint8 Family uint8 Port uint16 Addr [4]byte /* in_addr */ Zero [8]int8 } type RawSockaddrInet6 struct { Len uint8 Family uint8 Port uint16 Flowinfo uint32 Addr [16]byte /* in6_addr */ Scope_id uint32 } type RawSockaddrUnix struct { Len uint8 Family uint8 Path [104]int8 } type RawSockaddrDatalink struct { Len uint8 Family uint8 Index uint16 Type uint8 Nlen uint8 Alen uint8 Slen uint8 Data [12]int8 } type RawSockaddr struct { Len uint8 Family uint8 Data [14]int8 } type RawSockaddrAny struct { Addr RawSockaddr Pad [92]int8 } type _Socklen uint32 type Linger struct { Onoff int32 Linger int32 } type Iovec struct { Base *byte Len uint64 } type IPMreq struct { Multiaddr [4]byte /* in_addr */ Interface [4]byte /* in_addr */ } type IPv6Mreq struct { Multiaddr [16]byte /* in6_addr */ Interface uint32 } type Msghdr struct { Name *byte Namelen uint32 Pad_cgo_0 [4]byte Iov *Iovec Iovlen int32 Pad_cgo_1 [4]byte Control *byte Controllen uint32 Flags int32 } type Cmsghdr struct { Len uint32 Level int32 Type int32 } type Inet6Pktinfo struct { Addr [16]byte /* in6_addr */ Ifindex uint32 } type IPv6MTUInfo struct { Addr RawSockaddrInet6 Mtu uint32 } type ICMPv6Filter struct { Filt [8]uint32 } const ( SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet6 = 0x1c SizeofSockaddrAny = 0x6c SizeofSockaddrUnix = 0x6a SizeofSockaddrDatalink = 0x14 SizeofLinger = 0x8 SizeofIovec = 0x10 SizeofIPMreq = 0x8 SizeofIPv6Mreq = 0x14 SizeofMsghdr = 0x30 SizeofCmsghdr = 0xc SizeofInet6Pktinfo = 0x14 SizeofIPv6MTUInfo = 0x20 SizeofICMPv6Filter = 0x20 ) const ( PTRACE_TRACEME = 0x0 PTRACE_CONT = 0x7 PTRACE_KILL = 0x8 ) type Kevent_t struct { Ident uint64 Filter uint32 Flags uint32 Fflags uint32 Pad_cgo_0 [4]byte Data int64 Udata int64 } type FdSet struct { Bits [8]uint32 } const ( SizeofIfMsghdr = 0x98 SizeofIfData = 0x88 SizeofIfaMsghdr = 0x18 SizeofIfAnnounceMsghdr = 0x18 SizeofRtMsghdr = 0x78 SizeofRtMetrics = 0x50 ) type IfMsghdr struct { Msglen uint16 Version uint8 Type uint8 Addrs int32 Flags int32 Index uint16 Pad_cgo_0 [2]byte Data IfData } type IfData struct { Type uint8 Addrlen uint8 Hdrlen uint8 Pad_cgo_0 [1]byte Link_state int32 Mtu uint64 Metric uint64 Baudrate uint64 Ipackets uint64 Ierrors uint64 Opackets uint64 Oerrors uint64 Collisions uint64 Ibytes uint64 Obytes uint64 Imcasts uint64 Omcasts uint64 Iqdrops uint64 Noproto uint64 Lastchange Timespec } type IfaMsghdr struct { Msglen uint16 Version uint8 Type uint8 Addrs int32 Flags int32 Metric int32 Index uint16 Pad_cgo_0 [6]byte } type IfAnnounceMsghdr struct { Msglen uint16 Version uint8 Type uint8 Index uint16 Name [16]int8 What uint16 } type RtMsghdr struct { Msglen uint16 Version uint8 Type uint8 Index uint16 Pad_cgo_0 [2]byte Flags int32 Addrs int32 Pid int32 Seq int32 Errno int32 Use int32 Inits int32 Pad_cgo_1 [4]byte Rmx RtMetrics } type RtMetrics struct { Locks uint64 Mtu uint64 Hopcount uint64 Recvpipe uint64 Sendpipe uint64 Ssthresh uint64 Rtt uint64 Rttvar uint64 Expire int64 Pksent int64 } type Mclpool [0]byte const ( SizeofBpfVersion = 0x4 SizeofBpfStat = 0x80 SizeofBpfProgram = 0x10 SizeofBpfInsn = 0x8 SizeofBpfHdr = 0x20 ) type BpfVersion struct { Major uint16 Minor uint16 } type BpfStat struct { Recv uint64 Drop uint64 Capt uint64 Padding [13]uint64 } type BpfProgram struct { Len uint32 Pad_cgo_0 [4]byte Insns *BpfInsn } type BpfInsn struct { Code uint16 Jt uint8 Jf uint8 K uint32 } type BpfHdr struct { Tstamp BpfTimeval Caplen uint32 Datalen uint32 Hdrlen uint16 Pad_cgo_0 [6]byte } type BpfTimeval struct { Sec int64 Usec int64 } type Termios struct { Iflag uint32 Oflag uint32 Cflag uint32 Lflag uint32 Cc [20]uint8 Ispeed int32 Ospeed int32 } type Winsize struct { Row uint16 Col uint16 Xpixel uint16 Ypixel uint16 } type Ptmget struct { Cfd int32 Sfd int32 Cn [1024]byte Sn [1024]byte } const ( AT_FDCWD = -0x64 AT_EACCESS = 0x100 AT_SYMLINK_NOFOLLOW = 0x200 AT_SYMLINK_FOLLOW = 0x400 AT_REMOVEDIR = 0x800 ) type PollFd struct { Fd int32 Events int16 Revents int16 } const ( POLLERR = 0x8 POLLHUP = 0x10 POLLIN = 0x1 POLLNVAL = 0x20 POLLOUT = 0x4 POLLPRI = 0x2 POLLRDBAND = 0x80 POLLRDNORM = 0x40 POLLWRBAND = 0x100 POLLWRNORM = 0x4 ) type Sysctlnode struct { Flags uint32 Num int32 Name [32]int8 Ver uint32 X__rsvd uint32 Un [16]byte X_sysctl_size [8]byte X_sysctl_func [8]byte X_sysctl_parent [8]byte X_sysctl_desc [8]byte } type Utsname struct { Sysname [256]byte Nodename [256]byte Release [256]byte Version [256]byte Machine [256]byte } const SizeofUvmexp = 0x278 type Uvmexp struct { Pagesize int64 Pagemask int64 Pageshift int64 Npages int64 Free int64 Active int64 Inactive int64 Paging int64 Wired int64 Zeropages int64 Reserve_pagedaemon int64 Reserve_kernel int64 Freemin int64 Freetarg int64 Inactarg int64 Wiredmax int64 Nswapdev int64 Swpages int64 Swpginuse int64 Swpgonly int64 Nswget int64 Unused1 int64 Cpuhit int64 Cpumiss int64 Faults int64 Traps int64 Intrs int64 Swtch int64 Softs int64 Syscalls int64 Pageins int64 Swapins int64 Swapouts int64 Pgswapin int64 Pgswapout int64 Forks int64 Forks_ppwait int64 Forks_sharevm int64 Pga_zerohit int64 Pga_zeromiss int64 Zeroaborts int64 Fltnoram int64 Fltnoanon int64 Fltpgwait int64 Fltpgrele int64 Fltrelck int64 Fltrelckok int64 Fltanget int64 Fltanretry int64 Fltamcopy int64 Fltnamap int64 Fltnomap int64 Fltlget int64 Fltget int64 Flt_anon int64 Flt_acow int64 Flt_obj int64 Flt_prcopy int64 Flt_przero int64 Pdwoke int64 Pdrevs int64 Unused4 int64 Pdfreed int64 Pdscans int64 Pdanscan int64 Pdobscan int64 Pdreact int64 Pdbusy int64 Pdpageouts int64 Pdpending int64 Pddeact int64 Anonpages int64 Filepages int64 Execpages int64 Colorhit int64 Colormiss int64 Ncolors int64 Bootpages int64 Poolpages int64 } const SizeofClockinfo = 0x14 type Clockinfo struct { Hz int32 Tick int32 Tickadj int32 Stathz int32 Profhz int32 } ================================================ FILE: vendor/golang.org/x/sys/unix/ztypes_openbsd_386.go ================================================ // cgo -godefs types_openbsd.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build 386 && openbsd package unix const ( SizeofPtr = 0x4 SizeofShort = 0x2 SizeofInt = 0x4 SizeofLong = 0x4 SizeofLongLong = 0x8 ) type ( _C_short int16 _C_int int32 _C_long int32 _C_long_long int64 ) type Timespec struct { Sec int64 Nsec int32 } type Timeval struct { Sec int64 Usec int32 } type Rusage struct { Utime Timeval Stime Timeval Maxrss int32 Ixrss int32 Idrss int32 Isrss int32 Minflt int32 Majflt int32 Nswap int32 Inblock int32 Oublock int32 Msgsnd int32 Msgrcv int32 Nsignals int32 Nvcsw int32 Nivcsw int32 } type Rlimit struct { Cur uint64 Max uint64 } type _Gid_t uint32 type Stat_t struct { Mode uint32 Dev int32 Ino uint64 Nlink uint32 Uid uint32 Gid uint32 Rdev int32 Atim Timespec Mtim Timespec Ctim Timespec Size int64 Blocks int64 Blksize int32 Flags uint32 Gen uint32 _ Timespec } type Statfs_t struct { F_flags uint32 F_bsize uint32 F_iosize uint32 F_blocks uint64 F_bfree uint64 F_bavail int64 F_files uint64 F_ffree uint64 F_favail int64 F_syncwrites uint64 F_syncreads uint64 F_asyncwrites uint64 F_asyncreads uint64 F_fsid Fsid F_namemax uint32 F_owner uint32 F_ctime uint64 F_fstypename [16]byte F_mntonname [90]byte F_mntfromname [90]byte F_mntfromspec [90]byte _ [2]byte Mount_info [160]byte } type Flock_t struct { Start int64 Len int64 Pid int32 Type int16 Whence int16 } type Dirent struct { Fileno uint64 Off int64 Reclen uint16 Type uint8 Namlen uint8 _ [4]uint8 Name [256]int8 } type Fsid struct { Val [2]int32 } const ( PathMax = 0x400 ) type RawSockaddrInet4 struct { Len uint8 Family uint8 Port uint16 Addr [4]byte /* in_addr */ Zero [8]int8 } type RawSockaddrInet6 struct { Len uint8 Family uint8 Port uint16 Flowinfo uint32 Addr [16]byte /* in6_addr */ Scope_id uint32 } type RawSockaddrUnix struct { Len uint8 Family uint8 Path [104]int8 } type RawSockaddrDatalink struct { Len uint8 Family uint8 Index uint16 Type uint8 Nlen uint8 Alen uint8 Slen uint8 Data [24]int8 } type RawSockaddr struct { Len uint8 Family uint8 Data [14]int8 } type RawSockaddrAny struct { Addr RawSockaddr Pad [92]int8 } type _Socklen uint32 type Linger struct { Onoff int32 Linger int32 } type Iovec struct { Base *byte Len uint32 } type IPMreq struct { Multiaddr [4]byte /* in_addr */ Interface [4]byte /* in_addr */ } type IPv6Mreq struct { Multiaddr [16]byte /* in6_addr */ Interface uint32 } type Msghdr struct { Name *byte Namelen uint32 Iov *Iovec Iovlen uint32 Control *byte Controllen uint32 Flags int32 } type Cmsghdr struct { Len uint32 Level int32 Type int32 } type Inet6Pktinfo struct { Addr [16]byte /* in6_addr */ Ifindex uint32 } type IPv6MTUInfo struct { Addr RawSockaddrInet6 Mtu uint32 } type ICMPv6Filter struct { Filt [8]uint32 } const ( SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet6 = 0x1c SizeofSockaddrAny = 0x6c SizeofSockaddrUnix = 0x6a SizeofSockaddrDatalink = 0x20 SizeofLinger = 0x8 SizeofIovec = 0x8 SizeofIPMreq = 0x8 SizeofIPv6Mreq = 0x14 SizeofMsghdr = 0x1c SizeofCmsghdr = 0xc SizeofInet6Pktinfo = 0x14 SizeofIPv6MTUInfo = 0x20 SizeofICMPv6Filter = 0x20 ) const ( PTRACE_TRACEME = 0x0 PTRACE_CONT = 0x7 PTRACE_KILL = 0x8 ) type Kevent_t struct { Ident uint32 Filter int16 Flags uint16 Fflags uint32 Data int64 Udata *byte } type FdSet struct { Bits [32]uint32 } const ( SizeofIfMsghdr = 0xa0 SizeofIfData = 0x88 SizeofIfaMsghdr = 0x18 SizeofIfAnnounceMsghdr = 0x1a SizeofRtMsghdr = 0x60 SizeofRtMetrics = 0x38 ) type IfMsghdr struct { Msglen uint16 Version uint8 Type uint8 Hdrlen uint16 Index uint16 Tableid uint16 Pad1 uint8 Pad2 uint8 Addrs int32 Flags int32 Xflags int32 Data IfData } type IfData struct { Type uint8 Addrlen uint8 Hdrlen uint8 Link_state uint8 Mtu uint32 Metric uint32 Rdomain uint32 Baudrate uint64 Ipackets uint64 Ierrors uint64 Opackets uint64 Oerrors uint64 Collisions uint64 Ibytes uint64 Obytes uint64 Imcasts uint64 Omcasts uint64 Iqdrops uint64 Oqdrops uint64 Noproto uint64 Capabilities uint32 Lastchange Timeval } type IfaMsghdr struct { Msglen uint16 Version uint8 Type uint8 Hdrlen uint16 Index uint16 Tableid uint16 Pad1 uint8 Pad2 uint8 Addrs int32 Flags int32 Metric int32 } type IfAnnounceMsghdr struct { Msglen uint16 Version uint8 Type uint8 Hdrlen uint16 Index uint16 What uint16 Name [16]int8 } type RtMsghdr struct { Msglen uint16 Version uint8 Type uint8 Hdrlen uint16 Index uint16 Tableid uint16 Priority uint8 Mpls uint8 Addrs int32 Flags int32 Fmask int32 Pid int32 Seq int32 Errno int32 Inits uint32 Rmx RtMetrics } type RtMetrics struct { Pksent uint64 Expire int64 Locks uint32 Mtu uint32 Refcnt uint32 Hopcount uint32 Recvpipe uint32 Sendpipe uint32 Ssthresh uint32 Rtt uint32 Rttvar uint32 Pad uint32 } const ( SizeofBpfVersion = 0x4 SizeofBpfStat = 0x8 SizeofBpfProgram = 0x8 SizeofBpfInsn = 0x8 SizeofBpfHdr = 0x18 ) type BpfVersion struct { Major uint16 Minor uint16 } type BpfStat struct { Recv uint32 Drop uint32 } type BpfProgram struct { Len uint32 Insns *BpfInsn } type BpfInsn struct { Code uint16 Jt uint8 Jf uint8 K uint32 } type BpfHdr struct { Tstamp BpfTimeval Caplen uint32 Datalen uint32 Hdrlen uint16 Ifidx uint16 Flowid uint16 Flags uint8 Drops uint8 } type BpfTimeval struct { Sec uint32 Usec uint32 } type Termios struct { Iflag uint32 Oflag uint32 Cflag uint32 Lflag uint32 Cc [20]uint8 Ispeed int32 Ospeed int32 } type Winsize struct { Row uint16 Col uint16 Xpixel uint16 Ypixel uint16 } const ( AT_FDCWD = -0x64 AT_EACCESS = 0x1 AT_SYMLINK_NOFOLLOW = 0x2 AT_SYMLINK_FOLLOW = 0x4 AT_REMOVEDIR = 0x8 ) type PollFd struct { Fd int32 Events int16 Revents int16 } const ( POLLERR = 0x8 POLLHUP = 0x10 POLLIN = 0x1 POLLNVAL = 0x20 POLLOUT = 0x4 POLLPRI = 0x2 POLLRDBAND = 0x80 POLLRDNORM = 0x40 POLLWRBAND = 0x100 POLLWRNORM = 0x4 ) type Sigset_t uint32 type Utsname struct { Sysname [256]byte Nodename [256]byte Release [256]byte Version [256]byte Machine [256]byte } const SizeofUvmexp = 0x158 type Uvmexp struct { Pagesize int32 Pagemask int32 Pageshift int32 Npages int32 Free int32 Active int32 Inactive int32 Paging int32 Wired int32 Zeropages int32 Reserve_pagedaemon int32 Reserve_kernel int32 Unused01 int32 Vnodepages int32 Vtextpages int32 Freemin int32 Freetarg int32 Inactarg int32 Wiredmax int32 Anonmin int32 Vtextmin int32 Vnodemin int32 Anonminpct int32 Vtextminpct int32 Vnodeminpct int32 Nswapdev int32 Swpages int32 Swpginuse int32 Swpgonly int32 Nswget int32 Nanon int32 Unused05 int32 Unused06 int32 Faults int32 Traps int32 Intrs int32 Swtch int32 Softs int32 Syscalls int32 Pageins int32 Unused07 int32 Unused08 int32 Pgswapin int32 Pgswapout int32 Forks int32 Forks_ppwait int32 Forks_sharevm int32 Pga_zerohit int32 Pga_zeromiss int32 Unused09 int32 Fltnoram int32 Fltnoanon int32 Fltnoamap int32 Fltpgwait int32 Fltpgrele int32 Fltrelck int32 Fltrelckok int32 Fltanget int32 Fltanretry int32 Fltamcopy int32 Fltnamap int32 Fltnomap int32 Fltlget int32 Fltget int32 Flt_anon int32 Flt_acow int32 Flt_obj int32 Flt_prcopy int32 Flt_przero int32 Pdwoke int32 Pdrevs int32 Pdswout int32 Pdfreed int32 Pdscans int32 Pdanscan int32 Pdobscan int32 Pdreact int32 Pdbusy int32 Pdpageouts int32 Pdpending int32 Pddeact int32 Unused11 int32 Unused12 int32 Unused13 int32 Fpswtch int32 Kmapent int32 } const SizeofClockinfo = 0x10 type Clockinfo struct { Hz int32 Tick int32 Stathz int32 Profhz int32 } ================================================ FILE: vendor/golang.org/x/sys/unix/ztypes_openbsd_amd64.go ================================================ // cgo -godefs types_openbsd.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build amd64 && openbsd package unix const ( SizeofPtr = 0x8 SizeofShort = 0x2 SizeofInt = 0x4 SizeofLong = 0x8 SizeofLongLong = 0x8 ) type ( _C_short int16 _C_int int32 _C_long int64 _C_long_long int64 ) type Timespec struct { Sec int64 Nsec int64 } type Timeval struct { Sec int64 Usec int64 } type Rusage struct { Utime Timeval Stime Timeval Maxrss int64 Ixrss int64 Idrss int64 Isrss int64 Minflt int64 Majflt int64 Nswap int64 Inblock int64 Oublock int64 Msgsnd int64 Msgrcv int64 Nsignals int64 Nvcsw int64 Nivcsw int64 } type Rlimit struct { Cur uint64 Max uint64 } type _Gid_t uint32 type Stat_t struct { Mode uint32 Dev int32 Ino uint64 Nlink uint32 Uid uint32 Gid uint32 Rdev int32 Atim Timespec Mtim Timespec Ctim Timespec Size int64 Blocks int64 Blksize int32 Flags uint32 Gen uint32 _ Timespec } type Statfs_t struct { F_flags uint32 F_bsize uint32 F_iosize uint32 F_blocks uint64 F_bfree uint64 F_bavail int64 F_files uint64 F_ffree uint64 F_favail int64 F_syncwrites uint64 F_syncreads uint64 F_asyncwrites uint64 F_asyncreads uint64 F_fsid Fsid F_namemax uint32 F_owner uint32 F_ctime uint64 F_fstypename [16]byte F_mntonname [90]byte F_mntfromname [90]byte F_mntfromspec [90]byte _ [2]byte Mount_info [160]byte } type Flock_t struct { Start int64 Len int64 Pid int32 Type int16 Whence int16 } type Dirent struct { Fileno uint64 Off int64 Reclen uint16 Type uint8 Namlen uint8 _ [4]uint8 Name [256]int8 } type Fsid struct { Val [2]int32 } const ( PathMax = 0x400 ) type RawSockaddrInet4 struct { Len uint8 Family uint8 Port uint16 Addr [4]byte /* in_addr */ Zero [8]int8 } type RawSockaddrInet6 struct { Len uint8 Family uint8 Port uint16 Flowinfo uint32 Addr [16]byte /* in6_addr */ Scope_id uint32 } type RawSockaddrUnix struct { Len uint8 Family uint8 Path [104]int8 } type RawSockaddrDatalink struct { Len uint8 Family uint8 Index uint16 Type uint8 Nlen uint8 Alen uint8 Slen uint8 Data [24]int8 } type RawSockaddr struct { Len uint8 Family uint8 Data [14]int8 } type RawSockaddrAny struct { Addr RawSockaddr Pad [92]int8 } type _Socklen uint32 type Linger struct { Onoff int32 Linger int32 } type Iovec struct { Base *byte Len uint64 } type IPMreq struct { Multiaddr [4]byte /* in_addr */ Interface [4]byte /* in_addr */ } type IPv6Mreq struct { Multiaddr [16]byte /* in6_addr */ Interface uint32 } type Msghdr struct { Name *byte Namelen uint32 Iov *Iovec Iovlen uint32 Control *byte Controllen uint32 Flags int32 } type Cmsghdr struct { Len uint32 Level int32 Type int32 } type Inet6Pktinfo struct { Addr [16]byte /* in6_addr */ Ifindex uint32 } type IPv6MTUInfo struct { Addr RawSockaddrInet6 Mtu uint32 } type ICMPv6Filter struct { Filt [8]uint32 } const ( SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet6 = 0x1c SizeofSockaddrAny = 0x6c SizeofSockaddrUnix = 0x6a SizeofSockaddrDatalink = 0x20 SizeofLinger = 0x8 SizeofIovec = 0x10 SizeofIPMreq = 0x8 SizeofIPv6Mreq = 0x14 SizeofMsghdr = 0x30 SizeofCmsghdr = 0xc SizeofInet6Pktinfo = 0x14 SizeofIPv6MTUInfo = 0x20 SizeofICMPv6Filter = 0x20 ) const ( PTRACE_TRACEME = 0x0 PTRACE_CONT = 0x7 PTRACE_KILL = 0x8 ) type Kevent_t struct { Ident uint64 Filter int16 Flags uint16 Fflags uint32 Data int64 Udata *byte } type FdSet struct { Bits [32]uint32 } const ( SizeofIfMsghdr = 0xa8 SizeofIfData = 0x90 SizeofIfaMsghdr = 0x18 SizeofIfAnnounceMsghdr = 0x1a SizeofRtMsghdr = 0x60 SizeofRtMetrics = 0x38 ) type IfMsghdr struct { Msglen uint16 Version uint8 Type uint8 Hdrlen uint16 Index uint16 Tableid uint16 Pad1 uint8 Pad2 uint8 Addrs int32 Flags int32 Xflags int32 Data IfData } type IfData struct { Type uint8 Addrlen uint8 Hdrlen uint8 Link_state uint8 Mtu uint32 Metric uint32 Rdomain uint32 Baudrate uint64 Ipackets uint64 Ierrors uint64 Opackets uint64 Oerrors uint64 Collisions uint64 Ibytes uint64 Obytes uint64 Imcasts uint64 Omcasts uint64 Iqdrops uint64 Oqdrops uint64 Noproto uint64 Capabilities uint32 Lastchange Timeval } type IfaMsghdr struct { Msglen uint16 Version uint8 Type uint8 Hdrlen uint16 Index uint16 Tableid uint16 Pad1 uint8 Pad2 uint8 Addrs int32 Flags int32 Metric int32 } type IfAnnounceMsghdr struct { Msglen uint16 Version uint8 Type uint8 Hdrlen uint16 Index uint16 What uint16 Name [16]int8 } type RtMsghdr struct { Msglen uint16 Version uint8 Type uint8 Hdrlen uint16 Index uint16 Tableid uint16 Priority uint8 Mpls uint8 Addrs int32 Flags int32 Fmask int32 Pid int32 Seq int32 Errno int32 Inits uint32 Rmx RtMetrics } type RtMetrics struct { Pksent uint64 Expire int64 Locks uint32 Mtu uint32 Refcnt uint32 Hopcount uint32 Recvpipe uint32 Sendpipe uint32 Ssthresh uint32 Rtt uint32 Rttvar uint32 Pad uint32 } const ( SizeofBpfVersion = 0x4 SizeofBpfStat = 0x8 SizeofBpfProgram = 0x10 SizeofBpfInsn = 0x8 SizeofBpfHdr = 0x18 ) type BpfVersion struct { Major uint16 Minor uint16 } type BpfStat struct { Recv uint32 Drop uint32 } type BpfProgram struct { Len uint32 Insns *BpfInsn } type BpfInsn struct { Code uint16 Jt uint8 Jf uint8 K uint32 } type BpfHdr struct { Tstamp BpfTimeval Caplen uint32 Datalen uint32 Hdrlen uint16 Ifidx uint16 Flowid uint16 Flags uint8 Drops uint8 } type BpfTimeval struct { Sec uint32 Usec uint32 } type Termios struct { Iflag uint32 Oflag uint32 Cflag uint32 Lflag uint32 Cc [20]uint8 Ispeed int32 Ospeed int32 } type Winsize struct { Row uint16 Col uint16 Xpixel uint16 Ypixel uint16 } const ( AT_FDCWD = -0x64 AT_EACCESS = 0x1 AT_SYMLINK_NOFOLLOW = 0x2 AT_SYMLINK_FOLLOW = 0x4 AT_REMOVEDIR = 0x8 ) type PollFd struct { Fd int32 Events int16 Revents int16 } const ( POLLERR = 0x8 POLLHUP = 0x10 POLLIN = 0x1 POLLNVAL = 0x20 POLLOUT = 0x4 POLLPRI = 0x2 POLLRDBAND = 0x80 POLLRDNORM = 0x40 POLLWRBAND = 0x100 POLLWRNORM = 0x4 ) type Sigset_t uint32 type Utsname struct { Sysname [256]byte Nodename [256]byte Release [256]byte Version [256]byte Machine [256]byte } const SizeofUvmexp = 0x158 type Uvmexp struct { Pagesize int32 Pagemask int32 Pageshift int32 Npages int32 Free int32 Active int32 Inactive int32 Paging int32 Wired int32 Zeropages int32 Reserve_pagedaemon int32 Reserve_kernel int32 Unused01 int32 Vnodepages int32 Vtextpages int32 Freemin int32 Freetarg int32 Inactarg int32 Wiredmax int32 Anonmin int32 Vtextmin int32 Vnodemin int32 Anonminpct int32 Vtextminpct int32 Vnodeminpct int32 Nswapdev int32 Swpages int32 Swpginuse int32 Swpgonly int32 Nswget int32 Nanon int32 Unused05 int32 Unused06 int32 Faults int32 Traps int32 Intrs int32 Swtch int32 Softs int32 Syscalls int32 Pageins int32 Unused07 int32 Unused08 int32 Pgswapin int32 Pgswapout int32 Forks int32 Forks_ppwait int32 Forks_sharevm int32 Pga_zerohit int32 Pga_zeromiss int32 Unused09 int32 Fltnoram int32 Fltnoanon int32 Fltnoamap int32 Fltpgwait int32 Fltpgrele int32 Fltrelck int32 Fltrelckok int32 Fltanget int32 Fltanretry int32 Fltamcopy int32 Fltnamap int32 Fltnomap int32 Fltlget int32 Fltget int32 Flt_anon int32 Flt_acow int32 Flt_obj int32 Flt_prcopy int32 Flt_przero int32 Pdwoke int32 Pdrevs int32 Pdswout int32 Pdfreed int32 Pdscans int32 Pdanscan int32 Pdobscan int32 Pdreact int32 Pdbusy int32 Pdpageouts int32 Pdpending int32 Pddeact int32 Unused11 int32 Unused12 int32 Unused13 int32 Fpswtch int32 Kmapent int32 } const SizeofClockinfo = 0x10 type Clockinfo struct { Hz int32 Tick int32 Stathz int32 Profhz int32 } ================================================ FILE: vendor/golang.org/x/sys/unix/ztypes_openbsd_arm.go ================================================ // cgo -godefs -- -fsigned-char types_openbsd.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm && openbsd package unix const ( SizeofPtr = 0x4 SizeofShort = 0x2 SizeofInt = 0x4 SizeofLong = 0x4 SizeofLongLong = 0x8 ) type ( _C_short int16 _C_int int32 _C_long int32 _C_long_long int64 ) type Timespec struct { Sec int64 Nsec int32 _ [4]byte } type Timeval struct { Sec int64 Usec int32 _ [4]byte } type Rusage struct { Utime Timeval Stime Timeval Maxrss int32 Ixrss int32 Idrss int32 Isrss int32 Minflt int32 Majflt int32 Nswap int32 Inblock int32 Oublock int32 Msgsnd int32 Msgrcv int32 Nsignals int32 Nvcsw int32 Nivcsw int32 } type Rlimit struct { Cur uint64 Max uint64 } type _Gid_t uint32 type Stat_t struct { Mode uint32 Dev int32 Ino uint64 Nlink uint32 Uid uint32 Gid uint32 Rdev int32 Atim Timespec Mtim Timespec Ctim Timespec Size int64 Blocks int64 Blksize int32 Flags uint32 Gen uint32 _ [4]byte _ Timespec } type Statfs_t struct { F_flags uint32 F_bsize uint32 F_iosize uint32 _ [4]byte F_blocks uint64 F_bfree uint64 F_bavail int64 F_files uint64 F_ffree uint64 F_favail int64 F_syncwrites uint64 F_syncreads uint64 F_asyncwrites uint64 F_asyncreads uint64 F_fsid Fsid F_namemax uint32 F_owner uint32 F_ctime uint64 F_fstypename [16]byte F_mntonname [90]byte F_mntfromname [90]byte F_mntfromspec [90]byte _ [2]byte Mount_info [160]byte } type Flock_t struct { Start int64 Len int64 Pid int32 Type int16 Whence int16 } type Dirent struct { Fileno uint64 Off int64 Reclen uint16 Type uint8 Namlen uint8 _ [4]uint8 Name [256]int8 } type Fsid struct { Val [2]int32 } const ( PathMax = 0x400 ) type RawSockaddrInet4 struct { Len uint8 Family uint8 Port uint16 Addr [4]byte /* in_addr */ Zero [8]int8 } type RawSockaddrInet6 struct { Len uint8 Family uint8 Port uint16 Flowinfo uint32 Addr [16]byte /* in6_addr */ Scope_id uint32 } type RawSockaddrUnix struct { Len uint8 Family uint8 Path [104]int8 } type RawSockaddrDatalink struct { Len uint8 Family uint8 Index uint16 Type uint8 Nlen uint8 Alen uint8 Slen uint8 Data [24]int8 } type RawSockaddr struct { Len uint8 Family uint8 Data [14]int8 } type RawSockaddrAny struct { Addr RawSockaddr Pad [92]int8 } type _Socklen uint32 type Linger struct { Onoff int32 Linger int32 } type Iovec struct { Base *byte Len uint32 } type IPMreq struct { Multiaddr [4]byte /* in_addr */ Interface [4]byte /* in_addr */ } type IPv6Mreq struct { Multiaddr [16]byte /* in6_addr */ Interface uint32 } type Msghdr struct { Name *byte Namelen uint32 Iov *Iovec Iovlen uint32 Control *byte Controllen uint32 Flags int32 } type Cmsghdr struct { Len uint32 Level int32 Type int32 } type Inet6Pktinfo struct { Addr [16]byte /* in6_addr */ Ifindex uint32 } type IPv6MTUInfo struct { Addr RawSockaddrInet6 Mtu uint32 } type ICMPv6Filter struct { Filt [8]uint32 } const ( SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet6 = 0x1c SizeofSockaddrAny = 0x6c SizeofSockaddrUnix = 0x6a SizeofSockaddrDatalink = 0x20 SizeofLinger = 0x8 SizeofIovec = 0x8 SizeofIPMreq = 0x8 SizeofIPv6Mreq = 0x14 SizeofMsghdr = 0x1c SizeofCmsghdr = 0xc SizeofInet6Pktinfo = 0x14 SizeofIPv6MTUInfo = 0x20 SizeofICMPv6Filter = 0x20 ) const ( PTRACE_TRACEME = 0x0 PTRACE_CONT = 0x7 PTRACE_KILL = 0x8 ) type Kevent_t struct { Ident uint32 Filter int16 Flags uint16 Fflags uint32 _ [4]byte Data int64 Udata *byte _ [4]byte } type FdSet struct { Bits [32]uint32 } const ( SizeofIfMsghdr = 0xa8 SizeofIfData = 0x90 SizeofIfaMsghdr = 0x18 SizeofIfAnnounceMsghdr = 0x1a SizeofRtMsghdr = 0x60 SizeofRtMetrics = 0x38 ) type IfMsghdr struct { Msglen uint16 Version uint8 Type uint8 Hdrlen uint16 Index uint16 Tableid uint16 Pad1 uint8 Pad2 uint8 Addrs int32 Flags int32 Xflags int32 Data IfData } type IfData struct { Type uint8 Addrlen uint8 Hdrlen uint8 Link_state uint8 Mtu uint32 Metric uint32 Rdomain uint32 Baudrate uint64 Ipackets uint64 Ierrors uint64 Opackets uint64 Oerrors uint64 Collisions uint64 Ibytes uint64 Obytes uint64 Imcasts uint64 Omcasts uint64 Iqdrops uint64 Oqdrops uint64 Noproto uint64 Capabilities uint32 _ [4]byte Lastchange Timeval } type IfaMsghdr struct { Msglen uint16 Version uint8 Type uint8 Hdrlen uint16 Index uint16 Tableid uint16 Pad1 uint8 Pad2 uint8 Addrs int32 Flags int32 Metric int32 } type IfAnnounceMsghdr struct { Msglen uint16 Version uint8 Type uint8 Hdrlen uint16 Index uint16 What uint16 Name [16]int8 } type RtMsghdr struct { Msglen uint16 Version uint8 Type uint8 Hdrlen uint16 Index uint16 Tableid uint16 Priority uint8 Mpls uint8 Addrs int32 Flags int32 Fmask int32 Pid int32 Seq int32 Errno int32 Inits uint32 Rmx RtMetrics } type RtMetrics struct { Pksent uint64 Expire int64 Locks uint32 Mtu uint32 Refcnt uint32 Hopcount uint32 Recvpipe uint32 Sendpipe uint32 Ssthresh uint32 Rtt uint32 Rttvar uint32 Pad uint32 } const ( SizeofBpfVersion = 0x4 SizeofBpfStat = 0x8 SizeofBpfProgram = 0x8 SizeofBpfInsn = 0x8 SizeofBpfHdr = 0x18 ) type BpfVersion struct { Major uint16 Minor uint16 } type BpfStat struct { Recv uint32 Drop uint32 } type BpfProgram struct { Len uint32 Insns *BpfInsn } type BpfInsn struct { Code uint16 Jt uint8 Jf uint8 K uint32 } type BpfHdr struct { Tstamp BpfTimeval Caplen uint32 Datalen uint32 Hdrlen uint16 Ifidx uint16 Flowid uint16 Flags uint8 Drops uint8 } type BpfTimeval struct { Sec uint32 Usec uint32 } type Termios struct { Iflag uint32 Oflag uint32 Cflag uint32 Lflag uint32 Cc [20]uint8 Ispeed int32 Ospeed int32 } type Winsize struct { Row uint16 Col uint16 Xpixel uint16 Ypixel uint16 } const ( AT_FDCWD = -0x64 AT_EACCESS = 0x1 AT_SYMLINK_NOFOLLOW = 0x2 AT_SYMLINK_FOLLOW = 0x4 AT_REMOVEDIR = 0x8 ) type PollFd struct { Fd int32 Events int16 Revents int16 } const ( POLLERR = 0x8 POLLHUP = 0x10 POLLIN = 0x1 POLLNVAL = 0x20 POLLOUT = 0x4 POLLPRI = 0x2 POLLRDBAND = 0x80 POLLRDNORM = 0x40 POLLWRBAND = 0x100 POLLWRNORM = 0x4 ) type Sigset_t uint32 type Utsname struct { Sysname [256]byte Nodename [256]byte Release [256]byte Version [256]byte Machine [256]byte } const SizeofUvmexp = 0x158 type Uvmexp struct { Pagesize int32 Pagemask int32 Pageshift int32 Npages int32 Free int32 Active int32 Inactive int32 Paging int32 Wired int32 Zeropages int32 Reserve_pagedaemon int32 Reserve_kernel int32 Unused01 int32 Vnodepages int32 Vtextpages int32 Freemin int32 Freetarg int32 Inactarg int32 Wiredmax int32 Anonmin int32 Vtextmin int32 Vnodemin int32 Anonminpct int32 Vtextminpct int32 Vnodeminpct int32 Nswapdev int32 Swpages int32 Swpginuse int32 Swpgonly int32 Nswget int32 Nanon int32 Unused05 int32 Unused06 int32 Faults int32 Traps int32 Intrs int32 Swtch int32 Softs int32 Syscalls int32 Pageins int32 Unused07 int32 Unused08 int32 Pgswapin int32 Pgswapout int32 Forks int32 Forks_ppwait int32 Forks_sharevm int32 Pga_zerohit int32 Pga_zeromiss int32 Unused09 int32 Fltnoram int32 Fltnoanon int32 Fltnoamap int32 Fltpgwait int32 Fltpgrele int32 Fltrelck int32 Fltrelckok int32 Fltanget int32 Fltanretry int32 Fltamcopy int32 Fltnamap int32 Fltnomap int32 Fltlget int32 Fltget int32 Flt_anon int32 Flt_acow int32 Flt_obj int32 Flt_prcopy int32 Flt_przero int32 Pdwoke int32 Pdrevs int32 Pdswout int32 Pdfreed int32 Pdscans int32 Pdanscan int32 Pdobscan int32 Pdreact int32 Pdbusy int32 Pdpageouts int32 Pdpending int32 Pddeact int32 Unused11 int32 Unused12 int32 Unused13 int32 Fpswtch int32 Kmapent int32 } const SizeofClockinfo = 0x10 type Clockinfo struct { Hz int32 Tick int32 Stathz int32 Profhz int32 } ================================================ FILE: vendor/golang.org/x/sys/unix/ztypes_openbsd_arm64.go ================================================ // cgo -godefs -- -fsigned-char types_openbsd.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm64 && openbsd package unix const ( SizeofPtr = 0x8 SizeofShort = 0x2 SizeofInt = 0x4 SizeofLong = 0x8 SizeofLongLong = 0x8 ) type ( _C_short int16 _C_int int32 _C_long int64 _C_long_long int64 ) type Timespec struct { Sec int64 Nsec int64 } type Timeval struct { Sec int64 Usec int64 } type Rusage struct { Utime Timeval Stime Timeval Maxrss int64 Ixrss int64 Idrss int64 Isrss int64 Minflt int64 Majflt int64 Nswap int64 Inblock int64 Oublock int64 Msgsnd int64 Msgrcv int64 Nsignals int64 Nvcsw int64 Nivcsw int64 } type Rlimit struct { Cur uint64 Max uint64 } type _Gid_t uint32 type Stat_t struct { Mode uint32 Dev int32 Ino uint64 Nlink uint32 Uid uint32 Gid uint32 Rdev int32 Atim Timespec Mtim Timespec Ctim Timespec Size int64 Blocks int64 Blksize int32 Flags uint32 Gen uint32 _ Timespec } type Statfs_t struct { F_flags uint32 F_bsize uint32 F_iosize uint32 F_blocks uint64 F_bfree uint64 F_bavail int64 F_files uint64 F_ffree uint64 F_favail int64 F_syncwrites uint64 F_syncreads uint64 F_asyncwrites uint64 F_asyncreads uint64 F_fsid Fsid F_namemax uint32 F_owner uint32 F_ctime uint64 F_fstypename [16]byte F_mntonname [90]byte F_mntfromname [90]byte F_mntfromspec [90]byte _ [2]byte Mount_info [160]byte } type Flock_t struct { Start int64 Len int64 Pid int32 Type int16 Whence int16 } type Dirent struct { Fileno uint64 Off int64 Reclen uint16 Type uint8 Namlen uint8 _ [4]uint8 Name [256]int8 } type Fsid struct { Val [2]int32 } const ( PathMax = 0x400 ) type RawSockaddrInet4 struct { Len uint8 Family uint8 Port uint16 Addr [4]byte /* in_addr */ Zero [8]int8 } type RawSockaddrInet6 struct { Len uint8 Family uint8 Port uint16 Flowinfo uint32 Addr [16]byte /* in6_addr */ Scope_id uint32 } type RawSockaddrUnix struct { Len uint8 Family uint8 Path [104]int8 } type RawSockaddrDatalink struct { Len uint8 Family uint8 Index uint16 Type uint8 Nlen uint8 Alen uint8 Slen uint8 Data [24]int8 } type RawSockaddr struct { Len uint8 Family uint8 Data [14]int8 } type RawSockaddrAny struct { Addr RawSockaddr Pad [92]int8 } type _Socklen uint32 type Linger struct { Onoff int32 Linger int32 } type Iovec struct { Base *byte Len uint64 } type IPMreq struct { Multiaddr [4]byte /* in_addr */ Interface [4]byte /* in_addr */ } type IPv6Mreq struct { Multiaddr [16]byte /* in6_addr */ Interface uint32 } type Msghdr struct { Name *byte Namelen uint32 Iov *Iovec Iovlen uint32 Control *byte Controllen uint32 Flags int32 } type Cmsghdr struct { Len uint32 Level int32 Type int32 } type Inet6Pktinfo struct { Addr [16]byte /* in6_addr */ Ifindex uint32 } type IPv6MTUInfo struct { Addr RawSockaddrInet6 Mtu uint32 } type ICMPv6Filter struct { Filt [8]uint32 } const ( SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet6 = 0x1c SizeofSockaddrAny = 0x6c SizeofSockaddrUnix = 0x6a SizeofSockaddrDatalink = 0x20 SizeofLinger = 0x8 SizeofIovec = 0x10 SizeofIPMreq = 0x8 SizeofIPv6Mreq = 0x14 SizeofMsghdr = 0x30 SizeofCmsghdr = 0xc SizeofInet6Pktinfo = 0x14 SizeofIPv6MTUInfo = 0x20 SizeofICMPv6Filter = 0x20 ) const ( PTRACE_TRACEME = 0x0 PTRACE_CONT = 0x7 PTRACE_KILL = 0x8 ) type Kevent_t struct { Ident uint64 Filter int16 Flags uint16 Fflags uint32 Data int64 Udata *byte } type FdSet struct { Bits [32]uint32 } const ( SizeofIfMsghdr = 0xa8 SizeofIfData = 0x90 SizeofIfaMsghdr = 0x18 SizeofIfAnnounceMsghdr = 0x1a SizeofRtMsghdr = 0x60 SizeofRtMetrics = 0x38 ) type IfMsghdr struct { Msglen uint16 Version uint8 Type uint8 Hdrlen uint16 Index uint16 Tableid uint16 Pad1 uint8 Pad2 uint8 Addrs int32 Flags int32 Xflags int32 Data IfData } type IfData struct { Type uint8 Addrlen uint8 Hdrlen uint8 Link_state uint8 Mtu uint32 Metric uint32 Rdomain uint32 Baudrate uint64 Ipackets uint64 Ierrors uint64 Opackets uint64 Oerrors uint64 Collisions uint64 Ibytes uint64 Obytes uint64 Imcasts uint64 Omcasts uint64 Iqdrops uint64 Oqdrops uint64 Noproto uint64 Capabilities uint32 Lastchange Timeval } type IfaMsghdr struct { Msglen uint16 Version uint8 Type uint8 Hdrlen uint16 Index uint16 Tableid uint16 Pad1 uint8 Pad2 uint8 Addrs int32 Flags int32 Metric int32 } type IfAnnounceMsghdr struct { Msglen uint16 Version uint8 Type uint8 Hdrlen uint16 Index uint16 What uint16 Name [16]int8 } type RtMsghdr struct { Msglen uint16 Version uint8 Type uint8 Hdrlen uint16 Index uint16 Tableid uint16 Priority uint8 Mpls uint8 Addrs int32 Flags int32 Fmask int32 Pid int32 Seq int32 Errno int32 Inits uint32 Rmx RtMetrics } type RtMetrics struct { Pksent uint64 Expire int64 Locks uint32 Mtu uint32 Refcnt uint32 Hopcount uint32 Recvpipe uint32 Sendpipe uint32 Ssthresh uint32 Rtt uint32 Rttvar uint32 Pad uint32 } const ( SizeofBpfVersion = 0x4 SizeofBpfStat = 0x8 SizeofBpfProgram = 0x10 SizeofBpfInsn = 0x8 SizeofBpfHdr = 0x18 ) type BpfVersion struct { Major uint16 Minor uint16 } type BpfStat struct { Recv uint32 Drop uint32 } type BpfProgram struct { Len uint32 Insns *BpfInsn } type BpfInsn struct { Code uint16 Jt uint8 Jf uint8 K uint32 } type BpfHdr struct { Tstamp BpfTimeval Caplen uint32 Datalen uint32 Hdrlen uint16 Ifidx uint16 Flowid uint16 Flags uint8 Drops uint8 } type BpfTimeval struct { Sec uint32 Usec uint32 } type Termios struct { Iflag uint32 Oflag uint32 Cflag uint32 Lflag uint32 Cc [20]uint8 Ispeed int32 Ospeed int32 } type Winsize struct { Row uint16 Col uint16 Xpixel uint16 Ypixel uint16 } const ( AT_FDCWD = -0x64 AT_EACCESS = 0x1 AT_SYMLINK_NOFOLLOW = 0x2 AT_SYMLINK_FOLLOW = 0x4 AT_REMOVEDIR = 0x8 ) type PollFd struct { Fd int32 Events int16 Revents int16 } const ( POLLERR = 0x8 POLLHUP = 0x10 POLLIN = 0x1 POLLNVAL = 0x20 POLLOUT = 0x4 POLLPRI = 0x2 POLLRDBAND = 0x80 POLLRDNORM = 0x40 POLLWRBAND = 0x100 POLLWRNORM = 0x4 ) type Sigset_t uint32 type Utsname struct { Sysname [256]byte Nodename [256]byte Release [256]byte Version [256]byte Machine [256]byte } const SizeofUvmexp = 0x158 type Uvmexp struct { Pagesize int32 Pagemask int32 Pageshift int32 Npages int32 Free int32 Active int32 Inactive int32 Paging int32 Wired int32 Zeropages int32 Reserve_pagedaemon int32 Reserve_kernel int32 Unused01 int32 Vnodepages int32 Vtextpages int32 Freemin int32 Freetarg int32 Inactarg int32 Wiredmax int32 Anonmin int32 Vtextmin int32 Vnodemin int32 Anonminpct int32 Vtextminpct int32 Vnodeminpct int32 Nswapdev int32 Swpages int32 Swpginuse int32 Swpgonly int32 Nswget int32 Nanon int32 Unused05 int32 Unused06 int32 Faults int32 Traps int32 Intrs int32 Swtch int32 Softs int32 Syscalls int32 Pageins int32 Unused07 int32 Unused08 int32 Pgswapin int32 Pgswapout int32 Forks int32 Forks_ppwait int32 Forks_sharevm int32 Pga_zerohit int32 Pga_zeromiss int32 Unused09 int32 Fltnoram int32 Fltnoanon int32 Fltnoamap int32 Fltpgwait int32 Fltpgrele int32 Fltrelck int32 Fltrelckok int32 Fltanget int32 Fltanretry int32 Fltamcopy int32 Fltnamap int32 Fltnomap int32 Fltlget int32 Fltget int32 Flt_anon int32 Flt_acow int32 Flt_obj int32 Flt_prcopy int32 Flt_przero int32 Pdwoke int32 Pdrevs int32 Pdswout int32 Pdfreed int32 Pdscans int32 Pdanscan int32 Pdobscan int32 Pdreact int32 Pdbusy int32 Pdpageouts int32 Pdpending int32 Pddeact int32 Unused11 int32 Unused12 int32 Unused13 int32 Fpswtch int32 Kmapent int32 } const SizeofClockinfo = 0x10 type Clockinfo struct { Hz int32 Tick int32 Stathz int32 Profhz int32 } ================================================ FILE: vendor/golang.org/x/sys/unix/ztypes_openbsd_mips64.go ================================================ // cgo -godefs -- -fsigned-char types_openbsd.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build mips64 && openbsd package unix const ( SizeofPtr = 0x8 SizeofShort = 0x2 SizeofInt = 0x4 SizeofLong = 0x8 SizeofLongLong = 0x8 ) type ( _C_short int16 _C_int int32 _C_long int64 _C_long_long int64 ) type Timespec struct { Sec int64 Nsec int64 } type Timeval struct { Sec int64 Usec int64 } type Rusage struct { Utime Timeval Stime Timeval Maxrss int64 Ixrss int64 Idrss int64 Isrss int64 Minflt int64 Majflt int64 Nswap int64 Inblock int64 Oublock int64 Msgsnd int64 Msgrcv int64 Nsignals int64 Nvcsw int64 Nivcsw int64 } type Rlimit struct { Cur uint64 Max uint64 } type _Gid_t uint32 type Stat_t struct { Mode uint32 Dev int32 Ino uint64 Nlink uint32 Uid uint32 Gid uint32 Rdev int32 Atim Timespec Mtim Timespec Ctim Timespec Size int64 Blocks int64 Blksize int32 Flags uint32 Gen uint32 _ Timespec } type Statfs_t struct { F_flags uint32 F_bsize uint32 F_iosize uint32 F_blocks uint64 F_bfree uint64 F_bavail int64 F_files uint64 F_ffree uint64 F_favail int64 F_syncwrites uint64 F_syncreads uint64 F_asyncwrites uint64 F_asyncreads uint64 F_fsid Fsid F_namemax uint32 F_owner uint32 F_ctime uint64 F_fstypename [16]byte F_mntonname [90]byte F_mntfromname [90]byte F_mntfromspec [90]byte _ [2]byte Mount_info [160]byte } type Flock_t struct { Start int64 Len int64 Pid int32 Type int16 Whence int16 } type Dirent struct { Fileno uint64 Off int64 Reclen uint16 Type uint8 Namlen uint8 _ [4]uint8 Name [256]int8 } type Fsid struct { Val [2]int32 } const ( PathMax = 0x400 ) type RawSockaddrInet4 struct { Len uint8 Family uint8 Port uint16 Addr [4]byte /* in_addr */ Zero [8]int8 } type RawSockaddrInet6 struct { Len uint8 Family uint8 Port uint16 Flowinfo uint32 Addr [16]byte /* in6_addr */ Scope_id uint32 } type RawSockaddrUnix struct { Len uint8 Family uint8 Path [104]int8 } type RawSockaddrDatalink struct { Len uint8 Family uint8 Index uint16 Type uint8 Nlen uint8 Alen uint8 Slen uint8 Data [24]int8 } type RawSockaddr struct { Len uint8 Family uint8 Data [14]int8 } type RawSockaddrAny struct { Addr RawSockaddr Pad [92]int8 } type _Socklen uint32 type Linger struct { Onoff int32 Linger int32 } type Iovec struct { Base *byte Len uint64 } type IPMreq struct { Multiaddr [4]byte /* in_addr */ Interface [4]byte /* in_addr */ } type IPv6Mreq struct { Multiaddr [16]byte /* in6_addr */ Interface uint32 } type Msghdr struct { Name *byte Namelen uint32 Iov *Iovec Iovlen uint32 Control *byte Controllen uint32 Flags int32 } type Cmsghdr struct { Len uint32 Level int32 Type int32 } type Inet6Pktinfo struct { Addr [16]byte /* in6_addr */ Ifindex uint32 } type IPv6MTUInfo struct { Addr RawSockaddrInet6 Mtu uint32 } type ICMPv6Filter struct { Filt [8]uint32 } const ( SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet6 = 0x1c SizeofSockaddrAny = 0x6c SizeofSockaddrUnix = 0x6a SizeofSockaddrDatalink = 0x20 SizeofLinger = 0x8 SizeofIovec = 0x10 SizeofIPMreq = 0x8 SizeofIPv6Mreq = 0x14 SizeofMsghdr = 0x30 SizeofCmsghdr = 0xc SizeofInet6Pktinfo = 0x14 SizeofIPv6MTUInfo = 0x20 SizeofICMPv6Filter = 0x20 ) const ( PTRACE_TRACEME = 0x0 PTRACE_CONT = 0x7 PTRACE_KILL = 0x8 ) type Kevent_t struct { Ident uint64 Filter int16 Flags uint16 Fflags uint32 Data int64 Udata *byte } type FdSet struct { Bits [32]uint32 } const ( SizeofIfMsghdr = 0xa8 SizeofIfData = 0x90 SizeofIfaMsghdr = 0x18 SizeofIfAnnounceMsghdr = 0x1a SizeofRtMsghdr = 0x60 SizeofRtMetrics = 0x38 ) type IfMsghdr struct { Msglen uint16 Version uint8 Type uint8 Hdrlen uint16 Index uint16 Tableid uint16 Pad1 uint8 Pad2 uint8 Addrs int32 Flags int32 Xflags int32 Data IfData } type IfData struct { Type uint8 Addrlen uint8 Hdrlen uint8 Link_state uint8 Mtu uint32 Metric uint32 Rdomain uint32 Baudrate uint64 Ipackets uint64 Ierrors uint64 Opackets uint64 Oerrors uint64 Collisions uint64 Ibytes uint64 Obytes uint64 Imcasts uint64 Omcasts uint64 Iqdrops uint64 Oqdrops uint64 Noproto uint64 Capabilities uint32 Lastchange Timeval } type IfaMsghdr struct { Msglen uint16 Version uint8 Type uint8 Hdrlen uint16 Index uint16 Tableid uint16 Pad1 uint8 Pad2 uint8 Addrs int32 Flags int32 Metric int32 } type IfAnnounceMsghdr struct { Msglen uint16 Version uint8 Type uint8 Hdrlen uint16 Index uint16 What uint16 Name [16]int8 } type RtMsghdr struct { Msglen uint16 Version uint8 Type uint8 Hdrlen uint16 Index uint16 Tableid uint16 Priority uint8 Mpls uint8 Addrs int32 Flags int32 Fmask int32 Pid int32 Seq int32 Errno int32 Inits uint32 Rmx RtMetrics } type RtMetrics struct { Pksent uint64 Expire int64 Locks uint32 Mtu uint32 Refcnt uint32 Hopcount uint32 Recvpipe uint32 Sendpipe uint32 Ssthresh uint32 Rtt uint32 Rttvar uint32 Pad uint32 } const ( SizeofBpfVersion = 0x4 SizeofBpfStat = 0x8 SizeofBpfProgram = 0x10 SizeofBpfInsn = 0x8 SizeofBpfHdr = 0x18 ) type BpfVersion struct { Major uint16 Minor uint16 } type BpfStat struct { Recv uint32 Drop uint32 } type BpfProgram struct { Len uint32 Insns *BpfInsn } type BpfInsn struct { Code uint16 Jt uint8 Jf uint8 K uint32 } type BpfHdr struct { Tstamp BpfTimeval Caplen uint32 Datalen uint32 Hdrlen uint16 Ifidx uint16 Flowid uint16 Flags uint8 Drops uint8 } type BpfTimeval struct { Sec uint32 Usec uint32 } type Termios struct { Iflag uint32 Oflag uint32 Cflag uint32 Lflag uint32 Cc [20]uint8 Ispeed int32 Ospeed int32 } type Winsize struct { Row uint16 Col uint16 Xpixel uint16 Ypixel uint16 } const ( AT_FDCWD = -0x64 AT_EACCESS = 0x1 AT_SYMLINK_NOFOLLOW = 0x2 AT_SYMLINK_FOLLOW = 0x4 AT_REMOVEDIR = 0x8 ) type PollFd struct { Fd int32 Events int16 Revents int16 } const ( POLLERR = 0x8 POLLHUP = 0x10 POLLIN = 0x1 POLLNVAL = 0x20 POLLOUT = 0x4 POLLPRI = 0x2 POLLRDBAND = 0x80 POLLRDNORM = 0x40 POLLWRBAND = 0x100 POLLWRNORM = 0x4 ) type Sigset_t uint32 type Utsname struct { Sysname [256]byte Nodename [256]byte Release [256]byte Version [256]byte Machine [256]byte } const SizeofUvmexp = 0x158 type Uvmexp struct { Pagesize int32 Pagemask int32 Pageshift int32 Npages int32 Free int32 Active int32 Inactive int32 Paging int32 Wired int32 Zeropages int32 Reserve_pagedaemon int32 Reserve_kernel int32 Unused01 int32 Vnodepages int32 Vtextpages int32 Freemin int32 Freetarg int32 Inactarg int32 Wiredmax int32 Anonmin int32 Vtextmin int32 Vnodemin int32 Anonminpct int32 Vtextminpct int32 Vnodeminpct int32 Nswapdev int32 Swpages int32 Swpginuse int32 Swpgonly int32 Nswget int32 Nanon int32 Unused05 int32 Unused06 int32 Faults int32 Traps int32 Intrs int32 Swtch int32 Softs int32 Syscalls int32 Pageins int32 Unused07 int32 Unused08 int32 Pgswapin int32 Pgswapout int32 Forks int32 Forks_ppwait int32 Forks_sharevm int32 Pga_zerohit int32 Pga_zeromiss int32 Unused09 int32 Fltnoram int32 Fltnoanon int32 Fltnoamap int32 Fltpgwait int32 Fltpgrele int32 Fltrelck int32 Fltrelckok int32 Fltanget int32 Fltanretry int32 Fltamcopy int32 Fltnamap int32 Fltnomap int32 Fltlget int32 Fltget int32 Flt_anon int32 Flt_acow int32 Flt_obj int32 Flt_prcopy int32 Flt_przero int32 Pdwoke int32 Pdrevs int32 Pdswout int32 Pdfreed int32 Pdscans int32 Pdanscan int32 Pdobscan int32 Pdreact int32 Pdbusy int32 Pdpageouts int32 Pdpending int32 Pddeact int32 Unused11 int32 Unused12 int32 Unused13 int32 Fpswtch int32 Kmapent int32 } const SizeofClockinfo = 0x10 type Clockinfo struct { Hz int32 Tick int32 Stathz int32 Profhz int32 } ================================================ FILE: vendor/golang.org/x/sys/unix/ztypes_openbsd_ppc64.go ================================================ // cgo -godefs -- -fsigned-char types_openbsd.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build ppc64 && openbsd package unix const ( SizeofPtr = 0x8 SizeofShort = 0x2 SizeofInt = 0x4 SizeofLong = 0x8 SizeofLongLong = 0x8 ) type ( _C_short int16 _C_int int32 _C_long int64 _C_long_long int64 ) type Timespec struct { Sec int64 Nsec int64 } type Timeval struct { Sec int64 Usec int64 } type Rusage struct { Utime Timeval Stime Timeval Maxrss int64 Ixrss int64 Idrss int64 Isrss int64 Minflt int64 Majflt int64 Nswap int64 Inblock int64 Oublock int64 Msgsnd int64 Msgrcv int64 Nsignals int64 Nvcsw int64 Nivcsw int64 } type Rlimit struct { Cur uint64 Max uint64 } type _Gid_t uint32 type Stat_t struct { Mode uint32 Dev int32 Ino uint64 Nlink uint32 Uid uint32 Gid uint32 Rdev int32 Atim Timespec Mtim Timespec Ctim Timespec Size int64 Blocks int64 Blksize int32 Flags uint32 Gen uint32 _ Timespec } type Statfs_t struct { F_flags uint32 F_bsize uint32 F_iosize uint32 F_blocks uint64 F_bfree uint64 F_bavail int64 F_files uint64 F_ffree uint64 F_favail int64 F_syncwrites uint64 F_syncreads uint64 F_asyncwrites uint64 F_asyncreads uint64 F_fsid Fsid F_namemax uint32 F_owner uint32 F_ctime uint64 F_fstypename [16]byte F_mntonname [90]byte F_mntfromname [90]byte F_mntfromspec [90]byte _ [2]byte Mount_info [160]byte } type Flock_t struct { Start int64 Len int64 Pid int32 Type int16 Whence int16 } type Dirent struct { Fileno uint64 Off int64 Reclen uint16 Type uint8 Namlen uint8 _ [4]uint8 Name [256]int8 } type Fsid struct { Val [2]int32 } const ( PathMax = 0x400 ) type RawSockaddrInet4 struct { Len uint8 Family uint8 Port uint16 Addr [4]byte /* in_addr */ Zero [8]int8 } type RawSockaddrInet6 struct { Len uint8 Family uint8 Port uint16 Flowinfo uint32 Addr [16]byte /* in6_addr */ Scope_id uint32 } type RawSockaddrUnix struct { Len uint8 Family uint8 Path [104]int8 } type RawSockaddrDatalink struct { Len uint8 Family uint8 Index uint16 Type uint8 Nlen uint8 Alen uint8 Slen uint8 Data [24]int8 } type RawSockaddr struct { Len uint8 Family uint8 Data [14]int8 } type RawSockaddrAny struct { Addr RawSockaddr Pad [92]int8 } type _Socklen uint32 type Linger struct { Onoff int32 Linger int32 } type Iovec struct { Base *byte Len uint64 } type IPMreq struct { Multiaddr [4]byte /* in_addr */ Interface [4]byte /* in_addr */ } type IPv6Mreq struct { Multiaddr [16]byte /* in6_addr */ Interface uint32 } type Msghdr struct { Name *byte Namelen uint32 Iov *Iovec Iovlen uint32 Control *byte Controllen uint32 Flags int32 } type Cmsghdr struct { Len uint32 Level int32 Type int32 } type Inet6Pktinfo struct { Addr [16]byte /* in6_addr */ Ifindex uint32 } type IPv6MTUInfo struct { Addr RawSockaddrInet6 Mtu uint32 } type ICMPv6Filter struct { Filt [8]uint32 } const ( SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet6 = 0x1c SizeofSockaddrAny = 0x6c SizeofSockaddrUnix = 0x6a SizeofSockaddrDatalink = 0x20 SizeofLinger = 0x8 SizeofIovec = 0x10 SizeofIPMreq = 0x8 SizeofIPv6Mreq = 0x14 SizeofMsghdr = 0x30 SizeofCmsghdr = 0xc SizeofInet6Pktinfo = 0x14 SizeofIPv6MTUInfo = 0x20 SizeofICMPv6Filter = 0x20 ) const ( PTRACE_TRACEME = 0x0 PTRACE_CONT = 0x7 PTRACE_KILL = 0x8 ) type Kevent_t struct { Ident uint64 Filter int16 Flags uint16 Fflags uint32 Data int64 Udata *byte } type FdSet struct { Bits [32]uint32 } const ( SizeofIfMsghdr = 0xa8 SizeofIfData = 0x90 SizeofIfaMsghdr = 0x18 SizeofIfAnnounceMsghdr = 0x1a SizeofRtMsghdr = 0x60 SizeofRtMetrics = 0x38 ) type IfMsghdr struct { Msglen uint16 Version uint8 Type uint8 Hdrlen uint16 Index uint16 Tableid uint16 Pad1 uint8 Pad2 uint8 Addrs int32 Flags int32 Xflags int32 Data IfData } type IfData struct { Type uint8 Addrlen uint8 Hdrlen uint8 Link_state uint8 Mtu uint32 Metric uint32 Rdomain uint32 Baudrate uint64 Ipackets uint64 Ierrors uint64 Opackets uint64 Oerrors uint64 Collisions uint64 Ibytes uint64 Obytes uint64 Imcasts uint64 Omcasts uint64 Iqdrops uint64 Oqdrops uint64 Noproto uint64 Capabilities uint32 Lastchange Timeval } type IfaMsghdr struct { Msglen uint16 Version uint8 Type uint8 Hdrlen uint16 Index uint16 Tableid uint16 Pad1 uint8 Pad2 uint8 Addrs int32 Flags int32 Metric int32 } type IfAnnounceMsghdr struct { Msglen uint16 Version uint8 Type uint8 Hdrlen uint16 Index uint16 What uint16 Name [16]int8 } type RtMsghdr struct { Msglen uint16 Version uint8 Type uint8 Hdrlen uint16 Index uint16 Tableid uint16 Priority uint8 Mpls uint8 Addrs int32 Flags int32 Fmask int32 Pid int32 Seq int32 Errno int32 Inits uint32 Rmx RtMetrics } type RtMetrics struct { Pksent uint64 Expire int64 Locks uint32 Mtu uint32 Refcnt uint32 Hopcount uint32 Recvpipe uint32 Sendpipe uint32 Ssthresh uint32 Rtt uint32 Rttvar uint32 Pad uint32 } type Mclpool struct{} const ( SizeofBpfVersion = 0x4 SizeofBpfStat = 0x8 SizeofBpfProgram = 0x10 SizeofBpfInsn = 0x8 SizeofBpfHdr = 0x18 ) type BpfVersion struct { Major uint16 Minor uint16 } type BpfStat struct { Recv uint32 Drop uint32 } type BpfProgram struct { Len uint32 Insns *BpfInsn } type BpfInsn struct { Code uint16 Jt uint8 Jf uint8 K uint32 } type BpfHdr struct { Tstamp BpfTimeval Caplen uint32 Datalen uint32 Hdrlen uint16 Ifidx uint16 Flowid uint16 Flags uint8 Drops uint8 } type BpfTimeval struct { Sec uint32 Usec uint32 } type Termios struct { Iflag uint32 Oflag uint32 Cflag uint32 Lflag uint32 Cc [20]uint8 Ispeed int32 Ospeed int32 } type Winsize struct { Row uint16 Col uint16 Xpixel uint16 Ypixel uint16 } const ( AT_FDCWD = -0x64 AT_EACCESS = 0x1 AT_SYMLINK_NOFOLLOW = 0x2 AT_SYMLINK_FOLLOW = 0x4 AT_REMOVEDIR = 0x8 ) type PollFd struct { Fd int32 Events int16 Revents int16 } const ( POLLERR = 0x8 POLLHUP = 0x10 POLLIN = 0x1 POLLNVAL = 0x20 POLLOUT = 0x4 POLLPRI = 0x2 POLLRDBAND = 0x80 POLLRDNORM = 0x40 POLLWRBAND = 0x100 POLLWRNORM = 0x4 ) type Sigset_t uint32 type Utsname struct { Sysname [256]byte Nodename [256]byte Release [256]byte Version [256]byte Machine [256]byte } const SizeofUvmexp = 0x158 type Uvmexp struct { Pagesize int32 Pagemask int32 Pageshift int32 Npages int32 Free int32 Active int32 Inactive int32 Paging int32 Wired int32 Zeropages int32 Reserve_pagedaemon int32 Reserve_kernel int32 Unused01 int32 Vnodepages int32 Vtextpages int32 Freemin int32 Freetarg int32 Inactarg int32 Wiredmax int32 Anonmin int32 Vtextmin int32 Vnodemin int32 Anonminpct int32 Vtextminpct int32 Vnodeminpct int32 Nswapdev int32 Swpages int32 Swpginuse int32 Swpgonly int32 Nswget int32 Nanon int32 Unused05 int32 Unused06 int32 Faults int32 Traps int32 Intrs int32 Swtch int32 Softs int32 Syscalls int32 Pageins int32 Unused07 int32 Unused08 int32 Pgswapin int32 Pgswapout int32 Forks int32 Forks_ppwait int32 Forks_sharevm int32 Pga_zerohit int32 Pga_zeromiss int32 Unused09 int32 Fltnoram int32 Fltnoanon int32 Fltnoamap int32 Fltpgwait int32 Fltpgrele int32 Fltrelck int32 Fltrelckok int32 Fltanget int32 Fltanretry int32 Fltamcopy int32 Fltnamap int32 Fltnomap int32 Fltlget int32 Fltget int32 Flt_anon int32 Flt_acow int32 Flt_obj int32 Flt_prcopy int32 Flt_przero int32 Pdwoke int32 Pdrevs int32 Pdswout int32 Pdfreed int32 Pdscans int32 Pdanscan int32 Pdobscan int32 Pdreact int32 Pdbusy int32 Pdpageouts int32 Pdpending int32 Pddeact int32 Unused11 int32 Unused12 int32 Unused13 int32 Fpswtch int32 Kmapent int32 } const SizeofClockinfo = 0x10 type Clockinfo struct { Hz int32 Tick int32 Stathz int32 Profhz int32 } ================================================ FILE: vendor/golang.org/x/sys/unix/ztypes_openbsd_riscv64.go ================================================ // cgo -godefs -- -fsigned-char types_openbsd.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build riscv64 && openbsd package unix const ( SizeofPtr = 0x8 SizeofShort = 0x2 SizeofInt = 0x4 SizeofLong = 0x8 SizeofLongLong = 0x8 ) type ( _C_short int16 _C_int int32 _C_long int64 _C_long_long int64 ) type Timespec struct { Sec int64 Nsec int64 } type Timeval struct { Sec int64 Usec int64 } type Rusage struct { Utime Timeval Stime Timeval Maxrss int64 Ixrss int64 Idrss int64 Isrss int64 Minflt int64 Majflt int64 Nswap int64 Inblock int64 Oublock int64 Msgsnd int64 Msgrcv int64 Nsignals int64 Nvcsw int64 Nivcsw int64 } type Rlimit struct { Cur uint64 Max uint64 } type _Gid_t uint32 type Stat_t struct { Mode uint32 Dev int32 Ino uint64 Nlink uint32 Uid uint32 Gid uint32 Rdev int32 Atim Timespec Mtim Timespec Ctim Timespec Size int64 Blocks int64 Blksize int32 Flags uint32 Gen uint32 _ Timespec } type Statfs_t struct { F_flags uint32 F_bsize uint32 F_iosize uint32 F_blocks uint64 F_bfree uint64 F_bavail int64 F_files uint64 F_ffree uint64 F_favail int64 F_syncwrites uint64 F_syncreads uint64 F_asyncwrites uint64 F_asyncreads uint64 F_fsid Fsid F_namemax uint32 F_owner uint32 F_ctime uint64 F_fstypename [16]byte F_mntonname [90]byte F_mntfromname [90]byte F_mntfromspec [90]byte _ [2]byte Mount_info [160]byte } type Flock_t struct { Start int64 Len int64 Pid int32 Type int16 Whence int16 } type Dirent struct { Fileno uint64 Off int64 Reclen uint16 Type uint8 Namlen uint8 _ [4]uint8 Name [256]int8 } type Fsid struct { Val [2]int32 } const ( PathMax = 0x400 ) type RawSockaddrInet4 struct { Len uint8 Family uint8 Port uint16 Addr [4]byte /* in_addr */ Zero [8]int8 } type RawSockaddrInet6 struct { Len uint8 Family uint8 Port uint16 Flowinfo uint32 Addr [16]byte /* in6_addr */ Scope_id uint32 } type RawSockaddrUnix struct { Len uint8 Family uint8 Path [104]int8 } type RawSockaddrDatalink struct { Len uint8 Family uint8 Index uint16 Type uint8 Nlen uint8 Alen uint8 Slen uint8 Data [24]int8 } type RawSockaddr struct { Len uint8 Family uint8 Data [14]int8 } type RawSockaddrAny struct { Addr RawSockaddr Pad [92]int8 } type _Socklen uint32 type Linger struct { Onoff int32 Linger int32 } type Iovec struct { Base *byte Len uint64 } type IPMreq struct { Multiaddr [4]byte /* in_addr */ Interface [4]byte /* in_addr */ } type IPv6Mreq struct { Multiaddr [16]byte /* in6_addr */ Interface uint32 } type Msghdr struct { Name *byte Namelen uint32 Iov *Iovec Iovlen uint32 Control *byte Controllen uint32 Flags int32 } type Cmsghdr struct { Len uint32 Level int32 Type int32 } type Inet6Pktinfo struct { Addr [16]byte /* in6_addr */ Ifindex uint32 } type IPv6MTUInfo struct { Addr RawSockaddrInet6 Mtu uint32 } type ICMPv6Filter struct { Filt [8]uint32 } const ( SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet6 = 0x1c SizeofSockaddrAny = 0x6c SizeofSockaddrUnix = 0x6a SizeofSockaddrDatalink = 0x20 SizeofLinger = 0x8 SizeofIovec = 0x10 SizeofIPMreq = 0x8 SizeofIPv6Mreq = 0x14 SizeofMsghdr = 0x30 SizeofCmsghdr = 0xc SizeofInet6Pktinfo = 0x14 SizeofIPv6MTUInfo = 0x20 SizeofICMPv6Filter = 0x20 ) const ( PTRACE_TRACEME = 0x0 PTRACE_CONT = 0x7 PTRACE_KILL = 0x8 ) type Kevent_t struct { Ident uint64 Filter int16 Flags uint16 Fflags uint32 Data int64 Udata *byte } type FdSet struct { Bits [32]uint32 } const ( SizeofIfMsghdr = 0xa8 SizeofIfData = 0x90 SizeofIfaMsghdr = 0x18 SizeofIfAnnounceMsghdr = 0x1a SizeofRtMsghdr = 0x60 SizeofRtMetrics = 0x38 ) type IfMsghdr struct { Msglen uint16 Version uint8 Type uint8 Hdrlen uint16 Index uint16 Tableid uint16 Pad1 uint8 Pad2 uint8 Addrs int32 Flags int32 Xflags int32 Data IfData } type IfData struct { Type uint8 Addrlen uint8 Hdrlen uint8 Link_state uint8 Mtu uint32 Metric uint32 Rdomain uint32 Baudrate uint64 Ipackets uint64 Ierrors uint64 Opackets uint64 Oerrors uint64 Collisions uint64 Ibytes uint64 Obytes uint64 Imcasts uint64 Omcasts uint64 Iqdrops uint64 Oqdrops uint64 Noproto uint64 Capabilities uint32 Lastchange Timeval } type IfaMsghdr struct { Msglen uint16 Version uint8 Type uint8 Hdrlen uint16 Index uint16 Tableid uint16 Pad1 uint8 Pad2 uint8 Addrs int32 Flags int32 Metric int32 } type IfAnnounceMsghdr struct { Msglen uint16 Version uint8 Type uint8 Hdrlen uint16 Index uint16 What uint16 Name [16]int8 } type RtMsghdr struct { Msglen uint16 Version uint8 Type uint8 Hdrlen uint16 Index uint16 Tableid uint16 Priority uint8 Mpls uint8 Addrs int32 Flags int32 Fmask int32 Pid int32 Seq int32 Errno int32 Inits uint32 Rmx RtMetrics } type RtMetrics struct { Pksent uint64 Expire int64 Locks uint32 Mtu uint32 Refcnt uint32 Hopcount uint32 Recvpipe uint32 Sendpipe uint32 Ssthresh uint32 Rtt uint32 Rttvar uint32 Pad uint32 } type Mclpool struct{} const ( SizeofBpfVersion = 0x4 SizeofBpfStat = 0x8 SizeofBpfProgram = 0x10 SizeofBpfInsn = 0x8 SizeofBpfHdr = 0x18 ) type BpfVersion struct { Major uint16 Minor uint16 } type BpfStat struct { Recv uint32 Drop uint32 } type BpfProgram struct { Len uint32 Insns *BpfInsn } type BpfInsn struct { Code uint16 Jt uint8 Jf uint8 K uint32 } type BpfHdr struct { Tstamp BpfTimeval Caplen uint32 Datalen uint32 Hdrlen uint16 Ifidx uint16 Flowid uint16 Flags uint8 Drops uint8 } type BpfTimeval struct { Sec uint32 Usec uint32 } type Termios struct { Iflag uint32 Oflag uint32 Cflag uint32 Lflag uint32 Cc [20]uint8 Ispeed int32 Ospeed int32 } type Winsize struct { Row uint16 Col uint16 Xpixel uint16 Ypixel uint16 } const ( AT_FDCWD = -0x64 AT_EACCESS = 0x1 AT_SYMLINK_NOFOLLOW = 0x2 AT_SYMLINK_FOLLOW = 0x4 AT_REMOVEDIR = 0x8 ) type PollFd struct { Fd int32 Events int16 Revents int16 } const ( POLLERR = 0x8 POLLHUP = 0x10 POLLIN = 0x1 POLLNVAL = 0x20 POLLOUT = 0x4 POLLPRI = 0x2 POLLRDBAND = 0x80 POLLRDNORM = 0x40 POLLWRBAND = 0x100 POLLWRNORM = 0x4 ) type Sigset_t uint32 type Utsname struct { Sysname [256]byte Nodename [256]byte Release [256]byte Version [256]byte Machine [256]byte } const SizeofUvmexp = 0x158 type Uvmexp struct { Pagesize int32 Pagemask int32 Pageshift int32 Npages int32 Free int32 Active int32 Inactive int32 Paging int32 Wired int32 Zeropages int32 Reserve_pagedaemon int32 Reserve_kernel int32 Unused01 int32 Vnodepages int32 Vtextpages int32 Freemin int32 Freetarg int32 Inactarg int32 Wiredmax int32 Anonmin int32 Vtextmin int32 Vnodemin int32 Anonminpct int32 Vtextminpct int32 Vnodeminpct int32 Nswapdev int32 Swpages int32 Swpginuse int32 Swpgonly int32 Nswget int32 Nanon int32 Unused05 int32 Unused06 int32 Faults int32 Traps int32 Intrs int32 Swtch int32 Softs int32 Syscalls int32 Pageins int32 Unused07 int32 Unused08 int32 Pgswapin int32 Pgswapout int32 Forks int32 Forks_ppwait int32 Forks_sharevm int32 Pga_zerohit int32 Pga_zeromiss int32 Unused09 int32 Fltnoram int32 Fltnoanon int32 Fltnoamap int32 Fltpgwait int32 Fltpgrele int32 Fltrelck int32 Fltrelckok int32 Fltanget int32 Fltanretry int32 Fltamcopy int32 Fltnamap int32 Fltnomap int32 Fltlget int32 Fltget int32 Flt_anon int32 Flt_acow int32 Flt_obj int32 Flt_prcopy int32 Flt_przero int32 Pdwoke int32 Pdrevs int32 Pdswout int32 Pdfreed int32 Pdscans int32 Pdanscan int32 Pdobscan int32 Pdreact int32 Pdbusy int32 Pdpageouts int32 Pdpending int32 Pddeact int32 Unused11 int32 Unused12 int32 Unused13 int32 Fpswtch int32 Kmapent int32 } const SizeofClockinfo = 0x10 type Clockinfo struct { Hz int32 Tick int32 Stathz int32 Profhz int32 } ================================================ FILE: vendor/golang.org/x/sys/unix/ztypes_solaris_amd64.go ================================================ // cgo -godefs types_solaris.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build amd64 && solaris package unix const ( SizeofPtr = 0x8 SizeofShort = 0x2 SizeofInt = 0x4 SizeofLong = 0x8 SizeofLongLong = 0x8 PathMax = 0x400 MaxHostNameLen = 0x100 ) type ( _C_short int16 _C_int int32 _C_long int64 _C_long_long int64 ) type Timespec struct { Sec int64 Nsec int64 } type Timeval struct { Sec int64 Usec int64 } type Timeval32 struct { Sec int32 Usec int32 } type Tms struct { Utime int64 Stime int64 Cutime int64 Cstime int64 } type Utimbuf struct { Actime int64 Modtime int64 } type Rusage struct { Utime Timeval Stime Timeval Maxrss int64 Ixrss int64 Idrss int64 Isrss int64 Minflt int64 Majflt int64 Nswap int64 Inblock int64 Oublock int64 Msgsnd int64 Msgrcv int64 Nsignals int64 Nvcsw int64 Nivcsw int64 } type Rlimit struct { Cur uint64 Max uint64 } type _Gid_t uint32 type Stat_t struct { Dev uint64 Ino uint64 Mode uint32 Nlink uint32 Uid uint32 Gid uint32 Rdev uint64 Size int64 Atim Timespec Mtim Timespec Ctim Timespec Blksize int32 Blocks int64 Fstype [16]int8 } type Flock_t struct { Type int16 Whence int16 Start int64 Len int64 Sysid int32 Pid int32 Pad [4]int64 } type Dirent struct { Ino uint64 Off int64 Reclen uint16 Name [1]int8 _ [5]byte } type _Fsblkcnt_t uint64 type Statvfs_t struct { Bsize uint64 Frsize uint64 Blocks uint64 Bfree uint64 Bavail uint64 Files uint64 Ffree uint64 Favail uint64 Fsid uint64 Basetype [16]int8 Flag uint64 Namemax uint64 Fstr [32]int8 } type RawSockaddrInet4 struct { Family uint16 Port uint16 Addr [4]byte /* in_addr */ Zero [8]int8 } type RawSockaddrInet6 struct { Family uint16 Port uint16 Flowinfo uint32 Addr [16]byte /* in6_addr */ Scope_id uint32 _ uint32 } type RawSockaddrUnix struct { Family uint16 Path [108]int8 } type RawSockaddrDatalink struct { Family uint16 Index uint16 Type uint8 Nlen uint8 Alen uint8 Slen uint8 Data [244]int8 } type RawSockaddr struct { Family uint16 Data [14]int8 } type RawSockaddrAny struct { Addr RawSockaddr Pad [236]int8 } type _Socklen uint32 type Linger struct { Onoff int32 Linger int32 } type Iovec struct { Base *byte Len uint64 } type IPMreq struct { Multiaddr [4]byte /* in_addr */ Interface [4]byte /* in_addr */ } type IPv6Mreq struct { Multiaddr [16]byte /* in6_addr */ Interface uint32 } type Msghdr struct { Name *byte Namelen uint32 Iov *Iovec Iovlen int32 Accrights *int8 Accrightslen int32 _ [4]byte } type Cmsghdr struct { Len uint32 Level int32 Type int32 } type Inet4Pktinfo struct { Ifindex uint32 Spec_dst [4]byte /* in_addr */ Addr [4]byte /* in_addr */ } type Inet6Pktinfo struct { Addr [16]byte /* in6_addr */ Ifindex uint32 } type IPv6MTUInfo struct { Addr RawSockaddrInet6 Mtu uint32 } type ICMPv6Filter struct { Filt [8]uint32 } const ( SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet6 = 0x20 SizeofSockaddrAny = 0xfc SizeofSockaddrUnix = 0x6e SizeofSockaddrDatalink = 0xfc SizeofLinger = 0x8 SizeofIovec = 0x10 SizeofIPMreq = 0x8 SizeofIPv6Mreq = 0x14 SizeofMsghdr = 0x30 SizeofCmsghdr = 0xc SizeofInet4Pktinfo = 0xc SizeofInet6Pktinfo = 0x14 SizeofIPv6MTUInfo = 0x24 SizeofICMPv6Filter = 0x20 ) type FdSet struct { Bits [1024]int64 } type Utsname struct { Sysname [257]byte Nodename [257]byte Release [257]byte Version [257]byte Machine [257]byte } type Ustat_t struct { Tfree int64 Tinode uint64 Fname [6]int8 Fpack [6]int8 _ [4]byte } const ( AT_FDCWD = 0xffd19553 AT_SYMLINK_NOFOLLOW = 0x1000 AT_SYMLINK_FOLLOW = 0x2000 AT_REMOVEDIR = 0x1 AT_EACCESS = 0x4 ) const ( SizeofIfMsghdr = 0x54 SizeofIfData = 0x44 SizeofIfaMsghdr = 0x14 SizeofRtMsghdr = 0x4c SizeofRtMetrics = 0x28 ) type IfMsghdr struct { Msglen uint16 Version uint8 Type uint8 Addrs int32 Flags int32 Index uint16 Data IfData } type IfData struct { Type uint8 Addrlen uint8 Hdrlen uint8 Mtu uint32 Metric uint32 Baudrate uint32 Ipackets uint32 Ierrors uint32 Opackets uint32 Oerrors uint32 Collisions uint32 Ibytes uint32 Obytes uint32 Imcasts uint32 Omcasts uint32 Iqdrops uint32 Noproto uint32 Lastchange Timeval32 } type IfaMsghdr struct { Msglen uint16 Version uint8 Type uint8 Addrs int32 Flags int32 Index uint16 Metric int32 } type RtMsghdr struct { Msglen uint16 Version uint8 Type uint8 Index uint16 Flags int32 Addrs int32 Pid int32 Seq int32 Errno int32 Use int32 Inits uint32 Rmx RtMetrics } type RtMetrics struct { Locks uint32 Mtu uint32 Hopcount uint32 Expire uint32 Recvpipe uint32 Sendpipe uint32 Ssthresh uint32 Rtt uint32 Rttvar uint32 Pksent uint32 } const ( SizeofBpfVersion = 0x4 SizeofBpfStat = 0x80 SizeofBpfProgram = 0x10 SizeofBpfInsn = 0x8 SizeofBpfHdr = 0x14 ) type BpfVersion struct { Major uint16 Minor uint16 } type BpfStat struct { Recv uint64 Drop uint64 Capt uint64 _ [13]uint64 } type BpfProgram struct { Len uint32 Insns *BpfInsn } type BpfInsn struct { Code uint16 Jt uint8 Jf uint8 K uint32 } type BpfTimeval struct { Sec int32 Usec int32 } type BpfHdr struct { Tstamp BpfTimeval Caplen uint32 Datalen uint32 Hdrlen uint16 _ [2]byte } type Termios struct { Iflag uint32 Oflag uint32 Cflag uint32 Lflag uint32 Cc [19]uint8 _ [1]byte } type Termio struct { Iflag uint16 Oflag uint16 Cflag uint16 Lflag uint16 Line int8 Cc [8]uint8 _ [1]byte } type Winsize struct { Row uint16 Col uint16 Xpixel uint16 Ypixel uint16 } type PollFd struct { Fd int32 Events int16 Revents int16 } const ( POLLERR = 0x8 POLLHUP = 0x10 POLLIN = 0x1 POLLNVAL = 0x20 POLLOUT = 0x4 POLLPRI = 0x2 POLLRDBAND = 0x80 POLLRDNORM = 0x40 POLLWRBAND = 0x100 POLLWRNORM = 0x4 ) type fileObj struct { Atim Timespec Mtim Timespec Ctim Timespec Pad [3]uint64 Name *int8 } type portEvent struct { Events int32 Source uint16 Pad uint16 Object uint64 User *byte } const ( PORT_SOURCE_AIO = 0x1 PORT_SOURCE_TIMER = 0x2 PORT_SOURCE_USER = 0x3 PORT_SOURCE_FD = 0x4 PORT_SOURCE_ALERT = 0x5 PORT_SOURCE_MQ = 0x6 PORT_SOURCE_FILE = 0x7 PORT_ALERT_SET = 0x1 PORT_ALERT_UPDATE = 0x2 PORT_ALERT_INVALID = 0x3 FILE_ACCESS = 0x1 FILE_MODIFIED = 0x2 FILE_ATTRIB = 0x4 FILE_TRUNC = 0x100000 FILE_NOFOLLOW = 0x10000000 FILE_DELETE = 0x10 FILE_RENAME_TO = 0x20 FILE_RENAME_FROM = 0x40 UNMOUNTED = 0x20000000 MOUNTEDOVER = 0x40000000 FILE_EXCEPTION = 0x60000070 ) const ( TUNNEWPPA = 0x540001 TUNSETPPA = 0x540002 I_STR = 0x5308 I_POP = 0x5303 I_PUSH = 0x5302 I_LINK = 0x530c I_UNLINK = 0x530d I_PLINK = 0x5316 I_PUNLINK = 0x5317 IF_UNITSEL = -0x7ffb8cca ) type strbuf struct { Maxlen int32 Len int32 Buf *int8 } type Strioctl struct { Cmd int32 Timout int32 Len int32 Dp *int8 } type Lifreq struct { Name [32]int8 Lifru1 [4]byte Type uint32 Lifru [336]byte } ================================================ FILE: vendor/golang.org/x/sys/unix/ztypes_zos_s390x.go ================================================ // Copyright 2020 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build zos && s390x // Hand edited based on ztypes_linux_s390x.go // TODO: auto-generate. package unix const ( SizeofPtr = 0x8 SizeofShort = 0x2 SizeofInt = 0x4 SizeofLong = 0x8 SizeofLongLong = 0x8 PathMax = 0x1000 ) const ( SizeofSockaddrAny = 128 SizeofCmsghdr = 12 SizeofIPMreq = 8 SizeofIPv6Mreq = 20 SizeofICMPv6Filter = 32 SizeofIPv6MTUInfo = 32 SizeofInet4Pktinfo = 8 SizeofInet6Pktinfo = 20 SizeofLinger = 8 SizeofSockaddrInet4 = 16 SizeofSockaddrInet6 = 28 SizeofTCPInfo = 0x68 SizeofUcred = 12 ) type ( _C_short int16 _C_int int32 _C_long int64 _C_long_long int64 ) type Timespec struct { Sec int64 Nsec int64 } type Timeval struct { Sec int64 Usec int64 } type timeval_zos struct { //correct (with padding and all) Sec int64 _ [4]byte // pad Usec int32 } type Tms struct { //clock_t is 4-byte unsigned int in zos Utime uint32 Stime uint32 Cutime uint32 Cstime uint32 } type Time_t int64 type Utimbuf struct { Actime int64 Modtime int64 } type Utsname struct { Sysname [16]byte Nodename [32]byte Release [8]byte Version [8]byte Machine [16]byte } type Ucred struct { Pid int32 Uid uint32 Gid uint32 } type RawSockaddrInet4 struct { Len uint8 Family uint8 Port uint16 Addr [4]byte /* in_addr */ Zero [8]uint8 } type RawSockaddrInet6 struct { Len uint8 Family uint8 Port uint16 Flowinfo uint32 Addr [16]byte /* in6_addr */ Scope_id uint32 } type RawSockaddrUnix struct { Len uint8 Family uint8 Path [108]int8 } type RawSockaddr struct { Len uint8 Family uint8 Data [14]uint8 } type RawSockaddrAny struct { Addr RawSockaddr _ [112]uint8 // pad } type _Socklen uint32 type Linger struct { Onoff int32 Linger int32 } type Iovec struct { Base *byte Len uint64 } type IPMreq struct { Multiaddr [4]byte /* in_addr */ Interface [4]byte /* in_addr */ } type IPv6Mreq struct { Multiaddr [16]byte /* in6_addr */ Interface uint32 } type Msghdr struct { Name *byte Iov *Iovec Control *byte Flags int32 Namelen int32 Iovlen int32 Controllen int32 } type Cmsghdr struct { Len int32 Level int32 Type int32 } type Inet4Pktinfo struct { Addr [4]byte /* in_addr */ Ifindex uint32 } type Inet6Pktinfo struct { Addr [16]byte /* in6_addr */ Ifindex uint32 } type IPv6MTUInfo struct { Addr RawSockaddrInet6 Mtu uint32 } type ICMPv6Filter struct { Data [8]uint32 } type TCPInfo struct { State uint8 Ca_state uint8 Retransmits uint8 Probes uint8 Backoff uint8 Options uint8 Rto uint32 Ato uint32 Snd_mss uint32 Rcv_mss uint32 Unacked uint32 Sacked uint32 Lost uint32 Retrans uint32 Fackets uint32 Last_data_sent uint32 Last_ack_sent uint32 Last_data_recv uint32 Last_ack_recv uint32 Pmtu uint32 Rcv_ssthresh uint32 Rtt uint32 Rttvar uint32 Snd_ssthresh uint32 Snd_cwnd uint32 Advmss uint32 Reordering uint32 Rcv_rtt uint32 Rcv_space uint32 Total_retrans uint32 } type _Gid_t uint32 type rusage_zos struct { Utime timeval_zos Stime timeval_zos } type Rusage struct { Utime Timeval Stime Timeval Maxrss int64 Ixrss int64 Idrss int64 Isrss int64 Minflt int64 Majflt int64 Nswap int64 Inblock int64 Oublock int64 Msgsnd int64 Msgrcv int64 Nsignals int64 Nvcsw int64 Nivcsw int64 } type Rlimit struct { Cur uint64 Max uint64 } // { int, short, short } in poll.h type PollFd struct { Fd int32 Events int16 Revents int16 } type Stat_t struct { //Linux Definition Dev uint64 Ino uint64 Nlink uint64 Mode uint32 Uid uint32 Gid uint32 _ int32 Rdev uint64 Size int64 Atim Timespec Mtim Timespec Ctim Timespec Blksize int64 Blocks int64 _ [3]int64 } type Stat_LE_t struct { _ [4]byte // eye catcher Length uint16 Version uint16 Mode int32 Ino uint32 Dev uint32 Nlink int32 Uid int32 Gid int32 Size int64 Atim31 [4]byte Mtim31 [4]byte Ctim31 [4]byte Rdev uint32 Auditoraudit uint32 Useraudit uint32 Blksize int32 Creatim31 [4]byte AuditID [16]byte _ [4]byte // rsrvd1 File_tag struct { Ccsid uint16 Txtflag uint16 // aggregating Txflag:1 deferred:1 rsvflags:14 } CharsetID [8]byte Blocks int64 Genvalue uint32 Reftim31 [4]byte Fid [8]byte Filefmt byte Fspflag2 byte _ [2]byte // rsrvd2 Ctimemsec int32 Seclabel [8]byte _ [4]byte // rsrvd3 _ [4]byte // rsrvd4 Atim Time_t Mtim Time_t Ctim Time_t Creatim Time_t Reftim Time_t _ [24]byte // rsrvd5 } type Statvfs_t struct { ID [4]byte Len int32 Bsize uint64 Blocks uint64 Usedspace uint64 Bavail uint64 Flag uint64 Maxfilesize int64 _ [16]byte Frsize uint64 Bfree uint64 Files uint32 Ffree uint32 Favail uint32 Namemax31 uint32 Invarsec uint32 _ [4]byte Fsid uint64 Namemax uint64 } type Statfs_t struct { Type uint64 Bsize uint64 Blocks uint64 Bfree uint64 Bavail uint64 Files uint32 Ffree uint32 Fsid uint64 Namelen uint64 Frsize uint64 Flags uint64 _ [4]uint64 } type direntLE struct { Reclen uint16 Namlen uint16 Ino uint32 Extra uintptr Name [256]byte } type Dirent struct { Ino uint64 Off int64 Reclen uint16 Type uint8 Name [256]uint8 _ [5]byte } type FdSet struct { Bits [64]int32 } // This struct is packed on z/OS so it can't be used directly. type Flock_t struct { Type int16 Whence int16 Start int64 Len int64 Pid int32 } type F_cnvrt struct { Cvtcmd int32 Pccsid int16 Fccsid int16 } type Termios struct { Cflag uint32 Iflag uint32 Lflag uint32 Oflag uint32 Cc [11]uint8 } type Winsize struct { Row uint16 Col uint16 Xpixel uint16 Ypixel uint16 } type W_Mnth struct { Hid [4]byte Size int32 Cur1 int32 //32bit pointer Cur2 int32 //^ Devno uint32 _ [4]byte } type W_Mntent struct { Fstype uint32 Mode uint32 Dev uint32 Parentdev uint32 Rootino uint32 Status byte Ddname [9]byte Fstname [9]byte Fsname [45]byte Pathlen uint32 Mountpoint [1024]byte Jobname [8]byte PID int32 Parmoffset int32 Parmlen int16 Owner [8]byte Quiesceowner [8]byte _ [38]byte } type EpollEvent struct { Events uint32 _ int32 Fd int32 Pad int32 } type InotifyEvent struct { Wd int32 Mask uint32 Cookie uint32 Len uint32 Name string } const ( SizeofInotifyEvent = 0x10 ) type ConsMsg2 struct { Cm2Format uint16 Cm2R1 uint16 Cm2Msglength uint32 Cm2Msg *byte Cm2R2 [4]byte Cm2R3 [4]byte Cm2Routcde *uint32 Cm2Descr *uint32 Cm2Msgflag uint32 Cm2Token uint32 Cm2Msgid *uint32 Cm2R4 [4]byte Cm2DomToken uint32 Cm2DomMsgid *uint32 Cm2ModCartptr *byte Cm2ModConsidptr *byte Cm2MsgCart [8]byte Cm2MsgConsid [4]byte Cm2R5 [12]byte } const ( CC_modify = 1 CC_stop = 2 CONSOLE_FORMAT_2 = 2 CONSOLE_FORMAT_3 = 3 CONSOLE_HRDCPY = 0x80000000 ) type OpenHow struct { Flags uint64 Mode uint64 Resolve uint64 } const SizeofOpenHow = 0x18 const ( RESOLVE_CACHED = 0x20 RESOLVE_BENEATH = 0x8 RESOLVE_IN_ROOT = 0x10 RESOLVE_NO_MAGICLINKS = 0x2 RESOLVE_NO_SYMLINKS = 0x4 RESOLVE_NO_XDEV = 0x1 ) type Siginfo struct { Signo int32 Errno int32 Code int32 Pid int32 Uid uint32 _ [44]byte } type SysvIpcPerm struct { Uid uint32 Gid uint32 Cuid uint32 Cgid uint32 Mode int32 } type SysvShmDesc struct { Perm SysvIpcPerm _ [4]byte Lpid int32 Cpid int32 Nattch uint32 _ [4]byte _ [4]byte _ [4]byte _ int32 _ uint8 _ uint8 _ uint16 _ *byte Segsz uint64 Atime Time_t Dtime Time_t Ctime Time_t } type SysvShmDesc64 struct { Perm SysvIpcPerm _ [4]byte Lpid int32 Cpid int32 Nattch uint32 _ [4]byte _ [4]byte _ [4]byte _ int32 _ byte _ uint8 _ uint16 _ *byte Segsz uint64 Atime int64 Dtime int64 Ctime int64 } ================================================ FILE: vendor/golang.org/x/sys/windows/aliases.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build windows package windows import "syscall" type Signal = syscall.Signal type Errno = syscall.Errno type SysProcAttr = syscall.SysProcAttr ================================================ FILE: vendor/golang.org/x/sys/windows/dll_windows.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package windows import ( "sync" "sync/atomic" "syscall" "unsafe" ) // We need to use LoadLibrary and GetProcAddress from the Go runtime, because // the these symbols are loaded by the system linker and are required to // dynamically load additional symbols. Note that in the Go runtime, these // return syscall.Handle and syscall.Errno, but these are the same, in fact, // as windows.Handle and windows.Errno, and we intend to keep these the same. //go:linkname syscall_loadlibrary syscall.loadlibrary func syscall_loadlibrary(filename *uint16) (handle Handle, err Errno) //go:linkname syscall_getprocaddress syscall.getprocaddress func syscall_getprocaddress(handle Handle, procname *uint8) (proc uintptr, err Errno) // DLLError describes reasons for DLL load failures. type DLLError struct { Err error ObjName string Msg string } func (e *DLLError) Error() string { return e.Msg } func (e *DLLError) Unwrap() error { return e.Err } // A DLL implements access to a single DLL. type DLL struct { Name string Handle Handle } // LoadDLL loads DLL file into memory. // // Warning: using LoadDLL without an absolute path name is subject to // DLL preloading attacks. To safely load a system DLL, use [NewLazySystemDLL], // or use [LoadLibraryEx] directly. func LoadDLL(name string) (dll *DLL, err error) { namep, err := UTF16PtrFromString(name) if err != nil { return nil, err } h, e := syscall_loadlibrary(namep) if e != 0 { return nil, &DLLError{ Err: e, ObjName: name, Msg: "Failed to load " + name + ": " + e.Error(), } } d := &DLL{ Name: name, Handle: h, } return d, nil } // MustLoadDLL is like LoadDLL but panics if load operation fails. func MustLoadDLL(name string) *DLL { d, e := LoadDLL(name) if e != nil { panic(e) } return d } // FindProc searches DLL d for procedure named name and returns *Proc // if found. It returns an error if search fails. func (d *DLL) FindProc(name string) (proc *Proc, err error) { namep, err := BytePtrFromString(name) if err != nil { return nil, err } a, e := syscall_getprocaddress(d.Handle, namep) if e != 0 { return nil, &DLLError{ Err: e, ObjName: name, Msg: "Failed to find " + name + " procedure in " + d.Name + ": " + e.Error(), } } p := &Proc{ Dll: d, Name: name, addr: a, } return p, nil } // MustFindProc is like FindProc but panics if search fails. func (d *DLL) MustFindProc(name string) *Proc { p, e := d.FindProc(name) if e != nil { panic(e) } return p } // FindProcByOrdinal searches DLL d for procedure by ordinal and returns *Proc // if found. It returns an error if search fails. func (d *DLL) FindProcByOrdinal(ordinal uintptr) (proc *Proc, err error) { a, e := GetProcAddressByOrdinal(d.Handle, ordinal) name := "#" + itoa(int(ordinal)) if e != nil { return nil, &DLLError{ Err: e, ObjName: name, Msg: "Failed to find " + name + " procedure in " + d.Name + ": " + e.Error(), } } p := &Proc{ Dll: d, Name: name, addr: a, } return p, nil } // MustFindProcByOrdinal is like FindProcByOrdinal but panics if search fails. func (d *DLL) MustFindProcByOrdinal(ordinal uintptr) *Proc { p, e := d.FindProcByOrdinal(ordinal) if e != nil { panic(e) } return p } // Release unloads DLL d from memory. func (d *DLL) Release() (err error) { return FreeLibrary(d.Handle) } // A Proc implements access to a procedure inside a DLL. type Proc struct { Dll *DLL Name string addr uintptr } // Addr returns the address of the procedure represented by p. // The return value can be passed to Syscall to run the procedure. func (p *Proc) Addr() uintptr { return p.addr } //go:uintptrescapes // Call executes procedure p with arguments a. It will panic, if more than 15 arguments // are supplied. // // The returned error is always non-nil, constructed from the result of GetLastError. // Callers must inspect the primary return value to decide whether an error occurred // (according to the semantics of the specific function being called) before consulting // the error. The error will be guaranteed to contain windows.Errno. func (p *Proc) Call(a ...uintptr) (r1, r2 uintptr, lastErr error) { switch len(a) { case 0: return syscall.Syscall(p.Addr(), uintptr(len(a)), 0, 0, 0) case 1: return syscall.Syscall(p.Addr(), uintptr(len(a)), a[0], 0, 0) case 2: return syscall.Syscall(p.Addr(), uintptr(len(a)), a[0], a[1], 0) case 3: return syscall.Syscall(p.Addr(), uintptr(len(a)), a[0], a[1], a[2]) case 4: return syscall.Syscall6(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], 0, 0) case 5: return syscall.Syscall6(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], 0) case 6: return syscall.Syscall6(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5]) case 7: return syscall.Syscall9(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], 0, 0) case 8: return syscall.Syscall9(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], 0) case 9: return 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]) case 10: return 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) case 11: return 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) case 12: return 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]) case 13: return 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) case 14: return 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) case 15: return 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]) default: panic("Call " + p.Name + " with too many arguments " + itoa(len(a)) + ".") } } // A LazyDLL implements access to a single DLL. // It will delay the load of the DLL until the first // call to its Handle method or to one of its // LazyProc's Addr method. type LazyDLL struct { Name string // System determines whether the DLL must be loaded from the // Windows System directory, bypassing the normal DLL search // path. System bool mu sync.Mutex dll *DLL // non nil once DLL is loaded } // Load loads DLL file d.Name into memory. It returns an error if fails. // Load will not try to load DLL, if it is already loaded into memory. func (d *LazyDLL) Load() error { // Non-racy version of: // if d.dll != nil { if atomic.LoadPointer((*unsafe.Pointer)(unsafe.Pointer(&d.dll))) != nil { return nil } d.mu.Lock() defer d.mu.Unlock() if d.dll != nil { return nil } // kernel32.dll is special, since it's where LoadLibraryEx comes from. // The kernel already special-cases its name, so it's always // loaded from system32. var dll *DLL var err error if d.Name == "kernel32.dll" { dll, err = LoadDLL(d.Name) } else { dll, err = loadLibraryEx(d.Name, d.System) } if err != nil { return err } // Non-racy version of: // d.dll = dll atomic.StorePointer((*unsafe.Pointer)(unsafe.Pointer(&d.dll)), unsafe.Pointer(dll)) return nil } // mustLoad is like Load but panics if search fails. func (d *LazyDLL) mustLoad() { e := d.Load() if e != nil { panic(e) } } // Handle returns d's module handle. func (d *LazyDLL) Handle() uintptr { d.mustLoad() return uintptr(d.dll.Handle) } // NewProc returns a LazyProc for accessing the named procedure in the DLL d. func (d *LazyDLL) NewProc(name string) *LazyProc { return &LazyProc{l: d, Name: name} } // NewLazyDLL creates new LazyDLL associated with DLL file. // // Warning: using NewLazyDLL without an absolute path name is subject to // DLL preloading attacks. To safely load a system DLL, use [NewLazySystemDLL]. func NewLazyDLL(name string) *LazyDLL { return &LazyDLL{Name: name} } // NewLazySystemDLL is like NewLazyDLL, but will only // search Windows System directory for the DLL if name is // a base name (like "advapi32.dll"). func NewLazySystemDLL(name string) *LazyDLL { return &LazyDLL{Name: name, System: true} } // A LazyProc implements access to a procedure inside a LazyDLL. // It delays the lookup until the Addr method is called. type LazyProc struct { Name string mu sync.Mutex l *LazyDLL proc *Proc } // Find searches DLL for procedure named p.Name. It returns // an error if search fails. Find will not search procedure, // if it is already found and loaded into memory. func (p *LazyProc) Find() error { // Non-racy version of: // if p.proc == nil { if atomic.LoadPointer((*unsafe.Pointer)(unsafe.Pointer(&p.proc))) == nil { p.mu.Lock() defer p.mu.Unlock() if p.proc == nil { e := p.l.Load() if e != nil { return e } proc, e := p.l.dll.FindProc(p.Name) if e != nil { return e } // Non-racy version of: // p.proc = proc atomic.StorePointer((*unsafe.Pointer)(unsafe.Pointer(&p.proc)), unsafe.Pointer(proc)) } } return nil } // mustFind is like Find but panics if search fails. func (p *LazyProc) mustFind() { e := p.Find() if e != nil { panic(e) } } // Addr returns the address of the procedure represented by p. // The return value can be passed to Syscall to run the procedure. // It will panic if the procedure cannot be found. func (p *LazyProc) Addr() uintptr { p.mustFind() return p.proc.Addr() } //go:uintptrescapes // Call executes procedure p with arguments a. It will panic, if more than 15 arguments // are supplied. It will also panic if the procedure cannot be found. // // The returned error is always non-nil, constructed from the result of GetLastError. // Callers must inspect the primary return value to decide whether an error occurred // (according to the semantics of the specific function being called) before consulting // the error. The error will be guaranteed to contain windows.Errno. func (p *LazyProc) Call(a ...uintptr) (r1, r2 uintptr, lastErr error) { p.mustFind() return p.proc.Call(a...) } var canDoSearchSystem32Once struct { sync.Once v bool } func initCanDoSearchSystem32() { // https://msdn.microsoft.com/en-us/library/ms684179(v=vs.85).aspx says: // "Windows 7, Windows Server 2008 R2, Windows Vista, and Windows // Server 2008: The LOAD_LIBRARY_SEARCH_* flags are available on // systems that have KB2533623 installed. To determine whether the // flags are available, use GetProcAddress to get the address of the // AddDllDirectory, RemoveDllDirectory, or SetDefaultDllDirectories // function. If GetProcAddress succeeds, the LOAD_LIBRARY_SEARCH_* // flags can be used with LoadLibraryEx." canDoSearchSystem32Once.v = (modkernel32.NewProc("AddDllDirectory").Find() == nil) } func canDoSearchSystem32() bool { canDoSearchSystem32Once.Do(initCanDoSearchSystem32) return canDoSearchSystem32Once.v } func isBaseName(name string) bool { for _, c := range name { if c == ':' || c == '/' || c == '\\' { return false } } return true } // loadLibraryEx wraps the Windows LoadLibraryEx function. // // See https://msdn.microsoft.com/en-us/library/windows/desktop/ms684179(v=vs.85).aspx // // If name is not an absolute path, LoadLibraryEx searches for the DLL // in a variety of automatic locations unless constrained by flags. // See: https://msdn.microsoft.com/en-us/library/ff919712%28VS.85%29.aspx func loadLibraryEx(name string, system bool) (*DLL, error) { loadDLL := name var flags uintptr if system { if canDoSearchSystem32() { flags = LOAD_LIBRARY_SEARCH_SYSTEM32 } else if isBaseName(name) { // WindowsXP or unpatched Windows machine // trying to load "foo.dll" out of the system // folder, but LoadLibraryEx doesn't support // that yet on their system, so emulate it. systemdir, err := GetSystemDirectory() if err != nil { return nil, err } loadDLL = systemdir + "\\" + name } } h, err := LoadLibraryEx(loadDLL, 0, flags) if err != nil { return nil, err } return &DLL{Name: name, Handle: h}, nil } ================================================ FILE: vendor/golang.org/x/sys/windows/env_windows.go ================================================ // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Windows environment variables. package windows import ( "syscall" "unsafe" ) func Getenv(key string) (value string, found bool) { return syscall.Getenv(key) } func Setenv(key, value string) error { return syscall.Setenv(key, value) } func Clearenv() { syscall.Clearenv() } func Environ() []string { return syscall.Environ() } // Returns a default environment associated with the token, rather than the current // process. If inheritExisting is true, then this environment also inherits the // environment of the current process. func (token Token) Environ(inheritExisting bool) (env []string, err error) { var block *uint16 err = CreateEnvironmentBlock(&block, token, inheritExisting) if err != nil { return nil, err } defer DestroyEnvironmentBlock(block) size := unsafe.Sizeof(*block) for *block != 0 { // find NUL terminator end := unsafe.Pointer(block) for *(*uint16)(end) != 0 { end = unsafe.Add(end, size) } entry := unsafe.Slice(block, (uintptr(end)-uintptr(unsafe.Pointer(block)))/size) env = append(env, UTF16ToString(entry)) block = (*uint16)(unsafe.Add(end, size)) } return env, nil } func Unsetenv(key string) error { return syscall.Unsetenv(key) } ================================================ FILE: vendor/golang.org/x/sys/windows/eventlog.go ================================================ // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build windows package windows const ( EVENTLOG_SUCCESS = 0 EVENTLOG_ERROR_TYPE = 1 EVENTLOG_WARNING_TYPE = 2 EVENTLOG_INFORMATION_TYPE = 4 EVENTLOG_AUDIT_SUCCESS = 8 EVENTLOG_AUDIT_FAILURE = 16 ) //sys RegisterEventSource(uncServerName *uint16, sourceName *uint16) (handle Handle, err error) [failretval==0] = advapi32.RegisterEventSourceW //sys DeregisterEventSource(handle Handle) (err error) = advapi32.DeregisterEventSource //sys ReportEvent(log Handle, etype uint16, category uint16, eventId uint32, usrSId uintptr, numStrings uint16, dataSize uint32, strings **uint16, rawData *byte) (err error) = advapi32.ReportEventW ================================================ FILE: vendor/golang.org/x/sys/windows/exec_windows.go ================================================ // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Fork, exec, wait, etc. package windows import ( errorspkg "errors" "unsafe" ) // EscapeArg rewrites command line argument s as prescribed // in http://msdn.microsoft.com/en-us/library/ms880421. // This function returns "" (2 double quotes) if s is empty. // Alternatively, these transformations are done: // - every back slash (\) is doubled, but only if immediately // followed by double quote ("); // - every double quote (") is escaped by back slash (\); // - finally, s is wrapped with double quotes (arg -> "arg"), // but only if there is space or tab inside s. func EscapeArg(s string) string { if len(s) == 0 { return `""` } n := len(s) hasSpace := false for i := 0; i < len(s); i++ { switch s[i] { case '"', '\\': n++ case ' ', '\t': hasSpace = true } } if hasSpace { n += 2 // Reserve space for quotes. } if n == len(s) { return s } qs := make([]byte, n) j := 0 if hasSpace { qs[j] = '"' j++ } slashes := 0 for i := 0; i < len(s); i++ { switch s[i] { default: slashes = 0 qs[j] = s[i] case '\\': slashes++ qs[j] = s[i] case '"': for ; slashes > 0; slashes-- { qs[j] = '\\' j++ } qs[j] = '\\' j++ qs[j] = s[i] } j++ } if hasSpace { for ; slashes > 0; slashes-- { qs[j] = '\\' j++ } qs[j] = '"' j++ } return string(qs[:j]) } // ComposeCommandLine escapes and joins the given arguments suitable for use as a Windows command line, // in CreateProcess's CommandLine argument, CreateService/ChangeServiceConfig's BinaryPathName argument, // or any program that uses CommandLineToArgv. func ComposeCommandLine(args []string) string { if len(args) == 0 { return "" } // Per https://learn.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-commandlinetoargvw: // “This function accepts command lines that contain a program name; the // program name can be enclosed in quotation marks or not.” // // Unfortunately, it provides no means of escaping interior quotation marks // within that program name, and we have no way to report them here. prog := args[0] mustQuote := len(prog) == 0 for i := 0; i < len(prog); i++ { c := prog[i] if c <= ' ' || (c == '"' && i == 0) { // Force quotes for not only the ASCII space and tab as described in the // MSDN article, but also ASCII control characters. // The documentation for CommandLineToArgvW doesn't say what happens when // the first argument is not a valid program name, but it empirically // seems to drop unquoted control characters. mustQuote = true break } } var commandLine []byte if mustQuote { commandLine = make([]byte, 0, len(prog)+2) commandLine = append(commandLine, '"') for i := 0; i < len(prog); i++ { c := prog[i] if c == '"' { // This quote would interfere with our surrounding quotes. // We have no way to report an error, so just strip out // the offending character instead. continue } commandLine = append(commandLine, c) } commandLine = append(commandLine, '"') } else { if len(args) == 1 { // args[0] is a valid command line representing itself. // No need to allocate a new slice or string for it. return prog } commandLine = []byte(prog) } for _, arg := range args[1:] { commandLine = append(commandLine, ' ') // TODO(bcmills): since we're already appending to a slice, it would be nice // to avoid the intermediate allocations of EscapeArg. // Perhaps we can factor out an appendEscapedArg function. commandLine = append(commandLine, EscapeArg(arg)...) } return string(commandLine) } // DecomposeCommandLine breaks apart its argument command line into unescaped parts using CommandLineToArgv, // as gathered from GetCommandLine, QUERY_SERVICE_CONFIG's BinaryPathName argument, or elsewhere that // command lines are passed around. // DecomposeCommandLine returns an error if commandLine contains NUL. func DecomposeCommandLine(commandLine string) ([]string, error) { if len(commandLine) == 0 { return []string{}, nil } utf16CommandLine, err := UTF16FromString(commandLine) if err != nil { return nil, errorspkg.New("string with NUL passed to DecomposeCommandLine") } var argc int32 argv, err := commandLineToArgv(&utf16CommandLine[0], &argc) if err != nil { return nil, err } defer LocalFree(Handle(unsafe.Pointer(argv))) var args []string for _, p := range unsafe.Slice(argv, argc) { args = append(args, UTF16PtrToString(p)) } return args, nil } // CommandLineToArgv parses a Unicode command line string and sets // argc to the number of parsed arguments. // // The returned memory should be freed using a single call to LocalFree. // // Note that although the return type of CommandLineToArgv indicates 8192 // entries of up to 8192 characters each, the actual count of parsed arguments // may exceed 8192, and the documentation for CommandLineToArgvW does not mention // any bound on the lengths of the individual argument strings. // (See https://go.dev/issue/63236.) func CommandLineToArgv(cmd *uint16, argc *int32) (argv *[8192]*[8192]uint16, err error) { argp, err := commandLineToArgv(cmd, argc) argv = (*[8192]*[8192]uint16)(unsafe.Pointer(argp)) return argv, err } func CloseOnExec(fd Handle) { SetHandleInformation(Handle(fd), HANDLE_FLAG_INHERIT, 0) } // FullPath retrieves the full path of the specified file. func FullPath(name string) (path string, err error) { p, err := UTF16PtrFromString(name) if err != nil { return "", err } n := uint32(100) for { buf := make([]uint16, n) n, err = GetFullPathName(p, uint32(len(buf)), &buf[0], nil) if err != nil { return "", err } if n <= uint32(len(buf)) { return UTF16ToString(buf[:n]), nil } } } // NewProcThreadAttributeList allocates a new ProcThreadAttributeListContainer, with the requested maximum number of attributes. func NewProcThreadAttributeList(maxAttrCount uint32) (*ProcThreadAttributeListContainer, error) { var size uintptr err := initializeProcThreadAttributeList(nil, maxAttrCount, 0, &size) if err != ERROR_INSUFFICIENT_BUFFER { if err == nil { return nil, errorspkg.New("unable to query buffer size from InitializeProcThreadAttributeList") } return nil, err } alloc, err := LocalAlloc(LMEM_FIXED, uint32(size)) if err != nil { return nil, err } // size is guaranteed to be ≥1 by InitializeProcThreadAttributeList. al := &ProcThreadAttributeListContainer{data: (*ProcThreadAttributeList)(unsafe.Pointer(alloc))} err = initializeProcThreadAttributeList(al.data, maxAttrCount, 0, &size) if err != nil { return nil, err } return al, err } // Update modifies the ProcThreadAttributeList using UpdateProcThreadAttribute. func (al *ProcThreadAttributeListContainer) Update(attribute uintptr, value unsafe.Pointer, size uintptr) error { al.pointers = append(al.pointers, value) return updateProcThreadAttribute(al.data, 0, attribute, value, size, nil, nil) } // Delete frees ProcThreadAttributeList's resources. func (al *ProcThreadAttributeListContainer) Delete() { deleteProcThreadAttributeList(al.data) LocalFree(Handle(unsafe.Pointer(al.data))) al.data = nil al.pointers = nil } // List returns the actual ProcThreadAttributeList to be passed to StartupInfoEx. func (al *ProcThreadAttributeListContainer) List() *ProcThreadAttributeList { return al.data } ================================================ FILE: vendor/golang.org/x/sys/windows/memory_windows.go ================================================ // Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package windows const ( MEM_COMMIT = 0x00001000 MEM_RESERVE = 0x00002000 MEM_DECOMMIT = 0x00004000 MEM_RELEASE = 0x00008000 MEM_RESET = 0x00080000 MEM_TOP_DOWN = 0x00100000 MEM_WRITE_WATCH = 0x00200000 MEM_PHYSICAL = 0x00400000 MEM_RESET_UNDO = 0x01000000 MEM_LARGE_PAGES = 0x20000000 PAGE_NOACCESS = 0x00000001 PAGE_READONLY = 0x00000002 PAGE_READWRITE = 0x00000004 PAGE_WRITECOPY = 0x00000008 PAGE_EXECUTE = 0x00000010 PAGE_EXECUTE_READ = 0x00000020 PAGE_EXECUTE_READWRITE = 0x00000040 PAGE_EXECUTE_WRITECOPY = 0x00000080 PAGE_GUARD = 0x00000100 PAGE_NOCACHE = 0x00000200 PAGE_WRITECOMBINE = 0x00000400 PAGE_TARGETS_INVALID = 0x40000000 PAGE_TARGETS_NO_UPDATE = 0x40000000 QUOTA_LIMITS_HARDWS_MIN_DISABLE = 0x00000002 QUOTA_LIMITS_HARDWS_MIN_ENABLE = 0x00000001 QUOTA_LIMITS_HARDWS_MAX_DISABLE = 0x00000008 QUOTA_LIMITS_HARDWS_MAX_ENABLE = 0x00000004 ) type MemoryBasicInformation struct { BaseAddress uintptr AllocationBase uintptr AllocationProtect uint32 PartitionId uint16 RegionSize uintptr State uint32 Protect uint32 Type uint32 } ================================================ FILE: vendor/golang.org/x/sys/windows/mkerrors.bash ================================================ #!/bin/bash # Copyright 2019 The Go Authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. set -e shopt -s nullglob winerror="$(printf '%s\n' "/mnt/c/Program Files (x86)/Windows Kits/"/*/Include/*/shared/winerror.h | sort -Vr | head -n 1)" [[ -n $winerror ]] || { echo "Unable to find winerror.h" >&2; exit 1; } ntstatus="$(printf '%s\n' "/mnt/c/Program Files (x86)/Windows Kits/"/*/Include/*/shared/ntstatus.h | sort -Vr | head -n 1)" [[ -n $ntstatus ]] || { echo "Unable to find ntstatus.h" >&2; exit 1; } declare -A errors { echo "// Code generated by 'mkerrors.bash'; DO NOT EDIT." echo echo "package windows" echo "import \"syscall\"" echo "const (" while read -r line; do unset vtype if [[ $line =~ ^#define\ +([A-Z0-9_]+k?)\ +([A-Z0-9_]+\()?([A-Z][A-Z0-9_]+k?)\)? ]]; then key="${BASH_REMATCH[1]}" value="${BASH_REMATCH[3]}" elif [[ $line =~ ^#define\ +([A-Z0-9_]+k?)\ +([A-Z0-9_]+\()?((0x)?[0-9A-Fa-f]+)L?\)? ]]; then key="${BASH_REMATCH[1]}" value="${BASH_REMATCH[3]}" vtype="${BASH_REMATCH[2]}" elif [[ $line =~ ^#define\ +([A-Z0-9_]+k?)\ +\(\(([A-Z]+)\)((0x)?[0-9A-Fa-f]+)L?\) ]]; then key="${BASH_REMATCH[1]}" value="${BASH_REMATCH[3]}" vtype="${BASH_REMATCH[2]}" else continue fi [[ -n $key && -n $value ]] || continue [[ -z ${errors["$key"]} ]] || continue errors["$key"]="$value" if [[ -v vtype ]]; then if [[ $key == FACILITY_* || $key == NO_ERROR ]]; then vtype="" elif [[ $vtype == *HANDLE* || $vtype == *HRESULT* ]]; then vtype="Handle" else vtype="syscall.Errno" fi last_vtype="$vtype" else vtype="" if [[ $last_vtype == Handle && $value == NO_ERROR ]]; then value="S_OK" elif [[ $last_vtype == syscall.Errno && $value == NO_ERROR ]]; then value="ERROR_SUCCESS" fi fi echo "$key $vtype = $value" done < "$winerror" while read -r line; do [[ $line =~ ^#define\ (STATUS_[^\s]+)\ +\(\(NTSTATUS\)((0x)?[0-9a-fA-F]+)L?\) ]] || continue echo "${BASH_REMATCH[1]} NTStatus = ${BASH_REMATCH[2]}" done < "$ntstatus" echo ")" } | gofmt > "zerrors_windows.go" ================================================ FILE: vendor/golang.org/x/sys/windows/mkknownfolderids.bash ================================================ #!/bin/bash # Copyright 2019 The Go Authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. set -e shopt -s nullglob knownfolders="$(printf '%s\n' "/mnt/c/Program Files (x86)/Windows Kits/"/*/Include/*/um/KnownFolders.h | sort -Vr | head -n 1)" [[ -n $knownfolders ]] || { echo "Unable to find KnownFolders.h" >&2; exit 1; } { echo "// Code generated by 'mkknownfolderids.bash'; DO NOT EDIT." echo echo "package windows" echo "type KNOWNFOLDERID GUID" echo "var (" while read -r line; do [[ $line =~ DEFINE_KNOWN_FOLDER\((FOLDERID_[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+)\) ]] || continue printf "%s = &KNOWNFOLDERID{0x%08x, 0x%04x, 0x%04x, [8]byte{0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x}}\n" \ "${BASH_REMATCH[1]}" $(( "${BASH_REMATCH[2]}" )) $(( "${BASH_REMATCH[3]}" )) $(( "${BASH_REMATCH[4]}" )) \ $(( "${BASH_REMATCH[5]}" )) $(( "${BASH_REMATCH[6]}" )) $(( "${BASH_REMATCH[7]}" )) $(( "${BASH_REMATCH[8]}" )) \ $(( "${BASH_REMATCH[9]}" )) $(( "${BASH_REMATCH[10]}" )) $(( "${BASH_REMATCH[11]}" )) $(( "${BASH_REMATCH[12]}" )) done < "$knownfolders" echo ")" } | gofmt > "zknownfolderids_windows.go" ================================================ FILE: vendor/golang.org/x/sys/windows/mksyscall.go ================================================ // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build generate package windows //go:generate go run golang.org/x/sys/windows/mkwinsyscall -output zsyscall_windows.go eventlog.go service.go syscall_windows.go security_windows.go setupapi_windows.go ================================================ FILE: vendor/golang.org/x/sys/windows/race.go ================================================ // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build windows && race package windows import ( "runtime" "unsafe" ) const raceenabled = true func raceAcquire(addr unsafe.Pointer) { runtime.RaceAcquire(addr) } func raceReleaseMerge(addr unsafe.Pointer) { runtime.RaceReleaseMerge(addr) } func raceReadRange(addr unsafe.Pointer, len int) { runtime.RaceReadRange(addr, len) } func raceWriteRange(addr unsafe.Pointer, len int) { runtime.RaceWriteRange(addr, len) } ================================================ FILE: vendor/golang.org/x/sys/windows/race0.go ================================================ // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build windows && !race package windows import ( "unsafe" ) const raceenabled = false func raceAcquire(addr unsafe.Pointer) { } func raceReleaseMerge(addr unsafe.Pointer) { } func raceReadRange(addr unsafe.Pointer, len int) { } func raceWriteRange(addr unsafe.Pointer, len int) { } ================================================ FILE: vendor/golang.org/x/sys/windows/security_windows.go ================================================ // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package windows import ( "syscall" "unsafe" ) const ( NameUnknown = 0 NameFullyQualifiedDN = 1 NameSamCompatible = 2 NameDisplay = 3 NameUniqueId = 6 NameCanonical = 7 NameUserPrincipal = 8 NameCanonicalEx = 9 NameServicePrincipal = 10 NameDnsDomain = 12 ) // This function returns 1 byte BOOLEAN rather than the 4 byte BOOL. // http://blogs.msdn.com/b/drnick/archive/2007/12/19/windows-and-upn-format-credentials.aspx //sys TranslateName(accName *uint16, accNameFormat uint32, desiredNameFormat uint32, translatedName *uint16, nSize *uint32) (err error) [failretval&0xff==0] = secur32.TranslateNameW //sys GetUserNameEx(nameFormat uint32, nameBuffre *uint16, nSize *uint32) (err error) [failretval&0xff==0] = secur32.GetUserNameExW // TranslateAccountName converts a directory service // object name from one format to another. func TranslateAccountName(username string, from, to uint32, initSize int) (string, error) { u, e := UTF16PtrFromString(username) if e != nil { return "", e } n := uint32(50) for { b := make([]uint16, n) e = TranslateName(u, from, to, &b[0], &n) if e == nil { return UTF16ToString(b[:n]), nil } if e != ERROR_INSUFFICIENT_BUFFER { return "", e } if n <= uint32(len(b)) { return "", e } } } const ( // do not reorder NetSetupUnknownStatus = iota NetSetupUnjoined NetSetupWorkgroupName NetSetupDomainName ) type UserInfo10 struct { Name *uint16 Comment *uint16 UsrComment *uint16 FullName *uint16 } //sys NetUserGetInfo(serverName *uint16, userName *uint16, level uint32, buf **byte) (neterr error) = netapi32.NetUserGetInfo //sys NetGetJoinInformation(server *uint16, name **uint16, bufType *uint32) (neterr error) = netapi32.NetGetJoinInformation //sys NetApiBufferFree(buf *byte) (neterr error) = netapi32.NetApiBufferFree //sys NetUserEnum(serverName *uint16, level uint32, filter uint32, buf **byte, prefMaxLen uint32, entriesRead *uint32, totalEntries *uint32, resumeHandle *uint32) (neterr error) = netapi32.NetUserEnum const ( // do not reorder SidTypeUser = 1 + iota SidTypeGroup SidTypeDomain SidTypeAlias SidTypeWellKnownGroup SidTypeDeletedAccount SidTypeInvalid SidTypeUnknown SidTypeComputer SidTypeLabel ) type SidIdentifierAuthority struct { Value [6]byte } var ( SECURITY_NULL_SID_AUTHORITY = SidIdentifierAuthority{[6]byte{0, 0, 0, 0, 0, 0}} SECURITY_WORLD_SID_AUTHORITY = SidIdentifierAuthority{[6]byte{0, 0, 0, 0, 0, 1}} SECURITY_LOCAL_SID_AUTHORITY = SidIdentifierAuthority{[6]byte{0, 0, 0, 0, 0, 2}} SECURITY_CREATOR_SID_AUTHORITY = SidIdentifierAuthority{[6]byte{0, 0, 0, 0, 0, 3}} SECURITY_NON_UNIQUE_AUTHORITY = SidIdentifierAuthority{[6]byte{0, 0, 0, 0, 0, 4}} SECURITY_NT_AUTHORITY = SidIdentifierAuthority{[6]byte{0, 0, 0, 0, 0, 5}} SECURITY_MANDATORY_LABEL_AUTHORITY = SidIdentifierAuthority{[6]byte{0, 0, 0, 0, 0, 16}} ) const ( SECURITY_NULL_RID = 0 SECURITY_WORLD_RID = 0 SECURITY_LOCAL_RID = 0 SECURITY_CREATOR_OWNER_RID = 0 SECURITY_CREATOR_GROUP_RID = 1 SECURITY_DIALUP_RID = 1 SECURITY_NETWORK_RID = 2 SECURITY_BATCH_RID = 3 SECURITY_INTERACTIVE_RID = 4 SECURITY_LOGON_IDS_RID = 5 SECURITY_SERVICE_RID = 6 SECURITY_LOCAL_SYSTEM_RID = 18 SECURITY_BUILTIN_DOMAIN_RID = 32 SECURITY_PRINCIPAL_SELF_RID = 10 SECURITY_CREATOR_OWNER_SERVER_RID = 0x2 SECURITY_CREATOR_GROUP_SERVER_RID = 0x3 SECURITY_LOGON_IDS_RID_COUNT = 0x3 SECURITY_ANONYMOUS_LOGON_RID = 0x7 SECURITY_PROXY_RID = 0x8 SECURITY_ENTERPRISE_CONTROLLERS_RID = 0x9 SECURITY_SERVER_LOGON_RID = SECURITY_ENTERPRISE_CONTROLLERS_RID SECURITY_AUTHENTICATED_USER_RID = 0xb SECURITY_RESTRICTED_CODE_RID = 0xc SECURITY_NT_NON_UNIQUE_RID = 0x15 ) // Predefined domain-relative RIDs for local groups. // See https://msdn.microsoft.com/en-us/library/windows/desktop/aa379649(v=vs.85).aspx const ( DOMAIN_ALIAS_RID_ADMINS = 0x220 DOMAIN_ALIAS_RID_USERS = 0x221 DOMAIN_ALIAS_RID_GUESTS = 0x222 DOMAIN_ALIAS_RID_POWER_USERS = 0x223 DOMAIN_ALIAS_RID_ACCOUNT_OPS = 0x224 DOMAIN_ALIAS_RID_SYSTEM_OPS = 0x225 DOMAIN_ALIAS_RID_PRINT_OPS = 0x226 DOMAIN_ALIAS_RID_BACKUP_OPS = 0x227 DOMAIN_ALIAS_RID_REPLICATOR = 0x228 DOMAIN_ALIAS_RID_RAS_SERVERS = 0x229 DOMAIN_ALIAS_RID_PREW2KCOMPACCESS = 0x22a DOMAIN_ALIAS_RID_REMOTE_DESKTOP_USERS = 0x22b DOMAIN_ALIAS_RID_NETWORK_CONFIGURATION_OPS = 0x22c DOMAIN_ALIAS_RID_INCOMING_FOREST_TRUST_BUILDERS = 0x22d DOMAIN_ALIAS_RID_MONITORING_USERS = 0x22e DOMAIN_ALIAS_RID_LOGGING_USERS = 0x22f DOMAIN_ALIAS_RID_AUTHORIZATIONACCESS = 0x230 DOMAIN_ALIAS_RID_TS_LICENSE_SERVERS = 0x231 DOMAIN_ALIAS_RID_DCOM_USERS = 0x232 DOMAIN_ALIAS_RID_IUSERS = 0x238 DOMAIN_ALIAS_RID_CRYPTO_OPERATORS = 0x239 DOMAIN_ALIAS_RID_CACHEABLE_PRINCIPALS_GROUP = 0x23b DOMAIN_ALIAS_RID_NON_CACHEABLE_PRINCIPALS_GROUP = 0x23c DOMAIN_ALIAS_RID_EVENT_LOG_READERS_GROUP = 0x23d DOMAIN_ALIAS_RID_CERTSVC_DCOM_ACCESS_GROUP = 0x23e ) //sys LookupAccountSid(systemName *uint16, sid *SID, name *uint16, nameLen *uint32, refdDomainName *uint16, refdDomainNameLen *uint32, use *uint32) (err error) = advapi32.LookupAccountSidW //sys LookupAccountName(systemName *uint16, accountName *uint16, sid *SID, sidLen *uint32, refdDomainName *uint16, refdDomainNameLen *uint32, use *uint32) (err error) = advapi32.LookupAccountNameW //sys ConvertSidToStringSid(sid *SID, stringSid **uint16) (err error) = advapi32.ConvertSidToStringSidW //sys ConvertStringSidToSid(stringSid *uint16, sid **SID) (err error) = advapi32.ConvertStringSidToSidW //sys GetLengthSid(sid *SID) (len uint32) = advapi32.GetLengthSid //sys CopySid(destSidLen uint32, destSid *SID, srcSid *SID) (err error) = advapi32.CopySid //sys 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) = advapi32.AllocateAndInitializeSid //sys createWellKnownSid(sidType WELL_KNOWN_SID_TYPE, domainSid *SID, sid *SID, sizeSid *uint32) (err error) = advapi32.CreateWellKnownSid //sys isWellKnownSid(sid *SID, sidType WELL_KNOWN_SID_TYPE) (isWellKnown bool) = advapi32.IsWellKnownSid //sys FreeSid(sid *SID) (err error) [failretval!=0] = advapi32.FreeSid //sys EqualSid(sid1 *SID, sid2 *SID) (isEqual bool) = advapi32.EqualSid //sys getSidIdentifierAuthority(sid *SID) (authority *SidIdentifierAuthority) = advapi32.GetSidIdentifierAuthority //sys getSidSubAuthorityCount(sid *SID) (count *uint8) = advapi32.GetSidSubAuthorityCount //sys getSidSubAuthority(sid *SID, index uint32) (subAuthority *uint32) = advapi32.GetSidSubAuthority //sys isValidSid(sid *SID) (isValid bool) = advapi32.IsValidSid // The security identifier (SID) structure is a variable-length // structure used to uniquely identify users or groups. type SID struct{} // StringToSid converts a string-format security identifier // SID into a valid, functional SID. func StringToSid(s string) (*SID, error) { var sid *SID p, e := UTF16PtrFromString(s) if e != nil { return nil, e } e = ConvertStringSidToSid(p, &sid) if e != nil { return nil, e } defer LocalFree((Handle)(unsafe.Pointer(sid))) return sid.Copy() } // LookupSID retrieves a security identifier SID for the account // and the name of the domain on which the account was found. // System specify target computer to search. func LookupSID(system, account string) (sid *SID, domain string, accType uint32, err error) { if len(account) == 0 { return nil, "", 0, syscall.EINVAL } acc, e := UTF16PtrFromString(account) if e != nil { return nil, "", 0, e } var sys *uint16 if len(system) > 0 { sys, e = UTF16PtrFromString(system) if e != nil { return nil, "", 0, e } } n := uint32(50) dn := uint32(50) for { b := make([]byte, n) db := make([]uint16, dn) sid = (*SID)(unsafe.Pointer(&b[0])) e = LookupAccountName(sys, acc, sid, &n, &db[0], &dn, &accType) if e == nil { return sid, UTF16ToString(db), accType, nil } if e != ERROR_INSUFFICIENT_BUFFER { return nil, "", 0, e } if n <= uint32(len(b)) { return nil, "", 0, e } } } // String converts SID to a string format suitable for display, storage, or transmission. func (sid *SID) String() string { var s *uint16 e := ConvertSidToStringSid(sid, &s) if e != nil { return "" } defer LocalFree((Handle)(unsafe.Pointer(s))) return UTF16ToString((*[256]uint16)(unsafe.Pointer(s))[:]) } // Len returns the length, in bytes, of a valid security identifier SID. func (sid *SID) Len() int { return int(GetLengthSid(sid)) } // Copy creates a duplicate of security identifier SID. func (sid *SID) Copy() (*SID, error) { b := make([]byte, sid.Len()) sid2 := (*SID)(unsafe.Pointer(&b[0])) e := CopySid(uint32(len(b)), sid2, sid) if e != nil { return nil, e } return sid2, nil } // IdentifierAuthority returns the identifier authority of the SID. func (sid *SID) IdentifierAuthority() SidIdentifierAuthority { return *getSidIdentifierAuthority(sid) } // SubAuthorityCount returns the number of sub-authorities in the SID. func (sid *SID) SubAuthorityCount() uint8 { return *getSidSubAuthorityCount(sid) } // SubAuthority returns the sub-authority of the SID as specified by // the index, which must be less than sid.SubAuthorityCount(). func (sid *SID) SubAuthority(idx uint32) uint32 { if idx >= uint32(sid.SubAuthorityCount()) { panic("sub-authority index out of range") } return *getSidSubAuthority(sid, idx) } // IsValid returns whether the SID has a valid revision and length. func (sid *SID) IsValid() bool { return isValidSid(sid) } // Equals compares two SIDs for equality. func (sid *SID) Equals(sid2 *SID) bool { return EqualSid(sid, sid2) } // IsWellKnown determines whether the SID matches the well-known sidType. func (sid *SID) IsWellKnown(sidType WELL_KNOWN_SID_TYPE) bool { return isWellKnownSid(sid, sidType) } // LookupAccount retrieves the name of the account for this SID // and the name of the first domain on which this SID is found. // System specify target computer to search for. func (sid *SID) LookupAccount(system string) (account, domain string, accType uint32, err error) { var sys *uint16 if len(system) > 0 { sys, err = UTF16PtrFromString(system) if err != nil { return "", "", 0, err } } n := uint32(50) dn := uint32(50) for { b := make([]uint16, n) db := make([]uint16, dn) e := LookupAccountSid(sys, sid, &b[0], &n, &db[0], &dn, &accType) if e == nil { return UTF16ToString(b), UTF16ToString(db), accType, nil } if e != ERROR_INSUFFICIENT_BUFFER { return "", "", 0, e } if n <= uint32(len(b)) { return "", "", 0, e } } } // Various types of pre-specified SIDs that can be synthesized and compared at runtime. type WELL_KNOWN_SID_TYPE uint32 const ( WinNullSid = 0 WinWorldSid = 1 WinLocalSid = 2 WinCreatorOwnerSid = 3 WinCreatorGroupSid = 4 WinCreatorOwnerServerSid = 5 WinCreatorGroupServerSid = 6 WinNtAuthoritySid = 7 WinDialupSid = 8 WinNetworkSid = 9 WinBatchSid = 10 WinInteractiveSid = 11 WinServiceSid = 12 WinAnonymousSid = 13 WinProxySid = 14 WinEnterpriseControllersSid = 15 WinSelfSid = 16 WinAuthenticatedUserSid = 17 WinRestrictedCodeSid = 18 WinTerminalServerSid = 19 WinRemoteLogonIdSid = 20 WinLogonIdsSid = 21 WinLocalSystemSid = 22 WinLocalServiceSid = 23 WinNetworkServiceSid = 24 WinBuiltinDomainSid = 25 WinBuiltinAdministratorsSid = 26 WinBuiltinUsersSid = 27 WinBuiltinGuestsSid = 28 WinBuiltinPowerUsersSid = 29 WinBuiltinAccountOperatorsSid = 30 WinBuiltinSystemOperatorsSid = 31 WinBuiltinPrintOperatorsSid = 32 WinBuiltinBackupOperatorsSid = 33 WinBuiltinReplicatorSid = 34 WinBuiltinPreWindows2000CompatibleAccessSid = 35 WinBuiltinRemoteDesktopUsersSid = 36 WinBuiltinNetworkConfigurationOperatorsSid = 37 WinAccountAdministratorSid = 38 WinAccountGuestSid = 39 WinAccountKrbtgtSid = 40 WinAccountDomainAdminsSid = 41 WinAccountDomainUsersSid = 42 WinAccountDomainGuestsSid = 43 WinAccountComputersSid = 44 WinAccountControllersSid = 45 WinAccountCertAdminsSid = 46 WinAccountSchemaAdminsSid = 47 WinAccountEnterpriseAdminsSid = 48 WinAccountPolicyAdminsSid = 49 WinAccountRasAndIasServersSid = 50 WinNTLMAuthenticationSid = 51 WinDigestAuthenticationSid = 52 WinSChannelAuthenticationSid = 53 WinThisOrganizationSid = 54 WinOtherOrganizationSid = 55 WinBuiltinIncomingForestTrustBuildersSid = 56 WinBuiltinPerfMonitoringUsersSid = 57 WinBuiltinPerfLoggingUsersSid = 58 WinBuiltinAuthorizationAccessSid = 59 WinBuiltinTerminalServerLicenseServersSid = 60 WinBuiltinDCOMUsersSid = 61 WinBuiltinIUsersSid = 62 WinIUserSid = 63 WinBuiltinCryptoOperatorsSid = 64 WinUntrustedLabelSid = 65 WinLowLabelSid = 66 WinMediumLabelSid = 67 WinHighLabelSid = 68 WinSystemLabelSid = 69 WinWriteRestrictedCodeSid = 70 WinCreatorOwnerRightsSid = 71 WinCacheablePrincipalsGroupSid = 72 WinNonCacheablePrincipalsGroupSid = 73 WinEnterpriseReadonlyControllersSid = 74 WinAccountReadonlyControllersSid = 75 WinBuiltinEventLogReadersGroup = 76 WinNewEnterpriseReadonlyControllersSid = 77 WinBuiltinCertSvcDComAccessGroup = 78 WinMediumPlusLabelSid = 79 WinLocalLogonSid = 80 WinConsoleLogonSid = 81 WinThisOrganizationCertificateSid = 82 WinApplicationPackageAuthoritySid = 83 WinBuiltinAnyPackageSid = 84 WinCapabilityInternetClientSid = 85 WinCapabilityInternetClientServerSid = 86 WinCapabilityPrivateNetworkClientServerSid = 87 WinCapabilityPicturesLibrarySid = 88 WinCapabilityVideosLibrarySid = 89 WinCapabilityMusicLibrarySid = 90 WinCapabilityDocumentsLibrarySid = 91 WinCapabilitySharedUserCertificatesSid = 92 WinCapabilityEnterpriseAuthenticationSid = 93 WinCapabilityRemovableStorageSid = 94 WinBuiltinRDSRemoteAccessServersSid = 95 WinBuiltinRDSEndpointServersSid = 96 WinBuiltinRDSManagementServersSid = 97 WinUserModeDriversSid = 98 WinBuiltinHyperVAdminsSid = 99 WinAccountCloneableControllersSid = 100 WinBuiltinAccessControlAssistanceOperatorsSid = 101 WinBuiltinRemoteManagementUsersSid = 102 WinAuthenticationAuthorityAssertedSid = 103 WinAuthenticationServiceAssertedSid = 104 WinLocalAccountSid = 105 WinLocalAccountAndAdministratorSid = 106 WinAccountProtectedUsersSid = 107 WinCapabilityAppointmentsSid = 108 WinCapabilityContactsSid = 109 WinAccountDefaultSystemManagedSid = 110 WinBuiltinDefaultSystemManagedGroupSid = 111 WinBuiltinStorageReplicaAdminsSid = 112 WinAccountKeyAdminsSid = 113 WinAccountEnterpriseKeyAdminsSid = 114 WinAuthenticationKeyTrustSid = 115 WinAuthenticationKeyPropertyMFASid = 116 WinAuthenticationKeyPropertyAttestationSid = 117 WinAuthenticationFreshKeyAuthSid = 118 WinBuiltinDeviceOwnersSid = 119 ) // Creates a SID for a well-known predefined alias, generally using the constants of the form // Win*Sid, for the local machine. func CreateWellKnownSid(sidType WELL_KNOWN_SID_TYPE) (*SID, error) { return CreateWellKnownDomainSid(sidType, nil) } // Creates a SID for a well-known predefined alias, generally using the constants of the form // Win*Sid, for the domain specified by the domainSid parameter. func CreateWellKnownDomainSid(sidType WELL_KNOWN_SID_TYPE, domainSid *SID) (*SID, error) { n := uint32(50) for { b := make([]byte, n) sid := (*SID)(unsafe.Pointer(&b[0])) err := createWellKnownSid(sidType, domainSid, sid, &n) if err == nil { return sid, nil } if err != ERROR_INSUFFICIENT_BUFFER { return nil, err } if n <= uint32(len(b)) { return nil, err } } } const ( // do not reorder TOKEN_ASSIGN_PRIMARY = 1 << iota TOKEN_DUPLICATE TOKEN_IMPERSONATE TOKEN_QUERY TOKEN_QUERY_SOURCE TOKEN_ADJUST_PRIVILEGES TOKEN_ADJUST_GROUPS TOKEN_ADJUST_DEFAULT TOKEN_ADJUST_SESSIONID TOKEN_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | TOKEN_ASSIGN_PRIMARY | TOKEN_DUPLICATE | TOKEN_IMPERSONATE | TOKEN_QUERY | TOKEN_QUERY_SOURCE | TOKEN_ADJUST_PRIVILEGES | TOKEN_ADJUST_GROUPS | TOKEN_ADJUST_DEFAULT | TOKEN_ADJUST_SESSIONID TOKEN_READ = STANDARD_RIGHTS_READ | TOKEN_QUERY TOKEN_WRITE = STANDARD_RIGHTS_WRITE | TOKEN_ADJUST_PRIVILEGES | TOKEN_ADJUST_GROUPS | TOKEN_ADJUST_DEFAULT TOKEN_EXECUTE = STANDARD_RIGHTS_EXECUTE ) const ( // do not reorder TokenUser = 1 + iota TokenGroups TokenPrivileges TokenOwner TokenPrimaryGroup TokenDefaultDacl TokenSource TokenType TokenImpersonationLevel TokenStatistics TokenRestrictedSids TokenSessionId TokenGroupsAndPrivileges TokenSessionReference TokenSandBoxInert TokenAuditPolicy TokenOrigin TokenElevationType TokenLinkedToken TokenElevation TokenHasRestrictions TokenAccessInformation TokenVirtualizationAllowed TokenVirtualizationEnabled TokenIntegrityLevel TokenUIAccess TokenMandatoryPolicy TokenLogonSid MaxTokenInfoClass ) // Group attributes inside of Tokengroups.Groups[i].Attributes const ( SE_GROUP_MANDATORY = 0x00000001 SE_GROUP_ENABLED_BY_DEFAULT = 0x00000002 SE_GROUP_ENABLED = 0x00000004 SE_GROUP_OWNER = 0x00000008 SE_GROUP_USE_FOR_DENY_ONLY = 0x00000010 SE_GROUP_INTEGRITY = 0x00000020 SE_GROUP_INTEGRITY_ENABLED = 0x00000040 SE_GROUP_LOGON_ID = 0xC0000000 SE_GROUP_RESOURCE = 0x20000000 SE_GROUP_VALID_ATTRIBUTES = SE_GROUP_MANDATORY | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_ENABLED | SE_GROUP_OWNER | SE_GROUP_USE_FOR_DENY_ONLY | SE_GROUP_LOGON_ID | SE_GROUP_RESOURCE | SE_GROUP_INTEGRITY | SE_GROUP_INTEGRITY_ENABLED ) // Privilege attributes const ( SE_PRIVILEGE_ENABLED_BY_DEFAULT = 0x00000001 SE_PRIVILEGE_ENABLED = 0x00000002 SE_PRIVILEGE_REMOVED = 0x00000004 SE_PRIVILEGE_USED_FOR_ACCESS = 0x80000000 SE_PRIVILEGE_VALID_ATTRIBUTES = SE_PRIVILEGE_ENABLED_BY_DEFAULT | SE_PRIVILEGE_ENABLED | SE_PRIVILEGE_REMOVED | SE_PRIVILEGE_USED_FOR_ACCESS ) // Token types const ( TokenPrimary = 1 TokenImpersonation = 2 ) // Impersonation levels const ( SecurityAnonymous = 0 SecurityIdentification = 1 SecurityImpersonation = 2 SecurityDelegation = 3 ) type LUID struct { LowPart uint32 HighPart int32 } type LUIDAndAttributes struct { Luid LUID Attributes uint32 } type SIDAndAttributes struct { Sid *SID Attributes uint32 } type Tokenuser struct { User SIDAndAttributes } type Tokenprimarygroup struct { PrimaryGroup *SID } type Tokengroups struct { GroupCount uint32 Groups [1]SIDAndAttributes // Use AllGroups() for iterating. } // AllGroups returns a slice that can be used to iterate over the groups in g. func (g *Tokengroups) AllGroups() []SIDAndAttributes { return (*[(1 << 28) - 1]SIDAndAttributes)(unsafe.Pointer(&g.Groups[0]))[:g.GroupCount:g.GroupCount] } type Tokenprivileges struct { PrivilegeCount uint32 Privileges [1]LUIDAndAttributes // Use AllPrivileges() for iterating. } // AllPrivileges returns a slice that can be used to iterate over the privileges in p. func (p *Tokenprivileges) AllPrivileges() []LUIDAndAttributes { return (*[(1 << 27) - 1]LUIDAndAttributes)(unsafe.Pointer(&p.Privileges[0]))[:p.PrivilegeCount:p.PrivilegeCount] } type Tokenmandatorylabel struct { Label SIDAndAttributes } func (tml *Tokenmandatorylabel) Size() uint32 { return uint32(unsafe.Sizeof(Tokenmandatorylabel{})) + GetLengthSid(tml.Label.Sid) } // Authorization Functions //sys checkTokenMembership(tokenHandle Token, sidToCheck *SID, isMember *int32) (err error) = advapi32.CheckTokenMembership //sys isTokenRestricted(tokenHandle Token) (ret bool, err error) [!failretval] = advapi32.IsTokenRestricted //sys OpenProcessToken(process Handle, access uint32, token *Token) (err error) = advapi32.OpenProcessToken //sys OpenThreadToken(thread Handle, access uint32, openAsSelf bool, token *Token) (err error) = advapi32.OpenThreadToken //sys ImpersonateSelf(impersonationlevel uint32) (err error) = advapi32.ImpersonateSelf //sys RevertToSelf() (err error) = advapi32.RevertToSelf //sys SetThreadToken(thread *Handle, token Token) (err error) = advapi32.SetThreadToken //sys LookupPrivilegeValue(systemname *uint16, name *uint16, luid *LUID) (err error) = advapi32.LookupPrivilegeValueW //sys AdjustTokenPrivileges(token Token, disableAllPrivileges bool, newstate *Tokenprivileges, buflen uint32, prevstate *Tokenprivileges, returnlen *uint32) (err error) = advapi32.AdjustTokenPrivileges //sys AdjustTokenGroups(token Token, resetToDefault bool, newstate *Tokengroups, buflen uint32, prevstate *Tokengroups, returnlen *uint32) (err error) = advapi32.AdjustTokenGroups //sys GetTokenInformation(token Token, infoClass uint32, info *byte, infoLen uint32, returnedLen *uint32) (err error) = advapi32.GetTokenInformation //sys SetTokenInformation(token Token, infoClass uint32, info *byte, infoLen uint32) (err error) = advapi32.SetTokenInformation //sys DuplicateTokenEx(existingToken Token, desiredAccess uint32, tokenAttributes *SecurityAttributes, impersonationLevel uint32, tokenType uint32, newToken *Token) (err error) = advapi32.DuplicateTokenEx //sys GetUserProfileDirectory(t Token, dir *uint16, dirLen *uint32) (err error) = userenv.GetUserProfileDirectoryW //sys getSystemDirectory(dir *uint16, dirLen uint32) (len uint32, err error) = kernel32.GetSystemDirectoryW //sys getWindowsDirectory(dir *uint16, dirLen uint32) (len uint32, err error) = kernel32.GetWindowsDirectoryW //sys getSystemWindowsDirectory(dir *uint16, dirLen uint32) (len uint32, err error) = kernel32.GetSystemWindowsDirectoryW // An access token contains the security information for a logon session. // The system creates an access token when a user logs on, and every // process executed on behalf of the user has a copy of the token. // The token identifies the user, the user's groups, and the user's // privileges. The system uses the token to control access to securable // objects and to control the ability of the user to perform various // system-related operations on the local computer. type Token Handle // OpenCurrentProcessToken opens an access token associated with current // process with TOKEN_QUERY access. It is a real token that needs to be closed. // // Deprecated: Explicitly call OpenProcessToken(CurrentProcess(), ...) // with the desired access instead, or use GetCurrentProcessToken for a // TOKEN_QUERY token. func OpenCurrentProcessToken() (Token, error) { var token Token err := OpenProcessToken(CurrentProcess(), TOKEN_QUERY, &token) return token, err } // GetCurrentProcessToken returns the access token associated with // the current process. It is a pseudo token that does not need // to be closed. func GetCurrentProcessToken() Token { return Token(^uintptr(4 - 1)) } // GetCurrentThreadToken return the access token associated with // the current thread. It is a pseudo token that does not need // to be closed. func GetCurrentThreadToken() Token { return Token(^uintptr(5 - 1)) } // GetCurrentThreadEffectiveToken returns the effective access token // associated with the current thread. It is a pseudo token that does // not need to be closed. func GetCurrentThreadEffectiveToken() Token { return Token(^uintptr(6 - 1)) } // Close releases access to access token. func (t Token) Close() error { return CloseHandle(Handle(t)) } // getInfo retrieves a specified type of information about an access token. func (t Token) getInfo(class uint32, initSize int) (unsafe.Pointer, error) { n := uint32(initSize) for { b := make([]byte, n) e := GetTokenInformation(t, class, &b[0], uint32(len(b)), &n) if e == nil { return unsafe.Pointer(&b[0]), nil } if e != ERROR_INSUFFICIENT_BUFFER { return nil, e } if n <= uint32(len(b)) { return nil, e } } } // GetTokenUser retrieves access token t user account information. func (t Token) GetTokenUser() (*Tokenuser, error) { i, e := t.getInfo(TokenUser, 50) if e != nil { return nil, e } return (*Tokenuser)(i), nil } // GetTokenGroups retrieves group accounts associated with access token t. func (t Token) GetTokenGroups() (*Tokengroups, error) { i, e := t.getInfo(TokenGroups, 50) if e != nil { return nil, e } return (*Tokengroups)(i), nil } // GetTokenPrimaryGroup retrieves access token t primary group information. // A pointer to a SID structure representing a group that will become // the primary group of any objects created by a process using this access token. func (t Token) GetTokenPrimaryGroup() (*Tokenprimarygroup, error) { i, e := t.getInfo(TokenPrimaryGroup, 50) if e != nil { return nil, e } return (*Tokenprimarygroup)(i), nil } // GetUserProfileDirectory retrieves path to the // root directory of the access token t user's profile. func (t Token) GetUserProfileDirectory() (string, error) { n := uint32(100) for { b := make([]uint16, n) e := GetUserProfileDirectory(t, &b[0], &n) if e == nil { return UTF16ToString(b), nil } if e != ERROR_INSUFFICIENT_BUFFER { return "", e } if n <= uint32(len(b)) { return "", e } } } // IsElevated returns whether the current token is elevated from a UAC perspective. func (token Token) IsElevated() bool { var isElevated uint32 var outLen uint32 err := GetTokenInformation(token, TokenElevation, (*byte)(unsafe.Pointer(&isElevated)), uint32(unsafe.Sizeof(isElevated)), &outLen) if err != nil { return false } return outLen == uint32(unsafe.Sizeof(isElevated)) && isElevated != 0 } // GetLinkedToken returns the linked token, which may be an elevated UAC token. func (token Token) GetLinkedToken() (Token, error) { var linkedToken Token var outLen uint32 err := GetTokenInformation(token, TokenLinkedToken, (*byte)(unsafe.Pointer(&linkedToken)), uint32(unsafe.Sizeof(linkedToken)), &outLen) if err != nil { return Token(0), err } return linkedToken, nil } // GetSystemDirectory retrieves the path to current location of the system // directory, which is typically, though not always, `C:\Windows\System32`. func GetSystemDirectory() (string, error) { n := uint32(MAX_PATH) for { b := make([]uint16, n) l, e := getSystemDirectory(&b[0], n) if e != nil { return "", e } if l <= n { return UTF16ToString(b[:l]), nil } n = l } } // GetWindowsDirectory retrieves the path to current location of the Windows // directory, which is typically, though not always, `C:\Windows`. This may // be a private user directory in the case that the application is running // under a terminal server. func GetWindowsDirectory() (string, error) { n := uint32(MAX_PATH) for { b := make([]uint16, n) l, e := getWindowsDirectory(&b[0], n) if e != nil { return "", e } if l <= n { return UTF16ToString(b[:l]), nil } n = l } } // GetSystemWindowsDirectory retrieves the path to current location of the // Windows directory, which is typically, though not always, `C:\Windows`. func GetSystemWindowsDirectory() (string, error) { n := uint32(MAX_PATH) for { b := make([]uint16, n) l, e := getSystemWindowsDirectory(&b[0], n) if e != nil { return "", e } if l <= n { return UTF16ToString(b[:l]), nil } n = l } } // IsMember reports whether the access token t is a member of the provided SID. func (t Token) IsMember(sid *SID) (bool, error) { var b int32 if e := checkTokenMembership(t, sid, &b); e != nil { return false, e } return b != 0, nil } // IsRestricted reports whether the access token t is a restricted token. func (t Token) IsRestricted() (isRestricted bool, err error) { isRestricted, err = isTokenRestricted(t) if !isRestricted && err == syscall.EINVAL { // If err is EINVAL, this returned ERROR_SUCCESS indicating a non-restricted token. err = nil } return } const ( WTS_CONSOLE_CONNECT = 0x1 WTS_CONSOLE_DISCONNECT = 0x2 WTS_REMOTE_CONNECT = 0x3 WTS_REMOTE_DISCONNECT = 0x4 WTS_SESSION_LOGON = 0x5 WTS_SESSION_LOGOFF = 0x6 WTS_SESSION_LOCK = 0x7 WTS_SESSION_UNLOCK = 0x8 WTS_SESSION_REMOTE_CONTROL = 0x9 WTS_SESSION_CREATE = 0xa WTS_SESSION_TERMINATE = 0xb ) const ( WTSActive = 0 WTSConnected = 1 WTSConnectQuery = 2 WTSShadow = 3 WTSDisconnected = 4 WTSIdle = 5 WTSListen = 6 WTSReset = 7 WTSDown = 8 WTSInit = 9 ) type WTSSESSION_NOTIFICATION struct { Size uint32 SessionID uint32 } type WTS_SESSION_INFO struct { SessionID uint32 WindowStationName *uint16 State uint32 } //sys WTSQueryUserToken(session uint32, token *Token) (err error) = wtsapi32.WTSQueryUserToken //sys WTSEnumerateSessions(handle Handle, reserved uint32, version uint32, sessions **WTS_SESSION_INFO, count *uint32) (err error) = wtsapi32.WTSEnumerateSessionsW //sys WTSFreeMemory(ptr uintptr) = wtsapi32.WTSFreeMemory //sys WTSGetActiveConsoleSessionId() (sessionID uint32) type ACL struct { aclRevision byte sbz1 byte aclSize uint16 AceCount uint16 sbz2 uint16 } type SECURITY_DESCRIPTOR struct { revision byte sbz1 byte control SECURITY_DESCRIPTOR_CONTROL owner *SID group *SID sacl *ACL dacl *ACL } type SECURITY_QUALITY_OF_SERVICE struct { Length uint32 ImpersonationLevel uint32 ContextTrackingMode byte EffectiveOnly byte } // Constants for the ContextTrackingMode field of SECURITY_QUALITY_OF_SERVICE. const ( SECURITY_STATIC_TRACKING = 0 SECURITY_DYNAMIC_TRACKING = 1 ) type SecurityAttributes struct { Length uint32 SecurityDescriptor *SECURITY_DESCRIPTOR InheritHandle uint32 } type SE_OBJECT_TYPE uint32 // Constants for type SE_OBJECT_TYPE const ( SE_UNKNOWN_OBJECT_TYPE = 0 SE_FILE_OBJECT = 1 SE_SERVICE = 2 SE_PRINTER = 3 SE_REGISTRY_KEY = 4 SE_LMSHARE = 5 SE_KERNEL_OBJECT = 6 SE_WINDOW_OBJECT = 7 SE_DS_OBJECT = 8 SE_DS_OBJECT_ALL = 9 SE_PROVIDER_DEFINED_OBJECT = 10 SE_WMIGUID_OBJECT = 11 SE_REGISTRY_WOW64_32KEY = 12 SE_REGISTRY_WOW64_64KEY = 13 ) type SECURITY_INFORMATION uint32 // Constants for type SECURITY_INFORMATION const ( OWNER_SECURITY_INFORMATION = 0x00000001 GROUP_SECURITY_INFORMATION = 0x00000002 DACL_SECURITY_INFORMATION = 0x00000004 SACL_SECURITY_INFORMATION = 0x00000008 LABEL_SECURITY_INFORMATION = 0x00000010 ATTRIBUTE_SECURITY_INFORMATION = 0x00000020 SCOPE_SECURITY_INFORMATION = 0x00000040 BACKUP_SECURITY_INFORMATION = 0x00010000 PROTECTED_DACL_SECURITY_INFORMATION = 0x80000000 PROTECTED_SACL_SECURITY_INFORMATION = 0x40000000 UNPROTECTED_DACL_SECURITY_INFORMATION = 0x20000000 UNPROTECTED_SACL_SECURITY_INFORMATION = 0x10000000 ) type SECURITY_DESCRIPTOR_CONTROL uint16 // Constants for type SECURITY_DESCRIPTOR_CONTROL const ( SE_OWNER_DEFAULTED = 0x0001 SE_GROUP_DEFAULTED = 0x0002 SE_DACL_PRESENT = 0x0004 SE_DACL_DEFAULTED = 0x0008 SE_SACL_PRESENT = 0x0010 SE_SACL_DEFAULTED = 0x0020 SE_DACL_AUTO_INHERIT_REQ = 0x0100 SE_SACL_AUTO_INHERIT_REQ = 0x0200 SE_DACL_AUTO_INHERITED = 0x0400 SE_SACL_AUTO_INHERITED = 0x0800 SE_DACL_PROTECTED = 0x1000 SE_SACL_PROTECTED = 0x2000 SE_RM_CONTROL_VALID = 0x4000 SE_SELF_RELATIVE = 0x8000 ) type ACCESS_MASK uint32 // Constants for type ACCESS_MASK const ( DELETE = 0x00010000 READ_CONTROL = 0x00020000 WRITE_DAC = 0x00040000 WRITE_OWNER = 0x00080000 SYNCHRONIZE = 0x00100000 STANDARD_RIGHTS_REQUIRED = 0x000F0000 STANDARD_RIGHTS_READ = READ_CONTROL STANDARD_RIGHTS_WRITE = READ_CONTROL STANDARD_RIGHTS_EXECUTE = READ_CONTROL STANDARD_RIGHTS_ALL = 0x001F0000 SPECIFIC_RIGHTS_ALL = 0x0000FFFF ACCESS_SYSTEM_SECURITY = 0x01000000 MAXIMUM_ALLOWED = 0x02000000 GENERIC_READ = 0x80000000 GENERIC_WRITE = 0x40000000 GENERIC_EXECUTE = 0x20000000 GENERIC_ALL = 0x10000000 ) type ACCESS_MODE uint32 // Constants for type ACCESS_MODE const ( NOT_USED_ACCESS = 0 GRANT_ACCESS = 1 SET_ACCESS = 2 DENY_ACCESS = 3 REVOKE_ACCESS = 4 SET_AUDIT_SUCCESS = 5 SET_AUDIT_FAILURE = 6 ) // Constants for AceFlags and Inheritance fields const ( NO_INHERITANCE = 0x0 SUB_OBJECTS_ONLY_INHERIT = 0x1 SUB_CONTAINERS_ONLY_INHERIT = 0x2 SUB_CONTAINERS_AND_OBJECTS_INHERIT = 0x3 INHERIT_NO_PROPAGATE = 0x4 INHERIT_ONLY = 0x8 INHERITED_ACCESS_ENTRY = 0x10 INHERITED_PARENT = 0x10000000 INHERITED_GRANDPARENT = 0x20000000 OBJECT_INHERIT_ACE = 0x1 CONTAINER_INHERIT_ACE = 0x2 NO_PROPAGATE_INHERIT_ACE = 0x4 INHERIT_ONLY_ACE = 0x8 INHERITED_ACE = 0x10 VALID_INHERIT_FLAGS = 0x1F ) type MULTIPLE_TRUSTEE_OPERATION uint32 // Constants for MULTIPLE_TRUSTEE_OPERATION const ( NO_MULTIPLE_TRUSTEE = 0 TRUSTEE_IS_IMPERSONATE = 1 ) type TRUSTEE_FORM uint32 // Constants for TRUSTEE_FORM const ( TRUSTEE_IS_SID = 0 TRUSTEE_IS_NAME = 1 TRUSTEE_BAD_FORM = 2 TRUSTEE_IS_OBJECTS_AND_SID = 3 TRUSTEE_IS_OBJECTS_AND_NAME = 4 ) type TRUSTEE_TYPE uint32 // Constants for TRUSTEE_TYPE const ( TRUSTEE_IS_UNKNOWN = 0 TRUSTEE_IS_USER = 1 TRUSTEE_IS_GROUP = 2 TRUSTEE_IS_DOMAIN = 3 TRUSTEE_IS_ALIAS = 4 TRUSTEE_IS_WELL_KNOWN_GROUP = 5 TRUSTEE_IS_DELETED = 6 TRUSTEE_IS_INVALID = 7 TRUSTEE_IS_COMPUTER = 8 ) // Constants for ObjectsPresent field const ( ACE_OBJECT_TYPE_PRESENT = 0x1 ACE_INHERITED_OBJECT_TYPE_PRESENT = 0x2 ) type EXPLICIT_ACCESS struct { AccessPermissions ACCESS_MASK AccessMode ACCESS_MODE Inheritance uint32 Trustee TRUSTEE } // https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-ace_header type ACE_HEADER struct { AceType uint8 AceFlags uint8 AceSize uint16 } // https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-access_allowed_ace type ACCESS_ALLOWED_ACE struct { Header ACE_HEADER Mask ACCESS_MASK SidStart uint32 } const ( // Constants for AceType // https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-ace_header ACCESS_ALLOWED_ACE_TYPE = 0 ACCESS_DENIED_ACE_TYPE = 1 ) // This type is the union inside of TRUSTEE and must be created using one of the TrusteeValueFrom* functions. type TrusteeValue uintptr func TrusteeValueFromString(str string) TrusteeValue { return TrusteeValue(unsafe.Pointer(StringToUTF16Ptr(str))) } func TrusteeValueFromSID(sid *SID) TrusteeValue { return TrusteeValue(unsafe.Pointer(sid)) } func TrusteeValueFromObjectsAndSid(objectsAndSid *OBJECTS_AND_SID) TrusteeValue { return TrusteeValue(unsafe.Pointer(objectsAndSid)) } func TrusteeValueFromObjectsAndName(objectsAndName *OBJECTS_AND_NAME) TrusteeValue { return TrusteeValue(unsafe.Pointer(objectsAndName)) } type TRUSTEE struct { MultipleTrustee *TRUSTEE MultipleTrusteeOperation MULTIPLE_TRUSTEE_OPERATION TrusteeForm TRUSTEE_FORM TrusteeType TRUSTEE_TYPE TrusteeValue TrusteeValue } type OBJECTS_AND_SID struct { ObjectsPresent uint32 ObjectTypeGuid GUID InheritedObjectTypeGuid GUID Sid *SID } type OBJECTS_AND_NAME struct { ObjectsPresent uint32 ObjectType SE_OBJECT_TYPE ObjectTypeName *uint16 InheritedObjectTypeName *uint16 Name *uint16 } //sys getSecurityInfo(handle Handle, objectType SE_OBJECT_TYPE, securityInformation SECURITY_INFORMATION, owner **SID, group **SID, dacl **ACL, sacl **ACL, sd **SECURITY_DESCRIPTOR) (ret error) = advapi32.GetSecurityInfo //sys SetSecurityInfo(handle Handle, objectType SE_OBJECT_TYPE, securityInformation SECURITY_INFORMATION, owner *SID, group *SID, dacl *ACL, sacl *ACL) (ret error) = advapi32.SetSecurityInfo //sys getNamedSecurityInfo(objectName string, objectType SE_OBJECT_TYPE, securityInformation SECURITY_INFORMATION, owner **SID, group **SID, dacl **ACL, sacl **ACL, sd **SECURITY_DESCRIPTOR) (ret error) = advapi32.GetNamedSecurityInfoW //sys SetNamedSecurityInfo(objectName string, objectType SE_OBJECT_TYPE, securityInformation SECURITY_INFORMATION, owner *SID, group *SID, dacl *ACL, sacl *ACL) (ret error) = advapi32.SetNamedSecurityInfoW //sys SetKernelObjectSecurity(handle Handle, securityInformation SECURITY_INFORMATION, securityDescriptor *SECURITY_DESCRIPTOR) (err error) = advapi32.SetKernelObjectSecurity //sys buildSecurityDescriptor(owner *TRUSTEE, group *TRUSTEE, countAccessEntries uint32, accessEntries *EXPLICIT_ACCESS, countAuditEntries uint32, auditEntries *EXPLICIT_ACCESS, oldSecurityDescriptor *SECURITY_DESCRIPTOR, sizeNewSecurityDescriptor *uint32, newSecurityDescriptor **SECURITY_DESCRIPTOR) (ret error) = advapi32.BuildSecurityDescriptorW //sys initializeSecurityDescriptor(absoluteSD *SECURITY_DESCRIPTOR, revision uint32) (err error) = advapi32.InitializeSecurityDescriptor //sys getSecurityDescriptorControl(sd *SECURITY_DESCRIPTOR, control *SECURITY_DESCRIPTOR_CONTROL, revision *uint32) (err error) = advapi32.GetSecurityDescriptorControl //sys getSecurityDescriptorDacl(sd *SECURITY_DESCRIPTOR, daclPresent *bool, dacl **ACL, daclDefaulted *bool) (err error) = advapi32.GetSecurityDescriptorDacl //sys getSecurityDescriptorSacl(sd *SECURITY_DESCRIPTOR, saclPresent *bool, sacl **ACL, saclDefaulted *bool) (err error) = advapi32.GetSecurityDescriptorSacl //sys getSecurityDescriptorOwner(sd *SECURITY_DESCRIPTOR, owner **SID, ownerDefaulted *bool) (err error) = advapi32.GetSecurityDescriptorOwner //sys getSecurityDescriptorGroup(sd *SECURITY_DESCRIPTOR, group **SID, groupDefaulted *bool) (err error) = advapi32.GetSecurityDescriptorGroup //sys getSecurityDescriptorLength(sd *SECURITY_DESCRIPTOR) (len uint32) = advapi32.GetSecurityDescriptorLength //sys getSecurityDescriptorRMControl(sd *SECURITY_DESCRIPTOR, rmControl *uint8) (ret error) [failretval!=0] = advapi32.GetSecurityDescriptorRMControl //sys isValidSecurityDescriptor(sd *SECURITY_DESCRIPTOR) (isValid bool) = advapi32.IsValidSecurityDescriptor //sys setSecurityDescriptorControl(sd *SECURITY_DESCRIPTOR, controlBitsOfInterest SECURITY_DESCRIPTOR_CONTROL, controlBitsToSet SECURITY_DESCRIPTOR_CONTROL) (err error) = advapi32.SetSecurityDescriptorControl //sys setSecurityDescriptorDacl(sd *SECURITY_DESCRIPTOR, daclPresent bool, dacl *ACL, daclDefaulted bool) (err error) = advapi32.SetSecurityDescriptorDacl //sys setSecurityDescriptorSacl(sd *SECURITY_DESCRIPTOR, saclPresent bool, sacl *ACL, saclDefaulted bool) (err error) = advapi32.SetSecurityDescriptorSacl //sys setSecurityDescriptorOwner(sd *SECURITY_DESCRIPTOR, owner *SID, ownerDefaulted bool) (err error) = advapi32.SetSecurityDescriptorOwner //sys setSecurityDescriptorGroup(sd *SECURITY_DESCRIPTOR, group *SID, groupDefaulted bool) (err error) = advapi32.SetSecurityDescriptorGroup //sys setSecurityDescriptorRMControl(sd *SECURITY_DESCRIPTOR, rmControl *uint8) = advapi32.SetSecurityDescriptorRMControl //sys convertStringSecurityDescriptorToSecurityDescriptor(str string, revision uint32, sd **SECURITY_DESCRIPTOR, size *uint32) (err error) = advapi32.ConvertStringSecurityDescriptorToSecurityDescriptorW //sys convertSecurityDescriptorToStringSecurityDescriptor(sd *SECURITY_DESCRIPTOR, revision uint32, securityInformation SECURITY_INFORMATION, str **uint16, strLen *uint32) (err error) = advapi32.ConvertSecurityDescriptorToStringSecurityDescriptorW //sys makeAbsoluteSD(selfRelativeSD *SECURITY_DESCRIPTOR, absoluteSD *SECURITY_DESCRIPTOR, absoluteSDSize *uint32, dacl *ACL, daclSize *uint32, sacl *ACL, saclSize *uint32, owner *SID, ownerSize *uint32, group *SID, groupSize *uint32) (err error) = advapi32.MakeAbsoluteSD //sys makeSelfRelativeSD(absoluteSD *SECURITY_DESCRIPTOR, selfRelativeSD *SECURITY_DESCRIPTOR, selfRelativeSDSize *uint32) (err error) = advapi32.MakeSelfRelativeSD //sys setEntriesInAcl(countExplicitEntries uint32, explicitEntries *EXPLICIT_ACCESS, oldACL *ACL, newACL **ACL) (ret error) = advapi32.SetEntriesInAclW //sys GetAce(acl *ACL, aceIndex uint32, pAce **ACCESS_ALLOWED_ACE) (err error) = advapi32.GetAce // Control returns the security descriptor control bits. func (sd *SECURITY_DESCRIPTOR) Control() (control SECURITY_DESCRIPTOR_CONTROL, revision uint32, err error) { err = getSecurityDescriptorControl(sd, &control, &revision) return } // SetControl sets the security descriptor control bits. func (sd *SECURITY_DESCRIPTOR) SetControl(controlBitsOfInterest SECURITY_DESCRIPTOR_CONTROL, controlBitsToSet SECURITY_DESCRIPTOR_CONTROL) error { return setSecurityDescriptorControl(sd, controlBitsOfInterest, controlBitsToSet) } // RMControl returns the security descriptor resource manager control bits. func (sd *SECURITY_DESCRIPTOR) RMControl() (control uint8, err error) { err = getSecurityDescriptorRMControl(sd, &control) return } // SetRMControl sets the security descriptor resource manager control bits. func (sd *SECURITY_DESCRIPTOR) SetRMControl(rmControl uint8) { setSecurityDescriptorRMControl(sd, &rmControl) } // DACL returns the security descriptor DACL and whether it was defaulted. The dacl return value may be nil // if a DACL exists but is an "empty DACL", meaning fully permissive. If the DACL does not exist, err returns // ERROR_OBJECT_NOT_FOUND. func (sd *SECURITY_DESCRIPTOR) DACL() (dacl *ACL, defaulted bool, err error) { var present bool err = getSecurityDescriptorDacl(sd, &present, &dacl, &defaulted) if !present { err = ERROR_OBJECT_NOT_FOUND } return } // SetDACL sets the absolute security descriptor DACL. func (absoluteSD *SECURITY_DESCRIPTOR) SetDACL(dacl *ACL, present, defaulted bool) error { return setSecurityDescriptorDacl(absoluteSD, present, dacl, defaulted) } // SACL returns the security descriptor SACL and whether it was defaulted. The sacl return value may be nil // if a SACL exists but is an "empty SACL", meaning fully permissive. If the SACL does not exist, err returns // ERROR_OBJECT_NOT_FOUND. func (sd *SECURITY_DESCRIPTOR) SACL() (sacl *ACL, defaulted bool, err error) { var present bool err = getSecurityDescriptorSacl(sd, &present, &sacl, &defaulted) if !present { err = ERROR_OBJECT_NOT_FOUND } return } // SetSACL sets the absolute security descriptor SACL. func (absoluteSD *SECURITY_DESCRIPTOR) SetSACL(sacl *ACL, present, defaulted bool) error { return setSecurityDescriptorSacl(absoluteSD, present, sacl, defaulted) } // Owner returns the security descriptor owner and whether it was defaulted. func (sd *SECURITY_DESCRIPTOR) Owner() (owner *SID, defaulted bool, err error) { err = getSecurityDescriptorOwner(sd, &owner, &defaulted) return } // SetOwner sets the absolute security descriptor owner. func (absoluteSD *SECURITY_DESCRIPTOR) SetOwner(owner *SID, defaulted bool) error { return setSecurityDescriptorOwner(absoluteSD, owner, defaulted) } // Group returns the security descriptor group and whether it was defaulted. func (sd *SECURITY_DESCRIPTOR) Group() (group *SID, defaulted bool, err error) { err = getSecurityDescriptorGroup(sd, &group, &defaulted) return } // SetGroup sets the absolute security descriptor owner. func (absoluteSD *SECURITY_DESCRIPTOR) SetGroup(group *SID, defaulted bool) error { return setSecurityDescriptorGroup(absoluteSD, group, defaulted) } // Length returns the length of the security descriptor. func (sd *SECURITY_DESCRIPTOR) Length() uint32 { return getSecurityDescriptorLength(sd) } // IsValid returns whether the security descriptor is valid. func (sd *SECURITY_DESCRIPTOR) IsValid() bool { return isValidSecurityDescriptor(sd) } // String returns the SDDL form of the security descriptor, with a function signature that can be // used with %v formatting directives. func (sd *SECURITY_DESCRIPTOR) String() string { var sddl *uint16 err := convertSecurityDescriptorToStringSecurityDescriptor(sd, 1, 0xff, &sddl, nil) if err != nil { return "" } defer LocalFree(Handle(unsafe.Pointer(sddl))) return UTF16PtrToString(sddl) } // ToAbsolute converts a self-relative security descriptor into an absolute one. func (selfRelativeSD *SECURITY_DESCRIPTOR) ToAbsolute() (absoluteSD *SECURITY_DESCRIPTOR, err error) { control, _, err := selfRelativeSD.Control() if err != nil { return } if control&SE_SELF_RELATIVE == 0 { err = ERROR_INVALID_PARAMETER return } var absoluteSDSize, daclSize, saclSize, ownerSize, groupSize uint32 err = makeAbsoluteSD(selfRelativeSD, nil, &absoluteSDSize, nil, &daclSize, nil, &saclSize, nil, &ownerSize, nil, &groupSize) switch err { case ERROR_INSUFFICIENT_BUFFER: case nil: // makeAbsoluteSD is expected to fail, but it succeeds. return nil, ERROR_INTERNAL_ERROR default: return nil, err } if absoluteSDSize > 0 { absoluteSD = new(SECURITY_DESCRIPTOR) if unsafe.Sizeof(*absoluteSD) < uintptr(absoluteSDSize) { panic("sizeof(SECURITY_DESCRIPTOR) too small") } } var ( dacl *ACL sacl *ACL owner *SID group *SID ) if daclSize > 0 { dacl = (*ACL)(unsafe.Pointer(unsafe.SliceData(make([]byte, daclSize)))) } if saclSize > 0 { sacl = (*ACL)(unsafe.Pointer(unsafe.SliceData(make([]byte, saclSize)))) } if ownerSize > 0 { owner = (*SID)(unsafe.Pointer(unsafe.SliceData(make([]byte, ownerSize)))) } if groupSize > 0 { group = (*SID)(unsafe.Pointer(unsafe.SliceData(make([]byte, groupSize)))) } // We call into Windows via makeAbsoluteSD, which sets up // pointers within absoluteSD that point to other chunks of memory // we pass into makeAbsoluteSD, and that happens outside the view of the GC. // We therefore take some care here to then verify the pointers are as we expect // and set them explicitly in view of the GC. See https://go.dev/issue/73199. // TODO: consider weak pointers once Go 1.24 is appropriate. See suggestion in https://go.dev/cl/663575. err = makeAbsoluteSD(selfRelativeSD, absoluteSD, &absoluteSDSize, dacl, &daclSize, sacl, &saclSize, owner, &ownerSize, group, &groupSize) if err != nil { // Don't return absoluteSD, which might be partially initialized. return nil, err } // Before using any fields, verify absoluteSD is in the format we expect according to Windows. // See https://learn.microsoft.com/en-us/windows/win32/secauthz/absolute-and-self-relative-security-descriptors absControl, _, err := absoluteSD.Control() if err != nil { panic("absoluteSD: " + err.Error()) } if absControl&SE_SELF_RELATIVE != 0 { panic("absoluteSD not in absolute format") } if absoluteSD.dacl != dacl { panic("dacl pointer mismatch") } if absoluteSD.sacl != sacl { panic("sacl pointer mismatch") } if absoluteSD.owner != owner { panic("owner pointer mismatch") } if absoluteSD.group != group { panic("group pointer mismatch") } absoluteSD.dacl = dacl absoluteSD.sacl = sacl absoluteSD.owner = owner absoluteSD.group = group return } // ToSelfRelative converts an absolute security descriptor into a self-relative one. func (absoluteSD *SECURITY_DESCRIPTOR) ToSelfRelative() (selfRelativeSD *SECURITY_DESCRIPTOR, err error) { control, _, err := absoluteSD.Control() if err != nil { return } if control&SE_SELF_RELATIVE != 0 { err = ERROR_INVALID_PARAMETER return } var selfRelativeSDSize uint32 err = makeSelfRelativeSD(absoluteSD, nil, &selfRelativeSDSize) switch err { case ERROR_INSUFFICIENT_BUFFER: case nil: // makeSelfRelativeSD is expected to fail, but it succeeds. return nil, ERROR_INTERNAL_ERROR default: return nil, err } if selfRelativeSDSize > 0 { selfRelativeSD = (*SECURITY_DESCRIPTOR)(unsafe.Pointer(&make([]byte, selfRelativeSDSize)[0])) } err = makeSelfRelativeSD(absoluteSD, selfRelativeSD, &selfRelativeSDSize) return } func (selfRelativeSD *SECURITY_DESCRIPTOR) copySelfRelativeSecurityDescriptor() *SECURITY_DESCRIPTOR { sdLen := int(selfRelativeSD.Length()) const min = int(unsafe.Sizeof(SECURITY_DESCRIPTOR{})) if sdLen < min { sdLen = min } src := unsafe.Slice((*byte)(unsafe.Pointer(selfRelativeSD)), sdLen) // SECURITY_DESCRIPTOR has pointers in it, which means checkptr expects for it to // be aligned properly. When we're copying a Windows-allocated struct to a // Go-allocated one, make sure that the Go allocation is aligned to the // pointer size. const psize = int(unsafe.Sizeof(uintptr(0))) alloc := make([]uintptr, (sdLen+psize-1)/psize) dst := unsafe.Slice((*byte)(unsafe.Pointer(&alloc[0])), sdLen) copy(dst, src) return (*SECURITY_DESCRIPTOR)(unsafe.Pointer(&dst[0])) } // SecurityDescriptorFromString converts an SDDL string describing a security descriptor into a // self-relative security descriptor object allocated on the Go heap. func SecurityDescriptorFromString(sddl string) (sd *SECURITY_DESCRIPTOR, err error) { var winHeapSD *SECURITY_DESCRIPTOR err = convertStringSecurityDescriptorToSecurityDescriptor(sddl, 1, &winHeapSD, nil) if err != nil { return } defer LocalFree(Handle(unsafe.Pointer(winHeapSD))) return winHeapSD.copySelfRelativeSecurityDescriptor(), nil } // GetSecurityInfo queries the security information for a given handle and returns the self-relative security // descriptor result on the Go heap. func GetSecurityInfo(handle Handle, objectType SE_OBJECT_TYPE, securityInformation SECURITY_INFORMATION) (sd *SECURITY_DESCRIPTOR, err error) { var winHeapSD *SECURITY_DESCRIPTOR err = getSecurityInfo(handle, objectType, securityInformation, nil, nil, nil, nil, &winHeapSD) if err != nil { return } defer LocalFree(Handle(unsafe.Pointer(winHeapSD))) return winHeapSD.copySelfRelativeSecurityDescriptor(), nil } // GetNamedSecurityInfo queries the security information for a given named object and returns the self-relative security // descriptor result on the Go heap. func GetNamedSecurityInfo(objectName string, objectType SE_OBJECT_TYPE, securityInformation SECURITY_INFORMATION) (sd *SECURITY_DESCRIPTOR, err error) { var winHeapSD *SECURITY_DESCRIPTOR err = getNamedSecurityInfo(objectName, objectType, securityInformation, nil, nil, nil, nil, &winHeapSD) if err != nil { return } defer LocalFree(Handle(unsafe.Pointer(winHeapSD))) return winHeapSD.copySelfRelativeSecurityDescriptor(), nil } // BuildSecurityDescriptor makes a new security descriptor using the input trustees, explicit access lists, and // prior security descriptor to be merged, any of which can be nil, returning the self-relative security descriptor // result on the Go heap. func BuildSecurityDescriptor(owner *TRUSTEE, group *TRUSTEE, accessEntries []EXPLICIT_ACCESS, auditEntries []EXPLICIT_ACCESS, mergedSecurityDescriptor *SECURITY_DESCRIPTOR) (sd *SECURITY_DESCRIPTOR, err error) { var winHeapSD *SECURITY_DESCRIPTOR var winHeapSDSize uint32 var firstAccessEntry *EXPLICIT_ACCESS if len(accessEntries) > 0 { firstAccessEntry = &accessEntries[0] } var firstAuditEntry *EXPLICIT_ACCESS if len(auditEntries) > 0 { firstAuditEntry = &auditEntries[0] } err = buildSecurityDescriptor(owner, group, uint32(len(accessEntries)), firstAccessEntry, uint32(len(auditEntries)), firstAuditEntry, mergedSecurityDescriptor, &winHeapSDSize, &winHeapSD) if err != nil { return } defer LocalFree(Handle(unsafe.Pointer(winHeapSD))) return winHeapSD.copySelfRelativeSecurityDescriptor(), nil } // NewSecurityDescriptor creates and initializes a new absolute security descriptor. func NewSecurityDescriptor() (absoluteSD *SECURITY_DESCRIPTOR, err error) { absoluteSD = &SECURITY_DESCRIPTOR{} err = initializeSecurityDescriptor(absoluteSD, 1) return } // ACLFromEntries returns a new ACL on the Go heap containing a list of explicit entries as well as those of another ACL. // Both explicitEntries and mergedACL are optional and can be nil. func ACLFromEntries(explicitEntries []EXPLICIT_ACCESS, mergedACL *ACL) (acl *ACL, err error) { var firstExplicitEntry *EXPLICIT_ACCESS if len(explicitEntries) > 0 { firstExplicitEntry = &explicitEntries[0] } var winHeapACL *ACL err = setEntriesInAcl(uint32(len(explicitEntries)), firstExplicitEntry, mergedACL, &winHeapACL) if err != nil { return } defer LocalFree(Handle(unsafe.Pointer(winHeapACL))) aclBytes := make([]byte, winHeapACL.aclSize) copy(aclBytes, (*[(1 << 31) - 1]byte)(unsafe.Pointer(winHeapACL))[:len(aclBytes):len(aclBytes)]) return (*ACL)(unsafe.Pointer(&aclBytes[0])), nil } ================================================ FILE: vendor/golang.org/x/sys/windows/service.go ================================================ // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build windows package windows const ( SC_MANAGER_CONNECT = 1 SC_MANAGER_CREATE_SERVICE = 2 SC_MANAGER_ENUMERATE_SERVICE = 4 SC_MANAGER_LOCK = 8 SC_MANAGER_QUERY_LOCK_STATUS = 16 SC_MANAGER_MODIFY_BOOT_CONFIG = 32 SC_MANAGER_ALL_ACCESS = 0xf003f ) const ( SERVICE_KERNEL_DRIVER = 1 SERVICE_FILE_SYSTEM_DRIVER = 2 SERVICE_ADAPTER = 4 SERVICE_RECOGNIZER_DRIVER = 8 SERVICE_WIN32_OWN_PROCESS = 16 SERVICE_WIN32_SHARE_PROCESS = 32 SERVICE_WIN32 = SERVICE_WIN32_OWN_PROCESS | SERVICE_WIN32_SHARE_PROCESS SERVICE_INTERACTIVE_PROCESS = 256 SERVICE_DRIVER = SERVICE_KERNEL_DRIVER | SERVICE_FILE_SYSTEM_DRIVER | SERVICE_RECOGNIZER_DRIVER SERVICE_TYPE_ALL = SERVICE_WIN32 | SERVICE_ADAPTER | SERVICE_DRIVER | SERVICE_INTERACTIVE_PROCESS SERVICE_BOOT_START = 0 SERVICE_SYSTEM_START = 1 SERVICE_AUTO_START = 2 SERVICE_DEMAND_START = 3 SERVICE_DISABLED = 4 SERVICE_ERROR_IGNORE = 0 SERVICE_ERROR_NORMAL = 1 SERVICE_ERROR_SEVERE = 2 SERVICE_ERROR_CRITICAL = 3 SC_STATUS_PROCESS_INFO = 0 SC_ACTION_NONE = 0 SC_ACTION_RESTART = 1 SC_ACTION_REBOOT = 2 SC_ACTION_RUN_COMMAND = 3 SERVICE_STOPPED = 1 SERVICE_START_PENDING = 2 SERVICE_STOP_PENDING = 3 SERVICE_RUNNING = 4 SERVICE_CONTINUE_PENDING = 5 SERVICE_PAUSE_PENDING = 6 SERVICE_PAUSED = 7 SERVICE_NO_CHANGE = 0xffffffff SERVICE_ACCEPT_STOP = 1 SERVICE_ACCEPT_PAUSE_CONTINUE = 2 SERVICE_ACCEPT_SHUTDOWN = 4 SERVICE_ACCEPT_PARAMCHANGE = 8 SERVICE_ACCEPT_NETBINDCHANGE = 16 SERVICE_ACCEPT_HARDWAREPROFILECHANGE = 32 SERVICE_ACCEPT_POWEREVENT = 64 SERVICE_ACCEPT_SESSIONCHANGE = 128 SERVICE_ACCEPT_PRESHUTDOWN = 256 SERVICE_CONTROL_STOP = 1 SERVICE_CONTROL_PAUSE = 2 SERVICE_CONTROL_CONTINUE = 3 SERVICE_CONTROL_INTERROGATE = 4 SERVICE_CONTROL_SHUTDOWN = 5 SERVICE_CONTROL_PARAMCHANGE = 6 SERVICE_CONTROL_NETBINDADD = 7 SERVICE_CONTROL_NETBINDREMOVE = 8 SERVICE_CONTROL_NETBINDENABLE = 9 SERVICE_CONTROL_NETBINDDISABLE = 10 SERVICE_CONTROL_DEVICEEVENT = 11 SERVICE_CONTROL_HARDWAREPROFILECHANGE = 12 SERVICE_CONTROL_POWEREVENT = 13 SERVICE_CONTROL_SESSIONCHANGE = 14 SERVICE_CONTROL_PRESHUTDOWN = 15 SERVICE_ACTIVE = 1 SERVICE_INACTIVE = 2 SERVICE_STATE_ALL = 3 SERVICE_QUERY_CONFIG = 1 SERVICE_CHANGE_CONFIG = 2 SERVICE_QUERY_STATUS = 4 SERVICE_ENUMERATE_DEPENDENTS = 8 SERVICE_START = 16 SERVICE_STOP = 32 SERVICE_PAUSE_CONTINUE = 64 SERVICE_INTERROGATE = 128 SERVICE_USER_DEFINED_CONTROL = 256 SERVICE_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 SERVICE_RUNS_IN_SYSTEM_PROCESS = 1 SERVICE_CONFIG_DESCRIPTION = 1 SERVICE_CONFIG_FAILURE_ACTIONS = 2 SERVICE_CONFIG_DELAYED_AUTO_START_INFO = 3 SERVICE_CONFIG_FAILURE_ACTIONS_FLAG = 4 SERVICE_CONFIG_SERVICE_SID_INFO = 5 SERVICE_CONFIG_REQUIRED_PRIVILEGES_INFO = 6 SERVICE_CONFIG_PRESHUTDOWN_INFO = 7 SERVICE_CONFIG_TRIGGER_INFO = 8 SERVICE_CONFIG_PREFERRED_NODE = 9 SERVICE_CONFIG_LAUNCH_PROTECTED = 12 SERVICE_SID_TYPE_NONE = 0 SERVICE_SID_TYPE_UNRESTRICTED = 1 SERVICE_SID_TYPE_RESTRICTED = 2 | SERVICE_SID_TYPE_UNRESTRICTED SC_ENUM_PROCESS_INFO = 0 SERVICE_NOTIFY_STATUS_CHANGE = 2 SERVICE_NOTIFY_STOPPED = 0x00000001 SERVICE_NOTIFY_START_PENDING = 0x00000002 SERVICE_NOTIFY_STOP_PENDING = 0x00000004 SERVICE_NOTIFY_RUNNING = 0x00000008 SERVICE_NOTIFY_CONTINUE_PENDING = 0x00000010 SERVICE_NOTIFY_PAUSE_PENDING = 0x00000020 SERVICE_NOTIFY_PAUSED = 0x00000040 SERVICE_NOTIFY_CREATED = 0x00000080 SERVICE_NOTIFY_DELETED = 0x00000100 SERVICE_NOTIFY_DELETE_PENDING = 0x00000200 SC_EVENT_DATABASE_CHANGE = 0 SC_EVENT_PROPERTY_CHANGE = 1 SC_EVENT_STATUS_CHANGE = 2 SERVICE_START_REASON_DEMAND = 0x00000001 SERVICE_START_REASON_AUTO = 0x00000002 SERVICE_START_REASON_TRIGGER = 0x00000004 SERVICE_START_REASON_RESTART_ON_FAILURE = 0x00000008 SERVICE_START_REASON_DELAYEDAUTO = 0x00000010 SERVICE_DYNAMIC_INFORMATION_LEVEL_START_REASON = 1 ) type ENUM_SERVICE_STATUS struct { ServiceName *uint16 DisplayName *uint16 ServiceStatus SERVICE_STATUS } type SERVICE_STATUS struct { ServiceType uint32 CurrentState uint32 ControlsAccepted uint32 Win32ExitCode uint32 ServiceSpecificExitCode uint32 CheckPoint uint32 WaitHint uint32 } type SERVICE_TABLE_ENTRY struct { ServiceName *uint16 ServiceProc uintptr } type QUERY_SERVICE_CONFIG struct { ServiceType uint32 StartType uint32 ErrorControl uint32 BinaryPathName *uint16 LoadOrderGroup *uint16 TagId uint32 Dependencies *uint16 ServiceStartName *uint16 DisplayName *uint16 } type SERVICE_DESCRIPTION struct { Description *uint16 } type SERVICE_DELAYED_AUTO_START_INFO struct { IsDelayedAutoStartUp uint32 } type SERVICE_STATUS_PROCESS struct { ServiceType uint32 CurrentState uint32 ControlsAccepted uint32 Win32ExitCode uint32 ServiceSpecificExitCode uint32 CheckPoint uint32 WaitHint uint32 ProcessId uint32 ServiceFlags uint32 } type ENUM_SERVICE_STATUS_PROCESS struct { ServiceName *uint16 DisplayName *uint16 ServiceStatusProcess SERVICE_STATUS_PROCESS } type SERVICE_NOTIFY struct { Version uint32 NotifyCallback uintptr Context uintptr NotificationStatus uint32 ServiceStatus SERVICE_STATUS_PROCESS NotificationTriggered uint32 ServiceNames *uint16 } type SERVICE_FAILURE_ACTIONS struct { ResetPeriod uint32 RebootMsg *uint16 Command *uint16 ActionsCount uint32 Actions *SC_ACTION } type SERVICE_FAILURE_ACTIONS_FLAG struct { FailureActionsOnNonCrashFailures int32 } type SC_ACTION struct { Type uint32 Delay uint32 } type QUERY_SERVICE_LOCK_STATUS struct { IsLocked uint32 LockOwner *uint16 LockDuration uint32 } //sys OpenSCManager(machineName *uint16, databaseName *uint16, access uint32) (handle Handle, err error) [failretval==0] = advapi32.OpenSCManagerW //sys CloseServiceHandle(handle Handle) (err error) = advapi32.CloseServiceHandle //sys 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) [failretval==0] = advapi32.CreateServiceW //sys OpenService(mgr Handle, serviceName *uint16, access uint32) (handle Handle, err error) [failretval==0] = advapi32.OpenServiceW //sys DeleteService(service Handle) (err error) = advapi32.DeleteService //sys StartService(service Handle, numArgs uint32, argVectors **uint16) (err error) = advapi32.StartServiceW //sys QueryServiceStatus(service Handle, status *SERVICE_STATUS) (err error) = advapi32.QueryServiceStatus //sys QueryServiceLockStatus(mgr Handle, lockStatus *QUERY_SERVICE_LOCK_STATUS, bufSize uint32, bytesNeeded *uint32) (err error) = advapi32.QueryServiceLockStatusW //sys ControlService(service Handle, control uint32, status *SERVICE_STATUS) (err error) = advapi32.ControlService //sys StartServiceCtrlDispatcher(serviceTable *SERVICE_TABLE_ENTRY) (err error) = advapi32.StartServiceCtrlDispatcherW //sys SetServiceStatus(service Handle, serviceStatus *SERVICE_STATUS) (err error) = advapi32.SetServiceStatus //sys 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) = advapi32.ChangeServiceConfigW //sys QueryServiceConfig(service Handle, serviceConfig *QUERY_SERVICE_CONFIG, bufSize uint32, bytesNeeded *uint32) (err error) = advapi32.QueryServiceConfigW //sys ChangeServiceConfig2(service Handle, infoLevel uint32, info *byte) (err error) = advapi32.ChangeServiceConfig2W //sys QueryServiceConfig2(service Handle, infoLevel uint32, buff *byte, buffSize uint32, bytesNeeded *uint32) (err error) = advapi32.QueryServiceConfig2W //sys EnumServicesStatusEx(mgr Handle, infoLevel uint32, serviceType uint32, serviceState uint32, services *byte, bufSize uint32, bytesNeeded *uint32, servicesReturned *uint32, resumeHandle *uint32, groupName *uint16) (err error) = advapi32.EnumServicesStatusExW //sys QueryServiceStatusEx(service Handle, infoLevel uint32, buff *byte, buffSize uint32, bytesNeeded *uint32) (err error) = advapi32.QueryServiceStatusEx //sys NotifyServiceStatusChange(service Handle, notifyMask uint32, notifier *SERVICE_NOTIFY) (ret error) = advapi32.NotifyServiceStatusChangeW //sys SubscribeServiceChangeNotifications(service Handle, eventType uint32, callback uintptr, callbackCtx uintptr, subscription *uintptr) (ret error) = sechost.SubscribeServiceChangeNotifications? //sys UnsubscribeServiceChangeNotifications(subscription uintptr) = sechost.UnsubscribeServiceChangeNotifications? //sys RegisterServiceCtrlHandlerEx(serviceName *uint16, handlerProc uintptr, context uintptr) (handle Handle, err error) = advapi32.RegisterServiceCtrlHandlerExW //sys QueryServiceDynamicInformation(service Handle, infoLevel uint32, dynamicInfo unsafe.Pointer) (err error) = advapi32.QueryServiceDynamicInformation? //sys EnumDependentServices(service Handle, activityState uint32, services *ENUM_SERVICE_STATUS, buffSize uint32, bytesNeeded *uint32, servicesReturned *uint32) (err error) = advapi32.EnumDependentServicesW ================================================ FILE: vendor/golang.org/x/sys/windows/setupapi_windows.go ================================================ // Copyright 2021 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package windows import ( "encoding/binary" "errors" "fmt" "runtime" "strings" "syscall" "unsafe" ) // This file contains functions that wrap SetupAPI.dll and CfgMgr32.dll, // core system functions for managing hardware devices, drivers, and the PnP tree. // Information about these APIs can be found at: // https://docs.microsoft.com/en-us/windows-hardware/drivers/install/setupapi // https://docs.microsoft.com/en-us/windows/win32/devinst/cfgmgr32- const ( ERROR_EXPECTED_SECTION_NAME Errno = 0x20000000 | 0xC0000000 | 0 ERROR_BAD_SECTION_NAME_LINE Errno = 0x20000000 | 0xC0000000 | 1 ERROR_SECTION_NAME_TOO_LONG Errno = 0x20000000 | 0xC0000000 | 2 ERROR_GENERAL_SYNTAX Errno = 0x20000000 | 0xC0000000 | 3 ERROR_WRONG_INF_STYLE Errno = 0x20000000 | 0xC0000000 | 0x100 ERROR_SECTION_NOT_FOUND Errno = 0x20000000 | 0xC0000000 | 0x101 ERROR_LINE_NOT_FOUND Errno = 0x20000000 | 0xC0000000 | 0x102 ERROR_NO_BACKUP Errno = 0x20000000 | 0xC0000000 | 0x103 ERROR_NO_ASSOCIATED_CLASS Errno = 0x20000000 | 0xC0000000 | 0x200 ERROR_CLASS_MISMATCH Errno = 0x20000000 | 0xC0000000 | 0x201 ERROR_DUPLICATE_FOUND Errno = 0x20000000 | 0xC0000000 | 0x202 ERROR_NO_DRIVER_SELECTED Errno = 0x20000000 | 0xC0000000 | 0x203 ERROR_KEY_DOES_NOT_EXIST Errno = 0x20000000 | 0xC0000000 | 0x204 ERROR_INVALID_DEVINST_NAME Errno = 0x20000000 | 0xC0000000 | 0x205 ERROR_INVALID_CLASS Errno = 0x20000000 | 0xC0000000 | 0x206 ERROR_DEVINST_ALREADY_EXISTS Errno = 0x20000000 | 0xC0000000 | 0x207 ERROR_DEVINFO_NOT_REGISTERED Errno = 0x20000000 | 0xC0000000 | 0x208 ERROR_INVALID_REG_PROPERTY Errno = 0x20000000 | 0xC0000000 | 0x209 ERROR_NO_INF Errno = 0x20000000 | 0xC0000000 | 0x20A ERROR_NO_SUCH_DEVINST Errno = 0x20000000 | 0xC0000000 | 0x20B ERROR_CANT_LOAD_CLASS_ICON Errno = 0x20000000 | 0xC0000000 | 0x20C ERROR_INVALID_CLASS_INSTALLER Errno = 0x20000000 | 0xC0000000 | 0x20D ERROR_DI_DO_DEFAULT Errno = 0x20000000 | 0xC0000000 | 0x20E ERROR_DI_NOFILECOPY Errno = 0x20000000 | 0xC0000000 | 0x20F ERROR_INVALID_HWPROFILE Errno = 0x20000000 | 0xC0000000 | 0x210 ERROR_NO_DEVICE_SELECTED Errno = 0x20000000 | 0xC0000000 | 0x211 ERROR_DEVINFO_LIST_LOCKED Errno = 0x20000000 | 0xC0000000 | 0x212 ERROR_DEVINFO_DATA_LOCKED Errno = 0x20000000 | 0xC0000000 | 0x213 ERROR_DI_BAD_PATH Errno = 0x20000000 | 0xC0000000 | 0x214 ERROR_NO_CLASSINSTALL_PARAMS Errno = 0x20000000 | 0xC0000000 | 0x215 ERROR_FILEQUEUE_LOCKED Errno = 0x20000000 | 0xC0000000 | 0x216 ERROR_BAD_SERVICE_INSTALLSECT Errno = 0x20000000 | 0xC0000000 | 0x217 ERROR_NO_CLASS_DRIVER_LIST Errno = 0x20000000 | 0xC0000000 | 0x218 ERROR_NO_ASSOCIATED_SERVICE Errno = 0x20000000 | 0xC0000000 | 0x219 ERROR_NO_DEFAULT_DEVICE_INTERFACE Errno = 0x20000000 | 0xC0000000 | 0x21A ERROR_DEVICE_INTERFACE_ACTIVE Errno = 0x20000000 | 0xC0000000 | 0x21B ERROR_DEVICE_INTERFACE_REMOVED Errno = 0x20000000 | 0xC0000000 | 0x21C ERROR_BAD_INTERFACE_INSTALLSECT Errno = 0x20000000 | 0xC0000000 | 0x21D ERROR_NO_SUCH_INTERFACE_CLASS Errno = 0x20000000 | 0xC0000000 | 0x21E ERROR_INVALID_REFERENCE_STRING Errno = 0x20000000 | 0xC0000000 | 0x21F ERROR_INVALID_MACHINENAME Errno = 0x20000000 | 0xC0000000 | 0x220 ERROR_REMOTE_COMM_FAILURE Errno = 0x20000000 | 0xC0000000 | 0x221 ERROR_MACHINE_UNAVAILABLE Errno = 0x20000000 | 0xC0000000 | 0x222 ERROR_NO_CONFIGMGR_SERVICES Errno = 0x20000000 | 0xC0000000 | 0x223 ERROR_INVALID_PROPPAGE_PROVIDER Errno = 0x20000000 | 0xC0000000 | 0x224 ERROR_NO_SUCH_DEVICE_INTERFACE Errno = 0x20000000 | 0xC0000000 | 0x225 ERROR_DI_POSTPROCESSING_REQUIRED Errno = 0x20000000 | 0xC0000000 | 0x226 ERROR_INVALID_COINSTALLER Errno = 0x20000000 | 0xC0000000 | 0x227 ERROR_NO_COMPAT_DRIVERS Errno = 0x20000000 | 0xC0000000 | 0x228 ERROR_NO_DEVICE_ICON Errno = 0x20000000 | 0xC0000000 | 0x229 ERROR_INVALID_INF_LOGCONFIG Errno = 0x20000000 | 0xC0000000 | 0x22A ERROR_DI_DONT_INSTALL Errno = 0x20000000 | 0xC0000000 | 0x22B ERROR_INVALID_FILTER_DRIVER Errno = 0x20000000 | 0xC0000000 | 0x22C ERROR_NON_WINDOWS_NT_DRIVER Errno = 0x20000000 | 0xC0000000 | 0x22D ERROR_NON_WINDOWS_DRIVER Errno = 0x20000000 | 0xC0000000 | 0x22E ERROR_NO_CATALOG_FOR_OEM_INF Errno = 0x20000000 | 0xC0000000 | 0x22F ERROR_DEVINSTALL_QUEUE_NONNATIVE Errno = 0x20000000 | 0xC0000000 | 0x230 ERROR_NOT_DISABLEABLE Errno = 0x20000000 | 0xC0000000 | 0x231 ERROR_CANT_REMOVE_DEVINST Errno = 0x20000000 | 0xC0000000 | 0x232 ERROR_INVALID_TARGET Errno = 0x20000000 | 0xC0000000 | 0x233 ERROR_DRIVER_NONNATIVE Errno = 0x20000000 | 0xC0000000 | 0x234 ERROR_IN_WOW64 Errno = 0x20000000 | 0xC0000000 | 0x235 ERROR_SET_SYSTEM_RESTORE_POINT Errno = 0x20000000 | 0xC0000000 | 0x236 ERROR_SCE_DISABLED Errno = 0x20000000 | 0xC0000000 | 0x238 ERROR_UNKNOWN_EXCEPTION Errno = 0x20000000 | 0xC0000000 | 0x239 ERROR_PNP_REGISTRY_ERROR Errno = 0x20000000 | 0xC0000000 | 0x23A ERROR_REMOTE_REQUEST_UNSUPPORTED Errno = 0x20000000 | 0xC0000000 | 0x23B ERROR_NOT_AN_INSTALLED_OEM_INF Errno = 0x20000000 | 0xC0000000 | 0x23C ERROR_INF_IN_USE_BY_DEVICES Errno = 0x20000000 | 0xC0000000 | 0x23D ERROR_DI_FUNCTION_OBSOLETE Errno = 0x20000000 | 0xC0000000 | 0x23E ERROR_NO_AUTHENTICODE_CATALOG Errno = 0x20000000 | 0xC0000000 | 0x23F ERROR_AUTHENTICODE_DISALLOWED Errno = 0x20000000 | 0xC0000000 | 0x240 ERROR_AUTHENTICODE_TRUSTED_PUBLISHER Errno = 0x20000000 | 0xC0000000 | 0x241 ERROR_AUTHENTICODE_TRUST_NOT_ESTABLISHED Errno = 0x20000000 | 0xC0000000 | 0x242 ERROR_AUTHENTICODE_PUBLISHER_NOT_TRUSTED Errno = 0x20000000 | 0xC0000000 | 0x243 ERROR_SIGNATURE_OSATTRIBUTE_MISMATCH Errno = 0x20000000 | 0xC0000000 | 0x244 ERROR_ONLY_VALIDATE_VIA_AUTHENTICODE Errno = 0x20000000 | 0xC0000000 | 0x245 ERROR_DEVICE_INSTALLER_NOT_READY Errno = 0x20000000 | 0xC0000000 | 0x246 ERROR_DRIVER_STORE_ADD_FAILED Errno = 0x20000000 | 0xC0000000 | 0x247 ERROR_DEVICE_INSTALL_BLOCKED Errno = 0x20000000 | 0xC0000000 | 0x248 ERROR_DRIVER_INSTALL_BLOCKED Errno = 0x20000000 | 0xC0000000 | 0x249 ERROR_WRONG_INF_TYPE Errno = 0x20000000 | 0xC0000000 | 0x24A ERROR_FILE_HASH_NOT_IN_CATALOG Errno = 0x20000000 | 0xC0000000 | 0x24B ERROR_DRIVER_STORE_DELETE_FAILED Errno = 0x20000000 | 0xC0000000 | 0x24C ERROR_UNRECOVERABLE_STACK_OVERFLOW Errno = 0x20000000 | 0xC0000000 | 0x300 EXCEPTION_SPAPI_UNRECOVERABLE_STACK_OVERFLOW Errno = ERROR_UNRECOVERABLE_STACK_OVERFLOW ERROR_NO_DEFAULT_INTERFACE_DEVICE Errno = ERROR_NO_DEFAULT_DEVICE_INTERFACE ERROR_INTERFACE_DEVICE_ACTIVE Errno = ERROR_DEVICE_INTERFACE_ACTIVE ERROR_INTERFACE_DEVICE_REMOVED Errno = ERROR_DEVICE_INTERFACE_REMOVED ERROR_NO_SUCH_INTERFACE_DEVICE Errno = ERROR_NO_SUCH_DEVICE_INTERFACE ) const ( MAX_DEVICE_ID_LEN = 200 MAX_DEVNODE_ID_LEN = MAX_DEVICE_ID_LEN MAX_GUID_STRING_LEN = 39 // 38 chars + terminator null MAX_CLASS_NAME_LEN = 32 MAX_PROFILE_LEN = 80 MAX_CONFIG_VALUE = 9999 MAX_INSTANCE_VALUE = 9999 CONFIGMG_VERSION = 0x0400 ) // Maximum string length constants const ( LINE_LEN = 256 // Windows 9x-compatible maximum for displayable strings coming from a device INF. MAX_INF_STRING_LENGTH = 4096 // Actual maximum size of an INF string (including string substitutions). MAX_INF_SECTION_NAME_LENGTH = 255 // For Windows 9x compatibility, INF section names should be constrained to 32 characters. MAX_TITLE_LEN = 60 MAX_INSTRUCTION_LEN = 256 MAX_LABEL_LEN = 30 MAX_SERVICE_NAME_LEN = 256 MAX_SUBTITLE_LEN = 256 ) const ( // SP_MAX_MACHINENAME_LENGTH defines maximum length of a machine name in the format expected by ConfigMgr32 CM_Connect_Machine (i.e., "\\\\MachineName\0"). SP_MAX_MACHINENAME_LENGTH = MAX_PATH + 3 ) // HSPFILEQ is type for setup file queue type HSPFILEQ uintptr // DevInfo holds reference to device information set type DevInfo Handle // DEVINST is a handle usually recognized by cfgmgr32 APIs type DEVINST uint32 // DevInfoData is a device information structure (references a device instance that is a member of a device information set) type DevInfoData struct { size uint32 ClassGUID GUID DevInst DEVINST _ uintptr } // DevInfoListDetailData is a structure for detailed information on a device information set (used for SetupDiGetDeviceInfoListDetail which supersedes the functionality of SetupDiGetDeviceInfoListClass). type DevInfoListDetailData struct { size uint32 // Use unsafeSizeOf method ClassGUID GUID RemoteMachineHandle Handle remoteMachineName [SP_MAX_MACHINENAME_LENGTH]uint16 } func (*DevInfoListDetailData) unsafeSizeOf() uint32 { if unsafe.Sizeof(uintptr(0)) == 4 { // Windows declares this with pshpack1.h return uint32(unsafe.Offsetof(DevInfoListDetailData{}.remoteMachineName) + unsafe.Sizeof(DevInfoListDetailData{}.remoteMachineName)) } return uint32(unsafe.Sizeof(DevInfoListDetailData{})) } func (data *DevInfoListDetailData) RemoteMachineName() string { return UTF16ToString(data.remoteMachineName[:]) } func (data *DevInfoListDetailData) SetRemoteMachineName(remoteMachineName string) error { str, err := UTF16FromString(remoteMachineName) if err != nil { return err } copy(data.remoteMachineName[:], str) return nil } // DI_FUNCTION is function type for device installer type DI_FUNCTION uint32 const ( DIF_SELECTDEVICE DI_FUNCTION = 0x00000001 DIF_INSTALLDEVICE DI_FUNCTION = 0x00000002 DIF_ASSIGNRESOURCES DI_FUNCTION = 0x00000003 DIF_PROPERTIES DI_FUNCTION = 0x00000004 DIF_REMOVE DI_FUNCTION = 0x00000005 DIF_FIRSTTIMESETUP DI_FUNCTION = 0x00000006 DIF_FOUNDDEVICE DI_FUNCTION = 0x00000007 DIF_SELECTCLASSDRIVERS DI_FUNCTION = 0x00000008 DIF_VALIDATECLASSDRIVERS DI_FUNCTION = 0x00000009 DIF_INSTALLCLASSDRIVERS DI_FUNCTION = 0x0000000A DIF_CALCDISKSPACE DI_FUNCTION = 0x0000000B DIF_DESTROYPRIVATEDATA DI_FUNCTION = 0x0000000C DIF_VALIDATEDRIVER DI_FUNCTION = 0x0000000D DIF_DETECT DI_FUNCTION = 0x0000000F DIF_INSTALLWIZARD DI_FUNCTION = 0x00000010 DIF_DESTROYWIZARDDATA DI_FUNCTION = 0x00000011 DIF_PROPERTYCHANGE DI_FUNCTION = 0x00000012 DIF_ENABLECLASS DI_FUNCTION = 0x00000013 DIF_DETECTVERIFY DI_FUNCTION = 0x00000014 DIF_INSTALLDEVICEFILES DI_FUNCTION = 0x00000015 DIF_UNREMOVE DI_FUNCTION = 0x00000016 DIF_SELECTBESTCOMPATDRV DI_FUNCTION = 0x00000017 DIF_ALLOW_INSTALL DI_FUNCTION = 0x00000018 DIF_REGISTERDEVICE DI_FUNCTION = 0x00000019 DIF_NEWDEVICEWIZARD_PRESELECT DI_FUNCTION = 0x0000001A DIF_NEWDEVICEWIZARD_SELECT DI_FUNCTION = 0x0000001B DIF_NEWDEVICEWIZARD_PREANALYZE DI_FUNCTION = 0x0000001C DIF_NEWDEVICEWIZARD_POSTANALYZE DI_FUNCTION = 0x0000001D DIF_NEWDEVICEWIZARD_FINISHINSTALL DI_FUNCTION = 0x0000001E DIF_INSTALLINTERFACES DI_FUNCTION = 0x00000020 DIF_DETECTCANCEL DI_FUNCTION = 0x00000021 DIF_REGISTER_COINSTALLERS DI_FUNCTION = 0x00000022 DIF_ADDPROPERTYPAGE_ADVANCED DI_FUNCTION = 0x00000023 DIF_ADDPROPERTYPAGE_BASIC DI_FUNCTION = 0x00000024 DIF_TROUBLESHOOTER DI_FUNCTION = 0x00000026 DIF_POWERMESSAGEWAKE DI_FUNCTION = 0x00000027 DIF_ADDREMOTEPROPERTYPAGE_ADVANCED DI_FUNCTION = 0x00000028 DIF_UPDATEDRIVER_UI DI_FUNCTION = 0x00000029 DIF_FINISHINSTALL_ACTION DI_FUNCTION = 0x0000002A ) // DevInstallParams is device installation parameters structure (associated with a particular device information element, or globally with a device information set) type DevInstallParams struct { size uint32 Flags DI_FLAGS FlagsEx DI_FLAGSEX hwndParent uintptr InstallMsgHandler uintptr InstallMsgHandlerContext uintptr FileQueue HSPFILEQ _ uintptr _ uint32 driverPath [MAX_PATH]uint16 } func (params *DevInstallParams) DriverPath() string { return UTF16ToString(params.driverPath[:]) } func (params *DevInstallParams) SetDriverPath(driverPath string) error { str, err := UTF16FromString(driverPath) if err != nil { return err } copy(params.driverPath[:], str) return nil } // DI_FLAGS is SP_DEVINSTALL_PARAMS.Flags values type DI_FLAGS uint32 const ( // Flags for choosing a device DI_SHOWOEM DI_FLAGS = 0x00000001 // support Other... button DI_SHOWCOMPAT DI_FLAGS = 0x00000002 // show compatibility list DI_SHOWCLASS DI_FLAGS = 0x00000004 // show class list DI_SHOWALL DI_FLAGS = 0x00000007 // both class & compat list shown DI_NOVCP DI_FLAGS = 0x00000008 // don't create a new copy queue--use caller-supplied FileQueue DI_DIDCOMPAT DI_FLAGS = 0x00000010 // Searched for compatible devices DI_DIDCLASS DI_FLAGS = 0x00000020 // Searched for class devices DI_AUTOASSIGNRES DI_FLAGS = 0x00000040 // No UI for resources if possible // Flags returned by DiInstallDevice to indicate need to reboot/restart DI_NEEDRESTART DI_FLAGS = 0x00000080 // Reboot required to take effect DI_NEEDREBOOT DI_FLAGS = 0x00000100 // "" // Flags for device installation DI_NOBROWSE DI_FLAGS = 0x00000200 // no Browse... in InsertDisk // Flags set by DiBuildDriverInfoList DI_MULTMFGS DI_FLAGS = 0x00000400 // Set if multiple manufacturers in class driver list // Flag indicates that device is disabled DI_DISABLED DI_FLAGS = 0x00000800 // Set if device disabled // Flags for Device/Class Properties DI_GENERALPAGE_ADDED DI_FLAGS = 0x00001000 DI_RESOURCEPAGE_ADDED DI_FLAGS = 0x00002000 // Flag to indicate the setting properties for this Device (or class) caused a change so the Dev Mgr UI probably needs to be updated. DI_PROPERTIES_CHANGE DI_FLAGS = 0x00004000 // Flag to indicate that the sorting from the INF file should be used. DI_INF_IS_SORTED DI_FLAGS = 0x00008000 // Flag to indicate that only the INF specified by SP_DEVINSTALL_PARAMS.DriverPath should be searched. DI_ENUMSINGLEINF DI_FLAGS = 0x00010000 // Flag that prevents ConfigMgr from removing/re-enumerating devices during device // registration, installation, and deletion. DI_DONOTCALLCONFIGMG DI_FLAGS = 0x00020000 // The following flag can be used to install a device disabled DI_INSTALLDISABLED DI_FLAGS = 0x00040000 // Flag that causes SetupDiBuildDriverInfoList to build a device's compatible driver // list from its existing class driver list, instead of the normal INF search. DI_COMPAT_FROM_CLASS DI_FLAGS = 0x00080000 // This flag is set if the Class Install params should be used. DI_CLASSINSTALLPARAMS DI_FLAGS = 0x00100000 // This flag is set if the caller of DiCallClassInstaller does NOT want the internal default action performed if the Class installer returns ERROR_DI_DO_DEFAULT. DI_NODI_DEFAULTACTION DI_FLAGS = 0x00200000 // Flags for device installation DI_QUIETINSTALL DI_FLAGS = 0x00800000 // don't confuse the user with questions or excess info DI_NOFILECOPY DI_FLAGS = 0x01000000 // No file Copy necessary DI_FORCECOPY DI_FLAGS = 0x02000000 // Force files to be copied from install path DI_DRIVERPAGE_ADDED DI_FLAGS = 0x04000000 // Prop provider added Driver page. DI_USECI_SELECTSTRINGS DI_FLAGS = 0x08000000 // Use Class Installer Provided strings in the Select Device Dlg DI_OVERRIDE_INFFLAGS DI_FLAGS = 0x10000000 // Override INF flags DI_PROPS_NOCHANGEUSAGE DI_FLAGS = 0x20000000 // No Enable/Disable in General Props DI_NOSELECTICONS DI_FLAGS = 0x40000000 // No small icons in select device dialogs DI_NOWRITE_IDS DI_FLAGS = 0x80000000 // Don't write HW & Compat IDs on install ) // DI_FLAGSEX is SP_DEVINSTALL_PARAMS.FlagsEx values type DI_FLAGSEX uint32 const ( DI_FLAGSEX_CI_FAILED DI_FLAGSEX = 0x00000004 // Failed to Load/Call class installer DI_FLAGSEX_FINISHINSTALL_ACTION DI_FLAGSEX = 0x00000008 // Class/co-installer wants to get a DIF_FINISH_INSTALL action in client context. DI_FLAGSEX_DIDINFOLIST DI_FLAGSEX = 0x00000010 // Did the Class Info List DI_FLAGSEX_DIDCOMPATINFO DI_FLAGSEX = 0x00000020 // Did the Compat Info List DI_FLAGSEX_FILTERCLASSES DI_FLAGSEX = 0x00000040 DI_FLAGSEX_SETFAILEDINSTALL DI_FLAGSEX = 0x00000080 DI_FLAGSEX_DEVICECHANGE DI_FLAGSEX = 0x00000100 DI_FLAGSEX_ALWAYSWRITEIDS DI_FLAGSEX = 0x00000200 DI_FLAGSEX_PROPCHANGE_PENDING DI_FLAGSEX = 0x00000400 // One or more device property sheets have had changes made to them, and need to have a DIF_PROPERTYCHANGE occur. DI_FLAGSEX_ALLOWEXCLUDEDDRVS DI_FLAGSEX = 0x00000800 DI_FLAGSEX_NOUIONQUERYREMOVE DI_FLAGSEX = 0x00001000 DI_FLAGSEX_USECLASSFORCOMPAT DI_FLAGSEX = 0x00002000 // Use the device's class when building compat drv list. (Ignored if DI_COMPAT_FROM_CLASS flag is specified.) DI_FLAGSEX_NO_DRVREG_MODIFY DI_FLAGSEX = 0x00008000 // Don't run AddReg and DelReg for device's software (driver) key. DI_FLAGSEX_IN_SYSTEM_SETUP DI_FLAGSEX = 0x00010000 // Installation is occurring during initial system setup. DI_FLAGSEX_INET_DRIVER DI_FLAGSEX = 0x00020000 // Driver came from Windows Update DI_FLAGSEX_APPENDDRIVERLIST DI_FLAGSEX = 0x00040000 // Cause SetupDiBuildDriverInfoList to append a new driver list to an existing list. DI_FLAGSEX_PREINSTALLBACKUP DI_FLAGSEX = 0x00080000 // not used DI_FLAGSEX_BACKUPONREPLACE DI_FLAGSEX = 0x00100000 // not used DI_FLAGSEX_DRIVERLIST_FROM_URL DI_FLAGSEX = 0x00200000 // build driver list from INF(s) retrieved from URL specified in SP_DEVINSTALL_PARAMS.DriverPath (empty string means Windows Update website) DI_FLAGSEX_EXCLUDE_OLD_INET_DRIVERS DI_FLAGSEX = 0x00800000 // Don't include old Internet drivers when building a driver list. Ignored on Windows Vista and later. DI_FLAGSEX_POWERPAGE_ADDED DI_FLAGSEX = 0x01000000 // class installer added their own power page DI_FLAGSEX_FILTERSIMILARDRIVERS DI_FLAGSEX = 0x02000000 // only include similar drivers in class list DI_FLAGSEX_INSTALLEDDRIVER DI_FLAGSEX = 0x04000000 // only add the installed driver to the class or compat driver list. Used in calls to SetupDiBuildDriverInfoList DI_FLAGSEX_NO_CLASSLIST_NODE_MERGE DI_FLAGSEX = 0x08000000 // Don't remove identical driver nodes from the class list DI_FLAGSEX_ALTPLATFORM_DRVSEARCH DI_FLAGSEX = 0x10000000 // Build driver list based on alternate platform information specified in associated file queue DI_FLAGSEX_RESTART_DEVICE_ONLY DI_FLAGSEX = 0x20000000 // only restart the device drivers are being installed on as opposed to restarting all devices using those drivers. DI_FLAGSEX_RECURSIVESEARCH DI_FLAGSEX = 0x40000000 // Tell SetupDiBuildDriverInfoList to do a recursive search DI_FLAGSEX_SEARCH_PUBLISHED_INFS DI_FLAGSEX = 0x80000000 // Tell SetupDiBuildDriverInfoList to do a "published INF" search ) // ClassInstallHeader is the first member of any class install parameters structure. It contains the device installation request code that defines the format of the rest of the install parameters structure. type ClassInstallHeader struct { size uint32 InstallFunction DI_FUNCTION } func MakeClassInstallHeader(installFunction DI_FUNCTION) *ClassInstallHeader { hdr := &ClassInstallHeader{InstallFunction: installFunction} hdr.size = uint32(unsafe.Sizeof(*hdr)) return hdr } // DICS_STATE specifies values indicating a change in a device's state type DICS_STATE uint32 const ( DICS_ENABLE DICS_STATE = 0x00000001 // The device is being enabled. DICS_DISABLE DICS_STATE = 0x00000002 // The device is being disabled. DICS_PROPCHANGE DICS_STATE = 0x00000003 // The properties of the device have changed. DICS_START DICS_STATE = 0x00000004 // The device is being started (if the request is for the currently active hardware profile). DICS_STOP DICS_STATE = 0x00000005 // The device is being stopped. The driver stack will be unloaded and the CSCONFIGFLAG_DO_NOT_START flag will be set for the device. ) // DICS_FLAG specifies the scope of a device property change type DICS_FLAG uint32 const ( DICS_FLAG_GLOBAL DICS_FLAG = 0x00000001 // make change in all hardware profiles DICS_FLAG_CONFIGSPECIFIC DICS_FLAG = 0x00000002 // make change in specified profile only DICS_FLAG_CONFIGGENERAL DICS_FLAG = 0x00000004 // 1 or more hardware profile-specific changes to follow (obsolete) ) // PropChangeParams is a structure corresponding to a DIF_PROPERTYCHANGE install function. type PropChangeParams struct { ClassInstallHeader ClassInstallHeader StateChange DICS_STATE Scope DICS_FLAG HwProfile uint32 } // DI_REMOVEDEVICE specifies the scope of the device removal type DI_REMOVEDEVICE uint32 const ( DI_REMOVEDEVICE_GLOBAL DI_REMOVEDEVICE = 0x00000001 // Make this change in all hardware profiles. Remove information about the device from the registry. DI_REMOVEDEVICE_CONFIGSPECIFIC DI_REMOVEDEVICE = 0x00000002 // Make this change to only the hardware profile specified by HwProfile. this flag only applies to root-enumerated devices. When Windows removes the device from the last hardware profile in which it was configured, Windows performs a global removal. ) // RemoveDeviceParams is a structure corresponding to a DIF_REMOVE install function. type RemoveDeviceParams struct { ClassInstallHeader ClassInstallHeader Scope DI_REMOVEDEVICE HwProfile uint32 } // DrvInfoData is driver information structure (member of a driver info list that may be associated with a particular device instance, or (globally) with a device information set) type DrvInfoData struct { size uint32 DriverType uint32 _ uintptr description [LINE_LEN]uint16 mfgName [LINE_LEN]uint16 providerName [LINE_LEN]uint16 DriverDate Filetime DriverVersion uint64 } func (data *DrvInfoData) Description() string { return UTF16ToString(data.description[:]) } func (data *DrvInfoData) SetDescription(description string) error { str, err := UTF16FromString(description) if err != nil { return err } copy(data.description[:], str) return nil } func (data *DrvInfoData) MfgName() string { return UTF16ToString(data.mfgName[:]) } func (data *DrvInfoData) SetMfgName(mfgName string) error { str, err := UTF16FromString(mfgName) if err != nil { return err } copy(data.mfgName[:], str) return nil } func (data *DrvInfoData) ProviderName() string { return UTF16ToString(data.providerName[:]) } func (data *DrvInfoData) SetProviderName(providerName string) error { str, err := UTF16FromString(providerName) if err != nil { return err } copy(data.providerName[:], str) return nil } // IsNewer method returns true if DrvInfoData date and version is newer than supplied parameters. func (data *DrvInfoData) IsNewer(driverDate Filetime, driverVersion uint64) bool { if data.DriverDate.HighDateTime > driverDate.HighDateTime { return true } if data.DriverDate.HighDateTime < driverDate.HighDateTime { return false } if data.DriverDate.LowDateTime > driverDate.LowDateTime { return true } if data.DriverDate.LowDateTime < driverDate.LowDateTime { return false } if data.DriverVersion > driverVersion { return true } if data.DriverVersion < driverVersion { return false } return false } // DrvInfoDetailData is driver information details structure (provides detailed information about a particular driver information structure) type DrvInfoDetailData struct { size uint32 // Use unsafeSizeOf method InfDate Filetime compatIDsOffset uint32 compatIDsLength uint32 _ uintptr sectionName [LINE_LEN]uint16 infFileName [MAX_PATH]uint16 drvDescription [LINE_LEN]uint16 hardwareID [1]uint16 } func (*DrvInfoDetailData) unsafeSizeOf() uint32 { if unsafe.Sizeof(uintptr(0)) == 4 { // Windows declares this with pshpack1.h return uint32(unsafe.Offsetof(DrvInfoDetailData{}.hardwareID) + unsafe.Sizeof(DrvInfoDetailData{}.hardwareID)) } return uint32(unsafe.Sizeof(DrvInfoDetailData{})) } func (data *DrvInfoDetailData) SectionName() string { return UTF16ToString(data.sectionName[:]) } func (data *DrvInfoDetailData) InfFileName() string { return UTF16ToString(data.infFileName[:]) } func (data *DrvInfoDetailData) DrvDescription() string { return UTF16ToString(data.drvDescription[:]) } func (data *DrvInfoDetailData) HardwareID() string { if data.compatIDsOffset > 1 { bufW := data.getBuf() return UTF16ToString(bufW[:wcslen(bufW)]) } return "" } func (data *DrvInfoDetailData) CompatIDs() []string { a := make([]string, 0) if data.compatIDsLength > 0 { bufW := data.getBuf() bufW = bufW[data.compatIDsOffset : data.compatIDsOffset+data.compatIDsLength] for i := 0; i < len(bufW); { j := i + wcslen(bufW[i:]) if i < j { a = append(a, UTF16ToString(bufW[i:j])) } i = j + 1 } } return a } func (data *DrvInfoDetailData) getBuf() []uint16 { len := (data.size - uint32(unsafe.Offsetof(data.hardwareID))) / 2 sl := struct { addr *uint16 len int cap int }{&data.hardwareID[0], int(len), int(len)} return *(*[]uint16)(unsafe.Pointer(&sl)) } // IsCompatible method tests if given hardware ID matches the driver or is listed on the compatible ID list. func (data *DrvInfoDetailData) IsCompatible(hwid string) bool { hwidLC := strings.ToLower(hwid) if strings.ToLower(data.HardwareID()) == hwidLC { return true } a := data.CompatIDs() for i := range a { if strings.ToLower(a[i]) == hwidLC { return true } } return false } // DICD flags control SetupDiCreateDeviceInfo type DICD uint32 const ( DICD_GENERATE_ID DICD = 0x00000001 DICD_INHERIT_CLASSDRVS DICD = 0x00000002 ) // SUOI flags control SetupUninstallOEMInf type SUOI uint32 const ( SUOI_FORCEDELETE SUOI = 0x0001 ) // SPDIT flags to distinguish between class drivers and // device drivers. (Passed in 'DriverType' parameter of // driver information list APIs) type SPDIT uint32 const ( SPDIT_NODRIVER SPDIT = 0x00000000 SPDIT_CLASSDRIVER SPDIT = 0x00000001 SPDIT_COMPATDRIVER SPDIT = 0x00000002 ) // DIGCF flags control what is included in the device information set built by SetupDiGetClassDevs type DIGCF uint32 const ( DIGCF_DEFAULT DIGCF = 0x00000001 // only valid with DIGCF_DEVICEINTERFACE DIGCF_PRESENT DIGCF = 0x00000002 DIGCF_ALLCLASSES DIGCF = 0x00000004 DIGCF_PROFILE DIGCF = 0x00000008 DIGCF_DEVICEINTERFACE DIGCF = 0x00000010 ) // DIREG specifies values for SetupDiCreateDevRegKey, SetupDiOpenDevRegKey, and SetupDiDeleteDevRegKey. type DIREG uint32 const ( DIREG_DEV DIREG = 0x00000001 // Open/Create/Delete device key DIREG_DRV DIREG = 0x00000002 // Open/Create/Delete driver key DIREG_BOTH DIREG = 0x00000004 // Delete both driver and Device key ) // SPDRP specifies device registry property codes // (Codes marked as read-only (R) may only be used for // SetupDiGetDeviceRegistryProperty) // // These values should cover the same set of registry properties // as defined by the CM_DRP codes in cfgmgr32.h. // // Note that SPDRP codes are zero based while CM_DRP codes are one based! type SPDRP uint32 const ( SPDRP_DEVICEDESC SPDRP = 0x00000000 // DeviceDesc (R/W) SPDRP_HARDWAREID SPDRP = 0x00000001 // HardwareID (R/W) SPDRP_COMPATIBLEIDS SPDRP = 0x00000002 // CompatibleIDs (R/W) SPDRP_SERVICE SPDRP = 0x00000004 // Service (R/W) SPDRP_CLASS SPDRP = 0x00000007 // Class (R--tied to ClassGUID) SPDRP_CLASSGUID SPDRP = 0x00000008 // ClassGUID (R/W) SPDRP_DRIVER SPDRP = 0x00000009 // Driver (R/W) SPDRP_CONFIGFLAGS SPDRP = 0x0000000A // ConfigFlags (R/W) SPDRP_MFG SPDRP = 0x0000000B // Mfg (R/W) SPDRP_FRIENDLYNAME SPDRP = 0x0000000C // FriendlyName (R/W) SPDRP_LOCATION_INFORMATION SPDRP = 0x0000000D // LocationInformation (R/W) SPDRP_PHYSICAL_DEVICE_OBJECT_NAME SPDRP = 0x0000000E // PhysicalDeviceObjectName (R) SPDRP_CAPABILITIES SPDRP = 0x0000000F // Capabilities (R) SPDRP_UI_NUMBER SPDRP = 0x00000010 // UiNumber (R) SPDRP_UPPERFILTERS SPDRP = 0x00000011 // UpperFilters (R/W) SPDRP_LOWERFILTERS SPDRP = 0x00000012 // LowerFilters (R/W) SPDRP_BUSTYPEGUID SPDRP = 0x00000013 // BusTypeGUID (R) SPDRP_LEGACYBUSTYPE SPDRP = 0x00000014 // LegacyBusType (R) SPDRP_BUSNUMBER SPDRP = 0x00000015 // BusNumber (R) SPDRP_ENUMERATOR_NAME SPDRP = 0x00000016 // Enumerator Name (R) SPDRP_SECURITY SPDRP = 0x00000017 // Security (R/W, binary form) SPDRP_SECURITY_SDS SPDRP = 0x00000018 // Security (W, SDS form) SPDRP_DEVTYPE SPDRP = 0x00000019 // Device Type (R/W) SPDRP_EXCLUSIVE SPDRP = 0x0000001A // Device is exclusive-access (R/W) SPDRP_CHARACTERISTICS SPDRP = 0x0000001B // Device Characteristics (R/W) SPDRP_ADDRESS SPDRP = 0x0000001C // Device Address (R) SPDRP_UI_NUMBER_DESC_FORMAT SPDRP = 0x0000001D // UiNumberDescFormat (R/W) SPDRP_DEVICE_POWER_DATA SPDRP = 0x0000001E // Device Power Data (R) SPDRP_REMOVAL_POLICY SPDRP = 0x0000001F // Removal Policy (R) SPDRP_REMOVAL_POLICY_HW_DEFAULT SPDRP = 0x00000020 // Hardware Removal Policy (R) SPDRP_REMOVAL_POLICY_OVERRIDE SPDRP = 0x00000021 // Removal Policy Override (RW) SPDRP_INSTALL_STATE SPDRP = 0x00000022 // Device Install State (R) SPDRP_LOCATION_PATHS SPDRP = 0x00000023 // Device Location Paths (R) SPDRP_BASE_CONTAINERID SPDRP = 0x00000024 // Base ContainerID (R) SPDRP_MAXIMUM_PROPERTY SPDRP = 0x00000025 // Upper bound on ordinals ) // DEVPROPTYPE represents the property-data-type identifier that specifies the // data type of a device property value in the unified device property model. type DEVPROPTYPE uint32 const ( DEVPROP_TYPEMOD_ARRAY DEVPROPTYPE = 0x00001000 DEVPROP_TYPEMOD_LIST DEVPROPTYPE = 0x00002000 DEVPROP_TYPE_EMPTY DEVPROPTYPE = 0x00000000 DEVPROP_TYPE_NULL DEVPROPTYPE = 0x00000001 DEVPROP_TYPE_SBYTE DEVPROPTYPE = 0x00000002 DEVPROP_TYPE_BYTE DEVPROPTYPE = 0x00000003 DEVPROP_TYPE_INT16 DEVPROPTYPE = 0x00000004 DEVPROP_TYPE_UINT16 DEVPROPTYPE = 0x00000005 DEVPROP_TYPE_INT32 DEVPROPTYPE = 0x00000006 DEVPROP_TYPE_UINT32 DEVPROPTYPE = 0x00000007 DEVPROP_TYPE_INT64 DEVPROPTYPE = 0x00000008 DEVPROP_TYPE_UINT64 DEVPROPTYPE = 0x00000009 DEVPROP_TYPE_FLOAT DEVPROPTYPE = 0x0000000A DEVPROP_TYPE_DOUBLE DEVPROPTYPE = 0x0000000B DEVPROP_TYPE_DECIMAL DEVPROPTYPE = 0x0000000C DEVPROP_TYPE_GUID DEVPROPTYPE = 0x0000000D DEVPROP_TYPE_CURRENCY DEVPROPTYPE = 0x0000000E DEVPROP_TYPE_DATE DEVPROPTYPE = 0x0000000F DEVPROP_TYPE_FILETIME DEVPROPTYPE = 0x00000010 DEVPROP_TYPE_BOOLEAN DEVPROPTYPE = 0x00000011 DEVPROP_TYPE_STRING DEVPROPTYPE = 0x00000012 DEVPROP_TYPE_STRING_LIST DEVPROPTYPE = DEVPROP_TYPE_STRING | DEVPROP_TYPEMOD_LIST DEVPROP_TYPE_SECURITY_DESCRIPTOR DEVPROPTYPE = 0x00000013 DEVPROP_TYPE_SECURITY_DESCRIPTOR_STRING DEVPROPTYPE = 0x00000014 DEVPROP_TYPE_DEVPROPKEY DEVPROPTYPE = 0x00000015 DEVPROP_TYPE_DEVPROPTYPE DEVPROPTYPE = 0x00000016 DEVPROP_TYPE_BINARY DEVPROPTYPE = DEVPROP_TYPE_BYTE | DEVPROP_TYPEMOD_ARRAY DEVPROP_TYPE_ERROR DEVPROPTYPE = 0x00000017 DEVPROP_TYPE_NTSTATUS DEVPROPTYPE = 0x00000018 DEVPROP_TYPE_STRING_INDIRECT DEVPROPTYPE = 0x00000019 MAX_DEVPROP_TYPE DEVPROPTYPE = 0x00000019 MAX_DEVPROP_TYPEMOD DEVPROPTYPE = 0x00002000 DEVPROP_MASK_TYPE DEVPROPTYPE = 0x00000FFF DEVPROP_MASK_TYPEMOD DEVPROPTYPE = 0x0000F000 ) // DEVPROPGUID specifies a property category. type DEVPROPGUID GUID // DEVPROPID uniquely identifies the property within the property category. type DEVPROPID uint32 const DEVPROPID_FIRST_USABLE DEVPROPID = 2 // DEVPROPKEY represents a device property key for a device property in the // unified device property model. type DEVPROPKEY struct { FmtID DEVPROPGUID PID DEVPROPID } // CONFIGRET is a return value or error code from cfgmgr32 APIs type CONFIGRET uint32 func (ret CONFIGRET) Error() string { if win32Error, ok := ret.Unwrap().(Errno); ok { return fmt.Sprintf("%s (CfgMgr error: 0x%08x)", win32Error.Error(), uint32(ret)) } return fmt.Sprintf("CfgMgr error: 0x%08x", uint32(ret)) } func (ret CONFIGRET) Win32Error(defaultError Errno) Errno { return cm_MapCrToWin32Err(ret, defaultError) } func (ret CONFIGRET) Unwrap() error { const noMatch = Errno(^uintptr(0)) win32Error := ret.Win32Error(noMatch) if win32Error == noMatch { return nil } return win32Error } const ( CR_SUCCESS CONFIGRET = 0x00000000 CR_DEFAULT CONFIGRET = 0x00000001 CR_OUT_OF_MEMORY CONFIGRET = 0x00000002 CR_INVALID_POINTER CONFIGRET = 0x00000003 CR_INVALID_FLAG CONFIGRET = 0x00000004 CR_INVALID_DEVNODE CONFIGRET = 0x00000005 CR_INVALID_DEVINST = CR_INVALID_DEVNODE CR_INVALID_RES_DES CONFIGRET = 0x00000006 CR_INVALID_LOG_CONF CONFIGRET = 0x00000007 CR_INVALID_ARBITRATOR CONFIGRET = 0x00000008 CR_INVALID_NODELIST CONFIGRET = 0x00000009 CR_DEVNODE_HAS_REQS CONFIGRET = 0x0000000A CR_DEVINST_HAS_REQS = CR_DEVNODE_HAS_REQS CR_INVALID_RESOURCEID CONFIGRET = 0x0000000B CR_DLVXD_NOT_FOUND CONFIGRET = 0x0000000C CR_NO_SUCH_DEVNODE CONFIGRET = 0x0000000D CR_NO_SUCH_DEVINST = CR_NO_SUCH_DEVNODE CR_NO_MORE_LOG_CONF CONFIGRET = 0x0000000E CR_NO_MORE_RES_DES CONFIGRET = 0x0000000F CR_ALREADY_SUCH_DEVNODE CONFIGRET = 0x00000010 CR_ALREADY_SUCH_DEVINST = CR_ALREADY_SUCH_DEVNODE CR_INVALID_RANGE_LIST CONFIGRET = 0x00000011 CR_INVALID_RANGE CONFIGRET = 0x00000012 CR_FAILURE CONFIGRET = 0x00000013 CR_NO_SUCH_LOGICAL_DEV CONFIGRET = 0x00000014 CR_CREATE_BLOCKED CONFIGRET = 0x00000015 CR_NOT_SYSTEM_VM CONFIGRET = 0x00000016 CR_REMOVE_VETOED CONFIGRET = 0x00000017 CR_APM_VETOED CONFIGRET = 0x00000018 CR_INVALID_LOAD_TYPE CONFIGRET = 0x00000019 CR_BUFFER_SMALL CONFIGRET = 0x0000001A CR_NO_ARBITRATOR CONFIGRET = 0x0000001B CR_NO_REGISTRY_HANDLE CONFIGRET = 0x0000001C CR_REGISTRY_ERROR CONFIGRET = 0x0000001D CR_INVALID_DEVICE_ID CONFIGRET = 0x0000001E CR_INVALID_DATA CONFIGRET = 0x0000001F CR_INVALID_API CONFIGRET = 0x00000020 CR_DEVLOADER_NOT_READY CONFIGRET = 0x00000021 CR_NEED_RESTART CONFIGRET = 0x00000022 CR_NO_MORE_HW_PROFILES CONFIGRET = 0x00000023 CR_DEVICE_NOT_THERE CONFIGRET = 0x00000024 CR_NO_SUCH_VALUE CONFIGRET = 0x00000025 CR_WRONG_TYPE CONFIGRET = 0x00000026 CR_INVALID_PRIORITY CONFIGRET = 0x00000027 CR_NOT_DISABLEABLE CONFIGRET = 0x00000028 CR_FREE_RESOURCES CONFIGRET = 0x00000029 CR_QUERY_VETOED CONFIGRET = 0x0000002A CR_CANT_SHARE_IRQ CONFIGRET = 0x0000002B CR_NO_DEPENDENT CONFIGRET = 0x0000002C CR_SAME_RESOURCES CONFIGRET = 0x0000002D CR_NO_SUCH_REGISTRY_KEY CONFIGRET = 0x0000002E CR_INVALID_MACHINENAME CONFIGRET = 0x0000002F CR_REMOTE_COMM_FAILURE CONFIGRET = 0x00000030 CR_MACHINE_UNAVAILABLE CONFIGRET = 0x00000031 CR_NO_CM_SERVICES CONFIGRET = 0x00000032 CR_ACCESS_DENIED CONFIGRET = 0x00000033 CR_CALL_NOT_IMPLEMENTED CONFIGRET = 0x00000034 CR_INVALID_PROPERTY CONFIGRET = 0x00000035 CR_DEVICE_INTERFACE_ACTIVE CONFIGRET = 0x00000036 CR_NO_SUCH_DEVICE_INTERFACE CONFIGRET = 0x00000037 CR_INVALID_REFERENCE_STRING CONFIGRET = 0x00000038 CR_INVALID_CONFLICT_LIST CONFIGRET = 0x00000039 CR_INVALID_INDEX CONFIGRET = 0x0000003A CR_INVALID_STRUCTURE_SIZE CONFIGRET = 0x0000003B NUM_CR_RESULTS CONFIGRET = 0x0000003C ) const ( CM_GET_DEVICE_INTERFACE_LIST_PRESENT = 0 // only currently 'live' device interfaces CM_GET_DEVICE_INTERFACE_LIST_ALL_DEVICES = 1 // all registered device interfaces, live or not ) const ( DN_ROOT_ENUMERATED = 0x00000001 // Was enumerated by ROOT DN_DRIVER_LOADED = 0x00000002 // Has Register_Device_Driver DN_ENUM_LOADED = 0x00000004 // Has Register_Enumerator DN_STARTED = 0x00000008 // Is currently configured DN_MANUAL = 0x00000010 // Manually installed DN_NEED_TO_ENUM = 0x00000020 // May need reenumeration DN_NOT_FIRST_TIME = 0x00000040 // Has received a config DN_HARDWARE_ENUM = 0x00000080 // Enum generates hardware ID DN_LIAR = 0x00000100 // Lied about can reconfig once DN_HAS_MARK = 0x00000200 // Not CM_Create_DevInst lately DN_HAS_PROBLEM = 0x00000400 // Need device installer DN_FILTERED = 0x00000800 // Is filtered DN_MOVED = 0x00001000 // Has been moved DN_DISABLEABLE = 0x00002000 // Can be disabled DN_REMOVABLE = 0x00004000 // Can be removed DN_PRIVATE_PROBLEM = 0x00008000 // Has a private problem DN_MF_PARENT = 0x00010000 // Multi function parent DN_MF_CHILD = 0x00020000 // Multi function child DN_WILL_BE_REMOVED = 0x00040000 // DevInst is being removed DN_NOT_FIRST_TIMEE = 0x00080000 // Has received a config enumerate DN_STOP_FREE_RES = 0x00100000 // When child is stopped, free resources DN_REBAL_CANDIDATE = 0x00200000 // Don't skip during rebalance DN_BAD_PARTIAL = 0x00400000 // This devnode's log_confs do not have same resources DN_NT_ENUMERATOR = 0x00800000 // This devnode's is an NT enumerator DN_NT_DRIVER = 0x01000000 // This devnode's is an NT driver DN_NEEDS_LOCKING = 0x02000000 // Devnode need lock resume processing DN_ARM_WAKEUP = 0x04000000 // Devnode can be the wakeup device DN_APM_ENUMERATOR = 0x08000000 // APM aware enumerator DN_APM_DRIVER = 0x10000000 // APM aware driver DN_SILENT_INSTALL = 0x20000000 // Silent install DN_NO_SHOW_IN_DM = 0x40000000 // No show in device manager DN_BOOT_LOG_PROB = 0x80000000 // Had a problem during preassignment of boot log conf DN_NEED_RESTART = DN_LIAR // System needs to be restarted for this Devnode to work properly DN_DRIVER_BLOCKED = DN_NOT_FIRST_TIME // One or more drivers are blocked from loading for this Devnode DN_LEGACY_DRIVER = DN_MOVED // This device is using a legacy driver DN_CHILD_WITH_INVALID_ID = DN_HAS_MARK // One or more children have invalid IDs DN_DEVICE_DISCONNECTED = DN_NEEDS_LOCKING // The function driver for a device reported that the device is not connected. Typically this means a wireless device is out of range. DN_QUERY_REMOVE_PENDING = DN_MF_PARENT // Device is part of a set of related devices collectively pending query-removal DN_QUERY_REMOVE_ACTIVE = DN_MF_CHILD // Device is actively engaged in a query-remove IRP DN_CHANGEABLE_FLAGS = DN_NOT_FIRST_TIME | DN_HARDWARE_ENUM | DN_HAS_MARK | DN_DISABLEABLE | DN_REMOVABLE | DN_MF_CHILD | DN_MF_PARENT | DN_NOT_FIRST_TIMEE | DN_STOP_FREE_RES | DN_REBAL_CANDIDATE | DN_NT_ENUMERATOR | DN_NT_DRIVER | DN_SILENT_INSTALL | DN_NO_SHOW_IN_DM ) //sys setupDiCreateDeviceInfoListEx(classGUID *GUID, hwndParent uintptr, machineName *uint16, reserved uintptr) (handle DevInfo, err error) [failretval==DevInfo(InvalidHandle)] = setupapi.SetupDiCreateDeviceInfoListExW // SetupDiCreateDeviceInfoListEx function creates an empty device information set on a remote or a local computer and optionally associates the set with a device setup class. func SetupDiCreateDeviceInfoListEx(classGUID *GUID, hwndParent uintptr, machineName string) (deviceInfoSet DevInfo, err error) { var machineNameUTF16 *uint16 if machineName != "" { machineNameUTF16, err = UTF16PtrFromString(machineName) if err != nil { return } } return setupDiCreateDeviceInfoListEx(classGUID, hwndParent, machineNameUTF16, 0) } //sys setupDiGetDeviceInfoListDetail(deviceInfoSet DevInfo, deviceInfoSetDetailData *DevInfoListDetailData) (err error) = setupapi.SetupDiGetDeviceInfoListDetailW // SetupDiGetDeviceInfoListDetail function retrieves information associated with a device information set including the class GUID, remote computer handle, and remote computer name. func SetupDiGetDeviceInfoListDetail(deviceInfoSet DevInfo) (deviceInfoSetDetailData *DevInfoListDetailData, err error) { data := &DevInfoListDetailData{} data.size = data.unsafeSizeOf() return data, setupDiGetDeviceInfoListDetail(deviceInfoSet, data) } // DeviceInfoListDetail method retrieves information associated with a device information set including the class GUID, remote computer handle, and remote computer name. func (deviceInfoSet DevInfo) DeviceInfoListDetail() (*DevInfoListDetailData, error) { return SetupDiGetDeviceInfoListDetail(deviceInfoSet) } //sys setupDiCreateDeviceInfo(deviceInfoSet DevInfo, DeviceName *uint16, classGUID *GUID, DeviceDescription *uint16, hwndParent uintptr, CreationFlags DICD, deviceInfoData *DevInfoData) (err error) = setupapi.SetupDiCreateDeviceInfoW // SetupDiCreateDeviceInfo function creates a new device information element and adds it as a new member to the specified device information set. func SetupDiCreateDeviceInfo(deviceInfoSet DevInfo, deviceName string, classGUID *GUID, deviceDescription string, hwndParent uintptr, creationFlags DICD) (deviceInfoData *DevInfoData, err error) { deviceNameUTF16, err := UTF16PtrFromString(deviceName) if err != nil { return } var deviceDescriptionUTF16 *uint16 if deviceDescription != "" { deviceDescriptionUTF16, err = UTF16PtrFromString(deviceDescription) if err != nil { return } } data := &DevInfoData{} data.size = uint32(unsafe.Sizeof(*data)) return data, setupDiCreateDeviceInfo(deviceInfoSet, deviceNameUTF16, classGUID, deviceDescriptionUTF16, hwndParent, creationFlags, data) } // CreateDeviceInfo method creates a new device information element and adds it as a new member to the specified device information set. func (deviceInfoSet DevInfo) CreateDeviceInfo(deviceName string, classGUID *GUID, deviceDescription string, hwndParent uintptr, creationFlags DICD) (*DevInfoData, error) { return SetupDiCreateDeviceInfo(deviceInfoSet, deviceName, classGUID, deviceDescription, hwndParent, creationFlags) } //sys setupDiEnumDeviceInfo(deviceInfoSet DevInfo, memberIndex uint32, deviceInfoData *DevInfoData) (err error) = setupapi.SetupDiEnumDeviceInfo // SetupDiEnumDeviceInfo function returns a DevInfoData structure that specifies a device information element in a device information set. func SetupDiEnumDeviceInfo(deviceInfoSet DevInfo, memberIndex int) (*DevInfoData, error) { data := &DevInfoData{} data.size = uint32(unsafe.Sizeof(*data)) return data, setupDiEnumDeviceInfo(deviceInfoSet, uint32(memberIndex), data) } // EnumDeviceInfo method returns a DevInfoData structure that specifies a device information element in a device information set. func (deviceInfoSet DevInfo) EnumDeviceInfo(memberIndex int) (*DevInfoData, error) { return SetupDiEnumDeviceInfo(deviceInfoSet, memberIndex) } // SetupDiDestroyDeviceInfoList function deletes a device information set and frees all associated memory. //sys SetupDiDestroyDeviceInfoList(deviceInfoSet DevInfo) (err error) = setupapi.SetupDiDestroyDeviceInfoList // Close method deletes a device information set and frees all associated memory. func (deviceInfoSet DevInfo) Close() error { return SetupDiDestroyDeviceInfoList(deviceInfoSet) } //sys SetupDiBuildDriverInfoList(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverType SPDIT) (err error) = setupapi.SetupDiBuildDriverInfoList // BuildDriverInfoList method builds a list of drivers that is associated with a specific device or with the global class driver list for a device information set. func (deviceInfoSet DevInfo) BuildDriverInfoList(deviceInfoData *DevInfoData, driverType SPDIT) error { return SetupDiBuildDriverInfoList(deviceInfoSet, deviceInfoData, driverType) } //sys SetupDiCancelDriverInfoSearch(deviceInfoSet DevInfo) (err error) = setupapi.SetupDiCancelDriverInfoSearch // CancelDriverInfoSearch method cancels a driver list search that is currently in progress in a different thread. func (deviceInfoSet DevInfo) CancelDriverInfoSearch() error { return SetupDiCancelDriverInfoSearch(deviceInfoSet) } //sys setupDiEnumDriverInfo(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverType SPDIT, memberIndex uint32, driverInfoData *DrvInfoData) (err error) = setupapi.SetupDiEnumDriverInfoW // SetupDiEnumDriverInfo function enumerates the members of a driver list. func SetupDiEnumDriverInfo(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverType SPDIT, memberIndex int) (*DrvInfoData, error) { data := &DrvInfoData{} data.size = uint32(unsafe.Sizeof(*data)) return data, setupDiEnumDriverInfo(deviceInfoSet, deviceInfoData, driverType, uint32(memberIndex), data) } // EnumDriverInfo method enumerates the members of a driver list. func (deviceInfoSet DevInfo) EnumDriverInfo(deviceInfoData *DevInfoData, driverType SPDIT, memberIndex int) (*DrvInfoData, error) { return SetupDiEnumDriverInfo(deviceInfoSet, deviceInfoData, driverType, memberIndex) } //sys setupDiGetSelectedDriver(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverInfoData *DrvInfoData) (err error) = setupapi.SetupDiGetSelectedDriverW // SetupDiGetSelectedDriver function retrieves the selected driver for a device information set or a particular device information element. func SetupDiGetSelectedDriver(deviceInfoSet DevInfo, deviceInfoData *DevInfoData) (*DrvInfoData, error) { data := &DrvInfoData{} data.size = uint32(unsafe.Sizeof(*data)) return data, setupDiGetSelectedDriver(deviceInfoSet, deviceInfoData, data) } // SelectedDriver method retrieves the selected driver for a device information set or a particular device information element. func (deviceInfoSet DevInfo) SelectedDriver(deviceInfoData *DevInfoData) (*DrvInfoData, error) { return SetupDiGetSelectedDriver(deviceInfoSet, deviceInfoData) } //sys SetupDiSetSelectedDriver(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverInfoData *DrvInfoData) (err error) = setupapi.SetupDiSetSelectedDriverW // SetSelectedDriver method sets, or resets, the selected driver for a device information element or the selected class driver for a device information set. func (deviceInfoSet DevInfo) SetSelectedDriver(deviceInfoData *DevInfoData, driverInfoData *DrvInfoData) error { return SetupDiSetSelectedDriver(deviceInfoSet, deviceInfoData, driverInfoData) } //sys setupDiGetDriverInfoDetail(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverInfoData *DrvInfoData, driverInfoDetailData *DrvInfoDetailData, driverInfoDetailDataSize uint32, requiredSize *uint32) (err error) = setupapi.SetupDiGetDriverInfoDetailW // SetupDiGetDriverInfoDetail function retrieves driver information detail for a device information set or a particular device information element in the device information set. func SetupDiGetDriverInfoDetail(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverInfoData *DrvInfoData) (*DrvInfoDetailData, error) { reqSize := uint32(2048) for { buf := make([]byte, reqSize) data := (*DrvInfoDetailData)(unsafe.Pointer(&buf[0])) data.size = data.unsafeSizeOf() err := setupDiGetDriverInfoDetail(deviceInfoSet, deviceInfoData, driverInfoData, data, uint32(len(buf)), &reqSize) if err == ERROR_INSUFFICIENT_BUFFER { continue } if err != nil { return nil, err } data.size = reqSize return data, nil } } // DriverInfoDetail method retrieves driver information detail for a device information set or a particular device information element in the device information set. func (deviceInfoSet DevInfo) DriverInfoDetail(deviceInfoData *DevInfoData, driverInfoData *DrvInfoData) (*DrvInfoDetailData, error) { return SetupDiGetDriverInfoDetail(deviceInfoSet, deviceInfoData, driverInfoData) } //sys SetupDiDestroyDriverInfoList(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverType SPDIT) (err error) = setupapi.SetupDiDestroyDriverInfoList // DestroyDriverInfoList method deletes a driver list. func (deviceInfoSet DevInfo) DestroyDriverInfoList(deviceInfoData *DevInfoData, driverType SPDIT) error { return SetupDiDestroyDriverInfoList(deviceInfoSet, deviceInfoData, driverType) } //sys setupDiGetClassDevsEx(classGUID *GUID, Enumerator *uint16, hwndParent uintptr, Flags DIGCF, deviceInfoSet DevInfo, machineName *uint16, reserved uintptr) (handle DevInfo, err error) [failretval==DevInfo(InvalidHandle)] = setupapi.SetupDiGetClassDevsExW // SetupDiGetClassDevsEx function returns a handle to a device information set that contains requested device information elements for a local or a remote computer. func SetupDiGetClassDevsEx(classGUID *GUID, enumerator string, hwndParent uintptr, flags DIGCF, deviceInfoSet DevInfo, machineName string) (handle DevInfo, err error) { var enumeratorUTF16 *uint16 if enumerator != "" { enumeratorUTF16, err = UTF16PtrFromString(enumerator) if err != nil { return } } var machineNameUTF16 *uint16 if machineName != "" { machineNameUTF16, err = UTF16PtrFromString(machineName) if err != nil { return } } return setupDiGetClassDevsEx(classGUID, enumeratorUTF16, hwndParent, flags, deviceInfoSet, machineNameUTF16, 0) } // SetupDiCallClassInstaller function calls the appropriate class installer, and any registered co-installers, with the specified installation request (DIF code). //sys SetupDiCallClassInstaller(installFunction DI_FUNCTION, deviceInfoSet DevInfo, deviceInfoData *DevInfoData) (err error) = setupapi.SetupDiCallClassInstaller // CallClassInstaller member calls the appropriate class installer, and any registered co-installers, with the specified installation request (DIF code). func (deviceInfoSet DevInfo) CallClassInstaller(installFunction DI_FUNCTION, deviceInfoData *DevInfoData) error { return SetupDiCallClassInstaller(installFunction, deviceInfoSet, deviceInfoData) } // SetupDiOpenDevRegKey function opens a registry key for device-specific configuration information. //sys SetupDiOpenDevRegKey(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, Scope DICS_FLAG, HwProfile uint32, KeyType DIREG, samDesired uint32) (key Handle, err error) [failretval==InvalidHandle] = setupapi.SetupDiOpenDevRegKey // OpenDevRegKey method opens a registry key for device-specific configuration information. func (deviceInfoSet DevInfo) OpenDevRegKey(DeviceInfoData *DevInfoData, Scope DICS_FLAG, HwProfile uint32, KeyType DIREG, samDesired uint32) (Handle, error) { return SetupDiOpenDevRegKey(deviceInfoSet, DeviceInfoData, Scope, HwProfile, KeyType, samDesired) } //sys setupDiGetDeviceProperty(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, propertyKey *DEVPROPKEY, propertyType *DEVPROPTYPE, propertyBuffer *byte, propertyBufferSize uint32, requiredSize *uint32, flags uint32) (err error) = setupapi.SetupDiGetDevicePropertyW // SetupDiGetDeviceProperty function retrieves a specified device instance property. func SetupDiGetDeviceProperty(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, propertyKey *DEVPROPKEY) (value interface{}, err error) { reqSize := uint32(256) for { var dataType DEVPROPTYPE buf := make([]byte, reqSize) err = setupDiGetDeviceProperty(deviceInfoSet, deviceInfoData, propertyKey, &dataType, &buf[0], uint32(len(buf)), &reqSize, 0) if err == ERROR_INSUFFICIENT_BUFFER { continue } if err != nil { return } switch dataType { case DEVPROP_TYPE_STRING: ret := UTF16ToString(bufToUTF16(buf)) runtime.KeepAlive(buf) return ret, nil } return nil, errors.New("unimplemented property type") } } //sys setupDiGetDeviceRegistryProperty(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, property SPDRP, propertyRegDataType *uint32, propertyBuffer *byte, propertyBufferSize uint32, requiredSize *uint32) (err error) = setupapi.SetupDiGetDeviceRegistryPropertyW // SetupDiGetDeviceRegistryProperty function retrieves a specified Plug and Play device property. func SetupDiGetDeviceRegistryProperty(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, property SPDRP) (value interface{}, err error) { reqSize := uint32(256) for { var dataType uint32 buf := make([]byte, reqSize) err = setupDiGetDeviceRegistryProperty(deviceInfoSet, deviceInfoData, property, &dataType, &buf[0], uint32(len(buf)), &reqSize) if err == ERROR_INSUFFICIENT_BUFFER { continue } if err != nil { return } return getRegistryValue(buf[:reqSize], dataType) } } func getRegistryValue(buf []byte, dataType uint32) (interface{}, error) { switch dataType { case REG_SZ: ret := UTF16ToString(bufToUTF16(buf)) runtime.KeepAlive(buf) return ret, nil case REG_EXPAND_SZ: value := UTF16ToString(bufToUTF16(buf)) if value == "" { return "", nil } p, err := syscall.UTF16PtrFromString(value) if err != nil { return "", err } ret := make([]uint16, 100) for { n, err := ExpandEnvironmentStrings(p, &ret[0], uint32(len(ret))) if err != nil { return "", err } if n <= uint32(len(ret)) { return UTF16ToString(ret[:n]), nil } ret = make([]uint16, n) } case REG_BINARY: return buf, nil case REG_DWORD_LITTLE_ENDIAN: return binary.LittleEndian.Uint32(buf), nil case REG_DWORD_BIG_ENDIAN: return binary.BigEndian.Uint32(buf), nil case REG_MULTI_SZ: bufW := bufToUTF16(buf) a := []string{} for i := 0; i < len(bufW); { j := i + wcslen(bufW[i:]) if i < j { a = append(a, UTF16ToString(bufW[i:j])) } i = j + 1 } runtime.KeepAlive(buf) return a, nil case REG_QWORD_LITTLE_ENDIAN: return binary.LittleEndian.Uint64(buf), nil default: return nil, fmt.Errorf("Unsupported registry value type: %v", dataType) } } // bufToUTF16 function reinterprets []byte buffer as []uint16 func bufToUTF16(buf []byte) []uint16 { sl := struct { addr *uint16 len int cap int }{(*uint16)(unsafe.Pointer(&buf[0])), len(buf) / 2, cap(buf) / 2} return *(*[]uint16)(unsafe.Pointer(&sl)) } // utf16ToBuf function reinterprets []uint16 as []byte func utf16ToBuf(buf []uint16) []byte { sl := struct { addr *byte len int cap int }{(*byte)(unsafe.Pointer(&buf[0])), len(buf) * 2, cap(buf) * 2} return *(*[]byte)(unsafe.Pointer(&sl)) } func wcslen(str []uint16) int { for i := 0; i < len(str); i++ { if str[i] == 0 { return i } } return len(str) } // DeviceRegistryProperty method retrieves a specified Plug and Play device property. func (deviceInfoSet DevInfo) DeviceRegistryProperty(deviceInfoData *DevInfoData, property SPDRP) (interface{}, error) { return SetupDiGetDeviceRegistryProperty(deviceInfoSet, deviceInfoData, property) } //sys setupDiSetDeviceRegistryProperty(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, property SPDRP, propertyBuffer *byte, propertyBufferSize uint32) (err error) = setupapi.SetupDiSetDeviceRegistryPropertyW // SetupDiSetDeviceRegistryProperty function sets a Plug and Play device property for a device. func SetupDiSetDeviceRegistryProperty(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, property SPDRP, propertyBuffers []byte) error { return setupDiSetDeviceRegistryProperty(deviceInfoSet, deviceInfoData, property, &propertyBuffers[0], uint32(len(propertyBuffers))) } // SetDeviceRegistryProperty function sets a Plug and Play device property for a device. func (deviceInfoSet DevInfo) SetDeviceRegistryProperty(deviceInfoData *DevInfoData, property SPDRP, propertyBuffers []byte) error { return SetupDiSetDeviceRegistryProperty(deviceInfoSet, deviceInfoData, property, propertyBuffers) } // SetDeviceRegistryPropertyString method sets a Plug and Play device property string for a device. func (deviceInfoSet DevInfo) SetDeviceRegistryPropertyString(deviceInfoData *DevInfoData, property SPDRP, str string) error { str16, err := UTF16FromString(str) if err != nil { return err } err = SetupDiSetDeviceRegistryProperty(deviceInfoSet, deviceInfoData, property, utf16ToBuf(append(str16, 0))) runtime.KeepAlive(str16) return err } //sys setupDiGetDeviceInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, deviceInstallParams *DevInstallParams) (err error) = setupapi.SetupDiGetDeviceInstallParamsW // SetupDiGetDeviceInstallParams function retrieves device installation parameters for a device information set or a particular device information element. func SetupDiGetDeviceInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfoData) (*DevInstallParams, error) { params := &DevInstallParams{} params.size = uint32(unsafe.Sizeof(*params)) return params, setupDiGetDeviceInstallParams(deviceInfoSet, deviceInfoData, params) } // DeviceInstallParams method retrieves device installation parameters for a device information set or a particular device information element. func (deviceInfoSet DevInfo) DeviceInstallParams(deviceInfoData *DevInfoData) (*DevInstallParams, error) { return SetupDiGetDeviceInstallParams(deviceInfoSet, deviceInfoData) } //sys setupDiGetDeviceInstanceId(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, instanceId *uint16, instanceIdSize uint32, instanceIdRequiredSize *uint32) (err error) = setupapi.SetupDiGetDeviceInstanceIdW // SetupDiGetDeviceInstanceId function retrieves the instance ID of the device. func SetupDiGetDeviceInstanceId(deviceInfoSet DevInfo, deviceInfoData *DevInfoData) (string, error) { reqSize := uint32(1024) for { buf := make([]uint16, reqSize) err := setupDiGetDeviceInstanceId(deviceInfoSet, deviceInfoData, &buf[0], uint32(len(buf)), &reqSize) if err == ERROR_INSUFFICIENT_BUFFER { continue } if err != nil { return "", err } return UTF16ToString(buf), nil } } // DeviceInstanceID method retrieves the instance ID of the device. func (deviceInfoSet DevInfo) DeviceInstanceID(deviceInfoData *DevInfoData) (string, error) { return SetupDiGetDeviceInstanceId(deviceInfoSet, deviceInfoData) } // SetupDiGetClassInstallParams function retrieves class installation parameters for a device information set or a particular device information element. //sys SetupDiGetClassInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, classInstallParams *ClassInstallHeader, classInstallParamsSize uint32, requiredSize *uint32) (err error) = setupapi.SetupDiGetClassInstallParamsW // ClassInstallParams method retrieves class installation parameters for a device information set or a particular device information element. func (deviceInfoSet DevInfo) ClassInstallParams(deviceInfoData *DevInfoData, classInstallParams *ClassInstallHeader, classInstallParamsSize uint32, requiredSize *uint32) error { return SetupDiGetClassInstallParams(deviceInfoSet, deviceInfoData, classInstallParams, classInstallParamsSize, requiredSize) } //sys SetupDiSetDeviceInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, deviceInstallParams *DevInstallParams) (err error) = setupapi.SetupDiSetDeviceInstallParamsW // SetDeviceInstallParams member sets device installation parameters for a device information set or a particular device information element. func (deviceInfoSet DevInfo) SetDeviceInstallParams(deviceInfoData *DevInfoData, deviceInstallParams *DevInstallParams) error { return SetupDiSetDeviceInstallParams(deviceInfoSet, deviceInfoData, deviceInstallParams) } // SetupDiSetClassInstallParams function sets or clears class install parameters for a device information set or a particular device information element. //sys SetupDiSetClassInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, classInstallParams *ClassInstallHeader, classInstallParamsSize uint32) (err error) = setupapi.SetupDiSetClassInstallParamsW // SetClassInstallParams method sets or clears class install parameters for a device information set or a particular device information element. func (deviceInfoSet DevInfo) SetClassInstallParams(deviceInfoData *DevInfoData, classInstallParams *ClassInstallHeader, classInstallParamsSize uint32) error { return SetupDiSetClassInstallParams(deviceInfoSet, deviceInfoData, classInstallParams, classInstallParamsSize) } //sys setupDiClassNameFromGuidEx(classGUID *GUID, className *uint16, classNameSize uint32, requiredSize *uint32, machineName *uint16, reserved uintptr) (err error) = setupapi.SetupDiClassNameFromGuidExW // SetupDiClassNameFromGuidEx function retrieves the class name associated with a class GUID. The class can be installed on a local or remote computer. func SetupDiClassNameFromGuidEx(classGUID *GUID, machineName string) (className string, err error) { var classNameUTF16 [MAX_CLASS_NAME_LEN]uint16 var machineNameUTF16 *uint16 if machineName != "" { machineNameUTF16, err = UTF16PtrFromString(machineName) if err != nil { return } } err = setupDiClassNameFromGuidEx(classGUID, &classNameUTF16[0], MAX_CLASS_NAME_LEN, nil, machineNameUTF16, 0) if err != nil { return } className = UTF16ToString(classNameUTF16[:]) return } //sys setupDiClassGuidsFromNameEx(className *uint16, classGuidList *GUID, classGuidListSize uint32, requiredSize *uint32, machineName *uint16, reserved uintptr) (err error) = setupapi.SetupDiClassGuidsFromNameExW // SetupDiClassGuidsFromNameEx function retrieves the GUIDs associated with the specified class name. This resulting list contains the classes currently installed on a local or remote computer. func SetupDiClassGuidsFromNameEx(className string, machineName string) ([]GUID, error) { classNameUTF16, err := UTF16PtrFromString(className) if err != nil { return nil, err } var machineNameUTF16 *uint16 if machineName != "" { machineNameUTF16, err = UTF16PtrFromString(machineName) if err != nil { return nil, err } } reqSize := uint32(4) for { buf := make([]GUID, reqSize) err = setupDiClassGuidsFromNameEx(classNameUTF16, &buf[0], uint32(len(buf)), &reqSize, machineNameUTF16, 0) if err == ERROR_INSUFFICIENT_BUFFER { continue } if err != nil { return nil, err } return buf[:reqSize], nil } } //sys setupDiGetSelectedDevice(deviceInfoSet DevInfo, deviceInfoData *DevInfoData) (err error) = setupapi.SetupDiGetSelectedDevice // SetupDiGetSelectedDevice function retrieves the selected device information element in a device information set. func SetupDiGetSelectedDevice(deviceInfoSet DevInfo) (*DevInfoData, error) { data := &DevInfoData{} data.size = uint32(unsafe.Sizeof(*data)) return data, setupDiGetSelectedDevice(deviceInfoSet, data) } // SelectedDevice method retrieves the selected device information element in a device information set. func (deviceInfoSet DevInfo) SelectedDevice() (*DevInfoData, error) { return SetupDiGetSelectedDevice(deviceInfoSet) } // SetupDiSetSelectedDevice function sets a device information element as the selected member of a device information set. This function is typically used by an installation wizard. //sys SetupDiSetSelectedDevice(deviceInfoSet DevInfo, deviceInfoData *DevInfoData) (err error) = setupapi.SetupDiSetSelectedDevice // SetSelectedDevice method sets a device information element as the selected member of a device information set. This function is typically used by an installation wizard. func (deviceInfoSet DevInfo) SetSelectedDevice(deviceInfoData *DevInfoData) error { return SetupDiSetSelectedDevice(deviceInfoSet, deviceInfoData) } //sys setupUninstallOEMInf(infFileName *uint16, flags SUOI, reserved uintptr) (err error) = setupapi.SetupUninstallOEMInfW // SetupUninstallOEMInf uninstalls the specified driver. func SetupUninstallOEMInf(infFileName string, flags SUOI) error { infFileName16, err := UTF16PtrFromString(infFileName) if err != nil { return err } return setupUninstallOEMInf(infFileName16, flags, 0) } //sys cm_MapCrToWin32Err(configRet CONFIGRET, defaultWin32Error Errno) (ret Errno) = CfgMgr32.CM_MapCrToWin32Err //sys cm_Get_Device_Interface_List_Size(len *uint32, interfaceClass *GUID, deviceID *uint16, flags uint32) (ret CONFIGRET) = CfgMgr32.CM_Get_Device_Interface_List_SizeW //sys cm_Get_Device_Interface_List(interfaceClass *GUID, deviceID *uint16, buffer *uint16, bufferLen uint32, flags uint32) (ret CONFIGRET) = CfgMgr32.CM_Get_Device_Interface_ListW func CM_Get_Device_Interface_List(deviceID string, interfaceClass *GUID, flags uint32) ([]string, error) { deviceID16, err := UTF16PtrFromString(deviceID) if err != nil { return nil, err } var buf []uint16 var buflen uint32 for { if ret := cm_Get_Device_Interface_List_Size(&buflen, interfaceClass, deviceID16, flags); ret != CR_SUCCESS { return nil, ret } buf = make([]uint16, buflen) if ret := cm_Get_Device_Interface_List(interfaceClass, deviceID16, &buf[0], buflen, flags); ret == CR_SUCCESS { break } else if ret != CR_BUFFER_SMALL { return nil, ret } } var interfaces []string for i := 0; i < len(buf); { j := i + wcslen(buf[i:]) if i < j { interfaces = append(interfaces, UTF16ToString(buf[i:j])) } i = j + 1 } if interfaces == nil { return nil, ERROR_NO_SUCH_DEVICE_INTERFACE } return interfaces, nil } //sys cm_Get_DevNode_Status(status *uint32, problemNumber *uint32, devInst DEVINST, flags uint32) (ret CONFIGRET) = CfgMgr32.CM_Get_DevNode_Status func CM_Get_DevNode_Status(status *uint32, problemNumber *uint32, devInst DEVINST, flags uint32) error { ret := cm_Get_DevNode_Status(status, problemNumber, devInst, flags) if ret == CR_SUCCESS { return nil } return ret } ================================================ FILE: vendor/golang.org/x/sys/windows/str.go ================================================ // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build windows package windows func itoa(val int) string { // do it here rather than with fmt to avoid dependency if val < 0 { return "-" + itoa(-val) } var buf [32]byte // big enough for int64 i := len(buf) - 1 for val >= 10 { buf[i] = byte(val%10 + '0') i-- val /= 10 } buf[i] = byte(val + '0') return string(buf[i:]) } ================================================ FILE: vendor/golang.org/x/sys/windows/syscall.go ================================================ // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build windows // Package windows contains an interface to the low-level operating system // primitives. OS details vary depending on the underlying system, and // by default, godoc will display the OS-specific documentation for the current // system. If you want godoc to display syscall documentation for another // system, set $GOOS and $GOARCH to the desired system. For example, if // you want to view documentation for freebsd/arm on linux/amd64, set $GOOS // to freebsd and $GOARCH to arm. // // The primary use of this package is inside other packages that provide a more // portable interface to the system, such as "os", "time" and "net". Use // those packages rather than this one if you can. // // For details of the functions and data types in this package consult // the manuals for the appropriate operating system. // // These calls return err == nil to indicate success; otherwise // err represents an operating system error describing the failure and // holds a value of type syscall.Errno. package windows // import "golang.org/x/sys/windows" import ( "bytes" "strings" "syscall" "unsafe" ) // ByteSliceFromString returns a NUL-terminated slice of bytes // containing the text of s. If s contains a NUL byte at any // location, it returns (nil, syscall.EINVAL). func ByteSliceFromString(s string) ([]byte, error) { if strings.IndexByte(s, 0) != -1 { return nil, syscall.EINVAL } a := make([]byte, len(s)+1) copy(a, s) return a, nil } // BytePtrFromString returns a pointer to a NUL-terminated array of // bytes containing the text of s. If s contains a NUL byte at any // location, it returns (nil, syscall.EINVAL). func BytePtrFromString(s string) (*byte, error) { a, err := ByteSliceFromString(s) if err != nil { return nil, err } return &a[0], nil } // ByteSliceToString returns a string form of the text represented by the slice s, with a terminating NUL and any // bytes after the NUL removed. func ByteSliceToString(s []byte) string { if i := bytes.IndexByte(s, 0); i != -1 { s = s[:i] } return string(s) } // BytePtrToString takes a pointer to a sequence of text and returns the corresponding string. // If the pointer is nil, it returns the empty string. It assumes that the text sequence is terminated // at a zero byte; if the zero byte is not present, the program may crash. func BytePtrToString(p *byte) string { if p == nil { return "" } if *p == 0 { return "" } // Find NUL terminator. n := 0 for ptr := unsafe.Pointer(p); *(*byte)(ptr) != 0; n++ { ptr = unsafe.Pointer(uintptr(ptr) + 1) } return string(unsafe.Slice(p, n)) } // Single-word zero for use when we need a valid pointer to 0 bytes. // See mksyscall.pl. var _zero uintptr func (ts *Timespec) Unix() (sec int64, nsec int64) { return int64(ts.Sec), int64(ts.Nsec) } func (tv *Timeval) Unix() (sec int64, nsec int64) { return int64(tv.Sec), int64(tv.Usec) * 1000 } func (ts *Timespec) Nano() int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } func (tv *Timeval) Nano() int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1000 } ================================================ FILE: vendor/golang.org/x/sys/windows/syscall_windows.go ================================================ // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Windows system calls. package windows import ( errorspkg "errors" "fmt" "runtime" "sync" "syscall" "time" "unicode/utf16" "unsafe" ) type ( Handle uintptr HWND uintptr ) const ( InvalidHandle = ^Handle(0) InvalidHWND = ^HWND(0) // Flags for DefineDosDevice. DDD_EXACT_MATCH_ON_REMOVE = 0x00000004 DDD_NO_BROADCAST_SYSTEM = 0x00000008 DDD_RAW_TARGET_PATH = 0x00000001 DDD_REMOVE_DEFINITION = 0x00000002 // Return values for GetDriveType. DRIVE_UNKNOWN = 0 DRIVE_NO_ROOT_DIR = 1 DRIVE_REMOVABLE = 2 DRIVE_FIXED = 3 DRIVE_REMOTE = 4 DRIVE_CDROM = 5 DRIVE_RAMDISK = 6 // File system flags from GetVolumeInformation and GetVolumeInformationByHandle. FILE_CASE_SENSITIVE_SEARCH = 0x00000001 FILE_CASE_PRESERVED_NAMES = 0x00000002 FILE_FILE_COMPRESSION = 0x00000010 FILE_DAX_VOLUME = 0x20000000 FILE_NAMED_STREAMS = 0x00040000 FILE_PERSISTENT_ACLS = 0x00000008 FILE_READ_ONLY_VOLUME = 0x00080000 FILE_SEQUENTIAL_WRITE_ONCE = 0x00100000 FILE_SUPPORTS_ENCRYPTION = 0x00020000 FILE_SUPPORTS_EXTENDED_ATTRIBUTES = 0x00800000 FILE_SUPPORTS_HARD_LINKS = 0x00400000 FILE_SUPPORTS_OBJECT_IDS = 0x00010000 FILE_SUPPORTS_OPEN_BY_FILE_ID = 0x01000000 FILE_SUPPORTS_REPARSE_POINTS = 0x00000080 FILE_SUPPORTS_SPARSE_FILES = 0x00000040 FILE_SUPPORTS_TRANSACTIONS = 0x00200000 FILE_SUPPORTS_USN_JOURNAL = 0x02000000 FILE_UNICODE_ON_DISK = 0x00000004 FILE_VOLUME_IS_COMPRESSED = 0x00008000 FILE_VOLUME_QUOTAS = 0x00000020 // Flags for LockFileEx. LOCKFILE_FAIL_IMMEDIATELY = 0x00000001 LOCKFILE_EXCLUSIVE_LOCK = 0x00000002 // Return value of SleepEx and other APC functions WAIT_IO_COMPLETION = 0x000000C0 ) // StringToUTF16 is deprecated. Use UTF16FromString instead. // If s contains a NUL byte this function panics instead of // returning an error. func StringToUTF16(s string) []uint16 { a, err := UTF16FromString(s) if err != nil { panic("windows: string with NUL passed to StringToUTF16") } return a } // UTF16FromString returns the UTF-16 encoding of the UTF-8 string // s, with a terminating NUL added. If s contains a NUL byte at any // location, it returns (nil, syscall.EINVAL). func UTF16FromString(s string) ([]uint16, error) { return syscall.UTF16FromString(s) } // UTF16ToString returns the UTF-8 encoding of the UTF-16 sequence s, // with a terminating NUL and any bytes after the NUL removed. func UTF16ToString(s []uint16) string { return syscall.UTF16ToString(s) } // StringToUTF16Ptr is deprecated. Use UTF16PtrFromString instead. // If s contains a NUL byte this function panics instead of // returning an error. func StringToUTF16Ptr(s string) *uint16 { return &StringToUTF16(s)[0] } // UTF16PtrFromString returns pointer to the UTF-16 encoding of // the UTF-8 string s, with a terminating NUL added. If s // contains a NUL byte at any location, it returns (nil, syscall.EINVAL). func UTF16PtrFromString(s string) (*uint16, error) { a, err := UTF16FromString(s) if err != nil { return nil, err } return &a[0], nil } // UTF16PtrToString takes a pointer to a UTF-16 sequence and returns the corresponding UTF-8 encoded string. // If the pointer is nil, it returns the empty string. It assumes that the UTF-16 sequence is terminated // at a zero word; if the zero word is not present, the program may crash. func UTF16PtrToString(p *uint16) string { if p == nil { return "" } if *p == 0 { return "" } // Find NUL terminator. n := 0 for ptr := unsafe.Pointer(p); *(*uint16)(ptr) != 0; n++ { ptr = unsafe.Pointer(uintptr(ptr) + unsafe.Sizeof(*p)) } return UTF16ToString(unsafe.Slice(p, n)) } func Getpagesize() int { return 4096 } // NewCallback converts a Go function to a function pointer conforming to the stdcall calling convention. // This is useful when interoperating with Windows code requiring callbacks. // The argument is expected to be a function with one uintptr-sized result. The function must not have arguments with size larger than the size of uintptr. func NewCallback(fn interface{}) uintptr { return syscall.NewCallback(fn) } // NewCallbackCDecl converts a Go function to a function pointer conforming to the cdecl calling convention. // This is useful when interoperating with Windows code requiring callbacks. // The argument is expected to be a function with one uintptr-sized result. The function must not have arguments with size larger than the size of uintptr. func NewCallbackCDecl(fn interface{}) uintptr { return syscall.NewCallbackCDecl(fn) } // windows api calls //sys GetLastError() (lasterr error) //sys LoadLibrary(libname string) (handle Handle, err error) = LoadLibraryW //sys LoadLibraryEx(libname string, zero Handle, flags uintptr) (handle Handle, err error) = LoadLibraryExW //sys FreeLibrary(handle Handle) (err error) //sys GetProcAddress(module Handle, procname string) (proc uintptr, err error) //sys GetModuleFileName(module Handle, filename *uint16, size uint32) (n uint32, err error) = kernel32.GetModuleFileNameW //sys GetModuleHandleEx(flags uint32, moduleName *uint16, module *Handle) (err error) = kernel32.GetModuleHandleExW //sys SetDefaultDllDirectories(directoryFlags uint32) (err error) //sys AddDllDirectory(path *uint16) (cookie uintptr, err error) = kernel32.AddDllDirectory //sys RemoveDllDirectory(cookie uintptr) (err error) = kernel32.RemoveDllDirectory //sys SetDllDirectory(path string) (err error) = kernel32.SetDllDirectoryW //sys GetVersion() (ver uint32, err error) //sys FormatMessage(flags uint32, msgsrc uintptr, msgid uint32, langid uint32, buf []uint16, args *byte) (n uint32, err error) = FormatMessageW //sys ExitProcess(exitcode uint32) //sys IsWow64Process(handle Handle, isWow64 *bool) (err error) = IsWow64Process //sys IsWow64Process2(handle Handle, processMachine *uint16, nativeMachine *uint16) (err error) = IsWow64Process2? //sys CreateFile(name *uint16, access uint32, mode uint32, sa *SecurityAttributes, createmode uint32, attrs uint32, templatefile Handle) (handle Handle, err error) [failretval==InvalidHandle] = CreateFileW //sys CreateNamedPipe(name *uint16, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *SecurityAttributes) (handle Handle, err error) [failretval==InvalidHandle] = CreateNamedPipeW //sys ConnectNamedPipe(pipe Handle, overlapped *Overlapped) (err error) //sys DisconnectNamedPipe(pipe Handle) (err error) //sys GetNamedPipeClientProcessId(pipe Handle, clientProcessID *uint32) (err error) //sys GetNamedPipeServerProcessId(pipe Handle, serverProcessID *uint32) (err error) //sys GetNamedPipeInfo(pipe Handle, flags *uint32, outSize *uint32, inSize *uint32, maxInstances *uint32) (err error) //sys GetNamedPipeHandleState(pipe Handle, state *uint32, curInstances *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32, userName *uint16, maxUserNameSize uint32) (err error) = GetNamedPipeHandleStateW //sys SetNamedPipeHandleState(pipe Handle, state *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32) (err error) = SetNamedPipeHandleState //sys readFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) (err error) = ReadFile //sys writeFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) (err error) = WriteFile //sys GetOverlappedResult(handle Handle, overlapped *Overlapped, done *uint32, wait bool) (err error) //sys SetFilePointer(handle Handle, lowoffset int32, highoffsetptr *int32, whence uint32) (newlowoffset uint32, err error) [failretval==0xffffffff] //sys CloseHandle(handle Handle) (err error) //sys GetStdHandle(stdhandle uint32) (handle Handle, err error) [failretval==InvalidHandle] //sys SetStdHandle(stdhandle uint32, handle Handle) (err error) //sys findFirstFile1(name *uint16, data *win32finddata1) (handle Handle, err error) [failretval==InvalidHandle] = FindFirstFileW //sys findNextFile1(handle Handle, data *win32finddata1) (err error) = FindNextFileW //sys FindClose(handle Handle) (err error) //sys GetFileInformationByHandle(handle Handle, data *ByHandleFileInformation) (err error) //sys GetFileInformationByHandleEx(handle Handle, class uint32, outBuffer *byte, outBufferLen uint32) (err error) //sys SetFileInformationByHandle(handle Handle, class uint32, inBuffer *byte, inBufferLen uint32) (err error) //sys GetCurrentDirectory(buflen uint32, buf *uint16) (n uint32, err error) = GetCurrentDirectoryW //sys SetCurrentDirectory(path *uint16) (err error) = SetCurrentDirectoryW //sys CreateDirectory(path *uint16, sa *SecurityAttributes) (err error) = CreateDirectoryW //sys RemoveDirectory(path *uint16) (err error) = RemoveDirectoryW //sys DeleteFile(path *uint16) (err error) = DeleteFileW //sys MoveFile(from *uint16, to *uint16) (err error) = MoveFileW //sys MoveFileEx(from *uint16, to *uint16, flags uint32) (err error) = MoveFileExW //sys LockFileEx(file Handle, flags uint32, reserved uint32, bytesLow uint32, bytesHigh uint32, overlapped *Overlapped) (err error) //sys UnlockFileEx(file Handle, reserved uint32, bytesLow uint32, bytesHigh uint32, overlapped *Overlapped) (err error) //sys GetComputerName(buf *uint16, n *uint32) (err error) = GetComputerNameW //sys GetComputerNameEx(nametype uint32, buf *uint16, n *uint32) (err error) = GetComputerNameExW //sys SetEndOfFile(handle Handle) (err error) //sys SetFileValidData(handle Handle, validDataLength int64) (err error) //sys GetSystemTimeAsFileTime(time *Filetime) //sys GetSystemTimePreciseAsFileTime(time *Filetime) //sys GetTimeZoneInformation(tzi *Timezoneinformation) (rc uint32, err error) [failretval==0xffffffff] //sys CreateIoCompletionPort(filehandle Handle, cphandle Handle, key uintptr, threadcnt uint32) (handle Handle, err error) //sys GetQueuedCompletionStatus(cphandle Handle, qty *uint32, key *uintptr, overlapped **Overlapped, timeout uint32) (err error) //sys PostQueuedCompletionStatus(cphandle Handle, qty uint32, key uintptr, overlapped *Overlapped) (err error) //sys CancelIo(s Handle) (err error) //sys CancelIoEx(s Handle, o *Overlapped) (err error) //sys CreateProcess(appName *uint16, commandLine *uint16, procSecurity *SecurityAttributes, threadSecurity *SecurityAttributes, inheritHandles bool, creationFlags uint32, env *uint16, currentDir *uint16, startupInfo *StartupInfo, outProcInfo *ProcessInformation) (err error) = CreateProcessW //sys CreateProcessAsUser(token Token, appName *uint16, commandLine *uint16, procSecurity *SecurityAttributes, threadSecurity *SecurityAttributes, inheritHandles bool, creationFlags uint32, env *uint16, currentDir *uint16, startupInfo *StartupInfo, outProcInfo *ProcessInformation) (err error) = advapi32.CreateProcessAsUserW //sys initializeProcThreadAttributeList(attrlist *ProcThreadAttributeList, attrcount uint32, flags uint32, size *uintptr) (err error) = InitializeProcThreadAttributeList //sys deleteProcThreadAttributeList(attrlist *ProcThreadAttributeList) = DeleteProcThreadAttributeList //sys updateProcThreadAttribute(attrlist *ProcThreadAttributeList, flags uint32, attr uintptr, value unsafe.Pointer, size uintptr, prevvalue unsafe.Pointer, returnedsize *uintptr) (err error) = UpdateProcThreadAttribute //sys OpenProcess(desiredAccess uint32, inheritHandle bool, processId uint32) (handle Handle, err error) //sys ShellExecute(hwnd Handle, verb *uint16, file *uint16, args *uint16, cwd *uint16, showCmd int32) (err error) [failretval<=32] = shell32.ShellExecuteW //sys GetWindowThreadProcessId(hwnd HWND, pid *uint32) (tid uint32, err error) = user32.GetWindowThreadProcessId //sys LoadKeyboardLayout(name *uint16, flags uint32) (hkl Handle, err error) [failretval==0] = user32.LoadKeyboardLayoutW //sys UnloadKeyboardLayout(hkl Handle) (err error) = user32.UnloadKeyboardLayout //sys GetKeyboardLayout(tid uint32) (hkl Handle) = user32.GetKeyboardLayout //sys ToUnicodeEx(vkey uint32, scancode uint32, keystate *byte, pwszBuff *uint16, cchBuff int32, flags uint32, hkl Handle) (ret int32) = user32.ToUnicodeEx //sys GetShellWindow() (shellWindow HWND) = user32.GetShellWindow //sys MessageBox(hwnd HWND, text *uint16, caption *uint16, boxtype uint32) (ret int32, err error) [failretval==0] = user32.MessageBoxW //sys ExitWindowsEx(flags uint32, reason uint32) (err error) = user32.ExitWindowsEx //sys shGetKnownFolderPath(id *KNOWNFOLDERID, flags uint32, token Token, path **uint16) (ret error) = shell32.SHGetKnownFolderPath //sys TerminateProcess(handle Handle, exitcode uint32) (err error) //sys GetExitCodeProcess(handle Handle, exitcode *uint32) (err error) //sys getStartupInfo(startupInfo *StartupInfo) = GetStartupInfoW //sys GetProcessTimes(handle Handle, creationTime *Filetime, exitTime *Filetime, kernelTime *Filetime, userTime *Filetime) (err error) //sys DuplicateHandle(hSourceProcessHandle Handle, hSourceHandle Handle, hTargetProcessHandle Handle, lpTargetHandle *Handle, dwDesiredAccess uint32, bInheritHandle bool, dwOptions uint32) (err error) //sys WaitForSingleObject(handle Handle, waitMilliseconds uint32) (event uint32, err error) [failretval==0xffffffff] //sys waitForMultipleObjects(count uint32, handles uintptr, waitAll bool, waitMilliseconds uint32) (event uint32, err error) [failretval==0xffffffff] = WaitForMultipleObjects //sys GetTempPath(buflen uint32, buf *uint16) (n uint32, err error) = GetTempPathW //sys CreatePipe(readhandle *Handle, writehandle *Handle, sa *SecurityAttributes, size uint32) (err error) //sys GetFileType(filehandle Handle) (n uint32, err error) //sys CryptAcquireContext(provhandle *Handle, container *uint16, provider *uint16, provtype uint32, flags uint32) (err error) = advapi32.CryptAcquireContextW //sys CryptReleaseContext(provhandle Handle, flags uint32) (err error) = advapi32.CryptReleaseContext //sys CryptGenRandom(provhandle Handle, buflen uint32, buf *byte) (err error) = advapi32.CryptGenRandom //sys GetEnvironmentStrings() (envs *uint16, err error) [failretval==nil] = kernel32.GetEnvironmentStringsW //sys FreeEnvironmentStrings(envs *uint16) (err error) = kernel32.FreeEnvironmentStringsW //sys GetEnvironmentVariable(name *uint16, buffer *uint16, size uint32) (n uint32, err error) = kernel32.GetEnvironmentVariableW //sys SetEnvironmentVariable(name *uint16, value *uint16) (err error) = kernel32.SetEnvironmentVariableW //sys ExpandEnvironmentStrings(src *uint16, dst *uint16, size uint32) (n uint32, err error) = kernel32.ExpandEnvironmentStringsW //sys CreateEnvironmentBlock(block **uint16, token Token, inheritExisting bool) (err error) = userenv.CreateEnvironmentBlock //sys DestroyEnvironmentBlock(block *uint16) (err error) = userenv.DestroyEnvironmentBlock //sys getTickCount64() (ms uint64) = kernel32.GetTickCount64 //sys GetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetime) (err error) //sys SetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetime) (err error) //sys GetFileAttributes(name *uint16) (attrs uint32, err error) [failretval==INVALID_FILE_ATTRIBUTES] = kernel32.GetFileAttributesW //sys SetFileAttributes(name *uint16, attrs uint32) (err error) = kernel32.SetFileAttributesW //sys GetFileAttributesEx(name *uint16, level uint32, info *byte) (err error) = kernel32.GetFileAttributesExW //sys GetCommandLine() (cmd *uint16) = kernel32.GetCommandLineW //sys commandLineToArgv(cmd *uint16, argc *int32) (argv **uint16, err error) [failretval==nil] = shell32.CommandLineToArgvW //sys LocalFree(hmem Handle) (handle Handle, err error) [failretval!=0] //sys LocalAlloc(flags uint32, length uint32) (ptr uintptr, err error) //sys SetHandleInformation(handle Handle, mask uint32, flags uint32) (err error) //sys FlushFileBuffers(handle Handle) (err error) //sys GetFullPathName(path *uint16, buflen uint32, buf *uint16, fname **uint16) (n uint32, err error) = kernel32.GetFullPathNameW //sys GetLongPathName(path *uint16, buf *uint16, buflen uint32) (n uint32, err error) = kernel32.GetLongPathNameW //sys GetShortPathName(longpath *uint16, shortpath *uint16, buflen uint32) (n uint32, err error) = kernel32.GetShortPathNameW //sys GetFinalPathNameByHandle(file Handle, filePath *uint16, filePathSize uint32, flags uint32) (n uint32, err error) = kernel32.GetFinalPathNameByHandleW //sys CreateFileMapping(fhandle Handle, sa *SecurityAttributes, prot uint32, maxSizeHigh uint32, maxSizeLow uint32, name *uint16) (handle Handle, err error) [failretval == 0 || e1 == ERROR_ALREADY_EXISTS] = kernel32.CreateFileMappingW //sys MapViewOfFile(handle Handle, access uint32, offsetHigh uint32, offsetLow uint32, length uintptr) (addr uintptr, err error) //sys UnmapViewOfFile(addr uintptr) (err error) //sys FlushViewOfFile(addr uintptr, length uintptr) (err error) //sys VirtualLock(addr uintptr, length uintptr) (err error) //sys VirtualUnlock(addr uintptr, length uintptr) (err error) //sys VirtualAlloc(address uintptr, size uintptr, alloctype uint32, protect uint32) (value uintptr, err error) = kernel32.VirtualAlloc //sys VirtualFree(address uintptr, size uintptr, freetype uint32) (err error) = kernel32.VirtualFree //sys VirtualProtect(address uintptr, size uintptr, newprotect uint32, oldprotect *uint32) (err error) = kernel32.VirtualProtect //sys VirtualProtectEx(process Handle, address uintptr, size uintptr, newProtect uint32, oldProtect *uint32) (err error) = kernel32.VirtualProtectEx //sys VirtualQuery(address uintptr, buffer *MemoryBasicInformation, length uintptr) (err error) = kernel32.VirtualQuery //sys VirtualQueryEx(process Handle, address uintptr, buffer *MemoryBasicInformation, length uintptr) (err error) = kernel32.VirtualQueryEx //sys ReadProcessMemory(process Handle, baseAddress uintptr, buffer *byte, size uintptr, numberOfBytesRead *uintptr) (err error) = kernel32.ReadProcessMemory //sys WriteProcessMemory(process Handle, baseAddress uintptr, buffer *byte, size uintptr, numberOfBytesWritten *uintptr) (err error) = kernel32.WriteProcessMemory //sys TransmitFile(s Handle, handle Handle, bytesToWrite uint32, bytsPerSend uint32, overlapped *Overlapped, transmitFileBuf *TransmitFileBuffers, flags uint32) (err error) = mswsock.TransmitFile //sys ReadDirectoryChanges(handle Handle, buf *byte, buflen uint32, watchSubTree bool, mask uint32, retlen *uint32, overlapped *Overlapped, completionRoutine uintptr) (err error) = kernel32.ReadDirectoryChangesW //sys FindFirstChangeNotification(path string, watchSubtree bool, notifyFilter uint32) (handle Handle, err error) [failretval==InvalidHandle] = kernel32.FindFirstChangeNotificationW //sys FindNextChangeNotification(handle Handle) (err error) //sys FindCloseChangeNotification(handle Handle) (err error) //sys CertOpenSystemStore(hprov Handle, name *uint16) (store Handle, err error) = crypt32.CertOpenSystemStoreW //sys CertOpenStore(storeProvider uintptr, msgAndCertEncodingType uint32, cryptProv uintptr, flags uint32, para uintptr) (handle Handle, err error) = crypt32.CertOpenStore //sys CertEnumCertificatesInStore(store Handle, prevContext *CertContext) (context *CertContext, err error) [failretval==nil] = crypt32.CertEnumCertificatesInStore //sys CertAddCertificateContextToStore(store Handle, certContext *CertContext, addDisposition uint32, storeContext **CertContext) (err error) = crypt32.CertAddCertificateContextToStore //sys CertCloseStore(store Handle, flags uint32) (err error) = crypt32.CertCloseStore //sys CertDeleteCertificateFromStore(certContext *CertContext) (err error) = crypt32.CertDeleteCertificateFromStore //sys CertDuplicateCertificateContext(certContext *CertContext) (dupContext *CertContext) = crypt32.CertDuplicateCertificateContext //sys PFXImportCertStore(pfx *CryptDataBlob, password *uint16, flags uint32) (store Handle, err error) = crypt32.PFXImportCertStore //sys CertGetCertificateChain(engine Handle, leaf *CertContext, time *Filetime, additionalStore Handle, para *CertChainPara, flags uint32, reserved uintptr, chainCtx **CertChainContext) (err error) = crypt32.CertGetCertificateChain //sys CertFreeCertificateChain(ctx *CertChainContext) = crypt32.CertFreeCertificateChain //sys CertCreateCertificateContext(certEncodingType uint32, certEncoded *byte, encodedLen uint32) (context *CertContext, err error) [failretval==nil] = crypt32.CertCreateCertificateContext //sys CertFreeCertificateContext(ctx *CertContext) (err error) = crypt32.CertFreeCertificateContext //sys CertVerifyCertificateChainPolicy(policyOID uintptr, chain *CertChainContext, para *CertChainPolicyPara, status *CertChainPolicyStatus) (err error) = crypt32.CertVerifyCertificateChainPolicy //sys CertGetNameString(certContext *CertContext, nameType uint32, flags uint32, typePara unsafe.Pointer, name *uint16, size uint32) (chars uint32) = crypt32.CertGetNameStringW //sys CertFindExtension(objId *byte, countExtensions uint32, extensions *CertExtension) (ret *CertExtension) = crypt32.CertFindExtension //sys CertFindCertificateInStore(store Handle, certEncodingType uint32, findFlags uint32, findType uint32, findPara unsafe.Pointer, prevCertContext *CertContext) (cert *CertContext, err error) [failretval==nil] = crypt32.CertFindCertificateInStore //sys CertFindChainInStore(store Handle, certEncodingType uint32, findFlags uint32, findType uint32, findPara unsafe.Pointer, prevChainContext *CertChainContext) (certchain *CertChainContext, err error) [failretval==nil] = crypt32.CertFindChainInStore //sys CryptAcquireCertificatePrivateKey(cert *CertContext, flags uint32, parameters unsafe.Pointer, cryptProvOrNCryptKey *Handle, keySpec *uint32, callerFreeProvOrNCryptKey *bool) (err error) = crypt32.CryptAcquireCertificatePrivateKey //sys CryptQueryObject(objectType uint32, object unsafe.Pointer, expectedContentTypeFlags uint32, expectedFormatTypeFlags uint32, flags uint32, msgAndCertEncodingType *uint32, contentType *uint32, formatType *uint32, certStore *Handle, msg *Handle, context *unsafe.Pointer) (err error) = crypt32.CryptQueryObject //sys CryptDecodeObject(encodingType uint32, structType *byte, encodedBytes *byte, lenEncodedBytes uint32, flags uint32, decoded unsafe.Pointer, decodedLen *uint32) (err error) = crypt32.CryptDecodeObject //sys CryptProtectData(dataIn *DataBlob, name *uint16, optionalEntropy *DataBlob, reserved uintptr, promptStruct *CryptProtectPromptStruct, flags uint32, dataOut *DataBlob) (err error) = crypt32.CryptProtectData //sys CryptUnprotectData(dataIn *DataBlob, name **uint16, optionalEntropy *DataBlob, reserved uintptr, promptStruct *CryptProtectPromptStruct, flags uint32, dataOut *DataBlob) (err error) = crypt32.CryptUnprotectData //sys WinVerifyTrustEx(hwnd HWND, actionId *GUID, data *WinTrustData) (ret error) = wintrust.WinVerifyTrustEx //sys RegOpenKeyEx(key Handle, subkey *uint16, options uint32, desiredAccess uint32, result *Handle) (regerrno error) = advapi32.RegOpenKeyExW //sys RegCloseKey(key Handle) (regerrno error) = advapi32.RegCloseKey //sys 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) = advapi32.RegQueryInfoKeyW //sys RegEnumKeyEx(key Handle, index uint32, name *uint16, nameLen *uint32, reserved *uint32, class *uint16, classLen *uint32, lastWriteTime *Filetime) (regerrno error) = advapi32.RegEnumKeyExW //sys RegQueryValueEx(key Handle, name *uint16, reserved *uint32, valtype *uint32, buf *byte, buflen *uint32) (regerrno error) = advapi32.RegQueryValueExW //sys RegNotifyChangeKeyValue(key Handle, watchSubtree bool, notifyFilter uint32, event Handle, asynchronous bool) (regerrno error) = advapi32.RegNotifyChangeKeyValue //sys GetCurrentProcessId() (pid uint32) = kernel32.GetCurrentProcessId //sys ProcessIdToSessionId(pid uint32, sessionid *uint32) (err error) = kernel32.ProcessIdToSessionId //sys ClosePseudoConsole(console Handle) = kernel32.ClosePseudoConsole //sys createPseudoConsole(size uint32, in Handle, out Handle, flags uint32, pconsole *Handle) (hr error) = kernel32.CreatePseudoConsole //sys GetConsoleMode(console Handle, mode *uint32) (err error) = kernel32.GetConsoleMode //sys SetConsoleMode(console Handle, mode uint32) (err error) = kernel32.SetConsoleMode //sys GetConsoleScreenBufferInfo(console Handle, info *ConsoleScreenBufferInfo) (err error) = kernel32.GetConsoleScreenBufferInfo //sys setConsoleCursorPosition(console Handle, position uint32) (err error) = kernel32.SetConsoleCursorPosition //sys GetConsoleCP() (cp uint32, err error) = kernel32.GetConsoleCP //sys GetConsoleOutputCP() (cp uint32, err error) = kernel32.GetConsoleOutputCP //sys SetConsoleCP(cp uint32) (err error) = kernel32.SetConsoleCP //sys SetConsoleOutputCP(cp uint32) (err error) = kernel32.SetConsoleOutputCP //sys WriteConsole(console Handle, buf *uint16, towrite uint32, written *uint32, reserved *byte) (err error) = kernel32.WriteConsoleW //sys ReadConsole(console Handle, buf *uint16, toread uint32, read *uint32, inputControl *byte) (err error) = kernel32.ReadConsoleW //sys GetNumberOfConsoleInputEvents(console Handle, numevents *uint32) (err error) = kernel32.GetNumberOfConsoleInputEvents //sys FlushConsoleInputBuffer(console Handle) (err error) = kernel32.FlushConsoleInputBuffer //sys resizePseudoConsole(pconsole Handle, size uint32) (hr error) = kernel32.ResizePseudoConsole //sys CreateToolhelp32Snapshot(flags uint32, processId uint32) (handle Handle, err error) [failretval==InvalidHandle] = kernel32.CreateToolhelp32Snapshot //sys Module32First(snapshot Handle, moduleEntry *ModuleEntry32) (err error) = kernel32.Module32FirstW //sys Module32Next(snapshot Handle, moduleEntry *ModuleEntry32) (err error) = kernel32.Module32NextW //sys Process32First(snapshot Handle, procEntry *ProcessEntry32) (err error) = kernel32.Process32FirstW //sys Process32Next(snapshot Handle, procEntry *ProcessEntry32) (err error) = kernel32.Process32NextW //sys Thread32First(snapshot Handle, threadEntry *ThreadEntry32) (err error) //sys Thread32Next(snapshot Handle, threadEntry *ThreadEntry32) (err error) //sys DeviceIoControl(handle Handle, ioControlCode uint32, inBuffer *byte, inBufferSize uint32, outBuffer *byte, outBufferSize uint32, bytesReturned *uint32, overlapped *Overlapped) (err error) // This function returns 1 byte BOOLEAN rather than the 4 byte BOOL. //sys CreateSymbolicLink(symlinkfilename *uint16, targetfilename *uint16, flags uint32) (err error) [failretval&0xff==0] = CreateSymbolicLinkW //sys CreateHardLink(filename *uint16, existingfilename *uint16, reserved uintptr) (err error) [failretval&0xff==0] = CreateHardLinkW //sys GetCurrentThreadId() (id uint32) //sys CreateEvent(eventAttrs *SecurityAttributes, manualReset uint32, initialState uint32, name *uint16) (handle Handle, err error) [failretval == 0 || e1 == ERROR_ALREADY_EXISTS] = kernel32.CreateEventW //sys CreateEventEx(eventAttrs *SecurityAttributes, name *uint16, flags uint32, desiredAccess uint32) (handle Handle, err error) [failretval == 0 || e1 == ERROR_ALREADY_EXISTS] = kernel32.CreateEventExW //sys OpenEvent(desiredAccess uint32, inheritHandle bool, name *uint16) (handle Handle, err error) = kernel32.OpenEventW //sys SetEvent(event Handle) (err error) = kernel32.SetEvent //sys ResetEvent(event Handle) (err error) = kernel32.ResetEvent //sys PulseEvent(event Handle) (err error) = kernel32.PulseEvent //sys CreateMutex(mutexAttrs *SecurityAttributes, initialOwner bool, name *uint16) (handle Handle, err error) [failretval == 0 || e1 == ERROR_ALREADY_EXISTS] = kernel32.CreateMutexW //sys CreateMutexEx(mutexAttrs *SecurityAttributes, name *uint16, flags uint32, desiredAccess uint32) (handle Handle, err error) [failretval == 0 || e1 == ERROR_ALREADY_EXISTS] = kernel32.CreateMutexExW //sys OpenMutex(desiredAccess uint32, inheritHandle bool, name *uint16) (handle Handle, err error) = kernel32.OpenMutexW //sys ReleaseMutex(mutex Handle) (err error) = kernel32.ReleaseMutex //sys SleepEx(milliseconds uint32, alertable bool) (ret uint32) = kernel32.SleepEx //sys CreateJobObject(jobAttr *SecurityAttributes, name *uint16) (handle Handle, err error) = kernel32.CreateJobObjectW //sys AssignProcessToJobObject(job Handle, process Handle) (err error) = kernel32.AssignProcessToJobObject //sys TerminateJobObject(job Handle, exitCode uint32) (err error) = kernel32.TerminateJobObject //sys SetErrorMode(mode uint32) (ret uint32) = kernel32.SetErrorMode //sys ResumeThread(thread Handle) (ret uint32, err error) [failretval==0xffffffff] = kernel32.ResumeThread //sys SetPriorityClass(process Handle, priorityClass uint32) (err error) = kernel32.SetPriorityClass //sys GetPriorityClass(process Handle) (ret uint32, err error) = kernel32.GetPriorityClass //sys QueryInformationJobObject(job Handle, JobObjectInformationClass int32, JobObjectInformation uintptr, JobObjectInformationLength uint32, retlen *uint32) (err error) = kernel32.QueryInformationJobObject //sys SetInformationJobObject(job Handle, JobObjectInformationClass uint32, JobObjectInformation uintptr, JobObjectInformationLength uint32) (ret int, err error) //sys GenerateConsoleCtrlEvent(ctrlEvent uint32, processGroupID uint32) (err error) //sys GetProcessId(process Handle) (id uint32, err error) //sys QueryFullProcessImageName(proc Handle, flags uint32, exeName *uint16, size *uint32) (err error) = kernel32.QueryFullProcessImageNameW //sys OpenThread(desiredAccess uint32, inheritHandle bool, threadId uint32) (handle Handle, err error) //sys SetProcessPriorityBoost(process Handle, disable bool) (err error) = kernel32.SetProcessPriorityBoost //sys GetProcessWorkingSetSizeEx(hProcess Handle, lpMinimumWorkingSetSize *uintptr, lpMaximumWorkingSetSize *uintptr, flags *uint32) //sys SetProcessWorkingSetSizeEx(hProcess Handle, dwMinimumWorkingSetSize uintptr, dwMaximumWorkingSetSize uintptr, flags uint32) (err error) //sys ClearCommBreak(handle Handle) (err error) //sys ClearCommError(handle Handle, lpErrors *uint32, lpStat *ComStat) (err error) //sys EscapeCommFunction(handle Handle, dwFunc uint32) (err error) //sys GetCommState(handle Handle, lpDCB *DCB) (err error) //sys GetCommModemStatus(handle Handle, lpModemStat *uint32) (err error) //sys GetCommTimeouts(handle Handle, timeouts *CommTimeouts) (err error) //sys PurgeComm(handle Handle, dwFlags uint32) (err error) //sys SetCommBreak(handle Handle) (err error) //sys SetCommMask(handle Handle, dwEvtMask uint32) (err error) //sys SetCommState(handle Handle, lpDCB *DCB) (err error) //sys SetCommTimeouts(handle Handle, timeouts *CommTimeouts) (err error) //sys SetupComm(handle Handle, dwInQueue uint32, dwOutQueue uint32) (err error) //sys WaitCommEvent(handle Handle, lpEvtMask *uint32, lpOverlapped *Overlapped) (err error) //sys GetActiveProcessorCount(groupNumber uint16) (ret uint32) //sys GetMaximumProcessorCount(groupNumber uint16) (ret uint32) //sys EnumWindows(enumFunc uintptr, param unsafe.Pointer) (err error) = user32.EnumWindows //sys EnumChildWindows(hwnd HWND, enumFunc uintptr, param unsafe.Pointer) = user32.EnumChildWindows //sys GetClassName(hwnd HWND, className *uint16, maxCount int32) (copied int32, err error) = user32.GetClassNameW //sys GetDesktopWindow() (hwnd HWND) = user32.GetDesktopWindow //sys GetForegroundWindow() (hwnd HWND) = user32.GetForegroundWindow //sys IsWindow(hwnd HWND) (isWindow bool) = user32.IsWindow //sys IsWindowUnicode(hwnd HWND) (isUnicode bool) = user32.IsWindowUnicode //sys IsWindowVisible(hwnd HWND) (isVisible bool) = user32.IsWindowVisible //sys GetGUIThreadInfo(thread uint32, info *GUIThreadInfo) (err error) = user32.GetGUIThreadInfo //sys GetLargePageMinimum() (size uintptr) // Volume Management Functions //sys DefineDosDevice(flags uint32, deviceName *uint16, targetPath *uint16) (err error) = DefineDosDeviceW //sys DeleteVolumeMountPoint(volumeMountPoint *uint16) (err error) = DeleteVolumeMountPointW //sys FindFirstVolume(volumeName *uint16, bufferLength uint32) (handle Handle, err error) [failretval==InvalidHandle] = FindFirstVolumeW //sys FindFirstVolumeMountPoint(rootPathName *uint16, volumeMountPoint *uint16, bufferLength uint32) (handle Handle, err error) [failretval==InvalidHandle] = FindFirstVolumeMountPointW //sys FindNextVolume(findVolume Handle, volumeName *uint16, bufferLength uint32) (err error) = FindNextVolumeW //sys FindNextVolumeMountPoint(findVolumeMountPoint Handle, volumeMountPoint *uint16, bufferLength uint32) (err error) = FindNextVolumeMountPointW //sys FindVolumeClose(findVolume Handle) (err error) //sys FindVolumeMountPointClose(findVolumeMountPoint Handle) (err error) //sys GetDiskFreeSpaceEx(directoryName *uint16, freeBytesAvailableToCaller *uint64, totalNumberOfBytes *uint64, totalNumberOfFreeBytes *uint64) (err error) = GetDiskFreeSpaceExW //sys GetDriveType(rootPathName *uint16) (driveType uint32) = GetDriveTypeW //sys GetLogicalDrives() (drivesBitMask uint32, err error) [failretval==0] //sys GetLogicalDriveStrings(bufferLength uint32, buffer *uint16) (n uint32, err error) [failretval==0] = GetLogicalDriveStringsW //sys GetVolumeInformation(rootPathName *uint16, volumeNameBuffer *uint16, volumeNameSize uint32, volumeNameSerialNumber *uint32, maximumComponentLength *uint32, fileSystemFlags *uint32, fileSystemNameBuffer *uint16, fileSystemNameSize uint32) (err error) = GetVolumeInformationW //sys GetVolumeInformationByHandle(file Handle, volumeNameBuffer *uint16, volumeNameSize uint32, volumeNameSerialNumber *uint32, maximumComponentLength *uint32, fileSystemFlags *uint32, fileSystemNameBuffer *uint16, fileSystemNameSize uint32) (err error) = GetVolumeInformationByHandleW //sys GetVolumeNameForVolumeMountPoint(volumeMountPoint *uint16, volumeName *uint16, bufferlength uint32) (err error) = GetVolumeNameForVolumeMountPointW //sys GetVolumePathName(fileName *uint16, volumePathName *uint16, bufferLength uint32) (err error) = GetVolumePathNameW //sys GetVolumePathNamesForVolumeName(volumeName *uint16, volumePathNames *uint16, bufferLength uint32, returnLength *uint32) (err error) = GetVolumePathNamesForVolumeNameW //sys QueryDosDevice(deviceName *uint16, targetPath *uint16, max uint32) (n uint32, err error) [failretval==0] = QueryDosDeviceW //sys SetVolumeLabel(rootPathName *uint16, volumeName *uint16) (err error) = SetVolumeLabelW //sys SetVolumeMountPoint(volumeMountPoint *uint16, volumeName *uint16) (err error) = SetVolumeMountPointW //sys InitiateSystemShutdownEx(machineName *uint16, message *uint16, timeout uint32, forceAppsClosed bool, rebootAfterShutdown bool, reason uint32) (err error) = advapi32.InitiateSystemShutdownExW //sys SetProcessShutdownParameters(level uint32, flags uint32) (err error) = kernel32.SetProcessShutdownParameters //sys GetProcessShutdownParameters(level *uint32, flags *uint32) (err error) = kernel32.GetProcessShutdownParameters //sys clsidFromString(lpsz *uint16, pclsid *GUID) (ret error) = ole32.CLSIDFromString //sys stringFromGUID2(rguid *GUID, lpsz *uint16, cchMax int32) (chars int32) = ole32.StringFromGUID2 //sys coCreateGuid(pguid *GUID) (ret error) = ole32.CoCreateGuid //sys CoTaskMemFree(address unsafe.Pointer) = ole32.CoTaskMemFree //sys CoInitializeEx(reserved uintptr, coInit uint32) (ret error) = ole32.CoInitializeEx //sys CoUninitialize() = ole32.CoUninitialize //sys CoGetObject(name *uint16, bindOpts *BIND_OPTS3, guid *GUID, functionTable **uintptr) (ret error) = ole32.CoGetObject //sys getProcessPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint16, bufSize *uint32) (err error) = kernel32.GetProcessPreferredUILanguages //sys getThreadPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint16, bufSize *uint32) (err error) = kernel32.GetThreadPreferredUILanguages //sys getUserPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint16, bufSize *uint32) (err error) = kernel32.GetUserPreferredUILanguages //sys getSystemPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint16, bufSize *uint32) (err error) = kernel32.GetSystemPreferredUILanguages //sys findResource(module Handle, name uintptr, resType uintptr) (resInfo Handle, err error) = kernel32.FindResourceW //sys SizeofResource(module Handle, resInfo Handle) (size uint32, err error) = kernel32.SizeofResource //sys LoadResource(module Handle, resInfo Handle) (resData Handle, err error) = kernel32.LoadResource //sys LockResource(resData Handle) (addr uintptr, err error) = kernel32.LockResource // Version APIs //sys GetFileVersionInfoSize(filename string, zeroHandle *Handle) (bufSize uint32, err error) = version.GetFileVersionInfoSizeW //sys GetFileVersionInfo(filename string, handle uint32, bufSize uint32, buffer unsafe.Pointer) (err error) = version.GetFileVersionInfoW //sys VerQueryValue(block unsafe.Pointer, subBlock string, pointerToBufferPointer unsafe.Pointer, bufSize *uint32) (err error) = version.VerQueryValueW // Process Status API (PSAPI) //sys enumProcesses(processIds *uint32, nSize uint32, bytesReturned *uint32) (err error) = psapi.EnumProcesses //sys EnumProcessModules(process Handle, module *Handle, cb uint32, cbNeeded *uint32) (err error) = psapi.EnumProcessModules //sys EnumProcessModulesEx(process Handle, module *Handle, cb uint32, cbNeeded *uint32, filterFlag uint32) (err error) = psapi.EnumProcessModulesEx //sys GetModuleInformation(process Handle, module Handle, modinfo *ModuleInfo, cb uint32) (err error) = psapi.GetModuleInformation //sys GetModuleFileNameEx(process Handle, module Handle, filename *uint16, size uint32) (err error) = psapi.GetModuleFileNameExW //sys GetModuleBaseName(process Handle, module Handle, baseName *uint16, size uint32) (err error) = psapi.GetModuleBaseNameW //sys QueryWorkingSetEx(process Handle, pv uintptr, cb uint32) (err error) = psapi.QueryWorkingSetEx // NT Native APIs //sys rtlNtStatusToDosErrorNoTeb(ntstatus NTStatus) (ret syscall.Errno) = ntdll.RtlNtStatusToDosErrorNoTeb //sys rtlGetVersion(info *OsVersionInfoEx) (ntstatus error) = ntdll.RtlGetVersion //sys rtlGetNtVersionNumbers(majorVersion *uint32, minorVersion *uint32, buildNumber *uint32) = ntdll.RtlGetNtVersionNumbers //sys RtlGetCurrentPeb() (peb *PEB) = ntdll.RtlGetCurrentPeb //sys RtlInitUnicodeString(destinationString *NTUnicodeString, sourceString *uint16) = ntdll.RtlInitUnicodeString //sys RtlInitString(destinationString *NTString, sourceString *byte) = ntdll.RtlInitString //sys NtCreateFile(handle *Handle, access uint32, oa *OBJECT_ATTRIBUTES, iosb *IO_STATUS_BLOCK, allocationSize *int64, attributes uint32, share uint32, disposition uint32, options uint32, eabuffer uintptr, ealength uint32) (ntstatus error) = ntdll.NtCreateFile //sys NtCreateNamedPipeFile(pipe *Handle, access uint32, oa *OBJECT_ATTRIBUTES, iosb *IO_STATUS_BLOCK, share uint32, disposition uint32, options uint32, typ uint32, readMode uint32, completionMode uint32, maxInstances uint32, inboundQuota uint32, outputQuota uint32, timeout *int64) (ntstatus error) = ntdll.NtCreateNamedPipeFile //sys NtSetInformationFile(handle Handle, iosb *IO_STATUS_BLOCK, inBuffer *byte, inBufferLen uint32, class uint32) (ntstatus error) = ntdll.NtSetInformationFile //sys RtlDosPathNameToNtPathName(dosName *uint16, ntName *NTUnicodeString, ntFileNamePart *uint16, relativeName *RTL_RELATIVE_NAME) (ntstatus error) = ntdll.RtlDosPathNameToNtPathName_U_WithStatus //sys RtlDosPathNameToRelativeNtPathName(dosName *uint16, ntName *NTUnicodeString, ntFileNamePart *uint16, relativeName *RTL_RELATIVE_NAME) (ntstatus error) = ntdll.RtlDosPathNameToRelativeNtPathName_U_WithStatus //sys RtlDefaultNpAcl(acl **ACL) (ntstatus error) = ntdll.RtlDefaultNpAcl //sys NtQueryInformationProcess(proc Handle, procInfoClass int32, procInfo unsafe.Pointer, procInfoLen uint32, retLen *uint32) (ntstatus error) = ntdll.NtQueryInformationProcess //sys NtSetInformationProcess(proc Handle, procInfoClass int32, procInfo unsafe.Pointer, procInfoLen uint32) (ntstatus error) = ntdll.NtSetInformationProcess //sys NtQuerySystemInformation(sysInfoClass int32, sysInfo unsafe.Pointer, sysInfoLen uint32, retLen *uint32) (ntstatus error) = ntdll.NtQuerySystemInformation //sys NtSetSystemInformation(sysInfoClass int32, sysInfo unsafe.Pointer, sysInfoLen uint32) (ntstatus error) = ntdll.NtSetSystemInformation //sys RtlAddFunctionTable(functionTable *RUNTIME_FUNCTION, entryCount uint32, baseAddress uintptr) (ret bool) = ntdll.RtlAddFunctionTable //sys RtlDeleteFunctionTable(functionTable *RUNTIME_FUNCTION) (ret bool) = ntdll.RtlDeleteFunctionTable // Desktop Window Manager API (Dwmapi) //sys DwmGetWindowAttribute(hwnd HWND, attribute uint32, value unsafe.Pointer, size uint32) (ret error) = dwmapi.DwmGetWindowAttribute //sys DwmSetWindowAttribute(hwnd HWND, attribute uint32, value unsafe.Pointer, size uint32) (ret error) = dwmapi.DwmSetWindowAttribute // Windows Multimedia API //sys TimeBeginPeriod (period uint32) (err error) [failretval != 0] = winmm.timeBeginPeriod //sys TimeEndPeriod (period uint32) (err error) [failretval != 0] = winmm.timeEndPeriod // syscall interface implementation for other packages // GetCurrentProcess returns the handle for the current process. // It is a pseudo handle that does not need to be closed. // The returned error is always nil. // // Deprecated: use CurrentProcess for the same Handle without the nil // error. func GetCurrentProcess() (Handle, error) { return CurrentProcess(), nil } // CurrentProcess returns the handle for the current process. // It is a pseudo handle that does not need to be closed. func CurrentProcess() Handle { return Handle(^uintptr(1 - 1)) } // GetCurrentThread returns the handle for the current thread. // It is a pseudo handle that does not need to be closed. // The returned error is always nil. // // Deprecated: use CurrentThread for the same Handle without the nil // error. func GetCurrentThread() (Handle, error) { return CurrentThread(), nil } // CurrentThread returns the handle for the current thread. // It is a pseudo handle that does not need to be closed. func CurrentThread() Handle { return Handle(^uintptr(2 - 1)) } // GetProcAddressByOrdinal retrieves the address of the exported // function from module by ordinal. func GetProcAddressByOrdinal(module Handle, ordinal uintptr) (proc uintptr, err error) { r0, _, e1 := syscall.Syscall(procGetProcAddress.Addr(), 2, uintptr(module), ordinal, 0) proc = uintptr(r0) if proc == 0 { err = errnoErr(e1) } return } func Exit(code int) { ExitProcess(uint32(code)) } func makeInheritSa() *SecurityAttributes { var sa SecurityAttributes sa.Length = uint32(unsafe.Sizeof(sa)) sa.InheritHandle = 1 return &sa } func Open(path string, mode int, perm uint32) (fd Handle, err error) { if len(path) == 0 { return InvalidHandle, ERROR_FILE_NOT_FOUND } pathp, err := UTF16PtrFromString(path) if err != nil { return InvalidHandle, err } var access uint32 switch mode & (O_RDONLY | O_WRONLY | O_RDWR) { case O_RDONLY: access = GENERIC_READ case O_WRONLY: access = GENERIC_WRITE case O_RDWR: access = GENERIC_READ | GENERIC_WRITE } if mode&O_CREAT != 0 { access |= GENERIC_WRITE } if mode&O_APPEND != 0 { access &^= GENERIC_WRITE access |= FILE_APPEND_DATA } sharemode := uint32(FILE_SHARE_READ | FILE_SHARE_WRITE) var sa *SecurityAttributes if mode&O_CLOEXEC == 0 { sa = makeInheritSa() } var createmode uint32 switch { case mode&(O_CREAT|O_EXCL) == (O_CREAT | O_EXCL): createmode = CREATE_NEW case mode&(O_CREAT|O_TRUNC) == (O_CREAT | O_TRUNC): createmode = CREATE_ALWAYS case mode&O_CREAT == O_CREAT: createmode = OPEN_ALWAYS case mode&O_TRUNC == O_TRUNC: createmode = TRUNCATE_EXISTING default: createmode = OPEN_EXISTING } var attrs uint32 = FILE_ATTRIBUTE_NORMAL if perm&S_IWRITE == 0 { attrs = FILE_ATTRIBUTE_READONLY } h, e := CreateFile(pathp, access, sharemode, sa, createmode, attrs, 0) return h, e } func Read(fd Handle, p []byte) (n int, err error) { var done uint32 e := ReadFile(fd, p, &done, nil) if e != nil { if e == ERROR_BROKEN_PIPE { // NOTE(brainman): work around ERROR_BROKEN_PIPE is returned on reading EOF from stdin return 0, nil } return 0, e } return int(done), nil } func Write(fd Handle, p []byte) (n int, err error) { if raceenabled { raceReleaseMerge(unsafe.Pointer(&ioSync)) } var done uint32 e := WriteFile(fd, p, &done, nil) if e != nil { return 0, e } return int(done), nil } func ReadFile(fd Handle, p []byte, done *uint32, overlapped *Overlapped) error { err := readFile(fd, p, done, overlapped) if raceenabled { if *done > 0 { raceWriteRange(unsafe.Pointer(&p[0]), int(*done)) } raceAcquire(unsafe.Pointer(&ioSync)) } return err } func WriteFile(fd Handle, p []byte, done *uint32, overlapped *Overlapped) error { if raceenabled { raceReleaseMerge(unsafe.Pointer(&ioSync)) } err := writeFile(fd, p, done, overlapped) if raceenabled && *done > 0 { raceReadRange(unsafe.Pointer(&p[0]), int(*done)) } return err } var ioSync int64 func Seek(fd Handle, offset int64, whence int) (newoffset int64, err error) { var w uint32 switch whence { case 0: w = FILE_BEGIN case 1: w = FILE_CURRENT case 2: w = FILE_END } hi := int32(offset >> 32) lo := int32(offset) // use GetFileType to check pipe, pipe can't do seek ft, _ := GetFileType(fd) if ft == FILE_TYPE_PIPE { return 0, syscall.EPIPE } rlo, e := SetFilePointer(fd, lo, &hi, w) if e != nil { return 0, e } return int64(hi)<<32 + int64(rlo), nil } func Close(fd Handle) (err error) { return CloseHandle(fd) } var ( Stdin = getStdHandle(STD_INPUT_HANDLE) Stdout = getStdHandle(STD_OUTPUT_HANDLE) Stderr = getStdHandle(STD_ERROR_HANDLE) ) func getStdHandle(stdhandle uint32) (fd Handle) { r, _ := GetStdHandle(stdhandle) return r } const ImplementsGetwd = true func Getwd() (wd string, err error) { b := make([]uint16, 300) n, e := GetCurrentDirectory(uint32(len(b)), &b[0]) if e != nil { return "", e } return string(utf16.Decode(b[0:n])), nil } func Chdir(path string) (err error) { pathp, err := UTF16PtrFromString(path) if err != nil { return err } return SetCurrentDirectory(pathp) } func Mkdir(path string, mode uint32) (err error) { pathp, err := UTF16PtrFromString(path) if err != nil { return err } return CreateDirectory(pathp, nil) } func Rmdir(path string) (err error) { pathp, err := UTF16PtrFromString(path) if err != nil { return err } return RemoveDirectory(pathp) } func Unlink(path string) (err error) { pathp, err := UTF16PtrFromString(path) if err != nil { return err } return DeleteFile(pathp) } func Rename(oldpath, newpath string) (err error) { from, err := UTF16PtrFromString(oldpath) if err != nil { return err } to, err := UTF16PtrFromString(newpath) if err != nil { return err } return MoveFileEx(from, to, MOVEFILE_REPLACE_EXISTING) } func ComputerName() (name string, err error) { var n uint32 = MAX_COMPUTERNAME_LENGTH + 1 b := make([]uint16, n) e := GetComputerName(&b[0], &n) if e != nil { return "", e } return string(utf16.Decode(b[0:n])), nil } func DurationSinceBoot() time.Duration { return time.Duration(getTickCount64()) * time.Millisecond } func Ftruncate(fd Handle, length int64) (err error) { type _FILE_END_OF_FILE_INFO struct { EndOfFile int64 } var info _FILE_END_OF_FILE_INFO info.EndOfFile = length return SetFileInformationByHandle(fd, FileEndOfFileInfo, (*byte)(unsafe.Pointer(&info)), uint32(unsafe.Sizeof(info))) } func Gettimeofday(tv *Timeval) (err error) { var ft Filetime GetSystemTimeAsFileTime(&ft) *tv = NsecToTimeval(ft.Nanoseconds()) return nil } func Pipe(p []Handle) (err error) { if len(p) != 2 { return syscall.EINVAL } var r, w Handle e := CreatePipe(&r, &w, makeInheritSa(), 0) if e != nil { return e } p[0] = r p[1] = w return nil } func Utimes(path string, tv []Timeval) (err error) { if len(tv) != 2 { return syscall.EINVAL } pathp, e := UTF16PtrFromString(path) if e != nil { return e } h, e := CreateFile(pathp, FILE_WRITE_ATTRIBUTES, FILE_SHARE_WRITE, nil, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0) if e != nil { return e } defer CloseHandle(h) a := NsecToFiletime(tv[0].Nanoseconds()) w := NsecToFiletime(tv[1].Nanoseconds()) return SetFileTime(h, nil, &a, &w) } func UtimesNano(path string, ts []Timespec) (err error) { if len(ts) != 2 { return syscall.EINVAL } pathp, e := UTF16PtrFromString(path) if e != nil { return e } h, e := CreateFile(pathp, FILE_WRITE_ATTRIBUTES, FILE_SHARE_WRITE, nil, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0) if e != nil { return e } defer CloseHandle(h) a := NsecToFiletime(TimespecToNsec(ts[0])) w := NsecToFiletime(TimespecToNsec(ts[1])) return SetFileTime(h, nil, &a, &w) } func Fsync(fd Handle) (err error) { return FlushFileBuffers(fd) } func Chmod(path string, mode uint32) (err error) { p, e := UTF16PtrFromString(path) if e != nil { return e } attrs, e := GetFileAttributes(p) if e != nil { return e } if mode&S_IWRITE != 0 { attrs &^= FILE_ATTRIBUTE_READONLY } else { attrs |= FILE_ATTRIBUTE_READONLY } return SetFileAttributes(p, attrs) } func LoadGetSystemTimePreciseAsFileTime() error { return procGetSystemTimePreciseAsFileTime.Find() } func LoadCancelIoEx() error { return procCancelIoEx.Find() } func LoadSetFileCompletionNotificationModes() error { return procSetFileCompletionNotificationModes.Find() } func WaitForMultipleObjects(handles []Handle, waitAll bool, waitMilliseconds uint32) (event uint32, err error) { // Every other win32 array API takes arguments as "pointer, count", except for this function. So we // can't declare it as a usual [] type, because mksyscall will use the opposite order. We therefore // trivially stub this ourselves. var handlePtr *Handle if len(handles) > 0 { handlePtr = &handles[0] } return waitForMultipleObjects(uint32(len(handles)), uintptr(unsafe.Pointer(handlePtr)), waitAll, waitMilliseconds) } // net api calls const socket_error = uintptr(^uint32(0)) //sys WSAStartup(verreq uint32, data *WSAData) (sockerr error) = ws2_32.WSAStartup //sys WSACleanup() (err error) [failretval==socket_error] = ws2_32.WSACleanup //sys WSAIoctl(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 //sys WSALookupServiceBegin(querySet *WSAQUERYSET, flags uint32, handle *Handle) (err error) [failretval==socket_error] = ws2_32.WSALookupServiceBeginW //sys WSALookupServiceNext(handle Handle, flags uint32, size *int32, querySet *WSAQUERYSET) (err error) [failretval==socket_error] = ws2_32.WSALookupServiceNextW //sys WSALookupServiceEnd(handle Handle) (err error) [failretval==socket_error] = ws2_32.WSALookupServiceEnd //sys socket(af int32, typ int32, protocol int32) (handle Handle, err error) [failretval==InvalidHandle] = ws2_32.socket //sys sendto(s Handle, buf []byte, flags int32, to unsafe.Pointer, tolen int32) (err error) [failretval==socket_error] = ws2_32.sendto //sys recvfrom(s Handle, buf []byte, flags int32, from *RawSockaddrAny, fromlen *int32) (n int32, err error) [failretval==-1] = ws2_32.recvfrom //sys Setsockopt(s Handle, level int32, optname int32, optval *byte, optlen int32) (err error) [failretval==socket_error] = ws2_32.setsockopt //sys Getsockopt(s Handle, level int32, optname int32, optval *byte, optlen *int32) (err error) [failretval==socket_error] = ws2_32.getsockopt //sys bind(s Handle, name unsafe.Pointer, namelen int32) (err error) [failretval==socket_error] = ws2_32.bind //sys connect(s Handle, name unsafe.Pointer, namelen int32) (err error) [failretval==socket_error] = ws2_32.connect //sys getsockname(s Handle, rsa *RawSockaddrAny, addrlen *int32) (err error) [failretval==socket_error] = ws2_32.getsockname //sys getpeername(s Handle, rsa *RawSockaddrAny, addrlen *int32) (err error) [failretval==socket_error] = ws2_32.getpeername //sys listen(s Handle, backlog int32) (err error) [failretval==socket_error] = ws2_32.listen //sys shutdown(s Handle, how int32) (err error) [failretval==socket_error] = ws2_32.shutdown //sys Closesocket(s Handle) (err error) [failretval==socket_error] = ws2_32.closesocket //sys AcceptEx(ls Handle, as Handle, buf *byte, rxdatalen uint32, laddrlen uint32, raddrlen uint32, recvd *uint32, overlapped *Overlapped) (err error) = mswsock.AcceptEx //sys GetAcceptExSockaddrs(buf *byte, rxdatalen uint32, laddrlen uint32, raddrlen uint32, lrsa **RawSockaddrAny, lrsalen *int32, rrsa **RawSockaddrAny, rrsalen *int32) = mswsock.GetAcceptExSockaddrs //sys WSARecv(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32, overlapped *Overlapped, croutine *byte) (err error) [failretval==socket_error] = ws2_32.WSARecv //sys WSASend(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, overlapped *Overlapped, croutine *byte) (err error) [failretval==socket_error] = ws2_32.WSASend //sys WSARecvFrom(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32, from *RawSockaddrAny, fromlen *int32, overlapped *Overlapped, croutine *byte) (err error) [failretval==socket_error] = ws2_32.WSARecvFrom //sys WSASendTo(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, to *RawSockaddrAny, tolen int32, overlapped *Overlapped, croutine *byte) (err error) [failretval==socket_error] = ws2_32.WSASendTo //sys WSASocket(af int32, typ int32, protocol int32, protoInfo *WSAProtocolInfo, group uint32, flags uint32) (handle Handle, err error) [failretval==InvalidHandle] = ws2_32.WSASocketW //sys WSADuplicateSocket(s Handle, processID uint32, info *WSAProtocolInfo) (err error) [failretval!=0] = ws2_32.WSADuplicateSocketW //sys GetHostByName(name string) (h *Hostent, err error) [failretval==nil] = ws2_32.gethostbyname //sys GetServByName(name string, proto string) (s *Servent, err error) [failretval==nil] = ws2_32.getservbyname //sys Ntohs(netshort uint16) (u uint16) = ws2_32.ntohs //sys GetProtoByName(name string) (p *Protoent, err error) [failretval==nil] = ws2_32.getprotobyname //sys DnsQuery(name string, qtype uint16, options uint32, extra *byte, qrs **DNSRecord, pr *byte) (status error) = dnsapi.DnsQuery_W //sys DnsRecordListFree(rl *DNSRecord, freetype uint32) = dnsapi.DnsRecordListFree //sys DnsNameCompare(name1 *uint16, name2 *uint16) (same bool) = dnsapi.DnsNameCompare_W //sys GetAddrInfoW(nodename *uint16, servicename *uint16, hints *AddrinfoW, result **AddrinfoW) (sockerr error) = ws2_32.GetAddrInfoW //sys FreeAddrInfoW(addrinfo *AddrinfoW) = ws2_32.FreeAddrInfoW //sys GetIfEntry(pIfRow *MibIfRow) (errcode error) = iphlpapi.GetIfEntry //sys GetAdaptersInfo(ai *IpAdapterInfo, ol *uint32) (errcode error) = iphlpapi.GetAdaptersInfo //sys SetFileCompletionNotificationModes(handle Handle, flags uint8) (err error) = kernel32.SetFileCompletionNotificationModes //sys WSAEnumProtocols(protocols *int32, protocolBuffer *WSAProtocolInfo, bufferLength *uint32) (n int32, err error) [failretval==-1] = ws2_32.WSAEnumProtocolsW //sys WSAGetOverlappedResult(h Handle, o *Overlapped, bytes *uint32, wait bool, flags *uint32) (err error) = ws2_32.WSAGetOverlappedResult //sys GetAdaptersAddresses(family uint32, flags uint32, reserved uintptr, adapterAddresses *IpAdapterAddresses, sizePointer *uint32) (errcode error) = iphlpapi.GetAdaptersAddresses //sys GetACP() (acp uint32) = kernel32.GetACP //sys MultiByteToWideChar(codePage uint32, dwFlags uint32, str *byte, nstr int32, wchar *uint16, nwchar int32) (nwrite int32, err error) = kernel32.MultiByteToWideChar //sys getBestInterfaceEx(sockaddr unsafe.Pointer, pdwBestIfIndex *uint32) (errcode error) = iphlpapi.GetBestInterfaceEx //sys GetIfEntry2Ex(level uint32, row *MibIfRow2) (errcode error) = iphlpapi.GetIfEntry2Ex //sys GetIpForwardEntry2(row *MibIpForwardRow2) (errcode error) = iphlpapi.GetIpForwardEntry2 //sys GetIpForwardTable2(family uint16, table **MibIpForwardTable2) (errcode error) = iphlpapi.GetIpForwardTable2 //sys GetUnicastIpAddressEntry(row *MibUnicastIpAddressRow) (errcode error) = iphlpapi.GetUnicastIpAddressEntry //sys FreeMibTable(memory unsafe.Pointer) = iphlpapi.FreeMibTable //sys NotifyIpInterfaceChange(family uint16, callback uintptr, callerContext unsafe.Pointer, initialNotification bool, notificationHandle *Handle) (errcode error) = iphlpapi.NotifyIpInterfaceChange //sys NotifyRouteChange2(family uint16, callback uintptr, callerContext unsafe.Pointer, initialNotification bool, notificationHandle *Handle) (errcode error) = iphlpapi.NotifyRouteChange2 //sys NotifyUnicastIpAddressChange(family uint16, callback uintptr, callerContext unsafe.Pointer, initialNotification bool, notificationHandle *Handle) (errcode error) = iphlpapi.NotifyUnicastIpAddressChange //sys CancelMibChangeNotify2(notificationHandle Handle) (errcode error) = iphlpapi.CancelMibChangeNotify2 //sys IsProcessorFeaturePresent(ProcessorFeature uint32) (ret bool) = kernel32.IsProcessorFeaturePresent // For testing: clients can set this flag to force // creation of IPv6 sockets to return EAFNOSUPPORT. var SocketDisableIPv6 bool type RawSockaddrInet4 struct { Family uint16 Port uint16 Addr [4]byte /* in_addr */ Zero [8]uint8 } type RawSockaddrInet6 struct { Family uint16 Port uint16 Flowinfo uint32 Addr [16]byte /* in6_addr */ Scope_id uint32 } // RawSockaddrInet is a union that contains an IPv4, an IPv6 address, or an address family. See // https://learn.microsoft.com/en-us/windows/win32/api/ws2ipdef/ns-ws2ipdef-sockaddr_inet. // // A [*RawSockaddrInet] may be converted to a [*RawSockaddrInet4] or [*RawSockaddrInet6] using // unsafe, depending on the address family. type RawSockaddrInet struct { Family uint16 Port uint16 Data [6]uint32 } type RawSockaddr struct { Family uint16 Data [14]int8 } type RawSockaddrAny struct { Addr RawSockaddr Pad [100]int8 } type Sockaddr interface { sockaddr() (ptr unsafe.Pointer, len int32, err error) // lowercase; only we can define Sockaddrs } type SockaddrInet4 struct { Port int Addr [4]byte raw RawSockaddrInet4 } func (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, int32, error) { if sa.Port < 0 || sa.Port > 0xFFFF { return nil, 0, syscall.EINVAL } sa.raw.Family = AF_INET p := (*[2]byte)(unsafe.Pointer(&sa.raw.Port)) p[0] = byte(sa.Port >> 8) p[1] = byte(sa.Port) sa.raw.Addr = sa.Addr return unsafe.Pointer(&sa.raw), int32(unsafe.Sizeof(sa.raw)), nil } type SockaddrInet6 struct { Port int ZoneId uint32 Addr [16]byte raw RawSockaddrInet6 } func (sa *SockaddrInet6) sockaddr() (unsafe.Pointer, int32, error) { if sa.Port < 0 || sa.Port > 0xFFFF { return nil, 0, syscall.EINVAL } sa.raw.Family = AF_INET6 p := (*[2]byte)(unsafe.Pointer(&sa.raw.Port)) p[0] = byte(sa.Port >> 8) p[1] = byte(sa.Port) sa.raw.Scope_id = sa.ZoneId sa.raw.Addr = sa.Addr return unsafe.Pointer(&sa.raw), int32(unsafe.Sizeof(sa.raw)), nil } type RawSockaddrUnix struct { Family uint16 Path [UNIX_PATH_MAX]int8 } type SockaddrUnix struct { Name string raw RawSockaddrUnix } func (sa *SockaddrUnix) sockaddr() (unsafe.Pointer, int32, error) { name := sa.Name n := len(name) if n > len(sa.raw.Path) { return nil, 0, syscall.EINVAL } if n == len(sa.raw.Path) && name[0] != '@' { return nil, 0, syscall.EINVAL } sa.raw.Family = AF_UNIX for i := 0; i < n; i++ { sa.raw.Path[i] = int8(name[i]) } // length is family (uint16), name, NUL. sl := int32(2) if n > 0 { sl += int32(n) + 1 } if sa.raw.Path[0] == '@' || (sa.raw.Path[0] == 0 && sl > 3) { // Check sl > 3 so we don't change unnamed socket behavior. sa.raw.Path[0] = 0 // Don't count trailing NUL for abstract address. sl-- } return unsafe.Pointer(&sa.raw), sl, nil } type RawSockaddrBth struct { AddressFamily [2]byte BtAddr [8]byte ServiceClassId [16]byte Port [4]byte } type SockaddrBth struct { BtAddr uint64 ServiceClassId GUID Port uint32 raw RawSockaddrBth } func (sa *SockaddrBth) sockaddr() (unsafe.Pointer, int32, error) { family := AF_BTH sa.raw = RawSockaddrBth{ AddressFamily: *(*[2]byte)(unsafe.Pointer(&family)), BtAddr: *(*[8]byte)(unsafe.Pointer(&sa.BtAddr)), Port: *(*[4]byte)(unsafe.Pointer(&sa.Port)), ServiceClassId: *(*[16]byte)(unsafe.Pointer(&sa.ServiceClassId)), } return unsafe.Pointer(&sa.raw), int32(unsafe.Sizeof(sa.raw)), nil } func (rsa *RawSockaddrAny) Sockaddr() (Sockaddr, error) { switch rsa.Addr.Family { case AF_UNIX: pp := (*RawSockaddrUnix)(unsafe.Pointer(rsa)) sa := new(SockaddrUnix) if pp.Path[0] == 0 { // "Abstract" Unix domain socket. // Rewrite leading NUL as @ for textual display. // (This is the standard convention.) // Not friendly to overwrite in place, // but the callers below don't care. pp.Path[0] = '@' } // Assume path ends at NUL. // This is not technically the Linux semantics for // abstract Unix domain sockets--they are supposed // to be uninterpreted fixed-size binary blobs--but // everyone uses this convention. n := 0 for n < len(pp.Path) && pp.Path[n] != 0 { n++ } sa.Name = string(unsafe.Slice((*byte)(unsafe.Pointer(&pp.Path[0])), n)) return sa, nil case AF_INET: pp := (*RawSockaddrInet4)(unsafe.Pointer(rsa)) sa := new(SockaddrInet4) p := (*[2]byte)(unsafe.Pointer(&pp.Port)) sa.Port = int(p[0])<<8 + int(p[1]) sa.Addr = pp.Addr return sa, nil case AF_INET6: pp := (*RawSockaddrInet6)(unsafe.Pointer(rsa)) sa := new(SockaddrInet6) p := (*[2]byte)(unsafe.Pointer(&pp.Port)) sa.Port = int(p[0])<<8 + int(p[1]) sa.ZoneId = pp.Scope_id sa.Addr = pp.Addr return sa, nil } return nil, syscall.EAFNOSUPPORT } func Socket(domain, typ, proto int) (fd Handle, err error) { if domain == AF_INET6 && SocketDisableIPv6 { return InvalidHandle, syscall.EAFNOSUPPORT } return socket(int32(domain), int32(typ), int32(proto)) } func SetsockoptInt(fd Handle, level, opt int, value int) (err error) { v := int32(value) return Setsockopt(fd, int32(level), int32(opt), (*byte)(unsafe.Pointer(&v)), int32(unsafe.Sizeof(v))) } func Bind(fd Handle, sa Sockaddr) (err error) { ptr, n, err := sa.sockaddr() if err != nil { return err } return bind(fd, ptr, n) } func Connect(fd Handle, sa Sockaddr) (err error) { ptr, n, err := sa.sockaddr() if err != nil { return err } return connect(fd, ptr, n) } func GetBestInterfaceEx(sa Sockaddr, pdwBestIfIndex *uint32) (err error) { ptr, _, err := sa.sockaddr() if err != nil { return err } return getBestInterfaceEx(ptr, pdwBestIfIndex) } func Getsockname(fd Handle) (sa Sockaddr, err error) { var rsa RawSockaddrAny l := int32(unsafe.Sizeof(rsa)) if err = getsockname(fd, &rsa, &l); err != nil { return } return rsa.Sockaddr() } func Getpeername(fd Handle) (sa Sockaddr, err error) { var rsa RawSockaddrAny l := int32(unsafe.Sizeof(rsa)) if err = getpeername(fd, &rsa, &l); err != nil { return } return rsa.Sockaddr() } func Listen(s Handle, n int) (err error) { return listen(s, int32(n)) } func Shutdown(fd Handle, how int) (err error) { return shutdown(fd, int32(how)) } func WSASendto(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, to Sockaddr, overlapped *Overlapped, croutine *byte) (err error) { var rsa unsafe.Pointer var l int32 if to != nil { rsa, l, err = to.sockaddr() if err != nil { return err } } return WSASendTo(s, bufs, bufcnt, sent, flags, (*RawSockaddrAny)(unsafe.Pointer(rsa)), l, overlapped, croutine) } func LoadGetAddrInfo() error { return procGetAddrInfoW.Find() } var connectExFunc struct { once sync.Once addr uintptr err error } func LoadConnectEx() error { connectExFunc.once.Do(func() { var s Handle s, connectExFunc.err = Socket(AF_INET, SOCK_STREAM, IPPROTO_TCP) if connectExFunc.err != nil { return } defer CloseHandle(s) var n uint32 connectExFunc.err = WSAIoctl(s, SIO_GET_EXTENSION_FUNCTION_POINTER, (*byte)(unsafe.Pointer(&WSAID_CONNECTEX)), uint32(unsafe.Sizeof(WSAID_CONNECTEX)), (*byte)(unsafe.Pointer(&connectExFunc.addr)), uint32(unsafe.Sizeof(connectExFunc.addr)), &n, nil, 0) }) return connectExFunc.err } func connectEx(s Handle, name unsafe.Pointer, namelen int32, sendBuf *byte, sendDataLen uint32, bytesSent *uint32, overlapped *Overlapped) (err error) { r1, _, 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) if r1 == 0 { if e1 != 0 { err = error(e1) } else { err = syscall.EINVAL } } return } func ConnectEx(fd Handle, sa Sockaddr, sendBuf *byte, sendDataLen uint32, bytesSent *uint32, overlapped *Overlapped) error { err := LoadConnectEx() if err != nil { return errorspkg.New("failed to find ConnectEx: " + err.Error()) } ptr, n, err := sa.sockaddr() if err != nil { return err } return connectEx(fd, ptr, n, sendBuf, sendDataLen, bytesSent, overlapped) } var sendRecvMsgFunc struct { once sync.Once sendAddr uintptr recvAddr uintptr err error } func loadWSASendRecvMsg() error { sendRecvMsgFunc.once.Do(func() { var s Handle s, sendRecvMsgFunc.err = Socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP) if sendRecvMsgFunc.err != nil { return } defer CloseHandle(s) var n uint32 sendRecvMsgFunc.err = WSAIoctl(s, SIO_GET_EXTENSION_FUNCTION_POINTER, (*byte)(unsafe.Pointer(&WSAID_WSARECVMSG)), uint32(unsafe.Sizeof(WSAID_WSARECVMSG)), (*byte)(unsafe.Pointer(&sendRecvMsgFunc.recvAddr)), uint32(unsafe.Sizeof(sendRecvMsgFunc.recvAddr)), &n, nil, 0) if sendRecvMsgFunc.err != nil { return } sendRecvMsgFunc.err = WSAIoctl(s, SIO_GET_EXTENSION_FUNCTION_POINTER, (*byte)(unsafe.Pointer(&WSAID_WSASENDMSG)), uint32(unsafe.Sizeof(WSAID_WSASENDMSG)), (*byte)(unsafe.Pointer(&sendRecvMsgFunc.sendAddr)), uint32(unsafe.Sizeof(sendRecvMsgFunc.sendAddr)), &n, nil, 0) }) return sendRecvMsgFunc.err } func WSASendMsg(fd Handle, msg *WSAMsg, flags uint32, bytesSent *uint32, overlapped *Overlapped, croutine *byte) error { err := loadWSASendRecvMsg() if err != nil { return err } r1, _, e1 := syscall.Syscall6(sendRecvMsgFunc.sendAddr, 6, uintptr(fd), uintptr(unsafe.Pointer(msg)), uintptr(flags), uintptr(unsafe.Pointer(bytesSent)), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine))) if r1 == socket_error { err = errnoErr(e1) } return err } func WSARecvMsg(fd Handle, msg *WSAMsg, bytesReceived *uint32, overlapped *Overlapped, croutine *byte) error { err := loadWSASendRecvMsg() if err != nil { return err } r1, _, e1 := syscall.Syscall6(sendRecvMsgFunc.recvAddr, 5, uintptr(fd), uintptr(unsafe.Pointer(msg)), uintptr(unsafe.Pointer(bytesReceived)), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine)), 0) if r1 == socket_error { err = errnoErr(e1) } return err } // Invented structures to support what package os expects. type Rusage struct { CreationTime Filetime ExitTime Filetime KernelTime Filetime UserTime Filetime } type WaitStatus struct { ExitCode uint32 } func (w WaitStatus) Exited() bool { return true } func (w WaitStatus) ExitStatus() int { return int(w.ExitCode) } func (w WaitStatus) Signal() Signal { return -1 } func (w WaitStatus) CoreDump() bool { return false } func (w WaitStatus) Stopped() bool { return false } func (w WaitStatus) Continued() bool { return false } func (w WaitStatus) StopSignal() Signal { return -1 } func (w WaitStatus) Signaled() bool { return false } func (w WaitStatus) TrapCause() int { return -1 } // Timespec is an invented structure on Windows, but here for // consistency with the corresponding package for other operating systems. type Timespec struct { Sec int64 Nsec int64 } func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } func NsecToTimespec(nsec int64) (ts Timespec) { ts.Sec = nsec / 1e9 ts.Nsec = nsec % 1e9 return } // TODO(brainman): fix all needed for net func Accept(fd Handle) (nfd Handle, sa Sockaddr, err error) { return 0, nil, syscall.EWINDOWS } func Recvfrom(fd Handle, p []byte, flags int) (n int, from Sockaddr, err error) { var rsa RawSockaddrAny l := int32(unsafe.Sizeof(rsa)) n32, err := recvfrom(fd, p, int32(flags), &rsa, &l) n = int(n32) if err != nil { return } from, err = rsa.Sockaddr() return } func Sendto(fd Handle, p []byte, flags int, to Sockaddr) (err error) { ptr, l, err := to.sockaddr() if err != nil { return err } return sendto(fd, p, int32(flags), ptr, l) } func SetsockoptTimeval(fd Handle, level, opt int, tv *Timeval) (err error) { return syscall.EWINDOWS } // The Linger struct is wrong but we only noticed after Go 1. // sysLinger is the real system call structure. // BUG(brainman): The definition of Linger is not appropriate for direct use // with Setsockopt and Getsockopt. // Use SetsockoptLinger instead. type Linger struct { Onoff int32 Linger int32 } type sysLinger struct { Onoff uint16 Linger uint16 } type IPMreq struct { Multiaddr [4]byte /* in_addr */ Interface [4]byte /* in_addr */ } type IPv6Mreq struct { Multiaddr [16]byte /* in6_addr */ Interface uint32 } func GetsockoptInt(fd Handle, level, opt int) (int, error) { v := int32(0) l := int32(unsafe.Sizeof(v)) err := Getsockopt(fd, int32(level), int32(opt), (*byte)(unsafe.Pointer(&v)), &l) return int(v), err } func SetsockoptLinger(fd Handle, level, opt int, l *Linger) (err error) { sys := sysLinger{Onoff: uint16(l.Onoff), Linger: uint16(l.Linger)} return Setsockopt(fd, int32(level), int32(opt), (*byte)(unsafe.Pointer(&sys)), int32(unsafe.Sizeof(sys))) } func SetsockoptInet4Addr(fd Handle, level, opt int, value [4]byte) (err error) { return Setsockopt(fd, int32(level), int32(opt), (*byte)(unsafe.Pointer(&value[0])), 4) } func SetsockoptIPMreq(fd Handle, level, opt int, mreq *IPMreq) (err error) { return Setsockopt(fd, int32(level), int32(opt), (*byte)(unsafe.Pointer(mreq)), int32(unsafe.Sizeof(*mreq))) } func SetsockoptIPv6Mreq(fd Handle, level, opt int, mreq *IPv6Mreq) (err error) { return syscall.EWINDOWS } func EnumProcesses(processIds []uint32, bytesReturned *uint32) error { // EnumProcesses syscall expects the size parameter to be in bytes, but the code generated with mksyscall uses // the length of the processIds slice instead. Hence, this wrapper function is added to fix the discrepancy. var p *uint32 if len(processIds) > 0 { p = &processIds[0] } size := uint32(len(processIds) * 4) return enumProcesses(p, size, bytesReturned) } func Getpid() (pid int) { return int(GetCurrentProcessId()) } func FindFirstFile(name *uint16, data *Win32finddata) (handle Handle, err error) { // NOTE(rsc): The Win32finddata struct is wrong for the system call: // the two paths are each one uint16 short. Use the correct struct, // a win32finddata1, and then copy the results out. // There is no loss of expressivity here, because the final // uint16, if it is used, is supposed to be a NUL, and Go doesn't need that. // For Go 1.1, we might avoid the allocation of win32finddata1 here // by adding a final Bug [2]uint16 field to the struct and then // adjusting the fields in the result directly. var data1 win32finddata1 handle, err = findFirstFile1(name, &data1) if err == nil { copyFindData(data, &data1) } return } func FindNextFile(handle Handle, data *Win32finddata) (err error) { var data1 win32finddata1 err = findNextFile1(handle, &data1) if err == nil { copyFindData(data, &data1) } return } func getProcessEntry(pid int) (*ProcessEntry32, error) { snapshot, err := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0) if err != nil { return nil, err } defer CloseHandle(snapshot) var procEntry ProcessEntry32 procEntry.Size = uint32(unsafe.Sizeof(procEntry)) if err = Process32First(snapshot, &procEntry); err != nil { return nil, err } for { if procEntry.ProcessID == uint32(pid) { return &procEntry, nil } err = Process32Next(snapshot, &procEntry) if err != nil { return nil, err } } } func Getppid() (ppid int) { pe, err := getProcessEntry(Getpid()) if err != nil { return -1 } return int(pe.ParentProcessID) } // TODO(brainman): fix all needed for os func Fchdir(fd Handle) (err error) { return syscall.EWINDOWS } func Link(oldpath, newpath string) (err error) { return syscall.EWINDOWS } func Symlink(path, link string) (err error) { return syscall.EWINDOWS } func Fchmod(fd Handle, mode uint32) (err error) { return syscall.EWINDOWS } func Chown(path string, uid int, gid int) (err error) { return syscall.EWINDOWS } func Lchown(path string, uid int, gid int) (err error) { return syscall.EWINDOWS } func Fchown(fd Handle, uid int, gid int) (err error) { return syscall.EWINDOWS } func Getuid() (uid int) { return -1 } func Geteuid() (euid int) { return -1 } func Getgid() (gid int) { return -1 } func Getegid() (egid int) { return -1 } func Getgroups() (gids []int, err error) { return nil, syscall.EWINDOWS } func LoadCreateSymbolicLink() error { return procCreateSymbolicLinkW.Find() } // Readlink returns the destination of the named symbolic link. func Readlink(path string, buf []byte) (n int, err error) { fd, err := CreateFile(StringToUTF16Ptr(path), GENERIC_READ, 0, nil, OPEN_EXISTING, FILE_FLAG_OPEN_REPARSE_POINT|FILE_FLAG_BACKUP_SEMANTICS, 0) if err != nil { return -1, err } defer CloseHandle(fd) rdbbuf := make([]byte, MAXIMUM_REPARSE_DATA_BUFFER_SIZE) var bytesReturned uint32 err = DeviceIoControl(fd, FSCTL_GET_REPARSE_POINT, nil, 0, &rdbbuf[0], uint32(len(rdbbuf)), &bytesReturned, nil) if err != nil { return -1, err } rdb := (*reparseDataBuffer)(unsafe.Pointer(&rdbbuf[0])) var s string switch rdb.ReparseTag { case IO_REPARSE_TAG_SYMLINK: data := (*symbolicLinkReparseBuffer)(unsafe.Pointer(&rdb.reparseBuffer)) p := (*[0xffff]uint16)(unsafe.Pointer(&data.PathBuffer[0])) s = UTF16ToString(p[data.PrintNameOffset/2 : (data.PrintNameLength-data.PrintNameOffset)/2]) case IO_REPARSE_TAG_MOUNT_POINT: data := (*mountPointReparseBuffer)(unsafe.Pointer(&rdb.reparseBuffer)) p := (*[0xffff]uint16)(unsafe.Pointer(&data.PathBuffer[0])) s = UTF16ToString(p[data.PrintNameOffset/2 : (data.PrintNameLength-data.PrintNameOffset)/2]) default: // the path is not a symlink or junction but another type of reparse // point return -1, syscall.ENOENT } n = copy(buf, []byte(s)) return n, nil } // GUIDFromString parses a string in the form of // "{XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}" into a GUID. func GUIDFromString(str string) (GUID, error) { guid := GUID{} str16, err := syscall.UTF16PtrFromString(str) if err != nil { return guid, err } err = clsidFromString(str16, &guid) if err != nil { return guid, err } return guid, nil } // GenerateGUID creates a new random GUID. func GenerateGUID() (GUID, error) { guid := GUID{} err := coCreateGuid(&guid) if err != nil { return guid, err } return guid, nil } // String returns the canonical string form of the GUID, // in the form of "{XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}". func (guid GUID) String() string { var str [100]uint16 chars := stringFromGUID2(&guid, &str[0], int32(len(str))) if chars <= 1 { return "" } return string(utf16.Decode(str[:chars-1])) } // KnownFolderPath returns a well-known folder path for the current user, specified by one of // the FOLDERID_ constants, and chosen and optionally created based on a KF_ flag. func KnownFolderPath(folderID *KNOWNFOLDERID, flags uint32) (string, error) { return Token(0).KnownFolderPath(folderID, flags) } // KnownFolderPath returns a well-known folder path for the user token, specified by one of // the FOLDERID_ constants, and chosen and optionally created based on a KF_ flag. func (t Token) KnownFolderPath(folderID *KNOWNFOLDERID, flags uint32) (string, error) { var p *uint16 err := shGetKnownFolderPath(folderID, flags, t, &p) if err != nil { return "", err } defer CoTaskMemFree(unsafe.Pointer(p)) return UTF16PtrToString(p), nil } // RtlGetVersion returns the version of the underlying operating system, ignoring // manifest semantics but is affected by the application compatibility layer. func RtlGetVersion() *OsVersionInfoEx { info := &OsVersionInfoEx{} info.osVersionInfoSize = uint32(unsafe.Sizeof(*info)) // According to documentation, this function always succeeds. // The function doesn't even check the validity of the // osVersionInfoSize member. Disassembling ntdll.dll indicates // that the documentation is indeed correct about that. _ = rtlGetVersion(info) return info } // RtlGetNtVersionNumbers returns the version of the underlying operating system, // ignoring manifest semantics and the application compatibility layer. func RtlGetNtVersionNumbers() (majorVersion, minorVersion, buildNumber uint32) { rtlGetNtVersionNumbers(&majorVersion, &minorVersion, &buildNumber) buildNumber &= 0xffff return } // GetProcessPreferredUILanguages retrieves the process preferred UI languages. func GetProcessPreferredUILanguages(flags uint32) ([]string, error) { return getUILanguages(flags, getProcessPreferredUILanguages) } // GetThreadPreferredUILanguages retrieves the thread preferred UI languages for the current thread. func GetThreadPreferredUILanguages(flags uint32) ([]string, error) { return getUILanguages(flags, getThreadPreferredUILanguages) } // GetUserPreferredUILanguages retrieves information about the user preferred UI languages. func GetUserPreferredUILanguages(flags uint32) ([]string, error) { return getUILanguages(flags, getUserPreferredUILanguages) } // GetSystemPreferredUILanguages retrieves the system preferred UI languages. func GetSystemPreferredUILanguages(flags uint32) ([]string, error) { return getUILanguages(flags, getSystemPreferredUILanguages) } func getUILanguages(flags uint32, f func(flags uint32, numLanguages *uint32, buf *uint16, bufSize *uint32) error) ([]string, error) { size := uint32(128) for { var numLanguages uint32 buf := make([]uint16, size) err := f(flags, &numLanguages, &buf[0], &size) if err == ERROR_INSUFFICIENT_BUFFER { continue } if err != nil { return nil, err } buf = buf[:size] if numLanguages == 0 || len(buf) == 0 { // GetProcessPreferredUILanguages may return numLanguages==0 with "\0\0" return []string{}, nil } if buf[len(buf)-1] == 0 { buf = buf[:len(buf)-1] // remove terminating null } languages := make([]string, 0, numLanguages) from := 0 for i, c := range buf { if c == 0 { languages = append(languages, string(utf16.Decode(buf[from:i]))) from = i + 1 } } return languages, nil } } func SetConsoleCursorPosition(console Handle, position Coord) error { return setConsoleCursorPosition(console, *((*uint32)(unsafe.Pointer(&position)))) } func GetStartupInfo(startupInfo *StartupInfo) error { getStartupInfo(startupInfo) return nil } func (s NTStatus) Errno() syscall.Errno { return rtlNtStatusToDosErrorNoTeb(s) } func langID(pri, sub uint16) uint32 { return uint32(sub)<<10 | uint32(pri) } func (s NTStatus) Error() string { b := make([]uint16, 300) n, err := FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_FROM_HMODULE|FORMAT_MESSAGE_ARGUMENT_ARRAY, modntdll.Handle(), uint32(s), langID(LANG_ENGLISH, SUBLANG_ENGLISH_US), b, nil) if err != nil { return fmt.Sprintf("NTSTATUS 0x%08x", uint32(s)) } // trim terminating \r and \n for ; n > 0 && (b[n-1] == '\n' || b[n-1] == '\r'); n-- { } return string(utf16.Decode(b[:n])) } // NewNTUnicodeString returns a new NTUnicodeString structure for use with native // NT APIs that work over the NTUnicodeString type. Note that most Windows APIs // do not use NTUnicodeString, and instead UTF16PtrFromString should be used for // the more common *uint16 string type. func NewNTUnicodeString(s string) (*NTUnicodeString, error) { s16, err := UTF16FromString(s) if err != nil { return nil, err } n := uint16(len(s16) * 2) return &NTUnicodeString{ Length: n - 2, // subtract 2 bytes for the NULL terminator MaximumLength: n, Buffer: &s16[0], }, nil } // Slice returns a uint16 slice that aliases the data in the NTUnicodeString. func (s *NTUnicodeString) Slice() []uint16 { // Note: this rounds the length down, if it happens // to (incorrectly) be odd. Probably safer than rounding up. return unsafe.Slice(s.Buffer, s.MaximumLength/2)[:s.Length/2] } func (s *NTUnicodeString) String() string { return UTF16ToString(s.Slice()) } // NewNTString returns a new NTString structure for use with native // NT APIs that work over the NTString type. Note that most Windows APIs // do not use NTString, and instead UTF16PtrFromString should be used for // the more common *uint16 string type. func NewNTString(s string) (*NTString, error) { var nts NTString s8, err := BytePtrFromString(s) if err != nil { return nil, err } RtlInitString(&nts, s8) return &nts, nil } // Slice returns a byte slice that aliases the data in the NTString. func (s *NTString) Slice() []byte { slice := unsafe.Slice(s.Buffer, s.MaximumLength) return slice[:s.Length] } func (s *NTString) String() string { return ByteSliceToString(s.Slice()) } // FindResource resolves a resource of the given name and resource type. func FindResource(module Handle, name, resType ResourceIDOrString) (Handle, error) { var namePtr, resTypePtr uintptr var name16, resType16 *uint16 var err error resolvePtr := func(i interface{}, keep **uint16) (uintptr, error) { switch v := i.(type) { case string: *keep, err = UTF16PtrFromString(v) if err != nil { return 0, err } return uintptr(unsafe.Pointer(*keep)), nil case ResourceID: return uintptr(v), nil } return 0, errorspkg.New("parameter must be a ResourceID or a string") } namePtr, err = resolvePtr(name, &name16) if err != nil { return 0, err } resTypePtr, err = resolvePtr(resType, &resType16) if err != nil { return 0, err } resInfo, err := findResource(module, namePtr, resTypePtr) runtime.KeepAlive(name16) runtime.KeepAlive(resType16) return resInfo, err } func LoadResourceData(module, resInfo Handle) (data []byte, err error) { size, err := SizeofResource(module, resInfo) if err != nil { return } resData, err := LoadResource(module, resInfo) if err != nil { return } ptr, err := LockResource(resData) if err != nil { return } data = unsafe.Slice((*byte)(unsafe.Pointer(ptr)), size) return } // PSAPI_WORKING_SET_EX_BLOCK contains extended working set information for a page. type PSAPI_WORKING_SET_EX_BLOCK uint64 // Valid returns the validity of this page. // If this bit is 1, the subsequent members are valid; otherwise they should be ignored. func (b PSAPI_WORKING_SET_EX_BLOCK) Valid() bool { return (b & 1) == 1 } // ShareCount is the number of processes that share this page. The maximum value of this member is 7. func (b PSAPI_WORKING_SET_EX_BLOCK) ShareCount() uint64 { return b.intField(1, 3) } // Win32Protection is the memory protection attributes of the page. For a list of values, see // https://docs.microsoft.com/en-us/windows/win32/memory/memory-protection-constants func (b PSAPI_WORKING_SET_EX_BLOCK) Win32Protection() uint64 { return b.intField(4, 11) } // Shared returns the shared status of this page. // If this bit is 1, the page can be shared. func (b PSAPI_WORKING_SET_EX_BLOCK) Shared() bool { return (b & (1 << 15)) == 1 } // Node is the NUMA node. The maximum value of this member is 63. func (b PSAPI_WORKING_SET_EX_BLOCK) Node() uint64 { return b.intField(16, 6) } // Locked returns the locked status of this page. // If this bit is 1, the virtual page is locked in physical memory. func (b PSAPI_WORKING_SET_EX_BLOCK) Locked() bool { return (b & (1 << 22)) == 1 } // LargePage returns the large page status of this page. // If this bit is 1, the page is a large page. func (b PSAPI_WORKING_SET_EX_BLOCK) LargePage() bool { return (b & (1 << 23)) == 1 } // Bad returns the bad status of this page. // If this bit is 1, the page is has been reported as bad. func (b PSAPI_WORKING_SET_EX_BLOCK) Bad() bool { return (b & (1 << 31)) == 1 } // intField extracts an integer field in the PSAPI_WORKING_SET_EX_BLOCK union. func (b PSAPI_WORKING_SET_EX_BLOCK) intField(start, length int) uint64 { var mask PSAPI_WORKING_SET_EX_BLOCK for pos := start; pos < start+length; pos++ { mask |= (1 << pos) } masked := b & mask return uint64(masked >> start) } // PSAPI_WORKING_SET_EX_INFORMATION contains extended working set information for a process. type PSAPI_WORKING_SET_EX_INFORMATION struct { // The virtual address. VirtualAddress Pointer // A PSAPI_WORKING_SET_EX_BLOCK union that indicates the attributes of the page at VirtualAddress. VirtualAttributes PSAPI_WORKING_SET_EX_BLOCK } // CreatePseudoConsole creates a windows pseudo console. func CreatePseudoConsole(size Coord, in Handle, out Handle, flags uint32, pconsole *Handle) error { // We need this wrapper to manually cast Coord to uint32. The autogenerated wrappers only // accept arguments that can be casted to uintptr, and Coord can't. return createPseudoConsole(*((*uint32)(unsafe.Pointer(&size))), in, out, flags, pconsole) } // ResizePseudoConsole resizes the internal buffers of the pseudo console to the width and height specified in `size`. func ResizePseudoConsole(pconsole Handle, size Coord) error { // We need this wrapper to manually cast Coord to uint32. The autogenerated wrappers only // accept arguments that can be casted to uintptr, and Coord can't. return resizePseudoConsole(pconsole, *((*uint32)(unsafe.Pointer(&size)))) } // DCB constants. See https://learn.microsoft.com/en-us/windows/win32/api/winbase/ns-winbase-dcb. const ( CBR_110 = 110 CBR_300 = 300 CBR_600 = 600 CBR_1200 = 1200 CBR_2400 = 2400 CBR_4800 = 4800 CBR_9600 = 9600 CBR_14400 = 14400 CBR_19200 = 19200 CBR_38400 = 38400 CBR_57600 = 57600 CBR_115200 = 115200 CBR_128000 = 128000 CBR_256000 = 256000 DTR_CONTROL_DISABLE = 0x00000000 DTR_CONTROL_ENABLE = 0x00000010 DTR_CONTROL_HANDSHAKE = 0x00000020 RTS_CONTROL_DISABLE = 0x00000000 RTS_CONTROL_ENABLE = 0x00001000 RTS_CONTROL_HANDSHAKE = 0x00002000 RTS_CONTROL_TOGGLE = 0x00003000 NOPARITY = 0 ODDPARITY = 1 EVENPARITY = 2 MARKPARITY = 3 SPACEPARITY = 4 ONESTOPBIT = 0 ONE5STOPBITS = 1 TWOSTOPBITS = 2 ) // EscapeCommFunction constants. See https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-escapecommfunction. const ( SETXOFF = 1 SETXON = 2 SETRTS = 3 CLRRTS = 4 SETDTR = 5 CLRDTR = 6 SETBREAK = 8 CLRBREAK = 9 ) // PurgeComm constants. See https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-purgecomm. const ( PURGE_TXABORT = 0x0001 PURGE_RXABORT = 0x0002 PURGE_TXCLEAR = 0x0004 PURGE_RXCLEAR = 0x0008 ) // SetCommMask constants. See https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-setcommmask. const ( EV_RXCHAR = 0x0001 EV_RXFLAG = 0x0002 EV_TXEMPTY = 0x0004 EV_CTS = 0x0008 EV_DSR = 0x0010 EV_RLSD = 0x0020 EV_BREAK = 0x0040 EV_ERR = 0x0080 EV_RING = 0x0100 ) ================================================ FILE: vendor/golang.org/x/sys/windows/types_windows.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package windows import ( "net" "syscall" "unsafe" ) // NTStatus corresponds with NTSTATUS, error values returned by ntdll.dll and // other native functions. type NTStatus uint32 const ( // Invented values to support what package os expects. O_RDONLY = 0x00000 O_WRONLY = 0x00001 O_RDWR = 0x00002 O_CREAT = 0x00040 O_EXCL = 0x00080 O_NOCTTY = 0x00100 O_TRUNC = 0x00200 O_NONBLOCK = 0x00800 O_APPEND = 0x00400 O_SYNC = 0x01000 O_ASYNC = 0x02000 O_CLOEXEC = 0x80000 ) const ( // More invented values for signals SIGHUP = Signal(0x1) SIGINT = Signal(0x2) SIGQUIT = Signal(0x3) SIGILL = Signal(0x4) SIGTRAP = Signal(0x5) SIGABRT = Signal(0x6) SIGBUS = Signal(0x7) SIGFPE = Signal(0x8) SIGKILL = Signal(0x9) SIGSEGV = Signal(0xb) SIGPIPE = Signal(0xd) SIGALRM = Signal(0xe) SIGTERM = Signal(0xf) ) var signals = [...]string{ 1: "hangup", 2: "interrupt", 3: "quit", 4: "illegal instruction", 5: "trace/breakpoint trap", 6: "aborted", 7: "bus error", 8: "floating point exception", 9: "killed", 10: "user defined signal 1", 11: "segmentation fault", 12: "user defined signal 2", 13: "broken pipe", 14: "alarm clock", 15: "terminated", } // File flags for [os.OpenFile]. The O_ prefix is used to indicate // that these flags are specific to the OpenFile function. const ( O_FILE_FLAG_OPEN_NO_RECALL = FILE_FLAG_OPEN_NO_RECALL O_FILE_FLAG_OPEN_REPARSE_POINT = FILE_FLAG_OPEN_REPARSE_POINT O_FILE_FLAG_SESSION_AWARE = FILE_FLAG_SESSION_AWARE O_FILE_FLAG_POSIX_SEMANTICS = FILE_FLAG_POSIX_SEMANTICS O_FILE_FLAG_BACKUP_SEMANTICS = FILE_FLAG_BACKUP_SEMANTICS O_FILE_FLAG_DELETE_ON_CLOSE = FILE_FLAG_DELETE_ON_CLOSE O_FILE_FLAG_SEQUENTIAL_SCAN = FILE_FLAG_SEQUENTIAL_SCAN O_FILE_FLAG_RANDOM_ACCESS = FILE_FLAG_RANDOM_ACCESS O_FILE_FLAG_NO_BUFFERING = FILE_FLAG_NO_BUFFERING O_FILE_FLAG_OVERLAPPED = FILE_FLAG_OVERLAPPED O_FILE_FLAG_WRITE_THROUGH = FILE_FLAG_WRITE_THROUGH ) const ( FILE_READ_DATA = 0x00000001 FILE_READ_ATTRIBUTES = 0x00000080 FILE_READ_EA = 0x00000008 FILE_WRITE_DATA = 0x00000002 FILE_WRITE_ATTRIBUTES = 0x00000100 FILE_WRITE_EA = 0x00000010 FILE_APPEND_DATA = 0x00000004 FILE_EXECUTE = 0x00000020 FILE_GENERIC_READ = STANDARD_RIGHTS_READ | FILE_READ_DATA | FILE_READ_ATTRIBUTES | FILE_READ_EA | SYNCHRONIZE FILE_GENERIC_WRITE = STANDARD_RIGHTS_WRITE | FILE_WRITE_DATA | FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA | FILE_APPEND_DATA | SYNCHRONIZE FILE_GENERIC_EXECUTE = STANDARD_RIGHTS_EXECUTE | FILE_READ_ATTRIBUTES | FILE_EXECUTE | SYNCHRONIZE FILE_LIST_DIRECTORY = 0x00000001 FILE_TRAVERSE = 0x00000020 FILE_SHARE_READ = 0x00000001 FILE_SHARE_WRITE = 0x00000002 FILE_SHARE_DELETE = 0x00000004 FILE_ATTRIBUTE_READONLY = 0x00000001 FILE_ATTRIBUTE_HIDDEN = 0x00000002 FILE_ATTRIBUTE_SYSTEM = 0x00000004 FILE_ATTRIBUTE_DIRECTORY = 0x00000010 FILE_ATTRIBUTE_ARCHIVE = 0x00000020 FILE_ATTRIBUTE_DEVICE = 0x00000040 FILE_ATTRIBUTE_NORMAL = 0x00000080 FILE_ATTRIBUTE_TEMPORARY = 0x00000100 FILE_ATTRIBUTE_SPARSE_FILE = 0x00000200 FILE_ATTRIBUTE_REPARSE_POINT = 0x00000400 FILE_ATTRIBUTE_COMPRESSED = 0x00000800 FILE_ATTRIBUTE_OFFLINE = 0x00001000 FILE_ATTRIBUTE_NOT_CONTENT_INDEXED = 0x00002000 FILE_ATTRIBUTE_ENCRYPTED = 0x00004000 FILE_ATTRIBUTE_INTEGRITY_STREAM = 0x00008000 FILE_ATTRIBUTE_VIRTUAL = 0x00010000 FILE_ATTRIBUTE_NO_SCRUB_DATA = 0x00020000 FILE_ATTRIBUTE_RECALL_ON_OPEN = 0x00040000 FILE_ATTRIBUTE_RECALL_ON_DATA_ACCESS = 0x00400000 INVALID_FILE_ATTRIBUTES = 0xffffffff CREATE_NEW = 1 CREATE_ALWAYS = 2 OPEN_EXISTING = 3 OPEN_ALWAYS = 4 TRUNCATE_EXISTING = 5 FILE_FLAG_OPEN_REQUIRING_OPLOCK = 0x00040000 FILE_FLAG_FIRST_PIPE_INSTANCE = 0x00080000 FILE_FLAG_OPEN_NO_RECALL = 0x00100000 FILE_FLAG_OPEN_REPARSE_POINT = 0x00200000 FILE_FLAG_SESSION_AWARE = 0x00800000 FILE_FLAG_POSIX_SEMANTICS = 0x01000000 FILE_FLAG_BACKUP_SEMANTICS = 0x02000000 FILE_FLAG_DELETE_ON_CLOSE = 0x04000000 FILE_FLAG_SEQUENTIAL_SCAN = 0x08000000 FILE_FLAG_RANDOM_ACCESS = 0x10000000 FILE_FLAG_NO_BUFFERING = 0x20000000 FILE_FLAG_OVERLAPPED = 0x40000000 FILE_FLAG_WRITE_THROUGH = 0x80000000 HANDLE_FLAG_INHERIT = 0x00000001 STARTF_USESTDHANDLES = 0x00000100 STARTF_USESHOWWINDOW = 0x00000001 DUPLICATE_CLOSE_SOURCE = 0x00000001 DUPLICATE_SAME_ACCESS = 0x00000002 STD_INPUT_HANDLE = -10 & (1<<32 - 1) STD_OUTPUT_HANDLE = -11 & (1<<32 - 1) STD_ERROR_HANDLE = -12 & (1<<32 - 1) FILE_BEGIN = 0 FILE_CURRENT = 1 FILE_END = 2 LANG_ENGLISH = 0x09 SUBLANG_ENGLISH_US = 0x01 FORMAT_MESSAGE_ALLOCATE_BUFFER = 256 FORMAT_MESSAGE_IGNORE_INSERTS = 512 FORMAT_MESSAGE_FROM_STRING = 1024 FORMAT_MESSAGE_FROM_HMODULE = 2048 FORMAT_MESSAGE_FROM_SYSTEM = 4096 FORMAT_MESSAGE_ARGUMENT_ARRAY = 8192 FORMAT_MESSAGE_MAX_WIDTH_MASK = 255 MAX_PATH = 260 MAX_LONG_PATH = 32768 MAX_MODULE_NAME32 = 255 MAX_COMPUTERNAME_LENGTH = 15 MAX_DHCPV6_DUID_LENGTH = 130 MAX_DNS_SUFFIX_STRING_LENGTH = 256 TIME_ZONE_ID_UNKNOWN = 0 TIME_ZONE_ID_STANDARD = 1 TIME_ZONE_ID_DAYLIGHT = 2 IGNORE = 0 INFINITE = 0xffffffff WAIT_ABANDONED = 0x00000080 WAIT_OBJECT_0 = 0x00000000 WAIT_FAILED = 0xFFFFFFFF // Access rights for process. PROCESS_ALL_ACCESS = 0xFFFF PROCESS_CREATE_PROCESS = 0x0080 PROCESS_CREATE_THREAD = 0x0002 PROCESS_DUP_HANDLE = 0x0040 PROCESS_QUERY_INFORMATION = 0x0400 PROCESS_QUERY_LIMITED_INFORMATION = 0x1000 PROCESS_SET_INFORMATION = 0x0200 PROCESS_SET_QUOTA = 0x0100 PROCESS_SUSPEND_RESUME = 0x0800 PROCESS_TERMINATE = 0x0001 PROCESS_VM_OPERATION = 0x0008 PROCESS_VM_READ = 0x0010 PROCESS_VM_WRITE = 0x0020 // Access rights for thread. THREAD_DIRECT_IMPERSONATION = 0x0200 THREAD_GET_CONTEXT = 0x0008 THREAD_IMPERSONATE = 0x0100 THREAD_QUERY_INFORMATION = 0x0040 THREAD_QUERY_LIMITED_INFORMATION = 0x0800 THREAD_SET_CONTEXT = 0x0010 THREAD_SET_INFORMATION = 0x0020 THREAD_SET_LIMITED_INFORMATION = 0x0400 THREAD_SET_THREAD_TOKEN = 0x0080 THREAD_SUSPEND_RESUME = 0x0002 THREAD_TERMINATE = 0x0001 FILE_MAP_COPY = 0x01 FILE_MAP_WRITE = 0x02 FILE_MAP_READ = 0x04 FILE_MAP_EXECUTE = 0x20 CTRL_C_EVENT = 0 CTRL_BREAK_EVENT = 1 CTRL_CLOSE_EVENT = 2 CTRL_LOGOFF_EVENT = 5 CTRL_SHUTDOWN_EVENT = 6 // Windows reserves errors >= 1<<29 for application use. APPLICATION_ERROR = 1 << 29 ) const ( // Process creation flags. CREATE_BREAKAWAY_FROM_JOB = 0x01000000 CREATE_DEFAULT_ERROR_MODE = 0x04000000 CREATE_NEW_CONSOLE = 0x00000010 CREATE_NEW_PROCESS_GROUP = 0x00000200 CREATE_NO_WINDOW = 0x08000000 CREATE_PROTECTED_PROCESS = 0x00040000 CREATE_PRESERVE_CODE_AUTHZ_LEVEL = 0x02000000 CREATE_SEPARATE_WOW_VDM = 0x00000800 CREATE_SHARED_WOW_VDM = 0x00001000 CREATE_SUSPENDED = 0x00000004 CREATE_UNICODE_ENVIRONMENT = 0x00000400 DEBUG_ONLY_THIS_PROCESS = 0x00000002 DEBUG_PROCESS = 0x00000001 DETACHED_PROCESS = 0x00000008 EXTENDED_STARTUPINFO_PRESENT = 0x00080000 INHERIT_PARENT_AFFINITY = 0x00010000 ) const ( // attributes for ProcThreadAttributeList PROC_THREAD_ATTRIBUTE_PARENT_PROCESS = 0x00020000 PROC_THREAD_ATTRIBUTE_HANDLE_LIST = 0x00020002 PROC_THREAD_ATTRIBUTE_GROUP_AFFINITY = 0x00030003 PROC_THREAD_ATTRIBUTE_PREFERRED_NODE = 0x00020004 PROC_THREAD_ATTRIBUTE_IDEAL_PROCESSOR = 0x00030005 PROC_THREAD_ATTRIBUTE_MITIGATION_POLICY = 0x00020007 PROC_THREAD_ATTRIBUTE_UMS_THREAD = 0x00030006 PROC_THREAD_ATTRIBUTE_PROTECTION_LEVEL = 0x0002000b PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE = 0x00020016 ) const ( // flags for CreateToolhelp32Snapshot TH32CS_SNAPHEAPLIST = 0x01 TH32CS_SNAPPROCESS = 0x02 TH32CS_SNAPTHREAD = 0x04 TH32CS_SNAPMODULE = 0x08 TH32CS_SNAPMODULE32 = 0x10 TH32CS_SNAPALL = TH32CS_SNAPHEAPLIST | TH32CS_SNAPMODULE | TH32CS_SNAPPROCESS | TH32CS_SNAPTHREAD TH32CS_INHERIT = 0x80000000 ) const ( // flags for EnumProcessModulesEx LIST_MODULES_32BIT = 0x01 LIST_MODULES_64BIT = 0x02 LIST_MODULES_ALL = 0x03 LIST_MODULES_DEFAULT = 0x00 ) const ( // filters for ReadDirectoryChangesW and FindFirstChangeNotificationW FILE_NOTIFY_CHANGE_FILE_NAME = 0x001 FILE_NOTIFY_CHANGE_DIR_NAME = 0x002 FILE_NOTIFY_CHANGE_ATTRIBUTES = 0x004 FILE_NOTIFY_CHANGE_SIZE = 0x008 FILE_NOTIFY_CHANGE_LAST_WRITE = 0x010 FILE_NOTIFY_CHANGE_LAST_ACCESS = 0x020 FILE_NOTIFY_CHANGE_CREATION = 0x040 FILE_NOTIFY_CHANGE_SECURITY = 0x100 ) const ( // do not reorder FILE_ACTION_ADDED = iota + 1 FILE_ACTION_REMOVED FILE_ACTION_MODIFIED FILE_ACTION_RENAMED_OLD_NAME FILE_ACTION_RENAMED_NEW_NAME ) const ( // wincrypt.h /* certenrolld_begin -- PROV_RSA_*/ PROV_RSA_FULL = 1 PROV_RSA_SIG = 2 PROV_DSS = 3 PROV_FORTEZZA = 4 PROV_MS_EXCHANGE = 5 PROV_SSL = 6 PROV_RSA_SCHANNEL = 12 PROV_DSS_DH = 13 PROV_EC_ECDSA_SIG = 14 PROV_EC_ECNRA_SIG = 15 PROV_EC_ECDSA_FULL = 16 PROV_EC_ECNRA_FULL = 17 PROV_DH_SCHANNEL = 18 PROV_SPYRUS_LYNKS = 20 PROV_RNG = 21 PROV_INTEL_SEC = 22 PROV_REPLACE_OWF = 23 PROV_RSA_AES = 24 /* dwFlags definitions for CryptAcquireContext */ CRYPT_VERIFYCONTEXT = 0xF0000000 CRYPT_NEWKEYSET = 0x00000008 CRYPT_DELETEKEYSET = 0x00000010 CRYPT_MACHINE_KEYSET = 0x00000020 CRYPT_SILENT = 0x00000040 CRYPT_DEFAULT_CONTAINER_OPTIONAL = 0x00000080 /* Flags for PFXImportCertStore */ CRYPT_EXPORTABLE = 0x00000001 CRYPT_USER_PROTECTED = 0x00000002 CRYPT_USER_KEYSET = 0x00001000 PKCS12_PREFER_CNG_KSP = 0x00000100 PKCS12_ALWAYS_CNG_KSP = 0x00000200 PKCS12_ALLOW_OVERWRITE_KEY = 0x00004000 PKCS12_NO_PERSIST_KEY = 0x00008000 PKCS12_INCLUDE_EXTENDED_PROPERTIES = 0x00000010 /* Flags for CryptAcquireCertificatePrivateKey */ CRYPT_ACQUIRE_CACHE_FLAG = 0x00000001 CRYPT_ACQUIRE_USE_PROV_INFO_FLAG = 0x00000002 CRYPT_ACQUIRE_COMPARE_KEY_FLAG = 0x00000004 CRYPT_ACQUIRE_NO_HEALING = 0x00000008 CRYPT_ACQUIRE_SILENT_FLAG = 0x00000040 CRYPT_ACQUIRE_WINDOW_HANDLE_FLAG = 0x00000080 CRYPT_ACQUIRE_NCRYPT_KEY_FLAGS_MASK = 0x00070000 CRYPT_ACQUIRE_ALLOW_NCRYPT_KEY_FLAG = 0x00010000 CRYPT_ACQUIRE_PREFER_NCRYPT_KEY_FLAG = 0x00020000 CRYPT_ACQUIRE_ONLY_NCRYPT_KEY_FLAG = 0x00040000 /* pdwKeySpec for CryptAcquireCertificatePrivateKey */ AT_KEYEXCHANGE = 1 AT_SIGNATURE = 2 CERT_NCRYPT_KEY_SPEC = 0xFFFFFFFF /* Default usage match type is AND with value zero */ USAGE_MATCH_TYPE_AND = 0 USAGE_MATCH_TYPE_OR = 1 /* msgAndCertEncodingType values for CertOpenStore function */ X509_ASN_ENCODING = 0x00000001 PKCS_7_ASN_ENCODING = 0x00010000 /* storeProvider values for CertOpenStore function */ CERT_STORE_PROV_MSG = 1 CERT_STORE_PROV_MEMORY = 2 CERT_STORE_PROV_FILE = 3 CERT_STORE_PROV_REG = 4 CERT_STORE_PROV_PKCS7 = 5 CERT_STORE_PROV_SERIALIZED = 6 CERT_STORE_PROV_FILENAME_A = 7 CERT_STORE_PROV_FILENAME_W = 8 CERT_STORE_PROV_FILENAME = CERT_STORE_PROV_FILENAME_W CERT_STORE_PROV_SYSTEM_A = 9 CERT_STORE_PROV_SYSTEM_W = 10 CERT_STORE_PROV_SYSTEM = CERT_STORE_PROV_SYSTEM_W CERT_STORE_PROV_COLLECTION = 11 CERT_STORE_PROV_SYSTEM_REGISTRY_A = 12 CERT_STORE_PROV_SYSTEM_REGISTRY_W = 13 CERT_STORE_PROV_SYSTEM_REGISTRY = CERT_STORE_PROV_SYSTEM_REGISTRY_W CERT_STORE_PROV_PHYSICAL_W = 14 CERT_STORE_PROV_PHYSICAL = CERT_STORE_PROV_PHYSICAL_W CERT_STORE_PROV_SMART_CARD_W = 15 CERT_STORE_PROV_SMART_CARD = CERT_STORE_PROV_SMART_CARD_W CERT_STORE_PROV_LDAP_W = 16 CERT_STORE_PROV_LDAP = CERT_STORE_PROV_LDAP_W CERT_STORE_PROV_PKCS12 = 17 /* store characteristics (low WORD of flag) for CertOpenStore function */ CERT_STORE_NO_CRYPT_RELEASE_FLAG = 0x00000001 CERT_STORE_SET_LOCALIZED_NAME_FLAG = 0x00000002 CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG = 0x00000004 CERT_STORE_DELETE_FLAG = 0x00000010 CERT_STORE_UNSAFE_PHYSICAL_FLAG = 0x00000020 CERT_STORE_SHARE_STORE_FLAG = 0x00000040 CERT_STORE_SHARE_CONTEXT_FLAG = 0x00000080 CERT_STORE_MANIFOLD_FLAG = 0x00000100 CERT_STORE_ENUM_ARCHIVED_FLAG = 0x00000200 CERT_STORE_UPDATE_KEYID_FLAG = 0x00000400 CERT_STORE_BACKUP_RESTORE_FLAG = 0x00000800 CERT_STORE_MAXIMUM_ALLOWED_FLAG = 0x00001000 CERT_STORE_CREATE_NEW_FLAG = 0x00002000 CERT_STORE_OPEN_EXISTING_FLAG = 0x00004000 CERT_STORE_READONLY_FLAG = 0x00008000 /* store locations (high WORD of flag) for CertOpenStore function */ CERT_SYSTEM_STORE_CURRENT_USER = 0x00010000 CERT_SYSTEM_STORE_LOCAL_MACHINE = 0x00020000 CERT_SYSTEM_STORE_CURRENT_SERVICE = 0x00040000 CERT_SYSTEM_STORE_SERVICES = 0x00050000 CERT_SYSTEM_STORE_USERS = 0x00060000 CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY = 0x00070000 CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY = 0x00080000 CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE = 0x00090000 CERT_SYSTEM_STORE_UNPROTECTED_FLAG = 0x40000000 CERT_SYSTEM_STORE_RELOCATE_FLAG = 0x80000000 /* Miscellaneous high-WORD flags for CertOpenStore function */ CERT_REGISTRY_STORE_REMOTE_FLAG = 0x00010000 CERT_REGISTRY_STORE_SERIALIZED_FLAG = 0x00020000 CERT_REGISTRY_STORE_ROAMING_FLAG = 0x00040000 CERT_REGISTRY_STORE_MY_IE_DIRTY_FLAG = 0x00080000 CERT_REGISTRY_STORE_LM_GPT_FLAG = 0x01000000 CERT_REGISTRY_STORE_CLIENT_GPT_FLAG = 0x80000000 CERT_FILE_STORE_COMMIT_ENABLE_FLAG = 0x00010000 CERT_LDAP_STORE_SIGN_FLAG = 0x00010000 CERT_LDAP_STORE_AREC_EXCLUSIVE_FLAG = 0x00020000 CERT_LDAP_STORE_OPENED_FLAG = 0x00040000 CERT_LDAP_STORE_UNBIND_FLAG = 0x00080000 /* addDisposition values for CertAddCertificateContextToStore function */ CERT_STORE_ADD_NEW = 1 CERT_STORE_ADD_USE_EXISTING = 2 CERT_STORE_ADD_REPLACE_EXISTING = 3 CERT_STORE_ADD_ALWAYS = 4 CERT_STORE_ADD_REPLACE_EXISTING_INHERIT_PROPERTIES = 5 CERT_STORE_ADD_NEWER = 6 CERT_STORE_ADD_NEWER_INHERIT_PROPERTIES = 7 /* ErrorStatus values for CertTrustStatus struct */ CERT_TRUST_NO_ERROR = 0x00000000 CERT_TRUST_IS_NOT_TIME_VALID = 0x00000001 CERT_TRUST_IS_REVOKED = 0x00000004 CERT_TRUST_IS_NOT_SIGNATURE_VALID = 0x00000008 CERT_TRUST_IS_NOT_VALID_FOR_USAGE = 0x00000010 CERT_TRUST_IS_UNTRUSTED_ROOT = 0x00000020 CERT_TRUST_REVOCATION_STATUS_UNKNOWN = 0x00000040 CERT_TRUST_IS_CYCLIC = 0x00000080 CERT_TRUST_INVALID_EXTENSION = 0x00000100 CERT_TRUST_INVALID_POLICY_CONSTRAINTS = 0x00000200 CERT_TRUST_INVALID_BASIC_CONSTRAINTS = 0x00000400 CERT_TRUST_INVALID_NAME_CONSTRAINTS = 0x00000800 CERT_TRUST_HAS_NOT_SUPPORTED_NAME_CONSTRAINT = 0x00001000 CERT_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT = 0x00002000 CERT_TRUST_HAS_NOT_PERMITTED_NAME_CONSTRAINT = 0x00004000 CERT_TRUST_HAS_EXCLUDED_NAME_CONSTRAINT = 0x00008000 CERT_TRUST_IS_PARTIAL_CHAIN = 0x00010000 CERT_TRUST_CTL_IS_NOT_TIME_VALID = 0x00020000 CERT_TRUST_CTL_IS_NOT_SIGNATURE_VALID = 0x00040000 CERT_TRUST_CTL_IS_NOT_VALID_FOR_USAGE = 0x00080000 CERT_TRUST_HAS_WEAK_SIGNATURE = 0x00100000 CERT_TRUST_IS_OFFLINE_REVOCATION = 0x01000000 CERT_TRUST_NO_ISSUANCE_CHAIN_POLICY = 0x02000000 CERT_TRUST_IS_EXPLICIT_DISTRUST = 0x04000000 CERT_TRUST_HAS_NOT_SUPPORTED_CRITICAL_EXT = 0x08000000 /* InfoStatus values for CertTrustStatus struct */ CERT_TRUST_HAS_EXACT_MATCH_ISSUER = 0x00000001 CERT_TRUST_HAS_KEY_MATCH_ISSUER = 0x00000002 CERT_TRUST_HAS_NAME_MATCH_ISSUER = 0x00000004 CERT_TRUST_IS_SELF_SIGNED = 0x00000008 CERT_TRUST_HAS_PREFERRED_ISSUER = 0x00000100 CERT_TRUST_HAS_ISSUANCE_CHAIN_POLICY = 0x00000400 CERT_TRUST_HAS_VALID_NAME_CONSTRAINTS = 0x00000400 CERT_TRUST_IS_PEER_TRUSTED = 0x00000800 CERT_TRUST_HAS_CRL_VALIDITY_EXTENDED = 0x00001000 CERT_TRUST_IS_FROM_EXCLUSIVE_TRUST_STORE = 0x00002000 CERT_TRUST_IS_CA_TRUSTED = 0x00004000 CERT_TRUST_IS_COMPLEX_CHAIN = 0x00010000 /* Certificate Information Flags */ CERT_INFO_VERSION_FLAG = 1 CERT_INFO_SERIAL_NUMBER_FLAG = 2 CERT_INFO_SIGNATURE_ALGORITHM_FLAG = 3 CERT_INFO_ISSUER_FLAG = 4 CERT_INFO_NOT_BEFORE_FLAG = 5 CERT_INFO_NOT_AFTER_FLAG = 6 CERT_INFO_SUBJECT_FLAG = 7 CERT_INFO_SUBJECT_PUBLIC_KEY_INFO_FLAG = 8 CERT_INFO_ISSUER_UNIQUE_ID_FLAG = 9 CERT_INFO_SUBJECT_UNIQUE_ID_FLAG = 10 CERT_INFO_EXTENSION_FLAG = 11 /* dwFindType for CertFindCertificateInStore */ CERT_COMPARE_MASK = 0xFFFF CERT_COMPARE_SHIFT = 16 CERT_COMPARE_ANY = 0 CERT_COMPARE_SHA1_HASH = 1 CERT_COMPARE_NAME = 2 CERT_COMPARE_ATTR = 3 CERT_COMPARE_MD5_HASH = 4 CERT_COMPARE_PROPERTY = 5 CERT_COMPARE_PUBLIC_KEY = 6 CERT_COMPARE_HASH = CERT_COMPARE_SHA1_HASH CERT_COMPARE_NAME_STR_A = 7 CERT_COMPARE_NAME_STR_W = 8 CERT_COMPARE_KEY_SPEC = 9 CERT_COMPARE_ENHKEY_USAGE = 10 CERT_COMPARE_CTL_USAGE = CERT_COMPARE_ENHKEY_USAGE CERT_COMPARE_SUBJECT_CERT = 11 CERT_COMPARE_ISSUER_OF = 12 CERT_COMPARE_EXISTING = 13 CERT_COMPARE_SIGNATURE_HASH = 14 CERT_COMPARE_KEY_IDENTIFIER = 15 CERT_COMPARE_CERT_ID = 16 CERT_COMPARE_CROSS_CERT_DIST_POINTS = 17 CERT_COMPARE_PUBKEY_MD5_HASH = 18 CERT_COMPARE_SUBJECT_INFO_ACCESS = 19 CERT_COMPARE_HASH_STR = 20 CERT_COMPARE_HAS_PRIVATE_KEY = 21 CERT_FIND_ANY = (CERT_COMPARE_ANY << CERT_COMPARE_SHIFT) CERT_FIND_SHA1_HASH = (CERT_COMPARE_SHA1_HASH << CERT_COMPARE_SHIFT) CERT_FIND_MD5_HASH = (CERT_COMPARE_MD5_HASH << CERT_COMPARE_SHIFT) CERT_FIND_SIGNATURE_HASH = (CERT_COMPARE_SIGNATURE_HASH << CERT_COMPARE_SHIFT) CERT_FIND_KEY_IDENTIFIER = (CERT_COMPARE_KEY_IDENTIFIER << CERT_COMPARE_SHIFT) CERT_FIND_HASH = CERT_FIND_SHA1_HASH CERT_FIND_PROPERTY = (CERT_COMPARE_PROPERTY << CERT_COMPARE_SHIFT) CERT_FIND_PUBLIC_KEY = (CERT_COMPARE_PUBLIC_KEY << CERT_COMPARE_SHIFT) CERT_FIND_SUBJECT_NAME = (CERT_COMPARE_NAME<> 32 & 0xffffffff) return ft } type Win32finddata struct { FileAttributes uint32 CreationTime Filetime LastAccessTime Filetime LastWriteTime Filetime FileSizeHigh uint32 FileSizeLow uint32 Reserved0 uint32 Reserved1 uint32 FileName [MAX_PATH - 1]uint16 AlternateFileName [13]uint16 } // This is the actual system call structure. // Win32finddata is what we committed to in Go 1. type win32finddata1 struct { FileAttributes uint32 CreationTime Filetime LastAccessTime Filetime LastWriteTime Filetime FileSizeHigh uint32 FileSizeLow uint32 Reserved0 uint32 Reserved1 uint32 FileName [MAX_PATH]uint16 AlternateFileName [14]uint16 // The Microsoft documentation for this struct¹ describes three additional // fields: dwFileType, dwCreatorType, and wFinderFlags. However, those fields // are empirically only present in the macOS port of the Win32 API,² and thus // not needed for binaries built for Windows. // // ¹ https://docs.microsoft.com/en-us/windows/win32/api/minwinbase/ns-minwinbase-win32_find_dataw describe // ² https://golang.org/issue/42637#issuecomment-760715755. } func copyFindData(dst *Win32finddata, src *win32finddata1) { dst.FileAttributes = src.FileAttributes dst.CreationTime = src.CreationTime dst.LastAccessTime = src.LastAccessTime dst.LastWriteTime = src.LastWriteTime dst.FileSizeHigh = src.FileSizeHigh dst.FileSizeLow = src.FileSizeLow dst.Reserved0 = src.Reserved0 dst.Reserved1 = src.Reserved1 // The src is 1 element bigger than dst, but it must be NUL. copy(dst.FileName[:], src.FileName[:]) copy(dst.AlternateFileName[:], src.AlternateFileName[:]) } type ByHandleFileInformation struct { FileAttributes uint32 CreationTime Filetime LastAccessTime Filetime LastWriteTime Filetime VolumeSerialNumber uint32 FileSizeHigh uint32 FileSizeLow uint32 NumberOfLinks uint32 FileIndexHigh uint32 FileIndexLow uint32 } const ( GetFileExInfoStandard = 0 GetFileExMaxInfoLevel = 1 ) type Win32FileAttributeData struct { FileAttributes uint32 CreationTime Filetime LastAccessTime Filetime LastWriteTime Filetime FileSizeHigh uint32 FileSizeLow uint32 } // ShowWindow constants const ( // winuser.h SW_HIDE = 0 SW_NORMAL = 1 SW_SHOWNORMAL = 1 SW_SHOWMINIMIZED = 2 SW_SHOWMAXIMIZED = 3 SW_MAXIMIZE = 3 SW_SHOWNOACTIVATE = 4 SW_SHOW = 5 SW_MINIMIZE = 6 SW_SHOWMINNOACTIVE = 7 SW_SHOWNA = 8 SW_RESTORE = 9 SW_SHOWDEFAULT = 10 SW_FORCEMINIMIZE = 11 ) type StartupInfo struct { Cb uint32 _ *uint16 Desktop *uint16 Title *uint16 X uint32 Y uint32 XSize uint32 YSize uint32 XCountChars uint32 YCountChars uint32 FillAttribute uint32 Flags uint32 ShowWindow uint16 _ uint16 _ *byte StdInput Handle StdOutput Handle StdErr Handle } type StartupInfoEx struct { StartupInfo ProcThreadAttributeList *ProcThreadAttributeList } // ProcThreadAttributeList is a placeholder type to represent a PROC_THREAD_ATTRIBUTE_LIST. // // To create a *ProcThreadAttributeList, use NewProcThreadAttributeList, update // it with ProcThreadAttributeListContainer.Update, free its memory using // ProcThreadAttributeListContainer.Delete, and access the list itself using // ProcThreadAttributeListContainer.List. type ProcThreadAttributeList struct{} type ProcThreadAttributeListContainer struct { data *ProcThreadAttributeList pointers []unsafe.Pointer } type ProcessInformation struct { Process Handle Thread Handle ProcessId uint32 ThreadId uint32 } type ProcessEntry32 struct { Size uint32 Usage uint32 ProcessID uint32 DefaultHeapID uintptr ModuleID uint32 Threads uint32 ParentProcessID uint32 PriClassBase int32 Flags uint32 ExeFile [MAX_PATH]uint16 } type ThreadEntry32 struct { Size uint32 Usage uint32 ThreadID uint32 OwnerProcessID uint32 BasePri int32 DeltaPri int32 Flags uint32 } type ModuleEntry32 struct { Size uint32 ModuleID uint32 ProcessID uint32 GlblcntUsage uint32 ProccntUsage uint32 ModBaseAddr uintptr ModBaseSize uint32 ModuleHandle Handle Module [MAX_MODULE_NAME32 + 1]uint16 ExePath [MAX_PATH]uint16 } const SizeofModuleEntry32 = unsafe.Sizeof(ModuleEntry32{}) type Systemtime struct { Year uint16 Month uint16 DayOfWeek uint16 Day uint16 Hour uint16 Minute uint16 Second uint16 Milliseconds uint16 } type Timezoneinformation struct { Bias int32 StandardName [32]uint16 StandardDate Systemtime StandardBias int32 DaylightName [32]uint16 DaylightDate Systemtime DaylightBias int32 } // Socket related. const ( AF_UNSPEC = 0 AF_UNIX = 1 AF_INET = 2 AF_NETBIOS = 17 AF_INET6 = 23 AF_IRDA = 26 AF_BTH = 32 SOCK_STREAM = 1 SOCK_DGRAM = 2 SOCK_RAW = 3 SOCK_RDM = 4 SOCK_SEQPACKET = 5 IPPROTO_IP = 0 IPPROTO_ICMP = 1 IPPROTO_IGMP = 2 BTHPROTO_RFCOMM = 3 IPPROTO_TCP = 6 IPPROTO_UDP = 17 IPPROTO_IPV6 = 41 IPPROTO_ICMPV6 = 58 IPPROTO_RM = 113 SOL_SOCKET = 0xffff SO_REUSEADDR = 4 SO_KEEPALIVE = 8 SO_DONTROUTE = 16 SO_BROADCAST = 32 SO_LINGER = 128 SO_RCVBUF = 0x1002 SO_RCVTIMEO = 0x1006 SO_SNDBUF = 0x1001 SO_UPDATE_ACCEPT_CONTEXT = 0x700b SO_UPDATE_CONNECT_CONTEXT = 0x7010 IOC_OUT = 0x40000000 IOC_IN = 0x80000000 IOC_VENDOR = 0x18000000 IOC_INOUT = IOC_IN | IOC_OUT IOC_WS2 = 0x08000000 SIO_GET_EXTENSION_FUNCTION_POINTER = IOC_INOUT | IOC_WS2 | 6 SIO_KEEPALIVE_VALS = IOC_IN | IOC_VENDOR | 4 SIO_UDP_CONNRESET = IOC_IN | IOC_VENDOR | 12 SIO_UDP_NETRESET = IOC_IN | IOC_VENDOR | 15 // cf. http://support.microsoft.com/default.aspx?scid=kb;en-us;257460 IP_HDRINCL = 0x2 IP_TOS = 0x3 IP_TTL = 0x4 IP_MULTICAST_IF = 0x9 IP_MULTICAST_TTL = 0xa IP_MULTICAST_LOOP = 0xb IP_ADD_MEMBERSHIP = 0xc IP_DROP_MEMBERSHIP = 0xd IP_PKTINFO = 0x13 IP_MTU_DISCOVER = 0x47 IPV6_V6ONLY = 0x1b IPV6_UNICAST_HOPS = 0x4 IPV6_MULTICAST_IF = 0x9 IPV6_MULTICAST_HOPS = 0xa IPV6_MULTICAST_LOOP = 0xb IPV6_JOIN_GROUP = 0xc IPV6_LEAVE_GROUP = 0xd IPV6_PKTINFO = 0x13 IPV6_MTU_DISCOVER = 0x47 MSG_OOB = 0x1 MSG_PEEK = 0x2 MSG_DONTROUTE = 0x4 MSG_WAITALL = 0x8 MSG_TRUNC = 0x0100 MSG_CTRUNC = 0x0200 MSG_BCAST = 0x0400 MSG_MCAST = 0x0800 SOMAXCONN = 0x7fffffff TCP_NODELAY = 1 TCP_EXPEDITED_1122 = 2 TCP_KEEPALIVE = 3 TCP_MAXSEG = 4 TCP_MAXRT = 5 TCP_STDURG = 6 TCP_NOURG = 7 TCP_ATMARK = 8 TCP_NOSYNRETRIES = 9 TCP_TIMESTAMPS = 10 TCP_OFFLOAD_PREFERENCE = 11 TCP_CONGESTION_ALGORITHM = 12 TCP_DELAY_FIN_ACK = 13 TCP_MAXRTMS = 14 TCP_FASTOPEN = 15 TCP_KEEPCNT = 16 TCP_KEEPIDLE = TCP_KEEPALIVE TCP_KEEPINTVL = 17 TCP_FAIL_CONNECT_ON_ICMP_ERROR = 18 TCP_ICMP_ERROR_INFO = 19 UDP_NOCHECKSUM = 1 UDP_SEND_MSG_SIZE = 2 UDP_RECV_MAX_COALESCED_SIZE = 3 UDP_CHECKSUM_COVERAGE = 20 UDP_COALESCED_INFO = 3 SHUT_RD = 0 SHUT_WR = 1 SHUT_RDWR = 2 WSADESCRIPTION_LEN = 256 WSASYS_STATUS_LEN = 128 ) // enum PMTUD_STATE from ws2ipdef.h const ( IP_PMTUDISC_NOT_SET = 0 IP_PMTUDISC_DO = 1 IP_PMTUDISC_DONT = 2 IP_PMTUDISC_PROBE = 3 IP_PMTUDISC_MAX = 4 ) type WSABuf struct { Len uint32 Buf *byte } type WSAMsg struct { Name *syscall.RawSockaddrAny Namelen int32 Buffers *WSABuf BufferCount uint32 Control WSABuf Flags uint32 } type WSACMSGHDR struct { Len uintptr Level int32 Type int32 } type IN_PKTINFO struct { Addr [4]byte Ifindex uint32 } type IN6_PKTINFO struct { Addr [16]byte Ifindex uint32 } // Flags for WSASocket const ( WSA_FLAG_OVERLAPPED = 0x01 WSA_FLAG_MULTIPOINT_C_ROOT = 0x02 WSA_FLAG_MULTIPOINT_C_LEAF = 0x04 WSA_FLAG_MULTIPOINT_D_ROOT = 0x08 WSA_FLAG_MULTIPOINT_D_LEAF = 0x10 WSA_FLAG_ACCESS_SYSTEM_SECURITY = 0x40 WSA_FLAG_NO_HANDLE_INHERIT = 0x80 WSA_FLAG_REGISTERED_IO = 0x100 ) // Invented values to support what package os expects. const ( S_IFMT = 0x1f000 S_IFIFO = 0x1000 S_IFCHR = 0x2000 S_IFDIR = 0x4000 S_IFBLK = 0x6000 S_IFREG = 0x8000 S_IFLNK = 0xa000 S_IFSOCK = 0xc000 S_ISUID = 0x800 S_ISGID = 0x400 S_ISVTX = 0x200 S_IRUSR = 0x100 S_IWRITE = 0x80 S_IWUSR = 0x80 S_IXUSR = 0x40 ) const ( FILE_TYPE_CHAR = 0x0002 FILE_TYPE_DISK = 0x0001 FILE_TYPE_PIPE = 0x0003 FILE_TYPE_REMOTE = 0x8000 FILE_TYPE_UNKNOWN = 0x0000 ) type Hostent struct { Name *byte Aliases **byte AddrType uint16 Length uint16 AddrList **byte } type Protoent struct { Name *byte Aliases **byte Proto uint16 } const ( DNS_TYPE_A = 0x0001 DNS_TYPE_NS = 0x0002 DNS_TYPE_MD = 0x0003 DNS_TYPE_MF = 0x0004 DNS_TYPE_CNAME = 0x0005 DNS_TYPE_SOA = 0x0006 DNS_TYPE_MB = 0x0007 DNS_TYPE_MG = 0x0008 DNS_TYPE_MR = 0x0009 DNS_TYPE_NULL = 0x000a DNS_TYPE_WKS = 0x000b DNS_TYPE_PTR = 0x000c DNS_TYPE_HINFO = 0x000d DNS_TYPE_MINFO = 0x000e DNS_TYPE_MX = 0x000f DNS_TYPE_TEXT = 0x0010 DNS_TYPE_RP = 0x0011 DNS_TYPE_AFSDB = 0x0012 DNS_TYPE_X25 = 0x0013 DNS_TYPE_ISDN = 0x0014 DNS_TYPE_RT = 0x0015 DNS_TYPE_NSAP = 0x0016 DNS_TYPE_NSAPPTR = 0x0017 DNS_TYPE_SIG = 0x0018 DNS_TYPE_KEY = 0x0019 DNS_TYPE_PX = 0x001a DNS_TYPE_GPOS = 0x001b DNS_TYPE_AAAA = 0x001c DNS_TYPE_LOC = 0x001d DNS_TYPE_NXT = 0x001e DNS_TYPE_EID = 0x001f DNS_TYPE_NIMLOC = 0x0020 DNS_TYPE_SRV = 0x0021 DNS_TYPE_ATMA = 0x0022 DNS_TYPE_NAPTR = 0x0023 DNS_TYPE_KX = 0x0024 DNS_TYPE_CERT = 0x0025 DNS_TYPE_A6 = 0x0026 DNS_TYPE_DNAME = 0x0027 DNS_TYPE_SINK = 0x0028 DNS_TYPE_OPT = 0x0029 DNS_TYPE_DS = 0x002B DNS_TYPE_RRSIG = 0x002E DNS_TYPE_NSEC = 0x002F DNS_TYPE_DNSKEY = 0x0030 DNS_TYPE_DHCID = 0x0031 DNS_TYPE_UINFO = 0x0064 DNS_TYPE_UID = 0x0065 DNS_TYPE_GID = 0x0066 DNS_TYPE_UNSPEC = 0x0067 DNS_TYPE_ADDRS = 0x00f8 DNS_TYPE_TKEY = 0x00f9 DNS_TYPE_TSIG = 0x00fa DNS_TYPE_IXFR = 0x00fb DNS_TYPE_AXFR = 0x00fc DNS_TYPE_MAILB = 0x00fd DNS_TYPE_MAILA = 0x00fe DNS_TYPE_ALL = 0x00ff DNS_TYPE_ANY = 0x00ff DNS_TYPE_WINS = 0xff01 DNS_TYPE_WINSR = 0xff02 DNS_TYPE_NBSTAT = 0xff01 ) const ( // flags inside DNSRecord.Dw DnsSectionQuestion = 0x0000 DnsSectionAnswer = 0x0001 DnsSectionAuthority = 0x0002 DnsSectionAdditional = 0x0003 ) const ( // flags of WSALookupService LUP_DEEP = 0x0001 LUP_CONTAINERS = 0x0002 LUP_NOCONTAINERS = 0x0004 LUP_NEAREST = 0x0008 LUP_RETURN_NAME = 0x0010 LUP_RETURN_TYPE = 0x0020 LUP_RETURN_VERSION = 0x0040 LUP_RETURN_COMMENT = 0x0080 LUP_RETURN_ADDR = 0x0100 LUP_RETURN_BLOB = 0x0200 LUP_RETURN_ALIASES = 0x0400 LUP_RETURN_QUERY_STRING = 0x0800 LUP_RETURN_ALL = 0x0FF0 LUP_RES_SERVICE = 0x8000 LUP_FLUSHCACHE = 0x1000 LUP_FLUSHPREVIOUS = 0x2000 LUP_NON_AUTHORITATIVE = 0x4000 LUP_SECURE = 0x8000 LUP_RETURN_PREFERRED_NAMES = 0x10000 LUP_DNS_ONLY = 0x20000 LUP_ADDRCONFIG = 0x100000 LUP_DUAL_ADDR = 0x200000 LUP_FILESERVER = 0x400000 LUP_DISABLE_IDN_ENCODING = 0x00800000 LUP_API_ANSI = 0x01000000 LUP_RESOLUTION_HANDLE = 0x80000000 ) const ( // values of WSAQUERYSET's namespace NS_ALL = 0 NS_DNS = 12 NS_NLA = 15 NS_BTH = 16 NS_EMAIL = 37 NS_PNRPNAME = 38 NS_PNRPCLOUD = 39 ) type DNSSRVData struct { Target *uint16 Priority uint16 Weight uint16 Port uint16 Pad uint16 } type DNSPTRData struct { Host *uint16 } type DNSMXData struct { NameExchange *uint16 Preference uint16 Pad uint16 } type DNSTXTData struct { StringCount uint16 StringArray [1]*uint16 } type DNSRecord struct { Next *DNSRecord Name *uint16 Type uint16 Length uint16 Dw uint32 Ttl uint32 Reserved uint32 Data [40]byte } const ( TF_DISCONNECT = 1 TF_REUSE_SOCKET = 2 TF_WRITE_BEHIND = 4 TF_USE_DEFAULT_WORKER = 0 TF_USE_SYSTEM_THREAD = 16 TF_USE_KERNEL_APC = 32 ) type TransmitFileBuffers struct { Head uintptr HeadLength uint32 Tail uintptr TailLength uint32 } const ( IFF_UP = 1 IFF_BROADCAST = 2 IFF_LOOPBACK = 4 IFF_POINTTOPOINT = 8 IFF_MULTICAST = 16 ) const SIO_GET_INTERFACE_LIST = 0x4004747F // TODO(mattn): SockaddrGen is union of sockaddr/sockaddr_in/sockaddr_in6_old. // will be fixed to change variable type as suitable. type SockaddrGen [24]byte type InterfaceInfo struct { Flags uint32 Address SockaddrGen BroadcastAddress SockaddrGen Netmask SockaddrGen } type IpAddressString struct { String [16]byte } type IpMaskString IpAddressString type IpAddrString struct { Next *IpAddrString IpAddress IpAddressString IpMask IpMaskString Context uint32 } const MAX_ADAPTER_NAME_LENGTH = 256 const MAX_ADAPTER_DESCRIPTION_LENGTH = 128 const MAX_ADAPTER_ADDRESS_LENGTH = 8 type IpAdapterInfo struct { Next *IpAdapterInfo ComboIndex uint32 AdapterName [MAX_ADAPTER_NAME_LENGTH + 4]byte Description [MAX_ADAPTER_DESCRIPTION_LENGTH + 4]byte AddressLength uint32 Address [MAX_ADAPTER_ADDRESS_LENGTH]byte Index uint32 Type uint32 DhcpEnabled uint32 CurrentIpAddress *IpAddrString IpAddressList IpAddrString GatewayList IpAddrString DhcpServer IpAddrString HaveWins bool PrimaryWinsServer IpAddrString SecondaryWinsServer IpAddrString LeaseObtained int64 LeaseExpires int64 } const MAXLEN_PHYSADDR = 8 const MAX_INTERFACE_NAME_LEN = 256 const MAXLEN_IFDESCR = 256 type MibIfRow struct { Name [MAX_INTERFACE_NAME_LEN]uint16 Index uint32 Type uint32 Mtu uint32 Speed uint32 PhysAddrLen uint32 PhysAddr [MAXLEN_PHYSADDR]byte AdminStatus uint32 OperStatus uint32 LastChange uint32 InOctets uint32 InUcastPkts uint32 InNUcastPkts uint32 InDiscards uint32 InErrors uint32 InUnknownProtos uint32 OutOctets uint32 OutUcastPkts uint32 OutNUcastPkts uint32 OutDiscards uint32 OutErrors uint32 OutQLen uint32 DescrLen uint32 Descr [MAXLEN_IFDESCR]byte } type CertInfo struct { Version uint32 SerialNumber CryptIntegerBlob SignatureAlgorithm CryptAlgorithmIdentifier Issuer CertNameBlob NotBefore Filetime NotAfter Filetime Subject CertNameBlob SubjectPublicKeyInfo CertPublicKeyInfo IssuerUniqueId CryptBitBlob SubjectUniqueId CryptBitBlob CountExtensions uint32 Extensions *CertExtension } type CertExtension struct { ObjId *byte Critical int32 Value CryptObjidBlob } type CryptAlgorithmIdentifier struct { ObjId *byte Parameters CryptObjidBlob } type CertPublicKeyInfo struct { Algorithm CryptAlgorithmIdentifier PublicKey CryptBitBlob } type DataBlob struct { Size uint32 Data *byte } type CryptIntegerBlob DataBlob type CryptUintBlob DataBlob type CryptObjidBlob DataBlob type CertNameBlob DataBlob type CertRdnValueBlob DataBlob type CertBlob DataBlob type CrlBlob DataBlob type CryptDataBlob DataBlob type CryptHashBlob DataBlob type CryptDigestBlob DataBlob type CryptDerBlob DataBlob type CryptAttrBlob DataBlob type CryptBitBlob struct { Size uint32 Data *byte UnusedBits uint32 } type CertContext struct { EncodingType uint32 EncodedCert *byte Length uint32 CertInfo *CertInfo Store Handle } type CertChainContext struct { Size uint32 TrustStatus CertTrustStatus ChainCount uint32 Chains **CertSimpleChain LowerQualityChainCount uint32 LowerQualityChains **CertChainContext HasRevocationFreshnessTime uint32 RevocationFreshnessTime uint32 } type CertTrustListInfo struct { // Not implemented } type CertSimpleChain struct { Size uint32 TrustStatus CertTrustStatus NumElements uint32 Elements **CertChainElement TrustListInfo *CertTrustListInfo HasRevocationFreshnessTime uint32 RevocationFreshnessTime uint32 } type CertChainElement struct { Size uint32 CertContext *CertContext TrustStatus CertTrustStatus RevocationInfo *CertRevocationInfo IssuanceUsage *CertEnhKeyUsage ApplicationUsage *CertEnhKeyUsage ExtendedErrorInfo *uint16 } type CertRevocationCrlInfo struct { // Not implemented } type CertRevocationInfo struct { Size uint32 RevocationResult uint32 RevocationOid *byte OidSpecificInfo Pointer HasFreshnessTime uint32 FreshnessTime uint32 CrlInfo *CertRevocationCrlInfo } type CertTrustStatus struct { ErrorStatus uint32 InfoStatus uint32 } type CertUsageMatch struct { Type uint32 Usage CertEnhKeyUsage } type CertEnhKeyUsage struct { Length uint32 UsageIdentifiers **byte } type CertChainPara struct { Size uint32 RequestedUsage CertUsageMatch RequstedIssuancePolicy CertUsageMatch URLRetrievalTimeout uint32 CheckRevocationFreshnessTime uint32 RevocationFreshnessTime uint32 CacheResync *Filetime } type CertChainPolicyPara struct { Size uint32 Flags uint32 ExtraPolicyPara Pointer } type SSLExtraCertChainPolicyPara struct { Size uint32 AuthType uint32 Checks uint32 ServerName *uint16 } type CertChainPolicyStatus struct { Size uint32 Error uint32 ChainIndex uint32 ElementIndex uint32 ExtraPolicyStatus Pointer } type CertPolicyInfo struct { Identifier *byte CountQualifiers uint32 Qualifiers *CertPolicyQualifierInfo } type CertPoliciesInfo struct { Count uint32 PolicyInfos *CertPolicyInfo } type CertPolicyQualifierInfo struct { // Not implemented } type CertStrongSignPara struct { Size uint32 InfoChoice uint32 InfoOrSerializedInfoOrOID unsafe.Pointer } type CryptProtectPromptStruct struct { Size uint32 PromptFlags uint32 App HWND Prompt *uint16 } type CertChainFindByIssuerPara struct { Size uint32 UsageIdentifier *byte KeySpec uint32 AcquirePrivateKeyFlags uint32 IssuerCount uint32 Issuer Pointer FindCallback Pointer FindArg Pointer IssuerChainIndex *uint32 IssuerElementIndex *uint32 } type WinTrustData struct { Size uint32 PolicyCallbackData uintptr SIPClientData uintptr UIChoice uint32 RevocationChecks uint32 UnionChoice uint32 FileOrCatalogOrBlobOrSgnrOrCert unsafe.Pointer StateAction uint32 StateData Handle URLReference *uint16 ProvFlags uint32 UIContext uint32 SignatureSettings *WinTrustSignatureSettings } type WinTrustFileInfo struct { Size uint32 FilePath *uint16 File Handle KnownSubject *GUID } type WinTrustSignatureSettings struct { Size uint32 Index uint32 Flags uint32 SecondarySigs uint32 VerifiedSigIndex uint32 CryptoPolicy *CertStrongSignPara } const ( // do not reorder HKEY_CLASSES_ROOT = 0x80000000 + iota HKEY_CURRENT_USER HKEY_LOCAL_MACHINE HKEY_USERS HKEY_PERFORMANCE_DATA HKEY_CURRENT_CONFIG HKEY_DYN_DATA KEY_QUERY_VALUE = 1 KEY_SET_VALUE = 2 KEY_CREATE_SUB_KEY = 4 KEY_ENUMERATE_SUB_KEYS = 8 KEY_NOTIFY = 16 KEY_CREATE_LINK = 32 KEY_WRITE = 0x20006 KEY_EXECUTE = 0x20019 KEY_READ = 0x20019 KEY_WOW64_64KEY = 0x0100 KEY_WOW64_32KEY = 0x0200 KEY_ALL_ACCESS = 0xf003f ) const ( // do not reorder REG_NONE = iota REG_SZ REG_EXPAND_SZ REG_BINARY REG_DWORD_LITTLE_ENDIAN REG_DWORD_BIG_ENDIAN REG_LINK REG_MULTI_SZ REG_RESOURCE_LIST REG_FULL_RESOURCE_DESCRIPTOR REG_RESOURCE_REQUIREMENTS_LIST REG_QWORD_LITTLE_ENDIAN REG_DWORD = REG_DWORD_LITTLE_ENDIAN REG_QWORD = REG_QWORD_LITTLE_ENDIAN ) const ( EVENT_MODIFY_STATE = 0x0002 EVENT_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3 MUTANT_QUERY_STATE = 0x0001 MUTANT_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | MUTANT_QUERY_STATE SEMAPHORE_MODIFY_STATE = 0x0002 SEMAPHORE_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3 TIMER_QUERY_STATE = 0x0001 TIMER_MODIFY_STATE = 0x0002 TIMER_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | TIMER_QUERY_STATE | TIMER_MODIFY_STATE MUTEX_MODIFY_STATE = MUTANT_QUERY_STATE MUTEX_ALL_ACCESS = MUTANT_ALL_ACCESS CREATE_EVENT_MANUAL_RESET = 0x1 CREATE_EVENT_INITIAL_SET = 0x2 CREATE_MUTEX_INITIAL_OWNER = 0x1 ) type AddrinfoW struct { Flags int32 Family int32 Socktype int32 Protocol int32 Addrlen uintptr Canonname *uint16 Addr uintptr Next *AddrinfoW } const ( AI_PASSIVE = 1 AI_CANONNAME = 2 AI_NUMERICHOST = 4 ) type GUID struct { Data1 uint32 Data2 uint16 Data3 uint16 Data4 [8]byte } var WSAID_CONNECTEX = GUID{ 0x25a207b9, 0xddf3, 0x4660, [8]byte{0x8e, 0xe9, 0x76, 0xe5, 0x8c, 0x74, 0x06, 0x3e}, } var WSAID_WSASENDMSG = GUID{ 0xa441e712, 0x754f, 0x43ca, [8]byte{0x84, 0xa7, 0x0d, 0xee, 0x44, 0xcf, 0x60, 0x6d}, } var WSAID_WSARECVMSG = GUID{ 0xf689d7c8, 0x6f1f, 0x436b, [8]byte{0x8a, 0x53, 0xe5, 0x4f, 0xe3, 0x51, 0xc3, 0x22}, } const ( FILE_SKIP_COMPLETION_PORT_ON_SUCCESS = 1 FILE_SKIP_SET_EVENT_ON_HANDLE = 2 ) const ( WSAPROTOCOL_LEN = 255 MAX_PROTOCOL_CHAIN = 7 BASE_PROTOCOL = 1 LAYERED_PROTOCOL = 0 XP1_CONNECTIONLESS = 0x00000001 XP1_GUARANTEED_DELIVERY = 0x00000002 XP1_GUARANTEED_ORDER = 0x00000004 XP1_MESSAGE_ORIENTED = 0x00000008 XP1_PSEUDO_STREAM = 0x00000010 XP1_GRACEFUL_CLOSE = 0x00000020 XP1_EXPEDITED_DATA = 0x00000040 XP1_CONNECT_DATA = 0x00000080 XP1_DISCONNECT_DATA = 0x00000100 XP1_SUPPORT_BROADCAST = 0x00000200 XP1_SUPPORT_MULTIPOINT = 0x00000400 XP1_MULTIPOINT_CONTROL_PLANE = 0x00000800 XP1_MULTIPOINT_DATA_PLANE = 0x00001000 XP1_QOS_SUPPORTED = 0x00002000 XP1_UNI_SEND = 0x00008000 XP1_UNI_RECV = 0x00010000 XP1_IFS_HANDLES = 0x00020000 XP1_PARTIAL_MESSAGE = 0x00040000 XP1_SAN_SUPPORT_SDP = 0x00080000 PFL_MULTIPLE_PROTO_ENTRIES = 0x00000001 PFL_RECOMMENDED_PROTO_ENTRY = 0x00000002 PFL_HIDDEN = 0x00000004 PFL_MATCHES_PROTOCOL_ZERO = 0x00000008 PFL_NETWORKDIRECT_PROVIDER = 0x00000010 ) type WSAProtocolInfo struct { ServiceFlags1 uint32 ServiceFlags2 uint32 ServiceFlags3 uint32 ServiceFlags4 uint32 ProviderFlags uint32 ProviderId GUID CatalogEntryId uint32 ProtocolChain WSAProtocolChain Version int32 AddressFamily int32 MaxSockAddr int32 MinSockAddr int32 SocketType int32 Protocol int32 ProtocolMaxOffset int32 NetworkByteOrder int32 SecurityScheme int32 MessageSize uint32 ProviderReserved uint32 ProtocolName [WSAPROTOCOL_LEN + 1]uint16 } type WSAProtocolChain struct { ChainLen int32 ChainEntries [MAX_PROTOCOL_CHAIN]uint32 } type TCPKeepalive struct { OnOff uint32 Time uint32 Interval uint32 } type symbolicLinkReparseBuffer struct { SubstituteNameOffset uint16 SubstituteNameLength uint16 PrintNameOffset uint16 PrintNameLength uint16 Flags uint32 PathBuffer [1]uint16 } type mountPointReparseBuffer struct { SubstituteNameOffset uint16 SubstituteNameLength uint16 PrintNameOffset uint16 PrintNameLength uint16 PathBuffer [1]uint16 } type reparseDataBuffer struct { ReparseTag uint32 ReparseDataLength uint16 Reserved uint16 // GenericReparseBuffer reparseBuffer byte } const ( FSCTL_CREATE_OR_GET_OBJECT_ID = 0x0900C0 FSCTL_DELETE_OBJECT_ID = 0x0900A0 FSCTL_DELETE_REPARSE_POINT = 0x0900AC FSCTL_DUPLICATE_EXTENTS_TO_FILE = 0x098344 FSCTL_DUPLICATE_EXTENTS_TO_FILE_EX = 0x0983E8 FSCTL_FILESYSTEM_GET_STATISTICS = 0x090060 FSCTL_FILE_LEVEL_TRIM = 0x098208 FSCTL_FIND_FILES_BY_SID = 0x09008F FSCTL_GET_COMPRESSION = 0x09003C FSCTL_GET_INTEGRITY_INFORMATION = 0x09027C FSCTL_GET_NTFS_VOLUME_DATA = 0x090064 FSCTL_GET_REFS_VOLUME_DATA = 0x0902D8 FSCTL_GET_OBJECT_ID = 0x09009C FSCTL_GET_REPARSE_POINT = 0x0900A8 FSCTL_GET_RETRIEVAL_POINTER_COUNT = 0x09042B FSCTL_GET_RETRIEVAL_POINTERS = 0x090073 FSCTL_GET_RETRIEVAL_POINTERS_AND_REFCOUNT = 0x0903D3 FSCTL_IS_PATHNAME_VALID = 0x09002C FSCTL_LMR_SET_LINK_TRACKING_INFORMATION = 0x1400EC FSCTL_MARK_HANDLE = 0x0900FC FSCTL_OFFLOAD_READ = 0x094264 FSCTL_OFFLOAD_WRITE = 0x098268 FSCTL_PIPE_PEEK = 0x11400C FSCTL_PIPE_TRANSCEIVE = 0x11C017 FSCTL_PIPE_WAIT = 0x110018 FSCTL_QUERY_ALLOCATED_RANGES = 0x0940CF FSCTL_QUERY_FAT_BPB = 0x090058 FSCTL_QUERY_FILE_REGIONS = 0x090284 FSCTL_QUERY_ON_DISK_VOLUME_INFO = 0x09013C FSCTL_QUERY_SPARING_INFO = 0x090138 FSCTL_READ_FILE_USN_DATA = 0x0900EB FSCTL_RECALL_FILE = 0x090117 FSCTL_REFS_STREAM_SNAPSHOT_MANAGEMENT = 0x090440 FSCTL_SET_COMPRESSION = 0x09C040 FSCTL_SET_DEFECT_MANAGEMENT = 0x098134 FSCTL_SET_ENCRYPTION = 0x0900D7 FSCTL_SET_INTEGRITY_INFORMATION = 0x09C280 FSCTL_SET_INTEGRITY_INFORMATION_EX = 0x090380 FSCTL_SET_OBJECT_ID = 0x090098 FSCTL_SET_OBJECT_ID_EXTENDED = 0x0900BC FSCTL_SET_REPARSE_POINT = 0x0900A4 FSCTL_SET_SPARSE = 0x0900C4 FSCTL_SET_ZERO_DATA = 0x0980C8 FSCTL_SET_ZERO_ON_DEALLOCATION = 0x090194 FSCTL_SIS_COPYFILE = 0x090100 FSCTL_WRITE_USN_CLOSE_RECORD = 0x0900EF MAXIMUM_REPARSE_DATA_BUFFER_SIZE = 16 * 1024 IO_REPARSE_TAG_MOUNT_POINT = 0xA0000003 IO_REPARSE_TAG_SYMLINK = 0xA000000C SYMBOLIC_LINK_FLAG_DIRECTORY = 0x1 ) // FILE_ZERO_DATA_INFORMATION from winioctl.h type FileZeroDataInformation struct { FileOffset int64 BeyondFinalZero int64 } const ( ComputerNameNetBIOS = 0 ComputerNameDnsHostname = 1 ComputerNameDnsDomain = 2 ComputerNameDnsFullyQualified = 3 ComputerNamePhysicalNetBIOS = 4 ComputerNamePhysicalDnsHostname = 5 ComputerNamePhysicalDnsDomain = 6 ComputerNamePhysicalDnsFullyQualified = 7 ComputerNameMax = 8 ) // For MessageBox() const ( MB_OK = 0x00000000 MB_OKCANCEL = 0x00000001 MB_ABORTRETRYIGNORE = 0x00000002 MB_YESNOCANCEL = 0x00000003 MB_YESNO = 0x00000004 MB_RETRYCANCEL = 0x00000005 MB_CANCELTRYCONTINUE = 0x00000006 MB_ICONHAND = 0x00000010 MB_ICONQUESTION = 0x00000020 MB_ICONEXCLAMATION = 0x00000030 MB_ICONASTERISK = 0x00000040 MB_USERICON = 0x00000080 MB_ICONWARNING = MB_ICONEXCLAMATION MB_ICONERROR = MB_ICONHAND MB_ICONINFORMATION = MB_ICONASTERISK MB_ICONSTOP = MB_ICONHAND MB_DEFBUTTON1 = 0x00000000 MB_DEFBUTTON2 = 0x00000100 MB_DEFBUTTON3 = 0x00000200 MB_DEFBUTTON4 = 0x00000300 MB_APPLMODAL = 0x00000000 MB_SYSTEMMODAL = 0x00001000 MB_TASKMODAL = 0x00002000 MB_HELP = 0x00004000 MB_NOFOCUS = 0x00008000 MB_SETFOREGROUND = 0x00010000 MB_DEFAULT_DESKTOP_ONLY = 0x00020000 MB_TOPMOST = 0x00040000 MB_RIGHT = 0x00080000 MB_RTLREADING = 0x00100000 MB_SERVICE_NOTIFICATION = 0x00200000 ) const ( MOVEFILE_REPLACE_EXISTING = 0x1 MOVEFILE_COPY_ALLOWED = 0x2 MOVEFILE_DELAY_UNTIL_REBOOT = 0x4 MOVEFILE_WRITE_THROUGH = 0x8 MOVEFILE_CREATE_HARDLINK = 0x10 MOVEFILE_FAIL_IF_NOT_TRACKABLE = 0x20 ) // Flags for GetAdaptersAddresses, see // https://learn.microsoft.com/en-us/windows/win32/api/iphlpapi/nf-iphlpapi-getadaptersaddresses. const ( GAA_FLAG_SKIP_UNICAST = 0x1 GAA_FLAG_SKIP_ANYCAST = 0x2 GAA_FLAG_SKIP_MULTICAST = 0x4 GAA_FLAG_SKIP_DNS_SERVER = 0x8 GAA_FLAG_INCLUDE_PREFIX = 0x10 GAA_FLAG_SKIP_FRIENDLY_NAME = 0x20 GAA_FLAG_INCLUDE_WINS_INFO = 0x40 GAA_FLAG_INCLUDE_GATEWAYS = 0x80 GAA_FLAG_INCLUDE_ALL_INTERFACES = 0x100 GAA_FLAG_INCLUDE_ALL_COMPARTMENTS = 0x200 GAA_FLAG_INCLUDE_TUNNEL_BINDINGORDER = 0x400 ) const ( IF_TYPE_OTHER = 1 IF_TYPE_ETHERNET_CSMACD = 6 IF_TYPE_ISO88025_TOKENRING = 9 IF_TYPE_PPP = 23 IF_TYPE_SOFTWARE_LOOPBACK = 24 IF_TYPE_ATM = 37 IF_TYPE_IEEE80211 = 71 IF_TYPE_TUNNEL = 131 IF_TYPE_IEEE1394 = 144 ) // Enum NL_PREFIX_ORIGIN for [IpAdapterUnicastAddress], see // https://learn.microsoft.com/en-us/windows/win32/api/nldef/ne-nldef-nl_prefix_origin const ( IpPrefixOriginOther = 0 IpPrefixOriginManual = 1 IpPrefixOriginWellKnown = 2 IpPrefixOriginDhcp = 3 IpPrefixOriginRouterAdvertisement = 4 IpPrefixOriginUnchanged = 1 << 4 ) // Enum NL_SUFFIX_ORIGIN for [IpAdapterUnicastAddress], see // https://learn.microsoft.com/en-us/windows/win32/api/nldef/ne-nldef-nl_suffix_origin const ( NlsoOther = 0 NlsoManual = 1 NlsoWellKnown = 2 NlsoDhcp = 3 NlsoLinkLayerAddress = 4 NlsoRandom = 5 IpSuffixOriginOther = 0 IpSuffixOriginManual = 1 IpSuffixOriginWellKnown = 2 IpSuffixOriginDhcp = 3 IpSuffixOriginLinkLayerAddress = 4 IpSuffixOriginRandom = 5 IpSuffixOriginUnchanged = 1 << 4 ) // Enum NL_DAD_STATE for [IpAdapterUnicastAddress], see // https://learn.microsoft.com/en-us/windows/win32/api/nldef/ne-nldef-nl_dad_state const ( NldsInvalid = 0 NldsTentative = 1 NldsDuplicate = 2 NldsDeprecated = 3 NldsPreferred = 4 IpDadStateInvalid = 0 IpDadStateTentative = 1 IpDadStateDuplicate = 2 IpDadStateDeprecated = 3 IpDadStatePreferred = 4 ) type SocketAddress struct { Sockaddr *syscall.RawSockaddrAny SockaddrLength int32 } // IP returns an IPv4 or IPv6 address, or nil if the underlying SocketAddress is neither. func (addr *SocketAddress) IP() net.IP { if uintptr(addr.SockaddrLength) >= unsafe.Sizeof(RawSockaddrInet4{}) && addr.Sockaddr.Addr.Family == AF_INET { return (*RawSockaddrInet4)(unsafe.Pointer(addr.Sockaddr)).Addr[:] } else if uintptr(addr.SockaddrLength) >= unsafe.Sizeof(RawSockaddrInet6{}) && addr.Sockaddr.Addr.Family == AF_INET6 { return (*RawSockaddrInet6)(unsafe.Pointer(addr.Sockaddr)).Addr[:] } return nil } type IpAdapterUnicastAddress struct { Length uint32 Flags uint32 Next *IpAdapterUnicastAddress Address SocketAddress PrefixOrigin int32 SuffixOrigin int32 DadState int32 ValidLifetime uint32 PreferredLifetime uint32 LeaseLifetime uint32 OnLinkPrefixLength uint8 } type IpAdapterAnycastAddress struct { Length uint32 Flags uint32 Next *IpAdapterAnycastAddress Address SocketAddress } type IpAdapterMulticastAddress struct { Length uint32 Flags uint32 Next *IpAdapterMulticastAddress Address SocketAddress } type IpAdapterDnsServerAdapter struct { Length uint32 Reserved uint32 Next *IpAdapterDnsServerAdapter Address SocketAddress } type IpAdapterPrefix struct { Length uint32 Flags uint32 Next *IpAdapterPrefix Address SocketAddress PrefixLength uint32 } type IpAdapterAddresses struct { Length uint32 IfIndex uint32 Next *IpAdapterAddresses AdapterName *byte FirstUnicastAddress *IpAdapterUnicastAddress FirstAnycastAddress *IpAdapterAnycastAddress FirstMulticastAddress *IpAdapterMulticastAddress FirstDnsServerAddress *IpAdapterDnsServerAdapter DnsSuffix *uint16 Description *uint16 FriendlyName *uint16 PhysicalAddress [syscall.MAX_ADAPTER_ADDRESS_LENGTH]byte PhysicalAddressLength uint32 Flags uint32 Mtu uint32 IfType uint32 OperStatus uint32 Ipv6IfIndex uint32 ZoneIndices [16]uint32 FirstPrefix *IpAdapterPrefix TransmitLinkSpeed uint64 ReceiveLinkSpeed uint64 FirstWinsServerAddress *IpAdapterWinsServerAddress FirstGatewayAddress *IpAdapterGatewayAddress Ipv4Metric uint32 Ipv6Metric uint32 Luid uint64 Dhcpv4Server SocketAddress CompartmentId uint32 NetworkGuid GUID ConnectionType uint32 TunnelType uint32 Dhcpv6Server SocketAddress Dhcpv6ClientDuid [MAX_DHCPV6_DUID_LENGTH]byte Dhcpv6ClientDuidLength uint32 Dhcpv6Iaid uint32 FirstDnsSuffix *IpAdapterDNSSuffix } type IpAdapterWinsServerAddress struct { Length uint32 Reserved uint32 Next *IpAdapterWinsServerAddress Address SocketAddress } type IpAdapterGatewayAddress struct { Length uint32 Reserved uint32 Next *IpAdapterGatewayAddress Address SocketAddress } type IpAdapterDNSSuffix struct { Next *IpAdapterDNSSuffix String [MAX_DNS_SUFFIX_STRING_LENGTH]uint16 } const ( IfOperStatusUp = 1 IfOperStatusDown = 2 IfOperStatusTesting = 3 IfOperStatusUnknown = 4 IfOperStatusDormant = 5 IfOperStatusNotPresent = 6 IfOperStatusLowerLayerDown = 7 ) const ( IF_MAX_PHYS_ADDRESS_LENGTH = 32 IF_MAX_STRING_SIZE = 256 ) // MIB_IF_ENTRY_LEVEL enumeration from netioapi.h or // https://learn.microsoft.com/en-us/windows/win32/api/netioapi/nf-netioapi-getifentry2ex. const ( MibIfEntryNormal = 0 MibIfEntryNormalWithoutStatistics = 2 ) // MIB_NOTIFICATION_TYPE enumeration from netioapi.h or // https://learn.microsoft.com/en-us/windows/win32/api/netioapi/ne-netioapi-mib_notification_type. const ( MibParameterNotification = 0 MibAddInstance = 1 MibDeleteInstance = 2 MibInitialNotification = 3 ) // MibIfRow2 stores information about a particular interface. See // https://learn.microsoft.com/en-us/windows/win32/api/netioapi/ns-netioapi-mib_if_row2. type MibIfRow2 struct { InterfaceLuid uint64 InterfaceIndex uint32 InterfaceGuid GUID Alias [IF_MAX_STRING_SIZE + 1]uint16 Description [IF_MAX_STRING_SIZE + 1]uint16 PhysicalAddressLength uint32 PhysicalAddress [IF_MAX_PHYS_ADDRESS_LENGTH]uint8 PermanentPhysicalAddress [IF_MAX_PHYS_ADDRESS_LENGTH]uint8 Mtu uint32 Type uint32 TunnelType uint32 MediaType uint32 PhysicalMediumType uint32 AccessType uint32 DirectionType uint32 InterfaceAndOperStatusFlags uint8 OperStatus uint32 AdminStatus uint32 MediaConnectState uint32 NetworkGuid GUID ConnectionType uint32 TransmitLinkSpeed uint64 ReceiveLinkSpeed uint64 InOctets uint64 InUcastPkts uint64 InNUcastPkts uint64 InDiscards uint64 InErrors uint64 InUnknownProtos uint64 InUcastOctets uint64 InMulticastOctets uint64 InBroadcastOctets uint64 OutOctets uint64 OutUcastPkts uint64 OutNUcastPkts uint64 OutDiscards uint64 OutErrors uint64 OutUcastOctets uint64 OutMulticastOctets uint64 OutBroadcastOctets uint64 OutQLen uint64 } // IP_ADDRESS_PREFIX stores an IP address prefix. See // https://learn.microsoft.com/en-us/windows/win32/api/netioapi/ns-netioapi-ip_address_prefix. type IpAddressPrefix struct { Prefix RawSockaddrInet PrefixLength uint8 } // NL_ROUTE_ORIGIN enumeration from nldef.h or // https://learn.microsoft.com/en-us/windows/win32/api/nldef/ne-nldef-nl_route_origin. const ( NlroManual = 0 NlroWellKnown = 1 NlroDHCP = 2 NlroRouterAdvertisement = 3 Nlro6to4 = 4 ) // NL_ROUTE_ORIGIN enumeration from nldef.h or // https://learn.microsoft.com/en-us/windows/win32/api/nldef/ne-nldef-nl_route_protocol. const ( MIB_IPPROTO_OTHER = 1 MIB_IPPROTO_LOCAL = 2 MIB_IPPROTO_NETMGMT = 3 MIB_IPPROTO_ICMP = 4 MIB_IPPROTO_EGP = 5 MIB_IPPROTO_GGP = 6 MIB_IPPROTO_HELLO = 7 MIB_IPPROTO_RIP = 8 MIB_IPPROTO_IS_IS = 9 MIB_IPPROTO_ES_IS = 10 MIB_IPPROTO_CISCO = 11 MIB_IPPROTO_BBN = 12 MIB_IPPROTO_OSPF = 13 MIB_IPPROTO_BGP = 14 MIB_IPPROTO_IDPR = 15 MIB_IPPROTO_EIGRP = 16 MIB_IPPROTO_DVMRP = 17 MIB_IPPROTO_RPL = 18 MIB_IPPROTO_DHCP = 19 MIB_IPPROTO_NT_AUTOSTATIC = 10002 MIB_IPPROTO_NT_STATIC = 10006 MIB_IPPROTO_NT_STATIC_NON_DOD = 10007 ) // MIB_IPFORWARD_ROW2 stores information about an IP route entry. See // https://learn.microsoft.com/en-us/windows/win32/api/netioapi/ns-netioapi-mib_ipforward_row2. type MibIpForwardRow2 struct { InterfaceLuid uint64 InterfaceIndex uint32 DestinationPrefix IpAddressPrefix NextHop RawSockaddrInet SitePrefixLength uint8 ValidLifetime uint32 PreferredLifetime uint32 Metric uint32 Protocol uint32 Loopback uint8 AutoconfigureAddress uint8 Publish uint8 Immortal uint8 Age uint32 Origin uint32 } // MIB_IPFORWARD_TABLE2 contains a table of IP route entries. See // https://learn.microsoft.com/en-us/windows/win32/api/netioapi/ns-netioapi-mib_ipforward_table2. type MibIpForwardTable2 struct { NumEntries uint32 Table [1]MibIpForwardRow2 } // Rows returns the IP route entries in the table. func (t *MibIpForwardTable2) Rows() []MibIpForwardRow2 { return unsafe.Slice(&t.Table[0], t.NumEntries) } // MIB_UNICASTIPADDRESS_ROW stores information about a unicast IP address. See // https://learn.microsoft.com/en-us/windows/win32/api/netioapi/ns-netioapi-mib_unicastipaddress_row. type MibUnicastIpAddressRow struct { Address RawSockaddrInet6 // SOCKADDR_INET union InterfaceLuid uint64 InterfaceIndex uint32 PrefixOrigin uint32 SuffixOrigin uint32 ValidLifetime uint32 PreferredLifetime uint32 OnLinkPrefixLength uint8 SkipAsSource uint8 DadState uint32 ScopeId uint32 CreationTimeStamp Filetime } const ScopeLevelCount = 16 // MIB_IPINTERFACE_ROW stores interface management information for a particular IP address family on a network interface. // See https://learn.microsoft.com/en-us/windows/win32/api/netioapi/ns-netioapi-mib_ipinterface_row. type MibIpInterfaceRow struct { Family uint16 InterfaceLuid uint64 InterfaceIndex uint32 MaxReassemblySize uint32 InterfaceIdentifier uint64 MinRouterAdvertisementInterval uint32 MaxRouterAdvertisementInterval uint32 AdvertisingEnabled uint8 ForwardingEnabled uint8 WeakHostSend uint8 WeakHostReceive uint8 UseAutomaticMetric uint8 UseNeighborUnreachabilityDetection uint8 ManagedAddressConfigurationSupported uint8 OtherStatefulConfigurationSupported uint8 AdvertiseDefaultRoute uint8 RouterDiscoveryBehavior uint32 DadTransmits uint32 BaseReachableTime uint32 RetransmitTime uint32 PathMtuDiscoveryTimeout uint32 LinkLocalAddressBehavior uint32 LinkLocalAddressTimeout uint32 ZoneIndices [ScopeLevelCount]uint32 SitePrefixLength uint32 Metric uint32 NlMtu uint32 Connected uint8 SupportsWakeUpPatterns uint8 SupportsNeighborDiscovery uint8 SupportsRouterDiscovery uint8 ReachableTime uint32 TransmitOffload uint32 ReceiveOffload uint32 DisableDefaultRoutes uint8 } // Console related constants used for the mode parameter to SetConsoleMode. See // https://docs.microsoft.com/en-us/windows/console/setconsolemode for details. const ( ENABLE_PROCESSED_INPUT = 0x1 ENABLE_LINE_INPUT = 0x2 ENABLE_ECHO_INPUT = 0x4 ENABLE_WINDOW_INPUT = 0x8 ENABLE_MOUSE_INPUT = 0x10 ENABLE_INSERT_MODE = 0x20 ENABLE_QUICK_EDIT_MODE = 0x40 ENABLE_EXTENDED_FLAGS = 0x80 ENABLE_AUTO_POSITION = 0x100 ENABLE_VIRTUAL_TERMINAL_INPUT = 0x200 ENABLE_PROCESSED_OUTPUT = 0x1 ENABLE_WRAP_AT_EOL_OUTPUT = 0x2 ENABLE_VIRTUAL_TERMINAL_PROCESSING = 0x4 DISABLE_NEWLINE_AUTO_RETURN = 0x8 ENABLE_LVB_GRID_WORLDWIDE = 0x10 ) // Pseudo console related constants used for the flags parameter to // CreatePseudoConsole. See: https://learn.microsoft.com/en-us/windows/console/createpseudoconsole const ( PSEUDOCONSOLE_INHERIT_CURSOR = 0x1 ) type Coord struct { X int16 Y int16 } type SmallRect struct { Left int16 Top int16 Right int16 Bottom int16 } // Used with GetConsoleScreenBuffer to retrieve information about a console // screen buffer. See // https://docs.microsoft.com/en-us/windows/console/console-screen-buffer-info-str // for details. type ConsoleScreenBufferInfo struct { Size Coord CursorPosition Coord Attributes uint16 Window SmallRect MaximumWindowSize Coord } const UNIX_PATH_MAX = 108 // defined in afunix.h const ( // flags for JOBOBJECT_BASIC_LIMIT_INFORMATION.LimitFlags JOB_OBJECT_LIMIT_ACTIVE_PROCESS = 0x00000008 JOB_OBJECT_LIMIT_AFFINITY = 0x00000010 JOB_OBJECT_LIMIT_BREAKAWAY_OK = 0x00000800 JOB_OBJECT_LIMIT_DIE_ON_UNHANDLED_EXCEPTION = 0x00000400 JOB_OBJECT_LIMIT_JOB_MEMORY = 0x00000200 JOB_OBJECT_LIMIT_JOB_TIME = 0x00000004 JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE = 0x00002000 JOB_OBJECT_LIMIT_PRESERVE_JOB_TIME = 0x00000040 JOB_OBJECT_LIMIT_PRIORITY_CLASS = 0x00000020 JOB_OBJECT_LIMIT_PROCESS_MEMORY = 0x00000100 JOB_OBJECT_LIMIT_PROCESS_TIME = 0x00000002 JOB_OBJECT_LIMIT_SCHEDULING_CLASS = 0x00000080 JOB_OBJECT_LIMIT_SILENT_BREAKAWAY_OK = 0x00001000 JOB_OBJECT_LIMIT_SUBSET_AFFINITY = 0x00004000 JOB_OBJECT_LIMIT_WORKINGSET = 0x00000001 ) type IO_COUNTERS struct { ReadOperationCount uint64 WriteOperationCount uint64 OtherOperationCount uint64 ReadTransferCount uint64 WriteTransferCount uint64 OtherTransferCount uint64 } type JOBOBJECT_EXTENDED_LIMIT_INFORMATION struct { BasicLimitInformation JOBOBJECT_BASIC_LIMIT_INFORMATION IoInfo IO_COUNTERS ProcessMemoryLimit uintptr JobMemoryLimit uintptr PeakProcessMemoryUsed uintptr PeakJobMemoryUsed uintptr } const ( // UIRestrictionsClass JOB_OBJECT_UILIMIT_DESKTOP = 0x00000040 JOB_OBJECT_UILIMIT_DISPLAYSETTINGS = 0x00000010 JOB_OBJECT_UILIMIT_EXITWINDOWS = 0x00000080 JOB_OBJECT_UILIMIT_GLOBALATOMS = 0x00000020 JOB_OBJECT_UILIMIT_HANDLES = 0x00000001 JOB_OBJECT_UILIMIT_READCLIPBOARD = 0x00000002 JOB_OBJECT_UILIMIT_SYSTEMPARAMETERS = 0x00000008 JOB_OBJECT_UILIMIT_WRITECLIPBOARD = 0x00000004 ) type JOBOBJECT_BASIC_UI_RESTRICTIONS struct { UIRestrictionsClass uint32 } const ( // JobObjectInformationClass for QueryInformationJobObject and SetInformationJobObject JobObjectAssociateCompletionPortInformation = 7 JobObjectBasicAccountingInformation = 1 JobObjectBasicAndIoAccountingInformation = 8 JobObjectBasicLimitInformation = 2 JobObjectBasicProcessIdList = 3 JobObjectBasicUIRestrictions = 4 JobObjectCpuRateControlInformation = 15 JobObjectEndOfJobTimeInformation = 6 JobObjectExtendedLimitInformation = 9 JobObjectGroupInformation = 11 JobObjectGroupInformationEx = 14 JobObjectLimitViolationInformation = 13 JobObjectLimitViolationInformation2 = 34 JobObjectNetRateControlInformation = 32 JobObjectNotificationLimitInformation = 12 JobObjectNotificationLimitInformation2 = 33 JobObjectSecurityLimitInformation = 5 ) const ( KF_FLAG_DEFAULT = 0x00000000 KF_FLAG_FORCE_APP_DATA_REDIRECTION = 0x00080000 KF_FLAG_RETURN_FILTER_REDIRECTION_TARGET = 0x00040000 KF_FLAG_FORCE_PACKAGE_REDIRECTION = 0x00020000 KF_FLAG_NO_PACKAGE_REDIRECTION = 0x00010000 KF_FLAG_FORCE_APPCONTAINER_REDIRECTION = 0x00020000 KF_FLAG_NO_APPCONTAINER_REDIRECTION = 0x00010000 KF_FLAG_CREATE = 0x00008000 KF_FLAG_DONT_VERIFY = 0x00004000 KF_FLAG_DONT_UNEXPAND = 0x00002000 KF_FLAG_NO_ALIAS = 0x00001000 KF_FLAG_INIT = 0x00000800 KF_FLAG_DEFAULT_PATH = 0x00000400 KF_FLAG_NOT_PARENT_RELATIVE = 0x00000200 KF_FLAG_SIMPLE_IDLIST = 0x00000100 KF_FLAG_ALIAS_ONLY = 0x80000000 ) type OsVersionInfoEx struct { osVersionInfoSize uint32 MajorVersion uint32 MinorVersion uint32 BuildNumber uint32 PlatformId uint32 CsdVersion [128]uint16 ServicePackMajor uint16 ServicePackMinor uint16 SuiteMask uint16 ProductType byte _ byte } const ( EWX_LOGOFF = 0x00000000 EWX_SHUTDOWN = 0x00000001 EWX_REBOOT = 0x00000002 EWX_FORCE = 0x00000004 EWX_POWEROFF = 0x00000008 EWX_FORCEIFHUNG = 0x00000010 EWX_QUICKRESOLVE = 0x00000020 EWX_RESTARTAPPS = 0x00000040 EWX_HYBRID_SHUTDOWN = 0x00400000 EWX_BOOTOPTIONS = 0x01000000 SHTDN_REASON_FLAG_COMMENT_REQUIRED = 0x01000000 SHTDN_REASON_FLAG_DIRTY_PROBLEM_ID_REQUIRED = 0x02000000 SHTDN_REASON_FLAG_CLEAN_UI = 0x04000000 SHTDN_REASON_FLAG_DIRTY_UI = 0x08000000 SHTDN_REASON_FLAG_USER_DEFINED = 0x40000000 SHTDN_REASON_FLAG_PLANNED = 0x80000000 SHTDN_REASON_MAJOR_OTHER = 0x00000000 SHTDN_REASON_MAJOR_NONE = 0x00000000 SHTDN_REASON_MAJOR_HARDWARE = 0x00010000 SHTDN_REASON_MAJOR_OPERATINGSYSTEM = 0x00020000 SHTDN_REASON_MAJOR_SOFTWARE = 0x00030000 SHTDN_REASON_MAJOR_APPLICATION = 0x00040000 SHTDN_REASON_MAJOR_SYSTEM = 0x00050000 SHTDN_REASON_MAJOR_POWER = 0x00060000 SHTDN_REASON_MAJOR_LEGACY_API = 0x00070000 SHTDN_REASON_MINOR_OTHER = 0x00000000 SHTDN_REASON_MINOR_NONE = 0x000000ff SHTDN_REASON_MINOR_MAINTENANCE = 0x00000001 SHTDN_REASON_MINOR_INSTALLATION = 0x00000002 SHTDN_REASON_MINOR_UPGRADE = 0x00000003 SHTDN_REASON_MINOR_RECONFIG = 0x00000004 SHTDN_REASON_MINOR_HUNG = 0x00000005 SHTDN_REASON_MINOR_UNSTABLE = 0x00000006 SHTDN_REASON_MINOR_DISK = 0x00000007 SHTDN_REASON_MINOR_PROCESSOR = 0x00000008 SHTDN_REASON_MINOR_NETWORKCARD = 0x00000009 SHTDN_REASON_MINOR_POWER_SUPPLY = 0x0000000a SHTDN_REASON_MINOR_CORDUNPLUGGED = 0x0000000b SHTDN_REASON_MINOR_ENVIRONMENT = 0x0000000c SHTDN_REASON_MINOR_HARDWARE_DRIVER = 0x0000000d SHTDN_REASON_MINOR_OTHERDRIVER = 0x0000000e SHTDN_REASON_MINOR_BLUESCREEN = 0x0000000F SHTDN_REASON_MINOR_SERVICEPACK = 0x00000010 SHTDN_REASON_MINOR_HOTFIX = 0x00000011 SHTDN_REASON_MINOR_SECURITYFIX = 0x00000012 SHTDN_REASON_MINOR_SECURITY = 0x00000013 SHTDN_REASON_MINOR_NETWORK_CONNECTIVITY = 0x00000014 SHTDN_REASON_MINOR_WMI = 0x00000015 SHTDN_REASON_MINOR_SERVICEPACK_UNINSTALL = 0x00000016 SHTDN_REASON_MINOR_HOTFIX_UNINSTALL = 0x00000017 SHTDN_REASON_MINOR_SECURITYFIX_UNINSTALL = 0x00000018 SHTDN_REASON_MINOR_MMC = 0x00000019 SHTDN_REASON_MINOR_SYSTEMRESTORE = 0x0000001a SHTDN_REASON_MINOR_TERMSRV = 0x00000020 SHTDN_REASON_MINOR_DC_PROMOTION = 0x00000021 SHTDN_REASON_MINOR_DC_DEMOTION = 0x00000022 SHTDN_REASON_UNKNOWN = SHTDN_REASON_MINOR_NONE SHTDN_REASON_LEGACY_API = SHTDN_REASON_MAJOR_LEGACY_API | SHTDN_REASON_FLAG_PLANNED SHTDN_REASON_VALID_BIT_MASK = 0xc0ffffff SHUTDOWN_NORETRY = 0x1 ) // Flags used for GetModuleHandleEx const ( GET_MODULE_HANDLE_EX_FLAG_PIN = 1 GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT = 2 GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS = 4 ) // MUI function flag values const ( MUI_LANGUAGE_ID = 0x4 MUI_LANGUAGE_NAME = 0x8 MUI_MERGE_SYSTEM_FALLBACK = 0x10 MUI_MERGE_USER_FALLBACK = 0x20 MUI_UI_FALLBACK = MUI_MERGE_SYSTEM_FALLBACK | MUI_MERGE_USER_FALLBACK MUI_THREAD_LANGUAGES = 0x40 MUI_CONSOLE_FILTER = 0x100 MUI_COMPLEX_SCRIPT_FILTER = 0x200 MUI_RESET_FILTERS = 0x001 MUI_USER_PREFERRED_UI_LANGUAGES = 0x10 MUI_USE_INSTALLED_LANGUAGES = 0x20 MUI_USE_SEARCH_ALL_LANGUAGES = 0x40 MUI_LANG_NEUTRAL_PE_FILE = 0x100 MUI_NON_LANG_NEUTRAL_FILE = 0x200 MUI_MACHINE_LANGUAGE_SETTINGS = 0x400 MUI_FILETYPE_NOT_LANGUAGE_NEUTRAL = 0x001 MUI_FILETYPE_LANGUAGE_NEUTRAL_MAIN = 0x002 MUI_FILETYPE_LANGUAGE_NEUTRAL_MUI = 0x004 MUI_QUERY_TYPE = 0x001 MUI_QUERY_CHECKSUM = 0x002 MUI_QUERY_LANGUAGE_NAME = 0x004 MUI_QUERY_RESOURCE_TYPES = 0x008 MUI_FILEINFO_VERSION = 0x001 MUI_FULL_LANGUAGE = 0x01 MUI_PARTIAL_LANGUAGE = 0x02 MUI_LIP_LANGUAGE = 0x04 MUI_LANGUAGE_INSTALLED = 0x20 MUI_LANGUAGE_LICENSED = 0x40 ) // FILE_INFO_BY_HANDLE_CLASS constants for SetFileInformationByHandle/GetFileInformationByHandleEx const ( FileBasicInfo = 0 FileStandardInfo = 1 FileNameInfo = 2 FileRenameInfo = 3 FileDispositionInfo = 4 FileAllocationInfo = 5 FileEndOfFileInfo = 6 FileStreamInfo = 7 FileCompressionInfo = 8 FileAttributeTagInfo = 9 FileIdBothDirectoryInfo = 10 FileIdBothDirectoryRestartInfo = 11 FileIoPriorityHintInfo = 12 FileRemoteProtocolInfo = 13 FileFullDirectoryInfo = 14 FileFullDirectoryRestartInfo = 15 FileStorageInfo = 16 FileAlignmentInfo = 17 FileIdInfo = 18 FileIdExtdDirectoryInfo = 19 FileIdExtdDirectoryRestartInfo = 20 FileDispositionInfoEx = 21 FileRenameInfoEx = 22 FileCaseSensitiveInfo = 23 FileNormalizedNameInfo = 24 ) // LoadLibrary flags for determining from where to search for a DLL const ( DONT_RESOLVE_DLL_REFERENCES = 0x1 LOAD_LIBRARY_AS_DATAFILE = 0x2 LOAD_WITH_ALTERED_SEARCH_PATH = 0x8 LOAD_IGNORE_CODE_AUTHZ_LEVEL = 0x10 LOAD_LIBRARY_AS_IMAGE_RESOURCE = 0x20 LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE = 0x40 LOAD_LIBRARY_REQUIRE_SIGNED_TARGET = 0x80 LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR = 0x100 LOAD_LIBRARY_SEARCH_APPLICATION_DIR = 0x200 LOAD_LIBRARY_SEARCH_USER_DIRS = 0x400 LOAD_LIBRARY_SEARCH_SYSTEM32 = 0x800 LOAD_LIBRARY_SEARCH_DEFAULT_DIRS = 0x1000 LOAD_LIBRARY_SAFE_CURRENT_DIRS = 0x00002000 LOAD_LIBRARY_SEARCH_SYSTEM32_NO_FORWARDER = 0x00004000 LOAD_LIBRARY_OS_INTEGRITY_CONTINUITY = 0x00008000 ) // RegNotifyChangeKeyValue notifyFilter flags. const ( // REG_NOTIFY_CHANGE_NAME notifies the caller if a subkey is added or deleted. REG_NOTIFY_CHANGE_NAME = 0x00000001 // REG_NOTIFY_CHANGE_ATTRIBUTES notifies the caller of changes to the attributes of the key, such as the security descriptor information. REG_NOTIFY_CHANGE_ATTRIBUTES = 0x00000002 // REG_NOTIFY_CHANGE_LAST_SET notifies the caller of changes to a value of the key. This can include adding or deleting a value, or changing an existing value. REG_NOTIFY_CHANGE_LAST_SET = 0x00000004 // REG_NOTIFY_CHANGE_SECURITY notifies the caller of changes to the security descriptor of the key. REG_NOTIFY_CHANGE_SECURITY = 0x00000008 // REG_NOTIFY_THREAD_AGNOSTIC indicates that the lifetime of the registration must not be tied to the lifetime of the thread issuing the RegNotifyChangeKeyValue call. Note: This flag value is only supported in Windows 8 and later. REG_NOTIFY_THREAD_AGNOSTIC = 0x10000000 ) type CommTimeouts struct { ReadIntervalTimeout uint32 ReadTotalTimeoutMultiplier uint32 ReadTotalTimeoutConstant uint32 WriteTotalTimeoutMultiplier uint32 WriteTotalTimeoutConstant uint32 } // NTUnicodeString is a UTF-16 string for NT native APIs, corresponding to UNICODE_STRING. type NTUnicodeString struct { // Note: Length and MaximumLength are in *bytes*, not uint16s. // They should always be even. Length uint16 MaximumLength uint16 Buffer *uint16 } // NTString is an ANSI string for NT native APIs, corresponding to STRING. type NTString struct { Length uint16 MaximumLength uint16 Buffer *byte } type LIST_ENTRY struct { Flink *LIST_ENTRY Blink *LIST_ENTRY } type RUNTIME_FUNCTION struct { BeginAddress uint32 EndAddress uint32 UnwindData uint32 } type LDR_DATA_TABLE_ENTRY struct { reserved1 [2]uintptr InMemoryOrderLinks LIST_ENTRY reserved2 [2]uintptr DllBase uintptr reserved3 [2]uintptr FullDllName NTUnicodeString reserved4 [8]byte reserved5 [3]uintptr reserved6 uintptr TimeDateStamp uint32 } type PEB_LDR_DATA struct { reserved1 [8]byte reserved2 [3]uintptr InMemoryOrderModuleList LIST_ENTRY } type CURDIR struct { DosPath NTUnicodeString Handle Handle } type RTL_DRIVE_LETTER_CURDIR struct { Flags uint16 Length uint16 TimeStamp uint32 DosPath NTString } type RTL_USER_PROCESS_PARAMETERS struct { MaximumLength, Length uint32 Flags, DebugFlags uint32 ConsoleHandle Handle ConsoleFlags uint32 StandardInput, StandardOutput, StandardError Handle CurrentDirectory CURDIR DllPath NTUnicodeString ImagePathName NTUnicodeString CommandLine NTUnicodeString Environment unsafe.Pointer StartingX, StartingY, CountX, CountY, CountCharsX, CountCharsY, FillAttribute uint32 WindowFlags, ShowWindowFlags uint32 WindowTitle, DesktopInfo, ShellInfo, RuntimeData NTUnicodeString CurrentDirectories [32]RTL_DRIVE_LETTER_CURDIR EnvironmentSize, EnvironmentVersion uintptr PackageDependencyData unsafe.Pointer ProcessGroupId uint32 LoaderThreads uint32 RedirectionDllName NTUnicodeString HeapPartitionName NTUnicodeString DefaultThreadpoolCpuSetMasks uintptr DefaultThreadpoolCpuSetMaskCount uint32 } type PEB struct { reserved1 [2]byte BeingDebugged byte BitField byte reserved3 uintptr ImageBaseAddress uintptr Ldr *PEB_LDR_DATA ProcessParameters *RTL_USER_PROCESS_PARAMETERS reserved4 [3]uintptr AtlThunkSListPtr uintptr reserved5 uintptr reserved6 uint32 reserved7 uintptr reserved8 uint32 AtlThunkSListPtr32 uint32 reserved9 [45]uintptr reserved10 [96]byte PostProcessInitRoutine uintptr reserved11 [128]byte reserved12 [1]uintptr SessionId uint32 } type OBJECT_ATTRIBUTES struct { Length uint32 RootDirectory Handle ObjectName *NTUnicodeString Attributes uint32 SecurityDescriptor *SECURITY_DESCRIPTOR SecurityQoS *SECURITY_QUALITY_OF_SERVICE } // Values for the Attributes member of OBJECT_ATTRIBUTES. const ( OBJ_INHERIT = 0x00000002 OBJ_PERMANENT = 0x00000010 OBJ_EXCLUSIVE = 0x00000020 OBJ_CASE_INSENSITIVE = 0x00000040 OBJ_OPENIF = 0x00000080 OBJ_OPENLINK = 0x00000100 OBJ_KERNEL_HANDLE = 0x00000200 OBJ_FORCE_ACCESS_CHECK = 0x00000400 OBJ_IGNORE_IMPERSONATED_DEVICEMAP = 0x00000800 OBJ_DONT_REPARSE = 0x00001000 OBJ_VALID_ATTRIBUTES = 0x00001FF2 ) type IO_STATUS_BLOCK struct { Status NTStatus Information uintptr } type RTLP_CURDIR_REF struct { RefCount int32 Handle Handle } type RTL_RELATIVE_NAME struct { RelativeName NTUnicodeString ContainingDirectory Handle CurDirRef *RTLP_CURDIR_REF } const ( // CreateDisposition flags for NtCreateFile and NtCreateNamedPipeFile. FILE_SUPERSEDE = 0x00000000 FILE_OPEN = 0x00000001 FILE_CREATE = 0x00000002 FILE_OPEN_IF = 0x00000003 FILE_OVERWRITE = 0x00000004 FILE_OVERWRITE_IF = 0x00000005 FILE_MAXIMUM_DISPOSITION = 0x00000005 // CreateOptions flags for NtCreateFile and NtCreateNamedPipeFile. FILE_DIRECTORY_FILE = 0x00000001 FILE_WRITE_THROUGH = 0x00000002 FILE_SEQUENTIAL_ONLY = 0x00000004 FILE_NO_INTERMEDIATE_BUFFERING = 0x00000008 FILE_SYNCHRONOUS_IO_ALERT = 0x00000010 FILE_SYNCHRONOUS_IO_NONALERT = 0x00000020 FILE_NON_DIRECTORY_FILE = 0x00000040 FILE_CREATE_TREE_CONNECTION = 0x00000080 FILE_COMPLETE_IF_OPLOCKED = 0x00000100 FILE_NO_EA_KNOWLEDGE = 0x00000200 FILE_OPEN_REMOTE_INSTANCE = 0x00000400 FILE_RANDOM_ACCESS = 0x00000800 FILE_DELETE_ON_CLOSE = 0x00001000 FILE_OPEN_BY_FILE_ID = 0x00002000 FILE_OPEN_FOR_BACKUP_INTENT = 0x00004000 FILE_NO_COMPRESSION = 0x00008000 FILE_OPEN_REQUIRING_OPLOCK = 0x00010000 FILE_DISALLOW_EXCLUSIVE = 0x00020000 FILE_RESERVE_OPFILTER = 0x00100000 FILE_OPEN_REPARSE_POINT = 0x00200000 FILE_OPEN_NO_RECALL = 0x00400000 FILE_OPEN_FOR_FREE_SPACE_QUERY = 0x00800000 // Parameter constants for NtCreateNamedPipeFile. FILE_PIPE_BYTE_STREAM_TYPE = 0x00000000 FILE_PIPE_MESSAGE_TYPE = 0x00000001 FILE_PIPE_ACCEPT_REMOTE_CLIENTS = 0x00000000 FILE_PIPE_REJECT_REMOTE_CLIENTS = 0x00000002 FILE_PIPE_TYPE_VALID_MASK = 0x00000003 FILE_PIPE_BYTE_STREAM_MODE = 0x00000000 FILE_PIPE_MESSAGE_MODE = 0x00000001 FILE_PIPE_QUEUE_OPERATION = 0x00000000 FILE_PIPE_COMPLETE_OPERATION = 0x00000001 FILE_PIPE_INBOUND = 0x00000000 FILE_PIPE_OUTBOUND = 0x00000001 FILE_PIPE_FULL_DUPLEX = 0x00000002 FILE_PIPE_DISCONNECTED_STATE = 0x00000001 FILE_PIPE_LISTENING_STATE = 0x00000002 FILE_PIPE_CONNECTED_STATE = 0x00000003 FILE_PIPE_CLOSING_STATE = 0x00000004 FILE_PIPE_CLIENT_END = 0x00000000 FILE_PIPE_SERVER_END = 0x00000001 ) const ( // FileInformationClass for NtSetInformationFile FileBasicInformation = 4 FileRenameInformation = 10 FileDispositionInformation = 13 FilePositionInformation = 14 FileEndOfFileInformation = 20 FileValidDataLengthInformation = 39 FileShortNameInformation = 40 FileIoPriorityHintInformation = 43 FileReplaceCompletionInformation = 61 FileDispositionInformationEx = 64 FileCaseSensitiveInformation = 71 FileLinkInformation = 72 FileCaseSensitiveInformationForceAccessCheck = 75 FileKnownFolderInformation = 76 // Flags for FILE_RENAME_INFORMATION FILE_RENAME_REPLACE_IF_EXISTS = 0x00000001 FILE_RENAME_POSIX_SEMANTICS = 0x00000002 FILE_RENAME_SUPPRESS_PIN_STATE_INHERITANCE = 0x00000004 FILE_RENAME_SUPPRESS_STORAGE_RESERVE_INHERITANCE = 0x00000008 FILE_RENAME_NO_INCREASE_AVAILABLE_SPACE = 0x00000010 FILE_RENAME_NO_DECREASE_AVAILABLE_SPACE = 0x00000020 FILE_RENAME_PRESERVE_AVAILABLE_SPACE = 0x00000030 FILE_RENAME_IGNORE_READONLY_ATTRIBUTE = 0x00000040 FILE_RENAME_FORCE_RESIZE_TARGET_SR = 0x00000080 FILE_RENAME_FORCE_RESIZE_SOURCE_SR = 0x00000100 FILE_RENAME_FORCE_RESIZE_SR = 0x00000180 // Flags for FILE_DISPOSITION_INFORMATION_EX FILE_DISPOSITION_DO_NOT_DELETE = 0x00000000 FILE_DISPOSITION_DELETE = 0x00000001 FILE_DISPOSITION_POSIX_SEMANTICS = 0x00000002 FILE_DISPOSITION_FORCE_IMAGE_SECTION_CHECK = 0x00000004 FILE_DISPOSITION_ON_CLOSE = 0x00000008 FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE = 0x00000010 // Flags for FILE_CASE_SENSITIVE_INFORMATION FILE_CS_FLAG_CASE_SENSITIVE_DIR = 0x00000001 // Flags for FILE_LINK_INFORMATION FILE_LINK_REPLACE_IF_EXISTS = 0x00000001 FILE_LINK_POSIX_SEMANTICS = 0x00000002 FILE_LINK_SUPPRESS_STORAGE_RESERVE_INHERITANCE = 0x00000008 FILE_LINK_NO_INCREASE_AVAILABLE_SPACE = 0x00000010 FILE_LINK_NO_DECREASE_AVAILABLE_SPACE = 0x00000020 FILE_LINK_PRESERVE_AVAILABLE_SPACE = 0x00000030 FILE_LINK_IGNORE_READONLY_ATTRIBUTE = 0x00000040 FILE_LINK_FORCE_RESIZE_TARGET_SR = 0x00000080 FILE_LINK_FORCE_RESIZE_SOURCE_SR = 0x00000100 FILE_LINK_FORCE_RESIZE_SR = 0x00000180 ) // ProcessInformationClasses for NtQueryInformationProcess and NtSetInformationProcess. const ( ProcessBasicInformation = iota ProcessQuotaLimits ProcessIoCounters ProcessVmCounters ProcessTimes ProcessBasePriority ProcessRaisePriority ProcessDebugPort ProcessExceptionPort ProcessAccessToken ProcessLdtInformation ProcessLdtSize ProcessDefaultHardErrorMode ProcessIoPortHandlers ProcessPooledUsageAndLimits ProcessWorkingSetWatch ProcessUserModeIOPL ProcessEnableAlignmentFaultFixup ProcessPriorityClass ProcessWx86Information ProcessHandleCount ProcessAffinityMask ProcessPriorityBoost ProcessDeviceMap ProcessSessionInformation ProcessForegroundInformation ProcessWow64Information ProcessImageFileName ProcessLUIDDeviceMapsEnabled ProcessBreakOnTermination ProcessDebugObjectHandle ProcessDebugFlags ProcessHandleTracing ProcessIoPriority ProcessExecuteFlags ProcessTlsInformation ProcessCookie ProcessImageInformation ProcessCycleTime ProcessPagePriority ProcessInstrumentationCallback ProcessThreadStackAllocation ProcessWorkingSetWatchEx ProcessImageFileNameWin32 ProcessImageFileMapping ProcessAffinityUpdateMode ProcessMemoryAllocationMode ProcessGroupInformation ProcessTokenVirtualizationEnabled ProcessConsoleHostProcess ProcessWindowInformation ProcessHandleInformation ProcessMitigationPolicy ProcessDynamicFunctionTableInformation ProcessHandleCheckingMode ProcessKeepAliveCount ProcessRevokeFileHandles ProcessWorkingSetControl ProcessHandleTable ProcessCheckStackExtentsMode ProcessCommandLineInformation ProcessProtectionInformation ProcessMemoryExhaustion ProcessFaultInformation ProcessTelemetryIdInformation ProcessCommitReleaseInformation ProcessDefaultCpuSetsInformation ProcessAllowedCpuSetsInformation ProcessSubsystemProcess ProcessJobMemoryInformation ProcessInPrivate ProcessRaiseUMExceptionOnInvalidHandleClose ProcessIumChallengeResponse ProcessChildProcessInformation ProcessHighGraphicsPriorityInformation ProcessSubsystemInformation ProcessEnergyValues ProcessActivityThrottleState ProcessActivityThrottlePolicy ProcessWin32kSyscallFilterInformation ProcessDisableSystemAllowedCpuSets ProcessWakeInformation ProcessEnergyTrackingState ProcessManageWritesToExecutableMemory ProcessCaptureTrustletLiveDump ProcessTelemetryCoverage ProcessEnclaveInformation ProcessEnableReadWriteVmLogging ProcessUptimeInformation ProcessImageSection ProcessDebugAuthInformation ProcessSystemResourceManagement ProcessSequenceNumber ProcessLoaderDetour ProcessSecurityDomainInformation ProcessCombineSecurityDomainsInformation ProcessEnableLogging ProcessLeapSecondInformation ProcessFiberShadowStackAllocation ProcessFreeFiberShadowStackAllocation ProcessAltSystemCallInformation ProcessDynamicEHContinuationTargets ProcessDynamicEnforcedCetCompatibleRanges ) type PROCESS_BASIC_INFORMATION struct { ExitStatus NTStatus PebBaseAddress *PEB AffinityMask uintptr BasePriority int32 UniqueProcessId uintptr InheritedFromUniqueProcessId uintptr } type SYSTEM_PROCESS_INFORMATION struct { NextEntryOffset uint32 NumberOfThreads uint32 WorkingSetPrivateSize int64 HardFaultCount uint32 NumberOfThreadsHighWatermark uint32 CycleTime uint64 CreateTime int64 UserTime int64 KernelTime int64 ImageName NTUnicodeString BasePriority int32 UniqueProcessID uintptr InheritedFromUniqueProcessID uintptr HandleCount uint32 SessionID uint32 UniqueProcessKey *uint32 PeakVirtualSize uintptr VirtualSize uintptr PageFaultCount uint32 PeakWorkingSetSize uintptr WorkingSetSize uintptr QuotaPeakPagedPoolUsage uintptr QuotaPagedPoolUsage uintptr QuotaPeakNonPagedPoolUsage uintptr QuotaNonPagedPoolUsage uintptr PagefileUsage uintptr PeakPagefileUsage uintptr PrivatePageCount uintptr ReadOperationCount int64 WriteOperationCount int64 OtherOperationCount int64 ReadTransferCount int64 WriteTransferCount int64 OtherTransferCount int64 } // SystemInformationClasses for NtQuerySystemInformation and NtSetSystemInformation const ( SystemBasicInformation = iota SystemProcessorInformation SystemPerformanceInformation SystemTimeOfDayInformation SystemPathInformation SystemProcessInformation SystemCallCountInformation SystemDeviceInformation SystemProcessorPerformanceInformation SystemFlagsInformation SystemCallTimeInformation SystemModuleInformation SystemLocksInformation SystemStackTraceInformation SystemPagedPoolInformation SystemNonPagedPoolInformation SystemHandleInformation SystemObjectInformation SystemPageFileInformation SystemVdmInstemulInformation SystemVdmBopInformation SystemFileCacheInformation SystemPoolTagInformation SystemInterruptInformation SystemDpcBehaviorInformation SystemFullMemoryInformation SystemLoadGdiDriverInformation SystemUnloadGdiDriverInformation SystemTimeAdjustmentInformation SystemSummaryMemoryInformation SystemMirrorMemoryInformation SystemPerformanceTraceInformation systemObsolete0 SystemExceptionInformation SystemCrashDumpStateInformation SystemKernelDebuggerInformation SystemContextSwitchInformation SystemRegistryQuotaInformation SystemExtendServiceTableInformation SystemPrioritySeperation SystemVerifierAddDriverInformation SystemVerifierRemoveDriverInformation SystemProcessorIdleInformation SystemLegacyDriverInformation SystemCurrentTimeZoneInformation SystemLookasideInformation SystemTimeSlipNotification SystemSessionCreate SystemSessionDetach SystemSessionInformation SystemRangeStartInformation SystemVerifierInformation SystemVerifierThunkExtend SystemSessionProcessInformation SystemLoadGdiDriverInSystemSpace SystemNumaProcessorMap SystemPrefetcherInformation SystemExtendedProcessInformation SystemRecommendedSharedDataAlignment SystemComPlusPackage SystemNumaAvailableMemory SystemProcessorPowerInformation SystemEmulationBasicInformation SystemEmulationProcessorInformation SystemExtendedHandleInformation SystemLostDelayedWriteInformation SystemBigPoolInformation SystemSessionPoolTagInformation SystemSessionMappedViewInformation SystemHotpatchInformation SystemObjectSecurityMode SystemWatchdogTimerHandler SystemWatchdogTimerInformation SystemLogicalProcessorInformation SystemWow64SharedInformationObsolete SystemRegisterFirmwareTableInformationHandler SystemFirmwareTableInformation SystemModuleInformationEx SystemVerifierTriageInformation SystemSuperfetchInformation SystemMemoryListInformation SystemFileCacheInformationEx SystemThreadPriorityClientIdInformation SystemProcessorIdleCycleTimeInformation SystemVerifierCancellationInformation SystemProcessorPowerInformationEx SystemRefTraceInformation SystemSpecialPoolInformation SystemProcessIdInformation SystemErrorPortInformation SystemBootEnvironmentInformation SystemHypervisorInformation SystemVerifierInformationEx SystemTimeZoneInformation SystemImageFileExecutionOptionsInformation SystemCoverageInformation SystemPrefetchPatchInformation SystemVerifierFaultsInformation SystemSystemPartitionInformation SystemSystemDiskInformation SystemProcessorPerformanceDistribution SystemNumaProximityNodeInformation SystemDynamicTimeZoneInformation SystemCodeIntegrityInformation SystemProcessorMicrocodeUpdateInformation SystemProcessorBrandString SystemVirtualAddressInformation SystemLogicalProcessorAndGroupInformation SystemProcessorCycleTimeInformation SystemStoreInformation SystemRegistryAppendString SystemAitSamplingValue SystemVhdBootInformation SystemCpuQuotaInformation SystemNativeBasicInformation systemSpare1 SystemLowPriorityIoInformation SystemTpmBootEntropyInformation SystemVerifierCountersInformation SystemPagedPoolInformationEx SystemSystemPtesInformationEx SystemNodeDistanceInformation SystemAcpiAuditInformation SystemBasicPerformanceInformation SystemQueryPerformanceCounterInformation SystemSessionBigPoolInformation SystemBootGraphicsInformation SystemScrubPhysicalMemoryInformation SystemBadPageInformation SystemProcessorProfileControlArea SystemCombinePhysicalMemoryInformation SystemEntropyInterruptTimingCallback SystemConsoleInformation SystemPlatformBinaryInformation SystemThrottleNotificationInformation SystemHypervisorProcessorCountInformation SystemDeviceDataInformation SystemDeviceDataEnumerationInformation SystemMemoryTopologyInformation SystemMemoryChannelInformation SystemBootLogoInformation SystemProcessorPerformanceInformationEx systemSpare0 SystemSecureBootPolicyInformation SystemPageFileInformationEx SystemSecureBootInformation SystemEntropyInterruptTimingRawInformation SystemPortableWorkspaceEfiLauncherInformation SystemFullProcessInformation SystemKernelDebuggerInformationEx SystemBootMetadataInformation SystemSoftRebootInformation SystemElamCertificateInformation SystemOfflineDumpConfigInformation SystemProcessorFeaturesInformation SystemRegistryReconciliationInformation SystemEdidInformation SystemManufacturingInformation SystemEnergyEstimationConfigInformation SystemHypervisorDetailInformation SystemProcessorCycleStatsInformation SystemVmGenerationCountInformation SystemTrustedPlatformModuleInformation SystemKernelDebuggerFlags SystemCodeIntegrityPolicyInformation SystemIsolatedUserModeInformation SystemHardwareSecurityTestInterfaceResultsInformation SystemSingleModuleInformation SystemAllowedCpuSetsInformation SystemDmaProtectionInformation SystemInterruptCpuSetsInformation SystemSecureBootPolicyFullInformation SystemCodeIntegrityPolicyFullInformation SystemAffinitizedInterruptProcessorInformation SystemRootSiloInformation ) type RTL_PROCESS_MODULE_INFORMATION struct { Section Handle MappedBase uintptr ImageBase uintptr ImageSize uint32 Flags uint32 LoadOrderIndex uint16 InitOrderIndex uint16 LoadCount uint16 OffsetToFileName uint16 FullPathName [256]byte } type RTL_PROCESS_MODULES struct { NumberOfModules uint32 Modules [1]RTL_PROCESS_MODULE_INFORMATION } // Constants for LocalAlloc flags. const ( LMEM_FIXED = 0x0 LMEM_MOVEABLE = 0x2 LMEM_NOCOMPACT = 0x10 LMEM_NODISCARD = 0x20 LMEM_ZEROINIT = 0x40 LMEM_MODIFY = 0x80 LMEM_DISCARDABLE = 0xf00 LMEM_VALID_FLAGS = 0xf72 LMEM_INVALID_HANDLE = 0x8000 LHND = LMEM_MOVEABLE | LMEM_ZEROINIT LPTR = LMEM_FIXED | LMEM_ZEROINIT NONZEROLHND = LMEM_MOVEABLE NONZEROLPTR = LMEM_FIXED ) // Constants for the CreateNamedPipe-family of functions. const ( PIPE_ACCESS_INBOUND = 0x1 PIPE_ACCESS_OUTBOUND = 0x2 PIPE_ACCESS_DUPLEX = 0x3 PIPE_CLIENT_END = 0x0 PIPE_SERVER_END = 0x1 PIPE_WAIT = 0x0 PIPE_NOWAIT = 0x1 PIPE_READMODE_BYTE = 0x0 PIPE_READMODE_MESSAGE = 0x2 PIPE_TYPE_BYTE = 0x0 PIPE_TYPE_MESSAGE = 0x4 PIPE_ACCEPT_REMOTE_CLIENTS = 0x0 PIPE_REJECT_REMOTE_CLIENTS = 0x8 PIPE_UNLIMITED_INSTANCES = 255 ) // Constants for security attributes when opening named pipes. const ( SECURITY_ANONYMOUS = SecurityAnonymous << 16 SECURITY_IDENTIFICATION = SecurityIdentification << 16 SECURITY_IMPERSONATION = SecurityImpersonation << 16 SECURITY_DELEGATION = SecurityDelegation << 16 SECURITY_CONTEXT_TRACKING = 0x40000 SECURITY_EFFECTIVE_ONLY = 0x80000 SECURITY_SQOS_PRESENT = 0x100000 SECURITY_VALID_SQOS_FLAGS = 0x1f0000 ) // ResourceID represents a 16-bit resource identifier, traditionally created with the MAKEINTRESOURCE macro. type ResourceID uint16 // ResourceIDOrString must be either a ResourceID, to specify a resource or resource type by ID, // or a string, to specify a resource or resource type by name. type ResourceIDOrString interface{} // Predefined resource names and types. var ( // Predefined names. CREATEPROCESS_MANIFEST_RESOURCE_ID ResourceID = 1 ISOLATIONAWARE_MANIFEST_RESOURCE_ID ResourceID = 2 ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID ResourceID = 3 ISOLATIONPOLICY_MANIFEST_RESOURCE_ID ResourceID = 4 ISOLATIONPOLICY_BROWSER_MANIFEST_RESOURCE_ID ResourceID = 5 MINIMUM_RESERVED_MANIFEST_RESOURCE_ID ResourceID = 1 // inclusive MAXIMUM_RESERVED_MANIFEST_RESOURCE_ID ResourceID = 16 // inclusive // Predefined types. RT_CURSOR ResourceID = 1 RT_BITMAP ResourceID = 2 RT_ICON ResourceID = 3 RT_MENU ResourceID = 4 RT_DIALOG ResourceID = 5 RT_STRING ResourceID = 6 RT_FONTDIR ResourceID = 7 RT_FONT ResourceID = 8 RT_ACCELERATOR ResourceID = 9 RT_RCDATA ResourceID = 10 RT_MESSAGETABLE ResourceID = 11 RT_GROUP_CURSOR ResourceID = 12 RT_GROUP_ICON ResourceID = 14 RT_VERSION ResourceID = 16 RT_DLGINCLUDE ResourceID = 17 RT_PLUGPLAY ResourceID = 19 RT_VXD ResourceID = 20 RT_ANICURSOR ResourceID = 21 RT_ANIICON ResourceID = 22 RT_HTML ResourceID = 23 RT_MANIFEST ResourceID = 24 ) type VS_FIXEDFILEINFO struct { Signature uint32 StrucVersion uint32 FileVersionMS uint32 FileVersionLS uint32 ProductVersionMS uint32 ProductVersionLS uint32 FileFlagsMask uint32 FileFlags uint32 FileOS uint32 FileType uint32 FileSubtype uint32 FileDateMS uint32 FileDateLS uint32 } type COAUTHIDENTITY struct { User *uint16 UserLength uint32 Domain *uint16 DomainLength uint32 Password *uint16 PasswordLength uint32 Flags uint32 } type COAUTHINFO struct { AuthnSvc uint32 AuthzSvc uint32 ServerPrincName *uint16 AuthnLevel uint32 ImpersonationLevel uint32 AuthIdentityData *COAUTHIDENTITY Capabilities uint32 } type COSERVERINFO struct { Reserved1 uint32 Aame *uint16 AuthInfo *COAUTHINFO Reserved2 uint32 } type BIND_OPTS3 struct { CbStruct uint32 Flags uint32 Mode uint32 TickCountDeadline uint32 TrackFlags uint32 ClassContext uint32 Locale uint32 ServerInfo *COSERVERINFO Hwnd HWND } const ( CLSCTX_INPROC_SERVER = 0x1 CLSCTX_INPROC_HANDLER = 0x2 CLSCTX_LOCAL_SERVER = 0x4 CLSCTX_INPROC_SERVER16 = 0x8 CLSCTX_REMOTE_SERVER = 0x10 CLSCTX_INPROC_HANDLER16 = 0x20 CLSCTX_RESERVED1 = 0x40 CLSCTX_RESERVED2 = 0x80 CLSCTX_RESERVED3 = 0x100 CLSCTX_RESERVED4 = 0x200 CLSCTX_NO_CODE_DOWNLOAD = 0x400 CLSCTX_RESERVED5 = 0x800 CLSCTX_NO_CUSTOM_MARSHAL = 0x1000 CLSCTX_ENABLE_CODE_DOWNLOAD = 0x2000 CLSCTX_NO_FAILURE_LOG = 0x4000 CLSCTX_DISABLE_AAA = 0x8000 CLSCTX_ENABLE_AAA = 0x10000 CLSCTX_FROM_DEFAULT_CONTEXT = 0x20000 CLSCTX_ACTIVATE_32_BIT_SERVER = 0x40000 CLSCTX_ACTIVATE_64_BIT_SERVER = 0x80000 CLSCTX_ENABLE_CLOAKING = 0x100000 CLSCTX_APPCONTAINER = 0x400000 CLSCTX_ACTIVATE_AAA_AS_IU = 0x800000 CLSCTX_PS_DLL = 0x80000000 COINIT_MULTITHREADED = 0x0 COINIT_APARTMENTTHREADED = 0x2 COINIT_DISABLE_OLE1DDE = 0x4 COINIT_SPEED_OVER_MEMORY = 0x8 ) // Flag for QueryFullProcessImageName. const PROCESS_NAME_NATIVE = 1 type ModuleInfo struct { BaseOfDll uintptr SizeOfImage uint32 EntryPoint uintptr } const ALL_PROCESSOR_GROUPS = 0xFFFF type Rect struct { Left int32 Top int32 Right int32 Bottom int32 } type GUIThreadInfo struct { Size uint32 Flags uint32 Active HWND Focus HWND Capture HWND MenuOwner HWND MoveSize HWND CaretHandle HWND CaretRect Rect } const ( DWMWA_NCRENDERING_ENABLED = 1 DWMWA_NCRENDERING_POLICY = 2 DWMWA_TRANSITIONS_FORCEDISABLED = 3 DWMWA_ALLOW_NCPAINT = 4 DWMWA_CAPTION_BUTTON_BOUNDS = 5 DWMWA_NONCLIENT_RTL_LAYOUT = 6 DWMWA_FORCE_ICONIC_REPRESENTATION = 7 DWMWA_FLIP3D_POLICY = 8 DWMWA_EXTENDED_FRAME_BOUNDS = 9 DWMWA_HAS_ICONIC_BITMAP = 10 DWMWA_DISALLOW_PEEK = 11 DWMWA_EXCLUDED_FROM_PEEK = 12 DWMWA_CLOAK = 13 DWMWA_CLOAKED = 14 DWMWA_FREEZE_REPRESENTATION = 15 DWMWA_PASSIVE_UPDATE_MODE = 16 DWMWA_USE_HOSTBACKDROPBRUSH = 17 DWMWA_USE_IMMERSIVE_DARK_MODE = 20 DWMWA_WINDOW_CORNER_PREFERENCE = 33 DWMWA_BORDER_COLOR = 34 DWMWA_CAPTION_COLOR = 35 DWMWA_TEXT_COLOR = 36 DWMWA_VISIBLE_FRAME_BORDER_THICKNESS = 37 ) type WSAQUERYSET struct { Size uint32 ServiceInstanceName *uint16 ServiceClassId *GUID Version *WSAVersion Comment *uint16 NameSpace uint32 NSProviderId *GUID Context *uint16 NumberOfProtocols uint32 AfpProtocols *AFProtocols QueryString *uint16 NumberOfCsAddrs uint32 SaBuffer *CSAddrInfo OutputFlags uint32 Blob *BLOB } type WSAVersion struct { Version uint32 EnumerationOfComparison int32 } type AFProtocols struct { AddressFamily int32 Protocol int32 } type CSAddrInfo struct { LocalAddr SocketAddress RemoteAddr SocketAddress SocketType int32 Protocol int32 } type BLOB struct { Size uint32 BlobData *byte } type ComStat struct { Flags uint32 CBInQue uint32 CBOutQue uint32 } type DCB struct { DCBlength uint32 BaudRate uint32 Flags uint32 wReserved uint16 XonLim uint16 XoffLim uint16 ByteSize uint8 Parity uint8 StopBits uint8 XonChar byte XoffChar byte ErrorChar byte EofChar byte EvtChar byte wReserved1 uint16 } // Keyboard Layout Flags. // See https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-loadkeyboardlayoutw const ( KLF_ACTIVATE = 0x00000001 KLF_SUBSTITUTE_OK = 0x00000002 KLF_REORDER = 0x00000008 KLF_REPLACELANG = 0x00000010 KLF_NOTELLSHELL = 0x00000080 KLF_SETFORPROCESS = 0x00000100 ) // Virtual Key codes // https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes const ( VK_LBUTTON = 0x01 VK_RBUTTON = 0x02 VK_CANCEL = 0x03 VK_MBUTTON = 0x04 VK_XBUTTON1 = 0x05 VK_XBUTTON2 = 0x06 VK_BACK = 0x08 VK_TAB = 0x09 VK_CLEAR = 0x0C VK_RETURN = 0x0D VK_SHIFT = 0x10 VK_CONTROL = 0x11 VK_MENU = 0x12 VK_PAUSE = 0x13 VK_CAPITAL = 0x14 VK_KANA = 0x15 VK_HANGEUL = 0x15 VK_HANGUL = 0x15 VK_IME_ON = 0x16 VK_JUNJA = 0x17 VK_FINAL = 0x18 VK_HANJA = 0x19 VK_KANJI = 0x19 VK_IME_OFF = 0x1A VK_ESCAPE = 0x1B VK_CONVERT = 0x1C VK_NONCONVERT = 0x1D VK_ACCEPT = 0x1E VK_MODECHANGE = 0x1F VK_SPACE = 0x20 VK_PRIOR = 0x21 VK_NEXT = 0x22 VK_END = 0x23 VK_HOME = 0x24 VK_LEFT = 0x25 VK_UP = 0x26 VK_RIGHT = 0x27 VK_DOWN = 0x28 VK_SELECT = 0x29 VK_PRINT = 0x2A VK_EXECUTE = 0x2B VK_SNAPSHOT = 0x2C VK_INSERT = 0x2D VK_DELETE = 0x2E VK_HELP = 0x2F VK_LWIN = 0x5B VK_RWIN = 0x5C VK_APPS = 0x5D VK_SLEEP = 0x5F VK_NUMPAD0 = 0x60 VK_NUMPAD1 = 0x61 VK_NUMPAD2 = 0x62 VK_NUMPAD3 = 0x63 VK_NUMPAD4 = 0x64 VK_NUMPAD5 = 0x65 VK_NUMPAD6 = 0x66 VK_NUMPAD7 = 0x67 VK_NUMPAD8 = 0x68 VK_NUMPAD9 = 0x69 VK_MULTIPLY = 0x6A VK_ADD = 0x6B VK_SEPARATOR = 0x6C VK_SUBTRACT = 0x6D VK_DECIMAL = 0x6E VK_DIVIDE = 0x6F VK_F1 = 0x70 VK_F2 = 0x71 VK_F3 = 0x72 VK_F4 = 0x73 VK_F5 = 0x74 VK_F6 = 0x75 VK_F7 = 0x76 VK_F8 = 0x77 VK_F9 = 0x78 VK_F10 = 0x79 VK_F11 = 0x7A VK_F12 = 0x7B VK_F13 = 0x7C VK_F14 = 0x7D VK_F15 = 0x7E VK_F16 = 0x7F VK_F17 = 0x80 VK_F18 = 0x81 VK_F19 = 0x82 VK_F20 = 0x83 VK_F21 = 0x84 VK_F22 = 0x85 VK_F23 = 0x86 VK_F24 = 0x87 VK_NUMLOCK = 0x90 VK_SCROLL = 0x91 VK_OEM_NEC_EQUAL = 0x92 VK_OEM_FJ_JISHO = 0x92 VK_OEM_FJ_MASSHOU = 0x93 VK_OEM_FJ_TOUROKU = 0x94 VK_OEM_FJ_LOYA = 0x95 VK_OEM_FJ_ROYA = 0x96 VK_LSHIFT = 0xA0 VK_RSHIFT = 0xA1 VK_LCONTROL = 0xA2 VK_RCONTROL = 0xA3 VK_LMENU = 0xA4 VK_RMENU = 0xA5 VK_BROWSER_BACK = 0xA6 VK_BROWSER_FORWARD = 0xA7 VK_BROWSER_REFRESH = 0xA8 VK_BROWSER_STOP = 0xA9 VK_BROWSER_SEARCH = 0xAA VK_BROWSER_FAVORITES = 0xAB VK_BROWSER_HOME = 0xAC VK_VOLUME_MUTE = 0xAD VK_VOLUME_DOWN = 0xAE VK_VOLUME_UP = 0xAF VK_MEDIA_NEXT_TRACK = 0xB0 VK_MEDIA_PREV_TRACK = 0xB1 VK_MEDIA_STOP = 0xB2 VK_MEDIA_PLAY_PAUSE = 0xB3 VK_LAUNCH_MAIL = 0xB4 VK_LAUNCH_MEDIA_SELECT = 0xB5 VK_LAUNCH_APP1 = 0xB6 VK_LAUNCH_APP2 = 0xB7 VK_OEM_1 = 0xBA VK_OEM_PLUS = 0xBB VK_OEM_COMMA = 0xBC VK_OEM_MINUS = 0xBD VK_OEM_PERIOD = 0xBE VK_OEM_2 = 0xBF VK_OEM_3 = 0xC0 VK_OEM_4 = 0xDB VK_OEM_5 = 0xDC VK_OEM_6 = 0xDD VK_OEM_7 = 0xDE VK_OEM_8 = 0xDF VK_OEM_AX = 0xE1 VK_OEM_102 = 0xE2 VK_ICO_HELP = 0xE3 VK_ICO_00 = 0xE4 VK_PROCESSKEY = 0xE5 VK_ICO_CLEAR = 0xE6 VK_OEM_RESET = 0xE9 VK_OEM_JUMP = 0xEA VK_OEM_PA1 = 0xEB VK_OEM_PA2 = 0xEC VK_OEM_PA3 = 0xED VK_OEM_WSCTRL = 0xEE VK_OEM_CUSEL = 0xEF VK_OEM_ATTN = 0xF0 VK_OEM_FINISH = 0xF1 VK_OEM_COPY = 0xF2 VK_OEM_AUTO = 0xF3 VK_OEM_ENLW = 0xF4 VK_OEM_BACKTAB = 0xF5 VK_ATTN = 0xF6 VK_CRSEL = 0xF7 VK_EXSEL = 0xF8 VK_EREOF = 0xF9 VK_PLAY = 0xFA VK_ZOOM = 0xFB VK_NONAME = 0xFC VK_PA1 = 0xFD VK_OEM_CLEAR = 0xFE ) // Mouse button constants. // https://docs.microsoft.com/en-us/windows/console/mouse-event-record-str const ( FROM_LEFT_1ST_BUTTON_PRESSED = 0x0001 RIGHTMOST_BUTTON_PRESSED = 0x0002 FROM_LEFT_2ND_BUTTON_PRESSED = 0x0004 FROM_LEFT_3RD_BUTTON_PRESSED = 0x0008 FROM_LEFT_4TH_BUTTON_PRESSED = 0x0010 ) // Control key state constaints. // https://docs.microsoft.com/en-us/windows/console/key-event-record-str // https://docs.microsoft.com/en-us/windows/console/mouse-event-record-str const ( CAPSLOCK_ON = 0x0080 ENHANCED_KEY = 0x0100 LEFT_ALT_PRESSED = 0x0002 LEFT_CTRL_PRESSED = 0x0008 NUMLOCK_ON = 0x0020 RIGHT_ALT_PRESSED = 0x0001 RIGHT_CTRL_PRESSED = 0x0004 SCROLLLOCK_ON = 0x0040 SHIFT_PRESSED = 0x0010 ) // Mouse event record event flags. // https://docs.microsoft.com/en-us/windows/console/mouse-event-record-str const ( MOUSE_MOVED = 0x0001 DOUBLE_CLICK = 0x0002 MOUSE_WHEELED = 0x0004 MOUSE_HWHEELED = 0x0008 ) // Input Record Event Types // https://learn.microsoft.com/en-us/windows/console/input-record-str const ( FOCUS_EVENT = 0x0010 KEY_EVENT = 0x0001 MENU_EVENT = 0x0008 MOUSE_EVENT = 0x0002 WINDOW_BUFFER_SIZE_EVENT = 0x0004 ) // The processor features to be tested for IsProcessorFeaturePresent, see // https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-isprocessorfeaturepresent const ( PF_ARM_64BIT_LOADSTORE_ATOMIC = 25 PF_ARM_DIVIDE_INSTRUCTION_AVAILABLE = 24 PF_ARM_EXTERNAL_CACHE_AVAILABLE = 26 PF_ARM_FMAC_INSTRUCTIONS_AVAILABLE = 27 PF_ARM_VFP_32_REGISTERS_AVAILABLE = 18 PF_3DNOW_INSTRUCTIONS_AVAILABLE = 7 PF_CHANNELS_ENABLED = 16 PF_COMPARE_EXCHANGE_DOUBLE = 2 PF_COMPARE_EXCHANGE128 = 14 PF_COMPARE64_EXCHANGE128 = 15 PF_FASTFAIL_AVAILABLE = 23 PF_FLOATING_POINT_EMULATED = 1 PF_FLOATING_POINT_PRECISION_ERRATA = 0 PF_MMX_INSTRUCTIONS_AVAILABLE = 3 PF_NX_ENABLED = 12 PF_PAE_ENABLED = 9 PF_RDTSC_INSTRUCTION_AVAILABLE = 8 PF_RDWRFSGSBASE_AVAILABLE = 22 PF_SECOND_LEVEL_ADDRESS_TRANSLATION = 20 PF_SSE3_INSTRUCTIONS_AVAILABLE = 13 PF_SSSE3_INSTRUCTIONS_AVAILABLE = 36 PF_SSE4_1_INSTRUCTIONS_AVAILABLE = 37 PF_SSE4_2_INSTRUCTIONS_AVAILABLE = 38 PF_AVX_INSTRUCTIONS_AVAILABLE = 39 PF_AVX2_INSTRUCTIONS_AVAILABLE = 40 PF_AVX512F_INSTRUCTIONS_AVAILABLE = 41 PF_VIRT_FIRMWARE_ENABLED = 21 PF_XMMI_INSTRUCTIONS_AVAILABLE = 6 PF_XMMI64_INSTRUCTIONS_AVAILABLE = 10 PF_XSAVE_ENABLED = 17 PF_ARM_V8_INSTRUCTIONS_AVAILABLE = 29 PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE = 30 PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE = 31 PF_ARM_V81_ATOMIC_INSTRUCTIONS_AVAILABLE = 34 PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE = 43 PF_ARM_V83_JSCVT_INSTRUCTIONS_AVAILABLE = 44 PF_ARM_V83_LRCPC_INSTRUCTIONS_AVAILABLE = 45 PF_ARM_SVE_INSTRUCTIONS_AVAILABLE = 46 PF_ARM_SVE2_INSTRUCTIONS_AVAILABLE = 47 PF_ARM_SVE2_1_INSTRUCTIONS_AVAILABLE = 48 PF_ARM_SVE_AES_INSTRUCTIONS_AVAILABLE = 49 PF_ARM_SVE_PMULL128_INSTRUCTIONS_AVAILABLE = 50 PF_ARM_SVE_BITPERM_INSTRUCTIONS_AVAILABLE = 51 PF_ARM_SVE_BF16_INSTRUCTIONS_AVAILABLE = 52 PF_ARM_SVE_EBF16_INSTRUCTIONS_AVAILABLE = 53 PF_ARM_SVE_B16B16_INSTRUCTIONS_AVAILABLE = 54 PF_ARM_SVE_SHA3_INSTRUCTIONS_AVAILABLE = 55 PF_ARM_SVE_SM4_INSTRUCTIONS_AVAILABLE = 56 PF_ARM_SVE_I8MM_INSTRUCTIONS_AVAILABLE = 57 PF_ARM_SVE_F32MM_INSTRUCTIONS_AVAILABLE = 58 PF_ARM_SVE_F64MM_INSTRUCTIONS_AVAILABLE = 59 PF_BMI2_INSTRUCTIONS_AVAILABLE = 60 PF_MOVDIR64B_INSTRUCTION_AVAILABLE = 61 PF_ARM_LSE2_AVAILABLE = 62 PF_ARM_SHA3_INSTRUCTIONS_AVAILABLE = 64 PF_ARM_SHA512_INSTRUCTIONS_AVAILABLE = 65 PF_ARM_V82_I8MM_INSTRUCTIONS_AVAILABLE = 66 PF_ARM_V82_FP16_INSTRUCTIONS_AVAILABLE = 67 PF_ARM_V86_BF16_INSTRUCTIONS_AVAILABLE = 68 PF_ARM_V86_EBF16_INSTRUCTIONS_AVAILABLE = 69 PF_ARM_SME_INSTRUCTIONS_AVAILABLE = 70 PF_ARM_SME2_INSTRUCTIONS_AVAILABLE = 71 PF_ARM_SME2_1_INSTRUCTIONS_AVAILABLE = 72 PF_ARM_SME2_2_INSTRUCTIONS_AVAILABLE = 73 PF_ARM_SME_AES_INSTRUCTIONS_AVAILABLE = 74 PF_ARM_SME_SBITPERM_INSTRUCTIONS_AVAILABLE = 75 PF_ARM_SME_SF8MM4_INSTRUCTIONS_AVAILABLE = 76 PF_ARM_SME_SF8MM8_INSTRUCTIONS_AVAILABLE = 77 PF_ARM_SME_SF8DP2_INSTRUCTIONS_AVAILABLE = 78 PF_ARM_SME_SF8DP4_INSTRUCTIONS_AVAILABLE = 79 PF_ARM_SME_SF8FMA_INSTRUCTIONS_AVAILABLE = 80 PF_ARM_SME_F8F32_INSTRUCTIONS_AVAILABLE = 81 PF_ARM_SME_F8F16_INSTRUCTIONS_AVAILABLE = 82 PF_ARM_SME_F16F16_INSTRUCTIONS_AVAILABLE = 83 PF_ARM_SME_B16B16_INSTRUCTIONS_AVAILABLE = 84 PF_ARM_SME_F64F64_INSTRUCTIONS_AVAILABLE = 85 PF_ARM_SME_I16I64_INSTRUCTIONS_AVAILABLE = 86 PF_ARM_SME_LUTv2_INSTRUCTIONS_AVAILABLE = 87 PF_ARM_SME_FA64_INSTRUCTIONS_AVAILABLE = 88 PF_UMONITOR_INSTRUCTION_AVAILABLE = 89 ) ================================================ FILE: vendor/golang.org/x/sys/windows/types_windows_386.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package windows type WSAData struct { Version uint16 HighVersion uint16 Description [WSADESCRIPTION_LEN + 1]byte SystemStatus [WSASYS_STATUS_LEN + 1]byte MaxSockets uint16 MaxUdpDg uint16 VendorInfo *byte } type Servent struct { Name *byte Aliases **byte Port uint16 Proto *byte } type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { PerProcessUserTimeLimit int64 PerJobUserTimeLimit int64 LimitFlags uint32 MinimumWorkingSetSize uintptr MaximumWorkingSetSize uintptr ActiveProcessLimit uint32 Affinity uintptr PriorityClass uint32 SchedulingClass uint32 _ uint32 // pad to 8 byte boundary } ================================================ FILE: vendor/golang.org/x/sys/windows/types_windows_amd64.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package windows type WSAData struct { Version uint16 HighVersion uint16 MaxSockets uint16 MaxUdpDg uint16 VendorInfo *byte Description [WSADESCRIPTION_LEN + 1]byte SystemStatus [WSASYS_STATUS_LEN + 1]byte } type Servent struct { Name *byte Aliases **byte Proto *byte Port uint16 } type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { PerProcessUserTimeLimit int64 PerJobUserTimeLimit int64 LimitFlags uint32 MinimumWorkingSetSize uintptr MaximumWorkingSetSize uintptr ActiveProcessLimit uint32 Affinity uintptr PriorityClass uint32 SchedulingClass uint32 } ================================================ FILE: vendor/golang.org/x/sys/windows/types_windows_arm.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package windows type WSAData struct { Version uint16 HighVersion uint16 Description [WSADESCRIPTION_LEN + 1]byte SystemStatus [WSASYS_STATUS_LEN + 1]byte MaxSockets uint16 MaxUdpDg uint16 VendorInfo *byte } type Servent struct { Name *byte Aliases **byte Port uint16 Proto *byte } type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { PerProcessUserTimeLimit int64 PerJobUserTimeLimit int64 LimitFlags uint32 MinimumWorkingSetSize uintptr MaximumWorkingSetSize uintptr ActiveProcessLimit uint32 Affinity uintptr PriorityClass uint32 SchedulingClass uint32 _ uint32 // pad to 8 byte boundary } ================================================ FILE: vendor/golang.org/x/sys/windows/types_windows_arm64.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package windows type WSAData struct { Version uint16 HighVersion uint16 MaxSockets uint16 MaxUdpDg uint16 VendorInfo *byte Description [WSADESCRIPTION_LEN + 1]byte SystemStatus [WSASYS_STATUS_LEN + 1]byte } type Servent struct { Name *byte Aliases **byte Proto *byte Port uint16 } type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { PerProcessUserTimeLimit int64 PerJobUserTimeLimit int64 LimitFlags uint32 MinimumWorkingSetSize uintptr MaximumWorkingSetSize uintptr ActiveProcessLimit uint32 Affinity uintptr PriorityClass uint32 SchedulingClass uint32 } ================================================ FILE: vendor/golang.org/x/sys/windows/zerrors_windows.go ================================================ // Code generated by 'mkerrors.bash'; DO NOT EDIT. package windows import "syscall" const ( FACILITY_NULL = 0 FACILITY_RPC = 1 FACILITY_DISPATCH = 2 FACILITY_STORAGE = 3 FACILITY_ITF = 4 FACILITY_WIN32 = 7 FACILITY_WINDOWS = 8 FACILITY_SSPI = 9 FACILITY_SECURITY = 9 FACILITY_CONTROL = 10 FACILITY_CERT = 11 FACILITY_INTERNET = 12 FACILITY_MEDIASERVER = 13 FACILITY_MSMQ = 14 FACILITY_SETUPAPI = 15 FACILITY_SCARD = 16 FACILITY_COMPLUS = 17 FACILITY_AAF = 18 FACILITY_URT = 19 FACILITY_ACS = 20 FACILITY_DPLAY = 21 FACILITY_UMI = 22 FACILITY_SXS = 23 FACILITY_WINDOWS_CE = 24 FACILITY_HTTP = 25 FACILITY_USERMODE_COMMONLOG = 26 FACILITY_WER = 27 FACILITY_USERMODE_FILTER_MANAGER = 31 FACILITY_BACKGROUNDCOPY = 32 FACILITY_CONFIGURATION = 33 FACILITY_WIA = 33 FACILITY_STATE_MANAGEMENT = 34 FACILITY_METADIRECTORY = 35 FACILITY_WINDOWSUPDATE = 36 FACILITY_DIRECTORYSERVICE = 37 FACILITY_GRAPHICS = 38 FACILITY_SHELL = 39 FACILITY_NAP = 39 FACILITY_TPM_SERVICES = 40 FACILITY_TPM_SOFTWARE = 41 FACILITY_UI = 42 FACILITY_XAML = 43 FACILITY_ACTION_QUEUE = 44 FACILITY_PLA = 48 FACILITY_WINDOWS_SETUP = 48 FACILITY_FVE = 49 FACILITY_FWP = 50 FACILITY_WINRM = 51 FACILITY_NDIS = 52 FACILITY_USERMODE_HYPERVISOR = 53 FACILITY_CMI = 54 FACILITY_USERMODE_VIRTUALIZATION = 55 FACILITY_USERMODE_VOLMGR = 56 FACILITY_BCD = 57 FACILITY_USERMODE_VHD = 58 FACILITY_USERMODE_HNS = 59 FACILITY_SDIAG = 60 FACILITY_WEBSERVICES = 61 FACILITY_WINPE = 61 FACILITY_WPN = 62 FACILITY_WINDOWS_STORE = 63 FACILITY_INPUT = 64 FACILITY_EAP = 66 FACILITY_WINDOWS_DEFENDER = 80 FACILITY_OPC = 81 FACILITY_XPS = 82 FACILITY_MBN = 84 FACILITY_POWERSHELL = 84 FACILITY_RAS = 83 FACILITY_P2P_INT = 98 FACILITY_P2P = 99 FACILITY_DAF = 100 FACILITY_BLUETOOTH_ATT = 101 FACILITY_AUDIO = 102 FACILITY_STATEREPOSITORY = 103 FACILITY_VISUALCPP = 109 FACILITY_SCRIPT = 112 FACILITY_PARSE = 113 FACILITY_BLB = 120 FACILITY_BLB_CLI = 121 FACILITY_WSBAPP = 122 FACILITY_BLBUI = 128 FACILITY_USN = 129 FACILITY_USERMODE_VOLSNAP = 130 FACILITY_TIERING = 131 FACILITY_WSB_ONLINE = 133 FACILITY_ONLINE_ID = 134 FACILITY_DEVICE_UPDATE_AGENT = 135 FACILITY_DRVSERVICING = 136 FACILITY_DLS = 153 FACILITY_DELIVERY_OPTIMIZATION = 208 FACILITY_USERMODE_SPACES = 231 FACILITY_USER_MODE_SECURITY_CORE = 232 FACILITY_USERMODE_LICENSING = 234 FACILITY_SOS = 160 FACILITY_DEBUGGERS = 176 FACILITY_SPP = 256 FACILITY_RESTORE = 256 FACILITY_DMSERVER = 256 FACILITY_DEPLOYMENT_SERVICES_SERVER = 257 FACILITY_DEPLOYMENT_SERVICES_IMAGING = 258 FACILITY_DEPLOYMENT_SERVICES_MANAGEMENT = 259 FACILITY_DEPLOYMENT_SERVICES_UTIL = 260 FACILITY_DEPLOYMENT_SERVICES_BINLSVC = 261 FACILITY_DEPLOYMENT_SERVICES_PXE = 263 FACILITY_DEPLOYMENT_SERVICES_TFTP = 264 FACILITY_DEPLOYMENT_SERVICES_TRANSPORT_MANAGEMENT = 272 FACILITY_DEPLOYMENT_SERVICES_DRIVER_PROVISIONING = 278 FACILITY_DEPLOYMENT_SERVICES_MULTICAST_SERVER = 289 FACILITY_DEPLOYMENT_SERVICES_MULTICAST_CLIENT = 290 FACILITY_DEPLOYMENT_SERVICES_CONTENT_PROVIDER = 293 FACILITY_LINGUISTIC_SERVICES = 305 FACILITY_AUDIOSTREAMING = 1094 FACILITY_ACCELERATOR = 1536 FACILITY_WMAAECMA = 1996 FACILITY_DIRECTMUSIC = 2168 FACILITY_DIRECT3D10 = 2169 FACILITY_DXGI = 2170 FACILITY_DXGI_DDI = 2171 FACILITY_DIRECT3D11 = 2172 FACILITY_DIRECT3D11_DEBUG = 2173 FACILITY_DIRECT3D12 = 2174 FACILITY_DIRECT3D12_DEBUG = 2175 FACILITY_LEAP = 2184 FACILITY_AUDCLNT = 2185 FACILITY_WINCODEC_DWRITE_DWM = 2200 FACILITY_WINML = 2192 FACILITY_DIRECT2D = 2201 FACILITY_DEFRAG = 2304 FACILITY_USERMODE_SDBUS = 2305 FACILITY_JSCRIPT = 2306 FACILITY_PIDGENX = 2561 FACILITY_EAS = 85 FACILITY_WEB = 885 FACILITY_WEB_SOCKET = 886 FACILITY_MOBILE = 1793 FACILITY_SQLITE = 1967 FACILITY_UTC = 1989 FACILITY_WEP = 2049 FACILITY_SYNCENGINE = 2050 FACILITY_XBOX = 2339 FACILITY_GAME = 2340 FACILITY_PIX = 2748 ERROR_SUCCESS syscall.Errno = 0 NO_ERROR = 0 SEC_E_OK Handle = 0x00000000 ERROR_INVALID_FUNCTION syscall.Errno = 1 ERROR_FILE_NOT_FOUND syscall.Errno = 2 ERROR_PATH_NOT_FOUND syscall.Errno = 3 ERROR_TOO_MANY_OPEN_FILES syscall.Errno = 4 ERROR_ACCESS_DENIED syscall.Errno = 5 ERROR_INVALID_HANDLE syscall.Errno = 6 ERROR_ARENA_TRASHED syscall.Errno = 7 ERROR_NOT_ENOUGH_MEMORY syscall.Errno = 8 ERROR_INVALID_BLOCK syscall.Errno = 9 ERROR_BAD_ENVIRONMENT syscall.Errno = 10 ERROR_BAD_FORMAT syscall.Errno = 11 ERROR_INVALID_ACCESS syscall.Errno = 12 ERROR_INVALID_DATA syscall.Errno = 13 ERROR_OUTOFMEMORY syscall.Errno = 14 ERROR_INVALID_DRIVE syscall.Errno = 15 ERROR_CURRENT_DIRECTORY syscall.Errno = 16 ERROR_NOT_SAME_DEVICE syscall.Errno = 17 ERROR_NO_MORE_FILES syscall.Errno = 18 ERROR_WRITE_PROTECT syscall.Errno = 19 ERROR_BAD_UNIT syscall.Errno = 20 ERROR_NOT_READY syscall.Errno = 21 ERROR_BAD_COMMAND syscall.Errno = 22 ERROR_CRC syscall.Errno = 23 ERROR_BAD_LENGTH syscall.Errno = 24 ERROR_SEEK syscall.Errno = 25 ERROR_NOT_DOS_DISK syscall.Errno = 26 ERROR_SECTOR_NOT_FOUND syscall.Errno = 27 ERROR_OUT_OF_PAPER syscall.Errno = 28 ERROR_WRITE_FAULT syscall.Errno = 29 ERROR_READ_FAULT syscall.Errno = 30 ERROR_GEN_FAILURE syscall.Errno = 31 ERROR_SHARING_VIOLATION syscall.Errno = 32 ERROR_LOCK_VIOLATION syscall.Errno = 33 ERROR_WRONG_DISK syscall.Errno = 34 ERROR_SHARING_BUFFER_EXCEEDED syscall.Errno = 36 ERROR_HANDLE_EOF syscall.Errno = 38 ERROR_HANDLE_DISK_FULL syscall.Errno = 39 ERROR_NOT_SUPPORTED syscall.Errno = 50 ERROR_REM_NOT_LIST syscall.Errno = 51 ERROR_DUP_NAME syscall.Errno = 52 ERROR_BAD_NETPATH syscall.Errno = 53 ERROR_NETWORK_BUSY syscall.Errno = 54 ERROR_DEV_NOT_EXIST syscall.Errno = 55 ERROR_TOO_MANY_CMDS syscall.Errno = 56 ERROR_ADAP_HDW_ERR syscall.Errno = 57 ERROR_BAD_NET_RESP syscall.Errno = 58 ERROR_UNEXP_NET_ERR syscall.Errno = 59 ERROR_BAD_REM_ADAP syscall.Errno = 60 ERROR_PRINTQ_FULL syscall.Errno = 61 ERROR_NO_SPOOL_SPACE syscall.Errno = 62 ERROR_PRINT_CANCELLED syscall.Errno = 63 ERROR_NETNAME_DELETED syscall.Errno = 64 ERROR_NETWORK_ACCESS_DENIED syscall.Errno = 65 ERROR_BAD_DEV_TYPE syscall.Errno = 66 ERROR_BAD_NET_NAME syscall.Errno = 67 ERROR_TOO_MANY_NAMES syscall.Errno = 68 ERROR_TOO_MANY_SESS syscall.Errno = 69 ERROR_SHARING_PAUSED syscall.Errno = 70 ERROR_REQ_NOT_ACCEP syscall.Errno = 71 ERROR_REDIR_PAUSED syscall.Errno = 72 ERROR_FILE_EXISTS syscall.Errno = 80 ERROR_CANNOT_MAKE syscall.Errno = 82 ERROR_FAIL_I24 syscall.Errno = 83 ERROR_OUT_OF_STRUCTURES syscall.Errno = 84 ERROR_ALREADY_ASSIGNED syscall.Errno = 85 ERROR_INVALID_PASSWORD syscall.Errno = 86 ERROR_INVALID_PARAMETER syscall.Errno = 87 ERROR_NET_WRITE_FAULT syscall.Errno = 88 ERROR_NO_PROC_SLOTS syscall.Errno = 89 ERROR_TOO_MANY_SEMAPHORES syscall.Errno = 100 ERROR_EXCL_SEM_ALREADY_OWNED syscall.Errno = 101 ERROR_SEM_IS_SET syscall.Errno = 102 ERROR_TOO_MANY_SEM_REQUESTS syscall.Errno = 103 ERROR_INVALID_AT_INTERRUPT_TIME syscall.Errno = 104 ERROR_SEM_OWNER_DIED syscall.Errno = 105 ERROR_SEM_USER_LIMIT syscall.Errno = 106 ERROR_DISK_CHANGE syscall.Errno = 107 ERROR_DRIVE_LOCKED syscall.Errno = 108 ERROR_BROKEN_PIPE syscall.Errno = 109 ERROR_OPEN_FAILED syscall.Errno = 110 ERROR_BUFFER_OVERFLOW syscall.Errno = 111 ERROR_DISK_FULL syscall.Errno = 112 ERROR_NO_MORE_SEARCH_HANDLES syscall.Errno = 113 ERROR_INVALID_TARGET_HANDLE syscall.Errno = 114 ERROR_INVALID_CATEGORY syscall.Errno = 117 ERROR_INVALID_VERIFY_SWITCH syscall.Errno = 118 ERROR_BAD_DRIVER_LEVEL syscall.Errno = 119 ERROR_CALL_NOT_IMPLEMENTED syscall.Errno = 120 ERROR_SEM_TIMEOUT syscall.Errno = 121 ERROR_INSUFFICIENT_BUFFER syscall.Errno = 122 ERROR_INVALID_NAME syscall.Errno = 123 ERROR_INVALID_LEVEL syscall.Errno = 124 ERROR_NO_VOLUME_LABEL syscall.Errno = 125 ERROR_MOD_NOT_FOUND syscall.Errno = 126 ERROR_PROC_NOT_FOUND syscall.Errno = 127 ERROR_WAIT_NO_CHILDREN syscall.Errno = 128 ERROR_CHILD_NOT_COMPLETE syscall.Errno = 129 ERROR_DIRECT_ACCESS_HANDLE syscall.Errno = 130 ERROR_NEGATIVE_SEEK syscall.Errno = 131 ERROR_SEEK_ON_DEVICE syscall.Errno = 132 ERROR_IS_JOIN_TARGET syscall.Errno = 133 ERROR_IS_JOINED syscall.Errno = 134 ERROR_IS_SUBSTED syscall.Errno = 135 ERROR_NOT_JOINED syscall.Errno = 136 ERROR_NOT_SUBSTED syscall.Errno = 137 ERROR_JOIN_TO_JOIN syscall.Errno = 138 ERROR_SUBST_TO_SUBST syscall.Errno = 139 ERROR_JOIN_TO_SUBST syscall.Errno = 140 ERROR_SUBST_TO_JOIN syscall.Errno = 141 ERROR_BUSY_DRIVE syscall.Errno = 142 ERROR_SAME_DRIVE syscall.Errno = 143 ERROR_DIR_NOT_ROOT syscall.Errno = 144 ERROR_DIR_NOT_EMPTY syscall.Errno = 145 ERROR_IS_SUBST_PATH syscall.Errno = 146 ERROR_IS_JOIN_PATH syscall.Errno = 147 ERROR_PATH_BUSY syscall.Errno = 148 ERROR_IS_SUBST_TARGET syscall.Errno = 149 ERROR_SYSTEM_TRACE syscall.Errno = 150 ERROR_INVALID_EVENT_COUNT syscall.Errno = 151 ERROR_TOO_MANY_MUXWAITERS syscall.Errno = 152 ERROR_INVALID_LIST_FORMAT syscall.Errno = 153 ERROR_LABEL_TOO_LONG syscall.Errno = 154 ERROR_TOO_MANY_TCBS syscall.Errno = 155 ERROR_SIGNAL_REFUSED syscall.Errno = 156 ERROR_DISCARDED syscall.Errno = 157 ERROR_NOT_LOCKED syscall.Errno = 158 ERROR_BAD_THREADID_ADDR syscall.Errno = 159 ERROR_BAD_ARGUMENTS syscall.Errno = 160 ERROR_BAD_PATHNAME syscall.Errno = 161 ERROR_SIGNAL_PENDING syscall.Errno = 162 ERROR_MAX_THRDS_REACHED syscall.Errno = 164 ERROR_LOCK_FAILED syscall.Errno = 167 ERROR_BUSY syscall.Errno = 170 ERROR_DEVICE_SUPPORT_IN_PROGRESS syscall.Errno = 171 ERROR_CANCEL_VIOLATION syscall.Errno = 173 ERROR_ATOMIC_LOCKS_NOT_SUPPORTED syscall.Errno = 174 ERROR_INVALID_SEGMENT_NUMBER syscall.Errno = 180 ERROR_INVALID_ORDINAL syscall.Errno = 182 ERROR_ALREADY_EXISTS syscall.Errno = 183 ERROR_INVALID_FLAG_NUMBER syscall.Errno = 186 ERROR_SEM_NOT_FOUND syscall.Errno = 187 ERROR_INVALID_STARTING_CODESEG syscall.Errno = 188 ERROR_INVALID_STACKSEG syscall.Errno = 189 ERROR_INVALID_MODULETYPE syscall.Errno = 190 ERROR_INVALID_EXE_SIGNATURE syscall.Errno = 191 ERROR_EXE_MARKED_INVALID syscall.Errno = 192 ERROR_BAD_EXE_FORMAT syscall.Errno = 193 ERROR_ITERATED_DATA_EXCEEDS_64k syscall.Errno = 194 ERROR_INVALID_MINALLOCSIZE syscall.Errno = 195 ERROR_DYNLINK_FROM_INVALID_RING syscall.Errno = 196 ERROR_IOPL_NOT_ENABLED syscall.Errno = 197 ERROR_INVALID_SEGDPL syscall.Errno = 198 ERROR_AUTODATASEG_EXCEEDS_64k syscall.Errno = 199 ERROR_RING2SEG_MUST_BE_MOVABLE syscall.Errno = 200 ERROR_RELOC_CHAIN_XEEDS_SEGLIM syscall.Errno = 201 ERROR_INFLOOP_IN_RELOC_CHAIN syscall.Errno = 202 ERROR_ENVVAR_NOT_FOUND syscall.Errno = 203 ERROR_NO_SIGNAL_SENT syscall.Errno = 205 ERROR_FILENAME_EXCED_RANGE syscall.Errno = 206 ERROR_RING2_STACK_IN_USE syscall.Errno = 207 ERROR_META_EXPANSION_TOO_LONG syscall.Errno = 208 ERROR_INVALID_SIGNAL_NUMBER syscall.Errno = 209 ERROR_THREAD_1_INACTIVE syscall.Errno = 210 ERROR_LOCKED syscall.Errno = 212 ERROR_TOO_MANY_MODULES syscall.Errno = 214 ERROR_NESTING_NOT_ALLOWED syscall.Errno = 215 ERROR_EXE_MACHINE_TYPE_MISMATCH syscall.Errno = 216 ERROR_EXE_CANNOT_MODIFY_SIGNED_BINARY syscall.Errno = 217 ERROR_EXE_CANNOT_MODIFY_STRONG_SIGNED_BINARY syscall.Errno = 218 ERROR_FILE_CHECKED_OUT syscall.Errno = 220 ERROR_CHECKOUT_REQUIRED syscall.Errno = 221 ERROR_BAD_FILE_TYPE syscall.Errno = 222 ERROR_FILE_TOO_LARGE syscall.Errno = 223 ERROR_FORMS_AUTH_REQUIRED syscall.Errno = 224 ERROR_VIRUS_INFECTED syscall.Errno = 225 ERROR_VIRUS_DELETED syscall.Errno = 226 ERROR_PIPE_LOCAL syscall.Errno = 229 ERROR_BAD_PIPE syscall.Errno = 230 ERROR_PIPE_BUSY syscall.Errno = 231 ERROR_NO_DATA syscall.Errno = 232 ERROR_PIPE_NOT_CONNECTED syscall.Errno = 233 ERROR_MORE_DATA syscall.Errno = 234 ERROR_NO_WORK_DONE syscall.Errno = 235 ERROR_VC_DISCONNECTED syscall.Errno = 240 ERROR_INVALID_EA_NAME syscall.Errno = 254 ERROR_EA_LIST_INCONSISTENT syscall.Errno = 255 WAIT_TIMEOUT syscall.Errno = 258 ERROR_NO_MORE_ITEMS syscall.Errno = 259 ERROR_CANNOT_COPY syscall.Errno = 266 ERROR_DIRECTORY syscall.Errno = 267 ERROR_EAS_DIDNT_FIT syscall.Errno = 275 ERROR_EA_FILE_CORRUPT syscall.Errno = 276 ERROR_EA_TABLE_FULL syscall.Errno = 277 ERROR_INVALID_EA_HANDLE syscall.Errno = 278 ERROR_EAS_NOT_SUPPORTED syscall.Errno = 282 ERROR_NOT_OWNER syscall.Errno = 288 ERROR_TOO_MANY_POSTS syscall.Errno = 298 ERROR_PARTIAL_COPY syscall.Errno = 299 ERROR_OPLOCK_NOT_GRANTED syscall.Errno = 300 ERROR_INVALID_OPLOCK_PROTOCOL syscall.Errno = 301 ERROR_DISK_TOO_FRAGMENTED syscall.Errno = 302 ERROR_DELETE_PENDING syscall.Errno = 303 ERROR_INCOMPATIBLE_WITH_GLOBAL_SHORT_NAME_REGISTRY_SETTING syscall.Errno = 304 ERROR_SHORT_NAMES_NOT_ENABLED_ON_VOLUME syscall.Errno = 305 ERROR_SECURITY_STREAM_IS_INCONSISTENT syscall.Errno = 306 ERROR_INVALID_LOCK_RANGE syscall.Errno = 307 ERROR_IMAGE_SUBSYSTEM_NOT_PRESENT syscall.Errno = 308 ERROR_NOTIFICATION_GUID_ALREADY_DEFINED syscall.Errno = 309 ERROR_INVALID_EXCEPTION_HANDLER syscall.Errno = 310 ERROR_DUPLICATE_PRIVILEGES syscall.Errno = 311 ERROR_NO_RANGES_PROCESSED syscall.Errno = 312 ERROR_NOT_ALLOWED_ON_SYSTEM_FILE syscall.Errno = 313 ERROR_DISK_RESOURCES_EXHAUSTED syscall.Errno = 314 ERROR_INVALID_TOKEN syscall.Errno = 315 ERROR_DEVICE_FEATURE_NOT_SUPPORTED syscall.Errno = 316 ERROR_MR_MID_NOT_FOUND syscall.Errno = 317 ERROR_SCOPE_NOT_FOUND syscall.Errno = 318 ERROR_UNDEFINED_SCOPE syscall.Errno = 319 ERROR_INVALID_CAP syscall.Errno = 320 ERROR_DEVICE_UNREACHABLE syscall.Errno = 321 ERROR_DEVICE_NO_RESOURCES syscall.Errno = 322 ERROR_DATA_CHECKSUM_ERROR syscall.Errno = 323 ERROR_INTERMIXED_KERNEL_EA_OPERATION syscall.Errno = 324 ERROR_FILE_LEVEL_TRIM_NOT_SUPPORTED syscall.Errno = 326 ERROR_OFFSET_ALIGNMENT_VIOLATION syscall.Errno = 327 ERROR_INVALID_FIELD_IN_PARAMETER_LIST syscall.Errno = 328 ERROR_OPERATION_IN_PROGRESS syscall.Errno = 329 ERROR_BAD_DEVICE_PATH syscall.Errno = 330 ERROR_TOO_MANY_DESCRIPTORS syscall.Errno = 331 ERROR_SCRUB_DATA_DISABLED syscall.Errno = 332 ERROR_NOT_REDUNDANT_STORAGE syscall.Errno = 333 ERROR_RESIDENT_FILE_NOT_SUPPORTED syscall.Errno = 334 ERROR_COMPRESSED_FILE_NOT_SUPPORTED syscall.Errno = 335 ERROR_DIRECTORY_NOT_SUPPORTED syscall.Errno = 336 ERROR_NOT_READ_FROM_COPY syscall.Errno = 337 ERROR_FT_WRITE_FAILURE syscall.Errno = 338 ERROR_FT_DI_SCAN_REQUIRED syscall.Errno = 339 ERROR_INVALID_KERNEL_INFO_VERSION syscall.Errno = 340 ERROR_INVALID_PEP_INFO_VERSION syscall.Errno = 341 ERROR_OBJECT_NOT_EXTERNALLY_BACKED syscall.Errno = 342 ERROR_EXTERNAL_BACKING_PROVIDER_UNKNOWN syscall.Errno = 343 ERROR_COMPRESSION_NOT_BENEFICIAL syscall.Errno = 344 ERROR_STORAGE_TOPOLOGY_ID_MISMATCH syscall.Errno = 345 ERROR_BLOCKED_BY_PARENTAL_CONTROLS syscall.Errno = 346 ERROR_BLOCK_TOO_MANY_REFERENCES syscall.Errno = 347 ERROR_MARKED_TO_DISALLOW_WRITES syscall.Errno = 348 ERROR_ENCLAVE_FAILURE syscall.Errno = 349 ERROR_FAIL_NOACTION_REBOOT syscall.Errno = 350 ERROR_FAIL_SHUTDOWN syscall.Errno = 351 ERROR_FAIL_RESTART syscall.Errno = 352 ERROR_MAX_SESSIONS_REACHED syscall.Errno = 353 ERROR_NETWORK_ACCESS_DENIED_EDP syscall.Errno = 354 ERROR_DEVICE_HINT_NAME_BUFFER_TOO_SMALL syscall.Errno = 355 ERROR_EDP_POLICY_DENIES_OPERATION syscall.Errno = 356 ERROR_EDP_DPL_POLICY_CANT_BE_SATISFIED syscall.Errno = 357 ERROR_CLOUD_FILE_SYNC_ROOT_METADATA_CORRUPT syscall.Errno = 358 ERROR_DEVICE_IN_MAINTENANCE syscall.Errno = 359 ERROR_NOT_SUPPORTED_ON_DAX syscall.Errno = 360 ERROR_DAX_MAPPING_EXISTS syscall.Errno = 361 ERROR_CLOUD_FILE_PROVIDER_NOT_RUNNING syscall.Errno = 362 ERROR_CLOUD_FILE_METADATA_CORRUPT syscall.Errno = 363 ERROR_CLOUD_FILE_METADATA_TOO_LARGE syscall.Errno = 364 ERROR_CLOUD_FILE_PROPERTY_BLOB_TOO_LARGE syscall.Errno = 365 ERROR_CLOUD_FILE_PROPERTY_BLOB_CHECKSUM_MISMATCH syscall.Errno = 366 ERROR_CHILD_PROCESS_BLOCKED syscall.Errno = 367 ERROR_STORAGE_LOST_DATA_PERSISTENCE syscall.Errno = 368 ERROR_FILE_SYSTEM_VIRTUALIZATION_UNAVAILABLE syscall.Errno = 369 ERROR_FILE_SYSTEM_VIRTUALIZATION_METADATA_CORRUPT syscall.Errno = 370 ERROR_FILE_SYSTEM_VIRTUALIZATION_BUSY syscall.Errno = 371 ERROR_FILE_SYSTEM_VIRTUALIZATION_PROVIDER_UNKNOWN syscall.Errno = 372 ERROR_GDI_HANDLE_LEAK syscall.Errno = 373 ERROR_CLOUD_FILE_TOO_MANY_PROPERTY_BLOBS syscall.Errno = 374 ERROR_CLOUD_FILE_PROPERTY_VERSION_NOT_SUPPORTED syscall.Errno = 375 ERROR_NOT_A_CLOUD_FILE syscall.Errno = 376 ERROR_CLOUD_FILE_NOT_IN_SYNC syscall.Errno = 377 ERROR_CLOUD_FILE_ALREADY_CONNECTED syscall.Errno = 378 ERROR_CLOUD_FILE_NOT_SUPPORTED syscall.Errno = 379 ERROR_CLOUD_FILE_INVALID_REQUEST syscall.Errno = 380 ERROR_CLOUD_FILE_READ_ONLY_VOLUME syscall.Errno = 381 ERROR_CLOUD_FILE_CONNECTED_PROVIDER_ONLY syscall.Errno = 382 ERROR_CLOUD_FILE_VALIDATION_FAILED syscall.Errno = 383 ERROR_SMB1_NOT_AVAILABLE syscall.Errno = 384 ERROR_FILE_SYSTEM_VIRTUALIZATION_INVALID_OPERATION syscall.Errno = 385 ERROR_CLOUD_FILE_AUTHENTICATION_FAILED syscall.Errno = 386 ERROR_CLOUD_FILE_INSUFFICIENT_RESOURCES syscall.Errno = 387 ERROR_CLOUD_FILE_NETWORK_UNAVAILABLE syscall.Errno = 388 ERROR_CLOUD_FILE_UNSUCCESSFUL syscall.Errno = 389 ERROR_CLOUD_FILE_NOT_UNDER_SYNC_ROOT syscall.Errno = 390 ERROR_CLOUD_FILE_IN_USE syscall.Errno = 391 ERROR_CLOUD_FILE_PINNED syscall.Errno = 392 ERROR_CLOUD_FILE_REQUEST_ABORTED syscall.Errno = 393 ERROR_CLOUD_FILE_PROPERTY_CORRUPT syscall.Errno = 394 ERROR_CLOUD_FILE_ACCESS_DENIED syscall.Errno = 395 ERROR_CLOUD_FILE_INCOMPATIBLE_HARDLINKS syscall.Errno = 396 ERROR_CLOUD_FILE_PROPERTY_LOCK_CONFLICT syscall.Errno = 397 ERROR_CLOUD_FILE_REQUEST_CANCELED syscall.Errno = 398 ERROR_EXTERNAL_SYSKEY_NOT_SUPPORTED syscall.Errno = 399 ERROR_THREAD_MODE_ALREADY_BACKGROUND syscall.Errno = 400 ERROR_THREAD_MODE_NOT_BACKGROUND syscall.Errno = 401 ERROR_PROCESS_MODE_ALREADY_BACKGROUND syscall.Errno = 402 ERROR_PROCESS_MODE_NOT_BACKGROUND syscall.Errno = 403 ERROR_CLOUD_FILE_PROVIDER_TERMINATED syscall.Errno = 404 ERROR_NOT_A_CLOUD_SYNC_ROOT syscall.Errno = 405 ERROR_FILE_PROTECTED_UNDER_DPL syscall.Errno = 406 ERROR_VOLUME_NOT_CLUSTER_ALIGNED syscall.Errno = 407 ERROR_NO_PHYSICALLY_ALIGNED_FREE_SPACE_FOUND syscall.Errno = 408 ERROR_APPX_FILE_NOT_ENCRYPTED syscall.Errno = 409 ERROR_RWRAW_ENCRYPTED_FILE_NOT_ENCRYPTED syscall.Errno = 410 ERROR_RWRAW_ENCRYPTED_INVALID_EDATAINFO_FILEOFFSET syscall.Errno = 411 ERROR_RWRAW_ENCRYPTED_INVALID_EDATAINFO_FILERANGE syscall.Errno = 412 ERROR_RWRAW_ENCRYPTED_INVALID_EDATAINFO_PARAMETER syscall.Errno = 413 ERROR_LINUX_SUBSYSTEM_NOT_PRESENT syscall.Errno = 414 ERROR_FT_READ_FAILURE syscall.Errno = 415 ERROR_STORAGE_RESERVE_ID_INVALID syscall.Errno = 416 ERROR_STORAGE_RESERVE_DOES_NOT_EXIST syscall.Errno = 417 ERROR_STORAGE_RESERVE_ALREADY_EXISTS syscall.Errno = 418 ERROR_STORAGE_RESERVE_NOT_EMPTY syscall.Errno = 419 ERROR_NOT_A_DAX_VOLUME syscall.Errno = 420 ERROR_NOT_DAX_MAPPABLE syscall.Errno = 421 ERROR_TIME_SENSITIVE_THREAD syscall.Errno = 422 ERROR_DPL_NOT_SUPPORTED_FOR_USER syscall.Errno = 423 ERROR_CASE_DIFFERING_NAMES_IN_DIR syscall.Errno = 424 ERROR_FILE_NOT_SUPPORTED syscall.Errno = 425 ERROR_CLOUD_FILE_REQUEST_TIMEOUT syscall.Errno = 426 ERROR_NO_TASK_QUEUE syscall.Errno = 427 ERROR_SRC_SRV_DLL_LOAD_FAILED syscall.Errno = 428 ERROR_NOT_SUPPORTED_WITH_BTT syscall.Errno = 429 ERROR_ENCRYPTION_DISABLED syscall.Errno = 430 ERROR_ENCRYPTING_METADATA_DISALLOWED syscall.Errno = 431 ERROR_CANT_CLEAR_ENCRYPTION_FLAG syscall.Errno = 432 ERROR_NO_SUCH_DEVICE syscall.Errno = 433 ERROR_CAPAUTHZ_NOT_DEVUNLOCKED syscall.Errno = 450 ERROR_CAPAUTHZ_CHANGE_TYPE syscall.Errno = 451 ERROR_CAPAUTHZ_NOT_PROVISIONED syscall.Errno = 452 ERROR_CAPAUTHZ_NOT_AUTHORIZED syscall.Errno = 453 ERROR_CAPAUTHZ_NO_POLICY syscall.Errno = 454 ERROR_CAPAUTHZ_DB_CORRUPTED syscall.Errno = 455 ERROR_CAPAUTHZ_SCCD_INVALID_CATALOG syscall.Errno = 456 ERROR_CAPAUTHZ_SCCD_NO_AUTH_ENTITY syscall.Errno = 457 ERROR_CAPAUTHZ_SCCD_PARSE_ERROR syscall.Errno = 458 ERROR_CAPAUTHZ_SCCD_DEV_MODE_REQUIRED syscall.Errno = 459 ERROR_CAPAUTHZ_SCCD_NO_CAPABILITY_MATCH syscall.Errno = 460 ERROR_PNP_QUERY_REMOVE_DEVICE_TIMEOUT syscall.Errno = 480 ERROR_PNP_QUERY_REMOVE_RELATED_DEVICE_TIMEOUT syscall.Errno = 481 ERROR_PNP_QUERY_REMOVE_UNRELATED_DEVICE_TIMEOUT syscall.Errno = 482 ERROR_DEVICE_HARDWARE_ERROR syscall.Errno = 483 ERROR_INVALID_ADDRESS syscall.Errno = 487 ERROR_VRF_CFG_ENABLED syscall.Errno = 1183 ERROR_PARTITION_TERMINATING syscall.Errno = 1184 ERROR_USER_PROFILE_LOAD syscall.Errno = 500 ERROR_ARITHMETIC_OVERFLOW syscall.Errno = 534 ERROR_PIPE_CONNECTED syscall.Errno = 535 ERROR_PIPE_LISTENING syscall.Errno = 536 ERROR_VERIFIER_STOP syscall.Errno = 537 ERROR_ABIOS_ERROR syscall.Errno = 538 ERROR_WX86_WARNING syscall.Errno = 539 ERROR_WX86_ERROR syscall.Errno = 540 ERROR_TIMER_NOT_CANCELED syscall.Errno = 541 ERROR_UNWIND syscall.Errno = 542 ERROR_BAD_STACK syscall.Errno = 543 ERROR_INVALID_UNWIND_TARGET syscall.Errno = 544 ERROR_INVALID_PORT_ATTRIBUTES syscall.Errno = 545 ERROR_PORT_MESSAGE_TOO_LONG syscall.Errno = 546 ERROR_INVALID_QUOTA_LOWER syscall.Errno = 547 ERROR_DEVICE_ALREADY_ATTACHED syscall.Errno = 548 ERROR_INSTRUCTION_MISALIGNMENT syscall.Errno = 549 ERROR_PROFILING_NOT_STARTED syscall.Errno = 550 ERROR_PROFILING_NOT_STOPPED syscall.Errno = 551 ERROR_COULD_NOT_INTERPRET syscall.Errno = 552 ERROR_PROFILING_AT_LIMIT syscall.Errno = 553 ERROR_CANT_WAIT syscall.Errno = 554 ERROR_CANT_TERMINATE_SELF syscall.Errno = 555 ERROR_UNEXPECTED_MM_CREATE_ERR syscall.Errno = 556 ERROR_UNEXPECTED_MM_MAP_ERROR syscall.Errno = 557 ERROR_UNEXPECTED_MM_EXTEND_ERR syscall.Errno = 558 ERROR_BAD_FUNCTION_TABLE syscall.Errno = 559 ERROR_NO_GUID_TRANSLATION syscall.Errno = 560 ERROR_INVALID_LDT_SIZE syscall.Errno = 561 ERROR_INVALID_LDT_OFFSET syscall.Errno = 563 ERROR_INVALID_LDT_DESCRIPTOR syscall.Errno = 564 ERROR_TOO_MANY_THREADS syscall.Errno = 565 ERROR_THREAD_NOT_IN_PROCESS syscall.Errno = 566 ERROR_PAGEFILE_QUOTA_EXCEEDED syscall.Errno = 567 ERROR_LOGON_SERVER_CONFLICT syscall.Errno = 568 ERROR_SYNCHRONIZATION_REQUIRED syscall.Errno = 569 ERROR_NET_OPEN_FAILED syscall.Errno = 570 ERROR_IO_PRIVILEGE_FAILED syscall.Errno = 571 ERROR_CONTROL_C_EXIT syscall.Errno = 572 ERROR_MISSING_SYSTEMFILE syscall.Errno = 573 ERROR_UNHANDLED_EXCEPTION syscall.Errno = 574 ERROR_APP_INIT_FAILURE syscall.Errno = 575 ERROR_PAGEFILE_CREATE_FAILED syscall.Errno = 576 ERROR_INVALID_IMAGE_HASH syscall.Errno = 577 ERROR_NO_PAGEFILE syscall.Errno = 578 ERROR_ILLEGAL_FLOAT_CONTEXT syscall.Errno = 579 ERROR_NO_EVENT_PAIR syscall.Errno = 580 ERROR_DOMAIN_CTRLR_CONFIG_ERROR syscall.Errno = 581 ERROR_ILLEGAL_CHARACTER syscall.Errno = 582 ERROR_UNDEFINED_CHARACTER syscall.Errno = 583 ERROR_FLOPPY_VOLUME syscall.Errno = 584 ERROR_BIOS_FAILED_TO_CONNECT_INTERRUPT syscall.Errno = 585 ERROR_BACKUP_CONTROLLER syscall.Errno = 586 ERROR_MUTANT_LIMIT_EXCEEDED syscall.Errno = 587 ERROR_FS_DRIVER_REQUIRED syscall.Errno = 588 ERROR_CANNOT_LOAD_REGISTRY_FILE syscall.Errno = 589 ERROR_DEBUG_ATTACH_FAILED syscall.Errno = 590 ERROR_SYSTEM_PROCESS_TERMINATED syscall.Errno = 591 ERROR_DATA_NOT_ACCEPTED syscall.Errno = 592 ERROR_VDM_HARD_ERROR syscall.Errno = 593 ERROR_DRIVER_CANCEL_TIMEOUT syscall.Errno = 594 ERROR_REPLY_MESSAGE_MISMATCH syscall.Errno = 595 ERROR_LOST_WRITEBEHIND_DATA syscall.Errno = 596 ERROR_CLIENT_SERVER_PARAMETERS_INVALID syscall.Errno = 597 ERROR_NOT_TINY_STREAM syscall.Errno = 598 ERROR_STACK_OVERFLOW_READ syscall.Errno = 599 ERROR_CONVERT_TO_LARGE syscall.Errno = 600 ERROR_FOUND_OUT_OF_SCOPE syscall.Errno = 601 ERROR_ALLOCATE_BUCKET syscall.Errno = 602 ERROR_MARSHALL_OVERFLOW syscall.Errno = 603 ERROR_INVALID_VARIANT syscall.Errno = 604 ERROR_BAD_COMPRESSION_BUFFER syscall.Errno = 605 ERROR_AUDIT_FAILED syscall.Errno = 606 ERROR_TIMER_RESOLUTION_NOT_SET syscall.Errno = 607 ERROR_INSUFFICIENT_LOGON_INFO syscall.Errno = 608 ERROR_BAD_DLL_ENTRYPOINT syscall.Errno = 609 ERROR_BAD_SERVICE_ENTRYPOINT syscall.Errno = 610 ERROR_IP_ADDRESS_CONFLICT1 syscall.Errno = 611 ERROR_IP_ADDRESS_CONFLICT2 syscall.Errno = 612 ERROR_REGISTRY_QUOTA_LIMIT syscall.Errno = 613 ERROR_NO_CALLBACK_ACTIVE syscall.Errno = 614 ERROR_PWD_TOO_SHORT syscall.Errno = 615 ERROR_PWD_TOO_RECENT syscall.Errno = 616 ERROR_PWD_HISTORY_CONFLICT syscall.Errno = 617 ERROR_UNSUPPORTED_COMPRESSION syscall.Errno = 618 ERROR_INVALID_HW_PROFILE syscall.Errno = 619 ERROR_INVALID_PLUGPLAY_DEVICE_PATH syscall.Errno = 620 ERROR_QUOTA_LIST_INCONSISTENT syscall.Errno = 621 ERROR_EVALUATION_EXPIRATION syscall.Errno = 622 ERROR_ILLEGAL_DLL_RELOCATION syscall.Errno = 623 ERROR_DLL_INIT_FAILED_LOGOFF syscall.Errno = 624 ERROR_VALIDATE_CONTINUE syscall.Errno = 625 ERROR_NO_MORE_MATCHES syscall.Errno = 626 ERROR_RANGE_LIST_CONFLICT syscall.Errno = 627 ERROR_SERVER_SID_MISMATCH syscall.Errno = 628 ERROR_CANT_ENABLE_DENY_ONLY syscall.Errno = 629 ERROR_FLOAT_MULTIPLE_FAULTS syscall.Errno = 630 ERROR_FLOAT_MULTIPLE_TRAPS syscall.Errno = 631 ERROR_NOINTERFACE syscall.Errno = 632 ERROR_DRIVER_FAILED_SLEEP syscall.Errno = 633 ERROR_CORRUPT_SYSTEM_FILE syscall.Errno = 634 ERROR_COMMITMENT_MINIMUM syscall.Errno = 635 ERROR_PNP_RESTART_ENUMERATION syscall.Errno = 636 ERROR_SYSTEM_IMAGE_BAD_SIGNATURE syscall.Errno = 637 ERROR_PNP_REBOOT_REQUIRED syscall.Errno = 638 ERROR_INSUFFICIENT_POWER syscall.Errno = 639 ERROR_MULTIPLE_FAULT_VIOLATION syscall.Errno = 640 ERROR_SYSTEM_SHUTDOWN syscall.Errno = 641 ERROR_PORT_NOT_SET syscall.Errno = 642 ERROR_DS_VERSION_CHECK_FAILURE syscall.Errno = 643 ERROR_RANGE_NOT_FOUND syscall.Errno = 644 ERROR_NOT_SAFE_MODE_DRIVER syscall.Errno = 646 ERROR_FAILED_DRIVER_ENTRY syscall.Errno = 647 ERROR_DEVICE_ENUMERATION_ERROR syscall.Errno = 648 ERROR_MOUNT_POINT_NOT_RESOLVED syscall.Errno = 649 ERROR_INVALID_DEVICE_OBJECT_PARAMETER syscall.Errno = 650 ERROR_MCA_OCCURED syscall.Errno = 651 ERROR_DRIVER_DATABASE_ERROR syscall.Errno = 652 ERROR_SYSTEM_HIVE_TOO_LARGE syscall.Errno = 653 ERROR_DRIVER_FAILED_PRIOR_UNLOAD syscall.Errno = 654 ERROR_VOLSNAP_PREPARE_HIBERNATE syscall.Errno = 655 ERROR_HIBERNATION_FAILURE syscall.Errno = 656 ERROR_PWD_TOO_LONG syscall.Errno = 657 ERROR_FILE_SYSTEM_LIMITATION syscall.Errno = 665 ERROR_ASSERTION_FAILURE syscall.Errno = 668 ERROR_ACPI_ERROR syscall.Errno = 669 ERROR_WOW_ASSERTION syscall.Errno = 670 ERROR_PNP_BAD_MPS_TABLE syscall.Errno = 671 ERROR_PNP_TRANSLATION_FAILED syscall.Errno = 672 ERROR_PNP_IRQ_TRANSLATION_FAILED syscall.Errno = 673 ERROR_PNP_INVALID_ID syscall.Errno = 674 ERROR_WAKE_SYSTEM_DEBUGGER syscall.Errno = 675 ERROR_HANDLES_CLOSED syscall.Errno = 676 ERROR_EXTRANEOUS_INFORMATION syscall.Errno = 677 ERROR_RXACT_COMMIT_NECESSARY syscall.Errno = 678 ERROR_MEDIA_CHECK syscall.Errno = 679 ERROR_GUID_SUBSTITUTION_MADE syscall.Errno = 680 ERROR_STOPPED_ON_SYMLINK syscall.Errno = 681 ERROR_LONGJUMP syscall.Errno = 682 ERROR_PLUGPLAY_QUERY_VETOED syscall.Errno = 683 ERROR_UNWIND_CONSOLIDATE syscall.Errno = 684 ERROR_REGISTRY_HIVE_RECOVERED syscall.Errno = 685 ERROR_DLL_MIGHT_BE_INSECURE syscall.Errno = 686 ERROR_DLL_MIGHT_BE_INCOMPATIBLE syscall.Errno = 687 ERROR_DBG_EXCEPTION_NOT_HANDLED syscall.Errno = 688 ERROR_DBG_REPLY_LATER syscall.Errno = 689 ERROR_DBG_UNABLE_TO_PROVIDE_HANDLE syscall.Errno = 690 ERROR_DBG_TERMINATE_THREAD syscall.Errno = 691 ERROR_DBG_TERMINATE_PROCESS syscall.Errno = 692 ERROR_DBG_CONTROL_C syscall.Errno = 693 ERROR_DBG_PRINTEXCEPTION_C syscall.Errno = 694 ERROR_DBG_RIPEXCEPTION syscall.Errno = 695 ERROR_DBG_CONTROL_BREAK syscall.Errno = 696 ERROR_DBG_COMMAND_EXCEPTION syscall.Errno = 697 ERROR_OBJECT_NAME_EXISTS syscall.Errno = 698 ERROR_THREAD_WAS_SUSPENDED syscall.Errno = 699 ERROR_IMAGE_NOT_AT_BASE syscall.Errno = 700 ERROR_RXACT_STATE_CREATED syscall.Errno = 701 ERROR_SEGMENT_NOTIFICATION syscall.Errno = 702 ERROR_BAD_CURRENT_DIRECTORY syscall.Errno = 703 ERROR_FT_READ_RECOVERY_FROM_BACKUP syscall.Errno = 704 ERROR_FT_WRITE_RECOVERY syscall.Errno = 705 ERROR_IMAGE_MACHINE_TYPE_MISMATCH syscall.Errno = 706 ERROR_RECEIVE_PARTIAL syscall.Errno = 707 ERROR_RECEIVE_EXPEDITED syscall.Errno = 708 ERROR_RECEIVE_PARTIAL_EXPEDITED syscall.Errno = 709 ERROR_EVENT_DONE syscall.Errno = 710 ERROR_EVENT_PENDING syscall.Errno = 711 ERROR_CHECKING_FILE_SYSTEM syscall.Errno = 712 ERROR_FATAL_APP_EXIT syscall.Errno = 713 ERROR_PREDEFINED_HANDLE syscall.Errno = 714 ERROR_WAS_UNLOCKED syscall.Errno = 715 ERROR_SERVICE_NOTIFICATION syscall.Errno = 716 ERROR_WAS_LOCKED syscall.Errno = 717 ERROR_LOG_HARD_ERROR syscall.Errno = 718 ERROR_ALREADY_WIN32 syscall.Errno = 719 ERROR_IMAGE_MACHINE_TYPE_MISMATCH_EXE syscall.Errno = 720 ERROR_NO_YIELD_PERFORMED syscall.Errno = 721 ERROR_TIMER_RESUME_IGNORED syscall.Errno = 722 ERROR_ARBITRATION_UNHANDLED syscall.Errno = 723 ERROR_CARDBUS_NOT_SUPPORTED syscall.Errno = 724 ERROR_MP_PROCESSOR_MISMATCH syscall.Errno = 725 ERROR_HIBERNATED syscall.Errno = 726 ERROR_RESUME_HIBERNATION syscall.Errno = 727 ERROR_FIRMWARE_UPDATED syscall.Errno = 728 ERROR_DRIVERS_LEAKING_LOCKED_PAGES syscall.Errno = 729 ERROR_WAKE_SYSTEM syscall.Errno = 730 ERROR_WAIT_1 syscall.Errno = 731 ERROR_WAIT_2 syscall.Errno = 732 ERROR_WAIT_3 syscall.Errno = 733 ERROR_WAIT_63 syscall.Errno = 734 ERROR_ABANDONED_WAIT_0 syscall.Errno = 735 ERROR_ABANDONED_WAIT_63 syscall.Errno = 736 ERROR_USER_APC syscall.Errno = 737 ERROR_KERNEL_APC syscall.Errno = 738 ERROR_ALERTED syscall.Errno = 739 ERROR_ELEVATION_REQUIRED syscall.Errno = 740 ERROR_REPARSE syscall.Errno = 741 ERROR_OPLOCK_BREAK_IN_PROGRESS syscall.Errno = 742 ERROR_VOLUME_MOUNTED syscall.Errno = 743 ERROR_RXACT_COMMITTED syscall.Errno = 744 ERROR_NOTIFY_CLEANUP syscall.Errno = 745 ERROR_PRIMARY_TRANSPORT_CONNECT_FAILED syscall.Errno = 746 ERROR_PAGE_FAULT_TRANSITION syscall.Errno = 747 ERROR_PAGE_FAULT_DEMAND_ZERO syscall.Errno = 748 ERROR_PAGE_FAULT_COPY_ON_WRITE syscall.Errno = 749 ERROR_PAGE_FAULT_GUARD_PAGE syscall.Errno = 750 ERROR_PAGE_FAULT_PAGING_FILE syscall.Errno = 751 ERROR_CACHE_PAGE_LOCKED syscall.Errno = 752 ERROR_CRASH_DUMP syscall.Errno = 753 ERROR_BUFFER_ALL_ZEROS syscall.Errno = 754 ERROR_REPARSE_OBJECT syscall.Errno = 755 ERROR_RESOURCE_REQUIREMENTS_CHANGED syscall.Errno = 756 ERROR_TRANSLATION_COMPLETE syscall.Errno = 757 ERROR_NOTHING_TO_TERMINATE syscall.Errno = 758 ERROR_PROCESS_NOT_IN_JOB syscall.Errno = 759 ERROR_PROCESS_IN_JOB syscall.Errno = 760 ERROR_VOLSNAP_HIBERNATE_READY syscall.Errno = 761 ERROR_FSFILTER_OP_COMPLETED_SUCCESSFULLY syscall.Errno = 762 ERROR_INTERRUPT_VECTOR_ALREADY_CONNECTED syscall.Errno = 763 ERROR_INTERRUPT_STILL_CONNECTED syscall.Errno = 764 ERROR_WAIT_FOR_OPLOCK syscall.Errno = 765 ERROR_DBG_EXCEPTION_HANDLED syscall.Errno = 766 ERROR_DBG_CONTINUE syscall.Errno = 767 ERROR_CALLBACK_POP_STACK syscall.Errno = 768 ERROR_COMPRESSION_DISABLED syscall.Errno = 769 ERROR_CANTFETCHBACKWARDS syscall.Errno = 770 ERROR_CANTSCROLLBACKWARDS syscall.Errno = 771 ERROR_ROWSNOTRELEASED syscall.Errno = 772 ERROR_BAD_ACCESSOR_FLAGS syscall.Errno = 773 ERROR_ERRORS_ENCOUNTERED syscall.Errno = 774 ERROR_NOT_CAPABLE syscall.Errno = 775 ERROR_REQUEST_OUT_OF_SEQUENCE syscall.Errno = 776 ERROR_VERSION_PARSE_ERROR syscall.Errno = 777 ERROR_BADSTARTPOSITION syscall.Errno = 778 ERROR_MEMORY_HARDWARE syscall.Errno = 779 ERROR_DISK_REPAIR_DISABLED syscall.Errno = 780 ERROR_INSUFFICIENT_RESOURCE_FOR_SPECIFIED_SHARED_SECTION_SIZE syscall.Errno = 781 ERROR_SYSTEM_POWERSTATE_TRANSITION syscall.Errno = 782 ERROR_SYSTEM_POWERSTATE_COMPLEX_TRANSITION syscall.Errno = 783 ERROR_MCA_EXCEPTION syscall.Errno = 784 ERROR_ACCESS_AUDIT_BY_POLICY syscall.Errno = 785 ERROR_ACCESS_DISABLED_NO_SAFER_UI_BY_POLICY syscall.Errno = 786 ERROR_ABANDON_HIBERFILE syscall.Errno = 787 ERROR_LOST_WRITEBEHIND_DATA_NETWORK_DISCONNECTED syscall.Errno = 788 ERROR_LOST_WRITEBEHIND_DATA_NETWORK_SERVER_ERROR syscall.Errno = 789 ERROR_LOST_WRITEBEHIND_DATA_LOCAL_DISK_ERROR syscall.Errno = 790 ERROR_BAD_MCFG_TABLE syscall.Errno = 791 ERROR_DISK_REPAIR_REDIRECTED syscall.Errno = 792 ERROR_DISK_REPAIR_UNSUCCESSFUL syscall.Errno = 793 ERROR_CORRUPT_LOG_OVERFULL syscall.Errno = 794 ERROR_CORRUPT_LOG_CORRUPTED syscall.Errno = 795 ERROR_CORRUPT_LOG_UNAVAILABLE syscall.Errno = 796 ERROR_CORRUPT_LOG_DELETED_FULL syscall.Errno = 797 ERROR_CORRUPT_LOG_CLEARED syscall.Errno = 798 ERROR_ORPHAN_NAME_EXHAUSTED syscall.Errno = 799 ERROR_OPLOCK_SWITCHED_TO_NEW_HANDLE syscall.Errno = 800 ERROR_CANNOT_GRANT_REQUESTED_OPLOCK syscall.Errno = 801 ERROR_CANNOT_BREAK_OPLOCK syscall.Errno = 802 ERROR_OPLOCK_HANDLE_CLOSED syscall.Errno = 803 ERROR_NO_ACE_CONDITION syscall.Errno = 804 ERROR_INVALID_ACE_CONDITION syscall.Errno = 805 ERROR_FILE_HANDLE_REVOKED syscall.Errno = 806 ERROR_IMAGE_AT_DIFFERENT_BASE syscall.Errno = 807 ERROR_ENCRYPTED_IO_NOT_POSSIBLE syscall.Errno = 808 ERROR_FILE_METADATA_OPTIMIZATION_IN_PROGRESS syscall.Errno = 809 ERROR_QUOTA_ACTIVITY syscall.Errno = 810 ERROR_HANDLE_REVOKED syscall.Errno = 811 ERROR_CALLBACK_INVOKE_INLINE syscall.Errno = 812 ERROR_CPU_SET_INVALID syscall.Errno = 813 ERROR_ENCLAVE_NOT_TERMINATED syscall.Errno = 814 ERROR_ENCLAVE_VIOLATION syscall.Errno = 815 ERROR_EA_ACCESS_DENIED syscall.Errno = 994 ERROR_OPERATION_ABORTED syscall.Errno = 995 ERROR_IO_INCOMPLETE syscall.Errno = 996 ERROR_IO_PENDING syscall.Errno = 997 ERROR_NOACCESS syscall.Errno = 998 ERROR_SWAPERROR syscall.Errno = 999 ERROR_STACK_OVERFLOW syscall.Errno = 1001 ERROR_INVALID_MESSAGE syscall.Errno = 1002 ERROR_CAN_NOT_COMPLETE syscall.Errno = 1003 ERROR_INVALID_FLAGS syscall.Errno = 1004 ERROR_UNRECOGNIZED_VOLUME syscall.Errno = 1005 ERROR_FILE_INVALID syscall.Errno = 1006 ERROR_FULLSCREEN_MODE syscall.Errno = 1007 ERROR_NO_TOKEN syscall.Errno = 1008 ERROR_BADDB syscall.Errno = 1009 ERROR_BADKEY syscall.Errno = 1010 ERROR_CANTOPEN syscall.Errno = 1011 ERROR_CANTREAD syscall.Errno = 1012 ERROR_CANTWRITE syscall.Errno = 1013 ERROR_REGISTRY_RECOVERED syscall.Errno = 1014 ERROR_REGISTRY_CORRUPT syscall.Errno = 1015 ERROR_REGISTRY_IO_FAILED syscall.Errno = 1016 ERROR_NOT_REGISTRY_FILE syscall.Errno = 1017 ERROR_KEY_DELETED syscall.Errno = 1018 ERROR_NO_LOG_SPACE syscall.Errno = 1019 ERROR_KEY_HAS_CHILDREN syscall.Errno = 1020 ERROR_CHILD_MUST_BE_VOLATILE syscall.Errno = 1021 ERROR_NOTIFY_ENUM_DIR syscall.Errno = 1022 ERROR_DEPENDENT_SERVICES_RUNNING syscall.Errno = 1051 ERROR_INVALID_SERVICE_CONTROL syscall.Errno = 1052 ERROR_SERVICE_REQUEST_TIMEOUT syscall.Errno = 1053 ERROR_SERVICE_NO_THREAD syscall.Errno = 1054 ERROR_SERVICE_DATABASE_LOCKED syscall.Errno = 1055 ERROR_SERVICE_ALREADY_RUNNING syscall.Errno = 1056 ERROR_INVALID_SERVICE_ACCOUNT syscall.Errno = 1057 ERROR_SERVICE_DISABLED syscall.Errno = 1058 ERROR_CIRCULAR_DEPENDENCY syscall.Errno = 1059 ERROR_SERVICE_DOES_NOT_EXIST syscall.Errno = 1060 ERROR_SERVICE_CANNOT_ACCEPT_CTRL syscall.Errno = 1061 ERROR_SERVICE_NOT_ACTIVE syscall.Errno = 1062 ERROR_FAILED_SERVICE_CONTROLLER_CONNECT syscall.Errno = 1063 ERROR_EXCEPTION_IN_SERVICE syscall.Errno = 1064 ERROR_DATABASE_DOES_NOT_EXIST syscall.Errno = 1065 ERROR_SERVICE_SPECIFIC_ERROR syscall.Errno = 1066 ERROR_PROCESS_ABORTED syscall.Errno = 1067 ERROR_SERVICE_DEPENDENCY_FAIL syscall.Errno = 1068 ERROR_SERVICE_LOGON_FAILED syscall.Errno = 1069 ERROR_SERVICE_START_HANG syscall.Errno = 1070 ERROR_INVALID_SERVICE_LOCK syscall.Errno = 1071 ERROR_SERVICE_MARKED_FOR_DELETE syscall.Errno = 1072 ERROR_SERVICE_EXISTS syscall.Errno = 1073 ERROR_ALREADY_RUNNING_LKG syscall.Errno = 1074 ERROR_SERVICE_DEPENDENCY_DELETED syscall.Errno = 1075 ERROR_BOOT_ALREADY_ACCEPTED syscall.Errno = 1076 ERROR_SERVICE_NEVER_STARTED syscall.Errno = 1077 ERROR_DUPLICATE_SERVICE_NAME syscall.Errno = 1078 ERROR_DIFFERENT_SERVICE_ACCOUNT syscall.Errno = 1079 ERROR_CANNOT_DETECT_DRIVER_FAILURE syscall.Errno = 1080 ERROR_CANNOT_DETECT_PROCESS_ABORT syscall.Errno = 1081 ERROR_NO_RECOVERY_PROGRAM syscall.Errno = 1082 ERROR_SERVICE_NOT_IN_EXE syscall.Errno = 1083 ERROR_NOT_SAFEBOOT_SERVICE syscall.Errno = 1084 ERROR_END_OF_MEDIA syscall.Errno = 1100 ERROR_FILEMARK_DETECTED syscall.Errno = 1101 ERROR_BEGINNING_OF_MEDIA syscall.Errno = 1102 ERROR_SETMARK_DETECTED syscall.Errno = 1103 ERROR_NO_DATA_DETECTED syscall.Errno = 1104 ERROR_PARTITION_FAILURE syscall.Errno = 1105 ERROR_INVALID_BLOCK_LENGTH syscall.Errno = 1106 ERROR_DEVICE_NOT_PARTITIONED syscall.Errno = 1107 ERROR_UNABLE_TO_LOCK_MEDIA syscall.Errno = 1108 ERROR_UNABLE_TO_UNLOAD_MEDIA syscall.Errno = 1109 ERROR_MEDIA_CHANGED syscall.Errno = 1110 ERROR_BUS_RESET syscall.Errno = 1111 ERROR_NO_MEDIA_IN_DRIVE syscall.Errno = 1112 ERROR_NO_UNICODE_TRANSLATION syscall.Errno = 1113 ERROR_DLL_INIT_FAILED syscall.Errno = 1114 ERROR_SHUTDOWN_IN_PROGRESS syscall.Errno = 1115 ERROR_NO_SHUTDOWN_IN_PROGRESS syscall.Errno = 1116 ERROR_IO_DEVICE syscall.Errno = 1117 ERROR_SERIAL_NO_DEVICE syscall.Errno = 1118 ERROR_IRQ_BUSY syscall.Errno = 1119 ERROR_MORE_WRITES syscall.Errno = 1120 ERROR_COUNTER_TIMEOUT syscall.Errno = 1121 ERROR_FLOPPY_ID_MARK_NOT_FOUND syscall.Errno = 1122 ERROR_FLOPPY_WRONG_CYLINDER syscall.Errno = 1123 ERROR_FLOPPY_UNKNOWN_ERROR syscall.Errno = 1124 ERROR_FLOPPY_BAD_REGISTERS syscall.Errno = 1125 ERROR_DISK_RECALIBRATE_FAILED syscall.Errno = 1126 ERROR_DISK_OPERATION_FAILED syscall.Errno = 1127 ERROR_DISK_RESET_FAILED syscall.Errno = 1128 ERROR_EOM_OVERFLOW syscall.Errno = 1129 ERROR_NOT_ENOUGH_SERVER_MEMORY syscall.Errno = 1130 ERROR_POSSIBLE_DEADLOCK syscall.Errno = 1131 ERROR_MAPPED_ALIGNMENT syscall.Errno = 1132 ERROR_SET_POWER_STATE_VETOED syscall.Errno = 1140 ERROR_SET_POWER_STATE_FAILED syscall.Errno = 1141 ERROR_TOO_MANY_LINKS syscall.Errno = 1142 ERROR_OLD_WIN_VERSION syscall.Errno = 1150 ERROR_APP_WRONG_OS syscall.Errno = 1151 ERROR_SINGLE_INSTANCE_APP syscall.Errno = 1152 ERROR_RMODE_APP syscall.Errno = 1153 ERROR_INVALID_DLL syscall.Errno = 1154 ERROR_NO_ASSOCIATION syscall.Errno = 1155 ERROR_DDE_FAIL syscall.Errno = 1156 ERROR_DLL_NOT_FOUND syscall.Errno = 1157 ERROR_NO_MORE_USER_HANDLES syscall.Errno = 1158 ERROR_MESSAGE_SYNC_ONLY syscall.Errno = 1159 ERROR_SOURCE_ELEMENT_EMPTY syscall.Errno = 1160 ERROR_DESTINATION_ELEMENT_FULL syscall.Errno = 1161 ERROR_ILLEGAL_ELEMENT_ADDRESS syscall.Errno = 1162 ERROR_MAGAZINE_NOT_PRESENT syscall.Errno = 1163 ERROR_DEVICE_REINITIALIZATION_NEEDED syscall.Errno = 1164 ERROR_DEVICE_REQUIRES_CLEANING syscall.Errno = 1165 ERROR_DEVICE_DOOR_OPEN syscall.Errno = 1166 ERROR_DEVICE_NOT_CONNECTED syscall.Errno = 1167 ERROR_NOT_FOUND syscall.Errno = 1168 ERROR_NO_MATCH syscall.Errno = 1169 ERROR_SET_NOT_FOUND syscall.Errno = 1170 ERROR_POINT_NOT_FOUND syscall.Errno = 1171 ERROR_NO_TRACKING_SERVICE syscall.Errno = 1172 ERROR_NO_VOLUME_ID syscall.Errno = 1173 ERROR_UNABLE_TO_REMOVE_REPLACED syscall.Errno = 1175 ERROR_UNABLE_TO_MOVE_REPLACEMENT syscall.Errno = 1176 ERROR_UNABLE_TO_MOVE_REPLACEMENT_2 syscall.Errno = 1177 ERROR_JOURNAL_DELETE_IN_PROGRESS syscall.Errno = 1178 ERROR_JOURNAL_NOT_ACTIVE syscall.Errno = 1179 ERROR_POTENTIAL_FILE_FOUND syscall.Errno = 1180 ERROR_JOURNAL_ENTRY_DELETED syscall.Errno = 1181 ERROR_SHUTDOWN_IS_SCHEDULED syscall.Errno = 1190 ERROR_SHUTDOWN_USERS_LOGGED_ON syscall.Errno = 1191 ERROR_BAD_DEVICE syscall.Errno = 1200 ERROR_CONNECTION_UNAVAIL syscall.Errno = 1201 ERROR_DEVICE_ALREADY_REMEMBERED syscall.Errno = 1202 ERROR_NO_NET_OR_BAD_PATH syscall.Errno = 1203 ERROR_BAD_PROVIDER syscall.Errno = 1204 ERROR_CANNOT_OPEN_PROFILE syscall.Errno = 1205 ERROR_BAD_PROFILE syscall.Errno = 1206 ERROR_NOT_CONTAINER syscall.Errno = 1207 ERROR_EXTENDED_ERROR syscall.Errno = 1208 ERROR_INVALID_GROUPNAME syscall.Errno = 1209 ERROR_INVALID_COMPUTERNAME syscall.Errno = 1210 ERROR_INVALID_EVENTNAME syscall.Errno = 1211 ERROR_INVALID_DOMAINNAME syscall.Errno = 1212 ERROR_INVALID_SERVICENAME syscall.Errno = 1213 ERROR_INVALID_NETNAME syscall.Errno = 1214 ERROR_INVALID_SHARENAME syscall.Errno = 1215 ERROR_INVALID_PASSWORDNAME syscall.Errno = 1216 ERROR_INVALID_MESSAGENAME syscall.Errno = 1217 ERROR_INVALID_MESSAGEDEST syscall.Errno = 1218 ERROR_SESSION_CREDENTIAL_CONFLICT syscall.Errno = 1219 ERROR_REMOTE_SESSION_LIMIT_EXCEEDED syscall.Errno = 1220 ERROR_DUP_DOMAINNAME syscall.Errno = 1221 ERROR_NO_NETWORK syscall.Errno = 1222 ERROR_CANCELLED syscall.Errno = 1223 ERROR_USER_MAPPED_FILE syscall.Errno = 1224 ERROR_CONNECTION_REFUSED syscall.Errno = 1225 ERROR_GRACEFUL_DISCONNECT syscall.Errno = 1226 ERROR_ADDRESS_ALREADY_ASSOCIATED syscall.Errno = 1227 ERROR_ADDRESS_NOT_ASSOCIATED syscall.Errno = 1228 ERROR_CONNECTION_INVALID syscall.Errno = 1229 ERROR_CONNECTION_ACTIVE syscall.Errno = 1230 ERROR_NETWORK_UNREACHABLE syscall.Errno = 1231 ERROR_HOST_UNREACHABLE syscall.Errno = 1232 ERROR_PROTOCOL_UNREACHABLE syscall.Errno = 1233 ERROR_PORT_UNREACHABLE syscall.Errno = 1234 ERROR_REQUEST_ABORTED syscall.Errno = 1235 ERROR_CONNECTION_ABORTED syscall.Errno = 1236 ERROR_RETRY syscall.Errno = 1237 ERROR_CONNECTION_COUNT_LIMIT syscall.Errno = 1238 ERROR_LOGIN_TIME_RESTRICTION syscall.Errno = 1239 ERROR_LOGIN_WKSTA_RESTRICTION syscall.Errno = 1240 ERROR_INCORRECT_ADDRESS syscall.Errno = 1241 ERROR_ALREADY_REGISTERED syscall.Errno = 1242 ERROR_SERVICE_NOT_FOUND syscall.Errno = 1243 ERROR_NOT_AUTHENTICATED syscall.Errno = 1244 ERROR_NOT_LOGGED_ON syscall.Errno = 1245 ERROR_CONTINUE syscall.Errno = 1246 ERROR_ALREADY_INITIALIZED syscall.Errno = 1247 ERROR_NO_MORE_DEVICES syscall.Errno = 1248 ERROR_NO_SUCH_SITE syscall.Errno = 1249 ERROR_DOMAIN_CONTROLLER_EXISTS syscall.Errno = 1250 ERROR_ONLY_IF_CONNECTED syscall.Errno = 1251 ERROR_OVERRIDE_NOCHANGES syscall.Errno = 1252 ERROR_BAD_USER_PROFILE syscall.Errno = 1253 ERROR_NOT_SUPPORTED_ON_SBS syscall.Errno = 1254 ERROR_SERVER_SHUTDOWN_IN_PROGRESS syscall.Errno = 1255 ERROR_HOST_DOWN syscall.Errno = 1256 ERROR_NON_ACCOUNT_SID syscall.Errno = 1257 ERROR_NON_DOMAIN_SID syscall.Errno = 1258 ERROR_APPHELP_BLOCK syscall.Errno = 1259 ERROR_ACCESS_DISABLED_BY_POLICY syscall.Errno = 1260 ERROR_REG_NAT_CONSUMPTION syscall.Errno = 1261 ERROR_CSCSHARE_OFFLINE syscall.Errno = 1262 ERROR_PKINIT_FAILURE syscall.Errno = 1263 ERROR_SMARTCARD_SUBSYSTEM_FAILURE syscall.Errno = 1264 ERROR_DOWNGRADE_DETECTED syscall.Errno = 1265 ERROR_MACHINE_LOCKED syscall.Errno = 1271 ERROR_SMB_GUEST_LOGON_BLOCKED syscall.Errno = 1272 ERROR_CALLBACK_SUPPLIED_INVALID_DATA syscall.Errno = 1273 ERROR_SYNC_FOREGROUND_REFRESH_REQUIRED syscall.Errno = 1274 ERROR_DRIVER_BLOCKED syscall.Errno = 1275 ERROR_INVALID_IMPORT_OF_NON_DLL syscall.Errno = 1276 ERROR_ACCESS_DISABLED_WEBBLADE syscall.Errno = 1277 ERROR_ACCESS_DISABLED_WEBBLADE_TAMPER syscall.Errno = 1278 ERROR_RECOVERY_FAILURE syscall.Errno = 1279 ERROR_ALREADY_FIBER syscall.Errno = 1280 ERROR_ALREADY_THREAD syscall.Errno = 1281 ERROR_STACK_BUFFER_OVERRUN syscall.Errno = 1282 ERROR_PARAMETER_QUOTA_EXCEEDED syscall.Errno = 1283 ERROR_DEBUGGER_INACTIVE syscall.Errno = 1284 ERROR_DELAY_LOAD_FAILED syscall.Errno = 1285 ERROR_VDM_DISALLOWED syscall.Errno = 1286 ERROR_UNIDENTIFIED_ERROR syscall.Errno = 1287 ERROR_INVALID_CRUNTIME_PARAMETER syscall.Errno = 1288 ERROR_BEYOND_VDL syscall.Errno = 1289 ERROR_INCOMPATIBLE_SERVICE_SID_TYPE syscall.Errno = 1290 ERROR_DRIVER_PROCESS_TERMINATED syscall.Errno = 1291 ERROR_IMPLEMENTATION_LIMIT syscall.Errno = 1292 ERROR_PROCESS_IS_PROTECTED syscall.Errno = 1293 ERROR_SERVICE_NOTIFY_CLIENT_LAGGING syscall.Errno = 1294 ERROR_DISK_QUOTA_EXCEEDED syscall.Errno = 1295 ERROR_CONTENT_BLOCKED syscall.Errno = 1296 ERROR_INCOMPATIBLE_SERVICE_PRIVILEGE syscall.Errno = 1297 ERROR_APP_HANG syscall.Errno = 1298 ERROR_INVALID_LABEL syscall.Errno = 1299 ERROR_NOT_ALL_ASSIGNED syscall.Errno = 1300 ERROR_SOME_NOT_MAPPED syscall.Errno = 1301 ERROR_NO_QUOTAS_FOR_ACCOUNT syscall.Errno = 1302 ERROR_LOCAL_USER_SESSION_KEY syscall.Errno = 1303 ERROR_NULL_LM_PASSWORD syscall.Errno = 1304 ERROR_UNKNOWN_REVISION syscall.Errno = 1305 ERROR_REVISION_MISMATCH syscall.Errno = 1306 ERROR_INVALID_OWNER syscall.Errno = 1307 ERROR_INVALID_PRIMARY_GROUP syscall.Errno = 1308 ERROR_NO_IMPERSONATION_TOKEN syscall.Errno = 1309 ERROR_CANT_DISABLE_MANDATORY syscall.Errno = 1310 ERROR_NO_LOGON_SERVERS syscall.Errno = 1311 ERROR_NO_SUCH_LOGON_SESSION syscall.Errno = 1312 ERROR_NO_SUCH_PRIVILEGE syscall.Errno = 1313 ERROR_PRIVILEGE_NOT_HELD syscall.Errno = 1314 ERROR_INVALID_ACCOUNT_NAME syscall.Errno = 1315 ERROR_USER_EXISTS syscall.Errno = 1316 ERROR_NO_SUCH_USER syscall.Errno = 1317 ERROR_GROUP_EXISTS syscall.Errno = 1318 ERROR_NO_SUCH_GROUP syscall.Errno = 1319 ERROR_MEMBER_IN_GROUP syscall.Errno = 1320 ERROR_MEMBER_NOT_IN_GROUP syscall.Errno = 1321 ERROR_LAST_ADMIN syscall.Errno = 1322 ERROR_WRONG_PASSWORD syscall.Errno = 1323 ERROR_ILL_FORMED_PASSWORD syscall.Errno = 1324 ERROR_PASSWORD_RESTRICTION syscall.Errno = 1325 ERROR_LOGON_FAILURE syscall.Errno = 1326 ERROR_ACCOUNT_RESTRICTION syscall.Errno = 1327 ERROR_INVALID_LOGON_HOURS syscall.Errno = 1328 ERROR_INVALID_WORKSTATION syscall.Errno = 1329 ERROR_PASSWORD_EXPIRED syscall.Errno = 1330 ERROR_ACCOUNT_DISABLED syscall.Errno = 1331 ERROR_NONE_MAPPED syscall.Errno = 1332 ERROR_TOO_MANY_LUIDS_REQUESTED syscall.Errno = 1333 ERROR_LUIDS_EXHAUSTED syscall.Errno = 1334 ERROR_INVALID_SUB_AUTHORITY syscall.Errno = 1335 ERROR_INVALID_ACL syscall.Errno = 1336 ERROR_INVALID_SID syscall.Errno = 1337 ERROR_INVALID_SECURITY_DESCR syscall.Errno = 1338 ERROR_BAD_INHERITANCE_ACL syscall.Errno = 1340 ERROR_SERVER_DISABLED syscall.Errno = 1341 ERROR_SERVER_NOT_DISABLED syscall.Errno = 1342 ERROR_INVALID_ID_AUTHORITY syscall.Errno = 1343 ERROR_ALLOTTED_SPACE_EXCEEDED syscall.Errno = 1344 ERROR_INVALID_GROUP_ATTRIBUTES syscall.Errno = 1345 ERROR_BAD_IMPERSONATION_LEVEL syscall.Errno = 1346 ERROR_CANT_OPEN_ANONYMOUS syscall.Errno = 1347 ERROR_BAD_VALIDATION_CLASS syscall.Errno = 1348 ERROR_BAD_TOKEN_TYPE syscall.Errno = 1349 ERROR_NO_SECURITY_ON_OBJECT syscall.Errno = 1350 ERROR_CANT_ACCESS_DOMAIN_INFO syscall.Errno = 1351 ERROR_INVALID_SERVER_STATE syscall.Errno = 1352 ERROR_INVALID_DOMAIN_STATE syscall.Errno = 1353 ERROR_INVALID_DOMAIN_ROLE syscall.Errno = 1354 ERROR_NO_SUCH_DOMAIN syscall.Errno = 1355 ERROR_DOMAIN_EXISTS syscall.Errno = 1356 ERROR_DOMAIN_LIMIT_EXCEEDED syscall.Errno = 1357 ERROR_INTERNAL_DB_CORRUPTION syscall.Errno = 1358 ERROR_INTERNAL_ERROR syscall.Errno = 1359 ERROR_GENERIC_NOT_MAPPED syscall.Errno = 1360 ERROR_BAD_DESCRIPTOR_FORMAT syscall.Errno = 1361 ERROR_NOT_LOGON_PROCESS syscall.Errno = 1362 ERROR_LOGON_SESSION_EXISTS syscall.Errno = 1363 ERROR_NO_SUCH_PACKAGE syscall.Errno = 1364 ERROR_BAD_LOGON_SESSION_STATE syscall.Errno = 1365 ERROR_LOGON_SESSION_COLLISION syscall.Errno = 1366 ERROR_INVALID_LOGON_TYPE syscall.Errno = 1367 ERROR_CANNOT_IMPERSONATE syscall.Errno = 1368 ERROR_RXACT_INVALID_STATE syscall.Errno = 1369 ERROR_RXACT_COMMIT_FAILURE syscall.Errno = 1370 ERROR_SPECIAL_ACCOUNT syscall.Errno = 1371 ERROR_SPECIAL_GROUP syscall.Errno = 1372 ERROR_SPECIAL_USER syscall.Errno = 1373 ERROR_MEMBERS_PRIMARY_GROUP syscall.Errno = 1374 ERROR_TOKEN_ALREADY_IN_USE syscall.Errno = 1375 ERROR_NO_SUCH_ALIAS syscall.Errno = 1376 ERROR_MEMBER_NOT_IN_ALIAS syscall.Errno = 1377 ERROR_MEMBER_IN_ALIAS syscall.Errno = 1378 ERROR_ALIAS_EXISTS syscall.Errno = 1379 ERROR_LOGON_NOT_GRANTED syscall.Errno = 1380 ERROR_TOO_MANY_SECRETS syscall.Errno = 1381 ERROR_SECRET_TOO_LONG syscall.Errno = 1382 ERROR_INTERNAL_DB_ERROR syscall.Errno = 1383 ERROR_TOO_MANY_CONTEXT_IDS syscall.Errno = 1384 ERROR_LOGON_TYPE_NOT_GRANTED syscall.Errno = 1385 ERROR_NT_CROSS_ENCRYPTION_REQUIRED syscall.Errno = 1386 ERROR_NO_SUCH_MEMBER syscall.Errno = 1387 ERROR_INVALID_MEMBER syscall.Errno = 1388 ERROR_TOO_MANY_SIDS syscall.Errno = 1389 ERROR_LM_CROSS_ENCRYPTION_REQUIRED syscall.Errno = 1390 ERROR_NO_INHERITANCE syscall.Errno = 1391 ERROR_FILE_CORRUPT syscall.Errno = 1392 ERROR_DISK_CORRUPT syscall.Errno = 1393 ERROR_NO_USER_SESSION_KEY syscall.Errno = 1394 ERROR_LICENSE_QUOTA_EXCEEDED syscall.Errno = 1395 ERROR_WRONG_TARGET_NAME syscall.Errno = 1396 ERROR_MUTUAL_AUTH_FAILED syscall.Errno = 1397 ERROR_TIME_SKEW syscall.Errno = 1398 ERROR_CURRENT_DOMAIN_NOT_ALLOWED syscall.Errno = 1399 ERROR_INVALID_WINDOW_HANDLE syscall.Errno = 1400 ERROR_INVALID_MENU_HANDLE syscall.Errno = 1401 ERROR_INVALID_CURSOR_HANDLE syscall.Errno = 1402 ERROR_INVALID_ACCEL_HANDLE syscall.Errno = 1403 ERROR_INVALID_HOOK_HANDLE syscall.Errno = 1404 ERROR_INVALID_DWP_HANDLE syscall.Errno = 1405 ERROR_TLW_WITH_WSCHILD syscall.Errno = 1406 ERROR_CANNOT_FIND_WND_CLASS syscall.Errno = 1407 ERROR_WINDOW_OF_OTHER_THREAD syscall.Errno = 1408 ERROR_HOTKEY_ALREADY_REGISTERED syscall.Errno = 1409 ERROR_CLASS_ALREADY_EXISTS syscall.Errno = 1410 ERROR_CLASS_DOES_NOT_EXIST syscall.Errno = 1411 ERROR_CLASS_HAS_WINDOWS syscall.Errno = 1412 ERROR_INVALID_INDEX syscall.Errno = 1413 ERROR_INVALID_ICON_HANDLE syscall.Errno = 1414 ERROR_PRIVATE_DIALOG_INDEX syscall.Errno = 1415 ERROR_LISTBOX_ID_NOT_FOUND syscall.Errno = 1416 ERROR_NO_WILDCARD_CHARACTERS syscall.Errno = 1417 ERROR_CLIPBOARD_NOT_OPEN syscall.Errno = 1418 ERROR_HOTKEY_NOT_REGISTERED syscall.Errno = 1419 ERROR_WINDOW_NOT_DIALOG syscall.Errno = 1420 ERROR_CONTROL_ID_NOT_FOUND syscall.Errno = 1421 ERROR_INVALID_COMBOBOX_MESSAGE syscall.Errno = 1422 ERROR_WINDOW_NOT_COMBOBOX syscall.Errno = 1423 ERROR_INVALID_EDIT_HEIGHT syscall.Errno = 1424 ERROR_DC_NOT_FOUND syscall.Errno = 1425 ERROR_INVALID_HOOK_FILTER syscall.Errno = 1426 ERROR_INVALID_FILTER_PROC syscall.Errno = 1427 ERROR_HOOK_NEEDS_HMOD syscall.Errno = 1428 ERROR_GLOBAL_ONLY_HOOK syscall.Errno = 1429 ERROR_JOURNAL_HOOK_SET syscall.Errno = 1430 ERROR_HOOK_NOT_INSTALLED syscall.Errno = 1431 ERROR_INVALID_LB_MESSAGE syscall.Errno = 1432 ERROR_SETCOUNT_ON_BAD_LB syscall.Errno = 1433 ERROR_LB_WITHOUT_TABSTOPS syscall.Errno = 1434 ERROR_DESTROY_OBJECT_OF_OTHER_THREAD syscall.Errno = 1435 ERROR_CHILD_WINDOW_MENU syscall.Errno = 1436 ERROR_NO_SYSTEM_MENU syscall.Errno = 1437 ERROR_INVALID_MSGBOX_STYLE syscall.Errno = 1438 ERROR_INVALID_SPI_VALUE syscall.Errno = 1439 ERROR_SCREEN_ALREADY_LOCKED syscall.Errno = 1440 ERROR_HWNDS_HAVE_DIFF_PARENT syscall.Errno = 1441 ERROR_NOT_CHILD_WINDOW syscall.Errno = 1442 ERROR_INVALID_GW_COMMAND syscall.Errno = 1443 ERROR_INVALID_THREAD_ID syscall.Errno = 1444 ERROR_NON_MDICHILD_WINDOW syscall.Errno = 1445 ERROR_POPUP_ALREADY_ACTIVE syscall.Errno = 1446 ERROR_NO_SCROLLBARS syscall.Errno = 1447 ERROR_INVALID_SCROLLBAR_RANGE syscall.Errno = 1448 ERROR_INVALID_SHOWWIN_COMMAND syscall.Errno = 1449 ERROR_NO_SYSTEM_RESOURCES syscall.Errno = 1450 ERROR_NONPAGED_SYSTEM_RESOURCES syscall.Errno = 1451 ERROR_PAGED_SYSTEM_RESOURCES syscall.Errno = 1452 ERROR_WORKING_SET_QUOTA syscall.Errno = 1453 ERROR_PAGEFILE_QUOTA syscall.Errno = 1454 ERROR_COMMITMENT_LIMIT syscall.Errno = 1455 ERROR_MENU_ITEM_NOT_FOUND syscall.Errno = 1456 ERROR_INVALID_KEYBOARD_HANDLE syscall.Errno = 1457 ERROR_HOOK_TYPE_NOT_ALLOWED syscall.Errno = 1458 ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION syscall.Errno = 1459 ERROR_TIMEOUT syscall.Errno = 1460 ERROR_INVALID_MONITOR_HANDLE syscall.Errno = 1461 ERROR_INCORRECT_SIZE syscall.Errno = 1462 ERROR_SYMLINK_CLASS_DISABLED syscall.Errno = 1463 ERROR_SYMLINK_NOT_SUPPORTED syscall.Errno = 1464 ERROR_XML_PARSE_ERROR syscall.Errno = 1465 ERROR_XMLDSIG_ERROR syscall.Errno = 1466 ERROR_RESTART_APPLICATION syscall.Errno = 1467 ERROR_WRONG_COMPARTMENT syscall.Errno = 1468 ERROR_AUTHIP_FAILURE syscall.Errno = 1469 ERROR_NO_NVRAM_RESOURCES syscall.Errno = 1470 ERROR_NOT_GUI_PROCESS syscall.Errno = 1471 ERROR_EVENTLOG_FILE_CORRUPT syscall.Errno = 1500 ERROR_EVENTLOG_CANT_START syscall.Errno = 1501 ERROR_LOG_FILE_FULL syscall.Errno = 1502 ERROR_EVENTLOG_FILE_CHANGED syscall.Errno = 1503 ERROR_CONTAINER_ASSIGNED syscall.Errno = 1504 ERROR_JOB_NO_CONTAINER syscall.Errno = 1505 ERROR_INVALID_TASK_NAME syscall.Errno = 1550 ERROR_INVALID_TASK_INDEX syscall.Errno = 1551 ERROR_THREAD_ALREADY_IN_TASK syscall.Errno = 1552 ERROR_INSTALL_SERVICE_FAILURE syscall.Errno = 1601 ERROR_INSTALL_USEREXIT syscall.Errno = 1602 ERROR_INSTALL_FAILURE syscall.Errno = 1603 ERROR_INSTALL_SUSPEND syscall.Errno = 1604 ERROR_UNKNOWN_PRODUCT syscall.Errno = 1605 ERROR_UNKNOWN_FEATURE syscall.Errno = 1606 ERROR_UNKNOWN_COMPONENT syscall.Errno = 1607 ERROR_UNKNOWN_PROPERTY syscall.Errno = 1608 ERROR_INVALID_HANDLE_STATE syscall.Errno = 1609 ERROR_BAD_CONFIGURATION syscall.Errno = 1610 ERROR_INDEX_ABSENT syscall.Errno = 1611 ERROR_INSTALL_SOURCE_ABSENT syscall.Errno = 1612 ERROR_INSTALL_PACKAGE_VERSION syscall.Errno = 1613 ERROR_PRODUCT_UNINSTALLED syscall.Errno = 1614 ERROR_BAD_QUERY_SYNTAX syscall.Errno = 1615 ERROR_INVALID_FIELD syscall.Errno = 1616 ERROR_DEVICE_REMOVED syscall.Errno = 1617 ERROR_INSTALL_ALREADY_RUNNING syscall.Errno = 1618 ERROR_INSTALL_PACKAGE_OPEN_FAILED syscall.Errno = 1619 ERROR_INSTALL_PACKAGE_INVALID syscall.Errno = 1620 ERROR_INSTALL_UI_FAILURE syscall.Errno = 1621 ERROR_INSTALL_LOG_FAILURE syscall.Errno = 1622 ERROR_INSTALL_LANGUAGE_UNSUPPORTED syscall.Errno = 1623 ERROR_INSTALL_TRANSFORM_FAILURE syscall.Errno = 1624 ERROR_INSTALL_PACKAGE_REJECTED syscall.Errno = 1625 ERROR_FUNCTION_NOT_CALLED syscall.Errno = 1626 ERROR_FUNCTION_FAILED syscall.Errno = 1627 ERROR_INVALID_TABLE syscall.Errno = 1628 ERROR_DATATYPE_MISMATCH syscall.Errno = 1629 ERROR_UNSUPPORTED_TYPE syscall.Errno = 1630 ERROR_CREATE_FAILED syscall.Errno = 1631 ERROR_INSTALL_TEMP_UNWRITABLE syscall.Errno = 1632 ERROR_INSTALL_PLATFORM_UNSUPPORTED syscall.Errno = 1633 ERROR_INSTALL_NOTUSED syscall.Errno = 1634 ERROR_PATCH_PACKAGE_OPEN_FAILED syscall.Errno = 1635 ERROR_PATCH_PACKAGE_INVALID syscall.Errno = 1636 ERROR_PATCH_PACKAGE_UNSUPPORTED syscall.Errno = 1637 ERROR_PRODUCT_VERSION syscall.Errno = 1638 ERROR_INVALID_COMMAND_LINE syscall.Errno = 1639 ERROR_INSTALL_REMOTE_DISALLOWED syscall.Errno = 1640 ERROR_SUCCESS_REBOOT_INITIATED syscall.Errno = 1641 ERROR_PATCH_TARGET_NOT_FOUND syscall.Errno = 1642 ERROR_PATCH_PACKAGE_REJECTED syscall.Errno = 1643 ERROR_INSTALL_TRANSFORM_REJECTED syscall.Errno = 1644 ERROR_INSTALL_REMOTE_PROHIBITED syscall.Errno = 1645 ERROR_PATCH_REMOVAL_UNSUPPORTED syscall.Errno = 1646 ERROR_UNKNOWN_PATCH syscall.Errno = 1647 ERROR_PATCH_NO_SEQUENCE syscall.Errno = 1648 ERROR_PATCH_REMOVAL_DISALLOWED syscall.Errno = 1649 ERROR_INVALID_PATCH_XML syscall.Errno = 1650 ERROR_PATCH_MANAGED_ADVERTISED_PRODUCT syscall.Errno = 1651 ERROR_INSTALL_SERVICE_SAFEBOOT syscall.Errno = 1652 ERROR_FAIL_FAST_EXCEPTION syscall.Errno = 1653 ERROR_INSTALL_REJECTED syscall.Errno = 1654 ERROR_DYNAMIC_CODE_BLOCKED syscall.Errno = 1655 ERROR_NOT_SAME_OBJECT syscall.Errno = 1656 ERROR_STRICT_CFG_VIOLATION syscall.Errno = 1657 ERROR_SET_CONTEXT_DENIED syscall.Errno = 1660 ERROR_CROSS_PARTITION_VIOLATION syscall.Errno = 1661 RPC_S_INVALID_STRING_BINDING syscall.Errno = 1700 RPC_S_WRONG_KIND_OF_BINDING syscall.Errno = 1701 RPC_S_INVALID_BINDING syscall.Errno = 1702 RPC_S_PROTSEQ_NOT_SUPPORTED syscall.Errno = 1703 RPC_S_INVALID_RPC_PROTSEQ syscall.Errno = 1704 RPC_S_INVALID_STRING_UUID syscall.Errno = 1705 RPC_S_INVALID_ENDPOINT_FORMAT syscall.Errno = 1706 RPC_S_INVALID_NET_ADDR syscall.Errno = 1707 RPC_S_NO_ENDPOINT_FOUND syscall.Errno = 1708 RPC_S_INVALID_TIMEOUT syscall.Errno = 1709 RPC_S_OBJECT_NOT_FOUND syscall.Errno = 1710 RPC_S_ALREADY_REGISTERED syscall.Errno = 1711 RPC_S_TYPE_ALREADY_REGISTERED syscall.Errno = 1712 RPC_S_ALREADY_LISTENING syscall.Errno = 1713 RPC_S_NO_PROTSEQS_REGISTERED syscall.Errno = 1714 RPC_S_NOT_LISTENING syscall.Errno = 1715 RPC_S_UNKNOWN_MGR_TYPE syscall.Errno = 1716 RPC_S_UNKNOWN_IF syscall.Errno = 1717 RPC_S_NO_BINDINGS syscall.Errno = 1718 RPC_S_NO_PROTSEQS syscall.Errno = 1719 RPC_S_CANT_CREATE_ENDPOINT syscall.Errno = 1720 RPC_S_OUT_OF_RESOURCES syscall.Errno = 1721 RPC_S_SERVER_UNAVAILABLE syscall.Errno = 1722 RPC_S_SERVER_TOO_BUSY syscall.Errno = 1723 RPC_S_INVALID_NETWORK_OPTIONS syscall.Errno = 1724 RPC_S_NO_CALL_ACTIVE syscall.Errno = 1725 RPC_S_CALL_FAILED syscall.Errno = 1726 RPC_S_CALL_FAILED_DNE syscall.Errno = 1727 RPC_S_PROTOCOL_ERROR syscall.Errno = 1728 RPC_S_PROXY_ACCESS_DENIED syscall.Errno = 1729 RPC_S_UNSUPPORTED_TRANS_SYN syscall.Errno = 1730 RPC_S_UNSUPPORTED_TYPE syscall.Errno = 1732 RPC_S_INVALID_TAG syscall.Errno = 1733 RPC_S_INVALID_BOUND syscall.Errno = 1734 RPC_S_NO_ENTRY_NAME syscall.Errno = 1735 RPC_S_INVALID_NAME_SYNTAX syscall.Errno = 1736 RPC_S_UNSUPPORTED_NAME_SYNTAX syscall.Errno = 1737 RPC_S_UUID_NO_ADDRESS syscall.Errno = 1739 RPC_S_DUPLICATE_ENDPOINT syscall.Errno = 1740 RPC_S_UNKNOWN_AUTHN_TYPE syscall.Errno = 1741 RPC_S_MAX_CALLS_TOO_SMALL syscall.Errno = 1742 RPC_S_STRING_TOO_LONG syscall.Errno = 1743 RPC_S_PROTSEQ_NOT_FOUND syscall.Errno = 1744 RPC_S_PROCNUM_OUT_OF_RANGE syscall.Errno = 1745 RPC_S_BINDING_HAS_NO_AUTH syscall.Errno = 1746 RPC_S_UNKNOWN_AUTHN_SERVICE syscall.Errno = 1747 RPC_S_UNKNOWN_AUTHN_LEVEL syscall.Errno = 1748 RPC_S_INVALID_AUTH_IDENTITY syscall.Errno = 1749 RPC_S_UNKNOWN_AUTHZ_SERVICE syscall.Errno = 1750 EPT_S_INVALID_ENTRY syscall.Errno = 1751 EPT_S_CANT_PERFORM_OP syscall.Errno = 1752 EPT_S_NOT_REGISTERED syscall.Errno = 1753 RPC_S_NOTHING_TO_EXPORT syscall.Errno = 1754 RPC_S_INCOMPLETE_NAME syscall.Errno = 1755 RPC_S_INVALID_VERS_OPTION syscall.Errno = 1756 RPC_S_NO_MORE_MEMBERS syscall.Errno = 1757 RPC_S_NOT_ALL_OBJS_UNEXPORTED syscall.Errno = 1758 RPC_S_INTERFACE_NOT_FOUND syscall.Errno = 1759 RPC_S_ENTRY_ALREADY_EXISTS syscall.Errno = 1760 RPC_S_ENTRY_NOT_FOUND syscall.Errno = 1761 RPC_S_NAME_SERVICE_UNAVAILABLE syscall.Errno = 1762 RPC_S_INVALID_NAF_ID syscall.Errno = 1763 RPC_S_CANNOT_SUPPORT syscall.Errno = 1764 RPC_S_NO_CONTEXT_AVAILABLE syscall.Errno = 1765 RPC_S_INTERNAL_ERROR syscall.Errno = 1766 RPC_S_ZERO_DIVIDE syscall.Errno = 1767 RPC_S_ADDRESS_ERROR syscall.Errno = 1768 RPC_S_FP_DIV_ZERO syscall.Errno = 1769 RPC_S_FP_UNDERFLOW syscall.Errno = 1770 RPC_S_FP_OVERFLOW syscall.Errno = 1771 RPC_X_NO_MORE_ENTRIES syscall.Errno = 1772 RPC_X_SS_CHAR_TRANS_OPEN_FAIL syscall.Errno = 1773 RPC_X_SS_CHAR_TRANS_SHORT_FILE syscall.Errno = 1774 RPC_X_SS_IN_NULL_CONTEXT syscall.Errno = 1775 RPC_X_SS_CONTEXT_DAMAGED syscall.Errno = 1777 RPC_X_SS_HANDLES_MISMATCH syscall.Errno = 1778 RPC_X_SS_CANNOT_GET_CALL_HANDLE syscall.Errno = 1779 RPC_X_NULL_REF_POINTER syscall.Errno = 1780 RPC_X_ENUM_VALUE_OUT_OF_RANGE syscall.Errno = 1781 RPC_X_BYTE_COUNT_TOO_SMALL syscall.Errno = 1782 RPC_X_BAD_STUB_DATA syscall.Errno = 1783 ERROR_INVALID_USER_BUFFER syscall.Errno = 1784 ERROR_UNRECOGNIZED_MEDIA syscall.Errno = 1785 ERROR_NO_TRUST_LSA_SECRET syscall.Errno = 1786 ERROR_NO_TRUST_SAM_ACCOUNT syscall.Errno = 1787 ERROR_TRUSTED_DOMAIN_FAILURE syscall.Errno = 1788 ERROR_TRUSTED_RELATIONSHIP_FAILURE syscall.Errno = 1789 ERROR_TRUST_FAILURE syscall.Errno = 1790 RPC_S_CALL_IN_PROGRESS syscall.Errno = 1791 ERROR_NETLOGON_NOT_STARTED syscall.Errno = 1792 ERROR_ACCOUNT_EXPIRED syscall.Errno = 1793 ERROR_REDIRECTOR_HAS_OPEN_HANDLES syscall.Errno = 1794 ERROR_PRINTER_DRIVER_ALREADY_INSTALLED syscall.Errno = 1795 ERROR_UNKNOWN_PORT syscall.Errno = 1796 ERROR_UNKNOWN_PRINTER_DRIVER syscall.Errno = 1797 ERROR_UNKNOWN_PRINTPROCESSOR syscall.Errno = 1798 ERROR_INVALID_SEPARATOR_FILE syscall.Errno = 1799 ERROR_INVALID_PRIORITY syscall.Errno = 1800 ERROR_INVALID_PRINTER_NAME syscall.Errno = 1801 ERROR_PRINTER_ALREADY_EXISTS syscall.Errno = 1802 ERROR_INVALID_PRINTER_COMMAND syscall.Errno = 1803 ERROR_INVALID_DATATYPE syscall.Errno = 1804 ERROR_INVALID_ENVIRONMENT syscall.Errno = 1805 RPC_S_NO_MORE_BINDINGS syscall.Errno = 1806 ERROR_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT syscall.Errno = 1807 ERROR_NOLOGON_WORKSTATION_TRUST_ACCOUNT syscall.Errno = 1808 ERROR_NOLOGON_SERVER_TRUST_ACCOUNT syscall.Errno = 1809 ERROR_DOMAIN_TRUST_INCONSISTENT syscall.Errno = 1810 ERROR_SERVER_HAS_OPEN_HANDLES syscall.Errno = 1811 ERROR_RESOURCE_DATA_NOT_FOUND syscall.Errno = 1812 ERROR_RESOURCE_TYPE_NOT_FOUND syscall.Errno = 1813 ERROR_RESOURCE_NAME_NOT_FOUND syscall.Errno = 1814 ERROR_RESOURCE_LANG_NOT_FOUND syscall.Errno = 1815 ERROR_NOT_ENOUGH_QUOTA syscall.Errno = 1816 RPC_S_NO_INTERFACES syscall.Errno = 1817 RPC_S_CALL_CANCELLED syscall.Errno = 1818 RPC_S_BINDING_INCOMPLETE syscall.Errno = 1819 RPC_S_COMM_FAILURE syscall.Errno = 1820 RPC_S_UNSUPPORTED_AUTHN_LEVEL syscall.Errno = 1821 RPC_S_NO_PRINC_NAME syscall.Errno = 1822 RPC_S_NOT_RPC_ERROR syscall.Errno = 1823 RPC_S_UUID_LOCAL_ONLY syscall.Errno = 1824 RPC_S_SEC_PKG_ERROR syscall.Errno = 1825 RPC_S_NOT_CANCELLED syscall.Errno = 1826 RPC_X_INVALID_ES_ACTION syscall.Errno = 1827 RPC_X_WRONG_ES_VERSION syscall.Errno = 1828 RPC_X_WRONG_STUB_VERSION syscall.Errno = 1829 RPC_X_INVALID_PIPE_OBJECT syscall.Errno = 1830 RPC_X_WRONG_PIPE_ORDER syscall.Errno = 1831 RPC_X_WRONG_PIPE_VERSION syscall.Errno = 1832 RPC_S_COOKIE_AUTH_FAILED syscall.Errno = 1833 RPC_S_DO_NOT_DISTURB syscall.Errno = 1834 RPC_S_SYSTEM_HANDLE_COUNT_EXCEEDED syscall.Errno = 1835 RPC_S_SYSTEM_HANDLE_TYPE_MISMATCH syscall.Errno = 1836 RPC_S_GROUP_MEMBER_NOT_FOUND syscall.Errno = 1898 EPT_S_CANT_CREATE syscall.Errno = 1899 RPC_S_INVALID_OBJECT syscall.Errno = 1900 ERROR_INVALID_TIME syscall.Errno = 1901 ERROR_INVALID_FORM_NAME syscall.Errno = 1902 ERROR_INVALID_FORM_SIZE syscall.Errno = 1903 ERROR_ALREADY_WAITING syscall.Errno = 1904 ERROR_PRINTER_DELETED syscall.Errno = 1905 ERROR_INVALID_PRINTER_STATE syscall.Errno = 1906 ERROR_PASSWORD_MUST_CHANGE syscall.Errno = 1907 ERROR_DOMAIN_CONTROLLER_NOT_FOUND syscall.Errno = 1908 ERROR_ACCOUNT_LOCKED_OUT syscall.Errno = 1909 OR_INVALID_OXID syscall.Errno = 1910 OR_INVALID_OID syscall.Errno = 1911 OR_INVALID_SET syscall.Errno = 1912 RPC_S_SEND_INCOMPLETE syscall.Errno = 1913 RPC_S_INVALID_ASYNC_HANDLE syscall.Errno = 1914 RPC_S_INVALID_ASYNC_CALL syscall.Errno = 1915 RPC_X_PIPE_CLOSED syscall.Errno = 1916 RPC_X_PIPE_DISCIPLINE_ERROR syscall.Errno = 1917 RPC_X_PIPE_EMPTY syscall.Errno = 1918 ERROR_NO_SITENAME syscall.Errno = 1919 ERROR_CANT_ACCESS_FILE syscall.Errno = 1920 ERROR_CANT_RESOLVE_FILENAME syscall.Errno = 1921 RPC_S_ENTRY_TYPE_MISMATCH syscall.Errno = 1922 RPC_S_NOT_ALL_OBJS_EXPORTED syscall.Errno = 1923 RPC_S_INTERFACE_NOT_EXPORTED syscall.Errno = 1924 RPC_S_PROFILE_NOT_ADDED syscall.Errno = 1925 RPC_S_PRF_ELT_NOT_ADDED syscall.Errno = 1926 RPC_S_PRF_ELT_NOT_REMOVED syscall.Errno = 1927 RPC_S_GRP_ELT_NOT_ADDED syscall.Errno = 1928 RPC_S_GRP_ELT_NOT_REMOVED syscall.Errno = 1929 ERROR_KM_DRIVER_BLOCKED syscall.Errno = 1930 ERROR_CONTEXT_EXPIRED syscall.Errno = 1931 ERROR_PER_USER_TRUST_QUOTA_EXCEEDED syscall.Errno = 1932 ERROR_ALL_USER_TRUST_QUOTA_EXCEEDED syscall.Errno = 1933 ERROR_USER_DELETE_TRUST_QUOTA_EXCEEDED syscall.Errno = 1934 ERROR_AUTHENTICATION_FIREWALL_FAILED syscall.Errno = 1935 ERROR_REMOTE_PRINT_CONNECTIONS_BLOCKED syscall.Errno = 1936 ERROR_NTLM_BLOCKED syscall.Errno = 1937 ERROR_PASSWORD_CHANGE_REQUIRED syscall.Errno = 1938 ERROR_LOST_MODE_LOGON_RESTRICTION syscall.Errno = 1939 ERROR_INVALID_PIXEL_FORMAT syscall.Errno = 2000 ERROR_BAD_DRIVER syscall.Errno = 2001 ERROR_INVALID_WINDOW_STYLE syscall.Errno = 2002 ERROR_METAFILE_NOT_SUPPORTED syscall.Errno = 2003 ERROR_TRANSFORM_NOT_SUPPORTED syscall.Errno = 2004 ERROR_CLIPPING_NOT_SUPPORTED syscall.Errno = 2005 ERROR_INVALID_CMM syscall.Errno = 2010 ERROR_INVALID_PROFILE syscall.Errno = 2011 ERROR_TAG_NOT_FOUND syscall.Errno = 2012 ERROR_TAG_NOT_PRESENT syscall.Errno = 2013 ERROR_DUPLICATE_TAG syscall.Errno = 2014 ERROR_PROFILE_NOT_ASSOCIATED_WITH_DEVICE syscall.Errno = 2015 ERROR_PROFILE_NOT_FOUND syscall.Errno = 2016 ERROR_INVALID_COLORSPACE syscall.Errno = 2017 ERROR_ICM_NOT_ENABLED syscall.Errno = 2018 ERROR_DELETING_ICM_XFORM syscall.Errno = 2019 ERROR_INVALID_TRANSFORM syscall.Errno = 2020 ERROR_COLORSPACE_MISMATCH syscall.Errno = 2021 ERROR_INVALID_COLORINDEX syscall.Errno = 2022 ERROR_PROFILE_DOES_NOT_MATCH_DEVICE syscall.Errno = 2023 ERROR_CONNECTED_OTHER_PASSWORD syscall.Errno = 2108 ERROR_CONNECTED_OTHER_PASSWORD_DEFAULT syscall.Errno = 2109 ERROR_BAD_USERNAME syscall.Errno = 2202 ERROR_NOT_CONNECTED syscall.Errno = 2250 ERROR_OPEN_FILES syscall.Errno = 2401 ERROR_ACTIVE_CONNECTIONS syscall.Errno = 2402 ERROR_DEVICE_IN_USE syscall.Errno = 2404 ERROR_UNKNOWN_PRINT_MONITOR syscall.Errno = 3000 ERROR_PRINTER_DRIVER_IN_USE syscall.Errno = 3001 ERROR_SPOOL_FILE_NOT_FOUND syscall.Errno = 3002 ERROR_SPL_NO_STARTDOC syscall.Errno = 3003 ERROR_SPL_NO_ADDJOB syscall.Errno = 3004 ERROR_PRINT_PROCESSOR_ALREADY_INSTALLED syscall.Errno = 3005 ERROR_PRINT_MONITOR_ALREADY_INSTALLED syscall.Errno = 3006 ERROR_INVALID_PRINT_MONITOR syscall.Errno = 3007 ERROR_PRINT_MONITOR_IN_USE syscall.Errno = 3008 ERROR_PRINTER_HAS_JOBS_QUEUED syscall.Errno = 3009 ERROR_SUCCESS_REBOOT_REQUIRED syscall.Errno = 3010 ERROR_SUCCESS_RESTART_REQUIRED syscall.Errno = 3011 ERROR_PRINTER_NOT_FOUND syscall.Errno = 3012 ERROR_PRINTER_DRIVER_WARNED syscall.Errno = 3013 ERROR_PRINTER_DRIVER_BLOCKED syscall.Errno = 3014 ERROR_PRINTER_DRIVER_PACKAGE_IN_USE syscall.Errno = 3015 ERROR_CORE_DRIVER_PACKAGE_NOT_FOUND syscall.Errno = 3016 ERROR_FAIL_REBOOT_REQUIRED syscall.Errno = 3017 ERROR_FAIL_REBOOT_INITIATED syscall.Errno = 3018 ERROR_PRINTER_DRIVER_DOWNLOAD_NEEDED syscall.Errno = 3019 ERROR_PRINT_JOB_RESTART_REQUIRED syscall.Errno = 3020 ERROR_INVALID_PRINTER_DRIVER_MANIFEST syscall.Errno = 3021 ERROR_PRINTER_NOT_SHAREABLE syscall.Errno = 3022 ERROR_REQUEST_PAUSED syscall.Errno = 3050 ERROR_APPEXEC_CONDITION_NOT_SATISFIED syscall.Errno = 3060 ERROR_APPEXEC_HANDLE_INVALIDATED syscall.Errno = 3061 ERROR_APPEXEC_INVALID_HOST_GENERATION syscall.Errno = 3062 ERROR_APPEXEC_UNEXPECTED_PROCESS_REGISTRATION syscall.Errno = 3063 ERROR_APPEXEC_INVALID_HOST_STATE syscall.Errno = 3064 ERROR_APPEXEC_NO_DONOR syscall.Errno = 3065 ERROR_APPEXEC_HOST_ID_MISMATCH syscall.Errno = 3066 ERROR_APPEXEC_UNKNOWN_USER syscall.Errno = 3067 ERROR_IO_REISSUE_AS_CACHED syscall.Errno = 3950 ERROR_WINS_INTERNAL syscall.Errno = 4000 ERROR_CAN_NOT_DEL_LOCAL_WINS syscall.Errno = 4001 ERROR_STATIC_INIT syscall.Errno = 4002 ERROR_INC_BACKUP syscall.Errno = 4003 ERROR_FULL_BACKUP syscall.Errno = 4004 ERROR_REC_NON_EXISTENT syscall.Errno = 4005 ERROR_RPL_NOT_ALLOWED syscall.Errno = 4006 PEERDIST_ERROR_CONTENTINFO_VERSION_UNSUPPORTED syscall.Errno = 4050 PEERDIST_ERROR_CANNOT_PARSE_CONTENTINFO syscall.Errno = 4051 PEERDIST_ERROR_MISSING_DATA syscall.Errno = 4052 PEERDIST_ERROR_NO_MORE syscall.Errno = 4053 PEERDIST_ERROR_NOT_INITIALIZED syscall.Errno = 4054 PEERDIST_ERROR_ALREADY_INITIALIZED syscall.Errno = 4055 PEERDIST_ERROR_SHUTDOWN_IN_PROGRESS syscall.Errno = 4056 PEERDIST_ERROR_INVALIDATED syscall.Errno = 4057 PEERDIST_ERROR_ALREADY_EXISTS syscall.Errno = 4058 PEERDIST_ERROR_OPERATION_NOTFOUND syscall.Errno = 4059 PEERDIST_ERROR_ALREADY_COMPLETED syscall.Errno = 4060 PEERDIST_ERROR_OUT_OF_BOUNDS syscall.Errno = 4061 PEERDIST_ERROR_VERSION_UNSUPPORTED syscall.Errno = 4062 PEERDIST_ERROR_INVALID_CONFIGURATION syscall.Errno = 4063 PEERDIST_ERROR_NOT_LICENSED syscall.Errno = 4064 PEERDIST_ERROR_SERVICE_UNAVAILABLE syscall.Errno = 4065 PEERDIST_ERROR_TRUST_FAILURE syscall.Errno = 4066 ERROR_DHCP_ADDRESS_CONFLICT syscall.Errno = 4100 ERROR_WMI_GUID_NOT_FOUND syscall.Errno = 4200 ERROR_WMI_INSTANCE_NOT_FOUND syscall.Errno = 4201 ERROR_WMI_ITEMID_NOT_FOUND syscall.Errno = 4202 ERROR_WMI_TRY_AGAIN syscall.Errno = 4203 ERROR_WMI_DP_NOT_FOUND syscall.Errno = 4204 ERROR_WMI_UNRESOLVED_INSTANCE_REF syscall.Errno = 4205 ERROR_WMI_ALREADY_ENABLED syscall.Errno = 4206 ERROR_WMI_GUID_DISCONNECTED syscall.Errno = 4207 ERROR_WMI_SERVER_UNAVAILABLE syscall.Errno = 4208 ERROR_WMI_DP_FAILED syscall.Errno = 4209 ERROR_WMI_INVALID_MOF syscall.Errno = 4210 ERROR_WMI_INVALID_REGINFO syscall.Errno = 4211 ERROR_WMI_ALREADY_DISABLED syscall.Errno = 4212 ERROR_WMI_READ_ONLY syscall.Errno = 4213 ERROR_WMI_SET_FAILURE syscall.Errno = 4214 ERROR_NOT_APPCONTAINER syscall.Errno = 4250 ERROR_APPCONTAINER_REQUIRED syscall.Errno = 4251 ERROR_NOT_SUPPORTED_IN_APPCONTAINER syscall.Errno = 4252 ERROR_INVALID_PACKAGE_SID_LENGTH syscall.Errno = 4253 ERROR_INVALID_MEDIA syscall.Errno = 4300 ERROR_INVALID_LIBRARY syscall.Errno = 4301 ERROR_INVALID_MEDIA_POOL syscall.Errno = 4302 ERROR_DRIVE_MEDIA_MISMATCH syscall.Errno = 4303 ERROR_MEDIA_OFFLINE syscall.Errno = 4304 ERROR_LIBRARY_OFFLINE syscall.Errno = 4305 ERROR_EMPTY syscall.Errno = 4306 ERROR_NOT_EMPTY syscall.Errno = 4307 ERROR_MEDIA_UNAVAILABLE syscall.Errno = 4308 ERROR_RESOURCE_DISABLED syscall.Errno = 4309 ERROR_INVALID_CLEANER syscall.Errno = 4310 ERROR_UNABLE_TO_CLEAN syscall.Errno = 4311 ERROR_OBJECT_NOT_FOUND syscall.Errno = 4312 ERROR_DATABASE_FAILURE syscall.Errno = 4313 ERROR_DATABASE_FULL syscall.Errno = 4314 ERROR_MEDIA_INCOMPATIBLE syscall.Errno = 4315 ERROR_RESOURCE_NOT_PRESENT syscall.Errno = 4316 ERROR_INVALID_OPERATION syscall.Errno = 4317 ERROR_MEDIA_NOT_AVAILABLE syscall.Errno = 4318 ERROR_DEVICE_NOT_AVAILABLE syscall.Errno = 4319 ERROR_REQUEST_REFUSED syscall.Errno = 4320 ERROR_INVALID_DRIVE_OBJECT syscall.Errno = 4321 ERROR_LIBRARY_FULL syscall.Errno = 4322 ERROR_MEDIUM_NOT_ACCESSIBLE syscall.Errno = 4323 ERROR_UNABLE_TO_LOAD_MEDIUM syscall.Errno = 4324 ERROR_UNABLE_TO_INVENTORY_DRIVE syscall.Errno = 4325 ERROR_UNABLE_TO_INVENTORY_SLOT syscall.Errno = 4326 ERROR_UNABLE_TO_INVENTORY_TRANSPORT syscall.Errno = 4327 ERROR_TRANSPORT_FULL syscall.Errno = 4328 ERROR_CONTROLLING_IEPORT syscall.Errno = 4329 ERROR_UNABLE_TO_EJECT_MOUNTED_MEDIA syscall.Errno = 4330 ERROR_CLEANER_SLOT_SET syscall.Errno = 4331 ERROR_CLEANER_SLOT_NOT_SET syscall.Errno = 4332 ERROR_CLEANER_CARTRIDGE_SPENT syscall.Errno = 4333 ERROR_UNEXPECTED_OMID syscall.Errno = 4334 ERROR_CANT_DELETE_LAST_ITEM syscall.Errno = 4335 ERROR_MESSAGE_EXCEEDS_MAX_SIZE syscall.Errno = 4336 ERROR_VOLUME_CONTAINS_SYS_FILES syscall.Errno = 4337 ERROR_INDIGENOUS_TYPE syscall.Errno = 4338 ERROR_NO_SUPPORTING_DRIVES syscall.Errno = 4339 ERROR_CLEANER_CARTRIDGE_INSTALLED syscall.Errno = 4340 ERROR_IEPORT_FULL syscall.Errno = 4341 ERROR_FILE_OFFLINE syscall.Errno = 4350 ERROR_REMOTE_STORAGE_NOT_ACTIVE syscall.Errno = 4351 ERROR_REMOTE_STORAGE_MEDIA_ERROR syscall.Errno = 4352 ERROR_NOT_A_REPARSE_POINT syscall.Errno = 4390 ERROR_REPARSE_ATTRIBUTE_CONFLICT syscall.Errno = 4391 ERROR_INVALID_REPARSE_DATA syscall.Errno = 4392 ERROR_REPARSE_TAG_INVALID syscall.Errno = 4393 ERROR_REPARSE_TAG_MISMATCH syscall.Errno = 4394 ERROR_REPARSE_POINT_ENCOUNTERED syscall.Errno = 4395 ERROR_APP_DATA_NOT_FOUND syscall.Errno = 4400 ERROR_APP_DATA_EXPIRED syscall.Errno = 4401 ERROR_APP_DATA_CORRUPT syscall.Errno = 4402 ERROR_APP_DATA_LIMIT_EXCEEDED syscall.Errno = 4403 ERROR_APP_DATA_REBOOT_REQUIRED syscall.Errno = 4404 ERROR_SECUREBOOT_ROLLBACK_DETECTED syscall.Errno = 4420 ERROR_SECUREBOOT_POLICY_VIOLATION syscall.Errno = 4421 ERROR_SECUREBOOT_INVALID_POLICY syscall.Errno = 4422 ERROR_SECUREBOOT_POLICY_PUBLISHER_NOT_FOUND syscall.Errno = 4423 ERROR_SECUREBOOT_POLICY_NOT_SIGNED syscall.Errno = 4424 ERROR_SECUREBOOT_NOT_ENABLED syscall.Errno = 4425 ERROR_SECUREBOOT_FILE_REPLACED syscall.Errno = 4426 ERROR_SECUREBOOT_POLICY_NOT_AUTHORIZED syscall.Errno = 4427 ERROR_SECUREBOOT_POLICY_UNKNOWN syscall.Errno = 4428 ERROR_SECUREBOOT_POLICY_MISSING_ANTIROLLBACKVERSION syscall.Errno = 4429 ERROR_SECUREBOOT_PLATFORM_ID_MISMATCH syscall.Errno = 4430 ERROR_SECUREBOOT_POLICY_ROLLBACK_DETECTED syscall.Errno = 4431 ERROR_SECUREBOOT_POLICY_UPGRADE_MISMATCH syscall.Errno = 4432 ERROR_SECUREBOOT_REQUIRED_POLICY_FILE_MISSING syscall.Errno = 4433 ERROR_SECUREBOOT_NOT_BASE_POLICY syscall.Errno = 4434 ERROR_SECUREBOOT_NOT_SUPPLEMENTAL_POLICY syscall.Errno = 4435 ERROR_OFFLOAD_READ_FLT_NOT_SUPPORTED syscall.Errno = 4440 ERROR_OFFLOAD_WRITE_FLT_NOT_SUPPORTED syscall.Errno = 4441 ERROR_OFFLOAD_READ_FILE_NOT_SUPPORTED syscall.Errno = 4442 ERROR_OFFLOAD_WRITE_FILE_NOT_SUPPORTED syscall.Errno = 4443 ERROR_ALREADY_HAS_STREAM_ID syscall.Errno = 4444 ERROR_SMR_GARBAGE_COLLECTION_REQUIRED syscall.Errno = 4445 ERROR_WOF_WIM_HEADER_CORRUPT syscall.Errno = 4446 ERROR_WOF_WIM_RESOURCE_TABLE_CORRUPT syscall.Errno = 4447 ERROR_WOF_FILE_RESOURCE_TABLE_CORRUPT syscall.Errno = 4448 ERROR_VOLUME_NOT_SIS_ENABLED syscall.Errno = 4500 ERROR_SYSTEM_INTEGRITY_ROLLBACK_DETECTED syscall.Errno = 4550 ERROR_SYSTEM_INTEGRITY_POLICY_VIOLATION syscall.Errno = 4551 ERROR_SYSTEM_INTEGRITY_INVALID_POLICY syscall.Errno = 4552 ERROR_SYSTEM_INTEGRITY_POLICY_NOT_SIGNED syscall.Errno = 4553 ERROR_SYSTEM_INTEGRITY_TOO_MANY_POLICIES syscall.Errno = 4554 ERROR_SYSTEM_INTEGRITY_SUPPLEMENTAL_POLICY_NOT_AUTHORIZED syscall.Errno = 4555 ERROR_VSM_NOT_INITIALIZED syscall.Errno = 4560 ERROR_VSM_DMA_PROTECTION_NOT_IN_USE syscall.Errno = 4561 ERROR_PLATFORM_MANIFEST_NOT_AUTHORIZED syscall.Errno = 4570 ERROR_PLATFORM_MANIFEST_INVALID syscall.Errno = 4571 ERROR_PLATFORM_MANIFEST_FILE_NOT_AUTHORIZED syscall.Errno = 4572 ERROR_PLATFORM_MANIFEST_CATALOG_NOT_AUTHORIZED syscall.Errno = 4573 ERROR_PLATFORM_MANIFEST_BINARY_ID_NOT_FOUND syscall.Errno = 4574 ERROR_PLATFORM_MANIFEST_NOT_ACTIVE syscall.Errno = 4575 ERROR_PLATFORM_MANIFEST_NOT_SIGNED syscall.Errno = 4576 ERROR_DEPENDENT_RESOURCE_EXISTS syscall.Errno = 5001 ERROR_DEPENDENCY_NOT_FOUND syscall.Errno = 5002 ERROR_DEPENDENCY_ALREADY_EXISTS syscall.Errno = 5003 ERROR_RESOURCE_NOT_ONLINE syscall.Errno = 5004 ERROR_HOST_NODE_NOT_AVAILABLE syscall.Errno = 5005 ERROR_RESOURCE_NOT_AVAILABLE syscall.Errno = 5006 ERROR_RESOURCE_NOT_FOUND syscall.Errno = 5007 ERROR_SHUTDOWN_CLUSTER syscall.Errno = 5008 ERROR_CANT_EVICT_ACTIVE_NODE syscall.Errno = 5009 ERROR_OBJECT_ALREADY_EXISTS syscall.Errno = 5010 ERROR_OBJECT_IN_LIST syscall.Errno = 5011 ERROR_GROUP_NOT_AVAILABLE syscall.Errno = 5012 ERROR_GROUP_NOT_FOUND syscall.Errno = 5013 ERROR_GROUP_NOT_ONLINE syscall.Errno = 5014 ERROR_HOST_NODE_NOT_RESOURCE_OWNER syscall.Errno = 5015 ERROR_HOST_NODE_NOT_GROUP_OWNER syscall.Errno = 5016 ERROR_RESMON_CREATE_FAILED syscall.Errno = 5017 ERROR_RESMON_ONLINE_FAILED syscall.Errno = 5018 ERROR_RESOURCE_ONLINE syscall.Errno = 5019 ERROR_QUORUM_RESOURCE syscall.Errno = 5020 ERROR_NOT_QUORUM_CAPABLE syscall.Errno = 5021 ERROR_CLUSTER_SHUTTING_DOWN syscall.Errno = 5022 ERROR_INVALID_STATE syscall.Errno = 5023 ERROR_RESOURCE_PROPERTIES_STORED syscall.Errno = 5024 ERROR_NOT_QUORUM_CLASS syscall.Errno = 5025 ERROR_CORE_RESOURCE syscall.Errno = 5026 ERROR_QUORUM_RESOURCE_ONLINE_FAILED syscall.Errno = 5027 ERROR_QUORUMLOG_OPEN_FAILED syscall.Errno = 5028 ERROR_CLUSTERLOG_CORRUPT syscall.Errno = 5029 ERROR_CLUSTERLOG_RECORD_EXCEEDS_MAXSIZE syscall.Errno = 5030 ERROR_CLUSTERLOG_EXCEEDS_MAXSIZE syscall.Errno = 5031 ERROR_CLUSTERLOG_CHKPOINT_NOT_FOUND syscall.Errno = 5032 ERROR_CLUSTERLOG_NOT_ENOUGH_SPACE syscall.Errno = 5033 ERROR_QUORUM_OWNER_ALIVE syscall.Errno = 5034 ERROR_NETWORK_NOT_AVAILABLE syscall.Errno = 5035 ERROR_NODE_NOT_AVAILABLE syscall.Errno = 5036 ERROR_ALL_NODES_NOT_AVAILABLE syscall.Errno = 5037 ERROR_RESOURCE_FAILED syscall.Errno = 5038 ERROR_CLUSTER_INVALID_NODE syscall.Errno = 5039 ERROR_CLUSTER_NODE_EXISTS syscall.Errno = 5040 ERROR_CLUSTER_JOIN_IN_PROGRESS syscall.Errno = 5041 ERROR_CLUSTER_NODE_NOT_FOUND syscall.Errno = 5042 ERROR_CLUSTER_LOCAL_NODE_NOT_FOUND syscall.Errno = 5043 ERROR_CLUSTER_NETWORK_EXISTS syscall.Errno = 5044 ERROR_CLUSTER_NETWORK_NOT_FOUND syscall.Errno = 5045 ERROR_CLUSTER_NETINTERFACE_EXISTS syscall.Errno = 5046 ERROR_CLUSTER_NETINTERFACE_NOT_FOUND syscall.Errno = 5047 ERROR_CLUSTER_INVALID_REQUEST syscall.Errno = 5048 ERROR_CLUSTER_INVALID_NETWORK_PROVIDER syscall.Errno = 5049 ERROR_CLUSTER_NODE_DOWN syscall.Errno = 5050 ERROR_CLUSTER_NODE_UNREACHABLE syscall.Errno = 5051 ERROR_CLUSTER_NODE_NOT_MEMBER syscall.Errno = 5052 ERROR_CLUSTER_JOIN_NOT_IN_PROGRESS syscall.Errno = 5053 ERROR_CLUSTER_INVALID_NETWORK syscall.Errno = 5054 ERROR_CLUSTER_NODE_UP syscall.Errno = 5056 ERROR_CLUSTER_IPADDR_IN_USE syscall.Errno = 5057 ERROR_CLUSTER_NODE_NOT_PAUSED syscall.Errno = 5058 ERROR_CLUSTER_NO_SECURITY_CONTEXT syscall.Errno = 5059 ERROR_CLUSTER_NETWORK_NOT_INTERNAL syscall.Errno = 5060 ERROR_CLUSTER_NODE_ALREADY_UP syscall.Errno = 5061 ERROR_CLUSTER_NODE_ALREADY_DOWN syscall.Errno = 5062 ERROR_CLUSTER_NETWORK_ALREADY_ONLINE syscall.Errno = 5063 ERROR_CLUSTER_NETWORK_ALREADY_OFFLINE syscall.Errno = 5064 ERROR_CLUSTER_NODE_ALREADY_MEMBER syscall.Errno = 5065 ERROR_CLUSTER_LAST_INTERNAL_NETWORK syscall.Errno = 5066 ERROR_CLUSTER_NETWORK_HAS_DEPENDENTS syscall.Errno = 5067 ERROR_INVALID_OPERATION_ON_QUORUM syscall.Errno = 5068 ERROR_DEPENDENCY_NOT_ALLOWED syscall.Errno = 5069 ERROR_CLUSTER_NODE_PAUSED syscall.Errno = 5070 ERROR_NODE_CANT_HOST_RESOURCE syscall.Errno = 5071 ERROR_CLUSTER_NODE_NOT_READY syscall.Errno = 5072 ERROR_CLUSTER_NODE_SHUTTING_DOWN syscall.Errno = 5073 ERROR_CLUSTER_JOIN_ABORTED syscall.Errno = 5074 ERROR_CLUSTER_INCOMPATIBLE_VERSIONS syscall.Errno = 5075 ERROR_CLUSTER_MAXNUM_OF_RESOURCES_EXCEEDED syscall.Errno = 5076 ERROR_CLUSTER_SYSTEM_CONFIG_CHANGED syscall.Errno = 5077 ERROR_CLUSTER_RESOURCE_TYPE_NOT_FOUND syscall.Errno = 5078 ERROR_CLUSTER_RESTYPE_NOT_SUPPORTED syscall.Errno = 5079 ERROR_CLUSTER_RESNAME_NOT_FOUND syscall.Errno = 5080 ERROR_CLUSTER_NO_RPC_PACKAGES_REGISTERED syscall.Errno = 5081 ERROR_CLUSTER_OWNER_NOT_IN_PREFLIST syscall.Errno = 5082 ERROR_CLUSTER_DATABASE_SEQMISMATCH syscall.Errno = 5083 ERROR_RESMON_INVALID_STATE syscall.Errno = 5084 ERROR_CLUSTER_GUM_NOT_LOCKER syscall.Errno = 5085 ERROR_QUORUM_DISK_NOT_FOUND syscall.Errno = 5086 ERROR_DATABASE_BACKUP_CORRUPT syscall.Errno = 5087 ERROR_CLUSTER_NODE_ALREADY_HAS_DFS_ROOT syscall.Errno = 5088 ERROR_RESOURCE_PROPERTY_UNCHANGEABLE syscall.Errno = 5089 ERROR_NO_ADMIN_ACCESS_POINT syscall.Errno = 5090 ERROR_CLUSTER_MEMBERSHIP_INVALID_STATE syscall.Errno = 5890 ERROR_CLUSTER_QUORUMLOG_NOT_FOUND syscall.Errno = 5891 ERROR_CLUSTER_MEMBERSHIP_HALT syscall.Errno = 5892 ERROR_CLUSTER_INSTANCE_ID_MISMATCH syscall.Errno = 5893 ERROR_CLUSTER_NETWORK_NOT_FOUND_FOR_IP syscall.Errno = 5894 ERROR_CLUSTER_PROPERTY_DATA_TYPE_MISMATCH syscall.Errno = 5895 ERROR_CLUSTER_EVICT_WITHOUT_CLEANUP syscall.Errno = 5896 ERROR_CLUSTER_PARAMETER_MISMATCH syscall.Errno = 5897 ERROR_NODE_CANNOT_BE_CLUSTERED syscall.Errno = 5898 ERROR_CLUSTER_WRONG_OS_VERSION syscall.Errno = 5899 ERROR_CLUSTER_CANT_CREATE_DUP_CLUSTER_NAME syscall.Errno = 5900 ERROR_CLUSCFG_ALREADY_COMMITTED syscall.Errno = 5901 ERROR_CLUSCFG_ROLLBACK_FAILED syscall.Errno = 5902 ERROR_CLUSCFG_SYSTEM_DISK_DRIVE_LETTER_CONFLICT syscall.Errno = 5903 ERROR_CLUSTER_OLD_VERSION syscall.Errno = 5904 ERROR_CLUSTER_MISMATCHED_COMPUTER_ACCT_NAME syscall.Errno = 5905 ERROR_CLUSTER_NO_NET_ADAPTERS syscall.Errno = 5906 ERROR_CLUSTER_POISONED syscall.Errno = 5907 ERROR_CLUSTER_GROUP_MOVING syscall.Errno = 5908 ERROR_CLUSTER_RESOURCE_TYPE_BUSY syscall.Errno = 5909 ERROR_RESOURCE_CALL_TIMED_OUT syscall.Errno = 5910 ERROR_INVALID_CLUSTER_IPV6_ADDRESS syscall.Errno = 5911 ERROR_CLUSTER_INTERNAL_INVALID_FUNCTION syscall.Errno = 5912 ERROR_CLUSTER_PARAMETER_OUT_OF_BOUNDS syscall.Errno = 5913 ERROR_CLUSTER_PARTIAL_SEND syscall.Errno = 5914 ERROR_CLUSTER_REGISTRY_INVALID_FUNCTION syscall.Errno = 5915 ERROR_CLUSTER_INVALID_STRING_TERMINATION syscall.Errno = 5916 ERROR_CLUSTER_INVALID_STRING_FORMAT syscall.Errno = 5917 ERROR_CLUSTER_DATABASE_TRANSACTION_IN_PROGRESS syscall.Errno = 5918 ERROR_CLUSTER_DATABASE_TRANSACTION_NOT_IN_PROGRESS syscall.Errno = 5919 ERROR_CLUSTER_NULL_DATA syscall.Errno = 5920 ERROR_CLUSTER_PARTIAL_READ syscall.Errno = 5921 ERROR_CLUSTER_PARTIAL_WRITE syscall.Errno = 5922 ERROR_CLUSTER_CANT_DESERIALIZE_DATA syscall.Errno = 5923 ERROR_DEPENDENT_RESOURCE_PROPERTY_CONFLICT syscall.Errno = 5924 ERROR_CLUSTER_NO_QUORUM syscall.Errno = 5925 ERROR_CLUSTER_INVALID_IPV6_NETWORK syscall.Errno = 5926 ERROR_CLUSTER_INVALID_IPV6_TUNNEL_NETWORK syscall.Errno = 5927 ERROR_QUORUM_NOT_ALLOWED_IN_THIS_GROUP syscall.Errno = 5928 ERROR_DEPENDENCY_TREE_TOO_COMPLEX syscall.Errno = 5929 ERROR_EXCEPTION_IN_RESOURCE_CALL syscall.Errno = 5930 ERROR_CLUSTER_RHS_FAILED_INITIALIZATION syscall.Errno = 5931 ERROR_CLUSTER_NOT_INSTALLED syscall.Errno = 5932 ERROR_CLUSTER_RESOURCES_MUST_BE_ONLINE_ON_THE_SAME_NODE syscall.Errno = 5933 ERROR_CLUSTER_MAX_NODES_IN_CLUSTER syscall.Errno = 5934 ERROR_CLUSTER_TOO_MANY_NODES syscall.Errno = 5935 ERROR_CLUSTER_OBJECT_ALREADY_USED syscall.Errno = 5936 ERROR_NONCORE_GROUPS_FOUND syscall.Errno = 5937 ERROR_FILE_SHARE_RESOURCE_CONFLICT syscall.Errno = 5938 ERROR_CLUSTER_EVICT_INVALID_REQUEST syscall.Errno = 5939 ERROR_CLUSTER_SINGLETON_RESOURCE syscall.Errno = 5940 ERROR_CLUSTER_GROUP_SINGLETON_RESOURCE syscall.Errno = 5941 ERROR_CLUSTER_RESOURCE_PROVIDER_FAILED syscall.Errno = 5942 ERROR_CLUSTER_RESOURCE_CONFIGURATION_ERROR syscall.Errno = 5943 ERROR_CLUSTER_GROUP_BUSY syscall.Errno = 5944 ERROR_CLUSTER_NOT_SHARED_VOLUME syscall.Errno = 5945 ERROR_CLUSTER_INVALID_SECURITY_DESCRIPTOR syscall.Errno = 5946 ERROR_CLUSTER_SHARED_VOLUMES_IN_USE syscall.Errno = 5947 ERROR_CLUSTER_USE_SHARED_VOLUMES_API syscall.Errno = 5948 ERROR_CLUSTER_BACKUP_IN_PROGRESS syscall.Errno = 5949 ERROR_NON_CSV_PATH syscall.Errno = 5950 ERROR_CSV_VOLUME_NOT_LOCAL syscall.Errno = 5951 ERROR_CLUSTER_WATCHDOG_TERMINATING syscall.Errno = 5952 ERROR_CLUSTER_RESOURCE_VETOED_MOVE_INCOMPATIBLE_NODES syscall.Errno = 5953 ERROR_CLUSTER_INVALID_NODE_WEIGHT syscall.Errno = 5954 ERROR_CLUSTER_RESOURCE_VETOED_CALL syscall.Errno = 5955 ERROR_RESMON_SYSTEM_RESOURCES_LACKING syscall.Errno = 5956 ERROR_CLUSTER_RESOURCE_VETOED_MOVE_NOT_ENOUGH_RESOURCES_ON_DESTINATION syscall.Errno = 5957 ERROR_CLUSTER_RESOURCE_VETOED_MOVE_NOT_ENOUGH_RESOURCES_ON_SOURCE syscall.Errno = 5958 ERROR_CLUSTER_GROUP_QUEUED syscall.Errno = 5959 ERROR_CLUSTER_RESOURCE_LOCKED_STATUS syscall.Errno = 5960 ERROR_CLUSTER_SHARED_VOLUME_FAILOVER_NOT_ALLOWED syscall.Errno = 5961 ERROR_CLUSTER_NODE_DRAIN_IN_PROGRESS syscall.Errno = 5962 ERROR_CLUSTER_DISK_NOT_CONNECTED syscall.Errno = 5963 ERROR_DISK_NOT_CSV_CAPABLE syscall.Errno = 5964 ERROR_RESOURCE_NOT_IN_AVAILABLE_STORAGE syscall.Errno = 5965 ERROR_CLUSTER_SHARED_VOLUME_REDIRECTED syscall.Errno = 5966 ERROR_CLUSTER_SHARED_VOLUME_NOT_REDIRECTED syscall.Errno = 5967 ERROR_CLUSTER_CANNOT_RETURN_PROPERTIES syscall.Errno = 5968 ERROR_CLUSTER_RESOURCE_CONTAINS_UNSUPPORTED_DIFF_AREA_FOR_SHARED_VOLUMES syscall.Errno = 5969 ERROR_CLUSTER_RESOURCE_IS_IN_MAINTENANCE_MODE syscall.Errno = 5970 ERROR_CLUSTER_AFFINITY_CONFLICT syscall.Errno = 5971 ERROR_CLUSTER_RESOURCE_IS_REPLICA_VIRTUAL_MACHINE syscall.Errno = 5972 ERROR_CLUSTER_UPGRADE_INCOMPATIBLE_VERSIONS syscall.Errno = 5973 ERROR_CLUSTER_UPGRADE_FIX_QUORUM_NOT_SUPPORTED syscall.Errno = 5974 ERROR_CLUSTER_UPGRADE_RESTART_REQUIRED syscall.Errno = 5975 ERROR_CLUSTER_UPGRADE_IN_PROGRESS syscall.Errno = 5976 ERROR_CLUSTER_UPGRADE_INCOMPLETE syscall.Errno = 5977 ERROR_CLUSTER_NODE_IN_GRACE_PERIOD syscall.Errno = 5978 ERROR_CLUSTER_CSV_IO_PAUSE_TIMEOUT syscall.Errno = 5979 ERROR_NODE_NOT_ACTIVE_CLUSTER_MEMBER syscall.Errno = 5980 ERROR_CLUSTER_RESOURCE_NOT_MONITORED syscall.Errno = 5981 ERROR_CLUSTER_RESOURCE_DOES_NOT_SUPPORT_UNMONITORED syscall.Errno = 5982 ERROR_CLUSTER_RESOURCE_IS_REPLICATED syscall.Errno = 5983 ERROR_CLUSTER_NODE_ISOLATED syscall.Errno = 5984 ERROR_CLUSTER_NODE_QUARANTINED syscall.Errno = 5985 ERROR_CLUSTER_DATABASE_UPDATE_CONDITION_FAILED syscall.Errno = 5986 ERROR_CLUSTER_SPACE_DEGRADED syscall.Errno = 5987 ERROR_CLUSTER_TOKEN_DELEGATION_NOT_SUPPORTED syscall.Errno = 5988 ERROR_CLUSTER_CSV_INVALID_HANDLE syscall.Errno = 5989 ERROR_CLUSTER_CSV_SUPPORTED_ONLY_ON_COORDINATOR syscall.Errno = 5990 ERROR_GROUPSET_NOT_AVAILABLE syscall.Errno = 5991 ERROR_GROUPSET_NOT_FOUND syscall.Errno = 5992 ERROR_GROUPSET_CANT_PROVIDE syscall.Errno = 5993 ERROR_CLUSTER_FAULT_DOMAIN_PARENT_NOT_FOUND syscall.Errno = 5994 ERROR_CLUSTER_FAULT_DOMAIN_INVALID_HIERARCHY syscall.Errno = 5995 ERROR_CLUSTER_FAULT_DOMAIN_FAILED_S2D_VALIDATION syscall.Errno = 5996 ERROR_CLUSTER_FAULT_DOMAIN_S2D_CONNECTIVITY_LOSS syscall.Errno = 5997 ERROR_CLUSTER_INVALID_INFRASTRUCTURE_FILESERVER_NAME syscall.Errno = 5998 ERROR_CLUSTERSET_MANAGEMENT_CLUSTER_UNREACHABLE syscall.Errno = 5999 ERROR_ENCRYPTION_FAILED syscall.Errno = 6000 ERROR_DECRYPTION_FAILED syscall.Errno = 6001 ERROR_FILE_ENCRYPTED syscall.Errno = 6002 ERROR_NO_RECOVERY_POLICY syscall.Errno = 6003 ERROR_NO_EFS syscall.Errno = 6004 ERROR_WRONG_EFS syscall.Errno = 6005 ERROR_NO_USER_KEYS syscall.Errno = 6006 ERROR_FILE_NOT_ENCRYPTED syscall.Errno = 6007 ERROR_NOT_EXPORT_FORMAT syscall.Errno = 6008 ERROR_FILE_READ_ONLY syscall.Errno = 6009 ERROR_DIR_EFS_DISALLOWED syscall.Errno = 6010 ERROR_EFS_SERVER_NOT_TRUSTED syscall.Errno = 6011 ERROR_BAD_RECOVERY_POLICY syscall.Errno = 6012 ERROR_EFS_ALG_BLOB_TOO_BIG syscall.Errno = 6013 ERROR_VOLUME_NOT_SUPPORT_EFS syscall.Errno = 6014 ERROR_EFS_DISABLED syscall.Errno = 6015 ERROR_EFS_VERSION_NOT_SUPPORT syscall.Errno = 6016 ERROR_CS_ENCRYPTION_INVALID_SERVER_RESPONSE syscall.Errno = 6017 ERROR_CS_ENCRYPTION_UNSUPPORTED_SERVER syscall.Errno = 6018 ERROR_CS_ENCRYPTION_EXISTING_ENCRYPTED_FILE syscall.Errno = 6019 ERROR_CS_ENCRYPTION_NEW_ENCRYPTED_FILE syscall.Errno = 6020 ERROR_CS_ENCRYPTION_FILE_NOT_CSE syscall.Errno = 6021 ERROR_ENCRYPTION_POLICY_DENIES_OPERATION syscall.Errno = 6022 ERROR_WIP_ENCRYPTION_FAILED syscall.Errno = 6023 ERROR_NO_BROWSER_SERVERS_FOUND syscall.Errno = 6118 SCHED_E_SERVICE_NOT_LOCALSYSTEM syscall.Errno = 6200 ERROR_LOG_SECTOR_INVALID syscall.Errno = 6600 ERROR_LOG_SECTOR_PARITY_INVALID syscall.Errno = 6601 ERROR_LOG_SECTOR_REMAPPED syscall.Errno = 6602 ERROR_LOG_BLOCK_INCOMPLETE syscall.Errno = 6603 ERROR_LOG_INVALID_RANGE syscall.Errno = 6604 ERROR_LOG_BLOCKS_EXHAUSTED syscall.Errno = 6605 ERROR_LOG_READ_CONTEXT_INVALID syscall.Errno = 6606 ERROR_LOG_RESTART_INVALID syscall.Errno = 6607 ERROR_LOG_BLOCK_VERSION syscall.Errno = 6608 ERROR_LOG_BLOCK_INVALID syscall.Errno = 6609 ERROR_LOG_READ_MODE_INVALID syscall.Errno = 6610 ERROR_LOG_NO_RESTART syscall.Errno = 6611 ERROR_LOG_METADATA_CORRUPT syscall.Errno = 6612 ERROR_LOG_METADATA_INVALID syscall.Errno = 6613 ERROR_LOG_METADATA_INCONSISTENT syscall.Errno = 6614 ERROR_LOG_RESERVATION_INVALID syscall.Errno = 6615 ERROR_LOG_CANT_DELETE syscall.Errno = 6616 ERROR_LOG_CONTAINER_LIMIT_EXCEEDED syscall.Errno = 6617 ERROR_LOG_START_OF_LOG syscall.Errno = 6618 ERROR_LOG_POLICY_ALREADY_INSTALLED syscall.Errno = 6619 ERROR_LOG_POLICY_NOT_INSTALLED syscall.Errno = 6620 ERROR_LOG_POLICY_INVALID syscall.Errno = 6621 ERROR_LOG_POLICY_CONFLICT syscall.Errno = 6622 ERROR_LOG_PINNED_ARCHIVE_TAIL syscall.Errno = 6623 ERROR_LOG_RECORD_NONEXISTENT syscall.Errno = 6624 ERROR_LOG_RECORDS_RESERVED_INVALID syscall.Errno = 6625 ERROR_LOG_SPACE_RESERVED_INVALID syscall.Errno = 6626 ERROR_LOG_TAIL_INVALID syscall.Errno = 6627 ERROR_LOG_FULL syscall.Errno = 6628 ERROR_COULD_NOT_RESIZE_LOG syscall.Errno = 6629 ERROR_LOG_MULTIPLEXED syscall.Errno = 6630 ERROR_LOG_DEDICATED syscall.Errno = 6631 ERROR_LOG_ARCHIVE_NOT_IN_PROGRESS syscall.Errno = 6632 ERROR_LOG_ARCHIVE_IN_PROGRESS syscall.Errno = 6633 ERROR_LOG_EPHEMERAL syscall.Errno = 6634 ERROR_LOG_NOT_ENOUGH_CONTAINERS syscall.Errno = 6635 ERROR_LOG_CLIENT_ALREADY_REGISTERED syscall.Errno = 6636 ERROR_LOG_CLIENT_NOT_REGISTERED syscall.Errno = 6637 ERROR_LOG_FULL_HANDLER_IN_PROGRESS syscall.Errno = 6638 ERROR_LOG_CONTAINER_READ_FAILED syscall.Errno = 6639 ERROR_LOG_CONTAINER_WRITE_FAILED syscall.Errno = 6640 ERROR_LOG_CONTAINER_OPEN_FAILED syscall.Errno = 6641 ERROR_LOG_CONTAINER_STATE_INVALID syscall.Errno = 6642 ERROR_LOG_STATE_INVALID syscall.Errno = 6643 ERROR_LOG_PINNED syscall.Errno = 6644 ERROR_LOG_METADATA_FLUSH_FAILED syscall.Errno = 6645 ERROR_LOG_INCONSISTENT_SECURITY syscall.Errno = 6646 ERROR_LOG_APPENDED_FLUSH_FAILED syscall.Errno = 6647 ERROR_LOG_PINNED_RESERVATION syscall.Errno = 6648 ERROR_INVALID_TRANSACTION syscall.Errno = 6700 ERROR_TRANSACTION_NOT_ACTIVE syscall.Errno = 6701 ERROR_TRANSACTION_REQUEST_NOT_VALID syscall.Errno = 6702 ERROR_TRANSACTION_NOT_REQUESTED syscall.Errno = 6703 ERROR_TRANSACTION_ALREADY_ABORTED syscall.Errno = 6704 ERROR_TRANSACTION_ALREADY_COMMITTED syscall.Errno = 6705 ERROR_TM_INITIALIZATION_FAILED syscall.Errno = 6706 ERROR_RESOURCEMANAGER_READ_ONLY syscall.Errno = 6707 ERROR_TRANSACTION_NOT_JOINED syscall.Errno = 6708 ERROR_TRANSACTION_SUPERIOR_EXISTS syscall.Errno = 6709 ERROR_CRM_PROTOCOL_ALREADY_EXISTS syscall.Errno = 6710 ERROR_TRANSACTION_PROPAGATION_FAILED syscall.Errno = 6711 ERROR_CRM_PROTOCOL_NOT_FOUND syscall.Errno = 6712 ERROR_TRANSACTION_INVALID_MARSHALL_BUFFER syscall.Errno = 6713 ERROR_CURRENT_TRANSACTION_NOT_VALID syscall.Errno = 6714 ERROR_TRANSACTION_NOT_FOUND syscall.Errno = 6715 ERROR_RESOURCEMANAGER_NOT_FOUND syscall.Errno = 6716 ERROR_ENLISTMENT_NOT_FOUND syscall.Errno = 6717 ERROR_TRANSACTIONMANAGER_NOT_FOUND syscall.Errno = 6718 ERROR_TRANSACTIONMANAGER_NOT_ONLINE syscall.Errno = 6719 ERROR_TRANSACTIONMANAGER_RECOVERY_NAME_COLLISION syscall.Errno = 6720 ERROR_TRANSACTION_NOT_ROOT syscall.Errno = 6721 ERROR_TRANSACTION_OBJECT_EXPIRED syscall.Errno = 6722 ERROR_TRANSACTION_RESPONSE_NOT_ENLISTED syscall.Errno = 6723 ERROR_TRANSACTION_RECORD_TOO_LONG syscall.Errno = 6724 ERROR_IMPLICIT_TRANSACTION_NOT_SUPPORTED syscall.Errno = 6725 ERROR_TRANSACTION_INTEGRITY_VIOLATED syscall.Errno = 6726 ERROR_TRANSACTIONMANAGER_IDENTITY_MISMATCH syscall.Errno = 6727 ERROR_RM_CANNOT_BE_FROZEN_FOR_SNAPSHOT syscall.Errno = 6728 ERROR_TRANSACTION_MUST_WRITETHROUGH syscall.Errno = 6729 ERROR_TRANSACTION_NO_SUPERIOR syscall.Errno = 6730 ERROR_HEURISTIC_DAMAGE_POSSIBLE syscall.Errno = 6731 ERROR_TRANSACTIONAL_CONFLICT syscall.Errno = 6800 ERROR_RM_NOT_ACTIVE syscall.Errno = 6801 ERROR_RM_METADATA_CORRUPT syscall.Errno = 6802 ERROR_DIRECTORY_NOT_RM syscall.Errno = 6803 ERROR_TRANSACTIONS_UNSUPPORTED_REMOTE syscall.Errno = 6805 ERROR_LOG_RESIZE_INVALID_SIZE syscall.Errno = 6806 ERROR_OBJECT_NO_LONGER_EXISTS syscall.Errno = 6807 ERROR_STREAM_MINIVERSION_NOT_FOUND syscall.Errno = 6808 ERROR_STREAM_MINIVERSION_NOT_VALID syscall.Errno = 6809 ERROR_MINIVERSION_INACCESSIBLE_FROM_SPECIFIED_TRANSACTION syscall.Errno = 6810 ERROR_CANT_OPEN_MINIVERSION_WITH_MODIFY_INTENT syscall.Errno = 6811 ERROR_CANT_CREATE_MORE_STREAM_MINIVERSIONS syscall.Errno = 6812 ERROR_REMOTE_FILE_VERSION_MISMATCH syscall.Errno = 6814 ERROR_HANDLE_NO_LONGER_VALID syscall.Errno = 6815 ERROR_NO_TXF_METADATA syscall.Errno = 6816 ERROR_LOG_CORRUPTION_DETECTED syscall.Errno = 6817 ERROR_CANT_RECOVER_WITH_HANDLE_OPEN syscall.Errno = 6818 ERROR_RM_DISCONNECTED syscall.Errno = 6819 ERROR_ENLISTMENT_NOT_SUPERIOR syscall.Errno = 6820 ERROR_RECOVERY_NOT_NEEDED syscall.Errno = 6821 ERROR_RM_ALREADY_STARTED syscall.Errno = 6822 ERROR_FILE_IDENTITY_NOT_PERSISTENT syscall.Errno = 6823 ERROR_CANT_BREAK_TRANSACTIONAL_DEPENDENCY syscall.Errno = 6824 ERROR_CANT_CROSS_RM_BOUNDARY syscall.Errno = 6825 ERROR_TXF_DIR_NOT_EMPTY syscall.Errno = 6826 ERROR_INDOUBT_TRANSACTIONS_EXIST syscall.Errno = 6827 ERROR_TM_VOLATILE syscall.Errno = 6828 ERROR_ROLLBACK_TIMER_EXPIRED syscall.Errno = 6829 ERROR_TXF_ATTRIBUTE_CORRUPT syscall.Errno = 6830 ERROR_EFS_NOT_ALLOWED_IN_TRANSACTION syscall.Errno = 6831 ERROR_TRANSACTIONAL_OPEN_NOT_ALLOWED syscall.Errno = 6832 ERROR_LOG_GROWTH_FAILED syscall.Errno = 6833 ERROR_TRANSACTED_MAPPING_UNSUPPORTED_REMOTE syscall.Errno = 6834 ERROR_TXF_METADATA_ALREADY_PRESENT syscall.Errno = 6835 ERROR_TRANSACTION_SCOPE_CALLBACKS_NOT_SET syscall.Errno = 6836 ERROR_TRANSACTION_REQUIRED_PROMOTION syscall.Errno = 6837 ERROR_CANNOT_EXECUTE_FILE_IN_TRANSACTION syscall.Errno = 6838 ERROR_TRANSACTIONS_NOT_FROZEN syscall.Errno = 6839 ERROR_TRANSACTION_FREEZE_IN_PROGRESS syscall.Errno = 6840 ERROR_NOT_SNAPSHOT_VOLUME syscall.Errno = 6841 ERROR_NO_SAVEPOINT_WITH_OPEN_FILES syscall.Errno = 6842 ERROR_DATA_LOST_REPAIR syscall.Errno = 6843 ERROR_SPARSE_NOT_ALLOWED_IN_TRANSACTION syscall.Errno = 6844 ERROR_TM_IDENTITY_MISMATCH syscall.Errno = 6845 ERROR_FLOATED_SECTION syscall.Errno = 6846 ERROR_CANNOT_ACCEPT_TRANSACTED_WORK syscall.Errno = 6847 ERROR_CANNOT_ABORT_TRANSACTIONS syscall.Errno = 6848 ERROR_BAD_CLUSTERS syscall.Errno = 6849 ERROR_COMPRESSION_NOT_ALLOWED_IN_TRANSACTION syscall.Errno = 6850 ERROR_VOLUME_DIRTY syscall.Errno = 6851 ERROR_NO_LINK_TRACKING_IN_TRANSACTION syscall.Errno = 6852 ERROR_OPERATION_NOT_SUPPORTED_IN_TRANSACTION syscall.Errno = 6853 ERROR_EXPIRED_HANDLE syscall.Errno = 6854 ERROR_TRANSACTION_NOT_ENLISTED syscall.Errno = 6855 ERROR_CTX_WINSTATION_NAME_INVALID syscall.Errno = 7001 ERROR_CTX_INVALID_PD syscall.Errno = 7002 ERROR_CTX_PD_NOT_FOUND syscall.Errno = 7003 ERROR_CTX_WD_NOT_FOUND syscall.Errno = 7004 ERROR_CTX_CANNOT_MAKE_EVENTLOG_ENTRY syscall.Errno = 7005 ERROR_CTX_SERVICE_NAME_COLLISION syscall.Errno = 7006 ERROR_CTX_CLOSE_PENDING syscall.Errno = 7007 ERROR_CTX_NO_OUTBUF syscall.Errno = 7008 ERROR_CTX_MODEM_INF_NOT_FOUND syscall.Errno = 7009 ERROR_CTX_INVALID_MODEMNAME syscall.Errno = 7010 ERROR_CTX_MODEM_RESPONSE_ERROR syscall.Errno = 7011 ERROR_CTX_MODEM_RESPONSE_TIMEOUT syscall.Errno = 7012 ERROR_CTX_MODEM_RESPONSE_NO_CARRIER syscall.Errno = 7013 ERROR_CTX_MODEM_RESPONSE_NO_DIALTONE syscall.Errno = 7014 ERROR_CTX_MODEM_RESPONSE_BUSY syscall.Errno = 7015 ERROR_CTX_MODEM_RESPONSE_VOICE syscall.Errno = 7016 ERROR_CTX_TD_ERROR syscall.Errno = 7017 ERROR_CTX_WINSTATION_NOT_FOUND syscall.Errno = 7022 ERROR_CTX_WINSTATION_ALREADY_EXISTS syscall.Errno = 7023 ERROR_CTX_WINSTATION_BUSY syscall.Errno = 7024 ERROR_CTX_BAD_VIDEO_MODE syscall.Errno = 7025 ERROR_CTX_GRAPHICS_INVALID syscall.Errno = 7035 ERROR_CTX_LOGON_DISABLED syscall.Errno = 7037 ERROR_CTX_NOT_CONSOLE syscall.Errno = 7038 ERROR_CTX_CLIENT_QUERY_TIMEOUT syscall.Errno = 7040 ERROR_CTX_CONSOLE_DISCONNECT syscall.Errno = 7041 ERROR_CTX_CONSOLE_CONNECT syscall.Errno = 7042 ERROR_CTX_SHADOW_DENIED syscall.Errno = 7044 ERROR_CTX_WINSTATION_ACCESS_DENIED syscall.Errno = 7045 ERROR_CTX_INVALID_WD syscall.Errno = 7049 ERROR_CTX_SHADOW_INVALID syscall.Errno = 7050 ERROR_CTX_SHADOW_DISABLED syscall.Errno = 7051 ERROR_CTX_CLIENT_LICENSE_IN_USE syscall.Errno = 7052 ERROR_CTX_CLIENT_LICENSE_NOT_SET syscall.Errno = 7053 ERROR_CTX_LICENSE_NOT_AVAILABLE syscall.Errno = 7054 ERROR_CTX_LICENSE_CLIENT_INVALID syscall.Errno = 7055 ERROR_CTX_LICENSE_EXPIRED syscall.Errno = 7056 ERROR_CTX_SHADOW_NOT_RUNNING syscall.Errno = 7057 ERROR_CTX_SHADOW_ENDED_BY_MODE_CHANGE syscall.Errno = 7058 ERROR_ACTIVATION_COUNT_EXCEEDED syscall.Errno = 7059 ERROR_CTX_WINSTATIONS_DISABLED syscall.Errno = 7060 ERROR_CTX_ENCRYPTION_LEVEL_REQUIRED syscall.Errno = 7061 ERROR_CTX_SESSION_IN_USE syscall.Errno = 7062 ERROR_CTX_NO_FORCE_LOGOFF syscall.Errno = 7063 ERROR_CTX_ACCOUNT_RESTRICTION syscall.Errno = 7064 ERROR_RDP_PROTOCOL_ERROR syscall.Errno = 7065 ERROR_CTX_CDM_CONNECT syscall.Errno = 7066 ERROR_CTX_CDM_DISCONNECT syscall.Errno = 7067 ERROR_CTX_SECURITY_LAYER_ERROR syscall.Errno = 7068 ERROR_TS_INCOMPATIBLE_SESSIONS syscall.Errno = 7069 ERROR_TS_VIDEO_SUBSYSTEM_ERROR syscall.Errno = 7070 FRS_ERR_INVALID_API_SEQUENCE syscall.Errno = 8001 FRS_ERR_STARTING_SERVICE syscall.Errno = 8002 FRS_ERR_STOPPING_SERVICE syscall.Errno = 8003 FRS_ERR_INTERNAL_API syscall.Errno = 8004 FRS_ERR_INTERNAL syscall.Errno = 8005 FRS_ERR_SERVICE_COMM syscall.Errno = 8006 FRS_ERR_INSUFFICIENT_PRIV syscall.Errno = 8007 FRS_ERR_AUTHENTICATION syscall.Errno = 8008 FRS_ERR_PARENT_INSUFFICIENT_PRIV syscall.Errno = 8009 FRS_ERR_PARENT_AUTHENTICATION syscall.Errno = 8010 FRS_ERR_CHILD_TO_PARENT_COMM syscall.Errno = 8011 FRS_ERR_PARENT_TO_CHILD_COMM syscall.Errno = 8012 FRS_ERR_SYSVOL_POPULATE syscall.Errno = 8013 FRS_ERR_SYSVOL_POPULATE_TIMEOUT syscall.Errno = 8014 FRS_ERR_SYSVOL_IS_BUSY syscall.Errno = 8015 FRS_ERR_SYSVOL_DEMOTE syscall.Errno = 8016 FRS_ERR_INVALID_SERVICE_PARAMETER syscall.Errno = 8017 DS_S_SUCCESS = ERROR_SUCCESS ERROR_DS_NOT_INSTALLED syscall.Errno = 8200 ERROR_DS_MEMBERSHIP_EVALUATED_LOCALLY syscall.Errno = 8201 ERROR_DS_NO_ATTRIBUTE_OR_VALUE syscall.Errno = 8202 ERROR_DS_INVALID_ATTRIBUTE_SYNTAX syscall.Errno = 8203 ERROR_DS_ATTRIBUTE_TYPE_UNDEFINED syscall.Errno = 8204 ERROR_DS_ATTRIBUTE_OR_VALUE_EXISTS syscall.Errno = 8205 ERROR_DS_BUSY syscall.Errno = 8206 ERROR_DS_UNAVAILABLE syscall.Errno = 8207 ERROR_DS_NO_RIDS_ALLOCATED syscall.Errno = 8208 ERROR_DS_NO_MORE_RIDS syscall.Errno = 8209 ERROR_DS_INCORRECT_ROLE_OWNER syscall.Errno = 8210 ERROR_DS_RIDMGR_INIT_ERROR syscall.Errno = 8211 ERROR_DS_OBJ_CLASS_VIOLATION syscall.Errno = 8212 ERROR_DS_CANT_ON_NON_LEAF syscall.Errno = 8213 ERROR_DS_CANT_ON_RDN syscall.Errno = 8214 ERROR_DS_CANT_MOD_OBJ_CLASS syscall.Errno = 8215 ERROR_DS_CROSS_DOM_MOVE_ERROR syscall.Errno = 8216 ERROR_DS_GC_NOT_AVAILABLE syscall.Errno = 8217 ERROR_SHARED_POLICY syscall.Errno = 8218 ERROR_POLICY_OBJECT_NOT_FOUND syscall.Errno = 8219 ERROR_POLICY_ONLY_IN_DS syscall.Errno = 8220 ERROR_PROMOTION_ACTIVE syscall.Errno = 8221 ERROR_NO_PROMOTION_ACTIVE syscall.Errno = 8222 ERROR_DS_OPERATIONS_ERROR syscall.Errno = 8224 ERROR_DS_PROTOCOL_ERROR syscall.Errno = 8225 ERROR_DS_TIMELIMIT_EXCEEDED syscall.Errno = 8226 ERROR_DS_SIZELIMIT_EXCEEDED syscall.Errno = 8227 ERROR_DS_ADMIN_LIMIT_EXCEEDED syscall.Errno = 8228 ERROR_DS_COMPARE_FALSE syscall.Errno = 8229 ERROR_DS_COMPARE_TRUE syscall.Errno = 8230 ERROR_DS_AUTH_METHOD_NOT_SUPPORTED syscall.Errno = 8231 ERROR_DS_STRONG_AUTH_REQUIRED syscall.Errno = 8232 ERROR_DS_INAPPROPRIATE_AUTH syscall.Errno = 8233 ERROR_DS_AUTH_UNKNOWN syscall.Errno = 8234 ERROR_DS_REFERRAL syscall.Errno = 8235 ERROR_DS_UNAVAILABLE_CRIT_EXTENSION syscall.Errno = 8236 ERROR_DS_CONFIDENTIALITY_REQUIRED syscall.Errno = 8237 ERROR_DS_INAPPROPRIATE_MATCHING syscall.Errno = 8238 ERROR_DS_CONSTRAINT_VIOLATION syscall.Errno = 8239 ERROR_DS_NO_SUCH_OBJECT syscall.Errno = 8240 ERROR_DS_ALIAS_PROBLEM syscall.Errno = 8241 ERROR_DS_INVALID_DN_SYNTAX syscall.Errno = 8242 ERROR_DS_IS_LEAF syscall.Errno = 8243 ERROR_DS_ALIAS_DEREF_PROBLEM syscall.Errno = 8244 ERROR_DS_UNWILLING_TO_PERFORM syscall.Errno = 8245 ERROR_DS_LOOP_DETECT syscall.Errno = 8246 ERROR_DS_NAMING_VIOLATION syscall.Errno = 8247 ERROR_DS_OBJECT_RESULTS_TOO_LARGE syscall.Errno = 8248 ERROR_DS_AFFECTS_MULTIPLE_DSAS syscall.Errno = 8249 ERROR_DS_SERVER_DOWN syscall.Errno = 8250 ERROR_DS_LOCAL_ERROR syscall.Errno = 8251 ERROR_DS_ENCODING_ERROR syscall.Errno = 8252 ERROR_DS_DECODING_ERROR syscall.Errno = 8253 ERROR_DS_FILTER_UNKNOWN syscall.Errno = 8254 ERROR_DS_PARAM_ERROR syscall.Errno = 8255 ERROR_DS_NOT_SUPPORTED syscall.Errno = 8256 ERROR_DS_NO_RESULTS_RETURNED syscall.Errno = 8257 ERROR_DS_CONTROL_NOT_FOUND syscall.Errno = 8258 ERROR_DS_CLIENT_LOOP syscall.Errno = 8259 ERROR_DS_REFERRAL_LIMIT_EXCEEDED syscall.Errno = 8260 ERROR_DS_SORT_CONTROL_MISSING syscall.Errno = 8261 ERROR_DS_OFFSET_RANGE_ERROR syscall.Errno = 8262 ERROR_DS_RIDMGR_DISABLED syscall.Errno = 8263 ERROR_DS_ROOT_MUST_BE_NC syscall.Errno = 8301 ERROR_DS_ADD_REPLICA_INHIBITED syscall.Errno = 8302 ERROR_DS_ATT_NOT_DEF_IN_SCHEMA syscall.Errno = 8303 ERROR_DS_MAX_OBJ_SIZE_EXCEEDED syscall.Errno = 8304 ERROR_DS_OBJ_STRING_NAME_EXISTS syscall.Errno = 8305 ERROR_DS_NO_RDN_DEFINED_IN_SCHEMA syscall.Errno = 8306 ERROR_DS_RDN_DOESNT_MATCH_SCHEMA syscall.Errno = 8307 ERROR_DS_NO_REQUESTED_ATTS_FOUND syscall.Errno = 8308 ERROR_DS_USER_BUFFER_TO_SMALL syscall.Errno = 8309 ERROR_DS_ATT_IS_NOT_ON_OBJ syscall.Errno = 8310 ERROR_DS_ILLEGAL_MOD_OPERATION syscall.Errno = 8311 ERROR_DS_OBJ_TOO_LARGE syscall.Errno = 8312 ERROR_DS_BAD_INSTANCE_TYPE syscall.Errno = 8313 ERROR_DS_MASTERDSA_REQUIRED syscall.Errno = 8314 ERROR_DS_OBJECT_CLASS_REQUIRED syscall.Errno = 8315 ERROR_DS_MISSING_REQUIRED_ATT syscall.Errno = 8316 ERROR_DS_ATT_NOT_DEF_FOR_CLASS syscall.Errno = 8317 ERROR_DS_ATT_ALREADY_EXISTS syscall.Errno = 8318 ERROR_DS_CANT_ADD_ATT_VALUES syscall.Errno = 8320 ERROR_DS_SINGLE_VALUE_CONSTRAINT syscall.Errno = 8321 ERROR_DS_RANGE_CONSTRAINT syscall.Errno = 8322 ERROR_DS_ATT_VAL_ALREADY_EXISTS syscall.Errno = 8323 ERROR_DS_CANT_REM_MISSING_ATT syscall.Errno = 8324 ERROR_DS_CANT_REM_MISSING_ATT_VAL syscall.Errno = 8325 ERROR_DS_ROOT_CANT_BE_SUBREF syscall.Errno = 8326 ERROR_DS_NO_CHAINING syscall.Errno = 8327 ERROR_DS_NO_CHAINED_EVAL syscall.Errno = 8328 ERROR_DS_NO_PARENT_OBJECT syscall.Errno = 8329 ERROR_DS_PARENT_IS_AN_ALIAS syscall.Errno = 8330 ERROR_DS_CANT_MIX_MASTER_AND_REPS syscall.Errno = 8331 ERROR_DS_CHILDREN_EXIST syscall.Errno = 8332 ERROR_DS_OBJ_NOT_FOUND syscall.Errno = 8333 ERROR_DS_ALIASED_OBJ_MISSING syscall.Errno = 8334 ERROR_DS_BAD_NAME_SYNTAX syscall.Errno = 8335 ERROR_DS_ALIAS_POINTS_TO_ALIAS syscall.Errno = 8336 ERROR_DS_CANT_DEREF_ALIAS syscall.Errno = 8337 ERROR_DS_OUT_OF_SCOPE syscall.Errno = 8338 ERROR_DS_OBJECT_BEING_REMOVED syscall.Errno = 8339 ERROR_DS_CANT_DELETE_DSA_OBJ syscall.Errno = 8340 ERROR_DS_GENERIC_ERROR syscall.Errno = 8341 ERROR_DS_DSA_MUST_BE_INT_MASTER syscall.Errno = 8342 ERROR_DS_CLASS_NOT_DSA syscall.Errno = 8343 ERROR_DS_INSUFF_ACCESS_RIGHTS syscall.Errno = 8344 ERROR_DS_ILLEGAL_SUPERIOR syscall.Errno = 8345 ERROR_DS_ATTRIBUTE_OWNED_BY_SAM syscall.Errno = 8346 ERROR_DS_NAME_TOO_MANY_PARTS syscall.Errno = 8347 ERROR_DS_NAME_TOO_LONG syscall.Errno = 8348 ERROR_DS_NAME_VALUE_TOO_LONG syscall.Errno = 8349 ERROR_DS_NAME_UNPARSEABLE syscall.Errno = 8350 ERROR_DS_NAME_TYPE_UNKNOWN syscall.Errno = 8351 ERROR_DS_NOT_AN_OBJECT syscall.Errno = 8352 ERROR_DS_SEC_DESC_TOO_SHORT syscall.Errno = 8353 ERROR_DS_SEC_DESC_INVALID syscall.Errno = 8354 ERROR_DS_NO_DELETED_NAME syscall.Errno = 8355 ERROR_DS_SUBREF_MUST_HAVE_PARENT syscall.Errno = 8356 ERROR_DS_NCNAME_MUST_BE_NC syscall.Errno = 8357 ERROR_DS_CANT_ADD_SYSTEM_ONLY syscall.Errno = 8358 ERROR_DS_CLASS_MUST_BE_CONCRETE syscall.Errno = 8359 ERROR_DS_INVALID_DMD syscall.Errno = 8360 ERROR_DS_OBJ_GUID_EXISTS syscall.Errno = 8361 ERROR_DS_NOT_ON_BACKLINK syscall.Errno = 8362 ERROR_DS_NO_CROSSREF_FOR_NC syscall.Errno = 8363 ERROR_DS_SHUTTING_DOWN syscall.Errno = 8364 ERROR_DS_UNKNOWN_OPERATION syscall.Errno = 8365 ERROR_DS_INVALID_ROLE_OWNER syscall.Errno = 8366 ERROR_DS_COULDNT_CONTACT_FSMO syscall.Errno = 8367 ERROR_DS_CROSS_NC_DN_RENAME syscall.Errno = 8368 ERROR_DS_CANT_MOD_SYSTEM_ONLY syscall.Errno = 8369 ERROR_DS_REPLICATOR_ONLY syscall.Errno = 8370 ERROR_DS_OBJ_CLASS_NOT_DEFINED syscall.Errno = 8371 ERROR_DS_OBJ_CLASS_NOT_SUBCLASS syscall.Errno = 8372 ERROR_DS_NAME_REFERENCE_INVALID syscall.Errno = 8373 ERROR_DS_CROSS_REF_EXISTS syscall.Errno = 8374 ERROR_DS_CANT_DEL_MASTER_CROSSREF syscall.Errno = 8375 ERROR_DS_SUBTREE_NOTIFY_NOT_NC_HEAD syscall.Errno = 8376 ERROR_DS_NOTIFY_FILTER_TOO_COMPLEX syscall.Errno = 8377 ERROR_DS_DUP_RDN syscall.Errno = 8378 ERROR_DS_DUP_OID syscall.Errno = 8379 ERROR_DS_DUP_MAPI_ID syscall.Errno = 8380 ERROR_DS_DUP_SCHEMA_ID_GUID syscall.Errno = 8381 ERROR_DS_DUP_LDAP_DISPLAY_NAME syscall.Errno = 8382 ERROR_DS_SEMANTIC_ATT_TEST syscall.Errno = 8383 ERROR_DS_SYNTAX_MISMATCH syscall.Errno = 8384 ERROR_DS_EXISTS_IN_MUST_HAVE syscall.Errno = 8385 ERROR_DS_EXISTS_IN_MAY_HAVE syscall.Errno = 8386 ERROR_DS_NONEXISTENT_MAY_HAVE syscall.Errno = 8387 ERROR_DS_NONEXISTENT_MUST_HAVE syscall.Errno = 8388 ERROR_DS_AUX_CLS_TEST_FAIL syscall.Errno = 8389 ERROR_DS_NONEXISTENT_POSS_SUP syscall.Errno = 8390 ERROR_DS_SUB_CLS_TEST_FAIL syscall.Errno = 8391 ERROR_DS_BAD_RDN_ATT_ID_SYNTAX syscall.Errno = 8392 ERROR_DS_EXISTS_IN_AUX_CLS syscall.Errno = 8393 ERROR_DS_EXISTS_IN_SUB_CLS syscall.Errno = 8394 ERROR_DS_EXISTS_IN_POSS_SUP syscall.Errno = 8395 ERROR_DS_RECALCSCHEMA_FAILED syscall.Errno = 8396 ERROR_DS_TREE_DELETE_NOT_FINISHED syscall.Errno = 8397 ERROR_DS_CANT_DELETE syscall.Errno = 8398 ERROR_DS_ATT_SCHEMA_REQ_ID syscall.Errno = 8399 ERROR_DS_BAD_ATT_SCHEMA_SYNTAX syscall.Errno = 8400 ERROR_DS_CANT_CACHE_ATT syscall.Errno = 8401 ERROR_DS_CANT_CACHE_CLASS syscall.Errno = 8402 ERROR_DS_CANT_REMOVE_ATT_CACHE syscall.Errno = 8403 ERROR_DS_CANT_REMOVE_CLASS_CACHE syscall.Errno = 8404 ERROR_DS_CANT_RETRIEVE_DN syscall.Errno = 8405 ERROR_DS_MISSING_SUPREF syscall.Errno = 8406 ERROR_DS_CANT_RETRIEVE_INSTANCE syscall.Errno = 8407 ERROR_DS_CODE_INCONSISTENCY syscall.Errno = 8408 ERROR_DS_DATABASE_ERROR syscall.Errno = 8409 ERROR_DS_GOVERNSID_MISSING syscall.Errno = 8410 ERROR_DS_MISSING_EXPECTED_ATT syscall.Errno = 8411 ERROR_DS_NCNAME_MISSING_CR_REF syscall.Errno = 8412 ERROR_DS_SECURITY_CHECKING_ERROR syscall.Errno = 8413 ERROR_DS_SCHEMA_NOT_LOADED syscall.Errno = 8414 ERROR_DS_SCHEMA_ALLOC_FAILED syscall.Errno = 8415 ERROR_DS_ATT_SCHEMA_REQ_SYNTAX syscall.Errno = 8416 ERROR_DS_GCVERIFY_ERROR syscall.Errno = 8417 ERROR_DS_DRA_SCHEMA_MISMATCH syscall.Errno = 8418 ERROR_DS_CANT_FIND_DSA_OBJ syscall.Errno = 8419 ERROR_DS_CANT_FIND_EXPECTED_NC syscall.Errno = 8420 ERROR_DS_CANT_FIND_NC_IN_CACHE syscall.Errno = 8421 ERROR_DS_CANT_RETRIEVE_CHILD syscall.Errno = 8422 ERROR_DS_SECURITY_ILLEGAL_MODIFY syscall.Errno = 8423 ERROR_DS_CANT_REPLACE_HIDDEN_REC syscall.Errno = 8424 ERROR_DS_BAD_HIERARCHY_FILE syscall.Errno = 8425 ERROR_DS_BUILD_HIERARCHY_TABLE_FAILED syscall.Errno = 8426 ERROR_DS_CONFIG_PARAM_MISSING syscall.Errno = 8427 ERROR_DS_COUNTING_AB_INDICES_FAILED syscall.Errno = 8428 ERROR_DS_HIERARCHY_TABLE_MALLOC_FAILED syscall.Errno = 8429 ERROR_DS_INTERNAL_FAILURE syscall.Errno = 8430 ERROR_DS_UNKNOWN_ERROR syscall.Errno = 8431 ERROR_DS_ROOT_REQUIRES_CLASS_TOP syscall.Errno = 8432 ERROR_DS_REFUSING_FSMO_ROLES syscall.Errno = 8433 ERROR_DS_MISSING_FSMO_SETTINGS syscall.Errno = 8434 ERROR_DS_UNABLE_TO_SURRENDER_ROLES syscall.Errno = 8435 ERROR_DS_DRA_GENERIC syscall.Errno = 8436 ERROR_DS_DRA_INVALID_PARAMETER syscall.Errno = 8437 ERROR_DS_DRA_BUSY syscall.Errno = 8438 ERROR_DS_DRA_BAD_DN syscall.Errno = 8439 ERROR_DS_DRA_BAD_NC syscall.Errno = 8440 ERROR_DS_DRA_DN_EXISTS syscall.Errno = 8441 ERROR_DS_DRA_INTERNAL_ERROR syscall.Errno = 8442 ERROR_DS_DRA_INCONSISTENT_DIT syscall.Errno = 8443 ERROR_DS_DRA_CONNECTION_FAILED syscall.Errno = 8444 ERROR_DS_DRA_BAD_INSTANCE_TYPE syscall.Errno = 8445 ERROR_DS_DRA_OUT_OF_MEM syscall.Errno = 8446 ERROR_DS_DRA_MAIL_PROBLEM syscall.Errno = 8447 ERROR_DS_DRA_REF_ALREADY_EXISTS syscall.Errno = 8448 ERROR_DS_DRA_REF_NOT_FOUND syscall.Errno = 8449 ERROR_DS_DRA_OBJ_IS_REP_SOURCE syscall.Errno = 8450 ERROR_DS_DRA_DB_ERROR syscall.Errno = 8451 ERROR_DS_DRA_NO_REPLICA syscall.Errno = 8452 ERROR_DS_DRA_ACCESS_DENIED syscall.Errno = 8453 ERROR_DS_DRA_NOT_SUPPORTED syscall.Errno = 8454 ERROR_DS_DRA_RPC_CANCELLED syscall.Errno = 8455 ERROR_DS_DRA_SOURCE_DISABLED syscall.Errno = 8456 ERROR_DS_DRA_SINK_DISABLED syscall.Errno = 8457 ERROR_DS_DRA_NAME_COLLISION syscall.Errno = 8458 ERROR_DS_DRA_SOURCE_REINSTALLED syscall.Errno = 8459 ERROR_DS_DRA_MISSING_PARENT syscall.Errno = 8460 ERROR_DS_DRA_PREEMPTED syscall.Errno = 8461 ERROR_DS_DRA_ABANDON_SYNC syscall.Errno = 8462 ERROR_DS_DRA_SHUTDOWN syscall.Errno = 8463 ERROR_DS_DRA_INCOMPATIBLE_PARTIAL_SET syscall.Errno = 8464 ERROR_DS_DRA_SOURCE_IS_PARTIAL_REPLICA syscall.Errno = 8465 ERROR_DS_DRA_EXTN_CONNECTION_FAILED syscall.Errno = 8466 ERROR_DS_INSTALL_SCHEMA_MISMATCH syscall.Errno = 8467 ERROR_DS_DUP_LINK_ID syscall.Errno = 8468 ERROR_DS_NAME_ERROR_RESOLVING syscall.Errno = 8469 ERROR_DS_NAME_ERROR_NOT_FOUND syscall.Errno = 8470 ERROR_DS_NAME_ERROR_NOT_UNIQUE syscall.Errno = 8471 ERROR_DS_NAME_ERROR_NO_MAPPING syscall.Errno = 8472 ERROR_DS_NAME_ERROR_DOMAIN_ONLY syscall.Errno = 8473 ERROR_DS_NAME_ERROR_NO_SYNTACTICAL_MAPPING syscall.Errno = 8474 ERROR_DS_CONSTRUCTED_ATT_MOD syscall.Errno = 8475 ERROR_DS_WRONG_OM_OBJ_CLASS syscall.Errno = 8476 ERROR_DS_DRA_REPL_PENDING syscall.Errno = 8477 ERROR_DS_DS_REQUIRED syscall.Errno = 8478 ERROR_DS_INVALID_LDAP_DISPLAY_NAME syscall.Errno = 8479 ERROR_DS_NON_BASE_SEARCH syscall.Errno = 8480 ERROR_DS_CANT_RETRIEVE_ATTS syscall.Errno = 8481 ERROR_DS_BACKLINK_WITHOUT_LINK syscall.Errno = 8482 ERROR_DS_EPOCH_MISMATCH syscall.Errno = 8483 ERROR_DS_SRC_NAME_MISMATCH syscall.Errno = 8484 ERROR_DS_SRC_AND_DST_NC_IDENTICAL syscall.Errno = 8485 ERROR_DS_DST_NC_MISMATCH syscall.Errno = 8486 ERROR_DS_NOT_AUTHORITIVE_FOR_DST_NC syscall.Errno = 8487 ERROR_DS_SRC_GUID_MISMATCH syscall.Errno = 8488 ERROR_DS_CANT_MOVE_DELETED_OBJECT syscall.Errno = 8489 ERROR_DS_PDC_OPERATION_IN_PROGRESS syscall.Errno = 8490 ERROR_DS_CROSS_DOMAIN_CLEANUP_REQD syscall.Errno = 8491 ERROR_DS_ILLEGAL_XDOM_MOVE_OPERATION syscall.Errno = 8492 ERROR_DS_CANT_WITH_ACCT_GROUP_MEMBERSHPS syscall.Errno = 8493 ERROR_DS_NC_MUST_HAVE_NC_PARENT syscall.Errno = 8494 ERROR_DS_CR_IMPOSSIBLE_TO_VALIDATE syscall.Errno = 8495 ERROR_DS_DST_DOMAIN_NOT_NATIVE syscall.Errno = 8496 ERROR_DS_MISSING_INFRASTRUCTURE_CONTAINER syscall.Errno = 8497 ERROR_DS_CANT_MOVE_ACCOUNT_GROUP syscall.Errno = 8498 ERROR_DS_CANT_MOVE_RESOURCE_GROUP syscall.Errno = 8499 ERROR_DS_INVALID_SEARCH_FLAG syscall.Errno = 8500 ERROR_DS_NO_TREE_DELETE_ABOVE_NC syscall.Errno = 8501 ERROR_DS_COULDNT_LOCK_TREE_FOR_DELETE syscall.Errno = 8502 ERROR_DS_COULDNT_IDENTIFY_OBJECTS_FOR_TREE_DELETE syscall.Errno = 8503 ERROR_DS_SAM_INIT_FAILURE syscall.Errno = 8504 ERROR_DS_SENSITIVE_GROUP_VIOLATION syscall.Errno = 8505 ERROR_DS_CANT_MOD_PRIMARYGROUPID syscall.Errno = 8506 ERROR_DS_ILLEGAL_BASE_SCHEMA_MOD syscall.Errno = 8507 ERROR_DS_NONSAFE_SCHEMA_CHANGE syscall.Errno = 8508 ERROR_DS_SCHEMA_UPDATE_DISALLOWED syscall.Errno = 8509 ERROR_DS_CANT_CREATE_UNDER_SCHEMA syscall.Errno = 8510 ERROR_DS_INSTALL_NO_SRC_SCH_VERSION syscall.Errno = 8511 ERROR_DS_INSTALL_NO_SCH_VERSION_IN_INIFILE syscall.Errno = 8512 ERROR_DS_INVALID_GROUP_TYPE syscall.Errno = 8513 ERROR_DS_NO_NEST_GLOBALGROUP_IN_MIXEDDOMAIN syscall.Errno = 8514 ERROR_DS_NO_NEST_LOCALGROUP_IN_MIXEDDOMAIN syscall.Errno = 8515 ERROR_DS_GLOBAL_CANT_HAVE_LOCAL_MEMBER syscall.Errno = 8516 ERROR_DS_GLOBAL_CANT_HAVE_UNIVERSAL_MEMBER syscall.Errno = 8517 ERROR_DS_UNIVERSAL_CANT_HAVE_LOCAL_MEMBER syscall.Errno = 8518 ERROR_DS_GLOBAL_CANT_HAVE_CROSSDOMAIN_MEMBER syscall.Errno = 8519 ERROR_DS_LOCAL_CANT_HAVE_CROSSDOMAIN_LOCAL_MEMBER syscall.Errno = 8520 ERROR_DS_HAVE_PRIMARY_MEMBERS syscall.Errno = 8521 ERROR_DS_STRING_SD_CONVERSION_FAILED syscall.Errno = 8522 ERROR_DS_NAMING_MASTER_GC syscall.Errno = 8523 ERROR_DS_DNS_LOOKUP_FAILURE syscall.Errno = 8524 ERROR_DS_COULDNT_UPDATE_SPNS syscall.Errno = 8525 ERROR_DS_CANT_RETRIEVE_SD syscall.Errno = 8526 ERROR_DS_KEY_NOT_UNIQUE syscall.Errno = 8527 ERROR_DS_WRONG_LINKED_ATT_SYNTAX syscall.Errno = 8528 ERROR_DS_SAM_NEED_BOOTKEY_PASSWORD syscall.Errno = 8529 ERROR_DS_SAM_NEED_BOOTKEY_FLOPPY syscall.Errno = 8530 ERROR_DS_CANT_START syscall.Errno = 8531 ERROR_DS_INIT_FAILURE syscall.Errno = 8532 ERROR_DS_NO_PKT_PRIVACY_ON_CONNECTION syscall.Errno = 8533 ERROR_DS_SOURCE_DOMAIN_IN_FOREST syscall.Errno = 8534 ERROR_DS_DESTINATION_DOMAIN_NOT_IN_FOREST syscall.Errno = 8535 ERROR_DS_DESTINATION_AUDITING_NOT_ENABLED syscall.Errno = 8536 ERROR_DS_CANT_FIND_DC_FOR_SRC_DOMAIN syscall.Errno = 8537 ERROR_DS_SRC_OBJ_NOT_GROUP_OR_USER syscall.Errno = 8538 ERROR_DS_SRC_SID_EXISTS_IN_FOREST syscall.Errno = 8539 ERROR_DS_SRC_AND_DST_OBJECT_CLASS_MISMATCH syscall.Errno = 8540 ERROR_SAM_INIT_FAILURE syscall.Errno = 8541 ERROR_DS_DRA_SCHEMA_INFO_SHIP syscall.Errno = 8542 ERROR_DS_DRA_SCHEMA_CONFLICT syscall.Errno = 8543 ERROR_DS_DRA_EARLIER_SCHEMA_CONFLICT syscall.Errno = 8544 ERROR_DS_DRA_OBJ_NC_MISMATCH syscall.Errno = 8545 ERROR_DS_NC_STILL_HAS_DSAS syscall.Errno = 8546 ERROR_DS_GC_REQUIRED syscall.Errno = 8547 ERROR_DS_LOCAL_MEMBER_OF_LOCAL_ONLY syscall.Errno = 8548 ERROR_DS_NO_FPO_IN_UNIVERSAL_GROUPS syscall.Errno = 8549 ERROR_DS_CANT_ADD_TO_GC syscall.Errno = 8550 ERROR_DS_NO_CHECKPOINT_WITH_PDC syscall.Errno = 8551 ERROR_DS_SOURCE_AUDITING_NOT_ENABLED syscall.Errno = 8552 ERROR_DS_CANT_CREATE_IN_NONDOMAIN_NC syscall.Errno = 8553 ERROR_DS_INVALID_NAME_FOR_SPN syscall.Errno = 8554 ERROR_DS_FILTER_USES_CONTRUCTED_ATTRS syscall.Errno = 8555 ERROR_DS_UNICODEPWD_NOT_IN_QUOTES syscall.Errno = 8556 ERROR_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED syscall.Errno = 8557 ERROR_DS_MUST_BE_RUN_ON_DST_DC syscall.Errno = 8558 ERROR_DS_SRC_DC_MUST_BE_SP4_OR_GREATER syscall.Errno = 8559 ERROR_DS_CANT_TREE_DELETE_CRITICAL_OBJ syscall.Errno = 8560 ERROR_DS_INIT_FAILURE_CONSOLE syscall.Errno = 8561 ERROR_DS_SAM_INIT_FAILURE_CONSOLE syscall.Errno = 8562 ERROR_DS_FOREST_VERSION_TOO_HIGH syscall.Errno = 8563 ERROR_DS_DOMAIN_VERSION_TOO_HIGH syscall.Errno = 8564 ERROR_DS_FOREST_VERSION_TOO_LOW syscall.Errno = 8565 ERROR_DS_DOMAIN_VERSION_TOO_LOW syscall.Errno = 8566 ERROR_DS_INCOMPATIBLE_VERSION syscall.Errno = 8567 ERROR_DS_LOW_DSA_VERSION syscall.Errno = 8568 ERROR_DS_NO_BEHAVIOR_VERSION_IN_MIXEDDOMAIN syscall.Errno = 8569 ERROR_DS_NOT_SUPPORTED_SORT_ORDER syscall.Errno = 8570 ERROR_DS_NAME_NOT_UNIQUE syscall.Errno = 8571 ERROR_DS_MACHINE_ACCOUNT_CREATED_PRENT4 syscall.Errno = 8572 ERROR_DS_OUT_OF_VERSION_STORE syscall.Errno = 8573 ERROR_DS_INCOMPATIBLE_CONTROLS_USED syscall.Errno = 8574 ERROR_DS_NO_REF_DOMAIN syscall.Errno = 8575 ERROR_DS_RESERVED_LINK_ID syscall.Errno = 8576 ERROR_DS_LINK_ID_NOT_AVAILABLE syscall.Errno = 8577 ERROR_DS_AG_CANT_HAVE_UNIVERSAL_MEMBER syscall.Errno = 8578 ERROR_DS_MODIFYDN_DISALLOWED_BY_INSTANCE_TYPE syscall.Errno = 8579 ERROR_DS_NO_OBJECT_MOVE_IN_SCHEMA_NC syscall.Errno = 8580 ERROR_DS_MODIFYDN_DISALLOWED_BY_FLAG syscall.Errno = 8581 ERROR_DS_MODIFYDN_WRONG_GRANDPARENT syscall.Errno = 8582 ERROR_DS_NAME_ERROR_TRUST_REFERRAL syscall.Errno = 8583 ERROR_NOT_SUPPORTED_ON_STANDARD_SERVER syscall.Errno = 8584 ERROR_DS_CANT_ACCESS_REMOTE_PART_OF_AD syscall.Errno = 8585 ERROR_DS_CR_IMPOSSIBLE_TO_VALIDATE_V2 syscall.Errno = 8586 ERROR_DS_THREAD_LIMIT_EXCEEDED syscall.Errno = 8587 ERROR_DS_NOT_CLOSEST syscall.Errno = 8588 ERROR_DS_CANT_DERIVE_SPN_WITHOUT_SERVER_REF syscall.Errno = 8589 ERROR_DS_SINGLE_USER_MODE_FAILED syscall.Errno = 8590 ERROR_DS_NTDSCRIPT_SYNTAX_ERROR syscall.Errno = 8591 ERROR_DS_NTDSCRIPT_PROCESS_ERROR syscall.Errno = 8592 ERROR_DS_DIFFERENT_REPL_EPOCHS syscall.Errno = 8593 ERROR_DS_DRS_EXTENSIONS_CHANGED syscall.Errno = 8594 ERROR_DS_REPLICA_SET_CHANGE_NOT_ALLOWED_ON_DISABLED_CR syscall.Errno = 8595 ERROR_DS_NO_MSDS_INTID syscall.Errno = 8596 ERROR_DS_DUP_MSDS_INTID syscall.Errno = 8597 ERROR_DS_EXISTS_IN_RDNATTID syscall.Errno = 8598 ERROR_DS_AUTHORIZATION_FAILED syscall.Errno = 8599 ERROR_DS_INVALID_SCRIPT syscall.Errno = 8600 ERROR_DS_REMOTE_CROSSREF_OP_FAILED syscall.Errno = 8601 ERROR_DS_CROSS_REF_BUSY syscall.Errno = 8602 ERROR_DS_CANT_DERIVE_SPN_FOR_DELETED_DOMAIN syscall.Errno = 8603 ERROR_DS_CANT_DEMOTE_WITH_WRITEABLE_NC syscall.Errno = 8604 ERROR_DS_DUPLICATE_ID_FOUND syscall.Errno = 8605 ERROR_DS_INSUFFICIENT_ATTR_TO_CREATE_OBJECT syscall.Errno = 8606 ERROR_DS_GROUP_CONVERSION_ERROR syscall.Errno = 8607 ERROR_DS_CANT_MOVE_APP_BASIC_GROUP syscall.Errno = 8608 ERROR_DS_CANT_MOVE_APP_QUERY_GROUP syscall.Errno = 8609 ERROR_DS_ROLE_NOT_VERIFIED syscall.Errno = 8610 ERROR_DS_WKO_CONTAINER_CANNOT_BE_SPECIAL syscall.Errno = 8611 ERROR_DS_DOMAIN_RENAME_IN_PROGRESS syscall.Errno = 8612 ERROR_DS_EXISTING_AD_CHILD_NC syscall.Errno = 8613 ERROR_DS_REPL_LIFETIME_EXCEEDED syscall.Errno = 8614 ERROR_DS_DISALLOWED_IN_SYSTEM_CONTAINER syscall.Errno = 8615 ERROR_DS_LDAP_SEND_QUEUE_FULL syscall.Errno = 8616 ERROR_DS_DRA_OUT_SCHEDULE_WINDOW syscall.Errno = 8617 ERROR_DS_POLICY_NOT_KNOWN syscall.Errno = 8618 ERROR_NO_SITE_SETTINGS_OBJECT syscall.Errno = 8619 ERROR_NO_SECRETS syscall.Errno = 8620 ERROR_NO_WRITABLE_DC_FOUND syscall.Errno = 8621 ERROR_DS_NO_SERVER_OBJECT syscall.Errno = 8622 ERROR_DS_NO_NTDSA_OBJECT syscall.Errno = 8623 ERROR_DS_NON_ASQ_SEARCH syscall.Errno = 8624 ERROR_DS_AUDIT_FAILURE syscall.Errno = 8625 ERROR_DS_INVALID_SEARCH_FLAG_SUBTREE syscall.Errno = 8626 ERROR_DS_INVALID_SEARCH_FLAG_TUPLE syscall.Errno = 8627 ERROR_DS_HIERARCHY_TABLE_TOO_DEEP syscall.Errno = 8628 ERROR_DS_DRA_CORRUPT_UTD_VECTOR syscall.Errno = 8629 ERROR_DS_DRA_SECRETS_DENIED syscall.Errno = 8630 ERROR_DS_RESERVED_MAPI_ID syscall.Errno = 8631 ERROR_DS_MAPI_ID_NOT_AVAILABLE syscall.Errno = 8632 ERROR_DS_DRA_MISSING_KRBTGT_SECRET syscall.Errno = 8633 ERROR_DS_DOMAIN_NAME_EXISTS_IN_FOREST syscall.Errno = 8634 ERROR_DS_FLAT_NAME_EXISTS_IN_FOREST syscall.Errno = 8635 ERROR_INVALID_USER_PRINCIPAL_NAME syscall.Errno = 8636 ERROR_DS_OID_MAPPED_GROUP_CANT_HAVE_MEMBERS syscall.Errno = 8637 ERROR_DS_OID_NOT_FOUND syscall.Errno = 8638 ERROR_DS_DRA_RECYCLED_TARGET syscall.Errno = 8639 ERROR_DS_DISALLOWED_NC_REDIRECT syscall.Errno = 8640 ERROR_DS_HIGH_ADLDS_FFL syscall.Errno = 8641 ERROR_DS_HIGH_DSA_VERSION syscall.Errno = 8642 ERROR_DS_LOW_ADLDS_FFL syscall.Errno = 8643 ERROR_DOMAIN_SID_SAME_AS_LOCAL_WORKSTATION syscall.Errno = 8644 ERROR_DS_UNDELETE_SAM_VALIDATION_FAILED syscall.Errno = 8645 ERROR_INCORRECT_ACCOUNT_TYPE syscall.Errno = 8646 ERROR_DS_SPN_VALUE_NOT_UNIQUE_IN_FOREST syscall.Errno = 8647 ERROR_DS_UPN_VALUE_NOT_UNIQUE_IN_FOREST syscall.Errno = 8648 ERROR_DS_MISSING_FOREST_TRUST syscall.Errno = 8649 ERROR_DS_VALUE_KEY_NOT_UNIQUE syscall.Errno = 8650 DNS_ERROR_RESPONSE_CODES_BASE syscall.Errno = 9000 DNS_ERROR_RCODE_NO_ERROR = ERROR_SUCCESS DNS_ERROR_MASK syscall.Errno = 0x00002328 DNS_ERROR_RCODE_FORMAT_ERROR syscall.Errno = 9001 DNS_ERROR_RCODE_SERVER_FAILURE syscall.Errno = 9002 DNS_ERROR_RCODE_NAME_ERROR syscall.Errno = 9003 DNS_ERROR_RCODE_NOT_IMPLEMENTED syscall.Errno = 9004 DNS_ERROR_RCODE_REFUSED syscall.Errno = 9005 DNS_ERROR_RCODE_YXDOMAIN syscall.Errno = 9006 DNS_ERROR_RCODE_YXRRSET syscall.Errno = 9007 DNS_ERROR_RCODE_NXRRSET syscall.Errno = 9008 DNS_ERROR_RCODE_NOTAUTH syscall.Errno = 9009 DNS_ERROR_RCODE_NOTZONE syscall.Errno = 9010 DNS_ERROR_RCODE_BADSIG syscall.Errno = 9016 DNS_ERROR_RCODE_BADKEY syscall.Errno = 9017 DNS_ERROR_RCODE_BADTIME syscall.Errno = 9018 DNS_ERROR_RCODE_LAST = DNS_ERROR_RCODE_BADTIME DNS_ERROR_DNSSEC_BASE syscall.Errno = 9100 DNS_ERROR_KEYMASTER_REQUIRED syscall.Errno = 9101 DNS_ERROR_NOT_ALLOWED_ON_SIGNED_ZONE syscall.Errno = 9102 DNS_ERROR_NSEC3_INCOMPATIBLE_WITH_RSA_SHA1 syscall.Errno = 9103 DNS_ERROR_NOT_ENOUGH_SIGNING_KEY_DESCRIPTORS syscall.Errno = 9104 DNS_ERROR_UNSUPPORTED_ALGORITHM syscall.Errno = 9105 DNS_ERROR_INVALID_KEY_SIZE syscall.Errno = 9106 DNS_ERROR_SIGNING_KEY_NOT_ACCESSIBLE syscall.Errno = 9107 DNS_ERROR_KSP_DOES_NOT_SUPPORT_PROTECTION syscall.Errno = 9108 DNS_ERROR_UNEXPECTED_DATA_PROTECTION_ERROR syscall.Errno = 9109 DNS_ERROR_UNEXPECTED_CNG_ERROR syscall.Errno = 9110 DNS_ERROR_UNKNOWN_SIGNING_PARAMETER_VERSION syscall.Errno = 9111 DNS_ERROR_KSP_NOT_ACCESSIBLE syscall.Errno = 9112 DNS_ERROR_TOO_MANY_SKDS syscall.Errno = 9113 DNS_ERROR_INVALID_ROLLOVER_PERIOD syscall.Errno = 9114 DNS_ERROR_INVALID_INITIAL_ROLLOVER_OFFSET syscall.Errno = 9115 DNS_ERROR_ROLLOVER_IN_PROGRESS syscall.Errno = 9116 DNS_ERROR_STANDBY_KEY_NOT_PRESENT syscall.Errno = 9117 DNS_ERROR_NOT_ALLOWED_ON_ZSK syscall.Errno = 9118 DNS_ERROR_NOT_ALLOWED_ON_ACTIVE_SKD syscall.Errno = 9119 DNS_ERROR_ROLLOVER_ALREADY_QUEUED syscall.Errno = 9120 DNS_ERROR_NOT_ALLOWED_ON_UNSIGNED_ZONE syscall.Errno = 9121 DNS_ERROR_BAD_KEYMASTER syscall.Errno = 9122 DNS_ERROR_INVALID_SIGNATURE_VALIDITY_PERIOD syscall.Errno = 9123 DNS_ERROR_INVALID_NSEC3_ITERATION_COUNT syscall.Errno = 9124 DNS_ERROR_DNSSEC_IS_DISABLED syscall.Errno = 9125 DNS_ERROR_INVALID_XML syscall.Errno = 9126 DNS_ERROR_NO_VALID_TRUST_ANCHORS syscall.Errno = 9127 DNS_ERROR_ROLLOVER_NOT_POKEABLE syscall.Errno = 9128 DNS_ERROR_NSEC3_NAME_COLLISION syscall.Errno = 9129 DNS_ERROR_NSEC_INCOMPATIBLE_WITH_NSEC3_RSA_SHA1 syscall.Errno = 9130 DNS_ERROR_PACKET_FMT_BASE syscall.Errno = 9500 DNS_INFO_NO_RECORDS syscall.Errno = 9501 DNS_ERROR_BAD_PACKET syscall.Errno = 9502 DNS_ERROR_NO_PACKET syscall.Errno = 9503 DNS_ERROR_RCODE syscall.Errno = 9504 DNS_ERROR_UNSECURE_PACKET syscall.Errno = 9505 DNS_STATUS_PACKET_UNSECURE = DNS_ERROR_UNSECURE_PACKET DNS_REQUEST_PENDING syscall.Errno = 9506 DNS_ERROR_NO_MEMORY = ERROR_OUTOFMEMORY DNS_ERROR_INVALID_NAME = ERROR_INVALID_NAME DNS_ERROR_INVALID_DATA = ERROR_INVALID_DATA DNS_ERROR_GENERAL_API_BASE syscall.Errno = 9550 DNS_ERROR_INVALID_TYPE syscall.Errno = 9551 DNS_ERROR_INVALID_IP_ADDRESS syscall.Errno = 9552 DNS_ERROR_INVALID_PROPERTY syscall.Errno = 9553 DNS_ERROR_TRY_AGAIN_LATER syscall.Errno = 9554 DNS_ERROR_NOT_UNIQUE syscall.Errno = 9555 DNS_ERROR_NON_RFC_NAME syscall.Errno = 9556 DNS_STATUS_FQDN syscall.Errno = 9557 DNS_STATUS_DOTTED_NAME syscall.Errno = 9558 DNS_STATUS_SINGLE_PART_NAME syscall.Errno = 9559 DNS_ERROR_INVALID_NAME_CHAR syscall.Errno = 9560 DNS_ERROR_NUMERIC_NAME syscall.Errno = 9561 DNS_ERROR_NOT_ALLOWED_ON_ROOT_SERVER syscall.Errno = 9562 DNS_ERROR_NOT_ALLOWED_UNDER_DELEGATION syscall.Errno = 9563 DNS_ERROR_CANNOT_FIND_ROOT_HINTS syscall.Errno = 9564 DNS_ERROR_INCONSISTENT_ROOT_HINTS syscall.Errno = 9565 DNS_ERROR_DWORD_VALUE_TOO_SMALL syscall.Errno = 9566 DNS_ERROR_DWORD_VALUE_TOO_LARGE syscall.Errno = 9567 DNS_ERROR_BACKGROUND_LOADING syscall.Errno = 9568 DNS_ERROR_NOT_ALLOWED_ON_RODC syscall.Errno = 9569 DNS_ERROR_NOT_ALLOWED_UNDER_DNAME syscall.Errno = 9570 DNS_ERROR_DELEGATION_REQUIRED syscall.Errno = 9571 DNS_ERROR_INVALID_POLICY_TABLE syscall.Errno = 9572 DNS_ERROR_ADDRESS_REQUIRED syscall.Errno = 9573 DNS_ERROR_ZONE_BASE syscall.Errno = 9600 DNS_ERROR_ZONE_DOES_NOT_EXIST syscall.Errno = 9601 DNS_ERROR_NO_ZONE_INFO syscall.Errno = 9602 DNS_ERROR_INVALID_ZONE_OPERATION syscall.Errno = 9603 DNS_ERROR_ZONE_CONFIGURATION_ERROR syscall.Errno = 9604 DNS_ERROR_ZONE_HAS_NO_SOA_RECORD syscall.Errno = 9605 DNS_ERROR_ZONE_HAS_NO_NS_RECORDS syscall.Errno = 9606 DNS_ERROR_ZONE_LOCKED syscall.Errno = 9607 DNS_ERROR_ZONE_CREATION_FAILED syscall.Errno = 9608 DNS_ERROR_ZONE_ALREADY_EXISTS syscall.Errno = 9609 DNS_ERROR_AUTOZONE_ALREADY_EXISTS syscall.Errno = 9610 DNS_ERROR_INVALID_ZONE_TYPE syscall.Errno = 9611 DNS_ERROR_SECONDARY_REQUIRES_MASTER_IP syscall.Errno = 9612 DNS_ERROR_ZONE_NOT_SECONDARY syscall.Errno = 9613 DNS_ERROR_NEED_SECONDARY_ADDRESSES syscall.Errno = 9614 DNS_ERROR_WINS_INIT_FAILED syscall.Errno = 9615 DNS_ERROR_NEED_WINS_SERVERS syscall.Errno = 9616 DNS_ERROR_NBSTAT_INIT_FAILED syscall.Errno = 9617 DNS_ERROR_SOA_DELETE_INVALID syscall.Errno = 9618 DNS_ERROR_FORWARDER_ALREADY_EXISTS syscall.Errno = 9619 DNS_ERROR_ZONE_REQUIRES_MASTER_IP syscall.Errno = 9620 DNS_ERROR_ZONE_IS_SHUTDOWN syscall.Errno = 9621 DNS_ERROR_ZONE_LOCKED_FOR_SIGNING syscall.Errno = 9622 DNS_ERROR_DATAFILE_BASE syscall.Errno = 9650 DNS_ERROR_PRIMARY_REQUIRES_DATAFILE syscall.Errno = 9651 DNS_ERROR_INVALID_DATAFILE_NAME syscall.Errno = 9652 DNS_ERROR_DATAFILE_OPEN_FAILURE syscall.Errno = 9653 DNS_ERROR_FILE_WRITEBACK_FAILED syscall.Errno = 9654 DNS_ERROR_DATAFILE_PARSING syscall.Errno = 9655 DNS_ERROR_DATABASE_BASE syscall.Errno = 9700 DNS_ERROR_RECORD_DOES_NOT_EXIST syscall.Errno = 9701 DNS_ERROR_RECORD_FORMAT syscall.Errno = 9702 DNS_ERROR_NODE_CREATION_FAILED syscall.Errno = 9703 DNS_ERROR_UNKNOWN_RECORD_TYPE syscall.Errno = 9704 DNS_ERROR_RECORD_TIMED_OUT syscall.Errno = 9705 DNS_ERROR_NAME_NOT_IN_ZONE syscall.Errno = 9706 DNS_ERROR_CNAME_LOOP syscall.Errno = 9707 DNS_ERROR_NODE_IS_CNAME syscall.Errno = 9708 DNS_ERROR_CNAME_COLLISION syscall.Errno = 9709 DNS_ERROR_RECORD_ONLY_AT_ZONE_ROOT syscall.Errno = 9710 DNS_ERROR_RECORD_ALREADY_EXISTS syscall.Errno = 9711 DNS_ERROR_SECONDARY_DATA syscall.Errno = 9712 DNS_ERROR_NO_CREATE_CACHE_DATA syscall.Errno = 9713 DNS_ERROR_NAME_DOES_NOT_EXIST syscall.Errno = 9714 DNS_WARNING_PTR_CREATE_FAILED syscall.Errno = 9715 DNS_WARNING_DOMAIN_UNDELETED syscall.Errno = 9716 DNS_ERROR_DS_UNAVAILABLE syscall.Errno = 9717 DNS_ERROR_DS_ZONE_ALREADY_EXISTS syscall.Errno = 9718 DNS_ERROR_NO_BOOTFILE_IF_DS_ZONE syscall.Errno = 9719 DNS_ERROR_NODE_IS_DNAME syscall.Errno = 9720 DNS_ERROR_DNAME_COLLISION syscall.Errno = 9721 DNS_ERROR_ALIAS_LOOP syscall.Errno = 9722 DNS_ERROR_OPERATION_BASE syscall.Errno = 9750 DNS_INFO_AXFR_COMPLETE syscall.Errno = 9751 DNS_ERROR_AXFR syscall.Errno = 9752 DNS_INFO_ADDED_LOCAL_WINS syscall.Errno = 9753 DNS_ERROR_SECURE_BASE syscall.Errno = 9800 DNS_STATUS_CONTINUE_NEEDED syscall.Errno = 9801 DNS_ERROR_SETUP_BASE syscall.Errno = 9850 DNS_ERROR_NO_TCPIP syscall.Errno = 9851 DNS_ERROR_NO_DNS_SERVERS syscall.Errno = 9852 DNS_ERROR_DP_BASE syscall.Errno = 9900 DNS_ERROR_DP_DOES_NOT_EXIST syscall.Errno = 9901 DNS_ERROR_DP_ALREADY_EXISTS syscall.Errno = 9902 DNS_ERROR_DP_NOT_ENLISTED syscall.Errno = 9903 DNS_ERROR_DP_ALREADY_ENLISTED syscall.Errno = 9904 DNS_ERROR_DP_NOT_AVAILABLE syscall.Errno = 9905 DNS_ERROR_DP_FSMO_ERROR syscall.Errno = 9906 DNS_ERROR_RRL_NOT_ENABLED syscall.Errno = 9911 DNS_ERROR_RRL_INVALID_WINDOW_SIZE syscall.Errno = 9912 DNS_ERROR_RRL_INVALID_IPV4_PREFIX syscall.Errno = 9913 DNS_ERROR_RRL_INVALID_IPV6_PREFIX syscall.Errno = 9914 DNS_ERROR_RRL_INVALID_TC_RATE syscall.Errno = 9915 DNS_ERROR_RRL_INVALID_LEAK_RATE syscall.Errno = 9916 DNS_ERROR_RRL_LEAK_RATE_LESSTHAN_TC_RATE syscall.Errno = 9917 DNS_ERROR_VIRTUALIZATION_INSTANCE_ALREADY_EXISTS syscall.Errno = 9921 DNS_ERROR_VIRTUALIZATION_INSTANCE_DOES_NOT_EXIST syscall.Errno = 9922 DNS_ERROR_VIRTUALIZATION_TREE_LOCKED syscall.Errno = 9923 DNS_ERROR_INVAILD_VIRTUALIZATION_INSTANCE_NAME syscall.Errno = 9924 DNS_ERROR_DEFAULT_VIRTUALIZATION_INSTANCE syscall.Errno = 9925 DNS_ERROR_ZONESCOPE_ALREADY_EXISTS syscall.Errno = 9951 DNS_ERROR_ZONESCOPE_DOES_NOT_EXIST syscall.Errno = 9952 DNS_ERROR_DEFAULT_ZONESCOPE syscall.Errno = 9953 DNS_ERROR_INVALID_ZONESCOPE_NAME syscall.Errno = 9954 DNS_ERROR_NOT_ALLOWED_WITH_ZONESCOPES syscall.Errno = 9955 DNS_ERROR_LOAD_ZONESCOPE_FAILED syscall.Errno = 9956 DNS_ERROR_ZONESCOPE_FILE_WRITEBACK_FAILED syscall.Errno = 9957 DNS_ERROR_INVALID_SCOPE_NAME syscall.Errno = 9958 DNS_ERROR_SCOPE_DOES_NOT_EXIST syscall.Errno = 9959 DNS_ERROR_DEFAULT_SCOPE syscall.Errno = 9960 DNS_ERROR_INVALID_SCOPE_OPERATION syscall.Errno = 9961 DNS_ERROR_SCOPE_LOCKED syscall.Errno = 9962 DNS_ERROR_SCOPE_ALREADY_EXISTS syscall.Errno = 9963 DNS_ERROR_POLICY_ALREADY_EXISTS syscall.Errno = 9971 DNS_ERROR_POLICY_DOES_NOT_EXIST syscall.Errno = 9972 DNS_ERROR_POLICY_INVALID_CRITERIA syscall.Errno = 9973 DNS_ERROR_POLICY_INVALID_SETTINGS syscall.Errno = 9974 DNS_ERROR_CLIENT_SUBNET_IS_ACCESSED syscall.Errno = 9975 DNS_ERROR_CLIENT_SUBNET_DOES_NOT_EXIST syscall.Errno = 9976 DNS_ERROR_CLIENT_SUBNET_ALREADY_EXISTS syscall.Errno = 9977 DNS_ERROR_SUBNET_DOES_NOT_EXIST syscall.Errno = 9978 DNS_ERROR_SUBNET_ALREADY_EXISTS syscall.Errno = 9979 DNS_ERROR_POLICY_LOCKED syscall.Errno = 9980 DNS_ERROR_POLICY_INVALID_WEIGHT syscall.Errno = 9981 DNS_ERROR_POLICY_INVALID_NAME syscall.Errno = 9982 DNS_ERROR_POLICY_MISSING_CRITERIA syscall.Errno = 9983 DNS_ERROR_INVALID_CLIENT_SUBNET_NAME syscall.Errno = 9984 DNS_ERROR_POLICY_PROCESSING_ORDER_INVALID syscall.Errno = 9985 DNS_ERROR_POLICY_SCOPE_MISSING syscall.Errno = 9986 DNS_ERROR_POLICY_SCOPE_NOT_ALLOWED syscall.Errno = 9987 DNS_ERROR_SERVERSCOPE_IS_REFERENCED syscall.Errno = 9988 DNS_ERROR_ZONESCOPE_IS_REFERENCED syscall.Errno = 9989 DNS_ERROR_POLICY_INVALID_CRITERIA_CLIENT_SUBNET syscall.Errno = 9990 DNS_ERROR_POLICY_INVALID_CRITERIA_TRANSPORT_PROTOCOL syscall.Errno = 9991 DNS_ERROR_POLICY_INVALID_CRITERIA_NETWORK_PROTOCOL syscall.Errno = 9992 DNS_ERROR_POLICY_INVALID_CRITERIA_INTERFACE syscall.Errno = 9993 DNS_ERROR_POLICY_INVALID_CRITERIA_FQDN syscall.Errno = 9994 DNS_ERROR_POLICY_INVALID_CRITERIA_QUERY_TYPE syscall.Errno = 9995 DNS_ERROR_POLICY_INVALID_CRITERIA_TIME_OF_DAY syscall.Errno = 9996 WSABASEERR syscall.Errno = 10000 WSAEINTR syscall.Errno = 10004 WSAEBADF syscall.Errno = 10009 WSAEACCES syscall.Errno = 10013 WSAEFAULT syscall.Errno = 10014 WSAEINVAL syscall.Errno = 10022 WSAEMFILE syscall.Errno = 10024 WSAEWOULDBLOCK syscall.Errno = 10035 WSAEINPROGRESS syscall.Errno = 10036 WSAEALREADY syscall.Errno = 10037 WSAENOTSOCK syscall.Errno = 10038 WSAEDESTADDRREQ syscall.Errno = 10039 WSAEMSGSIZE syscall.Errno = 10040 WSAEPROTOTYPE syscall.Errno = 10041 WSAENOPROTOOPT syscall.Errno = 10042 WSAEPROTONOSUPPORT syscall.Errno = 10043 WSAESOCKTNOSUPPORT syscall.Errno = 10044 WSAEOPNOTSUPP syscall.Errno = 10045 WSAEPFNOSUPPORT syscall.Errno = 10046 WSAEAFNOSUPPORT syscall.Errno = 10047 WSAEADDRINUSE syscall.Errno = 10048 WSAEADDRNOTAVAIL syscall.Errno = 10049 WSAENETDOWN syscall.Errno = 10050 WSAENETUNREACH syscall.Errno = 10051 WSAENETRESET syscall.Errno = 10052 WSAECONNABORTED syscall.Errno = 10053 WSAECONNRESET syscall.Errno = 10054 WSAENOBUFS syscall.Errno = 10055 WSAEISCONN syscall.Errno = 10056 WSAENOTCONN syscall.Errno = 10057 WSAESHUTDOWN syscall.Errno = 10058 WSAETOOMANYREFS syscall.Errno = 10059 WSAETIMEDOUT syscall.Errno = 10060 WSAECONNREFUSED syscall.Errno = 10061 WSAELOOP syscall.Errno = 10062 WSAENAMETOOLONG syscall.Errno = 10063 WSAEHOSTDOWN syscall.Errno = 10064 WSAEHOSTUNREACH syscall.Errno = 10065 WSAENOTEMPTY syscall.Errno = 10066 WSAEPROCLIM syscall.Errno = 10067 WSAEUSERS syscall.Errno = 10068 WSAEDQUOT syscall.Errno = 10069 WSAESTALE syscall.Errno = 10070 WSAEREMOTE syscall.Errno = 10071 WSASYSNOTREADY syscall.Errno = 10091 WSAVERNOTSUPPORTED syscall.Errno = 10092 WSANOTINITIALISED syscall.Errno = 10093 WSAEDISCON syscall.Errno = 10101 WSAENOMORE syscall.Errno = 10102 WSAECANCELLED syscall.Errno = 10103 WSAEINVALIDPROCTABLE syscall.Errno = 10104 WSAEINVALIDPROVIDER syscall.Errno = 10105 WSAEPROVIDERFAILEDINIT syscall.Errno = 10106 WSASYSCALLFAILURE syscall.Errno = 10107 WSASERVICE_NOT_FOUND syscall.Errno = 10108 WSATYPE_NOT_FOUND syscall.Errno = 10109 WSA_E_NO_MORE syscall.Errno = 10110 WSA_E_CANCELLED syscall.Errno = 10111 WSAEREFUSED syscall.Errno = 10112 WSAHOST_NOT_FOUND syscall.Errno = 11001 WSATRY_AGAIN syscall.Errno = 11002 WSANO_RECOVERY syscall.Errno = 11003 WSANO_DATA syscall.Errno = 11004 WSA_QOS_RECEIVERS syscall.Errno = 11005 WSA_QOS_SENDERS syscall.Errno = 11006 WSA_QOS_NO_SENDERS syscall.Errno = 11007 WSA_QOS_NO_RECEIVERS syscall.Errno = 11008 WSA_QOS_REQUEST_CONFIRMED syscall.Errno = 11009 WSA_QOS_ADMISSION_FAILURE syscall.Errno = 11010 WSA_QOS_POLICY_FAILURE syscall.Errno = 11011 WSA_QOS_BAD_STYLE syscall.Errno = 11012 WSA_QOS_BAD_OBJECT syscall.Errno = 11013 WSA_QOS_TRAFFIC_CTRL_ERROR syscall.Errno = 11014 WSA_QOS_GENERIC_ERROR syscall.Errno = 11015 WSA_QOS_ESERVICETYPE syscall.Errno = 11016 WSA_QOS_EFLOWSPEC syscall.Errno = 11017 WSA_QOS_EPROVSPECBUF syscall.Errno = 11018 WSA_QOS_EFILTERSTYLE syscall.Errno = 11019 WSA_QOS_EFILTERTYPE syscall.Errno = 11020 WSA_QOS_EFILTERCOUNT syscall.Errno = 11021 WSA_QOS_EOBJLENGTH syscall.Errno = 11022 WSA_QOS_EFLOWCOUNT syscall.Errno = 11023 WSA_QOS_EUNKOWNPSOBJ syscall.Errno = 11024 WSA_QOS_EPOLICYOBJ syscall.Errno = 11025 WSA_QOS_EFLOWDESC syscall.Errno = 11026 WSA_QOS_EPSFLOWSPEC syscall.Errno = 11027 WSA_QOS_EPSFILTERSPEC syscall.Errno = 11028 WSA_QOS_ESDMODEOBJ syscall.Errno = 11029 WSA_QOS_ESHAPERATEOBJ syscall.Errno = 11030 WSA_QOS_RESERVED_PETYPE syscall.Errno = 11031 WSA_SECURE_HOST_NOT_FOUND syscall.Errno = 11032 WSA_IPSEC_NAME_POLICY_ERROR syscall.Errno = 11033 ERROR_IPSEC_QM_POLICY_EXISTS syscall.Errno = 13000 ERROR_IPSEC_QM_POLICY_NOT_FOUND syscall.Errno = 13001 ERROR_IPSEC_QM_POLICY_IN_USE syscall.Errno = 13002 ERROR_IPSEC_MM_POLICY_EXISTS syscall.Errno = 13003 ERROR_IPSEC_MM_POLICY_NOT_FOUND syscall.Errno = 13004 ERROR_IPSEC_MM_POLICY_IN_USE syscall.Errno = 13005 ERROR_IPSEC_MM_FILTER_EXISTS syscall.Errno = 13006 ERROR_IPSEC_MM_FILTER_NOT_FOUND syscall.Errno = 13007 ERROR_IPSEC_TRANSPORT_FILTER_EXISTS syscall.Errno = 13008 ERROR_IPSEC_TRANSPORT_FILTER_NOT_FOUND syscall.Errno = 13009 ERROR_IPSEC_MM_AUTH_EXISTS syscall.Errno = 13010 ERROR_IPSEC_MM_AUTH_NOT_FOUND syscall.Errno = 13011 ERROR_IPSEC_MM_AUTH_IN_USE syscall.Errno = 13012 ERROR_IPSEC_DEFAULT_MM_POLICY_NOT_FOUND syscall.Errno = 13013 ERROR_IPSEC_DEFAULT_MM_AUTH_NOT_FOUND syscall.Errno = 13014 ERROR_IPSEC_DEFAULT_QM_POLICY_NOT_FOUND syscall.Errno = 13015 ERROR_IPSEC_TUNNEL_FILTER_EXISTS syscall.Errno = 13016 ERROR_IPSEC_TUNNEL_FILTER_NOT_FOUND syscall.Errno = 13017 ERROR_IPSEC_MM_FILTER_PENDING_DELETION syscall.Errno = 13018 ERROR_IPSEC_TRANSPORT_FILTER_PENDING_DELETION syscall.Errno = 13019 ERROR_IPSEC_TUNNEL_FILTER_PENDING_DELETION syscall.Errno = 13020 ERROR_IPSEC_MM_POLICY_PENDING_DELETION syscall.Errno = 13021 ERROR_IPSEC_MM_AUTH_PENDING_DELETION syscall.Errno = 13022 ERROR_IPSEC_QM_POLICY_PENDING_DELETION syscall.Errno = 13023 WARNING_IPSEC_MM_POLICY_PRUNED syscall.Errno = 13024 WARNING_IPSEC_QM_POLICY_PRUNED syscall.Errno = 13025 ERROR_IPSEC_IKE_NEG_STATUS_BEGIN syscall.Errno = 13800 ERROR_IPSEC_IKE_AUTH_FAIL syscall.Errno = 13801 ERROR_IPSEC_IKE_ATTRIB_FAIL syscall.Errno = 13802 ERROR_IPSEC_IKE_NEGOTIATION_PENDING syscall.Errno = 13803 ERROR_IPSEC_IKE_GENERAL_PROCESSING_ERROR syscall.Errno = 13804 ERROR_IPSEC_IKE_TIMED_OUT syscall.Errno = 13805 ERROR_IPSEC_IKE_NO_CERT syscall.Errno = 13806 ERROR_IPSEC_IKE_SA_DELETED syscall.Errno = 13807 ERROR_IPSEC_IKE_SA_REAPED syscall.Errno = 13808 ERROR_IPSEC_IKE_MM_ACQUIRE_DROP syscall.Errno = 13809 ERROR_IPSEC_IKE_QM_ACQUIRE_DROP syscall.Errno = 13810 ERROR_IPSEC_IKE_QUEUE_DROP_MM syscall.Errno = 13811 ERROR_IPSEC_IKE_QUEUE_DROP_NO_MM syscall.Errno = 13812 ERROR_IPSEC_IKE_DROP_NO_RESPONSE syscall.Errno = 13813 ERROR_IPSEC_IKE_MM_DELAY_DROP syscall.Errno = 13814 ERROR_IPSEC_IKE_QM_DELAY_DROP syscall.Errno = 13815 ERROR_IPSEC_IKE_ERROR syscall.Errno = 13816 ERROR_IPSEC_IKE_CRL_FAILED syscall.Errno = 13817 ERROR_IPSEC_IKE_INVALID_KEY_USAGE syscall.Errno = 13818 ERROR_IPSEC_IKE_INVALID_CERT_TYPE syscall.Errno = 13819 ERROR_IPSEC_IKE_NO_PRIVATE_KEY syscall.Errno = 13820 ERROR_IPSEC_IKE_SIMULTANEOUS_REKEY syscall.Errno = 13821 ERROR_IPSEC_IKE_DH_FAIL syscall.Errno = 13822 ERROR_IPSEC_IKE_CRITICAL_PAYLOAD_NOT_RECOGNIZED syscall.Errno = 13823 ERROR_IPSEC_IKE_INVALID_HEADER syscall.Errno = 13824 ERROR_IPSEC_IKE_NO_POLICY syscall.Errno = 13825 ERROR_IPSEC_IKE_INVALID_SIGNATURE syscall.Errno = 13826 ERROR_IPSEC_IKE_KERBEROS_ERROR syscall.Errno = 13827 ERROR_IPSEC_IKE_NO_PUBLIC_KEY syscall.Errno = 13828 ERROR_IPSEC_IKE_PROCESS_ERR syscall.Errno = 13829 ERROR_IPSEC_IKE_PROCESS_ERR_SA syscall.Errno = 13830 ERROR_IPSEC_IKE_PROCESS_ERR_PROP syscall.Errno = 13831 ERROR_IPSEC_IKE_PROCESS_ERR_TRANS syscall.Errno = 13832 ERROR_IPSEC_IKE_PROCESS_ERR_KE syscall.Errno = 13833 ERROR_IPSEC_IKE_PROCESS_ERR_ID syscall.Errno = 13834 ERROR_IPSEC_IKE_PROCESS_ERR_CERT syscall.Errno = 13835 ERROR_IPSEC_IKE_PROCESS_ERR_CERT_REQ syscall.Errno = 13836 ERROR_IPSEC_IKE_PROCESS_ERR_HASH syscall.Errno = 13837 ERROR_IPSEC_IKE_PROCESS_ERR_SIG syscall.Errno = 13838 ERROR_IPSEC_IKE_PROCESS_ERR_NONCE syscall.Errno = 13839 ERROR_IPSEC_IKE_PROCESS_ERR_NOTIFY syscall.Errno = 13840 ERROR_IPSEC_IKE_PROCESS_ERR_DELETE syscall.Errno = 13841 ERROR_IPSEC_IKE_PROCESS_ERR_VENDOR syscall.Errno = 13842 ERROR_IPSEC_IKE_INVALID_PAYLOAD syscall.Errno = 13843 ERROR_IPSEC_IKE_LOAD_SOFT_SA syscall.Errno = 13844 ERROR_IPSEC_IKE_SOFT_SA_TORN_DOWN syscall.Errno = 13845 ERROR_IPSEC_IKE_INVALID_COOKIE syscall.Errno = 13846 ERROR_IPSEC_IKE_NO_PEER_CERT syscall.Errno = 13847 ERROR_IPSEC_IKE_PEER_CRL_FAILED syscall.Errno = 13848 ERROR_IPSEC_IKE_POLICY_CHANGE syscall.Errno = 13849 ERROR_IPSEC_IKE_NO_MM_POLICY syscall.Errno = 13850 ERROR_IPSEC_IKE_NOTCBPRIV syscall.Errno = 13851 ERROR_IPSEC_IKE_SECLOADFAIL syscall.Errno = 13852 ERROR_IPSEC_IKE_FAILSSPINIT syscall.Errno = 13853 ERROR_IPSEC_IKE_FAILQUERYSSP syscall.Errno = 13854 ERROR_IPSEC_IKE_SRVACQFAIL syscall.Errno = 13855 ERROR_IPSEC_IKE_SRVQUERYCRED syscall.Errno = 13856 ERROR_IPSEC_IKE_GETSPIFAIL syscall.Errno = 13857 ERROR_IPSEC_IKE_INVALID_FILTER syscall.Errno = 13858 ERROR_IPSEC_IKE_OUT_OF_MEMORY syscall.Errno = 13859 ERROR_IPSEC_IKE_ADD_UPDATE_KEY_FAILED syscall.Errno = 13860 ERROR_IPSEC_IKE_INVALID_POLICY syscall.Errno = 13861 ERROR_IPSEC_IKE_UNKNOWN_DOI syscall.Errno = 13862 ERROR_IPSEC_IKE_INVALID_SITUATION syscall.Errno = 13863 ERROR_IPSEC_IKE_DH_FAILURE syscall.Errno = 13864 ERROR_IPSEC_IKE_INVALID_GROUP syscall.Errno = 13865 ERROR_IPSEC_IKE_ENCRYPT syscall.Errno = 13866 ERROR_IPSEC_IKE_DECRYPT syscall.Errno = 13867 ERROR_IPSEC_IKE_POLICY_MATCH syscall.Errno = 13868 ERROR_IPSEC_IKE_UNSUPPORTED_ID syscall.Errno = 13869 ERROR_IPSEC_IKE_INVALID_HASH syscall.Errno = 13870 ERROR_IPSEC_IKE_INVALID_HASH_ALG syscall.Errno = 13871 ERROR_IPSEC_IKE_INVALID_HASH_SIZE syscall.Errno = 13872 ERROR_IPSEC_IKE_INVALID_ENCRYPT_ALG syscall.Errno = 13873 ERROR_IPSEC_IKE_INVALID_AUTH_ALG syscall.Errno = 13874 ERROR_IPSEC_IKE_INVALID_SIG syscall.Errno = 13875 ERROR_IPSEC_IKE_LOAD_FAILED syscall.Errno = 13876 ERROR_IPSEC_IKE_RPC_DELETE syscall.Errno = 13877 ERROR_IPSEC_IKE_BENIGN_REINIT syscall.Errno = 13878 ERROR_IPSEC_IKE_INVALID_RESPONDER_LIFETIME_NOTIFY syscall.Errno = 13879 ERROR_IPSEC_IKE_INVALID_MAJOR_VERSION syscall.Errno = 13880 ERROR_IPSEC_IKE_INVALID_CERT_KEYLEN syscall.Errno = 13881 ERROR_IPSEC_IKE_MM_LIMIT syscall.Errno = 13882 ERROR_IPSEC_IKE_NEGOTIATION_DISABLED syscall.Errno = 13883 ERROR_IPSEC_IKE_QM_LIMIT syscall.Errno = 13884 ERROR_IPSEC_IKE_MM_EXPIRED syscall.Errno = 13885 ERROR_IPSEC_IKE_PEER_MM_ASSUMED_INVALID syscall.Errno = 13886 ERROR_IPSEC_IKE_CERT_CHAIN_POLICY_MISMATCH syscall.Errno = 13887 ERROR_IPSEC_IKE_UNEXPECTED_MESSAGE_ID syscall.Errno = 13888 ERROR_IPSEC_IKE_INVALID_AUTH_PAYLOAD syscall.Errno = 13889 ERROR_IPSEC_IKE_DOS_COOKIE_SENT syscall.Errno = 13890 ERROR_IPSEC_IKE_SHUTTING_DOWN syscall.Errno = 13891 ERROR_IPSEC_IKE_CGA_AUTH_FAILED syscall.Errno = 13892 ERROR_IPSEC_IKE_PROCESS_ERR_NATOA syscall.Errno = 13893 ERROR_IPSEC_IKE_INVALID_MM_FOR_QM syscall.Errno = 13894 ERROR_IPSEC_IKE_QM_EXPIRED syscall.Errno = 13895 ERROR_IPSEC_IKE_TOO_MANY_FILTERS syscall.Errno = 13896 ERROR_IPSEC_IKE_NEG_STATUS_END syscall.Errno = 13897 ERROR_IPSEC_IKE_KILL_DUMMY_NAP_TUNNEL syscall.Errno = 13898 ERROR_IPSEC_IKE_INNER_IP_ASSIGNMENT_FAILURE syscall.Errno = 13899 ERROR_IPSEC_IKE_REQUIRE_CP_PAYLOAD_MISSING syscall.Errno = 13900 ERROR_IPSEC_KEY_MODULE_IMPERSONATION_NEGOTIATION_PENDING syscall.Errno = 13901 ERROR_IPSEC_IKE_COEXISTENCE_SUPPRESS syscall.Errno = 13902 ERROR_IPSEC_IKE_RATELIMIT_DROP syscall.Errno = 13903 ERROR_IPSEC_IKE_PEER_DOESNT_SUPPORT_MOBIKE syscall.Errno = 13904 ERROR_IPSEC_IKE_AUTHORIZATION_FAILURE syscall.Errno = 13905 ERROR_IPSEC_IKE_STRONG_CRED_AUTHORIZATION_FAILURE syscall.Errno = 13906 ERROR_IPSEC_IKE_AUTHORIZATION_FAILURE_WITH_OPTIONAL_RETRY syscall.Errno = 13907 ERROR_IPSEC_IKE_STRONG_CRED_AUTHORIZATION_AND_CERTMAP_FAILURE syscall.Errno = 13908 ERROR_IPSEC_IKE_NEG_STATUS_EXTENDED_END syscall.Errno = 13909 ERROR_IPSEC_BAD_SPI syscall.Errno = 13910 ERROR_IPSEC_SA_LIFETIME_EXPIRED syscall.Errno = 13911 ERROR_IPSEC_WRONG_SA syscall.Errno = 13912 ERROR_IPSEC_REPLAY_CHECK_FAILED syscall.Errno = 13913 ERROR_IPSEC_INVALID_PACKET syscall.Errno = 13914 ERROR_IPSEC_INTEGRITY_CHECK_FAILED syscall.Errno = 13915 ERROR_IPSEC_CLEAR_TEXT_DROP syscall.Errno = 13916 ERROR_IPSEC_AUTH_FIREWALL_DROP syscall.Errno = 13917 ERROR_IPSEC_THROTTLE_DROP syscall.Errno = 13918 ERROR_IPSEC_DOSP_BLOCK syscall.Errno = 13925 ERROR_IPSEC_DOSP_RECEIVED_MULTICAST syscall.Errno = 13926 ERROR_IPSEC_DOSP_INVALID_PACKET syscall.Errno = 13927 ERROR_IPSEC_DOSP_STATE_LOOKUP_FAILED syscall.Errno = 13928 ERROR_IPSEC_DOSP_MAX_ENTRIES syscall.Errno = 13929 ERROR_IPSEC_DOSP_KEYMOD_NOT_ALLOWED syscall.Errno = 13930 ERROR_IPSEC_DOSP_NOT_INSTALLED syscall.Errno = 13931 ERROR_IPSEC_DOSP_MAX_PER_IP_RATELIMIT_QUEUES syscall.Errno = 13932 ERROR_SXS_SECTION_NOT_FOUND syscall.Errno = 14000 ERROR_SXS_CANT_GEN_ACTCTX syscall.Errno = 14001 ERROR_SXS_INVALID_ACTCTXDATA_FORMAT syscall.Errno = 14002 ERROR_SXS_ASSEMBLY_NOT_FOUND syscall.Errno = 14003 ERROR_SXS_MANIFEST_FORMAT_ERROR syscall.Errno = 14004 ERROR_SXS_MANIFEST_PARSE_ERROR syscall.Errno = 14005 ERROR_SXS_ACTIVATION_CONTEXT_DISABLED syscall.Errno = 14006 ERROR_SXS_KEY_NOT_FOUND syscall.Errno = 14007 ERROR_SXS_VERSION_CONFLICT syscall.Errno = 14008 ERROR_SXS_WRONG_SECTION_TYPE syscall.Errno = 14009 ERROR_SXS_THREAD_QUERIES_DISABLED syscall.Errno = 14010 ERROR_SXS_PROCESS_DEFAULT_ALREADY_SET syscall.Errno = 14011 ERROR_SXS_UNKNOWN_ENCODING_GROUP syscall.Errno = 14012 ERROR_SXS_UNKNOWN_ENCODING syscall.Errno = 14013 ERROR_SXS_INVALID_XML_NAMESPACE_URI syscall.Errno = 14014 ERROR_SXS_ROOT_MANIFEST_DEPENDENCY_NOT_INSTALLED syscall.Errno = 14015 ERROR_SXS_LEAF_MANIFEST_DEPENDENCY_NOT_INSTALLED syscall.Errno = 14016 ERROR_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE syscall.Errno = 14017 ERROR_SXS_MANIFEST_MISSING_REQUIRED_DEFAULT_NAMESPACE syscall.Errno = 14018 ERROR_SXS_MANIFEST_INVALID_REQUIRED_DEFAULT_NAMESPACE syscall.Errno = 14019 ERROR_SXS_PRIVATE_MANIFEST_CROSS_PATH_WITH_REPARSE_POINT syscall.Errno = 14020 ERROR_SXS_DUPLICATE_DLL_NAME syscall.Errno = 14021 ERROR_SXS_DUPLICATE_WINDOWCLASS_NAME syscall.Errno = 14022 ERROR_SXS_DUPLICATE_CLSID syscall.Errno = 14023 ERROR_SXS_DUPLICATE_IID syscall.Errno = 14024 ERROR_SXS_DUPLICATE_TLBID syscall.Errno = 14025 ERROR_SXS_DUPLICATE_PROGID syscall.Errno = 14026 ERROR_SXS_DUPLICATE_ASSEMBLY_NAME syscall.Errno = 14027 ERROR_SXS_FILE_HASH_MISMATCH syscall.Errno = 14028 ERROR_SXS_POLICY_PARSE_ERROR syscall.Errno = 14029 ERROR_SXS_XML_E_MISSINGQUOTE syscall.Errno = 14030 ERROR_SXS_XML_E_COMMENTSYNTAX syscall.Errno = 14031 ERROR_SXS_XML_E_BADSTARTNAMECHAR syscall.Errno = 14032 ERROR_SXS_XML_E_BADNAMECHAR syscall.Errno = 14033 ERROR_SXS_XML_E_BADCHARINSTRING syscall.Errno = 14034 ERROR_SXS_XML_E_XMLDECLSYNTAX syscall.Errno = 14035 ERROR_SXS_XML_E_BADCHARDATA syscall.Errno = 14036 ERROR_SXS_XML_E_MISSINGWHITESPACE syscall.Errno = 14037 ERROR_SXS_XML_E_EXPECTINGTAGEND syscall.Errno = 14038 ERROR_SXS_XML_E_MISSINGSEMICOLON syscall.Errno = 14039 ERROR_SXS_XML_E_UNBALANCEDPAREN syscall.Errno = 14040 ERROR_SXS_XML_E_INTERNALERROR syscall.Errno = 14041 ERROR_SXS_XML_E_UNEXPECTED_WHITESPACE syscall.Errno = 14042 ERROR_SXS_XML_E_INCOMPLETE_ENCODING syscall.Errno = 14043 ERROR_SXS_XML_E_MISSING_PAREN syscall.Errno = 14044 ERROR_SXS_XML_E_EXPECTINGCLOSEQUOTE syscall.Errno = 14045 ERROR_SXS_XML_E_MULTIPLE_COLONS syscall.Errno = 14046 ERROR_SXS_XML_E_INVALID_DECIMAL syscall.Errno = 14047 ERROR_SXS_XML_E_INVALID_HEXIDECIMAL syscall.Errno = 14048 ERROR_SXS_XML_E_INVALID_UNICODE syscall.Errno = 14049 ERROR_SXS_XML_E_WHITESPACEORQUESTIONMARK syscall.Errno = 14050 ERROR_SXS_XML_E_UNEXPECTEDENDTAG syscall.Errno = 14051 ERROR_SXS_XML_E_UNCLOSEDTAG syscall.Errno = 14052 ERROR_SXS_XML_E_DUPLICATEATTRIBUTE syscall.Errno = 14053 ERROR_SXS_XML_E_MULTIPLEROOTS syscall.Errno = 14054 ERROR_SXS_XML_E_INVALIDATROOTLEVEL syscall.Errno = 14055 ERROR_SXS_XML_E_BADXMLDECL syscall.Errno = 14056 ERROR_SXS_XML_E_MISSINGROOT syscall.Errno = 14057 ERROR_SXS_XML_E_UNEXPECTEDEOF syscall.Errno = 14058 ERROR_SXS_XML_E_BADPEREFINSUBSET syscall.Errno = 14059 ERROR_SXS_XML_E_UNCLOSEDSTARTTAG syscall.Errno = 14060 ERROR_SXS_XML_E_UNCLOSEDENDTAG syscall.Errno = 14061 ERROR_SXS_XML_E_UNCLOSEDSTRING syscall.Errno = 14062 ERROR_SXS_XML_E_UNCLOSEDCOMMENT syscall.Errno = 14063 ERROR_SXS_XML_E_UNCLOSEDDECL syscall.Errno = 14064 ERROR_SXS_XML_E_UNCLOSEDCDATA syscall.Errno = 14065 ERROR_SXS_XML_E_RESERVEDNAMESPACE syscall.Errno = 14066 ERROR_SXS_XML_E_INVALIDENCODING syscall.Errno = 14067 ERROR_SXS_XML_E_INVALIDSWITCH syscall.Errno = 14068 ERROR_SXS_XML_E_BADXMLCASE syscall.Errno = 14069 ERROR_SXS_XML_E_INVALID_STANDALONE syscall.Errno = 14070 ERROR_SXS_XML_E_UNEXPECTED_STANDALONE syscall.Errno = 14071 ERROR_SXS_XML_E_INVALID_VERSION syscall.Errno = 14072 ERROR_SXS_XML_E_MISSINGEQUALS syscall.Errno = 14073 ERROR_SXS_PROTECTION_RECOVERY_FAILED syscall.Errno = 14074 ERROR_SXS_PROTECTION_PUBLIC_KEY_TOO_SHORT syscall.Errno = 14075 ERROR_SXS_PROTECTION_CATALOG_NOT_VALID syscall.Errno = 14076 ERROR_SXS_UNTRANSLATABLE_HRESULT syscall.Errno = 14077 ERROR_SXS_PROTECTION_CATALOG_FILE_MISSING syscall.Errno = 14078 ERROR_SXS_MISSING_ASSEMBLY_IDENTITY_ATTRIBUTE syscall.Errno = 14079 ERROR_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE_NAME syscall.Errno = 14080 ERROR_SXS_ASSEMBLY_MISSING syscall.Errno = 14081 ERROR_SXS_CORRUPT_ACTIVATION_STACK syscall.Errno = 14082 ERROR_SXS_CORRUPTION syscall.Errno = 14083 ERROR_SXS_EARLY_DEACTIVATION syscall.Errno = 14084 ERROR_SXS_INVALID_DEACTIVATION syscall.Errno = 14085 ERROR_SXS_MULTIPLE_DEACTIVATION syscall.Errno = 14086 ERROR_SXS_PROCESS_TERMINATION_REQUESTED syscall.Errno = 14087 ERROR_SXS_RELEASE_ACTIVATION_CONTEXT syscall.Errno = 14088 ERROR_SXS_SYSTEM_DEFAULT_ACTIVATION_CONTEXT_EMPTY syscall.Errno = 14089 ERROR_SXS_INVALID_IDENTITY_ATTRIBUTE_VALUE syscall.Errno = 14090 ERROR_SXS_INVALID_IDENTITY_ATTRIBUTE_NAME syscall.Errno = 14091 ERROR_SXS_IDENTITY_DUPLICATE_ATTRIBUTE syscall.Errno = 14092 ERROR_SXS_IDENTITY_PARSE_ERROR syscall.Errno = 14093 ERROR_MALFORMED_SUBSTITUTION_STRING syscall.Errno = 14094 ERROR_SXS_INCORRECT_PUBLIC_KEY_TOKEN syscall.Errno = 14095 ERROR_UNMAPPED_SUBSTITUTION_STRING syscall.Errno = 14096 ERROR_SXS_ASSEMBLY_NOT_LOCKED syscall.Errno = 14097 ERROR_SXS_COMPONENT_STORE_CORRUPT syscall.Errno = 14098 ERROR_ADVANCED_INSTALLER_FAILED syscall.Errno = 14099 ERROR_XML_ENCODING_MISMATCH syscall.Errno = 14100 ERROR_SXS_MANIFEST_IDENTITY_SAME_BUT_CONTENTS_DIFFERENT syscall.Errno = 14101 ERROR_SXS_IDENTITIES_DIFFERENT syscall.Errno = 14102 ERROR_SXS_ASSEMBLY_IS_NOT_A_DEPLOYMENT syscall.Errno = 14103 ERROR_SXS_FILE_NOT_PART_OF_ASSEMBLY syscall.Errno = 14104 ERROR_SXS_MANIFEST_TOO_BIG syscall.Errno = 14105 ERROR_SXS_SETTING_NOT_REGISTERED syscall.Errno = 14106 ERROR_SXS_TRANSACTION_CLOSURE_INCOMPLETE syscall.Errno = 14107 ERROR_SMI_PRIMITIVE_INSTALLER_FAILED syscall.Errno = 14108 ERROR_GENERIC_COMMAND_FAILED syscall.Errno = 14109 ERROR_SXS_FILE_HASH_MISSING syscall.Errno = 14110 ERROR_SXS_DUPLICATE_ACTIVATABLE_CLASS syscall.Errno = 14111 ERROR_EVT_INVALID_CHANNEL_PATH syscall.Errno = 15000 ERROR_EVT_INVALID_QUERY syscall.Errno = 15001 ERROR_EVT_PUBLISHER_METADATA_NOT_FOUND syscall.Errno = 15002 ERROR_EVT_EVENT_TEMPLATE_NOT_FOUND syscall.Errno = 15003 ERROR_EVT_INVALID_PUBLISHER_NAME syscall.Errno = 15004 ERROR_EVT_INVALID_EVENT_DATA syscall.Errno = 15005 ERROR_EVT_CHANNEL_NOT_FOUND syscall.Errno = 15007 ERROR_EVT_MALFORMED_XML_TEXT syscall.Errno = 15008 ERROR_EVT_SUBSCRIPTION_TO_DIRECT_CHANNEL syscall.Errno = 15009 ERROR_EVT_CONFIGURATION_ERROR syscall.Errno = 15010 ERROR_EVT_QUERY_RESULT_STALE syscall.Errno = 15011 ERROR_EVT_QUERY_RESULT_INVALID_POSITION syscall.Errno = 15012 ERROR_EVT_NON_VALIDATING_MSXML syscall.Errno = 15013 ERROR_EVT_FILTER_ALREADYSCOPED syscall.Errno = 15014 ERROR_EVT_FILTER_NOTELTSET syscall.Errno = 15015 ERROR_EVT_FILTER_INVARG syscall.Errno = 15016 ERROR_EVT_FILTER_INVTEST syscall.Errno = 15017 ERROR_EVT_FILTER_INVTYPE syscall.Errno = 15018 ERROR_EVT_FILTER_PARSEERR syscall.Errno = 15019 ERROR_EVT_FILTER_UNSUPPORTEDOP syscall.Errno = 15020 ERROR_EVT_FILTER_UNEXPECTEDTOKEN syscall.Errno = 15021 ERROR_EVT_INVALID_OPERATION_OVER_ENABLED_DIRECT_CHANNEL syscall.Errno = 15022 ERROR_EVT_INVALID_CHANNEL_PROPERTY_VALUE syscall.Errno = 15023 ERROR_EVT_INVALID_PUBLISHER_PROPERTY_VALUE syscall.Errno = 15024 ERROR_EVT_CHANNEL_CANNOT_ACTIVATE syscall.Errno = 15025 ERROR_EVT_FILTER_TOO_COMPLEX syscall.Errno = 15026 ERROR_EVT_MESSAGE_NOT_FOUND syscall.Errno = 15027 ERROR_EVT_MESSAGE_ID_NOT_FOUND syscall.Errno = 15028 ERROR_EVT_UNRESOLVED_VALUE_INSERT syscall.Errno = 15029 ERROR_EVT_UNRESOLVED_PARAMETER_INSERT syscall.Errno = 15030 ERROR_EVT_MAX_INSERTS_REACHED syscall.Errno = 15031 ERROR_EVT_EVENT_DEFINITION_NOT_FOUND syscall.Errno = 15032 ERROR_EVT_MESSAGE_LOCALE_NOT_FOUND syscall.Errno = 15033 ERROR_EVT_VERSION_TOO_OLD syscall.Errno = 15034 ERROR_EVT_VERSION_TOO_NEW syscall.Errno = 15035 ERROR_EVT_CANNOT_OPEN_CHANNEL_OF_QUERY syscall.Errno = 15036 ERROR_EVT_PUBLISHER_DISABLED syscall.Errno = 15037 ERROR_EVT_FILTER_OUT_OF_RANGE syscall.Errno = 15038 ERROR_EC_SUBSCRIPTION_CANNOT_ACTIVATE syscall.Errno = 15080 ERROR_EC_LOG_DISABLED syscall.Errno = 15081 ERROR_EC_CIRCULAR_FORWARDING syscall.Errno = 15082 ERROR_EC_CREDSTORE_FULL syscall.Errno = 15083 ERROR_EC_CRED_NOT_FOUND syscall.Errno = 15084 ERROR_EC_NO_ACTIVE_CHANNEL syscall.Errno = 15085 ERROR_MUI_FILE_NOT_FOUND syscall.Errno = 15100 ERROR_MUI_INVALID_FILE syscall.Errno = 15101 ERROR_MUI_INVALID_RC_CONFIG syscall.Errno = 15102 ERROR_MUI_INVALID_LOCALE_NAME syscall.Errno = 15103 ERROR_MUI_INVALID_ULTIMATEFALLBACK_NAME syscall.Errno = 15104 ERROR_MUI_FILE_NOT_LOADED syscall.Errno = 15105 ERROR_RESOURCE_ENUM_USER_STOP syscall.Errno = 15106 ERROR_MUI_INTLSETTINGS_UILANG_NOT_INSTALLED syscall.Errno = 15107 ERROR_MUI_INTLSETTINGS_INVALID_LOCALE_NAME syscall.Errno = 15108 ERROR_MRM_RUNTIME_NO_DEFAULT_OR_NEUTRAL_RESOURCE syscall.Errno = 15110 ERROR_MRM_INVALID_PRICONFIG syscall.Errno = 15111 ERROR_MRM_INVALID_FILE_TYPE syscall.Errno = 15112 ERROR_MRM_UNKNOWN_QUALIFIER syscall.Errno = 15113 ERROR_MRM_INVALID_QUALIFIER_VALUE syscall.Errno = 15114 ERROR_MRM_NO_CANDIDATE syscall.Errno = 15115 ERROR_MRM_NO_MATCH_OR_DEFAULT_CANDIDATE syscall.Errno = 15116 ERROR_MRM_RESOURCE_TYPE_MISMATCH syscall.Errno = 15117 ERROR_MRM_DUPLICATE_MAP_NAME syscall.Errno = 15118 ERROR_MRM_DUPLICATE_ENTRY syscall.Errno = 15119 ERROR_MRM_INVALID_RESOURCE_IDENTIFIER syscall.Errno = 15120 ERROR_MRM_FILEPATH_TOO_LONG syscall.Errno = 15121 ERROR_MRM_UNSUPPORTED_DIRECTORY_TYPE syscall.Errno = 15122 ERROR_MRM_INVALID_PRI_FILE syscall.Errno = 15126 ERROR_MRM_NAMED_RESOURCE_NOT_FOUND syscall.Errno = 15127 ERROR_MRM_MAP_NOT_FOUND syscall.Errno = 15135 ERROR_MRM_UNSUPPORTED_PROFILE_TYPE syscall.Errno = 15136 ERROR_MRM_INVALID_QUALIFIER_OPERATOR syscall.Errno = 15137 ERROR_MRM_INDETERMINATE_QUALIFIER_VALUE syscall.Errno = 15138 ERROR_MRM_AUTOMERGE_ENABLED syscall.Errno = 15139 ERROR_MRM_TOO_MANY_RESOURCES syscall.Errno = 15140 ERROR_MRM_UNSUPPORTED_FILE_TYPE_FOR_MERGE syscall.Errno = 15141 ERROR_MRM_UNSUPPORTED_FILE_TYPE_FOR_LOAD_UNLOAD_PRI_FILE syscall.Errno = 15142 ERROR_MRM_NO_CURRENT_VIEW_ON_THREAD syscall.Errno = 15143 ERROR_DIFFERENT_PROFILE_RESOURCE_MANAGER_EXIST syscall.Errno = 15144 ERROR_OPERATION_NOT_ALLOWED_FROM_SYSTEM_COMPONENT syscall.Errno = 15145 ERROR_MRM_DIRECT_REF_TO_NON_DEFAULT_RESOURCE syscall.Errno = 15146 ERROR_MRM_GENERATION_COUNT_MISMATCH syscall.Errno = 15147 ERROR_PRI_MERGE_VERSION_MISMATCH syscall.Errno = 15148 ERROR_PRI_MERGE_MISSING_SCHEMA syscall.Errno = 15149 ERROR_PRI_MERGE_LOAD_FILE_FAILED syscall.Errno = 15150 ERROR_PRI_MERGE_ADD_FILE_FAILED syscall.Errno = 15151 ERROR_PRI_MERGE_WRITE_FILE_FAILED syscall.Errno = 15152 ERROR_PRI_MERGE_MULTIPLE_PACKAGE_FAMILIES_NOT_ALLOWED syscall.Errno = 15153 ERROR_PRI_MERGE_MULTIPLE_MAIN_PACKAGES_NOT_ALLOWED syscall.Errno = 15154 ERROR_PRI_MERGE_BUNDLE_PACKAGES_NOT_ALLOWED syscall.Errno = 15155 ERROR_PRI_MERGE_MAIN_PACKAGE_REQUIRED syscall.Errno = 15156 ERROR_PRI_MERGE_RESOURCE_PACKAGE_REQUIRED syscall.Errno = 15157 ERROR_PRI_MERGE_INVALID_FILE_NAME syscall.Errno = 15158 ERROR_MRM_PACKAGE_NOT_FOUND syscall.Errno = 15159 ERROR_MRM_MISSING_DEFAULT_LANGUAGE syscall.Errno = 15160 ERROR_MCA_INVALID_CAPABILITIES_STRING syscall.Errno = 15200 ERROR_MCA_INVALID_VCP_VERSION syscall.Errno = 15201 ERROR_MCA_MONITOR_VIOLATES_MCCS_SPECIFICATION syscall.Errno = 15202 ERROR_MCA_MCCS_VERSION_MISMATCH syscall.Errno = 15203 ERROR_MCA_UNSUPPORTED_MCCS_VERSION syscall.Errno = 15204 ERROR_MCA_INTERNAL_ERROR syscall.Errno = 15205 ERROR_MCA_INVALID_TECHNOLOGY_TYPE_RETURNED syscall.Errno = 15206 ERROR_MCA_UNSUPPORTED_COLOR_TEMPERATURE syscall.Errno = 15207 ERROR_AMBIGUOUS_SYSTEM_DEVICE syscall.Errno = 15250 ERROR_SYSTEM_DEVICE_NOT_FOUND syscall.Errno = 15299 ERROR_HASH_NOT_SUPPORTED syscall.Errno = 15300 ERROR_HASH_NOT_PRESENT syscall.Errno = 15301 ERROR_SECONDARY_IC_PROVIDER_NOT_REGISTERED syscall.Errno = 15321 ERROR_GPIO_CLIENT_INFORMATION_INVALID syscall.Errno = 15322 ERROR_GPIO_VERSION_NOT_SUPPORTED syscall.Errno = 15323 ERROR_GPIO_INVALID_REGISTRATION_PACKET syscall.Errno = 15324 ERROR_GPIO_OPERATION_DENIED syscall.Errno = 15325 ERROR_GPIO_INCOMPATIBLE_CONNECT_MODE syscall.Errno = 15326 ERROR_GPIO_INTERRUPT_ALREADY_UNMASKED syscall.Errno = 15327 ERROR_CANNOT_SWITCH_RUNLEVEL syscall.Errno = 15400 ERROR_INVALID_RUNLEVEL_SETTING syscall.Errno = 15401 ERROR_RUNLEVEL_SWITCH_TIMEOUT syscall.Errno = 15402 ERROR_RUNLEVEL_SWITCH_AGENT_TIMEOUT syscall.Errno = 15403 ERROR_RUNLEVEL_SWITCH_IN_PROGRESS syscall.Errno = 15404 ERROR_SERVICES_FAILED_AUTOSTART syscall.Errno = 15405 ERROR_COM_TASK_STOP_PENDING syscall.Errno = 15501 ERROR_INSTALL_OPEN_PACKAGE_FAILED syscall.Errno = 15600 ERROR_INSTALL_PACKAGE_NOT_FOUND syscall.Errno = 15601 ERROR_INSTALL_INVALID_PACKAGE syscall.Errno = 15602 ERROR_INSTALL_RESOLVE_DEPENDENCY_FAILED syscall.Errno = 15603 ERROR_INSTALL_OUT_OF_DISK_SPACE syscall.Errno = 15604 ERROR_INSTALL_NETWORK_FAILURE syscall.Errno = 15605 ERROR_INSTALL_REGISTRATION_FAILURE syscall.Errno = 15606 ERROR_INSTALL_DEREGISTRATION_FAILURE syscall.Errno = 15607 ERROR_INSTALL_CANCEL syscall.Errno = 15608 ERROR_INSTALL_FAILED syscall.Errno = 15609 ERROR_REMOVE_FAILED syscall.Errno = 15610 ERROR_PACKAGE_ALREADY_EXISTS syscall.Errno = 15611 ERROR_NEEDS_REMEDIATION syscall.Errno = 15612 ERROR_INSTALL_PREREQUISITE_FAILED syscall.Errno = 15613 ERROR_PACKAGE_REPOSITORY_CORRUPTED syscall.Errno = 15614 ERROR_INSTALL_POLICY_FAILURE syscall.Errno = 15615 ERROR_PACKAGE_UPDATING syscall.Errno = 15616 ERROR_DEPLOYMENT_BLOCKED_BY_POLICY syscall.Errno = 15617 ERROR_PACKAGES_IN_USE syscall.Errno = 15618 ERROR_RECOVERY_FILE_CORRUPT syscall.Errno = 15619 ERROR_INVALID_STAGED_SIGNATURE syscall.Errno = 15620 ERROR_DELETING_EXISTING_APPLICATIONDATA_STORE_FAILED syscall.Errno = 15621 ERROR_INSTALL_PACKAGE_DOWNGRADE syscall.Errno = 15622 ERROR_SYSTEM_NEEDS_REMEDIATION syscall.Errno = 15623 ERROR_APPX_INTEGRITY_FAILURE_CLR_NGEN syscall.Errno = 15624 ERROR_RESILIENCY_FILE_CORRUPT syscall.Errno = 15625 ERROR_INSTALL_FIREWALL_SERVICE_NOT_RUNNING syscall.Errno = 15626 ERROR_PACKAGE_MOVE_FAILED syscall.Errno = 15627 ERROR_INSTALL_VOLUME_NOT_EMPTY syscall.Errno = 15628 ERROR_INSTALL_VOLUME_OFFLINE syscall.Errno = 15629 ERROR_INSTALL_VOLUME_CORRUPT syscall.Errno = 15630 ERROR_NEEDS_REGISTRATION syscall.Errno = 15631 ERROR_INSTALL_WRONG_PROCESSOR_ARCHITECTURE syscall.Errno = 15632 ERROR_DEV_SIDELOAD_LIMIT_EXCEEDED syscall.Errno = 15633 ERROR_INSTALL_OPTIONAL_PACKAGE_REQUIRES_MAIN_PACKAGE syscall.Errno = 15634 ERROR_PACKAGE_NOT_SUPPORTED_ON_FILESYSTEM syscall.Errno = 15635 ERROR_PACKAGE_MOVE_BLOCKED_BY_STREAMING syscall.Errno = 15636 ERROR_INSTALL_OPTIONAL_PACKAGE_APPLICATIONID_NOT_UNIQUE syscall.Errno = 15637 ERROR_PACKAGE_STAGING_ONHOLD syscall.Errno = 15638 ERROR_INSTALL_INVALID_RELATED_SET_UPDATE syscall.Errno = 15639 ERROR_INSTALL_OPTIONAL_PACKAGE_REQUIRES_MAIN_PACKAGE_FULLTRUST_CAPABILITY syscall.Errno = 15640 ERROR_DEPLOYMENT_BLOCKED_BY_USER_LOG_OFF syscall.Errno = 15641 ERROR_PROVISION_OPTIONAL_PACKAGE_REQUIRES_MAIN_PACKAGE_PROVISIONED syscall.Errno = 15642 ERROR_PACKAGES_REPUTATION_CHECK_FAILED syscall.Errno = 15643 ERROR_PACKAGES_REPUTATION_CHECK_TIMEDOUT syscall.Errno = 15644 ERROR_DEPLOYMENT_OPTION_NOT_SUPPORTED syscall.Errno = 15645 ERROR_APPINSTALLER_ACTIVATION_BLOCKED syscall.Errno = 15646 ERROR_REGISTRATION_FROM_REMOTE_DRIVE_NOT_SUPPORTED syscall.Errno = 15647 ERROR_APPX_RAW_DATA_WRITE_FAILED syscall.Errno = 15648 ERROR_DEPLOYMENT_BLOCKED_BY_VOLUME_POLICY_PACKAGE syscall.Errno = 15649 ERROR_DEPLOYMENT_BLOCKED_BY_VOLUME_POLICY_MACHINE syscall.Errno = 15650 ERROR_DEPLOYMENT_BLOCKED_BY_PROFILE_POLICY syscall.Errno = 15651 ERROR_DEPLOYMENT_FAILED_CONFLICTING_MUTABLE_PACKAGE_DIRECTORY syscall.Errno = 15652 ERROR_SINGLETON_RESOURCE_INSTALLED_IN_ACTIVE_USER syscall.Errno = 15653 ERROR_DIFFERENT_VERSION_OF_PACKAGED_SERVICE_INSTALLED syscall.Errno = 15654 ERROR_SERVICE_EXISTS_AS_NON_PACKAGED_SERVICE syscall.Errno = 15655 ERROR_PACKAGED_SERVICE_REQUIRES_ADMIN_PRIVILEGES syscall.Errno = 15656 APPMODEL_ERROR_NO_PACKAGE syscall.Errno = 15700 APPMODEL_ERROR_PACKAGE_RUNTIME_CORRUPT syscall.Errno = 15701 APPMODEL_ERROR_PACKAGE_IDENTITY_CORRUPT syscall.Errno = 15702 APPMODEL_ERROR_NO_APPLICATION syscall.Errno = 15703 APPMODEL_ERROR_DYNAMIC_PROPERTY_READ_FAILED syscall.Errno = 15704 APPMODEL_ERROR_DYNAMIC_PROPERTY_INVALID syscall.Errno = 15705 APPMODEL_ERROR_PACKAGE_NOT_AVAILABLE syscall.Errno = 15706 APPMODEL_ERROR_NO_MUTABLE_DIRECTORY syscall.Errno = 15707 ERROR_STATE_LOAD_STORE_FAILED syscall.Errno = 15800 ERROR_STATE_GET_VERSION_FAILED syscall.Errno = 15801 ERROR_STATE_SET_VERSION_FAILED syscall.Errno = 15802 ERROR_STATE_STRUCTURED_RESET_FAILED syscall.Errno = 15803 ERROR_STATE_OPEN_CONTAINER_FAILED syscall.Errno = 15804 ERROR_STATE_CREATE_CONTAINER_FAILED syscall.Errno = 15805 ERROR_STATE_DELETE_CONTAINER_FAILED syscall.Errno = 15806 ERROR_STATE_READ_SETTING_FAILED syscall.Errno = 15807 ERROR_STATE_WRITE_SETTING_FAILED syscall.Errno = 15808 ERROR_STATE_DELETE_SETTING_FAILED syscall.Errno = 15809 ERROR_STATE_QUERY_SETTING_FAILED syscall.Errno = 15810 ERROR_STATE_READ_COMPOSITE_SETTING_FAILED syscall.Errno = 15811 ERROR_STATE_WRITE_COMPOSITE_SETTING_FAILED syscall.Errno = 15812 ERROR_STATE_ENUMERATE_CONTAINER_FAILED syscall.Errno = 15813 ERROR_STATE_ENUMERATE_SETTINGS_FAILED syscall.Errno = 15814 ERROR_STATE_COMPOSITE_SETTING_VALUE_SIZE_LIMIT_EXCEEDED syscall.Errno = 15815 ERROR_STATE_SETTING_VALUE_SIZE_LIMIT_EXCEEDED syscall.Errno = 15816 ERROR_STATE_SETTING_NAME_SIZE_LIMIT_EXCEEDED syscall.Errno = 15817 ERROR_STATE_CONTAINER_NAME_SIZE_LIMIT_EXCEEDED syscall.Errno = 15818 ERROR_API_UNAVAILABLE syscall.Errno = 15841 STORE_ERROR_UNLICENSED syscall.Errno = 15861 STORE_ERROR_UNLICENSED_USER syscall.Errno = 15862 STORE_ERROR_PENDING_COM_TRANSACTION syscall.Errno = 15863 STORE_ERROR_LICENSE_REVOKED syscall.Errno = 15864 SEVERITY_SUCCESS syscall.Errno = 0 SEVERITY_ERROR syscall.Errno = 1 FACILITY_NT_BIT = 0x10000000 E_NOT_SET = ERROR_NOT_FOUND E_NOT_VALID_STATE = ERROR_INVALID_STATE E_NOT_SUFFICIENT_BUFFER = ERROR_INSUFFICIENT_BUFFER E_TIME_SENSITIVE_THREAD = ERROR_TIME_SENSITIVE_THREAD E_NO_TASK_QUEUE = ERROR_NO_TASK_QUEUE NOERROR syscall.Errno = 0 E_UNEXPECTED Handle = 0x8000FFFF E_NOTIMPL Handle = 0x80004001 E_OUTOFMEMORY Handle = 0x8007000E E_INVALIDARG Handle = 0x80070057 E_NOINTERFACE Handle = 0x80004002 E_POINTER Handle = 0x80004003 E_HANDLE Handle = 0x80070006 E_ABORT Handle = 0x80004004 E_FAIL Handle = 0x80004005 E_ACCESSDENIED Handle = 0x80070005 E_PENDING Handle = 0x8000000A E_BOUNDS Handle = 0x8000000B E_CHANGED_STATE Handle = 0x8000000C E_ILLEGAL_STATE_CHANGE Handle = 0x8000000D E_ILLEGAL_METHOD_CALL Handle = 0x8000000E RO_E_METADATA_NAME_NOT_FOUND Handle = 0x8000000F RO_E_METADATA_NAME_IS_NAMESPACE Handle = 0x80000010 RO_E_METADATA_INVALID_TYPE_FORMAT Handle = 0x80000011 RO_E_INVALID_METADATA_FILE Handle = 0x80000012 RO_E_CLOSED Handle = 0x80000013 RO_E_EXCLUSIVE_WRITE Handle = 0x80000014 RO_E_CHANGE_NOTIFICATION_IN_PROGRESS Handle = 0x80000015 RO_E_ERROR_STRING_NOT_FOUND Handle = 0x80000016 E_STRING_NOT_NULL_TERMINATED Handle = 0x80000017 E_ILLEGAL_DELEGATE_ASSIGNMENT Handle = 0x80000018 E_ASYNC_OPERATION_NOT_STARTED Handle = 0x80000019 E_APPLICATION_EXITING Handle = 0x8000001A E_APPLICATION_VIEW_EXITING Handle = 0x8000001B RO_E_MUST_BE_AGILE Handle = 0x8000001C RO_E_UNSUPPORTED_FROM_MTA Handle = 0x8000001D RO_E_COMMITTED Handle = 0x8000001E RO_E_BLOCKED_CROSS_ASTA_CALL Handle = 0x8000001F RO_E_CANNOT_ACTIVATE_FULL_TRUST_SERVER Handle = 0x80000020 RO_E_CANNOT_ACTIVATE_UNIVERSAL_APPLICATION_SERVER Handle = 0x80000021 CO_E_INIT_TLS Handle = 0x80004006 CO_E_INIT_SHARED_ALLOCATOR Handle = 0x80004007 CO_E_INIT_MEMORY_ALLOCATOR Handle = 0x80004008 CO_E_INIT_CLASS_CACHE Handle = 0x80004009 CO_E_INIT_RPC_CHANNEL Handle = 0x8000400A CO_E_INIT_TLS_SET_CHANNEL_CONTROL Handle = 0x8000400B CO_E_INIT_TLS_CHANNEL_CONTROL Handle = 0x8000400C CO_E_INIT_UNACCEPTED_USER_ALLOCATOR Handle = 0x8000400D CO_E_INIT_SCM_MUTEX_EXISTS Handle = 0x8000400E CO_E_INIT_SCM_FILE_MAPPING_EXISTS Handle = 0x8000400F CO_E_INIT_SCM_MAP_VIEW_OF_FILE Handle = 0x80004010 CO_E_INIT_SCM_EXEC_FAILURE Handle = 0x80004011 CO_E_INIT_ONLY_SINGLE_THREADED Handle = 0x80004012 CO_E_CANT_REMOTE Handle = 0x80004013 CO_E_BAD_SERVER_NAME Handle = 0x80004014 CO_E_WRONG_SERVER_IDENTITY Handle = 0x80004015 CO_E_OLE1DDE_DISABLED Handle = 0x80004016 CO_E_RUNAS_SYNTAX Handle = 0x80004017 CO_E_CREATEPROCESS_FAILURE Handle = 0x80004018 CO_E_RUNAS_CREATEPROCESS_FAILURE Handle = 0x80004019 CO_E_RUNAS_LOGON_FAILURE Handle = 0x8000401A CO_E_LAUNCH_PERMSSION_DENIED Handle = 0x8000401B CO_E_START_SERVICE_FAILURE Handle = 0x8000401C CO_E_REMOTE_COMMUNICATION_FAILURE Handle = 0x8000401D CO_E_SERVER_START_TIMEOUT Handle = 0x8000401E CO_E_CLSREG_INCONSISTENT Handle = 0x8000401F CO_E_IIDREG_INCONSISTENT Handle = 0x80004020 CO_E_NOT_SUPPORTED Handle = 0x80004021 CO_E_RELOAD_DLL Handle = 0x80004022 CO_E_MSI_ERROR Handle = 0x80004023 CO_E_ATTEMPT_TO_CREATE_OUTSIDE_CLIENT_CONTEXT Handle = 0x80004024 CO_E_SERVER_PAUSED Handle = 0x80004025 CO_E_SERVER_NOT_PAUSED Handle = 0x80004026 CO_E_CLASS_DISABLED Handle = 0x80004027 CO_E_CLRNOTAVAILABLE Handle = 0x80004028 CO_E_ASYNC_WORK_REJECTED Handle = 0x80004029 CO_E_SERVER_INIT_TIMEOUT Handle = 0x8000402A CO_E_NO_SECCTX_IN_ACTIVATE Handle = 0x8000402B CO_E_TRACKER_CONFIG Handle = 0x80004030 CO_E_THREADPOOL_CONFIG Handle = 0x80004031 CO_E_SXS_CONFIG Handle = 0x80004032 CO_E_MALFORMED_SPN Handle = 0x80004033 CO_E_UNREVOKED_REGISTRATION_ON_APARTMENT_SHUTDOWN Handle = 0x80004034 CO_E_PREMATURE_STUB_RUNDOWN Handle = 0x80004035 S_OK Handle = 0 S_FALSE Handle = 1 OLE_E_FIRST Handle = 0x80040000 OLE_E_LAST Handle = 0x800400FF OLE_S_FIRST Handle = 0x00040000 OLE_S_LAST Handle = 0x000400FF OLE_E_OLEVERB Handle = 0x80040000 OLE_E_ADVF Handle = 0x80040001 OLE_E_ENUM_NOMORE Handle = 0x80040002 OLE_E_ADVISENOTSUPPORTED Handle = 0x80040003 OLE_E_NOCONNECTION Handle = 0x80040004 OLE_E_NOTRUNNING Handle = 0x80040005 OLE_E_NOCACHE Handle = 0x80040006 OLE_E_BLANK Handle = 0x80040007 OLE_E_CLASSDIFF Handle = 0x80040008 OLE_E_CANT_GETMONIKER Handle = 0x80040009 OLE_E_CANT_BINDTOSOURCE Handle = 0x8004000A OLE_E_STATIC Handle = 0x8004000B OLE_E_PROMPTSAVECANCELLED Handle = 0x8004000C OLE_E_INVALIDRECT Handle = 0x8004000D OLE_E_WRONGCOMPOBJ Handle = 0x8004000E OLE_E_INVALIDHWND Handle = 0x8004000F OLE_E_NOT_INPLACEACTIVE Handle = 0x80040010 OLE_E_CANTCONVERT Handle = 0x80040011 OLE_E_NOSTORAGE Handle = 0x80040012 DV_E_FORMATETC Handle = 0x80040064 DV_E_DVTARGETDEVICE Handle = 0x80040065 DV_E_STGMEDIUM Handle = 0x80040066 DV_E_STATDATA Handle = 0x80040067 DV_E_LINDEX Handle = 0x80040068 DV_E_TYMED Handle = 0x80040069 DV_E_CLIPFORMAT Handle = 0x8004006A DV_E_DVASPECT Handle = 0x8004006B DV_E_DVTARGETDEVICE_SIZE Handle = 0x8004006C DV_E_NOIVIEWOBJECT Handle = 0x8004006D DRAGDROP_E_FIRST syscall.Errno = 0x80040100 DRAGDROP_E_LAST syscall.Errno = 0x8004010F DRAGDROP_S_FIRST syscall.Errno = 0x00040100 DRAGDROP_S_LAST syscall.Errno = 0x0004010F DRAGDROP_E_NOTREGISTERED Handle = 0x80040100 DRAGDROP_E_ALREADYREGISTERED Handle = 0x80040101 DRAGDROP_E_INVALIDHWND Handle = 0x80040102 DRAGDROP_E_CONCURRENT_DRAG_ATTEMPTED Handle = 0x80040103 CLASSFACTORY_E_FIRST syscall.Errno = 0x80040110 CLASSFACTORY_E_LAST syscall.Errno = 0x8004011F CLASSFACTORY_S_FIRST syscall.Errno = 0x00040110 CLASSFACTORY_S_LAST syscall.Errno = 0x0004011F CLASS_E_NOAGGREGATION Handle = 0x80040110 CLASS_E_CLASSNOTAVAILABLE Handle = 0x80040111 CLASS_E_NOTLICENSED Handle = 0x80040112 MARSHAL_E_FIRST syscall.Errno = 0x80040120 MARSHAL_E_LAST syscall.Errno = 0x8004012F MARSHAL_S_FIRST syscall.Errno = 0x00040120 MARSHAL_S_LAST syscall.Errno = 0x0004012F DATA_E_FIRST syscall.Errno = 0x80040130 DATA_E_LAST syscall.Errno = 0x8004013F DATA_S_FIRST syscall.Errno = 0x00040130 DATA_S_LAST syscall.Errno = 0x0004013F VIEW_E_FIRST syscall.Errno = 0x80040140 VIEW_E_LAST syscall.Errno = 0x8004014F VIEW_S_FIRST syscall.Errno = 0x00040140 VIEW_S_LAST syscall.Errno = 0x0004014F VIEW_E_DRAW Handle = 0x80040140 REGDB_E_FIRST syscall.Errno = 0x80040150 REGDB_E_LAST syscall.Errno = 0x8004015F REGDB_S_FIRST syscall.Errno = 0x00040150 REGDB_S_LAST syscall.Errno = 0x0004015F REGDB_E_READREGDB Handle = 0x80040150 REGDB_E_WRITEREGDB Handle = 0x80040151 REGDB_E_KEYMISSING Handle = 0x80040152 REGDB_E_INVALIDVALUE Handle = 0x80040153 REGDB_E_CLASSNOTREG Handle = 0x80040154 REGDB_E_IIDNOTREG Handle = 0x80040155 REGDB_E_BADTHREADINGMODEL Handle = 0x80040156 REGDB_E_PACKAGEPOLICYVIOLATION Handle = 0x80040157 CAT_E_FIRST syscall.Errno = 0x80040160 CAT_E_LAST syscall.Errno = 0x80040161 CAT_E_CATIDNOEXIST Handle = 0x80040160 CAT_E_NODESCRIPTION Handle = 0x80040161 CS_E_FIRST syscall.Errno = 0x80040164 CS_E_LAST syscall.Errno = 0x8004016F CS_E_PACKAGE_NOTFOUND Handle = 0x80040164 CS_E_NOT_DELETABLE Handle = 0x80040165 CS_E_CLASS_NOTFOUND Handle = 0x80040166 CS_E_INVALID_VERSION Handle = 0x80040167 CS_E_NO_CLASSSTORE Handle = 0x80040168 CS_E_OBJECT_NOTFOUND Handle = 0x80040169 CS_E_OBJECT_ALREADY_EXISTS Handle = 0x8004016A CS_E_INVALID_PATH Handle = 0x8004016B CS_E_NETWORK_ERROR Handle = 0x8004016C CS_E_ADMIN_LIMIT_EXCEEDED Handle = 0x8004016D CS_E_SCHEMA_MISMATCH Handle = 0x8004016E CS_E_INTERNAL_ERROR Handle = 0x8004016F CACHE_E_FIRST syscall.Errno = 0x80040170 CACHE_E_LAST syscall.Errno = 0x8004017F CACHE_S_FIRST syscall.Errno = 0x00040170 CACHE_S_LAST syscall.Errno = 0x0004017F CACHE_E_NOCACHE_UPDATED Handle = 0x80040170 OLEOBJ_E_FIRST syscall.Errno = 0x80040180 OLEOBJ_E_LAST syscall.Errno = 0x8004018F OLEOBJ_S_FIRST syscall.Errno = 0x00040180 OLEOBJ_S_LAST syscall.Errno = 0x0004018F OLEOBJ_E_NOVERBS Handle = 0x80040180 OLEOBJ_E_INVALIDVERB Handle = 0x80040181 CLIENTSITE_E_FIRST syscall.Errno = 0x80040190 CLIENTSITE_E_LAST syscall.Errno = 0x8004019F CLIENTSITE_S_FIRST syscall.Errno = 0x00040190 CLIENTSITE_S_LAST syscall.Errno = 0x0004019F INPLACE_E_NOTUNDOABLE Handle = 0x800401A0 INPLACE_E_NOTOOLSPACE Handle = 0x800401A1 INPLACE_E_FIRST syscall.Errno = 0x800401A0 INPLACE_E_LAST syscall.Errno = 0x800401AF INPLACE_S_FIRST syscall.Errno = 0x000401A0 INPLACE_S_LAST syscall.Errno = 0x000401AF ENUM_E_FIRST syscall.Errno = 0x800401B0 ENUM_E_LAST syscall.Errno = 0x800401BF ENUM_S_FIRST syscall.Errno = 0x000401B0 ENUM_S_LAST syscall.Errno = 0x000401BF CONVERT10_E_FIRST syscall.Errno = 0x800401C0 CONVERT10_E_LAST syscall.Errno = 0x800401CF CONVERT10_S_FIRST syscall.Errno = 0x000401C0 CONVERT10_S_LAST syscall.Errno = 0x000401CF CONVERT10_E_OLESTREAM_GET Handle = 0x800401C0 CONVERT10_E_OLESTREAM_PUT Handle = 0x800401C1 CONVERT10_E_OLESTREAM_FMT Handle = 0x800401C2 CONVERT10_E_OLESTREAM_BITMAP_TO_DIB Handle = 0x800401C3 CONVERT10_E_STG_FMT Handle = 0x800401C4 CONVERT10_E_STG_NO_STD_STREAM Handle = 0x800401C5 CONVERT10_E_STG_DIB_TO_BITMAP Handle = 0x800401C6 CLIPBRD_E_FIRST syscall.Errno = 0x800401D0 CLIPBRD_E_LAST syscall.Errno = 0x800401DF CLIPBRD_S_FIRST syscall.Errno = 0x000401D0 CLIPBRD_S_LAST syscall.Errno = 0x000401DF CLIPBRD_E_CANT_OPEN Handle = 0x800401D0 CLIPBRD_E_CANT_EMPTY Handle = 0x800401D1 CLIPBRD_E_CANT_SET Handle = 0x800401D2 CLIPBRD_E_BAD_DATA Handle = 0x800401D3 CLIPBRD_E_CANT_CLOSE Handle = 0x800401D4 MK_E_FIRST syscall.Errno = 0x800401E0 MK_E_LAST syscall.Errno = 0x800401EF MK_S_FIRST syscall.Errno = 0x000401E0 MK_S_LAST syscall.Errno = 0x000401EF MK_E_CONNECTMANUALLY Handle = 0x800401E0 MK_E_EXCEEDEDDEADLINE Handle = 0x800401E1 MK_E_NEEDGENERIC Handle = 0x800401E2 MK_E_UNAVAILABLE Handle = 0x800401E3 MK_E_SYNTAX Handle = 0x800401E4 MK_E_NOOBJECT Handle = 0x800401E5 MK_E_INVALIDEXTENSION Handle = 0x800401E6 MK_E_INTERMEDIATEINTERFACENOTSUPPORTED Handle = 0x800401E7 MK_E_NOTBINDABLE Handle = 0x800401E8 MK_E_NOTBOUND Handle = 0x800401E9 MK_E_CANTOPENFILE Handle = 0x800401EA MK_E_MUSTBOTHERUSER Handle = 0x800401EB MK_E_NOINVERSE Handle = 0x800401EC MK_E_NOSTORAGE Handle = 0x800401ED MK_E_NOPREFIX Handle = 0x800401EE MK_E_ENUMERATION_FAILED Handle = 0x800401EF CO_E_FIRST syscall.Errno = 0x800401F0 CO_E_LAST syscall.Errno = 0x800401FF CO_S_FIRST syscall.Errno = 0x000401F0 CO_S_LAST syscall.Errno = 0x000401FF CO_E_NOTINITIALIZED Handle = 0x800401F0 CO_E_ALREADYINITIALIZED Handle = 0x800401F1 CO_E_CANTDETERMINECLASS Handle = 0x800401F2 CO_E_CLASSSTRING Handle = 0x800401F3 CO_E_IIDSTRING Handle = 0x800401F4 CO_E_APPNOTFOUND Handle = 0x800401F5 CO_E_APPSINGLEUSE Handle = 0x800401F6 CO_E_ERRORINAPP Handle = 0x800401F7 CO_E_DLLNOTFOUND Handle = 0x800401F8 CO_E_ERRORINDLL Handle = 0x800401F9 CO_E_WRONGOSFORAPP Handle = 0x800401FA CO_E_OBJNOTREG Handle = 0x800401FB CO_E_OBJISREG Handle = 0x800401FC CO_E_OBJNOTCONNECTED Handle = 0x800401FD CO_E_APPDIDNTREG Handle = 0x800401FE CO_E_RELEASED Handle = 0x800401FF EVENT_E_FIRST syscall.Errno = 0x80040200 EVENT_E_LAST syscall.Errno = 0x8004021F EVENT_S_FIRST syscall.Errno = 0x00040200 EVENT_S_LAST syscall.Errno = 0x0004021F EVENT_S_SOME_SUBSCRIBERS_FAILED Handle = 0x00040200 EVENT_E_ALL_SUBSCRIBERS_FAILED Handle = 0x80040201 EVENT_S_NOSUBSCRIBERS Handle = 0x00040202 EVENT_E_QUERYSYNTAX Handle = 0x80040203 EVENT_E_QUERYFIELD Handle = 0x80040204 EVENT_E_INTERNALEXCEPTION Handle = 0x80040205 EVENT_E_INTERNALERROR Handle = 0x80040206 EVENT_E_INVALID_PER_USER_SID Handle = 0x80040207 EVENT_E_USER_EXCEPTION Handle = 0x80040208 EVENT_E_TOO_MANY_METHODS Handle = 0x80040209 EVENT_E_MISSING_EVENTCLASS Handle = 0x8004020A EVENT_E_NOT_ALL_REMOVED Handle = 0x8004020B EVENT_E_COMPLUS_NOT_INSTALLED Handle = 0x8004020C EVENT_E_CANT_MODIFY_OR_DELETE_UNCONFIGURED_OBJECT Handle = 0x8004020D EVENT_E_CANT_MODIFY_OR_DELETE_CONFIGURED_OBJECT Handle = 0x8004020E EVENT_E_INVALID_EVENT_CLASS_PARTITION Handle = 0x8004020F EVENT_E_PER_USER_SID_NOT_LOGGED_ON Handle = 0x80040210 TPC_E_INVALID_PROPERTY Handle = 0x80040241 TPC_E_NO_DEFAULT_TABLET Handle = 0x80040212 TPC_E_UNKNOWN_PROPERTY Handle = 0x8004021B TPC_E_INVALID_INPUT_RECT Handle = 0x80040219 TPC_E_INVALID_STROKE Handle = 0x80040222 TPC_E_INITIALIZE_FAIL Handle = 0x80040223 TPC_E_NOT_RELEVANT Handle = 0x80040232 TPC_E_INVALID_PACKET_DESCRIPTION Handle = 0x80040233 TPC_E_RECOGNIZER_NOT_REGISTERED Handle = 0x80040235 TPC_E_INVALID_RIGHTS Handle = 0x80040236 TPC_E_OUT_OF_ORDER_CALL Handle = 0x80040237 TPC_E_QUEUE_FULL Handle = 0x80040238 TPC_E_INVALID_CONFIGURATION Handle = 0x80040239 TPC_E_INVALID_DATA_FROM_RECOGNIZER Handle = 0x8004023A TPC_S_TRUNCATED Handle = 0x00040252 TPC_S_INTERRUPTED Handle = 0x00040253 TPC_S_NO_DATA_TO_PROCESS Handle = 0x00040254 XACT_E_FIRST syscall.Errno = 0x8004D000 XACT_E_LAST syscall.Errno = 0x8004D02B XACT_S_FIRST syscall.Errno = 0x0004D000 XACT_S_LAST syscall.Errno = 0x0004D010 XACT_E_ALREADYOTHERSINGLEPHASE Handle = 0x8004D000 XACT_E_CANTRETAIN Handle = 0x8004D001 XACT_E_COMMITFAILED Handle = 0x8004D002 XACT_E_COMMITPREVENTED Handle = 0x8004D003 XACT_E_HEURISTICABORT Handle = 0x8004D004 XACT_E_HEURISTICCOMMIT Handle = 0x8004D005 XACT_E_HEURISTICDAMAGE Handle = 0x8004D006 XACT_E_HEURISTICDANGER Handle = 0x8004D007 XACT_E_ISOLATIONLEVEL Handle = 0x8004D008 XACT_E_NOASYNC Handle = 0x8004D009 XACT_E_NOENLIST Handle = 0x8004D00A XACT_E_NOISORETAIN Handle = 0x8004D00B XACT_E_NORESOURCE Handle = 0x8004D00C XACT_E_NOTCURRENT Handle = 0x8004D00D XACT_E_NOTRANSACTION Handle = 0x8004D00E XACT_E_NOTSUPPORTED Handle = 0x8004D00F XACT_E_UNKNOWNRMGRID Handle = 0x8004D010 XACT_E_WRONGSTATE Handle = 0x8004D011 XACT_E_WRONGUOW Handle = 0x8004D012 XACT_E_XTIONEXISTS Handle = 0x8004D013 XACT_E_NOIMPORTOBJECT Handle = 0x8004D014 XACT_E_INVALIDCOOKIE Handle = 0x8004D015 XACT_E_INDOUBT Handle = 0x8004D016 XACT_E_NOTIMEOUT Handle = 0x8004D017 XACT_E_ALREADYINPROGRESS Handle = 0x8004D018 XACT_E_ABORTED Handle = 0x8004D019 XACT_E_LOGFULL Handle = 0x8004D01A XACT_E_TMNOTAVAILABLE Handle = 0x8004D01B XACT_E_CONNECTION_DOWN Handle = 0x8004D01C XACT_E_CONNECTION_DENIED Handle = 0x8004D01D XACT_E_REENLISTTIMEOUT Handle = 0x8004D01E XACT_E_TIP_CONNECT_FAILED Handle = 0x8004D01F XACT_E_TIP_PROTOCOL_ERROR Handle = 0x8004D020 XACT_E_TIP_PULL_FAILED Handle = 0x8004D021 XACT_E_DEST_TMNOTAVAILABLE Handle = 0x8004D022 XACT_E_TIP_DISABLED Handle = 0x8004D023 XACT_E_NETWORK_TX_DISABLED Handle = 0x8004D024 XACT_E_PARTNER_NETWORK_TX_DISABLED Handle = 0x8004D025 XACT_E_XA_TX_DISABLED Handle = 0x8004D026 XACT_E_UNABLE_TO_READ_DTC_CONFIG Handle = 0x8004D027 XACT_E_UNABLE_TO_LOAD_DTC_PROXY Handle = 0x8004D028 XACT_E_ABORTING Handle = 0x8004D029 XACT_E_PUSH_COMM_FAILURE Handle = 0x8004D02A XACT_E_PULL_COMM_FAILURE Handle = 0x8004D02B XACT_E_LU_TX_DISABLED Handle = 0x8004D02C XACT_E_CLERKNOTFOUND Handle = 0x8004D080 XACT_E_CLERKEXISTS Handle = 0x8004D081 XACT_E_RECOVERYINPROGRESS Handle = 0x8004D082 XACT_E_TRANSACTIONCLOSED Handle = 0x8004D083 XACT_E_INVALIDLSN Handle = 0x8004D084 XACT_E_REPLAYREQUEST Handle = 0x8004D085 XACT_S_ASYNC Handle = 0x0004D000 XACT_S_DEFECT Handle = 0x0004D001 XACT_S_READONLY Handle = 0x0004D002 XACT_S_SOMENORETAIN Handle = 0x0004D003 XACT_S_OKINFORM Handle = 0x0004D004 XACT_S_MADECHANGESCONTENT Handle = 0x0004D005 XACT_S_MADECHANGESINFORM Handle = 0x0004D006 XACT_S_ALLNORETAIN Handle = 0x0004D007 XACT_S_ABORTING Handle = 0x0004D008 XACT_S_SINGLEPHASE Handle = 0x0004D009 XACT_S_LOCALLY_OK Handle = 0x0004D00A XACT_S_LASTRESOURCEMANAGER Handle = 0x0004D010 CONTEXT_E_FIRST syscall.Errno = 0x8004E000 CONTEXT_E_LAST syscall.Errno = 0x8004E02F CONTEXT_S_FIRST syscall.Errno = 0x0004E000 CONTEXT_S_LAST syscall.Errno = 0x0004E02F CONTEXT_E_ABORTED Handle = 0x8004E002 CONTEXT_E_ABORTING Handle = 0x8004E003 CONTEXT_E_NOCONTEXT Handle = 0x8004E004 CONTEXT_E_WOULD_DEADLOCK Handle = 0x8004E005 CONTEXT_E_SYNCH_TIMEOUT Handle = 0x8004E006 CONTEXT_E_OLDREF Handle = 0x8004E007 CONTEXT_E_ROLENOTFOUND Handle = 0x8004E00C CONTEXT_E_TMNOTAVAILABLE Handle = 0x8004E00F CO_E_ACTIVATIONFAILED Handle = 0x8004E021 CO_E_ACTIVATIONFAILED_EVENTLOGGED Handle = 0x8004E022 CO_E_ACTIVATIONFAILED_CATALOGERROR Handle = 0x8004E023 CO_E_ACTIVATIONFAILED_TIMEOUT Handle = 0x8004E024 CO_E_INITIALIZATIONFAILED Handle = 0x8004E025 CONTEXT_E_NOJIT Handle = 0x8004E026 CONTEXT_E_NOTRANSACTION Handle = 0x8004E027 CO_E_THREADINGMODEL_CHANGED Handle = 0x8004E028 CO_E_NOIISINTRINSICS Handle = 0x8004E029 CO_E_NOCOOKIES Handle = 0x8004E02A CO_E_DBERROR Handle = 0x8004E02B CO_E_NOTPOOLED Handle = 0x8004E02C CO_E_NOTCONSTRUCTED Handle = 0x8004E02D CO_E_NOSYNCHRONIZATION Handle = 0x8004E02E CO_E_ISOLEVELMISMATCH Handle = 0x8004E02F CO_E_CALL_OUT_OF_TX_SCOPE_NOT_ALLOWED Handle = 0x8004E030 CO_E_EXIT_TRANSACTION_SCOPE_NOT_CALLED Handle = 0x8004E031 OLE_S_USEREG Handle = 0x00040000 OLE_S_STATIC Handle = 0x00040001 OLE_S_MAC_CLIPFORMAT Handle = 0x00040002 DRAGDROP_S_DROP Handle = 0x00040100 DRAGDROP_S_CANCEL Handle = 0x00040101 DRAGDROP_S_USEDEFAULTCURSORS Handle = 0x00040102 DATA_S_SAMEFORMATETC Handle = 0x00040130 VIEW_S_ALREADY_FROZEN Handle = 0x00040140 CACHE_S_FORMATETC_NOTSUPPORTED Handle = 0x00040170 CACHE_S_SAMECACHE Handle = 0x00040171 CACHE_S_SOMECACHES_NOTUPDATED Handle = 0x00040172 OLEOBJ_S_INVALIDVERB Handle = 0x00040180 OLEOBJ_S_CANNOT_DOVERB_NOW Handle = 0x00040181 OLEOBJ_S_INVALIDHWND Handle = 0x00040182 INPLACE_S_TRUNCATED Handle = 0x000401A0 CONVERT10_S_NO_PRESENTATION Handle = 0x000401C0 MK_S_REDUCED_TO_SELF Handle = 0x000401E2 MK_S_ME Handle = 0x000401E4 MK_S_HIM Handle = 0x000401E5 MK_S_US Handle = 0x000401E6 MK_S_MONIKERALREADYREGISTERED Handle = 0x000401E7 SCHED_S_TASK_READY Handle = 0x00041300 SCHED_S_TASK_RUNNING Handle = 0x00041301 SCHED_S_TASK_DISABLED Handle = 0x00041302 SCHED_S_TASK_HAS_NOT_RUN Handle = 0x00041303 SCHED_S_TASK_NO_MORE_RUNS Handle = 0x00041304 SCHED_S_TASK_NOT_SCHEDULED Handle = 0x00041305 SCHED_S_TASK_TERMINATED Handle = 0x00041306 SCHED_S_TASK_NO_VALID_TRIGGERS Handle = 0x00041307 SCHED_S_EVENT_TRIGGER Handle = 0x00041308 SCHED_E_TRIGGER_NOT_FOUND Handle = 0x80041309 SCHED_E_TASK_NOT_READY Handle = 0x8004130A SCHED_E_TASK_NOT_RUNNING Handle = 0x8004130B SCHED_E_SERVICE_NOT_INSTALLED Handle = 0x8004130C SCHED_E_CANNOT_OPEN_TASK Handle = 0x8004130D SCHED_E_INVALID_TASK Handle = 0x8004130E SCHED_E_ACCOUNT_INFORMATION_NOT_SET Handle = 0x8004130F SCHED_E_ACCOUNT_NAME_NOT_FOUND Handle = 0x80041310 SCHED_E_ACCOUNT_DBASE_CORRUPT Handle = 0x80041311 SCHED_E_NO_SECURITY_SERVICES Handle = 0x80041312 SCHED_E_UNKNOWN_OBJECT_VERSION Handle = 0x80041313 SCHED_E_UNSUPPORTED_ACCOUNT_OPTION Handle = 0x80041314 SCHED_E_SERVICE_NOT_RUNNING Handle = 0x80041315 SCHED_E_UNEXPECTEDNODE Handle = 0x80041316 SCHED_E_NAMESPACE Handle = 0x80041317 SCHED_E_INVALIDVALUE Handle = 0x80041318 SCHED_E_MISSINGNODE Handle = 0x80041319 SCHED_E_MALFORMEDXML Handle = 0x8004131A SCHED_S_SOME_TRIGGERS_FAILED Handle = 0x0004131B SCHED_S_BATCH_LOGON_PROBLEM Handle = 0x0004131C SCHED_E_TOO_MANY_NODES Handle = 0x8004131D SCHED_E_PAST_END_BOUNDARY Handle = 0x8004131E SCHED_E_ALREADY_RUNNING Handle = 0x8004131F SCHED_E_USER_NOT_LOGGED_ON Handle = 0x80041320 SCHED_E_INVALID_TASK_HASH Handle = 0x80041321 SCHED_E_SERVICE_NOT_AVAILABLE Handle = 0x80041322 SCHED_E_SERVICE_TOO_BUSY Handle = 0x80041323 SCHED_E_TASK_ATTEMPTED Handle = 0x80041324 SCHED_S_TASK_QUEUED Handle = 0x00041325 SCHED_E_TASK_DISABLED Handle = 0x80041326 SCHED_E_TASK_NOT_V1_COMPAT Handle = 0x80041327 SCHED_E_START_ON_DEMAND Handle = 0x80041328 SCHED_E_TASK_NOT_UBPM_COMPAT Handle = 0x80041329 SCHED_E_DEPRECATED_FEATURE_USED Handle = 0x80041330 CO_E_CLASS_CREATE_FAILED Handle = 0x80080001 CO_E_SCM_ERROR Handle = 0x80080002 CO_E_SCM_RPC_FAILURE Handle = 0x80080003 CO_E_BAD_PATH Handle = 0x80080004 CO_E_SERVER_EXEC_FAILURE Handle = 0x80080005 CO_E_OBJSRV_RPC_FAILURE Handle = 0x80080006 MK_E_NO_NORMALIZED Handle = 0x80080007 CO_E_SERVER_STOPPING Handle = 0x80080008 MEM_E_INVALID_ROOT Handle = 0x80080009 MEM_E_INVALID_LINK Handle = 0x80080010 MEM_E_INVALID_SIZE Handle = 0x80080011 CO_S_NOTALLINTERFACES Handle = 0x00080012 CO_S_MACHINENAMENOTFOUND Handle = 0x00080013 CO_E_MISSING_DISPLAYNAME Handle = 0x80080015 CO_E_RUNAS_VALUE_MUST_BE_AAA Handle = 0x80080016 CO_E_ELEVATION_DISABLED Handle = 0x80080017 APPX_E_PACKAGING_INTERNAL Handle = 0x80080200 APPX_E_INTERLEAVING_NOT_ALLOWED Handle = 0x80080201 APPX_E_RELATIONSHIPS_NOT_ALLOWED Handle = 0x80080202 APPX_E_MISSING_REQUIRED_FILE Handle = 0x80080203 APPX_E_INVALID_MANIFEST Handle = 0x80080204 APPX_E_INVALID_BLOCKMAP Handle = 0x80080205 APPX_E_CORRUPT_CONTENT Handle = 0x80080206 APPX_E_BLOCK_HASH_INVALID Handle = 0x80080207 APPX_E_REQUESTED_RANGE_TOO_LARGE Handle = 0x80080208 APPX_E_INVALID_SIP_CLIENT_DATA Handle = 0x80080209 APPX_E_INVALID_KEY_INFO Handle = 0x8008020A APPX_E_INVALID_CONTENTGROUPMAP Handle = 0x8008020B APPX_E_INVALID_APPINSTALLER Handle = 0x8008020C APPX_E_DELTA_BASELINE_VERSION_MISMATCH Handle = 0x8008020D APPX_E_DELTA_PACKAGE_MISSING_FILE Handle = 0x8008020E APPX_E_INVALID_DELTA_PACKAGE Handle = 0x8008020F APPX_E_DELTA_APPENDED_PACKAGE_NOT_ALLOWED Handle = 0x80080210 APPX_E_INVALID_PACKAGING_LAYOUT Handle = 0x80080211 APPX_E_INVALID_PACKAGESIGNCONFIG Handle = 0x80080212 APPX_E_RESOURCESPRI_NOT_ALLOWED Handle = 0x80080213 APPX_E_FILE_COMPRESSION_MISMATCH Handle = 0x80080214 APPX_E_INVALID_PAYLOAD_PACKAGE_EXTENSION Handle = 0x80080215 APPX_E_INVALID_ENCRYPTION_EXCLUSION_FILE_LIST Handle = 0x80080216 BT_E_SPURIOUS_ACTIVATION Handle = 0x80080300 DISP_E_UNKNOWNINTERFACE Handle = 0x80020001 DISP_E_MEMBERNOTFOUND Handle = 0x80020003 DISP_E_PARAMNOTFOUND Handle = 0x80020004 DISP_E_TYPEMISMATCH Handle = 0x80020005 DISP_E_UNKNOWNNAME Handle = 0x80020006 DISP_E_NONAMEDARGS Handle = 0x80020007 DISP_E_BADVARTYPE Handle = 0x80020008 DISP_E_EXCEPTION Handle = 0x80020009 DISP_E_OVERFLOW Handle = 0x8002000A DISP_E_BADINDEX Handle = 0x8002000B DISP_E_UNKNOWNLCID Handle = 0x8002000C DISP_E_ARRAYISLOCKED Handle = 0x8002000D DISP_E_BADPARAMCOUNT Handle = 0x8002000E DISP_E_PARAMNOTOPTIONAL Handle = 0x8002000F DISP_E_BADCALLEE Handle = 0x80020010 DISP_E_NOTACOLLECTION Handle = 0x80020011 DISP_E_DIVBYZERO Handle = 0x80020012 DISP_E_BUFFERTOOSMALL Handle = 0x80020013 TYPE_E_BUFFERTOOSMALL Handle = 0x80028016 TYPE_E_FIELDNOTFOUND Handle = 0x80028017 TYPE_E_INVDATAREAD Handle = 0x80028018 TYPE_E_UNSUPFORMAT Handle = 0x80028019 TYPE_E_REGISTRYACCESS Handle = 0x8002801C TYPE_E_LIBNOTREGISTERED Handle = 0x8002801D TYPE_E_UNDEFINEDTYPE Handle = 0x80028027 TYPE_E_QUALIFIEDNAMEDISALLOWED Handle = 0x80028028 TYPE_E_INVALIDSTATE Handle = 0x80028029 TYPE_E_WRONGTYPEKIND Handle = 0x8002802A TYPE_E_ELEMENTNOTFOUND Handle = 0x8002802B TYPE_E_AMBIGUOUSNAME Handle = 0x8002802C TYPE_E_NAMECONFLICT Handle = 0x8002802D TYPE_E_UNKNOWNLCID Handle = 0x8002802E TYPE_E_DLLFUNCTIONNOTFOUND Handle = 0x8002802F TYPE_E_BADMODULEKIND Handle = 0x800288BD TYPE_E_SIZETOOBIG Handle = 0x800288C5 TYPE_E_DUPLICATEID Handle = 0x800288C6 TYPE_E_INVALIDID Handle = 0x800288CF TYPE_E_TYPEMISMATCH Handle = 0x80028CA0 TYPE_E_OUTOFBOUNDS Handle = 0x80028CA1 TYPE_E_IOERROR Handle = 0x80028CA2 TYPE_E_CANTCREATETMPFILE Handle = 0x80028CA3 TYPE_E_CANTLOADLIBRARY Handle = 0x80029C4A TYPE_E_INCONSISTENTPROPFUNCS Handle = 0x80029C83 TYPE_E_CIRCULARTYPE Handle = 0x80029C84 STG_E_INVALIDFUNCTION Handle = 0x80030001 STG_E_FILENOTFOUND Handle = 0x80030002 STG_E_PATHNOTFOUND Handle = 0x80030003 STG_E_TOOMANYOPENFILES Handle = 0x80030004 STG_E_ACCESSDENIED Handle = 0x80030005 STG_E_INVALIDHANDLE Handle = 0x80030006 STG_E_INSUFFICIENTMEMORY Handle = 0x80030008 STG_E_INVALIDPOINTER Handle = 0x80030009 STG_E_NOMOREFILES Handle = 0x80030012 STG_E_DISKISWRITEPROTECTED Handle = 0x80030013 STG_E_SEEKERROR Handle = 0x80030019 STG_E_WRITEFAULT Handle = 0x8003001D STG_E_READFAULT Handle = 0x8003001E STG_E_SHAREVIOLATION Handle = 0x80030020 STG_E_LOCKVIOLATION Handle = 0x80030021 STG_E_FILEALREADYEXISTS Handle = 0x80030050 STG_E_INVALIDPARAMETER Handle = 0x80030057 STG_E_MEDIUMFULL Handle = 0x80030070 STG_E_PROPSETMISMATCHED Handle = 0x800300F0 STG_E_ABNORMALAPIEXIT Handle = 0x800300FA STG_E_INVALIDHEADER Handle = 0x800300FB STG_E_INVALIDNAME Handle = 0x800300FC STG_E_UNKNOWN Handle = 0x800300FD STG_E_UNIMPLEMENTEDFUNCTION Handle = 0x800300FE STG_E_INVALIDFLAG Handle = 0x800300FF STG_E_INUSE Handle = 0x80030100 STG_E_NOTCURRENT Handle = 0x80030101 STG_E_REVERTED Handle = 0x80030102 STG_E_CANTSAVE Handle = 0x80030103 STG_E_OLDFORMAT Handle = 0x80030104 STG_E_OLDDLL Handle = 0x80030105 STG_E_SHAREREQUIRED Handle = 0x80030106 STG_E_NOTFILEBASEDSTORAGE Handle = 0x80030107 STG_E_EXTANTMARSHALLINGS Handle = 0x80030108 STG_E_DOCFILECORRUPT Handle = 0x80030109 STG_E_BADBASEADDRESS Handle = 0x80030110 STG_E_DOCFILETOOLARGE Handle = 0x80030111 STG_E_NOTSIMPLEFORMAT Handle = 0x80030112 STG_E_INCOMPLETE Handle = 0x80030201 STG_E_TERMINATED Handle = 0x80030202 STG_S_CONVERTED Handle = 0x00030200 STG_S_BLOCK Handle = 0x00030201 STG_S_RETRYNOW Handle = 0x00030202 STG_S_MONITORING Handle = 0x00030203 STG_S_MULTIPLEOPENS Handle = 0x00030204 STG_S_CONSOLIDATIONFAILED Handle = 0x00030205 STG_S_CANNOTCONSOLIDATE Handle = 0x00030206 STG_S_POWER_CYCLE_REQUIRED Handle = 0x00030207 STG_E_FIRMWARE_SLOT_INVALID Handle = 0x80030208 STG_E_FIRMWARE_IMAGE_INVALID Handle = 0x80030209 STG_E_DEVICE_UNRESPONSIVE Handle = 0x8003020A STG_E_STATUS_COPY_PROTECTION_FAILURE Handle = 0x80030305 STG_E_CSS_AUTHENTICATION_FAILURE Handle = 0x80030306 STG_E_CSS_KEY_NOT_PRESENT Handle = 0x80030307 STG_E_CSS_KEY_NOT_ESTABLISHED Handle = 0x80030308 STG_E_CSS_SCRAMBLED_SECTOR Handle = 0x80030309 STG_E_CSS_REGION_MISMATCH Handle = 0x8003030A STG_E_RESETS_EXHAUSTED Handle = 0x8003030B RPC_E_CALL_REJECTED Handle = 0x80010001 RPC_E_CALL_CANCELED Handle = 0x80010002 RPC_E_CANTPOST_INSENDCALL Handle = 0x80010003 RPC_E_CANTCALLOUT_INASYNCCALL Handle = 0x80010004 RPC_E_CANTCALLOUT_INEXTERNALCALL Handle = 0x80010005 RPC_E_CONNECTION_TERMINATED Handle = 0x80010006 RPC_E_SERVER_DIED Handle = 0x80010007 RPC_E_CLIENT_DIED Handle = 0x80010008 RPC_E_INVALID_DATAPACKET Handle = 0x80010009 RPC_E_CANTTRANSMIT_CALL Handle = 0x8001000A RPC_E_CLIENT_CANTMARSHAL_DATA Handle = 0x8001000B RPC_E_CLIENT_CANTUNMARSHAL_DATA Handle = 0x8001000C RPC_E_SERVER_CANTMARSHAL_DATA Handle = 0x8001000D RPC_E_SERVER_CANTUNMARSHAL_DATA Handle = 0x8001000E RPC_E_INVALID_DATA Handle = 0x8001000F RPC_E_INVALID_PARAMETER Handle = 0x80010010 RPC_E_CANTCALLOUT_AGAIN Handle = 0x80010011 RPC_E_SERVER_DIED_DNE Handle = 0x80010012 RPC_E_SYS_CALL_FAILED Handle = 0x80010100 RPC_E_OUT_OF_RESOURCES Handle = 0x80010101 RPC_E_ATTEMPTED_MULTITHREAD Handle = 0x80010102 RPC_E_NOT_REGISTERED Handle = 0x80010103 RPC_E_FAULT Handle = 0x80010104 RPC_E_SERVERFAULT Handle = 0x80010105 RPC_E_CHANGED_MODE Handle = 0x80010106 RPC_E_INVALIDMETHOD Handle = 0x80010107 RPC_E_DISCONNECTED Handle = 0x80010108 RPC_E_RETRY Handle = 0x80010109 RPC_E_SERVERCALL_RETRYLATER Handle = 0x8001010A RPC_E_SERVERCALL_REJECTED Handle = 0x8001010B RPC_E_INVALID_CALLDATA Handle = 0x8001010C RPC_E_CANTCALLOUT_ININPUTSYNCCALL Handle = 0x8001010D RPC_E_WRONG_THREAD Handle = 0x8001010E RPC_E_THREAD_NOT_INIT Handle = 0x8001010F RPC_E_VERSION_MISMATCH Handle = 0x80010110 RPC_E_INVALID_HEADER Handle = 0x80010111 RPC_E_INVALID_EXTENSION Handle = 0x80010112 RPC_E_INVALID_IPID Handle = 0x80010113 RPC_E_INVALID_OBJECT Handle = 0x80010114 RPC_S_CALLPENDING Handle = 0x80010115 RPC_S_WAITONTIMER Handle = 0x80010116 RPC_E_CALL_COMPLETE Handle = 0x80010117 RPC_E_UNSECURE_CALL Handle = 0x80010118 RPC_E_TOO_LATE Handle = 0x80010119 RPC_E_NO_GOOD_SECURITY_PACKAGES Handle = 0x8001011A RPC_E_ACCESS_DENIED Handle = 0x8001011B RPC_E_REMOTE_DISABLED Handle = 0x8001011C RPC_E_INVALID_OBJREF Handle = 0x8001011D RPC_E_NO_CONTEXT Handle = 0x8001011E RPC_E_TIMEOUT Handle = 0x8001011F RPC_E_NO_SYNC Handle = 0x80010120 RPC_E_FULLSIC_REQUIRED Handle = 0x80010121 RPC_E_INVALID_STD_NAME Handle = 0x80010122 CO_E_FAILEDTOIMPERSONATE Handle = 0x80010123 CO_E_FAILEDTOGETSECCTX Handle = 0x80010124 CO_E_FAILEDTOOPENTHREADTOKEN Handle = 0x80010125 CO_E_FAILEDTOGETTOKENINFO Handle = 0x80010126 CO_E_TRUSTEEDOESNTMATCHCLIENT Handle = 0x80010127 CO_E_FAILEDTOQUERYCLIENTBLANKET Handle = 0x80010128 CO_E_FAILEDTOSETDACL Handle = 0x80010129 CO_E_ACCESSCHECKFAILED Handle = 0x8001012A CO_E_NETACCESSAPIFAILED Handle = 0x8001012B CO_E_WRONGTRUSTEENAMESYNTAX Handle = 0x8001012C CO_E_INVALIDSID Handle = 0x8001012D CO_E_CONVERSIONFAILED Handle = 0x8001012E CO_E_NOMATCHINGSIDFOUND Handle = 0x8001012F CO_E_LOOKUPACCSIDFAILED Handle = 0x80010130 CO_E_NOMATCHINGNAMEFOUND Handle = 0x80010131 CO_E_LOOKUPACCNAMEFAILED Handle = 0x80010132 CO_E_SETSERLHNDLFAILED Handle = 0x80010133 CO_E_FAILEDTOGETWINDIR Handle = 0x80010134 CO_E_PATHTOOLONG Handle = 0x80010135 CO_E_FAILEDTOGENUUID Handle = 0x80010136 CO_E_FAILEDTOCREATEFILE Handle = 0x80010137 CO_E_FAILEDTOCLOSEHANDLE Handle = 0x80010138 CO_E_EXCEEDSYSACLLIMIT Handle = 0x80010139 CO_E_ACESINWRONGORDER Handle = 0x8001013A CO_E_INCOMPATIBLESTREAMVERSION Handle = 0x8001013B CO_E_FAILEDTOOPENPROCESSTOKEN Handle = 0x8001013C CO_E_DECODEFAILED Handle = 0x8001013D CO_E_ACNOTINITIALIZED Handle = 0x8001013F CO_E_CANCEL_DISABLED Handle = 0x80010140 RPC_E_UNEXPECTED Handle = 0x8001FFFF ERROR_AUDITING_DISABLED Handle = 0xC0090001 ERROR_ALL_SIDS_FILTERED Handle = 0xC0090002 ERROR_BIZRULES_NOT_ENABLED Handle = 0xC0090003 NTE_BAD_UID Handle = 0x80090001 NTE_BAD_HASH Handle = 0x80090002 NTE_BAD_KEY Handle = 0x80090003 NTE_BAD_LEN Handle = 0x80090004 NTE_BAD_DATA Handle = 0x80090005 NTE_BAD_SIGNATURE Handle = 0x80090006 NTE_BAD_VER Handle = 0x80090007 NTE_BAD_ALGID Handle = 0x80090008 NTE_BAD_FLAGS Handle = 0x80090009 NTE_BAD_TYPE Handle = 0x8009000A NTE_BAD_KEY_STATE Handle = 0x8009000B NTE_BAD_HASH_STATE Handle = 0x8009000C NTE_NO_KEY Handle = 0x8009000D NTE_NO_MEMORY Handle = 0x8009000E NTE_EXISTS Handle = 0x8009000F NTE_PERM Handle = 0x80090010 NTE_NOT_FOUND Handle = 0x80090011 NTE_DOUBLE_ENCRYPT Handle = 0x80090012 NTE_BAD_PROVIDER Handle = 0x80090013 NTE_BAD_PROV_TYPE Handle = 0x80090014 NTE_BAD_PUBLIC_KEY Handle = 0x80090015 NTE_BAD_KEYSET Handle = 0x80090016 NTE_PROV_TYPE_NOT_DEF Handle = 0x80090017 NTE_PROV_TYPE_ENTRY_BAD Handle = 0x80090018 NTE_KEYSET_NOT_DEF Handle = 0x80090019 NTE_KEYSET_ENTRY_BAD Handle = 0x8009001A NTE_PROV_TYPE_NO_MATCH Handle = 0x8009001B NTE_SIGNATURE_FILE_BAD Handle = 0x8009001C NTE_PROVIDER_DLL_FAIL Handle = 0x8009001D NTE_PROV_DLL_NOT_FOUND Handle = 0x8009001E NTE_BAD_KEYSET_PARAM Handle = 0x8009001F NTE_FAIL Handle = 0x80090020 NTE_SYS_ERR Handle = 0x80090021 NTE_SILENT_CONTEXT Handle = 0x80090022 NTE_TOKEN_KEYSET_STORAGE_FULL Handle = 0x80090023 NTE_TEMPORARY_PROFILE Handle = 0x80090024 NTE_FIXEDPARAMETER Handle = 0x80090025 NTE_INVALID_HANDLE Handle = 0x80090026 NTE_INVALID_PARAMETER Handle = 0x80090027 NTE_BUFFER_TOO_SMALL Handle = 0x80090028 NTE_NOT_SUPPORTED Handle = 0x80090029 NTE_NO_MORE_ITEMS Handle = 0x8009002A NTE_BUFFERS_OVERLAP Handle = 0x8009002B NTE_DECRYPTION_FAILURE Handle = 0x8009002C NTE_INTERNAL_ERROR Handle = 0x8009002D NTE_UI_REQUIRED Handle = 0x8009002E NTE_HMAC_NOT_SUPPORTED Handle = 0x8009002F NTE_DEVICE_NOT_READY Handle = 0x80090030 NTE_AUTHENTICATION_IGNORED Handle = 0x80090031 NTE_VALIDATION_FAILED Handle = 0x80090032 NTE_INCORRECT_PASSWORD Handle = 0x80090033 NTE_ENCRYPTION_FAILURE Handle = 0x80090034 NTE_DEVICE_NOT_FOUND Handle = 0x80090035 NTE_USER_CANCELLED Handle = 0x80090036 NTE_PASSWORD_CHANGE_REQUIRED Handle = 0x80090037 NTE_NOT_ACTIVE_CONSOLE Handle = 0x80090038 SEC_E_INSUFFICIENT_MEMORY Handle = 0x80090300 SEC_E_INVALID_HANDLE Handle = 0x80090301 SEC_E_UNSUPPORTED_FUNCTION Handle = 0x80090302 SEC_E_TARGET_UNKNOWN Handle = 0x80090303 SEC_E_INTERNAL_ERROR Handle = 0x80090304 SEC_E_SECPKG_NOT_FOUND Handle = 0x80090305 SEC_E_NOT_OWNER Handle = 0x80090306 SEC_E_CANNOT_INSTALL Handle = 0x80090307 SEC_E_INVALID_TOKEN Handle = 0x80090308 SEC_E_CANNOT_PACK Handle = 0x80090309 SEC_E_QOP_NOT_SUPPORTED Handle = 0x8009030A SEC_E_NO_IMPERSONATION Handle = 0x8009030B SEC_E_LOGON_DENIED Handle = 0x8009030C SEC_E_UNKNOWN_CREDENTIALS Handle = 0x8009030D SEC_E_NO_CREDENTIALS Handle = 0x8009030E SEC_E_MESSAGE_ALTERED Handle = 0x8009030F SEC_E_OUT_OF_SEQUENCE Handle = 0x80090310 SEC_E_NO_AUTHENTICATING_AUTHORITY Handle = 0x80090311 SEC_I_CONTINUE_NEEDED Handle = 0x00090312 SEC_I_COMPLETE_NEEDED Handle = 0x00090313 SEC_I_COMPLETE_AND_CONTINUE Handle = 0x00090314 SEC_I_LOCAL_LOGON Handle = 0x00090315 SEC_I_GENERIC_EXTENSION_RECEIVED Handle = 0x00090316 SEC_E_BAD_PKGID Handle = 0x80090316 SEC_E_CONTEXT_EXPIRED Handle = 0x80090317 SEC_I_CONTEXT_EXPIRED Handle = 0x00090317 SEC_E_INCOMPLETE_MESSAGE Handle = 0x80090318 SEC_E_INCOMPLETE_CREDENTIALS Handle = 0x80090320 SEC_E_BUFFER_TOO_SMALL Handle = 0x80090321 SEC_I_INCOMPLETE_CREDENTIALS Handle = 0x00090320 SEC_I_RENEGOTIATE Handle = 0x00090321 SEC_E_WRONG_PRINCIPAL Handle = 0x80090322 SEC_I_NO_LSA_CONTEXT Handle = 0x00090323 SEC_E_TIME_SKEW Handle = 0x80090324 SEC_E_UNTRUSTED_ROOT Handle = 0x80090325 SEC_E_ILLEGAL_MESSAGE Handle = 0x80090326 SEC_E_CERT_UNKNOWN Handle = 0x80090327 SEC_E_CERT_EXPIRED Handle = 0x80090328 SEC_E_ENCRYPT_FAILURE Handle = 0x80090329 SEC_E_DECRYPT_FAILURE Handle = 0x80090330 SEC_E_ALGORITHM_MISMATCH Handle = 0x80090331 SEC_E_SECURITY_QOS_FAILED Handle = 0x80090332 SEC_E_UNFINISHED_CONTEXT_DELETED Handle = 0x80090333 SEC_E_NO_TGT_REPLY Handle = 0x80090334 SEC_E_NO_IP_ADDRESSES Handle = 0x80090335 SEC_E_WRONG_CREDENTIAL_HANDLE Handle = 0x80090336 SEC_E_CRYPTO_SYSTEM_INVALID Handle = 0x80090337 SEC_E_MAX_REFERRALS_EXCEEDED Handle = 0x80090338 SEC_E_MUST_BE_KDC Handle = 0x80090339 SEC_E_STRONG_CRYPTO_NOT_SUPPORTED Handle = 0x8009033A SEC_E_TOO_MANY_PRINCIPALS Handle = 0x8009033B SEC_E_NO_PA_DATA Handle = 0x8009033C SEC_E_PKINIT_NAME_MISMATCH Handle = 0x8009033D SEC_E_SMARTCARD_LOGON_REQUIRED Handle = 0x8009033E SEC_E_SHUTDOWN_IN_PROGRESS Handle = 0x8009033F SEC_E_KDC_INVALID_REQUEST Handle = 0x80090340 SEC_E_KDC_UNABLE_TO_REFER Handle = 0x80090341 SEC_E_KDC_UNKNOWN_ETYPE Handle = 0x80090342 SEC_E_UNSUPPORTED_PREAUTH Handle = 0x80090343 SEC_E_DELEGATION_REQUIRED Handle = 0x80090345 SEC_E_BAD_BINDINGS Handle = 0x80090346 SEC_E_MULTIPLE_ACCOUNTS Handle = 0x80090347 SEC_E_NO_KERB_KEY Handle = 0x80090348 SEC_E_CERT_WRONG_USAGE Handle = 0x80090349 SEC_E_DOWNGRADE_DETECTED Handle = 0x80090350 SEC_E_SMARTCARD_CERT_REVOKED Handle = 0x80090351 SEC_E_ISSUING_CA_UNTRUSTED Handle = 0x80090352 SEC_E_REVOCATION_OFFLINE_C Handle = 0x80090353 SEC_E_PKINIT_CLIENT_FAILURE Handle = 0x80090354 SEC_E_SMARTCARD_CERT_EXPIRED Handle = 0x80090355 SEC_E_NO_S4U_PROT_SUPPORT Handle = 0x80090356 SEC_E_CROSSREALM_DELEGATION_FAILURE Handle = 0x80090357 SEC_E_REVOCATION_OFFLINE_KDC Handle = 0x80090358 SEC_E_ISSUING_CA_UNTRUSTED_KDC Handle = 0x80090359 SEC_E_KDC_CERT_EXPIRED Handle = 0x8009035A SEC_E_KDC_CERT_REVOKED Handle = 0x8009035B SEC_I_SIGNATURE_NEEDED Handle = 0x0009035C SEC_E_INVALID_PARAMETER Handle = 0x8009035D SEC_E_DELEGATION_POLICY Handle = 0x8009035E SEC_E_POLICY_NLTM_ONLY Handle = 0x8009035F SEC_I_NO_RENEGOTIATION Handle = 0x00090360 SEC_E_NO_CONTEXT Handle = 0x80090361 SEC_E_PKU2U_CERT_FAILURE Handle = 0x80090362 SEC_E_MUTUAL_AUTH_FAILED Handle = 0x80090363 SEC_I_MESSAGE_FRAGMENT Handle = 0x00090364 SEC_E_ONLY_HTTPS_ALLOWED Handle = 0x80090365 SEC_I_CONTINUE_NEEDED_MESSAGE_OK Handle = 0x00090366 SEC_E_APPLICATION_PROTOCOL_MISMATCH Handle = 0x80090367 SEC_I_ASYNC_CALL_PENDING Handle = 0x00090368 SEC_E_INVALID_UPN_NAME Handle = 0x80090369 SEC_E_EXT_BUFFER_TOO_SMALL Handle = 0x8009036A SEC_E_INSUFFICIENT_BUFFERS Handle = 0x8009036B SEC_E_NO_SPM = SEC_E_INTERNAL_ERROR SEC_E_NOT_SUPPORTED = SEC_E_UNSUPPORTED_FUNCTION CRYPT_E_MSG_ERROR Handle = 0x80091001 CRYPT_E_UNKNOWN_ALGO Handle = 0x80091002 CRYPT_E_OID_FORMAT Handle = 0x80091003 CRYPT_E_INVALID_MSG_TYPE Handle = 0x80091004 CRYPT_E_UNEXPECTED_ENCODING Handle = 0x80091005 CRYPT_E_AUTH_ATTR_MISSING Handle = 0x80091006 CRYPT_E_HASH_VALUE Handle = 0x80091007 CRYPT_E_INVALID_INDEX Handle = 0x80091008 CRYPT_E_ALREADY_DECRYPTED Handle = 0x80091009 CRYPT_E_NOT_DECRYPTED Handle = 0x8009100A CRYPT_E_RECIPIENT_NOT_FOUND Handle = 0x8009100B CRYPT_E_CONTROL_TYPE Handle = 0x8009100C CRYPT_E_ISSUER_SERIALNUMBER Handle = 0x8009100D CRYPT_E_SIGNER_NOT_FOUND Handle = 0x8009100E CRYPT_E_ATTRIBUTES_MISSING Handle = 0x8009100F CRYPT_E_STREAM_MSG_NOT_READY Handle = 0x80091010 CRYPT_E_STREAM_INSUFFICIENT_DATA Handle = 0x80091011 CRYPT_I_NEW_PROTECTION_REQUIRED Handle = 0x00091012 CRYPT_E_BAD_LEN Handle = 0x80092001 CRYPT_E_BAD_ENCODE Handle = 0x80092002 CRYPT_E_FILE_ERROR Handle = 0x80092003 CRYPT_E_NOT_FOUND Handle = 0x80092004 CRYPT_E_EXISTS Handle = 0x80092005 CRYPT_E_NO_PROVIDER Handle = 0x80092006 CRYPT_E_SELF_SIGNED Handle = 0x80092007 CRYPT_E_DELETED_PREV Handle = 0x80092008 CRYPT_E_NO_MATCH Handle = 0x80092009 CRYPT_E_UNEXPECTED_MSG_TYPE Handle = 0x8009200A CRYPT_E_NO_KEY_PROPERTY Handle = 0x8009200B CRYPT_E_NO_DECRYPT_CERT Handle = 0x8009200C CRYPT_E_BAD_MSG Handle = 0x8009200D CRYPT_E_NO_SIGNER Handle = 0x8009200E CRYPT_E_PENDING_CLOSE Handle = 0x8009200F CRYPT_E_REVOKED Handle = 0x80092010 CRYPT_E_NO_REVOCATION_DLL Handle = 0x80092011 CRYPT_E_NO_REVOCATION_CHECK Handle = 0x80092012 CRYPT_E_REVOCATION_OFFLINE Handle = 0x80092013 CRYPT_E_NOT_IN_REVOCATION_DATABASE Handle = 0x80092014 CRYPT_E_INVALID_NUMERIC_STRING Handle = 0x80092020 CRYPT_E_INVALID_PRINTABLE_STRING Handle = 0x80092021 CRYPT_E_INVALID_IA5_STRING Handle = 0x80092022 CRYPT_E_INVALID_X500_STRING Handle = 0x80092023 CRYPT_E_NOT_CHAR_STRING Handle = 0x80092024 CRYPT_E_FILERESIZED Handle = 0x80092025 CRYPT_E_SECURITY_SETTINGS Handle = 0x80092026 CRYPT_E_NO_VERIFY_USAGE_DLL Handle = 0x80092027 CRYPT_E_NO_VERIFY_USAGE_CHECK Handle = 0x80092028 CRYPT_E_VERIFY_USAGE_OFFLINE Handle = 0x80092029 CRYPT_E_NOT_IN_CTL Handle = 0x8009202A CRYPT_E_NO_TRUSTED_SIGNER Handle = 0x8009202B CRYPT_E_MISSING_PUBKEY_PARA Handle = 0x8009202C CRYPT_E_OBJECT_LOCATOR_OBJECT_NOT_FOUND Handle = 0x8009202D CRYPT_E_OSS_ERROR Handle = 0x80093000 OSS_MORE_BUF Handle = 0x80093001 OSS_NEGATIVE_UINTEGER Handle = 0x80093002 OSS_PDU_RANGE Handle = 0x80093003 OSS_MORE_INPUT Handle = 0x80093004 OSS_DATA_ERROR Handle = 0x80093005 OSS_BAD_ARG Handle = 0x80093006 OSS_BAD_VERSION Handle = 0x80093007 OSS_OUT_MEMORY Handle = 0x80093008 OSS_PDU_MISMATCH Handle = 0x80093009 OSS_LIMITED Handle = 0x8009300A OSS_BAD_PTR Handle = 0x8009300B OSS_BAD_TIME Handle = 0x8009300C OSS_INDEFINITE_NOT_SUPPORTED Handle = 0x8009300D OSS_MEM_ERROR Handle = 0x8009300E OSS_BAD_TABLE Handle = 0x8009300F OSS_TOO_LONG Handle = 0x80093010 OSS_CONSTRAINT_VIOLATED Handle = 0x80093011 OSS_FATAL_ERROR Handle = 0x80093012 OSS_ACCESS_SERIALIZATION_ERROR Handle = 0x80093013 OSS_NULL_TBL Handle = 0x80093014 OSS_NULL_FCN Handle = 0x80093015 OSS_BAD_ENCRULES Handle = 0x80093016 OSS_UNAVAIL_ENCRULES Handle = 0x80093017 OSS_CANT_OPEN_TRACE_WINDOW Handle = 0x80093018 OSS_UNIMPLEMENTED Handle = 0x80093019 OSS_OID_DLL_NOT_LINKED Handle = 0x8009301A OSS_CANT_OPEN_TRACE_FILE Handle = 0x8009301B OSS_TRACE_FILE_ALREADY_OPEN Handle = 0x8009301C OSS_TABLE_MISMATCH Handle = 0x8009301D OSS_TYPE_NOT_SUPPORTED Handle = 0x8009301E OSS_REAL_DLL_NOT_LINKED Handle = 0x8009301F OSS_REAL_CODE_NOT_LINKED Handle = 0x80093020 OSS_OUT_OF_RANGE Handle = 0x80093021 OSS_COPIER_DLL_NOT_LINKED Handle = 0x80093022 OSS_CONSTRAINT_DLL_NOT_LINKED Handle = 0x80093023 OSS_COMPARATOR_DLL_NOT_LINKED Handle = 0x80093024 OSS_COMPARATOR_CODE_NOT_LINKED Handle = 0x80093025 OSS_MEM_MGR_DLL_NOT_LINKED Handle = 0x80093026 OSS_PDV_DLL_NOT_LINKED Handle = 0x80093027 OSS_PDV_CODE_NOT_LINKED Handle = 0x80093028 OSS_API_DLL_NOT_LINKED Handle = 0x80093029 OSS_BERDER_DLL_NOT_LINKED Handle = 0x8009302A OSS_PER_DLL_NOT_LINKED Handle = 0x8009302B OSS_OPEN_TYPE_ERROR Handle = 0x8009302C OSS_MUTEX_NOT_CREATED Handle = 0x8009302D OSS_CANT_CLOSE_TRACE_FILE Handle = 0x8009302E CRYPT_E_ASN1_ERROR Handle = 0x80093100 CRYPT_E_ASN1_INTERNAL Handle = 0x80093101 CRYPT_E_ASN1_EOD Handle = 0x80093102 CRYPT_E_ASN1_CORRUPT Handle = 0x80093103 CRYPT_E_ASN1_LARGE Handle = 0x80093104 CRYPT_E_ASN1_CONSTRAINT Handle = 0x80093105 CRYPT_E_ASN1_MEMORY Handle = 0x80093106 CRYPT_E_ASN1_OVERFLOW Handle = 0x80093107 CRYPT_E_ASN1_BADPDU Handle = 0x80093108 CRYPT_E_ASN1_BADARGS Handle = 0x80093109 CRYPT_E_ASN1_BADREAL Handle = 0x8009310A CRYPT_E_ASN1_BADTAG Handle = 0x8009310B CRYPT_E_ASN1_CHOICE Handle = 0x8009310C CRYPT_E_ASN1_RULE Handle = 0x8009310D CRYPT_E_ASN1_UTF8 Handle = 0x8009310E CRYPT_E_ASN1_PDU_TYPE Handle = 0x80093133 CRYPT_E_ASN1_NYI Handle = 0x80093134 CRYPT_E_ASN1_EXTENDED Handle = 0x80093201 CRYPT_E_ASN1_NOEOD Handle = 0x80093202 CERTSRV_E_BAD_REQUESTSUBJECT Handle = 0x80094001 CERTSRV_E_NO_REQUEST Handle = 0x80094002 CERTSRV_E_BAD_REQUESTSTATUS Handle = 0x80094003 CERTSRV_E_PROPERTY_EMPTY Handle = 0x80094004 CERTSRV_E_INVALID_CA_CERTIFICATE Handle = 0x80094005 CERTSRV_E_SERVER_SUSPENDED Handle = 0x80094006 CERTSRV_E_ENCODING_LENGTH Handle = 0x80094007 CERTSRV_E_ROLECONFLICT Handle = 0x80094008 CERTSRV_E_RESTRICTEDOFFICER Handle = 0x80094009 CERTSRV_E_KEY_ARCHIVAL_NOT_CONFIGURED Handle = 0x8009400A CERTSRV_E_NO_VALID_KRA Handle = 0x8009400B CERTSRV_E_BAD_REQUEST_KEY_ARCHIVAL Handle = 0x8009400C CERTSRV_E_NO_CAADMIN_DEFINED Handle = 0x8009400D CERTSRV_E_BAD_RENEWAL_CERT_ATTRIBUTE Handle = 0x8009400E CERTSRV_E_NO_DB_SESSIONS Handle = 0x8009400F CERTSRV_E_ALIGNMENT_FAULT Handle = 0x80094010 CERTSRV_E_ENROLL_DENIED Handle = 0x80094011 CERTSRV_E_TEMPLATE_DENIED Handle = 0x80094012 CERTSRV_E_DOWNLEVEL_DC_SSL_OR_UPGRADE Handle = 0x80094013 CERTSRV_E_ADMIN_DENIED_REQUEST Handle = 0x80094014 CERTSRV_E_NO_POLICY_SERVER Handle = 0x80094015 CERTSRV_E_WEAK_SIGNATURE_OR_KEY Handle = 0x80094016 CERTSRV_E_KEY_ATTESTATION_NOT_SUPPORTED Handle = 0x80094017 CERTSRV_E_ENCRYPTION_CERT_REQUIRED Handle = 0x80094018 CERTSRV_E_UNSUPPORTED_CERT_TYPE Handle = 0x80094800 CERTSRV_E_NO_CERT_TYPE Handle = 0x80094801 CERTSRV_E_TEMPLATE_CONFLICT Handle = 0x80094802 CERTSRV_E_SUBJECT_ALT_NAME_REQUIRED Handle = 0x80094803 CERTSRV_E_ARCHIVED_KEY_REQUIRED Handle = 0x80094804 CERTSRV_E_SMIME_REQUIRED Handle = 0x80094805 CERTSRV_E_BAD_RENEWAL_SUBJECT Handle = 0x80094806 CERTSRV_E_BAD_TEMPLATE_VERSION Handle = 0x80094807 CERTSRV_E_TEMPLATE_POLICY_REQUIRED Handle = 0x80094808 CERTSRV_E_SIGNATURE_POLICY_REQUIRED Handle = 0x80094809 CERTSRV_E_SIGNATURE_COUNT Handle = 0x8009480A CERTSRV_E_SIGNATURE_REJECTED Handle = 0x8009480B CERTSRV_E_ISSUANCE_POLICY_REQUIRED Handle = 0x8009480C CERTSRV_E_SUBJECT_UPN_REQUIRED Handle = 0x8009480D CERTSRV_E_SUBJECT_DIRECTORY_GUID_REQUIRED Handle = 0x8009480E CERTSRV_E_SUBJECT_DNS_REQUIRED Handle = 0x8009480F CERTSRV_E_ARCHIVED_KEY_UNEXPECTED Handle = 0x80094810 CERTSRV_E_KEY_LENGTH Handle = 0x80094811 CERTSRV_E_SUBJECT_EMAIL_REQUIRED Handle = 0x80094812 CERTSRV_E_UNKNOWN_CERT_TYPE Handle = 0x80094813 CERTSRV_E_CERT_TYPE_OVERLAP Handle = 0x80094814 CERTSRV_E_TOO_MANY_SIGNATURES Handle = 0x80094815 CERTSRV_E_RENEWAL_BAD_PUBLIC_KEY Handle = 0x80094816 CERTSRV_E_INVALID_EK Handle = 0x80094817 CERTSRV_E_INVALID_IDBINDING Handle = 0x80094818 CERTSRV_E_INVALID_ATTESTATION Handle = 0x80094819 CERTSRV_E_KEY_ATTESTATION Handle = 0x8009481A CERTSRV_E_CORRUPT_KEY_ATTESTATION Handle = 0x8009481B CERTSRV_E_EXPIRED_CHALLENGE Handle = 0x8009481C CERTSRV_E_INVALID_RESPONSE Handle = 0x8009481D CERTSRV_E_INVALID_REQUESTID Handle = 0x8009481E CERTSRV_E_REQUEST_PRECERTIFICATE_MISMATCH Handle = 0x8009481F CERTSRV_E_PENDING_CLIENT_RESPONSE Handle = 0x80094820 XENROLL_E_KEY_NOT_EXPORTABLE Handle = 0x80095000 XENROLL_E_CANNOT_ADD_ROOT_CERT Handle = 0x80095001 XENROLL_E_RESPONSE_KA_HASH_NOT_FOUND Handle = 0x80095002 XENROLL_E_RESPONSE_UNEXPECTED_KA_HASH Handle = 0x80095003 XENROLL_E_RESPONSE_KA_HASH_MISMATCH Handle = 0x80095004 XENROLL_E_KEYSPEC_SMIME_MISMATCH Handle = 0x80095005 TRUST_E_SYSTEM_ERROR Handle = 0x80096001 TRUST_E_NO_SIGNER_CERT Handle = 0x80096002 TRUST_E_COUNTER_SIGNER Handle = 0x80096003 TRUST_E_CERT_SIGNATURE Handle = 0x80096004 TRUST_E_TIME_STAMP Handle = 0x80096005 TRUST_E_BAD_DIGEST Handle = 0x80096010 TRUST_E_MALFORMED_SIGNATURE Handle = 0x80096011 TRUST_E_BASIC_CONSTRAINTS Handle = 0x80096019 TRUST_E_FINANCIAL_CRITERIA Handle = 0x8009601E MSSIPOTF_E_OUTOFMEMRANGE Handle = 0x80097001 MSSIPOTF_E_CANTGETOBJECT Handle = 0x80097002 MSSIPOTF_E_NOHEADTABLE Handle = 0x80097003 MSSIPOTF_E_BAD_MAGICNUMBER Handle = 0x80097004 MSSIPOTF_E_BAD_OFFSET_TABLE Handle = 0x80097005 MSSIPOTF_E_TABLE_TAGORDER Handle = 0x80097006 MSSIPOTF_E_TABLE_LONGWORD Handle = 0x80097007 MSSIPOTF_E_BAD_FIRST_TABLE_PLACEMENT Handle = 0x80097008 MSSIPOTF_E_TABLES_OVERLAP Handle = 0x80097009 MSSIPOTF_E_TABLE_PADBYTES Handle = 0x8009700A MSSIPOTF_E_FILETOOSMALL Handle = 0x8009700B MSSIPOTF_E_TABLE_CHECKSUM Handle = 0x8009700C MSSIPOTF_E_FILE_CHECKSUM Handle = 0x8009700D MSSIPOTF_E_FAILED_POLICY Handle = 0x80097010 MSSIPOTF_E_FAILED_HINTS_CHECK Handle = 0x80097011 MSSIPOTF_E_NOT_OPENTYPE Handle = 0x80097012 MSSIPOTF_E_FILE Handle = 0x80097013 MSSIPOTF_E_CRYPT Handle = 0x80097014 MSSIPOTF_E_BADVERSION Handle = 0x80097015 MSSIPOTF_E_DSIG_STRUCTURE Handle = 0x80097016 MSSIPOTF_E_PCONST_CHECK Handle = 0x80097017 MSSIPOTF_E_STRUCTURE Handle = 0x80097018 ERROR_CRED_REQUIRES_CONFIRMATION Handle = 0x80097019 NTE_OP_OK syscall.Errno = 0 TRUST_E_PROVIDER_UNKNOWN Handle = 0x800B0001 TRUST_E_ACTION_UNKNOWN Handle = 0x800B0002 TRUST_E_SUBJECT_FORM_UNKNOWN Handle = 0x800B0003 TRUST_E_SUBJECT_NOT_TRUSTED Handle = 0x800B0004 DIGSIG_E_ENCODE Handle = 0x800B0005 DIGSIG_E_DECODE Handle = 0x800B0006 DIGSIG_E_EXTENSIBILITY Handle = 0x800B0007 DIGSIG_E_CRYPTO Handle = 0x800B0008 PERSIST_E_SIZEDEFINITE Handle = 0x800B0009 PERSIST_E_SIZEINDEFINITE Handle = 0x800B000A PERSIST_E_NOTSELFSIZING Handle = 0x800B000B TRUST_E_NOSIGNATURE Handle = 0x800B0100 CERT_E_EXPIRED Handle = 0x800B0101 CERT_E_VALIDITYPERIODNESTING Handle = 0x800B0102 CERT_E_ROLE Handle = 0x800B0103 CERT_E_PATHLENCONST Handle = 0x800B0104 CERT_E_CRITICAL Handle = 0x800B0105 CERT_E_PURPOSE Handle = 0x800B0106 CERT_E_ISSUERCHAINING Handle = 0x800B0107 CERT_E_MALFORMED Handle = 0x800B0108 CERT_E_UNTRUSTEDROOT Handle = 0x800B0109 CERT_E_CHAINING Handle = 0x800B010A TRUST_E_FAIL Handle = 0x800B010B CERT_E_REVOKED Handle = 0x800B010C CERT_E_UNTRUSTEDTESTROOT Handle = 0x800B010D CERT_E_REVOCATION_FAILURE Handle = 0x800B010E CERT_E_CN_NO_MATCH Handle = 0x800B010F CERT_E_WRONG_USAGE Handle = 0x800B0110 TRUST_E_EXPLICIT_DISTRUST Handle = 0x800B0111 CERT_E_UNTRUSTEDCA Handle = 0x800B0112 CERT_E_INVALID_POLICY Handle = 0x800B0113 CERT_E_INVALID_NAME Handle = 0x800B0114 SPAPI_E_EXPECTED_SECTION_NAME Handle = 0x800F0000 SPAPI_E_BAD_SECTION_NAME_LINE Handle = 0x800F0001 SPAPI_E_SECTION_NAME_TOO_LONG Handle = 0x800F0002 SPAPI_E_GENERAL_SYNTAX Handle = 0x800F0003 SPAPI_E_WRONG_INF_STYLE Handle = 0x800F0100 SPAPI_E_SECTION_NOT_FOUND Handle = 0x800F0101 SPAPI_E_LINE_NOT_FOUND Handle = 0x800F0102 SPAPI_E_NO_BACKUP Handle = 0x800F0103 SPAPI_E_NO_ASSOCIATED_CLASS Handle = 0x800F0200 SPAPI_E_CLASS_MISMATCH Handle = 0x800F0201 SPAPI_E_DUPLICATE_FOUND Handle = 0x800F0202 SPAPI_E_NO_DRIVER_SELECTED Handle = 0x800F0203 SPAPI_E_KEY_DOES_NOT_EXIST Handle = 0x800F0204 SPAPI_E_INVALID_DEVINST_NAME Handle = 0x800F0205 SPAPI_E_INVALID_CLASS Handle = 0x800F0206 SPAPI_E_DEVINST_ALREADY_EXISTS Handle = 0x800F0207 SPAPI_E_DEVINFO_NOT_REGISTERED Handle = 0x800F0208 SPAPI_E_INVALID_REG_PROPERTY Handle = 0x800F0209 SPAPI_E_NO_INF Handle = 0x800F020A SPAPI_E_NO_SUCH_DEVINST Handle = 0x800F020B SPAPI_E_CANT_LOAD_CLASS_ICON Handle = 0x800F020C SPAPI_E_INVALID_CLASS_INSTALLER Handle = 0x800F020D SPAPI_E_DI_DO_DEFAULT Handle = 0x800F020E SPAPI_E_DI_NOFILECOPY Handle = 0x800F020F SPAPI_E_INVALID_HWPROFILE Handle = 0x800F0210 SPAPI_E_NO_DEVICE_SELECTED Handle = 0x800F0211 SPAPI_E_DEVINFO_LIST_LOCKED Handle = 0x800F0212 SPAPI_E_DEVINFO_DATA_LOCKED Handle = 0x800F0213 SPAPI_E_DI_BAD_PATH Handle = 0x800F0214 SPAPI_E_NO_CLASSINSTALL_PARAMS Handle = 0x800F0215 SPAPI_E_FILEQUEUE_LOCKED Handle = 0x800F0216 SPAPI_E_BAD_SERVICE_INSTALLSECT Handle = 0x800F0217 SPAPI_E_NO_CLASS_DRIVER_LIST Handle = 0x800F0218 SPAPI_E_NO_ASSOCIATED_SERVICE Handle = 0x800F0219 SPAPI_E_NO_DEFAULT_DEVICE_INTERFACE Handle = 0x800F021A SPAPI_E_DEVICE_INTERFACE_ACTIVE Handle = 0x800F021B SPAPI_E_DEVICE_INTERFACE_REMOVED Handle = 0x800F021C SPAPI_E_BAD_INTERFACE_INSTALLSECT Handle = 0x800F021D SPAPI_E_NO_SUCH_INTERFACE_CLASS Handle = 0x800F021E SPAPI_E_INVALID_REFERENCE_STRING Handle = 0x800F021F SPAPI_E_INVALID_MACHINENAME Handle = 0x800F0220 SPAPI_E_REMOTE_COMM_FAILURE Handle = 0x800F0221 SPAPI_E_MACHINE_UNAVAILABLE Handle = 0x800F0222 SPAPI_E_NO_CONFIGMGR_SERVICES Handle = 0x800F0223 SPAPI_E_INVALID_PROPPAGE_PROVIDER Handle = 0x800F0224 SPAPI_E_NO_SUCH_DEVICE_INTERFACE Handle = 0x800F0225 SPAPI_E_DI_POSTPROCESSING_REQUIRED Handle = 0x800F0226 SPAPI_E_INVALID_COINSTALLER Handle = 0x800F0227 SPAPI_E_NO_COMPAT_DRIVERS Handle = 0x800F0228 SPAPI_E_NO_DEVICE_ICON Handle = 0x800F0229 SPAPI_E_INVALID_INF_LOGCONFIG Handle = 0x800F022A SPAPI_E_DI_DONT_INSTALL Handle = 0x800F022B SPAPI_E_INVALID_FILTER_DRIVER Handle = 0x800F022C SPAPI_E_NON_WINDOWS_NT_DRIVER Handle = 0x800F022D SPAPI_E_NON_WINDOWS_DRIVER Handle = 0x800F022E SPAPI_E_NO_CATALOG_FOR_OEM_INF Handle = 0x800F022F SPAPI_E_DEVINSTALL_QUEUE_NONNATIVE Handle = 0x800F0230 SPAPI_E_NOT_DISABLEABLE Handle = 0x800F0231 SPAPI_E_CANT_REMOVE_DEVINST Handle = 0x800F0232 SPAPI_E_INVALID_TARGET Handle = 0x800F0233 SPAPI_E_DRIVER_NONNATIVE Handle = 0x800F0234 SPAPI_E_IN_WOW64 Handle = 0x800F0235 SPAPI_E_SET_SYSTEM_RESTORE_POINT Handle = 0x800F0236 SPAPI_E_INCORRECTLY_COPIED_INF Handle = 0x800F0237 SPAPI_E_SCE_DISABLED Handle = 0x800F0238 SPAPI_E_UNKNOWN_EXCEPTION Handle = 0x800F0239 SPAPI_E_PNP_REGISTRY_ERROR Handle = 0x800F023A SPAPI_E_REMOTE_REQUEST_UNSUPPORTED Handle = 0x800F023B SPAPI_E_NOT_AN_INSTALLED_OEM_INF Handle = 0x800F023C SPAPI_E_INF_IN_USE_BY_DEVICES Handle = 0x800F023D SPAPI_E_DI_FUNCTION_OBSOLETE Handle = 0x800F023E SPAPI_E_NO_AUTHENTICODE_CATALOG Handle = 0x800F023F SPAPI_E_AUTHENTICODE_DISALLOWED Handle = 0x800F0240 SPAPI_E_AUTHENTICODE_TRUSTED_PUBLISHER Handle = 0x800F0241 SPAPI_E_AUTHENTICODE_TRUST_NOT_ESTABLISHED Handle = 0x800F0242 SPAPI_E_AUTHENTICODE_PUBLISHER_NOT_TRUSTED Handle = 0x800F0243 SPAPI_E_SIGNATURE_OSATTRIBUTE_MISMATCH Handle = 0x800F0244 SPAPI_E_ONLY_VALIDATE_VIA_AUTHENTICODE Handle = 0x800F0245 SPAPI_E_DEVICE_INSTALLER_NOT_READY Handle = 0x800F0246 SPAPI_E_DRIVER_STORE_ADD_FAILED Handle = 0x800F0247 SPAPI_E_DEVICE_INSTALL_BLOCKED Handle = 0x800F0248 SPAPI_E_DRIVER_INSTALL_BLOCKED Handle = 0x800F0249 SPAPI_E_WRONG_INF_TYPE Handle = 0x800F024A SPAPI_E_FILE_HASH_NOT_IN_CATALOG Handle = 0x800F024B SPAPI_E_DRIVER_STORE_DELETE_FAILED Handle = 0x800F024C SPAPI_E_UNRECOVERABLE_STACK_OVERFLOW Handle = 0x800F0300 SPAPI_E_ERROR_NOT_INSTALLED Handle = 0x800F1000 SCARD_S_SUCCESS = S_OK SCARD_F_INTERNAL_ERROR Handle = 0x80100001 SCARD_E_CANCELLED Handle = 0x80100002 SCARD_E_INVALID_HANDLE Handle = 0x80100003 SCARD_E_INVALID_PARAMETER Handle = 0x80100004 SCARD_E_INVALID_TARGET Handle = 0x80100005 SCARD_E_NO_MEMORY Handle = 0x80100006 SCARD_F_WAITED_TOO_LONG Handle = 0x80100007 SCARD_E_INSUFFICIENT_BUFFER Handle = 0x80100008 SCARD_E_UNKNOWN_READER Handle = 0x80100009 SCARD_E_TIMEOUT Handle = 0x8010000A SCARD_E_SHARING_VIOLATION Handle = 0x8010000B SCARD_E_NO_SMARTCARD Handle = 0x8010000C SCARD_E_UNKNOWN_CARD Handle = 0x8010000D SCARD_E_CANT_DISPOSE Handle = 0x8010000E SCARD_E_PROTO_MISMATCH Handle = 0x8010000F SCARD_E_NOT_READY Handle = 0x80100010 SCARD_E_INVALID_VALUE Handle = 0x80100011 SCARD_E_SYSTEM_CANCELLED Handle = 0x80100012 SCARD_F_COMM_ERROR Handle = 0x80100013 SCARD_F_UNKNOWN_ERROR Handle = 0x80100014 SCARD_E_INVALID_ATR Handle = 0x80100015 SCARD_E_NOT_TRANSACTED Handle = 0x80100016 SCARD_E_READER_UNAVAILABLE Handle = 0x80100017 SCARD_P_SHUTDOWN Handle = 0x80100018 SCARD_E_PCI_TOO_SMALL Handle = 0x80100019 SCARD_E_READER_UNSUPPORTED Handle = 0x8010001A SCARD_E_DUPLICATE_READER Handle = 0x8010001B SCARD_E_CARD_UNSUPPORTED Handle = 0x8010001C SCARD_E_NO_SERVICE Handle = 0x8010001D SCARD_E_SERVICE_STOPPED Handle = 0x8010001E SCARD_E_UNEXPECTED Handle = 0x8010001F SCARD_E_ICC_INSTALLATION Handle = 0x80100020 SCARD_E_ICC_CREATEORDER Handle = 0x80100021 SCARD_E_UNSUPPORTED_FEATURE Handle = 0x80100022 SCARD_E_DIR_NOT_FOUND Handle = 0x80100023 SCARD_E_FILE_NOT_FOUND Handle = 0x80100024 SCARD_E_NO_DIR Handle = 0x80100025 SCARD_E_NO_FILE Handle = 0x80100026 SCARD_E_NO_ACCESS Handle = 0x80100027 SCARD_E_WRITE_TOO_MANY Handle = 0x80100028 SCARD_E_BAD_SEEK Handle = 0x80100029 SCARD_E_INVALID_CHV Handle = 0x8010002A SCARD_E_UNKNOWN_RES_MNG Handle = 0x8010002B SCARD_E_NO_SUCH_CERTIFICATE Handle = 0x8010002C SCARD_E_CERTIFICATE_UNAVAILABLE Handle = 0x8010002D SCARD_E_NO_READERS_AVAILABLE Handle = 0x8010002E SCARD_E_COMM_DATA_LOST Handle = 0x8010002F SCARD_E_NO_KEY_CONTAINER Handle = 0x80100030 SCARD_E_SERVER_TOO_BUSY Handle = 0x80100031 SCARD_E_PIN_CACHE_EXPIRED Handle = 0x80100032 SCARD_E_NO_PIN_CACHE Handle = 0x80100033 SCARD_E_READ_ONLY_CARD Handle = 0x80100034 SCARD_W_UNSUPPORTED_CARD Handle = 0x80100065 SCARD_W_UNRESPONSIVE_CARD Handle = 0x80100066 SCARD_W_UNPOWERED_CARD Handle = 0x80100067 SCARD_W_RESET_CARD Handle = 0x80100068 SCARD_W_REMOVED_CARD Handle = 0x80100069 SCARD_W_SECURITY_VIOLATION Handle = 0x8010006A SCARD_W_WRONG_CHV Handle = 0x8010006B SCARD_W_CHV_BLOCKED Handle = 0x8010006C SCARD_W_EOF Handle = 0x8010006D SCARD_W_CANCELLED_BY_USER Handle = 0x8010006E SCARD_W_CARD_NOT_AUTHENTICATED Handle = 0x8010006F SCARD_W_CACHE_ITEM_NOT_FOUND Handle = 0x80100070 SCARD_W_CACHE_ITEM_STALE Handle = 0x80100071 SCARD_W_CACHE_ITEM_TOO_BIG Handle = 0x80100072 COMADMIN_E_OBJECTERRORS Handle = 0x80110401 COMADMIN_E_OBJECTINVALID Handle = 0x80110402 COMADMIN_E_KEYMISSING Handle = 0x80110403 COMADMIN_E_ALREADYINSTALLED Handle = 0x80110404 COMADMIN_E_APP_FILE_WRITEFAIL Handle = 0x80110407 COMADMIN_E_APP_FILE_READFAIL Handle = 0x80110408 COMADMIN_E_APP_FILE_VERSION Handle = 0x80110409 COMADMIN_E_BADPATH Handle = 0x8011040A COMADMIN_E_APPLICATIONEXISTS Handle = 0x8011040B COMADMIN_E_ROLEEXISTS Handle = 0x8011040C COMADMIN_E_CANTCOPYFILE Handle = 0x8011040D COMADMIN_E_NOUSER Handle = 0x8011040F COMADMIN_E_INVALIDUSERIDS Handle = 0x80110410 COMADMIN_E_NOREGISTRYCLSID Handle = 0x80110411 COMADMIN_E_BADREGISTRYPROGID Handle = 0x80110412 COMADMIN_E_AUTHENTICATIONLEVEL Handle = 0x80110413 COMADMIN_E_USERPASSWDNOTVALID Handle = 0x80110414 COMADMIN_E_CLSIDORIIDMISMATCH Handle = 0x80110418 COMADMIN_E_REMOTEINTERFACE Handle = 0x80110419 COMADMIN_E_DLLREGISTERSERVER Handle = 0x8011041A COMADMIN_E_NOSERVERSHARE Handle = 0x8011041B COMADMIN_E_DLLLOADFAILED Handle = 0x8011041D COMADMIN_E_BADREGISTRYLIBID Handle = 0x8011041E COMADMIN_E_APPDIRNOTFOUND Handle = 0x8011041F COMADMIN_E_REGISTRARFAILED Handle = 0x80110423 COMADMIN_E_COMPFILE_DOESNOTEXIST Handle = 0x80110424 COMADMIN_E_COMPFILE_LOADDLLFAIL Handle = 0x80110425 COMADMIN_E_COMPFILE_GETCLASSOBJ Handle = 0x80110426 COMADMIN_E_COMPFILE_CLASSNOTAVAIL Handle = 0x80110427 COMADMIN_E_COMPFILE_BADTLB Handle = 0x80110428 COMADMIN_E_COMPFILE_NOTINSTALLABLE Handle = 0x80110429 COMADMIN_E_NOTCHANGEABLE Handle = 0x8011042A COMADMIN_E_NOTDELETEABLE Handle = 0x8011042B COMADMIN_E_SESSION Handle = 0x8011042C COMADMIN_E_COMP_MOVE_LOCKED Handle = 0x8011042D COMADMIN_E_COMP_MOVE_BAD_DEST Handle = 0x8011042E COMADMIN_E_REGISTERTLB Handle = 0x80110430 COMADMIN_E_SYSTEMAPP Handle = 0x80110433 COMADMIN_E_COMPFILE_NOREGISTRAR Handle = 0x80110434 COMADMIN_E_COREQCOMPINSTALLED Handle = 0x80110435 COMADMIN_E_SERVICENOTINSTALLED Handle = 0x80110436 COMADMIN_E_PROPERTYSAVEFAILED Handle = 0x80110437 COMADMIN_E_OBJECTEXISTS Handle = 0x80110438 COMADMIN_E_COMPONENTEXISTS Handle = 0x80110439 COMADMIN_E_REGFILE_CORRUPT Handle = 0x8011043B COMADMIN_E_PROPERTY_OVERFLOW Handle = 0x8011043C COMADMIN_E_NOTINREGISTRY Handle = 0x8011043E COMADMIN_E_OBJECTNOTPOOLABLE Handle = 0x8011043F COMADMIN_E_APPLID_MATCHES_CLSID Handle = 0x80110446 COMADMIN_E_ROLE_DOES_NOT_EXIST Handle = 0x80110447 COMADMIN_E_START_APP_NEEDS_COMPONENTS Handle = 0x80110448 COMADMIN_E_REQUIRES_DIFFERENT_PLATFORM Handle = 0x80110449 COMADMIN_E_CAN_NOT_EXPORT_APP_PROXY Handle = 0x8011044A COMADMIN_E_CAN_NOT_START_APP Handle = 0x8011044B COMADMIN_E_CAN_NOT_EXPORT_SYS_APP Handle = 0x8011044C COMADMIN_E_CANT_SUBSCRIBE_TO_COMPONENT Handle = 0x8011044D COMADMIN_E_EVENTCLASS_CANT_BE_SUBSCRIBER Handle = 0x8011044E COMADMIN_E_LIB_APP_PROXY_INCOMPATIBLE Handle = 0x8011044F COMADMIN_E_BASE_PARTITION_ONLY Handle = 0x80110450 COMADMIN_E_START_APP_DISABLED Handle = 0x80110451 COMADMIN_E_CAT_DUPLICATE_PARTITION_NAME Handle = 0x80110457 COMADMIN_E_CAT_INVALID_PARTITION_NAME Handle = 0x80110458 COMADMIN_E_CAT_PARTITION_IN_USE Handle = 0x80110459 COMADMIN_E_FILE_PARTITION_DUPLICATE_FILES Handle = 0x8011045A COMADMIN_E_CAT_IMPORTED_COMPONENTS_NOT_ALLOWED Handle = 0x8011045B COMADMIN_E_AMBIGUOUS_APPLICATION_NAME Handle = 0x8011045C COMADMIN_E_AMBIGUOUS_PARTITION_NAME Handle = 0x8011045D COMADMIN_E_REGDB_NOTINITIALIZED Handle = 0x80110472 COMADMIN_E_REGDB_NOTOPEN Handle = 0x80110473 COMADMIN_E_REGDB_SYSTEMERR Handle = 0x80110474 COMADMIN_E_REGDB_ALREADYRUNNING Handle = 0x80110475 COMADMIN_E_MIG_VERSIONNOTSUPPORTED Handle = 0x80110480 COMADMIN_E_MIG_SCHEMANOTFOUND Handle = 0x80110481 COMADMIN_E_CAT_BITNESSMISMATCH Handle = 0x80110482 COMADMIN_E_CAT_UNACCEPTABLEBITNESS Handle = 0x80110483 COMADMIN_E_CAT_WRONGAPPBITNESS Handle = 0x80110484 COMADMIN_E_CAT_PAUSE_RESUME_NOT_SUPPORTED Handle = 0x80110485 COMADMIN_E_CAT_SERVERFAULT Handle = 0x80110486 COMQC_E_APPLICATION_NOT_QUEUED Handle = 0x80110600 COMQC_E_NO_QUEUEABLE_INTERFACES Handle = 0x80110601 COMQC_E_QUEUING_SERVICE_NOT_AVAILABLE Handle = 0x80110602 COMQC_E_NO_IPERSISTSTREAM Handle = 0x80110603 COMQC_E_BAD_MESSAGE Handle = 0x80110604 COMQC_E_UNAUTHENTICATED Handle = 0x80110605 COMQC_E_UNTRUSTED_ENQUEUER Handle = 0x80110606 MSDTC_E_DUPLICATE_RESOURCE Handle = 0x80110701 COMADMIN_E_OBJECT_PARENT_MISSING Handle = 0x80110808 COMADMIN_E_OBJECT_DOES_NOT_EXIST Handle = 0x80110809 COMADMIN_E_APP_NOT_RUNNING Handle = 0x8011080A COMADMIN_E_INVALID_PARTITION Handle = 0x8011080B COMADMIN_E_SVCAPP_NOT_POOLABLE_OR_RECYCLABLE Handle = 0x8011080D COMADMIN_E_USER_IN_SET Handle = 0x8011080E COMADMIN_E_CANTRECYCLELIBRARYAPPS Handle = 0x8011080F COMADMIN_E_CANTRECYCLESERVICEAPPS Handle = 0x80110811 COMADMIN_E_PROCESSALREADYRECYCLED Handle = 0x80110812 COMADMIN_E_PAUSEDPROCESSMAYNOTBERECYCLED Handle = 0x80110813 COMADMIN_E_CANTMAKEINPROCSERVICE Handle = 0x80110814 COMADMIN_E_PROGIDINUSEBYCLSID Handle = 0x80110815 COMADMIN_E_DEFAULT_PARTITION_NOT_IN_SET Handle = 0x80110816 COMADMIN_E_RECYCLEDPROCESSMAYNOTBEPAUSED Handle = 0x80110817 COMADMIN_E_PARTITION_ACCESSDENIED Handle = 0x80110818 COMADMIN_E_PARTITION_MSI_ONLY Handle = 0x80110819 COMADMIN_E_LEGACYCOMPS_NOT_ALLOWED_IN_1_0_FORMAT Handle = 0x8011081A COMADMIN_E_LEGACYCOMPS_NOT_ALLOWED_IN_NONBASE_PARTITIONS Handle = 0x8011081B COMADMIN_E_COMP_MOVE_SOURCE Handle = 0x8011081C COMADMIN_E_COMP_MOVE_DEST Handle = 0x8011081D COMADMIN_E_COMP_MOVE_PRIVATE Handle = 0x8011081E COMADMIN_E_BASEPARTITION_REQUIRED_IN_SET Handle = 0x8011081F COMADMIN_E_CANNOT_ALIAS_EVENTCLASS Handle = 0x80110820 COMADMIN_E_PRIVATE_ACCESSDENIED Handle = 0x80110821 COMADMIN_E_SAFERINVALID Handle = 0x80110822 COMADMIN_E_REGISTRY_ACCESSDENIED Handle = 0x80110823 COMADMIN_E_PARTITIONS_DISABLED Handle = 0x80110824 WER_S_REPORT_DEBUG Handle = 0x001B0000 WER_S_REPORT_UPLOADED Handle = 0x001B0001 WER_S_REPORT_QUEUED Handle = 0x001B0002 WER_S_DISABLED Handle = 0x001B0003 WER_S_SUSPENDED_UPLOAD Handle = 0x001B0004 WER_S_DISABLED_QUEUE Handle = 0x001B0005 WER_S_DISABLED_ARCHIVE Handle = 0x001B0006 WER_S_REPORT_ASYNC Handle = 0x001B0007 WER_S_IGNORE_ASSERT_INSTANCE Handle = 0x001B0008 WER_S_IGNORE_ALL_ASSERTS Handle = 0x001B0009 WER_S_ASSERT_CONTINUE Handle = 0x001B000A WER_S_THROTTLED Handle = 0x001B000B WER_S_REPORT_UPLOADED_CAB Handle = 0x001B000C WER_E_CRASH_FAILURE Handle = 0x801B8000 WER_E_CANCELED Handle = 0x801B8001 WER_E_NETWORK_FAILURE Handle = 0x801B8002 WER_E_NOT_INITIALIZED Handle = 0x801B8003 WER_E_ALREADY_REPORTING Handle = 0x801B8004 WER_E_DUMP_THROTTLED Handle = 0x801B8005 WER_E_INSUFFICIENT_CONSENT Handle = 0x801B8006 WER_E_TOO_HEAVY Handle = 0x801B8007 ERROR_FLT_IO_COMPLETE Handle = 0x001F0001 ERROR_FLT_NO_HANDLER_DEFINED Handle = 0x801F0001 ERROR_FLT_CONTEXT_ALREADY_DEFINED Handle = 0x801F0002 ERROR_FLT_INVALID_ASYNCHRONOUS_REQUEST Handle = 0x801F0003 ERROR_FLT_DISALLOW_FAST_IO Handle = 0x801F0004 ERROR_FLT_INVALID_NAME_REQUEST Handle = 0x801F0005 ERROR_FLT_NOT_SAFE_TO_POST_OPERATION Handle = 0x801F0006 ERROR_FLT_NOT_INITIALIZED Handle = 0x801F0007 ERROR_FLT_FILTER_NOT_READY Handle = 0x801F0008 ERROR_FLT_POST_OPERATION_CLEANUP Handle = 0x801F0009 ERROR_FLT_INTERNAL_ERROR Handle = 0x801F000A ERROR_FLT_DELETING_OBJECT Handle = 0x801F000B ERROR_FLT_MUST_BE_NONPAGED_POOL Handle = 0x801F000C ERROR_FLT_DUPLICATE_ENTRY Handle = 0x801F000D ERROR_FLT_CBDQ_DISABLED Handle = 0x801F000E ERROR_FLT_DO_NOT_ATTACH Handle = 0x801F000F ERROR_FLT_DO_NOT_DETACH Handle = 0x801F0010 ERROR_FLT_INSTANCE_ALTITUDE_COLLISION Handle = 0x801F0011 ERROR_FLT_INSTANCE_NAME_COLLISION Handle = 0x801F0012 ERROR_FLT_FILTER_NOT_FOUND Handle = 0x801F0013 ERROR_FLT_VOLUME_NOT_FOUND Handle = 0x801F0014 ERROR_FLT_INSTANCE_NOT_FOUND Handle = 0x801F0015 ERROR_FLT_CONTEXT_ALLOCATION_NOT_FOUND Handle = 0x801F0016 ERROR_FLT_INVALID_CONTEXT_REGISTRATION Handle = 0x801F0017 ERROR_FLT_NAME_CACHE_MISS Handle = 0x801F0018 ERROR_FLT_NO_DEVICE_OBJECT Handle = 0x801F0019 ERROR_FLT_VOLUME_ALREADY_MOUNTED Handle = 0x801F001A ERROR_FLT_ALREADY_ENLISTED Handle = 0x801F001B ERROR_FLT_CONTEXT_ALREADY_LINKED Handle = 0x801F001C ERROR_FLT_NO_WAITER_FOR_REPLY Handle = 0x801F0020 ERROR_FLT_REGISTRATION_BUSY Handle = 0x801F0023 ERROR_HUNG_DISPLAY_DRIVER_THREAD Handle = 0x80260001 DWM_E_COMPOSITIONDISABLED Handle = 0x80263001 DWM_E_REMOTING_NOT_SUPPORTED Handle = 0x80263002 DWM_E_NO_REDIRECTION_SURFACE_AVAILABLE Handle = 0x80263003 DWM_E_NOT_QUEUING_PRESENTS Handle = 0x80263004 DWM_E_ADAPTER_NOT_FOUND Handle = 0x80263005 DWM_S_GDI_REDIRECTION_SURFACE Handle = 0x00263005 DWM_E_TEXTURE_TOO_LARGE Handle = 0x80263007 DWM_S_GDI_REDIRECTION_SURFACE_BLT_VIA_GDI Handle = 0x00263008 ERROR_MONITOR_NO_DESCRIPTOR Handle = 0x00261001 ERROR_MONITOR_UNKNOWN_DESCRIPTOR_FORMAT Handle = 0x00261002 ERROR_MONITOR_INVALID_DESCRIPTOR_CHECKSUM Handle = 0xC0261003 ERROR_MONITOR_INVALID_STANDARD_TIMING_BLOCK Handle = 0xC0261004 ERROR_MONITOR_WMI_DATABLOCK_REGISTRATION_FAILED Handle = 0xC0261005 ERROR_MONITOR_INVALID_SERIAL_NUMBER_MONDSC_BLOCK Handle = 0xC0261006 ERROR_MONITOR_INVALID_USER_FRIENDLY_MONDSC_BLOCK Handle = 0xC0261007 ERROR_MONITOR_NO_MORE_DESCRIPTOR_DATA Handle = 0xC0261008 ERROR_MONITOR_INVALID_DETAILED_TIMING_BLOCK Handle = 0xC0261009 ERROR_MONITOR_INVALID_MANUFACTURE_DATE Handle = 0xC026100A ERROR_GRAPHICS_NOT_EXCLUSIVE_MODE_OWNER Handle = 0xC0262000 ERROR_GRAPHICS_INSUFFICIENT_DMA_BUFFER Handle = 0xC0262001 ERROR_GRAPHICS_INVALID_DISPLAY_ADAPTER Handle = 0xC0262002 ERROR_GRAPHICS_ADAPTER_WAS_RESET Handle = 0xC0262003 ERROR_GRAPHICS_INVALID_DRIVER_MODEL Handle = 0xC0262004 ERROR_GRAPHICS_PRESENT_MODE_CHANGED Handle = 0xC0262005 ERROR_GRAPHICS_PRESENT_OCCLUDED Handle = 0xC0262006 ERROR_GRAPHICS_PRESENT_DENIED Handle = 0xC0262007 ERROR_GRAPHICS_CANNOTCOLORCONVERT Handle = 0xC0262008 ERROR_GRAPHICS_DRIVER_MISMATCH Handle = 0xC0262009 ERROR_GRAPHICS_PARTIAL_DATA_POPULATED Handle = 0x4026200A ERROR_GRAPHICS_PRESENT_REDIRECTION_DISABLED Handle = 0xC026200B ERROR_GRAPHICS_PRESENT_UNOCCLUDED Handle = 0xC026200C ERROR_GRAPHICS_WINDOWDC_NOT_AVAILABLE Handle = 0xC026200D ERROR_GRAPHICS_WINDOWLESS_PRESENT_DISABLED Handle = 0xC026200E ERROR_GRAPHICS_PRESENT_INVALID_WINDOW Handle = 0xC026200F ERROR_GRAPHICS_PRESENT_BUFFER_NOT_BOUND Handle = 0xC0262010 ERROR_GRAPHICS_VAIL_STATE_CHANGED Handle = 0xC0262011 ERROR_GRAPHICS_INDIRECT_DISPLAY_ABANDON_SWAPCHAIN Handle = 0xC0262012 ERROR_GRAPHICS_INDIRECT_DISPLAY_DEVICE_STOPPED Handle = 0xC0262013 ERROR_GRAPHICS_NO_VIDEO_MEMORY Handle = 0xC0262100 ERROR_GRAPHICS_CANT_LOCK_MEMORY Handle = 0xC0262101 ERROR_GRAPHICS_ALLOCATION_BUSY Handle = 0xC0262102 ERROR_GRAPHICS_TOO_MANY_REFERENCES Handle = 0xC0262103 ERROR_GRAPHICS_TRY_AGAIN_LATER Handle = 0xC0262104 ERROR_GRAPHICS_TRY_AGAIN_NOW Handle = 0xC0262105 ERROR_GRAPHICS_ALLOCATION_INVALID Handle = 0xC0262106 ERROR_GRAPHICS_UNSWIZZLING_APERTURE_UNAVAILABLE Handle = 0xC0262107 ERROR_GRAPHICS_UNSWIZZLING_APERTURE_UNSUPPORTED Handle = 0xC0262108 ERROR_GRAPHICS_CANT_EVICT_PINNED_ALLOCATION Handle = 0xC0262109 ERROR_GRAPHICS_INVALID_ALLOCATION_USAGE Handle = 0xC0262110 ERROR_GRAPHICS_CANT_RENDER_LOCKED_ALLOCATION Handle = 0xC0262111 ERROR_GRAPHICS_ALLOCATION_CLOSED Handle = 0xC0262112 ERROR_GRAPHICS_INVALID_ALLOCATION_INSTANCE Handle = 0xC0262113 ERROR_GRAPHICS_INVALID_ALLOCATION_HANDLE Handle = 0xC0262114 ERROR_GRAPHICS_WRONG_ALLOCATION_DEVICE Handle = 0xC0262115 ERROR_GRAPHICS_ALLOCATION_CONTENT_LOST Handle = 0xC0262116 ERROR_GRAPHICS_GPU_EXCEPTION_ON_DEVICE Handle = 0xC0262200 ERROR_GRAPHICS_SKIP_ALLOCATION_PREPARATION Handle = 0x40262201 ERROR_GRAPHICS_INVALID_VIDPN_TOPOLOGY Handle = 0xC0262300 ERROR_GRAPHICS_VIDPN_TOPOLOGY_NOT_SUPPORTED Handle = 0xC0262301 ERROR_GRAPHICS_VIDPN_TOPOLOGY_CURRENTLY_NOT_SUPPORTED Handle = 0xC0262302 ERROR_GRAPHICS_INVALID_VIDPN Handle = 0xC0262303 ERROR_GRAPHICS_INVALID_VIDEO_PRESENT_SOURCE Handle = 0xC0262304 ERROR_GRAPHICS_INVALID_VIDEO_PRESENT_TARGET Handle = 0xC0262305 ERROR_GRAPHICS_VIDPN_MODALITY_NOT_SUPPORTED Handle = 0xC0262306 ERROR_GRAPHICS_MODE_NOT_PINNED Handle = 0x00262307 ERROR_GRAPHICS_INVALID_VIDPN_SOURCEMODESET Handle = 0xC0262308 ERROR_GRAPHICS_INVALID_VIDPN_TARGETMODESET Handle = 0xC0262309 ERROR_GRAPHICS_INVALID_FREQUENCY Handle = 0xC026230A ERROR_GRAPHICS_INVALID_ACTIVE_REGION Handle = 0xC026230B ERROR_GRAPHICS_INVALID_TOTAL_REGION Handle = 0xC026230C ERROR_GRAPHICS_INVALID_VIDEO_PRESENT_SOURCE_MODE Handle = 0xC0262310 ERROR_GRAPHICS_INVALID_VIDEO_PRESENT_TARGET_MODE Handle = 0xC0262311 ERROR_GRAPHICS_PINNED_MODE_MUST_REMAIN_IN_SET Handle = 0xC0262312 ERROR_GRAPHICS_PATH_ALREADY_IN_TOPOLOGY Handle = 0xC0262313 ERROR_GRAPHICS_MODE_ALREADY_IN_MODESET Handle = 0xC0262314 ERROR_GRAPHICS_INVALID_VIDEOPRESENTSOURCESET Handle = 0xC0262315 ERROR_GRAPHICS_INVALID_VIDEOPRESENTTARGETSET Handle = 0xC0262316 ERROR_GRAPHICS_SOURCE_ALREADY_IN_SET Handle = 0xC0262317 ERROR_GRAPHICS_TARGET_ALREADY_IN_SET Handle = 0xC0262318 ERROR_GRAPHICS_INVALID_VIDPN_PRESENT_PATH Handle = 0xC0262319 ERROR_GRAPHICS_NO_RECOMMENDED_VIDPN_TOPOLOGY Handle = 0xC026231A ERROR_GRAPHICS_INVALID_MONITOR_FREQUENCYRANGESET Handle = 0xC026231B ERROR_GRAPHICS_INVALID_MONITOR_FREQUENCYRANGE Handle = 0xC026231C ERROR_GRAPHICS_FREQUENCYRANGE_NOT_IN_SET Handle = 0xC026231D ERROR_GRAPHICS_NO_PREFERRED_MODE Handle = 0x0026231E ERROR_GRAPHICS_FREQUENCYRANGE_ALREADY_IN_SET Handle = 0xC026231F ERROR_GRAPHICS_STALE_MODESET Handle = 0xC0262320 ERROR_GRAPHICS_INVALID_MONITOR_SOURCEMODESET Handle = 0xC0262321 ERROR_GRAPHICS_INVALID_MONITOR_SOURCE_MODE Handle = 0xC0262322 ERROR_GRAPHICS_NO_RECOMMENDED_FUNCTIONAL_VIDPN Handle = 0xC0262323 ERROR_GRAPHICS_MODE_ID_MUST_BE_UNIQUE Handle = 0xC0262324 ERROR_GRAPHICS_EMPTY_ADAPTER_MONITOR_MODE_SUPPORT_INTERSECTION Handle = 0xC0262325 ERROR_GRAPHICS_VIDEO_PRESENT_TARGETS_LESS_THAN_SOURCES Handle = 0xC0262326 ERROR_GRAPHICS_PATH_NOT_IN_TOPOLOGY Handle = 0xC0262327 ERROR_GRAPHICS_ADAPTER_MUST_HAVE_AT_LEAST_ONE_SOURCE Handle = 0xC0262328 ERROR_GRAPHICS_ADAPTER_MUST_HAVE_AT_LEAST_ONE_TARGET Handle = 0xC0262329 ERROR_GRAPHICS_INVALID_MONITORDESCRIPTORSET Handle = 0xC026232A ERROR_GRAPHICS_INVALID_MONITORDESCRIPTOR Handle = 0xC026232B ERROR_GRAPHICS_MONITORDESCRIPTOR_NOT_IN_SET Handle = 0xC026232C ERROR_GRAPHICS_MONITORDESCRIPTOR_ALREADY_IN_SET Handle = 0xC026232D ERROR_GRAPHICS_MONITORDESCRIPTOR_ID_MUST_BE_UNIQUE Handle = 0xC026232E ERROR_GRAPHICS_INVALID_VIDPN_TARGET_SUBSET_TYPE Handle = 0xC026232F ERROR_GRAPHICS_RESOURCES_NOT_RELATED Handle = 0xC0262330 ERROR_GRAPHICS_SOURCE_ID_MUST_BE_UNIQUE Handle = 0xC0262331 ERROR_GRAPHICS_TARGET_ID_MUST_BE_UNIQUE Handle = 0xC0262332 ERROR_GRAPHICS_NO_AVAILABLE_VIDPN_TARGET Handle = 0xC0262333 ERROR_GRAPHICS_MONITOR_COULD_NOT_BE_ASSOCIATED_WITH_ADAPTER Handle = 0xC0262334 ERROR_GRAPHICS_NO_VIDPNMGR Handle = 0xC0262335 ERROR_GRAPHICS_NO_ACTIVE_VIDPN Handle = 0xC0262336 ERROR_GRAPHICS_STALE_VIDPN_TOPOLOGY Handle = 0xC0262337 ERROR_GRAPHICS_MONITOR_NOT_CONNECTED Handle = 0xC0262338 ERROR_GRAPHICS_SOURCE_NOT_IN_TOPOLOGY Handle = 0xC0262339 ERROR_GRAPHICS_INVALID_PRIMARYSURFACE_SIZE Handle = 0xC026233A ERROR_GRAPHICS_INVALID_VISIBLEREGION_SIZE Handle = 0xC026233B ERROR_GRAPHICS_INVALID_STRIDE Handle = 0xC026233C ERROR_GRAPHICS_INVALID_PIXELFORMAT Handle = 0xC026233D ERROR_GRAPHICS_INVALID_COLORBASIS Handle = 0xC026233E ERROR_GRAPHICS_INVALID_PIXELVALUEACCESSMODE Handle = 0xC026233F ERROR_GRAPHICS_TARGET_NOT_IN_TOPOLOGY Handle = 0xC0262340 ERROR_GRAPHICS_NO_DISPLAY_MODE_MANAGEMENT_SUPPORT Handle = 0xC0262341 ERROR_GRAPHICS_VIDPN_SOURCE_IN_USE Handle = 0xC0262342 ERROR_GRAPHICS_CANT_ACCESS_ACTIVE_VIDPN Handle = 0xC0262343 ERROR_GRAPHICS_INVALID_PATH_IMPORTANCE_ORDINAL Handle = 0xC0262344 ERROR_GRAPHICS_INVALID_PATH_CONTENT_GEOMETRY_TRANSFORMATION Handle = 0xC0262345 ERROR_GRAPHICS_PATH_CONTENT_GEOMETRY_TRANSFORMATION_NOT_SUPPORTED Handle = 0xC0262346 ERROR_GRAPHICS_INVALID_GAMMA_RAMP Handle = 0xC0262347 ERROR_GRAPHICS_GAMMA_RAMP_NOT_SUPPORTED Handle = 0xC0262348 ERROR_GRAPHICS_MULTISAMPLING_NOT_SUPPORTED Handle = 0xC0262349 ERROR_GRAPHICS_MODE_NOT_IN_MODESET Handle = 0xC026234A ERROR_GRAPHICS_DATASET_IS_EMPTY Handle = 0x0026234B ERROR_GRAPHICS_NO_MORE_ELEMENTS_IN_DATASET Handle = 0x0026234C ERROR_GRAPHICS_INVALID_VIDPN_TOPOLOGY_RECOMMENDATION_REASON Handle = 0xC026234D ERROR_GRAPHICS_INVALID_PATH_CONTENT_TYPE Handle = 0xC026234E ERROR_GRAPHICS_INVALID_COPYPROTECTION_TYPE Handle = 0xC026234F ERROR_GRAPHICS_UNASSIGNED_MODESET_ALREADY_EXISTS Handle = 0xC0262350 ERROR_GRAPHICS_PATH_CONTENT_GEOMETRY_TRANSFORMATION_NOT_PINNED Handle = 0x00262351 ERROR_GRAPHICS_INVALID_SCANLINE_ORDERING Handle = 0xC0262352 ERROR_GRAPHICS_TOPOLOGY_CHANGES_NOT_ALLOWED Handle = 0xC0262353 ERROR_GRAPHICS_NO_AVAILABLE_IMPORTANCE_ORDINALS Handle = 0xC0262354 ERROR_GRAPHICS_INCOMPATIBLE_PRIVATE_FORMAT Handle = 0xC0262355 ERROR_GRAPHICS_INVALID_MODE_PRUNING_ALGORITHM Handle = 0xC0262356 ERROR_GRAPHICS_INVALID_MONITOR_CAPABILITY_ORIGIN Handle = 0xC0262357 ERROR_GRAPHICS_INVALID_MONITOR_FREQUENCYRANGE_CONSTRAINT Handle = 0xC0262358 ERROR_GRAPHICS_MAX_NUM_PATHS_REACHED Handle = 0xC0262359 ERROR_GRAPHICS_CANCEL_VIDPN_TOPOLOGY_AUGMENTATION Handle = 0xC026235A ERROR_GRAPHICS_INVALID_CLIENT_TYPE Handle = 0xC026235B ERROR_GRAPHICS_CLIENTVIDPN_NOT_SET Handle = 0xC026235C ERROR_GRAPHICS_SPECIFIED_CHILD_ALREADY_CONNECTED Handle = 0xC0262400 ERROR_GRAPHICS_CHILD_DESCRIPTOR_NOT_SUPPORTED Handle = 0xC0262401 ERROR_GRAPHICS_UNKNOWN_CHILD_STATUS Handle = 0x4026242F ERROR_GRAPHICS_NOT_A_LINKED_ADAPTER Handle = 0xC0262430 ERROR_GRAPHICS_LEADLINK_NOT_ENUMERATED Handle = 0xC0262431 ERROR_GRAPHICS_CHAINLINKS_NOT_ENUMERATED Handle = 0xC0262432 ERROR_GRAPHICS_ADAPTER_CHAIN_NOT_READY Handle = 0xC0262433 ERROR_GRAPHICS_CHAINLINKS_NOT_STARTED Handle = 0xC0262434 ERROR_GRAPHICS_CHAINLINKS_NOT_POWERED_ON Handle = 0xC0262435 ERROR_GRAPHICS_INCONSISTENT_DEVICE_LINK_STATE Handle = 0xC0262436 ERROR_GRAPHICS_LEADLINK_START_DEFERRED Handle = 0x40262437 ERROR_GRAPHICS_NOT_POST_DEVICE_DRIVER Handle = 0xC0262438 ERROR_GRAPHICS_POLLING_TOO_FREQUENTLY Handle = 0x40262439 ERROR_GRAPHICS_START_DEFERRED Handle = 0x4026243A ERROR_GRAPHICS_ADAPTER_ACCESS_NOT_EXCLUDED Handle = 0xC026243B ERROR_GRAPHICS_DEPENDABLE_CHILD_STATUS Handle = 0x4026243C ERROR_GRAPHICS_OPM_NOT_SUPPORTED Handle = 0xC0262500 ERROR_GRAPHICS_COPP_NOT_SUPPORTED Handle = 0xC0262501 ERROR_GRAPHICS_UAB_NOT_SUPPORTED Handle = 0xC0262502 ERROR_GRAPHICS_OPM_INVALID_ENCRYPTED_PARAMETERS Handle = 0xC0262503 ERROR_GRAPHICS_OPM_NO_VIDEO_OUTPUTS_EXIST Handle = 0xC0262505 ERROR_GRAPHICS_OPM_INTERNAL_ERROR Handle = 0xC026250B ERROR_GRAPHICS_OPM_INVALID_HANDLE Handle = 0xC026250C ERROR_GRAPHICS_PVP_INVALID_CERTIFICATE_LENGTH Handle = 0xC026250E ERROR_GRAPHICS_OPM_SPANNING_MODE_ENABLED Handle = 0xC026250F ERROR_GRAPHICS_OPM_THEATER_MODE_ENABLED Handle = 0xC0262510 ERROR_GRAPHICS_PVP_HFS_FAILED Handle = 0xC0262511 ERROR_GRAPHICS_OPM_INVALID_SRM Handle = 0xC0262512 ERROR_GRAPHICS_OPM_OUTPUT_DOES_NOT_SUPPORT_HDCP Handle = 0xC0262513 ERROR_GRAPHICS_OPM_OUTPUT_DOES_NOT_SUPPORT_ACP Handle = 0xC0262514 ERROR_GRAPHICS_OPM_OUTPUT_DOES_NOT_SUPPORT_CGMSA Handle = 0xC0262515 ERROR_GRAPHICS_OPM_HDCP_SRM_NEVER_SET Handle = 0xC0262516 ERROR_GRAPHICS_OPM_RESOLUTION_TOO_HIGH Handle = 0xC0262517 ERROR_GRAPHICS_OPM_ALL_HDCP_HARDWARE_ALREADY_IN_USE Handle = 0xC0262518 ERROR_GRAPHICS_OPM_VIDEO_OUTPUT_NO_LONGER_EXISTS Handle = 0xC026251A ERROR_GRAPHICS_OPM_SESSION_TYPE_CHANGE_IN_PROGRESS Handle = 0xC026251B ERROR_GRAPHICS_OPM_VIDEO_OUTPUT_DOES_NOT_HAVE_COPP_SEMANTICS Handle = 0xC026251C ERROR_GRAPHICS_OPM_INVALID_INFORMATION_REQUEST Handle = 0xC026251D ERROR_GRAPHICS_OPM_DRIVER_INTERNAL_ERROR Handle = 0xC026251E ERROR_GRAPHICS_OPM_VIDEO_OUTPUT_DOES_NOT_HAVE_OPM_SEMANTICS Handle = 0xC026251F ERROR_GRAPHICS_OPM_SIGNALING_NOT_SUPPORTED Handle = 0xC0262520 ERROR_GRAPHICS_OPM_INVALID_CONFIGURATION_REQUEST Handle = 0xC0262521 ERROR_GRAPHICS_I2C_NOT_SUPPORTED Handle = 0xC0262580 ERROR_GRAPHICS_I2C_DEVICE_DOES_NOT_EXIST Handle = 0xC0262581 ERROR_GRAPHICS_I2C_ERROR_TRANSMITTING_DATA Handle = 0xC0262582 ERROR_GRAPHICS_I2C_ERROR_RECEIVING_DATA Handle = 0xC0262583 ERROR_GRAPHICS_DDCCI_VCP_NOT_SUPPORTED Handle = 0xC0262584 ERROR_GRAPHICS_DDCCI_INVALID_DATA Handle = 0xC0262585 ERROR_GRAPHICS_DDCCI_MONITOR_RETURNED_INVALID_TIMING_STATUS_BYTE Handle = 0xC0262586 ERROR_GRAPHICS_MCA_INVALID_CAPABILITIES_STRING Handle = 0xC0262587 ERROR_GRAPHICS_MCA_INTERNAL_ERROR Handle = 0xC0262588 ERROR_GRAPHICS_DDCCI_INVALID_MESSAGE_COMMAND Handle = 0xC0262589 ERROR_GRAPHICS_DDCCI_INVALID_MESSAGE_LENGTH Handle = 0xC026258A ERROR_GRAPHICS_DDCCI_INVALID_MESSAGE_CHECKSUM Handle = 0xC026258B ERROR_GRAPHICS_INVALID_PHYSICAL_MONITOR_HANDLE Handle = 0xC026258C ERROR_GRAPHICS_MONITOR_NO_LONGER_EXISTS Handle = 0xC026258D ERROR_GRAPHICS_DDCCI_CURRENT_CURRENT_VALUE_GREATER_THAN_MAXIMUM_VALUE Handle = 0xC02625D8 ERROR_GRAPHICS_MCA_INVALID_VCP_VERSION Handle = 0xC02625D9 ERROR_GRAPHICS_MCA_MONITOR_VIOLATES_MCCS_SPECIFICATION Handle = 0xC02625DA ERROR_GRAPHICS_MCA_MCCS_VERSION_MISMATCH Handle = 0xC02625DB ERROR_GRAPHICS_MCA_UNSUPPORTED_MCCS_VERSION Handle = 0xC02625DC ERROR_GRAPHICS_MCA_INVALID_TECHNOLOGY_TYPE_RETURNED Handle = 0xC02625DE ERROR_GRAPHICS_MCA_UNSUPPORTED_COLOR_TEMPERATURE Handle = 0xC02625DF ERROR_GRAPHICS_ONLY_CONSOLE_SESSION_SUPPORTED Handle = 0xC02625E0 ERROR_GRAPHICS_NO_DISPLAY_DEVICE_CORRESPONDS_TO_NAME Handle = 0xC02625E1 ERROR_GRAPHICS_DISPLAY_DEVICE_NOT_ATTACHED_TO_DESKTOP Handle = 0xC02625E2 ERROR_GRAPHICS_MIRRORING_DEVICES_NOT_SUPPORTED Handle = 0xC02625E3 ERROR_GRAPHICS_INVALID_POINTER Handle = 0xC02625E4 ERROR_GRAPHICS_NO_MONITORS_CORRESPOND_TO_DISPLAY_DEVICE Handle = 0xC02625E5 ERROR_GRAPHICS_PARAMETER_ARRAY_TOO_SMALL Handle = 0xC02625E6 ERROR_GRAPHICS_INTERNAL_ERROR Handle = 0xC02625E7 ERROR_GRAPHICS_SESSION_TYPE_CHANGE_IN_PROGRESS Handle = 0xC02605E8 NAP_E_INVALID_PACKET Handle = 0x80270001 NAP_E_MISSING_SOH Handle = 0x80270002 NAP_E_CONFLICTING_ID Handle = 0x80270003 NAP_E_NO_CACHED_SOH Handle = 0x80270004 NAP_E_STILL_BOUND Handle = 0x80270005 NAP_E_NOT_REGISTERED Handle = 0x80270006 NAP_E_NOT_INITIALIZED Handle = 0x80270007 NAP_E_MISMATCHED_ID Handle = 0x80270008 NAP_E_NOT_PENDING Handle = 0x80270009 NAP_E_ID_NOT_FOUND Handle = 0x8027000A NAP_E_MAXSIZE_TOO_SMALL Handle = 0x8027000B NAP_E_SERVICE_NOT_RUNNING Handle = 0x8027000C NAP_S_CERT_ALREADY_PRESENT Handle = 0x0027000D NAP_E_ENTITY_DISABLED Handle = 0x8027000E NAP_E_NETSH_GROUPPOLICY_ERROR Handle = 0x8027000F NAP_E_TOO_MANY_CALLS Handle = 0x80270010 NAP_E_SHV_CONFIG_EXISTED Handle = 0x80270011 NAP_E_SHV_CONFIG_NOT_FOUND Handle = 0x80270012 NAP_E_SHV_TIMEOUT Handle = 0x80270013 TPM_E_ERROR_MASK Handle = 0x80280000 TPM_E_AUTHFAIL Handle = 0x80280001 TPM_E_BADINDEX Handle = 0x80280002 TPM_E_BAD_PARAMETER Handle = 0x80280003 TPM_E_AUDITFAILURE Handle = 0x80280004 TPM_E_CLEAR_DISABLED Handle = 0x80280005 TPM_E_DEACTIVATED Handle = 0x80280006 TPM_E_DISABLED Handle = 0x80280007 TPM_E_DISABLED_CMD Handle = 0x80280008 TPM_E_FAIL Handle = 0x80280009 TPM_E_BAD_ORDINAL Handle = 0x8028000A TPM_E_INSTALL_DISABLED Handle = 0x8028000B TPM_E_INVALID_KEYHANDLE Handle = 0x8028000C TPM_E_KEYNOTFOUND Handle = 0x8028000D TPM_E_INAPPROPRIATE_ENC Handle = 0x8028000E TPM_E_MIGRATEFAIL Handle = 0x8028000F TPM_E_INVALID_PCR_INFO Handle = 0x80280010 TPM_E_NOSPACE Handle = 0x80280011 TPM_E_NOSRK Handle = 0x80280012 TPM_E_NOTSEALED_BLOB Handle = 0x80280013 TPM_E_OWNER_SET Handle = 0x80280014 TPM_E_RESOURCES Handle = 0x80280015 TPM_E_SHORTRANDOM Handle = 0x80280016 TPM_E_SIZE Handle = 0x80280017 TPM_E_WRONGPCRVAL Handle = 0x80280018 TPM_E_BAD_PARAM_SIZE Handle = 0x80280019 TPM_E_SHA_THREAD Handle = 0x8028001A TPM_E_SHA_ERROR Handle = 0x8028001B TPM_E_FAILEDSELFTEST Handle = 0x8028001C TPM_E_AUTH2FAIL Handle = 0x8028001D TPM_E_BADTAG Handle = 0x8028001E TPM_E_IOERROR Handle = 0x8028001F TPM_E_ENCRYPT_ERROR Handle = 0x80280020 TPM_E_DECRYPT_ERROR Handle = 0x80280021 TPM_E_INVALID_AUTHHANDLE Handle = 0x80280022 TPM_E_NO_ENDORSEMENT Handle = 0x80280023 TPM_E_INVALID_KEYUSAGE Handle = 0x80280024 TPM_E_WRONG_ENTITYTYPE Handle = 0x80280025 TPM_E_INVALID_POSTINIT Handle = 0x80280026 TPM_E_INAPPROPRIATE_SIG Handle = 0x80280027 TPM_E_BAD_KEY_PROPERTY Handle = 0x80280028 TPM_E_BAD_MIGRATION Handle = 0x80280029 TPM_E_BAD_SCHEME Handle = 0x8028002A TPM_E_BAD_DATASIZE Handle = 0x8028002B TPM_E_BAD_MODE Handle = 0x8028002C TPM_E_BAD_PRESENCE Handle = 0x8028002D TPM_E_BAD_VERSION Handle = 0x8028002E TPM_E_NO_WRAP_TRANSPORT Handle = 0x8028002F TPM_E_AUDITFAIL_UNSUCCESSFUL Handle = 0x80280030 TPM_E_AUDITFAIL_SUCCESSFUL Handle = 0x80280031 TPM_E_NOTRESETABLE Handle = 0x80280032 TPM_E_NOTLOCAL Handle = 0x80280033 TPM_E_BAD_TYPE Handle = 0x80280034 TPM_E_INVALID_RESOURCE Handle = 0x80280035 TPM_E_NOTFIPS Handle = 0x80280036 TPM_E_INVALID_FAMILY Handle = 0x80280037 TPM_E_NO_NV_PERMISSION Handle = 0x80280038 TPM_E_REQUIRES_SIGN Handle = 0x80280039 TPM_E_KEY_NOTSUPPORTED Handle = 0x8028003A TPM_E_AUTH_CONFLICT Handle = 0x8028003B TPM_E_AREA_LOCKED Handle = 0x8028003C TPM_E_BAD_LOCALITY Handle = 0x8028003D TPM_E_READ_ONLY Handle = 0x8028003E TPM_E_PER_NOWRITE Handle = 0x8028003F TPM_E_FAMILYCOUNT Handle = 0x80280040 TPM_E_WRITE_LOCKED Handle = 0x80280041 TPM_E_BAD_ATTRIBUTES Handle = 0x80280042 TPM_E_INVALID_STRUCTURE Handle = 0x80280043 TPM_E_KEY_OWNER_CONTROL Handle = 0x80280044 TPM_E_BAD_COUNTER Handle = 0x80280045 TPM_E_NOT_FULLWRITE Handle = 0x80280046 TPM_E_CONTEXT_GAP Handle = 0x80280047 TPM_E_MAXNVWRITES Handle = 0x80280048 TPM_E_NOOPERATOR Handle = 0x80280049 TPM_E_RESOURCEMISSING Handle = 0x8028004A TPM_E_DELEGATE_LOCK Handle = 0x8028004B TPM_E_DELEGATE_FAMILY Handle = 0x8028004C TPM_E_DELEGATE_ADMIN Handle = 0x8028004D TPM_E_TRANSPORT_NOTEXCLUSIVE Handle = 0x8028004E TPM_E_OWNER_CONTROL Handle = 0x8028004F TPM_E_DAA_RESOURCES Handle = 0x80280050 TPM_E_DAA_INPUT_DATA0 Handle = 0x80280051 TPM_E_DAA_INPUT_DATA1 Handle = 0x80280052 TPM_E_DAA_ISSUER_SETTINGS Handle = 0x80280053 TPM_E_DAA_TPM_SETTINGS Handle = 0x80280054 TPM_E_DAA_STAGE Handle = 0x80280055 TPM_E_DAA_ISSUER_VALIDITY Handle = 0x80280056 TPM_E_DAA_WRONG_W Handle = 0x80280057 TPM_E_BAD_HANDLE Handle = 0x80280058 TPM_E_BAD_DELEGATE Handle = 0x80280059 TPM_E_BADCONTEXT Handle = 0x8028005A TPM_E_TOOMANYCONTEXTS Handle = 0x8028005B TPM_E_MA_TICKET_SIGNATURE Handle = 0x8028005C TPM_E_MA_DESTINATION Handle = 0x8028005D TPM_E_MA_SOURCE Handle = 0x8028005E TPM_E_MA_AUTHORITY Handle = 0x8028005F TPM_E_PERMANENTEK Handle = 0x80280061 TPM_E_BAD_SIGNATURE Handle = 0x80280062 TPM_E_NOCONTEXTSPACE Handle = 0x80280063 TPM_20_E_ASYMMETRIC Handle = 0x80280081 TPM_20_E_ATTRIBUTES Handle = 0x80280082 TPM_20_E_HASH Handle = 0x80280083 TPM_20_E_VALUE Handle = 0x80280084 TPM_20_E_HIERARCHY Handle = 0x80280085 TPM_20_E_KEY_SIZE Handle = 0x80280087 TPM_20_E_MGF Handle = 0x80280088 TPM_20_E_MODE Handle = 0x80280089 TPM_20_E_TYPE Handle = 0x8028008A TPM_20_E_HANDLE Handle = 0x8028008B TPM_20_E_KDF Handle = 0x8028008C TPM_20_E_RANGE Handle = 0x8028008D TPM_20_E_AUTH_FAIL Handle = 0x8028008E TPM_20_E_NONCE Handle = 0x8028008F TPM_20_E_PP Handle = 0x80280090 TPM_20_E_SCHEME Handle = 0x80280092 TPM_20_E_SIZE Handle = 0x80280095 TPM_20_E_SYMMETRIC Handle = 0x80280096 TPM_20_E_TAG Handle = 0x80280097 TPM_20_E_SELECTOR Handle = 0x80280098 TPM_20_E_INSUFFICIENT Handle = 0x8028009A TPM_20_E_SIGNATURE Handle = 0x8028009B TPM_20_E_KEY Handle = 0x8028009C TPM_20_E_POLICY_FAIL Handle = 0x8028009D TPM_20_E_INTEGRITY Handle = 0x8028009F TPM_20_E_TICKET Handle = 0x802800A0 TPM_20_E_RESERVED_BITS Handle = 0x802800A1 TPM_20_E_BAD_AUTH Handle = 0x802800A2 TPM_20_E_EXPIRED Handle = 0x802800A3 TPM_20_E_POLICY_CC Handle = 0x802800A4 TPM_20_E_BINDING Handle = 0x802800A5 TPM_20_E_CURVE Handle = 0x802800A6 TPM_20_E_ECC_POINT Handle = 0x802800A7 TPM_20_E_INITIALIZE Handle = 0x80280100 TPM_20_E_FAILURE Handle = 0x80280101 TPM_20_E_SEQUENCE Handle = 0x80280103 TPM_20_E_PRIVATE Handle = 0x8028010B TPM_20_E_HMAC Handle = 0x80280119 TPM_20_E_DISABLED Handle = 0x80280120 TPM_20_E_EXCLUSIVE Handle = 0x80280121 TPM_20_E_ECC_CURVE Handle = 0x80280123 TPM_20_E_AUTH_TYPE Handle = 0x80280124 TPM_20_E_AUTH_MISSING Handle = 0x80280125 TPM_20_E_POLICY Handle = 0x80280126 TPM_20_E_PCR Handle = 0x80280127 TPM_20_E_PCR_CHANGED Handle = 0x80280128 TPM_20_E_UPGRADE Handle = 0x8028012D TPM_20_E_TOO_MANY_CONTEXTS Handle = 0x8028012E TPM_20_E_AUTH_UNAVAILABLE Handle = 0x8028012F TPM_20_E_REBOOT Handle = 0x80280130 TPM_20_E_UNBALANCED Handle = 0x80280131 TPM_20_E_COMMAND_SIZE Handle = 0x80280142 TPM_20_E_COMMAND_CODE Handle = 0x80280143 TPM_20_E_AUTHSIZE Handle = 0x80280144 TPM_20_E_AUTH_CONTEXT Handle = 0x80280145 TPM_20_E_NV_RANGE Handle = 0x80280146 TPM_20_E_NV_SIZE Handle = 0x80280147 TPM_20_E_NV_LOCKED Handle = 0x80280148 TPM_20_E_NV_AUTHORIZATION Handle = 0x80280149 TPM_20_E_NV_UNINITIALIZED Handle = 0x8028014A TPM_20_E_NV_SPACE Handle = 0x8028014B TPM_20_E_NV_DEFINED Handle = 0x8028014C TPM_20_E_BAD_CONTEXT Handle = 0x80280150 TPM_20_E_CPHASH Handle = 0x80280151 TPM_20_E_PARENT Handle = 0x80280152 TPM_20_E_NEEDS_TEST Handle = 0x80280153 TPM_20_E_NO_RESULT Handle = 0x80280154 TPM_20_E_SENSITIVE Handle = 0x80280155 TPM_E_COMMAND_BLOCKED Handle = 0x80280400 TPM_E_INVALID_HANDLE Handle = 0x80280401 TPM_E_DUPLICATE_VHANDLE Handle = 0x80280402 TPM_E_EMBEDDED_COMMAND_BLOCKED Handle = 0x80280403 TPM_E_EMBEDDED_COMMAND_UNSUPPORTED Handle = 0x80280404 TPM_E_RETRY Handle = 0x80280800 TPM_E_NEEDS_SELFTEST Handle = 0x80280801 TPM_E_DOING_SELFTEST Handle = 0x80280802 TPM_E_DEFEND_LOCK_RUNNING Handle = 0x80280803 TPM_20_E_CONTEXT_GAP Handle = 0x80280901 TPM_20_E_OBJECT_MEMORY Handle = 0x80280902 TPM_20_E_SESSION_MEMORY Handle = 0x80280903 TPM_20_E_MEMORY Handle = 0x80280904 TPM_20_E_SESSION_HANDLES Handle = 0x80280905 TPM_20_E_OBJECT_HANDLES Handle = 0x80280906 TPM_20_E_LOCALITY Handle = 0x80280907 TPM_20_E_YIELDED Handle = 0x80280908 TPM_20_E_CANCELED Handle = 0x80280909 TPM_20_E_TESTING Handle = 0x8028090A TPM_20_E_NV_RATE Handle = 0x80280920 TPM_20_E_LOCKOUT Handle = 0x80280921 TPM_20_E_RETRY Handle = 0x80280922 TPM_20_E_NV_UNAVAILABLE Handle = 0x80280923 TBS_E_INTERNAL_ERROR Handle = 0x80284001 TBS_E_BAD_PARAMETER Handle = 0x80284002 TBS_E_INVALID_OUTPUT_POINTER Handle = 0x80284003 TBS_E_INVALID_CONTEXT Handle = 0x80284004 TBS_E_INSUFFICIENT_BUFFER Handle = 0x80284005 TBS_E_IOERROR Handle = 0x80284006 TBS_E_INVALID_CONTEXT_PARAM Handle = 0x80284007 TBS_E_SERVICE_NOT_RUNNING Handle = 0x80284008 TBS_E_TOO_MANY_TBS_CONTEXTS Handle = 0x80284009 TBS_E_TOO_MANY_RESOURCES Handle = 0x8028400A TBS_E_SERVICE_START_PENDING Handle = 0x8028400B TBS_E_PPI_NOT_SUPPORTED Handle = 0x8028400C TBS_E_COMMAND_CANCELED Handle = 0x8028400D TBS_E_BUFFER_TOO_LARGE Handle = 0x8028400E TBS_E_TPM_NOT_FOUND Handle = 0x8028400F TBS_E_SERVICE_DISABLED Handle = 0x80284010 TBS_E_NO_EVENT_LOG Handle = 0x80284011 TBS_E_ACCESS_DENIED Handle = 0x80284012 TBS_E_PROVISIONING_NOT_ALLOWED Handle = 0x80284013 TBS_E_PPI_FUNCTION_UNSUPPORTED Handle = 0x80284014 TBS_E_OWNERAUTH_NOT_FOUND Handle = 0x80284015 TBS_E_PROVISIONING_INCOMPLETE Handle = 0x80284016 TPMAPI_E_INVALID_STATE Handle = 0x80290100 TPMAPI_E_NOT_ENOUGH_DATA Handle = 0x80290101 TPMAPI_E_TOO_MUCH_DATA Handle = 0x80290102 TPMAPI_E_INVALID_OUTPUT_POINTER Handle = 0x80290103 TPMAPI_E_INVALID_PARAMETER Handle = 0x80290104 TPMAPI_E_OUT_OF_MEMORY Handle = 0x80290105 TPMAPI_E_BUFFER_TOO_SMALL Handle = 0x80290106 TPMAPI_E_INTERNAL_ERROR Handle = 0x80290107 TPMAPI_E_ACCESS_DENIED Handle = 0x80290108 TPMAPI_E_AUTHORIZATION_FAILED Handle = 0x80290109 TPMAPI_E_INVALID_CONTEXT_HANDLE Handle = 0x8029010A TPMAPI_E_TBS_COMMUNICATION_ERROR Handle = 0x8029010B TPMAPI_E_TPM_COMMAND_ERROR Handle = 0x8029010C TPMAPI_E_MESSAGE_TOO_LARGE Handle = 0x8029010D TPMAPI_E_INVALID_ENCODING Handle = 0x8029010E TPMAPI_E_INVALID_KEY_SIZE Handle = 0x8029010F TPMAPI_E_ENCRYPTION_FAILED Handle = 0x80290110 TPMAPI_E_INVALID_KEY_PARAMS Handle = 0x80290111 TPMAPI_E_INVALID_MIGRATION_AUTHORIZATION_BLOB Handle = 0x80290112 TPMAPI_E_INVALID_PCR_INDEX Handle = 0x80290113 TPMAPI_E_INVALID_DELEGATE_BLOB Handle = 0x80290114 TPMAPI_E_INVALID_CONTEXT_PARAMS Handle = 0x80290115 TPMAPI_E_INVALID_KEY_BLOB Handle = 0x80290116 TPMAPI_E_INVALID_PCR_DATA Handle = 0x80290117 TPMAPI_E_INVALID_OWNER_AUTH Handle = 0x80290118 TPMAPI_E_FIPS_RNG_CHECK_FAILED Handle = 0x80290119 TPMAPI_E_EMPTY_TCG_LOG Handle = 0x8029011A TPMAPI_E_INVALID_TCG_LOG_ENTRY Handle = 0x8029011B TPMAPI_E_TCG_SEPARATOR_ABSENT Handle = 0x8029011C TPMAPI_E_TCG_INVALID_DIGEST_ENTRY Handle = 0x8029011D TPMAPI_E_POLICY_DENIES_OPERATION Handle = 0x8029011E TPMAPI_E_NV_BITS_NOT_DEFINED Handle = 0x8029011F TPMAPI_E_NV_BITS_NOT_READY Handle = 0x80290120 TPMAPI_E_SEALING_KEY_NOT_AVAILABLE Handle = 0x80290121 TPMAPI_E_NO_AUTHORIZATION_CHAIN_FOUND Handle = 0x80290122 TPMAPI_E_SVN_COUNTER_NOT_AVAILABLE Handle = 0x80290123 TPMAPI_E_OWNER_AUTH_NOT_NULL Handle = 0x80290124 TPMAPI_E_ENDORSEMENT_AUTH_NOT_NULL Handle = 0x80290125 TPMAPI_E_AUTHORIZATION_REVOKED Handle = 0x80290126 TPMAPI_E_MALFORMED_AUTHORIZATION_KEY Handle = 0x80290127 TPMAPI_E_AUTHORIZING_KEY_NOT_SUPPORTED Handle = 0x80290128 TPMAPI_E_INVALID_AUTHORIZATION_SIGNATURE Handle = 0x80290129 TPMAPI_E_MALFORMED_AUTHORIZATION_POLICY Handle = 0x8029012A TPMAPI_E_MALFORMED_AUTHORIZATION_OTHER Handle = 0x8029012B TPMAPI_E_SEALING_KEY_CHANGED Handle = 0x8029012C TBSIMP_E_BUFFER_TOO_SMALL Handle = 0x80290200 TBSIMP_E_CLEANUP_FAILED Handle = 0x80290201 TBSIMP_E_INVALID_CONTEXT_HANDLE Handle = 0x80290202 TBSIMP_E_INVALID_CONTEXT_PARAM Handle = 0x80290203 TBSIMP_E_TPM_ERROR Handle = 0x80290204 TBSIMP_E_HASH_BAD_KEY Handle = 0x80290205 TBSIMP_E_DUPLICATE_VHANDLE Handle = 0x80290206 TBSIMP_E_INVALID_OUTPUT_POINTER Handle = 0x80290207 TBSIMP_E_INVALID_PARAMETER Handle = 0x80290208 TBSIMP_E_RPC_INIT_FAILED Handle = 0x80290209 TBSIMP_E_SCHEDULER_NOT_RUNNING Handle = 0x8029020A TBSIMP_E_COMMAND_CANCELED Handle = 0x8029020B TBSIMP_E_OUT_OF_MEMORY Handle = 0x8029020C TBSIMP_E_LIST_NO_MORE_ITEMS Handle = 0x8029020D TBSIMP_E_LIST_NOT_FOUND Handle = 0x8029020E TBSIMP_E_NOT_ENOUGH_SPACE Handle = 0x8029020F TBSIMP_E_NOT_ENOUGH_TPM_CONTEXTS Handle = 0x80290210 TBSIMP_E_COMMAND_FAILED Handle = 0x80290211 TBSIMP_E_UNKNOWN_ORDINAL Handle = 0x80290212 TBSIMP_E_RESOURCE_EXPIRED Handle = 0x80290213 TBSIMP_E_INVALID_RESOURCE Handle = 0x80290214 TBSIMP_E_NOTHING_TO_UNLOAD Handle = 0x80290215 TBSIMP_E_HASH_TABLE_FULL Handle = 0x80290216 TBSIMP_E_TOO_MANY_TBS_CONTEXTS Handle = 0x80290217 TBSIMP_E_TOO_MANY_RESOURCES Handle = 0x80290218 TBSIMP_E_PPI_NOT_SUPPORTED Handle = 0x80290219 TBSIMP_E_TPM_INCOMPATIBLE Handle = 0x8029021A TBSIMP_E_NO_EVENT_LOG Handle = 0x8029021B TPM_E_PPI_ACPI_FAILURE Handle = 0x80290300 TPM_E_PPI_USER_ABORT Handle = 0x80290301 TPM_E_PPI_BIOS_FAILURE Handle = 0x80290302 TPM_E_PPI_NOT_SUPPORTED Handle = 0x80290303 TPM_E_PPI_BLOCKED_IN_BIOS Handle = 0x80290304 TPM_E_PCP_ERROR_MASK Handle = 0x80290400 TPM_E_PCP_DEVICE_NOT_READY Handle = 0x80290401 TPM_E_PCP_INVALID_HANDLE Handle = 0x80290402 TPM_E_PCP_INVALID_PARAMETER Handle = 0x80290403 TPM_E_PCP_FLAG_NOT_SUPPORTED Handle = 0x80290404 TPM_E_PCP_NOT_SUPPORTED Handle = 0x80290405 TPM_E_PCP_BUFFER_TOO_SMALL Handle = 0x80290406 TPM_E_PCP_INTERNAL_ERROR Handle = 0x80290407 TPM_E_PCP_AUTHENTICATION_FAILED Handle = 0x80290408 TPM_E_PCP_AUTHENTICATION_IGNORED Handle = 0x80290409 TPM_E_PCP_POLICY_NOT_FOUND Handle = 0x8029040A TPM_E_PCP_PROFILE_NOT_FOUND Handle = 0x8029040B TPM_E_PCP_VALIDATION_FAILED Handle = 0x8029040C TPM_E_PCP_WRONG_PARENT Handle = 0x8029040E TPM_E_KEY_NOT_LOADED Handle = 0x8029040F TPM_E_NO_KEY_CERTIFICATION Handle = 0x80290410 TPM_E_KEY_NOT_FINALIZED Handle = 0x80290411 TPM_E_ATTESTATION_CHALLENGE_NOT_SET Handle = 0x80290412 TPM_E_NOT_PCR_BOUND Handle = 0x80290413 TPM_E_KEY_ALREADY_FINALIZED Handle = 0x80290414 TPM_E_KEY_USAGE_POLICY_NOT_SUPPORTED Handle = 0x80290415 TPM_E_KEY_USAGE_POLICY_INVALID Handle = 0x80290416 TPM_E_SOFT_KEY_ERROR Handle = 0x80290417 TPM_E_KEY_NOT_AUTHENTICATED Handle = 0x80290418 TPM_E_PCP_KEY_NOT_AIK Handle = 0x80290419 TPM_E_KEY_NOT_SIGNING_KEY Handle = 0x8029041A TPM_E_LOCKED_OUT Handle = 0x8029041B TPM_E_CLAIM_TYPE_NOT_SUPPORTED Handle = 0x8029041C TPM_E_VERSION_NOT_SUPPORTED Handle = 0x8029041D TPM_E_BUFFER_LENGTH_MISMATCH Handle = 0x8029041E TPM_E_PCP_IFX_RSA_KEY_CREATION_BLOCKED Handle = 0x8029041F TPM_E_PCP_TICKET_MISSING Handle = 0x80290420 TPM_E_PCP_RAW_POLICY_NOT_SUPPORTED Handle = 0x80290421 TPM_E_PCP_KEY_HANDLE_INVALIDATED Handle = 0x80290422 TPM_E_PCP_UNSUPPORTED_PSS_SALT Handle = 0x40290423 TPM_E_ZERO_EXHAUST_ENABLED Handle = 0x80290500 PLA_E_DCS_NOT_FOUND Handle = 0x80300002 PLA_E_DCS_IN_USE Handle = 0x803000AA PLA_E_TOO_MANY_FOLDERS Handle = 0x80300045 PLA_E_NO_MIN_DISK Handle = 0x80300070 PLA_E_DCS_ALREADY_EXISTS Handle = 0x803000B7 PLA_S_PROPERTY_IGNORED Handle = 0x00300100 PLA_E_PROPERTY_CONFLICT Handle = 0x80300101 PLA_E_DCS_SINGLETON_REQUIRED Handle = 0x80300102 PLA_E_CREDENTIALS_REQUIRED Handle = 0x80300103 PLA_E_DCS_NOT_RUNNING Handle = 0x80300104 PLA_E_CONFLICT_INCL_EXCL_API Handle = 0x80300105 PLA_E_NETWORK_EXE_NOT_VALID Handle = 0x80300106 PLA_E_EXE_ALREADY_CONFIGURED Handle = 0x80300107 PLA_E_EXE_PATH_NOT_VALID Handle = 0x80300108 PLA_E_DC_ALREADY_EXISTS Handle = 0x80300109 PLA_E_DCS_START_WAIT_TIMEOUT Handle = 0x8030010A PLA_E_DC_START_WAIT_TIMEOUT Handle = 0x8030010B PLA_E_REPORT_WAIT_TIMEOUT Handle = 0x8030010C PLA_E_NO_DUPLICATES Handle = 0x8030010D PLA_E_EXE_FULL_PATH_REQUIRED Handle = 0x8030010E PLA_E_INVALID_SESSION_NAME Handle = 0x8030010F PLA_E_PLA_CHANNEL_NOT_ENABLED Handle = 0x80300110 PLA_E_TASKSCHED_CHANNEL_NOT_ENABLED Handle = 0x80300111 PLA_E_RULES_MANAGER_FAILED Handle = 0x80300112 PLA_E_CABAPI_FAILURE Handle = 0x80300113 FVE_E_LOCKED_VOLUME Handle = 0x80310000 FVE_E_NOT_ENCRYPTED Handle = 0x80310001 FVE_E_NO_TPM_BIOS Handle = 0x80310002 FVE_E_NO_MBR_METRIC Handle = 0x80310003 FVE_E_NO_BOOTSECTOR_METRIC Handle = 0x80310004 FVE_E_NO_BOOTMGR_METRIC Handle = 0x80310005 FVE_E_WRONG_BOOTMGR Handle = 0x80310006 FVE_E_SECURE_KEY_REQUIRED Handle = 0x80310007 FVE_E_NOT_ACTIVATED Handle = 0x80310008 FVE_E_ACTION_NOT_ALLOWED Handle = 0x80310009 FVE_E_AD_SCHEMA_NOT_INSTALLED Handle = 0x8031000A FVE_E_AD_INVALID_DATATYPE Handle = 0x8031000B FVE_E_AD_INVALID_DATASIZE Handle = 0x8031000C FVE_E_AD_NO_VALUES Handle = 0x8031000D FVE_E_AD_ATTR_NOT_SET Handle = 0x8031000E FVE_E_AD_GUID_NOT_FOUND Handle = 0x8031000F FVE_E_BAD_INFORMATION Handle = 0x80310010 FVE_E_TOO_SMALL Handle = 0x80310011 FVE_E_SYSTEM_VOLUME Handle = 0x80310012 FVE_E_FAILED_WRONG_FS Handle = 0x80310013 FVE_E_BAD_PARTITION_SIZE Handle = 0x80310014 FVE_E_NOT_SUPPORTED Handle = 0x80310015 FVE_E_BAD_DATA Handle = 0x80310016 FVE_E_VOLUME_NOT_BOUND Handle = 0x80310017 FVE_E_TPM_NOT_OWNED Handle = 0x80310018 FVE_E_NOT_DATA_VOLUME Handle = 0x80310019 FVE_E_AD_INSUFFICIENT_BUFFER Handle = 0x8031001A FVE_E_CONV_READ Handle = 0x8031001B FVE_E_CONV_WRITE Handle = 0x8031001C FVE_E_KEY_REQUIRED Handle = 0x8031001D FVE_E_CLUSTERING_NOT_SUPPORTED Handle = 0x8031001E FVE_E_VOLUME_BOUND_ALREADY Handle = 0x8031001F FVE_E_OS_NOT_PROTECTED Handle = 0x80310020 FVE_E_PROTECTION_DISABLED Handle = 0x80310021 FVE_E_RECOVERY_KEY_REQUIRED Handle = 0x80310022 FVE_E_FOREIGN_VOLUME Handle = 0x80310023 FVE_E_OVERLAPPED_UPDATE Handle = 0x80310024 FVE_E_TPM_SRK_AUTH_NOT_ZERO Handle = 0x80310025 FVE_E_FAILED_SECTOR_SIZE Handle = 0x80310026 FVE_E_FAILED_AUTHENTICATION Handle = 0x80310027 FVE_E_NOT_OS_VOLUME Handle = 0x80310028 FVE_E_AUTOUNLOCK_ENABLED Handle = 0x80310029 FVE_E_WRONG_BOOTSECTOR Handle = 0x8031002A FVE_E_WRONG_SYSTEM_FS Handle = 0x8031002B FVE_E_POLICY_PASSWORD_REQUIRED Handle = 0x8031002C FVE_E_CANNOT_SET_FVEK_ENCRYPTED Handle = 0x8031002D FVE_E_CANNOT_ENCRYPT_NO_KEY Handle = 0x8031002E FVE_E_BOOTABLE_CDDVD Handle = 0x80310030 FVE_E_PROTECTOR_EXISTS Handle = 0x80310031 FVE_E_RELATIVE_PATH Handle = 0x80310032 FVE_E_PROTECTOR_NOT_FOUND Handle = 0x80310033 FVE_E_INVALID_KEY_FORMAT Handle = 0x80310034 FVE_E_INVALID_PASSWORD_FORMAT Handle = 0x80310035 FVE_E_FIPS_RNG_CHECK_FAILED Handle = 0x80310036 FVE_E_FIPS_PREVENTS_RECOVERY_PASSWORD Handle = 0x80310037 FVE_E_FIPS_PREVENTS_EXTERNAL_KEY_EXPORT Handle = 0x80310038 FVE_E_NOT_DECRYPTED Handle = 0x80310039 FVE_E_INVALID_PROTECTOR_TYPE Handle = 0x8031003A FVE_E_NO_PROTECTORS_TO_TEST Handle = 0x8031003B FVE_E_KEYFILE_NOT_FOUND Handle = 0x8031003C FVE_E_KEYFILE_INVALID Handle = 0x8031003D FVE_E_KEYFILE_NO_VMK Handle = 0x8031003E FVE_E_TPM_DISABLED Handle = 0x8031003F FVE_E_NOT_ALLOWED_IN_SAFE_MODE Handle = 0x80310040 FVE_E_TPM_INVALID_PCR Handle = 0x80310041 FVE_E_TPM_NO_VMK Handle = 0x80310042 FVE_E_PIN_INVALID Handle = 0x80310043 FVE_E_AUTH_INVALID_APPLICATION Handle = 0x80310044 FVE_E_AUTH_INVALID_CONFIG Handle = 0x80310045 FVE_E_FIPS_DISABLE_PROTECTION_NOT_ALLOWED Handle = 0x80310046 FVE_E_FS_NOT_EXTENDED Handle = 0x80310047 FVE_E_FIRMWARE_TYPE_NOT_SUPPORTED Handle = 0x80310048 FVE_E_NO_LICENSE Handle = 0x80310049 FVE_E_NOT_ON_STACK Handle = 0x8031004A FVE_E_FS_MOUNTED Handle = 0x8031004B FVE_E_TOKEN_NOT_IMPERSONATED Handle = 0x8031004C FVE_E_DRY_RUN_FAILED Handle = 0x8031004D FVE_E_REBOOT_REQUIRED Handle = 0x8031004E FVE_E_DEBUGGER_ENABLED Handle = 0x8031004F FVE_E_RAW_ACCESS Handle = 0x80310050 FVE_E_RAW_BLOCKED Handle = 0x80310051 FVE_E_BCD_APPLICATIONS_PATH_INCORRECT Handle = 0x80310052 FVE_E_NOT_ALLOWED_IN_VERSION Handle = 0x80310053 FVE_E_NO_AUTOUNLOCK_MASTER_KEY Handle = 0x80310054 FVE_E_MOR_FAILED Handle = 0x80310055 FVE_E_HIDDEN_VOLUME Handle = 0x80310056 FVE_E_TRANSIENT_STATE Handle = 0x80310057 FVE_E_PUBKEY_NOT_ALLOWED Handle = 0x80310058 FVE_E_VOLUME_HANDLE_OPEN Handle = 0x80310059 FVE_E_NO_FEATURE_LICENSE Handle = 0x8031005A FVE_E_INVALID_STARTUP_OPTIONS Handle = 0x8031005B FVE_E_POLICY_RECOVERY_PASSWORD_NOT_ALLOWED Handle = 0x8031005C FVE_E_POLICY_RECOVERY_PASSWORD_REQUIRED Handle = 0x8031005D FVE_E_POLICY_RECOVERY_KEY_NOT_ALLOWED Handle = 0x8031005E FVE_E_POLICY_RECOVERY_KEY_REQUIRED Handle = 0x8031005F FVE_E_POLICY_STARTUP_PIN_NOT_ALLOWED Handle = 0x80310060 FVE_E_POLICY_STARTUP_PIN_REQUIRED Handle = 0x80310061 FVE_E_POLICY_STARTUP_KEY_NOT_ALLOWED Handle = 0x80310062 FVE_E_POLICY_STARTUP_KEY_REQUIRED Handle = 0x80310063 FVE_E_POLICY_STARTUP_PIN_KEY_NOT_ALLOWED Handle = 0x80310064 FVE_E_POLICY_STARTUP_PIN_KEY_REQUIRED Handle = 0x80310065 FVE_E_POLICY_STARTUP_TPM_NOT_ALLOWED Handle = 0x80310066 FVE_E_POLICY_STARTUP_TPM_REQUIRED Handle = 0x80310067 FVE_E_POLICY_INVALID_PIN_LENGTH Handle = 0x80310068 FVE_E_KEY_PROTECTOR_NOT_SUPPORTED Handle = 0x80310069 FVE_E_POLICY_PASSPHRASE_NOT_ALLOWED Handle = 0x8031006A FVE_E_POLICY_PASSPHRASE_REQUIRED Handle = 0x8031006B FVE_E_FIPS_PREVENTS_PASSPHRASE Handle = 0x8031006C FVE_E_OS_VOLUME_PASSPHRASE_NOT_ALLOWED Handle = 0x8031006D FVE_E_INVALID_BITLOCKER_OID Handle = 0x8031006E FVE_E_VOLUME_TOO_SMALL Handle = 0x8031006F FVE_E_DV_NOT_SUPPORTED_ON_FS Handle = 0x80310070 FVE_E_DV_NOT_ALLOWED_BY_GP Handle = 0x80310071 FVE_E_POLICY_USER_CERTIFICATE_NOT_ALLOWED Handle = 0x80310072 FVE_E_POLICY_USER_CERTIFICATE_REQUIRED Handle = 0x80310073 FVE_E_POLICY_USER_CERT_MUST_BE_HW Handle = 0x80310074 FVE_E_POLICY_USER_CONFIGURE_FDV_AUTOUNLOCK_NOT_ALLOWED Handle = 0x80310075 FVE_E_POLICY_USER_CONFIGURE_RDV_AUTOUNLOCK_NOT_ALLOWED Handle = 0x80310076 FVE_E_POLICY_USER_CONFIGURE_RDV_NOT_ALLOWED Handle = 0x80310077 FVE_E_POLICY_USER_ENABLE_RDV_NOT_ALLOWED Handle = 0x80310078 FVE_E_POLICY_USER_DISABLE_RDV_NOT_ALLOWED Handle = 0x80310079 FVE_E_POLICY_INVALID_PASSPHRASE_LENGTH Handle = 0x80310080 FVE_E_POLICY_PASSPHRASE_TOO_SIMPLE Handle = 0x80310081 FVE_E_RECOVERY_PARTITION Handle = 0x80310082 FVE_E_POLICY_CONFLICT_FDV_RK_OFF_AUK_ON Handle = 0x80310083 FVE_E_POLICY_CONFLICT_RDV_RK_OFF_AUK_ON Handle = 0x80310084 FVE_E_NON_BITLOCKER_OID Handle = 0x80310085 FVE_E_POLICY_PROHIBITS_SELFSIGNED Handle = 0x80310086 FVE_E_POLICY_CONFLICT_RO_AND_STARTUP_KEY_REQUIRED Handle = 0x80310087 FVE_E_CONV_RECOVERY_FAILED Handle = 0x80310088 FVE_E_VIRTUALIZED_SPACE_TOO_BIG Handle = 0x80310089 FVE_E_POLICY_CONFLICT_OSV_RP_OFF_ADB_ON Handle = 0x80310090 FVE_E_POLICY_CONFLICT_FDV_RP_OFF_ADB_ON Handle = 0x80310091 FVE_E_POLICY_CONFLICT_RDV_RP_OFF_ADB_ON Handle = 0x80310092 FVE_E_NON_BITLOCKER_KU Handle = 0x80310093 FVE_E_PRIVATEKEY_AUTH_FAILED Handle = 0x80310094 FVE_E_REMOVAL_OF_DRA_FAILED Handle = 0x80310095 FVE_E_OPERATION_NOT_SUPPORTED_ON_VISTA_VOLUME Handle = 0x80310096 FVE_E_CANT_LOCK_AUTOUNLOCK_ENABLED_VOLUME Handle = 0x80310097 FVE_E_FIPS_HASH_KDF_NOT_ALLOWED Handle = 0x80310098 FVE_E_ENH_PIN_INVALID Handle = 0x80310099 FVE_E_INVALID_PIN_CHARS Handle = 0x8031009A FVE_E_INVALID_DATUM_TYPE Handle = 0x8031009B FVE_E_EFI_ONLY Handle = 0x8031009C FVE_E_MULTIPLE_NKP_CERTS Handle = 0x8031009D FVE_E_REMOVAL_OF_NKP_FAILED Handle = 0x8031009E FVE_E_INVALID_NKP_CERT Handle = 0x8031009F FVE_E_NO_EXISTING_PIN Handle = 0x803100A0 FVE_E_PROTECTOR_CHANGE_PIN_MISMATCH Handle = 0x803100A1 FVE_E_PIN_PROTECTOR_CHANGE_BY_STD_USER_DISALLOWED Handle = 0x803100A2 FVE_E_PROTECTOR_CHANGE_MAX_PIN_CHANGE_ATTEMPTS_REACHED Handle = 0x803100A3 FVE_E_POLICY_PASSPHRASE_REQUIRES_ASCII Handle = 0x803100A4 FVE_E_FULL_ENCRYPTION_NOT_ALLOWED_ON_TP_STORAGE Handle = 0x803100A5 FVE_E_WIPE_NOT_ALLOWED_ON_TP_STORAGE Handle = 0x803100A6 FVE_E_KEY_LENGTH_NOT_SUPPORTED_BY_EDRIVE Handle = 0x803100A7 FVE_E_NO_EXISTING_PASSPHRASE Handle = 0x803100A8 FVE_E_PROTECTOR_CHANGE_PASSPHRASE_MISMATCH Handle = 0x803100A9 FVE_E_PASSPHRASE_TOO_LONG Handle = 0x803100AA FVE_E_NO_PASSPHRASE_WITH_TPM Handle = 0x803100AB FVE_E_NO_TPM_WITH_PASSPHRASE Handle = 0x803100AC FVE_E_NOT_ALLOWED_ON_CSV_STACK Handle = 0x803100AD FVE_E_NOT_ALLOWED_ON_CLUSTER Handle = 0x803100AE FVE_E_EDRIVE_NO_FAILOVER_TO_SW Handle = 0x803100AF FVE_E_EDRIVE_BAND_IN_USE Handle = 0x803100B0 FVE_E_EDRIVE_DISALLOWED_BY_GP Handle = 0x803100B1 FVE_E_EDRIVE_INCOMPATIBLE_VOLUME Handle = 0x803100B2 FVE_E_NOT_ALLOWED_TO_UPGRADE_WHILE_CONVERTING Handle = 0x803100B3 FVE_E_EDRIVE_DV_NOT_SUPPORTED Handle = 0x803100B4 FVE_E_NO_PREBOOT_KEYBOARD_DETECTED Handle = 0x803100B5 FVE_E_NO_PREBOOT_KEYBOARD_OR_WINRE_DETECTED Handle = 0x803100B6 FVE_E_POLICY_REQUIRES_STARTUP_PIN_ON_TOUCH_DEVICE Handle = 0x803100B7 FVE_E_POLICY_REQUIRES_RECOVERY_PASSWORD_ON_TOUCH_DEVICE Handle = 0x803100B8 FVE_E_WIPE_CANCEL_NOT_APPLICABLE Handle = 0x803100B9 FVE_E_SECUREBOOT_DISABLED Handle = 0x803100BA FVE_E_SECUREBOOT_CONFIGURATION_INVALID Handle = 0x803100BB FVE_E_EDRIVE_DRY_RUN_FAILED Handle = 0x803100BC FVE_E_SHADOW_COPY_PRESENT Handle = 0x803100BD FVE_E_POLICY_INVALID_ENHANCED_BCD_SETTINGS Handle = 0x803100BE FVE_E_EDRIVE_INCOMPATIBLE_FIRMWARE Handle = 0x803100BF FVE_E_PROTECTOR_CHANGE_MAX_PASSPHRASE_CHANGE_ATTEMPTS_REACHED Handle = 0x803100C0 FVE_E_PASSPHRASE_PROTECTOR_CHANGE_BY_STD_USER_DISALLOWED Handle = 0x803100C1 FVE_E_LIVEID_ACCOUNT_SUSPENDED Handle = 0x803100C2 FVE_E_LIVEID_ACCOUNT_BLOCKED Handle = 0x803100C3 FVE_E_NOT_PROVISIONED_ON_ALL_VOLUMES Handle = 0x803100C4 FVE_E_DE_FIXED_DATA_NOT_SUPPORTED Handle = 0x803100C5 FVE_E_DE_HARDWARE_NOT_COMPLIANT Handle = 0x803100C6 FVE_E_DE_WINRE_NOT_CONFIGURED Handle = 0x803100C7 FVE_E_DE_PROTECTION_SUSPENDED Handle = 0x803100C8 FVE_E_DE_OS_VOLUME_NOT_PROTECTED Handle = 0x803100C9 FVE_E_DE_DEVICE_LOCKEDOUT Handle = 0x803100CA FVE_E_DE_PROTECTION_NOT_YET_ENABLED Handle = 0x803100CB FVE_E_INVALID_PIN_CHARS_DETAILED Handle = 0x803100CC FVE_E_DEVICE_LOCKOUT_COUNTER_UNAVAILABLE Handle = 0x803100CD FVE_E_DEVICELOCKOUT_COUNTER_MISMATCH Handle = 0x803100CE FVE_E_BUFFER_TOO_LARGE Handle = 0x803100CF FVE_E_NO_SUCH_CAPABILITY_ON_TARGET Handle = 0x803100D0 FVE_E_DE_PREVENTED_FOR_OS Handle = 0x803100D1 FVE_E_DE_VOLUME_OPTED_OUT Handle = 0x803100D2 FVE_E_DE_VOLUME_NOT_SUPPORTED Handle = 0x803100D3 FVE_E_EOW_NOT_SUPPORTED_IN_VERSION Handle = 0x803100D4 FVE_E_ADBACKUP_NOT_ENABLED Handle = 0x803100D5 FVE_E_VOLUME_EXTEND_PREVENTS_EOW_DECRYPT Handle = 0x803100D6 FVE_E_NOT_DE_VOLUME Handle = 0x803100D7 FVE_E_PROTECTION_CANNOT_BE_DISABLED Handle = 0x803100D8 FVE_E_OSV_KSR_NOT_ALLOWED Handle = 0x803100D9 FVE_E_AD_BACKUP_REQUIRED_POLICY_NOT_SET_OS_DRIVE Handle = 0x803100DA FVE_E_AD_BACKUP_REQUIRED_POLICY_NOT_SET_FIXED_DRIVE Handle = 0x803100DB FVE_E_AD_BACKUP_REQUIRED_POLICY_NOT_SET_REMOVABLE_DRIVE Handle = 0x803100DC FVE_E_KEY_ROTATION_NOT_SUPPORTED Handle = 0x803100DD FVE_E_EXECUTE_REQUEST_SENT_TOO_SOON Handle = 0x803100DE FVE_E_KEY_ROTATION_NOT_ENABLED Handle = 0x803100DF FVE_E_DEVICE_NOT_JOINED Handle = 0x803100E0 FWP_E_CALLOUT_NOT_FOUND Handle = 0x80320001 FWP_E_CONDITION_NOT_FOUND Handle = 0x80320002 FWP_E_FILTER_NOT_FOUND Handle = 0x80320003 FWP_E_LAYER_NOT_FOUND Handle = 0x80320004 FWP_E_PROVIDER_NOT_FOUND Handle = 0x80320005 FWP_E_PROVIDER_CONTEXT_NOT_FOUND Handle = 0x80320006 FWP_E_SUBLAYER_NOT_FOUND Handle = 0x80320007 FWP_E_NOT_FOUND Handle = 0x80320008 FWP_E_ALREADY_EXISTS Handle = 0x80320009 FWP_E_IN_USE Handle = 0x8032000A FWP_E_DYNAMIC_SESSION_IN_PROGRESS Handle = 0x8032000B FWP_E_WRONG_SESSION Handle = 0x8032000C FWP_E_NO_TXN_IN_PROGRESS Handle = 0x8032000D FWP_E_TXN_IN_PROGRESS Handle = 0x8032000E FWP_E_TXN_ABORTED Handle = 0x8032000F FWP_E_SESSION_ABORTED Handle = 0x80320010 FWP_E_INCOMPATIBLE_TXN Handle = 0x80320011 FWP_E_TIMEOUT Handle = 0x80320012 FWP_E_NET_EVENTS_DISABLED Handle = 0x80320013 FWP_E_INCOMPATIBLE_LAYER Handle = 0x80320014 FWP_E_KM_CLIENTS_ONLY Handle = 0x80320015 FWP_E_LIFETIME_MISMATCH Handle = 0x80320016 FWP_E_BUILTIN_OBJECT Handle = 0x80320017 FWP_E_TOO_MANY_CALLOUTS Handle = 0x80320018 FWP_E_NOTIFICATION_DROPPED Handle = 0x80320019 FWP_E_TRAFFIC_MISMATCH Handle = 0x8032001A FWP_E_INCOMPATIBLE_SA_STATE Handle = 0x8032001B FWP_E_NULL_POINTER Handle = 0x8032001C FWP_E_INVALID_ENUMERATOR Handle = 0x8032001D FWP_E_INVALID_FLAGS Handle = 0x8032001E FWP_E_INVALID_NET_MASK Handle = 0x8032001F FWP_E_INVALID_RANGE Handle = 0x80320020 FWP_E_INVALID_INTERVAL Handle = 0x80320021 FWP_E_ZERO_LENGTH_ARRAY Handle = 0x80320022 FWP_E_NULL_DISPLAY_NAME Handle = 0x80320023 FWP_E_INVALID_ACTION_TYPE Handle = 0x80320024 FWP_E_INVALID_WEIGHT Handle = 0x80320025 FWP_E_MATCH_TYPE_MISMATCH Handle = 0x80320026 FWP_E_TYPE_MISMATCH Handle = 0x80320027 FWP_E_OUT_OF_BOUNDS Handle = 0x80320028 FWP_E_RESERVED Handle = 0x80320029 FWP_E_DUPLICATE_CONDITION Handle = 0x8032002A FWP_E_DUPLICATE_KEYMOD Handle = 0x8032002B FWP_E_ACTION_INCOMPATIBLE_WITH_LAYER Handle = 0x8032002C FWP_E_ACTION_INCOMPATIBLE_WITH_SUBLAYER Handle = 0x8032002D FWP_E_CONTEXT_INCOMPATIBLE_WITH_LAYER Handle = 0x8032002E FWP_E_CONTEXT_INCOMPATIBLE_WITH_CALLOUT Handle = 0x8032002F FWP_E_INCOMPATIBLE_AUTH_METHOD Handle = 0x80320030 FWP_E_INCOMPATIBLE_DH_GROUP Handle = 0x80320031 FWP_E_EM_NOT_SUPPORTED Handle = 0x80320032 FWP_E_NEVER_MATCH Handle = 0x80320033 FWP_E_PROVIDER_CONTEXT_MISMATCH Handle = 0x80320034 FWP_E_INVALID_PARAMETER Handle = 0x80320035 FWP_E_TOO_MANY_SUBLAYERS Handle = 0x80320036 FWP_E_CALLOUT_NOTIFICATION_FAILED Handle = 0x80320037 FWP_E_INVALID_AUTH_TRANSFORM Handle = 0x80320038 FWP_E_INVALID_CIPHER_TRANSFORM Handle = 0x80320039 FWP_E_INCOMPATIBLE_CIPHER_TRANSFORM Handle = 0x8032003A FWP_E_INVALID_TRANSFORM_COMBINATION Handle = 0x8032003B FWP_E_DUPLICATE_AUTH_METHOD Handle = 0x8032003C FWP_E_INVALID_TUNNEL_ENDPOINT Handle = 0x8032003D FWP_E_L2_DRIVER_NOT_READY Handle = 0x8032003E FWP_E_KEY_DICTATOR_ALREADY_REGISTERED Handle = 0x8032003F FWP_E_KEY_DICTATION_INVALID_KEYING_MATERIAL Handle = 0x80320040 FWP_E_CONNECTIONS_DISABLED Handle = 0x80320041 FWP_E_INVALID_DNS_NAME Handle = 0x80320042 FWP_E_STILL_ON Handle = 0x80320043 FWP_E_IKEEXT_NOT_RUNNING Handle = 0x80320044 FWP_E_DROP_NOICMP Handle = 0x80320104 WS_S_ASYNC Handle = 0x003D0000 WS_S_END Handle = 0x003D0001 WS_E_INVALID_FORMAT Handle = 0x803D0000 WS_E_OBJECT_FAULTED Handle = 0x803D0001 WS_E_NUMERIC_OVERFLOW Handle = 0x803D0002 WS_E_INVALID_OPERATION Handle = 0x803D0003 WS_E_OPERATION_ABORTED Handle = 0x803D0004 WS_E_ENDPOINT_ACCESS_DENIED Handle = 0x803D0005 WS_E_OPERATION_TIMED_OUT Handle = 0x803D0006 WS_E_OPERATION_ABANDONED Handle = 0x803D0007 WS_E_QUOTA_EXCEEDED Handle = 0x803D0008 WS_E_NO_TRANSLATION_AVAILABLE Handle = 0x803D0009 WS_E_SECURITY_VERIFICATION_FAILURE Handle = 0x803D000A WS_E_ADDRESS_IN_USE Handle = 0x803D000B WS_E_ADDRESS_NOT_AVAILABLE Handle = 0x803D000C WS_E_ENDPOINT_NOT_FOUND Handle = 0x803D000D WS_E_ENDPOINT_NOT_AVAILABLE Handle = 0x803D000E WS_E_ENDPOINT_FAILURE Handle = 0x803D000F WS_E_ENDPOINT_UNREACHABLE Handle = 0x803D0010 WS_E_ENDPOINT_ACTION_NOT_SUPPORTED Handle = 0x803D0011 WS_E_ENDPOINT_TOO_BUSY Handle = 0x803D0012 WS_E_ENDPOINT_FAULT_RECEIVED Handle = 0x803D0013 WS_E_ENDPOINT_DISCONNECTED Handle = 0x803D0014 WS_E_PROXY_FAILURE Handle = 0x803D0015 WS_E_PROXY_ACCESS_DENIED Handle = 0x803D0016 WS_E_NOT_SUPPORTED Handle = 0x803D0017 WS_E_PROXY_REQUIRES_BASIC_AUTH Handle = 0x803D0018 WS_E_PROXY_REQUIRES_DIGEST_AUTH Handle = 0x803D0019 WS_E_PROXY_REQUIRES_NTLM_AUTH Handle = 0x803D001A WS_E_PROXY_REQUIRES_NEGOTIATE_AUTH Handle = 0x803D001B WS_E_SERVER_REQUIRES_BASIC_AUTH Handle = 0x803D001C WS_E_SERVER_REQUIRES_DIGEST_AUTH Handle = 0x803D001D WS_E_SERVER_REQUIRES_NTLM_AUTH Handle = 0x803D001E WS_E_SERVER_REQUIRES_NEGOTIATE_AUTH Handle = 0x803D001F WS_E_INVALID_ENDPOINT_URL Handle = 0x803D0020 WS_E_OTHER Handle = 0x803D0021 WS_E_SECURITY_TOKEN_EXPIRED Handle = 0x803D0022 WS_E_SECURITY_SYSTEM_FAILURE Handle = 0x803D0023 ERROR_NDIS_INTERFACE_CLOSING syscall.Errno = 0x80340002 ERROR_NDIS_BAD_VERSION syscall.Errno = 0x80340004 ERROR_NDIS_BAD_CHARACTERISTICS syscall.Errno = 0x80340005 ERROR_NDIS_ADAPTER_NOT_FOUND syscall.Errno = 0x80340006 ERROR_NDIS_OPEN_FAILED syscall.Errno = 0x80340007 ERROR_NDIS_DEVICE_FAILED syscall.Errno = 0x80340008 ERROR_NDIS_MULTICAST_FULL syscall.Errno = 0x80340009 ERROR_NDIS_MULTICAST_EXISTS syscall.Errno = 0x8034000A ERROR_NDIS_MULTICAST_NOT_FOUND syscall.Errno = 0x8034000B ERROR_NDIS_REQUEST_ABORTED syscall.Errno = 0x8034000C ERROR_NDIS_RESET_IN_PROGRESS syscall.Errno = 0x8034000D ERROR_NDIS_NOT_SUPPORTED syscall.Errno = 0x803400BB ERROR_NDIS_INVALID_PACKET syscall.Errno = 0x8034000F ERROR_NDIS_ADAPTER_NOT_READY syscall.Errno = 0x80340011 ERROR_NDIS_INVALID_LENGTH syscall.Errno = 0x80340014 ERROR_NDIS_INVALID_DATA syscall.Errno = 0x80340015 ERROR_NDIS_BUFFER_TOO_SHORT syscall.Errno = 0x80340016 ERROR_NDIS_INVALID_OID syscall.Errno = 0x80340017 ERROR_NDIS_ADAPTER_REMOVED syscall.Errno = 0x80340018 ERROR_NDIS_UNSUPPORTED_MEDIA syscall.Errno = 0x80340019 ERROR_NDIS_GROUP_ADDRESS_IN_USE syscall.Errno = 0x8034001A ERROR_NDIS_FILE_NOT_FOUND syscall.Errno = 0x8034001B ERROR_NDIS_ERROR_READING_FILE syscall.Errno = 0x8034001C ERROR_NDIS_ALREADY_MAPPED syscall.Errno = 0x8034001D ERROR_NDIS_RESOURCE_CONFLICT syscall.Errno = 0x8034001E ERROR_NDIS_MEDIA_DISCONNECTED syscall.Errno = 0x8034001F ERROR_NDIS_INVALID_ADDRESS syscall.Errno = 0x80340022 ERROR_NDIS_INVALID_DEVICE_REQUEST syscall.Errno = 0x80340010 ERROR_NDIS_PAUSED syscall.Errno = 0x8034002A ERROR_NDIS_INTERFACE_NOT_FOUND syscall.Errno = 0x8034002B ERROR_NDIS_UNSUPPORTED_REVISION syscall.Errno = 0x8034002C ERROR_NDIS_INVALID_PORT syscall.Errno = 0x8034002D ERROR_NDIS_INVALID_PORT_STATE syscall.Errno = 0x8034002E ERROR_NDIS_LOW_POWER_STATE syscall.Errno = 0x8034002F ERROR_NDIS_REINIT_REQUIRED syscall.Errno = 0x80340030 ERROR_NDIS_NO_QUEUES syscall.Errno = 0x80340031 ERROR_NDIS_DOT11_AUTO_CONFIG_ENABLED syscall.Errno = 0x80342000 ERROR_NDIS_DOT11_MEDIA_IN_USE syscall.Errno = 0x80342001 ERROR_NDIS_DOT11_POWER_STATE_INVALID syscall.Errno = 0x80342002 ERROR_NDIS_PM_WOL_PATTERN_LIST_FULL syscall.Errno = 0x80342003 ERROR_NDIS_PM_PROTOCOL_OFFLOAD_LIST_FULL syscall.Errno = 0x80342004 ERROR_NDIS_DOT11_AP_CHANNEL_CURRENTLY_NOT_AVAILABLE syscall.Errno = 0x80342005 ERROR_NDIS_DOT11_AP_BAND_CURRENTLY_NOT_AVAILABLE syscall.Errno = 0x80342006 ERROR_NDIS_DOT11_AP_CHANNEL_NOT_ALLOWED syscall.Errno = 0x80342007 ERROR_NDIS_DOT11_AP_BAND_NOT_ALLOWED syscall.Errno = 0x80342008 ERROR_NDIS_INDICATION_REQUIRED syscall.Errno = 0x00340001 ERROR_NDIS_OFFLOAD_POLICY syscall.Errno = 0xC034100F ERROR_NDIS_OFFLOAD_CONNECTION_REJECTED syscall.Errno = 0xC0341012 ERROR_NDIS_OFFLOAD_PATH_REJECTED syscall.Errno = 0xC0341013 ERROR_HV_INVALID_HYPERCALL_CODE syscall.Errno = 0xC0350002 ERROR_HV_INVALID_HYPERCALL_INPUT syscall.Errno = 0xC0350003 ERROR_HV_INVALID_ALIGNMENT syscall.Errno = 0xC0350004 ERROR_HV_INVALID_PARAMETER syscall.Errno = 0xC0350005 ERROR_HV_ACCESS_DENIED syscall.Errno = 0xC0350006 ERROR_HV_INVALID_PARTITION_STATE syscall.Errno = 0xC0350007 ERROR_HV_OPERATION_DENIED syscall.Errno = 0xC0350008 ERROR_HV_UNKNOWN_PROPERTY syscall.Errno = 0xC0350009 ERROR_HV_PROPERTY_VALUE_OUT_OF_RANGE syscall.Errno = 0xC035000A ERROR_HV_INSUFFICIENT_MEMORY syscall.Errno = 0xC035000B ERROR_HV_PARTITION_TOO_DEEP syscall.Errno = 0xC035000C ERROR_HV_INVALID_PARTITION_ID syscall.Errno = 0xC035000D ERROR_HV_INVALID_VP_INDEX syscall.Errno = 0xC035000E ERROR_HV_INVALID_PORT_ID syscall.Errno = 0xC0350011 ERROR_HV_INVALID_CONNECTION_ID syscall.Errno = 0xC0350012 ERROR_HV_INSUFFICIENT_BUFFERS syscall.Errno = 0xC0350013 ERROR_HV_NOT_ACKNOWLEDGED syscall.Errno = 0xC0350014 ERROR_HV_INVALID_VP_STATE syscall.Errno = 0xC0350015 ERROR_HV_ACKNOWLEDGED syscall.Errno = 0xC0350016 ERROR_HV_INVALID_SAVE_RESTORE_STATE syscall.Errno = 0xC0350017 ERROR_HV_INVALID_SYNIC_STATE syscall.Errno = 0xC0350018 ERROR_HV_OBJECT_IN_USE syscall.Errno = 0xC0350019 ERROR_HV_INVALID_PROXIMITY_DOMAIN_INFO syscall.Errno = 0xC035001A ERROR_HV_NO_DATA syscall.Errno = 0xC035001B ERROR_HV_INACTIVE syscall.Errno = 0xC035001C ERROR_HV_NO_RESOURCES syscall.Errno = 0xC035001D ERROR_HV_FEATURE_UNAVAILABLE syscall.Errno = 0xC035001E ERROR_HV_INSUFFICIENT_BUFFER syscall.Errno = 0xC0350033 ERROR_HV_INSUFFICIENT_DEVICE_DOMAINS syscall.Errno = 0xC0350038 ERROR_HV_CPUID_FEATURE_VALIDATION syscall.Errno = 0xC035003C ERROR_HV_CPUID_XSAVE_FEATURE_VALIDATION syscall.Errno = 0xC035003D ERROR_HV_PROCESSOR_STARTUP_TIMEOUT syscall.Errno = 0xC035003E ERROR_HV_SMX_ENABLED syscall.Errno = 0xC035003F ERROR_HV_INVALID_LP_INDEX syscall.Errno = 0xC0350041 ERROR_HV_INVALID_REGISTER_VALUE syscall.Errno = 0xC0350050 ERROR_HV_INVALID_VTL_STATE syscall.Errno = 0xC0350051 ERROR_HV_NX_NOT_DETECTED syscall.Errno = 0xC0350055 ERROR_HV_INVALID_DEVICE_ID syscall.Errno = 0xC0350057 ERROR_HV_INVALID_DEVICE_STATE syscall.Errno = 0xC0350058 ERROR_HV_PENDING_PAGE_REQUESTS syscall.Errno = 0x00350059 ERROR_HV_PAGE_REQUEST_INVALID syscall.Errno = 0xC0350060 ERROR_HV_INVALID_CPU_GROUP_ID syscall.Errno = 0xC035006F ERROR_HV_INVALID_CPU_GROUP_STATE syscall.Errno = 0xC0350070 ERROR_HV_OPERATION_FAILED syscall.Errno = 0xC0350071 ERROR_HV_NOT_ALLOWED_WITH_NESTED_VIRT_ACTIVE syscall.Errno = 0xC0350072 ERROR_HV_INSUFFICIENT_ROOT_MEMORY syscall.Errno = 0xC0350073 ERROR_HV_NOT_PRESENT syscall.Errno = 0xC0351000 ERROR_VID_DUPLICATE_HANDLER syscall.Errno = 0xC0370001 ERROR_VID_TOO_MANY_HANDLERS syscall.Errno = 0xC0370002 ERROR_VID_QUEUE_FULL syscall.Errno = 0xC0370003 ERROR_VID_HANDLER_NOT_PRESENT syscall.Errno = 0xC0370004 ERROR_VID_INVALID_OBJECT_NAME syscall.Errno = 0xC0370005 ERROR_VID_PARTITION_NAME_TOO_LONG syscall.Errno = 0xC0370006 ERROR_VID_MESSAGE_QUEUE_NAME_TOO_LONG syscall.Errno = 0xC0370007 ERROR_VID_PARTITION_ALREADY_EXISTS syscall.Errno = 0xC0370008 ERROR_VID_PARTITION_DOES_NOT_EXIST syscall.Errno = 0xC0370009 ERROR_VID_PARTITION_NAME_NOT_FOUND syscall.Errno = 0xC037000A ERROR_VID_MESSAGE_QUEUE_ALREADY_EXISTS syscall.Errno = 0xC037000B ERROR_VID_EXCEEDED_MBP_ENTRY_MAP_LIMIT syscall.Errno = 0xC037000C ERROR_VID_MB_STILL_REFERENCED syscall.Errno = 0xC037000D ERROR_VID_CHILD_GPA_PAGE_SET_CORRUPTED syscall.Errno = 0xC037000E ERROR_VID_INVALID_NUMA_SETTINGS syscall.Errno = 0xC037000F ERROR_VID_INVALID_NUMA_NODE_INDEX syscall.Errno = 0xC0370010 ERROR_VID_NOTIFICATION_QUEUE_ALREADY_ASSOCIATED syscall.Errno = 0xC0370011 ERROR_VID_INVALID_MEMORY_BLOCK_HANDLE syscall.Errno = 0xC0370012 ERROR_VID_PAGE_RANGE_OVERFLOW syscall.Errno = 0xC0370013 ERROR_VID_INVALID_MESSAGE_QUEUE_HANDLE syscall.Errno = 0xC0370014 ERROR_VID_INVALID_GPA_RANGE_HANDLE syscall.Errno = 0xC0370015 ERROR_VID_NO_MEMORY_BLOCK_NOTIFICATION_QUEUE syscall.Errno = 0xC0370016 ERROR_VID_MEMORY_BLOCK_LOCK_COUNT_EXCEEDED syscall.Errno = 0xC0370017 ERROR_VID_INVALID_PPM_HANDLE syscall.Errno = 0xC0370018 ERROR_VID_MBPS_ARE_LOCKED syscall.Errno = 0xC0370019 ERROR_VID_MESSAGE_QUEUE_CLOSED syscall.Errno = 0xC037001A ERROR_VID_VIRTUAL_PROCESSOR_LIMIT_EXCEEDED syscall.Errno = 0xC037001B ERROR_VID_STOP_PENDING syscall.Errno = 0xC037001C ERROR_VID_INVALID_PROCESSOR_STATE syscall.Errno = 0xC037001D ERROR_VID_EXCEEDED_KM_CONTEXT_COUNT_LIMIT syscall.Errno = 0xC037001E ERROR_VID_KM_INTERFACE_ALREADY_INITIALIZED syscall.Errno = 0xC037001F ERROR_VID_MB_PROPERTY_ALREADY_SET_RESET syscall.Errno = 0xC0370020 ERROR_VID_MMIO_RANGE_DESTROYED syscall.Errno = 0xC0370021 ERROR_VID_INVALID_CHILD_GPA_PAGE_SET syscall.Errno = 0xC0370022 ERROR_VID_RESERVE_PAGE_SET_IS_BEING_USED syscall.Errno = 0xC0370023 ERROR_VID_RESERVE_PAGE_SET_TOO_SMALL syscall.Errno = 0xC0370024 ERROR_VID_MBP_ALREADY_LOCKED_USING_RESERVED_PAGE syscall.Errno = 0xC0370025 ERROR_VID_MBP_COUNT_EXCEEDED_LIMIT syscall.Errno = 0xC0370026 ERROR_VID_SAVED_STATE_CORRUPT syscall.Errno = 0xC0370027 ERROR_VID_SAVED_STATE_UNRECOGNIZED_ITEM syscall.Errno = 0xC0370028 ERROR_VID_SAVED_STATE_INCOMPATIBLE syscall.Errno = 0xC0370029 ERROR_VID_VTL_ACCESS_DENIED syscall.Errno = 0xC037002A ERROR_VMCOMPUTE_TERMINATED_DURING_START syscall.Errno = 0xC0370100 ERROR_VMCOMPUTE_IMAGE_MISMATCH syscall.Errno = 0xC0370101 ERROR_VMCOMPUTE_HYPERV_NOT_INSTALLED syscall.Errno = 0xC0370102 ERROR_VMCOMPUTE_OPERATION_PENDING syscall.Errno = 0xC0370103 ERROR_VMCOMPUTE_TOO_MANY_NOTIFICATIONS syscall.Errno = 0xC0370104 ERROR_VMCOMPUTE_INVALID_STATE syscall.Errno = 0xC0370105 ERROR_VMCOMPUTE_UNEXPECTED_EXIT syscall.Errno = 0xC0370106 ERROR_VMCOMPUTE_TERMINATED syscall.Errno = 0xC0370107 ERROR_VMCOMPUTE_CONNECT_FAILED syscall.Errno = 0xC0370108 ERROR_VMCOMPUTE_TIMEOUT syscall.Errno = 0xC0370109 ERROR_VMCOMPUTE_CONNECTION_CLOSED syscall.Errno = 0xC037010A ERROR_VMCOMPUTE_UNKNOWN_MESSAGE syscall.Errno = 0xC037010B ERROR_VMCOMPUTE_UNSUPPORTED_PROTOCOL_VERSION syscall.Errno = 0xC037010C ERROR_VMCOMPUTE_INVALID_JSON syscall.Errno = 0xC037010D ERROR_VMCOMPUTE_SYSTEM_NOT_FOUND syscall.Errno = 0xC037010E ERROR_VMCOMPUTE_SYSTEM_ALREADY_EXISTS syscall.Errno = 0xC037010F ERROR_VMCOMPUTE_SYSTEM_ALREADY_STOPPED syscall.Errno = 0xC0370110 ERROR_VMCOMPUTE_PROTOCOL_ERROR syscall.Errno = 0xC0370111 ERROR_VMCOMPUTE_INVALID_LAYER syscall.Errno = 0xC0370112 ERROR_VMCOMPUTE_WINDOWS_INSIDER_REQUIRED syscall.Errno = 0xC0370113 HCS_E_TERMINATED_DURING_START Handle = 0x80370100 HCS_E_IMAGE_MISMATCH Handle = 0x80370101 HCS_E_HYPERV_NOT_INSTALLED Handle = 0x80370102 HCS_E_INVALID_STATE Handle = 0x80370105 HCS_E_UNEXPECTED_EXIT Handle = 0x80370106 HCS_E_TERMINATED Handle = 0x80370107 HCS_E_CONNECT_FAILED Handle = 0x80370108 HCS_E_CONNECTION_TIMEOUT Handle = 0x80370109 HCS_E_CONNECTION_CLOSED Handle = 0x8037010A HCS_E_UNKNOWN_MESSAGE Handle = 0x8037010B HCS_E_UNSUPPORTED_PROTOCOL_VERSION Handle = 0x8037010C HCS_E_INVALID_JSON Handle = 0x8037010D HCS_E_SYSTEM_NOT_FOUND Handle = 0x8037010E HCS_E_SYSTEM_ALREADY_EXISTS Handle = 0x8037010F HCS_E_SYSTEM_ALREADY_STOPPED Handle = 0x80370110 HCS_E_PROTOCOL_ERROR Handle = 0x80370111 HCS_E_INVALID_LAYER Handle = 0x80370112 HCS_E_WINDOWS_INSIDER_REQUIRED Handle = 0x80370113 HCS_E_SERVICE_NOT_AVAILABLE Handle = 0x80370114 HCS_E_OPERATION_NOT_STARTED Handle = 0x80370115 HCS_E_OPERATION_ALREADY_STARTED Handle = 0x80370116 HCS_E_OPERATION_PENDING Handle = 0x80370117 HCS_E_OPERATION_TIMEOUT Handle = 0x80370118 HCS_E_OPERATION_SYSTEM_CALLBACK_ALREADY_SET Handle = 0x80370119 HCS_E_OPERATION_RESULT_ALLOCATION_FAILED Handle = 0x8037011A HCS_E_ACCESS_DENIED Handle = 0x8037011B HCS_E_GUEST_CRITICAL_ERROR Handle = 0x8037011C ERROR_VNET_VIRTUAL_SWITCH_NAME_NOT_FOUND syscall.Errno = 0xC0370200 ERROR_VID_REMOTE_NODE_PARENT_GPA_PAGES_USED syscall.Errno = 0x80370001 WHV_E_UNKNOWN_CAPABILITY Handle = 0x80370300 WHV_E_INSUFFICIENT_BUFFER Handle = 0x80370301 WHV_E_UNKNOWN_PROPERTY Handle = 0x80370302 WHV_E_UNSUPPORTED_HYPERVISOR_CONFIG Handle = 0x80370303 WHV_E_INVALID_PARTITION_CONFIG Handle = 0x80370304 WHV_E_GPA_RANGE_NOT_FOUND Handle = 0x80370305 WHV_E_VP_ALREADY_EXISTS Handle = 0x80370306 WHV_E_VP_DOES_NOT_EXIST Handle = 0x80370307 WHV_E_INVALID_VP_STATE Handle = 0x80370308 WHV_E_INVALID_VP_REGISTER_NAME Handle = 0x80370309 ERROR_VSMB_SAVED_STATE_FILE_NOT_FOUND syscall.Errno = 0xC0370400 ERROR_VSMB_SAVED_STATE_CORRUPT syscall.Errno = 0xC0370401 ERROR_VOLMGR_INCOMPLETE_REGENERATION syscall.Errno = 0x80380001 ERROR_VOLMGR_INCOMPLETE_DISK_MIGRATION syscall.Errno = 0x80380002 ERROR_VOLMGR_DATABASE_FULL syscall.Errno = 0xC0380001 ERROR_VOLMGR_DISK_CONFIGURATION_CORRUPTED syscall.Errno = 0xC0380002 ERROR_VOLMGR_DISK_CONFIGURATION_NOT_IN_SYNC syscall.Errno = 0xC0380003 ERROR_VOLMGR_PACK_CONFIG_UPDATE_FAILED syscall.Errno = 0xC0380004 ERROR_VOLMGR_DISK_CONTAINS_NON_SIMPLE_VOLUME syscall.Errno = 0xC0380005 ERROR_VOLMGR_DISK_DUPLICATE syscall.Errno = 0xC0380006 ERROR_VOLMGR_DISK_DYNAMIC syscall.Errno = 0xC0380007 ERROR_VOLMGR_DISK_ID_INVALID syscall.Errno = 0xC0380008 ERROR_VOLMGR_DISK_INVALID syscall.Errno = 0xC0380009 ERROR_VOLMGR_DISK_LAST_VOTER syscall.Errno = 0xC038000A ERROR_VOLMGR_DISK_LAYOUT_INVALID syscall.Errno = 0xC038000B ERROR_VOLMGR_DISK_LAYOUT_NON_BASIC_BETWEEN_BASIC_PARTITIONS syscall.Errno = 0xC038000C ERROR_VOLMGR_DISK_LAYOUT_NOT_CYLINDER_ALIGNED syscall.Errno = 0xC038000D ERROR_VOLMGR_DISK_LAYOUT_PARTITIONS_TOO_SMALL syscall.Errno = 0xC038000E ERROR_VOLMGR_DISK_LAYOUT_PRIMARY_BETWEEN_LOGICAL_PARTITIONS syscall.Errno = 0xC038000F ERROR_VOLMGR_DISK_LAYOUT_TOO_MANY_PARTITIONS syscall.Errno = 0xC0380010 ERROR_VOLMGR_DISK_MISSING syscall.Errno = 0xC0380011 ERROR_VOLMGR_DISK_NOT_EMPTY syscall.Errno = 0xC0380012 ERROR_VOLMGR_DISK_NOT_ENOUGH_SPACE syscall.Errno = 0xC0380013 ERROR_VOLMGR_DISK_REVECTORING_FAILED syscall.Errno = 0xC0380014 ERROR_VOLMGR_DISK_SECTOR_SIZE_INVALID syscall.Errno = 0xC0380015 ERROR_VOLMGR_DISK_SET_NOT_CONTAINED syscall.Errno = 0xC0380016 ERROR_VOLMGR_DISK_USED_BY_MULTIPLE_MEMBERS syscall.Errno = 0xC0380017 ERROR_VOLMGR_DISK_USED_BY_MULTIPLE_PLEXES syscall.Errno = 0xC0380018 ERROR_VOLMGR_DYNAMIC_DISK_NOT_SUPPORTED syscall.Errno = 0xC0380019 ERROR_VOLMGR_EXTENT_ALREADY_USED syscall.Errno = 0xC038001A ERROR_VOLMGR_EXTENT_NOT_CONTIGUOUS syscall.Errno = 0xC038001B ERROR_VOLMGR_EXTENT_NOT_IN_PUBLIC_REGION syscall.Errno = 0xC038001C ERROR_VOLMGR_EXTENT_NOT_SECTOR_ALIGNED syscall.Errno = 0xC038001D ERROR_VOLMGR_EXTENT_OVERLAPS_EBR_PARTITION syscall.Errno = 0xC038001E ERROR_VOLMGR_EXTENT_VOLUME_LENGTHS_DO_NOT_MATCH syscall.Errno = 0xC038001F ERROR_VOLMGR_FAULT_TOLERANT_NOT_SUPPORTED syscall.Errno = 0xC0380020 ERROR_VOLMGR_INTERLEAVE_LENGTH_INVALID syscall.Errno = 0xC0380021 ERROR_VOLMGR_MAXIMUM_REGISTERED_USERS syscall.Errno = 0xC0380022 ERROR_VOLMGR_MEMBER_IN_SYNC syscall.Errno = 0xC0380023 ERROR_VOLMGR_MEMBER_INDEX_DUPLICATE syscall.Errno = 0xC0380024 ERROR_VOLMGR_MEMBER_INDEX_INVALID syscall.Errno = 0xC0380025 ERROR_VOLMGR_MEMBER_MISSING syscall.Errno = 0xC0380026 ERROR_VOLMGR_MEMBER_NOT_DETACHED syscall.Errno = 0xC0380027 ERROR_VOLMGR_MEMBER_REGENERATING syscall.Errno = 0xC0380028 ERROR_VOLMGR_ALL_DISKS_FAILED syscall.Errno = 0xC0380029 ERROR_VOLMGR_NO_REGISTERED_USERS syscall.Errno = 0xC038002A ERROR_VOLMGR_NO_SUCH_USER syscall.Errno = 0xC038002B ERROR_VOLMGR_NOTIFICATION_RESET syscall.Errno = 0xC038002C ERROR_VOLMGR_NUMBER_OF_MEMBERS_INVALID syscall.Errno = 0xC038002D ERROR_VOLMGR_NUMBER_OF_PLEXES_INVALID syscall.Errno = 0xC038002E ERROR_VOLMGR_PACK_DUPLICATE syscall.Errno = 0xC038002F ERROR_VOLMGR_PACK_ID_INVALID syscall.Errno = 0xC0380030 ERROR_VOLMGR_PACK_INVALID syscall.Errno = 0xC0380031 ERROR_VOLMGR_PACK_NAME_INVALID syscall.Errno = 0xC0380032 ERROR_VOLMGR_PACK_OFFLINE syscall.Errno = 0xC0380033 ERROR_VOLMGR_PACK_HAS_QUORUM syscall.Errno = 0xC0380034 ERROR_VOLMGR_PACK_WITHOUT_QUORUM syscall.Errno = 0xC0380035 ERROR_VOLMGR_PARTITION_STYLE_INVALID syscall.Errno = 0xC0380036 ERROR_VOLMGR_PARTITION_UPDATE_FAILED syscall.Errno = 0xC0380037 ERROR_VOLMGR_PLEX_IN_SYNC syscall.Errno = 0xC0380038 ERROR_VOLMGR_PLEX_INDEX_DUPLICATE syscall.Errno = 0xC0380039 ERROR_VOLMGR_PLEX_INDEX_INVALID syscall.Errno = 0xC038003A ERROR_VOLMGR_PLEX_LAST_ACTIVE syscall.Errno = 0xC038003B ERROR_VOLMGR_PLEX_MISSING syscall.Errno = 0xC038003C ERROR_VOLMGR_PLEX_REGENERATING syscall.Errno = 0xC038003D ERROR_VOLMGR_PLEX_TYPE_INVALID syscall.Errno = 0xC038003E ERROR_VOLMGR_PLEX_NOT_RAID5 syscall.Errno = 0xC038003F ERROR_VOLMGR_PLEX_NOT_SIMPLE syscall.Errno = 0xC0380040 ERROR_VOLMGR_STRUCTURE_SIZE_INVALID syscall.Errno = 0xC0380041 ERROR_VOLMGR_TOO_MANY_NOTIFICATION_REQUESTS syscall.Errno = 0xC0380042 ERROR_VOLMGR_TRANSACTION_IN_PROGRESS syscall.Errno = 0xC0380043 ERROR_VOLMGR_UNEXPECTED_DISK_LAYOUT_CHANGE syscall.Errno = 0xC0380044 ERROR_VOLMGR_VOLUME_CONTAINS_MISSING_DISK syscall.Errno = 0xC0380045 ERROR_VOLMGR_VOLUME_ID_INVALID syscall.Errno = 0xC0380046 ERROR_VOLMGR_VOLUME_LENGTH_INVALID syscall.Errno = 0xC0380047 ERROR_VOLMGR_VOLUME_LENGTH_NOT_SECTOR_SIZE_MULTIPLE syscall.Errno = 0xC0380048 ERROR_VOLMGR_VOLUME_NOT_MIRRORED syscall.Errno = 0xC0380049 ERROR_VOLMGR_VOLUME_NOT_RETAINED syscall.Errno = 0xC038004A ERROR_VOLMGR_VOLUME_OFFLINE syscall.Errno = 0xC038004B ERROR_VOLMGR_VOLUME_RETAINED syscall.Errno = 0xC038004C ERROR_VOLMGR_NUMBER_OF_EXTENTS_INVALID syscall.Errno = 0xC038004D ERROR_VOLMGR_DIFFERENT_SECTOR_SIZE syscall.Errno = 0xC038004E ERROR_VOLMGR_BAD_BOOT_DISK syscall.Errno = 0xC038004F ERROR_VOLMGR_PACK_CONFIG_OFFLINE syscall.Errno = 0xC0380050 ERROR_VOLMGR_PACK_CONFIG_ONLINE syscall.Errno = 0xC0380051 ERROR_VOLMGR_NOT_PRIMARY_PACK syscall.Errno = 0xC0380052 ERROR_VOLMGR_PACK_LOG_UPDATE_FAILED syscall.Errno = 0xC0380053 ERROR_VOLMGR_NUMBER_OF_DISKS_IN_PLEX_INVALID syscall.Errno = 0xC0380054 ERROR_VOLMGR_NUMBER_OF_DISKS_IN_MEMBER_INVALID syscall.Errno = 0xC0380055 ERROR_VOLMGR_VOLUME_MIRRORED syscall.Errno = 0xC0380056 ERROR_VOLMGR_PLEX_NOT_SIMPLE_SPANNED syscall.Errno = 0xC0380057 ERROR_VOLMGR_NO_VALID_LOG_COPIES syscall.Errno = 0xC0380058 ERROR_VOLMGR_PRIMARY_PACK_PRESENT syscall.Errno = 0xC0380059 ERROR_VOLMGR_NUMBER_OF_DISKS_INVALID syscall.Errno = 0xC038005A ERROR_VOLMGR_MIRROR_NOT_SUPPORTED syscall.Errno = 0xC038005B ERROR_VOLMGR_RAID5_NOT_SUPPORTED syscall.Errno = 0xC038005C ERROR_BCD_NOT_ALL_ENTRIES_IMPORTED syscall.Errno = 0x80390001 ERROR_BCD_TOO_MANY_ELEMENTS syscall.Errno = 0xC0390002 ERROR_BCD_NOT_ALL_ENTRIES_SYNCHRONIZED syscall.Errno = 0x80390003 ERROR_VHD_DRIVE_FOOTER_MISSING syscall.Errno = 0xC03A0001 ERROR_VHD_DRIVE_FOOTER_CHECKSUM_MISMATCH syscall.Errno = 0xC03A0002 ERROR_VHD_DRIVE_FOOTER_CORRUPT syscall.Errno = 0xC03A0003 ERROR_VHD_FORMAT_UNKNOWN syscall.Errno = 0xC03A0004 ERROR_VHD_FORMAT_UNSUPPORTED_VERSION syscall.Errno = 0xC03A0005 ERROR_VHD_SPARSE_HEADER_CHECKSUM_MISMATCH syscall.Errno = 0xC03A0006 ERROR_VHD_SPARSE_HEADER_UNSUPPORTED_VERSION syscall.Errno = 0xC03A0007 ERROR_VHD_SPARSE_HEADER_CORRUPT syscall.Errno = 0xC03A0008 ERROR_VHD_BLOCK_ALLOCATION_FAILURE syscall.Errno = 0xC03A0009 ERROR_VHD_BLOCK_ALLOCATION_TABLE_CORRUPT syscall.Errno = 0xC03A000A ERROR_VHD_INVALID_BLOCK_SIZE syscall.Errno = 0xC03A000B ERROR_VHD_BITMAP_MISMATCH syscall.Errno = 0xC03A000C ERROR_VHD_PARENT_VHD_NOT_FOUND syscall.Errno = 0xC03A000D ERROR_VHD_CHILD_PARENT_ID_MISMATCH syscall.Errno = 0xC03A000E ERROR_VHD_CHILD_PARENT_TIMESTAMP_MISMATCH syscall.Errno = 0xC03A000F ERROR_VHD_METADATA_READ_FAILURE syscall.Errno = 0xC03A0010 ERROR_VHD_METADATA_WRITE_FAILURE syscall.Errno = 0xC03A0011 ERROR_VHD_INVALID_SIZE syscall.Errno = 0xC03A0012 ERROR_VHD_INVALID_FILE_SIZE syscall.Errno = 0xC03A0013 ERROR_VIRTDISK_PROVIDER_NOT_FOUND syscall.Errno = 0xC03A0014 ERROR_VIRTDISK_NOT_VIRTUAL_DISK syscall.Errno = 0xC03A0015 ERROR_VHD_PARENT_VHD_ACCESS_DENIED syscall.Errno = 0xC03A0016 ERROR_VHD_CHILD_PARENT_SIZE_MISMATCH syscall.Errno = 0xC03A0017 ERROR_VHD_DIFFERENCING_CHAIN_CYCLE_DETECTED syscall.Errno = 0xC03A0018 ERROR_VHD_DIFFERENCING_CHAIN_ERROR_IN_PARENT syscall.Errno = 0xC03A0019 ERROR_VIRTUAL_DISK_LIMITATION syscall.Errno = 0xC03A001A ERROR_VHD_INVALID_TYPE syscall.Errno = 0xC03A001B ERROR_VHD_INVALID_STATE syscall.Errno = 0xC03A001C ERROR_VIRTDISK_UNSUPPORTED_DISK_SECTOR_SIZE syscall.Errno = 0xC03A001D ERROR_VIRTDISK_DISK_ALREADY_OWNED syscall.Errno = 0xC03A001E ERROR_VIRTDISK_DISK_ONLINE_AND_WRITABLE syscall.Errno = 0xC03A001F ERROR_CTLOG_TRACKING_NOT_INITIALIZED syscall.Errno = 0xC03A0020 ERROR_CTLOG_LOGFILE_SIZE_EXCEEDED_MAXSIZE syscall.Errno = 0xC03A0021 ERROR_CTLOG_VHD_CHANGED_OFFLINE syscall.Errno = 0xC03A0022 ERROR_CTLOG_INVALID_TRACKING_STATE syscall.Errno = 0xC03A0023 ERROR_CTLOG_INCONSISTENT_TRACKING_FILE syscall.Errno = 0xC03A0024 ERROR_VHD_RESIZE_WOULD_TRUNCATE_DATA syscall.Errno = 0xC03A0025 ERROR_VHD_COULD_NOT_COMPUTE_MINIMUM_VIRTUAL_SIZE syscall.Errno = 0xC03A0026 ERROR_VHD_ALREADY_AT_OR_BELOW_MINIMUM_VIRTUAL_SIZE syscall.Errno = 0xC03A0027 ERROR_VHD_METADATA_FULL syscall.Errno = 0xC03A0028 ERROR_VHD_INVALID_CHANGE_TRACKING_ID syscall.Errno = 0xC03A0029 ERROR_VHD_CHANGE_TRACKING_DISABLED syscall.Errno = 0xC03A002A ERROR_VHD_MISSING_CHANGE_TRACKING_INFORMATION syscall.Errno = 0xC03A0030 ERROR_QUERY_STORAGE_ERROR syscall.Errno = 0x803A0001 HCN_E_NETWORK_NOT_FOUND Handle = 0x803B0001 HCN_E_ENDPOINT_NOT_FOUND Handle = 0x803B0002 HCN_E_LAYER_NOT_FOUND Handle = 0x803B0003 HCN_E_SWITCH_NOT_FOUND Handle = 0x803B0004 HCN_E_SUBNET_NOT_FOUND Handle = 0x803B0005 HCN_E_ADAPTER_NOT_FOUND Handle = 0x803B0006 HCN_E_PORT_NOT_FOUND Handle = 0x803B0007 HCN_E_POLICY_NOT_FOUND Handle = 0x803B0008 HCN_E_VFP_PORTSETTING_NOT_FOUND Handle = 0x803B0009 HCN_E_INVALID_NETWORK Handle = 0x803B000A HCN_E_INVALID_NETWORK_TYPE Handle = 0x803B000B HCN_E_INVALID_ENDPOINT Handle = 0x803B000C HCN_E_INVALID_POLICY Handle = 0x803B000D HCN_E_INVALID_POLICY_TYPE Handle = 0x803B000E HCN_E_INVALID_REMOTE_ENDPOINT_OPERATION Handle = 0x803B000F HCN_E_NETWORK_ALREADY_EXISTS Handle = 0x803B0010 HCN_E_LAYER_ALREADY_EXISTS Handle = 0x803B0011 HCN_E_POLICY_ALREADY_EXISTS Handle = 0x803B0012 HCN_E_PORT_ALREADY_EXISTS Handle = 0x803B0013 HCN_E_ENDPOINT_ALREADY_ATTACHED Handle = 0x803B0014 HCN_E_REQUEST_UNSUPPORTED Handle = 0x803B0015 HCN_E_MAPPING_NOT_SUPPORTED Handle = 0x803B0016 HCN_E_DEGRADED_OPERATION Handle = 0x803B0017 HCN_E_SHARED_SWITCH_MODIFICATION Handle = 0x803B0018 HCN_E_GUID_CONVERSION_FAILURE Handle = 0x803B0019 HCN_E_REGKEY_FAILURE Handle = 0x803B001A HCN_E_INVALID_JSON Handle = 0x803B001B HCN_E_INVALID_JSON_REFERENCE Handle = 0x803B001C HCN_E_ENDPOINT_SHARING_DISABLED Handle = 0x803B001D HCN_E_INVALID_IP Handle = 0x803B001E HCN_E_SWITCH_EXTENSION_NOT_FOUND Handle = 0x803B001F HCN_E_MANAGER_STOPPED Handle = 0x803B0020 GCN_E_MODULE_NOT_FOUND Handle = 0x803B0021 GCN_E_NO_REQUEST_HANDLERS Handle = 0x803B0022 GCN_E_REQUEST_UNSUPPORTED Handle = 0x803B0023 GCN_E_RUNTIMEKEYS_FAILED Handle = 0x803B0024 GCN_E_NETADAPTER_TIMEOUT Handle = 0x803B0025 GCN_E_NETADAPTER_NOT_FOUND Handle = 0x803B0026 GCN_E_NETCOMPARTMENT_NOT_FOUND Handle = 0x803B0027 GCN_E_NETINTERFACE_NOT_FOUND Handle = 0x803B0028 GCN_E_DEFAULTNAMESPACE_EXISTS Handle = 0x803B0029 HCN_E_ICS_DISABLED Handle = 0x803B002A HCN_E_ENDPOINT_NAMESPACE_ALREADY_EXISTS Handle = 0x803B002B HCN_E_ENTITY_HAS_REFERENCES Handle = 0x803B002C HCN_E_INVALID_INTERNAL_PORT Handle = 0x803B002D HCN_E_NAMESPACE_ATTACH_FAILED Handle = 0x803B002E HCN_E_ADDR_INVALID_OR_RESERVED Handle = 0x803B002F SDIAG_E_CANCELLED syscall.Errno = 0x803C0100 SDIAG_E_SCRIPT syscall.Errno = 0x803C0101 SDIAG_E_POWERSHELL syscall.Errno = 0x803C0102 SDIAG_E_MANAGEDHOST syscall.Errno = 0x803C0103 SDIAG_E_NOVERIFIER syscall.Errno = 0x803C0104 SDIAG_S_CANNOTRUN syscall.Errno = 0x003C0105 SDIAG_E_DISABLED syscall.Errno = 0x803C0106 SDIAG_E_TRUST syscall.Errno = 0x803C0107 SDIAG_E_CANNOTRUN syscall.Errno = 0x803C0108 SDIAG_E_VERSION syscall.Errno = 0x803C0109 SDIAG_E_RESOURCE syscall.Errno = 0x803C010A SDIAG_E_ROOTCAUSE syscall.Errno = 0x803C010B WPN_E_CHANNEL_CLOSED Handle = 0x803E0100 WPN_E_CHANNEL_REQUEST_NOT_COMPLETE Handle = 0x803E0101 WPN_E_INVALID_APP Handle = 0x803E0102 WPN_E_OUTSTANDING_CHANNEL_REQUEST Handle = 0x803E0103 WPN_E_DUPLICATE_CHANNEL Handle = 0x803E0104 WPN_E_PLATFORM_UNAVAILABLE Handle = 0x803E0105 WPN_E_NOTIFICATION_POSTED Handle = 0x803E0106 WPN_E_NOTIFICATION_HIDDEN Handle = 0x803E0107 WPN_E_NOTIFICATION_NOT_POSTED Handle = 0x803E0108 WPN_E_CLOUD_DISABLED Handle = 0x803E0109 WPN_E_CLOUD_INCAPABLE Handle = 0x803E0110 WPN_E_CLOUD_AUTH_UNAVAILABLE Handle = 0x803E011A WPN_E_CLOUD_SERVICE_UNAVAILABLE Handle = 0x803E011B WPN_E_FAILED_LOCK_SCREEN_UPDATE_INTIALIZATION Handle = 0x803E011C WPN_E_NOTIFICATION_DISABLED Handle = 0x803E0111 WPN_E_NOTIFICATION_INCAPABLE Handle = 0x803E0112 WPN_E_INTERNET_INCAPABLE Handle = 0x803E0113 WPN_E_NOTIFICATION_TYPE_DISABLED Handle = 0x803E0114 WPN_E_NOTIFICATION_SIZE Handle = 0x803E0115 WPN_E_TAG_SIZE Handle = 0x803E0116 WPN_E_ACCESS_DENIED Handle = 0x803E0117 WPN_E_DUPLICATE_REGISTRATION Handle = 0x803E0118 WPN_E_PUSH_NOTIFICATION_INCAPABLE Handle = 0x803E0119 WPN_E_DEV_ID_SIZE Handle = 0x803E0120 WPN_E_TAG_ALPHANUMERIC Handle = 0x803E012A WPN_E_INVALID_HTTP_STATUS_CODE Handle = 0x803E012B WPN_E_OUT_OF_SESSION Handle = 0x803E0200 WPN_E_POWER_SAVE Handle = 0x803E0201 WPN_E_IMAGE_NOT_FOUND_IN_CACHE Handle = 0x803E0202 WPN_E_ALL_URL_NOT_COMPLETED Handle = 0x803E0203 WPN_E_INVALID_CLOUD_IMAGE Handle = 0x803E0204 WPN_E_NOTIFICATION_ID_MATCHED Handle = 0x803E0205 WPN_E_CALLBACK_ALREADY_REGISTERED Handle = 0x803E0206 WPN_E_TOAST_NOTIFICATION_DROPPED Handle = 0x803E0207 WPN_E_STORAGE_LOCKED Handle = 0x803E0208 WPN_E_GROUP_SIZE Handle = 0x803E0209 WPN_E_GROUP_ALPHANUMERIC Handle = 0x803E020A WPN_E_CLOUD_DISABLED_FOR_APP Handle = 0x803E020B E_MBN_CONTEXT_NOT_ACTIVATED Handle = 0x80548201 E_MBN_BAD_SIM Handle = 0x80548202 E_MBN_DATA_CLASS_NOT_AVAILABLE Handle = 0x80548203 E_MBN_INVALID_ACCESS_STRING Handle = 0x80548204 E_MBN_MAX_ACTIVATED_CONTEXTS Handle = 0x80548205 E_MBN_PACKET_SVC_DETACHED Handle = 0x80548206 E_MBN_PROVIDER_NOT_VISIBLE Handle = 0x80548207 E_MBN_RADIO_POWER_OFF Handle = 0x80548208 E_MBN_SERVICE_NOT_ACTIVATED Handle = 0x80548209 E_MBN_SIM_NOT_INSERTED Handle = 0x8054820A E_MBN_VOICE_CALL_IN_PROGRESS Handle = 0x8054820B E_MBN_INVALID_CACHE Handle = 0x8054820C E_MBN_NOT_REGISTERED Handle = 0x8054820D E_MBN_PROVIDERS_NOT_FOUND Handle = 0x8054820E E_MBN_PIN_NOT_SUPPORTED Handle = 0x8054820F E_MBN_PIN_REQUIRED Handle = 0x80548210 E_MBN_PIN_DISABLED Handle = 0x80548211 E_MBN_FAILURE Handle = 0x80548212 E_MBN_INVALID_PROFILE Handle = 0x80548218 E_MBN_DEFAULT_PROFILE_EXIST Handle = 0x80548219 E_MBN_SMS_ENCODING_NOT_SUPPORTED Handle = 0x80548220 E_MBN_SMS_FILTER_NOT_SUPPORTED Handle = 0x80548221 E_MBN_SMS_INVALID_MEMORY_INDEX Handle = 0x80548222 E_MBN_SMS_LANG_NOT_SUPPORTED Handle = 0x80548223 E_MBN_SMS_MEMORY_FAILURE Handle = 0x80548224 E_MBN_SMS_NETWORK_TIMEOUT Handle = 0x80548225 E_MBN_SMS_UNKNOWN_SMSC_ADDRESS Handle = 0x80548226 E_MBN_SMS_FORMAT_NOT_SUPPORTED Handle = 0x80548227 E_MBN_SMS_OPERATION_NOT_ALLOWED Handle = 0x80548228 E_MBN_SMS_MEMORY_FULL Handle = 0x80548229 PEER_E_IPV6_NOT_INSTALLED Handle = 0x80630001 PEER_E_NOT_INITIALIZED Handle = 0x80630002 PEER_E_CANNOT_START_SERVICE Handle = 0x80630003 PEER_E_NOT_LICENSED Handle = 0x80630004 PEER_E_INVALID_GRAPH Handle = 0x80630010 PEER_E_DBNAME_CHANGED Handle = 0x80630011 PEER_E_DUPLICATE_GRAPH Handle = 0x80630012 PEER_E_GRAPH_NOT_READY Handle = 0x80630013 PEER_E_GRAPH_SHUTTING_DOWN Handle = 0x80630014 PEER_E_GRAPH_IN_USE Handle = 0x80630015 PEER_E_INVALID_DATABASE Handle = 0x80630016 PEER_E_TOO_MANY_ATTRIBUTES Handle = 0x80630017 PEER_E_CONNECTION_NOT_FOUND Handle = 0x80630103 PEER_E_CONNECT_SELF Handle = 0x80630106 PEER_E_ALREADY_LISTENING Handle = 0x80630107 PEER_E_NODE_NOT_FOUND Handle = 0x80630108 PEER_E_CONNECTION_FAILED Handle = 0x80630109 PEER_E_CONNECTION_NOT_AUTHENTICATED Handle = 0x8063010A PEER_E_CONNECTION_REFUSED Handle = 0x8063010B PEER_E_CLASSIFIER_TOO_LONG Handle = 0x80630201 PEER_E_TOO_MANY_IDENTITIES Handle = 0x80630202 PEER_E_NO_KEY_ACCESS Handle = 0x80630203 PEER_E_GROUPS_EXIST Handle = 0x80630204 PEER_E_RECORD_NOT_FOUND Handle = 0x80630301 PEER_E_DATABASE_ACCESSDENIED Handle = 0x80630302 PEER_E_DBINITIALIZATION_FAILED Handle = 0x80630303 PEER_E_MAX_RECORD_SIZE_EXCEEDED Handle = 0x80630304 PEER_E_DATABASE_ALREADY_PRESENT Handle = 0x80630305 PEER_E_DATABASE_NOT_PRESENT Handle = 0x80630306 PEER_E_IDENTITY_NOT_FOUND Handle = 0x80630401 PEER_E_EVENT_HANDLE_NOT_FOUND Handle = 0x80630501 PEER_E_INVALID_SEARCH Handle = 0x80630601 PEER_E_INVALID_ATTRIBUTES Handle = 0x80630602 PEER_E_INVITATION_NOT_TRUSTED Handle = 0x80630701 PEER_E_CHAIN_TOO_LONG Handle = 0x80630703 PEER_E_INVALID_TIME_PERIOD Handle = 0x80630705 PEER_E_CIRCULAR_CHAIN_DETECTED Handle = 0x80630706 PEER_E_CERT_STORE_CORRUPTED Handle = 0x80630801 PEER_E_NO_CLOUD Handle = 0x80631001 PEER_E_CLOUD_NAME_AMBIGUOUS Handle = 0x80631005 PEER_E_INVALID_RECORD Handle = 0x80632010 PEER_E_NOT_AUTHORIZED Handle = 0x80632020 PEER_E_PASSWORD_DOES_NOT_MEET_POLICY Handle = 0x80632021 PEER_E_DEFERRED_VALIDATION Handle = 0x80632030 PEER_E_INVALID_GROUP_PROPERTIES Handle = 0x80632040 PEER_E_INVALID_PEER_NAME Handle = 0x80632050 PEER_E_INVALID_CLASSIFIER Handle = 0x80632060 PEER_E_INVALID_FRIENDLY_NAME Handle = 0x80632070 PEER_E_INVALID_ROLE_PROPERTY Handle = 0x80632071 PEER_E_INVALID_CLASSIFIER_PROPERTY Handle = 0x80632072 PEER_E_INVALID_RECORD_EXPIRATION Handle = 0x80632080 PEER_E_INVALID_CREDENTIAL_INFO Handle = 0x80632081 PEER_E_INVALID_CREDENTIAL Handle = 0x80632082 PEER_E_INVALID_RECORD_SIZE Handle = 0x80632083 PEER_E_UNSUPPORTED_VERSION Handle = 0x80632090 PEER_E_GROUP_NOT_READY Handle = 0x80632091 PEER_E_GROUP_IN_USE Handle = 0x80632092 PEER_E_INVALID_GROUP Handle = 0x80632093 PEER_E_NO_MEMBERS_FOUND Handle = 0x80632094 PEER_E_NO_MEMBER_CONNECTIONS Handle = 0x80632095 PEER_E_UNABLE_TO_LISTEN Handle = 0x80632096 PEER_E_IDENTITY_DELETED Handle = 0x806320A0 PEER_E_SERVICE_NOT_AVAILABLE Handle = 0x806320A1 PEER_E_CONTACT_NOT_FOUND Handle = 0x80636001 PEER_S_GRAPH_DATA_CREATED Handle = 0x00630001 PEER_S_NO_EVENT_DATA Handle = 0x00630002 PEER_S_ALREADY_CONNECTED Handle = 0x00632000 PEER_S_SUBSCRIPTION_EXISTS Handle = 0x00636000 PEER_S_NO_CONNECTIVITY Handle = 0x00630005 PEER_S_ALREADY_A_MEMBER Handle = 0x00630006 PEER_E_CANNOT_CONVERT_PEER_NAME Handle = 0x80634001 PEER_E_INVALID_PEER_HOST_NAME Handle = 0x80634002 PEER_E_NO_MORE Handle = 0x80634003 PEER_E_PNRP_DUPLICATE_PEER_NAME Handle = 0x80634005 PEER_E_INVITE_CANCELLED Handle = 0x80637000 PEER_E_INVITE_RESPONSE_NOT_AVAILABLE Handle = 0x80637001 PEER_E_NOT_SIGNED_IN Handle = 0x80637003 PEER_E_PRIVACY_DECLINED Handle = 0x80637004 PEER_E_TIMEOUT Handle = 0x80637005 PEER_E_INVALID_ADDRESS Handle = 0x80637007 PEER_E_FW_EXCEPTION_DISABLED Handle = 0x80637008 PEER_E_FW_BLOCKED_BY_POLICY Handle = 0x80637009 PEER_E_FW_BLOCKED_BY_SHIELDS_UP Handle = 0x8063700A PEER_E_FW_DECLINED Handle = 0x8063700B UI_E_CREATE_FAILED Handle = 0x802A0001 UI_E_SHUTDOWN_CALLED Handle = 0x802A0002 UI_E_ILLEGAL_REENTRANCY Handle = 0x802A0003 UI_E_OBJECT_SEALED Handle = 0x802A0004 UI_E_VALUE_NOT_SET Handle = 0x802A0005 UI_E_VALUE_NOT_DETERMINED Handle = 0x802A0006 UI_E_INVALID_OUTPUT Handle = 0x802A0007 UI_E_BOOLEAN_EXPECTED Handle = 0x802A0008 UI_E_DIFFERENT_OWNER Handle = 0x802A0009 UI_E_AMBIGUOUS_MATCH Handle = 0x802A000A UI_E_FP_OVERFLOW Handle = 0x802A000B UI_E_WRONG_THREAD Handle = 0x802A000C UI_E_STORYBOARD_ACTIVE Handle = 0x802A0101 UI_E_STORYBOARD_NOT_PLAYING Handle = 0x802A0102 UI_E_START_KEYFRAME_AFTER_END Handle = 0x802A0103 UI_E_END_KEYFRAME_NOT_DETERMINED Handle = 0x802A0104 UI_E_LOOPS_OVERLAP Handle = 0x802A0105 UI_E_TRANSITION_ALREADY_USED Handle = 0x802A0106 UI_E_TRANSITION_NOT_IN_STORYBOARD Handle = 0x802A0107 UI_E_TRANSITION_ECLIPSED Handle = 0x802A0108 UI_E_TIME_BEFORE_LAST_UPDATE Handle = 0x802A0109 UI_E_TIMER_CLIENT_ALREADY_CONNECTED Handle = 0x802A010A UI_E_INVALID_DIMENSION Handle = 0x802A010B UI_E_PRIMITIVE_OUT_OF_BOUNDS Handle = 0x802A010C UI_E_WINDOW_CLOSED Handle = 0x802A0201 E_BLUETOOTH_ATT_INVALID_HANDLE Handle = 0x80650001 E_BLUETOOTH_ATT_READ_NOT_PERMITTED Handle = 0x80650002 E_BLUETOOTH_ATT_WRITE_NOT_PERMITTED Handle = 0x80650003 E_BLUETOOTH_ATT_INVALID_PDU Handle = 0x80650004 E_BLUETOOTH_ATT_INSUFFICIENT_AUTHENTICATION Handle = 0x80650005 E_BLUETOOTH_ATT_REQUEST_NOT_SUPPORTED Handle = 0x80650006 E_BLUETOOTH_ATT_INVALID_OFFSET Handle = 0x80650007 E_BLUETOOTH_ATT_INSUFFICIENT_AUTHORIZATION Handle = 0x80650008 E_BLUETOOTH_ATT_PREPARE_QUEUE_FULL Handle = 0x80650009 E_BLUETOOTH_ATT_ATTRIBUTE_NOT_FOUND Handle = 0x8065000A E_BLUETOOTH_ATT_ATTRIBUTE_NOT_LONG Handle = 0x8065000B E_BLUETOOTH_ATT_INSUFFICIENT_ENCRYPTION_KEY_SIZE Handle = 0x8065000C E_BLUETOOTH_ATT_INVALID_ATTRIBUTE_VALUE_LENGTH Handle = 0x8065000D E_BLUETOOTH_ATT_UNLIKELY Handle = 0x8065000E E_BLUETOOTH_ATT_INSUFFICIENT_ENCRYPTION Handle = 0x8065000F E_BLUETOOTH_ATT_UNSUPPORTED_GROUP_TYPE Handle = 0x80650010 E_BLUETOOTH_ATT_INSUFFICIENT_RESOURCES Handle = 0x80650011 E_BLUETOOTH_ATT_UNKNOWN_ERROR Handle = 0x80651000 E_AUDIO_ENGINE_NODE_NOT_FOUND Handle = 0x80660001 E_HDAUDIO_EMPTY_CONNECTION_LIST Handle = 0x80660002 E_HDAUDIO_CONNECTION_LIST_NOT_SUPPORTED Handle = 0x80660003 E_HDAUDIO_NO_LOGICAL_DEVICES_CREATED Handle = 0x80660004 E_HDAUDIO_NULL_LINKED_LIST_ENTRY Handle = 0x80660005 STATEREPOSITORY_E_CONCURRENCY_LOCKING_FAILURE Handle = 0x80670001 STATEREPOSITORY_E_STATEMENT_INPROGRESS Handle = 0x80670002 STATEREPOSITORY_E_CONFIGURATION_INVALID Handle = 0x80670003 STATEREPOSITORY_E_UNKNOWN_SCHEMA_VERSION Handle = 0x80670004 STATEREPOSITORY_ERROR_DICTIONARY_CORRUPTED Handle = 0x80670005 STATEREPOSITORY_E_BLOCKED Handle = 0x80670006 STATEREPOSITORY_E_BUSY_RETRY Handle = 0x80670007 STATEREPOSITORY_E_BUSY_RECOVERY_RETRY Handle = 0x80670008 STATEREPOSITORY_E_LOCKED_RETRY Handle = 0x80670009 STATEREPOSITORY_E_LOCKED_SHAREDCACHE_RETRY Handle = 0x8067000A STATEREPOSITORY_E_TRANSACTION_REQUIRED Handle = 0x8067000B STATEREPOSITORY_E_BUSY_TIMEOUT_EXCEEDED Handle = 0x8067000C STATEREPOSITORY_E_BUSY_RECOVERY_TIMEOUT_EXCEEDED Handle = 0x8067000D STATEREPOSITORY_E_LOCKED_TIMEOUT_EXCEEDED Handle = 0x8067000E STATEREPOSITORY_E_LOCKED_SHAREDCACHE_TIMEOUT_EXCEEDED Handle = 0x8067000F STATEREPOSITORY_E_SERVICE_STOP_IN_PROGRESS Handle = 0x80670010 STATEREPOSTORY_E_NESTED_TRANSACTION_NOT_SUPPORTED Handle = 0x80670011 STATEREPOSITORY_ERROR_CACHE_CORRUPTED Handle = 0x80670012 STATEREPOSITORY_TRANSACTION_CALLER_ID_CHANGED Handle = 0x00670013 STATEREPOSITORY_TRANSACTION_IN_PROGRESS Handle = 0x00670014 ERROR_SPACES_POOL_WAS_DELETED Handle = 0x00E70001 ERROR_SPACES_FAULT_DOMAIN_TYPE_INVALID Handle = 0x80E70001 ERROR_SPACES_INTERNAL_ERROR Handle = 0x80E70002 ERROR_SPACES_RESILIENCY_TYPE_INVALID Handle = 0x80E70003 ERROR_SPACES_DRIVE_SECTOR_SIZE_INVALID Handle = 0x80E70004 ERROR_SPACES_DRIVE_REDUNDANCY_INVALID Handle = 0x80E70006 ERROR_SPACES_NUMBER_OF_DATA_COPIES_INVALID Handle = 0x80E70007 ERROR_SPACES_PARITY_LAYOUT_INVALID Handle = 0x80E70008 ERROR_SPACES_INTERLEAVE_LENGTH_INVALID Handle = 0x80E70009 ERROR_SPACES_NUMBER_OF_COLUMNS_INVALID Handle = 0x80E7000A ERROR_SPACES_NOT_ENOUGH_DRIVES Handle = 0x80E7000B ERROR_SPACES_EXTENDED_ERROR Handle = 0x80E7000C ERROR_SPACES_PROVISIONING_TYPE_INVALID Handle = 0x80E7000D ERROR_SPACES_ALLOCATION_SIZE_INVALID Handle = 0x80E7000E ERROR_SPACES_ENCLOSURE_AWARE_INVALID Handle = 0x80E7000F ERROR_SPACES_WRITE_CACHE_SIZE_INVALID Handle = 0x80E70010 ERROR_SPACES_NUMBER_OF_GROUPS_INVALID Handle = 0x80E70011 ERROR_SPACES_DRIVE_OPERATIONAL_STATE_INVALID Handle = 0x80E70012 ERROR_SPACES_ENTRY_INCOMPLETE Handle = 0x80E70013 ERROR_SPACES_ENTRY_INVALID Handle = 0x80E70014 ERROR_VOLSNAP_BOOTFILE_NOT_VALID Handle = 0x80820001 ERROR_VOLSNAP_ACTIVATION_TIMEOUT Handle = 0x80820002 ERROR_TIERING_NOT_SUPPORTED_ON_VOLUME Handle = 0x80830001 ERROR_TIERING_VOLUME_DISMOUNT_IN_PROGRESS Handle = 0x80830002 ERROR_TIERING_STORAGE_TIER_NOT_FOUND Handle = 0x80830003 ERROR_TIERING_INVALID_FILE_ID Handle = 0x80830004 ERROR_TIERING_WRONG_CLUSTER_NODE Handle = 0x80830005 ERROR_TIERING_ALREADY_PROCESSING Handle = 0x80830006 ERROR_TIERING_CANNOT_PIN_OBJECT Handle = 0x80830007 ERROR_TIERING_FILE_IS_NOT_PINNED Handle = 0x80830008 ERROR_NOT_A_TIERED_VOLUME Handle = 0x80830009 ERROR_ATTRIBUTE_NOT_PRESENT Handle = 0x8083000A ERROR_SECCORE_INVALID_COMMAND Handle = 0xC0E80000 ERROR_NO_APPLICABLE_APP_LICENSES_FOUND Handle = 0xC0EA0001 ERROR_CLIP_LICENSE_NOT_FOUND Handle = 0xC0EA0002 ERROR_CLIP_DEVICE_LICENSE_MISSING Handle = 0xC0EA0003 ERROR_CLIP_LICENSE_INVALID_SIGNATURE Handle = 0xC0EA0004 ERROR_CLIP_KEYHOLDER_LICENSE_MISSING_OR_INVALID Handle = 0xC0EA0005 ERROR_CLIP_LICENSE_EXPIRED Handle = 0xC0EA0006 ERROR_CLIP_LICENSE_SIGNED_BY_UNKNOWN_SOURCE Handle = 0xC0EA0007 ERROR_CLIP_LICENSE_NOT_SIGNED Handle = 0xC0EA0008 ERROR_CLIP_LICENSE_HARDWARE_ID_OUT_OF_TOLERANCE Handle = 0xC0EA0009 ERROR_CLIP_LICENSE_DEVICE_ID_MISMATCH Handle = 0xC0EA000A DXGI_STATUS_OCCLUDED Handle = 0x087A0001 DXGI_STATUS_CLIPPED Handle = 0x087A0002 DXGI_STATUS_NO_REDIRECTION Handle = 0x087A0004 DXGI_STATUS_NO_DESKTOP_ACCESS Handle = 0x087A0005 DXGI_STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE Handle = 0x087A0006 DXGI_STATUS_MODE_CHANGED Handle = 0x087A0007 DXGI_STATUS_MODE_CHANGE_IN_PROGRESS Handle = 0x087A0008 DXGI_ERROR_INVALID_CALL Handle = 0x887A0001 DXGI_ERROR_NOT_FOUND Handle = 0x887A0002 DXGI_ERROR_MORE_DATA Handle = 0x887A0003 DXGI_ERROR_UNSUPPORTED Handle = 0x887A0004 DXGI_ERROR_DEVICE_REMOVED Handle = 0x887A0005 DXGI_ERROR_DEVICE_HUNG Handle = 0x887A0006 DXGI_ERROR_DEVICE_RESET Handle = 0x887A0007 DXGI_ERROR_WAS_STILL_DRAWING Handle = 0x887A000A DXGI_ERROR_FRAME_STATISTICS_DISJOINT Handle = 0x887A000B DXGI_ERROR_GRAPHICS_VIDPN_SOURCE_IN_USE Handle = 0x887A000C DXGI_ERROR_DRIVER_INTERNAL_ERROR Handle = 0x887A0020 DXGI_ERROR_NONEXCLUSIVE Handle = 0x887A0021 DXGI_ERROR_NOT_CURRENTLY_AVAILABLE Handle = 0x887A0022 DXGI_ERROR_REMOTE_CLIENT_DISCONNECTED Handle = 0x887A0023 DXGI_ERROR_REMOTE_OUTOFMEMORY Handle = 0x887A0024 DXGI_ERROR_ACCESS_LOST Handle = 0x887A0026 DXGI_ERROR_WAIT_TIMEOUT Handle = 0x887A0027 DXGI_ERROR_SESSION_DISCONNECTED Handle = 0x887A0028 DXGI_ERROR_RESTRICT_TO_OUTPUT_STALE Handle = 0x887A0029 DXGI_ERROR_CANNOT_PROTECT_CONTENT Handle = 0x887A002A DXGI_ERROR_ACCESS_DENIED Handle = 0x887A002B DXGI_ERROR_NAME_ALREADY_EXISTS Handle = 0x887A002C DXGI_ERROR_SDK_COMPONENT_MISSING Handle = 0x887A002D DXGI_ERROR_NOT_CURRENT Handle = 0x887A002E DXGI_ERROR_HW_PROTECTION_OUTOFMEMORY Handle = 0x887A0030 DXGI_ERROR_DYNAMIC_CODE_POLICY_VIOLATION Handle = 0x887A0031 DXGI_ERROR_NON_COMPOSITED_UI Handle = 0x887A0032 DXGI_STATUS_UNOCCLUDED Handle = 0x087A0009 DXGI_STATUS_DDA_WAS_STILL_DRAWING Handle = 0x087A000A DXGI_ERROR_MODE_CHANGE_IN_PROGRESS Handle = 0x887A0025 DXGI_STATUS_PRESENT_REQUIRED Handle = 0x087A002F DXGI_ERROR_CACHE_CORRUPT Handle = 0x887A0033 DXGI_ERROR_CACHE_FULL Handle = 0x887A0034 DXGI_ERROR_CACHE_HASH_COLLISION Handle = 0x887A0035 DXGI_ERROR_ALREADY_EXISTS Handle = 0x887A0036 DXGI_DDI_ERR_WASSTILLDRAWING Handle = 0x887B0001 DXGI_DDI_ERR_UNSUPPORTED Handle = 0x887B0002 DXGI_DDI_ERR_NONEXCLUSIVE Handle = 0x887B0003 D3D10_ERROR_TOO_MANY_UNIQUE_STATE_OBJECTS Handle = 0x88790001 D3D10_ERROR_FILE_NOT_FOUND Handle = 0x88790002 D3D11_ERROR_TOO_MANY_UNIQUE_STATE_OBJECTS Handle = 0x887C0001 D3D11_ERROR_FILE_NOT_FOUND Handle = 0x887C0002 D3D11_ERROR_TOO_MANY_UNIQUE_VIEW_OBJECTS Handle = 0x887C0003 D3D11_ERROR_DEFERRED_CONTEXT_MAP_WITHOUT_INITIAL_DISCARD Handle = 0x887C0004 D3D12_ERROR_ADAPTER_NOT_FOUND Handle = 0x887E0001 D3D12_ERROR_DRIVER_VERSION_MISMATCH Handle = 0x887E0002 D2DERR_WRONG_STATE Handle = 0x88990001 D2DERR_NOT_INITIALIZED Handle = 0x88990002 D2DERR_UNSUPPORTED_OPERATION Handle = 0x88990003 D2DERR_SCANNER_FAILED Handle = 0x88990004 D2DERR_SCREEN_ACCESS_DENIED Handle = 0x88990005 D2DERR_DISPLAY_STATE_INVALID Handle = 0x88990006 D2DERR_ZERO_VECTOR Handle = 0x88990007 D2DERR_INTERNAL_ERROR Handle = 0x88990008 D2DERR_DISPLAY_FORMAT_NOT_SUPPORTED Handle = 0x88990009 D2DERR_INVALID_CALL Handle = 0x8899000A D2DERR_NO_HARDWARE_DEVICE Handle = 0x8899000B D2DERR_RECREATE_TARGET Handle = 0x8899000C D2DERR_TOO_MANY_SHADER_ELEMENTS Handle = 0x8899000D D2DERR_SHADER_COMPILE_FAILED Handle = 0x8899000E D2DERR_MAX_TEXTURE_SIZE_EXCEEDED Handle = 0x8899000F D2DERR_UNSUPPORTED_VERSION Handle = 0x88990010 D2DERR_BAD_NUMBER Handle = 0x88990011 D2DERR_WRONG_FACTORY Handle = 0x88990012 D2DERR_LAYER_ALREADY_IN_USE Handle = 0x88990013 D2DERR_POP_CALL_DID_NOT_MATCH_PUSH Handle = 0x88990014 D2DERR_WRONG_RESOURCE_DOMAIN Handle = 0x88990015 D2DERR_PUSH_POP_UNBALANCED Handle = 0x88990016 D2DERR_RENDER_TARGET_HAS_LAYER_OR_CLIPRECT Handle = 0x88990017 D2DERR_INCOMPATIBLE_BRUSH_TYPES Handle = 0x88990018 D2DERR_WIN32_ERROR Handle = 0x88990019 D2DERR_TARGET_NOT_GDI_COMPATIBLE Handle = 0x8899001A D2DERR_TEXT_EFFECT_IS_WRONG_TYPE Handle = 0x8899001B D2DERR_TEXT_RENDERER_NOT_RELEASED Handle = 0x8899001C D2DERR_EXCEEDS_MAX_BITMAP_SIZE Handle = 0x8899001D D2DERR_INVALID_GRAPH_CONFIGURATION Handle = 0x8899001E D2DERR_INVALID_INTERNAL_GRAPH_CONFIGURATION Handle = 0x8899001F D2DERR_CYCLIC_GRAPH Handle = 0x88990020 D2DERR_BITMAP_CANNOT_DRAW Handle = 0x88990021 D2DERR_OUTSTANDING_BITMAP_REFERENCES Handle = 0x88990022 D2DERR_ORIGINAL_TARGET_NOT_BOUND Handle = 0x88990023 D2DERR_INVALID_TARGET Handle = 0x88990024 D2DERR_BITMAP_BOUND_AS_TARGET Handle = 0x88990025 D2DERR_INSUFFICIENT_DEVICE_CAPABILITIES Handle = 0x88990026 D2DERR_INTERMEDIATE_TOO_LARGE Handle = 0x88990027 D2DERR_EFFECT_IS_NOT_REGISTERED Handle = 0x88990028 D2DERR_INVALID_PROPERTY Handle = 0x88990029 D2DERR_NO_SUBPROPERTIES Handle = 0x8899002A D2DERR_PRINT_JOB_CLOSED Handle = 0x8899002B D2DERR_PRINT_FORMAT_NOT_SUPPORTED Handle = 0x8899002C D2DERR_TOO_MANY_TRANSFORM_INPUTS Handle = 0x8899002D D2DERR_INVALID_GLYPH_IMAGE Handle = 0x8899002E DWRITE_E_FILEFORMAT Handle = 0x88985000 DWRITE_E_UNEXPECTED Handle = 0x88985001 DWRITE_E_NOFONT Handle = 0x88985002 DWRITE_E_FILENOTFOUND Handle = 0x88985003 DWRITE_E_FILEACCESS Handle = 0x88985004 DWRITE_E_FONTCOLLECTIONOBSOLETE Handle = 0x88985005 DWRITE_E_ALREADYREGISTERED Handle = 0x88985006 DWRITE_E_CACHEFORMAT Handle = 0x88985007 DWRITE_E_CACHEVERSION Handle = 0x88985008 DWRITE_E_UNSUPPORTEDOPERATION Handle = 0x88985009 DWRITE_E_TEXTRENDERERINCOMPATIBLE Handle = 0x8898500A DWRITE_E_FLOWDIRECTIONCONFLICTS Handle = 0x8898500B DWRITE_E_NOCOLOR Handle = 0x8898500C DWRITE_E_REMOTEFONT Handle = 0x8898500D DWRITE_E_DOWNLOADCANCELLED Handle = 0x8898500E DWRITE_E_DOWNLOADFAILED Handle = 0x8898500F DWRITE_E_TOOMANYDOWNLOADS Handle = 0x88985010 WINCODEC_ERR_WRONGSTATE Handle = 0x88982F04 WINCODEC_ERR_VALUEOUTOFRANGE Handle = 0x88982F05 WINCODEC_ERR_UNKNOWNIMAGEFORMAT Handle = 0x88982F07 WINCODEC_ERR_UNSUPPORTEDVERSION Handle = 0x88982F0B WINCODEC_ERR_NOTINITIALIZED Handle = 0x88982F0C WINCODEC_ERR_ALREADYLOCKED Handle = 0x88982F0D WINCODEC_ERR_PROPERTYNOTFOUND Handle = 0x88982F40 WINCODEC_ERR_PROPERTYNOTSUPPORTED Handle = 0x88982F41 WINCODEC_ERR_PROPERTYSIZE Handle = 0x88982F42 WINCODEC_ERR_CODECPRESENT Handle = 0x88982F43 WINCODEC_ERR_CODECNOTHUMBNAIL Handle = 0x88982F44 WINCODEC_ERR_PALETTEUNAVAILABLE Handle = 0x88982F45 WINCODEC_ERR_CODECTOOMANYSCANLINES Handle = 0x88982F46 WINCODEC_ERR_INTERNALERROR Handle = 0x88982F48 WINCODEC_ERR_SOURCERECTDOESNOTMATCHDIMENSIONS Handle = 0x88982F49 WINCODEC_ERR_COMPONENTNOTFOUND Handle = 0x88982F50 WINCODEC_ERR_IMAGESIZEOUTOFRANGE Handle = 0x88982F51 WINCODEC_ERR_TOOMUCHMETADATA Handle = 0x88982F52 WINCODEC_ERR_BADIMAGE Handle = 0x88982F60 WINCODEC_ERR_BADHEADER Handle = 0x88982F61 WINCODEC_ERR_FRAMEMISSING Handle = 0x88982F62 WINCODEC_ERR_BADMETADATAHEADER Handle = 0x88982F63 WINCODEC_ERR_BADSTREAMDATA Handle = 0x88982F70 WINCODEC_ERR_STREAMWRITE Handle = 0x88982F71 WINCODEC_ERR_STREAMREAD Handle = 0x88982F72 WINCODEC_ERR_STREAMNOTAVAILABLE Handle = 0x88982F73 WINCODEC_ERR_UNSUPPORTEDPIXELFORMAT Handle = 0x88982F80 WINCODEC_ERR_UNSUPPORTEDOPERATION Handle = 0x88982F81 WINCODEC_ERR_INVALIDREGISTRATION Handle = 0x88982F8A WINCODEC_ERR_COMPONENTINITIALIZEFAILURE Handle = 0x88982F8B WINCODEC_ERR_INSUFFICIENTBUFFER Handle = 0x88982F8C WINCODEC_ERR_DUPLICATEMETADATAPRESENT Handle = 0x88982F8D WINCODEC_ERR_PROPERTYUNEXPECTEDTYPE Handle = 0x88982F8E WINCODEC_ERR_UNEXPECTEDSIZE Handle = 0x88982F8F WINCODEC_ERR_INVALIDQUERYREQUEST Handle = 0x88982F90 WINCODEC_ERR_UNEXPECTEDMETADATATYPE Handle = 0x88982F91 WINCODEC_ERR_REQUESTONLYVALIDATMETADATAROOT Handle = 0x88982F92 WINCODEC_ERR_INVALIDQUERYCHARACTER Handle = 0x88982F93 WINCODEC_ERR_WIN32ERROR Handle = 0x88982F94 WINCODEC_ERR_INVALIDPROGRESSIVELEVEL Handle = 0x88982F95 WINCODEC_ERR_INVALIDJPEGSCANINDEX Handle = 0x88982F96 MILERR_OBJECTBUSY Handle = 0x88980001 MILERR_INSUFFICIENTBUFFER Handle = 0x88980002 MILERR_WIN32ERROR Handle = 0x88980003 MILERR_SCANNER_FAILED Handle = 0x88980004 MILERR_SCREENACCESSDENIED Handle = 0x88980005 MILERR_DISPLAYSTATEINVALID Handle = 0x88980006 MILERR_NONINVERTIBLEMATRIX Handle = 0x88980007 MILERR_ZEROVECTOR Handle = 0x88980008 MILERR_TERMINATED Handle = 0x88980009 MILERR_BADNUMBER Handle = 0x8898000A MILERR_INTERNALERROR Handle = 0x88980080 MILERR_DISPLAYFORMATNOTSUPPORTED Handle = 0x88980084 MILERR_INVALIDCALL Handle = 0x88980085 MILERR_ALREADYLOCKED Handle = 0x88980086 MILERR_NOTLOCKED Handle = 0x88980087 MILERR_DEVICECANNOTRENDERTEXT Handle = 0x88980088 MILERR_GLYPHBITMAPMISSED Handle = 0x88980089 MILERR_MALFORMEDGLYPHCACHE Handle = 0x8898008A MILERR_GENERIC_IGNORE Handle = 0x8898008B MILERR_MALFORMED_GUIDELINE_DATA Handle = 0x8898008C MILERR_NO_HARDWARE_DEVICE Handle = 0x8898008D MILERR_NEED_RECREATE_AND_PRESENT Handle = 0x8898008E MILERR_ALREADY_INITIALIZED Handle = 0x8898008F MILERR_MISMATCHED_SIZE Handle = 0x88980090 MILERR_NO_REDIRECTION_SURFACE_AVAILABLE Handle = 0x88980091 MILERR_REMOTING_NOT_SUPPORTED Handle = 0x88980092 MILERR_QUEUED_PRESENT_NOT_SUPPORTED Handle = 0x88980093 MILERR_NOT_QUEUING_PRESENTS Handle = 0x88980094 MILERR_NO_REDIRECTION_SURFACE_RETRY_LATER Handle = 0x88980095 MILERR_TOOMANYSHADERELEMNTS Handle = 0x88980096 MILERR_MROW_READLOCK_FAILED Handle = 0x88980097 MILERR_MROW_UPDATE_FAILED Handle = 0x88980098 MILERR_SHADER_COMPILE_FAILED Handle = 0x88980099 MILERR_MAX_TEXTURE_SIZE_EXCEEDED Handle = 0x8898009A MILERR_QPC_TIME_WENT_BACKWARD Handle = 0x8898009B MILERR_DXGI_ENUMERATION_OUT_OF_SYNC Handle = 0x8898009D MILERR_ADAPTER_NOT_FOUND Handle = 0x8898009E MILERR_COLORSPACE_NOT_SUPPORTED Handle = 0x8898009F MILERR_PREFILTER_NOT_SUPPORTED Handle = 0x889800A0 MILERR_DISPLAYID_ACCESS_DENIED Handle = 0x889800A1 UCEERR_INVALIDPACKETHEADER Handle = 0x88980400 UCEERR_UNKNOWNPACKET Handle = 0x88980401 UCEERR_ILLEGALPACKET Handle = 0x88980402 UCEERR_MALFORMEDPACKET Handle = 0x88980403 UCEERR_ILLEGALHANDLE Handle = 0x88980404 UCEERR_HANDLELOOKUPFAILED Handle = 0x88980405 UCEERR_RENDERTHREADFAILURE Handle = 0x88980406 UCEERR_CTXSTACKFRSTTARGETNULL Handle = 0x88980407 UCEERR_CONNECTIONIDLOOKUPFAILED Handle = 0x88980408 UCEERR_BLOCKSFULL Handle = 0x88980409 UCEERR_MEMORYFAILURE Handle = 0x8898040A UCEERR_PACKETRECORDOUTOFRANGE Handle = 0x8898040B UCEERR_ILLEGALRECORDTYPE Handle = 0x8898040C UCEERR_OUTOFHANDLES Handle = 0x8898040D UCEERR_UNCHANGABLE_UPDATE_ATTEMPTED Handle = 0x8898040E UCEERR_NO_MULTIPLE_WORKER_THREADS Handle = 0x8898040F UCEERR_REMOTINGNOTSUPPORTED Handle = 0x88980410 UCEERR_MISSINGENDCOMMAND Handle = 0x88980411 UCEERR_MISSINGBEGINCOMMAND Handle = 0x88980412 UCEERR_CHANNELSYNCTIMEDOUT Handle = 0x88980413 UCEERR_CHANNELSYNCABANDONED Handle = 0x88980414 UCEERR_UNSUPPORTEDTRANSPORTVERSION Handle = 0x88980415 UCEERR_TRANSPORTUNAVAILABLE Handle = 0x88980416 UCEERR_FEEDBACK_UNSUPPORTED Handle = 0x88980417 UCEERR_COMMANDTRANSPORTDENIED Handle = 0x88980418 UCEERR_GRAPHICSSTREAMUNAVAILABLE Handle = 0x88980419 UCEERR_GRAPHICSSTREAMALREADYOPEN Handle = 0x88980420 UCEERR_TRANSPORTDISCONNECTED Handle = 0x88980421 UCEERR_TRANSPORTOVERLOADED Handle = 0x88980422 UCEERR_PARTITION_ZOMBIED Handle = 0x88980423 MILAVERR_NOCLOCK Handle = 0x88980500 MILAVERR_NOMEDIATYPE Handle = 0x88980501 MILAVERR_NOVIDEOMIXER Handle = 0x88980502 MILAVERR_NOVIDEOPRESENTER Handle = 0x88980503 MILAVERR_NOREADYFRAMES Handle = 0x88980504 MILAVERR_MODULENOTLOADED Handle = 0x88980505 MILAVERR_WMPFACTORYNOTREGISTERED Handle = 0x88980506 MILAVERR_INVALIDWMPVERSION Handle = 0x88980507 MILAVERR_INSUFFICIENTVIDEORESOURCES Handle = 0x88980508 MILAVERR_VIDEOACCELERATIONNOTAVAILABLE Handle = 0x88980509 MILAVERR_REQUESTEDTEXTURETOOBIG Handle = 0x8898050A MILAVERR_SEEKFAILED Handle = 0x8898050B MILAVERR_UNEXPECTEDWMPFAILURE Handle = 0x8898050C MILAVERR_MEDIAPLAYERCLOSED Handle = 0x8898050D MILAVERR_UNKNOWNHARDWAREERROR Handle = 0x8898050E MILEFFECTSERR_UNKNOWNPROPERTY Handle = 0x8898060E MILEFFECTSERR_EFFECTNOTPARTOFGROUP Handle = 0x8898060F MILEFFECTSERR_NOINPUTSOURCEATTACHED Handle = 0x88980610 MILEFFECTSERR_CONNECTORNOTCONNECTED Handle = 0x88980611 MILEFFECTSERR_CONNECTORNOTASSOCIATEDWITHEFFECT Handle = 0x88980612 MILEFFECTSERR_RESERVED Handle = 0x88980613 MILEFFECTSERR_CYCLEDETECTED Handle = 0x88980614 MILEFFECTSERR_EFFECTINMORETHANONEGRAPH Handle = 0x88980615 MILEFFECTSERR_EFFECTALREADYINAGRAPH Handle = 0x88980616 MILEFFECTSERR_EFFECTHASNOCHILDREN Handle = 0x88980617 MILEFFECTSERR_ALREADYATTACHEDTOLISTENER Handle = 0x88980618 MILEFFECTSERR_NOTAFFINETRANSFORM Handle = 0x88980619 MILEFFECTSERR_EMPTYBOUNDS Handle = 0x8898061A MILEFFECTSERR_OUTPUTSIZETOOLARGE Handle = 0x8898061B DWMERR_STATE_TRANSITION_FAILED Handle = 0x88980700 DWMERR_THEME_FAILED Handle = 0x88980701 DWMERR_CATASTROPHIC_FAILURE Handle = 0x88980702 DCOMPOSITION_ERROR_WINDOW_ALREADY_COMPOSED Handle = 0x88980800 DCOMPOSITION_ERROR_SURFACE_BEING_RENDERED Handle = 0x88980801 DCOMPOSITION_ERROR_SURFACE_NOT_BEING_RENDERED Handle = 0x88980802 ONL_E_INVALID_AUTHENTICATION_TARGET Handle = 0x80860001 ONL_E_ACCESS_DENIED_BY_TOU Handle = 0x80860002 ONL_E_INVALID_APPLICATION Handle = 0x80860003 ONL_E_PASSWORD_UPDATE_REQUIRED Handle = 0x80860004 ONL_E_ACCOUNT_UPDATE_REQUIRED Handle = 0x80860005 ONL_E_FORCESIGNIN Handle = 0x80860006 ONL_E_ACCOUNT_LOCKED Handle = 0x80860007 ONL_E_PARENTAL_CONSENT_REQUIRED Handle = 0x80860008 ONL_E_EMAIL_VERIFICATION_REQUIRED Handle = 0x80860009 ONL_E_ACCOUNT_SUSPENDED_COMPROIMISE Handle = 0x8086000A ONL_E_ACCOUNT_SUSPENDED_ABUSE Handle = 0x8086000B ONL_E_ACTION_REQUIRED Handle = 0x8086000C ONL_CONNECTION_COUNT_LIMIT Handle = 0x8086000D ONL_E_CONNECTED_ACCOUNT_CAN_NOT_SIGNOUT Handle = 0x8086000E ONL_E_USER_AUTHENTICATION_REQUIRED Handle = 0x8086000F ONL_E_REQUEST_THROTTLED Handle = 0x80860010 FA_E_MAX_PERSISTED_ITEMS_REACHED Handle = 0x80270220 FA_E_HOMEGROUP_NOT_AVAILABLE Handle = 0x80270222 E_MONITOR_RESOLUTION_TOO_LOW Handle = 0x80270250 E_ELEVATED_ACTIVATION_NOT_SUPPORTED Handle = 0x80270251 E_UAC_DISABLED Handle = 0x80270252 E_FULL_ADMIN_NOT_SUPPORTED Handle = 0x80270253 E_APPLICATION_NOT_REGISTERED Handle = 0x80270254 E_MULTIPLE_EXTENSIONS_FOR_APPLICATION Handle = 0x80270255 E_MULTIPLE_PACKAGES_FOR_FAMILY Handle = 0x80270256 E_APPLICATION_MANAGER_NOT_RUNNING Handle = 0x80270257 S_STORE_LAUNCHED_FOR_REMEDIATION Handle = 0x00270258 S_APPLICATION_ACTIVATION_ERROR_HANDLED_BY_DIALOG Handle = 0x00270259 E_APPLICATION_ACTIVATION_TIMED_OUT Handle = 0x8027025A E_APPLICATION_ACTIVATION_EXEC_FAILURE Handle = 0x8027025B E_APPLICATION_TEMPORARY_LICENSE_ERROR Handle = 0x8027025C E_APPLICATION_TRIAL_LICENSE_EXPIRED Handle = 0x8027025D E_SKYDRIVE_ROOT_TARGET_FILE_SYSTEM_NOT_SUPPORTED Handle = 0x80270260 E_SKYDRIVE_ROOT_TARGET_OVERLAP Handle = 0x80270261 E_SKYDRIVE_ROOT_TARGET_CANNOT_INDEX Handle = 0x80270262 E_SKYDRIVE_FILE_NOT_UPLOADED Handle = 0x80270263 E_SKYDRIVE_UPDATE_AVAILABILITY_FAIL Handle = 0x80270264 E_SKYDRIVE_ROOT_TARGET_VOLUME_ROOT_NOT_SUPPORTED Handle = 0x80270265 E_SYNCENGINE_FILE_SIZE_OVER_LIMIT Handle = 0x8802B001 E_SYNCENGINE_FILE_SIZE_EXCEEDS_REMAINING_QUOTA Handle = 0x8802B002 E_SYNCENGINE_UNSUPPORTED_FILE_NAME Handle = 0x8802B003 E_SYNCENGINE_FOLDER_ITEM_COUNT_LIMIT_EXCEEDED Handle = 0x8802B004 E_SYNCENGINE_FILE_SYNC_PARTNER_ERROR Handle = 0x8802B005 E_SYNCENGINE_SYNC_PAUSED_BY_SERVICE Handle = 0x8802B006 E_SYNCENGINE_FILE_IDENTIFIER_UNKNOWN Handle = 0x8802C002 E_SYNCENGINE_SERVICE_AUTHENTICATION_FAILED Handle = 0x8802C003 E_SYNCENGINE_UNKNOWN_SERVICE_ERROR Handle = 0x8802C004 E_SYNCENGINE_SERVICE_RETURNED_UNEXPECTED_SIZE Handle = 0x8802C005 E_SYNCENGINE_REQUEST_BLOCKED_BY_SERVICE Handle = 0x8802C006 E_SYNCENGINE_REQUEST_BLOCKED_DUE_TO_CLIENT_ERROR Handle = 0x8802C007 E_SYNCENGINE_FOLDER_INACCESSIBLE Handle = 0x8802D001 E_SYNCENGINE_UNSUPPORTED_FOLDER_NAME Handle = 0x8802D002 E_SYNCENGINE_UNSUPPORTED_MARKET Handle = 0x8802D003 E_SYNCENGINE_PATH_LENGTH_LIMIT_EXCEEDED Handle = 0x8802D004 E_SYNCENGINE_REMOTE_PATH_LENGTH_LIMIT_EXCEEDED Handle = 0x8802D005 E_SYNCENGINE_CLIENT_UPDATE_NEEDED Handle = 0x8802D006 E_SYNCENGINE_PROXY_AUTHENTICATION_REQUIRED Handle = 0x8802D007 E_SYNCENGINE_STORAGE_SERVICE_PROVISIONING_FAILED Handle = 0x8802D008 E_SYNCENGINE_UNSUPPORTED_REPARSE_POINT Handle = 0x8802D009 E_SYNCENGINE_STORAGE_SERVICE_BLOCKED Handle = 0x8802D00A E_SYNCENGINE_FOLDER_IN_REDIRECTION Handle = 0x8802D00B EAS_E_POLICY_NOT_MANAGED_BY_OS Handle = 0x80550001 EAS_E_POLICY_COMPLIANT_WITH_ACTIONS Handle = 0x80550002 EAS_E_REQUESTED_POLICY_NOT_ENFORCEABLE Handle = 0x80550003 EAS_E_CURRENT_USER_HAS_BLANK_PASSWORD Handle = 0x80550004 EAS_E_REQUESTED_POLICY_PASSWORD_EXPIRATION_INCOMPATIBLE Handle = 0x80550005 EAS_E_USER_CANNOT_CHANGE_PASSWORD Handle = 0x80550006 EAS_E_ADMINS_HAVE_BLANK_PASSWORD Handle = 0x80550007 EAS_E_ADMINS_CANNOT_CHANGE_PASSWORD Handle = 0x80550008 EAS_E_LOCAL_CONTROLLED_USERS_CANNOT_CHANGE_PASSWORD Handle = 0x80550009 EAS_E_PASSWORD_POLICY_NOT_ENFORCEABLE_FOR_CONNECTED_ADMINS Handle = 0x8055000A EAS_E_CONNECTED_ADMINS_NEED_TO_CHANGE_PASSWORD Handle = 0x8055000B EAS_E_PASSWORD_POLICY_NOT_ENFORCEABLE_FOR_CURRENT_CONNECTED_USER Handle = 0x8055000C EAS_E_CURRENT_CONNECTED_USER_NEED_TO_CHANGE_PASSWORD Handle = 0x8055000D WEB_E_UNSUPPORTED_FORMAT Handle = 0x83750001 WEB_E_INVALID_XML Handle = 0x83750002 WEB_E_MISSING_REQUIRED_ELEMENT Handle = 0x83750003 WEB_E_MISSING_REQUIRED_ATTRIBUTE Handle = 0x83750004 WEB_E_UNEXPECTED_CONTENT Handle = 0x83750005 WEB_E_RESOURCE_TOO_LARGE Handle = 0x83750006 WEB_E_INVALID_JSON_STRING Handle = 0x83750007 WEB_E_INVALID_JSON_NUMBER Handle = 0x83750008 WEB_E_JSON_VALUE_NOT_FOUND Handle = 0x83750009 HTTP_E_STATUS_UNEXPECTED Handle = 0x80190001 HTTP_E_STATUS_UNEXPECTED_REDIRECTION Handle = 0x80190003 HTTP_E_STATUS_UNEXPECTED_CLIENT_ERROR Handle = 0x80190004 HTTP_E_STATUS_UNEXPECTED_SERVER_ERROR Handle = 0x80190005 HTTP_E_STATUS_AMBIGUOUS Handle = 0x8019012C HTTP_E_STATUS_MOVED Handle = 0x8019012D HTTP_E_STATUS_REDIRECT Handle = 0x8019012E HTTP_E_STATUS_REDIRECT_METHOD Handle = 0x8019012F HTTP_E_STATUS_NOT_MODIFIED Handle = 0x80190130 HTTP_E_STATUS_USE_PROXY Handle = 0x80190131 HTTP_E_STATUS_REDIRECT_KEEP_VERB Handle = 0x80190133 HTTP_E_STATUS_BAD_REQUEST Handle = 0x80190190 HTTP_E_STATUS_DENIED Handle = 0x80190191 HTTP_E_STATUS_PAYMENT_REQ Handle = 0x80190192 HTTP_E_STATUS_FORBIDDEN Handle = 0x80190193 HTTP_E_STATUS_NOT_FOUND Handle = 0x80190194 HTTP_E_STATUS_BAD_METHOD Handle = 0x80190195 HTTP_E_STATUS_NONE_ACCEPTABLE Handle = 0x80190196 HTTP_E_STATUS_PROXY_AUTH_REQ Handle = 0x80190197 HTTP_E_STATUS_REQUEST_TIMEOUT Handle = 0x80190198 HTTP_E_STATUS_CONFLICT Handle = 0x80190199 HTTP_E_STATUS_GONE Handle = 0x8019019A HTTP_E_STATUS_LENGTH_REQUIRED Handle = 0x8019019B HTTP_E_STATUS_PRECOND_FAILED Handle = 0x8019019C HTTP_E_STATUS_REQUEST_TOO_LARGE Handle = 0x8019019D HTTP_E_STATUS_URI_TOO_LONG Handle = 0x8019019E HTTP_E_STATUS_UNSUPPORTED_MEDIA Handle = 0x8019019F HTTP_E_STATUS_RANGE_NOT_SATISFIABLE Handle = 0x801901A0 HTTP_E_STATUS_EXPECTATION_FAILED Handle = 0x801901A1 HTTP_E_STATUS_SERVER_ERROR Handle = 0x801901F4 HTTP_E_STATUS_NOT_SUPPORTED Handle = 0x801901F5 HTTP_E_STATUS_BAD_GATEWAY Handle = 0x801901F6 HTTP_E_STATUS_SERVICE_UNAVAIL Handle = 0x801901F7 HTTP_E_STATUS_GATEWAY_TIMEOUT Handle = 0x801901F8 HTTP_E_STATUS_VERSION_NOT_SUP Handle = 0x801901F9 E_INVALID_PROTOCOL_OPERATION Handle = 0x83760001 E_INVALID_PROTOCOL_FORMAT Handle = 0x83760002 E_PROTOCOL_EXTENSIONS_NOT_SUPPORTED Handle = 0x83760003 E_SUBPROTOCOL_NOT_SUPPORTED Handle = 0x83760004 E_PROTOCOL_VERSION_NOT_SUPPORTED Handle = 0x83760005 INPUT_E_OUT_OF_ORDER Handle = 0x80400000 INPUT_E_REENTRANCY Handle = 0x80400001 INPUT_E_MULTIMODAL Handle = 0x80400002 INPUT_E_PACKET Handle = 0x80400003 INPUT_E_FRAME Handle = 0x80400004 INPUT_E_HISTORY Handle = 0x80400005 INPUT_E_DEVICE_INFO Handle = 0x80400006 INPUT_E_TRANSFORM Handle = 0x80400007 INPUT_E_DEVICE_PROPERTY Handle = 0x80400008 INET_E_INVALID_URL Handle = 0x800C0002 INET_E_NO_SESSION Handle = 0x800C0003 INET_E_CANNOT_CONNECT Handle = 0x800C0004 INET_E_RESOURCE_NOT_FOUND Handle = 0x800C0005 INET_E_OBJECT_NOT_FOUND Handle = 0x800C0006 INET_E_DATA_NOT_AVAILABLE Handle = 0x800C0007 INET_E_DOWNLOAD_FAILURE Handle = 0x800C0008 INET_E_AUTHENTICATION_REQUIRED Handle = 0x800C0009 INET_E_NO_VALID_MEDIA Handle = 0x800C000A INET_E_CONNECTION_TIMEOUT Handle = 0x800C000B INET_E_INVALID_REQUEST Handle = 0x800C000C INET_E_UNKNOWN_PROTOCOL Handle = 0x800C000D INET_E_SECURITY_PROBLEM Handle = 0x800C000E INET_E_CANNOT_LOAD_DATA Handle = 0x800C000F INET_E_CANNOT_INSTANTIATE_OBJECT Handle = 0x800C0010 INET_E_INVALID_CERTIFICATE Handle = 0x800C0019 INET_E_REDIRECT_FAILED Handle = 0x800C0014 INET_E_REDIRECT_TO_DIR Handle = 0x800C0015 ERROR_DBG_CREATE_PROCESS_FAILURE_LOCKDOWN Handle = 0x80B00001 ERROR_DBG_ATTACH_PROCESS_FAILURE_LOCKDOWN Handle = 0x80B00002 ERROR_DBG_CONNECT_SERVER_FAILURE_LOCKDOWN Handle = 0x80B00003 ERROR_DBG_START_SERVER_FAILURE_LOCKDOWN Handle = 0x80B00004 ERROR_IO_PREEMPTED Handle = 0x89010001 JSCRIPT_E_CANTEXECUTE Handle = 0x89020001 WEP_E_NOT_PROVISIONED_ON_ALL_VOLUMES Handle = 0x88010001 WEP_E_FIXED_DATA_NOT_SUPPORTED Handle = 0x88010002 WEP_E_HARDWARE_NOT_COMPLIANT Handle = 0x88010003 WEP_E_LOCK_NOT_CONFIGURED Handle = 0x88010004 WEP_E_PROTECTION_SUSPENDED Handle = 0x88010005 WEP_E_NO_LICENSE Handle = 0x88010006 WEP_E_OS_NOT_PROTECTED Handle = 0x88010007 WEP_E_UNEXPECTED_FAIL Handle = 0x88010008 WEP_E_BUFFER_TOO_LARGE Handle = 0x88010009 ERROR_SVHDX_ERROR_STORED Handle = 0xC05C0000 ERROR_SVHDX_ERROR_NOT_AVAILABLE Handle = 0xC05CFF00 ERROR_SVHDX_UNIT_ATTENTION_AVAILABLE Handle = 0xC05CFF01 ERROR_SVHDX_UNIT_ATTENTION_CAPACITY_DATA_CHANGED Handle = 0xC05CFF02 ERROR_SVHDX_UNIT_ATTENTION_RESERVATIONS_PREEMPTED Handle = 0xC05CFF03 ERROR_SVHDX_UNIT_ATTENTION_RESERVATIONS_RELEASED Handle = 0xC05CFF04 ERROR_SVHDX_UNIT_ATTENTION_REGISTRATIONS_PREEMPTED Handle = 0xC05CFF05 ERROR_SVHDX_UNIT_ATTENTION_OPERATING_DEFINITION_CHANGED Handle = 0xC05CFF06 ERROR_SVHDX_RESERVATION_CONFLICT Handle = 0xC05CFF07 ERROR_SVHDX_WRONG_FILE_TYPE Handle = 0xC05CFF08 ERROR_SVHDX_VERSION_MISMATCH Handle = 0xC05CFF09 ERROR_VHD_SHARED Handle = 0xC05CFF0A ERROR_SVHDX_NO_INITIATOR Handle = 0xC05CFF0B ERROR_VHDSET_BACKING_STORAGE_NOT_FOUND Handle = 0xC05CFF0C ERROR_SMB_NO_PREAUTH_INTEGRITY_HASH_OVERLAP Handle = 0xC05D0000 ERROR_SMB_BAD_CLUSTER_DIALECT Handle = 0xC05D0001 WININET_E_OUT_OF_HANDLES Handle = 0x80072EE1 WININET_E_TIMEOUT Handle = 0x80072EE2 WININET_E_EXTENDED_ERROR Handle = 0x80072EE3 WININET_E_INTERNAL_ERROR Handle = 0x80072EE4 WININET_E_INVALID_URL Handle = 0x80072EE5 WININET_E_UNRECOGNIZED_SCHEME Handle = 0x80072EE6 WININET_E_NAME_NOT_RESOLVED Handle = 0x80072EE7 WININET_E_PROTOCOL_NOT_FOUND Handle = 0x80072EE8 WININET_E_INVALID_OPTION Handle = 0x80072EE9 WININET_E_BAD_OPTION_LENGTH Handle = 0x80072EEA WININET_E_OPTION_NOT_SETTABLE Handle = 0x80072EEB WININET_E_SHUTDOWN Handle = 0x80072EEC WININET_E_INCORRECT_USER_NAME Handle = 0x80072EED WININET_E_INCORRECT_PASSWORD Handle = 0x80072EEE WININET_E_LOGIN_FAILURE Handle = 0x80072EEF WININET_E_INVALID_OPERATION Handle = 0x80072EF0 WININET_E_OPERATION_CANCELLED Handle = 0x80072EF1 WININET_E_INCORRECT_HANDLE_TYPE Handle = 0x80072EF2 WININET_E_INCORRECT_HANDLE_STATE Handle = 0x80072EF3 WININET_E_NOT_PROXY_REQUEST Handle = 0x80072EF4 WININET_E_REGISTRY_VALUE_NOT_FOUND Handle = 0x80072EF5 WININET_E_BAD_REGISTRY_PARAMETER Handle = 0x80072EF6 WININET_E_NO_DIRECT_ACCESS Handle = 0x80072EF7 WININET_E_NO_CONTEXT Handle = 0x80072EF8 WININET_E_NO_CALLBACK Handle = 0x80072EF9 WININET_E_REQUEST_PENDING Handle = 0x80072EFA WININET_E_INCORRECT_FORMAT Handle = 0x80072EFB WININET_E_ITEM_NOT_FOUND Handle = 0x80072EFC WININET_E_CANNOT_CONNECT Handle = 0x80072EFD WININET_E_CONNECTION_ABORTED Handle = 0x80072EFE WININET_E_CONNECTION_RESET Handle = 0x80072EFF WININET_E_FORCE_RETRY Handle = 0x80072F00 WININET_E_INVALID_PROXY_REQUEST Handle = 0x80072F01 WININET_E_NEED_UI Handle = 0x80072F02 WININET_E_HANDLE_EXISTS Handle = 0x80072F04 WININET_E_SEC_CERT_DATE_INVALID Handle = 0x80072F05 WININET_E_SEC_CERT_CN_INVALID Handle = 0x80072F06 WININET_E_HTTP_TO_HTTPS_ON_REDIR Handle = 0x80072F07 WININET_E_HTTPS_TO_HTTP_ON_REDIR Handle = 0x80072F08 WININET_E_MIXED_SECURITY Handle = 0x80072F09 WININET_E_CHG_POST_IS_NON_SECURE Handle = 0x80072F0A WININET_E_POST_IS_NON_SECURE Handle = 0x80072F0B WININET_E_CLIENT_AUTH_CERT_NEEDED Handle = 0x80072F0C WININET_E_INVALID_CA Handle = 0x80072F0D WININET_E_CLIENT_AUTH_NOT_SETUP Handle = 0x80072F0E WININET_E_ASYNC_THREAD_FAILED Handle = 0x80072F0F WININET_E_REDIRECT_SCHEME_CHANGE Handle = 0x80072F10 WININET_E_DIALOG_PENDING Handle = 0x80072F11 WININET_E_RETRY_DIALOG Handle = 0x80072F12 WININET_E_NO_NEW_CONTAINERS Handle = 0x80072F13 WININET_E_HTTPS_HTTP_SUBMIT_REDIR Handle = 0x80072F14 WININET_E_SEC_CERT_ERRORS Handle = 0x80072F17 WININET_E_SEC_CERT_REV_FAILED Handle = 0x80072F19 WININET_E_HEADER_NOT_FOUND Handle = 0x80072F76 WININET_E_DOWNLEVEL_SERVER Handle = 0x80072F77 WININET_E_INVALID_SERVER_RESPONSE Handle = 0x80072F78 WININET_E_INVALID_HEADER Handle = 0x80072F79 WININET_E_INVALID_QUERY_REQUEST Handle = 0x80072F7A WININET_E_HEADER_ALREADY_EXISTS Handle = 0x80072F7B WININET_E_REDIRECT_FAILED Handle = 0x80072F7C WININET_E_SECURITY_CHANNEL_ERROR Handle = 0x80072F7D WININET_E_UNABLE_TO_CACHE_FILE Handle = 0x80072F7E WININET_E_TCPIP_NOT_INSTALLED Handle = 0x80072F7F WININET_E_DISCONNECTED Handle = 0x80072F83 WININET_E_SERVER_UNREACHABLE Handle = 0x80072F84 WININET_E_PROXY_SERVER_UNREACHABLE Handle = 0x80072F85 WININET_E_BAD_AUTO_PROXY_SCRIPT Handle = 0x80072F86 WININET_E_UNABLE_TO_DOWNLOAD_SCRIPT Handle = 0x80072F87 WININET_E_SEC_INVALID_CERT Handle = 0x80072F89 WININET_E_SEC_CERT_REVOKED Handle = 0x80072F8A WININET_E_FAILED_DUETOSECURITYCHECK Handle = 0x80072F8B WININET_E_NOT_INITIALIZED Handle = 0x80072F8C WININET_E_LOGIN_FAILURE_DISPLAY_ENTITY_BODY Handle = 0x80072F8E WININET_E_DECODING_FAILED Handle = 0x80072F8F WININET_E_NOT_REDIRECTED Handle = 0x80072F80 WININET_E_COOKIE_NEEDS_CONFIRMATION Handle = 0x80072F81 WININET_E_COOKIE_DECLINED Handle = 0x80072F82 WININET_E_REDIRECT_NEEDS_CONFIRMATION Handle = 0x80072F88 SQLITE_E_ERROR Handle = 0x87AF0001 SQLITE_E_INTERNAL Handle = 0x87AF0002 SQLITE_E_PERM Handle = 0x87AF0003 SQLITE_E_ABORT Handle = 0x87AF0004 SQLITE_E_BUSY Handle = 0x87AF0005 SQLITE_E_LOCKED Handle = 0x87AF0006 SQLITE_E_NOMEM Handle = 0x87AF0007 SQLITE_E_READONLY Handle = 0x87AF0008 SQLITE_E_INTERRUPT Handle = 0x87AF0009 SQLITE_E_IOERR Handle = 0x87AF000A SQLITE_E_CORRUPT Handle = 0x87AF000B SQLITE_E_NOTFOUND Handle = 0x87AF000C SQLITE_E_FULL Handle = 0x87AF000D SQLITE_E_CANTOPEN Handle = 0x87AF000E SQLITE_E_PROTOCOL Handle = 0x87AF000F SQLITE_E_EMPTY Handle = 0x87AF0010 SQLITE_E_SCHEMA Handle = 0x87AF0011 SQLITE_E_TOOBIG Handle = 0x87AF0012 SQLITE_E_CONSTRAINT Handle = 0x87AF0013 SQLITE_E_MISMATCH Handle = 0x87AF0014 SQLITE_E_MISUSE Handle = 0x87AF0015 SQLITE_E_NOLFS Handle = 0x87AF0016 SQLITE_E_AUTH Handle = 0x87AF0017 SQLITE_E_FORMAT Handle = 0x87AF0018 SQLITE_E_RANGE Handle = 0x87AF0019 SQLITE_E_NOTADB Handle = 0x87AF001A SQLITE_E_NOTICE Handle = 0x87AF001B SQLITE_E_WARNING Handle = 0x87AF001C SQLITE_E_ROW Handle = 0x87AF0064 SQLITE_E_DONE Handle = 0x87AF0065 SQLITE_E_IOERR_READ Handle = 0x87AF010A SQLITE_E_IOERR_SHORT_READ Handle = 0x87AF020A SQLITE_E_IOERR_WRITE Handle = 0x87AF030A SQLITE_E_IOERR_FSYNC Handle = 0x87AF040A SQLITE_E_IOERR_DIR_FSYNC Handle = 0x87AF050A SQLITE_E_IOERR_TRUNCATE Handle = 0x87AF060A SQLITE_E_IOERR_FSTAT Handle = 0x87AF070A SQLITE_E_IOERR_UNLOCK Handle = 0x87AF080A SQLITE_E_IOERR_RDLOCK Handle = 0x87AF090A SQLITE_E_IOERR_DELETE Handle = 0x87AF0A0A SQLITE_E_IOERR_BLOCKED Handle = 0x87AF0B0A SQLITE_E_IOERR_NOMEM Handle = 0x87AF0C0A SQLITE_E_IOERR_ACCESS Handle = 0x87AF0D0A SQLITE_E_IOERR_CHECKRESERVEDLOCK Handle = 0x87AF0E0A SQLITE_E_IOERR_LOCK Handle = 0x87AF0F0A SQLITE_E_IOERR_CLOSE Handle = 0x87AF100A SQLITE_E_IOERR_DIR_CLOSE Handle = 0x87AF110A SQLITE_E_IOERR_SHMOPEN Handle = 0x87AF120A SQLITE_E_IOERR_SHMSIZE Handle = 0x87AF130A SQLITE_E_IOERR_SHMLOCK Handle = 0x87AF140A SQLITE_E_IOERR_SHMMAP Handle = 0x87AF150A SQLITE_E_IOERR_SEEK Handle = 0x87AF160A SQLITE_E_IOERR_DELETE_NOENT Handle = 0x87AF170A SQLITE_E_IOERR_MMAP Handle = 0x87AF180A SQLITE_E_IOERR_GETTEMPPATH Handle = 0x87AF190A SQLITE_E_IOERR_CONVPATH Handle = 0x87AF1A0A SQLITE_E_IOERR_VNODE Handle = 0x87AF1A02 SQLITE_E_IOERR_AUTH Handle = 0x87AF1A03 SQLITE_E_LOCKED_SHAREDCACHE Handle = 0x87AF0106 SQLITE_E_BUSY_RECOVERY Handle = 0x87AF0105 SQLITE_E_BUSY_SNAPSHOT Handle = 0x87AF0205 SQLITE_E_CANTOPEN_NOTEMPDIR Handle = 0x87AF010E SQLITE_E_CANTOPEN_ISDIR Handle = 0x87AF020E SQLITE_E_CANTOPEN_FULLPATH Handle = 0x87AF030E SQLITE_E_CANTOPEN_CONVPATH Handle = 0x87AF040E SQLITE_E_CORRUPT_VTAB Handle = 0x87AF010B SQLITE_E_READONLY_RECOVERY Handle = 0x87AF0108 SQLITE_E_READONLY_CANTLOCK Handle = 0x87AF0208 SQLITE_E_READONLY_ROLLBACK Handle = 0x87AF0308 SQLITE_E_READONLY_DBMOVED Handle = 0x87AF0408 SQLITE_E_ABORT_ROLLBACK Handle = 0x87AF0204 SQLITE_E_CONSTRAINT_CHECK Handle = 0x87AF0113 SQLITE_E_CONSTRAINT_COMMITHOOK Handle = 0x87AF0213 SQLITE_E_CONSTRAINT_FOREIGNKEY Handle = 0x87AF0313 SQLITE_E_CONSTRAINT_FUNCTION Handle = 0x87AF0413 SQLITE_E_CONSTRAINT_NOTNULL Handle = 0x87AF0513 SQLITE_E_CONSTRAINT_PRIMARYKEY Handle = 0x87AF0613 SQLITE_E_CONSTRAINT_TRIGGER Handle = 0x87AF0713 SQLITE_E_CONSTRAINT_UNIQUE Handle = 0x87AF0813 SQLITE_E_CONSTRAINT_VTAB Handle = 0x87AF0913 SQLITE_E_CONSTRAINT_ROWID Handle = 0x87AF0A13 SQLITE_E_NOTICE_RECOVER_WAL Handle = 0x87AF011B SQLITE_E_NOTICE_RECOVER_ROLLBACK Handle = 0x87AF021B SQLITE_E_WARNING_AUTOINDEX Handle = 0x87AF011C UTC_E_TOGGLE_TRACE_STARTED Handle = 0x87C51001 UTC_E_ALTERNATIVE_TRACE_CANNOT_PREEMPT Handle = 0x87C51002 UTC_E_AOT_NOT_RUNNING Handle = 0x87C51003 UTC_E_SCRIPT_TYPE_INVALID Handle = 0x87C51004 UTC_E_SCENARIODEF_NOT_FOUND Handle = 0x87C51005 UTC_E_TRACEPROFILE_NOT_FOUND Handle = 0x87C51006 UTC_E_FORWARDER_ALREADY_ENABLED Handle = 0x87C51007 UTC_E_FORWARDER_ALREADY_DISABLED Handle = 0x87C51008 UTC_E_EVENTLOG_ENTRY_MALFORMED Handle = 0x87C51009 UTC_E_DIAGRULES_SCHEMAVERSION_MISMATCH Handle = 0x87C5100A UTC_E_SCRIPT_TERMINATED Handle = 0x87C5100B UTC_E_INVALID_CUSTOM_FILTER Handle = 0x87C5100C UTC_E_TRACE_NOT_RUNNING Handle = 0x87C5100D UTC_E_REESCALATED_TOO_QUICKLY Handle = 0x87C5100E UTC_E_ESCALATION_ALREADY_RUNNING Handle = 0x87C5100F UTC_E_PERFTRACK_ALREADY_TRACING Handle = 0x87C51010 UTC_E_REACHED_MAX_ESCALATIONS Handle = 0x87C51011 UTC_E_FORWARDER_PRODUCER_MISMATCH Handle = 0x87C51012 UTC_E_INTENTIONAL_SCRIPT_FAILURE Handle = 0x87C51013 UTC_E_SQM_INIT_FAILED Handle = 0x87C51014 UTC_E_NO_WER_LOGGER_SUPPORTED Handle = 0x87C51015 UTC_E_TRACERS_DONT_EXIST Handle = 0x87C51016 UTC_E_WINRT_INIT_FAILED Handle = 0x87C51017 UTC_E_SCENARIODEF_SCHEMAVERSION_MISMATCH Handle = 0x87C51018 UTC_E_INVALID_FILTER Handle = 0x87C51019 UTC_E_EXE_TERMINATED Handle = 0x87C5101A UTC_E_ESCALATION_NOT_AUTHORIZED Handle = 0x87C5101B UTC_E_SETUP_NOT_AUTHORIZED Handle = 0x87C5101C UTC_E_CHILD_PROCESS_FAILED Handle = 0x87C5101D UTC_E_COMMAND_LINE_NOT_AUTHORIZED Handle = 0x87C5101E UTC_E_CANNOT_LOAD_SCENARIO_EDITOR_XML Handle = 0x87C5101F UTC_E_ESCALATION_TIMED_OUT Handle = 0x87C51020 UTC_E_SETUP_TIMED_OUT Handle = 0x87C51021 UTC_E_TRIGGER_MISMATCH Handle = 0x87C51022 UTC_E_TRIGGER_NOT_FOUND Handle = 0x87C51023 UTC_E_SIF_NOT_SUPPORTED Handle = 0x87C51024 UTC_E_DELAY_TERMINATED Handle = 0x87C51025 UTC_E_DEVICE_TICKET_ERROR Handle = 0x87C51026 UTC_E_TRACE_BUFFER_LIMIT_EXCEEDED Handle = 0x87C51027 UTC_E_API_RESULT_UNAVAILABLE Handle = 0x87C51028 UTC_E_RPC_TIMEOUT Handle = 0x87C51029 UTC_E_RPC_WAIT_FAILED Handle = 0x87C5102A UTC_E_API_BUSY Handle = 0x87C5102B UTC_E_TRACE_MIN_DURATION_REQUIREMENT_NOT_MET Handle = 0x87C5102C UTC_E_EXCLUSIVITY_NOT_AVAILABLE Handle = 0x87C5102D UTC_E_GETFILE_FILE_PATH_NOT_APPROVED Handle = 0x87C5102E UTC_E_ESCALATION_DIRECTORY_ALREADY_EXISTS Handle = 0x87C5102F UTC_E_TIME_TRIGGER_ON_START_INVALID Handle = 0x87C51030 UTC_E_TIME_TRIGGER_ONLY_VALID_ON_SINGLE_TRANSITION Handle = 0x87C51031 UTC_E_TIME_TRIGGER_INVALID_TIME_RANGE Handle = 0x87C51032 UTC_E_MULTIPLE_TIME_TRIGGER_ON_SINGLE_STATE Handle = 0x87C51033 UTC_E_BINARY_MISSING Handle = 0x87C51034 UTC_E_NETWORK_CAPTURE_NOT_ALLOWED Handle = 0x87C51035 UTC_E_FAILED_TO_RESOLVE_CONTAINER_ID Handle = 0x87C51036 UTC_E_UNABLE_TO_RESOLVE_SESSION Handle = 0x87C51037 UTC_E_THROTTLED Handle = 0x87C51038 UTC_E_UNAPPROVED_SCRIPT Handle = 0x87C51039 UTC_E_SCRIPT_MISSING Handle = 0x87C5103A UTC_E_SCENARIO_THROTTLED Handle = 0x87C5103B UTC_E_API_NOT_SUPPORTED Handle = 0x87C5103C UTC_E_GETFILE_EXTERNAL_PATH_NOT_APPROVED Handle = 0x87C5103D UTC_E_TRY_GET_SCENARIO_TIMEOUT_EXCEEDED Handle = 0x87C5103E UTC_E_CERT_REV_FAILED Handle = 0x87C5103F UTC_E_FAILED_TO_START_NDISCAP Handle = 0x87C51040 UTC_E_KERNELDUMP_LIMIT_REACHED Handle = 0x87C51041 UTC_E_MISSING_AGGREGATE_EVENT_TAG Handle = 0x87C51042 UTC_E_INVALID_AGGREGATION_STRUCT Handle = 0x87C51043 UTC_E_ACTION_NOT_SUPPORTED_IN_DESTINATION Handle = 0x87C51044 UTC_E_FILTER_MISSING_ATTRIBUTE Handle = 0x87C51045 UTC_E_FILTER_INVALID_TYPE Handle = 0x87C51046 UTC_E_FILTER_VARIABLE_NOT_FOUND Handle = 0x87C51047 UTC_E_FILTER_FUNCTION_RESTRICTED Handle = 0x87C51048 UTC_E_FILTER_VERSION_MISMATCH Handle = 0x87C51049 UTC_E_FILTER_INVALID_FUNCTION Handle = 0x87C51050 UTC_E_FILTER_INVALID_FUNCTION_PARAMS Handle = 0x87C51051 UTC_E_FILTER_INVALID_COMMAND Handle = 0x87C51052 UTC_E_FILTER_ILLEGAL_EVAL Handle = 0x87C51053 UTC_E_TTTRACER_RETURNED_ERROR Handle = 0x87C51054 UTC_E_AGENT_DIAGNOSTICS_TOO_LARGE Handle = 0x87C51055 UTC_E_FAILED_TO_RECEIVE_AGENT_DIAGNOSTICS Handle = 0x87C51056 UTC_E_SCENARIO_HAS_NO_ACTIONS Handle = 0x87C51057 UTC_E_TTTRACER_STORAGE_FULL Handle = 0x87C51058 UTC_E_INSUFFICIENT_SPACE_TO_START_TRACE Handle = 0x87C51059 UTC_E_ESCALATION_CANCELLED_AT_SHUTDOWN Handle = 0x87C5105A UTC_E_GETFILEINFOACTION_FILE_NOT_APPROVED Handle = 0x87C5105B UTC_E_SETREGKEYACTION_TYPE_NOT_APPROVED Handle = 0x87C5105C WINML_ERR_INVALID_DEVICE Handle = 0x88900001 WINML_ERR_INVALID_BINDING Handle = 0x88900002 WINML_ERR_VALUE_NOTFOUND Handle = 0x88900003 WINML_ERR_SIZE_MISMATCH Handle = 0x88900004 STATUS_WAIT_0 NTStatus = 0x00000000 STATUS_SUCCESS NTStatus = 0x00000000 STATUS_WAIT_1 NTStatus = 0x00000001 STATUS_WAIT_2 NTStatus = 0x00000002 STATUS_WAIT_3 NTStatus = 0x00000003 STATUS_WAIT_63 NTStatus = 0x0000003F STATUS_ABANDONED NTStatus = 0x00000080 STATUS_ABANDONED_WAIT_0 NTStatus = 0x00000080 STATUS_ABANDONED_WAIT_63 NTStatus = 0x000000BF STATUS_USER_APC NTStatus = 0x000000C0 STATUS_ALREADY_COMPLETE NTStatus = 0x000000FF STATUS_KERNEL_APC NTStatus = 0x00000100 STATUS_ALERTED NTStatus = 0x00000101 STATUS_TIMEOUT NTStatus = 0x00000102 STATUS_PENDING NTStatus = 0x00000103 STATUS_REPARSE NTStatus = 0x00000104 STATUS_MORE_ENTRIES NTStatus = 0x00000105 STATUS_NOT_ALL_ASSIGNED NTStatus = 0x00000106 STATUS_SOME_NOT_MAPPED NTStatus = 0x00000107 STATUS_OPLOCK_BREAK_IN_PROGRESS NTStatus = 0x00000108 STATUS_VOLUME_MOUNTED NTStatus = 0x00000109 STATUS_RXACT_COMMITTED NTStatus = 0x0000010A STATUS_NOTIFY_CLEANUP NTStatus = 0x0000010B STATUS_NOTIFY_ENUM_DIR NTStatus = 0x0000010C STATUS_NO_QUOTAS_FOR_ACCOUNT NTStatus = 0x0000010D STATUS_PRIMARY_TRANSPORT_CONNECT_FAILED NTStatus = 0x0000010E STATUS_PAGE_FAULT_TRANSITION NTStatus = 0x00000110 STATUS_PAGE_FAULT_DEMAND_ZERO NTStatus = 0x00000111 STATUS_PAGE_FAULT_COPY_ON_WRITE NTStatus = 0x00000112 STATUS_PAGE_FAULT_GUARD_PAGE NTStatus = 0x00000113 STATUS_PAGE_FAULT_PAGING_FILE NTStatus = 0x00000114 STATUS_CACHE_PAGE_LOCKED NTStatus = 0x00000115 STATUS_CRASH_DUMP NTStatus = 0x00000116 STATUS_BUFFER_ALL_ZEROS NTStatus = 0x00000117 STATUS_REPARSE_OBJECT NTStatus = 0x00000118 STATUS_RESOURCE_REQUIREMENTS_CHANGED NTStatus = 0x00000119 STATUS_TRANSLATION_COMPLETE NTStatus = 0x00000120 STATUS_DS_MEMBERSHIP_EVALUATED_LOCALLY NTStatus = 0x00000121 STATUS_NOTHING_TO_TERMINATE NTStatus = 0x00000122 STATUS_PROCESS_NOT_IN_JOB NTStatus = 0x00000123 STATUS_PROCESS_IN_JOB NTStatus = 0x00000124 STATUS_VOLSNAP_HIBERNATE_READY NTStatus = 0x00000125 STATUS_FSFILTER_OP_COMPLETED_SUCCESSFULLY NTStatus = 0x00000126 STATUS_INTERRUPT_VECTOR_ALREADY_CONNECTED NTStatus = 0x00000127 STATUS_INTERRUPT_STILL_CONNECTED NTStatus = 0x00000128 STATUS_PROCESS_CLONED NTStatus = 0x00000129 STATUS_FILE_LOCKED_WITH_ONLY_READERS NTStatus = 0x0000012A STATUS_FILE_LOCKED_WITH_WRITERS NTStatus = 0x0000012B STATUS_VALID_IMAGE_HASH NTStatus = 0x0000012C STATUS_VALID_CATALOG_HASH NTStatus = 0x0000012D STATUS_VALID_STRONG_CODE_HASH NTStatus = 0x0000012E STATUS_GHOSTED NTStatus = 0x0000012F STATUS_DATA_OVERWRITTEN NTStatus = 0x00000130 STATUS_RESOURCEMANAGER_READ_ONLY NTStatus = 0x00000202 STATUS_RING_PREVIOUSLY_EMPTY NTStatus = 0x00000210 STATUS_RING_PREVIOUSLY_FULL NTStatus = 0x00000211 STATUS_RING_PREVIOUSLY_ABOVE_QUOTA NTStatus = 0x00000212 STATUS_RING_NEWLY_EMPTY NTStatus = 0x00000213 STATUS_RING_SIGNAL_OPPOSITE_ENDPOINT NTStatus = 0x00000214 STATUS_OPLOCK_SWITCHED_TO_NEW_HANDLE NTStatus = 0x00000215 STATUS_OPLOCK_HANDLE_CLOSED NTStatus = 0x00000216 STATUS_WAIT_FOR_OPLOCK NTStatus = 0x00000367 STATUS_REPARSE_GLOBAL NTStatus = 0x00000368 STATUS_FLT_IO_COMPLETE NTStatus = 0x001C0001 STATUS_OBJECT_NAME_EXISTS NTStatus = 0x40000000 STATUS_THREAD_WAS_SUSPENDED NTStatus = 0x40000001 STATUS_WORKING_SET_LIMIT_RANGE NTStatus = 0x40000002 STATUS_IMAGE_NOT_AT_BASE NTStatus = 0x40000003 STATUS_RXACT_STATE_CREATED NTStatus = 0x40000004 STATUS_SEGMENT_NOTIFICATION NTStatus = 0x40000005 STATUS_LOCAL_USER_SESSION_KEY NTStatus = 0x40000006 STATUS_BAD_CURRENT_DIRECTORY NTStatus = 0x40000007 STATUS_SERIAL_MORE_WRITES NTStatus = 0x40000008 STATUS_REGISTRY_RECOVERED NTStatus = 0x40000009 STATUS_FT_READ_RECOVERY_FROM_BACKUP NTStatus = 0x4000000A STATUS_FT_WRITE_RECOVERY NTStatus = 0x4000000B STATUS_SERIAL_COUNTER_TIMEOUT NTStatus = 0x4000000C STATUS_NULL_LM_PASSWORD NTStatus = 0x4000000D STATUS_IMAGE_MACHINE_TYPE_MISMATCH NTStatus = 0x4000000E STATUS_RECEIVE_PARTIAL NTStatus = 0x4000000F STATUS_RECEIVE_EXPEDITED NTStatus = 0x40000010 STATUS_RECEIVE_PARTIAL_EXPEDITED NTStatus = 0x40000011 STATUS_EVENT_DONE NTStatus = 0x40000012 STATUS_EVENT_PENDING NTStatus = 0x40000013 STATUS_CHECKING_FILE_SYSTEM NTStatus = 0x40000014 STATUS_FATAL_APP_EXIT NTStatus = 0x40000015 STATUS_PREDEFINED_HANDLE NTStatus = 0x40000016 STATUS_WAS_UNLOCKED NTStatus = 0x40000017 STATUS_SERVICE_NOTIFICATION NTStatus = 0x40000018 STATUS_WAS_LOCKED NTStatus = 0x40000019 STATUS_LOG_HARD_ERROR NTStatus = 0x4000001A STATUS_ALREADY_WIN32 NTStatus = 0x4000001B STATUS_WX86_UNSIMULATE NTStatus = 0x4000001C STATUS_WX86_CONTINUE NTStatus = 0x4000001D STATUS_WX86_SINGLE_STEP NTStatus = 0x4000001E STATUS_WX86_BREAKPOINT NTStatus = 0x4000001F STATUS_WX86_EXCEPTION_CONTINUE NTStatus = 0x40000020 STATUS_WX86_EXCEPTION_LASTCHANCE NTStatus = 0x40000021 STATUS_WX86_EXCEPTION_CHAIN NTStatus = 0x40000022 STATUS_IMAGE_MACHINE_TYPE_MISMATCH_EXE NTStatus = 0x40000023 STATUS_NO_YIELD_PERFORMED NTStatus = 0x40000024 STATUS_TIMER_RESUME_IGNORED NTStatus = 0x40000025 STATUS_ARBITRATION_UNHANDLED NTStatus = 0x40000026 STATUS_CARDBUS_NOT_SUPPORTED NTStatus = 0x40000027 STATUS_WX86_CREATEWX86TIB NTStatus = 0x40000028 STATUS_MP_PROCESSOR_MISMATCH NTStatus = 0x40000029 STATUS_HIBERNATED NTStatus = 0x4000002A STATUS_RESUME_HIBERNATION NTStatus = 0x4000002B STATUS_FIRMWARE_UPDATED NTStatus = 0x4000002C STATUS_DRIVERS_LEAKING_LOCKED_PAGES NTStatus = 0x4000002D STATUS_MESSAGE_RETRIEVED NTStatus = 0x4000002E STATUS_SYSTEM_POWERSTATE_TRANSITION NTStatus = 0x4000002F STATUS_ALPC_CHECK_COMPLETION_LIST NTStatus = 0x40000030 STATUS_SYSTEM_POWERSTATE_COMPLEX_TRANSITION NTStatus = 0x40000031 STATUS_ACCESS_AUDIT_BY_POLICY NTStatus = 0x40000032 STATUS_ABANDON_HIBERFILE NTStatus = 0x40000033 STATUS_BIZRULES_NOT_ENABLED NTStatus = 0x40000034 STATUS_FT_READ_FROM_COPY NTStatus = 0x40000035 STATUS_IMAGE_AT_DIFFERENT_BASE NTStatus = 0x40000036 STATUS_PATCH_DEFERRED NTStatus = 0x40000037 STATUS_HEURISTIC_DAMAGE_POSSIBLE NTStatus = 0x40190001 STATUS_GUARD_PAGE_VIOLATION NTStatus = 0x80000001 STATUS_DATATYPE_MISALIGNMENT NTStatus = 0x80000002 STATUS_BREAKPOINT NTStatus = 0x80000003 STATUS_SINGLE_STEP NTStatus = 0x80000004 STATUS_BUFFER_OVERFLOW NTStatus = 0x80000005 STATUS_NO_MORE_FILES NTStatus = 0x80000006 STATUS_WAKE_SYSTEM_DEBUGGER NTStatus = 0x80000007 STATUS_HANDLES_CLOSED NTStatus = 0x8000000A STATUS_NO_INHERITANCE NTStatus = 0x8000000B STATUS_GUID_SUBSTITUTION_MADE NTStatus = 0x8000000C STATUS_PARTIAL_COPY NTStatus = 0x8000000D STATUS_DEVICE_PAPER_EMPTY NTStatus = 0x8000000E STATUS_DEVICE_POWERED_OFF NTStatus = 0x8000000F STATUS_DEVICE_OFF_LINE NTStatus = 0x80000010 STATUS_DEVICE_BUSY NTStatus = 0x80000011 STATUS_NO_MORE_EAS NTStatus = 0x80000012 STATUS_INVALID_EA_NAME NTStatus = 0x80000013 STATUS_EA_LIST_INCONSISTENT NTStatus = 0x80000014 STATUS_INVALID_EA_FLAG NTStatus = 0x80000015 STATUS_VERIFY_REQUIRED NTStatus = 0x80000016 STATUS_EXTRANEOUS_INFORMATION NTStatus = 0x80000017 STATUS_RXACT_COMMIT_NECESSARY NTStatus = 0x80000018 STATUS_NO_MORE_ENTRIES NTStatus = 0x8000001A STATUS_FILEMARK_DETECTED NTStatus = 0x8000001B STATUS_MEDIA_CHANGED NTStatus = 0x8000001C STATUS_BUS_RESET NTStatus = 0x8000001D STATUS_END_OF_MEDIA NTStatus = 0x8000001E STATUS_BEGINNING_OF_MEDIA NTStatus = 0x8000001F STATUS_MEDIA_CHECK NTStatus = 0x80000020 STATUS_SETMARK_DETECTED NTStatus = 0x80000021 STATUS_NO_DATA_DETECTED NTStatus = 0x80000022 STATUS_REDIRECTOR_HAS_OPEN_HANDLES NTStatus = 0x80000023 STATUS_SERVER_HAS_OPEN_HANDLES NTStatus = 0x80000024 STATUS_ALREADY_DISCONNECTED NTStatus = 0x80000025 STATUS_LONGJUMP NTStatus = 0x80000026 STATUS_CLEANER_CARTRIDGE_INSTALLED NTStatus = 0x80000027 STATUS_PLUGPLAY_QUERY_VETOED NTStatus = 0x80000028 STATUS_UNWIND_CONSOLIDATE NTStatus = 0x80000029 STATUS_REGISTRY_HIVE_RECOVERED NTStatus = 0x8000002A STATUS_DLL_MIGHT_BE_INSECURE NTStatus = 0x8000002B STATUS_DLL_MIGHT_BE_INCOMPATIBLE NTStatus = 0x8000002C STATUS_STOPPED_ON_SYMLINK NTStatus = 0x8000002D STATUS_CANNOT_GRANT_REQUESTED_OPLOCK NTStatus = 0x8000002E STATUS_NO_ACE_CONDITION NTStatus = 0x8000002F STATUS_DEVICE_SUPPORT_IN_PROGRESS NTStatus = 0x80000030 STATUS_DEVICE_POWER_CYCLE_REQUIRED NTStatus = 0x80000031 STATUS_NO_WORK_DONE NTStatus = 0x80000032 STATUS_CLUSTER_NODE_ALREADY_UP NTStatus = 0x80130001 STATUS_CLUSTER_NODE_ALREADY_DOWN NTStatus = 0x80130002 STATUS_CLUSTER_NETWORK_ALREADY_ONLINE NTStatus = 0x80130003 STATUS_CLUSTER_NETWORK_ALREADY_OFFLINE NTStatus = 0x80130004 STATUS_CLUSTER_NODE_ALREADY_MEMBER NTStatus = 0x80130005 STATUS_FLT_BUFFER_TOO_SMALL NTStatus = 0x801C0001 STATUS_FVE_PARTIAL_METADATA NTStatus = 0x80210001 STATUS_FVE_TRANSIENT_STATE NTStatus = 0x80210002 STATUS_CLOUD_FILE_PROPERTY_BLOB_CHECKSUM_MISMATCH NTStatus = 0x8000CF00 STATUS_UNSUCCESSFUL NTStatus = 0xC0000001 STATUS_NOT_IMPLEMENTED NTStatus = 0xC0000002 STATUS_INVALID_INFO_CLASS NTStatus = 0xC0000003 STATUS_INFO_LENGTH_MISMATCH NTStatus = 0xC0000004 STATUS_ACCESS_VIOLATION NTStatus = 0xC0000005 STATUS_IN_PAGE_ERROR NTStatus = 0xC0000006 STATUS_PAGEFILE_QUOTA NTStatus = 0xC0000007 STATUS_INVALID_HANDLE NTStatus = 0xC0000008 STATUS_BAD_INITIAL_STACK NTStatus = 0xC0000009 STATUS_BAD_INITIAL_PC NTStatus = 0xC000000A STATUS_INVALID_CID NTStatus = 0xC000000B STATUS_TIMER_NOT_CANCELED NTStatus = 0xC000000C STATUS_INVALID_PARAMETER NTStatus = 0xC000000D STATUS_NO_SUCH_DEVICE NTStatus = 0xC000000E STATUS_NO_SUCH_FILE NTStatus = 0xC000000F STATUS_INVALID_DEVICE_REQUEST NTStatus = 0xC0000010 STATUS_END_OF_FILE NTStatus = 0xC0000011 STATUS_WRONG_VOLUME NTStatus = 0xC0000012 STATUS_NO_MEDIA_IN_DEVICE NTStatus = 0xC0000013 STATUS_UNRECOGNIZED_MEDIA NTStatus = 0xC0000014 STATUS_NONEXISTENT_SECTOR NTStatus = 0xC0000015 STATUS_MORE_PROCESSING_REQUIRED NTStatus = 0xC0000016 STATUS_NO_MEMORY NTStatus = 0xC0000017 STATUS_CONFLICTING_ADDRESSES NTStatus = 0xC0000018 STATUS_NOT_MAPPED_VIEW NTStatus = 0xC0000019 STATUS_UNABLE_TO_FREE_VM NTStatus = 0xC000001A STATUS_UNABLE_TO_DELETE_SECTION NTStatus = 0xC000001B STATUS_INVALID_SYSTEM_SERVICE NTStatus = 0xC000001C STATUS_ILLEGAL_INSTRUCTION NTStatus = 0xC000001D STATUS_INVALID_LOCK_SEQUENCE NTStatus = 0xC000001E STATUS_INVALID_VIEW_SIZE NTStatus = 0xC000001F STATUS_INVALID_FILE_FOR_SECTION NTStatus = 0xC0000020 STATUS_ALREADY_COMMITTED NTStatus = 0xC0000021 STATUS_ACCESS_DENIED NTStatus = 0xC0000022 STATUS_BUFFER_TOO_SMALL NTStatus = 0xC0000023 STATUS_OBJECT_TYPE_MISMATCH NTStatus = 0xC0000024 STATUS_NONCONTINUABLE_EXCEPTION NTStatus = 0xC0000025 STATUS_INVALID_DISPOSITION NTStatus = 0xC0000026 STATUS_UNWIND NTStatus = 0xC0000027 STATUS_BAD_STACK NTStatus = 0xC0000028 STATUS_INVALID_UNWIND_TARGET NTStatus = 0xC0000029 STATUS_NOT_LOCKED NTStatus = 0xC000002A STATUS_PARITY_ERROR NTStatus = 0xC000002B STATUS_UNABLE_TO_DECOMMIT_VM NTStatus = 0xC000002C STATUS_NOT_COMMITTED NTStatus = 0xC000002D STATUS_INVALID_PORT_ATTRIBUTES NTStatus = 0xC000002E STATUS_PORT_MESSAGE_TOO_LONG NTStatus = 0xC000002F STATUS_INVALID_PARAMETER_MIX NTStatus = 0xC0000030 STATUS_INVALID_QUOTA_LOWER NTStatus = 0xC0000031 STATUS_DISK_CORRUPT_ERROR NTStatus = 0xC0000032 STATUS_OBJECT_NAME_INVALID NTStatus = 0xC0000033 STATUS_OBJECT_NAME_NOT_FOUND NTStatus = 0xC0000034 STATUS_OBJECT_NAME_COLLISION NTStatus = 0xC0000035 STATUS_PORT_DO_NOT_DISTURB NTStatus = 0xC0000036 STATUS_PORT_DISCONNECTED NTStatus = 0xC0000037 STATUS_DEVICE_ALREADY_ATTACHED NTStatus = 0xC0000038 STATUS_OBJECT_PATH_INVALID NTStatus = 0xC0000039 STATUS_OBJECT_PATH_NOT_FOUND NTStatus = 0xC000003A STATUS_OBJECT_PATH_SYNTAX_BAD NTStatus = 0xC000003B STATUS_DATA_OVERRUN NTStatus = 0xC000003C STATUS_DATA_LATE_ERROR NTStatus = 0xC000003D STATUS_DATA_ERROR NTStatus = 0xC000003E STATUS_CRC_ERROR NTStatus = 0xC000003F STATUS_SECTION_TOO_BIG NTStatus = 0xC0000040 STATUS_PORT_CONNECTION_REFUSED NTStatus = 0xC0000041 STATUS_INVALID_PORT_HANDLE NTStatus = 0xC0000042 STATUS_SHARING_VIOLATION NTStatus = 0xC0000043 STATUS_QUOTA_EXCEEDED NTStatus = 0xC0000044 STATUS_INVALID_PAGE_PROTECTION NTStatus = 0xC0000045 STATUS_MUTANT_NOT_OWNED NTStatus = 0xC0000046 STATUS_SEMAPHORE_LIMIT_EXCEEDED NTStatus = 0xC0000047 STATUS_PORT_ALREADY_SET NTStatus = 0xC0000048 STATUS_SECTION_NOT_IMAGE NTStatus = 0xC0000049 STATUS_SUSPEND_COUNT_EXCEEDED NTStatus = 0xC000004A STATUS_THREAD_IS_TERMINATING NTStatus = 0xC000004B STATUS_BAD_WORKING_SET_LIMIT NTStatus = 0xC000004C STATUS_INCOMPATIBLE_FILE_MAP NTStatus = 0xC000004D STATUS_SECTION_PROTECTION NTStatus = 0xC000004E STATUS_EAS_NOT_SUPPORTED NTStatus = 0xC000004F STATUS_EA_TOO_LARGE NTStatus = 0xC0000050 STATUS_NONEXISTENT_EA_ENTRY NTStatus = 0xC0000051 STATUS_NO_EAS_ON_FILE NTStatus = 0xC0000052 STATUS_EA_CORRUPT_ERROR NTStatus = 0xC0000053 STATUS_FILE_LOCK_CONFLICT NTStatus = 0xC0000054 STATUS_LOCK_NOT_GRANTED NTStatus = 0xC0000055 STATUS_DELETE_PENDING NTStatus = 0xC0000056 STATUS_CTL_FILE_NOT_SUPPORTED NTStatus = 0xC0000057 STATUS_UNKNOWN_REVISION NTStatus = 0xC0000058 STATUS_REVISION_MISMATCH NTStatus = 0xC0000059 STATUS_INVALID_OWNER NTStatus = 0xC000005A STATUS_INVALID_PRIMARY_GROUP NTStatus = 0xC000005B STATUS_NO_IMPERSONATION_TOKEN NTStatus = 0xC000005C STATUS_CANT_DISABLE_MANDATORY NTStatus = 0xC000005D STATUS_NO_LOGON_SERVERS NTStatus = 0xC000005E STATUS_NO_SUCH_LOGON_SESSION NTStatus = 0xC000005F STATUS_NO_SUCH_PRIVILEGE NTStatus = 0xC0000060 STATUS_PRIVILEGE_NOT_HELD NTStatus = 0xC0000061 STATUS_INVALID_ACCOUNT_NAME NTStatus = 0xC0000062 STATUS_USER_EXISTS NTStatus = 0xC0000063 STATUS_NO_SUCH_USER NTStatus = 0xC0000064 STATUS_GROUP_EXISTS NTStatus = 0xC0000065 STATUS_NO_SUCH_GROUP NTStatus = 0xC0000066 STATUS_MEMBER_IN_GROUP NTStatus = 0xC0000067 STATUS_MEMBER_NOT_IN_GROUP NTStatus = 0xC0000068 STATUS_LAST_ADMIN NTStatus = 0xC0000069 STATUS_WRONG_PASSWORD NTStatus = 0xC000006A STATUS_ILL_FORMED_PASSWORD NTStatus = 0xC000006B STATUS_PASSWORD_RESTRICTION NTStatus = 0xC000006C STATUS_LOGON_FAILURE NTStatus = 0xC000006D STATUS_ACCOUNT_RESTRICTION NTStatus = 0xC000006E STATUS_INVALID_LOGON_HOURS NTStatus = 0xC000006F STATUS_INVALID_WORKSTATION NTStatus = 0xC0000070 STATUS_PASSWORD_EXPIRED NTStatus = 0xC0000071 STATUS_ACCOUNT_DISABLED NTStatus = 0xC0000072 STATUS_NONE_MAPPED NTStatus = 0xC0000073 STATUS_TOO_MANY_LUIDS_REQUESTED NTStatus = 0xC0000074 STATUS_LUIDS_EXHAUSTED NTStatus = 0xC0000075 STATUS_INVALID_SUB_AUTHORITY NTStatus = 0xC0000076 STATUS_INVALID_ACL NTStatus = 0xC0000077 STATUS_INVALID_SID NTStatus = 0xC0000078 STATUS_INVALID_SECURITY_DESCR NTStatus = 0xC0000079 STATUS_PROCEDURE_NOT_FOUND NTStatus = 0xC000007A STATUS_INVALID_IMAGE_FORMAT NTStatus = 0xC000007B STATUS_NO_TOKEN NTStatus = 0xC000007C STATUS_BAD_INHERITANCE_ACL NTStatus = 0xC000007D STATUS_RANGE_NOT_LOCKED NTStatus = 0xC000007E STATUS_DISK_FULL NTStatus = 0xC000007F STATUS_SERVER_DISABLED NTStatus = 0xC0000080 STATUS_SERVER_NOT_DISABLED NTStatus = 0xC0000081 STATUS_TOO_MANY_GUIDS_REQUESTED NTStatus = 0xC0000082 STATUS_GUIDS_EXHAUSTED NTStatus = 0xC0000083 STATUS_INVALID_ID_AUTHORITY NTStatus = 0xC0000084 STATUS_AGENTS_EXHAUSTED NTStatus = 0xC0000085 STATUS_INVALID_VOLUME_LABEL NTStatus = 0xC0000086 STATUS_SECTION_NOT_EXTENDED NTStatus = 0xC0000087 STATUS_NOT_MAPPED_DATA NTStatus = 0xC0000088 STATUS_RESOURCE_DATA_NOT_FOUND NTStatus = 0xC0000089 STATUS_RESOURCE_TYPE_NOT_FOUND NTStatus = 0xC000008A STATUS_RESOURCE_NAME_NOT_FOUND NTStatus = 0xC000008B STATUS_ARRAY_BOUNDS_EXCEEDED NTStatus = 0xC000008C STATUS_FLOAT_DENORMAL_OPERAND NTStatus = 0xC000008D STATUS_FLOAT_DIVIDE_BY_ZERO NTStatus = 0xC000008E STATUS_FLOAT_INEXACT_RESULT NTStatus = 0xC000008F STATUS_FLOAT_INVALID_OPERATION NTStatus = 0xC0000090 STATUS_FLOAT_OVERFLOW NTStatus = 0xC0000091 STATUS_FLOAT_STACK_CHECK NTStatus = 0xC0000092 STATUS_FLOAT_UNDERFLOW NTStatus = 0xC0000093 STATUS_INTEGER_DIVIDE_BY_ZERO NTStatus = 0xC0000094 STATUS_INTEGER_OVERFLOW NTStatus = 0xC0000095 STATUS_PRIVILEGED_INSTRUCTION NTStatus = 0xC0000096 STATUS_TOO_MANY_PAGING_FILES NTStatus = 0xC0000097 STATUS_FILE_INVALID NTStatus = 0xC0000098 STATUS_ALLOTTED_SPACE_EXCEEDED NTStatus = 0xC0000099 STATUS_INSUFFICIENT_RESOURCES NTStatus = 0xC000009A STATUS_DFS_EXIT_PATH_FOUND NTStatus = 0xC000009B STATUS_DEVICE_DATA_ERROR NTStatus = 0xC000009C STATUS_DEVICE_NOT_CONNECTED NTStatus = 0xC000009D STATUS_DEVICE_POWER_FAILURE NTStatus = 0xC000009E STATUS_FREE_VM_NOT_AT_BASE NTStatus = 0xC000009F STATUS_MEMORY_NOT_ALLOCATED NTStatus = 0xC00000A0 STATUS_WORKING_SET_QUOTA NTStatus = 0xC00000A1 STATUS_MEDIA_WRITE_PROTECTED NTStatus = 0xC00000A2 STATUS_DEVICE_NOT_READY NTStatus = 0xC00000A3 STATUS_INVALID_GROUP_ATTRIBUTES NTStatus = 0xC00000A4 STATUS_BAD_IMPERSONATION_LEVEL NTStatus = 0xC00000A5 STATUS_CANT_OPEN_ANONYMOUS NTStatus = 0xC00000A6 STATUS_BAD_VALIDATION_CLASS NTStatus = 0xC00000A7 STATUS_BAD_TOKEN_TYPE NTStatus = 0xC00000A8 STATUS_BAD_MASTER_BOOT_RECORD NTStatus = 0xC00000A9 STATUS_INSTRUCTION_MISALIGNMENT NTStatus = 0xC00000AA STATUS_INSTANCE_NOT_AVAILABLE NTStatus = 0xC00000AB STATUS_PIPE_NOT_AVAILABLE NTStatus = 0xC00000AC STATUS_INVALID_PIPE_STATE NTStatus = 0xC00000AD STATUS_PIPE_BUSY NTStatus = 0xC00000AE STATUS_ILLEGAL_FUNCTION NTStatus = 0xC00000AF STATUS_PIPE_DISCONNECTED NTStatus = 0xC00000B0 STATUS_PIPE_CLOSING NTStatus = 0xC00000B1 STATUS_PIPE_CONNECTED NTStatus = 0xC00000B2 STATUS_PIPE_LISTENING NTStatus = 0xC00000B3 STATUS_INVALID_READ_MODE NTStatus = 0xC00000B4 STATUS_IO_TIMEOUT NTStatus = 0xC00000B5 STATUS_FILE_FORCED_CLOSED NTStatus = 0xC00000B6 STATUS_PROFILING_NOT_STARTED NTStatus = 0xC00000B7 STATUS_PROFILING_NOT_STOPPED NTStatus = 0xC00000B8 STATUS_COULD_NOT_INTERPRET NTStatus = 0xC00000B9 STATUS_FILE_IS_A_DIRECTORY NTStatus = 0xC00000BA STATUS_NOT_SUPPORTED NTStatus = 0xC00000BB STATUS_REMOTE_NOT_LISTENING NTStatus = 0xC00000BC STATUS_DUPLICATE_NAME NTStatus = 0xC00000BD STATUS_BAD_NETWORK_PATH NTStatus = 0xC00000BE STATUS_NETWORK_BUSY NTStatus = 0xC00000BF STATUS_DEVICE_DOES_NOT_EXIST NTStatus = 0xC00000C0 STATUS_TOO_MANY_COMMANDS NTStatus = 0xC00000C1 STATUS_ADAPTER_HARDWARE_ERROR NTStatus = 0xC00000C2 STATUS_INVALID_NETWORK_RESPONSE NTStatus = 0xC00000C3 STATUS_UNEXPECTED_NETWORK_ERROR NTStatus = 0xC00000C4 STATUS_BAD_REMOTE_ADAPTER NTStatus = 0xC00000C5 STATUS_PRINT_QUEUE_FULL NTStatus = 0xC00000C6 STATUS_NO_SPOOL_SPACE NTStatus = 0xC00000C7 STATUS_PRINT_CANCELLED NTStatus = 0xC00000C8 STATUS_NETWORK_NAME_DELETED NTStatus = 0xC00000C9 STATUS_NETWORK_ACCESS_DENIED NTStatus = 0xC00000CA STATUS_BAD_DEVICE_TYPE NTStatus = 0xC00000CB STATUS_BAD_NETWORK_NAME NTStatus = 0xC00000CC STATUS_TOO_MANY_NAMES NTStatus = 0xC00000CD STATUS_TOO_MANY_SESSIONS NTStatus = 0xC00000CE STATUS_SHARING_PAUSED NTStatus = 0xC00000CF STATUS_REQUEST_NOT_ACCEPTED NTStatus = 0xC00000D0 STATUS_REDIRECTOR_PAUSED NTStatus = 0xC00000D1 STATUS_NET_WRITE_FAULT NTStatus = 0xC00000D2 STATUS_PROFILING_AT_LIMIT NTStatus = 0xC00000D3 STATUS_NOT_SAME_DEVICE NTStatus = 0xC00000D4 STATUS_FILE_RENAMED NTStatus = 0xC00000D5 STATUS_VIRTUAL_CIRCUIT_CLOSED NTStatus = 0xC00000D6 STATUS_NO_SECURITY_ON_OBJECT NTStatus = 0xC00000D7 STATUS_CANT_WAIT NTStatus = 0xC00000D8 STATUS_PIPE_EMPTY NTStatus = 0xC00000D9 STATUS_CANT_ACCESS_DOMAIN_INFO NTStatus = 0xC00000DA STATUS_CANT_TERMINATE_SELF NTStatus = 0xC00000DB STATUS_INVALID_SERVER_STATE NTStatus = 0xC00000DC STATUS_INVALID_DOMAIN_STATE NTStatus = 0xC00000DD STATUS_INVALID_DOMAIN_ROLE NTStatus = 0xC00000DE STATUS_NO_SUCH_DOMAIN NTStatus = 0xC00000DF STATUS_DOMAIN_EXISTS NTStatus = 0xC00000E0 STATUS_DOMAIN_LIMIT_EXCEEDED NTStatus = 0xC00000E1 STATUS_OPLOCK_NOT_GRANTED NTStatus = 0xC00000E2 STATUS_INVALID_OPLOCK_PROTOCOL NTStatus = 0xC00000E3 STATUS_INTERNAL_DB_CORRUPTION NTStatus = 0xC00000E4 STATUS_INTERNAL_ERROR NTStatus = 0xC00000E5 STATUS_GENERIC_NOT_MAPPED NTStatus = 0xC00000E6 STATUS_BAD_DESCRIPTOR_FORMAT NTStatus = 0xC00000E7 STATUS_INVALID_USER_BUFFER NTStatus = 0xC00000E8 STATUS_UNEXPECTED_IO_ERROR NTStatus = 0xC00000E9 STATUS_UNEXPECTED_MM_CREATE_ERR NTStatus = 0xC00000EA STATUS_UNEXPECTED_MM_MAP_ERROR NTStatus = 0xC00000EB STATUS_UNEXPECTED_MM_EXTEND_ERR NTStatus = 0xC00000EC STATUS_NOT_LOGON_PROCESS NTStatus = 0xC00000ED STATUS_LOGON_SESSION_EXISTS NTStatus = 0xC00000EE STATUS_INVALID_PARAMETER_1 NTStatus = 0xC00000EF STATUS_INVALID_PARAMETER_2 NTStatus = 0xC00000F0 STATUS_INVALID_PARAMETER_3 NTStatus = 0xC00000F1 STATUS_INVALID_PARAMETER_4 NTStatus = 0xC00000F2 STATUS_INVALID_PARAMETER_5 NTStatus = 0xC00000F3 STATUS_INVALID_PARAMETER_6 NTStatus = 0xC00000F4 STATUS_INVALID_PARAMETER_7 NTStatus = 0xC00000F5 STATUS_INVALID_PARAMETER_8 NTStatus = 0xC00000F6 STATUS_INVALID_PARAMETER_9 NTStatus = 0xC00000F7 STATUS_INVALID_PARAMETER_10 NTStatus = 0xC00000F8 STATUS_INVALID_PARAMETER_11 NTStatus = 0xC00000F9 STATUS_INVALID_PARAMETER_12 NTStatus = 0xC00000FA STATUS_REDIRECTOR_NOT_STARTED NTStatus = 0xC00000FB STATUS_REDIRECTOR_STARTED NTStatus = 0xC00000FC STATUS_STACK_OVERFLOW NTStatus = 0xC00000FD STATUS_NO_SUCH_PACKAGE NTStatus = 0xC00000FE STATUS_BAD_FUNCTION_TABLE NTStatus = 0xC00000FF STATUS_VARIABLE_NOT_FOUND NTStatus = 0xC0000100 STATUS_DIRECTORY_NOT_EMPTY NTStatus = 0xC0000101 STATUS_FILE_CORRUPT_ERROR NTStatus = 0xC0000102 STATUS_NOT_A_DIRECTORY NTStatus = 0xC0000103 STATUS_BAD_LOGON_SESSION_STATE NTStatus = 0xC0000104 STATUS_LOGON_SESSION_COLLISION NTStatus = 0xC0000105 STATUS_NAME_TOO_LONG NTStatus = 0xC0000106 STATUS_FILES_OPEN NTStatus = 0xC0000107 STATUS_CONNECTION_IN_USE NTStatus = 0xC0000108 STATUS_MESSAGE_NOT_FOUND NTStatus = 0xC0000109 STATUS_PROCESS_IS_TERMINATING NTStatus = 0xC000010A STATUS_INVALID_LOGON_TYPE NTStatus = 0xC000010B STATUS_NO_GUID_TRANSLATION NTStatus = 0xC000010C STATUS_CANNOT_IMPERSONATE NTStatus = 0xC000010D STATUS_IMAGE_ALREADY_LOADED NTStatus = 0xC000010E STATUS_ABIOS_NOT_PRESENT NTStatus = 0xC000010F STATUS_ABIOS_LID_NOT_EXIST NTStatus = 0xC0000110 STATUS_ABIOS_LID_ALREADY_OWNED NTStatus = 0xC0000111 STATUS_ABIOS_NOT_LID_OWNER NTStatus = 0xC0000112 STATUS_ABIOS_INVALID_COMMAND NTStatus = 0xC0000113 STATUS_ABIOS_INVALID_LID NTStatus = 0xC0000114 STATUS_ABIOS_SELECTOR_NOT_AVAILABLE NTStatus = 0xC0000115 STATUS_ABIOS_INVALID_SELECTOR NTStatus = 0xC0000116 STATUS_NO_LDT NTStatus = 0xC0000117 STATUS_INVALID_LDT_SIZE NTStatus = 0xC0000118 STATUS_INVALID_LDT_OFFSET NTStatus = 0xC0000119 STATUS_INVALID_LDT_DESCRIPTOR NTStatus = 0xC000011A STATUS_INVALID_IMAGE_NE_FORMAT NTStatus = 0xC000011B STATUS_RXACT_INVALID_STATE NTStatus = 0xC000011C STATUS_RXACT_COMMIT_FAILURE NTStatus = 0xC000011D STATUS_MAPPED_FILE_SIZE_ZERO NTStatus = 0xC000011E STATUS_TOO_MANY_OPENED_FILES NTStatus = 0xC000011F STATUS_CANCELLED NTStatus = 0xC0000120 STATUS_CANNOT_DELETE NTStatus = 0xC0000121 STATUS_INVALID_COMPUTER_NAME NTStatus = 0xC0000122 STATUS_FILE_DELETED NTStatus = 0xC0000123 STATUS_SPECIAL_ACCOUNT NTStatus = 0xC0000124 STATUS_SPECIAL_GROUP NTStatus = 0xC0000125 STATUS_SPECIAL_USER NTStatus = 0xC0000126 STATUS_MEMBERS_PRIMARY_GROUP NTStatus = 0xC0000127 STATUS_FILE_CLOSED NTStatus = 0xC0000128 STATUS_TOO_MANY_THREADS NTStatus = 0xC0000129 STATUS_THREAD_NOT_IN_PROCESS NTStatus = 0xC000012A STATUS_TOKEN_ALREADY_IN_USE NTStatus = 0xC000012B STATUS_PAGEFILE_QUOTA_EXCEEDED NTStatus = 0xC000012C STATUS_COMMITMENT_LIMIT NTStatus = 0xC000012D STATUS_INVALID_IMAGE_LE_FORMAT NTStatus = 0xC000012E STATUS_INVALID_IMAGE_NOT_MZ NTStatus = 0xC000012F STATUS_INVALID_IMAGE_PROTECT NTStatus = 0xC0000130 STATUS_INVALID_IMAGE_WIN_16 NTStatus = 0xC0000131 STATUS_LOGON_SERVER_CONFLICT NTStatus = 0xC0000132 STATUS_TIME_DIFFERENCE_AT_DC NTStatus = 0xC0000133 STATUS_SYNCHRONIZATION_REQUIRED NTStatus = 0xC0000134 STATUS_DLL_NOT_FOUND NTStatus = 0xC0000135 STATUS_OPEN_FAILED NTStatus = 0xC0000136 STATUS_IO_PRIVILEGE_FAILED NTStatus = 0xC0000137 STATUS_ORDINAL_NOT_FOUND NTStatus = 0xC0000138 STATUS_ENTRYPOINT_NOT_FOUND NTStatus = 0xC0000139 STATUS_CONTROL_C_EXIT NTStatus = 0xC000013A STATUS_LOCAL_DISCONNECT NTStatus = 0xC000013B STATUS_REMOTE_DISCONNECT NTStatus = 0xC000013C STATUS_REMOTE_RESOURCES NTStatus = 0xC000013D STATUS_LINK_FAILED NTStatus = 0xC000013E STATUS_LINK_TIMEOUT NTStatus = 0xC000013F STATUS_INVALID_CONNECTION NTStatus = 0xC0000140 STATUS_INVALID_ADDRESS NTStatus = 0xC0000141 STATUS_DLL_INIT_FAILED NTStatus = 0xC0000142 STATUS_MISSING_SYSTEMFILE NTStatus = 0xC0000143 STATUS_UNHANDLED_EXCEPTION NTStatus = 0xC0000144 STATUS_APP_INIT_FAILURE NTStatus = 0xC0000145 STATUS_PAGEFILE_CREATE_FAILED NTStatus = 0xC0000146 STATUS_NO_PAGEFILE NTStatus = 0xC0000147 STATUS_INVALID_LEVEL NTStatus = 0xC0000148 STATUS_WRONG_PASSWORD_CORE NTStatus = 0xC0000149 STATUS_ILLEGAL_FLOAT_CONTEXT NTStatus = 0xC000014A STATUS_PIPE_BROKEN NTStatus = 0xC000014B STATUS_REGISTRY_CORRUPT NTStatus = 0xC000014C STATUS_REGISTRY_IO_FAILED NTStatus = 0xC000014D STATUS_NO_EVENT_PAIR NTStatus = 0xC000014E STATUS_UNRECOGNIZED_VOLUME NTStatus = 0xC000014F STATUS_SERIAL_NO_DEVICE_INITED NTStatus = 0xC0000150 STATUS_NO_SUCH_ALIAS NTStatus = 0xC0000151 STATUS_MEMBER_NOT_IN_ALIAS NTStatus = 0xC0000152 STATUS_MEMBER_IN_ALIAS NTStatus = 0xC0000153 STATUS_ALIAS_EXISTS NTStatus = 0xC0000154 STATUS_LOGON_NOT_GRANTED NTStatus = 0xC0000155 STATUS_TOO_MANY_SECRETS NTStatus = 0xC0000156 STATUS_SECRET_TOO_LONG NTStatus = 0xC0000157 STATUS_INTERNAL_DB_ERROR NTStatus = 0xC0000158 STATUS_FULLSCREEN_MODE NTStatus = 0xC0000159 STATUS_TOO_MANY_CONTEXT_IDS NTStatus = 0xC000015A STATUS_LOGON_TYPE_NOT_GRANTED NTStatus = 0xC000015B STATUS_NOT_REGISTRY_FILE NTStatus = 0xC000015C STATUS_NT_CROSS_ENCRYPTION_REQUIRED NTStatus = 0xC000015D STATUS_DOMAIN_CTRLR_CONFIG_ERROR NTStatus = 0xC000015E STATUS_FT_MISSING_MEMBER NTStatus = 0xC000015F STATUS_ILL_FORMED_SERVICE_ENTRY NTStatus = 0xC0000160 STATUS_ILLEGAL_CHARACTER NTStatus = 0xC0000161 STATUS_UNMAPPABLE_CHARACTER NTStatus = 0xC0000162 STATUS_UNDEFINED_CHARACTER NTStatus = 0xC0000163 STATUS_FLOPPY_VOLUME NTStatus = 0xC0000164 STATUS_FLOPPY_ID_MARK_NOT_FOUND NTStatus = 0xC0000165 STATUS_FLOPPY_WRONG_CYLINDER NTStatus = 0xC0000166 STATUS_FLOPPY_UNKNOWN_ERROR NTStatus = 0xC0000167 STATUS_FLOPPY_BAD_REGISTERS NTStatus = 0xC0000168 STATUS_DISK_RECALIBRATE_FAILED NTStatus = 0xC0000169 STATUS_DISK_OPERATION_FAILED NTStatus = 0xC000016A STATUS_DISK_RESET_FAILED NTStatus = 0xC000016B STATUS_SHARED_IRQ_BUSY NTStatus = 0xC000016C STATUS_FT_ORPHANING NTStatus = 0xC000016D STATUS_BIOS_FAILED_TO_CONNECT_INTERRUPT NTStatus = 0xC000016E STATUS_PARTITION_FAILURE NTStatus = 0xC0000172 STATUS_INVALID_BLOCK_LENGTH NTStatus = 0xC0000173 STATUS_DEVICE_NOT_PARTITIONED NTStatus = 0xC0000174 STATUS_UNABLE_TO_LOCK_MEDIA NTStatus = 0xC0000175 STATUS_UNABLE_TO_UNLOAD_MEDIA NTStatus = 0xC0000176 STATUS_EOM_OVERFLOW NTStatus = 0xC0000177 STATUS_NO_MEDIA NTStatus = 0xC0000178 STATUS_NO_SUCH_MEMBER NTStatus = 0xC000017A STATUS_INVALID_MEMBER NTStatus = 0xC000017B STATUS_KEY_DELETED NTStatus = 0xC000017C STATUS_NO_LOG_SPACE NTStatus = 0xC000017D STATUS_TOO_MANY_SIDS NTStatus = 0xC000017E STATUS_LM_CROSS_ENCRYPTION_REQUIRED NTStatus = 0xC000017F STATUS_KEY_HAS_CHILDREN NTStatus = 0xC0000180 STATUS_CHILD_MUST_BE_VOLATILE NTStatus = 0xC0000181 STATUS_DEVICE_CONFIGURATION_ERROR NTStatus = 0xC0000182 STATUS_DRIVER_INTERNAL_ERROR NTStatus = 0xC0000183 STATUS_INVALID_DEVICE_STATE NTStatus = 0xC0000184 STATUS_IO_DEVICE_ERROR NTStatus = 0xC0000185 STATUS_DEVICE_PROTOCOL_ERROR NTStatus = 0xC0000186 STATUS_BACKUP_CONTROLLER NTStatus = 0xC0000187 STATUS_LOG_FILE_FULL NTStatus = 0xC0000188 STATUS_TOO_LATE NTStatus = 0xC0000189 STATUS_NO_TRUST_LSA_SECRET NTStatus = 0xC000018A STATUS_NO_TRUST_SAM_ACCOUNT NTStatus = 0xC000018B STATUS_TRUSTED_DOMAIN_FAILURE NTStatus = 0xC000018C STATUS_TRUSTED_RELATIONSHIP_FAILURE NTStatus = 0xC000018D STATUS_EVENTLOG_FILE_CORRUPT NTStatus = 0xC000018E STATUS_EVENTLOG_CANT_START NTStatus = 0xC000018F STATUS_TRUST_FAILURE NTStatus = 0xC0000190 STATUS_MUTANT_LIMIT_EXCEEDED NTStatus = 0xC0000191 STATUS_NETLOGON_NOT_STARTED NTStatus = 0xC0000192 STATUS_ACCOUNT_EXPIRED NTStatus = 0xC0000193 STATUS_POSSIBLE_DEADLOCK NTStatus = 0xC0000194 STATUS_NETWORK_CREDENTIAL_CONFLICT NTStatus = 0xC0000195 STATUS_REMOTE_SESSION_LIMIT NTStatus = 0xC0000196 STATUS_EVENTLOG_FILE_CHANGED NTStatus = 0xC0000197 STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT NTStatus = 0xC0000198 STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT NTStatus = 0xC0000199 STATUS_NOLOGON_SERVER_TRUST_ACCOUNT NTStatus = 0xC000019A STATUS_DOMAIN_TRUST_INCONSISTENT NTStatus = 0xC000019B STATUS_FS_DRIVER_REQUIRED NTStatus = 0xC000019C STATUS_IMAGE_ALREADY_LOADED_AS_DLL NTStatus = 0xC000019D STATUS_INCOMPATIBLE_WITH_GLOBAL_SHORT_NAME_REGISTRY_SETTING NTStatus = 0xC000019E STATUS_SHORT_NAMES_NOT_ENABLED_ON_VOLUME NTStatus = 0xC000019F STATUS_SECURITY_STREAM_IS_INCONSISTENT NTStatus = 0xC00001A0 STATUS_INVALID_LOCK_RANGE NTStatus = 0xC00001A1 STATUS_INVALID_ACE_CONDITION NTStatus = 0xC00001A2 STATUS_IMAGE_SUBSYSTEM_NOT_PRESENT NTStatus = 0xC00001A3 STATUS_NOTIFICATION_GUID_ALREADY_DEFINED NTStatus = 0xC00001A4 STATUS_INVALID_EXCEPTION_HANDLER NTStatus = 0xC00001A5 STATUS_DUPLICATE_PRIVILEGES NTStatus = 0xC00001A6 STATUS_NOT_ALLOWED_ON_SYSTEM_FILE NTStatus = 0xC00001A7 STATUS_REPAIR_NEEDED NTStatus = 0xC00001A8 STATUS_QUOTA_NOT_ENABLED NTStatus = 0xC00001A9 STATUS_NO_APPLICATION_PACKAGE NTStatus = 0xC00001AA STATUS_FILE_METADATA_OPTIMIZATION_IN_PROGRESS NTStatus = 0xC00001AB STATUS_NOT_SAME_OBJECT NTStatus = 0xC00001AC STATUS_FATAL_MEMORY_EXHAUSTION NTStatus = 0xC00001AD STATUS_ERROR_PROCESS_NOT_IN_JOB NTStatus = 0xC00001AE STATUS_CPU_SET_INVALID NTStatus = 0xC00001AF STATUS_IO_DEVICE_INVALID_DATA NTStatus = 0xC00001B0 STATUS_IO_UNALIGNED_WRITE NTStatus = 0xC00001B1 STATUS_NETWORK_OPEN_RESTRICTION NTStatus = 0xC0000201 STATUS_NO_USER_SESSION_KEY NTStatus = 0xC0000202 STATUS_USER_SESSION_DELETED NTStatus = 0xC0000203 STATUS_RESOURCE_LANG_NOT_FOUND NTStatus = 0xC0000204 STATUS_INSUFF_SERVER_RESOURCES NTStatus = 0xC0000205 STATUS_INVALID_BUFFER_SIZE NTStatus = 0xC0000206 STATUS_INVALID_ADDRESS_COMPONENT NTStatus = 0xC0000207 STATUS_INVALID_ADDRESS_WILDCARD NTStatus = 0xC0000208 STATUS_TOO_MANY_ADDRESSES NTStatus = 0xC0000209 STATUS_ADDRESS_ALREADY_EXISTS NTStatus = 0xC000020A STATUS_ADDRESS_CLOSED NTStatus = 0xC000020B STATUS_CONNECTION_DISCONNECTED NTStatus = 0xC000020C STATUS_CONNECTION_RESET NTStatus = 0xC000020D STATUS_TOO_MANY_NODES NTStatus = 0xC000020E STATUS_TRANSACTION_ABORTED NTStatus = 0xC000020F STATUS_TRANSACTION_TIMED_OUT NTStatus = 0xC0000210 STATUS_TRANSACTION_NO_RELEASE NTStatus = 0xC0000211 STATUS_TRANSACTION_NO_MATCH NTStatus = 0xC0000212 STATUS_TRANSACTION_RESPONDED NTStatus = 0xC0000213 STATUS_TRANSACTION_INVALID_ID NTStatus = 0xC0000214 STATUS_TRANSACTION_INVALID_TYPE NTStatus = 0xC0000215 STATUS_NOT_SERVER_SESSION NTStatus = 0xC0000216 STATUS_NOT_CLIENT_SESSION NTStatus = 0xC0000217 STATUS_CANNOT_LOAD_REGISTRY_FILE NTStatus = 0xC0000218 STATUS_DEBUG_ATTACH_FAILED NTStatus = 0xC0000219 STATUS_SYSTEM_PROCESS_TERMINATED NTStatus = 0xC000021A STATUS_DATA_NOT_ACCEPTED NTStatus = 0xC000021B STATUS_NO_BROWSER_SERVERS_FOUND NTStatus = 0xC000021C STATUS_VDM_HARD_ERROR NTStatus = 0xC000021D STATUS_DRIVER_CANCEL_TIMEOUT NTStatus = 0xC000021E STATUS_REPLY_MESSAGE_MISMATCH NTStatus = 0xC000021F STATUS_MAPPED_ALIGNMENT NTStatus = 0xC0000220 STATUS_IMAGE_CHECKSUM_MISMATCH NTStatus = 0xC0000221 STATUS_LOST_WRITEBEHIND_DATA NTStatus = 0xC0000222 STATUS_CLIENT_SERVER_PARAMETERS_INVALID NTStatus = 0xC0000223 STATUS_PASSWORD_MUST_CHANGE NTStatus = 0xC0000224 STATUS_NOT_FOUND NTStatus = 0xC0000225 STATUS_NOT_TINY_STREAM NTStatus = 0xC0000226 STATUS_RECOVERY_FAILURE NTStatus = 0xC0000227 STATUS_STACK_OVERFLOW_READ NTStatus = 0xC0000228 STATUS_FAIL_CHECK NTStatus = 0xC0000229 STATUS_DUPLICATE_OBJECTID NTStatus = 0xC000022A STATUS_OBJECTID_EXISTS NTStatus = 0xC000022B STATUS_CONVERT_TO_LARGE NTStatus = 0xC000022C STATUS_RETRY NTStatus = 0xC000022D STATUS_FOUND_OUT_OF_SCOPE NTStatus = 0xC000022E STATUS_ALLOCATE_BUCKET NTStatus = 0xC000022F STATUS_PROPSET_NOT_FOUND NTStatus = 0xC0000230 STATUS_MARSHALL_OVERFLOW NTStatus = 0xC0000231 STATUS_INVALID_VARIANT NTStatus = 0xC0000232 STATUS_DOMAIN_CONTROLLER_NOT_FOUND NTStatus = 0xC0000233 STATUS_ACCOUNT_LOCKED_OUT NTStatus = 0xC0000234 STATUS_HANDLE_NOT_CLOSABLE NTStatus = 0xC0000235 STATUS_CONNECTION_REFUSED NTStatus = 0xC0000236 STATUS_GRACEFUL_DISCONNECT NTStatus = 0xC0000237 STATUS_ADDRESS_ALREADY_ASSOCIATED NTStatus = 0xC0000238 STATUS_ADDRESS_NOT_ASSOCIATED NTStatus = 0xC0000239 STATUS_CONNECTION_INVALID NTStatus = 0xC000023A STATUS_CONNECTION_ACTIVE NTStatus = 0xC000023B STATUS_NETWORK_UNREACHABLE NTStatus = 0xC000023C STATUS_HOST_UNREACHABLE NTStatus = 0xC000023D STATUS_PROTOCOL_UNREACHABLE NTStatus = 0xC000023E STATUS_PORT_UNREACHABLE NTStatus = 0xC000023F STATUS_REQUEST_ABORTED NTStatus = 0xC0000240 STATUS_CONNECTION_ABORTED NTStatus = 0xC0000241 STATUS_BAD_COMPRESSION_BUFFER NTStatus = 0xC0000242 STATUS_USER_MAPPED_FILE NTStatus = 0xC0000243 STATUS_AUDIT_FAILED NTStatus = 0xC0000244 STATUS_TIMER_RESOLUTION_NOT_SET NTStatus = 0xC0000245 STATUS_CONNECTION_COUNT_LIMIT NTStatus = 0xC0000246 STATUS_LOGIN_TIME_RESTRICTION NTStatus = 0xC0000247 STATUS_LOGIN_WKSTA_RESTRICTION NTStatus = 0xC0000248 STATUS_IMAGE_MP_UP_MISMATCH NTStatus = 0xC0000249 STATUS_INSUFFICIENT_LOGON_INFO NTStatus = 0xC0000250 STATUS_BAD_DLL_ENTRYPOINT NTStatus = 0xC0000251 STATUS_BAD_SERVICE_ENTRYPOINT NTStatus = 0xC0000252 STATUS_LPC_REPLY_LOST NTStatus = 0xC0000253 STATUS_IP_ADDRESS_CONFLICT1 NTStatus = 0xC0000254 STATUS_IP_ADDRESS_CONFLICT2 NTStatus = 0xC0000255 STATUS_REGISTRY_QUOTA_LIMIT NTStatus = 0xC0000256 STATUS_PATH_NOT_COVERED NTStatus = 0xC0000257 STATUS_NO_CALLBACK_ACTIVE NTStatus = 0xC0000258 STATUS_LICENSE_QUOTA_EXCEEDED NTStatus = 0xC0000259 STATUS_PWD_TOO_SHORT NTStatus = 0xC000025A STATUS_PWD_TOO_RECENT NTStatus = 0xC000025B STATUS_PWD_HISTORY_CONFLICT NTStatus = 0xC000025C STATUS_PLUGPLAY_NO_DEVICE NTStatus = 0xC000025E STATUS_UNSUPPORTED_COMPRESSION NTStatus = 0xC000025F STATUS_INVALID_HW_PROFILE NTStatus = 0xC0000260 STATUS_INVALID_PLUGPLAY_DEVICE_PATH NTStatus = 0xC0000261 STATUS_DRIVER_ORDINAL_NOT_FOUND NTStatus = 0xC0000262 STATUS_DRIVER_ENTRYPOINT_NOT_FOUND NTStatus = 0xC0000263 STATUS_RESOURCE_NOT_OWNED NTStatus = 0xC0000264 STATUS_TOO_MANY_LINKS NTStatus = 0xC0000265 STATUS_QUOTA_LIST_INCONSISTENT NTStatus = 0xC0000266 STATUS_FILE_IS_OFFLINE NTStatus = 0xC0000267 STATUS_EVALUATION_EXPIRATION NTStatus = 0xC0000268 STATUS_ILLEGAL_DLL_RELOCATION NTStatus = 0xC0000269 STATUS_LICENSE_VIOLATION NTStatus = 0xC000026A STATUS_DLL_INIT_FAILED_LOGOFF NTStatus = 0xC000026B STATUS_DRIVER_UNABLE_TO_LOAD NTStatus = 0xC000026C STATUS_DFS_UNAVAILABLE NTStatus = 0xC000026D STATUS_VOLUME_DISMOUNTED NTStatus = 0xC000026E STATUS_WX86_INTERNAL_ERROR NTStatus = 0xC000026F STATUS_WX86_FLOAT_STACK_CHECK NTStatus = 0xC0000270 STATUS_VALIDATE_CONTINUE NTStatus = 0xC0000271 STATUS_NO_MATCH NTStatus = 0xC0000272 STATUS_NO_MORE_MATCHES NTStatus = 0xC0000273 STATUS_NOT_A_REPARSE_POINT NTStatus = 0xC0000275 STATUS_IO_REPARSE_TAG_INVALID NTStatus = 0xC0000276 STATUS_IO_REPARSE_TAG_MISMATCH NTStatus = 0xC0000277 STATUS_IO_REPARSE_DATA_INVALID NTStatus = 0xC0000278 STATUS_IO_REPARSE_TAG_NOT_HANDLED NTStatus = 0xC0000279 STATUS_PWD_TOO_LONG NTStatus = 0xC000027A STATUS_STOWED_EXCEPTION NTStatus = 0xC000027B STATUS_CONTEXT_STOWED_EXCEPTION NTStatus = 0xC000027C STATUS_REPARSE_POINT_NOT_RESOLVED NTStatus = 0xC0000280 STATUS_DIRECTORY_IS_A_REPARSE_POINT NTStatus = 0xC0000281 STATUS_RANGE_LIST_CONFLICT NTStatus = 0xC0000282 STATUS_SOURCE_ELEMENT_EMPTY NTStatus = 0xC0000283 STATUS_DESTINATION_ELEMENT_FULL NTStatus = 0xC0000284 STATUS_ILLEGAL_ELEMENT_ADDRESS NTStatus = 0xC0000285 STATUS_MAGAZINE_NOT_PRESENT NTStatus = 0xC0000286 STATUS_REINITIALIZATION_NEEDED NTStatus = 0xC0000287 STATUS_DEVICE_REQUIRES_CLEANING NTStatus = 0x80000288 STATUS_DEVICE_DOOR_OPEN NTStatus = 0x80000289 STATUS_ENCRYPTION_FAILED NTStatus = 0xC000028A STATUS_DECRYPTION_FAILED NTStatus = 0xC000028B STATUS_RANGE_NOT_FOUND NTStatus = 0xC000028C STATUS_NO_RECOVERY_POLICY NTStatus = 0xC000028D STATUS_NO_EFS NTStatus = 0xC000028E STATUS_WRONG_EFS NTStatus = 0xC000028F STATUS_NO_USER_KEYS NTStatus = 0xC0000290 STATUS_FILE_NOT_ENCRYPTED NTStatus = 0xC0000291 STATUS_NOT_EXPORT_FORMAT NTStatus = 0xC0000292 STATUS_FILE_ENCRYPTED NTStatus = 0xC0000293 STATUS_WAKE_SYSTEM NTStatus = 0x40000294 STATUS_WMI_GUID_NOT_FOUND NTStatus = 0xC0000295 STATUS_WMI_INSTANCE_NOT_FOUND NTStatus = 0xC0000296 STATUS_WMI_ITEMID_NOT_FOUND NTStatus = 0xC0000297 STATUS_WMI_TRY_AGAIN NTStatus = 0xC0000298 STATUS_SHARED_POLICY NTStatus = 0xC0000299 STATUS_POLICY_OBJECT_NOT_FOUND NTStatus = 0xC000029A STATUS_POLICY_ONLY_IN_DS NTStatus = 0xC000029B STATUS_VOLUME_NOT_UPGRADED NTStatus = 0xC000029C STATUS_REMOTE_STORAGE_NOT_ACTIVE NTStatus = 0xC000029D STATUS_REMOTE_STORAGE_MEDIA_ERROR NTStatus = 0xC000029E STATUS_NO_TRACKING_SERVICE NTStatus = 0xC000029F STATUS_SERVER_SID_MISMATCH NTStatus = 0xC00002A0 STATUS_DS_NO_ATTRIBUTE_OR_VALUE NTStatus = 0xC00002A1 STATUS_DS_INVALID_ATTRIBUTE_SYNTAX NTStatus = 0xC00002A2 STATUS_DS_ATTRIBUTE_TYPE_UNDEFINED NTStatus = 0xC00002A3 STATUS_DS_ATTRIBUTE_OR_VALUE_EXISTS NTStatus = 0xC00002A4 STATUS_DS_BUSY NTStatus = 0xC00002A5 STATUS_DS_UNAVAILABLE NTStatus = 0xC00002A6 STATUS_DS_NO_RIDS_ALLOCATED NTStatus = 0xC00002A7 STATUS_DS_NO_MORE_RIDS NTStatus = 0xC00002A8 STATUS_DS_INCORRECT_ROLE_OWNER NTStatus = 0xC00002A9 STATUS_DS_RIDMGR_INIT_ERROR NTStatus = 0xC00002AA STATUS_DS_OBJ_CLASS_VIOLATION NTStatus = 0xC00002AB STATUS_DS_CANT_ON_NON_LEAF NTStatus = 0xC00002AC STATUS_DS_CANT_ON_RDN NTStatus = 0xC00002AD STATUS_DS_CANT_MOD_OBJ_CLASS NTStatus = 0xC00002AE STATUS_DS_CROSS_DOM_MOVE_FAILED NTStatus = 0xC00002AF STATUS_DS_GC_NOT_AVAILABLE NTStatus = 0xC00002B0 STATUS_DIRECTORY_SERVICE_REQUIRED NTStatus = 0xC00002B1 STATUS_REPARSE_ATTRIBUTE_CONFLICT NTStatus = 0xC00002B2 STATUS_CANT_ENABLE_DENY_ONLY NTStatus = 0xC00002B3 STATUS_FLOAT_MULTIPLE_FAULTS NTStatus = 0xC00002B4 STATUS_FLOAT_MULTIPLE_TRAPS NTStatus = 0xC00002B5 STATUS_DEVICE_REMOVED NTStatus = 0xC00002B6 STATUS_JOURNAL_DELETE_IN_PROGRESS NTStatus = 0xC00002B7 STATUS_JOURNAL_NOT_ACTIVE NTStatus = 0xC00002B8 STATUS_NOINTERFACE NTStatus = 0xC00002B9 STATUS_DS_RIDMGR_DISABLED NTStatus = 0xC00002BA STATUS_DS_ADMIN_LIMIT_EXCEEDED NTStatus = 0xC00002C1 STATUS_DRIVER_FAILED_SLEEP NTStatus = 0xC00002C2 STATUS_MUTUAL_AUTHENTICATION_FAILED NTStatus = 0xC00002C3 STATUS_CORRUPT_SYSTEM_FILE NTStatus = 0xC00002C4 STATUS_DATATYPE_MISALIGNMENT_ERROR NTStatus = 0xC00002C5 STATUS_WMI_READ_ONLY NTStatus = 0xC00002C6 STATUS_WMI_SET_FAILURE NTStatus = 0xC00002C7 STATUS_COMMITMENT_MINIMUM NTStatus = 0xC00002C8 STATUS_REG_NAT_CONSUMPTION NTStatus = 0xC00002C9 STATUS_TRANSPORT_FULL NTStatus = 0xC00002CA STATUS_DS_SAM_INIT_FAILURE NTStatus = 0xC00002CB STATUS_ONLY_IF_CONNECTED NTStatus = 0xC00002CC STATUS_DS_SENSITIVE_GROUP_VIOLATION NTStatus = 0xC00002CD STATUS_PNP_RESTART_ENUMERATION NTStatus = 0xC00002CE STATUS_JOURNAL_ENTRY_DELETED NTStatus = 0xC00002CF STATUS_DS_CANT_MOD_PRIMARYGROUPID NTStatus = 0xC00002D0 STATUS_SYSTEM_IMAGE_BAD_SIGNATURE NTStatus = 0xC00002D1 STATUS_PNP_REBOOT_REQUIRED NTStatus = 0xC00002D2 STATUS_POWER_STATE_INVALID NTStatus = 0xC00002D3 STATUS_DS_INVALID_GROUP_TYPE NTStatus = 0xC00002D4 STATUS_DS_NO_NEST_GLOBALGROUP_IN_MIXEDDOMAIN NTStatus = 0xC00002D5 STATUS_DS_NO_NEST_LOCALGROUP_IN_MIXEDDOMAIN NTStatus = 0xC00002D6 STATUS_DS_GLOBAL_CANT_HAVE_LOCAL_MEMBER NTStatus = 0xC00002D7 STATUS_DS_GLOBAL_CANT_HAVE_UNIVERSAL_MEMBER NTStatus = 0xC00002D8 STATUS_DS_UNIVERSAL_CANT_HAVE_LOCAL_MEMBER NTStatus = 0xC00002D9 STATUS_DS_GLOBAL_CANT_HAVE_CROSSDOMAIN_MEMBER NTStatus = 0xC00002DA STATUS_DS_LOCAL_CANT_HAVE_CROSSDOMAIN_LOCAL_MEMBER NTStatus = 0xC00002DB STATUS_DS_HAVE_PRIMARY_MEMBERS NTStatus = 0xC00002DC STATUS_WMI_NOT_SUPPORTED NTStatus = 0xC00002DD STATUS_INSUFFICIENT_POWER NTStatus = 0xC00002DE STATUS_SAM_NEED_BOOTKEY_PASSWORD NTStatus = 0xC00002DF STATUS_SAM_NEED_BOOTKEY_FLOPPY NTStatus = 0xC00002E0 STATUS_DS_CANT_START NTStatus = 0xC00002E1 STATUS_DS_INIT_FAILURE NTStatus = 0xC00002E2 STATUS_SAM_INIT_FAILURE NTStatus = 0xC00002E3 STATUS_DS_GC_REQUIRED NTStatus = 0xC00002E4 STATUS_DS_LOCAL_MEMBER_OF_LOCAL_ONLY NTStatus = 0xC00002E5 STATUS_DS_NO_FPO_IN_UNIVERSAL_GROUPS NTStatus = 0xC00002E6 STATUS_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED NTStatus = 0xC00002E7 STATUS_MULTIPLE_FAULT_VIOLATION NTStatus = 0xC00002E8 STATUS_CURRENT_DOMAIN_NOT_ALLOWED NTStatus = 0xC00002E9 STATUS_CANNOT_MAKE NTStatus = 0xC00002EA STATUS_SYSTEM_SHUTDOWN NTStatus = 0xC00002EB STATUS_DS_INIT_FAILURE_CONSOLE NTStatus = 0xC00002EC STATUS_DS_SAM_INIT_FAILURE_CONSOLE NTStatus = 0xC00002ED STATUS_UNFINISHED_CONTEXT_DELETED NTStatus = 0xC00002EE STATUS_NO_TGT_REPLY NTStatus = 0xC00002EF STATUS_OBJECTID_NOT_FOUND NTStatus = 0xC00002F0 STATUS_NO_IP_ADDRESSES NTStatus = 0xC00002F1 STATUS_WRONG_CREDENTIAL_HANDLE NTStatus = 0xC00002F2 STATUS_CRYPTO_SYSTEM_INVALID NTStatus = 0xC00002F3 STATUS_MAX_REFERRALS_EXCEEDED NTStatus = 0xC00002F4 STATUS_MUST_BE_KDC NTStatus = 0xC00002F5 STATUS_STRONG_CRYPTO_NOT_SUPPORTED NTStatus = 0xC00002F6 STATUS_TOO_MANY_PRINCIPALS NTStatus = 0xC00002F7 STATUS_NO_PA_DATA NTStatus = 0xC00002F8 STATUS_PKINIT_NAME_MISMATCH NTStatus = 0xC00002F9 STATUS_SMARTCARD_LOGON_REQUIRED NTStatus = 0xC00002FA STATUS_KDC_INVALID_REQUEST NTStatus = 0xC00002FB STATUS_KDC_UNABLE_TO_REFER NTStatus = 0xC00002FC STATUS_KDC_UNKNOWN_ETYPE NTStatus = 0xC00002FD STATUS_SHUTDOWN_IN_PROGRESS NTStatus = 0xC00002FE STATUS_SERVER_SHUTDOWN_IN_PROGRESS NTStatus = 0xC00002FF STATUS_NOT_SUPPORTED_ON_SBS NTStatus = 0xC0000300 STATUS_WMI_GUID_DISCONNECTED NTStatus = 0xC0000301 STATUS_WMI_ALREADY_DISABLED NTStatus = 0xC0000302 STATUS_WMI_ALREADY_ENABLED NTStatus = 0xC0000303 STATUS_MFT_TOO_FRAGMENTED NTStatus = 0xC0000304 STATUS_COPY_PROTECTION_FAILURE NTStatus = 0xC0000305 STATUS_CSS_AUTHENTICATION_FAILURE NTStatus = 0xC0000306 STATUS_CSS_KEY_NOT_PRESENT NTStatus = 0xC0000307 STATUS_CSS_KEY_NOT_ESTABLISHED NTStatus = 0xC0000308 STATUS_CSS_SCRAMBLED_SECTOR NTStatus = 0xC0000309 STATUS_CSS_REGION_MISMATCH NTStatus = 0xC000030A STATUS_CSS_RESETS_EXHAUSTED NTStatus = 0xC000030B STATUS_PASSWORD_CHANGE_REQUIRED NTStatus = 0xC000030C STATUS_LOST_MODE_LOGON_RESTRICTION NTStatus = 0xC000030D STATUS_PKINIT_FAILURE NTStatus = 0xC0000320 STATUS_SMARTCARD_SUBSYSTEM_FAILURE NTStatus = 0xC0000321 STATUS_NO_KERB_KEY NTStatus = 0xC0000322 STATUS_HOST_DOWN NTStatus = 0xC0000350 STATUS_UNSUPPORTED_PREAUTH NTStatus = 0xC0000351 STATUS_EFS_ALG_BLOB_TOO_BIG NTStatus = 0xC0000352 STATUS_PORT_NOT_SET NTStatus = 0xC0000353 STATUS_DEBUGGER_INACTIVE NTStatus = 0xC0000354 STATUS_DS_VERSION_CHECK_FAILURE NTStatus = 0xC0000355 STATUS_AUDITING_DISABLED NTStatus = 0xC0000356 STATUS_PRENT4_MACHINE_ACCOUNT NTStatus = 0xC0000357 STATUS_DS_AG_CANT_HAVE_UNIVERSAL_MEMBER NTStatus = 0xC0000358 STATUS_INVALID_IMAGE_WIN_32 NTStatus = 0xC0000359 STATUS_INVALID_IMAGE_WIN_64 NTStatus = 0xC000035A STATUS_BAD_BINDINGS NTStatus = 0xC000035B STATUS_NETWORK_SESSION_EXPIRED NTStatus = 0xC000035C STATUS_APPHELP_BLOCK NTStatus = 0xC000035D STATUS_ALL_SIDS_FILTERED NTStatus = 0xC000035E STATUS_NOT_SAFE_MODE_DRIVER NTStatus = 0xC000035F STATUS_ACCESS_DISABLED_BY_POLICY_DEFAULT NTStatus = 0xC0000361 STATUS_ACCESS_DISABLED_BY_POLICY_PATH NTStatus = 0xC0000362 STATUS_ACCESS_DISABLED_BY_POLICY_PUBLISHER NTStatus = 0xC0000363 STATUS_ACCESS_DISABLED_BY_POLICY_OTHER NTStatus = 0xC0000364 STATUS_FAILED_DRIVER_ENTRY NTStatus = 0xC0000365 STATUS_DEVICE_ENUMERATION_ERROR NTStatus = 0xC0000366 STATUS_MOUNT_POINT_NOT_RESOLVED NTStatus = 0xC0000368 STATUS_INVALID_DEVICE_OBJECT_PARAMETER NTStatus = 0xC0000369 STATUS_MCA_OCCURED NTStatus = 0xC000036A STATUS_DRIVER_BLOCKED_CRITICAL NTStatus = 0xC000036B STATUS_DRIVER_BLOCKED NTStatus = 0xC000036C STATUS_DRIVER_DATABASE_ERROR NTStatus = 0xC000036D STATUS_SYSTEM_HIVE_TOO_LARGE NTStatus = 0xC000036E STATUS_INVALID_IMPORT_OF_NON_DLL NTStatus = 0xC000036F STATUS_DS_SHUTTING_DOWN NTStatus = 0x40000370 STATUS_NO_SECRETS NTStatus = 0xC0000371 STATUS_ACCESS_DISABLED_NO_SAFER_UI_BY_POLICY NTStatus = 0xC0000372 STATUS_FAILED_STACK_SWITCH NTStatus = 0xC0000373 STATUS_HEAP_CORRUPTION NTStatus = 0xC0000374 STATUS_SMARTCARD_WRONG_PIN NTStatus = 0xC0000380 STATUS_SMARTCARD_CARD_BLOCKED NTStatus = 0xC0000381 STATUS_SMARTCARD_CARD_NOT_AUTHENTICATED NTStatus = 0xC0000382 STATUS_SMARTCARD_NO_CARD NTStatus = 0xC0000383 STATUS_SMARTCARD_NO_KEY_CONTAINER NTStatus = 0xC0000384 STATUS_SMARTCARD_NO_CERTIFICATE NTStatus = 0xC0000385 STATUS_SMARTCARD_NO_KEYSET NTStatus = 0xC0000386 STATUS_SMARTCARD_IO_ERROR NTStatus = 0xC0000387 STATUS_DOWNGRADE_DETECTED NTStatus = 0xC0000388 STATUS_SMARTCARD_CERT_REVOKED NTStatus = 0xC0000389 STATUS_ISSUING_CA_UNTRUSTED NTStatus = 0xC000038A STATUS_REVOCATION_OFFLINE_C NTStatus = 0xC000038B STATUS_PKINIT_CLIENT_FAILURE NTStatus = 0xC000038C STATUS_SMARTCARD_CERT_EXPIRED NTStatus = 0xC000038D STATUS_DRIVER_FAILED_PRIOR_UNLOAD NTStatus = 0xC000038E STATUS_SMARTCARD_SILENT_CONTEXT NTStatus = 0xC000038F STATUS_PER_USER_TRUST_QUOTA_EXCEEDED NTStatus = 0xC0000401 STATUS_ALL_USER_TRUST_QUOTA_EXCEEDED NTStatus = 0xC0000402 STATUS_USER_DELETE_TRUST_QUOTA_EXCEEDED NTStatus = 0xC0000403 STATUS_DS_NAME_NOT_UNIQUE NTStatus = 0xC0000404 STATUS_DS_DUPLICATE_ID_FOUND NTStatus = 0xC0000405 STATUS_DS_GROUP_CONVERSION_ERROR NTStatus = 0xC0000406 STATUS_VOLSNAP_PREPARE_HIBERNATE NTStatus = 0xC0000407 STATUS_USER2USER_REQUIRED NTStatus = 0xC0000408 STATUS_STACK_BUFFER_OVERRUN NTStatus = 0xC0000409 STATUS_NO_S4U_PROT_SUPPORT NTStatus = 0xC000040A STATUS_CROSSREALM_DELEGATION_FAILURE NTStatus = 0xC000040B STATUS_REVOCATION_OFFLINE_KDC NTStatus = 0xC000040C STATUS_ISSUING_CA_UNTRUSTED_KDC NTStatus = 0xC000040D STATUS_KDC_CERT_EXPIRED NTStatus = 0xC000040E STATUS_KDC_CERT_REVOKED NTStatus = 0xC000040F STATUS_PARAMETER_QUOTA_EXCEEDED NTStatus = 0xC0000410 STATUS_HIBERNATION_FAILURE NTStatus = 0xC0000411 STATUS_DELAY_LOAD_FAILED NTStatus = 0xC0000412 STATUS_AUTHENTICATION_FIREWALL_FAILED NTStatus = 0xC0000413 STATUS_VDM_DISALLOWED NTStatus = 0xC0000414 STATUS_HUNG_DISPLAY_DRIVER_THREAD NTStatus = 0xC0000415 STATUS_INSUFFICIENT_RESOURCE_FOR_SPECIFIED_SHARED_SECTION_SIZE NTStatus = 0xC0000416 STATUS_INVALID_CRUNTIME_PARAMETER NTStatus = 0xC0000417 STATUS_NTLM_BLOCKED NTStatus = 0xC0000418 STATUS_DS_SRC_SID_EXISTS_IN_FOREST NTStatus = 0xC0000419 STATUS_DS_DOMAIN_NAME_EXISTS_IN_FOREST NTStatus = 0xC000041A STATUS_DS_FLAT_NAME_EXISTS_IN_FOREST NTStatus = 0xC000041B STATUS_INVALID_USER_PRINCIPAL_NAME NTStatus = 0xC000041C STATUS_FATAL_USER_CALLBACK_EXCEPTION NTStatus = 0xC000041D STATUS_ASSERTION_FAILURE NTStatus = 0xC0000420 STATUS_VERIFIER_STOP NTStatus = 0xC0000421 STATUS_CALLBACK_POP_STACK NTStatus = 0xC0000423 STATUS_INCOMPATIBLE_DRIVER_BLOCKED NTStatus = 0xC0000424 STATUS_HIVE_UNLOADED NTStatus = 0xC0000425 STATUS_COMPRESSION_DISABLED NTStatus = 0xC0000426 STATUS_FILE_SYSTEM_LIMITATION NTStatus = 0xC0000427 STATUS_INVALID_IMAGE_HASH NTStatus = 0xC0000428 STATUS_NOT_CAPABLE NTStatus = 0xC0000429 STATUS_REQUEST_OUT_OF_SEQUENCE NTStatus = 0xC000042A STATUS_IMPLEMENTATION_LIMIT NTStatus = 0xC000042B STATUS_ELEVATION_REQUIRED NTStatus = 0xC000042C STATUS_NO_SECURITY_CONTEXT NTStatus = 0xC000042D STATUS_PKU2U_CERT_FAILURE NTStatus = 0xC000042F STATUS_BEYOND_VDL NTStatus = 0xC0000432 STATUS_ENCOUNTERED_WRITE_IN_PROGRESS NTStatus = 0xC0000433 STATUS_PTE_CHANGED NTStatus = 0xC0000434 STATUS_PURGE_FAILED NTStatus = 0xC0000435 STATUS_CRED_REQUIRES_CONFIRMATION NTStatus = 0xC0000440 STATUS_CS_ENCRYPTION_INVALID_SERVER_RESPONSE NTStatus = 0xC0000441 STATUS_CS_ENCRYPTION_UNSUPPORTED_SERVER NTStatus = 0xC0000442 STATUS_CS_ENCRYPTION_EXISTING_ENCRYPTED_FILE NTStatus = 0xC0000443 STATUS_CS_ENCRYPTION_NEW_ENCRYPTED_FILE NTStatus = 0xC0000444 STATUS_CS_ENCRYPTION_FILE_NOT_CSE NTStatus = 0xC0000445 STATUS_INVALID_LABEL NTStatus = 0xC0000446 STATUS_DRIVER_PROCESS_TERMINATED NTStatus = 0xC0000450 STATUS_AMBIGUOUS_SYSTEM_DEVICE NTStatus = 0xC0000451 STATUS_SYSTEM_DEVICE_NOT_FOUND NTStatus = 0xC0000452 STATUS_RESTART_BOOT_APPLICATION NTStatus = 0xC0000453 STATUS_INSUFFICIENT_NVRAM_RESOURCES NTStatus = 0xC0000454 STATUS_INVALID_SESSION NTStatus = 0xC0000455 STATUS_THREAD_ALREADY_IN_SESSION NTStatus = 0xC0000456 STATUS_THREAD_NOT_IN_SESSION NTStatus = 0xC0000457 STATUS_INVALID_WEIGHT NTStatus = 0xC0000458 STATUS_REQUEST_PAUSED NTStatus = 0xC0000459 STATUS_NO_RANGES_PROCESSED NTStatus = 0xC0000460 STATUS_DISK_RESOURCES_EXHAUSTED NTStatus = 0xC0000461 STATUS_NEEDS_REMEDIATION NTStatus = 0xC0000462 STATUS_DEVICE_FEATURE_NOT_SUPPORTED NTStatus = 0xC0000463 STATUS_DEVICE_UNREACHABLE NTStatus = 0xC0000464 STATUS_INVALID_TOKEN NTStatus = 0xC0000465 STATUS_SERVER_UNAVAILABLE NTStatus = 0xC0000466 STATUS_FILE_NOT_AVAILABLE NTStatus = 0xC0000467 STATUS_DEVICE_INSUFFICIENT_RESOURCES NTStatus = 0xC0000468 STATUS_PACKAGE_UPDATING NTStatus = 0xC0000469 STATUS_NOT_READ_FROM_COPY NTStatus = 0xC000046A STATUS_FT_WRITE_FAILURE NTStatus = 0xC000046B STATUS_FT_DI_SCAN_REQUIRED NTStatus = 0xC000046C STATUS_OBJECT_NOT_EXTERNALLY_BACKED NTStatus = 0xC000046D STATUS_EXTERNAL_BACKING_PROVIDER_UNKNOWN NTStatus = 0xC000046E STATUS_COMPRESSION_NOT_BENEFICIAL NTStatus = 0xC000046F STATUS_DATA_CHECKSUM_ERROR NTStatus = 0xC0000470 STATUS_INTERMIXED_KERNEL_EA_OPERATION NTStatus = 0xC0000471 STATUS_TRIM_READ_ZERO_NOT_SUPPORTED NTStatus = 0xC0000472 STATUS_TOO_MANY_SEGMENT_DESCRIPTORS NTStatus = 0xC0000473 STATUS_INVALID_OFFSET_ALIGNMENT NTStatus = 0xC0000474 STATUS_INVALID_FIELD_IN_PARAMETER_LIST NTStatus = 0xC0000475 STATUS_OPERATION_IN_PROGRESS NTStatus = 0xC0000476 STATUS_INVALID_INITIATOR_TARGET_PATH NTStatus = 0xC0000477 STATUS_SCRUB_DATA_DISABLED NTStatus = 0xC0000478 STATUS_NOT_REDUNDANT_STORAGE NTStatus = 0xC0000479 STATUS_RESIDENT_FILE_NOT_SUPPORTED NTStatus = 0xC000047A STATUS_COMPRESSED_FILE_NOT_SUPPORTED NTStatus = 0xC000047B STATUS_DIRECTORY_NOT_SUPPORTED NTStatus = 0xC000047C STATUS_IO_OPERATION_TIMEOUT NTStatus = 0xC000047D STATUS_SYSTEM_NEEDS_REMEDIATION NTStatus = 0xC000047E STATUS_APPX_INTEGRITY_FAILURE_CLR_NGEN NTStatus = 0xC000047F STATUS_SHARE_UNAVAILABLE NTStatus = 0xC0000480 STATUS_APISET_NOT_HOSTED NTStatus = 0xC0000481 STATUS_APISET_NOT_PRESENT NTStatus = 0xC0000482 STATUS_DEVICE_HARDWARE_ERROR NTStatus = 0xC0000483 STATUS_FIRMWARE_SLOT_INVALID NTStatus = 0xC0000484 STATUS_FIRMWARE_IMAGE_INVALID NTStatus = 0xC0000485 STATUS_STORAGE_TOPOLOGY_ID_MISMATCH NTStatus = 0xC0000486 STATUS_WIM_NOT_BOOTABLE NTStatus = 0xC0000487 STATUS_BLOCKED_BY_PARENTAL_CONTROLS NTStatus = 0xC0000488 STATUS_NEEDS_REGISTRATION NTStatus = 0xC0000489 STATUS_QUOTA_ACTIVITY NTStatus = 0xC000048A STATUS_CALLBACK_INVOKE_INLINE NTStatus = 0xC000048B STATUS_BLOCK_TOO_MANY_REFERENCES NTStatus = 0xC000048C STATUS_MARKED_TO_DISALLOW_WRITES NTStatus = 0xC000048D STATUS_NETWORK_ACCESS_DENIED_EDP NTStatus = 0xC000048E STATUS_ENCLAVE_FAILURE NTStatus = 0xC000048F STATUS_PNP_NO_COMPAT_DRIVERS NTStatus = 0xC0000490 STATUS_PNP_DRIVER_PACKAGE_NOT_FOUND NTStatus = 0xC0000491 STATUS_PNP_DRIVER_CONFIGURATION_NOT_FOUND NTStatus = 0xC0000492 STATUS_PNP_DRIVER_CONFIGURATION_INCOMPLETE NTStatus = 0xC0000493 STATUS_PNP_FUNCTION_DRIVER_REQUIRED NTStatus = 0xC0000494 STATUS_PNP_DEVICE_CONFIGURATION_PENDING NTStatus = 0xC0000495 STATUS_DEVICE_HINT_NAME_BUFFER_TOO_SMALL NTStatus = 0xC0000496 STATUS_PACKAGE_NOT_AVAILABLE NTStatus = 0xC0000497 STATUS_DEVICE_IN_MAINTENANCE NTStatus = 0xC0000499 STATUS_NOT_SUPPORTED_ON_DAX NTStatus = 0xC000049A STATUS_FREE_SPACE_TOO_FRAGMENTED NTStatus = 0xC000049B STATUS_DAX_MAPPING_EXISTS NTStatus = 0xC000049C STATUS_CHILD_PROCESS_BLOCKED NTStatus = 0xC000049D STATUS_STORAGE_LOST_DATA_PERSISTENCE NTStatus = 0xC000049E STATUS_VRF_CFG_ENABLED NTStatus = 0xC000049F STATUS_PARTITION_TERMINATING NTStatus = 0xC00004A0 STATUS_EXTERNAL_SYSKEY_NOT_SUPPORTED NTStatus = 0xC00004A1 STATUS_ENCLAVE_VIOLATION NTStatus = 0xC00004A2 STATUS_FILE_PROTECTED_UNDER_DPL NTStatus = 0xC00004A3 STATUS_VOLUME_NOT_CLUSTER_ALIGNED NTStatus = 0xC00004A4 STATUS_NO_PHYSICALLY_ALIGNED_FREE_SPACE_FOUND NTStatus = 0xC00004A5 STATUS_APPX_FILE_NOT_ENCRYPTED NTStatus = 0xC00004A6 STATUS_RWRAW_ENCRYPTED_FILE_NOT_ENCRYPTED NTStatus = 0xC00004A7 STATUS_RWRAW_ENCRYPTED_INVALID_EDATAINFO_FILEOFFSET NTStatus = 0xC00004A8 STATUS_RWRAW_ENCRYPTED_INVALID_EDATAINFO_FILERANGE NTStatus = 0xC00004A9 STATUS_RWRAW_ENCRYPTED_INVALID_EDATAINFO_PARAMETER NTStatus = 0xC00004AA STATUS_FT_READ_FAILURE NTStatus = 0xC00004AB STATUS_PATCH_CONFLICT NTStatus = 0xC00004AC STATUS_STORAGE_RESERVE_ID_INVALID NTStatus = 0xC00004AD STATUS_STORAGE_RESERVE_DOES_NOT_EXIST NTStatus = 0xC00004AE STATUS_STORAGE_RESERVE_ALREADY_EXISTS NTStatus = 0xC00004AF STATUS_STORAGE_RESERVE_NOT_EMPTY NTStatus = 0xC00004B0 STATUS_NOT_A_DAX_VOLUME NTStatus = 0xC00004B1 STATUS_NOT_DAX_MAPPABLE NTStatus = 0xC00004B2 STATUS_CASE_DIFFERING_NAMES_IN_DIR NTStatus = 0xC00004B3 STATUS_FILE_NOT_SUPPORTED NTStatus = 0xC00004B4 STATUS_NOT_SUPPORTED_WITH_BTT NTStatus = 0xC00004B5 STATUS_ENCRYPTION_DISABLED NTStatus = 0xC00004B6 STATUS_ENCRYPTING_METADATA_DISALLOWED NTStatus = 0xC00004B7 STATUS_CANT_CLEAR_ENCRYPTION_FLAG NTStatus = 0xC00004B8 STATUS_INVALID_TASK_NAME NTStatus = 0xC0000500 STATUS_INVALID_TASK_INDEX NTStatus = 0xC0000501 STATUS_THREAD_ALREADY_IN_TASK NTStatus = 0xC0000502 STATUS_CALLBACK_BYPASS NTStatus = 0xC0000503 STATUS_UNDEFINED_SCOPE NTStatus = 0xC0000504 STATUS_INVALID_CAP NTStatus = 0xC0000505 STATUS_NOT_GUI_PROCESS NTStatus = 0xC0000506 STATUS_DEVICE_HUNG NTStatus = 0xC0000507 STATUS_CONTAINER_ASSIGNED NTStatus = 0xC0000508 STATUS_JOB_NO_CONTAINER NTStatus = 0xC0000509 STATUS_DEVICE_UNRESPONSIVE NTStatus = 0xC000050A STATUS_REPARSE_POINT_ENCOUNTERED NTStatus = 0xC000050B STATUS_ATTRIBUTE_NOT_PRESENT NTStatus = 0xC000050C STATUS_NOT_A_TIERED_VOLUME NTStatus = 0xC000050D STATUS_ALREADY_HAS_STREAM_ID NTStatus = 0xC000050E STATUS_JOB_NOT_EMPTY NTStatus = 0xC000050F STATUS_ALREADY_INITIALIZED NTStatus = 0xC0000510 STATUS_ENCLAVE_NOT_TERMINATED NTStatus = 0xC0000511 STATUS_ENCLAVE_IS_TERMINATING NTStatus = 0xC0000512 STATUS_SMB1_NOT_AVAILABLE NTStatus = 0xC0000513 STATUS_SMR_GARBAGE_COLLECTION_REQUIRED NTStatus = 0xC0000514 STATUS_INTERRUPTED NTStatus = 0xC0000515 STATUS_THREAD_NOT_RUNNING NTStatus = 0xC0000516 STATUS_FAIL_FAST_EXCEPTION NTStatus = 0xC0000602 STATUS_IMAGE_CERT_REVOKED NTStatus = 0xC0000603 STATUS_DYNAMIC_CODE_BLOCKED NTStatus = 0xC0000604 STATUS_IMAGE_CERT_EXPIRED NTStatus = 0xC0000605 STATUS_STRICT_CFG_VIOLATION NTStatus = 0xC0000606 STATUS_SET_CONTEXT_DENIED NTStatus = 0xC000060A STATUS_CROSS_PARTITION_VIOLATION NTStatus = 0xC000060B STATUS_PORT_CLOSED NTStatus = 0xC0000700 STATUS_MESSAGE_LOST NTStatus = 0xC0000701 STATUS_INVALID_MESSAGE NTStatus = 0xC0000702 STATUS_REQUEST_CANCELED NTStatus = 0xC0000703 STATUS_RECURSIVE_DISPATCH NTStatus = 0xC0000704 STATUS_LPC_RECEIVE_BUFFER_EXPECTED NTStatus = 0xC0000705 STATUS_LPC_INVALID_CONNECTION_USAGE NTStatus = 0xC0000706 STATUS_LPC_REQUESTS_NOT_ALLOWED NTStatus = 0xC0000707 STATUS_RESOURCE_IN_USE NTStatus = 0xC0000708 STATUS_HARDWARE_MEMORY_ERROR NTStatus = 0xC0000709 STATUS_THREADPOOL_HANDLE_EXCEPTION NTStatus = 0xC000070A STATUS_THREADPOOL_SET_EVENT_ON_COMPLETION_FAILED NTStatus = 0xC000070B STATUS_THREADPOOL_RELEASE_SEMAPHORE_ON_COMPLETION_FAILED NTStatus = 0xC000070C STATUS_THREADPOOL_RELEASE_MUTEX_ON_COMPLETION_FAILED NTStatus = 0xC000070D STATUS_THREADPOOL_FREE_LIBRARY_ON_COMPLETION_FAILED NTStatus = 0xC000070E STATUS_THREADPOOL_RELEASED_DURING_OPERATION NTStatus = 0xC000070F STATUS_CALLBACK_RETURNED_WHILE_IMPERSONATING NTStatus = 0xC0000710 STATUS_APC_RETURNED_WHILE_IMPERSONATING NTStatus = 0xC0000711 STATUS_PROCESS_IS_PROTECTED NTStatus = 0xC0000712 STATUS_MCA_EXCEPTION NTStatus = 0xC0000713 STATUS_CERTIFICATE_MAPPING_NOT_UNIQUE NTStatus = 0xC0000714 STATUS_SYMLINK_CLASS_DISABLED NTStatus = 0xC0000715 STATUS_INVALID_IDN_NORMALIZATION NTStatus = 0xC0000716 STATUS_NO_UNICODE_TRANSLATION NTStatus = 0xC0000717 STATUS_ALREADY_REGISTERED NTStatus = 0xC0000718 STATUS_CONTEXT_MISMATCH NTStatus = 0xC0000719 STATUS_PORT_ALREADY_HAS_COMPLETION_LIST NTStatus = 0xC000071A STATUS_CALLBACK_RETURNED_THREAD_PRIORITY NTStatus = 0xC000071B STATUS_INVALID_THREAD NTStatus = 0xC000071C STATUS_CALLBACK_RETURNED_TRANSACTION NTStatus = 0xC000071D STATUS_CALLBACK_RETURNED_LDR_LOCK NTStatus = 0xC000071E STATUS_CALLBACK_RETURNED_LANG NTStatus = 0xC000071F STATUS_CALLBACK_RETURNED_PRI_BACK NTStatus = 0xC0000720 STATUS_CALLBACK_RETURNED_THREAD_AFFINITY NTStatus = 0xC0000721 STATUS_LPC_HANDLE_COUNT_EXCEEDED NTStatus = 0xC0000722 STATUS_EXECUTABLE_MEMORY_WRITE NTStatus = 0xC0000723 STATUS_KERNEL_EXECUTABLE_MEMORY_WRITE NTStatus = 0xC0000724 STATUS_ATTACHED_EXECUTABLE_MEMORY_WRITE NTStatus = 0xC0000725 STATUS_TRIGGERED_EXECUTABLE_MEMORY_WRITE NTStatus = 0xC0000726 STATUS_DISK_REPAIR_DISABLED NTStatus = 0xC0000800 STATUS_DS_DOMAIN_RENAME_IN_PROGRESS NTStatus = 0xC0000801 STATUS_DISK_QUOTA_EXCEEDED NTStatus = 0xC0000802 STATUS_DATA_LOST_REPAIR NTStatus = 0x80000803 STATUS_CONTENT_BLOCKED NTStatus = 0xC0000804 STATUS_BAD_CLUSTERS NTStatus = 0xC0000805 STATUS_VOLUME_DIRTY NTStatus = 0xC0000806 STATUS_DISK_REPAIR_REDIRECTED NTStatus = 0x40000807 STATUS_DISK_REPAIR_UNSUCCESSFUL NTStatus = 0xC0000808 STATUS_CORRUPT_LOG_OVERFULL NTStatus = 0xC0000809 STATUS_CORRUPT_LOG_CORRUPTED NTStatus = 0xC000080A STATUS_CORRUPT_LOG_UNAVAILABLE NTStatus = 0xC000080B STATUS_CORRUPT_LOG_DELETED_FULL NTStatus = 0xC000080C STATUS_CORRUPT_LOG_CLEARED NTStatus = 0xC000080D STATUS_ORPHAN_NAME_EXHAUSTED NTStatus = 0xC000080E STATUS_PROACTIVE_SCAN_IN_PROGRESS NTStatus = 0xC000080F STATUS_ENCRYPTED_IO_NOT_POSSIBLE NTStatus = 0xC0000810 STATUS_CORRUPT_LOG_UPLEVEL_RECORDS NTStatus = 0xC0000811 STATUS_FILE_CHECKED_OUT NTStatus = 0xC0000901 STATUS_CHECKOUT_REQUIRED NTStatus = 0xC0000902 STATUS_BAD_FILE_TYPE NTStatus = 0xC0000903 STATUS_FILE_TOO_LARGE NTStatus = 0xC0000904 STATUS_FORMS_AUTH_REQUIRED NTStatus = 0xC0000905 STATUS_VIRUS_INFECTED NTStatus = 0xC0000906 STATUS_VIRUS_DELETED NTStatus = 0xC0000907 STATUS_BAD_MCFG_TABLE NTStatus = 0xC0000908 STATUS_CANNOT_BREAK_OPLOCK NTStatus = 0xC0000909 STATUS_BAD_KEY NTStatus = 0xC000090A STATUS_BAD_DATA NTStatus = 0xC000090B STATUS_NO_KEY NTStatus = 0xC000090C STATUS_FILE_HANDLE_REVOKED NTStatus = 0xC0000910 STATUS_WOW_ASSERTION NTStatus = 0xC0009898 STATUS_INVALID_SIGNATURE NTStatus = 0xC000A000 STATUS_HMAC_NOT_SUPPORTED NTStatus = 0xC000A001 STATUS_AUTH_TAG_MISMATCH NTStatus = 0xC000A002 STATUS_INVALID_STATE_TRANSITION NTStatus = 0xC000A003 STATUS_INVALID_KERNEL_INFO_VERSION NTStatus = 0xC000A004 STATUS_INVALID_PEP_INFO_VERSION NTStatus = 0xC000A005 STATUS_HANDLE_REVOKED NTStatus = 0xC000A006 STATUS_EOF_ON_GHOSTED_RANGE NTStatus = 0xC000A007 STATUS_IPSEC_QUEUE_OVERFLOW NTStatus = 0xC000A010 STATUS_ND_QUEUE_OVERFLOW NTStatus = 0xC000A011 STATUS_HOPLIMIT_EXCEEDED NTStatus = 0xC000A012 STATUS_PROTOCOL_NOT_SUPPORTED NTStatus = 0xC000A013 STATUS_FASTPATH_REJECTED NTStatus = 0xC000A014 STATUS_LOST_WRITEBEHIND_DATA_NETWORK_DISCONNECTED NTStatus = 0xC000A080 STATUS_LOST_WRITEBEHIND_DATA_NETWORK_SERVER_ERROR NTStatus = 0xC000A081 STATUS_LOST_WRITEBEHIND_DATA_LOCAL_DISK_ERROR NTStatus = 0xC000A082 STATUS_XML_PARSE_ERROR NTStatus = 0xC000A083 STATUS_XMLDSIG_ERROR NTStatus = 0xC000A084 STATUS_WRONG_COMPARTMENT NTStatus = 0xC000A085 STATUS_AUTHIP_FAILURE NTStatus = 0xC000A086 STATUS_DS_OID_MAPPED_GROUP_CANT_HAVE_MEMBERS NTStatus = 0xC000A087 STATUS_DS_OID_NOT_FOUND NTStatus = 0xC000A088 STATUS_INCORRECT_ACCOUNT_TYPE NTStatus = 0xC000A089 STATUS_HASH_NOT_SUPPORTED NTStatus = 0xC000A100 STATUS_HASH_NOT_PRESENT NTStatus = 0xC000A101 STATUS_SECONDARY_IC_PROVIDER_NOT_REGISTERED NTStatus = 0xC000A121 STATUS_GPIO_CLIENT_INFORMATION_INVALID NTStatus = 0xC000A122 STATUS_GPIO_VERSION_NOT_SUPPORTED NTStatus = 0xC000A123 STATUS_GPIO_INVALID_REGISTRATION_PACKET NTStatus = 0xC000A124 STATUS_GPIO_OPERATION_DENIED NTStatus = 0xC000A125 STATUS_GPIO_INCOMPATIBLE_CONNECT_MODE NTStatus = 0xC000A126 STATUS_GPIO_INTERRUPT_ALREADY_UNMASKED NTStatus = 0x8000A127 STATUS_CANNOT_SWITCH_RUNLEVEL NTStatus = 0xC000A141 STATUS_INVALID_RUNLEVEL_SETTING NTStatus = 0xC000A142 STATUS_RUNLEVEL_SWITCH_TIMEOUT NTStatus = 0xC000A143 STATUS_SERVICES_FAILED_AUTOSTART NTStatus = 0x4000A144 STATUS_RUNLEVEL_SWITCH_AGENT_TIMEOUT NTStatus = 0xC000A145 STATUS_RUNLEVEL_SWITCH_IN_PROGRESS NTStatus = 0xC000A146 STATUS_NOT_APPCONTAINER NTStatus = 0xC000A200 STATUS_NOT_SUPPORTED_IN_APPCONTAINER NTStatus = 0xC000A201 STATUS_INVALID_PACKAGE_SID_LENGTH NTStatus = 0xC000A202 STATUS_LPAC_ACCESS_DENIED NTStatus = 0xC000A203 STATUS_ADMINLESS_ACCESS_DENIED NTStatus = 0xC000A204 STATUS_APP_DATA_NOT_FOUND NTStatus = 0xC000A281 STATUS_APP_DATA_EXPIRED NTStatus = 0xC000A282 STATUS_APP_DATA_CORRUPT NTStatus = 0xC000A283 STATUS_APP_DATA_LIMIT_EXCEEDED NTStatus = 0xC000A284 STATUS_APP_DATA_REBOOT_REQUIRED NTStatus = 0xC000A285 STATUS_OFFLOAD_READ_FLT_NOT_SUPPORTED NTStatus = 0xC000A2A1 STATUS_OFFLOAD_WRITE_FLT_NOT_SUPPORTED NTStatus = 0xC000A2A2 STATUS_OFFLOAD_READ_FILE_NOT_SUPPORTED NTStatus = 0xC000A2A3 STATUS_OFFLOAD_WRITE_FILE_NOT_SUPPORTED NTStatus = 0xC000A2A4 STATUS_WOF_WIM_HEADER_CORRUPT NTStatus = 0xC000A2A5 STATUS_WOF_WIM_RESOURCE_TABLE_CORRUPT NTStatus = 0xC000A2A6 STATUS_WOF_FILE_RESOURCE_TABLE_CORRUPT NTStatus = 0xC000A2A7 STATUS_FILE_SYSTEM_VIRTUALIZATION_UNAVAILABLE NTStatus = 0xC000CE01 STATUS_FILE_SYSTEM_VIRTUALIZATION_METADATA_CORRUPT NTStatus = 0xC000CE02 STATUS_FILE_SYSTEM_VIRTUALIZATION_BUSY NTStatus = 0xC000CE03 STATUS_FILE_SYSTEM_VIRTUALIZATION_PROVIDER_UNKNOWN NTStatus = 0xC000CE04 STATUS_FILE_SYSTEM_VIRTUALIZATION_INVALID_OPERATION NTStatus = 0xC000CE05 STATUS_CLOUD_FILE_SYNC_ROOT_METADATA_CORRUPT NTStatus = 0xC000CF00 STATUS_CLOUD_FILE_PROVIDER_NOT_RUNNING NTStatus = 0xC000CF01 STATUS_CLOUD_FILE_METADATA_CORRUPT NTStatus = 0xC000CF02 STATUS_CLOUD_FILE_METADATA_TOO_LARGE NTStatus = 0xC000CF03 STATUS_CLOUD_FILE_PROPERTY_BLOB_TOO_LARGE NTStatus = 0x8000CF04 STATUS_CLOUD_FILE_TOO_MANY_PROPERTY_BLOBS NTStatus = 0x8000CF05 STATUS_CLOUD_FILE_PROPERTY_VERSION_NOT_SUPPORTED NTStatus = 0xC000CF06 STATUS_NOT_A_CLOUD_FILE NTStatus = 0xC000CF07 STATUS_CLOUD_FILE_NOT_IN_SYNC NTStatus = 0xC000CF08 STATUS_CLOUD_FILE_ALREADY_CONNECTED NTStatus = 0xC000CF09 STATUS_CLOUD_FILE_NOT_SUPPORTED NTStatus = 0xC000CF0A STATUS_CLOUD_FILE_INVALID_REQUEST NTStatus = 0xC000CF0B STATUS_CLOUD_FILE_READ_ONLY_VOLUME NTStatus = 0xC000CF0C STATUS_CLOUD_FILE_CONNECTED_PROVIDER_ONLY NTStatus = 0xC000CF0D STATUS_CLOUD_FILE_VALIDATION_FAILED NTStatus = 0xC000CF0E STATUS_CLOUD_FILE_AUTHENTICATION_FAILED NTStatus = 0xC000CF0F STATUS_CLOUD_FILE_INSUFFICIENT_RESOURCES NTStatus = 0xC000CF10 STATUS_CLOUD_FILE_NETWORK_UNAVAILABLE NTStatus = 0xC000CF11 STATUS_CLOUD_FILE_UNSUCCESSFUL NTStatus = 0xC000CF12 STATUS_CLOUD_FILE_NOT_UNDER_SYNC_ROOT NTStatus = 0xC000CF13 STATUS_CLOUD_FILE_IN_USE NTStatus = 0xC000CF14 STATUS_CLOUD_FILE_PINNED NTStatus = 0xC000CF15 STATUS_CLOUD_FILE_REQUEST_ABORTED NTStatus = 0xC000CF16 STATUS_CLOUD_FILE_PROPERTY_CORRUPT NTStatus = 0xC000CF17 STATUS_CLOUD_FILE_ACCESS_DENIED NTStatus = 0xC000CF18 STATUS_CLOUD_FILE_INCOMPATIBLE_HARDLINKS NTStatus = 0xC000CF19 STATUS_CLOUD_FILE_PROPERTY_LOCK_CONFLICT NTStatus = 0xC000CF1A STATUS_CLOUD_FILE_REQUEST_CANCELED NTStatus = 0xC000CF1B STATUS_CLOUD_FILE_PROVIDER_TERMINATED NTStatus = 0xC000CF1D STATUS_NOT_A_CLOUD_SYNC_ROOT NTStatus = 0xC000CF1E STATUS_CLOUD_FILE_REQUEST_TIMEOUT NTStatus = 0xC000CF1F STATUS_ACPI_INVALID_OPCODE NTStatus = 0xC0140001 STATUS_ACPI_STACK_OVERFLOW NTStatus = 0xC0140002 STATUS_ACPI_ASSERT_FAILED NTStatus = 0xC0140003 STATUS_ACPI_INVALID_INDEX NTStatus = 0xC0140004 STATUS_ACPI_INVALID_ARGUMENT NTStatus = 0xC0140005 STATUS_ACPI_FATAL NTStatus = 0xC0140006 STATUS_ACPI_INVALID_SUPERNAME NTStatus = 0xC0140007 STATUS_ACPI_INVALID_ARGTYPE NTStatus = 0xC0140008 STATUS_ACPI_INVALID_OBJTYPE NTStatus = 0xC0140009 STATUS_ACPI_INVALID_TARGETTYPE NTStatus = 0xC014000A STATUS_ACPI_INCORRECT_ARGUMENT_COUNT NTStatus = 0xC014000B STATUS_ACPI_ADDRESS_NOT_MAPPED NTStatus = 0xC014000C STATUS_ACPI_INVALID_EVENTTYPE NTStatus = 0xC014000D STATUS_ACPI_HANDLER_COLLISION NTStatus = 0xC014000E STATUS_ACPI_INVALID_DATA NTStatus = 0xC014000F STATUS_ACPI_INVALID_REGION NTStatus = 0xC0140010 STATUS_ACPI_INVALID_ACCESS_SIZE NTStatus = 0xC0140011 STATUS_ACPI_ACQUIRE_GLOBAL_LOCK NTStatus = 0xC0140012 STATUS_ACPI_ALREADY_INITIALIZED NTStatus = 0xC0140013 STATUS_ACPI_NOT_INITIALIZED NTStatus = 0xC0140014 STATUS_ACPI_INVALID_MUTEX_LEVEL NTStatus = 0xC0140015 STATUS_ACPI_MUTEX_NOT_OWNED NTStatus = 0xC0140016 STATUS_ACPI_MUTEX_NOT_OWNER NTStatus = 0xC0140017 STATUS_ACPI_RS_ACCESS NTStatus = 0xC0140018 STATUS_ACPI_INVALID_TABLE NTStatus = 0xC0140019 STATUS_ACPI_REG_HANDLER_FAILED NTStatus = 0xC0140020 STATUS_ACPI_POWER_REQUEST_FAILED NTStatus = 0xC0140021 STATUS_CTX_WINSTATION_NAME_INVALID NTStatus = 0xC00A0001 STATUS_CTX_INVALID_PD NTStatus = 0xC00A0002 STATUS_CTX_PD_NOT_FOUND NTStatus = 0xC00A0003 STATUS_CTX_CDM_CONNECT NTStatus = 0x400A0004 STATUS_CTX_CDM_DISCONNECT NTStatus = 0x400A0005 STATUS_CTX_CLOSE_PENDING NTStatus = 0xC00A0006 STATUS_CTX_NO_OUTBUF NTStatus = 0xC00A0007 STATUS_CTX_MODEM_INF_NOT_FOUND NTStatus = 0xC00A0008 STATUS_CTX_INVALID_MODEMNAME NTStatus = 0xC00A0009 STATUS_CTX_RESPONSE_ERROR NTStatus = 0xC00A000A STATUS_CTX_MODEM_RESPONSE_TIMEOUT NTStatus = 0xC00A000B STATUS_CTX_MODEM_RESPONSE_NO_CARRIER NTStatus = 0xC00A000C STATUS_CTX_MODEM_RESPONSE_NO_DIALTONE NTStatus = 0xC00A000D STATUS_CTX_MODEM_RESPONSE_BUSY NTStatus = 0xC00A000E STATUS_CTX_MODEM_RESPONSE_VOICE NTStatus = 0xC00A000F STATUS_CTX_TD_ERROR NTStatus = 0xC00A0010 STATUS_CTX_LICENSE_CLIENT_INVALID NTStatus = 0xC00A0012 STATUS_CTX_LICENSE_NOT_AVAILABLE NTStatus = 0xC00A0013 STATUS_CTX_LICENSE_EXPIRED NTStatus = 0xC00A0014 STATUS_CTX_WINSTATION_NOT_FOUND NTStatus = 0xC00A0015 STATUS_CTX_WINSTATION_NAME_COLLISION NTStatus = 0xC00A0016 STATUS_CTX_WINSTATION_BUSY NTStatus = 0xC00A0017 STATUS_CTX_BAD_VIDEO_MODE NTStatus = 0xC00A0018 STATUS_CTX_GRAPHICS_INVALID NTStatus = 0xC00A0022 STATUS_CTX_NOT_CONSOLE NTStatus = 0xC00A0024 STATUS_CTX_CLIENT_QUERY_TIMEOUT NTStatus = 0xC00A0026 STATUS_CTX_CONSOLE_DISCONNECT NTStatus = 0xC00A0027 STATUS_CTX_CONSOLE_CONNECT NTStatus = 0xC00A0028 STATUS_CTX_SHADOW_DENIED NTStatus = 0xC00A002A STATUS_CTX_WINSTATION_ACCESS_DENIED NTStatus = 0xC00A002B STATUS_CTX_INVALID_WD NTStatus = 0xC00A002E STATUS_CTX_WD_NOT_FOUND NTStatus = 0xC00A002F STATUS_CTX_SHADOW_INVALID NTStatus = 0xC00A0030 STATUS_CTX_SHADOW_DISABLED NTStatus = 0xC00A0031 STATUS_RDP_PROTOCOL_ERROR NTStatus = 0xC00A0032 STATUS_CTX_CLIENT_LICENSE_NOT_SET NTStatus = 0xC00A0033 STATUS_CTX_CLIENT_LICENSE_IN_USE NTStatus = 0xC00A0034 STATUS_CTX_SHADOW_ENDED_BY_MODE_CHANGE NTStatus = 0xC00A0035 STATUS_CTX_SHADOW_NOT_RUNNING NTStatus = 0xC00A0036 STATUS_CTX_LOGON_DISABLED NTStatus = 0xC00A0037 STATUS_CTX_SECURITY_LAYER_ERROR NTStatus = 0xC00A0038 STATUS_TS_INCOMPATIBLE_SESSIONS NTStatus = 0xC00A0039 STATUS_TS_VIDEO_SUBSYSTEM_ERROR NTStatus = 0xC00A003A STATUS_PNP_BAD_MPS_TABLE NTStatus = 0xC0040035 STATUS_PNP_TRANSLATION_FAILED NTStatus = 0xC0040036 STATUS_PNP_IRQ_TRANSLATION_FAILED NTStatus = 0xC0040037 STATUS_PNP_INVALID_ID NTStatus = 0xC0040038 STATUS_IO_REISSUE_AS_CACHED NTStatus = 0xC0040039 STATUS_MUI_FILE_NOT_FOUND NTStatus = 0xC00B0001 STATUS_MUI_INVALID_FILE NTStatus = 0xC00B0002 STATUS_MUI_INVALID_RC_CONFIG NTStatus = 0xC00B0003 STATUS_MUI_INVALID_LOCALE_NAME NTStatus = 0xC00B0004 STATUS_MUI_INVALID_ULTIMATEFALLBACK_NAME NTStatus = 0xC00B0005 STATUS_MUI_FILE_NOT_LOADED NTStatus = 0xC00B0006 STATUS_RESOURCE_ENUM_USER_STOP NTStatus = 0xC00B0007 STATUS_FLT_NO_HANDLER_DEFINED NTStatus = 0xC01C0001 STATUS_FLT_CONTEXT_ALREADY_DEFINED NTStatus = 0xC01C0002 STATUS_FLT_INVALID_ASYNCHRONOUS_REQUEST NTStatus = 0xC01C0003 STATUS_FLT_DISALLOW_FAST_IO NTStatus = 0xC01C0004 STATUS_FLT_INVALID_NAME_REQUEST NTStatus = 0xC01C0005 STATUS_FLT_NOT_SAFE_TO_POST_OPERATION NTStatus = 0xC01C0006 STATUS_FLT_NOT_INITIALIZED NTStatus = 0xC01C0007 STATUS_FLT_FILTER_NOT_READY NTStatus = 0xC01C0008 STATUS_FLT_POST_OPERATION_CLEANUP NTStatus = 0xC01C0009 STATUS_FLT_INTERNAL_ERROR NTStatus = 0xC01C000A STATUS_FLT_DELETING_OBJECT NTStatus = 0xC01C000B STATUS_FLT_MUST_BE_NONPAGED_POOL NTStatus = 0xC01C000C STATUS_FLT_DUPLICATE_ENTRY NTStatus = 0xC01C000D STATUS_FLT_CBDQ_DISABLED NTStatus = 0xC01C000E STATUS_FLT_DO_NOT_ATTACH NTStatus = 0xC01C000F STATUS_FLT_DO_NOT_DETACH NTStatus = 0xC01C0010 STATUS_FLT_INSTANCE_ALTITUDE_COLLISION NTStatus = 0xC01C0011 STATUS_FLT_INSTANCE_NAME_COLLISION NTStatus = 0xC01C0012 STATUS_FLT_FILTER_NOT_FOUND NTStatus = 0xC01C0013 STATUS_FLT_VOLUME_NOT_FOUND NTStatus = 0xC01C0014 STATUS_FLT_INSTANCE_NOT_FOUND NTStatus = 0xC01C0015 STATUS_FLT_CONTEXT_ALLOCATION_NOT_FOUND NTStatus = 0xC01C0016 STATUS_FLT_INVALID_CONTEXT_REGISTRATION NTStatus = 0xC01C0017 STATUS_FLT_NAME_CACHE_MISS NTStatus = 0xC01C0018 STATUS_FLT_NO_DEVICE_OBJECT NTStatus = 0xC01C0019 STATUS_FLT_VOLUME_ALREADY_MOUNTED NTStatus = 0xC01C001A STATUS_FLT_ALREADY_ENLISTED NTStatus = 0xC01C001B STATUS_FLT_CONTEXT_ALREADY_LINKED NTStatus = 0xC01C001C STATUS_FLT_NO_WAITER_FOR_REPLY NTStatus = 0xC01C0020 STATUS_FLT_REGISTRATION_BUSY NTStatus = 0xC01C0023 STATUS_SXS_SECTION_NOT_FOUND NTStatus = 0xC0150001 STATUS_SXS_CANT_GEN_ACTCTX NTStatus = 0xC0150002 STATUS_SXS_INVALID_ACTCTXDATA_FORMAT NTStatus = 0xC0150003 STATUS_SXS_ASSEMBLY_NOT_FOUND NTStatus = 0xC0150004 STATUS_SXS_MANIFEST_FORMAT_ERROR NTStatus = 0xC0150005 STATUS_SXS_MANIFEST_PARSE_ERROR NTStatus = 0xC0150006 STATUS_SXS_ACTIVATION_CONTEXT_DISABLED NTStatus = 0xC0150007 STATUS_SXS_KEY_NOT_FOUND NTStatus = 0xC0150008 STATUS_SXS_VERSION_CONFLICT NTStatus = 0xC0150009 STATUS_SXS_WRONG_SECTION_TYPE NTStatus = 0xC015000A STATUS_SXS_THREAD_QUERIES_DISABLED NTStatus = 0xC015000B STATUS_SXS_ASSEMBLY_MISSING NTStatus = 0xC015000C STATUS_SXS_RELEASE_ACTIVATION_CONTEXT NTStatus = 0x4015000D STATUS_SXS_PROCESS_DEFAULT_ALREADY_SET NTStatus = 0xC015000E STATUS_SXS_EARLY_DEACTIVATION NTStatus = 0xC015000F STATUS_SXS_INVALID_DEACTIVATION NTStatus = 0xC0150010 STATUS_SXS_MULTIPLE_DEACTIVATION NTStatus = 0xC0150011 STATUS_SXS_SYSTEM_DEFAULT_ACTIVATION_CONTEXT_EMPTY NTStatus = 0xC0150012 STATUS_SXS_PROCESS_TERMINATION_REQUESTED NTStatus = 0xC0150013 STATUS_SXS_CORRUPT_ACTIVATION_STACK NTStatus = 0xC0150014 STATUS_SXS_CORRUPTION NTStatus = 0xC0150015 STATUS_SXS_INVALID_IDENTITY_ATTRIBUTE_VALUE NTStatus = 0xC0150016 STATUS_SXS_INVALID_IDENTITY_ATTRIBUTE_NAME NTStatus = 0xC0150017 STATUS_SXS_IDENTITY_DUPLICATE_ATTRIBUTE NTStatus = 0xC0150018 STATUS_SXS_IDENTITY_PARSE_ERROR NTStatus = 0xC0150019 STATUS_SXS_COMPONENT_STORE_CORRUPT NTStatus = 0xC015001A STATUS_SXS_FILE_HASH_MISMATCH NTStatus = 0xC015001B STATUS_SXS_MANIFEST_IDENTITY_SAME_BUT_CONTENTS_DIFFERENT NTStatus = 0xC015001C STATUS_SXS_IDENTITIES_DIFFERENT NTStatus = 0xC015001D STATUS_SXS_ASSEMBLY_IS_NOT_A_DEPLOYMENT NTStatus = 0xC015001E STATUS_SXS_FILE_NOT_PART_OF_ASSEMBLY NTStatus = 0xC015001F STATUS_ADVANCED_INSTALLER_FAILED NTStatus = 0xC0150020 STATUS_XML_ENCODING_MISMATCH NTStatus = 0xC0150021 STATUS_SXS_MANIFEST_TOO_BIG NTStatus = 0xC0150022 STATUS_SXS_SETTING_NOT_REGISTERED NTStatus = 0xC0150023 STATUS_SXS_TRANSACTION_CLOSURE_INCOMPLETE NTStatus = 0xC0150024 STATUS_SMI_PRIMITIVE_INSTALLER_FAILED NTStatus = 0xC0150025 STATUS_GENERIC_COMMAND_FAILED NTStatus = 0xC0150026 STATUS_SXS_FILE_HASH_MISSING NTStatus = 0xC0150027 STATUS_CLUSTER_INVALID_NODE NTStatus = 0xC0130001 STATUS_CLUSTER_NODE_EXISTS NTStatus = 0xC0130002 STATUS_CLUSTER_JOIN_IN_PROGRESS NTStatus = 0xC0130003 STATUS_CLUSTER_NODE_NOT_FOUND NTStatus = 0xC0130004 STATUS_CLUSTER_LOCAL_NODE_NOT_FOUND NTStatus = 0xC0130005 STATUS_CLUSTER_NETWORK_EXISTS NTStatus = 0xC0130006 STATUS_CLUSTER_NETWORK_NOT_FOUND NTStatus = 0xC0130007 STATUS_CLUSTER_NETINTERFACE_EXISTS NTStatus = 0xC0130008 STATUS_CLUSTER_NETINTERFACE_NOT_FOUND NTStatus = 0xC0130009 STATUS_CLUSTER_INVALID_REQUEST NTStatus = 0xC013000A STATUS_CLUSTER_INVALID_NETWORK_PROVIDER NTStatus = 0xC013000B STATUS_CLUSTER_NODE_DOWN NTStatus = 0xC013000C STATUS_CLUSTER_NODE_UNREACHABLE NTStatus = 0xC013000D STATUS_CLUSTER_NODE_NOT_MEMBER NTStatus = 0xC013000E STATUS_CLUSTER_JOIN_NOT_IN_PROGRESS NTStatus = 0xC013000F STATUS_CLUSTER_INVALID_NETWORK NTStatus = 0xC0130010 STATUS_CLUSTER_NO_NET_ADAPTERS NTStatus = 0xC0130011 STATUS_CLUSTER_NODE_UP NTStatus = 0xC0130012 STATUS_CLUSTER_NODE_PAUSED NTStatus = 0xC0130013 STATUS_CLUSTER_NODE_NOT_PAUSED NTStatus = 0xC0130014 STATUS_CLUSTER_NO_SECURITY_CONTEXT NTStatus = 0xC0130015 STATUS_CLUSTER_NETWORK_NOT_INTERNAL NTStatus = 0xC0130016 STATUS_CLUSTER_POISONED NTStatus = 0xC0130017 STATUS_CLUSTER_NON_CSV_PATH NTStatus = 0xC0130018 STATUS_CLUSTER_CSV_VOLUME_NOT_LOCAL NTStatus = 0xC0130019 STATUS_CLUSTER_CSV_READ_OPLOCK_BREAK_IN_PROGRESS NTStatus = 0xC0130020 STATUS_CLUSTER_CSV_AUTO_PAUSE_ERROR NTStatus = 0xC0130021 STATUS_CLUSTER_CSV_REDIRECTED NTStatus = 0xC0130022 STATUS_CLUSTER_CSV_NOT_REDIRECTED NTStatus = 0xC0130023 STATUS_CLUSTER_CSV_VOLUME_DRAINING NTStatus = 0xC0130024 STATUS_CLUSTER_CSV_SNAPSHOT_CREATION_IN_PROGRESS NTStatus = 0xC0130025 STATUS_CLUSTER_CSV_VOLUME_DRAINING_SUCCEEDED_DOWNLEVEL NTStatus = 0xC0130026 STATUS_CLUSTER_CSV_NO_SNAPSHOTS NTStatus = 0xC0130027 STATUS_CSV_IO_PAUSE_TIMEOUT NTStatus = 0xC0130028 STATUS_CLUSTER_CSV_INVALID_HANDLE NTStatus = 0xC0130029 STATUS_CLUSTER_CSV_SUPPORTED_ONLY_ON_COORDINATOR NTStatus = 0xC0130030 STATUS_CLUSTER_CAM_TICKET_REPLAY_DETECTED NTStatus = 0xC0130031 STATUS_TRANSACTIONAL_CONFLICT NTStatus = 0xC0190001 STATUS_INVALID_TRANSACTION NTStatus = 0xC0190002 STATUS_TRANSACTION_NOT_ACTIVE NTStatus = 0xC0190003 STATUS_TM_INITIALIZATION_FAILED NTStatus = 0xC0190004 STATUS_RM_NOT_ACTIVE NTStatus = 0xC0190005 STATUS_RM_METADATA_CORRUPT NTStatus = 0xC0190006 STATUS_TRANSACTION_NOT_JOINED NTStatus = 0xC0190007 STATUS_DIRECTORY_NOT_RM NTStatus = 0xC0190008 STATUS_COULD_NOT_RESIZE_LOG NTStatus = 0x80190009 STATUS_TRANSACTIONS_UNSUPPORTED_REMOTE NTStatus = 0xC019000A STATUS_LOG_RESIZE_INVALID_SIZE NTStatus = 0xC019000B STATUS_REMOTE_FILE_VERSION_MISMATCH NTStatus = 0xC019000C STATUS_CRM_PROTOCOL_ALREADY_EXISTS NTStatus = 0xC019000F STATUS_TRANSACTION_PROPAGATION_FAILED NTStatus = 0xC0190010 STATUS_CRM_PROTOCOL_NOT_FOUND NTStatus = 0xC0190011 STATUS_TRANSACTION_SUPERIOR_EXISTS NTStatus = 0xC0190012 STATUS_TRANSACTION_REQUEST_NOT_VALID NTStatus = 0xC0190013 STATUS_TRANSACTION_NOT_REQUESTED NTStatus = 0xC0190014 STATUS_TRANSACTION_ALREADY_ABORTED NTStatus = 0xC0190015 STATUS_TRANSACTION_ALREADY_COMMITTED NTStatus = 0xC0190016 STATUS_TRANSACTION_INVALID_MARSHALL_BUFFER NTStatus = 0xC0190017 STATUS_CURRENT_TRANSACTION_NOT_VALID NTStatus = 0xC0190018 STATUS_LOG_GROWTH_FAILED NTStatus = 0xC0190019 STATUS_OBJECT_NO_LONGER_EXISTS NTStatus = 0xC0190021 STATUS_STREAM_MINIVERSION_NOT_FOUND NTStatus = 0xC0190022 STATUS_STREAM_MINIVERSION_NOT_VALID NTStatus = 0xC0190023 STATUS_MINIVERSION_INACCESSIBLE_FROM_SPECIFIED_TRANSACTION NTStatus = 0xC0190024 STATUS_CANT_OPEN_MINIVERSION_WITH_MODIFY_INTENT NTStatus = 0xC0190025 STATUS_CANT_CREATE_MORE_STREAM_MINIVERSIONS NTStatus = 0xC0190026 STATUS_HANDLE_NO_LONGER_VALID NTStatus = 0xC0190028 STATUS_NO_TXF_METADATA NTStatus = 0x80190029 STATUS_LOG_CORRUPTION_DETECTED NTStatus = 0xC0190030 STATUS_CANT_RECOVER_WITH_HANDLE_OPEN NTStatus = 0x80190031 STATUS_RM_DISCONNECTED NTStatus = 0xC0190032 STATUS_ENLISTMENT_NOT_SUPERIOR NTStatus = 0xC0190033 STATUS_RECOVERY_NOT_NEEDED NTStatus = 0x40190034 STATUS_RM_ALREADY_STARTED NTStatus = 0x40190035 STATUS_FILE_IDENTITY_NOT_PERSISTENT NTStatus = 0xC0190036 STATUS_CANT_BREAK_TRANSACTIONAL_DEPENDENCY NTStatus = 0xC0190037 STATUS_CANT_CROSS_RM_BOUNDARY NTStatus = 0xC0190038 STATUS_TXF_DIR_NOT_EMPTY NTStatus = 0xC0190039 STATUS_INDOUBT_TRANSACTIONS_EXIST NTStatus = 0xC019003A STATUS_TM_VOLATILE NTStatus = 0xC019003B STATUS_ROLLBACK_TIMER_EXPIRED NTStatus = 0xC019003C STATUS_TXF_ATTRIBUTE_CORRUPT NTStatus = 0xC019003D STATUS_EFS_NOT_ALLOWED_IN_TRANSACTION NTStatus = 0xC019003E STATUS_TRANSACTIONAL_OPEN_NOT_ALLOWED NTStatus = 0xC019003F STATUS_TRANSACTED_MAPPING_UNSUPPORTED_REMOTE NTStatus = 0xC0190040 STATUS_TXF_METADATA_ALREADY_PRESENT NTStatus = 0x80190041 STATUS_TRANSACTION_SCOPE_CALLBACKS_NOT_SET NTStatus = 0x80190042 STATUS_TRANSACTION_REQUIRED_PROMOTION NTStatus = 0xC0190043 STATUS_CANNOT_EXECUTE_FILE_IN_TRANSACTION NTStatus = 0xC0190044 STATUS_TRANSACTIONS_NOT_FROZEN NTStatus = 0xC0190045 STATUS_TRANSACTION_FREEZE_IN_PROGRESS NTStatus = 0xC0190046 STATUS_NOT_SNAPSHOT_VOLUME NTStatus = 0xC0190047 STATUS_NO_SAVEPOINT_WITH_OPEN_FILES NTStatus = 0xC0190048 STATUS_SPARSE_NOT_ALLOWED_IN_TRANSACTION NTStatus = 0xC0190049 STATUS_TM_IDENTITY_MISMATCH NTStatus = 0xC019004A STATUS_FLOATED_SECTION NTStatus = 0xC019004B STATUS_CANNOT_ACCEPT_TRANSACTED_WORK NTStatus = 0xC019004C STATUS_CANNOT_ABORT_TRANSACTIONS NTStatus = 0xC019004D STATUS_TRANSACTION_NOT_FOUND NTStatus = 0xC019004E STATUS_RESOURCEMANAGER_NOT_FOUND NTStatus = 0xC019004F STATUS_ENLISTMENT_NOT_FOUND NTStatus = 0xC0190050 STATUS_TRANSACTIONMANAGER_NOT_FOUND NTStatus = 0xC0190051 STATUS_TRANSACTIONMANAGER_NOT_ONLINE NTStatus = 0xC0190052 STATUS_TRANSACTIONMANAGER_RECOVERY_NAME_COLLISION NTStatus = 0xC0190053 STATUS_TRANSACTION_NOT_ROOT NTStatus = 0xC0190054 STATUS_TRANSACTION_OBJECT_EXPIRED NTStatus = 0xC0190055 STATUS_COMPRESSION_NOT_ALLOWED_IN_TRANSACTION NTStatus = 0xC0190056 STATUS_TRANSACTION_RESPONSE_NOT_ENLISTED NTStatus = 0xC0190057 STATUS_TRANSACTION_RECORD_TOO_LONG NTStatus = 0xC0190058 STATUS_NO_LINK_TRACKING_IN_TRANSACTION NTStatus = 0xC0190059 STATUS_OPERATION_NOT_SUPPORTED_IN_TRANSACTION NTStatus = 0xC019005A STATUS_TRANSACTION_INTEGRITY_VIOLATED NTStatus = 0xC019005B STATUS_TRANSACTIONMANAGER_IDENTITY_MISMATCH NTStatus = 0xC019005C STATUS_RM_CANNOT_BE_FROZEN_FOR_SNAPSHOT NTStatus = 0xC019005D STATUS_TRANSACTION_MUST_WRITETHROUGH NTStatus = 0xC019005E STATUS_TRANSACTION_NO_SUPERIOR NTStatus = 0xC019005F STATUS_EXPIRED_HANDLE NTStatus = 0xC0190060 STATUS_TRANSACTION_NOT_ENLISTED NTStatus = 0xC0190061 STATUS_LOG_SECTOR_INVALID NTStatus = 0xC01A0001 STATUS_LOG_SECTOR_PARITY_INVALID NTStatus = 0xC01A0002 STATUS_LOG_SECTOR_REMAPPED NTStatus = 0xC01A0003 STATUS_LOG_BLOCK_INCOMPLETE NTStatus = 0xC01A0004 STATUS_LOG_INVALID_RANGE NTStatus = 0xC01A0005 STATUS_LOG_BLOCKS_EXHAUSTED NTStatus = 0xC01A0006 STATUS_LOG_READ_CONTEXT_INVALID NTStatus = 0xC01A0007 STATUS_LOG_RESTART_INVALID NTStatus = 0xC01A0008 STATUS_LOG_BLOCK_VERSION NTStatus = 0xC01A0009 STATUS_LOG_BLOCK_INVALID NTStatus = 0xC01A000A STATUS_LOG_READ_MODE_INVALID NTStatus = 0xC01A000B STATUS_LOG_NO_RESTART NTStatus = 0x401A000C STATUS_LOG_METADATA_CORRUPT NTStatus = 0xC01A000D STATUS_LOG_METADATA_INVALID NTStatus = 0xC01A000E STATUS_LOG_METADATA_INCONSISTENT NTStatus = 0xC01A000F STATUS_LOG_RESERVATION_INVALID NTStatus = 0xC01A0010 STATUS_LOG_CANT_DELETE NTStatus = 0xC01A0011 STATUS_LOG_CONTAINER_LIMIT_EXCEEDED NTStatus = 0xC01A0012 STATUS_LOG_START_OF_LOG NTStatus = 0xC01A0013 STATUS_LOG_POLICY_ALREADY_INSTALLED NTStatus = 0xC01A0014 STATUS_LOG_POLICY_NOT_INSTALLED NTStatus = 0xC01A0015 STATUS_LOG_POLICY_INVALID NTStatus = 0xC01A0016 STATUS_LOG_POLICY_CONFLICT NTStatus = 0xC01A0017 STATUS_LOG_PINNED_ARCHIVE_TAIL NTStatus = 0xC01A0018 STATUS_LOG_RECORD_NONEXISTENT NTStatus = 0xC01A0019 STATUS_LOG_RECORDS_RESERVED_INVALID NTStatus = 0xC01A001A STATUS_LOG_SPACE_RESERVED_INVALID NTStatus = 0xC01A001B STATUS_LOG_TAIL_INVALID NTStatus = 0xC01A001C STATUS_LOG_FULL NTStatus = 0xC01A001D STATUS_LOG_MULTIPLEXED NTStatus = 0xC01A001E STATUS_LOG_DEDICATED NTStatus = 0xC01A001F STATUS_LOG_ARCHIVE_NOT_IN_PROGRESS NTStatus = 0xC01A0020 STATUS_LOG_ARCHIVE_IN_PROGRESS NTStatus = 0xC01A0021 STATUS_LOG_EPHEMERAL NTStatus = 0xC01A0022 STATUS_LOG_NOT_ENOUGH_CONTAINERS NTStatus = 0xC01A0023 STATUS_LOG_CLIENT_ALREADY_REGISTERED NTStatus = 0xC01A0024 STATUS_LOG_CLIENT_NOT_REGISTERED NTStatus = 0xC01A0025 STATUS_LOG_FULL_HANDLER_IN_PROGRESS NTStatus = 0xC01A0026 STATUS_LOG_CONTAINER_READ_FAILED NTStatus = 0xC01A0027 STATUS_LOG_CONTAINER_WRITE_FAILED NTStatus = 0xC01A0028 STATUS_LOG_CONTAINER_OPEN_FAILED NTStatus = 0xC01A0029 STATUS_LOG_CONTAINER_STATE_INVALID NTStatus = 0xC01A002A STATUS_LOG_STATE_INVALID NTStatus = 0xC01A002B STATUS_LOG_PINNED NTStatus = 0xC01A002C STATUS_LOG_METADATA_FLUSH_FAILED NTStatus = 0xC01A002D STATUS_LOG_INCONSISTENT_SECURITY NTStatus = 0xC01A002E STATUS_LOG_APPENDED_FLUSH_FAILED NTStatus = 0xC01A002F STATUS_LOG_PINNED_RESERVATION NTStatus = 0xC01A0030 STATUS_VIDEO_HUNG_DISPLAY_DRIVER_THREAD NTStatus = 0xC01B00EA STATUS_VIDEO_HUNG_DISPLAY_DRIVER_THREAD_RECOVERED NTStatus = 0x801B00EB STATUS_VIDEO_DRIVER_DEBUG_REPORT_REQUEST NTStatus = 0x401B00EC STATUS_MONITOR_NO_DESCRIPTOR NTStatus = 0xC01D0001 STATUS_MONITOR_UNKNOWN_DESCRIPTOR_FORMAT NTStatus = 0xC01D0002 STATUS_MONITOR_INVALID_DESCRIPTOR_CHECKSUM NTStatus = 0xC01D0003 STATUS_MONITOR_INVALID_STANDARD_TIMING_BLOCK NTStatus = 0xC01D0004 STATUS_MONITOR_WMI_DATABLOCK_REGISTRATION_FAILED NTStatus = 0xC01D0005 STATUS_MONITOR_INVALID_SERIAL_NUMBER_MONDSC_BLOCK NTStatus = 0xC01D0006 STATUS_MONITOR_INVALID_USER_FRIENDLY_MONDSC_BLOCK NTStatus = 0xC01D0007 STATUS_MONITOR_NO_MORE_DESCRIPTOR_DATA NTStatus = 0xC01D0008 STATUS_MONITOR_INVALID_DETAILED_TIMING_BLOCK NTStatus = 0xC01D0009 STATUS_MONITOR_INVALID_MANUFACTURE_DATE NTStatus = 0xC01D000A STATUS_GRAPHICS_NOT_EXCLUSIVE_MODE_OWNER NTStatus = 0xC01E0000 STATUS_GRAPHICS_INSUFFICIENT_DMA_BUFFER NTStatus = 0xC01E0001 STATUS_GRAPHICS_INVALID_DISPLAY_ADAPTER NTStatus = 0xC01E0002 STATUS_GRAPHICS_ADAPTER_WAS_RESET NTStatus = 0xC01E0003 STATUS_GRAPHICS_INVALID_DRIVER_MODEL NTStatus = 0xC01E0004 STATUS_GRAPHICS_PRESENT_MODE_CHANGED NTStatus = 0xC01E0005 STATUS_GRAPHICS_PRESENT_OCCLUDED NTStatus = 0xC01E0006 STATUS_GRAPHICS_PRESENT_DENIED NTStatus = 0xC01E0007 STATUS_GRAPHICS_CANNOTCOLORCONVERT NTStatus = 0xC01E0008 STATUS_GRAPHICS_DRIVER_MISMATCH NTStatus = 0xC01E0009 STATUS_GRAPHICS_PARTIAL_DATA_POPULATED NTStatus = 0x401E000A STATUS_GRAPHICS_PRESENT_REDIRECTION_DISABLED NTStatus = 0xC01E000B STATUS_GRAPHICS_PRESENT_UNOCCLUDED NTStatus = 0xC01E000C STATUS_GRAPHICS_WINDOWDC_NOT_AVAILABLE NTStatus = 0xC01E000D STATUS_GRAPHICS_WINDOWLESS_PRESENT_DISABLED NTStatus = 0xC01E000E STATUS_GRAPHICS_PRESENT_INVALID_WINDOW NTStatus = 0xC01E000F STATUS_GRAPHICS_PRESENT_BUFFER_NOT_BOUND NTStatus = 0xC01E0010 STATUS_GRAPHICS_VAIL_STATE_CHANGED NTStatus = 0xC01E0011 STATUS_GRAPHICS_INDIRECT_DISPLAY_ABANDON_SWAPCHAIN NTStatus = 0xC01E0012 STATUS_GRAPHICS_INDIRECT_DISPLAY_DEVICE_STOPPED NTStatus = 0xC01E0013 STATUS_GRAPHICS_NO_VIDEO_MEMORY NTStatus = 0xC01E0100 STATUS_GRAPHICS_CANT_LOCK_MEMORY NTStatus = 0xC01E0101 STATUS_GRAPHICS_ALLOCATION_BUSY NTStatus = 0xC01E0102 STATUS_GRAPHICS_TOO_MANY_REFERENCES NTStatus = 0xC01E0103 STATUS_GRAPHICS_TRY_AGAIN_LATER NTStatus = 0xC01E0104 STATUS_GRAPHICS_TRY_AGAIN_NOW NTStatus = 0xC01E0105 STATUS_GRAPHICS_ALLOCATION_INVALID NTStatus = 0xC01E0106 STATUS_GRAPHICS_UNSWIZZLING_APERTURE_UNAVAILABLE NTStatus = 0xC01E0107 STATUS_GRAPHICS_UNSWIZZLING_APERTURE_UNSUPPORTED NTStatus = 0xC01E0108 STATUS_GRAPHICS_CANT_EVICT_PINNED_ALLOCATION NTStatus = 0xC01E0109 STATUS_GRAPHICS_INVALID_ALLOCATION_USAGE NTStatus = 0xC01E0110 STATUS_GRAPHICS_CANT_RENDER_LOCKED_ALLOCATION NTStatus = 0xC01E0111 STATUS_GRAPHICS_ALLOCATION_CLOSED NTStatus = 0xC01E0112 STATUS_GRAPHICS_INVALID_ALLOCATION_INSTANCE NTStatus = 0xC01E0113 STATUS_GRAPHICS_INVALID_ALLOCATION_HANDLE NTStatus = 0xC01E0114 STATUS_GRAPHICS_WRONG_ALLOCATION_DEVICE NTStatus = 0xC01E0115 STATUS_GRAPHICS_ALLOCATION_CONTENT_LOST NTStatus = 0xC01E0116 STATUS_GRAPHICS_GPU_EXCEPTION_ON_DEVICE NTStatus = 0xC01E0200 STATUS_GRAPHICS_SKIP_ALLOCATION_PREPARATION NTStatus = 0x401E0201 STATUS_GRAPHICS_INVALID_VIDPN_TOPOLOGY NTStatus = 0xC01E0300 STATUS_GRAPHICS_VIDPN_TOPOLOGY_NOT_SUPPORTED NTStatus = 0xC01E0301 STATUS_GRAPHICS_VIDPN_TOPOLOGY_CURRENTLY_NOT_SUPPORTED NTStatus = 0xC01E0302 STATUS_GRAPHICS_INVALID_VIDPN NTStatus = 0xC01E0303 STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_SOURCE NTStatus = 0xC01E0304 STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_TARGET NTStatus = 0xC01E0305 STATUS_GRAPHICS_VIDPN_MODALITY_NOT_SUPPORTED NTStatus = 0xC01E0306 STATUS_GRAPHICS_MODE_NOT_PINNED NTStatus = 0x401E0307 STATUS_GRAPHICS_INVALID_VIDPN_SOURCEMODESET NTStatus = 0xC01E0308 STATUS_GRAPHICS_INVALID_VIDPN_TARGETMODESET NTStatus = 0xC01E0309 STATUS_GRAPHICS_INVALID_FREQUENCY NTStatus = 0xC01E030A STATUS_GRAPHICS_INVALID_ACTIVE_REGION NTStatus = 0xC01E030B STATUS_GRAPHICS_INVALID_TOTAL_REGION NTStatus = 0xC01E030C STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_SOURCE_MODE NTStatus = 0xC01E0310 STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_TARGET_MODE NTStatus = 0xC01E0311 STATUS_GRAPHICS_PINNED_MODE_MUST_REMAIN_IN_SET NTStatus = 0xC01E0312 STATUS_GRAPHICS_PATH_ALREADY_IN_TOPOLOGY NTStatus = 0xC01E0313 STATUS_GRAPHICS_MODE_ALREADY_IN_MODESET NTStatus = 0xC01E0314 STATUS_GRAPHICS_INVALID_VIDEOPRESENTSOURCESET NTStatus = 0xC01E0315 STATUS_GRAPHICS_INVALID_VIDEOPRESENTTARGETSET NTStatus = 0xC01E0316 STATUS_GRAPHICS_SOURCE_ALREADY_IN_SET NTStatus = 0xC01E0317 STATUS_GRAPHICS_TARGET_ALREADY_IN_SET NTStatus = 0xC01E0318 STATUS_GRAPHICS_INVALID_VIDPN_PRESENT_PATH NTStatus = 0xC01E0319 STATUS_GRAPHICS_NO_RECOMMENDED_VIDPN_TOPOLOGY NTStatus = 0xC01E031A STATUS_GRAPHICS_INVALID_MONITOR_FREQUENCYRANGESET NTStatus = 0xC01E031B STATUS_GRAPHICS_INVALID_MONITOR_FREQUENCYRANGE NTStatus = 0xC01E031C STATUS_GRAPHICS_FREQUENCYRANGE_NOT_IN_SET NTStatus = 0xC01E031D STATUS_GRAPHICS_NO_PREFERRED_MODE NTStatus = 0x401E031E STATUS_GRAPHICS_FREQUENCYRANGE_ALREADY_IN_SET NTStatus = 0xC01E031F STATUS_GRAPHICS_STALE_MODESET NTStatus = 0xC01E0320 STATUS_GRAPHICS_INVALID_MONITOR_SOURCEMODESET NTStatus = 0xC01E0321 STATUS_GRAPHICS_INVALID_MONITOR_SOURCE_MODE NTStatus = 0xC01E0322 STATUS_GRAPHICS_NO_RECOMMENDED_FUNCTIONAL_VIDPN NTStatus = 0xC01E0323 STATUS_GRAPHICS_MODE_ID_MUST_BE_UNIQUE NTStatus = 0xC01E0324 STATUS_GRAPHICS_EMPTY_ADAPTER_MONITOR_MODE_SUPPORT_INTERSECTION NTStatus = 0xC01E0325 STATUS_GRAPHICS_VIDEO_PRESENT_TARGETS_LESS_THAN_SOURCES NTStatus = 0xC01E0326 STATUS_GRAPHICS_PATH_NOT_IN_TOPOLOGY NTStatus = 0xC01E0327 STATUS_GRAPHICS_ADAPTER_MUST_HAVE_AT_LEAST_ONE_SOURCE NTStatus = 0xC01E0328 STATUS_GRAPHICS_ADAPTER_MUST_HAVE_AT_LEAST_ONE_TARGET NTStatus = 0xC01E0329 STATUS_GRAPHICS_INVALID_MONITORDESCRIPTORSET NTStatus = 0xC01E032A STATUS_GRAPHICS_INVALID_MONITORDESCRIPTOR NTStatus = 0xC01E032B STATUS_GRAPHICS_MONITORDESCRIPTOR_NOT_IN_SET NTStatus = 0xC01E032C STATUS_GRAPHICS_MONITORDESCRIPTOR_ALREADY_IN_SET NTStatus = 0xC01E032D STATUS_GRAPHICS_MONITORDESCRIPTOR_ID_MUST_BE_UNIQUE NTStatus = 0xC01E032E STATUS_GRAPHICS_INVALID_VIDPN_TARGET_SUBSET_TYPE NTStatus = 0xC01E032F STATUS_GRAPHICS_RESOURCES_NOT_RELATED NTStatus = 0xC01E0330 STATUS_GRAPHICS_SOURCE_ID_MUST_BE_UNIQUE NTStatus = 0xC01E0331 STATUS_GRAPHICS_TARGET_ID_MUST_BE_UNIQUE NTStatus = 0xC01E0332 STATUS_GRAPHICS_NO_AVAILABLE_VIDPN_TARGET NTStatus = 0xC01E0333 STATUS_GRAPHICS_MONITOR_COULD_NOT_BE_ASSOCIATED_WITH_ADAPTER NTStatus = 0xC01E0334 STATUS_GRAPHICS_NO_VIDPNMGR NTStatus = 0xC01E0335 STATUS_GRAPHICS_NO_ACTIVE_VIDPN NTStatus = 0xC01E0336 STATUS_GRAPHICS_STALE_VIDPN_TOPOLOGY NTStatus = 0xC01E0337 STATUS_GRAPHICS_MONITOR_NOT_CONNECTED NTStatus = 0xC01E0338 STATUS_GRAPHICS_SOURCE_NOT_IN_TOPOLOGY NTStatus = 0xC01E0339 STATUS_GRAPHICS_INVALID_PRIMARYSURFACE_SIZE NTStatus = 0xC01E033A STATUS_GRAPHICS_INVALID_VISIBLEREGION_SIZE NTStatus = 0xC01E033B STATUS_GRAPHICS_INVALID_STRIDE NTStatus = 0xC01E033C STATUS_GRAPHICS_INVALID_PIXELFORMAT NTStatus = 0xC01E033D STATUS_GRAPHICS_INVALID_COLORBASIS NTStatus = 0xC01E033E STATUS_GRAPHICS_INVALID_PIXELVALUEACCESSMODE NTStatus = 0xC01E033F STATUS_GRAPHICS_TARGET_NOT_IN_TOPOLOGY NTStatus = 0xC01E0340 STATUS_GRAPHICS_NO_DISPLAY_MODE_MANAGEMENT_SUPPORT NTStatus = 0xC01E0341 STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE NTStatus = 0xC01E0342 STATUS_GRAPHICS_CANT_ACCESS_ACTIVE_VIDPN NTStatus = 0xC01E0343 STATUS_GRAPHICS_INVALID_PATH_IMPORTANCE_ORDINAL NTStatus = 0xC01E0344 STATUS_GRAPHICS_INVALID_PATH_CONTENT_GEOMETRY_TRANSFORMATION NTStatus = 0xC01E0345 STATUS_GRAPHICS_PATH_CONTENT_GEOMETRY_TRANSFORMATION_NOT_SUPPORTED NTStatus = 0xC01E0346 STATUS_GRAPHICS_INVALID_GAMMA_RAMP NTStatus = 0xC01E0347 STATUS_GRAPHICS_GAMMA_RAMP_NOT_SUPPORTED NTStatus = 0xC01E0348 STATUS_GRAPHICS_MULTISAMPLING_NOT_SUPPORTED NTStatus = 0xC01E0349 STATUS_GRAPHICS_MODE_NOT_IN_MODESET NTStatus = 0xC01E034A STATUS_GRAPHICS_DATASET_IS_EMPTY NTStatus = 0x401E034B STATUS_GRAPHICS_NO_MORE_ELEMENTS_IN_DATASET NTStatus = 0x401E034C STATUS_GRAPHICS_INVALID_VIDPN_TOPOLOGY_RECOMMENDATION_REASON NTStatus = 0xC01E034D STATUS_GRAPHICS_INVALID_PATH_CONTENT_TYPE NTStatus = 0xC01E034E STATUS_GRAPHICS_INVALID_COPYPROTECTION_TYPE NTStatus = 0xC01E034F STATUS_GRAPHICS_UNASSIGNED_MODESET_ALREADY_EXISTS NTStatus = 0xC01E0350 STATUS_GRAPHICS_PATH_CONTENT_GEOMETRY_TRANSFORMATION_NOT_PINNED NTStatus = 0x401E0351 STATUS_GRAPHICS_INVALID_SCANLINE_ORDERING NTStatus = 0xC01E0352 STATUS_GRAPHICS_TOPOLOGY_CHANGES_NOT_ALLOWED NTStatus = 0xC01E0353 STATUS_GRAPHICS_NO_AVAILABLE_IMPORTANCE_ORDINALS NTStatus = 0xC01E0354 STATUS_GRAPHICS_INCOMPATIBLE_PRIVATE_FORMAT NTStatus = 0xC01E0355 STATUS_GRAPHICS_INVALID_MODE_PRUNING_ALGORITHM NTStatus = 0xC01E0356 STATUS_GRAPHICS_INVALID_MONITOR_CAPABILITY_ORIGIN NTStatus = 0xC01E0357 STATUS_GRAPHICS_INVALID_MONITOR_FREQUENCYRANGE_CONSTRAINT NTStatus = 0xC01E0358 STATUS_GRAPHICS_MAX_NUM_PATHS_REACHED NTStatus = 0xC01E0359 STATUS_GRAPHICS_CANCEL_VIDPN_TOPOLOGY_AUGMENTATION NTStatus = 0xC01E035A STATUS_GRAPHICS_INVALID_CLIENT_TYPE NTStatus = 0xC01E035B STATUS_GRAPHICS_CLIENTVIDPN_NOT_SET NTStatus = 0xC01E035C STATUS_GRAPHICS_SPECIFIED_CHILD_ALREADY_CONNECTED NTStatus = 0xC01E0400 STATUS_GRAPHICS_CHILD_DESCRIPTOR_NOT_SUPPORTED NTStatus = 0xC01E0401 STATUS_GRAPHICS_UNKNOWN_CHILD_STATUS NTStatus = 0x401E042F STATUS_GRAPHICS_NOT_A_LINKED_ADAPTER NTStatus = 0xC01E0430 STATUS_GRAPHICS_LEADLINK_NOT_ENUMERATED NTStatus = 0xC01E0431 STATUS_GRAPHICS_CHAINLINKS_NOT_ENUMERATED NTStatus = 0xC01E0432 STATUS_GRAPHICS_ADAPTER_CHAIN_NOT_READY NTStatus = 0xC01E0433 STATUS_GRAPHICS_CHAINLINKS_NOT_STARTED NTStatus = 0xC01E0434 STATUS_GRAPHICS_CHAINLINKS_NOT_POWERED_ON NTStatus = 0xC01E0435 STATUS_GRAPHICS_INCONSISTENT_DEVICE_LINK_STATE NTStatus = 0xC01E0436 STATUS_GRAPHICS_LEADLINK_START_DEFERRED NTStatus = 0x401E0437 STATUS_GRAPHICS_NOT_POST_DEVICE_DRIVER NTStatus = 0xC01E0438 STATUS_GRAPHICS_POLLING_TOO_FREQUENTLY NTStatus = 0x401E0439 STATUS_GRAPHICS_START_DEFERRED NTStatus = 0x401E043A STATUS_GRAPHICS_ADAPTER_ACCESS_NOT_EXCLUDED NTStatus = 0xC01E043B STATUS_GRAPHICS_DEPENDABLE_CHILD_STATUS NTStatus = 0x401E043C STATUS_GRAPHICS_OPM_NOT_SUPPORTED NTStatus = 0xC01E0500 STATUS_GRAPHICS_COPP_NOT_SUPPORTED NTStatus = 0xC01E0501 STATUS_GRAPHICS_UAB_NOT_SUPPORTED NTStatus = 0xC01E0502 STATUS_GRAPHICS_OPM_INVALID_ENCRYPTED_PARAMETERS NTStatus = 0xC01E0503 STATUS_GRAPHICS_OPM_NO_PROTECTED_OUTPUTS_EXIST NTStatus = 0xC01E0505 STATUS_GRAPHICS_OPM_INTERNAL_ERROR NTStatus = 0xC01E050B STATUS_GRAPHICS_OPM_INVALID_HANDLE NTStatus = 0xC01E050C STATUS_GRAPHICS_PVP_INVALID_CERTIFICATE_LENGTH NTStatus = 0xC01E050E STATUS_GRAPHICS_OPM_SPANNING_MODE_ENABLED NTStatus = 0xC01E050F STATUS_GRAPHICS_OPM_THEATER_MODE_ENABLED NTStatus = 0xC01E0510 STATUS_GRAPHICS_PVP_HFS_FAILED NTStatus = 0xC01E0511 STATUS_GRAPHICS_OPM_INVALID_SRM NTStatus = 0xC01E0512 STATUS_GRAPHICS_OPM_OUTPUT_DOES_NOT_SUPPORT_HDCP NTStatus = 0xC01E0513 STATUS_GRAPHICS_OPM_OUTPUT_DOES_NOT_SUPPORT_ACP NTStatus = 0xC01E0514 STATUS_GRAPHICS_OPM_OUTPUT_DOES_NOT_SUPPORT_CGMSA NTStatus = 0xC01E0515 STATUS_GRAPHICS_OPM_HDCP_SRM_NEVER_SET NTStatus = 0xC01E0516 STATUS_GRAPHICS_OPM_RESOLUTION_TOO_HIGH NTStatus = 0xC01E0517 STATUS_GRAPHICS_OPM_ALL_HDCP_HARDWARE_ALREADY_IN_USE NTStatus = 0xC01E0518 STATUS_GRAPHICS_OPM_PROTECTED_OUTPUT_NO_LONGER_EXISTS NTStatus = 0xC01E051A STATUS_GRAPHICS_OPM_PROTECTED_OUTPUT_DOES_NOT_HAVE_COPP_SEMANTICS NTStatus = 0xC01E051C STATUS_GRAPHICS_OPM_INVALID_INFORMATION_REQUEST NTStatus = 0xC01E051D STATUS_GRAPHICS_OPM_DRIVER_INTERNAL_ERROR NTStatus = 0xC01E051E STATUS_GRAPHICS_OPM_PROTECTED_OUTPUT_DOES_NOT_HAVE_OPM_SEMANTICS NTStatus = 0xC01E051F STATUS_GRAPHICS_OPM_SIGNALING_NOT_SUPPORTED NTStatus = 0xC01E0520 STATUS_GRAPHICS_OPM_INVALID_CONFIGURATION_REQUEST NTStatus = 0xC01E0521 STATUS_GRAPHICS_I2C_NOT_SUPPORTED NTStatus = 0xC01E0580 STATUS_GRAPHICS_I2C_DEVICE_DOES_NOT_EXIST NTStatus = 0xC01E0581 STATUS_GRAPHICS_I2C_ERROR_TRANSMITTING_DATA NTStatus = 0xC01E0582 STATUS_GRAPHICS_I2C_ERROR_RECEIVING_DATA NTStatus = 0xC01E0583 STATUS_GRAPHICS_DDCCI_VCP_NOT_SUPPORTED NTStatus = 0xC01E0584 STATUS_GRAPHICS_DDCCI_INVALID_DATA NTStatus = 0xC01E0585 STATUS_GRAPHICS_DDCCI_MONITOR_RETURNED_INVALID_TIMING_STATUS_BYTE NTStatus = 0xC01E0586 STATUS_GRAPHICS_DDCCI_INVALID_CAPABILITIES_STRING NTStatus = 0xC01E0587 STATUS_GRAPHICS_MCA_INTERNAL_ERROR NTStatus = 0xC01E0588 STATUS_GRAPHICS_DDCCI_INVALID_MESSAGE_COMMAND NTStatus = 0xC01E0589 STATUS_GRAPHICS_DDCCI_INVALID_MESSAGE_LENGTH NTStatus = 0xC01E058A STATUS_GRAPHICS_DDCCI_INVALID_MESSAGE_CHECKSUM NTStatus = 0xC01E058B STATUS_GRAPHICS_INVALID_PHYSICAL_MONITOR_HANDLE NTStatus = 0xC01E058C STATUS_GRAPHICS_MONITOR_NO_LONGER_EXISTS NTStatus = 0xC01E058D STATUS_GRAPHICS_ONLY_CONSOLE_SESSION_SUPPORTED NTStatus = 0xC01E05E0 STATUS_GRAPHICS_NO_DISPLAY_DEVICE_CORRESPONDS_TO_NAME NTStatus = 0xC01E05E1 STATUS_GRAPHICS_DISPLAY_DEVICE_NOT_ATTACHED_TO_DESKTOP NTStatus = 0xC01E05E2 STATUS_GRAPHICS_MIRRORING_DEVICES_NOT_SUPPORTED NTStatus = 0xC01E05E3 STATUS_GRAPHICS_INVALID_POINTER NTStatus = 0xC01E05E4 STATUS_GRAPHICS_NO_MONITORS_CORRESPOND_TO_DISPLAY_DEVICE NTStatus = 0xC01E05E5 STATUS_GRAPHICS_PARAMETER_ARRAY_TOO_SMALL NTStatus = 0xC01E05E6 STATUS_GRAPHICS_INTERNAL_ERROR NTStatus = 0xC01E05E7 STATUS_GRAPHICS_SESSION_TYPE_CHANGE_IN_PROGRESS NTStatus = 0xC01E05E8 STATUS_FVE_LOCKED_VOLUME NTStatus = 0xC0210000 STATUS_FVE_NOT_ENCRYPTED NTStatus = 0xC0210001 STATUS_FVE_BAD_INFORMATION NTStatus = 0xC0210002 STATUS_FVE_TOO_SMALL NTStatus = 0xC0210003 STATUS_FVE_FAILED_WRONG_FS NTStatus = 0xC0210004 STATUS_FVE_BAD_PARTITION_SIZE NTStatus = 0xC0210005 STATUS_FVE_FS_NOT_EXTENDED NTStatus = 0xC0210006 STATUS_FVE_FS_MOUNTED NTStatus = 0xC0210007 STATUS_FVE_NO_LICENSE NTStatus = 0xC0210008 STATUS_FVE_ACTION_NOT_ALLOWED NTStatus = 0xC0210009 STATUS_FVE_BAD_DATA NTStatus = 0xC021000A STATUS_FVE_VOLUME_NOT_BOUND NTStatus = 0xC021000B STATUS_FVE_NOT_DATA_VOLUME NTStatus = 0xC021000C STATUS_FVE_CONV_READ_ERROR NTStatus = 0xC021000D STATUS_FVE_CONV_WRITE_ERROR NTStatus = 0xC021000E STATUS_FVE_OVERLAPPED_UPDATE NTStatus = 0xC021000F STATUS_FVE_FAILED_SECTOR_SIZE NTStatus = 0xC0210010 STATUS_FVE_FAILED_AUTHENTICATION NTStatus = 0xC0210011 STATUS_FVE_NOT_OS_VOLUME NTStatus = 0xC0210012 STATUS_FVE_KEYFILE_NOT_FOUND NTStatus = 0xC0210013 STATUS_FVE_KEYFILE_INVALID NTStatus = 0xC0210014 STATUS_FVE_KEYFILE_NO_VMK NTStatus = 0xC0210015 STATUS_FVE_TPM_DISABLED NTStatus = 0xC0210016 STATUS_FVE_TPM_SRK_AUTH_NOT_ZERO NTStatus = 0xC0210017 STATUS_FVE_TPM_INVALID_PCR NTStatus = 0xC0210018 STATUS_FVE_TPM_NO_VMK NTStatus = 0xC0210019 STATUS_FVE_PIN_INVALID NTStatus = 0xC021001A STATUS_FVE_AUTH_INVALID_APPLICATION NTStatus = 0xC021001B STATUS_FVE_AUTH_INVALID_CONFIG NTStatus = 0xC021001C STATUS_FVE_DEBUGGER_ENABLED NTStatus = 0xC021001D STATUS_FVE_DRY_RUN_FAILED NTStatus = 0xC021001E STATUS_FVE_BAD_METADATA_POINTER NTStatus = 0xC021001F STATUS_FVE_OLD_METADATA_COPY NTStatus = 0xC0210020 STATUS_FVE_REBOOT_REQUIRED NTStatus = 0xC0210021 STATUS_FVE_RAW_ACCESS NTStatus = 0xC0210022 STATUS_FVE_RAW_BLOCKED NTStatus = 0xC0210023 STATUS_FVE_NO_AUTOUNLOCK_MASTER_KEY NTStatus = 0xC0210024 STATUS_FVE_MOR_FAILED NTStatus = 0xC0210025 STATUS_FVE_NO_FEATURE_LICENSE NTStatus = 0xC0210026 STATUS_FVE_POLICY_USER_DISABLE_RDV_NOT_ALLOWED NTStatus = 0xC0210027 STATUS_FVE_CONV_RECOVERY_FAILED NTStatus = 0xC0210028 STATUS_FVE_VIRTUALIZED_SPACE_TOO_BIG NTStatus = 0xC0210029 STATUS_FVE_INVALID_DATUM_TYPE NTStatus = 0xC021002A STATUS_FVE_VOLUME_TOO_SMALL NTStatus = 0xC0210030 STATUS_FVE_ENH_PIN_INVALID NTStatus = 0xC0210031 STATUS_FVE_FULL_ENCRYPTION_NOT_ALLOWED_ON_TP_STORAGE NTStatus = 0xC0210032 STATUS_FVE_WIPE_NOT_ALLOWED_ON_TP_STORAGE NTStatus = 0xC0210033 STATUS_FVE_NOT_ALLOWED_ON_CSV_STACK NTStatus = 0xC0210034 STATUS_FVE_NOT_ALLOWED_ON_CLUSTER NTStatus = 0xC0210035 STATUS_FVE_NOT_ALLOWED_TO_UPGRADE_WHILE_CONVERTING NTStatus = 0xC0210036 STATUS_FVE_WIPE_CANCEL_NOT_APPLICABLE NTStatus = 0xC0210037 STATUS_FVE_EDRIVE_DRY_RUN_FAILED NTStatus = 0xC0210038 STATUS_FVE_SECUREBOOT_DISABLED NTStatus = 0xC0210039 STATUS_FVE_SECUREBOOT_CONFIG_CHANGE NTStatus = 0xC021003A STATUS_FVE_DEVICE_LOCKEDOUT NTStatus = 0xC021003B STATUS_FVE_VOLUME_EXTEND_PREVENTS_EOW_DECRYPT NTStatus = 0xC021003C STATUS_FVE_NOT_DE_VOLUME NTStatus = 0xC021003D STATUS_FVE_PROTECTION_DISABLED NTStatus = 0xC021003E STATUS_FVE_PROTECTION_CANNOT_BE_DISABLED NTStatus = 0xC021003F STATUS_FVE_OSV_KSR_NOT_ALLOWED NTStatus = 0xC0210040 STATUS_FWP_CALLOUT_NOT_FOUND NTStatus = 0xC0220001 STATUS_FWP_CONDITION_NOT_FOUND NTStatus = 0xC0220002 STATUS_FWP_FILTER_NOT_FOUND NTStatus = 0xC0220003 STATUS_FWP_LAYER_NOT_FOUND NTStatus = 0xC0220004 STATUS_FWP_PROVIDER_NOT_FOUND NTStatus = 0xC0220005 STATUS_FWP_PROVIDER_CONTEXT_NOT_FOUND NTStatus = 0xC0220006 STATUS_FWP_SUBLAYER_NOT_FOUND NTStatus = 0xC0220007 STATUS_FWP_NOT_FOUND NTStatus = 0xC0220008 STATUS_FWP_ALREADY_EXISTS NTStatus = 0xC0220009 STATUS_FWP_IN_USE NTStatus = 0xC022000A STATUS_FWP_DYNAMIC_SESSION_IN_PROGRESS NTStatus = 0xC022000B STATUS_FWP_WRONG_SESSION NTStatus = 0xC022000C STATUS_FWP_NO_TXN_IN_PROGRESS NTStatus = 0xC022000D STATUS_FWP_TXN_IN_PROGRESS NTStatus = 0xC022000E STATUS_FWP_TXN_ABORTED NTStatus = 0xC022000F STATUS_FWP_SESSION_ABORTED NTStatus = 0xC0220010 STATUS_FWP_INCOMPATIBLE_TXN NTStatus = 0xC0220011 STATUS_FWP_TIMEOUT NTStatus = 0xC0220012 STATUS_FWP_NET_EVENTS_DISABLED NTStatus = 0xC0220013 STATUS_FWP_INCOMPATIBLE_LAYER NTStatus = 0xC0220014 STATUS_FWP_KM_CLIENTS_ONLY NTStatus = 0xC0220015 STATUS_FWP_LIFETIME_MISMATCH NTStatus = 0xC0220016 STATUS_FWP_BUILTIN_OBJECT NTStatus = 0xC0220017 STATUS_FWP_TOO_MANY_CALLOUTS NTStatus = 0xC0220018 STATUS_FWP_NOTIFICATION_DROPPED NTStatus = 0xC0220019 STATUS_FWP_TRAFFIC_MISMATCH NTStatus = 0xC022001A STATUS_FWP_INCOMPATIBLE_SA_STATE NTStatus = 0xC022001B STATUS_FWP_NULL_POINTER NTStatus = 0xC022001C STATUS_FWP_INVALID_ENUMERATOR NTStatus = 0xC022001D STATUS_FWP_INVALID_FLAGS NTStatus = 0xC022001E STATUS_FWP_INVALID_NET_MASK NTStatus = 0xC022001F STATUS_FWP_INVALID_RANGE NTStatus = 0xC0220020 STATUS_FWP_INVALID_INTERVAL NTStatus = 0xC0220021 STATUS_FWP_ZERO_LENGTH_ARRAY NTStatus = 0xC0220022 STATUS_FWP_NULL_DISPLAY_NAME NTStatus = 0xC0220023 STATUS_FWP_INVALID_ACTION_TYPE NTStatus = 0xC0220024 STATUS_FWP_INVALID_WEIGHT NTStatus = 0xC0220025 STATUS_FWP_MATCH_TYPE_MISMATCH NTStatus = 0xC0220026 STATUS_FWP_TYPE_MISMATCH NTStatus = 0xC0220027 STATUS_FWP_OUT_OF_BOUNDS NTStatus = 0xC0220028 STATUS_FWP_RESERVED NTStatus = 0xC0220029 STATUS_FWP_DUPLICATE_CONDITION NTStatus = 0xC022002A STATUS_FWP_DUPLICATE_KEYMOD NTStatus = 0xC022002B STATUS_FWP_ACTION_INCOMPATIBLE_WITH_LAYER NTStatus = 0xC022002C STATUS_FWP_ACTION_INCOMPATIBLE_WITH_SUBLAYER NTStatus = 0xC022002D STATUS_FWP_CONTEXT_INCOMPATIBLE_WITH_LAYER NTStatus = 0xC022002E STATUS_FWP_CONTEXT_INCOMPATIBLE_WITH_CALLOUT NTStatus = 0xC022002F STATUS_FWP_INCOMPATIBLE_AUTH_METHOD NTStatus = 0xC0220030 STATUS_FWP_INCOMPATIBLE_DH_GROUP NTStatus = 0xC0220031 STATUS_FWP_EM_NOT_SUPPORTED NTStatus = 0xC0220032 STATUS_FWP_NEVER_MATCH NTStatus = 0xC0220033 STATUS_FWP_PROVIDER_CONTEXT_MISMATCH NTStatus = 0xC0220034 STATUS_FWP_INVALID_PARAMETER NTStatus = 0xC0220035 STATUS_FWP_TOO_MANY_SUBLAYERS NTStatus = 0xC0220036 STATUS_FWP_CALLOUT_NOTIFICATION_FAILED NTStatus = 0xC0220037 STATUS_FWP_INVALID_AUTH_TRANSFORM NTStatus = 0xC0220038 STATUS_FWP_INVALID_CIPHER_TRANSFORM NTStatus = 0xC0220039 STATUS_FWP_INCOMPATIBLE_CIPHER_TRANSFORM NTStatus = 0xC022003A STATUS_FWP_INVALID_TRANSFORM_COMBINATION NTStatus = 0xC022003B STATUS_FWP_DUPLICATE_AUTH_METHOD NTStatus = 0xC022003C STATUS_FWP_INVALID_TUNNEL_ENDPOINT NTStatus = 0xC022003D STATUS_FWP_L2_DRIVER_NOT_READY NTStatus = 0xC022003E STATUS_FWP_KEY_DICTATOR_ALREADY_REGISTERED NTStatus = 0xC022003F STATUS_FWP_KEY_DICTATION_INVALID_KEYING_MATERIAL NTStatus = 0xC0220040 STATUS_FWP_CONNECTIONS_DISABLED NTStatus = 0xC0220041 STATUS_FWP_INVALID_DNS_NAME NTStatus = 0xC0220042 STATUS_FWP_STILL_ON NTStatus = 0xC0220043 STATUS_FWP_IKEEXT_NOT_RUNNING NTStatus = 0xC0220044 STATUS_FWP_TCPIP_NOT_READY NTStatus = 0xC0220100 STATUS_FWP_INJECT_HANDLE_CLOSING NTStatus = 0xC0220101 STATUS_FWP_INJECT_HANDLE_STALE NTStatus = 0xC0220102 STATUS_FWP_CANNOT_PEND NTStatus = 0xC0220103 STATUS_FWP_DROP_NOICMP NTStatus = 0xC0220104 STATUS_NDIS_CLOSING NTStatus = 0xC0230002 STATUS_NDIS_BAD_VERSION NTStatus = 0xC0230004 STATUS_NDIS_BAD_CHARACTERISTICS NTStatus = 0xC0230005 STATUS_NDIS_ADAPTER_NOT_FOUND NTStatus = 0xC0230006 STATUS_NDIS_OPEN_FAILED NTStatus = 0xC0230007 STATUS_NDIS_DEVICE_FAILED NTStatus = 0xC0230008 STATUS_NDIS_MULTICAST_FULL NTStatus = 0xC0230009 STATUS_NDIS_MULTICAST_EXISTS NTStatus = 0xC023000A STATUS_NDIS_MULTICAST_NOT_FOUND NTStatus = 0xC023000B STATUS_NDIS_REQUEST_ABORTED NTStatus = 0xC023000C STATUS_NDIS_RESET_IN_PROGRESS NTStatus = 0xC023000D STATUS_NDIS_NOT_SUPPORTED NTStatus = 0xC02300BB STATUS_NDIS_INVALID_PACKET NTStatus = 0xC023000F STATUS_NDIS_ADAPTER_NOT_READY NTStatus = 0xC0230011 STATUS_NDIS_INVALID_LENGTH NTStatus = 0xC0230014 STATUS_NDIS_INVALID_DATA NTStatus = 0xC0230015 STATUS_NDIS_BUFFER_TOO_SHORT NTStatus = 0xC0230016 STATUS_NDIS_INVALID_OID NTStatus = 0xC0230017 STATUS_NDIS_ADAPTER_REMOVED NTStatus = 0xC0230018 STATUS_NDIS_UNSUPPORTED_MEDIA NTStatus = 0xC0230019 STATUS_NDIS_GROUP_ADDRESS_IN_USE NTStatus = 0xC023001A STATUS_NDIS_FILE_NOT_FOUND NTStatus = 0xC023001B STATUS_NDIS_ERROR_READING_FILE NTStatus = 0xC023001C STATUS_NDIS_ALREADY_MAPPED NTStatus = 0xC023001D STATUS_NDIS_RESOURCE_CONFLICT NTStatus = 0xC023001E STATUS_NDIS_MEDIA_DISCONNECTED NTStatus = 0xC023001F STATUS_NDIS_INVALID_ADDRESS NTStatus = 0xC0230022 STATUS_NDIS_INVALID_DEVICE_REQUEST NTStatus = 0xC0230010 STATUS_NDIS_PAUSED NTStatus = 0xC023002A STATUS_NDIS_INTERFACE_NOT_FOUND NTStatus = 0xC023002B STATUS_NDIS_UNSUPPORTED_REVISION NTStatus = 0xC023002C STATUS_NDIS_INVALID_PORT NTStatus = 0xC023002D STATUS_NDIS_INVALID_PORT_STATE NTStatus = 0xC023002E STATUS_NDIS_LOW_POWER_STATE NTStatus = 0xC023002F STATUS_NDIS_REINIT_REQUIRED NTStatus = 0xC0230030 STATUS_NDIS_NO_QUEUES NTStatus = 0xC0230031 STATUS_NDIS_DOT11_AUTO_CONFIG_ENABLED NTStatus = 0xC0232000 STATUS_NDIS_DOT11_MEDIA_IN_USE NTStatus = 0xC0232001 STATUS_NDIS_DOT11_POWER_STATE_INVALID NTStatus = 0xC0232002 STATUS_NDIS_PM_WOL_PATTERN_LIST_FULL NTStatus = 0xC0232003 STATUS_NDIS_PM_PROTOCOL_OFFLOAD_LIST_FULL NTStatus = 0xC0232004 STATUS_NDIS_DOT11_AP_CHANNEL_CURRENTLY_NOT_AVAILABLE NTStatus = 0xC0232005 STATUS_NDIS_DOT11_AP_BAND_CURRENTLY_NOT_AVAILABLE NTStatus = 0xC0232006 STATUS_NDIS_DOT11_AP_CHANNEL_NOT_ALLOWED NTStatus = 0xC0232007 STATUS_NDIS_DOT11_AP_BAND_NOT_ALLOWED NTStatus = 0xC0232008 STATUS_NDIS_INDICATION_REQUIRED NTStatus = 0x40230001 STATUS_NDIS_OFFLOAD_POLICY NTStatus = 0xC023100F STATUS_NDIS_OFFLOAD_CONNECTION_REJECTED NTStatus = 0xC0231012 STATUS_NDIS_OFFLOAD_PATH_REJECTED NTStatus = 0xC0231013 STATUS_TPM_ERROR_MASK NTStatus = 0xC0290000 STATUS_TPM_AUTHFAIL NTStatus = 0xC0290001 STATUS_TPM_BADINDEX NTStatus = 0xC0290002 STATUS_TPM_BAD_PARAMETER NTStatus = 0xC0290003 STATUS_TPM_AUDITFAILURE NTStatus = 0xC0290004 STATUS_TPM_CLEAR_DISABLED NTStatus = 0xC0290005 STATUS_TPM_DEACTIVATED NTStatus = 0xC0290006 STATUS_TPM_DISABLED NTStatus = 0xC0290007 STATUS_TPM_DISABLED_CMD NTStatus = 0xC0290008 STATUS_TPM_FAIL NTStatus = 0xC0290009 STATUS_TPM_BAD_ORDINAL NTStatus = 0xC029000A STATUS_TPM_INSTALL_DISABLED NTStatus = 0xC029000B STATUS_TPM_INVALID_KEYHANDLE NTStatus = 0xC029000C STATUS_TPM_KEYNOTFOUND NTStatus = 0xC029000D STATUS_TPM_INAPPROPRIATE_ENC NTStatus = 0xC029000E STATUS_TPM_MIGRATEFAIL NTStatus = 0xC029000F STATUS_TPM_INVALID_PCR_INFO NTStatus = 0xC0290010 STATUS_TPM_NOSPACE NTStatus = 0xC0290011 STATUS_TPM_NOSRK NTStatus = 0xC0290012 STATUS_TPM_NOTSEALED_BLOB NTStatus = 0xC0290013 STATUS_TPM_OWNER_SET NTStatus = 0xC0290014 STATUS_TPM_RESOURCES NTStatus = 0xC0290015 STATUS_TPM_SHORTRANDOM NTStatus = 0xC0290016 STATUS_TPM_SIZE NTStatus = 0xC0290017 STATUS_TPM_WRONGPCRVAL NTStatus = 0xC0290018 STATUS_TPM_BAD_PARAM_SIZE NTStatus = 0xC0290019 STATUS_TPM_SHA_THREAD NTStatus = 0xC029001A STATUS_TPM_SHA_ERROR NTStatus = 0xC029001B STATUS_TPM_FAILEDSELFTEST NTStatus = 0xC029001C STATUS_TPM_AUTH2FAIL NTStatus = 0xC029001D STATUS_TPM_BADTAG NTStatus = 0xC029001E STATUS_TPM_IOERROR NTStatus = 0xC029001F STATUS_TPM_ENCRYPT_ERROR NTStatus = 0xC0290020 STATUS_TPM_DECRYPT_ERROR NTStatus = 0xC0290021 STATUS_TPM_INVALID_AUTHHANDLE NTStatus = 0xC0290022 STATUS_TPM_NO_ENDORSEMENT NTStatus = 0xC0290023 STATUS_TPM_INVALID_KEYUSAGE NTStatus = 0xC0290024 STATUS_TPM_WRONG_ENTITYTYPE NTStatus = 0xC0290025 STATUS_TPM_INVALID_POSTINIT NTStatus = 0xC0290026 STATUS_TPM_INAPPROPRIATE_SIG NTStatus = 0xC0290027 STATUS_TPM_BAD_KEY_PROPERTY NTStatus = 0xC0290028 STATUS_TPM_BAD_MIGRATION NTStatus = 0xC0290029 STATUS_TPM_BAD_SCHEME NTStatus = 0xC029002A STATUS_TPM_BAD_DATASIZE NTStatus = 0xC029002B STATUS_TPM_BAD_MODE NTStatus = 0xC029002C STATUS_TPM_BAD_PRESENCE NTStatus = 0xC029002D STATUS_TPM_BAD_VERSION NTStatus = 0xC029002E STATUS_TPM_NO_WRAP_TRANSPORT NTStatus = 0xC029002F STATUS_TPM_AUDITFAIL_UNSUCCESSFUL NTStatus = 0xC0290030 STATUS_TPM_AUDITFAIL_SUCCESSFUL NTStatus = 0xC0290031 STATUS_TPM_NOTRESETABLE NTStatus = 0xC0290032 STATUS_TPM_NOTLOCAL NTStatus = 0xC0290033 STATUS_TPM_BAD_TYPE NTStatus = 0xC0290034 STATUS_TPM_INVALID_RESOURCE NTStatus = 0xC0290035 STATUS_TPM_NOTFIPS NTStatus = 0xC0290036 STATUS_TPM_INVALID_FAMILY NTStatus = 0xC0290037 STATUS_TPM_NO_NV_PERMISSION NTStatus = 0xC0290038 STATUS_TPM_REQUIRES_SIGN NTStatus = 0xC0290039 STATUS_TPM_KEY_NOTSUPPORTED NTStatus = 0xC029003A STATUS_TPM_AUTH_CONFLICT NTStatus = 0xC029003B STATUS_TPM_AREA_LOCKED NTStatus = 0xC029003C STATUS_TPM_BAD_LOCALITY NTStatus = 0xC029003D STATUS_TPM_READ_ONLY NTStatus = 0xC029003E STATUS_TPM_PER_NOWRITE NTStatus = 0xC029003F STATUS_TPM_FAMILYCOUNT NTStatus = 0xC0290040 STATUS_TPM_WRITE_LOCKED NTStatus = 0xC0290041 STATUS_TPM_BAD_ATTRIBUTES NTStatus = 0xC0290042 STATUS_TPM_INVALID_STRUCTURE NTStatus = 0xC0290043 STATUS_TPM_KEY_OWNER_CONTROL NTStatus = 0xC0290044 STATUS_TPM_BAD_COUNTER NTStatus = 0xC0290045 STATUS_TPM_NOT_FULLWRITE NTStatus = 0xC0290046 STATUS_TPM_CONTEXT_GAP NTStatus = 0xC0290047 STATUS_TPM_MAXNVWRITES NTStatus = 0xC0290048 STATUS_TPM_NOOPERATOR NTStatus = 0xC0290049 STATUS_TPM_RESOURCEMISSING NTStatus = 0xC029004A STATUS_TPM_DELEGATE_LOCK NTStatus = 0xC029004B STATUS_TPM_DELEGATE_FAMILY NTStatus = 0xC029004C STATUS_TPM_DELEGATE_ADMIN NTStatus = 0xC029004D STATUS_TPM_TRANSPORT_NOTEXCLUSIVE NTStatus = 0xC029004E STATUS_TPM_OWNER_CONTROL NTStatus = 0xC029004F STATUS_TPM_DAA_RESOURCES NTStatus = 0xC0290050 STATUS_TPM_DAA_INPUT_DATA0 NTStatus = 0xC0290051 STATUS_TPM_DAA_INPUT_DATA1 NTStatus = 0xC0290052 STATUS_TPM_DAA_ISSUER_SETTINGS NTStatus = 0xC0290053 STATUS_TPM_DAA_TPM_SETTINGS NTStatus = 0xC0290054 STATUS_TPM_DAA_STAGE NTStatus = 0xC0290055 STATUS_TPM_DAA_ISSUER_VALIDITY NTStatus = 0xC0290056 STATUS_TPM_DAA_WRONG_W NTStatus = 0xC0290057 STATUS_TPM_BAD_HANDLE NTStatus = 0xC0290058 STATUS_TPM_BAD_DELEGATE NTStatus = 0xC0290059 STATUS_TPM_BADCONTEXT NTStatus = 0xC029005A STATUS_TPM_TOOMANYCONTEXTS NTStatus = 0xC029005B STATUS_TPM_MA_TICKET_SIGNATURE NTStatus = 0xC029005C STATUS_TPM_MA_DESTINATION NTStatus = 0xC029005D STATUS_TPM_MA_SOURCE NTStatus = 0xC029005E STATUS_TPM_MA_AUTHORITY NTStatus = 0xC029005F STATUS_TPM_PERMANENTEK NTStatus = 0xC0290061 STATUS_TPM_BAD_SIGNATURE NTStatus = 0xC0290062 STATUS_TPM_NOCONTEXTSPACE NTStatus = 0xC0290063 STATUS_TPM_20_E_ASYMMETRIC NTStatus = 0xC0290081 STATUS_TPM_20_E_ATTRIBUTES NTStatus = 0xC0290082 STATUS_TPM_20_E_HASH NTStatus = 0xC0290083 STATUS_TPM_20_E_VALUE NTStatus = 0xC0290084 STATUS_TPM_20_E_HIERARCHY NTStatus = 0xC0290085 STATUS_TPM_20_E_KEY_SIZE NTStatus = 0xC0290087 STATUS_TPM_20_E_MGF NTStatus = 0xC0290088 STATUS_TPM_20_E_MODE NTStatus = 0xC0290089 STATUS_TPM_20_E_TYPE NTStatus = 0xC029008A STATUS_TPM_20_E_HANDLE NTStatus = 0xC029008B STATUS_TPM_20_E_KDF NTStatus = 0xC029008C STATUS_TPM_20_E_RANGE NTStatus = 0xC029008D STATUS_TPM_20_E_AUTH_FAIL NTStatus = 0xC029008E STATUS_TPM_20_E_NONCE NTStatus = 0xC029008F STATUS_TPM_20_E_PP NTStatus = 0xC0290090 STATUS_TPM_20_E_SCHEME NTStatus = 0xC0290092 STATUS_TPM_20_E_SIZE NTStatus = 0xC0290095 STATUS_TPM_20_E_SYMMETRIC NTStatus = 0xC0290096 STATUS_TPM_20_E_TAG NTStatus = 0xC0290097 STATUS_TPM_20_E_SELECTOR NTStatus = 0xC0290098 STATUS_TPM_20_E_INSUFFICIENT NTStatus = 0xC029009A STATUS_TPM_20_E_SIGNATURE NTStatus = 0xC029009B STATUS_TPM_20_E_KEY NTStatus = 0xC029009C STATUS_TPM_20_E_POLICY_FAIL NTStatus = 0xC029009D STATUS_TPM_20_E_INTEGRITY NTStatus = 0xC029009F STATUS_TPM_20_E_TICKET NTStatus = 0xC02900A0 STATUS_TPM_20_E_RESERVED_BITS NTStatus = 0xC02900A1 STATUS_TPM_20_E_BAD_AUTH NTStatus = 0xC02900A2 STATUS_TPM_20_E_EXPIRED NTStatus = 0xC02900A3 STATUS_TPM_20_E_POLICY_CC NTStatus = 0xC02900A4 STATUS_TPM_20_E_BINDING NTStatus = 0xC02900A5 STATUS_TPM_20_E_CURVE NTStatus = 0xC02900A6 STATUS_TPM_20_E_ECC_POINT NTStatus = 0xC02900A7 STATUS_TPM_20_E_INITIALIZE NTStatus = 0xC0290100 STATUS_TPM_20_E_FAILURE NTStatus = 0xC0290101 STATUS_TPM_20_E_SEQUENCE NTStatus = 0xC0290103 STATUS_TPM_20_E_PRIVATE NTStatus = 0xC029010B STATUS_TPM_20_E_HMAC NTStatus = 0xC0290119 STATUS_TPM_20_E_DISABLED NTStatus = 0xC0290120 STATUS_TPM_20_E_EXCLUSIVE NTStatus = 0xC0290121 STATUS_TPM_20_E_ECC_CURVE NTStatus = 0xC0290123 STATUS_TPM_20_E_AUTH_TYPE NTStatus = 0xC0290124 STATUS_TPM_20_E_AUTH_MISSING NTStatus = 0xC0290125 STATUS_TPM_20_E_POLICY NTStatus = 0xC0290126 STATUS_TPM_20_E_PCR NTStatus = 0xC0290127 STATUS_TPM_20_E_PCR_CHANGED NTStatus = 0xC0290128 STATUS_TPM_20_E_UPGRADE NTStatus = 0xC029012D STATUS_TPM_20_E_TOO_MANY_CONTEXTS NTStatus = 0xC029012E STATUS_TPM_20_E_AUTH_UNAVAILABLE NTStatus = 0xC029012F STATUS_TPM_20_E_REBOOT NTStatus = 0xC0290130 STATUS_TPM_20_E_UNBALANCED NTStatus = 0xC0290131 STATUS_TPM_20_E_COMMAND_SIZE NTStatus = 0xC0290142 STATUS_TPM_20_E_COMMAND_CODE NTStatus = 0xC0290143 STATUS_TPM_20_E_AUTHSIZE NTStatus = 0xC0290144 STATUS_TPM_20_E_AUTH_CONTEXT NTStatus = 0xC0290145 STATUS_TPM_20_E_NV_RANGE NTStatus = 0xC0290146 STATUS_TPM_20_E_NV_SIZE NTStatus = 0xC0290147 STATUS_TPM_20_E_NV_LOCKED NTStatus = 0xC0290148 STATUS_TPM_20_E_NV_AUTHORIZATION NTStatus = 0xC0290149 STATUS_TPM_20_E_NV_UNINITIALIZED NTStatus = 0xC029014A STATUS_TPM_20_E_NV_SPACE NTStatus = 0xC029014B STATUS_TPM_20_E_NV_DEFINED NTStatus = 0xC029014C STATUS_TPM_20_E_BAD_CONTEXT NTStatus = 0xC0290150 STATUS_TPM_20_E_CPHASH NTStatus = 0xC0290151 STATUS_TPM_20_E_PARENT NTStatus = 0xC0290152 STATUS_TPM_20_E_NEEDS_TEST NTStatus = 0xC0290153 STATUS_TPM_20_E_NO_RESULT NTStatus = 0xC0290154 STATUS_TPM_20_E_SENSITIVE NTStatus = 0xC0290155 STATUS_TPM_COMMAND_BLOCKED NTStatus = 0xC0290400 STATUS_TPM_INVALID_HANDLE NTStatus = 0xC0290401 STATUS_TPM_DUPLICATE_VHANDLE NTStatus = 0xC0290402 STATUS_TPM_EMBEDDED_COMMAND_BLOCKED NTStatus = 0xC0290403 STATUS_TPM_EMBEDDED_COMMAND_UNSUPPORTED NTStatus = 0xC0290404 STATUS_TPM_RETRY NTStatus = 0xC0290800 STATUS_TPM_NEEDS_SELFTEST NTStatus = 0xC0290801 STATUS_TPM_DOING_SELFTEST NTStatus = 0xC0290802 STATUS_TPM_DEFEND_LOCK_RUNNING NTStatus = 0xC0290803 STATUS_TPM_COMMAND_CANCELED NTStatus = 0xC0291001 STATUS_TPM_TOO_MANY_CONTEXTS NTStatus = 0xC0291002 STATUS_TPM_NOT_FOUND NTStatus = 0xC0291003 STATUS_TPM_ACCESS_DENIED NTStatus = 0xC0291004 STATUS_TPM_INSUFFICIENT_BUFFER NTStatus = 0xC0291005 STATUS_TPM_PPI_FUNCTION_UNSUPPORTED NTStatus = 0xC0291006 STATUS_PCP_ERROR_MASK NTStatus = 0xC0292000 STATUS_PCP_DEVICE_NOT_READY NTStatus = 0xC0292001 STATUS_PCP_INVALID_HANDLE NTStatus = 0xC0292002 STATUS_PCP_INVALID_PARAMETER NTStatus = 0xC0292003 STATUS_PCP_FLAG_NOT_SUPPORTED NTStatus = 0xC0292004 STATUS_PCP_NOT_SUPPORTED NTStatus = 0xC0292005 STATUS_PCP_BUFFER_TOO_SMALL NTStatus = 0xC0292006 STATUS_PCP_INTERNAL_ERROR NTStatus = 0xC0292007 STATUS_PCP_AUTHENTICATION_FAILED NTStatus = 0xC0292008 STATUS_PCP_AUTHENTICATION_IGNORED NTStatus = 0xC0292009 STATUS_PCP_POLICY_NOT_FOUND NTStatus = 0xC029200A STATUS_PCP_PROFILE_NOT_FOUND NTStatus = 0xC029200B STATUS_PCP_VALIDATION_FAILED NTStatus = 0xC029200C STATUS_PCP_DEVICE_NOT_FOUND NTStatus = 0xC029200D STATUS_PCP_WRONG_PARENT NTStatus = 0xC029200E STATUS_PCP_KEY_NOT_LOADED NTStatus = 0xC029200F STATUS_PCP_NO_KEY_CERTIFICATION NTStatus = 0xC0292010 STATUS_PCP_KEY_NOT_FINALIZED NTStatus = 0xC0292011 STATUS_PCP_ATTESTATION_CHALLENGE_NOT_SET NTStatus = 0xC0292012 STATUS_PCP_NOT_PCR_BOUND NTStatus = 0xC0292013 STATUS_PCP_KEY_ALREADY_FINALIZED NTStatus = 0xC0292014 STATUS_PCP_KEY_USAGE_POLICY_NOT_SUPPORTED NTStatus = 0xC0292015 STATUS_PCP_KEY_USAGE_POLICY_INVALID NTStatus = 0xC0292016 STATUS_PCP_SOFT_KEY_ERROR NTStatus = 0xC0292017 STATUS_PCP_KEY_NOT_AUTHENTICATED NTStatus = 0xC0292018 STATUS_PCP_KEY_NOT_AIK NTStatus = 0xC0292019 STATUS_PCP_KEY_NOT_SIGNING_KEY NTStatus = 0xC029201A STATUS_PCP_LOCKED_OUT NTStatus = 0xC029201B STATUS_PCP_CLAIM_TYPE_NOT_SUPPORTED NTStatus = 0xC029201C STATUS_PCP_TPM_VERSION_NOT_SUPPORTED NTStatus = 0xC029201D STATUS_PCP_BUFFER_LENGTH_MISMATCH NTStatus = 0xC029201E STATUS_PCP_IFX_RSA_KEY_CREATION_BLOCKED NTStatus = 0xC029201F STATUS_PCP_TICKET_MISSING NTStatus = 0xC0292020 STATUS_PCP_RAW_POLICY_NOT_SUPPORTED NTStatus = 0xC0292021 STATUS_PCP_KEY_HANDLE_INVALIDATED NTStatus = 0xC0292022 STATUS_PCP_UNSUPPORTED_PSS_SALT NTStatus = 0x40292023 STATUS_RTPM_CONTEXT_CONTINUE NTStatus = 0x00293000 STATUS_RTPM_CONTEXT_COMPLETE NTStatus = 0x00293001 STATUS_RTPM_NO_RESULT NTStatus = 0xC0293002 STATUS_RTPM_PCR_READ_INCOMPLETE NTStatus = 0xC0293003 STATUS_RTPM_INVALID_CONTEXT NTStatus = 0xC0293004 STATUS_RTPM_UNSUPPORTED_CMD NTStatus = 0xC0293005 STATUS_TPM_ZERO_EXHAUST_ENABLED NTStatus = 0xC0294000 STATUS_HV_INVALID_HYPERCALL_CODE NTStatus = 0xC0350002 STATUS_HV_INVALID_HYPERCALL_INPUT NTStatus = 0xC0350003 STATUS_HV_INVALID_ALIGNMENT NTStatus = 0xC0350004 STATUS_HV_INVALID_PARAMETER NTStatus = 0xC0350005 STATUS_HV_ACCESS_DENIED NTStatus = 0xC0350006 STATUS_HV_INVALID_PARTITION_STATE NTStatus = 0xC0350007 STATUS_HV_OPERATION_DENIED NTStatus = 0xC0350008 STATUS_HV_UNKNOWN_PROPERTY NTStatus = 0xC0350009 STATUS_HV_PROPERTY_VALUE_OUT_OF_RANGE NTStatus = 0xC035000A STATUS_HV_INSUFFICIENT_MEMORY NTStatus = 0xC035000B STATUS_HV_PARTITION_TOO_DEEP NTStatus = 0xC035000C STATUS_HV_INVALID_PARTITION_ID NTStatus = 0xC035000D STATUS_HV_INVALID_VP_INDEX NTStatus = 0xC035000E STATUS_HV_INVALID_PORT_ID NTStatus = 0xC0350011 STATUS_HV_INVALID_CONNECTION_ID NTStatus = 0xC0350012 STATUS_HV_INSUFFICIENT_BUFFERS NTStatus = 0xC0350013 STATUS_HV_NOT_ACKNOWLEDGED NTStatus = 0xC0350014 STATUS_HV_INVALID_VP_STATE NTStatus = 0xC0350015 STATUS_HV_ACKNOWLEDGED NTStatus = 0xC0350016 STATUS_HV_INVALID_SAVE_RESTORE_STATE NTStatus = 0xC0350017 STATUS_HV_INVALID_SYNIC_STATE NTStatus = 0xC0350018 STATUS_HV_OBJECT_IN_USE NTStatus = 0xC0350019 STATUS_HV_INVALID_PROXIMITY_DOMAIN_INFO NTStatus = 0xC035001A STATUS_HV_NO_DATA NTStatus = 0xC035001B STATUS_HV_INACTIVE NTStatus = 0xC035001C STATUS_HV_NO_RESOURCES NTStatus = 0xC035001D STATUS_HV_FEATURE_UNAVAILABLE NTStatus = 0xC035001E STATUS_HV_INSUFFICIENT_BUFFER NTStatus = 0xC0350033 STATUS_HV_INSUFFICIENT_DEVICE_DOMAINS NTStatus = 0xC0350038 STATUS_HV_CPUID_FEATURE_VALIDATION_ERROR NTStatus = 0xC035003C STATUS_HV_CPUID_XSAVE_FEATURE_VALIDATION_ERROR NTStatus = 0xC035003D STATUS_HV_PROCESSOR_STARTUP_TIMEOUT NTStatus = 0xC035003E STATUS_HV_SMX_ENABLED NTStatus = 0xC035003F STATUS_HV_INVALID_LP_INDEX NTStatus = 0xC0350041 STATUS_HV_INVALID_REGISTER_VALUE NTStatus = 0xC0350050 STATUS_HV_INVALID_VTL_STATE NTStatus = 0xC0350051 STATUS_HV_NX_NOT_DETECTED NTStatus = 0xC0350055 STATUS_HV_INVALID_DEVICE_ID NTStatus = 0xC0350057 STATUS_HV_INVALID_DEVICE_STATE NTStatus = 0xC0350058 STATUS_HV_PENDING_PAGE_REQUESTS NTStatus = 0x00350059 STATUS_HV_PAGE_REQUEST_INVALID NTStatus = 0xC0350060 STATUS_HV_INVALID_CPU_GROUP_ID NTStatus = 0xC035006F STATUS_HV_INVALID_CPU_GROUP_STATE NTStatus = 0xC0350070 STATUS_HV_OPERATION_FAILED NTStatus = 0xC0350071 STATUS_HV_NOT_ALLOWED_WITH_NESTED_VIRT_ACTIVE NTStatus = 0xC0350072 STATUS_HV_INSUFFICIENT_ROOT_MEMORY NTStatus = 0xC0350073 STATUS_HV_NOT_PRESENT NTStatus = 0xC0351000 STATUS_VID_DUPLICATE_HANDLER NTStatus = 0xC0370001 STATUS_VID_TOO_MANY_HANDLERS NTStatus = 0xC0370002 STATUS_VID_QUEUE_FULL NTStatus = 0xC0370003 STATUS_VID_HANDLER_NOT_PRESENT NTStatus = 0xC0370004 STATUS_VID_INVALID_OBJECT_NAME NTStatus = 0xC0370005 STATUS_VID_PARTITION_NAME_TOO_LONG NTStatus = 0xC0370006 STATUS_VID_MESSAGE_QUEUE_NAME_TOO_LONG NTStatus = 0xC0370007 STATUS_VID_PARTITION_ALREADY_EXISTS NTStatus = 0xC0370008 STATUS_VID_PARTITION_DOES_NOT_EXIST NTStatus = 0xC0370009 STATUS_VID_PARTITION_NAME_NOT_FOUND NTStatus = 0xC037000A STATUS_VID_MESSAGE_QUEUE_ALREADY_EXISTS NTStatus = 0xC037000B STATUS_VID_EXCEEDED_MBP_ENTRY_MAP_LIMIT NTStatus = 0xC037000C STATUS_VID_MB_STILL_REFERENCED NTStatus = 0xC037000D STATUS_VID_CHILD_GPA_PAGE_SET_CORRUPTED NTStatus = 0xC037000E STATUS_VID_INVALID_NUMA_SETTINGS NTStatus = 0xC037000F STATUS_VID_INVALID_NUMA_NODE_INDEX NTStatus = 0xC0370010 STATUS_VID_NOTIFICATION_QUEUE_ALREADY_ASSOCIATED NTStatus = 0xC0370011 STATUS_VID_INVALID_MEMORY_BLOCK_HANDLE NTStatus = 0xC0370012 STATUS_VID_PAGE_RANGE_OVERFLOW NTStatus = 0xC0370013 STATUS_VID_INVALID_MESSAGE_QUEUE_HANDLE NTStatus = 0xC0370014 STATUS_VID_INVALID_GPA_RANGE_HANDLE NTStatus = 0xC0370015 STATUS_VID_NO_MEMORY_BLOCK_NOTIFICATION_QUEUE NTStatus = 0xC0370016 STATUS_VID_MEMORY_BLOCK_LOCK_COUNT_EXCEEDED NTStatus = 0xC0370017 STATUS_VID_INVALID_PPM_HANDLE NTStatus = 0xC0370018 STATUS_VID_MBPS_ARE_LOCKED NTStatus = 0xC0370019 STATUS_VID_MESSAGE_QUEUE_CLOSED NTStatus = 0xC037001A STATUS_VID_VIRTUAL_PROCESSOR_LIMIT_EXCEEDED NTStatus = 0xC037001B STATUS_VID_STOP_PENDING NTStatus = 0xC037001C STATUS_VID_INVALID_PROCESSOR_STATE NTStatus = 0xC037001D STATUS_VID_EXCEEDED_KM_CONTEXT_COUNT_LIMIT NTStatus = 0xC037001E STATUS_VID_KM_INTERFACE_ALREADY_INITIALIZED NTStatus = 0xC037001F STATUS_VID_MB_PROPERTY_ALREADY_SET_RESET NTStatus = 0xC0370020 STATUS_VID_MMIO_RANGE_DESTROYED NTStatus = 0xC0370021 STATUS_VID_INVALID_CHILD_GPA_PAGE_SET NTStatus = 0xC0370022 STATUS_VID_RESERVE_PAGE_SET_IS_BEING_USED NTStatus = 0xC0370023 STATUS_VID_RESERVE_PAGE_SET_TOO_SMALL NTStatus = 0xC0370024 STATUS_VID_MBP_ALREADY_LOCKED_USING_RESERVED_PAGE NTStatus = 0xC0370025 STATUS_VID_MBP_COUNT_EXCEEDED_LIMIT NTStatus = 0xC0370026 STATUS_VID_SAVED_STATE_CORRUPT NTStatus = 0xC0370027 STATUS_VID_SAVED_STATE_UNRECOGNIZED_ITEM NTStatus = 0xC0370028 STATUS_VID_SAVED_STATE_INCOMPATIBLE NTStatus = 0xC0370029 STATUS_VID_VTL_ACCESS_DENIED NTStatus = 0xC037002A STATUS_VID_REMOTE_NODE_PARENT_GPA_PAGES_USED NTStatus = 0x80370001 STATUS_IPSEC_BAD_SPI NTStatus = 0xC0360001 STATUS_IPSEC_SA_LIFETIME_EXPIRED NTStatus = 0xC0360002 STATUS_IPSEC_WRONG_SA NTStatus = 0xC0360003 STATUS_IPSEC_REPLAY_CHECK_FAILED NTStatus = 0xC0360004 STATUS_IPSEC_INVALID_PACKET NTStatus = 0xC0360005 STATUS_IPSEC_INTEGRITY_CHECK_FAILED NTStatus = 0xC0360006 STATUS_IPSEC_CLEAR_TEXT_DROP NTStatus = 0xC0360007 STATUS_IPSEC_AUTH_FIREWALL_DROP NTStatus = 0xC0360008 STATUS_IPSEC_THROTTLE_DROP NTStatus = 0xC0360009 STATUS_IPSEC_DOSP_BLOCK NTStatus = 0xC0368000 STATUS_IPSEC_DOSP_RECEIVED_MULTICAST NTStatus = 0xC0368001 STATUS_IPSEC_DOSP_INVALID_PACKET NTStatus = 0xC0368002 STATUS_IPSEC_DOSP_STATE_LOOKUP_FAILED NTStatus = 0xC0368003 STATUS_IPSEC_DOSP_MAX_ENTRIES NTStatus = 0xC0368004 STATUS_IPSEC_DOSP_KEYMOD_NOT_ALLOWED NTStatus = 0xC0368005 STATUS_IPSEC_DOSP_MAX_PER_IP_RATELIMIT_QUEUES NTStatus = 0xC0368006 STATUS_VOLMGR_INCOMPLETE_REGENERATION NTStatus = 0x80380001 STATUS_VOLMGR_INCOMPLETE_DISK_MIGRATION NTStatus = 0x80380002 STATUS_VOLMGR_DATABASE_FULL NTStatus = 0xC0380001 STATUS_VOLMGR_DISK_CONFIGURATION_CORRUPTED NTStatus = 0xC0380002 STATUS_VOLMGR_DISK_CONFIGURATION_NOT_IN_SYNC NTStatus = 0xC0380003 STATUS_VOLMGR_PACK_CONFIG_UPDATE_FAILED NTStatus = 0xC0380004 STATUS_VOLMGR_DISK_CONTAINS_NON_SIMPLE_VOLUME NTStatus = 0xC0380005 STATUS_VOLMGR_DISK_DUPLICATE NTStatus = 0xC0380006 STATUS_VOLMGR_DISK_DYNAMIC NTStatus = 0xC0380007 STATUS_VOLMGR_DISK_ID_INVALID NTStatus = 0xC0380008 STATUS_VOLMGR_DISK_INVALID NTStatus = 0xC0380009 STATUS_VOLMGR_DISK_LAST_VOTER NTStatus = 0xC038000A STATUS_VOLMGR_DISK_LAYOUT_INVALID NTStatus = 0xC038000B STATUS_VOLMGR_DISK_LAYOUT_NON_BASIC_BETWEEN_BASIC_PARTITIONS NTStatus = 0xC038000C STATUS_VOLMGR_DISK_LAYOUT_NOT_CYLINDER_ALIGNED NTStatus = 0xC038000D STATUS_VOLMGR_DISK_LAYOUT_PARTITIONS_TOO_SMALL NTStatus = 0xC038000E STATUS_VOLMGR_DISK_LAYOUT_PRIMARY_BETWEEN_LOGICAL_PARTITIONS NTStatus = 0xC038000F STATUS_VOLMGR_DISK_LAYOUT_TOO_MANY_PARTITIONS NTStatus = 0xC0380010 STATUS_VOLMGR_DISK_MISSING NTStatus = 0xC0380011 STATUS_VOLMGR_DISK_NOT_EMPTY NTStatus = 0xC0380012 STATUS_VOLMGR_DISK_NOT_ENOUGH_SPACE NTStatus = 0xC0380013 STATUS_VOLMGR_DISK_REVECTORING_FAILED NTStatus = 0xC0380014 STATUS_VOLMGR_DISK_SECTOR_SIZE_INVALID NTStatus = 0xC0380015 STATUS_VOLMGR_DISK_SET_NOT_CONTAINED NTStatus = 0xC0380016 STATUS_VOLMGR_DISK_USED_BY_MULTIPLE_MEMBERS NTStatus = 0xC0380017 STATUS_VOLMGR_DISK_USED_BY_MULTIPLE_PLEXES NTStatus = 0xC0380018 STATUS_VOLMGR_DYNAMIC_DISK_NOT_SUPPORTED NTStatus = 0xC0380019 STATUS_VOLMGR_EXTENT_ALREADY_USED NTStatus = 0xC038001A STATUS_VOLMGR_EXTENT_NOT_CONTIGUOUS NTStatus = 0xC038001B STATUS_VOLMGR_EXTENT_NOT_IN_PUBLIC_REGION NTStatus = 0xC038001C STATUS_VOLMGR_EXTENT_NOT_SECTOR_ALIGNED NTStatus = 0xC038001D STATUS_VOLMGR_EXTENT_OVERLAPS_EBR_PARTITION NTStatus = 0xC038001E STATUS_VOLMGR_EXTENT_VOLUME_LENGTHS_DO_NOT_MATCH NTStatus = 0xC038001F STATUS_VOLMGR_FAULT_TOLERANT_NOT_SUPPORTED NTStatus = 0xC0380020 STATUS_VOLMGR_INTERLEAVE_LENGTH_INVALID NTStatus = 0xC0380021 STATUS_VOLMGR_MAXIMUM_REGISTERED_USERS NTStatus = 0xC0380022 STATUS_VOLMGR_MEMBER_IN_SYNC NTStatus = 0xC0380023 STATUS_VOLMGR_MEMBER_INDEX_DUPLICATE NTStatus = 0xC0380024 STATUS_VOLMGR_MEMBER_INDEX_INVALID NTStatus = 0xC0380025 STATUS_VOLMGR_MEMBER_MISSING NTStatus = 0xC0380026 STATUS_VOLMGR_MEMBER_NOT_DETACHED NTStatus = 0xC0380027 STATUS_VOLMGR_MEMBER_REGENERATING NTStatus = 0xC0380028 STATUS_VOLMGR_ALL_DISKS_FAILED NTStatus = 0xC0380029 STATUS_VOLMGR_NO_REGISTERED_USERS NTStatus = 0xC038002A STATUS_VOLMGR_NO_SUCH_USER NTStatus = 0xC038002B STATUS_VOLMGR_NOTIFICATION_RESET NTStatus = 0xC038002C STATUS_VOLMGR_NUMBER_OF_MEMBERS_INVALID NTStatus = 0xC038002D STATUS_VOLMGR_NUMBER_OF_PLEXES_INVALID NTStatus = 0xC038002E STATUS_VOLMGR_PACK_DUPLICATE NTStatus = 0xC038002F STATUS_VOLMGR_PACK_ID_INVALID NTStatus = 0xC0380030 STATUS_VOLMGR_PACK_INVALID NTStatus = 0xC0380031 STATUS_VOLMGR_PACK_NAME_INVALID NTStatus = 0xC0380032 STATUS_VOLMGR_PACK_OFFLINE NTStatus = 0xC0380033 STATUS_VOLMGR_PACK_HAS_QUORUM NTStatus = 0xC0380034 STATUS_VOLMGR_PACK_WITHOUT_QUORUM NTStatus = 0xC0380035 STATUS_VOLMGR_PARTITION_STYLE_INVALID NTStatus = 0xC0380036 STATUS_VOLMGR_PARTITION_UPDATE_FAILED NTStatus = 0xC0380037 STATUS_VOLMGR_PLEX_IN_SYNC NTStatus = 0xC0380038 STATUS_VOLMGR_PLEX_INDEX_DUPLICATE NTStatus = 0xC0380039 STATUS_VOLMGR_PLEX_INDEX_INVALID NTStatus = 0xC038003A STATUS_VOLMGR_PLEX_LAST_ACTIVE NTStatus = 0xC038003B STATUS_VOLMGR_PLEX_MISSING NTStatus = 0xC038003C STATUS_VOLMGR_PLEX_REGENERATING NTStatus = 0xC038003D STATUS_VOLMGR_PLEX_TYPE_INVALID NTStatus = 0xC038003E STATUS_VOLMGR_PLEX_NOT_RAID5 NTStatus = 0xC038003F STATUS_VOLMGR_PLEX_NOT_SIMPLE NTStatus = 0xC0380040 STATUS_VOLMGR_STRUCTURE_SIZE_INVALID NTStatus = 0xC0380041 STATUS_VOLMGR_TOO_MANY_NOTIFICATION_REQUESTS NTStatus = 0xC0380042 STATUS_VOLMGR_TRANSACTION_IN_PROGRESS NTStatus = 0xC0380043 STATUS_VOLMGR_UNEXPECTED_DISK_LAYOUT_CHANGE NTStatus = 0xC0380044 STATUS_VOLMGR_VOLUME_CONTAINS_MISSING_DISK NTStatus = 0xC0380045 STATUS_VOLMGR_VOLUME_ID_INVALID NTStatus = 0xC0380046 STATUS_VOLMGR_VOLUME_LENGTH_INVALID NTStatus = 0xC0380047 STATUS_VOLMGR_VOLUME_LENGTH_NOT_SECTOR_SIZE_MULTIPLE NTStatus = 0xC0380048 STATUS_VOLMGR_VOLUME_NOT_MIRRORED NTStatus = 0xC0380049 STATUS_VOLMGR_VOLUME_NOT_RETAINED NTStatus = 0xC038004A STATUS_VOLMGR_VOLUME_OFFLINE NTStatus = 0xC038004B STATUS_VOLMGR_VOLUME_RETAINED NTStatus = 0xC038004C STATUS_VOLMGR_NUMBER_OF_EXTENTS_INVALID NTStatus = 0xC038004D STATUS_VOLMGR_DIFFERENT_SECTOR_SIZE NTStatus = 0xC038004E STATUS_VOLMGR_BAD_BOOT_DISK NTStatus = 0xC038004F STATUS_VOLMGR_PACK_CONFIG_OFFLINE NTStatus = 0xC0380050 STATUS_VOLMGR_PACK_CONFIG_ONLINE NTStatus = 0xC0380051 STATUS_VOLMGR_NOT_PRIMARY_PACK NTStatus = 0xC0380052 STATUS_VOLMGR_PACK_LOG_UPDATE_FAILED NTStatus = 0xC0380053 STATUS_VOLMGR_NUMBER_OF_DISKS_IN_PLEX_INVALID NTStatus = 0xC0380054 STATUS_VOLMGR_NUMBER_OF_DISKS_IN_MEMBER_INVALID NTStatus = 0xC0380055 STATUS_VOLMGR_VOLUME_MIRRORED NTStatus = 0xC0380056 STATUS_VOLMGR_PLEX_NOT_SIMPLE_SPANNED NTStatus = 0xC0380057 STATUS_VOLMGR_NO_VALID_LOG_COPIES NTStatus = 0xC0380058 STATUS_VOLMGR_PRIMARY_PACK_PRESENT NTStatus = 0xC0380059 STATUS_VOLMGR_NUMBER_OF_DISKS_INVALID NTStatus = 0xC038005A STATUS_VOLMGR_MIRROR_NOT_SUPPORTED NTStatus = 0xC038005B STATUS_VOLMGR_RAID5_NOT_SUPPORTED NTStatus = 0xC038005C STATUS_BCD_NOT_ALL_ENTRIES_IMPORTED NTStatus = 0x80390001 STATUS_BCD_TOO_MANY_ELEMENTS NTStatus = 0xC0390002 STATUS_BCD_NOT_ALL_ENTRIES_SYNCHRONIZED NTStatus = 0x80390003 STATUS_VHD_DRIVE_FOOTER_MISSING NTStatus = 0xC03A0001 STATUS_VHD_DRIVE_FOOTER_CHECKSUM_MISMATCH NTStatus = 0xC03A0002 STATUS_VHD_DRIVE_FOOTER_CORRUPT NTStatus = 0xC03A0003 STATUS_VHD_FORMAT_UNKNOWN NTStatus = 0xC03A0004 STATUS_VHD_FORMAT_UNSUPPORTED_VERSION NTStatus = 0xC03A0005 STATUS_VHD_SPARSE_HEADER_CHECKSUM_MISMATCH NTStatus = 0xC03A0006 STATUS_VHD_SPARSE_HEADER_UNSUPPORTED_VERSION NTStatus = 0xC03A0007 STATUS_VHD_SPARSE_HEADER_CORRUPT NTStatus = 0xC03A0008 STATUS_VHD_BLOCK_ALLOCATION_FAILURE NTStatus = 0xC03A0009 STATUS_VHD_BLOCK_ALLOCATION_TABLE_CORRUPT NTStatus = 0xC03A000A STATUS_VHD_INVALID_BLOCK_SIZE NTStatus = 0xC03A000B STATUS_VHD_BITMAP_MISMATCH NTStatus = 0xC03A000C STATUS_VHD_PARENT_VHD_NOT_FOUND NTStatus = 0xC03A000D STATUS_VHD_CHILD_PARENT_ID_MISMATCH NTStatus = 0xC03A000E STATUS_VHD_CHILD_PARENT_TIMESTAMP_MISMATCH NTStatus = 0xC03A000F STATUS_VHD_METADATA_READ_FAILURE NTStatus = 0xC03A0010 STATUS_VHD_METADATA_WRITE_FAILURE NTStatus = 0xC03A0011 STATUS_VHD_INVALID_SIZE NTStatus = 0xC03A0012 STATUS_VHD_INVALID_FILE_SIZE NTStatus = 0xC03A0013 STATUS_VIRTDISK_PROVIDER_NOT_FOUND NTStatus = 0xC03A0014 STATUS_VIRTDISK_NOT_VIRTUAL_DISK NTStatus = 0xC03A0015 STATUS_VHD_PARENT_VHD_ACCESS_DENIED NTStatus = 0xC03A0016 STATUS_VHD_CHILD_PARENT_SIZE_MISMATCH NTStatus = 0xC03A0017 STATUS_VHD_DIFFERENCING_CHAIN_CYCLE_DETECTED NTStatus = 0xC03A0018 STATUS_VHD_DIFFERENCING_CHAIN_ERROR_IN_PARENT NTStatus = 0xC03A0019 STATUS_VIRTUAL_DISK_LIMITATION NTStatus = 0xC03A001A STATUS_VHD_INVALID_TYPE NTStatus = 0xC03A001B STATUS_VHD_INVALID_STATE NTStatus = 0xC03A001C STATUS_VIRTDISK_UNSUPPORTED_DISK_SECTOR_SIZE NTStatus = 0xC03A001D STATUS_VIRTDISK_DISK_ALREADY_OWNED NTStatus = 0xC03A001E STATUS_VIRTDISK_DISK_ONLINE_AND_WRITABLE NTStatus = 0xC03A001F STATUS_CTLOG_TRACKING_NOT_INITIALIZED NTStatus = 0xC03A0020 STATUS_CTLOG_LOGFILE_SIZE_EXCEEDED_MAXSIZE NTStatus = 0xC03A0021 STATUS_CTLOG_VHD_CHANGED_OFFLINE NTStatus = 0xC03A0022 STATUS_CTLOG_INVALID_TRACKING_STATE NTStatus = 0xC03A0023 STATUS_CTLOG_INCONSISTENT_TRACKING_FILE NTStatus = 0xC03A0024 STATUS_VHD_METADATA_FULL NTStatus = 0xC03A0028 STATUS_VHD_INVALID_CHANGE_TRACKING_ID NTStatus = 0xC03A0029 STATUS_VHD_CHANGE_TRACKING_DISABLED NTStatus = 0xC03A002A STATUS_VHD_MISSING_CHANGE_TRACKING_INFORMATION NTStatus = 0xC03A0030 STATUS_VHD_RESIZE_WOULD_TRUNCATE_DATA NTStatus = 0xC03A0031 STATUS_VHD_COULD_NOT_COMPUTE_MINIMUM_VIRTUAL_SIZE NTStatus = 0xC03A0032 STATUS_VHD_ALREADY_AT_OR_BELOW_MINIMUM_VIRTUAL_SIZE NTStatus = 0xC03A0033 STATUS_QUERY_STORAGE_ERROR NTStatus = 0x803A0001 STATUS_GDI_HANDLE_LEAK NTStatus = 0x803F0001 STATUS_RKF_KEY_NOT_FOUND NTStatus = 0xC0400001 STATUS_RKF_DUPLICATE_KEY NTStatus = 0xC0400002 STATUS_RKF_BLOB_FULL NTStatus = 0xC0400003 STATUS_RKF_STORE_FULL NTStatus = 0xC0400004 STATUS_RKF_FILE_BLOCKED NTStatus = 0xC0400005 STATUS_RKF_ACTIVE_KEY NTStatus = 0xC0400006 STATUS_RDBSS_RESTART_OPERATION NTStatus = 0xC0410001 STATUS_RDBSS_CONTINUE_OPERATION NTStatus = 0xC0410002 STATUS_RDBSS_POST_OPERATION NTStatus = 0xC0410003 STATUS_RDBSS_RETRY_LOOKUP NTStatus = 0xC0410004 STATUS_BTH_ATT_INVALID_HANDLE NTStatus = 0xC0420001 STATUS_BTH_ATT_READ_NOT_PERMITTED NTStatus = 0xC0420002 STATUS_BTH_ATT_WRITE_NOT_PERMITTED NTStatus = 0xC0420003 STATUS_BTH_ATT_INVALID_PDU NTStatus = 0xC0420004 STATUS_BTH_ATT_INSUFFICIENT_AUTHENTICATION NTStatus = 0xC0420005 STATUS_BTH_ATT_REQUEST_NOT_SUPPORTED NTStatus = 0xC0420006 STATUS_BTH_ATT_INVALID_OFFSET NTStatus = 0xC0420007 STATUS_BTH_ATT_INSUFFICIENT_AUTHORIZATION NTStatus = 0xC0420008 STATUS_BTH_ATT_PREPARE_QUEUE_FULL NTStatus = 0xC0420009 STATUS_BTH_ATT_ATTRIBUTE_NOT_FOUND NTStatus = 0xC042000A STATUS_BTH_ATT_ATTRIBUTE_NOT_LONG NTStatus = 0xC042000B STATUS_BTH_ATT_INSUFFICIENT_ENCRYPTION_KEY_SIZE NTStatus = 0xC042000C STATUS_BTH_ATT_INVALID_ATTRIBUTE_VALUE_LENGTH NTStatus = 0xC042000D STATUS_BTH_ATT_UNLIKELY NTStatus = 0xC042000E STATUS_BTH_ATT_INSUFFICIENT_ENCRYPTION NTStatus = 0xC042000F STATUS_BTH_ATT_UNSUPPORTED_GROUP_TYPE NTStatus = 0xC0420010 STATUS_BTH_ATT_INSUFFICIENT_RESOURCES NTStatus = 0xC0420011 STATUS_BTH_ATT_UNKNOWN_ERROR NTStatus = 0xC0421000 STATUS_SECUREBOOT_ROLLBACK_DETECTED NTStatus = 0xC0430001 STATUS_SECUREBOOT_POLICY_VIOLATION NTStatus = 0xC0430002 STATUS_SECUREBOOT_INVALID_POLICY NTStatus = 0xC0430003 STATUS_SECUREBOOT_POLICY_PUBLISHER_NOT_FOUND NTStatus = 0xC0430004 STATUS_SECUREBOOT_POLICY_NOT_SIGNED NTStatus = 0xC0430005 STATUS_SECUREBOOT_NOT_ENABLED NTStatus = 0x80430006 STATUS_SECUREBOOT_FILE_REPLACED NTStatus = 0xC0430007 STATUS_SECUREBOOT_POLICY_NOT_AUTHORIZED NTStatus = 0xC0430008 STATUS_SECUREBOOT_POLICY_UNKNOWN NTStatus = 0xC0430009 STATUS_SECUREBOOT_POLICY_MISSING_ANTIROLLBACKVERSION NTStatus = 0xC043000A STATUS_SECUREBOOT_PLATFORM_ID_MISMATCH NTStatus = 0xC043000B STATUS_SECUREBOOT_POLICY_ROLLBACK_DETECTED NTStatus = 0xC043000C STATUS_SECUREBOOT_POLICY_UPGRADE_MISMATCH NTStatus = 0xC043000D STATUS_SECUREBOOT_REQUIRED_POLICY_FILE_MISSING NTStatus = 0xC043000E STATUS_SECUREBOOT_NOT_BASE_POLICY NTStatus = 0xC043000F STATUS_SECUREBOOT_NOT_SUPPLEMENTAL_POLICY NTStatus = 0xC0430010 STATUS_PLATFORM_MANIFEST_NOT_AUTHORIZED NTStatus = 0xC0EB0001 STATUS_PLATFORM_MANIFEST_INVALID NTStatus = 0xC0EB0002 STATUS_PLATFORM_MANIFEST_FILE_NOT_AUTHORIZED NTStatus = 0xC0EB0003 STATUS_PLATFORM_MANIFEST_CATALOG_NOT_AUTHORIZED NTStatus = 0xC0EB0004 STATUS_PLATFORM_MANIFEST_BINARY_ID_NOT_FOUND NTStatus = 0xC0EB0005 STATUS_PLATFORM_MANIFEST_NOT_ACTIVE NTStatus = 0xC0EB0006 STATUS_PLATFORM_MANIFEST_NOT_SIGNED NTStatus = 0xC0EB0007 STATUS_SYSTEM_INTEGRITY_ROLLBACK_DETECTED NTStatus = 0xC0E90001 STATUS_SYSTEM_INTEGRITY_POLICY_VIOLATION NTStatus = 0xC0E90002 STATUS_SYSTEM_INTEGRITY_INVALID_POLICY NTStatus = 0xC0E90003 STATUS_SYSTEM_INTEGRITY_POLICY_NOT_SIGNED NTStatus = 0xC0E90004 STATUS_SYSTEM_INTEGRITY_TOO_MANY_POLICIES NTStatus = 0xC0E90005 STATUS_SYSTEM_INTEGRITY_SUPPLEMENTAL_POLICY_NOT_AUTHORIZED NTStatus = 0xC0E90006 STATUS_NO_APPLICABLE_APP_LICENSES_FOUND NTStatus = 0xC0EA0001 STATUS_CLIP_LICENSE_NOT_FOUND NTStatus = 0xC0EA0002 STATUS_CLIP_DEVICE_LICENSE_MISSING NTStatus = 0xC0EA0003 STATUS_CLIP_LICENSE_INVALID_SIGNATURE NTStatus = 0xC0EA0004 STATUS_CLIP_KEYHOLDER_LICENSE_MISSING_OR_INVALID NTStatus = 0xC0EA0005 STATUS_CLIP_LICENSE_EXPIRED NTStatus = 0xC0EA0006 STATUS_CLIP_LICENSE_SIGNED_BY_UNKNOWN_SOURCE NTStatus = 0xC0EA0007 STATUS_CLIP_LICENSE_NOT_SIGNED NTStatus = 0xC0EA0008 STATUS_CLIP_LICENSE_HARDWARE_ID_OUT_OF_TOLERANCE NTStatus = 0xC0EA0009 STATUS_CLIP_LICENSE_DEVICE_ID_MISMATCH NTStatus = 0xC0EA000A STATUS_AUDIO_ENGINE_NODE_NOT_FOUND NTStatus = 0xC0440001 STATUS_HDAUDIO_EMPTY_CONNECTION_LIST NTStatus = 0xC0440002 STATUS_HDAUDIO_CONNECTION_LIST_NOT_SUPPORTED NTStatus = 0xC0440003 STATUS_HDAUDIO_NO_LOGICAL_DEVICES_CREATED NTStatus = 0xC0440004 STATUS_HDAUDIO_NULL_LINKED_LIST_ENTRY NTStatus = 0xC0440005 STATUS_SPACES_REPAIRED NTStatus = 0x00E70000 STATUS_SPACES_PAUSE NTStatus = 0x00E70001 STATUS_SPACES_COMPLETE NTStatus = 0x00E70002 STATUS_SPACES_REDIRECT NTStatus = 0x00E70003 STATUS_SPACES_FAULT_DOMAIN_TYPE_INVALID NTStatus = 0xC0E70001 STATUS_SPACES_RESILIENCY_TYPE_INVALID NTStatus = 0xC0E70003 STATUS_SPACES_DRIVE_SECTOR_SIZE_INVALID NTStatus = 0xC0E70004 STATUS_SPACES_DRIVE_REDUNDANCY_INVALID NTStatus = 0xC0E70006 STATUS_SPACES_NUMBER_OF_DATA_COPIES_INVALID NTStatus = 0xC0E70007 STATUS_SPACES_INTERLEAVE_LENGTH_INVALID NTStatus = 0xC0E70009 STATUS_SPACES_NUMBER_OF_COLUMNS_INVALID NTStatus = 0xC0E7000A STATUS_SPACES_NOT_ENOUGH_DRIVES NTStatus = 0xC0E7000B STATUS_SPACES_EXTENDED_ERROR NTStatus = 0xC0E7000C STATUS_SPACES_PROVISIONING_TYPE_INVALID NTStatus = 0xC0E7000D STATUS_SPACES_ALLOCATION_SIZE_INVALID NTStatus = 0xC0E7000E STATUS_SPACES_ENCLOSURE_AWARE_INVALID NTStatus = 0xC0E7000F STATUS_SPACES_WRITE_CACHE_SIZE_INVALID NTStatus = 0xC0E70010 STATUS_SPACES_NUMBER_OF_GROUPS_INVALID NTStatus = 0xC0E70011 STATUS_SPACES_DRIVE_OPERATIONAL_STATE_INVALID NTStatus = 0xC0E70012 STATUS_SPACES_UPDATE_COLUMN_STATE NTStatus = 0xC0E70013 STATUS_SPACES_MAP_REQUIRED NTStatus = 0xC0E70014 STATUS_SPACES_UNSUPPORTED_VERSION NTStatus = 0xC0E70015 STATUS_SPACES_CORRUPT_METADATA NTStatus = 0xC0E70016 STATUS_SPACES_DRT_FULL NTStatus = 0xC0E70017 STATUS_SPACES_INCONSISTENCY NTStatus = 0xC0E70018 STATUS_SPACES_LOG_NOT_READY NTStatus = 0xC0E70019 STATUS_SPACES_NO_REDUNDANCY NTStatus = 0xC0E7001A STATUS_SPACES_DRIVE_NOT_READY NTStatus = 0xC0E7001B STATUS_SPACES_DRIVE_SPLIT NTStatus = 0xC0E7001C STATUS_SPACES_DRIVE_LOST_DATA NTStatus = 0xC0E7001D STATUS_SPACES_ENTRY_INCOMPLETE NTStatus = 0xC0E7001E STATUS_SPACES_ENTRY_INVALID NTStatus = 0xC0E7001F STATUS_SPACES_MARK_DIRTY NTStatus = 0xC0E70020 STATUS_VOLSNAP_BOOTFILE_NOT_VALID NTStatus = 0xC0500003 STATUS_VOLSNAP_ACTIVATION_TIMEOUT NTStatus = 0xC0500004 STATUS_IO_PREEMPTED NTStatus = 0xC0510001 STATUS_SVHDX_ERROR_STORED NTStatus = 0xC05C0000 STATUS_SVHDX_ERROR_NOT_AVAILABLE NTStatus = 0xC05CFF00 STATUS_SVHDX_UNIT_ATTENTION_AVAILABLE NTStatus = 0xC05CFF01 STATUS_SVHDX_UNIT_ATTENTION_CAPACITY_DATA_CHANGED NTStatus = 0xC05CFF02 STATUS_SVHDX_UNIT_ATTENTION_RESERVATIONS_PREEMPTED NTStatus = 0xC05CFF03 STATUS_SVHDX_UNIT_ATTENTION_RESERVATIONS_RELEASED NTStatus = 0xC05CFF04 STATUS_SVHDX_UNIT_ATTENTION_REGISTRATIONS_PREEMPTED NTStatus = 0xC05CFF05 STATUS_SVHDX_UNIT_ATTENTION_OPERATING_DEFINITION_CHANGED NTStatus = 0xC05CFF06 STATUS_SVHDX_RESERVATION_CONFLICT NTStatus = 0xC05CFF07 STATUS_SVHDX_WRONG_FILE_TYPE NTStatus = 0xC05CFF08 STATUS_SVHDX_VERSION_MISMATCH NTStatus = 0xC05CFF09 STATUS_VHD_SHARED NTStatus = 0xC05CFF0A STATUS_SVHDX_NO_INITIATOR NTStatus = 0xC05CFF0B STATUS_VHDSET_BACKING_STORAGE_NOT_FOUND NTStatus = 0xC05CFF0C STATUS_SMB_NO_PREAUTH_INTEGRITY_HASH_OVERLAP NTStatus = 0xC05D0000 STATUS_SMB_BAD_CLUSTER_DIALECT NTStatus = 0xC05D0001 STATUS_SMB_GUEST_LOGON_BLOCKED NTStatus = 0xC05D0002 STATUS_SECCORE_INVALID_COMMAND NTStatus = 0xC0E80000 STATUS_VSM_NOT_INITIALIZED NTStatus = 0xC0450000 STATUS_VSM_DMA_PROTECTION_NOT_IN_USE NTStatus = 0xC0450001 STATUS_APPEXEC_CONDITION_NOT_SATISFIED NTStatus = 0xC0EC0000 STATUS_APPEXEC_HANDLE_INVALIDATED NTStatus = 0xC0EC0001 STATUS_APPEXEC_INVALID_HOST_GENERATION NTStatus = 0xC0EC0002 STATUS_APPEXEC_UNEXPECTED_PROCESS_REGISTRATION NTStatus = 0xC0EC0003 STATUS_APPEXEC_INVALID_HOST_STATE NTStatus = 0xC0EC0004 STATUS_APPEXEC_NO_DONOR NTStatus = 0xC0EC0005 STATUS_APPEXEC_HOST_ID_MISMATCH NTStatus = 0xC0EC0006 STATUS_APPEXEC_UNKNOWN_USER NTStatus = 0xC0EC0007 ) ================================================ FILE: vendor/golang.org/x/sys/windows/zknownfolderids_windows.go ================================================ // Code generated by 'mkknownfolderids.bash'; DO NOT EDIT. package windows type KNOWNFOLDERID GUID var ( FOLDERID_NetworkFolder = &KNOWNFOLDERID{0xd20beec4, 0x5ca8, 0x4905, [8]byte{0xae, 0x3b, 0xbf, 0x25, 0x1e, 0xa0, 0x9b, 0x53}} FOLDERID_ComputerFolder = &KNOWNFOLDERID{0x0ac0837c, 0xbbf8, 0x452a, [8]byte{0x85, 0x0d, 0x79, 0xd0, 0x8e, 0x66, 0x7c, 0xa7}} FOLDERID_InternetFolder = &KNOWNFOLDERID{0x4d9f7874, 0x4e0c, 0x4904, [8]byte{0x96, 0x7b, 0x40, 0xb0, 0xd2, 0x0c, 0x3e, 0x4b}} FOLDERID_ControlPanelFolder = &KNOWNFOLDERID{0x82a74aeb, 0xaeb4, 0x465c, [8]byte{0xa0, 0x14, 0xd0, 0x97, 0xee, 0x34, 0x6d, 0x63}} FOLDERID_PrintersFolder = &KNOWNFOLDERID{0x76fc4e2d, 0xd6ad, 0x4519, [8]byte{0xa6, 0x63, 0x37, 0xbd, 0x56, 0x06, 0x81, 0x85}} FOLDERID_SyncManagerFolder = &KNOWNFOLDERID{0x43668bf8, 0xc14e, 0x49b2, [8]byte{0x97, 0xc9, 0x74, 0x77, 0x84, 0xd7, 0x84, 0xb7}} FOLDERID_SyncSetupFolder = &KNOWNFOLDERID{0x0f214138, 0xb1d3, 0x4a90, [8]byte{0xbb, 0xa9, 0x27, 0xcb, 0xc0, 0xc5, 0x38, 0x9a}} FOLDERID_ConflictFolder = &KNOWNFOLDERID{0x4bfefb45, 0x347d, 0x4006, [8]byte{0xa5, 0xbe, 0xac, 0x0c, 0xb0, 0x56, 0x71, 0x92}} FOLDERID_SyncResultsFolder = &KNOWNFOLDERID{0x289a9a43, 0xbe44, 0x4057, [8]byte{0xa4, 0x1b, 0x58, 0x7a, 0x76, 0xd7, 0xe7, 0xf9}} FOLDERID_RecycleBinFolder = &KNOWNFOLDERID{0xb7534046, 0x3ecb, 0x4c18, [8]byte{0xbe, 0x4e, 0x64, 0xcd, 0x4c, 0xb7, 0xd6, 0xac}} FOLDERID_ConnectionsFolder = &KNOWNFOLDERID{0x6f0cd92b, 0x2e97, 0x45d1, [8]byte{0x88, 0xff, 0xb0, 0xd1, 0x86, 0xb8, 0xde, 0xdd}} FOLDERID_Fonts = &KNOWNFOLDERID{0xfd228cb7, 0xae11, 0x4ae3, [8]byte{0x86, 0x4c, 0x16, 0xf3, 0x91, 0x0a, 0xb8, 0xfe}} FOLDERID_Desktop = &KNOWNFOLDERID{0xb4bfcc3a, 0xdb2c, 0x424c, [8]byte{0xb0, 0x29, 0x7f, 0xe9, 0x9a, 0x87, 0xc6, 0x41}} FOLDERID_Startup = &KNOWNFOLDERID{0xb97d20bb, 0xf46a, 0x4c97, [8]byte{0xba, 0x10, 0x5e, 0x36, 0x08, 0x43, 0x08, 0x54}} FOLDERID_Programs = &KNOWNFOLDERID{0xa77f5d77, 0x2e2b, 0x44c3, [8]byte{0xa6, 0xa2, 0xab, 0xa6, 0x01, 0x05, 0x4a, 0x51}} FOLDERID_StartMenu = &KNOWNFOLDERID{0x625b53c3, 0xab48, 0x4ec1, [8]byte{0xba, 0x1f, 0xa1, 0xef, 0x41, 0x46, 0xfc, 0x19}} FOLDERID_Recent = &KNOWNFOLDERID{0xae50c081, 0xebd2, 0x438a, [8]byte{0x86, 0x55, 0x8a, 0x09, 0x2e, 0x34, 0x98, 0x7a}} FOLDERID_SendTo = &KNOWNFOLDERID{0x8983036c, 0x27c0, 0x404b, [8]byte{0x8f, 0x08, 0x10, 0x2d, 0x10, 0xdc, 0xfd, 0x74}} FOLDERID_Documents = &KNOWNFOLDERID{0xfdd39ad0, 0x238f, 0x46af, [8]byte{0xad, 0xb4, 0x6c, 0x85, 0x48, 0x03, 0x69, 0xc7}} FOLDERID_Favorites = &KNOWNFOLDERID{0x1777f761, 0x68ad, 0x4d8a, [8]byte{0x87, 0xbd, 0x30, 0xb7, 0x59, 0xfa, 0x33, 0xdd}} FOLDERID_NetHood = &KNOWNFOLDERID{0xc5abbf53, 0xe17f, 0x4121, [8]byte{0x89, 0x00, 0x86, 0x62, 0x6f, 0xc2, 0xc9, 0x73}} FOLDERID_PrintHood = &KNOWNFOLDERID{0x9274bd8d, 0xcfd1, 0x41c3, [8]byte{0xb3, 0x5e, 0xb1, 0x3f, 0x55, 0xa7, 0x58, 0xf4}} FOLDERID_Templates = &KNOWNFOLDERID{0xa63293e8, 0x664e, 0x48db, [8]byte{0xa0, 0x79, 0xdf, 0x75, 0x9e, 0x05, 0x09, 0xf7}} FOLDERID_CommonStartup = &KNOWNFOLDERID{0x82a5ea35, 0xd9cd, 0x47c5, [8]byte{0x96, 0x29, 0xe1, 0x5d, 0x2f, 0x71, 0x4e, 0x6e}} FOLDERID_CommonPrograms = &KNOWNFOLDERID{0x0139d44e, 0x6afe, 0x49f2, [8]byte{0x86, 0x90, 0x3d, 0xaf, 0xca, 0xe6, 0xff, 0xb8}} FOLDERID_CommonStartMenu = &KNOWNFOLDERID{0xa4115719, 0xd62e, 0x491d, [8]byte{0xaa, 0x7c, 0xe7, 0x4b, 0x8b, 0xe3, 0xb0, 0x67}} FOLDERID_PublicDesktop = &KNOWNFOLDERID{0xc4aa340d, 0xf20f, 0x4863, [8]byte{0xaf, 0xef, 0xf8, 0x7e, 0xf2, 0xe6, 0xba, 0x25}} FOLDERID_ProgramData = &KNOWNFOLDERID{0x62ab5d82, 0xfdc1, 0x4dc3, [8]byte{0xa9, 0xdd, 0x07, 0x0d, 0x1d, 0x49, 0x5d, 0x97}} FOLDERID_CommonTemplates = &KNOWNFOLDERID{0xb94237e7, 0x57ac, 0x4347, [8]byte{0x91, 0x51, 0xb0, 0x8c, 0x6c, 0x32, 0xd1, 0xf7}} FOLDERID_PublicDocuments = &KNOWNFOLDERID{0xed4824af, 0xdce4, 0x45a8, [8]byte{0x81, 0xe2, 0xfc, 0x79, 0x65, 0x08, 0x36, 0x34}} FOLDERID_RoamingAppData = &KNOWNFOLDERID{0x3eb685db, 0x65f9, 0x4cf6, [8]byte{0xa0, 0x3a, 0xe3, 0xef, 0x65, 0x72, 0x9f, 0x3d}} FOLDERID_LocalAppData = &KNOWNFOLDERID{0xf1b32785, 0x6fba, 0x4fcf, [8]byte{0x9d, 0x55, 0x7b, 0x8e, 0x7f, 0x15, 0x70, 0x91}} FOLDERID_LocalAppDataLow = &KNOWNFOLDERID{0xa520a1a4, 0x1780, 0x4ff6, [8]byte{0xbd, 0x18, 0x16, 0x73, 0x43, 0xc5, 0xaf, 0x16}} FOLDERID_InternetCache = &KNOWNFOLDERID{0x352481e8, 0x33be, 0x4251, [8]byte{0xba, 0x85, 0x60, 0x07, 0xca, 0xed, 0xcf, 0x9d}} FOLDERID_Cookies = &KNOWNFOLDERID{0x2b0f765d, 0xc0e9, 0x4171, [8]byte{0x90, 0x8e, 0x08, 0xa6, 0x11, 0xb8, 0x4f, 0xf6}} FOLDERID_History = &KNOWNFOLDERID{0xd9dc8a3b, 0xb784, 0x432e, [8]byte{0xa7, 0x81, 0x5a, 0x11, 0x30, 0xa7, 0x59, 0x63}} FOLDERID_System = &KNOWNFOLDERID{0x1ac14e77, 0x02e7, 0x4e5d, [8]byte{0xb7, 0x44, 0x2e, 0xb1, 0xae, 0x51, 0x98, 0xb7}} FOLDERID_SystemX86 = &KNOWNFOLDERID{0xd65231b0, 0xb2f1, 0x4857, [8]byte{0xa4, 0xce, 0xa8, 0xe7, 0xc6, 0xea, 0x7d, 0x27}} FOLDERID_Windows = &KNOWNFOLDERID{0xf38bf404, 0x1d43, 0x42f2, [8]byte{0x93, 0x05, 0x67, 0xde, 0x0b, 0x28, 0xfc, 0x23}} FOLDERID_Profile = &KNOWNFOLDERID{0x5e6c858f, 0x0e22, 0x4760, [8]byte{0x9a, 0xfe, 0xea, 0x33, 0x17, 0xb6, 0x71, 0x73}} FOLDERID_Pictures = &KNOWNFOLDERID{0x33e28130, 0x4e1e, 0x4676, [8]byte{0x83, 0x5a, 0x98, 0x39, 0x5c, 0x3b, 0xc3, 0xbb}} FOLDERID_ProgramFilesX86 = &KNOWNFOLDERID{0x7c5a40ef, 0xa0fb, 0x4bfc, [8]byte{0x87, 0x4a, 0xc0, 0xf2, 0xe0, 0xb9, 0xfa, 0x8e}} FOLDERID_ProgramFilesCommonX86 = &KNOWNFOLDERID{0xde974d24, 0xd9c6, 0x4d3e, [8]byte{0xbf, 0x91, 0xf4, 0x45, 0x51, 0x20, 0xb9, 0x17}} FOLDERID_ProgramFilesX64 = &KNOWNFOLDERID{0x6d809377, 0x6af0, 0x444b, [8]byte{0x89, 0x57, 0xa3, 0x77, 0x3f, 0x02, 0x20, 0x0e}} FOLDERID_ProgramFilesCommonX64 = &KNOWNFOLDERID{0x6365d5a7, 0x0f0d, 0x45e5, [8]byte{0x87, 0xf6, 0x0d, 0xa5, 0x6b, 0x6a, 0x4f, 0x7d}} FOLDERID_ProgramFiles = &KNOWNFOLDERID{0x905e63b6, 0xc1bf, 0x494e, [8]byte{0xb2, 0x9c, 0x65, 0xb7, 0x32, 0xd3, 0xd2, 0x1a}} FOLDERID_ProgramFilesCommon = &KNOWNFOLDERID{0xf7f1ed05, 0x9f6d, 0x47a2, [8]byte{0xaa, 0xae, 0x29, 0xd3, 0x17, 0xc6, 0xf0, 0x66}} FOLDERID_UserProgramFiles = &KNOWNFOLDERID{0x5cd7aee2, 0x2219, 0x4a67, [8]byte{0xb8, 0x5d, 0x6c, 0x9c, 0xe1, 0x56, 0x60, 0xcb}} FOLDERID_UserProgramFilesCommon = &KNOWNFOLDERID{0xbcbd3057, 0xca5c, 0x4622, [8]byte{0xb4, 0x2d, 0xbc, 0x56, 0xdb, 0x0a, 0xe5, 0x16}} FOLDERID_AdminTools = &KNOWNFOLDERID{0x724ef170, 0xa42d, 0x4fef, [8]byte{0x9f, 0x26, 0xb6, 0x0e, 0x84, 0x6f, 0xba, 0x4f}} FOLDERID_CommonAdminTools = &KNOWNFOLDERID{0xd0384e7d, 0xbac3, 0x4797, [8]byte{0x8f, 0x14, 0xcb, 0xa2, 0x29, 0xb3, 0x92, 0xb5}} FOLDERID_Music = &KNOWNFOLDERID{0x4bd8d571, 0x6d19, 0x48d3, [8]byte{0xbe, 0x97, 0x42, 0x22, 0x20, 0x08, 0x0e, 0x43}} FOLDERID_Videos = &KNOWNFOLDERID{0x18989b1d, 0x99b5, 0x455b, [8]byte{0x84, 0x1c, 0xab, 0x7c, 0x74, 0xe4, 0xdd, 0xfc}} FOLDERID_Ringtones = &KNOWNFOLDERID{0xc870044b, 0xf49e, 0x4126, [8]byte{0xa9, 0xc3, 0xb5, 0x2a, 0x1f, 0xf4, 0x11, 0xe8}} FOLDERID_PublicPictures = &KNOWNFOLDERID{0xb6ebfb86, 0x6907, 0x413c, [8]byte{0x9a, 0xf7, 0x4f, 0xc2, 0xab, 0xf0, 0x7c, 0xc5}} FOLDERID_PublicMusic = &KNOWNFOLDERID{0x3214fab5, 0x9757, 0x4298, [8]byte{0xbb, 0x61, 0x92, 0xa9, 0xde, 0xaa, 0x44, 0xff}} FOLDERID_PublicVideos = &KNOWNFOLDERID{0x2400183a, 0x6185, 0x49fb, [8]byte{0xa2, 0xd8, 0x4a, 0x39, 0x2a, 0x60, 0x2b, 0xa3}} FOLDERID_PublicRingtones = &KNOWNFOLDERID{0xe555ab60, 0x153b, 0x4d17, [8]byte{0x9f, 0x04, 0xa5, 0xfe, 0x99, 0xfc, 0x15, 0xec}} FOLDERID_ResourceDir = &KNOWNFOLDERID{0x8ad10c31, 0x2adb, 0x4296, [8]byte{0xa8, 0xf7, 0xe4, 0x70, 0x12, 0x32, 0xc9, 0x72}} FOLDERID_LocalizedResourcesDir = &KNOWNFOLDERID{0x2a00375e, 0x224c, 0x49de, [8]byte{0xb8, 0xd1, 0x44, 0x0d, 0xf7, 0xef, 0x3d, 0xdc}} FOLDERID_CommonOEMLinks = &KNOWNFOLDERID{0xc1bae2d0, 0x10df, 0x4334, [8]byte{0xbe, 0xdd, 0x7a, 0xa2, 0x0b, 0x22, 0x7a, 0x9d}} FOLDERID_CDBurning = &KNOWNFOLDERID{0x9e52ab10, 0xf80d, 0x49df, [8]byte{0xac, 0xb8, 0x43, 0x30, 0xf5, 0x68, 0x78, 0x55}} FOLDERID_UserProfiles = &KNOWNFOLDERID{0x0762d272, 0xc50a, 0x4bb0, [8]byte{0xa3, 0x82, 0x69, 0x7d, 0xcd, 0x72, 0x9b, 0x80}} FOLDERID_Playlists = &KNOWNFOLDERID{0xde92c1c7, 0x837f, 0x4f69, [8]byte{0xa3, 0xbb, 0x86, 0xe6, 0x31, 0x20, 0x4a, 0x23}} FOLDERID_SamplePlaylists = &KNOWNFOLDERID{0x15ca69b3, 0x30ee, 0x49c1, [8]byte{0xac, 0xe1, 0x6b, 0x5e, 0xc3, 0x72, 0xaf, 0xb5}} FOLDERID_SampleMusic = &KNOWNFOLDERID{0xb250c668, 0xf57d, 0x4ee1, [8]byte{0xa6, 0x3c, 0x29, 0x0e, 0xe7, 0xd1, 0xaa, 0x1f}} FOLDERID_SamplePictures = &KNOWNFOLDERID{0xc4900540, 0x2379, 0x4c75, [8]byte{0x84, 0x4b, 0x64, 0xe6, 0xfa, 0xf8, 0x71, 0x6b}} FOLDERID_SampleVideos = &KNOWNFOLDERID{0x859ead94, 0x2e85, 0x48ad, [8]byte{0xa7, 0x1a, 0x09, 0x69, 0xcb, 0x56, 0xa6, 0xcd}} FOLDERID_PhotoAlbums = &KNOWNFOLDERID{0x69d2cf90, 0xfc33, 0x4fb7, [8]byte{0x9a, 0x0c, 0xeb, 0xb0, 0xf0, 0xfc, 0xb4, 0x3c}} FOLDERID_Public = &KNOWNFOLDERID{0xdfdf76a2, 0xc82a, 0x4d63, [8]byte{0x90, 0x6a, 0x56, 0x44, 0xac, 0x45, 0x73, 0x85}} FOLDERID_ChangeRemovePrograms = &KNOWNFOLDERID{0xdf7266ac, 0x9274, 0x4867, [8]byte{0x8d, 0x55, 0x3b, 0xd6, 0x61, 0xde, 0x87, 0x2d}} FOLDERID_AppUpdates = &KNOWNFOLDERID{0xa305ce99, 0xf527, 0x492b, [8]byte{0x8b, 0x1a, 0x7e, 0x76, 0xfa, 0x98, 0xd6, 0xe4}} FOLDERID_AddNewPrograms = &KNOWNFOLDERID{0xde61d971, 0x5ebc, 0x4f02, [8]byte{0xa3, 0xa9, 0x6c, 0x82, 0x89, 0x5e, 0x5c, 0x04}} FOLDERID_Downloads = &KNOWNFOLDERID{0x374de290, 0x123f, 0x4565, [8]byte{0x91, 0x64, 0x39, 0xc4, 0x92, 0x5e, 0x46, 0x7b}} FOLDERID_PublicDownloads = &KNOWNFOLDERID{0x3d644c9b, 0x1fb8, 0x4f30, [8]byte{0x9b, 0x45, 0xf6, 0x70, 0x23, 0x5f, 0x79, 0xc0}} FOLDERID_SavedSearches = &KNOWNFOLDERID{0x7d1d3a04, 0xdebb, 0x4115, [8]byte{0x95, 0xcf, 0x2f, 0x29, 0xda, 0x29, 0x20, 0xda}} FOLDERID_QuickLaunch = &KNOWNFOLDERID{0x52a4f021, 0x7b75, 0x48a9, [8]byte{0x9f, 0x6b, 0x4b, 0x87, 0xa2, 0x10, 0xbc, 0x8f}} FOLDERID_Contacts = &KNOWNFOLDERID{0x56784854, 0xc6cb, 0x462b, [8]byte{0x81, 0x69, 0x88, 0xe3, 0x50, 0xac, 0xb8, 0x82}} FOLDERID_SidebarParts = &KNOWNFOLDERID{0xa75d362e, 0x50fc, 0x4fb7, [8]byte{0xac, 0x2c, 0xa8, 0xbe, 0xaa, 0x31, 0x44, 0x93}} FOLDERID_SidebarDefaultParts = &KNOWNFOLDERID{0x7b396e54, 0x9ec5, 0x4300, [8]byte{0xbe, 0x0a, 0x24, 0x82, 0xeb, 0xae, 0x1a, 0x26}} FOLDERID_PublicGameTasks = &KNOWNFOLDERID{0xdebf2536, 0xe1a8, 0x4c59, [8]byte{0xb6, 0xa2, 0x41, 0x45, 0x86, 0x47, 0x6a, 0xea}} FOLDERID_GameTasks = &KNOWNFOLDERID{0x054fae61, 0x4dd8, 0x4787, [8]byte{0x80, 0xb6, 0x09, 0x02, 0x20, 0xc4, 0xb7, 0x00}} FOLDERID_SavedGames = &KNOWNFOLDERID{0x4c5c32ff, 0xbb9d, 0x43b0, [8]byte{0xb5, 0xb4, 0x2d, 0x72, 0xe5, 0x4e, 0xaa, 0xa4}} FOLDERID_Games = &KNOWNFOLDERID{0xcac52c1a, 0xb53d, 0x4edc, [8]byte{0x92, 0xd7, 0x6b, 0x2e, 0x8a, 0xc1, 0x94, 0x34}} FOLDERID_SEARCH_MAPI = &KNOWNFOLDERID{0x98ec0e18, 0x2098, 0x4d44, [8]byte{0x86, 0x44, 0x66, 0x97, 0x93, 0x15, 0xa2, 0x81}} FOLDERID_SEARCH_CSC = &KNOWNFOLDERID{0xee32e446, 0x31ca, 0x4aba, [8]byte{0x81, 0x4f, 0xa5, 0xeb, 0xd2, 0xfd, 0x6d, 0x5e}} FOLDERID_Links = &KNOWNFOLDERID{0xbfb9d5e0, 0xc6a9, 0x404c, [8]byte{0xb2, 0xb2, 0xae, 0x6d, 0xb6, 0xaf, 0x49, 0x68}} FOLDERID_UsersFiles = &KNOWNFOLDERID{0xf3ce0f7c, 0x4901, 0x4acc, [8]byte{0x86, 0x48, 0xd5, 0xd4, 0x4b, 0x04, 0xef, 0x8f}} FOLDERID_UsersLibraries = &KNOWNFOLDERID{0xa302545d, 0xdeff, 0x464b, [8]byte{0xab, 0xe8, 0x61, 0xc8, 0x64, 0x8d, 0x93, 0x9b}} FOLDERID_SearchHome = &KNOWNFOLDERID{0x190337d1, 0xb8ca, 0x4121, [8]byte{0xa6, 0x39, 0x6d, 0x47, 0x2d, 0x16, 0x97, 0x2a}} FOLDERID_OriginalImages = &KNOWNFOLDERID{0x2c36c0aa, 0x5812, 0x4b87, [8]byte{0xbf, 0xd0, 0x4c, 0xd0, 0xdf, 0xb1, 0x9b, 0x39}} FOLDERID_DocumentsLibrary = &KNOWNFOLDERID{0x7b0db17d, 0x9cd2, 0x4a93, [8]byte{0x97, 0x33, 0x46, 0xcc, 0x89, 0x02, 0x2e, 0x7c}} FOLDERID_MusicLibrary = &KNOWNFOLDERID{0x2112ab0a, 0xc86a, 0x4ffe, [8]byte{0xa3, 0x68, 0x0d, 0xe9, 0x6e, 0x47, 0x01, 0x2e}} FOLDERID_PicturesLibrary = &KNOWNFOLDERID{0xa990ae9f, 0xa03b, 0x4e80, [8]byte{0x94, 0xbc, 0x99, 0x12, 0xd7, 0x50, 0x41, 0x04}} FOLDERID_VideosLibrary = &KNOWNFOLDERID{0x491e922f, 0x5643, 0x4af4, [8]byte{0xa7, 0xeb, 0x4e, 0x7a, 0x13, 0x8d, 0x81, 0x74}} FOLDERID_RecordedTVLibrary = &KNOWNFOLDERID{0x1a6fdba2, 0xf42d, 0x4358, [8]byte{0xa7, 0x98, 0xb7, 0x4d, 0x74, 0x59, 0x26, 0xc5}} FOLDERID_HomeGroup = &KNOWNFOLDERID{0x52528a6b, 0xb9e3, 0x4add, [8]byte{0xb6, 0x0d, 0x58, 0x8c, 0x2d, 0xba, 0x84, 0x2d}} FOLDERID_HomeGroupCurrentUser = &KNOWNFOLDERID{0x9b74b6a3, 0x0dfd, 0x4f11, [8]byte{0x9e, 0x78, 0x5f, 0x78, 0x00, 0xf2, 0xe7, 0x72}} FOLDERID_DeviceMetadataStore = &KNOWNFOLDERID{0x5ce4a5e9, 0xe4eb, 0x479d, [8]byte{0xb8, 0x9f, 0x13, 0x0c, 0x02, 0x88, 0x61, 0x55}} FOLDERID_Libraries = &KNOWNFOLDERID{0x1b3ea5dc, 0xb587, 0x4786, [8]byte{0xb4, 0xef, 0xbd, 0x1d, 0xc3, 0x32, 0xae, 0xae}} FOLDERID_PublicLibraries = &KNOWNFOLDERID{0x48daf80b, 0xe6cf, 0x4f4e, [8]byte{0xb8, 0x00, 0x0e, 0x69, 0xd8, 0x4e, 0xe3, 0x84}} FOLDERID_UserPinned = &KNOWNFOLDERID{0x9e3995ab, 0x1f9c, 0x4f13, [8]byte{0xb8, 0x27, 0x48, 0xb2, 0x4b, 0x6c, 0x71, 0x74}} FOLDERID_ImplicitAppShortcuts = &KNOWNFOLDERID{0xbcb5256f, 0x79f6, 0x4cee, [8]byte{0xb7, 0x25, 0xdc, 0x34, 0xe4, 0x02, 0xfd, 0x46}} FOLDERID_AccountPictures = &KNOWNFOLDERID{0x008ca0b1, 0x55b4, 0x4c56, [8]byte{0xb8, 0xa8, 0x4d, 0xe4, 0xb2, 0x99, 0xd3, 0xbe}} FOLDERID_PublicUserTiles = &KNOWNFOLDERID{0x0482af6c, 0x08f1, 0x4c34, [8]byte{0x8c, 0x90, 0xe1, 0x7e, 0xc9, 0x8b, 0x1e, 0x17}} FOLDERID_AppsFolder = &KNOWNFOLDERID{0x1e87508d, 0x89c2, 0x42f0, [8]byte{0x8a, 0x7e, 0x64, 0x5a, 0x0f, 0x50, 0xca, 0x58}} FOLDERID_StartMenuAllPrograms = &KNOWNFOLDERID{0xf26305ef, 0x6948, 0x40b9, [8]byte{0xb2, 0x55, 0x81, 0x45, 0x3d, 0x09, 0xc7, 0x85}} FOLDERID_CommonStartMenuPlaces = &KNOWNFOLDERID{0xa440879f, 0x87a0, 0x4f7d, [8]byte{0xb7, 0x00, 0x02, 0x07, 0xb9, 0x66, 0x19, 0x4a}} FOLDERID_ApplicationShortcuts = &KNOWNFOLDERID{0xa3918781, 0xe5f2, 0x4890, [8]byte{0xb3, 0xd9, 0xa7, 0xe5, 0x43, 0x32, 0x32, 0x8c}} FOLDERID_RoamingTiles = &KNOWNFOLDERID{0x00bcfc5a, 0xed94, 0x4e48, [8]byte{0x96, 0xa1, 0x3f, 0x62, 0x17, 0xf2, 0x19, 0x90}} FOLDERID_RoamedTileImages = &KNOWNFOLDERID{0xaaa8d5a5, 0xf1d6, 0x4259, [8]byte{0xba, 0xa8, 0x78, 0xe7, 0xef, 0x60, 0x83, 0x5e}} FOLDERID_Screenshots = &KNOWNFOLDERID{0xb7bede81, 0xdf94, 0x4682, [8]byte{0xa7, 0xd8, 0x57, 0xa5, 0x26, 0x20, 0xb8, 0x6f}} FOLDERID_CameraRoll = &KNOWNFOLDERID{0xab5fb87b, 0x7ce2, 0x4f83, [8]byte{0x91, 0x5d, 0x55, 0x08, 0x46, 0xc9, 0x53, 0x7b}} FOLDERID_SkyDrive = &KNOWNFOLDERID{0xa52bba46, 0xe9e1, 0x435f, [8]byte{0xb3, 0xd9, 0x28, 0xda, 0xa6, 0x48, 0xc0, 0xf6}} FOLDERID_OneDrive = &KNOWNFOLDERID{0xa52bba46, 0xe9e1, 0x435f, [8]byte{0xb3, 0xd9, 0x28, 0xda, 0xa6, 0x48, 0xc0, 0xf6}} FOLDERID_SkyDriveDocuments = &KNOWNFOLDERID{0x24d89e24, 0x2f19, 0x4534, [8]byte{0x9d, 0xde, 0x6a, 0x66, 0x71, 0xfb, 0xb8, 0xfe}} FOLDERID_SkyDrivePictures = &KNOWNFOLDERID{0x339719b5, 0x8c47, 0x4894, [8]byte{0x94, 0xc2, 0xd8, 0xf7, 0x7a, 0xdd, 0x44, 0xa6}} FOLDERID_SkyDriveMusic = &KNOWNFOLDERID{0xc3f2459e, 0x80d6, 0x45dc, [8]byte{0xbf, 0xef, 0x1f, 0x76, 0x9f, 0x2b, 0xe7, 0x30}} FOLDERID_SkyDriveCameraRoll = &KNOWNFOLDERID{0x767e6811, 0x49cb, 0x4273, [8]byte{0x87, 0xc2, 0x20, 0xf3, 0x55, 0xe1, 0x08, 0x5b}} FOLDERID_SearchHistory = &KNOWNFOLDERID{0x0d4c3db6, 0x03a3, 0x462f, [8]byte{0xa0, 0xe6, 0x08, 0x92, 0x4c, 0x41, 0xb5, 0xd4}} FOLDERID_SearchTemplates = &KNOWNFOLDERID{0x7e636bfe, 0xdfa9, 0x4d5e, [8]byte{0xb4, 0x56, 0xd7, 0xb3, 0x98, 0x51, 0xd8, 0xa9}} FOLDERID_CameraRollLibrary = &KNOWNFOLDERID{0x2b20df75, 0x1eda, 0x4039, [8]byte{0x80, 0x97, 0x38, 0x79, 0x82, 0x27, 0xd5, 0xb7}} FOLDERID_SavedPictures = &KNOWNFOLDERID{0x3b193882, 0xd3ad, 0x4eab, [8]byte{0x96, 0x5a, 0x69, 0x82, 0x9d, 0x1f, 0xb5, 0x9f}} FOLDERID_SavedPicturesLibrary = &KNOWNFOLDERID{0xe25b5812, 0xbe88, 0x4bd9, [8]byte{0x94, 0xb0, 0x29, 0x23, 0x34, 0x77, 0xb6, 0xc3}} FOLDERID_RetailDemo = &KNOWNFOLDERID{0x12d4c69e, 0x24ad, 0x4923, [8]byte{0xbe, 0x19, 0x31, 0x32, 0x1c, 0x43, 0xa7, 0x67}} FOLDERID_Device = &KNOWNFOLDERID{0x1c2ac1dc, 0x4358, 0x4b6c, [8]byte{0x97, 0x33, 0xaf, 0x21, 0x15, 0x65, 0x76, 0xf0}} FOLDERID_DevelopmentFiles = &KNOWNFOLDERID{0xdbe8e08e, 0x3053, 0x4bbc, [8]byte{0xb1, 0x83, 0x2a, 0x7b, 0x2b, 0x19, 0x1e, 0x59}} FOLDERID_Objects3D = &KNOWNFOLDERID{0x31c0dd25, 0x9439, 0x4f12, [8]byte{0xbf, 0x41, 0x7f, 0xf4, 0xed, 0xa3, 0x87, 0x22}} FOLDERID_AppCaptures = &KNOWNFOLDERID{0xedc0fe71, 0x98d8, 0x4f4a, [8]byte{0xb9, 0x20, 0xc8, 0xdc, 0x13, 0x3c, 0xb1, 0x65}} FOLDERID_LocalDocuments = &KNOWNFOLDERID{0xf42ee2d3, 0x909f, 0x4907, [8]byte{0x88, 0x71, 0x4c, 0x22, 0xfc, 0x0b, 0xf7, 0x56}} FOLDERID_LocalPictures = &KNOWNFOLDERID{0x0ddd015d, 0xb06c, 0x45d5, [8]byte{0x8c, 0x4c, 0xf5, 0x97, 0x13, 0x85, 0x46, 0x39}} FOLDERID_LocalVideos = &KNOWNFOLDERID{0x35286a68, 0x3c57, 0x41a1, [8]byte{0xbb, 0xb1, 0x0e, 0xae, 0x73, 0xd7, 0x6c, 0x95}} FOLDERID_LocalMusic = &KNOWNFOLDERID{0xa0c69a99, 0x21c8, 0x4671, [8]byte{0x87, 0x03, 0x79, 0x34, 0x16, 0x2f, 0xcf, 0x1d}} FOLDERID_LocalDownloads = &KNOWNFOLDERID{0x7d83ee9b, 0x2244, 0x4e70, [8]byte{0xb1, 0xf5, 0x53, 0x93, 0x04, 0x2a, 0xf1, 0xe4}} FOLDERID_RecordedCalls = &KNOWNFOLDERID{0x2f8b40c2, 0x83ed, 0x48ee, [8]byte{0xb3, 0x83, 0xa1, 0xf1, 0x57, 0xec, 0x6f, 0x9a}} FOLDERID_AllAppMods = &KNOWNFOLDERID{0x7ad67899, 0x66af, 0x43ba, [8]byte{0x91, 0x56, 0x6a, 0xad, 0x42, 0xe6, 0xc5, 0x96}} FOLDERID_CurrentAppMods = &KNOWNFOLDERID{0x3db40b20, 0x2a30, 0x4dbe, [8]byte{0x91, 0x7e, 0x77, 0x1d, 0xd2, 0x1d, 0xd0, 0x99}} FOLDERID_AppDataDesktop = &KNOWNFOLDERID{0xb2c5e279, 0x7add, 0x439f, [8]byte{0xb2, 0x8c, 0xc4, 0x1f, 0xe1, 0xbb, 0xf6, 0x72}} FOLDERID_AppDataDocuments = &KNOWNFOLDERID{0x7be16610, 0x1f7f, 0x44ac, [8]byte{0xbf, 0xf0, 0x83, 0xe1, 0x5f, 0x2f, 0xfc, 0xa1}} FOLDERID_AppDataFavorites = &KNOWNFOLDERID{0x7cfbefbc, 0xde1f, 0x45aa, [8]byte{0xb8, 0x43, 0xa5, 0x42, 0xac, 0x53, 0x6c, 0xc9}} FOLDERID_AppDataProgramData = &KNOWNFOLDERID{0x559d40a3, 0xa036, 0x40fa, [8]byte{0xaf, 0x61, 0x84, 0xcb, 0x43, 0x0a, 0x4d, 0x34}} ) ================================================ FILE: vendor/golang.org/x/sys/windows/zsyscall_windows.go ================================================ // Code generated by 'go generate'; DO NOT EDIT. package windows import ( "syscall" "unsafe" ) var _ unsafe.Pointer // Do the interface allocations only once for common // Errno values. const ( errnoERROR_IO_PENDING = 997 ) var ( errERROR_IO_PENDING error = syscall.Errno(errnoERROR_IO_PENDING) errERROR_EINVAL error = syscall.EINVAL ) // errnoErr returns common boxed Errno values, to prevent // allocations at runtime. func errnoErr(e syscall.Errno) error { switch e { case 0: return errERROR_EINVAL case errnoERROR_IO_PENDING: return errERROR_IO_PENDING } // TODO: add more here, after collecting data on the common // error values see on Windows. (perhaps when running // all.bat?) return e } var ( modCfgMgr32 = NewLazySystemDLL("CfgMgr32.dll") modadvapi32 = NewLazySystemDLL("advapi32.dll") modcrypt32 = NewLazySystemDLL("crypt32.dll") moddnsapi = NewLazySystemDLL("dnsapi.dll") moddwmapi = NewLazySystemDLL("dwmapi.dll") modiphlpapi = NewLazySystemDLL("iphlpapi.dll") modkernel32 = NewLazySystemDLL("kernel32.dll") modmswsock = NewLazySystemDLL("mswsock.dll") modnetapi32 = NewLazySystemDLL("netapi32.dll") modntdll = NewLazySystemDLL("ntdll.dll") modole32 = NewLazySystemDLL("ole32.dll") modpsapi = NewLazySystemDLL("psapi.dll") modsechost = NewLazySystemDLL("sechost.dll") modsecur32 = NewLazySystemDLL("secur32.dll") modsetupapi = NewLazySystemDLL("setupapi.dll") modshell32 = NewLazySystemDLL("shell32.dll") moduser32 = NewLazySystemDLL("user32.dll") moduserenv = NewLazySystemDLL("userenv.dll") modversion = NewLazySystemDLL("version.dll") modwinmm = NewLazySystemDLL("winmm.dll") modwintrust = NewLazySystemDLL("wintrust.dll") modws2_32 = NewLazySystemDLL("ws2_32.dll") modwtsapi32 = NewLazySystemDLL("wtsapi32.dll") procCM_Get_DevNode_Status = modCfgMgr32.NewProc("CM_Get_DevNode_Status") procCM_Get_Device_Interface_ListW = modCfgMgr32.NewProc("CM_Get_Device_Interface_ListW") procCM_Get_Device_Interface_List_SizeW = modCfgMgr32.NewProc("CM_Get_Device_Interface_List_SizeW") procCM_MapCrToWin32Err = modCfgMgr32.NewProc("CM_MapCrToWin32Err") procAdjustTokenGroups = modadvapi32.NewProc("AdjustTokenGroups") procAdjustTokenPrivileges = modadvapi32.NewProc("AdjustTokenPrivileges") procAllocateAndInitializeSid = modadvapi32.NewProc("AllocateAndInitializeSid") procBuildSecurityDescriptorW = modadvapi32.NewProc("BuildSecurityDescriptorW") procChangeServiceConfig2W = modadvapi32.NewProc("ChangeServiceConfig2W") procChangeServiceConfigW = modadvapi32.NewProc("ChangeServiceConfigW") procCheckTokenMembership = modadvapi32.NewProc("CheckTokenMembership") procCloseServiceHandle = modadvapi32.NewProc("CloseServiceHandle") procControlService = modadvapi32.NewProc("ControlService") procConvertSecurityDescriptorToStringSecurityDescriptorW = modadvapi32.NewProc("ConvertSecurityDescriptorToStringSecurityDescriptorW") procConvertSidToStringSidW = modadvapi32.NewProc("ConvertSidToStringSidW") procConvertStringSecurityDescriptorToSecurityDescriptorW = modadvapi32.NewProc("ConvertStringSecurityDescriptorToSecurityDescriptorW") procConvertStringSidToSidW = modadvapi32.NewProc("ConvertStringSidToSidW") procCopySid = modadvapi32.NewProc("CopySid") procCreateProcessAsUserW = modadvapi32.NewProc("CreateProcessAsUserW") procCreateServiceW = modadvapi32.NewProc("CreateServiceW") procCreateWellKnownSid = modadvapi32.NewProc("CreateWellKnownSid") procCryptAcquireContextW = modadvapi32.NewProc("CryptAcquireContextW") procCryptGenRandom = modadvapi32.NewProc("CryptGenRandom") procCryptReleaseContext = modadvapi32.NewProc("CryptReleaseContext") procDeleteService = modadvapi32.NewProc("DeleteService") procDeregisterEventSource = modadvapi32.NewProc("DeregisterEventSource") procDuplicateTokenEx = modadvapi32.NewProc("DuplicateTokenEx") procEnumDependentServicesW = modadvapi32.NewProc("EnumDependentServicesW") procEnumServicesStatusExW = modadvapi32.NewProc("EnumServicesStatusExW") procEqualSid = modadvapi32.NewProc("EqualSid") procFreeSid = modadvapi32.NewProc("FreeSid") procGetAce = modadvapi32.NewProc("GetAce") procGetLengthSid = modadvapi32.NewProc("GetLengthSid") procGetNamedSecurityInfoW = modadvapi32.NewProc("GetNamedSecurityInfoW") procGetSecurityDescriptorControl = modadvapi32.NewProc("GetSecurityDescriptorControl") procGetSecurityDescriptorDacl = modadvapi32.NewProc("GetSecurityDescriptorDacl") procGetSecurityDescriptorGroup = modadvapi32.NewProc("GetSecurityDescriptorGroup") procGetSecurityDescriptorLength = modadvapi32.NewProc("GetSecurityDescriptorLength") procGetSecurityDescriptorOwner = modadvapi32.NewProc("GetSecurityDescriptorOwner") procGetSecurityDescriptorRMControl = modadvapi32.NewProc("GetSecurityDescriptorRMControl") procGetSecurityDescriptorSacl = modadvapi32.NewProc("GetSecurityDescriptorSacl") procGetSecurityInfo = modadvapi32.NewProc("GetSecurityInfo") procGetSidIdentifierAuthority = modadvapi32.NewProc("GetSidIdentifierAuthority") procGetSidSubAuthority = modadvapi32.NewProc("GetSidSubAuthority") procGetSidSubAuthorityCount = modadvapi32.NewProc("GetSidSubAuthorityCount") procGetTokenInformation = modadvapi32.NewProc("GetTokenInformation") procImpersonateSelf = modadvapi32.NewProc("ImpersonateSelf") procInitializeSecurityDescriptor = modadvapi32.NewProc("InitializeSecurityDescriptor") procInitiateSystemShutdownExW = modadvapi32.NewProc("InitiateSystemShutdownExW") procIsTokenRestricted = modadvapi32.NewProc("IsTokenRestricted") procIsValidSecurityDescriptor = modadvapi32.NewProc("IsValidSecurityDescriptor") procIsValidSid = modadvapi32.NewProc("IsValidSid") procIsWellKnownSid = modadvapi32.NewProc("IsWellKnownSid") procLookupAccountNameW = modadvapi32.NewProc("LookupAccountNameW") procLookupAccountSidW = modadvapi32.NewProc("LookupAccountSidW") procLookupPrivilegeValueW = modadvapi32.NewProc("LookupPrivilegeValueW") procMakeAbsoluteSD = modadvapi32.NewProc("MakeAbsoluteSD") procMakeSelfRelativeSD = modadvapi32.NewProc("MakeSelfRelativeSD") procNotifyServiceStatusChangeW = modadvapi32.NewProc("NotifyServiceStatusChangeW") procOpenProcessToken = modadvapi32.NewProc("OpenProcessToken") procOpenSCManagerW = modadvapi32.NewProc("OpenSCManagerW") procOpenServiceW = modadvapi32.NewProc("OpenServiceW") procOpenThreadToken = modadvapi32.NewProc("OpenThreadToken") procQueryServiceConfig2W = modadvapi32.NewProc("QueryServiceConfig2W") procQueryServiceConfigW = modadvapi32.NewProc("QueryServiceConfigW") procQueryServiceDynamicInformation = modadvapi32.NewProc("QueryServiceDynamicInformation") procQueryServiceLockStatusW = modadvapi32.NewProc("QueryServiceLockStatusW") procQueryServiceStatus = modadvapi32.NewProc("QueryServiceStatus") procQueryServiceStatusEx = modadvapi32.NewProc("QueryServiceStatusEx") procRegCloseKey = modadvapi32.NewProc("RegCloseKey") procRegEnumKeyExW = modadvapi32.NewProc("RegEnumKeyExW") procRegNotifyChangeKeyValue = modadvapi32.NewProc("RegNotifyChangeKeyValue") procRegOpenKeyExW = modadvapi32.NewProc("RegOpenKeyExW") procRegQueryInfoKeyW = modadvapi32.NewProc("RegQueryInfoKeyW") procRegQueryValueExW = modadvapi32.NewProc("RegQueryValueExW") procRegisterEventSourceW = modadvapi32.NewProc("RegisterEventSourceW") procRegisterServiceCtrlHandlerExW = modadvapi32.NewProc("RegisterServiceCtrlHandlerExW") procReportEventW = modadvapi32.NewProc("ReportEventW") procRevertToSelf = modadvapi32.NewProc("RevertToSelf") procSetEntriesInAclW = modadvapi32.NewProc("SetEntriesInAclW") procSetKernelObjectSecurity = modadvapi32.NewProc("SetKernelObjectSecurity") procSetNamedSecurityInfoW = modadvapi32.NewProc("SetNamedSecurityInfoW") procSetSecurityDescriptorControl = modadvapi32.NewProc("SetSecurityDescriptorControl") procSetSecurityDescriptorDacl = modadvapi32.NewProc("SetSecurityDescriptorDacl") procSetSecurityDescriptorGroup = modadvapi32.NewProc("SetSecurityDescriptorGroup") procSetSecurityDescriptorOwner = modadvapi32.NewProc("SetSecurityDescriptorOwner") procSetSecurityDescriptorRMControl = modadvapi32.NewProc("SetSecurityDescriptorRMControl") procSetSecurityDescriptorSacl = modadvapi32.NewProc("SetSecurityDescriptorSacl") procSetSecurityInfo = modadvapi32.NewProc("SetSecurityInfo") procSetServiceStatus = modadvapi32.NewProc("SetServiceStatus") procSetThreadToken = modadvapi32.NewProc("SetThreadToken") procSetTokenInformation = modadvapi32.NewProc("SetTokenInformation") procStartServiceCtrlDispatcherW = modadvapi32.NewProc("StartServiceCtrlDispatcherW") procStartServiceW = modadvapi32.NewProc("StartServiceW") procCertAddCertificateContextToStore = modcrypt32.NewProc("CertAddCertificateContextToStore") procCertCloseStore = modcrypt32.NewProc("CertCloseStore") procCertCreateCertificateContext = modcrypt32.NewProc("CertCreateCertificateContext") procCertDeleteCertificateFromStore = modcrypt32.NewProc("CertDeleteCertificateFromStore") procCertDuplicateCertificateContext = modcrypt32.NewProc("CertDuplicateCertificateContext") procCertEnumCertificatesInStore = modcrypt32.NewProc("CertEnumCertificatesInStore") procCertFindCertificateInStore = modcrypt32.NewProc("CertFindCertificateInStore") procCertFindChainInStore = modcrypt32.NewProc("CertFindChainInStore") procCertFindExtension = modcrypt32.NewProc("CertFindExtension") procCertFreeCertificateChain = modcrypt32.NewProc("CertFreeCertificateChain") procCertFreeCertificateContext = modcrypt32.NewProc("CertFreeCertificateContext") procCertGetCertificateChain = modcrypt32.NewProc("CertGetCertificateChain") procCertGetNameStringW = modcrypt32.NewProc("CertGetNameStringW") procCertOpenStore = modcrypt32.NewProc("CertOpenStore") procCertOpenSystemStoreW = modcrypt32.NewProc("CertOpenSystemStoreW") procCertVerifyCertificateChainPolicy = modcrypt32.NewProc("CertVerifyCertificateChainPolicy") procCryptAcquireCertificatePrivateKey = modcrypt32.NewProc("CryptAcquireCertificatePrivateKey") procCryptDecodeObject = modcrypt32.NewProc("CryptDecodeObject") procCryptProtectData = modcrypt32.NewProc("CryptProtectData") procCryptQueryObject = modcrypt32.NewProc("CryptQueryObject") procCryptUnprotectData = modcrypt32.NewProc("CryptUnprotectData") procPFXImportCertStore = modcrypt32.NewProc("PFXImportCertStore") procDnsNameCompare_W = moddnsapi.NewProc("DnsNameCompare_W") procDnsQuery_W = moddnsapi.NewProc("DnsQuery_W") procDnsRecordListFree = moddnsapi.NewProc("DnsRecordListFree") procDwmGetWindowAttribute = moddwmapi.NewProc("DwmGetWindowAttribute") procDwmSetWindowAttribute = moddwmapi.NewProc("DwmSetWindowAttribute") procCancelMibChangeNotify2 = modiphlpapi.NewProc("CancelMibChangeNotify2") procFreeMibTable = modiphlpapi.NewProc("FreeMibTable") procGetAdaptersAddresses = modiphlpapi.NewProc("GetAdaptersAddresses") procGetAdaptersInfo = modiphlpapi.NewProc("GetAdaptersInfo") procGetBestInterfaceEx = modiphlpapi.NewProc("GetBestInterfaceEx") procGetIfEntry = modiphlpapi.NewProc("GetIfEntry") procGetIfEntry2Ex = modiphlpapi.NewProc("GetIfEntry2Ex") procGetIpForwardEntry2 = modiphlpapi.NewProc("GetIpForwardEntry2") procGetIpForwardTable2 = modiphlpapi.NewProc("GetIpForwardTable2") procGetUnicastIpAddressEntry = modiphlpapi.NewProc("GetUnicastIpAddressEntry") procNotifyIpInterfaceChange = modiphlpapi.NewProc("NotifyIpInterfaceChange") procNotifyRouteChange2 = modiphlpapi.NewProc("NotifyRouteChange2") procNotifyUnicastIpAddressChange = modiphlpapi.NewProc("NotifyUnicastIpAddressChange") procAddDllDirectory = modkernel32.NewProc("AddDllDirectory") procAssignProcessToJobObject = modkernel32.NewProc("AssignProcessToJobObject") procCancelIo = modkernel32.NewProc("CancelIo") procCancelIoEx = modkernel32.NewProc("CancelIoEx") procClearCommBreak = modkernel32.NewProc("ClearCommBreak") procClearCommError = modkernel32.NewProc("ClearCommError") procCloseHandle = modkernel32.NewProc("CloseHandle") procClosePseudoConsole = modkernel32.NewProc("ClosePseudoConsole") procConnectNamedPipe = modkernel32.NewProc("ConnectNamedPipe") procCreateDirectoryW = modkernel32.NewProc("CreateDirectoryW") procCreateEventExW = modkernel32.NewProc("CreateEventExW") procCreateEventW = modkernel32.NewProc("CreateEventW") procCreateFileMappingW = modkernel32.NewProc("CreateFileMappingW") procCreateFileW = modkernel32.NewProc("CreateFileW") procCreateHardLinkW = modkernel32.NewProc("CreateHardLinkW") procCreateIoCompletionPort = modkernel32.NewProc("CreateIoCompletionPort") procCreateJobObjectW = modkernel32.NewProc("CreateJobObjectW") procCreateMutexExW = modkernel32.NewProc("CreateMutexExW") procCreateMutexW = modkernel32.NewProc("CreateMutexW") procCreateNamedPipeW = modkernel32.NewProc("CreateNamedPipeW") procCreatePipe = modkernel32.NewProc("CreatePipe") procCreateProcessW = modkernel32.NewProc("CreateProcessW") procCreatePseudoConsole = modkernel32.NewProc("CreatePseudoConsole") procCreateSymbolicLinkW = modkernel32.NewProc("CreateSymbolicLinkW") procCreateToolhelp32Snapshot = modkernel32.NewProc("CreateToolhelp32Snapshot") procDefineDosDeviceW = modkernel32.NewProc("DefineDosDeviceW") procDeleteFileW = modkernel32.NewProc("DeleteFileW") procDeleteProcThreadAttributeList = modkernel32.NewProc("DeleteProcThreadAttributeList") procDeleteVolumeMountPointW = modkernel32.NewProc("DeleteVolumeMountPointW") procDeviceIoControl = modkernel32.NewProc("DeviceIoControl") procDisconnectNamedPipe = modkernel32.NewProc("DisconnectNamedPipe") procDuplicateHandle = modkernel32.NewProc("DuplicateHandle") procEscapeCommFunction = modkernel32.NewProc("EscapeCommFunction") procExitProcess = modkernel32.NewProc("ExitProcess") procExpandEnvironmentStringsW = modkernel32.NewProc("ExpandEnvironmentStringsW") procFindClose = modkernel32.NewProc("FindClose") procFindCloseChangeNotification = modkernel32.NewProc("FindCloseChangeNotification") procFindFirstChangeNotificationW = modkernel32.NewProc("FindFirstChangeNotificationW") procFindFirstFileW = modkernel32.NewProc("FindFirstFileW") procFindFirstVolumeMountPointW = modkernel32.NewProc("FindFirstVolumeMountPointW") procFindFirstVolumeW = modkernel32.NewProc("FindFirstVolumeW") procFindNextChangeNotification = modkernel32.NewProc("FindNextChangeNotification") procFindNextFileW = modkernel32.NewProc("FindNextFileW") procFindNextVolumeMountPointW = modkernel32.NewProc("FindNextVolumeMountPointW") procFindNextVolumeW = modkernel32.NewProc("FindNextVolumeW") procFindResourceW = modkernel32.NewProc("FindResourceW") procFindVolumeClose = modkernel32.NewProc("FindVolumeClose") procFindVolumeMountPointClose = modkernel32.NewProc("FindVolumeMountPointClose") procFlushConsoleInputBuffer = modkernel32.NewProc("FlushConsoleInputBuffer") procFlushFileBuffers = modkernel32.NewProc("FlushFileBuffers") procFlushViewOfFile = modkernel32.NewProc("FlushViewOfFile") procFormatMessageW = modkernel32.NewProc("FormatMessageW") procFreeEnvironmentStringsW = modkernel32.NewProc("FreeEnvironmentStringsW") procFreeLibrary = modkernel32.NewProc("FreeLibrary") procGenerateConsoleCtrlEvent = modkernel32.NewProc("GenerateConsoleCtrlEvent") procGetACP = modkernel32.NewProc("GetACP") procGetActiveProcessorCount = modkernel32.NewProc("GetActiveProcessorCount") procGetCommModemStatus = modkernel32.NewProc("GetCommModemStatus") procGetCommState = modkernel32.NewProc("GetCommState") procGetCommTimeouts = modkernel32.NewProc("GetCommTimeouts") procGetCommandLineW = modkernel32.NewProc("GetCommandLineW") procGetComputerNameExW = modkernel32.NewProc("GetComputerNameExW") procGetComputerNameW = modkernel32.NewProc("GetComputerNameW") procGetConsoleCP = modkernel32.NewProc("GetConsoleCP") procGetConsoleMode = modkernel32.NewProc("GetConsoleMode") procGetConsoleOutputCP = modkernel32.NewProc("GetConsoleOutputCP") procGetConsoleScreenBufferInfo = modkernel32.NewProc("GetConsoleScreenBufferInfo") procGetCurrentDirectoryW = modkernel32.NewProc("GetCurrentDirectoryW") procGetCurrentProcessId = modkernel32.NewProc("GetCurrentProcessId") procGetCurrentThreadId = modkernel32.NewProc("GetCurrentThreadId") procGetDiskFreeSpaceExW = modkernel32.NewProc("GetDiskFreeSpaceExW") procGetDriveTypeW = modkernel32.NewProc("GetDriveTypeW") procGetEnvironmentStringsW = modkernel32.NewProc("GetEnvironmentStringsW") procGetEnvironmentVariableW = modkernel32.NewProc("GetEnvironmentVariableW") procGetExitCodeProcess = modkernel32.NewProc("GetExitCodeProcess") procGetFileAttributesExW = modkernel32.NewProc("GetFileAttributesExW") procGetFileAttributesW = modkernel32.NewProc("GetFileAttributesW") procGetFileInformationByHandle = modkernel32.NewProc("GetFileInformationByHandle") procGetFileInformationByHandleEx = modkernel32.NewProc("GetFileInformationByHandleEx") procGetFileTime = modkernel32.NewProc("GetFileTime") procGetFileType = modkernel32.NewProc("GetFileType") procGetFinalPathNameByHandleW = modkernel32.NewProc("GetFinalPathNameByHandleW") procGetFullPathNameW = modkernel32.NewProc("GetFullPathNameW") procGetLargePageMinimum = modkernel32.NewProc("GetLargePageMinimum") procGetLastError = modkernel32.NewProc("GetLastError") procGetLogicalDriveStringsW = modkernel32.NewProc("GetLogicalDriveStringsW") procGetLogicalDrives = modkernel32.NewProc("GetLogicalDrives") procGetLongPathNameW = modkernel32.NewProc("GetLongPathNameW") procGetMaximumProcessorCount = modkernel32.NewProc("GetMaximumProcessorCount") procGetModuleFileNameW = modkernel32.NewProc("GetModuleFileNameW") procGetModuleHandleExW = modkernel32.NewProc("GetModuleHandleExW") procGetNamedPipeClientProcessId = modkernel32.NewProc("GetNamedPipeClientProcessId") procGetNamedPipeHandleStateW = modkernel32.NewProc("GetNamedPipeHandleStateW") procGetNamedPipeInfo = modkernel32.NewProc("GetNamedPipeInfo") procGetNamedPipeServerProcessId = modkernel32.NewProc("GetNamedPipeServerProcessId") procGetNumberOfConsoleInputEvents = modkernel32.NewProc("GetNumberOfConsoleInputEvents") procGetOverlappedResult = modkernel32.NewProc("GetOverlappedResult") procGetPriorityClass = modkernel32.NewProc("GetPriorityClass") procGetProcAddress = modkernel32.NewProc("GetProcAddress") procGetProcessId = modkernel32.NewProc("GetProcessId") procGetProcessPreferredUILanguages = modkernel32.NewProc("GetProcessPreferredUILanguages") procGetProcessShutdownParameters = modkernel32.NewProc("GetProcessShutdownParameters") procGetProcessTimes = modkernel32.NewProc("GetProcessTimes") procGetProcessWorkingSetSizeEx = modkernel32.NewProc("GetProcessWorkingSetSizeEx") procGetQueuedCompletionStatus = modkernel32.NewProc("GetQueuedCompletionStatus") procGetShortPathNameW = modkernel32.NewProc("GetShortPathNameW") procGetStartupInfoW = modkernel32.NewProc("GetStartupInfoW") procGetStdHandle = modkernel32.NewProc("GetStdHandle") procGetSystemDirectoryW = modkernel32.NewProc("GetSystemDirectoryW") procGetSystemPreferredUILanguages = modkernel32.NewProc("GetSystemPreferredUILanguages") procGetSystemTimeAsFileTime = modkernel32.NewProc("GetSystemTimeAsFileTime") procGetSystemTimePreciseAsFileTime = modkernel32.NewProc("GetSystemTimePreciseAsFileTime") procGetSystemWindowsDirectoryW = modkernel32.NewProc("GetSystemWindowsDirectoryW") procGetTempPathW = modkernel32.NewProc("GetTempPathW") procGetThreadPreferredUILanguages = modkernel32.NewProc("GetThreadPreferredUILanguages") procGetTickCount64 = modkernel32.NewProc("GetTickCount64") procGetTimeZoneInformation = modkernel32.NewProc("GetTimeZoneInformation") procGetUserPreferredUILanguages = modkernel32.NewProc("GetUserPreferredUILanguages") procGetVersion = modkernel32.NewProc("GetVersion") procGetVolumeInformationByHandleW = modkernel32.NewProc("GetVolumeInformationByHandleW") procGetVolumeInformationW = modkernel32.NewProc("GetVolumeInformationW") procGetVolumeNameForVolumeMountPointW = modkernel32.NewProc("GetVolumeNameForVolumeMountPointW") procGetVolumePathNameW = modkernel32.NewProc("GetVolumePathNameW") procGetVolumePathNamesForVolumeNameW = modkernel32.NewProc("GetVolumePathNamesForVolumeNameW") procGetWindowsDirectoryW = modkernel32.NewProc("GetWindowsDirectoryW") procInitializeProcThreadAttributeList = modkernel32.NewProc("InitializeProcThreadAttributeList") procIsProcessorFeaturePresent = modkernel32.NewProc("IsProcessorFeaturePresent") procIsWow64Process = modkernel32.NewProc("IsWow64Process") procIsWow64Process2 = modkernel32.NewProc("IsWow64Process2") procLoadLibraryExW = modkernel32.NewProc("LoadLibraryExW") procLoadLibraryW = modkernel32.NewProc("LoadLibraryW") procLoadResource = modkernel32.NewProc("LoadResource") procLocalAlloc = modkernel32.NewProc("LocalAlloc") procLocalFree = modkernel32.NewProc("LocalFree") procLockFileEx = modkernel32.NewProc("LockFileEx") procLockResource = modkernel32.NewProc("LockResource") procMapViewOfFile = modkernel32.NewProc("MapViewOfFile") procModule32FirstW = modkernel32.NewProc("Module32FirstW") procModule32NextW = modkernel32.NewProc("Module32NextW") procMoveFileExW = modkernel32.NewProc("MoveFileExW") procMoveFileW = modkernel32.NewProc("MoveFileW") procMultiByteToWideChar = modkernel32.NewProc("MultiByteToWideChar") procOpenEventW = modkernel32.NewProc("OpenEventW") procOpenMutexW = modkernel32.NewProc("OpenMutexW") procOpenProcess = modkernel32.NewProc("OpenProcess") procOpenThread = modkernel32.NewProc("OpenThread") procPostQueuedCompletionStatus = modkernel32.NewProc("PostQueuedCompletionStatus") procProcess32FirstW = modkernel32.NewProc("Process32FirstW") procProcess32NextW = modkernel32.NewProc("Process32NextW") procProcessIdToSessionId = modkernel32.NewProc("ProcessIdToSessionId") procPulseEvent = modkernel32.NewProc("PulseEvent") procPurgeComm = modkernel32.NewProc("PurgeComm") procQueryDosDeviceW = modkernel32.NewProc("QueryDosDeviceW") procQueryFullProcessImageNameW = modkernel32.NewProc("QueryFullProcessImageNameW") procQueryInformationJobObject = modkernel32.NewProc("QueryInformationJobObject") procReadConsoleW = modkernel32.NewProc("ReadConsoleW") procReadDirectoryChangesW = modkernel32.NewProc("ReadDirectoryChangesW") procReadFile = modkernel32.NewProc("ReadFile") procReadProcessMemory = modkernel32.NewProc("ReadProcessMemory") procReleaseMutex = modkernel32.NewProc("ReleaseMutex") procRemoveDirectoryW = modkernel32.NewProc("RemoveDirectoryW") procRemoveDllDirectory = modkernel32.NewProc("RemoveDllDirectory") procResetEvent = modkernel32.NewProc("ResetEvent") procResizePseudoConsole = modkernel32.NewProc("ResizePseudoConsole") procResumeThread = modkernel32.NewProc("ResumeThread") procSetCommBreak = modkernel32.NewProc("SetCommBreak") procSetCommMask = modkernel32.NewProc("SetCommMask") procSetCommState = modkernel32.NewProc("SetCommState") procSetCommTimeouts = modkernel32.NewProc("SetCommTimeouts") procSetConsoleCP = modkernel32.NewProc("SetConsoleCP") procSetConsoleCursorPosition = modkernel32.NewProc("SetConsoleCursorPosition") procSetConsoleMode = modkernel32.NewProc("SetConsoleMode") procSetConsoleOutputCP = modkernel32.NewProc("SetConsoleOutputCP") procSetCurrentDirectoryW = modkernel32.NewProc("SetCurrentDirectoryW") procSetDefaultDllDirectories = modkernel32.NewProc("SetDefaultDllDirectories") procSetDllDirectoryW = modkernel32.NewProc("SetDllDirectoryW") procSetEndOfFile = modkernel32.NewProc("SetEndOfFile") procSetEnvironmentVariableW = modkernel32.NewProc("SetEnvironmentVariableW") procSetErrorMode = modkernel32.NewProc("SetErrorMode") procSetEvent = modkernel32.NewProc("SetEvent") procSetFileAttributesW = modkernel32.NewProc("SetFileAttributesW") procSetFileCompletionNotificationModes = modkernel32.NewProc("SetFileCompletionNotificationModes") procSetFileInformationByHandle = modkernel32.NewProc("SetFileInformationByHandle") procSetFilePointer = modkernel32.NewProc("SetFilePointer") procSetFileTime = modkernel32.NewProc("SetFileTime") procSetFileValidData = modkernel32.NewProc("SetFileValidData") procSetHandleInformation = modkernel32.NewProc("SetHandleInformation") procSetInformationJobObject = modkernel32.NewProc("SetInformationJobObject") procSetNamedPipeHandleState = modkernel32.NewProc("SetNamedPipeHandleState") procSetPriorityClass = modkernel32.NewProc("SetPriorityClass") procSetProcessPriorityBoost = modkernel32.NewProc("SetProcessPriorityBoost") procSetProcessShutdownParameters = modkernel32.NewProc("SetProcessShutdownParameters") procSetProcessWorkingSetSizeEx = modkernel32.NewProc("SetProcessWorkingSetSizeEx") procSetStdHandle = modkernel32.NewProc("SetStdHandle") procSetVolumeLabelW = modkernel32.NewProc("SetVolumeLabelW") procSetVolumeMountPointW = modkernel32.NewProc("SetVolumeMountPointW") procSetupComm = modkernel32.NewProc("SetupComm") procSizeofResource = modkernel32.NewProc("SizeofResource") procSleepEx = modkernel32.NewProc("SleepEx") procTerminateJobObject = modkernel32.NewProc("TerminateJobObject") procTerminateProcess = modkernel32.NewProc("TerminateProcess") procThread32First = modkernel32.NewProc("Thread32First") procThread32Next = modkernel32.NewProc("Thread32Next") procUnlockFileEx = modkernel32.NewProc("UnlockFileEx") procUnmapViewOfFile = modkernel32.NewProc("UnmapViewOfFile") procUpdateProcThreadAttribute = modkernel32.NewProc("UpdateProcThreadAttribute") procVirtualAlloc = modkernel32.NewProc("VirtualAlloc") procVirtualFree = modkernel32.NewProc("VirtualFree") procVirtualLock = modkernel32.NewProc("VirtualLock") procVirtualProtect = modkernel32.NewProc("VirtualProtect") procVirtualProtectEx = modkernel32.NewProc("VirtualProtectEx") procVirtualQuery = modkernel32.NewProc("VirtualQuery") procVirtualQueryEx = modkernel32.NewProc("VirtualQueryEx") procVirtualUnlock = modkernel32.NewProc("VirtualUnlock") procWTSGetActiveConsoleSessionId = modkernel32.NewProc("WTSGetActiveConsoleSessionId") procWaitCommEvent = modkernel32.NewProc("WaitCommEvent") procWaitForMultipleObjects = modkernel32.NewProc("WaitForMultipleObjects") procWaitForSingleObject = modkernel32.NewProc("WaitForSingleObject") procWriteConsoleW = modkernel32.NewProc("WriteConsoleW") procWriteFile = modkernel32.NewProc("WriteFile") procWriteProcessMemory = modkernel32.NewProc("WriteProcessMemory") procAcceptEx = modmswsock.NewProc("AcceptEx") procGetAcceptExSockaddrs = modmswsock.NewProc("GetAcceptExSockaddrs") procTransmitFile = modmswsock.NewProc("TransmitFile") procNetApiBufferFree = modnetapi32.NewProc("NetApiBufferFree") procNetGetJoinInformation = modnetapi32.NewProc("NetGetJoinInformation") procNetUserEnum = modnetapi32.NewProc("NetUserEnum") procNetUserGetInfo = modnetapi32.NewProc("NetUserGetInfo") procNtCreateFile = modntdll.NewProc("NtCreateFile") procNtCreateNamedPipeFile = modntdll.NewProc("NtCreateNamedPipeFile") procNtQueryInformationProcess = modntdll.NewProc("NtQueryInformationProcess") procNtQuerySystemInformation = modntdll.NewProc("NtQuerySystemInformation") procNtSetInformationFile = modntdll.NewProc("NtSetInformationFile") procNtSetInformationProcess = modntdll.NewProc("NtSetInformationProcess") procNtSetSystemInformation = modntdll.NewProc("NtSetSystemInformation") procRtlAddFunctionTable = modntdll.NewProc("RtlAddFunctionTable") procRtlDefaultNpAcl = modntdll.NewProc("RtlDefaultNpAcl") procRtlDeleteFunctionTable = modntdll.NewProc("RtlDeleteFunctionTable") procRtlDosPathNameToNtPathName_U_WithStatus = modntdll.NewProc("RtlDosPathNameToNtPathName_U_WithStatus") procRtlDosPathNameToRelativeNtPathName_U_WithStatus = modntdll.NewProc("RtlDosPathNameToRelativeNtPathName_U_WithStatus") procRtlGetCurrentPeb = modntdll.NewProc("RtlGetCurrentPeb") procRtlGetNtVersionNumbers = modntdll.NewProc("RtlGetNtVersionNumbers") procRtlGetVersion = modntdll.NewProc("RtlGetVersion") procRtlInitString = modntdll.NewProc("RtlInitString") procRtlInitUnicodeString = modntdll.NewProc("RtlInitUnicodeString") procRtlNtStatusToDosErrorNoTeb = modntdll.NewProc("RtlNtStatusToDosErrorNoTeb") procCLSIDFromString = modole32.NewProc("CLSIDFromString") procCoCreateGuid = modole32.NewProc("CoCreateGuid") procCoGetObject = modole32.NewProc("CoGetObject") procCoInitializeEx = modole32.NewProc("CoInitializeEx") procCoTaskMemFree = modole32.NewProc("CoTaskMemFree") procCoUninitialize = modole32.NewProc("CoUninitialize") procStringFromGUID2 = modole32.NewProc("StringFromGUID2") procEnumProcessModules = modpsapi.NewProc("EnumProcessModules") procEnumProcessModulesEx = modpsapi.NewProc("EnumProcessModulesEx") procEnumProcesses = modpsapi.NewProc("EnumProcesses") procGetModuleBaseNameW = modpsapi.NewProc("GetModuleBaseNameW") procGetModuleFileNameExW = modpsapi.NewProc("GetModuleFileNameExW") procGetModuleInformation = modpsapi.NewProc("GetModuleInformation") procQueryWorkingSetEx = modpsapi.NewProc("QueryWorkingSetEx") procSubscribeServiceChangeNotifications = modsechost.NewProc("SubscribeServiceChangeNotifications") procUnsubscribeServiceChangeNotifications = modsechost.NewProc("UnsubscribeServiceChangeNotifications") procGetUserNameExW = modsecur32.NewProc("GetUserNameExW") procTranslateNameW = modsecur32.NewProc("TranslateNameW") procSetupDiBuildDriverInfoList = modsetupapi.NewProc("SetupDiBuildDriverInfoList") procSetupDiCallClassInstaller = modsetupapi.NewProc("SetupDiCallClassInstaller") procSetupDiCancelDriverInfoSearch = modsetupapi.NewProc("SetupDiCancelDriverInfoSearch") procSetupDiClassGuidsFromNameExW = modsetupapi.NewProc("SetupDiClassGuidsFromNameExW") procSetupDiClassNameFromGuidExW = modsetupapi.NewProc("SetupDiClassNameFromGuidExW") procSetupDiCreateDeviceInfoListExW = modsetupapi.NewProc("SetupDiCreateDeviceInfoListExW") procSetupDiCreateDeviceInfoW = modsetupapi.NewProc("SetupDiCreateDeviceInfoW") procSetupDiDestroyDeviceInfoList = modsetupapi.NewProc("SetupDiDestroyDeviceInfoList") procSetupDiDestroyDriverInfoList = modsetupapi.NewProc("SetupDiDestroyDriverInfoList") procSetupDiEnumDeviceInfo = modsetupapi.NewProc("SetupDiEnumDeviceInfo") procSetupDiEnumDriverInfoW = modsetupapi.NewProc("SetupDiEnumDriverInfoW") procSetupDiGetClassDevsExW = modsetupapi.NewProc("SetupDiGetClassDevsExW") procSetupDiGetClassInstallParamsW = modsetupapi.NewProc("SetupDiGetClassInstallParamsW") procSetupDiGetDeviceInfoListDetailW = modsetupapi.NewProc("SetupDiGetDeviceInfoListDetailW") procSetupDiGetDeviceInstallParamsW = modsetupapi.NewProc("SetupDiGetDeviceInstallParamsW") procSetupDiGetDeviceInstanceIdW = modsetupapi.NewProc("SetupDiGetDeviceInstanceIdW") procSetupDiGetDevicePropertyW = modsetupapi.NewProc("SetupDiGetDevicePropertyW") procSetupDiGetDeviceRegistryPropertyW = modsetupapi.NewProc("SetupDiGetDeviceRegistryPropertyW") procSetupDiGetDriverInfoDetailW = modsetupapi.NewProc("SetupDiGetDriverInfoDetailW") procSetupDiGetSelectedDevice = modsetupapi.NewProc("SetupDiGetSelectedDevice") procSetupDiGetSelectedDriverW = modsetupapi.NewProc("SetupDiGetSelectedDriverW") procSetupDiOpenDevRegKey = modsetupapi.NewProc("SetupDiOpenDevRegKey") procSetupDiSetClassInstallParamsW = modsetupapi.NewProc("SetupDiSetClassInstallParamsW") procSetupDiSetDeviceInstallParamsW = modsetupapi.NewProc("SetupDiSetDeviceInstallParamsW") procSetupDiSetDeviceRegistryPropertyW = modsetupapi.NewProc("SetupDiSetDeviceRegistryPropertyW") procSetupDiSetSelectedDevice = modsetupapi.NewProc("SetupDiSetSelectedDevice") procSetupDiSetSelectedDriverW = modsetupapi.NewProc("SetupDiSetSelectedDriverW") procSetupUninstallOEMInfW = modsetupapi.NewProc("SetupUninstallOEMInfW") procCommandLineToArgvW = modshell32.NewProc("CommandLineToArgvW") procSHGetKnownFolderPath = modshell32.NewProc("SHGetKnownFolderPath") procShellExecuteW = modshell32.NewProc("ShellExecuteW") procEnumChildWindows = moduser32.NewProc("EnumChildWindows") procEnumWindows = moduser32.NewProc("EnumWindows") procExitWindowsEx = moduser32.NewProc("ExitWindowsEx") procGetClassNameW = moduser32.NewProc("GetClassNameW") procGetDesktopWindow = moduser32.NewProc("GetDesktopWindow") procGetForegroundWindow = moduser32.NewProc("GetForegroundWindow") procGetGUIThreadInfo = moduser32.NewProc("GetGUIThreadInfo") procGetKeyboardLayout = moduser32.NewProc("GetKeyboardLayout") procGetShellWindow = moduser32.NewProc("GetShellWindow") procGetWindowThreadProcessId = moduser32.NewProc("GetWindowThreadProcessId") procIsWindow = moduser32.NewProc("IsWindow") procIsWindowUnicode = moduser32.NewProc("IsWindowUnicode") procIsWindowVisible = moduser32.NewProc("IsWindowVisible") procLoadKeyboardLayoutW = moduser32.NewProc("LoadKeyboardLayoutW") procMessageBoxW = moduser32.NewProc("MessageBoxW") procToUnicodeEx = moduser32.NewProc("ToUnicodeEx") procUnloadKeyboardLayout = moduser32.NewProc("UnloadKeyboardLayout") procCreateEnvironmentBlock = moduserenv.NewProc("CreateEnvironmentBlock") procDestroyEnvironmentBlock = moduserenv.NewProc("DestroyEnvironmentBlock") procGetUserProfileDirectoryW = moduserenv.NewProc("GetUserProfileDirectoryW") procGetFileVersionInfoSizeW = modversion.NewProc("GetFileVersionInfoSizeW") procGetFileVersionInfoW = modversion.NewProc("GetFileVersionInfoW") procVerQueryValueW = modversion.NewProc("VerQueryValueW") proctimeBeginPeriod = modwinmm.NewProc("timeBeginPeriod") proctimeEndPeriod = modwinmm.NewProc("timeEndPeriod") procWinVerifyTrustEx = modwintrust.NewProc("WinVerifyTrustEx") procFreeAddrInfoW = modws2_32.NewProc("FreeAddrInfoW") procGetAddrInfoW = modws2_32.NewProc("GetAddrInfoW") procWSACleanup = modws2_32.NewProc("WSACleanup") procWSADuplicateSocketW = modws2_32.NewProc("WSADuplicateSocketW") procWSAEnumProtocolsW = modws2_32.NewProc("WSAEnumProtocolsW") procWSAGetOverlappedResult = modws2_32.NewProc("WSAGetOverlappedResult") procWSAIoctl = modws2_32.NewProc("WSAIoctl") procWSALookupServiceBeginW = modws2_32.NewProc("WSALookupServiceBeginW") procWSALookupServiceEnd = modws2_32.NewProc("WSALookupServiceEnd") procWSALookupServiceNextW = modws2_32.NewProc("WSALookupServiceNextW") procWSARecv = modws2_32.NewProc("WSARecv") procWSARecvFrom = modws2_32.NewProc("WSARecvFrom") procWSASend = modws2_32.NewProc("WSASend") procWSASendTo = modws2_32.NewProc("WSASendTo") procWSASocketW = modws2_32.NewProc("WSASocketW") procWSAStartup = modws2_32.NewProc("WSAStartup") procbind = modws2_32.NewProc("bind") procclosesocket = modws2_32.NewProc("closesocket") procconnect = modws2_32.NewProc("connect") procgethostbyname = modws2_32.NewProc("gethostbyname") procgetpeername = modws2_32.NewProc("getpeername") procgetprotobyname = modws2_32.NewProc("getprotobyname") procgetservbyname = modws2_32.NewProc("getservbyname") procgetsockname = modws2_32.NewProc("getsockname") procgetsockopt = modws2_32.NewProc("getsockopt") proclisten = modws2_32.NewProc("listen") procntohs = modws2_32.NewProc("ntohs") procrecvfrom = modws2_32.NewProc("recvfrom") procsendto = modws2_32.NewProc("sendto") procsetsockopt = modws2_32.NewProc("setsockopt") procshutdown = modws2_32.NewProc("shutdown") procsocket = modws2_32.NewProc("socket") procWTSEnumerateSessionsW = modwtsapi32.NewProc("WTSEnumerateSessionsW") procWTSFreeMemory = modwtsapi32.NewProc("WTSFreeMemory") procWTSQueryUserToken = modwtsapi32.NewProc("WTSQueryUserToken") ) func cm_Get_DevNode_Status(status *uint32, problemNumber *uint32, devInst DEVINST, flags uint32) (ret CONFIGRET) { r0, _, _ := syscall.SyscallN(procCM_Get_DevNode_Status.Addr(), uintptr(unsafe.Pointer(status)), uintptr(unsafe.Pointer(problemNumber)), uintptr(devInst), uintptr(flags)) ret = CONFIGRET(r0) return } func cm_Get_Device_Interface_List(interfaceClass *GUID, deviceID *uint16, buffer *uint16, bufferLen uint32, flags uint32) (ret CONFIGRET) { r0, _, _ := syscall.SyscallN(procCM_Get_Device_Interface_ListW.Addr(), uintptr(unsafe.Pointer(interfaceClass)), uintptr(unsafe.Pointer(deviceID)), uintptr(unsafe.Pointer(buffer)), uintptr(bufferLen), uintptr(flags)) ret = CONFIGRET(r0) return } func cm_Get_Device_Interface_List_Size(len *uint32, interfaceClass *GUID, deviceID *uint16, flags uint32) (ret CONFIGRET) { r0, _, _ := syscall.SyscallN(procCM_Get_Device_Interface_List_SizeW.Addr(), uintptr(unsafe.Pointer(len)), uintptr(unsafe.Pointer(interfaceClass)), uintptr(unsafe.Pointer(deviceID)), uintptr(flags)) ret = CONFIGRET(r0) return } func cm_MapCrToWin32Err(configRet CONFIGRET, defaultWin32Error Errno) (ret Errno) { r0, _, _ := syscall.SyscallN(procCM_MapCrToWin32Err.Addr(), uintptr(configRet), uintptr(defaultWin32Error)) ret = Errno(r0) return } func AdjustTokenGroups(token Token, resetToDefault bool, newstate *Tokengroups, buflen uint32, prevstate *Tokengroups, returnlen *uint32) (err error) { var _p0 uint32 if resetToDefault { _p0 = 1 } r1, _, e1 := syscall.SyscallN(procAdjustTokenGroups.Addr(), uintptr(token), uintptr(_p0), uintptr(unsafe.Pointer(newstate)), uintptr(buflen), uintptr(unsafe.Pointer(prevstate)), uintptr(unsafe.Pointer(returnlen))) if r1 == 0 { err = errnoErr(e1) } return } func AdjustTokenPrivileges(token Token, disableAllPrivileges bool, newstate *Tokenprivileges, buflen uint32, prevstate *Tokenprivileges, returnlen *uint32) (err error) { var _p0 uint32 if disableAllPrivileges { _p0 = 1 } r1, _, e1 := syscall.SyscallN(procAdjustTokenPrivileges.Addr(), uintptr(token), uintptr(_p0), uintptr(unsafe.Pointer(newstate)), uintptr(buflen), uintptr(unsafe.Pointer(prevstate)), uintptr(unsafe.Pointer(returnlen))) if r1 == 0 { err = errnoErr(e1) } return } func 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) { r1, _, e1 := syscall.SyscallN(procAllocateAndInitializeSid.Addr(), 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))) if r1 == 0 { err = errnoErr(e1) } return } func buildSecurityDescriptor(owner *TRUSTEE, group *TRUSTEE, countAccessEntries uint32, accessEntries *EXPLICIT_ACCESS, countAuditEntries uint32, auditEntries *EXPLICIT_ACCESS, oldSecurityDescriptor *SECURITY_DESCRIPTOR, sizeNewSecurityDescriptor *uint32, newSecurityDescriptor **SECURITY_DESCRIPTOR) (ret error) { r0, _, _ := syscall.SyscallN(procBuildSecurityDescriptorW.Addr(), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(countAccessEntries), uintptr(unsafe.Pointer(accessEntries)), uintptr(countAuditEntries), uintptr(unsafe.Pointer(auditEntries)), uintptr(unsafe.Pointer(oldSecurityDescriptor)), uintptr(unsafe.Pointer(sizeNewSecurityDescriptor)), uintptr(unsafe.Pointer(newSecurityDescriptor))) if r0 != 0 { ret = syscall.Errno(r0) } return } func ChangeServiceConfig2(service Handle, infoLevel uint32, info *byte) (err error) { r1, _, e1 := syscall.SyscallN(procChangeServiceConfig2W.Addr(), uintptr(service), uintptr(infoLevel), uintptr(unsafe.Pointer(info))) if r1 == 0 { err = errnoErr(e1) } return } func 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) { r1, _, e1 := syscall.SyscallN(procChangeServiceConfigW.Addr(), 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))) if r1 == 0 { err = errnoErr(e1) } return } func checkTokenMembership(tokenHandle Token, sidToCheck *SID, isMember *int32) (err error) { r1, _, e1 := syscall.SyscallN(procCheckTokenMembership.Addr(), uintptr(tokenHandle), uintptr(unsafe.Pointer(sidToCheck)), uintptr(unsafe.Pointer(isMember))) if r1 == 0 { err = errnoErr(e1) } return } func CloseServiceHandle(handle Handle) (err error) { r1, _, e1 := syscall.SyscallN(procCloseServiceHandle.Addr(), uintptr(handle)) if r1 == 0 { err = errnoErr(e1) } return } func ControlService(service Handle, control uint32, status *SERVICE_STATUS) (err error) { r1, _, e1 := syscall.SyscallN(procControlService.Addr(), uintptr(service), uintptr(control), uintptr(unsafe.Pointer(status))) if r1 == 0 { err = errnoErr(e1) } return } func convertSecurityDescriptorToStringSecurityDescriptor(sd *SECURITY_DESCRIPTOR, revision uint32, securityInformation SECURITY_INFORMATION, str **uint16, strLen *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procConvertSecurityDescriptorToStringSecurityDescriptorW.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(revision), uintptr(securityInformation), uintptr(unsafe.Pointer(str)), uintptr(unsafe.Pointer(strLen))) if r1 == 0 { err = errnoErr(e1) } return } func ConvertSidToStringSid(sid *SID, stringSid **uint16) (err error) { r1, _, e1 := syscall.SyscallN(procConvertSidToStringSidW.Addr(), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(stringSid))) if r1 == 0 { err = errnoErr(e1) } return } func convertStringSecurityDescriptorToSecurityDescriptor(str string, revision uint32, sd **SECURITY_DESCRIPTOR, size *uint32) (err error) { var _p0 *uint16 _p0, err = syscall.UTF16PtrFromString(str) if err != nil { return } return _convertStringSecurityDescriptorToSecurityDescriptor(_p0, revision, sd, size) } func _convertStringSecurityDescriptorToSecurityDescriptor(str *uint16, revision uint32, sd **SECURITY_DESCRIPTOR, size *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procConvertStringSecurityDescriptorToSecurityDescriptorW.Addr(), uintptr(unsafe.Pointer(str)), uintptr(revision), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(size))) if r1 == 0 { err = errnoErr(e1) } return } func ConvertStringSidToSid(stringSid *uint16, sid **SID) (err error) { r1, _, e1 := syscall.SyscallN(procConvertStringSidToSidW.Addr(), uintptr(unsafe.Pointer(stringSid)), uintptr(unsafe.Pointer(sid))) if r1 == 0 { err = errnoErr(e1) } return } func CopySid(destSidLen uint32, destSid *SID, srcSid *SID) (err error) { r1, _, e1 := syscall.SyscallN(procCopySid.Addr(), uintptr(destSidLen), uintptr(unsafe.Pointer(destSid)), uintptr(unsafe.Pointer(srcSid))) if r1 == 0 { err = errnoErr(e1) } return } func CreateProcessAsUser(token Token, appName *uint16, commandLine *uint16, procSecurity *SecurityAttributes, threadSecurity *SecurityAttributes, inheritHandles bool, creationFlags uint32, env *uint16, currentDir *uint16, startupInfo *StartupInfo, outProcInfo *ProcessInformation) (err error) { var _p0 uint32 if inheritHandles { _p0 = 1 } r1, _, e1 := syscall.SyscallN(procCreateProcessAsUserW.Addr(), uintptr(token), 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))) if r1 == 0 { err = errnoErr(e1) } return } func 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) { r0, _, e1 := syscall.SyscallN(procCreateServiceW.Addr(), 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))) handle = Handle(r0) if handle == 0 { err = errnoErr(e1) } return } func createWellKnownSid(sidType WELL_KNOWN_SID_TYPE, domainSid *SID, sid *SID, sizeSid *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procCreateWellKnownSid.Addr(), uintptr(sidType), uintptr(unsafe.Pointer(domainSid)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(sizeSid))) if r1 == 0 { err = errnoErr(e1) } return } func CryptAcquireContext(provhandle *Handle, container *uint16, provider *uint16, provtype uint32, flags uint32) (err error) { r1, _, e1 := syscall.SyscallN(procCryptAcquireContextW.Addr(), uintptr(unsafe.Pointer(provhandle)), uintptr(unsafe.Pointer(container)), uintptr(unsafe.Pointer(provider)), uintptr(provtype), uintptr(flags)) if r1 == 0 { err = errnoErr(e1) } return } func CryptGenRandom(provhandle Handle, buflen uint32, buf *byte) (err error) { r1, _, e1 := syscall.SyscallN(procCryptGenRandom.Addr(), uintptr(provhandle), uintptr(buflen), uintptr(unsafe.Pointer(buf))) if r1 == 0 { err = errnoErr(e1) } return } func CryptReleaseContext(provhandle Handle, flags uint32) (err error) { r1, _, e1 := syscall.SyscallN(procCryptReleaseContext.Addr(), uintptr(provhandle), uintptr(flags)) if r1 == 0 { err = errnoErr(e1) } return } func DeleteService(service Handle) (err error) { r1, _, e1 := syscall.SyscallN(procDeleteService.Addr(), uintptr(service)) if r1 == 0 { err = errnoErr(e1) } return } func DeregisterEventSource(handle Handle) (err error) { r1, _, e1 := syscall.SyscallN(procDeregisterEventSource.Addr(), uintptr(handle)) if r1 == 0 { err = errnoErr(e1) } return } func DuplicateTokenEx(existingToken Token, desiredAccess uint32, tokenAttributes *SecurityAttributes, impersonationLevel uint32, tokenType uint32, newToken *Token) (err error) { r1, _, e1 := syscall.SyscallN(procDuplicateTokenEx.Addr(), uintptr(existingToken), uintptr(desiredAccess), uintptr(unsafe.Pointer(tokenAttributes)), uintptr(impersonationLevel), uintptr(tokenType), uintptr(unsafe.Pointer(newToken))) if r1 == 0 { err = errnoErr(e1) } return } func EnumDependentServices(service Handle, activityState uint32, services *ENUM_SERVICE_STATUS, buffSize uint32, bytesNeeded *uint32, servicesReturned *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procEnumDependentServicesW.Addr(), uintptr(service), uintptr(activityState), uintptr(unsafe.Pointer(services)), uintptr(buffSize), uintptr(unsafe.Pointer(bytesNeeded)), uintptr(unsafe.Pointer(servicesReturned))) if r1 == 0 { err = errnoErr(e1) } return } func EnumServicesStatusEx(mgr Handle, infoLevel uint32, serviceType uint32, serviceState uint32, services *byte, bufSize uint32, bytesNeeded *uint32, servicesReturned *uint32, resumeHandle *uint32, groupName *uint16) (err error) { r1, _, e1 := syscall.SyscallN(procEnumServicesStatusExW.Addr(), uintptr(mgr), uintptr(infoLevel), uintptr(serviceType), uintptr(serviceState), uintptr(unsafe.Pointer(services)), uintptr(bufSize), uintptr(unsafe.Pointer(bytesNeeded)), uintptr(unsafe.Pointer(servicesReturned)), uintptr(unsafe.Pointer(resumeHandle)), uintptr(unsafe.Pointer(groupName))) if r1 == 0 { err = errnoErr(e1) } return } func EqualSid(sid1 *SID, sid2 *SID) (isEqual bool) { r0, _, _ := syscall.SyscallN(procEqualSid.Addr(), uintptr(unsafe.Pointer(sid1)), uintptr(unsafe.Pointer(sid2))) isEqual = r0 != 0 return } func FreeSid(sid *SID) (err error) { r1, _, e1 := syscall.SyscallN(procFreeSid.Addr(), uintptr(unsafe.Pointer(sid))) if r1 != 0 { err = errnoErr(e1) } return } func GetAce(acl *ACL, aceIndex uint32, pAce **ACCESS_ALLOWED_ACE) (err error) { r1, _, e1 := syscall.SyscallN(procGetAce.Addr(), uintptr(unsafe.Pointer(acl)), uintptr(aceIndex), uintptr(unsafe.Pointer(pAce))) if r1 == 0 { err = errnoErr(e1) } return } func GetLengthSid(sid *SID) (len uint32) { r0, _, _ := syscall.SyscallN(procGetLengthSid.Addr(), uintptr(unsafe.Pointer(sid))) len = uint32(r0) return } func getNamedSecurityInfo(objectName string, objectType SE_OBJECT_TYPE, securityInformation SECURITY_INFORMATION, owner **SID, group **SID, dacl **ACL, sacl **ACL, sd **SECURITY_DESCRIPTOR) (ret error) { var _p0 *uint16 _p0, ret = syscall.UTF16PtrFromString(objectName) if ret != nil { return } return _getNamedSecurityInfo(_p0, objectType, securityInformation, owner, group, dacl, sacl, sd) } func _getNamedSecurityInfo(objectName *uint16, objectType SE_OBJECT_TYPE, securityInformation SECURITY_INFORMATION, owner **SID, group **SID, dacl **ACL, sacl **ACL, sd **SECURITY_DESCRIPTOR) (ret error) { r0, _, _ := syscall.SyscallN(procGetNamedSecurityInfoW.Addr(), uintptr(unsafe.Pointer(objectName)), uintptr(objectType), uintptr(securityInformation), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(sacl)), uintptr(unsafe.Pointer(sd))) if r0 != 0 { ret = syscall.Errno(r0) } return } func getSecurityDescriptorControl(sd *SECURITY_DESCRIPTOR, control *SECURITY_DESCRIPTOR_CONTROL, revision *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetSecurityDescriptorControl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(control)), uintptr(unsafe.Pointer(revision))) if r1 == 0 { err = errnoErr(e1) } return } func getSecurityDescriptorDacl(sd *SECURITY_DESCRIPTOR, daclPresent *bool, dacl **ACL, daclDefaulted *bool) (err error) { var _p0 uint32 if *daclPresent { _p0 = 1 } var _p1 uint32 if *daclDefaulted { _p1 = 1 } r1, _, e1 := syscall.SyscallN(procGetSecurityDescriptorDacl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(&_p0)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(&_p1))) *daclPresent = _p0 != 0 *daclDefaulted = _p1 != 0 if r1 == 0 { err = errnoErr(e1) } return } func getSecurityDescriptorGroup(sd *SECURITY_DESCRIPTOR, group **SID, groupDefaulted *bool) (err error) { var _p0 uint32 if *groupDefaulted { _p0 = 1 } r1, _, e1 := syscall.SyscallN(procGetSecurityDescriptorGroup.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(&_p0))) *groupDefaulted = _p0 != 0 if r1 == 0 { err = errnoErr(e1) } return } func getSecurityDescriptorLength(sd *SECURITY_DESCRIPTOR) (len uint32) { r0, _, _ := syscall.SyscallN(procGetSecurityDescriptorLength.Addr(), uintptr(unsafe.Pointer(sd))) len = uint32(r0) return } func getSecurityDescriptorOwner(sd *SECURITY_DESCRIPTOR, owner **SID, ownerDefaulted *bool) (err error) { var _p0 uint32 if *ownerDefaulted { _p0 = 1 } r1, _, e1 := syscall.SyscallN(procGetSecurityDescriptorOwner.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(&_p0))) *ownerDefaulted = _p0 != 0 if r1 == 0 { err = errnoErr(e1) } return } func getSecurityDescriptorRMControl(sd *SECURITY_DESCRIPTOR, rmControl *uint8) (ret error) { r0, _, _ := syscall.SyscallN(procGetSecurityDescriptorRMControl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(rmControl))) if r0 != 0 { ret = syscall.Errno(r0) } return } func getSecurityDescriptorSacl(sd *SECURITY_DESCRIPTOR, saclPresent *bool, sacl **ACL, saclDefaulted *bool) (err error) { var _p0 uint32 if *saclPresent { _p0 = 1 } var _p1 uint32 if *saclDefaulted { _p1 = 1 } r1, _, e1 := syscall.SyscallN(procGetSecurityDescriptorSacl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(&_p0)), uintptr(unsafe.Pointer(sacl)), uintptr(unsafe.Pointer(&_p1))) *saclPresent = _p0 != 0 *saclDefaulted = _p1 != 0 if r1 == 0 { err = errnoErr(e1) } return } func getSecurityInfo(handle Handle, objectType SE_OBJECT_TYPE, securityInformation SECURITY_INFORMATION, owner **SID, group **SID, dacl **ACL, sacl **ACL, sd **SECURITY_DESCRIPTOR) (ret error) { r0, _, _ := syscall.SyscallN(procGetSecurityInfo.Addr(), uintptr(handle), uintptr(objectType), uintptr(securityInformation), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(sacl)), uintptr(unsafe.Pointer(sd))) if r0 != 0 { ret = syscall.Errno(r0) } return } func getSidIdentifierAuthority(sid *SID) (authority *SidIdentifierAuthority) { r0, _, _ := syscall.SyscallN(procGetSidIdentifierAuthority.Addr(), uintptr(unsafe.Pointer(sid))) authority = (*SidIdentifierAuthority)(unsafe.Pointer(r0)) return } func getSidSubAuthority(sid *SID, index uint32) (subAuthority *uint32) { r0, _, _ := syscall.SyscallN(procGetSidSubAuthority.Addr(), uintptr(unsafe.Pointer(sid)), uintptr(index)) subAuthority = (*uint32)(unsafe.Pointer(r0)) return } func getSidSubAuthorityCount(sid *SID) (count *uint8) { r0, _, _ := syscall.SyscallN(procGetSidSubAuthorityCount.Addr(), uintptr(unsafe.Pointer(sid))) count = (*uint8)(unsafe.Pointer(r0)) return } func GetTokenInformation(token Token, infoClass uint32, info *byte, infoLen uint32, returnedLen *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetTokenInformation.Addr(), uintptr(token), uintptr(infoClass), uintptr(unsafe.Pointer(info)), uintptr(infoLen), uintptr(unsafe.Pointer(returnedLen))) if r1 == 0 { err = errnoErr(e1) } return } func ImpersonateSelf(impersonationlevel uint32) (err error) { r1, _, e1 := syscall.SyscallN(procImpersonateSelf.Addr(), uintptr(impersonationlevel)) if r1 == 0 { err = errnoErr(e1) } return } func initializeSecurityDescriptor(absoluteSD *SECURITY_DESCRIPTOR, revision uint32) (err error) { r1, _, e1 := syscall.SyscallN(procInitializeSecurityDescriptor.Addr(), uintptr(unsafe.Pointer(absoluteSD)), uintptr(revision)) if r1 == 0 { err = errnoErr(e1) } return } func InitiateSystemShutdownEx(machineName *uint16, message *uint16, timeout uint32, forceAppsClosed bool, rebootAfterShutdown bool, reason uint32) (err error) { var _p0 uint32 if forceAppsClosed { _p0 = 1 } var _p1 uint32 if rebootAfterShutdown { _p1 = 1 } r1, _, e1 := syscall.SyscallN(procInitiateSystemShutdownExW.Addr(), uintptr(unsafe.Pointer(machineName)), uintptr(unsafe.Pointer(message)), uintptr(timeout), uintptr(_p0), uintptr(_p1), uintptr(reason)) if r1 == 0 { err = errnoErr(e1) } return } func isTokenRestricted(tokenHandle Token) (ret bool, err error) { r0, _, e1 := syscall.SyscallN(procIsTokenRestricted.Addr(), uintptr(tokenHandle)) ret = r0 != 0 if !ret { err = errnoErr(e1) } return } func isValidSecurityDescriptor(sd *SECURITY_DESCRIPTOR) (isValid bool) { r0, _, _ := syscall.SyscallN(procIsValidSecurityDescriptor.Addr(), uintptr(unsafe.Pointer(sd))) isValid = r0 != 0 return } func isValidSid(sid *SID) (isValid bool) { r0, _, _ := syscall.SyscallN(procIsValidSid.Addr(), uintptr(unsafe.Pointer(sid))) isValid = r0 != 0 return } func isWellKnownSid(sid *SID, sidType WELL_KNOWN_SID_TYPE) (isWellKnown bool) { r0, _, _ := syscall.SyscallN(procIsWellKnownSid.Addr(), uintptr(unsafe.Pointer(sid)), uintptr(sidType)) isWellKnown = r0 != 0 return } func LookupAccountName(systemName *uint16, accountName *uint16, sid *SID, sidLen *uint32, refdDomainName *uint16, refdDomainNameLen *uint32, use *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procLookupAccountNameW.Addr(), 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))) if r1 == 0 { err = errnoErr(e1) } return } func LookupAccountSid(systemName *uint16, sid *SID, name *uint16, nameLen *uint32, refdDomainName *uint16, refdDomainNameLen *uint32, use *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procLookupAccountSidW.Addr(), 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))) if r1 == 0 { err = errnoErr(e1) } return } func LookupPrivilegeValue(systemname *uint16, name *uint16, luid *LUID) (err error) { r1, _, e1 := syscall.SyscallN(procLookupPrivilegeValueW.Addr(), uintptr(unsafe.Pointer(systemname)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(luid))) if r1 == 0 { err = errnoErr(e1) } return } func makeAbsoluteSD(selfRelativeSD *SECURITY_DESCRIPTOR, absoluteSD *SECURITY_DESCRIPTOR, absoluteSDSize *uint32, dacl *ACL, daclSize *uint32, sacl *ACL, saclSize *uint32, owner *SID, ownerSize *uint32, group *SID, groupSize *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procMakeAbsoluteSD.Addr(), uintptr(unsafe.Pointer(selfRelativeSD)), uintptr(unsafe.Pointer(absoluteSD)), uintptr(unsafe.Pointer(absoluteSDSize)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(daclSize)), uintptr(unsafe.Pointer(sacl)), uintptr(unsafe.Pointer(saclSize)), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(ownerSize)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(groupSize))) if r1 == 0 { err = errnoErr(e1) } return } func makeSelfRelativeSD(absoluteSD *SECURITY_DESCRIPTOR, selfRelativeSD *SECURITY_DESCRIPTOR, selfRelativeSDSize *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procMakeSelfRelativeSD.Addr(), uintptr(unsafe.Pointer(absoluteSD)), uintptr(unsafe.Pointer(selfRelativeSD)), uintptr(unsafe.Pointer(selfRelativeSDSize))) if r1 == 0 { err = errnoErr(e1) } return } func NotifyServiceStatusChange(service Handle, notifyMask uint32, notifier *SERVICE_NOTIFY) (ret error) { r0, _, _ := syscall.SyscallN(procNotifyServiceStatusChangeW.Addr(), uintptr(service), uintptr(notifyMask), uintptr(unsafe.Pointer(notifier))) if r0 != 0 { ret = syscall.Errno(r0) } return } func OpenProcessToken(process Handle, access uint32, token *Token) (err error) { r1, _, e1 := syscall.SyscallN(procOpenProcessToken.Addr(), uintptr(process), uintptr(access), uintptr(unsafe.Pointer(token))) if r1 == 0 { err = errnoErr(e1) } return } func OpenSCManager(machineName *uint16, databaseName *uint16, access uint32) (handle Handle, err error) { r0, _, e1 := syscall.SyscallN(procOpenSCManagerW.Addr(), uintptr(unsafe.Pointer(machineName)), uintptr(unsafe.Pointer(databaseName)), uintptr(access)) handle = Handle(r0) if handle == 0 { err = errnoErr(e1) } return } func OpenService(mgr Handle, serviceName *uint16, access uint32) (handle Handle, err error) { r0, _, e1 := syscall.SyscallN(procOpenServiceW.Addr(), uintptr(mgr), uintptr(unsafe.Pointer(serviceName)), uintptr(access)) handle = Handle(r0) if handle == 0 { err = errnoErr(e1) } return } func OpenThreadToken(thread Handle, access uint32, openAsSelf bool, token *Token) (err error) { var _p0 uint32 if openAsSelf { _p0 = 1 } r1, _, e1 := syscall.SyscallN(procOpenThreadToken.Addr(), uintptr(thread), uintptr(access), uintptr(_p0), uintptr(unsafe.Pointer(token))) if r1 == 0 { err = errnoErr(e1) } return } func QueryServiceConfig2(service Handle, infoLevel uint32, buff *byte, buffSize uint32, bytesNeeded *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procQueryServiceConfig2W.Addr(), uintptr(service), uintptr(infoLevel), uintptr(unsafe.Pointer(buff)), uintptr(buffSize), uintptr(unsafe.Pointer(bytesNeeded))) if r1 == 0 { err = errnoErr(e1) } return } func QueryServiceConfig(service Handle, serviceConfig *QUERY_SERVICE_CONFIG, bufSize uint32, bytesNeeded *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procQueryServiceConfigW.Addr(), uintptr(service), uintptr(unsafe.Pointer(serviceConfig)), uintptr(bufSize), uintptr(unsafe.Pointer(bytesNeeded))) if r1 == 0 { err = errnoErr(e1) } return } func QueryServiceDynamicInformation(service Handle, infoLevel uint32, dynamicInfo unsafe.Pointer) (err error) { err = procQueryServiceDynamicInformation.Find() if err != nil { return } r1, _, e1 := syscall.SyscallN(procQueryServiceDynamicInformation.Addr(), uintptr(service), uintptr(infoLevel), uintptr(dynamicInfo)) if r1 == 0 { err = errnoErr(e1) } return } func QueryServiceLockStatus(mgr Handle, lockStatus *QUERY_SERVICE_LOCK_STATUS, bufSize uint32, bytesNeeded *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procQueryServiceLockStatusW.Addr(), uintptr(mgr), uintptr(unsafe.Pointer(lockStatus)), uintptr(bufSize), uintptr(unsafe.Pointer(bytesNeeded))) if r1 == 0 { err = errnoErr(e1) } return } func QueryServiceStatus(service Handle, status *SERVICE_STATUS) (err error) { r1, _, e1 := syscall.SyscallN(procQueryServiceStatus.Addr(), uintptr(service), uintptr(unsafe.Pointer(status))) if r1 == 0 { err = errnoErr(e1) } return } func QueryServiceStatusEx(service Handle, infoLevel uint32, buff *byte, buffSize uint32, bytesNeeded *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procQueryServiceStatusEx.Addr(), uintptr(service), uintptr(infoLevel), uintptr(unsafe.Pointer(buff)), uintptr(buffSize), uintptr(unsafe.Pointer(bytesNeeded))) if r1 == 0 { err = errnoErr(e1) } return } func RegCloseKey(key Handle) (regerrno error) { r0, _, _ := syscall.SyscallN(procRegCloseKey.Addr(), uintptr(key)) if r0 != 0 { regerrno = syscall.Errno(r0) } return } func RegEnumKeyEx(key Handle, index uint32, name *uint16, nameLen *uint32, reserved *uint32, class *uint16, classLen *uint32, lastWriteTime *Filetime) (regerrno error) { r0, _, _ := syscall.SyscallN(procRegEnumKeyExW.Addr(), 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))) if r0 != 0 { regerrno = syscall.Errno(r0) } return } func RegNotifyChangeKeyValue(key Handle, watchSubtree bool, notifyFilter uint32, event Handle, asynchronous bool) (regerrno error) { var _p0 uint32 if watchSubtree { _p0 = 1 } var _p1 uint32 if asynchronous { _p1 = 1 } r0, _, _ := syscall.SyscallN(procRegNotifyChangeKeyValue.Addr(), uintptr(key), uintptr(_p0), uintptr(notifyFilter), uintptr(event), uintptr(_p1)) if r0 != 0 { regerrno = syscall.Errno(r0) } return } func RegOpenKeyEx(key Handle, subkey *uint16, options uint32, desiredAccess uint32, result *Handle) (regerrno error) { r0, _, _ := syscall.SyscallN(procRegOpenKeyExW.Addr(), uintptr(key), uintptr(unsafe.Pointer(subkey)), uintptr(options), uintptr(desiredAccess), uintptr(unsafe.Pointer(result))) if r0 != 0 { regerrno = syscall.Errno(r0) } return } func 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) { r0, _, _ := syscall.SyscallN(procRegQueryInfoKeyW.Addr(), 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))) if r0 != 0 { regerrno = syscall.Errno(r0) } return } func RegQueryValueEx(key Handle, name *uint16, reserved *uint32, valtype *uint32, buf *byte, buflen *uint32) (regerrno error) { r0, _, _ := syscall.SyscallN(procRegQueryValueExW.Addr(), uintptr(key), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(reserved)), uintptr(unsafe.Pointer(valtype)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(buflen))) if r0 != 0 { regerrno = syscall.Errno(r0) } return } func RegisterEventSource(uncServerName *uint16, sourceName *uint16) (handle Handle, err error) { r0, _, e1 := syscall.SyscallN(procRegisterEventSourceW.Addr(), uintptr(unsafe.Pointer(uncServerName)), uintptr(unsafe.Pointer(sourceName))) handle = Handle(r0) if handle == 0 { err = errnoErr(e1) } return } func RegisterServiceCtrlHandlerEx(serviceName *uint16, handlerProc uintptr, context uintptr) (handle Handle, err error) { r0, _, e1 := syscall.SyscallN(procRegisterServiceCtrlHandlerExW.Addr(), uintptr(unsafe.Pointer(serviceName)), uintptr(handlerProc), uintptr(context)) handle = Handle(r0) if handle == 0 { err = errnoErr(e1) } return } func ReportEvent(log Handle, etype uint16, category uint16, eventId uint32, usrSId uintptr, numStrings uint16, dataSize uint32, strings **uint16, rawData *byte) (err error) { r1, _, e1 := syscall.SyscallN(procReportEventW.Addr(), uintptr(log), uintptr(etype), uintptr(category), uintptr(eventId), uintptr(usrSId), uintptr(numStrings), uintptr(dataSize), uintptr(unsafe.Pointer(strings)), uintptr(unsafe.Pointer(rawData))) if r1 == 0 { err = errnoErr(e1) } return } func RevertToSelf() (err error) { r1, _, e1 := syscall.SyscallN(procRevertToSelf.Addr()) if r1 == 0 { err = errnoErr(e1) } return } func setEntriesInAcl(countExplicitEntries uint32, explicitEntries *EXPLICIT_ACCESS, oldACL *ACL, newACL **ACL) (ret error) { r0, _, _ := syscall.SyscallN(procSetEntriesInAclW.Addr(), uintptr(countExplicitEntries), uintptr(unsafe.Pointer(explicitEntries)), uintptr(unsafe.Pointer(oldACL)), uintptr(unsafe.Pointer(newACL))) if r0 != 0 { ret = syscall.Errno(r0) } return } func SetKernelObjectSecurity(handle Handle, securityInformation SECURITY_INFORMATION, securityDescriptor *SECURITY_DESCRIPTOR) (err error) { r1, _, e1 := syscall.SyscallN(procSetKernelObjectSecurity.Addr(), uintptr(handle), uintptr(securityInformation), uintptr(unsafe.Pointer(securityDescriptor))) if r1 == 0 { err = errnoErr(e1) } return } func SetNamedSecurityInfo(objectName string, objectType SE_OBJECT_TYPE, securityInformation SECURITY_INFORMATION, owner *SID, group *SID, dacl *ACL, sacl *ACL) (ret error) { var _p0 *uint16 _p0, ret = syscall.UTF16PtrFromString(objectName) if ret != nil { return } return _SetNamedSecurityInfo(_p0, objectType, securityInformation, owner, group, dacl, sacl) } func _SetNamedSecurityInfo(objectName *uint16, objectType SE_OBJECT_TYPE, securityInformation SECURITY_INFORMATION, owner *SID, group *SID, dacl *ACL, sacl *ACL) (ret error) { r0, _, _ := syscall.SyscallN(procSetNamedSecurityInfoW.Addr(), uintptr(unsafe.Pointer(objectName)), uintptr(objectType), uintptr(securityInformation), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(sacl))) if r0 != 0 { ret = syscall.Errno(r0) } return } func setSecurityDescriptorControl(sd *SECURITY_DESCRIPTOR, controlBitsOfInterest SECURITY_DESCRIPTOR_CONTROL, controlBitsToSet SECURITY_DESCRIPTOR_CONTROL) (err error) { r1, _, e1 := syscall.SyscallN(procSetSecurityDescriptorControl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(controlBitsOfInterest), uintptr(controlBitsToSet)) if r1 == 0 { err = errnoErr(e1) } return } func setSecurityDescriptorDacl(sd *SECURITY_DESCRIPTOR, daclPresent bool, dacl *ACL, daclDefaulted bool) (err error) { var _p0 uint32 if daclPresent { _p0 = 1 } var _p1 uint32 if daclDefaulted { _p1 = 1 } r1, _, e1 := syscall.SyscallN(procSetSecurityDescriptorDacl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(_p0), uintptr(unsafe.Pointer(dacl)), uintptr(_p1)) if r1 == 0 { err = errnoErr(e1) } return } func setSecurityDescriptorGroup(sd *SECURITY_DESCRIPTOR, group *SID, groupDefaulted bool) (err error) { var _p0 uint32 if groupDefaulted { _p0 = 1 } r1, _, e1 := syscall.SyscallN(procSetSecurityDescriptorGroup.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(group)), uintptr(_p0)) if r1 == 0 { err = errnoErr(e1) } return } func setSecurityDescriptorOwner(sd *SECURITY_DESCRIPTOR, owner *SID, ownerDefaulted bool) (err error) { var _p0 uint32 if ownerDefaulted { _p0 = 1 } r1, _, e1 := syscall.SyscallN(procSetSecurityDescriptorOwner.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(owner)), uintptr(_p0)) if r1 == 0 { err = errnoErr(e1) } return } func setSecurityDescriptorRMControl(sd *SECURITY_DESCRIPTOR, rmControl *uint8) { syscall.SyscallN(procSetSecurityDescriptorRMControl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(rmControl))) return } func setSecurityDescriptorSacl(sd *SECURITY_DESCRIPTOR, saclPresent bool, sacl *ACL, saclDefaulted bool) (err error) { var _p0 uint32 if saclPresent { _p0 = 1 } var _p1 uint32 if saclDefaulted { _p1 = 1 } r1, _, e1 := syscall.SyscallN(procSetSecurityDescriptorSacl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(_p0), uintptr(unsafe.Pointer(sacl)), uintptr(_p1)) if r1 == 0 { err = errnoErr(e1) } return } func SetSecurityInfo(handle Handle, objectType SE_OBJECT_TYPE, securityInformation SECURITY_INFORMATION, owner *SID, group *SID, dacl *ACL, sacl *ACL) (ret error) { r0, _, _ := syscall.SyscallN(procSetSecurityInfo.Addr(), uintptr(handle), uintptr(objectType), uintptr(securityInformation), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(sacl))) if r0 != 0 { ret = syscall.Errno(r0) } return } func SetServiceStatus(service Handle, serviceStatus *SERVICE_STATUS) (err error) { r1, _, e1 := syscall.SyscallN(procSetServiceStatus.Addr(), uintptr(service), uintptr(unsafe.Pointer(serviceStatus))) if r1 == 0 { err = errnoErr(e1) } return } func SetThreadToken(thread *Handle, token Token) (err error) { r1, _, e1 := syscall.SyscallN(procSetThreadToken.Addr(), uintptr(unsafe.Pointer(thread)), uintptr(token)) if r1 == 0 { err = errnoErr(e1) } return } func SetTokenInformation(token Token, infoClass uint32, info *byte, infoLen uint32) (err error) { r1, _, e1 := syscall.SyscallN(procSetTokenInformation.Addr(), uintptr(token), uintptr(infoClass), uintptr(unsafe.Pointer(info)), uintptr(infoLen)) if r1 == 0 { err = errnoErr(e1) } return } func StartServiceCtrlDispatcher(serviceTable *SERVICE_TABLE_ENTRY) (err error) { r1, _, e1 := syscall.SyscallN(procStartServiceCtrlDispatcherW.Addr(), uintptr(unsafe.Pointer(serviceTable))) if r1 == 0 { err = errnoErr(e1) } return } func StartService(service Handle, numArgs uint32, argVectors **uint16) (err error) { r1, _, e1 := syscall.SyscallN(procStartServiceW.Addr(), uintptr(service), uintptr(numArgs), uintptr(unsafe.Pointer(argVectors))) if r1 == 0 { err = errnoErr(e1) } return } func CertAddCertificateContextToStore(store Handle, certContext *CertContext, addDisposition uint32, storeContext **CertContext) (err error) { r1, _, e1 := syscall.SyscallN(procCertAddCertificateContextToStore.Addr(), uintptr(store), uintptr(unsafe.Pointer(certContext)), uintptr(addDisposition), uintptr(unsafe.Pointer(storeContext))) if r1 == 0 { err = errnoErr(e1) } return } func CertCloseStore(store Handle, flags uint32) (err error) { r1, _, e1 := syscall.SyscallN(procCertCloseStore.Addr(), uintptr(store), uintptr(flags)) if r1 == 0 { err = errnoErr(e1) } return } func CertCreateCertificateContext(certEncodingType uint32, certEncoded *byte, encodedLen uint32) (context *CertContext, err error) { r0, _, e1 := syscall.SyscallN(procCertCreateCertificateContext.Addr(), uintptr(certEncodingType), uintptr(unsafe.Pointer(certEncoded)), uintptr(encodedLen)) context = (*CertContext)(unsafe.Pointer(r0)) if context == nil { err = errnoErr(e1) } return } func CertDeleteCertificateFromStore(certContext *CertContext) (err error) { r1, _, e1 := syscall.SyscallN(procCertDeleteCertificateFromStore.Addr(), uintptr(unsafe.Pointer(certContext))) if r1 == 0 { err = errnoErr(e1) } return } func CertDuplicateCertificateContext(certContext *CertContext) (dupContext *CertContext) { r0, _, _ := syscall.SyscallN(procCertDuplicateCertificateContext.Addr(), uintptr(unsafe.Pointer(certContext))) dupContext = (*CertContext)(unsafe.Pointer(r0)) return } func CertEnumCertificatesInStore(store Handle, prevContext *CertContext) (context *CertContext, err error) { r0, _, e1 := syscall.SyscallN(procCertEnumCertificatesInStore.Addr(), uintptr(store), uintptr(unsafe.Pointer(prevContext))) context = (*CertContext)(unsafe.Pointer(r0)) if context == nil { err = errnoErr(e1) } return } func CertFindCertificateInStore(store Handle, certEncodingType uint32, findFlags uint32, findType uint32, findPara unsafe.Pointer, prevCertContext *CertContext) (cert *CertContext, err error) { r0, _, e1 := syscall.SyscallN(procCertFindCertificateInStore.Addr(), uintptr(store), uintptr(certEncodingType), uintptr(findFlags), uintptr(findType), uintptr(findPara), uintptr(unsafe.Pointer(prevCertContext))) cert = (*CertContext)(unsafe.Pointer(r0)) if cert == nil { err = errnoErr(e1) } return } func CertFindChainInStore(store Handle, certEncodingType uint32, findFlags uint32, findType uint32, findPara unsafe.Pointer, prevChainContext *CertChainContext) (certchain *CertChainContext, err error) { r0, _, e1 := syscall.SyscallN(procCertFindChainInStore.Addr(), uintptr(store), uintptr(certEncodingType), uintptr(findFlags), uintptr(findType), uintptr(findPara), uintptr(unsafe.Pointer(prevChainContext))) certchain = (*CertChainContext)(unsafe.Pointer(r0)) if certchain == nil { err = errnoErr(e1) } return } func CertFindExtension(objId *byte, countExtensions uint32, extensions *CertExtension) (ret *CertExtension) { r0, _, _ := syscall.SyscallN(procCertFindExtension.Addr(), uintptr(unsafe.Pointer(objId)), uintptr(countExtensions), uintptr(unsafe.Pointer(extensions))) ret = (*CertExtension)(unsafe.Pointer(r0)) return } func CertFreeCertificateChain(ctx *CertChainContext) { syscall.SyscallN(procCertFreeCertificateChain.Addr(), uintptr(unsafe.Pointer(ctx))) return } func CertFreeCertificateContext(ctx *CertContext) (err error) { r1, _, e1 := syscall.SyscallN(procCertFreeCertificateContext.Addr(), uintptr(unsafe.Pointer(ctx))) if r1 == 0 { err = errnoErr(e1) } return } func CertGetCertificateChain(engine Handle, leaf *CertContext, time *Filetime, additionalStore Handle, para *CertChainPara, flags uint32, reserved uintptr, chainCtx **CertChainContext) (err error) { r1, _, e1 := syscall.SyscallN(procCertGetCertificateChain.Addr(), uintptr(engine), uintptr(unsafe.Pointer(leaf)), uintptr(unsafe.Pointer(time)), uintptr(additionalStore), uintptr(unsafe.Pointer(para)), uintptr(flags), uintptr(reserved), uintptr(unsafe.Pointer(chainCtx))) if r1 == 0 { err = errnoErr(e1) } return } func CertGetNameString(certContext *CertContext, nameType uint32, flags uint32, typePara unsafe.Pointer, name *uint16, size uint32) (chars uint32) { r0, _, _ := syscall.SyscallN(procCertGetNameStringW.Addr(), uintptr(unsafe.Pointer(certContext)), uintptr(nameType), uintptr(flags), uintptr(typePara), uintptr(unsafe.Pointer(name)), uintptr(size)) chars = uint32(r0) return } func CertOpenStore(storeProvider uintptr, msgAndCertEncodingType uint32, cryptProv uintptr, flags uint32, para uintptr) (handle Handle, err error) { r0, _, e1 := syscall.SyscallN(procCertOpenStore.Addr(), uintptr(storeProvider), uintptr(msgAndCertEncodingType), uintptr(cryptProv), uintptr(flags), uintptr(para)) handle = Handle(r0) if handle == 0 { err = errnoErr(e1) } return } func CertOpenSystemStore(hprov Handle, name *uint16) (store Handle, err error) { r0, _, e1 := syscall.SyscallN(procCertOpenSystemStoreW.Addr(), uintptr(hprov), uintptr(unsafe.Pointer(name))) store = Handle(r0) if store == 0 { err = errnoErr(e1) } return } func CertVerifyCertificateChainPolicy(policyOID uintptr, chain *CertChainContext, para *CertChainPolicyPara, status *CertChainPolicyStatus) (err error) { r1, _, e1 := syscall.SyscallN(procCertVerifyCertificateChainPolicy.Addr(), uintptr(policyOID), uintptr(unsafe.Pointer(chain)), uintptr(unsafe.Pointer(para)), uintptr(unsafe.Pointer(status))) if r1 == 0 { err = errnoErr(e1) } return } func CryptAcquireCertificatePrivateKey(cert *CertContext, flags uint32, parameters unsafe.Pointer, cryptProvOrNCryptKey *Handle, keySpec *uint32, callerFreeProvOrNCryptKey *bool) (err error) { var _p0 uint32 if *callerFreeProvOrNCryptKey { _p0 = 1 } r1, _, e1 := syscall.SyscallN(procCryptAcquireCertificatePrivateKey.Addr(), uintptr(unsafe.Pointer(cert)), uintptr(flags), uintptr(parameters), uintptr(unsafe.Pointer(cryptProvOrNCryptKey)), uintptr(unsafe.Pointer(keySpec)), uintptr(unsafe.Pointer(&_p0))) *callerFreeProvOrNCryptKey = _p0 != 0 if r1 == 0 { err = errnoErr(e1) } return } func CryptDecodeObject(encodingType uint32, structType *byte, encodedBytes *byte, lenEncodedBytes uint32, flags uint32, decoded unsafe.Pointer, decodedLen *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procCryptDecodeObject.Addr(), uintptr(encodingType), uintptr(unsafe.Pointer(structType)), uintptr(unsafe.Pointer(encodedBytes)), uintptr(lenEncodedBytes), uintptr(flags), uintptr(decoded), uintptr(unsafe.Pointer(decodedLen))) if r1 == 0 { err = errnoErr(e1) } return } func CryptProtectData(dataIn *DataBlob, name *uint16, optionalEntropy *DataBlob, reserved uintptr, promptStruct *CryptProtectPromptStruct, flags uint32, dataOut *DataBlob) (err error) { r1, _, e1 := syscall.SyscallN(procCryptProtectData.Addr(), uintptr(unsafe.Pointer(dataIn)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(optionalEntropy)), uintptr(reserved), uintptr(unsafe.Pointer(promptStruct)), uintptr(flags), uintptr(unsafe.Pointer(dataOut))) if r1 == 0 { err = errnoErr(e1) } return } func CryptQueryObject(objectType uint32, object unsafe.Pointer, expectedContentTypeFlags uint32, expectedFormatTypeFlags uint32, flags uint32, msgAndCertEncodingType *uint32, contentType *uint32, formatType *uint32, certStore *Handle, msg *Handle, context *unsafe.Pointer) (err error) { r1, _, e1 := syscall.SyscallN(procCryptQueryObject.Addr(), uintptr(objectType), uintptr(object), uintptr(expectedContentTypeFlags), uintptr(expectedFormatTypeFlags), uintptr(flags), uintptr(unsafe.Pointer(msgAndCertEncodingType)), uintptr(unsafe.Pointer(contentType)), uintptr(unsafe.Pointer(formatType)), uintptr(unsafe.Pointer(certStore)), uintptr(unsafe.Pointer(msg)), uintptr(unsafe.Pointer(context))) if r1 == 0 { err = errnoErr(e1) } return } func CryptUnprotectData(dataIn *DataBlob, name **uint16, optionalEntropy *DataBlob, reserved uintptr, promptStruct *CryptProtectPromptStruct, flags uint32, dataOut *DataBlob) (err error) { r1, _, e1 := syscall.SyscallN(procCryptUnprotectData.Addr(), uintptr(unsafe.Pointer(dataIn)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(optionalEntropy)), uintptr(reserved), uintptr(unsafe.Pointer(promptStruct)), uintptr(flags), uintptr(unsafe.Pointer(dataOut))) if r1 == 0 { err = errnoErr(e1) } return } func PFXImportCertStore(pfx *CryptDataBlob, password *uint16, flags uint32) (store Handle, err error) { r0, _, e1 := syscall.SyscallN(procPFXImportCertStore.Addr(), uintptr(unsafe.Pointer(pfx)), uintptr(unsafe.Pointer(password)), uintptr(flags)) store = Handle(r0) if store == 0 { err = errnoErr(e1) } return } func DnsNameCompare(name1 *uint16, name2 *uint16) (same bool) { r0, _, _ := syscall.SyscallN(procDnsNameCompare_W.Addr(), uintptr(unsafe.Pointer(name1)), uintptr(unsafe.Pointer(name2))) same = r0 != 0 return } func DnsQuery(name string, qtype uint16, options uint32, extra *byte, qrs **DNSRecord, pr *byte) (status error) { var _p0 *uint16 _p0, status = syscall.UTF16PtrFromString(name) if status != nil { return } return _DnsQuery(_p0, qtype, options, extra, qrs, pr) } func _DnsQuery(name *uint16, qtype uint16, options uint32, extra *byte, qrs **DNSRecord, pr *byte) (status error) { r0, _, _ := syscall.SyscallN(procDnsQuery_W.Addr(), uintptr(unsafe.Pointer(name)), uintptr(qtype), uintptr(options), uintptr(unsafe.Pointer(extra)), uintptr(unsafe.Pointer(qrs)), uintptr(unsafe.Pointer(pr))) if r0 != 0 { status = syscall.Errno(r0) } return } func DnsRecordListFree(rl *DNSRecord, freetype uint32) { syscall.SyscallN(procDnsRecordListFree.Addr(), uintptr(unsafe.Pointer(rl)), uintptr(freetype)) return } func DwmGetWindowAttribute(hwnd HWND, attribute uint32, value unsafe.Pointer, size uint32) (ret error) { r0, _, _ := syscall.SyscallN(procDwmGetWindowAttribute.Addr(), uintptr(hwnd), uintptr(attribute), uintptr(value), uintptr(size)) if r0 != 0 { ret = syscall.Errno(r0) } return } func DwmSetWindowAttribute(hwnd HWND, attribute uint32, value unsafe.Pointer, size uint32) (ret error) { r0, _, _ := syscall.SyscallN(procDwmSetWindowAttribute.Addr(), uintptr(hwnd), uintptr(attribute), uintptr(value), uintptr(size)) if r0 != 0 { ret = syscall.Errno(r0) } return } func CancelMibChangeNotify2(notificationHandle Handle) (errcode error) { r0, _, _ := syscall.SyscallN(procCancelMibChangeNotify2.Addr(), uintptr(notificationHandle)) if r0 != 0 { errcode = syscall.Errno(r0) } return } func FreeMibTable(memory unsafe.Pointer) { syscall.SyscallN(procFreeMibTable.Addr(), uintptr(memory)) return } func GetAdaptersAddresses(family uint32, flags uint32, reserved uintptr, adapterAddresses *IpAdapterAddresses, sizePointer *uint32) (errcode error) { r0, _, _ := syscall.SyscallN(procGetAdaptersAddresses.Addr(), uintptr(family), uintptr(flags), uintptr(reserved), uintptr(unsafe.Pointer(adapterAddresses)), uintptr(unsafe.Pointer(sizePointer))) if r0 != 0 { errcode = syscall.Errno(r0) } return } func GetAdaptersInfo(ai *IpAdapterInfo, ol *uint32) (errcode error) { r0, _, _ := syscall.SyscallN(procGetAdaptersInfo.Addr(), uintptr(unsafe.Pointer(ai)), uintptr(unsafe.Pointer(ol))) if r0 != 0 { errcode = syscall.Errno(r0) } return } func getBestInterfaceEx(sockaddr unsafe.Pointer, pdwBestIfIndex *uint32) (errcode error) { r0, _, _ := syscall.SyscallN(procGetBestInterfaceEx.Addr(), uintptr(sockaddr), uintptr(unsafe.Pointer(pdwBestIfIndex))) if r0 != 0 { errcode = syscall.Errno(r0) } return } func GetIfEntry(pIfRow *MibIfRow) (errcode error) { r0, _, _ := syscall.SyscallN(procGetIfEntry.Addr(), uintptr(unsafe.Pointer(pIfRow))) if r0 != 0 { errcode = syscall.Errno(r0) } return } func GetIfEntry2Ex(level uint32, row *MibIfRow2) (errcode error) { r0, _, _ := syscall.SyscallN(procGetIfEntry2Ex.Addr(), uintptr(level), uintptr(unsafe.Pointer(row))) if r0 != 0 { errcode = syscall.Errno(r0) } return } func GetIpForwardEntry2(row *MibIpForwardRow2) (errcode error) { r0, _, _ := syscall.SyscallN(procGetIpForwardEntry2.Addr(), uintptr(unsafe.Pointer(row))) if r0 != 0 { errcode = syscall.Errno(r0) } return } func GetIpForwardTable2(family uint16, table **MibIpForwardTable2) (errcode error) { r0, _, _ := syscall.SyscallN(procGetIpForwardTable2.Addr(), uintptr(family), uintptr(unsafe.Pointer(table))) if r0 != 0 { errcode = syscall.Errno(r0) } return } func GetUnicastIpAddressEntry(row *MibUnicastIpAddressRow) (errcode error) { r0, _, _ := syscall.SyscallN(procGetUnicastIpAddressEntry.Addr(), uintptr(unsafe.Pointer(row))) if r0 != 0 { errcode = syscall.Errno(r0) } return } func NotifyIpInterfaceChange(family uint16, callback uintptr, callerContext unsafe.Pointer, initialNotification bool, notificationHandle *Handle) (errcode error) { var _p0 uint32 if initialNotification { _p0 = 1 } r0, _, _ := syscall.SyscallN(procNotifyIpInterfaceChange.Addr(), uintptr(family), uintptr(callback), uintptr(callerContext), uintptr(_p0), uintptr(unsafe.Pointer(notificationHandle))) if r0 != 0 { errcode = syscall.Errno(r0) } return } func NotifyRouteChange2(family uint16, callback uintptr, callerContext unsafe.Pointer, initialNotification bool, notificationHandle *Handle) (errcode error) { var _p0 uint32 if initialNotification { _p0 = 1 } r0, _, _ := syscall.SyscallN(procNotifyRouteChange2.Addr(), uintptr(family), uintptr(callback), uintptr(callerContext), uintptr(_p0), uintptr(unsafe.Pointer(notificationHandle))) if r0 != 0 { errcode = syscall.Errno(r0) } return } func NotifyUnicastIpAddressChange(family uint16, callback uintptr, callerContext unsafe.Pointer, initialNotification bool, notificationHandle *Handle) (errcode error) { var _p0 uint32 if initialNotification { _p0 = 1 } r0, _, _ := syscall.SyscallN(procNotifyUnicastIpAddressChange.Addr(), uintptr(family), uintptr(callback), uintptr(callerContext), uintptr(_p0), uintptr(unsafe.Pointer(notificationHandle))) if r0 != 0 { errcode = syscall.Errno(r0) } return } func AddDllDirectory(path *uint16) (cookie uintptr, err error) { r0, _, e1 := syscall.SyscallN(procAddDllDirectory.Addr(), uintptr(unsafe.Pointer(path))) cookie = uintptr(r0) if cookie == 0 { err = errnoErr(e1) } return } func AssignProcessToJobObject(job Handle, process Handle) (err error) { r1, _, e1 := syscall.SyscallN(procAssignProcessToJobObject.Addr(), uintptr(job), uintptr(process)) if r1 == 0 { err = errnoErr(e1) } return } func CancelIo(s Handle) (err error) { r1, _, e1 := syscall.SyscallN(procCancelIo.Addr(), uintptr(s)) if r1 == 0 { err = errnoErr(e1) } return } func CancelIoEx(s Handle, o *Overlapped) (err error) { r1, _, e1 := syscall.SyscallN(procCancelIoEx.Addr(), uintptr(s), uintptr(unsafe.Pointer(o))) if r1 == 0 { err = errnoErr(e1) } return } func ClearCommBreak(handle Handle) (err error) { r1, _, e1 := syscall.SyscallN(procClearCommBreak.Addr(), uintptr(handle)) if r1 == 0 { err = errnoErr(e1) } return } func ClearCommError(handle Handle, lpErrors *uint32, lpStat *ComStat) (err error) { r1, _, e1 := syscall.SyscallN(procClearCommError.Addr(), uintptr(handle), uintptr(unsafe.Pointer(lpErrors)), uintptr(unsafe.Pointer(lpStat))) if r1 == 0 { err = errnoErr(e1) } return } func CloseHandle(handle Handle) (err error) { r1, _, e1 := syscall.SyscallN(procCloseHandle.Addr(), uintptr(handle)) if r1 == 0 { err = errnoErr(e1) } return } func ClosePseudoConsole(console Handle) { syscall.SyscallN(procClosePseudoConsole.Addr(), uintptr(console)) return } func ConnectNamedPipe(pipe Handle, overlapped *Overlapped) (err error) { r1, _, e1 := syscall.SyscallN(procConnectNamedPipe.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(overlapped))) if r1 == 0 { err = errnoErr(e1) } return } func CreateDirectory(path *uint16, sa *SecurityAttributes) (err error) { r1, _, e1 := syscall.SyscallN(procCreateDirectoryW.Addr(), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(sa))) if r1 == 0 { err = errnoErr(e1) } return } func CreateEventEx(eventAttrs *SecurityAttributes, name *uint16, flags uint32, desiredAccess uint32) (handle Handle, err error) { r0, _, e1 := syscall.SyscallN(procCreateEventExW.Addr(), uintptr(unsafe.Pointer(eventAttrs)), uintptr(unsafe.Pointer(name)), uintptr(flags), uintptr(desiredAccess)) handle = Handle(r0) if handle == 0 || e1 == ERROR_ALREADY_EXISTS { err = errnoErr(e1) } return } func CreateEvent(eventAttrs *SecurityAttributes, manualReset uint32, initialState uint32, name *uint16) (handle Handle, err error) { r0, _, e1 := syscall.SyscallN(procCreateEventW.Addr(), uintptr(unsafe.Pointer(eventAttrs)), uintptr(manualReset), uintptr(initialState), uintptr(unsafe.Pointer(name))) handle = Handle(r0) if handle == 0 || e1 == ERROR_ALREADY_EXISTS { err = errnoErr(e1) } return } func CreateFileMapping(fhandle Handle, sa *SecurityAttributes, prot uint32, maxSizeHigh uint32, maxSizeLow uint32, name *uint16) (handle Handle, err error) { r0, _, e1 := syscall.SyscallN(procCreateFileMappingW.Addr(), uintptr(fhandle), uintptr(unsafe.Pointer(sa)), uintptr(prot), uintptr(maxSizeHigh), uintptr(maxSizeLow), uintptr(unsafe.Pointer(name))) handle = Handle(r0) if handle == 0 || e1 == ERROR_ALREADY_EXISTS { err = errnoErr(e1) } return } func CreateFile(name *uint16, access uint32, mode uint32, sa *SecurityAttributes, createmode uint32, attrs uint32, templatefile Handle) (handle Handle, err error) { r0, _, e1 := syscall.SyscallN(procCreateFileW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(access), uintptr(mode), uintptr(unsafe.Pointer(sa)), uintptr(createmode), uintptr(attrs), uintptr(templatefile)) handle = Handle(r0) if handle == InvalidHandle { err = errnoErr(e1) } return } func CreateHardLink(filename *uint16, existingfilename *uint16, reserved uintptr) (err error) { r1, _, e1 := syscall.SyscallN(procCreateHardLinkW.Addr(), uintptr(unsafe.Pointer(filename)), uintptr(unsafe.Pointer(existingfilename)), uintptr(reserved)) if r1&0xff == 0 { err = errnoErr(e1) } return } func CreateIoCompletionPort(filehandle Handle, cphandle Handle, key uintptr, threadcnt uint32) (handle Handle, err error) { r0, _, e1 := syscall.SyscallN(procCreateIoCompletionPort.Addr(), uintptr(filehandle), uintptr(cphandle), uintptr(key), uintptr(threadcnt)) handle = Handle(r0) if handle == 0 { err = errnoErr(e1) } return } func CreateJobObject(jobAttr *SecurityAttributes, name *uint16) (handle Handle, err error) { r0, _, e1 := syscall.SyscallN(procCreateJobObjectW.Addr(), uintptr(unsafe.Pointer(jobAttr)), uintptr(unsafe.Pointer(name))) handle = Handle(r0) if handle == 0 { err = errnoErr(e1) } return } func CreateMutexEx(mutexAttrs *SecurityAttributes, name *uint16, flags uint32, desiredAccess uint32) (handle Handle, err error) { r0, _, e1 := syscall.SyscallN(procCreateMutexExW.Addr(), uintptr(unsafe.Pointer(mutexAttrs)), uintptr(unsafe.Pointer(name)), uintptr(flags), uintptr(desiredAccess)) handle = Handle(r0) if handle == 0 || e1 == ERROR_ALREADY_EXISTS { err = errnoErr(e1) } return } func CreateMutex(mutexAttrs *SecurityAttributes, initialOwner bool, name *uint16) (handle Handle, err error) { var _p0 uint32 if initialOwner { _p0 = 1 } r0, _, e1 := syscall.SyscallN(procCreateMutexW.Addr(), uintptr(unsafe.Pointer(mutexAttrs)), uintptr(_p0), uintptr(unsafe.Pointer(name))) handle = Handle(r0) if handle == 0 || e1 == ERROR_ALREADY_EXISTS { err = errnoErr(e1) } return } func CreateNamedPipe(name *uint16, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *SecurityAttributes) (handle Handle, err error) { r0, _, e1 := syscall.SyscallN(procCreateNamedPipeW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(flags), uintptr(pipeMode), uintptr(maxInstances), uintptr(outSize), uintptr(inSize), uintptr(defaultTimeout), uintptr(unsafe.Pointer(sa))) handle = Handle(r0) if handle == InvalidHandle { err = errnoErr(e1) } return } func CreatePipe(readhandle *Handle, writehandle *Handle, sa *SecurityAttributes, size uint32) (err error) { r1, _, e1 := syscall.SyscallN(procCreatePipe.Addr(), uintptr(unsafe.Pointer(readhandle)), uintptr(unsafe.Pointer(writehandle)), uintptr(unsafe.Pointer(sa)), uintptr(size)) if r1 == 0 { err = errnoErr(e1) } return } func CreateProcess(appName *uint16, commandLine *uint16, procSecurity *SecurityAttributes, threadSecurity *SecurityAttributes, inheritHandles bool, creationFlags uint32, env *uint16, currentDir *uint16, startupInfo *StartupInfo, outProcInfo *ProcessInformation) (err error) { var _p0 uint32 if inheritHandles { _p0 = 1 } r1, _, e1 := syscall.SyscallN(procCreateProcessW.Addr(), 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))) if r1 == 0 { err = errnoErr(e1) } return } func createPseudoConsole(size uint32, in Handle, out Handle, flags uint32, pconsole *Handle) (hr error) { r0, _, _ := syscall.SyscallN(procCreatePseudoConsole.Addr(), uintptr(size), uintptr(in), uintptr(out), uintptr(flags), uintptr(unsafe.Pointer(pconsole))) if r0 != 0 { hr = syscall.Errno(r0) } return } func CreateSymbolicLink(symlinkfilename *uint16, targetfilename *uint16, flags uint32) (err error) { r1, _, e1 := syscall.SyscallN(procCreateSymbolicLinkW.Addr(), uintptr(unsafe.Pointer(symlinkfilename)), uintptr(unsafe.Pointer(targetfilename)), uintptr(flags)) if r1&0xff == 0 { err = errnoErr(e1) } return } func CreateToolhelp32Snapshot(flags uint32, processId uint32) (handle Handle, err error) { r0, _, e1 := syscall.SyscallN(procCreateToolhelp32Snapshot.Addr(), uintptr(flags), uintptr(processId)) handle = Handle(r0) if handle == InvalidHandle { err = errnoErr(e1) } return } func DefineDosDevice(flags uint32, deviceName *uint16, targetPath *uint16) (err error) { r1, _, e1 := syscall.SyscallN(procDefineDosDeviceW.Addr(), uintptr(flags), uintptr(unsafe.Pointer(deviceName)), uintptr(unsafe.Pointer(targetPath))) if r1 == 0 { err = errnoErr(e1) } return } func DeleteFile(path *uint16) (err error) { r1, _, e1 := syscall.SyscallN(procDeleteFileW.Addr(), uintptr(unsafe.Pointer(path))) if r1 == 0 { err = errnoErr(e1) } return } func deleteProcThreadAttributeList(attrlist *ProcThreadAttributeList) { syscall.SyscallN(procDeleteProcThreadAttributeList.Addr(), uintptr(unsafe.Pointer(attrlist))) return } func DeleteVolumeMountPoint(volumeMountPoint *uint16) (err error) { r1, _, e1 := syscall.SyscallN(procDeleteVolumeMountPointW.Addr(), uintptr(unsafe.Pointer(volumeMountPoint))) if r1 == 0 { err = errnoErr(e1) } return } func DeviceIoControl(handle Handle, ioControlCode uint32, inBuffer *byte, inBufferSize uint32, outBuffer *byte, outBufferSize uint32, bytesReturned *uint32, overlapped *Overlapped) (err error) { r1, _, e1 := syscall.SyscallN(procDeviceIoControl.Addr(), uintptr(handle), uintptr(ioControlCode), uintptr(unsafe.Pointer(inBuffer)), uintptr(inBufferSize), uintptr(unsafe.Pointer(outBuffer)), uintptr(outBufferSize), uintptr(unsafe.Pointer(bytesReturned)), uintptr(unsafe.Pointer(overlapped))) if r1 == 0 { err = errnoErr(e1) } return } func DisconnectNamedPipe(pipe Handle) (err error) { r1, _, e1 := syscall.SyscallN(procDisconnectNamedPipe.Addr(), uintptr(pipe)) if r1 == 0 { err = errnoErr(e1) } return } func DuplicateHandle(hSourceProcessHandle Handle, hSourceHandle Handle, hTargetProcessHandle Handle, lpTargetHandle *Handle, dwDesiredAccess uint32, bInheritHandle bool, dwOptions uint32) (err error) { var _p0 uint32 if bInheritHandle { _p0 = 1 } r1, _, e1 := syscall.SyscallN(procDuplicateHandle.Addr(), uintptr(hSourceProcessHandle), uintptr(hSourceHandle), uintptr(hTargetProcessHandle), uintptr(unsafe.Pointer(lpTargetHandle)), uintptr(dwDesiredAccess), uintptr(_p0), uintptr(dwOptions)) if r1 == 0 { err = errnoErr(e1) } return } func EscapeCommFunction(handle Handle, dwFunc uint32) (err error) { r1, _, e1 := syscall.SyscallN(procEscapeCommFunction.Addr(), uintptr(handle), uintptr(dwFunc)) if r1 == 0 { err = errnoErr(e1) } return } func ExitProcess(exitcode uint32) { syscall.SyscallN(procExitProcess.Addr(), uintptr(exitcode)) return } func ExpandEnvironmentStrings(src *uint16, dst *uint16, size uint32) (n uint32, err error) { r0, _, e1 := syscall.SyscallN(procExpandEnvironmentStringsW.Addr(), uintptr(unsafe.Pointer(src)), uintptr(unsafe.Pointer(dst)), uintptr(size)) n = uint32(r0) if n == 0 { err = errnoErr(e1) } return } func FindClose(handle Handle) (err error) { r1, _, e1 := syscall.SyscallN(procFindClose.Addr(), uintptr(handle)) if r1 == 0 { err = errnoErr(e1) } return } func FindCloseChangeNotification(handle Handle) (err error) { r1, _, e1 := syscall.SyscallN(procFindCloseChangeNotification.Addr(), uintptr(handle)) if r1 == 0 { err = errnoErr(e1) } return } func FindFirstChangeNotification(path string, watchSubtree bool, notifyFilter uint32) (handle Handle, err error) { var _p0 *uint16 _p0, err = syscall.UTF16PtrFromString(path) if err != nil { return } return _FindFirstChangeNotification(_p0, watchSubtree, notifyFilter) } func _FindFirstChangeNotification(path *uint16, watchSubtree bool, notifyFilter uint32) (handle Handle, err error) { var _p1 uint32 if watchSubtree { _p1 = 1 } r0, _, e1 := syscall.SyscallN(procFindFirstChangeNotificationW.Addr(), uintptr(unsafe.Pointer(path)), uintptr(_p1), uintptr(notifyFilter)) handle = Handle(r0) if handle == InvalidHandle { err = errnoErr(e1) } return } func findFirstFile1(name *uint16, data *win32finddata1) (handle Handle, err error) { r0, _, e1 := syscall.SyscallN(procFindFirstFileW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(data))) handle = Handle(r0) if handle == InvalidHandle { err = errnoErr(e1) } return } func FindFirstVolumeMountPoint(rootPathName *uint16, volumeMountPoint *uint16, bufferLength uint32) (handle Handle, err error) { r0, _, e1 := syscall.SyscallN(procFindFirstVolumeMountPointW.Addr(), uintptr(unsafe.Pointer(rootPathName)), uintptr(unsafe.Pointer(volumeMountPoint)), uintptr(bufferLength)) handle = Handle(r0) if handle == InvalidHandle { err = errnoErr(e1) } return } func FindFirstVolume(volumeName *uint16, bufferLength uint32) (handle Handle, err error) { r0, _, e1 := syscall.SyscallN(procFindFirstVolumeW.Addr(), uintptr(unsafe.Pointer(volumeName)), uintptr(bufferLength)) handle = Handle(r0) if handle == InvalidHandle { err = errnoErr(e1) } return } func FindNextChangeNotification(handle Handle) (err error) { r1, _, e1 := syscall.SyscallN(procFindNextChangeNotification.Addr(), uintptr(handle)) if r1 == 0 { err = errnoErr(e1) } return } func findNextFile1(handle Handle, data *win32finddata1) (err error) { r1, _, e1 := syscall.SyscallN(procFindNextFileW.Addr(), uintptr(handle), uintptr(unsafe.Pointer(data))) if r1 == 0 { err = errnoErr(e1) } return } func FindNextVolumeMountPoint(findVolumeMountPoint Handle, volumeMountPoint *uint16, bufferLength uint32) (err error) { r1, _, e1 := syscall.SyscallN(procFindNextVolumeMountPointW.Addr(), uintptr(findVolumeMountPoint), uintptr(unsafe.Pointer(volumeMountPoint)), uintptr(bufferLength)) if r1 == 0 { err = errnoErr(e1) } return } func FindNextVolume(findVolume Handle, volumeName *uint16, bufferLength uint32) (err error) { r1, _, e1 := syscall.SyscallN(procFindNextVolumeW.Addr(), uintptr(findVolume), uintptr(unsafe.Pointer(volumeName)), uintptr(bufferLength)) if r1 == 0 { err = errnoErr(e1) } return } func findResource(module Handle, name uintptr, resType uintptr) (resInfo Handle, err error) { r0, _, e1 := syscall.SyscallN(procFindResourceW.Addr(), uintptr(module), uintptr(name), uintptr(resType)) resInfo = Handle(r0) if resInfo == 0 { err = errnoErr(e1) } return } func FindVolumeClose(findVolume Handle) (err error) { r1, _, e1 := syscall.SyscallN(procFindVolumeClose.Addr(), uintptr(findVolume)) if r1 == 0 { err = errnoErr(e1) } return } func FindVolumeMountPointClose(findVolumeMountPoint Handle) (err error) { r1, _, e1 := syscall.SyscallN(procFindVolumeMountPointClose.Addr(), uintptr(findVolumeMountPoint)) if r1 == 0 { err = errnoErr(e1) } return } func FlushConsoleInputBuffer(console Handle) (err error) { r1, _, e1 := syscall.SyscallN(procFlushConsoleInputBuffer.Addr(), uintptr(console)) if r1 == 0 { err = errnoErr(e1) } return } func FlushFileBuffers(handle Handle) (err error) { r1, _, e1 := syscall.SyscallN(procFlushFileBuffers.Addr(), uintptr(handle)) if r1 == 0 { err = errnoErr(e1) } return } func FlushViewOfFile(addr uintptr, length uintptr) (err error) { r1, _, e1 := syscall.SyscallN(procFlushViewOfFile.Addr(), uintptr(addr), uintptr(length)) if r1 == 0 { err = errnoErr(e1) } return } func FormatMessage(flags uint32, msgsrc uintptr, msgid uint32, langid uint32, buf []uint16, args *byte) (n uint32, err error) { var _p0 *uint16 if len(buf) > 0 { _p0 = &buf[0] } r0, _, e1 := syscall.SyscallN(procFormatMessageW.Addr(), uintptr(flags), uintptr(msgsrc), uintptr(msgid), uintptr(langid), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(args))) n = uint32(r0) if n == 0 { err = errnoErr(e1) } return } func FreeEnvironmentStrings(envs *uint16) (err error) { r1, _, e1 := syscall.SyscallN(procFreeEnvironmentStringsW.Addr(), uintptr(unsafe.Pointer(envs))) if r1 == 0 { err = errnoErr(e1) } return } func FreeLibrary(handle Handle) (err error) { r1, _, e1 := syscall.SyscallN(procFreeLibrary.Addr(), uintptr(handle)) if r1 == 0 { err = errnoErr(e1) } return } func GenerateConsoleCtrlEvent(ctrlEvent uint32, processGroupID uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGenerateConsoleCtrlEvent.Addr(), uintptr(ctrlEvent), uintptr(processGroupID)) if r1 == 0 { err = errnoErr(e1) } return } func GetACP() (acp uint32) { r0, _, _ := syscall.SyscallN(procGetACP.Addr()) acp = uint32(r0) return } func GetActiveProcessorCount(groupNumber uint16) (ret uint32) { r0, _, _ := syscall.SyscallN(procGetActiveProcessorCount.Addr(), uintptr(groupNumber)) ret = uint32(r0) return } func GetCommModemStatus(handle Handle, lpModemStat *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetCommModemStatus.Addr(), uintptr(handle), uintptr(unsafe.Pointer(lpModemStat))) if r1 == 0 { err = errnoErr(e1) } return } func GetCommState(handle Handle, lpDCB *DCB) (err error) { r1, _, e1 := syscall.SyscallN(procGetCommState.Addr(), uintptr(handle), uintptr(unsafe.Pointer(lpDCB))) if r1 == 0 { err = errnoErr(e1) } return } func GetCommTimeouts(handle Handle, timeouts *CommTimeouts) (err error) { r1, _, e1 := syscall.SyscallN(procGetCommTimeouts.Addr(), uintptr(handle), uintptr(unsafe.Pointer(timeouts))) if r1 == 0 { err = errnoErr(e1) } return } func GetCommandLine() (cmd *uint16) { r0, _, _ := syscall.SyscallN(procGetCommandLineW.Addr()) cmd = (*uint16)(unsafe.Pointer(r0)) return } func GetComputerNameEx(nametype uint32, buf *uint16, n *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetComputerNameExW.Addr(), uintptr(nametype), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(n))) if r1 == 0 { err = errnoErr(e1) } return } func GetComputerName(buf *uint16, n *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetComputerNameW.Addr(), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(n))) if r1 == 0 { err = errnoErr(e1) } return } func GetConsoleCP() (cp uint32, err error) { r0, _, e1 := syscall.SyscallN(procGetConsoleCP.Addr()) cp = uint32(r0) if cp == 0 { err = errnoErr(e1) } return } func GetConsoleMode(console Handle, mode *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetConsoleMode.Addr(), uintptr(console), uintptr(unsafe.Pointer(mode))) if r1 == 0 { err = errnoErr(e1) } return } func GetConsoleOutputCP() (cp uint32, err error) { r0, _, e1 := syscall.SyscallN(procGetConsoleOutputCP.Addr()) cp = uint32(r0) if cp == 0 { err = errnoErr(e1) } return } func GetConsoleScreenBufferInfo(console Handle, info *ConsoleScreenBufferInfo) (err error) { r1, _, e1 := syscall.SyscallN(procGetConsoleScreenBufferInfo.Addr(), uintptr(console), uintptr(unsafe.Pointer(info))) if r1 == 0 { err = errnoErr(e1) } return } func GetCurrentDirectory(buflen uint32, buf *uint16) (n uint32, err error) { r0, _, e1 := syscall.SyscallN(procGetCurrentDirectoryW.Addr(), uintptr(buflen), uintptr(unsafe.Pointer(buf))) n = uint32(r0) if n == 0 { err = errnoErr(e1) } return } func GetCurrentProcessId() (pid uint32) { r0, _, _ := syscall.SyscallN(procGetCurrentProcessId.Addr()) pid = uint32(r0) return } func GetCurrentThreadId() (id uint32) { r0, _, _ := syscall.SyscallN(procGetCurrentThreadId.Addr()) id = uint32(r0) return } func GetDiskFreeSpaceEx(directoryName *uint16, freeBytesAvailableToCaller *uint64, totalNumberOfBytes *uint64, totalNumberOfFreeBytes *uint64) (err error) { r1, _, e1 := syscall.SyscallN(procGetDiskFreeSpaceExW.Addr(), uintptr(unsafe.Pointer(directoryName)), uintptr(unsafe.Pointer(freeBytesAvailableToCaller)), uintptr(unsafe.Pointer(totalNumberOfBytes)), uintptr(unsafe.Pointer(totalNumberOfFreeBytes))) if r1 == 0 { err = errnoErr(e1) } return } func GetDriveType(rootPathName *uint16) (driveType uint32) { r0, _, _ := syscall.SyscallN(procGetDriveTypeW.Addr(), uintptr(unsafe.Pointer(rootPathName))) driveType = uint32(r0) return } func GetEnvironmentStrings() (envs *uint16, err error) { r0, _, e1 := syscall.SyscallN(procGetEnvironmentStringsW.Addr()) envs = (*uint16)(unsafe.Pointer(r0)) if envs == nil { err = errnoErr(e1) } return } func GetEnvironmentVariable(name *uint16, buffer *uint16, size uint32) (n uint32, err error) { r0, _, e1 := syscall.SyscallN(procGetEnvironmentVariableW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(buffer)), uintptr(size)) n = uint32(r0) if n == 0 { err = errnoErr(e1) } return } func GetExitCodeProcess(handle Handle, exitcode *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetExitCodeProcess.Addr(), uintptr(handle), uintptr(unsafe.Pointer(exitcode))) if r1 == 0 { err = errnoErr(e1) } return } func GetFileAttributesEx(name *uint16, level uint32, info *byte) (err error) { r1, _, e1 := syscall.SyscallN(procGetFileAttributesExW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(level), uintptr(unsafe.Pointer(info))) if r1 == 0 { err = errnoErr(e1) } return } func GetFileAttributes(name *uint16) (attrs uint32, err error) { r0, _, e1 := syscall.SyscallN(procGetFileAttributesW.Addr(), uintptr(unsafe.Pointer(name))) attrs = uint32(r0) if attrs == INVALID_FILE_ATTRIBUTES { err = errnoErr(e1) } return } func GetFileInformationByHandle(handle Handle, data *ByHandleFileInformation) (err error) { r1, _, e1 := syscall.SyscallN(procGetFileInformationByHandle.Addr(), uintptr(handle), uintptr(unsafe.Pointer(data))) if r1 == 0 { err = errnoErr(e1) } return } func GetFileInformationByHandleEx(handle Handle, class uint32, outBuffer *byte, outBufferLen uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetFileInformationByHandleEx.Addr(), uintptr(handle), uintptr(class), uintptr(unsafe.Pointer(outBuffer)), uintptr(outBufferLen)) if r1 == 0 { err = errnoErr(e1) } return } func GetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetime) (err error) { r1, _, e1 := syscall.SyscallN(procGetFileTime.Addr(), uintptr(handle), uintptr(unsafe.Pointer(ctime)), uintptr(unsafe.Pointer(atime)), uintptr(unsafe.Pointer(wtime))) if r1 == 0 { err = errnoErr(e1) } return } func GetFileType(filehandle Handle) (n uint32, err error) { r0, _, e1 := syscall.SyscallN(procGetFileType.Addr(), uintptr(filehandle)) n = uint32(r0) if n == 0 { err = errnoErr(e1) } return } func GetFinalPathNameByHandle(file Handle, filePath *uint16, filePathSize uint32, flags uint32) (n uint32, err error) { r0, _, e1 := syscall.SyscallN(procGetFinalPathNameByHandleW.Addr(), uintptr(file), uintptr(unsafe.Pointer(filePath)), uintptr(filePathSize), uintptr(flags)) n = uint32(r0) if n == 0 { err = errnoErr(e1) } return } func GetFullPathName(path *uint16, buflen uint32, buf *uint16, fname **uint16) (n uint32, err error) { r0, _, e1 := syscall.SyscallN(procGetFullPathNameW.Addr(), uintptr(unsafe.Pointer(path)), uintptr(buflen), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(fname))) n = uint32(r0) if n == 0 { err = errnoErr(e1) } return } func GetLargePageMinimum() (size uintptr) { r0, _, _ := syscall.SyscallN(procGetLargePageMinimum.Addr()) size = uintptr(r0) return } func GetLastError() (lasterr error) { r0, _, _ := syscall.SyscallN(procGetLastError.Addr()) if r0 != 0 { lasterr = syscall.Errno(r0) } return } func GetLogicalDriveStrings(bufferLength uint32, buffer *uint16) (n uint32, err error) { r0, _, e1 := syscall.SyscallN(procGetLogicalDriveStringsW.Addr(), uintptr(bufferLength), uintptr(unsafe.Pointer(buffer))) n = uint32(r0) if n == 0 { err = errnoErr(e1) } return } func GetLogicalDrives() (drivesBitMask uint32, err error) { r0, _, e1 := syscall.SyscallN(procGetLogicalDrives.Addr()) drivesBitMask = uint32(r0) if drivesBitMask == 0 { err = errnoErr(e1) } return } func GetLongPathName(path *uint16, buf *uint16, buflen uint32) (n uint32, err error) { r0, _, e1 := syscall.SyscallN(procGetLongPathNameW.Addr(), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(buf)), uintptr(buflen)) n = uint32(r0) if n == 0 { err = errnoErr(e1) } return } func GetMaximumProcessorCount(groupNumber uint16) (ret uint32) { r0, _, _ := syscall.SyscallN(procGetMaximumProcessorCount.Addr(), uintptr(groupNumber)) ret = uint32(r0) return } func GetModuleFileName(module Handle, filename *uint16, size uint32) (n uint32, err error) { r0, _, e1 := syscall.SyscallN(procGetModuleFileNameW.Addr(), uintptr(module), uintptr(unsafe.Pointer(filename)), uintptr(size)) n = uint32(r0) if n == 0 { err = errnoErr(e1) } return } func GetModuleHandleEx(flags uint32, moduleName *uint16, module *Handle) (err error) { r1, _, e1 := syscall.SyscallN(procGetModuleHandleExW.Addr(), uintptr(flags), uintptr(unsafe.Pointer(moduleName)), uintptr(unsafe.Pointer(module))) if r1 == 0 { err = errnoErr(e1) } return } func GetNamedPipeClientProcessId(pipe Handle, clientProcessID *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetNamedPipeClientProcessId.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(clientProcessID))) if r1 == 0 { err = errnoErr(e1) } return } func GetNamedPipeHandleState(pipe Handle, state *uint32, curInstances *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32, userName *uint16, maxUserNameSize uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetNamedPipeHandleStateW.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(state)), uintptr(unsafe.Pointer(curInstances)), uintptr(unsafe.Pointer(maxCollectionCount)), uintptr(unsafe.Pointer(collectDataTimeout)), uintptr(unsafe.Pointer(userName)), uintptr(maxUserNameSize)) if r1 == 0 { err = errnoErr(e1) } return } func GetNamedPipeInfo(pipe Handle, flags *uint32, outSize *uint32, inSize *uint32, maxInstances *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetNamedPipeInfo.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(flags)), uintptr(unsafe.Pointer(outSize)), uintptr(unsafe.Pointer(inSize)), uintptr(unsafe.Pointer(maxInstances))) if r1 == 0 { err = errnoErr(e1) } return } func GetNamedPipeServerProcessId(pipe Handle, serverProcessID *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetNamedPipeServerProcessId.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(serverProcessID))) if r1 == 0 { err = errnoErr(e1) } return } func GetNumberOfConsoleInputEvents(console Handle, numevents *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetNumberOfConsoleInputEvents.Addr(), uintptr(console), uintptr(unsafe.Pointer(numevents))) if r1 == 0 { err = errnoErr(e1) } return } func GetOverlappedResult(handle Handle, overlapped *Overlapped, done *uint32, wait bool) (err error) { var _p0 uint32 if wait { _p0 = 1 } r1, _, e1 := syscall.SyscallN(procGetOverlappedResult.Addr(), uintptr(handle), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(done)), uintptr(_p0)) if r1 == 0 { err = errnoErr(e1) } return } func GetPriorityClass(process Handle) (ret uint32, err error) { r0, _, e1 := syscall.SyscallN(procGetPriorityClass.Addr(), uintptr(process)) ret = uint32(r0) if ret == 0 { err = errnoErr(e1) } return } func GetProcAddress(module Handle, procname string) (proc uintptr, err error) { var _p0 *byte _p0, err = syscall.BytePtrFromString(procname) if err != nil { return } return _GetProcAddress(module, _p0) } func _GetProcAddress(module Handle, procname *byte) (proc uintptr, err error) { r0, _, e1 := syscall.SyscallN(procGetProcAddress.Addr(), uintptr(module), uintptr(unsafe.Pointer(procname))) proc = uintptr(r0) if proc == 0 { err = errnoErr(e1) } return } func GetProcessId(process Handle) (id uint32, err error) { r0, _, e1 := syscall.SyscallN(procGetProcessId.Addr(), uintptr(process)) id = uint32(r0) if id == 0 { err = errnoErr(e1) } return } func getProcessPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint16, bufSize *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetProcessPreferredUILanguages.Addr(), uintptr(flags), uintptr(unsafe.Pointer(numLanguages)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(bufSize))) if r1 == 0 { err = errnoErr(e1) } return } func GetProcessShutdownParameters(level *uint32, flags *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetProcessShutdownParameters.Addr(), uintptr(unsafe.Pointer(level)), uintptr(unsafe.Pointer(flags))) if r1 == 0 { err = errnoErr(e1) } return } func GetProcessTimes(handle Handle, creationTime *Filetime, exitTime *Filetime, kernelTime *Filetime, userTime *Filetime) (err error) { r1, _, e1 := syscall.SyscallN(procGetProcessTimes.Addr(), uintptr(handle), uintptr(unsafe.Pointer(creationTime)), uintptr(unsafe.Pointer(exitTime)), uintptr(unsafe.Pointer(kernelTime)), uintptr(unsafe.Pointer(userTime))) if r1 == 0 { err = errnoErr(e1) } return } func GetProcessWorkingSetSizeEx(hProcess Handle, lpMinimumWorkingSetSize *uintptr, lpMaximumWorkingSetSize *uintptr, flags *uint32) { syscall.SyscallN(procGetProcessWorkingSetSizeEx.Addr(), uintptr(hProcess), uintptr(unsafe.Pointer(lpMinimumWorkingSetSize)), uintptr(unsafe.Pointer(lpMaximumWorkingSetSize)), uintptr(unsafe.Pointer(flags))) return } func GetQueuedCompletionStatus(cphandle Handle, qty *uint32, key *uintptr, overlapped **Overlapped, timeout uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetQueuedCompletionStatus.Addr(), uintptr(cphandle), uintptr(unsafe.Pointer(qty)), uintptr(unsafe.Pointer(key)), uintptr(unsafe.Pointer(overlapped)), uintptr(timeout)) if r1 == 0 { err = errnoErr(e1) } return } func GetShortPathName(longpath *uint16, shortpath *uint16, buflen uint32) (n uint32, err error) { r0, _, e1 := syscall.SyscallN(procGetShortPathNameW.Addr(), uintptr(unsafe.Pointer(longpath)), uintptr(unsafe.Pointer(shortpath)), uintptr(buflen)) n = uint32(r0) if n == 0 { err = errnoErr(e1) } return } func getStartupInfo(startupInfo *StartupInfo) { syscall.SyscallN(procGetStartupInfoW.Addr(), uintptr(unsafe.Pointer(startupInfo))) return } func GetStdHandle(stdhandle uint32) (handle Handle, err error) { r0, _, e1 := syscall.SyscallN(procGetStdHandle.Addr(), uintptr(stdhandle)) handle = Handle(r0) if handle == InvalidHandle { err = errnoErr(e1) } return } func getSystemDirectory(dir *uint16, dirLen uint32) (len uint32, err error) { r0, _, e1 := syscall.SyscallN(procGetSystemDirectoryW.Addr(), uintptr(unsafe.Pointer(dir)), uintptr(dirLen)) len = uint32(r0) if len == 0 { err = errnoErr(e1) } return } func getSystemPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint16, bufSize *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetSystemPreferredUILanguages.Addr(), uintptr(flags), uintptr(unsafe.Pointer(numLanguages)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(bufSize))) if r1 == 0 { err = errnoErr(e1) } return } func GetSystemTimeAsFileTime(time *Filetime) { syscall.SyscallN(procGetSystemTimeAsFileTime.Addr(), uintptr(unsafe.Pointer(time))) return } func GetSystemTimePreciseAsFileTime(time *Filetime) { syscall.SyscallN(procGetSystemTimePreciseAsFileTime.Addr(), uintptr(unsafe.Pointer(time))) return } func getSystemWindowsDirectory(dir *uint16, dirLen uint32) (len uint32, err error) { r0, _, e1 := syscall.SyscallN(procGetSystemWindowsDirectoryW.Addr(), uintptr(unsafe.Pointer(dir)), uintptr(dirLen)) len = uint32(r0) if len == 0 { err = errnoErr(e1) } return } func GetTempPath(buflen uint32, buf *uint16) (n uint32, err error) { r0, _, e1 := syscall.SyscallN(procGetTempPathW.Addr(), uintptr(buflen), uintptr(unsafe.Pointer(buf))) n = uint32(r0) if n == 0 { err = errnoErr(e1) } return } func getThreadPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint16, bufSize *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetThreadPreferredUILanguages.Addr(), uintptr(flags), uintptr(unsafe.Pointer(numLanguages)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(bufSize))) if r1 == 0 { err = errnoErr(e1) } return } func getTickCount64() (ms uint64) { r0, _, _ := syscall.SyscallN(procGetTickCount64.Addr()) ms = uint64(r0) return } func GetTimeZoneInformation(tzi *Timezoneinformation) (rc uint32, err error) { r0, _, e1 := syscall.SyscallN(procGetTimeZoneInformation.Addr(), uintptr(unsafe.Pointer(tzi))) rc = uint32(r0) if rc == 0xffffffff { err = errnoErr(e1) } return } func getUserPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint16, bufSize *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetUserPreferredUILanguages.Addr(), uintptr(flags), uintptr(unsafe.Pointer(numLanguages)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(bufSize))) if r1 == 0 { err = errnoErr(e1) } return } func GetVersion() (ver uint32, err error) { r0, _, e1 := syscall.SyscallN(procGetVersion.Addr()) ver = uint32(r0) if ver == 0 { err = errnoErr(e1) } return } func GetVolumeInformationByHandle(file Handle, volumeNameBuffer *uint16, volumeNameSize uint32, volumeNameSerialNumber *uint32, maximumComponentLength *uint32, fileSystemFlags *uint32, fileSystemNameBuffer *uint16, fileSystemNameSize uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetVolumeInformationByHandleW.Addr(), uintptr(file), uintptr(unsafe.Pointer(volumeNameBuffer)), uintptr(volumeNameSize), uintptr(unsafe.Pointer(volumeNameSerialNumber)), uintptr(unsafe.Pointer(maximumComponentLength)), uintptr(unsafe.Pointer(fileSystemFlags)), uintptr(unsafe.Pointer(fileSystemNameBuffer)), uintptr(fileSystemNameSize)) if r1 == 0 { err = errnoErr(e1) } return } func GetVolumeInformation(rootPathName *uint16, volumeNameBuffer *uint16, volumeNameSize uint32, volumeNameSerialNumber *uint32, maximumComponentLength *uint32, fileSystemFlags *uint32, fileSystemNameBuffer *uint16, fileSystemNameSize uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetVolumeInformationW.Addr(), uintptr(unsafe.Pointer(rootPathName)), uintptr(unsafe.Pointer(volumeNameBuffer)), uintptr(volumeNameSize), uintptr(unsafe.Pointer(volumeNameSerialNumber)), uintptr(unsafe.Pointer(maximumComponentLength)), uintptr(unsafe.Pointer(fileSystemFlags)), uintptr(unsafe.Pointer(fileSystemNameBuffer)), uintptr(fileSystemNameSize)) if r1 == 0 { err = errnoErr(e1) } return } func GetVolumeNameForVolumeMountPoint(volumeMountPoint *uint16, volumeName *uint16, bufferlength uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetVolumeNameForVolumeMountPointW.Addr(), uintptr(unsafe.Pointer(volumeMountPoint)), uintptr(unsafe.Pointer(volumeName)), uintptr(bufferlength)) if r1 == 0 { err = errnoErr(e1) } return } func GetVolumePathName(fileName *uint16, volumePathName *uint16, bufferLength uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetVolumePathNameW.Addr(), uintptr(unsafe.Pointer(fileName)), uintptr(unsafe.Pointer(volumePathName)), uintptr(bufferLength)) if r1 == 0 { err = errnoErr(e1) } return } func GetVolumePathNamesForVolumeName(volumeName *uint16, volumePathNames *uint16, bufferLength uint32, returnLength *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetVolumePathNamesForVolumeNameW.Addr(), uintptr(unsafe.Pointer(volumeName)), uintptr(unsafe.Pointer(volumePathNames)), uintptr(bufferLength), uintptr(unsafe.Pointer(returnLength))) if r1 == 0 { err = errnoErr(e1) } return } func getWindowsDirectory(dir *uint16, dirLen uint32) (len uint32, err error) { r0, _, e1 := syscall.SyscallN(procGetWindowsDirectoryW.Addr(), uintptr(unsafe.Pointer(dir)), uintptr(dirLen)) len = uint32(r0) if len == 0 { err = errnoErr(e1) } return } func initializeProcThreadAttributeList(attrlist *ProcThreadAttributeList, attrcount uint32, flags uint32, size *uintptr) (err error) { r1, _, e1 := syscall.SyscallN(procInitializeProcThreadAttributeList.Addr(), uintptr(unsafe.Pointer(attrlist)), uintptr(attrcount), uintptr(flags), uintptr(unsafe.Pointer(size))) if r1 == 0 { err = errnoErr(e1) } return } func IsProcessorFeaturePresent(ProcessorFeature uint32) (ret bool) { r0, _, _ := syscall.SyscallN(procIsProcessorFeaturePresent.Addr(), uintptr(ProcessorFeature)) ret = r0 != 0 return } func IsWow64Process(handle Handle, isWow64 *bool) (err error) { var _p0 uint32 if *isWow64 { _p0 = 1 } r1, _, e1 := syscall.SyscallN(procIsWow64Process.Addr(), uintptr(handle), uintptr(unsafe.Pointer(&_p0))) *isWow64 = _p0 != 0 if r1 == 0 { err = errnoErr(e1) } return } func IsWow64Process2(handle Handle, processMachine *uint16, nativeMachine *uint16) (err error) { err = procIsWow64Process2.Find() if err != nil { return } r1, _, e1 := syscall.SyscallN(procIsWow64Process2.Addr(), uintptr(handle), uintptr(unsafe.Pointer(processMachine)), uintptr(unsafe.Pointer(nativeMachine))) if r1 == 0 { err = errnoErr(e1) } return } func LoadLibraryEx(libname string, zero Handle, flags uintptr) (handle Handle, err error) { var _p0 *uint16 _p0, err = syscall.UTF16PtrFromString(libname) if err != nil { return } return _LoadLibraryEx(_p0, zero, flags) } func _LoadLibraryEx(libname *uint16, zero Handle, flags uintptr) (handle Handle, err error) { r0, _, e1 := syscall.SyscallN(procLoadLibraryExW.Addr(), uintptr(unsafe.Pointer(libname)), uintptr(zero), uintptr(flags)) handle = Handle(r0) if handle == 0 { err = errnoErr(e1) } return } func LoadLibrary(libname string) (handle Handle, err error) { var _p0 *uint16 _p0, err = syscall.UTF16PtrFromString(libname) if err != nil { return } return _LoadLibrary(_p0) } func _LoadLibrary(libname *uint16) (handle Handle, err error) { r0, _, e1 := syscall.SyscallN(procLoadLibraryW.Addr(), uintptr(unsafe.Pointer(libname))) handle = Handle(r0) if handle == 0 { err = errnoErr(e1) } return } func LoadResource(module Handle, resInfo Handle) (resData Handle, err error) { r0, _, e1 := syscall.SyscallN(procLoadResource.Addr(), uintptr(module), uintptr(resInfo)) resData = Handle(r0) if resData == 0 { err = errnoErr(e1) } return } func LocalAlloc(flags uint32, length uint32) (ptr uintptr, err error) { r0, _, e1 := syscall.SyscallN(procLocalAlloc.Addr(), uintptr(flags), uintptr(length)) ptr = uintptr(r0) if ptr == 0 { err = errnoErr(e1) } return } func LocalFree(hmem Handle) (handle Handle, err error) { r0, _, e1 := syscall.SyscallN(procLocalFree.Addr(), uintptr(hmem)) handle = Handle(r0) if handle != 0 { err = errnoErr(e1) } return } func LockFileEx(file Handle, flags uint32, reserved uint32, bytesLow uint32, bytesHigh uint32, overlapped *Overlapped) (err error) { r1, _, e1 := syscall.SyscallN(procLockFileEx.Addr(), uintptr(file), uintptr(flags), uintptr(reserved), uintptr(bytesLow), uintptr(bytesHigh), uintptr(unsafe.Pointer(overlapped))) if r1 == 0 { err = errnoErr(e1) } return } func LockResource(resData Handle) (addr uintptr, err error) { r0, _, e1 := syscall.SyscallN(procLockResource.Addr(), uintptr(resData)) addr = uintptr(r0) if addr == 0 { err = errnoErr(e1) } return } func MapViewOfFile(handle Handle, access uint32, offsetHigh uint32, offsetLow uint32, length uintptr) (addr uintptr, err error) { r0, _, e1 := syscall.SyscallN(procMapViewOfFile.Addr(), uintptr(handle), uintptr(access), uintptr(offsetHigh), uintptr(offsetLow), uintptr(length)) addr = uintptr(r0) if addr == 0 { err = errnoErr(e1) } return } func Module32First(snapshot Handle, moduleEntry *ModuleEntry32) (err error) { r1, _, e1 := syscall.SyscallN(procModule32FirstW.Addr(), uintptr(snapshot), uintptr(unsafe.Pointer(moduleEntry))) if r1 == 0 { err = errnoErr(e1) } return } func Module32Next(snapshot Handle, moduleEntry *ModuleEntry32) (err error) { r1, _, e1 := syscall.SyscallN(procModule32NextW.Addr(), uintptr(snapshot), uintptr(unsafe.Pointer(moduleEntry))) if r1 == 0 { err = errnoErr(e1) } return } func MoveFileEx(from *uint16, to *uint16, flags uint32) (err error) { r1, _, e1 := syscall.SyscallN(procMoveFileExW.Addr(), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(to)), uintptr(flags)) if r1 == 0 { err = errnoErr(e1) } return } func MoveFile(from *uint16, to *uint16) (err error) { r1, _, e1 := syscall.SyscallN(procMoveFileW.Addr(), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(to))) if r1 == 0 { err = errnoErr(e1) } return } func MultiByteToWideChar(codePage uint32, dwFlags uint32, str *byte, nstr int32, wchar *uint16, nwchar int32) (nwrite int32, err error) { r0, _, e1 := syscall.SyscallN(procMultiByteToWideChar.Addr(), uintptr(codePage), uintptr(dwFlags), uintptr(unsafe.Pointer(str)), uintptr(nstr), uintptr(unsafe.Pointer(wchar)), uintptr(nwchar)) nwrite = int32(r0) if nwrite == 0 { err = errnoErr(e1) } return } func OpenEvent(desiredAccess uint32, inheritHandle bool, name *uint16) (handle Handle, err error) { var _p0 uint32 if inheritHandle { _p0 = 1 } r0, _, e1 := syscall.SyscallN(procOpenEventW.Addr(), uintptr(desiredAccess), uintptr(_p0), uintptr(unsafe.Pointer(name))) handle = Handle(r0) if handle == 0 { err = errnoErr(e1) } return } func OpenMutex(desiredAccess uint32, inheritHandle bool, name *uint16) (handle Handle, err error) { var _p0 uint32 if inheritHandle { _p0 = 1 } r0, _, e1 := syscall.SyscallN(procOpenMutexW.Addr(), uintptr(desiredAccess), uintptr(_p0), uintptr(unsafe.Pointer(name))) handle = Handle(r0) if handle == 0 { err = errnoErr(e1) } return } func OpenProcess(desiredAccess uint32, inheritHandle bool, processId uint32) (handle Handle, err error) { var _p0 uint32 if inheritHandle { _p0 = 1 } r0, _, e1 := syscall.SyscallN(procOpenProcess.Addr(), uintptr(desiredAccess), uintptr(_p0), uintptr(processId)) handle = Handle(r0) if handle == 0 { err = errnoErr(e1) } return } func OpenThread(desiredAccess uint32, inheritHandle bool, threadId uint32) (handle Handle, err error) { var _p0 uint32 if inheritHandle { _p0 = 1 } r0, _, e1 := syscall.SyscallN(procOpenThread.Addr(), uintptr(desiredAccess), uintptr(_p0), uintptr(threadId)) handle = Handle(r0) if handle == 0 { err = errnoErr(e1) } return } func PostQueuedCompletionStatus(cphandle Handle, qty uint32, key uintptr, overlapped *Overlapped) (err error) { r1, _, e1 := syscall.SyscallN(procPostQueuedCompletionStatus.Addr(), uintptr(cphandle), uintptr(qty), uintptr(key), uintptr(unsafe.Pointer(overlapped))) if r1 == 0 { err = errnoErr(e1) } return } func Process32First(snapshot Handle, procEntry *ProcessEntry32) (err error) { r1, _, e1 := syscall.SyscallN(procProcess32FirstW.Addr(), uintptr(snapshot), uintptr(unsafe.Pointer(procEntry))) if r1 == 0 { err = errnoErr(e1) } return } func Process32Next(snapshot Handle, procEntry *ProcessEntry32) (err error) { r1, _, e1 := syscall.SyscallN(procProcess32NextW.Addr(), uintptr(snapshot), uintptr(unsafe.Pointer(procEntry))) if r1 == 0 { err = errnoErr(e1) } return } func ProcessIdToSessionId(pid uint32, sessionid *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procProcessIdToSessionId.Addr(), uintptr(pid), uintptr(unsafe.Pointer(sessionid))) if r1 == 0 { err = errnoErr(e1) } return } func PulseEvent(event Handle) (err error) { r1, _, e1 := syscall.SyscallN(procPulseEvent.Addr(), uintptr(event)) if r1 == 0 { err = errnoErr(e1) } return } func PurgeComm(handle Handle, dwFlags uint32) (err error) { r1, _, e1 := syscall.SyscallN(procPurgeComm.Addr(), uintptr(handle), uintptr(dwFlags)) if r1 == 0 { err = errnoErr(e1) } return } func QueryDosDevice(deviceName *uint16, targetPath *uint16, max uint32) (n uint32, err error) { r0, _, e1 := syscall.SyscallN(procQueryDosDeviceW.Addr(), uintptr(unsafe.Pointer(deviceName)), uintptr(unsafe.Pointer(targetPath)), uintptr(max)) n = uint32(r0) if n == 0 { err = errnoErr(e1) } return } func QueryFullProcessImageName(proc Handle, flags uint32, exeName *uint16, size *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procQueryFullProcessImageNameW.Addr(), uintptr(proc), uintptr(flags), uintptr(unsafe.Pointer(exeName)), uintptr(unsafe.Pointer(size))) if r1 == 0 { err = errnoErr(e1) } return } func QueryInformationJobObject(job Handle, JobObjectInformationClass int32, JobObjectInformation uintptr, JobObjectInformationLength uint32, retlen *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procQueryInformationJobObject.Addr(), uintptr(job), uintptr(JobObjectInformationClass), uintptr(JobObjectInformation), uintptr(JobObjectInformationLength), uintptr(unsafe.Pointer(retlen))) if r1 == 0 { err = errnoErr(e1) } return } func ReadConsole(console Handle, buf *uint16, toread uint32, read *uint32, inputControl *byte) (err error) { r1, _, e1 := syscall.SyscallN(procReadConsoleW.Addr(), uintptr(console), uintptr(unsafe.Pointer(buf)), uintptr(toread), uintptr(unsafe.Pointer(read)), uintptr(unsafe.Pointer(inputControl))) if r1 == 0 { err = errnoErr(e1) } return } func ReadDirectoryChanges(handle Handle, buf *byte, buflen uint32, watchSubTree bool, mask uint32, retlen *uint32, overlapped *Overlapped, completionRoutine uintptr) (err error) { var _p0 uint32 if watchSubTree { _p0 = 1 } r1, _, e1 := syscall.SyscallN(procReadDirectoryChangesW.Addr(), uintptr(handle), uintptr(unsafe.Pointer(buf)), uintptr(buflen), uintptr(_p0), uintptr(mask), uintptr(unsafe.Pointer(retlen)), uintptr(unsafe.Pointer(overlapped)), uintptr(completionRoutine)) if r1 == 0 { err = errnoErr(e1) } return } func readFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) (err error) { var _p0 *byte if len(buf) > 0 { _p0 = &buf[0] } r1, _, e1 := syscall.SyscallN(procReadFile.Addr(), uintptr(handle), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(done)), uintptr(unsafe.Pointer(overlapped))) if r1 == 0 { err = errnoErr(e1) } return } func ReadProcessMemory(process Handle, baseAddress uintptr, buffer *byte, size uintptr, numberOfBytesRead *uintptr) (err error) { r1, _, e1 := syscall.SyscallN(procReadProcessMemory.Addr(), uintptr(process), uintptr(baseAddress), uintptr(unsafe.Pointer(buffer)), uintptr(size), uintptr(unsafe.Pointer(numberOfBytesRead))) if r1 == 0 { err = errnoErr(e1) } return } func ReleaseMutex(mutex Handle) (err error) { r1, _, e1 := syscall.SyscallN(procReleaseMutex.Addr(), uintptr(mutex)) if r1 == 0 { err = errnoErr(e1) } return } func RemoveDirectory(path *uint16) (err error) { r1, _, e1 := syscall.SyscallN(procRemoveDirectoryW.Addr(), uintptr(unsafe.Pointer(path))) if r1 == 0 { err = errnoErr(e1) } return } func RemoveDllDirectory(cookie uintptr) (err error) { r1, _, e1 := syscall.SyscallN(procRemoveDllDirectory.Addr(), uintptr(cookie)) if r1 == 0 { err = errnoErr(e1) } return } func ResetEvent(event Handle) (err error) { r1, _, e1 := syscall.SyscallN(procResetEvent.Addr(), uintptr(event)) if r1 == 0 { err = errnoErr(e1) } return } func resizePseudoConsole(pconsole Handle, size uint32) (hr error) { r0, _, _ := syscall.SyscallN(procResizePseudoConsole.Addr(), uintptr(pconsole), uintptr(size)) if r0 != 0 { hr = syscall.Errno(r0) } return } func ResumeThread(thread Handle) (ret uint32, err error) { r0, _, e1 := syscall.SyscallN(procResumeThread.Addr(), uintptr(thread)) ret = uint32(r0) if ret == 0xffffffff { err = errnoErr(e1) } return } func SetCommBreak(handle Handle) (err error) { r1, _, e1 := syscall.SyscallN(procSetCommBreak.Addr(), uintptr(handle)) if r1 == 0 { err = errnoErr(e1) } return } func SetCommMask(handle Handle, dwEvtMask uint32) (err error) { r1, _, e1 := syscall.SyscallN(procSetCommMask.Addr(), uintptr(handle), uintptr(dwEvtMask)) if r1 == 0 { err = errnoErr(e1) } return } func SetCommState(handle Handle, lpDCB *DCB) (err error) { r1, _, e1 := syscall.SyscallN(procSetCommState.Addr(), uintptr(handle), uintptr(unsafe.Pointer(lpDCB))) if r1 == 0 { err = errnoErr(e1) } return } func SetCommTimeouts(handle Handle, timeouts *CommTimeouts) (err error) { r1, _, e1 := syscall.SyscallN(procSetCommTimeouts.Addr(), uintptr(handle), uintptr(unsafe.Pointer(timeouts))) if r1 == 0 { err = errnoErr(e1) } return } func SetConsoleCP(cp uint32) (err error) { r1, _, e1 := syscall.SyscallN(procSetConsoleCP.Addr(), uintptr(cp)) if r1 == 0 { err = errnoErr(e1) } return } func setConsoleCursorPosition(console Handle, position uint32) (err error) { r1, _, e1 := syscall.SyscallN(procSetConsoleCursorPosition.Addr(), uintptr(console), uintptr(position)) if r1 == 0 { err = errnoErr(e1) } return } func SetConsoleMode(console Handle, mode uint32) (err error) { r1, _, e1 := syscall.SyscallN(procSetConsoleMode.Addr(), uintptr(console), uintptr(mode)) if r1 == 0 { err = errnoErr(e1) } return } func SetConsoleOutputCP(cp uint32) (err error) { r1, _, e1 := syscall.SyscallN(procSetConsoleOutputCP.Addr(), uintptr(cp)) if r1 == 0 { err = errnoErr(e1) } return } func SetCurrentDirectory(path *uint16) (err error) { r1, _, e1 := syscall.SyscallN(procSetCurrentDirectoryW.Addr(), uintptr(unsafe.Pointer(path))) if r1 == 0 { err = errnoErr(e1) } return } func SetDefaultDllDirectories(directoryFlags uint32) (err error) { r1, _, e1 := syscall.SyscallN(procSetDefaultDllDirectories.Addr(), uintptr(directoryFlags)) if r1 == 0 { err = errnoErr(e1) } return } func SetDllDirectory(path string) (err error) { var _p0 *uint16 _p0, err = syscall.UTF16PtrFromString(path) if err != nil { return } return _SetDllDirectory(_p0) } func _SetDllDirectory(path *uint16) (err error) { r1, _, e1 := syscall.SyscallN(procSetDllDirectoryW.Addr(), uintptr(unsafe.Pointer(path))) if r1 == 0 { err = errnoErr(e1) } return } func SetEndOfFile(handle Handle) (err error) { r1, _, e1 := syscall.SyscallN(procSetEndOfFile.Addr(), uintptr(handle)) if r1 == 0 { err = errnoErr(e1) } return } func SetEnvironmentVariable(name *uint16, value *uint16) (err error) { r1, _, e1 := syscall.SyscallN(procSetEnvironmentVariableW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(value))) if r1 == 0 { err = errnoErr(e1) } return } func SetErrorMode(mode uint32) (ret uint32) { r0, _, _ := syscall.SyscallN(procSetErrorMode.Addr(), uintptr(mode)) ret = uint32(r0) return } func SetEvent(event Handle) (err error) { r1, _, e1 := syscall.SyscallN(procSetEvent.Addr(), uintptr(event)) if r1 == 0 { err = errnoErr(e1) } return } func SetFileAttributes(name *uint16, attrs uint32) (err error) { r1, _, e1 := syscall.SyscallN(procSetFileAttributesW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(attrs)) if r1 == 0 { err = errnoErr(e1) } return } func SetFileCompletionNotificationModes(handle Handle, flags uint8) (err error) { r1, _, e1 := syscall.SyscallN(procSetFileCompletionNotificationModes.Addr(), uintptr(handle), uintptr(flags)) if r1 == 0 { err = errnoErr(e1) } return } func SetFileInformationByHandle(handle Handle, class uint32, inBuffer *byte, inBufferLen uint32) (err error) { r1, _, e1 := syscall.SyscallN(procSetFileInformationByHandle.Addr(), uintptr(handle), uintptr(class), uintptr(unsafe.Pointer(inBuffer)), uintptr(inBufferLen)) if r1 == 0 { err = errnoErr(e1) } return } func SetFilePointer(handle Handle, lowoffset int32, highoffsetptr *int32, whence uint32) (newlowoffset uint32, err error) { r0, _, e1 := syscall.SyscallN(procSetFilePointer.Addr(), uintptr(handle), uintptr(lowoffset), uintptr(unsafe.Pointer(highoffsetptr)), uintptr(whence)) newlowoffset = uint32(r0) if newlowoffset == 0xffffffff { err = errnoErr(e1) } return } func SetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetime) (err error) { r1, _, e1 := syscall.SyscallN(procSetFileTime.Addr(), uintptr(handle), uintptr(unsafe.Pointer(ctime)), uintptr(unsafe.Pointer(atime)), uintptr(unsafe.Pointer(wtime))) if r1 == 0 { err = errnoErr(e1) } return } func SetFileValidData(handle Handle, validDataLength int64) (err error) { r1, _, e1 := syscall.SyscallN(procSetFileValidData.Addr(), uintptr(handle), uintptr(validDataLength)) if r1 == 0 { err = errnoErr(e1) } return } func SetHandleInformation(handle Handle, mask uint32, flags uint32) (err error) { r1, _, e1 := syscall.SyscallN(procSetHandleInformation.Addr(), uintptr(handle), uintptr(mask), uintptr(flags)) if r1 == 0 { err = errnoErr(e1) } return } func SetInformationJobObject(job Handle, JobObjectInformationClass uint32, JobObjectInformation uintptr, JobObjectInformationLength uint32) (ret int, err error) { r0, _, e1 := syscall.SyscallN(procSetInformationJobObject.Addr(), uintptr(job), uintptr(JobObjectInformationClass), uintptr(JobObjectInformation), uintptr(JobObjectInformationLength)) ret = int(r0) if ret == 0 { err = errnoErr(e1) } return } func SetNamedPipeHandleState(pipe Handle, state *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procSetNamedPipeHandleState.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(state)), uintptr(unsafe.Pointer(maxCollectionCount)), uintptr(unsafe.Pointer(collectDataTimeout))) if r1 == 0 { err = errnoErr(e1) } return } func SetPriorityClass(process Handle, priorityClass uint32) (err error) { r1, _, e1 := syscall.SyscallN(procSetPriorityClass.Addr(), uintptr(process), uintptr(priorityClass)) if r1 == 0 { err = errnoErr(e1) } return } func SetProcessPriorityBoost(process Handle, disable bool) (err error) { var _p0 uint32 if disable { _p0 = 1 } r1, _, e1 := syscall.SyscallN(procSetProcessPriorityBoost.Addr(), uintptr(process), uintptr(_p0)) if r1 == 0 { err = errnoErr(e1) } return } func SetProcessShutdownParameters(level uint32, flags uint32) (err error) { r1, _, e1 := syscall.SyscallN(procSetProcessShutdownParameters.Addr(), uintptr(level), uintptr(flags)) if r1 == 0 { err = errnoErr(e1) } return } func SetProcessWorkingSetSizeEx(hProcess Handle, dwMinimumWorkingSetSize uintptr, dwMaximumWorkingSetSize uintptr, flags uint32) (err error) { r1, _, e1 := syscall.SyscallN(procSetProcessWorkingSetSizeEx.Addr(), uintptr(hProcess), uintptr(dwMinimumWorkingSetSize), uintptr(dwMaximumWorkingSetSize), uintptr(flags)) if r1 == 0 { err = errnoErr(e1) } return } func SetStdHandle(stdhandle uint32, handle Handle) (err error) { r1, _, e1 := syscall.SyscallN(procSetStdHandle.Addr(), uintptr(stdhandle), uintptr(handle)) if r1 == 0 { err = errnoErr(e1) } return } func SetVolumeLabel(rootPathName *uint16, volumeName *uint16) (err error) { r1, _, e1 := syscall.SyscallN(procSetVolumeLabelW.Addr(), uintptr(unsafe.Pointer(rootPathName)), uintptr(unsafe.Pointer(volumeName))) if r1 == 0 { err = errnoErr(e1) } return } func SetVolumeMountPoint(volumeMountPoint *uint16, volumeName *uint16) (err error) { r1, _, e1 := syscall.SyscallN(procSetVolumeMountPointW.Addr(), uintptr(unsafe.Pointer(volumeMountPoint)), uintptr(unsafe.Pointer(volumeName))) if r1 == 0 { err = errnoErr(e1) } return } func SetupComm(handle Handle, dwInQueue uint32, dwOutQueue uint32) (err error) { r1, _, e1 := syscall.SyscallN(procSetupComm.Addr(), uintptr(handle), uintptr(dwInQueue), uintptr(dwOutQueue)) if r1 == 0 { err = errnoErr(e1) } return } func SizeofResource(module Handle, resInfo Handle) (size uint32, err error) { r0, _, e1 := syscall.SyscallN(procSizeofResource.Addr(), uintptr(module), uintptr(resInfo)) size = uint32(r0) if size == 0 { err = errnoErr(e1) } return } func SleepEx(milliseconds uint32, alertable bool) (ret uint32) { var _p0 uint32 if alertable { _p0 = 1 } r0, _, _ := syscall.SyscallN(procSleepEx.Addr(), uintptr(milliseconds), uintptr(_p0)) ret = uint32(r0) return } func TerminateJobObject(job Handle, exitCode uint32) (err error) { r1, _, e1 := syscall.SyscallN(procTerminateJobObject.Addr(), uintptr(job), uintptr(exitCode)) if r1 == 0 { err = errnoErr(e1) } return } func TerminateProcess(handle Handle, exitcode uint32) (err error) { r1, _, e1 := syscall.SyscallN(procTerminateProcess.Addr(), uintptr(handle), uintptr(exitcode)) if r1 == 0 { err = errnoErr(e1) } return } func Thread32First(snapshot Handle, threadEntry *ThreadEntry32) (err error) { r1, _, e1 := syscall.SyscallN(procThread32First.Addr(), uintptr(snapshot), uintptr(unsafe.Pointer(threadEntry))) if r1 == 0 { err = errnoErr(e1) } return } func Thread32Next(snapshot Handle, threadEntry *ThreadEntry32) (err error) { r1, _, e1 := syscall.SyscallN(procThread32Next.Addr(), uintptr(snapshot), uintptr(unsafe.Pointer(threadEntry))) if r1 == 0 { err = errnoErr(e1) } return } func UnlockFileEx(file Handle, reserved uint32, bytesLow uint32, bytesHigh uint32, overlapped *Overlapped) (err error) { r1, _, e1 := syscall.SyscallN(procUnlockFileEx.Addr(), uintptr(file), uintptr(reserved), uintptr(bytesLow), uintptr(bytesHigh), uintptr(unsafe.Pointer(overlapped))) if r1 == 0 { err = errnoErr(e1) } return } func UnmapViewOfFile(addr uintptr) (err error) { r1, _, e1 := syscall.SyscallN(procUnmapViewOfFile.Addr(), uintptr(addr)) if r1 == 0 { err = errnoErr(e1) } return } func updateProcThreadAttribute(attrlist *ProcThreadAttributeList, flags uint32, attr uintptr, value unsafe.Pointer, size uintptr, prevvalue unsafe.Pointer, returnedsize *uintptr) (err error) { r1, _, e1 := syscall.SyscallN(procUpdateProcThreadAttribute.Addr(), uintptr(unsafe.Pointer(attrlist)), uintptr(flags), uintptr(attr), uintptr(value), uintptr(size), uintptr(prevvalue), uintptr(unsafe.Pointer(returnedsize))) if r1 == 0 { err = errnoErr(e1) } return } func VirtualAlloc(address uintptr, size uintptr, alloctype uint32, protect uint32) (value uintptr, err error) { r0, _, e1 := syscall.SyscallN(procVirtualAlloc.Addr(), uintptr(address), uintptr(size), uintptr(alloctype), uintptr(protect)) value = uintptr(r0) if value == 0 { err = errnoErr(e1) } return } func VirtualFree(address uintptr, size uintptr, freetype uint32) (err error) { r1, _, e1 := syscall.SyscallN(procVirtualFree.Addr(), uintptr(address), uintptr(size), uintptr(freetype)) if r1 == 0 { err = errnoErr(e1) } return } func VirtualLock(addr uintptr, length uintptr) (err error) { r1, _, e1 := syscall.SyscallN(procVirtualLock.Addr(), uintptr(addr), uintptr(length)) if r1 == 0 { err = errnoErr(e1) } return } func VirtualProtect(address uintptr, size uintptr, newprotect uint32, oldprotect *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procVirtualProtect.Addr(), uintptr(address), uintptr(size), uintptr(newprotect), uintptr(unsafe.Pointer(oldprotect))) if r1 == 0 { err = errnoErr(e1) } return } func VirtualProtectEx(process Handle, address uintptr, size uintptr, newProtect uint32, oldProtect *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procVirtualProtectEx.Addr(), uintptr(process), uintptr(address), uintptr(size), uintptr(newProtect), uintptr(unsafe.Pointer(oldProtect))) if r1 == 0 { err = errnoErr(e1) } return } func VirtualQuery(address uintptr, buffer *MemoryBasicInformation, length uintptr) (err error) { r1, _, e1 := syscall.SyscallN(procVirtualQuery.Addr(), uintptr(address), uintptr(unsafe.Pointer(buffer)), uintptr(length)) if r1 == 0 { err = errnoErr(e1) } return } func VirtualQueryEx(process Handle, address uintptr, buffer *MemoryBasicInformation, length uintptr) (err error) { r1, _, e1 := syscall.SyscallN(procVirtualQueryEx.Addr(), uintptr(process), uintptr(address), uintptr(unsafe.Pointer(buffer)), uintptr(length)) if r1 == 0 { err = errnoErr(e1) } return } func VirtualUnlock(addr uintptr, length uintptr) (err error) { r1, _, e1 := syscall.SyscallN(procVirtualUnlock.Addr(), uintptr(addr), uintptr(length)) if r1 == 0 { err = errnoErr(e1) } return } func WTSGetActiveConsoleSessionId() (sessionID uint32) { r0, _, _ := syscall.SyscallN(procWTSGetActiveConsoleSessionId.Addr()) sessionID = uint32(r0) return } func WaitCommEvent(handle Handle, lpEvtMask *uint32, lpOverlapped *Overlapped) (err error) { r1, _, e1 := syscall.SyscallN(procWaitCommEvent.Addr(), uintptr(handle), uintptr(unsafe.Pointer(lpEvtMask)), uintptr(unsafe.Pointer(lpOverlapped))) if r1 == 0 { err = errnoErr(e1) } return } func waitForMultipleObjects(count uint32, handles uintptr, waitAll bool, waitMilliseconds uint32) (event uint32, err error) { var _p0 uint32 if waitAll { _p0 = 1 } r0, _, e1 := syscall.SyscallN(procWaitForMultipleObjects.Addr(), uintptr(count), uintptr(handles), uintptr(_p0), uintptr(waitMilliseconds)) event = uint32(r0) if event == 0xffffffff { err = errnoErr(e1) } return } func WaitForSingleObject(handle Handle, waitMilliseconds uint32) (event uint32, err error) { r0, _, e1 := syscall.SyscallN(procWaitForSingleObject.Addr(), uintptr(handle), uintptr(waitMilliseconds)) event = uint32(r0) if event == 0xffffffff { err = errnoErr(e1) } return } func WriteConsole(console Handle, buf *uint16, towrite uint32, written *uint32, reserved *byte) (err error) { r1, _, e1 := syscall.SyscallN(procWriteConsoleW.Addr(), uintptr(console), uintptr(unsafe.Pointer(buf)), uintptr(towrite), uintptr(unsafe.Pointer(written)), uintptr(unsafe.Pointer(reserved))) if r1 == 0 { err = errnoErr(e1) } return } func writeFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) (err error) { var _p0 *byte if len(buf) > 0 { _p0 = &buf[0] } r1, _, e1 := syscall.SyscallN(procWriteFile.Addr(), uintptr(handle), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(done)), uintptr(unsafe.Pointer(overlapped))) if r1 == 0 { err = errnoErr(e1) } return } func WriteProcessMemory(process Handle, baseAddress uintptr, buffer *byte, size uintptr, numberOfBytesWritten *uintptr) (err error) { r1, _, e1 := syscall.SyscallN(procWriteProcessMemory.Addr(), uintptr(process), uintptr(baseAddress), uintptr(unsafe.Pointer(buffer)), uintptr(size), uintptr(unsafe.Pointer(numberOfBytesWritten))) if r1 == 0 { err = errnoErr(e1) } return } func AcceptEx(ls Handle, as Handle, buf *byte, rxdatalen uint32, laddrlen uint32, raddrlen uint32, recvd *uint32, overlapped *Overlapped) (err error) { r1, _, e1 := syscall.SyscallN(procAcceptEx.Addr(), uintptr(ls), uintptr(as), uintptr(unsafe.Pointer(buf)), uintptr(rxdatalen), uintptr(laddrlen), uintptr(raddrlen), uintptr(unsafe.Pointer(recvd)), uintptr(unsafe.Pointer(overlapped))) if r1 == 0 { err = errnoErr(e1) } return } func GetAcceptExSockaddrs(buf *byte, rxdatalen uint32, laddrlen uint32, raddrlen uint32, lrsa **RawSockaddrAny, lrsalen *int32, rrsa **RawSockaddrAny, rrsalen *int32) { syscall.SyscallN(procGetAcceptExSockaddrs.Addr(), 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))) return } func TransmitFile(s Handle, handle Handle, bytesToWrite uint32, bytsPerSend uint32, overlapped *Overlapped, transmitFileBuf *TransmitFileBuffers, flags uint32) (err error) { r1, _, e1 := syscall.SyscallN(procTransmitFile.Addr(), uintptr(s), uintptr(handle), uintptr(bytesToWrite), uintptr(bytsPerSend), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(transmitFileBuf)), uintptr(flags)) if r1 == 0 { err = errnoErr(e1) } return } func NetApiBufferFree(buf *byte) (neterr error) { r0, _, _ := syscall.SyscallN(procNetApiBufferFree.Addr(), uintptr(unsafe.Pointer(buf))) if r0 != 0 { neterr = syscall.Errno(r0) } return } func NetGetJoinInformation(server *uint16, name **uint16, bufType *uint32) (neterr error) { r0, _, _ := syscall.SyscallN(procNetGetJoinInformation.Addr(), uintptr(unsafe.Pointer(server)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(bufType))) if r0 != 0 { neterr = syscall.Errno(r0) } return } func NetUserEnum(serverName *uint16, level uint32, filter uint32, buf **byte, prefMaxLen uint32, entriesRead *uint32, totalEntries *uint32, resumeHandle *uint32) (neterr error) { r0, _, _ := syscall.SyscallN(procNetUserEnum.Addr(), uintptr(unsafe.Pointer(serverName)), uintptr(level), uintptr(filter), uintptr(unsafe.Pointer(buf)), uintptr(prefMaxLen), uintptr(unsafe.Pointer(entriesRead)), uintptr(unsafe.Pointer(totalEntries)), uintptr(unsafe.Pointer(resumeHandle))) if r0 != 0 { neterr = syscall.Errno(r0) } return } func NetUserGetInfo(serverName *uint16, userName *uint16, level uint32, buf **byte) (neterr error) { r0, _, _ := syscall.SyscallN(procNetUserGetInfo.Addr(), uintptr(unsafe.Pointer(serverName)), uintptr(unsafe.Pointer(userName)), uintptr(level), uintptr(unsafe.Pointer(buf))) if r0 != 0 { neterr = syscall.Errno(r0) } return } func NtCreateFile(handle *Handle, access uint32, oa *OBJECT_ATTRIBUTES, iosb *IO_STATUS_BLOCK, allocationSize *int64, attributes uint32, share uint32, disposition uint32, options uint32, eabuffer uintptr, ealength uint32) (ntstatus error) { r0, _, _ := syscall.SyscallN(procNtCreateFile.Addr(), uintptr(unsafe.Pointer(handle)), uintptr(access), uintptr(unsafe.Pointer(oa)), uintptr(unsafe.Pointer(iosb)), uintptr(unsafe.Pointer(allocationSize)), uintptr(attributes), uintptr(share), uintptr(disposition), uintptr(options), uintptr(eabuffer), uintptr(ealength)) if r0 != 0 { ntstatus = NTStatus(r0) } return } func NtCreateNamedPipeFile(pipe *Handle, access uint32, oa *OBJECT_ATTRIBUTES, iosb *IO_STATUS_BLOCK, share uint32, disposition uint32, options uint32, typ uint32, readMode uint32, completionMode uint32, maxInstances uint32, inboundQuota uint32, outputQuota uint32, timeout *int64) (ntstatus error) { r0, _, _ := syscall.SyscallN(procNtCreateNamedPipeFile.Addr(), uintptr(unsafe.Pointer(pipe)), uintptr(access), uintptr(unsafe.Pointer(oa)), uintptr(unsafe.Pointer(iosb)), uintptr(share), uintptr(disposition), uintptr(options), uintptr(typ), uintptr(readMode), uintptr(completionMode), uintptr(maxInstances), uintptr(inboundQuota), uintptr(outputQuota), uintptr(unsafe.Pointer(timeout))) if r0 != 0 { ntstatus = NTStatus(r0) } return } func NtQueryInformationProcess(proc Handle, procInfoClass int32, procInfo unsafe.Pointer, procInfoLen uint32, retLen *uint32) (ntstatus error) { r0, _, _ := syscall.SyscallN(procNtQueryInformationProcess.Addr(), uintptr(proc), uintptr(procInfoClass), uintptr(procInfo), uintptr(procInfoLen), uintptr(unsafe.Pointer(retLen))) if r0 != 0 { ntstatus = NTStatus(r0) } return } func NtQuerySystemInformation(sysInfoClass int32, sysInfo unsafe.Pointer, sysInfoLen uint32, retLen *uint32) (ntstatus error) { r0, _, _ := syscall.SyscallN(procNtQuerySystemInformation.Addr(), uintptr(sysInfoClass), uintptr(sysInfo), uintptr(sysInfoLen), uintptr(unsafe.Pointer(retLen))) if r0 != 0 { ntstatus = NTStatus(r0) } return } func NtSetInformationFile(handle Handle, iosb *IO_STATUS_BLOCK, inBuffer *byte, inBufferLen uint32, class uint32) (ntstatus error) { r0, _, _ := syscall.SyscallN(procNtSetInformationFile.Addr(), uintptr(handle), uintptr(unsafe.Pointer(iosb)), uintptr(unsafe.Pointer(inBuffer)), uintptr(inBufferLen), uintptr(class)) if r0 != 0 { ntstatus = NTStatus(r0) } return } func NtSetInformationProcess(proc Handle, procInfoClass int32, procInfo unsafe.Pointer, procInfoLen uint32) (ntstatus error) { r0, _, _ := syscall.SyscallN(procNtSetInformationProcess.Addr(), uintptr(proc), uintptr(procInfoClass), uintptr(procInfo), uintptr(procInfoLen)) if r0 != 0 { ntstatus = NTStatus(r0) } return } func NtSetSystemInformation(sysInfoClass int32, sysInfo unsafe.Pointer, sysInfoLen uint32) (ntstatus error) { r0, _, _ := syscall.SyscallN(procNtSetSystemInformation.Addr(), uintptr(sysInfoClass), uintptr(sysInfo), uintptr(sysInfoLen)) if r0 != 0 { ntstatus = NTStatus(r0) } return } func RtlAddFunctionTable(functionTable *RUNTIME_FUNCTION, entryCount uint32, baseAddress uintptr) (ret bool) { r0, _, _ := syscall.SyscallN(procRtlAddFunctionTable.Addr(), uintptr(unsafe.Pointer(functionTable)), uintptr(entryCount), uintptr(baseAddress)) ret = r0 != 0 return } func RtlDefaultNpAcl(acl **ACL) (ntstatus error) { r0, _, _ := syscall.SyscallN(procRtlDefaultNpAcl.Addr(), uintptr(unsafe.Pointer(acl))) if r0 != 0 { ntstatus = NTStatus(r0) } return } func RtlDeleteFunctionTable(functionTable *RUNTIME_FUNCTION) (ret bool) { r0, _, _ := syscall.SyscallN(procRtlDeleteFunctionTable.Addr(), uintptr(unsafe.Pointer(functionTable))) ret = r0 != 0 return } func RtlDosPathNameToNtPathName(dosName *uint16, ntName *NTUnicodeString, ntFileNamePart *uint16, relativeName *RTL_RELATIVE_NAME) (ntstatus error) { r0, _, _ := syscall.SyscallN(procRtlDosPathNameToNtPathName_U_WithStatus.Addr(), uintptr(unsafe.Pointer(dosName)), uintptr(unsafe.Pointer(ntName)), uintptr(unsafe.Pointer(ntFileNamePart)), uintptr(unsafe.Pointer(relativeName))) if r0 != 0 { ntstatus = NTStatus(r0) } return } func RtlDosPathNameToRelativeNtPathName(dosName *uint16, ntName *NTUnicodeString, ntFileNamePart *uint16, relativeName *RTL_RELATIVE_NAME) (ntstatus error) { r0, _, _ := syscall.SyscallN(procRtlDosPathNameToRelativeNtPathName_U_WithStatus.Addr(), uintptr(unsafe.Pointer(dosName)), uintptr(unsafe.Pointer(ntName)), uintptr(unsafe.Pointer(ntFileNamePart)), uintptr(unsafe.Pointer(relativeName))) if r0 != 0 { ntstatus = NTStatus(r0) } return } func RtlGetCurrentPeb() (peb *PEB) { r0, _, _ := syscall.SyscallN(procRtlGetCurrentPeb.Addr()) peb = (*PEB)(unsafe.Pointer(r0)) return } func rtlGetNtVersionNumbers(majorVersion *uint32, minorVersion *uint32, buildNumber *uint32) { syscall.SyscallN(procRtlGetNtVersionNumbers.Addr(), uintptr(unsafe.Pointer(majorVersion)), uintptr(unsafe.Pointer(minorVersion)), uintptr(unsafe.Pointer(buildNumber))) return } func rtlGetVersion(info *OsVersionInfoEx) (ntstatus error) { r0, _, _ := syscall.SyscallN(procRtlGetVersion.Addr(), uintptr(unsafe.Pointer(info))) if r0 != 0 { ntstatus = NTStatus(r0) } return } func RtlInitString(destinationString *NTString, sourceString *byte) { syscall.SyscallN(procRtlInitString.Addr(), uintptr(unsafe.Pointer(destinationString)), uintptr(unsafe.Pointer(sourceString))) return } func RtlInitUnicodeString(destinationString *NTUnicodeString, sourceString *uint16) { syscall.SyscallN(procRtlInitUnicodeString.Addr(), uintptr(unsafe.Pointer(destinationString)), uintptr(unsafe.Pointer(sourceString))) return } func rtlNtStatusToDosErrorNoTeb(ntstatus NTStatus) (ret syscall.Errno) { r0, _, _ := syscall.SyscallN(procRtlNtStatusToDosErrorNoTeb.Addr(), uintptr(ntstatus)) ret = syscall.Errno(r0) return } func clsidFromString(lpsz *uint16, pclsid *GUID) (ret error) { r0, _, _ := syscall.SyscallN(procCLSIDFromString.Addr(), uintptr(unsafe.Pointer(lpsz)), uintptr(unsafe.Pointer(pclsid))) if r0 != 0 { ret = syscall.Errno(r0) } return } func coCreateGuid(pguid *GUID) (ret error) { r0, _, _ := syscall.SyscallN(procCoCreateGuid.Addr(), uintptr(unsafe.Pointer(pguid))) if r0 != 0 { ret = syscall.Errno(r0) } return } func CoGetObject(name *uint16, bindOpts *BIND_OPTS3, guid *GUID, functionTable **uintptr) (ret error) { r0, _, _ := syscall.SyscallN(procCoGetObject.Addr(), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(bindOpts)), uintptr(unsafe.Pointer(guid)), uintptr(unsafe.Pointer(functionTable))) if r0 != 0 { ret = syscall.Errno(r0) } return } func CoInitializeEx(reserved uintptr, coInit uint32) (ret error) { r0, _, _ := syscall.SyscallN(procCoInitializeEx.Addr(), uintptr(reserved), uintptr(coInit)) if r0 != 0 { ret = syscall.Errno(r0) } return } func CoTaskMemFree(address unsafe.Pointer) { syscall.SyscallN(procCoTaskMemFree.Addr(), uintptr(address)) return } func CoUninitialize() { syscall.SyscallN(procCoUninitialize.Addr()) return } func stringFromGUID2(rguid *GUID, lpsz *uint16, cchMax int32) (chars int32) { r0, _, _ := syscall.SyscallN(procStringFromGUID2.Addr(), uintptr(unsafe.Pointer(rguid)), uintptr(unsafe.Pointer(lpsz)), uintptr(cchMax)) chars = int32(r0) return } func EnumProcessModules(process Handle, module *Handle, cb uint32, cbNeeded *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procEnumProcessModules.Addr(), uintptr(process), uintptr(unsafe.Pointer(module)), uintptr(cb), uintptr(unsafe.Pointer(cbNeeded))) if r1 == 0 { err = errnoErr(e1) } return } func EnumProcessModulesEx(process Handle, module *Handle, cb uint32, cbNeeded *uint32, filterFlag uint32) (err error) { r1, _, e1 := syscall.SyscallN(procEnumProcessModulesEx.Addr(), uintptr(process), uintptr(unsafe.Pointer(module)), uintptr(cb), uintptr(unsafe.Pointer(cbNeeded)), uintptr(filterFlag)) if r1 == 0 { err = errnoErr(e1) } return } func enumProcesses(processIds *uint32, nSize uint32, bytesReturned *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procEnumProcesses.Addr(), uintptr(unsafe.Pointer(processIds)), uintptr(nSize), uintptr(unsafe.Pointer(bytesReturned))) if r1 == 0 { err = errnoErr(e1) } return } func GetModuleBaseName(process Handle, module Handle, baseName *uint16, size uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetModuleBaseNameW.Addr(), uintptr(process), uintptr(module), uintptr(unsafe.Pointer(baseName)), uintptr(size)) if r1 == 0 { err = errnoErr(e1) } return } func GetModuleFileNameEx(process Handle, module Handle, filename *uint16, size uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetModuleFileNameExW.Addr(), uintptr(process), uintptr(module), uintptr(unsafe.Pointer(filename)), uintptr(size)) if r1 == 0 { err = errnoErr(e1) } return } func GetModuleInformation(process Handle, module Handle, modinfo *ModuleInfo, cb uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetModuleInformation.Addr(), uintptr(process), uintptr(module), uintptr(unsafe.Pointer(modinfo)), uintptr(cb)) if r1 == 0 { err = errnoErr(e1) } return } func QueryWorkingSetEx(process Handle, pv uintptr, cb uint32) (err error) { r1, _, e1 := syscall.SyscallN(procQueryWorkingSetEx.Addr(), uintptr(process), uintptr(pv), uintptr(cb)) if r1 == 0 { err = errnoErr(e1) } return } func SubscribeServiceChangeNotifications(service Handle, eventType uint32, callback uintptr, callbackCtx uintptr, subscription *uintptr) (ret error) { ret = procSubscribeServiceChangeNotifications.Find() if ret != nil { return } r0, _, _ := syscall.SyscallN(procSubscribeServiceChangeNotifications.Addr(), uintptr(service), uintptr(eventType), uintptr(callback), uintptr(callbackCtx), uintptr(unsafe.Pointer(subscription))) if r0 != 0 { ret = syscall.Errno(r0) } return } func UnsubscribeServiceChangeNotifications(subscription uintptr) (err error) { err = procUnsubscribeServiceChangeNotifications.Find() if err != nil { return } syscall.SyscallN(procUnsubscribeServiceChangeNotifications.Addr(), uintptr(subscription)) return } func GetUserNameEx(nameFormat uint32, nameBuffre *uint16, nSize *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetUserNameExW.Addr(), uintptr(nameFormat), uintptr(unsafe.Pointer(nameBuffre)), uintptr(unsafe.Pointer(nSize))) if r1&0xff == 0 { err = errnoErr(e1) } return } func TranslateName(accName *uint16, accNameFormat uint32, desiredNameFormat uint32, translatedName *uint16, nSize *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procTranslateNameW.Addr(), uintptr(unsafe.Pointer(accName)), uintptr(accNameFormat), uintptr(desiredNameFormat), uintptr(unsafe.Pointer(translatedName)), uintptr(unsafe.Pointer(nSize))) if r1&0xff == 0 { err = errnoErr(e1) } return } func SetupDiBuildDriverInfoList(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverType SPDIT) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiBuildDriverInfoList.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(driverType)) if r1 == 0 { err = errnoErr(e1) } return } func SetupDiCallClassInstaller(installFunction DI_FUNCTION, deviceInfoSet DevInfo, deviceInfoData *DevInfoData) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiCallClassInstaller.Addr(), uintptr(installFunction), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData))) if r1 == 0 { err = errnoErr(e1) } return } func SetupDiCancelDriverInfoSearch(deviceInfoSet DevInfo) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiCancelDriverInfoSearch.Addr(), uintptr(deviceInfoSet)) if r1 == 0 { err = errnoErr(e1) } return } func setupDiClassGuidsFromNameEx(className *uint16, classGuidList *GUID, classGuidListSize uint32, requiredSize *uint32, machineName *uint16, reserved uintptr) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiClassGuidsFromNameExW.Addr(), uintptr(unsafe.Pointer(className)), uintptr(unsafe.Pointer(classGuidList)), uintptr(classGuidListSize), uintptr(unsafe.Pointer(requiredSize)), uintptr(unsafe.Pointer(machineName)), uintptr(reserved)) if r1 == 0 { err = errnoErr(e1) } return } func setupDiClassNameFromGuidEx(classGUID *GUID, className *uint16, classNameSize uint32, requiredSize *uint32, machineName *uint16, reserved uintptr) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiClassNameFromGuidExW.Addr(), uintptr(unsafe.Pointer(classGUID)), uintptr(unsafe.Pointer(className)), uintptr(classNameSize), uintptr(unsafe.Pointer(requiredSize)), uintptr(unsafe.Pointer(machineName)), uintptr(reserved)) if r1 == 0 { err = errnoErr(e1) } return } func setupDiCreateDeviceInfoListEx(classGUID *GUID, hwndParent uintptr, machineName *uint16, reserved uintptr) (handle DevInfo, err error) { r0, _, e1 := syscall.SyscallN(procSetupDiCreateDeviceInfoListExW.Addr(), uintptr(unsafe.Pointer(classGUID)), uintptr(hwndParent), uintptr(unsafe.Pointer(machineName)), uintptr(reserved)) handle = DevInfo(r0) if handle == DevInfo(InvalidHandle) { err = errnoErr(e1) } return } func setupDiCreateDeviceInfo(deviceInfoSet DevInfo, DeviceName *uint16, classGUID *GUID, DeviceDescription *uint16, hwndParent uintptr, CreationFlags DICD, deviceInfoData *DevInfoData) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiCreateDeviceInfoW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(DeviceName)), uintptr(unsafe.Pointer(classGUID)), uintptr(unsafe.Pointer(DeviceDescription)), uintptr(hwndParent), uintptr(CreationFlags), uintptr(unsafe.Pointer(deviceInfoData))) if r1 == 0 { err = errnoErr(e1) } return } func SetupDiDestroyDeviceInfoList(deviceInfoSet DevInfo) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiDestroyDeviceInfoList.Addr(), uintptr(deviceInfoSet)) if r1 == 0 { err = errnoErr(e1) } return } func SetupDiDestroyDriverInfoList(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverType SPDIT) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiDestroyDriverInfoList.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(driverType)) if r1 == 0 { err = errnoErr(e1) } return } func setupDiEnumDeviceInfo(deviceInfoSet DevInfo, memberIndex uint32, deviceInfoData *DevInfoData) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiEnumDeviceInfo.Addr(), uintptr(deviceInfoSet), uintptr(memberIndex), uintptr(unsafe.Pointer(deviceInfoData))) if r1 == 0 { err = errnoErr(e1) } return } func setupDiEnumDriverInfo(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverType SPDIT, memberIndex uint32, driverInfoData *DrvInfoData) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiEnumDriverInfoW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(driverType), uintptr(memberIndex), uintptr(unsafe.Pointer(driverInfoData))) if r1 == 0 { err = errnoErr(e1) } return } func setupDiGetClassDevsEx(classGUID *GUID, Enumerator *uint16, hwndParent uintptr, Flags DIGCF, deviceInfoSet DevInfo, machineName *uint16, reserved uintptr) (handle DevInfo, err error) { r0, _, e1 := syscall.SyscallN(procSetupDiGetClassDevsExW.Addr(), uintptr(unsafe.Pointer(classGUID)), uintptr(unsafe.Pointer(Enumerator)), uintptr(hwndParent), uintptr(Flags), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(machineName)), uintptr(reserved)) handle = DevInfo(r0) if handle == DevInfo(InvalidHandle) { err = errnoErr(e1) } return } func SetupDiGetClassInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, classInstallParams *ClassInstallHeader, classInstallParamsSize uint32, requiredSize *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiGetClassInstallParamsW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(classInstallParams)), uintptr(classInstallParamsSize), uintptr(unsafe.Pointer(requiredSize))) if r1 == 0 { err = errnoErr(e1) } return } func setupDiGetDeviceInfoListDetail(deviceInfoSet DevInfo, deviceInfoSetDetailData *DevInfoListDetailData) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiGetDeviceInfoListDetailW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoSetDetailData))) if r1 == 0 { err = errnoErr(e1) } return } func setupDiGetDeviceInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, deviceInstallParams *DevInstallParams) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiGetDeviceInstallParamsW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(deviceInstallParams))) if r1 == 0 { err = errnoErr(e1) } return } func setupDiGetDeviceInstanceId(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, instanceId *uint16, instanceIdSize uint32, instanceIdRequiredSize *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiGetDeviceInstanceIdW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(instanceId)), uintptr(instanceIdSize), uintptr(unsafe.Pointer(instanceIdRequiredSize))) if r1 == 0 { err = errnoErr(e1) } return } func setupDiGetDeviceProperty(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, propertyKey *DEVPROPKEY, propertyType *DEVPROPTYPE, propertyBuffer *byte, propertyBufferSize uint32, requiredSize *uint32, flags uint32) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiGetDevicePropertyW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(propertyKey)), uintptr(unsafe.Pointer(propertyType)), uintptr(unsafe.Pointer(propertyBuffer)), uintptr(propertyBufferSize), uintptr(unsafe.Pointer(requiredSize)), uintptr(flags)) if r1 == 0 { err = errnoErr(e1) } return } func setupDiGetDeviceRegistryProperty(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, property SPDRP, propertyRegDataType *uint32, propertyBuffer *byte, propertyBufferSize uint32, requiredSize *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiGetDeviceRegistryPropertyW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(property), uintptr(unsafe.Pointer(propertyRegDataType)), uintptr(unsafe.Pointer(propertyBuffer)), uintptr(propertyBufferSize), uintptr(unsafe.Pointer(requiredSize))) if r1 == 0 { err = errnoErr(e1) } return } func setupDiGetDriverInfoDetail(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverInfoData *DrvInfoData, driverInfoDetailData *DrvInfoDetailData, driverInfoDetailDataSize uint32, requiredSize *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiGetDriverInfoDetailW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(driverInfoData)), uintptr(unsafe.Pointer(driverInfoDetailData)), uintptr(driverInfoDetailDataSize), uintptr(unsafe.Pointer(requiredSize))) if r1 == 0 { err = errnoErr(e1) } return } func setupDiGetSelectedDevice(deviceInfoSet DevInfo, deviceInfoData *DevInfoData) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiGetSelectedDevice.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData))) if r1 == 0 { err = errnoErr(e1) } return } func setupDiGetSelectedDriver(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverInfoData *DrvInfoData) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiGetSelectedDriverW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(driverInfoData))) if r1 == 0 { err = errnoErr(e1) } return } func SetupDiOpenDevRegKey(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, Scope DICS_FLAG, HwProfile uint32, KeyType DIREG, samDesired uint32) (key Handle, err error) { r0, _, e1 := syscall.SyscallN(procSetupDiOpenDevRegKey.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(Scope), uintptr(HwProfile), uintptr(KeyType), uintptr(samDesired)) key = Handle(r0) if key == InvalidHandle { err = errnoErr(e1) } return } func SetupDiSetClassInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, classInstallParams *ClassInstallHeader, classInstallParamsSize uint32) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiSetClassInstallParamsW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(classInstallParams)), uintptr(classInstallParamsSize)) if r1 == 0 { err = errnoErr(e1) } return } func SetupDiSetDeviceInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, deviceInstallParams *DevInstallParams) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiSetDeviceInstallParamsW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(deviceInstallParams))) if r1 == 0 { err = errnoErr(e1) } return } func setupDiSetDeviceRegistryProperty(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, property SPDRP, propertyBuffer *byte, propertyBufferSize uint32) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiSetDeviceRegistryPropertyW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(property), uintptr(unsafe.Pointer(propertyBuffer)), uintptr(propertyBufferSize)) if r1 == 0 { err = errnoErr(e1) } return } func SetupDiSetSelectedDevice(deviceInfoSet DevInfo, deviceInfoData *DevInfoData) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiSetSelectedDevice.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData))) if r1 == 0 { err = errnoErr(e1) } return } func SetupDiSetSelectedDriver(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverInfoData *DrvInfoData) (err error) { r1, _, e1 := syscall.SyscallN(procSetupDiSetSelectedDriverW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(driverInfoData))) if r1 == 0 { err = errnoErr(e1) } return } func setupUninstallOEMInf(infFileName *uint16, flags SUOI, reserved uintptr) (err error) { r1, _, e1 := syscall.SyscallN(procSetupUninstallOEMInfW.Addr(), uintptr(unsafe.Pointer(infFileName)), uintptr(flags), uintptr(reserved)) if r1 == 0 { err = errnoErr(e1) } return } func commandLineToArgv(cmd *uint16, argc *int32) (argv **uint16, err error) { r0, _, e1 := syscall.SyscallN(procCommandLineToArgvW.Addr(), uintptr(unsafe.Pointer(cmd)), uintptr(unsafe.Pointer(argc))) argv = (**uint16)(unsafe.Pointer(r0)) if argv == nil { err = errnoErr(e1) } return } func shGetKnownFolderPath(id *KNOWNFOLDERID, flags uint32, token Token, path **uint16) (ret error) { r0, _, _ := syscall.SyscallN(procSHGetKnownFolderPath.Addr(), uintptr(unsafe.Pointer(id)), uintptr(flags), uintptr(token), uintptr(unsafe.Pointer(path))) if r0 != 0 { ret = syscall.Errno(r0) } return } func ShellExecute(hwnd Handle, verb *uint16, file *uint16, args *uint16, cwd *uint16, showCmd int32) (err error) { r1, _, e1 := syscall.SyscallN(procShellExecuteW.Addr(), uintptr(hwnd), uintptr(unsafe.Pointer(verb)), uintptr(unsafe.Pointer(file)), uintptr(unsafe.Pointer(args)), uintptr(unsafe.Pointer(cwd)), uintptr(showCmd)) if r1 <= 32 { err = errnoErr(e1) } return } func EnumChildWindows(hwnd HWND, enumFunc uintptr, param unsafe.Pointer) { syscall.SyscallN(procEnumChildWindows.Addr(), uintptr(hwnd), uintptr(enumFunc), uintptr(param)) return } func EnumWindows(enumFunc uintptr, param unsafe.Pointer) (err error) { r1, _, e1 := syscall.SyscallN(procEnumWindows.Addr(), uintptr(enumFunc), uintptr(param)) if r1 == 0 { err = errnoErr(e1) } return } func ExitWindowsEx(flags uint32, reason uint32) (err error) { r1, _, e1 := syscall.SyscallN(procExitWindowsEx.Addr(), uintptr(flags), uintptr(reason)) if r1 == 0 { err = errnoErr(e1) } return } func GetClassName(hwnd HWND, className *uint16, maxCount int32) (copied int32, err error) { r0, _, e1 := syscall.SyscallN(procGetClassNameW.Addr(), uintptr(hwnd), uintptr(unsafe.Pointer(className)), uintptr(maxCount)) copied = int32(r0) if copied == 0 { err = errnoErr(e1) } return } func GetDesktopWindow() (hwnd HWND) { r0, _, _ := syscall.SyscallN(procGetDesktopWindow.Addr()) hwnd = HWND(r0) return } func GetForegroundWindow() (hwnd HWND) { r0, _, _ := syscall.SyscallN(procGetForegroundWindow.Addr()) hwnd = HWND(r0) return } func GetGUIThreadInfo(thread uint32, info *GUIThreadInfo) (err error) { r1, _, e1 := syscall.SyscallN(procGetGUIThreadInfo.Addr(), uintptr(thread), uintptr(unsafe.Pointer(info))) if r1 == 0 { err = errnoErr(e1) } return } func GetKeyboardLayout(tid uint32) (hkl Handle) { r0, _, _ := syscall.SyscallN(procGetKeyboardLayout.Addr(), uintptr(tid)) hkl = Handle(r0) return } func GetShellWindow() (shellWindow HWND) { r0, _, _ := syscall.SyscallN(procGetShellWindow.Addr()) shellWindow = HWND(r0) return } func GetWindowThreadProcessId(hwnd HWND, pid *uint32) (tid uint32, err error) { r0, _, e1 := syscall.SyscallN(procGetWindowThreadProcessId.Addr(), uintptr(hwnd), uintptr(unsafe.Pointer(pid))) tid = uint32(r0) if tid == 0 { err = errnoErr(e1) } return } func IsWindow(hwnd HWND) (isWindow bool) { r0, _, _ := syscall.SyscallN(procIsWindow.Addr(), uintptr(hwnd)) isWindow = r0 != 0 return } func IsWindowUnicode(hwnd HWND) (isUnicode bool) { r0, _, _ := syscall.SyscallN(procIsWindowUnicode.Addr(), uintptr(hwnd)) isUnicode = r0 != 0 return } func IsWindowVisible(hwnd HWND) (isVisible bool) { r0, _, _ := syscall.SyscallN(procIsWindowVisible.Addr(), uintptr(hwnd)) isVisible = r0 != 0 return } func LoadKeyboardLayout(name *uint16, flags uint32) (hkl Handle, err error) { r0, _, e1 := syscall.SyscallN(procLoadKeyboardLayoutW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(flags)) hkl = Handle(r0) if hkl == 0 { err = errnoErr(e1) } return } func MessageBox(hwnd HWND, text *uint16, caption *uint16, boxtype uint32) (ret int32, err error) { r0, _, e1 := syscall.SyscallN(procMessageBoxW.Addr(), uintptr(hwnd), uintptr(unsafe.Pointer(text)), uintptr(unsafe.Pointer(caption)), uintptr(boxtype)) ret = int32(r0) if ret == 0 { err = errnoErr(e1) } return } func ToUnicodeEx(vkey uint32, scancode uint32, keystate *byte, pwszBuff *uint16, cchBuff int32, flags uint32, hkl Handle) (ret int32) { r0, _, _ := syscall.SyscallN(procToUnicodeEx.Addr(), uintptr(vkey), uintptr(scancode), uintptr(unsafe.Pointer(keystate)), uintptr(unsafe.Pointer(pwszBuff)), uintptr(cchBuff), uintptr(flags), uintptr(hkl)) ret = int32(r0) return } func UnloadKeyboardLayout(hkl Handle) (err error) { r1, _, e1 := syscall.SyscallN(procUnloadKeyboardLayout.Addr(), uintptr(hkl)) if r1 == 0 { err = errnoErr(e1) } return } func CreateEnvironmentBlock(block **uint16, token Token, inheritExisting bool) (err error) { var _p0 uint32 if inheritExisting { _p0 = 1 } r1, _, e1 := syscall.SyscallN(procCreateEnvironmentBlock.Addr(), uintptr(unsafe.Pointer(block)), uintptr(token), uintptr(_p0)) if r1 == 0 { err = errnoErr(e1) } return } func DestroyEnvironmentBlock(block *uint16) (err error) { r1, _, e1 := syscall.SyscallN(procDestroyEnvironmentBlock.Addr(), uintptr(unsafe.Pointer(block))) if r1 == 0 { err = errnoErr(e1) } return } func GetUserProfileDirectory(t Token, dir *uint16, dirLen *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procGetUserProfileDirectoryW.Addr(), uintptr(t), uintptr(unsafe.Pointer(dir)), uintptr(unsafe.Pointer(dirLen))) if r1 == 0 { err = errnoErr(e1) } return } func GetFileVersionInfoSize(filename string, zeroHandle *Handle) (bufSize uint32, err error) { var _p0 *uint16 _p0, err = syscall.UTF16PtrFromString(filename) if err != nil { return } return _GetFileVersionInfoSize(_p0, zeroHandle) } func _GetFileVersionInfoSize(filename *uint16, zeroHandle *Handle) (bufSize uint32, err error) { r0, _, e1 := syscall.SyscallN(procGetFileVersionInfoSizeW.Addr(), uintptr(unsafe.Pointer(filename)), uintptr(unsafe.Pointer(zeroHandle))) bufSize = uint32(r0) if bufSize == 0 { err = errnoErr(e1) } return } func GetFileVersionInfo(filename string, handle uint32, bufSize uint32, buffer unsafe.Pointer) (err error) { var _p0 *uint16 _p0, err = syscall.UTF16PtrFromString(filename) if err != nil { return } return _GetFileVersionInfo(_p0, handle, bufSize, buffer) } func _GetFileVersionInfo(filename *uint16, handle uint32, bufSize uint32, buffer unsafe.Pointer) (err error) { r1, _, e1 := syscall.SyscallN(procGetFileVersionInfoW.Addr(), uintptr(unsafe.Pointer(filename)), uintptr(handle), uintptr(bufSize), uintptr(buffer)) if r1 == 0 { err = errnoErr(e1) } return } func VerQueryValue(block unsafe.Pointer, subBlock string, pointerToBufferPointer unsafe.Pointer, bufSize *uint32) (err error) { var _p0 *uint16 _p0, err = syscall.UTF16PtrFromString(subBlock) if err != nil { return } return _VerQueryValue(block, _p0, pointerToBufferPointer, bufSize) } func _VerQueryValue(block unsafe.Pointer, subBlock *uint16, pointerToBufferPointer unsafe.Pointer, bufSize *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procVerQueryValueW.Addr(), uintptr(block), uintptr(unsafe.Pointer(subBlock)), uintptr(pointerToBufferPointer), uintptr(unsafe.Pointer(bufSize))) if r1 == 0 { err = errnoErr(e1) } return } func TimeBeginPeriod(period uint32) (err error) { r1, _, e1 := syscall.SyscallN(proctimeBeginPeriod.Addr(), uintptr(period)) if r1 != 0 { err = errnoErr(e1) } return } func TimeEndPeriod(period uint32) (err error) { r1, _, e1 := syscall.SyscallN(proctimeEndPeriod.Addr(), uintptr(period)) if r1 != 0 { err = errnoErr(e1) } return } func WinVerifyTrustEx(hwnd HWND, actionId *GUID, data *WinTrustData) (ret error) { r0, _, _ := syscall.SyscallN(procWinVerifyTrustEx.Addr(), uintptr(hwnd), uintptr(unsafe.Pointer(actionId)), uintptr(unsafe.Pointer(data))) if r0 != 0 { ret = syscall.Errno(r0) } return } func FreeAddrInfoW(addrinfo *AddrinfoW) { syscall.SyscallN(procFreeAddrInfoW.Addr(), uintptr(unsafe.Pointer(addrinfo))) return } func GetAddrInfoW(nodename *uint16, servicename *uint16, hints *AddrinfoW, result **AddrinfoW) (sockerr error) { r0, _, _ := syscall.SyscallN(procGetAddrInfoW.Addr(), uintptr(unsafe.Pointer(nodename)), uintptr(unsafe.Pointer(servicename)), uintptr(unsafe.Pointer(hints)), uintptr(unsafe.Pointer(result))) if r0 != 0 { sockerr = syscall.Errno(r0) } return } func WSACleanup() (err error) { r1, _, e1 := syscall.SyscallN(procWSACleanup.Addr()) if r1 == socket_error { err = errnoErr(e1) } return } func WSADuplicateSocket(s Handle, processID uint32, info *WSAProtocolInfo) (err error) { r1, _, e1 := syscall.SyscallN(procWSADuplicateSocketW.Addr(), uintptr(s), uintptr(processID), uintptr(unsafe.Pointer(info))) if r1 != 0 { err = errnoErr(e1) } return } func WSAEnumProtocols(protocols *int32, protocolBuffer *WSAProtocolInfo, bufferLength *uint32) (n int32, err error) { r0, _, e1 := syscall.SyscallN(procWSAEnumProtocolsW.Addr(), uintptr(unsafe.Pointer(protocols)), uintptr(unsafe.Pointer(protocolBuffer)), uintptr(unsafe.Pointer(bufferLength))) n = int32(r0) if n == -1 { err = errnoErr(e1) } return } func WSAGetOverlappedResult(h Handle, o *Overlapped, bytes *uint32, wait bool, flags *uint32) (err error) { var _p0 uint32 if wait { _p0 = 1 } r1, _, e1 := syscall.SyscallN(procWSAGetOverlappedResult.Addr(), uintptr(h), uintptr(unsafe.Pointer(o)), uintptr(unsafe.Pointer(bytes)), uintptr(_p0), uintptr(unsafe.Pointer(flags))) if r1 == 0 { err = errnoErr(e1) } return } func WSAIoctl(s Handle, iocc uint32, inbuf *byte, cbif uint32, outbuf *byte, cbob uint32, cbbr *uint32, overlapped *Overlapped, completionRoutine uintptr) (err error) { r1, _, e1 := syscall.SyscallN(procWSAIoctl.Addr(), 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)) if r1 == socket_error { err = errnoErr(e1) } return } func WSALookupServiceBegin(querySet *WSAQUERYSET, flags uint32, handle *Handle) (err error) { r1, _, e1 := syscall.SyscallN(procWSALookupServiceBeginW.Addr(), uintptr(unsafe.Pointer(querySet)), uintptr(flags), uintptr(unsafe.Pointer(handle))) if r1 == socket_error { err = errnoErr(e1) } return } func WSALookupServiceEnd(handle Handle) (err error) { r1, _, e1 := syscall.SyscallN(procWSALookupServiceEnd.Addr(), uintptr(handle)) if r1 == socket_error { err = errnoErr(e1) } return } func WSALookupServiceNext(handle Handle, flags uint32, size *int32, querySet *WSAQUERYSET) (err error) { r1, _, e1 := syscall.SyscallN(procWSALookupServiceNextW.Addr(), uintptr(handle), uintptr(flags), uintptr(unsafe.Pointer(size)), uintptr(unsafe.Pointer(querySet))) if r1 == socket_error { err = errnoErr(e1) } return } func WSARecv(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32, overlapped *Overlapped, croutine *byte) (err error) { r1, _, e1 := syscall.SyscallN(procWSARecv.Addr(), uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(recvd)), uintptr(unsafe.Pointer(flags)), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine))) if r1 == socket_error { err = errnoErr(e1) } return } func WSARecvFrom(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32, from *RawSockaddrAny, fromlen *int32, overlapped *Overlapped, croutine *byte) (err error) { r1, _, e1 := syscall.SyscallN(procWSARecvFrom.Addr(), 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))) if r1 == socket_error { err = errnoErr(e1) } return } func WSASend(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, overlapped *Overlapped, croutine *byte) (err error) { r1, _, e1 := syscall.SyscallN(procWSASend.Addr(), uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(sent)), uintptr(flags), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine))) if r1 == socket_error { err = errnoErr(e1) } return } func WSASendTo(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, to *RawSockaddrAny, tolen int32, overlapped *Overlapped, croutine *byte) (err error) { r1, _, e1 := syscall.SyscallN(procWSASendTo.Addr(), 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))) if r1 == socket_error { err = errnoErr(e1) } return } func WSASocket(af int32, typ int32, protocol int32, protoInfo *WSAProtocolInfo, group uint32, flags uint32) (handle Handle, err error) { r0, _, e1 := syscall.SyscallN(procWSASocketW.Addr(), uintptr(af), uintptr(typ), uintptr(protocol), uintptr(unsafe.Pointer(protoInfo)), uintptr(group), uintptr(flags)) handle = Handle(r0) if handle == InvalidHandle { err = errnoErr(e1) } return } func WSAStartup(verreq uint32, data *WSAData) (sockerr error) { r0, _, _ := syscall.SyscallN(procWSAStartup.Addr(), uintptr(verreq), uintptr(unsafe.Pointer(data))) if r0 != 0 { sockerr = syscall.Errno(r0) } return } func bind(s Handle, name unsafe.Pointer, namelen int32) (err error) { r1, _, e1 := syscall.SyscallN(procbind.Addr(), uintptr(s), uintptr(name), uintptr(namelen)) if r1 == socket_error { err = errnoErr(e1) } return } func Closesocket(s Handle) (err error) { r1, _, e1 := syscall.SyscallN(procclosesocket.Addr(), uintptr(s)) if r1 == socket_error { err = errnoErr(e1) } return } func connect(s Handle, name unsafe.Pointer, namelen int32) (err error) { r1, _, e1 := syscall.SyscallN(procconnect.Addr(), uintptr(s), uintptr(name), uintptr(namelen)) if r1 == socket_error { err = errnoErr(e1) } return } func GetHostByName(name string) (h *Hostent, err error) { var _p0 *byte _p0, err = syscall.BytePtrFromString(name) if err != nil { return } return _GetHostByName(_p0) } func _GetHostByName(name *byte) (h *Hostent, err error) { r0, _, e1 := syscall.SyscallN(procgethostbyname.Addr(), uintptr(unsafe.Pointer(name))) h = (*Hostent)(unsafe.Pointer(r0)) if h == nil { err = errnoErr(e1) } return } func getpeername(s Handle, rsa *RawSockaddrAny, addrlen *int32) (err error) { r1, _, e1 := syscall.SyscallN(procgetpeername.Addr(), uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if r1 == socket_error { err = errnoErr(e1) } return } func GetProtoByName(name string) (p *Protoent, err error) { var _p0 *byte _p0, err = syscall.BytePtrFromString(name) if err != nil { return } return _GetProtoByName(_p0) } func _GetProtoByName(name *byte) (p *Protoent, err error) { r0, _, e1 := syscall.SyscallN(procgetprotobyname.Addr(), uintptr(unsafe.Pointer(name))) p = (*Protoent)(unsafe.Pointer(r0)) if p == nil { err = errnoErr(e1) } return } func GetServByName(name string, proto string) (s *Servent, err error) { var _p0 *byte _p0, err = syscall.BytePtrFromString(name) if err != nil { return } var _p1 *byte _p1, err = syscall.BytePtrFromString(proto) if err != nil { return } return _GetServByName(_p0, _p1) } func _GetServByName(name *byte, proto *byte) (s *Servent, err error) { r0, _, e1 := syscall.SyscallN(procgetservbyname.Addr(), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(proto))) s = (*Servent)(unsafe.Pointer(r0)) if s == nil { err = errnoErr(e1) } return } func getsockname(s Handle, rsa *RawSockaddrAny, addrlen *int32) (err error) { r1, _, e1 := syscall.SyscallN(procgetsockname.Addr(), uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if r1 == socket_error { err = errnoErr(e1) } return } func Getsockopt(s Handle, level int32, optname int32, optval *byte, optlen *int32) (err error) { r1, _, e1 := syscall.SyscallN(procgetsockopt.Addr(), uintptr(s), uintptr(level), uintptr(optname), uintptr(unsafe.Pointer(optval)), uintptr(unsafe.Pointer(optlen))) if r1 == socket_error { err = errnoErr(e1) } return } func listen(s Handle, backlog int32) (err error) { r1, _, e1 := syscall.SyscallN(proclisten.Addr(), uintptr(s), uintptr(backlog)) if r1 == socket_error { err = errnoErr(e1) } return } func Ntohs(netshort uint16) (u uint16) { r0, _, _ := syscall.SyscallN(procntohs.Addr(), uintptr(netshort)) u = uint16(r0) return } func recvfrom(s Handle, buf []byte, flags int32, from *RawSockaddrAny, fromlen *int32) (n int32, err error) { var _p0 *byte if len(buf) > 0 { _p0 = &buf[0] } r0, _, e1 := syscall.SyscallN(procrecvfrom.Addr(), uintptr(s), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int32(r0) if n == -1 { err = errnoErr(e1) } return } func sendto(s Handle, buf []byte, flags int32, to unsafe.Pointer, tolen int32) (err error) { var _p0 *byte if len(buf) > 0 { _p0 = &buf[0] } r1, _, e1 := syscall.SyscallN(procsendto.Addr(), uintptr(s), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(tolen)) if r1 == socket_error { err = errnoErr(e1) } return } func Setsockopt(s Handle, level int32, optname int32, optval *byte, optlen int32) (err error) { r1, _, e1 := syscall.SyscallN(procsetsockopt.Addr(), uintptr(s), uintptr(level), uintptr(optname), uintptr(unsafe.Pointer(optval)), uintptr(optlen)) if r1 == socket_error { err = errnoErr(e1) } return } func shutdown(s Handle, how int32) (err error) { r1, _, e1 := syscall.SyscallN(procshutdown.Addr(), uintptr(s), uintptr(how)) if r1 == socket_error { err = errnoErr(e1) } return } func socket(af int32, typ int32, protocol int32) (handle Handle, err error) { r0, _, e1 := syscall.SyscallN(procsocket.Addr(), uintptr(af), uintptr(typ), uintptr(protocol)) handle = Handle(r0) if handle == InvalidHandle { err = errnoErr(e1) } return } func WTSEnumerateSessions(handle Handle, reserved uint32, version uint32, sessions **WTS_SESSION_INFO, count *uint32) (err error) { r1, _, e1 := syscall.SyscallN(procWTSEnumerateSessionsW.Addr(), uintptr(handle), uintptr(reserved), uintptr(version), uintptr(unsafe.Pointer(sessions)), uintptr(unsafe.Pointer(count))) if r1 == 0 { err = errnoErr(e1) } return } func WTSFreeMemory(ptr uintptr) { syscall.SyscallN(procWTSFreeMemory.Addr(), uintptr(ptr)) return } func WTSQueryUserToken(session uint32, token *Token) (err error) { r1, _, e1 := syscall.SyscallN(procWTSQueryUserToken.Addr(), uintptr(session), uintptr(unsafe.Pointer(token))) if r1 == 0 { err = errnoErr(e1) } return } ================================================ FILE: vendor/golang.org/x/term/CONTRIBUTING.md ================================================ # Contributing to Go Go is an open source project. It is the work of hundreds of contributors. We appreciate your help! ## Filing issues When [filing an issue](https://golang.org/issue/new), make sure to answer these five questions: 1. What version of Go are you using (`go version`)? 2. What operating system and processor architecture are you using? 3. What did you do? 4. What did you expect to see? 5. What did you see instead? General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker. The gophers there will answer or ask you to file an issue if you've tripped over a bug. ## Contributing code Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html) before sending patches. Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file. ================================================ FILE: vendor/golang.org/x/term/LICENSE ================================================ Copyright 2009 The Go Authors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: vendor/golang.org/x/term/PATENTS ================================================ Additional IP Rights Grant (Patents) "This implementation" means the copyrightable works distributed by Google as part of the Go project. Google hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, transfer and otherwise run, modify and propagate the contents of this implementation of Go, where such license applies only to those patent claims, both currently owned or controlled by Google and acquired in the future, licensable by Google that are necessarily infringed by this implementation of Go. This grant does not include claims that would be infringed only as a consequence of further modification of this implementation. If you or your agent or exclusive licensee institute or order or agree to the institution of patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that this implementation of Go or any code incorporated within this implementation of Go constitutes direct or contributory patent infringement, or inducement of patent infringement, then any patent rights granted to you under this License for this implementation of Go shall terminate as of the date such litigation is filed. ================================================ FILE: vendor/golang.org/x/term/README.md ================================================ # Go terminal/console support [![Go Reference](https://pkg.go.dev/badge/golang.org/x/term.svg)](https://pkg.go.dev/golang.org/x/term) This repository provides Go terminal and console support packages. ## Report Issues / Send Patches This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://go.dev/doc/contribute. The git repository is https://go.googlesource.com/term. The main issue tracker for the term repository is located at https://go.dev/issues. Prefix your issue with "x/term:" in the subject line, so it is easy to find. ================================================ FILE: vendor/golang.org/x/term/codereview.cfg ================================================ issuerepo: golang/go ================================================ FILE: vendor/golang.org/x/term/term.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package term provides support functions for dealing with terminals, as // commonly found on UNIX systems. // // Putting a terminal into raw mode is the most common requirement: // // oldState, err := term.MakeRaw(int(os.Stdin.Fd())) // if err != nil { // panic(err) // } // defer term.Restore(int(os.Stdin.Fd()), oldState) // // Note that on non-Unix systems os.Stdin.Fd() may not be 0. package term // State contains the state of a terminal. type State struct { state } // IsTerminal returns whether the given file descriptor is a terminal. func IsTerminal(fd int) bool { return isTerminal(fd) } // MakeRaw puts the terminal connected to the given file descriptor into raw // mode and returns the previous state of the terminal so that it can be // restored. func MakeRaw(fd int) (*State, error) { return makeRaw(fd) } // GetState returns the current state of a terminal which may be useful to // restore the terminal after a signal. func GetState(fd int) (*State, error) { return getState(fd) } // Restore restores the terminal connected to the given file descriptor to a // previous state. func Restore(fd int, oldState *State) error { return restore(fd, oldState) } // GetSize returns the visible dimensions of the given terminal. // // These dimensions don't include any scrollback buffer height. func GetSize(fd int) (width, height int, err error) { return getSize(fd) } // ReadPassword reads a line of input from a terminal without local echo. This // is commonly used for inputting passwords and other sensitive data. The slice // returned does not include the \n. func ReadPassword(fd int) ([]byte, error) { return readPassword(fd) } ================================================ FILE: vendor/golang.org/x/term/term_plan9.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package term import ( "fmt" "runtime" "golang.org/x/sys/plan9" ) type state struct{} func isTerminal(fd int) bool { path, err := plan9.Fd2path(fd) if err != nil { return false } return path == "/dev/cons" || path == "/mnt/term/dev/cons" } func makeRaw(fd int) (*State, error) { return nil, fmt.Errorf("terminal: MakeRaw not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) } func getState(fd int) (*State, error) { return nil, fmt.Errorf("terminal: GetState not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) } func restore(fd int, state *State) error { return fmt.Errorf("terminal: Restore not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) } func getSize(fd int) (width, height int, err error) { return 0, 0, fmt.Errorf("terminal: GetSize not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) } func readPassword(fd int) ([]byte, error) { return nil, fmt.Errorf("terminal: ReadPassword not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) } ================================================ FILE: vendor/golang.org/x/term/term_unix.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos package term import ( "golang.org/x/sys/unix" ) type state struct { termios unix.Termios } func isTerminal(fd int) bool { _, err := unix.IoctlGetTermios(fd, ioctlReadTermios) return err == nil } func makeRaw(fd int) (*State, error) { termios, err := unix.IoctlGetTermios(fd, ioctlReadTermios) if err != nil { return nil, err } oldState := State{state{termios: *termios}} // This attempts to replicate the behaviour documented for cfmakeraw in // the termios(3) manpage. termios.Iflag &^= unix.IGNBRK | unix.BRKINT | unix.PARMRK | unix.ISTRIP | unix.INLCR | unix.IGNCR | unix.ICRNL | unix.IXON termios.Oflag &^= unix.OPOST termios.Lflag &^= unix.ECHO | unix.ECHONL | unix.ICANON | unix.ISIG | unix.IEXTEN termios.Cflag &^= unix.CSIZE | unix.PARENB termios.Cflag |= unix.CS8 termios.Cc[unix.VMIN] = 1 termios.Cc[unix.VTIME] = 0 if err := unix.IoctlSetTermios(fd, ioctlWriteTermios, termios); err != nil { return nil, err } return &oldState, nil } func getState(fd int) (*State, error) { termios, err := unix.IoctlGetTermios(fd, ioctlReadTermios) if err != nil { return nil, err } return &State{state{termios: *termios}}, nil } func restore(fd int, state *State) error { return unix.IoctlSetTermios(fd, ioctlWriteTermios, &state.termios) } func getSize(fd int) (width, height int, err error) { ws, err := unix.IoctlGetWinsize(fd, unix.TIOCGWINSZ) if err != nil { return 0, 0, err } return int(ws.Col), int(ws.Row), nil } // passwordReader is an io.Reader that reads from a specific file descriptor. type passwordReader int func (r passwordReader) Read(buf []byte) (int, error) { return unix.Read(int(r), buf) } func readPassword(fd int) ([]byte, error) { termios, err := unix.IoctlGetTermios(fd, ioctlReadTermios) if err != nil { return nil, err } newState := *termios newState.Lflag &^= unix.ECHO newState.Lflag |= unix.ICANON | unix.ISIG newState.Iflag |= unix.ICRNL if err := unix.IoctlSetTermios(fd, ioctlWriteTermios, &newState); err != nil { return nil, err } defer unix.IoctlSetTermios(fd, ioctlWriteTermios, termios) return readPasswordLine(passwordReader(fd)) } ================================================ FILE: vendor/golang.org/x/term/term_unix_bsd.go ================================================ // Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build darwin || dragonfly || freebsd || netbsd || openbsd package term import "golang.org/x/sys/unix" const ioctlReadTermios = unix.TIOCGETA const ioctlWriteTermios = unix.TIOCSETA ================================================ FILE: vendor/golang.org/x/term/term_unix_other.go ================================================ // Copyright 2021 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build aix || linux || solaris || zos package term import "golang.org/x/sys/unix" const ioctlReadTermios = unix.TCGETS const ioctlWriteTermios = unix.TCSETS ================================================ FILE: vendor/golang.org/x/term/term_unsupported.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !zos && !windows && !solaris && !plan9 package term import ( "fmt" "runtime" ) type state struct{} func isTerminal(fd int) bool { return false } func makeRaw(fd int) (*State, error) { return nil, fmt.Errorf("terminal: MakeRaw not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) } func getState(fd int) (*State, error) { return nil, fmt.Errorf("terminal: GetState not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) } func restore(fd int, state *State) error { return fmt.Errorf("terminal: Restore not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) } func getSize(fd int) (width, height int, err error) { return 0, 0, fmt.Errorf("terminal: GetSize not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) } func readPassword(fd int) ([]byte, error) { return nil, fmt.Errorf("terminal: ReadPassword not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) } ================================================ FILE: vendor/golang.org/x/term/term_windows.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package term import ( "os" "golang.org/x/sys/windows" ) type state struct { mode uint32 } func isTerminal(fd int) bool { var st uint32 err := windows.GetConsoleMode(windows.Handle(fd), &st) return err == nil } // This is intended to be used on a console input handle. // See https://learn.microsoft.com/en-us/windows/console/setconsolemode func makeRaw(fd int) (*State, error) { var st uint32 if err := windows.GetConsoleMode(windows.Handle(fd), &st); err != nil { return nil, err } raw := st &^ (windows.ENABLE_ECHO_INPUT | windows.ENABLE_PROCESSED_INPUT | windows.ENABLE_LINE_INPUT) raw |= windows.ENABLE_VIRTUAL_TERMINAL_INPUT if err := windows.SetConsoleMode(windows.Handle(fd), raw); err != nil { return nil, err } return &State{state{st}}, nil } func getState(fd int) (*State, error) { var st uint32 if err := windows.GetConsoleMode(windows.Handle(fd), &st); err != nil { return nil, err } return &State{state{st}}, nil } func restore(fd int, state *State) error { return windows.SetConsoleMode(windows.Handle(fd), state.mode) } func getSize(fd int) (width, height int, err error) { var info windows.ConsoleScreenBufferInfo if err := windows.GetConsoleScreenBufferInfo(windows.Handle(fd), &info); err != nil { return 0, 0, err } return int(info.Window.Right - info.Window.Left + 1), int(info.Window.Bottom - info.Window.Top + 1), nil } func readPassword(fd int) ([]byte, error) { var st uint32 if err := windows.GetConsoleMode(windows.Handle(fd), &st); err != nil { return nil, err } old := st st &^= (windows.ENABLE_ECHO_INPUT | windows.ENABLE_LINE_INPUT) st |= (windows.ENABLE_PROCESSED_OUTPUT | windows.ENABLE_PROCESSED_INPUT) if err := windows.SetConsoleMode(windows.Handle(fd), st); err != nil { return nil, err } defer windows.SetConsoleMode(windows.Handle(fd), old) var h windows.Handle p, _ := windows.GetCurrentProcess() if err := windows.DuplicateHandle(p, windows.Handle(fd), p, &h, 0, false, windows.DUPLICATE_SAME_ACCESS); err != nil { return nil, err } f := os.NewFile(uintptr(h), "stdin") defer f.Close() return readPasswordLine(f) } ================================================ FILE: vendor/golang.org/x/term/terminal.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package term import ( "bytes" "fmt" "io" "runtime" "strconv" "sync" "unicode/utf8" ) // EscapeCodes contains escape sequences that can be written to the terminal in // order to achieve different styles of text. type EscapeCodes struct { // Foreground colors Black, Red, Green, Yellow, Blue, Magenta, Cyan, White []byte // Reset all attributes Reset []byte } var vt100EscapeCodes = EscapeCodes{ Black: []byte{keyEscape, '[', '3', '0', 'm'}, Red: []byte{keyEscape, '[', '3', '1', 'm'}, Green: []byte{keyEscape, '[', '3', '2', 'm'}, Yellow: []byte{keyEscape, '[', '3', '3', 'm'}, Blue: []byte{keyEscape, '[', '3', '4', 'm'}, Magenta: []byte{keyEscape, '[', '3', '5', 'm'}, Cyan: []byte{keyEscape, '[', '3', '6', 'm'}, White: []byte{keyEscape, '[', '3', '7', 'm'}, Reset: []byte{keyEscape, '[', '0', 'm'}, } // A History provides a (possibly bounded) queue of input lines read by [Terminal.ReadLine]. type History interface { // Add will be called by [Terminal.ReadLine] to add // a new, most recent entry to the history. // It is allowed to drop any entry, including // the entry being added (e.g., if it's deemed an invalid entry), // the least-recent entry (e.g., to keep the history bounded), // or any other entry. Add(entry string) // Len returns the number of entries in the history. Len() int // At returns an entry from the history. // Index 0 is the most-recently added entry and // index Len()-1 is the least-recently added entry. // If index is < 0 or >= Len(), it panics. At(idx int) string } // Terminal contains the state for running a VT100 terminal that is capable of // reading lines of input. type Terminal struct { // AutoCompleteCallback, if non-null, is called for each keypress with // the full input line and the current position of the cursor (in // bytes, as an index into |line|). If it returns ok=false, the key // press is processed normally. Otherwise it returns a replacement line // and the new cursor position. // // This will be disabled during ReadPassword. AutoCompleteCallback func(line string, pos int, key rune) (newLine string, newPos int, ok bool) // Escape contains a pointer to the escape codes for this terminal. // It's always a valid pointer, although the escape codes themselves // may be empty if the terminal doesn't support them. Escape *EscapeCodes // lock protects the terminal and the state in this object from // concurrent processing of a key press and a Write() call. lock sync.Mutex c io.ReadWriter prompt []rune // line is the current line being entered. line []rune // pos is the logical position of the cursor in line pos int // echo is true if local echo is enabled echo bool // pasteActive is true iff there is a bracketed paste operation in // progress. pasteActive bool // cursorX contains the current X value of the cursor where the left // edge is 0. cursorY contains the row number where the first row of // the current line is 0. cursorX, cursorY int // maxLine is the greatest value of cursorY so far. maxLine int termWidth, termHeight int // outBuf contains the terminal data to be sent. outBuf []byte // remainder contains the remainder of any partial key sequences after // a read. It aliases into inBuf. remainder []byte inBuf [256]byte // History records and retrieves lines of input read by [ReadLine] which // a user can retrieve and navigate using the up and down arrow keys. // // It is not safe to call ReadLine concurrently with any methods on History. // // [NewTerminal] sets this to a default implementation that records the // last 100 lines of input. History History // historyIndex stores the currently accessed history entry, where zero // means the immediately previous entry. historyIndex int // When navigating up and down the history it's possible to return to // the incomplete, initial line. That value is stored in // historyPending. historyPending string } // NewTerminal runs a VT100 terminal on the given ReadWriter. If the ReadWriter is // a local terminal, that terminal must first have been put into raw mode. // prompt is a string that is written at the start of each input line (i.e. // "> "). func NewTerminal(c io.ReadWriter, prompt string) *Terminal { return &Terminal{ Escape: &vt100EscapeCodes, c: c, prompt: []rune(prompt), termWidth: 80, termHeight: 24, echo: true, historyIndex: -1, History: &stRingBuffer{}, } } const ( keyCtrlC = 3 keyCtrlD = 4 keyCtrlU = 21 keyEnter = '\r' keyLF = '\n' keyEscape = 27 keyBackspace = 127 keyUnknown = 0xd800 /* UTF-16 surrogate area */ + iota keyUp keyDown keyLeft keyRight keyAltLeft keyAltRight keyHome keyEnd keyDeleteWord keyDeleteLine keyDelete keyClearScreen keyTranspose keyPasteStart keyPasteEnd ) var ( crlf = []byte{'\r', '\n'} pasteStart = []byte{keyEscape, '[', '2', '0', '0', '~'} pasteEnd = []byte{keyEscape, '[', '2', '0', '1', '~'} ) // bytesToKey tries to parse a key sequence from b. If successful, it returns // the key and the remainder of the input. Otherwise it returns utf8.RuneError. func bytesToKey(b []byte, pasteActive bool) (rune, []byte) { if len(b) == 0 { return utf8.RuneError, nil } if !pasteActive { switch b[0] { case 1: // ^A return keyHome, b[1:] case 2: // ^B return keyLeft, b[1:] case 5: // ^E return keyEnd, b[1:] case 6: // ^F return keyRight, b[1:] case 8: // ^H return keyBackspace, b[1:] case 11: // ^K return keyDeleteLine, b[1:] case 12: // ^L return keyClearScreen, b[1:] case 20: // ^T return keyTranspose, b[1:] case 23: // ^W return keyDeleteWord, b[1:] case 14: // ^N return keyDown, b[1:] case 16: // ^P return keyUp, b[1:] } } if b[0] != keyEscape { if !utf8.FullRune(b) { return utf8.RuneError, b } r, l := utf8.DecodeRune(b) return r, b[l:] } if !pasteActive && len(b) >= 3 && b[0] == keyEscape && b[1] == '[' { switch b[2] { case 'A': return keyUp, b[3:] case 'B': return keyDown, b[3:] case 'C': return keyRight, b[3:] case 'D': return keyLeft, b[3:] case 'H': return keyHome, b[3:] case 'F': return keyEnd, b[3:] } } if !pasteActive && len(b) >= 4 && b[0] == keyEscape && b[1] == '[' && b[2] == '3' && b[3] == '~' { return keyDelete, b[4:] } if !pasteActive && len(b) >= 6 && b[0] == keyEscape && b[1] == '[' && b[2] == '1' && b[3] == ';' && b[4] == '3' { switch b[5] { case 'C': return keyAltRight, b[6:] case 'D': return keyAltLeft, b[6:] } } if !pasteActive && len(b) >= 6 && bytes.Equal(b[:6], pasteStart) { return keyPasteStart, b[6:] } if pasteActive && len(b) >= 6 && bytes.Equal(b[:6], pasteEnd) { return keyPasteEnd, b[6:] } // If we get here then we have a key that we don't recognise, or a // partial sequence. It's not clear how one should find the end of a // sequence without knowing them all, but it seems that [a-zA-Z~] only // appears at the end of a sequence. for i, c := range b[0:] { if c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c == '~' { return keyUnknown, b[i+1:] } } return utf8.RuneError, b } // queue appends data to the end of t.outBuf func (t *Terminal) queue(data []rune) { t.outBuf = append(t.outBuf, []byte(string(data))...) } var space = []rune{' '} func isPrintable(key rune) bool { isInSurrogateArea := key >= 0xd800 && key <= 0xdbff return key >= 32 && !isInSurrogateArea } // moveCursorToPos appends data to t.outBuf which will move the cursor to the // given, logical position in the text. func (t *Terminal) moveCursorToPos(pos int) { if !t.echo { return } x := visualLength(t.prompt) + pos y := x / t.termWidth x = x % t.termWidth up := 0 if y < t.cursorY { up = t.cursorY - y } down := 0 if y > t.cursorY { down = y - t.cursorY } left := 0 if x < t.cursorX { left = t.cursorX - x } right := 0 if x > t.cursorX { right = x - t.cursorX } t.cursorX = x t.cursorY = y t.move(up, down, left, right) } func (t *Terminal) move(up, down, left, right int) { m := []rune{} // 1 unit up can be expressed as ^[[A or ^[A // 5 units up can be expressed as ^[[5A if up == 1 { m = append(m, keyEscape, '[', 'A') } else if up > 1 { m = append(m, keyEscape, '[') m = append(m, []rune(strconv.Itoa(up))...) m = append(m, 'A') } if down == 1 { m = append(m, keyEscape, '[', 'B') } else if down > 1 { m = append(m, keyEscape, '[') m = append(m, []rune(strconv.Itoa(down))...) m = append(m, 'B') } if right == 1 { m = append(m, keyEscape, '[', 'C') } else if right > 1 { m = append(m, keyEscape, '[') m = append(m, []rune(strconv.Itoa(right))...) m = append(m, 'C') } if left == 1 { m = append(m, keyEscape, '[', 'D') } else if left > 1 { m = append(m, keyEscape, '[') m = append(m, []rune(strconv.Itoa(left))...) m = append(m, 'D') } t.queue(m) } func (t *Terminal) clearLineToRight() { op := []rune{keyEscape, '[', 'K'} t.queue(op) } const maxLineLength = 4096 func (t *Terminal) setLine(newLine []rune, newPos int) { if t.echo { t.moveCursorToPos(0) t.writeLine(newLine) for i := len(newLine); i < len(t.line); i++ { t.writeLine(space) } t.moveCursorToPos(newPos) } t.line = newLine t.pos = newPos } func (t *Terminal) advanceCursor(places int) { t.cursorX += places t.cursorY += t.cursorX / t.termWidth if t.cursorY > t.maxLine { t.maxLine = t.cursorY } t.cursorX = t.cursorX % t.termWidth if places > 0 && t.cursorX == 0 { // Normally terminals will advance the current position // when writing a character. But that doesn't happen // for the last character in a line. However, when // writing a character (except a new line) that causes // a line wrap, the position will be advanced two // places. // // So, if we are stopping at the end of a line, we // need to write a newline so that our cursor can be // advanced to the next line. t.outBuf = append(t.outBuf, '\r', '\n') } } func (t *Terminal) eraseNPreviousChars(n int) { if n == 0 { return } if t.pos < n { n = t.pos } t.pos -= n t.moveCursorToPos(t.pos) copy(t.line[t.pos:], t.line[n+t.pos:]) t.line = t.line[:len(t.line)-n] if t.echo { t.writeLine(t.line[t.pos:]) for i := 0; i < n; i++ { t.queue(space) } t.advanceCursor(n) t.moveCursorToPos(t.pos) } } // countToLeftWord returns the number of characters from the cursor to the // start of the previous word. func (t *Terminal) countToLeftWord() int { if t.pos == 0 { return 0 } pos := t.pos - 1 for pos > 0 { if t.line[pos] != ' ' { break } pos-- } for pos > 0 { if t.line[pos] == ' ' { pos++ break } pos-- } return t.pos - pos } // countToRightWord returns the number of characters from the cursor to the // start of the next word. func (t *Terminal) countToRightWord() int { pos := t.pos for pos < len(t.line) { if t.line[pos] == ' ' { break } pos++ } for pos < len(t.line) { if t.line[pos] != ' ' { break } pos++ } return pos - t.pos } // visualLength returns the number of visible glyphs in s. func visualLength(runes []rune) int { inEscapeSeq := false length := 0 for _, r := range runes { switch { case inEscapeSeq: if (r >= 'a' && r <= 'z') || (r >= 'A' && r <= 'Z') { inEscapeSeq = false } case r == '\x1b': inEscapeSeq = true default: length++ } } return length } // historyAt unlocks the terminal and relocks it while calling History.At. func (t *Terminal) historyAt(idx int) (string, bool) { t.lock.Unlock() // Unlock to avoid deadlock if History methods use the output writer. defer t.lock.Lock() // panic in At (or Len) protection. if idx < 0 || idx >= t.History.Len() { return "", false } return t.History.At(idx), true } // historyAdd unlocks the terminal and relocks it while calling History.Add. func (t *Terminal) historyAdd(entry string) { t.lock.Unlock() // Unlock to avoid deadlock if History methods use the output writer. defer t.lock.Lock() // panic in Add protection. t.History.Add(entry) } // handleKey processes the given key and, optionally, returns a line of text // that the user has entered. func (t *Terminal) handleKey(key rune) (line string, ok bool) { if t.pasteActive && key != keyEnter && key != keyLF { t.addKeyToLine(key) return } switch key { case keyBackspace: if t.pos == 0 { return } t.eraseNPreviousChars(1) case keyAltLeft: // move left by a word. t.pos -= t.countToLeftWord() t.moveCursorToPos(t.pos) case keyAltRight: // move right by a word. t.pos += t.countToRightWord() t.moveCursorToPos(t.pos) case keyLeft: if t.pos == 0 { return } t.pos-- t.moveCursorToPos(t.pos) case keyRight: if t.pos == len(t.line) { return } t.pos++ t.moveCursorToPos(t.pos) case keyHome: if t.pos == 0 { return } t.pos = 0 t.moveCursorToPos(t.pos) case keyEnd: if t.pos == len(t.line) { return } t.pos = len(t.line) t.moveCursorToPos(t.pos) case keyUp: entry, ok := t.historyAt(t.historyIndex + 1) if !ok { return "", false } if t.historyIndex == -1 { t.historyPending = string(t.line) } t.historyIndex++ runes := []rune(entry) t.setLine(runes, len(runes)) case keyDown: switch t.historyIndex { case -1: return case 0: runes := []rune(t.historyPending) t.setLine(runes, len(runes)) t.historyIndex-- default: entry, ok := t.historyAt(t.historyIndex - 1) if ok { t.historyIndex-- runes := []rune(entry) t.setLine(runes, len(runes)) } } case keyEnter, keyLF: t.moveCursorToPos(len(t.line)) t.queue([]rune("\r\n")) line = string(t.line) ok = true t.line = t.line[:0] t.pos = 0 t.cursorX = 0 t.cursorY = 0 t.maxLine = 0 case keyDeleteWord: // Delete zero or more spaces and then one or more characters. t.eraseNPreviousChars(t.countToLeftWord()) case keyDeleteLine: // Delete everything from the current cursor position to the // end of line. for i := t.pos; i < len(t.line); i++ { t.queue(space) t.advanceCursor(1) } t.line = t.line[:t.pos] t.moveCursorToPos(t.pos) case keyCtrlD, keyDelete: // Erase the character under the current position. // The EOF case when the line is empty is handled in // readLine(). if t.pos < len(t.line) { t.pos++ t.eraseNPreviousChars(1) } case keyCtrlU: t.eraseNPreviousChars(t.pos) case keyTranspose: // This transposes the two characters around the cursor and advances the cursor. Best-effort. if len(t.line) < 2 || t.pos < 1 { return } swap := t.pos if swap == len(t.line) { swap-- // special: at end of line, swap previous two chars } t.line[swap-1], t.line[swap] = t.line[swap], t.line[swap-1] if t.pos < len(t.line) { t.pos++ } if t.echo { t.moveCursorToPos(swap - 1) t.writeLine(t.line[swap-1:]) t.moveCursorToPos(t.pos) } case keyClearScreen: // Erases the screen and moves the cursor to the home position. t.queue([]rune("\x1b[2J\x1b[H")) t.queue(t.prompt) t.cursorX, t.cursorY = 0, 0 t.advanceCursor(visualLength(t.prompt)) t.setLine(t.line, t.pos) default: if t.AutoCompleteCallback != nil { prefix := string(t.line[:t.pos]) suffix := string(t.line[t.pos:]) t.lock.Unlock() newLine, newPos, completeOk := t.AutoCompleteCallback(prefix+suffix, len(prefix), key) t.lock.Lock() if completeOk { t.setLine([]rune(newLine), utf8.RuneCount([]byte(newLine)[:newPos])) return } } if !isPrintable(key) { return } if len(t.line) == maxLineLength { return } t.addKeyToLine(key) } return } // addKeyToLine inserts the given key at the current position in the current // line. func (t *Terminal) addKeyToLine(key rune) { if len(t.line) == cap(t.line) { newLine := make([]rune, len(t.line), 2*(1+len(t.line))) copy(newLine, t.line) t.line = newLine } t.line = t.line[:len(t.line)+1] copy(t.line[t.pos+1:], t.line[t.pos:]) t.line[t.pos] = key if t.echo { t.writeLine(t.line[t.pos:]) } t.pos++ t.moveCursorToPos(t.pos) } func (t *Terminal) writeLine(line []rune) { for len(line) != 0 { remainingOnLine := t.termWidth - t.cursorX todo := len(line) if todo > remainingOnLine { todo = remainingOnLine } t.queue(line[:todo]) t.advanceCursor(visualLength(line[:todo])) line = line[todo:] } } // writeWithCRLF writes buf to w but replaces all occurrences of \n with \r\n. func writeWithCRLF(w io.Writer, buf []byte) (n int, err error) { for len(buf) > 0 { i := bytes.IndexByte(buf, '\n') todo := len(buf) if i >= 0 { todo = i } var nn int nn, err = w.Write(buf[:todo]) n += nn if err != nil { return n, err } buf = buf[todo:] if i >= 0 { if _, err = w.Write(crlf); err != nil { return n, err } n++ buf = buf[1:] } } return n, nil } func (t *Terminal) Write(buf []byte) (n int, err error) { t.lock.Lock() defer t.lock.Unlock() if t.cursorX == 0 && t.cursorY == 0 { // This is the easy case: there's nothing on the screen that we // have to move out of the way. return writeWithCRLF(t.c, buf) } // We have a prompt and possibly user input on the screen. We // have to clear it first. t.move(0 /* up */, 0 /* down */, t.cursorX /* left */, 0 /* right */) t.cursorX = 0 t.clearLineToRight() for t.cursorY > 0 { t.move(1 /* up */, 0, 0, 0) t.cursorY-- t.clearLineToRight() } if _, err = t.c.Write(t.outBuf); err != nil { return } t.outBuf = t.outBuf[:0] if n, err = writeWithCRLF(t.c, buf); err != nil { return } t.writeLine(t.prompt) if t.echo { t.writeLine(t.line) } t.moveCursorToPos(t.pos) if _, err = t.c.Write(t.outBuf); err != nil { return } t.outBuf = t.outBuf[:0] return } // ReadPassword temporarily changes the prompt and reads a password, without // echo, from the terminal. // // The AutoCompleteCallback is disabled during this call. func (t *Terminal) ReadPassword(prompt string) (line string, err error) { t.lock.Lock() defer t.lock.Unlock() oldPrompt := t.prompt t.prompt = []rune(prompt) t.echo = false oldAutoCompleteCallback := t.AutoCompleteCallback t.AutoCompleteCallback = nil defer func() { t.AutoCompleteCallback = oldAutoCompleteCallback }() line, err = t.readLine() t.prompt = oldPrompt t.echo = true return } // ReadLine returns a line of input from the terminal. func (t *Terminal) ReadLine() (line string, err error) { t.lock.Lock() defer t.lock.Unlock() return t.readLine() } func (t *Terminal) readLine() (line string, err error) { // t.lock must be held at this point if t.cursorX == 0 && t.cursorY == 0 { t.writeLine(t.prompt) t.c.Write(t.outBuf) t.outBuf = t.outBuf[:0] } lineIsPasted := t.pasteActive for { rest := t.remainder lineOk := false for !lineOk { var key rune key, rest = bytesToKey(rest, t.pasteActive) if key == utf8.RuneError { break } if !t.pasteActive { if key == keyCtrlD { if len(t.line) == 0 { return "", io.EOF } } if key == keyCtrlC { return "", io.EOF } if key == keyPasteStart { t.pasteActive = true if len(t.line) == 0 { lineIsPasted = true } continue } } else if key == keyPasteEnd { t.pasteActive = false continue } if !t.pasteActive { lineIsPasted = false } // If we have CR, consume LF if present (CRLF sequence) to avoid returning an extra empty line. if key == keyEnter && len(rest) > 0 && rest[0] == keyLF { rest = rest[1:] } line, lineOk = t.handleKey(key) } if len(rest) > 0 { n := copy(t.inBuf[:], rest) t.remainder = t.inBuf[:n] } else { t.remainder = nil } t.c.Write(t.outBuf) t.outBuf = t.outBuf[:0] if lineOk { if t.echo { t.historyIndex = -1 t.historyAdd(line) } if lineIsPasted { err = ErrPasteIndicator } return } // t.remainder is a slice at the beginning of t.inBuf // containing a partial key sequence readBuf := t.inBuf[len(t.remainder):] var n int t.lock.Unlock() n, err = t.c.Read(readBuf) t.lock.Lock() if err != nil { return } t.remainder = t.inBuf[:n+len(t.remainder)] } } // SetPrompt sets the prompt to be used when reading subsequent lines. func (t *Terminal) SetPrompt(prompt string) { t.lock.Lock() defer t.lock.Unlock() t.prompt = []rune(prompt) } func (t *Terminal) clearAndRepaintLinePlusNPrevious(numPrevLines int) { // Move cursor to column zero at the start of the line. t.move(t.cursorY, 0, t.cursorX, 0) t.cursorX, t.cursorY = 0, 0 t.clearLineToRight() for t.cursorY < numPrevLines { // Move down a line t.move(0, 1, 0, 0) t.cursorY++ t.clearLineToRight() } // Move back to beginning. t.move(t.cursorY, 0, 0, 0) t.cursorX, t.cursorY = 0, 0 t.queue(t.prompt) t.advanceCursor(visualLength(t.prompt)) t.writeLine(t.line) t.moveCursorToPos(t.pos) } func (t *Terminal) SetSize(width, height int) error { t.lock.Lock() defer t.lock.Unlock() if width == 0 { width = 1 } oldWidth := t.termWidth t.termWidth, t.termHeight = width, height switch { case width == oldWidth: // If the width didn't change then nothing else needs to be // done. return nil case len(t.line) == 0 && t.cursorX == 0 && t.cursorY == 0: // If there is nothing on current line and no prompt printed, // just do nothing return nil case width < oldWidth: // Some terminals (e.g. xterm) will truncate lines that were // too long when shinking. Others, (e.g. gnome-terminal) will // attempt to wrap them. For the former, repainting t.maxLine // works great, but that behaviour goes badly wrong in the case // of the latter because they have doubled every full line. // We assume that we are working on a terminal that wraps lines // and adjust the cursor position based on every previous line // wrapping and turning into two. This causes the prompt on // xterms to move upwards, which isn't great, but it avoids a // huge mess with gnome-terminal. if t.cursorX >= t.termWidth { t.cursorX = t.termWidth - 1 } t.cursorY *= 2 t.clearAndRepaintLinePlusNPrevious(t.maxLine * 2) case width > oldWidth: // If the terminal expands then our position calculations will // be wrong in the future because we think the cursor is // |t.pos| chars into the string, but there will be a gap at // the end of any wrapped line. // // But the position will actually be correct until we move, so // we can move back to the beginning and repaint everything. t.clearAndRepaintLinePlusNPrevious(t.maxLine) } _, err := t.c.Write(t.outBuf) t.outBuf = t.outBuf[:0] return err } type pasteIndicatorError struct{} func (pasteIndicatorError) Error() string { return "terminal: ErrPasteIndicator not correctly handled" } // ErrPasteIndicator may be returned from ReadLine as the error, in addition // to valid line data. It indicates that bracketed paste mode is enabled and // that the returned line consists only of pasted data. Programs may wish to // interpret pasted data more literally than typed data. var ErrPasteIndicator = pasteIndicatorError{} // SetBracketedPasteMode requests that the terminal bracket paste operations // with markers. Not all terminals support this but, if it is supported, then // enabling this mode will stop any autocomplete callback from running due to // pastes. Additionally, any lines that are completely pasted will be returned // from ReadLine with the error set to ErrPasteIndicator. func (t *Terminal) SetBracketedPasteMode(on bool) { if on { io.WriteString(t.c, "\x1b[?2004h") } else { io.WriteString(t.c, "\x1b[?2004l") } } // stRingBuffer is a ring buffer of strings. type stRingBuffer struct { // entries contains max elements. entries []string max int // head contains the index of the element most recently added to the ring. head int // size contains the number of elements in the ring. size int } func (s *stRingBuffer) Add(a string) { if s.entries == nil { const defaultNumEntries = 100 s.entries = make([]string, defaultNumEntries) s.max = defaultNumEntries } s.head = (s.head + 1) % s.max s.entries[s.head] = a if s.size < s.max { s.size++ } } func (s *stRingBuffer) Len() int { return s.size } // At returns the value passed to the nth previous call to Add. // If n is zero then the immediately prior value is returned, if one, then the // next most recent, and so on. If such an element doesn't exist then ok is // false. func (s *stRingBuffer) At(n int) string { if n < 0 || n >= s.size { panic(fmt.Sprintf("term: history index [%d] out of range [0,%d)", n, s.size)) } index := s.head - n if index < 0 { index += s.max } return s.entries[index] } // readPasswordLine reads from reader until it finds \n or io.EOF. // The slice returned does not include the \n. // readPasswordLine also ignores any \r it finds. // Windows uses \r as end of line. So, on Windows, readPasswordLine // reads until it finds \r and ignores any \n it finds during processing. func readPasswordLine(reader io.Reader) ([]byte, error) { var buf [1]byte var ret []byte for { n, err := reader.Read(buf[:]) if n > 0 { switch buf[0] { case '\b': if len(ret) > 0 { ret = ret[:len(ret)-1] } case '\n': if runtime.GOOS != "windows" { return ret, nil } // otherwise ignore \n case '\r': if runtime.GOOS == "windows" { return ret, nil } // otherwise ignore \r default: ret = append(ret, buf[0]) } continue } if err != nil { if err == io.EOF && len(ret) > 0 { return ret, nil } return ret, err } } } ================================================ FILE: vendor/golang.org/x/text/LICENSE ================================================ Copyright 2009 The Go Authors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: vendor/golang.org/x/text/PATENTS ================================================ Additional IP Rights Grant (Patents) "This implementation" means the copyrightable works distributed by Google as part of the Go project. Google hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, transfer and otherwise run, modify and propagate the contents of this implementation of Go, where such license applies only to those patent claims, both currently owned or controlled by Google and acquired in the future, licensable by Google that are necessarily infringed by this implementation of Go. This grant does not include claims that would be infringed only as a consequence of further modification of this implementation. If you or your agent or exclusive licensee institute or order or agree to the institution of patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that this implementation of Go or any code incorporated within this implementation of Go constitutes direct or contributory patent infringement, or inducement of patent infringement, then any patent rights granted to you under this License for this implementation of Go shall terminate as of the date such litigation is filed. ================================================ FILE: vendor/golang.org/x/text/feature/plural/common.go ================================================ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. package plural // Form defines a plural form. // // Not all languages support all forms. Also, the meaning of each form varies // per language. It is important to note that the name of a form does not // necessarily correspond one-to-one with the set of numbers. For instance, // for Croation, One matches not only 1, but also 11, 21, etc. // // Each language must at least support the form "other". type Form byte const ( Other Form = iota Zero One Two Few Many ) var countMap = map[string]Form{ "other": Other, "zero": Zero, "one": One, "two": Two, "few": Few, "many": Many, } type pluralCheck struct { // category: // 3..7: opID // 0..2: category cat byte setID byte } // opID identifies the type of operand in the plural rule, being i, n or f. // (v, w, and t are treated as filters in our implementation.) type opID byte const ( opMod opID = 0x1 // is '%' used? opNotEqual opID = 0x2 // using "!=" to compare opI opID = 0 << 2 // integers after taking the absolute value opN opID = 1 << 2 // full number (must be integer) opF opID = 2 << 2 // fraction opV opID = 3 << 2 // number of visible digits opW opID = 4 << 2 // number of visible digits without trailing zeros opBretonM opID = 5 << 2 // hard-wired rule for Breton opItalian800 opID = 6 << 2 // hard-wired rule for Italian opAzerbaijan00s opID = 7 << 2 // hard-wired rule for Azerbaijan ) const ( // Use this plural form to indicate the next rule needs to match as well. // The last condition in the list will have the correct plural form. andNext = 0x7 formMask = 0x7 opShift = 3 // numN indicates the maximum integer, or maximum mod value, for which we // have inclusion masks. numN = 100 // The common denominator of the modulo that is taken. maxMod = 100 ) ================================================ FILE: vendor/golang.org/x/text/feature/plural/message.go ================================================ // Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package plural import ( "fmt" "io" "reflect" "strconv" "golang.org/x/text/internal/catmsg" "golang.org/x/text/internal/number" "golang.org/x/text/language" "golang.org/x/text/message/catalog" ) // TODO: consider deleting this interface. Maybe VisibleDigits is always // sufficient and practical. // Interface is used for types that can determine their own plural form. type Interface interface { // PluralForm reports the plural form for the given language of the // underlying value. It also returns the integer value. If the integer value // is larger than fits in n, PluralForm may return a value modulo // 10,000,000. PluralForm(t language.Tag, scale int) (f Form, n int) } // Selectf returns the first case for which its selector is a match for the // arg-th substitution argument to a formatting call, formatting it as indicated // by format. // // The cases argument are pairs of selectors and messages. Selectors are of type // string or Form. Messages are of type string or catalog.Message. A selector // matches an argument if: // - it is "other" or Other // - it matches the plural form of the argument: "zero", "one", "two", "few", // or "many", or the equivalent Form // - it is of the form "=x" where x is an integer that matches the value of // the argument. // - it is of the form " kindDefault { e.EncodeUint(uint64(m.scale)) } forms := validForms(cardinal, e.Language()) for i := 0; i < len(m.cases); { if err := compileSelector(e, forms, m.cases[i]); err != nil { return err } if i++; i >= len(m.cases) { return fmt.Errorf("plural: no message defined for selector %v", m.cases[i-1]) } var msg catalog.Message switch x := m.cases[i].(type) { case string: msg = catalog.String(x) case catalog.Message: msg = x default: return fmt.Errorf("plural: message of type %T; must be string or catalog.Message", x) } if err := e.EncodeMessage(msg); err != nil { return err } i++ } return nil } func compileSelector(e *catmsg.Encoder, valid []Form, selector interface{}) error { form := Other switch x := selector.(type) { case string: if x == "" { return fmt.Errorf("plural: empty selector") } if c := x[0]; c == '=' || c == '<' { val, err := strconv.ParseUint(x[1:], 10, 16) if err != nil { return fmt.Errorf("plural: invalid number in selector %q: %v", selector, err) } e.EncodeUint(uint64(c)) e.EncodeUint(val) return nil } var ok bool form, ok = countMap[x] if !ok { return fmt.Errorf("plural: invalid plural form %q", selector) } case Form: form = x default: return fmt.Errorf("plural: selector of type %T; want string or Form", selector) } ok := false for _, f := range valid { if f == form { ok = true break } } if !ok { return fmt.Errorf("plural: form %q not supported for language %q", selector, e.Language()) } e.EncodeUint(uint64(form)) return nil } func execute(d *catmsg.Decoder) bool { lang := d.Language() argN := int(d.DecodeUint()) kind := int(d.DecodeUint()) scale := -1 // default if kind > kindDefault { scale = int(d.DecodeUint()) } form := Other n := -1 if arg := d.Arg(argN); arg == nil { // Default to Other. } else if x, ok := arg.(number.VisibleDigits); ok { d := x.Digits(nil, lang, scale) form, n = cardinal.matchDisplayDigits(lang, &d) } else if x, ok := arg.(Interface); ok { // This covers lists and formatters from the number package. form, n = x.PluralForm(lang, scale) } else { var f number.Formatter switch kind { case kindScale: f.InitDecimal(lang) f.SetScale(scale) case kindScientific: f.InitScientific(lang) f.SetScale(scale) case kindPrecision: f.InitDecimal(lang) f.SetPrecision(scale) case kindDefault: // sensible default f.InitDecimal(lang) if k := reflect.TypeOf(arg).Kind(); reflect.Int <= k && k <= reflect.Uintptr { f.SetScale(0) } else { f.SetScale(2) } } var dec number.Decimal // TODO: buffer in Printer dec.Convert(f.RoundingContext, arg) v := number.FormatDigits(&dec, f.RoundingContext) if !v.NaN && !v.Inf { form, n = cardinal.matchDisplayDigits(d.Language(), &v) } } for !d.Done() { f := d.DecodeUint() if (f == '=' && n == int(d.DecodeUint())) || (f == '<' && 0 <= n && n < int(d.DecodeUint())) || form == Form(f) || Other == Form(f) { return d.ExecuteMessage() } d.SkipMessage() } return false } ================================================ FILE: vendor/golang.org/x/text/feature/plural/plural.go ================================================ // Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:generate go run gen.go gen_common.go // Package plural provides utilities for handling linguistic plurals in text. // // The definitions in this package are based on the plural rule handling defined // in CLDR. See // https://unicode.org/reports/tr35/tr35-numbers.html#Language_Plural_Rules for // details. package plural import ( "golang.org/x/text/internal/language/compact" "golang.org/x/text/internal/number" "golang.org/x/text/language" ) // Rules defines the plural rules for all languages for a certain plural type. // // This package is UNDER CONSTRUCTION and its API may change. type Rules struct { rules []pluralCheck index []byte langToIndex []byte inclusionMasks []uint64 } var ( // Cardinal defines the plural rules for numbers indicating quantities. Cardinal *Rules = cardinal // Ordinal defines the plural rules for numbers indicating position // (first, second, etc.). Ordinal *Rules = ordinal ordinal = &Rules{ ordinalRules, ordinalIndex, ordinalLangToIndex, ordinalInclusionMasks[:], } cardinal = &Rules{ cardinalRules, cardinalIndex, cardinalLangToIndex, cardinalInclusionMasks[:], } ) // getIntApprox converts the digits in slice digits[start:end] to an integer // according to the following rules: // - Let i be asInt(digits[start:end]), where out-of-range digits are assumed // to be zero. // - Result n is big if i / 10^nMod > 1. // - Otherwise the result is i % 10^nMod. // // For example, if digits is {1, 2, 3} and start:end is 0:5, then the result // for various values of nMod is: // - when nMod == 2, n == big // - when nMod == 3, n == big // - when nMod == 4, n == big // - when nMod == 5, n == 12300 // - when nMod == 6, n == 12300 // - when nMod == 7, n == 12300 func getIntApprox(digits []byte, start, end, nMod, big int) (n int) { // Leading 0 digits just result in 0. p := start if p < 0 { p = 0 } // Range only over the part for which we have digits. mid := end if mid >= len(digits) { mid = len(digits) } // Check digits more significant that nMod. if q := end - nMod; q > 0 { if q > mid { q = mid } for ; p < q; p++ { if digits[p] != 0 { return big } } } for ; p < mid; p++ { n = 10*n + int(digits[p]) } // Multiply for trailing zeros. for ; p < end; p++ { n *= 10 } return n } // MatchDigits computes the plural form for the given language and the given // decimal floating point digits. The digits are stored in big-endian order and // are of value byte(0) - byte(9). The floating point position is indicated by // exp and the number of visible decimals is scale. All leading and trailing // zeros may be omitted from digits. // // The following table contains examples of possible arguments to represent // the given numbers. // // decimal digits exp scale // 123 []byte{1, 2, 3} 3 0 // 123.4 []byte{1, 2, 3, 4} 3 1 // 123.40 []byte{1, 2, 3, 4} 3 2 // 100000 []byte{1} 6 0 // 100000.00 []byte{1} 6 3 func (p *Rules) MatchDigits(t language.Tag, digits []byte, exp, scale int) Form { index := tagToID(t) // Differentiate up to including mod 1000000 for the integer part. n := getIntApprox(digits, 0, exp, 6, 1000000) // Differentiate up to including mod 100 for the fractional part. f := getIntApprox(digits, exp, exp+scale, 2, 100) return matchPlural(p, index, n, f, scale) } func (p *Rules) matchDisplayDigits(t language.Tag, d *number.Digits) (Form, int) { n := getIntApprox(d.Digits, 0, int(d.Exp), 6, 1000000) return p.MatchDigits(t, d.Digits, int(d.Exp), d.NumFracDigits()), n } func validForms(p *Rules, t language.Tag) (forms []Form) { offset := p.langToIndex[tagToID(t)] rules := p.rules[p.index[offset]:p.index[offset+1]] forms = append(forms, Other) last := Other for _, r := range rules { if cat := Form(r.cat & formMask); cat != andNext && last != cat { forms = append(forms, cat) last = cat } } return forms } func (p *Rules) matchComponents(t language.Tag, n, f, scale int) Form { return matchPlural(p, tagToID(t), n, f, scale) } // MatchPlural returns the plural form for the given language and plural // operands (as defined in // https://unicode.org/reports/tr35/tr35-numbers.html#Language_Plural_Rules): // // where // n absolute value of the source number (integer and decimals) // input // i integer digits of n. // v number of visible fraction digits in n, with trailing zeros. // w number of visible fraction digits in n, without trailing zeros. // f visible fractional digits in n, with trailing zeros (f = t * 10^(v-w)) // t visible fractional digits in n, without trailing zeros. // // If any of the operand values is too large to fit in an int, it is okay to // pass the value modulo 10,000,000. func (p *Rules) MatchPlural(lang language.Tag, i, v, w, f, t int) Form { return matchPlural(p, tagToID(lang), i, f, v) } func matchPlural(p *Rules, index compact.ID, n, f, v int) Form { nMask := p.inclusionMasks[n%maxMod] // Compute the fMask inline in the rules below, as it is relatively rare. // fMask := p.inclusionMasks[f%maxMod] vMask := p.inclusionMasks[v%maxMod] // Do the matching offset := p.langToIndex[index] rules := p.rules[p.index[offset]:p.index[offset+1]] for i := 0; i < len(rules); i++ { rule := rules[i] setBit := uint64(1 << rule.setID) var skip bool switch op := opID(rule.cat >> opShift); op { case opI: // i = x skip = n >= numN || nMask&setBit == 0 case opI | opNotEqual: // i != x skip = n < numN && nMask&setBit != 0 case opI | opMod: // i % m = x skip = nMask&setBit == 0 case opI | opMod | opNotEqual: // i % m != x skip = nMask&setBit != 0 case opN: // n = x skip = f != 0 || n >= numN || nMask&setBit == 0 case opN | opNotEqual: // n != x skip = f == 0 && n < numN && nMask&setBit != 0 case opN | opMod: // n % m = x skip = f != 0 || nMask&setBit == 0 case opN | opMod | opNotEqual: // n % m != x skip = f == 0 && nMask&setBit != 0 case opF: // f = x skip = f >= numN || p.inclusionMasks[f%maxMod]&setBit == 0 case opF | opNotEqual: // f != x skip = f < numN && p.inclusionMasks[f%maxMod]&setBit != 0 case opF | opMod: // f % m = x skip = p.inclusionMasks[f%maxMod]&setBit == 0 case opF | opMod | opNotEqual: // f % m != x skip = p.inclusionMasks[f%maxMod]&setBit != 0 case opV: // v = x skip = v < numN && vMask&setBit == 0 case opV | opNotEqual: // v != x skip = v < numN && vMask&setBit != 0 case opW: // w == 0 skip = f != 0 case opW | opNotEqual: // w != 0 skip = f == 0 // Hard-wired rules that cannot be handled by our algorithm. case opBretonM: skip = f != 0 || n == 0 || n%1000000 != 0 case opAzerbaijan00s: // 100,200,300,400,500,600,700,800,900 skip = n == 0 || n >= 1000 || n%100 != 0 case opItalian800: skip = (f != 0 || n >= numN || nMask&setBit == 0) && n != 800 } if skip { // advance over AND entries. for ; i < len(rules) && rules[i].cat&formMask == andNext; i++ { } continue } // return if we have a final entry. if cat := rule.cat & formMask; cat != andNext { return Form(cat) } } return Other } func tagToID(t language.Tag) compact.ID { id, _ := compact.RegionalID(compact.Tag(t)) return id } ================================================ FILE: vendor/golang.org/x/text/feature/plural/tables.go ================================================ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. package plural // CLDRVersion is the CLDR version from which the tables in this package are derived. const CLDRVersion = "32" var ordinalRules = []pluralCheck{ // 64 elements 0: {cat: 0x2f, setID: 0x4}, 1: {cat: 0x3a, setID: 0x5}, 2: {cat: 0x22, setID: 0x1}, 3: {cat: 0x22, setID: 0x6}, 4: {cat: 0x22, setID: 0x7}, 5: {cat: 0x2f, setID: 0x8}, 6: {cat: 0x3c, setID: 0x9}, 7: {cat: 0x2f, setID: 0xa}, 8: {cat: 0x3c, setID: 0xb}, 9: {cat: 0x2c, setID: 0xc}, 10: {cat: 0x24, setID: 0xd}, 11: {cat: 0x2d, setID: 0xe}, 12: {cat: 0x2d, setID: 0xf}, 13: {cat: 0x2f, setID: 0x10}, 14: {cat: 0x35, setID: 0x3}, 15: {cat: 0xc5, setID: 0x11}, 16: {cat: 0x2, setID: 0x1}, 17: {cat: 0x5, setID: 0x3}, 18: {cat: 0xd, setID: 0x12}, 19: {cat: 0x22, setID: 0x1}, 20: {cat: 0x2f, setID: 0x13}, 21: {cat: 0x3d, setID: 0x14}, 22: {cat: 0x2f, setID: 0x15}, 23: {cat: 0x3a, setID: 0x16}, 24: {cat: 0x2f, setID: 0x17}, 25: {cat: 0x3b, setID: 0x18}, 26: {cat: 0x2f, setID: 0xa}, 27: {cat: 0x3c, setID: 0xb}, 28: {cat: 0x22, setID: 0x1}, 29: {cat: 0x23, setID: 0x19}, 30: {cat: 0x24, setID: 0x1a}, 31: {cat: 0x22, setID: 0x1b}, 32: {cat: 0x23, setID: 0x2}, 33: {cat: 0x24, setID: 0x1a}, 34: {cat: 0xf, setID: 0x15}, 35: {cat: 0x1a, setID: 0x16}, 36: {cat: 0xf, setID: 0x17}, 37: {cat: 0x1b, setID: 0x18}, 38: {cat: 0xf, setID: 0x1c}, 39: {cat: 0x1d, setID: 0x1d}, 40: {cat: 0xa, setID: 0x1e}, 41: {cat: 0xa, setID: 0x1f}, 42: {cat: 0xc, setID: 0x20}, 43: {cat: 0xe4, setID: 0x0}, 44: {cat: 0x5, setID: 0x3}, 45: {cat: 0xd, setID: 0xe}, 46: {cat: 0xd, setID: 0x21}, 47: {cat: 0x22, setID: 0x1}, 48: {cat: 0x23, setID: 0x19}, 49: {cat: 0x24, setID: 0x1a}, 50: {cat: 0x25, setID: 0x22}, 51: {cat: 0x22, setID: 0x23}, 52: {cat: 0x23, setID: 0x19}, 53: {cat: 0x24, setID: 0x1a}, 54: {cat: 0x25, setID: 0x22}, 55: {cat: 0x22, setID: 0x24}, 56: {cat: 0x23, setID: 0x19}, 57: {cat: 0x24, setID: 0x1a}, 58: {cat: 0x25, setID: 0x22}, 59: {cat: 0x21, setID: 0x25}, 60: {cat: 0x22, setID: 0x1}, 61: {cat: 0x23, setID: 0x2}, 62: {cat: 0x24, setID: 0x26}, 63: {cat: 0x25, setID: 0x27}, } // Size: 152 bytes var ordinalIndex = []uint8{ // 22 elements 0x00, 0x00, 0x02, 0x03, 0x04, 0x05, 0x07, 0x09, 0x0b, 0x0f, 0x10, 0x13, 0x16, 0x1c, 0x1f, 0x22, 0x28, 0x2f, 0x33, 0x37, 0x3b, 0x40, } // Size: 46 bytes var ordinalLangToIndex = []uint8{ // 775 elements // Entry 0 - 3F 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Entry 40 - 7F 0x12, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Entry 80 - BF 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, // Entry C0 - FF 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Entry 100 - 13F 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, // Entry 140 - 17F 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Entry 180 - 1BF 0x00, 0x00, 0x00, 0x00, 0x09, 0x09, 0x09, 0x09, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Entry 1C0 - 1FF 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0d, 0x0d, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Entry 200 - 23F 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Entry 240 - 27F 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Entry 280 - 2BF 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x0b, 0x0b, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x02, 0x00, 0x00, 0x00, 0x00, // Entry 2C0 - 2FF 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Entry 300 - 33F 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x0c, } // Size: 799 bytes var ordinalInclusionMasks = []uint64{ // 100 elements // Entry 0 - 1F 0x0000002000010009, 0x00000018482000d3, 0x0000000042840195, 0x000000410a040581, 0x00000041040c0081, 0x0000009840040041, 0x0000008400045001, 0x0000003850040001, 0x0000003850060001, 0x0000003800049001, 0x0000000800052001, 0x0000000040660031, 0x0000000041840331, 0x0000000100040f01, 0x00000001001c0001, 0x0000000040040001, 0x0000000000045001, 0x0000000070040001, 0x0000000070040001, 0x0000000000049001, 0x0000000080050001, 0x0000000040200011, 0x0000000040800111, 0x0000000100000501, 0x0000000100080001, 0x0000000040000001, 0x0000000000005001, 0x0000000050000001, 0x0000000050000001, 0x0000000000009001, 0x0000000000010001, 0x0000000040200011, // Entry 20 - 3F 0x0000000040800111, 0x0000000100000501, 0x0000000100080001, 0x0000000040000001, 0x0000000000005001, 0x0000000050000001, 0x0000000050000001, 0x0000000000009001, 0x0000000200050001, 0x0000000040200011, 0x0000000040800111, 0x0000000100000501, 0x0000000100080001, 0x0000000040000001, 0x0000000000005001, 0x0000000050000001, 0x0000000050000001, 0x0000000000009001, 0x0000000080010001, 0x0000000040200011, 0x0000000040800111, 0x0000000100000501, 0x0000000100080001, 0x0000000040000001, 0x0000000000005001, 0x0000000050000001, 0x0000000050000001, 0x0000000000009001, 0x0000000200050001, 0x0000000040200011, 0x0000000040800111, 0x0000000100000501, // Entry 40 - 5F 0x0000000100080001, 0x0000000040000001, 0x0000000000005001, 0x0000000050000001, 0x0000000050000001, 0x0000000000009001, 0x0000000080010001, 0x0000000040200011, 0x0000000040800111, 0x0000000100000501, 0x0000000100080001, 0x0000000040000001, 0x0000000000005001, 0x0000000050000001, 0x0000000050000001, 0x0000000000009001, 0x0000000080070001, 0x0000000040200011, 0x0000000040800111, 0x0000000100000501, 0x0000000100080001, 0x0000000040000001, 0x0000000000005001, 0x0000000050000001, 0x0000000050000001, 0x0000000000009001, 0x0000000200010001, 0x0000000040200011, 0x0000000040800111, 0x0000000100000501, 0x0000000100080001, 0x0000000040000001, // Entry 60 - 7F 0x0000000000005001, 0x0000000050000001, 0x0000000050000001, 0x0000000000009001, } // Size: 824 bytes // Slots used for ordinal: 40 of 0xFF rules; 16 of 0xFF indexes; 40 of 64 sets var cardinalRules = []pluralCheck{ // 166 elements 0: {cat: 0x2, setID: 0x3}, 1: {cat: 0x22, setID: 0x1}, 2: {cat: 0x2, setID: 0x4}, 3: {cat: 0x2, setID: 0x4}, 4: {cat: 0x7, setID: 0x1}, 5: {cat: 0x62, setID: 0x3}, 6: {cat: 0x22, setID: 0x4}, 7: {cat: 0x7, setID: 0x3}, 8: {cat: 0x42, setID: 0x1}, 9: {cat: 0x22, setID: 0x4}, 10: {cat: 0x22, setID: 0x4}, 11: {cat: 0x22, setID: 0x5}, 12: {cat: 0x22, setID: 0x1}, 13: {cat: 0x22, setID: 0x1}, 14: {cat: 0x7, setID: 0x4}, 15: {cat: 0x92, setID: 0x3}, 16: {cat: 0xf, setID: 0x6}, 17: {cat: 0x1f, setID: 0x7}, 18: {cat: 0x82, setID: 0x3}, 19: {cat: 0x92, setID: 0x3}, 20: {cat: 0xf, setID: 0x6}, 21: {cat: 0x62, setID: 0x3}, 22: {cat: 0x4a, setID: 0x6}, 23: {cat: 0x7, setID: 0x8}, 24: {cat: 0x62, setID: 0x3}, 25: {cat: 0x1f, setID: 0x9}, 26: {cat: 0x62, setID: 0x3}, 27: {cat: 0x5f, setID: 0x9}, 28: {cat: 0x72, setID: 0x3}, 29: {cat: 0x29, setID: 0xa}, 30: {cat: 0x29, setID: 0xb}, 31: {cat: 0x4f, setID: 0xb}, 32: {cat: 0x61, setID: 0x2}, 33: {cat: 0x2f, setID: 0x6}, 34: {cat: 0x3a, setID: 0x7}, 35: {cat: 0x4f, setID: 0x6}, 36: {cat: 0x5f, setID: 0x7}, 37: {cat: 0x62, setID: 0x2}, 38: {cat: 0x4f, setID: 0x6}, 39: {cat: 0x72, setID: 0x2}, 40: {cat: 0x21, setID: 0x3}, 41: {cat: 0x7, setID: 0x4}, 42: {cat: 0x32, setID: 0x3}, 43: {cat: 0x21, setID: 0x3}, 44: {cat: 0x22, setID: 0x1}, 45: {cat: 0x22, setID: 0x1}, 46: {cat: 0x23, setID: 0x2}, 47: {cat: 0x2, setID: 0x3}, 48: {cat: 0x22, setID: 0x1}, 49: {cat: 0x24, setID: 0xc}, 50: {cat: 0x7, setID: 0x1}, 51: {cat: 0x62, setID: 0x3}, 52: {cat: 0x74, setID: 0x3}, 53: {cat: 0x24, setID: 0x3}, 54: {cat: 0x2f, setID: 0xd}, 55: {cat: 0x34, setID: 0x1}, 56: {cat: 0xf, setID: 0x6}, 57: {cat: 0x1f, setID: 0x7}, 58: {cat: 0x62, setID: 0x3}, 59: {cat: 0x4f, setID: 0x6}, 60: {cat: 0x5a, setID: 0x7}, 61: {cat: 0xf, setID: 0xe}, 62: {cat: 0x1f, setID: 0xf}, 63: {cat: 0x64, setID: 0x3}, 64: {cat: 0x4f, setID: 0xe}, 65: {cat: 0x5c, setID: 0xf}, 66: {cat: 0x22, setID: 0x10}, 67: {cat: 0x23, setID: 0x11}, 68: {cat: 0x24, setID: 0x12}, 69: {cat: 0xf, setID: 0x1}, 70: {cat: 0x62, setID: 0x3}, 71: {cat: 0xf, setID: 0x2}, 72: {cat: 0x63, setID: 0x3}, 73: {cat: 0xf, setID: 0x13}, 74: {cat: 0x64, setID: 0x3}, 75: {cat: 0x74, setID: 0x3}, 76: {cat: 0xf, setID: 0x1}, 77: {cat: 0x62, setID: 0x3}, 78: {cat: 0x4a, setID: 0x1}, 79: {cat: 0xf, setID: 0x2}, 80: {cat: 0x63, setID: 0x3}, 81: {cat: 0x4b, setID: 0x2}, 82: {cat: 0xf, setID: 0x13}, 83: {cat: 0x64, setID: 0x3}, 84: {cat: 0x4c, setID: 0x13}, 85: {cat: 0x7, setID: 0x1}, 86: {cat: 0x62, setID: 0x3}, 87: {cat: 0x7, setID: 0x2}, 88: {cat: 0x63, setID: 0x3}, 89: {cat: 0x2f, setID: 0xa}, 90: {cat: 0x37, setID: 0x14}, 91: {cat: 0x65, setID: 0x3}, 92: {cat: 0x7, setID: 0x1}, 93: {cat: 0x62, setID: 0x3}, 94: {cat: 0x7, setID: 0x15}, 95: {cat: 0x64, setID: 0x3}, 96: {cat: 0x75, setID: 0x3}, 97: {cat: 0x7, setID: 0x1}, 98: {cat: 0x62, setID: 0x3}, 99: {cat: 0xf, setID: 0xe}, 100: {cat: 0x1f, setID: 0xf}, 101: {cat: 0x64, setID: 0x3}, 102: {cat: 0xf, setID: 0x16}, 103: {cat: 0x17, setID: 0x1}, 104: {cat: 0x65, setID: 0x3}, 105: {cat: 0xf, setID: 0x17}, 106: {cat: 0x65, setID: 0x3}, 107: {cat: 0xf, setID: 0xf}, 108: {cat: 0x65, setID: 0x3}, 109: {cat: 0x2f, setID: 0x6}, 110: {cat: 0x3a, setID: 0x7}, 111: {cat: 0x2f, setID: 0xe}, 112: {cat: 0x3c, setID: 0xf}, 113: {cat: 0x2d, setID: 0xa}, 114: {cat: 0x2d, setID: 0x17}, 115: {cat: 0x2d, setID: 0x18}, 116: {cat: 0x2f, setID: 0x6}, 117: {cat: 0x3a, setID: 0xb}, 118: {cat: 0x2f, setID: 0x19}, 119: {cat: 0x3c, setID: 0xb}, 120: {cat: 0x55, setID: 0x3}, 121: {cat: 0x22, setID: 0x1}, 122: {cat: 0x24, setID: 0x3}, 123: {cat: 0x2c, setID: 0xc}, 124: {cat: 0x2d, setID: 0xb}, 125: {cat: 0xf, setID: 0x6}, 126: {cat: 0x1f, setID: 0x7}, 127: {cat: 0x62, setID: 0x3}, 128: {cat: 0xf, setID: 0xe}, 129: {cat: 0x1f, setID: 0xf}, 130: {cat: 0x64, setID: 0x3}, 131: {cat: 0xf, setID: 0xa}, 132: {cat: 0x65, setID: 0x3}, 133: {cat: 0xf, setID: 0x17}, 134: {cat: 0x65, setID: 0x3}, 135: {cat: 0xf, setID: 0x18}, 136: {cat: 0x65, setID: 0x3}, 137: {cat: 0x2f, setID: 0x6}, 138: {cat: 0x3a, setID: 0x1a}, 139: {cat: 0x2f, setID: 0x1b}, 140: {cat: 0x3b, setID: 0x1c}, 141: {cat: 0x2f, setID: 0x1d}, 142: {cat: 0x3c, setID: 0x1e}, 143: {cat: 0x37, setID: 0x3}, 144: {cat: 0xa5, setID: 0x0}, 145: {cat: 0x22, setID: 0x1}, 146: {cat: 0x23, setID: 0x2}, 147: {cat: 0x24, setID: 0x1f}, 148: {cat: 0x25, setID: 0x20}, 149: {cat: 0xf, setID: 0x6}, 150: {cat: 0x62, setID: 0x3}, 151: {cat: 0xf, setID: 0x1b}, 152: {cat: 0x63, setID: 0x3}, 153: {cat: 0xf, setID: 0x21}, 154: {cat: 0x64, setID: 0x3}, 155: {cat: 0x75, setID: 0x3}, 156: {cat: 0x21, setID: 0x3}, 157: {cat: 0x22, setID: 0x1}, 158: {cat: 0x23, setID: 0x2}, 159: {cat: 0x2c, setID: 0x22}, 160: {cat: 0x2d, setID: 0x5}, 161: {cat: 0x21, setID: 0x3}, 162: {cat: 0x22, setID: 0x1}, 163: {cat: 0x23, setID: 0x2}, 164: {cat: 0x24, setID: 0x23}, 165: {cat: 0x25, setID: 0x24}, } // Size: 356 bytes var cardinalIndex = []uint8{ // 36 elements 0x00, 0x00, 0x02, 0x03, 0x04, 0x06, 0x09, 0x0a, 0x0c, 0x0d, 0x10, 0x14, 0x17, 0x1d, 0x28, 0x2b, 0x2d, 0x2f, 0x32, 0x38, 0x42, 0x45, 0x4c, 0x55, 0x5c, 0x61, 0x6d, 0x74, 0x79, 0x7d, 0x89, 0x91, 0x95, 0x9c, 0xa1, 0xa6, } // Size: 60 bytes var cardinalLangToIndex = []uint8{ // 775 elements // Entry 0 - 3F 0x00, 0x08, 0x08, 0x08, 0x00, 0x00, 0x06, 0x06, 0x01, 0x01, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x01, 0x01, 0x08, 0x08, 0x04, 0x04, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x1a, 0x1a, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x06, 0x00, 0x00, // Entry 40 - 7F 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x1e, 0x1e, 0x08, 0x08, 0x13, 0x13, 0x13, 0x13, 0x13, 0x04, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x18, 0x18, 0x00, 0x00, 0x22, 0x22, 0x09, 0x09, 0x09, 0x00, 0x00, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, 0x16, 0x16, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Entry 80 - BF 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, // Entry C0 - FF 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, // Entry 100 - 13F 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x04, 0x04, 0x08, 0x08, 0x00, 0x00, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x04, 0x04, 0x0c, 0x0c, 0x08, 0x08, 0x08, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, // Entry 140 - 17F 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x08, 0x08, 0x04, 0x04, 0x1f, 0x1f, 0x14, 0x14, 0x04, 0x04, 0x08, 0x08, 0x08, 0x08, 0x01, 0x01, 0x06, 0x00, 0x00, 0x20, 0x20, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x17, 0x17, 0x01, 0x01, 0x13, 0x13, 0x13, 0x16, 0x16, 0x08, 0x08, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Entry 180 - 1BF 0x00, 0x04, 0x0a, 0x0a, 0x04, 0x04, 0x04, 0x04, 0x04, 0x10, 0x17, 0x00, 0x00, 0x00, 0x08, 0x08, 0x04, 0x08, 0x08, 0x00, 0x00, 0x08, 0x08, 0x02, 0x02, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x0f, 0x0f, 0x08, 0x10, // Entry 1C0 - 1FF 0x10, 0x08, 0x08, 0x0e, 0x0e, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x0d, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x00, 0x00, 0x08, 0x08, 0x0b, 0x0b, 0x08, 0x08, 0x08, 0x08, 0x12, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, // Entry 200 - 23F 0x00, 0x08, 0x10, 0x10, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x08, 0x06, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x06, 0x06, 0x06, 0x06, 0x06, 0x08, 0x19, 0x19, 0x0d, 0x0d, 0x08, 0x08, 0x03, 0x04, 0x03, 0x04, 0x04, 0x04, // Entry 240 - 27F 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x12, 0x12, 0x12, 0x08, 0x08, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x08, 0x08, 0x08, 0x10, 0x10, 0x10, 0x10, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x13, 0x11, 0x11, 0x11, 0x11, 0x11, 0x05, 0x05, 0x18, 0x18, 0x15, 0x15, 0x10, 0x10, // Entry 280 - 2BF 0x10, 0x10, 0x10, 0x10, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x08, 0x08, 0x08, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, 0x08, 0x08, 0x08, 0x0c, 0x08, 0x00, 0x00, 0x08, // Entry 2C0 - 2FF 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x08, 0x08, 0x1d, 0x1d, 0x04, 0x04, 0x04, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x06, 0x08, 0x08, 0x00, 0x00, 0x08, 0x08, 0x08, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Entry 300 - 33F 0x00, 0x00, 0x00, 0x01, 0x01, 0x04, 0x04, } // Size: 799 bytes var cardinalInclusionMasks = []uint64{ // 100 elements // Entry 0 - 1F 0x0000000200500419, 0x0000000000512153, 0x000000000a327105, 0x0000000ca23c7101, 0x00000004a23c7201, 0x0000000482943001, 0x0000001482943201, 0x0000000502943001, 0x0000000502943001, 0x0000000522943201, 0x0000000540543401, 0x00000000454128e1, 0x000000005b02e821, 0x000000006304e821, 0x000000006304ea21, 0x0000000042842821, 0x0000000042842a21, 0x0000000042842821, 0x0000000042842821, 0x0000000062842a21, 0x0000000200400421, 0x0000000000400061, 0x000000000a004021, 0x0000000022004021, 0x0000000022004221, 0x0000000002800021, 0x0000000002800221, 0x0000000002800021, 0x0000000002800021, 0x0000000022800221, 0x0000000000400421, 0x0000000000400061, // Entry 20 - 3F 0x000000000a004021, 0x0000000022004021, 0x0000000022004221, 0x0000000002800021, 0x0000000002800221, 0x0000000002800021, 0x0000000002800021, 0x0000000022800221, 0x0000000200400421, 0x0000000000400061, 0x000000000a004021, 0x0000000022004021, 0x0000000022004221, 0x0000000002800021, 0x0000000002800221, 0x0000000002800021, 0x0000000002800021, 0x0000000022800221, 0x0000000000400421, 0x0000000000400061, 0x000000000a004021, 0x0000000022004021, 0x0000000022004221, 0x0000000002800021, 0x0000000002800221, 0x0000000002800021, 0x0000000002800021, 0x0000000022800221, 0x0000000200400421, 0x0000000000400061, 0x000000000a004021, 0x0000000022004021, // Entry 40 - 5F 0x0000000022004221, 0x0000000002800021, 0x0000000002800221, 0x0000000002800021, 0x0000000002800021, 0x0000000022800221, 0x0000000040400421, 0x0000000044400061, 0x000000005a004021, 0x0000000062004021, 0x0000000062004221, 0x0000000042800021, 0x0000000042800221, 0x0000000042800021, 0x0000000042800021, 0x0000000062800221, 0x0000000200400421, 0x0000000000400061, 0x000000000a004021, 0x0000000022004021, 0x0000000022004221, 0x0000000002800021, 0x0000000002800221, 0x0000000002800021, 0x0000000002800021, 0x0000000022800221, 0x0000000040400421, 0x0000000044400061, 0x000000005a004021, 0x0000000062004021, 0x0000000062004221, 0x0000000042800021, // Entry 60 - 7F 0x0000000042800221, 0x0000000042800021, 0x0000000042800021, 0x0000000062800221, } // Size: 824 bytes // Slots used for cardinal: A6 of 0xFF rules; 24 of 0xFF indexes; 37 of 64 sets // Total table size 3860 bytes (3KiB); checksum: AAFBF21 ================================================ FILE: vendor/golang.org/x/text/internal/catmsg/catmsg.go ================================================ // Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package catmsg contains support types for package x/text/message/catalog. // // This package contains the low-level implementations of Message used by the // catalog package and provides primitives for other packages to implement their // own. For instance, the plural package provides functionality for selecting // translation strings based on the plural category of substitution arguments. // // # Encoding and Decoding // // Catalogs store Messages encoded as a single string. Compiling a message into // a string both results in compacter representation and speeds up evaluation. // // A Message must implement a Compile method to convert its arbitrary // representation to a string. The Compile method takes an Encoder which // facilitates serializing the message. Encoders also provide more context of // the messages's creation (such as for which language the message is intended), // which may not be known at the time of the creation of the message. // // Each message type must also have an accompanying decoder registered to decode // the message. This decoder takes a Decoder argument which provides the // counterparts for the decoding. // // # Renderers // // A Decoder must be initialized with a Renderer implementation. These // implementations must be provided by packages that use Catalogs, typically // formatting packages such as x/text/message. A typical user will not need to // worry about this type; it is only relevant to packages that do string // formatting and want to use the catalog package to handle localized strings. // // A package that uses catalogs for selecting strings receives selection results // as sequence of substrings passed to the Renderer. The following snippet shows // how to express the above example using the message package. // // message.Set(language.English, "You are %d minute(s) late.", // catalog.Var("minutes", plural.Select(1, "one", "minute")), // catalog.String("You are %[1]d ${minutes} late.")) // // p := message.NewPrinter(language.English) // p.Printf("You are %d minute(s) late.", 5) // always 5 minutes late. // // To evaluate the Printf, package message wraps the arguments in a Renderer // that is passed to the catalog for message decoding. The call sequence that // results from evaluating the above message, assuming the person is rather // tardy, is: // // Render("You are %[1]d ") // Arg(1) // Render("minutes") // Render(" late.") // // The calls to Arg is caused by the plural.Select execution, which evaluates // the argument to determine whether the singular or plural message form should // be selected. The calls to Render reports the partial results to the message // package for further evaluation. package catmsg import ( "errors" "fmt" "strconv" "strings" "sync" "golang.org/x/text/language" ) // A Handle refers to a registered message type. type Handle int // A Handler decodes and evaluates data compiled by a Message and sends the // result to the Decoder. The output may depend on the value of the substitution // arguments, accessible by the Decoder's Arg method. The Handler returns false // if there is no translation for the given substitution arguments. type Handler func(d *Decoder) bool // Register records the existence of a message type and returns a Handle that // can be used in the Encoder's EncodeMessageType method to create such // messages. The prefix of the name should be the package path followed by // an optional disambiguating string. // Register will panic if a handle for the same name was already registered. func Register(name string, handler Handler) Handle { mutex.Lock() defer mutex.Unlock() if _, ok := names[name]; ok { panic(fmt.Errorf("catmsg: handler for %q already exists", name)) } h := Handle(len(handlers)) names[name] = h handlers = append(handlers, handler) return h } // These handlers require fixed positions in the handlers slice. const ( msgVars Handle = iota msgFirst msgRaw msgString msgAffix // Leave some arbitrary room for future expansion: 20 should suffice. numInternal = 20 ) const prefix = "golang.org/x/text/internal/catmsg." var ( // TODO: find a more stable way to link handles to message types. mutex sync.Mutex names = map[string]Handle{ prefix + "Vars": msgVars, prefix + "First": msgFirst, prefix + "Raw": msgRaw, prefix + "String": msgString, prefix + "Affix": msgAffix, } handlers = make([]Handler, numInternal) ) func init() { // This handler is a message type wrapper that initializes a decoder // with a variable block. This message type, if present, is always at the // start of an encoded message. handlers[msgVars] = func(d *Decoder) bool { blockSize := int(d.DecodeUint()) d.vars = d.data[:blockSize] d.data = d.data[blockSize:] return d.executeMessage() } // First takes the first message in a sequence that results in a match for // the given substitution arguments. handlers[msgFirst] = func(d *Decoder) bool { for !d.Done() { if d.ExecuteMessage() { return true } } return false } handlers[msgRaw] = func(d *Decoder) bool { d.Render(d.data) return true } // A String message alternates between a string constant and a variable // substitution. handlers[msgString] = func(d *Decoder) bool { for !d.Done() { if str := d.DecodeString(); str != "" { d.Render(str) } if d.Done() { break } d.ExecuteSubstitution() } return true } handlers[msgAffix] = func(d *Decoder) bool { // TODO: use an alternative method for common cases. prefix := d.DecodeString() suffix := d.DecodeString() if prefix != "" { d.Render(prefix) } ret := d.ExecuteMessage() if suffix != "" { d.Render(suffix) } return ret } } var ( // ErrIncomplete indicates a compiled message does not define translations // for all possible argument values. If this message is returned, evaluating // a message may result in the ErrNoMatch error. ErrIncomplete = errors.New("catmsg: incomplete message; may not give result for all inputs") // ErrNoMatch indicates no translation message matched the given input // parameters when evaluating a message. ErrNoMatch = errors.New("catmsg: no translation for inputs") ) // A Message holds a collection of translations for the same phrase that may // vary based on the values of substitution arguments. type Message interface { // Compile encodes the format string(s) of the message as a string for later // evaluation. // // The first call Compile makes on the encoder must be EncodeMessageType. // The handle passed to this call may either be a handle returned by // Register to encode a single custom message, or HandleFirst followed by // a sequence of calls to EncodeMessage. // // Compile must return ErrIncomplete if it is possible for evaluation to // not match any translation for a given set of formatting parameters. // For example, selecting a translation based on plural form may not yield // a match if the form "Other" is not one of the selectors. // // Compile may return any other application-specific error. For backwards // compatibility with package like fmt, which often do not do sanity // checking of format strings ahead of time, Compile should still make an // effort to have some sensible fallback in case of an error. Compile(e *Encoder) error } // Compile converts a Message to a data string that can be stored in a Catalog. // The resulting string can subsequently be decoded by passing to the Execute // method of a Decoder. func Compile(tag language.Tag, macros Dictionary, m Message) (data string, err error) { // TODO: pass macros so they can be used for validation. v := &Encoder{inBody: true} // encoder for variables v.root = v e := &Encoder{root: v, parent: v, tag: tag} // encoder for messages err = m.Compile(e) // This package serves te message package, which in turn is meant to be a // drop-in replacement for fmt. With the fmt package, format strings are // evaluated lazily and errors are handled by substituting strings in the // result, rather then returning an error. Dealing with multiple languages // makes it more important to check errors ahead of time. We chose to be // consistent and compatible and allow graceful degradation in case of // errors. buf := e.buf[stripPrefix(e.buf):] if len(v.buf) > 0 { // Prepend variable block. b := make([]byte, 1+maxVarintBytes+len(v.buf)+len(buf)) b[0] = byte(msgVars) b = b[:1+encodeUint(b[1:], uint64(len(v.buf)))] b = append(b, v.buf...) b = append(b, buf...) buf = b } if err == nil { err = v.err } return string(buf), err } // FirstOf is a message type that prints the first message in the sequence that // resolves to a match for the given substitution arguments. type FirstOf []Message // Compile implements Message. func (s FirstOf) Compile(e *Encoder) error { e.EncodeMessageType(msgFirst) err := ErrIncomplete for i, m := range s { if err == nil { return fmt.Errorf("catalog: message argument %d is complete and blocks subsequent messages", i-1) } err = e.EncodeMessage(m) } return err } // Var defines a message that can be substituted for a placeholder of the same // name. If an expression does not result in a string after evaluation, Name is // used as the substitution. For example: // // Var{ // Name: "minutes", // Message: plural.Select(1, "one", "minute"), // } // // will resolve to minute for singular and minutes for plural forms. type Var struct { Name string Message Message } var errIsVar = errors.New("catmsg: variable used as message") // Compile implements Message. // // Note that this method merely registers a variable; it does not create an // encoded message. func (v *Var) Compile(e *Encoder) error { if err := e.addVar(v.Name, v.Message); err != nil { return err } // Using a Var by itself is an error. If it is in a sequence followed by // other messages referring to it, this error will be ignored. return errIsVar } // Raw is a message consisting of a single format string that is passed as is // to the Renderer. // // Note that a Renderer may still do its own variable substitution. type Raw string // Compile implements Message. func (r Raw) Compile(e *Encoder) (err error) { e.EncodeMessageType(msgRaw) // Special case: raw strings don't have a size encoding and so don't use // EncodeString. e.buf = append(e.buf, r...) return nil } // String is a message consisting of a single format string which contains // placeholders that may be substituted with variables. // // Variable substitutions are marked with placeholders and a variable name of // the form ${name}. Any other substitutions such as Go templates or // printf-style substitutions are left to be done by the Renderer. // // When evaluation a string interpolation, a Renderer will receive separate // calls for each placeholder and interstitial string. For example, for the // message: "%[1]v ${invites} %[2]v to ${their} party." The sequence of calls // is: // // d.Render("%[1]v ") // d.Arg(1) // d.Render(resultOfInvites) // d.Render(" %[2]v to ") // d.Arg(2) // d.Render(resultOfTheir) // d.Render(" party.") // // where the messages for "invites" and "their" both use a plural.Select // referring to the first argument. // // Strings may also invoke macros. Macros are essentially variables that can be // reused. Macros may, for instance, be used to make selections between // different conjugations of a verb. See the catalog package description for an // overview of macros. type String string // Compile implements Message. It parses the placeholder formats and returns // any error. func (s String) Compile(e *Encoder) (err error) { msg := string(s) const subStart = "${" hasHeader := false p := 0 b := []byte{} for { i := strings.Index(msg[p:], subStart) if i == -1 { break } b = append(b, msg[p:p+i]...) p += i + len(subStart) if i = strings.IndexByte(msg[p:], '}'); i == -1 { b = append(b, "$!(MISSINGBRACE)"...) err = fmt.Errorf("catmsg: missing '}'") p = len(msg) break } name := strings.TrimSpace(msg[p : p+i]) if q := strings.IndexByte(name, '('); q == -1 { if !hasHeader { hasHeader = true e.EncodeMessageType(msgString) } e.EncodeString(string(b)) e.EncodeSubstitution(name) b = b[:0] } else if j := strings.IndexByte(name[q:], ')'); j == -1 { // TODO: what should the error be? b = append(b, "$!(MISSINGPAREN)"...) err = fmt.Errorf("catmsg: missing ')'") } else if x, sErr := strconv.ParseUint(strings.TrimSpace(name[q+1:q+j]), 10, 32); sErr != nil { // TODO: handle more than one argument b = append(b, "$!(BADNUM)"...) err = fmt.Errorf("catmsg: invalid number %q", strings.TrimSpace(name[q+1:q+j])) } else { if !hasHeader { hasHeader = true e.EncodeMessageType(msgString) } e.EncodeString(string(b)) e.EncodeSubstitution(name[:q], int(x)) b = b[:0] } p += i + 1 } b = append(b, msg[p:]...) if !hasHeader { // Simplify string to a raw string. Raw(string(b)).Compile(e) } else if len(b) > 0 { e.EncodeString(string(b)) } return err } // Affix is a message that adds a prefix and suffix to another message. // This is mostly used add back whitespace to a translation that was stripped // before sending it out. type Affix struct { Message Message Prefix string Suffix string } // Compile implements Message. func (a Affix) Compile(e *Encoder) (err error) { // TODO: consider adding a special message type that just adds a single // return. This is probably common enough to handle the majority of cases. // Get some stats first, though. e.EncodeMessageType(msgAffix) e.EncodeString(a.Prefix) e.EncodeString(a.Suffix) e.EncodeMessage(a.Message) return nil } ================================================ FILE: vendor/golang.org/x/text/internal/catmsg/codec.go ================================================ // Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package catmsg import ( "errors" "fmt" "golang.org/x/text/language" ) // A Renderer renders a Message. type Renderer interface { // Render renders the given string. The given string may be interpreted as a // format string, such as the one used by the fmt package or a template. Render(s string) // Arg returns the i-th argument passed to format a message. This method // should return nil if there is no such argument. Messages need access to // arguments to allow selecting a message based on linguistic features of // those arguments. Arg(i int) interface{} } // A Dictionary specifies a source of messages, including variables or macros. type Dictionary interface { // Lookup returns the message for the given key. It returns false for ok if // such a message could not be found. Lookup(key string) (data string, ok bool) // TODO: consider returning an interface, instead of a string. This will // allow implementations to do their own message type decoding. } // An Encoder serializes a Message to a string. type Encoder struct { // The root encoder is used for storing encoded variables. root *Encoder // The parent encoder provides the surrounding scopes for resolving variable // names. parent *Encoder tag language.Tag // buf holds the encoded message so far. After a message completes encoding, // the contents of buf, prefixed by the encoded length, are flushed to the // parent buffer. buf []byte // vars is the lookup table of variables in the current scope. vars []keyVal err error inBody bool // if false next call must be EncodeMessageType } type keyVal struct { key string offset int } // Language reports the language for which the encoded message will be stored // in the Catalog. func (e *Encoder) Language() language.Tag { return e.tag } func (e *Encoder) setError(err error) { if e.root.err == nil { e.root.err = err } } // EncodeUint encodes x. func (e *Encoder) EncodeUint(x uint64) { e.checkInBody() var buf [maxVarintBytes]byte n := encodeUint(buf[:], x) e.buf = append(e.buf, buf[:n]...) } // EncodeString encodes s. func (e *Encoder) EncodeString(s string) { e.checkInBody() e.EncodeUint(uint64(len(s))) e.buf = append(e.buf, s...) } // EncodeMessageType marks the current message to be of type h. // // It must be the first call of a Message's Compile method. func (e *Encoder) EncodeMessageType(h Handle) { if e.inBody { panic("catmsg: EncodeMessageType not the first method called") } e.inBody = true e.EncodeUint(uint64(h)) } // EncodeMessage serializes the given message inline at the current position. func (e *Encoder) EncodeMessage(m Message) error { e = &Encoder{root: e.root, parent: e, tag: e.tag} err := m.Compile(e) if _, ok := m.(*Var); !ok { e.flushTo(e.parent) } return err } func (e *Encoder) checkInBody() { if !e.inBody { panic("catmsg: expected prior call to EncodeMessageType") } } // stripPrefix indicates the number of prefix bytes that must be stripped to // turn a single-element sequence into a message that is just this single member // without its size prefix. If the message can be stripped, b[1:n] contains the // size prefix. func stripPrefix(b []byte) (n int) { if len(b) > 0 && Handle(b[0]) == msgFirst { x, n, _ := decodeUint(b[1:]) if 1+n+int(x) == len(b) { return 1 + n } } return 0 } func (e *Encoder) flushTo(dst *Encoder) { data := e.buf p := stripPrefix(data) if p > 0 { data = data[1:] } else { // Prefix the size. dst.EncodeUint(uint64(len(data))) } dst.buf = append(dst.buf, data...) } func (e *Encoder) addVar(key string, m Message) error { for _, v := range e.parent.vars { if v.key == key { err := fmt.Errorf("catmsg: duplicate variable %q", key) e.setError(err) return err } } scope := e.parent // If a variable message is Incomplete, and does not evaluate to a message // during execution, we fall back to the variable name. We encode this by // appending the variable name if the message reports it's incomplete. err := m.Compile(e) if err != ErrIncomplete { e.setError(err) } switch { case len(e.buf) == 1 && Handle(e.buf[0]) == msgFirst: // empty sequence e.buf = e.buf[:0] e.inBody = false fallthrough case len(e.buf) == 0: // Empty message. if err := String(key).Compile(e); err != nil { e.setError(err) } case err == ErrIncomplete: if Handle(e.buf[0]) != msgFirst { seq := &Encoder{root: e.root, parent: e} seq.EncodeMessageType(msgFirst) e.flushTo(seq) e = seq } // e contains a sequence; append the fallback string. e.EncodeMessage(String(key)) } // Flush result to variable heap. offset := len(e.root.buf) e.flushTo(e.root) e.buf = e.buf[:0] // Record variable offset in current scope. scope.vars = append(scope.vars, keyVal{key: key, offset: offset}) return err } const ( substituteVar = iota substituteMacro substituteError ) // EncodeSubstitution inserts a resolved reference to a variable or macro. // // This call must be matched with a call to ExecuteSubstitution at decoding // time. func (e *Encoder) EncodeSubstitution(name string, arguments ...int) { if arity := len(arguments); arity > 0 { // TODO: also resolve macros. e.EncodeUint(substituteMacro) e.EncodeString(name) for _, a := range arguments { e.EncodeUint(uint64(a)) } return } for scope := e; scope != nil; scope = scope.parent { for _, v := range scope.vars { if v.key != name { continue } e.EncodeUint(substituteVar) // TODO: support arity > 0 e.EncodeUint(uint64(v.offset)) return } } // TODO: refer to dictionary-wide scoped variables. e.EncodeUint(substituteError) e.EncodeString(name) e.setError(fmt.Errorf("catmsg: unknown var %q", name)) } // A Decoder deserializes and evaluates messages that are encoded by an encoder. type Decoder struct { tag language.Tag dst Renderer macros Dictionary err error vars string data string macroArg int // TODO: allow more than one argument } // NewDecoder returns a new Decoder. // // Decoders are designed to be reused for multiple invocations of Execute. // Only one goroutine may call Execute concurrently. func NewDecoder(tag language.Tag, r Renderer, macros Dictionary) *Decoder { return &Decoder{ tag: tag, dst: r, macros: macros, } } func (d *Decoder) setError(err error) { if d.err == nil { d.err = err } } // Language returns the language in which the message is being rendered. // // The destination language may be a child language of the language used for // encoding. For instance, a decoding language of "pt-PT" is consistent with an // encoding language of "pt". func (d *Decoder) Language() language.Tag { return d.tag } // Done reports whether there are more bytes to process in this message. func (d *Decoder) Done() bool { return len(d.data) == 0 } // Render implements Renderer. func (d *Decoder) Render(s string) { d.dst.Render(s) } // Arg implements Renderer. // // During evaluation of macros, the argument positions may be mapped to // arguments that differ from the original call. func (d *Decoder) Arg(i int) interface{} { if d.macroArg != 0 { if i != 1 { panic("catmsg: only macros with single argument supported") } i = d.macroArg } return d.dst.Arg(i) } // DecodeUint decodes a number that was encoded with EncodeUint and advances the // position. func (d *Decoder) DecodeUint() uint64 { x, n, err := decodeUintString(d.data) d.data = d.data[n:] if err != nil { d.setError(err) } return x } // DecodeString decodes a string that was encoded with EncodeString and advances // the position. func (d *Decoder) DecodeString() string { size := d.DecodeUint() s := d.data[:size] d.data = d.data[size:] return s } // SkipMessage skips the message at the current location and advances the // position. func (d *Decoder) SkipMessage() { n := int(d.DecodeUint()) d.data = d.data[n:] } // Execute decodes and evaluates msg. // // Only one goroutine may call execute. func (d *Decoder) Execute(msg string) error { d.err = nil if !d.execute(msg) { return ErrNoMatch } return d.err } func (d *Decoder) execute(msg string) bool { saved := d.data d.data = msg ok := d.executeMessage() d.data = saved return ok } // executeMessageFromData is like execute, but also decodes a leading message // size and clips the given string accordingly. // // It reports the number of bytes consumed and whether a message was selected. func (d *Decoder) executeMessageFromData(s string) (n int, ok bool) { saved := d.data d.data = s size := int(d.DecodeUint()) n = len(s) - len(d.data) // Sanitize the setting. This allows skipping a size argument for // RawString and method Done. d.data = d.data[:size] ok = d.executeMessage() n += size - len(d.data) d.data = saved return n, ok } var errUnknownHandler = errors.New("catmsg: string contains unsupported handler") // executeMessage reads the handle id, initializes the decoder and executes the // message. It is assumed that all of d.data[d.p:] is the single message. func (d *Decoder) executeMessage() bool { if d.Done() { // We interpret no data as a valid empty message. return true } handle := d.DecodeUint() var fn Handler mutex.Lock() if int(handle) < len(handlers) { fn = handlers[handle] } mutex.Unlock() if fn == nil { d.setError(errUnknownHandler) d.execute(fmt.Sprintf("\x02$!(UNKNOWNMSGHANDLER=%#x)", handle)) return true } return fn(d) } // ExecuteMessage decodes and executes the message at the current position. func (d *Decoder) ExecuteMessage() bool { n, ok := d.executeMessageFromData(d.data) d.data = d.data[n:] return ok } // ExecuteSubstitution executes the message corresponding to the substitution // as encoded by EncodeSubstitution. func (d *Decoder) ExecuteSubstitution() { switch x := d.DecodeUint(); x { case substituteVar: offset := d.DecodeUint() d.executeMessageFromData(d.vars[offset:]) case substituteMacro: name := d.DecodeString() data, ok := d.macros.Lookup(name) old := d.macroArg // TODO: support macros of arity other than 1. d.macroArg = int(d.DecodeUint()) switch { case !ok: // TODO: detect this at creation time. d.setError(fmt.Errorf("catmsg: undefined macro %q", name)) fallthrough case !d.execute(data): d.dst.Render(name) // fall back to macro name. } d.macroArg = old case substituteError: d.dst.Render(d.DecodeString()) default: panic("catmsg: unreachable") } } ================================================ FILE: vendor/golang.org/x/text/internal/catmsg/varint.go ================================================ // Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package catmsg // This file implements varint encoding analogous to the one in encoding/binary. // We need a string version of this function, so we add that here and then add // the rest for consistency. import "errors" var ( errIllegalVarint = errors.New("catmsg: illegal varint") errVarintTooLarge = errors.New("catmsg: varint too large for uint64") ) const maxVarintBytes = 10 // maximum length of a varint // encodeUint encodes x as a variable-sized integer into buf and returns the // number of bytes written. buf must be at least maxVarintBytes long func encodeUint(buf []byte, x uint64) (n int) { for ; x > 127; n++ { buf[n] = 0x80 | uint8(x&0x7F) x >>= 7 } buf[n] = uint8(x) n++ return n } func decodeUintString(s string) (x uint64, size int, err error) { i := 0 for shift := uint(0); shift < 64; shift += 7 { if i >= len(s) { return 0, i, errIllegalVarint } b := uint64(s[i]) i++ x |= (b & 0x7F) << shift if b&0x80 == 0 { return x, i, nil } } return 0, i, errVarintTooLarge } func decodeUint(b []byte) (x uint64, size int, err error) { i := 0 for shift := uint(0); shift < 64; shift += 7 { if i >= len(b) { return 0, i, errIllegalVarint } c := uint64(b[i]) i++ x |= (c & 0x7F) << shift if c&0x80 == 0 { return x, i, nil } } return 0, i, errVarintTooLarge } ================================================ FILE: vendor/golang.org/x/text/internal/format/format.go ================================================ // Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package format contains types for defining language-specific formatting of // values. // // This package is internal now, but will eventually be exposed after the API // settles. package format // import "golang.org/x/text/internal/format" import ( "fmt" "golang.org/x/text/language" ) // State represents the printer state passed to custom formatters. It provides // access to the fmt.State interface and the sentence and language-related // context. type State interface { fmt.State // Language reports the requested language in which to render a message. Language() language.Tag // TODO: consider this and removing rune from the Format method in the // Formatter interface. // // Verb returns the format variant to render, analogous to the types used // in fmt. Use 'v' for the default or only variant. // Verb() rune // TODO: more info: // - sentence context such as linguistic features passed by the translator. } // Formatter is analogous to fmt.Formatter. type Formatter interface { Format(state State, verb rune) } ================================================ FILE: vendor/golang.org/x/text/internal/format/parser.go ================================================ // Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package format import ( "reflect" "unicode/utf8" ) // A Parser parses a format string. The result from the parse are set in the // struct fields. type Parser struct { Verb rune WidthPresent bool PrecPresent bool Minus bool Plus bool Sharp bool Space bool Zero bool // For the formats %+v %#v, we set the plusV/sharpV flags // and clear the plus/sharp flags since %+v and %#v are in effect // different, flagless formats set at the top level. PlusV bool SharpV bool HasIndex bool Width int Prec int // precision // retain arguments across calls. Args []interface{} // retain current argument number across calls ArgNum int // reordered records whether the format string used argument reordering. Reordered bool // goodArgNum records whether the most recent reordering directive was valid. goodArgNum bool // position info format string startPos int endPos int Status Status } // Reset initializes a parser to scan format strings for the given args. func (p *Parser) Reset(args []interface{}) { p.Args = args p.ArgNum = 0 p.startPos = 0 p.Reordered = false } // Text returns the part of the format string that was parsed by the last call // to Scan. It returns the original substitution clause if the current scan // parsed a substitution. func (p *Parser) Text() string { return p.format[p.startPos:p.endPos] } // SetFormat sets a new format string to parse. It does not reset the argument // count. func (p *Parser) SetFormat(format string) { p.format = format p.startPos = 0 p.endPos = 0 } // Status indicates the result type of a call to Scan. type Status int const ( StatusText Status = iota StatusSubstitution StatusBadWidthSubstitution StatusBadPrecSubstitution StatusNoVerb StatusBadArgNum StatusMissingArg ) // ClearFlags reset the parser to default behavior. func (p *Parser) ClearFlags() { p.WidthPresent = false p.PrecPresent = false p.Minus = false p.Plus = false p.Sharp = false p.Space = false p.Zero = false p.PlusV = false p.SharpV = false p.HasIndex = false } // Scan scans the next part of the format string and sets the status to // indicate whether it scanned a string literal, substitution or error. func (p *Parser) Scan() bool { p.Status = StatusText format := p.format end := len(format) if p.endPos >= end { return false } afterIndex := false // previous item in format was an index like [3]. p.startPos = p.endPos p.goodArgNum = true i := p.startPos for i < end && format[i] != '%' { i++ } if i > p.startPos { p.endPos = i return true } // Process one verb i++ p.Status = StatusSubstitution // Do we have flags? p.ClearFlags() simpleFormat: for ; i < end; i++ { c := p.format[i] switch c { case '#': p.Sharp = true case '0': p.Zero = !p.Minus // Only allow zero padding to the left. case '+': p.Plus = true case '-': p.Minus = true p.Zero = false // Do not pad with zeros to the right. case ' ': p.Space = true default: // Fast path for common case of ascii lower case simple verbs // without precision or width or argument indices. if 'a' <= c && c <= 'z' && p.ArgNum < len(p.Args) { if c == 'v' { // Go syntax p.SharpV = p.Sharp p.Sharp = false // Struct-field syntax p.PlusV = p.Plus p.Plus = false } p.Verb = rune(c) p.ArgNum++ p.endPos = i + 1 return true } // Format is more complex than simple flags and a verb or is malformed. break simpleFormat } } // Do we have an explicit argument index? i, afterIndex = p.updateArgNumber(format, i) // Do we have width? if i < end && format[i] == '*' { i++ p.Width, p.WidthPresent = p.intFromArg() if !p.WidthPresent { p.Status = StatusBadWidthSubstitution } // We have a negative width, so take its value and ensure // that the minus flag is set if p.Width < 0 { p.Width = -p.Width p.Minus = true p.Zero = false // Do not pad with zeros to the right. } afterIndex = false } else { p.Width, p.WidthPresent, i = parsenum(format, i, end) if afterIndex && p.WidthPresent { // "%[3]2d" p.goodArgNum = false } } // Do we have precision? if i+1 < end && format[i] == '.' { i++ if afterIndex { // "%[3].2d" p.goodArgNum = false } i, afterIndex = p.updateArgNumber(format, i) if i < end && format[i] == '*' { i++ p.Prec, p.PrecPresent = p.intFromArg() // Negative precision arguments don't make sense if p.Prec < 0 { p.Prec = 0 p.PrecPresent = false } if !p.PrecPresent { p.Status = StatusBadPrecSubstitution } afterIndex = false } else { p.Prec, p.PrecPresent, i = parsenum(format, i, end) if !p.PrecPresent { p.Prec = 0 p.PrecPresent = true } } } if !afterIndex { i, afterIndex = p.updateArgNumber(format, i) } p.HasIndex = afterIndex if i >= end { p.endPos = i p.Status = StatusNoVerb return true } verb, w := utf8.DecodeRuneInString(format[i:]) p.endPos = i + w p.Verb = verb switch { case verb == '%': // Percent does not absorb operands and ignores f.wid and f.prec. p.startPos = p.endPos - 1 p.Status = StatusText case !p.goodArgNum: p.Status = StatusBadArgNum case p.ArgNum >= len(p.Args): // No argument left over to print for the current verb. p.Status = StatusMissingArg p.ArgNum++ case verb == 'v': // Go syntax p.SharpV = p.Sharp p.Sharp = false // Struct-field syntax p.PlusV = p.Plus p.Plus = false fallthrough default: p.ArgNum++ } return true } // intFromArg gets the ArgNumth element of Args. On return, isInt reports // whether the argument has integer type. func (p *Parser) intFromArg() (num int, isInt bool) { if p.ArgNum < len(p.Args) { arg := p.Args[p.ArgNum] num, isInt = arg.(int) // Almost always OK. if !isInt { // Work harder. switch v := reflect.ValueOf(arg); v.Kind() { case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: n := v.Int() if int64(int(n)) == n { num = int(n) isInt = true } case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: n := v.Uint() if int64(n) >= 0 && uint64(int(n)) == n { num = int(n) isInt = true } default: // Already 0, false. } } p.ArgNum++ if tooLarge(num) { num = 0 isInt = false } } return } // parseArgNumber returns the value of the bracketed number, minus 1 // (explicit argument numbers are one-indexed but we want zero-indexed). // The opening bracket is known to be present at format[0]. // The returned values are the index, the number of bytes to consume // up to the closing paren, if present, and whether the number parsed // ok. The bytes to consume will be 1 if no closing paren is present. func parseArgNumber(format string) (index int, wid int, ok bool) { // There must be at least 3 bytes: [n]. if len(format) < 3 { return 0, 1, false } // Find closing bracket. for i := 1; i < len(format); i++ { if format[i] == ']' { width, ok, newi := parsenum(format, 1, i) if !ok || newi != i { return 0, i + 1, false } return width - 1, i + 1, true // arg numbers are one-indexed and skip paren. } } return 0, 1, false } // updateArgNumber returns the next argument to evaluate, which is either the value of the passed-in // argNum or the value of the bracketed integer that begins format[i:]. It also returns // the new value of i, that is, the index of the next byte of the format to process. func (p *Parser) updateArgNumber(format string, i int) (newi int, found bool) { if len(format) <= i || format[i] != '[' { return i, false } p.Reordered = true index, wid, ok := parseArgNumber(format[i:]) if ok && 0 <= index && index < len(p.Args) { p.ArgNum = index return i + wid, true } p.goodArgNum = false return i + wid, ok } // tooLarge reports whether the magnitude of the integer is // too large to be used as a formatting width or precision. func tooLarge(x int) bool { const max int = 1e6 return x > max || x < -max } // parsenum converts ASCII to integer. num is 0 (and isnum is false) if no number present. func parsenum(s string, start, end int) (num int, isnum bool, newi int) { if start >= end { return 0, false, end } for newi = start; newi < end && '0' <= s[newi] && s[newi] <= '9'; newi++ { if tooLarge(num) { return 0, false, end // Overflow; crazy long number most likely. } num = num*10 + int(s[newi]-'0') isnum = true } return } ================================================ FILE: vendor/golang.org/x/text/internal/internal.go ================================================ // Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package internal contains non-exported functionality that are used by // packages in the text repository. package internal // import "golang.org/x/text/internal" import ( "sort" "golang.org/x/text/language" ) // SortTags sorts tags in place. func SortTags(tags []language.Tag) { sort.Sort(sorter(tags)) } type sorter []language.Tag func (s sorter) Len() int { return len(s) } func (s sorter) Swap(i, j int) { s[i], s[j] = s[j], s[i] } func (s sorter) Less(i, j int) bool { return s[i].String() < s[j].String() } // UniqueTags sorts and filters duplicate tags in place and returns a slice with // only unique tags. func UniqueTags(tags []language.Tag) []language.Tag { if len(tags) <= 1 { return tags } SortTags(tags) k := 0 for i := 1; i < len(tags); i++ { if tags[k].String() < tags[i].String() { k++ tags[k] = tags[i] } } return tags[:k+1] } ================================================ FILE: vendor/golang.org/x/text/internal/language/common.go ================================================ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. package language // This file contains code common to the maketables.go and the package code. // AliasType is the type of an alias in AliasMap. type AliasType int8 const ( Deprecated AliasType = iota Macro Legacy AliasTypeUnknown AliasType = -1 ) ================================================ FILE: vendor/golang.org/x/text/internal/language/compact/compact.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package compact defines a compact representation of language tags. // // Common language tags (at least all for which locale information is defined // in CLDR) are assigned a unique index. Each Tag is associated with such an // ID for selecting language-related resources (such as translations) as well // as one for selecting regional defaults (currency, number formatting, etc.) // // It may want to export this functionality at some point, but at this point // this is only available for use within x/text. package compact // import "golang.org/x/text/internal/language/compact" import ( "sort" "strings" "golang.org/x/text/internal/language" ) // ID is an integer identifying a single tag. type ID uint16 func getCoreIndex(t language.Tag) (id ID, ok bool) { cci, ok := language.GetCompactCore(t) if !ok { return 0, false } i := sort.Search(len(coreTags), func(i int) bool { return cci <= coreTags[i] }) if i == len(coreTags) || coreTags[i] != cci { return 0, false } return ID(i), true } // Parent returns the ID of the parent or the root ID if id is already the root. func (id ID) Parent() ID { return parents[id] } // Tag converts id to an internal language Tag. func (id ID) Tag() language.Tag { if int(id) >= len(coreTags) { return specialTags[int(id)-len(coreTags)] } return coreTags[id].Tag() } var specialTags []language.Tag func init() { tags := strings.Split(specialTagsStr, " ") specialTags = make([]language.Tag, len(tags)) for i, t := range tags { specialTags[i] = language.MustParse(t) } } ================================================ FILE: vendor/golang.org/x/text/internal/language/compact/language.go ================================================ // Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:generate go run gen.go gen_index.go -output tables.go //go:generate go run gen_parents.go package compact // TODO: Remove above NOTE after: // - verifying that tables are dropped correctly (most notably matcher tables). import ( "strings" "golang.org/x/text/internal/language" ) // Tag represents a BCP 47 language tag. It is used to specify an instance of a // specific language or locale. All language tag values are guaranteed to be // well-formed. type Tag struct { // NOTE: exported tags will become part of the public API. language ID locale ID full fullTag // always a language.Tag for now. } const _und = 0 type fullTag interface { IsRoot() bool Parent() language.Tag } // Make a compact Tag from a fully specified internal language Tag. func Make(t language.Tag) (tag Tag) { if region := t.TypeForKey("rg"); len(region) == 6 && region[2:] == "zzzz" { if r, err := language.ParseRegion(region[:2]); err == nil { tFull := t t, _ = t.SetTypeForKey("rg", "") // TODO: should we not consider "va" for the language tag? var exact1, exact2 bool tag.language, exact1 = FromTag(t) t.RegionID = r tag.locale, exact2 = FromTag(t) if !exact1 || !exact2 { tag.full = tFull } return tag } } lang, ok := FromTag(t) tag.language = lang tag.locale = lang if !ok { tag.full = t } return tag } // Tag returns an internal language Tag version of this tag. func (t Tag) Tag() language.Tag { if t.full != nil { return t.full.(language.Tag) } tag := t.language.Tag() if t.language != t.locale { loc := t.locale.Tag() tag, _ = tag.SetTypeForKey("rg", strings.ToLower(loc.RegionID.String())+"zzzz") } return tag } // IsCompact reports whether this tag is fully defined in terms of ID. func (t *Tag) IsCompact() bool { return t.full == nil } // MayHaveVariants reports whether a tag may have variants. If it returns false // it is guaranteed the tag does not have variants. func (t Tag) MayHaveVariants() bool { return t.full != nil || int(t.language) >= len(coreTags) } // MayHaveExtensions reports whether a tag may have extensions. If it returns // false it is guaranteed the tag does not have them. func (t Tag) MayHaveExtensions() bool { return t.full != nil || int(t.language) >= len(coreTags) || t.language != t.locale } // IsRoot returns true if t is equal to language "und". func (t Tag) IsRoot() bool { if t.full != nil { return t.full.IsRoot() } return t.language == _und } // Parent returns the CLDR parent of t. In CLDR, missing fields in data for a // specific language are substituted with fields from the parent language. // The parent for a language may change for newer versions of CLDR. func (t Tag) Parent() Tag { if t.full != nil { return Make(t.full.Parent()) } if t.language != t.locale { // Simulate stripping -u-rg-xxxxxx return Tag{language: t.language, locale: t.language} } // TODO: use parent lookup table once cycle from internal package is // removed. Probably by internalizing the table and declaring this fast // enough. // lang := compactID(internal.Parent(uint16(t.language))) lang, _ := FromTag(t.language.Tag().Parent()) return Tag{language: lang, locale: lang} } // nextToken returns token t and the rest of the string. func nextToken(s string) (t, tail string) { p := strings.Index(s[1:], "-") if p == -1 { return s[1:], "" } p++ return s[1:p], s[p:] } // LanguageID returns an index, where 0 <= index < NumCompactTags, for tags // for which data exists in the text repository.The index will change over time // and should not be stored in persistent storage. If t does not match a compact // index, exact will be false and the compact index will be returned for the // first match after repeatedly taking the Parent of t. func LanguageID(t Tag) (id ID, exact bool) { return t.language, t.full == nil } // RegionalID returns the ID for the regional variant of this tag. This index is // used to indicate region-specific overrides, such as default currency, default // calendar and week data, default time cycle, and default measurement system // and unit preferences. // // For instance, the tag en-GB-u-rg-uszzzz specifies British English with US // settings for currency, number formatting, etc. The CompactIndex for this tag // will be that for en-GB, while the RegionalID will be the one corresponding to // en-US. func RegionalID(t Tag) (id ID, exact bool) { return t.locale, t.full == nil } // LanguageTag returns t stripped of regional variant indicators. // // At the moment this means it is stripped of a regional and variant subtag "rg" // and "va" in the "u" extension. func (t Tag) LanguageTag() Tag { if t.full == nil { return Tag{language: t.language, locale: t.language} } tt := t.Tag() tt.SetTypeForKey("rg", "") tt.SetTypeForKey("va", "") return Make(tt) } // RegionalTag returns the regional variant of the tag. // // At the moment this means that the region is set from the regional subtag // "rg" in the "u" extension. func (t Tag) RegionalTag() Tag { rt := Tag{language: t.locale, locale: t.locale} if t.full == nil { return rt } b := language.Builder{} tag := t.Tag() // tag, _ = tag.SetTypeForKey("rg", "") b.SetTag(t.locale.Tag()) if v := tag.Variants(); v != "" { for _, v := range strings.Split(v, "-") { b.AddVariant(v) } } for _, e := range tag.Extensions() { b.AddExt(e) } return t } // FromTag reports closest matching ID for an internal language Tag. func FromTag(t language.Tag) (id ID, exact bool) { // TODO: perhaps give more frequent tags a lower index. // TODO: we could make the indexes stable. This will excluded some // possibilities for optimization, so don't do this quite yet. exact = true b, s, r := t.Raw() if t.HasString() { if t.IsPrivateUse() { // We have no entries for user-defined tags. return 0, false } hasExtra := false if t.HasVariants() { if t.HasExtensions() { build := language.Builder{} build.SetTag(language.Tag{LangID: b, ScriptID: s, RegionID: r}) build.AddVariant(t.Variants()) exact = false t = build.Make() } hasExtra = true } else if _, ok := t.Extension('u'); ok { // TODO: va may mean something else. Consider not considering it. // Strip all but the 'va' entry. old := t variant := t.TypeForKey("va") t = language.Tag{LangID: b, ScriptID: s, RegionID: r} if variant != "" { t, _ = t.SetTypeForKey("va", variant) hasExtra = true } exact = old == t } else { exact = false } if hasExtra { // We have some variants. for i, s := range specialTags { if s == t { return ID(i + len(coreTags)), exact } } exact = false } } if x, ok := getCoreIndex(t); ok { return x, exact } exact = false if r != 0 && s == 0 { // Deal with cases where an extra script is inserted for the region. t, _ := t.Maximize() if x, ok := getCoreIndex(t); ok { return x, exact } } for t = t.Parent(); t != root; t = t.Parent() { // No variants specified: just compare core components. // The key has the form lllssrrr, where l, s, and r are nibbles for // respectively the langID, scriptID, and regionID. if x, ok := getCoreIndex(t); ok { return x, exact } } return 0, exact } var root = language.Tag{} ================================================ FILE: vendor/golang.org/x/text/internal/language/compact/parents.go ================================================ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. package compact // parents maps a compact index of a tag to the compact index of the parent of // this tag. var parents = []ID{ // 775 elements // Entry 0 - 3F 0x0000, 0x0000, 0x0001, 0x0001, 0x0000, 0x0004, 0x0000, 0x0006, 0x0000, 0x0008, 0x0000, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x0000, 0x0000, 0x0028, 0x0000, 0x002a, 0x0000, 0x002c, 0x0000, 0x0000, 0x002f, 0x002e, 0x002e, 0x0000, 0x0033, 0x0000, 0x0035, 0x0000, 0x0037, 0x0000, 0x0039, 0x0000, 0x003b, 0x0000, 0x0000, 0x003e, // Entry 40 - 7F 0x0000, 0x0040, 0x0040, 0x0000, 0x0043, 0x0043, 0x0000, 0x0046, 0x0000, 0x0048, 0x0000, 0x0000, 0x004b, 0x004a, 0x004a, 0x0000, 0x004f, 0x004f, 0x004f, 0x004f, 0x0000, 0x0054, 0x0054, 0x0000, 0x0057, 0x0000, 0x0059, 0x0000, 0x005b, 0x0000, 0x005d, 0x005d, 0x0000, 0x0060, 0x0000, 0x0062, 0x0000, 0x0064, 0x0000, 0x0066, 0x0066, 0x0000, 0x0069, 0x0000, 0x006b, 0x006b, 0x006b, 0x006b, 0x006b, 0x006b, 0x006b, 0x0000, 0x0073, 0x0000, 0x0075, 0x0000, 0x0077, 0x0000, 0x0000, 0x007a, 0x0000, 0x007c, 0x0000, 0x007e, // Entry 80 - BF 0x0000, 0x0080, 0x0080, 0x0000, 0x0083, 0x0083, 0x0000, 0x0086, 0x0087, 0x0087, 0x0087, 0x0086, 0x0088, 0x0087, 0x0087, 0x0087, 0x0086, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0088, 0x0087, 0x0087, 0x0087, 0x0087, 0x0088, 0x0087, 0x0088, 0x0087, 0x0087, 0x0088, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0086, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0086, 0x0087, 0x0086, // Entry C0 - FF 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0088, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0086, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0088, 0x0087, 0x0087, 0x0088, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0086, 0x0086, 0x0087, 0x0087, 0x0086, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0000, 0x00ef, 0x0000, 0x00f1, 0x00f2, 0x00f2, 0x00f2, 0x00f2, 0x00f2, 0x00f2, 0x00f2, 0x00f2, 0x00f2, 0x00f1, 0x00f2, 0x00f1, 0x00f1, // Entry 100 - 13F 0x00f2, 0x00f2, 0x00f1, 0x00f2, 0x00f2, 0x00f2, 0x00f2, 0x00f1, 0x00f2, 0x00f2, 0x00f2, 0x00f2, 0x00f2, 0x00f2, 0x0000, 0x010e, 0x0000, 0x0110, 0x0000, 0x0112, 0x0000, 0x0114, 0x0114, 0x0000, 0x0117, 0x0117, 0x0117, 0x0117, 0x0000, 0x011c, 0x0000, 0x011e, 0x0000, 0x0120, 0x0120, 0x0000, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, // Entry 140 - 17F 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0000, 0x0152, 0x0000, 0x0154, 0x0000, 0x0156, 0x0000, 0x0158, 0x0000, 0x015a, 0x0000, 0x015c, 0x015c, 0x015c, 0x0000, 0x0160, 0x0000, 0x0000, 0x0163, 0x0000, 0x0165, 0x0000, 0x0167, 0x0167, 0x0167, 0x0000, 0x016b, 0x0000, 0x016d, 0x0000, 0x016f, 0x0000, 0x0171, 0x0171, 0x0000, 0x0174, 0x0000, 0x0176, 0x0000, 0x0178, 0x0000, 0x017a, 0x0000, 0x017c, 0x0000, 0x017e, // Entry 180 - 1BF 0x0000, 0x0000, 0x0000, 0x0182, 0x0000, 0x0184, 0x0184, 0x0184, 0x0184, 0x0000, 0x0000, 0x0000, 0x018b, 0x0000, 0x0000, 0x018e, 0x0000, 0x0000, 0x0191, 0x0000, 0x0000, 0x0000, 0x0195, 0x0000, 0x0197, 0x0000, 0x0000, 0x019a, 0x0000, 0x0000, 0x019d, 0x0000, 0x019f, 0x0000, 0x01a1, 0x0000, 0x01a3, 0x0000, 0x01a5, 0x0000, 0x01a7, 0x0000, 0x01a9, 0x0000, 0x01ab, 0x0000, 0x01ad, 0x0000, 0x01af, 0x0000, 0x01b1, 0x01b1, 0x0000, 0x01b4, 0x0000, 0x01b6, 0x0000, 0x01b8, 0x0000, 0x01ba, 0x0000, 0x01bc, 0x0000, 0x0000, // Entry 1C0 - 1FF 0x01bf, 0x0000, 0x01c1, 0x0000, 0x01c3, 0x0000, 0x01c5, 0x0000, 0x01c7, 0x0000, 0x01c9, 0x0000, 0x01cb, 0x01cb, 0x01cb, 0x01cb, 0x0000, 0x01d0, 0x0000, 0x01d2, 0x01d2, 0x0000, 0x01d5, 0x0000, 0x01d7, 0x0000, 0x01d9, 0x0000, 0x01db, 0x0000, 0x01dd, 0x0000, 0x01df, 0x01df, 0x0000, 0x01e2, 0x0000, 0x01e4, 0x0000, 0x01e6, 0x0000, 0x01e8, 0x0000, 0x01ea, 0x0000, 0x01ec, 0x0000, 0x01ee, 0x0000, 0x01f0, 0x0000, 0x0000, 0x01f3, 0x0000, 0x01f5, 0x01f5, 0x01f5, 0x0000, 0x01f9, 0x0000, 0x01fb, 0x0000, 0x01fd, 0x0000, // Entry 200 - 23F 0x01ff, 0x0000, 0x0000, 0x0202, 0x0000, 0x0204, 0x0204, 0x0000, 0x0207, 0x0000, 0x0209, 0x0209, 0x0000, 0x020c, 0x020c, 0x0000, 0x020f, 0x020f, 0x020f, 0x020f, 0x020f, 0x020f, 0x020f, 0x0000, 0x0217, 0x0000, 0x0219, 0x0000, 0x021b, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0221, 0x0000, 0x0000, 0x0224, 0x0000, 0x0226, 0x0226, 0x0000, 0x0229, 0x0000, 0x022b, 0x022b, 0x0000, 0x0000, 0x022f, 0x022e, 0x022e, 0x0000, 0x0000, 0x0234, 0x0000, 0x0236, 0x0000, 0x0238, 0x0000, 0x0244, 0x023a, 0x0244, 0x0244, 0x0244, // Entry 240 - 27F 0x0244, 0x0244, 0x0244, 0x0244, 0x023a, 0x0244, 0x0244, 0x0000, 0x0247, 0x0247, 0x0247, 0x0000, 0x024b, 0x0000, 0x024d, 0x0000, 0x024f, 0x024f, 0x0000, 0x0252, 0x0000, 0x0254, 0x0254, 0x0254, 0x0254, 0x0254, 0x0254, 0x0000, 0x025b, 0x0000, 0x025d, 0x0000, 0x025f, 0x0000, 0x0261, 0x0000, 0x0263, 0x0000, 0x0265, 0x0000, 0x0000, 0x0268, 0x0268, 0x0268, 0x0000, 0x026c, 0x0000, 0x026e, 0x0000, 0x0270, 0x0000, 0x0000, 0x0000, 0x0274, 0x0273, 0x0273, 0x0000, 0x0278, 0x0000, 0x027a, 0x0000, 0x027c, 0x0000, 0x0000, // Entry 280 - 2BF 0x0000, 0x0000, 0x0281, 0x0000, 0x0000, 0x0284, 0x0000, 0x0286, 0x0286, 0x0286, 0x0286, 0x0000, 0x028b, 0x028b, 0x028b, 0x0000, 0x028f, 0x028f, 0x028f, 0x028f, 0x028f, 0x0000, 0x0295, 0x0295, 0x0295, 0x0295, 0x0000, 0x0000, 0x0000, 0x0000, 0x029d, 0x029d, 0x029d, 0x0000, 0x02a1, 0x02a1, 0x02a1, 0x02a1, 0x0000, 0x0000, 0x02a7, 0x02a7, 0x02a7, 0x02a7, 0x0000, 0x02ac, 0x0000, 0x02ae, 0x02ae, 0x0000, 0x02b1, 0x0000, 0x02b3, 0x0000, 0x02b5, 0x02b5, 0x0000, 0x0000, 0x02b9, 0x0000, 0x0000, 0x0000, 0x02bd, 0x0000, // Entry 2C0 - 2FF 0x02bf, 0x02bf, 0x0000, 0x0000, 0x02c3, 0x0000, 0x02c5, 0x0000, 0x02c7, 0x0000, 0x02c9, 0x0000, 0x02cb, 0x0000, 0x02cd, 0x02cd, 0x0000, 0x0000, 0x02d1, 0x0000, 0x02d3, 0x02d0, 0x02d0, 0x0000, 0x0000, 0x02d8, 0x02d7, 0x02d7, 0x0000, 0x0000, 0x02dd, 0x0000, 0x02df, 0x0000, 0x02e1, 0x0000, 0x0000, 0x02e4, 0x0000, 0x02e6, 0x0000, 0x0000, 0x02e9, 0x0000, 0x02eb, 0x0000, 0x02ed, 0x0000, 0x02ef, 0x02ef, 0x0000, 0x0000, 0x02f3, 0x02f2, 0x02f2, 0x0000, 0x02f7, 0x0000, 0x02f9, 0x02f9, 0x02f9, 0x02f9, 0x02f9, 0x0000, // Entry 300 - 33F 0x02ff, 0x0300, 0x02ff, 0x0000, 0x0303, 0x0051, 0x00e6, } // Size: 1574 bytes // Total table size 1574 bytes (1KiB); checksum: 895AAF0B ================================================ FILE: vendor/golang.org/x/text/internal/language/compact/tables.go ================================================ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. package compact import "golang.org/x/text/internal/language" // CLDRVersion is the CLDR version from which the tables in this package are derived. const CLDRVersion = "32" // NumCompactTags is the number of common tags. The maximum tag is // NumCompactTags-1. const NumCompactTags = 775 const ( undIndex ID = 0 afIndex ID = 1 afNAIndex ID = 2 afZAIndex ID = 3 agqIndex ID = 4 agqCMIndex ID = 5 akIndex ID = 6 akGHIndex ID = 7 amIndex ID = 8 amETIndex ID = 9 arIndex ID = 10 ar001Index ID = 11 arAEIndex ID = 12 arBHIndex ID = 13 arDJIndex ID = 14 arDZIndex ID = 15 arEGIndex ID = 16 arEHIndex ID = 17 arERIndex ID = 18 arILIndex ID = 19 arIQIndex ID = 20 arJOIndex ID = 21 arKMIndex ID = 22 arKWIndex ID = 23 arLBIndex ID = 24 arLYIndex ID = 25 arMAIndex ID = 26 arMRIndex ID = 27 arOMIndex ID = 28 arPSIndex ID = 29 arQAIndex ID = 30 arSAIndex ID = 31 arSDIndex ID = 32 arSOIndex ID = 33 arSSIndex ID = 34 arSYIndex ID = 35 arTDIndex ID = 36 arTNIndex ID = 37 arYEIndex ID = 38 arsIndex ID = 39 asIndex ID = 40 asINIndex ID = 41 asaIndex ID = 42 asaTZIndex ID = 43 astIndex ID = 44 astESIndex ID = 45 azIndex ID = 46 azCyrlIndex ID = 47 azCyrlAZIndex ID = 48 azLatnIndex ID = 49 azLatnAZIndex ID = 50 basIndex ID = 51 basCMIndex ID = 52 beIndex ID = 53 beBYIndex ID = 54 bemIndex ID = 55 bemZMIndex ID = 56 bezIndex ID = 57 bezTZIndex ID = 58 bgIndex ID = 59 bgBGIndex ID = 60 bhIndex ID = 61 bmIndex ID = 62 bmMLIndex ID = 63 bnIndex ID = 64 bnBDIndex ID = 65 bnINIndex ID = 66 boIndex ID = 67 boCNIndex ID = 68 boINIndex ID = 69 brIndex ID = 70 brFRIndex ID = 71 brxIndex ID = 72 brxINIndex ID = 73 bsIndex ID = 74 bsCyrlIndex ID = 75 bsCyrlBAIndex ID = 76 bsLatnIndex ID = 77 bsLatnBAIndex ID = 78 caIndex ID = 79 caADIndex ID = 80 caESIndex ID = 81 caFRIndex ID = 82 caITIndex ID = 83 ccpIndex ID = 84 ccpBDIndex ID = 85 ccpINIndex ID = 86 ceIndex ID = 87 ceRUIndex ID = 88 cggIndex ID = 89 cggUGIndex ID = 90 chrIndex ID = 91 chrUSIndex ID = 92 ckbIndex ID = 93 ckbIQIndex ID = 94 ckbIRIndex ID = 95 csIndex ID = 96 csCZIndex ID = 97 cuIndex ID = 98 cuRUIndex ID = 99 cyIndex ID = 100 cyGBIndex ID = 101 daIndex ID = 102 daDKIndex ID = 103 daGLIndex ID = 104 davIndex ID = 105 davKEIndex ID = 106 deIndex ID = 107 deATIndex ID = 108 deBEIndex ID = 109 deCHIndex ID = 110 deDEIndex ID = 111 deITIndex ID = 112 deLIIndex ID = 113 deLUIndex ID = 114 djeIndex ID = 115 djeNEIndex ID = 116 dsbIndex ID = 117 dsbDEIndex ID = 118 duaIndex ID = 119 duaCMIndex ID = 120 dvIndex ID = 121 dyoIndex ID = 122 dyoSNIndex ID = 123 dzIndex ID = 124 dzBTIndex ID = 125 ebuIndex ID = 126 ebuKEIndex ID = 127 eeIndex ID = 128 eeGHIndex ID = 129 eeTGIndex ID = 130 elIndex ID = 131 elCYIndex ID = 132 elGRIndex ID = 133 enIndex ID = 134 en001Index ID = 135 en150Index ID = 136 enAGIndex ID = 137 enAIIndex ID = 138 enASIndex ID = 139 enATIndex ID = 140 enAUIndex ID = 141 enBBIndex ID = 142 enBEIndex ID = 143 enBIIndex ID = 144 enBMIndex ID = 145 enBSIndex ID = 146 enBWIndex ID = 147 enBZIndex ID = 148 enCAIndex ID = 149 enCCIndex ID = 150 enCHIndex ID = 151 enCKIndex ID = 152 enCMIndex ID = 153 enCXIndex ID = 154 enCYIndex ID = 155 enDEIndex ID = 156 enDGIndex ID = 157 enDKIndex ID = 158 enDMIndex ID = 159 enERIndex ID = 160 enFIIndex ID = 161 enFJIndex ID = 162 enFKIndex ID = 163 enFMIndex ID = 164 enGBIndex ID = 165 enGDIndex ID = 166 enGGIndex ID = 167 enGHIndex ID = 168 enGIIndex ID = 169 enGMIndex ID = 170 enGUIndex ID = 171 enGYIndex ID = 172 enHKIndex ID = 173 enIEIndex ID = 174 enILIndex ID = 175 enIMIndex ID = 176 enINIndex ID = 177 enIOIndex ID = 178 enJEIndex ID = 179 enJMIndex ID = 180 enKEIndex ID = 181 enKIIndex ID = 182 enKNIndex ID = 183 enKYIndex ID = 184 enLCIndex ID = 185 enLRIndex ID = 186 enLSIndex ID = 187 enMGIndex ID = 188 enMHIndex ID = 189 enMOIndex ID = 190 enMPIndex ID = 191 enMSIndex ID = 192 enMTIndex ID = 193 enMUIndex ID = 194 enMWIndex ID = 195 enMYIndex ID = 196 enNAIndex ID = 197 enNFIndex ID = 198 enNGIndex ID = 199 enNLIndex ID = 200 enNRIndex ID = 201 enNUIndex ID = 202 enNZIndex ID = 203 enPGIndex ID = 204 enPHIndex ID = 205 enPKIndex ID = 206 enPNIndex ID = 207 enPRIndex ID = 208 enPWIndex ID = 209 enRWIndex ID = 210 enSBIndex ID = 211 enSCIndex ID = 212 enSDIndex ID = 213 enSEIndex ID = 214 enSGIndex ID = 215 enSHIndex ID = 216 enSIIndex ID = 217 enSLIndex ID = 218 enSSIndex ID = 219 enSXIndex ID = 220 enSZIndex ID = 221 enTCIndex ID = 222 enTKIndex ID = 223 enTOIndex ID = 224 enTTIndex ID = 225 enTVIndex ID = 226 enTZIndex ID = 227 enUGIndex ID = 228 enUMIndex ID = 229 enUSIndex ID = 230 enVCIndex ID = 231 enVGIndex ID = 232 enVIIndex ID = 233 enVUIndex ID = 234 enWSIndex ID = 235 enZAIndex ID = 236 enZMIndex ID = 237 enZWIndex ID = 238 eoIndex ID = 239 eo001Index ID = 240 esIndex ID = 241 es419Index ID = 242 esARIndex ID = 243 esBOIndex ID = 244 esBRIndex ID = 245 esBZIndex ID = 246 esCLIndex ID = 247 esCOIndex ID = 248 esCRIndex ID = 249 esCUIndex ID = 250 esDOIndex ID = 251 esEAIndex ID = 252 esECIndex ID = 253 esESIndex ID = 254 esGQIndex ID = 255 esGTIndex ID = 256 esHNIndex ID = 257 esICIndex ID = 258 esMXIndex ID = 259 esNIIndex ID = 260 esPAIndex ID = 261 esPEIndex ID = 262 esPHIndex ID = 263 esPRIndex ID = 264 esPYIndex ID = 265 esSVIndex ID = 266 esUSIndex ID = 267 esUYIndex ID = 268 esVEIndex ID = 269 etIndex ID = 270 etEEIndex ID = 271 euIndex ID = 272 euESIndex ID = 273 ewoIndex ID = 274 ewoCMIndex ID = 275 faIndex ID = 276 faAFIndex ID = 277 faIRIndex ID = 278 ffIndex ID = 279 ffCMIndex ID = 280 ffGNIndex ID = 281 ffMRIndex ID = 282 ffSNIndex ID = 283 fiIndex ID = 284 fiFIIndex ID = 285 filIndex ID = 286 filPHIndex ID = 287 foIndex ID = 288 foDKIndex ID = 289 foFOIndex ID = 290 frIndex ID = 291 frBEIndex ID = 292 frBFIndex ID = 293 frBIIndex ID = 294 frBJIndex ID = 295 frBLIndex ID = 296 frCAIndex ID = 297 frCDIndex ID = 298 frCFIndex ID = 299 frCGIndex ID = 300 frCHIndex ID = 301 frCIIndex ID = 302 frCMIndex ID = 303 frDJIndex ID = 304 frDZIndex ID = 305 frFRIndex ID = 306 frGAIndex ID = 307 frGFIndex ID = 308 frGNIndex ID = 309 frGPIndex ID = 310 frGQIndex ID = 311 frHTIndex ID = 312 frKMIndex ID = 313 frLUIndex ID = 314 frMAIndex ID = 315 frMCIndex ID = 316 frMFIndex ID = 317 frMGIndex ID = 318 frMLIndex ID = 319 frMQIndex ID = 320 frMRIndex ID = 321 frMUIndex ID = 322 frNCIndex ID = 323 frNEIndex ID = 324 frPFIndex ID = 325 frPMIndex ID = 326 frREIndex ID = 327 frRWIndex ID = 328 frSCIndex ID = 329 frSNIndex ID = 330 frSYIndex ID = 331 frTDIndex ID = 332 frTGIndex ID = 333 frTNIndex ID = 334 frVUIndex ID = 335 frWFIndex ID = 336 frYTIndex ID = 337 furIndex ID = 338 furITIndex ID = 339 fyIndex ID = 340 fyNLIndex ID = 341 gaIndex ID = 342 gaIEIndex ID = 343 gdIndex ID = 344 gdGBIndex ID = 345 glIndex ID = 346 glESIndex ID = 347 gswIndex ID = 348 gswCHIndex ID = 349 gswFRIndex ID = 350 gswLIIndex ID = 351 guIndex ID = 352 guINIndex ID = 353 guwIndex ID = 354 guzIndex ID = 355 guzKEIndex ID = 356 gvIndex ID = 357 gvIMIndex ID = 358 haIndex ID = 359 haGHIndex ID = 360 haNEIndex ID = 361 haNGIndex ID = 362 hawIndex ID = 363 hawUSIndex ID = 364 heIndex ID = 365 heILIndex ID = 366 hiIndex ID = 367 hiINIndex ID = 368 hrIndex ID = 369 hrBAIndex ID = 370 hrHRIndex ID = 371 hsbIndex ID = 372 hsbDEIndex ID = 373 huIndex ID = 374 huHUIndex ID = 375 hyIndex ID = 376 hyAMIndex ID = 377 idIndex ID = 378 idIDIndex ID = 379 igIndex ID = 380 igNGIndex ID = 381 iiIndex ID = 382 iiCNIndex ID = 383 inIndex ID = 384 ioIndex ID = 385 isIndex ID = 386 isISIndex ID = 387 itIndex ID = 388 itCHIndex ID = 389 itITIndex ID = 390 itSMIndex ID = 391 itVAIndex ID = 392 iuIndex ID = 393 iwIndex ID = 394 jaIndex ID = 395 jaJPIndex ID = 396 jboIndex ID = 397 jgoIndex ID = 398 jgoCMIndex ID = 399 jiIndex ID = 400 jmcIndex ID = 401 jmcTZIndex ID = 402 jvIndex ID = 403 jwIndex ID = 404 kaIndex ID = 405 kaGEIndex ID = 406 kabIndex ID = 407 kabDZIndex ID = 408 kajIndex ID = 409 kamIndex ID = 410 kamKEIndex ID = 411 kcgIndex ID = 412 kdeIndex ID = 413 kdeTZIndex ID = 414 keaIndex ID = 415 keaCVIndex ID = 416 khqIndex ID = 417 khqMLIndex ID = 418 kiIndex ID = 419 kiKEIndex ID = 420 kkIndex ID = 421 kkKZIndex ID = 422 kkjIndex ID = 423 kkjCMIndex ID = 424 klIndex ID = 425 klGLIndex ID = 426 klnIndex ID = 427 klnKEIndex ID = 428 kmIndex ID = 429 kmKHIndex ID = 430 knIndex ID = 431 knINIndex ID = 432 koIndex ID = 433 koKPIndex ID = 434 koKRIndex ID = 435 kokIndex ID = 436 kokINIndex ID = 437 ksIndex ID = 438 ksINIndex ID = 439 ksbIndex ID = 440 ksbTZIndex ID = 441 ksfIndex ID = 442 ksfCMIndex ID = 443 kshIndex ID = 444 kshDEIndex ID = 445 kuIndex ID = 446 kwIndex ID = 447 kwGBIndex ID = 448 kyIndex ID = 449 kyKGIndex ID = 450 lagIndex ID = 451 lagTZIndex ID = 452 lbIndex ID = 453 lbLUIndex ID = 454 lgIndex ID = 455 lgUGIndex ID = 456 lktIndex ID = 457 lktUSIndex ID = 458 lnIndex ID = 459 lnAOIndex ID = 460 lnCDIndex ID = 461 lnCFIndex ID = 462 lnCGIndex ID = 463 loIndex ID = 464 loLAIndex ID = 465 lrcIndex ID = 466 lrcIQIndex ID = 467 lrcIRIndex ID = 468 ltIndex ID = 469 ltLTIndex ID = 470 luIndex ID = 471 luCDIndex ID = 472 luoIndex ID = 473 luoKEIndex ID = 474 luyIndex ID = 475 luyKEIndex ID = 476 lvIndex ID = 477 lvLVIndex ID = 478 masIndex ID = 479 masKEIndex ID = 480 masTZIndex ID = 481 merIndex ID = 482 merKEIndex ID = 483 mfeIndex ID = 484 mfeMUIndex ID = 485 mgIndex ID = 486 mgMGIndex ID = 487 mghIndex ID = 488 mghMZIndex ID = 489 mgoIndex ID = 490 mgoCMIndex ID = 491 mkIndex ID = 492 mkMKIndex ID = 493 mlIndex ID = 494 mlINIndex ID = 495 mnIndex ID = 496 mnMNIndex ID = 497 moIndex ID = 498 mrIndex ID = 499 mrINIndex ID = 500 msIndex ID = 501 msBNIndex ID = 502 msMYIndex ID = 503 msSGIndex ID = 504 mtIndex ID = 505 mtMTIndex ID = 506 muaIndex ID = 507 muaCMIndex ID = 508 myIndex ID = 509 myMMIndex ID = 510 mznIndex ID = 511 mznIRIndex ID = 512 nahIndex ID = 513 naqIndex ID = 514 naqNAIndex ID = 515 nbIndex ID = 516 nbNOIndex ID = 517 nbSJIndex ID = 518 ndIndex ID = 519 ndZWIndex ID = 520 ndsIndex ID = 521 ndsDEIndex ID = 522 ndsNLIndex ID = 523 neIndex ID = 524 neINIndex ID = 525 neNPIndex ID = 526 nlIndex ID = 527 nlAWIndex ID = 528 nlBEIndex ID = 529 nlBQIndex ID = 530 nlCWIndex ID = 531 nlNLIndex ID = 532 nlSRIndex ID = 533 nlSXIndex ID = 534 nmgIndex ID = 535 nmgCMIndex ID = 536 nnIndex ID = 537 nnNOIndex ID = 538 nnhIndex ID = 539 nnhCMIndex ID = 540 noIndex ID = 541 nqoIndex ID = 542 nrIndex ID = 543 nsoIndex ID = 544 nusIndex ID = 545 nusSSIndex ID = 546 nyIndex ID = 547 nynIndex ID = 548 nynUGIndex ID = 549 omIndex ID = 550 omETIndex ID = 551 omKEIndex ID = 552 orIndex ID = 553 orINIndex ID = 554 osIndex ID = 555 osGEIndex ID = 556 osRUIndex ID = 557 paIndex ID = 558 paArabIndex ID = 559 paArabPKIndex ID = 560 paGuruIndex ID = 561 paGuruINIndex ID = 562 papIndex ID = 563 plIndex ID = 564 plPLIndex ID = 565 prgIndex ID = 566 prg001Index ID = 567 psIndex ID = 568 psAFIndex ID = 569 ptIndex ID = 570 ptAOIndex ID = 571 ptBRIndex ID = 572 ptCHIndex ID = 573 ptCVIndex ID = 574 ptGQIndex ID = 575 ptGWIndex ID = 576 ptLUIndex ID = 577 ptMOIndex ID = 578 ptMZIndex ID = 579 ptPTIndex ID = 580 ptSTIndex ID = 581 ptTLIndex ID = 582 quIndex ID = 583 quBOIndex ID = 584 quECIndex ID = 585 quPEIndex ID = 586 rmIndex ID = 587 rmCHIndex ID = 588 rnIndex ID = 589 rnBIIndex ID = 590 roIndex ID = 591 roMDIndex ID = 592 roROIndex ID = 593 rofIndex ID = 594 rofTZIndex ID = 595 ruIndex ID = 596 ruBYIndex ID = 597 ruKGIndex ID = 598 ruKZIndex ID = 599 ruMDIndex ID = 600 ruRUIndex ID = 601 ruUAIndex ID = 602 rwIndex ID = 603 rwRWIndex ID = 604 rwkIndex ID = 605 rwkTZIndex ID = 606 sahIndex ID = 607 sahRUIndex ID = 608 saqIndex ID = 609 saqKEIndex ID = 610 sbpIndex ID = 611 sbpTZIndex ID = 612 sdIndex ID = 613 sdPKIndex ID = 614 sdhIndex ID = 615 seIndex ID = 616 seFIIndex ID = 617 seNOIndex ID = 618 seSEIndex ID = 619 sehIndex ID = 620 sehMZIndex ID = 621 sesIndex ID = 622 sesMLIndex ID = 623 sgIndex ID = 624 sgCFIndex ID = 625 shIndex ID = 626 shiIndex ID = 627 shiLatnIndex ID = 628 shiLatnMAIndex ID = 629 shiTfngIndex ID = 630 shiTfngMAIndex ID = 631 siIndex ID = 632 siLKIndex ID = 633 skIndex ID = 634 skSKIndex ID = 635 slIndex ID = 636 slSIIndex ID = 637 smaIndex ID = 638 smiIndex ID = 639 smjIndex ID = 640 smnIndex ID = 641 smnFIIndex ID = 642 smsIndex ID = 643 snIndex ID = 644 snZWIndex ID = 645 soIndex ID = 646 soDJIndex ID = 647 soETIndex ID = 648 soKEIndex ID = 649 soSOIndex ID = 650 sqIndex ID = 651 sqALIndex ID = 652 sqMKIndex ID = 653 sqXKIndex ID = 654 srIndex ID = 655 srCyrlIndex ID = 656 srCyrlBAIndex ID = 657 srCyrlMEIndex ID = 658 srCyrlRSIndex ID = 659 srCyrlXKIndex ID = 660 srLatnIndex ID = 661 srLatnBAIndex ID = 662 srLatnMEIndex ID = 663 srLatnRSIndex ID = 664 srLatnXKIndex ID = 665 ssIndex ID = 666 ssyIndex ID = 667 stIndex ID = 668 svIndex ID = 669 svAXIndex ID = 670 svFIIndex ID = 671 svSEIndex ID = 672 swIndex ID = 673 swCDIndex ID = 674 swKEIndex ID = 675 swTZIndex ID = 676 swUGIndex ID = 677 syrIndex ID = 678 taIndex ID = 679 taINIndex ID = 680 taLKIndex ID = 681 taMYIndex ID = 682 taSGIndex ID = 683 teIndex ID = 684 teINIndex ID = 685 teoIndex ID = 686 teoKEIndex ID = 687 teoUGIndex ID = 688 tgIndex ID = 689 tgTJIndex ID = 690 thIndex ID = 691 thTHIndex ID = 692 tiIndex ID = 693 tiERIndex ID = 694 tiETIndex ID = 695 tigIndex ID = 696 tkIndex ID = 697 tkTMIndex ID = 698 tlIndex ID = 699 tnIndex ID = 700 toIndex ID = 701 toTOIndex ID = 702 trIndex ID = 703 trCYIndex ID = 704 trTRIndex ID = 705 tsIndex ID = 706 ttIndex ID = 707 ttRUIndex ID = 708 twqIndex ID = 709 twqNEIndex ID = 710 tzmIndex ID = 711 tzmMAIndex ID = 712 ugIndex ID = 713 ugCNIndex ID = 714 ukIndex ID = 715 ukUAIndex ID = 716 urIndex ID = 717 urINIndex ID = 718 urPKIndex ID = 719 uzIndex ID = 720 uzArabIndex ID = 721 uzArabAFIndex ID = 722 uzCyrlIndex ID = 723 uzCyrlUZIndex ID = 724 uzLatnIndex ID = 725 uzLatnUZIndex ID = 726 vaiIndex ID = 727 vaiLatnIndex ID = 728 vaiLatnLRIndex ID = 729 vaiVaiiIndex ID = 730 vaiVaiiLRIndex ID = 731 veIndex ID = 732 viIndex ID = 733 viVNIndex ID = 734 voIndex ID = 735 vo001Index ID = 736 vunIndex ID = 737 vunTZIndex ID = 738 waIndex ID = 739 waeIndex ID = 740 waeCHIndex ID = 741 woIndex ID = 742 woSNIndex ID = 743 xhIndex ID = 744 xogIndex ID = 745 xogUGIndex ID = 746 yavIndex ID = 747 yavCMIndex ID = 748 yiIndex ID = 749 yi001Index ID = 750 yoIndex ID = 751 yoBJIndex ID = 752 yoNGIndex ID = 753 yueIndex ID = 754 yueHansIndex ID = 755 yueHansCNIndex ID = 756 yueHantIndex ID = 757 yueHantHKIndex ID = 758 zghIndex ID = 759 zghMAIndex ID = 760 zhIndex ID = 761 zhHansIndex ID = 762 zhHansCNIndex ID = 763 zhHansHKIndex ID = 764 zhHansMOIndex ID = 765 zhHansSGIndex ID = 766 zhHantIndex ID = 767 zhHantHKIndex ID = 768 zhHantMOIndex ID = 769 zhHantTWIndex ID = 770 zuIndex ID = 771 zuZAIndex ID = 772 caESvalenciaIndex ID = 773 enUSuvaposixIndex ID = 774 ) var coreTags = []language.CompactCoreInfo{ // 773 elements // Entry 0 - 1F 0x00000000, 0x01600000, 0x016000d3, 0x01600162, 0x01c00000, 0x01c00052, 0x02100000, 0x02100081, 0x02700000, 0x02700070, 0x03a00000, 0x03a00001, 0x03a00023, 0x03a00039, 0x03a00063, 0x03a00068, 0x03a0006c, 0x03a0006d, 0x03a0006e, 0x03a00098, 0x03a0009c, 0x03a000a2, 0x03a000a9, 0x03a000ad, 0x03a000b1, 0x03a000ba, 0x03a000bb, 0x03a000ca, 0x03a000e2, 0x03a000ee, 0x03a000f4, 0x03a00109, // Entry 20 - 3F 0x03a0010c, 0x03a00116, 0x03a00118, 0x03a0011d, 0x03a00121, 0x03a00129, 0x03a0015f, 0x04000000, 0x04300000, 0x0430009a, 0x04400000, 0x04400130, 0x04800000, 0x0480006f, 0x05800000, 0x05820000, 0x05820032, 0x0585b000, 0x0585b032, 0x05e00000, 0x05e00052, 0x07100000, 0x07100047, 0x07500000, 0x07500163, 0x07900000, 0x07900130, 0x07e00000, 0x07e00038, 0x08200000, 0x0a000000, 0x0a0000c4, // Entry 40 - 5F 0x0a500000, 0x0a500035, 0x0a50009a, 0x0a900000, 0x0a900053, 0x0a90009a, 0x0b200000, 0x0b200079, 0x0b500000, 0x0b50009a, 0x0b700000, 0x0b720000, 0x0b720033, 0x0b75b000, 0x0b75b033, 0x0d700000, 0x0d700022, 0x0d70006f, 0x0d700079, 0x0d70009f, 0x0db00000, 0x0db00035, 0x0db0009a, 0x0dc00000, 0x0dc00107, 0x0df00000, 0x0df00132, 0x0e500000, 0x0e500136, 0x0e900000, 0x0e90009c, 0x0e90009d, // Entry 60 - 7F 0x0fa00000, 0x0fa0005f, 0x0fe00000, 0x0fe00107, 0x10000000, 0x1000007c, 0x10100000, 0x10100064, 0x10100083, 0x10800000, 0x108000a5, 0x10d00000, 0x10d0002e, 0x10d00036, 0x10d0004e, 0x10d00061, 0x10d0009f, 0x10d000b3, 0x10d000b8, 0x11700000, 0x117000d5, 0x11f00000, 0x11f00061, 0x12400000, 0x12400052, 0x12800000, 0x12b00000, 0x12b00115, 0x12d00000, 0x12d00043, 0x12f00000, 0x12f000a5, // Entry 80 - 9F 0x13000000, 0x13000081, 0x13000123, 0x13600000, 0x1360005e, 0x13600088, 0x13900000, 0x13900001, 0x1390001a, 0x13900025, 0x13900026, 0x1390002d, 0x1390002e, 0x1390002f, 0x13900034, 0x13900036, 0x1390003a, 0x1390003d, 0x13900042, 0x13900046, 0x13900048, 0x13900049, 0x1390004a, 0x1390004e, 0x13900050, 0x13900052, 0x1390005d, 0x1390005e, 0x13900061, 0x13900062, 0x13900064, 0x13900065, // Entry A0 - BF 0x1390006e, 0x13900073, 0x13900074, 0x13900075, 0x13900076, 0x1390007c, 0x1390007d, 0x13900080, 0x13900081, 0x13900082, 0x13900084, 0x1390008b, 0x1390008d, 0x1390008e, 0x13900097, 0x13900098, 0x13900099, 0x1390009a, 0x1390009b, 0x139000a0, 0x139000a1, 0x139000a5, 0x139000a8, 0x139000aa, 0x139000ae, 0x139000b2, 0x139000b5, 0x139000b6, 0x139000c0, 0x139000c1, 0x139000c7, 0x139000c8, // Entry C0 - DF 0x139000cb, 0x139000cc, 0x139000cd, 0x139000cf, 0x139000d1, 0x139000d3, 0x139000d6, 0x139000d7, 0x139000da, 0x139000de, 0x139000e0, 0x139000e1, 0x139000e7, 0x139000e8, 0x139000e9, 0x139000ec, 0x139000ed, 0x139000f1, 0x13900108, 0x1390010a, 0x1390010b, 0x1390010c, 0x1390010d, 0x1390010e, 0x1390010f, 0x13900110, 0x13900113, 0x13900118, 0x1390011c, 0x1390011e, 0x13900120, 0x13900126, // Entry E0 - FF 0x1390012a, 0x1390012d, 0x1390012e, 0x13900130, 0x13900132, 0x13900134, 0x13900136, 0x1390013a, 0x1390013d, 0x1390013e, 0x13900140, 0x13900143, 0x13900162, 0x13900163, 0x13900165, 0x13c00000, 0x13c00001, 0x13e00000, 0x13e0001f, 0x13e0002c, 0x13e0003f, 0x13e00041, 0x13e00048, 0x13e00051, 0x13e00054, 0x13e00057, 0x13e0005a, 0x13e00066, 0x13e00069, 0x13e0006a, 0x13e0006f, 0x13e00087, // Entry 100 - 11F 0x13e0008a, 0x13e00090, 0x13e00095, 0x13e000d0, 0x13e000d9, 0x13e000e3, 0x13e000e5, 0x13e000e8, 0x13e000ed, 0x13e000f2, 0x13e0011b, 0x13e00136, 0x13e00137, 0x13e0013c, 0x14000000, 0x1400006b, 0x14500000, 0x1450006f, 0x14600000, 0x14600052, 0x14800000, 0x14800024, 0x1480009d, 0x14e00000, 0x14e00052, 0x14e00085, 0x14e000ca, 0x14e00115, 0x15100000, 0x15100073, 0x15300000, 0x153000e8, // Entry 120 - 13F 0x15800000, 0x15800064, 0x15800077, 0x15e00000, 0x15e00036, 0x15e00037, 0x15e0003a, 0x15e0003b, 0x15e0003c, 0x15e00049, 0x15e0004b, 0x15e0004c, 0x15e0004d, 0x15e0004e, 0x15e0004f, 0x15e00052, 0x15e00063, 0x15e00068, 0x15e00079, 0x15e0007b, 0x15e0007f, 0x15e00085, 0x15e00086, 0x15e00087, 0x15e00092, 0x15e000a9, 0x15e000b8, 0x15e000bb, 0x15e000bc, 0x15e000bf, 0x15e000c0, 0x15e000c4, // Entry 140 - 15F 0x15e000c9, 0x15e000ca, 0x15e000cd, 0x15e000d4, 0x15e000d5, 0x15e000e6, 0x15e000eb, 0x15e00103, 0x15e00108, 0x15e0010b, 0x15e00115, 0x15e0011d, 0x15e00121, 0x15e00123, 0x15e00129, 0x15e00140, 0x15e00141, 0x15e00160, 0x16900000, 0x1690009f, 0x16d00000, 0x16d000da, 0x16e00000, 0x16e00097, 0x17e00000, 0x17e0007c, 0x19000000, 0x1900006f, 0x1a300000, 0x1a30004e, 0x1a300079, 0x1a3000b3, // Entry 160 - 17F 0x1a400000, 0x1a40009a, 0x1a900000, 0x1ab00000, 0x1ab000a5, 0x1ac00000, 0x1ac00099, 0x1b400000, 0x1b400081, 0x1b4000d5, 0x1b4000d7, 0x1b800000, 0x1b800136, 0x1bc00000, 0x1bc00098, 0x1be00000, 0x1be0009a, 0x1d100000, 0x1d100033, 0x1d100091, 0x1d200000, 0x1d200061, 0x1d500000, 0x1d500093, 0x1d700000, 0x1d700028, 0x1e100000, 0x1e100096, 0x1e700000, 0x1e7000d7, 0x1ea00000, 0x1ea00053, // Entry 180 - 19F 0x1f300000, 0x1f500000, 0x1f800000, 0x1f80009e, 0x1f900000, 0x1f90004e, 0x1f90009f, 0x1f900114, 0x1f900139, 0x1fa00000, 0x1fb00000, 0x20000000, 0x200000a3, 0x20300000, 0x20700000, 0x20700052, 0x20800000, 0x20a00000, 0x20a00130, 0x20e00000, 0x20f00000, 0x21000000, 0x2100007e, 0x21200000, 0x21200068, 0x21600000, 0x21700000, 0x217000a5, 0x21f00000, 0x22300000, 0x22300130, 0x22700000, // Entry 1A0 - 1BF 0x2270005b, 0x23400000, 0x234000c4, 0x23900000, 0x239000a5, 0x24200000, 0x242000af, 0x24400000, 0x24400052, 0x24500000, 0x24500083, 0x24600000, 0x246000a5, 0x24a00000, 0x24a000a7, 0x25100000, 0x2510009a, 0x25400000, 0x254000ab, 0x254000ac, 0x25600000, 0x2560009a, 0x26a00000, 0x26a0009a, 0x26b00000, 0x26b00130, 0x26d00000, 0x26d00052, 0x26e00000, 0x26e00061, 0x27400000, 0x28100000, // Entry 1C0 - 1DF 0x2810007c, 0x28a00000, 0x28a000a6, 0x29100000, 0x29100130, 0x29500000, 0x295000b8, 0x2a300000, 0x2a300132, 0x2af00000, 0x2af00136, 0x2b500000, 0x2b50002a, 0x2b50004b, 0x2b50004c, 0x2b50004d, 0x2b800000, 0x2b8000b0, 0x2bf00000, 0x2bf0009c, 0x2bf0009d, 0x2c000000, 0x2c0000b7, 0x2c200000, 0x2c20004b, 0x2c400000, 0x2c4000a5, 0x2c500000, 0x2c5000a5, 0x2c700000, 0x2c7000b9, 0x2d100000, // Entry 1E0 - 1FF 0x2d1000a5, 0x2d100130, 0x2e900000, 0x2e9000a5, 0x2ed00000, 0x2ed000cd, 0x2f100000, 0x2f1000c0, 0x2f200000, 0x2f2000d2, 0x2f400000, 0x2f400052, 0x2ff00000, 0x2ff000c3, 0x30400000, 0x3040009a, 0x30b00000, 0x30b000c6, 0x31000000, 0x31b00000, 0x31b0009a, 0x31f00000, 0x31f0003e, 0x31f000d1, 0x31f0010e, 0x32000000, 0x320000cc, 0x32500000, 0x32500052, 0x33100000, 0x331000c5, 0x33a00000, // Entry 200 - 21F 0x33a0009d, 0x34100000, 0x34500000, 0x345000d3, 0x34700000, 0x347000db, 0x34700111, 0x34e00000, 0x34e00165, 0x35000000, 0x35000061, 0x350000da, 0x35100000, 0x3510009a, 0x351000dc, 0x36700000, 0x36700030, 0x36700036, 0x36700040, 0x3670005c, 0x367000da, 0x36700117, 0x3670011c, 0x36800000, 0x36800052, 0x36a00000, 0x36a000db, 0x36c00000, 0x36c00052, 0x36f00000, 0x37500000, 0x37600000, // Entry 220 - 23F 0x37a00000, 0x38000000, 0x38000118, 0x38700000, 0x38900000, 0x38900132, 0x39000000, 0x39000070, 0x390000a5, 0x39500000, 0x3950009a, 0x39800000, 0x3980007e, 0x39800107, 0x39d00000, 0x39d05000, 0x39d050e9, 0x39d36000, 0x39d3609a, 0x3a100000, 0x3b300000, 0x3b3000ea, 0x3bd00000, 0x3bd00001, 0x3be00000, 0x3be00024, 0x3c000000, 0x3c00002a, 0x3c000041, 0x3c00004e, 0x3c00005b, 0x3c000087, // Entry 240 - 25F 0x3c00008c, 0x3c0000b8, 0x3c0000c7, 0x3c0000d2, 0x3c0000ef, 0x3c000119, 0x3c000127, 0x3c400000, 0x3c40003f, 0x3c40006a, 0x3c4000e5, 0x3d400000, 0x3d40004e, 0x3d900000, 0x3d90003a, 0x3dc00000, 0x3dc000bd, 0x3dc00105, 0x3de00000, 0x3de00130, 0x3e200000, 0x3e200047, 0x3e2000a6, 0x3e2000af, 0x3e2000bd, 0x3e200107, 0x3e200131, 0x3e500000, 0x3e500108, 0x3e600000, 0x3e600130, 0x3eb00000, // Entry 260 - 27F 0x3eb00107, 0x3ec00000, 0x3ec000a5, 0x3f300000, 0x3f300130, 0x3fa00000, 0x3fa000e9, 0x3fc00000, 0x3fd00000, 0x3fd00073, 0x3fd000db, 0x3fd0010d, 0x3ff00000, 0x3ff000d2, 0x40100000, 0x401000c4, 0x40200000, 0x4020004c, 0x40700000, 0x40800000, 0x4085b000, 0x4085b0bb, 0x408eb000, 0x408eb0bb, 0x40c00000, 0x40c000b4, 0x41200000, 0x41200112, 0x41600000, 0x41600110, 0x41c00000, 0x41d00000, // Entry 280 - 29F 0x41e00000, 0x41f00000, 0x41f00073, 0x42200000, 0x42300000, 0x42300165, 0x42900000, 0x42900063, 0x42900070, 0x429000a5, 0x42900116, 0x43100000, 0x43100027, 0x431000c3, 0x4310014e, 0x43200000, 0x43220000, 0x43220033, 0x432200be, 0x43220106, 0x4322014e, 0x4325b000, 0x4325b033, 0x4325b0be, 0x4325b106, 0x4325b14e, 0x43700000, 0x43a00000, 0x43b00000, 0x44400000, 0x44400031, 0x44400073, // Entry 2A0 - 2BF 0x4440010d, 0x44500000, 0x4450004b, 0x445000a5, 0x44500130, 0x44500132, 0x44e00000, 0x45000000, 0x4500009a, 0x450000b4, 0x450000d1, 0x4500010e, 0x46100000, 0x4610009a, 0x46400000, 0x464000a5, 0x46400132, 0x46700000, 0x46700125, 0x46b00000, 0x46b00124, 0x46f00000, 0x46f0006e, 0x46f00070, 0x47100000, 0x47600000, 0x47600128, 0x47a00000, 0x48000000, 0x48200000, 0x4820012a, 0x48a00000, // Entry 2C0 - 2DF 0x48a0005e, 0x48a0012c, 0x48e00000, 0x49400000, 0x49400107, 0x4a400000, 0x4a4000d5, 0x4a900000, 0x4a9000bb, 0x4ac00000, 0x4ac00053, 0x4ae00000, 0x4ae00131, 0x4b400000, 0x4b40009a, 0x4b4000e9, 0x4bc00000, 0x4bc05000, 0x4bc05024, 0x4bc20000, 0x4bc20138, 0x4bc5b000, 0x4bc5b138, 0x4be00000, 0x4be5b000, 0x4be5b0b5, 0x4bef4000, 0x4bef40b5, 0x4c000000, 0x4c300000, 0x4c30013f, 0x4c900000, // Entry 2E0 - 2FF 0x4c900001, 0x4cc00000, 0x4cc00130, 0x4ce00000, 0x4cf00000, 0x4cf0004e, 0x4e500000, 0x4e500115, 0x4f200000, 0x4fb00000, 0x4fb00132, 0x50900000, 0x50900052, 0x51200000, 0x51200001, 0x51800000, 0x5180003b, 0x518000d7, 0x51f00000, 0x51f3b000, 0x51f3b053, 0x51f3c000, 0x51f3c08e, 0x52800000, 0x528000bb, 0x52900000, 0x5293b000, 0x5293b053, 0x5293b08e, 0x5293b0c7, 0x5293b10e, 0x5293c000, // Entry 300 - 31F 0x5293c08e, 0x5293c0c7, 0x5293c12f, 0x52f00000, 0x52f00162, } // Size: 3116 bytes const specialTagsStr string = "ca-ES-valencia en-US-u-va-posix" // Total table size 3147 bytes (3KiB); checksum: 5A8FFFA5 ================================================ FILE: vendor/golang.org/x/text/internal/language/compact/tags.go ================================================ // Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package compact var ( und = Tag{} Und Tag = Tag{} Afrikaans Tag = Tag{language: afIndex, locale: afIndex} Amharic Tag = Tag{language: amIndex, locale: amIndex} Arabic Tag = Tag{language: arIndex, locale: arIndex} ModernStandardArabic Tag = Tag{language: ar001Index, locale: ar001Index} Azerbaijani Tag = Tag{language: azIndex, locale: azIndex} Bulgarian Tag = Tag{language: bgIndex, locale: bgIndex} Bengali Tag = Tag{language: bnIndex, locale: bnIndex} Catalan Tag = Tag{language: caIndex, locale: caIndex} Czech Tag = Tag{language: csIndex, locale: csIndex} Danish Tag = Tag{language: daIndex, locale: daIndex} German Tag = Tag{language: deIndex, locale: deIndex} Greek Tag = Tag{language: elIndex, locale: elIndex} English Tag = Tag{language: enIndex, locale: enIndex} AmericanEnglish Tag = Tag{language: enUSIndex, locale: enUSIndex} BritishEnglish Tag = Tag{language: enGBIndex, locale: enGBIndex} Spanish Tag = Tag{language: esIndex, locale: esIndex} EuropeanSpanish Tag = Tag{language: esESIndex, locale: esESIndex} LatinAmericanSpanish Tag = Tag{language: es419Index, locale: es419Index} Estonian Tag = Tag{language: etIndex, locale: etIndex} Persian Tag = Tag{language: faIndex, locale: faIndex} Finnish Tag = Tag{language: fiIndex, locale: fiIndex} Filipino Tag = Tag{language: filIndex, locale: filIndex} French Tag = Tag{language: frIndex, locale: frIndex} CanadianFrench Tag = Tag{language: frCAIndex, locale: frCAIndex} Gujarati Tag = Tag{language: guIndex, locale: guIndex} Hebrew Tag = Tag{language: heIndex, locale: heIndex} Hindi Tag = Tag{language: hiIndex, locale: hiIndex} Croatian Tag = Tag{language: hrIndex, locale: hrIndex} Hungarian Tag = Tag{language: huIndex, locale: huIndex} Armenian Tag = Tag{language: hyIndex, locale: hyIndex} Indonesian Tag = Tag{language: idIndex, locale: idIndex} Icelandic Tag = Tag{language: isIndex, locale: isIndex} Italian Tag = Tag{language: itIndex, locale: itIndex} Japanese Tag = Tag{language: jaIndex, locale: jaIndex} Georgian Tag = Tag{language: kaIndex, locale: kaIndex} Kazakh Tag = Tag{language: kkIndex, locale: kkIndex} Khmer Tag = Tag{language: kmIndex, locale: kmIndex} Kannada Tag = Tag{language: knIndex, locale: knIndex} Korean Tag = Tag{language: koIndex, locale: koIndex} Kirghiz Tag = Tag{language: kyIndex, locale: kyIndex} Lao Tag = Tag{language: loIndex, locale: loIndex} Lithuanian Tag = Tag{language: ltIndex, locale: ltIndex} Latvian Tag = Tag{language: lvIndex, locale: lvIndex} Macedonian Tag = Tag{language: mkIndex, locale: mkIndex} Malayalam Tag = Tag{language: mlIndex, locale: mlIndex} Mongolian Tag = Tag{language: mnIndex, locale: mnIndex} Marathi Tag = Tag{language: mrIndex, locale: mrIndex} Malay Tag = Tag{language: msIndex, locale: msIndex} Burmese Tag = Tag{language: myIndex, locale: myIndex} Nepali Tag = Tag{language: neIndex, locale: neIndex} Dutch Tag = Tag{language: nlIndex, locale: nlIndex} Norwegian Tag = Tag{language: noIndex, locale: noIndex} Punjabi Tag = Tag{language: paIndex, locale: paIndex} Polish Tag = Tag{language: plIndex, locale: plIndex} Portuguese Tag = Tag{language: ptIndex, locale: ptIndex} BrazilianPortuguese Tag = Tag{language: ptBRIndex, locale: ptBRIndex} EuropeanPortuguese Tag = Tag{language: ptPTIndex, locale: ptPTIndex} Romanian Tag = Tag{language: roIndex, locale: roIndex} Russian Tag = Tag{language: ruIndex, locale: ruIndex} Sinhala Tag = Tag{language: siIndex, locale: siIndex} Slovak Tag = Tag{language: skIndex, locale: skIndex} Slovenian Tag = Tag{language: slIndex, locale: slIndex} Albanian Tag = Tag{language: sqIndex, locale: sqIndex} Serbian Tag = Tag{language: srIndex, locale: srIndex} SerbianLatin Tag = Tag{language: srLatnIndex, locale: srLatnIndex} Swedish Tag = Tag{language: svIndex, locale: svIndex} Swahili Tag = Tag{language: swIndex, locale: swIndex} Tamil Tag = Tag{language: taIndex, locale: taIndex} Telugu Tag = Tag{language: teIndex, locale: teIndex} Thai Tag = Tag{language: thIndex, locale: thIndex} Turkish Tag = Tag{language: trIndex, locale: trIndex} Ukrainian Tag = Tag{language: ukIndex, locale: ukIndex} Urdu Tag = Tag{language: urIndex, locale: urIndex} Uzbek Tag = Tag{language: uzIndex, locale: uzIndex} Vietnamese Tag = Tag{language: viIndex, locale: viIndex} Chinese Tag = Tag{language: zhIndex, locale: zhIndex} SimplifiedChinese Tag = Tag{language: zhHansIndex, locale: zhHansIndex} TraditionalChinese Tag = Tag{language: zhHantIndex, locale: zhHantIndex} Zulu Tag = Tag{language: zuIndex, locale: zuIndex} ) ================================================ FILE: vendor/golang.org/x/text/internal/language/compact.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package language // CompactCoreInfo is a compact integer with the three core tags encoded. type CompactCoreInfo uint32 // GetCompactCore generates a uint32 value that is guaranteed to be unique for // different language, region, and script values. func GetCompactCore(t Tag) (cci CompactCoreInfo, ok bool) { if t.LangID > langNoIndexOffset { return 0, false } cci |= CompactCoreInfo(t.LangID) << (8 + 12) cci |= CompactCoreInfo(t.ScriptID) << 12 cci |= CompactCoreInfo(t.RegionID) return cci, true } // Tag generates a tag from c. func (c CompactCoreInfo) Tag() Tag { return Tag{ LangID: Language(c >> 20), RegionID: Region(c & 0x3ff), ScriptID: Script(c>>12) & 0xff, } } ================================================ FILE: vendor/golang.org/x/text/internal/language/compose.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package language import ( "sort" "strings" ) // A Builder allows constructing a Tag from individual components. // Its main user is Compose in the top-level language package. type Builder struct { Tag Tag private string // the x extension variants []string extensions []string } // Make returns a new Tag from the current settings. func (b *Builder) Make() Tag { t := b.Tag if len(b.extensions) > 0 || len(b.variants) > 0 { sort.Sort(sortVariants(b.variants)) sort.Strings(b.extensions) if b.private != "" { b.extensions = append(b.extensions, b.private) } n := maxCoreSize + tokenLen(b.variants...) + tokenLen(b.extensions...) buf := make([]byte, n) p := t.genCoreBytes(buf) t.pVariant = byte(p) p += appendTokens(buf[p:], b.variants...) t.pExt = uint16(p) p += appendTokens(buf[p:], b.extensions...) t.str = string(buf[:p]) // We may not always need to remake the string, but when or when not // to do so is rather tricky. scan := makeScanner(buf[:p]) t, _ = parse(&scan, "") return t } else if b.private != "" { t.str = b.private t.RemakeString() } return t } // SetTag copies all the settings from a given Tag. Any previously set values // are discarded. func (b *Builder) SetTag(t Tag) { b.Tag.LangID = t.LangID b.Tag.RegionID = t.RegionID b.Tag.ScriptID = t.ScriptID // TODO: optimize b.variants = b.variants[:0] if variants := t.Variants(); variants != "" { for _, vr := range strings.Split(variants[1:], "-") { b.variants = append(b.variants, vr) } } b.extensions, b.private = b.extensions[:0], "" for _, e := range t.Extensions() { b.AddExt(e) } } // AddExt adds extension e to the tag. e must be a valid extension as returned // by Tag.Extension. If the extension already exists, it will be discarded, // except for a -u extension, where non-existing key-type pairs will added. func (b *Builder) AddExt(e string) { if e[0] == 'x' { if b.private == "" { b.private = e } return } for i, s := range b.extensions { if s[0] == e[0] { if e[0] == 'u' { b.extensions[i] += e[1:] } return } } b.extensions = append(b.extensions, e) } // SetExt sets the extension e to the tag. e must be a valid extension as // returned by Tag.Extension. If the extension already exists, it will be // overwritten, except for a -u extension, where the individual key-type pairs // will be set. func (b *Builder) SetExt(e string) { if e[0] == 'x' { b.private = e return } for i, s := range b.extensions { if s[0] == e[0] { if e[0] == 'u' { b.extensions[i] = e + s[1:] } else { b.extensions[i] = e } return } } b.extensions = append(b.extensions, e) } // AddVariant adds any number of variants. func (b *Builder) AddVariant(v ...string) { for _, v := range v { if v != "" { b.variants = append(b.variants, v) } } } // ClearVariants removes any variants previously added, including those // copied from a Tag in SetTag. func (b *Builder) ClearVariants() { b.variants = b.variants[:0] } // ClearExtensions removes any extensions previously added, including those // copied from a Tag in SetTag. func (b *Builder) ClearExtensions() { b.private = "" b.extensions = b.extensions[:0] } func tokenLen(token ...string) (n int) { for _, t := range token { n += len(t) + 1 } return } func appendTokens(b []byte, token ...string) int { p := 0 for _, t := range token { b[p] = '-' copy(b[p+1:], t) p += 1 + len(t) } return p } type sortVariants []string func (s sortVariants) Len() int { return len(s) } func (s sortVariants) Swap(i, j int) { s[j], s[i] = s[i], s[j] } func (s sortVariants) Less(i, j int) bool { return variantIndex[s[i]] < variantIndex[s[j]] } ================================================ FILE: vendor/golang.org/x/text/internal/language/coverage.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package language // BaseLanguages returns the list of all supported base languages. It generates // the list by traversing the internal structures. func BaseLanguages() []Language { base := make([]Language, 0, NumLanguages) for i := 0; i < langNoIndexOffset; i++ { // We included "und" already for the value 0. if i != nonCanonicalUnd { base = append(base, Language(i)) } } i := langNoIndexOffset for _, v := range langNoIndex { for k := 0; k < 8; k++ { if v&1 == 1 { base = append(base, Language(i)) } v >>= 1 i++ } } return base } ================================================ FILE: vendor/golang.org/x/text/internal/language/language.go ================================================ // Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:generate go run gen.go gen_common.go -output tables.go package language // import "golang.org/x/text/internal/language" // TODO: Remove above NOTE after: // - verifying that tables are dropped correctly (most notably matcher tables). import ( "errors" "fmt" "strings" ) const ( // maxCoreSize is the maximum size of a BCP 47 tag without variants and // extensions. Equals max lang (3) + script (4) + max reg (3) + 2 dashes. maxCoreSize = 12 // max99thPercentileSize is a somewhat arbitrary buffer size that presumably // is large enough to hold at least 99% of the BCP 47 tags. max99thPercentileSize = 32 // maxSimpleUExtensionSize is the maximum size of a -u extension with one // key-type pair. Equals len("-u-") + key (2) + dash + max value (8). maxSimpleUExtensionSize = 14 ) // Tag represents a BCP 47 language tag. It is used to specify an instance of a // specific language or locale. All language tag values are guaranteed to be // well-formed. The zero value of Tag is Und. type Tag struct { // TODO: the following fields have the form TagTypeID. This name is chosen // to allow refactoring the public package without conflicting with its // Base, Script, and Region methods. Once the transition is fully completed // the ID can be stripped from the name. LangID Language RegionID Region // TODO: we will soon run out of positions for ScriptID. Idea: instead of // storing lang, region, and ScriptID codes, store only the compact index and // have a lookup table from this code to its expansion. This greatly speeds // up table lookup, speed up common variant cases. // This will also immediately free up 3 extra bytes. Also, the pVariant // field can now be moved to the lookup table, as the compact index uniquely // determines the offset of a possible variant. ScriptID Script pVariant byte // offset in str, includes preceding '-' pExt uint16 // offset of first extension, includes preceding '-' // str is the string representation of the Tag. It will only be used if the // tag has variants or extensions. str string } // Make is a convenience wrapper for Parse that omits the error. // In case of an error, a sensible default is returned. func Make(s string) Tag { t, _ := Parse(s) return t } // Raw returns the raw base language, script and region, without making an // attempt to infer their values. // TODO: consider removing func (t Tag) Raw() (b Language, s Script, r Region) { return t.LangID, t.ScriptID, t.RegionID } // equalTags compares language, script and region subtags only. func (t Tag) equalTags(a Tag) bool { return t.LangID == a.LangID && t.ScriptID == a.ScriptID && t.RegionID == a.RegionID } // IsRoot returns true if t is equal to language "und". func (t Tag) IsRoot() bool { if int(t.pVariant) < len(t.str) { return false } return t.equalTags(Und) } // IsPrivateUse reports whether the Tag consists solely of an IsPrivateUse use // tag. func (t Tag) IsPrivateUse() bool { return t.str != "" && t.pVariant == 0 } // RemakeString is used to update t.str in case lang, script or region changed. // It is assumed that pExt and pVariant still point to the start of the // respective parts. func (t *Tag) RemakeString() { if t.str == "" { return } extra := t.str[t.pVariant:] if t.pVariant > 0 { extra = extra[1:] } if t.equalTags(Und) && strings.HasPrefix(extra, "x-") { t.str = extra t.pVariant = 0 t.pExt = 0 return } var buf [max99thPercentileSize]byte // avoid extra memory allocation in most cases. b := buf[:t.genCoreBytes(buf[:])] if extra != "" { diff := len(b) - int(t.pVariant) b = append(b, '-') b = append(b, extra...) t.pVariant = uint8(int(t.pVariant) + diff) t.pExt = uint16(int(t.pExt) + diff) } else { t.pVariant = uint8(len(b)) t.pExt = uint16(len(b)) } t.str = string(b) } // genCoreBytes writes a string for the base languages, script and region tags // to the given buffer and returns the number of bytes written. It will never // write more than maxCoreSize bytes. func (t *Tag) genCoreBytes(buf []byte) int { n := t.LangID.StringToBuf(buf[:]) if t.ScriptID != 0 { n += copy(buf[n:], "-") n += copy(buf[n:], t.ScriptID.String()) } if t.RegionID != 0 { n += copy(buf[n:], "-") n += copy(buf[n:], t.RegionID.String()) } return n } // String returns the canonical string representation of the language tag. func (t Tag) String() string { if t.str != "" { return t.str } if t.ScriptID == 0 && t.RegionID == 0 { return t.LangID.String() } buf := [maxCoreSize]byte{} return string(buf[:t.genCoreBytes(buf[:])]) } // MarshalText implements encoding.TextMarshaler. func (t Tag) MarshalText() (text []byte, err error) { if t.str != "" { text = append(text, t.str...) } else if t.ScriptID == 0 && t.RegionID == 0 { text = append(text, t.LangID.String()...) } else { buf := [maxCoreSize]byte{} text = buf[:t.genCoreBytes(buf[:])] } return text, nil } // UnmarshalText implements encoding.TextUnmarshaler. func (t *Tag) UnmarshalText(text []byte) error { tag, err := Parse(string(text)) *t = tag return err } // Variants returns the part of the tag holding all variants or the empty string // if there are no variants defined. func (t Tag) Variants() string { if t.pVariant == 0 { return "" } return t.str[t.pVariant:t.pExt] } // VariantOrPrivateUseTags returns variants or private use tags. func (t Tag) VariantOrPrivateUseTags() string { if t.pExt > 0 { return t.str[t.pVariant:t.pExt] } return t.str[t.pVariant:] } // HasString reports whether this tag defines more than just the raw // components. func (t Tag) HasString() bool { return t.str != "" } // Parent returns the CLDR parent of t. In CLDR, missing fields in data for a // specific language are substituted with fields from the parent language. // The parent for a language may change for newer versions of CLDR. func (t Tag) Parent() Tag { if t.str != "" { // Strip the variants and extensions. b, s, r := t.Raw() t = Tag{LangID: b, ScriptID: s, RegionID: r} if t.RegionID == 0 && t.ScriptID != 0 && t.LangID != 0 { base, _ := addTags(Tag{LangID: t.LangID}) if base.ScriptID == t.ScriptID { return Tag{LangID: t.LangID} } } return t } if t.LangID != 0 { if t.RegionID != 0 { maxScript := t.ScriptID if maxScript == 0 { max, _ := addTags(t) maxScript = max.ScriptID } for i := range parents { if Language(parents[i].lang) == t.LangID && Script(parents[i].maxScript) == maxScript { for _, r := range parents[i].fromRegion { if Region(r) == t.RegionID { return Tag{ LangID: t.LangID, ScriptID: Script(parents[i].script), RegionID: Region(parents[i].toRegion), } } } } } // Strip the script if it is the default one. base, _ := addTags(Tag{LangID: t.LangID}) if base.ScriptID != maxScript { return Tag{LangID: t.LangID, ScriptID: maxScript} } return Tag{LangID: t.LangID} } else if t.ScriptID != 0 { // The parent for an base-script pair with a non-default script is // "und" instead of the base language. base, _ := addTags(Tag{LangID: t.LangID}) if base.ScriptID != t.ScriptID { return Und } return Tag{LangID: t.LangID} } } return Und } // ParseExtension parses s as an extension and returns it on success. func ParseExtension(s string) (ext string, err error) { defer func() { if recover() != nil { ext = "" err = ErrSyntax } }() scan := makeScannerString(s) var end int if n := len(scan.token); n != 1 { return "", ErrSyntax } scan.toLower(0, len(scan.b)) end = parseExtension(&scan) if end != len(s) { return "", ErrSyntax } return string(scan.b), nil } // HasVariants reports whether t has variants. func (t Tag) HasVariants() bool { return uint16(t.pVariant) < t.pExt } // HasExtensions reports whether t has extensions. func (t Tag) HasExtensions() bool { return int(t.pExt) < len(t.str) } // Extension returns the extension of type x for tag t. It will return // false for ok if t does not have the requested extension. The returned // extension will be invalid in this case. func (t Tag) Extension(x byte) (ext string, ok bool) { for i := int(t.pExt); i < len(t.str)-1; { var ext string i, ext = getExtension(t.str, i) if ext[0] == x { return ext, true } } return "", false } // Extensions returns all extensions of t. func (t Tag) Extensions() []string { e := []string{} for i := int(t.pExt); i < len(t.str)-1; { var ext string i, ext = getExtension(t.str, i) e = append(e, ext) } return e } // TypeForKey returns the type associated with the given key, where key and type // are of the allowed values defined for the Unicode locale extension ('u') in // https://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers. // TypeForKey will traverse the inheritance chain to get the correct value. // // If there are multiple types associated with a key, only the first will be // returned. If there is no type associated with a key, it returns the empty // string. func (t Tag) TypeForKey(key string) string { if _, start, end, _ := t.findTypeForKey(key); end != start { s := t.str[start:end] if p := strings.IndexByte(s, '-'); p >= 0 { s = s[:p] } return s } return "" } var ( errPrivateUse = errors.New("cannot set a key on a private use tag") errInvalidArguments = errors.New("invalid key or type") ) // SetTypeForKey returns a new Tag with the key set to type, where key and type // are of the allowed values defined for the Unicode locale extension ('u') in // https://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers. // An empty value removes an existing pair with the same key. func (t Tag) SetTypeForKey(key, value string) (Tag, error) { if t.IsPrivateUse() { return t, errPrivateUse } if len(key) != 2 { return t, errInvalidArguments } // Remove the setting if value is "". if value == "" { start, sep, end, _ := t.findTypeForKey(key) if start != sep { // Remove a possible empty extension. switch { case t.str[start-2] != '-': // has previous elements. case end == len(t.str), // end of string end+2 < len(t.str) && t.str[end+2] == '-': // end of extension start -= 2 } if start == int(t.pVariant) && end == len(t.str) { t.str = "" t.pVariant, t.pExt = 0, 0 } else { t.str = fmt.Sprintf("%s%s", t.str[:start], t.str[end:]) } } return t, nil } if len(value) < 3 || len(value) > 8 { return t, errInvalidArguments } var ( buf [maxCoreSize + maxSimpleUExtensionSize]byte uStart int // start of the -u extension. ) // Generate the tag string if needed. if t.str == "" { uStart = t.genCoreBytes(buf[:]) buf[uStart] = '-' uStart++ } // Create new key-type pair and parse it to verify. b := buf[uStart:] copy(b, "u-") copy(b[2:], key) b[4] = '-' b = b[:5+copy(b[5:], value)] scan := makeScanner(b) if parseExtensions(&scan); scan.err != nil { return t, scan.err } // Assemble the replacement string. if t.str == "" { t.pVariant, t.pExt = byte(uStart-1), uint16(uStart-1) t.str = string(buf[:uStart+len(b)]) } else { s := t.str start, sep, end, hasExt := t.findTypeForKey(key) if start == sep { if hasExt { b = b[2:] } t.str = fmt.Sprintf("%s-%s%s", s[:sep], b, s[end:]) } else { t.str = fmt.Sprintf("%s-%s%s", s[:start+3], value, s[end:]) } } return t, nil } // findTypeForKey returns the start and end position for the type corresponding // to key or the point at which to insert the key-value pair if the type // wasn't found. The hasExt return value reports whether an -u extension was present. // Note: the extensions are typically very small and are likely to contain // only one key-type pair. func (t Tag) findTypeForKey(key string) (start, sep, end int, hasExt bool) { p := int(t.pExt) if len(key) != 2 || p == len(t.str) || p == 0 { return p, p, p, false } s := t.str // Find the correct extension. for p++; s[p] != 'u'; p++ { if s[p] > 'u' { p-- return p, p, p, false } if p = nextExtension(s, p); p == len(s) { return len(s), len(s), len(s), false } } // Proceed to the hyphen following the extension name. p++ // curKey is the key currently being processed. curKey := "" // Iterate over keys until we get the end of a section. for { end = p for p++; p < len(s) && s[p] != '-'; p++ { } n := p - end - 1 if n <= 2 && curKey == key { if sep < end { sep++ } return start, sep, end, true } switch n { case 0, // invalid string 1: // next extension return end, end, end, true case 2: // next key curKey = s[end+1 : p] if curKey > key { return end, end, end, true } start = end sep = p } } } // ParseBase parses a 2- or 3-letter ISO 639 code. // It returns a ValueError if s is a well-formed but unknown language identifier // or another error if another error occurred. func ParseBase(s string) (l Language, err error) { defer func() { if recover() != nil { l = 0 err = ErrSyntax } }() if n := len(s); n < 2 || 3 < n { return 0, ErrSyntax } var buf [3]byte return getLangID(buf[:copy(buf[:], s)]) } // ParseScript parses a 4-letter ISO 15924 code. // It returns a ValueError if s is a well-formed but unknown script identifier // or another error if another error occurred. func ParseScript(s string) (scr Script, err error) { defer func() { if recover() != nil { scr = 0 err = ErrSyntax } }() if len(s) != 4 { return 0, ErrSyntax } var buf [4]byte return getScriptID(script, buf[:copy(buf[:], s)]) } // EncodeM49 returns the Region for the given UN M.49 code. // It returns an error if r is not a valid code. func EncodeM49(r int) (Region, error) { return getRegionM49(r) } // ParseRegion parses a 2- or 3-letter ISO 3166-1 or a UN M.49 code. // It returns a ValueError if s is a well-formed but unknown region identifier // or another error if another error occurred. func ParseRegion(s string) (r Region, err error) { defer func() { if recover() != nil { r = 0 err = ErrSyntax } }() if n := len(s); n < 2 || 3 < n { return 0, ErrSyntax } var buf [3]byte return getRegionID(buf[:copy(buf[:], s)]) } // IsCountry returns whether this region is a country or autonomous area. This // includes non-standard definitions from CLDR. func (r Region) IsCountry() bool { if r == 0 || r.IsGroup() || r.IsPrivateUse() && r != _XK { return false } return true } // IsGroup returns whether this region defines a collection of regions. This // includes non-standard definitions from CLDR. func (r Region) IsGroup() bool { if r == 0 { return false } return int(regionInclusion[r]) < len(regionContainment) } // Contains returns whether Region c is contained by Region r. It returns true // if c == r. func (r Region) Contains(c Region) bool { if r == c { return true } g := regionInclusion[r] if g >= nRegionGroups { return false } m := regionContainment[g] d := regionInclusion[c] b := regionInclusionBits[d] // A contained country may belong to multiple disjoint groups. Matching any // of these indicates containment. If the contained region is a group, it // must strictly be a subset. if d >= nRegionGroups { return b&m != 0 } return b&^m == 0 } var errNoTLD = errors.New("language: region is not a valid ccTLD") // TLD returns the country code top-level domain (ccTLD). UK is returned for GB. // In all other cases it returns either the region itself or an error. // // This method may return an error for a region for which there exists a // canonical form with a ccTLD. To get that ccTLD canonicalize r first. The // region will already be canonicalized it was obtained from a Tag that was // obtained using any of the default methods. func (r Region) TLD() (Region, error) { // See http://en.wikipedia.org/wiki/Country_code_top-level_domain for the // difference between ISO 3166-1 and IANA ccTLD. if r == _GB { r = _UK } if (r.typ() & ccTLD) == 0 { return 0, errNoTLD } return r, nil } // Canonicalize returns the region or a possible replacement if the region is // deprecated. It will not return a replacement for deprecated regions that // are split into multiple regions. func (r Region) Canonicalize() Region { if cr := normRegion(r); cr != 0 { return cr } return r } // Variant represents a registered variant of a language as defined by BCP 47. type Variant struct { ID uint8 str string } // ParseVariant parses and returns a Variant. An error is returned if s is not // a valid variant. func ParseVariant(s string) (v Variant, err error) { defer func() { if recover() != nil { v = Variant{} err = ErrSyntax } }() s = strings.ToLower(s) if id, ok := variantIndex[s]; ok { return Variant{id, s}, nil } return Variant{}, NewValueError([]byte(s)) } // String returns the string representation of the variant. func (v Variant) String() string { return v.str } ================================================ FILE: vendor/golang.org/x/text/internal/language/lookup.go ================================================ // Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package language import ( "bytes" "fmt" "sort" "strconv" "golang.org/x/text/internal/tag" ) // findIndex tries to find the given tag in idx and returns a standardized error // if it could not be found. func findIndex(idx tag.Index, key []byte, form string) (index int, err error) { if !tag.FixCase(form, key) { return 0, ErrSyntax } i := idx.Index(key) if i == -1 { return 0, NewValueError(key) } return i, nil } func searchUint(imap []uint16, key uint16) int { return sort.Search(len(imap), func(i int) bool { return imap[i] >= key }) } type Language uint16 // getLangID returns the langID of s if s is a canonical subtag // or langUnknown if s is not a canonical subtag. func getLangID(s []byte) (Language, error) { if len(s) == 2 { return getLangISO2(s) } return getLangISO3(s) } // TODO language normalization as well as the AliasMaps could be moved to the // higher level package, but it is a bit tricky to separate the generation. func (id Language) Canonicalize() (Language, AliasType) { return normLang(id) } // normLang returns the mapped langID of id according to mapping m. func normLang(id Language) (Language, AliasType) { k := sort.Search(len(AliasMap), func(i int) bool { return AliasMap[i].From >= uint16(id) }) if k < len(AliasMap) && AliasMap[k].From == uint16(id) { return Language(AliasMap[k].To), AliasTypes[k] } return id, AliasTypeUnknown } // getLangISO2 returns the langID for the given 2-letter ISO language code // or unknownLang if this does not exist. func getLangISO2(s []byte) (Language, error) { if !tag.FixCase("zz", s) { return 0, ErrSyntax } if i := lang.Index(s); i != -1 && lang.Elem(i)[3] != 0 { return Language(i), nil } return 0, NewValueError(s) } const base = 'z' - 'a' + 1 func strToInt(s []byte) uint { v := uint(0) for i := 0; i < len(s); i++ { v *= base v += uint(s[i] - 'a') } return v } // converts the given integer to the original ASCII string passed to strToInt. // len(s) must match the number of characters obtained. func intToStr(v uint, s []byte) { for i := len(s) - 1; i >= 0; i-- { s[i] = byte(v%base) + 'a' v /= base } } // getLangISO3 returns the langID for the given 3-letter ISO language code // or unknownLang if this does not exist. func getLangISO3(s []byte) (Language, error) { if tag.FixCase("und", s) { // first try to match canonical 3-letter entries for i := lang.Index(s[:2]); i != -1; i = lang.Next(s[:2], i) { if e := lang.Elem(i); e[3] == 0 && e[2] == s[2] { // We treat "und" as special and always translate it to "unspecified". // Note that ZZ and Zzzz are private use and are not treated as // unspecified by default. id := Language(i) if id == nonCanonicalUnd { return 0, nil } return id, nil } } if i := altLangISO3.Index(s); i != -1 { return Language(altLangIndex[altLangISO3.Elem(i)[3]]), nil } n := strToInt(s) if langNoIndex[n/8]&(1<<(n%8)) != 0 { return Language(n) + langNoIndexOffset, nil } // Check for non-canonical uses of ISO3. for i := lang.Index(s[:1]); i != -1; i = lang.Next(s[:1], i) { if e := lang.Elem(i); e[2] == s[1] && e[3] == s[2] { return Language(i), nil } } return 0, NewValueError(s) } return 0, ErrSyntax } // StringToBuf writes the string to b and returns the number of bytes // written. cap(b) must be >= 3. func (id Language) StringToBuf(b []byte) int { if id >= langNoIndexOffset { intToStr(uint(id)-langNoIndexOffset, b[:3]) return 3 } else if id == 0 { return copy(b, "und") } l := lang[id<<2:] if l[3] == 0 { return copy(b, l[:3]) } return copy(b, l[:2]) } // String returns the BCP 47 representation of the langID. // Use b as variable name, instead of id, to ensure the variable // used is consistent with that of Base in which this type is embedded. func (b Language) String() string { if b == 0 { return "und" } else if b >= langNoIndexOffset { b -= langNoIndexOffset buf := [3]byte{} intToStr(uint(b), buf[:]) return string(buf[:]) } l := lang.Elem(int(b)) if l[3] == 0 { return l[:3] } return l[:2] } // ISO3 returns the ISO 639-3 language code. func (b Language) ISO3() string { if b == 0 || b >= langNoIndexOffset { return b.String() } l := lang.Elem(int(b)) if l[3] == 0 { return l[:3] } else if l[2] == 0 { return altLangISO3.Elem(int(l[3]))[:3] } // This allocation will only happen for 3-letter ISO codes // that are non-canonical BCP 47 language identifiers. return l[0:1] + l[2:4] } // IsPrivateUse reports whether this language code is reserved for private use. func (b Language) IsPrivateUse() bool { return langPrivateStart <= b && b <= langPrivateEnd } // SuppressScript returns the script marked as SuppressScript in the IANA // language tag repository, or 0 if there is no such script. func (b Language) SuppressScript() Script { if b < langNoIndexOffset { return Script(suppressScript[b]) } return 0 } type Region uint16 // getRegionID returns the region id for s if s is a valid 2-letter region code // or unknownRegion. func getRegionID(s []byte) (Region, error) { if len(s) == 3 { if isAlpha(s[0]) { return getRegionISO3(s) } if i, err := strconv.ParseUint(string(s), 10, 10); err == nil { return getRegionM49(int(i)) } } return getRegionISO2(s) } // getRegionISO2 returns the regionID for the given 2-letter ISO country code // or unknownRegion if this does not exist. func getRegionISO2(s []byte) (Region, error) { i, err := findIndex(regionISO, s, "ZZ") if err != nil { return 0, err } return Region(i) + isoRegionOffset, nil } // getRegionISO3 returns the regionID for the given 3-letter ISO country code // or unknownRegion if this does not exist. func getRegionISO3(s []byte) (Region, error) { if tag.FixCase("ZZZ", s) { for i := regionISO.Index(s[:1]); i != -1; i = regionISO.Next(s[:1], i) { if e := regionISO.Elem(i); e[2] == s[1] && e[3] == s[2] { return Region(i) + isoRegionOffset, nil } } for i := 0; i < len(altRegionISO3); i += 3 { if tag.Compare(altRegionISO3[i:i+3], s) == 0 { return Region(altRegionIDs[i/3]), nil } } return 0, NewValueError(s) } return 0, ErrSyntax } func getRegionM49(n int) (Region, error) { if 0 < n && n <= 999 { const ( searchBits = 7 regionBits = 9 regionMask = 1<> searchBits buf := fromM49[m49Index[idx]:m49Index[idx+1]] val := uint16(n) << regionBits // we rely on bits shifting out i := sort.Search(len(buf), func(i int) bool { return buf[i] >= val }) if r := fromM49[int(m49Index[idx])+i]; r&^regionMask == val { return Region(r & regionMask), nil } } var e ValueError fmt.Fprint(bytes.NewBuffer([]byte(e.v[:])), n) return 0, e } // normRegion returns a region if r is deprecated or 0 otherwise. // TODO: consider supporting BYS (-> BLR), CSK (-> 200 or CZ), PHI (-> PHL) and AFI (-> DJ). // TODO: consider mapping split up regions to new most populous one (like CLDR). func normRegion(r Region) Region { m := regionOldMap k := sort.Search(len(m), func(i int) bool { return m[i].From >= uint16(r) }) if k < len(m) && m[k].From == uint16(r) { return Region(m[k].To) } return 0 } const ( iso3166UserAssigned = 1 << iota ccTLD bcp47Region ) func (r Region) typ() byte { return regionTypes[r] } // String returns the BCP 47 representation for the region. // It returns "ZZ" for an unspecified region. func (r Region) String() string { if r < isoRegionOffset { if r == 0 { return "ZZ" } return fmt.Sprintf("%03d", r.M49()) } r -= isoRegionOffset return regionISO.Elem(int(r))[:2] } // ISO3 returns the 3-letter ISO code of r. // Note that not all regions have a 3-letter ISO code. // In such cases this method returns "ZZZ". func (r Region) ISO3() string { if r < isoRegionOffset { return "ZZZ" } r -= isoRegionOffset reg := regionISO.Elem(int(r)) switch reg[2] { case 0: return altRegionISO3[reg[3]:][:3] case ' ': return "ZZZ" } return reg[0:1] + reg[2:4] } // M49 returns the UN M.49 encoding of r, or 0 if this encoding // is not defined for r. func (r Region) M49() int { return int(m49[r]) } // IsPrivateUse reports whether r has the ISO 3166 User-assigned status. This // may include private-use tags that are assigned by CLDR and used in this // implementation. So IsPrivateUse and IsCountry can be simultaneously true. func (r Region) IsPrivateUse() bool { return r.typ()&iso3166UserAssigned != 0 } type Script uint16 // getScriptID returns the script id for string s. It assumes that s // is of the format [A-Z][a-z]{3}. func getScriptID(idx tag.Index, s []byte) (Script, error) { i, err := findIndex(idx, s, "Zzzz") return Script(i), err } // String returns the script code in title case. // It returns "Zzzz" for an unspecified script. func (s Script) String() string { if s == 0 { return "Zzzz" } return script.Elem(int(s)) } // IsPrivateUse reports whether this script code is reserved for private use. func (s Script) IsPrivateUse() bool { return _Qaaa <= s && s <= _Qabx } const ( maxAltTaglen = len("en-US-POSIX") maxLen = maxAltTaglen ) var ( // grandfatheredMap holds a mapping from legacy and grandfathered tags to // their base language or index to more elaborate tag. grandfatheredMap = map[[maxLen]byte]int16{ [maxLen]byte{'a', 'r', 't', '-', 'l', 'o', 'j', 'b', 'a', 'n'}: _jbo, // art-lojban [maxLen]byte{'i', '-', 'a', 'm', 'i'}: _ami, // i-ami [maxLen]byte{'i', '-', 'b', 'n', 'n'}: _bnn, // i-bnn [maxLen]byte{'i', '-', 'h', 'a', 'k'}: _hak, // i-hak [maxLen]byte{'i', '-', 'k', 'l', 'i', 'n', 'g', 'o', 'n'}: _tlh, // i-klingon [maxLen]byte{'i', '-', 'l', 'u', 'x'}: _lb, // i-lux [maxLen]byte{'i', '-', 'n', 'a', 'v', 'a', 'j', 'o'}: _nv, // i-navajo [maxLen]byte{'i', '-', 'p', 'w', 'n'}: _pwn, // i-pwn [maxLen]byte{'i', '-', 't', 'a', 'o'}: _tao, // i-tao [maxLen]byte{'i', '-', 't', 'a', 'y'}: _tay, // i-tay [maxLen]byte{'i', '-', 't', 's', 'u'}: _tsu, // i-tsu [maxLen]byte{'n', 'o', '-', 'b', 'o', 'k'}: _nb, // no-bok [maxLen]byte{'n', 'o', '-', 'n', 'y', 'n'}: _nn, // no-nyn [maxLen]byte{'s', 'g', 'n', '-', 'b', 'e', '-', 'f', 'r'}: _sfb, // sgn-BE-FR [maxLen]byte{'s', 'g', 'n', '-', 'b', 'e', '-', 'n', 'l'}: _vgt, // sgn-BE-NL [maxLen]byte{'s', 'g', 'n', '-', 'c', 'h', '-', 'd', 'e'}: _sgg, // sgn-CH-DE [maxLen]byte{'z', 'h', '-', 'g', 'u', 'o', 'y', 'u'}: _cmn, // zh-guoyu [maxLen]byte{'z', 'h', '-', 'h', 'a', 'k', 'k', 'a'}: _hak, // zh-hakka [maxLen]byte{'z', 'h', '-', 'm', 'i', 'n', '-', 'n', 'a', 'n'}: _nan, // zh-min-nan [maxLen]byte{'z', 'h', '-', 'x', 'i', 'a', 'n', 'g'}: _hsn, // zh-xiang // Grandfathered tags with no modern replacement will be converted as // follows: [maxLen]byte{'c', 'e', 'l', '-', 'g', 'a', 'u', 'l', 'i', 's', 'h'}: -1, // cel-gaulish [maxLen]byte{'e', 'n', '-', 'g', 'b', '-', 'o', 'e', 'd'}: -2, // en-GB-oed [maxLen]byte{'i', '-', 'd', 'e', 'f', 'a', 'u', 'l', 't'}: -3, // i-default [maxLen]byte{'i', '-', 'e', 'n', 'o', 'c', 'h', 'i', 'a', 'n'}: -4, // i-enochian [maxLen]byte{'i', '-', 'm', 'i', 'n', 'g', 'o'}: -5, // i-mingo [maxLen]byte{'z', 'h', '-', 'm', 'i', 'n'}: -6, // zh-min // CLDR-specific tag. [maxLen]byte{'r', 'o', 'o', 't'}: 0, // root [maxLen]byte{'e', 'n', '-', 'u', 's', '-', 'p', 'o', 's', 'i', 'x'}: -7, // en_US_POSIX" } altTagIndex = [...]uint8{0, 17, 31, 45, 61, 74, 86, 102} altTags = "xtg-x-cel-gaulishen-GB-oxendicten-x-i-defaultund-x-i-enochiansee-x-i-mingonan-x-zh-minen-US-u-va-posix" ) func grandfathered(s [maxAltTaglen]byte) (t Tag, ok bool) { if v, ok := grandfatheredMap[s]; ok { if v < 0 { return Make(altTags[altTagIndex[-v-1]:altTagIndex[-v]]), true } t.LangID = Language(v) return t, true } return t, false } ================================================ FILE: vendor/golang.org/x/text/internal/language/match.go ================================================ // Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package language import "errors" type scriptRegionFlags uint8 const ( isList = 1 << iota scriptInFrom regionInFrom ) func (t *Tag) setUndefinedLang(id Language) { if t.LangID == 0 { t.LangID = id } } func (t *Tag) setUndefinedScript(id Script) { if t.ScriptID == 0 { t.ScriptID = id } } func (t *Tag) setUndefinedRegion(id Region) { if t.RegionID == 0 || t.RegionID.Contains(id) { t.RegionID = id } } // ErrMissingLikelyTagsData indicates no information was available // to compute likely values of missing tags. var ErrMissingLikelyTagsData = errors.New("missing likely tags data") // addLikelySubtags sets subtags to their most likely value, given the locale. // In most cases this means setting fields for unknown values, but in some // cases it may alter a value. It returns an ErrMissingLikelyTagsData error // if the given locale cannot be expanded. func (t Tag) addLikelySubtags() (Tag, error) { id, err := addTags(t) if err != nil { return t, err } else if id.equalTags(t) { return t, nil } id.RemakeString() return id, nil } // specializeRegion attempts to specialize a group region. func specializeRegion(t *Tag) bool { if i := regionInclusion[t.RegionID]; i < nRegionGroups { x := likelyRegionGroup[i] if Language(x.lang) == t.LangID && Script(x.script) == t.ScriptID { t.RegionID = Region(x.region) } return true } return false } // Maximize returns a new tag with missing tags filled in. func (t Tag) Maximize() (Tag, error) { return addTags(t) } func addTags(t Tag) (Tag, error) { // We leave private use identifiers alone. if t.IsPrivateUse() { return t, nil } if t.ScriptID != 0 && t.RegionID != 0 { if t.LangID != 0 { // already fully specified specializeRegion(&t) return t, nil } // Search matches for und-script-region. Note that for these cases // region will never be a group so there is no need to check for this. list := likelyRegion[t.RegionID : t.RegionID+1] if x := list[0]; x.flags&isList != 0 { list = likelyRegionList[x.lang : x.lang+uint16(x.script)] } for _, x := range list { // Deviating from the spec. See match_test.go for details. if Script(x.script) == t.ScriptID { t.setUndefinedLang(Language(x.lang)) return t, nil } } } if t.LangID != 0 { // Search matches for lang-script and lang-region, where lang != und. if t.LangID < langNoIndexOffset { x := likelyLang[t.LangID] if x.flags&isList != 0 { list := likelyLangList[x.region : x.region+uint16(x.script)] if t.ScriptID != 0 { for _, x := range list { if Script(x.script) == t.ScriptID && x.flags&scriptInFrom != 0 { t.setUndefinedRegion(Region(x.region)) return t, nil } } } else if t.RegionID != 0 { count := 0 goodScript := true tt := t for _, x := range list { // We visit all entries for which the script was not // defined, including the ones where the region was not // defined. This allows for proper disambiguation within // regions. if x.flags&scriptInFrom == 0 && t.RegionID.Contains(Region(x.region)) { tt.RegionID = Region(x.region) tt.setUndefinedScript(Script(x.script)) goodScript = goodScript && tt.ScriptID == Script(x.script) count++ } } if count == 1 { return tt, nil } // Even if we fail to find a unique Region, we might have // an unambiguous script. if goodScript { t.ScriptID = tt.ScriptID } } } } } else { // Search matches for und-script. if t.ScriptID != 0 { x := likelyScript[t.ScriptID] if x.region != 0 { t.setUndefinedRegion(Region(x.region)) t.setUndefinedLang(Language(x.lang)) return t, nil } } // Search matches for und-region. If und-script-region exists, it would // have been found earlier. if t.RegionID != 0 { if i := regionInclusion[t.RegionID]; i < nRegionGroups { x := likelyRegionGroup[i] if x.region != 0 { t.setUndefinedLang(Language(x.lang)) t.setUndefinedScript(Script(x.script)) t.RegionID = Region(x.region) } } else { x := likelyRegion[t.RegionID] if x.flags&isList != 0 { x = likelyRegionList[x.lang] } if x.script != 0 && x.flags != scriptInFrom { t.setUndefinedLang(Language(x.lang)) t.setUndefinedScript(Script(x.script)) return t, nil } } } } // Search matches for lang. if t.LangID < langNoIndexOffset { x := likelyLang[t.LangID] if x.flags&isList != 0 { x = likelyLangList[x.region] } if x.region != 0 { t.setUndefinedScript(Script(x.script)) t.setUndefinedRegion(Region(x.region)) } specializeRegion(&t) if t.LangID == 0 { t.LangID = _en // default language } return t, nil } return t, ErrMissingLikelyTagsData } func (t *Tag) setTagsFrom(id Tag) { t.LangID = id.LangID t.ScriptID = id.ScriptID t.RegionID = id.RegionID } // minimize removes the region or script subtags from t such that // t.addLikelySubtags() == t.minimize().addLikelySubtags(). func (t Tag) minimize() (Tag, error) { t, err := minimizeTags(t) if err != nil { return t, err } t.RemakeString() return t, nil } // minimizeTags mimics the behavior of the ICU 51 C implementation. func minimizeTags(t Tag) (Tag, error) { if t.equalTags(Und) { return t, nil } max, err := addTags(t) if err != nil { return t, err } for _, id := range [...]Tag{ {LangID: t.LangID}, {LangID: t.LangID, RegionID: t.RegionID}, {LangID: t.LangID, ScriptID: t.ScriptID}, } { if x, err := addTags(id); err == nil && max.equalTags(x) { t.setTagsFrom(id) break } } return t, nil } ================================================ FILE: vendor/golang.org/x/text/internal/language/parse.go ================================================ // Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package language import ( "bytes" "errors" "fmt" "sort" "golang.org/x/text/internal/tag" ) // isAlpha returns true if the byte is not a digit. // b must be an ASCII letter or digit. func isAlpha(b byte) bool { return b > '9' } // isAlphaNum returns true if the string contains only ASCII letters or digits. func isAlphaNum(s []byte) bool { for _, c := range s { if !('a' <= c && c <= 'z' || 'A' <= c && c <= 'Z' || '0' <= c && c <= '9') { return false } } return true } // ErrSyntax is returned by any of the parsing functions when the // input is not well-formed, according to BCP 47. // TODO: return the position at which the syntax error occurred? var ErrSyntax = errors.New("language: tag is not well-formed") // ErrDuplicateKey is returned when a tag contains the same key twice with // different values in the -u section. var ErrDuplicateKey = errors.New("language: different values for same key in -u extension") // ValueError is returned by any of the parsing functions when the // input is well-formed but the respective subtag is not recognized // as a valid value. type ValueError struct { v [8]byte } // NewValueError creates a new ValueError. func NewValueError(tag []byte) ValueError { var e ValueError copy(e.v[:], tag) return e } func (e ValueError) tag() []byte { n := bytes.IndexByte(e.v[:], 0) if n == -1 { n = 8 } return e.v[:n] } // Error implements the error interface. func (e ValueError) Error() string { return fmt.Sprintf("language: subtag %q is well-formed but unknown", e.tag()) } // Subtag returns the subtag for which the error occurred. func (e ValueError) Subtag() string { return string(e.tag()) } // scanner is used to scan BCP 47 tokens, which are separated by _ or -. type scanner struct { b []byte bytes [max99thPercentileSize]byte token []byte start int // start position of the current token end int // end position of the current token next int // next point for scan err error done bool } func makeScannerString(s string) scanner { scan := scanner{} if len(s) <= len(scan.bytes) { scan.b = scan.bytes[:copy(scan.bytes[:], s)] } else { scan.b = []byte(s) } scan.init() return scan } // makeScanner returns a scanner using b as the input buffer. // b is not copied and may be modified by the scanner routines. func makeScanner(b []byte) scanner { scan := scanner{b: b} scan.init() return scan } func (s *scanner) init() { for i, c := range s.b { if c == '_' { s.b[i] = '-' } } s.scan() } // restToLower converts the string between start and end to lower case. func (s *scanner) toLower(start, end int) { for i := start; i < end; i++ { c := s.b[i] if 'A' <= c && c <= 'Z' { s.b[i] += 'a' - 'A' } } } func (s *scanner) setError(e error) { if s.err == nil || (e == ErrSyntax && s.err != ErrSyntax) { s.err = e } } // resizeRange shrinks or grows the array at position oldStart such that // a new string of size newSize can fit between oldStart and oldEnd. // Sets the scan point to after the resized range. func (s *scanner) resizeRange(oldStart, oldEnd, newSize int) { s.start = oldStart if end := oldStart + newSize; end != oldEnd { diff := end - oldEnd var b []byte if n := len(s.b) + diff; n > cap(s.b) { b = make([]byte, n) copy(b, s.b[:oldStart]) } else { b = s.b[:n] } copy(b[end:], s.b[oldEnd:]) s.b = b s.next = end + (s.next - s.end) s.end = end } } // replace replaces the current token with repl. func (s *scanner) replace(repl string) { s.resizeRange(s.start, s.end, len(repl)) copy(s.b[s.start:], repl) } // gobble removes the current token from the input. // Caller must call scan after calling gobble. func (s *scanner) gobble(e error) { s.setError(e) if s.start == 0 { s.b = s.b[:+copy(s.b, s.b[s.next:])] s.end = 0 } else { s.b = s.b[:s.start-1+copy(s.b[s.start-1:], s.b[s.end:])] s.end = s.start - 1 } s.next = s.start } // deleteRange removes the given range from s.b before the current token. func (s *scanner) deleteRange(start, end int) { s.b = s.b[:start+copy(s.b[start:], s.b[end:])] diff := end - start s.next -= diff s.start -= diff s.end -= diff } // scan parses the next token of a BCP 47 string. Tokens that are larger // than 8 characters or include non-alphanumeric characters result in an error // and are gobbled and removed from the output. // It returns the end position of the last token consumed. func (s *scanner) scan() (end int) { end = s.end s.token = nil for s.start = s.next; s.next < len(s.b); { i := bytes.IndexByte(s.b[s.next:], '-') if i == -1 { s.end = len(s.b) s.next = len(s.b) i = s.end - s.start } else { s.end = s.next + i s.next = s.end + 1 } token := s.b[s.start:s.end] if i < 1 || i > 8 || !isAlphaNum(token) { s.gobble(ErrSyntax) continue } s.token = token return end } if n := len(s.b); n > 0 && s.b[n-1] == '-' { s.setError(ErrSyntax) s.b = s.b[:len(s.b)-1] } s.done = true return end } // acceptMinSize parses multiple tokens of the given size or greater. // It returns the end position of the last token consumed. func (s *scanner) acceptMinSize(min int) (end int) { end = s.end s.scan() for ; len(s.token) >= min; s.scan() { end = s.end } return end } // Parse parses the given BCP 47 string and returns a valid Tag. If parsing // failed it returns an error and any part of the tag that could be parsed. // If parsing succeeded but an unknown value was found, it returns // ValueError. The Tag returned in this case is just stripped of the unknown // value. All other values are preserved. It accepts tags in the BCP 47 format // and extensions to this standard defined in // https://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers. func Parse(s string) (t Tag, err error) { // TODO: consider supporting old-style locale key-value pairs. if s == "" { return Und, ErrSyntax } defer func() { if recover() != nil { t = Und err = ErrSyntax return } }() if len(s) <= maxAltTaglen { b := [maxAltTaglen]byte{} for i, c := range s { // Generating invalid UTF-8 is okay as it won't match. if 'A' <= c && c <= 'Z' { c += 'a' - 'A' } else if c == '_' { c = '-' } b[i] = byte(c) } if t, ok := grandfathered(b); ok { return t, nil } } scan := makeScannerString(s) return parse(&scan, s) } func parse(scan *scanner, s string) (t Tag, err error) { t = Und var end int if n := len(scan.token); n <= 1 { scan.toLower(0, len(scan.b)) if n == 0 || scan.token[0] != 'x' { return t, ErrSyntax } end = parseExtensions(scan) } else if n >= 4 { return Und, ErrSyntax } else { // the usual case t, end = parseTag(scan, true) if n := len(scan.token); n == 1 { t.pExt = uint16(end) end = parseExtensions(scan) } else if end < len(scan.b) { scan.setError(ErrSyntax) scan.b = scan.b[:end] } } if int(t.pVariant) < len(scan.b) { if end < len(s) { s = s[:end] } if len(s) > 0 && tag.Compare(s, scan.b) == 0 { t.str = s } else { t.str = string(scan.b) } } else { t.pVariant, t.pExt = 0, 0 } return t, scan.err } // parseTag parses language, script, region and variants. // It returns a Tag and the end position in the input that was parsed. // If doNorm is true, then - will be normalized to . func parseTag(scan *scanner, doNorm bool) (t Tag, end int) { var e error // TODO: set an error if an unknown lang, script or region is encountered. t.LangID, e = getLangID(scan.token) scan.setError(e) scan.replace(t.LangID.String()) langStart := scan.start end = scan.scan() for len(scan.token) == 3 && isAlpha(scan.token[0]) { // From http://tools.ietf.org/html/bcp47, - tags are equivalent // to a tag of the form . if doNorm { lang, e := getLangID(scan.token) if lang != 0 { t.LangID = lang langStr := lang.String() copy(scan.b[langStart:], langStr) scan.b[langStart+len(langStr)] = '-' scan.start = langStart + len(langStr) + 1 } scan.gobble(e) } end = scan.scan() } if len(scan.token) == 4 && isAlpha(scan.token[0]) { t.ScriptID, e = getScriptID(script, scan.token) if t.ScriptID == 0 { scan.gobble(e) } end = scan.scan() } if n := len(scan.token); n >= 2 && n <= 3 { t.RegionID, e = getRegionID(scan.token) if t.RegionID == 0 { scan.gobble(e) } else { scan.replace(t.RegionID.String()) } end = scan.scan() } scan.toLower(scan.start, len(scan.b)) t.pVariant = byte(end) end = parseVariants(scan, end, t) t.pExt = uint16(end) return t, end } var separator = []byte{'-'} // parseVariants scans tokens as long as each token is a valid variant string. // Duplicate variants are removed. func parseVariants(scan *scanner, end int, t Tag) int { start := scan.start varIDBuf := [4]uint8{} variantBuf := [4][]byte{} varID := varIDBuf[:0] variant := variantBuf[:0] last := -1 needSort := false for ; len(scan.token) >= 4; scan.scan() { // TODO: measure the impact of needing this conversion and redesign // the data structure if there is an issue. v, ok := variantIndex[string(scan.token)] if !ok { // unknown variant // TODO: allow user-defined variants? scan.gobble(NewValueError(scan.token)) continue } varID = append(varID, v) variant = append(variant, scan.token) if !needSort { if last < int(v) { last = int(v) } else { needSort = true // There is no legal combinations of more than 7 variants // (and this is by no means a useful sequence). const maxVariants = 8 if len(varID) > maxVariants { break } } } end = scan.end } if needSort { sort.Sort(variantsSort{varID, variant}) k, l := 0, -1 for i, v := range varID { w := int(v) if l == w { // Remove duplicates. continue } varID[k] = varID[i] variant[k] = variant[i] k++ l = w } if str := bytes.Join(variant[:k], separator); len(str) == 0 { end = start - 1 } else { scan.resizeRange(start, end, len(str)) copy(scan.b[scan.start:], str) end = scan.end } } return end } type variantsSort struct { i []uint8 v [][]byte } func (s variantsSort) Len() int { return len(s.i) } func (s variantsSort) Swap(i, j int) { s.i[i], s.i[j] = s.i[j], s.i[i] s.v[i], s.v[j] = s.v[j], s.v[i] } func (s variantsSort) Less(i, j int) bool { return s.i[i] < s.i[j] } type bytesSort struct { b [][]byte n int // first n bytes to compare } func (b bytesSort) Len() int { return len(b.b) } func (b bytesSort) Swap(i, j int) { b.b[i], b.b[j] = b.b[j], b.b[i] } func (b bytesSort) Less(i, j int) bool { for k := 0; k < b.n; k++ { if b.b[i][k] == b.b[j][k] { continue } return b.b[i][k] < b.b[j][k] } return false } // parseExtensions parses and normalizes the extensions in the buffer. // It returns the last position of scan.b that is part of any extension. // It also trims scan.b to remove excess parts accordingly. func parseExtensions(scan *scanner) int { start := scan.start exts := [][]byte{} private := []byte{} end := scan.end for len(scan.token) == 1 { extStart := scan.start ext := scan.token[0] end = parseExtension(scan) extension := scan.b[extStart:end] if len(extension) < 3 || (ext != 'x' && len(extension) < 4) { scan.setError(ErrSyntax) end = extStart continue } else if start == extStart && (ext == 'x' || scan.start == len(scan.b)) { scan.b = scan.b[:end] return end } else if ext == 'x' { private = extension break } exts = append(exts, extension) } sort.Sort(bytesSort{exts, 1}) if len(private) > 0 { exts = append(exts, private) } scan.b = scan.b[:start] if len(exts) > 0 { scan.b = append(scan.b, bytes.Join(exts, separator)...) } else if start > 0 { // Strip trailing '-'. scan.b = scan.b[:start-1] } return end } // parseExtension parses a single extension and returns the position of // the extension end. func parseExtension(scan *scanner) int { start, end := scan.start, scan.end switch scan.token[0] { case 'u': // https://www.ietf.org/rfc/rfc6067.txt attrStart := end scan.scan() for last := []byte{}; len(scan.token) > 2; scan.scan() { if bytes.Compare(scan.token, last) != -1 { // Attributes are unsorted. Start over from scratch. p := attrStart + 1 scan.next = p attrs := [][]byte{} for scan.scan(); len(scan.token) > 2; scan.scan() { attrs = append(attrs, scan.token) end = scan.end } sort.Sort(bytesSort{attrs, 3}) copy(scan.b[p:], bytes.Join(attrs, separator)) break } last = scan.token end = scan.end } // Scan key-type sequences. A key is of length 2 and may be followed // by 0 or more "type" subtags from 3 to the maximum of 8 letters. var last, key []byte for attrEnd := end; len(scan.token) == 2; last = key { key = scan.token end = scan.end for scan.scan(); end < scan.end && len(scan.token) > 2; scan.scan() { end = scan.end } // TODO: check key value validity if bytes.Compare(key, last) != 1 || scan.err != nil { // We have an invalid key or the keys are not sorted. // Start scanning keys from scratch and reorder. p := attrEnd + 1 scan.next = p keys := [][]byte{} for scan.scan(); len(scan.token) == 2; { keyStart := scan.start end = scan.end for scan.scan(); end < scan.end && len(scan.token) > 2; scan.scan() { end = scan.end } keys = append(keys, scan.b[keyStart:end]) } sort.Stable(bytesSort{keys, 2}) if n := len(keys); n > 0 { k := 0 for i := 1; i < n; i++ { if !bytes.Equal(keys[k][:2], keys[i][:2]) { k++ keys[k] = keys[i] } else if !bytes.Equal(keys[k], keys[i]) { scan.setError(ErrDuplicateKey) } } keys = keys[:k+1] } reordered := bytes.Join(keys, separator) if e := p + len(reordered); e < end { scan.deleteRange(e, end) end = e } copy(scan.b[p:], reordered) break } } case 't': // https://www.ietf.org/rfc/rfc6497.txt scan.scan() if n := len(scan.token); n >= 2 && n <= 3 && isAlpha(scan.token[1]) { _, end = parseTag(scan, false) scan.toLower(start, end) } for len(scan.token) == 2 && !isAlpha(scan.token[1]) { end = scan.acceptMinSize(3) } case 'x': end = scan.acceptMinSize(1) default: end = scan.acceptMinSize(2) } return end } // getExtension returns the name, body and end position of the extension. func getExtension(s string, p int) (end int, ext string) { if s[p] == '-' { p++ } if s[p] == 'x' { return len(s), s[p:] } end = nextExtension(s, p) return end, s[p:end] } // nextExtension finds the next extension within the string, searching // for the -- pattern from position p. // In the fast majority of cases, language tags will have at most // one extension and extensions tend to be small. func nextExtension(s string, p int) int { for n := len(s) - 3; p < n; { if s[p] == '-' { if s[p+2] == '-' { return p } p += 3 } else { p++ } } return len(s) } ================================================ FILE: vendor/golang.org/x/text/internal/language/tables.go ================================================ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. package language import "golang.org/x/text/internal/tag" // CLDRVersion is the CLDR version from which the tables in this package are derived. const CLDRVersion = "32" const NumLanguages = 8798 const NumScripts = 261 const NumRegions = 358 type FromTo struct { From uint16 To uint16 } const nonCanonicalUnd = 1201 const ( _af = 22 _am = 39 _ar = 58 _az = 88 _bg = 126 _bn = 165 _ca = 215 _cs = 250 _da = 257 _de = 269 _el = 310 _en = 313 _es = 318 _et = 320 _fa = 328 _fi = 337 _fil = 339 _fr = 350 _gu = 420 _he = 444 _hi = 446 _hr = 465 _hu = 469 _hy = 471 _id = 481 _is = 504 _it = 505 _ja = 512 _ka = 528 _kk = 578 _km = 586 _kn = 593 _ko = 596 _ky = 650 _lo = 696 _lt = 704 _lv = 711 _mk = 767 _ml = 772 _mn = 779 _mo = 784 _mr = 795 _ms = 799 _mul = 806 _my = 817 _nb = 839 _ne = 849 _nl = 871 _no = 879 _pa = 925 _pl = 947 _pt = 960 _ro = 988 _ru = 994 _sh = 1031 _si = 1036 _sk = 1042 _sl = 1046 _sq = 1073 _sr = 1074 _sv = 1092 _sw = 1093 _ta = 1104 _te = 1121 _th = 1131 _tl = 1146 _tn = 1152 _tr = 1162 _uk = 1198 _ur = 1204 _uz = 1212 _vi = 1219 _zh = 1321 _zu = 1327 _jbo = 515 _ami = 1650 _bnn = 2357 _hak = 438 _tlh = 14467 _lb = 661 _nv = 899 _pwn = 12055 _tao = 14188 _tay = 14198 _tsu = 14662 _nn = 874 _sfb = 13629 _vgt = 15701 _sgg = 13660 _cmn = 3007 _nan = 835 _hsn = 467 ) const langPrivateStart = 0x2f72 const langPrivateEnd = 0x3179 // lang holds an alphabetically sorted list of ISO-639 language identifiers. // All entries are 4 bytes. The index of the identifier (divided by 4) is the language tag. // For 2-byte language identifiers, the two successive bytes have the following meaning: // - if the first letter of the 2- and 3-letter ISO codes are the same: // the second and third letter of the 3-letter ISO code. // - otherwise: a 0 and a by 2 bits right-shifted index into altLangISO3. // // For 3-byte language identifiers the 4th byte is 0. const lang tag.Index = "" + // Size: 5324 bytes "---\x00aaaraai\x00aak\x00aau\x00abbkabi\x00abq\x00abr\x00abt\x00aby\x00a" + "cd\x00ace\x00ach\x00ada\x00ade\x00adj\x00ady\x00adz\x00aeveaeb\x00aey" + "\x00affragc\x00agd\x00agg\x00agm\x00ago\x00agq\x00aha\x00ahl\x00aho\x00a" + "jg\x00akkaakk\x00ala\x00ali\x00aln\x00alt\x00ammhamm\x00amn\x00amo\x00am" + "p\x00anrganc\x00ank\x00ann\x00any\x00aoj\x00aom\x00aoz\x00apc\x00apd\x00" + "ape\x00apr\x00aps\x00apz\x00arraarc\x00arh\x00arn\x00aro\x00arq\x00ars" + "\x00ary\x00arz\x00assmasa\x00ase\x00asg\x00aso\x00ast\x00ata\x00atg\x00a" + "tj\x00auy\x00avvaavl\x00avn\x00avt\x00avu\x00awa\x00awb\x00awo\x00awx" + "\x00ayymayb\x00azzebaakbal\x00ban\x00bap\x00bar\x00bas\x00bav\x00bax\x00" + "bba\x00bbb\x00bbc\x00bbd\x00bbj\x00bbp\x00bbr\x00bcf\x00bch\x00bci\x00bc" + "m\x00bcn\x00bco\x00bcq\x00bcu\x00bdd\x00beelbef\x00beh\x00bej\x00bem\x00" + "bet\x00bew\x00bex\x00bez\x00bfd\x00bfq\x00bft\x00bfy\x00bgulbgc\x00bgn" + "\x00bgx\x00bhihbhb\x00bhg\x00bhi\x00bhk\x00bhl\x00bho\x00bhy\x00biisbib" + "\x00big\x00bik\x00bim\x00bin\x00bio\x00biq\x00bjh\x00bji\x00bjj\x00bjn" + "\x00bjo\x00bjr\x00bjt\x00bjz\x00bkc\x00bkm\x00bkq\x00bku\x00bkv\x00blt" + "\x00bmambmh\x00bmk\x00bmq\x00bmu\x00bnenbng\x00bnm\x00bnp\x00boodboj\x00" + "bom\x00bon\x00bpy\x00bqc\x00bqi\x00bqp\x00bqv\x00brrebra\x00brh\x00brx" + "\x00brz\x00bsosbsj\x00bsq\x00bss\x00bst\x00bto\x00btt\x00btv\x00bua\x00b" + "uc\x00bud\x00bug\x00buk\x00bum\x00buo\x00bus\x00buu\x00bvb\x00bwd\x00bwr" + "\x00bxh\x00bye\x00byn\x00byr\x00bys\x00byv\x00byx\x00bza\x00bze\x00bzf" + "\x00bzh\x00bzw\x00caatcan\x00cbj\x00cch\x00ccp\x00ceheceb\x00cfa\x00cgg" + "\x00chhachk\x00chm\x00cho\x00chp\x00chr\x00cja\x00cjm\x00cjv\x00ckb\x00c" + "kl\x00cko\x00cky\x00cla\x00cme\x00cmg\x00cooscop\x00cps\x00crrecrh\x00cr" + "j\x00crk\x00crl\x00crm\x00crs\x00csescsb\x00csw\x00ctd\x00cuhucvhvcyymda" + "andad\x00daf\x00dag\x00dah\x00dak\x00dar\x00dav\x00dbd\x00dbq\x00dcc\x00" + "ddn\x00deeuded\x00den\x00dga\x00dgh\x00dgi\x00dgl\x00dgr\x00dgz\x00dia" + "\x00dje\x00dnj\x00dob\x00doi\x00dop\x00dow\x00dri\x00drs\x00dsb\x00dtm" + "\x00dtp\x00dts\x00dty\x00dua\x00duc\x00dud\x00dug\x00dvivdva\x00dww\x00d" + "yo\x00dyu\x00dzzodzg\x00ebu\x00eeweefi\x00egl\x00egy\x00eka\x00eky\x00el" + "llema\x00emi\x00enngenn\x00enq\x00eopoeri\x00es\x00\x05esu\x00etstetr" + "\x00ett\x00etu\x00etx\x00euusewo\x00ext\x00faasfaa\x00fab\x00fag\x00fai" + "\x00fan\x00ffulffi\x00ffm\x00fiinfia\x00fil\x00fit\x00fjijflr\x00fmp\x00" + "foaofod\x00fon\x00for\x00fpe\x00fqs\x00frrafrc\x00frp\x00frr\x00frs\x00f" + "ub\x00fud\x00fue\x00fuf\x00fuh\x00fuq\x00fur\x00fuv\x00fuy\x00fvr\x00fyr" + "ygalegaa\x00gaf\x00gag\x00gah\x00gaj\x00gam\x00gan\x00gaw\x00gay\x00gba" + "\x00gbf\x00gbm\x00gby\x00gbz\x00gcr\x00gdlagde\x00gdn\x00gdr\x00geb\x00g" + "ej\x00gel\x00gez\x00gfk\x00ggn\x00ghs\x00gil\x00gim\x00gjk\x00gjn\x00gju" + "\x00gkn\x00gkp\x00gllgglk\x00gmm\x00gmv\x00gnrngnd\x00gng\x00god\x00gof" + "\x00goi\x00gom\x00gon\x00gor\x00gos\x00got\x00grb\x00grc\x00grt\x00grw" + "\x00gsw\x00guujgub\x00guc\x00gud\x00gur\x00guw\x00gux\x00guz\x00gvlvgvf" + "\x00gvr\x00gvs\x00gwc\x00gwi\x00gwt\x00gyi\x00haauhag\x00hak\x00ham\x00h" + "aw\x00haz\x00hbb\x00hdy\x00heebhhy\x00hiinhia\x00hif\x00hig\x00hih\x00hi" + "l\x00hla\x00hlu\x00hmd\x00hmt\x00hnd\x00hne\x00hnj\x00hnn\x00hno\x00homo" + "hoc\x00hoj\x00hot\x00hrrvhsb\x00hsn\x00htathuunhui\x00hyyehzerianaian" + "\x00iar\x00iba\x00ibb\x00iby\x00ica\x00ich\x00idndidd\x00idi\x00idu\x00i" + "eleife\x00igboigb\x00ige\x00iiiiijj\x00ikpkikk\x00ikt\x00ikw\x00ikx\x00i" + "lo\x00imo\x00inndinh\x00iodoiou\x00iri\x00isslittaiukuiw\x00\x03iwm\x00i" + "ws\x00izh\x00izi\x00japnjab\x00jam\x00jbo\x00jbu\x00jen\x00jgk\x00jgo" + "\x00ji\x00\x06jib\x00jmc\x00jml\x00jra\x00jut\x00jvavjwavkaatkaa\x00kab" + "\x00kac\x00kad\x00kai\x00kaj\x00kam\x00kao\x00kbd\x00kbm\x00kbp\x00kbq" + "\x00kbx\x00kby\x00kcg\x00kck\x00kcl\x00kct\x00kde\x00kdh\x00kdl\x00kdt" + "\x00kea\x00ken\x00kez\x00kfo\x00kfr\x00kfy\x00kgonkge\x00kgf\x00kgp\x00k" + "ha\x00khb\x00khn\x00khq\x00khs\x00kht\x00khw\x00khz\x00kiikkij\x00kiu" + "\x00kiw\x00kjuakjd\x00kjg\x00kjs\x00kjy\x00kkazkkc\x00kkj\x00klalkln\x00" + "klq\x00klt\x00klx\x00kmhmkmb\x00kmh\x00kmo\x00kms\x00kmu\x00kmw\x00knank" + "nf\x00knp\x00koorkoi\x00kok\x00kol\x00kos\x00koz\x00kpe\x00kpf\x00kpo" + "\x00kpr\x00kpx\x00kqb\x00kqf\x00kqs\x00kqy\x00kraukrc\x00kri\x00krj\x00k" + "rl\x00krs\x00kru\x00ksasksb\x00ksd\x00ksf\x00ksh\x00ksj\x00ksr\x00ktb" + "\x00ktm\x00kto\x00kuurkub\x00kud\x00kue\x00kuj\x00kum\x00kun\x00kup\x00k" + "us\x00kvomkvg\x00kvr\x00kvx\x00kw\x00\x01kwj\x00kwo\x00kxa\x00kxc\x00kxm" + "\x00kxp\x00kxw\x00kxz\x00kyirkye\x00kyx\x00kzr\x00laatlab\x00lad\x00lag" + "\x00lah\x00laj\x00las\x00lbtzlbe\x00lbu\x00lbw\x00lcm\x00lcp\x00ldb\x00l" + "ed\x00lee\x00lem\x00lep\x00leq\x00leu\x00lez\x00lguglgg\x00liimlia\x00li" + "d\x00lif\x00lig\x00lih\x00lij\x00lis\x00ljp\x00lki\x00lkt\x00lle\x00lln" + "\x00lmn\x00lmo\x00lmp\x00lninlns\x00lnu\x00loaoloj\x00lok\x00lol\x00lor" + "\x00los\x00loz\x00lrc\x00ltitltg\x00luublua\x00luo\x00luy\x00luz\x00lvav" + "lwl\x00lzh\x00lzz\x00mad\x00maf\x00mag\x00mai\x00mak\x00man\x00mas\x00ma" + "w\x00maz\x00mbh\x00mbo\x00mbq\x00mbu\x00mbw\x00mci\x00mcp\x00mcq\x00mcr" + "\x00mcu\x00mda\x00mde\x00mdf\x00mdh\x00mdj\x00mdr\x00mdx\x00med\x00mee" + "\x00mek\x00men\x00mer\x00met\x00meu\x00mfa\x00mfe\x00mfn\x00mfo\x00mfq" + "\x00mglgmgh\x00mgl\x00mgo\x00mgp\x00mgy\x00mhahmhi\x00mhl\x00mirimif\x00" + "min\x00mis\x00miw\x00mkkdmki\x00mkl\x00mkp\x00mkw\x00mlalmle\x00mlp\x00m" + "ls\x00mmo\x00mmu\x00mmx\x00mnonmna\x00mnf\x00mni\x00mnw\x00moolmoa\x00mo" + "e\x00moh\x00mos\x00mox\x00mpp\x00mps\x00mpt\x00mpx\x00mql\x00mrarmrd\x00" + "mrj\x00mro\x00mssamtltmtc\x00mtf\x00mti\x00mtr\x00mua\x00mul\x00mur\x00m" + "us\x00mva\x00mvn\x00mvy\x00mwk\x00mwr\x00mwv\x00mxc\x00mxm\x00myyamyk" + "\x00mym\x00myv\x00myw\x00myx\x00myz\x00mzk\x00mzm\x00mzn\x00mzp\x00mzw" + "\x00mzz\x00naaunac\x00naf\x00nah\x00nak\x00nan\x00nap\x00naq\x00nas\x00n" + "bobnca\x00nce\x00ncf\x00nch\x00nco\x00ncu\x00nddendc\x00nds\x00neepneb" + "\x00new\x00nex\x00nfr\x00ngdonga\x00ngb\x00ngl\x00nhb\x00nhe\x00nhw\x00n" + "if\x00nii\x00nij\x00nin\x00niu\x00niy\x00niz\x00njo\x00nkg\x00nko\x00nll" + "dnmg\x00nmz\x00nnnonnf\x00nnh\x00nnk\x00nnm\x00noornod\x00noe\x00non\x00" + "nop\x00nou\x00nqo\x00nrblnrb\x00nsk\x00nsn\x00nso\x00nss\x00ntm\x00ntr" + "\x00nui\x00nup\x00nus\x00nuv\x00nux\x00nvavnwb\x00nxq\x00nxr\x00nyyanym" + "\x00nyn\x00nzi\x00occiogc\x00ojjiokr\x00okv\x00omrmong\x00onn\x00ons\x00" + "opm\x00orrioro\x00oru\x00osssosa\x00ota\x00otk\x00ozm\x00paanpag\x00pal" + "\x00pam\x00pap\x00pau\x00pbi\x00pcd\x00pcm\x00pdc\x00pdt\x00ped\x00peo" + "\x00pex\x00pfl\x00phl\x00phn\x00pilipil\x00pip\x00pka\x00pko\x00plolpla" + "\x00pms\x00png\x00pnn\x00pnt\x00pon\x00ppo\x00pra\x00prd\x00prg\x00psusp" + "ss\x00ptorptp\x00puu\x00pwa\x00quuequc\x00qug\x00rai\x00raj\x00rao\x00rc" + "f\x00rej\x00rel\x00res\x00rgn\x00rhg\x00ria\x00rif\x00rjs\x00rkt\x00rmoh" + "rmf\x00rmo\x00rmt\x00rmu\x00rnunrna\x00rng\x00roonrob\x00rof\x00roo\x00r" + "ro\x00rtm\x00ruusrue\x00rug\x00rw\x00\x04rwk\x00rwo\x00ryu\x00saansaf" + "\x00sah\x00saq\x00sas\x00sat\x00sav\x00saz\x00sba\x00sbe\x00sbp\x00scrds" + "ck\x00scl\x00scn\x00sco\x00scs\x00sdndsdc\x00sdh\x00semesef\x00seh\x00se" + "i\x00ses\x00sgagsga\x00sgs\x00sgw\x00sgz\x00sh\x00\x02shi\x00shk\x00shn" + "\x00shu\x00siinsid\x00sig\x00sil\x00sim\x00sjr\x00sklkskc\x00skr\x00sks" + "\x00sllvsld\x00sli\x00sll\x00sly\x00smmosma\x00smi\x00smj\x00smn\x00smp" + "\x00smq\x00sms\x00snnasnc\x00snk\x00snp\x00snx\x00sny\x00soomsok\x00soq" + "\x00sou\x00soy\x00spd\x00spl\x00sps\x00sqqisrrpsrb\x00srn\x00srr\x00srx" + "\x00ssswssd\x00ssg\x00ssy\x00stotstk\x00stq\x00suunsua\x00sue\x00suk\x00" + "sur\x00sus\x00svweswwaswb\x00swc\x00swg\x00swp\x00swv\x00sxn\x00sxw\x00s" + "yl\x00syr\x00szl\x00taamtaj\x00tal\x00tan\x00taq\x00tbc\x00tbd\x00tbf" + "\x00tbg\x00tbo\x00tbw\x00tbz\x00tci\x00tcy\x00tdd\x00tdg\x00tdh\x00teelt" + "ed\x00tem\x00teo\x00tet\x00tfi\x00tggktgc\x00tgo\x00tgu\x00thhathl\x00th" + "q\x00thr\x00tiirtif\x00tig\x00tik\x00tim\x00tio\x00tiv\x00tkuktkl\x00tkr" + "\x00tkt\x00tlgltlf\x00tlx\x00tly\x00tmh\x00tmy\x00tnsntnh\x00toontof\x00" + "tog\x00toq\x00tpi\x00tpm\x00tpz\x00tqo\x00trurtru\x00trv\x00trw\x00tssot" + "sd\x00tsf\x00tsg\x00tsj\x00tsw\x00ttatttd\x00tte\x00ttj\x00ttr\x00tts" + "\x00ttt\x00tuh\x00tul\x00tum\x00tuq\x00tvd\x00tvl\x00tvu\x00twwitwh\x00t" + "wq\x00txg\x00tyahtya\x00tyv\x00tzm\x00ubu\x00udm\x00ugiguga\x00ukkruli" + "\x00umb\x00und\x00unr\x00unx\x00urrduri\x00urt\x00urw\x00usa\x00utr\x00u" + "vh\x00uvl\x00uzzbvag\x00vai\x00van\x00veenvec\x00vep\x00viievic\x00viv" + "\x00vls\x00vmf\x00vmw\x00voolvot\x00vro\x00vun\x00vut\x00walnwae\x00waj" + "\x00wal\x00wan\x00war\x00wbp\x00wbq\x00wbr\x00wci\x00wer\x00wgi\x00whg" + "\x00wib\x00wiu\x00wiv\x00wja\x00wji\x00wls\x00wmo\x00wnc\x00wni\x00wnu" + "\x00woolwob\x00wos\x00wrs\x00wsk\x00wtm\x00wuu\x00wuv\x00wwa\x00xav\x00x" + "bi\x00xcr\x00xes\x00xhhoxla\x00xlc\x00xld\x00xmf\x00xmn\x00xmr\x00xna" + "\x00xnr\x00xog\x00xon\x00xpr\x00xrb\x00xsa\x00xsi\x00xsm\x00xsr\x00xwe" + "\x00yam\x00yao\x00yap\x00yas\x00yat\x00yav\x00yay\x00yaz\x00yba\x00ybb" + "\x00yby\x00yer\x00ygr\x00ygw\x00yiidyko\x00yle\x00ylg\x00yll\x00yml\x00y" + "ooryon\x00yrb\x00yre\x00yrl\x00yss\x00yua\x00yue\x00yuj\x00yut\x00yuw" + "\x00zahazag\x00zbl\x00zdj\x00zea\x00zgh\x00zhhozhx\x00zia\x00zlm\x00zmi" + "\x00zne\x00zuulzxx\x00zza\x00\xff\xff\xff\xff" const langNoIndexOffset = 1330 // langNoIndex is a bit vector of all 3-letter language codes that are not used as an index // in lookup tables. The language ids for these language codes are derived directly // from the letters and are not consecutive. // Size: 2197 bytes, 2197 elements var langNoIndex = [2197]uint8{ // Entry 0 - 3F 0xff, 0xf8, 0xed, 0xfe, 0xeb, 0xd3, 0x3b, 0xd2, 0xfb, 0xbf, 0x7a, 0xfa, 0x37, 0x1d, 0x3c, 0x57, 0x6e, 0x97, 0x73, 0x38, 0xfb, 0xea, 0xbf, 0x70, 0xad, 0x03, 0xff, 0xff, 0xcf, 0x05, 0x84, 0x72, 0xe9, 0xbf, 0xfd, 0xbf, 0xbf, 0xf7, 0xfd, 0x77, 0x0f, 0xff, 0xef, 0x6f, 0xff, 0xfb, 0xdf, 0xe2, 0xc9, 0xf8, 0x7f, 0x7e, 0x4d, 0xbc, 0x0a, 0x6a, 0x7c, 0xea, 0xe3, 0xfa, 0x7a, 0xbf, 0x67, 0xff, // Entry 40 - 7F 0xff, 0xff, 0xff, 0xdf, 0x2a, 0x54, 0x91, 0xc0, 0x5d, 0xe3, 0x97, 0x14, 0x07, 0x20, 0xdd, 0xed, 0x9f, 0x3f, 0xc9, 0x21, 0xf8, 0x3f, 0x94, 0x35, 0x7c, 0x5f, 0xff, 0x5f, 0x8e, 0x6e, 0xdf, 0xff, 0xff, 0xff, 0x55, 0x7c, 0xd3, 0xfd, 0xbf, 0xb5, 0x7b, 0xdf, 0x7f, 0xf7, 0xca, 0xfe, 0xdb, 0xa3, 0xa8, 0xff, 0x1f, 0x67, 0x7d, 0xeb, 0xef, 0xce, 0xff, 0xff, 0x9f, 0xff, 0xb7, 0xef, 0xfe, 0xcf, // Entry 80 - BF 0xdb, 0xff, 0xf3, 0xcd, 0xfb, 0x7f, 0xff, 0xff, 0xbb, 0xee, 0xf7, 0xbd, 0xdb, 0xff, 0x5f, 0xf7, 0xfd, 0xf2, 0xfd, 0xff, 0x5e, 0x2f, 0x3b, 0xba, 0x7e, 0xff, 0xff, 0xfe, 0xf7, 0xff, 0xdd, 0xff, 0xfd, 0xdf, 0xfb, 0xfe, 0x9d, 0xb4, 0xd3, 0xff, 0xef, 0xff, 0xdf, 0xf7, 0x7f, 0xb7, 0xfd, 0xd5, 0xa5, 0x77, 0x40, 0xff, 0x9c, 0xc1, 0x41, 0x2c, 0x08, 0x21, 0x41, 0x00, 0x50, 0x40, 0x00, 0x80, // Entry C0 - FF 0xfb, 0x4a, 0xf2, 0x9f, 0xb4, 0x42, 0x41, 0x96, 0x1b, 0x14, 0x08, 0xf3, 0x2b, 0xe7, 0x17, 0x56, 0x05, 0x7d, 0x0e, 0x1c, 0x37, 0x7f, 0xf3, 0xef, 0x97, 0xff, 0x5d, 0x38, 0x64, 0x08, 0x00, 0x10, 0xbc, 0x85, 0xaf, 0xdf, 0xff, 0xff, 0x7b, 0x35, 0x3e, 0xc7, 0xc7, 0xdf, 0xff, 0x01, 0x81, 0x00, 0xb0, 0x05, 0x80, 0x00, 0x20, 0x00, 0x00, 0x03, 0x40, 0x00, 0x40, 0x92, 0x21, 0x50, 0xb1, 0x5d, // Entry 100 - 13F 0xfd, 0xdc, 0xbe, 0x5e, 0x00, 0x00, 0x02, 0x64, 0x0d, 0x19, 0x41, 0xdf, 0x79, 0x22, 0x00, 0x00, 0x00, 0x5e, 0x64, 0xdc, 0x24, 0xe5, 0xd9, 0xe3, 0xfe, 0xff, 0xfd, 0xcb, 0x9f, 0x14, 0x41, 0x0c, 0x86, 0x00, 0xd1, 0x00, 0xf0, 0xc7, 0x67, 0x5f, 0x56, 0x99, 0x5e, 0xb5, 0x6c, 0xaf, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0xc0, 0x37, 0xda, 0x56, 0x90, 0x6d, 0x01, 0x2e, 0x96, 0x69, 0x20, 0xfb, // Entry 140 - 17F 0xff, 0x3f, 0x00, 0x00, 0x00, 0x01, 0x0c, 0x16, 0x03, 0x00, 0x00, 0xb0, 0x14, 0x23, 0x50, 0x06, 0x0a, 0x00, 0x01, 0x00, 0x00, 0x10, 0x11, 0x09, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x44, 0x00, 0x00, 0x10, 0x00, 0x05, 0x08, 0x00, 0x00, 0x05, 0x00, 0x80, 0x28, 0x04, 0x00, 0x00, 0x40, 0xd5, 0x2d, 0x00, 0x64, 0x35, 0x24, 0x52, 0xf4, 0xd5, 0xbf, 0x62, 0xc9, 0x03, // Entry 180 - 1BF 0x00, 0x80, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x13, 0x39, 0x01, 0xdd, 0x57, 0x98, 0x21, 0x18, 0x81, 0x08, 0x00, 0x01, 0x40, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x44, 0x00, 0x00, 0x80, 0xea, 0xa9, 0x39, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // Entry 1C0 - 1FF 0x00, 0x03, 0x28, 0x05, 0x00, 0x00, 0x00, 0x00, 0x04, 0x20, 0x04, 0xa6, 0x00, 0x04, 0x00, 0x00, 0x81, 0x50, 0x00, 0x00, 0x00, 0x11, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x55, 0x02, 0x10, 0x08, 0x04, 0x00, 0x00, 0x00, 0x40, 0x30, 0x83, 0x01, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0xcd, 0xbf, 0x7a, 0xbf, // Entry 200 - 23F 0xdf, 0xc3, 0x83, 0x82, 0xc0, 0xfb, 0x57, 0x27, 0xed, 0x55, 0xe7, 0x01, 0x00, 0x20, 0xb2, 0xc5, 0xa4, 0x45, 0x25, 0x9b, 0x02, 0xdf, 0xe1, 0xdf, 0x03, 0x44, 0x08, 0x90, 0x01, 0x04, 0x81, 0xe3, 0x92, 0x54, 0xdb, 0x28, 0xd3, 0x5f, 0xfe, 0x6d, 0x79, 0xed, 0x1c, 0x7f, 0x04, 0x08, 0x00, 0x01, 0x21, 0x12, 0x64, 0x5f, 0xdd, 0x0e, 0x85, 0x4f, 0x40, 0x40, 0x00, 0x04, 0xf1, 0xfd, 0x3d, 0x54, // Entry 240 - 27F 0xe8, 0x03, 0xb4, 0x27, 0x23, 0x0d, 0x00, 0x00, 0x20, 0x7b, 0x78, 0x02, 0x07, 0x84, 0x00, 0xf0, 0xbb, 0x7e, 0x5a, 0x00, 0x18, 0x04, 0x81, 0x00, 0x00, 0x00, 0x80, 0x10, 0x90, 0x1c, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x40, 0x00, 0x04, 0x08, 0xa0, 0x70, 0xa5, 0x0c, 0x40, 0x00, 0x00, 0x91, 0x24, 0x04, 0x68, 0x00, 0x20, 0x70, 0xff, 0x7b, 0x7f, 0x70, 0x00, 0x05, 0x9b, 0xdd, 0x66, // Entry 280 - 2BF 0x03, 0x00, 0x11, 0x00, 0x00, 0x00, 0x40, 0x05, 0xb5, 0xb6, 0x80, 0x08, 0x04, 0x00, 0x04, 0x51, 0xe2, 0xef, 0xfd, 0x3f, 0x05, 0x09, 0x08, 0x05, 0x40, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x81, 0x00, 0x60, 0xe7, 0x48, 0x00, 0x81, 0x20, 0xc0, 0x05, 0x80, 0x03, 0x00, 0x00, 0x00, 0x8c, 0x50, 0x40, 0x04, 0x84, 0x47, 0x84, 0x40, 0x20, 0x10, 0x00, 0x20, // Entry 2C0 - 2FF 0x02, 0x50, 0x80, 0x11, 0x00, 0x99, 0x6c, 0xe2, 0x50, 0x27, 0x1d, 0x11, 0x29, 0x0e, 0x59, 0xe9, 0x33, 0x08, 0x00, 0x20, 0x04, 0x40, 0x10, 0x00, 0x00, 0x00, 0x50, 0x44, 0x92, 0x49, 0xd6, 0x5d, 0xa7, 0x81, 0x47, 0x97, 0xfb, 0x00, 0x10, 0x00, 0x08, 0x00, 0x80, 0x00, 0x40, 0x04, 0x00, 0x01, 0x02, 0x00, 0x01, 0x40, 0x80, 0x00, 0x40, 0x08, 0xd8, 0xeb, 0xf6, 0x39, 0xc4, 0x8d, 0x12, 0x00, // Entry 300 - 33F 0x00, 0x0c, 0x04, 0x01, 0x20, 0x20, 0xdd, 0xa0, 0x01, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x04, 0x10, 0xd0, 0x9d, 0x95, 0x13, 0x04, 0x80, 0x00, 0x01, 0xd0, 0x16, 0x40, 0x00, 0x10, 0xb0, 0x10, 0x62, 0x4c, 0xd2, 0x02, 0x01, 0x4a, 0x00, 0x46, 0x04, 0x00, 0x08, 0x02, 0x00, 0x20, 0x80, 0x00, 0x80, 0x06, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xd8, 0x6f, 0x15, 0x02, 0x08, 0x00, // Entry 340 - 37F 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x10, 0x01, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf0, 0x84, 0xe3, 0xdd, 0xbf, 0xf9, 0xf9, 0x3b, 0x7f, 0x7f, 0xdb, 0xfd, 0xfc, 0xfe, 0xdf, 0xff, 0xfd, 0xff, 0xf6, 0xfb, 0xfc, 0xf7, 0x1f, 0xff, 0xb3, 0x6c, 0xff, 0xd9, 0xad, 0xdf, 0xfe, 0xef, 0xba, 0xdf, 0xff, 0xff, 0xff, 0xb7, 0xdd, 0x7d, 0xbf, 0xab, 0x7f, 0xfd, 0xfd, 0xdf, 0x2f, 0x9c, 0xdf, 0xf3, 0x6f, // Entry 380 - 3BF 0xdf, 0xdd, 0xff, 0xfb, 0xee, 0xd2, 0xab, 0x5f, 0xd5, 0xdf, 0x7f, 0xff, 0xeb, 0xff, 0xe4, 0x4d, 0xf9, 0xff, 0xfe, 0xf7, 0xfd, 0xdf, 0xfb, 0xbf, 0xee, 0xdb, 0x6f, 0xef, 0xff, 0x7f, 0xff, 0xff, 0xf7, 0x5f, 0xd3, 0x3b, 0xfd, 0xd9, 0xdf, 0xeb, 0xbc, 0x08, 0x05, 0x24, 0xff, 0x07, 0x70, 0xfe, 0xe6, 0x5e, 0x00, 0x08, 0x00, 0x83, 0x7d, 0x1f, 0x06, 0xe6, 0x72, 0x60, 0xd1, 0x3c, 0x7f, 0x44, // Entry 3C0 - 3FF 0x02, 0x30, 0x9f, 0x7a, 0x16, 0xbd, 0x7f, 0x57, 0xf2, 0xff, 0x31, 0xff, 0xf2, 0x1e, 0x90, 0xf7, 0xf1, 0xf9, 0x45, 0x80, 0x01, 0x02, 0x00, 0x20, 0x40, 0x54, 0x9f, 0x8a, 0xdf, 0xf9, 0x6e, 0x11, 0x86, 0x51, 0xc0, 0xf3, 0xfb, 0x47, 0x40, 0x03, 0x05, 0xd1, 0x50, 0x5c, 0x00, 0x40, 0x00, 0x10, 0x04, 0x02, 0x00, 0x00, 0x0a, 0x00, 0x17, 0xd2, 0xb9, 0xfd, 0xfc, 0xba, 0xfe, 0xef, 0xc7, 0xbe, // Entry 400 - 43F 0x53, 0x6f, 0xdf, 0xe7, 0xdb, 0x65, 0xbb, 0x7f, 0xfa, 0xff, 0x77, 0xf3, 0xef, 0xbf, 0xfd, 0xf7, 0xdf, 0xdf, 0x9b, 0x7f, 0xff, 0xff, 0x7f, 0x6f, 0xf7, 0xfb, 0xeb, 0xdf, 0xbc, 0xff, 0xbf, 0x6b, 0x7b, 0xfb, 0xff, 0xce, 0x76, 0xbd, 0xf7, 0xf7, 0xdf, 0xdc, 0xf7, 0xf7, 0xff, 0xdf, 0xf3, 0xfe, 0xef, 0xff, 0xff, 0xff, 0xb6, 0x7f, 0x7f, 0xde, 0xf7, 0xb9, 0xeb, 0x77, 0xff, 0xfb, 0xbf, 0xdf, // Entry 440 - 47F 0xfd, 0xfe, 0xfb, 0xff, 0xfe, 0xeb, 0x1f, 0x7d, 0x2f, 0xfd, 0xb6, 0xb5, 0xa5, 0xfc, 0xff, 0xfd, 0x7f, 0x4e, 0xbf, 0x8f, 0xae, 0xff, 0xee, 0xdf, 0x7f, 0xf7, 0x73, 0x02, 0x02, 0x04, 0xfc, 0xf7, 0xff, 0xb7, 0xd7, 0xef, 0xfe, 0xcd, 0xf5, 0xce, 0xe2, 0x8e, 0xe7, 0xbf, 0xb7, 0xff, 0x56, 0xfd, 0xcd, 0xff, 0xfb, 0xff, 0xdf, 0xd7, 0xea, 0xff, 0xe5, 0x5f, 0x6d, 0x0f, 0xa7, 0x51, 0x06, 0xc4, // Entry 480 - 4BF 0x93, 0x50, 0x5d, 0xaf, 0xa6, 0xff, 0x99, 0xfb, 0x63, 0x1d, 0x53, 0xff, 0xef, 0xb7, 0x35, 0x20, 0x14, 0x00, 0x55, 0x51, 0xc2, 0x65, 0xf5, 0x41, 0xe2, 0xff, 0xfc, 0xdf, 0x02, 0x85, 0xc5, 0x05, 0x00, 0x22, 0x00, 0x74, 0x69, 0x10, 0x08, 0x05, 0x41, 0x00, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x20, 0x05, 0x04, 0x01, 0x00, 0x00, 0x06, 0x11, 0x20, 0x00, 0x18, 0x01, 0x92, 0xf1, // Entry 4C0 - 4FF 0xfd, 0x47, 0x69, 0x06, 0x95, 0x06, 0x57, 0xed, 0xfb, 0x4d, 0x1c, 0x6b, 0x83, 0x04, 0x62, 0x40, 0x00, 0x11, 0x42, 0x00, 0x00, 0x00, 0x54, 0x83, 0xb8, 0x4f, 0x10, 0x8e, 0x89, 0x46, 0xde, 0xf7, 0x13, 0x31, 0x00, 0x20, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x10, 0x00, 0x01, 0x00, 0x00, 0xf0, 0x5b, 0xf4, 0xbe, 0x3d, 0xbe, 0xcf, 0xf7, 0xaf, 0x42, 0x04, 0x84, 0x41, // Entry 500 - 53F 0x30, 0xff, 0x79, 0x72, 0x04, 0x00, 0x00, 0x49, 0x2d, 0x14, 0x27, 0x5f, 0xed, 0xf1, 0x3f, 0xe7, 0x3f, 0x00, 0x00, 0x02, 0xc6, 0xa0, 0x1e, 0xf8, 0xbb, 0xff, 0xfd, 0xfb, 0xb7, 0xfd, 0xe7, 0xf7, 0xfd, 0xfc, 0xd5, 0xed, 0x47, 0xf4, 0x7e, 0x10, 0x01, 0x01, 0x84, 0x6d, 0xff, 0xf7, 0xdd, 0xf9, 0x5b, 0x05, 0x86, 0xed, 0xf5, 0x77, 0xbd, 0x3c, 0x00, 0x00, 0x00, 0x42, 0x71, 0x42, 0x00, 0x40, // Entry 540 - 57F 0x00, 0x00, 0x01, 0x43, 0x19, 0x24, 0x08, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, // Entry 580 - 5BF 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xab, 0xbd, 0xe7, 0x57, 0xee, 0x13, 0x5d, 0x09, 0xc1, 0x40, 0x21, 0xfa, 0x17, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xce, 0xfb, 0xbf, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x30, 0x15, 0xa3, 0x10, 0x00, 0x00, 0x00, 0x11, 0x04, 0x16, 0x00, 0x00, 0x02, 0x20, 0x81, 0xa3, 0x01, 0x50, 0x00, 0x00, 0x83, 0x11, 0x40, // Entry 5C0 - 5FF 0x00, 0x00, 0x00, 0xf0, 0xdd, 0x7b, 0xbe, 0x02, 0xaa, 0x10, 0x5d, 0x98, 0x52, 0x00, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x02, 0x02, 0x3d, 0x40, 0x10, 0x02, 0x10, 0x61, 0x5a, 0x9d, 0x31, 0x00, 0x00, 0x00, 0x01, 0x18, 0x02, 0x20, 0x00, 0x00, 0x01, 0x00, 0x42, 0x00, 0x20, 0x00, 0x00, 0x1f, 0xdf, 0xd2, 0xb9, 0xff, 0xfd, 0x3f, 0x1f, 0x98, 0xcf, 0x9c, 0xff, 0xaf, 0x5f, 0xfe, // Entry 600 - 63F 0x7b, 0x4b, 0x40, 0x10, 0xe1, 0xfd, 0xaf, 0xd9, 0xb7, 0xf6, 0xfb, 0xb3, 0xc7, 0xff, 0x6f, 0xf1, 0x73, 0xb1, 0x7f, 0x9f, 0x7f, 0xbd, 0xfc, 0xb7, 0xee, 0x1c, 0xfa, 0xcb, 0xef, 0xdd, 0xf9, 0xbd, 0x6e, 0xae, 0x55, 0xfd, 0x6e, 0x81, 0x76, 0x9f, 0xd4, 0x77, 0xf5, 0x7d, 0xfb, 0xff, 0xeb, 0xfe, 0xbe, 0x5f, 0x46, 0x5b, 0xe9, 0x5f, 0x50, 0x18, 0x02, 0xfa, 0xf7, 0x9d, 0x15, 0x97, 0x05, 0x0f, // Entry 640 - 67F 0x75, 0xc4, 0x7d, 0x81, 0x92, 0xf5, 0x57, 0x6c, 0xff, 0xe4, 0xef, 0x6f, 0xff, 0xfc, 0xdd, 0xde, 0xfc, 0xfd, 0x76, 0x5f, 0x7a, 0x3f, 0x00, 0x98, 0x02, 0xfb, 0xa3, 0xef, 0xf3, 0xd6, 0xf2, 0xff, 0xb9, 0xda, 0x7d, 0xd0, 0x3e, 0x15, 0x7b, 0xb4, 0xf5, 0x3e, 0xff, 0xff, 0xf1, 0xf7, 0xff, 0xe7, 0x5f, 0xff, 0xff, 0x9e, 0xdf, 0xf6, 0xd7, 0xb9, 0xef, 0x27, 0x80, 0xbb, 0xc5, 0xff, 0xff, 0xe3, // Entry 680 - 6BF 0x97, 0x9d, 0xbf, 0x9f, 0xf7, 0xc7, 0xfd, 0x37, 0xce, 0x7f, 0x44, 0x1d, 0x73, 0x7f, 0xf8, 0xda, 0x5d, 0xce, 0x7d, 0x06, 0xb9, 0xea, 0x79, 0xa0, 0x1a, 0x20, 0x00, 0x30, 0x02, 0x04, 0x24, 0x08, 0x04, 0x00, 0x00, 0x40, 0xd4, 0x02, 0x04, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, 0x20, 0x09, 0x06, 0x50, 0x00, 0x08, 0x00, 0x00, 0x00, 0x24, 0x00, 0x04, 0x00, 0x10, 0xdc, 0x58, 0xd7, 0x0d, 0x0f, // Entry 6C0 - 6FF 0x54, 0x4d, 0xf1, 0x16, 0x44, 0xd5, 0x42, 0x08, 0x40, 0x02, 0x00, 0x40, 0x00, 0x08, 0x00, 0x00, 0x00, 0xdc, 0xfb, 0xcb, 0x0e, 0x58, 0x48, 0x41, 0x24, 0x20, 0x04, 0x00, 0x30, 0x12, 0x40, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x80, 0x10, 0x10, 0xab, 0x6d, 0x93, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x25, 0x00, 0x00, // Entry 700 - 73F 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x80, 0x86, 0xc2, 0x00, 0x00, 0x01, 0x00, 0x01, 0xff, 0x18, 0x02, 0x00, 0x02, 0xf0, 0xfd, 0x79, 0x3b, 0x00, 0x25, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x03, 0x00, 0x09, 0x20, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Entry 740 - 77F 0x00, 0x00, 0x00, 0xef, 0xd5, 0xfd, 0xcf, 0x7e, 0xb0, 0x11, 0x00, 0x00, 0x00, 0x92, 0x01, 0x46, 0xcd, 0xf9, 0x5c, 0x00, 0x01, 0x00, 0x30, 0x04, 0x04, 0x55, 0x00, 0x01, 0x04, 0xf4, 0x3f, 0x4a, 0x01, 0x00, 0x00, 0xb0, 0x80, 0x20, 0x55, 0x75, 0x97, 0x7c, 0xdf, 0x31, 0xcc, 0x68, 0xd1, 0x03, 0xd5, 0x57, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0xf7, 0xcb, 0x1f, 0x14, 0x60, // Entry 780 - 7BF 0x83, 0x68, 0x01, 0x10, 0x8b, 0x38, 0x8a, 0x01, 0x00, 0x00, 0x20, 0x00, 0x24, 0x44, 0x00, 0x00, 0x10, 0x03, 0x31, 0x02, 0x01, 0x00, 0x00, 0xf0, 0xf5, 0xff, 0xd5, 0x97, 0xbc, 0x70, 0xd6, 0x78, 0x78, 0x15, 0x50, 0x05, 0xa4, 0x84, 0xa9, 0x41, 0x00, 0x00, 0x00, 0x6b, 0x39, 0x52, 0x74, 0x40, 0xe8, 0x30, 0x90, 0x6a, 0x92, 0x00, 0x00, 0x02, 0xff, 0xef, 0xff, 0x4b, 0x85, 0x53, 0xf4, 0xed, // Entry 7C0 - 7FF 0xdd, 0xbf, 0xf2, 0x5d, 0xc7, 0x0c, 0xd5, 0x42, 0xfc, 0xff, 0xf7, 0x1f, 0x00, 0x80, 0x40, 0x56, 0xcc, 0x16, 0x9e, 0xea, 0x35, 0x7d, 0xef, 0xff, 0xbd, 0xa4, 0xaf, 0x01, 0x44, 0x18, 0x01, 0x4d, 0x4e, 0x4a, 0x08, 0x50, 0x28, 0x30, 0xe0, 0x80, 0x10, 0x20, 0x24, 0x00, 0xff, 0x2f, 0xd3, 0x60, 0xfe, 0x01, 0x02, 0x88, 0x2a, 0x40, 0x16, 0x01, 0x01, 0x15, 0x2b, 0x3c, 0x01, 0x00, 0x00, 0x10, // Entry 800 - 83F 0x90, 0x49, 0x41, 0x02, 0x02, 0x01, 0xe1, 0xbf, 0xbf, 0x03, 0x00, 0x00, 0x10, 0xdc, 0xa3, 0xd1, 0x40, 0x9c, 0x44, 0xdf, 0xf5, 0x8f, 0x66, 0xb3, 0x55, 0x20, 0xd4, 0xc1, 0xd8, 0x30, 0x3d, 0x80, 0x00, 0x00, 0x00, 0x04, 0xd4, 0x11, 0xc5, 0x84, 0x2f, 0x50, 0x00, 0x22, 0x50, 0x6e, 0xbd, 0x93, 0x07, 0x00, 0x20, 0x10, 0x84, 0xb2, 0x45, 0x10, 0x06, 0x44, 0x00, 0x00, 0x12, 0x02, 0x11, 0x00, // Entry 840 - 87F 0xf0, 0xfb, 0xfd, 0x7f, 0x05, 0x00, 0x16, 0x89, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x03, 0x30, 0x02, 0x28, 0x84, 0x00, 0x21, 0xc0, 0x23, 0x24, 0x00, 0x00, 0x00, 0xcb, 0xe4, 0x3a, 0x46, 0x88, 0x54, 0xf1, 0xef, 0xff, 0x7f, 0x12, 0x01, 0x01, 0x84, 0x50, 0x07, 0xfc, 0xff, 0xff, 0x0f, 0x01, 0x00, 0x40, 0x10, 0x38, 0x01, 0x01, 0x1c, 0x12, 0x40, 0xe1, // Entry 880 - 8BF 0x76, 0x16, 0x08, 0x03, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x24, 0x0a, 0x00, 0x80, 0x00, 0x00, } // altLangISO3 holds an alphabetically sorted list of 3-letter language code alternatives // to 2-letter language codes that cannot be derived using the method described above. // Each 3-letter code is followed by its 1-byte langID. const altLangISO3 tag.Index = "---\x00cor\x00hbs\x01heb\x02kin\x03spa\x04yid\x05\xff\xff\xff\xff" // altLangIndex is used to convert indexes in altLangISO3 to langIDs. // Size: 12 bytes, 6 elements var altLangIndex = [6]uint16{ 0x0281, 0x0407, 0x01fb, 0x03e5, 0x013e, 0x0208, } // AliasMap maps langIDs to their suggested replacements. // Size: 772 bytes, 193 elements var AliasMap = [193]FromTo{ 0: {From: 0x82, To: 0x88}, 1: {From: 0x187, To: 0x1ae}, 2: {From: 0x1f3, To: 0x1e1}, 3: {From: 0x1fb, To: 0x1bc}, 4: {From: 0x208, To: 0x512}, 5: {From: 0x20f, To: 0x20e}, 6: {From: 0x310, To: 0x3dc}, 7: {From: 0x347, To: 0x36f}, 8: {From: 0x407, To: 0x432}, 9: {From: 0x47a, To: 0x153}, 10: {From: 0x490, To: 0x451}, 11: {From: 0x4a2, To: 0x21}, 12: {From: 0x53e, To: 0x544}, 13: {From: 0x58f, To: 0x12d}, 14: {From: 0x62b, To: 0x34}, 15: {From: 0x62f, To: 0x14}, 16: {From: 0x630, To: 0x1eb1}, 17: {From: 0x651, To: 0x431}, 18: {From: 0x662, To: 0x431}, 19: {From: 0x6ed, To: 0x3a}, 20: {From: 0x6f8, To: 0x1d7}, 21: {From: 0x709, To: 0x3625}, 22: {From: 0x73e, To: 0x21a1}, 23: {From: 0x7b3, To: 0x56}, 24: {From: 0x7b9, To: 0x299b}, 25: {From: 0x7c5, To: 0x58}, 26: {From: 0x7e6, To: 0x145}, 27: {From: 0x80c, To: 0x5a}, 28: {From: 0x815, To: 0x8d}, 29: {From: 0x87e, To: 0x810}, 30: {From: 0x8a8, To: 0x8b7}, 31: {From: 0x8c3, To: 0xee3}, 32: {From: 0x8fa, To: 0x1dc}, 33: {From: 0x9ef, To: 0x331}, 34: {From: 0xa36, To: 0x2c5}, 35: {From: 0xa3d, To: 0xbf}, 36: {From: 0xabe, To: 0x3322}, 37: {From: 0xb38, To: 0x529}, 38: {From: 0xb75, To: 0x265a}, 39: {From: 0xb7e, To: 0xbc3}, 40: {From: 0xb9b, To: 0x44e}, 41: {From: 0xbbc, To: 0x4229}, 42: {From: 0xbbf, To: 0x529}, 43: {From: 0xbfe, To: 0x2da7}, 44: {From: 0xc2e, To: 0x3181}, 45: {From: 0xcb9, To: 0xf3}, 46: {From: 0xd08, To: 0xfa}, 47: {From: 0xdc8, To: 0x11a}, 48: {From: 0xdd7, To: 0x32d}, 49: {From: 0xdf8, To: 0xdfb}, 50: {From: 0xdfe, To: 0x531}, 51: {From: 0xe01, To: 0xdf3}, 52: {From: 0xedf, To: 0x205a}, 53: {From: 0xee9, To: 0x222e}, 54: {From: 0xeee, To: 0x2e9a}, 55: {From: 0xf39, To: 0x367}, 56: {From: 0x10d0, To: 0x140}, 57: {From: 0x1104, To: 0x2d0}, 58: {From: 0x11a0, To: 0x1ec}, 59: {From: 0x1279, To: 0x21}, 60: {From: 0x1424, To: 0x15e}, 61: {From: 0x1470, To: 0x14e}, 62: {From: 0x151f, To: 0xd9b}, 63: {From: 0x1523, To: 0x390}, 64: {From: 0x1532, To: 0x19f}, 65: {From: 0x1580, To: 0x210}, 66: {From: 0x1583, To: 0x10d}, 67: {From: 0x15a3, To: 0x3caf}, 68: {From: 0x1630, To: 0x222e}, 69: {From: 0x166a, To: 0x19b}, 70: {From: 0x16c8, To: 0x136}, 71: {From: 0x1700, To: 0x29f8}, 72: {From: 0x1718, To: 0x194}, 73: {From: 0x1727, To: 0xf3f}, 74: {From: 0x177a, To: 0x178}, 75: {From: 0x1809, To: 0x17b6}, 76: {From: 0x1816, To: 0x18f3}, 77: {From: 0x188a, To: 0x436}, 78: {From: 0x1979, To: 0x1d01}, 79: {From: 0x1a74, To: 0x2bb0}, 80: {From: 0x1a8a, To: 0x1f8}, 81: {From: 0x1b5a, To: 0x1fa}, 82: {From: 0x1b86, To: 0x1515}, 83: {From: 0x1d64, To: 0x2c9b}, 84: {From: 0x2038, To: 0x37b1}, 85: {From: 0x203d, To: 0x20dd}, 86: {From: 0x2042, To: 0x2e00}, 87: {From: 0x205a, To: 0x30b}, 88: {From: 0x20e3, To: 0x274}, 89: {From: 0x20ee, To: 0x263}, 90: {From: 0x20f2, To: 0x22d}, 91: {From: 0x20f9, To: 0x256}, 92: {From: 0x210f, To: 0x21eb}, 93: {From: 0x2135, To: 0x27d}, 94: {From: 0x2160, To: 0x913}, 95: {From: 0x2199, To: 0x121}, 96: {From: 0x21ce, To: 0x1561}, 97: {From: 0x21e6, To: 0x504}, 98: {From: 0x21f4, To: 0x49f}, 99: {From: 0x21fb, To: 0x269}, 100: {From: 0x222d, To: 0x121}, 101: {From: 0x2237, To: 0x121}, 102: {From: 0x2248, To: 0x217d}, 103: {From: 0x2262, To: 0x92a}, 104: {From: 0x2316, To: 0x3226}, 105: {From: 0x236a, To: 0x2835}, 106: {From: 0x2382, To: 0x3365}, 107: {From: 0x2472, To: 0x2c7}, 108: {From: 0x24e4, To: 0x2ff}, 109: {From: 0x24f0, To: 0x2fa}, 110: {From: 0x24fa, To: 0x31f}, 111: {From: 0x2550, To: 0xb5b}, 112: {From: 0x25a9, To: 0xe2}, 113: {From: 0x263e, To: 0x2d0}, 114: {From: 0x26c9, To: 0x26b4}, 115: {From: 0x26f9, To: 0x3c8}, 116: {From: 0x2727, To: 0x3caf}, 117: {From: 0x2755, To: 0x6a4}, 118: {From: 0x2765, To: 0x26b4}, 119: {From: 0x2789, To: 0x4358}, 120: {From: 0x27c9, To: 0x2001}, 121: {From: 0x28ea, To: 0x27b1}, 122: {From: 0x28ef, To: 0x2837}, 123: {From: 0x28fe, To: 0xaa5}, 124: {From: 0x2914, To: 0x351}, 125: {From: 0x2986, To: 0x2da7}, 126: {From: 0x29f0, To: 0x96b}, 127: {From: 0x2b1a, To: 0x38d}, 128: {From: 0x2bfc, To: 0x395}, 129: {From: 0x2c3f, To: 0x3caf}, 130: {From: 0x2ce1, To: 0x2201}, 131: {From: 0x2cfc, To: 0x3be}, 132: {From: 0x2d13, To: 0x597}, 133: {From: 0x2d47, To: 0x148}, 134: {From: 0x2d48, To: 0x148}, 135: {From: 0x2dff, To: 0x2f1}, 136: {From: 0x2e08, To: 0x19cc}, 137: {From: 0x2e10, To: 0xc45}, 138: {From: 0x2e1a, To: 0x2d95}, 139: {From: 0x2e21, To: 0x292}, 140: {From: 0x2e54, To: 0x7d}, 141: {From: 0x2e65, To: 0x2282}, 142: {From: 0x2e97, To: 0x1a4}, 143: {From: 0x2ea0, To: 0x2e9b}, 144: {From: 0x2eef, To: 0x2ed7}, 145: {From: 0x3193, To: 0x3c4}, 146: {From: 0x3366, To: 0x338e}, 147: {From: 0x342a, To: 0x3dc}, 148: {From: 0x34ee, To: 0x18d0}, 149: {From: 0x35c8, To: 0x2c9b}, 150: {From: 0x35e6, To: 0x412}, 151: {From: 0x35f5, To: 0x24b}, 152: {From: 0x360d, To: 0x1dc}, 153: {From: 0x3658, To: 0x246}, 154: {From: 0x3676, To: 0x3f4}, 155: {From: 0x36fd, To: 0x445}, 156: {From: 0x3747, To: 0x3b42}, 157: {From: 0x37c0, To: 0x121}, 158: {From: 0x3816, To: 0x38f2}, 159: {From: 0x382a, To: 0x2b48}, 160: {From: 0x382b, To: 0x2c9b}, 161: {From: 0x382f, To: 0xa9}, 162: {From: 0x3832, To: 0x3228}, 163: {From: 0x386c, To: 0x39a6}, 164: {From: 0x3892, To: 0x3fc0}, 165: {From: 0x38a0, To: 0x45f}, 166: {From: 0x38a5, To: 0x39d7}, 167: {From: 0x38b4, To: 0x1fa4}, 168: {From: 0x38b5, To: 0x2e9a}, 169: {From: 0x38fa, To: 0x38f1}, 170: {From: 0x395c, To: 0x47e}, 171: {From: 0x3b4e, To: 0xd91}, 172: {From: 0x3b78, To: 0x137}, 173: {From: 0x3c99, To: 0x4bc}, 174: {From: 0x3fbd, To: 0x100}, 175: {From: 0x4208, To: 0xa91}, 176: {From: 0x42be, To: 0x573}, 177: {From: 0x42f9, To: 0x3f60}, 178: {From: 0x4378, To: 0x25a}, 179: {From: 0x43b8, To: 0xe6c}, 180: {From: 0x43cd, To: 0x10f}, 181: {From: 0x43d4, To: 0x4848}, 182: {From: 0x44af, To: 0x3322}, 183: {From: 0x44e3, To: 0x512}, 184: {From: 0x45ca, To: 0x2409}, 185: {From: 0x45dd, To: 0x26dc}, 186: {From: 0x4610, To: 0x48ae}, 187: {From: 0x46ae, To: 0x46a0}, 188: {From: 0x473e, To: 0x4745}, 189: {From: 0x4817, To: 0x3503}, 190: {From: 0x483b, To: 0x208b}, 191: {From: 0x4916, To: 0x31f}, 192: {From: 0x49a7, To: 0x523}, } // Size: 193 bytes, 193 elements var AliasTypes = [193]AliasType{ // Entry 0 - 3F 1, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 1, 0, 0, 0, 0, 1, 2, 1, 1, 2, 0, 0, 1, 0, 1, 2, 1, 1, 0, 0, 0, 0, 2, 1, 1, 0, 2, 0, 0, 1, 0, 1, 0, 0, 1, 2, 1, 1, 1, 1, 0, 0, 0, 0, 2, 1, 1, 1, 1, 2, 1, 0, 1, // Entry 40 - 7F 1, 2, 2, 0, 0, 1, 2, 0, 1, 0, 1, 1, 1, 1, 0, 0, 2, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 2, 2, 2, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, // Entry 80 - BF 1, 0, 0, 1, 0, 2, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 2, 0, 0, 2, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 2, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, // Entry C0 - FF 1, } const ( _Latn = 91 _Hani = 57 _Hans = 59 _Hant = 60 _Qaaa = 149 _Qaai = 157 _Qabx = 198 _Zinh = 255 _Zyyy = 260 _Zzzz = 261 ) // script is an alphabetically sorted list of ISO 15924 codes. The index // of the script in the string, divided by 4, is the internal scriptID. const script tag.Index = "" + // Size: 1052 bytes "----AdlmAfakAghbAhomArabAranArmiArmnAvstBaliBamuBassBatkBengBhksBlisBopo" + "BrahBraiBugiBuhdCakmCansCariChamCherChrsCirtCoptCpmnCprtCyrlCyrsDevaDiak" + "DogrDsrtDuplEgydEgyhEgypElbaElymEthiGeokGeorGlagGongGonmGothGranGrekGujr" + "GuruHanbHangHaniHanoHansHantHatrHebrHiraHluwHmngHmnpHrktHungIndsItalJamo" + "JavaJpanJurcKaliKanaKawiKharKhmrKhojKitlKitsKndaKoreKpelKthiLanaLaooLatf" + "LatgLatnLekeLepcLimbLinaLinbLisuLomaLyciLydiMahjMakaMandManiMarcMayaMedf" + "MendMercMeroMlymModiMongMoonMrooMteiMultMymrNagmNandNarbNbatNewaNkdbNkgb" + "NkooNshuOgamOlckOrkhOryaOsgeOsmaOugrPalmPaucPcunPelmPermPhagPhliPhlpPhlv" + "PhnxPiqdPlrdPrtiPsinQaaaQaabQaacQaadQaaeQaafQaagQaahQaaiQaajQaakQaalQaam" + "QaanQaaoQaapQaaqQaarQaasQaatQaauQaavQaawQaaxQaayQaazQabaQabbQabcQabdQabe" + "QabfQabgQabhQabiQabjQabkQablQabmQabnQaboQabpQabqQabrQabsQabtQabuQabvQabw" + "QabxRanjRjngRohgRoroRunrSamrSaraSarbSaurSgnwShawShrdShuiSiddSindSinhSogd" + "SogoSoraSoyoSundSunuSyloSyrcSyreSyrjSyrnTagbTakrTaleTaluTamlTangTavtTelu" + "TengTfngTglgThaaThaiTibtTirhTnsaTotoUgarVaiiVispVithWaraWchoWoleXpeoXsux" + "YeziYiiiZanbZinhZmthZsyeZsymZxxxZyyyZzzz\xff\xff\xff\xff" // suppressScript is an index from langID to the dominant script for that language, // if it exists. If a script is given, it should be suppressed from the language tag. // Size: 1330 bytes, 1330 elements var suppressScript = [1330]uint8{ // Entry 0 - 3F 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, // Entry 40 - 7F 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, // Entry 80 - BF 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Entry C0 - FF 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, // Entry 100 - 13F 0x5b, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xed, 0x00, 0x00, 0x00, 0x00, 0xef, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x5b, 0x00, 0x5b, 0x00, // Entry 140 - 17F 0x5b, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x5b, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Entry 180 - 1BF 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x22, 0x00, // Entry 1C0 - 1FF 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x5b, 0x00, 0x5b, 0x5b, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x5b, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, // Entry 200 - 23F 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Entry 240 - 27F 0x00, 0x00, 0x20, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x54, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Entry 280 - 2BF 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Entry 2C0 - 2FF 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, // Entry 300 - 33F 0x00, 0x00, 0x00, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x5b, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, // Entry 340 - 37F 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x5b, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x5b, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, // Entry 380 - 3BF 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, // Entry 3C0 - 3FF 0x5b, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Entry 400 - 43F 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, // Entry 440 - 47F 0x00, 0x00, 0x00, 0x00, 0x5b, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe9, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xee, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x5b, 0x00, // Entry 480 - 4BF 0x5b, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Entry 4C0 - 4FF 0x5b, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Entry 500 - 53F 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, } const ( _001 = 1 _419 = 31 _BR = 65 _CA = 73 _ES = 111 _GB = 124 _MD = 189 _PT = 239 _UK = 307 _US = 310 _ZZ = 358 _XA = 324 _XC = 326 _XK = 334 ) // isoRegionOffset needs to be added to the index of regionISO to obtain the regionID // for 2-letter ISO codes. (The first isoRegionOffset regionIDs are reserved for // the UN.M49 codes used for groups.) const isoRegionOffset = 32 // regionTypes defines the status of a region for various standards. // Size: 359 bytes, 359 elements var regionTypes = [359]uint8{ // Entry 0 - 3F 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, // Entry 40 - 7F 0x06, 0x06, 0x06, 0x06, 0x04, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x04, 0x04, 0x06, 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x04, 0x06, 0x04, 0x06, 0x06, 0x06, 0x06, 0x00, 0x06, 0x04, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x04, 0x06, 0x06, 0x06, 0x06, 0x06, 0x00, 0x06, 0x04, 0x06, 0x06, 0x06, 0x06, 0x06, // Entry 80 - BF 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x00, 0x04, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, // Entry C0 - FF 0x06, 0x06, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x00, 0x06, 0x06, 0x06, 0x06, 0x00, 0x06, 0x04, 0x06, 0x06, 0x06, 0x06, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x00, 0x06, 0x06, 0x00, 0x06, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, // Entry 100 - 13F 0x05, 0x05, 0x05, 0x06, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x04, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x02, 0x06, 0x04, 0x06, 0x06, 0x06, 0x06, 0x06, 0x00, 0x06, 0x06, 0x06, 0x06, // Entry 140 - 17F 0x06, 0x06, 0x00, 0x06, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x06, 0x06, 0x04, 0x06, 0x06, 0x04, 0x06, 0x05, } // regionISO holds a list of alphabetically sorted 2-letter ISO region codes. // Each 2-letter codes is followed by two bytes with the following meaning: // - [A-Z}{2}: the first letter of the 2-letter code plus these two // letters form the 3-letter ISO code. // - 0, n: index into altRegionISO3. const regionISO tag.Index = "" + // Size: 1312 bytes "AAAAACSCADNDAEREAFFGAGTGAIIAALLBAMRMANNTAOGOAQTAARRGASSMATUTAUUSAWBWAXLA" + "AZZEBAIHBBRBBDGDBEELBFFABGGRBHHRBIDIBJENBLLMBMMUBNRNBOOLBQESBRRABSHSBTTN" + "BUURBVVTBWWABYLRBZLZCAANCCCKCDODCFAFCGOGCHHECIIVCKOKCLHLCMMRCNHNCOOLCPPT" + "CQ CRRICS\x00\x00CTTECUUBCVPVCWUWCXXRCYYPCZZEDDDRDEEUDGGADJJIDKNKDMMADO" + "OMDYHYDZZAEA ECCUEESTEGGYEHSHERRIESSPETTHEU\x00\x03EZ FIINFJJIFKLKFMSM" + "FOROFQ\x00\x18FRRAFXXXGAABGBBRGDRDGEEOGFUFGGGYGHHAGIIBGLRLGMMBGNINGPLPGQ" + "NQGRRCGS\x00\x06GTTMGUUMGWNBGYUYHKKGHMMDHNNDHRRVHTTIHUUNHVVOIC IDDNIERL" + "ILSRIMMNINNDIOOTIQRQIRRNISSLITTAJEEYJMAMJOORJPPNJTTNKEENKGGZKHHMKIIRKM" + "\x00\x09KNNAKP\x00\x0cKRORKWWTKY\x00\x0fKZAZLAAOLBBNLCCALIIELKKALRBRLSSO" + "LTTULUUXLVVALYBYMAARMCCOMDDAMENEMFAFMGDGMHHLMIIDMKKDMLLIMMMRMNNGMOACMPNP" + "MQTQMRRTMSSRMTLTMUUSMVDVMWWIMXEXMYYSMZOZNAAMNCCLNEERNFFKNGGANHHBNIICNLLD" + "NOORNPPLNQ\x00\x1eNRRUNTTZNUIUNZZLOMMNPAANPCCIPEERPFYFPGNGPHHLPKAKPLOLPM" + "\x00\x12PNCNPRRIPSSEPTRTPUUSPWLWPYRYPZCZQAATQMMMQNNNQOOOQPPPQQQQQRRRQSSS" + "QTTTQU\x00\x03QVVVQWWWQXXXQYYYQZZZREEURHHOROOURS\x00\x15RUUSRWWASAAUSBLB" + "SCYCSDDNSEWESGGPSHHNSIVNSJJMSKVKSLLESMMRSNENSOOMSRURSSSDSTTPSUUNSVLVSXXM" + "SYYRSZWZTAAATCCATDCDTF\x00\x18TGGOTHHATJJKTKKLTLLSTMKMTNUNTOONTPMPTRURTT" + "TOTVUVTWWNTZZAUAKRUGGAUK UMMIUN USSAUYRYUZZBVAATVCCTVDDRVEENVGGBVIIRVN" + "NMVUUTWFLFWKAKWSSMXAAAXBBBXCCCXDDDXEEEXFFFXGGGXHHHXIIIXJJJXKKKXLLLXMMMXN" + "NNXOOOXPPPXQQQXRRRXSSSXTTTXUUUXVVVXWWWXXXXXYYYXZZZYDMDYEEMYT\x00\x1bYUUG" + "ZAAFZMMBZRARZWWEZZZZ\xff\xff\xff\xff" // altRegionISO3 holds a list of 3-letter region codes that cannot be // mapped to 2-letter codes using the default algorithm. This is a short list. const altRegionISO3 string = "SCGQUUSGSCOMPRKCYMSPMSRBATFMYTATN" // altRegionIDs holds a list of regionIDs the positions of which match those // of the 3-letter ISO codes in altRegionISO3. // Size: 22 bytes, 11 elements var altRegionIDs = [11]uint16{ 0x0058, 0x0071, 0x0089, 0x00a9, 0x00ab, 0x00ae, 0x00eb, 0x0106, 0x0122, 0x0160, 0x00dd, } // Size: 80 bytes, 20 elements var regionOldMap = [20]FromTo{ 0: {From: 0x44, To: 0xc5}, 1: {From: 0x59, To: 0xa8}, 2: {From: 0x60, To: 0x61}, 3: {From: 0x67, To: 0x3b}, 4: {From: 0x7a, To: 0x79}, 5: {From: 0x94, To: 0x37}, 6: {From: 0xa4, To: 0x134}, 7: {From: 0xc2, To: 0x134}, 8: {From: 0xd8, To: 0x140}, 9: {From: 0xdd, To: 0x2b}, 10: {From: 0xf0, To: 0x134}, 11: {From: 0xf3, To: 0xe3}, 12: {From: 0xfd, To: 0x71}, 13: {From: 0x104, To: 0x165}, 14: {From: 0x12b, To: 0x127}, 15: {From: 0x133, To: 0x7c}, 16: {From: 0x13b, To: 0x13f}, 17: {From: 0x142, To: 0x134}, 18: {From: 0x15e, To: 0x15f}, 19: {From: 0x164, To: 0x4b}, } // m49 maps regionIDs to UN.M49 codes. The first isoRegionOffset entries are // codes indicating collections of regions. // Size: 718 bytes, 359 elements var m49 = [359]int16{ // Entry 0 - 3F 0, 1, 2, 3, 5, 9, 11, 13, 14, 15, 17, 18, 19, 21, 29, 30, 34, 35, 39, 53, 54, 57, 61, 142, 143, 145, 150, 151, 154, 155, 202, 419, 958, 0, 20, 784, 4, 28, 660, 8, 51, 530, 24, 10, 32, 16, 40, 36, 533, 248, 31, 70, 52, 50, 56, 854, 100, 48, 108, 204, 652, 60, 96, 68, // Entry 40 - 7F 535, 76, 44, 64, 104, 74, 72, 112, 84, 124, 166, 180, 140, 178, 756, 384, 184, 152, 120, 156, 170, 0, 0, 188, 891, 296, 192, 132, 531, 162, 196, 203, 278, 276, 0, 262, 208, 212, 214, 204, 12, 0, 218, 233, 818, 732, 232, 724, 231, 967, 0, 246, 242, 238, 583, 234, 0, 250, 249, 266, 826, 308, 268, 254, // Entry 80 - BF 831, 288, 292, 304, 270, 324, 312, 226, 300, 239, 320, 316, 624, 328, 344, 334, 340, 191, 332, 348, 854, 0, 360, 372, 376, 833, 356, 86, 368, 364, 352, 380, 832, 388, 400, 392, 581, 404, 417, 116, 296, 174, 659, 408, 410, 414, 136, 398, 418, 422, 662, 438, 144, 430, 426, 440, 442, 428, 434, 504, 492, 498, 499, 663, // Entry C0 - FF 450, 584, 581, 807, 466, 104, 496, 446, 580, 474, 478, 500, 470, 480, 462, 454, 484, 458, 508, 516, 540, 562, 574, 566, 548, 558, 528, 578, 524, 10, 520, 536, 570, 554, 512, 591, 0, 604, 258, 598, 608, 586, 616, 666, 612, 630, 275, 620, 581, 585, 600, 591, 634, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, // Entry 100 - 13F 970, 971, 972, 638, 716, 642, 688, 643, 646, 682, 90, 690, 729, 752, 702, 654, 705, 744, 703, 694, 674, 686, 706, 740, 728, 678, 810, 222, 534, 760, 748, 0, 796, 148, 260, 768, 764, 762, 772, 626, 795, 788, 776, 626, 792, 780, 798, 158, 834, 804, 800, 826, 581, 0, 840, 858, 860, 336, 670, 704, 862, 92, 850, 704, // Entry 140 - 17F 548, 876, 581, 882, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 720, 887, 175, 891, 710, 894, 180, 716, 999, } // m49Index gives indexes into fromM49 based on the three most significant bits // of a 10-bit UN.M49 code. To search an UN.M49 code in fromM49, search in // // fromM49[m49Index[msb39(code)]:m49Index[msb3(code)+1]] // // for an entry where the first 7 bits match the 7 lsb of the UN.M49 code. // The region code is stored in the 9 lsb of the indexed value. // Size: 18 bytes, 9 elements var m49Index = [9]int16{ 0, 59, 108, 143, 181, 220, 259, 291, 333, } // fromM49 contains entries to map UN.M49 codes to regions. See m49Index for details. // Size: 666 bytes, 333 elements var fromM49 = [333]uint16{ // Entry 0 - 3F 0x0201, 0x0402, 0x0603, 0x0824, 0x0a04, 0x1027, 0x1205, 0x142b, 0x1606, 0x1868, 0x1a07, 0x1c08, 0x1e09, 0x202d, 0x220a, 0x240b, 0x260c, 0x2822, 0x2a0d, 0x302a, 0x3825, 0x3a0e, 0x3c0f, 0x3e32, 0x402c, 0x4410, 0x4611, 0x482f, 0x4e12, 0x502e, 0x5842, 0x6039, 0x6435, 0x6628, 0x6834, 0x6a13, 0x6c14, 0x7036, 0x7215, 0x783d, 0x7a16, 0x8043, 0x883f, 0x8c33, 0x9046, 0x9445, 0x9841, 0xa848, 0xac9b, 0xb50a, 0xb93d, 0xc03e, 0xc838, 0xd0c5, 0xd83a, 0xe047, 0xe8a7, 0xf052, 0xf849, 0x085b, 0x10ae, 0x184c, 0x1c17, 0x1e18, // Entry 40 - 7F 0x20b4, 0x2219, 0x2921, 0x2c1a, 0x2e1b, 0x3051, 0x341c, 0x361d, 0x3853, 0x3d2f, 0x445d, 0x4c4a, 0x5454, 0x5ca9, 0x5f60, 0x644d, 0x684b, 0x7050, 0x7857, 0x7e91, 0x805a, 0x885e, 0x941e, 0x965f, 0x983b, 0xa064, 0xa865, 0xac66, 0xb46a, 0xbd1b, 0xc487, 0xcc70, 0xce70, 0xd06e, 0xd26b, 0xd477, 0xdc75, 0xde89, 0xe474, 0xec73, 0xf031, 0xf27a, 0xf479, 0xfc7f, 0x04e6, 0x0922, 0x0c63, 0x147b, 0x187e, 0x1c84, 0x26ee, 0x2861, 0x2c60, 0x3061, 0x4081, 0x4882, 0x50a8, 0x5888, 0x6083, 0x687d, 0x7086, 0x788b, 0x808a, 0x8885, // Entry 80 - BF 0x908d, 0x9892, 0x9c8f, 0xa139, 0xa890, 0xb08e, 0xb893, 0xc09e, 0xc89a, 0xd096, 0xd89d, 0xe09c, 0xe897, 0xf098, 0xf89f, 0x004f, 0x08a1, 0x10a3, 0x1caf, 0x20a2, 0x28a5, 0x30ab, 0x34ac, 0x3cad, 0x42a6, 0x44b0, 0x461f, 0x4cb1, 0x54b6, 0x58b9, 0x5cb5, 0x64ba, 0x6cb3, 0x70b7, 0x74b8, 0x7cc7, 0x84c0, 0x8ccf, 0x94d1, 0x9cce, 0xa4c4, 0xaccc, 0xb4c9, 0xbcca, 0xc0cd, 0xc8d0, 0xd8bc, 0xe0c6, 0xe4bd, 0xe6be, 0xe8cb, 0xf0bb, 0xf8d2, 0x00e2, 0x08d3, 0x10de, 0x18dc, 0x20da, 0x2429, 0x265c, 0x2a30, 0x2d1c, 0x2e40, 0x30df, // Entry C0 - FF 0x38d4, 0x4940, 0x54e1, 0x5cd9, 0x64d5, 0x6cd7, 0x74e0, 0x7cd6, 0x84db, 0x88c8, 0x8b34, 0x8e76, 0x90c1, 0x92f1, 0x94e9, 0x9ee3, 0xace7, 0xb0f2, 0xb8e5, 0xc0e8, 0xc8ec, 0xd0ea, 0xd8ef, 0xe08c, 0xe527, 0xeced, 0xf4f4, 0xfd03, 0x0505, 0x0707, 0x0d08, 0x183c, 0x1d0f, 0x26aa, 0x2826, 0x2cb2, 0x2ebf, 0x34eb, 0x3d3a, 0x4514, 0x4d19, 0x5509, 0x5d15, 0x6106, 0x650b, 0x6d13, 0x7d0e, 0x7f12, 0x813f, 0x8310, 0x8516, 0x8d62, 0x9965, 0xa15e, 0xa86f, 0xb118, 0xb30c, 0xb86d, 0xc10c, 0xc917, 0xd111, 0xd91e, 0xe10d, 0xe84e, // Entry 100 - 13F 0xf11d, 0xf525, 0xf924, 0x0123, 0x0926, 0x112a, 0x192d, 0x2023, 0x2929, 0x312c, 0x3728, 0x3920, 0x3d2e, 0x4132, 0x4931, 0x4ec3, 0x551a, 0x646c, 0x747c, 0x7e80, 0x80a0, 0x8299, 0x8530, 0x9136, 0xa53e, 0xac37, 0xb537, 0xb938, 0xbd3c, 0xd941, 0xe543, 0xed5f, 0xef5f, 0xf658, 0xfd63, 0x7c20, 0x7ef5, 0x80f6, 0x82f7, 0x84f8, 0x86f9, 0x88fa, 0x8afb, 0x8cfc, 0x8e71, 0x90fe, 0x92ff, 0x9500, 0x9701, 0x9902, 0x9b44, 0x9d45, 0x9f46, 0xa147, 0xa348, 0xa549, 0xa74a, 0xa94b, 0xab4c, 0xad4d, 0xaf4e, 0xb14f, 0xb350, 0xb551, // Entry 140 - 17F 0xb752, 0xb953, 0xbb54, 0xbd55, 0xbf56, 0xc157, 0xc358, 0xc559, 0xc75a, 0xc95b, 0xcb5c, 0xcd5d, 0xcf66, } // Size: 2128 bytes var variantIndex = map[string]uint8{ "1606nict": 0x0, "1694acad": 0x1, "1901": 0x2, "1959acad": 0x3, "1994": 0x67, "1996": 0x4, "abl1943": 0x5, "akuapem": 0x6, "alalc97": 0x69, "aluku": 0x7, "ao1990": 0x8, "aranes": 0x9, "arevela": 0xa, "arevmda": 0xb, "arkaika": 0xc, "asante": 0xd, "auvern": 0xe, "baku1926": 0xf, "balanka": 0x10, "barla": 0x11, "basiceng": 0x12, "bauddha": 0x13, "bciav": 0x14, "bcizbl": 0x15, "biscayan": 0x16, "biske": 0x62, "bohoric": 0x17, "boont": 0x18, "bornholm": 0x19, "cisaup": 0x1a, "colb1945": 0x1b, "cornu": 0x1c, "creiss": 0x1d, "dajnko": 0x1e, "ekavsk": 0x1f, "emodeng": 0x20, "fonipa": 0x6a, "fonkirsh": 0x6b, "fonnapa": 0x6c, "fonupa": 0x6d, "fonxsamp": 0x6e, "gallo": 0x21, "gascon": 0x22, "grclass": 0x23, "grital": 0x24, "grmistr": 0x25, "hepburn": 0x26, "heploc": 0x68, "hognorsk": 0x27, "hsistemo": 0x28, "ijekavsk": 0x29, "itihasa": 0x2a, "ivanchov": 0x2b, "jauer": 0x2c, "jyutping": 0x2d, "kkcor": 0x2e, "kociewie": 0x2f, "kscor": 0x30, "laukika": 0x31, "lemosin": 0x32, "lengadoc": 0x33, "lipaw": 0x63, "ltg1929": 0x34, "ltg2007": 0x35, "luna1918": 0x36, "metelko": 0x37, "monoton": 0x38, "ndyuka": 0x39, "nedis": 0x3a, "newfound": 0x3b, "nicard": 0x3c, "njiva": 0x64, "nulik": 0x3d, "osojs": 0x65, "oxendict": 0x3e, "pahawh2": 0x3f, "pahawh3": 0x40, "pahawh4": 0x41, "pamaka": 0x42, "peano": 0x43, "petr1708": 0x44, "pinyin": 0x45, "polyton": 0x46, "provenc": 0x47, "puter": 0x48, "rigik": 0x49, "rozaj": 0x4a, "rumgr": 0x4b, "scotland": 0x4c, "scouse": 0x4d, "simple": 0x6f, "solba": 0x66, "sotav": 0x4e, "spanglis": 0x4f, "surmiran": 0x50, "sursilv": 0x51, "sutsilv": 0x52, "synnejyl": 0x53, "tarask": 0x54, "tongyong": 0x55, "tunumiit": 0x56, "uccor": 0x57, "ucrcor": 0x58, "ulster": 0x59, "unifon": 0x5a, "vaidika": 0x5b, "valencia": 0x5c, "vallader": 0x5d, "vecdruka": 0x5e, "vivaraup": 0x5f, "wadegile": 0x60, "xsistemo": 0x61, } // variantNumSpecialized is the number of specialized variants in variants. const variantNumSpecialized = 105 // nRegionGroups is the number of region groups. const nRegionGroups = 33 type likelyLangRegion struct { lang uint16 region uint16 } // likelyScript is a lookup table, indexed by scriptID, for the most likely // languages and regions given a script. // Size: 1052 bytes, 263 elements var likelyScript = [263]likelyLangRegion{ 1: {lang: 0x14e, region: 0x85}, 3: {lang: 0x2a2, region: 0x107}, 4: {lang: 0x1f, region: 0x9a}, 5: {lang: 0x3a, region: 0x6c}, 7: {lang: 0x3b, region: 0x9d}, 8: {lang: 0x1d7, region: 0x28}, 9: {lang: 0x13, region: 0x9d}, 10: {lang: 0x5b, region: 0x96}, 11: {lang: 0x60, region: 0x52}, 12: {lang: 0xb9, region: 0xb5}, 13: {lang: 0x63, region: 0x96}, 14: {lang: 0xa5, region: 0x35}, 15: {lang: 0x3e9, region: 0x9a}, 17: {lang: 0x529, region: 0x12f}, 18: {lang: 0x3b1, region: 0x9a}, 19: {lang: 0x15e, region: 0x79}, 20: {lang: 0xc2, region: 0x96}, 21: {lang: 0x9d, region: 0xe8}, 22: {lang: 0xdb, region: 0x35}, 23: {lang: 0xf3, region: 0x49}, 24: {lang: 0x4f0, region: 0x12c}, 25: {lang: 0xe7, region: 0x13f}, 26: {lang: 0xe5, region: 0x136}, 29: {lang: 0xf1, region: 0x6c}, 31: {lang: 0x1a0, region: 0x5e}, 32: {lang: 0x3e2, region: 0x107}, 34: {lang: 0x1be, region: 0x9a}, 38: {lang: 0x15e, region: 0x79}, 41: {lang: 0x133, region: 0x6c}, 42: {lang: 0x431, region: 0x27}, 44: {lang: 0x27, region: 0x70}, 46: {lang: 0x210, region: 0x7e}, 47: {lang: 0xfe, region: 0x38}, 49: {lang: 0x19b, region: 0x9a}, 50: {lang: 0x19e, region: 0x131}, 51: {lang: 0x3e9, region: 0x9a}, 52: {lang: 0x136, region: 0x88}, 53: {lang: 0x1a4, region: 0x9a}, 54: {lang: 0x39d, region: 0x9a}, 55: {lang: 0x529, region: 0x12f}, 56: {lang: 0x254, region: 0xac}, 57: {lang: 0x529, region: 0x53}, 58: {lang: 0x1cb, region: 0xe8}, 59: {lang: 0x529, region: 0x53}, 60: {lang: 0x529, region: 0x12f}, 61: {lang: 0x2fd, region: 0x9c}, 62: {lang: 0x1bc, region: 0x98}, 63: {lang: 0x200, region: 0xa3}, 64: {lang: 0x1c5, region: 0x12c}, 65: {lang: 0x1ca, region: 0xb0}, 68: {lang: 0x1d5, region: 0x93}, 70: {lang: 0x142, region: 0x9f}, 71: {lang: 0x254, region: 0xac}, 72: {lang: 0x20e, region: 0x96}, 73: {lang: 0x200, region: 0xa3}, 75: {lang: 0x135, region: 0xc5}, 76: {lang: 0x200, region: 0xa3}, 78: {lang: 0x3bb, region: 0xe9}, 79: {lang: 0x24a, region: 0xa7}, 80: {lang: 0x3fa, region: 0x9a}, 83: {lang: 0x251, region: 0x9a}, 84: {lang: 0x254, region: 0xac}, 86: {lang: 0x88, region: 0x9a}, 87: {lang: 0x370, region: 0x124}, 88: {lang: 0x2b8, region: 0xb0}, 93: {lang: 0x29f, region: 0x9a}, 94: {lang: 0x2a8, region: 0x9a}, 95: {lang: 0x28f, region: 0x88}, 96: {lang: 0x1a0, region: 0x88}, 97: {lang: 0x2ac, region: 0x53}, 99: {lang: 0x4f4, region: 0x12c}, 100: {lang: 0x4f5, region: 0x12c}, 101: {lang: 0x1be, region: 0x9a}, 103: {lang: 0x337, region: 0x9d}, 104: {lang: 0x4f7, region: 0x53}, 105: {lang: 0xa9, region: 0x53}, 108: {lang: 0x2e8, region: 0x113}, 109: {lang: 0x4f8, region: 0x10c}, 110: {lang: 0x4f8, region: 0x10c}, 111: {lang: 0x304, region: 0x9a}, 112: {lang: 0x31b, region: 0x9a}, 113: {lang: 0x30b, region: 0x53}, 115: {lang: 0x31e, region: 0x35}, 116: {lang: 0x30e, region: 0x9a}, 117: {lang: 0x414, region: 0xe9}, 118: {lang: 0x331, region: 0xc5}, 121: {lang: 0x4f9, region: 0x109}, 122: {lang: 0x3b, region: 0xa2}, 123: {lang: 0x353, region: 0xdc}, 126: {lang: 0x2d0, region: 0x85}, 127: {lang: 0x52a, region: 0x53}, 128: {lang: 0x403, region: 0x97}, 129: {lang: 0x3ee, region: 0x9a}, 130: {lang: 0x39b, region: 0xc6}, 131: {lang: 0x395, region: 0x9a}, 132: {lang: 0x399, region: 0x136}, 133: {lang: 0x429, region: 0x116}, 135: {lang: 0x3b, region: 0x11d}, 136: {lang: 0xfd, region: 0xc5}, 139: {lang: 0x27d, region: 0x107}, 140: {lang: 0x2c9, region: 0x53}, 141: {lang: 0x39f, region: 0x9d}, 142: {lang: 0x39f, region: 0x53}, 144: {lang: 0x3ad, region: 0xb1}, 146: {lang: 0x1c6, region: 0x53}, 147: {lang: 0x4fd, region: 0x9d}, 200: {lang: 0x3cb, region: 0x96}, 203: {lang: 0x372, region: 0x10d}, 204: {lang: 0x420, region: 0x98}, 206: {lang: 0x4ff, region: 0x15f}, 207: {lang: 0x3f0, region: 0x9a}, 208: {lang: 0x45, region: 0x136}, 209: {lang: 0x139, region: 0x7c}, 210: {lang: 0x3e9, region: 0x9a}, 212: {lang: 0x3e9, region: 0x9a}, 213: {lang: 0x3fa, region: 0x9a}, 214: {lang: 0x40c, region: 0xb4}, 217: {lang: 0x433, region: 0x9a}, 218: {lang: 0xef, region: 0xc6}, 219: {lang: 0x43e, region: 0x96}, 221: {lang: 0x44d, region: 0x35}, 222: {lang: 0x44e, region: 0x9c}, 226: {lang: 0x45a, region: 0xe8}, 227: {lang: 0x11a, region: 0x9a}, 228: {lang: 0x45e, region: 0x53}, 229: {lang: 0x232, region: 0x53}, 230: {lang: 0x450, region: 0x9a}, 231: {lang: 0x4a5, region: 0x53}, 232: {lang: 0x9f, region: 0x13f}, 233: {lang: 0x461, region: 0x9a}, 235: {lang: 0x528, region: 0xbb}, 236: {lang: 0x153, region: 0xe8}, 237: {lang: 0x128, region: 0xce}, 238: {lang: 0x46b, region: 0x124}, 239: {lang: 0xa9, region: 0x53}, 240: {lang: 0x2ce, region: 0x9a}, 243: {lang: 0x4ad, region: 0x11d}, 244: {lang: 0x4be, region: 0xb5}, 247: {lang: 0x1ce, region: 0x9a}, 250: {lang: 0x3a9, region: 0x9d}, 251: {lang: 0x22, region: 0x9c}, 253: {lang: 0x1ea, region: 0x53}, 254: {lang: 0xef, region: 0xc6}, } type likelyScriptRegion struct { region uint16 script uint16 flags uint8 } // likelyLang is a lookup table, indexed by langID, for the most likely // scripts and regions given incomplete information. If more entries exist for a // given language, region and script are the index and size respectively // of the list in likelyLangList. // Size: 7980 bytes, 1330 elements var likelyLang = [1330]likelyScriptRegion{ 0: {region: 0x136, script: 0x5b, flags: 0x0}, 1: {region: 0x70, script: 0x5b, flags: 0x0}, 2: {region: 0x166, script: 0x5b, flags: 0x0}, 3: {region: 0x166, script: 0x5b, flags: 0x0}, 4: {region: 0x166, script: 0x5b, flags: 0x0}, 5: {region: 0x7e, script: 0x20, flags: 0x0}, 6: {region: 0x166, script: 0x5b, flags: 0x0}, 7: {region: 0x166, script: 0x20, flags: 0x0}, 8: {region: 0x81, script: 0x5b, flags: 0x0}, 9: {region: 0x166, script: 0x5b, flags: 0x0}, 10: {region: 0x166, script: 0x5b, flags: 0x0}, 11: {region: 0x166, script: 0x5b, flags: 0x0}, 12: {region: 0x96, script: 0x5b, flags: 0x0}, 13: {region: 0x132, script: 0x5b, flags: 0x0}, 14: {region: 0x81, script: 0x5b, flags: 0x0}, 15: {region: 0x166, script: 0x5b, flags: 0x0}, 16: {region: 0x166, script: 0x5b, flags: 0x0}, 17: {region: 0x107, script: 0x20, flags: 0x0}, 18: {region: 0x166, script: 0x5b, flags: 0x0}, 19: {region: 0x9d, script: 0x9, flags: 0x0}, 20: {region: 0x129, script: 0x5, flags: 0x0}, 21: {region: 0x166, script: 0x5b, flags: 0x0}, 22: {region: 0x162, script: 0x5b, flags: 0x0}, 23: {region: 0x166, script: 0x5b, flags: 0x0}, 24: {region: 0x166, script: 0x5b, flags: 0x0}, 25: {region: 0x166, script: 0x5b, flags: 0x0}, 26: {region: 0x166, script: 0x5b, flags: 0x0}, 27: {region: 0x166, script: 0x5b, flags: 0x0}, 28: {region: 0x52, script: 0x5b, flags: 0x0}, 29: {region: 0x166, script: 0x5b, flags: 0x0}, 30: {region: 0x166, script: 0x5b, flags: 0x0}, 31: {region: 0x9a, script: 0x4, flags: 0x0}, 32: {region: 0x166, script: 0x5b, flags: 0x0}, 33: {region: 0x81, script: 0x5b, flags: 0x0}, 34: {region: 0x9c, script: 0xfb, flags: 0x0}, 35: {region: 0x166, script: 0x5b, flags: 0x0}, 36: {region: 0x166, script: 0x5b, flags: 0x0}, 37: {region: 0x14e, script: 0x5b, flags: 0x0}, 38: {region: 0x107, script: 0x20, flags: 0x0}, 39: {region: 0x70, script: 0x2c, flags: 0x0}, 40: {region: 0x166, script: 0x5b, flags: 0x0}, 41: {region: 0x166, script: 0x5b, flags: 0x0}, 42: {region: 0xd7, script: 0x5b, flags: 0x0}, 43: {region: 0x166, script: 0x5b, flags: 0x0}, 45: {region: 0x166, script: 0x5b, flags: 0x0}, 46: {region: 0x166, script: 0x5b, flags: 0x0}, 47: {region: 0x166, script: 0x5b, flags: 0x0}, 48: {region: 0x166, script: 0x5b, flags: 0x0}, 49: {region: 0x166, script: 0x5b, flags: 0x0}, 50: {region: 0x166, script: 0x5b, flags: 0x0}, 51: {region: 0x96, script: 0x5b, flags: 0x0}, 52: {region: 0x166, script: 0x5, flags: 0x0}, 53: {region: 0x123, script: 0x5, flags: 0x0}, 54: {region: 0x166, script: 0x5b, flags: 0x0}, 55: {region: 0x166, script: 0x5b, flags: 0x0}, 56: {region: 0x166, script: 0x5b, flags: 0x0}, 57: {region: 0x166, script: 0x5b, flags: 0x0}, 58: {region: 0x6c, script: 0x5, flags: 0x0}, 59: {region: 0x0, script: 0x3, flags: 0x1}, 60: {region: 0x166, script: 0x5b, flags: 0x0}, 61: {region: 0x51, script: 0x5b, flags: 0x0}, 62: {region: 0x3f, script: 0x5b, flags: 0x0}, 63: {region: 0x68, script: 0x5, flags: 0x0}, 65: {region: 0xbb, script: 0x5, flags: 0x0}, 66: {region: 0x6c, script: 0x5, flags: 0x0}, 67: {region: 0x9a, script: 0xe, flags: 0x0}, 68: {region: 0x130, script: 0x5b, flags: 0x0}, 69: {region: 0x136, script: 0xd0, flags: 0x0}, 70: {region: 0x166, script: 0x5b, flags: 0x0}, 71: {region: 0x166, script: 0x5b, flags: 0x0}, 72: {region: 0x6f, script: 0x5b, flags: 0x0}, 73: {region: 0x166, script: 0x5b, flags: 0x0}, 74: {region: 0x166, script: 0x5b, flags: 0x0}, 75: {region: 0x49, script: 0x5b, flags: 0x0}, 76: {region: 0x166, script: 0x5b, flags: 0x0}, 77: {region: 0x107, script: 0x20, flags: 0x0}, 78: {region: 0x166, script: 0x5, flags: 0x0}, 79: {region: 0x166, script: 0x5b, flags: 0x0}, 80: {region: 0x166, script: 0x5b, flags: 0x0}, 81: {region: 0x166, script: 0x5b, flags: 0x0}, 82: {region: 0x9a, script: 0x22, flags: 0x0}, 83: {region: 0x166, script: 0x5b, flags: 0x0}, 84: {region: 0x166, script: 0x5b, flags: 0x0}, 85: {region: 0x166, script: 0x5b, flags: 0x0}, 86: {region: 0x3f, script: 0x5b, flags: 0x0}, 87: {region: 0x166, script: 0x5b, flags: 0x0}, 88: {region: 0x3, script: 0x5, flags: 0x1}, 89: {region: 0x107, script: 0x20, flags: 0x0}, 90: {region: 0xe9, script: 0x5, flags: 0x0}, 91: {region: 0x96, script: 0x5b, flags: 0x0}, 92: {region: 0xdc, script: 0x22, flags: 0x0}, 93: {region: 0x2e, script: 0x5b, flags: 0x0}, 94: {region: 0x52, script: 0x5b, flags: 0x0}, 95: {region: 0x166, script: 0x5b, flags: 0x0}, 96: {region: 0x52, script: 0xb, flags: 0x0}, 97: {region: 0x166, script: 0x5b, flags: 0x0}, 98: {region: 0x166, script: 0x5b, flags: 0x0}, 99: {region: 0x96, script: 0x5b, flags: 0x0}, 100: {region: 0x166, script: 0x5b, flags: 0x0}, 101: {region: 0x52, script: 0x5b, flags: 0x0}, 102: {region: 0x166, script: 0x5b, flags: 0x0}, 103: {region: 0x166, script: 0x5b, flags: 0x0}, 104: {region: 0x166, script: 0x5b, flags: 0x0}, 105: {region: 0x166, script: 0x5b, flags: 0x0}, 106: {region: 0x4f, script: 0x5b, flags: 0x0}, 107: {region: 0x166, script: 0x5b, flags: 0x0}, 108: {region: 0x166, script: 0x5b, flags: 0x0}, 109: {region: 0x166, script: 0x5b, flags: 0x0}, 110: {region: 0x166, script: 0x2c, flags: 0x0}, 111: {region: 0x166, script: 0x5b, flags: 0x0}, 112: {region: 0x166, script: 0x5b, flags: 0x0}, 113: {region: 0x47, script: 0x20, flags: 0x0}, 114: {region: 0x166, script: 0x5b, flags: 0x0}, 115: {region: 0x166, script: 0x5b, flags: 0x0}, 116: {region: 0x10c, script: 0x5, flags: 0x0}, 117: {region: 0x163, script: 0x5b, flags: 0x0}, 118: {region: 0x166, script: 0x5b, flags: 0x0}, 119: {region: 0x96, script: 0x5b, flags: 0x0}, 120: {region: 0x166, script: 0x5b, flags: 0x0}, 121: {region: 0x130, script: 0x5b, flags: 0x0}, 122: {region: 0x52, script: 0x5b, flags: 0x0}, 123: {region: 0x9a, script: 0xe6, flags: 0x0}, 124: {region: 0xe9, script: 0x5, flags: 0x0}, 125: {region: 0x9a, script: 0x22, flags: 0x0}, 126: {region: 0x38, script: 0x20, flags: 0x0}, 127: {region: 0x9a, script: 0x22, flags: 0x0}, 128: {region: 0xe9, script: 0x5, flags: 0x0}, 129: {region: 0x12c, script: 0x34, flags: 0x0}, 131: {region: 0x9a, script: 0x22, flags: 0x0}, 132: {region: 0x166, script: 0x5b, flags: 0x0}, 133: {region: 0x9a, script: 0x22, flags: 0x0}, 134: {region: 0xe8, script: 0x5b, flags: 0x0}, 135: {region: 0x166, script: 0x5b, flags: 0x0}, 136: {region: 0x9a, script: 0x22, flags: 0x0}, 137: {region: 0x166, script: 0x5b, flags: 0x0}, 138: {region: 0x140, script: 0x5b, flags: 0x0}, 139: {region: 0x166, script: 0x5b, flags: 0x0}, 140: {region: 0x166, script: 0x5b, flags: 0x0}, 141: {region: 0xe8, script: 0x5b, flags: 0x0}, 142: {region: 0x166, script: 0x5b, flags: 0x0}, 143: {region: 0xd7, script: 0x5b, flags: 0x0}, 144: {region: 0x166, script: 0x5b, flags: 0x0}, 145: {region: 0x166, script: 0x5b, flags: 0x0}, 146: {region: 0x166, script: 0x5b, flags: 0x0}, 147: {region: 0x166, script: 0x2c, flags: 0x0}, 148: {region: 0x9a, script: 0x22, flags: 0x0}, 149: {region: 0x96, script: 0x5b, flags: 0x0}, 150: {region: 0x166, script: 0x5b, flags: 0x0}, 151: {region: 0x166, script: 0x5b, flags: 0x0}, 152: {region: 0x115, script: 0x5b, flags: 0x0}, 153: {region: 0x166, script: 0x5b, flags: 0x0}, 154: {region: 0x166, script: 0x5b, flags: 0x0}, 155: {region: 0x52, script: 0x5b, flags: 0x0}, 156: {region: 0x166, script: 0x5b, flags: 0x0}, 157: {region: 0xe8, script: 0x5b, flags: 0x0}, 158: {region: 0x166, script: 0x5b, flags: 0x0}, 159: {region: 0x13f, script: 0xe8, flags: 0x0}, 160: {region: 0xc4, script: 0x5b, flags: 0x0}, 161: {region: 0x166, script: 0x5b, flags: 0x0}, 162: {region: 0x166, script: 0x5b, flags: 0x0}, 163: {region: 0xc4, script: 0x5b, flags: 0x0}, 164: {region: 0x166, script: 0x5b, flags: 0x0}, 165: {region: 0x35, script: 0xe, flags: 0x0}, 166: {region: 0x166, script: 0x5b, flags: 0x0}, 167: {region: 0x166, script: 0x5b, flags: 0x0}, 168: {region: 0x166, script: 0x5b, flags: 0x0}, 169: {region: 0x53, script: 0xef, flags: 0x0}, 170: {region: 0x166, script: 0x5b, flags: 0x0}, 171: {region: 0x166, script: 0x5b, flags: 0x0}, 172: {region: 0x166, script: 0x5b, flags: 0x0}, 173: {region: 0x9a, script: 0xe, flags: 0x0}, 174: {region: 0x166, script: 0x5b, flags: 0x0}, 175: {region: 0x9d, script: 0x5, flags: 0x0}, 176: {region: 0x166, script: 0x5b, flags: 0x0}, 177: {region: 0x4f, script: 0x5b, flags: 0x0}, 178: {region: 0x79, script: 0x5b, flags: 0x0}, 179: {region: 0x9a, script: 0x22, flags: 0x0}, 180: {region: 0xe9, script: 0x5, flags: 0x0}, 181: {region: 0x9a, script: 0x22, flags: 0x0}, 182: {region: 0x166, script: 0x5b, flags: 0x0}, 183: {region: 0x33, script: 0x5b, flags: 0x0}, 184: {region: 0x166, script: 0x5b, flags: 0x0}, 185: {region: 0xb5, script: 0xc, flags: 0x0}, 186: {region: 0x52, script: 0x5b, flags: 0x0}, 187: {region: 0x166, script: 0x2c, flags: 0x0}, 188: {region: 0xe8, script: 0x5b, flags: 0x0}, 189: {region: 0x166, script: 0x5b, flags: 0x0}, 190: {region: 0xe9, script: 0x22, flags: 0x0}, 191: {region: 0x107, script: 0x20, flags: 0x0}, 192: {region: 0x160, script: 0x5b, flags: 0x0}, 193: {region: 0x166, script: 0x5b, flags: 0x0}, 194: {region: 0x96, script: 0x5b, flags: 0x0}, 195: {region: 0x166, script: 0x5b, flags: 0x0}, 196: {region: 0x52, script: 0x5b, flags: 0x0}, 197: {region: 0x166, script: 0x5b, flags: 0x0}, 198: {region: 0x166, script: 0x5b, flags: 0x0}, 199: {region: 0x166, script: 0x5b, flags: 0x0}, 200: {region: 0x87, script: 0x5b, flags: 0x0}, 201: {region: 0x166, script: 0x5b, flags: 0x0}, 202: {region: 0x166, script: 0x5b, flags: 0x0}, 203: {region: 0x166, script: 0x5b, flags: 0x0}, 204: {region: 0x166, script: 0x5b, flags: 0x0}, 205: {region: 0x6e, script: 0x2c, flags: 0x0}, 206: {region: 0x166, script: 0x5b, flags: 0x0}, 207: {region: 0x166, script: 0x5b, flags: 0x0}, 208: {region: 0x52, script: 0x5b, flags: 0x0}, 209: {region: 0x166, script: 0x5b, flags: 0x0}, 210: {region: 0x166, script: 0x5b, flags: 0x0}, 211: {region: 0xc4, script: 0x5b, flags: 0x0}, 212: {region: 0x166, script: 0x5b, flags: 0x0}, 213: {region: 0x166, script: 0x5b, flags: 0x0}, 214: {region: 0x166, script: 0x5b, flags: 0x0}, 215: {region: 0x6f, script: 0x5b, flags: 0x0}, 216: {region: 0x166, script: 0x5b, flags: 0x0}, 217: {region: 0x166, script: 0x5b, flags: 0x0}, 218: {region: 0xd7, script: 0x5b, flags: 0x0}, 219: {region: 0x35, script: 0x16, flags: 0x0}, 220: {region: 0x107, script: 0x20, flags: 0x0}, 221: {region: 0xe8, script: 0x5b, flags: 0x0}, 222: {region: 0x166, script: 0x5b, flags: 0x0}, 223: {region: 0x132, script: 0x5b, flags: 0x0}, 224: {region: 0x8b, script: 0x5b, flags: 0x0}, 225: {region: 0x76, script: 0x5b, flags: 0x0}, 226: {region: 0x107, script: 0x20, flags: 0x0}, 227: {region: 0x136, script: 0x5b, flags: 0x0}, 228: {region: 0x49, script: 0x5b, flags: 0x0}, 229: {region: 0x136, script: 0x1a, flags: 0x0}, 230: {region: 0xa7, script: 0x5, flags: 0x0}, 231: {region: 0x13f, script: 0x19, flags: 0x0}, 232: {region: 0x166, script: 0x5b, flags: 0x0}, 233: {region: 0x9c, script: 0x5, flags: 0x0}, 234: {region: 0x166, script: 0x5b, flags: 0x0}, 235: {region: 0x166, script: 0x5b, flags: 0x0}, 236: {region: 0x166, script: 0x5b, flags: 0x0}, 237: {region: 0x166, script: 0x5b, flags: 0x0}, 238: {region: 0x166, script: 0x5b, flags: 0x0}, 239: {region: 0xc6, script: 0xda, flags: 0x0}, 240: {region: 0x79, script: 0x5b, flags: 0x0}, 241: {region: 0x6c, script: 0x1d, flags: 0x0}, 242: {region: 0xe8, script: 0x5b, flags: 0x0}, 243: {region: 0x49, script: 0x17, flags: 0x0}, 244: {region: 0x131, script: 0x20, flags: 0x0}, 245: {region: 0x49, script: 0x17, flags: 0x0}, 246: {region: 0x49, script: 0x17, flags: 0x0}, 247: {region: 0x49, script: 0x17, flags: 0x0}, 248: {region: 0x49, script: 0x17, flags: 0x0}, 249: {region: 0x10b, script: 0x5b, flags: 0x0}, 250: {region: 0x5f, script: 0x5b, flags: 0x0}, 251: {region: 0xea, script: 0x5b, flags: 0x0}, 252: {region: 0x49, script: 0x17, flags: 0x0}, 253: {region: 0xc5, script: 0x88, flags: 0x0}, 254: {region: 0x8, script: 0x2, flags: 0x1}, 255: {region: 0x107, script: 0x20, flags: 0x0}, 256: {region: 0x7c, script: 0x5b, flags: 0x0}, 257: {region: 0x64, script: 0x5b, flags: 0x0}, 258: {region: 0x166, script: 0x5b, flags: 0x0}, 259: {region: 0x166, script: 0x5b, flags: 0x0}, 260: {region: 0x166, script: 0x5b, flags: 0x0}, 261: {region: 0x166, script: 0x5b, flags: 0x0}, 262: {region: 0x136, script: 0x5b, flags: 0x0}, 263: {region: 0x107, script: 0x20, flags: 0x0}, 264: {region: 0xa5, script: 0x5b, flags: 0x0}, 265: {region: 0x166, script: 0x5b, flags: 0x0}, 266: {region: 0x166, script: 0x5b, flags: 0x0}, 267: {region: 0x9a, script: 0x5, flags: 0x0}, 268: {region: 0x166, script: 0x5b, flags: 0x0}, 269: {region: 0x61, script: 0x5b, flags: 0x0}, 270: {region: 0x166, script: 0x5b, flags: 0x0}, 271: {region: 0x49, script: 0x5b, flags: 0x0}, 272: {region: 0x166, script: 0x5b, flags: 0x0}, 273: {region: 0x166, script: 0x5b, flags: 0x0}, 274: {region: 0x166, script: 0x5b, flags: 0x0}, 275: {region: 0x166, script: 0x5, flags: 0x0}, 276: {region: 0x49, script: 0x5b, flags: 0x0}, 277: {region: 0x166, script: 0x5b, flags: 0x0}, 278: {region: 0x166, script: 0x5b, flags: 0x0}, 279: {region: 0xd5, script: 0x5b, flags: 0x0}, 280: {region: 0x4f, script: 0x5b, flags: 0x0}, 281: {region: 0x166, script: 0x5b, flags: 0x0}, 282: {region: 0x9a, script: 0x5, flags: 0x0}, 283: {region: 0x166, script: 0x5b, flags: 0x0}, 284: {region: 0x166, script: 0x5b, flags: 0x0}, 285: {region: 0x166, script: 0x5b, flags: 0x0}, 286: {region: 0x166, script: 0x2c, flags: 0x0}, 287: {region: 0x61, script: 0x5b, flags: 0x0}, 288: {region: 0xc4, script: 0x5b, flags: 0x0}, 289: {region: 0xd1, script: 0x5b, flags: 0x0}, 290: {region: 0x166, script: 0x5b, flags: 0x0}, 291: {region: 0xdc, script: 0x22, flags: 0x0}, 292: {region: 0x52, script: 0x5b, flags: 0x0}, 293: {region: 0x166, script: 0x5b, flags: 0x0}, 294: {region: 0x166, script: 0x5b, flags: 0x0}, 295: {region: 0x166, script: 0x5b, flags: 0x0}, 296: {region: 0xce, script: 0xed, flags: 0x0}, 297: {region: 0x166, script: 0x5b, flags: 0x0}, 298: {region: 0x166, script: 0x5b, flags: 0x0}, 299: {region: 0x115, script: 0x5b, flags: 0x0}, 300: {region: 0x37, script: 0x5b, flags: 0x0}, 301: {region: 0x43, script: 0xef, flags: 0x0}, 302: {region: 0x166, script: 0x5b, flags: 0x0}, 303: {region: 0xa5, script: 0x5b, flags: 0x0}, 304: {region: 0x81, script: 0x5b, flags: 0x0}, 305: {region: 0xd7, script: 0x5b, flags: 0x0}, 306: {region: 0x9f, script: 0x5b, flags: 0x0}, 307: {region: 0x6c, script: 0x29, flags: 0x0}, 308: {region: 0x166, script: 0x5b, flags: 0x0}, 309: {region: 0xc5, script: 0x4b, flags: 0x0}, 310: {region: 0x88, script: 0x34, flags: 0x0}, 311: {region: 0x166, script: 0x5b, flags: 0x0}, 312: {region: 0x166, script: 0x5b, flags: 0x0}, 313: {region: 0xa, script: 0x2, flags: 0x1}, 314: {region: 0x166, script: 0x5b, flags: 0x0}, 315: {region: 0x166, script: 0x5b, flags: 0x0}, 316: {region: 0x1, script: 0x5b, flags: 0x0}, 317: {region: 0x166, script: 0x5b, flags: 0x0}, 318: {region: 0x6f, script: 0x5b, flags: 0x0}, 319: {region: 0x136, script: 0x5b, flags: 0x0}, 320: {region: 0x6b, script: 0x5b, flags: 0x0}, 321: {region: 0x166, script: 0x5b, flags: 0x0}, 322: {region: 0x9f, script: 0x46, flags: 0x0}, 323: {region: 0x166, script: 0x5b, flags: 0x0}, 324: {region: 0x166, script: 0x5b, flags: 0x0}, 325: {region: 0x6f, script: 0x5b, flags: 0x0}, 326: {region: 0x52, script: 0x5b, flags: 0x0}, 327: {region: 0x6f, script: 0x5b, flags: 0x0}, 328: {region: 0x9d, script: 0x5, flags: 0x0}, 329: {region: 0x166, script: 0x5b, flags: 0x0}, 330: {region: 0x166, script: 0x5b, flags: 0x0}, 331: {region: 0x166, script: 0x5b, flags: 0x0}, 332: {region: 0x166, script: 0x5b, flags: 0x0}, 333: {region: 0x87, script: 0x5b, flags: 0x0}, 334: {region: 0xc, script: 0x2, flags: 0x1}, 335: {region: 0x166, script: 0x5b, flags: 0x0}, 336: {region: 0xc4, script: 0x5b, flags: 0x0}, 337: {region: 0x73, script: 0x5b, flags: 0x0}, 338: {region: 0x10c, script: 0x5, flags: 0x0}, 339: {region: 0xe8, script: 0x5b, flags: 0x0}, 340: {region: 0x10d, script: 0x5b, flags: 0x0}, 341: {region: 0x74, script: 0x5b, flags: 0x0}, 342: {region: 0x166, script: 0x5b, flags: 0x0}, 343: {region: 0x166, script: 0x5b, flags: 0x0}, 344: {region: 0x77, script: 0x5b, flags: 0x0}, 345: {region: 0x166, script: 0x5b, flags: 0x0}, 346: {region: 0x3b, script: 0x5b, flags: 0x0}, 347: {region: 0x166, script: 0x5b, flags: 0x0}, 348: {region: 0x166, script: 0x5b, flags: 0x0}, 349: {region: 0x166, script: 0x5b, flags: 0x0}, 350: {region: 0x79, script: 0x5b, flags: 0x0}, 351: {region: 0x136, script: 0x5b, flags: 0x0}, 352: {region: 0x79, script: 0x5b, flags: 0x0}, 353: {region: 0x61, script: 0x5b, flags: 0x0}, 354: {region: 0x61, script: 0x5b, flags: 0x0}, 355: {region: 0x52, script: 0x5, flags: 0x0}, 356: {region: 0x141, script: 0x5b, flags: 0x0}, 357: {region: 0x166, script: 0x5b, flags: 0x0}, 358: {region: 0x85, script: 0x5b, flags: 0x0}, 359: {region: 0x166, script: 0x5b, flags: 0x0}, 360: {region: 0xd5, script: 0x5b, flags: 0x0}, 361: {region: 0x9f, script: 0x5b, flags: 0x0}, 362: {region: 0xd7, script: 0x5b, flags: 0x0}, 363: {region: 0x166, script: 0x5b, flags: 0x0}, 364: {region: 0x10c, script: 0x5b, flags: 0x0}, 365: {region: 0xda, script: 0x5b, flags: 0x0}, 366: {region: 0x97, script: 0x5b, flags: 0x0}, 367: {region: 0x81, script: 0x5b, flags: 0x0}, 368: {region: 0x166, script: 0x5b, flags: 0x0}, 369: {region: 0xbd, script: 0x5b, flags: 0x0}, 370: {region: 0x166, script: 0x5b, flags: 0x0}, 371: {region: 0x166, script: 0x5b, flags: 0x0}, 372: {region: 0x166, script: 0x5b, flags: 0x0}, 373: {region: 0x53, script: 0x3b, flags: 0x0}, 374: {region: 0x166, script: 0x5b, flags: 0x0}, 375: {region: 0x96, script: 0x5b, flags: 0x0}, 376: {region: 0x166, script: 0x5b, flags: 0x0}, 377: {region: 0x166, script: 0x5b, flags: 0x0}, 378: {region: 0x9a, script: 0x22, flags: 0x0}, 379: {region: 0x166, script: 0x5b, flags: 0x0}, 380: {region: 0x9d, script: 0x5, flags: 0x0}, 381: {region: 0x7f, script: 0x5b, flags: 0x0}, 382: {region: 0x7c, script: 0x5b, flags: 0x0}, 383: {region: 0x166, script: 0x5b, flags: 0x0}, 384: {region: 0x166, script: 0x5b, flags: 0x0}, 385: {region: 0x166, script: 0x5b, flags: 0x0}, 386: {region: 0x166, script: 0x5b, flags: 0x0}, 387: {region: 0x166, script: 0x5b, flags: 0x0}, 388: {region: 0x166, script: 0x5b, flags: 0x0}, 389: {region: 0x70, script: 0x2c, flags: 0x0}, 390: {region: 0x166, script: 0x5b, flags: 0x0}, 391: {region: 0xdc, script: 0x22, flags: 0x0}, 392: {region: 0x166, script: 0x5b, flags: 0x0}, 393: {region: 0xa8, script: 0x5b, flags: 0x0}, 394: {region: 0x166, script: 0x5b, flags: 0x0}, 395: {region: 0xe9, script: 0x5, flags: 0x0}, 396: {region: 0x166, script: 0x5b, flags: 0x0}, 397: {region: 0xe9, script: 0x5, flags: 0x0}, 398: {region: 0x166, script: 0x5b, flags: 0x0}, 399: {region: 0x166, script: 0x5b, flags: 0x0}, 400: {region: 0x6f, script: 0x5b, flags: 0x0}, 401: {region: 0x9d, script: 0x5, flags: 0x0}, 402: {region: 0x166, script: 0x5b, flags: 0x0}, 403: {region: 0x166, script: 0x2c, flags: 0x0}, 404: {region: 0xf2, script: 0x5b, flags: 0x0}, 405: {region: 0x166, script: 0x5b, flags: 0x0}, 406: {region: 0x166, script: 0x5b, flags: 0x0}, 407: {region: 0x166, script: 0x5b, flags: 0x0}, 408: {region: 0x166, script: 0x2c, flags: 0x0}, 409: {region: 0x166, script: 0x5b, flags: 0x0}, 410: {region: 0x9a, script: 0x22, flags: 0x0}, 411: {region: 0x9a, script: 0xe9, flags: 0x0}, 412: {region: 0x96, script: 0x5b, flags: 0x0}, 413: {region: 0xda, script: 0x5b, flags: 0x0}, 414: {region: 0x131, script: 0x32, flags: 0x0}, 415: {region: 0x166, script: 0x5b, flags: 0x0}, 416: {region: 0xe, script: 0x2, flags: 0x1}, 417: {region: 0x9a, script: 0xe, flags: 0x0}, 418: {region: 0x166, script: 0x5b, flags: 0x0}, 419: {region: 0x4e, script: 0x5b, flags: 0x0}, 420: {region: 0x9a, script: 0x35, flags: 0x0}, 421: {region: 0x41, script: 0x5b, flags: 0x0}, 422: {region: 0x54, script: 0x5b, flags: 0x0}, 423: {region: 0x166, script: 0x5b, flags: 0x0}, 424: {region: 0x81, script: 0x5b, flags: 0x0}, 425: {region: 0x166, script: 0x5b, flags: 0x0}, 426: {region: 0x166, script: 0x5b, flags: 0x0}, 427: {region: 0xa5, script: 0x5b, flags: 0x0}, 428: {region: 0x99, script: 0x5b, flags: 0x0}, 429: {region: 0x166, script: 0x5b, flags: 0x0}, 430: {region: 0xdc, script: 0x22, flags: 0x0}, 431: {region: 0x166, script: 0x5b, flags: 0x0}, 432: {region: 0x166, script: 0x5, flags: 0x0}, 433: {region: 0x49, script: 0x5b, flags: 0x0}, 434: {region: 0x166, script: 0x5, flags: 0x0}, 435: {region: 0x166, script: 0x5b, flags: 0x0}, 436: {region: 0x10, script: 0x3, flags: 0x1}, 437: {region: 0x166, script: 0x5b, flags: 0x0}, 438: {region: 0x53, script: 0x3b, flags: 0x0}, 439: {region: 0x166, script: 0x5b, flags: 0x0}, 440: {region: 0x136, script: 0x5b, flags: 0x0}, 441: {region: 0x24, script: 0x5, flags: 0x0}, 442: {region: 0x166, script: 0x5b, flags: 0x0}, 443: {region: 0x166, script: 0x2c, flags: 0x0}, 444: {region: 0x98, script: 0x3e, flags: 0x0}, 445: {region: 0x166, script: 0x5b, flags: 0x0}, 446: {region: 0x9a, script: 0x22, flags: 0x0}, 447: {region: 0x166, script: 0x5b, flags: 0x0}, 448: {region: 0x74, script: 0x5b, flags: 0x0}, 449: {region: 0x166, script: 0x5b, flags: 0x0}, 450: {region: 0x166, script: 0x5b, flags: 0x0}, 451: {region: 0xe8, script: 0x5b, flags: 0x0}, 452: {region: 0x166, script: 0x5b, flags: 0x0}, 453: {region: 0x12c, script: 0x40, flags: 0x0}, 454: {region: 0x53, script: 0x92, flags: 0x0}, 455: {region: 0x166, script: 0x5b, flags: 0x0}, 456: {region: 0xe9, script: 0x5, flags: 0x0}, 457: {region: 0x9a, script: 0x22, flags: 0x0}, 458: {region: 0xb0, script: 0x41, flags: 0x0}, 459: {region: 0xe8, script: 0x5b, flags: 0x0}, 460: {region: 0xe9, script: 0x5, flags: 0x0}, 461: {region: 0xe7, script: 0x5b, flags: 0x0}, 462: {region: 0x9a, script: 0x22, flags: 0x0}, 463: {region: 0x9a, script: 0x22, flags: 0x0}, 464: {region: 0x166, script: 0x5b, flags: 0x0}, 465: {region: 0x91, script: 0x5b, flags: 0x0}, 466: {region: 0x61, script: 0x5b, flags: 0x0}, 467: {region: 0x53, script: 0x3b, flags: 0x0}, 468: {region: 0x92, script: 0x5b, flags: 0x0}, 469: {region: 0x93, script: 0x5b, flags: 0x0}, 470: {region: 0x166, script: 0x5b, flags: 0x0}, 471: {region: 0x28, script: 0x8, flags: 0x0}, 472: {region: 0xd3, script: 0x5b, flags: 0x0}, 473: {region: 0x79, script: 0x5b, flags: 0x0}, 474: {region: 0x166, script: 0x5b, flags: 0x0}, 475: {region: 0x166, script: 0x5b, flags: 0x0}, 476: {region: 0xd1, script: 0x5b, flags: 0x0}, 477: {region: 0xd7, script: 0x5b, flags: 0x0}, 478: {region: 0x166, script: 0x5b, flags: 0x0}, 479: {region: 0x166, script: 0x5b, flags: 0x0}, 480: {region: 0x166, script: 0x5b, flags: 0x0}, 481: {region: 0x96, script: 0x5b, flags: 0x0}, 482: {region: 0x166, script: 0x5b, flags: 0x0}, 483: {region: 0x166, script: 0x5b, flags: 0x0}, 484: {region: 0x166, script: 0x5b, flags: 0x0}, 486: {region: 0x123, script: 0x5b, flags: 0x0}, 487: {region: 0xd7, script: 0x5b, flags: 0x0}, 488: {region: 0x166, script: 0x5b, flags: 0x0}, 489: {region: 0x166, script: 0x5b, flags: 0x0}, 490: {region: 0x53, script: 0xfd, flags: 0x0}, 491: {region: 0x166, script: 0x5b, flags: 0x0}, 492: {region: 0x136, script: 0x5b, flags: 0x0}, 493: {region: 0x166, script: 0x5b, flags: 0x0}, 494: {region: 0x49, script: 0x5b, flags: 0x0}, 495: {region: 0x166, script: 0x5b, flags: 0x0}, 496: {region: 0x166, script: 0x5b, flags: 0x0}, 497: {region: 0xe8, script: 0x5b, flags: 0x0}, 498: {region: 0x166, script: 0x5b, flags: 0x0}, 499: {region: 0x96, script: 0x5b, flags: 0x0}, 500: {region: 0x107, script: 0x20, flags: 0x0}, 501: {region: 0x1, script: 0x5b, flags: 0x0}, 502: {region: 0x166, script: 0x5b, flags: 0x0}, 503: {region: 0x166, script: 0x5b, flags: 0x0}, 504: {region: 0x9e, script: 0x5b, flags: 0x0}, 505: {region: 0x9f, script: 0x5b, flags: 0x0}, 506: {region: 0x49, script: 0x17, flags: 0x0}, 507: {region: 0x98, script: 0x3e, flags: 0x0}, 508: {region: 0x166, script: 0x5b, flags: 0x0}, 509: {region: 0x166, script: 0x5b, flags: 0x0}, 510: {region: 0x107, script: 0x5b, flags: 0x0}, 511: {region: 0x166, script: 0x5b, flags: 0x0}, 512: {region: 0xa3, script: 0x49, flags: 0x0}, 513: {region: 0x166, script: 0x5b, flags: 0x0}, 514: {region: 0xa1, script: 0x5b, flags: 0x0}, 515: {region: 0x1, script: 0x5b, flags: 0x0}, 516: {region: 0x166, script: 0x5b, flags: 0x0}, 517: {region: 0x166, script: 0x5b, flags: 0x0}, 518: {region: 0x166, script: 0x5b, flags: 0x0}, 519: {region: 0x52, script: 0x5b, flags: 0x0}, 520: {region: 0x131, script: 0x3e, flags: 0x0}, 521: {region: 0x166, script: 0x5b, flags: 0x0}, 522: {region: 0x130, script: 0x5b, flags: 0x0}, 523: {region: 0xdc, script: 0x22, flags: 0x0}, 524: {region: 0x166, script: 0x5b, flags: 0x0}, 525: {region: 0x64, script: 0x5b, flags: 0x0}, 526: {region: 0x96, script: 0x5b, flags: 0x0}, 527: {region: 0x96, script: 0x5b, flags: 0x0}, 528: {region: 0x7e, script: 0x2e, flags: 0x0}, 529: {region: 0x138, script: 0x20, flags: 0x0}, 530: {region: 0x68, script: 0x5b, flags: 0x0}, 531: {region: 0xc5, script: 0x5b, flags: 0x0}, 532: {region: 0x166, script: 0x5b, flags: 0x0}, 533: {region: 0x166, script: 0x5b, flags: 0x0}, 534: {region: 0xd7, script: 0x5b, flags: 0x0}, 535: {region: 0xa5, script: 0x5b, flags: 0x0}, 536: {region: 0xc4, script: 0x5b, flags: 0x0}, 537: {region: 0x107, script: 0x20, flags: 0x0}, 538: {region: 0x166, script: 0x5b, flags: 0x0}, 539: {region: 0x166, script: 0x5b, flags: 0x0}, 540: {region: 0x166, script: 0x5b, flags: 0x0}, 541: {region: 0x166, script: 0x5b, flags: 0x0}, 542: {region: 0xd5, script: 0x5, flags: 0x0}, 543: {region: 0xd7, script: 0x5b, flags: 0x0}, 544: {region: 0x165, script: 0x5b, flags: 0x0}, 545: {region: 0x166, script: 0x5b, flags: 0x0}, 546: {region: 0x166, script: 0x5b, flags: 0x0}, 547: {region: 0x130, script: 0x5b, flags: 0x0}, 548: {region: 0x123, script: 0x5, flags: 0x0}, 549: {region: 0x166, script: 0x5b, flags: 0x0}, 550: {region: 0x124, script: 0xee, flags: 0x0}, 551: {region: 0x5b, script: 0x5b, flags: 0x0}, 552: {region: 0x52, script: 0x5b, flags: 0x0}, 553: {region: 0x166, script: 0x5b, flags: 0x0}, 554: {region: 0x4f, script: 0x5b, flags: 0x0}, 555: {region: 0x9a, script: 0x22, flags: 0x0}, 556: {region: 0x9a, script: 0x22, flags: 0x0}, 557: {region: 0x4b, script: 0x5b, flags: 0x0}, 558: {region: 0x96, script: 0x5b, flags: 0x0}, 559: {region: 0x166, script: 0x5b, flags: 0x0}, 560: {region: 0x41, script: 0x5b, flags: 0x0}, 561: {region: 0x9a, script: 0x5b, flags: 0x0}, 562: {region: 0x53, script: 0xe5, flags: 0x0}, 563: {region: 0x9a, script: 0x22, flags: 0x0}, 564: {region: 0xc4, script: 0x5b, flags: 0x0}, 565: {region: 0x166, script: 0x5b, flags: 0x0}, 566: {region: 0x9a, script: 0x76, flags: 0x0}, 567: {region: 0xe9, script: 0x5, flags: 0x0}, 568: {region: 0x166, script: 0x5b, flags: 0x0}, 569: {region: 0xa5, script: 0x5b, flags: 0x0}, 570: {region: 0x166, script: 0x5b, flags: 0x0}, 571: {region: 0x12c, script: 0x5b, flags: 0x0}, 572: {region: 0x166, script: 0x5b, flags: 0x0}, 573: {region: 0xd3, script: 0x5b, flags: 0x0}, 574: {region: 0x166, script: 0x5b, flags: 0x0}, 575: {region: 0xb0, script: 0x58, flags: 0x0}, 576: {region: 0x166, script: 0x5b, flags: 0x0}, 577: {region: 0x166, script: 0x5b, flags: 0x0}, 578: {region: 0x13, script: 0x6, flags: 0x1}, 579: {region: 0x166, script: 0x5b, flags: 0x0}, 580: {region: 0x52, script: 0x5b, flags: 0x0}, 581: {region: 0x83, script: 0x5b, flags: 0x0}, 582: {region: 0xa5, script: 0x5b, flags: 0x0}, 583: {region: 0x166, script: 0x5b, flags: 0x0}, 584: {region: 0x166, script: 0x5b, flags: 0x0}, 585: {region: 0x166, script: 0x5b, flags: 0x0}, 586: {region: 0xa7, script: 0x4f, flags: 0x0}, 587: {region: 0x2a, script: 0x5b, flags: 0x0}, 588: {region: 0x166, script: 0x5b, flags: 0x0}, 589: {region: 0x166, script: 0x5b, flags: 0x0}, 590: {region: 0x166, script: 0x5b, flags: 0x0}, 591: {region: 0x166, script: 0x5b, flags: 0x0}, 592: {region: 0x166, script: 0x5b, flags: 0x0}, 593: {region: 0x9a, script: 0x53, flags: 0x0}, 594: {region: 0x8c, script: 0x5b, flags: 0x0}, 595: {region: 0x166, script: 0x5b, flags: 0x0}, 596: {region: 0xac, script: 0x54, flags: 0x0}, 597: {region: 0x107, script: 0x20, flags: 0x0}, 598: {region: 0x9a, script: 0x22, flags: 0x0}, 599: {region: 0x166, script: 0x5b, flags: 0x0}, 600: {region: 0x76, script: 0x5b, flags: 0x0}, 601: {region: 0x166, script: 0x5b, flags: 0x0}, 602: {region: 0xb5, script: 0x5b, flags: 0x0}, 603: {region: 0x166, script: 0x5b, flags: 0x0}, 604: {region: 0x166, script: 0x5b, flags: 0x0}, 605: {region: 0x166, script: 0x5b, flags: 0x0}, 606: {region: 0x166, script: 0x5b, flags: 0x0}, 607: {region: 0x166, script: 0x5b, flags: 0x0}, 608: {region: 0x166, script: 0x5b, flags: 0x0}, 609: {region: 0x166, script: 0x5b, flags: 0x0}, 610: {region: 0x166, script: 0x2c, flags: 0x0}, 611: {region: 0x166, script: 0x5b, flags: 0x0}, 612: {region: 0x107, script: 0x20, flags: 0x0}, 613: {region: 0x113, script: 0x5b, flags: 0x0}, 614: {region: 0xe8, script: 0x5b, flags: 0x0}, 615: {region: 0x107, script: 0x5b, flags: 0x0}, 616: {region: 0x166, script: 0x5b, flags: 0x0}, 617: {region: 0x9a, script: 0x22, flags: 0x0}, 618: {region: 0x9a, script: 0x5, flags: 0x0}, 619: {region: 0x130, script: 0x5b, flags: 0x0}, 620: {region: 0x166, script: 0x5b, flags: 0x0}, 621: {region: 0x52, script: 0x5b, flags: 0x0}, 622: {region: 0x61, script: 0x5b, flags: 0x0}, 623: {region: 0x166, script: 0x5b, flags: 0x0}, 624: {region: 0x166, script: 0x5b, flags: 0x0}, 625: {region: 0x166, script: 0x2c, flags: 0x0}, 626: {region: 0x166, script: 0x5b, flags: 0x0}, 627: {region: 0x166, script: 0x5b, flags: 0x0}, 628: {region: 0x19, script: 0x3, flags: 0x1}, 629: {region: 0x166, script: 0x5b, flags: 0x0}, 630: {region: 0x166, script: 0x5b, flags: 0x0}, 631: {region: 0x166, script: 0x5b, flags: 0x0}, 632: {region: 0x166, script: 0x5b, flags: 0x0}, 633: {region: 0x107, script: 0x20, flags: 0x0}, 634: {region: 0x166, script: 0x5b, flags: 0x0}, 635: {region: 0x166, script: 0x5b, flags: 0x0}, 636: {region: 0x166, script: 0x5b, flags: 0x0}, 637: {region: 0x107, script: 0x20, flags: 0x0}, 638: {region: 0x166, script: 0x5b, flags: 0x0}, 639: {region: 0x96, script: 0x5b, flags: 0x0}, 640: {region: 0xe9, script: 0x5, flags: 0x0}, 641: {region: 0x7c, script: 0x5b, flags: 0x0}, 642: {region: 0x166, script: 0x5b, flags: 0x0}, 643: {region: 0x166, script: 0x5b, flags: 0x0}, 644: {region: 0x166, script: 0x5b, flags: 0x0}, 645: {region: 0x166, script: 0x2c, flags: 0x0}, 646: {region: 0x124, script: 0xee, flags: 0x0}, 647: {region: 0xe9, script: 0x5, flags: 0x0}, 648: {region: 0x166, script: 0x5b, flags: 0x0}, 649: {region: 0x166, script: 0x5b, flags: 0x0}, 650: {region: 0x1c, script: 0x5, flags: 0x1}, 651: {region: 0x166, script: 0x5b, flags: 0x0}, 652: {region: 0x166, script: 0x5b, flags: 0x0}, 653: {region: 0x166, script: 0x5b, flags: 0x0}, 654: {region: 0x139, script: 0x5b, flags: 0x0}, 655: {region: 0x88, script: 0x5f, flags: 0x0}, 656: {region: 0x98, script: 0x3e, flags: 0x0}, 657: {region: 0x130, script: 0x5b, flags: 0x0}, 658: {region: 0xe9, script: 0x5, flags: 0x0}, 659: {region: 0x132, script: 0x5b, flags: 0x0}, 660: {region: 0x166, script: 0x5b, flags: 0x0}, 661: {region: 0xb8, script: 0x5b, flags: 0x0}, 662: {region: 0x107, script: 0x20, flags: 0x0}, 663: {region: 0x166, script: 0x5b, flags: 0x0}, 664: {region: 0x96, script: 0x5b, flags: 0x0}, 665: {region: 0x166, script: 0x5b, flags: 0x0}, 666: {region: 0x53, script: 0xee, flags: 0x0}, 667: {region: 0x166, script: 0x5b, flags: 0x0}, 668: {region: 0x166, script: 0x5b, flags: 0x0}, 669: {region: 0x166, script: 0x5b, flags: 0x0}, 670: {region: 0x166, script: 0x5b, flags: 0x0}, 671: {region: 0x9a, script: 0x5d, flags: 0x0}, 672: {region: 0x166, script: 0x5b, flags: 0x0}, 673: {region: 0x166, script: 0x5b, flags: 0x0}, 674: {region: 0x107, script: 0x20, flags: 0x0}, 675: {region: 0x132, script: 0x5b, flags: 0x0}, 676: {region: 0x166, script: 0x5b, flags: 0x0}, 677: {region: 0xda, script: 0x5b, flags: 0x0}, 678: {region: 0x166, script: 0x5b, flags: 0x0}, 679: {region: 0x166, script: 0x5b, flags: 0x0}, 680: {region: 0x21, script: 0x2, flags: 0x1}, 681: {region: 0x166, script: 0x5b, flags: 0x0}, 682: {region: 0x166, script: 0x5b, flags: 0x0}, 683: {region: 0x9f, script: 0x5b, flags: 0x0}, 684: {region: 0x53, script: 0x61, flags: 0x0}, 685: {region: 0x96, script: 0x5b, flags: 0x0}, 686: {region: 0x9d, script: 0x5, flags: 0x0}, 687: {region: 0x136, script: 0x5b, flags: 0x0}, 688: {region: 0x166, script: 0x5b, flags: 0x0}, 689: {region: 0x166, script: 0x5b, flags: 0x0}, 690: {region: 0x9a, script: 0xe9, flags: 0x0}, 691: {region: 0x9f, script: 0x5b, flags: 0x0}, 692: {region: 0x166, script: 0x5b, flags: 0x0}, 693: {region: 0x4b, script: 0x5b, flags: 0x0}, 694: {region: 0x166, script: 0x5b, flags: 0x0}, 695: {region: 0x166, script: 0x5b, flags: 0x0}, 696: {region: 0xb0, script: 0x58, flags: 0x0}, 697: {region: 0x166, script: 0x5b, flags: 0x0}, 698: {region: 0x166, script: 0x5b, flags: 0x0}, 699: {region: 0x4b, script: 0x5b, flags: 0x0}, 700: {region: 0x166, script: 0x5b, flags: 0x0}, 701: {region: 0x166, script: 0x5b, flags: 0x0}, 702: {region: 0x163, script: 0x5b, flags: 0x0}, 703: {region: 0x9d, script: 0x5, flags: 0x0}, 704: {region: 0xb7, script: 0x5b, flags: 0x0}, 705: {region: 0xb9, script: 0x5b, flags: 0x0}, 706: {region: 0x4b, script: 0x5b, flags: 0x0}, 707: {region: 0x4b, script: 0x5b, flags: 0x0}, 708: {region: 0xa5, script: 0x5b, flags: 0x0}, 709: {region: 0xa5, script: 0x5b, flags: 0x0}, 710: {region: 0x9d, script: 0x5, flags: 0x0}, 711: {region: 0xb9, script: 0x5b, flags: 0x0}, 712: {region: 0x124, script: 0xee, flags: 0x0}, 713: {region: 0x53, script: 0x3b, flags: 0x0}, 714: {region: 0x12c, script: 0x5b, flags: 0x0}, 715: {region: 0x96, script: 0x5b, flags: 0x0}, 716: {region: 0x52, script: 0x5b, flags: 0x0}, 717: {region: 0x9a, script: 0x22, flags: 0x0}, 718: {region: 0x9a, script: 0x22, flags: 0x0}, 719: {region: 0x96, script: 0x5b, flags: 0x0}, 720: {region: 0x23, script: 0x3, flags: 0x1}, 721: {region: 0xa5, script: 0x5b, flags: 0x0}, 722: {region: 0x166, script: 0x5b, flags: 0x0}, 723: {region: 0xd0, script: 0x5b, flags: 0x0}, 724: {region: 0x166, script: 0x5b, flags: 0x0}, 725: {region: 0x166, script: 0x5b, flags: 0x0}, 726: {region: 0x166, script: 0x5b, flags: 0x0}, 727: {region: 0x166, script: 0x5b, flags: 0x0}, 728: {region: 0x166, script: 0x5b, flags: 0x0}, 729: {region: 0x166, script: 0x5b, flags: 0x0}, 730: {region: 0x166, script: 0x5b, flags: 0x0}, 731: {region: 0x166, script: 0x5b, flags: 0x0}, 732: {region: 0x166, script: 0x5b, flags: 0x0}, 733: {region: 0x166, script: 0x5b, flags: 0x0}, 734: {region: 0x166, script: 0x5b, flags: 0x0}, 735: {region: 0x166, script: 0x5, flags: 0x0}, 736: {region: 0x107, script: 0x20, flags: 0x0}, 737: {region: 0xe8, script: 0x5b, flags: 0x0}, 738: {region: 0x166, script: 0x5b, flags: 0x0}, 739: {region: 0x96, script: 0x5b, flags: 0x0}, 740: {region: 0x166, script: 0x2c, flags: 0x0}, 741: {region: 0x166, script: 0x5b, flags: 0x0}, 742: {region: 0x166, script: 0x5b, flags: 0x0}, 743: {region: 0x166, script: 0x5b, flags: 0x0}, 744: {region: 0x113, script: 0x5b, flags: 0x0}, 745: {region: 0xa5, script: 0x5b, flags: 0x0}, 746: {region: 0x166, script: 0x5b, flags: 0x0}, 747: {region: 0x166, script: 0x5b, flags: 0x0}, 748: {region: 0x124, script: 0x5, flags: 0x0}, 749: {region: 0xcd, script: 0x5b, flags: 0x0}, 750: {region: 0x166, script: 0x5b, flags: 0x0}, 751: {region: 0x166, script: 0x5b, flags: 0x0}, 752: {region: 0x166, script: 0x5b, flags: 0x0}, 753: {region: 0xc0, script: 0x5b, flags: 0x0}, 754: {region: 0xd2, script: 0x5b, flags: 0x0}, 755: {region: 0x166, script: 0x5b, flags: 0x0}, 756: {region: 0x52, script: 0x5b, flags: 0x0}, 757: {region: 0xdc, script: 0x22, flags: 0x0}, 758: {region: 0x130, script: 0x5b, flags: 0x0}, 759: {region: 0xc1, script: 0x5b, flags: 0x0}, 760: {region: 0x166, script: 0x5b, flags: 0x0}, 761: {region: 0x166, script: 0x5b, flags: 0x0}, 762: {region: 0xe1, script: 0x5b, flags: 0x0}, 763: {region: 0x166, script: 0x5b, flags: 0x0}, 764: {region: 0x96, script: 0x5b, flags: 0x0}, 765: {region: 0x9c, script: 0x3d, flags: 0x0}, 766: {region: 0x166, script: 0x5b, flags: 0x0}, 767: {region: 0xc3, script: 0x20, flags: 0x0}, 768: {region: 0x166, script: 0x5, flags: 0x0}, 769: {region: 0x166, script: 0x5b, flags: 0x0}, 770: {region: 0x166, script: 0x5b, flags: 0x0}, 771: {region: 0x166, script: 0x5b, flags: 0x0}, 772: {region: 0x9a, script: 0x6f, flags: 0x0}, 773: {region: 0x166, script: 0x5b, flags: 0x0}, 774: {region: 0x166, script: 0x5b, flags: 0x0}, 775: {region: 0x10c, script: 0x5b, flags: 0x0}, 776: {region: 0x166, script: 0x5b, flags: 0x0}, 777: {region: 0x166, script: 0x5b, flags: 0x0}, 778: {region: 0x166, script: 0x5b, flags: 0x0}, 779: {region: 0x26, script: 0x3, flags: 0x1}, 780: {region: 0x166, script: 0x5b, flags: 0x0}, 781: {region: 0x166, script: 0x5b, flags: 0x0}, 782: {region: 0x9a, script: 0xe, flags: 0x0}, 783: {region: 0xc5, script: 0x76, flags: 0x0}, 785: {region: 0x166, script: 0x5b, flags: 0x0}, 786: {region: 0x49, script: 0x5b, flags: 0x0}, 787: {region: 0x49, script: 0x5b, flags: 0x0}, 788: {region: 0x37, script: 0x5b, flags: 0x0}, 789: {region: 0x166, script: 0x5b, flags: 0x0}, 790: {region: 0x166, script: 0x5b, flags: 0x0}, 791: {region: 0x166, script: 0x5b, flags: 0x0}, 792: {region: 0x166, script: 0x5b, flags: 0x0}, 793: {region: 0x166, script: 0x5b, flags: 0x0}, 794: {region: 0x166, script: 0x5b, flags: 0x0}, 795: {region: 0x9a, script: 0x22, flags: 0x0}, 796: {region: 0xdc, script: 0x22, flags: 0x0}, 797: {region: 0x107, script: 0x20, flags: 0x0}, 798: {region: 0x35, script: 0x73, flags: 0x0}, 799: {region: 0x29, script: 0x3, flags: 0x1}, 800: {region: 0xcc, script: 0x5b, flags: 0x0}, 801: {region: 0x166, script: 0x5b, flags: 0x0}, 802: {region: 0x166, script: 0x5b, flags: 0x0}, 803: {region: 0x166, script: 0x5b, flags: 0x0}, 804: {region: 0x9a, script: 0x22, flags: 0x0}, 805: {region: 0x52, script: 0x5b, flags: 0x0}, 807: {region: 0x166, script: 0x5b, flags: 0x0}, 808: {region: 0x136, script: 0x5b, flags: 0x0}, 809: {region: 0x166, script: 0x5b, flags: 0x0}, 810: {region: 0x166, script: 0x5b, flags: 0x0}, 811: {region: 0xe9, script: 0x5, flags: 0x0}, 812: {region: 0xc4, script: 0x5b, flags: 0x0}, 813: {region: 0x9a, script: 0x22, flags: 0x0}, 814: {region: 0x96, script: 0x5b, flags: 0x0}, 815: {region: 0x165, script: 0x5b, flags: 0x0}, 816: {region: 0x166, script: 0x5b, flags: 0x0}, 817: {region: 0xc5, script: 0x76, flags: 0x0}, 818: {region: 0x166, script: 0x5b, flags: 0x0}, 819: {region: 0x166, script: 0x2c, flags: 0x0}, 820: {region: 0x107, script: 0x20, flags: 0x0}, 821: {region: 0x166, script: 0x5b, flags: 0x0}, 822: {region: 0x132, script: 0x5b, flags: 0x0}, 823: {region: 0x9d, script: 0x67, flags: 0x0}, 824: {region: 0x166, script: 0x5b, flags: 0x0}, 825: {region: 0x166, script: 0x5b, flags: 0x0}, 826: {region: 0x9d, script: 0x5, flags: 0x0}, 827: {region: 0x166, script: 0x5b, flags: 0x0}, 828: {region: 0x166, script: 0x5b, flags: 0x0}, 829: {region: 0x166, script: 0x5b, flags: 0x0}, 830: {region: 0xde, script: 0x5b, flags: 0x0}, 831: {region: 0x166, script: 0x5b, flags: 0x0}, 832: {region: 0x166, script: 0x5b, flags: 0x0}, 834: {region: 0x166, script: 0x5b, flags: 0x0}, 835: {region: 0x53, script: 0x3b, flags: 0x0}, 836: {region: 0x9f, script: 0x5b, flags: 0x0}, 837: {region: 0xd3, script: 0x5b, flags: 0x0}, 838: {region: 0x166, script: 0x5b, flags: 0x0}, 839: {region: 0xdb, script: 0x5b, flags: 0x0}, 840: {region: 0x166, script: 0x5b, flags: 0x0}, 841: {region: 0x166, script: 0x5b, flags: 0x0}, 842: {region: 0x166, script: 0x5b, flags: 0x0}, 843: {region: 0xd0, script: 0x5b, flags: 0x0}, 844: {region: 0x166, script: 0x5b, flags: 0x0}, 845: {region: 0x166, script: 0x5b, flags: 0x0}, 846: {region: 0x165, script: 0x5b, flags: 0x0}, 847: {region: 0xd2, script: 0x5b, flags: 0x0}, 848: {region: 0x61, script: 0x5b, flags: 0x0}, 849: {region: 0xdc, script: 0x22, flags: 0x0}, 850: {region: 0x166, script: 0x5b, flags: 0x0}, 851: {region: 0xdc, script: 0x22, flags: 0x0}, 852: {region: 0x166, script: 0x5b, flags: 0x0}, 853: {region: 0x166, script: 0x5b, flags: 0x0}, 854: {region: 0xd3, script: 0x5b, flags: 0x0}, 855: {region: 0x166, script: 0x5b, flags: 0x0}, 856: {region: 0x166, script: 0x5b, flags: 0x0}, 857: {region: 0xd2, script: 0x5b, flags: 0x0}, 858: {region: 0x166, script: 0x5b, flags: 0x0}, 859: {region: 0xd0, script: 0x5b, flags: 0x0}, 860: {region: 0xd0, script: 0x5b, flags: 0x0}, 861: {region: 0x166, script: 0x5b, flags: 0x0}, 862: {region: 0x166, script: 0x5b, flags: 0x0}, 863: {region: 0x96, script: 0x5b, flags: 0x0}, 864: {region: 0x166, script: 0x5b, flags: 0x0}, 865: {region: 0xe0, script: 0x5b, flags: 0x0}, 866: {region: 0x166, script: 0x5b, flags: 0x0}, 867: {region: 0x166, script: 0x5b, flags: 0x0}, 868: {region: 0x9a, script: 0x5b, flags: 0x0}, 869: {region: 0x166, script: 0x5b, flags: 0x0}, 870: {region: 0x166, script: 0x5b, flags: 0x0}, 871: {region: 0xda, script: 0x5b, flags: 0x0}, 872: {region: 0x52, script: 0x5b, flags: 0x0}, 873: {region: 0x166, script: 0x5b, flags: 0x0}, 874: {region: 0xdb, script: 0x5b, flags: 0x0}, 875: {region: 0x166, script: 0x5b, flags: 0x0}, 876: {region: 0x52, script: 0x5b, flags: 0x0}, 877: {region: 0x166, script: 0x5b, flags: 0x0}, 878: {region: 0x166, script: 0x5b, flags: 0x0}, 879: {region: 0xdb, script: 0x5b, flags: 0x0}, 880: {region: 0x124, script: 0x57, flags: 0x0}, 881: {region: 0x9a, script: 0x22, flags: 0x0}, 882: {region: 0x10d, script: 0xcb, flags: 0x0}, 883: {region: 0x166, script: 0x5b, flags: 0x0}, 884: {region: 0x166, script: 0x5b, flags: 0x0}, 885: {region: 0x85, script: 0x7e, flags: 0x0}, 886: {region: 0x162, script: 0x5b, flags: 0x0}, 887: {region: 0x166, script: 0x5b, flags: 0x0}, 888: {region: 0x49, script: 0x17, flags: 0x0}, 889: {region: 0x166, script: 0x5b, flags: 0x0}, 890: {region: 0x162, script: 0x5b, flags: 0x0}, 891: {region: 0x166, script: 0x5b, flags: 0x0}, 892: {region: 0x166, script: 0x5b, flags: 0x0}, 893: {region: 0x166, script: 0x5b, flags: 0x0}, 894: {region: 0x166, script: 0x5b, flags: 0x0}, 895: {region: 0x166, script: 0x5b, flags: 0x0}, 896: {region: 0x118, script: 0x5b, flags: 0x0}, 897: {region: 0x166, script: 0x5b, flags: 0x0}, 898: {region: 0x166, script: 0x5b, flags: 0x0}, 899: {region: 0x136, script: 0x5b, flags: 0x0}, 900: {region: 0x166, script: 0x5b, flags: 0x0}, 901: {region: 0x53, script: 0x5b, flags: 0x0}, 902: {region: 0x166, script: 0x5b, flags: 0x0}, 903: {region: 0xcf, script: 0x5b, flags: 0x0}, 904: {region: 0x130, script: 0x5b, flags: 0x0}, 905: {region: 0x132, script: 0x5b, flags: 0x0}, 906: {region: 0x81, script: 0x5b, flags: 0x0}, 907: {region: 0x79, script: 0x5b, flags: 0x0}, 908: {region: 0x166, script: 0x5b, flags: 0x0}, 910: {region: 0x166, script: 0x5b, flags: 0x0}, 911: {region: 0x166, script: 0x5b, flags: 0x0}, 912: {region: 0x70, script: 0x5b, flags: 0x0}, 913: {region: 0x166, script: 0x5b, flags: 0x0}, 914: {region: 0x166, script: 0x5b, flags: 0x0}, 915: {region: 0x166, script: 0x5b, flags: 0x0}, 916: {region: 0x166, script: 0x5b, flags: 0x0}, 917: {region: 0x9a, script: 0x83, flags: 0x0}, 918: {region: 0x166, script: 0x5b, flags: 0x0}, 919: {region: 0x166, script: 0x5, flags: 0x0}, 920: {region: 0x7e, script: 0x20, flags: 0x0}, 921: {region: 0x136, script: 0x84, flags: 0x0}, 922: {region: 0x166, script: 0x5, flags: 0x0}, 923: {region: 0xc6, script: 0x82, flags: 0x0}, 924: {region: 0x166, script: 0x5b, flags: 0x0}, 925: {region: 0x2c, script: 0x3, flags: 0x1}, 926: {region: 0xe8, script: 0x5b, flags: 0x0}, 927: {region: 0x2f, script: 0x2, flags: 0x1}, 928: {region: 0xe8, script: 0x5b, flags: 0x0}, 929: {region: 0x30, script: 0x5b, flags: 0x0}, 930: {region: 0xf1, script: 0x5b, flags: 0x0}, 931: {region: 0x166, script: 0x5b, flags: 0x0}, 932: {region: 0x79, script: 0x5b, flags: 0x0}, 933: {region: 0xd7, script: 0x5b, flags: 0x0}, 934: {region: 0x136, script: 0x5b, flags: 0x0}, 935: {region: 0x49, script: 0x5b, flags: 0x0}, 936: {region: 0x166, script: 0x5b, flags: 0x0}, 937: {region: 0x9d, script: 0xfa, flags: 0x0}, 938: {region: 0x166, script: 0x5b, flags: 0x0}, 939: {region: 0x61, script: 0x5b, flags: 0x0}, 940: {region: 0x166, script: 0x5, flags: 0x0}, 941: {region: 0xb1, script: 0x90, flags: 0x0}, 943: {region: 0x166, script: 0x5b, flags: 0x0}, 944: {region: 0x166, script: 0x5b, flags: 0x0}, 945: {region: 0x9a, script: 0x12, flags: 0x0}, 946: {region: 0xa5, script: 0x5b, flags: 0x0}, 947: {region: 0xea, script: 0x5b, flags: 0x0}, 948: {region: 0x166, script: 0x5b, flags: 0x0}, 949: {region: 0x9f, script: 0x5b, flags: 0x0}, 950: {region: 0x166, script: 0x5b, flags: 0x0}, 951: {region: 0x166, script: 0x5b, flags: 0x0}, 952: {region: 0x88, script: 0x34, flags: 0x0}, 953: {region: 0x76, script: 0x5b, flags: 0x0}, 954: {region: 0x166, script: 0x5b, flags: 0x0}, 955: {region: 0xe9, script: 0x4e, flags: 0x0}, 956: {region: 0x9d, script: 0x5, flags: 0x0}, 957: {region: 0x1, script: 0x5b, flags: 0x0}, 958: {region: 0x24, script: 0x5, flags: 0x0}, 959: {region: 0x166, script: 0x5b, flags: 0x0}, 960: {region: 0x41, script: 0x5b, flags: 0x0}, 961: {region: 0x166, script: 0x5b, flags: 0x0}, 962: {region: 0x7b, script: 0x5b, flags: 0x0}, 963: {region: 0x166, script: 0x5b, flags: 0x0}, 964: {region: 0xe5, script: 0x5b, flags: 0x0}, 965: {region: 0x8a, script: 0x5b, flags: 0x0}, 966: {region: 0x6a, script: 0x5b, flags: 0x0}, 967: {region: 0x166, script: 0x5b, flags: 0x0}, 968: {region: 0x9a, script: 0x22, flags: 0x0}, 969: {region: 0x166, script: 0x5b, flags: 0x0}, 970: {region: 0x103, script: 0x5b, flags: 0x0}, 971: {region: 0x96, script: 0x5b, flags: 0x0}, 972: {region: 0x166, script: 0x5b, flags: 0x0}, 973: {region: 0x166, script: 0x5b, flags: 0x0}, 974: {region: 0x9f, script: 0x5b, flags: 0x0}, 975: {region: 0x166, script: 0x5, flags: 0x0}, 976: {region: 0x9a, script: 0x5b, flags: 0x0}, 977: {region: 0x31, script: 0x2, flags: 0x1}, 978: {region: 0xdc, script: 0x22, flags: 0x0}, 979: {region: 0x35, script: 0xe, flags: 0x0}, 980: {region: 0x4e, script: 0x5b, flags: 0x0}, 981: {region: 0x73, script: 0x5b, flags: 0x0}, 982: {region: 0x4e, script: 0x5b, flags: 0x0}, 983: {region: 0x9d, script: 0x5, flags: 0x0}, 984: {region: 0x10d, script: 0x5b, flags: 0x0}, 985: {region: 0x3a, script: 0x5b, flags: 0x0}, 986: {region: 0x166, script: 0x5b, flags: 0x0}, 987: {region: 0xd2, script: 0x5b, flags: 0x0}, 988: {region: 0x105, script: 0x5b, flags: 0x0}, 989: {region: 0x96, script: 0x5b, flags: 0x0}, 990: {region: 0x130, script: 0x5b, flags: 0x0}, 991: {region: 0x166, script: 0x5b, flags: 0x0}, 992: {region: 0x166, script: 0x5b, flags: 0x0}, 993: {region: 0x74, script: 0x5b, flags: 0x0}, 994: {region: 0x107, script: 0x20, flags: 0x0}, 995: {region: 0x131, script: 0x20, flags: 0x0}, 996: {region: 0x10a, script: 0x5b, flags: 0x0}, 997: {region: 0x108, script: 0x5b, flags: 0x0}, 998: {region: 0x130, script: 0x5b, flags: 0x0}, 999: {region: 0x166, script: 0x5b, flags: 0x0}, 1000: {region: 0xa3, script: 0x4c, flags: 0x0}, 1001: {region: 0x9a, script: 0x22, flags: 0x0}, 1002: {region: 0x81, script: 0x5b, flags: 0x0}, 1003: {region: 0x107, script: 0x20, flags: 0x0}, 1004: {region: 0xa5, script: 0x5b, flags: 0x0}, 1005: {region: 0x96, script: 0x5b, flags: 0x0}, 1006: {region: 0x9a, script: 0x5b, flags: 0x0}, 1007: {region: 0x115, script: 0x5b, flags: 0x0}, 1008: {region: 0x9a, script: 0xcf, flags: 0x0}, 1009: {region: 0x166, script: 0x5b, flags: 0x0}, 1010: {region: 0x166, script: 0x5b, flags: 0x0}, 1011: {region: 0x130, script: 0x5b, flags: 0x0}, 1012: {region: 0x9f, script: 0x5b, flags: 0x0}, 1013: {region: 0x9a, script: 0x22, flags: 0x0}, 1014: {region: 0x166, script: 0x5, flags: 0x0}, 1015: {region: 0x9f, script: 0x5b, flags: 0x0}, 1016: {region: 0x7c, script: 0x5b, flags: 0x0}, 1017: {region: 0x49, script: 0x5b, flags: 0x0}, 1018: {region: 0x33, script: 0x4, flags: 0x1}, 1019: {region: 0x9f, script: 0x5b, flags: 0x0}, 1020: {region: 0x9d, script: 0x5, flags: 0x0}, 1021: {region: 0xdb, script: 0x5b, flags: 0x0}, 1022: {region: 0x4f, script: 0x5b, flags: 0x0}, 1023: {region: 0xd2, script: 0x5b, flags: 0x0}, 1024: {region: 0xd0, script: 0x5b, flags: 0x0}, 1025: {region: 0xc4, script: 0x5b, flags: 0x0}, 1026: {region: 0x4c, script: 0x5b, flags: 0x0}, 1027: {region: 0x97, script: 0x80, flags: 0x0}, 1028: {region: 0xb7, script: 0x5b, flags: 0x0}, 1029: {region: 0x166, script: 0x2c, flags: 0x0}, 1030: {region: 0x166, script: 0x5b, flags: 0x0}, 1032: {region: 0xbb, script: 0xeb, flags: 0x0}, 1033: {region: 0x166, script: 0x5b, flags: 0x0}, 1034: {region: 0xc5, script: 0x76, flags: 0x0}, 1035: {region: 0x166, script: 0x5, flags: 0x0}, 1036: {region: 0xb4, script: 0xd6, flags: 0x0}, 1037: {region: 0x70, script: 0x5b, flags: 0x0}, 1038: {region: 0x166, script: 0x5b, flags: 0x0}, 1039: {region: 0x166, script: 0x5b, flags: 0x0}, 1040: {region: 0x166, script: 0x5b, flags: 0x0}, 1041: {region: 0x166, script: 0x5b, flags: 0x0}, 1042: {region: 0x112, script: 0x5b, flags: 0x0}, 1043: {region: 0x166, script: 0x5b, flags: 0x0}, 1044: {region: 0xe9, script: 0x5, flags: 0x0}, 1045: {region: 0x166, script: 0x5b, flags: 0x0}, 1046: {region: 0x110, script: 0x5b, flags: 0x0}, 1047: {region: 0x166, script: 0x5b, flags: 0x0}, 1048: {region: 0xea, script: 0x5b, flags: 0x0}, 1049: {region: 0x166, script: 0x5b, flags: 0x0}, 1050: {region: 0x96, script: 0x5b, flags: 0x0}, 1051: {region: 0x143, script: 0x5b, flags: 0x0}, 1052: {region: 0x10d, script: 0x5b, flags: 0x0}, 1054: {region: 0x10d, script: 0x5b, flags: 0x0}, 1055: {region: 0x73, script: 0x5b, flags: 0x0}, 1056: {region: 0x98, script: 0xcc, flags: 0x0}, 1057: {region: 0x166, script: 0x5b, flags: 0x0}, 1058: {region: 0x73, script: 0x5b, flags: 0x0}, 1059: {region: 0x165, script: 0x5b, flags: 0x0}, 1060: {region: 0x166, script: 0x5b, flags: 0x0}, 1061: {region: 0xc4, script: 0x5b, flags: 0x0}, 1062: {region: 0x166, script: 0x5b, flags: 0x0}, 1063: {region: 0x166, script: 0x5b, flags: 0x0}, 1064: {region: 0x166, script: 0x5b, flags: 0x0}, 1065: {region: 0x116, script: 0x5b, flags: 0x0}, 1066: {region: 0x166, script: 0x5b, flags: 0x0}, 1067: {region: 0x166, script: 0x5b, flags: 0x0}, 1068: {region: 0x124, script: 0xee, flags: 0x0}, 1069: {region: 0x166, script: 0x5b, flags: 0x0}, 1070: {region: 0x166, script: 0x5b, flags: 0x0}, 1071: {region: 0x166, script: 0x5b, flags: 0x0}, 1072: {region: 0x166, script: 0x5b, flags: 0x0}, 1073: {region: 0x27, script: 0x5b, flags: 0x0}, 1074: {region: 0x37, script: 0x5, flags: 0x1}, 1075: {region: 0x9a, script: 0xd9, flags: 0x0}, 1076: {region: 0x117, script: 0x5b, flags: 0x0}, 1077: {region: 0x115, script: 0x5b, flags: 0x0}, 1078: {region: 0x9a, script: 0x22, flags: 0x0}, 1079: {region: 0x162, script: 0x5b, flags: 0x0}, 1080: {region: 0x166, script: 0x5b, flags: 0x0}, 1081: {region: 0x166, script: 0x5b, flags: 0x0}, 1082: {region: 0x6e, script: 0x5b, flags: 0x0}, 1083: {region: 0x162, script: 0x5b, flags: 0x0}, 1084: {region: 0x166, script: 0x5b, flags: 0x0}, 1085: {region: 0x61, script: 0x5b, flags: 0x0}, 1086: {region: 0x96, script: 0x5b, flags: 0x0}, 1087: {region: 0x166, script: 0x5b, flags: 0x0}, 1088: {region: 0x166, script: 0x5b, flags: 0x0}, 1089: {region: 0x130, script: 0x5b, flags: 0x0}, 1090: {region: 0x166, script: 0x5b, flags: 0x0}, 1091: {region: 0x85, script: 0x5b, flags: 0x0}, 1092: {region: 0x10d, script: 0x5b, flags: 0x0}, 1093: {region: 0x130, script: 0x5b, flags: 0x0}, 1094: {region: 0x160, script: 0x5, flags: 0x0}, 1095: {region: 0x4b, script: 0x5b, flags: 0x0}, 1096: {region: 0x61, script: 0x5b, flags: 0x0}, 1097: {region: 0x166, script: 0x5b, flags: 0x0}, 1098: {region: 0x9a, script: 0x22, flags: 0x0}, 1099: {region: 0x96, script: 0x5b, flags: 0x0}, 1100: {region: 0x166, script: 0x5b, flags: 0x0}, 1101: {region: 0x35, script: 0xe, flags: 0x0}, 1102: {region: 0x9c, script: 0xde, flags: 0x0}, 1103: {region: 0xea, script: 0x5b, flags: 0x0}, 1104: {region: 0x9a, script: 0xe6, flags: 0x0}, 1105: {region: 0xdc, script: 0x22, flags: 0x0}, 1106: {region: 0x166, script: 0x5b, flags: 0x0}, 1107: {region: 0x166, script: 0x5b, flags: 0x0}, 1108: {region: 0x166, script: 0x5b, flags: 0x0}, 1109: {region: 0x166, script: 0x5b, flags: 0x0}, 1110: {region: 0x166, script: 0x5b, flags: 0x0}, 1111: {region: 0x166, script: 0x5b, flags: 0x0}, 1112: {region: 0x166, script: 0x5b, flags: 0x0}, 1113: {region: 0x166, script: 0x5b, flags: 0x0}, 1114: {region: 0xe8, script: 0x5b, flags: 0x0}, 1115: {region: 0x166, script: 0x5b, flags: 0x0}, 1116: {region: 0x166, script: 0x5b, flags: 0x0}, 1117: {region: 0x9a, script: 0x53, flags: 0x0}, 1118: {region: 0x53, script: 0xe4, flags: 0x0}, 1119: {region: 0xdc, script: 0x22, flags: 0x0}, 1120: {region: 0xdc, script: 0x22, flags: 0x0}, 1121: {region: 0x9a, script: 0xe9, flags: 0x0}, 1122: {region: 0x166, script: 0x5b, flags: 0x0}, 1123: {region: 0x113, script: 0x5b, flags: 0x0}, 1124: {region: 0x132, script: 0x5b, flags: 0x0}, 1125: {region: 0x127, script: 0x5b, flags: 0x0}, 1126: {region: 0x166, script: 0x5b, flags: 0x0}, 1127: {region: 0x3c, script: 0x3, flags: 0x1}, 1128: {region: 0x166, script: 0x5b, flags: 0x0}, 1129: {region: 0x166, script: 0x5b, flags: 0x0}, 1130: {region: 0x166, script: 0x5b, flags: 0x0}, 1131: {region: 0x124, script: 0xee, flags: 0x0}, 1132: {region: 0xdc, script: 0x22, flags: 0x0}, 1133: {region: 0xdc, script: 0x22, flags: 0x0}, 1134: {region: 0xdc, script: 0x22, flags: 0x0}, 1135: {region: 0x70, script: 0x2c, flags: 0x0}, 1136: {region: 0x166, script: 0x5b, flags: 0x0}, 1137: {region: 0x6e, script: 0x2c, flags: 0x0}, 1138: {region: 0x166, script: 0x5b, flags: 0x0}, 1139: {region: 0x166, script: 0x5b, flags: 0x0}, 1140: {region: 0x166, script: 0x5b, flags: 0x0}, 1141: {region: 0xd7, script: 0x5b, flags: 0x0}, 1142: {region: 0x128, script: 0x5b, flags: 0x0}, 1143: {region: 0x126, script: 0x5b, flags: 0x0}, 1144: {region: 0x32, script: 0x5b, flags: 0x0}, 1145: {region: 0xdc, script: 0x22, flags: 0x0}, 1146: {region: 0xe8, script: 0x5b, flags: 0x0}, 1147: {region: 0x166, script: 0x5b, flags: 0x0}, 1148: {region: 0x166, script: 0x5b, flags: 0x0}, 1149: {region: 0x32, script: 0x5b, flags: 0x0}, 1150: {region: 0xd5, script: 0x5b, flags: 0x0}, 1151: {region: 0x166, script: 0x5b, flags: 0x0}, 1152: {region: 0x162, script: 0x5b, flags: 0x0}, 1153: {region: 0x166, script: 0x5b, flags: 0x0}, 1154: {region: 0x12a, script: 0x5b, flags: 0x0}, 1155: {region: 0x166, script: 0x5b, flags: 0x0}, 1156: {region: 0xcf, script: 0x5b, flags: 0x0}, 1157: {region: 0x166, script: 0x5b, flags: 0x0}, 1158: {region: 0xe7, script: 0x5b, flags: 0x0}, 1159: {region: 0x166, script: 0x5b, flags: 0x0}, 1160: {region: 0x166, script: 0x5b, flags: 0x0}, 1161: {region: 0x166, script: 0x5b, flags: 0x0}, 1162: {region: 0x12c, script: 0x5b, flags: 0x0}, 1163: {region: 0x12c, script: 0x5b, flags: 0x0}, 1164: {region: 0x12f, script: 0x5b, flags: 0x0}, 1165: {region: 0x166, script: 0x5, flags: 0x0}, 1166: {region: 0x162, script: 0x5b, flags: 0x0}, 1167: {region: 0x88, script: 0x34, flags: 0x0}, 1168: {region: 0xdc, script: 0x22, flags: 0x0}, 1169: {region: 0xe8, script: 0x5b, flags: 0x0}, 1170: {region: 0x43, script: 0xef, flags: 0x0}, 1171: {region: 0x166, script: 0x5b, flags: 0x0}, 1172: {region: 0x107, script: 0x20, flags: 0x0}, 1173: {region: 0x166, script: 0x5b, flags: 0x0}, 1174: {region: 0x166, script: 0x5b, flags: 0x0}, 1175: {region: 0x132, script: 0x5b, flags: 0x0}, 1176: {region: 0x166, script: 0x5b, flags: 0x0}, 1177: {region: 0x124, script: 0xee, flags: 0x0}, 1178: {region: 0x32, script: 0x5b, flags: 0x0}, 1179: {region: 0x166, script: 0x5b, flags: 0x0}, 1180: {region: 0x166, script: 0x5b, flags: 0x0}, 1181: {region: 0xcf, script: 0x5b, flags: 0x0}, 1182: {region: 0x166, script: 0x5b, flags: 0x0}, 1183: {region: 0x166, script: 0x5b, flags: 0x0}, 1184: {region: 0x12e, script: 0x5b, flags: 0x0}, 1185: {region: 0x166, script: 0x5b, flags: 0x0}, 1187: {region: 0x166, script: 0x5b, flags: 0x0}, 1188: {region: 0xd5, script: 0x5b, flags: 0x0}, 1189: {region: 0x53, script: 0xe7, flags: 0x0}, 1190: {region: 0xe6, script: 0x5b, flags: 0x0}, 1191: {region: 0x166, script: 0x5b, flags: 0x0}, 1192: {region: 0x107, script: 0x20, flags: 0x0}, 1193: {region: 0xbb, script: 0x5b, flags: 0x0}, 1194: {region: 0x166, script: 0x5b, flags: 0x0}, 1195: {region: 0x107, script: 0x20, flags: 0x0}, 1196: {region: 0x3f, script: 0x4, flags: 0x1}, 1197: {region: 0x11d, script: 0xf3, flags: 0x0}, 1198: {region: 0x131, script: 0x20, flags: 0x0}, 1199: {region: 0x76, script: 0x5b, flags: 0x0}, 1200: {region: 0x2a, script: 0x5b, flags: 0x0}, 1202: {region: 0x43, script: 0x3, flags: 0x1}, 1203: {region: 0x9a, script: 0xe, flags: 0x0}, 1204: {region: 0xe9, script: 0x5, flags: 0x0}, 1205: {region: 0x166, script: 0x5b, flags: 0x0}, 1206: {region: 0x166, script: 0x5b, flags: 0x0}, 1207: {region: 0x166, script: 0x5b, flags: 0x0}, 1208: {region: 0x166, script: 0x5b, flags: 0x0}, 1209: {region: 0x166, script: 0x5b, flags: 0x0}, 1210: {region: 0x166, script: 0x5b, flags: 0x0}, 1211: {region: 0x166, script: 0x5b, flags: 0x0}, 1212: {region: 0x46, script: 0x4, flags: 0x1}, 1213: {region: 0x166, script: 0x5b, flags: 0x0}, 1214: {region: 0xb5, script: 0xf4, flags: 0x0}, 1215: {region: 0x166, script: 0x5b, flags: 0x0}, 1216: {region: 0x162, script: 0x5b, flags: 0x0}, 1217: {region: 0x9f, script: 0x5b, flags: 0x0}, 1218: {region: 0x107, script: 0x5b, flags: 0x0}, 1219: {region: 0x13f, script: 0x5b, flags: 0x0}, 1220: {region: 0x11c, script: 0x5b, flags: 0x0}, 1221: {region: 0x166, script: 0x5b, flags: 0x0}, 1222: {region: 0x36, script: 0x5b, flags: 0x0}, 1223: {region: 0x61, script: 0x5b, flags: 0x0}, 1224: {region: 0xd2, script: 0x5b, flags: 0x0}, 1225: {region: 0x1, script: 0x5b, flags: 0x0}, 1226: {region: 0x107, script: 0x5b, flags: 0x0}, 1227: {region: 0x6b, script: 0x5b, flags: 0x0}, 1228: {region: 0x130, script: 0x5b, flags: 0x0}, 1229: {region: 0x166, script: 0x5b, flags: 0x0}, 1230: {region: 0x36, script: 0x5b, flags: 0x0}, 1231: {region: 0x4e, script: 0x5b, flags: 0x0}, 1232: {region: 0x166, script: 0x5b, flags: 0x0}, 1233: {region: 0x70, script: 0x2c, flags: 0x0}, 1234: {region: 0x166, script: 0x5b, flags: 0x0}, 1235: {region: 0xe8, script: 0x5b, flags: 0x0}, 1236: {region: 0x2f, script: 0x5b, flags: 0x0}, 1237: {region: 0x9a, script: 0xe9, flags: 0x0}, 1238: {region: 0x9a, script: 0x22, flags: 0x0}, 1239: {region: 0x166, script: 0x5b, flags: 0x0}, 1240: {region: 0x166, script: 0x5b, flags: 0x0}, 1241: {region: 0x166, script: 0x5b, flags: 0x0}, 1242: {region: 0x166, script: 0x5b, flags: 0x0}, 1243: {region: 0x166, script: 0x5b, flags: 0x0}, 1244: {region: 0x166, script: 0x5b, flags: 0x0}, 1245: {region: 0x166, script: 0x5b, flags: 0x0}, 1246: {region: 0x166, script: 0x5b, flags: 0x0}, 1247: {region: 0x166, script: 0x5b, flags: 0x0}, 1248: {region: 0x141, script: 0x5b, flags: 0x0}, 1249: {region: 0x166, script: 0x5b, flags: 0x0}, 1250: {region: 0x166, script: 0x5b, flags: 0x0}, 1251: {region: 0xa9, script: 0x5, flags: 0x0}, 1252: {region: 0x166, script: 0x5b, flags: 0x0}, 1253: {region: 0x115, script: 0x5b, flags: 0x0}, 1254: {region: 0x166, script: 0x5b, flags: 0x0}, 1255: {region: 0x166, script: 0x5b, flags: 0x0}, 1256: {region: 0x166, script: 0x5b, flags: 0x0}, 1257: {region: 0x166, script: 0x5b, flags: 0x0}, 1258: {region: 0x9a, script: 0x22, flags: 0x0}, 1259: {region: 0x53, script: 0x3b, flags: 0x0}, 1260: {region: 0x166, script: 0x5b, flags: 0x0}, 1261: {region: 0x166, script: 0x5b, flags: 0x0}, 1262: {region: 0x41, script: 0x5b, flags: 0x0}, 1263: {region: 0x166, script: 0x5b, flags: 0x0}, 1264: {region: 0x12c, script: 0x18, flags: 0x0}, 1265: {region: 0x166, script: 0x5b, flags: 0x0}, 1266: {region: 0x162, script: 0x5b, flags: 0x0}, 1267: {region: 0x166, script: 0x5b, flags: 0x0}, 1268: {region: 0x12c, script: 0x63, flags: 0x0}, 1269: {region: 0x12c, script: 0x64, flags: 0x0}, 1270: {region: 0x7e, script: 0x2e, flags: 0x0}, 1271: {region: 0x53, script: 0x68, flags: 0x0}, 1272: {region: 0x10c, script: 0x6d, flags: 0x0}, 1273: {region: 0x109, script: 0x79, flags: 0x0}, 1274: {region: 0x9a, script: 0x22, flags: 0x0}, 1275: {region: 0x132, script: 0x5b, flags: 0x0}, 1276: {region: 0x166, script: 0x5b, flags: 0x0}, 1277: {region: 0x9d, script: 0x93, flags: 0x0}, 1278: {region: 0x166, script: 0x5b, flags: 0x0}, 1279: {region: 0x15f, script: 0xce, flags: 0x0}, 1280: {region: 0x166, script: 0x5b, flags: 0x0}, 1281: {region: 0x166, script: 0x5b, flags: 0x0}, 1282: {region: 0xdc, script: 0x22, flags: 0x0}, 1283: {region: 0x166, script: 0x5b, flags: 0x0}, 1284: {region: 0x166, script: 0x5b, flags: 0x0}, 1285: {region: 0xd2, script: 0x5b, flags: 0x0}, 1286: {region: 0x76, script: 0x5b, flags: 0x0}, 1287: {region: 0x166, script: 0x5b, flags: 0x0}, 1288: {region: 0x166, script: 0x5b, flags: 0x0}, 1289: {region: 0x52, script: 0x5b, flags: 0x0}, 1290: {region: 0x166, script: 0x5b, flags: 0x0}, 1291: {region: 0x166, script: 0x5b, flags: 0x0}, 1292: {region: 0x166, script: 0x5b, flags: 0x0}, 1293: {region: 0x52, script: 0x5b, flags: 0x0}, 1294: {region: 0x166, script: 0x5b, flags: 0x0}, 1295: {region: 0x166, script: 0x5b, flags: 0x0}, 1296: {region: 0x166, script: 0x5b, flags: 0x0}, 1297: {region: 0x166, script: 0x5b, flags: 0x0}, 1298: {region: 0x1, script: 0x3e, flags: 0x0}, 1299: {region: 0x166, script: 0x5b, flags: 0x0}, 1300: {region: 0x166, script: 0x5b, flags: 0x0}, 1301: {region: 0x166, script: 0x5b, flags: 0x0}, 1302: {region: 0x166, script: 0x5b, flags: 0x0}, 1303: {region: 0x166, script: 0x5b, flags: 0x0}, 1304: {region: 0xd7, script: 0x5b, flags: 0x0}, 1305: {region: 0x166, script: 0x5b, flags: 0x0}, 1306: {region: 0x166, script: 0x5b, flags: 0x0}, 1307: {region: 0x166, script: 0x5b, flags: 0x0}, 1308: {region: 0x41, script: 0x5b, flags: 0x0}, 1309: {region: 0x166, script: 0x5b, flags: 0x0}, 1310: {region: 0xd0, script: 0x5b, flags: 0x0}, 1311: {region: 0x4a, script: 0x3, flags: 0x1}, 1312: {region: 0x166, script: 0x5b, flags: 0x0}, 1313: {region: 0x166, script: 0x5b, flags: 0x0}, 1314: {region: 0x166, script: 0x5b, flags: 0x0}, 1315: {region: 0x53, script: 0x5b, flags: 0x0}, 1316: {region: 0x10c, script: 0x5b, flags: 0x0}, 1318: {region: 0xa9, script: 0x5, flags: 0x0}, 1319: {region: 0xda, script: 0x5b, flags: 0x0}, 1320: {region: 0xbb, script: 0xeb, flags: 0x0}, 1321: {region: 0x4d, script: 0x14, flags: 0x1}, 1322: {region: 0x53, script: 0x7f, flags: 0x0}, 1323: {region: 0x166, script: 0x5b, flags: 0x0}, 1324: {region: 0x123, script: 0x5b, flags: 0x0}, 1325: {region: 0xd1, script: 0x5b, flags: 0x0}, 1326: {region: 0x166, script: 0x5b, flags: 0x0}, 1327: {region: 0x162, script: 0x5b, flags: 0x0}, 1329: {region: 0x12c, script: 0x5b, flags: 0x0}, } // likelyLangList holds lists info associated with likelyLang. // Size: 582 bytes, 97 elements var likelyLangList = [97]likelyScriptRegion{ 0: {region: 0x9d, script: 0x7, flags: 0x0}, 1: {region: 0xa2, script: 0x7a, flags: 0x2}, 2: {region: 0x11d, script: 0x87, flags: 0x2}, 3: {region: 0x32, script: 0x5b, flags: 0x0}, 4: {region: 0x9c, script: 0x5, flags: 0x4}, 5: {region: 0x9d, script: 0x5, flags: 0x4}, 6: {region: 0x107, script: 0x20, flags: 0x4}, 7: {region: 0x9d, script: 0x5, flags: 0x2}, 8: {region: 0x107, script: 0x20, flags: 0x0}, 9: {region: 0x38, script: 0x2f, flags: 0x2}, 10: {region: 0x136, script: 0x5b, flags: 0x0}, 11: {region: 0x7c, script: 0xd1, flags: 0x2}, 12: {region: 0x115, script: 0x5b, flags: 0x0}, 13: {region: 0x85, script: 0x1, flags: 0x2}, 14: {region: 0x5e, script: 0x1f, flags: 0x0}, 15: {region: 0x88, script: 0x60, flags: 0x2}, 16: {region: 0xd7, script: 0x5b, flags: 0x0}, 17: {region: 0x52, script: 0x5, flags: 0x4}, 18: {region: 0x10c, script: 0x5, flags: 0x4}, 19: {region: 0xaf, script: 0x20, flags: 0x0}, 20: {region: 0x24, script: 0x5, flags: 0x4}, 21: {region: 0x53, script: 0x5, flags: 0x4}, 22: {region: 0x9d, script: 0x5, flags: 0x4}, 23: {region: 0xc6, script: 0x5, flags: 0x4}, 24: {region: 0x53, script: 0x5, flags: 0x2}, 25: {region: 0x12c, script: 0x5b, flags: 0x0}, 26: {region: 0xb1, script: 0x5, flags: 0x4}, 27: {region: 0x9c, script: 0x5, flags: 0x2}, 28: {region: 0xa6, script: 0x20, flags: 0x0}, 29: {region: 0x53, script: 0x5, flags: 0x4}, 30: {region: 0x12c, script: 0x5b, flags: 0x4}, 31: {region: 0x53, script: 0x5, flags: 0x2}, 32: {region: 0x12c, script: 0x5b, flags: 0x2}, 33: {region: 0xdc, script: 0x22, flags: 0x0}, 34: {region: 0x9a, script: 0x5e, flags: 0x2}, 35: {region: 0x84, script: 0x5b, flags: 0x0}, 36: {region: 0x85, script: 0x7e, flags: 0x4}, 37: {region: 0x85, script: 0x7e, flags: 0x2}, 38: {region: 0xc6, script: 0x20, flags: 0x0}, 39: {region: 0x53, script: 0x71, flags: 0x4}, 40: {region: 0x53, script: 0x71, flags: 0x2}, 41: {region: 0xd1, script: 0x5b, flags: 0x0}, 42: {region: 0x4a, script: 0x5, flags: 0x4}, 43: {region: 0x96, script: 0x5, flags: 0x4}, 44: {region: 0x9a, script: 0x36, flags: 0x0}, 45: {region: 0xe9, script: 0x5, flags: 0x4}, 46: {region: 0xe9, script: 0x5, flags: 0x2}, 47: {region: 0x9d, script: 0x8d, flags: 0x0}, 48: {region: 0x53, script: 0x8e, flags: 0x2}, 49: {region: 0xbb, script: 0xeb, flags: 0x0}, 50: {region: 0xda, script: 0x5b, flags: 0x4}, 51: {region: 0xe9, script: 0x5, flags: 0x0}, 52: {region: 0x9a, script: 0x22, flags: 0x2}, 53: {region: 0x9a, script: 0x50, flags: 0x2}, 54: {region: 0x9a, script: 0xd5, flags: 0x2}, 55: {region: 0x106, script: 0x20, flags: 0x0}, 56: {region: 0xbe, script: 0x5b, flags: 0x4}, 57: {region: 0x105, script: 0x5b, flags: 0x4}, 58: {region: 0x107, script: 0x5b, flags: 0x4}, 59: {region: 0x12c, script: 0x5b, flags: 0x4}, 60: {region: 0x125, script: 0x20, flags: 0x0}, 61: {region: 0xe9, script: 0x5, flags: 0x4}, 62: {region: 0xe9, script: 0x5, flags: 0x2}, 63: {region: 0x53, script: 0x5, flags: 0x0}, 64: {region: 0xaf, script: 0x20, flags: 0x4}, 65: {region: 0xc6, script: 0x20, flags: 0x4}, 66: {region: 0xaf, script: 0x20, flags: 0x2}, 67: {region: 0x9a, script: 0xe, flags: 0x0}, 68: {region: 0xdc, script: 0x22, flags: 0x4}, 69: {region: 0xdc, script: 0x22, flags: 0x2}, 70: {region: 0x138, script: 0x5b, flags: 0x0}, 71: {region: 0x24, script: 0x5, flags: 0x4}, 72: {region: 0x53, script: 0x20, flags: 0x4}, 73: {region: 0x24, script: 0x5, flags: 0x2}, 74: {region: 0x8e, script: 0x3c, flags: 0x0}, 75: {region: 0x53, script: 0x3b, flags: 0x4}, 76: {region: 0x53, script: 0x3b, flags: 0x2}, 77: {region: 0x53, script: 0x3b, flags: 0x0}, 78: {region: 0x2f, script: 0x3c, flags: 0x4}, 79: {region: 0x3e, script: 0x3c, flags: 0x4}, 80: {region: 0x7c, script: 0x3c, flags: 0x4}, 81: {region: 0x7f, script: 0x3c, flags: 0x4}, 82: {region: 0x8e, script: 0x3c, flags: 0x4}, 83: {region: 0x96, script: 0x3c, flags: 0x4}, 84: {region: 0xc7, script: 0x3c, flags: 0x4}, 85: {region: 0xd1, script: 0x3c, flags: 0x4}, 86: {region: 0xe3, script: 0x3c, flags: 0x4}, 87: {region: 0xe6, script: 0x3c, flags: 0x4}, 88: {region: 0xe8, script: 0x3c, flags: 0x4}, 89: {region: 0x117, script: 0x3c, flags: 0x4}, 90: {region: 0x124, script: 0x3c, flags: 0x4}, 91: {region: 0x12f, script: 0x3c, flags: 0x4}, 92: {region: 0x136, script: 0x3c, flags: 0x4}, 93: {region: 0x13f, script: 0x3c, flags: 0x4}, 94: {region: 0x12f, script: 0x11, flags: 0x2}, 95: {region: 0x12f, script: 0x37, flags: 0x2}, 96: {region: 0x12f, script: 0x3c, flags: 0x2}, } type likelyLangScript struct { lang uint16 script uint16 flags uint8 } // likelyRegion is a lookup table, indexed by regionID, for the most likely // languages and scripts given incomplete information. If more entries exist // for a given regionID, lang and script are the index and size respectively // of the list in likelyRegionList. // TODO: exclude containers and user-definable regions from the list. // Size: 2154 bytes, 359 elements var likelyRegion = [359]likelyLangScript{ 34: {lang: 0xd7, script: 0x5b, flags: 0x0}, 35: {lang: 0x3a, script: 0x5, flags: 0x0}, 36: {lang: 0x0, script: 0x2, flags: 0x1}, 39: {lang: 0x2, script: 0x2, flags: 0x1}, 40: {lang: 0x4, script: 0x2, flags: 0x1}, 42: {lang: 0x3c0, script: 0x5b, flags: 0x0}, 43: {lang: 0x0, script: 0x5b, flags: 0x0}, 44: {lang: 0x13e, script: 0x5b, flags: 0x0}, 45: {lang: 0x41b, script: 0x5b, flags: 0x0}, 46: {lang: 0x10d, script: 0x5b, flags: 0x0}, 48: {lang: 0x367, script: 0x5b, flags: 0x0}, 49: {lang: 0x444, script: 0x5b, flags: 0x0}, 50: {lang: 0x58, script: 0x5b, flags: 0x0}, 51: {lang: 0x6, script: 0x2, flags: 0x1}, 53: {lang: 0xa5, script: 0xe, flags: 0x0}, 54: {lang: 0x367, script: 0x5b, flags: 0x0}, 55: {lang: 0x15e, script: 0x5b, flags: 0x0}, 56: {lang: 0x7e, script: 0x20, flags: 0x0}, 57: {lang: 0x3a, script: 0x5, flags: 0x0}, 58: {lang: 0x3d9, script: 0x5b, flags: 0x0}, 59: {lang: 0x15e, script: 0x5b, flags: 0x0}, 60: {lang: 0x15e, script: 0x5b, flags: 0x0}, 62: {lang: 0x31f, script: 0x5b, flags: 0x0}, 63: {lang: 0x13e, script: 0x5b, flags: 0x0}, 64: {lang: 0x3a1, script: 0x5b, flags: 0x0}, 65: {lang: 0x3c0, script: 0x5b, flags: 0x0}, 67: {lang: 0x8, script: 0x2, flags: 0x1}, 69: {lang: 0x0, script: 0x5b, flags: 0x0}, 71: {lang: 0x71, script: 0x20, flags: 0x0}, 73: {lang: 0x512, script: 0x3e, flags: 0x2}, 74: {lang: 0x31f, script: 0x5, flags: 0x2}, 75: {lang: 0x445, script: 0x5b, flags: 0x0}, 76: {lang: 0x15e, script: 0x5b, flags: 0x0}, 77: {lang: 0x15e, script: 0x5b, flags: 0x0}, 78: {lang: 0x10d, script: 0x5b, flags: 0x0}, 79: {lang: 0x15e, script: 0x5b, flags: 0x0}, 81: {lang: 0x13e, script: 0x5b, flags: 0x0}, 82: {lang: 0x15e, script: 0x5b, flags: 0x0}, 83: {lang: 0xa, script: 0x4, flags: 0x1}, 84: {lang: 0x13e, script: 0x5b, flags: 0x0}, 85: {lang: 0x0, script: 0x5b, flags: 0x0}, 87: {lang: 0x13e, script: 0x5b, flags: 0x0}, 90: {lang: 0x13e, script: 0x5b, flags: 0x0}, 91: {lang: 0x3c0, script: 0x5b, flags: 0x0}, 92: {lang: 0x3a1, script: 0x5b, flags: 0x0}, 94: {lang: 0xe, script: 0x2, flags: 0x1}, 95: {lang: 0xfa, script: 0x5b, flags: 0x0}, 97: {lang: 0x10d, script: 0x5b, flags: 0x0}, 99: {lang: 0x1, script: 0x5b, flags: 0x0}, 100: {lang: 0x101, script: 0x5b, flags: 0x0}, 102: {lang: 0x13e, script: 0x5b, flags: 0x0}, 104: {lang: 0x10, script: 0x2, flags: 0x1}, 105: {lang: 0x13e, script: 0x5b, flags: 0x0}, 106: {lang: 0x13e, script: 0x5b, flags: 0x0}, 107: {lang: 0x140, script: 0x5b, flags: 0x0}, 108: {lang: 0x3a, script: 0x5, flags: 0x0}, 109: {lang: 0x3a, script: 0x5, flags: 0x0}, 110: {lang: 0x46f, script: 0x2c, flags: 0x0}, 111: {lang: 0x13e, script: 0x5b, flags: 0x0}, 112: {lang: 0x12, script: 0x2, flags: 0x1}, 114: {lang: 0x10d, script: 0x5b, flags: 0x0}, 115: {lang: 0x151, script: 0x5b, flags: 0x0}, 116: {lang: 0x1c0, script: 0x22, flags: 0x2}, 119: {lang: 0x158, script: 0x5b, flags: 0x0}, 121: {lang: 0x15e, script: 0x5b, flags: 0x0}, 123: {lang: 0x15e, script: 0x5b, flags: 0x0}, 124: {lang: 0x14, script: 0x2, flags: 0x1}, 126: {lang: 0x16, script: 0x3, flags: 0x1}, 127: {lang: 0x15e, script: 0x5b, flags: 0x0}, 129: {lang: 0x21, script: 0x5b, flags: 0x0}, 131: {lang: 0x245, script: 0x5b, flags: 0x0}, 133: {lang: 0x15e, script: 0x5b, flags: 0x0}, 134: {lang: 0x15e, script: 0x5b, flags: 0x0}, 135: {lang: 0x13e, script: 0x5b, flags: 0x0}, 136: {lang: 0x19, script: 0x2, flags: 0x1}, 137: {lang: 0x0, script: 0x5b, flags: 0x0}, 138: {lang: 0x13e, script: 0x5b, flags: 0x0}, 140: {lang: 0x3c0, script: 0x5b, flags: 0x0}, 142: {lang: 0x529, script: 0x3c, flags: 0x0}, 143: {lang: 0x0, script: 0x5b, flags: 0x0}, 144: {lang: 0x13e, script: 0x5b, flags: 0x0}, 145: {lang: 0x1d1, script: 0x5b, flags: 0x0}, 146: {lang: 0x1d4, script: 0x5b, flags: 0x0}, 147: {lang: 0x1d5, script: 0x5b, flags: 0x0}, 149: {lang: 0x13e, script: 0x5b, flags: 0x0}, 150: {lang: 0x1b, script: 0x2, flags: 0x1}, 152: {lang: 0x1bc, script: 0x3e, flags: 0x0}, 154: {lang: 0x1d, script: 0x3, flags: 0x1}, 156: {lang: 0x3a, script: 0x5, flags: 0x0}, 157: {lang: 0x20, script: 0x2, flags: 0x1}, 158: {lang: 0x1f8, script: 0x5b, flags: 0x0}, 159: {lang: 0x1f9, script: 0x5b, flags: 0x0}, 162: {lang: 0x3a, script: 0x5, flags: 0x0}, 163: {lang: 0x200, script: 0x49, flags: 0x0}, 165: {lang: 0x445, script: 0x5b, flags: 0x0}, 166: {lang: 0x28a, script: 0x20, flags: 0x0}, 167: {lang: 0x22, script: 0x3, flags: 0x1}, 169: {lang: 0x25, script: 0x2, flags: 0x1}, 171: {lang: 0x254, script: 0x54, flags: 0x0}, 172: {lang: 0x254, script: 0x54, flags: 0x0}, 173: {lang: 0x3a, script: 0x5, flags: 0x0}, 175: {lang: 0x3e2, script: 0x20, flags: 0x0}, 176: {lang: 0x27, script: 0x2, flags: 0x1}, 177: {lang: 0x3a, script: 0x5, flags: 0x0}, 179: {lang: 0x10d, script: 0x5b, flags: 0x0}, 180: {lang: 0x40c, script: 0xd6, flags: 0x0}, 182: {lang: 0x43b, script: 0x5b, flags: 0x0}, 183: {lang: 0x2c0, script: 0x5b, flags: 0x0}, 184: {lang: 0x15e, script: 0x5b, flags: 0x0}, 185: {lang: 0x2c7, script: 0x5b, flags: 0x0}, 186: {lang: 0x3a, script: 0x5, flags: 0x0}, 187: {lang: 0x29, script: 0x2, flags: 0x1}, 188: {lang: 0x15e, script: 0x5b, flags: 0x0}, 189: {lang: 0x2b, script: 0x2, flags: 0x1}, 190: {lang: 0x432, script: 0x5b, flags: 0x0}, 191: {lang: 0x15e, script: 0x5b, flags: 0x0}, 192: {lang: 0x2f1, script: 0x5b, flags: 0x0}, 195: {lang: 0x2d, script: 0x2, flags: 0x1}, 196: {lang: 0xa0, script: 0x5b, flags: 0x0}, 197: {lang: 0x2f, script: 0x2, flags: 0x1}, 198: {lang: 0x31, script: 0x2, flags: 0x1}, 199: {lang: 0x33, script: 0x2, flags: 0x1}, 201: {lang: 0x15e, script: 0x5b, flags: 0x0}, 202: {lang: 0x35, script: 0x2, flags: 0x1}, 204: {lang: 0x320, script: 0x5b, flags: 0x0}, 205: {lang: 0x37, script: 0x3, flags: 0x1}, 206: {lang: 0x128, script: 0xed, flags: 0x0}, 208: {lang: 0x13e, script: 0x5b, flags: 0x0}, 209: {lang: 0x31f, script: 0x5b, flags: 0x0}, 210: {lang: 0x3c0, script: 0x5b, flags: 0x0}, 211: {lang: 0x16, script: 0x5b, flags: 0x0}, 212: {lang: 0x15e, script: 0x5b, flags: 0x0}, 213: {lang: 0x1b4, script: 0x5b, flags: 0x0}, 215: {lang: 0x1b4, script: 0x5, flags: 0x2}, 217: {lang: 0x13e, script: 0x5b, flags: 0x0}, 218: {lang: 0x367, script: 0x5b, flags: 0x0}, 219: {lang: 0x347, script: 0x5b, flags: 0x0}, 220: {lang: 0x351, script: 0x22, flags: 0x0}, 226: {lang: 0x3a, script: 0x5, flags: 0x0}, 227: {lang: 0x13e, script: 0x5b, flags: 0x0}, 229: {lang: 0x13e, script: 0x5b, flags: 0x0}, 230: {lang: 0x15e, script: 0x5b, flags: 0x0}, 231: {lang: 0x486, script: 0x5b, flags: 0x0}, 232: {lang: 0x153, script: 0x5b, flags: 0x0}, 233: {lang: 0x3a, script: 0x3, flags: 0x1}, 234: {lang: 0x3b3, script: 0x5b, flags: 0x0}, 235: {lang: 0x15e, script: 0x5b, flags: 0x0}, 237: {lang: 0x13e, script: 0x5b, flags: 0x0}, 238: {lang: 0x3a, script: 0x5, flags: 0x0}, 239: {lang: 0x3c0, script: 0x5b, flags: 0x0}, 241: {lang: 0x3a2, script: 0x5b, flags: 0x0}, 242: {lang: 0x194, script: 0x5b, flags: 0x0}, 244: {lang: 0x3a, script: 0x5, flags: 0x0}, 259: {lang: 0x15e, script: 0x5b, flags: 0x0}, 261: {lang: 0x3d, script: 0x2, flags: 0x1}, 262: {lang: 0x432, script: 0x20, flags: 0x0}, 263: {lang: 0x3f, script: 0x2, flags: 0x1}, 264: {lang: 0x3e5, script: 0x5b, flags: 0x0}, 265: {lang: 0x3a, script: 0x5, flags: 0x0}, 267: {lang: 0x15e, script: 0x5b, flags: 0x0}, 268: {lang: 0x3a, script: 0x5, flags: 0x0}, 269: {lang: 0x41, script: 0x2, flags: 0x1}, 272: {lang: 0x416, script: 0x5b, flags: 0x0}, 273: {lang: 0x347, script: 0x5b, flags: 0x0}, 274: {lang: 0x43, script: 0x2, flags: 0x1}, 276: {lang: 0x1f9, script: 0x5b, flags: 0x0}, 277: {lang: 0x15e, script: 0x5b, flags: 0x0}, 278: {lang: 0x429, script: 0x5b, flags: 0x0}, 279: {lang: 0x367, script: 0x5b, flags: 0x0}, 281: {lang: 0x3c0, script: 0x5b, flags: 0x0}, 283: {lang: 0x13e, script: 0x5b, flags: 0x0}, 285: {lang: 0x45, script: 0x2, flags: 0x1}, 289: {lang: 0x15e, script: 0x5b, flags: 0x0}, 290: {lang: 0x15e, script: 0x5b, flags: 0x0}, 291: {lang: 0x47, script: 0x2, flags: 0x1}, 292: {lang: 0x49, script: 0x3, flags: 0x1}, 293: {lang: 0x4c, script: 0x2, flags: 0x1}, 294: {lang: 0x477, script: 0x5b, flags: 0x0}, 295: {lang: 0x3c0, script: 0x5b, flags: 0x0}, 296: {lang: 0x476, script: 0x5b, flags: 0x0}, 297: {lang: 0x4e, script: 0x2, flags: 0x1}, 298: {lang: 0x482, script: 0x5b, flags: 0x0}, 300: {lang: 0x50, script: 0x4, flags: 0x1}, 302: {lang: 0x4a0, script: 0x5b, flags: 0x0}, 303: {lang: 0x54, script: 0x2, flags: 0x1}, 304: {lang: 0x445, script: 0x5b, flags: 0x0}, 305: {lang: 0x56, script: 0x3, flags: 0x1}, 306: {lang: 0x445, script: 0x5b, flags: 0x0}, 310: {lang: 0x512, script: 0x3e, flags: 0x2}, 311: {lang: 0x13e, script: 0x5b, flags: 0x0}, 312: {lang: 0x4bc, script: 0x5b, flags: 0x0}, 313: {lang: 0x1f9, script: 0x5b, flags: 0x0}, 316: {lang: 0x13e, script: 0x5b, flags: 0x0}, 319: {lang: 0x4c3, script: 0x5b, flags: 0x0}, 320: {lang: 0x8a, script: 0x5b, flags: 0x0}, 321: {lang: 0x15e, script: 0x5b, flags: 0x0}, 323: {lang: 0x41b, script: 0x5b, flags: 0x0}, 334: {lang: 0x59, script: 0x2, flags: 0x1}, 351: {lang: 0x3a, script: 0x5, flags: 0x0}, 352: {lang: 0x5b, script: 0x2, flags: 0x1}, 357: {lang: 0x423, script: 0x5b, flags: 0x0}, } // likelyRegionList holds lists info associated with likelyRegion. // Size: 558 bytes, 93 elements var likelyRegionList = [93]likelyLangScript{ 0: {lang: 0x148, script: 0x5, flags: 0x0}, 1: {lang: 0x476, script: 0x5b, flags: 0x0}, 2: {lang: 0x431, script: 0x5b, flags: 0x0}, 3: {lang: 0x2ff, script: 0x20, flags: 0x0}, 4: {lang: 0x1d7, script: 0x8, flags: 0x0}, 5: {lang: 0x274, script: 0x5b, flags: 0x0}, 6: {lang: 0xb7, script: 0x5b, flags: 0x0}, 7: {lang: 0x432, script: 0x20, flags: 0x0}, 8: {lang: 0x12d, script: 0xef, flags: 0x0}, 9: {lang: 0x351, script: 0x22, flags: 0x0}, 10: {lang: 0x529, script: 0x3b, flags: 0x0}, 11: {lang: 0x4ac, script: 0x5, flags: 0x0}, 12: {lang: 0x523, script: 0x5b, flags: 0x0}, 13: {lang: 0x29a, script: 0xee, flags: 0x0}, 14: {lang: 0x136, script: 0x34, flags: 0x0}, 15: {lang: 0x48a, script: 0x5b, flags: 0x0}, 16: {lang: 0x3a, script: 0x5, flags: 0x0}, 17: {lang: 0x15e, script: 0x5b, flags: 0x0}, 18: {lang: 0x27, script: 0x2c, flags: 0x0}, 19: {lang: 0x139, script: 0x5b, flags: 0x0}, 20: {lang: 0x26a, script: 0x5, flags: 0x2}, 21: {lang: 0x512, script: 0x3e, flags: 0x2}, 22: {lang: 0x210, script: 0x2e, flags: 0x0}, 23: {lang: 0x5, script: 0x20, flags: 0x0}, 24: {lang: 0x274, script: 0x5b, flags: 0x0}, 25: {lang: 0x136, script: 0x34, flags: 0x0}, 26: {lang: 0x2ff, script: 0x20, flags: 0x0}, 27: {lang: 0x1e1, script: 0x5b, flags: 0x0}, 28: {lang: 0x31f, script: 0x5, flags: 0x0}, 29: {lang: 0x1be, script: 0x22, flags: 0x0}, 30: {lang: 0x4b4, script: 0x5, flags: 0x0}, 31: {lang: 0x236, script: 0x76, flags: 0x0}, 32: {lang: 0x148, script: 0x5, flags: 0x0}, 33: {lang: 0x476, script: 0x5b, flags: 0x0}, 34: {lang: 0x24a, script: 0x4f, flags: 0x0}, 35: {lang: 0xe6, script: 0x5, flags: 0x0}, 36: {lang: 0x226, script: 0xee, flags: 0x0}, 37: {lang: 0x3a, script: 0x5, flags: 0x0}, 38: {lang: 0x15e, script: 0x5b, flags: 0x0}, 39: {lang: 0x2b8, script: 0x58, flags: 0x0}, 40: {lang: 0x226, script: 0xee, flags: 0x0}, 41: {lang: 0x3a, script: 0x5, flags: 0x0}, 42: {lang: 0x15e, script: 0x5b, flags: 0x0}, 43: {lang: 0x3dc, script: 0x5b, flags: 0x0}, 44: {lang: 0x4ae, script: 0x20, flags: 0x0}, 45: {lang: 0x2ff, script: 0x20, flags: 0x0}, 46: {lang: 0x431, script: 0x5b, flags: 0x0}, 47: {lang: 0x331, script: 0x76, flags: 0x0}, 48: {lang: 0x213, script: 0x5b, flags: 0x0}, 49: {lang: 0x30b, script: 0x20, flags: 0x0}, 50: {lang: 0x242, script: 0x5, flags: 0x0}, 51: {lang: 0x529, script: 0x3c, flags: 0x0}, 52: {lang: 0x3c0, script: 0x5b, flags: 0x0}, 53: {lang: 0x3a, script: 0x5, flags: 0x0}, 54: {lang: 0x15e, script: 0x5b, flags: 0x0}, 55: {lang: 0x2ed, script: 0x5b, flags: 0x0}, 56: {lang: 0x4b4, script: 0x5, flags: 0x0}, 57: {lang: 0x88, script: 0x22, flags: 0x0}, 58: {lang: 0x4b4, script: 0x5, flags: 0x0}, 59: {lang: 0x4b4, script: 0x5, flags: 0x0}, 60: {lang: 0xbe, script: 0x22, flags: 0x0}, 61: {lang: 0x3dc, script: 0x5b, flags: 0x0}, 62: {lang: 0x7e, script: 0x20, flags: 0x0}, 63: {lang: 0x3e2, script: 0x20, flags: 0x0}, 64: {lang: 0x267, script: 0x5b, flags: 0x0}, 65: {lang: 0x444, script: 0x5b, flags: 0x0}, 66: {lang: 0x512, script: 0x3e, flags: 0x0}, 67: {lang: 0x412, script: 0x5b, flags: 0x0}, 68: {lang: 0x4ae, script: 0x20, flags: 0x0}, 69: {lang: 0x3a, script: 0x5, flags: 0x0}, 70: {lang: 0x15e, script: 0x5b, flags: 0x0}, 71: {lang: 0x15e, script: 0x5b, flags: 0x0}, 72: {lang: 0x35, script: 0x5, flags: 0x0}, 73: {lang: 0x46b, script: 0xee, flags: 0x0}, 74: {lang: 0x2ec, script: 0x5, flags: 0x0}, 75: {lang: 0x30f, script: 0x76, flags: 0x0}, 76: {lang: 0x467, script: 0x20, flags: 0x0}, 77: {lang: 0x148, script: 0x5, flags: 0x0}, 78: {lang: 0x3a, script: 0x5, flags: 0x0}, 79: {lang: 0x15e, script: 0x5b, flags: 0x0}, 80: {lang: 0x48a, script: 0x5b, flags: 0x0}, 81: {lang: 0x58, script: 0x5, flags: 0x0}, 82: {lang: 0x219, script: 0x20, flags: 0x0}, 83: {lang: 0x81, script: 0x34, flags: 0x0}, 84: {lang: 0x529, script: 0x3c, flags: 0x0}, 85: {lang: 0x48c, script: 0x5b, flags: 0x0}, 86: {lang: 0x4ae, script: 0x20, flags: 0x0}, 87: {lang: 0x512, script: 0x3e, flags: 0x0}, 88: {lang: 0x3b3, script: 0x5b, flags: 0x0}, 89: {lang: 0x431, script: 0x5b, flags: 0x0}, 90: {lang: 0x432, script: 0x20, flags: 0x0}, 91: {lang: 0x15e, script: 0x5b, flags: 0x0}, 92: {lang: 0x446, script: 0x5, flags: 0x0}, } type likelyTag struct { lang uint16 region uint16 script uint16 } // Size: 198 bytes, 33 elements var likelyRegionGroup = [33]likelyTag{ 1: {lang: 0x139, region: 0xd7, script: 0x5b}, 2: {lang: 0x139, region: 0x136, script: 0x5b}, 3: {lang: 0x3c0, region: 0x41, script: 0x5b}, 4: {lang: 0x139, region: 0x2f, script: 0x5b}, 5: {lang: 0x139, region: 0xd7, script: 0x5b}, 6: {lang: 0x13e, region: 0xd0, script: 0x5b}, 7: {lang: 0x445, region: 0x130, script: 0x5b}, 8: {lang: 0x3a, region: 0x6c, script: 0x5}, 9: {lang: 0x445, region: 0x4b, script: 0x5b}, 10: {lang: 0x139, region: 0x162, script: 0x5b}, 11: {lang: 0x139, region: 0x136, script: 0x5b}, 12: {lang: 0x139, region: 0x136, script: 0x5b}, 13: {lang: 0x13e, region: 0x5a, script: 0x5b}, 14: {lang: 0x529, region: 0x53, script: 0x3b}, 15: {lang: 0x1be, region: 0x9a, script: 0x22}, 16: {lang: 0x1e1, region: 0x96, script: 0x5b}, 17: {lang: 0x1f9, region: 0x9f, script: 0x5b}, 18: {lang: 0x139, region: 0x2f, script: 0x5b}, 19: {lang: 0x139, region: 0xe7, script: 0x5b}, 20: {lang: 0x139, region: 0x8b, script: 0x5b}, 21: {lang: 0x41b, region: 0x143, script: 0x5b}, 22: {lang: 0x529, region: 0x53, script: 0x3b}, 23: {lang: 0x4bc, region: 0x138, script: 0x5b}, 24: {lang: 0x3a, region: 0x109, script: 0x5}, 25: {lang: 0x3e2, region: 0x107, script: 0x20}, 26: {lang: 0x3e2, region: 0x107, script: 0x20}, 27: {lang: 0x139, region: 0x7c, script: 0x5b}, 28: {lang: 0x10d, region: 0x61, script: 0x5b}, 29: {lang: 0x139, region: 0xd7, script: 0x5b}, 30: {lang: 0x13e, region: 0x1f, script: 0x5b}, 31: {lang: 0x139, region: 0x9b, script: 0x5b}, 32: {lang: 0x139, region: 0x7c, script: 0x5b}, } // Size: 264 bytes, 33 elements var regionContainment = [33]uint64{ // Entry 0 - 1F 0x00000001ffffffff, 0x00000000200007a2, 0x0000000000003044, 0x0000000000000008, 0x00000000803c0010, 0x0000000000000020, 0x0000000000000040, 0x0000000000000080, 0x0000000000000100, 0x0000000000000200, 0x0000000000000400, 0x000000004000384c, 0x0000000000001000, 0x0000000000002000, 0x0000000000004000, 0x0000000000008000, 0x0000000000010000, 0x0000000000020000, 0x0000000000040000, 0x0000000000080000, 0x0000000000100000, 0x0000000000200000, 0x0000000001c1c000, 0x0000000000800000, 0x0000000001000000, 0x000000001e020000, 0x0000000004000000, 0x0000000008000000, 0x0000000010000000, 0x00000000200006a0, 0x0000000040002048, 0x0000000080000000, // Entry 20 - 3F 0x0000000100000000, } // regionInclusion maps region identifiers to sets of regions in regionInclusionBits, // where each set holds all groupings that are directly connected in a region // containment graph. // Size: 359 bytes, 359 elements var regionInclusion = [359]uint8{ // Entry 0 - 3F 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x26, 0x23, 0x24, 0x26, 0x27, 0x22, 0x28, 0x29, 0x2a, 0x2b, 0x26, 0x2c, 0x24, 0x23, 0x26, 0x25, 0x2a, 0x2d, 0x2e, 0x24, 0x2f, 0x2d, 0x26, 0x30, 0x31, 0x28, // Entry 40 - 7F 0x26, 0x28, 0x26, 0x25, 0x31, 0x22, 0x32, 0x33, 0x34, 0x30, 0x22, 0x27, 0x27, 0x27, 0x35, 0x2d, 0x29, 0x28, 0x27, 0x36, 0x28, 0x22, 0x21, 0x34, 0x23, 0x21, 0x26, 0x2d, 0x26, 0x22, 0x37, 0x2e, 0x35, 0x2a, 0x22, 0x2f, 0x38, 0x26, 0x26, 0x21, 0x39, 0x39, 0x28, 0x38, 0x39, 0x39, 0x2f, 0x3a, 0x2f, 0x20, 0x21, 0x38, 0x3b, 0x28, 0x3c, 0x2c, 0x21, 0x2a, 0x35, 0x27, 0x38, 0x26, 0x24, 0x28, // Entry 80 - BF 0x2c, 0x2d, 0x23, 0x30, 0x2d, 0x2d, 0x26, 0x27, 0x3a, 0x22, 0x34, 0x3c, 0x2d, 0x28, 0x36, 0x22, 0x34, 0x3a, 0x26, 0x2e, 0x21, 0x39, 0x31, 0x38, 0x24, 0x2c, 0x25, 0x22, 0x24, 0x25, 0x2c, 0x3a, 0x2c, 0x26, 0x24, 0x36, 0x21, 0x2f, 0x3d, 0x31, 0x3c, 0x2f, 0x26, 0x36, 0x36, 0x24, 0x26, 0x3d, 0x31, 0x24, 0x26, 0x35, 0x25, 0x2d, 0x32, 0x38, 0x2a, 0x38, 0x39, 0x39, 0x35, 0x33, 0x23, 0x26, // Entry C0 - FF 0x2f, 0x3c, 0x21, 0x23, 0x2d, 0x31, 0x36, 0x36, 0x3c, 0x26, 0x2d, 0x26, 0x3a, 0x2f, 0x25, 0x2f, 0x34, 0x31, 0x2f, 0x32, 0x3b, 0x2d, 0x2b, 0x2d, 0x21, 0x34, 0x2a, 0x2c, 0x25, 0x21, 0x3c, 0x24, 0x29, 0x2b, 0x24, 0x34, 0x21, 0x28, 0x29, 0x3b, 0x31, 0x25, 0x2e, 0x30, 0x29, 0x26, 0x24, 0x3a, 0x21, 0x3c, 0x28, 0x21, 0x24, 0x21, 0x21, 0x1f, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, // Entry 100 - 13F 0x21, 0x21, 0x21, 0x2f, 0x21, 0x2e, 0x23, 0x33, 0x2f, 0x24, 0x3b, 0x2f, 0x39, 0x38, 0x31, 0x2d, 0x3a, 0x2c, 0x2e, 0x2d, 0x23, 0x2d, 0x2f, 0x28, 0x2f, 0x27, 0x33, 0x34, 0x26, 0x24, 0x32, 0x22, 0x26, 0x27, 0x22, 0x2d, 0x31, 0x3d, 0x29, 0x31, 0x3d, 0x39, 0x29, 0x31, 0x24, 0x26, 0x29, 0x36, 0x2f, 0x33, 0x2f, 0x21, 0x22, 0x21, 0x30, 0x28, 0x3d, 0x23, 0x26, 0x21, 0x28, 0x26, 0x26, 0x31, // Entry 140 - 17F 0x3b, 0x29, 0x21, 0x29, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x23, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x24, 0x24, 0x2f, 0x23, 0x32, 0x2f, 0x27, 0x2f, 0x21, } // regionInclusionBits is an array of bit vectors where every vector represents // a set of region groupings. These sets are used to compute the distance // between two regions for the purpose of language matching. // Size: 584 bytes, 73 elements var regionInclusionBits = [73]uint64{ // Entry 0 - 1F 0x0000000102400813, 0x00000000200007a3, 0x0000000000003844, 0x0000000040000808, 0x00000000803c0011, 0x0000000020000022, 0x0000000040000844, 0x0000000020000082, 0x0000000000000102, 0x0000000020000202, 0x0000000020000402, 0x000000004000384d, 0x0000000000001804, 0x0000000040002804, 0x0000000000404000, 0x0000000000408000, 0x0000000000410000, 0x0000000002020000, 0x0000000000040010, 0x0000000000080010, 0x0000000000100010, 0x0000000000200010, 0x0000000001c1c001, 0x0000000000c00000, 0x0000000001400000, 0x000000001e020001, 0x0000000006000000, 0x000000000a000000, 0x0000000012000000, 0x00000000200006a2, 0x0000000040002848, 0x0000000080000010, // Entry 20 - 3F 0x0000000100000001, 0x0000000000000001, 0x0000000080000000, 0x0000000000020000, 0x0000000001000000, 0x0000000000008000, 0x0000000000002000, 0x0000000000000200, 0x0000000000000008, 0x0000000000200000, 0x0000000110000000, 0x0000000000040000, 0x0000000008000000, 0x0000000000000020, 0x0000000104000000, 0x0000000000000080, 0x0000000000001000, 0x0000000000010000, 0x0000000000000400, 0x0000000004000000, 0x0000000000000040, 0x0000000010000000, 0x0000000000004000, 0x0000000101000000, 0x0000000108000000, 0x0000000000000100, 0x0000000100020000, 0x0000000000080000, 0x0000000000100000, 0x0000000000800000, 0x00000001ffffffff, 0x0000000122400fb3, // Entry 40 - 5F 0x00000001827c0813, 0x000000014240385f, 0x0000000103c1c813, 0x000000011e420813, 0x0000000112000001, 0x0000000106000001, 0x0000000101400001, 0x000000010a000001, 0x0000000102020001, } // regionInclusionNext marks, for each entry in regionInclusionBits, the set of // all groups that are reachable from the groups set in the respective entry. // Size: 73 bytes, 73 elements var regionInclusionNext = [73]uint8{ // Entry 0 - 3F 0x3e, 0x3f, 0x0b, 0x0b, 0x40, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x01, 0x41, 0x0b, 0x0b, 0x16, 0x16, 0x16, 0x19, 0x04, 0x04, 0x04, 0x04, 0x42, 0x16, 0x16, 0x43, 0x19, 0x19, 0x19, 0x01, 0x0b, 0x04, 0x00, 0x00, 0x1f, 0x11, 0x18, 0x0f, 0x0d, 0x09, 0x03, 0x15, 0x44, 0x12, 0x1b, 0x05, 0x45, 0x07, 0x0c, 0x10, 0x0a, 0x1a, 0x06, 0x1c, 0x0e, 0x46, 0x47, 0x08, 0x48, 0x13, 0x14, 0x17, 0x3e, 0x3e, // Entry 40 - 7F 0x3e, 0x3e, 0x3e, 0x3e, 0x43, 0x43, 0x42, 0x43, 0x43, } type parentRel struct { lang uint16 script uint16 maxScript uint16 toRegion uint16 fromRegion []uint16 } // Size: 414 bytes, 5 elements var parents = [5]parentRel{ 0: {lang: 0x139, script: 0x0, maxScript: 0x5b, toRegion: 0x1, fromRegion: []uint16{0x1a, 0x25, 0x26, 0x2f, 0x34, 0x36, 0x3d, 0x42, 0x46, 0x48, 0x49, 0x4a, 0x50, 0x52, 0x5d, 0x5e, 0x62, 0x65, 0x6e, 0x74, 0x75, 0x76, 0x7c, 0x7d, 0x80, 0x81, 0x82, 0x84, 0x8d, 0x8e, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0xa0, 0xa1, 0xa5, 0xa8, 0xaa, 0xae, 0xb2, 0xb5, 0xb6, 0xc0, 0xc7, 0xcb, 0xcc, 0xcd, 0xcf, 0xd1, 0xd3, 0xd6, 0xd7, 0xde, 0xe0, 0xe1, 0xe7, 0xe8, 0xe9, 0xec, 0xf1, 0x108, 0x10a, 0x10b, 0x10c, 0x10e, 0x10f, 0x113, 0x118, 0x11c, 0x11e, 0x120, 0x126, 0x12a, 0x12d, 0x12e, 0x130, 0x132, 0x13a, 0x13d, 0x140, 0x143, 0x162, 0x163, 0x165}}, 1: {lang: 0x139, script: 0x0, maxScript: 0x5b, toRegion: 0x1a, fromRegion: []uint16{0x2e, 0x4e, 0x61, 0x64, 0x73, 0xda, 0x10d, 0x110}}, 2: {lang: 0x13e, script: 0x0, maxScript: 0x5b, toRegion: 0x1f, fromRegion: []uint16{0x2c, 0x3f, 0x41, 0x48, 0x51, 0x54, 0x57, 0x5a, 0x66, 0x6a, 0x8a, 0x90, 0xd0, 0xd9, 0xe3, 0xe5, 0xed, 0xf2, 0x11b, 0x136, 0x137, 0x13c}}, 3: {lang: 0x3c0, script: 0x0, maxScript: 0x5b, toRegion: 0xef, fromRegion: []uint16{0x2a, 0x4e, 0x5b, 0x87, 0x8c, 0xb8, 0xc7, 0xd2, 0x119, 0x127}}, 4: {lang: 0x529, script: 0x3c, maxScript: 0x3c, toRegion: 0x8e, fromRegion: []uint16{0xc7}}, } // Total table size 30466 bytes (29KiB); checksum: 7544152B ================================================ FILE: vendor/golang.org/x/text/internal/language/tags.go ================================================ // Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package language // MustParse is like Parse, but panics if the given BCP 47 tag cannot be parsed. // It simplifies safe initialization of Tag values. func MustParse(s string) Tag { t, err := Parse(s) if err != nil { panic(err) } return t } // MustParseBase is like ParseBase, but panics if the given base cannot be parsed. // It simplifies safe initialization of Base values. func MustParseBase(s string) Language { b, err := ParseBase(s) if err != nil { panic(err) } return b } // MustParseScript is like ParseScript, but panics if the given script cannot be // parsed. It simplifies safe initialization of Script values. func MustParseScript(s string) Script { scr, err := ParseScript(s) if err != nil { panic(err) } return scr } // MustParseRegion is like ParseRegion, but panics if the given region cannot be // parsed. It simplifies safe initialization of Region values. func MustParseRegion(s string) Region { r, err := ParseRegion(s) if err != nil { panic(err) } return r } // Und is the root language. var Und Tag ================================================ FILE: vendor/golang.org/x/text/internal/match.go ================================================ // Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package internal // This file contains matchers that implement CLDR inheritance. // // See https://unicode.org/reports/tr35/#Locale_Inheritance. // // Some of the inheritance described in this document is already handled by // the cldr package. import ( "golang.org/x/text/language" ) // TODO: consider if (some of the) matching algorithm needs to be public after // getting some feel about what is generic and what is specific. // NewInheritanceMatcher returns a matcher that matches based on the inheritance // chain. // // The matcher uses canonicalization and the parent relationship to find a // match. The resulting match will always be either Und or a language with the // same language and script as the requested language. It will not match // languages for which there is understood to be mutual or one-directional // intelligibility. // // A Match will indicate an Exact match if the language matches after // canonicalization and High if the matched tag is a parent. func NewInheritanceMatcher(t []language.Tag) *InheritanceMatcher { tags := &InheritanceMatcher{make(map[language.Tag]int)} for i, tag := range t { ct, err := language.All.Canonicalize(tag) if err != nil { ct = tag } tags.index[ct] = i } return tags } type InheritanceMatcher struct { index map[language.Tag]int } func (m InheritanceMatcher) Match(want ...language.Tag) (language.Tag, int, language.Confidence) { for _, t := range want { ct, err := language.All.Canonicalize(t) if err != nil { ct = t } conf := language.Exact for { if index, ok := m.index[ct]; ok { return ct, index, conf } if ct == language.Und { break } ct = ct.Parent() conf = language.High } } return language.Und, 0, language.No } ================================================ FILE: vendor/golang.org/x/text/internal/number/common.go ================================================ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. package number import ( "unicode/utf8" "golang.org/x/text/internal/language/compact" ) // A system identifies a CLDR numbering system. type system byte type systemData struct { id system digitSize byte // number of UTF-8 bytes per digit zero [utf8.UTFMax]byte // UTF-8 sequence of zero digit. } // A SymbolType identifies a symbol of a specific kind. type SymbolType int const ( SymDecimal SymbolType = iota SymGroup SymList SymPercentSign SymPlusSign SymMinusSign SymExponential SymSuperscriptingExponent SymPerMille SymInfinity SymNan SymTimeSeparator NumSymbolTypes ) const hasNonLatnMask = 0x8000 // symOffset is an offset into altSymData if the bit indicated by hasNonLatnMask // is not 0 (with this bit masked out), and an offset into symIndex otherwise. // // TODO: this type can be a byte again if we use an indirection into altsymData // and introduce an alt -> offset slice (the length of this will be number of // alternatives plus 1). This also allows getting rid of the compactTag field // in altSymData. In total this will save about 1K. type symOffset uint16 type altSymData struct { compactTag compact.ID symIndex symOffset system system } ================================================ FILE: vendor/golang.org/x/text/internal/number/decimal.go ================================================ // Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:generate stringer -type RoundingMode package number import ( "math" "strconv" ) // RoundingMode determines how a number is rounded to the desired precision. type RoundingMode byte const ( ToNearestEven RoundingMode = iota // towards the nearest integer, or towards an even number if equidistant. ToNearestZero // towards the nearest integer, or towards zero if equidistant. ToNearestAway // towards the nearest integer, or away from zero if equidistant. ToPositiveInf // towards infinity ToNegativeInf // towards negative infinity ToZero // towards zero AwayFromZero // away from zero numModes ) const maxIntDigits = 20 // A Decimal represents a floating point number in decimal format. // Digits represents a number [0, 1.0), and the absolute value represented by // Decimal is Digits * 10^Exp. Leading and trailing zeros may be omitted and Exp // may point outside a valid position in Digits. // // Examples: // // Number Decimal // 12345 Digits: [1, 2, 3, 4, 5], Exp: 5 // 12.345 Digits: [1, 2, 3, 4, 5], Exp: 2 // 12000 Digits: [1, 2], Exp: 5 // 12000.00 Digits: [1, 2], Exp: 5 // 0.00123 Digits: [1, 2, 3], Exp: -2 // 0 Digits: [], Exp: 0 type Decimal struct { digits buf [maxIntDigits]byte } type digits struct { Digits []byte // mantissa digits, big-endian Exp int32 // exponent Neg bool Inf bool // Takes precedence over Digits and Exp. NaN bool // Takes precedence over Inf. } // Digits represents a floating point number represented in digits of the // base in which a number is to be displayed. It is similar to Decimal, but // keeps track of trailing fraction zeros and the comma placement for // engineering notation. Digits must have at least one digit. // // Examples: // // Number Decimal // decimal // 12345 Digits: [1, 2, 3, 4, 5], Exp: 5 End: 5 // 12.345 Digits: [1, 2, 3, 4, 5], Exp: 2 End: 5 // 12000 Digits: [1, 2], Exp: 5 End: 5 // 12000.00 Digits: [1, 2], Exp: 5 End: 7 // 0.00123 Digits: [1, 2, 3], Exp: -2 End: 3 // 0 Digits: [], Exp: 0 End: 1 // scientific (actual exp is Exp - Comma) // 0e0 Digits: [0], Exp: 1, End: 1, Comma: 1 // .0e0 Digits: [0], Exp: 0, End: 1, Comma: 0 // 0.0e0 Digits: [0], Exp: 1, End: 2, Comma: 1 // 1.23e4 Digits: [1, 2, 3], Exp: 5, End: 3, Comma: 1 // .123e5 Digits: [1, 2, 3], Exp: 5, End: 3, Comma: 0 // engineering // 12.3e3 Digits: [1, 2, 3], Exp: 5, End: 3, Comma: 2 type Digits struct { digits // End indicates the end position of the number. End int32 // For decimals Exp <= End. For scientific len(Digits) <= End. // Comma is used for the comma position for scientific (always 0 or 1) and // engineering notation (always 0, 1, 2, or 3). Comma uint8 // IsScientific indicates whether this number is to be rendered as a // scientific number. IsScientific bool } func (d *Digits) NumFracDigits() int { if d.Exp >= d.End { return 0 } return int(d.End - d.Exp) } // normalize returns a new Decimal with leading and trailing zeros removed. func (d *Decimal) normalize() (n Decimal) { n = *d b := n.Digits // Strip leading zeros. Resulting number of digits is significant digits. for len(b) > 0 && b[0] == 0 { b = b[1:] n.Exp-- } // Strip trailing zeros for len(b) > 0 && b[len(b)-1] == 0 { b = b[:len(b)-1] } if len(b) == 0 { n.Exp = 0 } n.Digits = b return n } func (d *Decimal) clear() { b := d.Digits if b == nil { b = d.buf[:0] } *d = Decimal{} d.Digits = b[:0] } func (x *Decimal) String() string { if x.NaN { return "NaN" } var buf []byte if x.Neg { buf = append(buf, '-') } if x.Inf { buf = append(buf, "Inf"...) return string(buf) } switch { case len(x.Digits) == 0: buf = append(buf, '0') case x.Exp <= 0: // 0.00ddd buf = append(buf, "0."...) buf = appendZeros(buf, -int(x.Exp)) buf = appendDigits(buf, x.Digits) case /* 0 < */ int(x.Exp) < len(x.Digits): // dd.ddd buf = appendDigits(buf, x.Digits[:x.Exp]) buf = append(buf, '.') buf = appendDigits(buf, x.Digits[x.Exp:]) default: // len(x.Digits) <= x.Exp // ddd00 buf = appendDigits(buf, x.Digits) buf = appendZeros(buf, int(x.Exp)-len(x.Digits)) } return string(buf) } func appendDigits(buf []byte, digits []byte) []byte { for _, c := range digits { buf = append(buf, c+'0') } return buf } // appendZeros appends n 0 digits to buf and returns buf. func appendZeros(buf []byte, n int) []byte { for ; n > 0; n-- { buf = append(buf, '0') } return buf } func (d *digits) round(mode RoundingMode, n int) { if n >= len(d.Digits) { return } // Make rounding decision: The result mantissa is truncated ("rounded down") // by default. Decide if we need to increment, or "round up", the (unsigned) // mantissa. inc := false switch mode { case ToNegativeInf: inc = d.Neg case ToPositiveInf: inc = !d.Neg case ToZero: // nothing to do case AwayFromZero: inc = true case ToNearestEven: inc = d.Digits[n] > 5 || d.Digits[n] == 5 && (len(d.Digits) > n+1 || n == 0 || d.Digits[n-1]&1 != 0) case ToNearestAway: inc = d.Digits[n] >= 5 case ToNearestZero: inc = d.Digits[n] > 5 || d.Digits[n] == 5 && len(d.Digits) > n+1 default: panic("unreachable") } if inc { d.roundUp(n) } else { d.roundDown(n) } } // roundFloat rounds a floating point number. func (r RoundingMode) roundFloat(x float64) float64 { // Make rounding decision: The result mantissa is truncated ("rounded down") // by default. Decide if we need to increment, or "round up", the (unsigned) // mantissa. abs := x if x < 0 { abs = -x } i, f := math.Modf(abs) if f == 0.0 { return x } inc := false switch r { case ToNegativeInf: inc = x < 0 case ToPositiveInf: inc = x >= 0 case ToZero: // nothing to do case AwayFromZero: inc = true case ToNearestEven: // TODO: check overflow inc = f > 0.5 || f == 0.5 && int64(i)&1 != 0 case ToNearestAway: inc = f >= 0.5 case ToNearestZero: inc = f > 0.5 default: panic("unreachable") } if inc { i += 1 } if abs != x { i = -i } return i } func (x *digits) roundUp(n int) { if n < 0 || n >= len(x.Digits) { return // nothing to do } // find first digit < 9 for n > 0 && x.Digits[n-1] >= 9 { n-- } if n == 0 { // all digits are 9s => round up to 1 and update exponent x.Digits[0] = 1 // ok since len(x.Digits) > n x.Digits = x.Digits[:1] x.Exp++ return } x.Digits[n-1]++ x.Digits = x.Digits[:n] // x already trimmed } func (x *digits) roundDown(n int) { if n < 0 || n >= len(x.Digits) { return // nothing to do } x.Digits = x.Digits[:n] trim(x) } // trim cuts off any trailing zeros from x's mantissa; // they are meaningless for the value of x. func trim(x *digits) { i := len(x.Digits) for i > 0 && x.Digits[i-1] == 0 { i-- } x.Digits = x.Digits[:i] if i == 0 { x.Exp = 0 } } // A Converter converts a number into decimals according to the given rounding // criteria. type Converter interface { Convert(d *Decimal, r RoundingContext) } const ( signed = true unsigned = false ) // Convert converts the given number to the decimal representation using the // supplied RoundingContext. func (d *Decimal) Convert(r RoundingContext, number interface{}) { switch f := number.(type) { case Converter: d.clear() f.Convert(d, r) case float32: d.ConvertFloat(r, float64(f), 32) case float64: d.ConvertFloat(r, f, 64) case int: d.ConvertInt(r, signed, uint64(f)) case int8: d.ConvertInt(r, signed, uint64(f)) case int16: d.ConvertInt(r, signed, uint64(f)) case int32: d.ConvertInt(r, signed, uint64(f)) case int64: d.ConvertInt(r, signed, uint64(f)) case uint: d.ConvertInt(r, unsigned, uint64(f)) case uint8: d.ConvertInt(r, unsigned, uint64(f)) case uint16: d.ConvertInt(r, unsigned, uint64(f)) case uint32: d.ConvertInt(r, unsigned, uint64(f)) case uint64: d.ConvertInt(r, unsigned, f) default: d.NaN = true // TODO: // case string: if produced by strconv, allows for easy arbitrary pos. // case reflect.Value: // case big.Float // case big.Int // case big.Rat? // catch underlyings using reflect or will this already be done by the // message package? } } // ConvertInt converts an integer to decimals. func (d *Decimal) ConvertInt(r RoundingContext, signed bool, x uint64) { if r.Increment > 0 { // TODO: if uint64 is too large, fall back to float64 if signed { d.ConvertFloat(r, float64(int64(x)), 64) } else { d.ConvertFloat(r, float64(x), 64) } return } d.clear() if signed && int64(x) < 0 { x = uint64(-int64(x)) d.Neg = true } d.fillIntDigits(x) d.Exp = int32(len(d.Digits)) } // ConvertFloat converts a floating point number to decimals. func (d *Decimal) ConvertFloat(r RoundingContext, x float64, size int) { d.clear() if math.IsNaN(x) { d.NaN = true return } // Simple case: decimal notation if r.Increment > 0 { scale := int(r.IncrementScale) mult := 1.0 if scale >= len(scales) { mult = math.Pow(10, float64(scale)) } else { mult = scales[scale] } // We multiply x instead of dividing inc as it gives less rounding // issues. x *= mult x /= float64(r.Increment) x = r.Mode.roundFloat(x) x *= float64(r.Increment) x /= mult } abs := x if x < 0 { d.Neg = true abs = -x } if math.IsInf(abs, 1) { d.Inf = true return } // By default we get the exact decimal representation. verb := byte('g') prec := -1 // As the strconv API does not return the rounding accuracy, we can only // round using ToNearestEven. if r.Mode == ToNearestEven { if n := r.RoundSignificantDigits(); n >= 0 { prec = n } else if n = r.RoundFractionDigits(); n >= 0 { prec = n verb = 'f' } } else { // TODO: At this point strconv's rounding is imprecise to the point that // it is not usable for this purpose. // See https://github.com/golang/go/issues/21714 // If rounding is requested, we ask for a large number of digits and // round from there to simulate rounding only once. // Ideally we would have strconv export an AppendDigits that would take // a rounding mode and/or return an accuracy. Something like this would // work: // AppendDigits(dst []byte, x float64, base, size, prec int) (digits []byte, exp, accuracy int) hasPrec := r.RoundSignificantDigits() >= 0 hasScale := r.RoundFractionDigits() >= 0 if hasPrec || hasScale { // prec is the number of mantissa bits plus some extra for safety. // We need at least the number of mantissa bits as decimals to // accurately represent the floating point without rounding, as each // bit requires one more decimal to represent: 0.5, 0.25, 0.125, ... prec = 60 } } b := strconv.AppendFloat(d.Digits[:0], abs, verb, prec, size) i := 0 k := 0 beforeDot := 1 for i < len(b) { if c := b[i]; '0' <= c && c <= '9' { b[k] = c - '0' k++ d.Exp += int32(beforeDot) } else if c == '.' { beforeDot = 0 d.Exp = int32(k) } else { break } i++ } d.Digits = b[:k] if i != len(b) { i += len("e") pSign := i exp := 0 for i++; i < len(b); i++ { exp *= 10 exp += int(b[i] - '0') } if b[pSign] == '-' { exp = -exp } d.Exp = int32(exp) + 1 } } func (d *Decimal) fillIntDigits(x uint64) { if cap(d.Digits) < maxIntDigits { d.Digits = d.buf[:] } else { d.Digits = d.buf[:maxIntDigits] } i := 0 for ; x > 0; x /= 10 { d.Digits[i] = byte(x % 10) i++ } d.Digits = d.Digits[:i] for p := 0; p < i; p++ { i-- d.Digits[p], d.Digits[i] = d.Digits[i], d.Digits[p] } } var scales [70]float64 func init() { x := 1.0 for i := range scales { scales[i] = x x *= 10 } } ================================================ FILE: vendor/golang.org/x/text/internal/number/format.go ================================================ // Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package number import ( "strconv" "unicode/utf8" "golang.org/x/text/language" ) // TODO: // - grouping of fractions // - allow user-defined superscript notation (such as 4) // - same for non-breaking spaces, like   // A VisibleDigits computes digits, comma placement and trailing zeros as they // will be shown to the user. type VisibleDigits interface { Digits(buf []byte, t language.Tag, scale int) Digits // TODO: Do we also need to add the verb or pass a format.State? } // Formatting proceeds along the following lines: // 0) Compose rounding information from format and context. // 1) Convert a number into a Decimal. // 2) Sanitize Decimal by adding trailing zeros, removing leading digits, and // (non-increment) rounding. The Decimal that results from this is suitable // for determining the plural form. // 3) Render the Decimal in the localized form. // Formatter contains all the information needed to render a number. type Formatter struct { Pattern Info } func (f *Formatter) init(t language.Tag, index []uint8) { f.Info = InfoFromTag(t) f.Pattern = formats[index[tagToID(t)]] } // InitPattern initializes a Formatter for the given Pattern. func (f *Formatter) InitPattern(t language.Tag, pat *Pattern) { f.Info = InfoFromTag(t) f.Pattern = *pat } // InitDecimal initializes a Formatter using the default Pattern for the given // language. func (f *Formatter) InitDecimal(t language.Tag) { f.init(t, tagToDecimal) } // InitScientific initializes a Formatter using the default Pattern for the // given language. func (f *Formatter) InitScientific(t language.Tag) { f.init(t, tagToScientific) f.Pattern.MinFractionDigits = 0 f.Pattern.MaxFractionDigits = -1 } // InitEngineering initializes a Formatter using the default Pattern for the // given language. func (f *Formatter) InitEngineering(t language.Tag) { f.init(t, tagToScientific) f.Pattern.MinFractionDigits = 0 f.Pattern.MaxFractionDigits = -1 f.Pattern.MaxIntegerDigits = 3 f.Pattern.MinIntegerDigits = 1 } // InitPercent initializes a Formatter using the default Pattern for the given // language. func (f *Formatter) InitPercent(t language.Tag) { f.init(t, tagToPercent) } // InitPerMille initializes a Formatter using the default Pattern for the given // language. func (f *Formatter) InitPerMille(t language.Tag) { f.init(t, tagToPercent) f.Pattern.DigitShift = 3 } func (f *Formatter) Append(dst []byte, x interface{}) []byte { var d Decimal r := f.RoundingContext d.Convert(r, x) return f.Render(dst, FormatDigits(&d, r)) } func FormatDigits(d *Decimal, r RoundingContext) Digits { if r.isScientific() { return scientificVisibleDigits(r, d) } return decimalVisibleDigits(r, d) } func (f *Formatter) Format(dst []byte, d *Decimal) []byte { return f.Render(dst, FormatDigits(d, f.RoundingContext)) } func (f *Formatter) Render(dst []byte, d Digits) []byte { var result []byte var postPrefix, preSuffix int if d.IsScientific { result, postPrefix, preSuffix = appendScientific(dst, f, &d) } else { result, postPrefix, preSuffix = appendDecimal(dst, f, &d) } if f.PadRune == 0 { return result } width := int(f.FormatWidth) if count := utf8.RuneCount(result); count < width { insertPos := 0 switch f.Flags & PadMask { case PadAfterPrefix: insertPos = postPrefix case PadBeforeSuffix: insertPos = preSuffix case PadAfterSuffix: insertPos = len(result) } num := width - count pad := [utf8.UTFMax]byte{' '} sz := 1 if r := f.PadRune; r != 0 { sz = utf8.EncodeRune(pad[:], r) } extra := sz * num if n := len(result) + extra; n < cap(result) { result = result[:n] copy(result[insertPos+extra:], result[insertPos:]) } else { buf := make([]byte, n) copy(buf, result[:insertPos]) copy(buf[insertPos+extra:], result[insertPos:]) result = buf } for ; num > 0; num-- { insertPos += copy(result[insertPos:], pad[:sz]) } } return result } // decimalVisibleDigits converts d according to the RoundingContext. Note that // the exponent may change as a result of this operation. func decimalVisibleDigits(r RoundingContext, d *Decimal) Digits { if d.NaN || d.Inf { return Digits{digits: digits{Neg: d.Neg, NaN: d.NaN, Inf: d.Inf}} } n := Digits{digits: d.normalize().digits} exp := n.Exp exp += int32(r.DigitShift) // Cap integer digits. Remove *most-significant* digits. if r.MaxIntegerDigits > 0 { if p := int(exp) - int(r.MaxIntegerDigits); p > 0 { if p > len(n.Digits) { p = len(n.Digits) } if n.Digits = n.Digits[p:]; len(n.Digits) == 0 { exp = 0 } else { exp -= int32(p) } // Strip leading zeros. for len(n.Digits) > 0 && n.Digits[0] == 0 { n.Digits = n.Digits[1:] exp-- } } } // Rounding if not already done by Convert. p := len(n.Digits) if maxSig := int(r.MaxSignificantDigits); maxSig > 0 { p = maxSig } if maxFrac := int(r.MaxFractionDigits); maxFrac >= 0 { if cap := int(exp) + maxFrac; cap < p { p = int(exp) + maxFrac } if p < 0 { p = 0 } } n.round(r.Mode, p) // set End (trailing zeros) n.End = int32(len(n.Digits)) if n.End == 0 { exp = 0 if r.MinFractionDigits > 0 { n.End = int32(r.MinFractionDigits) } if p := int32(r.MinSignificantDigits) - 1; p > n.End { n.End = p } } else { if end := exp + int32(r.MinFractionDigits); end > n.End { n.End = end } if n.End < int32(r.MinSignificantDigits) { n.End = int32(r.MinSignificantDigits) } } n.Exp = exp return n } // appendDecimal appends a formatted number to dst. It returns two possible // insertion points for padding. func appendDecimal(dst []byte, f *Formatter, n *Digits) (b []byte, postPre, preSuf int) { if dst, ok := f.renderSpecial(dst, n); ok { return dst, 0, len(dst) } digits := n.Digits exp := n.Exp // Split in integer and fraction part. var intDigits, fracDigits []byte numInt := 0 numFrac := int(n.End - n.Exp) if exp > 0 { numInt = int(exp) if int(exp) >= len(digits) { // ddddd | ddddd00 intDigits = digits } else { // ddd.dd intDigits = digits[:exp] fracDigits = digits[exp:] } } else { fracDigits = digits } neg := n.Neg affix, suffix := f.getAffixes(neg) dst = appendAffix(dst, f, affix, neg) savedLen := len(dst) minInt := int(f.MinIntegerDigits) if minInt == 0 && f.MinSignificantDigits > 0 { minInt = 1 } // add leading zeros for i := minInt; i > numInt; i-- { dst = f.AppendDigit(dst, 0) if f.needsSep(i) { dst = append(dst, f.Symbol(SymGroup)...) } } i := 0 for ; i < len(intDigits); i++ { dst = f.AppendDigit(dst, intDigits[i]) if f.needsSep(numInt - i) { dst = append(dst, f.Symbol(SymGroup)...) } } for ; i < numInt; i++ { dst = f.AppendDigit(dst, 0) if f.needsSep(numInt - i) { dst = append(dst, f.Symbol(SymGroup)...) } } if numFrac > 0 || f.Flags&AlwaysDecimalSeparator != 0 { dst = append(dst, f.Symbol(SymDecimal)...) } // Add trailing zeros i = 0 for n := -int(n.Exp); i < n; i++ { dst = f.AppendDigit(dst, 0) } for _, d := range fracDigits { i++ dst = f.AppendDigit(dst, d) } for ; i < numFrac; i++ { dst = f.AppendDigit(dst, 0) } return appendAffix(dst, f, suffix, neg), savedLen, len(dst) } func scientificVisibleDigits(r RoundingContext, d *Decimal) Digits { if d.NaN || d.Inf { return Digits{digits: digits{Neg: d.Neg, NaN: d.NaN, Inf: d.Inf}} } n := Digits{digits: d.normalize().digits, IsScientific: true} // Normalize to have at least one digit. This simplifies engineering // notation. if len(n.Digits) == 0 { n.Digits = append(n.Digits, 0) n.Exp = 1 } // Significant digits are transformed by the parser for scientific notation // and do not need to be handled here. maxInt, numInt := int(r.MaxIntegerDigits), int(r.MinIntegerDigits) if numInt == 0 { numInt = 1 } // If a maximum number of integers is specified, the minimum must be 1 // and the exponent is grouped by this number (e.g. for engineering) if maxInt > numInt { // Correct the exponent to reflect a single integer digit. numInt = 1 // engineering // 0.01234 ([12345]e-1) -> 1.2345e-2 12.345e-3 // 12345 ([12345]e+5) -> 1.2345e4 12.345e3 d := int(n.Exp-1) % maxInt if d < 0 { d += maxInt } numInt += d } p := len(n.Digits) if maxSig := int(r.MaxSignificantDigits); maxSig > 0 { p = maxSig } if maxFrac := int(r.MaxFractionDigits); maxFrac >= 0 && numInt+maxFrac < p { p = numInt + maxFrac } n.round(r.Mode, p) n.Comma = uint8(numInt) n.End = int32(len(n.Digits)) if minSig := int32(r.MinFractionDigits) + int32(numInt); n.End < minSig { n.End = minSig } return n } // appendScientific appends a formatted number to dst. It returns two possible // insertion points for padding. func appendScientific(dst []byte, f *Formatter, n *Digits) (b []byte, postPre, preSuf int) { if dst, ok := f.renderSpecial(dst, n); ok { return dst, 0, 0 } digits := n.Digits numInt := int(n.Comma) numFrac := int(n.End) - int(n.Comma) var intDigits, fracDigits []byte if numInt <= len(digits) { intDigits = digits[:numInt] fracDigits = digits[numInt:] } else { intDigits = digits } neg := n.Neg affix, suffix := f.getAffixes(neg) dst = appendAffix(dst, f, affix, neg) savedLen := len(dst) i := 0 for ; i < len(intDigits); i++ { dst = f.AppendDigit(dst, intDigits[i]) if f.needsSep(numInt - i) { dst = append(dst, f.Symbol(SymGroup)...) } } for ; i < numInt; i++ { dst = f.AppendDigit(dst, 0) if f.needsSep(numInt - i) { dst = append(dst, f.Symbol(SymGroup)...) } } if numFrac > 0 || f.Flags&AlwaysDecimalSeparator != 0 { dst = append(dst, f.Symbol(SymDecimal)...) } i = 0 for ; i < len(fracDigits); i++ { dst = f.AppendDigit(dst, fracDigits[i]) } for ; i < numFrac; i++ { dst = f.AppendDigit(dst, 0) } // exp buf := [12]byte{} // TODO: use exponential if superscripting is not available (no Latin // numbers or no tags) and use exponential in all other cases. exp := n.Exp - int32(n.Comma) exponential := f.Symbol(SymExponential) if exponential == "E" { dst = append(dst, f.Symbol(SymSuperscriptingExponent)...) dst = f.AppendDigit(dst, 1) dst = f.AppendDigit(dst, 0) switch { case exp < 0: dst = append(dst, superMinus...) exp = -exp case f.Flags&AlwaysExpSign != 0: dst = append(dst, superPlus...) } b = strconv.AppendUint(buf[:0], uint64(exp), 10) for i := len(b); i < int(f.MinExponentDigits); i++ { dst = append(dst, superDigits[0]...) } for _, c := range b { dst = append(dst, superDigits[c-'0']...) } } else { dst = append(dst, exponential...) switch { case exp < 0: dst = append(dst, f.Symbol(SymMinusSign)...) exp = -exp case f.Flags&AlwaysExpSign != 0: dst = append(dst, f.Symbol(SymPlusSign)...) } b = strconv.AppendUint(buf[:0], uint64(exp), 10) for i := len(b); i < int(f.MinExponentDigits); i++ { dst = f.AppendDigit(dst, 0) } for _, c := range b { dst = f.AppendDigit(dst, c-'0') } } return appendAffix(dst, f, suffix, neg), savedLen, len(dst) } const ( superMinus = "\u207B" // SUPERSCRIPT HYPHEN-MINUS superPlus = "\u207A" // SUPERSCRIPT PLUS SIGN ) var ( // Note: the digits are not sequential!!! superDigits = []string{ "\u2070", // SUPERSCRIPT DIGIT ZERO "\u00B9", // SUPERSCRIPT DIGIT ONE "\u00B2", // SUPERSCRIPT DIGIT TWO "\u00B3", // SUPERSCRIPT DIGIT THREE "\u2074", // SUPERSCRIPT DIGIT FOUR "\u2075", // SUPERSCRIPT DIGIT FIVE "\u2076", // SUPERSCRIPT DIGIT SIX "\u2077", // SUPERSCRIPT DIGIT SEVEN "\u2078", // SUPERSCRIPT DIGIT EIGHT "\u2079", // SUPERSCRIPT DIGIT NINE } ) func (f *Formatter) getAffixes(neg bool) (affix, suffix string) { str := f.Affix if str != "" { if f.NegOffset > 0 { if neg { str = str[f.NegOffset:] } else { str = str[:f.NegOffset] } } sufStart := 1 + str[0] affix = str[1:sufStart] suffix = str[sufStart+1:] } // TODO: introduce a NeedNeg sign to indicate if the left pattern already // has a sign marked? if f.NegOffset == 0 && (neg || f.Flags&AlwaysSign != 0) { affix = "-" + affix } return affix, suffix } func (f *Formatter) renderSpecial(dst []byte, d *Digits) (b []byte, ok bool) { if d.NaN { return fmtNaN(dst, f), true } if d.Inf { return fmtInfinite(dst, f, d), true } return dst, false } func fmtNaN(dst []byte, f *Formatter) []byte { return append(dst, f.Symbol(SymNan)...) } func fmtInfinite(dst []byte, f *Formatter, d *Digits) []byte { affix, suffix := f.getAffixes(d.Neg) dst = appendAffix(dst, f, affix, d.Neg) dst = append(dst, f.Symbol(SymInfinity)...) dst = appendAffix(dst, f, suffix, d.Neg) return dst } func appendAffix(dst []byte, f *Formatter, affix string, neg bool) []byte { quoting := false escaping := false for _, r := range affix { switch { case escaping: // escaping occurs both inside and outside of quotes dst = append(dst, string(r)...) escaping = false case r == '\\': escaping = true case r == '\'': quoting = !quoting case quoting: dst = append(dst, string(r)...) case r == '%': if f.DigitShift == 3 { dst = append(dst, f.Symbol(SymPerMille)...) } else { dst = append(dst, f.Symbol(SymPercentSign)...) } case r == '-' || r == '+': if neg { dst = append(dst, f.Symbol(SymMinusSign)...) } else if f.Flags&ElideSign == 0 { dst = append(dst, f.Symbol(SymPlusSign)...) } else { dst = append(dst, ' ') } default: dst = append(dst, string(r)...) } } return dst } ================================================ FILE: vendor/golang.org/x/text/internal/number/number.go ================================================ // Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:generate go run gen.go gen_common.go // Package number contains tools and data for formatting numbers. package number import ( "unicode/utf8" "golang.org/x/text/internal/language/compact" "golang.org/x/text/language" ) // Info holds number formatting configuration data. type Info struct { system systemData // numbering system information symIndex symOffset // index to symbols } // InfoFromLangID returns a Info for the given compact language identifier and // numbering system identifier. If system is the empty string, the default // numbering system will be taken for that language. func InfoFromLangID(compactIndex compact.ID, numberSystem string) Info { p := langToDefaults[compactIndex] // Lookup the entry for the language. pSymIndex := symOffset(0) // Default: Latin, default symbols system, ok := systemMap[numberSystem] if !ok { // Take the value for the default numbering system. This is by far the // most common case as an alternative numbering system is hardly used. if p&hasNonLatnMask == 0 { // Latn digits. pSymIndex = p } else { // Non-Latn or multiple numbering systems. // Take the first entry from the alternatives list. data := langToAlt[p&^hasNonLatnMask] pSymIndex = data.symIndex system = data.system } } else { langIndex := compactIndex ns := system outerLoop: for ; ; p = langToDefaults[langIndex] { if p&hasNonLatnMask == 0 { if ns == 0 { // The index directly points to the symbol data. pSymIndex = p break } // Move to the parent and retry. langIndex = langIndex.Parent() } else { // The index points to a list of symbol data indexes. for _, e := range langToAlt[p&^hasNonLatnMask:] { if e.compactTag != langIndex { if langIndex == 0 { // The CLDR root defines full symbol information for // all numbering systems (even though mostly by // means of aliases). Fall back to the default entry // for Latn if there is no data for the numbering // system of this language. if ns == 0 { break } // Fall back to Latin and start from the original // language. See // https://unicode.org/reports/tr35/#Locale_Inheritance. ns = numLatn langIndex = compactIndex continue outerLoop } // Fall back to parent. langIndex = langIndex.Parent() } else if e.system == ns { pSymIndex = e.symIndex break outerLoop } } } } } if int(system) >= len(numSysData) { // algorithmic // Will generate ASCII digits in case the user inadvertently calls // WriteDigit or Digit on it. d := numSysData[0] d.id = system return Info{ system: d, symIndex: pSymIndex, } } return Info{ system: numSysData[system], symIndex: pSymIndex, } } // InfoFromTag returns a Info for the given language tag. func InfoFromTag(t language.Tag) Info { return InfoFromLangID(tagToID(t), t.TypeForKey("nu")) } // IsDecimal reports if the numbering system can convert decimal to native // symbols one-to-one. func (n Info) IsDecimal() bool { return int(n.system.id) < len(numSysData) } // WriteDigit writes the UTF-8 sequence for n corresponding to the given ASCII // digit to dst and reports the number of bytes written. dst must be large // enough to hold the rune (can be up to utf8.UTFMax bytes). func (n Info) WriteDigit(dst []byte, asciiDigit rune) int { copy(dst, n.system.zero[:n.system.digitSize]) dst[n.system.digitSize-1] += byte(asciiDigit - '0') return int(n.system.digitSize) } // AppendDigit appends the UTF-8 sequence for n corresponding to the given digit // to dst and reports the number of bytes written. dst must be large enough to // hold the rune (can be up to utf8.UTFMax bytes). func (n Info) AppendDigit(dst []byte, digit byte) []byte { dst = append(dst, n.system.zero[:n.system.digitSize]...) dst[len(dst)-1] += digit return dst } // Digit returns the digit for the numbering system for the corresponding ASCII // value. For example, ni.Digit('3') could return '三'. Note that the argument // is the rune constant '3', which equals 51, not the integer constant 3. func (n Info) Digit(asciiDigit rune) rune { var x [utf8.UTFMax]byte n.WriteDigit(x[:], asciiDigit) r, _ := utf8.DecodeRune(x[:]) return r } // Symbol returns the string for the given symbol type. func (n Info) Symbol(t SymbolType) string { return symData.Elem(int(symIndex[n.symIndex][t])) } func formatForLang(t language.Tag, index []byte) *Pattern { return &formats[index[tagToID(t)]] } func tagToID(t language.Tag) compact.ID { id, _ := compact.RegionalID(compact.Tag(t)) return id } ================================================ FILE: vendor/golang.org/x/text/internal/number/pattern.go ================================================ // Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package number import ( "errors" "unicode/utf8" ) // This file contains a parser for the CLDR number patterns as described in // https://unicode.org/reports/tr35/tr35-numbers.html#Number_Format_Patterns. // // The following BNF is derived from this standard. // // pattern := subpattern (';' subpattern)? // subpattern := affix? number exponent? affix? // number := decimal | sigDigits // decimal := '#'* '0'* ('.' fraction)? | '#' | '0' // fraction := '0'* '#'* // sigDigits := '#'* '@' '@'* '#'* // exponent := 'E' '+'? '0'* '0' // padSpec := '*' \L // // Notes: // - An affix pattern may contain any runes, but runes with special meaning // should be escaped. // - Sequences of digits, '#', and '@' in decimal and sigDigits may have // interstitial commas. // TODO: replace special characters in affixes (-, +, ¤) with control codes. // Pattern holds information for formatting numbers. It is designed to hold // information from CLDR number patterns. // // This pattern is precompiled for all patterns for all languages. Even though // the number of patterns is not very large, we want to keep this small. // // This type is only intended for internal use. type Pattern struct { RoundingContext Affix string // includes prefix and suffix. First byte is prefix length. Offset uint16 // Offset into Affix for prefix and suffix NegOffset uint16 // Offset into Affix for negative prefix and suffix or 0. PadRune rune FormatWidth uint16 GroupingSize [2]uint8 Flags PatternFlag } // A RoundingContext indicates how a number should be converted to digits. // It contains all information needed to determine the "visible digits" as // required by the pluralization rules. type RoundingContext struct { // TODO: unify these two fields so that there is a more unambiguous meaning // of how precision is handled. MaxSignificantDigits int16 // -1 is unlimited MaxFractionDigits int16 // -1 is unlimited Increment uint32 IncrementScale uint8 // May differ from printed scale. Mode RoundingMode DigitShift uint8 // Number of decimals to shift. Used for % and ‰. // Number of digits. MinIntegerDigits uint8 MaxIntegerDigits uint8 MinFractionDigits uint8 MinSignificantDigits uint8 MinExponentDigits uint8 } // RoundSignificantDigits returns the number of significant digits an // implementation of Convert may round to or n < 0 if there is no maximum or // a maximum is not recommended. func (r *RoundingContext) RoundSignificantDigits() (n int) { if r.MaxFractionDigits == 0 && r.MaxSignificantDigits > 0 { return int(r.MaxSignificantDigits) } else if r.isScientific() && r.MaxIntegerDigits == 1 { if r.MaxSignificantDigits == 0 || int(r.MaxFractionDigits+1) == int(r.MaxSignificantDigits) { // Note: don't add DigitShift: it is only used for decimals. return int(r.MaxFractionDigits) + 1 } } return -1 } // RoundFractionDigits returns the number of fraction digits an implementation // of Convert may round to or n < 0 if there is no maximum or a maximum is not // recommended. func (r *RoundingContext) RoundFractionDigits() (n int) { if r.MinExponentDigits == 0 && r.MaxSignificantDigits == 0 && r.MaxFractionDigits >= 0 { return int(r.MaxFractionDigits) + int(r.DigitShift) } return -1 } // SetScale fixes the RoundingContext to a fixed number of fraction digits. func (r *RoundingContext) SetScale(scale int) { r.MinFractionDigits = uint8(scale) r.MaxFractionDigits = int16(scale) } func (r *RoundingContext) SetPrecision(prec int) { r.MaxSignificantDigits = int16(prec) } func (r *RoundingContext) isScientific() bool { return r.MinExponentDigits > 0 } func (f *Pattern) needsSep(pos int) bool { p := pos - 1 size := int(f.GroupingSize[0]) if size == 0 || p == 0 { return false } if p == size { return true } if p -= size; p < 0 { return false } // TODO: make second groupingsize the same as first if 0 so that we can // avoid this check. if x := int(f.GroupingSize[1]); x != 0 { size = x } return p%size == 0 } // A PatternFlag is a bit mask for the flag field of a Pattern. type PatternFlag uint8 const ( AlwaysSign PatternFlag = 1 << iota ElideSign // Use space instead of plus sign. AlwaysSign must be true. AlwaysExpSign AlwaysDecimalSeparator ParenthesisForNegative // Common pattern. Saves space. PadAfterNumber PadAfterAffix PadBeforePrefix = 0 // Default PadAfterPrefix = PadAfterAffix PadBeforeSuffix = PadAfterNumber PadAfterSuffix = PadAfterNumber | PadAfterAffix PadMask = PadAfterNumber | PadAfterAffix ) type parser struct { *Pattern leadingSharps int pos int err error doNotTerminate bool groupingCount uint hasGroup bool buf []byte } func (p *parser) setError(err error) { if p.err == nil { p.err = err } } func (p *parser) updateGrouping() { if p.hasGroup && 0 < p.groupingCount && p.groupingCount < 255 { p.GroupingSize[1] = p.GroupingSize[0] p.GroupingSize[0] = uint8(p.groupingCount) } p.groupingCount = 0 p.hasGroup = true } var ( // TODO: more sensible and localizeable error messages. errMultiplePadSpecifiers = errors.New("format: pattern has multiple pad specifiers") errInvalidPadSpecifier = errors.New("format: invalid pad specifier") errInvalidQuote = errors.New("format: invalid quote") errAffixTooLarge = errors.New("format: prefix or suffix exceeds maximum UTF-8 length of 256 bytes") errDuplicatePercentSign = errors.New("format: duplicate percent sign") errDuplicatePermilleSign = errors.New("format: duplicate permille sign") errUnexpectedEnd = errors.New("format: unexpected end of pattern") ) // ParsePattern extracts formatting information from a CLDR number pattern. // // See https://unicode.org/reports/tr35/tr35-numbers.html#Number_Format_Patterns. func ParsePattern(s string) (f *Pattern, err error) { p := parser{Pattern: &Pattern{}} s = p.parseSubPattern(s) if s != "" { // Parse negative sub pattern. if s[0] != ';' { p.setError(errors.New("format: error parsing first sub pattern")) return nil, p.err } neg := parser{Pattern: &Pattern{}} // just for extracting the affixes. s = neg.parseSubPattern(s[len(";"):]) p.NegOffset = uint16(len(p.buf)) p.buf = append(p.buf, neg.buf...) } if s != "" { p.setError(errors.New("format: spurious characters at end of pattern")) } if p.err != nil { return nil, p.err } if affix := string(p.buf); affix == "\x00\x00" || affix == "\x00\x00\x00\x00" { // No prefix or suffixes. p.NegOffset = 0 } else { p.Affix = affix } if p.Increment == 0 { p.IncrementScale = 0 } return p.Pattern, nil } func (p *parser) parseSubPattern(s string) string { s = p.parsePad(s, PadBeforePrefix) s = p.parseAffix(s) s = p.parsePad(s, PadAfterPrefix) s = p.parse(p.number, s) p.updateGrouping() s = p.parsePad(s, PadBeforeSuffix) s = p.parseAffix(s) s = p.parsePad(s, PadAfterSuffix) return s } func (p *parser) parsePad(s string, f PatternFlag) (tail string) { if len(s) >= 2 && s[0] == '*' { r, sz := utf8.DecodeRuneInString(s[1:]) if p.PadRune != 0 { p.err = errMultiplePadSpecifiers } else { p.Flags |= f p.PadRune = r } return s[1+sz:] } return s } func (p *parser) parseAffix(s string) string { x := len(p.buf) p.buf = append(p.buf, 0) // placeholder for affix length s = p.parse(p.affix, s) n := len(p.buf) - x - 1 if n > 0xFF { p.setError(errAffixTooLarge) } p.buf[x] = uint8(n) return s } // state implements a state transition. It returns the new state. A state // function may set an error on the parser or may simply return on an incorrect // token and let the next phase fail. type state func(r rune) state // parse repeatedly applies a state function on the given string until a // termination condition is reached. func (p *parser) parse(fn state, s string) (tail string) { for i, r := range s { p.doNotTerminate = false if fn = fn(r); fn == nil || p.err != nil { return s[i:] } p.FormatWidth++ } if p.doNotTerminate { p.setError(errUnexpectedEnd) } return "" } func (p *parser) affix(r rune) state { switch r { case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '#', '@', '.', '*', ',', ';': return nil case '\'': p.FormatWidth-- return p.escapeFirst case '%': if p.DigitShift != 0 { p.setError(errDuplicatePercentSign) } p.DigitShift = 2 case '\u2030': // ‰ Per mille if p.DigitShift != 0 { p.setError(errDuplicatePermilleSign) } p.DigitShift = 3 // TODO: handle currency somehow: ¤, ¤¤, ¤¤¤, ¤¤¤¤ } p.buf = append(p.buf, string(r)...) return p.affix } func (p *parser) escapeFirst(r rune) state { switch r { case '\'': p.buf = append(p.buf, "\\'"...) return p.affix default: p.buf = append(p.buf, '\'') p.buf = append(p.buf, string(r)...) } return p.escape } func (p *parser) escape(r rune) state { switch r { case '\'': p.FormatWidth-- p.buf = append(p.buf, '\'') return p.affix default: p.buf = append(p.buf, string(r)...) } return p.escape } // number parses a number. The BNF says the integer part should always have // a '0', but that does not appear to be the case according to the rest of the // documentation. We will allow having only '#' numbers. func (p *parser) number(r rune) state { switch r { case '#': p.groupingCount++ p.leadingSharps++ case '@': p.groupingCount++ p.leadingSharps = 0 p.MaxFractionDigits = -1 return p.sigDigits(r) case ',': if p.leadingSharps == 0 { // no leading commas return nil } p.updateGrouping() case 'E': p.MaxIntegerDigits = uint8(p.leadingSharps) return p.exponent case '.': // allow ".##" etc. p.updateGrouping() return p.fraction case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': return p.integer(r) default: return nil } return p.number } func (p *parser) integer(r rune) state { if !('0' <= r && r <= '9') { var next state switch r { case 'E': if p.leadingSharps > 0 { p.MaxIntegerDigits = uint8(p.leadingSharps) + p.MinIntegerDigits } next = p.exponent case '.': next = p.fraction case ',': next = p.integer } p.updateGrouping() return next } p.Increment = p.Increment*10 + uint32(r-'0') p.groupingCount++ p.MinIntegerDigits++ return p.integer } func (p *parser) sigDigits(r rune) state { switch r { case '@': p.groupingCount++ p.MaxSignificantDigits++ p.MinSignificantDigits++ case '#': return p.sigDigitsFinal(r) case 'E': p.updateGrouping() return p.normalizeSigDigitsWithExponent() default: p.updateGrouping() return nil } return p.sigDigits } func (p *parser) sigDigitsFinal(r rune) state { switch r { case '#': p.groupingCount++ p.MaxSignificantDigits++ case 'E': p.updateGrouping() return p.normalizeSigDigitsWithExponent() default: p.updateGrouping() return nil } return p.sigDigitsFinal } func (p *parser) normalizeSigDigitsWithExponent() state { p.MinIntegerDigits, p.MaxIntegerDigits = 1, 1 p.MinFractionDigits = p.MinSignificantDigits - 1 p.MaxFractionDigits = p.MaxSignificantDigits - 1 p.MinSignificantDigits, p.MaxSignificantDigits = 0, 0 return p.exponent } func (p *parser) fraction(r rune) state { switch r { case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': p.Increment = p.Increment*10 + uint32(r-'0') p.IncrementScale++ p.MinFractionDigits++ p.MaxFractionDigits++ case '#': p.MaxFractionDigits++ case 'E': if p.leadingSharps > 0 { p.MaxIntegerDigits = uint8(p.leadingSharps) + p.MinIntegerDigits } return p.exponent default: return nil } return p.fraction } func (p *parser) exponent(r rune) state { switch r { case '+': // Set mode and check it wasn't already set. if p.Flags&AlwaysExpSign != 0 || p.MinExponentDigits > 0 { break } p.Flags |= AlwaysExpSign p.doNotTerminate = true return p.exponent case '0': p.MinExponentDigits++ return p.exponent } // termination condition if p.MinExponentDigits == 0 { p.setError(errors.New("format: need at least one digit")) } return nil } ================================================ FILE: vendor/golang.org/x/text/internal/number/roundingmode_string.go ================================================ // Code generated by "stringer -type RoundingMode"; DO NOT EDIT. package number import "strconv" func _() { // An "invalid array index" compiler error signifies that the constant values have changed. // Re-run the stringer command to generate them again. var x [1]struct{} _ = x[ToNearestEven-0] _ = x[ToNearestZero-1] _ = x[ToNearestAway-2] _ = x[ToPositiveInf-3] _ = x[ToNegativeInf-4] _ = x[ToZero-5] _ = x[AwayFromZero-6] _ = x[numModes-7] } const _RoundingMode_name = "ToNearestEvenToNearestZeroToNearestAwayToPositiveInfToNegativeInfToZeroAwayFromZeronumModes" var _RoundingMode_index = [...]uint8{0, 13, 26, 39, 52, 65, 71, 83, 91} func (i RoundingMode) String() string { if i >= RoundingMode(len(_RoundingMode_index)-1) { return "RoundingMode(" + strconv.FormatInt(int64(i), 10) + ")" } return _RoundingMode_name[_RoundingMode_index[i]:_RoundingMode_index[i+1]] } ================================================ FILE: vendor/golang.org/x/text/internal/number/tables.go ================================================ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. package number import "golang.org/x/text/internal/stringset" // CLDRVersion is the CLDR version from which the tables in this package are derived. const CLDRVersion = "32" var numSysData = []systemData{ // 59 elements 0: {id: 0x0, digitSize: 0x1, zero: [4]uint8{0x30, 0x0, 0x0, 0x0}}, 1: {id: 0x1, digitSize: 0x4, zero: [4]uint8{0xf0, 0x9e, 0xa5, 0x90}}, 2: {id: 0x2, digitSize: 0x4, zero: [4]uint8{0xf0, 0x91, 0x9c, 0xb0}}, 3: {id: 0x3, digitSize: 0x2, zero: [4]uint8{0xd9, 0xa0, 0x0, 0x0}}, 4: {id: 0x4, digitSize: 0x2, zero: [4]uint8{0xdb, 0xb0, 0x0, 0x0}}, 5: {id: 0x5, digitSize: 0x3, zero: [4]uint8{0xe1, 0xad, 0x90, 0x0}}, 6: {id: 0x6, digitSize: 0x3, zero: [4]uint8{0xe0, 0xa7, 0xa6, 0x0}}, 7: {id: 0x7, digitSize: 0x4, zero: [4]uint8{0xf0, 0x91, 0xb1, 0x90}}, 8: {id: 0x8, digitSize: 0x4, zero: [4]uint8{0xf0, 0x91, 0x81, 0xa6}}, 9: {id: 0x9, digitSize: 0x4, zero: [4]uint8{0xf0, 0x91, 0x84, 0xb6}}, 10: {id: 0xa, digitSize: 0x3, zero: [4]uint8{0xea, 0xa9, 0x90, 0x0}}, 11: {id: 0xb, digitSize: 0x3, zero: [4]uint8{0xe0, 0xa5, 0xa6, 0x0}}, 12: {id: 0xc, digitSize: 0x3, zero: [4]uint8{0xef, 0xbc, 0x90, 0x0}}, 13: {id: 0xd, digitSize: 0x4, zero: [4]uint8{0xf0, 0x91, 0xb5, 0x90}}, 14: {id: 0xe, digitSize: 0x3, zero: [4]uint8{0xe0, 0xab, 0xa6, 0x0}}, 15: {id: 0xf, digitSize: 0x3, zero: [4]uint8{0xe0, 0xa9, 0xa6, 0x0}}, 16: {id: 0x10, digitSize: 0x4, zero: [4]uint8{0xf0, 0x96, 0xad, 0x90}}, 17: {id: 0x11, digitSize: 0x3, zero: [4]uint8{0xea, 0xa7, 0x90, 0x0}}, 18: {id: 0x12, digitSize: 0x3, zero: [4]uint8{0xea, 0xa4, 0x80, 0x0}}, 19: {id: 0x13, digitSize: 0x3, zero: [4]uint8{0xe1, 0x9f, 0xa0, 0x0}}, 20: {id: 0x14, digitSize: 0x3, zero: [4]uint8{0xe0, 0xb3, 0xa6, 0x0}}, 21: {id: 0x15, digitSize: 0x3, zero: [4]uint8{0xe1, 0xaa, 0x80, 0x0}}, 22: {id: 0x16, digitSize: 0x3, zero: [4]uint8{0xe1, 0xaa, 0x90, 0x0}}, 23: {id: 0x17, digitSize: 0x3, zero: [4]uint8{0xe0, 0xbb, 0x90, 0x0}}, 24: {id: 0x18, digitSize: 0x3, zero: [4]uint8{0xe1, 0xb1, 0x80, 0x0}}, 25: {id: 0x19, digitSize: 0x3, zero: [4]uint8{0xe1, 0xa5, 0x86, 0x0}}, 26: {id: 0x1a, digitSize: 0x4, zero: [4]uint8{0xf0, 0x9d, 0x9f, 0x8e}}, 27: {id: 0x1b, digitSize: 0x4, zero: [4]uint8{0xf0, 0x9d, 0x9f, 0x98}}, 28: {id: 0x1c, digitSize: 0x4, zero: [4]uint8{0xf0, 0x9d, 0x9f, 0xb6}}, 29: {id: 0x1d, digitSize: 0x4, zero: [4]uint8{0xf0, 0x9d, 0x9f, 0xac}}, 30: {id: 0x1e, digitSize: 0x4, zero: [4]uint8{0xf0, 0x9d, 0x9f, 0xa2}}, 31: {id: 0x1f, digitSize: 0x3, zero: [4]uint8{0xe0, 0xb5, 0xa6, 0x0}}, 32: {id: 0x20, digitSize: 0x4, zero: [4]uint8{0xf0, 0x91, 0x99, 0x90}}, 33: {id: 0x21, digitSize: 0x3, zero: [4]uint8{0xe1, 0xa0, 0x90, 0x0}}, 34: {id: 0x22, digitSize: 0x4, zero: [4]uint8{0xf0, 0x96, 0xa9, 0xa0}}, 35: {id: 0x23, digitSize: 0x3, zero: [4]uint8{0xea, 0xaf, 0xb0, 0x0}}, 36: {id: 0x24, digitSize: 0x3, zero: [4]uint8{0xe1, 0x81, 0x80, 0x0}}, 37: {id: 0x25, digitSize: 0x3, zero: [4]uint8{0xe1, 0x82, 0x90, 0x0}}, 38: {id: 0x26, digitSize: 0x3, zero: [4]uint8{0xea, 0xa7, 0xb0, 0x0}}, 39: {id: 0x27, digitSize: 0x4, zero: [4]uint8{0xf0, 0x91, 0x91, 0x90}}, 40: {id: 0x28, digitSize: 0x2, zero: [4]uint8{0xdf, 0x80, 0x0, 0x0}}, 41: {id: 0x29, digitSize: 0x3, zero: [4]uint8{0xe1, 0xb1, 0x90, 0x0}}, 42: {id: 0x2a, digitSize: 0x3, zero: [4]uint8{0xe0, 0xad, 0xa6, 0x0}}, 43: {id: 0x2b, digitSize: 0x4, zero: [4]uint8{0xf0, 0x90, 0x92, 0xa0}}, 44: {id: 0x2c, digitSize: 0x3, zero: [4]uint8{0xea, 0xa3, 0x90, 0x0}}, 45: {id: 0x2d, digitSize: 0x4, zero: [4]uint8{0xf0, 0x91, 0x87, 0x90}}, 46: {id: 0x2e, digitSize: 0x4, zero: [4]uint8{0xf0, 0x91, 0x8b, 0xb0}}, 47: {id: 0x2f, digitSize: 0x3, zero: [4]uint8{0xe0, 0xb7, 0xa6, 0x0}}, 48: {id: 0x30, digitSize: 0x4, zero: [4]uint8{0xf0, 0x91, 0x83, 0xb0}}, 49: {id: 0x31, digitSize: 0x3, zero: [4]uint8{0xe1, 0xae, 0xb0, 0x0}}, 50: {id: 0x32, digitSize: 0x4, zero: [4]uint8{0xf0, 0x91, 0x9b, 0x80}}, 51: {id: 0x33, digitSize: 0x3, zero: [4]uint8{0xe1, 0xa7, 0x90, 0x0}}, 52: {id: 0x34, digitSize: 0x3, zero: [4]uint8{0xe0, 0xaf, 0xa6, 0x0}}, 53: {id: 0x35, digitSize: 0x3, zero: [4]uint8{0xe0, 0xb1, 0xa6, 0x0}}, 54: {id: 0x36, digitSize: 0x3, zero: [4]uint8{0xe0, 0xb9, 0x90, 0x0}}, 55: {id: 0x37, digitSize: 0x3, zero: [4]uint8{0xe0, 0xbc, 0xa0, 0x0}}, 56: {id: 0x38, digitSize: 0x4, zero: [4]uint8{0xf0, 0x91, 0x93, 0x90}}, 57: {id: 0x39, digitSize: 0x3, zero: [4]uint8{0xea, 0x98, 0xa0, 0x0}}, 58: {id: 0x3a, digitSize: 0x4, zero: [4]uint8{0xf0, 0x91, 0xa3, 0xa0}}, } // Size: 378 bytes const ( numAdlm = 0x1 numAhom = 0x2 numArab = 0x3 numArabext = 0x4 numArmn = 0x3b numArmnlow = 0x3c numBali = 0x5 numBeng = 0x6 numBhks = 0x7 numBrah = 0x8 numCakm = 0x9 numCham = 0xa numCyrl = 0x3d numDeva = 0xb numEthi = 0x3e numFullwide = 0xc numGeor = 0x3f numGonm = 0xd numGrek = 0x40 numGreklow = 0x41 numGujr = 0xe numGuru = 0xf numHanidays = 0x42 numHanidec = 0x43 numHans = 0x44 numHansfin = 0x45 numHant = 0x46 numHantfin = 0x47 numHebr = 0x48 numHmng = 0x10 numJava = 0x11 numJpan = 0x49 numJpanfin = 0x4a numKali = 0x12 numKhmr = 0x13 numKnda = 0x14 numLana = 0x15 numLanatham = 0x16 numLaoo = 0x17 numLatn = 0x0 numLepc = 0x18 numLimb = 0x19 numMathbold = 0x1a numMathdbl = 0x1b numMathmono = 0x1c numMathsanb = 0x1d numMathsans = 0x1e numMlym = 0x1f numModi = 0x20 numMong = 0x21 numMroo = 0x22 numMtei = 0x23 numMymr = 0x24 numMymrshan = 0x25 numMymrtlng = 0x26 numNewa = 0x27 numNkoo = 0x28 numOlck = 0x29 numOrya = 0x2a numOsma = 0x2b numRoman = 0x4b numRomanlow = 0x4c numSaur = 0x2c numShrd = 0x2d numSind = 0x2e numSinh = 0x2f numSora = 0x30 numSund = 0x31 numTakr = 0x32 numTalu = 0x33 numTaml = 0x4d numTamldec = 0x34 numTelu = 0x35 numThai = 0x36 numTibt = 0x37 numTirh = 0x38 numVaii = 0x39 numWara = 0x3a numNumberSystems ) var systemMap = map[string]system{ "adlm": numAdlm, "ahom": numAhom, "arab": numArab, "arabext": numArabext, "armn": numArmn, "armnlow": numArmnlow, "bali": numBali, "beng": numBeng, "bhks": numBhks, "brah": numBrah, "cakm": numCakm, "cham": numCham, "cyrl": numCyrl, "deva": numDeva, "ethi": numEthi, "fullwide": numFullwide, "geor": numGeor, "gonm": numGonm, "grek": numGrek, "greklow": numGreklow, "gujr": numGujr, "guru": numGuru, "hanidays": numHanidays, "hanidec": numHanidec, "hans": numHans, "hansfin": numHansfin, "hant": numHant, "hantfin": numHantfin, "hebr": numHebr, "hmng": numHmng, "java": numJava, "jpan": numJpan, "jpanfin": numJpanfin, "kali": numKali, "khmr": numKhmr, "knda": numKnda, "lana": numLana, "lanatham": numLanatham, "laoo": numLaoo, "latn": numLatn, "lepc": numLepc, "limb": numLimb, "mathbold": numMathbold, "mathdbl": numMathdbl, "mathmono": numMathmono, "mathsanb": numMathsanb, "mathsans": numMathsans, "mlym": numMlym, "modi": numModi, "mong": numMong, "mroo": numMroo, "mtei": numMtei, "mymr": numMymr, "mymrshan": numMymrshan, "mymrtlng": numMymrtlng, "newa": numNewa, "nkoo": numNkoo, "olck": numOlck, "orya": numOrya, "osma": numOsma, "roman": numRoman, "romanlow": numRomanlow, "saur": numSaur, "shrd": numShrd, "sind": numSind, "sinh": numSinh, "sora": numSora, "sund": numSund, "takr": numTakr, "talu": numTalu, "taml": numTaml, "tamldec": numTamldec, "telu": numTelu, "thai": numThai, "tibt": numTibt, "tirh": numTirh, "vaii": numVaii, "wara": numWara, } var symIndex = [][12]uint8{ // 81 elements 0: [12]uint8{0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb}, 1: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb}, 2: [12]uint8{0x0, 0x1, 0x2, 0xd, 0xe, 0xf, 0x6, 0x7, 0x8, 0x9, 0x10, 0xb}, 3: [12]uint8{0x1, 0x0, 0x2, 0xd, 0xe, 0xf, 0x6, 0x7, 0x8, 0x9, 0x10, 0xb}, 4: [12]uint8{0x0, 0x1, 0x2, 0x11, 0xe, 0xf, 0x6, 0x7, 0x8, 0x9, 0x10, 0xb}, 5: [12]uint8{0x1, 0x0, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x12, 0xb}, 6: [12]uint8{0x1, 0x0, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb}, 7: [12]uint8{0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x13, 0xb}, 8: [12]uint8{0x0, 0x1, 0x2, 0x3, 0xe, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb}, 9: [12]uint8{0x1, 0x0, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0x0}, 10: [12]uint8{0x1, 0x0, 0x2, 0x3, 0x4, 0x5, 0x6, 0x14, 0x8, 0x9, 0xa, 0xb}, 11: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x5, 0x6, 0x14, 0x8, 0x9, 0xa, 0xb}, 12: [12]uint8{0x0, 0x15, 0x2, 0x3, 0x4, 0x5, 0x6, 0x14, 0x8, 0x9, 0xa, 0xb}, 13: [12]uint8{0x0, 0xc, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb}, 14: [12]uint8{0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x16, 0xb}, 15: [12]uint8{0x1, 0x0, 0x2, 0x3, 0x4, 0x5, 0x17, 0x7, 0x8, 0x9, 0xa, 0xb}, 16: [12]uint8{0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x17, 0x7, 0x8, 0x9, 0xa, 0x0}, 17: [12]uint8{0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x17, 0x7, 0x8, 0x9, 0xa, 0xb}, 18: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0x0}, 19: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x5, 0x18, 0x7, 0x8, 0x9, 0xa, 0xb}, 20: [12]uint8{0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x19, 0x1a, 0xa, 0xb}, 21: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x1b, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb}, 22: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x1b, 0x18, 0x7, 0x8, 0x9, 0xa, 0xb}, 23: [12]uint8{0x1, 0x0, 0x2, 0x3, 0x4, 0x1b, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb}, 24: [12]uint8{0x0, 0x1, 0x2, 0x3, 0xe, 0x1c, 0x6, 0x7, 0x8, 0x9, 0x1d, 0xb}, 25: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x1b, 0x6, 0x7, 0x8, 0x9, 0x1e, 0x0}, 26: [12]uint8{0x0, 0x15, 0x2, 0x3, 0x4, 0x1b, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb}, 27: [12]uint8{0x0, 0x1, 0x2, 0x3, 0xe, 0xf, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb}, 28: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x1f, 0xb}, 29: [12]uint8{0x0, 0x15, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb}, 30: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x20, 0xb}, 31: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x5, 0x21, 0x7, 0x8, 0x9, 0x22, 0xb}, 32: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x23, 0xb}, 33: [12]uint8{0x1, 0x0, 0x2, 0x3, 0x4, 0x1b, 0x18, 0x14, 0x8, 0x9, 0x24, 0xb}, 34: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x1b, 0x18, 0x7, 0x8, 0x9, 0x24, 0xb}, 35: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x25, 0xb}, 36: [12]uint8{0x1, 0x0, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x26, 0xb}, 37: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x27, 0xb}, 38: [12]uint8{0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x28, 0xb}, 39: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x29, 0xb}, 40: [12]uint8{0x1, 0x0, 0x2, 0x3, 0xe, 0x1c, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb}, 41: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x2a, 0xb}, 42: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x2b, 0xb}, 43: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x1b, 0x2c, 0x14, 0x8, 0x9, 0x24, 0xb}, 44: [12]uint8{0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0x0}, 45: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x5, 0x17, 0x7, 0x8, 0x9, 0xa, 0xb}, 46: [12]uint8{0x1, 0x0, 0x2, 0x3, 0x4, 0x1b, 0x17, 0x7, 0x8, 0x9, 0xa, 0xb}, 47: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x2d, 0x0}, 48: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x2e, 0xb}, 49: [12]uint8{0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x2f, 0xb}, 50: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x5, 0x30, 0x7, 0x8, 0x9, 0xa, 0xb}, 51: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x31, 0xb}, 52: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x32, 0xb}, 53: [12]uint8{0x1, 0x15, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb}, 54: [12]uint8{0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x33, 0xb}, 55: [12]uint8{0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x34, 0xb}, 56: [12]uint8{0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x7, 0x3c, 0x9, 0xa, 0xb}, 57: [12]uint8{0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x7, 0x3c, 0x9, 0x3d, 0xb}, 58: [12]uint8{0x35, 0x36, 0x37, 0x11, 0x3e, 0x3f, 0x3b, 0x7, 0x3c, 0x9, 0xa, 0xb}, 59: [12]uint8{0x35, 0x36, 0x37, 0x11, 0x39, 0x3a, 0x3b, 0x7, 0x3c, 0x9, 0xa, 0xb}, 60: [12]uint8{0x35, 0x36, 0x37, 0x11, 0x39, 0x40, 0x3b, 0x7, 0x3c, 0x9, 0xa, 0xb}, 61: [12]uint8{0x35, 0x36, 0x37, 0x41, 0x3e, 0x3f, 0x3b, 0x7, 0x3c, 0x9, 0xa, 0xb}, 62: [12]uint8{0x35, 0x36, 0x37, 0x38, 0x3e, 0x3f, 0x3b, 0x7, 0x3c, 0x9, 0xa, 0xb}, 63: [12]uint8{0x35, 0xc, 0x37, 0x38, 0x39, 0x42, 0x3b, 0x7, 0x3c, 0x9, 0xa, 0x0}, 64: [12]uint8{0x35, 0xc, 0x37, 0x38, 0x39, 0x42, 0x43, 0x7, 0x44, 0x9, 0x24, 0xb}, 65: [12]uint8{0x35, 0x36, 0x37, 0x38, 0x39, 0x5, 0x3b, 0x7, 0x3c, 0x9, 0x33, 0xb}, 66: [12]uint8{0x35, 0x36, 0x37, 0x11, 0x45, 0x46, 0x43, 0x7, 0x3c, 0x9, 0xa, 0x35}, 67: [12]uint8{0x35, 0x36, 0x37, 0x11, 0xe, 0x1c, 0x43, 0x7, 0x3c, 0x9, 0x1d, 0xb}, 68: [12]uint8{0x35, 0x36, 0x37, 0x11, 0xe, 0x1c, 0x43, 0x7, 0x3c, 0x9, 0xa, 0x35}, 69: [12]uint8{0x35, 0x36, 0x37, 0x11, 0x45, 0x5, 0x43, 0x7, 0x3c, 0x9, 0xa, 0x35}, 70: [12]uint8{0x1, 0xc, 0x37, 0x11, 0x45, 0x47, 0x43, 0x7, 0x3c, 0x9, 0xa, 0x0}, 71: [12]uint8{0x35, 0x1, 0x37, 0x11, 0x4, 0x5, 0x43, 0x7, 0x3c, 0x9, 0xa, 0x35}, 72: [12]uint8{0x1, 0xc, 0x37, 0x11, 0x45, 0x47, 0x43, 0x7, 0x3c, 0x9, 0x24, 0xb}, 73: [12]uint8{0x35, 0x36, 0x2, 0x3, 0x45, 0x46, 0x43, 0x7, 0x8, 0x9, 0xa, 0x35}, 74: [12]uint8{0x35, 0x36, 0x37, 0x11, 0x4, 0x5, 0x43, 0x7, 0x3c, 0x9, 0x31, 0x35}, 75: [12]uint8{0x35, 0x36, 0x37, 0x11, 0x4, 0x5, 0x43, 0x7, 0x3c, 0x9, 0x32, 0x35}, 76: [12]uint8{0x35, 0x36, 0x37, 0x11, 0x48, 0x46, 0x43, 0x7, 0x3c, 0x9, 0x33, 0x35}, 77: [12]uint8{0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0x49}, 78: [12]uint8{0x0, 0x1, 0x4a, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x28, 0xb}, 79: [12]uint8{0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x4b, 0xb}, 80: [12]uint8{0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x4c, 0x4d, 0xb}, } // Size: 996 bytes var symData = stringset.Set{ Data: "" + // Size: 599 bytes ".,;%+-E׉∞NaN:\u00a0\u200e%\u200e\u200e+\u200e-ليس\u00a0رقمًا٪NDТерхьаш" + "\u00a0дац·’mnne×10^0/00INF−\u200e−ناعددepälukuՈչԹარ\u00a0არის\u00a0რიცხვ" + "იZMdMсан\u00a0емес¤¤¤сан\u00a0эмесບໍ່\u200bແມ່ນ\u200bໂຕ\u200bເລກNSဂဏန်" + "းမဟုတ်သောННне\u00a0числочыыһыла\u00a0буотах·10^epilohosan\u00a0dälTFЕs" + "on\u00a0emasҳақиқий\u00a0сон\u00a0эмас非數值非数值٫٬؛٪\u061c\u061c+\u061c-اس؉ل" + "يس\u00a0رقم\u200f+\u200f-\u200f−٪\u200f\u061c−×۱۰^؉\u200f\u200e+\u200e" + "\u200e-\u200e\u200e−\u200e+\u200e:၊ཨང་མེན་གྲངས་མེདཨང་མད", Index: []uint16{ // 79 elements // Entry 0 - 3F 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0009, 0x000c, 0x000f, 0x0012, 0x0013, 0x0015, 0x001c, 0x0020, 0x0024, 0x0036, 0x0038, 0x003a, 0x0050, 0x0052, 0x0055, 0x0058, 0x0059, 0x005e, 0x0062, 0x0065, 0x0068, 0x006e, 0x0078, 0x0080, 0x0086, 0x00ae, 0x00af, 0x00b2, 0x00c2, 0x00c8, 0x00d8, 0x0105, 0x0107, 0x012e, 0x0132, 0x0142, 0x015e, 0x0163, 0x016a, 0x0173, 0x0175, 0x0177, 0x0180, 0x01a0, 0x01a9, 0x01b2, 0x01b4, 0x01b6, 0x01b8, 0x01bc, 0x01bf, 0x01c2, 0x01c6, 0x01c8, 0x01d6, 0x01da, // Entry 40 - 7F 0x01de, 0x01e4, 0x01e9, 0x01ee, 0x01f5, 0x01fa, 0x0201, 0x0208, 0x0211, 0x0215, 0x0218, 0x021b, 0x0230, 0x0248, 0x0257, }, } // Size: 797 bytes // langToDefaults maps a compact language index to the default numbering system // and default symbol set var langToDefaults = [775]symOffset{ // Entry 0 - 3F 0x8000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x8003, 0x0002, 0x0002, 0x0002, 0x0002, 0x0003, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0003, 0x0003, 0x0003, 0x0003, 0x0002, 0x0002, 0x0002, 0x0004, 0x0002, 0x0004, 0x0002, 0x0002, 0x0002, 0x0003, 0x0002, 0x0000, 0x8005, 0x0000, 0x0000, 0x0000, 0x8006, 0x0005, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, // Entry 40 - 7F 0x8009, 0x0000, 0x0000, 0x800a, 0x0000, 0x0000, 0x800c, 0x0001, 0x0000, 0x0000, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x800e, 0x0000, 0x0000, 0x0007, 0x0007, 0x0000, 0x0000, 0x0000, 0x0000, 0x800f, 0x0008, 0x0008, 0x8011, 0x0001, 0x0001, 0x0001, 0x803c, 0x0000, 0x0009, 0x0009, 0x0009, 0x0000, 0x0000, 0x000a, 0x000b, 0x000a, 0x000c, 0x000a, 0x000a, 0x000c, 0x000a, 0x000d, 0x000d, 0x000a, 0x000a, 0x0001, 0x0001, 0x0000, 0x0001, 0x0001, 0x803f, 0x0000, 0x0000, 0x0000, // Entry 80 - BF 0x000e, 0x000e, 0x000e, 0x000f, 0x000f, 0x000f, 0x0000, 0x0000, 0x0006, 0x0000, 0x0000, 0x0000, 0x000a, 0x0010, 0x0000, 0x0006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0011, 0x0000, 0x000a, 0x0000, 0x0000, 0x0000, 0x0000, 0x000a, 0x0000, 0x0009, 0x0000, 0x0000, 0x0012, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Entry C0 - FF 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0013, 0x0000, 0x0000, 0x000f, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0000, 0x0015, 0x0015, 0x0006, 0x0000, 0x0006, 0x0006, 0x0000, 0x0000, 0x0006, 0x0006, 0x0001, 0x0000, 0x0000, 0x0006, 0x0006, 0x0006, 0x0006, // Entry 100 - 13F 0x0000, 0x0000, 0x0006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0006, 0x0000, 0x0006, 0x0000, 0x0000, 0x0006, 0x0006, 0x0016, 0x0016, 0x0017, 0x0017, 0x0001, 0x0001, 0x8041, 0x0018, 0x0018, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0019, 0x0019, 0x0000, 0x0000, 0x0017, 0x0017, 0x0017, 0x8044, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0006, 0x0006, 0x0001, 0x0001, 0x0001, 0x0001, // Entry 140 - 17F 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0006, 0x0006, 0x0006, 0x0006, 0x0000, 0x0000, 0x8047, 0x0000, 0x0006, 0x0006, 0x001a, 0x001a, 0x001a, 0x001a, 0x804a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x804c, 0x001b, 0x0000, 0x0000, 0x0006, 0x0006, 0x0006, 0x000a, 0x000a, 0x0001, 0x0001, 0x001c, 0x001c, 0x0009, 0x0009, 0x804f, 0x0000, 0x0000, 0x0000, // Entry 180 - 1BF 0x0000, 0x0000, 0x8052, 0x0006, 0x0006, 0x001d, 0x0006, 0x0006, 0x0006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0006, 0x0006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x001e, 0x001e, 0x001f, 0x001f, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x000d, 0x000d, 0x0000, 0x0000, 0x0020, 0x0020, 0x0006, 0x0006, 0x0021, 0x0021, 0x0000, 0x0000, 0x0006, 0x0006, 0x0000, 0x0000, 0x8054, 0x0000, 0x0000, 0x0000, 0x0000, 0x8056, 0x001b, 0x0000, 0x0000, 0x0001, 0x0001, 0x0022, 0x0022, 0x0000, 0x0000, // Entry 1C0 - 1FF 0x0000, 0x0023, 0x0023, 0x0000, 0x0000, 0x0006, 0x0006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0024, 0x0024, 0x8058, 0x0000, 0x0000, 0x0016, 0x0016, 0x0006, 0x0006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0025, 0x0025, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x000d, 0x000d, 0x0000, 0x0000, 0x0006, 0x0006, 0x0000, 0x0000, 0x0006, 0x0006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x805a, 0x0000, 0x0000, 0x0006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0006, 0x0006, 0x805b, 0x0026, 0x805d, // Entry 200 - 23F 0x0000, 0x0000, 0x0000, 0x0000, 0x805e, 0x0015, 0x0015, 0x0000, 0x0000, 0x0006, 0x0006, 0x0006, 0x8061, 0x0000, 0x0000, 0x8062, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0001, 0x0001, 0x0015, 0x0015, 0x0006, 0x0006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0027, 0x0027, 0x0027, 0x8065, 0x8067, 0x001b, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x8069, 0x0028, 0x0006, 0x0001, 0x0006, 0x0001, 0x0001, 0x0001, // Entry 240 - 27F 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0006, 0x0000, 0x0000, 0x001a, 0x001a, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0000, 0x0000, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0006, 0x0006, 0x0000, 0x0000, 0x002a, 0x002a, 0x0000, 0x0000, 0x0000, 0x0000, 0x806b, 0x0000, 0x0000, 0x002b, 0x002b, 0x002b, 0x002b, 0x0006, 0x0006, 0x000d, 0x000d, 0x0006, 0x0006, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x002c, 0x002c, 0x002d, 0x002d, 0x002e, 0x002e, 0x0000, 0x0000, // Entry 280 - 2BF 0x0000, 0x002f, 0x002f, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0000, 0x0000, 0x0000, 0x806d, 0x0022, 0x0022, 0x0022, 0x0000, 0x0006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0030, 0x0030, 0x0000, 0x0000, 0x8071, 0x0031, 0x0006, // Entry 2C0 - 2FF 0x0006, 0x0006, 0x0000, 0x0001, 0x0001, 0x000d, 0x000d, 0x0001, 0x0001, 0x0000, 0x0000, 0x0032, 0x0032, 0x8074, 0x8076, 0x001b, 0x8077, 0x8079, 0x0028, 0x807b, 0x0034, 0x0033, 0x0033, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0006, 0x0006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0035, 0x0035, 0x0006, 0x0006, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0036, 0x0037, 0x0037, 0x0036, 0x0036, 0x0001, 0x0001, 0x807d, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8080, // Entry 300 - 33F 0x0036, 0x0036, 0x0036, 0x0000, 0x0000, 0x0006, 0x0014, } // Size: 1550 bytes // langToAlt is a list of numbering system and symbol set pairs, sorted and // marked by compact language index. var langToAlt = []altSymData{ // 131 elements 1: {compactTag: 0x0, symIndex: 0x38, system: 0x3}, 2: {compactTag: 0x0, symIndex: 0x42, system: 0x4}, 3: {compactTag: 0xa, symIndex: 0x39, system: 0x3}, 4: {compactTag: 0xa, symIndex: 0x2, system: 0x0}, 5: {compactTag: 0x28, symIndex: 0x0, system: 0x6}, 6: {compactTag: 0x2c, symIndex: 0x5, system: 0x0}, 7: {compactTag: 0x2c, symIndex: 0x3a, system: 0x3}, 8: {compactTag: 0x2c, symIndex: 0x42, system: 0x4}, 9: {compactTag: 0x40, symIndex: 0x0, system: 0x6}, 10: {compactTag: 0x43, symIndex: 0x0, system: 0x0}, 11: {compactTag: 0x43, symIndex: 0x4f, system: 0x37}, 12: {compactTag: 0x46, symIndex: 0x1, system: 0x0}, 13: {compactTag: 0x46, symIndex: 0x38, system: 0x3}, 14: {compactTag: 0x54, symIndex: 0x0, system: 0x9}, 15: {compactTag: 0x5d, symIndex: 0x3a, system: 0x3}, 16: {compactTag: 0x5d, symIndex: 0x8, system: 0x0}, 17: {compactTag: 0x60, symIndex: 0x1, system: 0x0}, 18: {compactTag: 0x60, symIndex: 0x38, system: 0x3}, 19: {compactTag: 0x60, symIndex: 0x42, system: 0x4}, 20: {compactTag: 0x60, symIndex: 0x0, system: 0x5}, 21: {compactTag: 0x60, symIndex: 0x0, system: 0x6}, 22: {compactTag: 0x60, symIndex: 0x0, system: 0x8}, 23: {compactTag: 0x60, symIndex: 0x0, system: 0x9}, 24: {compactTag: 0x60, symIndex: 0x0, system: 0xa}, 25: {compactTag: 0x60, symIndex: 0x0, system: 0xb}, 26: {compactTag: 0x60, symIndex: 0x0, system: 0xc}, 27: {compactTag: 0x60, symIndex: 0x0, system: 0xd}, 28: {compactTag: 0x60, symIndex: 0x0, system: 0xe}, 29: {compactTag: 0x60, symIndex: 0x0, system: 0xf}, 30: {compactTag: 0x60, symIndex: 0x0, system: 0x11}, 31: {compactTag: 0x60, symIndex: 0x0, system: 0x12}, 32: {compactTag: 0x60, symIndex: 0x0, system: 0x13}, 33: {compactTag: 0x60, symIndex: 0x0, system: 0x14}, 34: {compactTag: 0x60, symIndex: 0x0, system: 0x15}, 35: {compactTag: 0x60, symIndex: 0x0, system: 0x16}, 36: {compactTag: 0x60, symIndex: 0x0, system: 0x17}, 37: {compactTag: 0x60, symIndex: 0x0, system: 0x18}, 38: {compactTag: 0x60, symIndex: 0x0, system: 0x19}, 39: {compactTag: 0x60, symIndex: 0x0, system: 0x1f}, 40: {compactTag: 0x60, symIndex: 0x0, system: 0x21}, 41: {compactTag: 0x60, symIndex: 0x0, system: 0x23}, 42: {compactTag: 0x60, symIndex: 0x0, system: 0x24}, 43: {compactTag: 0x60, symIndex: 0x0, system: 0x25}, 44: {compactTag: 0x60, symIndex: 0x0, system: 0x28}, 45: {compactTag: 0x60, symIndex: 0x0, system: 0x29}, 46: {compactTag: 0x60, symIndex: 0x0, system: 0x2a}, 47: {compactTag: 0x60, symIndex: 0x0, system: 0x2b}, 48: {compactTag: 0x60, symIndex: 0x0, system: 0x2c}, 49: {compactTag: 0x60, symIndex: 0x0, system: 0x2d}, 50: {compactTag: 0x60, symIndex: 0x0, system: 0x30}, 51: {compactTag: 0x60, symIndex: 0x0, system: 0x31}, 52: {compactTag: 0x60, symIndex: 0x0, system: 0x32}, 53: {compactTag: 0x60, symIndex: 0x0, system: 0x33}, 54: {compactTag: 0x60, symIndex: 0x0, system: 0x34}, 55: {compactTag: 0x60, symIndex: 0x0, system: 0x35}, 56: {compactTag: 0x60, symIndex: 0x0, system: 0x36}, 57: {compactTag: 0x60, symIndex: 0x0, system: 0x37}, 58: {compactTag: 0x60, symIndex: 0x0, system: 0x39}, 59: {compactTag: 0x60, symIndex: 0x0, system: 0x43}, 60: {compactTag: 0x64, symIndex: 0x0, system: 0x0}, 61: {compactTag: 0x64, symIndex: 0x38, system: 0x3}, 62: {compactTag: 0x64, symIndex: 0x42, system: 0x4}, 63: {compactTag: 0x7c, symIndex: 0x50, system: 0x37}, 64: {compactTag: 0x7c, symIndex: 0x0, system: 0x0}, 65: {compactTag: 0x114, symIndex: 0x43, system: 0x4}, 66: {compactTag: 0x114, symIndex: 0x18, system: 0x0}, 67: {compactTag: 0x114, symIndex: 0x3b, system: 0x3}, 68: {compactTag: 0x123, symIndex: 0x1, system: 0x0}, 69: {compactTag: 0x123, symIndex: 0x3c, system: 0x3}, 70: {compactTag: 0x123, symIndex: 0x44, system: 0x4}, 71: {compactTag: 0x158, symIndex: 0x0, system: 0x0}, 72: {compactTag: 0x158, symIndex: 0x3b, system: 0x3}, 73: {compactTag: 0x158, symIndex: 0x45, system: 0x4}, 74: {compactTag: 0x160, symIndex: 0x0, system: 0x0}, 75: {compactTag: 0x160, symIndex: 0x38, system: 0x3}, 76: {compactTag: 0x16d, symIndex: 0x1b, system: 0x0}, 77: {compactTag: 0x16d, symIndex: 0x0, system: 0x9}, 78: {compactTag: 0x16d, symIndex: 0x0, system: 0xa}, 79: {compactTag: 0x17c, symIndex: 0x0, system: 0x0}, 80: {compactTag: 0x17c, symIndex: 0x3d, system: 0x3}, 81: {compactTag: 0x17c, symIndex: 0x42, system: 0x4}, 82: {compactTag: 0x182, symIndex: 0x6, system: 0x0}, 83: {compactTag: 0x182, symIndex: 0x38, system: 0x3}, 84: {compactTag: 0x1b1, symIndex: 0x0, system: 0x0}, 85: {compactTag: 0x1b1, symIndex: 0x3e, system: 0x3}, 86: {compactTag: 0x1b6, symIndex: 0x42, system: 0x4}, 87: {compactTag: 0x1b6, symIndex: 0x1b, system: 0x0}, 88: {compactTag: 0x1d2, symIndex: 0x42, system: 0x4}, 89: {compactTag: 0x1d2, symIndex: 0x0, system: 0x0}, 90: {compactTag: 0x1f3, symIndex: 0x0, system: 0xb}, 91: {compactTag: 0x1fd, symIndex: 0x4e, system: 0x24}, 92: {compactTag: 0x1fd, symIndex: 0x26, system: 0x0}, 93: {compactTag: 0x1ff, symIndex: 0x42, system: 0x4}, 94: {compactTag: 0x204, symIndex: 0x15, system: 0x0}, 95: {compactTag: 0x204, symIndex: 0x3f, system: 0x3}, 96: {compactTag: 0x204, symIndex: 0x46, system: 0x4}, 97: {compactTag: 0x20c, symIndex: 0x0, system: 0xb}, 98: {compactTag: 0x20f, symIndex: 0x6, system: 0x0}, 99: {compactTag: 0x20f, symIndex: 0x38, system: 0x3}, 100: {compactTag: 0x20f, symIndex: 0x42, system: 0x4}, 101: {compactTag: 0x22e, symIndex: 0x0, system: 0x0}, 102: {compactTag: 0x22e, symIndex: 0x47, system: 0x4}, 103: {compactTag: 0x22f, symIndex: 0x42, system: 0x4}, 104: {compactTag: 0x22f, symIndex: 0x1b, system: 0x0}, 105: {compactTag: 0x238, symIndex: 0x42, system: 0x4}, 106: {compactTag: 0x238, symIndex: 0x28, system: 0x0}, 107: {compactTag: 0x265, symIndex: 0x38, system: 0x3}, 108: {compactTag: 0x265, symIndex: 0x0, system: 0x0}, 109: {compactTag: 0x29d, symIndex: 0x22, system: 0x0}, 110: {compactTag: 0x29d, symIndex: 0x40, system: 0x3}, 111: {compactTag: 0x29d, symIndex: 0x48, system: 0x4}, 112: {compactTag: 0x29d, symIndex: 0x4d, system: 0xc}, 113: {compactTag: 0x2bd, symIndex: 0x31, system: 0x0}, 114: {compactTag: 0x2bd, symIndex: 0x3e, system: 0x3}, 115: {compactTag: 0x2bd, symIndex: 0x42, system: 0x4}, 116: {compactTag: 0x2cd, symIndex: 0x1b, system: 0x0}, 117: {compactTag: 0x2cd, symIndex: 0x49, system: 0x4}, 118: {compactTag: 0x2ce, symIndex: 0x49, system: 0x4}, 119: {compactTag: 0x2d0, symIndex: 0x33, system: 0x0}, 120: {compactTag: 0x2d0, symIndex: 0x4a, system: 0x4}, 121: {compactTag: 0x2d1, symIndex: 0x42, system: 0x4}, 122: {compactTag: 0x2d1, symIndex: 0x28, system: 0x0}, 123: {compactTag: 0x2d3, symIndex: 0x34, system: 0x0}, 124: {compactTag: 0x2d3, symIndex: 0x4b, system: 0x4}, 125: {compactTag: 0x2f9, symIndex: 0x0, system: 0x0}, 126: {compactTag: 0x2f9, symIndex: 0x38, system: 0x3}, 127: {compactTag: 0x2f9, symIndex: 0x42, system: 0x4}, 128: {compactTag: 0x2ff, symIndex: 0x36, system: 0x0}, 129: {compactTag: 0x2ff, symIndex: 0x41, system: 0x3}, 130: {compactTag: 0x2ff, symIndex: 0x4c, system: 0x4}, } // Size: 810 bytes var tagToDecimal = []uint8{ // 775 elements // Entry 0 - 3F 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x05, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, // Entry 40 - 7F 0x05, 0x05, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x05, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x05, 0x05, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x05, 0x05, 0x01, 0x01, // Entry 80 - BF 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, // Entry C0 - FF 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, // Entry 100 - 13F 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, // Entry 140 - 17F 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x05, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x05, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, // Entry 180 - 1BF 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x05, 0x05, 0x05, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, // Entry 1C0 - 1FF 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x05, 0x05, 0x01, 0x01, 0x01, 0x05, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, // Entry 200 - 23F 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x05, 0x05, 0x01, 0x01, 0x01, 0x05, 0x01, 0x01, 0x05, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, // Entry 240 - 27F 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, // Entry 280 - 2BF 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x05, 0x05, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, // Entry 2C0 - 2FF 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, // Entry 300 - 33F 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x08, } // Size: 799 bytes var tagToScientific = []uint8{ // 775 elements // Entry 0 - 3F 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, // Entry 40 - 7F 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, // Entry 80 - BF 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, // Entry C0 - FF 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, // Entry 100 - 13F 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, // Entry 140 - 17F 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0c, 0x0c, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0c, 0x0c, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, // Entry 180 - 1BF 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, // Entry 1C0 - 1FF 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0d, 0x0d, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0c, 0x0c, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, // Entry 200 - 23F 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0c, 0x02, 0x02, 0x0c, 0x0c, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, // Entry 240 - 27F 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0d, 0x0d, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, // Entry 280 - 2BF 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, // Entry 2C0 - 2FF 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, // Entry 300 - 33F 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x09, } // Size: 799 bytes var tagToPercent = []uint8{ // 775 elements // Entry 0 - 3F 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x06, 0x06, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, // Entry 40 - 7F 0x06, 0x06, 0x06, 0x04, 0x04, 0x04, 0x03, 0x03, 0x06, 0x06, 0x03, 0x04, 0x04, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x06, 0x06, 0x06, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x04, 0x04, 0x03, 0x03, 0x03, 0x04, 0x03, 0x03, 0x04, 0x03, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x07, 0x07, 0x04, 0x04, // Entry 80 - BF 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x06, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, // Entry C0 - FF 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, // Entry 100 - 13F 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x0b, 0x0b, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, // Entry 140 - 17F 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x06, 0x06, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x06, 0x06, 0x04, 0x04, 0x04, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, // Entry 180 - 1BF 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x06, 0x06, 0x06, 0x06, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x04, 0x04, // Entry 1C0 - 1FF 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, // Entry 200 - 23F 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x06, 0x06, 0x04, 0x04, 0x04, 0x06, 0x04, 0x04, 0x06, 0x06, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, // Entry 240 - 27F 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, // Entry 280 - 2BF 0x04, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x06, 0x06, 0x06, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x0e, // Entry 2C0 - 2FF 0x0e, 0x0e, 0x04, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, // Entry 300 - 33F 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x0a, } // Size: 799 bytes var formats = []Pattern{Pattern{RoundingContext: RoundingContext{MaxSignificantDigits: 0, MaxFractionDigits: 0, Increment: 0x0, IncrementScale: 0x0, Mode: 0x0, DigitShift: 0x0, MinIntegerDigits: 0x0, MaxIntegerDigits: 0x0, MinFractionDigits: 0x0, MinSignificantDigits: 0x0, MinExponentDigits: 0x0}, Affix: "", Offset: 0x0, NegOffset: 0x0, PadRune: 0, FormatWidth: 0x0, GroupingSize: [2]uint8{0x0, 0x0}, Flags: 0x0}, Pattern{RoundingContext: RoundingContext{MaxSignificantDigits: 0, MaxFractionDigits: 3, Increment: 0x0, IncrementScale: 0x0, Mode: 0x0, DigitShift: 0x0, MinIntegerDigits: 0x1, MaxIntegerDigits: 0x0, MinFractionDigits: 0x0, MinSignificantDigits: 0x0, MinExponentDigits: 0x0}, Affix: "", Offset: 0x0, NegOffset: 0x0, PadRune: 0, FormatWidth: 0x9, GroupingSize: [2]uint8{0x3, 0x0}, Flags: 0x0}, Pattern{RoundingContext: RoundingContext{MaxSignificantDigits: 0, MaxFractionDigits: 0, Increment: 0x0, IncrementScale: 0x0, Mode: 0x0, DigitShift: 0x0, MinIntegerDigits: 0x0, MaxIntegerDigits: 0x1, MinFractionDigits: 0x0, MinSignificantDigits: 0x0, MinExponentDigits: 0x1}, Affix: "", Offset: 0x0, NegOffset: 0x0, PadRune: 0, FormatWidth: 0x3, GroupingSize: [2]uint8{0x0, 0x0}, Flags: 0x0}, Pattern{RoundingContext: RoundingContext{MaxSignificantDigits: 0, MaxFractionDigits: 0, Increment: 0x0, IncrementScale: 0x0, Mode: 0x0, DigitShift: 0x2, MinIntegerDigits: 0x1, MaxIntegerDigits: 0x0, MinFractionDigits: 0x0, MinSignificantDigits: 0x0, MinExponentDigits: 0x0}, Affix: "\x00\x03\u00a0%", Offset: 0x0, NegOffset: 0x0, PadRune: 0, FormatWidth: 0x7, GroupingSize: [2]uint8{0x3, 0x0}, Flags: 0x0}, Pattern{RoundingContext: RoundingContext{MaxSignificantDigits: 0, MaxFractionDigits: 0, Increment: 0x0, IncrementScale: 0x0, Mode: 0x0, DigitShift: 0x2, MinIntegerDigits: 0x1, MaxIntegerDigits: 0x0, MinFractionDigits: 0x0, MinSignificantDigits: 0x0, MinExponentDigits: 0x0}, Affix: "\x00\x01%", Offset: 0x0, NegOffset: 0x0, PadRune: 0, FormatWidth: 0x6, GroupingSize: [2]uint8{0x3, 0x0}, Flags: 0x0}, Pattern{RoundingContext: RoundingContext{MaxSignificantDigits: 0, MaxFractionDigits: 3, Increment: 0x0, IncrementScale: 0x0, Mode: 0x0, DigitShift: 0x0, MinIntegerDigits: 0x1, MaxIntegerDigits: 0x0, MinFractionDigits: 0x0, MinSignificantDigits: 0x0, MinExponentDigits: 0x0}, Affix: "", Offset: 0x0, NegOffset: 0x0, PadRune: 0, FormatWidth: 0xc, GroupingSize: [2]uint8{0x3, 0x2}, Flags: 0x0}, Pattern{RoundingContext: RoundingContext{MaxSignificantDigits: 0, MaxFractionDigits: 0, Increment: 0x0, IncrementScale: 0x0, Mode: 0x0, DigitShift: 0x2, MinIntegerDigits: 0x1, MaxIntegerDigits: 0x0, MinFractionDigits: 0x0, MinSignificantDigits: 0x0, MinExponentDigits: 0x0}, Affix: "\x00\x01%", Offset: 0x0, NegOffset: 0x0, PadRune: 0, FormatWidth: 0x9, GroupingSize: [2]uint8{0x3, 0x2}, Flags: 0x0}, Pattern{RoundingContext: RoundingContext{MaxSignificantDigits: 0, MaxFractionDigits: 0, Increment: 0x0, IncrementScale: 0x0, Mode: 0x0, DigitShift: 0x2, MinIntegerDigits: 0x1, MaxIntegerDigits: 0x0, MinFractionDigits: 0x0, MinSignificantDigits: 0x0, MinExponentDigits: 0x0}, Affix: "\x00\x03\u00a0%", Offset: 0x0, NegOffset: 0x0, PadRune: 0, FormatWidth: 0xa, GroupingSize: [2]uint8{0x3, 0x2}, Flags: 0x0}, Pattern{RoundingContext: RoundingContext{MaxSignificantDigits: 0, MaxFractionDigits: 6, Increment: 0x0, IncrementScale: 0x0, Mode: 0x0, DigitShift: 0x0, MinIntegerDigits: 0x1, MaxIntegerDigits: 0x0, MinFractionDigits: 0x0, MinSignificantDigits: 0x0, MinExponentDigits: 0x0}, Affix: "", Offset: 0x0, NegOffset: 0x0, PadRune: 0, FormatWidth: 0x8, GroupingSize: [2]uint8{0x0, 0x0}, Flags: 0x0}, Pattern{RoundingContext: RoundingContext{MaxSignificantDigits: 0, MaxFractionDigits: 6, Increment: 0x0, IncrementScale: 0x0, Mode: 0x0, DigitShift: 0x0, MinIntegerDigits: 0x1, MaxIntegerDigits: 0x0, MinFractionDigits: 0x6, MinSignificantDigits: 0x0, MinExponentDigits: 0x3}, Affix: "", Offset: 0x0, NegOffset: 0x0, PadRune: 0, FormatWidth: 0xd, GroupingSize: [2]uint8{0x0, 0x0}, Flags: 0x4}, Pattern{RoundingContext: RoundingContext{MaxSignificantDigits: 0, MaxFractionDigits: 0, Increment: 0x0, IncrementScale: 0x0, Mode: 0x0, DigitShift: 0x2, MinIntegerDigits: 0x1, MaxIntegerDigits: 0x0, MinFractionDigits: 0x0, MinSignificantDigits: 0x0, MinExponentDigits: 0x0}, Affix: "\x00\x01%", Offset: 0x0, NegOffset: 0x0, PadRune: 0, FormatWidth: 0x2, GroupingSize: [2]uint8{0x0, 0x0}, Flags: 0x0}, Pattern{RoundingContext: RoundingContext{MaxSignificantDigits: 0, MaxFractionDigits: 0, Increment: 0x0, IncrementScale: 0x0, Mode: 0x0, DigitShift: 0x2, MinIntegerDigits: 0x1, MaxIntegerDigits: 0x0, MinFractionDigits: 0x0, MinSignificantDigits: 0x0, MinExponentDigits: 0x0}, Affix: "\x03%\u00a0\x00", Offset: 0x0, NegOffset: 0x0, PadRune: 0, FormatWidth: 0x7, GroupingSize: [2]uint8{0x3, 0x0}, Flags: 0x0}, Pattern{RoundingContext: RoundingContext{MaxSignificantDigits: 0, MaxFractionDigits: 0, Increment: 0x0, IncrementScale: 0x0, Mode: 0x0, DigitShift: 0x0, MinIntegerDigits: 0x0, MaxIntegerDigits: 0x1, MinFractionDigits: 0x0, MinSignificantDigits: 0x0, MinExponentDigits: 0x1}, Affix: "\x01[\x01]", Offset: 0x0, NegOffset: 0x0, PadRune: 0, FormatWidth: 0x5, GroupingSize: [2]uint8{0x0, 0x0}, Flags: 0x0}, Pattern{RoundingContext: RoundingContext{MaxSignificantDigits: 0, MaxFractionDigits: 0, Increment: 0x0, IncrementScale: 0x0, Mode: 0x0, DigitShift: 0x0, MinIntegerDigits: 0x0, MaxIntegerDigits: 0x0, MinFractionDigits: 0x0, MinSignificantDigits: 0x0, MinExponentDigits: 0x0}, Affix: "", Offset: 0x0, NegOffset: 0x0, PadRune: 0, FormatWidth: 0x1, GroupingSize: [2]uint8{0x0, 0x0}, Flags: 0x0}, Pattern{RoundingContext: RoundingContext{MaxSignificantDigits: 0, MaxFractionDigits: 0, Increment: 0x0, IncrementScale: 0x0, Mode: 0x0, DigitShift: 0x2, MinIntegerDigits: 0x1, MaxIntegerDigits: 0x0, MinFractionDigits: 0x0, MinSignificantDigits: 0x0, MinExponentDigits: 0x0}, Affix: "\x01%\x00", Offset: 0x0, NegOffset: 0x0, PadRune: 0, FormatWidth: 0x6, GroupingSize: [2]uint8{0x3, 0x0}, Flags: 0x0}} // Total table size 8634 bytes (8KiB); checksum: 8F23386D ================================================ FILE: vendor/golang.org/x/text/internal/stringset/set.go ================================================ // Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package stringset provides a way to represent a collection of strings // compactly. package stringset import "sort" // A Set holds a collection of strings that can be looked up by an index number. type Set struct { // These fields are exported to allow for code generation. Data string Index []uint16 } // Elem returns the string with index i. It panics if i is out of range. func (s *Set) Elem(i int) string { return s.Data[s.Index[i]:s.Index[i+1]] } // Len returns the number of strings in the set. func (s *Set) Len() int { return len(s.Index) - 1 } // Search returns the index of the given string or -1 if it is not in the set. // The Set must have been created with strings in sorted order. func Search(s *Set, str string) int { // TODO: optimize this if it gets used a lot. n := len(s.Index) - 1 p := sort.Search(n, func(i int) bool { return s.Elem(i) >= str }) if p == n || str != s.Elem(p) { return -1 } return p } // A Builder constructs Sets. type Builder struct { set Set index map[string]int } // NewBuilder returns a new and initialized Builder. func NewBuilder() *Builder { return &Builder{ set: Set{ Index: []uint16{0}, }, index: map[string]int{}, } } // Set creates the set created so far. func (b *Builder) Set() Set { return b.set } // Index returns the index for the given string, which must have been added // before. func (b *Builder) Index(s string) int { return b.index[s] } // Add adds a string to the index. Strings that are added by a single Add will // be stored together, unless they match an existing string. func (b *Builder) Add(ss ...string) { // First check if the string already exists. for _, s := range ss { if _, ok := b.index[s]; ok { continue } b.index[s] = len(b.set.Index) - 1 b.set.Data += s x := len(b.set.Data) if x > 0xFFFF { panic("Index too > 0xFFFF") } b.set.Index = append(b.set.Index, uint16(x)) } } ================================================ FILE: vendor/golang.org/x/text/internal/tag/tag.go ================================================ // Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package tag contains functionality handling tags and related data. package tag // import "golang.org/x/text/internal/tag" import "sort" // An Index converts tags to a compact numeric value. // // All elements are of size 4. Tags may be up to 4 bytes long. Excess bytes can // be used to store additional information about the tag. type Index string // Elem returns the element data at the given index. func (s Index) Elem(x int) string { return string(s[x*4 : x*4+4]) } // Index reports the index of the given key or -1 if it could not be found. // Only the first len(key) bytes from the start of the 4-byte entries will be // considered for the search and the first match in Index will be returned. func (s Index) Index(key []byte) int { n := len(key) // search the index of the first entry with an equal or higher value than // key in s. index := sort.Search(len(s)/4, func(i int) bool { return cmp(s[i*4:i*4+n], key) != -1 }) i := index * 4 if cmp(s[i:i+len(key)], key) != 0 { return -1 } return index } // Next finds the next occurrence of key after index x, which must have been // obtained from a call to Index using the same key. It returns x+1 or -1. func (s Index) Next(key []byte, x int) int { if x++; x*4 < len(s) && cmp(s[x*4:x*4+len(key)], key) == 0 { return x } return -1 } // cmp returns an integer comparing a and b lexicographically. func cmp(a Index, b []byte) int { n := len(a) if len(b) < n { n = len(b) } for i, c := range b[:n] { switch { case a[i] > c: return 1 case a[i] < c: return -1 } } switch { case len(a) < len(b): return -1 case len(a) > len(b): return 1 } return 0 } // Compare returns an integer comparing a and b lexicographically. func Compare(a string, b []byte) int { return cmp(Index(a), b) } // FixCase reformats b to the same pattern of cases as form. // If returns false if string b is malformed. func FixCase(form string, b []byte) bool { if len(form) != len(b) { return false } for i, c := range b { if form[i] <= 'Z' { if c >= 'a' { c -= 'z' - 'Z' } if c < 'A' || 'Z' < c { return false } } else { if c <= 'Z' { c += 'z' - 'Z' } if c < 'a' || 'z' < c { return false } } b[i] = c } return true } ================================================ FILE: vendor/golang.org/x/text/language/coverage.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package language import ( "fmt" "sort" "golang.org/x/text/internal/language" ) // The Coverage interface is used to define the level of coverage of an // internationalization service. Note that not all types are supported by all // services. As lists may be generated on the fly, it is recommended that users // of a Coverage cache the results. type Coverage interface { // Tags returns the list of supported tags. Tags() []Tag // BaseLanguages returns the list of supported base languages. BaseLanguages() []Base // Scripts returns the list of supported scripts. Scripts() []Script // Regions returns the list of supported regions. Regions() []Region } var ( // Supported defines a Coverage that lists all supported subtags. Tags // always returns nil. Supported Coverage = allSubtags{} ) // TODO: // - Support Variants, numbering systems. // - CLDR coverage levels. // - Set of common tags defined in this package. type allSubtags struct{} // Regions returns the list of supported regions. As all regions are in a // consecutive range, it simply returns a slice of numbers in increasing order. // The "undefined" region is not returned. func (s allSubtags) Regions() []Region { reg := make([]Region, language.NumRegions) for i := range reg { reg[i] = Region{language.Region(i + 1)} } return reg } // Scripts returns the list of supported scripts. As all scripts are in a // consecutive range, it simply returns a slice of numbers in increasing order. // The "undefined" script is not returned. func (s allSubtags) Scripts() []Script { scr := make([]Script, language.NumScripts) for i := range scr { scr[i] = Script{language.Script(i + 1)} } return scr } // BaseLanguages returns the list of all supported base languages. It generates // the list by traversing the internal structures. func (s allSubtags) BaseLanguages() []Base { bs := language.BaseLanguages() base := make([]Base, len(bs)) for i, b := range bs { base[i] = Base{b} } return base } // Tags always returns nil. func (s allSubtags) Tags() []Tag { return nil } // coverage is used by NewCoverage which is used as a convenient way for // creating Coverage implementations for partially defined data. Very often a // package will only need to define a subset of slices. coverage provides a // convenient way to do this. Moreover, packages using NewCoverage, instead of // their own implementation, will not break if later new slice types are added. type coverage struct { tags func() []Tag bases func() []Base scripts func() []Script regions func() []Region } func (s *coverage) Tags() []Tag { if s.tags == nil { return nil } return s.tags() } // bases implements sort.Interface and is used to sort base languages. type bases []Base func (b bases) Len() int { return len(b) } func (b bases) Swap(i, j int) { b[i], b[j] = b[j], b[i] } func (b bases) Less(i, j int) bool { return b[i].langID < b[j].langID } // BaseLanguages returns the result from calling s.bases if it is specified or // otherwise derives the set of supported base languages from tags. func (s *coverage) BaseLanguages() []Base { if s.bases == nil { tags := s.Tags() if len(tags) == 0 { return nil } a := make([]Base, len(tags)) for i, t := range tags { a[i] = Base{language.Language(t.lang())} } sort.Sort(bases(a)) k := 0 for i := 1; i < len(a); i++ { if a[k] != a[i] { k++ a[k] = a[i] } } return a[:k+1] } return s.bases() } func (s *coverage) Scripts() []Script { if s.scripts == nil { return nil } return s.scripts() } func (s *coverage) Regions() []Region { if s.regions == nil { return nil } return s.regions() } // NewCoverage returns a Coverage for the given lists. It is typically used by // packages providing internationalization services to define their level of // coverage. A list may be of type []T or func() []T, where T is either Tag, // Base, Script or Region. The returned Coverage derives the value for Bases // from Tags if no func or slice for []Base is specified. For other unspecified // types the returned Coverage will return nil for the respective methods. func NewCoverage(list ...interface{}) Coverage { s := &coverage{} for _, x := range list { switch v := x.(type) { case func() []Base: s.bases = v case func() []Script: s.scripts = v case func() []Region: s.regions = v case func() []Tag: s.tags = v case []Base: s.bases = func() []Base { return v } case []Script: s.scripts = func() []Script { return v } case []Region: s.regions = func() []Region { return v } case []Tag: s.tags = func() []Tag { return v } default: panic(fmt.Sprintf("language: unsupported set type %T", v)) } } return s } ================================================ FILE: vendor/golang.org/x/text/language/doc.go ================================================ // Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package language implements BCP 47 language tags and related functionality. // // The most important function of package language is to match a list of // user-preferred languages to a list of supported languages. // It alleviates the developer of dealing with the complexity of this process // and provides the user with the best experience // (see https://blog.golang.org/matchlang). // // # Matching preferred against supported languages // // A Matcher for an application that supports English, Australian English, // Danish, and standard Mandarin can be created as follows: // // var matcher = language.NewMatcher([]language.Tag{ // language.English, // The first language is used as fallback. // language.MustParse("en-AU"), // language.Danish, // language.Chinese, // }) // // This list of supported languages is typically implied by the languages for // which there exists translations of the user interface. // // User-preferred languages usually come as a comma-separated list of BCP 47 // language tags. // The MatchString finds best matches for such strings: // // handler(w http.ResponseWriter, r *http.Request) { // lang, _ := r.Cookie("lang") // accept := r.Header.Get("Accept-Language") // tag, _ := language.MatchStrings(matcher, lang.String(), accept) // // // tag should now be used for the initialization of any // // locale-specific service. // } // // The Matcher's Match method can be used to match Tags directly. // // Matchers are aware of the intricacies of equivalence between languages, such // as deprecated subtags, legacy tags, macro languages, mutual // intelligibility between scripts and languages, and transparently passing // BCP 47 user configuration. // For instance, it will know that a reader of Bokmål Danish can read Norwegian // and will know that Cantonese ("yue") is a good match for "zh-HK". // // # Using match results // // To guarantee a consistent user experience to the user it is important to // use the same language tag for the selection of any locale-specific services. // For example, it is utterly confusing to substitute spelled-out numbers // or dates in one language in text of another language. // More subtly confusing is using the wrong sorting order or casing // algorithm for a certain language. // // All the packages in x/text that provide locale-specific services // (e.g. collate, cases) should be initialized with the tag that was // obtained at the start of an interaction with the user. // // Note that Tag that is returned by Match and MatchString may differ from any // of the supported languages, as it may contain carried over settings from // the user tags. // This may be inconvenient when your application has some additional // locale-specific data for your supported languages. // Match and MatchString both return the index of the matched supported tag // to simplify associating such data with the matched tag. // // # Canonicalization // // If one uses the Matcher to compare languages one does not need to // worry about canonicalization. // // The meaning of a Tag varies per application. The language package // therefore delays canonicalization and preserves information as much // as possible. The Matcher, however, will always take into account that // two different tags may represent the same language. // // By default, only legacy and deprecated tags are converted into their // canonical equivalent. All other information is preserved. This approach makes // the confidence scores more accurate and allows matchers to distinguish // between variants that are otherwise lost. // // As a consequence, two tags that should be treated as identical according to // BCP 47 or CLDR, like "en-Latn" and "en", will be represented differently. The // Matcher handles such distinctions, though, and is aware of the // equivalence relations. The CanonType type can be used to alter the // canonicalization form. // // # References // // BCP 47 - Tags for Identifying Languages http://tools.ietf.org/html/bcp47 package language // import "golang.org/x/text/language" // TODO: explanation on how to match languages for your own locale-specific // service. ================================================ FILE: vendor/golang.org/x/text/language/language.go ================================================ // Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:generate go run gen.go -output tables.go package language // TODO: Remove above NOTE after: // - verifying that tables are dropped correctly (most notably matcher tables). import ( "strings" "golang.org/x/text/internal/language" "golang.org/x/text/internal/language/compact" ) // Tag represents a BCP 47 language tag. It is used to specify an instance of a // specific language or locale. All language tag values are guaranteed to be // well-formed. type Tag compact.Tag func makeTag(t language.Tag) (tag Tag) { return Tag(compact.Make(t)) } func (t *Tag) tag() language.Tag { return (*compact.Tag)(t).Tag() } func (t *Tag) isCompact() bool { return (*compact.Tag)(t).IsCompact() } // TODO: improve performance. func (t *Tag) lang() language.Language { return t.tag().LangID } func (t *Tag) region() language.Region { return t.tag().RegionID } func (t *Tag) script() language.Script { return t.tag().ScriptID } // Make is a convenience wrapper for Parse that omits the error. // In case of an error, a sensible default is returned. func Make(s string) Tag { return Default.Make(s) } // Make is a convenience wrapper for c.Parse that omits the error. // In case of an error, a sensible default is returned. func (c CanonType) Make(s string) Tag { t, _ := c.Parse(s) return t } // Raw returns the raw base language, script and region, without making an // attempt to infer their values. func (t Tag) Raw() (b Base, s Script, r Region) { tt := t.tag() return Base{tt.LangID}, Script{tt.ScriptID}, Region{tt.RegionID} } // IsRoot returns true if t is equal to language "und". func (t Tag) IsRoot() bool { return compact.Tag(t).IsRoot() } // CanonType can be used to enable or disable various types of canonicalization. type CanonType int const ( // Replace deprecated base languages with their preferred replacements. DeprecatedBase CanonType = 1 << iota // Replace deprecated scripts with their preferred replacements. DeprecatedScript // Replace deprecated regions with their preferred replacements. DeprecatedRegion // Remove redundant scripts. SuppressScript // Normalize legacy encodings. This includes legacy languages defined in // CLDR as well as bibliographic codes defined in ISO-639. Legacy // Map the dominant language of a macro language group to the macro language // subtag. For example cmn -> zh. Macro // The CLDR flag should be used if full compatibility with CLDR is required. // There are a few cases where language.Tag may differ from CLDR. To follow all // of CLDR's suggestions, use All|CLDR. CLDR // Raw can be used to Compose or Parse without Canonicalization. Raw CanonType = 0 // Replace all deprecated tags with their preferred replacements. Deprecated = DeprecatedBase | DeprecatedScript | DeprecatedRegion // All canonicalizations recommended by BCP 47. BCP47 = Deprecated | SuppressScript // All canonicalizations. All = BCP47 | Legacy | Macro // Default is the canonicalization used by Parse, Make and Compose. To // preserve as much information as possible, canonicalizations that remove // potentially valuable information are not included. The Matcher is // designed to recognize similar tags that would be the same if // they were canonicalized using All. Default = Deprecated | Legacy canonLang = DeprecatedBase | Legacy | Macro // TODO: LikelyScript, LikelyRegion: suppress similar to ICU. ) // canonicalize returns the canonicalized equivalent of the tag and // whether there was any change. func canonicalize(c CanonType, t language.Tag) (language.Tag, bool) { if c == Raw { return t, false } changed := false if c&SuppressScript != 0 { if t.LangID.SuppressScript() == t.ScriptID { t.ScriptID = 0 changed = true } } if c&canonLang != 0 { for { if l, aliasType := t.LangID.Canonicalize(); l != t.LangID { switch aliasType { case language.Legacy: if c&Legacy != 0 { if t.LangID == _sh && t.ScriptID == 0 { t.ScriptID = _Latn } t.LangID = l changed = true } case language.Macro: if c&Macro != 0 { // We deviate here from CLDR. The mapping "nb" -> "no" // qualifies as a typical Macro language mapping. However, // for legacy reasons, CLDR maps "no", the macro language // code for Norwegian, to the dominant variant "nb". This // change is currently under consideration for CLDR as well. // See https://unicode.org/cldr/trac/ticket/2698 and also // https://unicode.org/cldr/trac/ticket/1790 for some of the // practical implications. TODO: this check could be removed // if CLDR adopts this change. if c&CLDR == 0 || t.LangID != _nb { changed = true t.LangID = l } } case language.Deprecated: if c&DeprecatedBase != 0 { if t.LangID == _mo && t.RegionID == 0 { t.RegionID = _MD } t.LangID = l changed = true // Other canonicalization types may still apply. continue } } } else if c&Legacy != 0 && t.LangID == _no && c&CLDR != 0 { t.LangID = _nb changed = true } break } } if c&DeprecatedScript != 0 { if t.ScriptID == _Qaai { changed = true t.ScriptID = _Zinh } } if c&DeprecatedRegion != 0 { if r := t.RegionID.Canonicalize(); r != t.RegionID { changed = true t.RegionID = r } } return t, changed } // Canonicalize returns the canonicalized equivalent of the tag. func (c CanonType) Canonicalize(t Tag) (Tag, error) { // First try fast path. if t.isCompact() { if _, changed := canonicalize(c, compact.Tag(t).Tag()); !changed { return t, nil } } // It is unlikely that one will canonicalize a tag after matching. So do // a slow but simple approach here. if tag, changed := canonicalize(c, t.tag()); changed { tag.RemakeString() return makeTag(tag), nil } return t, nil } // Confidence indicates the level of certainty for a given return value. // For example, Serbian may be written in Cyrillic or Latin script. // The confidence level indicates whether a value was explicitly specified, // whether it is typically the only possible value, or whether there is // an ambiguity. type Confidence int const ( No Confidence = iota // full confidence that there was no match Low // most likely value picked out of a set of alternatives High // value is generally assumed to be the correct match Exact // exact match or explicitly specified value ) var confName = []string{"No", "Low", "High", "Exact"} func (c Confidence) String() string { return confName[c] } // String returns the canonical string representation of the language tag. func (t Tag) String() string { return t.tag().String() } // MarshalText implements encoding.TextMarshaler. func (t Tag) MarshalText() (text []byte, err error) { return t.tag().MarshalText() } // UnmarshalText implements encoding.TextUnmarshaler. func (t *Tag) UnmarshalText(text []byte) error { var tag language.Tag err := tag.UnmarshalText(text) *t = makeTag(tag) return err } // Base returns the base language of the language tag. If the base language is // unspecified, an attempt will be made to infer it from the context. // It uses a variant of CLDR's Add Likely Subtags algorithm. This is subject to change. func (t Tag) Base() (Base, Confidence) { if b := t.lang(); b != 0 { return Base{b}, Exact } tt := t.tag() c := High if tt.ScriptID == 0 && !tt.RegionID.IsCountry() { c = Low } if tag, err := tt.Maximize(); err == nil && tag.LangID != 0 { return Base{tag.LangID}, c } return Base{0}, No } // Script infers the script for the language tag. If it was not explicitly given, it will infer // a most likely candidate. // If more than one script is commonly used for a language, the most likely one // is returned with a low confidence indication. For example, it returns (Cyrl, Low) // for Serbian. // If a script cannot be inferred (Zzzz, No) is returned. We do not use Zyyy (undetermined) // as one would suspect from the IANA registry for BCP 47. In a Unicode context Zyyy marks // common characters (like 1, 2, 3, '.', etc.) and is therefore more like multiple scripts. // See https://www.unicode.org/reports/tr24/#Values for more details. Zzzz is also used for // unknown value in CLDR. (Zzzz, Exact) is returned if Zzzz was explicitly specified. // Note that an inferred script is never guaranteed to be the correct one. Latin is // almost exclusively used for Afrikaans, but Arabic has been used for some texts // in the past. Also, the script that is commonly used may change over time. // It uses a variant of CLDR's Add Likely Subtags algorithm. This is subject to change. func (t Tag) Script() (Script, Confidence) { if scr := t.script(); scr != 0 { return Script{scr}, Exact } tt := t.tag() sc, c := language.Script(_Zzzz), No if scr := tt.LangID.SuppressScript(); scr != 0 { // Note: it is not always the case that a language with a suppress // script value is only written in one script (e.g. kk, ms, pa). if tt.RegionID == 0 { return Script{scr}, High } sc, c = scr, High } if tag, err := tt.Maximize(); err == nil { if tag.ScriptID != sc { sc, c = tag.ScriptID, Low } } else { tt, _ = canonicalize(Deprecated|Macro, tt) if tag, err := tt.Maximize(); err == nil && tag.ScriptID != sc { sc, c = tag.ScriptID, Low } } return Script{sc}, c } // Region returns the region for the language tag. If it was not explicitly given, it will // infer a most likely candidate from the context. // It uses a variant of CLDR's Add Likely Subtags algorithm. This is subject to change. func (t Tag) Region() (Region, Confidence) { if r := t.region(); r != 0 { return Region{r}, Exact } tt := t.tag() if tt, err := tt.Maximize(); err == nil { return Region{tt.RegionID}, Low // TODO: differentiate between high and low. } tt, _ = canonicalize(Deprecated|Macro, tt) if tag, err := tt.Maximize(); err == nil { return Region{tag.RegionID}, Low } return Region{_ZZ}, No // TODO: return world instead of undetermined? } // Variants returns the variants specified explicitly for this language tag. // or nil if no variant was specified. func (t Tag) Variants() []Variant { if !compact.Tag(t).MayHaveVariants() { return nil } v := []Variant{} x, str := "", t.tag().Variants() for str != "" { x, str = nextToken(str) v = append(v, Variant{x}) } return v } // Parent returns the CLDR parent of t. In CLDR, missing fields in data for a // specific language are substituted with fields from the parent language. // The parent for a language may change for newer versions of CLDR. // // Parent returns a tag for a less specific language that is mutually // intelligible or Und if there is no such language. This may not be the same as // simply stripping the last BCP 47 subtag. For instance, the parent of "zh-TW" // is "zh-Hant", and the parent of "zh-Hant" is "und". func (t Tag) Parent() Tag { return Tag(compact.Tag(t).Parent()) } // nextToken returns token t and the rest of the string. func nextToken(s string) (t, tail string) { p := strings.Index(s[1:], "-") if p == -1 { return s[1:], "" } p++ return s[1:p], s[p:] } // Extension is a single BCP 47 extension. type Extension struct { s string } // String returns the string representation of the extension, including the // type tag. func (e Extension) String() string { return e.s } // ParseExtension parses s as an extension and returns it on success. func ParseExtension(s string) (e Extension, err error) { ext, err := language.ParseExtension(s) return Extension{ext}, err } // Type returns the one-byte extension type of e. It returns 0 for the zero // exception. func (e Extension) Type() byte { if e.s == "" { return 0 } return e.s[0] } // Tokens returns the list of tokens of e. func (e Extension) Tokens() []string { return strings.Split(e.s, "-") } // Extension returns the extension of type x for tag t. It will return // false for ok if t does not have the requested extension. The returned // extension will be invalid in this case. func (t Tag) Extension(x byte) (ext Extension, ok bool) { if !compact.Tag(t).MayHaveExtensions() { return Extension{}, false } e, ok := t.tag().Extension(x) return Extension{e}, ok } // Extensions returns all extensions of t. func (t Tag) Extensions() []Extension { if !compact.Tag(t).MayHaveExtensions() { return nil } e := []Extension{} for _, ext := range t.tag().Extensions() { e = append(e, Extension{ext}) } return e } // TypeForKey returns the type associated with the given key, where key and type // are of the allowed values defined for the Unicode locale extension ('u') in // https://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers. // TypeForKey will traverse the inheritance chain to get the correct value. // // If there are multiple types associated with a key, only the first will be // returned. If there is no type associated with a key, it returns the empty // string. func (t Tag) TypeForKey(key string) string { if !compact.Tag(t).MayHaveExtensions() { if key != "rg" && key != "va" { return "" } } return t.tag().TypeForKey(key) } // SetTypeForKey returns a new Tag with the key set to type, where key and type // are of the allowed values defined for the Unicode locale extension ('u') in // https://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers. // An empty value removes an existing pair with the same key. func (t Tag) SetTypeForKey(key, value string) (Tag, error) { tt, err := t.tag().SetTypeForKey(key, value) return makeTag(tt), err } // NumCompactTags is the number of compact tags. The maximum tag is // NumCompactTags-1. const NumCompactTags = compact.NumCompactTags // CompactIndex returns an index, where 0 <= index < NumCompactTags, for tags // for which data exists in the text repository.The index will change over time // and should not be stored in persistent storage. If t does not match a compact // index, exact will be false and the compact index will be returned for the // first match after repeatedly taking the Parent of t. func CompactIndex(t Tag) (index int, exact bool) { id, exact := compact.LanguageID(compact.Tag(t)) return int(id), exact } var root = language.Tag{} // Base is an ISO 639 language code, used for encoding the base language // of a language tag. type Base struct { langID language.Language } // ParseBase parses a 2- or 3-letter ISO 639 code. // It returns a ValueError if s is a well-formed but unknown language identifier // or another error if another error occurred. func ParseBase(s string) (Base, error) { l, err := language.ParseBase(s) return Base{l}, err } // String returns the BCP 47 representation of the base language. func (b Base) String() string { return b.langID.String() } // ISO3 returns the ISO 639-3 language code. func (b Base) ISO3() string { return b.langID.ISO3() } // IsPrivateUse reports whether this language code is reserved for private use. func (b Base) IsPrivateUse() bool { return b.langID.IsPrivateUse() } // Script is a 4-letter ISO 15924 code for representing scripts. // It is idiomatically represented in title case. type Script struct { scriptID language.Script } // ParseScript parses a 4-letter ISO 15924 code. // It returns a ValueError if s is a well-formed but unknown script identifier // or another error if another error occurred. func ParseScript(s string) (Script, error) { sc, err := language.ParseScript(s) return Script{sc}, err } // String returns the script code in title case. // It returns "Zzzz" for an unspecified script. func (s Script) String() string { return s.scriptID.String() } // IsPrivateUse reports whether this script code is reserved for private use. func (s Script) IsPrivateUse() bool { return s.scriptID.IsPrivateUse() } // Region is an ISO 3166-1 or UN M.49 code for representing countries and regions. type Region struct { regionID language.Region } // EncodeM49 returns the Region for the given UN M.49 code. // It returns an error if r is not a valid code. func EncodeM49(r int) (Region, error) { rid, err := language.EncodeM49(r) return Region{rid}, err } // ParseRegion parses a 2- or 3-letter ISO 3166-1 or a UN M.49 code. // It returns a ValueError if s is a well-formed but unknown region identifier // or another error if another error occurred. func ParseRegion(s string) (Region, error) { r, err := language.ParseRegion(s) return Region{r}, err } // String returns the BCP 47 representation for the region. // It returns "ZZ" for an unspecified region. func (r Region) String() string { return r.regionID.String() } // ISO3 returns the 3-letter ISO code of r. // Note that not all regions have a 3-letter ISO code. // In such cases this method returns "ZZZ". func (r Region) ISO3() string { return r.regionID.ISO3() } // M49 returns the UN M.49 encoding of r, or 0 if this encoding // is not defined for r. func (r Region) M49() int { return r.regionID.M49() } // IsPrivateUse reports whether r has the ISO 3166 User-assigned status. This // may include private-use tags that are assigned by CLDR and used in this // implementation. So IsPrivateUse and IsCountry can be simultaneously true. func (r Region) IsPrivateUse() bool { return r.regionID.IsPrivateUse() } // IsCountry returns whether this region is a country or autonomous area. This // includes non-standard definitions from CLDR. func (r Region) IsCountry() bool { return r.regionID.IsCountry() } // IsGroup returns whether this region defines a collection of regions. This // includes non-standard definitions from CLDR. func (r Region) IsGroup() bool { return r.regionID.IsGroup() } // Contains returns whether Region c is contained by Region r. It returns true // if c == r. func (r Region) Contains(c Region) bool { return r.regionID.Contains(c.regionID) } // TLD returns the country code top-level domain (ccTLD). UK is returned for GB. // In all other cases it returns either the region itself or an error. // // This method may return an error for a region for which there exists a // canonical form with a ccTLD. To get that ccTLD canonicalize r first. The // region will already be canonicalized it was obtained from a Tag that was // obtained using any of the default methods. func (r Region) TLD() (Region, error) { tld, err := r.regionID.TLD() return Region{tld}, err } // Canonicalize returns the region or a possible replacement if the region is // deprecated. It will not return a replacement for deprecated regions that // are split into multiple regions. func (r Region) Canonicalize() Region { return Region{r.regionID.Canonicalize()} } // Variant represents a registered variant of a language as defined by BCP 47. type Variant struct { variant string } // ParseVariant parses and returns a Variant. An error is returned if s is not // a valid variant. func ParseVariant(s string) (Variant, error) { v, err := language.ParseVariant(s) return Variant{v.String()}, err } // String returns the string representation of the variant. func (v Variant) String() string { return v.variant } ================================================ FILE: vendor/golang.org/x/text/language/match.go ================================================ // Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package language import ( "errors" "strings" "golang.org/x/text/internal/language" ) // A MatchOption configures a Matcher. type MatchOption func(*matcher) // PreferSameScript will, in the absence of a match, result in the first // preferred tag with the same script as a supported tag to match this supported // tag. The default is currently true, but this may change in the future. func PreferSameScript(preferSame bool) MatchOption { return func(m *matcher) { m.preferSameScript = preferSame } } // TODO(v1.0.0): consider making Matcher a concrete type, instead of interface. // There doesn't seem to be too much need for multiple types. // Making it a concrete type allows MatchStrings to be a method, which will // improve its discoverability. // MatchStrings parses and matches the given strings until one of them matches // the language in the Matcher. A string may be an Accept-Language header as // handled by ParseAcceptLanguage. The default language is returned if no // other language matched. func MatchStrings(m Matcher, lang ...string) (tag Tag, index int) { for _, accept := range lang { desired, _, err := ParseAcceptLanguage(accept) if err != nil { continue } if tag, index, conf := m.Match(desired...); conf != No { return tag, index } } tag, index, _ = m.Match() return } // Matcher is the interface that wraps the Match method. // // Match returns the best match for any of the given tags, along with // a unique index associated with the returned tag and a confidence // score. type Matcher interface { Match(t ...Tag) (tag Tag, index int, c Confidence) } // Comprehends reports the confidence score for a speaker of a given language // to being able to comprehend the written form of an alternative language. func Comprehends(speaker, alternative Tag) Confidence { _, _, c := NewMatcher([]Tag{alternative}).Match(speaker) return c } // NewMatcher returns a Matcher that matches an ordered list of preferred tags // against a list of supported tags based on written intelligibility, closeness // of dialect, equivalence of subtags and various other rules. It is initialized // with the list of supported tags. The first element is used as the default // value in case no match is found. // // Its Match method matches the first of the given Tags to reach a certain // confidence threshold. The tags passed to Match should therefore be specified // in order of preference. Extensions are ignored for matching. // // The index returned by the Match method corresponds to the index of the // matched tag in t, but is augmented with the Unicode extension ('u')of the // corresponding preferred tag. This allows user locale options to be passed // transparently. func NewMatcher(t []Tag, options ...MatchOption) Matcher { return newMatcher(t, options) } func (m *matcher) Match(want ...Tag) (t Tag, index int, c Confidence) { var tt language.Tag match, w, c := m.getBest(want...) if match != nil { tt, index = match.tag, match.index } else { // TODO: this should be an option tt = m.default_.tag if m.preferSameScript { outer: for _, w := range want { script, _ := w.Script() if script.scriptID == 0 { // Don't do anything if there is no script, such as with // private subtags. continue } for i, h := range m.supported { if script.scriptID == h.maxScript { tt, index = h.tag, i break outer } } } } // TODO: select first language tag based on script. } if w.RegionID != tt.RegionID && w.RegionID != 0 { if w.RegionID != 0 && tt.RegionID != 0 && tt.RegionID.Contains(w.RegionID) { tt.RegionID = w.RegionID tt.RemakeString() } else if r := w.RegionID.String(); len(r) == 2 { // TODO: also filter macro and deprecated. tt, _ = tt.SetTypeForKey("rg", strings.ToLower(r)+"zzzz") } } // Copy options from the user-provided tag into the result tag. This is hard // to do after the fact, so we do it here. // TODO: add in alternative variants to -u-va-. // TODO: add preferred region to -u-rg-. if e := w.Extensions(); len(e) > 0 { b := language.Builder{} b.SetTag(tt) for _, e := range e { b.AddExt(e) } tt = b.Make() } return makeTag(tt), index, c } // ErrMissingLikelyTagsData indicates no information was available // to compute likely values of missing tags. var ErrMissingLikelyTagsData = errors.New("missing likely tags data") // func (t *Tag) setTagsFrom(id Tag) { // t.LangID = id.LangID // t.ScriptID = id.ScriptID // t.RegionID = id.RegionID // } // Tag Matching // CLDR defines an algorithm for finding the best match between two sets of language // tags. The basic algorithm defines how to score a possible match and then find // the match with the best score // (see https://www.unicode.org/reports/tr35/#LanguageMatching). // Using scoring has several disadvantages. The scoring obfuscates the importance of // the various factors considered, making the algorithm harder to understand. Using // scoring also requires the full score to be computed for each pair of tags. // // We will use a different algorithm which aims to have the following properties: // - clarity on the precedence of the various selection factors, and // - improved performance by allowing early termination of a comparison. // // Matching algorithm (overview) // Input: // - supported: a set of supported tags // - default: the default tag to return in case there is no match // - desired: list of desired tags, ordered by preference, starting with // the most-preferred. // // Algorithm: // 1) Set the best match to the lowest confidence level // 2) For each tag in "desired": // a) For each tag in "supported": // 1) compute the match between the two tags. // 2) if the match is better than the previous best match, replace it // with the new match. (see next section) // b) if the current best match is Exact and pin is true the result will be // frozen to the language found thusfar, although better matches may // still be found for the same language. // 3) If the best match so far is below a certain threshold, return "default". // // Ranking: // We use two phases to determine whether one pair of tags are a better match // than another pair of tags. First, we determine a rough confidence level. If the // levels are different, the one with the highest confidence wins. // Second, if the rough confidence levels are identical, we use a set of tie-breaker // rules. // // The confidence level of matching a pair of tags is determined by finding the // lowest confidence level of any matches of the corresponding subtags (the // result is deemed as good as its weakest link). // We define the following levels: // Exact - An exact match of a subtag, before adding likely subtags. // MaxExact - An exact match of a subtag, after adding likely subtags. // [See Note 2]. // High - High level of mutual intelligibility between different subtag // variants. // Low - Low level of mutual intelligibility between different subtag // variants. // No - No mutual intelligibility. // // The following levels can occur for each type of subtag: // Base: Exact, MaxExact, High, Low, No // Script: Exact, MaxExact [see Note 3], Low, No // Region: Exact, MaxExact, High // Variant: Exact, High // Private: Exact, No // // Any result with a confidence level of Low or higher is deemed a possible match. // Once a desired tag matches any of the supported tags with a level of MaxExact // or higher, the next desired tag is not considered (see Step 2.b). // Note that CLDR provides languageMatching data that defines close equivalence // classes for base languages, scripts and regions. // // Tie-breaking // If we get the same confidence level for two matches, we apply a sequence of // tie-breaking rules. The first that succeeds defines the result. The rules are // applied in the following order. // 1) Original language was defined and was identical. // 2) Original region was defined and was identical. // 3) Distance between two maximized regions was the smallest. // 4) Original script was defined and was identical. // 5) Distance from want tag to have tag using the parent relation [see Note 5.] // If there is still no winner after these rules are applied, the first match // found wins. // // Notes: // [2] In practice, as matching of Exact is done in a separate phase from // matching the other levels, we reuse the Exact level to mean MaxExact in // the second phase. As a consequence, we only need the levels defined by // the Confidence type. The MaxExact confidence level is mapped to High in // the public API. // [3] We do not differentiate between maximized script values that were derived // from suppressScript versus most likely tag data. We determined that in // ranking the two, one ranks just after the other. Moreover, the two cannot // occur concurrently. As a consequence, they are identical for practical // purposes. // [4] In case of deprecated, macro-equivalents and legacy mappings, we assign // the MaxExact level to allow iw vs he to still be a closer match than // en-AU vs en-US, for example. // [5] In CLDR a locale inherits fields that are unspecified for this locale // from its parent. Therefore, if a locale is a parent of another locale, // it is a strong measure for closeness, especially when no other tie // breaker rule applies. One could also argue it is inconsistent, for // example, when pt-AO matches pt (which CLDR equates with pt-BR), even // though its parent is pt-PT according to the inheritance rules. // // Implementation Details: // There are several performance considerations worth pointing out. Most notably, // we preprocess as much as possible (within reason) at the time of creation of a // matcher. This includes: // - creating a per-language map, which includes data for the raw base language // and its canonicalized variant (if applicable), // - expanding entries for the equivalence classes defined in CLDR's // languageMatch data. // The per-language map ensures that typically only a very small number of tags // need to be considered. The pre-expansion of canonicalized subtags and // equivalence classes reduces the amount of map lookups that need to be done at // runtime. // matcher keeps a set of supported language tags, indexed by language. type matcher struct { default_ *haveTag supported []*haveTag index map[language.Language]*matchHeader passSettings bool preferSameScript bool } // matchHeader has the lists of tags for exact matches and matches based on // maximized and canonicalized tags for a given language. type matchHeader struct { haveTags []*haveTag original bool } // haveTag holds a supported Tag and its maximized script and region. The maximized // or canonicalized language is not stored as it is not needed during matching. type haveTag struct { tag language.Tag // index of this tag in the original list of supported tags. index int // conf is the maximum confidence that can result from matching this haveTag. // When conf < Exact this means it was inserted after applying a CLDR equivalence rule. conf Confidence // Maximized region and script. maxRegion language.Region maxScript language.Script // altScript may be checked as an alternative match to maxScript. If altScript // matches, the confidence level for this match is Low. Theoretically there // could be multiple alternative scripts. This does not occur in practice. altScript language.Script // nextMax is the index of the next haveTag with the same maximized tags. nextMax uint16 } func makeHaveTag(tag language.Tag, index int) (haveTag, language.Language) { max := tag if tag.LangID != 0 || tag.RegionID != 0 || tag.ScriptID != 0 { max, _ = canonicalize(All, max) max, _ = max.Maximize() max.RemakeString() } return haveTag{tag, index, Exact, max.RegionID, max.ScriptID, altScript(max.LangID, max.ScriptID), 0}, max.LangID } // altScript returns an alternative script that may match the given script with // a low confidence. At the moment, the langMatch data allows for at most one // script to map to another and we rely on this to keep the code simple. func altScript(l language.Language, s language.Script) language.Script { for _, alt := range matchScript { // TODO: also match cases where language is not the same. if (language.Language(alt.wantLang) == l || language.Language(alt.haveLang) == l) && language.Script(alt.haveScript) == s { return language.Script(alt.wantScript) } } return 0 } // addIfNew adds a haveTag to the list of tags only if it is a unique tag. // Tags that have the same maximized values are linked by index. func (h *matchHeader) addIfNew(n haveTag, exact bool) { h.original = h.original || exact // Don't add new exact matches. for _, v := range h.haveTags { if equalsRest(v.tag, n.tag) { return } } // Allow duplicate maximized tags, but create a linked list to allow quickly // comparing the equivalents and bail out. for i, v := range h.haveTags { if v.maxScript == n.maxScript && v.maxRegion == n.maxRegion && v.tag.VariantOrPrivateUseTags() == n.tag.VariantOrPrivateUseTags() { for h.haveTags[i].nextMax != 0 { i = int(h.haveTags[i].nextMax) } h.haveTags[i].nextMax = uint16(len(h.haveTags)) break } } h.haveTags = append(h.haveTags, &n) } // header returns the matchHeader for the given language. It creates one if // it doesn't already exist. func (m *matcher) header(l language.Language) *matchHeader { if h := m.index[l]; h != nil { return h } h := &matchHeader{} m.index[l] = h return h } func toConf(d uint8) Confidence { if d <= 10 { return High } if d < 30 { return Low } return No } // newMatcher builds an index for the given supported tags and returns it as // a matcher. It also expands the index by considering various equivalence classes // for a given tag. func newMatcher(supported []Tag, options []MatchOption) *matcher { m := &matcher{ index: make(map[language.Language]*matchHeader), preferSameScript: true, } for _, o := range options { o(m) } if len(supported) == 0 { m.default_ = &haveTag{} return m } // Add supported languages to the index. Add exact matches first to give // them precedence. for i, tag := range supported { tt := tag.tag() pair, _ := makeHaveTag(tt, i) m.header(tt.LangID).addIfNew(pair, true) m.supported = append(m.supported, &pair) } m.default_ = m.header(supported[0].lang()).haveTags[0] // Keep these in two different loops to support the case that two equivalent // languages are distinguished, such as iw and he. for i, tag := range supported { tt := tag.tag() pair, max := makeHaveTag(tt, i) if max != tt.LangID { m.header(max).addIfNew(pair, true) } } // update is used to add indexes in the map for equivalent languages. // update will only add entries to original indexes, thus not computing any // transitive relations. update := func(want, have uint16, conf Confidence) { if hh := m.index[language.Language(have)]; hh != nil { if !hh.original { return } hw := m.header(language.Language(want)) for _, ht := range hh.haveTags { v := *ht if conf < v.conf { v.conf = conf } v.nextMax = 0 // this value needs to be recomputed if v.altScript != 0 { v.altScript = altScript(language.Language(want), v.maxScript) } hw.addIfNew(v, conf == Exact && hh.original) } } } // Add entries for languages with mutual intelligibility as defined by CLDR's // languageMatch data. for _, ml := range matchLang { update(ml.want, ml.have, toConf(ml.distance)) if !ml.oneway { update(ml.have, ml.want, toConf(ml.distance)) } } // Add entries for possible canonicalizations. This is an optimization to // ensure that only one map lookup needs to be done at runtime per desired tag. // First we match deprecated equivalents. If they are perfect equivalents // (their canonicalization simply substitutes a different language code, but // nothing else), the match confidence is Exact, otherwise it is High. for i, lm := range language.AliasMap { // If deprecated codes match and there is no fiddling with the script // or region, we consider it an exact match. conf := Exact if language.AliasTypes[i] != language.Macro { if !isExactEquivalent(language.Language(lm.From)) { conf = High } update(lm.To, lm.From, conf) } update(lm.From, lm.To, conf) } return m } // getBest gets the best matching tag in m for any of the given tags, taking into // account the order of preference of the given tags. func (m *matcher) getBest(want ...Tag) (got *haveTag, orig language.Tag, c Confidence) { best := bestMatch{} for i, ww := range want { w := ww.tag() var max language.Tag // Check for exact match first. h := m.index[w.LangID] if w.LangID != 0 { if h == nil { continue } // Base language is defined. max, _ = canonicalize(Legacy|Deprecated|Macro, w) // A region that is added through canonicalization is stronger than // a maximized region: set it in the original (e.g. mo -> ro-MD). if w.RegionID != max.RegionID { w.RegionID = max.RegionID } // TODO: should we do the same for scripts? // See test case: en, sr, nl ; sh ; sr max, _ = max.Maximize() } else { // Base language is not defined. if h != nil { for i := range h.haveTags { have := h.haveTags[i] if equalsRest(have.tag, w) { return have, w, Exact } } } if w.ScriptID == 0 && w.RegionID == 0 { // We skip all tags matching und for approximate matching, including // private tags. continue } max, _ = w.Maximize() if h = m.index[max.LangID]; h == nil { continue } } pin := true for _, t := range want[i+1:] { if w.LangID == t.lang() { pin = false break } } // Check for match based on maximized tag. for i := range h.haveTags { have := h.haveTags[i] best.update(have, w, max.ScriptID, max.RegionID, pin) if best.conf == Exact { for have.nextMax != 0 { have = h.haveTags[have.nextMax] best.update(have, w, max.ScriptID, max.RegionID, pin) } return best.have, best.want, best.conf } } } if best.conf <= No { if len(want) != 0 { return nil, want[0].tag(), No } return nil, language.Tag{}, No } return best.have, best.want, best.conf } // bestMatch accumulates the best match so far. type bestMatch struct { have *haveTag want language.Tag conf Confidence pinnedRegion language.Region pinLanguage bool sameRegionGroup bool // Cached results from applying tie-breaking rules. origLang bool origReg bool paradigmReg bool regGroupDist uint8 origScript bool } // update updates the existing best match if the new pair is considered to be a // better match. To determine if the given pair is a better match, it first // computes the rough confidence level. If this surpasses the current match, it // will replace it and update the tie-breaker rule cache. If there is a tie, it // proceeds with applying a series of tie-breaker rules. If there is no // conclusive winner after applying the tie-breaker rules, it leaves the current // match as the preferred match. // // If pin is true and have and tag are a strong match, it will henceforth only // consider matches for this language. This corresponds to the idea that most // users have a strong preference for the first defined language. A user can // still prefer a second language over a dialect of the preferred language by // explicitly specifying dialects, e.g. "en, nl, en-GB". In this case pin should // be false. func (m *bestMatch) update(have *haveTag, tag language.Tag, maxScript language.Script, maxRegion language.Region, pin bool) { // Bail if the maximum attainable confidence is below that of the current best match. c := have.conf if c < m.conf { return } // Don't change the language once we already have found an exact match. if m.pinLanguage && tag.LangID != m.want.LangID { return } // Pin the region group if we are comparing tags for the same language. if tag.LangID == m.want.LangID && m.sameRegionGroup { _, sameGroup := regionGroupDist(m.pinnedRegion, have.maxRegion, have.maxScript, m.want.LangID) if !sameGroup { return } } if c == Exact && have.maxScript == maxScript { // If there is another language and then another entry of this language, // don't pin anything, otherwise pin the language. m.pinLanguage = pin } if equalsRest(have.tag, tag) { } else if have.maxScript != maxScript { // There is usually very little comprehension between different scripts. // In a few cases there may still be Low comprehension. This possibility // is pre-computed and stored in have.altScript. if Low < m.conf || have.altScript != maxScript { return } c = Low } else if have.maxRegion != maxRegion { if High < c { // There is usually a small difference between languages across regions. c = High } } // We store the results of the computations of the tie-breaker rules along // with the best match. There is no need to do the checks once we determine // we have a winner, but we do still need to do the tie-breaker computations. // We use "beaten" to keep track if we still need to do the checks. beaten := false // true if the new pair defeats the current one. if c != m.conf { if c < m.conf { return } beaten = true } // Tie-breaker rules: // We prefer if the pre-maximized language was specified and identical. origLang := have.tag.LangID == tag.LangID && tag.LangID != 0 if !beaten && m.origLang != origLang { if m.origLang { return } beaten = true } // We prefer if the pre-maximized region was specified and identical. origReg := have.tag.RegionID == tag.RegionID && tag.RegionID != 0 if !beaten && m.origReg != origReg { if m.origReg { return } beaten = true } regGroupDist, sameGroup := regionGroupDist(have.maxRegion, maxRegion, maxScript, tag.LangID) if !beaten && m.regGroupDist != regGroupDist { if regGroupDist > m.regGroupDist { return } beaten = true } paradigmReg := isParadigmLocale(tag.LangID, have.maxRegion) if !beaten && m.paradigmReg != paradigmReg { if !paradigmReg { return } beaten = true } // Next we prefer if the pre-maximized script was specified and identical. origScript := have.tag.ScriptID == tag.ScriptID && tag.ScriptID != 0 if !beaten && m.origScript != origScript { if m.origScript { return } beaten = true } // Update m to the newly found best match. if beaten { m.have = have m.want = tag m.conf = c m.pinnedRegion = maxRegion m.sameRegionGroup = sameGroup m.origLang = origLang m.origReg = origReg m.paradigmReg = paradigmReg m.origScript = origScript m.regGroupDist = regGroupDist } } func isParadigmLocale(lang language.Language, r language.Region) bool { for _, e := range paradigmLocales { if language.Language(e[0]) == lang && (r == language.Region(e[1]) || r == language.Region(e[2])) { return true } } return false } // regionGroupDist computes the distance between two regions based on their // CLDR grouping. func regionGroupDist(a, b language.Region, script language.Script, lang language.Language) (dist uint8, same bool) { const defaultDistance = 4 aGroup := uint(regionToGroups[a]) << 1 bGroup := uint(regionToGroups[b]) << 1 for _, ri := range matchRegion { if language.Language(ri.lang) == lang && (ri.script == 0 || language.Script(ri.script) == script) { group := uint(1 << (ri.group &^ 0x80)) if 0x80&ri.group == 0 { if aGroup&bGroup&group != 0 { // Both regions are in the group. return ri.distance, ri.distance == defaultDistance } } else { if (aGroup|bGroup)&group == 0 { // Both regions are not in the group. return ri.distance, ri.distance == defaultDistance } } } } return defaultDistance, true } // equalsRest compares everything except the language. func equalsRest(a, b language.Tag) bool { // TODO: don't include extensions in this comparison. To do this efficiently, // though, we should handle private tags separately. return a.ScriptID == b.ScriptID && a.RegionID == b.RegionID && a.VariantOrPrivateUseTags() == b.VariantOrPrivateUseTags() } // isExactEquivalent returns true if canonicalizing the language will not alter // the script or region of a tag. func isExactEquivalent(l language.Language) bool { for _, o := range notEquivalent { if o == l { return false } } return true } var notEquivalent []language.Language func init() { // Create a list of all languages for which canonicalization may alter the // script or region. for _, lm := range language.AliasMap { tag := language.Tag{LangID: language.Language(lm.From)} if tag, _ = canonicalize(All, tag); tag.ScriptID != 0 || tag.RegionID != 0 { notEquivalent = append(notEquivalent, language.Language(lm.From)) } } // Maximize undefined regions of paradigm locales. for i, v := range paradigmLocales { t := language.Tag{LangID: language.Language(v[0])} max, _ := t.Maximize() if v[1] == 0 { paradigmLocales[i][1] = uint16(max.RegionID) } if v[2] == 0 { paradigmLocales[i][2] = uint16(max.RegionID) } } } ================================================ FILE: vendor/golang.org/x/text/language/parse.go ================================================ // Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package language import ( "errors" "sort" "strconv" "strings" "golang.org/x/text/internal/language" ) // ValueError is returned by any of the parsing functions when the // input is well-formed but the respective subtag is not recognized // as a valid value. type ValueError interface { error // Subtag returns the subtag for which the error occurred. Subtag() string } // Parse parses the given BCP 47 string and returns a valid Tag. If parsing // failed it returns an error and any part of the tag that could be parsed. // If parsing succeeded but an unknown value was found, it returns // ValueError. The Tag returned in this case is just stripped of the unknown // value. All other values are preserved. It accepts tags in the BCP 47 format // and extensions to this standard defined in // https://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers. // The resulting tag is canonicalized using the default canonicalization type. func Parse(s string) (t Tag, err error) { return Default.Parse(s) } // Parse parses the given BCP 47 string and returns a valid Tag. If parsing // failed it returns an error and any part of the tag that could be parsed. // If parsing succeeded but an unknown value was found, it returns // ValueError. The Tag returned in this case is just stripped of the unknown // value. All other values are preserved. It accepts tags in the BCP 47 format // and extensions to this standard defined in // https://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers. // The resulting tag is canonicalized using the canonicalization type c. func (c CanonType) Parse(s string) (t Tag, err error) { defer func() { if recover() != nil { t = Tag{} err = language.ErrSyntax } }() tt, err := language.Parse(s) if err != nil { return makeTag(tt), err } tt, changed := canonicalize(c, tt) if changed { tt.RemakeString() } return makeTag(tt), nil } // Compose creates a Tag from individual parts, which may be of type Tag, Base, // Script, Region, Variant, []Variant, Extension, []Extension or error. If a // Base, Script or Region or slice of type Variant or Extension is passed more // than once, the latter will overwrite the former. Variants and Extensions are // accumulated, but if two extensions of the same type are passed, the latter // will replace the former. For -u extensions, though, the key-type pairs are // added, where later values overwrite older ones. A Tag overwrites all former // values and typically only makes sense as the first argument. The resulting // tag is returned after canonicalizing using the Default CanonType. If one or // more errors are encountered, one of the errors is returned. func Compose(part ...interface{}) (t Tag, err error) { return Default.Compose(part...) } // Compose creates a Tag from individual parts, which may be of type Tag, Base, // Script, Region, Variant, []Variant, Extension, []Extension or error. If a // Base, Script or Region or slice of type Variant or Extension is passed more // than once, the latter will overwrite the former. Variants and Extensions are // accumulated, but if two extensions of the same type are passed, the latter // will replace the former. For -u extensions, though, the key-type pairs are // added, where later values overwrite older ones. A Tag overwrites all former // values and typically only makes sense as the first argument. The resulting // tag is returned after canonicalizing using CanonType c. If one or more errors // are encountered, one of the errors is returned. func (c CanonType) Compose(part ...interface{}) (t Tag, err error) { defer func() { if recover() != nil { t = Tag{} err = language.ErrSyntax } }() var b language.Builder if err = update(&b, part...); err != nil { return und, err } b.Tag, _ = canonicalize(c, b.Tag) return makeTag(b.Make()), err } var errInvalidArgument = errors.New("invalid Extension or Variant") func update(b *language.Builder, part ...interface{}) (err error) { for _, x := range part { switch v := x.(type) { case Tag: b.SetTag(v.tag()) case Base: b.Tag.LangID = v.langID case Script: b.Tag.ScriptID = v.scriptID case Region: b.Tag.RegionID = v.regionID case Variant: if v.variant == "" { err = errInvalidArgument break } b.AddVariant(v.variant) case Extension: if v.s == "" { err = errInvalidArgument break } b.SetExt(v.s) case []Variant: b.ClearVariants() for _, v := range v { b.AddVariant(v.variant) } case []Extension: b.ClearExtensions() for _, e := range v { b.SetExt(e.s) } // TODO: support parsing of raw strings based on morphology or just extensions? case error: if v != nil { err = v } } } return } var errInvalidWeight = errors.New("ParseAcceptLanguage: invalid weight") var errTagListTooLarge = errors.New("tag list exceeds max length") // ParseAcceptLanguage parses the contents of an Accept-Language header as // defined in http://www.ietf.org/rfc/rfc2616.txt and returns a list of Tags and // a list of corresponding quality weights. It is more permissive than RFC 2616 // and may return non-nil slices even if the input is not valid. // The Tags will be sorted by highest weight first and then by first occurrence. // Tags with a weight of zero will be dropped. An error will be returned if the // input could not be parsed. func ParseAcceptLanguage(s string) (tag []Tag, q []float32, err error) { defer func() { if recover() != nil { tag = nil q = nil err = language.ErrSyntax } }() if strings.Count(s, "-") > 1000 { return nil, nil, errTagListTooLarge } var entry string for s != "" { if entry, s = split(s, ','); entry == "" { continue } entry, weight := split(entry, ';') // Scan the language. t, err := Parse(entry) if err != nil { id, ok := acceptFallback[entry] if !ok { return nil, nil, err } t = makeTag(language.Tag{LangID: id}) } // Scan the optional weight. w := 1.0 if weight != "" { weight = consume(weight, 'q') weight = consume(weight, '=') // consume returns the empty string when a token could not be // consumed, resulting in an error for ParseFloat. if w, err = strconv.ParseFloat(weight, 32); err != nil { return nil, nil, errInvalidWeight } // Drop tags with a quality weight of 0. if w <= 0 { continue } } tag = append(tag, t) q = append(q, float32(w)) } sort.Stable(&tagSort{tag, q}) return tag, q, nil } // consume removes a leading token c from s and returns the result or the empty // string if there is no such token. func consume(s string, c byte) string { if s == "" || s[0] != c { return "" } return strings.TrimSpace(s[1:]) } func split(s string, c byte) (head, tail string) { if i := strings.IndexByte(s, c); i >= 0 { return strings.TrimSpace(s[:i]), strings.TrimSpace(s[i+1:]) } return strings.TrimSpace(s), "" } // Add hack mapping to deal with a small number of cases that occur // in Accept-Language (with reasonable frequency). var acceptFallback = map[string]language.Language{ "english": _en, "deutsch": _de, "italian": _it, "french": _fr, "*": _mul, // defined in the spec to match all languages. } type tagSort struct { tag []Tag q []float32 } func (s *tagSort) Len() int { return len(s.q) } func (s *tagSort) Less(i, j int) bool { return s.q[i] > s.q[j] } func (s *tagSort) Swap(i, j int) { s.tag[i], s.tag[j] = s.tag[j], s.tag[i] s.q[i], s.q[j] = s.q[j], s.q[i] } ================================================ FILE: vendor/golang.org/x/text/language/tables.go ================================================ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. package language // CLDRVersion is the CLDR version from which the tables in this package are derived. const CLDRVersion = "32" const ( _de = 269 _en = 313 _fr = 350 _it = 505 _mo = 784 _no = 879 _nb = 839 _pt = 960 _sh = 1031 _mul = 806 _und = 0 ) const ( _001 = 1 _419 = 31 _BR = 65 _CA = 73 _ES = 111 _GB = 124 _MD = 189 _PT = 239 _UK = 307 _US = 310 _ZZ = 358 _XA = 324 _XC = 326 _XK = 334 ) const ( _Latn = 91 _Hani = 57 _Hans = 59 _Hant = 60 _Qaaa = 149 _Qaai = 157 _Qabx = 198 _Zinh = 255 _Zyyy = 260 _Zzzz = 261 ) var regionToGroups = []uint8{ // 359 elements // Entry 0 - 3F 0x00, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00, 0x04, // Entry 40 - 7F 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x04, // Entry 80 - BF 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x01, 0x00, 0x04, 0x02, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x00, 0x04, // Entry C0 - FF 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x01, 0x04, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Entry 100 - 13F 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x04, 0x00, 0x00, 0x04, 0x00, 0x04, 0x04, 0x05, 0x00, // Entry 140 - 17F 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, } // Size: 383 bytes var paradigmLocales = [][3]uint16{ // 3 elements 0: [3]uint16{0x139, 0x0, 0x7c}, 1: [3]uint16{0x13e, 0x0, 0x1f}, 2: [3]uint16{0x3c0, 0x41, 0xef}, } // Size: 42 bytes type mutualIntelligibility struct { want uint16 have uint16 distance uint8 oneway bool } type scriptIntelligibility struct { wantLang uint16 haveLang uint16 wantScript uint8 haveScript uint8 distance uint8 } type regionIntelligibility struct { lang uint16 script uint8 group uint8 distance uint8 } // matchLang holds pairs of langIDs of base languages that are typically // mutually intelligible. Each pair is associated with a confidence and // whether the intelligibility goes one or both ways. var matchLang = []mutualIntelligibility{ // 113 elements 0: {want: 0x1d1, have: 0xb7, distance: 0x4, oneway: false}, 1: {want: 0x407, have: 0xb7, distance: 0x4, oneway: false}, 2: {want: 0x407, have: 0x1d1, distance: 0x4, oneway: false}, 3: {want: 0x407, have: 0x432, distance: 0x4, oneway: false}, 4: {want: 0x43a, have: 0x1, distance: 0x4, oneway: false}, 5: {want: 0x1a3, have: 0x10d, distance: 0x4, oneway: true}, 6: {want: 0x295, have: 0x10d, distance: 0x4, oneway: true}, 7: {want: 0x101, have: 0x36f, distance: 0x8, oneway: false}, 8: {want: 0x101, have: 0x347, distance: 0x8, oneway: false}, 9: {want: 0x5, have: 0x3e2, distance: 0xa, oneway: true}, 10: {want: 0xd, have: 0x139, distance: 0xa, oneway: true}, 11: {want: 0x16, have: 0x367, distance: 0xa, oneway: true}, 12: {want: 0x21, have: 0x139, distance: 0xa, oneway: true}, 13: {want: 0x56, have: 0x13e, distance: 0xa, oneway: true}, 14: {want: 0x58, have: 0x3e2, distance: 0xa, oneway: true}, 15: {want: 0x71, have: 0x3e2, distance: 0xa, oneway: true}, 16: {want: 0x75, have: 0x139, distance: 0xa, oneway: true}, 17: {want: 0x82, have: 0x1be, distance: 0xa, oneway: true}, 18: {want: 0xa5, have: 0x139, distance: 0xa, oneway: true}, 19: {want: 0xb2, have: 0x15e, distance: 0xa, oneway: true}, 20: {want: 0xdd, have: 0x153, distance: 0xa, oneway: true}, 21: {want: 0xe5, have: 0x139, distance: 0xa, oneway: true}, 22: {want: 0xe9, have: 0x3a, distance: 0xa, oneway: true}, 23: {want: 0xf0, have: 0x15e, distance: 0xa, oneway: true}, 24: {want: 0xf9, have: 0x15e, distance: 0xa, oneway: true}, 25: {want: 0x100, have: 0x139, distance: 0xa, oneway: true}, 26: {want: 0x130, have: 0x139, distance: 0xa, oneway: true}, 27: {want: 0x13c, have: 0x139, distance: 0xa, oneway: true}, 28: {want: 0x140, have: 0x151, distance: 0xa, oneway: true}, 29: {want: 0x145, have: 0x13e, distance: 0xa, oneway: true}, 30: {want: 0x158, have: 0x101, distance: 0xa, oneway: true}, 31: {want: 0x16d, have: 0x367, distance: 0xa, oneway: true}, 32: {want: 0x16e, have: 0x139, distance: 0xa, oneway: true}, 33: {want: 0x16f, have: 0x139, distance: 0xa, oneway: true}, 34: {want: 0x17e, have: 0x139, distance: 0xa, oneway: true}, 35: {want: 0x190, have: 0x13e, distance: 0xa, oneway: true}, 36: {want: 0x194, have: 0x13e, distance: 0xa, oneway: true}, 37: {want: 0x1a4, have: 0x1be, distance: 0xa, oneway: true}, 38: {want: 0x1b4, have: 0x139, distance: 0xa, oneway: true}, 39: {want: 0x1b8, have: 0x139, distance: 0xa, oneway: true}, 40: {want: 0x1d4, have: 0x15e, distance: 0xa, oneway: true}, 41: {want: 0x1d7, have: 0x3e2, distance: 0xa, oneway: true}, 42: {want: 0x1d9, have: 0x139, distance: 0xa, oneway: true}, 43: {want: 0x1e7, have: 0x139, distance: 0xa, oneway: true}, 44: {want: 0x1f8, have: 0x139, distance: 0xa, oneway: true}, 45: {want: 0x20e, have: 0x1e1, distance: 0xa, oneway: true}, 46: {want: 0x210, have: 0x139, distance: 0xa, oneway: true}, 47: {want: 0x22d, have: 0x15e, distance: 0xa, oneway: true}, 48: {want: 0x242, have: 0x3e2, distance: 0xa, oneway: true}, 49: {want: 0x24a, have: 0x139, distance: 0xa, oneway: true}, 50: {want: 0x251, have: 0x139, distance: 0xa, oneway: true}, 51: {want: 0x265, have: 0x139, distance: 0xa, oneway: true}, 52: {want: 0x274, have: 0x48a, distance: 0xa, oneway: true}, 53: {want: 0x28a, have: 0x3e2, distance: 0xa, oneway: true}, 54: {want: 0x28e, have: 0x1f9, distance: 0xa, oneway: true}, 55: {want: 0x2a3, have: 0x139, distance: 0xa, oneway: true}, 56: {want: 0x2b5, have: 0x15e, distance: 0xa, oneway: true}, 57: {want: 0x2b8, have: 0x139, distance: 0xa, oneway: true}, 58: {want: 0x2be, have: 0x139, distance: 0xa, oneway: true}, 59: {want: 0x2c3, have: 0x15e, distance: 0xa, oneway: true}, 60: {want: 0x2ed, have: 0x139, distance: 0xa, oneway: true}, 61: {want: 0x2f1, have: 0x15e, distance: 0xa, oneway: true}, 62: {want: 0x2fa, have: 0x139, distance: 0xa, oneway: true}, 63: {want: 0x2ff, have: 0x7e, distance: 0xa, oneway: true}, 64: {want: 0x304, have: 0x139, distance: 0xa, oneway: true}, 65: {want: 0x30b, have: 0x3e2, distance: 0xa, oneway: true}, 66: {want: 0x31b, have: 0x1be, distance: 0xa, oneway: true}, 67: {want: 0x31f, have: 0x1e1, distance: 0xa, oneway: true}, 68: {want: 0x320, have: 0x139, distance: 0xa, oneway: true}, 69: {want: 0x331, have: 0x139, distance: 0xa, oneway: true}, 70: {want: 0x351, have: 0x139, distance: 0xa, oneway: true}, 71: {want: 0x36a, have: 0x347, distance: 0xa, oneway: false}, 72: {want: 0x36a, have: 0x36f, distance: 0xa, oneway: true}, 73: {want: 0x37a, have: 0x139, distance: 0xa, oneway: true}, 74: {want: 0x387, have: 0x139, distance: 0xa, oneway: true}, 75: {want: 0x389, have: 0x139, distance: 0xa, oneway: true}, 76: {want: 0x38b, have: 0x15e, distance: 0xa, oneway: true}, 77: {want: 0x390, have: 0x139, distance: 0xa, oneway: true}, 78: {want: 0x395, have: 0x139, distance: 0xa, oneway: true}, 79: {want: 0x39d, have: 0x139, distance: 0xa, oneway: true}, 80: {want: 0x3a5, have: 0x139, distance: 0xa, oneway: true}, 81: {want: 0x3be, have: 0x139, distance: 0xa, oneway: true}, 82: {want: 0x3c4, have: 0x13e, distance: 0xa, oneway: true}, 83: {want: 0x3d4, have: 0x10d, distance: 0xa, oneway: true}, 84: {want: 0x3d9, have: 0x139, distance: 0xa, oneway: true}, 85: {want: 0x3e5, have: 0x15e, distance: 0xa, oneway: true}, 86: {want: 0x3e9, have: 0x1be, distance: 0xa, oneway: true}, 87: {want: 0x3fa, have: 0x139, distance: 0xa, oneway: true}, 88: {want: 0x40c, have: 0x139, distance: 0xa, oneway: true}, 89: {want: 0x423, have: 0x139, distance: 0xa, oneway: true}, 90: {want: 0x429, have: 0x139, distance: 0xa, oneway: true}, 91: {want: 0x431, have: 0x139, distance: 0xa, oneway: true}, 92: {want: 0x43b, have: 0x139, distance: 0xa, oneway: true}, 93: {want: 0x43e, have: 0x1e1, distance: 0xa, oneway: true}, 94: {want: 0x445, have: 0x139, distance: 0xa, oneway: true}, 95: {want: 0x450, have: 0x139, distance: 0xa, oneway: true}, 96: {want: 0x461, have: 0x139, distance: 0xa, oneway: true}, 97: {want: 0x467, have: 0x3e2, distance: 0xa, oneway: true}, 98: {want: 0x46f, have: 0x139, distance: 0xa, oneway: true}, 99: {want: 0x476, have: 0x3e2, distance: 0xa, oneway: true}, 100: {want: 0x3883, have: 0x139, distance: 0xa, oneway: true}, 101: {want: 0x480, have: 0x139, distance: 0xa, oneway: true}, 102: {want: 0x482, have: 0x139, distance: 0xa, oneway: true}, 103: {want: 0x494, have: 0x3e2, distance: 0xa, oneway: true}, 104: {want: 0x49d, have: 0x139, distance: 0xa, oneway: true}, 105: {want: 0x4ac, have: 0x529, distance: 0xa, oneway: true}, 106: {want: 0x4b4, have: 0x139, distance: 0xa, oneway: true}, 107: {want: 0x4bc, have: 0x3e2, distance: 0xa, oneway: true}, 108: {want: 0x4e5, have: 0x15e, distance: 0xa, oneway: true}, 109: {want: 0x4f2, have: 0x139, distance: 0xa, oneway: true}, 110: {want: 0x512, have: 0x139, distance: 0xa, oneway: true}, 111: {want: 0x518, have: 0x139, distance: 0xa, oneway: true}, 112: {want: 0x52f, have: 0x139, distance: 0xa, oneway: true}, } // Size: 702 bytes // matchScript holds pairs of scriptIDs where readers of one script // can typically also read the other. Each is associated with a confidence. var matchScript = []scriptIntelligibility{ // 26 elements 0: {wantLang: 0x432, haveLang: 0x432, wantScript: 0x5b, haveScript: 0x20, distance: 0x5}, 1: {wantLang: 0x432, haveLang: 0x432, wantScript: 0x20, haveScript: 0x5b, distance: 0x5}, 2: {wantLang: 0x58, haveLang: 0x3e2, wantScript: 0x5b, haveScript: 0x20, distance: 0xa}, 3: {wantLang: 0xa5, haveLang: 0x139, wantScript: 0xe, haveScript: 0x5b, distance: 0xa}, 4: {wantLang: 0x1d7, haveLang: 0x3e2, wantScript: 0x8, haveScript: 0x20, distance: 0xa}, 5: {wantLang: 0x210, haveLang: 0x139, wantScript: 0x2e, haveScript: 0x5b, distance: 0xa}, 6: {wantLang: 0x24a, haveLang: 0x139, wantScript: 0x4f, haveScript: 0x5b, distance: 0xa}, 7: {wantLang: 0x251, haveLang: 0x139, wantScript: 0x53, haveScript: 0x5b, distance: 0xa}, 8: {wantLang: 0x2b8, haveLang: 0x139, wantScript: 0x58, haveScript: 0x5b, distance: 0xa}, 9: {wantLang: 0x304, haveLang: 0x139, wantScript: 0x6f, haveScript: 0x5b, distance: 0xa}, 10: {wantLang: 0x331, haveLang: 0x139, wantScript: 0x76, haveScript: 0x5b, distance: 0xa}, 11: {wantLang: 0x351, haveLang: 0x139, wantScript: 0x22, haveScript: 0x5b, distance: 0xa}, 12: {wantLang: 0x395, haveLang: 0x139, wantScript: 0x83, haveScript: 0x5b, distance: 0xa}, 13: {wantLang: 0x39d, haveLang: 0x139, wantScript: 0x36, haveScript: 0x5b, distance: 0xa}, 14: {wantLang: 0x3be, haveLang: 0x139, wantScript: 0x5, haveScript: 0x5b, distance: 0xa}, 15: {wantLang: 0x3fa, haveLang: 0x139, wantScript: 0x5, haveScript: 0x5b, distance: 0xa}, 16: {wantLang: 0x40c, haveLang: 0x139, wantScript: 0xd6, haveScript: 0x5b, distance: 0xa}, 17: {wantLang: 0x450, haveLang: 0x139, wantScript: 0xe6, haveScript: 0x5b, distance: 0xa}, 18: {wantLang: 0x461, haveLang: 0x139, wantScript: 0xe9, haveScript: 0x5b, distance: 0xa}, 19: {wantLang: 0x46f, haveLang: 0x139, wantScript: 0x2c, haveScript: 0x5b, distance: 0xa}, 20: {wantLang: 0x476, haveLang: 0x3e2, wantScript: 0x5b, haveScript: 0x20, distance: 0xa}, 21: {wantLang: 0x4b4, haveLang: 0x139, wantScript: 0x5, haveScript: 0x5b, distance: 0xa}, 22: {wantLang: 0x4bc, haveLang: 0x3e2, wantScript: 0x5b, haveScript: 0x20, distance: 0xa}, 23: {wantLang: 0x512, haveLang: 0x139, wantScript: 0x3e, haveScript: 0x5b, distance: 0xa}, 24: {wantLang: 0x529, haveLang: 0x529, wantScript: 0x3b, haveScript: 0x3c, distance: 0xf}, 25: {wantLang: 0x529, haveLang: 0x529, wantScript: 0x3c, haveScript: 0x3b, distance: 0x13}, } // Size: 232 bytes var matchRegion = []regionIntelligibility{ // 15 elements 0: {lang: 0x3a, script: 0x0, group: 0x4, distance: 0x4}, 1: {lang: 0x3a, script: 0x0, group: 0x84, distance: 0x4}, 2: {lang: 0x139, script: 0x0, group: 0x1, distance: 0x4}, 3: {lang: 0x139, script: 0x0, group: 0x81, distance: 0x4}, 4: {lang: 0x13e, script: 0x0, group: 0x3, distance: 0x4}, 5: {lang: 0x13e, script: 0x0, group: 0x83, distance: 0x4}, 6: {lang: 0x3c0, script: 0x0, group: 0x3, distance: 0x4}, 7: {lang: 0x3c0, script: 0x0, group: 0x83, distance: 0x4}, 8: {lang: 0x529, script: 0x3c, group: 0x2, distance: 0x4}, 9: {lang: 0x529, script: 0x3c, group: 0x82, distance: 0x4}, 10: {lang: 0x3a, script: 0x0, group: 0x80, distance: 0x5}, 11: {lang: 0x139, script: 0x0, group: 0x80, distance: 0x5}, 12: {lang: 0x13e, script: 0x0, group: 0x80, distance: 0x5}, 13: {lang: 0x3c0, script: 0x0, group: 0x80, distance: 0x5}, 14: {lang: 0x529, script: 0x3c, group: 0x80, distance: 0x5}, } // Size: 114 bytes // Total table size 1473 bytes (1KiB); checksum: 7BB90B5C ================================================ FILE: vendor/golang.org/x/text/language/tags.go ================================================ // Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package language import "golang.org/x/text/internal/language/compact" // TODO: Various sets of commonly use tags and regions. // MustParse is like Parse, but panics if the given BCP 47 tag cannot be parsed. // It simplifies safe initialization of Tag values. func MustParse(s string) Tag { t, err := Parse(s) if err != nil { panic(err) } return t } // MustParse is like Parse, but panics if the given BCP 47 tag cannot be parsed. // It simplifies safe initialization of Tag values. func (c CanonType) MustParse(s string) Tag { t, err := c.Parse(s) if err != nil { panic(err) } return t } // MustParseBase is like ParseBase, but panics if the given base cannot be parsed. // It simplifies safe initialization of Base values. func MustParseBase(s string) Base { b, err := ParseBase(s) if err != nil { panic(err) } return b } // MustParseScript is like ParseScript, but panics if the given script cannot be // parsed. It simplifies safe initialization of Script values. func MustParseScript(s string) Script { scr, err := ParseScript(s) if err != nil { panic(err) } return scr } // MustParseRegion is like ParseRegion, but panics if the given region cannot be // parsed. It simplifies safe initialization of Region values. func MustParseRegion(s string) Region { r, err := ParseRegion(s) if err != nil { panic(err) } return r } var ( und = Tag{} Und Tag = Tag{} Afrikaans Tag = Tag(compact.Afrikaans) Amharic Tag = Tag(compact.Amharic) Arabic Tag = Tag(compact.Arabic) ModernStandardArabic Tag = Tag(compact.ModernStandardArabic) Azerbaijani Tag = Tag(compact.Azerbaijani) Bulgarian Tag = Tag(compact.Bulgarian) Bengali Tag = Tag(compact.Bengali) Catalan Tag = Tag(compact.Catalan) Czech Tag = Tag(compact.Czech) Danish Tag = Tag(compact.Danish) German Tag = Tag(compact.German) Greek Tag = Tag(compact.Greek) English Tag = Tag(compact.English) AmericanEnglish Tag = Tag(compact.AmericanEnglish) BritishEnglish Tag = Tag(compact.BritishEnglish) Spanish Tag = Tag(compact.Spanish) EuropeanSpanish Tag = Tag(compact.EuropeanSpanish) LatinAmericanSpanish Tag = Tag(compact.LatinAmericanSpanish) Estonian Tag = Tag(compact.Estonian) Persian Tag = Tag(compact.Persian) Finnish Tag = Tag(compact.Finnish) Filipino Tag = Tag(compact.Filipino) French Tag = Tag(compact.French) CanadianFrench Tag = Tag(compact.CanadianFrench) Gujarati Tag = Tag(compact.Gujarati) Hebrew Tag = Tag(compact.Hebrew) Hindi Tag = Tag(compact.Hindi) Croatian Tag = Tag(compact.Croatian) Hungarian Tag = Tag(compact.Hungarian) Armenian Tag = Tag(compact.Armenian) Indonesian Tag = Tag(compact.Indonesian) Icelandic Tag = Tag(compact.Icelandic) Italian Tag = Tag(compact.Italian) Japanese Tag = Tag(compact.Japanese) Georgian Tag = Tag(compact.Georgian) Kazakh Tag = Tag(compact.Kazakh) Khmer Tag = Tag(compact.Khmer) Kannada Tag = Tag(compact.Kannada) Korean Tag = Tag(compact.Korean) Kirghiz Tag = Tag(compact.Kirghiz) Lao Tag = Tag(compact.Lao) Lithuanian Tag = Tag(compact.Lithuanian) Latvian Tag = Tag(compact.Latvian) Macedonian Tag = Tag(compact.Macedonian) Malayalam Tag = Tag(compact.Malayalam) Mongolian Tag = Tag(compact.Mongolian) Marathi Tag = Tag(compact.Marathi) Malay Tag = Tag(compact.Malay) Burmese Tag = Tag(compact.Burmese) Nepali Tag = Tag(compact.Nepali) Dutch Tag = Tag(compact.Dutch) Norwegian Tag = Tag(compact.Norwegian) Punjabi Tag = Tag(compact.Punjabi) Polish Tag = Tag(compact.Polish) Portuguese Tag = Tag(compact.Portuguese) BrazilianPortuguese Tag = Tag(compact.BrazilianPortuguese) EuropeanPortuguese Tag = Tag(compact.EuropeanPortuguese) Romanian Tag = Tag(compact.Romanian) Russian Tag = Tag(compact.Russian) Sinhala Tag = Tag(compact.Sinhala) Slovak Tag = Tag(compact.Slovak) Slovenian Tag = Tag(compact.Slovenian) Albanian Tag = Tag(compact.Albanian) Serbian Tag = Tag(compact.Serbian) SerbianLatin Tag = Tag(compact.SerbianLatin) Swedish Tag = Tag(compact.Swedish) Swahili Tag = Tag(compact.Swahili) Tamil Tag = Tag(compact.Tamil) Telugu Tag = Tag(compact.Telugu) Thai Tag = Tag(compact.Thai) Turkish Tag = Tag(compact.Turkish) Ukrainian Tag = Tag(compact.Ukrainian) Urdu Tag = Tag(compact.Urdu) Uzbek Tag = Tag(compact.Uzbek) Vietnamese Tag = Tag(compact.Vietnamese) Chinese Tag = Tag(compact.Chinese) SimplifiedChinese Tag = Tag(compact.SimplifiedChinese) TraditionalChinese Tag = Tag(compact.TraditionalChinese) Zulu Tag = Tag(compact.Zulu) ) ================================================ FILE: vendor/golang.org/x/text/message/catalog/catalog.go ================================================ // Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package catalog defines collections of translated format strings. // // This package mostly defines types for populating catalogs with messages. The // catmsg package contains further definitions for creating custom message and // dictionary types as well as packages that use Catalogs. // // Package catalog defines various interfaces: Dictionary, Loader, and Message. // A Dictionary maintains a set of translations of format strings for a single // language. The Loader interface defines a source of dictionaries. A // translation of a format string is represented by a Message. // // # Catalogs // // A Catalog defines a programmatic interface for setting message translations. // It maintains a set of per-language dictionaries with translations for a set // of keys. For message translation to function properly, a translation should // be defined for each key for each supported language. A dictionary may be // underspecified, though, if there is a parent language that already defines // the key. For example, a Dictionary for "en-GB" could leave out entries that // are identical to those in a dictionary for "en". // // # Messages // // A Message is a format string which varies on the value of substitution // variables. For instance, to indicate the number of results one could want "no // results" if there are none, "1 result" if there is 1, and "%d results" for // any other number. Catalog is agnostic to the kind of format strings that are // used: for instance, messages can follow either the printf-style substitution // from package fmt or use templates. // // A Message does not substitute arguments in the format string. This job is // reserved for packages that render strings, such as message, that use Catalogs // to selected string. This separation of concerns allows Catalog to be used to // store any kind of formatting strings. // // # Selecting messages based on linguistic features of substitution arguments // // Messages may vary based on any linguistic features of the argument values. // The most common one is plural form, but others exist. // // Selection messages are provided in packages that provide support for a // specific linguistic feature. The following snippet uses plural.Selectf: // // catalog.Set(language.English, "You are %d minute(s) late.", // plural.Selectf(1, "", // plural.One, "You are 1 minute late.", // plural.Other, "You are %d minutes late.")) // // In this example, a message is stored in the Catalog where one of two messages // is selected based on the first argument, a number. The first message is // selected if the argument is singular (identified by the selector "one") and // the second message is selected in all other cases. The selectors are defined // by the plural rules defined in CLDR. The selector "other" is special and will // always match. Each language always defines one of the linguistic categories // to be "other." For English, singular is "one" and plural is "other". // // Selects can be nested. This allows selecting sentences based on features of // multiple arguments or multiple linguistic properties of a single argument. // // # String interpolation // // There is often a lot of commonality between the possible variants of a // message. For instance, in the example above the word "minute" varies based on // the plural catogory of the argument, but the rest of the sentence is // identical. Using interpolation the above message can be rewritten as: // // catalog.Set(language.English, "You are %d minute(s) late.", // catalog.Var("minutes", // plural.Selectf(1, "", plural.One, "minute", plural.Other, "minutes")), // catalog.String("You are %[1]d ${minutes} late.")) // // Var is defined to return the variable name if the message does not yield a // match. This allows us to further simplify this snippet to // // catalog.Set(language.English, "You are %d minute(s) late.", // catalog.Var("minutes", plural.Selectf(1, "", plural.One, "minute")), // catalog.String("You are %d ${minutes} late.")) // // Overall this is still only a minor improvement, but things can get a lot more // unwieldy if more than one linguistic feature is used to determine a message // variant. Consider the following example: // // // argument 1: list of hosts, argument 2: list of guests // catalog.Set(language.English, "%[1]v invite(s) %[2]v to their party.", // catalog.Var("their", // plural.Selectf(1, "" // plural.One, gender.Select(1, "female", "her", "other", "his"))), // catalog.Var("invites", plural.Selectf(1, "", plural.One, "invite")) // catalog.String("%[1]v ${invites} %[2]v to ${their} party.")), // // Without variable substitution, this would have to be written as // // // argument 1: list of hosts, argument 2: list of guests // catalog.Set(language.English, "%[1]v invite(s) %[2]v to their party.", // plural.Selectf(1, "", // plural.One, gender.Select(1, // "female", "%[1]v invites %[2]v to her party." // "other", "%[1]v invites %[2]v to his party."), // plural.Other, "%[1]v invites %[2]v to their party.")) // // Not necessarily shorter, but using variables there is less duplication and // the messages are more maintenance friendly. Moreover, languages may have up // to six plural forms. This makes the use of variables more welcome. // // Different messages using the same inflections can reuse variables by moving // them to macros. Using macros we can rewrite the message as: // // // argument 1: list of hosts, argument 2: list of guests // catalog.SetString(language.English, "%[1]v invite(s) %[2]v to their party.", // "%[1]v ${invites(1)} %[2]v to ${their(1)} party.") // // Where the following macros were defined separately. // // catalog.SetMacro(language.English, "invites", plural.Selectf(1, "", // plural.One, "invite")) // catalog.SetMacro(language.English, "their", plural.Selectf(1, "", // plural.One, gender.Select(1, "female", "her", "other", "his"))), // // Placeholders use parentheses and the arguments to invoke a macro. // // # Looking up messages // // Message lookup using Catalogs is typically only done by specialized packages // and is not something the user should be concerned with. For instance, to // express the tardiness of a user using the related message we defined earlier, // the user may use the package message like so: // // p := message.NewPrinter(language.English) // p.Printf("You are %d minute(s) late.", 5) // // Which would print: // // You are 5 minutes late. // // This package is UNDER CONSTRUCTION and its API may change. package catalog // import "golang.org/x/text/message/catalog" // TODO: // Some way to freeze a catalog. // - Locking on each lockup turns out to be about 50% of the total running time // for some of the benchmarks in the message package. // Consider these: // - Sequence type to support sequences in user-defined messages. // - Garbage collection: Remove dictionaries that can no longer be reached // as other dictionaries have been added that cover all possible keys. import ( "errors" "fmt" "golang.org/x/text/internal" "golang.org/x/text/internal/catmsg" "golang.org/x/text/language" ) // A Catalog allows lookup of translated messages. type Catalog interface { // Languages returns all languages for which the Catalog contains variants. Languages() []language.Tag // Matcher returns a Matcher for languages from this Catalog. Matcher() language.Matcher // A Context is used for evaluating Messages. Context(tag language.Tag, r catmsg.Renderer) *Context // This method also makes Catalog a private interface. lookup(tag language.Tag, key string) (data string, ok bool) } // NewFromMap creates a Catalog from the given map. If a Dictionary is // underspecified the entry is retrieved from a parent language. func NewFromMap(dictionaries map[string]Dictionary, opts ...Option) (Catalog, error) { options := options{} for _, o := range opts { o(&options) } c := &catalog{ dicts: map[language.Tag]Dictionary{}, } _, hasFallback := dictionaries[options.fallback.String()] if hasFallback { // TODO: Should it be okay to not have a fallback language? // Catalog generators could enforce there is always a fallback. c.langs = append(c.langs, options.fallback) } for lang, dict := range dictionaries { tag, err := language.Parse(lang) if err != nil { return nil, fmt.Errorf("catalog: invalid language tag %q", lang) } if _, ok := c.dicts[tag]; ok { return nil, fmt.Errorf("catalog: duplicate entry for tag %q after normalization", tag) } c.dicts[tag] = dict if !hasFallback || tag != options.fallback { c.langs = append(c.langs, tag) } } if hasFallback { internal.SortTags(c.langs[1:]) } else { internal.SortTags(c.langs) } c.matcher = language.NewMatcher(c.langs) return c, nil } // A Dictionary is a source of translations for a single language. type Dictionary interface { // Lookup returns a message compiled with catmsg.Compile for the given key. // It returns false for ok if such a message could not be found. Lookup(key string) (data string, ok bool) } type catalog struct { langs []language.Tag dicts map[language.Tag]Dictionary macros store matcher language.Matcher } func (c *catalog) Languages() []language.Tag { return c.langs } func (c *catalog) Matcher() language.Matcher { return c.matcher } func (c *catalog) lookup(tag language.Tag, key string) (data string, ok bool) { for ; ; tag = tag.Parent() { if dict, ok := c.dicts[tag]; ok { if data, ok := dict.Lookup(key); ok { return data, true } } if tag == language.Und { break } } return "", false } // Context returns a Context for formatting messages. // Only one Message may be formatted per context at any given time. func (c *catalog) Context(tag language.Tag, r catmsg.Renderer) *Context { return &Context{ cat: c, tag: tag, dec: catmsg.NewDecoder(tag, r, &dict{&c.macros, tag}), } } // A Builder allows building a Catalog programmatically. type Builder struct { options matcher language.Matcher index store macros store } type options struct { fallback language.Tag } // An Option configures Catalog behavior. type Option func(*options) // Fallback specifies the default fallback language. The default is Und. func Fallback(tag language.Tag) Option { return func(o *options) { o.fallback = tag } } // TODO: // // Catalogs specifies one or more sources for a Catalog. // // Lookups are in order. // // This can be changed inserting a Catalog used for setting, which implements // // Loader, used for setting in the chain. // func Catalogs(d ...Loader) Option { // return nil // } // // func Delims(start, end string) Option {} // // func Dict(tag language.Tag, d ...Dictionary) Option // NewBuilder returns an empty mutable Catalog. func NewBuilder(opts ...Option) *Builder { c := &Builder{} for _, o := range opts { o(&c.options) } return c } // SetString is shorthand for Set(tag, key, String(msg)). func (c *Builder) SetString(tag language.Tag, key string, msg string) error { return c.set(tag, key, &c.index, String(msg)) } // Set sets the translation for the given language and key. // // When evaluation this message, the first Message in the sequence to msgs to // evaluate to a string will be the message returned. func (c *Builder) Set(tag language.Tag, key string, msg ...Message) error { return c.set(tag, key, &c.index, msg...) } // SetMacro defines a Message that may be substituted in another message. // The arguments to a macro Message are passed as arguments in the // placeholder the form "${foo(arg1, arg2)}". func (c *Builder) SetMacro(tag language.Tag, name string, msg ...Message) error { return c.set(tag, name, &c.macros, msg...) } // ErrNotFound indicates there was no message for the given key. var ErrNotFound = errors.New("catalog: message not found") // String specifies a plain message string. It can be used as fallback if no // other strings match or as a simple standalone message. // // It is an error to pass more than one String in a message sequence. func String(name string) Message { return catmsg.String(name) } // Var sets a variable that may be substituted in formatting patterns using // named substitution of the form "${name}". The name argument is used as a // fallback if the statements do not produce a match. The statement sequence may // not contain any Var calls. // // The name passed to a Var must be unique within message sequence. func Var(name string, msg ...Message) Message { return &catmsg.Var{Name: name, Message: catmsg.FirstOf(msg)} } // Context returns a Context for formatting messages. // Only one Message may be formatted per context at any given time. func (b *Builder) Context(tag language.Tag, r catmsg.Renderer) *Context { return &Context{ cat: b, tag: tag, dec: catmsg.NewDecoder(tag, r, &dict{&b.macros, tag}), } } // A Context is used for evaluating Messages. // Only one Message may be formatted per context at any given time. type Context struct { cat Catalog tag language.Tag // TODO: use compact index. dec *catmsg.Decoder } // Execute looks up and executes the message with the given key. // It returns ErrNotFound if no message could be found in the index. func (c *Context) Execute(key string) error { data, ok := c.cat.lookup(c.tag, key) if !ok { return ErrNotFound } return c.dec.Execute(data) } ================================================ FILE: vendor/golang.org/x/text/message/catalog/dict.go ================================================ // Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package catalog import ( "sync" "golang.org/x/text/internal" "golang.org/x/text/internal/catmsg" "golang.org/x/text/language" ) // A Message holds a collection of translations for the same phrase that may // vary based on the values of substitution arguments. type Message = catmsg.Message // TODO: // Dictionary returns a Dictionary that returns the first Message, using the // given language tag, that matches: // 1. the last one registered by one of the Set methods // 2. returned by one of the Loaders // 3. repeat from 1. using the parent language // This approach allows messages to be underspecified. // func (c *Catalog) Dictionary(tag language.Tag) (Dictionary, error) { // // TODO: verify dictionary exists. // return &dict{&c.index, tag}, nil // } type dict struct { s *store tag language.Tag // TODO: make compact tag. } func (d *dict) Lookup(key string) (data string, ok bool) { return d.s.lookup(d.tag, key) } func (b *Builder) lookup(tag language.Tag, key string) (data string, ok bool) { return b.index.lookup(tag, key) } func (c *Builder) set(tag language.Tag, key string, s *store, msg ...Message) error { data, err := catmsg.Compile(tag, &dict{&c.macros, tag}, catmsg.FirstOf(msg)) s.mutex.Lock() defer s.mutex.Unlock() m := s.index[tag] if m == nil { m = msgMap{} if s.index == nil { s.index = map[language.Tag]msgMap{} } c.matcher = nil s.index[tag] = m } m[key] = data return err } func (c *Builder) Matcher() language.Matcher { c.index.mutex.RLock() m := c.matcher c.index.mutex.RUnlock() if m != nil { return m } c.index.mutex.Lock() if c.matcher == nil { c.matcher = language.NewMatcher(c.unlockedLanguages()) } m = c.matcher c.index.mutex.Unlock() return m } type store struct { mutex sync.RWMutex index map[language.Tag]msgMap } type msgMap map[string]string func (s *store) lookup(tag language.Tag, key string) (data string, ok bool) { s.mutex.RLock() defer s.mutex.RUnlock() for ; ; tag = tag.Parent() { if msgs, ok := s.index[tag]; ok { if msg, ok := msgs[key]; ok { return msg, true } } if tag == language.Und { break } } return "", false } // Languages returns all languages for which the Catalog contains variants. func (b *Builder) Languages() []language.Tag { s := &b.index s.mutex.RLock() defer s.mutex.RUnlock() return b.unlockedLanguages() } func (b *Builder) unlockedLanguages() []language.Tag { s := &b.index if len(s.index) == 0 { return nil } tags := make([]language.Tag, 0, len(s.index)) _, hasFallback := s.index[b.options.fallback] offset := 0 if hasFallback { tags = append(tags, b.options.fallback) offset = 1 } for t := range s.index { if t != b.options.fallback { tags = append(tags, t) } } internal.SortTags(tags[offset:]) return tags } ================================================ FILE: vendor/golang.org/x/text/message/catalog.go ================================================ // Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package message // TODO: some types in this file will need to be made public at some time. // Documentation and method names will reflect this by using the exported name. import ( "golang.org/x/text/language" "golang.org/x/text/message/catalog" ) // MatchLanguage reports the matched tag obtained from language.MatchStrings for // the Matcher of the DefaultCatalog. func MatchLanguage(preferred ...string) language.Tag { c := DefaultCatalog tag, _ := language.MatchStrings(c.Matcher(), preferred...) return tag } // DefaultCatalog is used by SetString. var DefaultCatalog catalog.Catalog = defaultCatalog var defaultCatalog = catalog.NewBuilder() // SetString calls SetString on the initial default Catalog. func SetString(tag language.Tag, key string, msg string) error { return defaultCatalog.SetString(tag, key, msg) } // Set calls Set on the initial default Catalog. func Set(tag language.Tag, key string, msg ...catalog.Message) error { return defaultCatalog.Set(tag, key, msg...) } ================================================ FILE: vendor/golang.org/x/text/message/doc.go ================================================ // Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package message implements formatted I/O for localized strings with functions // analogous to the fmt's print functions. It is a drop-in replacement for fmt. // // # Localized Formatting // // A format string can be localized by replacing any of the print functions of // fmt with an equivalent call to a Printer. // // p := message.NewPrinter(message.MatchLanguage("en")) // p.Println(123456.78) // Prints 123,456.78 // // p.Printf("%d ducks in a row", 4331) // Prints 4,331 ducks in a row // // p := message.NewPrinter(message.MatchLanguage("nl")) // p.Printf("Hoogte: %.1f meter", 1244.9) // Prints Hoogte: 1,244.9 meter // // p := message.NewPrinter(message.MatchLanguage("bn")) // p.Println(123456.78) // Prints ১,২৩,৪৫৬.৭৮ // // Printer currently supports numbers and specialized types for which packages // exist in x/text. Other builtin types such as time.Time and slices are // planned. // // Format strings largely have the same meaning as with fmt with the following // notable exceptions: // - flag # always resorts to fmt for printing // - verb 'f', 'e', 'g', 'd' use localized formatting unless the '#' flag is // specified. // - verb 'm' inserts a translation of a string argument. // // See package fmt for more options. // // # Translation // // The format strings that are passed to Printf, Sprintf, Fprintf, or Errorf // are used as keys to look up translations for the specified languages. // More on how these need to be specified below. // // One can use arbitrary keys to distinguish between otherwise ambiguous // strings: // // p := message.NewPrinter(language.English) // p.Printf("archive(noun)") // Prints "archive" // p.Printf("archive(verb)") // Prints "archive" // // p := message.NewPrinter(language.German) // p.Printf("archive(noun)") // Prints "Archiv" // p.Printf("archive(verb)") // Prints "archivieren" // // To retain the fallback functionality, use Key: // // p.Printf(message.Key("archive(noun)", "archive")) // p.Printf(message.Key("archive(verb)", "archive")) // // # Translation Pipeline // // Format strings that contain text need to be translated to support different // locales. The first step is to extract strings that need to be translated. // // 1. Install gotext // // go get -u golang.org/x/text/cmd/gotext // gotext -help // // 2. Mark strings in your source to be translated by using message.Printer, // instead of the functions of the fmt package. // // 3. Extract the strings from your source // // gotext extract // // The output will be written to the textdata directory. // // 4. Send the files for translation // // It is planned to support multiple formats, but for now one will have to // rewrite the JSON output to the desired format. // // 5. Inject translations into program // // 6. Repeat from 2 // // Right now this has to be done programmatically with calls to Set or // SetString. These functions as well as the methods defined in // see also package golang.org/x/text/message/catalog can be used to implement // either dynamic or static loading of messages. // // # Plural and Gender Forms // // Translated messages can vary based on the plural and gender forms of // substitution values. In general, it is up to the translators to provide // alternative translations for such forms. See the packages in // golang.org/x/text/feature and golang.org/x/text/message/catalog for more // information. package message ================================================ FILE: vendor/golang.org/x/text/message/format.go ================================================ // Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package message import ( "bytes" "strconv" "unicode/utf8" "golang.org/x/text/internal/format" ) const ( ldigits = "0123456789abcdefx" udigits = "0123456789ABCDEFX" ) const ( signed = true unsigned = false ) // A formatInfo is the raw formatter used by Printf etc. // It prints into a buffer that must be set up separately. type formatInfo struct { buf *bytes.Buffer format.Parser // intbuf is large enough to store %b of an int64 with a sign and // avoids padding at the end of the struct on 32 bit architectures. intbuf [68]byte } func (f *formatInfo) init(buf *bytes.Buffer) { f.ClearFlags() f.buf = buf } // writePadding generates n bytes of padding. func (f *formatInfo) writePadding(n int) { if n <= 0 { // No padding bytes needed. return } f.buf.Grow(n) // Decide which byte the padding should be filled with. padByte := byte(' ') if f.Zero { padByte = byte('0') } // Fill padding with padByte. for i := 0; i < n; i++ { f.buf.WriteByte(padByte) // TODO: make more efficient. } } // pad appends b to f.buf, padded on left (!f.minus) or right (f.minus). func (f *formatInfo) pad(b []byte) { if !f.WidthPresent || f.Width == 0 { f.buf.Write(b) return } width := f.Width - utf8.RuneCount(b) if !f.Minus { // left padding f.writePadding(width) f.buf.Write(b) } else { // right padding f.buf.Write(b) f.writePadding(width) } } // padString appends s to f.buf, padded on left (!f.minus) or right (f.minus). func (f *formatInfo) padString(s string) { if !f.WidthPresent || f.Width == 0 { f.buf.WriteString(s) return } width := f.Width - utf8.RuneCountInString(s) if !f.Minus { // left padding f.writePadding(width) f.buf.WriteString(s) } else { // right padding f.buf.WriteString(s) f.writePadding(width) } } // fmt_boolean formats a boolean. func (f *formatInfo) fmt_boolean(v bool) { if v { f.padString("true") } else { f.padString("false") } } // fmt_unicode formats a uint64 as "U+0078" or with f.sharp set as "U+0078 'x'". func (f *formatInfo) fmt_unicode(u uint64) { buf := f.intbuf[0:] // With default precision set the maximum needed buf length is 18 // for formatting -1 with %#U ("U+FFFFFFFFFFFFFFFF") which fits // into the already allocated intbuf with a capacity of 68 bytes. prec := 4 if f.PrecPresent && f.Prec > 4 { prec = f.Prec // Compute space needed for "U+" , number, " '", character, "'". width := 2 + prec + 2 + utf8.UTFMax + 1 if width > len(buf) { buf = make([]byte, width) } } // Format into buf, ending at buf[i]. Formatting numbers is easier right-to-left. i := len(buf) // For %#U we want to add a space and a quoted character at the end of the buffer. if f.Sharp && u <= utf8.MaxRune && strconv.IsPrint(rune(u)) { i-- buf[i] = '\'' i -= utf8.RuneLen(rune(u)) utf8.EncodeRune(buf[i:], rune(u)) i-- buf[i] = '\'' i-- buf[i] = ' ' } // Format the Unicode code point u as a hexadecimal number. for u >= 16 { i-- buf[i] = udigits[u&0xF] prec-- u >>= 4 } i-- buf[i] = udigits[u] prec-- // Add zeros in front of the number until requested precision is reached. for prec > 0 { i-- buf[i] = '0' prec-- } // Add a leading "U+". i-- buf[i] = '+' i-- buf[i] = 'U' oldZero := f.Zero f.Zero = false f.pad(buf[i:]) f.Zero = oldZero } // fmt_integer formats signed and unsigned integers. func (f *formatInfo) fmt_integer(u uint64, base int, isSigned bool, digits string) { negative := isSigned && int64(u) < 0 if negative { u = -u } buf := f.intbuf[0:] // The already allocated f.intbuf with a capacity of 68 bytes // is large enough for integer formatting when no precision or width is set. if f.WidthPresent || f.PrecPresent { // Account 3 extra bytes for possible addition of a sign and "0x". width := 3 + f.Width + f.Prec // wid and prec are always positive. if width > len(buf) { // We're going to need a bigger boat. buf = make([]byte, width) } } // Two ways to ask for extra leading zero digits: %.3d or %03d. // If both are specified the f.zero flag is ignored and // padding with spaces is used instead. prec := 0 if f.PrecPresent { prec = f.Prec // Precision of 0 and value of 0 means "print nothing" but padding. if prec == 0 && u == 0 { oldZero := f.Zero f.Zero = false f.writePadding(f.Width) f.Zero = oldZero return } } else if f.Zero && f.WidthPresent { prec = f.Width if negative || f.Plus || f.Space { prec-- // leave room for sign } } // Because printing is easier right-to-left: format u into buf, ending at buf[i]. // We could make things marginally faster by splitting the 32-bit case out // into a separate block but it's not worth the duplication, so u has 64 bits. i := len(buf) // Use constants for the division and modulo for more efficient code. // Switch cases ordered by popularity. switch base { case 10: for u >= 10 { i-- next := u / 10 buf[i] = byte('0' + u - next*10) u = next } case 16: for u >= 16 { i-- buf[i] = digits[u&0xF] u >>= 4 } case 8: for u >= 8 { i-- buf[i] = byte('0' + u&7) u >>= 3 } case 2: for u >= 2 { i-- buf[i] = byte('0' + u&1) u >>= 1 } default: panic("fmt: unknown base; can't happen") } i-- buf[i] = digits[u] for i > 0 && prec > len(buf)-i { i-- buf[i] = '0' } // Various prefixes: 0x, -, etc. if f.Sharp { switch base { case 8: if buf[i] != '0' { i-- buf[i] = '0' } case 16: // Add a leading 0x or 0X. i-- buf[i] = digits[16] i-- buf[i] = '0' } } if negative { i-- buf[i] = '-' } else if f.Plus { i-- buf[i] = '+' } else if f.Space { i-- buf[i] = ' ' } // Left padding with zeros has already been handled like precision earlier // or the f.zero flag is ignored due to an explicitly set precision. oldZero := f.Zero f.Zero = false f.pad(buf[i:]) f.Zero = oldZero } // truncate truncates the string to the specified precision, if present. func (f *formatInfo) truncate(s string) string { if f.PrecPresent { n := f.Prec for i := range s { n-- if n < 0 { return s[:i] } } } return s } // fmt_s formats a string. func (f *formatInfo) fmt_s(s string) { s = f.truncate(s) f.padString(s) } // fmt_sbx formats a string or byte slice as a hexadecimal encoding of its bytes. func (f *formatInfo) fmt_sbx(s string, b []byte, digits string) { length := len(b) if b == nil { // No byte slice present. Assume string s should be encoded. length = len(s) } // Set length to not process more bytes than the precision demands. if f.PrecPresent && f.Prec < length { length = f.Prec } // Compute width of the encoding taking into account the f.sharp and f.space flag. width := 2 * length if width > 0 { if f.Space { // Each element encoded by two hexadecimals will get a leading 0x or 0X. if f.Sharp { width *= 2 } // Elements will be separated by a space. width += length - 1 } else if f.Sharp { // Only a leading 0x or 0X will be added for the whole string. width += 2 } } else { // The byte slice or string that should be encoded is empty. if f.WidthPresent { f.writePadding(f.Width) } return } // Handle padding to the left. if f.WidthPresent && f.Width > width && !f.Minus { f.writePadding(f.Width - width) } // Write the encoding directly into the output buffer. buf := f.buf if f.Sharp { // Add leading 0x or 0X. buf.WriteByte('0') buf.WriteByte(digits[16]) } var c byte for i := 0; i < length; i++ { if f.Space && i > 0 { // Separate elements with a space. buf.WriteByte(' ') if f.Sharp { // Add leading 0x or 0X for each element. buf.WriteByte('0') buf.WriteByte(digits[16]) } } if b != nil { c = b[i] // Take a byte from the input byte slice. } else { c = s[i] // Take a byte from the input string. } // Encode each byte as two hexadecimal digits. buf.WriteByte(digits[c>>4]) buf.WriteByte(digits[c&0xF]) } // Handle padding to the right. if f.WidthPresent && f.Width > width && f.Minus { f.writePadding(f.Width - width) } } // fmt_sx formats a string as a hexadecimal encoding of its bytes. func (f *formatInfo) fmt_sx(s, digits string) { f.fmt_sbx(s, nil, digits) } // fmt_bx formats a byte slice as a hexadecimal encoding of its bytes. func (f *formatInfo) fmt_bx(b []byte, digits string) { f.fmt_sbx("", b, digits) } // fmt_q formats a string as a double-quoted, escaped Go string constant. // If f.sharp is set a raw (backquoted) string may be returned instead // if the string does not contain any control characters other than tab. func (f *formatInfo) fmt_q(s string) { s = f.truncate(s) if f.Sharp && strconv.CanBackquote(s) { f.padString("`" + s + "`") return } buf := f.intbuf[:0] if f.Plus { f.pad(strconv.AppendQuoteToASCII(buf, s)) } else { f.pad(strconv.AppendQuote(buf, s)) } } // fmt_c formats an integer as a Unicode character. // If the character is not valid Unicode, it will print '\ufffd'. func (f *formatInfo) fmt_c(c uint64) { r := rune(c) if c > utf8.MaxRune { r = utf8.RuneError } buf := f.intbuf[:0] w := utf8.EncodeRune(buf[:utf8.UTFMax], r) f.pad(buf[:w]) } // fmt_qc formats an integer as a single-quoted, escaped Go character constant. // If the character is not valid Unicode, it will print '\ufffd'. func (f *formatInfo) fmt_qc(c uint64) { r := rune(c) if c > utf8.MaxRune { r = utf8.RuneError } buf := f.intbuf[:0] if f.Plus { f.pad(strconv.AppendQuoteRuneToASCII(buf, r)) } else { f.pad(strconv.AppendQuoteRune(buf, r)) } } // fmt_float formats a float64. It assumes that verb is a valid format specifier // for strconv.AppendFloat and therefore fits into a byte. func (f *formatInfo) fmt_float(v float64, size int, verb rune, prec int) { // Explicit precision in format specifier overrules default precision. if f.PrecPresent { prec = f.Prec } // Format number, reserving space for leading + sign if needed. num := strconv.AppendFloat(f.intbuf[:1], v, byte(verb), prec, size) if num[1] == '-' || num[1] == '+' { num = num[1:] } else { num[0] = '+' } // f.space means to add a leading space instead of a "+" sign unless // the sign is explicitly asked for by f.plus. if f.Space && num[0] == '+' && !f.Plus { num[0] = ' ' } // Special handling for infinities and NaN, // which don't look like a number so shouldn't be padded with zeros. if num[1] == 'I' || num[1] == 'N' { oldZero := f.Zero f.Zero = false // Remove sign before NaN if not asked for. if num[1] == 'N' && !f.Space && !f.Plus { num = num[1:] } f.pad(num) f.Zero = oldZero return } // The sharp flag forces printing a decimal point for non-binary formats // and retains trailing zeros, which we may need to restore. if f.Sharp && verb != 'b' { digits := 0 switch verb { case 'v', 'g', 'G': digits = prec // If no precision is set explicitly use a precision of 6. if digits == -1 { digits = 6 } } // Buffer pre-allocated with enough room for // exponent notations of the form "e+123". var tailBuf [5]byte tail := tailBuf[:0] hasDecimalPoint := false // Starting from i = 1 to skip sign at num[0]. for i := 1; i < len(num); i++ { switch num[i] { case '.': hasDecimalPoint = true case 'e', 'E': tail = append(tail, num[i:]...) num = num[:i] default: digits-- } } if !hasDecimalPoint { num = append(num, '.') } for digits > 0 { num = append(num, '0') digits-- } num = append(num, tail...) } // We want a sign if asked for and if the sign is not positive. if f.Plus || num[0] != '+' { // If we're zero padding to the left we want the sign before the leading zeros. // Achieve this by writing the sign out and then padding the unsigned number. if f.Zero && f.WidthPresent && f.Width > len(num) { f.buf.WriteByte(num[0]) f.writePadding(f.Width - len(num)) f.buf.Write(num[1:]) return } f.pad(num) return } // No sign to show and the number is positive; just print the unsigned number. f.pad(num[1:]) } ================================================ FILE: vendor/golang.org/x/text/message/message.go ================================================ // Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package message // import "golang.org/x/text/message" import ( "io" "os" // Include features to facilitate generated catalogs. _ "golang.org/x/text/feature/plural" "golang.org/x/text/internal/number" "golang.org/x/text/language" "golang.org/x/text/message/catalog" ) // A Printer implements language-specific formatted I/O analogous to the fmt // package. type Printer struct { // the language tag language.Tag toDecimal number.Formatter toScientific number.Formatter cat catalog.Catalog } type options struct { cat catalog.Catalog // TODO: // - allow %s to print integers in written form (tables are likely too large // to enable this by default). // - list behavior // } // An Option defines an option of a Printer. type Option func(o *options) // Catalog defines the catalog to be used. func Catalog(c catalog.Catalog) Option { return func(o *options) { o.cat = c } } // NewPrinter returns a Printer that formats messages tailored to language t. func NewPrinter(t language.Tag, opts ...Option) *Printer { options := &options{ cat: DefaultCatalog, } for _, o := range opts { o(options) } p := &Printer{ tag: t, cat: options.cat, } p.toDecimal.InitDecimal(t) p.toScientific.InitScientific(t) return p } // Sprint is like fmt.Sprint, but using language-specific formatting. func (p *Printer) Sprint(a ...interface{}) string { pp := newPrinter(p) pp.doPrint(a) s := pp.String() pp.free() return s } // Fprint is like fmt.Fprint, but using language-specific formatting. func (p *Printer) Fprint(w io.Writer, a ...interface{}) (n int, err error) { pp := newPrinter(p) pp.doPrint(a) n64, err := io.Copy(w, &pp.Buffer) pp.free() return int(n64), err } // Print is like fmt.Print, but using language-specific formatting. func (p *Printer) Print(a ...interface{}) (n int, err error) { return p.Fprint(os.Stdout, a...) } // Sprintln is like fmt.Sprintln, but using language-specific formatting. func (p *Printer) Sprintln(a ...interface{}) string { pp := newPrinter(p) pp.doPrintln(a) s := pp.String() pp.free() return s } // Fprintln is like fmt.Fprintln, but using language-specific formatting. func (p *Printer) Fprintln(w io.Writer, a ...interface{}) (n int, err error) { pp := newPrinter(p) pp.doPrintln(a) n64, err := io.Copy(w, &pp.Buffer) pp.free() return int(n64), err } // Println is like fmt.Println, but using language-specific formatting. func (p *Printer) Println(a ...interface{}) (n int, err error) { return p.Fprintln(os.Stdout, a...) } // Sprintf is like fmt.Sprintf, but using language-specific formatting. func (p *Printer) Sprintf(key Reference, a ...interface{}) string { pp := newPrinter(p) lookupAndFormat(pp, key, a) s := pp.String() pp.free() return s } // Fprintf is like fmt.Fprintf, but using language-specific formatting. func (p *Printer) Fprintf(w io.Writer, key Reference, a ...interface{}) (n int, err error) { pp := newPrinter(p) lookupAndFormat(pp, key, a) n, err = w.Write(pp.Bytes()) pp.free() return n, err } // Printf is like fmt.Printf, but using language-specific formatting. func (p *Printer) Printf(key Reference, a ...interface{}) (n int, err error) { pp := newPrinter(p) lookupAndFormat(pp, key, a) n, err = os.Stdout.Write(pp.Bytes()) pp.free() return n, err } func lookupAndFormat(p *printer, r Reference, a []interface{}) { p.fmt.Reset(a) switch v := r.(type) { case string: if p.catContext.Execute(v) == catalog.ErrNotFound { p.Render(v) return } case key: if p.catContext.Execute(v.id) == catalog.ErrNotFound && p.catContext.Execute(v.fallback) == catalog.ErrNotFound { p.Render(v.fallback) return } default: panic("key argument is not a Reference") } } type rawPrinter struct { p *printer } func (p rawPrinter) Render(msg string) { p.p.WriteString(msg) } func (p rawPrinter) Arg(i int) interface{} { return nil } // Arg implements catmsg.Renderer. func (p *printer) Arg(i int) interface{} { // TODO, also return "ok" bool i-- if uint(i) < uint(len(p.fmt.Args)) { return p.fmt.Args[i] } return nil } // Render implements catmsg.Renderer. func (p *printer) Render(msg string) { p.doPrintf(msg) } // A Reference is a string or a message reference. type Reference interface { // TODO: also allow []string } // Key creates a message Reference for a message where the given id is used for // message lookup and the fallback is returned when no matches are found. func Key(id string, fallback string) Reference { return key{id, fallback} } type key struct { id, fallback string } ================================================ FILE: vendor/golang.org/x/text/message/print.go ================================================ // Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package message import ( "bytes" "fmt" // TODO: consider copying interfaces from package fmt to avoid dependency. "math" "reflect" "sync" "unicode/utf8" "golang.org/x/text/internal/format" "golang.org/x/text/internal/number" "golang.org/x/text/language" "golang.org/x/text/message/catalog" ) // Strings for use with buffer.WriteString. // This is less overhead than using buffer.Write with byte arrays. const ( commaSpaceString = ", " nilAngleString = "" nilParenString = "(nil)" nilString = "nil" mapString = "map[" percentBangString = "%!" missingString = "(MISSING)" badIndexString = "(BADINDEX)" panicString = "(PANIC=" extraString = "%!(EXTRA " badWidthString = "%!(BADWIDTH)" badPrecString = "%!(BADPREC)" noVerbString = "%!(NOVERB)" invReflectString = "" ) var printerPool = sync.Pool{ New: func() interface{} { return new(printer) }, } // newPrinter allocates a new printer struct or grabs a cached one. func newPrinter(pp *Printer) *printer { p := printerPool.Get().(*printer) p.Printer = *pp // TODO: cache most of the following call. p.catContext = pp.cat.Context(pp.tag, p) p.panicking = false p.erroring = false p.fmt.init(&p.Buffer) return p } // free saves used printer structs in printerFree; avoids an allocation per invocation. func (p *printer) free() { p.Buffer.Reset() p.arg = nil p.value = reflect.Value{} printerPool.Put(p) } // printer is used to store a printer's state. // It implements "golang.org/x/text/internal/format".State. type printer struct { Printer // the context for looking up message translations catContext *catalog.Context // buffer for accumulating output. bytes.Buffer // arg holds the current item, as an interface{}. arg interface{} // value is used instead of arg for reflect values. value reflect.Value // fmt is used to format basic items such as integers or strings. fmt formatInfo // panicking is set by catchPanic to avoid infinite panic, recover, panic, ... recursion. panicking bool // erroring is set when printing an error string to guard against calling handleMethods. erroring bool } // Language implements "golang.org/x/text/internal/format".State. func (p *printer) Language() language.Tag { return p.tag } func (p *printer) Width() (wid int, ok bool) { return p.fmt.Width, p.fmt.WidthPresent } func (p *printer) Precision() (prec int, ok bool) { return p.fmt.Prec, p.fmt.PrecPresent } func (p *printer) Flag(b int) bool { switch b { case '-': return p.fmt.Minus case '+': return p.fmt.Plus || p.fmt.PlusV case '#': return p.fmt.Sharp || p.fmt.SharpV case ' ': return p.fmt.Space case '0': return p.fmt.Zero } return false } // getField gets the i'th field of the struct value. // If the field is itself is an interface, return a value for // the thing inside the interface, not the interface itself. func getField(v reflect.Value, i int) reflect.Value { val := v.Field(i) if val.Kind() == reflect.Interface && !val.IsNil() { val = val.Elem() } return val } func (p *printer) unknownType(v reflect.Value) { if !v.IsValid() { p.WriteString(nilAngleString) return } p.WriteByte('?') p.WriteString(v.Type().String()) p.WriteByte('?') } func (p *printer) badVerb(verb rune) { p.erroring = true p.WriteString(percentBangString) p.WriteRune(verb) p.WriteByte('(') switch { case p.arg != nil: p.WriteString(reflect.TypeOf(p.arg).String()) p.WriteByte('=') p.printArg(p.arg, 'v') case p.value.IsValid(): p.WriteString(p.value.Type().String()) p.WriteByte('=') p.printValue(p.value, 'v', 0) default: p.WriteString(nilAngleString) } p.WriteByte(')') p.erroring = false } func (p *printer) fmtBool(v bool, verb rune) { switch verb { case 't', 'v': p.fmt.fmt_boolean(v) default: p.badVerb(verb) } } // fmt0x64 formats a uint64 in hexadecimal and prefixes it with 0x or // not, as requested, by temporarily setting the sharp flag. func (p *printer) fmt0x64(v uint64, leading0x bool) { sharp := p.fmt.Sharp p.fmt.Sharp = leading0x p.fmt.fmt_integer(v, 16, unsigned, ldigits) p.fmt.Sharp = sharp } // fmtInteger formats a signed or unsigned integer. func (p *printer) fmtInteger(v uint64, isSigned bool, verb rune) { switch verb { case 'v': if p.fmt.SharpV && !isSigned { p.fmt0x64(v, true) return } fallthrough case 'd': if p.fmt.Sharp || p.fmt.SharpV { p.fmt.fmt_integer(v, 10, isSigned, ldigits) } else { p.fmtDecimalInt(v, isSigned) } case 'b': p.fmt.fmt_integer(v, 2, isSigned, ldigits) case 'o': p.fmt.fmt_integer(v, 8, isSigned, ldigits) case 'x': p.fmt.fmt_integer(v, 16, isSigned, ldigits) case 'X': p.fmt.fmt_integer(v, 16, isSigned, udigits) case 'c': p.fmt.fmt_c(v) case 'q': if v <= utf8.MaxRune { p.fmt.fmt_qc(v) } else { p.badVerb(verb) } case 'U': p.fmt.fmt_unicode(v) default: p.badVerb(verb) } } // fmtFloat formats a float. The default precision for each verb // is specified as last argument in the call to fmt_float. func (p *printer) fmtFloat(v float64, size int, verb rune) { switch verb { case 'b': p.fmt.fmt_float(v, size, verb, -1) case 'v': verb = 'g' fallthrough case 'g', 'G': if p.fmt.Sharp || p.fmt.SharpV { p.fmt.fmt_float(v, size, verb, -1) } else { p.fmtVariableFloat(v, size) } case 'e', 'E': if p.fmt.Sharp || p.fmt.SharpV { p.fmt.fmt_float(v, size, verb, 6) } else { p.fmtScientific(v, size, 6) } case 'f', 'F': if p.fmt.Sharp || p.fmt.SharpV { p.fmt.fmt_float(v, size, verb, 6) } else { p.fmtDecimalFloat(v, size, 6) } default: p.badVerb(verb) } } func (p *printer) setFlags(f *number.Formatter) { f.Flags &^= number.ElideSign if p.fmt.Plus || p.fmt.Space { f.Flags |= number.AlwaysSign if !p.fmt.Plus { f.Flags |= number.ElideSign } } else { f.Flags &^= number.AlwaysSign } } func (p *printer) updatePadding(f *number.Formatter) { f.Flags &^= number.PadMask if p.fmt.Minus { f.Flags |= number.PadAfterSuffix } else { f.Flags |= number.PadBeforePrefix } f.PadRune = ' ' f.FormatWidth = uint16(p.fmt.Width) } func (p *printer) initDecimal(minFrac, maxFrac int) { f := &p.toDecimal f.MinIntegerDigits = 1 f.MaxIntegerDigits = 0 f.MinFractionDigits = uint8(minFrac) f.MaxFractionDigits = int16(maxFrac) p.setFlags(f) f.PadRune = 0 if p.fmt.WidthPresent { if p.fmt.Zero { wid := p.fmt.Width // Use significant integers for this. // TODO: this is not the same as width, but so be it. if f.MinFractionDigits > 0 { wid -= 1 + int(f.MinFractionDigits) } if p.fmt.Plus || p.fmt.Space { wid-- } if wid > 0 && wid > int(f.MinIntegerDigits) { f.MinIntegerDigits = uint8(wid) } } p.updatePadding(f) } } func (p *printer) initScientific(minFrac, maxFrac int) { f := &p.toScientific if maxFrac < 0 { f.SetPrecision(maxFrac) } else { f.SetPrecision(maxFrac + 1) f.MinFractionDigits = uint8(minFrac) f.MaxFractionDigits = int16(maxFrac) } f.MinExponentDigits = 2 p.setFlags(f) f.PadRune = 0 if p.fmt.WidthPresent { f.Flags &^= number.PadMask if p.fmt.Zero { f.PadRune = f.Digit(0) f.Flags |= number.PadAfterPrefix } else { f.PadRune = ' ' f.Flags |= number.PadBeforePrefix } p.updatePadding(f) } } func (p *printer) fmtDecimalInt(v uint64, isSigned bool) { var d number.Decimal f := &p.toDecimal if p.fmt.PrecPresent { p.setFlags(f) f.MinIntegerDigits = uint8(p.fmt.Prec) f.MaxIntegerDigits = 0 f.MinFractionDigits = 0 f.MaxFractionDigits = 0 if p.fmt.WidthPresent { p.updatePadding(f) } } else { p.initDecimal(0, 0) } d.ConvertInt(p.toDecimal.RoundingContext, isSigned, v) out := p.toDecimal.Format([]byte(nil), &d) p.Buffer.Write(out) } func (p *printer) fmtDecimalFloat(v float64, size, prec int) { var d number.Decimal if p.fmt.PrecPresent { prec = p.fmt.Prec } p.initDecimal(prec, prec) d.ConvertFloat(p.toDecimal.RoundingContext, v, size) out := p.toDecimal.Format([]byte(nil), &d) p.Buffer.Write(out) } func (p *printer) fmtVariableFloat(v float64, size int) { prec := -1 if p.fmt.PrecPresent { prec = p.fmt.Prec } var d number.Decimal p.initScientific(0, prec) d.ConvertFloat(p.toScientific.RoundingContext, v, size) // Copy logic of 'g' formatting from strconv. It is simplified a bit as // we don't have to mind having prec > len(d.Digits). shortest := prec < 0 ePrec := prec if shortest { prec = len(d.Digits) ePrec = 6 } else if prec == 0 { prec = 1 ePrec = 1 } exp := int(d.Exp) - 1 if exp < -4 || exp >= ePrec { p.initScientific(0, prec) out := p.toScientific.Format([]byte(nil), &d) p.Buffer.Write(out) } else { if prec > int(d.Exp) { prec = len(d.Digits) } if prec -= int(d.Exp); prec < 0 { prec = 0 } p.initDecimal(0, prec) out := p.toDecimal.Format([]byte(nil), &d) p.Buffer.Write(out) } } func (p *printer) fmtScientific(v float64, size, prec int) { var d number.Decimal if p.fmt.PrecPresent { prec = p.fmt.Prec } p.initScientific(prec, prec) rc := p.toScientific.RoundingContext d.ConvertFloat(rc, v, size) out := p.toScientific.Format([]byte(nil), &d) p.Buffer.Write(out) } // fmtComplex formats a complex number v with // r = real(v) and j = imag(v) as (r+ji) using // fmtFloat for r and j formatting. func (p *printer) fmtComplex(v complex128, size int, verb rune) { // Make sure any unsupported verbs are found before the // calls to fmtFloat to not generate an incorrect error string. switch verb { case 'v', 'b', 'g', 'G', 'f', 'F', 'e', 'E': p.WriteByte('(') p.fmtFloat(real(v), size/2, verb) // Imaginary part always has a sign. if math.IsNaN(imag(v)) { // By CLDR's rules, NaNs do not use patterns or signs. As this code // relies on AlwaysSign working for imaginary parts, we need to // manually handle NaNs. f := &p.toScientific p.setFlags(f) p.updatePadding(f) p.setFlags(f) nan := f.Symbol(number.SymNan) extra := 0 if w, ok := p.Width(); ok { extra = w - utf8.RuneCountInString(nan) - 1 } if f.Flags&number.PadAfterNumber == 0 { for ; extra > 0; extra-- { p.WriteRune(f.PadRune) } } p.WriteString(f.Symbol(number.SymPlusSign)) p.WriteString(nan) for ; extra > 0; extra-- { p.WriteRune(f.PadRune) } p.WriteString("i)") return } oldPlus := p.fmt.Plus p.fmt.Plus = true p.fmtFloat(imag(v), size/2, verb) p.WriteString("i)") // TODO: use symbol? p.fmt.Plus = oldPlus default: p.badVerb(verb) } } func (p *printer) fmtString(v string, verb rune) { switch verb { case 'v': if p.fmt.SharpV { p.fmt.fmt_q(v) } else { p.fmt.fmt_s(v) } case 's': p.fmt.fmt_s(v) case 'x': p.fmt.fmt_sx(v, ldigits) case 'X': p.fmt.fmt_sx(v, udigits) case 'q': p.fmt.fmt_q(v) case 'm': ctx := p.cat.Context(p.tag, rawPrinter{p}) if ctx.Execute(v) == catalog.ErrNotFound { p.WriteString(v) } default: p.badVerb(verb) } } func (p *printer) fmtBytes(v []byte, verb rune, typeString string) { switch verb { case 'v', 'd': if p.fmt.SharpV { p.WriteString(typeString) if v == nil { p.WriteString(nilParenString) return } p.WriteByte('{') for i, c := range v { if i > 0 { p.WriteString(commaSpaceString) } p.fmt0x64(uint64(c), true) } p.WriteByte('}') } else { p.WriteByte('[') for i, c := range v { if i > 0 { p.WriteByte(' ') } p.fmt.fmt_integer(uint64(c), 10, unsigned, ldigits) } p.WriteByte(']') } case 's': p.fmt.fmt_s(string(v)) case 'x': p.fmt.fmt_bx(v, ldigits) case 'X': p.fmt.fmt_bx(v, udigits) case 'q': p.fmt.fmt_q(string(v)) default: p.printValue(reflect.ValueOf(v), verb, 0) } } func (p *printer) fmtPointer(value reflect.Value, verb rune) { var u uintptr switch value.Kind() { case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.Slice, reflect.UnsafePointer: u = value.Pointer() default: p.badVerb(verb) return } switch verb { case 'v': if p.fmt.SharpV { p.WriteByte('(') p.WriteString(value.Type().String()) p.WriteString(")(") if u == 0 { p.WriteString(nilString) } else { p.fmt0x64(uint64(u), true) } p.WriteByte(')') } else { if u == 0 { p.fmt.padString(nilAngleString) } else { p.fmt0x64(uint64(u), !p.fmt.Sharp) } } case 'p': p.fmt0x64(uint64(u), !p.fmt.Sharp) case 'b', 'o', 'd', 'x', 'X': if verb == 'd' { p.fmt.Sharp = true // Print as standard go. TODO: does this make sense? } p.fmtInteger(uint64(u), unsigned, verb) default: p.badVerb(verb) } } func (p *printer) catchPanic(arg interface{}, verb rune) { if err := recover(); err != nil { // If it's a nil pointer, just say "". The likeliest causes are a // Stringer that fails to guard against nil or a nil pointer for a // value receiver, and in either case, "" is a nice result. if v := reflect.ValueOf(arg); v.Kind() == reflect.Ptr && v.IsNil() { p.WriteString(nilAngleString) return } // Otherwise print a concise panic message. Most of the time the panic // value will print itself nicely. if p.panicking { // Nested panics; the recursion in printArg cannot succeed. panic(err) } oldFlags := p.fmt.Parser // For this output we want default behavior. p.fmt.ClearFlags() p.WriteString(percentBangString) p.WriteRune(verb) p.WriteString(panicString) p.panicking = true p.printArg(err, 'v') p.panicking = false p.WriteByte(')') p.fmt.Parser = oldFlags } } func (p *printer) handleMethods(verb rune) (handled bool) { if p.erroring { return } // Is it a Formatter? if formatter, ok := p.arg.(format.Formatter); ok { handled = true defer p.catchPanic(p.arg, verb) formatter.Format(p, verb) return } if formatter, ok := p.arg.(fmt.Formatter); ok { handled = true defer p.catchPanic(p.arg, verb) formatter.Format(p, verb) return } // If we're doing Go syntax and the argument knows how to supply it, take care of it now. if p.fmt.SharpV { if stringer, ok := p.arg.(fmt.GoStringer); ok { handled = true defer p.catchPanic(p.arg, verb) // Print the result of GoString unadorned. p.fmt.fmt_s(stringer.GoString()) return } } else { // If a string is acceptable according to the format, see if // the value satisfies one of the string-valued interfaces. // Println etc. set verb to %v, which is "stringable". switch verb { case 'v', 's', 'x', 'X', 'q': // Is it an error or Stringer? // The duplication in the bodies is necessary: // setting handled and deferring catchPanic // must happen before calling the method. switch v := p.arg.(type) { case error: handled = true defer p.catchPanic(p.arg, verb) p.fmtString(v.Error(), verb) return case fmt.Stringer: handled = true defer p.catchPanic(p.arg, verb) p.fmtString(v.String(), verb) return } } } return false } func (p *printer) printArg(arg interface{}, verb rune) { p.arg = arg p.value = reflect.Value{} if arg == nil { switch verb { case 'T', 'v': p.fmt.padString(nilAngleString) default: p.badVerb(verb) } return } // Special processing considerations. // %T (the value's type) and %p (its address) are special; we always do them first. switch verb { case 'T': p.fmt.fmt_s(reflect.TypeOf(arg).String()) return case 'p': p.fmtPointer(reflect.ValueOf(arg), 'p') return } // Some types can be done without reflection. switch f := arg.(type) { case bool: p.fmtBool(f, verb) case float32: p.fmtFloat(float64(f), 32, verb) case float64: p.fmtFloat(f, 64, verb) case complex64: p.fmtComplex(complex128(f), 64, verb) case complex128: p.fmtComplex(f, 128, verb) case int: p.fmtInteger(uint64(f), signed, verb) case int8: p.fmtInteger(uint64(f), signed, verb) case int16: p.fmtInteger(uint64(f), signed, verb) case int32: p.fmtInteger(uint64(f), signed, verb) case int64: p.fmtInteger(uint64(f), signed, verb) case uint: p.fmtInteger(uint64(f), unsigned, verb) case uint8: p.fmtInteger(uint64(f), unsigned, verb) case uint16: p.fmtInteger(uint64(f), unsigned, verb) case uint32: p.fmtInteger(uint64(f), unsigned, verb) case uint64: p.fmtInteger(f, unsigned, verb) case uintptr: p.fmtInteger(uint64(f), unsigned, verb) case string: p.fmtString(f, verb) case []byte: p.fmtBytes(f, verb, "[]byte") case reflect.Value: // Handle extractable values with special methods // since printValue does not handle them at depth 0. if f.IsValid() && f.CanInterface() { p.arg = f.Interface() if p.handleMethods(verb) { return } } p.printValue(f, verb, 0) default: // If the type is not simple, it might have methods. if !p.handleMethods(verb) { // Need to use reflection, since the type had no // interface methods that could be used for formatting. p.printValue(reflect.ValueOf(f), verb, 0) } } } // printValue is similar to printArg but starts with a reflect value, not an interface{} value. // It does not handle 'p' and 'T' verbs because these should have been already handled by printArg. func (p *printer) printValue(value reflect.Value, verb rune, depth int) { // Handle values with special methods if not already handled by printArg (depth == 0). if depth > 0 && value.IsValid() && value.CanInterface() { p.arg = value.Interface() if p.handleMethods(verb) { return } } p.arg = nil p.value = value switch f := value; value.Kind() { case reflect.Invalid: if depth == 0 { p.WriteString(invReflectString) } else { switch verb { case 'v': p.WriteString(nilAngleString) default: p.badVerb(verb) } } case reflect.Bool: p.fmtBool(f.Bool(), verb) case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: p.fmtInteger(uint64(f.Int()), signed, verb) case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: p.fmtInteger(f.Uint(), unsigned, verb) case reflect.Float32: p.fmtFloat(f.Float(), 32, verb) case reflect.Float64: p.fmtFloat(f.Float(), 64, verb) case reflect.Complex64: p.fmtComplex(f.Complex(), 64, verb) case reflect.Complex128: p.fmtComplex(f.Complex(), 128, verb) case reflect.String: p.fmtString(f.String(), verb) case reflect.Map: if p.fmt.SharpV { p.WriteString(f.Type().String()) if f.IsNil() { p.WriteString(nilParenString) return } p.WriteByte('{') } else { p.WriteString(mapString) } keys := f.MapKeys() for i, key := range keys { if i > 0 { if p.fmt.SharpV { p.WriteString(commaSpaceString) } else { p.WriteByte(' ') } } p.printValue(key, verb, depth+1) p.WriteByte(':') p.printValue(f.MapIndex(key), verb, depth+1) } if p.fmt.SharpV { p.WriteByte('}') } else { p.WriteByte(']') } case reflect.Struct: if p.fmt.SharpV { p.WriteString(f.Type().String()) } p.WriteByte('{') for i := 0; i < f.NumField(); i++ { if i > 0 { if p.fmt.SharpV { p.WriteString(commaSpaceString) } else { p.WriteByte(' ') } } if p.fmt.PlusV || p.fmt.SharpV { if name := f.Type().Field(i).Name; name != "" { p.WriteString(name) p.WriteByte(':') } } p.printValue(getField(f, i), verb, depth+1) } p.WriteByte('}') case reflect.Interface: value := f.Elem() if !value.IsValid() { if p.fmt.SharpV { p.WriteString(f.Type().String()) p.WriteString(nilParenString) } else { p.WriteString(nilAngleString) } } else { p.printValue(value, verb, depth+1) } case reflect.Array, reflect.Slice: switch verb { case 's', 'q', 'x', 'X': // Handle byte and uint8 slices and arrays special for the above verbs. t := f.Type() if t.Elem().Kind() == reflect.Uint8 { var bytes []byte if f.Kind() == reflect.Slice { bytes = f.Bytes() } else if f.CanAddr() { bytes = f.Slice(0, f.Len()).Bytes() } else { // We have an array, but we cannot Slice() a non-addressable array, // so we build a slice by hand. This is a rare case but it would be nice // if reflection could help a little more. bytes = make([]byte, f.Len()) for i := range bytes { bytes[i] = byte(f.Index(i).Uint()) } } p.fmtBytes(bytes, verb, t.String()) return } } if p.fmt.SharpV { p.WriteString(f.Type().String()) if f.Kind() == reflect.Slice && f.IsNil() { p.WriteString(nilParenString) return } p.WriteByte('{') for i := 0; i < f.Len(); i++ { if i > 0 { p.WriteString(commaSpaceString) } p.printValue(f.Index(i), verb, depth+1) } p.WriteByte('}') } else { p.WriteByte('[') for i := 0; i < f.Len(); i++ { if i > 0 { p.WriteByte(' ') } p.printValue(f.Index(i), verb, depth+1) } p.WriteByte(']') } case reflect.Ptr: // pointer to array or slice or struct? ok at top level // but not embedded (avoid loops) if depth == 0 && f.Pointer() != 0 { switch a := f.Elem(); a.Kind() { case reflect.Array, reflect.Slice, reflect.Struct, reflect.Map: p.WriteByte('&') p.printValue(a, verb, depth+1) return } } fallthrough case reflect.Chan, reflect.Func, reflect.UnsafePointer: p.fmtPointer(f, verb) default: p.unknownType(f) } } func (p *printer) badArgNum(verb rune) { p.WriteString(percentBangString) p.WriteRune(verb) p.WriteString(badIndexString) } func (p *printer) missingArg(verb rune) { p.WriteString(percentBangString) p.WriteRune(verb) p.WriteString(missingString) } func (p *printer) doPrintf(fmt string) { for p.fmt.Parser.SetFormat(fmt); p.fmt.Scan(); { switch p.fmt.Status { case format.StatusText: p.WriteString(p.fmt.Text()) case format.StatusSubstitution: p.printArg(p.Arg(p.fmt.ArgNum), p.fmt.Verb) case format.StatusBadWidthSubstitution: p.WriteString(badWidthString) p.printArg(p.Arg(p.fmt.ArgNum), p.fmt.Verb) case format.StatusBadPrecSubstitution: p.WriteString(badPrecString) p.printArg(p.Arg(p.fmt.ArgNum), p.fmt.Verb) case format.StatusNoVerb: p.WriteString(noVerbString) case format.StatusBadArgNum: p.badArgNum(p.fmt.Verb) case format.StatusMissingArg: p.missingArg(p.fmt.Verb) default: panic("unreachable") } } // Check for extra arguments, but only if there was at least one ordered // argument. Note that this behavior is necessarily different from fmt: // different variants of messages may opt to drop some or all of the // arguments. if !p.fmt.Reordered && p.fmt.ArgNum < len(p.fmt.Args) && p.fmt.ArgNum != 0 { p.fmt.ClearFlags() p.WriteString(extraString) for i, arg := range p.fmt.Args[p.fmt.ArgNum:] { if i > 0 { p.WriteString(commaSpaceString) } if arg == nil { p.WriteString(nilAngleString) } else { p.WriteString(reflect.TypeOf(arg).String()) p.WriteString("=") p.printArg(arg, 'v') } } p.WriteByte(')') } } func (p *printer) doPrint(a []interface{}) { prevString := false for argNum, arg := range a { isString := arg != nil && reflect.TypeOf(arg).Kind() == reflect.String // Add a space between two non-string arguments. if argNum > 0 && !isString && !prevString { p.WriteByte(' ') } p.printArg(arg, 'v') prevString = isString } } // doPrintln is like doPrint but always adds a space between arguments // and a newline after the last argument. func (p *printer) doPrintln(a []interface{}) { for argNum, arg := range a { if argNum > 0 { p.WriteByte(' ') } p.printArg(arg, 'v') } p.WriteByte('\n') } ================================================ FILE: vendor/golang.org/x/text/secure/bidirule/bidirule.go ================================================ // Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package bidirule implements the Bidi Rule defined by RFC 5893. // // This package is under development. The API may change without notice and // without preserving backward compatibility. package bidirule import ( "errors" "unicode/utf8" "golang.org/x/text/transform" "golang.org/x/text/unicode/bidi" ) // This file contains an implementation of RFC 5893: Right-to-Left Scripts for // Internationalized Domain Names for Applications (IDNA) // // A label is an individual component of a domain name. Labels are usually // shown separated by dots; for example, the domain name "www.example.com" is // composed of three labels: "www", "example", and "com". // // An RTL label is a label that contains at least one character of class R, AL, // or AN. An LTR label is any label that is not an RTL label. // // A "Bidi domain name" is a domain name that contains at least one RTL label. // // The following guarantees can be made based on the above: // // o In a domain name consisting of only labels that satisfy the rule, // the requirements of Section 3 are satisfied. Note that even LTR // labels and pure ASCII labels have to be tested. // // o In a domain name consisting of only LDH labels (as defined in the // Definitions document [RFC5890]) and labels that satisfy the rule, // the requirements of Section 3 are satisfied as long as a label // that starts with an ASCII digit does not come after a // right-to-left label. // // No guarantee is given for other combinations. // ErrInvalid indicates a label is invalid according to the Bidi Rule. var ErrInvalid = errors.New("bidirule: failed Bidi Rule") type ruleState uint8 const ( ruleInitial ruleState = iota ruleLTR ruleLTRFinal ruleRTL ruleRTLFinal ruleInvalid ) type ruleTransition struct { next ruleState mask uint16 } var transitions = [...][2]ruleTransition{ // [2.1] The first character must be a character with Bidi property L, R, or // AL. If it has the R or AL property, it is an RTL label; if it has the L // property, it is an LTR label. ruleInitial: { {ruleLTRFinal, 1 << bidi.L}, {ruleRTLFinal, 1< 0 bytes returned // before considering the error". if r.src0 != r.src1 || r.err != nil { r.dst0 = 0 r.dst1, n, err = r.t.Transform(r.dst, r.src[r.src0:r.src1], r.err == io.EOF) r.src0 += n switch { case err == nil: if r.src0 != r.src1 { r.err = errInconsistentByteCount } // The Transform call was successful; we are complete if we // cannot read more bytes into src. r.transformComplete = r.err != nil continue case err == ErrShortDst && (r.dst1 != 0 || n != 0): // Make room in dst by copying out, and try again. continue case err == ErrShortSrc && r.src1-r.src0 != len(r.src) && r.err == nil: // Read more bytes into src via the code below, and try again. default: r.transformComplete = true // The reader error (r.err) takes precedence over the // transformer error (err) unless r.err is nil or io.EOF. if r.err == nil || r.err == io.EOF { r.err = err } continue } } // Move any untransformed source bytes to the start of the buffer // and read more bytes. if r.src0 != 0 { r.src0, r.src1 = 0, copy(r.src, r.src[r.src0:r.src1]) } n, r.err = r.r.Read(r.src[r.src1:]) r.src1 += n } } // TODO: implement ReadByte (and ReadRune??). // Writer wraps another io.Writer by transforming the bytes read. // The user needs to call Close to flush unwritten bytes that may // be buffered. type Writer struct { w io.Writer t Transformer dst []byte // src[:n] contains bytes that have not yet passed through t. src []byte n int } // NewWriter returns a new Writer that wraps w by transforming the bytes written // via t. It calls Reset on t. func NewWriter(w io.Writer, t Transformer) *Writer { t.Reset() return &Writer{ w: w, t: t, dst: make([]byte, defaultBufSize), src: make([]byte, defaultBufSize), } } // Write implements the io.Writer interface. If there are not enough // bytes available to complete a Transform, the bytes will be buffered // for the next write. Call Close to convert the remaining bytes. func (w *Writer) Write(data []byte) (n int, err error) { src := data if w.n > 0 { // Append bytes from data to the last remainder. // TODO: limit the amount copied on first try. n = copy(w.src[w.n:], data) w.n += n src = w.src[:w.n] } for { nDst, nSrc, err := w.t.Transform(w.dst, src, false) if _, werr := w.w.Write(w.dst[:nDst]); werr != nil { return n, werr } src = src[nSrc:] if w.n == 0 { n += nSrc } else if len(src) <= n { // Enough bytes from w.src have been consumed. We make src point // to data instead to reduce the copying. w.n = 0 n -= len(src) src = data[n:] if n < len(data) && (err == nil || err == ErrShortSrc) { continue } } switch err { case ErrShortDst: // This error is okay as long as we are making progress. if nDst > 0 || nSrc > 0 { continue } case ErrShortSrc: if len(src) < len(w.src) { m := copy(w.src, src) // If w.n > 0, bytes from data were already copied to w.src and n // was already set to the number of bytes consumed. if w.n == 0 { n += m } w.n = m err = nil } else if nDst > 0 || nSrc > 0 { // Not enough buffer to store the remainder. Keep processing as // long as there is progress. Without this case, transforms that // require a lookahead larger than the buffer may result in an // error. This is not something one may expect to be common in // practice, but it may occur when buffers are set to small // sizes during testing. continue } case nil: if w.n > 0 { err = errInconsistentByteCount } } return n, err } } // Close implements the io.Closer interface. func (w *Writer) Close() error { src := w.src[:w.n] for { nDst, nSrc, err := w.t.Transform(w.dst, src, true) if _, werr := w.w.Write(w.dst[:nDst]); werr != nil { return werr } if err != ErrShortDst { return err } src = src[nSrc:] } } type nop struct{ NopResetter } func (nop) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) { n := copy(dst, src) if n < len(src) { err = ErrShortDst } return n, n, err } func (nop) Span(src []byte, atEOF bool) (n int, err error) { return len(src), nil } type discard struct{ NopResetter } func (discard) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) { return 0, len(src), nil } var ( // Discard is a Transformer for which all Transform calls succeed // by consuming all bytes and writing nothing. Discard Transformer = discard{} // Nop is a SpanningTransformer that copies src to dst. Nop SpanningTransformer = nop{} ) // chain is a sequence of links. A chain with N Transformers has N+1 links and // N+1 buffers. Of those N+1 buffers, the first and last are the src and dst // buffers given to chain.Transform and the middle N-1 buffers are intermediate // buffers owned by the chain. The i'th link transforms bytes from the i'th // buffer chain.link[i].b at read offset chain.link[i].p to the i+1'th buffer // chain.link[i+1].b at write offset chain.link[i+1].n, for i in [0, N). type chain struct { link []link err error // errStart is the index at which the error occurred plus 1. Processing // errStart at this level at the next call to Transform. As long as // errStart > 0, chain will not consume any more source bytes. errStart int } func (c *chain) fatalError(errIndex int, err error) { if i := errIndex + 1; i > c.errStart { c.errStart = i c.err = err } } type link struct { t Transformer // b[p:n] holds the bytes to be transformed by t. b []byte p int n int } func (l *link) src() []byte { return l.b[l.p:l.n] } func (l *link) dst() []byte { return l.b[l.n:] } // Chain returns a Transformer that applies t in sequence. func Chain(t ...Transformer) Transformer { if len(t) == 0 { return nop{} } c := &chain{link: make([]link, len(t)+1)} for i, tt := range t { c.link[i].t = tt } // Allocate intermediate buffers. b := make([][defaultBufSize]byte, len(t)-1) for i := range b { c.link[i+1].b = b[i][:] } return c } // Reset resets the state of Chain. It calls Reset on all the Transformers. func (c *chain) Reset() { for i, l := range c.link { if l.t != nil { l.t.Reset() } c.link[i].p, c.link[i].n = 0, 0 } } // TODO: make chain use Span (is going to be fun to implement!) // Transform applies the transformers of c in sequence. func (c *chain) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) { // Set up src and dst in the chain. srcL := &c.link[0] dstL := &c.link[len(c.link)-1] srcL.b, srcL.p, srcL.n = src, 0, len(src) dstL.b, dstL.n = dst, 0 var lastFull, needProgress bool // for detecting progress // i is the index of the next Transformer to apply, for i in [low, high]. // low is the lowest index for which c.link[low] may still produce bytes. // high is the highest index for which c.link[high] has a Transformer. // The error returned by Transform determines whether to increase or // decrease i. We try to completely fill a buffer before converting it. for low, i, high := c.errStart, c.errStart, len(c.link)-2; low <= i && i <= high; { in, out := &c.link[i], &c.link[i+1] nDst, nSrc, err0 := in.t.Transform(out.dst(), in.src(), atEOF && low == i) out.n += nDst in.p += nSrc if i > 0 && in.p == in.n { in.p, in.n = 0, 0 } needProgress, lastFull = lastFull, false switch err0 { case ErrShortDst: // Process the destination buffer next. Return if we are already // at the high index. if i == high { return dstL.n, srcL.p, ErrShortDst } if out.n != 0 { i++ // If the Transformer at the next index is not able to process any // source bytes there is nothing that can be done to make progress // and the bytes will remain unprocessed. lastFull is used to // detect this and break out of the loop with a fatal error. lastFull = true continue } // The destination buffer was too small, but is completely empty. // Return a fatal error as this transformation can never complete. c.fatalError(i, errShortInternal) case ErrShortSrc: if i == 0 { // Save ErrShortSrc in err. All other errors take precedence. err = ErrShortSrc break } // Source bytes were depleted before filling up the destination buffer. // Verify we made some progress, move the remaining bytes to the errStart // and try to get more source bytes. if needProgress && nSrc == 0 || in.n-in.p == len(in.b) { // There were not enough source bytes to proceed while the source // buffer cannot hold any more bytes. Return a fatal error as this // transformation can never complete. c.fatalError(i, errShortInternal) break } // in.b is an internal buffer and we can make progress. in.p, in.n = 0, copy(in.b, in.src()) fallthrough case nil: // if i == low, we have depleted the bytes at index i or any lower levels. // In that case we increase low and i. In all other cases we decrease i to // fetch more bytes before proceeding to the next index. if i > low { i-- continue } default: c.fatalError(i, err0) } // Exhausted level low or fatal error: increase low and continue // to process the bytes accepted so far. i++ low = i } // If c.errStart > 0, this means we found a fatal error. We will clear // all upstream buffers. At this point, no more progress can be made // downstream, as Transform would have bailed while handling ErrShortDst. if c.errStart > 0 { for i := 1; i < c.errStart; i++ { c.link[i].p, c.link[i].n = 0, 0 } err, c.errStart, c.err = c.err, 0, nil } return dstL.n, srcL.p, err } // Deprecated: Use runes.Remove instead. func RemoveFunc(f func(r rune) bool) Transformer { return removeF(f) } type removeF func(r rune) bool func (removeF) Reset() {} // Transform implements the Transformer interface. func (t removeF) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) { for r, sz := rune(0), 0; len(src) > 0; src = src[sz:] { if r = rune(src[0]); r < utf8.RuneSelf { sz = 1 } else { r, sz = utf8.DecodeRune(src) if sz == 1 { // Invalid rune. if !atEOF && !utf8.FullRune(src) { err = ErrShortSrc break } // We replace illegal bytes with RuneError. Not doing so might // otherwise turn a sequence of invalid UTF-8 into valid UTF-8. // The resulting byte sequence may subsequently contain runes // for which t(r) is true that were passed unnoticed. if !t(r) { if nDst+3 > len(dst) { err = ErrShortDst break } nDst += copy(dst[nDst:], "\uFFFD") } nSrc++ continue } } if !t(r) { if nDst+sz > len(dst) { err = ErrShortDst break } nDst += copy(dst[nDst:], src[:sz]) } nSrc += sz } return } // grow returns a new []byte that is longer than b, and copies the first n bytes // of b to the start of the new slice. func grow(b []byte, n int) []byte { m := len(b) if m <= 32 { m = 64 } else if m <= 256 { m *= 2 } else { m += m >> 1 } buf := make([]byte, m) copy(buf, b[:n]) return buf } const initialBufSize = 128 // String returns a string with the result of converting s[:n] using t, where // n <= len(s). If err == nil, n will be len(s). It calls Reset on t. func String(t Transformer, s string) (result string, n int, err error) { t.Reset() if s == "" { // Fast path for the common case for empty input. Results in about a // 86% reduction of running time for BenchmarkStringLowerEmpty. if _, _, err := t.Transform(nil, nil, true); err == nil { return "", 0, nil } } // Allocate only once. Note that both dst and src escape when passed to // Transform. buf := [2 * initialBufSize]byte{} dst := buf[:initialBufSize:initialBufSize] src := buf[initialBufSize : 2*initialBufSize] // The input string s is transformed in multiple chunks (starting with a // chunk size of initialBufSize). nDst and nSrc are per-chunk (or // per-Transform-call) indexes, pDst and pSrc are overall indexes. nDst, nSrc := 0, 0 pDst, pSrc := 0, 0 // pPrefix is the length of a common prefix: the first pPrefix bytes of the // result will equal the first pPrefix bytes of s. It is not guaranteed to // be the largest such value, but if pPrefix, len(result) and len(s) are // all equal after the final transform (i.e. calling Transform with atEOF // being true returned nil error) then we don't need to allocate a new // result string. pPrefix := 0 for { // Invariant: pDst == pPrefix && pSrc == pPrefix. n := copy(src, s[pSrc:]) nDst, nSrc, err = t.Transform(dst, src[:n], pSrc+n == len(s)) pDst += nDst pSrc += nSrc // TODO: let transformers implement an optional Spanner interface, akin // to norm's QuickSpan. This would even allow us to avoid any allocation. if !bytes.Equal(dst[:nDst], src[:nSrc]) { break } pPrefix = pSrc if err == ErrShortDst { // A buffer can only be short if a transformer modifies its input. break } else if err == ErrShortSrc { if nSrc == 0 { // No progress was made. break } // Equal so far and !atEOF, so continue checking. } else if err != nil || pPrefix == len(s) { return string(s[:pPrefix]), pPrefix, err } } // Post-condition: pDst == pPrefix + nDst && pSrc == pPrefix + nSrc. // We have transformed the first pSrc bytes of the input s to become pDst // transformed bytes. Those transformed bytes are discontiguous: the first // pPrefix of them equal s[:pPrefix] and the last nDst of them equal // dst[:nDst]. We copy them around, into a new dst buffer if necessary, so // that they become one contiguous slice: dst[:pDst]. if pPrefix != 0 { newDst := dst if pDst > len(newDst) { newDst = make([]byte, len(s)+nDst-nSrc) } copy(newDst[pPrefix:pDst], dst[:nDst]) copy(newDst[:pPrefix], s[:pPrefix]) dst = newDst } // Prevent duplicate Transform calls with atEOF being true at the end of // the input. Also return if we have an unrecoverable error. if (err == nil && pSrc == len(s)) || (err != nil && err != ErrShortDst && err != ErrShortSrc) { return string(dst[:pDst]), pSrc, err } // Transform the remaining input, growing dst and src buffers as necessary. for { n := copy(src, s[pSrc:]) atEOF := pSrc+n == len(s) nDst, nSrc, err := t.Transform(dst[pDst:], src[:n], atEOF) pDst += nDst pSrc += nSrc // If we got ErrShortDst or ErrShortSrc, do not grow as long as we can // make progress. This may avoid excessive allocations. if err == ErrShortDst { if nDst == 0 { dst = grow(dst, pDst) } } else if err == ErrShortSrc { if atEOF { return string(dst[:pDst]), pSrc, err } if nSrc == 0 { src = grow(src, 0) } } else if err != nil || pSrc == len(s) { return string(dst[:pDst]), pSrc, err } } } // Bytes returns a new byte slice with the result of converting b[:n] using t, // where n <= len(b). If err == nil, n will be len(b). It calls Reset on t. func Bytes(t Transformer, b []byte) (result []byte, n int, err error) { return doAppend(t, 0, make([]byte, len(b)), b) } // Append appends the result of converting src[:n] using t to dst, where // n <= len(src), If err == nil, n will be len(src). It calls Reset on t. func Append(t Transformer, dst, src []byte) (result []byte, n int, err error) { if len(dst) == cap(dst) { n := len(src) + len(dst) // It is okay for this to be 0. b := make([]byte, n) dst = b[:copy(b, dst)] } return doAppend(t, len(dst), dst[:cap(dst)], src) } func doAppend(t Transformer, pDst int, dst, src []byte) (result []byte, n int, err error) { t.Reset() pSrc := 0 for { nDst, nSrc, err := t.Transform(dst[pDst:], src[pSrc:], true) pDst += nDst pSrc += nSrc if err != ErrShortDst { return dst[:pDst], pSrc, err } // Grow the destination buffer, but do not grow as long as we can make // progress. This may avoid excessive allocations. if nDst == 0 { dst = grow(dst, pDst) } } } ================================================ FILE: vendor/golang.org/x/text/unicode/bidi/bidi.go ================================================ // Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:generate go run gen.go gen_trieval.go gen_ranges.go // Package bidi contains functionality for bidirectional text support. // // See https://www.unicode.org/reports/tr9. // // NOTE: UNDER CONSTRUCTION. This API may change in backwards incompatible ways // and without notice. package bidi // import "golang.org/x/text/unicode/bidi" // TODO // - Transformer for reordering? // - Transformer (validator, really) for Bidi Rule. import ( "bytes" ) // This API tries to avoid dealing with embedding levels for now. Under the hood // these will be computed, but the question is to which extent the user should // know they exist. We should at some point allow the user to specify an // embedding hierarchy, though. // A Direction indicates the overall flow of text. type Direction int const ( // LeftToRight indicates the text contains no right-to-left characters and // that either there are some left-to-right characters or the option // DefaultDirection(LeftToRight) was passed. LeftToRight Direction = iota // RightToLeft indicates the text contains no left-to-right characters and // that either there are some right-to-left characters or the option // DefaultDirection(RightToLeft) was passed. RightToLeft // Mixed indicates text contains both left-to-right and right-to-left // characters. Mixed // Neutral means that text contains no left-to-right and right-to-left // characters and that no default direction has been set. Neutral ) type options struct { defaultDirection Direction } // An Option is an option for Bidi processing. type Option func(*options) // ICU allows the user to define embedding levels. This may be used, for example, // to use hierarchical structure of markup languages to define embeddings. // The following option may be a way to expose this functionality in this API. // // LevelFunc sets a function that associates nesting levels with the given text. // // The levels function will be called with monotonically increasing values for p. // func LevelFunc(levels func(p int) int) Option { // panic("unimplemented") // } // DefaultDirection sets the default direction for a Paragraph. The direction is // overridden if the text contains directional characters. func DefaultDirection(d Direction) Option { return func(opts *options) { opts.defaultDirection = d } } // A Paragraph holds a single Paragraph for Bidi processing. type Paragraph struct { p []byte o Ordering opts []Option types []Class pairTypes []bracketType pairValues []rune runes []rune options options } // Initialize the p.pairTypes, p.pairValues and p.types from the input previously // set by p.SetBytes() or p.SetString(). Also limit the input up to (and including) a paragraph // separator (bidi class B). // // The function p.Order() needs these values to be set, so this preparation could be postponed. // But since the SetBytes and SetStrings functions return the length of the input up to the paragraph // separator, the whole input needs to be processed anyway and should not be done twice. // // The function has the same return values as SetBytes() / SetString() func (p *Paragraph) prepareInput() (n int, err error) { p.runes = bytes.Runes(p.p) bytecount := 0 // clear slices from previous SetString or SetBytes p.pairTypes = nil p.pairValues = nil p.types = nil for _, r := range p.runes { props, i := LookupRune(r) bytecount += i cls := props.Class() if cls == B { return bytecount, nil } p.types = append(p.types, cls) if props.IsOpeningBracket() { p.pairTypes = append(p.pairTypes, bpOpen) p.pairValues = append(p.pairValues, r) } else if props.IsBracket() { // this must be a closing bracket, // since IsOpeningBracket is not true p.pairTypes = append(p.pairTypes, bpClose) p.pairValues = append(p.pairValues, r) } else { p.pairTypes = append(p.pairTypes, bpNone) p.pairValues = append(p.pairValues, 0) } } return bytecount, nil } // SetBytes configures p for the given paragraph text. It replaces text // previously set by SetBytes or SetString. If b contains a paragraph separator // it will only process the first paragraph and report the number of bytes // consumed from b including this separator. Error may be non-nil if options are // given. func (p *Paragraph) SetBytes(b []byte, opts ...Option) (n int, err error) { p.p = b p.opts = opts return p.prepareInput() } // SetString configures s for the given paragraph text. It replaces text // previously set by SetBytes or SetString. If s contains a paragraph separator // it will only process the first paragraph and report the number of bytes // consumed from s including this separator. Error may be non-nil if options are // given. func (p *Paragraph) SetString(s string, opts ...Option) (n int, err error) { p.p = []byte(s) p.opts = opts return p.prepareInput() } // IsLeftToRight reports whether the principle direction of rendering for this // paragraphs is left-to-right. If this returns false, the principle direction // of rendering is right-to-left. func (p *Paragraph) IsLeftToRight() bool { return p.Direction() == LeftToRight } // Direction returns the direction of the text of this paragraph. // // The direction may be LeftToRight, RightToLeft, Mixed, or Neutral. func (p *Paragraph) Direction() Direction { return p.o.Direction() } // TODO: what happens if the position is > len(input)? This should return an error. // RunAt reports the Run at the given position of the input text. // // This method can be used for computing line breaks on paragraphs. func (p *Paragraph) RunAt(pos int) Run { c := 0 runNumber := 0 for i, r := range p.o.runes { c += len(r) if pos < c { runNumber = i } } return p.o.Run(runNumber) } func calculateOrdering(levels []level, runes []rune) Ordering { var curDir Direction prevDir := Neutral prevI := 0 o := Ordering{} // lvl = 0,2,4,...: left to right // lvl = 1,3,5,...: right to left for i, lvl := range levels { if lvl%2 == 0 { curDir = LeftToRight } else { curDir = RightToLeft } if curDir != prevDir { if i > 0 { o.runes = append(o.runes, runes[prevI:i]) o.directions = append(o.directions, prevDir) o.startpos = append(o.startpos, prevI) } prevI = i prevDir = curDir } } o.runes = append(o.runes, runes[prevI:]) o.directions = append(o.directions, prevDir) o.startpos = append(o.startpos, prevI) return o } // Order computes the visual ordering of all the runs in a Paragraph. func (p *Paragraph) Order() (Ordering, error) { if len(p.types) == 0 { return Ordering{}, nil } for _, fn := range p.opts { fn(&p.options) } lvl := level(-1) if p.options.defaultDirection == RightToLeft { lvl = 1 } para, err := newParagraph(p.types, p.pairTypes, p.pairValues, lvl) if err != nil { return Ordering{}, err } levels := para.getLevels([]int{len(p.types)}) p.o = calculateOrdering(levels, p.runes) return p.o, nil } // Line computes the visual ordering of runs for a single line starting and // ending at the given positions in the original text. func (p *Paragraph) Line(start, end int) (Ordering, error) { lineTypes := p.types[start:end] para, err := newParagraph(lineTypes, p.pairTypes[start:end], p.pairValues[start:end], -1) if err != nil { return Ordering{}, err } levels := para.getLevels([]int{len(lineTypes)}) o := calculateOrdering(levels, p.runes[start:end]) return o, nil } // An Ordering holds the computed visual order of runs of a Paragraph. Calling // SetBytes or SetString on the originating Paragraph invalidates an Ordering. // The methods of an Ordering should only be called by one goroutine at a time. type Ordering struct { runes [][]rune directions []Direction startpos []int } // Direction reports the directionality of the runs. // // The direction may be LeftToRight, RightToLeft, Mixed, or Neutral. func (o *Ordering) Direction() Direction { return o.directions[0] } // NumRuns returns the number of runs. func (o *Ordering) NumRuns() int { return len(o.runes) } // Run returns the ith run within the ordering. func (o *Ordering) Run(i int) Run { r := Run{ runes: o.runes[i], direction: o.directions[i], startpos: o.startpos[i], } return r } // TODO: perhaps with options. // // Reorder creates a reader that reads the runes in visual order per character. // // Modifiers remain after the runes they modify. // func (l *Runs) Reorder() io.Reader { // panic("unimplemented") // } // A Run is a continuous sequence of characters of a single direction. type Run struct { runes []rune direction Direction startpos int } // String returns the text of the run in its original order. func (r *Run) String() string { return string(r.runes) } // Bytes returns the text of the run in its original order. func (r *Run) Bytes() []byte { return []byte(r.String()) } // TODO: methods for // - Display order // - headers and footers // - bracket replacement. // Direction reports the direction of the run. func (r *Run) Direction() Direction { return r.direction } // Pos returns the position of the Run within the text passed to SetBytes or SetString of the // originating Paragraph value. func (r *Run) Pos() (start, end int) { return r.startpos, r.startpos + len(r.runes) - 1 } // AppendReverse reverses the order of characters of in, appends them to out, // and returns the result. Modifiers will still follow the runes they modify. // Brackets are replaced with their counterparts. func AppendReverse(out, in []byte) []byte { ret := make([]byte, len(in)+len(out)) copy(ret, out) inRunes := bytes.Runes(in) for i, r := range inRunes { prop, _ := LookupRune(r) if prop.IsBracket() { inRunes[i] = prop.reverseBracket(r) } } for i, j := 0, len(inRunes)-1; i < j; i, j = i+1, j-1 { inRunes[i], inRunes[j] = inRunes[j], inRunes[i] } copy(ret[len(out):], string(inRunes)) return ret } // ReverseString reverses the order of characters in s and returns a new string. // Modifiers will still follow the runes they modify. Brackets are replaced with // their counterparts. func ReverseString(s string) string { input := []rune(s) li := len(input) ret := make([]rune, li) for i, r := range input { prop, _ := LookupRune(r) if prop.IsBracket() { ret[li-i-1] = prop.reverseBracket(r) } else { ret[li-i-1] = r } } return string(ret) } ================================================ FILE: vendor/golang.org/x/text/unicode/bidi/bracket.go ================================================ // Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package bidi import ( "container/list" "fmt" "sort" ) // This file contains a port of the reference implementation of the // Bidi Parentheses Algorithm: // https://www.unicode.org/Public/PROGRAMS/BidiReferenceJava/BidiPBAReference.java // // The implementation in this file covers definitions BD14-BD16 and rule N0 // of UAX#9. // // Some preprocessing is done for each rune before data is passed to this // algorithm: // - opening and closing brackets are identified // - a bracket pair type, like '(' and ')' is assigned a unique identifier that // is identical for the opening and closing bracket. It is left to do these // mappings. // - The BPA algorithm requires that bracket characters that are canonical // equivalents of each other be able to be substituted for each other. // It is the responsibility of the caller to do this canonicalization. // // In implementing BD16, this implementation departs slightly from the "logical" // algorithm defined in UAX#9. In particular, the stack referenced there // supports operations that go beyond a "basic" stack. An equivalent // implementation based on a linked list is used here. // Bidi_Paired_Bracket_Type // BD14. An opening paired bracket is a character whose // Bidi_Paired_Bracket_Type property value is Open. // // BD15. A closing paired bracket is a character whose // Bidi_Paired_Bracket_Type property value is Close. type bracketType byte const ( bpNone bracketType = iota bpOpen bpClose ) // bracketPair holds a pair of index values for opening and closing bracket // location of a bracket pair. type bracketPair struct { opener int closer int } func (b *bracketPair) String() string { return fmt.Sprintf("(%v, %v)", b.opener, b.closer) } // bracketPairs is a slice of bracketPairs with a sort.Interface implementation. type bracketPairs []bracketPair func (b bracketPairs) Len() int { return len(b) } func (b bracketPairs) Swap(i, j int) { b[i], b[j] = b[j], b[i] } func (b bracketPairs) Less(i, j int) bool { return b[i].opener < b[j].opener } // resolvePairedBrackets runs the paired bracket part of the UBA algorithm. // // For each rune, it takes the indexes into the original string, the class the // bracket type (in pairTypes) and the bracket identifier (pairValues). It also // takes the direction type for the start-of-sentence and the embedding level. // // The identifiers for bracket types are the rune of the canonicalized opening // bracket for brackets (open or close) or 0 for runes that are not brackets. func resolvePairedBrackets(s *isolatingRunSequence) { p := bracketPairer{ sos: s.sos, openers: list.New(), codesIsolatedRun: s.types, indexes: s.indexes, } dirEmbed := L if s.level&1 != 0 { dirEmbed = R } p.locateBrackets(s.p.pairTypes, s.p.pairValues) p.resolveBrackets(dirEmbed, s.p.initialTypes) } type bracketPairer struct { sos Class // direction corresponding to start of sequence // The following is a restatement of BD 16 using non-algorithmic language. // // A bracket pair is a pair of characters consisting of an opening // paired bracket and a closing paired bracket such that the // Bidi_Paired_Bracket property value of the former equals the latter, // subject to the following constraints. // - both characters of a pair occur in the same isolating run sequence // - the closing character of a pair follows the opening character // - any bracket character can belong at most to one pair, the earliest possible one // - any bracket character not part of a pair is treated like an ordinary character // - pairs may nest properly, but their spans may not overlap otherwise // Bracket characters with canonical decompositions are supposed to be // treated as if they had been normalized, to allow normalized and non- // normalized text to give the same result. In this implementation that step // is pushed out to the caller. The caller has to ensure that the pairValue // slices contain the rune of the opening bracket after normalization for // any opening or closing bracket. openers *list.List // list of positions for opening brackets // bracket pair positions sorted by location of opening bracket pairPositions bracketPairs codesIsolatedRun []Class // directional bidi codes for an isolated run indexes []int // array of index values into the original string } // matchOpener reports whether characters at given positions form a matching // bracket pair. func (p *bracketPairer) matchOpener(pairValues []rune, opener, closer int) bool { return pairValues[p.indexes[opener]] == pairValues[p.indexes[closer]] } const maxPairingDepth = 63 // locateBrackets locates matching bracket pairs according to BD16. // // This implementation uses a linked list instead of a stack, because, while // elements are added at the front (like a push) they are not generally removed // in atomic 'pop' operations, reducing the benefit of the stack archetype. func (p *bracketPairer) locateBrackets(pairTypes []bracketType, pairValues []rune) { // traverse the run // do that explicitly (not in a for-each) so we can record position for i, index := range p.indexes { // look at the bracket type for each character if pairTypes[index] == bpNone || p.codesIsolatedRun[i] != ON { // continue scanning continue } switch pairTypes[index] { case bpOpen: // check if maximum pairing depth reached if p.openers.Len() == maxPairingDepth { p.openers.Init() return } // remember opener location, most recent first p.openers.PushFront(i) case bpClose: // see if there is a match count := 0 for elem := p.openers.Front(); elem != nil; elem = elem.Next() { count++ opener := elem.Value.(int) if p.matchOpener(pairValues, opener, i) { // if the opener matches, add nested pair to the ordered list p.pairPositions = append(p.pairPositions, bracketPair{opener, i}) // remove up to and including matched opener for ; count > 0; count-- { p.openers.Remove(p.openers.Front()) } break } } sort.Sort(p.pairPositions) // if we get here, the closing bracket matched no openers // and gets ignored } } } // Bracket pairs within an isolating run sequence are processed as units so // that both the opening and the closing paired bracket in a pair resolve to // the same direction. // // N0. Process bracket pairs in an isolating run sequence sequentially in // the logical order of the text positions of the opening paired brackets // using the logic given below. Within this scope, bidirectional types EN // and AN are treated as R. // // Identify the bracket pairs in the current isolating run sequence // according to BD16. For each bracket-pair element in the list of pairs of // text positions: // // a Inspect the bidirectional types of the characters enclosed within the // bracket pair. // // b If any strong type (either L or R) matching the embedding direction is // found, set the type for both brackets in the pair to match the embedding // direction. // // o [ e ] o -> o e e e o // // o [ o e ] -> o e o e e // // o [ NI e ] -> o e NI e e // // c Otherwise, if a strong type (opposite the embedding direction) is // found, test for adjacent strong types as follows: 1 First, check // backwards before the opening paired bracket until the first strong type // (L, R, or sos) is found. If that first preceding strong type is opposite // the embedding direction, then set the type for both brackets in the pair // to that type. 2 Otherwise, set the type for both brackets in the pair to // the embedding direction. // // o [ o ] e -> o o o o e // // o [ o NI ] o -> o o o NI o o // // e [ o ] o -> e e o e o // // e [ o ] e -> e e o e e // // e ( o [ o ] NI ) e -> e e o o o o NI e e // // d Otherwise, do not set the type for the current bracket pair. Note that // if the enclosed text contains no strong types the paired brackets will // both resolve to the same level when resolved individually using rules N1 // and N2. // // e ( NI ) o -> e ( NI ) o // getStrongTypeN0 maps character's directional code to strong type as required // by rule N0. // // TODO: have separate type for "strong" directionality. func (p *bracketPairer) getStrongTypeN0(index int) Class { switch p.codesIsolatedRun[index] { // in the scope of N0, number types are treated as R case EN, AN, AL, R: return R case L: return L default: return ON } } // classifyPairContent reports the strong types contained inside a Bracket Pair, // assuming the given embedding direction. // // It returns ON if no strong type is found. If a single strong type is found, // it returns this type. Otherwise it returns the embedding direction. // // TODO: use separate type for "strong" directionality. func (p *bracketPairer) classifyPairContent(loc bracketPair, dirEmbed Class) Class { dirOpposite := ON for i := loc.opener + 1; i < loc.closer; i++ { dir := p.getStrongTypeN0(i) if dir == ON { continue } if dir == dirEmbed { return dir // type matching embedding direction found } dirOpposite = dir } // return ON if no strong type found, or class opposite to dirEmbed return dirOpposite } // classBeforePair determines which strong types are present before a Bracket // Pair. Return R or L if strong type found, otherwise ON. func (p *bracketPairer) classBeforePair(loc bracketPair) Class { for i := loc.opener - 1; i >= 0; i-- { if dir := p.getStrongTypeN0(i); dir != ON { return dir } } // no strong types found, return sos return p.sos } // assignBracketType implements rule N0 for a single bracket pair. func (p *bracketPairer) assignBracketType(loc bracketPair, dirEmbed Class, initialTypes []Class) { // rule "N0, a", inspect contents of pair dirPair := p.classifyPairContent(loc, dirEmbed) // dirPair is now L, R, or N (no strong type found) // the following logical tests are performed out of order compared to // the statement of the rules but yield the same results if dirPair == ON { return // case "d" - nothing to do } if dirPair != dirEmbed { // case "c": strong type found, opposite - check before (c.1) dirPair = p.classBeforePair(loc) if dirPair == dirEmbed || dirPair == ON { // no strong opposite type found before - use embedding (c.2) dirPair = dirEmbed } } // else: case "b", strong type found matching embedding, // no explicit action needed, as dirPair is already set to embedding // direction // set the bracket types to the type found p.setBracketsToType(loc, dirPair, initialTypes) } func (p *bracketPairer) setBracketsToType(loc bracketPair, dirPair Class, initialTypes []Class) { p.codesIsolatedRun[loc.opener] = dirPair p.codesIsolatedRun[loc.closer] = dirPair for i := loc.opener + 1; i < loc.closer; i++ { index := p.indexes[i] if initialTypes[index] != NSM { break } p.codesIsolatedRun[i] = dirPair } for i := loc.closer + 1; i < len(p.indexes); i++ { index := p.indexes[i] if initialTypes[index] != NSM { break } p.codesIsolatedRun[i] = dirPair } } // resolveBrackets implements rule N0 for a list of pairs. func (p *bracketPairer) resolveBrackets(dirEmbed Class, initialTypes []Class) { for _, loc := range p.pairPositions { p.assignBracketType(loc, dirEmbed, initialTypes) } } ================================================ FILE: vendor/golang.org/x/text/unicode/bidi/core.go ================================================ // Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package bidi import ( "fmt" "log" ) // This implementation is a port based on the reference implementation found at: // https://www.unicode.org/Public/PROGRAMS/BidiReferenceJava/ // // described in Unicode Bidirectional Algorithm (UAX #9). // // Input: // There are two levels of input to the algorithm, since clients may prefer to // supply some information from out-of-band sources rather than relying on the // default behavior. // // - Bidi class array // - Bidi class array, with externally supplied base line direction // // Output: // Output is separated into several stages: // // - levels array over entire paragraph // - reordering array over entire paragraph // - levels array over line // - reordering array over line // // Note that for conformance to the Unicode Bidirectional Algorithm, // implementations are only required to generate correct reordering and // character directionality (odd or even levels) over a line. Generating // identical level arrays over a line is not required. Bidi explicit format // codes (LRE, RLE, LRO, RLO, PDF) and BN can be assigned arbitrary levels and // positions as long as the rest of the input is properly reordered. // // As the algorithm is defined to operate on a single paragraph at a time, this // implementation is written to handle single paragraphs. Thus rule P1 is // presumed by this implementation-- the data provided to the implementation is // assumed to be a single paragraph, and either contains no 'B' codes, or a // single 'B' code at the end of the input. 'B' is allowed as input to // illustrate how the algorithm assigns it a level. // // Also note that rules L3 and L4 depend on the rendering engine that uses the // result of the bidi algorithm. This implementation assumes that the rendering // engine expects combining marks in visual order (e.g. to the left of their // base character in RTL runs) and that it adjusts the glyphs used to render // mirrored characters that are in RTL runs so that they render appropriately. // level is the embedding level of a character. Even embedding levels indicate // left-to-right order and odd levels indicate right-to-left order. The special // level of -1 is reserved for undefined order. type level int8 const implicitLevel level = -1 // in returns if x is equal to any of the values in set. func (c Class) in(set ...Class) bool { for _, s := range set { if c == s { return true } } return false } // A paragraph contains the state of a paragraph. type paragraph struct { initialTypes []Class // Arrays of properties needed for paired bracket evaluation in N0 pairTypes []bracketType // paired Bracket types for paragraph pairValues []rune // rune for opening bracket or pbOpen and pbClose; 0 for pbNone embeddingLevel level // default: = implicitLevel; // at the paragraph levels resultTypes []Class resultLevels []level // Index of matching PDI for isolate initiator characters. For other // characters, the value of matchingPDI will be set to -1. For isolate // initiators with no matching PDI, matchingPDI will be set to the length of // the input string. matchingPDI []int // Index of matching isolate initiator for PDI characters. For other // characters, and for PDIs with no matching isolate initiator, the value of // matchingIsolateInitiator will be set to -1. matchingIsolateInitiator []int } // newParagraph initializes a paragraph. The user needs to supply a few arrays // corresponding to the preprocessed text input. The types correspond to the // Unicode BiDi classes for each rune. pairTypes indicates the bracket type for // each rune. pairValues provides a unique bracket class identifier for each // rune (suggested is the rune of the open bracket for opening and matching // close brackets, after normalization). The embedding levels are optional, but // may be supplied to encode embedding levels of styled text. func newParagraph(types []Class, pairTypes []bracketType, pairValues []rune, levels level) (*paragraph, error) { var err error if err = validateTypes(types); err != nil { return nil, err } if err = validatePbTypes(pairTypes); err != nil { return nil, err } if err = validatePbValues(pairValues, pairTypes); err != nil { return nil, err } if err = validateParagraphEmbeddingLevel(levels); err != nil { return nil, err } p := ¶graph{ initialTypes: append([]Class(nil), types...), embeddingLevel: levels, pairTypes: pairTypes, pairValues: pairValues, resultTypes: append([]Class(nil), types...), } p.run() return p, nil } func (p *paragraph) Len() int { return len(p.initialTypes) } // The algorithm. Does not include line-based processing (Rules L1, L2). // These are applied later in the line-based phase of the algorithm. func (p *paragraph) run() { p.determineMatchingIsolates() // 1) determining the paragraph level // Rule P1 is the requirement for entering this algorithm. // Rules P2, P3. // If no externally supplied paragraph embedding level, use default. if p.embeddingLevel == implicitLevel { p.embeddingLevel = p.determineParagraphEmbeddingLevel(0, p.Len()) } // Initialize result levels to paragraph embedding level. p.resultLevels = make([]level, p.Len()) setLevels(p.resultLevels, p.embeddingLevel) // 2) Explicit levels and directions // Rules X1-X8. p.determineExplicitEmbeddingLevels() // Rule X9. // We do not remove the embeddings, the overrides, the PDFs, and the BNs // from the string explicitly. But they are not copied into isolating run // sequences when they are created, so they are removed for all // practical purposes. // Rule X10. // Run remainder of algorithm one isolating run sequence at a time for _, seq := range p.determineIsolatingRunSequences() { // 3) resolving weak types // Rules W1-W7. seq.resolveWeakTypes() // 4a) resolving paired brackets // Rule N0 resolvePairedBrackets(seq) // 4b) resolving neutral types // Rules N1-N3. seq.resolveNeutralTypes() // 5) resolving implicit embedding levels // Rules I1, I2. seq.resolveImplicitLevels() // Apply the computed levels and types seq.applyLevelsAndTypes() } // Assign appropriate levels to 'hide' LREs, RLEs, LROs, RLOs, PDFs, and // BNs. This is for convenience, so the resulting level array will have // a value for every character. p.assignLevelsToCharactersRemovedByX9() } // determineMatchingIsolates determines the matching PDI for each isolate // initiator and vice versa. // // Definition BD9. // // At the end of this function: // // - The member variable matchingPDI is set to point to the index of the // matching PDI character for each isolate initiator character. If there is // no matching PDI, it is set to the length of the input text. For other // characters, it is set to -1. // - The member variable matchingIsolateInitiator is set to point to the // index of the matching isolate initiator character for each PDI character. // If there is no matching isolate initiator, or the character is not a PDI, // it is set to -1. func (p *paragraph) determineMatchingIsolates() { p.matchingPDI = make([]int, p.Len()) p.matchingIsolateInitiator = make([]int, p.Len()) for i := range p.matchingIsolateInitiator { p.matchingIsolateInitiator[i] = -1 } for i := range p.matchingPDI { p.matchingPDI[i] = -1 if t := p.resultTypes[i]; t.in(LRI, RLI, FSI) { depthCounter := 1 for j := i + 1; j < p.Len(); j++ { if u := p.resultTypes[j]; u.in(LRI, RLI, FSI) { depthCounter++ } else if u == PDI { if depthCounter--; depthCounter == 0 { p.matchingPDI[i] = j p.matchingIsolateInitiator[j] = i break } } } if p.matchingPDI[i] == -1 { p.matchingPDI[i] = p.Len() } } } } // determineParagraphEmbeddingLevel reports the resolved paragraph direction of // the substring limited by the given range [start, end). // // Determines the paragraph level based on rules P2, P3. This is also used // in rule X5c to find if an FSI should resolve to LRI or RLI. func (p *paragraph) determineParagraphEmbeddingLevel(start, end int) level { var strongType Class = unknownClass // Rule P2. for i := start; i < end; i++ { if t := p.resultTypes[i]; t.in(L, AL, R) { strongType = t break } else if t.in(FSI, LRI, RLI) { i = p.matchingPDI[i] // skip over to the matching PDI if i > end { log.Panic("assert (i <= end)") } } } // Rule P3. switch strongType { case unknownClass: // none found // default embedding level when no strong types found is 0. return 0 case L: return 0 default: // AL, R return 1 } } const maxDepth = 125 // This stack will store the embedding levels and override and isolated // statuses type directionalStatusStack struct { stackCounter int embeddingLevelStack [maxDepth + 1]level overrideStatusStack [maxDepth + 1]Class isolateStatusStack [maxDepth + 1]bool } func (s *directionalStatusStack) empty() { s.stackCounter = 0 } func (s *directionalStatusStack) pop() { s.stackCounter-- } func (s *directionalStatusStack) depth() int { return s.stackCounter } func (s *directionalStatusStack) push(level level, overrideStatus Class, isolateStatus bool) { s.embeddingLevelStack[s.stackCounter] = level s.overrideStatusStack[s.stackCounter] = overrideStatus s.isolateStatusStack[s.stackCounter] = isolateStatus s.stackCounter++ } func (s *directionalStatusStack) lastEmbeddingLevel() level { return s.embeddingLevelStack[s.stackCounter-1] } func (s *directionalStatusStack) lastDirectionalOverrideStatus() Class { return s.overrideStatusStack[s.stackCounter-1] } func (s *directionalStatusStack) lastDirectionalIsolateStatus() bool { return s.isolateStatusStack[s.stackCounter-1] } // Determine explicit levels using rules X1 - X8 func (p *paragraph) determineExplicitEmbeddingLevels() { var stack directionalStatusStack var overflowIsolateCount, overflowEmbeddingCount, validIsolateCount int // Rule X1. stack.push(p.embeddingLevel, ON, false) for i, t := range p.resultTypes { // Rules X2, X3, X4, X5, X5a, X5b, X5c switch t { case RLE, LRE, RLO, LRO, RLI, LRI, FSI: isIsolate := t.in(RLI, LRI, FSI) isRTL := t.in(RLE, RLO, RLI) // override if this is an FSI that resolves to RLI if t == FSI { isRTL = (p.determineParagraphEmbeddingLevel(i+1, p.matchingPDI[i]) == 1) } if isIsolate { p.resultLevels[i] = stack.lastEmbeddingLevel() if stack.lastDirectionalOverrideStatus() != ON { p.resultTypes[i] = stack.lastDirectionalOverrideStatus() } } var newLevel level if isRTL { // least greater odd newLevel = (stack.lastEmbeddingLevel() + 1) | 1 } else { // least greater even newLevel = (stack.lastEmbeddingLevel() + 2) &^ 1 } if newLevel <= maxDepth && overflowIsolateCount == 0 && overflowEmbeddingCount == 0 { if isIsolate { validIsolateCount++ } // Push new embedding level, override status, and isolated // status. // No check for valid stack counter, since the level check // suffices. switch t { case LRO: stack.push(newLevel, L, isIsolate) case RLO: stack.push(newLevel, R, isIsolate) default: stack.push(newLevel, ON, isIsolate) } // Not really part of the spec if !isIsolate { p.resultLevels[i] = newLevel } } else { // This is an invalid explicit formatting character, // so apply the "Otherwise" part of rules X2-X5b. if isIsolate { overflowIsolateCount++ } else { // !isIsolate if overflowIsolateCount == 0 { overflowEmbeddingCount++ } } } // Rule X6a case PDI: if overflowIsolateCount > 0 { overflowIsolateCount-- } else if validIsolateCount == 0 { // do nothing } else { overflowEmbeddingCount = 0 for !stack.lastDirectionalIsolateStatus() { stack.pop() } stack.pop() validIsolateCount-- } p.resultLevels[i] = stack.lastEmbeddingLevel() // Rule X7 case PDF: // Not really part of the spec p.resultLevels[i] = stack.lastEmbeddingLevel() if overflowIsolateCount > 0 { // do nothing } else if overflowEmbeddingCount > 0 { overflowEmbeddingCount-- } else if !stack.lastDirectionalIsolateStatus() && stack.depth() >= 2 { stack.pop() } case B: // paragraph separator. // Rule X8. // These values are reset for clarity, in this implementation B // can only occur as the last code in the array. stack.empty() overflowIsolateCount = 0 overflowEmbeddingCount = 0 validIsolateCount = 0 p.resultLevels[i] = p.embeddingLevel default: p.resultLevels[i] = stack.lastEmbeddingLevel() if stack.lastDirectionalOverrideStatus() != ON { p.resultTypes[i] = stack.lastDirectionalOverrideStatus() } } } } type isolatingRunSequence struct { p *paragraph indexes []int // indexes to the original string types []Class // type of each character using the index resolvedLevels []level // resolved levels after application of rules level level sos, eos Class } func (i *isolatingRunSequence) Len() int { return len(i.indexes) } // Rule X10, second bullet: Determine the start-of-sequence (sos) and end-of-sequence (eos) types, // either L or R, for each isolating run sequence. func (p *paragraph) isolatingRunSequence(indexes []int) *isolatingRunSequence { length := len(indexes) types := make([]Class, length) for i, x := range indexes { types[i] = p.resultTypes[x] } // assign level, sos and eos prevChar := indexes[0] - 1 for prevChar >= 0 && isRemovedByX9(p.initialTypes[prevChar]) { prevChar-- } prevLevel := p.embeddingLevel if prevChar >= 0 { prevLevel = p.resultLevels[prevChar] } var succLevel level lastType := types[length-1] if lastType.in(LRI, RLI, FSI) { succLevel = p.embeddingLevel } else { // the first character after the end of run sequence limit := indexes[length-1] + 1 for ; limit < p.Len() && isRemovedByX9(p.initialTypes[limit]); limit++ { } succLevel = p.embeddingLevel if limit < p.Len() { succLevel = p.resultLevels[limit] } } level := p.resultLevels[indexes[0]] return &isolatingRunSequence{ p: p, indexes: indexes, types: types, level: level, sos: typeForLevel(max(prevLevel, level)), eos: typeForLevel(max(succLevel, level)), } } // Resolving weak types Rules W1-W7. // // Note that some weak types (EN, AN) remain after this processing is // complete. func (s *isolatingRunSequence) resolveWeakTypes() { // on entry, only these types remain s.assertOnly(L, R, AL, EN, ES, ET, AN, CS, B, S, WS, ON, NSM, LRI, RLI, FSI, PDI) // Rule W1. // Changes all NSMs. precedingCharacterType := s.sos for i, t := range s.types { if t == NSM { s.types[i] = precedingCharacterType } else { // if t.in(LRI, RLI, FSI, PDI) { // precedingCharacterType = ON // } precedingCharacterType = t } } // Rule W2. // EN does not change at the start of the run, because sos != AL. for i, t := range s.types { if t == EN { for j := i - 1; j >= 0; j-- { if t := s.types[j]; t.in(L, R, AL) { if t == AL { s.types[i] = AN } break } } } } // Rule W3. for i, t := range s.types { if t == AL { s.types[i] = R } } // Rule W4. // Since there must be values on both sides for this rule to have an // effect, the scan skips the first and last value. // // Although the scan proceeds left to right, and changes the type // values in a way that would appear to affect the computations // later in the scan, there is actually no problem. A change in the // current value can only affect the value to its immediate right, // and only affect it if it is ES or CS. But the current value can // only change if the value to its right is not ES or CS. Thus // either the current value will not change, or its change will have // no effect on the remainder of the analysis. for i := 1; i < s.Len()-1; i++ { t := s.types[i] if t == ES || t == CS { prevSepType := s.types[i-1] succSepType := s.types[i+1] if prevSepType == EN && succSepType == EN { s.types[i] = EN } else if s.types[i] == CS && prevSepType == AN && succSepType == AN { s.types[i] = AN } } } // Rule W5. for i, t := range s.types { if t == ET { // locate end of sequence runStart := i runEnd := s.findRunLimit(runStart, ET) // check values at ends of sequence t := s.sos if runStart > 0 { t = s.types[runStart-1] } if t != EN { t = s.eos if runEnd < len(s.types) { t = s.types[runEnd] } } if t == EN { setTypes(s.types[runStart:runEnd], EN) } // continue at end of sequence i = runEnd } } // Rule W6. for i, t := range s.types { if t.in(ES, ET, CS) { s.types[i] = ON } } // Rule W7. for i, t := range s.types { if t == EN { // set default if we reach start of run prevStrongType := s.sos for j := i - 1; j >= 0; j-- { t = s.types[j] if t == L || t == R { // AL's have been changed to R prevStrongType = t break } } if prevStrongType == L { s.types[i] = L } } } } // 6) resolving neutral types Rules N1-N2. func (s *isolatingRunSequence) resolveNeutralTypes() { // on entry, only these types can be in resultTypes s.assertOnly(L, R, EN, AN, B, S, WS, ON, RLI, LRI, FSI, PDI) for i, t := range s.types { switch t { case WS, ON, B, S, RLI, LRI, FSI, PDI: // find bounds of run of neutrals runStart := i runEnd := s.findRunLimit(runStart, B, S, WS, ON, RLI, LRI, FSI, PDI) // determine effective types at ends of run var leadType, trailType Class // Note that the character found can only be L, R, AN, or // EN. if runStart == 0 { leadType = s.sos } else { leadType = s.types[runStart-1] if leadType.in(AN, EN) { leadType = R } } if runEnd == len(s.types) { trailType = s.eos } else { trailType = s.types[runEnd] if trailType.in(AN, EN) { trailType = R } } var resolvedType Class if leadType == trailType { // Rule N1. resolvedType = leadType } else { // Rule N2. // Notice the embedding level of the run is used, not // the paragraph embedding level. resolvedType = typeForLevel(s.level) } setTypes(s.types[runStart:runEnd], resolvedType) // skip over run of (former) neutrals i = runEnd } } } func setLevels(levels []level, newLevel level) { for i := range levels { levels[i] = newLevel } } func setTypes(types []Class, newType Class) { for i := range types { types[i] = newType } } // 7) resolving implicit embedding levels Rules I1, I2. func (s *isolatingRunSequence) resolveImplicitLevels() { // on entry, only these types can be in resultTypes s.assertOnly(L, R, EN, AN) s.resolvedLevels = make([]level, len(s.types)) setLevels(s.resolvedLevels, s.level) if (s.level & 1) == 0 { // even level for i, t := range s.types { // Rule I1. if t == L { // no change } else if t == R { s.resolvedLevels[i] += 1 } else { // t == AN || t == EN s.resolvedLevels[i] += 2 } } } else { // odd level for i, t := range s.types { // Rule I2. if t == R { // no change } else { // t == L || t == AN || t == EN s.resolvedLevels[i] += 1 } } } } // Applies the levels and types resolved in rules W1-I2 to the // resultLevels array. func (s *isolatingRunSequence) applyLevelsAndTypes() { for i, x := range s.indexes { s.p.resultTypes[x] = s.types[i] s.p.resultLevels[x] = s.resolvedLevels[i] } } // Return the limit of the run consisting only of the types in validSet // starting at index. This checks the value at index, and will return // index if that value is not in validSet. func (s *isolatingRunSequence) findRunLimit(index int, validSet ...Class) int { loop: for ; index < len(s.types); index++ { t := s.types[index] for _, valid := range validSet { if t == valid { continue loop } } return index // didn't find a match in validSet } return len(s.types) } // Algorithm validation. Assert that all values in types are in the // provided set. func (s *isolatingRunSequence) assertOnly(codes ...Class) { loop: for i, t := range s.types { for _, c := range codes { if t == c { continue loop } } log.Panicf("invalid bidi code %v present in assertOnly at position %d", t, s.indexes[i]) } } // determineLevelRuns returns an array of level runs. Each level run is // described as an array of indexes into the input string. // // Determines the level runs. Rule X9 will be applied in determining the // runs, in the way that makes sure the characters that are supposed to be // removed are not included in the runs. func (p *paragraph) determineLevelRuns() [][]int { run := []int{} allRuns := [][]int{} currentLevel := implicitLevel for i := range p.initialTypes { if !isRemovedByX9(p.initialTypes[i]) { if p.resultLevels[i] != currentLevel { // we just encountered a new run; wrap up last run if currentLevel >= 0 { // only wrap it up if there was a run allRuns = append(allRuns, run) run = nil } // Start new run currentLevel = p.resultLevels[i] } run = append(run, i) } } // Wrap up the final run, if any if len(run) > 0 { allRuns = append(allRuns, run) } return allRuns } // Definition BD13. Determine isolating run sequences. func (p *paragraph) determineIsolatingRunSequences() []*isolatingRunSequence { levelRuns := p.determineLevelRuns() // Compute the run that each character belongs to runForCharacter := make([]int, p.Len()) for i, run := range levelRuns { for _, index := range run { runForCharacter[index] = i } } sequences := []*isolatingRunSequence{} var currentRunSequence []int for _, run := range levelRuns { first := run[0] if p.initialTypes[first] != PDI || p.matchingIsolateInitiator[first] == -1 { currentRunSequence = nil // int run = i; for { // Copy this level run into currentRunSequence currentRunSequence = append(currentRunSequence, run...) last := currentRunSequence[len(currentRunSequence)-1] lastT := p.initialTypes[last] if lastT.in(LRI, RLI, FSI) && p.matchingPDI[last] != p.Len() { run = levelRuns[runForCharacter[p.matchingPDI[last]]] } else { break } } sequences = append(sequences, p.isolatingRunSequence(currentRunSequence)) } } return sequences } // Assign level information to characters removed by rule X9. This is for // ease of relating the level information to the original input data. Note // that the levels assigned to these codes are arbitrary, they're chosen so // as to avoid breaking level runs. func (p *paragraph) assignLevelsToCharactersRemovedByX9() { for i, t := range p.initialTypes { if t.in(LRE, RLE, LRO, RLO, PDF, BN) { p.resultTypes[i] = t p.resultLevels[i] = -1 } } // now propagate forward the levels information (could have // propagated backward, the main thing is not to introduce a level // break where one doesn't already exist). if p.resultLevels[0] == -1 { p.resultLevels[0] = p.embeddingLevel } for i := 1; i < len(p.initialTypes); i++ { if p.resultLevels[i] == -1 { p.resultLevels[i] = p.resultLevels[i-1] } } // Embedding information is for informational purposes only so need not be // adjusted. } // // Output // // getLevels computes levels array breaking lines at offsets in linebreaks. // Rule L1. // // The linebreaks array must include at least one value. The values must be // in strictly increasing order (no duplicates) between 1 and the length of // the text, inclusive. The last value must be the length of the text. func (p *paragraph) getLevels(linebreaks []int) []level { // Note that since the previous processing has removed all // P, S, and WS values from resultTypes, the values referred to // in these rules are the initial types, before any processing // has been applied (including processing of overrides). // // This example implementation has reinserted explicit format codes // and BN, in order that the levels array correspond to the // initial text. Their final placement is not normative. // These codes are treated like WS in this implementation, // so they don't interrupt sequences of WS. validateLineBreaks(linebreaks, p.Len()) result := append([]level(nil), p.resultLevels...) // don't worry about linebreaks since if there is a break within // a series of WS values preceding S, the linebreak itself // causes the reset. for i, t := range p.initialTypes { if t.in(B, S) { // Rule L1, clauses one and two. result[i] = p.embeddingLevel // Rule L1, clause three. for j := i - 1; j >= 0; j-- { if isWhitespace(p.initialTypes[j]) { // including format codes result[j] = p.embeddingLevel } else { break } } } } // Rule L1, clause four. start := 0 for _, limit := range linebreaks { for j := limit - 1; j >= start; j-- { if isWhitespace(p.initialTypes[j]) { // including format codes result[j] = p.embeddingLevel } else { break } } start = limit } return result } // getReordering returns the reordering of lines from a visual index to a // logical index for line breaks at the given offsets. // // Lines are concatenated from left to right. So for example, the fifth // character from the left on the third line is // // getReordering(linebreaks)[linebreaks[1] + 4] // // (linebreaks[1] is the position after the last character of the second // line, which is also the index of the first character on the third line, // and adding four gets the fifth character from the left). // // The linebreaks array must include at least one value. The values must be // in strictly increasing order (no duplicates) between 1 and the length of // the text, inclusive. The last value must be the length of the text. func (p *paragraph) getReordering(linebreaks []int) []int { validateLineBreaks(linebreaks, p.Len()) return computeMultilineReordering(p.getLevels(linebreaks), linebreaks) } // Return multiline reordering array for a given level array. Reordering // does not occur across a line break. func computeMultilineReordering(levels []level, linebreaks []int) []int { result := make([]int, len(levels)) start := 0 for _, limit := range linebreaks { tempLevels := make([]level, limit-start) copy(tempLevels, levels[start:]) for j, order := range computeReordering(tempLevels) { result[start+j] = order + start } start = limit } return result } // Return reordering array for a given level array. This reorders a single // line. The reordering is a visual to logical map. For example, the // leftmost char is string.charAt(order[0]). Rule L2. func computeReordering(levels []level) []int { result := make([]int, len(levels)) // initialize order for i := range result { result[i] = i } // locate highest level found on line. // Note the rules say text, but no reordering across line bounds is // performed, so this is sufficient. highestLevel := level(0) lowestOddLevel := level(maxDepth + 2) for _, level := range levels { if level > highestLevel { highestLevel = level } if level&1 != 0 && level < lowestOddLevel { lowestOddLevel = level } } for level := highestLevel; level >= lowestOddLevel; level-- { for i := 0; i < len(levels); i++ { if levels[i] >= level { // find range of text at or above this level start := i limit := i + 1 for limit < len(levels) && levels[limit] >= level { limit++ } for j, k := start, limit-1; j < k; j, k = j+1, k-1 { result[j], result[k] = result[k], result[j] } // skip to end of level run i = limit } } } return result } // isWhitespace reports whether the type is considered a whitespace type for the // line break rules. func isWhitespace(c Class) bool { switch c { case LRE, RLE, LRO, RLO, PDF, LRI, RLI, FSI, PDI, BN, WS: return true } return false } // isRemovedByX9 reports whether the type is one of the types removed in X9. func isRemovedByX9(c Class) bool { switch c { case LRE, RLE, LRO, RLO, PDF, BN: return true } return false } // typeForLevel reports the strong type (L or R) corresponding to the level. func typeForLevel(level level) Class { if (level & 0x1) == 0 { return L } return R } func validateTypes(types []Class) error { if len(types) == 0 { return fmt.Errorf("types is null") } for i, t := range types[:len(types)-1] { if t == B { return fmt.Errorf("B type before end of paragraph at index: %d", i) } } return nil } func validateParagraphEmbeddingLevel(embeddingLevel level) error { if embeddingLevel != implicitLevel && embeddingLevel != 0 && embeddingLevel != 1 { return fmt.Errorf("illegal paragraph embedding level: %d", embeddingLevel) } return nil } func validateLineBreaks(linebreaks []int, textLength int) error { prev := 0 for i, next := range linebreaks { if next <= prev { return fmt.Errorf("bad linebreak: %d at index: %d", next, i) } prev = next } if prev != textLength { return fmt.Errorf("last linebreak was %d, want %d", prev, textLength) } return nil } func validatePbTypes(pairTypes []bracketType) error { if len(pairTypes) == 0 { return fmt.Errorf("pairTypes is null") } for i, pt := range pairTypes { switch pt { case bpNone, bpOpen, bpClose: default: return fmt.Errorf("illegal pairType value at %d: %v", i, pairTypes[i]) } } return nil } func validatePbValues(pairValues []rune, pairTypes []bracketType) error { if pairValues == nil { return fmt.Errorf("pairValues is null") } if len(pairTypes) != len(pairValues) { return fmt.Errorf("pairTypes is different length from pairValues") } return nil } ================================================ FILE: vendor/golang.org/x/text/unicode/bidi/prop.go ================================================ // Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package bidi import "unicode/utf8" // Properties provides access to BiDi properties of runes. type Properties struct { entry uint8 last uint8 } var trie = newBidiTrie(0) // TODO: using this for bidirule reduces the running time by about 5%. Consider // if this is worth exposing or if we can find a way to speed up the Class // method. // // // CompactClass is like Class, but maps all of the BiDi control classes // // (LRO, RLO, LRE, RLE, PDF, LRI, RLI, FSI, PDI) to the class Control. // func (p Properties) CompactClass() Class { // return Class(p.entry & 0x0F) // } // Class returns the Bidi class for p. func (p Properties) Class() Class { c := Class(p.entry & 0x0F) if c == Control { c = controlByteToClass[p.last&0xF] } return c } // IsBracket reports whether the rune is a bracket. func (p Properties) IsBracket() bool { return p.entry&0xF0 != 0 } // IsOpeningBracket reports whether the rune is an opening bracket. // IsBracket must return true. func (p Properties) IsOpeningBracket() bool { return p.entry&openMask != 0 } // TODO: find a better API and expose. func (p Properties) reverseBracket(r rune) rune { return xorMasks[p.entry>>xorMaskShift] ^ r } var controlByteToClass = [16]Class{ 0xD: LRO, // U+202D LeftToRightOverride, 0xE: RLO, // U+202E RightToLeftOverride, 0xA: LRE, // U+202A LeftToRightEmbedding, 0xB: RLE, // U+202B RightToLeftEmbedding, 0xC: PDF, // U+202C PopDirectionalFormat, 0x6: LRI, // U+2066 LeftToRightIsolate, 0x7: RLI, // U+2067 RightToLeftIsolate, 0x8: FSI, // U+2068 FirstStrongIsolate, 0x9: PDI, // U+2069 PopDirectionalIsolate, } // LookupRune returns properties for r. func LookupRune(r rune) (p Properties, size int) { var buf [4]byte n := utf8.EncodeRune(buf[:], r) return Lookup(buf[:n]) } // TODO: these lookup methods are based on the generated trie code. The returned // sizes have slightly different semantics from the generated code, in that it // always returns size==1 for an illegal UTF-8 byte (instead of the length // of the maximum invalid subsequence). Most Transformers, like unicode/norm, // leave invalid UTF-8 untouched, in which case it has performance benefits to // do so (without changing the semantics). Bidi requires the semantics used here // for the bidirule implementation to be compatible with the Go semantics. // They ultimately should perhaps be adopted by all trie implementations, for // convenience sake. // This unrolled code also boosts performance of the secure/bidirule package by // about 30%. // So, to remove this code: // - add option to trie generator to define return type. // - always return 1 byte size for ill-formed UTF-8 runes. // Lookup returns properties for the first rune in s and the width in bytes of // its encoding. The size will be 0 if s does not hold enough bytes to complete // the encoding. func Lookup(s []byte) (p Properties, sz int) { c0 := s[0] switch { case c0 < 0x80: // is ASCII return Properties{entry: bidiValues[c0]}, 1 case c0 < 0xC2: return Properties{}, 1 case c0 < 0xE0: // 2-byte UTF-8 if len(s) < 2 { return Properties{}, 0 } i := bidiIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return Properties{}, 1 } return Properties{entry: trie.lookupValue(uint32(i), c1)}, 2 case c0 < 0xF0: // 3-byte UTF-8 if len(s) < 3 { return Properties{}, 0 } i := bidiIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return Properties{}, 1 } o := uint32(i)<<6 + uint32(c1) i = bidiIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return Properties{}, 1 } return Properties{entry: trie.lookupValue(uint32(i), c2), last: c2}, 3 case c0 < 0xF8: // 4-byte UTF-8 if len(s) < 4 { return Properties{}, 0 } i := bidiIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return Properties{}, 1 } o := uint32(i)<<6 + uint32(c1) i = bidiIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return Properties{}, 1 } o = uint32(i)<<6 + uint32(c2) i = bidiIndex[o] c3 := s[3] if c3 < 0x80 || 0xC0 <= c3 { return Properties{}, 1 } return Properties{entry: trie.lookupValue(uint32(i), c3)}, 4 } // Illegal rune return Properties{}, 1 } // LookupString returns properties for the first rune in s and the width in // bytes of its encoding. The size will be 0 if s does not hold enough bytes to // complete the encoding. func LookupString(s string) (p Properties, sz int) { c0 := s[0] switch { case c0 < 0x80: // is ASCII return Properties{entry: bidiValues[c0]}, 1 case c0 < 0xC2: return Properties{}, 1 case c0 < 0xE0: // 2-byte UTF-8 if len(s) < 2 { return Properties{}, 0 } i := bidiIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return Properties{}, 1 } return Properties{entry: trie.lookupValue(uint32(i), c1)}, 2 case c0 < 0xF0: // 3-byte UTF-8 if len(s) < 3 { return Properties{}, 0 } i := bidiIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return Properties{}, 1 } o := uint32(i)<<6 + uint32(c1) i = bidiIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return Properties{}, 1 } return Properties{entry: trie.lookupValue(uint32(i), c2), last: c2}, 3 case c0 < 0xF8: // 4-byte UTF-8 if len(s) < 4 { return Properties{}, 0 } i := bidiIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return Properties{}, 1 } o := uint32(i)<<6 + uint32(c1) i = bidiIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return Properties{}, 1 } o = uint32(i)<<6 + uint32(c2) i = bidiIndex[o] c3 := s[3] if c3 < 0x80 || 0xC0 <= c3 { return Properties{}, 1 } return Properties{entry: trie.lookupValue(uint32(i), c3)}, 4 } // Illegal rune return Properties{}, 1 } ================================================ FILE: vendor/golang.org/x/text/unicode/bidi/tables15.0.0.go ================================================ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. //go:build !go1.27 package bidi // UnicodeVersion is the Unicode version from which the tables in this package are derived. const UnicodeVersion = "15.0.0" // xorMasks contains masks to be xor-ed with brackets to get the reverse // version. var xorMasks = []int32{ // 8 elements 0, 1, 6, 7, 3, 15, 29, 63, } // Size: 56 bytes // lookup returns the trie value for the first UTF-8 encoding in s and // the width in bytes of this encoding. The size will be 0 if s does not // hold enough bytes to complete the encoding. len(s) must be greater than 0. func (t *bidiTrie) lookup(s []byte) (v uint8, sz int) { c0 := s[0] switch { case c0 < 0x80: // is ASCII return bidiValues[c0], 1 case c0 < 0xC2: return 0, 1 // Illegal UTF-8: not a starter, not ASCII. case c0 < 0xE0: // 2-byte UTF-8 if len(s) < 2 { return 0, 0 } i := bidiIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c1), 2 case c0 < 0xF0: // 3-byte UTF-8 if len(s) < 3 { return 0, 0 } i := bidiIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = bidiIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c2), 3 case c0 < 0xF8: // 4-byte UTF-8 if len(s) < 4 { return 0, 0 } i := bidiIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = bidiIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } o = uint32(i)<<6 + uint32(c2) i = bidiIndex[o] c3 := s[3] if c3 < 0x80 || 0xC0 <= c3 { return 0, 3 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c3), 4 } // Illegal rune return 0, 1 } // lookupUnsafe returns the trie value for the first UTF-8 encoding in s. // s must start with a full and valid UTF-8 encoded rune. func (t *bidiTrie) lookupUnsafe(s []byte) uint8 { c0 := s[0] if c0 < 0x80 { // is ASCII return bidiValues[c0] } i := bidiIndex[c0] if c0 < 0xE0 { // 2-byte UTF-8 return t.lookupValue(uint32(i), s[1]) } i = bidiIndex[uint32(i)<<6+uint32(s[1])] if c0 < 0xF0 { // 3-byte UTF-8 return t.lookupValue(uint32(i), s[2]) } i = bidiIndex[uint32(i)<<6+uint32(s[2])] if c0 < 0xF8 { // 4-byte UTF-8 return t.lookupValue(uint32(i), s[3]) } return 0 } // lookupString returns the trie value for the first UTF-8 encoding in s and // the width in bytes of this encoding. The size will be 0 if s does not // hold enough bytes to complete the encoding. len(s) must be greater than 0. func (t *bidiTrie) lookupString(s string) (v uint8, sz int) { c0 := s[0] switch { case c0 < 0x80: // is ASCII return bidiValues[c0], 1 case c0 < 0xC2: return 0, 1 // Illegal UTF-8: not a starter, not ASCII. case c0 < 0xE0: // 2-byte UTF-8 if len(s) < 2 { return 0, 0 } i := bidiIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c1), 2 case c0 < 0xF0: // 3-byte UTF-8 if len(s) < 3 { return 0, 0 } i := bidiIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = bidiIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c2), 3 case c0 < 0xF8: // 4-byte UTF-8 if len(s) < 4 { return 0, 0 } i := bidiIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = bidiIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } o = uint32(i)<<6 + uint32(c2) i = bidiIndex[o] c3 := s[3] if c3 < 0x80 || 0xC0 <= c3 { return 0, 3 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c3), 4 } // Illegal rune return 0, 1 } // lookupStringUnsafe returns the trie value for the first UTF-8 encoding in s. // s must start with a full and valid UTF-8 encoded rune. func (t *bidiTrie) lookupStringUnsafe(s string) uint8 { c0 := s[0] if c0 < 0x80 { // is ASCII return bidiValues[c0] } i := bidiIndex[c0] if c0 < 0xE0 { // 2-byte UTF-8 return t.lookupValue(uint32(i), s[1]) } i = bidiIndex[uint32(i)<<6+uint32(s[1])] if c0 < 0xF0 { // 3-byte UTF-8 return t.lookupValue(uint32(i), s[2]) } i = bidiIndex[uint32(i)<<6+uint32(s[2])] if c0 < 0xF8 { // 4-byte UTF-8 return t.lookupValue(uint32(i), s[3]) } return 0 } // bidiTrie. Total size: 19904 bytes (19.44 KiB). Checksum: b1f201ed2debb6c8. type bidiTrie struct{} func newBidiTrie(i int) *bidiTrie { return &bidiTrie{} } // lookupValue determines the type of block n and looks up the value for b. func (t *bidiTrie) lookupValue(n uint32, b byte) uint8 { switch { default: return uint8(bidiValues[n<<6+uint32(b)]) } } // bidiValues: 259 blocks, 16576 entries, 16576 bytes // The third block is the zero block. var bidiValues = [16576]uint8{ // Block 0x0, offset 0x0 0x00: 0x000b, 0x01: 0x000b, 0x02: 0x000b, 0x03: 0x000b, 0x04: 0x000b, 0x05: 0x000b, 0x06: 0x000b, 0x07: 0x000b, 0x08: 0x000b, 0x09: 0x0008, 0x0a: 0x0007, 0x0b: 0x0008, 0x0c: 0x0009, 0x0d: 0x0007, 0x0e: 0x000b, 0x0f: 0x000b, 0x10: 0x000b, 0x11: 0x000b, 0x12: 0x000b, 0x13: 0x000b, 0x14: 0x000b, 0x15: 0x000b, 0x16: 0x000b, 0x17: 0x000b, 0x18: 0x000b, 0x19: 0x000b, 0x1a: 0x000b, 0x1b: 0x000b, 0x1c: 0x0007, 0x1d: 0x0007, 0x1e: 0x0007, 0x1f: 0x0008, 0x20: 0x0009, 0x21: 0x000a, 0x22: 0x000a, 0x23: 0x0004, 0x24: 0x0004, 0x25: 0x0004, 0x26: 0x000a, 0x27: 0x000a, 0x28: 0x003a, 0x29: 0x002a, 0x2a: 0x000a, 0x2b: 0x0003, 0x2c: 0x0006, 0x2d: 0x0003, 0x2e: 0x0006, 0x2f: 0x0006, 0x30: 0x0002, 0x31: 0x0002, 0x32: 0x0002, 0x33: 0x0002, 0x34: 0x0002, 0x35: 0x0002, 0x36: 0x0002, 0x37: 0x0002, 0x38: 0x0002, 0x39: 0x0002, 0x3a: 0x0006, 0x3b: 0x000a, 0x3c: 0x000a, 0x3d: 0x000a, 0x3e: 0x000a, 0x3f: 0x000a, // Block 0x1, offset 0x40 0x40: 0x000a, 0x5b: 0x005a, 0x5c: 0x000a, 0x5d: 0x004a, 0x5e: 0x000a, 0x5f: 0x000a, 0x60: 0x000a, 0x7b: 0x005a, 0x7c: 0x000a, 0x7d: 0x004a, 0x7e: 0x000a, 0x7f: 0x000b, // Block 0x2, offset 0x80 // Block 0x3, offset 0xc0 0xc0: 0x000b, 0xc1: 0x000b, 0xc2: 0x000b, 0xc3: 0x000b, 0xc4: 0x000b, 0xc5: 0x0007, 0xc6: 0x000b, 0xc7: 0x000b, 0xc8: 0x000b, 0xc9: 0x000b, 0xca: 0x000b, 0xcb: 0x000b, 0xcc: 0x000b, 0xcd: 0x000b, 0xce: 0x000b, 0xcf: 0x000b, 0xd0: 0x000b, 0xd1: 0x000b, 0xd2: 0x000b, 0xd3: 0x000b, 0xd4: 0x000b, 0xd5: 0x000b, 0xd6: 0x000b, 0xd7: 0x000b, 0xd8: 0x000b, 0xd9: 0x000b, 0xda: 0x000b, 0xdb: 0x000b, 0xdc: 0x000b, 0xdd: 0x000b, 0xde: 0x000b, 0xdf: 0x000b, 0xe0: 0x0006, 0xe1: 0x000a, 0xe2: 0x0004, 0xe3: 0x0004, 0xe4: 0x0004, 0xe5: 0x0004, 0xe6: 0x000a, 0xe7: 0x000a, 0xe8: 0x000a, 0xe9: 0x000a, 0xeb: 0x000a, 0xec: 0x000a, 0xed: 0x000b, 0xee: 0x000a, 0xef: 0x000a, 0xf0: 0x0004, 0xf1: 0x0004, 0xf2: 0x0002, 0xf3: 0x0002, 0xf4: 0x000a, 0xf6: 0x000a, 0xf7: 0x000a, 0xf8: 0x000a, 0xf9: 0x0002, 0xfb: 0x000a, 0xfc: 0x000a, 0xfd: 0x000a, 0xfe: 0x000a, 0xff: 0x000a, // Block 0x4, offset 0x100 0x117: 0x000a, 0x137: 0x000a, // Block 0x5, offset 0x140 0x179: 0x000a, 0x17a: 0x000a, // Block 0x6, offset 0x180 0x182: 0x000a, 0x183: 0x000a, 0x184: 0x000a, 0x185: 0x000a, 0x186: 0x000a, 0x187: 0x000a, 0x188: 0x000a, 0x189: 0x000a, 0x18a: 0x000a, 0x18b: 0x000a, 0x18c: 0x000a, 0x18d: 0x000a, 0x18e: 0x000a, 0x18f: 0x000a, 0x192: 0x000a, 0x193: 0x000a, 0x194: 0x000a, 0x195: 0x000a, 0x196: 0x000a, 0x197: 0x000a, 0x198: 0x000a, 0x199: 0x000a, 0x19a: 0x000a, 0x19b: 0x000a, 0x19c: 0x000a, 0x19d: 0x000a, 0x19e: 0x000a, 0x19f: 0x000a, 0x1a5: 0x000a, 0x1a6: 0x000a, 0x1a7: 0x000a, 0x1a8: 0x000a, 0x1a9: 0x000a, 0x1aa: 0x000a, 0x1ab: 0x000a, 0x1ac: 0x000a, 0x1ad: 0x000a, 0x1af: 0x000a, 0x1b0: 0x000a, 0x1b1: 0x000a, 0x1b2: 0x000a, 0x1b3: 0x000a, 0x1b4: 0x000a, 0x1b5: 0x000a, 0x1b6: 0x000a, 0x1b7: 0x000a, 0x1b8: 0x000a, 0x1b9: 0x000a, 0x1ba: 0x000a, 0x1bb: 0x000a, 0x1bc: 0x000a, 0x1bd: 0x000a, 0x1be: 0x000a, 0x1bf: 0x000a, // Block 0x7, offset 0x1c0 0x1c0: 0x000c, 0x1c1: 0x000c, 0x1c2: 0x000c, 0x1c3: 0x000c, 0x1c4: 0x000c, 0x1c5: 0x000c, 0x1c6: 0x000c, 0x1c7: 0x000c, 0x1c8: 0x000c, 0x1c9: 0x000c, 0x1ca: 0x000c, 0x1cb: 0x000c, 0x1cc: 0x000c, 0x1cd: 0x000c, 0x1ce: 0x000c, 0x1cf: 0x000c, 0x1d0: 0x000c, 0x1d1: 0x000c, 0x1d2: 0x000c, 0x1d3: 0x000c, 0x1d4: 0x000c, 0x1d5: 0x000c, 0x1d6: 0x000c, 0x1d7: 0x000c, 0x1d8: 0x000c, 0x1d9: 0x000c, 0x1da: 0x000c, 0x1db: 0x000c, 0x1dc: 0x000c, 0x1dd: 0x000c, 0x1de: 0x000c, 0x1df: 0x000c, 0x1e0: 0x000c, 0x1e1: 0x000c, 0x1e2: 0x000c, 0x1e3: 0x000c, 0x1e4: 0x000c, 0x1e5: 0x000c, 0x1e6: 0x000c, 0x1e7: 0x000c, 0x1e8: 0x000c, 0x1e9: 0x000c, 0x1ea: 0x000c, 0x1eb: 0x000c, 0x1ec: 0x000c, 0x1ed: 0x000c, 0x1ee: 0x000c, 0x1ef: 0x000c, 0x1f0: 0x000c, 0x1f1: 0x000c, 0x1f2: 0x000c, 0x1f3: 0x000c, 0x1f4: 0x000c, 0x1f5: 0x000c, 0x1f6: 0x000c, 0x1f7: 0x000c, 0x1f8: 0x000c, 0x1f9: 0x000c, 0x1fa: 0x000c, 0x1fb: 0x000c, 0x1fc: 0x000c, 0x1fd: 0x000c, 0x1fe: 0x000c, 0x1ff: 0x000c, // Block 0x8, offset 0x200 0x200: 0x000c, 0x201: 0x000c, 0x202: 0x000c, 0x203: 0x000c, 0x204: 0x000c, 0x205: 0x000c, 0x206: 0x000c, 0x207: 0x000c, 0x208: 0x000c, 0x209: 0x000c, 0x20a: 0x000c, 0x20b: 0x000c, 0x20c: 0x000c, 0x20d: 0x000c, 0x20e: 0x000c, 0x20f: 0x000c, 0x210: 0x000c, 0x211: 0x000c, 0x212: 0x000c, 0x213: 0x000c, 0x214: 0x000c, 0x215: 0x000c, 0x216: 0x000c, 0x217: 0x000c, 0x218: 0x000c, 0x219: 0x000c, 0x21a: 0x000c, 0x21b: 0x000c, 0x21c: 0x000c, 0x21d: 0x000c, 0x21e: 0x000c, 0x21f: 0x000c, 0x220: 0x000c, 0x221: 0x000c, 0x222: 0x000c, 0x223: 0x000c, 0x224: 0x000c, 0x225: 0x000c, 0x226: 0x000c, 0x227: 0x000c, 0x228: 0x000c, 0x229: 0x000c, 0x22a: 0x000c, 0x22b: 0x000c, 0x22c: 0x000c, 0x22d: 0x000c, 0x22e: 0x000c, 0x22f: 0x000c, 0x234: 0x000a, 0x235: 0x000a, 0x23e: 0x000a, // Block 0x9, offset 0x240 0x244: 0x000a, 0x245: 0x000a, 0x247: 0x000a, // Block 0xa, offset 0x280 0x2b6: 0x000a, // Block 0xb, offset 0x2c0 0x2c3: 0x000c, 0x2c4: 0x000c, 0x2c5: 0x000c, 0x2c6: 0x000c, 0x2c7: 0x000c, 0x2c8: 0x000c, 0x2c9: 0x000c, // Block 0xc, offset 0x300 0x30a: 0x000a, 0x30d: 0x000a, 0x30e: 0x000a, 0x30f: 0x0004, 0x310: 0x0001, 0x311: 0x000c, 0x312: 0x000c, 0x313: 0x000c, 0x314: 0x000c, 0x315: 0x000c, 0x316: 0x000c, 0x317: 0x000c, 0x318: 0x000c, 0x319: 0x000c, 0x31a: 0x000c, 0x31b: 0x000c, 0x31c: 0x000c, 0x31d: 0x000c, 0x31e: 0x000c, 0x31f: 0x000c, 0x320: 0x000c, 0x321: 0x000c, 0x322: 0x000c, 0x323: 0x000c, 0x324: 0x000c, 0x325: 0x000c, 0x326: 0x000c, 0x327: 0x000c, 0x328: 0x000c, 0x329: 0x000c, 0x32a: 0x000c, 0x32b: 0x000c, 0x32c: 0x000c, 0x32d: 0x000c, 0x32e: 0x000c, 0x32f: 0x000c, 0x330: 0x000c, 0x331: 0x000c, 0x332: 0x000c, 0x333: 0x000c, 0x334: 0x000c, 0x335: 0x000c, 0x336: 0x000c, 0x337: 0x000c, 0x338: 0x000c, 0x339: 0x000c, 0x33a: 0x000c, 0x33b: 0x000c, 0x33c: 0x000c, 0x33d: 0x000c, 0x33e: 0x0001, 0x33f: 0x000c, // Block 0xd, offset 0x340 0x340: 0x0001, 0x341: 0x000c, 0x342: 0x000c, 0x343: 0x0001, 0x344: 0x000c, 0x345: 0x000c, 0x346: 0x0001, 0x347: 0x000c, 0x348: 0x0001, 0x349: 0x0001, 0x34a: 0x0001, 0x34b: 0x0001, 0x34c: 0x0001, 0x34d: 0x0001, 0x34e: 0x0001, 0x34f: 0x0001, 0x350: 0x0001, 0x351: 0x0001, 0x352: 0x0001, 0x353: 0x0001, 0x354: 0x0001, 0x355: 0x0001, 0x356: 0x0001, 0x357: 0x0001, 0x358: 0x0001, 0x359: 0x0001, 0x35a: 0x0001, 0x35b: 0x0001, 0x35c: 0x0001, 0x35d: 0x0001, 0x35e: 0x0001, 0x35f: 0x0001, 0x360: 0x0001, 0x361: 0x0001, 0x362: 0x0001, 0x363: 0x0001, 0x364: 0x0001, 0x365: 0x0001, 0x366: 0x0001, 0x367: 0x0001, 0x368: 0x0001, 0x369: 0x0001, 0x36a: 0x0001, 0x36b: 0x0001, 0x36c: 0x0001, 0x36d: 0x0001, 0x36e: 0x0001, 0x36f: 0x0001, 0x370: 0x0001, 0x371: 0x0001, 0x372: 0x0001, 0x373: 0x0001, 0x374: 0x0001, 0x375: 0x0001, 0x376: 0x0001, 0x377: 0x0001, 0x378: 0x0001, 0x379: 0x0001, 0x37a: 0x0001, 0x37b: 0x0001, 0x37c: 0x0001, 0x37d: 0x0001, 0x37e: 0x0001, 0x37f: 0x0001, // Block 0xe, offset 0x380 0x380: 0x0005, 0x381: 0x0005, 0x382: 0x0005, 0x383: 0x0005, 0x384: 0x0005, 0x385: 0x0005, 0x386: 0x000a, 0x387: 0x000a, 0x388: 0x000d, 0x389: 0x0004, 0x38a: 0x0004, 0x38b: 0x000d, 0x38c: 0x0006, 0x38d: 0x000d, 0x38e: 0x000a, 0x38f: 0x000a, 0x390: 0x000c, 0x391: 0x000c, 0x392: 0x000c, 0x393: 0x000c, 0x394: 0x000c, 0x395: 0x000c, 0x396: 0x000c, 0x397: 0x000c, 0x398: 0x000c, 0x399: 0x000c, 0x39a: 0x000c, 0x39b: 0x000d, 0x39c: 0x000d, 0x39d: 0x000d, 0x39e: 0x000d, 0x39f: 0x000d, 0x3a0: 0x000d, 0x3a1: 0x000d, 0x3a2: 0x000d, 0x3a3: 0x000d, 0x3a4: 0x000d, 0x3a5: 0x000d, 0x3a6: 0x000d, 0x3a7: 0x000d, 0x3a8: 0x000d, 0x3a9: 0x000d, 0x3aa: 0x000d, 0x3ab: 0x000d, 0x3ac: 0x000d, 0x3ad: 0x000d, 0x3ae: 0x000d, 0x3af: 0x000d, 0x3b0: 0x000d, 0x3b1: 0x000d, 0x3b2: 0x000d, 0x3b3: 0x000d, 0x3b4: 0x000d, 0x3b5: 0x000d, 0x3b6: 0x000d, 0x3b7: 0x000d, 0x3b8: 0x000d, 0x3b9: 0x000d, 0x3ba: 0x000d, 0x3bb: 0x000d, 0x3bc: 0x000d, 0x3bd: 0x000d, 0x3be: 0x000d, 0x3bf: 0x000d, // Block 0xf, offset 0x3c0 0x3c0: 0x000d, 0x3c1: 0x000d, 0x3c2: 0x000d, 0x3c3: 0x000d, 0x3c4: 0x000d, 0x3c5: 0x000d, 0x3c6: 0x000d, 0x3c7: 0x000d, 0x3c8: 0x000d, 0x3c9: 0x000d, 0x3ca: 0x000d, 0x3cb: 0x000c, 0x3cc: 0x000c, 0x3cd: 0x000c, 0x3ce: 0x000c, 0x3cf: 0x000c, 0x3d0: 0x000c, 0x3d1: 0x000c, 0x3d2: 0x000c, 0x3d3: 0x000c, 0x3d4: 0x000c, 0x3d5: 0x000c, 0x3d6: 0x000c, 0x3d7: 0x000c, 0x3d8: 0x000c, 0x3d9: 0x000c, 0x3da: 0x000c, 0x3db: 0x000c, 0x3dc: 0x000c, 0x3dd: 0x000c, 0x3de: 0x000c, 0x3df: 0x000c, 0x3e0: 0x0005, 0x3e1: 0x0005, 0x3e2: 0x0005, 0x3e3: 0x0005, 0x3e4: 0x0005, 0x3e5: 0x0005, 0x3e6: 0x0005, 0x3e7: 0x0005, 0x3e8: 0x0005, 0x3e9: 0x0005, 0x3ea: 0x0004, 0x3eb: 0x0005, 0x3ec: 0x0005, 0x3ed: 0x000d, 0x3ee: 0x000d, 0x3ef: 0x000d, 0x3f0: 0x000c, 0x3f1: 0x000d, 0x3f2: 0x000d, 0x3f3: 0x000d, 0x3f4: 0x000d, 0x3f5: 0x000d, 0x3f6: 0x000d, 0x3f7: 0x000d, 0x3f8: 0x000d, 0x3f9: 0x000d, 0x3fa: 0x000d, 0x3fb: 0x000d, 0x3fc: 0x000d, 0x3fd: 0x000d, 0x3fe: 0x000d, 0x3ff: 0x000d, // Block 0x10, offset 0x400 0x400: 0x000d, 0x401: 0x000d, 0x402: 0x000d, 0x403: 0x000d, 0x404: 0x000d, 0x405: 0x000d, 0x406: 0x000d, 0x407: 0x000d, 0x408: 0x000d, 0x409: 0x000d, 0x40a: 0x000d, 0x40b: 0x000d, 0x40c: 0x000d, 0x40d: 0x000d, 0x40e: 0x000d, 0x40f: 0x000d, 0x410: 0x000d, 0x411: 0x000d, 0x412: 0x000d, 0x413: 0x000d, 0x414: 0x000d, 0x415: 0x000d, 0x416: 0x000d, 0x417: 0x000d, 0x418: 0x000d, 0x419: 0x000d, 0x41a: 0x000d, 0x41b: 0x000d, 0x41c: 0x000d, 0x41d: 0x000d, 0x41e: 0x000d, 0x41f: 0x000d, 0x420: 0x000d, 0x421: 0x000d, 0x422: 0x000d, 0x423: 0x000d, 0x424: 0x000d, 0x425: 0x000d, 0x426: 0x000d, 0x427: 0x000d, 0x428: 0x000d, 0x429: 0x000d, 0x42a: 0x000d, 0x42b: 0x000d, 0x42c: 0x000d, 0x42d: 0x000d, 0x42e: 0x000d, 0x42f: 0x000d, 0x430: 0x000d, 0x431: 0x000d, 0x432: 0x000d, 0x433: 0x000d, 0x434: 0x000d, 0x435: 0x000d, 0x436: 0x000d, 0x437: 0x000d, 0x438: 0x000d, 0x439: 0x000d, 0x43a: 0x000d, 0x43b: 0x000d, 0x43c: 0x000d, 0x43d: 0x000d, 0x43e: 0x000d, 0x43f: 0x000d, // Block 0x11, offset 0x440 0x440: 0x000d, 0x441: 0x000d, 0x442: 0x000d, 0x443: 0x000d, 0x444: 0x000d, 0x445: 0x000d, 0x446: 0x000d, 0x447: 0x000d, 0x448: 0x000d, 0x449: 0x000d, 0x44a: 0x000d, 0x44b: 0x000d, 0x44c: 0x000d, 0x44d: 0x000d, 0x44e: 0x000d, 0x44f: 0x000d, 0x450: 0x000d, 0x451: 0x000d, 0x452: 0x000d, 0x453: 0x000d, 0x454: 0x000d, 0x455: 0x000d, 0x456: 0x000c, 0x457: 0x000c, 0x458: 0x000c, 0x459: 0x000c, 0x45a: 0x000c, 0x45b: 0x000c, 0x45c: 0x000c, 0x45d: 0x0005, 0x45e: 0x000a, 0x45f: 0x000c, 0x460: 0x000c, 0x461: 0x000c, 0x462: 0x000c, 0x463: 0x000c, 0x464: 0x000c, 0x465: 0x000d, 0x466: 0x000d, 0x467: 0x000c, 0x468: 0x000c, 0x469: 0x000a, 0x46a: 0x000c, 0x46b: 0x000c, 0x46c: 0x000c, 0x46d: 0x000c, 0x46e: 0x000d, 0x46f: 0x000d, 0x470: 0x0002, 0x471: 0x0002, 0x472: 0x0002, 0x473: 0x0002, 0x474: 0x0002, 0x475: 0x0002, 0x476: 0x0002, 0x477: 0x0002, 0x478: 0x0002, 0x479: 0x0002, 0x47a: 0x000d, 0x47b: 0x000d, 0x47c: 0x000d, 0x47d: 0x000d, 0x47e: 0x000d, 0x47f: 0x000d, // Block 0x12, offset 0x480 0x480: 0x000d, 0x481: 0x000d, 0x482: 0x000d, 0x483: 0x000d, 0x484: 0x000d, 0x485: 0x000d, 0x486: 0x000d, 0x487: 0x000d, 0x488: 0x000d, 0x489: 0x000d, 0x48a: 0x000d, 0x48b: 0x000d, 0x48c: 0x000d, 0x48d: 0x000d, 0x48e: 0x000d, 0x48f: 0x000d, 0x490: 0x000d, 0x491: 0x000c, 0x492: 0x000d, 0x493: 0x000d, 0x494: 0x000d, 0x495: 0x000d, 0x496: 0x000d, 0x497: 0x000d, 0x498: 0x000d, 0x499: 0x000d, 0x49a: 0x000d, 0x49b: 0x000d, 0x49c: 0x000d, 0x49d: 0x000d, 0x49e: 0x000d, 0x49f: 0x000d, 0x4a0: 0x000d, 0x4a1: 0x000d, 0x4a2: 0x000d, 0x4a3: 0x000d, 0x4a4: 0x000d, 0x4a5: 0x000d, 0x4a6: 0x000d, 0x4a7: 0x000d, 0x4a8: 0x000d, 0x4a9: 0x000d, 0x4aa: 0x000d, 0x4ab: 0x000d, 0x4ac: 0x000d, 0x4ad: 0x000d, 0x4ae: 0x000d, 0x4af: 0x000d, 0x4b0: 0x000c, 0x4b1: 0x000c, 0x4b2: 0x000c, 0x4b3: 0x000c, 0x4b4: 0x000c, 0x4b5: 0x000c, 0x4b6: 0x000c, 0x4b7: 0x000c, 0x4b8: 0x000c, 0x4b9: 0x000c, 0x4ba: 0x000c, 0x4bb: 0x000c, 0x4bc: 0x000c, 0x4bd: 0x000c, 0x4be: 0x000c, 0x4bf: 0x000c, // Block 0x13, offset 0x4c0 0x4c0: 0x000c, 0x4c1: 0x000c, 0x4c2: 0x000c, 0x4c3: 0x000c, 0x4c4: 0x000c, 0x4c5: 0x000c, 0x4c6: 0x000c, 0x4c7: 0x000c, 0x4c8: 0x000c, 0x4c9: 0x000c, 0x4ca: 0x000c, 0x4cb: 0x000d, 0x4cc: 0x000d, 0x4cd: 0x000d, 0x4ce: 0x000d, 0x4cf: 0x000d, 0x4d0: 0x000d, 0x4d1: 0x000d, 0x4d2: 0x000d, 0x4d3: 0x000d, 0x4d4: 0x000d, 0x4d5: 0x000d, 0x4d6: 0x000d, 0x4d7: 0x000d, 0x4d8: 0x000d, 0x4d9: 0x000d, 0x4da: 0x000d, 0x4db: 0x000d, 0x4dc: 0x000d, 0x4dd: 0x000d, 0x4de: 0x000d, 0x4df: 0x000d, 0x4e0: 0x000d, 0x4e1: 0x000d, 0x4e2: 0x000d, 0x4e3: 0x000d, 0x4e4: 0x000d, 0x4e5: 0x000d, 0x4e6: 0x000d, 0x4e7: 0x000d, 0x4e8: 0x000d, 0x4e9: 0x000d, 0x4ea: 0x000d, 0x4eb: 0x000d, 0x4ec: 0x000d, 0x4ed: 0x000d, 0x4ee: 0x000d, 0x4ef: 0x000d, 0x4f0: 0x000d, 0x4f1: 0x000d, 0x4f2: 0x000d, 0x4f3: 0x000d, 0x4f4: 0x000d, 0x4f5: 0x000d, 0x4f6: 0x000d, 0x4f7: 0x000d, 0x4f8: 0x000d, 0x4f9: 0x000d, 0x4fa: 0x000d, 0x4fb: 0x000d, 0x4fc: 0x000d, 0x4fd: 0x000d, 0x4fe: 0x000d, 0x4ff: 0x000d, // Block 0x14, offset 0x500 0x500: 0x000d, 0x501: 0x000d, 0x502: 0x000d, 0x503: 0x000d, 0x504: 0x000d, 0x505: 0x000d, 0x506: 0x000d, 0x507: 0x000d, 0x508: 0x000d, 0x509: 0x000d, 0x50a: 0x000d, 0x50b: 0x000d, 0x50c: 0x000d, 0x50d: 0x000d, 0x50e: 0x000d, 0x50f: 0x000d, 0x510: 0x000d, 0x511: 0x000d, 0x512: 0x000d, 0x513: 0x000d, 0x514: 0x000d, 0x515: 0x000d, 0x516: 0x000d, 0x517: 0x000d, 0x518: 0x000d, 0x519: 0x000d, 0x51a: 0x000d, 0x51b: 0x000d, 0x51c: 0x000d, 0x51d: 0x000d, 0x51e: 0x000d, 0x51f: 0x000d, 0x520: 0x000d, 0x521: 0x000d, 0x522: 0x000d, 0x523: 0x000d, 0x524: 0x000d, 0x525: 0x000d, 0x526: 0x000c, 0x527: 0x000c, 0x528: 0x000c, 0x529: 0x000c, 0x52a: 0x000c, 0x52b: 0x000c, 0x52c: 0x000c, 0x52d: 0x000c, 0x52e: 0x000c, 0x52f: 0x000c, 0x530: 0x000c, 0x531: 0x000d, 0x532: 0x000d, 0x533: 0x000d, 0x534: 0x000d, 0x535: 0x000d, 0x536: 0x000d, 0x537: 0x000d, 0x538: 0x000d, 0x539: 0x000d, 0x53a: 0x000d, 0x53b: 0x000d, 0x53c: 0x000d, 0x53d: 0x000d, 0x53e: 0x000d, 0x53f: 0x000d, // Block 0x15, offset 0x540 0x540: 0x0001, 0x541: 0x0001, 0x542: 0x0001, 0x543: 0x0001, 0x544: 0x0001, 0x545: 0x0001, 0x546: 0x0001, 0x547: 0x0001, 0x548: 0x0001, 0x549: 0x0001, 0x54a: 0x0001, 0x54b: 0x0001, 0x54c: 0x0001, 0x54d: 0x0001, 0x54e: 0x0001, 0x54f: 0x0001, 0x550: 0x0001, 0x551: 0x0001, 0x552: 0x0001, 0x553: 0x0001, 0x554: 0x0001, 0x555: 0x0001, 0x556: 0x0001, 0x557: 0x0001, 0x558: 0x0001, 0x559: 0x0001, 0x55a: 0x0001, 0x55b: 0x0001, 0x55c: 0x0001, 0x55d: 0x0001, 0x55e: 0x0001, 0x55f: 0x0001, 0x560: 0x0001, 0x561: 0x0001, 0x562: 0x0001, 0x563: 0x0001, 0x564: 0x0001, 0x565: 0x0001, 0x566: 0x0001, 0x567: 0x0001, 0x568: 0x0001, 0x569: 0x0001, 0x56a: 0x0001, 0x56b: 0x000c, 0x56c: 0x000c, 0x56d: 0x000c, 0x56e: 0x000c, 0x56f: 0x000c, 0x570: 0x000c, 0x571: 0x000c, 0x572: 0x000c, 0x573: 0x000c, 0x574: 0x0001, 0x575: 0x0001, 0x576: 0x000a, 0x577: 0x000a, 0x578: 0x000a, 0x579: 0x000a, 0x57a: 0x0001, 0x57b: 0x0001, 0x57c: 0x0001, 0x57d: 0x000c, 0x57e: 0x0001, 0x57f: 0x0001, // Block 0x16, offset 0x580 0x580: 0x0001, 0x581: 0x0001, 0x582: 0x0001, 0x583: 0x0001, 0x584: 0x0001, 0x585: 0x0001, 0x586: 0x0001, 0x587: 0x0001, 0x588: 0x0001, 0x589: 0x0001, 0x58a: 0x0001, 0x58b: 0x0001, 0x58c: 0x0001, 0x58d: 0x0001, 0x58e: 0x0001, 0x58f: 0x0001, 0x590: 0x0001, 0x591: 0x0001, 0x592: 0x0001, 0x593: 0x0001, 0x594: 0x0001, 0x595: 0x0001, 0x596: 0x000c, 0x597: 0x000c, 0x598: 0x000c, 0x599: 0x000c, 0x59a: 0x0001, 0x59b: 0x000c, 0x59c: 0x000c, 0x59d: 0x000c, 0x59e: 0x000c, 0x59f: 0x000c, 0x5a0: 0x000c, 0x5a1: 0x000c, 0x5a2: 0x000c, 0x5a3: 0x000c, 0x5a4: 0x0001, 0x5a5: 0x000c, 0x5a6: 0x000c, 0x5a7: 0x000c, 0x5a8: 0x0001, 0x5a9: 0x000c, 0x5aa: 0x000c, 0x5ab: 0x000c, 0x5ac: 0x000c, 0x5ad: 0x000c, 0x5ae: 0x0001, 0x5af: 0x0001, 0x5b0: 0x0001, 0x5b1: 0x0001, 0x5b2: 0x0001, 0x5b3: 0x0001, 0x5b4: 0x0001, 0x5b5: 0x0001, 0x5b6: 0x0001, 0x5b7: 0x0001, 0x5b8: 0x0001, 0x5b9: 0x0001, 0x5ba: 0x0001, 0x5bb: 0x0001, 0x5bc: 0x0001, 0x5bd: 0x0001, 0x5be: 0x0001, 0x5bf: 0x0001, // Block 0x17, offset 0x5c0 0x5c0: 0x0001, 0x5c1: 0x0001, 0x5c2: 0x0001, 0x5c3: 0x0001, 0x5c4: 0x0001, 0x5c5: 0x0001, 0x5c6: 0x0001, 0x5c7: 0x0001, 0x5c8: 0x0001, 0x5c9: 0x0001, 0x5ca: 0x0001, 0x5cb: 0x0001, 0x5cc: 0x0001, 0x5cd: 0x0001, 0x5ce: 0x0001, 0x5cf: 0x0001, 0x5d0: 0x0001, 0x5d1: 0x0001, 0x5d2: 0x0001, 0x5d3: 0x0001, 0x5d4: 0x0001, 0x5d5: 0x0001, 0x5d6: 0x0001, 0x5d7: 0x0001, 0x5d8: 0x0001, 0x5d9: 0x000c, 0x5da: 0x000c, 0x5db: 0x000c, 0x5dc: 0x0001, 0x5dd: 0x0001, 0x5de: 0x0001, 0x5df: 0x0001, 0x5e0: 0x000d, 0x5e1: 0x000d, 0x5e2: 0x000d, 0x5e3: 0x000d, 0x5e4: 0x000d, 0x5e5: 0x000d, 0x5e6: 0x000d, 0x5e7: 0x000d, 0x5e8: 0x000d, 0x5e9: 0x000d, 0x5ea: 0x000d, 0x5eb: 0x0001, 0x5ec: 0x0001, 0x5ed: 0x0001, 0x5ee: 0x0001, 0x5ef: 0x0001, 0x5f0: 0x000d, 0x5f1: 0x000d, 0x5f2: 0x000d, 0x5f3: 0x000d, 0x5f4: 0x000d, 0x5f5: 0x000d, 0x5f6: 0x000d, 0x5f7: 0x000d, 0x5f8: 0x000d, 0x5f9: 0x000d, 0x5fa: 0x000d, 0x5fb: 0x000d, 0x5fc: 0x000d, 0x5fd: 0x000d, 0x5fe: 0x000d, 0x5ff: 0x000d, // Block 0x18, offset 0x600 0x600: 0x000d, 0x601: 0x000d, 0x602: 0x000d, 0x603: 0x000d, 0x604: 0x000d, 0x605: 0x000d, 0x606: 0x000d, 0x607: 0x000d, 0x608: 0x000d, 0x609: 0x000d, 0x60a: 0x000d, 0x60b: 0x000d, 0x60c: 0x000d, 0x60d: 0x000d, 0x60e: 0x000d, 0x60f: 0x0001, 0x610: 0x0005, 0x611: 0x0005, 0x612: 0x0001, 0x613: 0x0001, 0x614: 0x0001, 0x615: 0x0001, 0x616: 0x0001, 0x617: 0x0001, 0x618: 0x000c, 0x619: 0x000c, 0x61a: 0x000c, 0x61b: 0x000c, 0x61c: 0x000c, 0x61d: 0x000c, 0x61e: 0x000c, 0x61f: 0x000c, 0x620: 0x000d, 0x621: 0x000d, 0x622: 0x000d, 0x623: 0x000d, 0x624: 0x000d, 0x625: 0x000d, 0x626: 0x000d, 0x627: 0x000d, 0x628: 0x000d, 0x629: 0x000d, 0x62a: 0x000d, 0x62b: 0x000d, 0x62c: 0x000d, 0x62d: 0x000d, 0x62e: 0x000d, 0x62f: 0x000d, 0x630: 0x000d, 0x631: 0x000d, 0x632: 0x000d, 0x633: 0x000d, 0x634: 0x000d, 0x635: 0x000d, 0x636: 0x000d, 0x637: 0x000d, 0x638: 0x000d, 0x639: 0x000d, 0x63a: 0x000d, 0x63b: 0x000d, 0x63c: 0x000d, 0x63d: 0x000d, 0x63e: 0x000d, 0x63f: 0x000d, // Block 0x19, offset 0x640 0x640: 0x000d, 0x641: 0x000d, 0x642: 0x000d, 0x643: 0x000d, 0x644: 0x000d, 0x645: 0x000d, 0x646: 0x000d, 0x647: 0x000d, 0x648: 0x000d, 0x649: 0x000d, 0x64a: 0x000c, 0x64b: 0x000c, 0x64c: 0x000c, 0x64d: 0x000c, 0x64e: 0x000c, 0x64f: 0x000c, 0x650: 0x000c, 0x651: 0x000c, 0x652: 0x000c, 0x653: 0x000c, 0x654: 0x000c, 0x655: 0x000c, 0x656: 0x000c, 0x657: 0x000c, 0x658: 0x000c, 0x659: 0x000c, 0x65a: 0x000c, 0x65b: 0x000c, 0x65c: 0x000c, 0x65d: 0x000c, 0x65e: 0x000c, 0x65f: 0x000c, 0x660: 0x000c, 0x661: 0x000c, 0x662: 0x0005, 0x663: 0x000c, 0x664: 0x000c, 0x665: 0x000c, 0x666: 0x000c, 0x667: 0x000c, 0x668: 0x000c, 0x669: 0x000c, 0x66a: 0x000c, 0x66b: 0x000c, 0x66c: 0x000c, 0x66d: 0x000c, 0x66e: 0x000c, 0x66f: 0x000c, 0x670: 0x000c, 0x671: 0x000c, 0x672: 0x000c, 0x673: 0x000c, 0x674: 0x000c, 0x675: 0x000c, 0x676: 0x000c, 0x677: 0x000c, 0x678: 0x000c, 0x679: 0x000c, 0x67a: 0x000c, 0x67b: 0x000c, 0x67c: 0x000c, 0x67d: 0x000c, 0x67e: 0x000c, 0x67f: 0x000c, // Block 0x1a, offset 0x680 0x680: 0x000c, 0x681: 0x000c, 0x682: 0x000c, 0x6ba: 0x000c, 0x6bc: 0x000c, // Block 0x1b, offset 0x6c0 0x6c1: 0x000c, 0x6c2: 0x000c, 0x6c3: 0x000c, 0x6c4: 0x000c, 0x6c5: 0x000c, 0x6c6: 0x000c, 0x6c7: 0x000c, 0x6c8: 0x000c, 0x6cd: 0x000c, 0x6d1: 0x000c, 0x6d2: 0x000c, 0x6d3: 0x000c, 0x6d4: 0x000c, 0x6d5: 0x000c, 0x6d6: 0x000c, 0x6d7: 0x000c, 0x6e2: 0x000c, 0x6e3: 0x000c, // Block 0x1c, offset 0x700 0x701: 0x000c, 0x73c: 0x000c, // Block 0x1d, offset 0x740 0x741: 0x000c, 0x742: 0x000c, 0x743: 0x000c, 0x744: 0x000c, 0x74d: 0x000c, 0x762: 0x000c, 0x763: 0x000c, 0x772: 0x0004, 0x773: 0x0004, 0x77b: 0x0004, 0x77e: 0x000c, // Block 0x1e, offset 0x780 0x781: 0x000c, 0x782: 0x000c, 0x7bc: 0x000c, // Block 0x1f, offset 0x7c0 0x7c1: 0x000c, 0x7c2: 0x000c, 0x7c7: 0x000c, 0x7c8: 0x000c, 0x7cb: 0x000c, 0x7cc: 0x000c, 0x7cd: 0x000c, 0x7d1: 0x000c, 0x7f0: 0x000c, 0x7f1: 0x000c, 0x7f5: 0x000c, // Block 0x20, offset 0x800 0x801: 0x000c, 0x802: 0x000c, 0x803: 0x000c, 0x804: 0x000c, 0x805: 0x000c, 0x807: 0x000c, 0x808: 0x000c, 0x80d: 0x000c, 0x822: 0x000c, 0x823: 0x000c, 0x831: 0x0004, 0x83a: 0x000c, 0x83b: 0x000c, 0x83c: 0x000c, 0x83d: 0x000c, 0x83e: 0x000c, 0x83f: 0x000c, // Block 0x21, offset 0x840 0x841: 0x000c, 0x87c: 0x000c, 0x87f: 0x000c, // Block 0x22, offset 0x880 0x881: 0x000c, 0x882: 0x000c, 0x883: 0x000c, 0x884: 0x000c, 0x88d: 0x000c, 0x895: 0x000c, 0x896: 0x000c, 0x8a2: 0x000c, 0x8a3: 0x000c, // Block 0x23, offset 0x8c0 0x8c2: 0x000c, // Block 0x24, offset 0x900 0x900: 0x000c, 0x90d: 0x000c, 0x933: 0x000a, 0x934: 0x000a, 0x935: 0x000a, 0x936: 0x000a, 0x937: 0x000a, 0x938: 0x000a, 0x939: 0x0004, 0x93a: 0x000a, // Block 0x25, offset 0x940 0x940: 0x000c, 0x944: 0x000c, 0x97c: 0x000c, 0x97e: 0x000c, 0x97f: 0x000c, // Block 0x26, offset 0x980 0x980: 0x000c, 0x986: 0x000c, 0x987: 0x000c, 0x988: 0x000c, 0x98a: 0x000c, 0x98b: 0x000c, 0x98c: 0x000c, 0x98d: 0x000c, 0x995: 0x000c, 0x996: 0x000c, 0x9a2: 0x000c, 0x9a3: 0x000c, 0x9b8: 0x000a, 0x9b9: 0x000a, 0x9ba: 0x000a, 0x9bb: 0x000a, 0x9bc: 0x000a, 0x9bd: 0x000a, 0x9be: 0x000a, // Block 0x27, offset 0x9c0 0x9cc: 0x000c, 0x9cd: 0x000c, 0x9e2: 0x000c, 0x9e3: 0x000c, // Block 0x28, offset 0xa00 0xa00: 0x000c, 0xa01: 0x000c, 0xa3b: 0x000c, 0xa3c: 0x000c, // Block 0x29, offset 0xa40 0xa41: 0x000c, 0xa42: 0x000c, 0xa43: 0x000c, 0xa44: 0x000c, 0xa4d: 0x000c, 0xa62: 0x000c, 0xa63: 0x000c, // Block 0x2a, offset 0xa80 0xa81: 0x000c, // Block 0x2b, offset 0xac0 0xaca: 0x000c, 0xad2: 0x000c, 0xad3: 0x000c, 0xad4: 0x000c, 0xad6: 0x000c, // Block 0x2c, offset 0xb00 0xb31: 0x000c, 0xb34: 0x000c, 0xb35: 0x000c, 0xb36: 0x000c, 0xb37: 0x000c, 0xb38: 0x000c, 0xb39: 0x000c, 0xb3a: 0x000c, 0xb3f: 0x0004, // Block 0x2d, offset 0xb40 0xb47: 0x000c, 0xb48: 0x000c, 0xb49: 0x000c, 0xb4a: 0x000c, 0xb4b: 0x000c, 0xb4c: 0x000c, 0xb4d: 0x000c, 0xb4e: 0x000c, // Block 0x2e, offset 0xb80 0xbb1: 0x000c, 0xbb4: 0x000c, 0xbb5: 0x000c, 0xbb6: 0x000c, 0xbb7: 0x000c, 0xbb8: 0x000c, 0xbb9: 0x000c, 0xbba: 0x000c, 0xbbb: 0x000c, 0xbbc: 0x000c, // Block 0x2f, offset 0xbc0 0xbc8: 0x000c, 0xbc9: 0x000c, 0xbca: 0x000c, 0xbcb: 0x000c, 0xbcc: 0x000c, 0xbcd: 0x000c, 0xbce: 0x000c, // Block 0x30, offset 0xc00 0xc18: 0x000c, 0xc19: 0x000c, 0xc35: 0x000c, 0xc37: 0x000c, 0xc39: 0x000c, 0xc3a: 0x003a, 0xc3b: 0x002a, 0xc3c: 0x003a, 0xc3d: 0x002a, // Block 0x31, offset 0xc40 0xc71: 0x000c, 0xc72: 0x000c, 0xc73: 0x000c, 0xc74: 0x000c, 0xc75: 0x000c, 0xc76: 0x000c, 0xc77: 0x000c, 0xc78: 0x000c, 0xc79: 0x000c, 0xc7a: 0x000c, 0xc7b: 0x000c, 0xc7c: 0x000c, 0xc7d: 0x000c, 0xc7e: 0x000c, // Block 0x32, offset 0xc80 0xc80: 0x000c, 0xc81: 0x000c, 0xc82: 0x000c, 0xc83: 0x000c, 0xc84: 0x000c, 0xc86: 0x000c, 0xc87: 0x000c, 0xc8d: 0x000c, 0xc8e: 0x000c, 0xc8f: 0x000c, 0xc90: 0x000c, 0xc91: 0x000c, 0xc92: 0x000c, 0xc93: 0x000c, 0xc94: 0x000c, 0xc95: 0x000c, 0xc96: 0x000c, 0xc97: 0x000c, 0xc99: 0x000c, 0xc9a: 0x000c, 0xc9b: 0x000c, 0xc9c: 0x000c, 0xc9d: 0x000c, 0xc9e: 0x000c, 0xc9f: 0x000c, 0xca0: 0x000c, 0xca1: 0x000c, 0xca2: 0x000c, 0xca3: 0x000c, 0xca4: 0x000c, 0xca5: 0x000c, 0xca6: 0x000c, 0xca7: 0x000c, 0xca8: 0x000c, 0xca9: 0x000c, 0xcaa: 0x000c, 0xcab: 0x000c, 0xcac: 0x000c, 0xcad: 0x000c, 0xcae: 0x000c, 0xcaf: 0x000c, 0xcb0: 0x000c, 0xcb1: 0x000c, 0xcb2: 0x000c, 0xcb3: 0x000c, 0xcb4: 0x000c, 0xcb5: 0x000c, 0xcb6: 0x000c, 0xcb7: 0x000c, 0xcb8: 0x000c, 0xcb9: 0x000c, 0xcba: 0x000c, 0xcbb: 0x000c, 0xcbc: 0x000c, // Block 0x33, offset 0xcc0 0xcc6: 0x000c, // Block 0x34, offset 0xd00 0xd2d: 0x000c, 0xd2e: 0x000c, 0xd2f: 0x000c, 0xd30: 0x000c, 0xd32: 0x000c, 0xd33: 0x000c, 0xd34: 0x000c, 0xd35: 0x000c, 0xd36: 0x000c, 0xd37: 0x000c, 0xd39: 0x000c, 0xd3a: 0x000c, 0xd3d: 0x000c, 0xd3e: 0x000c, // Block 0x35, offset 0xd40 0xd58: 0x000c, 0xd59: 0x000c, 0xd5e: 0x000c, 0xd5f: 0x000c, 0xd60: 0x000c, 0xd71: 0x000c, 0xd72: 0x000c, 0xd73: 0x000c, 0xd74: 0x000c, // Block 0x36, offset 0xd80 0xd82: 0x000c, 0xd85: 0x000c, 0xd86: 0x000c, 0xd8d: 0x000c, 0xd9d: 0x000c, // Block 0x37, offset 0xdc0 0xddd: 0x000c, 0xdde: 0x000c, 0xddf: 0x000c, // Block 0x38, offset 0xe00 0xe10: 0x000a, 0xe11: 0x000a, 0xe12: 0x000a, 0xe13: 0x000a, 0xe14: 0x000a, 0xe15: 0x000a, 0xe16: 0x000a, 0xe17: 0x000a, 0xe18: 0x000a, 0xe19: 0x000a, // Block 0x39, offset 0xe40 0xe40: 0x000a, // Block 0x3a, offset 0xe80 0xe80: 0x0009, 0xe9b: 0x007a, 0xe9c: 0x006a, // Block 0x3b, offset 0xec0 0xed2: 0x000c, 0xed3: 0x000c, 0xed4: 0x000c, 0xef2: 0x000c, 0xef3: 0x000c, // Block 0x3c, offset 0xf00 0xf12: 0x000c, 0xf13: 0x000c, 0xf32: 0x000c, 0xf33: 0x000c, // Block 0x3d, offset 0xf40 0xf74: 0x000c, 0xf75: 0x000c, 0xf77: 0x000c, 0xf78: 0x000c, 0xf79: 0x000c, 0xf7a: 0x000c, 0xf7b: 0x000c, 0xf7c: 0x000c, 0xf7d: 0x000c, // Block 0x3e, offset 0xf80 0xf86: 0x000c, 0xf89: 0x000c, 0xf8a: 0x000c, 0xf8b: 0x000c, 0xf8c: 0x000c, 0xf8d: 0x000c, 0xf8e: 0x000c, 0xf8f: 0x000c, 0xf90: 0x000c, 0xf91: 0x000c, 0xf92: 0x000c, 0xf93: 0x000c, 0xf9b: 0x0004, 0xf9d: 0x000c, 0xfb0: 0x000a, 0xfb1: 0x000a, 0xfb2: 0x000a, 0xfb3: 0x000a, 0xfb4: 0x000a, 0xfb5: 0x000a, 0xfb6: 0x000a, 0xfb7: 0x000a, 0xfb8: 0x000a, 0xfb9: 0x000a, // Block 0x3f, offset 0xfc0 0xfc0: 0x000a, 0xfc1: 0x000a, 0xfc2: 0x000a, 0xfc3: 0x000a, 0xfc4: 0x000a, 0xfc5: 0x000a, 0xfc6: 0x000a, 0xfc7: 0x000a, 0xfc8: 0x000a, 0xfc9: 0x000a, 0xfca: 0x000a, 0xfcb: 0x000c, 0xfcc: 0x000c, 0xfcd: 0x000c, 0xfce: 0x000b, 0xfcf: 0x000c, // Block 0x40, offset 0x1000 0x1005: 0x000c, 0x1006: 0x000c, 0x1029: 0x000c, // Block 0x41, offset 0x1040 0x1060: 0x000c, 0x1061: 0x000c, 0x1062: 0x000c, 0x1067: 0x000c, 0x1068: 0x000c, 0x1072: 0x000c, 0x1079: 0x000c, 0x107a: 0x000c, 0x107b: 0x000c, // Block 0x42, offset 0x1080 0x1080: 0x000a, 0x1084: 0x000a, 0x1085: 0x000a, // Block 0x43, offset 0x10c0 0x10de: 0x000a, 0x10df: 0x000a, 0x10e0: 0x000a, 0x10e1: 0x000a, 0x10e2: 0x000a, 0x10e3: 0x000a, 0x10e4: 0x000a, 0x10e5: 0x000a, 0x10e6: 0x000a, 0x10e7: 0x000a, 0x10e8: 0x000a, 0x10e9: 0x000a, 0x10ea: 0x000a, 0x10eb: 0x000a, 0x10ec: 0x000a, 0x10ed: 0x000a, 0x10ee: 0x000a, 0x10ef: 0x000a, 0x10f0: 0x000a, 0x10f1: 0x000a, 0x10f2: 0x000a, 0x10f3: 0x000a, 0x10f4: 0x000a, 0x10f5: 0x000a, 0x10f6: 0x000a, 0x10f7: 0x000a, 0x10f8: 0x000a, 0x10f9: 0x000a, 0x10fa: 0x000a, 0x10fb: 0x000a, 0x10fc: 0x000a, 0x10fd: 0x000a, 0x10fe: 0x000a, 0x10ff: 0x000a, // Block 0x44, offset 0x1100 0x1117: 0x000c, 0x1118: 0x000c, 0x111b: 0x000c, // Block 0x45, offset 0x1140 0x1156: 0x000c, 0x1158: 0x000c, 0x1159: 0x000c, 0x115a: 0x000c, 0x115b: 0x000c, 0x115c: 0x000c, 0x115d: 0x000c, 0x115e: 0x000c, 0x1160: 0x000c, 0x1162: 0x000c, 0x1165: 0x000c, 0x1166: 0x000c, 0x1167: 0x000c, 0x1168: 0x000c, 0x1169: 0x000c, 0x116a: 0x000c, 0x116b: 0x000c, 0x116c: 0x000c, 0x1173: 0x000c, 0x1174: 0x000c, 0x1175: 0x000c, 0x1176: 0x000c, 0x1177: 0x000c, 0x1178: 0x000c, 0x1179: 0x000c, 0x117a: 0x000c, 0x117b: 0x000c, 0x117c: 0x000c, 0x117f: 0x000c, // Block 0x46, offset 0x1180 0x11b0: 0x000c, 0x11b1: 0x000c, 0x11b2: 0x000c, 0x11b3: 0x000c, 0x11b4: 0x000c, 0x11b5: 0x000c, 0x11b6: 0x000c, 0x11b7: 0x000c, 0x11b8: 0x000c, 0x11b9: 0x000c, 0x11ba: 0x000c, 0x11bb: 0x000c, 0x11bc: 0x000c, 0x11bd: 0x000c, 0x11be: 0x000c, 0x11bf: 0x000c, // Block 0x47, offset 0x11c0 0x11c0: 0x000c, 0x11c1: 0x000c, 0x11c2: 0x000c, 0x11c3: 0x000c, 0x11c4: 0x000c, 0x11c5: 0x000c, 0x11c6: 0x000c, 0x11c7: 0x000c, 0x11c8: 0x000c, 0x11c9: 0x000c, 0x11ca: 0x000c, 0x11cb: 0x000c, 0x11cc: 0x000c, 0x11cd: 0x000c, 0x11ce: 0x000c, // Block 0x48, offset 0x1200 0x1200: 0x000c, 0x1201: 0x000c, 0x1202: 0x000c, 0x1203: 0x000c, 0x1234: 0x000c, 0x1236: 0x000c, 0x1237: 0x000c, 0x1238: 0x000c, 0x1239: 0x000c, 0x123a: 0x000c, 0x123c: 0x000c, // Block 0x49, offset 0x1240 0x1242: 0x000c, 0x126b: 0x000c, 0x126c: 0x000c, 0x126d: 0x000c, 0x126e: 0x000c, 0x126f: 0x000c, 0x1270: 0x000c, 0x1271: 0x000c, 0x1272: 0x000c, 0x1273: 0x000c, // Block 0x4a, offset 0x1280 0x1280: 0x000c, 0x1281: 0x000c, 0x12a2: 0x000c, 0x12a3: 0x000c, 0x12a4: 0x000c, 0x12a5: 0x000c, 0x12a8: 0x000c, 0x12a9: 0x000c, 0x12ab: 0x000c, 0x12ac: 0x000c, 0x12ad: 0x000c, // Block 0x4b, offset 0x12c0 0x12e6: 0x000c, 0x12e8: 0x000c, 0x12e9: 0x000c, 0x12ed: 0x000c, 0x12ef: 0x000c, 0x12f0: 0x000c, 0x12f1: 0x000c, // Block 0x4c, offset 0x1300 0x132c: 0x000c, 0x132d: 0x000c, 0x132e: 0x000c, 0x132f: 0x000c, 0x1330: 0x000c, 0x1331: 0x000c, 0x1332: 0x000c, 0x1333: 0x000c, 0x1336: 0x000c, 0x1337: 0x000c, // Block 0x4d, offset 0x1340 0x1350: 0x000c, 0x1351: 0x000c, 0x1352: 0x000c, 0x1354: 0x000c, 0x1355: 0x000c, 0x1356: 0x000c, 0x1357: 0x000c, 0x1358: 0x000c, 0x1359: 0x000c, 0x135a: 0x000c, 0x135b: 0x000c, 0x135c: 0x000c, 0x135d: 0x000c, 0x135e: 0x000c, 0x135f: 0x000c, 0x1360: 0x000c, 0x1362: 0x000c, 0x1363: 0x000c, 0x1364: 0x000c, 0x1365: 0x000c, 0x1366: 0x000c, 0x1367: 0x000c, 0x1368: 0x000c, 0x136d: 0x000c, 0x1374: 0x000c, 0x1378: 0x000c, 0x1379: 0x000c, // Block 0x4e, offset 0x1380 0x13bd: 0x000a, 0x13bf: 0x000a, // Block 0x4f, offset 0x13c0 0x13c0: 0x000a, 0x13c1: 0x000a, 0x13cd: 0x000a, 0x13ce: 0x000a, 0x13cf: 0x000a, 0x13dd: 0x000a, 0x13de: 0x000a, 0x13df: 0x000a, 0x13ed: 0x000a, 0x13ee: 0x000a, 0x13ef: 0x000a, 0x13fd: 0x000a, 0x13fe: 0x000a, // Block 0x50, offset 0x1400 0x1400: 0x0009, 0x1401: 0x0009, 0x1402: 0x0009, 0x1403: 0x0009, 0x1404: 0x0009, 0x1405: 0x0009, 0x1406: 0x0009, 0x1407: 0x0009, 0x1408: 0x0009, 0x1409: 0x0009, 0x140a: 0x0009, 0x140b: 0x000b, 0x140c: 0x000b, 0x140d: 0x000b, 0x140f: 0x0001, 0x1410: 0x000a, 0x1411: 0x000a, 0x1412: 0x000a, 0x1413: 0x000a, 0x1414: 0x000a, 0x1415: 0x000a, 0x1416: 0x000a, 0x1417: 0x000a, 0x1418: 0x000a, 0x1419: 0x000a, 0x141a: 0x000a, 0x141b: 0x000a, 0x141c: 0x000a, 0x141d: 0x000a, 0x141e: 0x000a, 0x141f: 0x000a, 0x1420: 0x000a, 0x1421: 0x000a, 0x1422: 0x000a, 0x1423: 0x000a, 0x1424: 0x000a, 0x1425: 0x000a, 0x1426: 0x000a, 0x1427: 0x000a, 0x1428: 0x0009, 0x1429: 0x0007, 0x142a: 0x000e, 0x142b: 0x000e, 0x142c: 0x000e, 0x142d: 0x000e, 0x142e: 0x000e, 0x142f: 0x0006, 0x1430: 0x0004, 0x1431: 0x0004, 0x1432: 0x0004, 0x1433: 0x0004, 0x1434: 0x0004, 0x1435: 0x000a, 0x1436: 0x000a, 0x1437: 0x000a, 0x1438: 0x000a, 0x1439: 0x000a, 0x143a: 0x000a, 0x143b: 0x000a, 0x143c: 0x000a, 0x143d: 0x000a, 0x143e: 0x000a, 0x143f: 0x000a, // Block 0x51, offset 0x1440 0x1440: 0x000a, 0x1441: 0x000a, 0x1442: 0x000a, 0x1443: 0x000a, 0x1444: 0x0006, 0x1445: 0x009a, 0x1446: 0x008a, 0x1447: 0x000a, 0x1448: 0x000a, 0x1449: 0x000a, 0x144a: 0x000a, 0x144b: 0x000a, 0x144c: 0x000a, 0x144d: 0x000a, 0x144e: 0x000a, 0x144f: 0x000a, 0x1450: 0x000a, 0x1451: 0x000a, 0x1452: 0x000a, 0x1453: 0x000a, 0x1454: 0x000a, 0x1455: 0x000a, 0x1456: 0x000a, 0x1457: 0x000a, 0x1458: 0x000a, 0x1459: 0x000a, 0x145a: 0x000a, 0x145b: 0x000a, 0x145c: 0x000a, 0x145d: 0x000a, 0x145e: 0x000a, 0x145f: 0x0009, 0x1460: 0x000b, 0x1461: 0x000b, 0x1462: 0x000b, 0x1463: 0x000b, 0x1464: 0x000b, 0x1465: 0x000b, 0x1466: 0x000e, 0x1467: 0x000e, 0x1468: 0x000e, 0x1469: 0x000e, 0x146a: 0x000b, 0x146b: 0x000b, 0x146c: 0x000b, 0x146d: 0x000b, 0x146e: 0x000b, 0x146f: 0x000b, 0x1470: 0x0002, 0x1474: 0x0002, 0x1475: 0x0002, 0x1476: 0x0002, 0x1477: 0x0002, 0x1478: 0x0002, 0x1479: 0x0002, 0x147a: 0x0003, 0x147b: 0x0003, 0x147c: 0x000a, 0x147d: 0x009a, 0x147e: 0x008a, // Block 0x52, offset 0x1480 0x1480: 0x0002, 0x1481: 0x0002, 0x1482: 0x0002, 0x1483: 0x0002, 0x1484: 0x0002, 0x1485: 0x0002, 0x1486: 0x0002, 0x1487: 0x0002, 0x1488: 0x0002, 0x1489: 0x0002, 0x148a: 0x0003, 0x148b: 0x0003, 0x148c: 0x000a, 0x148d: 0x009a, 0x148e: 0x008a, 0x14a0: 0x0004, 0x14a1: 0x0004, 0x14a2: 0x0004, 0x14a3: 0x0004, 0x14a4: 0x0004, 0x14a5: 0x0004, 0x14a6: 0x0004, 0x14a7: 0x0004, 0x14a8: 0x0004, 0x14a9: 0x0004, 0x14aa: 0x0004, 0x14ab: 0x0004, 0x14ac: 0x0004, 0x14ad: 0x0004, 0x14ae: 0x0004, 0x14af: 0x0004, 0x14b0: 0x0004, 0x14b1: 0x0004, 0x14b2: 0x0004, 0x14b3: 0x0004, 0x14b4: 0x0004, 0x14b5: 0x0004, 0x14b6: 0x0004, 0x14b7: 0x0004, 0x14b8: 0x0004, 0x14b9: 0x0004, 0x14ba: 0x0004, 0x14bb: 0x0004, 0x14bc: 0x0004, 0x14bd: 0x0004, 0x14be: 0x0004, 0x14bf: 0x0004, // Block 0x53, offset 0x14c0 0x14c0: 0x0004, 0x14c1: 0x0004, 0x14c2: 0x0004, 0x14c3: 0x0004, 0x14c4: 0x0004, 0x14c5: 0x0004, 0x14c6: 0x0004, 0x14c7: 0x0004, 0x14c8: 0x0004, 0x14c9: 0x0004, 0x14ca: 0x0004, 0x14cb: 0x0004, 0x14cc: 0x0004, 0x14cd: 0x0004, 0x14ce: 0x0004, 0x14cf: 0x0004, 0x14d0: 0x000c, 0x14d1: 0x000c, 0x14d2: 0x000c, 0x14d3: 0x000c, 0x14d4: 0x000c, 0x14d5: 0x000c, 0x14d6: 0x000c, 0x14d7: 0x000c, 0x14d8: 0x000c, 0x14d9: 0x000c, 0x14da: 0x000c, 0x14db: 0x000c, 0x14dc: 0x000c, 0x14dd: 0x000c, 0x14de: 0x000c, 0x14df: 0x000c, 0x14e0: 0x000c, 0x14e1: 0x000c, 0x14e2: 0x000c, 0x14e3: 0x000c, 0x14e4: 0x000c, 0x14e5: 0x000c, 0x14e6: 0x000c, 0x14e7: 0x000c, 0x14e8: 0x000c, 0x14e9: 0x000c, 0x14ea: 0x000c, 0x14eb: 0x000c, 0x14ec: 0x000c, 0x14ed: 0x000c, 0x14ee: 0x000c, 0x14ef: 0x000c, 0x14f0: 0x000c, // Block 0x54, offset 0x1500 0x1500: 0x000a, 0x1501: 0x000a, 0x1503: 0x000a, 0x1504: 0x000a, 0x1505: 0x000a, 0x1506: 0x000a, 0x1508: 0x000a, 0x1509: 0x000a, 0x1514: 0x000a, 0x1516: 0x000a, 0x1517: 0x000a, 0x1518: 0x000a, 0x151e: 0x000a, 0x151f: 0x000a, 0x1520: 0x000a, 0x1521: 0x000a, 0x1522: 0x000a, 0x1523: 0x000a, 0x1525: 0x000a, 0x1527: 0x000a, 0x1529: 0x000a, 0x152e: 0x0004, 0x153a: 0x000a, 0x153b: 0x000a, // Block 0x55, offset 0x1540 0x1540: 0x000a, 0x1541: 0x000a, 0x1542: 0x000a, 0x1543: 0x000a, 0x1544: 0x000a, 0x154a: 0x000a, 0x154b: 0x000a, 0x154c: 0x000a, 0x154d: 0x000a, 0x1550: 0x000a, 0x1551: 0x000a, 0x1552: 0x000a, 0x1553: 0x000a, 0x1554: 0x000a, 0x1555: 0x000a, 0x1556: 0x000a, 0x1557: 0x000a, 0x1558: 0x000a, 0x1559: 0x000a, 0x155a: 0x000a, 0x155b: 0x000a, 0x155c: 0x000a, 0x155d: 0x000a, 0x155e: 0x000a, 0x155f: 0x000a, // Block 0x56, offset 0x1580 0x1589: 0x000a, 0x158a: 0x000a, 0x158b: 0x000a, 0x1590: 0x000a, 0x1591: 0x000a, 0x1592: 0x000a, 0x1593: 0x000a, 0x1594: 0x000a, 0x1595: 0x000a, 0x1596: 0x000a, 0x1597: 0x000a, 0x1598: 0x000a, 0x1599: 0x000a, 0x159a: 0x000a, 0x159b: 0x000a, 0x159c: 0x000a, 0x159d: 0x000a, 0x159e: 0x000a, 0x159f: 0x000a, 0x15a0: 0x000a, 0x15a1: 0x000a, 0x15a2: 0x000a, 0x15a3: 0x000a, 0x15a4: 0x000a, 0x15a5: 0x000a, 0x15a6: 0x000a, 0x15a7: 0x000a, 0x15a8: 0x000a, 0x15a9: 0x000a, 0x15aa: 0x000a, 0x15ab: 0x000a, 0x15ac: 0x000a, 0x15ad: 0x000a, 0x15ae: 0x000a, 0x15af: 0x000a, 0x15b0: 0x000a, 0x15b1: 0x000a, 0x15b2: 0x000a, 0x15b3: 0x000a, 0x15b4: 0x000a, 0x15b5: 0x000a, 0x15b6: 0x000a, 0x15b7: 0x000a, 0x15b8: 0x000a, 0x15b9: 0x000a, 0x15ba: 0x000a, 0x15bb: 0x000a, 0x15bc: 0x000a, 0x15bd: 0x000a, 0x15be: 0x000a, 0x15bf: 0x000a, // Block 0x57, offset 0x15c0 0x15c0: 0x000a, 0x15c1: 0x000a, 0x15c2: 0x000a, 0x15c3: 0x000a, 0x15c4: 0x000a, 0x15c5: 0x000a, 0x15c6: 0x000a, 0x15c7: 0x000a, 0x15c8: 0x000a, 0x15c9: 0x000a, 0x15ca: 0x000a, 0x15cb: 0x000a, 0x15cc: 0x000a, 0x15cd: 0x000a, 0x15ce: 0x000a, 0x15cf: 0x000a, 0x15d0: 0x000a, 0x15d1: 0x000a, 0x15d2: 0x000a, 0x15d3: 0x000a, 0x15d4: 0x000a, 0x15d5: 0x000a, 0x15d6: 0x000a, 0x15d7: 0x000a, 0x15d8: 0x000a, 0x15d9: 0x000a, 0x15da: 0x000a, 0x15db: 0x000a, 0x15dc: 0x000a, 0x15dd: 0x000a, 0x15de: 0x000a, 0x15df: 0x000a, 0x15e0: 0x000a, 0x15e1: 0x000a, 0x15e2: 0x000a, 0x15e3: 0x000a, 0x15e4: 0x000a, 0x15e5: 0x000a, 0x15e6: 0x000a, 0x15e7: 0x000a, 0x15e8: 0x000a, 0x15e9: 0x000a, 0x15ea: 0x000a, 0x15eb: 0x000a, 0x15ec: 0x000a, 0x15ed: 0x000a, 0x15ee: 0x000a, 0x15ef: 0x000a, 0x15f0: 0x000a, 0x15f1: 0x000a, 0x15f2: 0x000a, 0x15f3: 0x000a, 0x15f4: 0x000a, 0x15f5: 0x000a, 0x15f6: 0x000a, 0x15f7: 0x000a, 0x15f8: 0x000a, 0x15f9: 0x000a, 0x15fa: 0x000a, 0x15fb: 0x000a, 0x15fc: 0x000a, 0x15fd: 0x000a, 0x15fe: 0x000a, 0x15ff: 0x000a, // Block 0x58, offset 0x1600 0x1600: 0x000a, 0x1601: 0x000a, 0x1602: 0x000a, 0x1603: 0x000a, 0x1604: 0x000a, 0x1605: 0x000a, 0x1606: 0x000a, 0x1607: 0x000a, 0x1608: 0x000a, 0x1609: 0x000a, 0x160a: 0x000a, 0x160b: 0x000a, 0x160c: 0x000a, 0x160d: 0x000a, 0x160e: 0x000a, 0x160f: 0x000a, 0x1610: 0x000a, 0x1611: 0x000a, 0x1612: 0x0003, 0x1613: 0x0004, 0x1614: 0x000a, 0x1615: 0x000a, 0x1616: 0x000a, 0x1617: 0x000a, 0x1618: 0x000a, 0x1619: 0x000a, 0x161a: 0x000a, 0x161b: 0x000a, 0x161c: 0x000a, 0x161d: 0x000a, 0x161e: 0x000a, 0x161f: 0x000a, 0x1620: 0x000a, 0x1621: 0x000a, 0x1622: 0x000a, 0x1623: 0x000a, 0x1624: 0x000a, 0x1625: 0x000a, 0x1626: 0x000a, 0x1627: 0x000a, 0x1628: 0x000a, 0x1629: 0x000a, 0x162a: 0x000a, 0x162b: 0x000a, 0x162c: 0x000a, 0x162d: 0x000a, 0x162e: 0x000a, 0x162f: 0x000a, 0x1630: 0x000a, 0x1631: 0x000a, 0x1632: 0x000a, 0x1633: 0x000a, 0x1634: 0x000a, 0x1635: 0x000a, 0x1636: 0x000a, 0x1637: 0x000a, 0x1638: 0x000a, 0x1639: 0x000a, 0x163a: 0x000a, 0x163b: 0x000a, 0x163c: 0x000a, 0x163d: 0x000a, 0x163e: 0x000a, 0x163f: 0x000a, // Block 0x59, offset 0x1640 0x1640: 0x000a, 0x1641: 0x000a, 0x1642: 0x000a, 0x1643: 0x000a, 0x1644: 0x000a, 0x1645: 0x000a, 0x1646: 0x000a, 0x1647: 0x000a, 0x1648: 0x003a, 0x1649: 0x002a, 0x164a: 0x003a, 0x164b: 0x002a, 0x164c: 0x000a, 0x164d: 0x000a, 0x164e: 0x000a, 0x164f: 0x000a, 0x1650: 0x000a, 0x1651: 0x000a, 0x1652: 0x000a, 0x1653: 0x000a, 0x1654: 0x000a, 0x1655: 0x000a, 0x1656: 0x000a, 0x1657: 0x000a, 0x1658: 0x000a, 0x1659: 0x000a, 0x165a: 0x000a, 0x165b: 0x000a, 0x165c: 0x000a, 0x165d: 0x000a, 0x165e: 0x000a, 0x165f: 0x000a, 0x1660: 0x000a, 0x1661: 0x000a, 0x1662: 0x000a, 0x1663: 0x000a, 0x1664: 0x000a, 0x1665: 0x000a, 0x1666: 0x000a, 0x1667: 0x000a, 0x1668: 0x000a, 0x1669: 0x009a, 0x166a: 0x008a, 0x166b: 0x000a, 0x166c: 0x000a, 0x166d: 0x000a, 0x166e: 0x000a, 0x166f: 0x000a, 0x1670: 0x000a, 0x1671: 0x000a, 0x1672: 0x000a, 0x1673: 0x000a, 0x1674: 0x000a, 0x1675: 0x000a, // Block 0x5a, offset 0x1680 0x16bb: 0x000a, 0x16bc: 0x000a, 0x16bd: 0x000a, 0x16be: 0x000a, 0x16bf: 0x000a, // Block 0x5b, offset 0x16c0 0x16c0: 0x000a, 0x16c1: 0x000a, 0x16c2: 0x000a, 0x16c3: 0x000a, 0x16c4: 0x000a, 0x16c5: 0x000a, 0x16c6: 0x000a, 0x16c7: 0x000a, 0x16c8: 0x000a, 0x16c9: 0x000a, 0x16ca: 0x000a, 0x16cb: 0x000a, 0x16cc: 0x000a, 0x16cd: 0x000a, 0x16ce: 0x000a, 0x16cf: 0x000a, 0x16d0: 0x000a, 0x16d1: 0x000a, 0x16d2: 0x000a, 0x16d3: 0x000a, 0x16d4: 0x000a, 0x16d6: 0x000a, 0x16d7: 0x000a, 0x16d8: 0x000a, 0x16d9: 0x000a, 0x16da: 0x000a, 0x16db: 0x000a, 0x16dc: 0x000a, 0x16dd: 0x000a, 0x16de: 0x000a, 0x16df: 0x000a, 0x16e0: 0x000a, 0x16e1: 0x000a, 0x16e2: 0x000a, 0x16e3: 0x000a, 0x16e4: 0x000a, 0x16e5: 0x000a, 0x16e6: 0x000a, 0x16e7: 0x000a, 0x16e8: 0x000a, 0x16e9: 0x000a, 0x16ea: 0x000a, 0x16eb: 0x000a, 0x16ec: 0x000a, 0x16ed: 0x000a, 0x16ee: 0x000a, 0x16ef: 0x000a, 0x16f0: 0x000a, 0x16f1: 0x000a, 0x16f2: 0x000a, 0x16f3: 0x000a, 0x16f4: 0x000a, 0x16f5: 0x000a, 0x16f6: 0x000a, 0x16f7: 0x000a, 0x16f8: 0x000a, 0x16f9: 0x000a, 0x16fa: 0x000a, 0x16fb: 0x000a, 0x16fc: 0x000a, 0x16fd: 0x000a, 0x16fe: 0x000a, 0x16ff: 0x000a, // Block 0x5c, offset 0x1700 0x1700: 0x000a, 0x1701: 0x000a, 0x1702: 0x000a, 0x1703: 0x000a, 0x1704: 0x000a, 0x1705: 0x000a, 0x1706: 0x000a, 0x1707: 0x000a, 0x1708: 0x000a, 0x1709: 0x000a, 0x170a: 0x000a, 0x170b: 0x000a, 0x170c: 0x000a, 0x170d: 0x000a, 0x170e: 0x000a, 0x170f: 0x000a, 0x1710: 0x000a, 0x1711: 0x000a, 0x1712: 0x000a, 0x1713: 0x000a, 0x1714: 0x000a, 0x1715: 0x000a, 0x1716: 0x000a, 0x1717: 0x000a, 0x1718: 0x000a, 0x1719: 0x000a, 0x171a: 0x000a, 0x171b: 0x000a, 0x171c: 0x000a, 0x171d: 0x000a, 0x171e: 0x000a, 0x171f: 0x000a, 0x1720: 0x000a, 0x1721: 0x000a, 0x1722: 0x000a, 0x1723: 0x000a, 0x1724: 0x000a, 0x1725: 0x000a, 0x1726: 0x000a, // Block 0x5d, offset 0x1740 0x1740: 0x000a, 0x1741: 0x000a, 0x1742: 0x000a, 0x1743: 0x000a, 0x1744: 0x000a, 0x1745: 0x000a, 0x1746: 0x000a, 0x1747: 0x000a, 0x1748: 0x000a, 0x1749: 0x000a, 0x174a: 0x000a, 0x1760: 0x000a, 0x1761: 0x000a, 0x1762: 0x000a, 0x1763: 0x000a, 0x1764: 0x000a, 0x1765: 0x000a, 0x1766: 0x000a, 0x1767: 0x000a, 0x1768: 0x000a, 0x1769: 0x000a, 0x176a: 0x000a, 0x176b: 0x000a, 0x176c: 0x000a, 0x176d: 0x000a, 0x176e: 0x000a, 0x176f: 0x000a, 0x1770: 0x000a, 0x1771: 0x000a, 0x1772: 0x000a, 0x1773: 0x000a, 0x1774: 0x000a, 0x1775: 0x000a, 0x1776: 0x000a, 0x1777: 0x000a, 0x1778: 0x000a, 0x1779: 0x000a, 0x177a: 0x000a, 0x177b: 0x000a, 0x177c: 0x000a, 0x177d: 0x000a, 0x177e: 0x000a, 0x177f: 0x000a, // Block 0x5e, offset 0x1780 0x1780: 0x000a, 0x1781: 0x000a, 0x1782: 0x000a, 0x1783: 0x000a, 0x1784: 0x000a, 0x1785: 0x000a, 0x1786: 0x000a, 0x1787: 0x000a, 0x1788: 0x0002, 0x1789: 0x0002, 0x178a: 0x0002, 0x178b: 0x0002, 0x178c: 0x0002, 0x178d: 0x0002, 0x178e: 0x0002, 0x178f: 0x0002, 0x1790: 0x0002, 0x1791: 0x0002, 0x1792: 0x0002, 0x1793: 0x0002, 0x1794: 0x0002, 0x1795: 0x0002, 0x1796: 0x0002, 0x1797: 0x0002, 0x1798: 0x0002, 0x1799: 0x0002, 0x179a: 0x0002, 0x179b: 0x0002, // Block 0x5f, offset 0x17c0 0x17ea: 0x000a, 0x17eb: 0x000a, 0x17ec: 0x000a, 0x17ed: 0x000a, 0x17ee: 0x000a, 0x17ef: 0x000a, 0x17f0: 0x000a, 0x17f1: 0x000a, 0x17f2: 0x000a, 0x17f3: 0x000a, 0x17f4: 0x000a, 0x17f5: 0x000a, 0x17f6: 0x000a, 0x17f7: 0x000a, 0x17f8: 0x000a, 0x17f9: 0x000a, 0x17fa: 0x000a, 0x17fb: 0x000a, 0x17fc: 0x000a, 0x17fd: 0x000a, 0x17fe: 0x000a, 0x17ff: 0x000a, // Block 0x60, offset 0x1800 0x1800: 0x000a, 0x1801: 0x000a, 0x1802: 0x000a, 0x1803: 0x000a, 0x1804: 0x000a, 0x1805: 0x000a, 0x1806: 0x000a, 0x1807: 0x000a, 0x1808: 0x000a, 0x1809: 0x000a, 0x180a: 0x000a, 0x180b: 0x000a, 0x180c: 0x000a, 0x180d: 0x000a, 0x180e: 0x000a, 0x180f: 0x000a, 0x1810: 0x000a, 0x1811: 0x000a, 0x1812: 0x000a, 0x1813: 0x000a, 0x1814: 0x000a, 0x1815: 0x000a, 0x1816: 0x000a, 0x1817: 0x000a, 0x1818: 0x000a, 0x1819: 0x000a, 0x181a: 0x000a, 0x181b: 0x000a, 0x181c: 0x000a, 0x181d: 0x000a, 0x181e: 0x000a, 0x181f: 0x000a, 0x1820: 0x000a, 0x1821: 0x000a, 0x1822: 0x000a, 0x1823: 0x000a, 0x1824: 0x000a, 0x1825: 0x000a, 0x1826: 0x000a, 0x1827: 0x000a, 0x1828: 0x000a, 0x1829: 0x000a, 0x182a: 0x000a, 0x182b: 0x000a, 0x182d: 0x000a, 0x182e: 0x000a, 0x182f: 0x000a, 0x1830: 0x000a, 0x1831: 0x000a, 0x1832: 0x000a, 0x1833: 0x000a, 0x1834: 0x000a, 0x1835: 0x000a, 0x1836: 0x000a, 0x1837: 0x000a, 0x1838: 0x000a, 0x1839: 0x000a, 0x183a: 0x000a, 0x183b: 0x000a, 0x183c: 0x000a, 0x183d: 0x000a, 0x183e: 0x000a, 0x183f: 0x000a, // Block 0x61, offset 0x1840 0x1840: 0x000a, 0x1841: 0x000a, 0x1842: 0x000a, 0x1843: 0x000a, 0x1844: 0x000a, 0x1845: 0x000a, 0x1846: 0x000a, 0x1847: 0x000a, 0x1848: 0x000a, 0x1849: 0x000a, 0x184a: 0x000a, 0x184b: 0x000a, 0x184c: 0x000a, 0x184d: 0x000a, 0x184e: 0x000a, 0x184f: 0x000a, 0x1850: 0x000a, 0x1851: 0x000a, 0x1852: 0x000a, 0x1853: 0x000a, 0x1854: 0x000a, 0x1855: 0x000a, 0x1856: 0x000a, 0x1857: 0x000a, 0x1858: 0x000a, 0x1859: 0x000a, 0x185a: 0x000a, 0x185b: 0x000a, 0x185c: 0x000a, 0x185d: 0x000a, 0x185e: 0x000a, 0x185f: 0x000a, 0x1860: 0x000a, 0x1861: 0x000a, 0x1862: 0x000a, 0x1863: 0x000a, 0x1864: 0x000a, 0x1865: 0x000a, 0x1866: 0x000a, 0x1867: 0x000a, 0x1868: 0x003a, 0x1869: 0x002a, 0x186a: 0x003a, 0x186b: 0x002a, 0x186c: 0x003a, 0x186d: 0x002a, 0x186e: 0x003a, 0x186f: 0x002a, 0x1870: 0x003a, 0x1871: 0x002a, 0x1872: 0x003a, 0x1873: 0x002a, 0x1874: 0x003a, 0x1875: 0x002a, 0x1876: 0x000a, 0x1877: 0x000a, 0x1878: 0x000a, 0x1879: 0x000a, 0x187a: 0x000a, 0x187b: 0x000a, 0x187c: 0x000a, 0x187d: 0x000a, 0x187e: 0x000a, 0x187f: 0x000a, // Block 0x62, offset 0x1880 0x1880: 0x000a, 0x1881: 0x000a, 0x1882: 0x000a, 0x1883: 0x000a, 0x1884: 0x000a, 0x1885: 0x009a, 0x1886: 0x008a, 0x1887: 0x000a, 0x1888: 0x000a, 0x1889: 0x000a, 0x188a: 0x000a, 0x188b: 0x000a, 0x188c: 0x000a, 0x188d: 0x000a, 0x188e: 0x000a, 0x188f: 0x000a, 0x1890: 0x000a, 0x1891: 0x000a, 0x1892: 0x000a, 0x1893: 0x000a, 0x1894: 0x000a, 0x1895: 0x000a, 0x1896: 0x000a, 0x1897: 0x000a, 0x1898: 0x000a, 0x1899: 0x000a, 0x189a: 0x000a, 0x189b: 0x000a, 0x189c: 0x000a, 0x189d: 0x000a, 0x189e: 0x000a, 0x189f: 0x000a, 0x18a0: 0x000a, 0x18a1: 0x000a, 0x18a2: 0x000a, 0x18a3: 0x000a, 0x18a4: 0x000a, 0x18a5: 0x000a, 0x18a6: 0x003a, 0x18a7: 0x002a, 0x18a8: 0x003a, 0x18a9: 0x002a, 0x18aa: 0x003a, 0x18ab: 0x002a, 0x18ac: 0x003a, 0x18ad: 0x002a, 0x18ae: 0x003a, 0x18af: 0x002a, 0x18b0: 0x000a, 0x18b1: 0x000a, 0x18b2: 0x000a, 0x18b3: 0x000a, 0x18b4: 0x000a, 0x18b5: 0x000a, 0x18b6: 0x000a, 0x18b7: 0x000a, 0x18b8: 0x000a, 0x18b9: 0x000a, 0x18ba: 0x000a, 0x18bb: 0x000a, 0x18bc: 0x000a, 0x18bd: 0x000a, 0x18be: 0x000a, 0x18bf: 0x000a, // Block 0x63, offset 0x18c0 0x18c0: 0x000a, 0x18c1: 0x000a, 0x18c2: 0x000a, 0x18c3: 0x007a, 0x18c4: 0x006a, 0x18c5: 0x009a, 0x18c6: 0x008a, 0x18c7: 0x00ba, 0x18c8: 0x00aa, 0x18c9: 0x009a, 0x18ca: 0x008a, 0x18cb: 0x007a, 0x18cc: 0x006a, 0x18cd: 0x00da, 0x18ce: 0x002a, 0x18cf: 0x003a, 0x18d0: 0x00ca, 0x18d1: 0x009a, 0x18d2: 0x008a, 0x18d3: 0x007a, 0x18d4: 0x006a, 0x18d5: 0x009a, 0x18d6: 0x008a, 0x18d7: 0x00ba, 0x18d8: 0x00aa, 0x18d9: 0x000a, 0x18da: 0x000a, 0x18db: 0x000a, 0x18dc: 0x000a, 0x18dd: 0x000a, 0x18de: 0x000a, 0x18df: 0x000a, 0x18e0: 0x000a, 0x18e1: 0x000a, 0x18e2: 0x000a, 0x18e3: 0x000a, 0x18e4: 0x000a, 0x18e5: 0x000a, 0x18e6: 0x000a, 0x18e7: 0x000a, 0x18e8: 0x000a, 0x18e9: 0x000a, 0x18ea: 0x000a, 0x18eb: 0x000a, 0x18ec: 0x000a, 0x18ed: 0x000a, 0x18ee: 0x000a, 0x18ef: 0x000a, 0x18f0: 0x000a, 0x18f1: 0x000a, 0x18f2: 0x000a, 0x18f3: 0x000a, 0x18f4: 0x000a, 0x18f5: 0x000a, 0x18f6: 0x000a, 0x18f7: 0x000a, 0x18f8: 0x000a, 0x18f9: 0x000a, 0x18fa: 0x000a, 0x18fb: 0x000a, 0x18fc: 0x000a, 0x18fd: 0x000a, 0x18fe: 0x000a, 0x18ff: 0x000a, // Block 0x64, offset 0x1900 0x1900: 0x000a, 0x1901: 0x000a, 0x1902: 0x000a, 0x1903: 0x000a, 0x1904: 0x000a, 0x1905: 0x000a, 0x1906: 0x000a, 0x1907: 0x000a, 0x1908: 0x000a, 0x1909: 0x000a, 0x190a: 0x000a, 0x190b: 0x000a, 0x190c: 0x000a, 0x190d: 0x000a, 0x190e: 0x000a, 0x190f: 0x000a, 0x1910: 0x000a, 0x1911: 0x000a, 0x1912: 0x000a, 0x1913: 0x000a, 0x1914: 0x000a, 0x1915: 0x000a, 0x1916: 0x000a, 0x1917: 0x000a, 0x1918: 0x003a, 0x1919: 0x002a, 0x191a: 0x003a, 0x191b: 0x002a, 0x191c: 0x000a, 0x191d: 0x000a, 0x191e: 0x000a, 0x191f: 0x000a, 0x1920: 0x000a, 0x1921: 0x000a, 0x1922: 0x000a, 0x1923: 0x000a, 0x1924: 0x000a, 0x1925: 0x000a, 0x1926: 0x000a, 0x1927: 0x000a, 0x1928: 0x000a, 0x1929: 0x000a, 0x192a: 0x000a, 0x192b: 0x000a, 0x192c: 0x000a, 0x192d: 0x000a, 0x192e: 0x000a, 0x192f: 0x000a, 0x1930: 0x000a, 0x1931: 0x000a, 0x1932: 0x000a, 0x1933: 0x000a, 0x1934: 0x000a, 0x1935: 0x000a, 0x1936: 0x000a, 0x1937: 0x000a, 0x1938: 0x000a, 0x1939: 0x000a, 0x193a: 0x000a, 0x193b: 0x000a, 0x193c: 0x003a, 0x193d: 0x002a, 0x193e: 0x000a, 0x193f: 0x000a, // Block 0x65, offset 0x1940 0x1940: 0x000a, 0x1941: 0x000a, 0x1942: 0x000a, 0x1943: 0x000a, 0x1944: 0x000a, 0x1945: 0x000a, 0x1946: 0x000a, 0x1947: 0x000a, 0x1948: 0x000a, 0x1949: 0x000a, 0x194a: 0x000a, 0x194b: 0x000a, 0x194c: 0x000a, 0x194d: 0x000a, 0x194e: 0x000a, 0x194f: 0x000a, 0x1950: 0x000a, 0x1951: 0x000a, 0x1952: 0x000a, 0x1953: 0x000a, 0x1954: 0x000a, 0x1955: 0x000a, 0x1956: 0x000a, 0x1957: 0x000a, 0x1958: 0x000a, 0x1959: 0x000a, 0x195a: 0x000a, 0x195b: 0x000a, 0x195c: 0x000a, 0x195d: 0x000a, 0x195e: 0x000a, 0x195f: 0x000a, 0x1960: 0x000a, 0x1961: 0x000a, 0x1962: 0x000a, 0x1963: 0x000a, 0x1964: 0x000a, 0x1965: 0x000a, 0x1966: 0x000a, 0x1967: 0x000a, 0x1968: 0x000a, 0x1969: 0x000a, 0x196a: 0x000a, 0x196b: 0x000a, 0x196c: 0x000a, 0x196d: 0x000a, 0x196e: 0x000a, 0x196f: 0x000a, 0x1970: 0x000a, 0x1971: 0x000a, 0x1972: 0x000a, 0x1973: 0x000a, 0x1976: 0x000a, 0x1977: 0x000a, 0x1978: 0x000a, 0x1979: 0x000a, 0x197a: 0x000a, 0x197b: 0x000a, 0x197c: 0x000a, 0x197d: 0x000a, 0x197e: 0x000a, 0x197f: 0x000a, // Block 0x66, offset 0x1980 0x1980: 0x000a, 0x1981: 0x000a, 0x1982: 0x000a, 0x1983: 0x000a, 0x1984: 0x000a, 0x1985: 0x000a, 0x1986: 0x000a, 0x1987: 0x000a, 0x1988: 0x000a, 0x1989: 0x000a, 0x198a: 0x000a, 0x198b: 0x000a, 0x198c: 0x000a, 0x198d: 0x000a, 0x198e: 0x000a, 0x198f: 0x000a, 0x1990: 0x000a, 0x1991: 0x000a, 0x1992: 0x000a, 0x1993: 0x000a, 0x1994: 0x000a, 0x1995: 0x000a, 0x1997: 0x000a, 0x1998: 0x000a, 0x1999: 0x000a, 0x199a: 0x000a, 0x199b: 0x000a, 0x199c: 0x000a, 0x199d: 0x000a, 0x199e: 0x000a, 0x199f: 0x000a, 0x19a0: 0x000a, 0x19a1: 0x000a, 0x19a2: 0x000a, 0x19a3: 0x000a, 0x19a4: 0x000a, 0x19a5: 0x000a, 0x19a6: 0x000a, 0x19a7: 0x000a, 0x19a8: 0x000a, 0x19a9: 0x000a, 0x19aa: 0x000a, 0x19ab: 0x000a, 0x19ac: 0x000a, 0x19ad: 0x000a, 0x19ae: 0x000a, 0x19af: 0x000a, 0x19b0: 0x000a, 0x19b1: 0x000a, 0x19b2: 0x000a, 0x19b3: 0x000a, 0x19b4: 0x000a, 0x19b5: 0x000a, 0x19b6: 0x000a, 0x19b7: 0x000a, 0x19b8: 0x000a, 0x19b9: 0x000a, 0x19ba: 0x000a, 0x19bb: 0x000a, 0x19bc: 0x000a, 0x19bd: 0x000a, 0x19be: 0x000a, 0x19bf: 0x000a, // Block 0x67, offset 0x19c0 0x19e5: 0x000a, 0x19e6: 0x000a, 0x19e7: 0x000a, 0x19e8: 0x000a, 0x19e9: 0x000a, 0x19ea: 0x000a, 0x19ef: 0x000c, 0x19f0: 0x000c, 0x19f1: 0x000c, 0x19f9: 0x000a, 0x19fa: 0x000a, 0x19fb: 0x000a, 0x19fc: 0x000a, 0x19fd: 0x000a, 0x19fe: 0x000a, 0x19ff: 0x000a, // Block 0x68, offset 0x1a00 0x1a3f: 0x000c, // Block 0x69, offset 0x1a40 0x1a60: 0x000c, 0x1a61: 0x000c, 0x1a62: 0x000c, 0x1a63: 0x000c, 0x1a64: 0x000c, 0x1a65: 0x000c, 0x1a66: 0x000c, 0x1a67: 0x000c, 0x1a68: 0x000c, 0x1a69: 0x000c, 0x1a6a: 0x000c, 0x1a6b: 0x000c, 0x1a6c: 0x000c, 0x1a6d: 0x000c, 0x1a6e: 0x000c, 0x1a6f: 0x000c, 0x1a70: 0x000c, 0x1a71: 0x000c, 0x1a72: 0x000c, 0x1a73: 0x000c, 0x1a74: 0x000c, 0x1a75: 0x000c, 0x1a76: 0x000c, 0x1a77: 0x000c, 0x1a78: 0x000c, 0x1a79: 0x000c, 0x1a7a: 0x000c, 0x1a7b: 0x000c, 0x1a7c: 0x000c, 0x1a7d: 0x000c, 0x1a7e: 0x000c, 0x1a7f: 0x000c, // Block 0x6a, offset 0x1a80 0x1a80: 0x000a, 0x1a81: 0x000a, 0x1a82: 0x000a, 0x1a83: 0x000a, 0x1a84: 0x000a, 0x1a85: 0x000a, 0x1a86: 0x000a, 0x1a87: 0x000a, 0x1a88: 0x000a, 0x1a89: 0x000a, 0x1a8a: 0x000a, 0x1a8b: 0x000a, 0x1a8c: 0x000a, 0x1a8d: 0x000a, 0x1a8e: 0x000a, 0x1a8f: 0x000a, 0x1a90: 0x000a, 0x1a91: 0x000a, 0x1a92: 0x000a, 0x1a93: 0x000a, 0x1a94: 0x000a, 0x1a95: 0x000a, 0x1a96: 0x000a, 0x1a97: 0x000a, 0x1a98: 0x000a, 0x1a99: 0x000a, 0x1a9a: 0x000a, 0x1a9b: 0x000a, 0x1a9c: 0x000a, 0x1a9d: 0x000a, 0x1a9e: 0x000a, 0x1a9f: 0x000a, 0x1aa0: 0x000a, 0x1aa1: 0x000a, 0x1aa2: 0x003a, 0x1aa3: 0x002a, 0x1aa4: 0x003a, 0x1aa5: 0x002a, 0x1aa6: 0x003a, 0x1aa7: 0x002a, 0x1aa8: 0x003a, 0x1aa9: 0x002a, 0x1aaa: 0x000a, 0x1aab: 0x000a, 0x1aac: 0x000a, 0x1aad: 0x000a, 0x1aae: 0x000a, 0x1aaf: 0x000a, 0x1ab0: 0x000a, 0x1ab1: 0x000a, 0x1ab2: 0x000a, 0x1ab3: 0x000a, 0x1ab4: 0x000a, 0x1ab5: 0x000a, 0x1ab6: 0x000a, 0x1ab7: 0x000a, 0x1ab8: 0x000a, 0x1ab9: 0x000a, 0x1aba: 0x000a, 0x1abb: 0x000a, 0x1abc: 0x000a, 0x1abd: 0x000a, 0x1abe: 0x000a, 0x1abf: 0x000a, // Block 0x6b, offset 0x1ac0 0x1ac0: 0x000a, 0x1ac1: 0x000a, 0x1ac2: 0x000a, 0x1ac3: 0x000a, 0x1ac4: 0x000a, 0x1ac5: 0x000a, 0x1ac6: 0x000a, 0x1ac7: 0x000a, 0x1ac8: 0x000a, 0x1ac9: 0x000a, 0x1aca: 0x000a, 0x1acb: 0x000a, 0x1acc: 0x000a, 0x1acd: 0x000a, 0x1ace: 0x000a, 0x1acf: 0x000a, 0x1ad0: 0x000a, 0x1ad1: 0x000a, 0x1ad2: 0x000a, 0x1ad3: 0x000a, 0x1ad4: 0x000a, 0x1ad5: 0x009a, 0x1ad6: 0x008a, 0x1ad7: 0x00ba, 0x1ad8: 0x00aa, 0x1ad9: 0x009a, 0x1ada: 0x008a, 0x1adb: 0x007a, 0x1adc: 0x006a, 0x1add: 0x000a, // Block 0x6c, offset 0x1b00 0x1b00: 0x000a, 0x1b01: 0x000a, 0x1b02: 0x000a, 0x1b03: 0x000a, 0x1b04: 0x000a, 0x1b05: 0x000a, 0x1b06: 0x000a, 0x1b07: 0x000a, 0x1b08: 0x000a, 0x1b09: 0x000a, 0x1b0a: 0x000a, 0x1b0b: 0x000a, 0x1b0c: 0x000a, 0x1b0d: 0x000a, 0x1b0e: 0x000a, 0x1b0f: 0x000a, 0x1b10: 0x000a, 0x1b11: 0x000a, 0x1b12: 0x000a, 0x1b13: 0x000a, 0x1b14: 0x000a, 0x1b15: 0x000a, 0x1b16: 0x000a, 0x1b17: 0x000a, 0x1b18: 0x000a, 0x1b19: 0x000a, 0x1b1b: 0x000a, 0x1b1c: 0x000a, 0x1b1d: 0x000a, 0x1b1e: 0x000a, 0x1b1f: 0x000a, 0x1b20: 0x000a, 0x1b21: 0x000a, 0x1b22: 0x000a, 0x1b23: 0x000a, 0x1b24: 0x000a, 0x1b25: 0x000a, 0x1b26: 0x000a, 0x1b27: 0x000a, 0x1b28: 0x000a, 0x1b29: 0x000a, 0x1b2a: 0x000a, 0x1b2b: 0x000a, 0x1b2c: 0x000a, 0x1b2d: 0x000a, 0x1b2e: 0x000a, 0x1b2f: 0x000a, 0x1b30: 0x000a, 0x1b31: 0x000a, 0x1b32: 0x000a, 0x1b33: 0x000a, 0x1b34: 0x000a, 0x1b35: 0x000a, 0x1b36: 0x000a, 0x1b37: 0x000a, 0x1b38: 0x000a, 0x1b39: 0x000a, 0x1b3a: 0x000a, 0x1b3b: 0x000a, 0x1b3c: 0x000a, 0x1b3d: 0x000a, 0x1b3e: 0x000a, 0x1b3f: 0x000a, // Block 0x6d, offset 0x1b40 0x1b40: 0x000a, 0x1b41: 0x000a, 0x1b42: 0x000a, 0x1b43: 0x000a, 0x1b44: 0x000a, 0x1b45: 0x000a, 0x1b46: 0x000a, 0x1b47: 0x000a, 0x1b48: 0x000a, 0x1b49: 0x000a, 0x1b4a: 0x000a, 0x1b4b: 0x000a, 0x1b4c: 0x000a, 0x1b4d: 0x000a, 0x1b4e: 0x000a, 0x1b4f: 0x000a, 0x1b50: 0x000a, 0x1b51: 0x000a, 0x1b52: 0x000a, 0x1b53: 0x000a, 0x1b54: 0x000a, 0x1b55: 0x000a, 0x1b56: 0x000a, 0x1b57: 0x000a, 0x1b58: 0x000a, 0x1b59: 0x000a, 0x1b5a: 0x000a, 0x1b5b: 0x000a, 0x1b5c: 0x000a, 0x1b5d: 0x000a, 0x1b5e: 0x000a, 0x1b5f: 0x000a, 0x1b60: 0x000a, 0x1b61: 0x000a, 0x1b62: 0x000a, 0x1b63: 0x000a, 0x1b64: 0x000a, 0x1b65: 0x000a, 0x1b66: 0x000a, 0x1b67: 0x000a, 0x1b68: 0x000a, 0x1b69: 0x000a, 0x1b6a: 0x000a, 0x1b6b: 0x000a, 0x1b6c: 0x000a, 0x1b6d: 0x000a, 0x1b6e: 0x000a, 0x1b6f: 0x000a, 0x1b70: 0x000a, 0x1b71: 0x000a, 0x1b72: 0x000a, 0x1b73: 0x000a, // Block 0x6e, offset 0x1b80 0x1b80: 0x000a, 0x1b81: 0x000a, 0x1b82: 0x000a, 0x1b83: 0x000a, 0x1b84: 0x000a, 0x1b85: 0x000a, 0x1b86: 0x000a, 0x1b87: 0x000a, 0x1b88: 0x000a, 0x1b89: 0x000a, 0x1b8a: 0x000a, 0x1b8b: 0x000a, 0x1b8c: 0x000a, 0x1b8d: 0x000a, 0x1b8e: 0x000a, 0x1b8f: 0x000a, 0x1b90: 0x000a, 0x1b91: 0x000a, 0x1b92: 0x000a, 0x1b93: 0x000a, 0x1b94: 0x000a, 0x1b95: 0x000a, 0x1bb0: 0x000a, 0x1bb1: 0x000a, 0x1bb2: 0x000a, 0x1bb3: 0x000a, 0x1bb4: 0x000a, 0x1bb5: 0x000a, 0x1bb6: 0x000a, 0x1bb7: 0x000a, 0x1bb8: 0x000a, 0x1bb9: 0x000a, 0x1bba: 0x000a, 0x1bbb: 0x000a, // Block 0x6f, offset 0x1bc0 0x1bc0: 0x0009, 0x1bc1: 0x000a, 0x1bc2: 0x000a, 0x1bc3: 0x000a, 0x1bc4: 0x000a, 0x1bc8: 0x003a, 0x1bc9: 0x002a, 0x1bca: 0x003a, 0x1bcb: 0x002a, 0x1bcc: 0x003a, 0x1bcd: 0x002a, 0x1bce: 0x003a, 0x1bcf: 0x002a, 0x1bd0: 0x003a, 0x1bd1: 0x002a, 0x1bd2: 0x000a, 0x1bd3: 0x000a, 0x1bd4: 0x003a, 0x1bd5: 0x002a, 0x1bd6: 0x003a, 0x1bd7: 0x002a, 0x1bd8: 0x003a, 0x1bd9: 0x002a, 0x1bda: 0x003a, 0x1bdb: 0x002a, 0x1bdc: 0x000a, 0x1bdd: 0x000a, 0x1bde: 0x000a, 0x1bdf: 0x000a, 0x1be0: 0x000a, 0x1bea: 0x000c, 0x1beb: 0x000c, 0x1bec: 0x000c, 0x1bed: 0x000c, 0x1bf0: 0x000a, 0x1bf6: 0x000a, 0x1bf7: 0x000a, 0x1bfd: 0x000a, 0x1bfe: 0x000a, 0x1bff: 0x000a, // Block 0x70, offset 0x1c00 0x1c19: 0x000c, 0x1c1a: 0x000c, 0x1c1b: 0x000a, 0x1c1c: 0x000a, 0x1c20: 0x000a, // Block 0x71, offset 0x1c40 0x1c7b: 0x000a, // Block 0x72, offset 0x1c80 0x1c80: 0x000a, 0x1c81: 0x000a, 0x1c82: 0x000a, 0x1c83: 0x000a, 0x1c84: 0x000a, 0x1c85: 0x000a, 0x1c86: 0x000a, 0x1c87: 0x000a, 0x1c88: 0x000a, 0x1c89: 0x000a, 0x1c8a: 0x000a, 0x1c8b: 0x000a, 0x1c8c: 0x000a, 0x1c8d: 0x000a, 0x1c8e: 0x000a, 0x1c8f: 0x000a, 0x1c90: 0x000a, 0x1c91: 0x000a, 0x1c92: 0x000a, 0x1c93: 0x000a, 0x1c94: 0x000a, 0x1c95: 0x000a, 0x1c96: 0x000a, 0x1c97: 0x000a, 0x1c98: 0x000a, 0x1c99: 0x000a, 0x1c9a: 0x000a, 0x1c9b: 0x000a, 0x1c9c: 0x000a, 0x1c9d: 0x000a, 0x1c9e: 0x000a, 0x1c9f: 0x000a, 0x1ca0: 0x000a, 0x1ca1: 0x000a, 0x1ca2: 0x000a, 0x1ca3: 0x000a, // Block 0x73, offset 0x1cc0 0x1cdd: 0x000a, 0x1cde: 0x000a, // Block 0x74, offset 0x1d00 0x1d10: 0x000a, 0x1d11: 0x000a, 0x1d12: 0x000a, 0x1d13: 0x000a, 0x1d14: 0x000a, 0x1d15: 0x000a, 0x1d16: 0x000a, 0x1d17: 0x000a, 0x1d18: 0x000a, 0x1d19: 0x000a, 0x1d1a: 0x000a, 0x1d1b: 0x000a, 0x1d1c: 0x000a, 0x1d1d: 0x000a, 0x1d1e: 0x000a, 0x1d1f: 0x000a, 0x1d3c: 0x000a, 0x1d3d: 0x000a, 0x1d3e: 0x000a, // Block 0x75, offset 0x1d40 0x1d71: 0x000a, 0x1d72: 0x000a, 0x1d73: 0x000a, 0x1d74: 0x000a, 0x1d75: 0x000a, 0x1d76: 0x000a, 0x1d77: 0x000a, 0x1d78: 0x000a, 0x1d79: 0x000a, 0x1d7a: 0x000a, 0x1d7b: 0x000a, 0x1d7c: 0x000a, 0x1d7d: 0x000a, 0x1d7e: 0x000a, 0x1d7f: 0x000a, // Block 0x76, offset 0x1d80 0x1d8c: 0x000a, 0x1d8d: 0x000a, 0x1d8e: 0x000a, 0x1d8f: 0x000a, // Block 0x77, offset 0x1dc0 0x1df7: 0x000a, 0x1df8: 0x000a, 0x1df9: 0x000a, 0x1dfa: 0x000a, // Block 0x78, offset 0x1e00 0x1e1e: 0x000a, 0x1e1f: 0x000a, 0x1e3f: 0x000a, // Block 0x79, offset 0x1e40 0x1e50: 0x000a, 0x1e51: 0x000a, 0x1e52: 0x000a, 0x1e53: 0x000a, 0x1e54: 0x000a, 0x1e55: 0x000a, 0x1e56: 0x000a, 0x1e57: 0x000a, 0x1e58: 0x000a, 0x1e59: 0x000a, 0x1e5a: 0x000a, 0x1e5b: 0x000a, 0x1e5c: 0x000a, 0x1e5d: 0x000a, 0x1e5e: 0x000a, 0x1e5f: 0x000a, 0x1e60: 0x000a, 0x1e61: 0x000a, 0x1e62: 0x000a, 0x1e63: 0x000a, 0x1e64: 0x000a, 0x1e65: 0x000a, 0x1e66: 0x000a, 0x1e67: 0x000a, 0x1e68: 0x000a, 0x1e69: 0x000a, 0x1e6a: 0x000a, 0x1e6b: 0x000a, 0x1e6c: 0x000a, 0x1e6d: 0x000a, 0x1e6e: 0x000a, 0x1e6f: 0x000a, 0x1e70: 0x000a, 0x1e71: 0x000a, 0x1e72: 0x000a, 0x1e73: 0x000a, 0x1e74: 0x000a, 0x1e75: 0x000a, 0x1e76: 0x000a, 0x1e77: 0x000a, 0x1e78: 0x000a, 0x1e79: 0x000a, 0x1e7a: 0x000a, 0x1e7b: 0x000a, 0x1e7c: 0x000a, 0x1e7d: 0x000a, 0x1e7e: 0x000a, 0x1e7f: 0x000a, // Block 0x7a, offset 0x1e80 0x1e80: 0x000a, 0x1e81: 0x000a, 0x1e82: 0x000a, 0x1e83: 0x000a, 0x1e84: 0x000a, 0x1e85: 0x000a, 0x1e86: 0x000a, // Block 0x7b, offset 0x1ec0 0x1ecd: 0x000a, 0x1ece: 0x000a, 0x1ecf: 0x000a, // Block 0x7c, offset 0x1f00 0x1f2f: 0x000c, 0x1f30: 0x000c, 0x1f31: 0x000c, 0x1f32: 0x000c, 0x1f33: 0x000a, 0x1f34: 0x000c, 0x1f35: 0x000c, 0x1f36: 0x000c, 0x1f37: 0x000c, 0x1f38: 0x000c, 0x1f39: 0x000c, 0x1f3a: 0x000c, 0x1f3b: 0x000c, 0x1f3c: 0x000c, 0x1f3d: 0x000c, 0x1f3e: 0x000a, 0x1f3f: 0x000a, // Block 0x7d, offset 0x1f40 0x1f5e: 0x000c, 0x1f5f: 0x000c, // Block 0x7e, offset 0x1f80 0x1fb0: 0x000c, 0x1fb1: 0x000c, // Block 0x7f, offset 0x1fc0 0x1fc0: 0x000a, 0x1fc1: 0x000a, 0x1fc2: 0x000a, 0x1fc3: 0x000a, 0x1fc4: 0x000a, 0x1fc5: 0x000a, 0x1fc6: 0x000a, 0x1fc7: 0x000a, 0x1fc8: 0x000a, 0x1fc9: 0x000a, 0x1fca: 0x000a, 0x1fcb: 0x000a, 0x1fcc: 0x000a, 0x1fcd: 0x000a, 0x1fce: 0x000a, 0x1fcf: 0x000a, 0x1fd0: 0x000a, 0x1fd1: 0x000a, 0x1fd2: 0x000a, 0x1fd3: 0x000a, 0x1fd4: 0x000a, 0x1fd5: 0x000a, 0x1fd6: 0x000a, 0x1fd7: 0x000a, 0x1fd8: 0x000a, 0x1fd9: 0x000a, 0x1fda: 0x000a, 0x1fdb: 0x000a, 0x1fdc: 0x000a, 0x1fdd: 0x000a, 0x1fde: 0x000a, 0x1fdf: 0x000a, 0x1fe0: 0x000a, 0x1fe1: 0x000a, // Block 0x80, offset 0x2000 0x2008: 0x000a, // Block 0x81, offset 0x2040 0x2042: 0x000c, 0x2046: 0x000c, 0x204b: 0x000c, 0x2065: 0x000c, 0x2066: 0x000c, 0x2068: 0x000a, 0x2069: 0x000a, 0x206a: 0x000a, 0x206b: 0x000a, 0x206c: 0x000c, 0x2078: 0x0004, 0x2079: 0x0004, // Block 0x82, offset 0x2080 0x20b4: 0x000a, 0x20b5: 0x000a, 0x20b6: 0x000a, 0x20b7: 0x000a, // Block 0x83, offset 0x20c0 0x20c4: 0x000c, 0x20c5: 0x000c, 0x20e0: 0x000c, 0x20e1: 0x000c, 0x20e2: 0x000c, 0x20e3: 0x000c, 0x20e4: 0x000c, 0x20e5: 0x000c, 0x20e6: 0x000c, 0x20e7: 0x000c, 0x20e8: 0x000c, 0x20e9: 0x000c, 0x20ea: 0x000c, 0x20eb: 0x000c, 0x20ec: 0x000c, 0x20ed: 0x000c, 0x20ee: 0x000c, 0x20ef: 0x000c, 0x20f0: 0x000c, 0x20f1: 0x000c, 0x20ff: 0x000c, // Block 0x84, offset 0x2100 0x2126: 0x000c, 0x2127: 0x000c, 0x2128: 0x000c, 0x2129: 0x000c, 0x212a: 0x000c, 0x212b: 0x000c, 0x212c: 0x000c, 0x212d: 0x000c, // Block 0x85, offset 0x2140 0x2147: 0x000c, 0x2148: 0x000c, 0x2149: 0x000c, 0x214a: 0x000c, 0x214b: 0x000c, 0x214c: 0x000c, 0x214d: 0x000c, 0x214e: 0x000c, 0x214f: 0x000c, 0x2150: 0x000c, 0x2151: 0x000c, // Block 0x86, offset 0x2180 0x2180: 0x000c, 0x2181: 0x000c, 0x2182: 0x000c, 0x21b3: 0x000c, 0x21b6: 0x000c, 0x21b7: 0x000c, 0x21b8: 0x000c, 0x21b9: 0x000c, 0x21bc: 0x000c, 0x21bd: 0x000c, // Block 0x87, offset 0x21c0 0x21e5: 0x000c, // Block 0x88, offset 0x2200 0x2229: 0x000c, 0x222a: 0x000c, 0x222b: 0x000c, 0x222c: 0x000c, 0x222d: 0x000c, 0x222e: 0x000c, 0x2231: 0x000c, 0x2232: 0x000c, 0x2235: 0x000c, 0x2236: 0x000c, // Block 0x89, offset 0x2240 0x2243: 0x000c, 0x224c: 0x000c, 0x227c: 0x000c, // Block 0x8a, offset 0x2280 0x22b0: 0x000c, 0x22b2: 0x000c, 0x22b3: 0x000c, 0x22b4: 0x000c, 0x22b7: 0x000c, 0x22b8: 0x000c, 0x22be: 0x000c, 0x22bf: 0x000c, // Block 0x8b, offset 0x22c0 0x22c1: 0x000c, 0x22ec: 0x000c, 0x22ed: 0x000c, 0x22f6: 0x000c, // Block 0x8c, offset 0x2300 0x232a: 0x000a, 0x232b: 0x000a, // Block 0x8d, offset 0x2340 0x2365: 0x000c, 0x2368: 0x000c, 0x236d: 0x000c, // Block 0x8e, offset 0x2380 0x239d: 0x0001, 0x239e: 0x000c, 0x239f: 0x0001, 0x23a0: 0x0001, 0x23a1: 0x0001, 0x23a2: 0x0001, 0x23a3: 0x0001, 0x23a4: 0x0001, 0x23a5: 0x0001, 0x23a6: 0x0001, 0x23a7: 0x0001, 0x23a8: 0x0001, 0x23a9: 0x0003, 0x23aa: 0x0001, 0x23ab: 0x0001, 0x23ac: 0x0001, 0x23ad: 0x0001, 0x23ae: 0x0001, 0x23af: 0x0001, 0x23b0: 0x0001, 0x23b1: 0x0001, 0x23b2: 0x0001, 0x23b3: 0x0001, 0x23b4: 0x0001, 0x23b5: 0x0001, 0x23b6: 0x0001, 0x23b7: 0x0001, 0x23b8: 0x0001, 0x23b9: 0x0001, 0x23ba: 0x0001, 0x23bb: 0x0001, 0x23bc: 0x0001, 0x23bd: 0x0001, 0x23be: 0x0001, 0x23bf: 0x0001, // Block 0x8f, offset 0x23c0 0x23c0: 0x0001, 0x23c1: 0x0001, 0x23c2: 0x0001, 0x23c3: 0x0001, 0x23c4: 0x0001, 0x23c5: 0x0001, 0x23c6: 0x0001, 0x23c7: 0x0001, 0x23c8: 0x0001, 0x23c9: 0x0001, 0x23ca: 0x0001, 0x23cb: 0x0001, 0x23cc: 0x0001, 0x23cd: 0x0001, 0x23ce: 0x0001, 0x23cf: 0x0001, 0x23d0: 0x000d, 0x23d1: 0x000d, 0x23d2: 0x000d, 0x23d3: 0x000d, 0x23d4: 0x000d, 0x23d5: 0x000d, 0x23d6: 0x000d, 0x23d7: 0x000d, 0x23d8: 0x000d, 0x23d9: 0x000d, 0x23da: 0x000d, 0x23db: 0x000d, 0x23dc: 0x000d, 0x23dd: 0x000d, 0x23de: 0x000d, 0x23df: 0x000d, 0x23e0: 0x000d, 0x23e1: 0x000d, 0x23e2: 0x000d, 0x23e3: 0x000d, 0x23e4: 0x000d, 0x23e5: 0x000d, 0x23e6: 0x000d, 0x23e7: 0x000d, 0x23e8: 0x000d, 0x23e9: 0x000d, 0x23ea: 0x000d, 0x23eb: 0x000d, 0x23ec: 0x000d, 0x23ed: 0x000d, 0x23ee: 0x000d, 0x23ef: 0x000d, 0x23f0: 0x000d, 0x23f1: 0x000d, 0x23f2: 0x000d, 0x23f3: 0x000d, 0x23f4: 0x000d, 0x23f5: 0x000d, 0x23f6: 0x000d, 0x23f7: 0x000d, 0x23f8: 0x000d, 0x23f9: 0x000d, 0x23fa: 0x000d, 0x23fb: 0x000d, 0x23fc: 0x000d, 0x23fd: 0x000d, 0x23fe: 0x000d, 0x23ff: 0x000d, // Block 0x90, offset 0x2400 0x2400: 0x000d, 0x2401: 0x000d, 0x2402: 0x000d, 0x2403: 0x000d, 0x2404: 0x000d, 0x2405: 0x000d, 0x2406: 0x000d, 0x2407: 0x000d, 0x2408: 0x000d, 0x2409: 0x000d, 0x240a: 0x000d, 0x240b: 0x000d, 0x240c: 0x000d, 0x240d: 0x000d, 0x240e: 0x000d, 0x240f: 0x000d, 0x2410: 0x000d, 0x2411: 0x000d, 0x2412: 0x000d, 0x2413: 0x000d, 0x2414: 0x000d, 0x2415: 0x000d, 0x2416: 0x000d, 0x2417: 0x000d, 0x2418: 0x000d, 0x2419: 0x000d, 0x241a: 0x000d, 0x241b: 0x000d, 0x241c: 0x000d, 0x241d: 0x000d, 0x241e: 0x000d, 0x241f: 0x000d, 0x2420: 0x000d, 0x2421: 0x000d, 0x2422: 0x000d, 0x2423: 0x000d, 0x2424: 0x000d, 0x2425: 0x000d, 0x2426: 0x000d, 0x2427: 0x000d, 0x2428: 0x000d, 0x2429: 0x000d, 0x242a: 0x000d, 0x242b: 0x000d, 0x242c: 0x000d, 0x242d: 0x000d, 0x242e: 0x000d, 0x242f: 0x000d, 0x2430: 0x000d, 0x2431: 0x000d, 0x2432: 0x000d, 0x2433: 0x000d, 0x2434: 0x000d, 0x2435: 0x000d, 0x2436: 0x000d, 0x2437: 0x000d, 0x2438: 0x000d, 0x2439: 0x000d, 0x243a: 0x000d, 0x243b: 0x000d, 0x243c: 0x000d, 0x243d: 0x000d, 0x243e: 0x000a, 0x243f: 0x000a, // Block 0x91, offset 0x2440 0x2440: 0x000a, 0x2441: 0x000a, 0x2442: 0x000a, 0x2443: 0x000a, 0x2444: 0x000a, 0x2445: 0x000a, 0x2446: 0x000a, 0x2447: 0x000a, 0x2448: 0x000a, 0x2449: 0x000a, 0x244a: 0x000a, 0x244b: 0x000a, 0x244c: 0x000a, 0x244d: 0x000a, 0x244e: 0x000a, 0x244f: 0x000a, 0x2450: 0x000d, 0x2451: 0x000d, 0x2452: 0x000d, 0x2453: 0x000d, 0x2454: 0x000d, 0x2455: 0x000d, 0x2456: 0x000d, 0x2457: 0x000d, 0x2458: 0x000d, 0x2459: 0x000d, 0x245a: 0x000d, 0x245b: 0x000d, 0x245c: 0x000d, 0x245d: 0x000d, 0x245e: 0x000d, 0x245f: 0x000d, 0x2460: 0x000d, 0x2461: 0x000d, 0x2462: 0x000d, 0x2463: 0x000d, 0x2464: 0x000d, 0x2465: 0x000d, 0x2466: 0x000d, 0x2467: 0x000d, 0x2468: 0x000d, 0x2469: 0x000d, 0x246a: 0x000d, 0x246b: 0x000d, 0x246c: 0x000d, 0x246d: 0x000d, 0x246e: 0x000d, 0x246f: 0x000d, 0x2470: 0x000d, 0x2471: 0x000d, 0x2472: 0x000d, 0x2473: 0x000d, 0x2474: 0x000d, 0x2475: 0x000d, 0x2476: 0x000d, 0x2477: 0x000d, 0x2478: 0x000d, 0x2479: 0x000d, 0x247a: 0x000d, 0x247b: 0x000d, 0x247c: 0x000d, 0x247d: 0x000d, 0x247e: 0x000d, 0x247f: 0x000d, // Block 0x92, offset 0x2480 0x2480: 0x000d, 0x2481: 0x000d, 0x2482: 0x000d, 0x2483: 0x000d, 0x2484: 0x000d, 0x2485: 0x000d, 0x2486: 0x000d, 0x2487: 0x000d, 0x2488: 0x000d, 0x2489: 0x000d, 0x248a: 0x000d, 0x248b: 0x000d, 0x248c: 0x000d, 0x248d: 0x000d, 0x248e: 0x000d, 0x248f: 0x000a, 0x2490: 0x000b, 0x2491: 0x000b, 0x2492: 0x000b, 0x2493: 0x000b, 0x2494: 0x000b, 0x2495: 0x000b, 0x2496: 0x000b, 0x2497: 0x000b, 0x2498: 0x000b, 0x2499: 0x000b, 0x249a: 0x000b, 0x249b: 0x000b, 0x249c: 0x000b, 0x249d: 0x000b, 0x249e: 0x000b, 0x249f: 0x000b, 0x24a0: 0x000b, 0x24a1: 0x000b, 0x24a2: 0x000b, 0x24a3: 0x000b, 0x24a4: 0x000b, 0x24a5: 0x000b, 0x24a6: 0x000b, 0x24a7: 0x000b, 0x24a8: 0x000b, 0x24a9: 0x000b, 0x24aa: 0x000b, 0x24ab: 0x000b, 0x24ac: 0x000b, 0x24ad: 0x000b, 0x24ae: 0x000b, 0x24af: 0x000b, 0x24b0: 0x000d, 0x24b1: 0x000d, 0x24b2: 0x000d, 0x24b3: 0x000d, 0x24b4: 0x000d, 0x24b5: 0x000d, 0x24b6: 0x000d, 0x24b7: 0x000d, 0x24b8: 0x000d, 0x24b9: 0x000d, 0x24ba: 0x000d, 0x24bb: 0x000d, 0x24bc: 0x000d, 0x24bd: 0x000a, 0x24be: 0x000a, 0x24bf: 0x000a, // Block 0x93, offset 0x24c0 0x24c0: 0x000c, 0x24c1: 0x000c, 0x24c2: 0x000c, 0x24c3: 0x000c, 0x24c4: 0x000c, 0x24c5: 0x000c, 0x24c6: 0x000c, 0x24c7: 0x000c, 0x24c8: 0x000c, 0x24c9: 0x000c, 0x24ca: 0x000c, 0x24cb: 0x000c, 0x24cc: 0x000c, 0x24cd: 0x000c, 0x24ce: 0x000c, 0x24cf: 0x000c, 0x24d0: 0x000a, 0x24d1: 0x000a, 0x24d2: 0x000a, 0x24d3: 0x000a, 0x24d4: 0x000a, 0x24d5: 0x000a, 0x24d6: 0x000a, 0x24d7: 0x000a, 0x24d8: 0x000a, 0x24d9: 0x000a, 0x24e0: 0x000c, 0x24e1: 0x000c, 0x24e2: 0x000c, 0x24e3: 0x000c, 0x24e4: 0x000c, 0x24e5: 0x000c, 0x24e6: 0x000c, 0x24e7: 0x000c, 0x24e8: 0x000c, 0x24e9: 0x000c, 0x24ea: 0x000c, 0x24eb: 0x000c, 0x24ec: 0x000c, 0x24ed: 0x000c, 0x24ee: 0x000c, 0x24ef: 0x000c, 0x24f0: 0x000a, 0x24f1: 0x000a, 0x24f2: 0x000a, 0x24f3: 0x000a, 0x24f4: 0x000a, 0x24f5: 0x000a, 0x24f6: 0x000a, 0x24f7: 0x000a, 0x24f8: 0x000a, 0x24f9: 0x000a, 0x24fa: 0x000a, 0x24fb: 0x000a, 0x24fc: 0x000a, 0x24fd: 0x000a, 0x24fe: 0x000a, 0x24ff: 0x000a, // Block 0x94, offset 0x2500 0x2500: 0x000a, 0x2501: 0x000a, 0x2502: 0x000a, 0x2503: 0x000a, 0x2504: 0x000a, 0x2505: 0x000a, 0x2506: 0x000a, 0x2507: 0x000a, 0x2508: 0x000a, 0x2509: 0x000a, 0x250a: 0x000a, 0x250b: 0x000a, 0x250c: 0x000a, 0x250d: 0x000a, 0x250e: 0x000a, 0x250f: 0x000a, 0x2510: 0x0006, 0x2511: 0x000a, 0x2512: 0x0006, 0x2514: 0x000a, 0x2515: 0x0006, 0x2516: 0x000a, 0x2517: 0x000a, 0x2518: 0x000a, 0x2519: 0x009a, 0x251a: 0x008a, 0x251b: 0x007a, 0x251c: 0x006a, 0x251d: 0x009a, 0x251e: 0x008a, 0x251f: 0x0004, 0x2520: 0x000a, 0x2521: 0x000a, 0x2522: 0x0003, 0x2523: 0x0003, 0x2524: 0x000a, 0x2525: 0x000a, 0x2526: 0x000a, 0x2528: 0x000a, 0x2529: 0x0004, 0x252a: 0x0004, 0x252b: 0x000a, 0x2530: 0x000d, 0x2531: 0x000d, 0x2532: 0x000d, 0x2533: 0x000d, 0x2534: 0x000d, 0x2535: 0x000d, 0x2536: 0x000d, 0x2537: 0x000d, 0x2538: 0x000d, 0x2539: 0x000d, 0x253a: 0x000d, 0x253b: 0x000d, 0x253c: 0x000d, 0x253d: 0x000d, 0x253e: 0x000d, 0x253f: 0x000d, // Block 0x95, offset 0x2540 0x2540: 0x000d, 0x2541: 0x000d, 0x2542: 0x000d, 0x2543: 0x000d, 0x2544: 0x000d, 0x2545: 0x000d, 0x2546: 0x000d, 0x2547: 0x000d, 0x2548: 0x000d, 0x2549: 0x000d, 0x254a: 0x000d, 0x254b: 0x000d, 0x254c: 0x000d, 0x254d: 0x000d, 0x254e: 0x000d, 0x254f: 0x000d, 0x2550: 0x000d, 0x2551: 0x000d, 0x2552: 0x000d, 0x2553: 0x000d, 0x2554: 0x000d, 0x2555: 0x000d, 0x2556: 0x000d, 0x2557: 0x000d, 0x2558: 0x000d, 0x2559: 0x000d, 0x255a: 0x000d, 0x255b: 0x000d, 0x255c: 0x000d, 0x255d: 0x000d, 0x255e: 0x000d, 0x255f: 0x000d, 0x2560: 0x000d, 0x2561: 0x000d, 0x2562: 0x000d, 0x2563: 0x000d, 0x2564: 0x000d, 0x2565: 0x000d, 0x2566: 0x000d, 0x2567: 0x000d, 0x2568: 0x000d, 0x2569: 0x000d, 0x256a: 0x000d, 0x256b: 0x000d, 0x256c: 0x000d, 0x256d: 0x000d, 0x256e: 0x000d, 0x256f: 0x000d, 0x2570: 0x000d, 0x2571: 0x000d, 0x2572: 0x000d, 0x2573: 0x000d, 0x2574: 0x000d, 0x2575: 0x000d, 0x2576: 0x000d, 0x2577: 0x000d, 0x2578: 0x000d, 0x2579: 0x000d, 0x257a: 0x000d, 0x257b: 0x000d, 0x257c: 0x000d, 0x257d: 0x000d, 0x257e: 0x000d, 0x257f: 0x000b, // Block 0x96, offset 0x2580 0x2581: 0x000a, 0x2582: 0x000a, 0x2583: 0x0004, 0x2584: 0x0004, 0x2585: 0x0004, 0x2586: 0x000a, 0x2587: 0x000a, 0x2588: 0x003a, 0x2589: 0x002a, 0x258a: 0x000a, 0x258b: 0x0003, 0x258c: 0x0006, 0x258d: 0x0003, 0x258e: 0x0006, 0x258f: 0x0006, 0x2590: 0x0002, 0x2591: 0x0002, 0x2592: 0x0002, 0x2593: 0x0002, 0x2594: 0x0002, 0x2595: 0x0002, 0x2596: 0x0002, 0x2597: 0x0002, 0x2598: 0x0002, 0x2599: 0x0002, 0x259a: 0x0006, 0x259b: 0x000a, 0x259c: 0x000a, 0x259d: 0x000a, 0x259e: 0x000a, 0x259f: 0x000a, 0x25a0: 0x000a, 0x25bb: 0x005a, 0x25bc: 0x000a, 0x25bd: 0x004a, 0x25be: 0x000a, 0x25bf: 0x000a, // Block 0x97, offset 0x25c0 0x25c0: 0x000a, 0x25db: 0x005a, 0x25dc: 0x000a, 0x25dd: 0x004a, 0x25de: 0x000a, 0x25df: 0x00fa, 0x25e0: 0x00ea, 0x25e1: 0x000a, 0x25e2: 0x003a, 0x25e3: 0x002a, 0x25e4: 0x000a, 0x25e5: 0x000a, // Block 0x98, offset 0x2600 0x2620: 0x0004, 0x2621: 0x0004, 0x2622: 0x000a, 0x2623: 0x000a, 0x2624: 0x000a, 0x2625: 0x0004, 0x2626: 0x0004, 0x2628: 0x000a, 0x2629: 0x000a, 0x262a: 0x000a, 0x262b: 0x000a, 0x262c: 0x000a, 0x262d: 0x000a, 0x262e: 0x000a, 0x2630: 0x000b, 0x2631: 0x000b, 0x2632: 0x000b, 0x2633: 0x000b, 0x2634: 0x000b, 0x2635: 0x000b, 0x2636: 0x000b, 0x2637: 0x000b, 0x2638: 0x000b, 0x2639: 0x000a, 0x263a: 0x000a, 0x263b: 0x000a, 0x263c: 0x000a, 0x263d: 0x000a, 0x263e: 0x000b, 0x263f: 0x000b, // Block 0x99, offset 0x2640 0x2641: 0x000a, // Block 0x9a, offset 0x2680 0x2680: 0x000a, 0x2681: 0x000a, 0x2682: 0x000a, 0x2683: 0x000a, 0x2684: 0x000a, 0x2685: 0x000a, 0x2686: 0x000a, 0x2687: 0x000a, 0x2688: 0x000a, 0x2689: 0x000a, 0x268a: 0x000a, 0x268b: 0x000a, 0x268c: 0x000a, 0x2690: 0x000a, 0x2691: 0x000a, 0x2692: 0x000a, 0x2693: 0x000a, 0x2694: 0x000a, 0x2695: 0x000a, 0x2696: 0x000a, 0x2697: 0x000a, 0x2698: 0x000a, 0x2699: 0x000a, 0x269a: 0x000a, 0x269b: 0x000a, 0x269c: 0x000a, 0x26a0: 0x000a, // Block 0x9b, offset 0x26c0 0x26fd: 0x000c, // Block 0x9c, offset 0x2700 0x2720: 0x000c, 0x2721: 0x0002, 0x2722: 0x0002, 0x2723: 0x0002, 0x2724: 0x0002, 0x2725: 0x0002, 0x2726: 0x0002, 0x2727: 0x0002, 0x2728: 0x0002, 0x2729: 0x0002, 0x272a: 0x0002, 0x272b: 0x0002, 0x272c: 0x0002, 0x272d: 0x0002, 0x272e: 0x0002, 0x272f: 0x0002, 0x2730: 0x0002, 0x2731: 0x0002, 0x2732: 0x0002, 0x2733: 0x0002, 0x2734: 0x0002, 0x2735: 0x0002, 0x2736: 0x0002, 0x2737: 0x0002, 0x2738: 0x0002, 0x2739: 0x0002, 0x273a: 0x0002, 0x273b: 0x0002, // Block 0x9d, offset 0x2740 0x2776: 0x000c, 0x2777: 0x000c, 0x2778: 0x000c, 0x2779: 0x000c, 0x277a: 0x000c, // Block 0x9e, offset 0x2780 0x2780: 0x0001, 0x2781: 0x0001, 0x2782: 0x0001, 0x2783: 0x0001, 0x2784: 0x0001, 0x2785: 0x0001, 0x2786: 0x0001, 0x2787: 0x0001, 0x2788: 0x0001, 0x2789: 0x0001, 0x278a: 0x0001, 0x278b: 0x0001, 0x278c: 0x0001, 0x278d: 0x0001, 0x278e: 0x0001, 0x278f: 0x0001, 0x2790: 0x0001, 0x2791: 0x0001, 0x2792: 0x0001, 0x2793: 0x0001, 0x2794: 0x0001, 0x2795: 0x0001, 0x2796: 0x0001, 0x2797: 0x0001, 0x2798: 0x0001, 0x2799: 0x0001, 0x279a: 0x0001, 0x279b: 0x0001, 0x279c: 0x0001, 0x279d: 0x0001, 0x279e: 0x0001, 0x279f: 0x0001, 0x27a0: 0x0001, 0x27a1: 0x0001, 0x27a2: 0x0001, 0x27a3: 0x0001, 0x27a4: 0x0001, 0x27a5: 0x0001, 0x27a6: 0x0001, 0x27a7: 0x0001, 0x27a8: 0x0001, 0x27a9: 0x0001, 0x27aa: 0x0001, 0x27ab: 0x0001, 0x27ac: 0x0001, 0x27ad: 0x0001, 0x27ae: 0x0001, 0x27af: 0x0001, 0x27b0: 0x0001, 0x27b1: 0x0001, 0x27b2: 0x0001, 0x27b3: 0x0001, 0x27b4: 0x0001, 0x27b5: 0x0001, 0x27b6: 0x0001, 0x27b7: 0x0001, 0x27b8: 0x0001, 0x27b9: 0x0001, 0x27ba: 0x0001, 0x27bb: 0x0001, 0x27bc: 0x0001, 0x27bd: 0x0001, 0x27be: 0x0001, 0x27bf: 0x0001, // Block 0x9f, offset 0x27c0 0x27c0: 0x0001, 0x27c1: 0x0001, 0x27c2: 0x0001, 0x27c3: 0x0001, 0x27c4: 0x0001, 0x27c5: 0x0001, 0x27c6: 0x0001, 0x27c7: 0x0001, 0x27c8: 0x0001, 0x27c9: 0x0001, 0x27ca: 0x0001, 0x27cb: 0x0001, 0x27cc: 0x0001, 0x27cd: 0x0001, 0x27ce: 0x0001, 0x27cf: 0x0001, 0x27d0: 0x0001, 0x27d1: 0x0001, 0x27d2: 0x0001, 0x27d3: 0x0001, 0x27d4: 0x0001, 0x27d5: 0x0001, 0x27d6: 0x0001, 0x27d7: 0x0001, 0x27d8: 0x0001, 0x27d9: 0x0001, 0x27da: 0x0001, 0x27db: 0x0001, 0x27dc: 0x0001, 0x27dd: 0x0001, 0x27de: 0x0001, 0x27df: 0x000a, 0x27e0: 0x0001, 0x27e1: 0x0001, 0x27e2: 0x0001, 0x27e3: 0x0001, 0x27e4: 0x0001, 0x27e5: 0x0001, 0x27e6: 0x0001, 0x27e7: 0x0001, 0x27e8: 0x0001, 0x27e9: 0x0001, 0x27ea: 0x0001, 0x27eb: 0x0001, 0x27ec: 0x0001, 0x27ed: 0x0001, 0x27ee: 0x0001, 0x27ef: 0x0001, 0x27f0: 0x0001, 0x27f1: 0x0001, 0x27f2: 0x0001, 0x27f3: 0x0001, 0x27f4: 0x0001, 0x27f5: 0x0001, 0x27f6: 0x0001, 0x27f7: 0x0001, 0x27f8: 0x0001, 0x27f9: 0x0001, 0x27fa: 0x0001, 0x27fb: 0x0001, 0x27fc: 0x0001, 0x27fd: 0x0001, 0x27fe: 0x0001, 0x27ff: 0x0001, // Block 0xa0, offset 0x2800 0x2800: 0x0001, 0x2801: 0x000c, 0x2802: 0x000c, 0x2803: 0x000c, 0x2804: 0x0001, 0x2805: 0x000c, 0x2806: 0x000c, 0x2807: 0x0001, 0x2808: 0x0001, 0x2809: 0x0001, 0x280a: 0x0001, 0x280b: 0x0001, 0x280c: 0x000c, 0x280d: 0x000c, 0x280e: 0x000c, 0x280f: 0x000c, 0x2810: 0x0001, 0x2811: 0x0001, 0x2812: 0x0001, 0x2813: 0x0001, 0x2814: 0x0001, 0x2815: 0x0001, 0x2816: 0x0001, 0x2817: 0x0001, 0x2818: 0x0001, 0x2819: 0x0001, 0x281a: 0x0001, 0x281b: 0x0001, 0x281c: 0x0001, 0x281d: 0x0001, 0x281e: 0x0001, 0x281f: 0x0001, 0x2820: 0x0001, 0x2821: 0x0001, 0x2822: 0x0001, 0x2823: 0x0001, 0x2824: 0x0001, 0x2825: 0x0001, 0x2826: 0x0001, 0x2827: 0x0001, 0x2828: 0x0001, 0x2829: 0x0001, 0x282a: 0x0001, 0x282b: 0x0001, 0x282c: 0x0001, 0x282d: 0x0001, 0x282e: 0x0001, 0x282f: 0x0001, 0x2830: 0x0001, 0x2831: 0x0001, 0x2832: 0x0001, 0x2833: 0x0001, 0x2834: 0x0001, 0x2835: 0x0001, 0x2836: 0x0001, 0x2837: 0x0001, 0x2838: 0x000c, 0x2839: 0x000c, 0x283a: 0x000c, 0x283b: 0x0001, 0x283c: 0x0001, 0x283d: 0x0001, 0x283e: 0x0001, 0x283f: 0x000c, // Block 0xa1, offset 0x2840 0x2840: 0x0001, 0x2841: 0x0001, 0x2842: 0x0001, 0x2843: 0x0001, 0x2844: 0x0001, 0x2845: 0x0001, 0x2846: 0x0001, 0x2847: 0x0001, 0x2848: 0x0001, 0x2849: 0x0001, 0x284a: 0x0001, 0x284b: 0x0001, 0x284c: 0x0001, 0x284d: 0x0001, 0x284e: 0x0001, 0x284f: 0x0001, 0x2850: 0x0001, 0x2851: 0x0001, 0x2852: 0x0001, 0x2853: 0x0001, 0x2854: 0x0001, 0x2855: 0x0001, 0x2856: 0x0001, 0x2857: 0x0001, 0x2858: 0x0001, 0x2859: 0x0001, 0x285a: 0x0001, 0x285b: 0x0001, 0x285c: 0x0001, 0x285d: 0x0001, 0x285e: 0x0001, 0x285f: 0x0001, 0x2860: 0x0001, 0x2861: 0x0001, 0x2862: 0x0001, 0x2863: 0x0001, 0x2864: 0x0001, 0x2865: 0x000c, 0x2866: 0x000c, 0x2867: 0x0001, 0x2868: 0x0001, 0x2869: 0x0001, 0x286a: 0x0001, 0x286b: 0x0001, 0x286c: 0x0001, 0x286d: 0x0001, 0x286e: 0x0001, 0x286f: 0x0001, 0x2870: 0x0001, 0x2871: 0x0001, 0x2872: 0x0001, 0x2873: 0x0001, 0x2874: 0x0001, 0x2875: 0x0001, 0x2876: 0x0001, 0x2877: 0x0001, 0x2878: 0x0001, 0x2879: 0x0001, 0x287a: 0x0001, 0x287b: 0x0001, 0x287c: 0x0001, 0x287d: 0x0001, 0x287e: 0x0001, 0x287f: 0x0001, // Block 0xa2, offset 0x2880 0x2880: 0x0001, 0x2881: 0x0001, 0x2882: 0x0001, 0x2883: 0x0001, 0x2884: 0x0001, 0x2885: 0x0001, 0x2886: 0x0001, 0x2887: 0x0001, 0x2888: 0x0001, 0x2889: 0x0001, 0x288a: 0x0001, 0x288b: 0x0001, 0x288c: 0x0001, 0x288d: 0x0001, 0x288e: 0x0001, 0x288f: 0x0001, 0x2890: 0x0001, 0x2891: 0x0001, 0x2892: 0x0001, 0x2893: 0x0001, 0x2894: 0x0001, 0x2895: 0x0001, 0x2896: 0x0001, 0x2897: 0x0001, 0x2898: 0x0001, 0x2899: 0x0001, 0x289a: 0x0001, 0x289b: 0x0001, 0x289c: 0x0001, 0x289d: 0x0001, 0x289e: 0x0001, 0x289f: 0x0001, 0x28a0: 0x0001, 0x28a1: 0x0001, 0x28a2: 0x0001, 0x28a3: 0x0001, 0x28a4: 0x0001, 0x28a5: 0x0001, 0x28a6: 0x0001, 0x28a7: 0x0001, 0x28a8: 0x0001, 0x28a9: 0x0001, 0x28aa: 0x0001, 0x28ab: 0x0001, 0x28ac: 0x0001, 0x28ad: 0x0001, 0x28ae: 0x0001, 0x28af: 0x0001, 0x28b0: 0x0001, 0x28b1: 0x0001, 0x28b2: 0x0001, 0x28b3: 0x0001, 0x28b4: 0x0001, 0x28b5: 0x0001, 0x28b6: 0x0001, 0x28b7: 0x0001, 0x28b8: 0x0001, 0x28b9: 0x000a, 0x28ba: 0x000a, 0x28bb: 0x000a, 0x28bc: 0x000a, 0x28bd: 0x000a, 0x28be: 0x000a, 0x28bf: 0x000a, // Block 0xa3, offset 0x28c0 0x28c0: 0x000d, 0x28c1: 0x000d, 0x28c2: 0x000d, 0x28c3: 0x000d, 0x28c4: 0x000d, 0x28c5: 0x000d, 0x28c6: 0x000d, 0x28c7: 0x000d, 0x28c8: 0x000d, 0x28c9: 0x000d, 0x28ca: 0x000d, 0x28cb: 0x000d, 0x28cc: 0x000d, 0x28cd: 0x000d, 0x28ce: 0x000d, 0x28cf: 0x000d, 0x28d0: 0x000d, 0x28d1: 0x000d, 0x28d2: 0x000d, 0x28d3: 0x000d, 0x28d4: 0x000d, 0x28d5: 0x000d, 0x28d6: 0x000d, 0x28d7: 0x000d, 0x28d8: 0x000d, 0x28d9: 0x000d, 0x28da: 0x000d, 0x28db: 0x000d, 0x28dc: 0x000d, 0x28dd: 0x000d, 0x28de: 0x000d, 0x28df: 0x000d, 0x28e0: 0x000d, 0x28e1: 0x000d, 0x28e2: 0x000d, 0x28e3: 0x000d, 0x28e4: 0x000c, 0x28e5: 0x000c, 0x28e6: 0x000c, 0x28e7: 0x000c, 0x28e8: 0x0001, 0x28e9: 0x0001, 0x28ea: 0x0001, 0x28eb: 0x0001, 0x28ec: 0x0001, 0x28ed: 0x0001, 0x28ee: 0x0001, 0x28ef: 0x0001, 0x28f0: 0x0005, 0x28f1: 0x0005, 0x28f2: 0x0005, 0x28f3: 0x0005, 0x28f4: 0x0005, 0x28f5: 0x0005, 0x28f6: 0x0005, 0x28f7: 0x0005, 0x28f8: 0x0005, 0x28f9: 0x0005, 0x28fa: 0x0001, 0x28fb: 0x0001, 0x28fc: 0x0001, 0x28fd: 0x0001, 0x28fe: 0x0001, 0x28ff: 0x0001, // Block 0xa4, offset 0x2900 0x2900: 0x0001, 0x2901: 0x0001, 0x2902: 0x0001, 0x2903: 0x0001, 0x2904: 0x0001, 0x2905: 0x0001, 0x2906: 0x0001, 0x2907: 0x0001, 0x2908: 0x0001, 0x2909: 0x0001, 0x290a: 0x0001, 0x290b: 0x0001, 0x290c: 0x0001, 0x290d: 0x0001, 0x290e: 0x0001, 0x290f: 0x0001, 0x2910: 0x0001, 0x2911: 0x0001, 0x2912: 0x0001, 0x2913: 0x0001, 0x2914: 0x0001, 0x2915: 0x0001, 0x2916: 0x0001, 0x2917: 0x0001, 0x2918: 0x0001, 0x2919: 0x0001, 0x291a: 0x0001, 0x291b: 0x0001, 0x291c: 0x0001, 0x291d: 0x0001, 0x291e: 0x0001, 0x291f: 0x0001, 0x2920: 0x0005, 0x2921: 0x0005, 0x2922: 0x0005, 0x2923: 0x0005, 0x2924: 0x0005, 0x2925: 0x0005, 0x2926: 0x0005, 0x2927: 0x0005, 0x2928: 0x0005, 0x2929: 0x0005, 0x292a: 0x0005, 0x292b: 0x0005, 0x292c: 0x0005, 0x292d: 0x0005, 0x292e: 0x0005, 0x292f: 0x0005, 0x2930: 0x0005, 0x2931: 0x0005, 0x2932: 0x0005, 0x2933: 0x0005, 0x2934: 0x0005, 0x2935: 0x0005, 0x2936: 0x0005, 0x2937: 0x0005, 0x2938: 0x0005, 0x2939: 0x0005, 0x293a: 0x0005, 0x293b: 0x0005, 0x293c: 0x0005, 0x293d: 0x0005, 0x293e: 0x0005, 0x293f: 0x0001, // Block 0xa5, offset 0x2940 0x2940: 0x0001, 0x2941: 0x0001, 0x2942: 0x0001, 0x2943: 0x0001, 0x2944: 0x0001, 0x2945: 0x0001, 0x2946: 0x0001, 0x2947: 0x0001, 0x2948: 0x0001, 0x2949: 0x0001, 0x294a: 0x0001, 0x294b: 0x0001, 0x294c: 0x0001, 0x294d: 0x0001, 0x294e: 0x0001, 0x294f: 0x0001, 0x2950: 0x0001, 0x2951: 0x0001, 0x2952: 0x0001, 0x2953: 0x0001, 0x2954: 0x0001, 0x2955: 0x0001, 0x2956: 0x0001, 0x2957: 0x0001, 0x2958: 0x0001, 0x2959: 0x0001, 0x295a: 0x0001, 0x295b: 0x0001, 0x295c: 0x0001, 0x295d: 0x0001, 0x295e: 0x0001, 0x295f: 0x0001, 0x2960: 0x0001, 0x2961: 0x0001, 0x2962: 0x0001, 0x2963: 0x0001, 0x2964: 0x0001, 0x2965: 0x0001, 0x2966: 0x0001, 0x2967: 0x0001, 0x2968: 0x0001, 0x2969: 0x0001, 0x296a: 0x0001, 0x296b: 0x000c, 0x296c: 0x000c, 0x296d: 0x0001, 0x296e: 0x0001, 0x296f: 0x0001, 0x2970: 0x0001, 0x2971: 0x0001, 0x2972: 0x0001, 0x2973: 0x0001, 0x2974: 0x0001, 0x2975: 0x0001, 0x2976: 0x0001, 0x2977: 0x0001, 0x2978: 0x0001, 0x2979: 0x0001, 0x297a: 0x0001, 0x297b: 0x0001, 0x297c: 0x0001, 0x297d: 0x0001, 0x297e: 0x0001, 0x297f: 0x0001, // Block 0xa6, offset 0x2980 0x2980: 0x0001, 0x2981: 0x0001, 0x2982: 0x0001, 0x2983: 0x0001, 0x2984: 0x0001, 0x2985: 0x0001, 0x2986: 0x0001, 0x2987: 0x0001, 0x2988: 0x0001, 0x2989: 0x0001, 0x298a: 0x0001, 0x298b: 0x0001, 0x298c: 0x0001, 0x298d: 0x0001, 0x298e: 0x0001, 0x298f: 0x0001, 0x2990: 0x0001, 0x2991: 0x0001, 0x2992: 0x0001, 0x2993: 0x0001, 0x2994: 0x0001, 0x2995: 0x0001, 0x2996: 0x0001, 0x2997: 0x0001, 0x2998: 0x0001, 0x2999: 0x0001, 0x299a: 0x0001, 0x299b: 0x0001, 0x299c: 0x0001, 0x299d: 0x0001, 0x299e: 0x0001, 0x299f: 0x0001, 0x29a0: 0x0001, 0x29a1: 0x0001, 0x29a2: 0x0001, 0x29a3: 0x0001, 0x29a4: 0x0001, 0x29a5: 0x0001, 0x29a6: 0x0001, 0x29a7: 0x0001, 0x29a8: 0x0001, 0x29a9: 0x0001, 0x29aa: 0x0001, 0x29ab: 0x0001, 0x29ac: 0x0001, 0x29ad: 0x0001, 0x29ae: 0x0001, 0x29af: 0x0001, 0x29b0: 0x0001, 0x29b1: 0x0001, 0x29b2: 0x0001, 0x29b3: 0x0001, 0x29b4: 0x0001, 0x29b5: 0x0001, 0x29b6: 0x0001, 0x29b7: 0x0001, 0x29b8: 0x0001, 0x29b9: 0x0001, 0x29ba: 0x0001, 0x29bb: 0x0001, 0x29bc: 0x0001, 0x29bd: 0x000c, 0x29be: 0x000c, 0x29bf: 0x000c, // Block 0xa7, offset 0x29c0 0x29c0: 0x0001, 0x29c1: 0x0001, 0x29c2: 0x0001, 0x29c3: 0x0001, 0x29c4: 0x0001, 0x29c5: 0x0001, 0x29c6: 0x0001, 0x29c7: 0x0001, 0x29c8: 0x0001, 0x29c9: 0x0001, 0x29ca: 0x0001, 0x29cb: 0x0001, 0x29cc: 0x0001, 0x29cd: 0x0001, 0x29ce: 0x0001, 0x29cf: 0x0001, 0x29d0: 0x0001, 0x29d1: 0x0001, 0x29d2: 0x0001, 0x29d3: 0x0001, 0x29d4: 0x0001, 0x29d5: 0x0001, 0x29d6: 0x0001, 0x29d7: 0x0001, 0x29d8: 0x0001, 0x29d9: 0x0001, 0x29da: 0x0001, 0x29db: 0x0001, 0x29dc: 0x0001, 0x29dd: 0x0001, 0x29de: 0x0001, 0x29df: 0x0001, 0x29e0: 0x0001, 0x29e1: 0x0001, 0x29e2: 0x0001, 0x29e3: 0x0001, 0x29e4: 0x0001, 0x29e5: 0x0001, 0x29e6: 0x0001, 0x29e7: 0x0001, 0x29e8: 0x0001, 0x29e9: 0x0001, 0x29ea: 0x0001, 0x29eb: 0x0001, 0x29ec: 0x0001, 0x29ed: 0x0001, 0x29ee: 0x0001, 0x29ef: 0x0001, 0x29f0: 0x000d, 0x29f1: 0x000d, 0x29f2: 0x000d, 0x29f3: 0x000d, 0x29f4: 0x000d, 0x29f5: 0x000d, 0x29f6: 0x000d, 0x29f7: 0x000d, 0x29f8: 0x000d, 0x29f9: 0x000d, 0x29fa: 0x000d, 0x29fb: 0x000d, 0x29fc: 0x000d, 0x29fd: 0x000d, 0x29fe: 0x000d, 0x29ff: 0x000d, // Block 0xa8, offset 0x2a00 0x2a00: 0x000d, 0x2a01: 0x000d, 0x2a02: 0x000d, 0x2a03: 0x000d, 0x2a04: 0x000d, 0x2a05: 0x000d, 0x2a06: 0x000c, 0x2a07: 0x000c, 0x2a08: 0x000c, 0x2a09: 0x000c, 0x2a0a: 0x000c, 0x2a0b: 0x000c, 0x2a0c: 0x000c, 0x2a0d: 0x000c, 0x2a0e: 0x000c, 0x2a0f: 0x000c, 0x2a10: 0x000c, 0x2a11: 0x000d, 0x2a12: 0x000d, 0x2a13: 0x000d, 0x2a14: 0x000d, 0x2a15: 0x000d, 0x2a16: 0x000d, 0x2a17: 0x000d, 0x2a18: 0x000d, 0x2a19: 0x000d, 0x2a1a: 0x0001, 0x2a1b: 0x0001, 0x2a1c: 0x0001, 0x2a1d: 0x0001, 0x2a1e: 0x0001, 0x2a1f: 0x0001, 0x2a20: 0x0001, 0x2a21: 0x0001, 0x2a22: 0x0001, 0x2a23: 0x0001, 0x2a24: 0x0001, 0x2a25: 0x0001, 0x2a26: 0x0001, 0x2a27: 0x0001, 0x2a28: 0x0001, 0x2a29: 0x0001, 0x2a2a: 0x0001, 0x2a2b: 0x0001, 0x2a2c: 0x0001, 0x2a2d: 0x0001, 0x2a2e: 0x0001, 0x2a2f: 0x0001, 0x2a30: 0x0001, 0x2a31: 0x0001, 0x2a32: 0x0001, 0x2a33: 0x0001, 0x2a34: 0x0001, 0x2a35: 0x0001, 0x2a36: 0x0001, 0x2a37: 0x0001, 0x2a38: 0x0001, 0x2a39: 0x0001, 0x2a3a: 0x0001, 0x2a3b: 0x0001, 0x2a3c: 0x0001, 0x2a3d: 0x0001, 0x2a3e: 0x0001, 0x2a3f: 0x0001, // Block 0xa9, offset 0x2a40 0x2a40: 0x0001, 0x2a41: 0x0001, 0x2a42: 0x000c, 0x2a43: 0x000c, 0x2a44: 0x000c, 0x2a45: 0x000c, 0x2a46: 0x0001, 0x2a47: 0x0001, 0x2a48: 0x0001, 0x2a49: 0x0001, 0x2a4a: 0x0001, 0x2a4b: 0x0001, 0x2a4c: 0x0001, 0x2a4d: 0x0001, 0x2a4e: 0x0001, 0x2a4f: 0x0001, 0x2a50: 0x0001, 0x2a51: 0x0001, 0x2a52: 0x0001, 0x2a53: 0x0001, 0x2a54: 0x0001, 0x2a55: 0x0001, 0x2a56: 0x0001, 0x2a57: 0x0001, 0x2a58: 0x0001, 0x2a59: 0x0001, 0x2a5a: 0x0001, 0x2a5b: 0x0001, 0x2a5c: 0x0001, 0x2a5d: 0x0001, 0x2a5e: 0x0001, 0x2a5f: 0x0001, 0x2a60: 0x0001, 0x2a61: 0x0001, 0x2a62: 0x0001, 0x2a63: 0x0001, 0x2a64: 0x0001, 0x2a65: 0x0001, 0x2a66: 0x0001, 0x2a67: 0x0001, 0x2a68: 0x0001, 0x2a69: 0x0001, 0x2a6a: 0x0001, 0x2a6b: 0x0001, 0x2a6c: 0x0001, 0x2a6d: 0x0001, 0x2a6e: 0x0001, 0x2a6f: 0x0001, 0x2a70: 0x0001, 0x2a71: 0x0001, 0x2a72: 0x0001, 0x2a73: 0x0001, 0x2a74: 0x0001, 0x2a75: 0x0001, 0x2a76: 0x0001, 0x2a77: 0x0001, 0x2a78: 0x0001, 0x2a79: 0x0001, 0x2a7a: 0x0001, 0x2a7b: 0x0001, 0x2a7c: 0x0001, 0x2a7d: 0x0001, 0x2a7e: 0x0001, 0x2a7f: 0x0001, // Block 0xaa, offset 0x2a80 0x2a81: 0x000c, 0x2ab8: 0x000c, 0x2ab9: 0x000c, 0x2aba: 0x000c, 0x2abb: 0x000c, 0x2abc: 0x000c, 0x2abd: 0x000c, 0x2abe: 0x000c, 0x2abf: 0x000c, // Block 0xab, offset 0x2ac0 0x2ac0: 0x000c, 0x2ac1: 0x000c, 0x2ac2: 0x000c, 0x2ac3: 0x000c, 0x2ac4: 0x000c, 0x2ac5: 0x000c, 0x2ac6: 0x000c, 0x2ad2: 0x000a, 0x2ad3: 0x000a, 0x2ad4: 0x000a, 0x2ad5: 0x000a, 0x2ad6: 0x000a, 0x2ad7: 0x000a, 0x2ad8: 0x000a, 0x2ad9: 0x000a, 0x2ada: 0x000a, 0x2adb: 0x000a, 0x2adc: 0x000a, 0x2add: 0x000a, 0x2ade: 0x000a, 0x2adf: 0x000a, 0x2ae0: 0x000a, 0x2ae1: 0x000a, 0x2ae2: 0x000a, 0x2ae3: 0x000a, 0x2ae4: 0x000a, 0x2ae5: 0x000a, 0x2af0: 0x000c, 0x2af3: 0x000c, 0x2af4: 0x000c, 0x2aff: 0x000c, // Block 0xac, offset 0x2b00 0x2b00: 0x000c, 0x2b01: 0x000c, 0x2b33: 0x000c, 0x2b34: 0x000c, 0x2b35: 0x000c, 0x2b36: 0x000c, 0x2b39: 0x000c, 0x2b3a: 0x000c, // Block 0xad, offset 0x2b40 0x2b40: 0x000c, 0x2b41: 0x000c, 0x2b42: 0x000c, 0x2b67: 0x000c, 0x2b68: 0x000c, 0x2b69: 0x000c, 0x2b6a: 0x000c, 0x2b6b: 0x000c, 0x2b6d: 0x000c, 0x2b6e: 0x000c, 0x2b6f: 0x000c, 0x2b70: 0x000c, 0x2b71: 0x000c, 0x2b72: 0x000c, 0x2b73: 0x000c, 0x2b74: 0x000c, // Block 0xae, offset 0x2b80 0x2bb3: 0x000c, // Block 0xaf, offset 0x2bc0 0x2bc0: 0x000c, 0x2bc1: 0x000c, 0x2bf6: 0x000c, 0x2bf7: 0x000c, 0x2bf8: 0x000c, 0x2bf9: 0x000c, 0x2bfa: 0x000c, 0x2bfb: 0x000c, 0x2bfc: 0x000c, 0x2bfd: 0x000c, 0x2bfe: 0x000c, // Block 0xb0, offset 0x2c00 0x2c09: 0x000c, 0x2c0a: 0x000c, 0x2c0b: 0x000c, 0x2c0c: 0x000c, 0x2c0f: 0x000c, // Block 0xb1, offset 0x2c40 0x2c6f: 0x000c, 0x2c70: 0x000c, 0x2c71: 0x000c, 0x2c74: 0x000c, 0x2c76: 0x000c, 0x2c77: 0x000c, 0x2c7e: 0x000c, // Block 0xb2, offset 0x2c80 0x2c9f: 0x000c, 0x2ca3: 0x000c, 0x2ca4: 0x000c, 0x2ca5: 0x000c, 0x2ca6: 0x000c, 0x2ca7: 0x000c, 0x2ca8: 0x000c, 0x2ca9: 0x000c, 0x2caa: 0x000c, // Block 0xb3, offset 0x2cc0 0x2cc0: 0x000c, 0x2ce6: 0x000c, 0x2ce7: 0x000c, 0x2ce8: 0x000c, 0x2ce9: 0x000c, 0x2cea: 0x000c, 0x2ceb: 0x000c, 0x2cec: 0x000c, 0x2cf0: 0x000c, 0x2cf1: 0x000c, 0x2cf2: 0x000c, 0x2cf3: 0x000c, 0x2cf4: 0x000c, // Block 0xb4, offset 0x2d00 0x2d38: 0x000c, 0x2d39: 0x000c, 0x2d3a: 0x000c, 0x2d3b: 0x000c, 0x2d3c: 0x000c, 0x2d3d: 0x000c, 0x2d3e: 0x000c, 0x2d3f: 0x000c, // Block 0xb5, offset 0x2d40 0x2d42: 0x000c, 0x2d43: 0x000c, 0x2d44: 0x000c, 0x2d46: 0x000c, 0x2d5e: 0x000c, // Block 0xb6, offset 0x2d80 0x2db3: 0x000c, 0x2db4: 0x000c, 0x2db5: 0x000c, 0x2db6: 0x000c, 0x2db7: 0x000c, 0x2db8: 0x000c, 0x2dba: 0x000c, 0x2dbf: 0x000c, // Block 0xb7, offset 0x2dc0 0x2dc0: 0x000c, 0x2dc2: 0x000c, 0x2dc3: 0x000c, // Block 0xb8, offset 0x2e00 0x2e32: 0x000c, 0x2e33: 0x000c, 0x2e34: 0x000c, 0x2e35: 0x000c, 0x2e3c: 0x000c, 0x2e3d: 0x000c, 0x2e3f: 0x000c, // Block 0xb9, offset 0x2e40 0x2e40: 0x000c, 0x2e5c: 0x000c, 0x2e5d: 0x000c, // Block 0xba, offset 0x2e80 0x2eb3: 0x000c, 0x2eb4: 0x000c, 0x2eb5: 0x000c, 0x2eb6: 0x000c, 0x2eb7: 0x000c, 0x2eb8: 0x000c, 0x2eb9: 0x000c, 0x2eba: 0x000c, 0x2ebd: 0x000c, 0x2ebf: 0x000c, // Block 0xbb, offset 0x2ec0 0x2ec0: 0x000c, 0x2ee0: 0x000a, 0x2ee1: 0x000a, 0x2ee2: 0x000a, 0x2ee3: 0x000a, 0x2ee4: 0x000a, 0x2ee5: 0x000a, 0x2ee6: 0x000a, 0x2ee7: 0x000a, 0x2ee8: 0x000a, 0x2ee9: 0x000a, 0x2eea: 0x000a, 0x2eeb: 0x000a, 0x2eec: 0x000a, // Block 0xbc, offset 0x2f00 0x2f2b: 0x000c, 0x2f2d: 0x000c, 0x2f30: 0x000c, 0x2f31: 0x000c, 0x2f32: 0x000c, 0x2f33: 0x000c, 0x2f34: 0x000c, 0x2f35: 0x000c, 0x2f37: 0x000c, // Block 0xbd, offset 0x2f40 0x2f5d: 0x000c, 0x2f5e: 0x000c, 0x2f5f: 0x000c, 0x2f62: 0x000c, 0x2f63: 0x000c, 0x2f64: 0x000c, 0x2f65: 0x000c, 0x2f67: 0x000c, 0x2f68: 0x000c, 0x2f69: 0x000c, 0x2f6a: 0x000c, 0x2f6b: 0x000c, // Block 0xbe, offset 0x2f80 0x2faf: 0x000c, 0x2fb0: 0x000c, 0x2fb1: 0x000c, 0x2fb2: 0x000c, 0x2fb3: 0x000c, 0x2fb4: 0x000c, 0x2fb5: 0x000c, 0x2fb6: 0x000c, 0x2fb7: 0x000c, 0x2fb9: 0x000c, 0x2fba: 0x000c, // Block 0xbf, offset 0x2fc0 0x2ffb: 0x000c, 0x2ffc: 0x000c, 0x2ffe: 0x000c, // Block 0xc0, offset 0x3000 0x3003: 0x000c, // Block 0xc1, offset 0x3040 0x3054: 0x000c, 0x3055: 0x000c, 0x3056: 0x000c, 0x3057: 0x000c, 0x305a: 0x000c, 0x305b: 0x000c, 0x3060: 0x000c, // Block 0xc2, offset 0x3080 0x3081: 0x000c, 0x3082: 0x000c, 0x3083: 0x000c, 0x3084: 0x000c, 0x3085: 0x000c, 0x3086: 0x000c, 0x3089: 0x000c, 0x308a: 0x000c, 0x30b3: 0x000c, 0x30b4: 0x000c, 0x30b5: 0x000c, 0x30b6: 0x000c, 0x30b7: 0x000c, 0x30b8: 0x000c, 0x30bb: 0x000c, 0x30bc: 0x000c, 0x30bd: 0x000c, 0x30be: 0x000c, // Block 0xc3, offset 0x30c0 0x30c7: 0x000c, 0x30d1: 0x000c, 0x30d2: 0x000c, 0x30d3: 0x000c, 0x30d4: 0x000c, 0x30d5: 0x000c, 0x30d6: 0x000c, 0x30d9: 0x000c, 0x30da: 0x000c, 0x30db: 0x000c, // Block 0xc4, offset 0x3100 0x310a: 0x000c, 0x310b: 0x000c, 0x310c: 0x000c, 0x310d: 0x000c, 0x310e: 0x000c, 0x310f: 0x000c, 0x3110: 0x000c, 0x3111: 0x000c, 0x3112: 0x000c, 0x3113: 0x000c, 0x3114: 0x000c, 0x3115: 0x000c, 0x3116: 0x000c, 0x3118: 0x000c, 0x3119: 0x000c, // Block 0xc5, offset 0x3140 0x3170: 0x000c, 0x3171: 0x000c, 0x3172: 0x000c, 0x3173: 0x000c, 0x3174: 0x000c, 0x3175: 0x000c, 0x3176: 0x000c, 0x3178: 0x000c, 0x3179: 0x000c, 0x317a: 0x000c, 0x317b: 0x000c, 0x317c: 0x000c, 0x317d: 0x000c, // Block 0xc6, offset 0x3180 0x3192: 0x000c, 0x3193: 0x000c, 0x3194: 0x000c, 0x3195: 0x000c, 0x3196: 0x000c, 0x3197: 0x000c, 0x3198: 0x000c, 0x3199: 0x000c, 0x319a: 0x000c, 0x319b: 0x000c, 0x319c: 0x000c, 0x319d: 0x000c, 0x319e: 0x000c, 0x319f: 0x000c, 0x31a0: 0x000c, 0x31a1: 0x000c, 0x31a2: 0x000c, 0x31a3: 0x000c, 0x31a4: 0x000c, 0x31a5: 0x000c, 0x31a6: 0x000c, 0x31a7: 0x000c, 0x31aa: 0x000c, 0x31ab: 0x000c, 0x31ac: 0x000c, 0x31ad: 0x000c, 0x31ae: 0x000c, 0x31af: 0x000c, 0x31b0: 0x000c, 0x31b2: 0x000c, 0x31b3: 0x000c, 0x31b5: 0x000c, 0x31b6: 0x000c, // Block 0xc7, offset 0x31c0 0x31f1: 0x000c, 0x31f2: 0x000c, 0x31f3: 0x000c, 0x31f4: 0x000c, 0x31f5: 0x000c, 0x31f6: 0x000c, 0x31fa: 0x000c, 0x31fc: 0x000c, 0x31fd: 0x000c, 0x31ff: 0x000c, // Block 0xc8, offset 0x3200 0x3200: 0x000c, 0x3201: 0x000c, 0x3202: 0x000c, 0x3203: 0x000c, 0x3204: 0x000c, 0x3205: 0x000c, 0x3207: 0x000c, // Block 0xc9, offset 0x3240 0x3250: 0x000c, 0x3251: 0x000c, 0x3255: 0x000c, 0x3257: 0x000c, // Block 0xca, offset 0x3280 0x32b3: 0x000c, 0x32b4: 0x000c, // Block 0xcb, offset 0x32c0 0x32c0: 0x000c, 0x32c1: 0x000c, 0x32f6: 0x000c, 0x32f7: 0x000c, 0x32f8: 0x000c, 0x32f9: 0x000c, 0x32fa: 0x000c, // Block 0xcc, offset 0x3300 0x3300: 0x000c, 0x3302: 0x000c, // Block 0xcd, offset 0x3340 0x3355: 0x000a, 0x3356: 0x000a, 0x3357: 0x000a, 0x3358: 0x000a, 0x3359: 0x000a, 0x335a: 0x000a, 0x335b: 0x000a, 0x335c: 0x000a, 0x335d: 0x0004, 0x335e: 0x0004, 0x335f: 0x0004, 0x3360: 0x0004, 0x3361: 0x000a, 0x3362: 0x000a, 0x3363: 0x000a, 0x3364: 0x000a, 0x3365: 0x000a, 0x3366: 0x000a, 0x3367: 0x000a, 0x3368: 0x000a, 0x3369: 0x000a, 0x336a: 0x000a, 0x336b: 0x000a, 0x336c: 0x000a, 0x336d: 0x000a, 0x336e: 0x000a, 0x336f: 0x000a, 0x3370: 0x000a, 0x3371: 0x000a, // Block 0xce, offset 0x3380 0x3380: 0x000c, 0x3387: 0x000c, 0x3388: 0x000c, 0x3389: 0x000c, 0x338a: 0x000c, 0x338b: 0x000c, 0x338c: 0x000c, 0x338d: 0x000c, 0x338e: 0x000c, 0x338f: 0x000c, 0x3390: 0x000c, 0x3391: 0x000c, 0x3392: 0x000c, 0x3393: 0x000c, 0x3394: 0x000c, 0x3395: 0x000c, // Block 0xcf, offset 0x33c0 0x33f0: 0x000c, 0x33f1: 0x000c, 0x33f2: 0x000c, 0x33f3: 0x000c, 0x33f4: 0x000c, // Block 0xd0, offset 0x3400 0x3430: 0x000c, 0x3431: 0x000c, 0x3432: 0x000c, 0x3433: 0x000c, 0x3434: 0x000c, 0x3435: 0x000c, 0x3436: 0x000c, // Block 0xd1, offset 0x3440 0x344f: 0x000c, // Block 0xd2, offset 0x3480 0x348f: 0x000c, 0x3490: 0x000c, 0x3491: 0x000c, 0x3492: 0x000c, // Block 0xd3, offset 0x34c0 0x34e2: 0x000a, 0x34e4: 0x000c, // Block 0xd4, offset 0x3500 0x351d: 0x000c, 0x351e: 0x000c, 0x3520: 0x000b, 0x3521: 0x000b, 0x3522: 0x000b, 0x3523: 0x000b, // Block 0xd5, offset 0x3540 0x3540: 0x000c, 0x3541: 0x000c, 0x3542: 0x000c, 0x3543: 0x000c, 0x3544: 0x000c, 0x3545: 0x000c, 0x3546: 0x000c, 0x3547: 0x000c, 0x3548: 0x000c, 0x3549: 0x000c, 0x354a: 0x000c, 0x354b: 0x000c, 0x354c: 0x000c, 0x354d: 0x000c, 0x354e: 0x000c, 0x354f: 0x000c, 0x3550: 0x000c, 0x3551: 0x000c, 0x3552: 0x000c, 0x3553: 0x000c, 0x3554: 0x000c, 0x3555: 0x000c, 0x3556: 0x000c, 0x3557: 0x000c, 0x3558: 0x000c, 0x3559: 0x000c, 0x355a: 0x000c, 0x355b: 0x000c, 0x355c: 0x000c, 0x355d: 0x000c, 0x355e: 0x000c, 0x355f: 0x000c, 0x3560: 0x000c, 0x3561: 0x000c, 0x3562: 0x000c, 0x3563: 0x000c, 0x3564: 0x000c, 0x3565: 0x000c, 0x3566: 0x000c, 0x3567: 0x000c, 0x3568: 0x000c, 0x3569: 0x000c, 0x356a: 0x000c, 0x356b: 0x000c, 0x356c: 0x000c, 0x356d: 0x000c, 0x3570: 0x000c, 0x3571: 0x000c, 0x3572: 0x000c, 0x3573: 0x000c, 0x3574: 0x000c, 0x3575: 0x000c, 0x3576: 0x000c, 0x3577: 0x000c, 0x3578: 0x000c, 0x3579: 0x000c, 0x357a: 0x000c, 0x357b: 0x000c, 0x357c: 0x000c, 0x357d: 0x000c, 0x357e: 0x000c, 0x357f: 0x000c, // Block 0xd6, offset 0x3580 0x3580: 0x000c, 0x3581: 0x000c, 0x3582: 0x000c, 0x3583: 0x000c, 0x3584: 0x000c, 0x3585: 0x000c, 0x3586: 0x000c, // Block 0xd7, offset 0x35c0 0x35e7: 0x000c, 0x35e8: 0x000c, 0x35e9: 0x000c, 0x35f3: 0x000b, 0x35f4: 0x000b, 0x35f5: 0x000b, 0x35f6: 0x000b, 0x35f7: 0x000b, 0x35f8: 0x000b, 0x35f9: 0x000b, 0x35fa: 0x000b, 0x35fb: 0x000c, 0x35fc: 0x000c, 0x35fd: 0x000c, 0x35fe: 0x000c, 0x35ff: 0x000c, // Block 0xd8, offset 0x3600 0x3600: 0x000c, 0x3601: 0x000c, 0x3602: 0x000c, 0x3605: 0x000c, 0x3606: 0x000c, 0x3607: 0x000c, 0x3608: 0x000c, 0x3609: 0x000c, 0x360a: 0x000c, 0x360b: 0x000c, 0x362a: 0x000c, 0x362b: 0x000c, 0x362c: 0x000c, 0x362d: 0x000c, // Block 0xd9, offset 0x3640 0x3669: 0x000a, 0x366a: 0x000a, // Block 0xda, offset 0x3680 0x3680: 0x000a, 0x3681: 0x000a, 0x3682: 0x000c, 0x3683: 0x000c, 0x3684: 0x000c, 0x3685: 0x000a, // Block 0xdb, offset 0x36c0 0x36c0: 0x000a, 0x36c1: 0x000a, 0x36c2: 0x000a, 0x36c3: 0x000a, 0x36c4: 0x000a, 0x36c5: 0x000a, 0x36c6: 0x000a, 0x36c7: 0x000a, 0x36c8: 0x000a, 0x36c9: 0x000a, 0x36ca: 0x000a, 0x36cb: 0x000a, 0x36cc: 0x000a, 0x36cd: 0x000a, 0x36ce: 0x000a, 0x36cf: 0x000a, 0x36d0: 0x000a, 0x36d1: 0x000a, 0x36d2: 0x000a, 0x36d3: 0x000a, 0x36d4: 0x000a, 0x36d5: 0x000a, 0x36d6: 0x000a, // Block 0xdc, offset 0x3700 0x371b: 0x000a, // Block 0xdd, offset 0x3740 0x3755: 0x000a, // Block 0xde, offset 0x3780 0x378f: 0x000a, // Block 0xdf, offset 0x37c0 0x37c9: 0x000a, // Block 0xe0, offset 0x3800 0x3803: 0x000a, 0x380e: 0x0002, 0x380f: 0x0002, 0x3810: 0x0002, 0x3811: 0x0002, 0x3812: 0x0002, 0x3813: 0x0002, 0x3814: 0x0002, 0x3815: 0x0002, 0x3816: 0x0002, 0x3817: 0x0002, 0x3818: 0x0002, 0x3819: 0x0002, 0x381a: 0x0002, 0x381b: 0x0002, 0x381c: 0x0002, 0x381d: 0x0002, 0x381e: 0x0002, 0x381f: 0x0002, 0x3820: 0x0002, 0x3821: 0x0002, 0x3822: 0x0002, 0x3823: 0x0002, 0x3824: 0x0002, 0x3825: 0x0002, 0x3826: 0x0002, 0x3827: 0x0002, 0x3828: 0x0002, 0x3829: 0x0002, 0x382a: 0x0002, 0x382b: 0x0002, 0x382c: 0x0002, 0x382d: 0x0002, 0x382e: 0x0002, 0x382f: 0x0002, 0x3830: 0x0002, 0x3831: 0x0002, 0x3832: 0x0002, 0x3833: 0x0002, 0x3834: 0x0002, 0x3835: 0x0002, 0x3836: 0x0002, 0x3837: 0x0002, 0x3838: 0x0002, 0x3839: 0x0002, 0x383a: 0x0002, 0x383b: 0x0002, 0x383c: 0x0002, 0x383d: 0x0002, 0x383e: 0x0002, 0x383f: 0x0002, // Block 0xe1, offset 0x3840 0x3840: 0x000c, 0x3841: 0x000c, 0x3842: 0x000c, 0x3843: 0x000c, 0x3844: 0x000c, 0x3845: 0x000c, 0x3846: 0x000c, 0x3847: 0x000c, 0x3848: 0x000c, 0x3849: 0x000c, 0x384a: 0x000c, 0x384b: 0x000c, 0x384c: 0x000c, 0x384d: 0x000c, 0x384e: 0x000c, 0x384f: 0x000c, 0x3850: 0x000c, 0x3851: 0x000c, 0x3852: 0x000c, 0x3853: 0x000c, 0x3854: 0x000c, 0x3855: 0x000c, 0x3856: 0x000c, 0x3857: 0x000c, 0x3858: 0x000c, 0x3859: 0x000c, 0x385a: 0x000c, 0x385b: 0x000c, 0x385c: 0x000c, 0x385d: 0x000c, 0x385e: 0x000c, 0x385f: 0x000c, 0x3860: 0x000c, 0x3861: 0x000c, 0x3862: 0x000c, 0x3863: 0x000c, 0x3864: 0x000c, 0x3865: 0x000c, 0x3866: 0x000c, 0x3867: 0x000c, 0x3868: 0x000c, 0x3869: 0x000c, 0x386a: 0x000c, 0x386b: 0x000c, 0x386c: 0x000c, 0x386d: 0x000c, 0x386e: 0x000c, 0x386f: 0x000c, 0x3870: 0x000c, 0x3871: 0x000c, 0x3872: 0x000c, 0x3873: 0x000c, 0x3874: 0x000c, 0x3875: 0x000c, 0x3876: 0x000c, 0x387b: 0x000c, 0x387c: 0x000c, 0x387d: 0x000c, 0x387e: 0x000c, 0x387f: 0x000c, // Block 0xe2, offset 0x3880 0x3880: 0x000c, 0x3881: 0x000c, 0x3882: 0x000c, 0x3883: 0x000c, 0x3884: 0x000c, 0x3885: 0x000c, 0x3886: 0x000c, 0x3887: 0x000c, 0x3888: 0x000c, 0x3889: 0x000c, 0x388a: 0x000c, 0x388b: 0x000c, 0x388c: 0x000c, 0x388d: 0x000c, 0x388e: 0x000c, 0x388f: 0x000c, 0x3890: 0x000c, 0x3891: 0x000c, 0x3892: 0x000c, 0x3893: 0x000c, 0x3894: 0x000c, 0x3895: 0x000c, 0x3896: 0x000c, 0x3897: 0x000c, 0x3898: 0x000c, 0x3899: 0x000c, 0x389a: 0x000c, 0x389b: 0x000c, 0x389c: 0x000c, 0x389d: 0x000c, 0x389e: 0x000c, 0x389f: 0x000c, 0x38a0: 0x000c, 0x38a1: 0x000c, 0x38a2: 0x000c, 0x38a3: 0x000c, 0x38a4: 0x000c, 0x38a5: 0x000c, 0x38a6: 0x000c, 0x38a7: 0x000c, 0x38a8: 0x000c, 0x38a9: 0x000c, 0x38aa: 0x000c, 0x38ab: 0x000c, 0x38ac: 0x000c, 0x38b5: 0x000c, // Block 0xe3, offset 0x38c0 0x38c4: 0x000c, 0x38db: 0x000c, 0x38dc: 0x000c, 0x38dd: 0x000c, 0x38de: 0x000c, 0x38df: 0x000c, 0x38e1: 0x000c, 0x38e2: 0x000c, 0x38e3: 0x000c, 0x38e4: 0x000c, 0x38e5: 0x000c, 0x38e6: 0x000c, 0x38e7: 0x000c, 0x38e8: 0x000c, 0x38e9: 0x000c, 0x38ea: 0x000c, 0x38eb: 0x000c, 0x38ec: 0x000c, 0x38ed: 0x000c, 0x38ee: 0x000c, 0x38ef: 0x000c, // Block 0xe4, offset 0x3900 0x3900: 0x000c, 0x3901: 0x000c, 0x3902: 0x000c, 0x3903: 0x000c, 0x3904: 0x000c, 0x3905: 0x000c, 0x3906: 0x000c, 0x3908: 0x000c, 0x3909: 0x000c, 0x390a: 0x000c, 0x390b: 0x000c, 0x390c: 0x000c, 0x390d: 0x000c, 0x390e: 0x000c, 0x390f: 0x000c, 0x3910: 0x000c, 0x3911: 0x000c, 0x3912: 0x000c, 0x3913: 0x000c, 0x3914: 0x000c, 0x3915: 0x000c, 0x3916: 0x000c, 0x3917: 0x000c, 0x3918: 0x000c, 0x391b: 0x000c, 0x391c: 0x000c, 0x391d: 0x000c, 0x391e: 0x000c, 0x391f: 0x000c, 0x3920: 0x000c, 0x3921: 0x000c, 0x3923: 0x000c, 0x3924: 0x000c, 0x3926: 0x000c, 0x3927: 0x000c, 0x3928: 0x000c, 0x3929: 0x000c, 0x392a: 0x000c, // Block 0xe5, offset 0x3940 0x396e: 0x000c, // Block 0xe6, offset 0x3980 0x39ac: 0x000c, 0x39ad: 0x000c, 0x39ae: 0x000c, 0x39af: 0x000c, 0x39bf: 0x0004, // Block 0xe7, offset 0x39c0 0x39ec: 0x000c, 0x39ed: 0x000c, 0x39ee: 0x000c, 0x39ef: 0x000c, // Block 0xe8, offset 0x3a00 0x3a00: 0x0001, 0x3a01: 0x0001, 0x3a02: 0x0001, 0x3a03: 0x0001, 0x3a04: 0x0001, 0x3a05: 0x0001, 0x3a06: 0x0001, 0x3a07: 0x0001, 0x3a08: 0x0001, 0x3a09: 0x0001, 0x3a0a: 0x0001, 0x3a0b: 0x0001, 0x3a0c: 0x0001, 0x3a0d: 0x0001, 0x3a0e: 0x0001, 0x3a0f: 0x0001, 0x3a10: 0x000c, 0x3a11: 0x000c, 0x3a12: 0x000c, 0x3a13: 0x000c, 0x3a14: 0x000c, 0x3a15: 0x000c, 0x3a16: 0x000c, 0x3a17: 0x0001, 0x3a18: 0x0001, 0x3a19: 0x0001, 0x3a1a: 0x0001, 0x3a1b: 0x0001, 0x3a1c: 0x0001, 0x3a1d: 0x0001, 0x3a1e: 0x0001, 0x3a1f: 0x0001, 0x3a20: 0x0001, 0x3a21: 0x0001, 0x3a22: 0x0001, 0x3a23: 0x0001, 0x3a24: 0x0001, 0x3a25: 0x0001, 0x3a26: 0x0001, 0x3a27: 0x0001, 0x3a28: 0x0001, 0x3a29: 0x0001, 0x3a2a: 0x0001, 0x3a2b: 0x0001, 0x3a2c: 0x0001, 0x3a2d: 0x0001, 0x3a2e: 0x0001, 0x3a2f: 0x0001, 0x3a30: 0x0001, 0x3a31: 0x0001, 0x3a32: 0x0001, 0x3a33: 0x0001, 0x3a34: 0x0001, 0x3a35: 0x0001, 0x3a36: 0x0001, 0x3a37: 0x0001, 0x3a38: 0x0001, 0x3a39: 0x0001, 0x3a3a: 0x0001, 0x3a3b: 0x0001, 0x3a3c: 0x0001, 0x3a3d: 0x0001, 0x3a3e: 0x0001, 0x3a3f: 0x0001, // Block 0xe9, offset 0x3a40 0x3a40: 0x0001, 0x3a41: 0x0001, 0x3a42: 0x0001, 0x3a43: 0x0001, 0x3a44: 0x000c, 0x3a45: 0x000c, 0x3a46: 0x000c, 0x3a47: 0x000c, 0x3a48: 0x000c, 0x3a49: 0x000c, 0x3a4a: 0x000c, 0x3a4b: 0x0001, 0x3a4c: 0x0001, 0x3a4d: 0x0001, 0x3a4e: 0x0001, 0x3a4f: 0x0001, 0x3a50: 0x0001, 0x3a51: 0x0001, 0x3a52: 0x0001, 0x3a53: 0x0001, 0x3a54: 0x0001, 0x3a55: 0x0001, 0x3a56: 0x0001, 0x3a57: 0x0001, 0x3a58: 0x0001, 0x3a59: 0x0001, 0x3a5a: 0x0001, 0x3a5b: 0x0001, 0x3a5c: 0x0001, 0x3a5d: 0x0001, 0x3a5e: 0x0001, 0x3a5f: 0x0001, 0x3a60: 0x0001, 0x3a61: 0x0001, 0x3a62: 0x0001, 0x3a63: 0x0001, 0x3a64: 0x0001, 0x3a65: 0x0001, 0x3a66: 0x0001, 0x3a67: 0x0001, 0x3a68: 0x0001, 0x3a69: 0x0001, 0x3a6a: 0x0001, 0x3a6b: 0x0001, 0x3a6c: 0x0001, 0x3a6d: 0x0001, 0x3a6e: 0x0001, 0x3a6f: 0x0001, 0x3a70: 0x0001, 0x3a71: 0x0001, 0x3a72: 0x0001, 0x3a73: 0x0001, 0x3a74: 0x0001, 0x3a75: 0x0001, 0x3a76: 0x0001, 0x3a77: 0x0001, 0x3a78: 0x0001, 0x3a79: 0x0001, 0x3a7a: 0x0001, 0x3a7b: 0x0001, 0x3a7c: 0x0001, 0x3a7d: 0x0001, 0x3a7e: 0x0001, 0x3a7f: 0x0001, // Block 0xea, offset 0x3a80 0x3a80: 0x0001, 0x3a81: 0x0001, 0x3a82: 0x0001, 0x3a83: 0x0001, 0x3a84: 0x0001, 0x3a85: 0x0001, 0x3a86: 0x0001, 0x3a87: 0x0001, 0x3a88: 0x0001, 0x3a89: 0x0001, 0x3a8a: 0x0001, 0x3a8b: 0x0001, 0x3a8c: 0x0001, 0x3a8d: 0x0001, 0x3a8e: 0x0001, 0x3a8f: 0x0001, 0x3a90: 0x0001, 0x3a91: 0x0001, 0x3a92: 0x0001, 0x3a93: 0x0001, 0x3a94: 0x0001, 0x3a95: 0x0001, 0x3a96: 0x0001, 0x3a97: 0x0001, 0x3a98: 0x0001, 0x3a99: 0x0001, 0x3a9a: 0x0001, 0x3a9b: 0x0001, 0x3a9c: 0x0001, 0x3a9d: 0x0001, 0x3a9e: 0x0001, 0x3a9f: 0x0001, 0x3aa0: 0x0001, 0x3aa1: 0x0001, 0x3aa2: 0x0001, 0x3aa3: 0x0001, 0x3aa4: 0x0001, 0x3aa5: 0x0001, 0x3aa6: 0x0001, 0x3aa7: 0x0001, 0x3aa8: 0x0001, 0x3aa9: 0x0001, 0x3aaa: 0x0001, 0x3aab: 0x0001, 0x3aac: 0x0001, 0x3aad: 0x0001, 0x3aae: 0x0001, 0x3aaf: 0x0001, 0x3ab0: 0x0001, 0x3ab1: 0x000d, 0x3ab2: 0x000d, 0x3ab3: 0x000d, 0x3ab4: 0x000d, 0x3ab5: 0x000d, 0x3ab6: 0x000d, 0x3ab7: 0x000d, 0x3ab8: 0x000d, 0x3ab9: 0x000d, 0x3aba: 0x000d, 0x3abb: 0x000d, 0x3abc: 0x000d, 0x3abd: 0x000d, 0x3abe: 0x000d, 0x3abf: 0x000d, // Block 0xeb, offset 0x3ac0 0x3ac0: 0x000d, 0x3ac1: 0x000d, 0x3ac2: 0x000d, 0x3ac3: 0x000d, 0x3ac4: 0x000d, 0x3ac5: 0x000d, 0x3ac6: 0x000d, 0x3ac7: 0x000d, 0x3ac8: 0x000d, 0x3ac9: 0x000d, 0x3aca: 0x000d, 0x3acb: 0x000d, 0x3acc: 0x000d, 0x3acd: 0x000d, 0x3ace: 0x000d, 0x3acf: 0x000d, 0x3ad0: 0x000d, 0x3ad1: 0x000d, 0x3ad2: 0x000d, 0x3ad3: 0x000d, 0x3ad4: 0x000d, 0x3ad5: 0x000d, 0x3ad6: 0x000d, 0x3ad7: 0x000d, 0x3ad8: 0x000d, 0x3ad9: 0x000d, 0x3ada: 0x000d, 0x3adb: 0x000d, 0x3adc: 0x000d, 0x3add: 0x000d, 0x3ade: 0x000d, 0x3adf: 0x000d, 0x3ae0: 0x000d, 0x3ae1: 0x000d, 0x3ae2: 0x000d, 0x3ae3: 0x000d, 0x3ae4: 0x000d, 0x3ae5: 0x000d, 0x3ae6: 0x000d, 0x3ae7: 0x000d, 0x3ae8: 0x000d, 0x3ae9: 0x000d, 0x3aea: 0x000d, 0x3aeb: 0x000d, 0x3aec: 0x000d, 0x3aed: 0x000d, 0x3aee: 0x000d, 0x3aef: 0x000d, 0x3af0: 0x000d, 0x3af1: 0x000d, 0x3af2: 0x000d, 0x3af3: 0x000d, 0x3af4: 0x000d, 0x3af5: 0x0001, 0x3af6: 0x0001, 0x3af7: 0x0001, 0x3af8: 0x0001, 0x3af9: 0x0001, 0x3afa: 0x0001, 0x3afb: 0x0001, 0x3afc: 0x0001, 0x3afd: 0x0001, 0x3afe: 0x0001, 0x3aff: 0x0001, // Block 0xec, offset 0x3b00 0x3b00: 0x0001, 0x3b01: 0x000d, 0x3b02: 0x000d, 0x3b03: 0x000d, 0x3b04: 0x000d, 0x3b05: 0x000d, 0x3b06: 0x000d, 0x3b07: 0x000d, 0x3b08: 0x000d, 0x3b09: 0x000d, 0x3b0a: 0x000d, 0x3b0b: 0x000d, 0x3b0c: 0x000d, 0x3b0d: 0x000d, 0x3b0e: 0x000d, 0x3b0f: 0x000d, 0x3b10: 0x000d, 0x3b11: 0x000d, 0x3b12: 0x000d, 0x3b13: 0x000d, 0x3b14: 0x000d, 0x3b15: 0x000d, 0x3b16: 0x000d, 0x3b17: 0x000d, 0x3b18: 0x000d, 0x3b19: 0x000d, 0x3b1a: 0x000d, 0x3b1b: 0x000d, 0x3b1c: 0x000d, 0x3b1d: 0x000d, 0x3b1e: 0x000d, 0x3b1f: 0x000d, 0x3b20: 0x000d, 0x3b21: 0x000d, 0x3b22: 0x000d, 0x3b23: 0x000d, 0x3b24: 0x000d, 0x3b25: 0x000d, 0x3b26: 0x000d, 0x3b27: 0x000d, 0x3b28: 0x000d, 0x3b29: 0x000d, 0x3b2a: 0x000d, 0x3b2b: 0x000d, 0x3b2c: 0x000d, 0x3b2d: 0x000d, 0x3b2e: 0x000d, 0x3b2f: 0x000d, 0x3b30: 0x000d, 0x3b31: 0x000d, 0x3b32: 0x000d, 0x3b33: 0x000d, 0x3b34: 0x000d, 0x3b35: 0x000d, 0x3b36: 0x000d, 0x3b37: 0x000d, 0x3b38: 0x000d, 0x3b39: 0x000d, 0x3b3a: 0x000d, 0x3b3b: 0x000d, 0x3b3c: 0x000d, 0x3b3d: 0x000d, 0x3b3e: 0x0001, 0x3b3f: 0x0001, // Block 0xed, offset 0x3b40 0x3b40: 0x000d, 0x3b41: 0x000d, 0x3b42: 0x000d, 0x3b43: 0x000d, 0x3b44: 0x000d, 0x3b45: 0x000d, 0x3b46: 0x000d, 0x3b47: 0x000d, 0x3b48: 0x000d, 0x3b49: 0x000d, 0x3b4a: 0x000d, 0x3b4b: 0x000d, 0x3b4c: 0x000d, 0x3b4d: 0x000d, 0x3b4e: 0x000d, 0x3b4f: 0x000d, 0x3b50: 0x000d, 0x3b51: 0x000d, 0x3b52: 0x000d, 0x3b53: 0x000d, 0x3b54: 0x000d, 0x3b55: 0x000d, 0x3b56: 0x000d, 0x3b57: 0x000d, 0x3b58: 0x000d, 0x3b59: 0x000d, 0x3b5a: 0x000d, 0x3b5b: 0x000d, 0x3b5c: 0x000d, 0x3b5d: 0x000d, 0x3b5e: 0x000d, 0x3b5f: 0x000d, 0x3b60: 0x000d, 0x3b61: 0x000d, 0x3b62: 0x000d, 0x3b63: 0x000d, 0x3b64: 0x000d, 0x3b65: 0x000d, 0x3b66: 0x000d, 0x3b67: 0x000d, 0x3b68: 0x000d, 0x3b69: 0x000d, 0x3b6a: 0x000d, 0x3b6b: 0x000d, 0x3b6c: 0x000d, 0x3b6d: 0x000d, 0x3b6e: 0x000d, 0x3b6f: 0x000d, 0x3b70: 0x000a, 0x3b71: 0x000a, 0x3b72: 0x000d, 0x3b73: 0x000d, 0x3b74: 0x000d, 0x3b75: 0x000d, 0x3b76: 0x000d, 0x3b77: 0x000d, 0x3b78: 0x000d, 0x3b79: 0x000d, 0x3b7a: 0x000d, 0x3b7b: 0x000d, 0x3b7c: 0x000d, 0x3b7d: 0x000d, 0x3b7e: 0x000d, 0x3b7f: 0x000d, // Block 0xee, offset 0x3b80 0x3b80: 0x000a, 0x3b81: 0x000a, 0x3b82: 0x000a, 0x3b83: 0x000a, 0x3b84: 0x000a, 0x3b85: 0x000a, 0x3b86: 0x000a, 0x3b87: 0x000a, 0x3b88: 0x000a, 0x3b89: 0x000a, 0x3b8a: 0x000a, 0x3b8b: 0x000a, 0x3b8c: 0x000a, 0x3b8d: 0x000a, 0x3b8e: 0x000a, 0x3b8f: 0x000a, 0x3b90: 0x000a, 0x3b91: 0x000a, 0x3b92: 0x000a, 0x3b93: 0x000a, 0x3b94: 0x000a, 0x3b95: 0x000a, 0x3b96: 0x000a, 0x3b97: 0x000a, 0x3b98: 0x000a, 0x3b99: 0x000a, 0x3b9a: 0x000a, 0x3b9b: 0x000a, 0x3b9c: 0x000a, 0x3b9d: 0x000a, 0x3b9e: 0x000a, 0x3b9f: 0x000a, 0x3ba0: 0x000a, 0x3ba1: 0x000a, 0x3ba2: 0x000a, 0x3ba3: 0x000a, 0x3ba4: 0x000a, 0x3ba5: 0x000a, 0x3ba6: 0x000a, 0x3ba7: 0x000a, 0x3ba8: 0x000a, 0x3ba9: 0x000a, 0x3baa: 0x000a, 0x3bab: 0x000a, 0x3bb0: 0x000a, 0x3bb1: 0x000a, 0x3bb2: 0x000a, 0x3bb3: 0x000a, 0x3bb4: 0x000a, 0x3bb5: 0x000a, 0x3bb6: 0x000a, 0x3bb7: 0x000a, 0x3bb8: 0x000a, 0x3bb9: 0x000a, 0x3bba: 0x000a, 0x3bbb: 0x000a, 0x3bbc: 0x000a, 0x3bbd: 0x000a, 0x3bbe: 0x000a, 0x3bbf: 0x000a, // Block 0xef, offset 0x3bc0 0x3bc0: 0x000a, 0x3bc1: 0x000a, 0x3bc2: 0x000a, 0x3bc3: 0x000a, 0x3bc4: 0x000a, 0x3bc5: 0x000a, 0x3bc6: 0x000a, 0x3bc7: 0x000a, 0x3bc8: 0x000a, 0x3bc9: 0x000a, 0x3bca: 0x000a, 0x3bcb: 0x000a, 0x3bcc: 0x000a, 0x3bcd: 0x000a, 0x3bce: 0x000a, 0x3bcf: 0x000a, 0x3bd0: 0x000a, 0x3bd1: 0x000a, 0x3bd2: 0x000a, 0x3bd3: 0x000a, 0x3be0: 0x000a, 0x3be1: 0x000a, 0x3be2: 0x000a, 0x3be3: 0x000a, 0x3be4: 0x000a, 0x3be5: 0x000a, 0x3be6: 0x000a, 0x3be7: 0x000a, 0x3be8: 0x000a, 0x3be9: 0x000a, 0x3bea: 0x000a, 0x3beb: 0x000a, 0x3bec: 0x000a, 0x3bed: 0x000a, 0x3bee: 0x000a, 0x3bf1: 0x000a, 0x3bf2: 0x000a, 0x3bf3: 0x000a, 0x3bf4: 0x000a, 0x3bf5: 0x000a, 0x3bf6: 0x000a, 0x3bf7: 0x000a, 0x3bf8: 0x000a, 0x3bf9: 0x000a, 0x3bfa: 0x000a, 0x3bfb: 0x000a, 0x3bfc: 0x000a, 0x3bfd: 0x000a, 0x3bfe: 0x000a, 0x3bff: 0x000a, // Block 0xf0, offset 0x3c00 0x3c01: 0x000a, 0x3c02: 0x000a, 0x3c03: 0x000a, 0x3c04: 0x000a, 0x3c05: 0x000a, 0x3c06: 0x000a, 0x3c07: 0x000a, 0x3c08: 0x000a, 0x3c09: 0x000a, 0x3c0a: 0x000a, 0x3c0b: 0x000a, 0x3c0c: 0x000a, 0x3c0d: 0x000a, 0x3c0e: 0x000a, 0x3c0f: 0x000a, 0x3c11: 0x000a, 0x3c12: 0x000a, 0x3c13: 0x000a, 0x3c14: 0x000a, 0x3c15: 0x000a, 0x3c16: 0x000a, 0x3c17: 0x000a, 0x3c18: 0x000a, 0x3c19: 0x000a, 0x3c1a: 0x000a, 0x3c1b: 0x000a, 0x3c1c: 0x000a, 0x3c1d: 0x000a, 0x3c1e: 0x000a, 0x3c1f: 0x000a, 0x3c20: 0x000a, 0x3c21: 0x000a, 0x3c22: 0x000a, 0x3c23: 0x000a, 0x3c24: 0x000a, 0x3c25: 0x000a, 0x3c26: 0x000a, 0x3c27: 0x000a, 0x3c28: 0x000a, 0x3c29: 0x000a, 0x3c2a: 0x000a, 0x3c2b: 0x000a, 0x3c2c: 0x000a, 0x3c2d: 0x000a, 0x3c2e: 0x000a, 0x3c2f: 0x000a, 0x3c30: 0x000a, 0x3c31: 0x000a, 0x3c32: 0x000a, 0x3c33: 0x000a, 0x3c34: 0x000a, 0x3c35: 0x000a, // Block 0xf1, offset 0x3c40 0x3c40: 0x0002, 0x3c41: 0x0002, 0x3c42: 0x0002, 0x3c43: 0x0002, 0x3c44: 0x0002, 0x3c45: 0x0002, 0x3c46: 0x0002, 0x3c47: 0x0002, 0x3c48: 0x0002, 0x3c49: 0x0002, 0x3c4a: 0x0002, 0x3c4b: 0x000a, 0x3c4c: 0x000a, 0x3c4d: 0x000a, 0x3c4e: 0x000a, 0x3c4f: 0x000a, 0x3c6f: 0x000a, // Block 0xf2, offset 0x3c80 0x3caa: 0x000a, 0x3cab: 0x000a, 0x3cac: 0x000a, 0x3cad: 0x000a, 0x3cae: 0x000a, 0x3caf: 0x000a, // Block 0xf3, offset 0x3cc0 0x3ced: 0x000a, // Block 0xf4, offset 0x3d00 0x3d20: 0x000a, 0x3d21: 0x000a, 0x3d22: 0x000a, 0x3d23: 0x000a, 0x3d24: 0x000a, 0x3d25: 0x000a, // Block 0xf5, offset 0x3d40 0x3d40: 0x000a, 0x3d41: 0x000a, 0x3d42: 0x000a, 0x3d43: 0x000a, 0x3d44: 0x000a, 0x3d45: 0x000a, 0x3d46: 0x000a, 0x3d47: 0x000a, 0x3d48: 0x000a, 0x3d49: 0x000a, 0x3d4a: 0x000a, 0x3d4b: 0x000a, 0x3d4c: 0x000a, 0x3d4d: 0x000a, 0x3d4e: 0x000a, 0x3d4f: 0x000a, 0x3d50: 0x000a, 0x3d51: 0x000a, 0x3d52: 0x000a, 0x3d53: 0x000a, 0x3d54: 0x000a, 0x3d55: 0x000a, 0x3d56: 0x000a, 0x3d57: 0x000a, 0x3d5c: 0x000a, 0x3d5d: 0x000a, 0x3d5e: 0x000a, 0x3d5f: 0x000a, 0x3d60: 0x000a, 0x3d61: 0x000a, 0x3d62: 0x000a, 0x3d63: 0x000a, 0x3d64: 0x000a, 0x3d65: 0x000a, 0x3d66: 0x000a, 0x3d67: 0x000a, 0x3d68: 0x000a, 0x3d69: 0x000a, 0x3d6a: 0x000a, 0x3d6b: 0x000a, 0x3d6c: 0x000a, 0x3d70: 0x000a, 0x3d71: 0x000a, 0x3d72: 0x000a, 0x3d73: 0x000a, 0x3d74: 0x000a, 0x3d75: 0x000a, 0x3d76: 0x000a, 0x3d77: 0x000a, 0x3d78: 0x000a, 0x3d79: 0x000a, 0x3d7a: 0x000a, 0x3d7b: 0x000a, 0x3d7c: 0x000a, // Block 0xf6, offset 0x3d80 0x3d80: 0x000a, 0x3d81: 0x000a, 0x3d82: 0x000a, 0x3d83: 0x000a, 0x3d84: 0x000a, 0x3d85: 0x000a, 0x3d86: 0x000a, 0x3d87: 0x000a, 0x3d88: 0x000a, 0x3d89: 0x000a, 0x3d8a: 0x000a, 0x3d8b: 0x000a, 0x3d8c: 0x000a, 0x3d8d: 0x000a, 0x3d8e: 0x000a, 0x3d8f: 0x000a, 0x3d90: 0x000a, 0x3d91: 0x000a, 0x3d92: 0x000a, 0x3d93: 0x000a, 0x3d94: 0x000a, 0x3d95: 0x000a, 0x3d96: 0x000a, 0x3d97: 0x000a, 0x3d98: 0x000a, 0x3d99: 0x000a, 0x3d9a: 0x000a, 0x3d9b: 0x000a, 0x3d9c: 0x000a, 0x3d9d: 0x000a, 0x3d9e: 0x000a, 0x3d9f: 0x000a, 0x3da0: 0x000a, 0x3da1: 0x000a, 0x3da2: 0x000a, 0x3da3: 0x000a, 0x3da4: 0x000a, 0x3da5: 0x000a, 0x3da6: 0x000a, 0x3da7: 0x000a, 0x3da8: 0x000a, 0x3da9: 0x000a, 0x3daa: 0x000a, 0x3dab: 0x000a, 0x3dac: 0x000a, 0x3dad: 0x000a, 0x3dae: 0x000a, 0x3daf: 0x000a, 0x3db0: 0x000a, 0x3db1: 0x000a, 0x3db2: 0x000a, 0x3db3: 0x000a, 0x3db4: 0x000a, 0x3db5: 0x000a, 0x3db6: 0x000a, 0x3dbb: 0x000a, 0x3dbc: 0x000a, 0x3dbd: 0x000a, 0x3dbe: 0x000a, 0x3dbf: 0x000a, // Block 0xf7, offset 0x3dc0 0x3dc0: 0x000a, 0x3dc1: 0x000a, 0x3dc2: 0x000a, 0x3dc3: 0x000a, 0x3dc4: 0x000a, 0x3dc5: 0x000a, 0x3dc6: 0x000a, 0x3dc7: 0x000a, 0x3dc8: 0x000a, 0x3dc9: 0x000a, 0x3dca: 0x000a, 0x3dcb: 0x000a, 0x3dcc: 0x000a, 0x3dcd: 0x000a, 0x3dce: 0x000a, 0x3dcf: 0x000a, 0x3dd0: 0x000a, 0x3dd1: 0x000a, 0x3dd2: 0x000a, 0x3dd3: 0x000a, 0x3dd4: 0x000a, 0x3dd5: 0x000a, 0x3dd6: 0x000a, 0x3dd7: 0x000a, 0x3dd8: 0x000a, 0x3dd9: 0x000a, 0x3de0: 0x000a, 0x3de1: 0x000a, 0x3de2: 0x000a, 0x3de3: 0x000a, 0x3de4: 0x000a, 0x3de5: 0x000a, 0x3de6: 0x000a, 0x3de7: 0x000a, 0x3de8: 0x000a, 0x3de9: 0x000a, 0x3dea: 0x000a, 0x3deb: 0x000a, 0x3df0: 0x000a, // Block 0xf8, offset 0x3e00 0x3e00: 0x000a, 0x3e01: 0x000a, 0x3e02: 0x000a, 0x3e03: 0x000a, 0x3e04: 0x000a, 0x3e05: 0x000a, 0x3e06: 0x000a, 0x3e07: 0x000a, 0x3e08: 0x000a, 0x3e09: 0x000a, 0x3e0a: 0x000a, 0x3e0b: 0x000a, 0x3e10: 0x000a, 0x3e11: 0x000a, 0x3e12: 0x000a, 0x3e13: 0x000a, 0x3e14: 0x000a, 0x3e15: 0x000a, 0x3e16: 0x000a, 0x3e17: 0x000a, 0x3e18: 0x000a, 0x3e19: 0x000a, 0x3e1a: 0x000a, 0x3e1b: 0x000a, 0x3e1c: 0x000a, 0x3e1d: 0x000a, 0x3e1e: 0x000a, 0x3e1f: 0x000a, 0x3e20: 0x000a, 0x3e21: 0x000a, 0x3e22: 0x000a, 0x3e23: 0x000a, 0x3e24: 0x000a, 0x3e25: 0x000a, 0x3e26: 0x000a, 0x3e27: 0x000a, 0x3e28: 0x000a, 0x3e29: 0x000a, 0x3e2a: 0x000a, 0x3e2b: 0x000a, 0x3e2c: 0x000a, 0x3e2d: 0x000a, 0x3e2e: 0x000a, 0x3e2f: 0x000a, 0x3e30: 0x000a, 0x3e31: 0x000a, 0x3e32: 0x000a, 0x3e33: 0x000a, 0x3e34: 0x000a, 0x3e35: 0x000a, 0x3e36: 0x000a, 0x3e37: 0x000a, 0x3e38: 0x000a, 0x3e39: 0x000a, 0x3e3a: 0x000a, 0x3e3b: 0x000a, 0x3e3c: 0x000a, 0x3e3d: 0x000a, 0x3e3e: 0x000a, 0x3e3f: 0x000a, // Block 0xf9, offset 0x3e40 0x3e40: 0x000a, 0x3e41: 0x000a, 0x3e42: 0x000a, 0x3e43: 0x000a, 0x3e44: 0x000a, 0x3e45: 0x000a, 0x3e46: 0x000a, 0x3e47: 0x000a, 0x3e50: 0x000a, 0x3e51: 0x000a, 0x3e52: 0x000a, 0x3e53: 0x000a, 0x3e54: 0x000a, 0x3e55: 0x000a, 0x3e56: 0x000a, 0x3e57: 0x000a, 0x3e58: 0x000a, 0x3e59: 0x000a, 0x3e60: 0x000a, 0x3e61: 0x000a, 0x3e62: 0x000a, 0x3e63: 0x000a, 0x3e64: 0x000a, 0x3e65: 0x000a, 0x3e66: 0x000a, 0x3e67: 0x000a, 0x3e68: 0x000a, 0x3e69: 0x000a, 0x3e6a: 0x000a, 0x3e6b: 0x000a, 0x3e6c: 0x000a, 0x3e6d: 0x000a, 0x3e6e: 0x000a, 0x3e6f: 0x000a, 0x3e70: 0x000a, 0x3e71: 0x000a, 0x3e72: 0x000a, 0x3e73: 0x000a, 0x3e74: 0x000a, 0x3e75: 0x000a, 0x3e76: 0x000a, 0x3e77: 0x000a, 0x3e78: 0x000a, 0x3e79: 0x000a, 0x3e7a: 0x000a, 0x3e7b: 0x000a, 0x3e7c: 0x000a, 0x3e7d: 0x000a, 0x3e7e: 0x000a, 0x3e7f: 0x000a, // Block 0xfa, offset 0x3e80 0x3e80: 0x000a, 0x3e81: 0x000a, 0x3e82: 0x000a, 0x3e83: 0x000a, 0x3e84: 0x000a, 0x3e85: 0x000a, 0x3e86: 0x000a, 0x3e87: 0x000a, 0x3e90: 0x000a, 0x3e91: 0x000a, 0x3e92: 0x000a, 0x3e93: 0x000a, 0x3e94: 0x000a, 0x3e95: 0x000a, 0x3e96: 0x000a, 0x3e97: 0x000a, 0x3e98: 0x000a, 0x3e99: 0x000a, 0x3e9a: 0x000a, 0x3e9b: 0x000a, 0x3e9c: 0x000a, 0x3e9d: 0x000a, 0x3e9e: 0x000a, 0x3e9f: 0x000a, 0x3ea0: 0x000a, 0x3ea1: 0x000a, 0x3ea2: 0x000a, 0x3ea3: 0x000a, 0x3ea4: 0x000a, 0x3ea5: 0x000a, 0x3ea6: 0x000a, 0x3ea7: 0x000a, 0x3ea8: 0x000a, 0x3ea9: 0x000a, 0x3eaa: 0x000a, 0x3eab: 0x000a, 0x3eac: 0x000a, 0x3ead: 0x000a, 0x3eb0: 0x000a, 0x3eb1: 0x000a, // Block 0xfb, offset 0x3ec0 0x3ec0: 0x000a, 0x3ec1: 0x000a, 0x3ec2: 0x000a, 0x3ec3: 0x000a, 0x3ec4: 0x000a, 0x3ec5: 0x000a, 0x3ec6: 0x000a, 0x3ec7: 0x000a, 0x3ec8: 0x000a, 0x3ec9: 0x000a, 0x3eca: 0x000a, 0x3ecb: 0x000a, 0x3ecc: 0x000a, 0x3ecd: 0x000a, 0x3ece: 0x000a, 0x3ecf: 0x000a, 0x3ed0: 0x000a, 0x3ed1: 0x000a, 0x3ed2: 0x000a, 0x3ed3: 0x000a, 0x3ee0: 0x000a, 0x3ee1: 0x000a, 0x3ee2: 0x000a, 0x3ee3: 0x000a, 0x3ee4: 0x000a, 0x3ee5: 0x000a, 0x3ee6: 0x000a, 0x3ee7: 0x000a, 0x3ee8: 0x000a, 0x3ee9: 0x000a, 0x3eea: 0x000a, 0x3eeb: 0x000a, 0x3eec: 0x000a, 0x3eed: 0x000a, 0x3ef0: 0x000a, 0x3ef1: 0x000a, 0x3ef2: 0x000a, 0x3ef3: 0x000a, 0x3ef4: 0x000a, 0x3ef5: 0x000a, 0x3ef6: 0x000a, 0x3ef7: 0x000a, 0x3ef8: 0x000a, 0x3ef9: 0x000a, 0x3efa: 0x000a, 0x3efb: 0x000a, 0x3efc: 0x000a, // Block 0xfc, offset 0x3f00 0x3f00: 0x000a, 0x3f01: 0x000a, 0x3f02: 0x000a, 0x3f03: 0x000a, 0x3f04: 0x000a, 0x3f05: 0x000a, 0x3f06: 0x000a, 0x3f07: 0x000a, 0x3f08: 0x000a, 0x3f10: 0x000a, 0x3f11: 0x000a, 0x3f12: 0x000a, 0x3f13: 0x000a, 0x3f14: 0x000a, 0x3f15: 0x000a, 0x3f16: 0x000a, 0x3f17: 0x000a, 0x3f18: 0x000a, 0x3f19: 0x000a, 0x3f1a: 0x000a, 0x3f1b: 0x000a, 0x3f1c: 0x000a, 0x3f1d: 0x000a, 0x3f1e: 0x000a, 0x3f1f: 0x000a, 0x3f20: 0x000a, 0x3f21: 0x000a, 0x3f22: 0x000a, 0x3f23: 0x000a, 0x3f24: 0x000a, 0x3f25: 0x000a, 0x3f26: 0x000a, 0x3f27: 0x000a, 0x3f28: 0x000a, 0x3f29: 0x000a, 0x3f2a: 0x000a, 0x3f2b: 0x000a, 0x3f2c: 0x000a, 0x3f2d: 0x000a, 0x3f2e: 0x000a, 0x3f2f: 0x000a, 0x3f30: 0x000a, 0x3f31: 0x000a, 0x3f32: 0x000a, 0x3f33: 0x000a, 0x3f34: 0x000a, 0x3f35: 0x000a, 0x3f36: 0x000a, 0x3f37: 0x000a, 0x3f38: 0x000a, 0x3f39: 0x000a, 0x3f3a: 0x000a, 0x3f3b: 0x000a, 0x3f3c: 0x000a, 0x3f3d: 0x000a, 0x3f3f: 0x000a, // Block 0xfd, offset 0x3f40 0x3f40: 0x000a, 0x3f41: 0x000a, 0x3f42: 0x000a, 0x3f43: 0x000a, 0x3f44: 0x000a, 0x3f45: 0x000a, 0x3f4e: 0x000a, 0x3f4f: 0x000a, 0x3f50: 0x000a, 0x3f51: 0x000a, 0x3f52: 0x000a, 0x3f53: 0x000a, 0x3f54: 0x000a, 0x3f55: 0x000a, 0x3f56: 0x000a, 0x3f57: 0x000a, 0x3f58: 0x000a, 0x3f59: 0x000a, 0x3f5a: 0x000a, 0x3f5b: 0x000a, 0x3f60: 0x000a, 0x3f61: 0x000a, 0x3f62: 0x000a, 0x3f63: 0x000a, 0x3f64: 0x000a, 0x3f65: 0x000a, 0x3f66: 0x000a, 0x3f67: 0x000a, 0x3f68: 0x000a, 0x3f70: 0x000a, 0x3f71: 0x000a, 0x3f72: 0x000a, 0x3f73: 0x000a, 0x3f74: 0x000a, 0x3f75: 0x000a, 0x3f76: 0x000a, 0x3f77: 0x000a, 0x3f78: 0x000a, // Block 0xfe, offset 0x3f80 0x3f80: 0x000a, 0x3f81: 0x000a, 0x3f82: 0x000a, 0x3f83: 0x000a, 0x3f84: 0x000a, 0x3f85: 0x000a, 0x3f86: 0x000a, 0x3f87: 0x000a, 0x3f88: 0x000a, 0x3f89: 0x000a, 0x3f8a: 0x000a, 0x3f8b: 0x000a, 0x3f8c: 0x000a, 0x3f8d: 0x000a, 0x3f8e: 0x000a, 0x3f8f: 0x000a, 0x3f90: 0x000a, 0x3f91: 0x000a, 0x3f92: 0x000a, 0x3f94: 0x000a, 0x3f95: 0x000a, 0x3f96: 0x000a, 0x3f97: 0x000a, 0x3f98: 0x000a, 0x3f99: 0x000a, 0x3f9a: 0x000a, 0x3f9b: 0x000a, 0x3f9c: 0x000a, 0x3f9d: 0x000a, 0x3f9e: 0x000a, 0x3f9f: 0x000a, 0x3fa0: 0x000a, 0x3fa1: 0x000a, 0x3fa2: 0x000a, 0x3fa3: 0x000a, 0x3fa4: 0x000a, 0x3fa5: 0x000a, 0x3fa6: 0x000a, 0x3fa7: 0x000a, 0x3fa8: 0x000a, 0x3fa9: 0x000a, 0x3faa: 0x000a, 0x3fab: 0x000a, 0x3fac: 0x000a, 0x3fad: 0x000a, 0x3fae: 0x000a, 0x3faf: 0x000a, 0x3fb0: 0x000a, 0x3fb1: 0x000a, 0x3fb2: 0x000a, 0x3fb3: 0x000a, 0x3fb4: 0x000a, 0x3fb5: 0x000a, 0x3fb6: 0x000a, 0x3fb7: 0x000a, 0x3fb8: 0x000a, 0x3fb9: 0x000a, 0x3fba: 0x000a, 0x3fbb: 0x000a, 0x3fbc: 0x000a, 0x3fbd: 0x000a, 0x3fbe: 0x000a, 0x3fbf: 0x000a, // Block 0xff, offset 0x3fc0 0x3fc0: 0x000a, 0x3fc1: 0x000a, 0x3fc2: 0x000a, 0x3fc3: 0x000a, 0x3fc4: 0x000a, 0x3fc5: 0x000a, 0x3fc6: 0x000a, 0x3fc7: 0x000a, 0x3fc8: 0x000a, 0x3fc9: 0x000a, 0x3fca: 0x000a, 0x3ff0: 0x0002, 0x3ff1: 0x0002, 0x3ff2: 0x0002, 0x3ff3: 0x0002, 0x3ff4: 0x0002, 0x3ff5: 0x0002, 0x3ff6: 0x0002, 0x3ff7: 0x0002, 0x3ff8: 0x0002, 0x3ff9: 0x0002, // Block 0x100, offset 0x4000 0x403e: 0x000b, 0x403f: 0x000b, // Block 0x101, offset 0x4040 0x4040: 0x000b, 0x4041: 0x000b, 0x4042: 0x000b, 0x4043: 0x000b, 0x4044: 0x000b, 0x4045: 0x000b, 0x4046: 0x000b, 0x4047: 0x000b, 0x4048: 0x000b, 0x4049: 0x000b, 0x404a: 0x000b, 0x404b: 0x000b, 0x404c: 0x000b, 0x404d: 0x000b, 0x404e: 0x000b, 0x404f: 0x000b, 0x4050: 0x000b, 0x4051: 0x000b, 0x4052: 0x000b, 0x4053: 0x000b, 0x4054: 0x000b, 0x4055: 0x000b, 0x4056: 0x000b, 0x4057: 0x000b, 0x4058: 0x000b, 0x4059: 0x000b, 0x405a: 0x000b, 0x405b: 0x000b, 0x405c: 0x000b, 0x405d: 0x000b, 0x405e: 0x000b, 0x405f: 0x000b, 0x4060: 0x000b, 0x4061: 0x000b, 0x4062: 0x000b, 0x4063: 0x000b, 0x4064: 0x000b, 0x4065: 0x000b, 0x4066: 0x000b, 0x4067: 0x000b, 0x4068: 0x000b, 0x4069: 0x000b, 0x406a: 0x000b, 0x406b: 0x000b, 0x406c: 0x000b, 0x406d: 0x000b, 0x406e: 0x000b, 0x406f: 0x000b, 0x4070: 0x000b, 0x4071: 0x000b, 0x4072: 0x000b, 0x4073: 0x000b, 0x4074: 0x000b, 0x4075: 0x000b, 0x4076: 0x000b, 0x4077: 0x000b, 0x4078: 0x000b, 0x4079: 0x000b, 0x407a: 0x000b, 0x407b: 0x000b, 0x407c: 0x000b, 0x407d: 0x000b, 0x407e: 0x000b, 0x407f: 0x000b, // Block 0x102, offset 0x4080 0x4080: 0x000c, 0x4081: 0x000c, 0x4082: 0x000c, 0x4083: 0x000c, 0x4084: 0x000c, 0x4085: 0x000c, 0x4086: 0x000c, 0x4087: 0x000c, 0x4088: 0x000c, 0x4089: 0x000c, 0x408a: 0x000c, 0x408b: 0x000c, 0x408c: 0x000c, 0x408d: 0x000c, 0x408e: 0x000c, 0x408f: 0x000c, 0x4090: 0x000c, 0x4091: 0x000c, 0x4092: 0x000c, 0x4093: 0x000c, 0x4094: 0x000c, 0x4095: 0x000c, 0x4096: 0x000c, 0x4097: 0x000c, 0x4098: 0x000c, 0x4099: 0x000c, 0x409a: 0x000c, 0x409b: 0x000c, 0x409c: 0x000c, 0x409d: 0x000c, 0x409e: 0x000c, 0x409f: 0x000c, 0x40a0: 0x000c, 0x40a1: 0x000c, 0x40a2: 0x000c, 0x40a3: 0x000c, 0x40a4: 0x000c, 0x40a5: 0x000c, 0x40a6: 0x000c, 0x40a7: 0x000c, 0x40a8: 0x000c, 0x40a9: 0x000c, 0x40aa: 0x000c, 0x40ab: 0x000c, 0x40ac: 0x000c, 0x40ad: 0x000c, 0x40ae: 0x000c, 0x40af: 0x000c, 0x40b0: 0x000b, 0x40b1: 0x000b, 0x40b2: 0x000b, 0x40b3: 0x000b, 0x40b4: 0x000b, 0x40b5: 0x000b, 0x40b6: 0x000b, 0x40b7: 0x000b, 0x40b8: 0x000b, 0x40b9: 0x000b, 0x40ba: 0x000b, 0x40bb: 0x000b, 0x40bc: 0x000b, 0x40bd: 0x000b, 0x40be: 0x000b, 0x40bf: 0x000b, } // bidiIndex: 26 blocks, 1664 entries, 3328 bytes // Block 0 is the zero block. var bidiIndex = [1664]uint16{ // Block 0x0, offset 0x0 // Block 0x1, offset 0x40 // Block 0x2, offset 0x80 // Block 0x3, offset 0xc0 0xc2: 0x01, 0xc3: 0x02, 0xca: 0x03, 0xcb: 0x04, 0xcc: 0x05, 0xcd: 0x06, 0xce: 0x07, 0xcf: 0x08, 0xd2: 0x09, 0xd6: 0x0a, 0xd7: 0x0b, 0xd8: 0x0c, 0xd9: 0x0d, 0xda: 0x0e, 0xdb: 0x0f, 0xdc: 0x10, 0xdd: 0x11, 0xde: 0x12, 0xdf: 0x13, 0xe0: 0x02, 0xe1: 0x03, 0xe2: 0x04, 0xe3: 0x05, 0xe4: 0x06, 0xea: 0x07, 0xef: 0x08, 0xf0: 0x13, 0xf1: 0x14, 0xf2: 0x14, 0xf3: 0x16, 0xf4: 0x17, // Block 0x4, offset 0x100 0x120: 0x14, 0x121: 0x15, 0x122: 0x16, 0x123: 0x17, 0x124: 0x18, 0x125: 0x19, 0x126: 0x1a, 0x127: 0x1b, 0x128: 0x1c, 0x129: 0x1d, 0x12a: 0x1c, 0x12b: 0x1e, 0x12c: 0x1f, 0x12d: 0x20, 0x12e: 0x21, 0x12f: 0x22, 0x130: 0x23, 0x131: 0x24, 0x132: 0x1a, 0x133: 0x25, 0x134: 0x26, 0x135: 0x27, 0x136: 0x28, 0x137: 0x29, 0x138: 0x2a, 0x139: 0x2b, 0x13a: 0x2c, 0x13b: 0x2d, 0x13c: 0x2e, 0x13d: 0x2f, 0x13e: 0x30, 0x13f: 0x31, // Block 0x5, offset 0x140 0x140: 0x32, 0x141: 0x33, 0x142: 0x34, 0x14d: 0x35, 0x14e: 0x36, 0x150: 0x37, 0x15a: 0x38, 0x15c: 0x39, 0x15d: 0x3a, 0x15e: 0x3b, 0x15f: 0x3c, 0x160: 0x3d, 0x162: 0x3e, 0x164: 0x3f, 0x165: 0x40, 0x167: 0x41, 0x168: 0x42, 0x169: 0x43, 0x16a: 0x44, 0x16b: 0x45, 0x16c: 0x46, 0x16d: 0x47, 0x16e: 0x48, 0x16f: 0x49, 0x170: 0x4a, 0x173: 0x4b, 0x177: 0x05, 0x17e: 0x4c, 0x17f: 0x4d, // Block 0x6, offset 0x180 0x180: 0x4e, 0x181: 0x4f, 0x182: 0x50, 0x183: 0x51, 0x184: 0x52, 0x185: 0x53, 0x186: 0x54, 0x187: 0x55, 0x188: 0x56, 0x189: 0x55, 0x18a: 0x55, 0x18b: 0x55, 0x18c: 0x57, 0x18d: 0x58, 0x18e: 0x59, 0x18f: 0x55, 0x190: 0x5a, 0x191: 0x5b, 0x192: 0x5c, 0x193: 0x5d, 0x194: 0x55, 0x195: 0x55, 0x196: 0x55, 0x197: 0x55, 0x198: 0x55, 0x199: 0x55, 0x19a: 0x5e, 0x19b: 0x55, 0x19c: 0x55, 0x19d: 0x5f, 0x19e: 0x55, 0x19f: 0x60, 0x1a4: 0x55, 0x1a5: 0x55, 0x1a6: 0x61, 0x1a7: 0x62, 0x1a8: 0x55, 0x1a9: 0x55, 0x1aa: 0x55, 0x1ab: 0x55, 0x1ac: 0x55, 0x1ad: 0x63, 0x1ae: 0x64, 0x1af: 0x55, 0x1b3: 0x65, 0x1b5: 0x66, 0x1b7: 0x67, 0x1b8: 0x68, 0x1b9: 0x69, 0x1ba: 0x6a, 0x1bb: 0x6b, 0x1bc: 0x55, 0x1bd: 0x55, 0x1be: 0x55, 0x1bf: 0x6c, // Block 0x7, offset 0x1c0 0x1c0: 0x6d, 0x1c2: 0x6e, 0x1c3: 0x6f, 0x1c7: 0x70, 0x1c8: 0x71, 0x1c9: 0x72, 0x1ca: 0x73, 0x1cb: 0x74, 0x1cd: 0x75, 0x1cf: 0x76, // Block 0x8, offset 0x200 0x237: 0x55, // Block 0x9, offset 0x240 0x252: 0x77, 0x253: 0x78, 0x258: 0x79, 0x259: 0x7a, 0x25a: 0x7b, 0x25b: 0x7c, 0x25c: 0x7d, 0x25e: 0x7e, 0x260: 0x7f, 0x261: 0x80, 0x263: 0x81, 0x264: 0x82, 0x265: 0x83, 0x266: 0x84, 0x267: 0x85, 0x268: 0x86, 0x269: 0x87, 0x26a: 0x88, 0x26b: 0x89, 0x26d: 0x8a, 0x26f: 0x8b, // Block 0xa, offset 0x280 0x2ac: 0x8c, 0x2ad: 0x8d, 0x2ae: 0x0e, 0x2af: 0x0e, 0x2b0: 0x0e, 0x2b1: 0x0e, 0x2b2: 0x0e, 0x2b3: 0x0e, 0x2b4: 0x8e, 0x2b5: 0x8f, 0x2b6: 0x0e, 0x2b7: 0x90, 0x2b8: 0x91, 0x2b9: 0x92, 0x2ba: 0x0e, 0x2bb: 0x93, 0x2bc: 0x94, 0x2bd: 0x95, 0x2bf: 0x96, // Block 0xb, offset 0x2c0 0x2c4: 0x97, 0x2c5: 0x55, 0x2c6: 0x98, 0x2c7: 0x99, 0x2cb: 0x9a, 0x2cd: 0x9b, 0x2e0: 0x9c, 0x2e1: 0x9c, 0x2e2: 0x9c, 0x2e3: 0x9c, 0x2e4: 0x9d, 0x2e5: 0x9c, 0x2e6: 0x9c, 0x2e7: 0x9c, 0x2e8: 0x9e, 0x2e9: 0x9c, 0x2ea: 0x9c, 0x2eb: 0x9f, 0x2ec: 0xa0, 0x2ed: 0x9c, 0x2ee: 0x9c, 0x2ef: 0x9c, 0x2f0: 0x9c, 0x2f1: 0x9c, 0x2f2: 0x9c, 0x2f3: 0x9c, 0x2f4: 0xa1, 0x2f5: 0x9c, 0x2f6: 0x9c, 0x2f7: 0x9c, 0x2f8: 0x9c, 0x2f9: 0xa2, 0x2fa: 0xa3, 0x2fb: 0xa4, 0x2fc: 0xa5, 0x2fd: 0xa6, 0x2fe: 0xa7, 0x2ff: 0x9c, // Block 0xc, offset 0x300 0x300: 0xa8, 0x301: 0xa9, 0x302: 0xaa, 0x303: 0x21, 0x304: 0xab, 0x305: 0xac, 0x306: 0xad, 0x307: 0xae, 0x308: 0xaf, 0x309: 0x28, 0x30b: 0xb0, 0x30c: 0x26, 0x30d: 0xb1, 0x310: 0xb2, 0x311: 0xb3, 0x312: 0xb4, 0x313: 0xb5, 0x316: 0xb6, 0x317: 0xb7, 0x318: 0xb8, 0x319: 0xb9, 0x31a: 0xba, 0x31c: 0xbb, 0x320: 0xbc, 0x324: 0xbd, 0x325: 0xbe, 0x327: 0xbf, 0x328: 0xc0, 0x329: 0xc1, 0x32a: 0xc2, 0x330: 0xc3, 0x332: 0xc4, 0x334: 0xc5, 0x335: 0xc6, 0x336: 0xc7, 0x33b: 0xc8, 0x33c: 0xc9, 0x33d: 0xca, 0x33f: 0xcb, // Block 0xd, offset 0x340 0x351: 0xcc, // Block 0xe, offset 0x380 0x3ab: 0xcd, 0x3ac: 0xce, 0x3bd: 0xcf, 0x3be: 0xd0, 0x3bf: 0xd1, // Block 0xf, offset 0x3c0 0x3f2: 0xd2, // Block 0x10, offset 0x400 0x43c: 0xd3, 0x43d: 0xd4, // Block 0x11, offset 0x440 0x445: 0xd5, 0x446: 0xd6, 0x447: 0xd7, 0x448: 0x55, 0x449: 0xd8, 0x44c: 0x55, 0x44d: 0xd9, 0x45b: 0xda, 0x45c: 0xdb, 0x45d: 0xdc, 0x45e: 0xdd, 0x45f: 0xde, 0x468: 0xdf, 0x469: 0xe0, 0x46a: 0xe1, // Block 0x12, offset 0x480 0x480: 0xe2, 0x482: 0xcf, 0x484: 0xce, 0x48a: 0xe3, 0x48b: 0xe4, 0x493: 0xe5, 0x4a0: 0x9c, 0x4a1: 0x9c, 0x4a2: 0x9c, 0x4a3: 0xe6, 0x4a4: 0x9c, 0x4a5: 0xe7, 0x4a6: 0x9c, 0x4a7: 0x9c, 0x4a8: 0x9c, 0x4a9: 0x9c, 0x4aa: 0x9c, 0x4ab: 0x9c, 0x4ac: 0x9c, 0x4ad: 0x9c, 0x4ae: 0x9c, 0x4af: 0x9c, 0x4b0: 0x9c, 0x4b1: 0xe8, 0x4b2: 0xe9, 0x4b3: 0x9c, 0x4b4: 0xea, 0x4b5: 0x9c, 0x4b6: 0x9c, 0x4b7: 0x9c, 0x4b8: 0x0e, 0x4b9: 0x0e, 0x4ba: 0x0e, 0x4bb: 0xeb, 0x4bc: 0x9c, 0x4bd: 0x9c, 0x4be: 0x9c, 0x4bf: 0x9c, // Block 0x13, offset 0x4c0 0x4c0: 0xec, 0x4c1: 0x55, 0x4c2: 0xed, 0x4c3: 0xee, 0x4c4: 0xef, 0x4c5: 0xf0, 0x4c6: 0xf1, 0x4c9: 0xf2, 0x4cc: 0x55, 0x4cd: 0x55, 0x4ce: 0x55, 0x4cf: 0x55, 0x4d0: 0x55, 0x4d1: 0x55, 0x4d2: 0x55, 0x4d3: 0x55, 0x4d4: 0x55, 0x4d5: 0x55, 0x4d6: 0x55, 0x4d7: 0x55, 0x4d8: 0x55, 0x4d9: 0x55, 0x4da: 0x55, 0x4db: 0xf3, 0x4dc: 0x55, 0x4dd: 0xf4, 0x4de: 0x55, 0x4df: 0xf5, 0x4e0: 0xf6, 0x4e1: 0xf7, 0x4e2: 0xf8, 0x4e4: 0x55, 0x4e5: 0x55, 0x4e6: 0x55, 0x4e7: 0x55, 0x4e8: 0x55, 0x4e9: 0xf9, 0x4ea: 0xfa, 0x4eb: 0xfb, 0x4ec: 0x55, 0x4ed: 0x55, 0x4ee: 0xfc, 0x4ef: 0xfd, 0x4ff: 0xfe, // Block 0x14, offset 0x500 0x53f: 0xfe, // Block 0x15, offset 0x540 0x550: 0x09, 0x551: 0x0a, 0x553: 0x0b, 0x556: 0x0c, 0x55b: 0x0d, 0x55c: 0x0e, 0x55d: 0x0f, 0x55e: 0x10, 0x55f: 0x11, 0x56f: 0x12, 0x57f: 0x12, // Block 0x16, offset 0x580 0x58f: 0x12, 0x59f: 0x12, 0x5af: 0x12, 0x5bf: 0x12, // Block 0x17, offset 0x5c0 0x5c0: 0xff, 0x5c1: 0xff, 0x5c2: 0xff, 0x5c3: 0xff, 0x5c4: 0x05, 0x5c5: 0x05, 0x5c6: 0x05, 0x5c7: 0x100, 0x5c8: 0xff, 0x5c9: 0xff, 0x5ca: 0xff, 0x5cb: 0xff, 0x5cc: 0xff, 0x5cd: 0xff, 0x5ce: 0xff, 0x5cf: 0xff, 0x5d0: 0xff, 0x5d1: 0xff, 0x5d2: 0xff, 0x5d3: 0xff, 0x5d4: 0xff, 0x5d5: 0xff, 0x5d6: 0xff, 0x5d7: 0xff, 0x5d8: 0xff, 0x5d9: 0xff, 0x5da: 0xff, 0x5db: 0xff, 0x5dc: 0xff, 0x5dd: 0xff, 0x5de: 0xff, 0x5df: 0xff, 0x5e0: 0xff, 0x5e1: 0xff, 0x5e2: 0xff, 0x5e3: 0xff, 0x5e4: 0xff, 0x5e5: 0xff, 0x5e6: 0xff, 0x5e7: 0xff, 0x5e8: 0xff, 0x5e9: 0xff, 0x5ea: 0xff, 0x5eb: 0xff, 0x5ec: 0xff, 0x5ed: 0xff, 0x5ee: 0xff, 0x5ef: 0xff, 0x5f0: 0xff, 0x5f1: 0xff, 0x5f2: 0xff, 0x5f3: 0xff, 0x5f4: 0xff, 0x5f5: 0xff, 0x5f6: 0xff, 0x5f7: 0xff, 0x5f8: 0xff, 0x5f9: 0xff, 0x5fa: 0xff, 0x5fb: 0xff, 0x5fc: 0xff, 0x5fd: 0xff, 0x5fe: 0xff, 0x5ff: 0xff, // Block 0x18, offset 0x600 0x60f: 0x12, 0x61f: 0x12, 0x620: 0x15, 0x62f: 0x12, 0x63f: 0x12, // Block 0x19, offset 0x640 0x64f: 0x12, } // Total table size 19960 bytes (19KiB); checksum: F50EF68C ================================================ FILE: vendor/golang.org/x/text/unicode/bidi/tables17.0.0.go ================================================ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. //go:build go1.27 package bidi // UnicodeVersion is the Unicode version from which the tables in this package are derived. const UnicodeVersion = "17.0.0" // xorMasks contains masks to be xor-ed with brackets to get the reverse // version. var xorMasks = []int32{ // 8 elements 0, 1, 6, 7, 3, 15, 29, 63, } // Size: 56 bytes // lookup returns the trie value for the first UTF-8 encoding in s and // the width in bytes of this encoding. The size will be 0 if s does not // hold enough bytes to complete the encoding. len(s) must be greater than 0. func (t *bidiTrie) lookup(s []byte) (v uint8, sz int) { c0 := s[0] switch { case c0 < 0x80: // is ASCII return bidiValues[c0], 1 case c0 < 0xC2: return 0, 1 // Illegal UTF-8: not a starter, not ASCII. case c0 < 0xE0: // 2-byte UTF-8 if len(s) < 2 { return 0, 0 } i := bidiIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c1), 2 case c0 < 0xF0: // 3-byte UTF-8 if len(s) < 3 { return 0, 0 } i := bidiIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = bidiIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c2), 3 case c0 < 0xF8: // 4-byte UTF-8 if len(s) < 4 { return 0, 0 } i := bidiIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = bidiIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } o = uint32(i)<<6 + uint32(c2) i = bidiIndex[o] c3 := s[3] if c3 < 0x80 || 0xC0 <= c3 { return 0, 3 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c3), 4 } // Illegal rune return 0, 1 } // lookupUnsafe returns the trie value for the first UTF-8 encoding in s. // s must start with a full and valid UTF-8 encoded rune. func (t *bidiTrie) lookupUnsafe(s []byte) uint8 { c0 := s[0] if c0 < 0x80 { // is ASCII return bidiValues[c0] } i := bidiIndex[c0] if c0 < 0xE0 { // 2-byte UTF-8 return t.lookupValue(uint32(i), s[1]) } i = bidiIndex[uint32(i)<<6+uint32(s[1])] if c0 < 0xF0 { // 3-byte UTF-8 return t.lookupValue(uint32(i), s[2]) } i = bidiIndex[uint32(i)<<6+uint32(s[2])] if c0 < 0xF8 { // 4-byte UTF-8 return t.lookupValue(uint32(i), s[3]) } return 0 } // lookupString returns the trie value for the first UTF-8 encoding in s and // the width in bytes of this encoding. The size will be 0 if s does not // hold enough bytes to complete the encoding. len(s) must be greater than 0. func (t *bidiTrie) lookupString(s string) (v uint8, sz int) { c0 := s[0] switch { case c0 < 0x80: // is ASCII return bidiValues[c0], 1 case c0 < 0xC2: return 0, 1 // Illegal UTF-8: not a starter, not ASCII. case c0 < 0xE0: // 2-byte UTF-8 if len(s) < 2 { return 0, 0 } i := bidiIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c1), 2 case c0 < 0xF0: // 3-byte UTF-8 if len(s) < 3 { return 0, 0 } i := bidiIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = bidiIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c2), 3 case c0 < 0xF8: // 4-byte UTF-8 if len(s) < 4 { return 0, 0 } i := bidiIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = bidiIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } o = uint32(i)<<6 + uint32(c2) i = bidiIndex[o] c3 := s[3] if c3 < 0x80 || 0xC0 <= c3 { return 0, 3 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c3), 4 } // Illegal rune return 0, 1 } // lookupStringUnsafe returns the trie value for the first UTF-8 encoding in s. // s must start with a full and valid UTF-8 encoded rune. func (t *bidiTrie) lookupStringUnsafe(s string) uint8 { c0 := s[0] if c0 < 0x80 { // is ASCII return bidiValues[c0] } i := bidiIndex[c0] if c0 < 0xE0 { // 2-byte UTF-8 return t.lookupValue(uint32(i), s[1]) } i = bidiIndex[uint32(i)<<6+uint32(s[1])] if c0 < 0xF0 { // 3-byte UTF-8 return t.lookupValue(uint32(i), s[2]) } i = bidiIndex[uint32(i)<<6+uint32(s[2])] if c0 < 0xF8 { // 4-byte UTF-8 return t.lookupValue(uint32(i), s[3]) } return 0 } // bidiTrie. Total size: 20608 bytes (20.12 KiB). Checksum: 291cd0103a32a537. type bidiTrie struct{} func newBidiTrie(i int) *bidiTrie { return &bidiTrie{} } // lookupValue determines the type of block n and looks up the value for b. func (t *bidiTrie) lookupValue(n uint32, b byte) uint8 { switch { default: return uint8(bidiValues[n<<6+uint32(b)]) } } // bidiValues: 270 blocks, 17280 entries, 17280 bytes // The third block is the zero block. var bidiValues = [17280]uint8{ // Block 0x0, offset 0x0 0x00: 0x000b, 0x01: 0x000b, 0x02: 0x000b, 0x03: 0x000b, 0x04: 0x000b, 0x05: 0x000b, 0x06: 0x000b, 0x07: 0x000b, 0x08: 0x000b, 0x09: 0x0008, 0x0a: 0x0007, 0x0b: 0x0008, 0x0c: 0x0009, 0x0d: 0x0007, 0x0e: 0x000b, 0x0f: 0x000b, 0x10: 0x000b, 0x11: 0x000b, 0x12: 0x000b, 0x13: 0x000b, 0x14: 0x000b, 0x15: 0x000b, 0x16: 0x000b, 0x17: 0x000b, 0x18: 0x000b, 0x19: 0x000b, 0x1a: 0x000b, 0x1b: 0x000b, 0x1c: 0x0007, 0x1d: 0x0007, 0x1e: 0x0007, 0x1f: 0x0008, 0x20: 0x0009, 0x21: 0x000a, 0x22: 0x000a, 0x23: 0x0004, 0x24: 0x0004, 0x25: 0x0004, 0x26: 0x000a, 0x27: 0x000a, 0x28: 0x003a, 0x29: 0x002a, 0x2a: 0x000a, 0x2b: 0x0003, 0x2c: 0x0006, 0x2d: 0x0003, 0x2e: 0x0006, 0x2f: 0x0006, 0x30: 0x0002, 0x31: 0x0002, 0x32: 0x0002, 0x33: 0x0002, 0x34: 0x0002, 0x35: 0x0002, 0x36: 0x0002, 0x37: 0x0002, 0x38: 0x0002, 0x39: 0x0002, 0x3a: 0x0006, 0x3b: 0x000a, 0x3c: 0x000a, 0x3d: 0x000a, 0x3e: 0x000a, 0x3f: 0x000a, // Block 0x1, offset 0x40 0x40: 0x000a, 0x5b: 0x005a, 0x5c: 0x000a, 0x5d: 0x004a, 0x5e: 0x000a, 0x5f: 0x000a, 0x60: 0x000a, 0x7b: 0x005a, 0x7c: 0x000a, 0x7d: 0x004a, 0x7e: 0x000a, 0x7f: 0x000b, // Block 0x2, offset 0x80 // Block 0x3, offset 0xc0 0xc0: 0x000b, 0xc1: 0x000b, 0xc2: 0x000b, 0xc3: 0x000b, 0xc4: 0x000b, 0xc5: 0x0007, 0xc6: 0x000b, 0xc7: 0x000b, 0xc8: 0x000b, 0xc9: 0x000b, 0xca: 0x000b, 0xcb: 0x000b, 0xcc: 0x000b, 0xcd: 0x000b, 0xce: 0x000b, 0xcf: 0x000b, 0xd0: 0x000b, 0xd1: 0x000b, 0xd2: 0x000b, 0xd3: 0x000b, 0xd4: 0x000b, 0xd5: 0x000b, 0xd6: 0x000b, 0xd7: 0x000b, 0xd8: 0x000b, 0xd9: 0x000b, 0xda: 0x000b, 0xdb: 0x000b, 0xdc: 0x000b, 0xdd: 0x000b, 0xde: 0x000b, 0xdf: 0x000b, 0xe0: 0x0006, 0xe1: 0x000a, 0xe2: 0x0004, 0xe3: 0x0004, 0xe4: 0x0004, 0xe5: 0x0004, 0xe6: 0x000a, 0xe7: 0x000a, 0xe8: 0x000a, 0xe9: 0x000a, 0xeb: 0x000a, 0xec: 0x000a, 0xed: 0x000b, 0xee: 0x000a, 0xef: 0x000a, 0xf0: 0x0004, 0xf1: 0x0004, 0xf2: 0x0002, 0xf3: 0x0002, 0xf4: 0x000a, 0xf6: 0x000a, 0xf7: 0x000a, 0xf8: 0x000a, 0xf9: 0x0002, 0xfb: 0x000a, 0xfc: 0x000a, 0xfd: 0x000a, 0xfe: 0x000a, 0xff: 0x000a, // Block 0x4, offset 0x100 0x117: 0x000a, 0x137: 0x000a, // Block 0x5, offset 0x140 0x179: 0x000a, 0x17a: 0x000a, // Block 0x6, offset 0x180 0x182: 0x000a, 0x183: 0x000a, 0x184: 0x000a, 0x185: 0x000a, 0x186: 0x000a, 0x187: 0x000a, 0x188: 0x000a, 0x189: 0x000a, 0x18a: 0x000a, 0x18b: 0x000a, 0x18c: 0x000a, 0x18d: 0x000a, 0x18e: 0x000a, 0x18f: 0x000a, 0x192: 0x000a, 0x193: 0x000a, 0x194: 0x000a, 0x195: 0x000a, 0x196: 0x000a, 0x197: 0x000a, 0x198: 0x000a, 0x199: 0x000a, 0x19a: 0x000a, 0x19b: 0x000a, 0x19c: 0x000a, 0x19d: 0x000a, 0x19e: 0x000a, 0x19f: 0x000a, 0x1a5: 0x000a, 0x1a6: 0x000a, 0x1a7: 0x000a, 0x1a8: 0x000a, 0x1a9: 0x000a, 0x1aa: 0x000a, 0x1ab: 0x000a, 0x1ac: 0x000a, 0x1ad: 0x000a, 0x1af: 0x000a, 0x1b0: 0x000a, 0x1b1: 0x000a, 0x1b2: 0x000a, 0x1b3: 0x000a, 0x1b4: 0x000a, 0x1b5: 0x000a, 0x1b6: 0x000a, 0x1b7: 0x000a, 0x1b8: 0x000a, 0x1b9: 0x000a, 0x1ba: 0x000a, 0x1bb: 0x000a, 0x1bc: 0x000a, 0x1bd: 0x000a, 0x1be: 0x000a, 0x1bf: 0x000a, // Block 0x7, offset 0x1c0 0x1c0: 0x000c, 0x1c1: 0x000c, 0x1c2: 0x000c, 0x1c3: 0x000c, 0x1c4: 0x000c, 0x1c5: 0x000c, 0x1c6: 0x000c, 0x1c7: 0x000c, 0x1c8: 0x000c, 0x1c9: 0x000c, 0x1ca: 0x000c, 0x1cb: 0x000c, 0x1cc: 0x000c, 0x1cd: 0x000c, 0x1ce: 0x000c, 0x1cf: 0x000c, 0x1d0: 0x000c, 0x1d1: 0x000c, 0x1d2: 0x000c, 0x1d3: 0x000c, 0x1d4: 0x000c, 0x1d5: 0x000c, 0x1d6: 0x000c, 0x1d7: 0x000c, 0x1d8: 0x000c, 0x1d9: 0x000c, 0x1da: 0x000c, 0x1db: 0x000c, 0x1dc: 0x000c, 0x1dd: 0x000c, 0x1de: 0x000c, 0x1df: 0x000c, 0x1e0: 0x000c, 0x1e1: 0x000c, 0x1e2: 0x000c, 0x1e3: 0x000c, 0x1e4: 0x000c, 0x1e5: 0x000c, 0x1e6: 0x000c, 0x1e7: 0x000c, 0x1e8: 0x000c, 0x1e9: 0x000c, 0x1ea: 0x000c, 0x1eb: 0x000c, 0x1ec: 0x000c, 0x1ed: 0x000c, 0x1ee: 0x000c, 0x1ef: 0x000c, 0x1f0: 0x000c, 0x1f1: 0x000c, 0x1f2: 0x000c, 0x1f3: 0x000c, 0x1f4: 0x000c, 0x1f5: 0x000c, 0x1f6: 0x000c, 0x1f7: 0x000c, 0x1f8: 0x000c, 0x1f9: 0x000c, 0x1fa: 0x000c, 0x1fb: 0x000c, 0x1fc: 0x000c, 0x1fd: 0x000c, 0x1fe: 0x000c, 0x1ff: 0x000c, // Block 0x8, offset 0x200 0x200: 0x000c, 0x201: 0x000c, 0x202: 0x000c, 0x203: 0x000c, 0x204: 0x000c, 0x205: 0x000c, 0x206: 0x000c, 0x207: 0x000c, 0x208: 0x000c, 0x209: 0x000c, 0x20a: 0x000c, 0x20b: 0x000c, 0x20c: 0x000c, 0x20d: 0x000c, 0x20e: 0x000c, 0x20f: 0x000c, 0x210: 0x000c, 0x211: 0x000c, 0x212: 0x000c, 0x213: 0x000c, 0x214: 0x000c, 0x215: 0x000c, 0x216: 0x000c, 0x217: 0x000c, 0x218: 0x000c, 0x219: 0x000c, 0x21a: 0x000c, 0x21b: 0x000c, 0x21c: 0x000c, 0x21d: 0x000c, 0x21e: 0x000c, 0x21f: 0x000c, 0x220: 0x000c, 0x221: 0x000c, 0x222: 0x000c, 0x223: 0x000c, 0x224: 0x000c, 0x225: 0x000c, 0x226: 0x000c, 0x227: 0x000c, 0x228: 0x000c, 0x229: 0x000c, 0x22a: 0x000c, 0x22b: 0x000c, 0x22c: 0x000c, 0x22d: 0x000c, 0x22e: 0x000c, 0x22f: 0x000c, 0x234: 0x000a, 0x235: 0x000a, 0x23e: 0x000a, // Block 0x9, offset 0x240 0x244: 0x000a, 0x245: 0x000a, 0x247: 0x000a, // Block 0xa, offset 0x280 0x2b6: 0x000a, // Block 0xb, offset 0x2c0 0x2c3: 0x000c, 0x2c4: 0x000c, 0x2c5: 0x000c, 0x2c6: 0x000c, 0x2c7: 0x000c, 0x2c8: 0x000c, 0x2c9: 0x000c, // Block 0xc, offset 0x300 0x30a: 0x000a, 0x30d: 0x000a, 0x30e: 0x000a, 0x30f: 0x0004, 0x310: 0x0001, 0x311: 0x000c, 0x312: 0x000c, 0x313: 0x000c, 0x314: 0x000c, 0x315: 0x000c, 0x316: 0x000c, 0x317: 0x000c, 0x318: 0x000c, 0x319: 0x000c, 0x31a: 0x000c, 0x31b: 0x000c, 0x31c: 0x000c, 0x31d: 0x000c, 0x31e: 0x000c, 0x31f: 0x000c, 0x320: 0x000c, 0x321: 0x000c, 0x322: 0x000c, 0x323: 0x000c, 0x324: 0x000c, 0x325: 0x000c, 0x326: 0x000c, 0x327: 0x000c, 0x328: 0x000c, 0x329: 0x000c, 0x32a: 0x000c, 0x32b: 0x000c, 0x32c: 0x000c, 0x32d: 0x000c, 0x32e: 0x000c, 0x32f: 0x000c, 0x330: 0x000c, 0x331: 0x000c, 0x332: 0x000c, 0x333: 0x000c, 0x334: 0x000c, 0x335: 0x000c, 0x336: 0x000c, 0x337: 0x000c, 0x338: 0x000c, 0x339: 0x000c, 0x33a: 0x000c, 0x33b: 0x000c, 0x33c: 0x000c, 0x33d: 0x000c, 0x33e: 0x0001, 0x33f: 0x000c, // Block 0xd, offset 0x340 0x340: 0x0001, 0x341: 0x000c, 0x342: 0x000c, 0x343: 0x0001, 0x344: 0x000c, 0x345: 0x000c, 0x346: 0x0001, 0x347: 0x000c, 0x348: 0x0001, 0x349: 0x0001, 0x34a: 0x0001, 0x34b: 0x0001, 0x34c: 0x0001, 0x34d: 0x0001, 0x34e: 0x0001, 0x34f: 0x0001, 0x350: 0x0001, 0x351: 0x0001, 0x352: 0x0001, 0x353: 0x0001, 0x354: 0x0001, 0x355: 0x0001, 0x356: 0x0001, 0x357: 0x0001, 0x358: 0x0001, 0x359: 0x0001, 0x35a: 0x0001, 0x35b: 0x0001, 0x35c: 0x0001, 0x35d: 0x0001, 0x35e: 0x0001, 0x35f: 0x0001, 0x360: 0x0001, 0x361: 0x0001, 0x362: 0x0001, 0x363: 0x0001, 0x364: 0x0001, 0x365: 0x0001, 0x366: 0x0001, 0x367: 0x0001, 0x368: 0x0001, 0x369: 0x0001, 0x36a: 0x0001, 0x36b: 0x0001, 0x36c: 0x0001, 0x36d: 0x0001, 0x36e: 0x0001, 0x36f: 0x0001, 0x370: 0x0001, 0x371: 0x0001, 0x372: 0x0001, 0x373: 0x0001, 0x374: 0x0001, 0x375: 0x0001, 0x376: 0x0001, 0x377: 0x0001, 0x378: 0x0001, 0x379: 0x0001, 0x37a: 0x0001, 0x37b: 0x0001, 0x37c: 0x0001, 0x37d: 0x0001, 0x37e: 0x0001, 0x37f: 0x0001, // Block 0xe, offset 0x380 0x380: 0x0005, 0x381: 0x0005, 0x382: 0x0005, 0x383: 0x0005, 0x384: 0x0005, 0x385: 0x0005, 0x386: 0x000a, 0x387: 0x000a, 0x388: 0x000d, 0x389: 0x0004, 0x38a: 0x0004, 0x38b: 0x000d, 0x38c: 0x0006, 0x38d: 0x000d, 0x38e: 0x000a, 0x38f: 0x000a, 0x390: 0x000c, 0x391: 0x000c, 0x392: 0x000c, 0x393: 0x000c, 0x394: 0x000c, 0x395: 0x000c, 0x396: 0x000c, 0x397: 0x000c, 0x398: 0x000c, 0x399: 0x000c, 0x39a: 0x000c, 0x39b: 0x000d, 0x39c: 0x000d, 0x39d: 0x000d, 0x39e: 0x000d, 0x39f: 0x000d, 0x3a0: 0x000d, 0x3a1: 0x000d, 0x3a2: 0x000d, 0x3a3: 0x000d, 0x3a4: 0x000d, 0x3a5: 0x000d, 0x3a6: 0x000d, 0x3a7: 0x000d, 0x3a8: 0x000d, 0x3a9: 0x000d, 0x3aa: 0x000d, 0x3ab: 0x000d, 0x3ac: 0x000d, 0x3ad: 0x000d, 0x3ae: 0x000d, 0x3af: 0x000d, 0x3b0: 0x000d, 0x3b1: 0x000d, 0x3b2: 0x000d, 0x3b3: 0x000d, 0x3b4: 0x000d, 0x3b5: 0x000d, 0x3b6: 0x000d, 0x3b7: 0x000d, 0x3b8: 0x000d, 0x3b9: 0x000d, 0x3ba: 0x000d, 0x3bb: 0x000d, 0x3bc: 0x000d, 0x3bd: 0x000d, 0x3be: 0x000d, 0x3bf: 0x000d, // Block 0xf, offset 0x3c0 0x3c0: 0x000d, 0x3c1: 0x000d, 0x3c2: 0x000d, 0x3c3: 0x000d, 0x3c4: 0x000d, 0x3c5: 0x000d, 0x3c6: 0x000d, 0x3c7: 0x000d, 0x3c8: 0x000d, 0x3c9: 0x000d, 0x3ca: 0x000d, 0x3cb: 0x000c, 0x3cc: 0x000c, 0x3cd: 0x000c, 0x3ce: 0x000c, 0x3cf: 0x000c, 0x3d0: 0x000c, 0x3d1: 0x000c, 0x3d2: 0x000c, 0x3d3: 0x000c, 0x3d4: 0x000c, 0x3d5: 0x000c, 0x3d6: 0x000c, 0x3d7: 0x000c, 0x3d8: 0x000c, 0x3d9: 0x000c, 0x3da: 0x000c, 0x3db: 0x000c, 0x3dc: 0x000c, 0x3dd: 0x000c, 0x3de: 0x000c, 0x3df: 0x000c, 0x3e0: 0x0005, 0x3e1: 0x0005, 0x3e2: 0x0005, 0x3e3: 0x0005, 0x3e4: 0x0005, 0x3e5: 0x0005, 0x3e6: 0x0005, 0x3e7: 0x0005, 0x3e8: 0x0005, 0x3e9: 0x0005, 0x3ea: 0x0004, 0x3eb: 0x0005, 0x3ec: 0x0005, 0x3ed: 0x000d, 0x3ee: 0x000d, 0x3ef: 0x000d, 0x3f0: 0x000c, 0x3f1: 0x000d, 0x3f2: 0x000d, 0x3f3: 0x000d, 0x3f4: 0x000d, 0x3f5: 0x000d, 0x3f6: 0x000d, 0x3f7: 0x000d, 0x3f8: 0x000d, 0x3f9: 0x000d, 0x3fa: 0x000d, 0x3fb: 0x000d, 0x3fc: 0x000d, 0x3fd: 0x000d, 0x3fe: 0x000d, 0x3ff: 0x000d, // Block 0x10, offset 0x400 0x400: 0x000d, 0x401: 0x000d, 0x402: 0x000d, 0x403: 0x000d, 0x404: 0x000d, 0x405: 0x000d, 0x406: 0x000d, 0x407: 0x000d, 0x408: 0x000d, 0x409: 0x000d, 0x40a: 0x000d, 0x40b: 0x000d, 0x40c: 0x000d, 0x40d: 0x000d, 0x40e: 0x000d, 0x40f: 0x000d, 0x410: 0x000d, 0x411: 0x000d, 0x412: 0x000d, 0x413: 0x000d, 0x414: 0x000d, 0x415: 0x000d, 0x416: 0x000d, 0x417: 0x000d, 0x418: 0x000d, 0x419: 0x000d, 0x41a: 0x000d, 0x41b: 0x000d, 0x41c: 0x000d, 0x41d: 0x000d, 0x41e: 0x000d, 0x41f: 0x000d, 0x420: 0x000d, 0x421: 0x000d, 0x422: 0x000d, 0x423: 0x000d, 0x424: 0x000d, 0x425: 0x000d, 0x426: 0x000d, 0x427: 0x000d, 0x428: 0x000d, 0x429: 0x000d, 0x42a: 0x000d, 0x42b: 0x000d, 0x42c: 0x000d, 0x42d: 0x000d, 0x42e: 0x000d, 0x42f: 0x000d, 0x430: 0x000d, 0x431: 0x000d, 0x432: 0x000d, 0x433: 0x000d, 0x434: 0x000d, 0x435: 0x000d, 0x436: 0x000d, 0x437: 0x000d, 0x438: 0x000d, 0x439: 0x000d, 0x43a: 0x000d, 0x43b: 0x000d, 0x43c: 0x000d, 0x43d: 0x000d, 0x43e: 0x000d, 0x43f: 0x000d, // Block 0x11, offset 0x440 0x440: 0x000d, 0x441: 0x000d, 0x442: 0x000d, 0x443: 0x000d, 0x444: 0x000d, 0x445: 0x000d, 0x446: 0x000d, 0x447: 0x000d, 0x448: 0x000d, 0x449: 0x000d, 0x44a: 0x000d, 0x44b: 0x000d, 0x44c: 0x000d, 0x44d: 0x000d, 0x44e: 0x000d, 0x44f: 0x000d, 0x450: 0x000d, 0x451: 0x000d, 0x452: 0x000d, 0x453: 0x000d, 0x454: 0x000d, 0x455: 0x000d, 0x456: 0x000c, 0x457: 0x000c, 0x458: 0x000c, 0x459: 0x000c, 0x45a: 0x000c, 0x45b: 0x000c, 0x45c: 0x000c, 0x45d: 0x0005, 0x45e: 0x000a, 0x45f: 0x000c, 0x460: 0x000c, 0x461: 0x000c, 0x462: 0x000c, 0x463: 0x000c, 0x464: 0x000c, 0x465: 0x000d, 0x466: 0x000d, 0x467: 0x000c, 0x468: 0x000c, 0x469: 0x000a, 0x46a: 0x000c, 0x46b: 0x000c, 0x46c: 0x000c, 0x46d: 0x000c, 0x46e: 0x000d, 0x46f: 0x000d, 0x470: 0x0002, 0x471: 0x0002, 0x472: 0x0002, 0x473: 0x0002, 0x474: 0x0002, 0x475: 0x0002, 0x476: 0x0002, 0x477: 0x0002, 0x478: 0x0002, 0x479: 0x0002, 0x47a: 0x000d, 0x47b: 0x000d, 0x47c: 0x000d, 0x47d: 0x000d, 0x47e: 0x000d, 0x47f: 0x000d, // Block 0x12, offset 0x480 0x480: 0x000d, 0x481: 0x000d, 0x482: 0x000d, 0x483: 0x000d, 0x484: 0x000d, 0x485: 0x000d, 0x486: 0x000d, 0x487: 0x000d, 0x488: 0x000d, 0x489: 0x000d, 0x48a: 0x000d, 0x48b: 0x000d, 0x48c: 0x000d, 0x48d: 0x000d, 0x48e: 0x000d, 0x48f: 0x000d, 0x490: 0x000d, 0x491: 0x000c, 0x492: 0x000d, 0x493: 0x000d, 0x494: 0x000d, 0x495: 0x000d, 0x496: 0x000d, 0x497: 0x000d, 0x498: 0x000d, 0x499: 0x000d, 0x49a: 0x000d, 0x49b: 0x000d, 0x49c: 0x000d, 0x49d: 0x000d, 0x49e: 0x000d, 0x49f: 0x000d, 0x4a0: 0x000d, 0x4a1: 0x000d, 0x4a2: 0x000d, 0x4a3: 0x000d, 0x4a4: 0x000d, 0x4a5: 0x000d, 0x4a6: 0x000d, 0x4a7: 0x000d, 0x4a8: 0x000d, 0x4a9: 0x000d, 0x4aa: 0x000d, 0x4ab: 0x000d, 0x4ac: 0x000d, 0x4ad: 0x000d, 0x4ae: 0x000d, 0x4af: 0x000d, 0x4b0: 0x000c, 0x4b1: 0x000c, 0x4b2: 0x000c, 0x4b3: 0x000c, 0x4b4: 0x000c, 0x4b5: 0x000c, 0x4b6: 0x000c, 0x4b7: 0x000c, 0x4b8: 0x000c, 0x4b9: 0x000c, 0x4ba: 0x000c, 0x4bb: 0x000c, 0x4bc: 0x000c, 0x4bd: 0x000c, 0x4be: 0x000c, 0x4bf: 0x000c, // Block 0x13, offset 0x4c0 0x4c0: 0x000c, 0x4c1: 0x000c, 0x4c2: 0x000c, 0x4c3: 0x000c, 0x4c4: 0x000c, 0x4c5: 0x000c, 0x4c6: 0x000c, 0x4c7: 0x000c, 0x4c8: 0x000c, 0x4c9: 0x000c, 0x4ca: 0x000c, 0x4cb: 0x000d, 0x4cc: 0x000d, 0x4cd: 0x000d, 0x4ce: 0x000d, 0x4cf: 0x000d, 0x4d0: 0x000d, 0x4d1: 0x000d, 0x4d2: 0x000d, 0x4d3: 0x000d, 0x4d4: 0x000d, 0x4d5: 0x000d, 0x4d6: 0x000d, 0x4d7: 0x000d, 0x4d8: 0x000d, 0x4d9: 0x000d, 0x4da: 0x000d, 0x4db: 0x000d, 0x4dc: 0x000d, 0x4dd: 0x000d, 0x4de: 0x000d, 0x4df: 0x000d, 0x4e0: 0x000d, 0x4e1: 0x000d, 0x4e2: 0x000d, 0x4e3: 0x000d, 0x4e4: 0x000d, 0x4e5: 0x000d, 0x4e6: 0x000d, 0x4e7: 0x000d, 0x4e8: 0x000d, 0x4e9: 0x000d, 0x4ea: 0x000d, 0x4eb: 0x000d, 0x4ec: 0x000d, 0x4ed: 0x000d, 0x4ee: 0x000d, 0x4ef: 0x000d, 0x4f0: 0x000d, 0x4f1: 0x000d, 0x4f2: 0x000d, 0x4f3: 0x000d, 0x4f4: 0x000d, 0x4f5: 0x000d, 0x4f6: 0x000d, 0x4f7: 0x000d, 0x4f8: 0x000d, 0x4f9: 0x000d, 0x4fa: 0x000d, 0x4fb: 0x000d, 0x4fc: 0x000d, 0x4fd: 0x000d, 0x4fe: 0x000d, 0x4ff: 0x000d, // Block 0x14, offset 0x500 0x500: 0x000d, 0x501: 0x000d, 0x502: 0x000d, 0x503: 0x000d, 0x504: 0x000d, 0x505: 0x000d, 0x506: 0x000d, 0x507: 0x000d, 0x508: 0x000d, 0x509: 0x000d, 0x50a: 0x000d, 0x50b: 0x000d, 0x50c: 0x000d, 0x50d: 0x000d, 0x50e: 0x000d, 0x50f: 0x000d, 0x510: 0x000d, 0x511: 0x000d, 0x512: 0x000d, 0x513: 0x000d, 0x514: 0x000d, 0x515: 0x000d, 0x516: 0x000d, 0x517: 0x000d, 0x518: 0x000d, 0x519: 0x000d, 0x51a: 0x000d, 0x51b: 0x000d, 0x51c: 0x000d, 0x51d: 0x000d, 0x51e: 0x000d, 0x51f: 0x000d, 0x520: 0x000d, 0x521: 0x000d, 0x522: 0x000d, 0x523: 0x000d, 0x524: 0x000d, 0x525: 0x000d, 0x526: 0x000c, 0x527: 0x000c, 0x528: 0x000c, 0x529: 0x000c, 0x52a: 0x000c, 0x52b: 0x000c, 0x52c: 0x000c, 0x52d: 0x000c, 0x52e: 0x000c, 0x52f: 0x000c, 0x530: 0x000c, 0x531: 0x000d, 0x532: 0x000d, 0x533: 0x000d, 0x534: 0x000d, 0x535: 0x000d, 0x536: 0x000d, 0x537: 0x000d, 0x538: 0x000d, 0x539: 0x000d, 0x53a: 0x000d, 0x53b: 0x000d, 0x53c: 0x000d, 0x53d: 0x000d, 0x53e: 0x000d, 0x53f: 0x000d, // Block 0x15, offset 0x540 0x540: 0x0001, 0x541: 0x0001, 0x542: 0x0001, 0x543: 0x0001, 0x544: 0x0001, 0x545: 0x0001, 0x546: 0x0001, 0x547: 0x0001, 0x548: 0x0001, 0x549: 0x0001, 0x54a: 0x0001, 0x54b: 0x0001, 0x54c: 0x0001, 0x54d: 0x0001, 0x54e: 0x0001, 0x54f: 0x0001, 0x550: 0x0001, 0x551: 0x0001, 0x552: 0x0001, 0x553: 0x0001, 0x554: 0x0001, 0x555: 0x0001, 0x556: 0x0001, 0x557: 0x0001, 0x558: 0x0001, 0x559: 0x0001, 0x55a: 0x0001, 0x55b: 0x0001, 0x55c: 0x0001, 0x55d: 0x0001, 0x55e: 0x0001, 0x55f: 0x0001, 0x560: 0x0001, 0x561: 0x0001, 0x562: 0x0001, 0x563: 0x0001, 0x564: 0x0001, 0x565: 0x0001, 0x566: 0x0001, 0x567: 0x0001, 0x568: 0x0001, 0x569: 0x0001, 0x56a: 0x0001, 0x56b: 0x000c, 0x56c: 0x000c, 0x56d: 0x000c, 0x56e: 0x000c, 0x56f: 0x000c, 0x570: 0x000c, 0x571: 0x000c, 0x572: 0x000c, 0x573: 0x000c, 0x574: 0x0001, 0x575: 0x0001, 0x576: 0x000a, 0x577: 0x000a, 0x578: 0x000a, 0x579: 0x000a, 0x57a: 0x0001, 0x57b: 0x0001, 0x57c: 0x0001, 0x57d: 0x000c, 0x57e: 0x0001, 0x57f: 0x0001, // Block 0x16, offset 0x580 0x580: 0x0001, 0x581: 0x0001, 0x582: 0x0001, 0x583: 0x0001, 0x584: 0x0001, 0x585: 0x0001, 0x586: 0x0001, 0x587: 0x0001, 0x588: 0x0001, 0x589: 0x0001, 0x58a: 0x0001, 0x58b: 0x0001, 0x58c: 0x0001, 0x58d: 0x0001, 0x58e: 0x0001, 0x58f: 0x0001, 0x590: 0x0001, 0x591: 0x0001, 0x592: 0x0001, 0x593: 0x0001, 0x594: 0x0001, 0x595: 0x0001, 0x596: 0x000c, 0x597: 0x000c, 0x598: 0x000c, 0x599: 0x000c, 0x59a: 0x0001, 0x59b: 0x000c, 0x59c: 0x000c, 0x59d: 0x000c, 0x59e: 0x000c, 0x59f: 0x000c, 0x5a0: 0x000c, 0x5a1: 0x000c, 0x5a2: 0x000c, 0x5a3: 0x000c, 0x5a4: 0x0001, 0x5a5: 0x000c, 0x5a6: 0x000c, 0x5a7: 0x000c, 0x5a8: 0x0001, 0x5a9: 0x000c, 0x5aa: 0x000c, 0x5ab: 0x000c, 0x5ac: 0x000c, 0x5ad: 0x000c, 0x5ae: 0x0001, 0x5af: 0x0001, 0x5b0: 0x0001, 0x5b1: 0x0001, 0x5b2: 0x0001, 0x5b3: 0x0001, 0x5b4: 0x0001, 0x5b5: 0x0001, 0x5b6: 0x0001, 0x5b7: 0x0001, 0x5b8: 0x0001, 0x5b9: 0x0001, 0x5ba: 0x0001, 0x5bb: 0x0001, 0x5bc: 0x0001, 0x5bd: 0x0001, 0x5be: 0x0001, 0x5bf: 0x0001, // Block 0x17, offset 0x5c0 0x5c0: 0x0001, 0x5c1: 0x0001, 0x5c2: 0x0001, 0x5c3: 0x0001, 0x5c4: 0x0001, 0x5c5: 0x0001, 0x5c6: 0x0001, 0x5c7: 0x0001, 0x5c8: 0x0001, 0x5c9: 0x0001, 0x5ca: 0x0001, 0x5cb: 0x0001, 0x5cc: 0x0001, 0x5cd: 0x0001, 0x5ce: 0x0001, 0x5cf: 0x0001, 0x5d0: 0x0001, 0x5d1: 0x0001, 0x5d2: 0x0001, 0x5d3: 0x0001, 0x5d4: 0x0001, 0x5d5: 0x0001, 0x5d6: 0x0001, 0x5d7: 0x0001, 0x5d8: 0x0001, 0x5d9: 0x000c, 0x5da: 0x000c, 0x5db: 0x000c, 0x5dc: 0x0001, 0x5dd: 0x0001, 0x5de: 0x0001, 0x5df: 0x0001, 0x5e0: 0x000d, 0x5e1: 0x000d, 0x5e2: 0x000d, 0x5e3: 0x000d, 0x5e4: 0x000d, 0x5e5: 0x000d, 0x5e6: 0x000d, 0x5e7: 0x000d, 0x5e8: 0x000d, 0x5e9: 0x000d, 0x5ea: 0x000d, 0x5eb: 0x0001, 0x5ec: 0x0001, 0x5ed: 0x0001, 0x5ee: 0x0001, 0x5ef: 0x0001, 0x5f0: 0x000d, 0x5f1: 0x000d, 0x5f2: 0x000d, 0x5f3: 0x000d, 0x5f4: 0x000d, 0x5f5: 0x000d, 0x5f6: 0x000d, 0x5f7: 0x000d, 0x5f8: 0x000d, 0x5f9: 0x000d, 0x5fa: 0x000d, 0x5fb: 0x000d, 0x5fc: 0x000d, 0x5fd: 0x000d, 0x5fe: 0x000d, 0x5ff: 0x000d, // Block 0x18, offset 0x600 0x600: 0x000d, 0x601: 0x000d, 0x602: 0x000d, 0x603: 0x000d, 0x604: 0x000d, 0x605: 0x000d, 0x606: 0x000d, 0x607: 0x000d, 0x608: 0x000d, 0x609: 0x000d, 0x60a: 0x000d, 0x60b: 0x000d, 0x60c: 0x000d, 0x60d: 0x000d, 0x60e: 0x000d, 0x60f: 0x000d, 0x610: 0x0005, 0x611: 0x0005, 0x612: 0x0001, 0x613: 0x0001, 0x614: 0x0001, 0x615: 0x0001, 0x616: 0x0001, 0x617: 0x000c, 0x618: 0x000c, 0x619: 0x000c, 0x61a: 0x000c, 0x61b: 0x000c, 0x61c: 0x000c, 0x61d: 0x000c, 0x61e: 0x000c, 0x61f: 0x000c, 0x620: 0x000d, 0x621: 0x000d, 0x622: 0x000d, 0x623: 0x000d, 0x624: 0x000d, 0x625: 0x000d, 0x626: 0x000d, 0x627: 0x000d, 0x628: 0x000d, 0x629: 0x000d, 0x62a: 0x000d, 0x62b: 0x000d, 0x62c: 0x000d, 0x62d: 0x000d, 0x62e: 0x000d, 0x62f: 0x000d, 0x630: 0x000d, 0x631: 0x000d, 0x632: 0x000d, 0x633: 0x000d, 0x634: 0x000d, 0x635: 0x000d, 0x636: 0x000d, 0x637: 0x000d, 0x638: 0x000d, 0x639: 0x000d, 0x63a: 0x000d, 0x63b: 0x000d, 0x63c: 0x000d, 0x63d: 0x000d, 0x63e: 0x000d, 0x63f: 0x000d, // Block 0x19, offset 0x640 0x640: 0x000d, 0x641: 0x000d, 0x642: 0x000d, 0x643: 0x000d, 0x644: 0x000d, 0x645: 0x000d, 0x646: 0x000d, 0x647: 0x000d, 0x648: 0x000d, 0x649: 0x000d, 0x64a: 0x000c, 0x64b: 0x000c, 0x64c: 0x000c, 0x64d: 0x000c, 0x64e: 0x000c, 0x64f: 0x000c, 0x650: 0x000c, 0x651: 0x000c, 0x652: 0x000c, 0x653: 0x000c, 0x654: 0x000c, 0x655: 0x000c, 0x656: 0x000c, 0x657: 0x000c, 0x658: 0x000c, 0x659: 0x000c, 0x65a: 0x000c, 0x65b: 0x000c, 0x65c: 0x000c, 0x65d: 0x000c, 0x65e: 0x000c, 0x65f: 0x000c, 0x660: 0x000c, 0x661: 0x000c, 0x662: 0x0005, 0x663: 0x000c, 0x664: 0x000c, 0x665: 0x000c, 0x666: 0x000c, 0x667: 0x000c, 0x668: 0x000c, 0x669: 0x000c, 0x66a: 0x000c, 0x66b: 0x000c, 0x66c: 0x000c, 0x66d: 0x000c, 0x66e: 0x000c, 0x66f: 0x000c, 0x670: 0x000c, 0x671: 0x000c, 0x672: 0x000c, 0x673: 0x000c, 0x674: 0x000c, 0x675: 0x000c, 0x676: 0x000c, 0x677: 0x000c, 0x678: 0x000c, 0x679: 0x000c, 0x67a: 0x000c, 0x67b: 0x000c, 0x67c: 0x000c, 0x67d: 0x000c, 0x67e: 0x000c, 0x67f: 0x000c, // Block 0x1a, offset 0x680 0x680: 0x000c, 0x681: 0x000c, 0x682: 0x000c, 0x6ba: 0x000c, 0x6bc: 0x000c, // Block 0x1b, offset 0x6c0 0x6c1: 0x000c, 0x6c2: 0x000c, 0x6c3: 0x000c, 0x6c4: 0x000c, 0x6c5: 0x000c, 0x6c6: 0x000c, 0x6c7: 0x000c, 0x6c8: 0x000c, 0x6cd: 0x000c, 0x6d1: 0x000c, 0x6d2: 0x000c, 0x6d3: 0x000c, 0x6d4: 0x000c, 0x6d5: 0x000c, 0x6d6: 0x000c, 0x6d7: 0x000c, 0x6e2: 0x000c, 0x6e3: 0x000c, // Block 0x1c, offset 0x700 0x701: 0x000c, 0x73c: 0x000c, // Block 0x1d, offset 0x740 0x741: 0x000c, 0x742: 0x000c, 0x743: 0x000c, 0x744: 0x000c, 0x74d: 0x000c, 0x762: 0x000c, 0x763: 0x000c, 0x772: 0x0004, 0x773: 0x0004, 0x77b: 0x0004, 0x77e: 0x000c, // Block 0x1e, offset 0x780 0x781: 0x000c, 0x782: 0x000c, 0x7bc: 0x000c, // Block 0x1f, offset 0x7c0 0x7c1: 0x000c, 0x7c2: 0x000c, 0x7c7: 0x000c, 0x7c8: 0x000c, 0x7cb: 0x000c, 0x7cc: 0x000c, 0x7cd: 0x000c, 0x7d1: 0x000c, 0x7f0: 0x000c, 0x7f1: 0x000c, 0x7f5: 0x000c, // Block 0x20, offset 0x800 0x801: 0x000c, 0x802: 0x000c, 0x803: 0x000c, 0x804: 0x000c, 0x805: 0x000c, 0x807: 0x000c, 0x808: 0x000c, 0x80d: 0x000c, 0x822: 0x000c, 0x823: 0x000c, 0x831: 0x0004, 0x83a: 0x000c, 0x83b: 0x000c, 0x83c: 0x000c, 0x83d: 0x000c, 0x83e: 0x000c, 0x83f: 0x000c, // Block 0x21, offset 0x840 0x841: 0x000c, 0x87c: 0x000c, 0x87f: 0x000c, // Block 0x22, offset 0x880 0x881: 0x000c, 0x882: 0x000c, 0x883: 0x000c, 0x884: 0x000c, 0x88d: 0x000c, 0x895: 0x000c, 0x896: 0x000c, 0x8a2: 0x000c, 0x8a3: 0x000c, // Block 0x23, offset 0x8c0 0x8c2: 0x000c, // Block 0x24, offset 0x900 0x900: 0x000c, 0x90d: 0x000c, 0x933: 0x000a, 0x934: 0x000a, 0x935: 0x000a, 0x936: 0x000a, 0x937: 0x000a, 0x938: 0x000a, 0x939: 0x0004, 0x93a: 0x000a, // Block 0x25, offset 0x940 0x940: 0x000c, 0x944: 0x000c, 0x97c: 0x000c, 0x97e: 0x000c, 0x97f: 0x000c, // Block 0x26, offset 0x980 0x980: 0x000c, 0x986: 0x000c, 0x987: 0x000c, 0x988: 0x000c, 0x98a: 0x000c, 0x98b: 0x000c, 0x98c: 0x000c, 0x98d: 0x000c, 0x995: 0x000c, 0x996: 0x000c, 0x9a2: 0x000c, 0x9a3: 0x000c, 0x9b8: 0x000a, 0x9b9: 0x000a, 0x9ba: 0x000a, 0x9bb: 0x000a, 0x9bc: 0x000a, 0x9bd: 0x000a, 0x9be: 0x000a, // Block 0x27, offset 0x9c0 0x9cc: 0x000c, 0x9cd: 0x000c, 0x9e2: 0x000c, 0x9e3: 0x000c, // Block 0x28, offset 0xa00 0xa00: 0x000c, 0xa01: 0x000c, 0xa3b: 0x000c, 0xa3c: 0x000c, // Block 0x29, offset 0xa40 0xa41: 0x000c, 0xa42: 0x000c, 0xa43: 0x000c, 0xa44: 0x000c, 0xa4d: 0x000c, 0xa62: 0x000c, 0xa63: 0x000c, // Block 0x2a, offset 0xa80 0xa81: 0x000c, // Block 0x2b, offset 0xac0 0xaca: 0x000c, 0xad2: 0x000c, 0xad3: 0x000c, 0xad4: 0x000c, 0xad6: 0x000c, // Block 0x2c, offset 0xb00 0xb31: 0x000c, 0xb34: 0x000c, 0xb35: 0x000c, 0xb36: 0x000c, 0xb37: 0x000c, 0xb38: 0x000c, 0xb39: 0x000c, 0xb3a: 0x000c, 0xb3f: 0x0004, // Block 0x2d, offset 0xb40 0xb47: 0x000c, 0xb48: 0x000c, 0xb49: 0x000c, 0xb4a: 0x000c, 0xb4b: 0x000c, 0xb4c: 0x000c, 0xb4d: 0x000c, 0xb4e: 0x000c, // Block 0x2e, offset 0xb80 0xbb1: 0x000c, 0xbb4: 0x000c, 0xbb5: 0x000c, 0xbb6: 0x000c, 0xbb7: 0x000c, 0xbb8: 0x000c, 0xbb9: 0x000c, 0xbba: 0x000c, 0xbbb: 0x000c, 0xbbc: 0x000c, // Block 0x2f, offset 0xbc0 0xbc8: 0x000c, 0xbc9: 0x000c, 0xbca: 0x000c, 0xbcb: 0x000c, 0xbcc: 0x000c, 0xbcd: 0x000c, 0xbce: 0x000c, // Block 0x30, offset 0xc00 0xc18: 0x000c, 0xc19: 0x000c, 0xc35: 0x000c, 0xc37: 0x000c, 0xc39: 0x000c, 0xc3a: 0x003a, 0xc3b: 0x002a, 0xc3c: 0x003a, 0xc3d: 0x002a, // Block 0x31, offset 0xc40 0xc71: 0x000c, 0xc72: 0x000c, 0xc73: 0x000c, 0xc74: 0x000c, 0xc75: 0x000c, 0xc76: 0x000c, 0xc77: 0x000c, 0xc78: 0x000c, 0xc79: 0x000c, 0xc7a: 0x000c, 0xc7b: 0x000c, 0xc7c: 0x000c, 0xc7d: 0x000c, 0xc7e: 0x000c, // Block 0x32, offset 0xc80 0xc80: 0x000c, 0xc81: 0x000c, 0xc82: 0x000c, 0xc83: 0x000c, 0xc84: 0x000c, 0xc86: 0x000c, 0xc87: 0x000c, 0xc8d: 0x000c, 0xc8e: 0x000c, 0xc8f: 0x000c, 0xc90: 0x000c, 0xc91: 0x000c, 0xc92: 0x000c, 0xc93: 0x000c, 0xc94: 0x000c, 0xc95: 0x000c, 0xc96: 0x000c, 0xc97: 0x000c, 0xc99: 0x000c, 0xc9a: 0x000c, 0xc9b: 0x000c, 0xc9c: 0x000c, 0xc9d: 0x000c, 0xc9e: 0x000c, 0xc9f: 0x000c, 0xca0: 0x000c, 0xca1: 0x000c, 0xca2: 0x000c, 0xca3: 0x000c, 0xca4: 0x000c, 0xca5: 0x000c, 0xca6: 0x000c, 0xca7: 0x000c, 0xca8: 0x000c, 0xca9: 0x000c, 0xcaa: 0x000c, 0xcab: 0x000c, 0xcac: 0x000c, 0xcad: 0x000c, 0xcae: 0x000c, 0xcaf: 0x000c, 0xcb0: 0x000c, 0xcb1: 0x000c, 0xcb2: 0x000c, 0xcb3: 0x000c, 0xcb4: 0x000c, 0xcb5: 0x000c, 0xcb6: 0x000c, 0xcb7: 0x000c, 0xcb8: 0x000c, 0xcb9: 0x000c, 0xcba: 0x000c, 0xcbb: 0x000c, 0xcbc: 0x000c, // Block 0x33, offset 0xcc0 0xcc6: 0x000c, // Block 0x34, offset 0xd00 0xd2d: 0x000c, 0xd2e: 0x000c, 0xd2f: 0x000c, 0xd30: 0x000c, 0xd32: 0x000c, 0xd33: 0x000c, 0xd34: 0x000c, 0xd35: 0x000c, 0xd36: 0x000c, 0xd37: 0x000c, 0xd39: 0x000c, 0xd3a: 0x000c, 0xd3d: 0x000c, 0xd3e: 0x000c, // Block 0x35, offset 0xd40 0xd58: 0x000c, 0xd59: 0x000c, 0xd5e: 0x000c, 0xd5f: 0x000c, 0xd60: 0x000c, 0xd71: 0x000c, 0xd72: 0x000c, 0xd73: 0x000c, 0xd74: 0x000c, // Block 0x36, offset 0xd80 0xd82: 0x000c, 0xd85: 0x000c, 0xd86: 0x000c, 0xd8d: 0x000c, 0xd9d: 0x000c, // Block 0x37, offset 0xdc0 0xddd: 0x000c, 0xdde: 0x000c, 0xddf: 0x000c, // Block 0x38, offset 0xe00 0xe10: 0x000a, 0xe11: 0x000a, 0xe12: 0x000a, 0xe13: 0x000a, 0xe14: 0x000a, 0xe15: 0x000a, 0xe16: 0x000a, 0xe17: 0x000a, 0xe18: 0x000a, 0xe19: 0x000a, // Block 0x39, offset 0xe40 0xe40: 0x000a, // Block 0x3a, offset 0xe80 0xe80: 0x0009, 0xe9b: 0x007a, 0xe9c: 0x006a, // Block 0x3b, offset 0xec0 0xed2: 0x000c, 0xed3: 0x000c, 0xed4: 0x000c, 0xef2: 0x000c, 0xef3: 0x000c, // Block 0x3c, offset 0xf00 0xf12: 0x000c, 0xf13: 0x000c, 0xf32: 0x000c, 0xf33: 0x000c, // Block 0x3d, offset 0xf40 0xf74: 0x000c, 0xf75: 0x000c, 0xf77: 0x000c, 0xf78: 0x000c, 0xf79: 0x000c, 0xf7a: 0x000c, 0xf7b: 0x000c, 0xf7c: 0x000c, 0xf7d: 0x000c, // Block 0x3e, offset 0xf80 0xf86: 0x000c, 0xf89: 0x000c, 0xf8a: 0x000c, 0xf8b: 0x000c, 0xf8c: 0x000c, 0xf8d: 0x000c, 0xf8e: 0x000c, 0xf8f: 0x000c, 0xf90: 0x000c, 0xf91: 0x000c, 0xf92: 0x000c, 0xf93: 0x000c, 0xf9b: 0x0004, 0xf9d: 0x000c, 0xfb0: 0x000a, 0xfb1: 0x000a, 0xfb2: 0x000a, 0xfb3: 0x000a, 0xfb4: 0x000a, 0xfb5: 0x000a, 0xfb6: 0x000a, 0xfb7: 0x000a, 0xfb8: 0x000a, 0xfb9: 0x000a, // Block 0x3f, offset 0xfc0 0xfc0: 0x000a, 0xfc1: 0x000a, 0xfc2: 0x000a, 0xfc3: 0x000a, 0xfc4: 0x000a, 0xfc5: 0x000a, 0xfc6: 0x000a, 0xfc7: 0x000a, 0xfc8: 0x000a, 0xfc9: 0x000a, 0xfca: 0x000a, 0xfcb: 0x000c, 0xfcc: 0x000c, 0xfcd: 0x000c, 0xfce: 0x000b, 0xfcf: 0x000c, // Block 0x40, offset 0x1000 0x1005: 0x000c, 0x1006: 0x000c, 0x1029: 0x000c, // Block 0x41, offset 0x1040 0x1060: 0x000c, 0x1061: 0x000c, 0x1062: 0x000c, 0x1067: 0x000c, 0x1068: 0x000c, 0x1072: 0x000c, 0x1079: 0x000c, 0x107a: 0x000c, 0x107b: 0x000c, // Block 0x42, offset 0x1080 0x1080: 0x000a, 0x1084: 0x000a, 0x1085: 0x000a, // Block 0x43, offset 0x10c0 0x10de: 0x000a, 0x10df: 0x000a, 0x10e0: 0x000a, 0x10e1: 0x000a, 0x10e2: 0x000a, 0x10e3: 0x000a, 0x10e4: 0x000a, 0x10e5: 0x000a, 0x10e6: 0x000a, 0x10e7: 0x000a, 0x10e8: 0x000a, 0x10e9: 0x000a, 0x10ea: 0x000a, 0x10eb: 0x000a, 0x10ec: 0x000a, 0x10ed: 0x000a, 0x10ee: 0x000a, 0x10ef: 0x000a, 0x10f0: 0x000a, 0x10f1: 0x000a, 0x10f2: 0x000a, 0x10f3: 0x000a, 0x10f4: 0x000a, 0x10f5: 0x000a, 0x10f6: 0x000a, 0x10f7: 0x000a, 0x10f8: 0x000a, 0x10f9: 0x000a, 0x10fa: 0x000a, 0x10fb: 0x000a, 0x10fc: 0x000a, 0x10fd: 0x000a, 0x10fe: 0x000a, 0x10ff: 0x000a, // Block 0x44, offset 0x1100 0x1117: 0x000c, 0x1118: 0x000c, 0x111b: 0x000c, // Block 0x45, offset 0x1140 0x1156: 0x000c, 0x1158: 0x000c, 0x1159: 0x000c, 0x115a: 0x000c, 0x115b: 0x000c, 0x115c: 0x000c, 0x115d: 0x000c, 0x115e: 0x000c, 0x1160: 0x000c, 0x1162: 0x000c, 0x1165: 0x000c, 0x1166: 0x000c, 0x1167: 0x000c, 0x1168: 0x000c, 0x1169: 0x000c, 0x116a: 0x000c, 0x116b: 0x000c, 0x116c: 0x000c, 0x1173: 0x000c, 0x1174: 0x000c, 0x1175: 0x000c, 0x1176: 0x000c, 0x1177: 0x000c, 0x1178: 0x000c, 0x1179: 0x000c, 0x117a: 0x000c, 0x117b: 0x000c, 0x117c: 0x000c, 0x117f: 0x000c, // Block 0x46, offset 0x1180 0x11b0: 0x000c, 0x11b1: 0x000c, 0x11b2: 0x000c, 0x11b3: 0x000c, 0x11b4: 0x000c, 0x11b5: 0x000c, 0x11b6: 0x000c, 0x11b7: 0x000c, 0x11b8: 0x000c, 0x11b9: 0x000c, 0x11ba: 0x000c, 0x11bb: 0x000c, 0x11bc: 0x000c, 0x11bd: 0x000c, 0x11be: 0x000c, 0x11bf: 0x000c, // Block 0x47, offset 0x11c0 0x11c0: 0x000c, 0x11c1: 0x000c, 0x11c2: 0x000c, 0x11c3: 0x000c, 0x11c4: 0x000c, 0x11c5: 0x000c, 0x11c6: 0x000c, 0x11c7: 0x000c, 0x11c8: 0x000c, 0x11c9: 0x000c, 0x11ca: 0x000c, 0x11cb: 0x000c, 0x11cc: 0x000c, 0x11cd: 0x000c, 0x11ce: 0x000c, 0x11cf: 0x000c, 0x11d0: 0x000c, 0x11d1: 0x000c, 0x11d2: 0x000c, 0x11d3: 0x000c, 0x11d4: 0x000c, 0x11d5: 0x000c, 0x11d6: 0x000c, 0x11d7: 0x000c, 0x11d8: 0x000c, 0x11d9: 0x000c, 0x11da: 0x000c, 0x11db: 0x000c, 0x11dc: 0x000c, 0x11dd: 0x000c, 0x11e0: 0x000c, 0x11e1: 0x000c, 0x11e2: 0x000c, 0x11e3: 0x000c, 0x11e4: 0x000c, 0x11e5: 0x000c, 0x11e6: 0x000c, 0x11e7: 0x000c, 0x11e8: 0x000c, 0x11e9: 0x000c, 0x11ea: 0x000c, 0x11eb: 0x000c, // Block 0x48, offset 0x1200 0x1200: 0x000c, 0x1201: 0x000c, 0x1202: 0x000c, 0x1203: 0x000c, 0x1234: 0x000c, 0x1236: 0x000c, 0x1237: 0x000c, 0x1238: 0x000c, 0x1239: 0x000c, 0x123a: 0x000c, 0x123c: 0x000c, // Block 0x49, offset 0x1240 0x1242: 0x000c, 0x126b: 0x000c, 0x126c: 0x000c, 0x126d: 0x000c, 0x126e: 0x000c, 0x126f: 0x000c, 0x1270: 0x000c, 0x1271: 0x000c, 0x1272: 0x000c, 0x1273: 0x000c, // Block 0x4a, offset 0x1280 0x1280: 0x000c, 0x1281: 0x000c, 0x12a2: 0x000c, 0x12a3: 0x000c, 0x12a4: 0x000c, 0x12a5: 0x000c, 0x12a8: 0x000c, 0x12a9: 0x000c, 0x12ab: 0x000c, 0x12ac: 0x000c, 0x12ad: 0x000c, // Block 0x4b, offset 0x12c0 0x12e6: 0x000c, 0x12e8: 0x000c, 0x12e9: 0x000c, 0x12ed: 0x000c, 0x12ef: 0x000c, 0x12f0: 0x000c, 0x12f1: 0x000c, // Block 0x4c, offset 0x1300 0x132c: 0x000c, 0x132d: 0x000c, 0x132e: 0x000c, 0x132f: 0x000c, 0x1330: 0x000c, 0x1331: 0x000c, 0x1332: 0x000c, 0x1333: 0x000c, 0x1336: 0x000c, 0x1337: 0x000c, // Block 0x4d, offset 0x1340 0x1350: 0x000c, 0x1351: 0x000c, 0x1352: 0x000c, 0x1354: 0x000c, 0x1355: 0x000c, 0x1356: 0x000c, 0x1357: 0x000c, 0x1358: 0x000c, 0x1359: 0x000c, 0x135a: 0x000c, 0x135b: 0x000c, 0x135c: 0x000c, 0x135d: 0x000c, 0x135e: 0x000c, 0x135f: 0x000c, 0x1360: 0x000c, 0x1362: 0x000c, 0x1363: 0x000c, 0x1364: 0x000c, 0x1365: 0x000c, 0x1366: 0x000c, 0x1367: 0x000c, 0x1368: 0x000c, 0x136d: 0x000c, 0x1374: 0x000c, 0x1378: 0x000c, 0x1379: 0x000c, // Block 0x4e, offset 0x1380 0x13bd: 0x000a, 0x13bf: 0x000a, // Block 0x4f, offset 0x13c0 0x13c0: 0x000a, 0x13c1: 0x000a, 0x13cd: 0x000a, 0x13ce: 0x000a, 0x13cf: 0x000a, 0x13dd: 0x000a, 0x13de: 0x000a, 0x13df: 0x000a, 0x13ed: 0x000a, 0x13ee: 0x000a, 0x13ef: 0x000a, 0x13fd: 0x000a, 0x13fe: 0x000a, // Block 0x50, offset 0x1400 0x1400: 0x0009, 0x1401: 0x0009, 0x1402: 0x0009, 0x1403: 0x0009, 0x1404: 0x0009, 0x1405: 0x0009, 0x1406: 0x0009, 0x1407: 0x0009, 0x1408: 0x0009, 0x1409: 0x0009, 0x140a: 0x0009, 0x140b: 0x000b, 0x140c: 0x000b, 0x140d: 0x000b, 0x140f: 0x0001, 0x1410: 0x000a, 0x1411: 0x000a, 0x1412: 0x000a, 0x1413: 0x000a, 0x1414: 0x000a, 0x1415: 0x000a, 0x1416: 0x000a, 0x1417: 0x000a, 0x1418: 0x000a, 0x1419: 0x000a, 0x141a: 0x000a, 0x141b: 0x000a, 0x141c: 0x000a, 0x141d: 0x000a, 0x141e: 0x000a, 0x141f: 0x000a, 0x1420: 0x000a, 0x1421: 0x000a, 0x1422: 0x000a, 0x1423: 0x000a, 0x1424: 0x000a, 0x1425: 0x000a, 0x1426: 0x000a, 0x1427: 0x000a, 0x1428: 0x0009, 0x1429: 0x0007, 0x142a: 0x000e, 0x142b: 0x000e, 0x142c: 0x000e, 0x142d: 0x000e, 0x142e: 0x000e, 0x142f: 0x0006, 0x1430: 0x0004, 0x1431: 0x0004, 0x1432: 0x0004, 0x1433: 0x0004, 0x1434: 0x0004, 0x1435: 0x000a, 0x1436: 0x000a, 0x1437: 0x000a, 0x1438: 0x000a, 0x1439: 0x000a, 0x143a: 0x000a, 0x143b: 0x000a, 0x143c: 0x000a, 0x143d: 0x000a, 0x143e: 0x000a, 0x143f: 0x000a, // Block 0x51, offset 0x1440 0x1440: 0x000a, 0x1441: 0x000a, 0x1442: 0x000a, 0x1443: 0x000a, 0x1444: 0x0006, 0x1445: 0x009a, 0x1446: 0x008a, 0x1447: 0x000a, 0x1448: 0x000a, 0x1449: 0x000a, 0x144a: 0x000a, 0x144b: 0x000a, 0x144c: 0x000a, 0x144d: 0x000a, 0x144e: 0x000a, 0x144f: 0x000a, 0x1450: 0x000a, 0x1451: 0x000a, 0x1452: 0x000a, 0x1453: 0x000a, 0x1454: 0x000a, 0x1455: 0x000a, 0x1456: 0x000a, 0x1457: 0x000a, 0x1458: 0x000a, 0x1459: 0x000a, 0x145a: 0x000a, 0x145b: 0x000a, 0x145c: 0x000a, 0x145d: 0x000a, 0x145e: 0x000a, 0x145f: 0x0009, 0x1460: 0x000b, 0x1461: 0x000b, 0x1462: 0x000b, 0x1463: 0x000b, 0x1464: 0x000b, 0x1465: 0x000b, 0x1466: 0x000e, 0x1467: 0x000e, 0x1468: 0x000e, 0x1469: 0x000e, 0x146a: 0x000b, 0x146b: 0x000b, 0x146c: 0x000b, 0x146d: 0x000b, 0x146e: 0x000b, 0x146f: 0x000b, 0x1470: 0x0002, 0x1474: 0x0002, 0x1475: 0x0002, 0x1476: 0x0002, 0x1477: 0x0002, 0x1478: 0x0002, 0x1479: 0x0002, 0x147a: 0x0003, 0x147b: 0x0003, 0x147c: 0x000a, 0x147d: 0x009a, 0x147e: 0x008a, // Block 0x52, offset 0x1480 0x1480: 0x0002, 0x1481: 0x0002, 0x1482: 0x0002, 0x1483: 0x0002, 0x1484: 0x0002, 0x1485: 0x0002, 0x1486: 0x0002, 0x1487: 0x0002, 0x1488: 0x0002, 0x1489: 0x0002, 0x148a: 0x0003, 0x148b: 0x0003, 0x148c: 0x000a, 0x148d: 0x009a, 0x148e: 0x008a, 0x14a0: 0x0004, 0x14a1: 0x0004, 0x14a2: 0x0004, 0x14a3: 0x0004, 0x14a4: 0x0004, 0x14a5: 0x0004, 0x14a6: 0x0004, 0x14a7: 0x0004, 0x14a8: 0x0004, 0x14a9: 0x0004, 0x14aa: 0x0004, 0x14ab: 0x0004, 0x14ac: 0x0004, 0x14ad: 0x0004, 0x14ae: 0x0004, 0x14af: 0x0004, 0x14b0: 0x0004, 0x14b1: 0x0004, 0x14b2: 0x0004, 0x14b3: 0x0004, 0x14b4: 0x0004, 0x14b5: 0x0004, 0x14b6: 0x0004, 0x14b7: 0x0004, 0x14b8: 0x0004, 0x14b9: 0x0004, 0x14ba: 0x0004, 0x14bb: 0x0004, 0x14bc: 0x0004, 0x14bd: 0x0004, 0x14be: 0x0004, 0x14bf: 0x0004, // Block 0x53, offset 0x14c0 0x14c0: 0x0004, 0x14c1: 0x0004, 0x14c2: 0x0004, 0x14c3: 0x0004, 0x14c4: 0x0004, 0x14c5: 0x0004, 0x14c6: 0x0004, 0x14c7: 0x0004, 0x14c8: 0x0004, 0x14c9: 0x0004, 0x14ca: 0x0004, 0x14cb: 0x0004, 0x14cc: 0x0004, 0x14cd: 0x0004, 0x14ce: 0x0004, 0x14cf: 0x0004, 0x14d0: 0x000c, 0x14d1: 0x000c, 0x14d2: 0x000c, 0x14d3: 0x000c, 0x14d4: 0x000c, 0x14d5: 0x000c, 0x14d6: 0x000c, 0x14d7: 0x000c, 0x14d8: 0x000c, 0x14d9: 0x000c, 0x14da: 0x000c, 0x14db: 0x000c, 0x14dc: 0x000c, 0x14dd: 0x000c, 0x14de: 0x000c, 0x14df: 0x000c, 0x14e0: 0x000c, 0x14e1: 0x000c, 0x14e2: 0x000c, 0x14e3: 0x000c, 0x14e4: 0x000c, 0x14e5: 0x000c, 0x14e6: 0x000c, 0x14e7: 0x000c, 0x14e8: 0x000c, 0x14e9: 0x000c, 0x14ea: 0x000c, 0x14eb: 0x000c, 0x14ec: 0x000c, 0x14ed: 0x000c, 0x14ee: 0x000c, 0x14ef: 0x000c, 0x14f0: 0x000c, // Block 0x54, offset 0x1500 0x1500: 0x000a, 0x1501: 0x000a, 0x1503: 0x000a, 0x1504: 0x000a, 0x1505: 0x000a, 0x1506: 0x000a, 0x1508: 0x000a, 0x1509: 0x000a, 0x1514: 0x000a, 0x1516: 0x000a, 0x1517: 0x000a, 0x1518: 0x000a, 0x151e: 0x000a, 0x151f: 0x000a, 0x1520: 0x000a, 0x1521: 0x000a, 0x1522: 0x000a, 0x1523: 0x000a, 0x1525: 0x000a, 0x1527: 0x000a, 0x1529: 0x000a, 0x152e: 0x0004, 0x153a: 0x000a, 0x153b: 0x000a, // Block 0x55, offset 0x1540 0x1540: 0x000a, 0x1541: 0x000a, 0x1542: 0x000a, 0x1543: 0x000a, 0x1544: 0x000a, 0x154a: 0x000a, 0x154b: 0x000a, 0x154c: 0x000a, 0x154d: 0x000a, 0x1550: 0x000a, 0x1551: 0x000a, 0x1552: 0x000a, 0x1553: 0x000a, 0x1554: 0x000a, 0x1555: 0x000a, 0x1556: 0x000a, 0x1557: 0x000a, 0x1558: 0x000a, 0x1559: 0x000a, 0x155a: 0x000a, 0x155b: 0x000a, 0x155c: 0x000a, 0x155d: 0x000a, 0x155e: 0x000a, 0x155f: 0x000a, // Block 0x56, offset 0x1580 0x1589: 0x000a, 0x158a: 0x000a, 0x158b: 0x000a, 0x1590: 0x000a, 0x1591: 0x000a, 0x1592: 0x000a, 0x1593: 0x000a, 0x1594: 0x000a, 0x1595: 0x000a, 0x1596: 0x000a, 0x1597: 0x000a, 0x1598: 0x000a, 0x1599: 0x000a, 0x159a: 0x000a, 0x159b: 0x000a, 0x159c: 0x000a, 0x159d: 0x000a, 0x159e: 0x000a, 0x159f: 0x000a, 0x15a0: 0x000a, 0x15a1: 0x000a, 0x15a2: 0x000a, 0x15a3: 0x000a, 0x15a4: 0x000a, 0x15a5: 0x000a, 0x15a6: 0x000a, 0x15a7: 0x000a, 0x15a8: 0x000a, 0x15a9: 0x000a, 0x15aa: 0x000a, 0x15ab: 0x000a, 0x15ac: 0x000a, 0x15ad: 0x000a, 0x15ae: 0x000a, 0x15af: 0x000a, 0x15b0: 0x000a, 0x15b1: 0x000a, 0x15b2: 0x000a, 0x15b3: 0x000a, 0x15b4: 0x000a, 0x15b5: 0x000a, 0x15b6: 0x000a, 0x15b7: 0x000a, 0x15b8: 0x000a, 0x15b9: 0x000a, 0x15ba: 0x000a, 0x15bb: 0x000a, 0x15bc: 0x000a, 0x15bd: 0x000a, 0x15be: 0x000a, 0x15bf: 0x000a, // Block 0x57, offset 0x15c0 0x15c0: 0x000a, 0x15c1: 0x000a, 0x15c2: 0x000a, 0x15c3: 0x000a, 0x15c4: 0x000a, 0x15c5: 0x000a, 0x15c6: 0x000a, 0x15c7: 0x000a, 0x15c8: 0x000a, 0x15c9: 0x000a, 0x15ca: 0x000a, 0x15cb: 0x000a, 0x15cc: 0x000a, 0x15cd: 0x000a, 0x15ce: 0x000a, 0x15cf: 0x000a, 0x15d0: 0x000a, 0x15d1: 0x000a, 0x15d2: 0x000a, 0x15d3: 0x000a, 0x15d4: 0x000a, 0x15d5: 0x000a, 0x15d6: 0x000a, 0x15d7: 0x000a, 0x15d8: 0x000a, 0x15d9: 0x000a, 0x15da: 0x000a, 0x15db: 0x000a, 0x15dc: 0x000a, 0x15dd: 0x000a, 0x15de: 0x000a, 0x15df: 0x000a, 0x15e0: 0x000a, 0x15e1: 0x000a, 0x15e2: 0x000a, 0x15e3: 0x000a, 0x15e4: 0x000a, 0x15e5: 0x000a, 0x15e6: 0x000a, 0x15e7: 0x000a, 0x15e8: 0x000a, 0x15e9: 0x000a, 0x15ea: 0x000a, 0x15eb: 0x000a, 0x15ec: 0x000a, 0x15ed: 0x000a, 0x15ee: 0x000a, 0x15ef: 0x000a, 0x15f0: 0x000a, 0x15f1: 0x000a, 0x15f2: 0x000a, 0x15f3: 0x000a, 0x15f4: 0x000a, 0x15f5: 0x000a, 0x15f6: 0x000a, 0x15f7: 0x000a, 0x15f8: 0x000a, 0x15f9: 0x000a, 0x15fa: 0x000a, 0x15fb: 0x000a, 0x15fc: 0x000a, 0x15fd: 0x000a, 0x15fe: 0x000a, 0x15ff: 0x000a, // Block 0x58, offset 0x1600 0x1600: 0x000a, 0x1601: 0x000a, 0x1602: 0x000a, 0x1603: 0x000a, 0x1604: 0x000a, 0x1605: 0x000a, 0x1606: 0x000a, 0x1607: 0x000a, 0x1608: 0x000a, 0x1609: 0x000a, 0x160a: 0x000a, 0x160b: 0x000a, 0x160c: 0x000a, 0x160d: 0x000a, 0x160e: 0x000a, 0x160f: 0x000a, 0x1610: 0x000a, 0x1611: 0x000a, 0x1612: 0x0003, 0x1613: 0x0004, 0x1614: 0x000a, 0x1615: 0x000a, 0x1616: 0x000a, 0x1617: 0x000a, 0x1618: 0x000a, 0x1619: 0x000a, 0x161a: 0x000a, 0x161b: 0x000a, 0x161c: 0x000a, 0x161d: 0x000a, 0x161e: 0x000a, 0x161f: 0x000a, 0x1620: 0x000a, 0x1621: 0x000a, 0x1622: 0x000a, 0x1623: 0x000a, 0x1624: 0x000a, 0x1625: 0x000a, 0x1626: 0x000a, 0x1627: 0x000a, 0x1628: 0x000a, 0x1629: 0x000a, 0x162a: 0x000a, 0x162b: 0x000a, 0x162c: 0x000a, 0x162d: 0x000a, 0x162e: 0x000a, 0x162f: 0x000a, 0x1630: 0x000a, 0x1631: 0x000a, 0x1632: 0x000a, 0x1633: 0x000a, 0x1634: 0x000a, 0x1635: 0x000a, 0x1636: 0x000a, 0x1637: 0x000a, 0x1638: 0x000a, 0x1639: 0x000a, 0x163a: 0x000a, 0x163b: 0x000a, 0x163c: 0x000a, 0x163d: 0x000a, 0x163e: 0x000a, 0x163f: 0x000a, // Block 0x59, offset 0x1640 0x1640: 0x000a, 0x1641: 0x000a, 0x1642: 0x000a, 0x1643: 0x000a, 0x1644: 0x000a, 0x1645: 0x000a, 0x1646: 0x000a, 0x1647: 0x000a, 0x1648: 0x003a, 0x1649: 0x002a, 0x164a: 0x003a, 0x164b: 0x002a, 0x164c: 0x000a, 0x164d: 0x000a, 0x164e: 0x000a, 0x164f: 0x000a, 0x1650: 0x000a, 0x1651: 0x000a, 0x1652: 0x000a, 0x1653: 0x000a, 0x1654: 0x000a, 0x1655: 0x000a, 0x1656: 0x000a, 0x1657: 0x000a, 0x1658: 0x000a, 0x1659: 0x000a, 0x165a: 0x000a, 0x165b: 0x000a, 0x165c: 0x000a, 0x165d: 0x000a, 0x165e: 0x000a, 0x165f: 0x000a, 0x1660: 0x000a, 0x1661: 0x000a, 0x1662: 0x000a, 0x1663: 0x000a, 0x1664: 0x000a, 0x1665: 0x000a, 0x1666: 0x000a, 0x1667: 0x000a, 0x1668: 0x000a, 0x1669: 0x009a, 0x166a: 0x008a, 0x166b: 0x000a, 0x166c: 0x000a, 0x166d: 0x000a, 0x166e: 0x000a, 0x166f: 0x000a, 0x1670: 0x000a, 0x1671: 0x000a, 0x1672: 0x000a, 0x1673: 0x000a, 0x1674: 0x000a, 0x1675: 0x000a, // Block 0x5a, offset 0x1680 0x16bb: 0x000a, 0x16bc: 0x000a, 0x16bd: 0x000a, 0x16be: 0x000a, 0x16bf: 0x000a, // Block 0x5b, offset 0x16c0 0x16c0: 0x000a, 0x16c1: 0x000a, 0x16c2: 0x000a, 0x16c3: 0x000a, 0x16c4: 0x000a, 0x16c5: 0x000a, 0x16c6: 0x000a, 0x16c7: 0x000a, 0x16c8: 0x000a, 0x16c9: 0x000a, 0x16ca: 0x000a, 0x16cb: 0x000a, 0x16cc: 0x000a, 0x16cd: 0x000a, 0x16ce: 0x000a, 0x16cf: 0x000a, 0x16d0: 0x000a, 0x16d1: 0x000a, 0x16d2: 0x000a, 0x16d3: 0x000a, 0x16d4: 0x000a, 0x16d6: 0x000a, 0x16d7: 0x000a, 0x16d8: 0x000a, 0x16d9: 0x000a, 0x16da: 0x000a, 0x16db: 0x000a, 0x16dc: 0x000a, 0x16dd: 0x000a, 0x16de: 0x000a, 0x16df: 0x000a, 0x16e0: 0x000a, 0x16e1: 0x000a, 0x16e2: 0x000a, 0x16e3: 0x000a, 0x16e4: 0x000a, 0x16e5: 0x000a, 0x16e6: 0x000a, 0x16e7: 0x000a, 0x16e8: 0x000a, 0x16e9: 0x000a, 0x16ea: 0x000a, 0x16eb: 0x000a, 0x16ec: 0x000a, 0x16ed: 0x000a, 0x16ee: 0x000a, 0x16ef: 0x000a, 0x16f0: 0x000a, 0x16f1: 0x000a, 0x16f2: 0x000a, 0x16f3: 0x000a, 0x16f4: 0x000a, 0x16f5: 0x000a, 0x16f6: 0x000a, 0x16f7: 0x000a, 0x16f8: 0x000a, 0x16f9: 0x000a, 0x16fa: 0x000a, 0x16fb: 0x000a, 0x16fc: 0x000a, 0x16fd: 0x000a, 0x16fe: 0x000a, 0x16ff: 0x000a, // Block 0x5c, offset 0x1700 0x1700: 0x000a, 0x1701: 0x000a, 0x1702: 0x000a, 0x1703: 0x000a, 0x1704: 0x000a, 0x1705: 0x000a, 0x1706: 0x000a, 0x1707: 0x000a, 0x1708: 0x000a, 0x1709: 0x000a, 0x170a: 0x000a, 0x170b: 0x000a, 0x170c: 0x000a, 0x170d: 0x000a, 0x170e: 0x000a, 0x170f: 0x000a, 0x1710: 0x000a, 0x1711: 0x000a, 0x1712: 0x000a, 0x1713: 0x000a, 0x1714: 0x000a, 0x1715: 0x000a, 0x1716: 0x000a, 0x1717: 0x000a, 0x1718: 0x000a, 0x1719: 0x000a, 0x171a: 0x000a, 0x171b: 0x000a, 0x171c: 0x000a, 0x171d: 0x000a, 0x171e: 0x000a, 0x171f: 0x000a, 0x1720: 0x000a, 0x1721: 0x000a, 0x1722: 0x000a, 0x1723: 0x000a, 0x1724: 0x000a, 0x1725: 0x000a, 0x1726: 0x000a, 0x1727: 0x000a, 0x1728: 0x000a, 0x1729: 0x000a, // Block 0x5d, offset 0x1740 0x1740: 0x000a, 0x1741: 0x000a, 0x1742: 0x000a, 0x1743: 0x000a, 0x1744: 0x000a, 0x1745: 0x000a, 0x1746: 0x000a, 0x1747: 0x000a, 0x1748: 0x000a, 0x1749: 0x000a, 0x174a: 0x000a, 0x1760: 0x000a, 0x1761: 0x000a, 0x1762: 0x000a, 0x1763: 0x000a, 0x1764: 0x000a, 0x1765: 0x000a, 0x1766: 0x000a, 0x1767: 0x000a, 0x1768: 0x000a, 0x1769: 0x000a, 0x176a: 0x000a, 0x176b: 0x000a, 0x176c: 0x000a, 0x176d: 0x000a, 0x176e: 0x000a, 0x176f: 0x000a, 0x1770: 0x000a, 0x1771: 0x000a, 0x1772: 0x000a, 0x1773: 0x000a, 0x1774: 0x000a, 0x1775: 0x000a, 0x1776: 0x000a, 0x1777: 0x000a, 0x1778: 0x000a, 0x1779: 0x000a, 0x177a: 0x000a, 0x177b: 0x000a, 0x177c: 0x000a, 0x177d: 0x000a, 0x177e: 0x000a, 0x177f: 0x000a, // Block 0x5e, offset 0x1780 0x1780: 0x000a, 0x1781: 0x000a, 0x1782: 0x000a, 0x1783: 0x000a, 0x1784: 0x000a, 0x1785: 0x000a, 0x1786: 0x000a, 0x1787: 0x000a, 0x1788: 0x0002, 0x1789: 0x0002, 0x178a: 0x0002, 0x178b: 0x0002, 0x178c: 0x0002, 0x178d: 0x0002, 0x178e: 0x0002, 0x178f: 0x0002, 0x1790: 0x0002, 0x1791: 0x0002, 0x1792: 0x0002, 0x1793: 0x0002, 0x1794: 0x0002, 0x1795: 0x0002, 0x1796: 0x0002, 0x1797: 0x0002, 0x1798: 0x0002, 0x1799: 0x0002, 0x179a: 0x0002, 0x179b: 0x0002, // Block 0x5f, offset 0x17c0 0x17ea: 0x000a, 0x17eb: 0x000a, 0x17ec: 0x000a, 0x17ed: 0x000a, 0x17ee: 0x000a, 0x17ef: 0x000a, 0x17f0: 0x000a, 0x17f1: 0x000a, 0x17f2: 0x000a, 0x17f3: 0x000a, 0x17f4: 0x000a, 0x17f5: 0x000a, 0x17f6: 0x000a, 0x17f7: 0x000a, 0x17f8: 0x000a, 0x17f9: 0x000a, 0x17fa: 0x000a, 0x17fb: 0x000a, 0x17fc: 0x000a, 0x17fd: 0x000a, 0x17fe: 0x000a, 0x17ff: 0x000a, // Block 0x60, offset 0x1800 0x1800: 0x000a, 0x1801: 0x000a, 0x1802: 0x000a, 0x1803: 0x000a, 0x1804: 0x000a, 0x1805: 0x000a, 0x1806: 0x000a, 0x1807: 0x000a, 0x1808: 0x000a, 0x1809: 0x000a, 0x180a: 0x000a, 0x180b: 0x000a, 0x180c: 0x000a, 0x180d: 0x000a, 0x180e: 0x000a, 0x180f: 0x000a, 0x1810: 0x000a, 0x1811: 0x000a, 0x1812: 0x000a, 0x1813: 0x000a, 0x1814: 0x000a, 0x1815: 0x000a, 0x1816: 0x000a, 0x1817: 0x000a, 0x1818: 0x000a, 0x1819: 0x000a, 0x181a: 0x000a, 0x181b: 0x000a, 0x181c: 0x000a, 0x181d: 0x000a, 0x181e: 0x000a, 0x181f: 0x000a, 0x1820: 0x000a, 0x1821: 0x000a, 0x1822: 0x000a, 0x1823: 0x000a, 0x1824: 0x000a, 0x1825: 0x000a, 0x1826: 0x000a, 0x1827: 0x000a, 0x1828: 0x000a, 0x1829: 0x000a, 0x182a: 0x000a, 0x182b: 0x000a, 0x182d: 0x000a, 0x182e: 0x000a, 0x182f: 0x000a, 0x1830: 0x000a, 0x1831: 0x000a, 0x1832: 0x000a, 0x1833: 0x000a, 0x1834: 0x000a, 0x1835: 0x000a, 0x1836: 0x000a, 0x1837: 0x000a, 0x1838: 0x000a, 0x1839: 0x000a, 0x183a: 0x000a, 0x183b: 0x000a, 0x183c: 0x000a, 0x183d: 0x000a, 0x183e: 0x000a, 0x183f: 0x000a, // Block 0x61, offset 0x1840 0x1840: 0x000a, 0x1841: 0x000a, 0x1842: 0x000a, 0x1843: 0x000a, 0x1844: 0x000a, 0x1845: 0x000a, 0x1846: 0x000a, 0x1847: 0x000a, 0x1848: 0x000a, 0x1849: 0x000a, 0x184a: 0x000a, 0x184b: 0x000a, 0x184c: 0x000a, 0x184d: 0x000a, 0x184e: 0x000a, 0x184f: 0x000a, 0x1850: 0x000a, 0x1851: 0x000a, 0x1852: 0x000a, 0x1853: 0x000a, 0x1854: 0x000a, 0x1855: 0x000a, 0x1856: 0x000a, 0x1857: 0x000a, 0x1858: 0x000a, 0x1859: 0x000a, 0x185a: 0x000a, 0x185b: 0x000a, 0x185c: 0x000a, 0x185d: 0x000a, 0x185e: 0x000a, 0x185f: 0x000a, 0x1860: 0x000a, 0x1861: 0x000a, 0x1862: 0x000a, 0x1863: 0x000a, 0x1864: 0x000a, 0x1865: 0x000a, 0x1866: 0x000a, 0x1867: 0x000a, 0x1868: 0x003a, 0x1869: 0x002a, 0x186a: 0x003a, 0x186b: 0x002a, 0x186c: 0x003a, 0x186d: 0x002a, 0x186e: 0x003a, 0x186f: 0x002a, 0x1870: 0x003a, 0x1871: 0x002a, 0x1872: 0x003a, 0x1873: 0x002a, 0x1874: 0x003a, 0x1875: 0x002a, 0x1876: 0x000a, 0x1877: 0x000a, 0x1878: 0x000a, 0x1879: 0x000a, 0x187a: 0x000a, 0x187b: 0x000a, 0x187c: 0x000a, 0x187d: 0x000a, 0x187e: 0x000a, 0x187f: 0x000a, // Block 0x62, offset 0x1880 0x1880: 0x000a, 0x1881: 0x000a, 0x1882: 0x000a, 0x1883: 0x000a, 0x1884: 0x000a, 0x1885: 0x009a, 0x1886: 0x008a, 0x1887: 0x000a, 0x1888: 0x000a, 0x1889: 0x000a, 0x188a: 0x000a, 0x188b: 0x000a, 0x188c: 0x000a, 0x188d: 0x000a, 0x188e: 0x000a, 0x188f: 0x000a, 0x1890: 0x000a, 0x1891: 0x000a, 0x1892: 0x000a, 0x1893: 0x000a, 0x1894: 0x000a, 0x1895: 0x000a, 0x1896: 0x000a, 0x1897: 0x000a, 0x1898: 0x000a, 0x1899: 0x000a, 0x189a: 0x000a, 0x189b: 0x000a, 0x189c: 0x000a, 0x189d: 0x000a, 0x189e: 0x000a, 0x189f: 0x000a, 0x18a0: 0x000a, 0x18a1: 0x000a, 0x18a2: 0x000a, 0x18a3: 0x000a, 0x18a4: 0x000a, 0x18a5: 0x000a, 0x18a6: 0x003a, 0x18a7: 0x002a, 0x18a8: 0x003a, 0x18a9: 0x002a, 0x18aa: 0x003a, 0x18ab: 0x002a, 0x18ac: 0x003a, 0x18ad: 0x002a, 0x18ae: 0x003a, 0x18af: 0x002a, 0x18b0: 0x000a, 0x18b1: 0x000a, 0x18b2: 0x000a, 0x18b3: 0x000a, 0x18b4: 0x000a, 0x18b5: 0x000a, 0x18b6: 0x000a, 0x18b7: 0x000a, 0x18b8: 0x000a, 0x18b9: 0x000a, 0x18ba: 0x000a, 0x18bb: 0x000a, 0x18bc: 0x000a, 0x18bd: 0x000a, 0x18be: 0x000a, 0x18bf: 0x000a, // Block 0x63, offset 0x18c0 0x18c0: 0x000a, 0x18c1: 0x000a, 0x18c2: 0x000a, 0x18c3: 0x007a, 0x18c4: 0x006a, 0x18c5: 0x009a, 0x18c6: 0x008a, 0x18c7: 0x00ba, 0x18c8: 0x00aa, 0x18c9: 0x009a, 0x18ca: 0x008a, 0x18cb: 0x007a, 0x18cc: 0x006a, 0x18cd: 0x00da, 0x18ce: 0x002a, 0x18cf: 0x003a, 0x18d0: 0x00ca, 0x18d1: 0x009a, 0x18d2: 0x008a, 0x18d3: 0x007a, 0x18d4: 0x006a, 0x18d5: 0x009a, 0x18d6: 0x008a, 0x18d7: 0x00ba, 0x18d8: 0x00aa, 0x18d9: 0x000a, 0x18da: 0x000a, 0x18db: 0x000a, 0x18dc: 0x000a, 0x18dd: 0x000a, 0x18de: 0x000a, 0x18df: 0x000a, 0x18e0: 0x000a, 0x18e1: 0x000a, 0x18e2: 0x000a, 0x18e3: 0x000a, 0x18e4: 0x000a, 0x18e5: 0x000a, 0x18e6: 0x000a, 0x18e7: 0x000a, 0x18e8: 0x000a, 0x18e9: 0x000a, 0x18ea: 0x000a, 0x18eb: 0x000a, 0x18ec: 0x000a, 0x18ed: 0x000a, 0x18ee: 0x000a, 0x18ef: 0x000a, 0x18f0: 0x000a, 0x18f1: 0x000a, 0x18f2: 0x000a, 0x18f3: 0x000a, 0x18f4: 0x000a, 0x18f5: 0x000a, 0x18f6: 0x000a, 0x18f7: 0x000a, 0x18f8: 0x000a, 0x18f9: 0x000a, 0x18fa: 0x000a, 0x18fb: 0x000a, 0x18fc: 0x000a, 0x18fd: 0x000a, 0x18fe: 0x000a, 0x18ff: 0x000a, // Block 0x64, offset 0x1900 0x1900: 0x000a, 0x1901: 0x000a, 0x1902: 0x000a, 0x1903: 0x000a, 0x1904: 0x000a, 0x1905: 0x000a, 0x1906: 0x000a, 0x1907: 0x000a, 0x1908: 0x000a, 0x1909: 0x000a, 0x190a: 0x000a, 0x190b: 0x000a, 0x190c: 0x000a, 0x190d: 0x000a, 0x190e: 0x000a, 0x190f: 0x000a, 0x1910: 0x000a, 0x1911: 0x000a, 0x1912: 0x000a, 0x1913: 0x000a, 0x1914: 0x000a, 0x1915: 0x000a, 0x1916: 0x000a, 0x1917: 0x000a, 0x1918: 0x003a, 0x1919: 0x002a, 0x191a: 0x003a, 0x191b: 0x002a, 0x191c: 0x000a, 0x191d: 0x000a, 0x191e: 0x000a, 0x191f: 0x000a, 0x1920: 0x000a, 0x1921: 0x000a, 0x1922: 0x000a, 0x1923: 0x000a, 0x1924: 0x000a, 0x1925: 0x000a, 0x1926: 0x000a, 0x1927: 0x000a, 0x1928: 0x000a, 0x1929: 0x000a, 0x192a: 0x000a, 0x192b: 0x000a, 0x192c: 0x000a, 0x192d: 0x000a, 0x192e: 0x000a, 0x192f: 0x000a, 0x1930: 0x000a, 0x1931: 0x000a, 0x1932: 0x000a, 0x1933: 0x000a, 0x1934: 0x000a, 0x1935: 0x000a, 0x1936: 0x000a, 0x1937: 0x000a, 0x1938: 0x000a, 0x1939: 0x000a, 0x193a: 0x000a, 0x193b: 0x000a, 0x193c: 0x003a, 0x193d: 0x002a, 0x193e: 0x000a, 0x193f: 0x000a, // Block 0x65, offset 0x1940 0x1940: 0x000a, 0x1941: 0x000a, 0x1942: 0x000a, 0x1943: 0x000a, 0x1944: 0x000a, 0x1945: 0x000a, 0x1946: 0x000a, 0x1947: 0x000a, 0x1948: 0x000a, 0x1949: 0x000a, 0x194a: 0x000a, 0x194b: 0x000a, 0x194c: 0x000a, 0x194d: 0x000a, 0x194e: 0x000a, 0x194f: 0x000a, 0x1950: 0x000a, 0x1951: 0x000a, 0x1952: 0x000a, 0x1953: 0x000a, 0x1954: 0x000a, 0x1955: 0x000a, 0x1956: 0x000a, 0x1957: 0x000a, 0x1958: 0x000a, 0x1959: 0x000a, 0x195a: 0x000a, 0x195b: 0x000a, 0x195c: 0x000a, 0x195d: 0x000a, 0x195e: 0x000a, 0x195f: 0x000a, 0x1960: 0x000a, 0x1961: 0x000a, 0x1962: 0x000a, 0x1963: 0x000a, 0x1964: 0x000a, 0x1965: 0x000a, 0x1966: 0x000a, 0x1967: 0x000a, 0x1968: 0x000a, 0x1969: 0x000a, 0x196a: 0x000a, 0x196b: 0x000a, 0x196c: 0x000a, 0x196d: 0x000a, 0x196e: 0x000a, 0x196f: 0x000a, 0x1970: 0x000a, 0x1971: 0x000a, 0x1972: 0x000a, 0x1973: 0x000a, 0x1976: 0x000a, 0x1977: 0x000a, 0x1978: 0x000a, 0x1979: 0x000a, 0x197a: 0x000a, 0x197b: 0x000a, 0x197c: 0x000a, 0x197d: 0x000a, 0x197e: 0x000a, 0x197f: 0x000a, // Block 0x66, offset 0x1980 0x19a5: 0x000a, 0x19a6: 0x000a, 0x19a7: 0x000a, 0x19a8: 0x000a, 0x19a9: 0x000a, 0x19aa: 0x000a, 0x19af: 0x000c, 0x19b0: 0x000c, 0x19b1: 0x000c, 0x19b9: 0x000a, 0x19ba: 0x000a, 0x19bb: 0x000a, 0x19bc: 0x000a, 0x19bd: 0x000a, 0x19be: 0x000a, 0x19bf: 0x000a, // Block 0x67, offset 0x19c0 0x19ff: 0x000c, // Block 0x68, offset 0x1a00 0x1a20: 0x000c, 0x1a21: 0x000c, 0x1a22: 0x000c, 0x1a23: 0x000c, 0x1a24: 0x000c, 0x1a25: 0x000c, 0x1a26: 0x000c, 0x1a27: 0x000c, 0x1a28: 0x000c, 0x1a29: 0x000c, 0x1a2a: 0x000c, 0x1a2b: 0x000c, 0x1a2c: 0x000c, 0x1a2d: 0x000c, 0x1a2e: 0x000c, 0x1a2f: 0x000c, 0x1a30: 0x000c, 0x1a31: 0x000c, 0x1a32: 0x000c, 0x1a33: 0x000c, 0x1a34: 0x000c, 0x1a35: 0x000c, 0x1a36: 0x000c, 0x1a37: 0x000c, 0x1a38: 0x000c, 0x1a39: 0x000c, 0x1a3a: 0x000c, 0x1a3b: 0x000c, 0x1a3c: 0x000c, 0x1a3d: 0x000c, 0x1a3e: 0x000c, 0x1a3f: 0x000c, // Block 0x69, offset 0x1a40 0x1a40: 0x000a, 0x1a41: 0x000a, 0x1a42: 0x000a, 0x1a43: 0x000a, 0x1a44: 0x000a, 0x1a45: 0x000a, 0x1a46: 0x000a, 0x1a47: 0x000a, 0x1a48: 0x000a, 0x1a49: 0x000a, 0x1a4a: 0x000a, 0x1a4b: 0x000a, 0x1a4c: 0x000a, 0x1a4d: 0x000a, 0x1a4e: 0x000a, 0x1a4f: 0x000a, 0x1a50: 0x000a, 0x1a51: 0x000a, 0x1a52: 0x000a, 0x1a53: 0x000a, 0x1a54: 0x000a, 0x1a55: 0x000a, 0x1a56: 0x000a, 0x1a57: 0x000a, 0x1a58: 0x000a, 0x1a59: 0x000a, 0x1a5a: 0x000a, 0x1a5b: 0x000a, 0x1a5c: 0x000a, 0x1a5d: 0x000a, 0x1a5e: 0x000a, 0x1a5f: 0x000a, 0x1a60: 0x000a, 0x1a61: 0x000a, 0x1a62: 0x003a, 0x1a63: 0x002a, 0x1a64: 0x003a, 0x1a65: 0x002a, 0x1a66: 0x003a, 0x1a67: 0x002a, 0x1a68: 0x003a, 0x1a69: 0x002a, 0x1a6a: 0x000a, 0x1a6b: 0x000a, 0x1a6c: 0x000a, 0x1a6d: 0x000a, 0x1a6e: 0x000a, 0x1a6f: 0x000a, 0x1a70: 0x000a, 0x1a71: 0x000a, 0x1a72: 0x000a, 0x1a73: 0x000a, 0x1a74: 0x000a, 0x1a75: 0x000a, 0x1a76: 0x000a, 0x1a77: 0x000a, 0x1a78: 0x000a, 0x1a79: 0x000a, 0x1a7a: 0x000a, 0x1a7b: 0x000a, 0x1a7c: 0x000a, 0x1a7d: 0x000a, 0x1a7e: 0x000a, 0x1a7f: 0x000a, // Block 0x6a, offset 0x1a80 0x1a80: 0x000a, 0x1a81: 0x000a, 0x1a82: 0x000a, 0x1a83: 0x000a, 0x1a84: 0x000a, 0x1a85: 0x000a, 0x1a86: 0x000a, 0x1a87: 0x000a, 0x1a88: 0x000a, 0x1a89: 0x000a, 0x1a8a: 0x000a, 0x1a8b: 0x000a, 0x1a8c: 0x000a, 0x1a8d: 0x000a, 0x1a8e: 0x000a, 0x1a8f: 0x000a, 0x1a90: 0x000a, 0x1a91: 0x000a, 0x1a92: 0x000a, 0x1a93: 0x000a, 0x1a94: 0x000a, 0x1a95: 0x009a, 0x1a96: 0x008a, 0x1a97: 0x00ba, 0x1a98: 0x00aa, 0x1a99: 0x009a, 0x1a9a: 0x008a, 0x1a9b: 0x007a, 0x1a9c: 0x006a, 0x1a9d: 0x000a, // Block 0x6b, offset 0x1ac0 0x1ac0: 0x000a, 0x1ac1: 0x000a, 0x1ac2: 0x000a, 0x1ac3: 0x000a, 0x1ac4: 0x000a, 0x1ac5: 0x000a, 0x1ac6: 0x000a, 0x1ac7: 0x000a, 0x1ac8: 0x000a, 0x1ac9: 0x000a, 0x1aca: 0x000a, 0x1acb: 0x000a, 0x1acc: 0x000a, 0x1acd: 0x000a, 0x1ace: 0x000a, 0x1acf: 0x000a, 0x1ad0: 0x000a, 0x1ad1: 0x000a, 0x1ad2: 0x000a, 0x1ad3: 0x000a, 0x1ad4: 0x000a, 0x1ad5: 0x000a, 0x1ad6: 0x000a, 0x1ad7: 0x000a, 0x1ad8: 0x000a, 0x1ad9: 0x000a, 0x1adb: 0x000a, 0x1adc: 0x000a, 0x1add: 0x000a, 0x1ade: 0x000a, 0x1adf: 0x000a, 0x1ae0: 0x000a, 0x1ae1: 0x000a, 0x1ae2: 0x000a, 0x1ae3: 0x000a, 0x1ae4: 0x000a, 0x1ae5: 0x000a, 0x1ae6: 0x000a, 0x1ae7: 0x000a, 0x1ae8: 0x000a, 0x1ae9: 0x000a, 0x1aea: 0x000a, 0x1aeb: 0x000a, 0x1aec: 0x000a, 0x1aed: 0x000a, 0x1aee: 0x000a, 0x1aef: 0x000a, 0x1af0: 0x000a, 0x1af1: 0x000a, 0x1af2: 0x000a, 0x1af3: 0x000a, 0x1af4: 0x000a, 0x1af5: 0x000a, 0x1af6: 0x000a, 0x1af7: 0x000a, 0x1af8: 0x000a, 0x1af9: 0x000a, 0x1afa: 0x000a, 0x1afb: 0x000a, 0x1afc: 0x000a, 0x1afd: 0x000a, 0x1afe: 0x000a, 0x1aff: 0x000a, // Block 0x6c, offset 0x1b00 0x1b00: 0x000a, 0x1b01: 0x000a, 0x1b02: 0x000a, 0x1b03: 0x000a, 0x1b04: 0x000a, 0x1b05: 0x000a, 0x1b06: 0x000a, 0x1b07: 0x000a, 0x1b08: 0x000a, 0x1b09: 0x000a, 0x1b0a: 0x000a, 0x1b0b: 0x000a, 0x1b0c: 0x000a, 0x1b0d: 0x000a, 0x1b0e: 0x000a, 0x1b0f: 0x000a, 0x1b10: 0x000a, 0x1b11: 0x000a, 0x1b12: 0x000a, 0x1b13: 0x000a, 0x1b14: 0x000a, 0x1b15: 0x000a, 0x1b16: 0x000a, 0x1b17: 0x000a, 0x1b18: 0x000a, 0x1b19: 0x000a, 0x1b1a: 0x000a, 0x1b1b: 0x000a, 0x1b1c: 0x000a, 0x1b1d: 0x000a, 0x1b1e: 0x000a, 0x1b1f: 0x000a, 0x1b20: 0x000a, 0x1b21: 0x000a, 0x1b22: 0x000a, 0x1b23: 0x000a, 0x1b24: 0x000a, 0x1b25: 0x000a, 0x1b26: 0x000a, 0x1b27: 0x000a, 0x1b28: 0x000a, 0x1b29: 0x000a, 0x1b2a: 0x000a, 0x1b2b: 0x000a, 0x1b2c: 0x000a, 0x1b2d: 0x000a, 0x1b2e: 0x000a, 0x1b2f: 0x000a, 0x1b30: 0x000a, 0x1b31: 0x000a, 0x1b32: 0x000a, 0x1b33: 0x000a, // Block 0x6d, offset 0x1b40 0x1b40: 0x000a, 0x1b41: 0x000a, 0x1b42: 0x000a, 0x1b43: 0x000a, 0x1b44: 0x000a, 0x1b45: 0x000a, 0x1b46: 0x000a, 0x1b47: 0x000a, 0x1b48: 0x000a, 0x1b49: 0x000a, 0x1b4a: 0x000a, 0x1b4b: 0x000a, 0x1b4c: 0x000a, 0x1b4d: 0x000a, 0x1b4e: 0x000a, 0x1b4f: 0x000a, 0x1b50: 0x000a, 0x1b51: 0x000a, 0x1b52: 0x000a, 0x1b53: 0x000a, 0x1b54: 0x000a, 0x1b55: 0x000a, 0x1b70: 0x000a, 0x1b71: 0x000a, 0x1b72: 0x000a, 0x1b73: 0x000a, 0x1b74: 0x000a, 0x1b75: 0x000a, 0x1b76: 0x000a, 0x1b77: 0x000a, 0x1b78: 0x000a, 0x1b79: 0x000a, 0x1b7a: 0x000a, 0x1b7b: 0x000a, 0x1b7c: 0x000a, 0x1b7d: 0x000a, 0x1b7e: 0x000a, 0x1b7f: 0x000a, // Block 0x6e, offset 0x1b80 0x1b80: 0x0009, 0x1b81: 0x000a, 0x1b82: 0x000a, 0x1b83: 0x000a, 0x1b84: 0x000a, 0x1b88: 0x003a, 0x1b89: 0x002a, 0x1b8a: 0x003a, 0x1b8b: 0x002a, 0x1b8c: 0x003a, 0x1b8d: 0x002a, 0x1b8e: 0x003a, 0x1b8f: 0x002a, 0x1b90: 0x003a, 0x1b91: 0x002a, 0x1b92: 0x000a, 0x1b93: 0x000a, 0x1b94: 0x003a, 0x1b95: 0x002a, 0x1b96: 0x003a, 0x1b97: 0x002a, 0x1b98: 0x003a, 0x1b99: 0x002a, 0x1b9a: 0x003a, 0x1b9b: 0x002a, 0x1b9c: 0x000a, 0x1b9d: 0x000a, 0x1b9e: 0x000a, 0x1b9f: 0x000a, 0x1ba0: 0x000a, 0x1baa: 0x000c, 0x1bab: 0x000c, 0x1bac: 0x000c, 0x1bad: 0x000c, 0x1bb0: 0x000a, 0x1bb6: 0x000a, 0x1bb7: 0x000a, 0x1bbd: 0x000a, 0x1bbe: 0x000a, 0x1bbf: 0x000a, // Block 0x6f, offset 0x1bc0 0x1bd9: 0x000c, 0x1bda: 0x000c, 0x1bdb: 0x000a, 0x1bdc: 0x000a, 0x1be0: 0x000a, // Block 0x70, offset 0x1c00 0x1c3b: 0x000a, // Block 0x71, offset 0x1c40 0x1c40: 0x000a, 0x1c41: 0x000a, 0x1c42: 0x000a, 0x1c43: 0x000a, 0x1c44: 0x000a, 0x1c45: 0x000a, 0x1c46: 0x000a, 0x1c47: 0x000a, 0x1c48: 0x000a, 0x1c49: 0x000a, 0x1c4a: 0x000a, 0x1c4b: 0x000a, 0x1c4c: 0x000a, 0x1c4d: 0x000a, 0x1c4e: 0x000a, 0x1c4f: 0x000a, 0x1c50: 0x000a, 0x1c51: 0x000a, 0x1c52: 0x000a, 0x1c53: 0x000a, 0x1c54: 0x000a, 0x1c55: 0x000a, 0x1c56: 0x000a, 0x1c57: 0x000a, 0x1c58: 0x000a, 0x1c59: 0x000a, 0x1c5a: 0x000a, 0x1c5b: 0x000a, 0x1c5c: 0x000a, 0x1c5d: 0x000a, 0x1c5e: 0x000a, 0x1c5f: 0x000a, 0x1c60: 0x000a, 0x1c61: 0x000a, 0x1c62: 0x000a, 0x1c63: 0x000a, 0x1c64: 0x000a, 0x1c65: 0x000a, 0x1c6f: 0x000a, // Block 0x72, offset 0x1c80 0x1c9d: 0x000a, 0x1c9e: 0x000a, // Block 0x73, offset 0x1cc0 0x1cd0: 0x000a, 0x1cd1: 0x000a, 0x1cd2: 0x000a, 0x1cd3: 0x000a, 0x1cd4: 0x000a, 0x1cd5: 0x000a, 0x1cd6: 0x000a, 0x1cd7: 0x000a, 0x1cd8: 0x000a, 0x1cd9: 0x000a, 0x1cda: 0x000a, 0x1cdb: 0x000a, 0x1cdc: 0x000a, 0x1cdd: 0x000a, 0x1cde: 0x000a, 0x1cdf: 0x000a, 0x1cfc: 0x000a, 0x1cfd: 0x000a, 0x1cfe: 0x000a, // Block 0x74, offset 0x1d00 0x1d31: 0x000a, 0x1d32: 0x000a, 0x1d33: 0x000a, 0x1d34: 0x000a, 0x1d35: 0x000a, 0x1d36: 0x000a, 0x1d37: 0x000a, 0x1d38: 0x000a, 0x1d39: 0x000a, 0x1d3a: 0x000a, 0x1d3b: 0x000a, 0x1d3c: 0x000a, 0x1d3d: 0x000a, 0x1d3e: 0x000a, 0x1d3f: 0x000a, // Block 0x75, offset 0x1d40 0x1d4c: 0x000a, 0x1d4d: 0x000a, 0x1d4e: 0x000a, 0x1d4f: 0x000a, // Block 0x76, offset 0x1d80 0x1db7: 0x000a, 0x1db8: 0x000a, 0x1db9: 0x000a, 0x1dba: 0x000a, // Block 0x77, offset 0x1dc0 0x1dde: 0x000a, 0x1ddf: 0x000a, 0x1dff: 0x000a, // Block 0x78, offset 0x1e00 0x1e10: 0x000a, 0x1e11: 0x000a, 0x1e12: 0x000a, 0x1e13: 0x000a, 0x1e14: 0x000a, 0x1e15: 0x000a, 0x1e16: 0x000a, 0x1e17: 0x000a, 0x1e18: 0x000a, 0x1e19: 0x000a, 0x1e1a: 0x000a, 0x1e1b: 0x000a, 0x1e1c: 0x000a, 0x1e1d: 0x000a, 0x1e1e: 0x000a, 0x1e1f: 0x000a, 0x1e20: 0x000a, 0x1e21: 0x000a, 0x1e22: 0x000a, 0x1e23: 0x000a, 0x1e24: 0x000a, 0x1e25: 0x000a, 0x1e26: 0x000a, 0x1e27: 0x000a, 0x1e28: 0x000a, 0x1e29: 0x000a, 0x1e2a: 0x000a, 0x1e2b: 0x000a, 0x1e2c: 0x000a, 0x1e2d: 0x000a, 0x1e2e: 0x000a, 0x1e2f: 0x000a, 0x1e30: 0x000a, 0x1e31: 0x000a, 0x1e32: 0x000a, 0x1e33: 0x000a, 0x1e34: 0x000a, 0x1e35: 0x000a, 0x1e36: 0x000a, 0x1e37: 0x000a, 0x1e38: 0x000a, 0x1e39: 0x000a, 0x1e3a: 0x000a, 0x1e3b: 0x000a, 0x1e3c: 0x000a, 0x1e3d: 0x000a, 0x1e3e: 0x000a, 0x1e3f: 0x000a, // Block 0x79, offset 0x1e40 0x1e40: 0x000a, 0x1e41: 0x000a, 0x1e42: 0x000a, 0x1e43: 0x000a, 0x1e44: 0x000a, 0x1e45: 0x000a, 0x1e46: 0x000a, // Block 0x7a, offset 0x1e80 0x1e8d: 0x000a, 0x1e8e: 0x000a, 0x1e8f: 0x000a, // Block 0x7b, offset 0x1ec0 0x1eef: 0x000c, 0x1ef0: 0x000c, 0x1ef1: 0x000c, 0x1ef2: 0x000c, 0x1ef3: 0x000a, 0x1ef4: 0x000c, 0x1ef5: 0x000c, 0x1ef6: 0x000c, 0x1ef7: 0x000c, 0x1ef8: 0x000c, 0x1ef9: 0x000c, 0x1efa: 0x000c, 0x1efb: 0x000c, 0x1efc: 0x000c, 0x1efd: 0x000c, 0x1efe: 0x000a, 0x1eff: 0x000a, // Block 0x7c, offset 0x1f00 0x1f1e: 0x000c, 0x1f1f: 0x000c, // Block 0x7d, offset 0x1f40 0x1f70: 0x000c, 0x1f71: 0x000c, // Block 0x7e, offset 0x1f80 0x1f80: 0x000a, 0x1f81: 0x000a, 0x1f82: 0x000a, 0x1f83: 0x000a, 0x1f84: 0x000a, 0x1f85: 0x000a, 0x1f86: 0x000a, 0x1f87: 0x000a, 0x1f88: 0x000a, 0x1f89: 0x000a, 0x1f8a: 0x000a, 0x1f8b: 0x000a, 0x1f8c: 0x000a, 0x1f8d: 0x000a, 0x1f8e: 0x000a, 0x1f8f: 0x000a, 0x1f90: 0x000a, 0x1f91: 0x000a, 0x1f92: 0x000a, 0x1f93: 0x000a, 0x1f94: 0x000a, 0x1f95: 0x000a, 0x1f96: 0x000a, 0x1f97: 0x000a, 0x1f98: 0x000a, 0x1f99: 0x000a, 0x1f9a: 0x000a, 0x1f9b: 0x000a, 0x1f9c: 0x000a, 0x1f9d: 0x000a, 0x1f9e: 0x000a, 0x1f9f: 0x000a, 0x1fa0: 0x000a, 0x1fa1: 0x000a, // Block 0x7f, offset 0x1fc0 0x1fc8: 0x000a, // Block 0x80, offset 0x2000 0x2002: 0x000c, 0x2006: 0x000c, 0x200b: 0x000c, 0x2025: 0x000c, 0x2026: 0x000c, 0x2028: 0x000a, 0x2029: 0x000a, 0x202a: 0x000a, 0x202b: 0x000a, 0x202c: 0x000c, 0x2038: 0x0004, 0x2039: 0x0004, // Block 0x81, offset 0x2040 0x2074: 0x000a, 0x2075: 0x000a, 0x2076: 0x000a, 0x2077: 0x000a, // Block 0x82, offset 0x2080 0x2084: 0x000c, 0x2085: 0x000c, 0x20a0: 0x000c, 0x20a1: 0x000c, 0x20a2: 0x000c, 0x20a3: 0x000c, 0x20a4: 0x000c, 0x20a5: 0x000c, 0x20a6: 0x000c, 0x20a7: 0x000c, 0x20a8: 0x000c, 0x20a9: 0x000c, 0x20aa: 0x000c, 0x20ab: 0x000c, 0x20ac: 0x000c, 0x20ad: 0x000c, 0x20ae: 0x000c, 0x20af: 0x000c, 0x20b0: 0x000c, 0x20b1: 0x000c, 0x20bf: 0x000c, // Block 0x83, offset 0x20c0 0x20e6: 0x000c, 0x20e7: 0x000c, 0x20e8: 0x000c, 0x20e9: 0x000c, 0x20ea: 0x000c, 0x20eb: 0x000c, 0x20ec: 0x000c, 0x20ed: 0x000c, // Block 0x84, offset 0x2100 0x2107: 0x000c, 0x2108: 0x000c, 0x2109: 0x000c, 0x210a: 0x000c, 0x210b: 0x000c, 0x210c: 0x000c, 0x210d: 0x000c, 0x210e: 0x000c, 0x210f: 0x000c, 0x2110: 0x000c, 0x2111: 0x000c, // Block 0x85, offset 0x2140 0x2140: 0x000c, 0x2141: 0x000c, 0x2142: 0x000c, 0x2173: 0x000c, 0x2176: 0x000c, 0x2177: 0x000c, 0x2178: 0x000c, 0x2179: 0x000c, 0x217c: 0x000c, 0x217d: 0x000c, // Block 0x86, offset 0x2180 0x21a5: 0x000c, // Block 0x87, offset 0x21c0 0x21e9: 0x000c, 0x21ea: 0x000c, 0x21eb: 0x000c, 0x21ec: 0x000c, 0x21ed: 0x000c, 0x21ee: 0x000c, 0x21f1: 0x000c, 0x21f2: 0x000c, 0x21f5: 0x000c, 0x21f6: 0x000c, // Block 0x88, offset 0x2200 0x2203: 0x000c, 0x220c: 0x000c, 0x223c: 0x000c, // Block 0x89, offset 0x2240 0x2270: 0x000c, 0x2272: 0x000c, 0x2273: 0x000c, 0x2274: 0x000c, 0x2277: 0x000c, 0x2278: 0x000c, 0x227e: 0x000c, 0x227f: 0x000c, // Block 0x8a, offset 0x2280 0x2281: 0x000c, 0x22ac: 0x000c, 0x22ad: 0x000c, 0x22b6: 0x000c, // Block 0x8b, offset 0x22c0 0x22ea: 0x000a, 0x22eb: 0x000a, // Block 0x8c, offset 0x2300 0x2325: 0x000c, 0x2328: 0x000c, 0x232d: 0x000c, // Block 0x8d, offset 0x2340 0x235d: 0x0001, 0x235e: 0x000c, 0x235f: 0x0001, 0x2360: 0x0001, 0x2361: 0x0001, 0x2362: 0x0001, 0x2363: 0x0001, 0x2364: 0x0001, 0x2365: 0x0001, 0x2366: 0x0001, 0x2367: 0x0001, 0x2368: 0x0001, 0x2369: 0x0003, 0x236a: 0x0001, 0x236b: 0x0001, 0x236c: 0x0001, 0x236d: 0x0001, 0x236e: 0x0001, 0x236f: 0x0001, 0x2370: 0x0001, 0x2371: 0x0001, 0x2372: 0x0001, 0x2373: 0x0001, 0x2374: 0x0001, 0x2375: 0x0001, 0x2376: 0x0001, 0x2377: 0x0001, 0x2378: 0x0001, 0x2379: 0x0001, 0x237a: 0x0001, 0x237b: 0x0001, 0x237c: 0x0001, 0x237d: 0x0001, 0x237e: 0x0001, 0x237f: 0x0001, // Block 0x8e, offset 0x2380 0x2380: 0x0001, 0x2381: 0x0001, 0x2382: 0x0001, 0x2383: 0x0001, 0x2384: 0x0001, 0x2385: 0x0001, 0x2386: 0x0001, 0x2387: 0x0001, 0x2388: 0x0001, 0x2389: 0x0001, 0x238a: 0x0001, 0x238b: 0x0001, 0x238c: 0x0001, 0x238d: 0x0001, 0x238e: 0x0001, 0x238f: 0x0001, 0x2390: 0x000d, 0x2391: 0x000d, 0x2392: 0x000d, 0x2393: 0x000d, 0x2394: 0x000d, 0x2395: 0x000d, 0x2396: 0x000d, 0x2397: 0x000d, 0x2398: 0x000d, 0x2399: 0x000d, 0x239a: 0x000d, 0x239b: 0x000d, 0x239c: 0x000d, 0x239d: 0x000d, 0x239e: 0x000d, 0x239f: 0x000d, 0x23a0: 0x000d, 0x23a1: 0x000d, 0x23a2: 0x000d, 0x23a3: 0x000d, 0x23a4: 0x000d, 0x23a5: 0x000d, 0x23a6: 0x000d, 0x23a7: 0x000d, 0x23a8: 0x000d, 0x23a9: 0x000d, 0x23aa: 0x000d, 0x23ab: 0x000d, 0x23ac: 0x000d, 0x23ad: 0x000d, 0x23ae: 0x000d, 0x23af: 0x000d, 0x23b0: 0x000d, 0x23b1: 0x000d, 0x23b2: 0x000d, 0x23b3: 0x000d, 0x23b4: 0x000d, 0x23b5: 0x000d, 0x23b6: 0x000d, 0x23b7: 0x000d, 0x23b8: 0x000d, 0x23b9: 0x000d, 0x23ba: 0x000d, 0x23bb: 0x000d, 0x23bc: 0x000d, 0x23bd: 0x000d, 0x23be: 0x000d, 0x23bf: 0x000d, // Block 0x8f, offset 0x23c0 0x23c0: 0x000d, 0x23c1: 0x000d, 0x23c2: 0x000d, 0x23c3: 0x000a, 0x23c4: 0x000a, 0x23c5: 0x000a, 0x23c6: 0x000a, 0x23c7: 0x000a, 0x23c8: 0x000a, 0x23c9: 0x000a, 0x23ca: 0x000a, 0x23cb: 0x000a, 0x23cc: 0x000a, 0x23cd: 0x000a, 0x23ce: 0x000a, 0x23cf: 0x000a, 0x23d0: 0x000a, 0x23d1: 0x000a, 0x23d2: 0x000a, 0x23d3: 0x000d, 0x23d4: 0x000d, 0x23d5: 0x000d, 0x23d6: 0x000d, 0x23d7: 0x000d, 0x23d8: 0x000d, 0x23d9: 0x000d, 0x23da: 0x000d, 0x23db: 0x000d, 0x23dc: 0x000d, 0x23dd: 0x000d, 0x23de: 0x000d, 0x23df: 0x000d, 0x23e0: 0x000d, 0x23e1: 0x000d, 0x23e2: 0x000d, 0x23e3: 0x000d, 0x23e4: 0x000d, 0x23e5: 0x000d, 0x23e6: 0x000d, 0x23e7: 0x000d, 0x23e8: 0x000d, 0x23e9: 0x000d, 0x23ea: 0x000d, 0x23eb: 0x000d, 0x23ec: 0x000d, 0x23ed: 0x000d, 0x23ee: 0x000d, 0x23ef: 0x000d, 0x23f0: 0x000d, 0x23f1: 0x000d, 0x23f2: 0x000d, 0x23f3: 0x000d, 0x23f4: 0x000d, 0x23f5: 0x000d, 0x23f6: 0x000d, 0x23f7: 0x000d, 0x23f8: 0x000d, 0x23f9: 0x000d, 0x23fa: 0x000d, 0x23fb: 0x000d, 0x23fc: 0x000d, 0x23fd: 0x000d, 0x23fe: 0x000d, 0x23ff: 0x000d, // Block 0x90, offset 0x2400 0x2400: 0x000d, 0x2401: 0x000d, 0x2402: 0x000d, 0x2403: 0x000d, 0x2404: 0x000d, 0x2405: 0x000d, 0x2406: 0x000d, 0x2407: 0x000d, 0x2408: 0x000d, 0x2409: 0x000d, 0x240a: 0x000d, 0x240b: 0x000d, 0x240c: 0x000d, 0x240d: 0x000d, 0x240e: 0x000d, 0x240f: 0x000d, 0x2410: 0x000d, 0x2411: 0x000d, 0x2412: 0x000d, 0x2413: 0x000d, 0x2414: 0x000d, 0x2415: 0x000d, 0x2416: 0x000d, 0x2417: 0x000d, 0x2418: 0x000d, 0x2419: 0x000d, 0x241a: 0x000d, 0x241b: 0x000d, 0x241c: 0x000d, 0x241d: 0x000d, 0x241e: 0x000d, 0x241f: 0x000d, 0x2420: 0x000d, 0x2421: 0x000d, 0x2422: 0x000d, 0x2423: 0x000d, 0x2424: 0x000d, 0x2425: 0x000d, 0x2426: 0x000d, 0x2427: 0x000d, 0x2428: 0x000d, 0x2429: 0x000d, 0x242a: 0x000d, 0x242b: 0x000d, 0x242c: 0x000d, 0x242d: 0x000d, 0x242e: 0x000d, 0x242f: 0x000d, 0x2430: 0x000d, 0x2431: 0x000d, 0x2432: 0x000d, 0x2433: 0x000d, 0x2434: 0x000d, 0x2435: 0x000d, 0x2436: 0x000d, 0x2437: 0x000d, 0x2438: 0x000d, 0x2439: 0x000d, 0x243a: 0x000d, 0x243b: 0x000d, 0x243c: 0x000d, 0x243d: 0x000d, 0x243e: 0x000a, 0x243f: 0x000a, // Block 0x91, offset 0x2440 0x2440: 0x000a, 0x2441: 0x000a, 0x2442: 0x000a, 0x2443: 0x000a, 0x2444: 0x000a, 0x2445: 0x000a, 0x2446: 0x000a, 0x2447: 0x000a, 0x2448: 0x000a, 0x2449: 0x000a, 0x244a: 0x000a, 0x244b: 0x000a, 0x244c: 0x000a, 0x244d: 0x000a, 0x244e: 0x000a, 0x244f: 0x000a, 0x2450: 0x000d, 0x2451: 0x000d, 0x2452: 0x000d, 0x2453: 0x000d, 0x2454: 0x000d, 0x2455: 0x000d, 0x2456: 0x000d, 0x2457: 0x000d, 0x2458: 0x000d, 0x2459: 0x000d, 0x245a: 0x000d, 0x245b: 0x000d, 0x245c: 0x000d, 0x245d: 0x000d, 0x245e: 0x000d, 0x245f: 0x000d, 0x2460: 0x000d, 0x2461: 0x000d, 0x2462: 0x000d, 0x2463: 0x000d, 0x2464: 0x000d, 0x2465: 0x000d, 0x2466: 0x000d, 0x2467: 0x000d, 0x2468: 0x000d, 0x2469: 0x000d, 0x246a: 0x000d, 0x246b: 0x000d, 0x246c: 0x000d, 0x246d: 0x000d, 0x246e: 0x000d, 0x246f: 0x000d, 0x2470: 0x000d, 0x2471: 0x000d, 0x2472: 0x000d, 0x2473: 0x000d, 0x2474: 0x000d, 0x2475: 0x000d, 0x2476: 0x000d, 0x2477: 0x000d, 0x2478: 0x000d, 0x2479: 0x000d, 0x247a: 0x000d, 0x247b: 0x000d, 0x247c: 0x000d, 0x247d: 0x000d, 0x247e: 0x000d, 0x247f: 0x000d, // Block 0x92, offset 0x2480 0x2480: 0x000d, 0x2481: 0x000d, 0x2482: 0x000d, 0x2483: 0x000d, 0x2484: 0x000d, 0x2485: 0x000d, 0x2486: 0x000d, 0x2487: 0x000d, 0x2488: 0x000d, 0x2489: 0x000d, 0x248a: 0x000d, 0x248b: 0x000d, 0x248c: 0x000d, 0x248d: 0x000d, 0x248e: 0x000d, 0x248f: 0x000d, 0x2490: 0x000a, 0x2491: 0x000a, 0x2492: 0x000d, 0x2493: 0x000d, 0x2494: 0x000d, 0x2495: 0x000d, 0x2496: 0x000d, 0x2497: 0x000d, 0x2498: 0x000d, 0x2499: 0x000d, 0x249a: 0x000d, 0x249b: 0x000d, 0x249c: 0x000d, 0x249d: 0x000d, 0x249e: 0x000d, 0x249f: 0x000d, 0x24a0: 0x000d, 0x24a1: 0x000d, 0x24a2: 0x000d, 0x24a3: 0x000d, 0x24a4: 0x000d, 0x24a5: 0x000d, 0x24a6: 0x000d, 0x24a7: 0x000d, 0x24a8: 0x000d, 0x24a9: 0x000d, 0x24aa: 0x000d, 0x24ab: 0x000d, 0x24ac: 0x000d, 0x24ad: 0x000d, 0x24ae: 0x000d, 0x24af: 0x000d, 0x24b0: 0x000d, 0x24b1: 0x000d, 0x24b2: 0x000d, 0x24b3: 0x000d, 0x24b4: 0x000d, 0x24b5: 0x000d, 0x24b6: 0x000d, 0x24b7: 0x000d, 0x24b8: 0x000d, 0x24b9: 0x000d, 0x24ba: 0x000d, 0x24bb: 0x000d, 0x24bc: 0x000d, 0x24bd: 0x000d, 0x24be: 0x000d, 0x24bf: 0x000d, // Block 0x93, offset 0x24c0 0x24c0: 0x000d, 0x24c1: 0x000d, 0x24c2: 0x000d, 0x24c3: 0x000d, 0x24c4: 0x000d, 0x24c5: 0x000d, 0x24c6: 0x000d, 0x24c7: 0x000d, 0x24c8: 0x000a, 0x24c9: 0x000a, 0x24ca: 0x000a, 0x24cb: 0x000a, 0x24cc: 0x000a, 0x24cd: 0x000a, 0x24ce: 0x000a, 0x24cf: 0x000a, 0x24d0: 0x000b, 0x24d1: 0x000b, 0x24d2: 0x000b, 0x24d3: 0x000b, 0x24d4: 0x000b, 0x24d5: 0x000b, 0x24d6: 0x000b, 0x24d7: 0x000b, 0x24d8: 0x000b, 0x24d9: 0x000b, 0x24da: 0x000b, 0x24db: 0x000b, 0x24dc: 0x000b, 0x24dd: 0x000b, 0x24de: 0x000b, 0x24df: 0x000b, 0x24e0: 0x000b, 0x24e1: 0x000b, 0x24e2: 0x000b, 0x24e3: 0x000b, 0x24e4: 0x000b, 0x24e5: 0x000b, 0x24e6: 0x000b, 0x24e7: 0x000b, 0x24e8: 0x000b, 0x24e9: 0x000b, 0x24ea: 0x000b, 0x24eb: 0x000b, 0x24ec: 0x000b, 0x24ed: 0x000b, 0x24ee: 0x000b, 0x24ef: 0x000b, 0x24f0: 0x000d, 0x24f1: 0x000d, 0x24f2: 0x000d, 0x24f3: 0x000d, 0x24f4: 0x000d, 0x24f5: 0x000d, 0x24f6: 0x000d, 0x24f7: 0x000d, 0x24f8: 0x000d, 0x24f9: 0x000d, 0x24fa: 0x000d, 0x24fb: 0x000d, 0x24fc: 0x000d, 0x24fd: 0x000a, 0x24fe: 0x000a, 0x24ff: 0x000a, // Block 0x94, offset 0x2500 0x2500: 0x000c, 0x2501: 0x000c, 0x2502: 0x000c, 0x2503: 0x000c, 0x2504: 0x000c, 0x2505: 0x000c, 0x2506: 0x000c, 0x2507: 0x000c, 0x2508: 0x000c, 0x2509: 0x000c, 0x250a: 0x000c, 0x250b: 0x000c, 0x250c: 0x000c, 0x250d: 0x000c, 0x250e: 0x000c, 0x250f: 0x000c, 0x2510: 0x000a, 0x2511: 0x000a, 0x2512: 0x000a, 0x2513: 0x000a, 0x2514: 0x000a, 0x2515: 0x000a, 0x2516: 0x000a, 0x2517: 0x000a, 0x2518: 0x000a, 0x2519: 0x000a, 0x2520: 0x000c, 0x2521: 0x000c, 0x2522: 0x000c, 0x2523: 0x000c, 0x2524: 0x000c, 0x2525: 0x000c, 0x2526: 0x000c, 0x2527: 0x000c, 0x2528: 0x000c, 0x2529: 0x000c, 0x252a: 0x000c, 0x252b: 0x000c, 0x252c: 0x000c, 0x252d: 0x000c, 0x252e: 0x000c, 0x252f: 0x000c, 0x2530: 0x000a, 0x2531: 0x000a, 0x2532: 0x000a, 0x2533: 0x000a, 0x2534: 0x000a, 0x2535: 0x000a, 0x2536: 0x000a, 0x2537: 0x000a, 0x2538: 0x000a, 0x2539: 0x000a, 0x253a: 0x000a, 0x253b: 0x000a, 0x253c: 0x000a, 0x253d: 0x000a, 0x253e: 0x000a, 0x253f: 0x000a, // Block 0x95, offset 0x2540 0x2540: 0x000a, 0x2541: 0x000a, 0x2542: 0x000a, 0x2543: 0x000a, 0x2544: 0x000a, 0x2545: 0x000a, 0x2546: 0x000a, 0x2547: 0x000a, 0x2548: 0x000a, 0x2549: 0x000a, 0x254a: 0x000a, 0x254b: 0x000a, 0x254c: 0x000a, 0x254d: 0x000a, 0x254e: 0x000a, 0x254f: 0x000a, 0x2550: 0x0006, 0x2551: 0x000a, 0x2552: 0x0006, 0x2554: 0x000a, 0x2555: 0x0006, 0x2556: 0x000a, 0x2557: 0x000a, 0x2558: 0x000a, 0x2559: 0x009a, 0x255a: 0x008a, 0x255b: 0x007a, 0x255c: 0x006a, 0x255d: 0x009a, 0x255e: 0x008a, 0x255f: 0x0004, 0x2560: 0x000a, 0x2561: 0x000a, 0x2562: 0x0003, 0x2563: 0x0003, 0x2564: 0x000a, 0x2565: 0x000a, 0x2566: 0x000a, 0x2568: 0x000a, 0x2569: 0x0004, 0x256a: 0x0004, 0x256b: 0x000a, 0x2570: 0x000d, 0x2571: 0x000d, 0x2572: 0x000d, 0x2573: 0x000d, 0x2574: 0x000d, 0x2575: 0x000d, 0x2576: 0x000d, 0x2577: 0x000d, 0x2578: 0x000d, 0x2579: 0x000d, 0x257a: 0x000d, 0x257b: 0x000d, 0x257c: 0x000d, 0x257d: 0x000d, 0x257e: 0x000d, 0x257f: 0x000d, // Block 0x96, offset 0x2580 0x2580: 0x000d, 0x2581: 0x000d, 0x2582: 0x000d, 0x2583: 0x000d, 0x2584: 0x000d, 0x2585: 0x000d, 0x2586: 0x000d, 0x2587: 0x000d, 0x2588: 0x000d, 0x2589: 0x000d, 0x258a: 0x000d, 0x258b: 0x000d, 0x258c: 0x000d, 0x258d: 0x000d, 0x258e: 0x000d, 0x258f: 0x000d, 0x2590: 0x000d, 0x2591: 0x000d, 0x2592: 0x000d, 0x2593: 0x000d, 0x2594: 0x000d, 0x2595: 0x000d, 0x2596: 0x000d, 0x2597: 0x000d, 0x2598: 0x000d, 0x2599: 0x000d, 0x259a: 0x000d, 0x259b: 0x000d, 0x259c: 0x000d, 0x259d: 0x000d, 0x259e: 0x000d, 0x259f: 0x000d, 0x25a0: 0x000d, 0x25a1: 0x000d, 0x25a2: 0x000d, 0x25a3: 0x000d, 0x25a4: 0x000d, 0x25a5: 0x000d, 0x25a6: 0x000d, 0x25a7: 0x000d, 0x25a8: 0x000d, 0x25a9: 0x000d, 0x25aa: 0x000d, 0x25ab: 0x000d, 0x25ac: 0x000d, 0x25ad: 0x000d, 0x25ae: 0x000d, 0x25af: 0x000d, 0x25b0: 0x000d, 0x25b1: 0x000d, 0x25b2: 0x000d, 0x25b3: 0x000d, 0x25b4: 0x000d, 0x25b5: 0x000d, 0x25b6: 0x000d, 0x25b7: 0x000d, 0x25b8: 0x000d, 0x25b9: 0x000d, 0x25ba: 0x000d, 0x25bb: 0x000d, 0x25bc: 0x000d, 0x25bd: 0x000d, 0x25be: 0x000d, 0x25bf: 0x000b, // Block 0x97, offset 0x25c0 0x25c1: 0x000a, 0x25c2: 0x000a, 0x25c3: 0x0004, 0x25c4: 0x0004, 0x25c5: 0x0004, 0x25c6: 0x000a, 0x25c7: 0x000a, 0x25c8: 0x003a, 0x25c9: 0x002a, 0x25ca: 0x000a, 0x25cb: 0x0003, 0x25cc: 0x0006, 0x25cd: 0x0003, 0x25ce: 0x0006, 0x25cf: 0x0006, 0x25d0: 0x0002, 0x25d1: 0x0002, 0x25d2: 0x0002, 0x25d3: 0x0002, 0x25d4: 0x0002, 0x25d5: 0x0002, 0x25d6: 0x0002, 0x25d7: 0x0002, 0x25d8: 0x0002, 0x25d9: 0x0002, 0x25da: 0x0006, 0x25db: 0x000a, 0x25dc: 0x000a, 0x25dd: 0x000a, 0x25de: 0x000a, 0x25df: 0x000a, 0x25e0: 0x000a, 0x25fb: 0x005a, 0x25fc: 0x000a, 0x25fd: 0x004a, 0x25fe: 0x000a, 0x25ff: 0x000a, // Block 0x98, offset 0x2600 0x2600: 0x000a, 0x261b: 0x005a, 0x261c: 0x000a, 0x261d: 0x004a, 0x261e: 0x000a, 0x261f: 0x00fa, 0x2620: 0x00ea, 0x2621: 0x000a, 0x2622: 0x003a, 0x2623: 0x002a, 0x2624: 0x000a, 0x2625: 0x000a, // Block 0x99, offset 0x2640 0x2660: 0x0004, 0x2661: 0x0004, 0x2662: 0x000a, 0x2663: 0x000a, 0x2664: 0x000a, 0x2665: 0x0004, 0x2666: 0x0004, 0x2668: 0x000a, 0x2669: 0x000a, 0x266a: 0x000a, 0x266b: 0x000a, 0x266c: 0x000a, 0x266d: 0x000a, 0x266e: 0x000a, 0x2670: 0x000b, 0x2671: 0x000b, 0x2672: 0x000b, 0x2673: 0x000b, 0x2674: 0x000b, 0x2675: 0x000b, 0x2676: 0x000b, 0x2677: 0x000b, 0x2678: 0x000b, 0x2679: 0x000a, 0x267a: 0x000a, 0x267b: 0x000a, 0x267c: 0x000a, 0x267d: 0x000a, 0x267e: 0x000b, 0x267f: 0x000b, // Block 0x9a, offset 0x2680 0x2681: 0x000a, // Block 0x9b, offset 0x26c0 0x26c0: 0x000a, 0x26c1: 0x000a, 0x26c2: 0x000a, 0x26c3: 0x000a, 0x26c4: 0x000a, 0x26c5: 0x000a, 0x26c6: 0x000a, 0x26c7: 0x000a, 0x26c8: 0x000a, 0x26c9: 0x000a, 0x26ca: 0x000a, 0x26cb: 0x000a, 0x26cc: 0x000a, 0x26d0: 0x000a, 0x26d1: 0x000a, 0x26d2: 0x000a, 0x26d3: 0x000a, 0x26d4: 0x000a, 0x26d5: 0x000a, 0x26d6: 0x000a, 0x26d7: 0x000a, 0x26d8: 0x000a, 0x26d9: 0x000a, 0x26da: 0x000a, 0x26db: 0x000a, 0x26dc: 0x000a, 0x26e0: 0x000a, // Block 0x9c, offset 0x2700 0x273d: 0x000c, // Block 0x9d, offset 0x2740 0x2760: 0x000c, 0x2761: 0x0002, 0x2762: 0x0002, 0x2763: 0x0002, 0x2764: 0x0002, 0x2765: 0x0002, 0x2766: 0x0002, 0x2767: 0x0002, 0x2768: 0x0002, 0x2769: 0x0002, 0x276a: 0x0002, 0x276b: 0x0002, 0x276c: 0x0002, 0x276d: 0x0002, 0x276e: 0x0002, 0x276f: 0x0002, 0x2770: 0x0002, 0x2771: 0x0002, 0x2772: 0x0002, 0x2773: 0x0002, 0x2774: 0x0002, 0x2775: 0x0002, 0x2776: 0x0002, 0x2777: 0x0002, 0x2778: 0x0002, 0x2779: 0x0002, 0x277a: 0x0002, 0x277b: 0x0002, // Block 0x9e, offset 0x2780 0x27b6: 0x000c, 0x27b7: 0x000c, 0x27b8: 0x000c, 0x27b9: 0x000c, 0x27ba: 0x000c, // Block 0x9f, offset 0x27c0 0x27c0: 0x0001, 0x27c1: 0x0001, 0x27c2: 0x0001, 0x27c3: 0x0001, 0x27c4: 0x0001, 0x27c5: 0x0001, 0x27c6: 0x0001, 0x27c7: 0x0001, 0x27c8: 0x0001, 0x27c9: 0x0001, 0x27ca: 0x0001, 0x27cb: 0x0001, 0x27cc: 0x0001, 0x27cd: 0x0001, 0x27ce: 0x0001, 0x27cf: 0x0001, 0x27d0: 0x0001, 0x27d1: 0x0001, 0x27d2: 0x0001, 0x27d3: 0x0001, 0x27d4: 0x0001, 0x27d5: 0x0001, 0x27d6: 0x0001, 0x27d7: 0x0001, 0x27d8: 0x0001, 0x27d9: 0x0001, 0x27da: 0x0001, 0x27db: 0x0001, 0x27dc: 0x0001, 0x27dd: 0x0001, 0x27de: 0x0001, 0x27df: 0x0001, 0x27e0: 0x0001, 0x27e1: 0x0001, 0x27e2: 0x0001, 0x27e3: 0x0001, 0x27e4: 0x0001, 0x27e5: 0x0001, 0x27e6: 0x0001, 0x27e7: 0x0001, 0x27e8: 0x0001, 0x27e9: 0x0001, 0x27ea: 0x0001, 0x27eb: 0x0001, 0x27ec: 0x0001, 0x27ed: 0x0001, 0x27ee: 0x0001, 0x27ef: 0x0001, 0x27f0: 0x0001, 0x27f1: 0x0001, 0x27f2: 0x0001, 0x27f3: 0x0001, 0x27f4: 0x0001, 0x27f5: 0x0001, 0x27f6: 0x0001, 0x27f7: 0x0001, 0x27f8: 0x0001, 0x27f9: 0x0001, 0x27fa: 0x0001, 0x27fb: 0x0001, 0x27fc: 0x0001, 0x27fd: 0x0001, 0x27fe: 0x0001, 0x27ff: 0x0001, // Block 0xa0, offset 0x2800 0x2800: 0x0001, 0x2801: 0x0001, 0x2802: 0x0001, 0x2803: 0x0001, 0x2804: 0x0001, 0x2805: 0x0001, 0x2806: 0x0001, 0x2807: 0x0001, 0x2808: 0x0001, 0x2809: 0x0001, 0x280a: 0x0001, 0x280b: 0x0001, 0x280c: 0x0001, 0x280d: 0x0001, 0x280e: 0x0001, 0x280f: 0x0001, 0x2810: 0x0001, 0x2811: 0x0001, 0x2812: 0x0001, 0x2813: 0x0001, 0x2814: 0x0001, 0x2815: 0x0001, 0x2816: 0x0001, 0x2817: 0x0001, 0x2818: 0x0001, 0x2819: 0x0001, 0x281a: 0x0001, 0x281b: 0x0001, 0x281c: 0x0001, 0x281d: 0x0001, 0x281e: 0x0001, 0x281f: 0x000a, 0x2820: 0x0001, 0x2821: 0x0001, 0x2822: 0x0001, 0x2823: 0x0001, 0x2824: 0x0001, 0x2825: 0x0001, 0x2826: 0x0001, 0x2827: 0x0001, 0x2828: 0x0001, 0x2829: 0x0001, 0x282a: 0x0001, 0x282b: 0x0001, 0x282c: 0x0001, 0x282d: 0x0001, 0x282e: 0x0001, 0x282f: 0x0001, 0x2830: 0x0001, 0x2831: 0x0001, 0x2832: 0x0001, 0x2833: 0x0001, 0x2834: 0x0001, 0x2835: 0x0001, 0x2836: 0x0001, 0x2837: 0x0001, 0x2838: 0x0001, 0x2839: 0x0001, 0x283a: 0x0001, 0x283b: 0x0001, 0x283c: 0x0001, 0x283d: 0x0001, 0x283e: 0x0001, 0x283f: 0x0001, // Block 0xa1, offset 0x2840 0x2840: 0x0001, 0x2841: 0x000c, 0x2842: 0x000c, 0x2843: 0x000c, 0x2844: 0x0001, 0x2845: 0x000c, 0x2846: 0x000c, 0x2847: 0x0001, 0x2848: 0x0001, 0x2849: 0x0001, 0x284a: 0x0001, 0x284b: 0x0001, 0x284c: 0x000c, 0x284d: 0x000c, 0x284e: 0x000c, 0x284f: 0x000c, 0x2850: 0x0001, 0x2851: 0x0001, 0x2852: 0x0001, 0x2853: 0x0001, 0x2854: 0x0001, 0x2855: 0x0001, 0x2856: 0x0001, 0x2857: 0x0001, 0x2858: 0x0001, 0x2859: 0x0001, 0x285a: 0x0001, 0x285b: 0x0001, 0x285c: 0x0001, 0x285d: 0x0001, 0x285e: 0x0001, 0x285f: 0x0001, 0x2860: 0x0001, 0x2861: 0x0001, 0x2862: 0x0001, 0x2863: 0x0001, 0x2864: 0x0001, 0x2865: 0x0001, 0x2866: 0x0001, 0x2867: 0x0001, 0x2868: 0x0001, 0x2869: 0x0001, 0x286a: 0x0001, 0x286b: 0x0001, 0x286c: 0x0001, 0x286d: 0x0001, 0x286e: 0x0001, 0x286f: 0x0001, 0x2870: 0x0001, 0x2871: 0x0001, 0x2872: 0x0001, 0x2873: 0x0001, 0x2874: 0x0001, 0x2875: 0x0001, 0x2876: 0x0001, 0x2877: 0x0001, 0x2878: 0x000c, 0x2879: 0x000c, 0x287a: 0x000c, 0x287b: 0x0001, 0x287c: 0x0001, 0x287d: 0x0001, 0x287e: 0x0001, 0x287f: 0x000c, // Block 0xa2, offset 0x2880 0x2880: 0x0001, 0x2881: 0x0001, 0x2882: 0x0001, 0x2883: 0x0001, 0x2884: 0x0001, 0x2885: 0x0001, 0x2886: 0x0001, 0x2887: 0x0001, 0x2888: 0x0001, 0x2889: 0x0001, 0x288a: 0x0001, 0x288b: 0x0001, 0x288c: 0x0001, 0x288d: 0x0001, 0x288e: 0x0001, 0x288f: 0x0001, 0x2890: 0x0001, 0x2891: 0x0001, 0x2892: 0x0001, 0x2893: 0x0001, 0x2894: 0x0001, 0x2895: 0x0001, 0x2896: 0x0001, 0x2897: 0x0001, 0x2898: 0x0001, 0x2899: 0x0001, 0x289a: 0x0001, 0x289b: 0x0001, 0x289c: 0x0001, 0x289d: 0x0001, 0x289e: 0x0001, 0x289f: 0x0001, 0x28a0: 0x0001, 0x28a1: 0x0001, 0x28a2: 0x0001, 0x28a3: 0x0001, 0x28a4: 0x0001, 0x28a5: 0x000c, 0x28a6: 0x000c, 0x28a7: 0x0001, 0x28a8: 0x0001, 0x28a9: 0x0001, 0x28aa: 0x0001, 0x28ab: 0x0001, 0x28ac: 0x0001, 0x28ad: 0x0001, 0x28ae: 0x0001, 0x28af: 0x0001, 0x28b0: 0x0001, 0x28b1: 0x0001, 0x28b2: 0x0001, 0x28b3: 0x0001, 0x28b4: 0x0001, 0x28b5: 0x0001, 0x28b6: 0x0001, 0x28b7: 0x0001, 0x28b8: 0x0001, 0x28b9: 0x0001, 0x28ba: 0x0001, 0x28bb: 0x0001, 0x28bc: 0x0001, 0x28bd: 0x0001, 0x28be: 0x0001, 0x28bf: 0x0001, // Block 0xa3, offset 0x28c0 0x28c0: 0x0001, 0x28c1: 0x0001, 0x28c2: 0x0001, 0x28c3: 0x0001, 0x28c4: 0x0001, 0x28c5: 0x0001, 0x28c6: 0x0001, 0x28c7: 0x0001, 0x28c8: 0x0001, 0x28c9: 0x0001, 0x28ca: 0x0001, 0x28cb: 0x0001, 0x28cc: 0x0001, 0x28cd: 0x0001, 0x28ce: 0x0001, 0x28cf: 0x0001, 0x28d0: 0x0001, 0x28d1: 0x0001, 0x28d2: 0x0001, 0x28d3: 0x0001, 0x28d4: 0x0001, 0x28d5: 0x0001, 0x28d6: 0x0001, 0x28d7: 0x0001, 0x28d8: 0x0001, 0x28d9: 0x0001, 0x28da: 0x0001, 0x28db: 0x0001, 0x28dc: 0x0001, 0x28dd: 0x0001, 0x28de: 0x0001, 0x28df: 0x0001, 0x28e0: 0x0001, 0x28e1: 0x0001, 0x28e2: 0x0001, 0x28e3: 0x0001, 0x28e4: 0x0001, 0x28e5: 0x0001, 0x28e6: 0x0001, 0x28e7: 0x0001, 0x28e8: 0x0001, 0x28e9: 0x0001, 0x28ea: 0x0001, 0x28eb: 0x0001, 0x28ec: 0x0001, 0x28ed: 0x0001, 0x28ee: 0x0001, 0x28ef: 0x0001, 0x28f0: 0x0001, 0x28f1: 0x0001, 0x28f2: 0x0001, 0x28f3: 0x0001, 0x28f4: 0x0001, 0x28f5: 0x0001, 0x28f6: 0x0001, 0x28f7: 0x0001, 0x28f8: 0x0001, 0x28f9: 0x000a, 0x28fa: 0x000a, 0x28fb: 0x000a, 0x28fc: 0x000a, 0x28fd: 0x000a, 0x28fe: 0x000a, 0x28ff: 0x000a, // Block 0xa4, offset 0x2900 0x2900: 0x000d, 0x2901: 0x000d, 0x2902: 0x000d, 0x2903: 0x000d, 0x2904: 0x000d, 0x2905: 0x000d, 0x2906: 0x000d, 0x2907: 0x000d, 0x2908: 0x000d, 0x2909: 0x000d, 0x290a: 0x000d, 0x290b: 0x000d, 0x290c: 0x000d, 0x290d: 0x000d, 0x290e: 0x000d, 0x290f: 0x000d, 0x2910: 0x000d, 0x2911: 0x000d, 0x2912: 0x000d, 0x2913: 0x000d, 0x2914: 0x000d, 0x2915: 0x000d, 0x2916: 0x000d, 0x2917: 0x000d, 0x2918: 0x000d, 0x2919: 0x000d, 0x291a: 0x000d, 0x291b: 0x000d, 0x291c: 0x000d, 0x291d: 0x000d, 0x291e: 0x000d, 0x291f: 0x000d, 0x2920: 0x000d, 0x2921: 0x000d, 0x2922: 0x000d, 0x2923: 0x000d, 0x2924: 0x000c, 0x2925: 0x000c, 0x2926: 0x000c, 0x2927: 0x000c, 0x2928: 0x0001, 0x2929: 0x0001, 0x292a: 0x0001, 0x292b: 0x0001, 0x292c: 0x0001, 0x292d: 0x0001, 0x292e: 0x0001, 0x292f: 0x0001, 0x2930: 0x0005, 0x2931: 0x0005, 0x2932: 0x0005, 0x2933: 0x0005, 0x2934: 0x0005, 0x2935: 0x0005, 0x2936: 0x0005, 0x2937: 0x0005, 0x2938: 0x0005, 0x2939: 0x0005, 0x293a: 0x0001, 0x293b: 0x0001, 0x293c: 0x0001, 0x293d: 0x0001, 0x293e: 0x0001, 0x293f: 0x0001, // Block 0xa5, offset 0x2940 0x2940: 0x0005, 0x2941: 0x0005, 0x2942: 0x0005, 0x2943: 0x0005, 0x2944: 0x0005, 0x2945: 0x0005, 0x2946: 0x0005, 0x2947: 0x0005, 0x2948: 0x0005, 0x2949: 0x0005, 0x294a: 0x0001, 0x294b: 0x0001, 0x294c: 0x0001, 0x294d: 0x0001, 0x294e: 0x0001, 0x294f: 0x0001, 0x2950: 0x0001, 0x2951: 0x0001, 0x2952: 0x0001, 0x2953: 0x0001, 0x2954: 0x0001, 0x2955: 0x0001, 0x2956: 0x0001, 0x2957: 0x0001, 0x2958: 0x0001, 0x2959: 0x0001, 0x295a: 0x0001, 0x295b: 0x0001, 0x295c: 0x0001, 0x295d: 0x0001, 0x295e: 0x0001, 0x295f: 0x0001, 0x2960: 0x0001, 0x2961: 0x0001, 0x2962: 0x0001, 0x2963: 0x0001, 0x2964: 0x0001, 0x2965: 0x0001, 0x2966: 0x0001, 0x2967: 0x0001, 0x2968: 0x0001, 0x2969: 0x000c, 0x296a: 0x000c, 0x296b: 0x000c, 0x296c: 0x000c, 0x296d: 0x000c, 0x296e: 0x000a, 0x296f: 0x0001, 0x2970: 0x0001, 0x2971: 0x0001, 0x2972: 0x0001, 0x2973: 0x0001, 0x2974: 0x0001, 0x2975: 0x0001, 0x2976: 0x0001, 0x2977: 0x0001, 0x2978: 0x0001, 0x2979: 0x0001, 0x297a: 0x0001, 0x297b: 0x0001, 0x297c: 0x0001, 0x297d: 0x0001, 0x297e: 0x0001, 0x297f: 0x0001, // Block 0xa6, offset 0x2980 0x2980: 0x0001, 0x2981: 0x0001, 0x2982: 0x0001, 0x2983: 0x0001, 0x2984: 0x0001, 0x2985: 0x0001, 0x2986: 0x0001, 0x2987: 0x0001, 0x2988: 0x0001, 0x2989: 0x0001, 0x298a: 0x0001, 0x298b: 0x0001, 0x298c: 0x0001, 0x298d: 0x0001, 0x298e: 0x0001, 0x298f: 0x0001, 0x2990: 0x0001, 0x2991: 0x0001, 0x2992: 0x0001, 0x2993: 0x0001, 0x2994: 0x0001, 0x2995: 0x0001, 0x2996: 0x0001, 0x2997: 0x0001, 0x2998: 0x0001, 0x2999: 0x0001, 0x299a: 0x0001, 0x299b: 0x0001, 0x299c: 0x0001, 0x299d: 0x0001, 0x299e: 0x0001, 0x299f: 0x0001, 0x29a0: 0x0005, 0x29a1: 0x0005, 0x29a2: 0x0005, 0x29a3: 0x0005, 0x29a4: 0x0005, 0x29a5: 0x0005, 0x29a6: 0x0005, 0x29a7: 0x0005, 0x29a8: 0x0005, 0x29a9: 0x0005, 0x29aa: 0x0005, 0x29ab: 0x0005, 0x29ac: 0x0005, 0x29ad: 0x0005, 0x29ae: 0x0005, 0x29af: 0x0005, 0x29b0: 0x0005, 0x29b1: 0x0005, 0x29b2: 0x0005, 0x29b3: 0x0005, 0x29b4: 0x0005, 0x29b5: 0x0005, 0x29b6: 0x0005, 0x29b7: 0x0005, 0x29b8: 0x0005, 0x29b9: 0x0005, 0x29ba: 0x0005, 0x29bb: 0x0005, 0x29bc: 0x0005, 0x29bd: 0x0005, 0x29be: 0x0005, 0x29bf: 0x0001, // Block 0xa7, offset 0x29c0 0x29c0: 0x0001, 0x29c1: 0x0001, 0x29c2: 0x0001, 0x29c3: 0x0001, 0x29c4: 0x0001, 0x29c5: 0x0001, 0x29c6: 0x0001, 0x29c7: 0x0001, 0x29c8: 0x0001, 0x29c9: 0x0001, 0x29ca: 0x0001, 0x29cb: 0x0001, 0x29cc: 0x0001, 0x29cd: 0x0001, 0x29ce: 0x0001, 0x29cf: 0x0001, 0x29d0: 0x0001, 0x29d1: 0x0001, 0x29d2: 0x0001, 0x29d3: 0x0001, 0x29d4: 0x0001, 0x29d5: 0x0001, 0x29d6: 0x0001, 0x29d7: 0x0001, 0x29d8: 0x0001, 0x29d9: 0x0001, 0x29da: 0x0001, 0x29db: 0x0001, 0x29dc: 0x0001, 0x29dd: 0x0001, 0x29de: 0x0001, 0x29df: 0x0001, 0x29e0: 0x0001, 0x29e1: 0x0001, 0x29e2: 0x0001, 0x29e3: 0x0001, 0x29e4: 0x0001, 0x29e5: 0x0001, 0x29e6: 0x0001, 0x29e7: 0x0001, 0x29e8: 0x0001, 0x29e9: 0x0001, 0x29ea: 0x0001, 0x29eb: 0x000c, 0x29ec: 0x000c, 0x29ed: 0x0001, 0x29ee: 0x0001, 0x29ef: 0x0001, 0x29f0: 0x0001, 0x29f1: 0x0001, 0x29f2: 0x0001, 0x29f3: 0x0001, 0x29f4: 0x0001, 0x29f5: 0x0001, 0x29f6: 0x0001, 0x29f7: 0x0001, 0x29f8: 0x0001, 0x29f9: 0x0001, 0x29fa: 0x0001, 0x29fb: 0x0001, 0x29fc: 0x0001, 0x29fd: 0x0001, 0x29fe: 0x0001, 0x29ff: 0x0001, // Block 0xa8, offset 0x2a00 0x2a00: 0x0001, 0x2a01: 0x0001, 0x2a02: 0x000d, 0x2a03: 0x000d, 0x2a04: 0x000d, 0x2a05: 0x000d, 0x2a06: 0x000d, 0x2a07: 0x000d, 0x2a08: 0x0001, 0x2a09: 0x0001, 0x2a0a: 0x0001, 0x2a0b: 0x0001, 0x2a0c: 0x0001, 0x2a0d: 0x0001, 0x2a0e: 0x0001, 0x2a0f: 0x0001, 0x2a10: 0x000a, 0x2a11: 0x000a, 0x2a12: 0x000a, 0x2a13: 0x000a, 0x2a14: 0x000a, 0x2a15: 0x000a, 0x2a16: 0x000a, 0x2a17: 0x000a, 0x2a18: 0x000a, 0x2a19: 0x0001, 0x2a1a: 0x0001, 0x2a1b: 0x0001, 0x2a1c: 0x0001, 0x2a1d: 0x0001, 0x2a1e: 0x0001, 0x2a1f: 0x0001, 0x2a20: 0x0001, 0x2a21: 0x0001, 0x2a22: 0x0001, 0x2a23: 0x0001, 0x2a24: 0x0001, 0x2a25: 0x0001, 0x2a26: 0x0001, 0x2a27: 0x0001, 0x2a28: 0x0001, 0x2a29: 0x0001, 0x2a2a: 0x0001, 0x2a2b: 0x0001, 0x2a2c: 0x0001, 0x2a2d: 0x0001, 0x2a2e: 0x0001, 0x2a2f: 0x0001, 0x2a30: 0x0001, 0x2a31: 0x0001, 0x2a32: 0x0001, 0x2a33: 0x0001, 0x2a34: 0x0001, 0x2a35: 0x0001, 0x2a36: 0x0001, 0x2a37: 0x0001, 0x2a38: 0x0001, 0x2a39: 0x0001, 0x2a3a: 0x000c, 0x2a3b: 0x000c, 0x2a3c: 0x000c, 0x2a3d: 0x000c, 0x2a3e: 0x000c, 0x2a3f: 0x000c, // Block 0xa9, offset 0x2a40 0x2a40: 0x0001, 0x2a41: 0x0001, 0x2a42: 0x0001, 0x2a43: 0x0001, 0x2a44: 0x0001, 0x2a45: 0x0001, 0x2a46: 0x0001, 0x2a47: 0x0001, 0x2a48: 0x0001, 0x2a49: 0x0001, 0x2a4a: 0x0001, 0x2a4b: 0x0001, 0x2a4c: 0x0001, 0x2a4d: 0x0001, 0x2a4e: 0x0001, 0x2a4f: 0x0001, 0x2a50: 0x0001, 0x2a51: 0x0001, 0x2a52: 0x0001, 0x2a53: 0x0001, 0x2a54: 0x0001, 0x2a55: 0x0001, 0x2a56: 0x0001, 0x2a57: 0x0001, 0x2a58: 0x0001, 0x2a59: 0x0001, 0x2a5a: 0x0001, 0x2a5b: 0x0001, 0x2a5c: 0x0001, 0x2a5d: 0x0001, 0x2a5e: 0x0001, 0x2a5f: 0x0001, 0x2a60: 0x0001, 0x2a61: 0x0001, 0x2a62: 0x0001, 0x2a63: 0x0001, 0x2a64: 0x0001, 0x2a65: 0x0001, 0x2a66: 0x0001, 0x2a67: 0x0001, 0x2a68: 0x0001, 0x2a69: 0x0001, 0x2a6a: 0x0001, 0x2a6b: 0x0001, 0x2a6c: 0x0001, 0x2a6d: 0x0001, 0x2a6e: 0x0001, 0x2a6f: 0x0001, 0x2a70: 0x000d, 0x2a71: 0x000d, 0x2a72: 0x000d, 0x2a73: 0x000d, 0x2a74: 0x000d, 0x2a75: 0x000d, 0x2a76: 0x000d, 0x2a77: 0x000d, 0x2a78: 0x000d, 0x2a79: 0x000d, 0x2a7a: 0x000d, 0x2a7b: 0x000d, 0x2a7c: 0x000d, 0x2a7d: 0x000d, 0x2a7e: 0x000d, 0x2a7f: 0x000d, // Block 0xaa, offset 0x2a80 0x2a80: 0x000d, 0x2a81: 0x000d, 0x2a82: 0x000d, 0x2a83: 0x000d, 0x2a84: 0x000d, 0x2a85: 0x000d, 0x2a86: 0x000c, 0x2a87: 0x000c, 0x2a88: 0x000c, 0x2a89: 0x000c, 0x2a8a: 0x000c, 0x2a8b: 0x000c, 0x2a8c: 0x000c, 0x2a8d: 0x000c, 0x2a8e: 0x000c, 0x2a8f: 0x000c, 0x2a90: 0x000c, 0x2a91: 0x000d, 0x2a92: 0x000d, 0x2a93: 0x000d, 0x2a94: 0x000d, 0x2a95: 0x000d, 0x2a96: 0x000d, 0x2a97: 0x000d, 0x2a98: 0x000d, 0x2a99: 0x000d, 0x2a9a: 0x0001, 0x2a9b: 0x0001, 0x2a9c: 0x0001, 0x2a9d: 0x0001, 0x2a9e: 0x0001, 0x2a9f: 0x0001, 0x2aa0: 0x0001, 0x2aa1: 0x0001, 0x2aa2: 0x0001, 0x2aa3: 0x0001, 0x2aa4: 0x0001, 0x2aa5: 0x0001, 0x2aa6: 0x0001, 0x2aa7: 0x0001, 0x2aa8: 0x0001, 0x2aa9: 0x0001, 0x2aaa: 0x0001, 0x2aab: 0x0001, 0x2aac: 0x0001, 0x2aad: 0x0001, 0x2aae: 0x0001, 0x2aaf: 0x0001, 0x2ab0: 0x0001, 0x2ab1: 0x0001, 0x2ab2: 0x0001, 0x2ab3: 0x0001, 0x2ab4: 0x0001, 0x2ab5: 0x0001, 0x2ab6: 0x0001, 0x2ab7: 0x0001, 0x2ab8: 0x0001, 0x2ab9: 0x0001, 0x2aba: 0x0001, 0x2abb: 0x0001, 0x2abc: 0x0001, 0x2abd: 0x0001, 0x2abe: 0x0001, 0x2abf: 0x0001, // Block 0xab, offset 0x2ac0 0x2ac0: 0x0001, 0x2ac1: 0x0001, 0x2ac2: 0x000c, 0x2ac3: 0x000c, 0x2ac4: 0x000c, 0x2ac5: 0x000c, 0x2ac6: 0x0001, 0x2ac7: 0x0001, 0x2ac8: 0x0001, 0x2ac9: 0x0001, 0x2aca: 0x0001, 0x2acb: 0x0001, 0x2acc: 0x0001, 0x2acd: 0x0001, 0x2ace: 0x0001, 0x2acf: 0x0001, 0x2ad0: 0x0001, 0x2ad1: 0x0001, 0x2ad2: 0x0001, 0x2ad3: 0x0001, 0x2ad4: 0x0001, 0x2ad5: 0x0001, 0x2ad6: 0x0001, 0x2ad7: 0x0001, 0x2ad8: 0x0001, 0x2ad9: 0x0001, 0x2ada: 0x0001, 0x2adb: 0x0001, 0x2adc: 0x0001, 0x2add: 0x0001, 0x2ade: 0x0001, 0x2adf: 0x0001, 0x2ae0: 0x0001, 0x2ae1: 0x0001, 0x2ae2: 0x0001, 0x2ae3: 0x0001, 0x2ae4: 0x0001, 0x2ae5: 0x0001, 0x2ae6: 0x0001, 0x2ae7: 0x0001, 0x2ae8: 0x0001, 0x2ae9: 0x0001, 0x2aea: 0x0001, 0x2aeb: 0x0001, 0x2aec: 0x0001, 0x2aed: 0x0001, 0x2aee: 0x0001, 0x2aef: 0x0001, 0x2af0: 0x0001, 0x2af1: 0x0001, 0x2af2: 0x0001, 0x2af3: 0x0001, 0x2af4: 0x0001, 0x2af5: 0x0001, 0x2af6: 0x0001, 0x2af7: 0x0001, 0x2af8: 0x0001, 0x2af9: 0x0001, 0x2afa: 0x0001, 0x2afb: 0x0001, 0x2afc: 0x0001, 0x2afd: 0x0001, 0x2afe: 0x0001, 0x2aff: 0x0001, // Block 0xac, offset 0x2b00 0x2b01: 0x000c, 0x2b38: 0x000c, 0x2b39: 0x000c, 0x2b3a: 0x000c, 0x2b3b: 0x000c, 0x2b3c: 0x000c, 0x2b3d: 0x000c, 0x2b3e: 0x000c, 0x2b3f: 0x000c, // Block 0xad, offset 0x2b40 0x2b40: 0x000c, 0x2b41: 0x000c, 0x2b42: 0x000c, 0x2b43: 0x000c, 0x2b44: 0x000c, 0x2b45: 0x000c, 0x2b46: 0x000c, 0x2b52: 0x000a, 0x2b53: 0x000a, 0x2b54: 0x000a, 0x2b55: 0x000a, 0x2b56: 0x000a, 0x2b57: 0x000a, 0x2b58: 0x000a, 0x2b59: 0x000a, 0x2b5a: 0x000a, 0x2b5b: 0x000a, 0x2b5c: 0x000a, 0x2b5d: 0x000a, 0x2b5e: 0x000a, 0x2b5f: 0x000a, 0x2b60: 0x000a, 0x2b61: 0x000a, 0x2b62: 0x000a, 0x2b63: 0x000a, 0x2b64: 0x000a, 0x2b65: 0x000a, 0x2b70: 0x000c, 0x2b73: 0x000c, 0x2b74: 0x000c, 0x2b7f: 0x000c, // Block 0xae, offset 0x2b80 0x2b80: 0x000c, 0x2b81: 0x000c, 0x2bb3: 0x000c, 0x2bb4: 0x000c, 0x2bb5: 0x000c, 0x2bb6: 0x000c, 0x2bb9: 0x000c, 0x2bba: 0x000c, // Block 0xaf, offset 0x2bc0 0x2bc0: 0x000c, 0x2bc1: 0x000c, 0x2bc2: 0x000c, 0x2be7: 0x000c, 0x2be8: 0x000c, 0x2be9: 0x000c, 0x2bea: 0x000c, 0x2beb: 0x000c, 0x2bed: 0x000c, 0x2bee: 0x000c, 0x2bef: 0x000c, 0x2bf0: 0x000c, 0x2bf1: 0x000c, 0x2bf2: 0x000c, 0x2bf3: 0x000c, 0x2bf4: 0x000c, // Block 0xb0, offset 0x2c00 0x2c33: 0x000c, // Block 0xb1, offset 0x2c40 0x2c40: 0x000c, 0x2c41: 0x000c, 0x2c76: 0x000c, 0x2c77: 0x000c, 0x2c78: 0x000c, 0x2c79: 0x000c, 0x2c7a: 0x000c, 0x2c7b: 0x000c, 0x2c7c: 0x000c, 0x2c7d: 0x000c, 0x2c7e: 0x000c, // Block 0xb2, offset 0x2c80 0x2c89: 0x000c, 0x2c8a: 0x000c, 0x2c8b: 0x000c, 0x2c8c: 0x000c, 0x2c8f: 0x000c, // Block 0xb3, offset 0x2cc0 0x2cef: 0x000c, 0x2cf0: 0x000c, 0x2cf1: 0x000c, 0x2cf4: 0x000c, 0x2cf6: 0x000c, 0x2cf7: 0x000c, 0x2cfe: 0x000c, // Block 0xb4, offset 0x2d00 0x2d1f: 0x000c, 0x2d23: 0x000c, 0x2d24: 0x000c, 0x2d25: 0x000c, 0x2d26: 0x000c, 0x2d27: 0x000c, 0x2d28: 0x000c, 0x2d29: 0x000c, 0x2d2a: 0x000c, // Block 0xb5, offset 0x2d40 0x2d40: 0x000c, 0x2d66: 0x000c, 0x2d67: 0x000c, 0x2d68: 0x000c, 0x2d69: 0x000c, 0x2d6a: 0x000c, 0x2d6b: 0x000c, 0x2d6c: 0x000c, 0x2d70: 0x000c, 0x2d71: 0x000c, 0x2d72: 0x000c, 0x2d73: 0x000c, 0x2d74: 0x000c, // Block 0xb6, offset 0x2d80 0x2dbb: 0x000c, 0x2dbc: 0x000c, 0x2dbd: 0x000c, 0x2dbe: 0x000c, 0x2dbf: 0x000c, // Block 0xb7, offset 0x2dc0 0x2dc0: 0x000c, 0x2dce: 0x000c, 0x2dd0: 0x000c, 0x2dd2: 0x000c, 0x2de1: 0x000c, 0x2de2: 0x000c, // Block 0xb8, offset 0x2e00 0x2e38: 0x000c, 0x2e39: 0x000c, 0x2e3a: 0x000c, 0x2e3b: 0x000c, 0x2e3c: 0x000c, 0x2e3d: 0x000c, 0x2e3e: 0x000c, 0x2e3f: 0x000c, // Block 0xb9, offset 0x2e40 0x2e42: 0x000c, 0x2e43: 0x000c, 0x2e44: 0x000c, 0x2e46: 0x000c, 0x2e5e: 0x000c, // Block 0xba, offset 0x2e80 0x2eb3: 0x000c, 0x2eb4: 0x000c, 0x2eb5: 0x000c, 0x2eb6: 0x000c, 0x2eb7: 0x000c, 0x2eb8: 0x000c, 0x2eba: 0x000c, 0x2ebf: 0x000c, // Block 0xbb, offset 0x2ec0 0x2ec0: 0x000c, 0x2ec2: 0x000c, 0x2ec3: 0x000c, // Block 0xbc, offset 0x2f00 0x2f32: 0x000c, 0x2f33: 0x000c, 0x2f34: 0x000c, 0x2f35: 0x000c, 0x2f3c: 0x000c, 0x2f3d: 0x000c, 0x2f3f: 0x000c, // Block 0xbd, offset 0x2f40 0x2f40: 0x000c, 0x2f5c: 0x000c, 0x2f5d: 0x000c, // Block 0xbe, offset 0x2f80 0x2fb3: 0x000c, 0x2fb4: 0x000c, 0x2fb5: 0x000c, 0x2fb6: 0x000c, 0x2fb7: 0x000c, 0x2fb8: 0x000c, 0x2fb9: 0x000c, 0x2fba: 0x000c, 0x2fbd: 0x000c, 0x2fbf: 0x000c, // Block 0xbf, offset 0x2fc0 0x2fc0: 0x000c, 0x2fe0: 0x000a, 0x2fe1: 0x000a, 0x2fe2: 0x000a, 0x2fe3: 0x000a, 0x2fe4: 0x000a, 0x2fe5: 0x000a, 0x2fe6: 0x000a, 0x2fe7: 0x000a, 0x2fe8: 0x000a, 0x2fe9: 0x000a, 0x2fea: 0x000a, 0x2feb: 0x000a, 0x2fec: 0x000a, // Block 0xc0, offset 0x3000 0x302b: 0x000c, 0x302d: 0x000c, 0x3030: 0x000c, 0x3031: 0x000c, 0x3032: 0x000c, 0x3033: 0x000c, 0x3034: 0x000c, 0x3035: 0x000c, 0x3037: 0x000c, // Block 0xc1, offset 0x3040 0x305d: 0x000c, 0x305f: 0x000c, 0x3062: 0x000c, 0x3063: 0x000c, 0x3064: 0x000c, 0x3065: 0x000c, 0x3067: 0x000c, 0x3068: 0x000c, 0x3069: 0x000c, 0x306a: 0x000c, 0x306b: 0x000c, // Block 0xc2, offset 0x3080 0x30af: 0x000c, 0x30b0: 0x000c, 0x30b1: 0x000c, 0x30b2: 0x000c, 0x30b3: 0x000c, 0x30b4: 0x000c, 0x30b5: 0x000c, 0x30b6: 0x000c, 0x30b7: 0x000c, 0x30b9: 0x000c, 0x30ba: 0x000c, // Block 0xc3, offset 0x30c0 0x30fb: 0x000c, 0x30fc: 0x000c, 0x30fe: 0x000c, // Block 0xc4, offset 0x3100 0x3103: 0x000c, // Block 0xc5, offset 0x3140 0x3154: 0x000c, 0x3155: 0x000c, 0x3156: 0x000c, 0x3157: 0x000c, 0x315a: 0x000c, 0x315b: 0x000c, 0x3160: 0x000c, // Block 0xc6, offset 0x3180 0x3181: 0x000c, 0x3182: 0x000c, 0x3183: 0x000c, 0x3184: 0x000c, 0x3185: 0x000c, 0x3186: 0x000c, 0x3189: 0x000c, 0x318a: 0x000c, 0x31b3: 0x000c, 0x31b4: 0x000c, 0x31b5: 0x000c, 0x31b6: 0x000c, 0x31b7: 0x000c, 0x31b8: 0x000c, 0x31bb: 0x000c, 0x31bc: 0x000c, 0x31bd: 0x000c, 0x31be: 0x000c, // Block 0xc7, offset 0x31c0 0x31c7: 0x000c, 0x31d1: 0x000c, 0x31d2: 0x000c, 0x31d3: 0x000c, 0x31d4: 0x000c, 0x31d5: 0x000c, 0x31d6: 0x000c, 0x31d9: 0x000c, 0x31da: 0x000c, 0x31db: 0x000c, // Block 0xc8, offset 0x3200 0x320a: 0x000c, 0x320b: 0x000c, 0x320c: 0x000c, 0x320d: 0x000c, 0x320e: 0x000c, 0x320f: 0x000c, 0x3210: 0x000c, 0x3211: 0x000c, 0x3212: 0x000c, 0x3213: 0x000c, 0x3214: 0x000c, 0x3215: 0x000c, 0x3216: 0x000c, 0x3218: 0x000c, 0x3219: 0x000c, // Block 0xc9, offset 0x3240 0x3260: 0x000c, 0x3262: 0x000c, 0x3263: 0x000c, 0x3264: 0x000c, 0x3266: 0x000c, // Block 0xca, offset 0x3280 0x32b0: 0x000c, 0x32b1: 0x000c, 0x32b2: 0x000c, 0x32b3: 0x000c, 0x32b4: 0x000c, 0x32b5: 0x000c, 0x32b6: 0x000c, 0x32b8: 0x000c, 0x32b9: 0x000c, 0x32ba: 0x000c, 0x32bb: 0x000c, 0x32bc: 0x000c, 0x32bd: 0x000c, // Block 0xcb, offset 0x32c0 0x32d2: 0x000c, 0x32d3: 0x000c, 0x32d4: 0x000c, 0x32d5: 0x000c, 0x32d6: 0x000c, 0x32d7: 0x000c, 0x32d8: 0x000c, 0x32d9: 0x000c, 0x32da: 0x000c, 0x32db: 0x000c, 0x32dc: 0x000c, 0x32dd: 0x000c, 0x32de: 0x000c, 0x32df: 0x000c, 0x32e0: 0x000c, 0x32e1: 0x000c, 0x32e2: 0x000c, 0x32e3: 0x000c, 0x32e4: 0x000c, 0x32e5: 0x000c, 0x32e6: 0x000c, 0x32e7: 0x000c, 0x32ea: 0x000c, 0x32eb: 0x000c, 0x32ec: 0x000c, 0x32ed: 0x000c, 0x32ee: 0x000c, 0x32ef: 0x000c, 0x32f0: 0x000c, 0x32f2: 0x000c, 0x32f3: 0x000c, 0x32f5: 0x000c, 0x32f6: 0x000c, // Block 0xcc, offset 0x3300 0x3331: 0x000c, 0x3332: 0x000c, 0x3333: 0x000c, 0x3334: 0x000c, 0x3335: 0x000c, 0x3336: 0x000c, 0x333a: 0x000c, 0x333c: 0x000c, 0x333d: 0x000c, 0x333f: 0x000c, // Block 0xcd, offset 0x3340 0x3340: 0x000c, 0x3341: 0x000c, 0x3342: 0x000c, 0x3343: 0x000c, 0x3344: 0x000c, 0x3345: 0x000c, 0x3347: 0x000c, // Block 0xce, offset 0x3380 0x3390: 0x000c, 0x3391: 0x000c, 0x3395: 0x000c, 0x3397: 0x000c, // Block 0xcf, offset 0x33c0 0x33f3: 0x000c, 0x33f4: 0x000c, // Block 0xd0, offset 0x3400 0x3400: 0x000c, 0x3401: 0x000c, 0x3436: 0x000c, 0x3437: 0x000c, 0x3438: 0x000c, 0x3439: 0x000c, 0x343a: 0x000c, // Block 0xd1, offset 0x3440 0x3440: 0x000c, 0x3442: 0x000c, 0x345a: 0x000c, // Block 0xd2, offset 0x3480 0x3495: 0x000a, 0x3496: 0x000a, 0x3497: 0x000a, 0x3498: 0x000a, 0x3499: 0x000a, 0x349a: 0x000a, 0x349b: 0x000a, 0x349c: 0x000a, 0x349d: 0x0004, 0x349e: 0x0004, 0x349f: 0x0004, 0x34a0: 0x0004, 0x34a1: 0x000a, 0x34a2: 0x000a, 0x34a3: 0x000a, 0x34a4: 0x000a, 0x34a5: 0x000a, 0x34a6: 0x000a, 0x34a7: 0x000a, 0x34a8: 0x000a, 0x34a9: 0x000a, 0x34aa: 0x000a, 0x34ab: 0x000a, 0x34ac: 0x000a, 0x34ad: 0x000a, 0x34ae: 0x000a, 0x34af: 0x000a, 0x34b0: 0x000a, 0x34b1: 0x000a, // Block 0xd3, offset 0x34c0 0x34c0: 0x000c, 0x34c7: 0x000c, 0x34c8: 0x000c, 0x34c9: 0x000c, 0x34ca: 0x000c, 0x34cb: 0x000c, 0x34cc: 0x000c, 0x34cd: 0x000c, 0x34ce: 0x000c, 0x34cf: 0x000c, 0x34d0: 0x000c, 0x34d1: 0x000c, 0x34d2: 0x000c, 0x34d3: 0x000c, 0x34d4: 0x000c, 0x34d5: 0x000c, // Block 0xd4, offset 0x3500 0x351e: 0x000c, 0x351f: 0x000c, 0x3520: 0x000c, 0x3521: 0x000c, 0x3522: 0x000c, 0x3523: 0x000c, 0x3524: 0x000c, 0x3525: 0x000c, 0x3526: 0x000c, 0x3527: 0x000c, 0x3528: 0x000c, 0x3529: 0x000c, 0x352d: 0x000c, 0x352e: 0x000c, 0x352f: 0x000c, // Block 0xd5, offset 0x3540 0x3570: 0x000c, 0x3571: 0x000c, 0x3572: 0x000c, 0x3573: 0x000c, 0x3574: 0x000c, // Block 0xd6, offset 0x3580 0x35b0: 0x000c, 0x35b1: 0x000c, 0x35b2: 0x000c, 0x35b3: 0x000c, 0x35b4: 0x000c, 0x35b5: 0x000c, 0x35b6: 0x000c, // Block 0xd7, offset 0x35c0 0x35cf: 0x000c, // Block 0xd8, offset 0x3600 0x360f: 0x000c, 0x3610: 0x000c, 0x3611: 0x000c, 0x3612: 0x000c, // Block 0xd9, offset 0x3640 0x3662: 0x000a, 0x3664: 0x000c, // Block 0xda, offset 0x3680 0x369d: 0x000c, 0x369e: 0x000c, 0x36a0: 0x000b, 0x36a1: 0x000b, 0x36a2: 0x000b, 0x36a3: 0x000b, // Block 0xdb, offset 0x36c0 0x36c0: 0x000a, 0x36c1: 0x000a, 0x36c2: 0x000a, 0x36c3: 0x000a, 0x36c4: 0x000a, 0x36c5: 0x000a, 0x36c6: 0x000a, 0x36c7: 0x000a, 0x36c8: 0x000a, 0x36c9: 0x000a, 0x36ca: 0x000a, 0x36cb: 0x000a, 0x36cc: 0x000a, 0x36cd: 0x000a, 0x36ce: 0x000a, 0x36cf: 0x000a, 0x36d0: 0x000a, 0x36d1: 0x000a, 0x36d2: 0x000a, 0x36d3: 0x000a, 0x36d4: 0x000a, 0x36d5: 0x000a, 0x36f0: 0x0002, 0x36f1: 0x0002, 0x36f2: 0x0002, 0x36f3: 0x0002, 0x36f4: 0x0002, 0x36f5: 0x0002, 0x36f6: 0x0002, 0x36f7: 0x0002, 0x36f8: 0x0002, 0x36f9: 0x0002, 0x36fa: 0x000a, 0x36fb: 0x000a, 0x36fc: 0x000a, // Block 0xdc, offset 0x3700 0x3700: 0x000a, 0x3701: 0x000a, 0x3702: 0x000a, 0x3703: 0x000a, 0x3704: 0x000a, 0x3705: 0x000a, 0x3706: 0x000a, 0x3707: 0x000a, 0x3708: 0x000a, 0x3709: 0x000a, 0x370a: 0x000a, 0x370b: 0x000a, 0x370c: 0x000a, 0x370d: 0x000a, 0x370e: 0x000a, 0x370f: 0x000a, 0x3710: 0x000a, 0x3711: 0x000a, 0x3712: 0x000a, 0x3713: 0x000a, 0x3714: 0x000a, 0x3715: 0x000a, 0x3716: 0x000a, 0x3717: 0x000a, 0x3718: 0x000a, 0x3719: 0x000a, 0x371a: 0x000a, 0x371b: 0x000a, 0x371c: 0x000a, 0x371d: 0x000a, 0x371e: 0x000a, 0x371f: 0x000a, 0x3720: 0x000a, 0x3721: 0x000a, 0x3722: 0x000a, 0x3723: 0x000a, 0x3724: 0x000a, 0x3725: 0x000a, 0x3726: 0x000a, 0x3727: 0x000a, 0x3728: 0x000a, 0x3729: 0x000a, 0x372a: 0x000a, 0x372b: 0x000a, 0x372c: 0x000a, 0x372d: 0x000a, 0x372e: 0x000a, 0x372f: 0x000a, 0x3730: 0x000a, 0x3731: 0x000a, 0x3732: 0x000a, 0x3733: 0x000a, 0x373a: 0x000a, 0x373b: 0x000a, 0x373c: 0x000a, 0x373d: 0x000a, 0x373e: 0x000a, 0x373f: 0x000a, // Block 0xdd, offset 0x3740 0x3740: 0x000a, 0x3741: 0x000a, 0x3742: 0x000a, 0x3743: 0x000a, 0x3744: 0x000a, 0x3745: 0x000a, 0x3746: 0x000a, 0x3747: 0x000a, 0x3748: 0x000a, 0x3749: 0x000a, 0x374a: 0x000a, 0x374b: 0x000a, 0x374c: 0x000a, 0x374d: 0x000a, 0x374e: 0x000a, 0x374f: 0x000a, 0x3750: 0x000a, 0x3760: 0x000a, 0x3761: 0x000a, 0x3762: 0x000a, 0x3763: 0x000a, 0x3764: 0x000a, 0x3765: 0x000a, 0x3766: 0x000a, 0x3767: 0x000a, 0x3768: 0x000a, 0x3769: 0x000a, 0x376a: 0x000a, 0x376b: 0x000a, 0x376c: 0x000a, 0x376d: 0x000a, 0x376e: 0x000a, 0x376f: 0x000a, 0x3770: 0x000a, // Block 0xde, offset 0x3780 0x3780: 0x000c, 0x3781: 0x000c, 0x3782: 0x000c, 0x3783: 0x000c, 0x3784: 0x000c, 0x3785: 0x000c, 0x3786: 0x000c, 0x3787: 0x000c, 0x3788: 0x000c, 0x3789: 0x000c, 0x378a: 0x000c, 0x378b: 0x000c, 0x378c: 0x000c, 0x378d: 0x000c, 0x378e: 0x000c, 0x378f: 0x000c, 0x3790: 0x000c, 0x3791: 0x000c, 0x3792: 0x000c, 0x3793: 0x000c, 0x3794: 0x000c, 0x3795: 0x000c, 0x3796: 0x000c, 0x3797: 0x000c, 0x3798: 0x000c, 0x3799: 0x000c, 0x379a: 0x000c, 0x379b: 0x000c, 0x379c: 0x000c, 0x379d: 0x000c, 0x379e: 0x000c, 0x379f: 0x000c, 0x37a0: 0x000c, 0x37a1: 0x000c, 0x37a2: 0x000c, 0x37a3: 0x000c, 0x37a4: 0x000c, 0x37a5: 0x000c, 0x37a6: 0x000c, 0x37a7: 0x000c, 0x37a8: 0x000c, 0x37a9: 0x000c, 0x37aa: 0x000c, 0x37ab: 0x000c, 0x37ac: 0x000c, 0x37ad: 0x000c, 0x37b0: 0x000c, 0x37b1: 0x000c, 0x37b2: 0x000c, 0x37b3: 0x000c, 0x37b4: 0x000c, 0x37b5: 0x000c, 0x37b6: 0x000c, 0x37b7: 0x000c, 0x37b8: 0x000c, 0x37b9: 0x000c, 0x37ba: 0x000c, 0x37bb: 0x000c, 0x37bc: 0x000c, 0x37bd: 0x000c, 0x37be: 0x000c, 0x37bf: 0x000c, // Block 0xdf, offset 0x37c0 0x37c0: 0x000c, 0x37c1: 0x000c, 0x37c2: 0x000c, 0x37c3: 0x000c, 0x37c4: 0x000c, 0x37c5: 0x000c, 0x37c6: 0x000c, // Block 0xe0, offset 0x3800 0x3827: 0x000c, 0x3828: 0x000c, 0x3829: 0x000c, 0x3833: 0x000b, 0x3834: 0x000b, 0x3835: 0x000b, 0x3836: 0x000b, 0x3837: 0x000b, 0x3838: 0x000b, 0x3839: 0x000b, 0x383a: 0x000b, 0x383b: 0x000c, 0x383c: 0x000c, 0x383d: 0x000c, 0x383e: 0x000c, 0x383f: 0x000c, // Block 0xe1, offset 0x3840 0x3840: 0x000c, 0x3841: 0x000c, 0x3842: 0x000c, 0x3845: 0x000c, 0x3846: 0x000c, 0x3847: 0x000c, 0x3848: 0x000c, 0x3849: 0x000c, 0x384a: 0x000c, 0x384b: 0x000c, 0x386a: 0x000c, 0x386b: 0x000c, 0x386c: 0x000c, 0x386d: 0x000c, // Block 0xe2, offset 0x3880 0x38a9: 0x000a, 0x38aa: 0x000a, // Block 0xe3, offset 0x38c0 0x38c0: 0x000a, 0x38c1: 0x000a, 0x38c2: 0x000c, 0x38c3: 0x000c, 0x38c4: 0x000c, 0x38c5: 0x000a, // Block 0xe4, offset 0x3900 0x3900: 0x000a, 0x3901: 0x000a, 0x3902: 0x000a, 0x3903: 0x000a, 0x3904: 0x000a, 0x3905: 0x000a, 0x3906: 0x000a, 0x3907: 0x000a, 0x3908: 0x000a, 0x3909: 0x000a, 0x390a: 0x000a, 0x390b: 0x000a, 0x390c: 0x000a, 0x390d: 0x000a, 0x390e: 0x000a, 0x390f: 0x000a, 0x3910: 0x000a, 0x3911: 0x000a, 0x3912: 0x000a, 0x3913: 0x000a, 0x3914: 0x000a, 0x3915: 0x000a, 0x3916: 0x000a, // Block 0xe5, offset 0x3940 0x3941: 0x000a, 0x395b: 0x000a, 0x397b: 0x000a, // Block 0xe6, offset 0x3980 0x3995: 0x000a, 0x39b5: 0x000a, // Block 0xe7, offset 0x39c0 0x39cf: 0x000a, 0x39ef: 0x000a, // Block 0xe8, offset 0x3a00 0x3a09: 0x000a, 0x3a29: 0x000a, // Block 0xe9, offset 0x3a40 0x3a43: 0x000a, 0x3a4e: 0x0002, 0x3a4f: 0x0002, 0x3a50: 0x0002, 0x3a51: 0x0002, 0x3a52: 0x0002, 0x3a53: 0x0002, 0x3a54: 0x0002, 0x3a55: 0x0002, 0x3a56: 0x0002, 0x3a57: 0x0002, 0x3a58: 0x0002, 0x3a59: 0x0002, 0x3a5a: 0x0002, 0x3a5b: 0x0002, 0x3a5c: 0x0002, 0x3a5d: 0x0002, 0x3a5e: 0x0002, 0x3a5f: 0x0002, 0x3a60: 0x0002, 0x3a61: 0x0002, 0x3a62: 0x0002, 0x3a63: 0x0002, 0x3a64: 0x0002, 0x3a65: 0x0002, 0x3a66: 0x0002, 0x3a67: 0x0002, 0x3a68: 0x0002, 0x3a69: 0x0002, 0x3a6a: 0x0002, 0x3a6b: 0x0002, 0x3a6c: 0x0002, 0x3a6d: 0x0002, 0x3a6e: 0x0002, 0x3a6f: 0x0002, 0x3a70: 0x0002, 0x3a71: 0x0002, 0x3a72: 0x0002, 0x3a73: 0x0002, 0x3a74: 0x0002, 0x3a75: 0x0002, 0x3a76: 0x0002, 0x3a77: 0x0002, 0x3a78: 0x0002, 0x3a79: 0x0002, 0x3a7a: 0x0002, 0x3a7b: 0x0002, 0x3a7c: 0x0002, 0x3a7d: 0x0002, 0x3a7e: 0x0002, 0x3a7f: 0x0002, // Block 0xea, offset 0x3a80 0x3a80: 0x000c, 0x3a81: 0x000c, 0x3a82: 0x000c, 0x3a83: 0x000c, 0x3a84: 0x000c, 0x3a85: 0x000c, 0x3a86: 0x000c, 0x3a87: 0x000c, 0x3a88: 0x000c, 0x3a89: 0x000c, 0x3a8a: 0x000c, 0x3a8b: 0x000c, 0x3a8c: 0x000c, 0x3a8d: 0x000c, 0x3a8e: 0x000c, 0x3a8f: 0x000c, 0x3a90: 0x000c, 0x3a91: 0x000c, 0x3a92: 0x000c, 0x3a93: 0x000c, 0x3a94: 0x000c, 0x3a95: 0x000c, 0x3a96: 0x000c, 0x3a97: 0x000c, 0x3a98: 0x000c, 0x3a99: 0x000c, 0x3a9a: 0x000c, 0x3a9b: 0x000c, 0x3a9c: 0x000c, 0x3a9d: 0x000c, 0x3a9e: 0x000c, 0x3a9f: 0x000c, 0x3aa0: 0x000c, 0x3aa1: 0x000c, 0x3aa2: 0x000c, 0x3aa3: 0x000c, 0x3aa4: 0x000c, 0x3aa5: 0x000c, 0x3aa6: 0x000c, 0x3aa7: 0x000c, 0x3aa8: 0x000c, 0x3aa9: 0x000c, 0x3aaa: 0x000c, 0x3aab: 0x000c, 0x3aac: 0x000c, 0x3aad: 0x000c, 0x3aae: 0x000c, 0x3aaf: 0x000c, 0x3ab0: 0x000c, 0x3ab1: 0x000c, 0x3ab2: 0x000c, 0x3ab3: 0x000c, 0x3ab4: 0x000c, 0x3ab5: 0x000c, 0x3ab6: 0x000c, 0x3abb: 0x000c, 0x3abc: 0x000c, 0x3abd: 0x000c, 0x3abe: 0x000c, 0x3abf: 0x000c, // Block 0xeb, offset 0x3ac0 0x3ac0: 0x000c, 0x3ac1: 0x000c, 0x3ac2: 0x000c, 0x3ac3: 0x000c, 0x3ac4: 0x000c, 0x3ac5: 0x000c, 0x3ac6: 0x000c, 0x3ac7: 0x000c, 0x3ac8: 0x000c, 0x3ac9: 0x000c, 0x3aca: 0x000c, 0x3acb: 0x000c, 0x3acc: 0x000c, 0x3acd: 0x000c, 0x3ace: 0x000c, 0x3acf: 0x000c, 0x3ad0: 0x000c, 0x3ad1: 0x000c, 0x3ad2: 0x000c, 0x3ad3: 0x000c, 0x3ad4: 0x000c, 0x3ad5: 0x000c, 0x3ad6: 0x000c, 0x3ad7: 0x000c, 0x3ad8: 0x000c, 0x3ad9: 0x000c, 0x3ada: 0x000c, 0x3adb: 0x000c, 0x3adc: 0x000c, 0x3add: 0x000c, 0x3ade: 0x000c, 0x3adf: 0x000c, 0x3ae0: 0x000c, 0x3ae1: 0x000c, 0x3ae2: 0x000c, 0x3ae3: 0x000c, 0x3ae4: 0x000c, 0x3ae5: 0x000c, 0x3ae6: 0x000c, 0x3ae7: 0x000c, 0x3ae8: 0x000c, 0x3ae9: 0x000c, 0x3aea: 0x000c, 0x3aeb: 0x000c, 0x3aec: 0x000c, 0x3af5: 0x000c, // Block 0xec, offset 0x3b00 0x3b04: 0x000c, 0x3b1b: 0x000c, 0x3b1c: 0x000c, 0x3b1d: 0x000c, 0x3b1e: 0x000c, 0x3b1f: 0x000c, 0x3b21: 0x000c, 0x3b22: 0x000c, 0x3b23: 0x000c, 0x3b24: 0x000c, 0x3b25: 0x000c, 0x3b26: 0x000c, 0x3b27: 0x000c, 0x3b28: 0x000c, 0x3b29: 0x000c, 0x3b2a: 0x000c, 0x3b2b: 0x000c, 0x3b2c: 0x000c, 0x3b2d: 0x000c, 0x3b2e: 0x000c, 0x3b2f: 0x000c, // Block 0xed, offset 0x3b40 0x3b40: 0x000c, 0x3b41: 0x000c, 0x3b42: 0x000c, 0x3b43: 0x000c, 0x3b44: 0x000c, 0x3b45: 0x000c, 0x3b46: 0x000c, 0x3b48: 0x000c, 0x3b49: 0x000c, 0x3b4a: 0x000c, 0x3b4b: 0x000c, 0x3b4c: 0x000c, 0x3b4d: 0x000c, 0x3b4e: 0x000c, 0x3b4f: 0x000c, 0x3b50: 0x000c, 0x3b51: 0x000c, 0x3b52: 0x000c, 0x3b53: 0x000c, 0x3b54: 0x000c, 0x3b55: 0x000c, 0x3b56: 0x000c, 0x3b57: 0x000c, 0x3b58: 0x000c, 0x3b5b: 0x000c, 0x3b5c: 0x000c, 0x3b5d: 0x000c, 0x3b5e: 0x000c, 0x3b5f: 0x000c, 0x3b60: 0x000c, 0x3b61: 0x000c, 0x3b63: 0x000c, 0x3b64: 0x000c, 0x3b66: 0x000c, 0x3b67: 0x000c, 0x3b68: 0x000c, 0x3b69: 0x000c, 0x3b6a: 0x000c, // Block 0xee, offset 0x3b80 0x3bae: 0x000c, // Block 0xef, offset 0x3bc0 0x3bec: 0x000c, 0x3bed: 0x000c, 0x3bee: 0x000c, 0x3bef: 0x000c, 0x3bff: 0x0004, // Block 0xf0, offset 0x3c00 0x3c2c: 0x000c, 0x3c2d: 0x000c, 0x3c2e: 0x000c, 0x3c2f: 0x000c, // Block 0xf1, offset 0x3c40 0x3c6e: 0x000c, 0x3c6f: 0x000c, // Block 0xf2, offset 0x3c80 0x3ca3: 0x000c, 0x3ca6: 0x000c, 0x3cae: 0x000c, 0x3caf: 0x000c, 0x3cb5: 0x000c, // Block 0xf3, offset 0x3cc0 0x3cc0: 0x0001, 0x3cc1: 0x0001, 0x3cc2: 0x0001, 0x3cc3: 0x0001, 0x3cc4: 0x0001, 0x3cc5: 0x0001, 0x3cc6: 0x0001, 0x3cc7: 0x0001, 0x3cc8: 0x0001, 0x3cc9: 0x0001, 0x3cca: 0x0001, 0x3ccb: 0x0001, 0x3ccc: 0x0001, 0x3ccd: 0x0001, 0x3cce: 0x0001, 0x3ccf: 0x0001, 0x3cd0: 0x000c, 0x3cd1: 0x000c, 0x3cd2: 0x000c, 0x3cd3: 0x000c, 0x3cd4: 0x000c, 0x3cd5: 0x000c, 0x3cd6: 0x000c, 0x3cd7: 0x0001, 0x3cd8: 0x0001, 0x3cd9: 0x0001, 0x3cda: 0x0001, 0x3cdb: 0x0001, 0x3cdc: 0x0001, 0x3cdd: 0x0001, 0x3cde: 0x0001, 0x3cdf: 0x0001, 0x3ce0: 0x0001, 0x3ce1: 0x0001, 0x3ce2: 0x0001, 0x3ce3: 0x0001, 0x3ce4: 0x0001, 0x3ce5: 0x0001, 0x3ce6: 0x0001, 0x3ce7: 0x0001, 0x3ce8: 0x0001, 0x3ce9: 0x0001, 0x3cea: 0x0001, 0x3ceb: 0x0001, 0x3cec: 0x0001, 0x3ced: 0x0001, 0x3cee: 0x0001, 0x3cef: 0x0001, 0x3cf0: 0x0001, 0x3cf1: 0x0001, 0x3cf2: 0x0001, 0x3cf3: 0x0001, 0x3cf4: 0x0001, 0x3cf5: 0x0001, 0x3cf6: 0x0001, 0x3cf7: 0x0001, 0x3cf8: 0x0001, 0x3cf9: 0x0001, 0x3cfa: 0x0001, 0x3cfb: 0x0001, 0x3cfc: 0x0001, 0x3cfd: 0x0001, 0x3cfe: 0x0001, 0x3cff: 0x0001, // Block 0xf4, offset 0x3d00 0x3d00: 0x0001, 0x3d01: 0x0001, 0x3d02: 0x0001, 0x3d03: 0x0001, 0x3d04: 0x000c, 0x3d05: 0x000c, 0x3d06: 0x000c, 0x3d07: 0x000c, 0x3d08: 0x000c, 0x3d09: 0x000c, 0x3d0a: 0x000c, 0x3d0b: 0x0001, 0x3d0c: 0x0001, 0x3d0d: 0x0001, 0x3d0e: 0x0001, 0x3d0f: 0x0001, 0x3d10: 0x0001, 0x3d11: 0x0001, 0x3d12: 0x0001, 0x3d13: 0x0001, 0x3d14: 0x0001, 0x3d15: 0x0001, 0x3d16: 0x0001, 0x3d17: 0x0001, 0x3d18: 0x0001, 0x3d19: 0x0001, 0x3d1a: 0x0001, 0x3d1b: 0x0001, 0x3d1c: 0x0001, 0x3d1d: 0x0001, 0x3d1e: 0x0001, 0x3d1f: 0x0001, 0x3d20: 0x0001, 0x3d21: 0x0001, 0x3d22: 0x0001, 0x3d23: 0x0001, 0x3d24: 0x0001, 0x3d25: 0x0001, 0x3d26: 0x0001, 0x3d27: 0x0001, 0x3d28: 0x0001, 0x3d29: 0x0001, 0x3d2a: 0x0001, 0x3d2b: 0x0001, 0x3d2c: 0x0001, 0x3d2d: 0x0001, 0x3d2e: 0x0001, 0x3d2f: 0x0001, 0x3d30: 0x0001, 0x3d31: 0x0001, 0x3d32: 0x0001, 0x3d33: 0x0001, 0x3d34: 0x0001, 0x3d35: 0x0001, 0x3d36: 0x0001, 0x3d37: 0x0001, 0x3d38: 0x0001, 0x3d39: 0x0001, 0x3d3a: 0x0001, 0x3d3b: 0x0001, 0x3d3c: 0x0001, 0x3d3d: 0x0001, 0x3d3e: 0x0001, 0x3d3f: 0x0001, // Block 0xf5, offset 0x3d40 0x3d40: 0x0001, 0x3d41: 0x0001, 0x3d42: 0x0001, 0x3d43: 0x0001, 0x3d44: 0x0001, 0x3d45: 0x0001, 0x3d46: 0x0001, 0x3d47: 0x0001, 0x3d48: 0x0001, 0x3d49: 0x0001, 0x3d4a: 0x0001, 0x3d4b: 0x0001, 0x3d4c: 0x0001, 0x3d4d: 0x0001, 0x3d4e: 0x0001, 0x3d4f: 0x0001, 0x3d50: 0x0001, 0x3d51: 0x0001, 0x3d52: 0x0001, 0x3d53: 0x0001, 0x3d54: 0x0001, 0x3d55: 0x0001, 0x3d56: 0x0001, 0x3d57: 0x0001, 0x3d58: 0x0001, 0x3d59: 0x0001, 0x3d5a: 0x0001, 0x3d5b: 0x0001, 0x3d5c: 0x0001, 0x3d5d: 0x0001, 0x3d5e: 0x0001, 0x3d5f: 0x0001, 0x3d60: 0x0001, 0x3d61: 0x0001, 0x3d62: 0x0001, 0x3d63: 0x0001, 0x3d64: 0x0001, 0x3d65: 0x0001, 0x3d66: 0x0001, 0x3d67: 0x0001, 0x3d68: 0x0001, 0x3d69: 0x0001, 0x3d6a: 0x0001, 0x3d6b: 0x0001, 0x3d6c: 0x0001, 0x3d6d: 0x0001, 0x3d6e: 0x0001, 0x3d6f: 0x0001, 0x3d70: 0x0001, 0x3d71: 0x000d, 0x3d72: 0x000d, 0x3d73: 0x000d, 0x3d74: 0x000d, 0x3d75: 0x000d, 0x3d76: 0x000d, 0x3d77: 0x000d, 0x3d78: 0x000d, 0x3d79: 0x000d, 0x3d7a: 0x000d, 0x3d7b: 0x000d, 0x3d7c: 0x000d, 0x3d7d: 0x000d, 0x3d7e: 0x000d, 0x3d7f: 0x000d, // Block 0xf6, offset 0x3d80 0x3d80: 0x000d, 0x3d81: 0x000d, 0x3d82: 0x000d, 0x3d83: 0x000d, 0x3d84: 0x000d, 0x3d85: 0x000d, 0x3d86: 0x000d, 0x3d87: 0x000d, 0x3d88: 0x000d, 0x3d89: 0x000d, 0x3d8a: 0x000d, 0x3d8b: 0x000d, 0x3d8c: 0x000d, 0x3d8d: 0x000d, 0x3d8e: 0x000d, 0x3d8f: 0x000d, 0x3d90: 0x000d, 0x3d91: 0x000d, 0x3d92: 0x000d, 0x3d93: 0x000d, 0x3d94: 0x000d, 0x3d95: 0x000d, 0x3d96: 0x000d, 0x3d97: 0x000d, 0x3d98: 0x000d, 0x3d99: 0x000d, 0x3d9a: 0x000d, 0x3d9b: 0x000d, 0x3d9c: 0x000d, 0x3d9d: 0x000d, 0x3d9e: 0x000d, 0x3d9f: 0x000d, 0x3da0: 0x000d, 0x3da1: 0x000d, 0x3da2: 0x000d, 0x3da3: 0x000d, 0x3da4: 0x000d, 0x3da5: 0x000d, 0x3da6: 0x000d, 0x3da7: 0x000d, 0x3da8: 0x000d, 0x3da9: 0x000d, 0x3daa: 0x000d, 0x3dab: 0x000d, 0x3dac: 0x000d, 0x3dad: 0x000d, 0x3dae: 0x000d, 0x3daf: 0x000d, 0x3db0: 0x000d, 0x3db1: 0x000d, 0x3db2: 0x000d, 0x3db3: 0x000d, 0x3db4: 0x000d, 0x3db5: 0x0001, 0x3db6: 0x0001, 0x3db7: 0x0001, 0x3db8: 0x0001, 0x3db9: 0x0001, 0x3dba: 0x0001, 0x3dbb: 0x0001, 0x3dbc: 0x0001, 0x3dbd: 0x0001, 0x3dbe: 0x0001, 0x3dbf: 0x0001, // Block 0xf7, offset 0x3dc0 0x3dc0: 0x0001, 0x3dc1: 0x000d, 0x3dc2: 0x000d, 0x3dc3: 0x000d, 0x3dc4: 0x000d, 0x3dc5: 0x000d, 0x3dc6: 0x000d, 0x3dc7: 0x000d, 0x3dc8: 0x000d, 0x3dc9: 0x000d, 0x3dca: 0x000d, 0x3dcb: 0x000d, 0x3dcc: 0x000d, 0x3dcd: 0x000d, 0x3dce: 0x000d, 0x3dcf: 0x000d, 0x3dd0: 0x000d, 0x3dd1: 0x000d, 0x3dd2: 0x000d, 0x3dd3: 0x000d, 0x3dd4: 0x000d, 0x3dd5: 0x000d, 0x3dd6: 0x000d, 0x3dd7: 0x000d, 0x3dd8: 0x000d, 0x3dd9: 0x000d, 0x3dda: 0x000d, 0x3ddb: 0x000d, 0x3ddc: 0x000d, 0x3ddd: 0x000d, 0x3dde: 0x000d, 0x3ddf: 0x000d, 0x3de0: 0x000d, 0x3de1: 0x000d, 0x3de2: 0x000d, 0x3de3: 0x000d, 0x3de4: 0x000d, 0x3de5: 0x000d, 0x3de6: 0x000d, 0x3de7: 0x000d, 0x3de8: 0x000d, 0x3de9: 0x000d, 0x3dea: 0x000d, 0x3deb: 0x000d, 0x3dec: 0x000d, 0x3ded: 0x000d, 0x3dee: 0x000d, 0x3def: 0x000d, 0x3df0: 0x000d, 0x3df1: 0x000d, 0x3df2: 0x000d, 0x3df3: 0x000d, 0x3df4: 0x000d, 0x3df5: 0x000d, 0x3df6: 0x000d, 0x3df7: 0x000d, 0x3df8: 0x000d, 0x3df9: 0x000d, 0x3dfa: 0x000d, 0x3dfb: 0x000d, 0x3dfc: 0x000d, 0x3dfd: 0x000d, 0x3dfe: 0x0001, 0x3dff: 0x0001, // Block 0xf8, offset 0x3e00 0x3e00: 0x000d, 0x3e01: 0x000d, 0x3e02: 0x000d, 0x3e03: 0x000d, 0x3e04: 0x000d, 0x3e05: 0x000d, 0x3e06: 0x000d, 0x3e07: 0x000d, 0x3e08: 0x000d, 0x3e09: 0x000d, 0x3e0a: 0x000d, 0x3e0b: 0x000d, 0x3e0c: 0x000d, 0x3e0d: 0x000d, 0x3e0e: 0x000d, 0x3e0f: 0x000d, 0x3e10: 0x000d, 0x3e11: 0x000d, 0x3e12: 0x000d, 0x3e13: 0x000d, 0x3e14: 0x000d, 0x3e15: 0x000d, 0x3e16: 0x000d, 0x3e17: 0x000d, 0x3e18: 0x000d, 0x3e19: 0x000d, 0x3e1a: 0x000d, 0x3e1b: 0x000d, 0x3e1c: 0x000d, 0x3e1d: 0x000d, 0x3e1e: 0x000d, 0x3e1f: 0x000d, 0x3e20: 0x000d, 0x3e21: 0x000d, 0x3e22: 0x000d, 0x3e23: 0x000d, 0x3e24: 0x000d, 0x3e25: 0x000d, 0x3e26: 0x000d, 0x3e27: 0x000d, 0x3e28: 0x000d, 0x3e29: 0x000d, 0x3e2a: 0x000d, 0x3e2b: 0x000d, 0x3e2c: 0x000d, 0x3e2d: 0x000d, 0x3e2e: 0x000d, 0x3e2f: 0x000d, 0x3e30: 0x000a, 0x3e31: 0x000a, 0x3e32: 0x000d, 0x3e33: 0x000d, 0x3e34: 0x000d, 0x3e35: 0x000d, 0x3e36: 0x000d, 0x3e37: 0x000d, 0x3e38: 0x000d, 0x3e39: 0x000d, 0x3e3a: 0x000d, 0x3e3b: 0x000d, 0x3e3c: 0x000d, 0x3e3d: 0x000d, 0x3e3e: 0x000d, 0x3e3f: 0x000d, // Block 0xf9, offset 0x3e40 0x3e40: 0x000a, 0x3e41: 0x000a, 0x3e42: 0x000a, 0x3e43: 0x000a, 0x3e44: 0x000a, 0x3e45: 0x000a, 0x3e46: 0x000a, 0x3e47: 0x000a, 0x3e48: 0x000a, 0x3e49: 0x000a, 0x3e4a: 0x000a, 0x3e4b: 0x000a, 0x3e4c: 0x000a, 0x3e4d: 0x000a, 0x3e4e: 0x000a, 0x3e4f: 0x000a, 0x3e50: 0x000a, 0x3e51: 0x000a, 0x3e52: 0x000a, 0x3e53: 0x000a, 0x3e54: 0x000a, 0x3e55: 0x000a, 0x3e56: 0x000a, 0x3e57: 0x000a, 0x3e58: 0x000a, 0x3e59: 0x000a, 0x3e5a: 0x000a, 0x3e5b: 0x000a, 0x3e5c: 0x000a, 0x3e5d: 0x000a, 0x3e5e: 0x000a, 0x3e5f: 0x000a, 0x3e60: 0x000a, 0x3e61: 0x000a, 0x3e62: 0x000a, 0x3e63: 0x000a, 0x3e64: 0x000a, 0x3e65: 0x000a, 0x3e66: 0x000a, 0x3e67: 0x000a, 0x3e68: 0x000a, 0x3e69: 0x000a, 0x3e6a: 0x000a, 0x3e6b: 0x000a, 0x3e70: 0x000a, 0x3e71: 0x000a, 0x3e72: 0x000a, 0x3e73: 0x000a, 0x3e74: 0x000a, 0x3e75: 0x000a, 0x3e76: 0x000a, 0x3e77: 0x000a, 0x3e78: 0x000a, 0x3e79: 0x000a, 0x3e7a: 0x000a, 0x3e7b: 0x000a, 0x3e7c: 0x000a, 0x3e7d: 0x000a, 0x3e7e: 0x000a, 0x3e7f: 0x000a, // Block 0xfa, offset 0x3e80 0x3e80: 0x000a, 0x3e81: 0x000a, 0x3e82: 0x000a, 0x3e83: 0x000a, 0x3e84: 0x000a, 0x3e85: 0x000a, 0x3e86: 0x000a, 0x3e87: 0x000a, 0x3e88: 0x000a, 0x3e89: 0x000a, 0x3e8a: 0x000a, 0x3e8b: 0x000a, 0x3e8c: 0x000a, 0x3e8d: 0x000a, 0x3e8e: 0x000a, 0x3e8f: 0x000a, 0x3e90: 0x000a, 0x3e91: 0x000a, 0x3e92: 0x000a, 0x3e93: 0x000a, 0x3ea0: 0x000a, 0x3ea1: 0x000a, 0x3ea2: 0x000a, 0x3ea3: 0x000a, 0x3ea4: 0x000a, 0x3ea5: 0x000a, 0x3ea6: 0x000a, 0x3ea7: 0x000a, 0x3ea8: 0x000a, 0x3ea9: 0x000a, 0x3eaa: 0x000a, 0x3eab: 0x000a, 0x3eac: 0x000a, 0x3ead: 0x000a, 0x3eae: 0x000a, 0x3eb1: 0x000a, 0x3eb2: 0x000a, 0x3eb3: 0x000a, 0x3eb4: 0x000a, 0x3eb5: 0x000a, 0x3eb6: 0x000a, 0x3eb7: 0x000a, 0x3eb8: 0x000a, 0x3eb9: 0x000a, 0x3eba: 0x000a, 0x3ebb: 0x000a, 0x3ebc: 0x000a, 0x3ebd: 0x000a, 0x3ebe: 0x000a, 0x3ebf: 0x000a, // Block 0xfb, offset 0x3ec0 0x3ec1: 0x000a, 0x3ec2: 0x000a, 0x3ec3: 0x000a, 0x3ec4: 0x000a, 0x3ec5: 0x000a, 0x3ec6: 0x000a, 0x3ec7: 0x000a, 0x3ec8: 0x000a, 0x3ec9: 0x000a, 0x3eca: 0x000a, 0x3ecb: 0x000a, 0x3ecc: 0x000a, 0x3ecd: 0x000a, 0x3ece: 0x000a, 0x3ecf: 0x000a, 0x3ed1: 0x000a, 0x3ed2: 0x000a, 0x3ed3: 0x000a, 0x3ed4: 0x000a, 0x3ed5: 0x000a, 0x3ed6: 0x000a, 0x3ed7: 0x000a, 0x3ed8: 0x000a, 0x3ed9: 0x000a, 0x3eda: 0x000a, 0x3edb: 0x000a, 0x3edc: 0x000a, 0x3edd: 0x000a, 0x3ede: 0x000a, 0x3edf: 0x000a, 0x3ee0: 0x000a, 0x3ee1: 0x000a, 0x3ee2: 0x000a, 0x3ee3: 0x000a, 0x3ee4: 0x000a, 0x3ee5: 0x000a, 0x3ee6: 0x000a, 0x3ee7: 0x000a, 0x3ee8: 0x000a, 0x3ee9: 0x000a, 0x3eea: 0x000a, 0x3eeb: 0x000a, 0x3eec: 0x000a, 0x3eed: 0x000a, 0x3eee: 0x000a, 0x3eef: 0x000a, 0x3ef0: 0x000a, 0x3ef1: 0x000a, 0x3ef2: 0x000a, 0x3ef3: 0x000a, 0x3ef4: 0x000a, 0x3ef5: 0x000a, // Block 0xfc, offset 0x3f00 0x3f00: 0x0002, 0x3f01: 0x0002, 0x3f02: 0x0002, 0x3f03: 0x0002, 0x3f04: 0x0002, 0x3f05: 0x0002, 0x3f06: 0x0002, 0x3f07: 0x0002, 0x3f08: 0x0002, 0x3f09: 0x0002, 0x3f0a: 0x0002, 0x3f0b: 0x000a, 0x3f0c: 0x000a, 0x3f0d: 0x000a, 0x3f0e: 0x000a, 0x3f0f: 0x000a, 0x3f2f: 0x000a, // Block 0xfd, offset 0x3f40 0x3f6a: 0x000a, 0x3f6b: 0x000a, 0x3f6c: 0x000a, 0x3f6d: 0x000a, 0x3f6e: 0x000a, 0x3f6f: 0x000a, // Block 0xfe, offset 0x3f80 0x3fad: 0x000a, // Block 0xff, offset 0x3fc0 0x3fe0: 0x000a, 0x3fe1: 0x000a, 0x3fe2: 0x000a, 0x3fe3: 0x000a, 0x3fe4: 0x000a, 0x3fe5: 0x000a, // Block 0x100, offset 0x4000 0x4000: 0x000a, 0x4001: 0x000a, 0x4002: 0x000a, 0x4003: 0x000a, 0x4004: 0x000a, 0x4005: 0x000a, 0x4006: 0x000a, 0x4007: 0x000a, 0x4008: 0x000a, 0x4009: 0x000a, 0x400a: 0x000a, 0x400b: 0x000a, 0x400c: 0x000a, 0x400d: 0x000a, 0x400e: 0x000a, 0x400f: 0x000a, 0x4010: 0x000a, 0x4011: 0x000a, 0x4012: 0x000a, 0x4013: 0x000a, 0x4014: 0x000a, 0x4015: 0x000a, 0x4016: 0x000a, 0x4017: 0x000a, 0x4018: 0x000a, 0x401c: 0x000a, 0x401d: 0x000a, 0x401e: 0x000a, 0x401f: 0x000a, 0x4020: 0x000a, 0x4021: 0x000a, 0x4022: 0x000a, 0x4023: 0x000a, 0x4024: 0x000a, 0x4025: 0x000a, 0x4026: 0x000a, 0x4027: 0x000a, 0x4028: 0x000a, 0x4029: 0x000a, 0x402a: 0x000a, 0x402b: 0x000a, 0x402c: 0x000a, 0x4030: 0x000a, 0x4031: 0x000a, 0x4032: 0x000a, 0x4033: 0x000a, 0x4034: 0x000a, 0x4035: 0x000a, 0x4036: 0x000a, 0x4037: 0x000a, 0x4038: 0x000a, 0x4039: 0x000a, 0x403a: 0x000a, 0x403b: 0x000a, 0x403c: 0x000a, // Block 0x101, offset 0x4040 0x4040: 0x000a, 0x4041: 0x000a, 0x4042: 0x000a, 0x4043: 0x000a, 0x4044: 0x000a, 0x4045: 0x000a, 0x4046: 0x000a, 0x4047: 0x000a, 0x4048: 0x000a, 0x4049: 0x000a, 0x404a: 0x000a, 0x404b: 0x000a, 0x404c: 0x000a, 0x404d: 0x000a, 0x404e: 0x000a, 0x404f: 0x000a, 0x4050: 0x000a, 0x4051: 0x000a, 0x4052: 0x000a, 0x4053: 0x000a, 0x4054: 0x000a, 0x4055: 0x000a, 0x4056: 0x000a, 0x4057: 0x000a, 0x4058: 0x000a, 0x4059: 0x000a, 0x4060: 0x000a, 0x4061: 0x000a, 0x4062: 0x000a, 0x4063: 0x000a, 0x4064: 0x000a, 0x4065: 0x000a, 0x4066: 0x000a, 0x4067: 0x000a, 0x4068: 0x000a, 0x4069: 0x000a, 0x406a: 0x000a, 0x406b: 0x000a, 0x4070: 0x000a, // Block 0x102, offset 0x4080 0x4080: 0x000a, 0x4081: 0x000a, 0x4082: 0x000a, 0x4083: 0x000a, 0x4084: 0x000a, 0x4085: 0x000a, 0x4086: 0x000a, 0x4087: 0x000a, 0x4088: 0x000a, 0x4089: 0x000a, 0x408a: 0x000a, 0x408b: 0x000a, 0x4090: 0x000a, 0x4091: 0x000a, 0x4092: 0x000a, 0x4093: 0x000a, 0x4094: 0x000a, 0x4095: 0x000a, 0x4096: 0x000a, 0x4097: 0x000a, 0x4098: 0x000a, 0x4099: 0x000a, 0x409a: 0x000a, 0x409b: 0x000a, 0x409c: 0x000a, 0x409d: 0x000a, 0x409e: 0x000a, 0x409f: 0x000a, 0x40a0: 0x000a, 0x40a1: 0x000a, 0x40a2: 0x000a, 0x40a3: 0x000a, 0x40a4: 0x000a, 0x40a5: 0x000a, 0x40a6: 0x000a, 0x40a7: 0x000a, 0x40a8: 0x000a, 0x40a9: 0x000a, 0x40aa: 0x000a, 0x40ab: 0x000a, 0x40ac: 0x000a, 0x40ad: 0x000a, 0x40ae: 0x000a, 0x40af: 0x000a, 0x40b0: 0x000a, 0x40b1: 0x000a, 0x40b2: 0x000a, 0x40b3: 0x000a, 0x40b4: 0x000a, 0x40b5: 0x000a, 0x40b6: 0x000a, 0x40b7: 0x000a, 0x40b8: 0x000a, 0x40b9: 0x000a, 0x40ba: 0x000a, 0x40bb: 0x000a, 0x40bc: 0x000a, 0x40bd: 0x000a, 0x40be: 0x000a, 0x40bf: 0x000a, // Block 0x103, offset 0x40c0 0x40c0: 0x000a, 0x40c1: 0x000a, 0x40c2: 0x000a, 0x40c3: 0x000a, 0x40c4: 0x000a, 0x40c5: 0x000a, 0x40c6: 0x000a, 0x40c7: 0x000a, 0x40d0: 0x000a, 0x40d1: 0x000a, 0x40d2: 0x000a, 0x40d3: 0x000a, 0x40d4: 0x000a, 0x40d5: 0x000a, 0x40d6: 0x000a, 0x40d7: 0x000a, 0x40d8: 0x000a, 0x40d9: 0x000a, 0x40e0: 0x000a, 0x40e1: 0x000a, 0x40e2: 0x000a, 0x40e3: 0x000a, 0x40e4: 0x000a, 0x40e5: 0x000a, 0x40e6: 0x000a, 0x40e7: 0x000a, 0x40e8: 0x000a, 0x40e9: 0x000a, 0x40ea: 0x000a, 0x40eb: 0x000a, 0x40ec: 0x000a, 0x40ed: 0x000a, 0x40ee: 0x000a, 0x40ef: 0x000a, 0x40f0: 0x000a, 0x40f1: 0x000a, 0x40f2: 0x000a, 0x40f3: 0x000a, 0x40f4: 0x000a, 0x40f5: 0x000a, 0x40f6: 0x000a, 0x40f7: 0x000a, 0x40f8: 0x000a, 0x40f9: 0x000a, 0x40fa: 0x000a, 0x40fb: 0x000a, 0x40fc: 0x000a, 0x40fd: 0x000a, 0x40fe: 0x000a, 0x40ff: 0x000a, // Block 0x104, offset 0x4100 0x4100: 0x000a, 0x4101: 0x000a, 0x4102: 0x000a, 0x4103: 0x000a, 0x4104: 0x000a, 0x4105: 0x000a, 0x4106: 0x000a, 0x4107: 0x000a, 0x4110: 0x000a, 0x4111: 0x000a, 0x4112: 0x000a, 0x4113: 0x000a, 0x4114: 0x000a, 0x4115: 0x000a, 0x4116: 0x000a, 0x4117: 0x000a, 0x4118: 0x000a, 0x4119: 0x000a, 0x411a: 0x000a, 0x411b: 0x000a, 0x411c: 0x000a, 0x411d: 0x000a, 0x411e: 0x000a, 0x411f: 0x000a, 0x4120: 0x000a, 0x4121: 0x000a, 0x4122: 0x000a, 0x4123: 0x000a, 0x4124: 0x000a, 0x4125: 0x000a, 0x4126: 0x000a, 0x4127: 0x000a, 0x4128: 0x000a, 0x4129: 0x000a, 0x412a: 0x000a, 0x412b: 0x000a, 0x412c: 0x000a, 0x412d: 0x000a, 0x4130: 0x000a, 0x4131: 0x000a, 0x4132: 0x000a, 0x4133: 0x000a, 0x4134: 0x000a, 0x4135: 0x000a, 0x4136: 0x000a, 0x4137: 0x000a, 0x4138: 0x000a, 0x4139: 0x000a, 0x413a: 0x000a, 0x413b: 0x000a, // Block 0x105, offset 0x4140 0x4140: 0x000a, 0x4141: 0x000a, 0x4150: 0x000a, 0x4151: 0x000a, 0x4152: 0x000a, 0x4153: 0x000a, 0x4154: 0x000a, 0x4155: 0x000a, 0x4156: 0x000a, 0x4157: 0x000a, 0x4158: 0x000a, // Block 0x106, offset 0x4180 0x4180: 0x000a, 0x4181: 0x000a, 0x4182: 0x000a, 0x4183: 0x000a, 0x4184: 0x000a, 0x4185: 0x000a, 0x4186: 0x000a, 0x4187: 0x000a, 0x4188: 0x000a, 0x4189: 0x000a, 0x418a: 0x000a, 0x418b: 0x000a, 0x418c: 0x000a, 0x418d: 0x000a, 0x418e: 0x000a, 0x418f: 0x000a, 0x4190: 0x000a, 0x4191: 0x000a, 0x4192: 0x000a, 0x4193: 0x000a, 0x4194: 0x000a, 0x4195: 0x000a, 0x4196: 0x000a, 0x4197: 0x000a, 0x41a0: 0x000a, 0x41a1: 0x000a, 0x41a2: 0x000a, 0x41a3: 0x000a, 0x41a4: 0x000a, 0x41a5: 0x000a, 0x41a6: 0x000a, 0x41a7: 0x000a, 0x41a8: 0x000a, 0x41a9: 0x000a, 0x41aa: 0x000a, 0x41ab: 0x000a, 0x41ac: 0x000a, 0x41ad: 0x000a, 0x41b0: 0x000a, 0x41b1: 0x000a, 0x41b2: 0x000a, 0x41b3: 0x000a, 0x41b4: 0x000a, 0x41b5: 0x000a, 0x41b6: 0x000a, 0x41b7: 0x000a, 0x41b8: 0x000a, 0x41b9: 0x000a, 0x41ba: 0x000a, 0x41bb: 0x000a, 0x41bc: 0x000a, // Block 0x107, offset 0x41c0 0x41c0: 0x000a, 0x41c1: 0x000a, 0x41c2: 0x000a, 0x41c3: 0x000a, 0x41c4: 0x000a, 0x41c5: 0x000a, 0x41c6: 0x000a, 0x41c7: 0x000a, 0x41c8: 0x000a, 0x41c9: 0x000a, 0x41ca: 0x000a, 0x41ce: 0x000a, 0x41cf: 0x000a, 0x41d0: 0x000a, 0x41d1: 0x000a, 0x41d2: 0x000a, 0x41d3: 0x000a, 0x41d4: 0x000a, 0x41d5: 0x000a, 0x41d6: 0x000a, 0x41d7: 0x000a, 0x41d8: 0x000a, 0x41d9: 0x000a, 0x41da: 0x000a, 0x41db: 0x000a, 0x41dc: 0x000a, 0x41dd: 0x000a, 0x41de: 0x000a, 0x41df: 0x000a, 0x41e0: 0x000a, 0x41e1: 0x000a, 0x41e2: 0x000a, 0x41e3: 0x000a, 0x41e4: 0x000a, 0x41e5: 0x000a, 0x41e6: 0x000a, 0x41e7: 0x000a, 0x41e8: 0x000a, 0x41e9: 0x000a, 0x41ea: 0x000a, 0x41eb: 0x000a, 0x41ec: 0x000a, 0x41ed: 0x000a, 0x41ee: 0x000a, 0x41ef: 0x000a, 0x41f0: 0x000a, 0x41f1: 0x000a, 0x41f2: 0x000a, 0x41f3: 0x000a, 0x41f4: 0x000a, 0x41f5: 0x000a, 0x41f6: 0x000a, 0x41f7: 0x000a, 0x41f8: 0x000a, 0x41f9: 0x000a, 0x41fa: 0x000a, 0x41fb: 0x000a, 0x41fc: 0x000a, 0x41fd: 0x000a, 0x41fe: 0x000a, 0x41ff: 0x000a, // Block 0x108, offset 0x4200 0x4200: 0x000a, 0x4201: 0x000a, 0x4202: 0x000a, 0x4203: 0x000a, 0x4204: 0x000a, 0x4205: 0x000a, 0x4206: 0x000a, 0x4208: 0x000a, 0x420d: 0x000a, 0x420e: 0x000a, 0x420f: 0x000a, 0x4210: 0x000a, 0x4211: 0x000a, 0x4212: 0x000a, 0x4213: 0x000a, 0x4214: 0x000a, 0x4215: 0x000a, 0x4216: 0x000a, 0x4217: 0x000a, 0x4218: 0x000a, 0x4219: 0x000a, 0x421a: 0x000a, 0x421b: 0x000a, 0x421c: 0x000a, 0x421f: 0x000a, 0x4220: 0x000a, 0x4221: 0x000a, 0x4222: 0x000a, 0x4223: 0x000a, 0x4224: 0x000a, 0x4225: 0x000a, 0x4226: 0x000a, 0x4227: 0x000a, 0x4228: 0x000a, 0x4229: 0x000a, 0x422a: 0x000a, 0x422f: 0x000a, 0x4230: 0x000a, 0x4231: 0x000a, 0x4232: 0x000a, 0x4233: 0x000a, 0x4234: 0x000a, 0x4235: 0x000a, 0x4236: 0x000a, 0x4237: 0x000a, 0x4238: 0x000a, // Block 0x109, offset 0x4240 0x4240: 0x000a, 0x4241: 0x000a, 0x4242: 0x000a, 0x4243: 0x000a, 0x4244: 0x000a, 0x4245: 0x000a, 0x4246: 0x000a, 0x4247: 0x000a, 0x4248: 0x000a, 0x4249: 0x000a, 0x424a: 0x000a, 0x424b: 0x000a, 0x424c: 0x000a, 0x424d: 0x000a, 0x424e: 0x000a, 0x424f: 0x000a, 0x4250: 0x000a, 0x4251: 0x000a, 0x4252: 0x000a, 0x4254: 0x000a, 0x4255: 0x000a, 0x4256: 0x000a, 0x4257: 0x000a, 0x4258: 0x000a, 0x4259: 0x000a, 0x425a: 0x000a, 0x425b: 0x000a, 0x425c: 0x000a, 0x425d: 0x000a, 0x425e: 0x000a, 0x425f: 0x000a, 0x4260: 0x000a, 0x4261: 0x000a, 0x4262: 0x000a, 0x4263: 0x000a, 0x4264: 0x000a, 0x4265: 0x000a, 0x4266: 0x000a, 0x4267: 0x000a, 0x4268: 0x000a, 0x4269: 0x000a, 0x426a: 0x000a, 0x426b: 0x000a, 0x426c: 0x000a, 0x426d: 0x000a, 0x426e: 0x000a, 0x426f: 0x000a, 0x4270: 0x000a, 0x4271: 0x000a, 0x4272: 0x000a, 0x4273: 0x000a, 0x4274: 0x000a, 0x4275: 0x000a, 0x4276: 0x000a, 0x4277: 0x000a, 0x4278: 0x000a, 0x4279: 0x000a, 0x427a: 0x000a, 0x427b: 0x000a, 0x427c: 0x000a, 0x427d: 0x000a, 0x427e: 0x000a, 0x427f: 0x000a, // Block 0x10a, offset 0x4280 0x4280: 0x000a, 0x4281: 0x000a, 0x4282: 0x000a, 0x4283: 0x000a, 0x4284: 0x000a, 0x4285: 0x000a, 0x4286: 0x000a, 0x4287: 0x000a, 0x4288: 0x000a, 0x4289: 0x000a, 0x428a: 0x000a, 0x428b: 0x000a, 0x428c: 0x000a, 0x428d: 0x000a, 0x428e: 0x000a, 0x428f: 0x000a, 0x4290: 0x000a, 0x4291: 0x000a, 0x4292: 0x000a, 0x4293: 0x000a, 0x4294: 0x000a, 0x4295: 0x000a, 0x4296: 0x000a, 0x4297: 0x000a, 0x4298: 0x000a, 0x4299: 0x000a, 0x429a: 0x000a, 0x429b: 0x000a, 0x429c: 0x000a, 0x429d: 0x000a, 0x429e: 0x000a, 0x429f: 0x000a, 0x42a0: 0x000a, 0x42a1: 0x000a, 0x42a2: 0x000a, 0x42a3: 0x000a, 0x42a4: 0x000a, 0x42a5: 0x000a, 0x42a6: 0x000a, 0x42a7: 0x000a, 0x42a8: 0x000a, 0x42a9: 0x000a, 0x42aa: 0x000a, 0x42ab: 0x000a, 0x42ac: 0x000a, 0x42ad: 0x000a, 0x42ae: 0x000a, 0x42af: 0x000a, 0x42b0: 0x0002, 0x42b1: 0x0002, 0x42b2: 0x0002, 0x42b3: 0x0002, 0x42b4: 0x0002, 0x42b5: 0x0002, 0x42b6: 0x0002, 0x42b7: 0x0002, 0x42b8: 0x0002, 0x42b9: 0x0002, 0x42ba: 0x000a, // Block 0x10b, offset 0x42c0 0x42fe: 0x000b, 0x42ff: 0x000b, // Block 0x10c, offset 0x4300 0x4300: 0x000b, 0x4301: 0x000b, 0x4302: 0x000b, 0x4303: 0x000b, 0x4304: 0x000b, 0x4305: 0x000b, 0x4306: 0x000b, 0x4307: 0x000b, 0x4308: 0x000b, 0x4309: 0x000b, 0x430a: 0x000b, 0x430b: 0x000b, 0x430c: 0x000b, 0x430d: 0x000b, 0x430e: 0x000b, 0x430f: 0x000b, 0x4310: 0x000b, 0x4311: 0x000b, 0x4312: 0x000b, 0x4313: 0x000b, 0x4314: 0x000b, 0x4315: 0x000b, 0x4316: 0x000b, 0x4317: 0x000b, 0x4318: 0x000b, 0x4319: 0x000b, 0x431a: 0x000b, 0x431b: 0x000b, 0x431c: 0x000b, 0x431d: 0x000b, 0x431e: 0x000b, 0x431f: 0x000b, 0x4320: 0x000b, 0x4321: 0x000b, 0x4322: 0x000b, 0x4323: 0x000b, 0x4324: 0x000b, 0x4325: 0x000b, 0x4326: 0x000b, 0x4327: 0x000b, 0x4328: 0x000b, 0x4329: 0x000b, 0x432a: 0x000b, 0x432b: 0x000b, 0x432c: 0x000b, 0x432d: 0x000b, 0x432e: 0x000b, 0x432f: 0x000b, 0x4330: 0x000b, 0x4331: 0x000b, 0x4332: 0x000b, 0x4333: 0x000b, 0x4334: 0x000b, 0x4335: 0x000b, 0x4336: 0x000b, 0x4337: 0x000b, 0x4338: 0x000b, 0x4339: 0x000b, 0x433a: 0x000b, 0x433b: 0x000b, 0x433c: 0x000b, 0x433d: 0x000b, 0x433e: 0x000b, 0x433f: 0x000b, // Block 0x10d, offset 0x4340 0x4340: 0x000c, 0x4341: 0x000c, 0x4342: 0x000c, 0x4343: 0x000c, 0x4344: 0x000c, 0x4345: 0x000c, 0x4346: 0x000c, 0x4347: 0x000c, 0x4348: 0x000c, 0x4349: 0x000c, 0x434a: 0x000c, 0x434b: 0x000c, 0x434c: 0x000c, 0x434d: 0x000c, 0x434e: 0x000c, 0x434f: 0x000c, 0x4350: 0x000c, 0x4351: 0x000c, 0x4352: 0x000c, 0x4353: 0x000c, 0x4354: 0x000c, 0x4355: 0x000c, 0x4356: 0x000c, 0x4357: 0x000c, 0x4358: 0x000c, 0x4359: 0x000c, 0x435a: 0x000c, 0x435b: 0x000c, 0x435c: 0x000c, 0x435d: 0x000c, 0x435e: 0x000c, 0x435f: 0x000c, 0x4360: 0x000c, 0x4361: 0x000c, 0x4362: 0x000c, 0x4363: 0x000c, 0x4364: 0x000c, 0x4365: 0x000c, 0x4366: 0x000c, 0x4367: 0x000c, 0x4368: 0x000c, 0x4369: 0x000c, 0x436a: 0x000c, 0x436b: 0x000c, 0x436c: 0x000c, 0x436d: 0x000c, 0x436e: 0x000c, 0x436f: 0x000c, 0x4370: 0x000b, 0x4371: 0x000b, 0x4372: 0x000b, 0x4373: 0x000b, 0x4374: 0x000b, 0x4375: 0x000b, 0x4376: 0x000b, 0x4377: 0x000b, 0x4378: 0x000b, 0x4379: 0x000b, 0x437a: 0x000b, 0x437b: 0x000b, 0x437c: 0x000b, 0x437d: 0x000b, 0x437e: 0x000b, 0x437f: 0x000b, } // bidiIndex: 26 blocks, 1664 entries, 3328 bytes // Block 0 is the zero block. var bidiIndex = [1664]uint16{ // Block 0x0, offset 0x0 // Block 0x1, offset 0x40 // Block 0x2, offset 0x80 // Block 0x3, offset 0xc0 0xc2: 0x01, 0xc3: 0x02, 0xca: 0x03, 0xcb: 0x04, 0xcc: 0x05, 0xcd: 0x06, 0xce: 0x07, 0xcf: 0x08, 0xd2: 0x09, 0xd6: 0x0a, 0xd7: 0x0b, 0xd8: 0x0c, 0xd9: 0x0d, 0xda: 0x0e, 0xdb: 0x0f, 0xdc: 0x10, 0xdd: 0x11, 0xde: 0x12, 0xdf: 0x13, 0xe0: 0x02, 0xe1: 0x03, 0xe2: 0x04, 0xe3: 0x05, 0xe4: 0x06, 0xea: 0x07, 0xef: 0x08, 0xf0: 0x13, 0xf1: 0x14, 0xf2: 0x14, 0xf3: 0x16, 0xf4: 0x17, // Block 0x4, offset 0x100 0x120: 0x14, 0x121: 0x15, 0x122: 0x16, 0x123: 0x17, 0x124: 0x18, 0x125: 0x19, 0x126: 0x1a, 0x127: 0x1b, 0x128: 0x1c, 0x129: 0x1d, 0x12a: 0x1c, 0x12b: 0x1e, 0x12c: 0x1f, 0x12d: 0x20, 0x12e: 0x21, 0x12f: 0x22, 0x130: 0x23, 0x131: 0x24, 0x132: 0x1a, 0x133: 0x25, 0x134: 0x26, 0x135: 0x27, 0x136: 0x28, 0x137: 0x29, 0x138: 0x2a, 0x139: 0x2b, 0x13a: 0x2c, 0x13b: 0x2d, 0x13c: 0x2e, 0x13d: 0x2f, 0x13e: 0x30, 0x13f: 0x31, // Block 0x5, offset 0x140 0x140: 0x32, 0x141: 0x33, 0x142: 0x34, 0x14d: 0x35, 0x14e: 0x36, 0x150: 0x37, 0x15a: 0x38, 0x15c: 0x39, 0x15d: 0x3a, 0x15e: 0x3b, 0x15f: 0x3c, 0x160: 0x3d, 0x162: 0x3e, 0x164: 0x3f, 0x165: 0x40, 0x167: 0x41, 0x168: 0x42, 0x169: 0x43, 0x16a: 0x44, 0x16b: 0x45, 0x16c: 0x46, 0x16d: 0x47, 0x16e: 0x48, 0x16f: 0x49, 0x170: 0x4a, 0x173: 0x4b, 0x177: 0x05, 0x17e: 0x4c, 0x17f: 0x4d, // Block 0x6, offset 0x180 0x180: 0x4e, 0x181: 0x4f, 0x182: 0x50, 0x183: 0x51, 0x184: 0x52, 0x185: 0x53, 0x186: 0x54, 0x187: 0x55, 0x188: 0x56, 0x189: 0x55, 0x18a: 0x55, 0x18b: 0x55, 0x18c: 0x57, 0x18d: 0x58, 0x18e: 0x59, 0x18f: 0x55, 0x190: 0x5a, 0x191: 0x5b, 0x192: 0x5c, 0x193: 0x5d, 0x194: 0x55, 0x195: 0x55, 0x196: 0x55, 0x197: 0x55, 0x198: 0x55, 0x199: 0x55, 0x19a: 0x5e, 0x19b: 0x55, 0x19c: 0x55, 0x19d: 0x5f, 0x19e: 0x55, 0x19f: 0x60, 0x1a4: 0x55, 0x1a5: 0x55, 0x1a6: 0x61, 0x1a7: 0x62, 0x1a8: 0x55, 0x1a9: 0x55, 0x1aa: 0x55, 0x1ab: 0x55, 0x1ac: 0x55, 0x1ad: 0x63, 0x1ae: 0x55, 0x1af: 0x55, 0x1b3: 0x64, 0x1b5: 0x65, 0x1b7: 0x66, 0x1b8: 0x67, 0x1b9: 0x68, 0x1ba: 0x69, 0x1bb: 0x6a, 0x1bc: 0x55, 0x1bd: 0x55, 0x1be: 0x55, 0x1bf: 0x6b, // Block 0x7, offset 0x1c0 0x1c0: 0x6c, 0x1c2: 0x6d, 0x1c3: 0x6e, 0x1c7: 0x6f, 0x1c8: 0x70, 0x1c9: 0x71, 0x1ca: 0x72, 0x1cb: 0x73, 0x1cd: 0x74, 0x1cf: 0x75, // Block 0x8, offset 0x200 0x237: 0x55, // Block 0x9, offset 0x240 0x252: 0x76, 0x253: 0x77, 0x258: 0x78, 0x259: 0x79, 0x25a: 0x7a, 0x25b: 0x7b, 0x25c: 0x7c, 0x25e: 0x7d, 0x260: 0x7e, 0x261: 0x7f, 0x263: 0x80, 0x264: 0x81, 0x265: 0x82, 0x266: 0x83, 0x267: 0x84, 0x268: 0x85, 0x269: 0x86, 0x26a: 0x87, 0x26b: 0x88, 0x26d: 0x89, 0x26f: 0x8a, // Block 0xa, offset 0x280 0x2ac: 0x8b, 0x2ad: 0x8c, 0x2ae: 0x0e, 0x2af: 0x8d, 0x2b0: 0x0e, 0x2b1: 0x0e, 0x2b2: 0x0e, 0x2b3: 0x0e, 0x2b4: 0x8e, 0x2b5: 0x8f, 0x2b6: 0x90, 0x2b7: 0x91, 0x2b8: 0x92, 0x2b9: 0x93, 0x2ba: 0x0e, 0x2bb: 0x94, 0x2bc: 0x95, 0x2bd: 0x96, 0x2bf: 0x97, // Block 0xb, offset 0x2c0 0x2c4: 0x98, 0x2c5: 0x55, 0x2c6: 0x99, 0x2c7: 0x9a, 0x2cb: 0x9b, 0x2cd: 0x9c, 0x2e0: 0x9d, 0x2e1: 0x9d, 0x2e2: 0x9d, 0x2e3: 0x9d, 0x2e4: 0x9e, 0x2e5: 0x9d, 0x2e6: 0x9d, 0x2e7: 0x9d, 0x2e8: 0x9f, 0x2e9: 0x9d, 0x2ea: 0x9d, 0x2eb: 0xa0, 0x2ec: 0xa1, 0x2ed: 0x9d, 0x2ee: 0x9d, 0x2ef: 0x9d, 0x2f0: 0x9d, 0x2f1: 0x9d, 0x2f2: 0x9d, 0x2f3: 0x9d, 0x2f4: 0xa2, 0x2f5: 0xa3, 0x2f6: 0x9d, 0x2f7: 0x9d, 0x2f8: 0x9d, 0x2f9: 0xa4, 0x2fa: 0xa5, 0x2fb: 0xa6, 0x2fc: 0xa7, 0x2fd: 0xa8, 0x2fe: 0xa9, 0x2ff: 0x9d, // Block 0xc, offset 0x300 0x300: 0xaa, 0x301: 0xab, 0x302: 0xac, 0x303: 0x21, 0x304: 0xad, 0x305: 0xae, 0x306: 0xaf, 0x307: 0xb0, 0x308: 0xb1, 0x309: 0x28, 0x30b: 0xb2, 0x30c: 0x26, 0x30d: 0xb3, 0x30e: 0xb4, 0x30f: 0xb5, 0x310: 0xb6, 0x311: 0xb7, 0x312: 0xb8, 0x313: 0xb9, 0x316: 0xba, 0x317: 0xbb, 0x318: 0xbc, 0x319: 0xbd, 0x31a: 0xbe, 0x31c: 0xbf, 0x320: 0xc0, 0x324: 0xc1, 0x325: 0xc2, 0x327: 0xc3, 0x328: 0xc4, 0x329: 0xc5, 0x32a: 0xc6, 0x32d: 0xc7, 0x330: 0xc8, 0x332: 0xc9, 0x334: 0xca, 0x335: 0xcb, 0x336: 0xcc, 0x33b: 0xcd, 0x33c: 0xce, 0x33d: 0xcf, 0x33f: 0xd0, // Block 0xd, offset 0x340 0x351: 0xd1, // Block 0xe, offset 0x380 0x384: 0xd2, 0x3ab: 0xd3, 0x3ac: 0xd4, 0x3bd: 0xd5, 0x3be: 0xd6, 0x3bf: 0xd7, // Block 0xf, offset 0x3c0 0x3f2: 0xd8, // Block 0x10, offset 0x400 0x430: 0x55, 0x431: 0x55, 0x432: 0x55, 0x433: 0xd9, 0x434: 0x55, 0x435: 0x55, 0x436: 0x55, 0x437: 0x55, 0x438: 0x55, 0x439: 0x55, 0x43a: 0xda, 0x43b: 0xdb, 0x43c: 0xdc, 0x43d: 0xdd, // Block 0x11, offset 0x440 0x445: 0xde, 0x446: 0xdf, 0x447: 0xe0, 0x448: 0x55, 0x449: 0xe1, 0x44c: 0x55, 0x44d: 0xe2, 0x45b: 0xe3, 0x45c: 0xe4, 0x45d: 0xe5, 0x45e: 0xe6, 0x45f: 0xe7, 0x468: 0xe8, 0x469: 0xe9, 0x46a: 0xea, // Block 0x12, offset 0x480 0x480: 0xeb, 0x482: 0xd5, 0x484: 0xd4, 0x48a: 0xec, 0x48b: 0xed, 0x493: 0xee, 0x497: 0xef, 0x49b: 0xf0, 0x4a0: 0x9d, 0x4a1: 0x9d, 0x4a2: 0x9d, 0x4a3: 0xf1, 0x4a4: 0x9d, 0x4a5: 0xf2, 0x4a6: 0x9d, 0x4a7: 0x9d, 0x4a8: 0x9d, 0x4a9: 0x9d, 0x4aa: 0x9d, 0x4ab: 0x9d, 0x4ac: 0x9d, 0x4ad: 0x9d, 0x4ae: 0x9d, 0x4af: 0x9d, 0x4b0: 0x9d, 0x4b1: 0xf3, 0x4b2: 0xf4, 0x4b3: 0x9d, 0x4b4: 0xf5, 0x4b5: 0x9d, 0x4b6: 0x9d, 0x4b7: 0x9d, 0x4b8: 0x0e, 0x4b9: 0x0e, 0x4ba: 0x0e, 0x4bb: 0xf6, 0x4bc: 0x9d, 0x4bd: 0x9d, 0x4be: 0x9d, 0x4bf: 0x9d, // Block 0x13, offset 0x4c0 0x4c0: 0xf7, 0x4c1: 0x55, 0x4c2: 0xf8, 0x4c3: 0xf9, 0x4c4: 0xfa, 0x4c5: 0xfb, 0x4c6: 0xfc, 0x4c9: 0xfd, 0x4cc: 0x55, 0x4cd: 0x55, 0x4ce: 0x55, 0x4cf: 0x55, 0x4d0: 0x55, 0x4d1: 0x55, 0x4d2: 0x55, 0x4d3: 0x55, 0x4d4: 0x55, 0x4d5: 0x55, 0x4d6: 0x55, 0x4d7: 0x55, 0x4d8: 0x55, 0x4d9: 0x55, 0x4da: 0x55, 0x4db: 0xfe, 0x4dc: 0x55, 0x4dd: 0x55, 0x4de: 0x55, 0x4df: 0xff, 0x4e0: 0x100, 0x4e1: 0x101, 0x4e2: 0x102, 0x4e3: 0x103, 0x4e4: 0x55, 0x4e5: 0x55, 0x4e6: 0x55, 0x4e7: 0x55, 0x4e8: 0x55, 0x4e9: 0x104, 0x4ea: 0x105, 0x4eb: 0x106, 0x4ec: 0x55, 0x4ed: 0x55, 0x4ee: 0x107, 0x4ef: 0x108, 0x4ff: 0x109, // Block 0x14, offset 0x500 0x53f: 0x109, // Block 0x15, offset 0x540 0x550: 0x09, 0x551: 0x0a, 0x553: 0x0b, 0x556: 0x0c, 0x55b: 0x0d, 0x55c: 0x0e, 0x55d: 0x0f, 0x55e: 0x10, 0x55f: 0x11, 0x56f: 0x12, 0x57f: 0x12, // Block 0x16, offset 0x580 0x58f: 0x12, 0x59f: 0x12, 0x5af: 0x12, 0x5bf: 0x12, // Block 0x17, offset 0x5c0 0x5c0: 0x10a, 0x5c1: 0x10a, 0x5c2: 0x10a, 0x5c3: 0x10a, 0x5c4: 0x05, 0x5c5: 0x05, 0x5c6: 0x05, 0x5c7: 0x10b, 0x5c8: 0x10a, 0x5c9: 0x10a, 0x5ca: 0x10a, 0x5cb: 0x10a, 0x5cc: 0x10a, 0x5cd: 0x10a, 0x5ce: 0x10a, 0x5cf: 0x10a, 0x5d0: 0x10a, 0x5d1: 0x10a, 0x5d2: 0x10a, 0x5d3: 0x10a, 0x5d4: 0x10a, 0x5d5: 0x10a, 0x5d6: 0x10a, 0x5d7: 0x10a, 0x5d8: 0x10a, 0x5d9: 0x10a, 0x5da: 0x10a, 0x5db: 0x10a, 0x5dc: 0x10a, 0x5dd: 0x10a, 0x5de: 0x10a, 0x5df: 0x10a, 0x5e0: 0x10a, 0x5e1: 0x10a, 0x5e2: 0x10a, 0x5e3: 0x10a, 0x5e4: 0x10a, 0x5e5: 0x10a, 0x5e6: 0x10a, 0x5e7: 0x10a, 0x5e8: 0x10a, 0x5e9: 0x10a, 0x5ea: 0x10a, 0x5eb: 0x10a, 0x5ec: 0x10a, 0x5ed: 0x10a, 0x5ee: 0x10a, 0x5ef: 0x10a, 0x5f0: 0x10a, 0x5f1: 0x10a, 0x5f2: 0x10a, 0x5f3: 0x10a, 0x5f4: 0x10a, 0x5f5: 0x10a, 0x5f6: 0x10a, 0x5f7: 0x10a, 0x5f8: 0x10a, 0x5f9: 0x10a, 0x5fa: 0x10a, 0x5fb: 0x10a, 0x5fc: 0x10a, 0x5fd: 0x10a, 0x5fe: 0x10a, 0x5ff: 0x10a, // Block 0x18, offset 0x600 0x60f: 0x12, 0x61f: 0x12, 0x620: 0x15, 0x62f: 0x12, 0x63f: 0x12, // Block 0x19, offset 0x640 0x64f: 0x12, } // Total table size 20664 bytes (20KiB); checksum: F50EF68C ================================================ FILE: vendor/golang.org/x/text/unicode/bidi/trieval.go ================================================ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. package bidi // Class is the Unicode BiDi class. Each rune has a single class. type Class uint const ( L Class = iota // LeftToRight R // RightToLeft EN // EuropeanNumber ES // EuropeanSeparator ET // EuropeanTerminator AN // ArabicNumber CS // CommonSeparator B // ParagraphSeparator S // SegmentSeparator WS // WhiteSpace ON // OtherNeutral BN // BoundaryNeutral NSM // NonspacingMark AL // ArabicLetter Control // Control LRO - PDI numClass LRO // LeftToRightOverride RLO // RightToLeftOverride LRE // LeftToRightEmbedding RLE // RightToLeftEmbedding PDF // PopDirectionalFormat LRI // LeftToRightIsolate RLI // RightToLeftIsolate FSI // FirstStrongIsolate PDI // PopDirectionalIsolate unknownClass = ^Class(0) ) // A trie entry has the following bits: // 7..5 XOR mask for brackets // 4 1: Bracket open, 0: Bracket close // 3..0 Class type const ( openMask = 0x10 xorMaskShift = 5 ) ================================================ FILE: vendor/golang.org/x/text/unicode/norm/composition.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package norm import "unicode/utf8" const ( maxNonStarters = 30 // The maximum number of characters needed for a buffer is // maxNonStarters + 1 for the starter + 1 for the GCJ maxBufferSize = maxNonStarters + 2 maxNFCExpansion = 3 // NFC(0x1D160) maxNFKCExpansion = 18 // NFKC(0xFDFA) maxByteBufferSize = utf8.UTFMax * maxBufferSize // 128 ) // ssState is used for reporting the segment state after inserting a rune. // It is returned by streamSafe.next. type ssState int const ( // Indicates a rune was successfully added to the segment. ssSuccess ssState = iota // Indicates a rune starts a new segment and should not be added. ssStarter // Indicates a rune caused a segment overflow and a CGJ should be inserted. ssOverflow ) // streamSafe implements the policy of when a CGJ should be inserted. type streamSafe uint8 // first inserts the first rune of a segment. It is a faster version of next if // it is known p represents the first rune in a segment. func (ss *streamSafe) first(p Properties) { *ss = streamSafe(p.nTrailingNonStarters()) } // insert returns a ssState value to indicate whether a rune represented by p // can be inserted. func (ss *streamSafe) next(p Properties) ssState { if *ss > maxNonStarters { panic("streamSafe was not reset") } n := p.nLeadingNonStarters() if *ss += streamSafe(n); *ss > maxNonStarters { *ss = 0 return ssOverflow } // The Stream-Safe Text Processing prescribes that the counting can stop // as soon as a starter is encountered. However, there are some starters, // like Jamo V and T, that can combine with other runes, leaving their // successive non-starters appended to the previous, possibly causing an // overflow. We will therefore consider any rune with a non-zero nLead to // be a non-starter. Note that it always hold that if nLead > 0 then // nLead == nTrail. if n == 0 { *ss = streamSafe(p.nTrailingNonStarters()) return ssStarter } return ssSuccess } // backwards is used for checking for overflow and segment starts // when traversing a string backwards. Users do not need to call first // for the first rune. The state of the streamSafe retains the count of // the non-starters loaded. func (ss *streamSafe) backwards(p Properties) ssState { if *ss > maxNonStarters { panic("streamSafe was not reset") } c := *ss + streamSafe(p.nTrailingNonStarters()) if c > maxNonStarters { return ssOverflow } *ss = c if p.nLeadingNonStarters() == 0 { return ssStarter } return ssSuccess } func (ss streamSafe) isMax() bool { return ss == maxNonStarters } // GraphemeJoiner is inserted after maxNonStarters non-starter runes. const GraphemeJoiner = "\u034F" // reorderBuffer is used to normalize a single segment. Characters inserted with // insert are decomposed and reordered based on CCC. The compose method can // be used to recombine characters. Note that the byte buffer does not hold // the UTF-8 characters in order. Only the rune array is maintained in sorted // order. flush writes the resulting segment to a byte array. type reorderBuffer struct { rune [maxBufferSize]Properties // Per character info. byte [maxByteBufferSize]byte // UTF-8 buffer. Referenced by runeInfo.pos. nbyte uint8 // Number or bytes. ss streamSafe // For limiting length of non-starter sequence. nrune int // Number of runeInfos. f formInfo src input nsrc int tmpBytes input out []byte flushF func(*reorderBuffer) bool } func (rb *reorderBuffer) init(f Form, src []byte) { rb.f = *formTable[f] rb.src.setBytes(src) rb.nsrc = len(src) rb.ss = 0 } func (rb *reorderBuffer) initString(f Form, src string) { rb.f = *formTable[f] rb.src.setString(src) rb.nsrc = len(src) rb.ss = 0 } func (rb *reorderBuffer) setFlusher(out []byte, f func(*reorderBuffer) bool) { rb.out = out rb.flushF = f } // reset discards all characters from the buffer. func (rb *reorderBuffer) reset() { rb.nrune = 0 rb.nbyte = 0 } func (rb *reorderBuffer) doFlush() bool { if rb.f.composing { rb.compose() } res := rb.flushF(rb) rb.reset() return res } // appendFlush appends the normalized segment to rb.out. func appendFlush(rb *reorderBuffer) bool { for i := 0; i < rb.nrune; i++ { start := rb.rune[i].pos end := start + rb.rune[i].size rb.out = append(rb.out, rb.byte[start:end]...) } return true } // flush appends the normalized segment to out and resets rb. func (rb *reorderBuffer) flush(out []byte) []byte { for i := 0; i < rb.nrune; i++ { start := rb.rune[i].pos end := start + rb.rune[i].size out = append(out, rb.byte[start:end]...) } rb.reset() return out } // flushCopy copies the normalized segment to buf and resets rb. // It returns the number of bytes written to buf. func (rb *reorderBuffer) flushCopy(buf []byte) int { p := 0 for i := 0; i < rb.nrune; i++ { runep := rb.rune[i] p += copy(buf[p:], rb.byte[runep.pos:runep.pos+runep.size]) } rb.reset() return p } // insertOrdered inserts a rune in the buffer, ordered by Canonical Combining Class. // It returns false if the buffer is not large enough to hold the rune. // It is used internally by insert and insertString only. func (rb *reorderBuffer) insertOrdered(info Properties) { n := rb.nrune b := rb.rune[:] cc := info.ccc if cc > 0 { // Find insertion position + move elements to make room. for ; n > 0; n-- { if b[n-1].ccc <= cc { break } b[n] = b[n-1] } } rb.nrune += 1 pos := uint8(rb.nbyte) rb.nbyte += utf8.UTFMax info.pos = pos b[n] = info } // insertErr is an error code returned by insert. Using this type instead // of error improves performance up to 20% for many of the benchmarks. type insertErr int const ( iSuccess insertErr = -iota iShortDst iShortSrc ) // insertFlush inserts the given rune in the buffer ordered by CCC. // If a decomposition with multiple segments are encountered, they leading // ones are flushed. // It returns a non-zero error code if the rune was not inserted. func (rb *reorderBuffer) insertFlush(src input, i int, info Properties) insertErr { if rune := src.hangul(i); rune != 0 { rb.decomposeHangul(rune) return iSuccess } if info.hasDecomposition() { return rb.insertDecomposed(info.Decomposition()) } rb.insertSingle(src, i, info) return iSuccess } // insertUnsafe inserts the given rune in the buffer ordered by CCC. // It is assumed there is sufficient space to hold the runes. It is the // responsibility of the caller to ensure this. This can be done by checking // the state returned by the streamSafe type. func (rb *reorderBuffer) insertUnsafe(src input, i int, info Properties) { if rune := src.hangul(i); rune != 0 { rb.decomposeHangul(rune) } if info.hasDecomposition() { // TODO: inline. rb.insertDecomposed(info.Decomposition()) } else { rb.insertSingle(src, i, info) } } // insertDecomposed inserts an entry in to the reorderBuffer for each rune // in dcomp. dcomp must be a sequence of decomposed UTF-8-encoded runes. // It flushes the buffer on each new segment start. func (rb *reorderBuffer) insertDecomposed(dcomp []byte) insertErr { rb.tmpBytes.setBytes(dcomp) // As the streamSafe accounting already handles the counting for modifiers, // we don't have to call next. However, we do need to keep the accounting // intact when flushing the buffer. for i := 0; i < len(dcomp); { info := rb.f.info(rb.tmpBytes, i) if info.BoundaryBefore() && rb.nrune > 0 && !rb.doFlush() { return iShortDst } i += copy(rb.byte[rb.nbyte:], dcomp[i:i+int(info.size)]) rb.insertOrdered(info) } return iSuccess } // insertSingle inserts an entry in the reorderBuffer for the rune at // position i. info is the runeInfo for the rune at position i. func (rb *reorderBuffer) insertSingle(src input, i int, info Properties) { src.copySlice(rb.byte[rb.nbyte:], i, i+int(info.size)) rb.insertOrdered(info) } // insertCGJ inserts a Combining Grapheme Joiner (0x034f) into rb. func (rb *reorderBuffer) insertCGJ() { rb.insertSingle(input{str: GraphemeJoiner}, 0, Properties{size: uint8(len(GraphemeJoiner))}) } // appendRune inserts a rune at the end of the buffer. It is used for Hangul. func (rb *reorderBuffer) appendRune(r rune) { bn := rb.nbyte sz := utf8.EncodeRune(rb.byte[bn:], rune(r)) rb.nbyte += utf8.UTFMax rb.rune[rb.nrune] = Properties{pos: bn, size: uint8(sz)} rb.nrune++ } // assignRune sets a rune at position pos. It is used for Hangul and recomposition. func (rb *reorderBuffer) assignRune(pos int, r rune) { bn := rb.rune[pos].pos sz := utf8.EncodeRune(rb.byte[bn:], rune(r)) rb.rune[pos] = Properties{pos: bn, size: uint8(sz)} } // runeAt returns the rune at position n. It is used for Hangul and recomposition. func (rb *reorderBuffer) runeAt(n int) rune { inf := rb.rune[n] r, _ := utf8.DecodeRune(rb.byte[inf.pos : inf.pos+inf.size]) return r } // bytesAt returns the UTF-8 encoding of the rune at position n. // It is used for Hangul and recomposition. func (rb *reorderBuffer) bytesAt(n int) []byte { inf := rb.rune[n] return rb.byte[inf.pos : int(inf.pos)+int(inf.size)] } // For Hangul we combine algorithmically, instead of using tables. const ( hangulBase = 0xAC00 // UTF-8(hangulBase) -> EA B0 80 hangulBase0 = 0xEA hangulBase1 = 0xB0 hangulBase2 = 0x80 hangulEnd = hangulBase + jamoLVTCount // UTF-8(0xD7A4) -> ED 9E A4 hangulEnd0 = 0xED hangulEnd1 = 0x9E hangulEnd2 = 0xA4 jamoLBase = 0x1100 // UTF-8(jamoLBase) -> E1 84 00 jamoLBase0 = 0xE1 jamoLBase1 = 0x84 jamoLEnd = 0x1113 jamoVBase = 0x1161 jamoVEnd = 0x1176 jamoTBase = 0x11A7 jamoTEnd = 0x11C3 jamoTCount = 28 jamoVCount = 21 jamoVTCount = 21 * 28 jamoLVTCount = 19 * 21 * 28 ) const hangulUTF8Size = 3 func isHangul(b []byte) bool { if len(b) < hangulUTF8Size { return false } b0 := b[0] if b0 < hangulBase0 { return false } b1 := b[1] switch { case b0 == hangulBase0: return b1 >= hangulBase1 case b0 < hangulEnd0: return true case b0 > hangulEnd0: return false case b1 < hangulEnd1: return true } return b1 == hangulEnd1 && b[2] < hangulEnd2 } func isHangulString(b string) bool { if len(b) < hangulUTF8Size { return false } b0 := b[0] if b0 < hangulBase0 { return false } b1 := b[1] switch { case b0 == hangulBase0: return b1 >= hangulBase1 case b0 < hangulEnd0: return true case b0 > hangulEnd0: return false case b1 < hangulEnd1: return true } return b1 == hangulEnd1 && b[2] < hangulEnd2 } // Caller must ensure len(b) >= 2. func isJamoVT(b []byte) bool { // True if (rune & 0xff00) == jamoLBase return b[0] == jamoLBase0 && (b[1]&0xFC) == jamoLBase1 } func isHangulWithoutJamoT(b []byte) bool { c, _ := utf8.DecodeRune(b) c -= hangulBase return c < jamoLVTCount && c%jamoTCount == 0 } // decomposeHangul writes the decomposed Hangul to buf and returns the number // of bytes written. len(buf) should be at least 9. func decomposeHangul(buf []byte, r rune) int { const JamoUTF8Len = 3 r -= hangulBase x := r % jamoTCount r /= jamoTCount utf8.EncodeRune(buf, jamoLBase+r/jamoVCount) utf8.EncodeRune(buf[JamoUTF8Len:], jamoVBase+r%jamoVCount) if x != 0 { utf8.EncodeRune(buf[2*JamoUTF8Len:], jamoTBase+x) return 3 * JamoUTF8Len } return 2 * JamoUTF8Len } // decomposeHangul algorithmically decomposes a Hangul rune into // its Jamo components. // See https://unicode.org/reports/tr15/#Hangul for details on decomposing Hangul. func (rb *reorderBuffer) decomposeHangul(r rune) { r -= hangulBase x := r % jamoTCount r /= jamoTCount rb.appendRune(jamoLBase + r/jamoVCount) rb.appendRune(jamoVBase + r%jamoVCount) if x != 0 { rb.appendRune(jamoTBase + x) } } // combineHangul algorithmically combines Jamo character components into Hangul. // See https://unicode.org/reports/tr15/#Hangul for details on combining Hangul. func (rb *reorderBuffer) combineHangul(s, i, k int) { b := rb.rune[:] bn := rb.nrune for ; i < bn; i++ { cccB := b[k-1].ccc cccC := b[i].ccc if cccB == 0 { s = k - 1 } if s != k-1 && cccB >= cccC { // b[i] is blocked by greater-equal cccX below it b[k] = b[i] k++ } else { l := rb.runeAt(s) // also used to compare to hangulBase v := rb.runeAt(i) // also used to compare to jamoT switch { case jamoLBase <= l && l < jamoLEnd && jamoVBase <= v && v < jamoVEnd: // 11xx plus 116x to LV rb.assignRune(s, hangulBase+ (l-jamoLBase)*jamoVTCount+(v-jamoVBase)*jamoTCount) case hangulBase <= l && l < hangulEnd && jamoTBase < v && v < jamoTEnd && ((l-hangulBase)%jamoTCount) == 0: // ACxx plus 11Ax to LVT rb.assignRune(s, l+v-jamoTBase) default: b[k] = b[i] k++ } } } rb.nrune = k } // compose recombines the runes in the buffer. // It should only be used to recompose a single segment, as it will not // handle alternations between Hangul and non-Hangul characters correctly. func (rb *reorderBuffer) compose() { // Lazily load the map used by the combine func below, but do // it outside of the loop. recompMapOnce.Do(buildRecompMap) // UAX #15, section X5 , including Corrigendum #5 // "In any character sequence beginning with starter S, a character C is // blocked from S if and only if there is some character B between S // and C, and either B is a starter or it has the same or higher // combining class as C." bn := rb.nrune if bn == 0 { return } k := 1 b := rb.rune[:] for s, i := 0, 1; i < bn; i++ { if isJamoVT(rb.bytesAt(i)) { // Redo from start in Hangul mode. Necessary to support // U+320E..U+321E in NFKC mode. rb.combineHangul(s, i, k) return } ii := b[i] // We can only use combineForward as a filter if we later // get the info for the combined character. This is more // expensive than using the filter. Using combinesBackward() // is safe. if ii.combinesBackward() { cccB := b[k-1].ccc cccC := ii.ccc blocked := false // b[i] blocked by starter or greater or equal CCC? if cccB == 0 { s = k - 1 } else { blocked = s != k-1 && cccB >= cccC } if !blocked { combined := combine(rb.runeAt(s), rb.runeAt(i)) if combined != 0 { rb.assignRune(s, combined) continue } } } b[k] = b[i] k++ } rb.nrune = k } ================================================ FILE: vendor/golang.org/x/text/unicode/norm/forminfo.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package norm import "encoding/binary" // This file contains Form-specific logic and wrappers for data in tables.go. // Rune info is stored in a separate trie per composing form. A composing form // and its corresponding decomposing form share the same trie. Each trie maps // a rune to a uint16. The values take two forms. For v >= 0x8000: // bits // 15: 1 (inverse of NFD_QC bit of qcInfo) // 12..7: qcInfo (see below). isYesD is always true (no decomposition). // 6..0: ccc (compressed CCC value). // For v < 0x8000, the respective rune has a decomposition and v is an index // into a byte array of UTF-8 decomposition sequences and additional info and // has the form: //
* [ []] // The header contains the number of bytes in the decomposition (excluding this // length byte), with 33 mapped to 31 to fit in 5 bits. // (If any 31- or 32-byte decompositions come along, we could switch to using // use a general lookup table as long as there are at most 32 distinct lengths.) // The three most significant bits of this length byte correspond // to bit 5, 4, and 3 of qcInfo (see below). The byte sequence itself starts at v+1. // The byte sequence is followed by a trailing and leading CCC if the values // for these are not zero. The value of v determines which ccc are appended // to the sequences. For v < firstCCC, there are none, for v >= firstCCC, // the sequence is followed by a trailing ccc, and for v >= firstLeadingCC // there is an additional leading ccc. The value of tccc itself is the // trailing CCC shifted left 2 bits. The two least-significant bits of tccc // are the number of trailing non-starters. const ( qcInfoMask = 0x3F // to clear all but the relevant bits in a qcInfo headerLenMask = 0x1F // extract the length value from the header byte (31 => 33) headerFlagsMask = 0xE0 // extract the qcInfo bits from the header byte ) // Properties provides access to normalization properties of a rune. type Properties struct { pos uint8 // start position in reorderBuffer; used in composition.go size uint8 // length of UTF-8 encoding of this rune ccc uint8 // leading canonical combining class (ccc if not decomposition) tccc uint8 // trailing canonical combining class (ccc if not decomposition) nLead uint8 // number of leading non-starters. flags qcInfo // quick check flags index uint16 } // functions dispatchable per form type lookupFunc func(b input, i int) Properties // formInfo holds Form-specific functions and tables. type formInfo struct { form Form composing, compatibility bool // form type info lookupFunc nextMain iterFunc } var formTable = []*formInfo{{ form: NFC, composing: true, compatibility: false, info: lookupInfoNFC, nextMain: nextComposed, }, { form: NFD, composing: false, compatibility: false, info: lookupInfoNFC, nextMain: nextDecomposed, }, { form: NFKC, composing: true, compatibility: true, info: lookupInfoNFKC, nextMain: nextComposed, }, { form: NFKD, composing: false, compatibility: true, info: lookupInfoNFKC, nextMain: nextDecomposed, }} // We do not distinguish between boundaries for NFC, NFD, etc. to avoid // unexpected behavior for the user. For example, in NFD, there is a boundary // after 'a'. However, 'a' might combine with modifiers, so from the application's // perspective it is not a good boundary. We will therefore always use the // boundaries for the combining variants. // BoundaryBefore returns true if this rune starts a new segment and // cannot combine with any rune on the left. func (p Properties) BoundaryBefore() bool { if p.ccc == 0 && !p.combinesBackward() { return true } // We assume that the CCC of the first character in a decomposition // is always non-zero if different from info.ccc and that we can return // false at this point. This is verified by maketables. return false } // BoundaryAfter returns true if runes cannot combine with or otherwise // interact with this or previous runes. func (p Properties) BoundaryAfter() bool { // TODO: loosen these conditions. return p.isInert() } // We pack quick check data in 6 bits: // // 5: Combines forward (0 == false, 1 == true) // 4..3: NFC_QC Yes(00), No (10), or Maybe (11) // 2: NFD_QC Yes (0) or No (1). No also means there is a decomposition. // 1..0: Number of trailing non-starters. // // When all 6 bits are zero, the character is inert, meaning it is never // influenced by normalization. type qcInfo uint8 func (p Properties) isYesC() bool { return p.flags&0x10 == 0 } func (p Properties) isYesD() bool { return p.flags&0x4 == 0 } func (p Properties) combinesForward() bool { return p.flags&0x20 != 0 } func (p Properties) combinesBackward() bool { return p.flags&0x8 != 0 } // == isMaybe func (p Properties) hasDecomposition() bool { return p.flags&0x4 != 0 } // == isNoD func (p Properties) isInert() bool { return p.flags&qcInfoMask == 0 && p.ccc == 0 } func (p Properties) multiSegment() bool { return p.index >= firstMulti && p.index < endMulti } func (p Properties) nLeadingNonStarters() uint8 { return p.nLead } func (p Properties) nTrailingNonStarters() uint8 { return uint8(p.flags & 0x03) } // Decomposition returns the decomposition for the underlying rune // or nil if there is none. func (p Properties) Decomposition() []byte { // TODO: create the decomposition for Hangul? if p.index == 0 { return nil } i := p.index n := decomps[i] & headerLenMask if n == 31 { n = 33 } i++ return decomps[i : i+uint16(n)] } // Size returns the length of UTF-8 encoding of the rune. func (p Properties) Size() int { return int(p.size) } // CCC returns the canonical combining class of the underlying rune. func (p Properties) CCC() uint8 { if p.index >= firstCCCZeroExcept { return 0 } return ccc[p.ccc] } // LeadCCC returns the CCC of the first rune in the decomposition. // If there is no decomposition, LeadCCC equals CCC. func (p Properties) LeadCCC() uint8 { return ccc[p.ccc] } // TrailCCC returns the CCC of the last rune in the decomposition. // If there is no decomposition, TrailCCC equals CCC. func (p Properties) TrailCCC() uint8 { return ccc[p.tccc] } func buildRecompMap() { recompMap = make(map[uint32]rune, len(recompMapPacked)/8) var buf [8]byte for i := 0; i < len(recompMapPacked); i += 8 { copy(buf[:], recompMapPacked[i:i+8]) key := binary.BigEndian.Uint32(buf[:4]) val := binary.BigEndian.Uint32(buf[4:]) recompMap[key] = rune(val) } } // Recomposition // We use 32-bit keys instead of 64-bit for the two codepoint keys. // This clips off the bits of three entries, but we know this will not // result in a collision. In the unlikely event that changes to // UnicodeData.txt introduce collisions, the compiler will catch it. // Note that the recomposition map for NFC and NFKC are identical. // combine returns the combined rune or 0 if it doesn't exist. // // The caller is responsible for calling // recompMapOnce.Do(buildRecompMap) sometime before this is called. func combine(a, b rune) rune { key := uint32(uint16(a))<<16 + uint32(uint16(b)) if recompMap == nil { panic("caller error") // see func comment } return recompMap[key] } func lookupInfoNFC(b input, i int) Properties { v, sz := b.charinfoNFC(i) return compInfo(v, sz) } func lookupInfoNFKC(b input, i int) Properties { v, sz := b.charinfoNFKC(i) return compInfo(v, sz) } // Properties returns properties for the first rune in s. func (f Form) Properties(s []byte) Properties { if f == NFC || f == NFD { return compInfo(nfcData.lookup(s)) } return compInfo(nfkcData.lookup(s)) } // PropertiesString returns properties for the first rune in s. func (f Form) PropertiesString(s string) Properties { if f == NFC || f == NFD { return compInfo(nfcData.lookupString(s)) } return compInfo(nfkcData.lookupString(s)) } // compInfo converts the information contained in v and sz // to a Properties. See the comment at the top of the file // for more information on the format. func compInfo(v uint16, sz int) Properties { if v == 0 { return Properties{size: uint8(sz)} } else if v >= 0x8000 { p := Properties{ size: uint8(sz), ccc: uint8(v), tccc: uint8(v), flags: qcInfo(v >> 8), } if p.ccc > 0 || p.combinesBackward() { p.nLead = uint8(p.flags & 0x3) } return p } // has decomposition h := decomps[v] f := (qcInfo(h&headerFlagsMask) >> 2) | 0x4 p := Properties{size: uint8(sz), flags: f, index: v} if v >= firstCCC { n := uint16(h & headerLenMask) if n == 31 { n = 33 } v += n + 1 c := decomps[v] p.tccc = c >> 2 p.flags |= qcInfo(c & 0x3) if v >= firstLeadingCCC { p.nLead = c & 0x3 if v >= firstStarterWithNLead { // We were tricked. Remove the decomposition. p.flags &= 0x03 p.index = 0 return p } p.ccc = decomps[v+1] } } return p } ================================================ FILE: vendor/golang.org/x/text/unicode/norm/input.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package norm import "unicode/utf8" type input struct { str string bytes []byte } func inputBytes(str []byte) input { return input{bytes: str} } func inputString(str string) input { return input{str: str} } func (in *input) setBytes(str []byte) { in.str = "" in.bytes = str } func (in *input) setString(str string) { in.str = str in.bytes = nil } func (in *input) _byte(p int) byte { if in.bytes == nil { return in.str[p] } return in.bytes[p] } func (in *input) skipASCII(p, max int) int { if in.bytes == nil { for ; p < max && in.str[p] < utf8.RuneSelf; p++ { } } else { for ; p < max && in.bytes[p] < utf8.RuneSelf; p++ { } } return p } func (in *input) skipContinuationBytes(p int) int { if in.bytes == nil { for ; p < len(in.str) && !utf8.RuneStart(in.str[p]); p++ { } } else { for ; p < len(in.bytes) && !utf8.RuneStart(in.bytes[p]); p++ { } } return p } func (in *input) appendSlice(buf []byte, b, e int) []byte { if in.bytes != nil { return append(buf, in.bytes[b:e]...) } for i := b; i < e; i++ { buf = append(buf, in.str[i]) } return buf } func (in *input) copySlice(buf []byte, b, e int) int { if in.bytes == nil { return copy(buf, in.str[b:e]) } return copy(buf, in.bytes[b:e]) } func (in *input) charinfoNFC(p int) (uint16, int) { if in.bytes == nil { return nfcData.lookupString(in.str[p:]) } return nfcData.lookup(in.bytes[p:]) } func (in *input) charinfoNFKC(p int) (uint16, int) { if in.bytes == nil { return nfkcData.lookupString(in.str[p:]) } return nfkcData.lookup(in.bytes[p:]) } func (in *input) hangul(p int) (r rune) { var size int if in.bytes == nil { if !isHangulString(in.str[p:]) { return 0 } r, size = utf8.DecodeRuneInString(in.str[p:]) } else { if !isHangul(in.bytes[p:]) { return 0 } r, size = utf8.DecodeRune(in.bytes[p:]) } if size != hangulUTF8Size { return 0 } return r } ================================================ FILE: vendor/golang.org/x/text/unicode/norm/iter.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package norm import ( "fmt" "unicode/utf8" ) // MaxSegmentSize is the maximum size of a byte buffer needed to consider any // sequence of starter and non-starter runes for the purpose of normalization. const MaxSegmentSize = maxByteBufferSize // An Iter iterates over a string or byte slice, while normalizing it // to a given Form. type Iter struct { rb reorderBuffer buf [maxByteBufferSize]byte info Properties // first character saved from previous iteration next iterFunc // implementation of next depends on form asciiF iterFunc p int // current position in input source multiSeg []byte // remainder of multi-segment decomposition } type iterFunc func(*Iter) []byte // Init initializes i to iterate over src after normalizing it to Form f. func (i *Iter) Init(f Form, src []byte) { i.p = 0 if len(src) == 0 { i.setDone() i.rb.nsrc = 0 return } i.multiSeg = nil i.rb.init(f, src) i.next = i.rb.f.nextMain i.asciiF = nextASCIIBytes i.info = i.rb.f.info(i.rb.src, i.p) i.rb.ss.first(i.info) } // InitString initializes i to iterate over src after normalizing it to Form f. func (i *Iter) InitString(f Form, src string) { i.p = 0 if len(src) == 0 { i.setDone() i.rb.nsrc = 0 return } i.multiSeg = nil i.rb.initString(f, src) i.next = i.rb.f.nextMain i.asciiF = nextASCIIString i.info = i.rb.f.info(i.rb.src, i.p) i.rb.ss.first(i.info) } // Seek sets the segment to be returned by the next call to Next to start // at position p. It is the responsibility of the caller to set p to the // start of a segment. func (i *Iter) Seek(offset int64, whence int) (int64, error) { var abs int64 switch whence { case 0: abs = offset case 1: abs = int64(i.p) + offset case 2: abs = int64(i.rb.nsrc) + offset default: return 0, fmt.Errorf("norm: invalid whence") } if abs < 0 { return 0, fmt.Errorf("norm: negative position") } if int(abs) >= i.rb.nsrc { i.setDone() return int64(i.p), nil } i.p = int(abs) i.multiSeg = nil i.next = i.rb.f.nextMain i.info = i.rb.f.info(i.rb.src, i.p) i.rb.ss.first(i.info) return abs, nil } // returnSlice returns a slice of the underlying input type as a byte slice. // If the underlying is of type []byte, it will simply return a slice. // If the underlying is of type string, it will copy the slice to the buffer // and return that. func (i *Iter) returnSlice(a, b int) []byte { if i.rb.src.bytes == nil { return i.buf[:copy(i.buf[:], i.rb.src.str[a:b])] } return i.rb.src.bytes[a:b] } // Pos returns the byte position at which the next call to Next will commence processing. func (i *Iter) Pos() int { return i.p } func (i *Iter) setDone() { i.next = nextDone i.p = i.rb.nsrc } // Done returns true if there is no more input to process. func (i *Iter) Done() bool { return i.p >= i.rb.nsrc } // Next returns f(i.input[i.Pos():n]), where n is a boundary of i.input. // For any input a and b for which f(a) == f(b), subsequent calls // to Next will return the same segments. // Modifying runes are grouped together with the preceding starter, if such a starter exists. // Although not guaranteed, n will typically be the smallest possible n. func (i *Iter) Next() []byte { return i.next(i) } func nextASCIIBytes(i *Iter) []byte { p := i.p + 1 if p >= i.rb.nsrc { p0 := i.p i.setDone() return i.rb.src.bytes[p0:p] } if i.rb.src.bytes[p] < utf8.RuneSelf { p0 := i.p i.p = p return i.rb.src.bytes[p0:p] } i.info = i.rb.f.info(i.rb.src, i.p) i.next = i.rb.f.nextMain return i.next(i) } func nextASCIIString(i *Iter) []byte { p := i.p + 1 if p >= i.rb.nsrc { i.buf[0] = i.rb.src.str[i.p] i.setDone() return i.buf[:1] } if i.rb.src.str[p] < utf8.RuneSelf { i.buf[0] = i.rb.src.str[i.p] i.p = p return i.buf[:1] } i.info = i.rb.f.info(i.rb.src, i.p) i.next = i.rb.f.nextMain return i.next(i) } func nextHangul(i *Iter) []byte { p := i.p next := p + hangulUTF8Size if next >= i.rb.nsrc { i.setDone() } else if i.rb.src.hangul(next) == 0 { i.rb.ss.next(i.info) i.info = i.rb.f.info(i.rb.src, i.p) i.next = i.rb.f.nextMain return i.next(i) } i.p = next return i.buf[:decomposeHangul(i.buf[:], i.rb.src.hangul(p))] } func nextDone(i *Iter) []byte { return nil } // nextMulti is used for iterating over multi-segment decompositions // for decomposing normal forms. func nextMulti(i *Iter) []byte { j := 0 d := i.multiSeg // skip first rune for j = 1; j < len(d) && !utf8.RuneStart(d[j]); j++ { } for j < len(d) { info := i.rb.f.info(input{bytes: d}, j) if info.BoundaryBefore() { i.multiSeg = d[j:] return d[:j] } j += int(info.size) } // treat last segment as normal decomposition i.next = i.rb.f.nextMain return i.next(i) } // nextMultiNorm is used for iterating over multi-segment decompositions // for composing normal forms. func nextMultiNorm(i *Iter) []byte { j := 0 d := i.multiSeg for j < len(d) { info := i.rb.f.info(input{bytes: d}, j) if info.BoundaryBefore() { i.rb.compose() seg := i.buf[:i.rb.flushCopy(i.buf[:])] i.rb.insertUnsafe(input{bytes: d}, j, info) i.multiSeg = d[j+int(info.size):] return seg } i.rb.insertUnsafe(input{bytes: d}, j, info) j += int(info.size) } i.multiSeg = nil i.next = nextComposed return doNormComposed(i) } // nextDecomposed is the implementation of Next for forms NFD and NFKD. func nextDecomposed(i *Iter) (next []byte) { outp := 0 inCopyStart, outCopyStart := i.p, 0 for { if sz := int(i.info.size); sz <= 1 { i.rb.ss = 0 p := i.p i.p++ // ASCII or illegal byte. Either way, advance by 1. if i.p >= i.rb.nsrc { i.setDone() return i.returnSlice(p, i.p) } else if i.rb.src._byte(i.p) < utf8.RuneSelf { i.next = i.asciiF return i.returnSlice(p, i.p) } outp++ } else if d := i.info.Decomposition(); d != nil { // Note: If leading CCC != 0, then len(d) == 2 and last is also non-zero. // Case 1: there is a leftover to copy. In this case the decomposition // must begin with a modifier and should always be appended. // Case 2: no leftover. Simply return d if followed by a ccc == 0 value. p := outp + len(d) if outp > 0 { i.rb.src.copySlice(i.buf[outCopyStart:], inCopyStart, i.p) // TODO: this condition should not be possible, but we leave it // in for defensive purposes. if p > len(i.buf) { return i.buf[:outp] } } else if i.info.multiSegment() { // outp must be 0 as multi-segment decompositions always // start a new segment. if i.multiSeg == nil { i.multiSeg = d i.next = nextMulti return nextMulti(i) } // We are in the last segment. Treat as normal decomposition. d = i.multiSeg i.multiSeg = nil p = len(d) } prevCC := i.info.tccc if i.p += sz; i.p >= i.rb.nsrc { i.setDone() i.info = Properties{} // Force BoundaryBefore to succeed. } else { i.info = i.rb.f.info(i.rb.src, i.p) } switch i.rb.ss.next(i.info) { case ssOverflow: i.next = nextCGJDecompose fallthrough case ssStarter: if outp > 0 { copy(i.buf[outp:], d) return i.buf[:p] } return d } copy(i.buf[outp:], d) outp = p inCopyStart, outCopyStart = i.p, outp if i.info.ccc < prevCC { goto doNorm } continue } else if r := i.rb.src.hangul(i.p); r != 0 { outp = decomposeHangul(i.buf[:], r) i.p += hangulUTF8Size inCopyStart, outCopyStart = i.p, outp if i.p >= i.rb.nsrc { i.setDone() break } else if i.rb.src.hangul(i.p) != 0 { i.next = nextHangul return i.buf[:outp] } } else { p := outp + sz if p > len(i.buf) { break } outp = p i.p += sz } if i.p >= i.rb.nsrc { i.setDone() break } prevCC := i.info.tccc i.info = i.rb.f.info(i.rb.src, i.p) if v := i.rb.ss.next(i.info); v == ssStarter { break } else if v == ssOverflow { i.next = nextCGJDecompose break } if i.info.ccc < prevCC { goto doNorm } } if outCopyStart == 0 { return i.returnSlice(inCopyStart, i.p) } else if inCopyStart < i.p { i.rb.src.copySlice(i.buf[outCopyStart:], inCopyStart, i.p) } return i.buf[:outp] doNorm: // Insert what we have decomposed so far in the reorderBuffer. // As we will only reorder, there will always be enough room. i.rb.src.copySlice(i.buf[outCopyStart:], inCopyStart, i.p) i.rb.insertDecomposed(i.buf[0:outp]) return doNormDecomposed(i) } func doNormDecomposed(i *Iter) []byte { for { i.rb.insertUnsafe(i.rb.src, i.p, i.info) if i.p += int(i.info.size); i.p >= i.rb.nsrc { i.setDone() break } i.info = i.rb.f.info(i.rb.src, i.p) if i.info.ccc == 0 { break } if s := i.rb.ss.next(i.info); s == ssOverflow { i.next = nextCGJDecompose break } } // new segment or too many combining characters: exit normalization return i.buf[:i.rb.flushCopy(i.buf[:])] } func nextCGJDecompose(i *Iter) []byte { i.rb.ss = 0 i.rb.insertCGJ() i.next = nextDecomposed i.rb.ss.first(i.info) buf := doNormDecomposed(i) return buf } // nextComposed is the implementation of Next for forms NFC and NFKC. func nextComposed(i *Iter) []byte { outp, startp := 0, i.p var prevCC uint8 for { if !i.info.isYesC() { goto doNorm } prevCC = i.info.tccc sz := int(i.info.size) if sz == 0 { sz = 1 // illegal rune: copy byte-by-byte } p := outp + sz if p > len(i.buf) { break } outp = p i.p += sz if i.p >= i.rb.nsrc { i.setDone() break } else if i.rb.src._byte(i.p) < utf8.RuneSelf { i.rb.ss = 0 i.next = i.asciiF break } i.info = i.rb.f.info(i.rb.src, i.p) if v := i.rb.ss.next(i.info); v == ssStarter { break } else if v == ssOverflow { i.next = nextCGJCompose break } if i.info.ccc < prevCC { goto doNorm } } return i.returnSlice(startp, i.p) doNorm: // reset to start position i.p = startp i.info = i.rb.f.info(i.rb.src, i.p) i.rb.ss.first(i.info) if i.info.multiSegment() { d := i.info.Decomposition() info := i.rb.f.info(input{bytes: d}, 0) i.rb.insertUnsafe(input{bytes: d}, 0, info) i.multiSeg = d[int(info.size):] i.next = nextMultiNorm return nextMultiNorm(i) } i.rb.ss.first(i.info) i.rb.insertUnsafe(i.rb.src, i.p, i.info) return doNormComposed(i) } func doNormComposed(i *Iter) []byte { // First rune should already be inserted. for { if i.p += int(i.info.size); i.p >= i.rb.nsrc { i.setDone() break } i.info = i.rb.f.info(i.rb.src, i.p) if s := i.rb.ss.next(i.info); s == ssStarter { break } else if s == ssOverflow { i.next = nextCGJCompose break } i.rb.insertUnsafe(i.rb.src, i.p, i.info) } i.rb.compose() seg := i.buf[:i.rb.flushCopy(i.buf[:])] return seg } func nextCGJCompose(i *Iter) []byte { i.rb.ss = 0 // instead of first i.rb.insertCGJ() i.next = nextComposed // Note that we treat any rune with nLeadingNonStarters > 0 as a non-starter, // even if they are not. This is particularly dubious for U+FF9E and UFF9A. // If we ever change that, insert a check here. i.rb.ss.first(i.info) i.rb.insertUnsafe(i.rb.src, i.p, i.info) return doNormComposed(i) } ================================================ FILE: vendor/golang.org/x/text/unicode/norm/normalize.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Note: the file data_test.go that is generated should not be checked in. //go:generate go run maketables.go triegen.go //go:generate go test -tags test // Package norm contains types and functions for normalizing Unicode strings. package norm // import "golang.org/x/text/unicode/norm" import ( "unicode/utf8" "golang.org/x/text/transform" ) // A Form denotes a canonical representation of Unicode code points. // The Unicode-defined normalization and equivalence forms are: // // NFC Unicode Normalization Form C // NFD Unicode Normalization Form D // NFKC Unicode Normalization Form KC // NFKD Unicode Normalization Form KD // // For a Form f, this documentation uses the notation f(x) to mean // the bytes or string x converted to the given form. // A position n in x is called a boundary if conversion to the form can // proceed independently on both sides: // // f(x) == append(f(x[0:n]), f(x[n:])...) // // References: https://unicode.org/reports/tr15/ and // https://unicode.org/notes/tn5/. type Form int const ( NFC Form = iota NFD NFKC NFKD ) // Bytes returns f(b). May return b if f(b) = b. func (f Form) Bytes(b []byte) []byte { src := inputBytes(b) ft := formTable[f] n, ok := ft.quickSpan(src, 0, len(b), true) if ok { return b } out := make([]byte, n, len(b)) copy(out, b[0:n]) rb := reorderBuffer{f: *ft, src: src, nsrc: len(b), out: out, flushF: appendFlush} return doAppendInner(&rb, n) } // String returns f(s). func (f Form) String(s string) string { src := inputString(s) ft := formTable[f] n, ok := ft.quickSpan(src, 0, len(s), true) if ok { return s } out := make([]byte, n, len(s)) copy(out, s[0:n]) rb := reorderBuffer{f: *ft, src: src, nsrc: len(s), out: out, flushF: appendFlush} return string(doAppendInner(&rb, n)) } // IsNormal returns true if b == f(b). func (f Form) IsNormal(b []byte) bool { src := inputBytes(b) ft := formTable[f] bp, ok := ft.quickSpan(src, 0, len(b), true) if ok { return true } rb := reorderBuffer{f: *ft, src: src, nsrc: len(b)} rb.setFlusher(nil, cmpNormalBytes) for bp < len(b) { rb.out = b[bp:] if bp = decomposeSegment(&rb, bp, true); bp < 0 { return false } bp, _ = rb.f.quickSpan(rb.src, bp, len(b), true) } return true } func cmpNormalBytes(rb *reorderBuffer) bool { b := rb.out for i := 0; i < rb.nrune; i++ { info := rb.rune[i] if int(info.size) > len(b) { return false } p := info.pos pe := p + info.size for ; p < pe; p++ { if b[0] != rb.byte[p] { return false } b = b[1:] } } return true } // IsNormalString returns true if s == f(s). func (f Form) IsNormalString(s string) bool { src := inputString(s) ft := formTable[f] bp, ok := ft.quickSpan(src, 0, len(s), true) if ok { return true } rb := reorderBuffer{f: *ft, src: src, nsrc: len(s)} rb.setFlusher(nil, func(rb *reorderBuffer) bool { for i := 0; i < rb.nrune; i++ { info := rb.rune[i] if bp+int(info.size) > len(s) { return false } p := info.pos pe := p + info.size for ; p < pe; p++ { if s[bp] != rb.byte[p] { return false } bp++ } } return true }) for bp < len(s) { if bp = decomposeSegment(&rb, bp, true); bp < 0 { return false } bp, _ = rb.f.quickSpan(rb.src, bp, len(s), true) } return true } // patchTail fixes a case where a rune may be incorrectly normalized // if it is followed by illegal continuation bytes. It returns the // patched buffer and whether the decomposition is still in progress. func patchTail(rb *reorderBuffer) bool { info, p := lastRuneStart(&rb.f, rb.out) if p == -1 || info.size == 0 { return true } end := p + int(info.size) extra := len(rb.out) - end if extra > 0 { // Potentially allocating memory. However, this only // happens with ill-formed UTF-8. x := make([]byte, 0) x = append(x, rb.out[len(rb.out)-extra:]...) rb.out = rb.out[:end] decomposeToLastBoundary(rb) rb.doFlush() rb.out = append(rb.out, x...) return false } buf := rb.out[p:] rb.out = rb.out[:p] decomposeToLastBoundary(rb) if s := rb.ss.next(info); s == ssStarter { rb.doFlush() rb.ss.first(info) } else if s == ssOverflow { rb.doFlush() rb.insertCGJ() rb.ss = 0 } rb.insertUnsafe(inputBytes(buf), 0, info) return true } func appendQuick(rb *reorderBuffer, i int) int { if rb.nsrc == i { return i } end, _ := rb.f.quickSpan(rb.src, i, rb.nsrc, true) rb.out = rb.src.appendSlice(rb.out, i, end) return end } // Append returns f(append(out, b...)). // The buffer out must be nil, empty, or equal to f(out). func (f Form) Append(out []byte, src ...byte) []byte { return f.doAppend(out, inputBytes(src), len(src)) } func (f Form) doAppend(out []byte, src input, n int) []byte { if n == 0 { return out } ft := formTable[f] // Attempt to do a quickSpan first so we can avoid initializing the reorderBuffer. if len(out) == 0 { p, _ := ft.quickSpan(src, 0, n, true) out = src.appendSlice(out, 0, p) if p == n { return out } rb := reorderBuffer{f: *ft, src: src, nsrc: n, out: out, flushF: appendFlush} return doAppendInner(&rb, p) } rb := reorderBuffer{f: *ft, src: src, nsrc: n} return doAppend(&rb, out, 0) } func doAppend(rb *reorderBuffer, out []byte, p int) []byte { rb.setFlusher(out, appendFlush) src, n := rb.src, rb.nsrc doMerge := len(out) > 0 if q := src.skipContinuationBytes(p); q > p { // Move leading non-starters to destination. rb.out = src.appendSlice(rb.out, p, q) p = q doMerge = patchTail(rb) } fd := &rb.f if doMerge { var info Properties if p < n { info = fd.info(src, p) if !info.BoundaryBefore() || info.nLeadingNonStarters() > 0 { if p == 0 { decomposeToLastBoundary(rb) } p = decomposeSegment(rb, p, true) } } if info.size == 0 { rb.doFlush() // Append incomplete UTF-8 encoding. return src.appendSlice(rb.out, p, n) } if rb.nrune > 0 { return doAppendInner(rb, p) } } p = appendQuick(rb, p) return doAppendInner(rb, p) } func doAppendInner(rb *reorderBuffer, p int) []byte { for n := rb.nsrc; p < n; { p = decomposeSegment(rb, p, true) p = appendQuick(rb, p) } return rb.out } // AppendString returns f(append(out, []byte(s))). // The buffer out must be nil, empty, or equal to f(out). func (f Form) AppendString(out []byte, src string) []byte { return f.doAppend(out, inputString(src), len(src)) } // QuickSpan returns a boundary n such that b[0:n] == f(b[0:n]). // It is not guaranteed to return the largest such n. func (f Form) QuickSpan(b []byte) int { n, _ := formTable[f].quickSpan(inputBytes(b), 0, len(b), true) return n } // Span implements transform.SpanningTransformer. It returns a boundary n such // that b[0:n] == f(b[0:n]). It is not guaranteed to return the largest such n. func (f Form) Span(b []byte, atEOF bool) (n int, err error) { n, ok := formTable[f].quickSpan(inputBytes(b), 0, len(b), atEOF) if n < len(b) { if !ok { err = transform.ErrEndOfSpan } else { err = transform.ErrShortSrc } } return n, err } // SpanString returns a boundary n such that s[0:n] == f(s[0:n]). // It is not guaranteed to return the largest such n. func (f Form) SpanString(s string, atEOF bool) (n int, err error) { n, ok := formTable[f].quickSpan(inputString(s), 0, len(s), atEOF) if n < len(s) { if !ok { err = transform.ErrEndOfSpan } else { err = transform.ErrShortSrc } } return n, err } // quickSpan returns a boundary n such that src[0:n] == f(src[0:n]) and // whether any non-normalized parts were found. If atEOF is false, n will // not point past the last segment if this segment might be become // non-normalized by appending other runes. func (f *formInfo) quickSpan(src input, i, end int, atEOF bool) (n int, ok bool) { var lastCC uint8 ss := streamSafe(0) lastSegStart := i for n = end; i < n; { if j := src.skipASCII(i, n); i != j { i = j lastSegStart = i - 1 lastCC = 0 ss = 0 continue } info := f.info(src, i) if info.size == 0 { if atEOF { // include incomplete runes return n, true } return lastSegStart, true } // This block needs to be before the next, because it is possible to // have an overflow for runes that are starters (e.g. with U+FF9E). switch ss.next(info) { case ssStarter: lastSegStart = i case ssOverflow: return lastSegStart, false case ssSuccess: if lastCC > info.ccc { return lastSegStart, false } } if f.composing { if !info.isYesC() { break } } else { if !info.isYesD() { break } } lastCC = info.ccc i += int(info.size) } if i == n { if !atEOF { n = lastSegStart } return n, true } return lastSegStart, false } // QuickSpanString returns a boundary n such that s[0:n] == f(s[0:n]). // It is not guaranteed to return the largest such n. func (f Form) QuickSpanString(s string) int { n, _ := formTable[f].quickSpan(inputString(s), 0, len(s), true) return n } // FirstBoundary returns the position i of the first boundary in b // or -1 if b contains no boundary. func (f Form) FirstBoundary(b []byte) int { return f.firstBoundary(inputBytes(b), len(b)) } func (f Form) firstBoundary(src input, nsrc int) int { i := src.skipContinuationBytes(0) if i >= nsrc { return -1 } fd := formTable[f] ss := streamSafe(0) // We should call ss.first here, but we can't as the first rune is // skipped already. This means FirstBoundary can't really determine // CGJ insertion points correctly. Luckily it doesn't have to. for { info := fd.info(src, i) if info.size == 0 { return -1 } if s := ss.next(info); s != ssSuccess { return i } i += int(info.size) if i >= nsrc { if !info.BoundaryAfter() && !ss.isMax() { return -1 } return nsrc } } } // FirstBoundaryInString returns the position i of the first boundary in s // or -1 if s contains no boundary. func (f Form) FirstBoundaryInString(s string) int { return f.firstBoundary(inputString(s), len(s)) } // NextBoundary reports the index of the boundary between the first and next // segment in b or -1 if atEOF is false and there are not enough bytes to // determine this boundary. func (f Form) NextBoundary(b []byte, atEOF bool) int { return f.nextBoundary(inputBytes(b), len(b), atEOF) } // NextBoundaryInString reports the index of the boundary between the first and // next segment in b or -1 if atEOF is false and there are not enough bytes to // determine this boundary. func (f Form) NextBoundaryInString(s string, atEOF bool) int { return f.nextBoundary(inputString(s), len(s), atEOF) } func (f Form) nextBoundary(src input, nsrc int, atEOF bool) int { if nsrc == 0 { if atEOF { return 0 } return -1 } fd := formTable[f] info := fd.info(src, 0) if info.size == 0 { if atEOF { return 1 } return -1 } ss := streamSafe(0) ss.first(info) for i := int(info.size); i < nsrc; i += int(info.size) { info = fd.info(src, i) if info.size == 0 { if atEOF { return i } return -1 } // TODO: Using streamSafe to determine the boundary isn't the same as // using BoundaryBefore. Determine which should be used. if s := ss.next(info); s != ssSuccess { return i } } if !atEOF && !info.BoundaryAfter() && !ss.isMax() { return -1 } return nsrc } // LastBoundary returns the position i of the last boundary in b // or -1 if b contains no boundary. func (f Form) LastBoundary(b []byte) int { return lastBoundary(formTable[f], b) } func lastBoundary(fd *formInfo, b []byte) int { i := len(b) info, p := lastRuneStart(fd, b) if p == -1 { return -1 } if info.size == 0 { // ends with incomplete rune if p == 0 { // starts with incomplete rune return -1 } i = p info, p = lastRuneStart(fd, b[:i]) if p == -1 { // incomplete UTF-8 encoding or non-starter bytes without a starter return i } } if p+int(info.size) != i { // trailing non-starter bytes: illegal UTF-8 return i } if info.BoundaryAfter() { return i } ss := streamSafe(0) v := ss.backwards(info) for i = p; i >= 0 && v != ssStarter; i = p { info, p = lastRuneStart(fd, b[:i]) if v = ss.backwards(info); v == ssOverflow { break } if p+int(info.size) != i { if p == -1 { // no boundary found return -1 } return i // boundary after an illegal UTF-8 encoding } } return i } // decomposeSegment scans the first segment in src into rb. It inserts 0x034f // (Grapheme Joiner) when it encounters a sequence of more than 30 non-starters // and returns the number of bytes consumed from src or iShortDst or iShortSrc. func decomposeSegment(rb *reorderBuffer, sp int, atEOF bool) int { // Force one character to be consumed. info := rb.f.info(rb.src, sp) if info.size == 0 { return 0 } if s := rb.ss.next(info); s == ssStarter { // TODO: this could be removed if we don't support merging. if rb.nrune > 0 { goto end } } else if s == ssOverflow { rb.insertCGJ() goto end } if err := rb.insertFlush(rb.src, sp, info); err != iSuccess { return int(err) } for { sp += int(info.size) if sp >= rb.nsrc { if !atEOF && !info.BoundaryAfter() { return int(iShortSrc) } break } info = rb.f.info(rb.src, sp) if info.size == 0 { if !atEOF { return int(iShortSrc) } break } if s := rb.ss.next(info); s == ssStarter { break } else if s == ssOverflow { rb.insertCGJ() break } if err := rb.insertFlush(rb.src, sp, info); err != iSuccess { return int(err) } } end: if !rb.doFlush() { return int(iShortDst) } return sp } // lastRuneStart returns the runeInfo and position of the last // rune in buf or the zero runeInfo and -1 if no rune was found. func lastRuneStart(fd *formInfo, buf []byte) (Properties, int) { p := len(buf) - 1 for ; p >= 0 && !utf8.RuneStart(buf[p]); p-- { } if p < 0 { return Properties{}, -1 } return fd.info(inputBytes(buf), p), p } // decomposeToLastBoundary finds an open segment at the end of the buffer // and scans it into rb. Returns the buffer minus the last segment. func decomposeToLastBoundary(rb *reorderBuffer) { fd := &rb.f info, i := lastRuneStart(fd, rb.out) if int(info.size) != len(rb.out)-i { // illegal trailing continuation bytes return } if info.BoundaryAfter() { return } var add [maxNonStarters + 1]Properties // stores runeInfo in reverse order padd := 0 ss := streamSafe(0) p := len(rb.out) for { add[padd] = info v := ss.backwards(info) if v == ssOverflow { // Note that if we have an overflow, it the string we are appending to // is not correctly normalized. In this case the behavior is undefined. break } padd++ p -= int(info.size) if v == ssStarter || p < 0 { break } info, i = lastRuneStart(fd, rb.out[:p]) if int(info.size) != p-i { break } } rb.ss = ss // Copy bytes for insertion as we may need to overwrite rb.out. var buf [maxBufferSize * utf8.UTFMax]byte cp := buf[:copy(buf[:], rb.out[p:])] rb.out = rb.out[:p] for padd--; padd >= 0; padd-- { info = add[padd] rb.insertUnsafe(inputBytes(cp), 0, info) cp = cp[info.size:] } } ================================================ FILE: vendor/golang.org/x/text/unicode/norm/readwriter.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package norm import "io" type normWriter struct { rb reorderBuffer w io.Writer buf []byte } // Write implements the standard write interface. If the last characters are // not at a normalization boundary, the bytes will be buffered for the next // write. The remaining bytes will be written on close. func (w *normWriter) Write(data []byte) (n int, err error) { // Process data in pieces to keep w.buf size bounded. const chunk = 4000 for len(data) > 0 { // Normalize into w.buf. m := len(data) if m > chunk { m = chunk } w.rb.src = inputBytes(data[:m]) w.rb.nsrc = m w.buf = doAppend(&w.rb, w.buf, 0) data = data[m:] n += m // Write out complete prefix, save remainder. // Note that lastBoundary looks back at most 31 runes. i := lastBoundary(&w.rb.f, w.buf) if i == -1 { i = 0 } if i > 0 { if _, err = w.w.Write(w.buf[:i]); err != nil { break } bn := copy(w.buf, w.buf[i:]) w.buf = w.buf[:bn] } } return n, err } // Close forces data that remains in the buffer to be written. func (w *normWriter) Close() error { if len(w.buf) > 0 { _, err := w.w.Write(w.buf) if err != nil { return err } } return nil } // Writer returns a new writer that implements Write(b) // by writing f(b) to w. The returned writer may use an // internal buffer to maintain state across Write calls. // Calling its Close method writes any buffered data to w. func (f Form) Writer(w io.Writer) io.WriteCloser { wr := &normWriter{rb: reorderBuffer{}, w: w} wr.rb.init(f, nil) return wr } type normReader struct { rb reorderBuffer r io.Reader inbuf []byte outbuf []byte bufStart int lastBoundary int err error } // Read implements the standard read interface. func (r *normReader) Read(p []byte) (int, error) { for { if r.lastBoundary-r.bufStart > 0 { n := copy(p, r.outbuf[r.bufStart:r.lastBoundary]) r.bufStart += n if r.lastBoundary-r.bufStart > 0 { return n, nil } return n, r.err } if r.err != nil { return 0, r.err } outn := copy(r.outbuf, r.outbuf[r.lastBoundary:]) r.outbuf = r.outbuf[0:outn] r.bufStart = 0 n, err := r.r.Read(r.inbuf) r.rb.src = inputBytes(r.inbuf[0:n]) r.rb.nsrc, r.err = n, err if n > 0 { r.outbuf = doAppend(&r.rb, r.outbuf, 0) } if err == io.EOF { r.lastBoundary = len(r.outbuf) } else { r.lastBoundary = lastBoundary(&r.rb.f, r.outbuf) if r.lastBoundary == -1 { r.lastBoundary = 0 } } } } // Reader returns a new reader that implements Read // by reading data from r and returning f(data). func (f Form) Reader(r io.Reader) io.Reader { const chunk = 4000 buf := make([]byte, chunk) rr := &normReader{rb: reorderBuffer{}, r: r, inbuf: buf} rr.rb.init(f, buf) return rr } ================================================ FILE: vendor/golang.org/x/text/unicode/norm/tables15.0.0.go ================================================ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. //go:build !go1.27 package norm import "sync" const ( // Version is the Unicode edition from which the tables are derived. Version = "15.0.0" // MaxTransformChunkSize indicates the maximum number of bytes that Transform // may need to write atomically for any Form. Making a destination buffer at // least this size ensures that Transform can always make progress and that // the user does not need to grow the buffer on an ErrShortDst. MaxTransformChunkSize = 35 + maxNonStarters*4 ) var ccc = [56]uint8{ 0, 1, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 84, 91, 103, 107, 118, 122, 129, 130, 132, 202, 214, 216, 218, 220, 222, 224, 226, 228, 230, 232, 233, 234, 240, } const ( firstMulti = 0x199A firstCCC = 0x2DD5 endMulti = 0x2EBF firstLeadingCCC = 0x4AEF firstCCCZeroExcept = 0x4BB9 firstStarterWithNLead = 0x4BE0 lastDecomp = 0x4BE2 maxDecomp = 0x8000 ) // decomps: 19426 bytes var decomps = [...]byte{ // Bytes 0 - 3f 0x00, 0x41, 0x20, 0x41, 0x21, 0x41, 0x22, 0x41, 0x23, 0x41, 0x24, 0x41, 0x25, 0x41, 0x26, 0x41, 0x27, 0x41, 0x28, 0x41, 0x29, 0x41, 0x2A, 0x41, 0x2B, 0x41, 0x2C, 0x41, 0x2D, 0x41, 0x2E, 0x41, 0x2F, 0x41, 0x30, 0x41, 0x31, 0x41, 0x32, 0x41, 0x33, 0x41, 0x34, 0x41, 0x35, 0x41, 0x36, 0x41, 0x37, 0x41, 0x38, 0x41, 0x39, 0x41, 0x3A, 0x41, 0x3B, 0x41, 0x3C, 0x41, 0x3D, 0x41, 0x3E, 0x41, // Bytes 40 - 7f 0x3F, 0x41, 0x40, 0x41, 0x41, 0x41, 0x42, 0x41, 0x43, 0x41, 0x44, 0x41, 0x45, 0x41, 0x46, 0x41, 0x47, 0x41, 0x48, 0x41, 0x49, 0x41, 0x4A, 0x41, 0x4B, 0x41, 0x4C, 0x41, 0x4D, 0x41, 0x4E, 0x41, 0x4F, 0x41, 0x50, 0x41, 0x51, 0x41, 0x52, 0x41, 0x53, 0x41, 0x54, 0x41, 0x55, 0x41, 0x56, 0x41, 0x57, 0x41, 0x58, 0x41, 0x59, 0x41, 0x5A, 0x41, 0x5B, 0x41, 0x5C, 0x41, 0x5D, 0x41, 0x5E, 0x41, // Bytes 80 - bf 0x5F, 0x41, 0x60, 0x41, 0x61, 0x41, 0x62, 0x41, 0x63, 0x41, 0x64, 0x41, 0x65, 0x41, 0x66, 0x41, 0x67, 0x41, 0x68, 0x41, 0x69, 0x41, 0x6A, 0x41, 0x6B, 0x41, 0x6C, 0x41, 0x6D, 0x41, 0x6E, 0x41, 0x6F, 0x41, 0x70, 0x41, 0x71, 0x41, 0x72, 0x41, 0x73, 0x41, 0x74, 0x41, 0x75, 0x41, 0x76, 0x41, 0x77, 0x41, 0x78, 0x41, 0x79, 0x41, 0x7A, 0x41, 0x7B, 0x41, 0x7C, 0x41, 0x7D, 0x41, 0x7E, 0x42, // Bytes c0 - ff 0xC2, 0xA2, 0x42, 0xC2, 0xA3, 0x42, 0xC2, 0xA5, 0x42, 0xC2, 0xA6, 0x42, 0xC2, 0xAC, 0x42, 0xC2, 0xB7, 0x42, 0xC3, 0x86, 0x42, 0xC3, 0xA6, 0x42, 0xC3, 0xB0, 0x42, 0xC3, 0xB8, 0x42, 0xC4, 0xA6, 0x42, 0xC4, 0xA7, 0x42, 0xC4, 0xB1, 0x42, 0xC5, 0x8B, 0x42, 0xC5, 0x93, 0x42, 0xC6, 0x8E, 0x42, 0xC6, 0x90, 0x42, 0xC6, 0xAB, 0x42, 0xC7, 0x80, 0x42, 0xC7, 0x81, 0x42, 0xC7, 0x82, 0x42, 0xC8, // Bytes 100 - 13f 0xA2, 0x42, 0xC8, 0xB7, 0x42, 0xC9, 0x90, 0x42, 0xC9, 0x91, 0x42, 0xC9, 0x92, 0x42, 0xC9, 0x93, 0x42, 0xC9, 0x94, 0x42, 0xC9, 0x95, 0x42, 0xC9, 0x96, 0x42, 0xC9, 0x97, 0x42, 0xC9, 0x98, 0x42, 0xC9, 0x99, 0x42, 0xC9, 0x9B, 0x42, 0xC9, 0x9C, 0x42, 0xC9, 0x9E, 0x42, 0xC9, 0x9F, 0x42, 0xC9, 0xA0, 0x42, 0xC9, 0xA1, 0x42, 0xC9, 0xA2, 0x42, 0xC9, 0xA3, 0x42, 0xC9, 0xA4, 0x42, 0xC9, 0xA5, // Bytes 140 - 17f 0x42, 0xC9, 0xA6, 0x42, 0xC9, 0xA7, 0x42, 0xC9, 0xA8, 0x42, 0xC9, 0xA9, 0x42, 0xC9, 0xAA, 0x42, 0xC9, 0xAB, 0x42, 0xC9, 0xAC, 0x42, 0xC9, 0xAD, 0x42, 0xC9, 0xAE, 0x42, 0xC9, 0xAF, 0x42, 0xC9, 0xB0, 0x42, 0xC9, 0xB1, 0x42, 0xC9, 0xB2, 0x42, 0xC9, 0xB3, 0x42, 0xC9, 0xB4, 0x42, 0xC9, 0xB5, 0x42, 0xC9, 0xB6, 0x42, 0xC9, 0xB7, 0x42, 0xC9, 0xB8, 0x42, 0xC9, 0xB9, 0x42, 0xC9, 0xBA, 0x42, // Bytes 180 - 1bf 0xC9, 0xBB, 0x42, 0xC9, 0xBD, 0x42, 0xC9, 0xBE, 0x42, 0xCA, 0x80, 0x42, 0xCA, 0x81, 0x42, 0xCA, 0x82, 0x42, 0xCA, 0x83, 0x42, 0xCA, 0x84, 0x42, 0xCA, 0x88, 0x42, 0xCA, 0x89, 0x42, 0xCA, 0x8A, 0x42, 0xCA, 0x8B, 0x42, 0xCA, 0x8C, 0x42, 0xCA, 0x8D, 0x42, 0xCA, 0x8E, 0x42, 0xCA, 0x8F, 0x42, 0xCA, 0x90, 0x42, 0xCA, 0x91, 0x42, 0xCA, 0x92, 0x42, 0xCA, 0x95, 0x42, 0xCA, 0x98, 0x42, 0xCA, // Bytes 1c0 - 1ff 0x99, 0x42, 0xCA, 0x9B, 0x42, 0xCA, 0x9C, 0x42, 0xCA, 0x9D, 0x42, 0xCA, 0x9F, 0x42, 0xCA, 0xA1, 0x42, 0xCA, 0xA2, 0x42, 0xCA, 0xA3, 0x42, 0xCA, 0xA4, 0x42, 0xCA, 0xA5, 0x42, 0xCA, 0xA6, 0x42, 0xCA, 0xA7, 0x42, 0xCA, 0xA8, 0x42, 0xCA, 0xA9, 0x42, 0xCA, 0xAA, 0x42, 0xCA, 0xAB, 0x42, 0xCA, 0xB9, 0x42, 0xCB, 0x90, 0x42, 0xCB, 0x91, 0x42, 0xCE, 0x91, 0x42, 0xCE, 0x92, 0x42, 0xCE, 0x93, // Bytes 200 - 23f 0x42, 0xCE, 0x94, 0x42, 0xCE, 0x95, 0x42, 0xCE, 0x96, 0x42, 0xCE, 0x97, 0x42, 0xCE, 0x98, 0x42, 0xCE, 0x99, 0x42, 0xCE, 0x9A, 0x42, 0xCE, 0x9B, 0x42, 0xCE, 0x9C, 0x42, 0xCE, 0x9D, 0x42, 0xCE, 0x9E, 0x42, 0xCE, 0x9F, 0x42, 0xCE, 0xA0, 0x42, 0xCE, 0xA1, 0x42, 0xCE, 0xA3, 0x42, 0xCE, 0xA4, 0x42, 0xCE, 0xA5, 0x42, 0xCE, 0xA6, 0x42, 0xCE, 0xA7, 0x42, 0xCE, 0xA8, 0x42, 0xCE, 0xA9, 0x42, // Bytes 240 - 27f 0xCE, 0xB1, 0x42, 0xCE, 0xB2, 0x42, 0xCE, 0xB3, 0x42, 0xCE, 0xB4, 0x42, 0xCE, 0xB5, 0x42, 0xCE, 0xB6, 0x42, 0xCE, 0xB7, 0x42, 0xCE, 0xB8, 0x42, 0xCE, 0xB9, 0x42, 0xCE, 0xBA, 0x42, 0xCE, 0xBB, 0x42, 0xCE, 0xBC, 0x42, 0xCE, 0xBD, 0x42, 0xCE, 0xBE, 0x42, 0xCE, 0xBF, 0x42, 0xCF, 0x80, 0x42, 0xCF, 0x81, 0x42, 0xCF, 0x82, 0x42, 0xCF, 0x83, 0x42, 0xCF, 0x84, 0x42, 0xCF, 0x85, 0x42, 0xCF, // Bytes 280 - 2bf 0x86, 0x42, 0xCF, 0x87, 0x42, 0xCF, 0x88, 0x42, 0xCF, 0x89, 0x42, 0xCF, 0x9C, 0x42, 0xCF, 0x9D, 0x42, 0xD0, 0xB0, 0x42, 0xD0, 0xB1, 0x42, 0xD0, 0xB2, 0x42, 0xD0, 0xB3, 0x42, 0xD0, 0xB4, 0x42, 0xD0, 0xB5, 0x42, 0xD0, 0xB6, 0x42, 0xD0, 0xB7, 0x42, 0xD0, 0xB8, 0x42, 0xD0, 0xBA, 0x42, 0xD0, 0xBB, 0x42, 0xD0, 0xBC, 0x42, 0xD0, 0xBD, 0x42, 0xD0, 0xBE, 0x42, 0xD0, 0xBF, 0x42, 0xD1, 0x80, // Bytes 2c0 - 2ff 0x42, 0xD1, 0x81, 0x42, 0xD1, 0x82, 0x42, 0xD1, 0x83, 0x42, 0xD1, 0x84, 0x42, 0xD1, 0x85, 0x42, 0xD1, 0x86, 0x42, 0xD1, 0x87, 0x42, 0xD1, 0x88, 0x42, 0xD1, 0x8A, 0x42, 0xD1, 0x8B, 0x42, 0xD1, 0x8C, 0x42, 0xD1, 0x8D, 0x42, 0xD1, 0x8E, 0x42, 0xD1, 0x95, 0x42, 0xD1, 0x96, 0x42, 0xD1, 0x98, 0x42, 0xD1, 0x9F, 0x42, 0xD2, 0x91, 0x42, 0xD2, 0xAB, 0x42, 0xD2, 0xAF, 0x42, 0xD2, 0xB1, 0x42, // Bytes 300 - 33f 0xD3, 0x8F, 0x42, 0xD3, 0x99, 0x42, 0xD3, 0xA9, 0x42, 0xD7, 0x90, 0x42, 0xD7, 0x91, 0x42, 0xD7, 0x92, 0x42, 0xD7, 0x93, 0x42, 0xD7, 0x94, 0x42, 0xD7, 0x9B, 0x42, 0xD7, 0x9C, 0x42, 0xD7, 0x9D, 0x42, 0xD7, 0xA2, 0x42, 0xD7, 0xA8, 0x42, 0xD7, 0xAA, 0x42, 0xD8, 0xA1, 0x42, 0xD8, 0xA7, 0x42, 0xD8, 0xA8, 0x42, 0xD8, 0xA9, 0x42, 0xD8, 0xAA, 0x42, 0xD8, 0xAB, 0x42, 0xD8, 0xAC, 0x42, 0xD8, // Bytes 340 - 37f 0xAD, 0x42, 0xD8, 0xAE, 0x42, 0xD8, 0xAF, 0x42, 0xD8, 0xB0, 0x42, 0xD8, 0xB1, 0x42, 0xD8, 0xB2, 0x42, 0xD8, 0xB3, 0x42, 0xD8, 0xB4, 0x42, 0xD8, 0xB5, 0x42, 0xD8, 0xB6, 0x42, 0xD8, 0xB7, 0x42, 0xD8, 0xB8, 0x42, 0xD8, 0xB9, 0x42, 0xD8, 0xBA, 0x42, 0xD9, 0x81, 0x42, 0xD9, 0x82, 0x42, 0xD9, 0x83, 0x42, 0xD9, 0x84, 0x42, 0xD9, 0x85, 0x42, 0xD9, 0x86, 0x42, 0xD9, 0x87, 0x42, 0xD9, 0x88, // Bytes 380 - 3bf 0x42, 0xD9, 0x89, 0x42, 0xD9, 0x8A, 0x42, 0xD9, 0xAE, 0x42, 0xD9, 0xAF, 0x42, 0xD9, 0xB1, 0x42, 0xD9, 0xB9, 0x42, 0xD9, 0xBA, 0x42, 0xD9, 0xBB, 0x42, 0xD9, 0xBE, 0x42, 0xD9, 0xBF, 0x42, 0xDA, 0x80, 0x42, 0xDA, 0x83, 0x42, 0xDA, 0x84, 0x42, 0xDA, 0x86, 0x42, 0xDA, 0x87, 0x42, 0xDA, 0x88, 0x42, 0xDA, 0x8C, 0x42, 0xDA, 0x8D, 0x42, 0xDA, 0x8E, 0x42, 0xDA, 0x91, 0x42, 0xDA, 0x98, 0x42, // Bytes 3c0 - 3ff 0xDA, 0xA1, 0x42, 0xDA, 0xA4, 0x42, 0xDA, 0xA6, 0x42, 0xDA, 0xA9, 0x42, 0xDA, 0xAD, 0x42, 0xDA, 0xAF, 0x42, 0xDA, 0xB1, 0x42, 0xDA, 0xB3, 0x42, 0xDA, 0xBA, 0x42, 0xDA, 0xBB, 0x42, 0xDA, 0xBE, 0x42, 0xDB, 0x81, 0x42, 0xDB, 0x85, 0x42, 0xDB, 0x86, 0x42, 0xDB, 0x87, 0x42, 0xDB, 0x88, 0x42, 0xDB, 0x89, 0x42, 0xDB, 0x8B, 0x42, 0xDB, 0x8C, 0x42, 0xDB, 0x90, 0x42, 0xDB, 0x92, 0x43, 0xE0, // Bytes 400 - 43f 0xBC, 0x8B, 0x43, 0xE1, 0x83, 0x9C, 0x43, 0xE1, 0x84, 0x80, 0x43, 0xE1, 0x84, 0x81, 0x43, 0xE1, 0x84, 0x82, 0x43, 0xE1, 0x84, 0x83, 0x43, 0xE1, 0x84, 0x84, 0x43, 0xE1, 0x84, 0x85, 0x43, 0xE1, 0x84, 0x86, 0x43, 0xE1, 0x84, 0x87, 0x43, 0xE1, 0x84, 0x88, 0x43, 0xE1, 0x84, 0x89, 0x43, 0xE1, 0x84, 0x8A, 0x43, 0xE1, 0x84, 0x8B, 0x43, 0xE1, 0x84, 0x8C, 0x43, 0xE1, 0x84, 0x8D, 0x43, 0xE1, // Bytes 440 - 47f 0x84, 0x8E, 0x43, 0xE1, 0x84, 0x8F, 0x43, 0xE1, 0x84, 0x90, 0x43, 0xE1, 0x84, 0x91, 0x43, 0xE1, 0x84, 0x92, 0x43, 0xE1, 0x84, 0x94, 0x43, 0xE1, 0x84, 0x95, 0x43, 0xE1, 0x84, 0x9A, 0x43, 0xE1, 0x84, 0x9C, 0x43, 0xE1, 0x84, 0x9D, 0x43, 0xE1, 0x84, 0x9E, 0x43, 0xE1, 0x84, 0xA0, 0x43, 0xE1, 0x84, 0xA1, 0x43, 0xE1, 0x84, 0xA2, 0x43, 0xE1, 0x84, 0xA3, 0x43, 0xE1, 0x84, 0xA7, 0x43, 0xE1, // Bytes 480 - 4bf 0x84, 0xA9, 0x43, 0xE1, 0x84, 0xAB, 0x43, 0xE1, 0x84, 0xAC, 0x43, 0xE1, 0x84, 0xAD, 0x43, 0xE1, 0x84, 0xAE, 0x43, 0xE1, 0x84, 0xAF, 0x43, 0xE1, 0x84, 0xB2, 0x43, 0xE1, 0x84, 0xB6, 0x43, 0xE1, 0x85, 0x80, 0x43, 0xE1, 0x85, 0x87, 0x43, 0xE1, 0x85, 0x8C, 0x43, 0xE1, 0x85, 0x97, 0x43, 0xE1, 0x85, 0x98, 0x43, 0xE1, 0x85, 0x99, 0x43, 0xE1, 0x85, 0xA0, 0x43, 0xE1, 0x86, 0x84, 0x43, 0xE1, // Bytes 4c0 - 4ff 0x86, 0x85, 0x43, 0xE1, 0x86, 0x88, 0x43, 0xE1, 0x86, 0x91, 0x43, 0xE1, 0x86, 0x92, 0x43, 0xE1, 0x86, 0x94, 0x43, 0xE1, 0x86, 0x9E, 0x43, 0xE1, 0x86, 0xA1, 0x43, 0xE1, 0x87, 0x87, 0x43, 0xE1, 0x87, 0x88, 0x43, 0xE1, 0x87, 0x8C, 0x43, 0xE1, 0x87, 0x8E, 0x43, 0xE1, 0x87, 0x93, 0x43, 0xE1, 0x87, 0x97, 0x43, 0xE1, 0x87, 0x99, 0x43, 0xE1, 0x87, 0x9D, 0x43, 0xE1, 0x87, 0x9F, 0x43, 0xE1, // Bytes 500 - 53f 0x87, 0xB1, 0x43, 0xE1, 0x87, 0xB2, 0x43, 0xE1, 0xB4, 0x82, 0x43, 0xE1, 0xB4, 0x96, 0x43, 0xE1, 0xB4, 0x97, 0x43, 0xE1, 0xB4, 0x9C, 0x43, 0xE1, 0xB4, 0x9D, 0x43, 0xE1, 0xB4, 0xA5, 0x43, 0xE1, 0xB5, 0xBB, 0x43, 0xE1, 0xB6, 0x85, 0x43, 0xE1, 0xB6, 0x91, 0x43, 0xE2, 0x80, 0x82, 0x43, 0xE2, 0x80, 0x83, 0x43, 0xE2, 0x80, 0x90, 0x43, 0xE2, 0x80, 0x93, 0x43, 0xE2, 0x80, 0x94, 0x43, 0xE2, // Bytes 540 - 57f 0x82, 0xA9, 0x43, 0xE2, 0x86, 0x90, 0x43, 0xE2, 0x86, 0x91, 0x43, 0xE2, 0x86, 0x92, 0x43, 0xE2, 0x86, 0x93, 0x43, 0xE2, 0x88, 0x82, 0x43, 0xE2, 0x88, 0x87, 0x43, 0xE2, 0x88, 0x91, 0x43, 0xE2, 0x88, 0x92, 0x43, 0xE2, 0x94, 0x82, 0x43, 0xE2, 0x96, 0xA0, 0x43, 0xE2, 0x97, 0x8B, 0x43, 0xE2, 0xA6, 0x85, 0x43, 0xE2, 0xA6, 0x86, 0x43, 0xE2, 0xB1, 0xB1, 0x43, 0xE2, 0xB5, 0xA1, 0x43, 0xE3, // Bytes 580 - 5bf 0x80, 0x81, 0x43, 0xE3, 0x80, 0x82, 0x43, 0xE3, 0x80, 0x88, 0x43, 0xE3, 0x80, 0x89, 0x43, 0xE3, 0x80, 0x8A, 0x43, 0xE3, 0x80, 0x8B, 0x43, 0xE3, 0x80, 0x8C, 0x43, 0xE3, 0x80, 0x8D, 0x43, 0xE3, 0x80, 0x8E, 0x43, 0xE3, 0x80, 0x8F, 0x43, 0xE3, 0x80, 0x90, 0x43, 0xE3, 0x80, 0x91, 0x43, 0xE3, 0x80, 0x92, 0x43, 0xE3, 0x80, 0x94, 0x43, 0xE3, 0x80, 0x95, 0x43, 0xE3, 0x80, 0x96, 0x43, 0xE3, // Bytes 5c0 - 5ff 0x80, 0x97, 0x43, 0xE3, 0x82, 0xA1, 0x43, 0xE3, 0x82, 0xA2, 0x43, 0xE3, 0x82, 0xA3, 0x43, 0xE3, 0x82, 0xA4, 0x43, 0xE3, 0x82, 0xA5, 0x43, 0xE3, 0x82, 0xA6, 0x43, 0xE3, 0x82, 0xA7, 0x43, 0xE3, 0x82, 0xA8, 0x43, 0xE3, 0x82, 0xA9, 0x43, 0xE3, 0x82, 0xAA, 0x43, 0xE3, 0x82, 0xAB, 0x43, 0xE3, 0x82, 0xAD, 0x43, 0xE3, 0x82, 0xAF, 0x43, 0xE3, 0x82, 0xB1, 0x43, 0xE3, 0x82, 0xB3, 0x43, 0xE3, // Bytes 600 - 63f 0x82, 0xB5, 0x43, 0xE3, 0x82, 0xB7, 0x43, 0xE3, 0x82, 0xB9, 0x43, 0xE3, 0x82, 0xBB, 0x43, 0xE3, 0x82, 0xBD, 0x43, 0xE3, 0x82, 0xBF, 0x43, 0xE3, 0x83, 0x81, 0x43, 0xE3, 0x83, 0x83, 0x43, 0xE3, 0x83, 0x84, 0x43, 0xE3, 0x83, 0x86, 0x43, 0xE3, 0x83, 0x88, 0x43, 0xE3, 0x83, 0x8A, 0x43, 0xE3, 0x83, 0x8B, 0x43, 0xE3, 0x83, 0x8C, 0x43, 0xE3, 0x83, 0x8D, 0x43, 0xE3, 0x83, 0x8E, 0x43, 0xE3, // Bytes 640 - 67f 0x83, 0x8F, 0x43, 0xE3, 0x83, 0x92, 0x43, 0xE3, 0x83, 0x95, 0x43, 0xE3, 0x83, 0x98, 0x43, 0xE3, 0x83, 0x9B, 0x43, 0xE3, 0x83, 0x9E, 0x43, 0xE3, 0x83, 0x9F, 0x43, 0xE3, 0x83, 0xA0, 0x43, 0xE3, 0x83, 0xA1, 0x43, 0xE3, 0x83, 0xA2, 0x43, 0xE3, 0x83, 0xA3, 0x43, 0xE3, 0x83, 0xA4, 0x43, 0xE3, 0x83, 0xA5, 0x43, 0xE3, 0x83, 0xA6, 0x43, 0xE3, 0x83, 0xA7, 0x43, 0xE3, 0x83, 0xA8, 0x43, 0xE3, // Bytes 680 - 6bf 0x83, 0xA9, 0x43, 0xE3, 0x83, 0xAA, 0x43, 0xE3, 0x83, 0xAB, 0x43, 0xE3, 0x83, 0xAC, 0x43, 0xE3, 0x83, 0xAD, 0x43, 0xE3, 0x83, 0xAF, 0x43, 0xE3, 0x83, 0xB0, 0x43, 0xE3, 0x83, 0xB1, 0x43, 0xE3, 0x83, 0xB2, 0x43, 0xE3, 0x83, 0xB3, 0x43, 0xE3, 0x83, 0xBB, 0x43, 0xE3, 0x83, 0xBC, 0x43, 0xE3, 0x92, 0x9E, 0x43, 0xE3, 0x92, 0xB9, 0x43, 0xE3, 0x92, 0xBB, 0x43, 0xE3, 0x93, 0x9F, 0x43, 0xE3, // Bytes 6c0 - 6ff 0x94, 0x95, 0x43, 0xE3, 0x9B, 0xAE, 0x43, 0xE3, 0x9B, 0xBC, 0x43, 0xE3, 0x9E, 0x81, 0x43, 0xE3, 0xA0, 0xAF, 0x43, 0xE3, 0xA1, 0xA2, 0x43, 0xE3, 0xA1, 0xBC, 0x43, 0xE3, 0xA3, 0x87, 0x43, 0xE3, 0xA3, 0xA3, 0x43, 0xE3, 0xA4, 0x9C, 0x43, 0xE3, 0xA4, 0xBA, 0x43, 0xE3, 0xA8, 0xAE, 0x43, 0xE3, 0xA9, 0xAC, 0x43, 0xE3, 0xAB, 0xA4, 0x43, 0xE3, 0xAC, 0x88, 0x43, 0xE3, 0xAC, 0x99, 0x43, 0xE3, // Bytes 700 - 73f 0xAD, 0x89, 0x43, 0xE3, 0xAE, 0x9D, 0x43, 0xE3, 0xB0, 0x98, 0x43, 0xE3, 0xB1, 0x8E, 0x43, 0xE3, 0xB4, 0xB3, 0x43, 0xE3, 0xB6, 0x96, 0x43, 0xE3, 0xBA, 0xAC, 0x43, 0xE3, 0xBA, 0xB8, 0x43, 0xE3, 0xBC, 0x9B, 0x43, 0xE3, 0xBF, 0xBC, 0x43, 0xE4, 0x80, 0x88, 0x43, 0xE4, 0x80, 0x98, 0x43, 0xE4, 0x80, 0xB9, 0x43, 0xE4, 0x81, 0x86, 0x43, 0xE4, 0x82, 0x96, 0x43, 0xE4, 0x83, 0xA3, 0x43, 0xE4, // Bytes 740 - 77f 0x84, 0xAF, 0x43, 0xE4, 0x88, 0x82, 0x43, 0xE4, 0x88, 0xA7, 0x43, 0xE4, 0x8A, 0xA0, 0x43, 0xE4, 0x8C, 0x81, 0x43, 0xE4, 0x8C, 0xB4, 0x43, 0xE4, 0x8D, 0x99, 0x43, 0xE4, 0x8F, 0x95, 0x43, 0xE4, 0x8F, 0x99, 0x43, 0xE4, 0x90, 0x8B, 0x43, 0xE4, 0x91, 0xAB, 0x43, 0xE4, 0x94, 0xAB, 0x43, 0xE4, 0x95, 0x9D, 0x43, 0xE4, 0x95, 0xA1, 0x43, 0xE4, 0x95, 0xAB, 0x43, 0xE4, 0x97, 0x97, 0x43, 0xE4, // Bytes 780 - 7bf 0x97, 0xB9, 0x43, 0xE4, 0x98, 0xB5, 0x43, 0xE4, 0x9A, 0xBE, 0x43, 0xE4, 0x9B, 0x87, 0x43, 0xE4, 0xA6, 0x95, 0x43, 0xE4, 0xA7, 0xA6, 0x43, 0xE4, 0xA9, 0xAE, 0x43, 0xE4, 0xA9, 0xB6, 0x43, 0xE4, 0xAA, 0xB2, 0x43, 0xE4, 0xAC, 0xB3, 0x43, 0xE4, 0xAF, 0x8E, 0x43, 0xE4, 0xB3, 0x8E, 0x43, 0xE4, 0xB3, 0xAD, 0x43, 0xE4, 0xB3, 0xB8, 0x43, 0xE4, 0xB5, 0x96, 0x43, 0xE4, 0xB8, 0x80, 0x43, 0xE4, // Bytes 7c0 - 7ff 0xB8, 0x81, 0x43, 0xE4, 0xB8, 0x83, 0x43, 0xE4, 0xB8, 0x89, 0x43, 0xE4, 0xB8, 0x8A, 0x43, 0xE4, 0xB8, 0x8B, 0x43, 0xE4, 0xB8, 0x8D, 0x43, 0xE4, 0xB8, 0x99, 0x43, 0xE4, 0xB8, 0xA6, 0x43, 0xE4, 0xB8, 0xA8, 0x43, 0xE4, 0xB8, 0xAD, 0x43, 0xE4, 0xB8, 0xB2, 0x43, 0xE4, 0xB8, 0xB6, 0x43, 0xE4, 0xB8, 0xB8, 0x43, 0xE4, 0xB8, 0xB9, 0x43, 0xE4, 0xB8, 0xBD, 0x43, 0xE4, 0xB8, 0xBF, 0x43, 0xE4, // Bytes 800 - 83f 0xB9, 0x81, 0x43, 0xE4, 0xB9, 0x99, 0x43, 0xE4, 0xB9, 0x9D, 0x43, 0xE4, 0xBA, 0x82, 0x43, 0xE4, 0xBA, 0x85, 0x43, 0xE4, 0xBA, 0x86, 0x43, 0xE4, 0xBA, 0x8C, 0x43, 0xE4, 0xBA, 0x94, 0x43, 0xE4, 0xBA, 0xA0, 0x43, 0xE4, 0xBA, 0xA4, 0x43, 0xE4, 0xBA, 0xAE, 0x43, 0xE4, 0xBA, 0xBA, 0x43, 0xE4, 0xBB, 0x80, 0x43, 0xE4, 0xBB, 0x8C, 0x43, 0xE4, 0xBB, 0xA4, 0x43, 0xE4, 0xBC, 0x81, 0x43, 0xE4, // Bytes 840 - 87f 0xBC, 0x91, 0x43, 0xE4, 0xBD, 0xA0, 0x43, 0xE4, 0xBE, 0x80, 0x43, 0xE4, 0xBE, 0x86, 0x43, 0xE4, 0xBE, 0x8B, 0x43, 0xE4, 0xBE, 0xAE, 0x43, 0xE4, 0xBE, 0xBB, 0x43, 0xE4, 0xBE, 0xBF, 0x43, 0xE5, 0x80, 0x82, 0x43, 0xE5, 0x80, 0xAB, 0x43, 0xE5, 0x81, 0xBA, 0x43, 0xE5, 0x82, 0x99, 0x43, 0xE5, 0x83, 0x8F, 0x43, 0xE5, 0x83, 0x9A, 0x43, 0xE5, 0x83, 0xA7, 0x43, 0xE5, 0x84, 0xAA, 0x43, 0xE5, // Bytes 880 - 8bf 0x84, 0xBF, 0x43, 0xE5, 0x85, 0x80, 0x43, 0xE5, 0x85, 0x85, 0x43, 0xE5, 0x85, 0x8D, 0x43, 0xE5, 0x85, 0x94, 0x43, 0xE5, 0x85, 0xA4, 0x43, 0xE5, 0x85, 0xA5, 0x43, 0xE5, 0x85, 0xA7, 0x43, 0xE5, 0x85, 0xA8, 0x43, 0xE5, 0x85, 0xA9, 0x43, 0xE5, 0x85, 0xAB, 0x43, 0xE5, 0x85, 0xAD, 0x43, 0xE5, 0x85, 0xB7, 0x43, 0xE5, 0x86, 0x80, 0x43, 0xE5, 0x86, 0x82, 0x43, 0xE5, 0x86, 0x8D, 0x43, 0xE5, // Bytes 8c0 - 8ff 0x86, 0x92, 0x43, 0xE5, 0x86, 0x95, 0x43, 0xE5, 0x86, 0x96, 0x43, 0xE5, 0x86, 0x97, 0x43, 0xE5, 0x86, 0x99, 0x43, 0xE5, 0x86, 0xA4, 0x43, 0xE5, 0x86, 0xAB, 0x43, 0xE5, 0x86, 0xAC, 0x43, 0xE5, 0x86, 0xB5, 0x43, 0xE5, 0x86, 0xB7, 0x43, 0xE5, 0x87, 0x89, 0x43, 0xE5, 0x87, 0x8C, 0x43, 0xE5, 0x87, 0x9C, 0x43, 0xE5, 0x87, 0x9E, 0x43, 0xE5, 0x87, 0xA0, 0x43, 0xE5, 0x87, 0xB5, 0x43, 0xE5, // Bytes 900 - 93f 0x88, 0x80, 0x43, 0xE5, 0x88, 0x83, 0x43, 0xE5, 0x88, 0x87, 0x43, 0xE5, 0x88, 0x97, 0x43, 0xE5, 0x88, 0x9D, 0x43, 0xE5, 0x88, 0xA9, 0x43, 0xE5, 0x88, 0xBA, 0x43, 0xE5, 0x88, 0xBB, 0x43, 0xE5, 0x89, 0x86, 0x43, 0xE5, 0x89, 0x8D, 0x43, 0xE5, 0x89, 0xB2, 0x43, 0xE5, 0x89, 0xB7, 0x43, 0xE5, 0x8A, 0x89, 0x43, 0xE5, 0x8A, 0x9B, 0x43, 0xE5, 0x8A, 0xA3, 0x43, 0xE5, 0x8A, 0xB3, 0x43, 0xE5, // Bytes 940 - 97f 0x8A, 0xB4, 0x43, 0xE5, 0x8B, 0x87, 0x43, 0xE5, 0x8B, 0x89, 0x43, 0xE5, 0x8B, 0x92, 0x43, 0xE5, 0x8B, 0x9E, 0x43, 0xE5, 0x8B, 0xA4, 0x43, 0xE5, 0x8B, 0xB5, 0x43, 0xE5, 0x8B, 0xB9, 0x43, 0xE5, 0x8B, 0xBA, 0x43, 0xE5, 0x8C, 0x85, 0x43, 0xE5, 0x8C, 0x86, 0x43, 0xE5, 0x8C, 0x95, 0x43, 0xE5, 0x8C, 0x97, 0x43, 0xE5, 0x8C, 0x9A, 0x43, 0xE5, 0x8C, 0xB8, 0x43, 0xE5, 0x8C, 0xBB, 0x43, 0xE5, // Bytes 980 - 9bf 0x8C, 0xBF, 0x43, 0xE5, 0x8D, 0x81, 0x43, 0xE5, 0x8D, 0x84, 0x43, 0xE5, 0x8D, 0x85, 0x43, 0xE5, 0x8D, 0x89, 0x43, 0xE5, 0x8D, 0x91, 0x43, 0xE5, 0x8D, 0x94, 0x43, 0xE5, 0x8D, 0x9A, 0x43, 0xE5, 0x8D, 0x9C, 0x43, 0xE5, 0x8D, 0xA9, 0x43, 0xE5, 0x8D, 0xB0, 0x43, 0xE5, 0x8D, 0xB3, 0x43, 0xE5, 0x8D, 0xB5, 0x43, 0xE5, 0x8D, 0xBD, 0x43, 0xE5, 0x8D, 0xBF, 0x43, 0xE5, 0x8E, 0x82, 0x43, 0xE5, // Bytes 9c0 - 9ff 0x8E, 0xB6, 0x43, 0xE5, 0x8F, 0x83, 0x43, 0xE5, 0x8F, 0x88, 0x43, 0xE5, 0x8F, 0x8A, 0x43, 0xE5, 0x8F, 0x8C, 0x43, 0xE5, 0x8F, 0x9F, 0x43, 0xE5, 0x8F, 0xA3, 0x43, 0xE5, 0x8F, 0xA5, 0x43, 0xE5, 0x8F, 0xAB, 0x43, 0xE5, 0x8F, 0xAF, 0x43, 0xE5, 0x8F, 0xB1, 0x43, 0xE5, 0x8F, 0xB3, 0x43, 0xE5, 0x90, 0x86, 0x43, 0xE5, 0x90, 0x88, 0x43, 0xE5, 0x90, 0x8D, 0x43, 0xE5, 0x90, 0x8F, 0x43, 0xE5, // Bytes a00 - a3f 0x90, 0x9D, 0x43, 0xE5, 0x90, 0xB8, 0x43, 0xE5, 0x90, 0xB9, 0x43, 0xE5, 0x91, 0x82, 0x43, 0xE5, 0x91, 0x88, 0x43, 0xE5, 0x91, 0xA8, 0x43, 0xE5, 0x92, 0x9E, 0x43, 0xE5, 0x92, 0xA2, 0x43, 0xE5, 0x92, 0xBD, 0x43, 0xE5, 0x93, 0xB6, 0x43, 0xE5, 0x94, 0x90, 0x43, 0xE5, 0x95, 0x8F, 0x43, 0xE5, 0x95, 0x93, 0x43, 0xE5, 0x95, 0x95, 0x43, 0xE5, 0x95, 0xA3, 0x43, 0xE5, 0x96, 0x84, 0x43, 0xE5, // Bytes a40 - a7f 0x96, 0x87, 0x43, 0xE5, 0x96, 0x99, 0x43, 0xE5, 0x96, 0x9D, 0x43, 0xE5, 0x96, 0xAB, 0x43, 0xE5, 0x96, 0xB3, 0x43, 0xE5, 0x96, 0xB6, 0x43, 0xE5, 0x97, 0x80, 0x43, 0xE5, 0x97, 0x82, 0x43, 0xE5, 0x97, 0xA2, 0x43, 0xE5, 0x98, 0x86, 0x43, 0xE5, 0x99, 0x91, 0x43, 0xE5, 0x99, 0xA8, 0x43, 0xE5, 0x99, 0xB4, 0x43, 0xE5, 0x9B, 0x97, 0x43, 0xE5, 0x9B, 0x9B, 0x43, 0xE5, 0x9B, 0xB9, 0x43, 0xE5, // Bytes a80 - abf 0x9C, 0x96, 0x43, 0xE5, 0x9C, 0x97, 0x43, 0xE5, 0x9C, 0x9F, 0x43, 0xE5, 0x9C, 0xB0, 0x43, 0xE5, 0x9E, 0x8B, 0x43, 0xE5, 0x9F, 0x8E, 0x43, 0xE5, 0x9F, 0xB4, 0x43, 0xE5, 0xA0, 0x8D, 0x43, 0xE5, 0xA0, 0xB1, 0x43, 0xE5, 0xA0, 0xB2, 0x43, 0xE5, 0xA1, 0x80, 0x43, 0xE5, 0xA1, 0x9A, 0x43, 0xE5, 0xA1, 0x9E, 0x43, 0xE5, 0xA2, 0xA8, 0x43, 0xE5, 0xA2, 0xAC, 0x43, 0xE5, 0xA2, 0xB3, 0x43, 0xE5, // Bytes ac0 - aff 0xA3, 0x98, 0x43, 0xE5, 0xA3, 0x9F, 0x43, 0xE5, 0xA3, 0xAB, 0x43, 0xE5, 0xA3, 0xAE, 0x43, 0xE5, 0xA3, 0xB0, 0x43, 0xE5, 0xA3, 0xB2, 0x43, 0xE5, 0xA3, 0xB7, 0x43, 0xE5, 0xA4, 0x82, 0x43, 0xE5, 0xA4, 0x86, 0x43, 0xE5, 0xA4, 0x8A, 0x43, 0xE5, 0xA4, 0x95, 0x43, 0xE5, 0xA4, 0x9A, 0x43, 0xE5, 0xA4, 0x9C, 0x43, 0xE5, 0xA4, 0xA2, 0x43, 0xE5, 0xA4, 0xA7, 0x43, 0xE5, 0xA4, 0xA9, 0x43, 0xE5, // Bytes b00 - b3f 0xA5, 0x84, 0x43, 0xE5, 0xA5, 0x88, 0x43, 0xE5, 0xA5, 0x91, 0x43, 0xE5, 0xA5, 0x94, 0x43, 0xE5, 0xA5, 0xA2, 0x43, 0xE5, 0xA5, 0xB3, 0x43, 0xE5, 0xA7, 0x98, 0x43, 0xE5, 0xA7, 0xAC, 0x43, 0xE5, 0xA8, 0x9B, 0x43, 0xE5, 0xA8, 0xA7, 0x43, 0xE5, 0xA9, 0xA2, 0x43, 0xE5, 0xA9, 0xA6, 0x43, 0xE5, 0xAA, 0xB5, 0x43, 0xE5, 0xAC, 0x88, 0x43, 0xE5, 0xAC, 0xA8, 0x43, 0xE5, 0xAC, 0xBE, 0x43, 0xE5, // Bytes b40 - b7f 0xAD, 0x90, 0x43, 0xE5, 0xAD, 0x97, 0x43, 0xE5, 0xAD, 0xA6, 0x43, 0xE5, 0xAE, 0x80, 0x43, 0xE5, 0xAE, 0x85, 0x43, 0xE5, 0xAE, 0x97, 0x43, 0xE5, 0xAF, 0x83, 0x43, 0xE5, 0xAF, 0x98, 0x43, 0xE5, 0xAF, 0xA7, 0x43, 0xE5, 0xAF, 0xAE, 0x43, 0xE5, 0xAF, 0xB3, 0x43, 0xE5, 0xAF, 0xB8, 0x43, 0xE5, 0xAF, 0xBF, 0x43, 0xE5, 0xB0, 0x86, 0x43, 0xE5, 0xB0, 0x8F, 0x43, 0xE5, 0xB0, 0xA2, 0x43, 0xE5, // Bytes b80 - bbf 0xB0, 0xB8, 0x43, 0xE5, 0xB0, 0xBF, 0x43, 0xE5, 0xB1, 0xA0, 0x43, 0xE5, 0xB1, 0xA2, 0x43, 0xE5, 0xB1, 0xA4, 0x43, 0xE5, 0xB1, 0xA5, 0x43, 0xE5, 0xB1, 0xAE, 0x43, 0xE5, 0xB1, 0xB1, 0x43, 0xE5, 0xB2, 0x8D, 0x43, 0xE5, 0xB3, 0x80, 0x43, 0xE5, 0xB4, 0x99, 0x43, 0xE5, 0xB5, 0x83, 0x43, 0xE5, 0xB5, 0x90, 0x43, 0xE5, 0xB5, 0xAB, 0x43, 0xE5, 0xB5, 0xAE, 0x43, 0xE5, 0xB5, 0xBC, 0x43, 0xE5, // Bytes bc0 - bff 0xB6, 0xB2, 0x43, 0xE5, 0xB6, 0xBA, 0x43, 0xE5, 0xB7, 0x9B, 0x43, 0xE5, 0xB7, 0xA1, 0x43, 0xE5, 0xB7, 0xA2, 0x43, 0xE5, 0xB7, 0xA5, 0x43, 0xE5, 0xB7, 0xA6, 0x43, 0xE5, 0xB7, 0xB1, 0x43, 0xE5, 0xB7, 0xBD, 0x43, 0xE5, 0xB7, 0xBE, 0x43, 0xE5, 0xB8, 0xA8, 0x43, 0xE5, 0xB8, 0xBD, 0x43, 0xE5, 0xB9, 0xA9, 0x43, 0xE5, 0xB9, 0xB2, 0x43, 0xE5, 0xB9, 0xB4, 0x43, 0xE5, 0xB9, 0xBA, 0x43, 0xE5, // Bytes c00 - c3f 0xB9, 0xBC, 0x43, 0xE5, 0xB9, 0xBF, 0x43, 0xE5, 0xBA, 0xA6, 0x43, 0xE5, 0xBA, 0xB0, 0x43, 0xE5, 0xBA, 0xB3, 0x43, 0xE5, 0xBA, 0xB6, 0x43, 0xE5, 0xBB, 0x89, 0x43, 0xE5, 0xBB, 0x8A, 0x43, 0xE5, 0xBB, 0x92, 0x43, 0xE5, 0xBB, 0x93, 0x43, 0xE5, 0xBB, 0x99, 0x43, 0xE5, 0xBB, 0xAC, 0x43, 0xE5, 0xBB, 0xB4, 0x43, 0xE5, 0xBB, 0xBE, 0x43, 0xE5, 0xBC, 0x84, 0x43, 0xE5, 0xBC, 0x8B, 0x43, 0xE5, // Bytes c40 - c7f 0xBC, 0x93, 0x43, 0xE5, 0xBC, 0xA2, 0x43, 0xE5, 0xBD, 0x90, 0x43, 0xE5, 0xBD, 0x93, 0x43, 0xE5, 0xBD, 0xA1, 0x43, 0xE5, 0xBD, 0xA2, 0x43, 0xE5, 0xBD, 0xA9, 0x43, 0xE5, 0xBD, 0xAB, 0x43, 0xE5, 0xBD, 0xB3, 0x43, 0xE5, 0xBE, 0x8B, 0x43, 0xE5, 0xBE, 0x8C, 0x43, 0xE5, 0xBE, 0x97, 0x43, 0xE5, 0xBE, 0x9A, 0x43, 0xE5, 0xBE, 0xA9, 0x43, 0xE5, 0xBE, 0xAD, 0x43, 0xE5, 0xBF, 0x83, 0x43, 0xE5, // Bytes c80 - cbf 0xBF, 0x8D, 0x43, 0xE5, 0xBF, 0x97, 0x43, 0xE5, 0xBF, 0xB5, 0x43, 0xE5, 0xBF, 0xB9, 0x43, 0xE6, 0x80, 0x92, 0x43, 0xE6, 0x80, 0x9C, 0x43, 0xE6, 0x81, 0xB5, 0x43, 0xE6, 0x82, 0x81, 0x43, 0xE6, 0x82, 0x94, 0x43, 0xE6, 0x83, 0x87, 0x43, 0xE6, 0x83, 0x98, 0x43, 0xE6, 0x83, 0xA1, 0x43, 0xE6, 0x84, 0x88, 0x43, 0xE6, 0x85, 0x84, 0x43, 0xE6, 0x85, 0x88, 0x43, 0xE6, 0x85, 0x8C, 0x43, 0xE6, // Bytes cc0 - cff 0x85, 0x8E, 0x43, 0xE6, 0x85, 0xA0, 0x43, 0xE6, 0x85, 0xA8, 0x43, 0xE6, 0x85, 0xBA, 0x43, 0xE6, 0x86, 0x8E, 0x43, 0xE6, 0x86, 0x90, 0x43, 0xE6, 0x86, 0xA4, 0x43, 0xE6, 0x86, 0xAF, 0x43, 0xE6, 0x86, 0xB2, 0x43, 0xE6, 0x87, 0x9E, 0x43, 0xE6, 0x87, 0xB2, 0x43, 0xE6, 0x87, 0xB6, 0x43, 0xE6, 0x88, 0x80, 0x43, 0xE6, 0x88, 0x88, 0x43, 0xE6, 0x88, 0x90, 0x43, 0xE6, 0x88, 0x9B, 0x43, 0xE6, // Bytes d00 - d3f 0x88, 0xAE, 0x43, 0xE6, 0x88, 0xB4, 0x43, 0xE6, 0x88, 0xB6, 0x43, 0xE6, 0x89, 0x8B, 0x43, 0xE6, 0x89, 0x93, 0x43, 0xE6, 0x89, 0x9D, 0x43, 0xE6, 0x8A, 0x95, 0x43, 0xE6, 0x8A, 0xB1, 0x43, 0xE6, 0x8B, 0x89, 0x43, 0xE6, 0x8B, 0x8F, 0x43, 0xE6, 0x8B, 0x93, 0x43, 0xE6, 0x8B, 0x94, 0x43, 0xE6, 0x8B, 0xBC, 0x43, 0xE6, 0x8B, 0xBE, 0x43, 0xE6, 0x8C, 0x87, 0x43, 0xE6, 0x8C, 0xBD, 0x43, 0xE6, // Bytes d40 - d7f 0x8D, 0x90, 0x43, 0xE6, 0x8D, 0x95, 0x43, 0xE6, 0x8D, 0xA8, 0x43, 0xE6, 0x8D, 0xBB, 0x43, 0xE6, 0x8E, 0x83, 0x43, 0xE6, 0x8E, 0xA0, 0x43, 0xE6, 0x8E, 0xA9, 0x43, 0xE6, 0x8F, 0x84, 0x43, 0xE6, 0x8F, 0x85, 0x43, 0xE6, 0x8F, 0xA4, 0x43, 0xE6, 0x90, 0x9C, 0x43, 0xE6, 0x90, 0xA2, 0x43, 0xE6, 0x91, 0x92, 0x43, 0xE6, 0x91, 0xA9, 0x43, 0xE6, 0x91, 0xB7, 0x43, 0xE6, 0x91, 0xBE, 0x43, 0xE6, // Bytes d80 - dbf 0x92, 0x9A, 0x43, 0xE6, 0x92, 0x9D, 0x43, 0xE6, 0x93, 0x84, 0x43, 0xE6, 0x94, 0xAF, 0x43, 0xE6, 0x94, 0xB4, 0x43, 0xE6, 0x95, 0x8F, 0x43, 0xE6, 0x95, 0x96, 0x43, 0xE6, 0x95, 0xAC, 0x43, 0xE6, 0x95, 0xB8, 0x43, 0xE6, 0x96, 0x87, 0x43, 0xE6, 0x96, 0x97, 0x43, 0xE6, 0x96, 0x99, 0x43, 0xE6, 0x96, 0xA4, 0x43, 0xE6, 0x96, 0xB0, 0x43, 0xE6, 0x96, 0xB9, 0x43, 0xE6, 0x97, 0x85, 0x43, 0xE6, // Bytes dc0 - dff 0x97, 0xA0, 0x43, 0xE6, 0x97, 0xA2, 0x43, 0xE6, 0x97, 0xA3, 0x43, 0xE6, 0x97, 0xA5, 0x43, 0xE6, 0x98, 0x93, 0x43, 0xE6, 0x98, 0xA0, 0x43, 0xE6, 0x99, 0x89, 0x43, 0xE6, 0x99, 0xB4, 0x43, 0xE6, 0x9A, 0x88, 0x43, 0xE6, 0x9A, 0x91, 0x43, 0xE6, 0x9A, 0x9C, 0x43, 0xE6, 0x9A, 0xB4, 0x43, 0xE6, 0x9B, 0x86, 0x43, 0xE6, 0x9B, 0xB0, 0x43, 0xE6, 0x9B, 0xB4, 0x43, 0xE6, 0x9B, 0xB8, 0x43, 0xE6, // Bytes e00 - e3f 0x9C, 0x80, 0x43, 0xE6, 0x9C, 0x88, 0x43, 0xE6, 0x9C, 0x89, 0x43, 0xE6, 0x9C, 0x97, 0x43, 0xE6, 0x9C, 0x9B, 0x43, 0xE6, 0x9C, 0xA1, 0x43, 0xE6, 0x9C, 0xA8, 0x43, 0xE6, 0x9D, 0x8E, 0x43, 0xE6, 0x9D, 0x93, 0x43, 0xE6, 0x9D, 0x96, 0x43, 0xE6, 0x9D, 0x9E, 0x43, 0xE6, 0x9D, 0xBB, 0x43, 0xE6, 0x9E, 0x85, 0x43, 0xE6, 0x9E, 0x97, 0x43, 0xE6, 0x9F, 0xB3, 0x43, 0xE6, 0x9F, 0xBA, 0x43, 0xE6, // Bytes e40 - e7f 0xA0, 0x97, 0x43, 0xE6, 0xA0, 0x9F, 0x43, 0xE6, 0xA0, 0xAA, 0x43, 0xE6, 0xA1, 0x92, 0x43, 0xE6, 0xA2, 0x81, 0x43, 0xE6, 0xA2, 0x85, 0x43, 0xE6, 0xA2, 0x8E, 0x43, 0xE6, 0xA2, 0xA8, 0x43, 0xE6, 0xA4, 0x94, 0x43, 0xE6, 0xA5, 0x82, 0x43, 0xE6, 0xA6, 0xA3, 0x43, 0xE6, 0xA7, 0xAA, 0x43, 0xE6, 0xA8, 0x82, 0x43, 0xE6, 0xA8, 0x93, 0x43, 0xE6, 0xAA, 0xA8, 0x43, 0xE6, 0xAB, 0x93, 0x43, 0xE6, // Bytes e80 - ebf 0xAB, 0x9B, 0x43, 0xE6, 0xAC, 0x84, 0x43, 0xE6, 0xAC, 0xA0, 0x43, 0xE6, 0xAC, 0xA1, 0x43, 0xE6, 0xAD, 0x94, 0x43, 0xE6, 0xAD, 0xA2, 0x43, 0xE6, 0xAD, 0xA3, 0x43, 0xE6, 0xAD, 0xB2, 0x43, 0xE6, 0xAD, 0xB7, 0x43, 0xE6, 0xAD, 0xB9, 0x43, 0xE6, 0xAE, 0x9F, 0x43, 0xE6, 0xAE, 0xAE, 0x43, 0xE6, 0xAE, 0xB3, 0x43, 0xE6, 0xAE, 0xBA, 0x43, 0xE6, 0xAE, 0xBB, 0x43, 0xE6, 0xAF, 0x8B, 0x43, 0xE6, // Bytes ec0 - eff 0xAF, 0x8D, 0x43, 0xE6, 0xAF, 0x94, 0x43, 0xE6, 0xAF, 0x9B, 0x43, 0xE6, 0xB0, 0x8F, 0x43, 0xE6, 0xB0, 0x94, 0x43, 0xE6, 0xB0, 0xB4, 0x43, 0xE6, 0xB1, 0x8E, 0x43, 0xE6, 0xB1, 0xA7, 0x43, 0xE6, 0xB2, 0x88, 0x43, 0xE6, 0xB2, 0xBF, 0x43, 0xE6, 0xB3, 0x8C, 0x43, 0xE6, 0xB3, 0x8D, 0x43, 0xE6, 0xB3, 0xA5, 0x43, 0xE6, 0xB3, 0xA8, 0x43, 0xE6, 0xB4, 0x96, 0x43, 0xE6, 0xB4, 0x9B, 0x43, 0xE6, // Bytes f00 - f3f 0xB4, 0x9E, 0x43, 0xE6, 0xB4, 0xB4, 0x43, 0xE6, 0xB4, 0xBE, 0x43, 0xE6, 0xB5, 0x81, 0x43, 0xE6, 0xB5, 0xA9, 0x43, 0xE6, 0xB5, 0xAA, 0x43, 0xE6, 0xB5, 0xB7, 0x43, 0xE6, 0xB5, 0xB8, 0x43, 0xE6, 0xB6, 0x85, 0x43, 0xE6, 0xB7, 0x8B, 0x43, 0xE6, 0xB7, 0x9A, 0x43, 0xE6, 0xB7, 0xAA, 0x43, 0xE6, 0xB7, 0xB9, 0x43, 0xE6, 0xB8, 0x9A, 0x43, 0xE6, 0xB8, 0xAF, 0x43, 0xE6, 0xB9, 0xAE, 0x43, 0xE6, // Bytes f40 - f7f 0xBA, 0x80, 0x43, 0xE6, 0xBA, 0x9C, 0x43, 0xE6, 0xBA, 0xBA, 0x43, 0xE6, 0xBB, 0x87, 0x43, 0xE6, 0xBB, 0x8B, 0x43, 0xE6, 0xBB, 0x91, 0x43, 0xE6, 0xBB, 0x9B, 0x43, 0xE6, 0xBC, 0x8F, 0x43, 0xE6, 0xBC, 0x94, 0x43, 0xE6, 0xBC, 0xA2, 0x43, 0xE6, 0xBC, 0xA3, 0x43, 0xE6, 0xBD, 0xAE, 0x43, 0xE6, 0xBF, 0x86, 0x43, 0xE6, 0xBF, 0xAB, 0x43, 0xE6, 0xBF, 0xBE, 0x43, 0xE7, 0x80, 0x9B, 0x43, 0xE7, // Bytes f80 - fbf 0x80, 0x9E, 0x43, 0xE7, 0x80, 0xB9, 0x43, 0xE7, 0x81, 0x8A, 0x43, 0xE7, 0x81, 0xAB, 0x43, 0xE7, 0x81, 0xB0, 0x43, 0xE7, 0x81, 0xB7, 0x43, 0xE7, 0x81, 0xBD, 0x43, 0xE7, 0x82, 0x99, 0x43, 0xE7, 0x82, 0xAD, 0x43, 0xE7, 0x83, 0x88, 0x43, 0xE7, 0x83, 0x99, 0x43, 0xE7, 0x84, 0xA1, 0x43, 0xE7, 0x85, 0x85, 0x43, 0xE7, 0x85, 0x89, 0x43, 0xE7, 0x85, 0xAE, 0x43, 0xE7, 0x86, 0x9C, 0x43, 0xE7, // Bytes fc0 - fff 0x87, 0x8E, 0x43, 0xE7, 0x87, 0x90, 0x43, 0xE7, 0x88, 0x90, 0x43, 0xE7, 0x88, 0x9B, 0x43, 0xE7, 0x88, 0xA8, 0x43, 0xE7, 0x88, 0xAA, 0x43, 0xE7, 0x88, 0xAB, 0x43, 0xE7, 0x88, 0xB5, 0x43, 0xE7, 0x88, 0xB6, 0x43, 0xE7, 0x88, 0xBB, 0x43, 0xE7, 0x88, 0xBF, 0x43, 0xE7, 0x89, 0x87, 0x43, 0xE7, 0x89, 0x90, 0x43, 0xE7, 0x89, 0x99, 0x43, 0xE7, 0x89, 0x9B, 0x43, 0xE7, 0x89, 0xA2, 0x43, 0xE7, // Bytes 1000 - 103f 0x89, 0xB9, 0x43, 0xE7, 0x8A, 0x80, 0x43, 0xE7, 0x8A, 0x95, 0x43, 0xE7, 0x8A, 0xAC, 0x43, 0xE7, 0x8A, 0xAF, 0x43, 0xE7, 0x8B, 0x80, 0x43, 0xE7, 0x8B, 0xBC, 0x43, 0xE7, 0x8C, 0xAA, 0x43, 0xE7, 0x8D, 0xB5, 0x43, 0xE7, 0x8D, 0xBA, 0x43, 0xE7, 0x8E, 0x84, 0x43, 0xE7, 0x8E, 0x87, 0x43, 0xE7, 0x8E, 0x89, 0x43, 0xE7, 0x8E, 0x8B, 0x43, 0xE7, 0x8E, 0xA5, 0x43, 0xE7, 0x8E, 0xB2, 0x43, 0xE7, // Bytes 1040 - 107f 0x8F, 0x9E, 0x43, 0xE7, 0x90, 0x86, 0x43, 0xE7, 0x90, 0x89, 0x43, 0xE7, 0x90, 0xA2, 0x43, 0xE7, 0x91, 0x87, 0x43, 0xE7, 0x91, 0x9C, 0x43, 0xE7, 0x91, 0xA9, 0x43, 0xE7, 0x91, 0xB1, 0x43, 0xE7, 0x92, 0x85, 0x43, 0xE7, 0x92, 0x89, 0x43, 0xE7, 0x92, 0x98, 0x43, 0xE7, 0x93, 0x8A, 0x43, 0xE7, 0x93, 0x9C, 0x43, 0xE7, 0x93, 0xA6, 0x43, 0xE7, 0x94, 0x86, 0x43, 0xE7, 0x94, 0x98, 0x43, 0xE7, // Bytes 1080 - 10bf 0x94, 0x9F, 0x43, 0xE7, 0x94, 0xA4, 0x43, 0xE7, 0x94, 0xA8, 0x43, 0xE7, 0x94, 0xB0, 0x43, 0xE7, 0x94, 0xB2, 0x43, 0xE7, 0x94, 0xB3, 0x43, 0xE7, 0x94, 0xB7, 0x43, 0xE7, 0x94, 0xBB, 0x43, 0xE7, 0x94, 0xBE, 0x43, 0xE7, 0x95, 0x99, 0x43, 0xE7, 0x95, 0xA5, 0x43, 0xE7, 0x95, 0xB0, 0x43, 0xE7, 0x96, 0x8B, 0x43, 0xE7, 0x96, 0x92, 0x43, 0xE7, 0x97, 0xA2, 0x43, 0xE7, 0x98, 0x90, 0x43, 0xE7, // Bytes 10c0 - 10ff 0x98, 0x9D, 0x43, 0xE7, 0x98, 0x9F, 0x43, 0xE7, 0x99, 0x82, 0x43, 0xE7, 0x99, 0xA9, 0x43, 0xE7, 0x99, 0xB6, 0x43, 0xE7, 0x99, 0xBD, 0x43, 0xE7, 0x9A, 0xAE, 0x43, 0xE7, 0x9A, 0xBF, 0x43, 0xE7, 0x9B, 0x8A, 0x43, 0xE7, 0x9B, 0x9B, 0x43, 0xE7, 0x9B, 0xA3, 0x43, 0xE7, 0x9B, 0xA7, 0x43, 0xE7, 0x9B, 0xAE, 0x43, 0xE7, 0x9B, 0xB4, 0x43, 0xE7, 0x9C, 0x81, 0x43, 0xE7, 0x9C, 0x9E, 0x43, 0xE7, // Bytes 1100 - 113f 0x9C, 0x9F, 0x43, 0xE7, 0x9D, 0x80, 0x43, 0xE7, 0x9D, 0x8A, 0x43, 0xE7, 0x9E, 0x8B, 0x43, 0xE7, 0x9E, 0xA7, 0x43, 0xE7, 0x9F, 0x9B, 0x43, 0xE7, 0x9F, 0xA2, 0x43, 0xE7, 0x9F, 0xB3, 0x43, 0xE7, 0xA1, 0x8E, 0x43, 0xE7, 0xA1, 0xAB, 0x43, 0xE7, 0xA2, 0x8C, 0x43, 0xE7, 0xA2, 0x91, 0x43, 0xE7, 0xA3, 0x8A, 0x43, 0xE7, 0xA3, 0x8C, 0x43, 0xE7, 0xA3, 0xBB, 0x43, 0xE7, 0xA4, 0xAA, 0x43, 0xE7, // Bytes 1140 - 117f 0xA4, 0xBA, 0x43, 0xE7, 0xA4, 0xBC, 0x43, 0xE7, 0xA4, 0xBE, 0x43, 0xE7, 0xA5, 0x88, 0x43, 0xE7, 0xA5, 0x89, 0x43, 0xE7, 0xA5, 0x90, 0x43, 0xE7, 0xA5, 0x96, 0x43, 0xE7, 0xA5, 0x9D, 0x43, 0xE7, 0xA5, 0x9E, 0x43, 0xE7, 0xA5, 0xA5, 0x43, 0xE7, 0xA5, 0xBF, 0x43, 0xE7, 0xA6, 0x81, 0x43, 0xE7, 0xA6, 0x8D, 0x43, 0xE7, 0xA6, 0x8E, 0x43, 0xE7, 0xA6, 0x8F, 0x43, 0xE7, 0xA6, 0xAE, 0x43, 0xE7, // Bytes 1180 - 11bf 0xA6, 0xB8, 0x43, 0xE7, 0xA6, 0xBE, 0x43, 0xE7, 0xA7, 0x8A, 0x43, 0xE7, 0xA7, 0x98, 0x43, 0xE7, 0xA7, 0xAB, 0x43, 0xE7, 0xA8, 0x9C, 0x43, 0xE7, 0xA9, 0x80, 0x43, 0xE7, 0xA9, 0x8A, 0x43, 0xE7, 0xA9, 0x8F, 0x43, 0xE7, 0xA9, 0xB4, 0x43, 0xE7, 0xA9, 0xBA, 0x43, 0xE7, 0xAA, 0x81, 0x43, 0xE7, 0xAA, 0xB1, 0x43, 0xE7, 0xAB, 0x8B, 0x43, 0xE7, 0xAB, 0xAE, 0x43, 0xE7, 0xAB, 0xB9, 0x43, 0xE7, // Bytes 11c0 - 11ff 0xAC, 0xA0, 0x43, 0xE7, 0xAE, 0x8F, 0x43, 0xE7, 0xAF, 0x80, 0x43, 0xE7, 0xAF, 0x86, 0x43, 0xE7, 0xAF, 0x89, 0x43, 0xE7, 0xB0, 0xBE, 0x43, 0xE7, 0xB1, 0xA0, 0x43, 0xE7, 0xB1, 0xB3, 0x43, 0xE7, 0xB1, 0xBB, 0x43, 0xE7, 0xB2, 0x92, 0x43, 0xE7, 0xB2, 0xBE, 0x43, 0xE7, 0xB3, 0x92, 0x43, 0xE7, 0xB3, 0x96, 0x43, 0xE7, 0xB3, 0xA3, 0x43, 0xE7, 0xB3, 0xA7, 0x43, 0xE7, 0xB3, 0xA8, 0x43, 0xE7, // Bytes 1200 - 123f 0xB3, 0xB8, 0x43, 0xE7, 0xB4, 0x80, 0x43, 0xE7, 0xB4, 0x90, 0x43, 0xE7, 0xB4, 0xA2, 0x43, 0xE7, 0xB4, 0xAF, 0x43, 0xE7, 0xB5, 0x82, 0x43, 0xE7, 0xB5, 0x9B, 0x43, 0xE7, 0xB5, 0xA3, 0x43, 0xE7, 0xB6, 0xA0, 0x43, 0xE7, 0xB6, 0xBE, 0x43, 0xE7, 0xB7, 0x87, 0x43, 0xE7, 0xB7, 0xB4, 0x43, 0xE7, 0xB8, 0x82, 0x43, 0xE7, 0xB8, 0x89, 0x43, 0xE7, 0xB8, 0xB7, 0x43, 0xE7, 0xB9, 0x81, 0x43, 0xE7, // Bytes 1240 - 127f 0xB9, 0x85, 0x43, 0xE7, 0xBC, 0xB6, 0x43, 0xE7, 0xBC, 0xBE, 0x43, 0xE7, 0xBD, 0x91, 0x43, 0xE7, 0xBD, 0xB2, 0x43, 0xE7, 0xBD, 0xB9, 0x43, 0xE7, 0xBD, 0xBA, 0x43, 0xE7, 0xBE, 0x85, 0x43, 0xE7, 0xBE, 0x8A, 0x43, 0xE7, 0xBE, 0x95, 0x43, 0xE7, 0xBE, 0x9A, 0x43, 0xE7, 0xBE, 0xBD, 0x43, 0xE7, 0xBF, 0xBA, 0x43, 0xE8, 0x80, 0x81, 0x43, 0xE8, 0x80, 0x85, 0x43, 0xE8, 0x80, 0x8C, 0x43, 0xE8, // Bytes 1280 - 12bf 0x80, 0x92, 0x43, 0xE8, 0x80, 0xB3, 0x43, 0xE8, 0x81, 0x86, 0x43, 0xE8, 0x81, 0xA0, 0x43, 0xE8, 0x81, 0xAF, 0x43, 0xE8, 0x81, 0xB0, 0x43, 0xE8, 0x81, 0xBE, 0x43, 0xE8, 0x81, 0xBF, 0x43, 0xE8, 0x82, 0x89, 0x43, 0xE8, 0x82, 0x8B, 0x43, 0xE8, 0x82, 0xAD, 0x43, 0xE8, 0x82, 0xB2, 0x43, 0xE8, 0x84, 0x83, 0x43, 0xE8, 0x84, 0xBE, 0x43, 0xE8, 0x87, 0x98, 0x43, 0xE8, 0x87, 0xA3, 0x43, 0xE8, // Bytes 12c0 - 12ff 0x87, 0xA8, 0x43, 0xE8, 0x87, 0xAA, 0x43, 0xE8, 0x87, 0xAD, 0x43, 0xE8, 0x87, 0xB3, 0x43, 0xE8, 0x87, 0xBC, 0x43, 0xE8, 0x88, 0x81, 0x43, 0xE8, 0x88, 0x84, 0x43, 0xE8, 0x88, 0x8C, 0x43, 0xE8, 0x88, 0x98, 0x43, 0xE8, 0x88, 0x9B, 0x43, 0xE8, 0x88, 0x9F, 0x43, 0xE8, 0x89, 0xAE, 0x43, 0xE8, 0x89, 0xAF, 0x43, 0xE8, 0x89, 0xB2, 0x43, 0xE8, 0x89, 0xB8, 0x43, 0xE8, 0x89, 0xB9, 0x43, 0xE8, // Bytes 1300 - 133f 0x8A, 0x8B, 0x43, 0xE8, 0x8A, 0x91, 0x43, 0xE8, 0x8A, 0x9D, 0x43, 0xE8, 0x8A, 0xB1, 0x43, 0xE8, 0x8A, 0xB3, 0x43, 0xE8, 0x8A, 0xBD, 0x43, 0xE8, 0x8B, 0xA5, 0x43, 0xE8, 0x8B, 0xA6, 0x43, 0xE8, 0x8C, 0x9D, 0x43, 0xE8, 0x8C, 0xA3, 0x43, 0xE8, 0x8C, 0xB6, 0x43, 0xE8, 0x8D, 0x92, 0x43, 0xE8, 0x8D, 0x93, 0x43, 0xE8, 0x8D, 0xA3, 0x43, 0xE8, 0x8E, 0xAD, 0x43, 0xE8, 0x8E, 0xBD, 0x43, 0xE8, // Bytes 1340 - 137f 0x8F, 0x89, 0x43, 0xE8, 0x8F, 0x8A, 0x43, 0xE8, 0x8F, 0x8C, 0x43, 0xE8, 0x8F, 0x9C, 0x43, 0xE8, 0x8F, 0xA7, 0x43, 0xE8, 0x8F, 0xAF, 0x43, 0xE8, 0x8F, 0xB1, 0x43, 0xE8, 0x90, 0xBD, 0x43, 0xE8, 0x91, 0x89, 0x43, 0xE8, 0x91, 0x97, 0x43, 0xE8, 0x93, 0xAE, 0x43, 0xE8, 0x93, 0xB1, 0x43, 0xE8, 0x93, 0xB3, 0x43, 0xE8, 0x93, 0xBC, 0x43, 0xE8, 0x94, 0x96, 0x43, 0xE8, 0x95, 0xA4, 0x43, 0xE8, // Bytes 1380 - 13bf 0x97, 0x8D, 0x43, 0xE8, 0x97, 0xBA, 0x43, 0xE8, 0x98, 0x86, 0x43, 0xE8, 0x98, 0x92, 0x43, 0xE8, 0x98, 0xAD, 0x43, 0xE8, 0x98, 0xBF, 0x43, 0xE8, 0x99, 0x8D, 0x43, 0xE8, 0x99, 0x90, 0x43, 0xE8, 0x99, 0x9C, 0x43, 0xE8, 0x99, 0xA7, 0x43, 0xE8, 0x99, 0xA9, 0x43, 0xE8, 0x99, 0xAB, 0x43, 0xE8, 0x9A, 0x88, 0x43, 0xE8, 0x9A, 0xA9, 0x43, 0xE8, 0x9B, 0xA2, 0x43, 0xE8, 0x9C, 0x8E, 0x43, 0xE8, // Bytes 13c0 - 13ff 0x9C, 0xA8, 0x43, 0xE8, 0x9D, 0xAB, 0x43, 0xE8, 0x9D, 0xB9, 0x43, 0xE8, 0x9E, 0x86, 0x43, 0xE8, 0x9E, 0xBA, 0x43, 0xE8, 0x9F, 0xA1, 0x43, 0xE8, 0xA0, 0x81, 0x43, 0xE8, 0xA0, 0x9F, 0x43, 0xE8, 0xA1, 0x80, 0x43, 0xE8, 0xA1, 0x8C, 0x43, 0xE8, 0xA1, 0xA0, 0x43, 0xE8, 0xA1, 0xA3, 0x43, 0xE8, 0xA3, 0x82, 0x43, 0xE8, 0xA3, 0x8F, 0x43, 0xE8, 0xA3, 0x97, 0x43, 0xE8, 0xA3, 0x9E, 0x43, 0xE8, // Bytes 1400 - 143f 0xA3, 0xA1, 0x43, 0xE8, 0xA3, 0xB8, 0x43, 0xE8, 0xA3, 0xBA, 0x43, 0xE8, 0xA4, 0x90, 0x43, 0xE8, 0xA5, 0x81, 0x43, 0xE8, 0xA5, 0xA4, 0x43, 0xE8, 0xA5, 0xBE, 0x43, 0xE8, 0xA6, 0x86, 0x43, 0xE8, 0xA6, 0x8B, 0x43, 0xE8, 0xA6, 0x96, 0x43, 0xE8, 0xA7, 0x92, 0x43, 0xE8, 0xA7, 0xA3, 0x43, 0xE8, 0xA8, 0x80, 0x43, 0xE8, 0xAA, 0xA0, 0x43, 0xE8, 0xAA, 0xAA, 0x43, 0xE8, 0xAA, 0xBF, 0x43, 0xE8, // Bytes 1440 - 147f 0xAB, 0x8B, 0x43, 0xE8, 0xAB, 0x92, 0x43, 0xE8, 0xAB, 0x96, 0x43, 0xE8, 0xAB, 0xAD, 0x43, 0xE8, 0xAB, 0xB8, 0x43, 0xE8, 0xAB, 0xBE, 0x43, 0xE8, 0xAC, 0x81, 0x43, 0xE8, 0xAC, 0xB9, 0x43, 0xE8, 0xAD, 0x98, 0x43, 0xE8, 0xAE, 0x80, 0x43, 0xE8, 0xAE, 0x8A, 0x43, 0xE8, 0xB0, 0xB7, 0x43, 0xE8, 0xB1, 0x86, 0x43, 0xE8, 0xB1, 0x88, 0x43, 0xE8, 0xB1, 0x95, 0x43, 0xE8, 0xB1, 0xB8, 0x43, 0xE8, // Bytes 1480 - 14bf 0xB2, 0x9D, 0x43, 0xE8, 0xB2, 0xA1, 0x43, 0xE8, 0xB2, 0xA9, 0x43, 0xE8, 0xB2, 0xAB, 0x43, 0xE8, 0xB3, 0x81, 0x43, 0xE8, 0xB3, 0x82, 0x43, 0xE8, 0xB3, 0x87, 0x43, 0xE8, 0xB3, 0x88, 0x43, 0xE8, 0xB3, 0x93, 0x43, 0xE8, 0xB4, 0x88, 0x43, 0xE8, 0xB4, 0x9B, 0x43, 0xE8, 0xB5, 0xA4, 0x43, 0xE8, 0xB5, 0xB0, 0x43, 0xE8, 0xB5, 0xB7, 0x43, 0xE8, 0xB6, 0xB3, 0x43, 0xE8, 0xB6, 0xBC, 0x43, 0xE8, // Bytes 14c0 - 14ff 0xB7, 0x8B, 0x43, 0xE8, 0xB7, 0xAF, 0x43, 0xE8, 0xB7, 0xB0, 0x43, 0xE8, 0xBA, 0xAB, 0x43, 0xE8, 0xBB, 0x8A, 0x43, 0xE8, 0xBB, 0x94, 0x43, 0xE8, 0xBC, 0xA6, 0x43, 0xE8, 0xBC, 0xAA, 0x43, 0xE8, 0xBC, 0xB8, 0x43, 0xE8, 0xBC, 0xBB, 0x43, 0xE8, 0xBD, 0xA2, 0x43, 0xE8, 0xBE, 0x9B, 0x43, 0xE8, 0xBE, 0x9E, 0x43, 0xE8, 0xBE, 0xB0, 0x43, 0xE8, 0xBE, 0xB5, 0x43, 0xE8, 0xBE, 0xB6, 0x43, 0xE9, // Bytes 1500 - 153f 0x80, 0xA3, 0x43, 0xE9, 0x80, 0xB8, 0x43, 0xE9, 0x81, 0x8A, 0x43, 0xE9, 0x81, 0xA9, 0x43, 0xE9, 0x81, 0xB2, 0x43, 0xE9, 0x81, 0xBC, 0x43, 0xE9, 0x82, 0x8F, 0x43, 0xE9, 0x82, 0x91, 0x43, 0xE9, 0x82, 0x94, 0x43, 0xE9, 0x83, 0x8E, 0x43, 0xE9, 0x83, 0x9E, 0x43, 0xE9, 0x83, 0xB1, 0x43, 0xE9, 0x83, 0xBD, 0x43, 0xE9, 0x84, 0x91, 0x43, 0xE9, 0x84, 0x9B, 0x43, 0xE9, 0x85, 0x89, 0x43, 0xE9, // Bytes 1540 - 157f 0x85, 0x8D, 0x43, 0xE9, 0x85, 0xAA, 0x43, 0xE9, 0x86, 0x99, 0x43, 0xE9, 0x86, 0xB4, 0x43, 0xE9, 0x87, 0x86, 0x43, 0xE9, 0x87, 0x8C, 0x43, 0xE9, 0x87, 0x8F, 0x43, 0xE9, 0x87, 0x91, 0x43, 0xE9, 0x88, 0xB4, 0x43, 0xE9, 0x88, 0xB8, 0x43, 0xE9, 0x89, 0xB6, 0x43, 0xE9, 0x89, 0xBC, 0x43, 0xE9, 0x8B, 0x97, 0x43, 0xE9, 0x8B, 0x98, 0x43, 0xE9, 0x8C, 0x84, 0x43, 0xE9, 0x8D, 0x8A, 0x43, 0xE9, // Bytes 1580 - 15bf 0x8F, 0xB9, 0x43, 0xE9, 0x90, 0x95, 0x43, 0xE9, 0x95, 0xB7, 0x43, 0xE9, 0x96, 0x80, 0x43, 0xE9, 0x96, 0x8B, 0x43, 0xE9, 0x96, 0xAD, 0x43, 0xE9, 0x96, 0xB7, 0x43, 0xE9, 0x98, 0x9C, 0x43, 0xE9, 0x98, 0xAE, 0x43, 0xE9, 0x99, 0x8B, 0x43, 0xE9, 0x99, 0x8D, 0x43, 0xE9, 0x99, 0xB5, 0x43, 0xE9, 0x99, 0xB8, 0x43, 0xE9, 0x99, 0xBC, 0x43, 0xE9, 0x9A, 0x86, 0x43, 0xE9, 0x9A, 0xA3, 0x43, 0xE9, // Bytes 15c0 - 15ff 0x9A, 0xB6, 0x43, 0xE9, 0x9A, 0xB7, 0x43, 0xE9, 0x9A, 0xB8, 0x43, 0xE9, 0x9A, 0xB9, 0x43, 0xE9, 0x9B, 0x83, 0x43, 0xE9, 0x9B, 0xA2, 0x43, 0xE9, 0x9B, 0xA3, 0x43, 0xE9, 0x9B, 0xA8, 0x43, 0xE9, 0x9B, 0xB6, 0x43, 0xE9, 0x9B, 0xB7, 0x43, 0xE9, 0x9C, 0xA3, 0x43, 0xE9, 0x9C, 0xB2, 0x43, 0xE9, 0x9D, 0x88, 0x43, 0xE9, 0x9D, 0x91, 0x43, 0xE9, 0x9D, 0x96, 0x43, 0xE9, 0x9D, 0x9E, 0x43, 0xE9, // Bytes 1600 - 163f 0x9D, 0xA2, 0x43, 0xE9, 0x9D, 0xA9, 0x43, 0xE9, 0x9F, 0x8B, 0x43, 0xE9, 0x9F, 0x9B, 0x43, 0xE9, 0x9F, 0xA0, 0x43, 0xE9, 0x9F, 0xAD, 0x43, 0xE9, 0x9F, 0xB3, 0x43, 0xE9, 0x9F, 0xBF, 0x43, 0xE9, 0xA0, 0x81, 0x43, 0xE9, 0xA0, 0x85, 0x43, 0xE9, 0xA0, 0x8B, 0x43, 0xE9, 0xA0, 0x98, 0x43, 0xE9, 0xA0, 0xA9, 0x43, 0xE9, 0xA0, 0xBB, 0x43, 0xE9, 0xA1, 0x9E, 0x43, 0xE9, 0xA2, 0xA8, 0x43, 0xE9, // Bytes 1640 - 167f 0xA3, 0x9B, 0x43, 0xE9, 0xA3, 0x9F, 0x43, 0xE9, 0xA3, 0xA2, 0x43, 0xE9, 0xA3, 0xAF, 0x43, 0xE9, 0xA3, 0xBC, 0x43, 0xE9, 0xA4, 0xA8, 0x43, 0xE9, 0xA4, 0xA9, 0x43, 0xE9, 0xA6, 0x96, 0x43, 0xE9, 0xA6, 0x99, 0x43, 0xE9, 0xA6, 0xA7, 0x43, 0xE9, 0xA6, 0xAC, 0x43, 0xE9, 0xA7, 0x82, 0x43, 0xE9, 0xA7, 0xB1, 0x43, 0xE9, 0xA7, 0xBE, 0x43, 0xE9, 0xA9, 0xAA, 0x43, 0xE9, 0xAA, 0xA8, 0x43, 0xE9, // Bytes 1680 - 16bf 0xAB, 0x98, 0x43, 0xE9, 0xAB, 0x9F, 0x43, 0xE9, 0xAC, 0x92, 0x43, 0xE9, 0xAC, 0xA5, 0x43, 0xE9, 0xAC, 0xAF, 0x43, 0xE9, 0xAC, 0xB2, 0x43, 0xE9, 0xAC, 0xBC, 0x43, 0xE9, 0xAD, 0x9A, 0x43, 0xE9, 0xAD, 0xAF, 0x43, 0xE9, 0xB1, 0x80, 0x43, 0xE9, 0xB1, 0x97, 0x43, 0xE9, 0xB3, 0xA5, 0x43, 0xE9, 0xB3, 0xBD, 0x43, 0xE9, 0xB5, 0xA7, 0x43, 0xE9, 0xB6, 0xB4, 0x43, 0xE9, 0xB7, 0xBA, 0x43, 0xE9, // Bytes 16c0 - 16ff 0xB8, 0x9E, 0x43, 0xE9, 0xB9, 0xB5, 0x43, 0xE9, 0xB9, 0xBF, 0x43, 0xE9, 0xBA, 0x97, 0x43, 0xE9, 0xBA, 0x9F, 0x43, 0xE9, 0xBA, 0xA5, 0x43, 0xE9, 0xBA, 0xBB, 0x43, 0xE9, 0xBB, 0x83, 0x43, 0xE9, 0xBB, 0x8D, 0x43, 0xE9, 0xBB, 0x8E, 0x43, 0xE9, 0xBB, 0x91, 0x43, 0xE9, 0xBB, 0xB9, 0x43, 0xE9, 0xBB, 0xBD, 0x43, 0xE9, 0xBB, 0xBE, 0x43, 0xE9, 0xBC, 0x85, 0x43, 0xE9, 0xBC, 0x8E, 0x43, 0xE9, // Bytes 1700 - 173f 0xBC, 0x8F, 0x43, 0xE9, 0xBC, 0x93, 0x43, 0xE9, 0xBC, 0x96, 0x43, 0xE9, 0xBC, 0xA0, 0x43, 0xE9, 0xBC, 0xBB, 0x43, 0xE9, 0xBD, 0x83, 0x43, 0xE9, 0xBD, 0x8A, 0x43, 0xE9, 0xBD, 0x92, 0x43, 0xE9, 0xBE, 0x8D, 0x43, 0xE9, 0xBE, 0x8E, 0x43, 0xE9, 0xBE, 0x9C, 0x43, 0xE9, 0xBE, 0x9F, 0x43, 0xE9, 0xBE, 0xA0, 0x43, 0xEA, 0x99, 0x91, 0x43, 0xEA, 0x9A, 0x89, 0x43, 0xEA, 0x9C, 0xA7, 0x43, 0xEA, // Bytes 1740 - 177f 0x9D, 0xAF, 0x43, 0xEA, 0x9E, 0x8E, 0x43, 0xEA, 0xAC, 0xB7, 0x43, 0xEA, 0xAD, 0x92, 0x43, 0xEA, 0xAD, 0xA6, 0x43, 0xEA, 0xAD, 0xA7, 0x44, 0xF0, 0x9D, 0xBC, 0x84, 0x44, 0xF0, 0x9D, 0xBC, 0x85, 0x44, 0xF0, 0x9D, 0xBC, 0x86, 0x44, 0xF0, 0x9D, 0xBC, 0x88, 0x44, 0xF0, 0x9D, 0xBC, 0x8A, 0x44, 0xF0, 0x9D, 0xBC, 0x9E, 0x44, 0xF0, 0xA0, 0x84, 0xA2, 0x44, 0xF0, 0xA0, 0x94, 0x9C, 0x44, 0xF0, // Bytes 1780 - 17bf 0xA0, 0x94, 0xA5, 0x44, 0xF0, 0xA0, 0x95, 0x8B, 0x44, 0xF0, 0xA0, 0x98, 0xBA, 0x44, 0xF0, 0xA0, 0xA0, 0x84, 0x44, 0xF0, 0xA0, 0xA3, 0x9E, 0x44, 0xF0, 0xA0, 0xA8, 0xAC, 0x44, 0xF0, 0xA0, 0xAD, 0xA3, 0x44, 0xF0, 0xA1, 0x93, 0xA4, 0x44, 0xF0, 0xA1, 0x9A, 0xA8, 0x44, 0xF0, 0xA1, 0x9B, 0xAA, 0x44, 0xF0, 0xA1, 0xA7, 0x88, 0x44, 0xF0, 0xA1, 0xAC, 0x98, 0x44, 0xF0, 0xA1, 0xB4, 0x8B, 0x44, // Bytes 17c0 - 17ff 0xF0, 0xA1, 0xB7, 0xA4, 0x44, 0xF0, 0xA1, 0xB7, 0xA6, 0x44, 0xF0, 0xA2, 0x86, 0x83, 0x44, 0xF0, 0xA2, 0x86, 0x9F, 0x44, 0xF0, 0xA2, 0x8C, 0xB1, 0x44, 0xF0, 0xA2, 0x9B, 0x94, 0x44, 0xF0, 0xA2, 0xA1, 0x84, 0x44, 0xF0, 0xA2, 0xA1, 0x8A, 0x44, 0xF0, 0xA2, 0xAC, 0x8C, 0x44, 0xF0, 0xA2, 0xAF, 0xB1, 0x44, 0xF0, 0xA3, 0x80, 0x8A, 0x44, 0xF0, 0xA3, 0x8A, 0xB8, 0x44, 0xF0, 0xA3, 0x8D, 0x9F, // Bytes 1800 - 183f 0x44, 0xF0, 0xA3, 0x8E, 0x93, 0x44, 0xF0, 0xA3, 0x8E, 0x9C, 0x44, 0xF0, 0xA3, 0x8F, 0x83, 0x44, 0xF0, 0xA3, 0x8F, 0x95, 0x44, 0xF0, 0xA3, 0x91, 0xAD, 0x44, 0xF0, 0xA3, 0x9A, 0xA3, 0x44, 0xF0, 0xA3, 0xA2, 0xA7, 0x44, 0xF0, 0xA3, 0xAA, 0x8D, 0x44, 0xF0, 0xA3, 0xAB, 0xBA, 0x44, 0xF0, 0xA3, 0xB2, 0xBC, 0x44, 0xF0, 0xA3, 0xB4, 0x9E, 0x44, 0xF0, 0xA3, 0xBB, 0x91, 0x44, 0xF0, 0xA3, 0xBD, // Bytes 1840 - 187f 0x9E, 0x44, 0xF0, 0xA3, 0xBE, 0x8E, 0x44, 0xF0, 0xA4, 0x89, 0xA3, 0x44, 0xF0, 0xA4, 0x8B, 0xAE, 0x44, 0xF0, 0xA4, 0x8E, 0xAB, 0x44, 0xF0, 0xA4, 0x98, 0x88, 0x44, 0xF0, 0xA4, 0x9C, 0xB5, 0x44, 0xF0, 0xA4, 0xA0, 0x94, 0x44, 0xF0, 0xA4, 0xB0, 0xB6, 0x44, 0xF0, 0xA4, 0xB2, 0x92, 0x44, 0xF0, 0xA4, 0xBE, 0xA1, 0x44, 0xF0, 0xA4, 0xBE, 0xB8, 0x44, 0xF0, 0xA5, 0x81, 0x84, 0x44, 0xF0, 0xA5, // Bytes 1880 - 18bf 0x83, 0xB2, 0x44, 0xF0, 0xA5, 0x83, 0xB3, 0x44, 0xF0, 0xA5, 0x84, 0x99, 0x44, 0xF0, 0xA5, 0x84, 0xB3, 0x44, 0xF0, 0xA5, 0x89, 0x89, 0x44, 0xF0, 0xA5, 0x90, 0x9D, 0x44, 0xF0, 0xA5, 0x98, 0xA6, 0x44, 0xF0, 0xA5, 0x9A, 0x9A, 0x44, 0xF0, 0xA5, 0x9B, 0x85, 0x44, 0xF0, 0xA5, 0xA5, 0xBC, 0x44, 0xF0, 0xA5, 0xAA, 0xA7, 0x44, 0xF0, 0xA5, 0xAE, 0xAB, 0x44, 0xF0, 0xA5, 0xB2, 0x80, 0x44, 0xF0, // Bytes 18c0 - 18ff 0xA5, 0xB3, 0x90, 0x44, 0xF0, 0xA5, 0xBE, 0x86, 0x44, 0xF0, 0xA6, 0x87, 0x9A, 0x44, 0xF0, 0xA6, 0x88, 0xA8, 0x44, 0xF0, 0xA6, 0x89, 0x87, 0x44, 0xF0, 0xA6, 0x8B, 0x99, 0x44, 0xF0, 0xA6, 0x8C, 0xBE, 0x44, 0xF0, 0xA6, 0x93, 0x9A, 0x44, 0xF0, 0xA6, 0x94, 0xA3, 0x44, 0xF0, 0xA6, 0x96, 0xA8, 0x44, 0xF0, 0xA6, 0x9E, 0xA7, 0x44, 0xF0, 0xA6, 0x9E, 0xB5, 0x44, 0xF0, 0xA6, 0xAC, 0xBC, 0x44, // Bytes 1900 - 193f 0xF0, 0xA6, 0xB0, 0xB6, 0x44, 0xF0, 0xA6, 0xB3, 0x95, 0x44, 0xF0, 0xA6, 0xB5, 0xAB, 0x44, 0xF0, 0xA6, 0xBC, 0xAC, 0x44, 0xF0, 0xA6, 0xBE, 0xB1, 0x44, 0xF0, 0xA7, 0x83, 0x92, 0x44, 0xF0, 0xA7, 0x8F, 0x8A, 0x44, 0xF0, 0xA7, 0x99, 0xA7, 0x44, 0xF0, 0xA7, 0xA2, 0xAE, 0x44, 0xF0, 0xA7, 0xA5, 0xA6, 0x44, 0xF0, 0xA7, 0xB2, 0xA8, 0x44, 0xF0, 0xA7, 0xBB, 0x93, 0x44, 0xF0, 0xA7, 0xBC, 0xAF, // Bytes 1940 - 197f 0x44, 0xF0, 0xA8, 0x97, 0x92, 0x44, 0xF0, 0xA8, 0x97, 0xAD, 0x44, 0xF0, 0xA8, 0x9C, 0xAE, 0x44, 0xF0, 0xA8, 0xAF, 0xBA, 0x44, 0xF0, 0xA8, 0xB5, 0xB7, 0x44, 0xF0, 0xA9, 0x85, 0x85, 0x44, 0xF0, 0xA9, 0x87, 0x9F, 0x44, 0xF0, 0xA9, 0x88, 0x9A, 0x44, 0xF0, 0xA9, 0x90, 0x8A, 0x44, 0xF0, 0xA9, 0x92, 0x96, 0x44, 0xF0, 0xA9, 0x96, 0xB6, 0x44, 0xF0, 0xA9, 0xAC, 0xB0, 0x44, 0xF0, 0xAA, 0x83, // Bytes 1980 - 19bf 0x8E, 0x44, 0xF0, 0xAA, 0x84, 0x85, 0x44, 0xF0, 0xAA, 0x88, 0x8E, 0x44, 0xF0, 0xAA, 0x8A, 0x91, 0x44, 0xF0, 0xAA, 0x8E, 0x92, 0x44, 0xF0, 0xAA, 0x98, 0x80, 0x42, 0x21, 0x21, 0x42, 0x21, 0x3F, 0x42, 0x2E, 0x2E, 0x42, 0x30, 0x2C, 0x42, 0x30, 0x2E, 0x42, 0x31, 0x2C, 0x42, 0x31, 0x2E, 0x42, 0x31, 0x30, 0x42, 0x31, 0x31, 0x42, 0x31, 0x32, 0x42, 0x31, 0x33, 0x42, 0x31, 0x34, 0x42, 0x31, // Bytes 19c0 - 19ff 0x35, 0x42, 0x31, 0x36, 0x42, 0x31, 0x37, 0x42, 0x31, 0x38, 0x42, 0x31, 0x39, 0x42, 0x32, 0x2C, 0x42, 0x32, 0x2E, 0x42, 0x32, 0x30, 0x42, 0x32, 0x31, 0x42, 0x32, 0x32, 0x42, 0x32, 0x33, 0x42, 0x32, 0x34, 0x42, 0x32, 0x35, 0x42, 0x32, 0x36, 0x42, 0x32, 0x37, 0x42, 0x32, 0x38, 0x42, 0x32, 0x39, 0x42, 0x33, 0x2C, 0x42, 0x33, 0x2E, 0x42, 0x33, 0x30, 0x42, 0x33, 0x31, 0x42, 0x33, 0x32, // Bytes 1a00 - 1a3f 0x42, 0x33, 0x33, 0x42, 0x33, 0x34, 0x42, 0x33, 0x35, 0x42, 0x33, 0x36, 0x42, 0x33, 0x37, 0x42, 0x33, 0x38, 0x42, 0x33, 0x39, 0x42, 0x34, 0x2C, 0x42, 0x34, 0x2E, 0x42, 0x34, 0x30, 0x42, 0x34, 0x31, 0x42, 0x34, 0x32, 0x42, 0x34, 0x33, 0x42, 0x34, 0x34, 0x42, 0x34, 0x35, 0x42, 0x34, 0x36, 0x42, 0x34, 0x37, 0x42, 0x34, 0x38, 0x42, 0x34, 0x39, 0x42, 0x35, 0x2C, 0x42, 0x35, 0x2E, 0x42, // Bytes 1a40 - 1a7f 0x35, 0x30, 0x42, 0x36, 0x2C, 0x42, 0x36, 0x2E, 0x42, 0x37, 0x2C, 0x42, 0x37, 0x2E, 0x42, 0x38, 0x2C, 0x42, 0x38, 0x2E, 0x42, 0x39, 0x2C, 0x42, 0x39, 0x2E, 0x42, 0x3D, 0x3D, 0x42, 0x3F, 0x21, 0x42, 0x3F, 0x3F, 0x42, 0x41, 0x55, 0x42, 0x42, 0x71, 0x42, 0x43, 0x44, 0x42, 0x44, 0x4A, 0x42, 0x44, 0x5A, 0x42, 0x44, 0x7A, 0x42, 0x47, 0x42, 0x42, 0x47, 0x79, 0x42, 0x48, 0x50, 0x42, 0x48, // Bytes 1a80 - 1abf 0x56, 0x42, 0x48, 0x67, 0x42, 0x48, 0x7A, 0x42, 0x49, 0x49, 0x42, 0x49, 0x4A, 0x42, 0x49, 0x55, 0x42, 0x49, 0x56, 0x42, 0x49, 0x58, 0x42, 0x4B, 0x42, 0x42, 0x4B, 0x4B, 0x42, 0x4B, 0x4D, 0x42, 0x4C, 0x4A, 0x42, 0x4C, 0x6A, 0x42, 0x4D, 0x42, 0x42, 0x4D, 0x43, 0x42, 0x4D, 0x44, 0x42, 0x4D, 0x52, 0x42, 0x4D, 0x56, 0x42, 0x4D, 0x57, 0x42, 0x4E, 0x4A, 0x42, 0x4E, 0x6A, 0x42, 0x4E, 0x6F, // Bytes 1ac0 - 1aff 0x42, 0x50, 0x48, 0x42, 0x50, 0x52, 0x42, 0x50, 0x61, 0x42, 0x52, 0x73, 0x42, 0x53, 0x44, 0x42, 0x53, 0x4D, 0x42, 0x53, 0x53, 0x42, 0x53, 0x76, 0x42, 0x54, 0x4D, 0x42, 0x56, 0x49, 0x42, 0x57, 0x43, 0x42, 0x57, 0x5A, 0x42, 0x57, 0x62, 0x42, 0x58, 0x49, 0x42, 0x63, 0x63, 0x42, 0x63, 0x64, 0x42, 0x63, 0x6D, 0x42, 0x64, 0x42, 0x42, 0x64, 0x61, 0x42, 0x64, 0x6C, 0x42, 0x64, 0x6D, 0x42, // Bytes 1b00 - 1b3f 0x64, 0x7A, 0x42, 0x65, 0x56, 0x42, 0x66, 0x66, 0x42, 0x66, 0x69, 0x42, 0x66, 0x6C, 0x42, 0x66, 0x6D, 0x42, 0x68, 0x61, 0x42, 0x69, 0x69, 0x42, 0x69, 0x6A, 0x42, 0x69, 0x6E, 0x42, 0x69, 0x76, 0x42, 0x69, 0x78, 0x42, 0x6B, 0x41, 0x42, 0x6B, 0x56, 0x42, 0x6B, 0x57, 0x42, 0x6B, 0x67, 0x42, 0x6B, 0x6C, 0x42, 0x6B, 0x6D, 0x42, 0x6B, 0x74, 0x42, 0x6C, 0x6A, 0x42, 0x6C, 0x6D, 0x42, 0x6C, // Bytes 1b40 - 1b7f 0x6E, 0x42, 0x6C, 0x78, 0x42, 0x6D, 0x32, 0x42, 0x6D, 0x33, 0x42, 0x6D, 0x41, 0x42, 0x6D, 0x56, 0x42, 0x6D, 0x57, 0x42, 0x6D, 0x62, 0x42, 0x6D, 0x67, 0x42, 0x6D, 0x6C, 0x42, 0x6D, 0x6D, 0x42, 0x6D, 0x73, 0x42, 0x6E, 0x41, 0x42, 0x6E, 0x46, 0x42, 0x6E, 0x56, 0x42, 0x6E, 0x57, 0x42, 0x6E, 0x6A, 0x42, 0x6E, 0x6D, 0x42, 0x6E, 0x73, 0x42, 0x6F, 0x56, 0x42, 0x70, 0x41, 0x42, 0x70, 0x46, // Bytes 1b80 - 1bbf 0x42, 0x70, 0x56, 0x42, 0x70, 0x57, 0x42, 0x70, 0x63, 0x42, 0x70, 0x73, 0x42, 0x73, 0x72, 0x42, 0x73, 0x74, 0x42, 0x76, 0x69, 0x42, 0x78, 0x69, 0x43, 0x28, 0x31, 0x29, 0x43, 0x28, 0x32, 0x29, 0x43, 0x28, 0x33, 0x29, 0x43, 0x28, 0x34, 0x29, 0x43, 0x28, 0x35, 0x29, 0x43, 0x28, 0x36, 0x29, 0x43, 0x28, 0x37, 0x29, 0x43, 0x28, 0x38, 0x29, 0x43, 0x28, 0x39, 0x29, 0x43, 0x28, 0x41, 0x29, // Bytes 1bc0 - 1bff 0x43, 0x28, 0x42, 0x29, 0x43, 0x28, 0x43, 0x29, 0x43, 0x28, 0x44, 0x29, 0x43, 0x28, 0x45, 0x29, 0x43, 0x28, 0x46, 0x29, 0x43, 0x28, 0x47, 0x29, 0x43, 0x28, 0x48, 0x29, 0x43, 0x28, 0x49, 0x29, 0x43, 0x28, 0x4A, 0x29, 0x43, 0x28, 0x4B, 0x29, 0x43, 0x28, 0x4C, 0x29, 0x43, 0x28, 0x4D, 0x29, 0x43, 0x28, 0x4E, 0x29, 0x43, 0x28, 0x4F, 0x29, 0x43, 0x28, 0x50, 0x29, 0x43, 0x28, 0x51, 0x29, // Bytes 1c00 - 1c3f 0x43, 0x28, 0x52, 0x29, 0x43, 0x28, 0x53, 0x29, 0x43, 0x28, 0x54, 0x29, 0x43, 0x28, 0x55, 0x29, 0x43, 0x28, 0x56, 0x29, 0x43, 0x28, 0x57, 0x29, 0x43, 0x28, 0x58, 0x29, 0x43, 0x28, 0x59, 0x29, 0x43, 0x28, 0x5A, 0x29, 0x43, 0x28, 0x61, 0x29, 0x43, 0x28, 0x62, 0x29, 0x43, 0x28, 0x63, 0x29, 0x43, 0x28, 0x64, 0x29, 0x43, 0x28, 0x65, 0x29, 0x43, 0x28, 0x66, 0x29, 0x43, 0x28, 0x67, 0x29, // Bytes 1c40 - 1c7f 0x43, 0x28, 0x68, 0x29, 0x43, 0x28, 0x69, 0x29, 0x43, 0x28, 0x6A, 0x29, 0x43, 0x28, 0x6B, 0x29, 0x43, 0x28, 0x6C, 0x29, 0x43, 0x28, 0x6D, 0x29, 0x43, 0x28, 0x6E, 0x29, 0x43, 0x28, 0x6F, 0x29, 0x43, 0x28, 0x70, 0x29, 0x43, 0x28, 0x71, 0x29, 0x43, 0x28, 0x72, 0x29, 0x43, 0x28, 0x73, 0x29, 0x43, 0x28, 0x74, 0x29, 0x43, 0x28, 0x75, 0x29, 0x43, 0x28, 0x76, 0x29, 0x43, 0x28, 0x77, 0x29, // Bytes 1c80 - 1cbf 0x43, 0x28, 0x78, 0x29, 0x43, 0x28, 0x79, 0x29, 0x43, 0x28, 0x7A, 0x29, 0x43, 0x2E, 0x2E, 0x2E, 0x43, 0x31, 0x30, 0x2E, 0x43, 0x31, 0x31, 0x2E, 0x43, 0x31, 0x32, 0x2E, 0x43, 0x31, 0x33, 0x2E, 0x43, 0x31, 0x34, 0x2E, 0x43, 0x31, 0x35, 0x2E, 0x43, 0x31, 0x36, 0x2E, 0x43, 0x31, 0x37, 0x2E, 0x43, 0x31, 0x38, 0x2E, 0x43, 0x31, 0x39, 0x2E, 0x43, 0x32, 0x30, 0x2E, 0x43, 0x3A, 0x3A, 0x3D, // Bytes 1cc0 - 1cff 0x43, 0x3D, 0x3D, 0x3D, 0x43, 0x43, 0x6F, 0x2E, 0x43, 0x46, 0x41, 0x58, 0x43, 0x47, 0x48, 0x7A, 0x43, 0x47, 0x50, 0x61, 0x43, 0x49, 0x49, 0x49, 0x43, 0x4C, 0x54, 0x44, 0x43, 0x4C, 0xC2, 0xB7, 0x43, 0x4D, 0x48, 0x7A, 0x43, 0x4D, 0x50, 0x61, 0x43, 0x4D, 0xCE, 0xA9, 0x43, 0x50, 0x50, 0x4D, 0x43, 0x50, 0x50, 0x56, 0x43, 0x50, 0x54, 0x45, 0x43, 0x54, 0x45, 0x4C, 0x43, 0x54, 0x48, 0x7A, // Bytes 1d00 - 1d3f 0x43, 0x56, 0x49, 0x49, 0x43, 0x58, 0x49, 0x49, 0x43, 0x61, 0x2F, 0x63, 0x43, 0x61, 0x2F, 0x73, 0x43, 0x61, 0xCA, 0xBE, 0x43, 0x62, 0x61, 0x72, 0x43, 0x63, 0x2F, 0x6F, 0x43, 0x63, 0x2F, 0x75, 0x43, 0x63, 0x61, 0x6C, 0x43, 0x63, 0x6D, 0x32, 0x43, 0x63, 0x6D, 0x33, 0x43, 0x64, 0x6D, 0x32, 0x43, 0x64, 0x6D, 0x33, 0x43, 0x65, 0x72, 0x67, 0x43, 0x66, 0x66, 0x69, 0x43, 0x66, 0x66, 0x6C, // Bytes 1d40 - 1d7f 0x43, 0x67, 0x61, 0x6C, 0x43, 0x68, 0x50, 0x61, 0x43, 0x69, 0x69, 0x69, 0x43, 0x6B, 0x48, 0x7A, 0x43, 0x6B, 0x50, 0x61, 0x43, 0x6B, 0x6D, 0x32, 0x43, 0x6B, 0x6D, 0x33, 0x43, 0x6B, 0xCE, 0xA9, 0x43, 0x6C, 0x6F, 0x67, 0x43, 0x6C, 0xC2, 0xB7, 0x43, 0x6D, 0x69, 0x6C, 0x43, 0x6D, 0x6D, 0x32, 0x43, 0x6D, 0x6D, 0x33, 0x43, 0x6D, 0x6F, 0x6C, 0x43, 0x72, 0x61, 0x64, 0x43, 0x76, 0x69, 0x69, // Bytes 1d80 - 1dbf 0x43, 0x78, 0x69, 0x69, 0x43, 0xC2, 0xB0, 0x43, 0x43, 0xC2, 0xB0, 0x46, 0x43, 0xCA, 0xBC, 0x6E, 0x43, 0xCE, 0xBC, 0x41, 0x43, 0xCE, 0xBC, 0x46, 0x43, 0xCE, 0xBC, 0x56, 0x43, 0xCE, 0xBC, 0x57, 0x43, 0xCE, 0xBC, 0x67, 0x43, 0xCE, 0xBC, 0x6C, 0x43, 0xCE, 0xBC, 0x6D, 0x43, 0xCE, 0xBC, 0x73, 0x44, 0x28, 0x31, 0x30, 0x29, 0x44, 0x28, 0x31, 0x31, 0x29, 0x44, 0x28, 0x31, 0x32, 0x29, 0x44, // Bytes 1dc0 - 1dff 0x28, 0x31, 0x33, 0x29, 0x44, 0x28, 0x31, 0x34, 0x29, 0x44, 0x28, 0x31, 0x35, 0x29, 0x44, 0x28, 0x31, 0x36, 0x29, 0x44, 0x28, 0x31, 0x37, 0x29, 0x44, 0x28, 0x31, 0x38, 0x29, 0x44, 0x28, 0x31, 0x39, 0x29, 0x44, 0x28, 0x32, 0x30, 0x29, 0x44, 0x30, 0xE7, 0x82, 0xB9, 0x44, 0x31, 0xE2, 0x81, 0x84, 0x44, 0x31, 0xE6, 0x97, 0xA5, 0x44, 0x31, 0xE6, 0x9C, 0x88, 0x44, 0x31, 0xE7, 0x82, 0xB9, // Bytes 1e00 - 1e3f 0x44, 0x32, 0xE6, 0x97, 0xA5, 0x44, 0x32, 0xE6, 0x9C, 0x88, 0x44, 0x32, 0xE7, 0x82, 0xB9, 0x44, 0x33, 0xE6, 0x97, 0xA5, 0x44, 0x33, 0xE6, 0x9C, 0x88, 0x44, 0x33, 0xE7, 0x82, 0xB9, 0x44, 0x34, 0xE6, 0x97, 0xA5, 0x44, 0x34, 0xE6, 0x9C, 0x88, 0x44, 0x34, 0xE7, 0x82, 0xB9, 0x44, 0x35, 0xE6, 0x97, 0xA5, 0x44, 0x35, 0xE6, 0x9C, 0x88, 0x44, 0x35, 0xE7, 0x82, 0xB9, 0x44, 0x36, 0xE6, 0x97, // Bytes 1e40 - 1e7f 0xA5, 0x44, 0x36, 0xE6, 0x9C, 0x88, 0x44, 0x36, 0xE7, 0x82, 0xB9, 0x44, 0x37, 0xE6, 0x97, 0xA5, 0x44, 0x37, 0xE6, 0x9C, 0x88, 0x44, 0x37, 0xE7, 0x82, 0xB9, 0x44, 0x38, 0xE6, 0x97, 0xA5, 0x44, 0x38, 0xE6, 0x9C, 0x88, 0x44, 0x38, 0xE7, 0x82, 0xB9, 0x44, 0x39, 0xE6, 0x97, 0xA5, 0x44, 0x39, 0xE6, 0x9C, 0x88, 0x44, 0x39, 0xE7, 0x82, 0xB9, 0x44, 0x56, 0x49, 0x49, 0x49, 0x44, 0x61, 0x2E, // Bytes 1e80 - 1ebf 0x6D, 0x2E, 0x44, 0x6B, 0x63, 0x61, 0x6C, 0x44, 0x70, 0x2E, 0x6D, 0x2E, 0x44, 0x76, 0x69, 0x69, 0x69, 0x44, 0xD5, 0xA5, 0xD6, 0x82, 0x44, 0xD5, 0xB4, 0xD5, 0xA5, 0x44, 0xD5, 0xB4, 0xD5, 0xAB, 0x44, 0xD5, 0xB4, 0xD5, 0xAD, 0x44, 0xD5, 0xB4, 0xD5, 0xB6, 0x44, 0xD5, 0xBE, 0xD5, 0xB6, 0x44, 0xD7, 0x90, 0xD7, 0x9C, 0x44, 0xD8, 0xA7, 0xD9, 0xB4, 0x44, 0xD8, 0xA8, 0xD8, 0xAC, 0x44, 0xD8, // Bytes 1ec0 - 1eff 0xA8, 0xD8, 0xAD, 0x44, 0xD8, 0xA8, 0xD8, 0xAE, 0x44, 0xD8, 0xA8, 0xD8, 0xB1, 0x44, 0xD8, 0xA8, 0xD8, 0xB2, 0x44, 0xD8, 0xA8, 0xD9, 0x85, 0x44, 0xD8, 0xA8, 0xD9, 0x86, 0x44, 0xD8, 0xA8, 0xD9, 0x87, 0x44, 0xD8, 0xA8, 0xD9, 0x89, 0x44, 0xD8, 0xA8, 0xD9, 0x8A, 0x44, 0xD8, 0xAA, 0xD8, 0xAC, 0x44, 0xD8, 0xAA, 0xD8, 0xAD, 0x44, 0xD8, 0xAA, 0xD8, 0xAE, 0x44, 0xD8, 0xAA, 0xD8, 0xB1, 0x44, // Bytes 1f00 - 1f3f 0xD8, 0xAA, 0xD8, 0xB2, 0x44, 0xD8, 0xAA, 0xD9, 0x85, 0x44, 0xD8, 0xAA, 0xD9, 0x86, 0x44, 0xD8, 0xAA, 0xD9, 0x87, 0x44, 0xD8, 0xAA, 0xD9, 0x89, 0x44, 0xD8, 0xAA, 0xD9, 0x8A, 0x44, 0xD8, 0xAB, 0xD8, 0xAC, 0x44, 0xD8, 0xAB, 0xD8, 0xB1, 0x44, 0xD8, 0xAB, 0xD8, 0xB2, 0x44, 0xD8, 0xAB, 0xD9, 0x85, 0x44, 0xD8, 0xAB, 0xD9, 0x86, 0x44, 0xD8, 0xAB, 0xD9, 0x87, 0x44, 0xD8, 0xAB, 0xD9, 0x89, // Bytes 1f40 - 1f7f 0x44, 0xD8, 0xAB, 0xD9, 0x8A, 0x44, 0xD8, 0xAC, 0xD8, 0xAD, 0x44, 0xD8, 0xAC, 0xD9, 0x85, 0x44, 0xD8, 0xAC, 0xD9, 0x89, 0x44, 0xD8, 0xAC, 0xD9, 0x8A, 0x44, 0xD8, 0xAD, 0xD8, 0xAC, 0x44, 0xD8, 0xAD, 0xD9, 0x85, 0x44, 0xD8, 0xAD, 0xD9, 0x89, 0x44, 0xD8, 0xAD, 0xD9, 0x8A, 0x44, 0xD8, 0xAE, 0xD8, 0xAC, 0x44, 0xD8, 0xAE, 0xD8, 0xAD, 0x44, 0xD8, 0xAE, 0xD9, 0x85, 0x44, 0xD8, 0xAE, 0xD9, // Bytes 1f80 - 1fbf 0x89, 0x44, 0xD8, 0xAE, 0xD9, 0x8A, 0x44, 0xD8, 0xB3, 0xD8, 0xAC, 0x44, 0xD8, 0xB3, 0xD8, 0xAD, 0x44, 0xD8, 0xB3, 0xD8, 0xAE, 0x44, 0xD8, 0xB3, 0xD8, 0xB1, 0x44, 0xD8, 0xB3, 0xD9, 0x85, 0x44, 0xD8, 0xB3, 0xD9, 0x87, 0x44, 0xD8, 0xB3, 0xD9, 0x89, 0x44, 0xD8, 0xB3, 0xD9, 0x8A, 0x44, 0xD8, 0xB4, 0xD8, 0xAC, 0x44, 0xD8, 0xB4, 0xD8, 0xAD, 0x44, 0xD8, 0xB4, 0xD8, 0xAE, 0x44, 0xD8, 0xB4, // Bytes 1fc0 - 1fff 0xD8, 0xB1, 0x44, 0xD8, 0xB4, 0xD9, 0x85, 0x44, 0xD8, 0xB4, 0xD9, 0x87, 0x44, 0xD8, 0xB4, 0xD9, 0x89, 0x44, 0xD8, 0xB4, 0xD9, 0x8A, 0x44, 0xD8, 0xB5, 0xD8, 0xAD, 0x44, 0xD8, 0xB5, 0xD8, 0xAE, 0x44, 0xD8, 0xB5, 0xD8, 0xB1, 0x44, 0xD8, 0xB5, 0xD9, 0x85, 0x44, 0xD8, 0xB5, 0xD9, 0x89, 0x44, 0xD8, 0xB5, 0xD9, 0x8A, 0x44, 0xD8, 0xB6, 0xD8, 0xAC, 0x44, 0xD8, 0xB6, 0xD8, 0xAD, 0x44, 0xD8, // Bytes 2000 - 203f 0xB6, 0xD8, 0xAE, 0x44, 0xD8, 0xB6, 0xD8, 0xB1, 0x44, 0xD8, 0xB6, 0xD9, 0x85, 0x44, 0xD8, 0xB6, 0xD9, 0x89, 0x44, 0xD8, 0xB6, 0xD9, 0x8A, 0x44, 0xD8, 0xB7, 0xD8, 0xAD, 0x44, 0xD8, 0xB7, 0xD9, 0x85, 0x44, 0xD8, 0xB7, 0xD9, 0x89, 0x44, 0xD8, 0xB7, 0xD9, 0x8A, 0x44, 0xD8, 0xB8, 0xD9, 0x85, 0x44, 0xD8, 0xB9, 0xD8, 0xAC, 0x44, 0xD8, 0xB9, 0xD9, 0x85, 0x44, 0xD8, 0xB9, 0xD9, 0x89, 0x44, // Bytes 2040 - 207f 0xD8, 0xB9, 0xD9, 0x8A, 0x44, 0xD8, 0xBA, 0xD8, 0xAC, 0x44, 0xD8, 0xBA, 0xD9, 0x85, 0x44, 0xD8, 0xBA, 0xD9, 0x89, 0x44, 0xD8, 0xBA, 0xD9, 0x8A, 0x44, 0xD9, 0x81, 0xD8, 0xAC, 0x44, 0xD9, 0x81, 0xD8, 0xAD, 0x44, 0xD9, 0x81, 0xD8, 0xAE, 0x44, 0xD9, 0x81, 0xD9, 0x85, 0x44, 0xD9, 0x81, 0xD9, 0x89, 0x44, 0xD9, 0x81, 0xD9, 0x8A, 0x44, 0xD9, 0x82, 0xD8, 0xAD, 0x44, 0xD9, 0x82, 0xD9, 0x85, // Bytes 2080 - 20bf 0x44, 0xD9, 0x82, 0xD9, 0x89, 0x44, 0xD9, 0x82, 0xD9, 0x8A, 0x44, 0xD9, 0x83, 0xD8, 0xA7, 0x44, 0xD9, 0x83, 0xD8, 0xAC, 0x44, 0xD9, 0x83, 0xD8, 0xAD, 0x44, 0xD9, 0x83, 0xD8, 0xAE, 0x44, 0xD9, 0x83, 0xD9, 0x84, 0x44, 0xD9, 0x83, 0xD9, 0x85, 0x44, 0xD9, 0x83, 0xD9, 0x89, 0x44, 0xD9, 0x83, 0xD9, 0x8A, 0x44, 0xD9, 0x84, 0xD8, 0xA7, 0x44, 0xD9, 0x84, 0xD8, 0xAC, 0x44, 0xD9, 0x84, 0xD8, // Bytes 20c0 - 20ff 0xAD, 0x44, 0xD9, 0x84, 0xD8, 0xAE, 0x44, 0xD9, 0x84, 0xD9, 0x85, 0x44, 0xD9, 0x84, 0xD9, 0x87, 0x44, 0xD9, 0x84, 0xD9, 0x89, 0x44, 0xD9, 0x84, 0xD9, 0x8A, 0x44, 0xD9, 0x85, 0xD8, 0xA7, 0x44, 0xD9, 0x85, 0xD8, 0xAC, 0x44, 0xD9, 0x85, 0xD8, 0xAD, 0x44, 0xD9, 0x85, 0xD8, 0xAE, 0x44, 0xD9, 0x85, 0xD9, 0x85, 0x44, 0xD9, 0x85, 0xD9, 0x89, 0x44, 0xD9, 0x85, 0xD9, 0x8A, 0x44, 0xD9, 0x86, // Bytes 2100 - 213f 0xD8, 0xAC, 0x44, 0xD9, 0x86, 0xD8, 0xAD, 0x44, 0xD9, 0x86, 0xD8, 0xAE, 0x44, 0xD9, 0x86, 0xD8, 0xB1, 0x44, 0xD9, 0x86, 0xD8, 0xB2, 0x44, 0xD9, 0x86, 0xD9, 0x85, 0x44, 0xD9, 0x86, 0xD9, 0x86, 0x44, 0xD9, 0x86, 0xD9, 0x87, 0x44, 0xD9, 0x86, 0xD9, 0x89, 0x44, 0xD9, 0x86, 0xD9, 0x8A, 0x44, 0xD9, 0x87, 0xD8, 0xAC, 0x44, 0xD9, 0x87, 0xD9, 0x85, 0x44, 0xD9, 0x87, 0xD9, 0x89, 0x44, 0xD9, // Bytes 2140 - 217f 0x87, 0xD9, 0x8A, 0x44, 0xD9, 0x88, 0xD9, 0xB4, 0x44, 0xD9, 0x8A, 0xD8, 0xAC, 0x44, 0xD9, 0x8A, 0xD8, 0xAD, 0x44, 0xD9, 0x8A, 0xD8, 0xAE, 0x44, 0xD9, 0x8A, 0xD8, 0xB1, 0x44, 0xD9, 0x8A, 0xD8, 0xB2, 0x44, 0xD9, 0x8A, 0xD9, 0x85, 0x44, 0xD9, 0x8A, 0xD9, 0x86, 0x44, 0xD9, 0x8A, 0xD9, 0x87, 0x44, 0xD9, 0x8A, 0xD9, 0x89, 0x44, 0xD9, 0x8A, 0xD9, 0x8A, 0x44, 0xD9, 0x8A, 0xD9, 0xB4, 0x44, // Bytes 2180 - 21bf 0xDB, 0x87, 0xD9, 0xB4, 0x45, 0x28, 0xE1, 0x84, 0x80, 0x29, 0x45, 0x28, 0xE1, 0x84, 0x82, 0x29, 0x45, 0x28, 0xE1, 0x84, 0x83, 0x29, 0x45, 0x28, 0xE1, 0x84, 0x85, 0x29, 0x45, 0x28, 0xE1, 0x84, 0x86, 0x29, 0x45, 0x28, 0xE1, 0x84, 0x87, 0x29, 0x45, 0x28, 0xE1, 0x84, 0x89, 0x29, 0x45, 0x28, 0xE1, 0x84, 0x8B, 0x29, 0x45, 0x28, 0xE1, 0x84, 0x8C, 0x29, 0x45, 0x28, 0xE1, 0x84, 0x8E, 0x29, // Bytes 21c0 - 21ff 0x45, 0x28, 0xE1, 0x84, 0x8F, 0x29, 0x45, 0x28, 0xE1, 0x84, 0x90, 0x29, 0x45, 0x28, 0xE1, 0x84, 0x91, 0x29, 0x45, 0x28, 0xE1, 0x84, 0x92, 0x29, 0x45, 0x28, 0xE4, 0xB8, 0x80, 0x29, 0x45, 0x28, 0xE4, 0xB8, 0x83, 0x29, 0x45, 0x28, 0xE4, 0xB8, 0x89, 0x29, 0x45, 0x28, 0xE4, 0xB9, 0x9D, 0x29, 0x45, 0x28, 0xE4, 0xBA, 0x8C, 0x29, 0x45, 0x28, 0xE4, 0xBA, 0x94, 0x29, 0x45, 0x28, 0xE4, 0xBB, // Bytes 2200 - 223f 0xA3, 0x29, 0x45, 0x28, 0xE4, 0xBC, 0x81, 0x29, 0x45, 0x28, 0xE4, 0xBC, 0x91, 0x29, 0x45, 0x28, 0xE5, 0x85, 0xAB, 0x29, 0x45, 0x28, 0xE5, 0x85, 0xAD, 0x29, 0x45, 0x28, 0xE5, 0x8A, 0xB4, 0x29, 0x45, 0x28, 0xE5, 0x8D, 0x81, 0x29, 0x45, 0x28, 0xE5, 0x8D, 0x94, 0x29, 0x45, 0x28, 0xE5, 0x90, 0x8D, 0x29, 0x45, 0x28, 0xE5, 0x91, 0xBC, 0x29, 0x45, 0x28, 0xE5, 0x9B, 0x9B, 0x29, 0x45, 0x28, // Bytes 2240 - 227f 0xE5, 0x9C, 0x9F, 0x29, 0x45, 0x28, 0xE5, 0xAD, 0xA6, 0x29, 0x45, 0x28, 0xE6, 0x97, 0xA5, 0x29, 0x45, 0x28, 0xE6, 0x9C, 0x88, 0x29, 0x45, 0x28, 0xE6, 0x9C, 0x89, 0x29, 0x45, 0x28, 0xE6, 0x9C, 0xA8, 0x29, 0x45, 0x28, 0xE6, 0xA0, 0xAA, 0x29, 0x45, 0x28, 0xE6, 0xB0, 0xB4, 0x29, 0x45, 0x28, 0xE7, 0x81, 0xAB, 0x29, 0x45, 0x28, 0xE7, 0x89, 0xB9, 0x29, 0x45, 0x28, 0xE7, 0x9B, 0xA3, 0x29, // Bytes 2280 - 22bf 0x45, 0x28, 0xE7, 0xA4, 0xBE, 0x29, 0x45, 0x28, 0xE7, 0xA5, 0x9D, 0x29, 0x45, 0x28, 0xE7, 0xA5, 0xAD, 0x29, 0x45, 0x28, 0xE8, 0x87, 0xAA, 0x29, 0x45, 0x28, 0xE8, 0x87, 0xB3, 0x29, 0x45, 0x28, 0xE8, 0xB2, 0xA1, 0x29, 0x45, 0x28, 0xE8, 0xB3, 0x87, 0x29, 0x45, 0x28, 0xE9, 0x87, 0x91, 0x29, 0x45, 0x30, 0xE2, 0x81, 0x84, 0x33, 0x45, 0x31, 0x30, 0xE6, 0x97, 0xA5, 0x45, 0x31, 0x30, 0xE6, // Bytes 22c0 - 22ff 0x9C, 0x88, 0x45, 0x31, 0x30, 0xE7, 0x82, 0xB9, 0x45, 0x31, 0x31, 0xE6, 0x97, 0xA5, 0x45, 0x31, 0x31, 0xE6, 0x9C, 0x88, 0x45, 0x31, 0x31, 0xE7, 0x82, 0xB9, 0x45, 0x31, 0x32, 0xE6, 0x97, 0xA5, 0x45, 0x31, 0x32, 0xE6, 0x9C, 0x88, 0x45, 0x31, 0x32, 0xE7, 0x82, 0xB9, 0x45, 0x31, 0x33, 0xE6, 0x97, 0xA5, 0x45, 0x31, 0x33, 0xE7, 0x82, 0xB9, 0x45, 0x31, 0x34, 0xE6, 0x97, 0xA5, 0x45, 0x31, // Bytes 2300 - 233f 0x34, 0xE7, 0x82, 0xB9, 0x45, 0x31, 0x35, 0xE6, 0x97, 0xA5, 0x45, 0x31, 0x35, 0xE7, 0x82, 0xB9, 0x45, 0x31, 0x36, 0xE6, 0x97, 0xA5, 0x45, 0x31, 0x36, 0xE7, 0x82, 0xB9, 0x45, 0x31, 0x37, 0xE6, 0x97, 0xA5, 0x45, 0x31, 0x37, 0xE7, 0x82, 0xB9, 0x45, 0x31, 0x38, 0xE6, 0x97, 0xA5, 0x45, 0x31, 0x38, 0xE7, 0x82, 0xB9, 0x45, 0x31, 0x39, 0xE6, 0x97, 0xA5, 0x45, 0x31, 0x39, 0xE7, 0x82, 0xB9, // Bytes 2340 - 237f 0x45, 0x31, 0xE2, 0x81, 0x84, 0x32, 0x45, 0x31, 0xE2, 0x81, 0x84, 0x33, 0x45, 0x31, 0xE2, 0x81, 0x84, 0x34, 0x45, 0x31, 0xE2, 0x81, 0x84, 0x35, 0x45, 0x31, 0xE2, 0x81, 0x84, 0x36, 0x45, 0x31, 0xE2, 0x81, 0x84, 0x37, 0x45, 0x31, 0xE2, 0x81, 0x84, 0x38, 0x45, 0x31, 0xE2, 0x81, 0x84, 0x39, 0x45, 0x32, 0x30, 0xE6, 0x97, 0xA5, 0x45, 0x32, 0x30, 0xE7, 0x82, 0xB9, 0x45, 0x32, 0x31, 0xE6, // Bytes 2380 - 23bf 0x97, 0xA5, 0x45, 0x32, 0x31, 0xE7, 0x82, 0xB9, 0x45, 0x32, 0x32, 0xE6, 0x97, 0xA5, 0x45, 0x32, 0x32, 0xE7, 0x82, 0xB9, 0x45, 0x32, 0x33, 0xE6, 0x97, 0xA5, 0x45, 0x32, 0x33, 0xE7, 0x82, 0xB9, 0x45, 0x32, 0x34, 0xE6, 0x97, 0xA5, 0x45, 0x32, 0x34, 0xE7, 0x82, 0xB9, 0x45, 0x32, 0x35, 0xE6, 0x97, 0xA5, 0x45, 0x32, 0x36, 0xE6, 0x97, 0xA5, 0x45, 0x32, 0x37, 0xE6, 0x97, 0xA5, 0x45, 0x32, // Bytes 23c0 - 23ff 0x38, 0xE6, 0x97, 0xA5, 0x45, 0x32, 0x39, 0xE6, 0x97, 0xA5, 0x45, 0x32, 0xE2, 0x81, 0x84, 0x33, 0x45, 0x32, 0xE2, 0x81, 0x84, 0x35, 0x45, 0x33, 0x30, 0xE6, 0x97, 0xA5, 0x45, 0x33, 0x31, 0xE6, 0x97, 0xA5, 0x45, 0x33, 0xE2, 0x81, 0x84, 0x34, 0x45, 0x33, 0xE2, 0x81, 0x84, 0x35, 0x45, 0x33, 0xE2, 0x81, 0x84, 0x38, 0x45, 0x34, 0xE2, 0x81, 0x84, 0x35, 0x45, 0x35, 0xE2, 0x81, 0x84, 0x36, // Bytes 2400 - 243f 0x45, 0x35, 0xE2, 0x81, 0x84, 0x38, 0x45, 0x37, 0xE2, 0x81, 0x84, 0x38, 0x45, 0x41, 0xE2, 0x88, 0x95, 0x6D, 0x45, 0x56, 0xE2, 0x88, 0x95, 0x6D, 0x45, 0x6D, 0xE2, 0x88, 0x95, 0x73, 0x46, 0x31, 0xE2, 0x81, 0x84, 0x31, 0x30, 0x46, 0x43, 0xE2, 0x88, 0x95, 0x6B, 0x67, 0x46, 0x6D, 0xE2, 0x88, 0x95, 0x73, 0x32, 0x46, 0xD8, 0xA8, 0xD8, 0xAD, 0xD9, 0x8A, 0x46, 0xD8, 0xA8, 0xD8, 0xAE, 0xD9, // Bytes 2440 - 247f 0x8A, 0x46, 0xD8, 0xAA, 0xD8, 0xAC, 0xD9, 0x85, 0x46, 0xD8, 0xAA, 0xD8, 0xAC, 0xD9, 0x89, 0x46, 0xD8, 0xAA, 0xD8, 0xAC, 0xD9, 0x8A, 0x46, 0xD8, 0xAA, 0xD8, 0xAD, 0xD8, 0xAC, 0x46, 0xD8, 0xAA, 0xD8, 0xAD, 0xD9, 0x85, 0x46, 0xD8, 0xAA, 0xD8, 0xAE, 0xD9, 0x85, 0x46, 0xD8, 0xAA, 0xD8, 0xAE, 0xD9, 0x89, 0x46, 0xD8, 0xAA, 0xD8, 0xAE, 0xD9, 0x8A, 0x46, 0xD8, 0xAA, 0xD9, 0x85, 0xD8, 0xAC, // Bytes 2480 - 24bf 0x46, 0xD8, 0xAA, 0xD9, 0x85, 0xD8, 0xAD, 0x46, 0xD8, 0xAA, 0xD9, 0x85, 0xD8, 0xAE, 0x46, 0xD8, 0xAA, 0xD9, 0x85, 0xD9, 0x89, 0x46, 0xD8, 0xAA, 0xD9, 0x85, 0xD9, 0x8A, 0x46, 0xD8, 0xAC, 0xD8, 0xAD, 0xD9, 0x89, 0x46, 0xD8, 0xAC, 0xD8, 0xAD, 0xD9, 0x8A, 0x46, 0xD8, 0xAC, 0xD9, 0x85, 0xD8, 0xAD, 0x46, 0xD8, 0xAC, 0xD9, 0x85, 0xD9, 0x89, 0x46, 0xD8, 0xAC, 0xD9, 0x85, 0xD9, 0x8A, 0x46, // Bytes 24c0 - 24ff 0xD8, 0xAD, 0xD8, 0xAC, 0xD9, 0x8A, 0x46, 0xD8, 0xAD, 0xD9, 0x85, 0xD9, 0x89, 0x46, 0xD8, 0xAD, 0xD9, 0x85, 0xD9, 0x8A, 0x46, 0xD8, 0xB3, 0xD8, 0xAC, 0xD8, 0xAD, 0x46, 0xD8, 0xB3, 0xD8, 0xAC, 0xD9, 0x89, 0x46, 0xD8, 0xB3, 0xD8, 0xAD, 0xD8, 0xAC, 0x46, 0xD8, 0xB3, 0xD8, 0xAE, 0xD9, 0x89, 0x46, 0xD8, 0xB3, 0xD8, 0xAE, 0xD9, 0x8A, 0x46, 0xD8, 0xB3, 0xD9, 0x85, 0xD8, 0xAC, 0x46, 0xD8, // Bytes 2500 - 253f 0xB3, 0xD9, 0x85, 0xD8, 0xAD, 0x46, 0xD8, 0xB3, 0xD9, 0x85, 0xD9, 0x85, 0x46, 0xD8, 0xB4, 0xD8, 0xAC, 0xD9, 0x8A, 0x46, 0xD8, 0xB4, 0xD8, 0xAD, 0xD9, 0x85, 0x46, 0xD8, 0xB4, 0xD8, 0xAD, 0xD9, 0x8A, 0x46, 0xD8, 0xB4, 0xD9, 0x85, 0xD8, 0xAE, 0x46, 0xD8, 0xB4, 0xD9, 0x85, 0xD9, 0x85, 0x46, 0xD8, 0xB5, 0xD8, 0xAD, 0xD8, 0xAD, 0x46, 0xD8, 0xB5, 0xD8, 0xAD, 0xD9, 0x8A, 0x46, 0xD8, 0xB5, // Bytes 2540 - 257f 0xD9, 0x84, 0xD9, 0x89, 0x46, 0xD8, 0xB5, 0xD9, 0x84, 0xDB, 0x92, 0x46, 0xD8, 0xB5, 0xD9, 0x85, 0xD9, 0x85, 0x46, 0xD8, 0xB6, 0xD8, 0xAD, 0xD9, 0x89, 0x46, 0xD8, 0xB6, 0xD8, 0xAD, 0xD9, 0x8A, 0x46, 0xD8, 0xB6, 0xD8, 0xAE, 0xD9, 0x85, 0x46, 0xD8, 0xB7, 0xD9, 0x85, 0xD8, 0xAD, 0x46, 0xD8, 0xB7, 0xD9, 0x85, 0xD9, 0x85, 0x46, 0xD8, 0xB7, 0xD9, 0x85, 0xD9, 0x8A, 0x46, 0xD8, 0xB9, 0xD8, // Bytes 2580 - 25bf 0xAC, 0xD9, 0x85, 0x46, 0xD8, 0xB9, 0xD9, 0x85, 0xD9, 0x85, 0x46, 0xD8, 0xB9, 0xD9, 0x85, 0xD9, 0x89, 0x46, 0xD8, 0xB9, 0xD9, 0x85, 0xD9, 0x8A, 0x46, 0xD8, 0xBA, 0xD9, 0x85, 0xD9, 0x85, 0x46, 0xD8, 0xBA, 0xD9, 0x85, 0xD9, 0x89, 0x46, 0xD8, 0xBA, 0xD9, 0x85, 0xD9, 0x8A, 0x46, 0xD9, 0x81, 0xD8, 0xAE, 0xD9, 0x85, 0x46, 0xD9, 0x81, 0xD9, 0x85, 0xD9, 0x8A, 0x46, 0xD9, 0x82, 0xD9, 0x84, // Bytes 25c0 - 25ff 0xDB, 0x92, 0x46, 0xD9, 0x82, 0xD9, 0x85, 0xD8, 0xAD, 0x46, 0xD9, 0x82, 0xD9, 0x85, 0xD9, 0x85, 0x46, 0xD9, 0x82, 0xD9, 0x85, 0xD9, 0x8A, 0x46, 0xD9, 0x83, 0xD9, 0x85, 0xD9, 0x85, 0x46, 0xD9, 0x83, 0xD9, 0x85, 0xD9, 0x8A, 0x46, 0xD9, 0x84, 0xD8, 0xAC, 0xD8, 0xAC, 0x46, 0xD9, 0x84, 0xD8, 0xAC, 0xD9, 0x85, 0x46, 0xD9, 0x84, 0xD8, 0xAC, 0xD9, 0x8A, 0x46, 0xD9, 0x84, 0xD8, 0xAD, 0xD9, // Bytes 2600 - 263f 0x85, 0x46, 0xD9, 0x84, 0xD8, 0xAD, 0xD9, 0x89, 0x46, 0xD9, 0x84, 0xD8, 0xAD, 0xD9, 0x8A, 0x46, 0xD9, 0x84, 0xD8, 0xAE, 0xD9, 0x85, 0x46, 0xD9, 0x84, 0xD9, 0x85, 0xD8, 0xAD, 0x46, 0xD9, 0x84, 0xD9, 0x85, 0xD9, 0x8A, 0x46, 0xD9, 0x85, 0xD8, 0xAC, 0xD8, 0xAD, 0x46, 0xD9, 0x85, 0xD8, 0xAC, 0xD8, 0xAE, 0x46, 0xD9, 0x85, 0xD8, 0xAC, 0xD9, 0x85, 0x46, 0xD9, 0x85, 0xD8, 0xAC, 0xD9, 0x8A, // Bytes 2640 - 267f 0x46, 0xD9, 0x85, 0xD8, 0xAD, 0xD8, 0xAC, 0x46, 0xD9, 0x85, 0xD8, 0xAD, 0xD9, 0x85, 0x46, 0xD9, 0x85, 0xD8, 0xAD, 0xD9, 0x8A, 0x46, 0xD9, 0x85, 0xD8, 0xAE, 0xD8, 0xAC, 0x46, 0xD9, 0x85, 0xD8, 0xAE, 0xD9, 0x85, 0x46, 0xD9, 0x85, 0xD8, 0xAE, 0xD9, 0x8A, 0x46, 0xD9, 0x85, 0xD9, 0x85, 0xD9, 0x8A, 0x46, 0xD9, 0x86, 0xD8, 0xAC, 0xD8, 0xAD, 0x46, 0xD9, 0x86, 0xD8, 0xAC, 0xD9, 0x85, 0x46, // Bytes 2680 - 26bf 0xD9, 0x86, 0xD8, 0xAC, 0xD9, 0x89, 0x46, 0xD9, 0x86, 0xD8, 0xAC, 0xD9, 0x8A, 0x46, 0xD9, 0x86, 0xD8, 0xAD, 0xD9, 0x85, 0x46, 0xD9, 0x86, 0xD8, 0xAD, 0xD9, 0x89, 0x46, 0xD9, 0x86, 0xD8, 0xAD, 0xD9, 0x8A, 0x46, 0xD9, 0x86, 0xD9, 0x85, 0xD9, 0x89, 0x46, 0xD9, 0x86, 0xD9, 0x85, 0xD9, 0x8A, 0x46, 0xD9, 0x87, 0xD9, 0x85, 0xD8, 0xAC, 0x46, 0xD9, 0x87, 0xD9, 0x85, 0xD9, 0x85, 0x46, 0xD9, // Bytes 26c0 - 26ff 0x8A, 0xD8, 0xAC, 0xD9, 0x8A, 0x46, 0xD9, 0x8A, 0xD8, 0xAD, 0xD9, 0x8A, 0x46, 0xD9, 0x8A, 0xD9, 0x85, 0xD9, 0x85, 0x46, 0xD9, 0x8A, 0xD9, 0x85, 0xD9, 0x8A, 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xD8, 0xA7, 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xD8, 0xAC, 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xD8, 0xAD, 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xD8, 0xAE, 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xD8, 0xB1, 0x46, 0xD9, 0x8A, // Bytes 2700 - 273f 0xD9, 0x94, 0xD8, 0xB2, 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xD9, 0x85, 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xD9, 0x86, 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xD9, 0x87, 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xD9, 0x88, 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xD9, 0x89, 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xD9, 0x8A, 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xDB, 0x86, 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xDB, 0x87, 0x46, 0xD9, 0x8A, 0xD9, // Bytes 2740 - 277f 0x94, 0xDB, 0x88, 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xDB, 0x90, 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xDB, 0x95, 0x46, 0xE0, 0xB9, 0x8D, 0xE0, 0xB8, 0xB2, 0x46, 0xE0, 0xBA, 0xAB, 0xE0, 0xBA, 0x99, 0x46, 0xE0, 0xBA, 0xAB, 0xE0, 0xBA, 0xA1, 0x46, 0xE0, 0xBB, 0x8D, 0xE0, 0xBA, 0xB2, 0x46, 0xE0, 0xBD, 0x80, 0xE0, 0xBE, 0xB5, 0x46, 0xE0, 0xBD, 0x82, 0xE0, 0xBE, 0xB7, 0x46, 0xE0, 0xBD, 0x8C, 0xE0, // Bytes 2780 - 27bf 0xBE, 0xB7, 0x46, 0xE0, 0xBD, 0x91, 0xE0, 0xBE, 0xB7, 0x46, 0xE0, 0xBD, 0x96, 0xE0, 0xBE, 0xB7, 0x46, 0xE0, 0xBD, 0x9B, 0xE0, 0xBE, 0xB7, 0x46, 0xE0, 0xBE, 0x90, 0xE0, 0xBE, 0xB5, 0x46, 0xE0, 0xBE, 0x92, 0xE0, 0xBE, 0xB7, 0x46, 0xE0, 0xBE, 0x9C, 0xE0, 0xBE, 0xB7, 0x46, 0xE0, 0xBE, 0xA1, 0xE0, 0xBE, 0xB7, 0x46, 0xE0, 0xBE, 0xA6, 0xE0, 0xBE, 0xB7, 0x46, 0xE0, 0xBE, 0xAB, 0xE0, 0xBE, // Bytes 27c0 - 27ff 0xB7, 0x46, 0xE2, 0x80, 0xB2, 0xE2, 0x80, 0xB2, 0x46, 0xE2, 0x80, 0xB5, 0xE2, 0x80, 0xB5, 0x46, 0xE2, 0x88, 0xAB, 0xE2, 0x88, 0xAB, 0x46, 0xE2, 0x88, 0xAE, 0xE2, 0x88, 0xAE, 0x46, 0xE3, 0x81, 0xBB, 0xE3, 0x81, 0x8B, 0x46, 0xE3, 0x82, 0x88, 0xE3, 0x82, 0x8A, 0x46, 0xE3, 0x82, 0xAD, 0xE3, 0x83, 0xAD, 0x46, 0xE3, 0x82, 0xB3, 0xE3, 0x82, 0xB3, 0x46, 0xE3, 0x82, 0xB3, 0xE3, 0x83, 0x88, // Bytes 2800 - 283f 0x46, 0xE3, 0x83, 0x88, 0xE3, 0x83, 0xB3, 0x46, 0xE3, 0x83, 0x8A, 0xE3, 0x83, 0x8E, 0x46, 0xE3, 0x83, 0x9B, 0xE3, 0x83, 0xB3, 0x46, 0xE3, 0x83, 0x9F, 0xE3, 0x83, 0xAA, 0x46, 0xE3, 0x83, 0xAA, 0xE3, 0x83, 0xA9, 0x46, 0xE3, 0x83, 0xAC, 0xE3, 0x83, 0xA0, 0x46, 0xE4, 0xBB, 0xA4, 0xE5, 0x92, 0x8C, 0x46, 0xE5, 0xA4, 0xA7, 0xE6, 0xAD, 0xA3, 0x46, 0xE5, 0xB9, 0xB3, 0xE6, 0x88, 0x90, 0x46, // Bytes 2840 - 287f 0xE6, 0x98, 0x8E, 0xE6, 0xB2, 0xBB, 0x46, 0xE6, 0x98, 0xAD, 0xE5, 0x92, 0x8C, 0x47, 0x72, 0x61, 0x64, 0xE2, 0x88, 0x95, 0x73, 0x47, 0xE3, 0x80, 0x94, 0x53, 0xE3, 0x80, 0x95, 0x48, 0x28, 0xE1, 0x84, 0x80, 0xE1, 0x85, 0xA1, 0x29, 0x48, 0x28, 0xE1, 0x84, 0x82, 0xE1, 0x85, 0xA1, 0x29, 0x48, 0x28, 0xE1, 0x84, 0x83, 0xE1, 0x85, 0xA1, 0x29, 0x48, 0x28, 0xE1, 0x84, 0x85, 0xE1, 0x85, 0xA1, // Bytes 2880 - 28bf 0x29, 0x48, 0x28, 0xE1, 0x84, 0x86, 0xE1, 0x85, 0xA1, 0x29, 0x48, 0x28, 0xE1, 0x84, 0x87, 0xE1, 0x85, 0xA1, 0x29, 0x48, 0x28, 0xE1, 0x84, 0x89, 0xE1, 0x85, 0xA1, 0x29, 0x48, 0x28, 0xE1, 0x84, 0x8B, 0xE1, 0x85, 0xA1, 0x29, 0x48, 0x28, 0xE1, 0x84, 0x8C, 0xE1, 0x85, 0xA1, 0x29, 0x48, 0x28, 0xE1, 0x84, 0x8C, 0xE1, 0x85, 0xAE, 0x29, 0x48, 0x28, 0xE1, 0x84, 0x8E, 0xE1, 0x85, 0xA1, 0x29, // Bytes 28c0 - 28ff 0x48, 0x28, 0xE1, 0x84, 0x8F, 0xE1, 0x85, 0xA1, 0x29, 0x48, 0x28, 0xE1, 0x84, 0x90, 0xE1, 0x85, 0xA1, 0x29, 0x48, 0x28, 0xE1, 0x84, 0x91, 0xE1, 0x85, 0xA1, 0x29, 0x48, 0x28, 0xE1, 0x84, 0x92, 0xE1, 0x85, 0xA1, 0x29, 0x48, 0x72, 0x61, 0x64, 0xE2, 0x88, 0x95, 0x73, 0x32, 0x48, 0xD8, 0xA7, 0xD9, 0x83, 0xD8, 0xA8, 0xD8, 0xB1, 0x48, 0xD8, 0xA7, 0xD9, 0x84, 0xD9, 0x84, 0xD9, 0x87, 0x48, // Bytes 2900 - 293f 0xD8, 0xB1, 0xD8, 0xB3, 0xD9, 0x88, 0xD9, 0x84, 0x48, 0xD8, 0xB1, 0xDB, 0x8C, 0xD8, 0xA7, 0xD9, 0x84, 0x48, 0xD8, 0xB5, 0xD9, 0x84, 0xD8, 0xB9, 0xD9, 0x85, 0x48, 0xD8, 0xB9, 0xD9, 0x84, 0xD9, 0x8A, 0xD9, 0x87, 0x48, 0xD9, 0x85, 0xD8, 0xAD, 0xD9, 0x85, 0xD8, 0xAF, 0x48, 0xD9, 0x88, 0xD8, 0xB3, 0xD9, 0x84, 0xD9, 0x85, 0x49, 0xE2, 0x80, 0xB2, 0xE2, 0x80, 0xB2, 0xE2, 0x80, 0xB2, 0x49, // Bytes 2940 - 297f 0xE2, 0x80, 0xB5, 0xE2, 0x80, 0xB5, 0xE2, 0x80, 0xB5, 0x49, 0xE2, 0x88, 0xAB, 0xE2, 0x88, 0xAB, 0xE2, 0x88, 0xAB, 0x49, 0xE2, 0x88, 0xAE, 0xE2, 0x88, 0xAE, 0xE2, 0x88, 0xAE, 0x49, 0xE3, 0x80, 0x94, 0xE4, 0xB8, 0x89, 0xE3, 0x80, 0x95, 0x49, 0xE3, 0x80, 0x94, 0xE4, 0xBA, 0x8C, 0xE3, 0x80, 0x95, 0x49, 0xE3, 0x80, 0x94, 0xE5, 0x8B, 0x9D, 0xE3, 0x80, 0x95, 0x49, 0xE3, 0x80, 0x94, 0xE5, // Bytes 2980 - 29bf 0xAE, 0x89, 0xE3, 0x80, 0x95, 0x49, 0xE3, 0x80, 0x94, 0xE6, 0x89, 0x93, 0xE3, 0x80, 0x95, 0x49, 0xE3, 0x80, 0x94, 0xE6, 0x95, 0x97, 0xE3, 0x80, 0x95, 0x49, 0xE3, 0x80, 0x94, 0xE6, 0x9C, 0xAC, 0xE3, 0x80, 0x95, 0x49, 0xE3, 0x80, 0x94, 0xE7, 0x82, 0xB9, 0xE3, 0x80, 0x95, 0x49, 0xE3, 0x80, 0x94, 0xE7, 0x9B, 0x97, 0xE3, 0x80, 0x95, 0x49, 0xE3, 0x82, 0xA2, 0xE3, 0x83, 0xBC, 0xE3, 0x83, // Bytes 29c0 - 29ff 0xAB, 0x49, 0xE3, 0x82, 0xA4, 0xE3, 0x83, 0xB3, 0xE3, 0x83, 0x81, 0x49, 0xE3, 0x82, 0xA6, 0xE3, 0x82, 0xA9, 0xE3, 0x83, 0xB3, 0x49, 0xE3, 0x82, 0xAA, 0xE3, 0x83, 0xB3, 0xE3, 0x82, 0xB9, 0x49, 0xE3, 0x82, 0xAA, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0xA0, 0x49, 0xE3, 0x82, 0xAB, 0xE3, 0x82, 0xA4, 0xE3, 0x83, 0xAA, 0x49, 0xE3, 0x82, 0xB1, 0xE3, 0x83, 0xBC, 0xE3, 0x82, 0xB9, 0x49, 0xE3, 0x82, // Bytes 2a00 - 2a3f 0xB3, 0xE3, 0x83, 0xAB, 0xE3, 0x83, 0x8A, 0x49, 0xE3, 0x82, 0xBB, 0xE3, 0x83, 0xB3, 0xE3, 0x83, 0x81, 0x49, 0xE3, 0x82, 0xBB, 0xE3, 0x83, 0xB3, 0xE3, 0x83, 0x88, 0x49, 0xE3, 0x83, 0x86, 0xE3, 0x82, 0x99, 0xE3, 0x82, 0xB7, 0x49, 0xE3, 0x83, 0x88, 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xAB, 0x49, 0xE3, 0x83, 0x8E, 0xE3, 0x83, 0x83, 0xE3, 0x83, 0x88, 0x49, 0xE3, 0x83, 0x8F, 0xE3, 0x82, 0xA4, // Bytes 2a40 - 2a7f 0xE3, 0x83, 0x84, 0x49, 0xE3, 0x83, 0x92, 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xAB, 0x49, 0xE3, 0x83, 0x92, 0xE3, 0x82, 0x9A, 0xE3, 0x82, 0xB3, 0x49, 0xE3, 0x83, 0x95, 0xE3, 0x83, 0xA9, 0xE3, 0x83, 0xB3, 0x49, 0xE3, 0x83, 0x98, 0xE3, 0x82, 0x9A, 0xE3, 0x82, 0xBD, 0x49, 0xE3, 0x83, 0x98, 0xE3, 0x83, 0xAB, 0xE3, 0x83, 0x84, 0x49, 0xE3, 0x83, 0x9B, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0xAB, 0x49, // Bytes 2a80 - 2abf 0xE3, 0x83, 0x9B, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0xB3, 0x49, 0xE3, 0x83, 0x9E, 0xE3, 0x82, 0xA4, 0xE3, 0x83, 0xAB, 0x49, 0xE3, 0x83, 0x9E, 0xE3, 0x83, 0x83, 0xE3, 0x83, 0x8F, 0x49, 0xE3, 0x83, 0x9E, 0xE3, 0x83, 0xAB, 0xE3, 0x82, 0xAF, 0x49, 0xE3, 0x83, 0xA4, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0xAB, 0x49, 0xE3, 0x83, 0xA6, 0xE3, 0x82, 0xA2, 0xE3, 0x83, 0xB3, 0x49, 0xE3, 0x83, 0xAF, 0xE3, // Bytes 2ac0 - 2aff 0x83, 0x83, 0xE3, 0x83, 0x88, 0x4C, 0xE2, 0x80, 0xB2, 0xE2, 0x80, 0xB2, 0xE2, 0x80, 0xB2, 0xE2, 0x80, 0xB2, 0x4C, 0xE2, 0x88, 0xAB, 0xE2, 0x88, 0xAB, 0xE2, 0x88, 0xAB, 0xE2, 0x88, 0xAB, 0x4C, 0xE3, 0x82, 0xA2, 0xE3, 0x83, 0xAB, 0xE3, 0x83, 0x95, 0xE3, 0x82, 0xA1, 0x4C, 0xE3, 0x82, 0xA8, 0xE3, 0x83, 0xBC, 0xE3, 0x82, 0xAB, 0xE3, 0x83, 0xBC, 0x4C, 0xE3, 0x82, 0xAB, 0xE3, 0x82, 0x99, // Bytes 2b00 - 2b3f 0xE3, 0x83, 0xAD, 0xE3, 0x83, 0xB3, 0x4C, 0xE3, 0x82, 0xAB, 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xB3, 0xE3, 0x83, 0x9E, 0x4C, 0xE3, 0x82, 0xAB, 0xE3, 0x83, 0xA9, 0xE3, 0x83, 0x83, 0xE3, 0x83, 0x88, 0x4C, 0xE3, 0x82, 0xAB, 0xE3, 0x83, 0xAD, 0xE3, 0x83, 0xAA, 0xE3, 0x83, 0xBC, 0x4C, 0xE3, 0x82, 0xAD, 0xE3, 0x82, 0x99, 0xE3, 0x83, 0x8B, 0xE3, 0x83, 0xBC, 0x4C, 0xE3, 0x82, 0xAD, 0xE3, 0x83, // Bytes 2b40 - 2b7f 0xA5, 0xE3, 0x83, 0xAA, 0xE3, 0x83, 0xBC, 0x4C, 0xE3, 0x82, 0xAF, 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xA9, 0xE3, 0x83, 0xA0, 0x4C, 0xE3, 0x82, 0xAF, 0xE3, 0x83, 0xAD, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0x8D, 0x4C, 0xE3, 0x82, 0xB5, 0xE3, 0x82, 0xA4, 0xE3, 0x82, 0xAF, 0xE3, 0x83, 0xAB, 0x4C, 0xE3, 0x82, 0xBF, 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xBC, 0xE3, 0x82, 0xB9, 0x4C, 0xE3, 0x83, 0x8F, 0xE3, // Bytes 2b80 - 2bbf 0x82, 0x9A, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0x84, 0x4C, 0xE3, 0x83, 0x92, 0xE3, 0x82, 0x9A, 0xE3, 0x82, 0xAF, 0xE3, 0x83, 0xAB, 0x4C, 0xE3, 0x83, 0x95, 0xE3, 0x82, 0xA3, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0x88, 0x4C, 0xE3, 0x83, 0x98, 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xBC, 0xE3, 0x82, 0xBF, 0x4C, 0xE3, 0x83, 0x98, 0xE3, 0x82, 0x9A, 0xE3, 0x83, 0x8B, 0xE3, 0x83, 0x92, 0x4C, 0xE3, 0x83, 0x98, // Bytes 2bc0 - 2bff 0xE3, 0x82, 0x9A, 0xE3, 0x83, 0xB3, 0xE3, 0x82, 0xB9, 0x4C, 0xE3, 0x83, 0x9B, 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xAB, 0xE3, 0x83, 0x88, 0x4C, 0xE3, 0x83, 0x9E, 0xE3, 0x82, 0xA4, 0xE3, 0x82, 0xAF, 0xE3, 0x83, 0xAD, 0x4C, 0xE3, 0x83, 0x9F, 0xE3, 0x82, 0xAF, 0xE3, 0x83, 0xAD, 0xE3, 0x83, 0xB3, 0x4C, 0xE3, 0x83, 0xA1, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0x88, 0xE3, 0x83, 0xAB, 0x4C, 0xE3, 0x83, // Bytes 2c00 - 2c3f 0xAA, 0xE3, 0x83, 0x83, 0xE3, 0x83, 0x88, 0xE3, 0x83, 0xAB, 0x4C, 0xE3, 0x83, 0xAB, 0xE3, 0x83, 0x92, 0xE3, 0x82, 0x9A, 0xE3, 0x83, 0xBC, 0x4C, 0xE6, 0xA0, 0xAA, 0xE5, 0xBC, 0x8F, 0xE4, 0xBC, 0x9A, 0xE7, 0xA4, 0xBE, 0x4E, 0x28, 0xE1, 0x84, 0x8B, 0xE1, 0x85, 0xA9, 0xE1, 0x84, 0x92, 0xE1, 0x85, 0xAE, 0x29, 0x4F, 0xD8, 0xAC, 0xD9, 0x84, 0x20, 0xD8, 0xAC, 0xD9, 0x84, 0xD8, 0xA7, 0xD9, // Bytes 2c40 - 2c7f 0x84, 0xD9, 0x87, 0x4F, 0xE3, 0x82, 0xA2, 0xE3, 0x83, 0x8F, 0xE3, 0x82, 0x9A, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0x88, 0x4F, 0xE3, 0x82, 0xA2, 0xE3, 0x83, 0xB3, 0xE3, 0x83, 0x98, 0xE3, 0x82, 0x9A, 0xE3, 0x82, 0xA2, 0x4F, 0xE3, 0x82, 0xAD, 0xE3, 0x83, 0xAD, 0xE3, 0x83, 0xAF, 0xE3, 0x83, 0x83, 0xE3, 0x83, 0x88, 0x4F, 0xE3, 0x82, 0xB5, 0xE3, 0x83, 0xB3, 0xE3, 0x83, 0x81, 0xE3, 0x83, 0xBC, // Bytes 2c80 - 2cbf 0xE3, 0x83, 0xA0, 0x4F, 0xE3, 0x83, 0x8F, 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0xAC, 0xE3, 0x83, 0xAB, 0x4F, 0xE3, 0x83, 0x98, 0xE3, 0x82, 0xAF, 0xE3, 0x82, 0xBF, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0xAB, 0x4F, 0xE3, 0x83, 0x9B, 0xE3, 0x82, 0x9A, 0xE3, 0x82, 0xA4, 0xE3, 0x83, 0xB3, 0xE3, 0x83, 0x88, 0x4F, 0xE3, 0x83, 0x9E, 0xE3, 0x83, 0xB3, 0xE3, 0x82, 0xB7, 0xE3, 0x83, 0xA7, // Bytes 2cc0 - 2cff 0xE3, 0x83, 0xB3, 0x4F, 0xE3, 0x83, 0xA1, 0xE3, 0x82, 0xAB, 0xE3, 0x82, 0x99, 0xE3, 0x83, 0x88, 0xE3, 0x83, 0xB3, 0x4F, 0xE3, 0x83, 0xAB, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0x95, 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xAB, 0x51, 0x28, 0xE1, 0x84, 0x8B, 0xE1, 0x85, 0xA9, 0xE1, 0x84, 0x8C, 0xE1, 0x85, 0xA5, 0xE1, 0x86, 0xAB, 0x29, 0x52, 0xE3, 0x82, 0xAD, 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xAB, 0xE3, // Bytes 2d00 - 2d3f 0x82, 0xBF, 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xBC, 0x52, 0xE3, 0x82, 0xAD, 0xE3, 0x83, 0xAD, 0xE3, 0x82, 0xAF, 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xA9, 0xE3, 0x83, 0xA0, 0x52, 0xE3, 0x82, 0xAD, 0xE3, 0x83, 0xAD, 0xE3, 0x83, 0xA1, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0x88, 0xE3, 0x83, 0xAB, 0x52, 0xE3, 0x82, 0xAF, 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xA9, 0xE3, 0x83, 0xA0, 0xE3, 0x83, 0x88, 0xE3, 0x83, // Bytes 2d40 - 2d7f 0xB3, 0x52, 0xE3, 0x82, 0xAF, 0xE3, 0x83, 0xAB, 0xE3, 0x82, 0xBB, 0xE3, 0x82, 0x99, 0xE3, 0x82, 0xA4, 0xE3, 0x83, 0xAD, 0x52, 0xE3, 0x83, 0x8F, 0xE3, 0x82, 0x9A, 0xE3, 0x83, 0xBC, 0xE3, 0x82, 0xBB, 0xE3, 0x83, 0xB3, 0xE3, 0x83, 0x88, 0x52, 0xE3, 0x83, 0x92, 0xE3, 0x82, 0x9A, 0xE3, 0x82, 0xA2, 0xE3, 0x82, 0xB9, 0xE3, 0x83, 0x88, 0xE3, 0x83, 0xAB, 0x52, 0xE3, 0x83, 0x95, 0xE3, 0x82, // Bytes 2d80 - 2dbf 0x99, 0xE3, 0x83, 0x83, 0xE3, 0x82, 0xB7, 0xE3, 0x82, 0xA7, 0xE3, 0x83, 0xAB, 0x52, 0xE3, 0x83, 0x9F, 0xE3, 0x83, 0xAA, 0xE3, 0x83, 0x8F, 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0xAB, 0x52, 0xE3, 0x83, 0xAC, 0xE3, 0x83, 0xB3, 0xE3, 0x83, 0x88, 0xE3, 0x82, 0xB1, 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xB3, 0x5F, 0xD8, 0xB5, 0xD9, 0x84, 0xD9, 0x89, 0x20, 0xD8, 0xA7, 0xD9, 0x84, 0xD9, // Bytes 2dc0 - 2dff 0x84, 0xD9, 0x87, 0x20, 0xD8, 0xB9, 0xD9, 0x84, 0xD9, 0x8A, 0xD9, 0x87, 0x20, 0xD9, 0x88, 0xD8, 0xB3, 0xD9, 0x84, 0xD9, 0x85, 0x44, 0x44, 0x5A, 0xCC, 0x8C, 0xCD, 0x44, 0x44, 0x7A, 0xCC, 0x8C, 0xCD, 0x44, 0x64, 0x7A, 0xCC, 0x8C, 0xCD, 0x46, 0xD9, 0x84, 0xD8, 0xA7, 0xD9, 0x93, 0xCD, 0x46, 0xD9, 0x84, 0xD8, 0xA7, 0xD9, 0x94, 0xCD, 0x46, 0xD9, 0x84, 0xD8, 0xA7, 0xD9, 0x95, 0xB9, 0x49, // Bytes 2e00 - 2e3f 0xE3, 0x83, 0xA1, 0xE3, 0x82, 0xAB, 0xE3, 0x82, 0x99, 0x11, 0x4C, 0xE1, 0x84, 0x8C, 0xE1, 0x85, 0xAE, 0xE1, 0x84, 0x8B, 0xE1, 0x85, 0xB4, 0x01, 0x4C, 0xE3, 0x82, 0xAD, 0xE3, 0x82, 0x99, 0xE3, 0x82, 0xAB, 0xE3, 0x82, 0x99, 0x11, 0x4C, 0xE3, 0x82, 0xB3, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0x9B, 0xE3, 0x82, 0x9A, 0x11, 0x4C, 0xE3, 0x83, 0xA4, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0x88, 0xE3, 0x82, // Bytes 2e40 - 2e7f 0x99, 0x11, 0x4F, 0xE1, 0x84, 0x8E, 0xE1, 0x85, 0xA1, 0xE1, 0x86, 0xB7, 0xE1, 0x84, 0x80, 0xE1, 0x85, 0xA9, 0x01, 0x4F, 0xE3, 0x82, 0xA4, 0xE3, 0x83, 0x8B, 0xE3, 0x83, 0xB3, 0xE3, 0x82, 0xAF, 0xE3, 0x82, 0x99, 0x11, 0x4F, 0xE3, 0x82, 0xB7, 0xE3, 0x83, 0xAA, 0xE3, 0x83, 0xB3, 0xE3, 0x82, 0xAF, 0xE3, 0x82, 0x99, 0x11, 0x4F, 0xE3, 0x83, 0x98, 0xE3, 0x82, 0x9A, 0xE3, 0x83, 0xBC, 0xE3, // Bytes 2e80 - 2ebf 0x82, 0xB7, 0xE3, 0x82, 0x99, 0x11, 0x4F, 0xE3, 0x83, 0x9B, 0xE3, 0x82, 0x9A, 0xE3, 0x83, 0xB3, 0xE3, 0x83, 0x88, 0xE3, 0x82, 0x99, 0x11, 0x52, 0xE3, 0x82, 0xA8, 0xE3, 0x82, 0xB9, 0xE3, 0x82, 0xAF, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0x88, 0xE3, 0x82, 0x99, 0x11, 0x52, 0xE3, 0x83, 0x95, 0xE3, 0x82, 0xA1, 0xE3, 0x83, 0xA9, 0xE3, 0x83, 0x83, 0xE3, 0x83, 0x88, 0xE3, 0x82, 0x99, 0x11, 0x03, // Bytes 2ec0 - 2eff 0x3C, 0xCC, 0xB8, 0x05, 0x03, 0x3D, 0xCC, 0xB8, 0x05, 0x03, 0x3E, 0xCC, 0xB8, 0x05, 0x03, 0x41, 0xCC, 0x80, 0xCD, 0x03, 0x41, 0xCC, 0x81, 0xCD, 0x03, 0x41, 0xCC, 0x83, 0xCD, 0x03, 0x41, 0xCC, 0x84, 0xCD, 0x03, 0x41, 0xCC, 0x89, 0xCD, 0x03, 0x41, 0xCC, 0x8C, 0xCD, 0x03, 0x41, 0xCC, 0x8F, 0xCD, 0x03, 0x41, 0xCC, 0x91, 0xCD, 0x03, 0x41, 0xCC, 0xA5, 0xB9, 0x03, 0x41, 0xCC, 0xA8, 0xA9, // Bytes 2f00 - 2f3f 0x03, 0x42, 0xCC, 0x87, 0xCD, 0x03, 0x42, 0xCC, 0xA3, 0xB9, 0x03, 0x42, 0xCC, 0xB1, 0xB9, 0x03, 0x43, 0xCC, 0x81, 0xCD, 0x03, 0x43, 0xCC, 0x82, 0xCD, 0x03, 0x43, 0xCC, 0x87, 0xCD, 0x03, 0x43, 0xCC, 0x8C, 0xCD, 0x03, 0x44, 0xCC, 0x87, 0xCD, 0x03, 0x44, 0xCC, 0x8C, 0xCD, 0x03, 0x44, 0xCC, 0xA3, 0xB9, 0x03, 0x44, 0xCC, 0xA7, 0xA9, 0x03, 0x44, 0xCC, 0xAD, 0xB9, 0x03, 0x44, 0xCC, 0xB1, // Bytes 2f40 - 2f7f 0xB9, 0x03, 0x45, 0xCC, 0x80, 0xCD, 0x03, 0x45, 0xCC, 0x81, 0xCD, 0x03, 0x45, 0xCC, 0x83, 0xCD, 0x03, 0x45, 0xCC, 0x86, 0xCD, 0x03, 0x45, 0xCC, 0x87, 0xCD, 0x03, 0x45, 0xCC, 0x88, 0xCD, 0x03, 0x45, 0xCC, 0x89, 0xCD, 0x03, 0x45, 0xCC, 0x8C, 0xCD, 0x03, 0x45, 0xCC, 0x8F, 0xCD, 0x03, 0x45, 0xCC, 0x91, 0xCD, 0x03, 0x45, 0xCC, 0xA8, 0xA9, 0x03, 0x45, 0xCC, 0xAD, 0xB9, 0x03, 0x45, 0xCC, // Bytes 2f80 - 2fbf 0xB0, 0xB9, 0x03, 0x46, 0xCC, 0x87, 0xCD, 0x03, 0x47, 0xCC, 0x81, 0xCD, 0x03, 0x47, 0xCC, 0x82, 0xCD, 0x03, 0x47, 0xCC, 0x84, 0xCD, 0x03, 0x47, 0xCC, 0x86, 0xCD, 0x03, 0x47, 0xCC, 0x87, 0xCD, 0x03, 0x47, 0xCC, 0x8C, 0xCD, 0x03, 0x47, 0xCC, 0xA7, 0xA9, 0x03, 0x48, 0xCC, 0x82, 0xCD, 0x03, 0x48, 0xCC, 0x87, 0xCD, 0x03, 0x48, 0xCC, 0x88, 0xCD, 0x03, 0x48, 0xCC, 0x8C, 0xCD, 0x03, 0x48, // Bytes 2fc0 - 2fff 0xCC, 0xA3, 0xB9, 0x03, 0x48, 0xCC, 0xA7, 0xA9, 0x03, 0x48, 0xCC, 0xAE, 0xB9, 0x03, 0x49, 0xCC, 0x80, 0xCD, 0x03, 0x49, 0xCC, 0x81, 0xCD, 0x03, 0x49, 0xCC, 0x82, 0xCD, 0x03, 0x49, 0xCC, 0x83, 0xCD, 0x03, 0x49, 0xCC, 0x84, 0xCD, 0x03, 0x49, 0xCC, 0x86, 0xCD, 0x03, 0x49, 0xCC, 0x87, 0xCD, 0x03, 0x49, 0xCC, 0x89, 0xCD, 0x03, 0x49, 0xCC, 0x8C, 0xCD, 0x03, 0x49, 0xCC, 0x8F, 0xCD, 0x03, // Bytes 3000 - 303f 0x49, 0xCC, 0x91, 0xCD, 0x03, 0x49, 0xCC, 0xA3, 0xB9, 0x03, 0x49, 0xCC, 0xA8, 0xA9, 0x03, 0x49, 0xCC, 0xB0, 0xB9, 0x03, 0x4A, 0xCC, 0x82, 0xCD, 0x03, 0x4B, 0xCC, 0x81, 0xCD, 0x03, 0x4B, 0xCC, 0x8C, 0xCD, 0x03, 0x4B, 0xCC, 0xA3, 0xB9, 0x03, 0x4B, 0xCC, 0xA7, 0xA9, 0x03, 0x4B, 0xCC, 0xB1, 0xB9, 0x03, 0x4C, 0xCC, 0x81, 0xCD, 0x03, 0x4C, 0xCC, 0x8C, 0xCD, 0x03, 0x4C, 0xCC, 0xA7, 0xA9, // Bytes 3040 - 307f 0x03, 0x4C, 0xCC, 0xAD, 0xB9, 0x03, 0x4C, 0xCC, 0xB1, 0xB9, 0x03, 0x4D, 0xCC, 0x81, 0xCD, 0x03, 0x4D, 0xCC, 0x87, 0xCD, 0x03, 0x4D, 0xCC, 0xA3, 0xB9, 0x03, 0x4E, 0xCC, 0x80, 0xCD, 0x03, 0x4E, 0xCC, 0x81, 0xCD, 0x03, 0x4E, 0xCC, 0x83, 0xCD, 0x03, 0x4E, 0xCC, 0x87, 0xCD, 0x03, 0x4E, 0xCC, 0x8C, 0xCD, 0x03, 0x4E, 0xCC, 0xA3, 0xB9, 0x03, 0x4E, 0xCC, 0xA7, 0xA9, 0x03, 0x4E, 0xCC, 0xAD, // Bytes 3080 - 30bf 0xB9, 0x03, 0x4E, 0xCC, 0xB1, 0xB9, 0x03, 0x4F, 0xCC, 0x80, 0xCD, 0x03, 0x4F, 0xCC, 0x81, 0xCD, 0x03, 0x4F, 0xCC, 0x86, 0xCD, 0x03, 0x4F, 0xCC, 0x89, 0xCD, 0x03, 0x4F, 0xCC, 0x8B, 0xCD, 0x03, 0x4F, 0xCC, 0x8C, 0xCD, 0x03, 0x4F, 0xCC, 0x8F, 0xCD, 0x03, 0x4F, 0xCC, 0x91, 0xCD, 0x03, 0x50, 0xCC, 0x81, 0xCD, 0x03, 0x50, 0xCC, 0x87, 0xCD, 0x03, 0x52, 0xCC, 0x81, 0xCD, 0x03, 0x52, 0xCC, // Bytes 30c0 - 30ff 0x87, 0xCD, 0x03, 0x52, 0xCC, 0x8C, 0xCD, 0x03, 0x52, 0xCC, 0x8F, 0xCD, 0x03, 0x52, 0xCC, 0x91, 0xCD, 0x03, 0x52, 0xCC, 0xA7, 0xA9, 0x03, 0x52, 0xCC, 0xB1, 0xB9, 0x03, 0x53, 0xCC, 0x82, 0xCD, 0x03, 0x53, 0xCC, 0x87, 0xCD, 0x03, 0x53, 0xCC, 0xA6, 0xB9, 0x03, 0x53, 0xCC, 0xA7, 0xA9, 0x03, 0x54, 0xCC, 0x87, 0xCD, 0x03, 0x54, 0xCC, 0x8C, 0xCD, 0x03, 0x54, 0xCC, 0xA3, 0xB9, 0x03, 0x54, // Bytes 3100 - 313f 0xCC, 0xA6, 0xB9, 0x03, 0x54, 0xCC, 0xA7, 0xA9, 0x03, 0x54, 0xCC, 0xAD, 0xB9, 0x03, 0x54, 0xCC, 0xB1, 0xB9, 0x03, 0x55, 0xCC, 0x80, 0xCD, 0x03, 0x55, 0xCC, 0x81, 0xCD, 0x03, 0x55, 0xCC, 0x82, 0xCD, 0x03, 0x55, 0xCC, 0x86, 0xCD, 0x03, 0x55, 0xCC, 0x89, 0xCD, 0x03, 0x55, 0xCC, 0x8A, 0xCD, 0x03, 0x55, 0xCC, 0x8B, 0xCD, 0x03, 0x55, 0xCC, 0x8C, 0xCD, 0x03, 0x55, 0xCC, 0x8F, 0xCD, 0x03, // Bytes 3140 - 317f 0x55, 0xCC, 0x91, 0xCD, 0x03, 0x55, 0xCC, 0xA3, 0xB9, 0x03, 0x55, 0xCC, 0xA4, 0xB9, 0x03, 0x55, 0xCC, 0xA8, 0xA9, 0x03, 0x55, 0xCC, 0xAD, 0xB9, 0x03, 0x55, 0xCC, 0xB0, 0xB9, 0x03, 0x56, 0xCC, 0x83, 0xCD, 0x03, 0x56, 0xCC, 0xA3, 0xB9, 0x03, 0x57, 0xCC, 0x80, 0xCD, 0x03, 0x57, 0xCC, 0x81, 0xCD, 0x03, 0x57, 0xCC, 0x82, 0xCD, 0x03, 0x57, 0xCC, 0x87, 0xCD, 0x03, 0x57, 0xCC, 0x88, 0xCD, // Bytes 3180 - 31bf 0x03, 0x57, 0xCC, 0xA3, 0xB9, 0x03, 0x58, 0xCC, 0x87, 0xCD, 0x03, 0x58, 0xCC, 0x88, 0xCD, 0x03, 0x59, 0xCC, 0x80, 0xCD, 0x03, 0x59, 0xCC, 0x81, 0xCD, 0x03, 0x59, 0xCC, 0x82, 0xCD, 0x03, 0x59, 0xCC, 0x83, 0xCD, 0x03, 0x59, 0xCC, 0x84, 0xCD, 0x03, 0x59, 0xCC, 0x87, 0xCD, 0x03, 0x59, 0xCC, 0x88, 0xCD, 0x03, 0x59, 0xCC, 0x89, 0xCD, 0x03, 0x59, 0xCC, 0xA3, 0xB9, 0x03, 0x5A, 0xCC, 0x81, // Bytes 31c0 - 31ff 0xCD, 0x03, 0x5A, 0xCC, 0x82, 0xCD, 0x03, 0x5A, 0xCC, 0x87, 0xCD, 0x03, 0x5A, 0xCC, 0x8C, 0xCD, 0x03, 0x5A, 0xCC, 0xA3, 0xB9, 0x03, 0x5A, 0xCC, 0xB1, 0xB9, 0x03, 0x61, 0xCC, 0x80, 0xCD, 0x03, 0x61, 0xCC, 0x81, 0xCD, 0x03, 0x61, 0xCC, 0x83, 0xCD, 0x03, 0x61, 0xCC, 0x84, 0xCD, 0x03, 0x61, 0xCC, 0x89, 0xCD, 0x03, 0x61, 0xCC, 0x8C, 0xCD, 0x03, 0x61, 0xCC, 0x8F, 0xCD, 0x03, 0x61, 0xCC, // Bytes 3200 - 323f 0x91, 0xCD, 0x03, 0x61, 0xCC, 0xA5, 0xB9, 0x03, 0x61, 0xCC, 0xA8, 0xA9, 0x03, 0x62, 0xCC, 0x87, 0xCD, 0x03, 0x62, 0xCC, 0xA3, 0xB9, 0x03, 0x62, 0xCC, 0xB1, 0xB9, 0x03, 0x63, 0xCC, 0x81, 0xCD, 0x03, 0x63, 0xCC, 0x82, 0xCD, 0x03, 0x63, 0xCC, 0x87, 0xCD, 0x03, 0x63, 0xCC, 0x8C, 0xCD, 0x03, 0x64, 0xCC, 0x87, 0xCD, 0x03, 0x64, 0xCC, 0x8C, 0xCD, 0x03, 0x64, 0xCC, 0xA3, 0xB9, 0x03, 0x64, // Bytes 3240 - 327f 0xCC, 0xA7, 0xA9, 0x03, 0x64, 0xCC, 0xAD, 0xB9, 0x03, 0x64, 0xCC, 0xB1, 0xB9, 0x03, 0x65, 0xCC, 0x80, 0xCD, 0x03, 0x65, 0xCC, 0x81, 0xCD, 0x03, 0x65, 0xCC, 0x83, 0xCD, 0x03, 0x65, 0xCC, 0x86, 0xCD, 0x03, 0x65, 0xCC, 0x87, 0xCD, 0x03, 0x65, 0xCC, 0x88, 0xCD, 0x03, 0x65, 0xCC, 0x89, 0xCD, 0x03, 0x65, 0xCC, 0x8C, 0xCD, 0x03, 0x65, 0xCC, 0x8F, 0xCD, 0x03, 0x65, 0xCC, 0x91, 0xCD, 0x03, // Bytes 3280 - 32bf 0x65, 0xCC, 0xA8, 0xA9, 0x03, 0x65, 0xCC, 0xAD, 0xB9, 0x03, 0x65, 0xCC, 0xB0, 0xB9, 0x03, 0x66, 0xCC, 0x87, 0xCD, 0x03, 0x67, 0xCC, 0x81, 0xCD, 0x03, 0x67, 0xCC, 0x82, 0xCD, 0x03, 0x67, 0xCC, 0x84, 0xCD, 0x03, 0x67, 0xCC, 0x86, 0xCD, 0x03, 0x67, 0xCC, 0x87, 0xCD, 0x03, 0x67, 0xCC, 0x8C, 0xCD, 0x03, 0x67, 0xCC, 0xA7, 0xA9, 0x03, 0x68, 0xCC, 0x82, 0xCD, 0x03, 0x68, 0xCC, 0x87, 0xCD, // Bytes 32c0 - 32ff 0x03, 0x68, 0xCC, 0x88, 0xCD, 0x03, 0x68, 0xCC, 0x8C, 0xCD, 0x03, 0x68, 0xCC, 0xA3, 0xB9, 0x03, 0x68, 0xCC, 0xA7, 0xA9, 0x03, 0x68, 0xCC, 0xAE, 0xB9, 0x03, 0x68, 0xCC, 0xB1, 0xB9, 0x03, 0x69, 0xCC, 0x80, 0xCD, 0x03, 0x69, 0xCC, 0x81, 0xCD, 0x03, 0x69, 0xCC, 0x82, 0xCD, 0x03, 0x69, 0xCC, 0x83, 0xCD, 0x03, 0x69, 0xCC, 0x84, 0xCD, 0x03, 0x69, 0xCC, 0x86, 0xCD, 0x03, 0x69, 0xCC, 0x89, // Bytes 3300 - 333f 0xCD, 0x03, 0x69, 0xCC, 0x8C, 0xCD, 0x03, 0x69, 0xCC, 0x8F, 0xCD, 0x03, 0x69, 0xCC, 0x91, 0xCD, 0x03, 0x69, 0xCC, 0xA3, 0xB9, 0x03, 0x69, 0xCC, 0xA8, 0xA9, 0x03, 0x69, 0xCC, 0xB0, 0xB9, 0x03, 0x6A, 0xCC, 0x82, 0xCD, 0x03, 0x6A, 0xCC, 0x8C, 0xCD, 0x03, 0x6B, 0xCC, 0x81, 0xCD, 0x03, 0x6B, 0xCC, 0x8C, 0xCD, 0x03, 0x6B, 0xCC, 0xA3, 0xB9, 0x03, 0x6B, 0xCC, 0xA7, 0xA9, 0x03, 0x6B, 0xCC, // Bytes 3340 - 337f 0xB1, 0xB9, 0x03, 0x6C, 0xCC, 0x81, 0xCD, 0x03, 0x6C, 0xCC, 0x8C, 0xCD, 0x03, 0x6C, 0xCC, 0xA7, 0xA9, 0x03, 0x6C, 0xCC, 0xAD, 0xB9, 0x03, 0x6C, 0xCC, 0xB1, 0xB9, 0x03, 0x6D, 0xCC, 0x81, 0xCD, 0x03, 0x6D, 0xCC, 0x87, 0xCD, 0x03, 0x6D, 0xCC, 0xA3, 0xB9, 0x03, 0x6E, 0xCC, 0x80, 0xCD, 0x03, 0x6E, 0xCC, 0x81, 0xCD, 0x03, 0x6E, 0xCC, 0x83, 0xCD, 0x03, 0x6E, 0xCC, 0x87, 0xCD, 0x03, 0x6E, // Bytes 3380 - 33bf 0xCC, 0x8C, 0xCD, 0x03, 0x6E, 0xCC, 0xA3, 0xB9, 0x03, 0x6E, 0xCC, 0xA7, 0xA9, 0x03, 0x6E, 0xCC, 0xAD, 0xB9, 0x03, 0x6E, 0xCC, 0xB1, 0xB9, 0x03, 0x6F, 0xCC, 0x80, 0xCD, 0x03, 0x6F, 0xCC, 0x81, 0xCD, 0x03, 0x6F, 0xCC, 0x86, 0xCD, 0x03, 0x6F, 0xCC, 0x89, 0xCD, 0x03, 0x6F, 0xCC, 0x8B, 0xCD, 0x03, 0x6F, 0xCC, 0x8C, 0xCD, 0x03, 0x6F, 0xCC, 0x8F, 0xCD, 0x03, 0x6F, 0xCC, 0x91, 0xCD, 0x03, // Bytes 33c0 - 33ff 0x70, 0xCC, 0x81, 0xCD, 0x03, 0x70, 0xCC, 0x87, 0xCD, 0x03, 0x72, 0xCC, 0x81, 0xCD, 0x03, 0x72, 0xCC, 0x87, 0xCD, 0x03, 0x72, 0xCC, 0x8C, 0xCD, 0x03, 0x72, 0xCC, 0x8F, 0xCD, 0x03, 0x72, 0xCC, 0x91, 0xCD, 0x03, 0x72, 0xCC, 0xA7, 0xA9, 0x03, 0x72, 0xCC, 0xB1, 0xB9, 0x03, 0x73, 0xCC, 0x82, 0xCD, 0x03, 0x73, 0xCC, 0x87, 0xCD, 0x03, 0x73, 0xCC, 0xA6, 0xB9, 0x03, 0x73, 0xCC, 0xA7, 0xA9, // Bytes 3400 - 343f 0x03, 0x74, 0xCC, 0x87, 0xCD, 0x03, 0x74, 0xCC, 0x88, 0xCD, 0x03, 0x74, 0xCC, 0x8C, 0xCD, 0x03, 0x74, 0xCC, 0xA3, 0xB9, 0x03, 0x74, 0xCC, 0xA6, 0xB9, 0x03, 0x74, 0xCC, 0xA7, 0xA9, 0x03, 0x74, 0xCC, 0xAD, 0xB9, 0x03, 0x74, 0xCC, 0xB1, 0xB9, 0x03, 0x75, 0xCC, 0x80, 0xCD, 0x03, 0x75, 0xCC, 0x81, 0xCD, 0x03, 0x75, 0xCC, 0x82, 0xCD, 0x03, 0x75, 0xCC, 0x86, 0xCD, 0x03, 0x75, 0xCC, 0x89, // Bytes 3440 - 347f 0xCD, 0x03, 0x75, 0xCC, 0x8A, 0xCD, 0x03, 0x75, 0xCC, 0x8B, 0xCD, 0x03, 0x75, 0xCC, 0x8C, 0xCD, 0x03, 0x75, 0xCC, 0x8F, 0xCD, 0x03, 0x75, 0xCC, 0x91, 0xCD, 0x03, 0x75, 0xCC, 0xA3, 0xB9, 0x03, 0x75, 0xCC, 0xA4, 0xB9, 0x03, 0x75, 0xCC, 0xA8, 0xA9, 0x03, 0x75, 0xCC, 0xAD, 0xB9, 0x03, 0x75, 0xCC, 0xB0, 0xB9, 0x03, 0x76, 0xCC, 0x83, 0xCD, 0x03, 0x76, 0xCC, 0xA3, 0xB9, 0x03, 0x77, 0xCC, // Bytes 3480 - 34bf 0x80, 0xCD, 0x03, 0x77, 0xCC, 0x81, 0xCD, 0x03, 0x77, 0xCC, 0x82, 0xCD, 0x03, 0x77, 0xCC, 0x87, 0xCD, 0x03, 0x77, 0xCC, 0x88, 0xCD, 0x03, 0x77, 0xCC, 0x8A, 0xCD, 0x03, 0x77, 0xCC, 0xA3, 0xB9, 0x03, 0x78, 0xCC, 0x87, 0xCD, 0x03, 0x78, 0xCC, 0x88, 0xCD, 0x03, 0x79, 0xCC, 0x80, 0xCD, 0x03, 0x79, 0xCC, 0x81, 0xCD, 0x03, 0x79, 0xCC, 0x82, 0xCD, 0x03, 0x79, 0xCC, 0x83, 0xCD, 0x03, 0x79, // Bytes 34c0 - 34ff 0xCC, 0x84, 0xCD, 0x03, 0x79, 0xCC, 0x87, 0xCD, 0x03, 0x79, 0xCC, 0x88, 0xCD, 0x03, 0x79, 0xCC, 0x89, 0xCD, 0x03, 0x79, 0xCC, 0x8A, 0xCD, 0x03, 0x79, 0xCC, 0xA3, 0xB9, 0x03, 0x7A, 0xCC, 0x81, 0xCD, 0x03, 0x7A, 0xCC, 0x82, 0xCD, 0x03, 0x7A, 0xCC, 0x87, 0xCD, 0x03, 0x7A, 0xCC, 0x8C, 0xCD, 0x03, 0x7A, 0xCC, 0xA3, 0xB9, 0x03, 0x7A, 0xCC, 0xB1, 0xB9, 0x04, 0xC2, 0xA8, 0xCC, 0x80, 0xCE, // Bytes 3500 - 353f 0x04, 0xC2, 0xA8, 0xCC, 0x81, 0xCE, 0x04, 0xC2, 0xA8, 0xCD, 0x82, 0xCE, 0x04, 0xC3, 0x86, 0xCC, 0x81, 0xCD, 0x04, 0xC3, 0x86, 0xCC, 0x84, 0xCD, 0x04, 0xC3, 0x98, 0xCC, 0x81, 0xCD, 0x04, 0xC3, 0xA6, 0xCC, 0x81, 0xCD, 0x04, 0xC3, 0xA6, 0xCC, 0x84, 0xCD, 0x04, 0xC3, 0xB8, 0xCC, 0x81, 0xCD, 0x04, 0xC5, 0xBF, 0xCC, 0x87, 0xCD, 0x04, 0xC6, 0xB7, 0xCC, 0x8C, 0xCD, 0x04, 0xCA, 0x92, 0xCC, // Bytes 3540 - 357f 0x8C, 0xCD, 0x04, 0xCE, 0x91, 0xCC, 0x80, 0xCD, 0x04, 0xCE, 0x91, 0xCC, 0x81, 0xCD, 0x04, 0xCE, 0x91, 0xCC, 0x84, 0xCD, 0x04, 0xCE, 0x91, 0xCC, 0x86, 0xCD, 0x04, 0xCE, 0x91, 0xCD, 0x85, 0xDD, 0x04, 0xCE, 0x95, 0xCC, 0x80, 0xCD, 0x04, 0xCE, 0x95, 0xCC, 0x81, 0xCD, 0x04, 0xCE, 0x97, 0xCC, 0x80, 0xCD, 0x04, 0xCE, 0x97, 0xCC, 0x81, 0xCD, 0x04, 0xCE, 0x97, 0xCD, 0x85, 0xDD, 0x04, 0xCE, // Bytes 3580 - 35bf 0x99, 0xCC, 0x80, 0xCD, 0x04, 0xCE, 0x99, 0xCC, 0x81, 0xCD, 0x04, 0xCE, 0x99, 0xCC, 0x84, 0xCD, 0x04, 0xCE, 0x99, 0xCC, 0x86, 0xCD, 0x04, 0xCE, 0x99, 0xCC, 0x88, 0xCD, 0x04, 0xCE, 0x9F, 0xCC, 0x80, 0xCD, 0x04, 0xCE, 0x9F, 0xCC, 0x81, 0xCD, 0x04, 0xCE, 0xA1, 0xCC, 0x94, 0xCD, 0x04, 0xCE, 0xA5, 0xCC, 0x80, 0xCD, 0x04, 0xCE, 0xA5, 0xCC, 0x81, 0xCD, 0x04, 0xCE, 0xA5, 0xCC, 0x84, 0xCD, // Bytes 35c0 - 35ff 0x04, 0xCE, 0xA5, 0xCC, 0x86, 0xCD, 0x04, 0xCE, 0xA5, 0xCC, 0x88, 0xCD, 0x04, 0xCE, 0xA9, 0xCC, 0x80, 0xCD, 0x04, 0xCE, 0xA9, 0xCC, 0x81, 0xCD, 0x04, 0xCE, 0xA9, 0xCD, 0x85, 0xDD, 0x04, 0xCE, 0xB1, 0xCC, 0x84, 0xCD, 0x04, 0xCE, 0xB1, 0xCC, 0x86, 0xCD, 0x04, 0xCE, 0xB1, 0xCD, 0x85, 0xDD, 0x04, 0xCE, 0xB5, 0xCC, 0x80, 0xCD, 0x04, 0xCE, 0xB5, 0xCC, 0x81, 0xCD, 0x04, 0xCE, 0xB7, 0xCD, // Bytes 3600 - 363f 0x85, 0xDD, 0x04, 0xCE, 0xB9, 0xCC, 0x80, 0xCD, 0x04, 0xCE, 0xB9, 0xCC, 0x81, 0xCD, 0x04, 0xCE, 0xB9, 0xCC, 0x84, 0xCD, 0x04, 0xCE, 0xB9, 0xCC, 0x86, 0xCD, 0x04, 0xCE, 0xB9, 0xCD, 0x82, 0xCD, 0x04, 0xCE, 0xBF, 0xCC, 0x80, 0xCD, 0x04, 0xCE, 0xBF, 0xCC, 0x81, 0xCD, 0x04, 0xCF, 0x81, 0xCC, 0x93, 0xCD, 0x04, 0xCF, 0x81, 0xCC, 0x94, 0xCD, 0x04, 0xCF, 0x85, 0xCC, 0x80, 0xCD, 0x04, 0xCF, // Bytes 3640 - 367f 0x85, 0xCC, 0x81, 0xCD, 0x04, 0xCF, 0x85, 0xCC, 0x84, 0xCD, 0x04, 0xCF, 0x85, 0xCC, 0x86, 0xCD, 0x04, 0xCF, 0x85, 0xCD, 0x82, 0xCD, 0x04, 0xCF, 0x89, 0xCD, 0x85, 0xDD, 0x04, 0xCF, 0x92, 0xCC, 0x81, 0xCD, 0x04, 0xCF, 0x92, 0xCC, 0x88, 0xCD, 0x04, 0xD0, 0x86, 0xCC, 0x88, 0xCD, 0x04, 0xD0, 0x90, 0xCC, 0x86, 0xCD, 0x04, 0xD0, 0x90, 0xCC, 0x88, 0xCD, 0x04, 0xD0, 0x93, 0xCC, 0x81, 0xCD, // Bytes 3680 - 36bf 0x04, 0xD0, 0x95, 0xCC, 0x80, 0xCD, 0x04, 0xD0, 0x95, 0xCC, 0x86, 0xCD, 0x04, 0xD0, 0x95, 0xCC, 0x88, 0xCD, 0x04, 0xD0, 0x96, 0xCC, 0x86, 0xCD, 0x04, 0xD0, 0x96, 0xCC, 0x88, 0xCD, 0x04, 0xD0, 0x97, 0xCC, 0x88, 0xCD, 0x04, 0xD0, 0x98, 0xCC, 0x80, 0xCD, 0x04, 0xD0, 0x98, 0xCC, 0x84, 0xCD, 0x04, 0xD0, 0x98, 0xCC, 0x86, 0xCD, 0x04, 0xD0, 0x98, 0xCC, 0x88, 0xCD, 0x04, 0xD0, 0x9A, 0xCC, // Bytes 36c0 - 36ff 0x81, 0xCD, 0x04, 0xD0, 0x9E, 0xCC, 0x88, 0xCD, 0x04, 0xD0, 0xA3, 0xCC, 0x84, 0xCD, 0x04, 0xD0, 0xA3, 0xCC, 0x86, 0xCD, 0x04, 0xD0, 0xA3, 0xCC, 0x88, 0xCD, 0x04, 0xD0, 0xA3, 0xCC, 0x8B, 0xCD, 0x04, 0xD0, 0xA7, 0xCC, 0x88, 0xCD, 0x04, 0xD0, 0xAB, 0xCC, 0x88, 0xCD, 0x04, 0xD0, 0xAD, 0xCC, 0x88, 0xCD, 0x04, 0xD0, 0xB0, 0xCC, 0x86, 0xCD, 0x04, 0xD0, 0xB0, 0xCC, 0x88, 0xCD, 0x04, 0xD0, // Bytes 3700 - 373f 0xB3, 0xCC, 0x81, 0xCD, 0x04, 0xD0, 0xB5, 0xCC, 0x80, 0xCD, 0x04, 0xD0, 0xB5, 0xCC, 0x86, 0xCD, 0x04, 0xD0, 0xB5, 0xCC, 0x88, 0xCD, 0x04, 0xD0, 0xB6, 0xCC, 0x86, 0xCD, 0x04, 0xD0, 0xB6, 0xCC, 0x88, 0xCD, 0x04, 0xD0, 0xB7, 0xCC, 0x88, 0xCD, 0x04, 0xD0, 0xB8, 0xCC, 0x80, 0xCD, 0x04, 0xD0, 0xB8, 0xCC, 0x84, 0xCD, 0x04, 0xD0, 0xB8, 0xCC, 0x86, 0xCD, 0x04, 0xD0, 0xB8, 0xCC, 0x88, 0xCD, // Bytes 3740 - 377f 0x04, 0xD0, 0xBA, 0xCC, 0x81, 0xCD, 0x04, 0xD0, 0xBE, 0xCC, 0x88, 0xCD, 0x04, 0xD1, 0x83, 0xCC, 0x84, 0xCD, 0x04, 0xD1, 0x83, 0xCC, 0x86, 0xCD, 0x04, 0xD1, 0x83, 0xCC, 0x88, 0xCD, 0x04, 0xD1, 0x83, 0xCC, 0x8B, 0xCD, 0x04, 0xD1, 0x87, 0xCC, 0x88, 0xCD, 0x04, 0xD1, 0x8B, 0xCC, 0x88, 0xCD, 0x04, 0xD1, 0x8D, 0xCC, 0x88, 0xCD, 0x04, 0xD1, 0x96, 0xCC, 0x88, 0xCD, 0x04, 0xD1, 0xB4, 0xCC, // Bytes 3780 - 37bf 0x8F, 0xCD, 0x04, 0xD1, 0xB5, 0xCC, 0x8F, 0xCD, 0x04, 0xD3, 0x98, 0xCC, 0x88, 0xCD, 0x04, 0xD3, 0x99, 0xCC, 0x88, 0xCD, 0x04, 0xD3, 0xA8, 0xCC, 0x88, 0xCD, 0x04, 0xD3, 0xA9, 0xCC, 0x88, 0xCD, 0x04, 0xD8, 0xA7, 0xD9, 0x93, 0xCD, 0x04, 0xD8, 0xA7, 0xD9, 0x94, 0xCD, 0x04, 0xD8, 0xA7, 0xD9, 0x95, 0xB9, 0x04, 0xD9, 0x88, 0xD9, 0x94, 0xCD, 0x04, 0xD9, 0x8A, 0xD9, 0x94, 0xCD, 0x04, 0xDB, // Bytes 37c0 - 37ff 0x81, 0xD9, 0x94, 0xCD, 0x04, 0xDB, 0x92, 0xD9, 0x94, 0xCD, 0x04, 0xDB, 0x95, 0xD9, 0x94, 0xCD, 0x05, 0x41, 0xCC, 0x82, 0xCC, 0x80, 0xCE, 0x05, 0x41, 0xCC, 0x82, 0xCC, 0x81, 0xCE, 0x05, 0x41, 0xCC, 0x82, 0xCC, 0x83, 0xCE, 0x05, 0x41, 0xCC, 0x82, 0xCC, 0x89, 0xCE, 0x05, 0x41, 0xCC, 0x86, 0xCC, 0x80, 0xCE, 0x05, 0x41, 0xCC, 0x86, 0xCC, 0x81, 0xCE, 0x05, 0x41, 0xCC, 0x86, 0xCC, 0x83, // Bytes 3800 - 383f 0xCE, 0x05, 0x41, 0xCC, 0x86, 0xCC, 0x89, 0xCE, 0x05, 0x41, 0xCC, 0x87, 0xCC, 0x84, 0xCE, 0x05, 0x41, 0xCC, 0x88, 0xCC, 0x84, 0xCE, 0x05, 0x41, 0xCC, 0x8A, 0xCC, 0x81, 0xCE, 0x05, 0x41, 0xCC, 0xA3, 0xCC, 0x82, 0xCE, 0x05, 0x41, 0xCC, 0xA3, 0xCC, 0x86, 0xCE, 0x05, 0x43, 0xCC, 0xA7, 0xCC, 0x81, 0xCE, 0x05, 0x45, 0xCC, 0x82, 0xCC, 0x80, 0xCE, 0x05, 0x45, 0xCC, 0x82, 0xCC, 0x81, 0xCE, // Bytes 3840 - 387f 0x05, 0x45, 0xCC, 0x82, 0xCC, 0x83, 0xCE, 0x05, 0x45, 0xCC, 0x82, 0xCC, 0x89, 0xCE, 0x05, 0x45, 0xCC, 0x84, 0xCC, 0x80, 0xCE, 0x05, 0x45, 0xCC, 0x84, 0xCC, 0x81, 0xCE, 0x05, 0x45, 0xCC, 0xA3, 0xCC, 0x82, 0xCE, 0x05, 0x45, 0xCC, 0xA7, 0xCC, 0x86, 0xCE, 0x05, 0x49, 0xCC, 0x88, 0xCC, 0x81, 0xCE, 0x05, 0x4C, 0xCC, 0xA3, 0xCC, 0x84, 0xCE, 0x05, 0x4F, 0xCC, 0x82, 0xCC, 0x80, 0xCE, 0x05, // Bytes 3880 - 38bf 0x4F, 0xCC, 0x82, 0xCC, 0x81, 0xCE, 0x05, 0x4F, 0xCC, 0x82, 0xCC, 0x83, 0xCE, 0x05, 0x4F, 0xCC, 0x82, 0xCC, 0x89, 0xCE, 0x05, 0x4F, 0xCC, 0x83, 0xCC, 0x81, 0xCE, 0x05, 0x4F, 0xCC, 0x83, 0xCC, 0x84, 0xCE, 0x05, 0x4F, 0xCC, 0x83, 0xCC, 0x88, 0xCE, 0x05, 0x4F, 0xCC, 0x84, 0xCC, 0x80, 0xCE, 0x05, 0x4F, 0xCC, 0x84, 0xCC, 0x81, 0xCE, 0x05, 0x4F, 0xCC, 0x87, 0xCC, 0x84, 0xCE, 0x05, 0x4F, // Bytes 38c0 - 38ff 0xCC, 0x88, 0xCC, 0x84, 0xCE, 0x05, 0x4F, 0xCC, 0x9B, 0xCC, 0x80, 0xCE, 0x05, 0x4F, 0xCC, 0x9B, 0xCC, 0x81, 0xCE, 0x05, 0x4F, 0xCC, 0x9B, 0xCC, 0x83, 0xCE, 0x05, 0x4F, 0xCC, 0x9B, 0xCC, 0x89, 0xCE, 0x05, 0x4F, 0xCC, 0x9B, 0xCC, 0xA3, 0xBA, 0x05, 0x4F, 0xCC, 0xA3, 0xCC, 0x82, 0xCE, 0x05, 0x4F, 0xCC, 0xA8, 0xCC, 0x84, 0xCE, 0x05, 0x52, 0xCC, 0xA3, 0xCC, 0x84, 0xCE, 0x05, 0x53, 0xCC, // Bytes 3900 - 393f 0x81, 0xCC, 0x87, 0xCE, 0x05, 0x53, 0xCC, 0x8C, 0xCC, 0x87, 0xCE, 0x05, 0x53, 0xCC, 0xA3, 0xCC, 0x87, 0xCE, 0x05, 0x55, 0xCC, 0x83, 0xCC, 0x81, 0xCE, 0x05, 0x55, 0xCC, 0x84, 0xCC, 0x88, 0xCE, 0x05, 0x55, 0xCC, 0x88, 0xCC, 0x80, 0xCE, 0x05, 0x55, 0xCC, 0x88, 0xCC, 0x81, 0xCE, 0x05, 0x55, 0xCC, 0x88, 0xCC, 0x84, 0xCE, 0x05, 0x55, 0xCC, 0x88, 0xCC, 0x8C, 0xCE, 0x05, 0x55, 0xCC, 0x9B, // Bytes 3940 - 397f 0xCC, 0x80, 0xCE, 0x05, 0x55, 0xCC, 0x9B, 0xCC, 0x81, 0xCE, 0x05, 0x55, 0xCC, 0x9B, 0xCC, 0x83, 0xCE, 0x05, 0x55, 0xCC, 0x9B, 0xCC, 0x89, 0xCE, 0x05, 0x55, 0xCC, 0x9B, 0xCC, 0xA3, 0xBA, 0x05, 0x61, 0xCC, 0x82, 0xCC, 0x80, 0xCE, 0x05, 0x61, 0xCC, 0x82, 0xCC, 0x81, 0xCE, 0x05, 0x61, 0xCC, 0x82, 0xCC, 0x83, 0xCE, 0x05, 0x61, 0xCC, 0x82, 0xCC, 0x89, 0xCE, 0x05, 0x61, 0xCC, 0x86, 0xCC, // Bytes 3980 - 39bf 0x80, 0xCE, 0x05, 0x61, 0xCC, 0x86, 0xCC, 0x81, 0xCE, 0x05, 0x61, 0xCC, 0x86, 0xCC, 0x83, 0xCE, 0x05, 0x61, 0xCC, 0x86, 0xCC, 0x89, 0xCE, 0x05, 0x61, 0xCC, 0x87, 0xCC, 0x84, 0xCE, 0x05, 0x61, 0xCC, 0x88, 0xCC, 0x84, 0xCE, 0x05, 0x61, 0xCC, 0x8A, 0xCC, 0x81, 0xCE, 0x05, 0x61, 0xCC, 0xA3, 0xCC, 0x82, 0xCE, 0x05, 0x61, 0xCC, 0xA3, 0xCC, 0x86, 0xCE, 0x05, 0x63, 0xCC, 0xA7, 0xCC, 0x81, // Bytes 39c0 - 39ff 0xCE, 0x05, 0x65, 0xCC, 0x82, 0xCC, 0x80, 0xCE, 0x05, 0x65, 0xCC, 0x82, 0xCC, 0x81, 0xCE, 0x05, 0x65, 0xCC, 0x82, 0xCC, 0x83, 0xCE, 0x05, 0x65, 0xCC, 0x82, 0xCC, 0x89, 0xCE, 0x05, 0x65, 0xCC, 0x84, 0xCC, 0x80, 0xCE, 0x05, 0x65, 0xCC, 0x84, 0xCC, 0x81, 0xCE, 0x05, 0x65, 0xCC, 0xA3, 0xCC, 0x82, 0xCE, 0x05, 0x65, 0xCC, 0xA7, 0xCC, 0x86, 0xCE, 0x05, 0x69, 0xCC, 0x88, 0xCC, 0x81, 0xCE, // Bytes 3a00 - 3a3f 0x05, 0x6C, 0xCC, 0xA3, 0xCC, 0x84, 0xCE, 0x05, 0x6F, 0xCC, 0x82, 0xCC, 0x80, 0xCE, 0x05, 0x6F, 0xCC, 0x82, 0xCC, 0x81, 0xCE, 0x05, 0x6F, 0xCC, 0x82, 0xCC, 0x83, 0xCE, 0x05, 0x6F, 0xCC, 0x82, 0xCC, 0x89, 0xCE, 0x05, 0x6F, 0xCC, 0x83, 0xCC, 0x81, 0xCE, 0x05, 0x6F, 0xCC, 0x83, 0xCC, 0x84, 0xCE, 0x05, 0x6F, 0xCC, 0x83, 0xCC, 0x88, 0xCE, 0x05, 0x6F, 0xCC, 0x84, 0xCC, 0x80, 0xCE, 0x05, // Bytes 3a40 - 3a7f 0x6F, 0xCC, 0x84, 0xCC, 0x81, 0xCE, 0x05, 0x6F, 0xCC, 0x87, 0xCC, 0x84, 0xCE, 0x05, 0x6F, 0xCC, 0x88, 0xCC, 0x84, 0xCE, 0x05, 0x6F, 0xCC, 0x9B, 0xCC, 0x80, 0xCE, 0x05, 0x6F, 0xCC, 0x9B, 0xCC, 0x81, 0xCE, 0x05, 0x6F, 0xCC, 0x9B, 0xCC, 0x83, 0xCE, 0x05, 0x6F, 0xCC, 0x9B, 0xCC, 0x89, 0xCE, 0x05, 0x6F, 0xCC, 0x9B, 0xCC, 0xA3, 0xBA, 0x05, 0x6F, 0xCC, 0xA3, 0xCC, 0x82, 0xCE, 0x05, 0x6F, // Bytes 3a80 - 3abf 0xCC, 0xA8, 0xCC, 0x84, 0xCE, 0x05, 0x72, 0xCC, 0xA3, 0xCC, 0x84, 0xCE, 0x05, 0x73, 0xCC, 0x81, 0xCC, 0x87, 0xCE, 0x05, 0x73, 0xCC, 0x8C, 0xCC, 0x87, 0xCE, 0x05, 0x73, 0xCC, 0xA3, 0xCC, 0x87, 0xCE, 0x05, 0x75, 0xCC, 0x83, 0xCC, 0x81, 0xCE, 0x05, 0x75, 0xCC, 0x84, 0xCC, 0x88, 0xCE, 0x05, 0x75, 0xCC, 0x88, 0xCC, 0x80, 0xCE, 0x05, 0x75, 0xCC, 0x88, 0xCC, 0x81, 0xCE, 0x05, 0x75, 0xCC, // Bytes 3ac0 - 3aff 0x88, 0xCC, 0x84, 0xCE, 0x05, 0x75, 0xCC, 0x88, 0xCC, 0x8C, 0xCE, 0x05, 0x75, 0xCC, 0x9B, 0xCC, 0x80, 0xCE, 0x05, 0x75, 0xCC, 0x9B, 0xCC, 0x81, 0xCE, 0x05, 0x75, 0xCC, 0x9B, 0xCC, 0x83, 0xCE, 0x05, 0x75, 0xCC, 0x9B, 0xCC, 0x89, 0xCE, 0x05, 0x75, 0xCC, 0x9B, 0xCC, 0xA3, 0xBA, 0x05, 0xE1, 0xBE, 0xBF, 0xCC, 0x80, 0xCE, 0x05, 0xE1, 0xBE, 0xBF, 0xCC, 0x81, 0xCE, 0x05, 0xE1, 0xBE, 0xBF, // Bytes 3b00 - 3b3f 0xCD, 0x82, 0xCE, 0x05, 0xE1, 0xBF, 0xBE, 0xCC, 0x80, 0xCE, 0x05, 0xE1, 0xBF, 0xBE, 0xCC, 0x81, 0xCE, 0x05, 0xE1, 0xBF, 0xBE, 0xCD, 0x82, 0xCE, 0x05, 0xE2, 0x86, 0x90, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x86, 0x92, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x86, 0x94, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x87, 0x90, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x87, 0x92, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x87, 0x94, 0xCC, // Bytes 3b40 - 3b7f 0xB8, 0x05, 0x05, 0xE2, 0x88, 0x83, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x88, 0x88, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x88, 0x8B, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x88, 0xA3, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x88, 0xA5, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x88, 0xBC, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x89, 0x83, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x89, 0x85, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x89, 0x88, 0xCC, 0xB8, // Bytes 3b80 - 3bbf 0x05, 0x05, 0xE2, 0x89, 0x8D, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x89, 0xA1, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x89, 0xA4, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x89, 0xA5, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x89, 0xB2, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x89, 0xB3, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x89, 0xB6, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x89, 0xB7, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x89, 0xBA, 0xCC, 0xB8, 0x05, // Bytes 3bc0 - 3bff 0x05, 0xE2, 0x89, 0xBB, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x89, 0xBC, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x89, 0xBD, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x8A, 0x82, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x8A, 0x83, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x8A, 0x86, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x8A, 0x87, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x8A, 0x91, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x8A, 0x92, 0xCC, 0xB8, 0x05, 0x05, // Bytes 3c00 - 3c3f 0xE2, 0x8A, 0xA2, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x8A, 0xA8, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x8A, 0xA9, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x8A, 0xAB, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x8A, 0xB2, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x8A, 0xB3, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x8A, 0xB4, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x8A, 0xB5, 0xCC, 0xB8, 0x05, 0x06, 0xCE, 0x91, 0xCC, 0x93, 0xCD, 0x85, 0xDE, 0x06, // Bytes 3c40 - 3c7f 0xCE, 0x91, 0xCC, 0x94, 0xCD, 0x85, 0xDE, 0x06, 0xCE, 0x95, 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x06, 0xCE, 0x95, 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x06, 0xCE, 0x95, 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x06, 0xCE, 0x95, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x06, 0xCE, 0x97, 0xCC, 0x93, 0xCD, 0x85, 0xDE, 0x06, 0xCE, 0x97, 0xCC, 0x94, 0xCD, 0x85, 0xDE, 0x06, 0xCE, 0x99, 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x06, // Bytes 3c80 - 3cbf 0xCE, 0x99, 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x06, 0xCE, 0x99, 0xCC, 0x93, 0xCD, 0x82, 0xCE, 0x06, 0xCE, 0x99, 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x06, 0xCE, 0x99, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x06, 0xCE, 0x99, 0xCC, 0x94, 0xCD, 0x82, 0xCE, 0x06, 0xCE, 0x9F, 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x06, 0xCE, 0x9F, 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x06, 0xCE, 0x9F, 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x06, // Bytes 3cc0 - 3cff 0xCE, 0x9F, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x06, 0xCE, 0xA5, 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x06, 0xCE, 0xA5, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x06, 0xCE, 0xA5, 0xCC, 0x94, 0xCD, 0x82, 0xCE, 0x06, 0xCE, 0xA9, 0xCC, 0x93, 0xCD, 0x85, 0xDE, 0x06, 0xCE, 0xA9, 0xCC, 0x94, 0xCD, 0x85, 0xDE, 0x06, 0xCE, 0xB1, 0xCC, 0x80, 0xCD, 0x85, 0xDE, 0x06, 0xCE, 0xB1, 0xCC, 0x81, 0xCD, 0x85, 0xDE, 0x06, // Bytes 3d00 - 3d3f 0xCE, 0xB1, 0xCC, 0x93, 0xCD, 0x85, 0xDE, 0x06, 0xCE, 0xB1, 0xCC, 0x94, 0xCD, 0x85, 0xDE, 0x06, 0xCE, 0xB1, 0xCD, 0x82, 0xCD, 0x85, 0xDE, 0x06, 0xCE, 0xB5, 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x06, 0xCE, 0xB5, 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x06, 0xCE, 0xB5, 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x06, 0xCE, 0xB5, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x06, 0xCE, 0xB7, 0xCC, 0x80, 0xCD, 0x85, 0xDE, 0x06, // Bytes 3d40 - 3d7f 0xCE, 0xB7, 0xCC, 0x81, 0xCD, 0x85, 0xDE, 0x06, 0xCE, 0xB7, 0xCC, 0x93, 0xCD, 0x85, 0xDE, 0x06, 0xCE, 0xB7, 0xCC, 0x94, 0xCD, 0x85, 0xDE, 0x06, 0xCE, 0xB7, 0xCD, 0x82, 0xCD, 0x85, 0xDE, 0x06, 0xCE, 0xB9, 0xCC, 0x88, 0xCC, 0x80, 0xCE, 0x06, 0xCE, 0xB9, 0xCC, 0x88, 0xCC, 0x81, 0xCE, 0x06, 0xCE, 0xB9, 0xCC, 0x88, 0xCD, 0x82, 0xCE, 0x06, 0xCE, 0xB9, 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x06, // Bytes 3d80 - 3dbf 0xCE, 0xB9, 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x06, 0xCE, 0xB9, 0xCC, 0x93, 0xCD, 0x82, 0xCE, 0x06, 0xCE, 0xB9, 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x06, 0xCE, 0xB9, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x06, 0xCE, 0xB9, 0xCC, 0x94, 0xCD, 0x82, 0xCE, 0x06, 0xCE, 0xBF, 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x06, 0xCE, 0xBF, 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x06, 0xCE, 0xBF, 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x06, // Bytes 3dc0 - 3dff 0xCE, 0xBF, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x06, 0xCF, 0x85, 0xCC, 0x88, 0xCC, 0x80, 0xCE, 0x06, 0xCF, 0x85, 0xCC, 0x88, 0xCC, 0x81, 0xCE, 0x06, 0xCF, 0x85, 0xCC, 0x88, 0xCD, 0x82, 0xCE, 0x06, 0xCF, 0x85, 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x06, 0xCF, 0x85, 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x06, 0xCF, 0x85, 0xCC, 0x93, 0xCD, 0x82, 0xCE, 0x06, 0xCF, 0x85, 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x06, // Bytes 3e00 - 3e3f 0xCF, 0x85, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x06, 0xCF, 0x85, 0xCC, 0x94, 0xCD, 0x82, 0xCE, 0x06, 0xCF, 0x89, 0xCC, 0x80, 0xCD, 0x85, 0xDE, 0x06, 0xCF, 0x89, 0xCC, 0x81, 0xCD, 0x85, 0xDE, 0x06, 0xCF, 0x89, 0xCC, 0x93, 0xCD, 0x85, 0xDE, 0x06, 0xCF, 0x89, 0xCC, 0x94, 0xCD, 0x85, 0xDE, 0x06, 0xCF, 0x89, 0xCD, 0x82, 0xCD, 0x85, 0xDE, 0x06, 0xE0, 0xA4, 0xA8, 0xE0, 0xA4, 0xBC, 0x0D, 0x06, // Bytes 3e40 - 3e7f 0xE0, 0xA4, 0xB0, 0xE0, 0xA4, 0xBC, 0x0D, 0x06, 0xE0, 0xA4, 0xB3, 0xE0, 0xA4, 0xBC, 0x0D, 0x06, 0xE0, 0xA7, 0x87, 0xE0, 0xA6, 0xBE, 0x01, 0x06, 0xE0, 0xA7, 0x87, 0xE0, 0xA7, 0x97, 0x01, 0x06, 0xE0, 0xAD, 0x87, 0xE0, 0xAC, 0xBE, 0x01, 0x06, 0xE0, 0xAD, 0x87, 0xE0, 0xAD, 0x96, 0x01, 0x06, 0xE0, 0xAD, 0x87, 0xE0, 0xAD, 0x97, 0x01, 0x06, 0xE0, 0xAE, 0x92, 0xE0, 0xAF, 0x97, 0x01, 0x06, // Bytes 3e80 - 3ebf 0xE0, 0xAF, 0x86, 0xE0, 0xAE, 0xBE, 0x01, 0x06, 0xE0, 0xAF, 0x86, 0xE0, 0xAF, 0x97, 0x01, 0x06, 0xE0, 0xAF, 0x87, 0xE0, 0xAE, 0xBE, 0x01, 0x06, 0xE0, 0xB1, 0x86, 0xE0, 0xB1, 0x96, 0x89, 0x06, 0xE0, 0xB2, 0xBF, 0xE0, 0xB3, 0x95, 0x01, 0x06, 0xE0, 0xB3, 0x86, 0xE0, 0xB3, 0x95, 0x01, 0x06, 0xE0, 0xB3, 0x86, 0xE0, 0xB3, 0x96, 0x01, 0x06, 0xE0, 0xB5, 0x86, 0xE0, 0xB4, 0xBE, 0x01, 0x06, // Bytes 3ec0 - 3eff 0xE0, 0xB5, 0x86, 0xE0, 0xB5, 0x97, 0x01, 0x06, 0xE0, 0xB5, 0x87, 0xE0, 0xB4, 0xBE, 0x01, 0x06, 0xE0, 0xB7, 0x99, 0xE0, 0xB7, 0x8A, 0x15, 0x06, 0xE0, 0xB7, 0x99, 0xE0, 0xB7, 0x9F, 0x01, 0x06, 0xE1, 0x80, 0xA5, 0xE1, 0x80, 0xAE, 0x01, 0x06, 0xE1, 0xAC, 0x85, 0xE1, 0xAC, 0xB5, 0x01, 0x06, 0xE1, 0xAC, 0x87, 0xE1, 0xAC, 0xB5, 0x01, 0x06, 0xE1, 0xAC, 0x89, 0xE1, 0xAC, 0xB5, 0x01, 0x06, // Bytes 3f00 - 3f3f 0xE1, 0xAC, 0x8B, 0xE1, 0xAC, 0xB5, 0x01, 0x06, 0xE1, 0xAC, 0x8D, 0xE1, 0xAC, 0xB5, 0x01, 0x06, 0xE1, 0xAC, 0x91, 0xE1, 0xAC, 0xB5, 0x01, 0x06, 0xE1, 0xAC, 0xBA, 0xE1, 0xAC, 0xB5, 0x01, 0x06, 0xE1, 0xAC, 0xBC, 0xE1, 0xAC, 0xB5, 0x01, 0x06, 0xE1, 0xAC, 0xBE, 0xE1, 0xAC, 0xB5, 0x01, 0x06, 0xE1, 0xAC, 0xBF, 0xE1, 0xAC, 0xB5, 0x01, 0x06, 0xE1, 0xAD, 0x82, 0xE1, 0xAC, 0xB5, 0x01, 0x06, // Bytes 3f40 - 3f7f 0xE3, 0x81, 0x86, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x81, 0x8B, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x81, 0x8D, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x81, 0x8F, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x81, 0x91, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x81, 0x93, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x81, 0x95, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x81, 0x97, 0xE3, 0x82, 0x99, 0x11, 0x06, // Bytes 3f80 - 3fbf 0xE3, 0x81, 0x99, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x81, 0x9B, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x81, 0x9D, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x81, 0x9F, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x81, 0xA1, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x81, 0xA4, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x81, 0xA6, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x81, 0xA8, 0xE3, 0x82, 0x99, 0x11, 0x06, // Bytes 3fc0 - 3fff 0xE3, 0x81, 0xAF, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x81, 0xAF, 0xE3, 0x82, 0x9A, 0x11, 0x06, 0xE3, 0x81, 0xB2, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x81, 0xB2, 0xE3, 0x82, 0x9A, 0x11, 0x06, 0xE3, 0x81, 0xB5, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x81, 0xB5, 0xE3, 0x82, 0x9A, 0x11, 0x06, 0xE3, 0x81, 0xB8, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x81, 0xB8, 0xE3, 0x82, 0x9A, 0x11, 0x06, // Bytes 4000 - 403f 0xE3, 0x81, 0xBB, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x81, 0xBB, 0xE3, 0x82, 0x9A, 0x11, 0x06, 0xE3, 0x82, 0x9D, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x82, 0xA6, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x82, 0xAB, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x82, 0xAD, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x82, 0xAF, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x82, 0xB1, 0xE3, 0x82, 0x99, 0x11, 0x06, // Bytes 4040 - 407f 0xE3, 0x82, 0xB3, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x82, 0xB5, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x82, 0xB7, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x82, 0xB9, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x82, 0xBB, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x82, 0xBD, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x82, 0xBF, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x83, 0x81, 0xE3, 0x82, 0x99, 0x11, 0x06, // Bytes 4080 - 40bf 0xE3, 0x83, 0x84, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x83, 0x86, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x83, 0x88, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x83, 0x8F, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x83, 0x8F, 0xE3, 0x82, 0x9A, 0x11, 0x06, 0xE3, 0x83, 0x92, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x83, 0x92, 0xE3, 0x82, 0x9A, 0x11, 0x06, 0xE3, 0x83, 0x95, 0xE3, 0x82, 0x99, 0x11, 0x06, // Bytes 40c0 - 40ff 0xE3, 0x83, 0x95, 0xE3, 0x82, 0x9A, 0x11, 0x06, 0xE3, 0x83, 0x98, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x83, 0x98, 0xE3, 0x82, 0x9A, 0x11, 0x06, 0xE3, 0x83, 0x9B, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x83, 0x9B, 0xE3, 0x82, 0x9A, 0x11, 0x06, 0xE3, 0x83, 0xAF, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x83, 0xB0, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x83, 0xB1, 0xE3, 0x82, 0x99, 0x11, 0x06, // Bytes 4100 - 413f 0xE3, 0x83, 0xB2, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x83, 0xBD, 0xE3, 0x82, 0x99, 0x11, 0x08, 0xCE, 0x91, 0xCC, 0x93, 0xCC, 0x80, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0x91, 0xCC, 0x93, 0xCC, 0x81, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0x91, 0xCC, 0x93, 0xCD, 0x82, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0x91, 0xCC, 0x94, 0xCC, 0x80, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0x91, 0xCC, 0x94, 0xCC, 0x81, 0xCD, 0x85, // Bytes 4140 - 417f 0xDF, 0x08, 0xCE, 0x91, 0xCC, 0x94, 0xCD, 0x82, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0x97, 0xCC, 0x93, 0xCC, 0x80, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0x97, 0xCC, 0x93, 0xCC, 0x81, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0x97, 0xCC, 0x93, 0xCD, 0x82, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0x97, 0xCC, 0x94, 0xCC, 0x80, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0x97, 0xCC, 0x94, 0xCC, 0x81, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0x97, // Bytes 4180 - 41bf 0xCC, 0x94, 0xCD, 0x82, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xA9, 0xCC, 0x93, 0xCC, 0x80, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xA9, 0xCC, 0x93, 0xCC, 0x81, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xA9, 0xCC, 0x93, 0xCD, 0x82, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xA9, 0xCC, 0x94, 0xCC, 0x80, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xA9, 0xCC, 0x94, 0xCC, 0x81, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xA9, 0xCC, 0x94, 0xCD, 0x82, // Bytes 41c0 - 41ff 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xB1, 0xCC, 0x93, 0xCC, 0x80, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xB1, 0xCC, 0x93, 0xCC, 0x81, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xB1, 0xCC, 0x93, 0xCD, 0x82, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xB1, 0xCC, 0x94, 0xCC, 0x80, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xB1, 0xCC, 0x94, 0xCC, 0x81, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xB1, 0xCC, 0x94, 0xCD, 0x82, 0xCD, 0x85, 0xDF, 0x08, // Bytes 4200 - 423f 0xCE, 0xB7, 0xCC, 0x93, 0xCC, 0x80, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xB7, 0xCC, 0x93, 0xCC, 0x81, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xB7, 0xCC, 0x93, 0xCD, 0x82, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xB7, 0xCC, 0x94, 0xCC, 0x80, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xB7, 0xCC, 0x94, 0xCC, 0x81, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xB7, 0xCC, 0x94, 0xCD, 0x82, 0xCD, 0x85, 0xDF, 0x08, 0xCF, 0x89, 0xCC, 0x93, // Bytes 4240 - 427f 0xCC, 0x80, 0xCD, 0x85, 0xDF, 0x08, 0xCF, 0x89, 0xCC, 0x93, 0xCC, 0x81, 0xCD, 0x85, 0xDF, 0x08, 0xCF, 0x89, 0xCC, 0x93, 0xCD, 0x82, 0xCD, 0x85, 0xDF, 0x08, 0xCF, 0x89, 0xCC, 0x94, 0xCC, 0x80, 0xCD, 0x85, 0xDF, 0x08, 0xCF, 0x89, 0xCC, 0x94, 0xCC, 0x81, 0xCD, 0x85, 0xDF, 0x08, 0xCF, 0x89, 0xCC, 0x94, 0xCD, 0x82, 0xCD, 0x85, 0xDF, 0x08, 0xF0, 0x91, 0x82, 0x99, 0xF0, 0x91, 0x82, 0xBA, // Bytes 4280 - 42bf 0x0D, 0x08, 0xF0, 0x91, 0x82, 0x9B, 0xF0, 0x91, 0x82, 0xBA, 0x0D, 0x08, 0xF0, 0x91, 0x82, 0xA5, 0xF0, 0x91, 0x82, 0xBA, 0x0D, 0x08, 0xF0, 0x91, 0x84, 0xB1, 0xF0, 0x91, 0x84, 0xA7, 0x01, 0x08, 0xF0, 0x91, 0x84, 0xB2, 0xF0, 0x91, 0x84, 0xA7, 0x01, 0x08, 0xF0, 0x91, 0x8D, 0x87, 0xF0, 0x91, 0x8C, 0xBE, 0x01, 0x08, 0xF0, 0x91, 0x8D, 0x87, 0xF0, 0x91, 0x8D, 0x97, 0x01, 0x08, 0xF0, 0x91, // Bytes 42c0 - 42ff 0x92, 0xB9, 0xF0, 0x91, 0x92, 0xB0, 0x01, 0x08, 0xF0, 0x91, 0x92, 0xB9, 0xF0, 0x91, 0x92, 0xBA, 0x01, 0x08, 0xF0, 0x91, 0x92, 0xB9, 0xF0, 0x91, 0x92, 0xBD, 0x01, 0x08, 0xF0, 0x91, 0x96, 0xB8, 0xF0, 0x91, 0x96, 0xAF, 0x01, 0x08, 0xF0, 0x91, 0x96, 0xB9, 0xF0, 0x91, 0x96, 0xAF, 0x01, 0x08, 0xF0, 0x91, 0xA4, 0xB5, 0xF0, 0x91, 0xA4, 0xB0, 0x01, 0x09, 0xE0, 0xB3, 0x86, 0xE0, 0xB3, 0x82, // Bytes 4300 - 433f 0xE0, 0xB3, 0x95, 0x02, 0x09, 0xE0, 0xB7, 0x99, 0xE0, 0xB7, 0x8F, 0xE0, 0xB7, 0x8A, 0x16, 0x42, 0xC2, 0xB4, 0x01, 0x43, 0x20, 0xCC, 0x81, 0xCD, 0x43, 0x20, 0xCC, 0x83, 0xCD, 0x43, 0x20, 0xCC, 0x84, 0xCD, 0x43, 0x20, 0xCC, 0x85, 0xCD, 0x43, 0x20, 0xCC, 0x86, 0xCD, 0x43, 0x20, 0xCC, 0x87, 0xCD, 0x43, 0x20, 0xCC, 0x88, 0xCD, 0x43, 0x20, 0xCC, 0x8A, 0xCD, 0x43, 0x20, 0xCC, 0x8B, 0xCD, // Bytes 4340 - 437f 0x43, 0x20, 0xCC, 0x93, 0xCD, 0x43, 0x20, 0xCC, 0x94, 0xCD, 0x43, 0x20, 0xCC, 0xA7, 0xA9, 0x43, 0x20, 0xCC, 0xA8, 0xA9, 0x43, 0x20, 0xCC, 0xB3, 0xB9, 0x43, 0x20, 0xCD, 0x82, 0xCD, 0x43, 0x20, 0xCD, 0x85, 0xDD, 0x43, 0x20, 0xD9, 0x8B, 0x5D, 0x43, 0x20, 0xD9, 0x8C, 0x61, 0x43, 0x20, 0xD9, 0x8D, 0x65, 0x43, 0x20, 0xD9, 0x8E, 0x69, 0x43, 0x20, 0xD9, 0x8F, 0x6D, 0x43, 0x20, 0xD9, 0x90, // Bytes 4380 - 43bf 0x71, 0x43, 0x20, 0xD9, 0x91, 0x75, 0x43, 0x20, 0xD9, 0x92, 0x79, 0x43, 0x41, 0xCC, 0x8A, 0xCD, 0x43, 0x73, 0xCC, 0x87, 0xCD, 0x44, 0x20, 0xE3, 0x82, 0x99, 0x11, 0x44, 0x20, 0xE3, 0x82, 0x9A, 0x11, 0x44, 0xC2, 0xA8, 0xCC, 0x81, 0xCE, 0x44, 0xCE, 0x91, 0xCC, 0x81, 0xCD, 0x44, 0xCE, 0x95, 0xCC, 0x81, 0xCD, 0x44, 0xCE, 0x97, 0xCC, 0x81, 0xCD, 0x44, 0xCE, 0x99, 0xCC, 0x81, 0xCD, 0x44, // Bytes 43c0 - 43ff 0xCE, 0x9F, 0xCC, 0x81, 0xCD, 0x44, 0xCE, 0xA5, 0xCC, 0x81, 0xCD, 0x44, 0xCE, 0xA5, 0xCC, 0x88, 0xCD, 0x44, 0xCE, 0xA9, 0xCC, 0x81, 0xCD, 0x44, 0xCE, 0xB1, 0xCC, 0x81, 0xCD, 0x44, 0xCE, 0xB5, 0xCC, 0x81, 0xCD, 0x44, 0xCE, 0xB7, 0xCC, 0x81, 0xCD, 0x44, 0xCE, 0xB9, 0xCC, 0x81, 0xCD, 0x44, 0xCE, 0xBF, 0xCC, 0x81, 0xCD, 0x44, 0xCF, 0x85, 0xCC, 0x81, 0xCD, 0x44, 0xCF, 0x89, 0xCC, 0x81, // Bytes 4400 - 443f 0xCD, 0x44, 0xD7, 0x90, 0xD6, 0xB7, 0x35, 0x44, 0xD7, 0x90, 0xD6, 0xB8, 0x39, 0x44, 0xD7, 0x90, 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0x91, 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0x91, 0xD6, 0xBF, 0x4D, 0x44, 0xD7, 0x92, 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0x93, 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0x94, 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0x95, 0xD6, 0xB9, 0x3D, 0x44, 0xD7, 0x95, 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0x96, // Bytes 4440 - 447f 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0x98, 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0x99, 0xD6, 0xB4, 0x29, 0x44, 0xD7, 0x99, 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0x9A, 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0x9B, 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0x9B, 0xD6, 0xBF, 0x4D, 0x44, 0xD7, 0x9C, 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0x9E, 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0xA0, 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0xA1, 0xD6, 0xBC, 0x45, 0x44, // Bytes 4480 - 44bf 0xD7, 0xA3, 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0xA4, 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0xA4, 0xD6, 0xBF, 0x4D, 0x44, 0xD7, 0xA6, 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0xA7, 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0xA8, 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0xA9, 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0xA9, 0xD7, 0x81, 0x51, 0x44, 0xD7, 0xA9, 0xD7, 0x82, 0x55, 0x44, 0xD7, 0xAA, 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0xB2, 0xD6, 0xB7, // Bytes 44c0 - 44ff 0x35, 0x44, 0xD8, 0xA7, 0xD9, 0x8B, 0x5D, 0x44, 0xD8, 0xA7, 0xD9, 0x93, 0xCD, 0x44, 0xD8, 0xA7, 0xD9, 0x94, 0xCD, 0x44, 0xD8, 0xA7, 0xD9, 0x95, 0xB9, 0x44, 0xD8, 0xB0, 0xD9, 0xB0, 0x7D, 0x44, 0xD8, 0xB1, 0xD9, 0xB0, 0x7D, 0x44, 0xD9, 0x80, 0xD9, 0x8B, 0x5D, 0x44, 0xD9, 0x80, 0xD9, 0x8E, 0x69, 0x44, 0xD9, 0x80, 0xD9, 0x8F, 0x6D, 0x44, 0xD9, 0x80, 0xD9, 0x90, 0x71, 0x44, 0xD9, 0x80, // Bytes 4500 - 453f 0xD9, 0x91, 0x75, 0x44, 0xD9, 0x80, 0xD9, 0x92, 0x79, 0x44, 0xD9, 0x87, 0xD9, 0xB0, 0x7D, 0x44, 0xD9, 0x88, 0xD9, 0x94, 0xCD, 0x44, 0xD9, 0x89, 0xD9, 0xB0, 0x7D, 0x44, 0xD9, 0x8A, 0xD9, 0x94, 0xCD, 0x44, 0xDB, 0x92, 0xD9, 0x94, 0xCD, 0x44, 0xDB, 0x95, 0xD9, 0x94, 0xCD, 0x45, 0x20, 0xCC, 0x88, 0xCC, 0x80, 0xCE, 0x45, 0x20, 0xCC, 0x88, 0xCC, 0x81, 0xCE, 0x45, 0x20, 0xCC, 0x88, 0xCD, // Bytes 4540 - 457f 0x82, 0xCE, 0x45, 0x20, 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x45, 0x20, 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x45, 0x20, 0xCC, 0x93, 0xCD, 0x82, 0xCE, 0x45, 0x20, 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x45, 0x20, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x45, 0x20, 0xCC, 0x94, 0xCD, 0x82, 0xCE, 0x45, 0x20, 0xD9, 0x8C, 0xD9, 0x91, 0x76, 0x45, 0x20, 0xD9, 0x8D, 0xD9, 0x91, 0x76, 0x45, 0x20, 0xD9, 0x8E, 0xD9, 0x91, // Bytes 4580 - 45bf 0x76, 0x45, 0x20, 0xD9, 0x8F, 0xD9, 0x91, 0x76, 0x45, 0x20, 0xD9, 0x90, 0xD9, 0x91, 0x76, 0x45, 0x20, 0xD9, 0x91, 0xD9, 0xB0, 0x7E, 0x45, 0xE2, 0xAB, 0x9D, 0xCC, 0xB8, 0x05, 0x46, 0xCE, 0xB9, 0xCC, 0x88, 0xCC, 0x81, 0xCE, 0x46, 0xCF, 0x85, 0xCC, 0x88, 0xCC, 0x81, 0xCE, 0x46, 0xD7, 0xA9, 0xD6, 0xBC, 0xD7, 0x81, 0x52, 0x46, 0xD7, 0xA9, 0xD6, 0xBC, 0xD7, 0x82, 0x56, 0x46, 0xD9, 0x80, // Bytes 45c0 - 45ff 0xD9, 0x8E, 0xD9, 0x91, 0x76, 0x46, 0xD9, 0x80, 0xD9, 0x8F, 0xD9, 0x91, 0x76, 0x46, 0xD9, 0x80, 0xD9, 0x90, 0xD9, 0x91, 0x76, 0x46, 0xE0, 0xA4, 0x95, 0xE0, 0xA4, 0xBC, 0x0D, 0x46, 0xE0, 0xA4, 0x96, 0xE0, 0xA4, 0xBC, 0x0D, 0x46, 0xE0, 0xA4, 0x97, 0xE0, 0xA4, 0xBC, 0x0D, 0x46, 0xE0, 0xA4, 0x9C, 0xE0, 0xA4, 0xBC, 0x0D, 0x46, 0xE0, 0xA4, 0xA1, 0xE0, 0xA4, 0xBC, 0x0D, 0x46, 0xE0, 0xA4, // Bytes 4600 - 463f 0xA2, 0xE0, 0xA4, 0xBC, 0x0D, 0x46, 0xE0, 0xA4, 0xAB, 0xE0, 0xA4, 0xBC, 0x0D, 0x46, 0xE0, 0xA4, 0xAF, 0xE0, 0xA4, 0xBC, 0x0D, 0x46, 0xE0, 0xA6, 0xA1, 0xE0, 0xA6, 0xBC, 0x0D, 0x46, 0xE0, 0xA6, 0xA2, 0xE0, 0xA6, 0xBC, 0x0D, 0x46, 0xE0, 0xA6, 0xAF, 0xE0, 0xA6, 0xBC, 0x0D, 0x46, 0xE0, 0xA8, 0x96, 0xE0, 0xA8, 0xBC, 0x0D, 0x46, 0xE0, 0xA8, 0x97, 0xE0, 0xA8, 0xBC, 0x0D, 0x46, 0xE0, 0xA8, // Bytes 4640 - 467f 0x9C, 0xE0, 0xA8, 0xBC, 0x0D, 0x46, 0xE0, 0xA8, 0xAB, 0xE0, 0xA8, 0xBC, 0x0D, 0x46, 0xE0, 0xA8, 0xB2, 0xE0, 0xA8, 0xBC, 0x0D, 0x46, 0xE0, 0xA8, 0xB8, 0xE0, 0xA8, 0xBC, 0x0D, 0x46, 0xE0, 0xAC, 0xA1, 0xE0, 0xAC, 0xBC, 0x0D, 0x46, 0xE0, 0xAC, 0xA2, 0xE0, 0xAC, 0xBC, 0x0D, 0x46, 0xE0, 0xBE, 0xB2, 0xE0, 0xBE, 0x80, 0xA1, 0x46, 0xE0, 0xBE, 0xB3, 0xE0, 0xBE, 0x80, 0xA1, 0x46, 0xE1, 0x84, // Bytes 4680 - 46bf 0x80, 0xE1, 0x85, 0xA1, 0x01, 0x46, 0xE1, 0x84, 0x82, 0xE1, 0x85, 0xA1, 0x01, 0x46, 0xE1, 0x84, 0x83, 0xE1, 0x85, 0xA1, 0x01, 0x46, 0xE1, 0x84, 0x85, 0xE1, 0x85, 0xA1, 0x01, 0x46, 0xE1, 0x84, 0x86, 0xE1, 0x85, 0xA1, 0x01, 0x46, 0xE1, 0x84, 0x87, 0xE1, 0x85, 0xA1, 0x01, 0x46, 0xE1, 0x84, 0x89, 0xE1, 0x85, 0xA1, 0x01, 0x46, 0xE1, 0x84, 0x8B, 0xE1, 0x85, 0xA1, 0x01, 0x46, 0xE1, 0x84, // Bytes 46c0 - 46ff 0x8B, 0xE1, 0x85, 0xAE, 0x01, 0x46, 0xE1, 0x84, 0x8C, 0xE1, 0x85, 0xA1, 0x01, 0x46, 0xE1, 0x84, 0x8E, 0xE1, 0x85, 0xA1, 0x01, 0x46, 0xE1, 0x84, 0x8F, 0xE1, 0x85, 0xA1, 0x01, 0x46, 0xE1, 0x84, 0x90, 0xE1, 0x85, 0xA1, 0x01, 0x46, 0xE1, 0x84, 0x91, 0xE1, 0x85, 0xA1, 0x01, 0x46, 0xE1, 0x84, 0x92, 0xE1, 0x85, 0xA1, 0x01, 0x46, 0xE3, 0x83, 0x86, 0xE3, 0x82, 0x99, 0x11, 0x48, 0xF0, 0x9D, // Bytes 4700 - 473f 0x85, 0x97, 0xF0, 0x9D, 0x85, 0xA5, 0xB1, 0x48, 0xF0, 0x9D, 0x85, 0x98, 0xF0, 0x9D, 0x85, 0xA5, 0xB1, 0x48, 0xF0, 0x9D, 0x86, 0xB9, 0xF0, 0x9D, 0x85, 0xA5, 0xB1, 0x48, 0xF0, 0x9D, 0x86, 0xBA, 0xF0, 0x9D, 0x85, 0xA5, 0xB1, 0x49, 0xE0, 0xBE, 0xB2, 0xE0, 0xBD, 0xB1, 0xE0, 0xBE, 0x80, 0xA2, 0x49, 0xE0, 0xBE, 0xB3, 0xE0, 0xBD, 0xB1, 0xE0, 0xBE, 0x80, 0xA2, 0x4C, 0xF0, 0x9D, 0x85, 0x98, // Bytes 4740 - 477f 0xF0, 0x9D, 0x85, 0xA5, 0xF0, 0x9D, 0x85, 0xAE, 0xB2, 0x4C, 0xF0, 0x9D, 0x85, 0x98, 0xF0, 0x9D, 0x85, 0xA5, 0xF0, 0x9D, 0x85, 0xAF, 0xB2, 0x4C, 0xF0, 0x9D, 0x85, 0x98, 0xF0, 0x9D, 0x85, 0xA5, 0xF0, 0x9D, 0x85, 0xB0, 0xB2, 0x4C, 0xF0, 0x9D, 0x85, 0x98, 0xF0, 0x9D, 0x85, 0xA5, 0xF0, 0x9D, 0x85, 0xB1, 0xB2, 0x4C, 0xF0, 0x9D, 0x85, 0x98, 0xF0, 0x9D, 0x85, 0xA5, 0xF0, 0x9D, 0x85, 0xB2, // Bytes 4780 - 47bf 0xB2, 0x4C, 0xF0, 0x9D, 0x86, 0xB9, 0xF0, 0x9D, 0x85, 0xA5, 0xF0, 0x9D, 0x85, 0xAE, 0xB2, 0x4C, 0xF0, 0x9D, 0x86, 0xB9, 0xF0, 0x9D, 0x85, 0xA5, 0xF0, 0x9D, 0x85, 0xAF, 0xB2, 0x4C, 0xF0, 0x9D, 0x86, 0xBA, 0xF0, 0x9D, 0x85, 0xA5, 0xF0, 0x9D, 0x85, 0xAE, 0xB2, 0x4C, 0xF0, 0x9D, 0x86, 0xBA, 0xF0, 0x9D, 0x85, 0xA5, 0xF0, 0x9D, 0x85, 0xAF, 0xB2, 0x83, 0x41, 0xCC, 0x82, 0xCD, 0x83, 0x41, // Bytes 47c0 - 47ff 0xCC, 0x86, 0xCD, 0x83, 0x41, 0xCC, 0x87, 0xCD, 0x83, 0x41, 0xCC, 0x88, 0xCD, 0x83, 0x41, 0xCC, 0x8A, 0xCD, 0x83, 0x41, 0xCC, 0xA3, 0xB9, 0x83, 0x43, 0xCC, 0xA7, 0xA9, 0x83, 0x45, 0xCC, 0x82, 0xCD, 0x83, 0x45, 0xCC, 0x84, 0xCD, 0x83, 0x45, 0xCC, 0xA3, 0xB9, 0x83, 0x45, 0xCC, 0xA7, 0xA9, 0x83, 0x49, 0xCC, 0x88, 0xCD, 0x83, 0x4C, 0xCC, 0xA3, 0xB9, 0x83, 0x4F, 0xCC, 0x82, 0xCD, 0x83, // Bytes 4800 - 483f 0x4F, 0xCC, 0x83, 0xCD, 0x83, 0x4F, 0xCC, 0x84, 0xCD, 0x83, 0x4F, 0xCC, 0x87, 0xCD, 0x83, 0x4F, 0xCC, 0x88, 0xCD, 0x83, 0x4F, 0xCC, 0x9B, 0xB1, 0x83, 0x4F, 0xCC, 0xA3, 0xB9, 0x83, 0x4F, 0xCC, 0xA8, 0xA9, 0x83, 0x52, 0xCC, 0xA3, 0xB9, 0x83, 0x53, 0xCC, 0x81, 0xCD, 0x83, 0x53, 0xCC, 0x8C, 0xCD, 0x83, 0x53, 0xCC, 0xA3, 0xB9, 0x83, 0x55, 0xCC, 0x83, 0xCD, 0x83, 0x55, 0xCC, 0x84, 0xCD, // Bytes 4840 - 487f 0x83, 0x55, 0xCC, 0x88, 0xCD, 0x83, 0x55, 0xCC, 0x9B, 0xB1, 0x83, 0x61, 0xCC, 0x82, 0xCD, 0x83, 0x61, 0xCC, 0x86, 0xCD, 0x83, 0x61, 0xCC, 0x87, 0xCD, 0x83, 0x61, 0xCC, 0x88, 0xCD, 0x83, 0x61, 0xCC, 0x8A, 0xCD, 0x83, 0x61, 0xCC, 0xA3, 0xB9, 0x83, 0x63, 0xCC, 0xA7, 0xA9, 0x83, 0x65, 0xCC, 0x82, 0xCD, 0x83, 0x65, 0xCC, 0x84, 0xCD, 0x83, 0x65, 0xCC, 0xA3, 0xB9, 0x83, 0x65, 0xCC, 0xA7, // Bytes 4880 - 48bf 0xA9, 0x83, 0x69, 0xCC, 0x88, 0xCD, 0x83, 0x6C, 0xCC, 0xA3, 0xB9, 0x83, 0x6F, 0xCC, 0x82, 0xCD, 0x83, 0x6F, 0xCC, 0x83, 0xCD, 0x83, 0x6F, 0xCC, 0x84, 0xCD, 0x83, 0x6F, 0xCC, 0x87, 0xCD, 0x83, 0x6F, 0xCC, 0x88, 0xCD, 0x83, 0x6F, 0xCC, 0x9B, 0xB1, 0x83, 0x6F, 0xCC, 0xA3, 0xB9, 0x83, 0x6F, 0xCC, 0xA8, 0xA9, 0x83, 0x72, 0xCC, 0xA3, 0xB9, 0x83, 0x73, 0xCC, 0x81, 0xCD, 0x83, 0x73, 0xCC, // Bytes 48c0 - 48ff 0x8C, 0xCD, 0x83, 0x73, 0xCC, 0xA3, 0xB9, 0x83, 0x75, 0xCC, 0x83, 0xCD, 0x83, 0x75, 0xCC, 0x84, 0xCD, 0x83, 0x75, 0xCC, 0x88, 0xCD, 0x83, 0x75, 0xCC, 0x9B, 0xB1, 0x84, 0xCE, 0x91, 0xCC, 0x93, 0xCD, 0x84, 0xCE, 0x91, 0xCC, 0x94, 0xCD, 0x84, 0xCE, 0x95, 0xCC, 0x93, 0xCD, 0x84, 0xCE, 0x95, 0xCC, 0x94, 0xCD, 0x84, 0xCE, 0x97, 0xCC, 0x93, 0xCD, 0x84, 0xCE, 0x97, 0xCC, 0x94, 0xCD, 0x84, // Bytes 4900 - 493f 0xCE, 0x99, 0xCC, 0x93, 0xCD, 0x84, 0xCE, 0x99, 0xCC, 0x94, 0xCD, 0x84, 0xCE, 0x9F, 0xCC, 0x93, 0xCD, 0x84, 0xCE, 0x9F, 0xCC, 0x94, 0xCD, 0x84, 0xCE, 0xA5, 0xCC, 0x94, 0xCD, 0x84, 0xCE, 0xA9, 0xCC, 0x93, 0xCD, 0x84, 0xCE, 0xA9, 0xCC, 0x94, 0xCD, 0x84, 0xCE, 0xB1, 0xCC, 0x80, 0xCD, 0x84, 0xCE, 0xB1, 0xCC, 0x81, 0xCD, 0x84, 0xCE, 0xB1, 0xCC, 0x93, 0xCD, 0x84, 0xCE, 0xB1, 0xCC, 0x94, // Bytes 4940 - 497f 0xCD, 0x84, 0xCE, 0xB1, 0xCD, 0x82, 0xCD, 0x84, 0xCE, 0xB5, 0xCC, 0x93, 0xCD, 0x84, 0xCE, 0xB5, 0xCC, 0x94, 0xCD, 0x84, 0xCE, 0xB7, 0xCC, 0x80, 0xCD, 0x84, 0xCE, 0xB7, 0xCC, 0x81, 0xCD, 0x84, 0xCE, 0xB7, 0xCC, 0x93, 0xCD, 0x84, 0xCE, 0xB7, 0xCC, 0x94, 0xCD, 0x84, 0xCE, 0xB7, 0xCD, 0x82, 0xCD, 0x84, 0xCE, 0xB9, 0xCC, 0x88, 0xCD, 0x84, 0xCE, 0xB9, 0xCC, 0x93, 0xCD, 0x84, 0xCE, 0xB9, // Bytes 4980 - 49bf 0xCC, 0x94, 0xCD, 0x84, 0xCE, 0xBF, 0xCC, 0x93, 0xCD, 0x84, 0xCE, 0xBF, 0xCC, 0x94, 0xCD, 0x84, 0xCF, 0x85, 0xCC, 0x88, 0xCD, 0x84, 0xCF, 0x85, 0xCC, 0x93, 0xCD, 0x84, 0xCF, 0x85, 0xCC, 0x94, 0xCD, 0x84, 0xCF, 0x89, 0xCC, 0x80, 0xCD, 0x84, 0xCF, 0x89, 0xCC, 0x81, 0xCD, 0x84, 0xCF, 0x89, 0xCC, 0x93, 0xCD, 0x84, 0xCF, 0x89, 0xCC, 0x94, 0xCD, 0x84, 0xCF, 0x89, 0xCD, 0x82, 0xCD, 0x86, // Bytes 49c0 - 49ff 0xCE, 0x91, 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x86, 0xCE, 0x91, 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x86, 0xCE, 0x91, 0xCC, 0x93, 0xCD, 0x82, 0xCE, 0x86, 0xCE, 0x91, 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x86, 0xCE, 0x91, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x86, 0xCE, 0x91, 0xCC, 0x94, 0xCD, 0x82, 0xCE, 0x86, 0xCE, 0x97, 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x86, 0xCE, 0x97, 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x86, // Bytes 4a00 - 4a3f 0xCE, 0x97, 0xCC, 0x93, 0xCD, 0x82, 0xCE, 0x86, 0xCE, 0x97, 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x86, 0xCE, 0x97, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x86, 0xCE, 0x97, 0xCC, 0x94, 0xCD, 0x82, 0xCE, 0x86, 0xCE, 0xA9, 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x86, 0xCE, 0xA9, 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x86, 0xCE, 0xA9, 0xCC, 0x93, 0xCD, 0x82, 0xCE, 0x86, 0xCE, 0xA9, 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x86, // Bytes 4a40 - 4a7f 0xCE, 0xA9, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x86, 0xCE, 0xA9, 0xCC, 0x94, 0xCD, 0x82, 0xCE, 0x86, 0xCE, 0xB1, 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x86, 0xCE, 0xB1, 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x86, 0xCE, 0xB1, 0xCC, 0x93, 0xCD, 0x82, 0xCE, 0x86, 0xCE, 0xB1, 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x86, 0xCE, 0xB1, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x86, 0xCE, 0xB1, 0xCC, 0x94, 0xCD, 0x82, 0xCE, 0x86, // Bytes 4a80 - 4abf 0xCE, 0xB7, 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x86, 0xCE, 0xB7, 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x86, 0xCE, 0xB7, 0xCC, 0x93, 0xCD, 0x82, 0xCE, 0x86, 0xCE, 0xB7, 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x86, 0xCE, 0xB7, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x86, 0xCE, 0xB7, 0xCC, 0x94, 0xCD, 0x82, 0xCE, 0x86, 0xCF, 0x89, 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x86, 0xCF, 0x89, 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x86, // Bytes 4ac0 - 4aff 0xCF, 0x89, 0xCC, 0x93, 0xCD, 0x82, 0xCE, 0x86, 0xCF, 0x89, 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x86, 0xCF, 0x89, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x86, 0xCF, 0x89, 0xCC, 0x94, 0xCD, 0x82, 0xCE, 0x86, 0xE0, 0xB3, 0x86, 0xE0, 0xB3, 0x82, 0x01, 0x86, 0xE0, 0xB7, 0x99, 0xE0, 0xB7, 0x8F, 0x01, 0x42, 0xCC, 0x80, 0xCD, 0x33, 0x42, 0xCC, 0x81, 0xCD, 0x33, 0x42, 0xCC, 0x93, 0xCD, 0x33, 0x43, 0xE1, // Bytes 4b00 - 4b3f 0x85, 0xA1, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xA2, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xA3, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xA4, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xA5, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xA6, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xA7, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xA8, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xA9, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xAA, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xAB, 0x01, 0x00, // Bytes 4b40 - 4b7f 0x43, 0xE1, 0x85, 0xAC, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xAD, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xAE, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xAF, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xB0, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xB1, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xB2, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xB3, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xB4, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xB5, 0x01, 0x00, 0x43, 0xE1, 0x86, 0xAA, // Bytes 4b80 - 4bbf 0x01, 0x00, 0x43, 0xE1, 0x86, 0xAC, 0x01, 0x00, 0x43, 0xE1, 0x86, 0xAD, 0x01, 0x00, 0x43, 0xE1, 0x86, 0xB0, 0x01, 0x00, 0x43, 0xE1, 0x86, 0xB1, 0x01, 0x00, 0x43, 0xE1, 0x86, 0xB2, 0x01, 0x00, 0x43, 0xE1, 0x86, 0xB3, 0x01, 0x00, 0x43, 0xE1, 0x86, 0xB4, 0x01, 0x00, 0x43, 0xE1, 0x86, 0xB5, 0x01, 0x00, 0x44, 0xCC, 0x88, 0xCC, 0x81, 0xCE, 0x33, 0x43, 0xE3, 0x82, 0x99, 0x11, 0x04, 0x43, // Bytes 4bc0 - 4bff 0xE3, 0x82, 0x9A, 0x11, 0x04, 0x46, 0xE0, 0xBD, 0xB1, 0xE0, 0xBD, 0xB2, 0xA2, 0x27, 0x46, 0xE0, 0xBD, 0xB1, 0xE0, 0xBD, 0xB4, 0xA6, 0x27, 0x46, 0xE0, 0xBD, 0xB1, 0xE0, 0xBE, 0x80, 0xA2, 0x27, 0x00, 0x01, } // lookup returns the trie value for the first UTF-8 encoding in s and // the width in bytes of this encoding. The size will be 0 if s does not // hold enough bytes to complete the encoding. len(s) must be greater than 0. func (t *nfcTrie) lookup(s []byte) (v uint16, sz int) { c0 := s[0] switch { case c0 < 0x80: // is ASCII return nfcValues[c0], 1 case c0 < 0xC2: return 0, 1 // Illegal UTF-8: not a starter, not ASCII. case c0 < 0xE0: // 2-byte UTF-8 if len(s) < 2 { return 0, 0 } i := nfcIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c1), 2 case c0 < 0xF0: // 3-byte UTF-8 if len(s) < 3 { return 0, 0 } i := nfcIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = nfcIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c2), 3 case c0 < 0xF8: // 4-byte UTF-8 if len(s) < 4 { return 0, 0 } i := nfcIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = nfcIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } o = uint32(i)<<6 + uint32(c2) i = nfcIndex[o] c3 := s[3] if c3 < 0x80 || 0xC0 <= c3 { return 0, 3 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c3), 4 } // Illegal rune return 0, 1 } // lookupUnsafe returns the trie value for the first UTF-8 encoding in s. // s must start with a full and valid UTF-8 encoded rune. func (t *nfcTrie) lookupUnsafe(s []byte) uint16 { c0 := s[0] if c0 < 0x80 { // is ASCII return nfcValues[c0] } i := nfcIndex[c0] if c0 < 0xE0 { // 2-byte UTF-8 return t.lookupValue(uint32(i), s[1]) } i = nfcIndex[uint32(i)<<6+uint32(s[1])] if c0 < 0xF0 { // 3-byte UTF-8 return t.lookupValue(uint32(i), s[2]) } i = nfcIndex[uint32(i)<<6+uint32(s[2])] if c0 < 0xF8 { // 4-byte UTF-8 return t.lookupValue(uint32(i), s[3]) } return 0 } // lookupString returns the trie value for the first UTF-8 encoding in s and // the width in bytes of this encoding. The size will be 0 if s does not // hold enough bytes to complete the encoding. len(s) must be greater than 0. func (t *nfcTrie) lookupString(s string) (v uint16, sz int) { c0 := s[0] switch { case c0 < 0x80: // is ASCII return nfcValues[c0], 1 case c0 < 0xC2: return 0, 1 // Illegal UTF-8: not a starter, not ASCII. case c0 < 0xE0: // 2-byte UTF-8 if len(s) < 2 { return 0, 0 } i := nfcIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c1), 2 case c0 < 0xF0: // 3-byte UTF-8 if len(s) < 3 { return 0, 0 } i := nfcIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = nfcIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c2), 3 case c0 < 0xF8: // 4-byte UTF-8 if len(s) < 4 { return 0, 0 } i := nfcIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = nfcIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } o = uint32(i)<<6 + uint32(c2) i = nfcIndex[o] c3 := s[3] if c3 < 0x80 || 0xC0 <= c3 { return 0, 3 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c3), 4 } // Illegal rune return 0, 1 } // lookupStringUnsafe returns the trie value for the first UTF-8 encoding in s. // s must start with a full and valid UTF-8 encoded rune. func (t *nfcTrie) lookupStringUnsafe(s string) uint16 { c0 := s[0] if c0 < 0x80 { // is ASCII return nfcValues[c0] } i := nfcIndex[c0] if c0 < 0xE0 { // 2-byte UTF-8 return t.lookupValue(uint32(i), s[1]) } i = nfcIndex[uint32(i)<<6+uint32(s[1])] if c0 < 0xF0 { // 3-byte UTF-8 return t.lookupValue(uint32(i), s[2]) } i = nfcIndex[uint32(i)<<6+uint32(s[2])] if c0 < 0xF8 { // 4-byte UTF-8 return t.lookupValue(uint32(i), s[3]) } return 0 } // nfcTrie. Total size: 10798 bytes (10.54 KiB). Checksum: 721e0f15a4524bda. type nfcTrie struct{} func newNfcTrie(i int) *nfcTrie { return &nfcTrie{} } // lookupValue determines the type of block n and looks up the value for b. func (t *nfcTrie) lookupValue(n uint32, b byte) uint16 { switch { case n < 46: return uint16(nfcValues[n<<6+uint32(b)]) default: n -= 46 return uint16(nfcSparse.lookup(n, b)) } } // nfcValues: 48 blocks, 3072 entries, 6144 bytes // The third block is the zero block. var nfcValues = [3072]uint16{ // Block 0x0, offset 0x0 0x3c: 0xa000, 0x3d: 0xa000, 0x3e: 0xa000, // Block 0x1, offset 0x40 0x41: 0xa000, 0x42: 0xa000, 0x43: 0xa000, 0x44: 0xa000, 0x45: 0xa000, 0x46: 0xa000, 0x47: 0xa000, 0x48: 0xa000, 0x49: 0xa000, 0x4a: 0xa000, 0x4b: 0xa000, 0x4c: 0xa000, 0x4d: 0xa000, 0x4e: 0xa000, 0x4f: 0xa000, 0x50: 0xa000, 0x52: 0xa000, 0x53: 0xa000, 0x54: 0xa000, 0x55: 0xa000, 0x56: 0xa000, 0x57: 0xa000, 0x58: 0xa000, 0x59: 0xa000, 0x5a: 0xa000, 0x61: 0xa000, 0x62: 0xa000, 0x63: 0xa000, 0x64: 0xa000, 0x65: 0xa000, 0x66: 0xa000, 0x67: 0xa000, 0x68: 0xa000, 0x69: 0xa000, 0x6a: 0xa000, 0x6b: 0xa000, 0x6c: 0xa000, 0x6d: 0xa000, 0x6e: 0xa000, 0x6f: 0xa000, 0x70: 0xa000, 0x72: 0xa000, 0x73: 0xa000, 0x74: 0xa000, 0x75: 0xa000, 0x76: 0xa000, 0x77: 0xa000, 0x78: 0xa000, 0x79: 0xa000, 0x7a: 0xa000, // Block 0x2, offset 0x80 // Block 0x3, offset 0xc0 0xc0: 0x2ece, 0xc1: 0x2ed3, 0xc2: 0x47b9, 0xc3: 0x2ed8, 0xc4: 0x47c8, 0xc5: 0x47cd, 0xc6: 0xa000, 0xc7: 0x47d7, 0xc8: 0x2f41, 0xc9: 0x2f46, 0xca: 0x47dc, 0xcb: 0x2f5a, 0xcc: 0x2fcd, 0xcd: 0x2fd2, 0xce: 0x2fd7, 0xcf: 0x47f0, 0xd1: 0x3063, 0xd2: 0x3086, 0xd3: 0x308b, 0xd4: 0x47fa, 0xd5: 0x47ff, 0xd6: 0x480e, 0xd8: 0xa000, 0xd9: 0x3112, 0xda: 0x3117, 0xdb: 0x311c, 0xdc: 0x4840, 0xdd: 0x3194, 0xe0: 0x31da, 0xe1: 0x31df, 0xe2: 0x484a, 0xe3: 0x31e4, 0xe4: 0x4859, 0xe5: 0x485e, 0xe6: 0xa000, 0xe7: 0x4868, 0xe8: 0x324d, 0xe9: 0x3252, 0xea: 0x486d, 0xeb: 0x3266, 0xec: 0x32de, 0xed: 0x32e3, 0xee: 0x32e8, 0xef: 0x4881, 0xf1: 0x3374, 0xf2: 0x3397, 0xf3: 0x339c, 0xf4: 0x488b, 0xf5: 0x4890, 0xf6: 0x489f, 0xf8: 0xa000, 0xf9: 0x3428, 0xfa: 0x342d, 0xfb: 0x3432, 0xfc: 0x48d1, 0xfd: 0x34af, 0xff: 0x34c8, // Block 0x4, offset 0x100 0x100: 0x2edd, 0x101: 0x31e9, 0x102: 0x47be, 0x103: 0x484f, 0x104: 0x2efb, 0x105: 0x3207, 0x106: 0x2f0f, 0x107: 0x321b, 0x108: 0x2f14, 0x109: 0x3220, 0x10a: 0x2f19, 0x10b: 0x3225, 0x10c: 0x2f1e, 0x10d: 0x322a, 0x10e: 0x2f28, 0x10f: 0x3234, 0x112: 0x47e1, 0x113: 0x4872, 0x114: 0x2f50, 0x115: 0x325c, 0x116: 0x2f55, 0x117: 0x3261, 0x118: 0x2f73, 0x119: 0x327f, 0x11a: 0x2f64, 0x11b: 0x3270, 0x11c: 0x2f8c, 0x11d: 0x3298, 0x11e: 0x2f96, 0x11f: 0x32a2, 0x120: 0x2f9b, 0x121: 0x32a7, 0x122: 0x2fa5, 0x123: 0x32b1, 0x124: 0x2faa, 0x125: 0x32b6, 0x128: 0x2fdc, 0x129: 0x32ed, 0x12a: 0x2fe1, 0x12b: 0x32f2, 0x12c: 0x2fe6, 0x12d: 0x32f7, 0x12e: 0x3009, 0x12f: 0x3315, 0x130: 0x2feb, 0x134: 0x3013, 0x135: 0x331f, 0x136: 0x3027, 0x137: 0x3338, 0x139: 0x3031, 0x13a: 0x3342, 0x13b: 0x303b, 0x13c: 0x334c, 0x13d: 0x3036, 0x13e: 0x3347, // Block 0x5, offset 0x140 0x143: 0x305e, 0x144: 0x336f, 0x145: 0x3077, 0x146: 0x3388, 0x147: 0x306d, 0x148: 0x337e, 0x14c: 0x4804, 0x14d: 0x4895, 0x14e: 0x3090, 0x14f: 0x33a1, 0x150: 0x309a, 0x151: 0x33ab, 0x154: 0x30b8, 0x155: 0x33c9, 0x156: 0x30d1, 0x157: 0x33e2, 0x158: 0x30c2, 0x159: 0x33d3, 0x15a: 0x4827, 0x15b: 0x48b8, 0x15c: 0x30db, 0x15d: 0x33ec, 0x15e: 0x30ea, 0x15f: 0x33fb, 0x160: 0x482c, 0x161: 0x48bd, 0x162: 0x3103, 0x163: 0x3419, 0x164: 0x30f4, 0x165: 0x340a, 0x168: 0x4836, 0x169: 0x48c7, 0x16a: 0x483b, 0x16b: 0x48cc, 0x16c: 0x3121, 0x16d: 0x3437, 0x16e: 0x312b, 0x16f: 0x3441, 0x170: 0x3130, 0x171: 0x3446, 0x172: 0x314e, 0x173: 0x3464, 0x174: 0x3171, 0x175: 0x3487, 0x176: 0x3199, 0x177: 0x34b4, 0x178: 0x31ad, 0x179: 0x31bc, 0x17a: 0x34dc, 0x17b: 0x31c6, 0x17c: 0x34e6, 0x17d: 0x31cb, 0x17e: 0x34eb, 0x17f: 0xa000, // Block 0x6, offset 0x180 0x184: 0x8100, 0x185: 0x8100, 0x186: 0x8100, 0x18d: 0x2ee7, 0x18e: 0x31f3, 0x18f: 0x2ff5, 0x190: 0x3301, 0x191: 0x309f, 0x192: 0x33b0, 0x193: 0x3135, 0x194: 0x344b, 0x195: 0x392e, 0x196: 0x3abd, 0x197: 0x3927, 0x198: 0x3ab6, 0x199: 0x3935, 0x19a: 0x3ac4, 0x19b: 0x3920, 0x19c: 0x3aaf, 0x19e: 0x380f, 0x19f: 0x399e, 0x1a0: 0x3808, 0x1a1: 0x3997, 0x1a2: 0x3512, 0x1a3: 0x3524, 0x1a6: 0x2fa0, 0x1a7: 0x32ac, 0x1a8: 0x301d, 0x1a9: 0x332e, 0x1aa: 0x481d, 0x1ab: 0x48ae, 0x1ac: 0x38ef, 0x1ad: 0x3a7e, 0x1ae: 0x3536, 0x1af: 0x353c, 0x1b0: 0x3324, 0x1b4: 0x2f87, 0x1b5: 0x3293, 0x1b8: 0x3059, 0x1b9: 0x336a, 0x1ba: 0x3816, 0x1bb: 0x39a5, 0x1bc: 0x350c, 0x1bd: 0x351e, 0x1be: 0x3518, 0x1bf: 0x352a, // Block 0x7, offset 0x1c0 0x1c0: 0x2eec, 0x1c1: 0x31f8, 0x1c2: 0x2ef1, 0x1c3: 0x31fd, 0x1c4: 0x2f69, 0x1c5: 0x3275, 0x1c6: 0x2f6e, 0x1c7: 0x327a, 0x1c8: 0x2ffa, 0x1c9: 0x3306, 0x1ca: 0x2fff, 0x1cb: 0x330b, 0x1cc: 0x30a4, 0x1cd: 0x33b5, 0x1ce: 0x30a9, 0x1cf: 0x33ba, 0x1d0: 0x30c7, 0x1d1: 0x33d8, 0x1d2: 0x30cc, 0x1d3: 0x33dd, 0x1d4: 0x313a, 0x1d5: 0x3450, 0x1d6: 0x313f, 0x1d7: 0x3455, 0x1d8: 0x30e5, 0x1d9: 0x33f6, 0x1da: 0x30fe, 0x1db: 0x3414, 0x1de: 0x2fb9, 0x1df: 0x32c5, 0x1e6: 0x47c3, 0x1e7: 0x4854, 0x1e8: 0x47eb, 0x1e9: 0x487c, 0x1ea: 0x38be, 0x1eb: 0x3a4d, 0x1ec: 0x389b, 0x1ed: 0x3a2a, 0x1ee: 0x4809, 0x1ef: 0x489a, 0x1f0: 0x38b7, 0x1f1: 0x3a46, 0x1f2: 0x31a3, 0x1f3: 0x34be, // Block 0x8, offset 0x200 0x200: 0x9933, 0x201: 0x9933, 0x202: 0x9933, 0x203: 0x9933, 0x204: 0x9933, 0x205: 0x8133, 0x206: 0x9933, 0x207: 0x9933, 0x208: 0x9933, 0x209: 0x9933, 0x20a: 0x9933, 0x20b: 0x9933, 0x20c: 0x9933, 0x20d: 0x8133, 0x20e: 0x8133, 0x20f: 0x9933, 0x210: 0x8133, 0x211: 0x9933, 0x212: 0x8133, 0x213: 0x9933, 0x214: 0x9933, 0x215: 0x8134, 0x216: 0x812e, 0x217: 0x812e, 0x218: 0x812e, 0x219: 0x812e, 0x21a: 0x8134, 0x21b: 0x992c, 0x21c: 0x812e, 0x21d: 0x812e, 0x21e: 0x812e, 0x21f: 0x812e, 0x220: 0x812e, 0x221: 0x812a, 0x222: 0x812a, 0x223: 0x992e, 0x224: 0x992e, 0x225: 0x992e, 0x226: 0x992e, 0x227: 0x992a, 0x228: 0x992a, 0x229: 0x812e, 0x22a: 0x812e, 0x22b: 0x812e, 0x22c: 0x812e, 0x22d: 0x992e, 0x22e: 0x992e, 0x22f: 0x812e, 0x230: 0x992e, 0x231: 0x992e, 0x232: 0x812e, 0x233: 0x812e, 0x234: 0x8101, 0x235: 0x8101, 0x236: 0x8101, 0x237: 0x8101, 0x238: 0x9901, 0x239: 0x812e, 0x23a: 0x812e, 0x23b: 0x812e, 0x23c: 0x812e, 0x23d: 0x8133, 0x23e: 0x8133, 0x23f: 0x8133, // Block 0x9, offset 0x240 0x240: 0x4aef, 0x241: 0x4af4, 0x242: 0x9933, 0x243: 0x4af9, 0x244: 0x4bb2, 0x245: 0x9937, 0x246: 0x8133, 0x247: 0x812e, 0x248: 0x812e, 0x249: 0x812e, 0x24a: 0x8133, 0x24b: 0x8133, 0x24c: 0x8133, 0x24d: 0x812e, 0x24e: 0x812e, 0x250: 0x8133, 0x251: 0x8133, 0x252: 0x8133, 0x253: 0x812e, 0x254: 0x812e, 0x255: 0x812e, 0x256: 0x812e, 0x257: 0x8133, 0x258: 0x8134, 0x259: 0x812e, 0x25a: 0x812e, 0x25b: 0x8133, 0x25c: 0x8135, 0x25d: 0x8136, 0x25e: 0x8136, 0x25f: 0x8135, 0x260: 0x8136, 0x261: 0x8136, 0x262: 0x8135, 0x263: 0x8133, 0x264: 0x8133, 0x265: 0x8133, 0x266: 0x8133, 0x267: 0x8133, 0x268: 0x8133, 0x269: 0x8133, 0x26a: 0x8133, 0x26b: 0x8133, 0x26c: 0x8133, 0x26d: 0x8133, 0x26e: 0x8133, 0x26f: 0x8133, 0x274: 0x01ee, 0x27a: 0x8100, 0x27e: 0x0037, // Block 0xa, offset 0x280 0x284: 0x8100, 0x285: 0x3500, 0x286: 0x3548, 0x287: 0x00ce, 0x288: 0x3566, 0x289: 0x3572, 0x28a: 0x3584, 0x28c: 0x35a2, 0x28e: 0x35b4, 0x28f: 0x35d2, 0x290: 0x3d67, 0x291: 0xa000, 0x295: 0xa000, 0x297: 0xa000, 0x299: 0xa000, 0x29f: 0xa000, 0x2a1: 0xa000, 0x2a5: 0xa000, 0x2a9: 0xa000, 0x2aa: 0x3596, 0x2ab: 0x35c6, 0x2ac: 0x492f, 0x2ad: 0x35f6, 0x2ae: 0x4959, 0x2af: 0x3608, 0x2b0: 0x3dcf, 0x2b1: 0xa000, 0x2b5: 0xa000, 0x2b7: 0xa000, 0x2b9: 0xa000, 0x2bf: 0xa000, // Block 0xb, offset 0x2c0 0x2c0: 0x3680, 0x2c1: 0x368c, 0x2c3: 0x367a, 0x2c6: 0xa000, 0x2c7: 0x3668, 0x2cc: 0x36bc, 0x2cd: 0x36a4, 0x2ce: 0x36ce, 0x2d0: 0xa000, 0x2d3: 0xa000, 0x2d5: 0xa000, 0x2d6: 0xa000, 0x2d7: 0xa000, 0x2d8: 0xa000, 0x2d9: 0x36b0, 0x2da: 0xa000, 0x2de: 0xa000, 0x2e3: 0xa000, 0x2e7: 0xa000, 0x2eb: 0xa000, 0x2ed: 0xa000, 0x2f0: 0xa000, 0x2f3: 0xa000, 0x2f5: 0xa000, 0x2f6: 0xa000, 0x2f7: 0xa000, 0x2f8: 0xa000, 0x2f9: 0x3734, 0x2fa: 0xa000, 0x2fe: 0xa000, // Block 0xc, offset 0x300 0x301: 0x3692, 0x302: 0x3716, 0x310: 0x366e, 0x311: 0x36f2, 0x312: 0x3674, 0x313: 0x36f8, 0x316: 0x3686, 0x317: 0x370a, 0x318: 0xa000, 0x319: 0xa000, 0x31a: 0x3788, 0x31b: 0x378e, 0x31c: 0x3698, 0x31d: 0x371c, 0x31e: 0x369e, 0x31f: 0x3722, 0x322: 0x36aa, 0x323: 0x372e, 0x324: 0x36b6, 0x325: 0x373a, 0x326: 0x36c2, 0x327: 0x3746, 0x328: 0xa000, 0x329: 0xa000, 0x32a: 0x3794, 0x32b: 0x379a, 0x32c: 0x36ec, 0x32d: 0x3770, 0x32e: 0x36c8, 0x32f: 0x374c, 0x330: 0x36d4, 0x331: 0x3758, 0x332: 0x36da, 0x333: 0x375e, 0x334: 0x36e0, 0x335: 0x3764, 0x338: 0x36e6, 0x339: 0x376a, // Block 0xd, offset 0x340 0x351: 0x812e, 0x352: 0x8133, 0x353: 0x8133, 0x354: 0x8133, 0x355: 0x8133, 0x356: 0x812e, 0x357: 0x8133, 0x358: 0x8133, 0x359: 0x8133, 0x35a: 0x812f, 0x35b: 0x812e, 0x35c: 0x8133, 0x35d: 0x8133, 0x35e: 0x8133, 0x35f: 0x8133, 0x360: 0x8133, 0x361: 0x8133, 0x362: 0x812e, 0x363: 0x812e, 0x364: 0x812e, 0x365: 0x812e, 0x366: 0x812e, 0x367: 0x812e, 0x368: 0x8133, 0x369: 0x8133, 0x36a: 0x812e, 0x36b: 0x8133, 0x36c: 0x8133, 0x36d: 0x812f, 0x36e: 0x8132, 0x36f: 0x8133, 0x370: 0x8106, 0x371: 0x8107, 0x372: 0x8108, 0x373: 0x8109, 0x374: 0x810a, 0x375: 0x810b, 0x376: 0x810c, 0x377: 0x810d, 0x378: 0x810e, 0x379: 0x810f, 0x37a: 0x810f, 0x37b: 0x8110, 0x37c: 0x8111, 0x37d: 0x8112, 0x37f: 0x8113, // Block 0xe, offset 0x380 0x388: 0xa000, 0x38a: 0xa000, 0x38b: 0x8117, 0x38c: 0x8118, 0x38d: 0x8119, 0x38e: 0x811a, 0x38f: 0x811b, 0x390: 0x811c, 0x391: 0x811d, 0x392: 0x811e, 0x393: 0x9933, 0x394: 0x9933, 0x395: 0x992e, 0x396: 0x812e, 0x397: 0x8133, 0x398: 0x8133, 0x399: 0x8133, 0x39a: 0x8133, 0x39b: 0x8133, 0x39c: 0x812e, 0x39d: 0x8133, 0x39e: 0x8133, 0x39f: 0x812e, 0x3b0: 0x811f, // Block 0xf, offset 0x3c0 0x3ca: 0x8133, 0x3cb: 0x8133, 0x3cc: 0x8133, 0x3cd: 0x8133, 0x3ce: 0x8133, 0x3cf: 0x812e, 0x3d0: 0x812e, 0x3d1: 0x812e, 0x3d2: 0x812e, 0x3d3: 0x812e, 0x3d4: 0x8133, 0x3d5: 0x8133, 0x3d6: 0x8133, 0x3d7: 0x8133, 0x3d8: 0x8133, 0x3d9: 0x8133, 0x3da: 0x8133, 0x3db: 0x8133, 0x3dc: 0x8133, 0x3dd: 0x8133, 0x3de: 0x8133, 0x3df: 0x8133, 0x3e0: 0x8133, 0x3e1: 0x8133, 0x3e3: 0x812e, 0x3e4: 0x8133, 0x3e5: 0x8133, 0x3e6: 0x812e, 0x3e7: 0x8133, 0x3e8: 0x8133, 0x3e9: 0x812e, 0x3ea: 0x8133, 0x3eb: 0x8133, 0x3ec: 0x8133, 0x3ed: 0x812e, 0x3ee: 0x812e, 0x3ef: 0x812e, 0x3f0: 0x8117, 0x3f1: 0x8118, 0x3f2: 0x8119, 0x3f3: 0x8133, 0x3f4: 0x8133, 0x3f5: 0x8133, 0x3f6: 0x812e, 0x3f7: 0x8133, 0x3f8: 0x8133, 0x3f9: 0x812e, 0x3fa: 0x812e, 0x3fb: 0x8133, 0x3fc: 0x8133, 0x3fd: 0x8133, 0x3fe: 0x8133, 0x3ff: 0x8133, // Block 0x10, offset 0x400 0x405: 0xa000, 0x406: 0x3ee7, 0x407: 0xa000, 0x408: 0x3eef, 0x409: 0xa000, 0x40a: 0x3ef7, 0x40b: 0xa000, 0x40c: 0x3eff, 0x40d: 0xa000, 0x40e: 0x3f07, 0x411: 0xa000, 0x412: 0x3f0f, 0x434: 0x8103, 0x435: 0x9900, 0x43a: 0xa000, 0x43b: 0x3f17, 0x43c: 0xa000, 0x43d: 0x3f1f, 0x43e: 0xa000, 0x43f: 0xa000, // Block 0x11, offset 0x440 0x440: 0x8133, 0x441: 0x8133, 0x442: 0x812e, 0x443: 0x8133, 0x444: 0x8133, 0x445: 0x8133, 0x446: 0x8133, 0x447: 0x8133, 0x448: 0x8133, 0x449: 0x8133, 0x44a: 0x812e, 0x44b: 0x8133, 0x44c: 0x8133, 0x44d: 0x8136, 0x44e: 0x812b, 0x44f: 0x812e, 0x450: 0x812a, 0x451: 0x8133, 0x452: 0x8133, 0x453: 0x8133, 0x454: 0x8133, 0x455: 0x8133, 0x456: 0x8133, 0x457: 0x8133, 0x458: 0x8133, 0x459: 0x8133, 0x45a: 0x8133, 0x45b: 0x8133, 0x45c: 0x8133, 0x45d: 0x8133, 0x45e: 0x8133, 0x45f: 0x8133, 0x460: 0x8133, 0x461: 0x8133, 0x462: 0x8133, 0x463: 0x8133, 0x464: 0x8133, 0x465: 0x8133, 0x466: 0x8133, 0x467: 0x8133, 0x468: 0x8133, 0x469: 0x8133, 0x46a: 0x8133, 0x46b: 0x8133, 0x46c: 0x8133, 0x46d: 0x8133, 0x46e: 0x8133, 0x46f: 0x8133, 0x470: 0x8133, 0x471: 0x8133, 0x472: 0x8133, 0x473: 0x8133, 0x474: 0x8133, 0x475: 0x8133, 0x476: 0x8134, 0x477: 0x8132, 0x478: 0x8132, 0x479: 0x812e, 0x47a: 0x812d, 0x47b: 0x8133, 0x47c: 0x8135, 0x47d: 0x812e, 0x47e: 0x8133, 0x47f: 0x812e, // Block 0x12, offset 0x480 0x480: 0x2ef6, 0x481: 0x3202, 0x482: 0x2f00, 0x483: 0x320c, 0x484: 0x2f05, 0x485: 0x3211, 0x486: 0x2f0a, 0x487: 0x3216, 0x488: 0x382b, 0x489: 0x39ba, 0x48a: 0x2f23, 0x48b: 0x322f, 0x48c: 0x2f2d, 0x48d: 0x3239, 0x48e: 0x2f3c, 0x48f: 0x3248, 0x490: 0x2f32, 0x491: 0x323e, 0x492: 0x2f37, 0x493: 0x3243, 0x494: 0x384e, 0x495: 0x39dd, 0x496: 0x3855, 0x497: 0x39e4, 0x498: 0x2f78, 0x499: 0x3284, 0x49a: 0x2f7d, 0x49b: 0x3289, 0x49c: 0x3863, 0x49d: 0x39f2, 0x49e: 0x2f82, 0x49f: 0x328e, 0x4a0: 0x2f91, 0x4a1: 0x329d, 0x4a2: 0x2faf, 0x4a3: 0x32bb, 0x4a4: 0x2fbe, 0x4a5: 0x32ca, 0x4a6: 0x2fb4, 0x4a7: 0x32c0, 0x4a8: 0x2fc3, 0x4a9: 0x32cf, 0x4aa: 0x2fc8, 0x4ab: 0x32d4, 0x4ac: 0x300e, 0x4ad: 0x331a, 0x4ae: 0x386a, 0x4af: 0x39f9, 0x4b0: 0x3018, 0x4b1: 0x3329, 0x4b2: 0x3022, 0x4b3: 0x3333, 0x4b4: 0x302c, 0x4b5: 0x333d, 0x4b6: 0x47f5, 0x4b7: 0x4886, 0x4b8: 0x3871, 0x4b9: 0x3a00, 0x4ba: 0x3045, 0x4bb: 0x3356, 0x4bc: 0x3040, 0x4bd: 0x3351, 0x4be: 0x304a, 0x4bf: 0x335b, // Block 0x13, offset 0x4c0 0x4c0: 0x304f, 0x4c1: 0x3360, 0x4c2: 0x3054, 0x4c3: 0x3365, 0x4c4: 0x3068, 0x4c5: 0x3379, 0x4c6: 0x3072, 0x4c7: 0x3383, 0x4c8: 0x3081, 0x4c9: 0x3392, 0x4ca: 0x307c, 0x4cb: 0x338d, 0x4cc: 0x3894, 0x4cd: 0x3a23, 0x4ce: 0x38a2, 0x4cf: 0x3a31, 0x4d0: 0x38a9, 0x4d1: 0x3a38, 0x4d2: 0x38b0, 0x4d3: 0x3a3f, 0x4d4: 0x30ae, 0x4d5: 0x33bf, 0x4d6: 0x30b3, 0x4d7: 0x33c4, 0x4d8: 0x30bd, 0x4d9: 0x33ce, 0x4da: 0x4822, 0x4db: 0x48b3, 0x4dc: 0x38f6, 0x4dd: 0x3a85, 0x4de: 0x30d6, 0x4df: 0x33e7, 0x4e0: 0x30e0, 0x4e1: 0x33f1, 0x4e2: 0x4831, 0x4e3: 0x48c2, 0x4e4: 0x38fd, 0x4e5: 0x3a8c, 0x4e6: 0x3904, 0x4e7: 0x3a93, 0x4e8: 0x390b, 0x4e9: 0x3a9a, 0x4ea: 0x30ef, 0x4eb: 0x3400, 0x4ec: 0x30f9, 0x4ed: 0x340f, 0x4ee: 0x310d, 0x4ef: 0x3423, 0x4f0: 0x3108, 0x4f1: 0x341e, 0x4f2: 0x3149, 0x4f3: 0x345f, 0x4f4: 0x3158, 0x4f5: 0x346e, 0x4f6: 0x3153, 0x4f7: 0x3469, 0x4f8: 0x3912, 0x4f9: 0x3aa1, 0x4fa: 0x3919, 0x4fb: 0x3aa8, 0x4fc: 0x315d, 0x4fd: 0x3473, 0x4fe: 0x3162, 0x4ff: 0x3478, // Block 0x14, offset 0x500 0x500: 0x3167, 0x501: 0x347d, 0x502: 0x316c, 0x503: 0x3482, 0x504: 0x317b, 0x505: 0x3491, 0x506: 0x3176, 0x507: 0x348c, 0x508: 0x3180, 0x509: 0x349b, 0x50a: 0x3185, 0x50b: 0x34a0, 0x50c: 0x318a, 0x50d: 0x34a5, 0x50e: 0x31a8, 0x50f: 0x34c3, 0x510: 0x31c1, 0x511: 0x34e1, 0x512: 0x31d0, 0x513: 0x34f0, 0x514: 0x31d5, 0x515: 0x34f5, 0x516: 0x32d9, 0x517: 0x3405, 0x518: 0x3496, 0x519: 0x34d2, 0x51b: 0x3530, 0x520: 0x47d2, 0x521: 0x4863, 0x522: 0x2ee2, 0x523: 0x31ee, 0x524: 0x37d7, 0x525: 0x3966, 0x526: 0x37d0, 0x527: 0x395f, 0x528: 0x37e5, 0x529: 0x3974, 0x52a: 0x37de, 0x52b: 0x396d, 0x52c: 0x381d, 0x52d: 0x39ac, 0x52e: 0x37f3, 0x52f: 0x3982, 0x530: 0x37ec, 0x531: 0x397b, 0x532: 0x3801, 0x533: 0x3990, 0x534: 0x37fa, 0x535: 0x3989, 0x536: 0x3824, 0x537: 0x39b3, 0x538: 0x47e6, 0x539: 0x4877, 0x53a: 0x2f5f, 0x53b: 0x326b, 0x53c: 0x2f4b, 0x53d: 0x3257, 0x53e: 0x3839, 0x53f: 0x39c8, // Block 0x15, offset 0x540 0x540: 0x3832, 0x541: 0x39c1, 0x542: 0x3847, 0x543: 0x39d6, 0x544: 0x3840, 0x545: 0x39cf, 0x546: 0x385c, 0x547: 0x39eb, 0x548: 0x2ff0, 0x549: 0x32fc, 0x54a: 0x3004, 0x54b: 0x3310, 0x54c: 0x4818, 0x54d: 0x48a9, 0x54e: 0x3095, 0x54f: 0x33a6, 0x550: 0x387f, 0x551: 0x3a0e, 0x552: 0x3878, 0x553: 0x3a07, 0x554: 0x388d, 0x555: 0x3a1c, 0x556: 0x3886, 0x557: 0x3a15, 0x558: 0x38e8, 0x559: 0x3a77, 0x55a: 0x38cc, 0x55b: 0x3a5b, 0x55c: 0x38c5, 0x55d: 0x3a54, 0x55e: 0x38da, 0x55f: 0x3a69, 0x560: 0x38d3, 0x561: 0x3a62, 0x562: 0x38e1, 0x563: 0x3a70, 0x564: 0x3144, 0x565: 0x345a, 0x566: 0x3126, 0x567: 0x343c, 0x568: 0x3943, 0x569: 0x3ad2, 0x56a: 0x393c, 0x56b: 0x3acb, 0x56c: 0x3951, 0x56d: 0x3ae0, 0x56e: 0x394a, 0x56f: 0x3ad9, 0x570: 0x3958, 0x571: 0x3ae7, 0x572: 0x318f, 0x573: 0x34aa, 0x574: 0x31b7, 0x575: 0x34d7, 0x576: 0x31b2, 0x577: 0x34cd, 0x578: 0x319e, 0x579: 0x34b9, // Block 0x16, offset 0x580 0x580: 0x4935, 0x581: 0x493b, 0x582: 0x4a4f, 0x583: 0x4a67, 0x584: 0x4a57, 0x585: 0x4a6f, 0x586: 0x4a5f, 0x587: 0x4a77, 0x588: 0x48db, 0x589: 0x48e1, 0x58a: 0x49bf, 0x58b: 0x49d7, 0x58c: 0x49c7, 0x58d: 0x49df, 0x58e: 0x49cf, 0x58f: 0x49e7, 0x590: 0x4947, 0x591: 0x494d, 0x592: 0x3d17, 0x593: 0x3d27, 0x594: 0x3d1f, 0x595: 0x3d2f, 0x598: 0x48e7, 0x599: 0x48ed, 0x59a: 0x3c47, 0x59b: 0x3c57, 0x59c: 0x3c4f, 0x59d: 0x3c5f, 0x5a0: 0x495f, 0x5a1: 0x4965, 0x5a2: 0x4a7f, 0x5a3: 0x4a97, 0x5a4: 0x4a87, 0x5a5: 0x4a9f, 0x5a6: 0x4a8f, 0x5a7: 0x4aa7, 0x5a8: 0x48f3, 0x5a9: 0x48f9, 0x5aa: 0x49ef, 0x5ab: 0x4a07, 0x5ac: 0x49f7, 0x5ad: 0x4a0f, 0x5ae: 0x49ff, 0x5af: 0x4a17, 0x5b0: 0x4977, 0x5b1: 0x497d, 0x5b2: 0x3d77, 0x5b3: 0x3d8f, 0x5b4: 0x3d7f, 0x5b5: 0x3d97, 0x5b6: 0x3d87, 0x5b7: 0x3d9f, 0x5b8: 0x48ff, 0x5b9: 0x4905, 0x5ba: 0x3c77, 0x5bb: 0x3c8f, 0x5bc: 0x3c7f, 0x5bd: 0x3c97, 0x5be: 0x3c87, 0x5bf: 0x3c9f, // Block 0x17, offset 0x5c0 0x5c0: 0x4983, 0x5c1: 0x4989, 0x5c2: 0x3da7, 0x5c3: 0x3db7, 0x5c4: 0x3daf, 0x5c5: 0x3dbf, 0x5c8: 0x490b, 0x5c9: 0x4911, 0x5ca: 0x3ca7, 0x5cb: 0x3cb7, 0x5cc: 0x3caf, 0x5cd: 0x3cbf, 0x5d0: 0x4995, 0x5d1: 0x499b, 0x5d2: 0x3ddf, 0x5d3: 0x3df7, 0x5d4: 0x3de7, 0x5d5: 0x3dff, 0x5d6: 0x3def, 0x5d7: 0x3e07, 0x5d9: 0x4917, 0x5db: 0x3cc7, 0x5dd: 0x3ccf, 0x5df: 0x3cd7, 0x5e0: 0x49ad, 0x5e1: 0x49b3, 0x5e2: 0x4aaf, 0x5e3: 0x4ac7, 0x5e4: 0x4ab7, 0x5e5: 0x4acf, 0x5e6: 0x4abf, 0x5e7: 0x4ad7, 0x5e8: 0x491d, 0x5e9: 0x4923, 0x5ea: 0x4a1f, 0x5eb: 0x4a37, 0x5ec: 0x4a27, 0x5ed: 0x4a3f, 0x5ee: 0x4a2f, 0x5ef: 0x4a47, 0x5f0: 0x4929, 0x5f1: 0x43d7, 0x5f2: 0x35f0, 0x5f3: 0x43dd, 0x5f4: 0x4953, 0x5f5: 0x43e3, 0x5f6: 0x3602, 0x5f7: 0x43e9, 0x5f8: 0x3620, 0x5f9: 0x43ef, 0x5fa: 0x3638, 0x5fb: 0x43f5, 0x5fc: 0x49a1, 0x5fd: 0x43fb, // Block 0x18, offset 0x600 0x600: 0x3cff, 0x601: 0x3d07, 0x602: 0x41c3, 0x603: 0x41e1, 0x604: 0x41cd, 0x605: 0x41eb, 0x606: 0x41d7, 0x607: 0x41f5, 0x608: 0x3c37, 0x609: 0x3c3f, 0x60a: 0x410f, 0x60b: 0x412d, 0x60c: 0x4119, 0x60d: 0x4137, 0x60e: 0x4123, 0x60f: 0x4141, 0x610: 0x3d47, 0x611: 0x3d4f, 0x612: 0x41ff, 0x613: 0x421d, 0x614: 0x4209, 0x615: 0x4227, 0x616: 0x4213, 0x617: 0x4231, 0x618: 0x3c67, 0x619: 0x3c6f, 0x61a: 0x414b, 0x61b: 0x4169, 0x61c: 0x4155, 0x61d: 0x4173, 0x61e: 0x415f, 0x61f: 0x417d, 0x620: 0x3e1f, 0x621: 0x3e27, 0x622: 0x423b, 0x623: 0x4259, 0x624: 0x4245, 0x625: 0x4263, 0x626: 0x424f, 0x627: 0x426d, 0x628: 0x3cdf, 0x629: 0x3ce7, 0x62a: 0x4187, 0x62b: 0x41a5, 0x62c: 0x4191, 0x62d: 0x41af, 0x62e: 0x419b, 0x62f: 0x41b9, 0x630: 0x35e4, 0x631: 0x35de, 0x632: 0x3cef, 0x633: 0x35ea, 0x634: 0x3cf7, 0x636: 0x4941, 0x637: 0x3d0f, 0x638: 0x3554, 0x639: 0x354e, 0x63a: 0x3542, 0x63b: 0x43a7, 0x63c: 0x355a, 0x63d: 0x8100, 0x63e: 0x0257, 0x63f: 0xa100, // Block 0x19, offset 0x640 0x640: 0x8100, 0x641: 0x3506, 0x642: 0x3d37, 0x643: 0x35fc, 0x644: 0x3d3f, 0x646: 0x496b, 0x647: 0x3d57, 0x648: 0x3560, 0x649: 0x43ad, 0x64a: 0x356c, 0x64b: 0x43b3, 0x64c: 0x3578, 0x64d: 0x3aee, 0x64e: 0x3af5, 0x64f: 0x3afc, 0x650: 0x3614, 0x651: 0x360e, 0x652: 0x3d5f, 0x653: 0x459d, 0x656: 0x361a, 0x657: 0x3d6f, 0x658: 0x3590, 0x659: 0x358a, 0x65a: 0x357e, 0x65b: 0x43b9, 0x65d: 0x3b03, 0x65e: 0x3b0a, 0x65f: 0x3b11, 0x660: 0x364a, 0x661: 0x3644, 0x662: 0x3dc7, 0x663: 0x45a5, 0x664: 0x362c, 0x665: 0x3632, 0x666: 0x3650, 0x667: 0x3dd7, 0x668: 0x35c0, 0x669: 0x35ba, 0x66a: 0x35ae, 0x66b: 0x43c5, 0x66c: 0x35a8, 0x66d: 0x34fa, 0x66e: 0x43a1, 0x66f: 0x0081, 0x672: 0x3e0f, 0x673: 0x3656, 0x674: 0x3e17, 0x676: 0x49b9, 0x677: 0x3e2f, 0x678: 0x359c, 0x679: 0x43bf, 0x67a: 0x35cc, 0x67b: 0x43d1, 0x67c: 0x35d8, 0x67d: 0x430f, 0x67e: 0xa100, // Block 0x1a, offset 0x680 0x681: 0x3b65, 0x683: 0xa000, 0x684: 0x3b6c, 0x685: 0xa000, 0x687: 0x3b73, 0x688: 0xa000, 0x689: 0x3b7a, 0x68d: 0xa000, 0x6a0: 0x2ec4, 0x6a1: 0xa000, 0x6a2: 0x3b88, 0x6a4: 0xa000, 0x6a5: 0xa000, 0x6ad: 0x3b81, 0x6ae: 0x2ebf, 0x6af: 0x2ec9, 0x6b0: 0x3b8f, 0x6b1: 0x3b96, 0x6b2: 0xa000, 0x6b3: 0xa000, 0x6b4: 0x3b9d, 0x6b5: 0x3ba4, 0x6b6: 0xa000, 0x6b7: 0xa000, 0x6b8: 0x3bab, 0x6b9: 0x3bb2, 0x6ba: 0xa000, 0x6bb: 0xa000, 0x6bc: 0xa000, 0x6bd: 0xa000, // Block 0x1b, offset 0x6c0 0x6c0: 0x3bb9, 0x6c1: 0x3bc0, 0x6c2: 0xa000, 0x6c3: 0xa000, 0x6c4: 0x3bd5, 0x6c5: 0x3bdc, 0x6c6: 0xa000, 0x6c7: 0xa000, 0x6c8: 0x3be3, 0x6c9: 0x3bea, 0x6d1: 0xa000, 0x6d2: 0xa000, 0x6e2: 0xa000, 0x6e8: 0xa000, 0x6e9: 0xa000, 0x6eb: 0xa000, 0x6ec: 0x3bff, 0x6ed: 0x3c06, 0x6ee: 0x3c0d, 0x6ef: 0x3c14, 0x6f2: 0xa000, 0x6f3: 0xa000, 0x6f4: 0xa000, 0x6f5: 0xa000, // Block 0x1c, offset 0x700 0x706: 0xa000, 0x70b: 0xa000, 0x70c: 0x3f47, 0x70d: 0xa000, 0x70e: 0x3f4f, 0x70f: 0xa000, 0x710: 0x3f57, 0x711: 0xa000, 0x712: 0x3f5f, 0x713: 0xa000, 0x714: 0x3f67, 0x715: 0xa000, 0x716: 0x3f6f, 0x717: 0xa000, 0x718: 0x3f77, 0x719: 0xa000, 0x71a: 0x3f7f, 0x71b: 0xa000, 0x71c: 0x3f87, 0x71d: 0xa000, 0x71e: 0x3f8f, 0x71f: 0xa000, 0x720: 0x3f97, 0x721: 0xa000, 0x722: 0x3f9f, 0x724: 0xa000, 0x725: 0x3fa7, 0x726: 0xa000, 0x727: 0x3faf, 0x728: 0xa000, 0x729: 0x3fb7, 0x72f: 0xa000, 0x730: 0x3fbf, 0x731: 0x3fc7, 0x732: 0xa000, 0x733: 0x3fcf, 0x734: 0x3fd7, 0x735: 0xa000, 0x736: 0x3fdf, 0x737: 0x3fe7, 0x738: 0xa000, 0x739: 0x3fef, 0x73a: 0x3ff7, 0x73b: 0xa000, 0x73c: 0x3fff, 0x73d: 0x4007, // Block 0x1d, offset 0x740 0x754: 0x3f3f, 0x759: 0x9904, 0x75a: 0x9904, 0x75b: 0x8100, 0x75c: 0x8100, 0x75d: 0xa000, 0x75e: 0x400f, 0x766: 0xa000, 0x76b: 0xa000, 0x76c: 0x401f, 0x76d: 0xa000, 0x76e: 0x4027, 0x76f: 0xa000, 0x770: 0x402f, 0x771: 0xa000, 0x772: 0x4037, 0x773: 0xa000, 0x774: 0x403f, 0x775: 0xa000, 0x776: 0x4047, 0x777: 0xa000, 0x778: 0x404f, 0x779: 0xa000, 0x77a: 0x4057, 0x77b: 0xa000, 0x77c: 0x405f, 0x77d: 0xa000, 0x77e: 0x4067, 0x77f: 0xa000, // Block 0x1e, offset 0x780 0x780: 0x406f, 0x781: 0xa000, 0x782: 0x4077, 0x784: 0xa000, 0x785: 0x407f, 0x786: 0xa000, 0x787: 0x4087, 0x788: 0xa000, 0x789: 0x408f, 0x78f: 0xa000, 0x790: 0x4097, 0x791: 0x409f, 0x792: 0xa000, 0x793: 0x40a7, 0x794: 0x40af, 0x795: 0xa000, 0x796: 0x40b7, 0x797: 0x40bf, 0x798: 0xa000, 0x799: 0x40c7, 0x79a: 0x40cf, 0x79b: 0xa000, 0x79c: 0x40d7, 0x79d: 0x40df, 0x7af: 0xa000, 0x7b0: 0xa000, 0x7b1: 0xa000, 0x7b2: 0xa000, 0x7b4: 0x4017, 0x7b7: 0x40e7, 0x7b8: 0x40ef, 0x7b9: 0x40f7, 0x7ba: 0x40ff, 0x7bd: 0xa000, 0x7be: 0x4107, // Block 0x1f, offset 0x7c0 0x7c0: 0x1472, 0x7c1: 0x0df6, 0x7c2: 0x14ce, 0x7c3: 0x149a, 0x7c4: 0x0f52, 0x7c5: 0x07e6, 0x7c6: 0x09da, 0x7c7: 0x1726, 0x7c8: 0x1726, 0x7c9: 0x0b06, 0x7ca: 0x155a, 0x7cb: 0x0a3e, 0x7cc: 0x0b02, 0x7cd: 0x0cea, 0x7ce: 0x10ca, 0x7cf: 0x125a, 0x7d0: 0x1392, 0x7d1: 0x13ce, 0x7d2: 0x1402, 0x7d3: 0x1516, 0x7d4: 0x0e6e, 0x7d5: 0x0efa, 0x7d6: 0x0fa6, 0x7d7: 0x103e, 0x7d8: 0x135a, 0x7d9: 0x1542, 0x7da: 0x166e, 0x7db: 0x080a, 0x7dc: 0x09ae, 0x7dd: 0x0e82, 0x7de: 0x0fca, 0x7df: 0x138e, 0x7e0: 0x16be, 0x7e1: 0x0bae, 0x7e2: 0x0f72, 0x7e3: 0x137e, 0x7e4: 0x1412, 0x7e5: 0x0d1e, 0x7e6: 0x12b6, 0x7e7: 0x13da, 0x7e8: 0x0c1a, 0x7e9: 0x0e0a, 0x7ea: 0x0f12, 0x7eb: 0x1016, 0x7ec: 0x1522, 0x7ed: 0x084a, 0x7ee: 0x08e2, 0x7ef: 0x094e, 0x7f0: 0x0d86, 0x7f1: 0x0e7a, 0x7f2: 0x0fc6, 0x7f3: 0x10ea, 0x7f4: 0x1272, 0x7f5: 0x1386, 0x7f6: 0x139e, 0x7f7: 0x14c2, 0x7f8: 0x15ea, 0x7f9: 0x169e, 0x7fa: 0x16ba, 0x7fb: 0x1126, 0x7fc: 0x1166, 0x7fd: 0x121e, 0x7fe: 0x133e, 0x7ff: 0x1576, // Block 0x20, offset 0x800 0x800: 0x16c6, 0x801: 0x1446, 0x802: 0x0ac2, 0x803: 0x0c36, 0x804: 0x11d6, 0x805: 0x1296, 0x806: 0x0ffa, 0x807: 0x112e, 0x808: 0x1492, 0x809: 0x15e2, 0x80a: 0x0abe, 0x80b: 0x0b8a, 0x80c: 0x0e72, 0x80d: 0x0f26, 0x80e: 0x0f5a, 0x80f: 0x120e, 0x810: 0x1236, 0x811: 0x15a2, 0x812: 0x094a, 0x813: 0x12a2, 0x814: 0x08ee, 0x815: 0x08ea, 0x816: 0x1192, 0x817: 0x1222, 0x818: 0x1356, 0x819: 0x15aa, 0x81a: 0x1462, 0x81b: 0x0d22, 0x81c: 0x0e6e, 0x81d: 0x1452, 0x81e: 0x07f2, 0x81f: 0x0b5e, 0x820: 0x0c8e, 0x821: 0x102a, 0x822: 0x10aa, 0x823: 0x096e, 0x824: 0x1136, 0x825: 0x085a, 0x826: 0x0c72, 0x827: 0x07d2, 0x828: 0x0ee6, 0x829: 0x0d9e, 0x82a: 0x120a, 0x82b: 0x09c2, 0x82c: 0x0aae, 0x82d: 0x10f6, 0x82e: 0x135e, 0x82f: 0x1436, 0x830: 0x0eb2, 0x831: 0x14f2, 0x832: 0x0ede, 0x833: 0x0d32, 0x834: 0x1316, 0x835: 0x0d52, 0x836: 0x10a6, 0x837: 0x0826, 0x838: 0x08a2, 0x839: 0x08e6, 0x83a: 0x0e4e, 0x83b: 0x11f6, 0x83c: 0x12ee, 0x83d: 0x1442, 0x83e: 0x1556, 0x83f: 0x0956, // Block 0x21, offset 0x840 0x840: 0x0a0a, 0x841: 0x0b12, 0x842: 0x0c2a, 0x843: 0x0dba, 0x844: 0x0f76, 0x845: 0x113a, 0x846: 0x1592, 0x847: 0x1676, 0x848: 0x16ca, 0x849: 0x16e2, 0x84a: 0x0932, 0x84b: 0x0dee, 0x84c: 0x0e9e, 0x84d: 0x14e6, 0x84e: 0x0bf6, 0x84f: 0x0cd2, 0x850: 0x0cee, 0x851: 0x0d7e, 0x852: 0x0f66, 0x853: 0x0fb2, 0x854: 0x1062, 0x855: 0x1186, 0x856: 0x122a, 0x857: 0x128e, 0x858: 0x14d6, 0x859: 0x1366, 0x85a: 0x14fe, 0x85b: 0x157a, 0x85c: 0x090a, 0x85d: 0x0936, 0x85e: 0x0a1e, 0x85f: 0x0fa2, 0x860: 0x13ee, 0x861: 0x1436, 0x862: 0x0c16, 0x863: 0x0c86, 0x864: 0x0d4a, 0x865: 0x0eaa, 0x866: 0x11d2, 0x867: 0x101e, 0x868: 0x0836, 0x869: 0x0a7a, 0x86a: 0x0b5e, 0x86b: 0x0bc2, 0x86c: 0x0c92, 0x86d: 0x103a, 0x86e: 0x1056, 0x86f: 0x1266, 0x870: 0x1286, 0x871: 0x155e, 0x872: 0x15de, 0x873: 0x15ee, 0x874: 0x162a, 0x875: 0x084e, 0x876: 0x117a, 0x877: 0x154a, 0x878: 0x15c6, 0x879: 0x0caa, 0x87a: 0x0812, 0x87b: 0x0872, 0x87c: 0x0b62, 0x87d: 0x0b82, 0x87e: 0x0daa, 0x87f: 0x0e6e, // Block 0x22, offset 0x880 0x880: 0x0fbe, 0x881: 0x10c6, 0x882: 0x1372, 0x883: 0x1512, 0x884: 0x171e, 0x885: 0x0dde, 0x886: 0x159e, 0x887: 0x092e, 0x888: 0x0e2a, 0x889: 0x0e36, 0x88a: 0x0f0a, 0x88b: 0x0f42, 0x88c: 0x1046, 0x88d: 0x10a2, 0x88e: 0x1122, 0x88f: 0x1206, 0x890: 0x1636, 0x891: 0x08aa, 0x892: 0x0cfe, 0x893: 0x15ae, 0x894: 0x0862, 0x895: 0x0ba6, 0x896: 0x0f2a, 0x897: 0x14da, 0x898: 0x0c62, 0x899: 0x0cb2, 0x89a: 0x0e3e, 0x89b: 0x102a, 0x89c: 0x15b6, 0x89d: 0x0912, 0x89e: 0x09fa, 0x89f: 0x0b92, 0x8a0: 0x0dce, 0x8a1: 0x0e1a, 0x8a2: 0x0e5a, 0x8a3: 0x0eee, 0x8a4: 0x1042, 0x8a5: 0x10b6, 0x8a6: 0x1252, 0x8a7: 0x13f2, 0x8a8: 0x13fe, 0x8a9: 0x1552, 0x8aa: 0x15d2, 0x8ab: 0x097e, 0x8ac: 0x0f46, 0x8ad: 0x09fe, 0x8ae: 0x0fc2, 0x8af: 0x1066, 0x8b0: 0x1382, 0x8b1: 0x15ba, 0x8b2: 0x16a6, 0x8b3: 0x16ce, 0x8b4: 0x0e32, 0x8b5: 0x0f22, 0x8b6: 0x12be, 0x8b7: 0x11b2, 0x8b8: 0x11be, 0x8b9: 0x11e2, 0x8ba: 0x1012, 0x8bb: 0x0f9a, 0x8bc: 0x145e, 0x8bd: 0x082e, 0x8be: 0x1326, 0x8bf: 0x0916, // Block 0x23, offset 0x8c0 0x8c0: 0x0906, 0x8c1: 0x0c06, 0x8c2: 0x0d26, 0x8c3: 0x11ee, 0x8c4: 0x0b4e, 0x8c5: 0x0efe, 0x8c6: 0x0dea, 0x8c7: 0x14e2, 0x8c8: 0x13e2, 0x8c9: 0x15a6, 0x8ca: 0x141e, 0x8cb: 0x0c22, 0x8cc: 0x0882, 0x8cd: 0x0a56, 0x8d0: 0x0aaa, 0x8d2: 0x0dda, 0x8d5: 0x08f2, 0x8d6: 0x101a, 0x8d7: 0x10de, 0x8d8: 0x1142, 0x8d9: 0x115e, 0x8da: 0x1162, 0x8db: 0x1176, 0x8dc: 0x15f6, 0x8dd: 0x11e6, 0x8de: 0x126a, 0x8e0: 0x138a, 0x8e2: 0x144e, 0x8e5: 0x1502, 0x8e6: 0x152e, 0x8ea: 0x164a, 0x8eb: 0x164e, 0x8ec: 0x1652, 0x8ed: 0x16b6, 0x8ee: 0x1526, 0x8ef: 0x15c2, 0x8f0: 0x0852, 0x8f1: 0x0876, 0x8f2: 0x088a, 0x8f3: 0x0946, 0x8f4: 0x0952, 0x8f5: 0x0992, 0x8f6: 0x0a46, 0x8f7: 0x0a62, 0x8f8: 0x0a6a, 0x8f9: 0x0aa6, 0x8fa: 0x0ab2, 0x8fb: 0x0b8e, 0x8fc: 0x0b96, 0x8fd: 0x0c9e, 0x8fe: 0x0cc6, 0x8ff: 0x0cce, // Block 0x24, offset 0x900 0x900: 0x0ce6, 0x901: 0x0d92, 0x902: 0x0dc2, 0x903: 0x0de2, 0x904: 0x0e52, 0x905: 0x0f16, 0x906: 0x0f32, 0x907: 0x0f62, 0x908: 0x0fb6, 0x909: 0x0fd6, 0x90a: 0x104a, 0x90b: 0x112a, 0x90c: 0x1146, 0x90d: 0x114e, 0x90e: 0x114a, 0x90f: 0x1152, 0x910: 0x1156, 0x911: 0x115a, 0x912: 0x116e, 0x913: 0x1172, 0x914: 0x1196, 0x915: 0x11aa, 0x916: 0x11c6, 0x917: 0x122a, 0x918: 0x1232, 0x919: 0x123a, 0x91a: 0x124e, 0x91b: 0x1276, 0x91c: 0x12c6, 0x91d: 0x12fa, 0x91e: 0x12fa, 0x91f: 0x1362, 0x920: 0x140a, 0x921: 0x1422, 0x922: 0x1456, 0x923: 0x145a, 0x924: 0x149e, 0x925: 0x14a2, 0x926: 0x14fa, 0x927: 0x1502, 0x928: 0x15d6, 0x929: 0x161a, 0x92a: 0x1632, 0x92b: 0x0c96, 0x92c: 0x184b, 0x92d: 0x12de, 0x930: 0x07da, 0x931: 0x08de, 0x932: 0x089e, 0x933: 0x0846, 0x934: 0x0886, 0x935: 0x08b2, 0x936: 0x0942, 0x937: 0x095e, 0x938: 0x0a46, 0x939: 0x0a32, 0x93a: 0x0a42, 0x93b: 0x0a5e, 0x93c: 0x0aaa, 0x93d: 0x0aba, 0x93e: 0x0afe, 0x93f: 0x0b0a, // Block 0x25, offset 0x940 0x940: 0x0b26, 0x941: 0x0b36, 0x942: 0x0c1e, 0x943: 0x0c26, 0x944: 0x0c56, 0x945: 0x0c76, 0x946: 0x0ca6, 0x947: 0x0cbe, 0x948: 0x0cae, 0x949: 0x0cce, 0x94a: 0x0cc2, 0x94b: 0x0ce6, 0x94c: 0x0d02, 0x94d: 0x0d5a, 0x94e: 0x0d66, 0x94f: 0x0d6e, 0x950: 0x0d96, 0x951: 0x0dda, 0x952: 0x0e0a, 0x953: 0x0e0e, 0x954: 0x0e22, 0x955: 0x0ea2, 0x956: 0x0eb2, 0x957: 0x0f0a, 0x958: 0x0f56, 0x959: 0x0f4e, 0x95a: 0x0f62, 0x95b: 0x0f7e, 0x95c: 0x0fb6, 0x95d: 0x110e, 0x95e: 0x0fda, 0x95f: 0x100e, 0x960: 0x101a, 0x961: 0x105a, 0x962: 0x1076, 0x963: 0x109a, 0x964: 0x10be, 0x965: 0x10c2, 0x966: 0x10de, 0x967: 0x10e2, 0x968: 0x10f2, 0x969: 0x1106, 0x96a: 0x1102, 0x96b: 0x1132, 0x96c: 0x11ae, 0x96d: 0x11c6, 0x96e: 0x11de, 0x96f: 0x1216, 0x970: 0x122a, 0x971: 0x1246, 0x972: 0x1276, 0x973: 0x132a, 0x974: 0x1352, 0x975: 0x13c6, 0x976: 0x140e, 0x977: 0x141a, 0x978: 0x1422, 0x979: 0x143a, 0x97a: 0x144e, 0x97b: 0x143e, 0x97c: 0x1456, 0x97d: 0x1452, 0x97e: 0x144a, 0x97f: 0x145a, // Block 0x26, offset 0x980 0x980: 0x1466, 0x981: 0x14a2, 0x982: 0x14de, 0x983: 0x150e, 0x984: 0x1546, 0x985: 0x1566, 0x986: 0x15b2, 0x987: 0x15d6, 0x988: 0x15f6, 0x989: 0x160a, 0x98a: 0x161a, 0x98b: 0x1626, 0x98c: 0x1632, 0x98d: 0x1686, 0x98e: 0x1726, 0x98f: 0x17e2, 0x990: 0x17dd, 0x991: 0x180f, 0x992: 0x0702, 0x993: 0x072a, 0x994: 0x072e, 0x995: 0x1891, 0x996: 0x18be, 0x997: 0x1936, 0x998: 0x1712, 0x999: 0x1722, // Block 0x27, offset 0x9c0 0x9c0: 0x07f6, 0x9c1: 0x07ee, 0x9c2: 0x07fe, 0x9c3: 0x1774, 0x9c4: 0x0842, 0x9c5: 0x0852, 0x9c6: 0x0856, 0x9c7: 0x085e, 0x9c8: 0x0866, 0x9c9: 0x086a, 0x9ca: 0x0876, 0x9cb: 0x086e, 0x9cc: 0x06ae, 0x9cd: 0x1788, 0x9ce: 0x088a, 0x9cf: 0x088e, 0x9d0: 0x0892, 0x9d1: 0x08ae, 0x9d2: 0x1779, 0x9d3: 0x06b2, 0x9d4: 0x089a, 0x9d5: 0x08ba, 0x9d6: 0x1783, 0x9d7: 0x08ca, 0x9d8: 0x08d2, 0x9d9: 0x0832, 0x9da: 0x08da, 0x9db: 0x08de, 0x9dc: 0x195e, 0x9dd: 0x08fa, 0x9de: 0x0902, 0x9df: 0x06ba, 0x9e0: 0x091a, 0x9e1: 0x091e, 0x9e2: 0x0926, 0x9e3: 0x092a, 0x9e4: 0x06be, 0x9e5: 0x0942, 0x9e6: 0x0946, 0x9e7: 0x0952, 0x9e8: 0x095e, 0x9e9: 0x0962, 0x9ea: 0x0966, 0x9eb: 0x096e, 0x9ec: 0x098e, 0x9ed: 0x0992, 0x9ee: 0x099a, 0x9ef: 0x09aa, 0x9f0: 0x09b2, 0x9f1: 0x09b6, 0x9f2: 0x09b6, 0x9f3: 0x09b6, 0x9f4: 0x1797, 0x9f5: 0x0f8e, 0x9f6: 0x09ca, 0x9f7: 0x09d2, 0x9f8: 0x179c, 0x9f9: 0x09de, 0x9fa: 0x09e6, 0x9fb: 0x09ee, 0x9fc: 0x0a16, 0x9fd: 0x0a02, 0x9fe: 0x0a0e, 0x9ff: 0x0a12, // Block 0x28, offset 0xa00 0xa00: 0x0a1a, 0xa01: 0x0a22, 0xa02: 0x0a26, 0xa03: 0x0a2e, 0xa04: 0x0a36, 0xa05: 0x0a3a, 0xa06: 0x0a3a, 0xa07: 0x0a42, 0xa08: 0x0a4a, 0xa09: 0x0a4e, 0xa0a: 0x0a5a, 0xa0b: 0x0a7e, 0xa0c: 0x0a62, 0xa0d: 0x0a82, 0xa0e: 0x0a66, 0xa0f: 0x0a6e, 0xa10: 0x0906, 0xa11: 0x0aca, 0xa12: 0x0a92, 0xa13: 0x0a96, 0xa14: 0x0a9a, 0xa15: 0x0a8e, 0xa16: 0x0aa2, 0xa17: 0x0a9e, 0xa18: 0x0ab6, 0xa19: 0x17a1, 0xa1a: 0x0ad2, 0xa1b: 0x0ad6, 0xa1c: 0x0ade, 0xa1d: 0x0aea, 0xa1e: 0x0af2, 0xa1f: 0x0b0e, 0xa20: 0x17a6, 0xa21: 0x17ab, 0xa22: 0x0b1a, 0xa23: 0x0b1e, 0xa24: 0x0b22, 0xa25: 0x0b16, 0xa26: 0x0b2a, 0xa27: 0x06c2, 0xa28: 0x06c6, 0xa29: 0x0b32, 0xa2a: 0x0b3a, 0xa2b: 0x0b3a, 0xa2c: 0x17b0, 0xa2d: 0x0b56, 0xa2e: 0x0b5a, 0xa2f: 0x0b5e, 0xa30: 0x0b66, 0xa31: 0x17b5, 0xa32: 0x0b6e, 0xa33: 0x0b72, 0xa34: 0x0c4a, 0xa35: 0x0b7a, 0xa36: 0x06ca, 0xa37: 0x0b86, 0xa38: 0x0b96, 0xa39: 0x0ba2, 0xa3a: 0x0b9e, 0xa3b: 0x17bf, 0xa3c: 0x0baa, 0xa3d: 0x17c4, 0xa3e: 0x0bb6, 0xa3f: 0x0bb2, // Block 0x29, offset 0xa40 0xa40: 0x0bba, 0xa41: 0x0bca, 0xa42: 0x0bce, 0xa43: 0x06ce, 0xa44: 0x0bde, 0xa45: 0x0be6, 0xa46: 0x0bea, 0xa47: 0x0bee, 0xa48: 0x06d2, 0xa49: 0x17c9, 0xa4a: 0x06d6, 0xa4b: 0x0c0a, 0xa4c: 0x0c0e, 0xa4d: 0x0c12, 0xa4e: 0x0c1a, 0xa4f: 0x1990, 0xa50: 0x0c32, 0xa51: 0x17d3, 0xa52: 0x17d3, 0xa53: 0x12d2, 0xa54: 0x0c42, 0xa55: 0x0c42, 0xa56: 0x06da, 0xa57: 0x17f6, 0xa58: 0x18c8, 0xa59: 0x0c52, 0xa5a: 0x0c5a, 0xa5b: 0x06de, 0xa5c: 0x0c6e, 0xa5d: 0x0c7e, 0xa5e: 0x0c82, 0xa5f: 0x0c8a, 0xa60: 0x0c9a, 0xa61: 0x06e6, 0xa62: 0x06e2, 0xa63: 0x0c9e, 0xa64: 0x17d8, 0xa65: 0x0ca2, 0xa66: 0x0cb6, 0xa67: 0x0cba, 0xa68: 0x0cbe, 0xa69: 0x0cba, 0xa6a: 0x0cca, 0xa6b: 0x0cce, 0xa6c: 0x0cde, 0xa6d: 0x0cd6, 0xa6e: 0x0cda, 0xa6f: 0x0ce2, 0xa70: 0x0ce6, 0xa71: 0x0cea, 0xa72: 0x0cf6, 0xa73: 0x0cfa, 0xa74: 0x0d12, 0xa75: 0x0d1a, 0xa76: 0x0d2a, 0xa77: 0x0d3e, 0xa78: 0x17e7, 0xa79: 0x0d3a, 0xa7a: 0x0d2e, 0xa7b: 0x0d46, 0xa7c: 0x0d4e, 0xa7d: 0x0d62, 0xa7e: 0x17ec, 0xa7f: 0x0d6a, // Block 0x2a, offset 0xa80 0xa80: 0x0d5e, 0xa81: 0x0d56, 0xa82: 0x06ea, 0xa83: 0x0d72, 0xa84: 0x0d7a, 0xa85: 0x0d82, 0xa86: 0x0d76, 0xa87: 0x06ee, 0xa88: 0x0d92, 0xa89: 0x0d9a, 0xa8a: 0x17f1, 0xa8b: 0x0dc6, 0xa8c: 0x0dfa, 0xa8d: 0x0dd6, 0xa8e: 0x06fa, 0xa8f: 0x0de2, 0xa90: 0x06f6, 0xa91: 0x06f2, 0xa92: 0x08be, 0xa93: 0x08c2, 0xa94: 0x0dfe, 0xa95: 0x0de6, 0xa96: 0x12a6, 0xa97: 0x075e, 0xa98: 0x0e0a, 0xa99: 0x0e0e, 0xa9a: 0x0e12, 0xa9b: 0x0e26, 0xa9c: 0x0e1e, 0xa9d: 0x180a, 0xa9e: 0x06fe, 0xa9f: 0x0e3a, 0xaa0: 0x0e2e, 0xaa1: 0x0e4a, 0xaa2: 0x0e52, 0xaa3: 0x1814, 0xaa4: 0x0e56, 0xaa5: 0x0e42, 0xaa6: 0x0e5e, 0xaa7: 0x0702, 0xaa8: 0x0e62, 0xaa9: 0x0e66, 0xaaa: 0x0e6a, 0xaab: 0x0e76, 0xaac: 0x1819, 0xaad: 0x0e7e, 0xaae: 0x0706, 0xaaf: 0x0e8a, 0xab0: 0x181e, 0xab1: 0x0e8e, 0xab2: 0x070a, 0xab3: 0x0e9a, 0xab4: 0x0ea6, 0xab5: 0x0eb2, 0xab6: 0x0eb6, 0xab7: 0x1823, 0xab8: 0x17ba, 0xab9: 0x1828, 0xaba: 0x0ed6, 0xabb: 0x182d, 0xabc: 0x0ee2, 0xabd: 0x0eea, 0xabe: 0x0eda, 0xabf: 0x0ef6, // Block 0x2b, offset 0xac0 0xac0: 0x0f06, 0xac1: 0x0f16, 0xac2: 0x0f0a, 0xac3: 0x0f0e, 0xac4: 0x0f1a, 0xac5: 0x0f1e, 0xac6: 0x1832, 0xac7: 0x0f02, 0xac8: 0x0f36, 0xac9: 0x0f3a, 0xaca: 0x070e, 0xacb: 0x0f4e, 0xacc: 0x0f4a, 0xacd: 0x1837, 0xace: 0x0f2e, 0xacf: 0x0f6a, 0xad0: 0x183c, 0xad1: 0x1841, 0xad2: 0x0f6e, 0xad3: 0x0f82, 0xad4: 0x0f7e, 0xad5: 0x0f7a, 0xad6: 0x0712, 0xad7: 0x0f86, 0xad8: 0x0f96, 0xad9: 0x0f92, 0xada: 0x0f9e, 0xadb: 0x177e, 0xadc: 0x0fae, 0xadd: 0x1846, 0xade: 0x0fba, 0xadf: 0x1850, 0xae0: 0x0fce, 0xae1: 0x0fda, 0xae2: 0x0fee, 0xae3: 0x1855, 0xae4: 0x1002, 0xae5: 0x1006, 0xae6: 0x185a, 0xae7: 0x185f, 0xae8: 0x1022, 0xae9: 0x1032, 0xaea: 0x0716, 0xaeb: 0x1036, 0xaec: 0x071a, 0xaed: 0x071a, 0xaee: 0x104e, 0xaef: 0x1052, 0xaf0: 0x105a, 0xaf1: 0x105e, 0xaf2: 0x106a, 0xaf3: 0x071e, 0xaf4: 0x1082, 0xaf5: 0x1864, 0xaf6: 0x109e, 0xaf7: 0x1869, 0xaf8: 0x10aa, 0xaf9: 0x17ce, 0xafa: 0x10ba, 0xafb: 0x186e, 0xafc: 0x1873, 0xafd: 0x1878, 0xafe: 0x0722, 0xaff: 0x0726, // Block 0x2c, offset 0xb00 0xb00: 0x10f2, 0xb01: 0x1882, 0xb02: 0x187d, 0xb03: 0x1887, 0xb04: 0x188c, 0xb05: 0x10fa, 0xb06: 0x10fe, 0xb07: 0x10fe, 0xb08: 0x1106, 0xb09: 0x072e, 0xb0a: 0x110a, 0xb0b: 0x0732, 0xb0c: 0x0736, 0xb0d: 0x1896, 0xb0e: 0x111e, 0xb0f: 0x1126, 0xb10: 0x1132, 0xb11: 0x073a, 0xb12: 0x189b, 0xb13: 0x1156, 0xb14: 0x18a0, 0xb15: 0x18a5, 0xb16: 0x1176, 0xb17: 0x118e, 0xb18: 0x073e, 0xb19: 0x1196, 0xb1a: 0x119a, 0xb1b: 0x119e, 0xb1c: 0x18aa, 0xb1d: 0x18af, 0xb1e: 0x18af, 0xb1f: 0x11b6, 0xb20: 0x0742, 0xb21: 0x18b4, 0xb22: 0x11ca, 0xb23: 0x11ce, 0xb24: 0x0746, 0xb25: 0x18b9, 0xb26: 0x11ea, 0xb27: 0x074a, 0xb28: 0x11fa, 0xb29: 0x11f2, 0xb2a: 0x1202, 0xb2b: 0x18c3, 0xb2c: 0x121a, 0xb2d: 0x074e, 0xb2e: 0x1226, 0xb2f: 0x122e, 0xb30: 0x123e, 0xb31: 0x0752, 0xb32: 0x18cd, 0xb33: 0x18d2, 0xb34: 0x0756, 0xb35: 0x18d7, 0xb36: 0x1256, 0xb37: 0x18dc, 0xb38: 0x1262, 0xb39: 0x126e, 0xb3a: 0x1276, 0xb3b: 0x18e1, 0xb3c: 0x18e6, 0xb3d: 0x128a, 0xb3e: 0x18eb, 0xb3f: 0x1292, // Block 0x2d, offset 0xb40 0xb40: 0x17fb, 0xb41: 0x075a, 0xb42: 0x12aa, 0xb43: 0x12ae, 0xb44: 0x0762, 0xb45: 0x12b2, 0xb46: 0x0b2e, 0xb47: 0x18f0, 0xb48: 0x18f5, 0xb49: 0x1800, 0xb4a: 0x1805, 0xb4b: 0x12d2, 0xb4c: 0x12d6, 0xb4d: 0x14ee, 0xb4e: 0x0766, 0xb4f: 0x1302, 0xb50: 0x12fe, 0xb51: 0x1306, 0xb52: 0x093a, 0xb53: 0x130a, 0xb54: 0x130e, 0xb55: 0x1312, 0xb56: 0x131a, 0xb57: 0x18fa, 0xb58: 0x1316, 0xb59: 0x131e, 0xb5a: 0x1332, 0xb5b: 0x1336, 0xb5c: 0x1322, 0xb5d: 0x133a, 0xb5e: 0x134e, 0xb5f: 0x1362, 0xb60: 0x132e, 0xb61: 0x1342, 0xb62: 0x1346, 0xb63: 0x134a, 0xb64: 0x18ff, 0xb65: 0x1909, 0xb66: 0x1904, 0xb67: 0x076a, 0xb68: 0x136a, 0xb69: 0x136e, 0xb6a: 0x1376, 0xb6b: 0x191d, 0xb6c: 0x137a, 0xb6d: 0x190e, 0xb6e: 0x076e, 0xb6f: 0x0772, 0xb70: 0x1913, 0xb71: 0x1918, 0xb72: 0x0776, 0xb73: 0x139a, 0xb74: 0x139e, 0xb75: 0x13a2, 0xb76: 0x13a6, 0xb77: 0x13b2, 0xb78: 0x13ae, 0xb79: 0x13ba, 0xb7a: 0x13b6, 0xb7b: 0x13c6, 0xb7c: 0x13be, 0xb7d: 0x13c2, 0xb7e: 0x13ca, 0xb7f: 0x077a, // Block 0x2e, offset 0xb80 0xb80: 0x13d2, 0xb81: 0x13d6, 0xb82: 0x077e, 0xb83: 0x13e6, 0xb84: 0x13ea, 0xb85: 0x1922, 0xb86: 0x13f6, 0xb87: 0x13fa, 0xb88: 0x0782, 0xb89: 0x1406, 0xb8a: 0x06b6, 0xb8b: 0x1927, 0xb8c: 0x192c, 0xb8d: 0x0786, 0xb8e: 0x078a, 0xb8f: 0x1432, 0xb90: 0x144a, 0xb91: 0x1466, 0xb92: 0x1476, 0xb93: 0x1931, 0xb94: 0x148a, 0xb95: 0x148e, 0xb96: 0x14a6, 0xb97: 0x14b2, 0xb98: 0x193b, 0xb99: 0x178d, 0xb9a: 0x14be, 0xb9b: 0x14ba, 0xb9c: 0x14c6, 0xb9d: 0x1792, 0xb9e: 0x14d2, 0xb9f: 0x14de, 0xba0: 0x1940, 0xba1: 0x1945, 0xba2: 0x151e, 0xba3: 0x152a, 0xba4: 0x1532, 0xba5: 0x194a, 0xba6: 0x1536, 0xba7: 0x1562, 0xba8: 0x156e, 0xba9: 0x1572, 0xbaa: 0x156a, 0xbab: 0x157e, 0xbac: 0x1582, 0xbad: 0x194f, 0xbae: 0x158e, 0xbaf: 0x078e, 0xbb0: 0x1596, 0xbb1: 0x1954, 0xbb2: 0x0792, 0xbb3: 0x15ce, 0xbb4: 0x0bbe, 0xbb5: 0x15e6, 0xbb6: 0x1959, 0xbb7: 0x1963, 0xbb8: 0x0796, 0xbb9: 0x079a, 0xbba: 0x160e, 0xbbb: 0x1968, 0xbbc: 0x079e, 0xbbd: 0x196d, 0xbbe: 0x1626, 0xbbf: 0x1626, // Block 0x2f, offset 0xbc0 0xbc0: 0x162e, 0xbc1: 0x1972, 0xbc2: 0x1646, 0xbc3: 0x07a2, 0xbc4: 0x1656, 0xbc5: 0x1662, 0xbc6: 0x166a, 0xbc7: 0x1672, 0xbc8: 0x07a6, 0xbc9: 0x1977, 0xbca: 0x1686, 0xbcb: 0x16a2, 0xbcc: 0x16ae, 0xbcd: 0x07aa, 0xbce: 0x07ae, 0xbcf: 0x16b2, 0xbd0: 0x197c, 0xbd1: 0x07b2, 0xbd2: 0x1981, 0xbd3: 0x1986, 0xbd4: 0x198b, 0xbd5: 0x16d6, 0xbd6: 0x07b6, 0xbd7: 0x16ea, 0xbd8: 0x16f2, 0xbd9: 0x16f6, 0xbda: 0x16fe, 0xbdb: 0x1706, 0xbdc: 0x170e, 0xbdd: 0x1995, } // nfcIndex: 22 blocks, 1408 entries, 1408 bytes // Block 0 is the zero block. var nfcIndex = [1408]uint8{ // Block 0x0, offset 0x0 // Block 0x1, offset 0x40 // Block 0x2, offset 0x80 // Block 0x3, offset 0xc0 0xc2: 0x2e, 0xc3: 0x01, 0xc4: 0x02, 0xc5: 0x03, 0xc6: 0x2f, 0xc7: 0x04, 0xc8: 0x05, 0xca: 0x30, 0xcb: 0x31, 0xcc: 0x06, 0xcd: 0x07, 0xce: 0x08, 0xcf: 0x32, 0xd0: 0x09, 0xd1: 0x33, 0xd2: 0x34, 0xd3: 0x0a, 0xd6: 0x0b, 0xd7: 0x35, 0xd8: 0x36, 0xd9: 0x0c, 0xdb: 0x37, 0xdc: 0x38, 0xdd: 0x39, 0xdf: 0x3a, 0xe0: 0x02, 0xe1: 0x03, 0xe2: 0x04, 0xe3: 0x05, 0xea: 0x06, 0xeb: 0x07, 0xec: 0x08, 0xed: 0x09, 0xef: 0x0a, 0xf0: 0x13, // Block 0x4, offset 0x100 0x120: 0x3b, 0x121: 0x3c, 0x122: 0x3d, 0x123: 0x0d, 0x124: 0x3e, 0x125: 0x3f, 0x126: 0x40, 0x127: 0x41, 0x128: 0x42, 0x129: 0x43, 0x12a: 0x44, 0x12b: 0x45, 0x12c: 0x40, 0x12d: 0x46, 0x12e: 0x47, 0x12f: 0x48, 0x130: 0x44, 0x131: 0x49, 0x132: 0x4a, 0x133: 0x4b, 0x134: 0x4c, 0x135: 0x4d, 0x137: 0x4e, 0x138: 0x4f, 0x139: 0x50, 0x13a: 0x51, 0x13b: 0x52, 0x13c: 0x53, 0x13d: 0x54, 0x13e: 0x55, 0x13f: 0x56, // Block 0x5, offset 0x140 0x140: 0x57, 0x142: 0x58, 0x144: 0x59, 0x145: 0x5a, 0x146: 0x5b, 0x147: 0x5c, 0x14d: 0x5d, 0x15c: 0x5e, 0x15f: 0x5f, 0x162: 0x60, 0x164: 0x61, 0x168: 0x62, 0x169: 0x63, 0x16a: 0x64, 0x16b: 0x65, 0x16c: 0x0e, 0x16d: 0x66, 0x16e: 0x67, 0x16f: 0x68, 0x170: 0x69, 0x173: 0x6a, 0x177: 0x0f, 0x178: 0x10, 0x179: 0x11, 0x17a: 0x12, 0x17b: 0x13, 0x17c: 0x14, 0x17d: 0x15, 0x17e: 0x16, 0x17f: 0x17, // Block 0x6, offset 0x180 0x180: 0x6b, 0x183: 0x6c, 0x184: 0x6d, 0x186: 0x6e, 0x187: 0x6f, 0x188: 0x70, 0x189: 0x18, 0x18a: 0x19, 0x18b: 0x71, 0x18c: 0x72, 0x1ab: 0x73, 0x1b3: 0x74, 0x1b5: 0x75, 0x1b7: 0x76, // Block 0x7, offset 0x1c0 0x1c0: 0x77, 0x1c1: 0x1a, 0x1c2: 0x1b, 0x1c3: 0x1c, 0x1c4: 0x78, 0x1c5: 0x79, 0x1c9: 0x7a, 0x1cc: 0x7b, 0x1cd: 0x7c, // Block 0x8, offset 0x200 0x219: 0x7d, 0x21a: 0x7e, 0x21b: 0x7f, 0x220: 0x80, 0x223: 0x81, 0x224: 0x82, 0x225: 0x83, 0x226: 0x84, 0x227: 0x85, 0x22a: 0x86, 0x22b: 0x87, 0x22f: 0x88, 0x230: 0x89, 0x231: 0x8a, 0x232: 0x8b, 0x233: 0x8c, 0x234: 0x8d, 0x235: 0x8e, 0x236: 0x8f, 0x237: 0x89, 0x238: 0x8a, 0x239: 0x8b, 0x23a: 0x8c, 0x23b: 0x8d, 0x23c: 0x8e, 0x23d: 0x8f, 0x23e: 0x89, 0x23f: 0x8a, // Block 0x9, offset 0x240 0x240: 0x8b, 0x241: 0x8c, 0x242: 0x8d, 0x243: 0x8e, 0x244: 0x8f, 0x245: 0x89, 0x246: 0x8a, 0x247: 0x8b, 0x248: 0x8c, 0x249: 0x8d, 0x24a: 0x8e, 0x24b: 0x8f, 0x24c: 0x89, 0x24d: 0x8a, 0x24e: 0x8b, 0x24f: 0x8c, 0x250: 0x8d, 0x251: 0x8e, 0x252: 0x8f, 0x253: 0x89, 0x254: 0x8a, 0x255: 0x8b, 0x256: 0x8c, 0x257: 0x8d, 0x258: 0x8e, 0x259: 0x8f, 0x25a: 0x89, 0x25b: 0x8a, 0x25c: 0x8b, 0x25d: 0x8c, 0x25e: 0x8d, 0x25f: 0x8e, 0x260: 0x8f, 0x261: 0x89, 0x262: 0x8a, 0x263: 0x8b, 0x264: 0x8c, 0x265: 0x8d, 0x266: 0x8e, 0x267: 0x8f, 0x268: 0x89, 0x269: 0x8a, 0x26a: 0x8b, 0x26b: 0x8c, 0x26c: 0x8d, 0x26d: 0x8e, 0x26e: 0x8f, 0x26f: 0x89, 0x270: 0x8a, 0x271: 0x8b, 0x272: 0x8c, 0x273: 0x8d, 0x274: 0x8e, 0x275: 0x8f, 0x276: 0x89, 0x277: 0x8a, 0x278: 0x8b, 0x279: 0x8c, 0x27a: 0x8d, 0x27b: 0x8e, 0x27c: 0x8f, 0x27d: 0x89, 0x27e: 0x8a, 0x27f: 0x8b, // Block 0xa, offset 0x280 0x280: 0x8c, 0x281: 0x8d, 0x282: 0x8e, 0x283: 0x8f, 0x284: 0x89, 0x285: 0x8a, 0x286: 0x8b, 0x287: 0x8c, 0x288: 0x8d, 0x289: 0x8e, 0x28a: 0x8f, 0x28b: 0x89, 0x28c: 0x8a, 0x28d: 0x8b, 0x28e: 0x8c, 0x28f: 0x8d, 0x290: 0x8e, 0x291: 0x8f, 0x292: 0x89, 0x293: 0x8a, 0x294: 0x8b, 0x295: 0x8c, 0x296: 0x8d, 0x297: 0x8e, 0x298: 0x8f, 0x299: 0x89, 0x29a: 0x8a, 0x29b: 0x8b, 0x29c: 0x8c, 0x29d: 0x8d, 0x29e: 0x8e, 0x29f: 0x8f, 0x2a0: 0x89, 0x2a1: 0x8a, 0x2a2: 0x8b, 0x2a3: 0x8c, 0x2a4: 0x8d, 0x2a5: 0x8e, 0x2a6: 0x8f, 0x2a7: 0x89, 0x2a8: 0x8a, 0x2a9: 0x8b, 0x2aa: 0x8c, 0x2ab: 0x8d, 0x2ac: 0x8e, 0x2ad: 0x8f, 0x2ae: 0x89, 0x2af: 0x8a, 0x2b0: 0x8b, 0x2b1: 0x8c, 0x2b2: 0x8d, 0x2b3: 0x8e, 0x2b4: 0x8f, 0x2b5: 0x89, 0x2b6: 0x8a, 0x2b7: 0x8b, 0x2b8: 0x8c, 0x2b9: 0x8d, 0x2ba: 0x8e, 0x2bb: 0x8f, 0x2bc: 0x89, 0x2bd: 0x8a, 0x2be: 0x8b, 0x2bf: 0x8c, // Block 0xb, offset 0x2c0 0x2c0: 0x8d, 0x2c1: 0x8e, 0x2c2: 0x8f, 0x2c3: 0x89, 0x2c4: 0x8a, 0x2c5: 0x8b, 0x2c6: 0x8c, 0x2c7: 0x8d, 0x2c8: 0x8e, 0x2c9: 0x8f, 0x2ca: 0x89, 0x2cb: 0x8a, 0x2cc: 0x8b, 0x2cd: 0x8c, 0x2ce: 0x8d, 0x2cf: 0x8e, 0x2d0: 0x8f, 0x2d1: 0x89, 0x2d2: 0x8a, 0x2d3: 0x8b, 0x2d4: 0x8c, 0x2d5: 0x8d, 0x2d6: 0x8e, 0x2d7: 0x8f, 0x2d8: 0x89, 0x2d9: 0x8a, 0x2da: 0x8b, 0x2db: 0x8c, 0x2dc: 0x8d, 0x2dd: 0x8e, 0x2de: 0x90, // Block 0xc, offset 0x300 0x324: 0x1d, 0x325: 0x1e, 0x326: 0x1f, 0x327: 0x20, 0x328: 0x21, 0x329: 0x22, 0x32a: 0x23, 0x32b: 0x24, 0x32c: 0x91, 0x32d: 0x92, 0x32e: 0x93, 0x331: 0x94, 0x332: 0x95, 0x333: 0x96, 0x334: 0x97, 0x338: 0x98, 0x339: 0x99, 0x33a: 0x9a, 0x33b: 0x9b, 0x33e: 0x9c, 0x33f: 0x9d, // Block 0xd, offset 0x340 0x347: 0x9e, 0x34b: 0x9f, 0x34d: 0xa0, 0x368: 0xa1, 0x36b: 0xa2, 0x374: 0xa3, 0x37a: 0xa4, 0x37b: 0xa5, 0x37d: 0xa6, 0x37e: 0xa7, // Block 0xe, offset 0x380 0x381: 0xa8, 0x382: 0xa9, 0x384: 0xaa, 0x385: 0x84, 0x387: 0xab, 0x388: 0xac, 0x38b: 0xad, 0x38c: 0xae, 0x38d: 0xaf, 0x391: 0xb0, 0x392: 0xb1, 0x393: 0xb2, 0x396: 0xb3, 0x397: 0xb4, 0x398: 0x75, 0x39a: 0xb5, 0x39c: 0xb6, 0x3a0: 0xb7, 0x3a4: 0xb8, 0x3a5: 0xb9, 0x3a7: 0xba, 0x3a8: 0xbb, 0x3a9: 0xbc, 0x3aa: 0xbd, 0x3b0: 0x75, 0x3b5: 0xbe, 0x3b6: 0xbf, 0x3bd: 0xc0, // Block 0xf, offset 0x3c0 0x3eb: 0xc1, 0x3ec: 0xc2, 0x3ff: 0xc3, // Block 0x10, offset 0x400 0x432: 0xc4, // Block 0x11, offset 0x440 0x445: 0xc5, 0x446: 0xc6, 0x447: 0xc7, 0x449: 0xc8, // Block 0x12, offset 0x480 0x480: 0xc9, 0x482: 0xca, 0x484: 0xc2, 0x48a: 0xcb, 0x48b: 0xcc, 0x493: 0xcd, 0x4a3: 0xce, 0x4a5: 0xcf, // Block 0x13, offset 0x4c0 0x4c8: 0xd0, // Block 0x14, offset 0x500 0x520: 0x25, 0x521: 0x26, 0x522: 0x27, 0x523: 0x28, 0x524: 0x29, 0x525: 0x2a, 0x526: 0x2b, 0x527: 0x2c, 0x528: 0x2d, // Block 0x15, offset 0x540 0x550: 0x0b, 0x551: 0x0c, 0x556: 0x0d, 0x55b: 0x0e, 0x55d: 0x0f, 0x55e: 0x10, 0x55f: 0x11, 0x56f: 0x12, } // nfcSparseOffset: 163 entries, 326 bytes var nfcSparseOffset = []uint16{0x0, 0x5, 0x9, 0xb, 0xd, 0x18, 0x28, 0x2a, 0x2f, 0x3a, 0x49, 0x56, 0x5e, 0x63, 0x68, 0x6a, 0x6e, 0x76, 0x7d, 0x80, 0x88, 0x8c, 0x90, 0x92, 0x94, 0x9d, 0xa1, 0xa8, 0xad, 0xb0, 0xba, 0xbd, 0xc4, 0xcc, 0xcf, 0xd1, 0xd4, 0xd6, 0xdb, 0xec, 0xf8, 0xfa, 0x100, 0x102, 0x104, 0x106, 0x108, 0x10a, 0x10c, 0x10f, 0x112, 0x114, 0x117, 0x11a, 0x11e, 0x124, 0x12b, 0x134, 0x136, 0x139, 0x13b, 0x146, 0x14a, 0x158, 0x15b, 0x161, 0x167, 0x172, 0x176, 0x178, 0x17a, 0x17c, 0x17e, 0x180, 0x186, 0x18a, 0x18c, 0x18e, 0x196, 0x19a, 0x19d, 0x19f, 0x1a1, 0x1a4, 0x1a7, 0x1a9, 0x1ab, 0x1ad, 0x1af, 0x1b5, 0x1b8, 0x1ba, 0x1c1, 0x1c7, 0x1cd, 0x1d5, 0x1db, 0x1e1, 0x1e7, 0x1eb, 0x1f9, 0x202, 0x205, 0x208, 0x20a, 0x20d, 0x20f, 0x213, 0x218, 0x21a, 0x21c, 0x221, 0x227, 0x229, 0x22b, 0x22d, 0x233, 0x236, 0x238, 0x23a, 0x23c, 0x242, 0x246, 0x24a, 0x252, 0x259, 0x25c, 0x25f, 0x261, 0x264, 0x26c, 0x270, 0x277, 0x27a, 0x280, 0x282, 0x285, 0x287, 0x28a, 0x28f, 0x291, 0x293, 0x295, 0x297, 0x299, 0x29c, 0x29e, 0x2a0, 0x2a2, 0x2a4, 0x2a6, 0x2a8, 0x2b5, 0x2bf, 0x2c1, 0x2c3, 0x2c9, 0x2cb, 0x2cd, 0x2cf, 0x2d3, 0x2d5, 0x2d8} // nfcSparseValues: 730 entries, 2920 bytes var nfcSparseValues = [730]valueRange{ // Block 0x0, offset 0x0 {value: 0x0000, lo: 0x04}, {value: 0xa100, lo: 0xa8, hi: 0xa8}, {value: 0x8100, lo: 0xaf, hi: 0xaf}, {value: 0x8100, lo: 0xb4, hi: 0xb4}, {value: 0x8100, lo: 0xb8, hi: 0xb8}, // Block 0x1, offset 0x5 {value: 0x0091, lo: 0x03}, {value: 0x4813, lo: 0xa0, hi: 0xa1}, {value: 0x4845, lo: 0xaf, hi: 0xb0}, {value: 0xa000, lo: 0xb7, hi: 0xb7}, // Block 0x2, offset 0x9 {value: 0x0000, lo: 0x01}, {value: 0xa000, lo: 0x92, hi: 0x92}, // Block 0x3, offset 0xb {value: 0x0000, lo: 0x01}, {value: 0x8100, lo: 0x98, hi: 0x9d}, // Block 0x4, offset 0xd {value: 0x0006, lo: 0x0a}, {value: 0xa000, lo: 0x81, hi: 0x81}, {value: 0xa000, lo: 0x85, hi: 0x85}, {value: 0xa000, lo: 0x89, hi: 0x89}, {value: 0x4971, lo: 0x8a, hi: 0x8a}, {value: 0x498f, lo: 0x8b, hi: 0x8b}, {value: 0x3626, lo: 0x8c, hi: 0x8c}, {value: 0x363e, lo: 0x8d, hi: 0x8d}, {value: 0x49a7, lo: 0x8e, hi: 0x8e}, {value: 0xa000, lo: 0x92, hi: 0x92}, {value: 0x365c, lo: 0x93, hi: 0x94}, // Block 0x5, offset 0x18 {value: 0x0000, lo: 0x0f}, {value: 0xa000, lo: 0x83, hi: 0x83}, {value: 0xa000, lo: 0x87, hi: 0x87}, {value: 0xa000, lo: 0x8b, hi: 0x8b}, {value: 0xa000, lo: 0x8d, hi: 0x8d}, {value: 0x3704, lo: 0x90, hi: 0x90}, {value: 0x3710, lo: 0x91, hi: 0x91}, {value: 0x36fe, lo: 0x93, hi: 0x93}, {value: 0xa000, lo: 0x96, hi: 0x96}, {value: 0x3776, lo: 0x97, hi: 0x97}, {value: 0x3740, lo: 0x9c, hi: 0x9c}, {value: 0x3728, lo: 0x9d, hi: 0x9d}, {value: 0x3752, lo: 0x9e, hi: 0x9e}, {value: 0xa000, lo: 0xb4, hi: 0xb5}, {value: 0x377c, lo: 0xb6, hi: 0xb6}, {value: 0x3782, lo: 0xb7, hi: 0xb7}, // Block 0x6, offset 0x28 {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0x83, hi: 0x87}, // Block 0x7, offset 0x2a {value: 0x0001, lo: 0x04}, {value: 0x8114, lo: 0x81, hi: 0x82}, {value: 0x8133, lo: 0x84, hi: 0x84}, {value: 0x812e, lo: 0x85, hi: 0x85}, {value: 0x810e, lo: 0x87, hi: 0x87}, // Block 0x8, offset 0x2f {value: 0x0000, lo: 0x0a}, {value: 0x8133, lo: 0x90, hi: 0x97}, {value: 0x811a, lo: 0x98, hi: 0x98}, {value: 0x811b, lo: 0x99, hi: 0x99}, {value: 0x811c, lo: 0x9a, hi: 0x9a}, {value: 0x37a0, lo: 0xa2, hi: 0xa2}, {value: 0x37a6, lo: 0xa3, hi: 0xa3}, {value: 0x37b2, lo: 0xa4, hi: 0xa4}, {value: 0x37ac, lo: 0xa5, hi: 0xa5}, {value: 0x37b8, lo: 0xa6, hi: 0xa6}, {value: 0xa000, lo: 0xa7, hi: 0xa7}, // Block 0x9, offset 0x3a {value: 0x0000, lo: 0x0e}, {value: 0x37ca, lo: 0x80, hi: 0x80}, {value: 0xa000, lo: 0x81, hi: 0x81}, {value: 0x37be, lo: 0x82, hi: 0x82}, {value: 0xa000, lo: 0x92, hi: 0x92}, {value: 0x37c4, lo: 0x93, hi: 0x93}, {value: 0xa000, lo: 0x95, hi: 0x95}, {value: 0x8133, lo: 0x96, hi: 0x9c}, {value: 0x8133, lo: 0x9f, hi: 0xa2}, {value: 0x812e, lo: 0xa3, hi: 0xa3}, {value: 0x8133, lo: 0xa4, hi: 0xa4}, {value: 0x8133, lo: 0xa7, hi: 0xa8}, {value: 0x812e, lo: 0xaa, hi: 0xaa}, {value: 0x8133, lo: 0xab, hi: 0xac}, {value: 0x812e, lo: 0xad, hi: 0xad}, // Block 0xa, offset 0x49 {value: 0x0000, lo: 0x0c}, {value: 0x8120, lo: 0x91, hi: 0x91}, {value: 0x8133, lo: 0xb0, hi: 0xb0}, {value: 0x812e, lo: 0xb1, hi: 0xb1}, {value: 0x8133, lo: 0xb2, hi: 0xb3}, {value: 0x812e, lo: 0xb4, hi: 0xb4}, {value: 0x8133, lo: 0xb5, hi: 0xb6}, {value: 0x812e, lo: 0xb7, hi: 0xb9}, {value: 0x8133, lo: 0xba, hi: 0xba}, {value: 0x812e, lo: 0xbb, hi: 0xbc}, {value: 0x8133, lo: 0xbd, hi: 0xbd}, {value: 0x812e, lo: 0xbe, hi: 0xbe}, {value: 0x8133, lo: 0xbf, hi: 0xbf}, // Block 0xb, offset 0x56 {value: 0x0005, lo: 0x07}, {value: 0x8133, lo: 0x80, hi: 0x80}, {value: 0x8133, lo: 0x81, hi: 0x81}, {value: 0x812e, lo: 0x82, hi: 0x83}, {value: 0x812e, lo: 0x84, hi: 0x85}, {value: 0x812e, lo: 0x86, hi: 0x87}, {value: 0x812e, lo: 0x88, hi: 0x89}, {value: 0x8133, lo: 0x8a, hi: 0x8a}, // Block 0xc, offset 0x5e {value: 0x0000, lo: 0x04}, {value: 0x8133, lo: 0xab, hi: 0xb1}, {value: 0x812e, lo: 0xb2, hi: 0xb2}, {value: 0x8133, lo: 0xb3, hi: 0xb3}, {value: 0x812e, lo: 0xbd, hi: 0xbd}, // Block 0xd, offset 0x63 {value: 0x0000, lo: 0x04}, {value: 0x8133, lo: 0x96, hi: 0x99}, {value: 0x8133, lo: 0x9b, hi: 0xa3}, {value: 0x8133, lo: 0xa5, hi: 0xa7}, {value: 0x8133, lo: 0xa9, hi: 0xad}, // Block 0xe, offset 0x68 {value: 0x0000, lo: 0x01}, {value: 0x812e, lo: 0x99, hi: 0x9b}, // Block 0xf, offset 0x6a {value: 0x0000, lo: 0x03}, {value: 0x8133, lo: 0x98, hi: 0x98}, {value: 0x812e, lo: 0x99, hi: 0x9b}, {value: 0x8133, lo: 0x9c, hi: 0x9f}, // Block 0x10, offset 0x6e {value: 0x0000, lo: 0x07}, {value: 0xa000, lo: 0xa8, hi: 0xa8}, {value: 0x3e37, lo: 0xa9, hi: 0xa9}, {value: 0xa000, lo: 0xb0, hi: 0xb0}, {value: 0x3e3f, lo: 0xb1, hi: 0xb1}, {value: 0xa000, lo: 0xb3, hi: 0xb3}, {value: 0x3e47, lo: 0xb4, hi: 0xb4}, {value: 0x9903, lo: 0xbc, hi: 0xbc}, // Block 0x11, offset 0x76 {value: 0x0008, lo: 0x06}, {value: 0x8105, lo: 0x8d, hi: 0x8d}, {value: 0x8133, lo: 0x91, hi: 0x91}, {value: 0x812e, lo: 0x92, hi: 0x92}, {value: 0x8133, lo: 0x93, hi: 0x93}, {value: 0x8133, lo: 0x94, hi: 0x94}, {value: 0x45d5, lo: 0x98, hi: 0x9f}, // Block 0x12, offset 0x7d {value: 0x0000, lo: 0x02}, {value: 0x8103, lo: 0xbc, hi: 0xbc}, {value: 0x9900, lo: 0xbe, hi: 0xbe}, // Block 0x13, offset 0x80 {value: 0x0008, lo: 0x07}, {value: 0xa000, lo: 0x87, hi: 0x87}, {value: 0x3e4f, lo: 0x8b, hi: 0x8c}, {value: 0x8105, lo: 0x8d, hi: 0x8d}, {value: 0x9900, lo: 0x97, hi: 0x97}, {value: 0x4615, lo: 0x9c, hi: 0x9d}, {value: 0x4625, lo: 0x9f, hi: 0x9f}, {value: 0x8133, lo: 0xbe, hi: 0xbe}, // Block 0x14, offset 0x88 {value: 0x0000, lo: 0x03}, {value: 0x464d, lo: 0xb3, hi: 0xb3}, {value: 0x4655, lo: 0xb6, hi: 0xb6}, {value: 0x8103, lo: 0xbc, hi: 0xbc}, // Block 0x15, offset 0x8c {value: 0x0008, lo: 0x03}, {value: 0x8105, lo: 0x8d, hi: 0x8d}, {value: 0x462d, lo: 0x99, hi: 0x9b}, {value: 0x4645, lo: 0x9e, hi: 0x9e}, // Block 0x16, offset 0x90 {value: 0x0000, lo: 0x01}, {value: 0x8103, lo: 0xbc, hi: 0xbc}, // Block 0x17, offset 0x92 {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0x8d, hi: 0x8d}, // Block 0x18, offset 0x94 {value: 0x0000, lo: 0x08}, {value: 0xa000, lo: 0x87, hi: 0x87}, {value: 0x3e67, lo: 0x88, hi: 0x88}, {value: 0x3e5f, lo: 0x8b, hi: 0x8b}, {value: 0x3e6f, lo: 0x8c, hi: 0x8c}, {value: 0x8105, lo: 0x8d, hi: 0x8d}, {value: 0x9900, lo: 0x96, hi: 0x97}, {value: 0x465d, lo: 0x9c, hi: 0x9c}, {value: 0x4665, lo: 0x9d, hi: 0x9d}, // Block 0x19, offset 0x9d {value: 0x0000, lo: 0x03}, {value: 0xa000, lo: 0x92, hi: 0x92}, {value: 0x3e77, lo: 0x94, hi: 0x94}, {value: 0x9900, lo: 0xbe, hi: 0xbe}, // Block 0x1a, offset 0xa1 {value: 0x0000, lo: 0x06}, {value: 0xa000, lo: 0x86, hi: 0x87}, {value: 0x3e7f, lo: 0x8a, hi: 0x8a}, {value: 0x3e8f, lo: 0x8b, hi: 0x8b}, {value: 0x3e87, lo: 0x8c, hi: 0x8c}, {value: 0x8105, lo: 0x8d, hi: 0x8d}, {value: 0x9900, lo: 0x97, hi: 0x97}, // Block 0x1b, offset 0xa8 {value: 0x1801, lo: 0x04}, {value: 0xa000, lo: 0x86, hi: 0x86}, {value: 0x3e97, lo: 0x88, hi: 0x88}, {value: 0x8105, lo: 0x8d, hi: 0x8d}, {value: 0x8121, lo: 0x95, hi: 0x96}, // Block 0x1c, offset 0xad {value: 0x0000, lo: 0x02}, {value: 0x8103, lo: 0xbc, hi: 0xbc}, {value: 0xa000, lo: 0xbf, hi: 0xbf}, // Block 0x1d, offset 0xb0 {value: 0x0000, lo: 0x09}, {value: 0x3e9f, lo: 0x80, hi: 0x80}, {value: 0x9900, lo: 0x82, hi: 0x82}, {value: 0xa000, lo: 0x86, hi: 0x86}, {value: 0x3ea7, lo: 0x87, hi: 0x87}, {value: 0x3eaf, lo: 0x88, hi: 0x88}, {value: 0x4adf, lo: 0x8a, hi: 0x8a}, {value: 0x42f9, lo: 0x8b, hi: 0x8b}, {value: 0x8105, lo: 0x8d, hi: 0x8d}, {value: 0x9900, lo: 0x95, hi: 0x96}, // Block 0x1e, offset 0xba {value: 0x0000, lo: 0x02}, {value: 0x8105, lo: 0xbb, hi: 0xbc}, {value: 0x9900, lo: 0xbe, hi: 0xbe}, // Block 0x1f, offset 0xbd {value: 0x0000, lo: 0x06}, {value: 0xa000, lo: 0x86, hi: 0x87}, {value: 0x3eb7, lo: 0x8a, hi: 0x8a}, {value: 0x3ec7, lo: 0x8b, hi: 0x8b}, {value: 0x3ebf, lo: 0x8c, hi: 0x8c}, {value: 0x8105, lo: 0x8d, hi: 0x8d}, {value: 0x9900, lo: 0x97, hi: 0x97}, // Block 0x20, offset 0xc4 {value: 0x5a29, lo: 0x07}, {value: 0x9905, lo: 0x8a, hi: 0x8a}, {value: 0x9900, lo: 0x8f, hi: 0x8f}, {value: 0xa000, lo: 0x99, hi: 0x99}, {value: 0x3ecf, lo: 0x9a, hi: 0x9a}, {value: 0x4ae7, lo: 0x9c, hi: 0x9c}, {value: 0x4304, lo: 0x9d, hi: 0x9d}, {value: 0x3ed7, lo: 0x9e, hi: 0x9f}, // Block 0x21, offset 0xcc {value: 0x0000, lo: 0x02}, {value: 0x8123, lo: 0xb8, hi: 0xb9}, {value: 0x8105, lo: 0xba, hi: 0xba}, // Block 0x22, offset 0xcf {value: 0x0000, lo: 0x01}, {value: 0x8124, lo: 0x88, hi: 0x8b}, // Block 0x23, offset 0xd1 {value: 0x0000, lo: 0x02}, {value: 0x8125, lo: 0xb8, hi: 0xb9}, {value: 0x8105, lo: 0xba, hi: 0xba}, // Block 0x24, offset 0xd4 {value: 0x0000, lo: 0x01}, {value: 0x8126, lo: 0x88, hi: 0x8b}, // Block 0x25, offset 0xd6 {value: 0x0000, lo: 0x04}, {value: 0x812e, lo: 0x98, hi: 0x99}, {value: 0x812e, lo: 0xb5, hi: 0xb5}, {value: 0x812e, lo: 0xb7, hi: 0xb7}, {value: 0x812c, lo: 0xb9, hi: 0xb9}, // Block 0x26, offset 0xdb {value: 0x0000, lo: 0x10}, {value: 0x2774, lo: 0x83, hi: 0x83}, {value: 0x277b, lo: 0x8d, hi: 0x8d}, {value: 0x2782, lo: 0x92, hi: 0x92}, {value: 0x2789, lo: 0x97, hi: 0x97}, {value: 0x2790, lo: 0x9c, hi: 0x9c}, {value: 0x276d, lo: 0xa9, hi: 0xa9}, {value: 0x8127, lo: 0xb1, hi: 0xb1}, {value: 0x8128, lo: 0xb2, hi: 0xb2}, {value: 0x4bc5, lo: 0xb3, hi: 0xb3}, {value: 0x8129, lo: 0xb4, hi: 0xb4}, {value: 0x4bce, lo: 0xb5, hi: 0xb5}, {value: 0x466d, lo: 0xb6, hi: 0xb6}, {value: 0x8200, lo: 0xb7, hi: 0xb7}, {value: 0x4675, lo: 0xb8, hi: 0xb8}, {value: 0x8200, lo: 0xb9, hi: 0xb9}, {value: 0x8128, lo: 0xba, hi: 0xbd}, // Block 0x27, offset 0xec {value: 0x0000, lo: 0x0b}, {value: 0x8128, lo: 0x80, hi: 0x80}, {value: 0x4bd7, lo: 0x81, hi: 0x81}, {value: 0x8133, lo: 0x82, hi: 0x83}, {value: 0x8105, lo: 0x84, hi: 0x84}, {value: 0x8133, lo: 0x86, hi: 0x87}, {value: 0x279e, lo: 0x93, hi: 0x93}, {value: 0x27a5, lo: 0x9d, hi: 0x9d}, {value: 0x27ac, lo: 0xa2, hi: 0xa2}, {value: 0x27b3, lo: 0xa7, hi: 0xa7}, {value: 0x27ba, lo: 0xac, hi: 0xac}, {value: 0x2797, lo: 0xb9, hi: 0xb9}, // Block 0x28, offset 0xf8 {value: 0x0000, lo: 0x01}, {value: 0x812e, lo: 0x86, hi: 0x86}, // Block 0x29, offset 0xfa {value: 0x0000, lo: 0x05}, {value: 0xa000, lo: 0xa5, hi: 0xa5}, {value: 0x3edf, lo: 0xa6, hi: 0xa6}, {value: 0x9900, lo: 0xae, hi: 0xae}, {value: 0x8103, lo: 0xb7, hi: 0xb7}, {value: 0x8105, lo: 0xb9, hi: 0xba}, // Block 0x2a, offset 0x100 {value: 0x0000, lo: 0x01}, {value: 0x812e, lo: 0x8d, hi: 0x8d}, // Block 0x2b, offset 0x102 {value: 0x0000, lo: 0x01}, {value: 0xa000, lo: 0x80, hi: 0x92}, // Block 0x2c, offset 0x104 {value: 0x0000, lo: 0x01}, {value: 0xb900, lo: 0xa1, hi: 0xb5}, // Block 0x2d, offset 0x106 {value: 0x0000, lo: 0x01}, {value: 0x9900, lo: 0xa8, hi: 0xbf}, // Block 0x2e, offset 0x108 {value: 0x0000, lo: 0x01}, {value: 0x9900, lo: 0x80, hi: 0x82}, // Block 0x2f, offset 0x10a {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0x9d, hi: 0x9f}, // Block 0x30, offset 0x10c {value: 0x0000, lo: 0x02}, {value: 0x8105, lo: 0x94, hi: 0x95}, {value: 0x8105, lo: 0xb4, hi: 0xb4}, // Block 0x31, offset 0x10f {value: 0x0000, lo: 0x02}, {value: 0x8105, lo: 0x92, hi: 0x92}, {value: 0x8133, lo: 0x9d, hi: 0x9d}, // Block 0x32, offset 0x112 {value: 0x0000, lo: 0x01}, {value: 0x8132, lo: 0xa9, hi: 0xa9}, // Block 0x33, offset 0x114 {value: 0x0004, lo: 0x02}, {value: 0x812f, lo: 0xb9, hi: 0xba}, {value: 0x812e, lo: 0xbb, hi: 0xbb}, // Block 0x34, offset 0x117 {value: 0x0000, lo: 0x02}, {value: 0x8133, lo: 0x97, hi: 0x97}, {value: 0x812e, lo: 0x98, hi: 0x98}, // Block 0x35, offset 0x11a {value: 0x0000, lo: 0x03}, {value: 0x8105, lo: 0xa0, hi: 0xa0}, {value: 0x8133, lo: 0xb5, hi: 0xbc}, {value: 0x812e, lo: 0xbf, hi: 0xbf}, // Block 0x36, offset 0x11e {value: 0x0000, lo: 0x05}, {value: 0x8133, lo: 0xb0, hi: 0xb4}, {value: 0x812e, lo: 0xb5, hi: 0xba}, {value: 0x8133, lo: 0xbb, hi: 0xbc}, {value: 0x812e, lo: 0xbd, hi: 0xbd}, {value: 0x812e, lo: 0xbf, hi: 0xbf}, // Block 0x37, offset 0x124 {value: 0x0000, lo: 0x06}, {value: 0x812e, lo: 0x80, hi: 0x80}, {value: 0x8133, lo: 0x81, hi: 0x82}, {value: 0x812e, lo: 0x83, hi: 0x84}, {value: 0x8133, lo: 0x85, hi: 0x89}, {value: 0x812e, lo: 0x8a, hi: 0x8a}, {value: 0x8133, lo: 0x8b, hi: 0x8e}, // Block 0x38, offset 0x12b {value: 0x0000, lo: 0x08}, {value: 0x3f27, lo: 0x80, hi: 0x80}, {value: 0x3f2f, lo: 0x81, hi: 0x81}, {value: 0xa000, lo: 0x82, hi: 0x82}, {value: 0x3f37, lo: 0x83, hi: 0x83}, {value: 0x8105, lo: 0x84, hi: 0x84}, {value: 0x8133, lo: 0xab, hi: 0xab}, {value: 0x812e, lo: 0xac, hi: 0xac}, {value: 0x8133, lo: 0xad, hi: 0xb3}, // Block 0x39, offset 0x134 {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0xaa, hi: 0xab}, // Block 0x3a, offset 0x136 {value: 0x0000, lo: 0x02}, {value: 0x8103, lo: 0xa6, hi: 0xa6}, {value: 0x8105, lo: 0xb2, hi: 0xb3}, // Block 0x3b, offset 0x139 {value: 0x0000, lo: 0x01}, {value: 0x8103, lo: 0xb7, hi: 0xb7}, // Block 0x3c, offset 0x13b {value: 0x0000, lo: 0x0a}, {value: 0x8133, lo: 0x90, hi: 0x92}, {value: 0x8101, lo: 0x94, hi: 0x94}, {value: 0x812e, lo: 0x95, hi: 0x99}, {value: 0x8133, lo: 0x9a, hi: 0x9b}, {value: 0x812e, lo: 0x9c, hi: 0x9f}, {value: 0x8133, lo: 0xa0, hi: 0xa0}, {value: 0x8101, lo: 0xa2, hi: 0xa8}, {value: 0x812e, lo: 0xad, hi: 0xad}, {value: 0x8133, lo: 0xb4, hi: 0xb4}, {value: 0x8133, lo: 0xb8, hi: 0xb9}, // Block 0x3d, offset 0x146 {value: 0x0004, lo: 0x03}, {value: 0x052a, lo: 0x80, hi: 0x81}, {value: 0x8100, lo: 0x97, hi: 0x97}, {value: 0x8100, lo: 0xbe, hi: 0xbe}, // Block 0x3e, offset 0x14a {value: 0x0000, lo: 0x0d}, {value: 0x8133, lo: 0x90, hi: 0x91}, {value: 0x8101, lo: 0x92, hi: 0x93}, {value: 0x8133, lo: 0x94, hi: 0x97}, {value: 0x8101, lo: 0x98, hi: 0x9a}, {value: 0x8133, lo: 0x9b, hi: 0x9c}, {value: 0x8133, lo: 0xa1, hi: 0xa1}, {value: 0x8101, lo: 0xa5, hi: 0xa6}, {value: 0x8133, lo: 0xa7, hi: 0xa7}, {value: 0x812e, lo: 0xa8, hi: 0xa8}, {value: 0x8133, lo: 0xa9, hi: 0xa9}, {value: 0x8101, lo: 0xaa, hi: 0xab}, {value: 0x812e, lo: 0xac, hi: 0xaf}, {value: 0x8133, lo: 0xb0, hi: 0xb0}, // Block 0x3f, offset 0x158 {value: 0x4334, lo: 0x02}, {value: 0x023c, lo: 0xa6, hi: 0xa6}, {value: 0x0057, lo: 0xaa, hi: 0xab}, // Block 0x40, offset 0x15b {value: 0x0007, lo: 0x05}, {value: 0xa000, lo: 0x90, hi: 0x90}, {value: 0xa000, lo: 0x92, hi: 0x92}, {value: 0xa000, lo: 0x94, hi: 0x94}, {value: 0x3b18, lo: 0x9a, hi: 0x9b}, {value: 0x3b26, lo: 0xae, hi: 0xae}, // Block 0x41, offset 0x161 {value: 0x000e, lo: 0x05}, {value: 0x3b2d, lo: 0x8d, hi: 0x8e}, {value: 0x3b34, lo: 0x8f, hi: 0x8f}, {value: 0xa000, lo: 0x90, hi: 0x90}, {value: 0xa000, lo: 0x92, hi: 0x92}, {value: 0xa000, lo: 0x94, hi: 0x94}, // Block 0x42, offset 0x167 {value: 0x64a9, lo: 0x0a}, {value: 0xa000, lo: 0x83, hi: 0x83}, {value: 0x3b42, lo: 0x84, hi: 0x84}, {value: 0xa000, lo: 0x88, hi: 0x88}, {value: 0x3b49, lo: 0x89, hi: 0x89}, {value: 0xa000, lo: 0x8b, hi: 0x8b}, {value: 0x3b50, lo: 0x8c, hi: 0x8c}, {value: 0xa000, lo: 0xa3, hi: 0xa3}, {value: 0x3b57, lo: 0xa4, hi: 0xa5}, {value: 0x3b5e, lo: 0xa6, hi: 0xa6}, {value: 0xa000, lo: 0xbc, hi: 0xbc}, // Block 0x43, offset 0x172 {value: 0x0007, lo: 0x03}, {value: 0x3bc7, lo: 0xa0, hi: 0xa1}, {value: 0x3bf1, lo: 0xa2, hi: 0xa3}, {value: 0x3c1b, lo: 0xaa, hi: 0xad}, // Block 0x44, offset 0x176 {value: 0x0004, lo: 0x01}, {value: 0x0586, lo: 0xa9, hi: 0xaa}, // Block 0x45, offset 0x178 {value: 0x0000, lo: 0x01}, {value: 0x4596, lo: 0x9c, hi: 0x9c}, // Block 0x46, offset 0x17a {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0xaf, hi: 0xb1}, // Block 0x47, offset 0x17c {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0xbf, hi: 0xbf}, // Block 0x48, offset 0x17e {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0xa0, hi: 0xbf}, // Block 0x49, offset 0x180 {value: 0x0000, lo: 0x05}, {value: 0x812d, lo: 0xaa, hi: 0xaa}, {value: 0x8132, lo: 0xab, hi: 0xab}, {value: 0x8134, lo: 0xac, hi: 0xac}, {value: 0x812f, lo: 0xad, hi: 0xad}, {value: 0x8130, lo: 0xae, hi: 0xaf}, // Block 0x4a, offset 0x186 {value: 0x0000, lo: 0x03}, {value: 0x4be0, lo: 0xb3, hi: 0xb3}, {value: 0x4be0, lo: 0xb5, hi: 0xb6}, {value: 0x4be0, lo: 0xba, hi: 0xbf}, // Block 0x4b, offset 0x18a {value: 0x0000, lo: 0x01}, {value: 0x4be0, lo: 0x8f, hi: 0xa3}, // Block 0x4c, offset 0x18c {value: 0x0000, lo: 0x01}, {value: 0x8100, lo: 0xae, hi: 0xbe}, // Block 0x4d, offset 0x18e {value: 0x0000, lo: 0x07}, {value: 0x8100, lo: 0x84, hi: 0x84}, {value: 0x8100, lo: 0x87, hi: 0x87}, {value: 0x8100, lo: 0x90, hi: 0x90}, {value: 0x8100, lo: 0x9e, hi: 0x9e}, {value: 0x8100, lo: 0xa1, hi: 0xa1}, {value: 0x8100, lo: 0xb2, hi: 0xb2}, {value: 0x8100, lo: 0xbb, hi: 0xbb}, // Block 0x4e, offset 0x196 {value: 0x0000, lo: 0x03}, {value: 0x8100, lo: 0x80, hi: 0x80}, {value: 0x8100, lo: 0x8b, hi: 0x8b}, {value: 0x8100, lo: 0x8e, hi: 0x8e}, // Block 0x4f, offset 0x19a {value: 0x0000, lo: 0x02}, {value: 0x8133, lo: 0xaf, hi: 0xaf}, {value: 0x8133, lo: 0xb4, hi: 0xbd}, // Block 0x50, offset 0x19d {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0x9e, hi: 0x9f}, // Block 0x51, offset 0x19f {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0xb0, hi: 0xb1}, // Block 0x52, offset 0x1a1 {value: 0x0000, lo: 0x02}, {value: 0x8105, lo: 0x86, hi: 0x86}, {value: 0x8105, lo: 0xac, hi: 0xac}, // Block 0x53, offset 0x1a4 {value: 0x0000, lo: 0x02}, {value: 0x8105, lo: 0x84, hi: 0x84}, {value: 0x8133, lo: 0xa0, hi: 0xb1}, // Block 0x54, offset 0x1a7 {value: 0x0000, lo: 0x01}, {value: 0x812e, lo: 0xab, hi: 0xad}, // Block 0x55, offset 0x1a9 {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0x93, hi: 0x93}, // Block 0x56, offset 0x1ab {value: 0x0000, lo: 0x01}, {value: 0x8103, lo: 0xb3, hi: 0xb3}, // Block 0x57, offset 0x1ad {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0x80, hi: 0x80}, // Block 0x58, offset 0x1af {value: 0x0000, lo: 0x05}, {value: 0x8133, lo: 0xb0, hi: 0xb0}, {value: 0x8133, lo: 0xb2, hi: 0xb3}, {value: 0x812e, lo: 0xb4, hi: 0xb4}, {value: 0x8133, lo: 0xb7, hi: 0xb8}, {value: 0x8133, lo: 0xbe, hi: 0xbf}, // Block 0x59, offset 0x1b5 {value: 0x0000, lo: 0x02}, {value: 0x8133, lo: 0x81, hi: 0x81}, {value: 0x8105, lo: 0xb6, hi: 0xb6}, // Block 0x5a, offset 0x1b8 {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0xad, hi: 0xad}, // Block 0x5b, offset 0x1ba {value: 0x0000, lo: 0x06}, {value: 0xe500, lo: 0x80, hi: 0x80}, {value: 0xc600, lo: 0x81, hi: 0x9b}, {value: 0xe500, lo: 0x9c, hi: 0x9c}, {value: 0xc600, lo: 0x9d, hi: 0xb7}, {value: 0xe500, lo: 0xb8, hi: 0xb8}, {value: 0xc600, lo: 0xb9, hi: 0xbf}, // Block 0x5c, offset 0x1c1 {value: 0x0000, lo: 0x05}, {value: 0xc600, lo: 0x80, hi: 0x93}, {value: 0xe500, lo: 0x94, hi: 0x94}, {value: 0xc600, lo: 0x95, hi: 0xaf}, {value: 0xe500, lo: 0xb0, hi: 0xb0}, {value: 0xc600, lo: 0xb1, hi: 0xbf}, // Block 0x5d, offset 0x1c7 {value: 0x0000, lo: 0x05}, {value: 0xc600, lo: 0x80, hi: 0x8b}, {value: 0xe500, lo: 0x8c, hi: 0x8c}, {value: 0xc600, lo: 0x8d, hi: 0xa7}, {value: 0xe500, lo: 0xa8, hi: 0xa8}, {value: 0xc600, lo: 0xa9, hi: 0xbf}, // Block 0x5e, offset 0x1cd {value: 0x0000, lo: 0x07}, {value: 0xc600, lo: 0x80, hi: 0x83}, {value: 0xe500, lo: 0x84, hi: 0x84}, {value: 0xc600, lo: 0x85, hi: 0x9f}, {value: 0xe500, lo: 0xa0, hi: 0xa0}, {value: 0xc600, lo: 0xa1, hi: 0xbb}, {value: 0xe500, lo: 0xbc, hi: 0xbc}, {value: 0xc600, lo: 0xbd, hi: 0xbf}, // Block 0x5f, offset 0x1d5 {value: 0x0000, lo: 0x05}, {value: 0xc600, lo: 0x80, hi: 0x97}, {value: 0xe500, lo: 0x98, hi: 0x98}, {value: 0xc600, lo: 0x99, hi: 0xb3}, {value: 0xe500, lo: 0xb4, hi: 0xb4}, {value: 0xc600, lo: 0xb5, hi: 0xbf}, // Block 0x60, offset 0x1db {value: 0x0000, lo: 0x05}, {value: 0xc600, lo: 0x80, hi: 0x8f}, {value: 0xe500, lo: 0x90, hi: 0x90}, {value: 0xc600, lo: 0x91, hi: 0xab}, {value: 0xe500, lo: 0xac, hi: 0xac}, {value: 0xc600, lo: 0xad, hi: 0xbf}, // Block 0x61, offset 0x1e1 {value: 0x0000, lo: 0x05}, {value: 0xc600, lo: 0x80, hi: 0x87}, {value: 0xe500, lo: 0x88, hi: 0x88}, {value: 0xc600, lo: 0x89, hi: 0xa3}, {value: 0xe500, lo: 0xa4, hi: 0xa4}, {value: 0xc600, lo: 0xa5, hi: 0xbf}, // Block 0x62, offset 0x1e7 {value: 0x0000, lo: 0x03}, {value: 0xc600, lo: 0x80, hi: 0x87}, {value: 0xe500, lo: 0x88, hi: 0x88}, {value: 0xc600, lo: 0x89, hi: 0xa3}, // Block 0x63, offset 0x1eb {value: 0x0006, lo: 0x0d}, {value: 0x4449, lo: 0x9d, hi: 0x9d}, {value: 0x8116, lo: 0x9e, hi: 0x9e}, {value: 0x44bb, lo: 0x9f, hi: 0x9f}, {value: 0x44a9, lo: 0xaa, hi: 0xab}, {value: 0x45ad, lo: 0xac, hi: 0xac}, {value: 0x45b5, lo: 0xad, hi: 0xad}, {value: 0x4401, lo: 0xae, hi: 0xb1}, {value: 0x441f, lo: 0xb2, hi: 0xb4}, {value: 0x4437, lo: 0xb5, hi: 0xb6}, {value: 0x4443, lo: 0xb8, hi: 0xb8}, {value: 0x444f, lo: 0xb9, hi: 0xbb}, {value: 0x4467, lo: 0xbc, hi: 0xbc}, {value: 0x446d, lo: 0xbe, hi: 0xbe}, // Block 0x64, offset 0x1f9 {value: 0x0006, lo: 0x08}, {value: 0x4473, lo: 0x80, hi: 0x81}, {value: 0x447f, lo: 0x83, hi: 0x84}, {value: 0x4491, lo: 0x86, hi: 0x89}, {value: 0x44b5, lo: 0x8a, hi: 0x8a}, {value: 0x4431, lo: 0x8b, hi: 0x8b}, {value: 0x4419, lo: 0x8c, hi: 0x8c}, {value: 0x4461, lo: 0x8d, hi: 0x8d}, {value: 0x448b, lo: 0x8e, hi: 0x8e}, // Block 0x65, offset 0x202 {value: 0x0000, lo: 0x02}, {value: 0x8100, lo: 0xa4, hi: 0xa5}, {value: 0x8100, lo: 0xb0, hi: 0xb1}, // Block 0x66, offset 0x205 {value: 0x0000, lo: 0x02}, {value: 0x8100, lo: 0x9b, hi: 0x9d}, {value: 0x8200, lo: 0x9e, hi: 0xa3}, // Block 0x67, offset 0x208 {value: 0x0000, lo: 0x01}, {value: 0x8100, lo: 0x90, hi: 0x90}, // Block 0x68, offset 0x20a {value: 0x0000, lo: 0x02}, {value: 0x8100, lo: 0x99, hi: 0x99}, {value: 0x8200, lo: 0xb2, hi: 0xb4}, // Block 0x69, offset 0x20d {value: 0x0000, lo: 0x01}, {value: 0x8100, lo: 0xbc, hi: 0xbd}, // Block 0x6a, offset 0x20f {value: 0x0000, lo: 0x03}, {value: 0x8133, lo: 0xa0, hi: 0xa6}, {value: 0x812e, lo: 0xa7, hi: 0xad}, {value: 0x8133, lo: 0xae, hi: 0xaf}, // Block 0x6b, offset 0x213 {value: 0x0000, lo: 0x04}, {value: 0x8100, lo: 0x89, hi: 0x8c}, {value: 0x8100, lo: 0xb0, hi: 0xb2}, {value: 0x8100, lo: 0xb4, hi: 0xb4}, {value: 0x8100, lo: 0xb6, hi: 0xbf}, // Block 0x6c, offset 0x218 {value: 0x0000, lo: 0x01}, {value: 0x8100, lo: 0x81, hi: 0x8c}, // Block 0x6d, offset 0x21a {value: 0x0000, lo: 0x01}, {value: 0x8100, lo: 0xb5, hi: 0xba}, // Block 0x6e, offset 0x21c {value: 0x0000, lo: 0x04}, {value: 0x4be0, lo: 0x9e, hi: 0x9f}, {value: 0x4be0, lo: 0xa3, hi: 0xa3}, {value: 0x4be0, lo: 0xa5, hi: 0xa6}, {value: 0x4be0, lo: 0xaa, hi: 0xaf}, // Block 0x6f, offset 0x221 {value: 0x0000, lo: 0x05}, {value: 0x4be0, lo: 0x82, hi: 0x87}, {value: 0x4be0, lo: 0x8a, hi: 0x8f}, {value: 0x4be0, lo: 0x92, hi: 0x97}, {value: 0x4be0, lo: 0x9a, hi: 0x9c}, {value: 0x8100, lo: 0xa3, hi: 0xa3}, // Block 0x70, offset 0x227 {value: 0x0000, lo: 0x01}, {value: 0x812e, lo: 0xbd, hi: 0xbd}, // Block 0x71, offset 0x229 {value: 0x0000, lo: 0x01}, {value: 0x812e, lo: 0xa0, hi: 0xa0}, // Block 0x72, offset 0x22b {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0xb6, hi: 0xba}, // Block 0x73, offset 0x22d {value: 0x002d, lo: 0x05}, {value: 0x812e, lo: 0x8d, hi: 0x8d}, {value: 0x8133, lo: 0x8f, hi: 0x8f}, {value: 0x8133, lo: 0xb8, hi: 0xb8}, {value: 0x8101, lo: 0xb9, hi: 0xba}, {value: 0x8105, lo: 0xbf, hi: 0xbf}, // Block 0x74, offset 0x233 {value: 0x0000, lo: 0x02}, {value: 0x8133, lo: 0xa5, hi: 0xa5}, {value: 0x812e, lo: 0xa6, hi: 0xa6}, // Block 0x75, offset 0x236 {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0xa4, hi: 0xa7}, // Block 0x76, offset 0x238 {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0xab, hi: 0xac}, // Block 0x77, offset 0x23a {value: 0x0000, lo: 0x01}, {value: 0x812e, lo: 0xbd, hi: 0xbf}, // Block 0x78, offset 0x23c {value: 0x0000, lo: 0x05}, {value: 0x812e, lo: 0x86, hi: 0x87}, {value: 0x8133, lo: 0x88, hi: 0x8a}, {value: 0x812e, lo: 0x8b, hi: 0x8b}, {value: 0x8133, lo: 0x8c, hi: 0x8c}, {value: 0x812e, lo: 0x8d, hi: 0x90}, // Block 0x79, offset 0x242 {value: 0x0005, lo: 0x03}, {value: 0x8133, lo: 0x82, hi: 0x82}, {value: 0x812e, lo: 0x83, hi: 0x84}, {value: 0x812e, lo: 0x85, hi: 0x85}, // Block 0x7a, offset 0x246 {value: 0x0000, lo: 0x03}, {value: 0x8105, lo: 0x86, hi: 0x86}, {value: 0x8105, lo: 0xb0, hi: 0xb0}, {value: 0x8105, lo: 0xbf, hi: 0xbf}, // Block 0x7b, offset 0x24a {value: 0x17fe, lo: 0x07}, {value: 0xa000, lo: 0x99, hi: 0x99}, {value: 0x4277, lo: 0x9a, hi: 0x9a}, {value: 0xa000, lo: 0x9b, hi: 0x9b}, {value: 0x4281, lo: 0x9c, hi: 0x9c}, {value: 0xa000, lo: 0xa5, hi: 0xa5}, {value: 0x428b, lo: 0xab, hi: 0xab}, {value: 0x8105, lo: 0xb9, hi: 0xba}, // Block 0x7c, offset 0x252 {value: 0x0000, lo: 0x06}, {value: 0x8133, lo: 0x80, hi: 0x82}, {value: 0x9900, lo: 0xa7, hi: 0xa7}, {value: 0x4295, lo: 0xae, hi: 0xae}, {value: 0x429f, lo: 0xaf, hi: 0xaf}, {value: 0xa000, lo: 0xb1, hi: 0xb2}, {value: 0x8105, lo: 0xb3, hi: 0xb4}, // Block 0x7d, offset 0x259 {value: 0x0000, lo: 0x02}, {value: 0x8105, lo: 0x80, hi: 0x80}, {value: 0x8103, lo: 0x8a, hi: 0x8a}, // Block 0x7e, offset 0x25c {value: 0x0000, lo: 0x02}, {value: 0x8105, lo: 0xb5, hi: 0xb5}, {value: 0x8103, lo: 0xb6, hi: 0xb6}, // Block 0x7f, offset 0x25f {value: 0x0002, lo: 0x01}, {value: 0x8103, lo: 0xa9, hi: 0xaa}, // Block 0x80, offset 0x261 {value: 0x0000, lo: 0x02}, {value: 0x8103, lo: 0xbb, hi: 0xbc}, {value: 0x9900, lo: 0xbe, hi: 0xbe}, // Block 0x81, offset 0x264 {value: 0x0000, lo: 0x07}, {value: 0xa000, lo: 0x87, hi: 0x87}, {value: 0x42a9, lo: 0x8b, hi: 0x8b}, {value: 0x42b3, lo: 0x8c, hi: 0x8c}, {value: 0x8105, lo: 0x8d, hi: 0x8d}, {value: 0x9900, lo: 0x97, hi: 0x97}, {value: 0x8133, lo: 0xa6, hi: 0xac}, {value: 0x8133, lo: 0xb0, hi: 0xb4}, // Block 0x82, offset 0x26c {value: 0x0000, lo: 0x03}, {value: 0x8105, lo: 0x82, hi: 0x82}, {value: 0x8103, lo: 0x86, hi: 0x86}, {value: 0x8133, lo: 0x9e, hi: 0x9e}, // Block 0x83, offset 0x270 {value: 0x5643, lo: 0x06}, {value: 0x9900, lo: 0xb0, hi: 0xb0}, {value: 0xa000, lo: 0xb9, hi: 0xb9}, {value: 0x9900, lo: 0xba, hi: 0xba}, {value: 0x42c7, lo: 0xbb, hi: 0xbb}, {value: 0x42bd, lo: 0xbc, hi: 0xbd}, {value: 0x42d1, lo: 0xbe, hi: 0xbe}, // Block 0x84, offset 0x277 {value: 0x0000, lo: 0x02}, {value: 0x8105, lo: 0x82, hi: 0x82}, {value: 0x8103, lo: 0x83, hi: 0x83}, // Block 0x85, offset 0x27a {value: 0x0000, lo: 0x05}, {value: 0x9900, lo: 0xaf, hi: 0xaf}, {value: 0xa000, lo: 0xb8, hi: 0xb9}, {value: 0x42db, lo: 0xba, hi: 0xba}, {value: 0x42e5, lo: 0xbb, hi: 0xbb}, {value: 0x8105, lo: 0xbf, hi: 0xbf}, // Block 0x86, offset 0x280 {value: 0x0000, lo: 0x01}, {value: 0x8103, lo: 0x80, hi: 0x80}, // Block 0x87, offset 0x282 {value: 0x0000, lo: 0x02}, {value: 0x8105, lo: 0xb6, hi: 0xb6}, {value: 0x8103, lo: 0xb7, hi: 0xb7}, // Block 0x88, offset 0x285 {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0xab, hi: 0xab}, // Block 0x89, offset 0x287 {value: 0x0000, lo: 0x02}, {value: 0x8105, lo: 0xb9, hi: 0xb9}, {value: 0x8103, lo: 0xba, hi: 0xba}, // Block 0x8a, offset 0x28a {value: 0x0000, lo: 0x04}, {value: 0x9900, lo: 0xb0, hi: 0xb0}, {value: 0xa000, lo: 0xb5, hi: 0xb5}, {value: 0x42ef, lo: 0xb8, hi: 0xb8}, {value: 0x8105, lo: 0xbd, hi: 0xbe}, // Block 0x8b, offset 0x28f {value: 0x0000, lo: 0x01}, {value: 0x8103, lo: 0x83, hi: 0x83}, // Block 0x8c, offset 0x291 {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0xa0, hi: 0xa0}, // Block 0x8d, offset 0x293 {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0xb4, hi: 0xb4}, // Block 0x8e, offset 0x295 {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0x87, hi: 0x87}, // Block 0x8f, offset 0x297 {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0x99, hi: 0x99}, // Block 0x90, offset 0x299 {value: 0x0000, lo: 0x02}, {value: 0x8103, lo: 0x82, hi: 0x82}, {value: 0x8105, lo: 0x84, hi: 0x85}, // Block 0x91, offset 0x29c {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0x97, hi: 0x97}, // Block 0x92, offset 0x29e {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0x81, hi: 0x82}, // Block 0x93, offset 0x2a0 {value: 0x0000, lo: 0x01}, {value: 0x8101, lo: 0xb0, hi: 0xb4}, // Block 0x94, offset 0x2a2 {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0xb0, hi: 0xb6}, // Block 0x95, offset 0x2a4 {value: 0x0000, lo: 0x01}, {value: 0x8102, lo: 0xb0, hi: 0xb1}, // Block 0x96, offset 0x2a6 {value: 0x0000, lo: 0x01}, {value: 0x8101, lo: 0x9e, hi: 0x9e}, // Block 0x97, offset 0x2a8 {value: 0x0000, lo: 0x0c}, {value: 0x46fd, lo: 0x9e, hi: 0x9e}, {value: 0x4707, lo: 0x9f, hi: 0x9f}, {value: 0x473b, lo: 0xa0, hi: 0xa0}, {value: 0x4749, lo: 0xa1, hi: 0xa1}, {value: 0x4757, lo: 0xa2, hi: 0xa2}, {value: 0x4765, lo: 0xa3, hi: 0xa3}, {value: 0x4773, lo: 0xa4, hi: 0xa4}, {value: 0x812c, lo: 0xa5, hi: 0xa6}, {value: 0x8101, lo: 0xa7, hi: 0xa9}, {value: 0x8131, lo: 0xad, hi: 0xad}, {value: 0x812c, lo: 0xae, hi: 0xb2}, {value: 0x812e, lo: 0xbb, hi: 0xbf}, // Block 0x98, offset 0x2b5 {value: 0x0000, lo: 0x09}, {value: 0x812e, lo: 0x80, hi: 0x82}, {value: 0x8133, lo: 0x85, hi: 0x89}, {value: 0x812e, lo: 0x8a, hi: 0x8b}, {value: 0x8133, lo: 0xaa, hi: 0xad}, {value: 0x4711, lo: 0xbb, hi: 0xbb}, {value: 0x471b, lo: 0xbc, hi: 0xbc}, {value: 0x4781, lo: 0xbd, hi: 0xbd}, {value: 0x479d, lo: 0xbe, hi: 0xbe}, {value: 0x478f, lo: 0xbf, hi: 0xbf}, // Block 0x99, offset 0x2bf {value: 0x0000, lo: 0x01}, {value: 0x47ab, lo: 0x80, hi: 0x80}, // Block 0x9a, offset 0x2c1 {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0x82, hi: 0x84}, // Block 0x9b, offset 0x2c3 {value: 0x0000, lo: 0x05}, {value: 0x8133, lo: 0x80, hi: 0x86}, {value: 0x8133, lo: 0x88, hi: 0x98}, {value: 0x8133, lo: 0x9b, hi: 0xa1}, {value: 0x8133, lo: 0xa3, hi: 0xa4}, {value: 0x8133, lo: 0xa6, hi: 0xaa}, // Block 0x9c, offset 0x2c9 {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0x8f, hi: 0x8f}, // Block 0x9d, offset 0x2cb {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0xae, hi: 0xae}, // Block 0x9e, offset 0x2cd {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0xac, hi: 0xaf}, // Block 0x9f, offset 0x2cf {value: 0x0000, lo: 0x03}, {value: 0x8134, lo: 0xac, hi: 0xad}, {value: 0x812e, lo: 0xae, hi: 0xae}, {value: 0x8133, lo: 0xaf, hi: 0xaf}, // Block 0xa0, offset 0x2d3 {value: 0x0000, lo: 0x01}, {value: 0x812e, lo: 0x90, hi: 0x96}, // Block 0xa1, offset 0x2d5 {value: 0x0000, lo: 0x02}, {value: 0x8133, lo: 0x84, hi: 0x89}, {value: 0x8103, lo: 0x8a, hi: 0x8a}, // Block 0xa2, offset 0x2d8 {value: 0x0000, lo: 0x01}, {value: 0x8100, lo: 0x93, hi: 0x93}, } // lookup returns the trie value for the first UTF-8 encoding in s and // the width in bytes of this encoding. The size will be 0 if s does not // hold enough bytes to complete the encoding. len(s) must be greater than 0. func (t *nfkcTrie) lookup(s []byte) (v uint16, sz int) { c0 := s[0] switch { case c0 < 0x80: // is ASCII return nfkcValues[c0], 1 case c0 < 0xC2: return 0, 1 // Illegal UTF-8: not a starter, not ASCII. case c0 < 0xE0: // 2-byte UTF-8 if len(s) < 2 { return 0, 0 } i := nfkcIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c1), 2 case c0 < 0xF0: // 3-byte UTF-8 if len(s) < 3 { return 0, 0 } i := nfkcIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = nfkcIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c2), 3 case c0 < 0xF8: // 4-byte UTF-8 if len(s) < 4 { return 0, 0 } i := nfkcIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = nfkcIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } o = uint32(i)<<6 + uint32(c2) i = nfkcIndex[o] c3 := s[3] if c3 < 0x80 || 0xC0 <= c3 { return 0, 3 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c3), 4 } // Illegal rune return 0, 1 } // lookupUnsafe returns the trie value for the first UTF-8 encoding in s. // s must start with a full and valid UTF-8 encoded rune. func (t *nfkcTrie) lookupUnsafe(s []byte) uint16 { c0 := s[0] if c0 < 0x80 { // is ASCII return nfkcValues[c0] } i := nfkcIndex[c0] if c0 < 0xE0 { // 2-byte UTF-8 return t.lookupValue(uint32(i), s[1]) } i = nfkcIndex[uint32(i)<<6+uint32(s[1])] if c0 < 0xF0 { // 3-byte UTF-8 return t.lookupValue(uint32(i), s[2]) } i = nfkcIndex[uint32(i)<<6+uint32(s[2])] if c0 < 0xF8 { // 4-byte UTF-8 return t.lookupValue(uint32(i), s[3]) } return 0 } // lookupString returns the trie value for the first UTF-8 encoding in s and // the width in bytes of this encoding. The size will be 0 if s does not // hold enough bytes to complete the encoding. len(s) must be greater than 0. func (t *nfkcTrie) lookupString(s string) (v uint16, sz int) { c0 := s[0] switch { case c0 < 0x80: // is ASCII return nfkcValues[c0], 1 case c0 < 0xC2: return 0, 1 // Illegal UTF-8: not a starter, not ASCII. case c0 < 0xE0: // 2-byte UTF-8 if len(s) < 2 { return 0, 0 } i := nfkcIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c1), 2 case c0 < 0xF0: // 3-byte UTF-8 if len(s) < 3 { return 0, 0 } i := nfkcIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = nfkcIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c2), 3 case c0 < 0xF8: // 4-byte UTF-8 if len(s) < 4 { return 0, 0 } i := nfkcIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = nfkcIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } o = uint32(i)<<6 + uint32(c2) i = nfkcIndex[o] c3 := s[3] if c3 < 0x80 || 0xC0 <= c3 { return 0, 3 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c3), 4 } // Illegal rune return 0, 1 } // lookupStringUnsafe returns the trie value for the first UTF-8 encoding in s. // s must start with a full and valid UTF-8 encoded rune. func (t *nfkcTrie) lookupStringUnsafe(s string) uint16 { c0 := s[0] if c0 < 0x80 { // is ASCII return nfkcValues[c0] } i := nfkcIndex[c0] if c0 < 0xE0 { // 2-byte UTF-8 return t.lookupValue(uint32(i), s[1]) } i = nfkcIndex[uint32(i)<<6+uint32(s[1])] if c0 < 0xF0 { // 3-byte UTF-8 return t.lookupValue(uint32(i), s[2]) } i = nfkcIndex[uint32(i)<<6+uint32(s[2])] if c0 < 0xF8 { // 4-byte UTF-8 return t.lookupValue(uint32(i), s[3]) } return 0 } // nfkcTrie. Total size: 19260 bytes (18.81 KiB). Checksum: 4d294206c9ae0ba8. type nfkcTrie struct{} func newNfkcTrie(i int) *nfkcTrie { return &nfkcTrie{} } // lookupValue determines the type of block n and looks up the value for b. func (t *nfkcTrie) lookupValue(n uint32, b byte) uint16 { switch { case n < 95: return uint16(nfkcValues[n<<6+uint32(b)]) default: n -= 95 return uint16(nfkcSparse.lookup(n, b)) } } // nfkcValues: 97 blocks, 6208 entries, 12416 bytes // The third block is the zero block. var nfkcValues = [6208]uint16{ // Block 0x0, offset 0x0 0x3c: 0xa000, 0x3d: 0xa000, 0x3e: 0xa000, // Block 0x1, offset 0x40 0x41: 0xa000, 0x42: 0xa000, 0x43: 0xa000, 0x44: 0xa000, 0x45: 0xa000, 0x46: 0xa000, 0x47: 0xa000, 0x48: 0xa000, 0x49: 0xa000, 0x4a: 0xa000, 0x4b: 0xa000, 0x4c: 0xa000, 0x4d: 0xa000, 0x4e: 0xa000, 0x4f: 0xa000, 0x50: 0xa000, 0x52: 0xa000, 0x53: 0xa000, 0x54: 0xa000, 0x55: 0xa000, 0x56: 0xa000, 0x57: 0xa000, 0x58: 0xa000, 0x59: 0xa000, 0x5a: 0xa000, 0x61: 0xa000, 0x62: 0xa000, 0x63: 0xa000, 0x64: 0xa000, 0x65: 0xa000, 0x66: 0xa000, 0x67: 0xa000, 0x68: 0xa000, 0x69: 0xa000, 0x6a: 0xa000, 0x6b: 0xa000, 0x6c: 0xa000, 0x6d: 0xa000, 0x6e: 0xa000, 0x6f: 0xa000, 0x70: 0xa000, 0x72: 0xa000, 0x73: 0xa000, 0x74: 0xa000, 0x75: 0xa000, 0x76: 0xa000, 0x77: 0xa000, 0x78: 0xa000, 0x79: 0xa000, 0x7a: 0xa000, // Block 0x2, offset 0x80 // Block 0x3, offset 0xc0 0xc0: 0x2ece, 0xc1: 0x2ed3, 0xc2: 0x47b9, 0xc3: 0x2ed8, 0xc4: 0x47c8, 0xc5: 0x47cd, 0xc6: 0xa000, 0xc7: 0x47d7, 0xc8: 0x2f41, 0xc9: 0x2f46, 0xca: 0x47dc, 0xcb: 0x2f5a, 0xcc: 0x2fcd, 0xcd: 0x2fd2, 0xce: 0x2fd7, 0xcf: 0x47f0, 0xd1: 0x3063, 0xd2: 0x3086, 0xd3: 0x308b, 0xd4: 0x47fa, 0xd5: 0x47ff, 0xd6: 0x480e, 0xd8: 0xa000, 0xd9: 0x3112, 0xda: 0x3117, 0xdb: 0x311c, 0xdc: 0x4840, 0xdd: 0x3194, 0xe0: 0x31da, 0xe1: 0x31df, 0xe2: 0x484a, 0xe3: 0x31e4, 0xe4: 0x4859, 0xe5: 0x485e, 0xe6: 0xa000, 0xe7: 0x4868, 0xe8: 0x324d, 0xe9: 0x3252, 0xea: 0x486d, 0xeb: 0x3266, 0xec: 0x32de, 0xed: 0x32e3, 0xee: 0x32e8, 0xef: 0x4881, 0xf1: 0x3374, 0xf2: 0x3397, 0xf3: 0x339c, 0xf4: 0x488b, 0xf5: 0x4890, 0xf6: 0x489f, 0xf8: 0xa000, 0xf9: 0x3428, 0xfa: 0x342d, 0xfb: 0x3432, 0xfc: 0x48d1, 0xfd: 0x34af, 0xff: 0x34c8, // Block 0x4, offset 0x100 0x100: 0x2edd, 0x101: 0x31e9, 0x102: 0x47be, 0x103: 0x484f, 0x104: 0x2efb, 0x105: 0x3207, 0x106: 0x2f0f, 0x107: 0x321b, 0x108: 0x2f14, 0x109: 0x3220, 0x10a: 0x2f19, 0x10b: 0x3225, 0x10c: 0x2f1e, 0x10d: 0x322a, 0x10e: 0x2f28, 0x10f: 0x3234, 0x112: 0x47e1, 0x113: 0x4872, 0x114: 0x2f50, 0x115: 0x325c, 0x116: 0x2f55, 0x117: 0x3261, 0x118: 0x2f73, 0x119: 0x327f, 0x11a: 0x2f64, 0x11b: 0x3270, 0x11c: 0x2f8c, 0x11d: 0x3298, 0x11e: 0x2f96, 0x11f: 0x32a2, 0x120: 0x2f9b, 0x121: 0x32a7, 0x122: 0x2fa5, 0x123: 0x32b1, 0x124: 0x2faa, 0x125: 0x32b6, 0x128: 0x2fdc, 0x129: 0x32ed, 0x12a: 0x2fe1, 0x12b: 0x32f2, 0x12c: 0x2fe6, 0x12d: 0x32f7, 0x12e: 0x3009, 0x12f: 0x3315, 0x130: 0x2feb, 0x132: 0x1a8a, 0x133: 0x1b17, 0x134: 0x3013, 0x135: 0x331f, 0x136: 0x3027, 0x137: 0x3338, 0x139: 0x3031, 0x13a: 0x3342, 0x13b: 0x303b, 0x13c: 0x334c, 0x13d: 0x3036, 0x13e: 0x3347, 0x13f: 0x1cdc, // Block 0x5, offset 0x140 0x140: 0x1d64, 0x143: 0x305e, 0x144: 0x336f, 0x145: 0x3077, 0x146: 0x3388, 0x147: 0x306d, 0x148: 0x337e, 0x149: 0x1d8c, 0x14c: 0x4804, 0x14d: 0x4895, 0x14e: 0x3090, 0x14f: 0x33a1, 0x150: 0x309a, 0x151: 0x33ab, 0x154: 0x30b8, 0x155: 0x33c9, 0x156: 0x30d1, 0x157: 0x33e2, 0x158: 0x30c2, 0x159: 0x33d3, 0x15a: 0x4827, 0x15b: 0x48b8, 0x15c: 0x30db, 0x15d: 0x33ec, 0x15e: 0x30ea, 0x15f: 0x33fb, 0x160: 0x482c, 0x161: 0x48bd, 0x162: 0x3103, 0x163: 0x3419, 0x164: 0x30f4, 0x165: 0x340a, 0x168: 0x4836, 0x169: 0x48c7, 0x16a: 0x483b, 0x16b: 0x48cc, 0x16c: 0x3121, 0x16d: 0x3437, 0x16e: 0x312b, 0x16f: 0x3441, 0x170: 0x3130, 0x171: 0x3446, 0x172: 0x314e, 0x173: 0x3464, 0x174: 0x3171, 0x175: 0x3487, 0x176: 0x3199, 0x177: 0x34b4, 0x178: 0x31ad, 0x179: 0x31bc, 0x17a: 0x34dc, 0x17b: 0x31c6, 0x17c: 0x34e6, 0x17d: 0x31cb, 0x17e: 0x34eb, 0x17f: 0x00a7, // Block 0x6, offset 0x180 0x184: 0x2dd5, 0x185: 0x2ddb, 0x186: 0x2de1, 0x187: 0x1a9f, 0x188: 0x1aa2, 0x189: 0x1b38, 0x18a: 0x1ab7, 0x18b: 0x1aba, 0x18c: 0x1b6e, 0x18d: 0x2ee7, 0x18e: 0x31f3, 0x18f: 0x2ff5, 0x190: 0x3301, 0x191: 0x309f, 0x192: 0x33b0, 0x193: 0x3135, 0x194: 0x344b, 0x195: 0x392e, 0x196: 0x3abd, 0x197: 0x3927, 0x198: 0x3ab6, 0x199: 0x3935, 0x19a: 0x3ac4, 0x19b: 0x3920, 0x19c: 0x3aaf, 0x19e: 0x380f, 0x19f: 0x399e, 0x1a0: 0x3808, 0x1a1: 0x3997, 0x1a2: 0x3512, 0x1a3: 0x3524, 0x1a6: 0x2fa0, 0x1a7: 0x32ac, 0x1a8: 0x301d, 0x1a9: 0x332e, 0x1aa: 0x481d, 0x1ab: 0x48ae, 0x1ac: 0x38ef, 0x1ad: 0x3a7e, 0x1ae: 0x3536, 0x1af: 0x353c, 0x1b0: 0x3324, 0x1b1: 0x1a6f, 0x1b2: 0x1a72, 0x1b3: 0x1aff, 0x1b4: 0x2f87, 0x1b5: 0x3293, 0x1b8: 0x3059, 0x1b9: 0x336a, 0x1ba: 0x3816, 0x1bb: 0x39a5, 0x1bc: 0x350c, 0x1bd: 0x351e, 0x1be: 0x3518, 0x1bf: 0x352a, // Block 0x7, offset 0x1c0 0x1c0: 0x2eec, 0x1c1: 0x31f8, 0x1c2: 0x2ef1, 0x1c3: 0x31fd, 0x1c4: 0x2f69, 0x1c5: 0x3275, 0x1c6: 0x2f6e, 0x1c7: 0x327a, 0x1c8: 0x2ffa, 0x1c9: 0x3306, 0x1ca: 0x2fff, 0x1cb: 0x330b, 0x1cc: 0x30a4, 0x1cd: 0x33b5, 0x1ce: 0x30a9, 0x1cf: 0x33ba, 0x1d0: 0x30c7, 0x1d1: 0x33d8, 0x1d2: 0x30cc, 0x1d3: 0x33dd, 0x1d4: 0x313a, 0x1d5: 0x3450, 0x1d6: 0x313f, 0x1d7: 0x3455, 0x1d8: 0x30e5, 0x1d9: 0x33f6, 0x1da: 0x30fe, 0x1db: 0x3414, 0x1de: 0x2fb9, 0x1df: 0x32c5, 0x1e6: 0x47c3, 0x1e7: 0x4854, 0x1e8: 0x47eb, 0x1e9: 0x487c, 0x1ea: 0x38be, 0x1eb: 0x3a4d, 0x1ec: 0x389b, 0x1ed: 0x3a2a, 0x1ee: 0x4809, 0x1ef: 0x489a, 0x1f0: 0x38b7, 0x1f1: 0x3a46, 0x1f2: 0x31a3, 0x1f3: 0x34be, // Block 0x8, offset 0x200 0x200: 0x9933, 0x201: 0x9933, 0x202: 0x9933, 0x203: 0x9933, 0x204: 0x9933, 0x205: 0x8133, 0x206: 0x9933, 0x207: 0x9933, 0x208: 0x9933, 0x209: 0x9933, 0x20a: 0x9933, 0x20b: 0x9933, 0x20c: 0x9933, 0x20d: 0x8133, 0x20e: 0x8133, 0x20f: 0x9933, 0x210: 0x8133, 0x211: 0x9933, 0x212: 0x8133, 0x213: 0x9933, 0x214: 0x9933, 0x215: 0x8134, 0x216: 0x812e, 0x217: 0x812e, 0x218: 0x812e, 0x219: 0x812e, 0x21a: 0x8134, 0x21b: 0x992c, 0x21c: 0x812e, 0x21d: 0x812e, 0x21e: 0x812e, 0x21f: 0x812e, 0x220: 0x812e, 0x221: 0x812a, 0x222: 0x812a, 0x223: 0x992e, 0x224: 0x992e, 0x225: 0x992e, 0x226: 0x992e, 0x227: 0x992a, 0x228: 0x992a, 0x229: 0x812e, 0x22a: 0x812e, 0x22b: 0x812e, 0x22c: 0x812e, 0x22d: 0x992e, 0x22e: 0x992e, 0x22f: 0x812e, 0x230: 0x992e, 0x231: 0x992e, 0x232: 0x812e, 0x233: 0x812e, 0x234: 0x8101, 0x235: 0x8101, 0x236: 0x8101, 0x237: 0x8101, 0x238: 0x9901, 0x239: 0x812e, 0x23a: 0x812e, 0x23b: 0x812e, 0x23c: 0x812e, 0x23d: 0x8133, 0x23e: 0x8133, 0x23f: 0x8133, // Block 0x9, offset 0x240 0x240: 0x4aef, 0x241: 0x4af4, 0x242: 0x9933, 0x243: 0x4af9, 0x244: 0x4bb2, 0x245: 0x9937, 0x246: 0x8133, 0x247: 0x812e, 0x248: 0x812e, 0x249: 0x812e, 0x24a: 0x8133, 0x24b: 0x8133, 0x24c: 0x8133, 0x24d: 0x812e, 0x24e: 0x812e, 0x250: 0x8133, 0x251: 0x8133, 0x252: 0x8133, 0x253: 0x812e, 0x254: 0x812e, 0x255: 0x812e, 0x256: 0x812e, 0x257: 0x8133, 0x258: 0x8134, 0x259: 0x812e, 0x25a: 0x812e, 0x25b: 0x8133, 0x25c: 0x8135, 0x25d: 0x8136, 0x25e: 0x8136, 0x25f: 0x8135, 0x260: 0x8136, 0x261: 0x8136, 0x262: 0x8135, 0x263: 0x8133, 0x264: 0x8133, 0x265: 0x8133, 0x266: 0x8133, 0x267: 0x8133, 0x268: 0x8133, 0x269: 0x8133, 0x26a: 0x8133, 0x26b: 0x8133, 0x26c: 0x8133, 0x26d: 0x8133, 0x26e: 0x8133, 0x26f: 0x8133, 0x274: 0x01ee, 0x27a: 0x435e, 0x27e: 0x0037, // Block 0xa, offset 0x280 0x284: 0x4313, 0x285: 0x4534, 0x286: 0x3548, 0x287: 0x00ce, 0x288: 0x3566, 0x289: 0x3572, 0x28a: 0x3584, 0x28c: 0x35a2, 0x28e: 0x35b4, 0x28f: 0x35d2, 0x290: 0x3d67, 0x291: 0xa000, 0x295: 0xa000, 0x297: 0xa000, 0x299: 0xa000, 0x29f: 0xa000, 0x2a1: 0xa000, 0x2a5: 0xa000, 0x2a9: 0xa000, 0x2aa: 0x3596, 0x2ab: 0x35c6, 0x2ac: 0x492f, 0x2ad: 0x35f6, 0x2ae: 0x4959, 0x2af: 0x3608, 0x2b0: 0x3dcf, 0x2b1: 0xa000, 0x2b5: 0xa000, 0x2b7: 0xa000, 0x2b9: 0xa000, 0x2bf: 0xa000, // Block 0xb, offset 0x2c0 0x2c1: 0xa000, 0x2c5: 0xa000, 0x2c9: 0xa000, 0x2ca: 0x4971, 0x2cb: 0x498f, 0x2cc: 0x3626, 0x2cd: 0x363e, 0x2ce: 0x49a7, 0x2d0: 0x0242, 0x2d1: 0x0254, 0x2d2: 0x0230, 0x2d3: 0x43c5, 0x2d4: 0x43cb, 0x2d5: 0x027e, 0x2d6: 0x026c, 0x2f0: 0x025a, 0x2f1: 0x026f, 0x2f2: 0x0272, 0x2f4: 0x020c, 0x2f5: 0x024b, 0x2f9: 0x022a, // Block 0xc, offset 0x300 0x300: 0x3680, 0x301: 0x368c, 0x303: 0x367a, 0x306: 0xa000, 0x307: 0x3668, 0x30c: 0x36bc, 0x30d: 0x36a4, 0x30e: 0x36ce, 0x310: 0xa000, 0x313: 0xa000, 0x315: 0xa000, 0x316: 0xa000, 0x317: 0xa000, 0x318: 0xa000, 0x319: 0x36b0, 0x31a: 0xa000, 0x31e: 0xa000, 0x323: 0xa000, 0x327: 0xa000, 0x32b: 0xa000, 0x32d: 0xa000, 0x330: 0xa000, 0x333: 0xa000, 0x335: 0xa000, 0x336: 0xa000, 0x337: 0xa000, 0x338: 0xa000, 0x339: 0x3734, 0x33a: 0xa000, 0x33e: 0xa000, // Block 0xd, offset 0x340 0x341: 0x3692, 0x342: 0x3716, 0x350: 0x366e, 0x351: 0x36f2, 0x352: 0x3674, 0x353: 0x36f8, 0x356: 0x3686, 0x357: 0x370a, 0x358: 0xa000, 0x359: 0xa000, 0x35a: 0x3788, 0x35b: 0x378e, 0x35c: 0x3698, 0x35d: 0x371c, 0x35e: 0x369e, 0x35f: 0x3722, 0x362: 0x36aa, 0x363: 0x372e, 0x364: 0x36b6, 0x365: 0x373a, 0x366: 0x36c2, 0x367: 0x3746, 0x368: 0xa000, 0x369: 0xa000, 0x36a: 0x3794, 0x36b: 0x379a, 0x36c: 0x36ec, 0x36d: 0x3770, 0x36e: 0x36c8, 0x36f: 0x374c, 0x370: 0x36d4, 0x371: 0x3758, 0x372: 0x36da, 0x373: 0x375e, 0x374: 0x36e0, 0x375: 0x3764, 0x378: 0x36e6, 0x379: 0x376a, // Block 0xe, offset 0x380 0x387: 0x1e91, 0x391: 0x812e, 0x392: 0x8133, 0x393: 0x8133, 0x394: 0x8133, 0x395: 0x8133, 0x396: 0x812e, 0x397: 0x8133, 0x398: 0x8133, 0x399: 0x8133, 0x39a: 0x812f, 0x39b: 0x812e, 0x39c: 0x8133, 0x39d: 0x8133, 0x39e: 0x8133, 0x39f: 0x8133, 0x3a0: 0x8133, 0x3a1: 0x8133, 0x3a2: 0x812e, 0x3a3: 0x812e, 0x3a4: 0x812e, 0x3a5: 0x812e, 0x3a6: 0x812e, 0x3a7: 0x812e, 0x3a8: 0x8133, 0x3a9: 0x8133, 0x3aa: 0x812e, 0x3ab: 0x8133, 0x3ac: 0x8133, 0x3ad: 0x812f, 0x3ae: 0x8132, 0x3af: 0x8133, 0x3b0: 0x8106, 0x3b1: 0x8107, 0x3b2: 0x8108, 0x3b3: 0x8109, 0x3b4: 0x810a, 0x3b5: 0x810b, 0x3b6: 0x810c, 0x3b7: 0x810d, 0x3b8: 0x810e, 0x3b9: 0x810f, 0x3ba: 0x810f, 0x3bb: 0x8110, 0x3bc: 0x8111, 0x3bd: 0x8112, 0x3bf: 0x8113, // Block 0xf, offset 0x3c0 0x3c8: 0xa000, 0x3ca: 0xa000, 0x3cb: 0x8117, 0x3cc: 0x8118, 0x3cd: 0x8119, 0x3ce: 0x811a, 0x3cf: 0x811b, 0x3d0: 0x811c, 0x3d1: 0x811d, 0x3d2: 0x811e, 0x3d3: 0x9933, 0x3d4: 0x9933, 0x3d5: 0x992e, 0x3d6: 0x812e, 0x3d7: 0x8133, 0x3d8: 0x8133, 0x3d9: 0x8133, 0x3da: 0x8133, 0x3db: 0x8133, 0x3dc: 0x812e, 0x3dd: 0x8133, 0x3de: 0x8133, 0x3df: 0x812e, 0x3f0: 0x811f, 0x3f5: 0x1eb4, 0x3f6: 0x2143, 0x3f7: 0x217f, 0x3f8: 0x217a, // Block 0x10, offset 0x400 0x40a: 0x8133, 0x40b: 0x8133, 0x40c: 0x8133, 0x40d: 0x8133, 0x40e: 0x8133, 0x40f: 0x812e, 0x410: 0x812e, 0x411: 0x812e, 0x412: 0x812e, 0x413: 0x812e, 0x414: 0x8133, 0x415: 0x8133, 0x416: 0x8133, 0x417: 0x8133, 0x418: 0x8133, 0x419: 0x8133, 0x41a: 0x8133, 0x41b: 0x8133, 0x41c: 0x8133, 0x41d: 0x8133, 0x41e: 0x8133, 0x41f: 0x8133, 0x420: 0x8133, 0x421: 0x8133, 0x423: 0x812e, 0x424: 0x8133, 0x425: 0x8133, 0x426: 0x812e, 0x427: 0x8133, 0x428: 0x8133, 0x429: 0x812e, 0x42a: 0x8133, 0x42b: 0x8133, 0x42c: 0x8133, 0x42d: 0x812e, 0x42e: 0x812e, 0x42f: 0x812e, 0x430: 0x8117, 0x431: 0x8118, 0x432: 0x8119, 0x433: 0x8133, 0x434: 0x8133, 0x435: 0x8133, 0x436: 0x812e, 0x437: 0x8133, 0x438: 0x8133, 0x439: 0x812e, 0x43a: 0x812e, 0x43b: 0x8133, 0x43c: 0x8133, 0x43d: 0x8133, 0x43e: 0x8133, 0x43f: 0x8133, // Block 0x11, offset 0x440 0x445: 0xa000, 0x446: 0x3ee7, 0x447: 0xa000, 0x448: 0x3eef, 0x449: 0xa000, 0x44a: 0x3ef7, 0x44b: 0xa000, 0x44c: 0x3eff, 0x44d: 0xa000, 0x44e: 0x3f07, 0x451: 0xa000, 0x452: 0x3f0f, 0x474: 0x8103, 0x475: 0x9900, 0x47a: 0xa000, 0x47b: 0x3f17, 0x47c: 0xa000, 0x47d: 0x3f1f, 0x47e: 0xa000, 0x47f: 0xa000, // Block 0x12, offset 0x480 0x480: 0x0069, 0x481: 0x006b, 0x482: 0x006f, 0x483: 0x0083, 0x484: 0x0104, 0x485: 0x0107, 0x486: 0x0506, 0x487: 0x0085, 0x488: 0x0089, 0x489: 0x008b, 0x48a: 0x011f, 0x48b: 0x0122, 0x48c: 0x0125, 0x48d: 0x008f, 0x48f: 0x0097, 0x490: 0x009b, 0x491: 0x00e6, 0x492: 0x009f, 0x493: 0x0110, 0x494: 0x050a, 0x495: 0x050e, 0x496: 0x00a1, 0x497: 0x00a9, 0x498: 0x00ab, 0x499: 0x0516, 0x49a: 0x015b, 0x49b: 0x00ad, 0x49c: 0x051a, 0x49d: 0x0242, 0x49e: 0x0245, 0x49f: 0x0248, 0x4a0: 0x027e, 0x4a1: 0x0281, 0x4a2: 0x0093, 0x4a3: 0x00a5, 0x4a4: 0x00ab, 0x4a5: 0x00ad, 0x4a6: 0x0242, 0x4a7: 0x0245, 0x4a8: 0x026f, 0x4a9: 0x027e, 0x4aa: 0x0281, 0x4b8: 0x02b4, // Block 0x13, offset 0x4c0 0x4db: 0x010a, 0x4dc: 0x0087, 0x4dd: 0x0113, 0x4de: 0x00d7, 0x4df: 0x0125, 0x4e0: 0x008d, 0x4e1: 0x012b, 0x4e2: 0x0131, 0x4e3: 0x013d, 0x4e4: 0x0146, 0x4e5: 0x0149, 0x4e6: 0x014c, 0x4e7: 0x051e, 0x4e8: 0x01c7, 0x4e9: 0x0155, 0x4ea: 0x0522, 0x4eb: 0x01ca, 0x4ec: 0x0161, 0x4ed: 0x015e, 0x4ee: 0x0164, 0x4ef: 0x0167, 0x4f0: 0x016a, 0x4f1: 0x016d, 0x4f2: 0x0176, 0x4f3: 0x018e, 0x4f4: 0x0191, 0x4f5: 0x00f2, 0x4f6: 0x019a, 0x4f7: 0x019d, 0x4f8: 0x0512, 0x4f9: 0x01a0, 0x4fa: 0x01a3, 0x4fb: 0x00b5, 0x4fc: 0x01af, 0x4fd: 0x01b2, 0x4fe: 0x01b5, 0x4ff: 0x0254, // Block 0x14, offset 0x500 0x500: 0x8133, 0x501: 0x8133, 0x502: 0x812e, 0x503: 0x8133, 0x504: 0x8133, 0x505: 0x8133, 0x506: 0x8133, 0x507: 0x8133, 0x508: 0x8133, 0x509: 0x8133, 0x50a: 0x812e, 0x50b: 0x8133, 0x50c: 0x8133, 0x50d: 0x8136, 0x50e: 0x812b, 0x50f: 0x812e, 0x510: 0x812a, 0x511: 0x8133, 0x512: 0x8133, 0x513: 0x8133, 0x514: 0x8133, 0x515: 0x8133, 0x516: 0x8133, 0x517: 0x8133, 0x518: 0x8133, 0x519: 0x8133, 0x51a: 0x8133, 0x51b: 0x8133, 0x51c: 0x8133, 0x51d: 0x8133, 0x51e: 0x8133, 0x51f: 0x8133, 0x520: 0x8133, 0x521: 0x8133, 0x522: 0x8133, 0x523: 0x8133, 0x524: 0x8133, 0x525: 0x8133, 0x526: 0x8133, 0x527: 0x8133, 0x528: 0x8133, 0x529: 0x8133, 0x52a: 0x8133, 0x52b: 0x8133, 0x52c: 0x8133, 0x52d: 0x8133, 0x52e: 0x8133, 0x52f: 0x8133, 0x530: 0x8133, 0x531: 0x8133, 0x532: 0x8133, 0x533: 0x8133, 0x534: 0x8133, 0x535: 0x8133, 0x536: 0x8134, 0x537: 0x8132, 0x538: 0x8132, 0x539: 0x812e, 0x53a: 0x812d, 0x53b: 0x8133, 0x53c: 0x8135, 0x53d: 0x812e, 0x53e: 0x8133, 0x53f: 0x812e, // Block 0x15, offset 0x540 0x540: 0x2ef6, 0x541: 0x3202, 0x542: 0x2f00, 0x543: 0x320c, 0x544: 0x2f05, 0x545: 0x3211, 0x546: 0x2f0a, 0x547: 0x3216, 0x548: 0x382b, 0x549: 0x39ba, 0x54a: 0x2f23, 0x54b: 0x322f, 0x54c: 0x2f2d, 0x54d: 0x3239, 0x54e: 0x2f3c, 0x54f: 0x3248, 0x550: 0x2f32, 0x551: 0x323e, 0x552: 0x2f37, 0x553: 0x3243, 0x554: 0x384e, 0x555: 0x39dd, 0x556: 0x3855, 0x557: 0x39e4, 0x558: 0x2f78, 0x559: 0x3284, 0x55a: 0x2f7d, 0x55b: 0x3289, 0x55c: 0x3863, 0x55d: 0x39f2, 0x55e: 0x2f82, 0x55f: 0x328e, 0x560: 0x2f91, 0x561: 0x329d, 0x562: 0x2faf, 0x563: 0x32bb, 0x564: 0x2fbe, 0x565: 0x32ca, 0x566: 0x2fb4, 0x567: 0x32c0, 0x568: 0x2fc3, 0x569: 0x32cf, 0x56a: 0x2fc8, 0x56b: 0x32d4, 0x56c: 0x300e, 0x56d: 0x331a, 0x56e: 0x386a, 0x56f: 0x39f9, 0x570: 0x3018, 0x571: 0x3329, 0x572: 0x3022, 0x573: 0x3333, 0x574: 0x302c, 0x575: 0x333d, 0x576: 0x47f5, 0x577: 0x4886, 0x578: 0x3871, 0x579: 0x3a00, 0x57a: 0x3045, 0x57b: 0x3356, 0x57c: 0x3040, 0x57d: 0x3351, 0x57e: 0x304a, 0x57f: 0x335b, // Block 0x16, offset 0x580 0x580: 0x304f, 0x581: 0x3360, 0x582: 0x3054, 0x583: 0x3365, 0x584: 0x3068, 0x585: 0x3379, 0x586: 0x3072, 0x587: 0x3383, 0x588: 0x3081, 0x589: 0x3392, 0x58a: 0x307c, 0x58b: 0x338d, 0x58c: 0x3894, 0x58d: 0x3a23, 0x58e: 0x38a2, 0x58f: 0x3a31, 0x590: 0x38a9, 0x591: 0x3a38, 0x592: 0x38b0, 0x593: 0x3a3f, 0x594: 0x30ae, 0x595: 0x33bf, 0x596: 0x30b3, 0x597: 0x33c4, 0x598: 0x30bd, 0x599: 0x33ce, 0x59a: 0x4822, 0x59b: 0x48b3, 0x59c: 0x38f6, 0x59d: 0x3a85, 0x59e: 0x30d6, 0x59f: 0x33e7, 0x5a0: 0x30e0, 0x5a1: 0x33f1, 0x5a2: 0x4831, 0x5a3: 0x48c2, 0x5a4: 0x38fd, 0x5a5: 0x3a8c, 0x5a6: 0x3904, 0x5a7: 0x3a93, 0x5a8: 0x390b, 0x5a9: 0x3a9a, 0x5aa: 0x30ef, 0x5ab: 0x3400, 0x5ac: 0x30f9, 0x5ad: 0x340f, 0x5ae: 0x310d, 0x5af: 0x3423, 0x5b0: 0x3108, 0x5b1: 0x341e, 0x5b2: 0x3149, 0x5b3: 0x345f, 0x5b4: 0x3158, 0x5b5: 0x346e, 0x5b6: 0x3153, 0x5b7: 0x3469, 0x5b8: 0x3912, 0x5b9: 0x3aa1, 0x5ba: 0x3919, 0x5bb: 0x3aa8, 0x5bc: 0x315d, 0x5bd: 0x3473, 0x5be: 0x3162, 0x5bf: 0x3478, // Block 0x17, offset 0x5c0 0x5c0: 0x3167, 0x5c1: 0x347d, 0x5c2: 0x316c, 0x5c3: 0x3482, 0x5c4: 0x317b, 0x5c5: 0x3491, 0x5c6: 0x3176, 0x5c7: 0x348c, 0x5c8: 0x3180, 0x5c9: 0x349b, 0x5ca: 0x3185, 0x5cb: 0x34a0, 0x5cc: 0x318a, 0x5cd: 0x34a5, 0x5ce: 0x31a8, 0x5cf: 0x34c3, 0x5d0: 0x31c1, 0x5d1: 0x34e1, 0x5d2: 0x31d0, 0x5d3: 0x34f0, 0x5d4: 0x31d5, 0x5d5: 0x34f5, 0x5d6: 0x32d9, 0x5d7: 0x3405, 0x5d8: 0x3496, 0x5d9: 0x34d2, 0x5da: 0x1d10, 0x5db: 0x4390, 0x5e0: 0x47d2, 0x5e1: 0x4863, 0x5e2: 0x2ee2, 0x5e3: 0x31ee, 0x5e4: 0x37d7, 0x5e5: 0x3966, 0x5e6: 0x37d0, 0x5e7: 0x395f, 0x5e8: 0x37e5, 0x5e9: 0x3974, 0x5ea: 0x37de, 0x5eb: 0x396d, 0x5ec: 0x381d, 0x5ed: 0x39ac, 0x5ee: 0x37f3, 0x5ef: 0x3982, 0x5f0: 0x37ec, 0x5f1: 0x397b, 0x5f2: 0x3801, 0x5f3: 0x3990, 0x5f4: 0x37fa, 0x5f5: 0x3989, 0x5f6: 0x3824, 0x5f7: 0x39b3, 0x5f8: 0x47e6, 0x5f9: 0x4877, 0x5fa: 0x2f5f, 0x5fb: 0x326b, 0x5fc: 0x2f4b, 0x5fd: 0x3257, 0x5fe: 0x3839, 0x5ff: 0x39c8, // Block 0x18, offset 0x600 0x600: 0x3832, 0x601: 0x39c1, 0x602: 0x3847, 0x603: 0x39d6, 0x604: 0x3840, 0x605: 0x39cf, 0x606: 0x385c, 0x607: 0x39eb, 0x608: 0x2ff0, 0x609: 0x32fc, 0x60a: 0x3004, 0x60b: 0x3310, 0x60c: 0x4818, 0x60d: 0x48a9, 0x60e: 0x3095, 0x60f: 0x33a6, 0x610: 0x387f, 0x611: 0x3a0e, 0x612: 0x3878, 0x613: 0x3a07, 0x614: 0x388d, 0x615: 0x3a1c, 0x616: 0x3886, 0x617: 0x3a15, 0x618: 0x38e8, 0x619: 0x3a77, 0x61a: 0x38cc, 0x61b: 0x3a5b, 0x61c: 0x38c5, 0x61d: 0x3a54, 0x61e: 0x38da, 0x61f: 0x3a69, 0x620: 0x38d3, 0x621: 0x3a62, 0x622: 0x38e1, 0x623: 0x3a70, 0x624: 0x3144, 0x625: 0x345a, 0x626: 0x3126, 0x627: 0x343c, 0x628: 0x3943, 0x629: 0x3ad2, 0x62a: 0x393c, 0x62b: 0x3acb, 0x62c: 0x3951, 0x62d: 0x3ae0, 0x62e: 0x394a, 0x62f: 0x3ad9, 0x630: 0x3958, 0x631: 0x3ae7, 0x632: 0x318f, 0x633: 0x34aa, 0x634: 0x31b7, 0x635: 0x34d7, 0x636: 0x31b2, 0x637: 0x34cd, 0x638: 0x319e, 0x639: 0x34b9, // Block 0x19, offset 0x640 0x640: 0x4935, 0x641: 0x493b, 0x642: 0x4a4f, 0x643: 0x4a67, 0x644: 0x4a57, 0x645: 0x4a6f, 0x646: 0x4a5f, 0x647: 0x4a77, 0x648: 0x48db, 0x649: 0x48e1, 0x64a: 0x49bf, 0x64b: 0x49d7, 0x64c: 0x49c7, 0x64d: 0x49df, 0x64e: 0x49cf, 0x64f: 0x49e7, 0x650: 0x4947, 0x651: 0x494d, 0x652: 0x3d17, 0x653: 0x3d27, 0x654: 0x3d1f, 0x655: 0x3d2f, 0x658: 0x48e7, 0x659: 0x48ed, 0x65a: 0x3c47, 0x65b: 0x3c57, 0x65c: 0x3c4f, 0x65d: 0x3c5f, 0x660: 0x495f, 0x661: 0x4965, 0x662: 0x4a7f, 0x663: 0x4a97, 0x664: 0x4a87, 0x665: 0x4a9f, 0x666: 0x4a8f, 0x667: 0x4aa7, 0x668: 0x48f3, 0x669: 0x48f9, 0x66a: 0x49ef, 0x66b: 0x4a07, 0x66c: 0x49f7, 0x66d: 0x4a0f, 0x66e: 0x49ff, 0x66f: 0x4a17, 0x670: 0x4977, 0x671: 0x497d, 0x672: 0x3d77, 0x673: 0x3d8f, 0x674: 0x3d7f, 0x675: 0x3d97, 0x676: 0x3d87, 0x677: 0x3d9f, 0x678: 0x48ff, 0x679: 0x4905, 0x67a: 0x3c77, 0x67b: 0x3c8f, 0x67c: 0x3c7f, 0x67d: 0x3c97, 0x67e: 0x3c87, 0x67f: 0x3c9f, // Block 0x1a, offset 0x680 0x680: 0x4983, 0x681: 0x4989, 0x682: 0x3da7, 0x683: 0x3db7, 0x684: 0x3daf, 0x685: 0x3dbf, 0x688: 0x490b, 0x689: 0x4911, 0x68a: 0x3ca7, 0x68b: 0x3cb7, 0x68c: 0x3caf, 0x68d: 0x3cbf, 0x690: 0x4995, 0x691: 0x499b, 0x692: 0x3ddf, 0x693: 0x3df7, 0x694: 0x3de7, 0x695: 0x3dff, 0x696: 0x3def, 0x697: 0x3e07, 0x699: 0x4917, 0x69b: 0x3cc7, 0x69d: 0x3ccf, 0x69f: 0x3cd7, 0x6a0: 0x49ad, 0x6a1: 0x49b3, 0x6a2: 0x4aaf, 0x6a3: 0x4ac7, 0x6a4: 0x4ab7, 0x6a5: 0x4acf, 0x6a6: 0x4abf, 0x6a7: 0x4ad7, 0x6a8: 0x491d, 0x6a9: 0x4923, 0x6aa: 0x4a1f, 0x6ab: 0x4a37, 0x6ac: 0x4a27, 0x6ad: 0x4a3f, 0x6ae: 0x4a2f, 0x6af: 0x4a47, 0x6b0: 0x4929, 0x6b1: 0x43d7, 0x6b2: 0x35f0, 0x6b3: 0x43dd, 0x6b4: 0x4953, 0x6b5: 0x43e3, 0x6b6: 0x3602, 0x6b7: 0x43e9, 0x6b8: 0x3620, 0x6b9: 0x43ef, 0x6ba: 0x3638, 0x6bb: 0x43f5, 0x6bc: 0x49a1, 0x6bd: 0x43fb, // Block 0x1b, offset 0x6c0 0x6c0: 0x3cff, 0x6c1: 0x3d07, 0x6c2: 0x41c3, 0x6c3: 0x41e1, 0x6c4: 0x41cd, 0x6c5: 0x41eb, 0x6c6: 0x41d7, 0x6c7: 0x41f5, 0x6c8: 0x3c37, 0x6c9: 0x3c3f, 0x6ca: 0x410f, 0x6cb: 0x412d, 0x6cc: 0x4119, 0x6cd: 0x4137, 0x6ce: 0x4123, 0x6cf: 0x4141, 0x6d0: 0x3d47, 0x6d1: 0x3d4f, 0x6d2: 0x41ff, 0x6d3: 0x421d, 0x6d4: 0x4209, 0x6d5: 0x4227, 0x6d6: 0x4213, 0x6d7: 0x4231, 0x6d8: 0x3c67, 0x6d9: 0x3c6f, 0x6da: 0x414b, 0x6db: 0x4169, 0x6dc: 0x4155, 0x6dd: 0x4173, 0x6de: 0x415f, 0x6df: 0x417d, 0x6e0: 0x3e1f, 0x6e1: 0x3e27, 0x6e2: 0x423b, 0x6e3: 0x4259, 0x6e4: 0x4245, 0x6e5: 0x4263, 0x6e6: 0x424f, 0x6e7: 0x426d, 0x6e8: 0x3cdf, 0x6e9: 0x3ce7, 0x6ea: 0x4187, 0x6eb: 0x41a5, 0x6ec: 0x4191, 0x6ed: 0x41af, 0x6ee: 0x419b, 0x6ef: 0x41b9, 0x6f0: 0x35e4, 0x6f1: 0x35de, 0x6f2: 0x3cef, 0x6f3: 0x35ea, 0x6f4: 0x3cf7, 0x6f6: 0x4941, 0x6f7: 0x3d0f, 0x6f8: 0x3554, 0x6f9: 0x354e, 0x6fa: 0x3542, 0x6fb: 0x43a7, 0x6fc: 0x355a, 0x6fd: 0x4340, 0x6fe: 0x0257, 0x6ff: 0x4340, // Block 0x1c, offset 0x700 0x700: 0x4359, 0x701: 0x453b, 0x702: 0x3d37, 0x703: 0x35fc, 0x704: 0x3d3f, 0x706: 0x496b, 0x707: 0x3d57, 0x708: 0x3560, 0x709: 0x43ad, 0x70a: 0x356c, 0x70b: 0x43b3, 0x70c: 0x3578, 0x70d: 0x4542, 0x70e: 0x4549, 0x70f: 0x4550, 0x710: 0x3614, 0x711: 0x360e, 0x712: 0x3d5f, 0x713: 0x459d, 0x716: 0x361a, 0x717: 0x3d6f, 0x718: 0x3590, 0x719: 0x358a, 0x71a: 0x357e, 0x71b: 0x43b9, 0x71d: 0x4557, 0x71e: 0x455e, 0x71f: 0x4565, 0x720: 0x364a, 0x721: 0x3644, 0x722: 0x3dc7, 0x723: 0x45a5, 0x724: 0x362c, 0x725: 0x3632, 0x726: 0x3650, 0x727: 0x3dd7, 0x728: 0x35c0, 0x729: 0x35ba, 0x72a: 0x35ae, 0x72b: 0x43c5, 0x72c: 0x35a8, 0x72d: 0x452d, 0x72e: 0x4534, 0x72f: 0x0081, 0x732: 0x3e0f, 0x733: 0x3656, 0x734: 0x3e17, 0x736: 0x49b9, 0x737: 0x3e2f, 0x738: 0x359c, 0x739: 0x43bf, 0x73a: 0x35cc, 0x73b: 0x43d1, 0x73c: 0x35d8, 0x73d: 0x4313, 0x73e: 0x4345, // Block 0x1d, offset 0x740 0x740: 0x1d08, 0x741: 0x1d0c, 0x742: 0x0047, 0x743: 0x1d84, 0x745: 0x1d18, 0x746: 0x1d1c, 0x747: 0x00ef, 0x749: 0x1d88, 0x74a: 0x008f, 0x74b: 0x0051, 0x74c: 0x0051, 0x74d: 0x0051, 0x74e: 0x0091, 0x74f: 0x00e0, 0x750: 0x0053, 0x751: 0x0053, 0x752: 0x0059, 0x753: 0x0099, 0x755: 0x005d, 0x756: 0x1abd, 0x759: 0x0061, 0x75a: 0x0063, 0x75b: 0x0065, 0x75c: 0x0065, 0x75d: 0x0065, 0x760: 0x1acf, 0x761: 0x1cf8, 0x762: 0x1ad8, 0x764: 0x0075, 0x766: 0x023c, 0x768: 0x0075, 0x76a: 0x0057, 0x76b: 0x438b, 0x76c: 0x0045, 0x76d: 0x0047, 0x76f: 0x008b, 0x770: 0x004b, 0x771: 0x004d, 0x773: 0x005b, 0x774: 0x009f, 0x775: 0x0308, 0x776: 0x030b, 0x777: 0x030e, 0x778: 0x0311, 0x779: 0x0093, 0x77b: 0x1cc8, 0x77c: 0x026c, 0x77d: 0x0245, 0x77e: 0x01fd, 0x77f: 0x0224, // Block 0x1e, offset 0x780 0x780: 0x055a, 0x785: 0x0049, 0x786: 0x0089, 0x787: 0x008b, 0x788: 0x0093, 0x789: 0x0095, 0x790: 0x235e, 0x791: 0x236a, 0x792: 0x241e, 0x793: 0x2346, 0x794: 0x23ca, 0x795: 0x2352, 0x796: 0x23d0, 0x797: 0x23e8, 0x798: 0x23f4, 0x799: 0x2358, 0x79a: 0x23fa, 0x79b: 0x2364, 0x79c: 0x23ee, 0x79d: 0x2400, 0x79e: 0x2406, 0x79f: 0x1dec, 0x7a0: 0x0053, 0x7a1: 0x1a87, 0x7a2: 0x1cd4, 0x7a3: 0x1a90, 0x7a4: 0x006d, 0x7a5: 0x1adb, 0x7a6: 0x1d00, 0x7a7: 0x1e78, 0x7a8: 0x1a93, 0x7a9: 0x0071, 0x7aa: 0x1ae7, 0x7ab: 0x1d04, 0x7ac: 0x0059, 0x7ad: 0x0047, 0x7ae: 0x0049, 0x7af: 0x005b, 0x7b0: 0x0093, 0x7b1: 0x1b14, 0x7b2: 0x1d48, 0x7b3: 0x1b1d, 0x7b4: 0x00ad, 0x7b5: 0x1b92, 0x7b6: 0x1d7c, 0x7b7: 0x1e8c, 0x7b8: 0x1b20, 0x7b9: 0x00b1, 0x7ba: 0x1b95, 0x7bb: 0x1d80, 0x7bc: 0x0099, 0x7bd: 0x0087, 0x7be: 0x0089, 0x7bf: 0x009b, // Block 0x1f, offset 0x7c0 0x7c1: 0x3b65, 0x7c3: 0xa000, 0x7c4: 0x3b6c, 0x7c5: 0xa000, 0x7c7: 0x3b73, 0x7c8: 0xa000, 0x7c9: 0x3b7a, 0x7cd: 0xa000, 0x7e0: 0x2ec4, 0x7e1: 0xa000, 0x7e2: 0x3b88, 0x7e4: 0xa000, 0x7e5: 0xa000, 0x7ed: 0x3b81, 0x7ee: 0x2ebf, 0x7ef: 0x2ec9, 0x7f0: 0x3b8f, 0x7f1: 0x3b96, 0x7f2: 0xa000, 0x7f3: 0xa000, 0x7f4: 0x3b9d, 0x7f5: 0x3ba4, 0x7f6: 0xa000, 0x7f7: 0xa000, 0x7f8: 0x3bab, 0x7f9: 0x3bb2, 0x7fa: 0xa000, 0x7fb: 0xa000, 0x7fc: 0xa000, 0x7fd: 0xa000, // Block 0x20, offset 0x800 0x800: 0x3bb9, 0x801: 0x3bc0, 0x802: 0xa000, 0x803: 0xa000, 0x804: 0x3bd5, 0x805: 0x3bdc, 0x806: 0xa000, 0x807: 0xa000, 0x808: 0x3be3, 0x809: 0x3bea, 0x811: 0xa000, 0x812: 0xa000, 0x822: 0xa000, 0x828: 0xa000, 0x829: 0xa000, 0x82b: 0xa000, 0x82c: 0x3bff, 0x82d: 0x3c06, 0x82e: 0x3c0d, 0x82f: 0x3c14, 0x832: 0xa000, 0x833: 0xa000, 0x834: 0xa000, 0x835: 0xa000, // Block 0x21, offset 0x840 0x860: 0x0023, 0x861: 0x0025, 0x862: 0x0027, 0x863: 0x0029, 0x864: 0x002b, 0x865: 0x002d, 0x866: 0x002f, 0x867: 0x0031, 0x868: 0x0033, 0x869: 0x19af, 0x86a: 0x19b2, 0x86b: 0x19b5, 0x86c: 0x19b8, 0x86d: 0x19bb, 0x86e: 0x19be, 0x86f: 0x19c1, 0x870: 0x19c4, 0x871: 0x19c7, 0x872: 0x19ca, 0x873: 0x19d3, 0x874: 0x1b98, 0x875: 0x1b9c, 0x876: 0x1ba0, 0x877: 0x1ba4, 0x878: 0x1ba8, 0x879: 0x1bac, 0x87a: 0x1bb0, 0x87b: 0x1bb4, 0x87c: 0x1bb8, 0x87d: 0x1db0, 0x87e: 0x1db5, 0x87f: 0x1dba, // Block 0x22, offset 0x880 0x880: 0x1dbf, 0x881: 0x1dc4, 0x882: 0x1dc9, 0x883: 0x1dce, 0x884: 0x1dd3, 0x885: 0x1dd8, 0x886: 0x1ddd, 0x887: 0x1de2, 0x888: 0x19ac, 0x889: 0x19d0, 0x88a: 0x19f4, 0x88b: 0x1a18, 0x88c: 0x1a3c, 0x88d: 0x1a45, 0x88e: 0x1a4b, 0x88f: 0x1a51, 0x890: 0x1a57, 0x891: 0x1c90, 0x892: 0x1c94, 0x893: 0x1c98, 0x894: 0x1c9c, 0x895: 0x1ca0, 0x896: 0x1ca4, 0x897: 0x1ca8, 0x898: 0x1cac, 0x899: 0x1cb0, 0x89a: 0x1cb4, 0x89b: 0x1cb8, 0x89c: 0x1c24, 0x89d: 0x1c28, 0x89e: 0x1c2c, 0x89f: 0x1c30, 0x8a0: 0x1c34, 0x8a1: 0x1c38, 0x8a2: 0x1c3c, 0x8a3: 0x1c40, 0x8a4: 0x1c44, 0x8a5: 0x1c48, 0x8a6: 0x1c4c, 0x8a7: 0x1c50, 0x8a8: 0x1c54, 0x8a9: 0x1c58, 0x8aa: 0x1c5c, 0x8ab: 0x1c60, 0x8ac: 0x1c64, 0x8ad: 0x1c68, 0x8ae: 0x1c6c, 0x8af: 0x1c70, 0x8b0: 0x1c74, 0x8b1: 0x1c78, 0x8b2: 0x1c7c, 0x8b3: 0x1c80, 0x8b4: 0x1c84, 0x8b5: 0x1c88, 0x8b6: 0x0043, 0x8b7: 0x0045, 0x8b8: 0x0047, 0x8b9: 0x0049, 0x8ba: 0x004b, 0x8bb: 0x004d, 0x8bc: 0x004f, 0x8bd: 0x0051, 0x8be: 0x0053, 0x8bf: 0x0055, // Block 0x23, offset 0x8c0 0x8c0: 0x07ba, 0x8c1: 0x07de, 0x8c2: 0x07ea, 0x8c3: 0x07fa, 0x8c4: 0x0802, 0x8c5: 0x080e, 0x8c6: 0x0816, 0x8c7: 0x081e, 0x8c8: 0x082a, 0x8c9: 0x087e, 0x8ca: 0x0896, 0x8cb: 0x08a6, 0x8cc: 0x08b6, 0x8cd: 0x08c6, 0x8ce: 0x08d6, 0x8cf: 0x08f6, 0x8d0: 0x08fa, 0x8d1: 0x08fe, 0x8d2: 0x0932, 0x8d3: 0x095a, 0x8d4: 0x096a, 0x8d5: 0x0972, 0x8d6: 0x0976, 0x8d7: 0x0982, 0x8d8: 0x099e, 0x8d9: 0x09a2, 0x8da: 0x09ba, 0x8db: 0x09be, 0x8dc: 0x09c6, 0x8dd: 0x09d6, 0x8de: 0x0a72, 0x8df: 0x0a86, 0x8e0: 0x0ac6, 0x8e1: 0x0ada, 0x8e2: 0x0ae2, 0x8e3: 0x0ae6, 0x8e4: 0x0af6, 0x8e5: 0x0b12, 0x8e6: 0x0b3e, 0x8e7: 0x0b4a, 0x8e8: 0x0b6a, 0x8e9: 0x0b76, 0x8ea: 0x0b7a, 0x8eb: 0x0b7e, 0x8ec: 0x0b96, 0x8ed: 0x0b9a, 0x8ee: 0x0bc6, 0x8ef: 0x0bd2, 0x8f0: 0x0bda, 0x8f1: 0x0be2, 0x8f2: 0x0bf2, 0x8f3: 0x0bfa, 0x8f4: 0x0c02, 0x8f5: 0x0c2e, 0x8f6: 0x0c32, 0x8f7: 0x0c3a, 0x8f8: 0x0c3e, 0x8f9: 0x0c46, 0x8fa: 0x0c4e, 0x8fb: 0x0c5e, 0x8fc: 0x0c7a, 0x8fd: 0x0cf2, 0x8fe: 0x0d06, 0x8ff: 0x0d0a, // Block 0x24, offset 0x900 0x900: 0x0d8a, 0x901: 0x0d8e, 0x902: 0x0da2, 0x903: 0x0da6, 0x904: 0x0dae, 0x905: 0x0db6, 0x906: 0x0dbe, 0x907: 0x0dca, 0x908: 0x0df2, 0x909: 0x0e02, 0x90a: 0x0e16, 0x90b: 0x0e86, 0x90c: 0x0e92, 0x90d: 0x0ea2, 0x90e: 0x0eae, 0x90f: 0x0eba, 0x910: 0x0ec2, 0x911: 0x0ec6, 0x912: 0x0eca, 0x913: 0x0ece, 0x914: 0x0ed2, 0x915: 0x0f8a, 0x916: 0x0fd2, 0x917: 0x0fde, 0x918: 0x0fe2, 0x919: 0x0fe6, 0x91a: 0x0fea, 0x91b: 0x0ff2, 0x91c: 0x0ff6, 0x91d: 0x100a, 0x91e: 0x1026, 0x91f: 0x102e, 0x920: 0x106e, 0x921: 0x1072, 0x922: 0x107a, 0x923: 0x107e, 0x924: 0x1086, 0x925: 0x108a, 0x926: 0x10ae, 0x927: 0x10b2, 0x928: 0x10ce, 0x929: 0x10d2, 0x92a: 0x10d6, 0x92b: 0x10da, 0x92c: 0x10ee, 0x92d: 0x1112, 0x92e: 0x1116, 0x92f: 0x111a, 0x930: 0x113e, 0x931: 0x117e, 0x932: 0x1182, 0x933: 0x11a2, 0x934: 0x11b2, 0x935: 0x11ba, 0x936: 0x11da, 0x937: 0x11fe, 0x938: 0x1242, 0x939: 0x124a, 0x93a: 0x125e, 0x93b: 0x126a, 0x93c: 0x1272, 0x93d: 0x127a, 0x93e: 0x127e, 0x93f: 0x1282, // Block 0x25, offset 0x940 0x940: 0x129a, 0x941: 0x129e, 0x942: 0x12ba, 0x943: 0x12c2, 0x944: 0x12ca, 0x945: 0x12ce, 0x946: 0x12da, 0x947: 0x12e2, 0x948: 0x12e6, 0x949: 0x12ea, 0x94a: 0x12f2, 0x94b: 0x12f6, 0x94c: 0x1396, 0x94d: 0x13aa, 0x94e: 0x13de, 0x94f: 0x13e2, 0x950: 0x13ea, 0x951: 0x1416, 0x952: 0x141e, 0x953: 0x1426, 0x954: 0x142e, 0x955: 0x146a, 0x956: 0x146e, 0x957: 0x1476, 0x958: 0x147a, 0x959: 0x147e, 0x95a: 0x14aa, 0x95b: 0x14ae, 0x95c: 0x14b6, 0x95d: 0x14ca, 0x95e: 0x14ce, 0x95f: 0x14ea, 0x960: 0x14f2, 0x961: 0x14f6, 0x962: 0x151a, 0x963: 0x153a, 0x964: 0x154e, 0x965: 0x1552, 0x966: 0x155a, 0x967: 0x1586, 0x968: 0x158a, 0x969: 0x159a, 0x96a: 0x15be, 0x96b: 0x15ca, 0x96c: 0x15da, 0x96d: 0x15f2, 0x96e: 0x15fa, 0x96f: 0x15fe, 0x970: 0x1602, 0x971: 0x1606, 0x972: 0x1612, 0x973: 0x1616, 0x974: 0x161e, 0x975: 0x163a, 0x976: 0x163e, 0x977: 0x1642, 0x978: 0x165a, 0x979: 0x165e, 0x97a: 0x1666, 0x97b: 0x167a, 0x97c: 0x167e, 0x97d: 0x1682, 0x97e: 0x168a, 0x97f: 0x168e, // Block 0x26, offset 0x980 0x986: 0xa000, 0x98b: 0xa000, 0x98c: 0x3f47, 0x98d: 0xa000, 0x98e: 0x3f4f, 0x98f: 0xa000, 0x990: 0x3f57, 0x991: 0xa000, 0x992: 0x3f5f, 0x993: 0xa000, 0x994: 0x3f67, 0x995: 0xa000, 0x996: 0x3f6f, 0x997: 0xa000, 0x998: 0x3f77, 0x999: 0xa000, 0x99a: 0x3f7f, 0x99b: 0xa000, 0x99c: 0x3f87, 0x99d: 0xa000, 0x99e: 0x3f8f, 0x99f: 0xa000, 0x9a0: 0x3f97, 0x9a1: 0xa000, 0x9a2: 0x3f9f, 0x9a4: 0xa000, 0x9a5: 0x3fa7, 0x9a6: 0xa000, 0x9a7: 0x3faf, 0x9a8: 0xa000, 0x9a9: 0x3fb7, 0x9af: 0xa000, 0x9b0: 0x3fbf, 0x9b1: 0x3fc7, 0x9b2: 0xa000, 0x9b3: 0x3fcf, 0x9b4: 0x3fd7, 0x9b5: 0xa000, 0x9b6: 0x3fdf, 0x9b7: 0x3fe7, 0x9b8: 0xa000, 0x9b9: 0x3fef, 0x9ba: 0x3ff7, 0x9bb: 0xa000, 0x9bc: 0x3fff, 0x9bd: 0x4007, // Block 0x27, offset 0x9c0 0x9d4: 0x3f3f, 0x9d9: 0x9904, 0x9da: 0x9904, 0x9db: 0x4395, 0x9dc: 0x439b, 0x9dd: 0xa000, 0x9de: 0x400f, 0x9df: 0x27e4, 0x9e6: 0xa000, 0x9eb: 0xa000, 0x9ec: 0x401f, 0x9ed: 0xa000, 0x9ee: 0x4027, 0x9ef: 0xa000, 0x9f0: 0x402f, 0x9f1: 0xa000, 0x9f2: 0x4037, 0x9f3: 0xa000, 0x9f4: 0x403f, 0x9f5: 0xa000, 0x9f6: 0x4047, 0x9f7: 0xa000, 0x9f8: 0x404f, 0x9f9: 0xa000, 0x9fa: 0x4057, 0x9fb: 0xa000, 0x9fc: 0x405f, 0x9fd: 0xa000, 0x9fe: 0x4067, 0x9ff: 0xa000, // Block 0x28, offset 0xa00 0xa00: 0x406f, 0xa01: 0xa000, 0xa02: 0x4077, 0xa04: 0xa000, 0xa05: 0x407f, 0xa06: 0xa000, 0xa07: 0x4087, 0xa08: 0xa000, 0xa09: 0x408f, 0xa0f: 0xa000, 0xa10: 0x4097, 0xa11: 0x409f, 0xa12: 0xa000, 0xa13: 0x40a7, 0xa14: 0x40af, 0xa15: 0xa000, 0xa16: 0x40b7, 0xa17: 0x40bf, 0xa18: 0xa000, 0xa19: 0x40c7, 0xa1a: 0x40cf, 0xa1b: 0xa000, 0xa1c: 0x40d7, 0xa1d: 0x40df, 0xa2f: 0xa000, 0xa30: 0xa000, 0xa31: 0xa000, 0xa32: 0xa000, 0xa34: 0x4017, 0xa37: 0x40e7, 0xa38: 0x40ef, 0xa39: 0x40f7, 0xa3a: 0x40ff, 0xa3d: 0xa000, 0xa3e: 0x4107, 0xa3f: 0x27f9, // Block 0x29, offset 0xa40 0xa40: 0x045a, 0xa41: 0x041e, 0xa42: 0x0422, 0xa43: 0x0426, 0xa44: 0x046e, 0xa45: 0x042a, 0xa46: 0x042e, 0xa47: 0x0432, 0xa48: 0x0436, 0xa49: 0x043a, 0xa4a: 0x043e, 0xa4b: 0x0442, 0xa4c: 0x0446, 0xa4d: 0x044a, 0xa4e: 0x044e, 0xa4f: 0x4afe, 0xa50: 0x4b04, 0xa51: 0x4b0a, 0xa52: 0x4b10, 0xa53: 0x4b16, 0xa54: 0x4b1c, 0xa55: 0x4b22, 0xa56: 0x4b28, 0xa57: 0x4b2e, 0xa58: 0x4b34, 0xa59: 0x4b3a, 0xa5a: 0x4b40, 0xa5b: 0x4b46, 0xa5c: 0x4b4c, 0xa5d: 0x4b52, 0xa5e: 0x4b58, 0xa5f: 0x4b5e, 0xa60: 0x4b64, 0xa61: 0x4b6a, 0xa62: 0x4b70, 0xa63: 0x4b76, 0xa64: 0x04b6, 0xa65: 0x0452, 0xa66: 0x0456, 0xa67: 0x04da, 0xa68: 0x04de, 0xa69: 0x04e2, 0xa6a: 0x04e6, 0xa6b: 0x04ea, 0xa6c: 0x04ee, 0xa6d: 0x04f2, 0xa6e: 0x045e, 0xa6f: 0x04f6, 0xa70: 0x04fa, 0xa71: 0x0462, 0xa72: 0x0466, 0xa73: 0x046a, 0xa74: 0x0472, 0xa75: 0x0476, 0xa76: 0x047a, 0xa77: 0x047e, 0xa78: 0x0482, 0xa79: 0x0486, 0xa7a: 0x048a, 0xa7b: 0x048e, 0xa7c: 0x0492, 0xa7d: 0x0496, 0xa7e: 0x049a, 0xa7f: 0x049e, // Block 0x2a, offset 0xa80 0xa80: 0x04a2, 0xa81: 0x04a6, 0xa82: 0x04fe, 0xa83: 0x0502, 0xa84: 0x04aa, 0xa85: 0x04ae, 0xa86: 0x04b2, 0xa87: 0x04ba, 0xa88: 0x04be, 0xa89: 0x04c2, 0xa8a: 0x04c6, 0xa8b: 0x04ca, 0xa8c: 0x04ce, 0xa8d: 0x04d2, 0xa8e: 0x04d6, 0xa92: 0x07ba, 0xa93: 0x0816, 0xa94: 0x07c6, 0xa95: 0x0a76, 0xa96: 0x07ca, 0xa97: 0x07e2, 0xa98: 0x07ce, 0xa99: 0x108e, 0xa9a: 0x0802, 0xa9b: 0x07d6, 0xa9c: 0x07be, 0xa9d: 0x0afa, 0xa9e: 0x0a8a, 0xa9f: 0x082a, // Block 0x2b, offset 0xac0 0xac0: 0x2184, 0xac1: 0x218a, 0xac2: 0x2190, 0xac3: 0x2196, 0xac4: 0x219c, 0xac5: 0x21a2, 0xac6: 0x21a8, 0xac7: 0x21ae, 0xac8: 0x21b4, 0xac9: 0x21ba, 0xaca: 0x21c0, 0xacb: 0x21c6, 0xacc: 0x21cc, 0xacd: 0x21d2, 0xace: 0x285d, 0xacf: 0x2866, 0xad0: 0x286f, 0xad1: 0x2878, 0xad2: 0x2881, 0xad3: 0x288a, 0xad4: 0x2893, 0xad5: 0x289c, 0xad6: 0x28a5, 0xad7: 0x28b7, 0xad8: 0x28c0, 0xad9: 0x28c9, 0xada: 0x28d2, 0xadb: 0x28db, 0xadc: 0x28ae, 0xadd: 0x2ce3, 0xade: 0x2c24, 0xae0: 0x21d8, 0xae1: 0x21f0, 0xae2: 0x21e4, 0xae3: 0x2238, 0xae4: 0x21f6, 0xae5: 0x2214, 0xae6: 0x21de, 0xae7: 0x220e, 0xae8: 0x21ea, 0xae9: 0x2220, 0xaea: 0x2250, 0xaeb: 0x226e, 0xaec: 0x2268, 0xaed: 0x225c, 0xaee: 0x22aa, 0xaef: 0x223e, 0xaf0: 0x224a, 0xaf1: 0x2262, 0xaf2: 0x2256, 0xaf3: 0x2280, 0xaf4: 0x222c, 0xaf5: 0x2274, 0xaf6: 0x229e, 0xaf7: 0x2286, 0xaf8: 0x221a, 0xaf9: 0x21fc, 0xafa: 0x2232, 0xafb: 0x2244, 0xafc: 0x227a, 0xafd: 0x2202, 0xafe: 0x22a4, 0xaff: 0x2226, // Block 0x2c, offset 0xb00 0xb00: 0x228c, 0xb01: 0x2208, 0xb02: 0x2292, 0xb03: 0x2298, 0xb04: 0x0a2a, 0xb05: 0x0bfe, 0xb06: 0x0da2, 0xb07: 0x11c2, 0xb10: 0x1cf4, 0xb11: 0x19d6, 0xb12: 0x19d9, 0xb13: 0x19dc, 0xb14: 0x19df, 0xb15: 0x19e2, 0xb16: 0x19e5, 0xb17: 0x19e8, 0xb18: 0x19eb, 0xb19: 0x19ee, 0xb1a: 0x19f7, 0xb1b: 0x19fa, 0xb1c: 0x19fd, 0xb1d: 0x1a00, 0xb1e: 0x1a03, 0xb1f: 0x1a06, 0xb20: 0x0406, 0xb21: 0x040e, 0xb22: 0x0412, 0xb23: 0x041a, 0xb24: 0x041e, 0xb25: 0x0422, 0xb26: 0x042a, 0xb27: 0x0432, 0xb28: 0x0436, 0xb29: 0x043e, 0xb2a: 0x0442, 0xb2b: 0x0446, 0xb2c: 0x044a, 0xb2d: 0x044e, 0xb2e: 0x467d, 0xb2f: 0x4685, 0xb30: 0x468d, 0xb31: 0x4695, 0xb32: 0x469d, 0xb33: 0x46a5, 0xb34: 0x46ad, 0xb35: 0x46b5, 0xb36: 0x46c5, 0xb37: 0x46cd, 0xb38: 0x46d5, 0xb39: 0x46dd, 0xb3a: 0x46e5, 0xb3b: 0x46ed, 0xb3c: 0x2e42, 0xb3d: 0x2e0a, 0xb3e: 0x46bd, // Block 0x2d, offset 0xb40 0xb40: 0x07ba, 0xb41: 0x0816, 0xb42: 0x07c6, 0xb43: 0x0a76, 0xb44: 0x081a, 0xb45: 0x08aa, 0xb46: 0x07c2, 0xb47: 0x08a6, 0xb48: 0x0806, 0xb49: 0x0982, 0xb4a: 0x0e02, 0xb4b: 0x0f8a, 0xb4c: 0x0ed2, 0xb4d: 0x0e16, 0xb4e: 0x155a, 0xb4f: 0x0a86, 0xb50: 0x0dca, 0xb51: 0x0e46, 0xb52: 0x0e06, 0xb53: 0x1146, 0xb54: 0x09f6, 0xb55: 0x0ffe, 0xb56: 0x1482, 0xb57: 0x115a, 0xb58: 0x093e, 0xb59: 0x118a, 0xb5a: 0x1096, 0xb5b: 0x0b12, 0xb5c: 0x150a, 0xb5d: 0x087a, 0xb5e: 0x09a6, 0xb5f: 0x0ef2, 0xb60: 0x1622, 0xb61: 0x083e, 0xb62: 0x08ce, 0xb63: 0x0e96, 0xb64: 0x07ca, 0xb65: 0x07e2, 0xb66: 0x07ce, 0xb67: 0x0bd6, 0xb68: 0x09ea, 0xb69: 0x097a, 0xb6a: 0x0b52, 0xb6b: 0x0b46, 0xb6c: 0x10e6, 0xb6d: 0x083a, 0xb6e: 0x1496, 0xb6f: 0x0996, 0xb70: 0x0aee, 0xb71: 0x1a09, 0xb72: 0x1a0c, 0xb73: 0x1a0f, 0xb74: 0x1a12, 0xb75: 0x1a1b, 0xb76: 0x1a1e, 0xb77: 0x1a21, 0xb78: 0x1a24, 0xb79: 0x1a27, 0xb7a: 0x1a2a, 0xb7b: 0x1a2d, 0xb7c: 0x1a30, 0xb7d: 0x1a33, 0xb7e: 0x1a36, 0xb7f: 0x1a3f, // Block 0x2e, offset 0xb80 0xb80: 0x1df6, 0xb81: 0x1e05, 0xb82: 0x1e14, 0xb83: 0x1e23, 0xb84: 0x1e32, 0xb85: 0x1e41, 0xb86: 0x1e50, 0xb87: 0x1e5f, 0xb88: 0x1e6e, 0xb89: 0x22bc, 0xb8a: 0x22ce, 0xb8b: 0x22e0, 0xb8c: 0x1a81, 0xb8d: 0x1d34, 0xb8e: 0x1b02, 0xb8f: 0x1cd8, 0xb90: 0x05c6, 0xb91: 0x05ce, 0xb92: 0x05d6, 0xb93: 0x05de, 0xb94: 0x05e6, 0xb95: 0x05ea, 0xb96: 0x05ee, 0xb97: 0x05f2, 0xb98: 0x05f6, 0xb99: 0x05fa, 0xb9a: 0x05fe, 0xb9b: 0x0602, 0xb9c: 0x0606, 0xb9d: 0x060a, 0xb9e: 0x060e, 0xb9f: 0x0612, 0xba0: 0x0616, 0xba1: 0x061e, 0xba2: 0x0622, 0xba3: 0x0626, 0xba4: 0x062a, 0xba5: 0x062e, 0xba6: 0x0632, 0xba7: 0x0636, 0xba8: 0x063a, 0xba9: 0x063e, 0xbaa: 0x0642, 0xbab: 0x0646, 0xbac: 0x064a, 0xbad: 0x064e, 0xbae: 0x0652, 0xbaf: 0x0656, 0xbb0: 0x065a, 0xbb1: 0x065e, 0xbb2: 0x0662, 0xbb3: 0x066a, 0xbb4: 0x0672, 0xbb5: 0x067a, 0xbb6: 0x067e, 0xbb7: 0x0682, 0xbb8: 0x0686, 0xbb9: 0x068a, 0xbba: 0x068e, 0xbbb: 0x0692, 0xbbc: 0x0696, 0xbbd: 0x069a, 0xbbe: 0x069e, 0xbbf: 0x282a, // Block 0x2f, offset 0xbc0 0xbc0: 0x2c43, 0xbc1: 0x2adf, 0xbc2: 0x2c53, 0xbc3: 0x29b7, 0xbc4: 0x2e53, 0xbc5: 0x29c1, 0xbc6: 0x29cb, 0xbc7: 0x2e97, 0xbc8: 0x2aec, 0xbc9: 0x29d5, 0xbca: 0x29df, 0xbcb: 0x29e9, 0xbcc: 0x2b13, 0xbcd: 0x2b20, 0xbce: 0x2af9, 0xbcf: 0x2b06, 0xbd0: 0x2e18, 0xbd1: 0x2b2d, 0xbd2: 0x2b3a, 0xbd3: 0x2cf5, 0xbd4: 0x27eb, 0xbd5: 0x2d08, 0xbd6: 0x2d1b, 0xbd7: 0x2c63, 0xbd8: 0x2b47, 0xbd9: 0x2d2e, 0xbda: 0x2d41, 0xbdb: 0x2b54, 0xbdc: 0x29f3, 0xbdd: 0x29fd, 0xbde: 0x2e26, 0xbdf: 0x2b61, 0xbe0: 0x2c73, 0xbe1: 0x2e64, 0xbe2: 0x2a07, 0xbe3: 0x2a11, 0xbe4: 0x2b6e, 0xbe5: 0x2a1b, 0xbe6: 0x2a25, 0xbe7: 0x2800, 0xbe8: 0x2807, 0xbe9: 0x2a2f, 0xbea: 0x2a39, 0xbeb: 0x2d54, 0xbec: 0x2b7b, 0xbed: 0x2c83, 0xbee: 0x2d67, 0xbef: 0x2b88, 0xbf0: 0x2a4d, 0xbf1: 0x2a43, 0xbf2: 0x2eab, 0xbf3: 0x2b95, 0xbf4: 0x2d7a, 0xbf5: 0x2a57, 0xbf6: 0x2c93, 0xbf7: 0x2a61, 0xbf8: 0x2baf, 0xbf9: 0x2a6b, 0xbfa: 0x2bbc, 0xbfb: 0x2e75, 0xbfc: 0x2ba2, 0xbfd: 0x2ca3, 0xbfe: 0x2bc9, 0xbff: 0x280e, // Block 0x30, offset 0xc00 0xc00: 0x2e86, 0xc01: 0x2a75, 0xc02: 0x2a7f, 0xc03: 0x2bd6, 0xc04: 0x2a89, 0xc05: 0x2a93, 0xc06: 0x2a9d, 0xc07: 0x2cb3, 0xc08: 0x2be3, 0xc09: 0x2815, 0xc0a: 0x2d8d, 0xc0b: 0x2dff, 0xc0c: 0x2cc3, 0xc0d: 0x2bf0, 0xc0e: 0x2e34, 0xc0f: 0x2aa7, 0xc10: 0x2ab1, 0xc11: 0x2bfd, 0xc12: 0x281c, 0xc13: 0x2c0a, 0xc14: 0x2cd3, 0xc15: 0x2823, 0xc16: 0x2da0, 0xc17: 0x2abb, 0xc18: 0x1de7, 0xc19: 0x1dfb, 0xc1a: 0x1e0a, 0xc1b: 0x1e19, 0xc1c: 0x1e28, 0xc1d: 0x1e37, 0xc1e: 0x1e46, 0xc1f: 0x1e55, 0xc20: 0x1e64, 0xc21: 0x1e73, 0xc22: 0x22c2, 0xc23: 0x22d4, 0xc24: 0x22e6, 0xc25: 0x22f2, 0xc26: 0x22fe, 0xc27: 0x230a, 0xc28: 0x2316, 0xc29: 0x2322, 0xc2a: 0x232e, 0xc2b: 0x233a, 0xc2c: 0x2376, 0xc2d: 0x2382, 0xc2e: 0x238e, 0xc2f: 0x239a, 0xc30: 0x23a6, 0xc31: 0x1d44, 0xc32: 0x1af6, 0xc33: 0x1a63, 0xc34: 0x1d14, 0xc35: 0x1b77, 0xc36: 0x1b86, 0xc37: 0x1afc, 0xc38: 0x1d2c, 0xc39: 0x1d30, 0xc3a: 0x1a8d, 0xc3b: 0x2838, 0xc3c: 0x2846, 0xc3d: 0x2831, 0xc3e: 0x283f, 0xc3f: 0x2c17, // Block 0x31, offset 0xc40 0xc40: 0x1b7a, 0xc41: 0x1b62, 0xc42: 0x1d90, 0xc43: 0x1b4a, 0xc44: 0x1b23, 0xc45: 0x1a96, 0xc46: 0x1aa5, 0xc47: 0x1a75, 0xc48: 0x1d20, 0xc49: 0x1e82, 0xc4a: 0x1b7d, 0xc4b: 0x1b65, 0xc4c: 0x1d94, 0xc4d: 0x1da0, 0xc4e: 0x1b56, 0xc4f: 0x1b2c, 0xc50: 0x1a84, 0xc51: 0x1d4c, 0xc52: 0x1ce0, 0xc53: 0x1ccc, 0xc54: 0x1cfc, 0xc55: 0x1da4, 0xc56: 0x1b59, 0xc57: 0x1af9, 0xc58: 0x1b2f, 0xc59: 0x1b0e, 0xc5a: 0x1b71, 0xc5b: 0x1da8, 0xc5c: 0x1b5c, 0xc5d: 0x1af0, 0xc5e: 0x1b32, 0xc5f: 0x1d6c, 0xc60: 0x1d24, 0xc61: 0x1b44, 0xc62: 0x1d54, 0xc63: 0x1d70, 0xc64: 0x1d28, 0xc65: 0x1b47, 0xc66: 0x1d58, 0xc67: 0x2418, 0xc68: 0x242c, 0xc69: 0x1ac6, 0xc6a: 0x1d50, 0xc6b: 0x1ce4, 0xc6c: 0x1cd0, 0xc6d: 0x1d78, 0xc6e: 0x284d, 0xc6f: 0x28e4, 0xc70: 0x1b89, 0xc71: 0x1b74, 0xc72: 0x1dac, 0xc73: 0x1b5f, 0xc74: 0x1b80, 0xc75: 0x1b68, 0xc76: 0x1d98, 0xc77: 0x1b4d, 0xc78: 0x1b26, 0xc79: 0x1ab1, 0xc7a: 0x1b83, 0xc7b: 0x1b6b, 0xc7c: 0x1d9c, 0xc7d: 0x1b50, 0xc7e: 0x1b29, 0xc7f: 0x1ab4, // Block 0x32, offset 0xc80 0xc80: 0x1d5c, 0xc81: 0x1ce8, 0xc82: 0x1e7d, 0xc83: 0x1a66, 0xc84: 0x1aea, 0xc85: 0x1aed, 0xc86: 0x2425, 0xc87: 0x1cc4, 0xc88: 0x1af3, 0xc89: 0x1a78, 0xc8a: 0x1b11, 0xc8b: 0x1a7b, 0xc8c: 0x1b1a, 0xc8d: 0x1a99, 0xc8e: 0x1a9c, 0xc8f: 0x1b35, 0xc90: 0x1b3b, 0xc91: 0x1b3e, 0xc92: 0x1d60, 0xc93: 0x1b41, 0xc94: 0x1b53, 0xc95: 0x1d68, 0xc96: 0x1d74, 0xc97: 0x1ac0, 0xc98: 0x1e87, 0xc99: 0x1cec, 0xc9a: 0x1ac3, 0xc9b: 0x1b8c, 0xc9c: 0x1ad5, 0xc9d: 0x1ae4, 0xc9e: 0x2412, 0xc9f: 0x240c, 0xca0: 0x1df1, 0xca1: 0x1e00, 0xca2: 0x1e0f, 0xca3: 0x1e1e, 0xca4: 0x1e2d, 0xca5: 0x1e3c, 0xca6: 0x1e4b, 0xca7: 0x1e5a, 0xca8: 0x1e69, 0xca9: 0x22b6, 0xcaa: 0x22c8, 0xcab: 0x22da, 0xcac: 0x22ec, 0xcad: 0x22f8, 0xcae: 0x2304, 0xcaf: 0x2310, 0xcb0: 0x231c, 0xcb1: 0x2328, 0xcb2: 0x2334, 0xcb3: 0x2370, 0xcb4: 0x237c, 0xcb5: 0x2388, 0xcb6: 0x2394, 0xcb7: 0x23a0, 0xcb8: 0x23ac, 0xcb9: 0x23b2, 0xcba: 0x23b8, 0xcbb: 0x23be, 0xcbc: 0x23c4, 0xcbd: 0x23d6, 0xcbe: 0x23dc, 0xcbf: 0x1d40, // Block 0x33, offset 0xcc0 0xcc0: 0x1472, 0xcc1: 0x0df6, 0xcc2: 0x14ce, 0xcc3: 0x149a, 0xcc4: 0x0f52, 0xcc5: 0x07e6, 0xcc6: 0x09da, 0xcc7: 0x1726, 0xcc8: 0x1726, 0xcc9: 0x0b06, 0xcca: 0x155a, 0xccb: 0x0a3e, 0xccc: 0x0b02, 0xccd: 0x0cea, 0xcce: 0x10ca, 0xccf: 0x125a, 0xcd0: 0x1392, 0xcd1: 0x13ce, 0xcd2: 0x1402, 0xcd3: 0x1516, 0xcd4: 0x0e6e, 0xcd5: 0x0efa, 0xcd6: 0x0fa6, 0xcd7: 0x103e, 0xcd8: 0x135a, 0xcd9: 0x1542, 0xcda: 0x166e, 0xcdb: 0x080a, 0xcdc: 0x09ae, 0xcdd: 0x0e82, 0xcde: 0x0fca, 0xcdf: 0x138e, 0xce0: 0x16be, 0xce1: 0x0bae, 0xce2: 0x0f72, 0xce3: 0x137e, 0xce4: 0x1412, 0xce5: 0x0d1e, 0xce6: 0x12b6, 0xce7: 0x13da, 0xce8: 0x0c1a, 0xce9: 0x0e0a, 0xcea: 0x0f12, 0xceb: 0x1016, 0xcec: 0x1522, 0xced: 0x084a, 0xcee: 0x08e2, 0xcef: 0x094e, 0xcf0: 0x0d86, 0xcf1: 0x0e7a, 0xcf2: 0x0fc6, 0xcf3: 0x10ea, 0xcf4: 0x1272, 0xcf5: 0x1386, 0xcf6: 0x139e, 0xcf7: 0x14c2, 0xcf8: 0x15ea, 0xcf9: 0x169e, 0xcfa: 0x16ba, 0xcfb: 0x1126, 0xcfc: 0x1166, 0xcfd: 0x121e, 0xcfe: 0x133e, 0xcff: 0x1576, // Block 0x34, offset 0xd00 0xd00: 0x16c6, 0xd01: 0x1446, 0xd02: 0x0ac2, 0xd03: 0x0c36, 0xd04: 0x11d6, 0xd05: 0x1296, 0xd06: 0x0ffa, 0xd07: 0x112e, 0xd08: 0x1492, 0xd09: 0x15e2, 0xd0a: 0x0abe, 0xd0b: 0x0b8a, 0xd0c: 0x0e72, 0xd0d: 0x0f26, 0xd0e: 0x0f5a, 0xd0f: 0x120e, 0xd10: 0x1236, 0xd11: 0x15a2, 0xd12: 0x094a, 0xd13: 0x12a2, 0xd14: 0x08ee, 0xd15: 0x08ea, 0xd16: 0x1192, 0xd17: 0x1222, 0xd18: 0x1356, 0xd19: 0x15aa, 0xd1a: 0x1462, 0xd1b: 0x0d22, 0xd1c: 0x0e6e, 0xd1d: 0x1452, 0xd1e: 0x07f2, 0xd1f: 0x0b5e, 0xd20: 0x0c8e, 0xd21: 0x102a, 0xd22: 0x10aa, 0xd23: 0x096e, 0xd24: 0x1136, 0xd25: 0x085a, 0xd26: 0x0c72, 0xd27: 0x07d2, 0xd28: 0x0ee6, 0xd29: 0x0d9e, 0xd2a: 0x120a, 0xd2b: 0x09c2, 0xd2c: 0x0aae, 0xd2d: 0x10f6, 0xd2e: 0x135e, 0xd2f: 0x1436, 0xd30: 0x0eb2, 0xd31: 0x14f2, 0xd32: 0x0ede, 0xd33: 0x0d32, 0xd34: 0x1316, 0xd35: 0x0d52, 0xd36: 0x10a6, 0xd37: 0x0826, 0xd38: 0x08a2, 0xd39: 0x08e6, 0xd3a: 0x0e4e, 0xd3b: 0x11f6, 0xd3c: 0x12ee, 0xd3d: 0x1442, 0xd3e: 0x1556, 0xd3f: 0x0956, // Block 0x35, offset 0xd40 0xd40: 0x0a0a, 0xd41: 0x0b12, 0xd42: 0x0c2a, 0xd43: 0x0dba, 0xd44: 0x0f76, 0xd45: 0x113a, 0xd46: 0x1592, 0xd47: 0x1676, 0xd48: 0x16ca, 0xd49: 0x16e2, 0xd4a: 0x0932, 0xd4b: 0x0dee, 0xd4c: 0x0e9e, 0xd4d: 0x14e6, 0xd4e: 0x0bf6, 0xd4f: 0x0cd2, 0xd50: 0x0cee, 0xd51: 0x0d7e, 0xd52: 0x0f66, 0xd53: 0x0fb2, 0xd54: 0x1062, 0xd55: 0x1186, 0xd56: 0x122a, 0xd57: 0x128e, 0xd58: 0x14d6, 0xd59: 0x1366, 0xd5a: 0x14fe, 0xd5b: 0x157a, 0xd5c: 0x090a, 0xd5d: 0x0936, 0xd5e: 0x0a1e, 0xd5f: 0x0fa2, 0xd60: 0x13ee, 0xd61: 0x1436, 0xd62: 0x0c16, 0xd63: 0x0c86, 0xd64: 0x0d4a, 0xd65: 0x0eaa, 0xd66: 0x11d2, 0xd67: 0x101e, 0xd68: 0x0836, 0xd69: 0x0a7a, 0xd6a: 0x0b5e, 0xd6b: 0x0bc2, 0xd6c: 0x0c92, 0xd6d: 0x103a, 0xd6e: 0x1056, 0xd6f: 0x1266, 0xd70: 0x1286, 0xd71: 0x155e, 0xd72: 0x15de, 0xd73: 0x15ee, 0xd74: 0x162a, 0xd75: 0x084e, 0xd76: 0x117a, 0xd77: 0x154a, 0xd78: 0x15c6, 0xd79: 0x0caa, 0xd7a: 0x0812, 0xd7b: 0x0872, 0xd7c: 0x0b62, 0xd7d: 0x0b82, 0xd7e: 0x0daa, 0xd7f: 0x0e6e, // Block 0x36, offset 0xd80 0xd80: 0x0fbe, 0xd81: 0x10c6, 0xd82: 0x1372, 0xd83: 0x1512, 0xd84: 0x171e, 0xd85: 0x0dde, 0xd86: 0x159e, 0xd87: 0x092e, 0xd88: 0x0e2a, 0xd89: 0x0e36, 0xd8a: 0x0f0a, 0xd8b: 0x0f42, 0xd8c: 0x1046, 0xd8d: 0x10a2, 0xd8e: 0x1122, 0xd8f: 0x1206, 0xd90: 0x1636, 0xd91: 0x08aa, 0xd92: 0x0cfe, 0xd93: 0x15ae, 0xd94: 0x0862, 0xd95: 0x0ba6, 0xd96: 0x0f2a, 0xd97: 0x14da, 0xd98: 0x0c62, 0xd99: 0x0cb2, 0xd9a: 0x0e3e, 0xd9b: 0x102a, 0xd9c: 0x15b6, 0xd9d: 0x0912, 0xd9e: 0x09fa, 0xd9f: 0x0b92, 0xda0: 0x0dce, 0xda1: 0x0e1a, 0xda2: 0x0e5a, 0xda3: 0x0eee, 0xda4: 0x1042, 0xda5: 0x10b6, 0xda6: 0x1252, 0xda7: 0x13f2, 0xda8: 0x13fe, 0xda9: 0x1552, 0xdaa: 0x15d2, 0xdab: 0x097e, 0xdac: 0x0f46, 0xdad: 0x09fe, 0xdae: 0x0fc2, 0xdaf: 0x1066, 0xdb0: 0x1382, 0xdb1: 0x15ba, 0xdb2: 0x16a6, 0xdb3: 0x16ce, 0xdb4: 0x0e32, 0xdb5: 0x0f22, 0xdb6: 0x12be, 0xdb7: 0x11b2, 0xdb8: 0x11be, 0xdb9: 0x11e2, 0xdba: 0x1012, 0xdbb: 0x0f9a, 0xdbc: 0x145e, 0xdbd: 0x082e, 0xdbe: 0x1326, 0xdbf: 0x0916, // Block 0x37, offset 0xdc0 0xdc0: 0x0906, 0xdc1: 0x0c06, 0xdc2: 0x0d26, 0xdc3: 0x11ee, 0xdc4: 0x0b4e, 0xdc5: 0x0efe, 0xdc6: 0x0dea, 0xdc7: 0x14e2, 0xdc8: 0x13e2, 0xdc9: 0x15a6, 0xdca: 0x141e, 0xdcb: 0x0c22, 0xdcc: 0x0882, 0xdcd: 0x0a56, 0xdd0: 0x0aaa, 0xdd2: 0x0dda, 0xdd5: 0x08f2, 0xdd6: 0x101a, 0xdd7: 0x10de, 0xdd8: 0x1142, 0xdd9: 0x115e, 0xdda: 0x1162, 0xddb: 0x1176, 0xddc: 0x15f6, 0xddd: 0x11e6, 0xdde: 0x126a, 0xde0: 0x138a, 0xde2: 0x144e, 0xde5: 0x1502, 0xde6: 0x152e, 0xdea: 0x164a, 0xdeb: 0x164e, 0xdec: 0x1652, 0xded: 0x16b6, 0xdee: 0x1526, 0xdef: 0x15c2, 0xdf0: 0x0852, 0xdf1: 0x0876, 0xdf2: 0x088a, 0xdf3: 0x0946, 0xdf4: 0x0952, 0xdf5: 0x0992, 0xdf6: 0x0a46, 0xdf7: 0x0a62, 0xdf8: 0x0a6a, 0xdf9: 0x0aa6, 0xdfa: 0x0ab2, 0xdfb: 0x0b8e, 0xdfc: 0x0b96, 0xdfd: 0x0c9e, 0xdfe: 0x0cc6, 0xdff: 0x0cce, // Block 0x38, offset 0xe00 0xe00: 0x0ce6, 0xe01: 0x0d92, 0xe02: 0x0dc2, 0xe03: 0x0de2, 0xe04: 0x0e52, 0xe05: 0x0f16, 0xe06: 0x0f32, 0xe07: 0x0f62, 0xe08: 0x0fb6, 0xe09: 0x0fd6, 0xe0a: 0x104a, 0xe0b: 0x112a, 0xe0c: 0x1146, 0xe0d: 0x114e, 0xe0e: 0x114a, 0xe0f: 0x1152, 0xe10: 0x1156, 0xe11: 0x115a, 0xe12: 0x116e, 0xe13: 0x1172, 0xe14: 0x1196, 0xe15: 0x11aa, 0xe16: 0x11c6, 0xe17: 0x122a, 0xe18: 0x1232, 0xe19: 0x123a, 0xe1a: 0x124e, 0xe1b: 0x1276, 0xe1c: 0x12c6, 0xe1d: 0x12fa, 0xe1e: 0x12fa, 0xe1f: 0x1362, 0xe20: 0x140a, 0xe21: 0x1422, 0xe22: 0x1456, 0xe23: 0x145a, 0xe24: 0x149e, 0xe25: 0x14a2, 0xe26: 0x14fa, 0xe27: 0x1502, 0xe28: 0x15d6, 0xe29: 0x161a, 0xe2a: 0x1632, 0xe2b: 0x0c96, 0xe2c: 0x184b, 0xe2d: 0x12de, 0xe30: 0x07da, 0xe31: 0x08de, 0xe32: 0x089e, 0xe33: 0x0846, 0xe34: 0x0886, 0xe35: 0x08b2, 0xe36: 0x0942, 0xe37: 0x095e, 0xe38: 0x0a46, 0xe39: 0x0a32, 0xe3a: 0x0a42, 0xe3b: 0x0a5e, 0xe3c: 0x0aaa, 0xe3d: 0x0aba, 0xe3e: 0x0afe, 0xe3f: 0x0b0a, // Block 0x39, offset 0xe40 0xe40: 0x0b26, 0xe41: 0x0b36, 0xe42: 0x0c1e, 0xe43: 0x0c26, 0xe44: 0x0c56, 0xe45: 0x0c76, 0xe46: 0x0ca6, 0xe47: 0x0cbe, 0xe48: 0x0cae, 0xe49: 0x0cce, 0xe4a: 0x0cc2, 0xe4b: 0x0ce6, 0xe4c: 0x0d02, 0xe4d: 0x0d5a, 0xe4e: 0x0d66, 0xe4f: 0x0d6e, 0xe50: 0x0d96, 0xe51: 0x0dda, 0xe52: 0x0e0a, 0xe53: 0x0e0e, 0xe54: 0x0e22, 0xe55: 0x0ea2, 0xe56: 0x0eb2, 0xe57: 0x0f0a, 0xe58: 0x0f56, 0xe59: 0x0f4e, 0xe5a: 0x0f62, 0xe5b: 0x0f7e, 0xe5c: 0x0fb6, 0xe5d: 0x110e, 0xe5e: 0x0fda, 0xe5f: 0x100e, 0xe60: 0x101a, 0xe61: 0x105a, 0xe62: 0x1076, 0xe63: 0x109a, 0xe64: 0x10be, 0xe65: 0x10c2, 0xe66: 0x10de, 0xe67: 0x10e2, 0xe68: 0x10f2, 0xe69: 0x1106, 0xe6a: 0x1102, 0xe6b: 0x1132, 0xe6c: 0x11ae, 0xe6d: 0x11c6, 0xe6e: 0x11de, 0xe6f: 0x1216, 0xe70: 0x122a, 0xe71: 0x1246, 0xe72: 0x1276, 0xe73: 0x132a, 0xe74: 0x1352, 0xe75: 0x13c6, 0xe76: 0x140e, 0xe77: 0x141a, 0xe78: 0x1422, 0xe79: 0x143a, 0xe7a: 0x144e, 0xe7b: 0x143e, 0xe7c: 0x1456, 0xe7d: 0x1452, 0xe7e: 0x144a, 0xe7f: 0x145a, // Block 0x3a, offset 0xe80 0xe80: 0x1466, 0xe81: 0x14a2, 0xe82: 0x14de, 0xe83: 0x150e, 0xe84: 0x1546, 0xe85: 0x1566, 0xe86: 0x15b2, 0xe87: 0x15d6, 0xe88: 0x15f6, 0xe89: 0x160a, 0xe8a: 0x161a, 0xe8b: 0x1626, 0xe8c: 0x1632, 0xe8d: 0x1686, 0xe8e: 0x1726, 0xe8f: 0x17e2, 0xe90: 0x17dd, 0xe91: 0x180f, 0xe92: 0x0702, 0xe93: 0x072a, 0xe94: 0x072e, 0xe95: 0x1891, 0xe96: 0x18be, 0xe97: 0x1936, 0xe98: 0x1712, 0xe99: 0x1722, // Block 0x3b, offset 0xec0 0xec0: 0x1b05, 0xec1: 0x1b08, 0xec2: 0x1b0b, 0xec3: 0x1d38, 0xec4: 0x1d3c, 0xec5: 0x1b8f, 0xec6: 0x1b8f, 0xed3: 0x1ea5, 0xed4: 0x1e96, 0xed5: 0x1e9b, 0xed6: 0x1eaa, 0xed7: 0x1ea0, 0xedd: 0x4449, 0xede: 0x8116, 0xedf: 0x44bb, 0xee0: 0x0320, 0xee1: 0x0308, 0xee2: 0x0311, 0xee3: 0x0314, 0xee4: 0x0317, 0xee5: 0x031a, 0xee6: 0x031d, 0xee7: 0x0323, 0xee8: 0x0326, 0xee9: 0x0017, 0xeea: 0x44a9, 0xeeb: 0x44af, 0xeec: 0x45ad, 0xeed: 0x45b5, 0xeee: 0x4401, 0xeef: 0x4407, 0xef0: 0x440d, 0xef1: 0x4413, 0xef2: 0x441f, 0xef3: 0x4425, 0xef4: 0x442b, 0xef5: 0x4437, 0xef6: 0x443d, 0xef8: 0x4443, 0xef9: 0x444f, 0xefa: 0x4455, 0xefb: 0x445b, 0xefc: 0x4467, 0xefe: 0x446d, // Block 0x3c, offset 0xf00 0xf00: 0x4473, 0xf01: 0x4479, 0xf03: 0x447f, 0xf04: 0x4485, 0xf06: 0x4491, 0xf07: 0x4497, 0xf08: 0x449d, 0xf09: 0x44a3, 0xf0a: 0x44b5, 0xf0b: 0x4431, 0xf0c: 0x4419, 0xf0d: 0x4461, 0xf0e: 0x448b, 0xf0f: 0x1eaf, 0xf10: 0x038c, 0xf11: 0x038c, 0xf12: 0x0395, 0xf13: 0x0395, 0xf14: 0x0395, 0xf15: 0x0395, 0xf16: 0x0398, 0xf17: 0x0398, 0xf18: 0x0398, 0xf19: 0x0398, 0xf1a: 0x039e, 0xf1b: 0x039e, 0xf1c: 0x039e, 0xf1d: 0x039e, 0xf1e: 0x0392, 0xf1f: 0x0392, 0xf20: 0x0392, 0xf21: 0x0392, 0xf22: 0x039b, 0xf23: 0x039b, 0xf24: 0x039b, 0xf25: 0x039b, 0xf26: 0x038f, 0xf27: 0x038f, 0xf28: 0x038f, 0xf29: 0x038f, 0xf2a: 0x03c2, 0xf2b: 0x03c2, 0xf2c: 0x03c2, 0xf2d: 0x03c2, 0xf2e: 0x03c5, 0xf2f: 0x03c5, 0xf30: 0x03c5, 0xf31: 0x03c5, 0xf32: 0x03a4, 0xf33: 0x03a4, 0xf34: 0x03a4, 0xf35: 0x03a4, 0xf36: 0x03a1, 0xf37: 0x03a1, 0xf38: 0x03a1, 0xf39: 0x03a1, 0xf3a: 0x03a7, 0xf3b: 0x03a7, 0xf3c: 0x03a7, 0xf3d: 0x03a7, 0xf3e: 0x03aa, 0xf3f: 0x03aa, // Block 0x3d, offset 0xf40 0xf40: 0x03aa, 0xf41: 0x03aa, 0xf42: 0x03b3, 0xf43: 0x03b3, 0xf44: 0x03b0, 0xf45: 0x03b0, 0xf46: 0x03b6, 0xf47: 0x03b6, 0xf48: 0x03ad, 0xf49: 0x03ad, 0xf4a: 0x03bc, 0xf4b: 0x03bc, 0xf4c: 0x03b9, 0xf4d: 0x03b9, 0xf4e: 0x03c8, 0xf4f: 0x03c8, 0xf50: 0x03c8, 0xf51: 0x03c8, 0xf52: 0x03ce, 0xf53: 0x03ce, 0xf54: 0x03ce, 0xf55: 0x03ce, 0xf56: 0x03d4, 0xf57: 0x03d4, 0xf58: 0x03d4, 0xf59: 0x03d4, 0xf5a: 0x03d1, 0xf5b: 0x03d1, 0xf5c: 0x03d1, 0xf5d: 0x03d1, 0xf5e: 0x03d7, 0xf5f: 0x03d7, 0xf60: 0x03da, 0xf61: 0x03da, 0xf62: 0x03da, 0xf63: 0x03da, 0xf64: 0x4527, 0xf65: 0x4527, 0xf66: 0x03e0, 0xf67: 0x03e0, 0xf68: 0x03e0, 0xf69: 0x03e0, 0xf6a: 0x03dd, 0xf6b: 0x03dd, 0xf6c: 0x03dd, 0xf6d: 0x03dd, 0xf6e: 0x03fb, 0xf6f: 0x03fb, 0xf70: 0x4521, 0xf71: 0x4521, // Block 0x3e, offset 0xf80 0xf93: 0x03cb, 0xf94: 0x03cb, 0xf95: 0x03cb, 0xf96: 0x03cb, 0xf97: 0x03e9, 0xf98: 0x03e9, 0xf99: 0x03e6, 0xf9a: 0x03e6, 0xf9b: 0x03ec, 0xf9c: 0x03ec, 0xf9d: 0x217f, 0xf9e: 0x03f2, 0xf9f: 0x03f2, 0xfa0: 0x03e3, 0xfa1: 0x03e3, 0xfa2: 0x03ef, 0xfa3: 0x03ef, 0xfa4: 0x03f8, 0xfa5: 0x03f8, 0xfa6: 0x03f8, 0xfa7: 0x03f8, 0xfa8: 0x0380, 0xfa9: 0x0380, 0xfaa: 0x26da, 0xfab: 0x26da, 0xfac: 0x274a, 0xfad: 0x274a, 0xfae: 0x2719, 0xfaf: 0x2719, 0xfb0: 0x2735, 0xfb1: 0x2735, 0xfb2: 0x272e, 0xfb3: 0x272e, 0xfb4: 0x273c, 0xfb5: 0x273c, 0xfb6: 0x2743, 0xfb7: 0x2743, 0xfb8: 0x2743, 0xfb9: 0x2720, 0xfba: 0x2720, 0xfbb: 0x2720, 0xfbc: 0x03f5, 0xfbd: 0x03f5, 0xfbe: 0x03f5, 0xfbf: 0x03f5, // Block 0x3f, offset 0xfc0 0xfc0: 0x26e1, 0xfc1: 0x26e8, 0xfc2: 0x2704, 0xfc3: 0x2720, 0xfc4: 0x2727, 0xfc5: 0x1eb9, 0xfc6: 0x1ebe, 0xfc7: 0x1ec3, 0xfc8: 0x1ed2, 0xfc9: 0x1ee1, 0xfca: 0x1ee6, 0xfcb: 0x1eeb, 0xfcc: 0x1ef0, 0xfcd: 0x1ef5, 0xfce: 0x1f04, 0xfcf: 0x1f13, 0xfd0: 0x1f18, 0xfd1: 0x1f1d, 0xfd2: 0x1f2c, 0xfd3: 0x1f3b, 0xfd4: 0x1f40, 0xfd5: 0x1f45, 0xfd6: 0x1f4a, 0xfd7: 0x1f59, 0xfd8: 0x1f5e, 0xfd9: 0x1f6d, 0xfda: 0x1f72, 0xfdb: 0x1f77, 0xfdc: 0x1f86, 0xfdd: 0x1f8b, 0xfde: 0x1f90, 0xfdf: 0x1f9a, 0xfe0: 0x1fd6, 0xfe1: 0x1fe5, 0xfe2: 0x1ff4, 0xfe3: 0x1ff9, 0xfe4: 0x1ffe, 0xfe5: 0x2008, 0xfe6: 0x2017, 0xfe7: 0x201c, 0xfe8: 0x202b, 0xfe9: 0x2030, 0xfea: 0x2035, 0xfeb: 0x2044, 0xfec: 0x2049, 0xfed: 0x2058, 0xfee: 0x205d, 0xfef: 0x2062, 0xff0: 0x2067, 0xff1: 0x206c, 0xff2: 0x2071, 0xff3: 0x2076, 0xff4: 0x207b, 0xff5: 0x2080, 0xff6: 0x2085, 0xff7: 0x208a, 0xff8: 0x208f, 0xff9: 0x2094, 0xffa: 0x2099, 0xffb: 0x209e, 0xffc: 0x20a3, 0xffd: 0x20a8, 0xffe: 0x20ad, 0xfff: 0x20b7, // Block 0x40, offset 0x1000 0x1000: 0x20bc, 0x1001: 0x20c1, 0x1002: 0x20c6, 0x1003: 0x20d0, 0x1004: 0x20d5, 0x1005: 0x20df, 0x1006: 0x20e4, 0x1007: 0x20e9, 0x1008: 0x20ee, 0x1009: 0x20f3, 0x100a: 0x20f8, 0x100b: 0x20fd, 0x100c: 0x2102, 0x100d: 0x2107, 0x100e: 0x2116, 0x100f: 0x2125, 0x1010: 0x212a, 0x1011: 0x212f, 0x1012: 0x2134, 0x1013: 0x2139, 0x1014: 0x213e, 0x1015: 0x2148, 0x1016: 0x214d, 0x1017: 0x2152, 0x1018: 0x2161, 0x1019: 0x2170, 0x101a: 0x2175, 0x101b: 0x44d9, 0x101c: 0x44df, 0x101d: 0x4515, 0x101e: 0x456c, 0x101f: 0x4573, 0x1020: 0x457a, 0x1021: 0x4581, 0x1022: 0x4588, 0x1023: 0x458f, 0x1024: 0x26f6, 0x1025: 0x26fd, 0x1026: 0x2704, 0x1027: 0x270b, 0x1028: 0x2720, 0x1029: 0x2727, 0x102a: 0x1ec8, 0x102b: 0x1ecd, 0x102c: 0x1ed2, 0x102d: 0x1ed7, 0x102e: 0x1ee1, 0x102f: 0x1ee6, 0x1030: 0x1efa, 0x1031: 0x1eff, 0x1032: 0x1f04, 0x1033: 0x1f09, 0x1034: 0x1f13, 0x1035: 0x1f18, 0x1036: 0x1f22, 0x1037: 0x1f27, 0x1038: 0x1f2c, 0x1039: 0x1f31, 0x103a: 0x1f3b, 0x103b: 0x1f40, 0x103c: 0x206c, 0x103d: 0x2071, 0x103e: 0x2080, 0x103f: 0x2085, // Block 0x41, offset 0x1040 0x1040: 0x208a, 0x1041: 0x209e, 0x1042: 0x20a3, 0x1043: 0x20a8, 0x1044: 0x20ad, 0x1045: 0x20c6, 0x1046: 0x20d0, 0x1047: 0x20d5, 0x1048: 0x20da, 0x1049: 0x20ee, 0x104a: 0x210c, 0x104b: 0x2111, 0x104c: 0x2116, 0x104d: 0x211b, 0x104e: 0x2125, 0x104f: 0x212a, 0x1050: 0x4515, 0x1051: 0x2157, 0x1052: 0x215c, 0x1053: 0x2161, 0x1054: 0x2166, 0x1055: 0x2170, 0x1056: 0x2175, 0x1057: 0x26e1, 0x1058: 0x26e8, 0x1059: 0x26ef, 0x105a: 0x2704, 0x105b: 0x2712, 0x105c: 0x1eb9, 0x105d: 0x1ebe, 0x105e: 0x1ec3, 0x105f: 0x1ed2, 0x1060: 0x1edc, 0x1061: 0x1eeb, 0x1062: 0x1ef0, 0x1063: 0x1ef5, 0x1064: 0x1f04, 0x1065: 0x1f0e, 0x1066: 0x1f2c, 0x1067: 0x1f45, 0x1068: 0x1f4a, 0x1069: 0x1f59, 0x106a: 0x1f5e, 0x106b: 0x1f6d, 0x106c: 0x1f77, 0x106d: 0x1f86, 0x106e: 0x1f8b, 0x106f: 0x1f90, 0x1070: 0x1f9a, 0x1071: 0x1fd6, 0x1072: 0x1fdb, 0x1073: 0x1fe5, 0x1074: 0x1ff4, 0x1075: 0x1ff9, 0x1076: 0x1ffe, 0x1077: 0x2008, 0x1078: 0x2017, 0x1079: 0x202b, 0x107a: 0x2030, 0x107b: 0x2035, 0x107c: 0x2044, 0x107d: 0x2049, 0x107e: 0x2058, 0x107f: 0x205d, // Block 0x42, offset 0x1080 0x1080: 0x2062, 0x1081: 0x2067, 0x1082: 0x2076, 0x1083: 0x207b, 0x1084: 0x208f, 0x1085: 0x2094, 0x1086: 0x2099, 0x1087: 0x209e, 0x1088: 0x20a3, 0x1089: 0x20b7, 0x108a: 0x20bc, 0x108b: 0x20c1, 0x108c: 0x20c6, 0x108d: 0x20cb, 0x108e: 0x20df, 0x108f: 0x20e4, 0x1090: 0x20e9, 0x1091: 0x20ee, 0x1092: 0x20fd, 0x1093: 0x2102, 0x1094: 0x2107, 0x1095: 0x2116, 0x1096: 0x2120, 0x1097: 0x212f, 0x1098: 0x2134, 0x1099: 0x4509, 0x109a: 0x2148, 0x109b: 0x214d, 0x109c: 0x2152, 0x109d: 0x2161, 0x109e: 0x216b, 0x109f: 0x2704, 0x10a0: 0x2712, 0x10a1: 0x1ed2, 0x10a2: 0x1edc, 0x10a3: 0x1f04, 0x10a4: 0x1f0e, 0x10a5: 0x1f2c, 0x10a6: 0x1f36, 0x10a7: 0x1f9a, 0x10a8: 0x1f9f, 0x10a9: 0x1fc2, 0x10aa: 0x1fc7, 0x10ab: 0x209e, 0x10ac: 0x20a3, 0x10ad: 0x20c6, 0x10ae: 0x2116, 0x10af: 0x2120, 0x10b0: 0x2161, 0x10b1: 0x216b, 0x10b2: 0x45bd, 0x10b3: 0x45c5, 0x10b4: 0x45cd, 0x10b5: 0x2021, 0x10b6: 0x2026, 0x10b7: 0x203a, 0x10b8: 0x203f, 0x10b9: 0x204e, 0x10ba: 0x2053, 0x10bb: 0x1fa4, 0x10bc: 0x1fa9, 0x10bd: 0x1fcc, 0x10be: 0x1fd1, 0x10bf: 0x1f63, // Block 0x43, offset 0x10c0 0x10c0: 0x1f68, 0x10c1: 0x1f4f, 0x10c2: 0x1f54, 0x10c3: 0x1f7c, 0x10c4: 0x1f81, 0x10c5: 0x1fea, 0x10c6: 0x1fef, 0x10c7: 0x200d, 0x10c8: 0x2012, 0x10c9: 0x1fae, 0x10ca: 0x1fb3, 0x10cb: 0x1fb8, 0x10cc: 0x1fc2, 0x10cd: 0x1fbd, 0x10ce: 0x1f95, 0x10cf: 0x1fe0, 0x10d0: 0x2003, 0x10d1: 0x2021, 0x10d2: 0x2026, 0x10d3: 0x203a, 0x10d4: 0x203f, 0x10d5: 0x204e, 0x10d6: 0x2053, 0x10d7: 0x1fa4, 0x10d8: 0x1fa9, 0x10d9: 0x1fcc, 0x10da: 0x1fd1, 0x10db: 0x1f63, 0x10dc: 0x1f68, 0x10dd: 0x1f4f, 0x10de: 0x1f54, 0x10df: 0x1f7c, 0x10e0: 0x1f81, 0x10e1: 0x1fea, 0x10e2: 0x1fef, 0x10e3: 0x200d, 0x10e4: 0x2012, 0x10e5: 0x1fae, 0x10e6: 0x1fb3, 0x10e7: 0x1fb8, 0x10e8: 0x1fc2, 0x10e9: 0x1fbd, 0x10ea: 0x1f95, 0x10eb: 0x1fe0, 0x10ec: 0x2003, 0x10ed: 0x1fae, 0x10ee: 0x1fb3, 0x10ef: 0x1fb8, 0x10f0: 0x1fc2, 0x10f1: 0x1f9f, 0x10f2: 0x1fc7, 0x10f3: 0x201c, 0x10f4: 0x1f86, 0x10f5: 0x1f8b, 0x10f6: 0x1f90, 0x10f7: 0x1fae, 0x10f8: 0x1fb3, 0x10f9: 0x1fb8, 0x10fa: 0x201c, 0x10fb: 0x202b, 0x10fc: 0x44c1, 0x10fd: 0x44c1, // Block 0x44, offset 0x1100 0x1110: 0x2441, 0x1111: 0x2456, 0x1112: 0x2456, 0x1113: 0x245d, 0x1114: 0x2464, 0x1115: 0x2479, 0x1116: 0x2480, 0x1117: 0x2487, 0x1118: 0x24aa, 0x1119: 0x24aa, 0x111a: 0x24cd, 0x111b: 0x24c6, 0x111c: 0x24e2, 0x111d: 0x24d4, 0x111e: 0x24db, 0x111f: 0x24fe, 0x1120: 0x24fe, 0x1121: 0x24f7, 0x1122: 0x2505, 0x1123: 0x2505, 0x1124: 0x252f, 0x1125: 0x252f, 0x1126: 0x254b, 0x1127: 0x2513, 0x1128: 0x2513, 0x1129: 0x250c, 0x112a: 0x2521, 0x112b: 0x2521, 0x112c: 0x2528, 0x112d: 0x2528, 0x112e: 0x2552, 0x112f: 0x2560, 0x1130: 0x2560, 0x1131: 0x2567, 0x1132: 0x2567, 0x1133: 0x256e, 0x1134: 0x2575, 0x1135: 0x257c, 0x1136: 0x2583, 0x1137: 0x2583, 0x1138: 0x258a, 0x1139: 0x2598, 0x113a: 0x25a6, 0x113b: 0x259f, 0x113c: 0x25ad, 0x113d: 0x25ad, 0x113e: 0x25c2, 0x113f: 0x25c9, // Block 0x45, offset 0x1140 0x1140: 0x25fa, 0x1141: 0x2608, 0x1142: 0x2601, 0x1143: 0x25e5, 0x1144: 0x25e5, 0x1145: 0x260f, 0x1146: 0x260f, 0x1147: 0x2616, 0x1148: 0x2616, 0x1149: 0x2640, 0x114a: 0x2647, 0x114b: 0x264e, 0x114c: 0x2624, 0x114d: 0x2632, 0x114e: 0x2655, 0x114f: 0x265c, 0x1152: 0x262b, 0x1153: 0x26b0, 0x1154: 0x26b7, 0x1155: 0x268d, 0x1156: 0x2694, 0x1157: 0x2678, 0x1158: 0x2678, 0x1159: 0x267f, 0x115a: 0x26a9, 0x115b: 0x26a2, 0x115c: 0x26cc, 0x115d: 0x26cc, 0x115e: 0x243a, 0x115f: 0x244f, 0x1160: 0x2448, 0x1161: 0x2472, 0x1162: 0x246b, 0x1163: 0x2495, 0x1164: 0x248e, 0x1165: 0x24b8, 0x1166: 0x249c, 0x1167: 0x24b1, 0x1168: 0x24e9, 0x1169: 0x2536, 0x116a: 0x251a, 0x116b: 0x2559, 0x116c: 0x25f3, 0x116d: 0x261d, 0x116e: 0x26c5, 0x116f: 0x26be, 0x1170: 0x26d3, 0x1171: 0x266a, 0x1172: 0x25d0, 0x1173: 0x269b, 0x1174: 0x25c2, 0x1175: 0x25fa, 0x1176: 0x2591, 0x1177: 0x25de, 0x1178: 0x2671, 0x1179: 0x2663, 0x117a: 0x25ec, 0x117b: 0x25d7, 0x117c: 0x25ec, 0x117d: 0x2671, 0x117e: 0x24a3, 0x117f: 0x24bf, // Block 0x46, offset 0x1180 0x1180: 0x2639, 0x1181: 0x25b4, 0x1182: 0x2433, 0x1183: 0x25d7, 0x1184: 0x257c, 0x1185: 0x254b, 0x1186: 0x24f0, 0x1187: 0x2686, 0x11b0: 0x2544, 0x11b1: 0x25bb, 0x11b2: 0x28f6, 0x11b3: 0x28ed, 0x11b4: 0x2923, 0x11b5: 0x2911, 0x11b6: 0x28ff, 0x11b7: 0x291a, 0x11b8: 0x292c, 0x11b9: 0x253d, 0x11ba: 0x2db3, 0x11bb: 0x2c33, 0x11bc: 0x2908, // Block 0x47, offset 0x11c0 0x11d0: 0x0019, 0x11d1: 0x057e, 0x11d2: 0x0582, 0x11d3: 0x0035, 0x11d4: 0x0037, 0x11d5: 0x0003, 0x11d6: 0x003f, 0x11d7: 0x05ba, 0x11d8: 0x05be, 0x11d9: 0x1c8c, 0x11e0: 0x8133, 0x11e1: 0x8133, 0x11e2: 0x8133, 0x11e3: 0x8133, 0x11e4: 0x8133, 0x11e5: 0x8133, 0x11e6: 0x8133, 0x11e7: 0x812e, 0x11e8: 0x812e, 0x11e9: 0x812e, 0x11ea: 0x812e, 0x11eb: 0x812e, 0x11ec: 0x812e, 0x11ed: 0x812e, 0x11ee: 0x8133, 0x11ef: 0x8133, 0x11f0: 0x19a0, 0x11f1: 0x053a, 0x11f2: 0x0536, 0x11f3: 0x007f, 0x11f4: 0x007f, 0x11f5: 0x0011, 0x11f6: 0x0013, 0x11f7: 0x00b7, 0x11f8: 0x00bb, 0x11f9: 0x05b2, 0x11fa: 0x05b6, 0x11fb: 0x05a6, 0x11fc: 0x05aa, 0x11fd: 0x058e, 0x11fe: 0x0592, 0x11ff: 0x0586, // Block 0x48, offset 0x1200 0x1200: 0x058a, 0x1201: 0x0596, 0x1202: 0x059a, 0x1203: 0x059e, 0x1204: 0x05a2, 0x1207: 0x0077, 0x1208: 0x007b, 0x1209: 0x4322, 0x120a: 0x4322, 0x120b: 0x4322, 0x120c: 0x4322, 0x120d: 0x007f, 0x120e: 0x007f, 0x120f: 0x007f, 0x1210: 0x0019, 0x1211: 0x057e, 0x1212: 0x001d, 0x1214: 0x0037, 0x1215: 0x0035, 0x1216: 0x003f, 0x1217: 0x0003, 0x1218: 0x053a, 0x1219: 0x0011, 0x121a: 0x0013, 0x121b: 0x00b7, 0x121c: 0x00bb, 0x121d: 0x05b2, 0x121e: 0x05b6, 0x121f: 0x0007, 0x1220: 0x000d, 0x1221: 0x0015, 0x1222: 0x0017, 0x1223: 0x001b, 0x1224: 0x0039, 0x1225: 0x003d, 0x1226: 0x003b, 0x1228: 0x0079, 0x1229: 0x0009, 0x122a: 0x000b, 0x122b: 0x0041, 0x1230: 0x4363, 0x1231: 0x44e5, 0x1232: 0x4368, 0x1234: 0x436d, 0x1236: 0x4372, 0x1237: 0x44eb, 0x1238: 0x4377, 0x1239: 0x44f1, 0x123a: 0x437c, 0x123b: 0x44f7, 0x123c: 0x4381, 0x123d: 0x44fd, 0x123e: 0x4386, 0x123f: 0x4503, // Block 0x49, offset 0x1240 0x1240: 0x0329, 0x1241: 0x44c7, 0x1242: 0x44c7, 0x1243: 0x44cd, 0x1244: 0x44cd, 0x1245: 0x450f, 0x1246: 0x450f, 0x1247: 0x44d3, 0x1248: 0x44d3, 0x1249: 0x451b, 0x124a: 0x451b, 0x124b: 0x451b, 0x124c: 0x451b, 0x124d: 0x032c, 0x124e: 0x032c, 0x124f: 0x032f, 0x1250: 0x032f, 0x1251: 0x032f, 0x1252: 0x032f, 0x1253: 0x0332, 0x1254: 0x0332, 0x1255: 0x0335, 0x1256: 0x0335, 0x1257: 0x0335, 0x1258: 0x0335, 0x1259: 0x0338, 0x125a: 0x0338, 0x125b: 0x0338, 0x125c: 0x0338, 0x125d: 0x033b, 0x125e: 0x033b, 0x125f: 0x033b, 0x1260: 0x033b, 0x1261: 0x033e, 0x1262: 0x033e, 0x1263: 0x033e, 0x1264: 0x033e, 0x1265: 0x0341, 0x1266: 0x0341, 0x1267: 0x0341, 0x1268: 0x0341, 0x1269: 0x0344, 0x126a: 0x0344, 0x126b: 0x0347, 0x126c: 0x0347, 0x126d: 0x034a, 0x126e: 0x034a, 0x126f: 0x034d, 0x1270: 0x034d, 0x1271: 0x0350, 0x1272: 0x0350, 0x1273: 0x0350, 0x1274: 0x0350, 0x1275: 0x0353, 0x1276: 0x0353, 0x1277: 0x0353, 0x1278: 0x0353, 0x1279: 0x0356, 0x127a: 0x0356, 0x127b: 0x0356, 0x127c: 0x0356, 0x127d: 0x0359, 0x127e: 0x0359, 0x127f: 0x0359, // Block 0x4a, offset 0x1280 0x1280: 0x0359, 0x1281: 0x035c, 0x1282: 0x035c, 0x1283: 0x035c, 0x1284: 0x035c, 0x1285: 0x035f, 0x1286: 0x035f, 0x1287: 0x035f, 0x1288: 0x035f, 0x1289: 0x0362, 0x128a: 0x0362, 0x128b: 0x0362, 0x128c: 0x0362, 0x128d: 0x0365, 0x128e: 0x0365, 0x128f: 0x0365, 0x1290: 0x0365, 0x1291: 0x0368, 0x1292: 0x0368, 0x1293: 0x0368, 0x1294: 0x0368, 0x1295: 0x036b, 0x1296: 0x036b, 0x1297: 0x036b, 0x1298: 0x036b, 0x1299: 0x036e, 0x129a: 0x036e, 0x129b: 0x036e, 0x129c: 0x036e, 0x129d: 0x0371, 0x129e: 0x0371, 0x129f: 0x0371, 0x12a0: 0x0371, 0x12a1: 0x0374, 0x12a2: 0x0374, 0x12a3: 0x0374, 0x12a4: 0x0374, 0x12a5: 0x0377, 0x12a6: 0x0377, 0x12a7: 0x0377, 0x12a8: 0x0377, 0x12a9: 0x037a, 0x12aa: 0x037a, 0x12ab: 0x037a, 0x12ac: 0x037a, 0x12ad: 0x037d, 0x12ae: 0x037d, 0x12af: 0x0380, 0x12b0: 0x0380, 0x12b1: 0x0383, 0x12b2: 0x0383, 0x12b3: 0x0383, 0x12b4: 0x0383, 0x12b5: 0x2de7, 0x12b6: 0x2de7, 0x12b7: 0x2def, 0x12b8: 0x2def, 0x12b9: 0x2df7, 0x12ba: 0x2df7, 0x12bb: 0x20b2, 0x12bc: 0x20b2, // Block 0x4b, offset 0x12c0 0x12c0: 0x0081, 0x12c1: 0x0083, 0x12c2: 0x0085, 0x12c3: 0x0087, 0x12c4: 0x0089, 0x12c5: 0x008b, 0x12c6: 0x008d, 0x12c7: 0x008f, 0x12c8: 0x0091, 0x12c9: 0x0093, 0x12ca: 0x0095, 0x12cb: 0x0097, 0x12cc: 0x0099, 0x12cd: 0x009b, 0x12ce: 0x009d, 0x12cf: 0x009f, 0x12d0: 0x00a1, 0x12d1: 0x00a3, 0x12d2: 0x00a5, 0x12d3: 0x00a7, 0x12d4: 0x00a9, 0x12d5: 0x00ab, 0x12d6: 0x00ad, 0x12d7: 0x00af, 0x12d8: 0x00b1, 0x12d9: 0x00b3, 0x12da: 0x00b5, 0x12db: 0x00b7, 0x12dc: 0x00b9, 0x12dd: 0x00bb, 0x12de: 0x00bd, 0x12df: 0x056e, 0x12e0: 0x0572, 0x12e1: 0x0582, 0x12e2: 0x0596, 0x12e3: 0x059a, 0x12e4: 0x057e, 0x12e5: 0x06a6, 0x12e6: 0x069e, 0x12e7: 0x05c2, 0x12e8: 0x05ca, 0x12e9: 0x05d2, 0x12ea: 0x05da, 0x12eb: 0x05e2, 0x12ec: 0x0666, 0x12ed: 0x066e, 0x12ee: 0x0676, 0x12ef: 0x061a, 0x12f0: 0x06aa, 0x12f1: 0x05c6, 0x12f2: 0x05ce, 0x12f3: 0x05d6, 0x12f4: 0x05de, 0x12f5: 0x05e6, 0x12f6: 0x05ea, 0x12f7: 0x05ee, 0x12f8: 0x05f2, 0x12f9: 0x05f6, 0x12fa: 0x05fa, 0x12fb: 0x05fe, 0x12fc: 0x0602, 0x12fd: 0x0606, 0x12fe: 0x060a, 0x12ff: 0x060e, // Block 0x4c, offset 0x1300 0x1300: 0x0612, 0x1301: 0x0616, 0x1302: 0x061e, 0x1303: 0x0622, 0x1304: 0x0626, 0x1305: 0x062a, 0x1306: 0x062e, 0x1307: 0x0632, 0x1308: 0x0636, 0x1309: 0x063a, 0x130a: 0x063e, 0x130b: 0x0642, 0x130c: 0x0646, 0x130d: 0x064a, 0x130e: 0x064e, 0x130f: 0x0652, 0x1310: 0x0656, 0x1311: 0x065a, 0x1312: 0x065e, 0x1313: 0x0662, 0x1314: 0x066a, 0x1315: 0x0672, 0x1316: 0x067a, 0x1317: 0x067e, 0x1318: 0x0682, 0x1319: 0x0686, 0x131a: 0x068a, 0x131b: 0x068e, 0x131c: 0x0692, 0x131d: 0x06a2, 0x131e: 0x4bb9, 0x131f: 0x4bbf, 0x1320: 0x04b6, 0x1321: 0x0406, 0x1322: 0x040a, 0x1323: 0x4b7c, 0x1324: 0x040e, 0x1325: 0x4b82, 0x1326: 0x4b88, 0x1327: 0x0412, 0x1328: 0x0416, 0x1329: 0x041a, 0x132a: 0x4b8e, 0x132b: 0x4b94, 0x132c: 0x4b9a, 0x132d: 0x4ba0, 0x132e: 0x4ba6, 0x132f: 0x4bac, 0x1330: 0x045a, 0x1331: 0x041e, 0x1332: 0x0422, 0x1333: 0x0426, 0x1334: 0x046e, 0x1335: 0x042a, 0x1336: 0x042e, 0x1337: 0x0432, 0x1338: 0x0436, 0x1339: 0x043a, 0x133a: 0x043e, 0x133b: 0x0442, 0x133c: 0x0446, 0x133d: 0x044a, 0x133e: 0x044e, // Block 0x4d, offset 0x1340 0x1342: 0x4afe, 0x1343: 0x4b04, 0x1344: 0x4b0a, 0x1345: 0x4b10, 0x1346: 0x4b16, 0x1347: 0x4b1c, 0x134a: 0x4b22, 0x134b: 0x4b28, 0x134c: 0x4b2e, 0x134d: 0x4b34, 0x134e: 0x4b3a, 0x134f: 0x4b40, 0x1352: 0x4b46, 0x1353: 0x4b4c, 0x1354: 0x4b52, 0x1355: 0x4b58, 0x1356: 0x4b5e, 0x1357: 0x4b64, 0x135a: 0x4b6a, 0x135b: 0x4b70, 0x135c: 0x4b76, 0x1360: 0x00bf, 0x1361: 0x00c2, 0x1362: 0x00cb, 0x1363: 0x431d, 0x1364: 0x00c8, 0x1365: 0x00c5, 0x1366: 0x053e, 0x1368: 0x0562, 0x1369: 0x0542, 0x136a: 0x0546, 0x136b: 0x054a, 0x136c: 0x054e, 0x136d: 0x0566, 0x136e: 0x056a, // Block 0x4e, offset 0x1380 0x1381: 0x01f1, 0x1382: 0x01f4, 0x1383: 0x00d4, 0x1384: 0x01be, 0x1385: 0x010d, 0x1387: 0x01d3, 0x1388: 0x174e, 0x1389: 0x01d9, 0x138a: 0x01d6, 0x138b: 0x0116, 0x138c: 0x0119, 0x138d: 0x0526, 0x138e: 0x011c, 0x138f: 0x0128, 0x1390: 0x01e5, 0x1391: 0x013a, 0x1392: 0x0134, 0x1393: 0x012e, 0x1394: 0x01c1, 0x1395: 0x00e0, 0x1396: 0x01c4, 0x1397: 0x0143, 0x1398: 0x0194, 0x1399: 0x01e8, 0x139a: 0x01eb, 0x139b: 0x0152, 0x139c: 0x1756, 0x139d: 0x1742, 0x139e: 0x0158, 0x139f: 0x175b, 0x13a0: 0x01a9, 0x13a1: 0x1760, 0x13a2: 0x00da, 0x13a3: 0x0170, 0x13a4: 0x0173, 0x13a5: 0x00a3, 0x13a6: 0x017c, 0x13a7: 0x1765, 0x13a8: 0x0182, 0x13a9: 0x0185, 0x13aa: 0x0188, 0x13ab: 0x01e2, 0x13ac: 0x01dc, 0x13ad: 0x1752, 0x13ae: 0x01df, 0x13af: 0x0197, 0x13b0: 0x0576, 0x13b2: 0x01ac, 0x13b3: 0x01cd, 0x13b4: 0x01d0, 0x13b5: 0x01bb, 0x13b6: 0x00f5, 0x13b7: 0x00f8, 0x13b8: 0x00fb, 0x13b9: 0x176a, 0x13ba: 0x176f, // Block 0x4f, offset 0x13c0 0x13c0: 0x0063, 0x13c1: 0x0065, 0x13c2: 0x0067, 0x13c3: 0x0069, 0x13c4: 0x006b, 0x13c5: 0x006d, 0x13c6: 0x006f, 0x13c7: 0x0071, 0x13c8: 0x0073, 0x13c9: 0x0075, 0x13ca: 0x0083, 0x13cb: 0x0085, 0x13cc: 0x0087, 0x13cd: 0x0089, 0x13ce: 0x008b, 0x13cf: 0x008d, 0x13d0: 0x008f, 0x13d1: 0x0091, 0x13d2: 0x0093, 0x13d3: 0x0095, 0x13d4: 0x0097, 0x13d5: 0x0099, 0x13d6: 0x009b, 0x13d7: 0x009d, 0x13d8: 0x009f, 0x13d9: 0x00a1, 0x13da: 0x00a3, 0x13db: 0x00a5, 0x13dc: 0x00a7, 0x13dd: 0x00a9, 0x13de: 0x00ab, 0x13df: 0x00ad, 0x13e0: 0x00af, 0x13e1: 0x00b1, 0x13e2: 0x00b3, 0x13e3: 0x00b5, 0x13e4: 0x00e3, 0x13e5: 0x0101, 0x13e8: 0x01f7, 0x13e9: 0x01fa, 0x13ea: 0x01fd, 0x13eb: 0x0200, 0x13ec: 0x0203, 0x13ed: 0x0206, 0x13ee: 0x0209, 0x13ef: 0x020c, 0x13f0: 0x020f, 0x13f1: 0x0212, 0x13f2: 0x0215, 0x13f3: 0x0218, 0x13f4: 0x021b, 0x13f5: 0x021e, 0x13f6: 0x0221, 0x13f7: 0x0224, 0x13f8: 0x0227, 0x13f9: 0x020c, 0x13fa: 0x022a, 0x13fb: 0x022d, 0x13fc: 0x0230, 0x13fd: 0x0233, 0x13fe: 0x0236, 0x13ff: 0x0239, // Block 0x50, offset 0x1400 0x1400: 0x0281, 0x1401: 0x0284, 0x1402: 0x0287, 0x1403: 0x0552, 0x1404: 0x024b, 0x1405: 0x0254, 0x1406: 0x025a, 0x1407: 0x027e, 0x1408: 0x026f, 0x1409: 0x026c, 0x140a: 0x028a, 0x140b: 0x028d, 0x140e: 0x0021, 0x140f: 0x0023, 0x1410: 0x0025, 0x1411: 0x0027, 0x1412: 0x0029, 0x1413: 0x002b, 0x1414: 0x002d, 0x1415: 0x002f, 0x1416: 0x0031, 0x1417: 0x0033, 0x1418: 0x0021, 0x1419: 0x0023, 0x141a: 0x0025, 0x141b: 0x0027, 0x141c: 0x0029, 0x141d: 0x002b, 0x141e: 0x002d, 0x141f: 0x002f, 0x1420: 0x0031, 0x1421: 0x0033, 0x1422: 0x0021, 0x1423: 0x0023, 0x1424: 0x0025, 0x1425: 0x0027, 0x1426: 0x0029, 0x1427: 0x002b, 0x1428: 0x002d, 0x1429: 0x002f, 0x142a: 0x0031, 0x142b: 0x0033, 0x142c: 0x0021, 0x142d: 0x0023, 0x142e: 0x0025, 0x142f: 0x0027, 0x1430: 0x0029, 0x1431: 0x002b, 0x1432: 0x002d, 0x1433: 0x002f, 0x1434: 0x0031, 0x1435: 0x0033, 0x1436: 0x0021, 0x1437: 0x0023, 0x1438: 0x0025, 0x1439: 0x0027, 0x143a: 0x0029, 0x143b: 0x002b, 0x143c: 0x002d, 0x143d: 0x002f, 0x143e: 0x0031, 0x143f: 0x0033, // Block 0x51, offset 0x1440 0x1440: 0x8133, 0x1441: 0x8133, 0x1442: 0x8133, 0x1443: 0x8133, 0x1444: 0x8133, 0x1445: 0x8133, 0x1446: 0x8133, 0x1448: 0x8133, 0x1449: 0x8133, 0x144a: 0x8133, 0x144b: 0x8133, 0x144c: 0x8133, 0x144d: 0x8133, 0x144e: 0x8133, 0x144f: 0x8133, 0x1450: 0x8133, 0x1451: 0x8133, 0x1452: 0x8133, 0x1453: 0x8133, 0x1454: 0x8133, 0x1455: 0x8133, 0x1456: 0x8133, 0x1457: 0x8133, 0x1458: 0x8133, 0x145b: 0x8133, 0x145c: 0x8133, 0x145d: 0x8133, 0x145e: 0x8133, 0x145f: 0x8133, 0x1460: 0x8133, 0x1461: 0x8133, 0x1463: 0x8133, 0x1464: 0x8133, 0x1466: 0x8133, 0x1467: 0x8133, 0x1468: 0x8133, 0x1469: 0x8133, 0x146a: 0x8133, 0x1470: 0x0290, 0x1471: 0x0293, 0x1472: 0x0296, 0x1473: 0x0299, 0x1474: 0x029c, 0x1475: 0x029f, 0x1476: 0x02a2, 0x1477: 0x02a5, 0x1478: 0x02a8, 0x1479: 0x02ab, 0x147a: 0x02ae, 0x147b: 0x02b1, 0x147c: 0x02b7, 0x147d: 0x02ba, 0x147e: 0x02bd, 0x147f: 0x02c0, // Block 0x52, offset 0x1480 0x1480: 0x02c3, 0x1481: 0x02c6, 0x1482: 0x02c9, 0x1483: 0x02cc, 0x1484: 0x02cf, 0x1485: 0x02d2, 0x1486: 0x02d5, 0x1487: 0x02db, 0x1488: 0x02e1, 0x1489: 0x02e4, 0x148a: 0x1736, 0x148b: 0x0302, 0x148c: 0x02ea, 0x148d: 0x02ed, 0x148e: 0x0305, 0x148f: 0x02f9, 0x1490: 0x02ff, 0x1491: 0x0290, 0x1492: 0x0293, 0x1493: 0x0296, 0x1494: 0x0299, 0x1495: 0x029c, 0x1496: 0x029f, 0x1497: 0x02a2, 0x1498: 0x02a5, 0x1499: 0x02a8, 0x149a: 0x02ab, 0x149b: 0x02ae, 0x149c: 0x02b7, 0x149d: 0x02ba, 0x149e: 0x02c0, 0x149f: 0x02c6, 0x14a0: 0x02c9, 0x14a1: 0x02cc, 0x14a2: 0x02cf, 0x14a3: 0x02d2, 0x14a4: 0x02d5, 0x14a5: 0x02d8, 0x14a6: 0x02db, 0x14a7: 0x02f3, 0x14a8: 0x02ea, 0x14a9: 0x02e7, 0x14aa: 0x02f0, 0x14ab: 0x02f6, 0x14ac: 0x1732, 0x14ad: 0x02fc, // Block 0x53, offset 0x14c0 0x14c0: 0x032c, 0x14c1: 0x032f, 0x14c2: 0x033b, 0x14c3: 0x0344, 0x14c5: 0x037d, 0x14c6: 0x034d, 0x14c7: 0x033e, 0x14c8: 0x035c, 0x14c9: 0x0383, 0x14ca: 0x036e, 0x14cb: 0x0371, 0x14cc: 0x0374, 0x14cd: 0x0377, 0x14ce: 0x0350, 0x14cf: 0x0362, 0x14d0: 0x0368, 0x14d1: 0x0356, 0x14d2: 0x036b, 0x14d3: 0x034a, 0x14d4: 0x0353, 0x14d5: 0x0335, 0x14d6: 0x0338, 0x14d7: 0x0341, 0x14d8: 0x0347, 0x14d9: 0x0359, 0x14da: 0x035f, 0x14db: 0x0365, 0x14dc: 0x0386, 0x14dd: 0x03d7, 0x14de: 0x03bf, 0x14df: 0x0389, 0x14e1: 0x032f, 0x14e2: 0x033b, 0x14e4: 0x037a, 0x14e7: 0x033e, 0x14e9: 0x0383, 0x14ea: 0x036e, 0x14eb: 0x0371, 0x14ec: 0x0374, 0x14ed: 0x0377, 0x14ee: 0x0350, 0x14ef: 0x0362, 0x14f0: 0x0368, 0x14f1: 0x0356, 0x14f2: 0x036b, 0x14f4: 0x0353, 0x14f5: 0x0335, 0x14f6: 0x0338, 0x14f7: 0x0341, 0x14f9: 0x0359, 0x14fb: 0x0365, // Block 0x54, offset 0x1500 0x1502: 0x033b, 0x1507: 0x033e, 0x1509: 0x0383, 0x150b: 0x0371, 0x150d: 0x0377, 0x150e: 0x0350, 0x150f: 0x0362, 0x1511: 0x0356, 0x1512: 0x036b, 0x1514: 0x0353, 0x1517: 0x0341, 0x1519: 0x0359, 0x151b: 0x0365, 0x151d: 0x03d7, 0x151f: 0x0389, 0x1521: 0x032f, 0x1522: 0x033b, 0x1524: 0x037a, 0x1527: 0x033e, 0x1528: 0x035c, 0x1529: 0x0383, 0x152a: 0x036e, 0x152c: 0x0374, 0x152d: 0x0377, 0x152e: 0x0350, 0x152f: 0x0362, 0x1530: 0x0368, 0x1531: 0x0356, 0x1532: 0x036b, 0x1534: 0x0353, 0x1535: 0x0335, 0x1536: 0x0338, 0x1537: 0x0341, 0x1539: 0x0359, 0x153a: 0x035f, 0x153b: 0x0365, 0x153c: 0x0386, 0x153e: 0x03bf, // Block 0x55, offset 0x1540 0x1540: 0x032c, 0x1541: 0x032f, 0x1542: 0x033b, 0x1543: 0x0344, 0x1544: 0x037a, 0x1545: 0x037d, 0x1546: 0x034d, 0x1547: 0x033e, 0x1548: 0x035c, 0x1549: 0x0383, 0x154b: 0x0371, 0x154c: 0x0374, 0x154d: 0x0377, 0x154e: 0x0350, 0x154f: 0x0362, 0x1550: 0x0368, 0x1551: 0x0356, 0x1552: 0x036b, 0x1553: 0x034a, 0x1554: 0x0353, 0x1555: 0x0335, 0x1556: 0x0338, 0x1557: 0x0341, 0x1558: 0x0347, 0x1559: 0x0359, 0x155a: 0x035f, 0x155b: 0x0365, 0x1561: 0x032f, 0x1562: 0x033b, 0x1563: 0x0344, 0x1565: 0x037d, 0x1566: 0x034d, 0x1567: 0x033e, 0x1568: 0x035c, 0x1569: 0x0383, 0x156b: 0x0371, 0x156c: 0x0374, 0x156d: 0x0377, 0x156e: 0x0350, 0x156f: 0x0362, 0x1570: 0x0368, 0x1571: 0x0356, 0x1572: 0x036b, 0x1573: 0x034a, 0x1574: 0x0353, 0x1575: 0x0335, 0x1576: 0x0338, 0x1577: 0x0341, 0x1578: 0x0347, 0x1579: 0x0359, 0x157a: 0x035f, 0x157b: 0x0365, // Block 0x56, offset 0x1580 0x1580: 0x19a6, 0x1581: 0x19a3, 0x1582: 0x19a9, 0x1583: 0x19cd, 0x1584: 0x19f1, 0x1585: 0x1a15, 0x1586: 0x1a39, 0x1587: 0x1a42, 0x1588: 0x1a48, 0x1589: 0x1a4e, 0x158a: 0x1a54, 0x1590: 0x1bbc, 0x1591: 0x1bc0, 0x1592: 0x1bc4, 0x1593: 0x1bc8, 0x1594: 0x1bcc, 0x1595: 0x1bd0, 0x1596: 0x1bd4, 0x1597: 0x1bd8, 0x1598: 0x1bdc, 0x1599: 0x1be0, 0x159a: 0x1be4, 0x159b: 0x1be8, 0x159c: 0x1bec, 0x159d: 0x1bf0, 0x159e: 0x1bf4, 0x159f: 0x1bf8, 0x15a0: 0x1bfc, 0x15a1: 0x1c00, 0x15a2: 0x1c04, 0x15a3: 0x1c08, 0x15a4: 0x1c0c, 0x15a5: 0x1c10, 0x15a6: 0x1c14, 0x15a7: 0x1c18, 0x15a8: 0x1c1c, 0x15a9: 0x1c20, 0x15aa: 0x2855, 0x15ab: 0x0047, 0x15ac: 0x0065, 0x15ad: 0x1a69, 0x15ae: 0x1ae1, 0x15b0: 0x0043, 0x15b1: 0x0045, 0x15b2: 0x0047, 0x15b3: 0x0049, 0x15b4: 0x004b, 0x15b5: 0x004d, 0x15b6: 0x004f, 0x15b7: 0x0051, 0x15b8: 0x0053, 0x15b9: 0x0055, 0x15ba: 0x0057, 0x15bb: 0x0059, 0x15bc: 0x005b, 0x15bd: 0x005d, 0x15be: 0x005f, 0x15bf: 0x0061, // Block 0x57, offset 0x15c0 0x15c0: 0x27dd, 0x15c1: 0x27f2, 0x15c2: 0x05fe, 0x15d0: 0x0d0a, 0x15d1: 0x0b42, 0x15d2: 0x09ce, 0x15d3: 0x46f5, 0x15d4: 0x0816, 0x15d5: 0x0aea, 0x15d6: 0x142a, 0x15d7: 0x0afa, 0x15d8: 0x0822, 0x15d9: 0x0dd2, 0x15da: 0x0faa, 0x15db: 0x0daa, 0x15dc: 0x0922, 0x15dd: 0x0c66, 0x15de: 0x08ba, 0x15df: 0x0db2, 0x15e0: 0x090e, 0x15e1: 0x1212, 0x15e2: 0x107e, 0x15e3: 0x1486, 0x15e4: 0x0ace, 0x15e5: 0x0a06, 0x15e6: 0x0f5e, 0x15e7: 0x0d16, 0x15e8: 0x0d42, 0x15e9: 0x07ba, 0x15ea: 0x07c6, 0x15eb: 0x1506, 0x15ec: 0x0bd6, 0x15ed: 0x07e2, 0x15ee: 0x09ea, 0x15ef: 0x0d36, 0x15f0: 0x14ae, 0x15f1: 0x0d0e, 0x15f2: 0x116a, 0x15f3: 0x11a6, 0x15f4: 0x09f2, 0x15f5: 0x0f3e, 0x15f6: 0x0e06, 0x15f7: 0x0e02, 0x15f8: 0x1092, 0x15f9: 0x0926, 0x15fa: 0x0a52, 0x15fb: 0x153e, // Block 0x58, offset 0x1600 0x1600: 0x07f6, 0x1601: 0x07ee, 0x1602: 0x07fe, 0x1603: 0x1774, 0x1604: 0x0842, 0x1605: 0x0852, 0x1606: 0x0856, 0x1607: 0x085e, 0x1608: 0x0866, 0x1609: 0x086a, 0x160a: 0x0876, 0x160b: 0x086e, 0x160c: 0x06ae, 0x160d: 0x1788, 0x160e: 0x088a, 0x160f: 0x088e, 0x1610: 0x0892, 0x1611: 0x08ae, 0x1612: 0x1779, 0x1613: 0x06b2, 0x1614: 0x089a, 0x1615: 0x08ba, 0x1616: 0x1783, 0x1617: 0x08ca, 0x1618: 0x08d2, 0x1619: 0x0832, 0x161a: 0x08da, 0x161b: 0x08de, 0x161c: 0x195e, 0x161d: 0x08fa, 0x161e: 0x0902, 0x161f: 0x06ba, 0x1620: 0x091a, 0x1621: 0x091e, 0x1622: 0x0926, 0x1623: 0x092a, 0x1624: 0x06be, 0x1625: 0x0942, 0x1626: 0x0946, 0x1627: 0x0952, 0x1628: 0x095e, 0x1629: 0x0962, 0x162a: 0x0966, 0x162b: 0x096e, 0x162c: 0x098e, 0x162d: 0x0992, 0x162e: 0x099a, 0x162f: 0x09aa, 0x1630: 0x09b2, 0x1631: 0x09b6, 0x1632: 0x09b6, 0x1633: 0x09b6, 0x1634: 0x1797, 0x1635: 0x0f8e, 0x1636: 0x09ca, 0x1637: 0x09d2, 0x1638: 0x179c, 0x1639: 0x09de, 0x163a: 0x09e6, 0x163b: 0x09ee, 0x163c: 0x0a16, 0x163d: 0x0a02, 0x163e: 0x0a0e, 0x163f: 0x0a12, // Block 0x59, offset 0x1640 0x1640: 0x0a1a, 0x1641: 0x0a22, 0x1642: 0x0a26, 0x1643: 0x0a2e, 0x1644: 0x0a36, 0x1645: 0x0a3a, 0x1646: 0x0a3a, 0x1647: 0x0a42, 0x1648: 0x0a4a, 0x1649: 0x0a4e, 0x164a: 0x0a5a, 0x164b: 0x0a7e, 0x164c: 0x0a62, 0x164d: 0x0a82, 0x164e: 0x0a66, 0x164f: 0x0a6e, 0x1650: 0x0906, 0x1651: 0x0aca, 0x1652: 0x0a92, 0x1653: 0x0a96, 0x1654: 0x0a9a, 0x1655: 0x0a8e, 0x1656: 0x0aa2, 0x1657: 0x0a9e, 0x1658: 0x0ab6, 0x1659: 0x17a1, 0x165a: 0x0ad2, 0x165b: 0x0ad6, 0x165c: 0x0ade, 0x165d: 0x0aea, 0x165e: 0x0af2, 0x165f: 0x0b0e, 0x1660: 0x17a6, 0x1661: 0x17ab, 0x1662: 0x0b1a, 0x1663: 0x0b1e, 0x1664: 0x0b22, 0x1665: 0x0b16, 0x1666: 0x0b2a, 0x1667: 0x06c2, 0x1668: 0x06c6, 0x1669: 0x0b32, 0x166a: 0x0b3a, 0x166b: 0x0b3a, 0x166c: 0x17b0, 0x166d: 0x0b56, 0x166e: 0x0b5a, 0x166f: 0x0b5e, 0x1670: 0x0b66, 0x1671: 0x17b5, 0x1672: 0x0b6e, 0x1673: 0x0b72, 0x1674: 0x0c4a, 0x1675: 0x0b7a, 0x1676: 0x06ca, 0x1677: 0x0b86, 0x1678: 0x0b96, 0x1679: 0x0ba2, 0x167a: 0x0b9e, 0x167b: 0x17bf, 0x167c: 0x0baa, 0x167d: 0x17c4, 0x167e: 0x0bb6, 0x167f: 0x0bb2, // Block 0x5a, offset 0x1680 0x1680: 0x0bba, 0x1681: 0x0bca, 0x1682: 0x0bce, 0x1683: 0x06ce, 0x1684: 0x0bde, 0x1685: 0x0be6, 0x1686: 0x0bea, 0x1687: 0x0bee, 0x1688: 0x06d2, 0x1689: 0x17c9, 0x168a: 0x06d6, 0x168b: 0x0c0a, 0x168c: 0x0c0e, 0x168d: 0x0c12, 0x168e: 0x0c1a, 0x168f: 0x1990, 0x1690: 0x0c32, 0x1691: 0x17d3, 0x1692: 0x17d3, 0x1693: 0x12d2, 0x1694: 0x0c42, 0x1695: 0x0c42, 0x1696: 0x06da, 0x1697: 0x17f6, 0x1698: 0x18c8, 0x1699: 0x0c52, 0x169a: 0x0c5a, 0x169b: 0x06de, 0x169c: 0x0c6e, 0x169d: 0x0c7e, 0x169e: 0x0c82, 0x169f: 0x0c8a, 0x16a0: 0x0c9a, 0x16a1: 0x06e6, 0x16a2: 0x06e2, 0x16a3: 0x0c9e, 0x16a4: 0x17d8, 0x16a5: 0x0ca2, 0x16a6: 0x0cb6, 0x16a7: 0x0cba, 0x16a8: 0x0cbe, 0x16a9: 0x0cba, 0x16aa: 0x0cca, 0x16ab: 0x0cce, 0x16ac: 0x0cde, 0x16ad: 0x0cd6, 0x16ae: 0x0cda, 0x16af: 0x0ce2, 0x16b0: 0x0ce6, 0x16b1: 0x0cea, 0x16b2: 0x0cf6, 0x16b3: 0x0cfa, 0x16b4: 0x0d12, 0x16b5: 0x0d1a, 0x16b6: 0x0d2a, 0x16b7: 0x0d3e, 0x16b8: 0x17e7, 0x16b9: 0x0d3a, 0x16ba: 0x0d2e, 0x16bb: 0x0d46, 0x16bc: 0x0d4e, 0x16bd: 0x0d62, 0x16be: 0x17ec, 0x16bf: 0x0d6a, // Block 0x5b, offset 0x16c0 0x16c0: 0x0d5e, 0x16c1: 0x0d56, 0x16c2: 0x06ea, 0x16c3: 0x0d72, 0x16c4: 0x0d7a, 0x16c5: 0x0d82, 0x16c6: 0x0d76, 0x16c7: 0x06ee, 0x16c8: 0x0d92, 0x16c9: 0x0d9a, 0x16ca: 0x17f1, 0x16cb: 0x0dc6, 0x16cc: 0x0dfa, 0x16cd: 0x0dd6, 0x16ce: 0x06fa, 0x16cf: 0x0de2, 0x16d0: 0x06f6, 0x16d1: 0x06f2, 0x16d2: 0x08be, 0x16d3: 0x08c2, 0x16d4: 0x0dfe, 0x16d5: 0x0de6, 0x16d6: 0x12a6, 0x16d7: 0x075e, 0x16d8: 0x0e0a, 0x16d9: 0x0e0e, 0x16da: 0x0e12, 0x16db: 0x0e26, 0x16dc: 0x0e1e, 0x16dd: 0x180a, 0x16de: 0x06fe, 0x16df: 0x0e3a, 0x16e0: 0x0e2e, 0x16e1: 0x0e4a, 0x16e2: 0x0e52, 0x16e3: 0x1814, 0x16e4: 0x0e56, 0x16e5: 0x0e42, 0x16e6: 0x0e5e, 0x16e7: 0x0702, 0x16e8: 0x0e62, 0x16e9: 0x0e66, 0x16ea: 0x0e6a, 0x16eb: 0x0e76, 0x16ec: 0x1819, 0x16ed: 0x0e7e, 0x16ee: 0x0706, 0x16ef: 0x0e8a, 0x16f0: 0x181e, 0x16f1: 0x0e8e, 0x16f2: 0x070a, 0x16f3: 0x0e9a, 0x16f4: 0x0ea6, 0x16f5: 0x0eb2, 0x16f6: 0x0eb6, 0x16f7: 0x1823, 0x16f8: 0x17ba, 0x16f9: 0x1828, 0x16fa: 0x0ed6, 0x16fb: 0x182d, 0x16fc: 0x0ee2, 0x16fd: 0x0eea, 0x16fe: 0x0eda, 0x16ff: 0x0ef6, // Block 0x5c, offset 0x1700 0x1700: 0x0f06, 0x1701: 0x0f16, 0x1702: 0x0f0a, 0x1703: 0x0f0e, 0x1704: 0x0f1a, 0x1705: 0x0f1e, 0x1706: 0x1832, 0x1707: 0x0f02, 0x1708: 0x0f36, 0x1709: 0x0f3a, 0x170a: 0x070e, 0x170b: 0x0f4e, 0x170c: 0x0f4a, 0x170d: 0x1837, 0x170e: 0x0f2e, 0x170f: 0x0f6a, 0x1710: 0x183c, 0x1711: 0x1841, 0x1712: 0x0f6e, 0x1713: 0x0f82, 0x1714: 0x0f7e, 0x1715: 0x0f7a, 0x1716: 0x0712, 0x1717: 0x0f86, 0x1718: 0x0f96, 0x1719: 0x0f92, 0x171a: 0x0f9e, 0x171b: 0x177e, 0x171c: 0x0fae, 0x171d: 0x1846, 0x171e: 0x0fba, 0x171f: 0x1850, 0x1720: 0x0fce, 0x1721: 0x0fda, 0x1722: 0x0fee, 0x1723: 0x1855, 0x1724: 0x1002, 0x1725: 0x1006, 0x1726: 0x185a, 0x1727: 0x185f, 0x1728: 0x1022, 0x1729: 0x1032, 0x172a: 0x0716, 0x172b: 0x1036, 0x172c: 0x071a, 0x172d: 0x071a, 0x172e: 0x104e, 0x172f: 0x1052, 0x1730: 0x105a, 0x1731: 0x105e, 0x1732: 0x106a, 0x1733: 0x071e, 0x1734: 0x1082, 0x1735: 0x1864, 0x1736: 0x109e, 0x1737: 0x1869, 0x1738: 0x10aa, 0x1739: 0x17ce, 0x173a: 0x10ba, 0x173b: 0x186e, 0x173c: 0x1873, 0x173d: 0x1878, 0x173e: 0x0722, 0x173f: 0x0726, // Block 0x5d, offset 0x1740 0x1740: 0x10f2, 0x1741: 0x1882, 0x1742: 0x187d, 0x1743: 0x1887, 0x1744: 0x188c, 0x1745: 0x10fa, 0x1746: 0x10fe, 0x1747: 0x10fe, 0x1748: 0x1106, 0x1749: 0x072e, 0x174a: 0x110a, 0x174b: 0x0732, 0x174c: 0x0736, 0x174d: 0x1896, 0x174e: 0x111e, 0x174f: 0x1126, 0x1750: 0x1132, 0x1751: 0x073a, 0x1752: 0x189b, 0x1753: 0x1156, 0x1754: 0x18a0, 0x1755: 0x18a5, 0x1756: 0x1176, 0x1757: 0x118e, 0x1758: 0x073e, 0x1759: 0x1196, 0x175a: 0x119a, 0x175b: 0x119e, 0x175c: 0x18aa, 0x175d: 0x18af, 0x175e: 0x18af, 0x175f: 0x11b6, 0x1760: 0x0742, 0x1761: 0x18b4, 0x1762: 0x11ca, 0x1763: 0x11ce, 0x1764: 0x0746, 0x1765: 0x18b9, 0x1766: 0x11ea, 0x1767: 0x074a, 0x1768: 0x11fa, 0x1769: 0x11f2, 0x176a: 0x1202, 0x176b: 0x18c3, 0x176c: 0x121a, 0x176d: 0x074e, 0x176e: 0x1226, 0x176f: 0x122e, 0x1770: 0x123e, 0x1771: 0x0752, 0x1772: 0x18cd, 0x1773: 0x18d2, 0x1774: 0x0756, 0x1775: 0x18d7, 0x1776: 0x1256, 0x1777: 0x18dc, 0x1778: 0x1262, 0x1779: 0x126e, 0x177a: 0x1276, 0x177b: 0x18e1, 0x177c: 0x18e6, 0x177d: 0x128a, 0x177e: 0x18eb, 0x177f: 0x1292, // Block 0x5e, offset 0x1780 0x1780: 0x17fb, 0x1781: 0x075a, 0x1782: 0x12aa, 0x1783: 0x12ae, 0x1784: 0x0762, 0x1785: 0x12b2, 0x1786: 0x0b2e, 0x1787: 0x18f0, 0x1788: 0x18f5, 0x1789: 0x1800, 0x178a: 0x1805, 0x178b: 0x12d2, 0x178c: 0x12d6, 0x178d: 0x14ee, 0x178e: 0x0766, 0x178f: 0x1302, 0x1790: 0x12fe, 0x1791: 0x1306, 0x1792: 0x093a, 0x1793: 0x130a, 0x1794: 0x130e, 0x1795: 0x1312, 0x1796: 0x131a, 0x1797: 0x18fa, 0x1798: 0x1316, 0x1799: 0x131e, 0x179a: 0x1332, 0x179b: 0x1336, 0x179c: 0x1322, 0x179d: 0x133a, 0x179e: 0x134e, 0x179f: 0x1362, 0x17a0: 0x132e, 0x17a1: 0x1342, 0x17a2: 0x1346, 0x17a3: 0x134a, 0x17a4: 0x18ff, 0x17a5: 0x1909, 0x17a6: 0x1904, 0x17a7: 0x076a, 0x17a8: 0x136a, 0x17a9: 0x136e, 0x17aa: 0x1376, 0x17ab: 0x191d, 0x17ac: 0x137a, 0x17ad: 0x190e, 0x17ae: 0x076e, 0x17af: 0x0772, 0x17b0: 0x1913, 0x17b1: 0x1918, 0x17b2: 0x0776, 0x17b3: 0x139a, 0x17b4: 0x139e, 0x17b5: 0x13a2, 0x17b6: 0x13a6, 0x17b7: 0x13b2, 0x17b8: 0x13ae, 0x17b9: 0x13ba, 0x17ba: 0x13b6, 0x17bb: 0x13c6, 0x17bc: 0x13be, 0x17bd: 0x13c2, 0x17be: 0x13ca, 0x17bf: 0x077a, // Block 0x5f, offset 0x17c0 0x17c0: 0x13d2, 0x17c1: 0x13d6, 0x17c2: 0x077e, 0x17c3: 0x13e6, 0x17c4: 0x13ea, 0x17c5: 0x1922, 0x17c6: 0x13f6, 0x17c7: 0x13fa, 0x17c8: 0x0782, 0x17c9: 0x1406, 0x17ca: 0x06b6, 0x17cb: 0x1927, 0x17cc: 0x192c, 0x17cd: 0x0786, 0x17ce: 0x078a, 0x17cf: 0x1432, 0x17d0: 0x144a, 0x17d1: 0x1466, 0x17d2: 0x1476, 0x17d3: 0x1931, 0x17d4: 0x148a, 0x17d5: 0x148e, 0x17d6: 0x14a6, 0x17d7: 0x14b2, 0x17d8: 0x193b, 0x17d9: 0x178d, 0x17da: 0x14be, 0x17db: 0x14ba, 0x17dc: 0x14c6, 0x17dd: 0x1792, 0x17de: 0x14d2, 0x17df: 0x14de, 0x17e0: 0x1940, 0x17e1: 0x1945, 0x17e2: 0x151e, 0x17e3: 0x152a, 0x17e4: 0x1532, 0x17e5: 0x194a, 0x17e6: 0x1536, 0x17e7: 0x1562, 0x17e8: 0x156e, 0x17e9: 0x1572, 0x17ea: 0x156a, 0x17eb: 0x157e, 0x17ec: 0x1582, 0x17ed: 0x194f, 0x17ee: 0x158e, 0x17ef: 0x078e, 0x17f0: 0x1596, 0x17f1: 0x1954, 0x17f2: 0x0792, 0x17f3: 0x15ce, 0x17f4: 0x0bbe, 0x17f5: 0x15e6, 0x17f6: 0x1959, 0x17f7: 0x1963, 0x17f8: 0x0796, 0x17f9: 0x079a, 0x17fa: 0x160e, 0x17fb: 0x1968, 0x17fc: 0x079e, 0x17fd: 0x196d, 0x17fe: 0x1626, 0x17ff: 0x1626, // Block 0x60, offset 0x1800 0x1800: 0x162e, 0x1801: 0x1972, 0x1802: 0x1646, 0x1803: 0x07a2, 0x1804: 0x1656, 0x1805: 0x1662, 0x1806: 0x166a, 0x1807: 0x1672, 0x1808: 0x07a6, 0x1809: 0x1977, 0x180a: 0x1686, 0x180b: 0x16a2, 0x180c: 0x16ae, 0x180d: 0x07aa, 0x180e: 0x07ae, 0x180f: 0x16b2, 0x1810: 0x197c, 0x1811: 0x07b2, 0x1812: 0x1981, 0x1813: 0x1986, 0x1814: 0x198b, 0x1815: 0x16d6, 0x1816: 0x07b6, 0x1817: 0x16ea, 0x1818: 0x16f2, 0x1819: 0x16f6, 0x181a: 0x16fe, 0x181b: 0x1706, 0x181c: 0x170e, 0x181d: 0x1995, } // nfkcIndex: 22 blocks, 1408 entries, 2816 bytes // Block 0 is the zero block. var nfkcIndex = [1408]uint16{ // Block 0x0, offset 0x0 // Block 0x1, offset 0x40 // Block 0x2, offset 0x80 // Block 0x3, offset 0xc0 0xc2: 0x5f, 0xc3: 0x01, 0xc4: 0x02, 0xc5: 0x03, 0xc6: 0x60, 0xc7: 0x04, 0xc8: 0x05, 0xca: 0x61, 0xcb: 0x62, 0xcc: 0x06, 0xcd: 0x07, 0xce: 0x08, 0xcf: 0x09, 0xd0: 0x0a, 0xd1: 0x63, 0xd2: 0x64, 0xd3: 0x0b, 0xd6: 0x0c, 0xd7: 0x65, 0xd8: 0x66, 0xd9: 0x0d, 0xdb: 0x67, 0xdc: 0x68, 0xdd: 0x69, 0xdf: 0x6a, 0xe0: 0x02, 0xe1: 0x03, 0xe2: 0x04, 0xe3: 0x05, 0xea: 0x06, 0xeb: 0x07, 0xec: 0x08, 0xed: 0x09, 0xef: 0x0a, 0xf0: 0x13, // Block 0x4, offset 0x100 0x120: 0x6b, 0x121: 0x6c, 0x122: 0x6d, 0x123: 0x0e, 0x124: 0x6e, 0x125: 0x6f, 0x126: 0x70, 0x127: 0x71, 0x128: 0x72, 0x129: 0x73, 0x12a: 0x74, 0x12b: 0x75, 0x12c: 0x70, 0x12d: 0x76, 0x12e: 0x77, 0x12f: 0x78, 0x130: 0x74, 0x131: 0x79, 0x132: 0x7a, 0x133: 0x7b, 0x134: 0x7c, 0x135: 0x7d, 0x137: 0x7e, 0x138: 0x7f, 0x139: 0x80, 0x13a: 0x81, 0x13b: 0x82, 0x13c: 0x83, 0x13d: 0x84, 0x13e: 0x85, 0x13f: 0x86, // Block 0x5, offset 0x140 0x140: 0x87, 0x142: 0x88, 0x143: 0x89, 0x144: 0x8a, 0x145: 0x8b, 0x146: 0x8c, 0x147: 0x8d, 0x14d: 0x8e, 0x15c: 0x8f, 0x15f: 0x90, 0x162: 0x91, 0x164: 0x92, 0x168: 0x93, 0x169: 0x94, 0x16a: 0x95, 0x16b: 0x96, 0x16c: 0x0f, 0x16d: 0x97, 0x16e: 0x98, 0x16f: 0x99, 0x170: 0x9a, 0x173: 0x9b, 0x174: 0x9c, 0x175: 0x10, 0x176: 0x11, 0x177: 0x12, 0x178: 0x13, 0x179: 0x14, 0x17a: 0x15, 0x17b: 0x16, 0x17c: 0x17, 0x17d: 0x18, 0x17e: 0x19, 0x17f: 0x1a, // Block 0x6, offset 0x180 0x180: 0x9d, 0x181: 0x9e, 0x182: 0x9f, 0x183: 0xa0, 0x184: 0x1b, 0x185: 0x1c, 0x186: 0xa1, 0x187: 0xa2, 0x188: 0xa3, 0x189: 0x1d, 0x18a: 0x1e, 0x18b: 0xa4, 0x18c: 0xa5, 0x191: 0x1f, 0x192: 0x20, 0x193: 0xa6, 0x1a8: 0xa7, 0x1a9: 0xa8, 0x1ab: 0xa9, 0x1b1: 0xaa, 0x1b3: 0xab, 0x1b5: 0xac, 0x1b7: 0xad, 0x1ba: 0xae, 0x1bb: 0xaf, 0x1bc: 0x21, 0x1bd: 0x22, 0x1be: 0x23, 0x1bf: 0xb0, // Block 0x7, offset 0x1c0 0x1c0: 0xb1, 0x1c1: 0x24, 0x1c2: 0x25, 0x1c3: 0x26, 0x1c4: 0xb2, 0x1c5: 0x27, 0x1c6: 0x28, 0x1c8: 0x29, 0x1c9: 0x2a, 0x1ca: 0x2b, 0x1cb: 0x2c, 0x1cc: 0x2d, 0x1cd: 0x2e, 0x1ce: 0x2f, 0x1cf: 0x30, // Block 0x8, offset 0x200 0x219: 0xb3, 0x21a: 0xb4, 0x21b: 0xb5, 0x21d: 0xb6, 0x21f: 0xb7, 0x220: 0xb8, 0x223: 0xb9, 0x224: 0xba, 0x225: 0xbb, 0x226: 0xbc, 0x227: 0xbd, 0x22a: 0xbe, 0x22b: 0xbf, 0x22d: 0xc0, 0x22f: 0xc1, 0x230: 0xc2, 0x231: 0xc3, 0x232: 0xc4, 0x233: 0xc5, 0x234: 0xc6, 0x235: 0xc7, 0x236: 0xc8, 0x237: 0xc2, 0x238: 0xc3, 0x239: 0xc4, 0x23a: 0xc5, 0x23b: 0xc6, 0x23c: 0xc7, 0x23d: 0xc8, 0x23e: 0xc2, 0x23f: 0xc3, // Block 0x9, offset 0x240 0x240: 0xc4, 0x241: 0xc5, 0x242: 0xc6, 0x243: 0xc7, 0x244: 0xc8, 0x245: 0xc2, 0x246: 0xc3, 0x247: 0xc4, 0x248: 0xc5, 0x249: 0xc6, 0x24a: 0xc7, 0x24b: 0xc8, 0x24c: 0xc2, 0x24d: 0xc3, 0x24e: 0xc4, 0x24f: 0xc5, 0x250: 0xc6, 0x251: 0xc7, 0x252: 0xc8, 0x253: 0xc2, 0x254: 0xc3, 0x255: 0xc4, 0x256: 0xc5, 0x257: 0xc6, 0x258: 0xc7, 0x259: 0xc8, 0x25a: 0xc2, 0x25b: 0xc3, 0x25c: 0xc4, 0x25d: 0xc5, 0x25e: 0xc6, 0x25f: 0xc7, 0x260: 0xc8, 0x261: 0xc2, 0x262: 0xc3, 0x263: 0xc4, 0x264: 0xc5, 0x265: 0xc6, 0x266: 0xc7, 0x267: 0xc8, 0x268: 0xc2, 0x269: 0xc3, 0x26a: 0xc4, 0x26b: 0xc5, 0x26c: 0xc6, 0x26d: 0xc7, 0x26e: 0xc8, 0x26f: 0xc2, 0x270: 0xc3, 0x271: 0xc4, 0x272: 0xc5, 0x273: 0xc6, 0x274: 0xc7, 0x275: 0xc8, 0x276: 0xc2, 0x277: 0xc3, 0x278: 0xc4, 0x279: 0xc5, 0x27a: 0xc6, 0x27b: 0xc7, 0x27c: 0xc8, 0x27d: 0xc2, 0x27e: 0xc3, 0x27f: 0xc4, // Block 0xa, offset 0x280 0x280: 0xc5, 0x281: 0xc6, 0x282: 0xc7, 0x283: 0xc8, 0x284: 0xc2, 0x285: 0xc3, 0x286: 0xc4, 0x287: 0xc5, 0x288: 0xc6, 0x289: 0xc7, 0x28a: 0xc8, 0x28b: 0xc2, 0x28c: 0xc3, 0x28d: 0xc4, 0x28e: 0xc5, 0x28f: 0xc6, 0x290: 0xc7, 0x291: 0xc8, 0x292: 0xc2, 0x293: 0xc3, 0x294: 0xc4, 0x295: 0xc5, 0x296: 0xc6, 0x297: 0xc7, 0x298: 0xc8, 0x299: 0xc2, 0x29a: 0xc3, 0x29b: 0xc4, 0x29c: 0xc5, 0x29d: 0xc6, 0x29e: 0xc7, 0x29f: 0xc8, 0x2a0: 0xc2, 0x2a1: 0xc3, 0x2a2: 0xc4, 0x2a3: 0xc5, 0x2a4: 0xc6, 0x2a5: 0xc7, 0x2a6: 0xc8, 0x2a7: 0xc2, 0x2a8: 0xc3, 0x2a9: 0xc4, 0x2aa: 0xc5, 0x2ab: 0xc6, 0x2ac: 0xc7, 0x2ad: 0xc8, 0x2ae: 0xc2, 0x2af: 0xc3, 0x2b0: 0xc4, 0x2b1: 0xc5, 0x2b2: 0xc6, 0x2b3: 0xc7, 0x2b4: 0xc8, 0x2b5: 0xc2, 0x2b6: 0xc3, 0x2b7: 0xc4, 0x2b8: 0xc5, 0x2b9: 0xc6, 0x2ba: 0xc7, 0x2bb: 0xc8, 0x2bc: 0xc2, 0x2bd: 0xc3, 0x2be: 0xc4, 0x2bf: 0xc5, // Block 0xb, offset 0x2c0 0x2c0: 0xc6, 0x2c1: 0xc7, 0x2c2: 0xc8, 0x2c3: 0xc2, 0x2c4: 0xc3, 0x2c5: 0xc4, 0x2c6: 0xc5, 0x2c7: 0xc6, 0x2c8: 0xc7, 0x2c9: 0xc8, 0x2ca: 0xc2, 0x2cb: 0xc3, 0x2cc: 0xc4, 0x2cd: 0xc5, 0x2ce: 0xc6, 0x2cf: 0xc7, 0x2d0: 0xc8, 0x2d1: 0xc2, 0x2d2: 0xc3, 0x2d3: 0xc4, 0x2d4: 0xc5, 0x2d5: 0xc6, 0x2d6: 0xc7, 0x2d7: 0xc8, 0x2d8: 0xc2, 0x2d9: 0xc3, 0x2da: 0xc4, 0x2db: 0xc5, 0x2dc: 0xc6, 0x2dd: 0xc7, 0x2de: 0xc9, // Block 0xc, offset 0x300 0x324: 0x31, 0x325: 0x32, 0x326: 0x33, 0x327: 0x34, 0x328: 0x35, 0x329: 0x36, 0x32a: 0x37, 0x32b: 0x38, 0x32c: 0x39, 0x32d: 0x3a, 0x32e: 0x3b, 0x32f: 0x3c, 0x330: 0x3d, 0x331: 0x3e, 0x332: 0x3f, 0x333: 0x40, 0x334: 0x41, 0x335: 0x42, 0x336: 0x43, 0x337: 0x44, 0x338: 0x45, 0x339: 0x46, 0x33a: 0x47, 0x33b: 0x48, 0x33c: 0xca, 0x33d: 0x49, 0x33e: 0x4a, 0x33f: 0x4b, // Block 0xd, offset 0x340 0x347: 0xcb, 0x34b: 0xcc, 0x34d: 0xcd, 0x35e: 0x4c, 0x368: 0xce, 0x36b: 0xcf, 0x374: 0xd0, 0x37a: 0xd1, 0x37b: 0xd2, 0x37d: 0xd3, 0x37e: 0xd4, // Block 0xe, offset 0x380 0x381: 0xd5, 0x382: 0xd6, 0x384: 0xd7, 0x385: 0xbc, 0x387: 0xd8, 0x388: 0xd9, 0x38b: 0xda, 0x38c: 0xdb, 0x38d: 0xdc, 0x391: 0xdd, 0x392: 0xde, 0x393: 0xdf, 0x396: 0xe0, 0x397: 0xe1, 0x398: 0xe2, 0x39a: 0xe3, 0x39c: 0xe4, 0x3a0: 0xe5, 0x3a4: 0xe6, 0x3a5: 0xe7, 0x3a7: 0xe8, 0x3a8: 0xe9, 0x3a9: 0xea, 0x3aa: 0xeb, 0x3b0: 0xe2, 0x3b5: 0xec, 0x3b6: 0xed, 0x3bd: 0xee, // Block 0xf, offset 0x3c0 0x3eb: 0xef, 0x3ec: 0xf0, 0x3ff: 0xf1, // Block 0x10, offset 0x400 0x432: 0xf2, // Block 0x11, offset 0x440 0x445: 0xf3, 0x446: 0xf4, 0x447: 0xf5, 0x449: 0xf6, 0x450: 0xf7, 0x451: 0xf8, 0x452: 0xf9, 0x453: 0xfa, 0x454: 0xfb, 0x455: 0xfc, 0x456: 0xfd, 0x457: 0xfe, 0x458: 0xff, 0x459: 0x100, 0x45a: 0x4d, 0x45b: 0x101, 0x45c: 0x102, 0x45d: 0x103, 0x45e: 0x104, 0x45f: 0x4e, // Block 0x12, offset 0x480 0x480: 0x4f, 0x481: 0x50, 0x482: 0x105, 0x484: 0xf0, 0x48a: 0x106, 0x48b: 0x107, 0x493: 0x108, 0x4a3: 0x109, 0x4a5: 0x10a, 0x4b8: 0x51, 0x4b9: 0x52, 0x4ba: 0x53, // Block 0x13, offset 0x4c0 0x4c4: 0x54, 0x4c5: 0x10b, 0x4c6: 0x10c, 0x4c8: 0x55, 0x4c9: 0x10d, 0x4ef: 0x10e, // Block 0x14, offset 0x500 0x520: 0x56, 0x521: 0x57, 0x522: 0x58, 0x523: 0x59, 0x524: 0x5a, 0x525: 0x5b, 0x526: 0x5c, 0x527: 0x5d, 0x528: 0x5e, // Block 0x15, offset 0x540 0x550: 0x0b, 0x551: 0x0c, 0x556: 0x0d, 0x55b: 0x0e, 0x55d: 0x0f, 0x55e: 0x10, 0x55f: 0x11, 0x56f: 0x12, } // nfkcSparseOffset: 176 entries, 352 bytes var nfkcSparseOffset = []uint16{0x0, 0xe, 0x12, 0x1c, 0x26, 0x36, 0x38, 0x3d, 0x48, 0x57, 0x64, 0x6c, 0x71, 0x76, 0x78, 0x7c, 0x84, 0x8b, 0x8e, 0x96, 0x9a, 0x9e, 0xa0, 0xa2, 0xab, 0xaf, 0xb6, 0xbb, 0xbe, 0xc8, 0xcb, 0xd2, 0xda, 0xde, 0xe0, 0xe4, 0xe8, 0xee, 0xff, 0x10b, 0x10d, 0x113, 0x115, 0x117, 0x119, 0x11b, 0x11d, 0x11f, 0x121, 0x124, 0x127, 0x129, 0x12c, 0x12f, 0x133, 0x139, 0x140, 0x149, 0x14b, 0x14e, 0x150, 0x15b, 0x166, 0x174, 0x182, 0x192, 0x1a0, 0x1a7, 0x1ad, 0x1bc, 0x1c0, 0x1c2, 0x1c6, 0x1c8, 0x1cb, 0x1cd, 0x1d0, 0x1d2, 0x1d5, 0x1d7, 0x1d9, 0x1db, 0x1e7, 0x1f1, 0x1fb, 0x1fe, 0x202, 0x204, 0x206, 0x20b, 0x20e, 0x211, 0x213, 0x215, 0x217, 0x219, 0x21f, 0x222, 0x227, 0x229, 0x230, 0x236, 0x23c, 0x244, 0x24a, 0x250, 0x256, 0x25a, 0x25c, 0x25e, 0x260, 0x262, 0x268, 0x26b, 0x26d, 0x26f, 0x271, 0x277, 0x27b, 0x27f, 0x287, 0x28e, 0x291, 0x294, 0x296, 0x299, 0x2a1, 0x2a5, 0x2ac, 0x2af, 0x2b5, 0x2b7, 0x2b9, 0x2bc, 0x2be, 0x2c1, 0x2c6, 0x2c8, 0x2ca, 0x2cc, 0x2ce, 0x2d0, 0x2d3, 0x2d5, 0x2d7, 0x2d9, 0x2db, 0x2dd, 0x2df, 0x2ec, 0x2f6, 0x2f8, 0x2fa, 0x2fe, 0x303, 0x30f, 0x314, 0x31d, 0x323, 0x328, 0x32c, 0x331, 0x335, 0x345, 0x353, 0x361, 0x36f, 0x371, 0x373, 0x375, 0x379, 0x37b, 0x37e, 0x389, 0x38b, 0x395} // nfkcSparseValues: 919 entries, 3676 bytes var nfkcSparseValues = [919]valueRange{ // Block 0x0, offset 0x0 {value: 0x0002, lo: 0x0d}, {value: 0x0001, lo: 0xa0, hi: 0xa0}, {value: 0x4331, lo: 0xa8, hi: 0xa8}, {value: 0x0083, lo: 0xaa, hi: 0xaa}, {value: 0x431d, lo: 0xaf, hi: 0xaf}, {value: 0x0025, lo: 0xb2, hi: 0xb3}, {value: 0x4313, lo: 0xb4, hi: 0xb4}, {value: 0x0260, lo: 0xb5, hi: 0xb5}, {value: 0x434a, lo: 0xb8, hi: 0xb8}, {value: 0x0023, lo: 0xb9, hi: 0xb9}, {value: 0x009f, lo: 0xba, hi: 0xba}, {value: 0x234c, lo: 0xbc, hi: 0xbc}, {value: 0x2340, lo: 0xbd, hi: 0xbd}, {value: 0x23e2, lo: 0xbe, hi: 0xbe}, // Block 0x1, offset 0xe {value: 0x0091, lo: 0x03}, {value: 0x4813, lo: 0xa0, hi: 0xa1}, {value: 0x4845, lo: 0xaf, hi: 0xb0}, {value: 0xa000, lo: 0xb7, hi: 0xb7}, // Block 0x2, offset 0x12 {value: 0x0004, lo: 0x09}, {value: 0xa000, lo: 0x92, hi: 0x92}, {value: 0x0091, lo: 0xb0, hi: 0xb0}, {value: 0x0140, lo: 0xb1, hi: 0xb1}, {value: 0x0095, lo: 0xb2, hi: 0xb2}, {value: 0x00a5, lo: 0xb3, hi: 0xb3}, {value: 0x0179, lo: 0xb4, hi: 0xb4}, {value: 0x017f, lo: 0xb5, hi: 0xb5}, {value: 0x018b, lo: 0xb6, hi: 0xb6}, {value: 0x00af, lo: 0xb7, hi: 0xb8}, // Block 0x3, offset 0x1c {value: 0x000a, lo: 0x09}, {value: 0x4327, lo: 0x98, hi: 0x98}, {value: 0x432c, lo: 0x99, hi: 0x9a}, {value: 0x434f, lo: 0x9b, hi: 0x9b}, {value: 0x4318, lo: 0x9c, hi: 0x9c}, {value: 0x433b, lo: 0x9d, hi: 0x9d}, {value: 0x0137, lo: 0xa0, hi: 0xa0}, {value: 0x0099, lo: 0xa1, hi: 0xa1}, {value: 0x00a7, lo: 0xa2, hi: 0xa3}, {value: 0x01b8, lo: 0xa4, hi: 0xa4}, // Block 0x4, offset 0x26 {value: 0x0000, lo: 0x0f}, {value: 0xa000, lo: 0x83, hi: 0x83}, {value: 0xa000, lo: 0x87, hi: 0x87}, {value: 0xa000, lo: 0x8b, hi: 0x8b}, {value: 0xa000, lo: 0x8d, hi: 0x8d}, {value: 0x3704, lo: 0x90, hi: 0x90}, {value: 0x3710, lo: 0x91, hi: 0x91}, {value: 0x36fe, lo: 0x93, hi: 0x93}, {value: 0xa000, lo: 0x96, hi: 0x96}, {value: 0x3776, lo: 0x97, hi: 0x97}, {value: 0x3740, lo: 0x9c, hi: 0x9c}, {value: 0x3728, lo: 0x9d, hi: 0x9d}, {value: 0x3752, lo: 0x9e, hi: 0x9e}, {value: 0xa000, lo: 0xb4, hi: 0xb5}, {value: 0x377c, lo: 0xb6, hi: 0xb6}, {value: 0x3782, lo: 0xb7, hi: 0xb7}, // Block 0x5, offset 0x36 {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0x83, hi: 0x87}, // Block 0x6, offset 0x38 {value: 0x0001, lo: 0x04}, {value: 0x8114, lo: 0x81, hi: 0x82}, {value: 0x8133, lo: 0x84, hi: 0x84}, {value: 0x812e, lo: 0x85, hi: 0x85}, {value: 0x810e, lo: 0x87, hi: 0x87}, // Block 0x7, offset 0x3d {value: 0x0000, lo: 0x0a}, {value: 0x8133, lo: 0x90, hi: 0x97}, {value: 0x811a, lo: 0x98, hi: 0x98}, {value: 0x811b, lo: 0x99, hi: 0x99}, {value: 0x811c, lo: 0x9a, hi: 0x9a}, {value: 0x37a0, lo: 0xa2, hi: 0xa2}, {value: 0x37a6, lo: 0xa3, hi: 0xa3}, {value: 0x37b2, lo: 0xa4, hi: 0xa4}, {value: 0x37ac, lo: 0xa5, hi: 0xa5}, {value: 0x37b8, lo: 0xa6, hi: 0xa6}, {value: 0xa000, lo: 0xa7, hi: 0xa7}, // Block 0x8, offset 0x48 {value: 0x0000, lo: 0x0e}, {value: 0x37ca, lo: 0x80, hi: 0x80}, {value: 0xa000, lo: 0x81, hi: 0x81}, {value: 0x37be, lo: 0x82, hi: 0x82}, {value: 0xa000, lo: 0x92, hi: 0x92}, {value: 0x37c4, lo: 0x93, hi: 0x93}, {value: 0xa000, lo: 0x95, hi: 0x95}, {value: 0x8133, lo: 0x96, hi: 0x9c}, {value: 0x8133, lo: 0x9f, hi: 0xa2}, {value: 0x812e, lo: 0xa3, hi: 0xa3}, {value: 0x8133, lo: 0xa4, hi: 0xa4}, {value: 0x8133, lo: 0xa7, hi: 0xa8}, {value: 0x812e, lo: 0xaa, hi: 0xaa}, {value: 0x8133, lo: 0xab, hi: 0xac}, {value: 0x812e, lo: 0xad, hi: 0xad}, // Block 0x9, offset 0x57 {value: 0x0000, lo: 0x0c}, {value: 0x8120, lo: 0x91, hi: 0x91}, {value: 0x8133, lo: 0xb0, hi: 0xb0}, {value: 0x812e, lo: 0xb1, hi: 0xb1}, {value: 0x8133, lo: 0xb2, hi: 0xb3}, {value: 0x812e, lo: 0xb4, hi: 0xb4}, {value: 0x8133, lo: 0xb5, hi: 0xb6}, {value: 0x812e, lo: 0xb7, hi: 0xb9}, {value: 0x8133, lo: 0xba, hi: 0xba}, {value: 0x812e, lo: 0xbb, hi: 0xbc}, {value: 0x8133, lo: 0xbd, hi: 0xbd}, {value: 0x812e, lo: 0xbe, hi: 0xbe}, {value: 0x8133, lo: 0xbf, hi: 0xbf}, // Block 0xa, offset 0x64 {value: 0x0005, lo: 0x07}, {value: 0x8133, lo: 0x80, hi: 0x80}, {value: 0x8133, lo: 0x81, hi: 0x81}, {value: 0x812e, lo: 0x82, hi: 0x83}, {value: 0x812e, lo: 0x84, hi: 0x85}, {value: 0x812e, lo: 0x86, hi: 0x87}, {value: 0x812e, lo: 0x88, hi: 0x89}, {value: 0x8133, lo: 0x8a, hi: 0x8a}, // Block 0xb, offset 0x6c {value: 0x0000, lo: 0x04}, {value: 0x8133, lo: 0xab, hi: 0xb1}, {value: 0x812e, lo: 0xb2, hi: 0xb2}, {value: 0x8133, lo: 0xb3, hi: 0xb3}, {value: 0x812e, lo: 0xbd, hi: 0xbd}, // Block 0xc, offset 0x71 {value: 0x0000, lo: 0x04}, {value: 0x8133, lo: 0x96, hi: 0x99}, {value: 0x8133, lo: 0x9b, hi: 0xa3}, {value: 0x8133, lo: 0xa5, hi: 0xa7}, {value: 0x8133, lo: 0xa9, hi: 0xad}, // Block 0xd, offset 0x76 {value: 0x0000, lo: 0x01}, {value: 0x812e, lo: 0x99, hi: 0x9b}, // Block 0xe, offset 0x78 {value: 0x0000, lo: 0x03}, {value: 0x8133, lo: 0x98, hi: 0x98}, {value: 0x812e, lo: 0x99, hi: 0x9b}, {value: 0x8133, lo: 0x9c, hi: 0x9f}, // Block 0xf, offset 0x7c {value: 0x0000, lo: 0x07}, {value: 0xa000, lo: 0xa8, hi: 0xa8}, {value: 0x3e37, lo: 0xa9, hi: 0xa9}, {value: 0xa000, lo: 0xb0, hi: 0xb0}, {value: 0x3e3f, lo: 0xb1, hi: 0xb1}, {value: 0xa000, lo: 0xb3, hi: 0xb3}, {value: 0x3e47, lo: 0xb4, hi: 0xb4}, {value: 0x9903, lo: 0xbc, hi: 0xbc}, // Block 0x10, offset 0x84 {value: 0x0008, lo: 0x06}, {value: 0x8105, lo: 0x8d, hi: 0x8d}, {value: 0x8133, lo: 0x91, hi: 0x91}, {value: 0x812e, lo: 0x92, hi: 0x92}, {value: 0x8133, lo: 0x93, hi: 0x93}, {value: 0x8133, lo: 0x94, hi: 0x94}, {value: 0x45d5, lo: 0x98, hi: 0x9f}, // Block 0x11, offset 0x8b {value: 0x0000, lo: 0x02}, {value: 0x8103, lo: 0xbc, hi: 0xbc}, {value: 0x9900, lo: 0xbe, hi: 0xbe}, // Block 0x12, offset 0x8e {value: 0x0008, lo: 0x07}, {value: 0xa000, lo: 0x87, hi: 0x87}, {value: 0x3e4f, lo: 0x8b, hi: 0x8c}, {value: 0x8105, lo: 0x8d, hi: 0x8d}, {value: 0x9900, lo: 0x97, hi: 0x97}, {value: 0x4615, lo: 0x9c, hi: 0x9d}, {value: 0x4625, lo: 0x9f, hi: 0x9f}, {value: 0x8133, lo: 0xbe, hi: 0xbe}, // Block 0x13, offset 0x96 {value: 0x0000, lo: 0x03}, {value: 0x464d, lo: 0xb3, hi: 0xb3}, {value: 0x4655, lo: 0xb6, hi: 0xb6}, {value: 0x8103, lo: 0xbc, hi: 0xbc}, // Block 0x14, offset 0x9a {value: 0x0008, lo: 0x03}, {value: 0x8105, lo: 0x8d, hi: 0x8d}, {value: 0x462d, lo: 0x99, hi: 0x9b}, {value: 0x4645, lo: 0x9e, hi: 0x9e}, // Block 0x15, offset 0x9e {value: 0x0000, lo: 0x01}, {value: 0x8103, lo: 0xbc, hi: 0xbc}, // Block 0x16, offset 0xa0 {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0x8d, hi: 0x8d}, // Block 0x17, offset 0xa2 {value: 0x0000, lo: 0x08}, {value: 0xa000, lo: 0x87, hi: 0x87}, {value: 0x3e67, lo: 0x88, hi: 0x88}, {value: 0x3e5f, lo: 0x8b, hi: 0x8b}, {value: 0x3e6f, lo: 0x8c, hi: 0x8c}, {value: 0x8105, lo: 0x8d, hi: 0x8d}, {value: 0x9900, lo: 0x96, hi: 0x97}, {value: 0x465d, lo: 0x9c, hi: 0x9c}, {value: 0x4665, lo: 0x9d, hi: 0x9d}, // Block 0x18, offset 0xab {value: 0x0000, lo: 0x03}, {value: 0xa000, lo: 0x92, hi: 0x92}, {value: 0x3e77, lo: 0x94, hi: 0x94}, {value: 0x9900, lo: 0xbe, hi: 0xbe}, // Block 0x19, offset 0xaf {value: 0x0000, lo: 0x06}, {value: 0xa000, lo: 0x86, hi: 0x87}, {value: 0x3e7f, lo: 0x8a, hi: 0x8a}, {value: 0x3e8f, lo: 0x8b, hi: 0x8b}, {value: 0x3e87, lo: 0x8c, hi: 0x8c}, {value: 0x8105, lo: 0x8d, hi: 0x8d}, {value: 0x9900, lo: 0x97, hi: 0x97}, // Block 0x1a, offset 0xb6 {value: 0x1801, lo: 0x04}, {value: 0xa000, lo: 0x86, hi: 0x86}, {value: 0x3e97, lo: 0x88, hi: 0x88}, {value: 0x8105, lo: 0x8d, hi: 0x8d}, {value: 0x8121, lo: 0x95, hi: 0x96}, // Block 0x1b, offset 0xbb {value: 0x0000, lo: 0x02}, {value: 0x8103, lo: 0xbc, hi: 0xbc}, {value: 0xa000, lo: 0xbf, hi: 0xbf}, // Block 0x1c, offset 0xbe {value: 0x0000, lo: 0x09}, {value: 0x3e9f, lo: 0x80, hi: 0x80}, {value: 0x9900, lo: 0x82, hi: 0x82}, {value: 0xa000, lo: 0x86, hi: 0x86}, {value: 0x3ea7, lo: 0x87, hi: 0x87}, {value: 0x3eaf, lo: 0x88, hi: 0x88}, {value: 0x4adf, lo: 0x8a, hi: 0x8a}, {value: 0x42f9, lo: 0x8b, hi: 0x8b}, {value: 0x8105, lo: 0x8d, hi: 0x8d}, {value: 0x9900, lo: 0x95, hi: 0x96}, // Block 0x1d, offset 0xc8 {value: 0x0000, lo: 0x02}, {value: 0x8105, lo: 0xbb, hi: 0xbc}, {value: 0x9900, lo: 0xbe, hi: 0xbe}, // Block 0x1e, offset 0xcb {value: 0x0000, lo: 0x06}, {value: 0xa000, lo: 0x86, hi: 0x87}, {value: 0x3eb7, lo: 0x8a, hi: 0x8a}, {value: 0x3ec7, lo: 0x8b, hi: 0x8b}, {value: 0x3ebf, lo: 0x8c, hi: 0x8c}, {value: 0x8105, lo: 0x8d, hi: 0x8d}, {value: 0x9900, lo: 0x97, hi: 0x97}, // Block 0x1f, offset 0xd2 {value: 0x5a29, lo: 0x07}, {value: 0x9905, lo: 0x8a, hi: 0x8a}, {value: 0x9900, lo: 0x8f, hi: 0x8f}, {value: 0xa000, lo: 0x99, hi: 0x99}, {value: 0x3ecf, lo: 0x9a, hi: 0x9a}, {value: 0x4ae7, lo: 0x9c, hi: 0x9c}, {value: 0x4304, lo: 0x9d, hi: 0x9d}, {value: 0x3ed7, lo: 0x9e, hi: 0x9f}, // Block 0x20, offset 0xda {value: 0x0000, lo: 0x03}, {value: 0x2751, lo: 0xb3, hi: 0xb3}, {value: 0x8123, lo: 0xb8, hi: 0xb9}, {value: 0x8105, lo: 0xba, hi: 0xba}, // Block 0x21, offset 0xde {value: 0x0000, lo: 0x01}, {value: 0x8124, lo: 0x88, hi: 0x8b}, // Block 0x22, offset 0xe0 {value: 0x0000, lo: 0x03}, {value: 0x2766, lo: 0xb3, hi: 0xb3}, {value: 0x8125, lo: 0xb8, hi: 0xb9}, {value: 0x8105, lo: 0xba, hi: 0xba}, // Block 0x23, offset 0xe4 {value: 0x0000, lo: 0x03}, {value: 0x8126, lo: 0x88, hi: 0x8b}, {value: 0x2758, lo: 0x9c, hi: 0x9c}, {value: 0x275f, lo: 0x9d, hi: 0x9d}, // Block 0x24, offset 0xe8 {value: 0x0000, lo: 0x05}, {value: 0x03fe, lo: 0x8c, hi: 0x8c}, {value: 0x812e, lo: 0x98, hi: 0x99}, {value: 0x812e, lo: 0xb5, hi: 0xb5}, {value: 0x812e, lo: 0xb7, hi: 0xb7}, {value: 0x812c, lo: 0xb9, hi: 0xb9}, // Block 0x25, offset 0xee {value: 0x0000, lo: 0x10}, {value: 0x2774, lo: 0x83, hi: 0x83}, {value: 0x277b, lo: 0x8d, hi: 0x8d}, {value: 0x2782, lo: 0x92, hi: 0x92}, {value: 0x2789, lo: 0x97, hi: 0x97}, {value: 0x2790, lo: 0x9c, hi: 0x9c}, {value: 0x276d, lo: 0xa9, hi: 0xa9}, {value: 0x8127, lo: 0xb1, hi: 0xb1}, {value: 0x8128, lo: 0xb2, hi: 0xb2}, {value: 0x4bc5, lo: 0xb3, hi: 0xb3}, {value: 0x8129, lo: 0xb4, hi: 0xb4}, {value: 0x4bce, lo: 0xb5, hi: 0xb5}, {value: 0x466d, lo: 0xb6, hi: 0xb6}, {value: 0x4725, lo: 0xb7, hi: 0xb7}, {value: 0x4675, lo: 0xb8, hi: 0xb8}, {value: 0x4730, lo: 0xb9, hi: 0xb9}, {value: 0x8128, lo: 0xba, hi: 0xbd}, // Block 0x26, offset 0xff {value: 0x0000, lo: 0x0b}, {value: 0x8128, lo: 0x80, hi: 0x80}, {value: 0x4bd7, lo: 0x81, hi: 0x81}, {value: 0x8133, lo: 0x82, hi: 0x83}, {value: 0x8105, lo: 0x84, hi: 0x84}, {value: 0x8133, lo: 0x86, hi: 0x87}, {value: 0x279e, lo: 0x93, hi: 0x93}, {value: 0x27a5, lo: 0x9d, hi: 0x9d}, {value: 0x27ac, lo: 0xa2, hi: 0xa2}, {value: 0x27b3, lo: 0xa7, hi: 0xa7}, {value: 0x27ba, lo: 0xac, hi: 0xac}, {value: 0x2797, lo: 0xb9, hi: 0xb9}, // Block 0x27, offset 0x10b {value: 0x0000, lo: 0x01}, {value: 0x812e, lo: 0x86, hi: 0x86}, // Block 0x28, offset 0x10d {value: 0x0000, lo: 0x05}, {value: 0xa000, lo: 0xa5, hi: 0xa5}, {value: 0x3edf, lo: 0xa6, hi: 0xa6}, {value: 0x9900, lo: 0xae, hi: 0xae}, {value: 0x8103, lo: 0xb7, hi: 0xb7}, {value: 0x8105, lo: 0xb9, hi: 0xba}, // Block 0x29, offset 0x113 {value: 0x0000, lo: 0x01}, {value: 0x812e, lo: 0x8d, hi: 0x8d}, // Block 0x2a, offset 0x115 {value: 0x0000, lo: 0x01}, {value: 0x0402, lo: 0xbc, hi: 0xbc}, // Block 0x2b, offset 0x117 {value: 0x0000, lo: 0x01}, {value: 0xa000, lo: 0x80, hi: 0x92}, // Block 0x2c, offset 0x119 {value: 0x0000, lo: 0x01}, {value: 0xb900, lo: 0xa1, hi: 0xb5}, // Block 0x2d, offset 0x11b {value: 0x0000, lo: 0x01}, {value: 0x9900, lo: 0xa8, hi: 0xbf}, // Block 0x2e, offset 0x11d {value: 0x0000, lo: 0x01}, {value: 0x9900, lo: 0x80, hi: 0x82}, // Block 0x2f, offset 0x11f {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0x9d, hi: 0x9f}, // Block 0x30, offset 0x121 {value: 0x0000, lo: 0x02}, {value: 0x8105, lo: 0x94, hi: 0x95}, {value: 0x8105, lo: 0xb4, hi: 0xb4}, // Block 0x31, offset 0x124 {value: 0x0000, lo: 0x02}, {value: 0x8105, lo: 0x92, hi: 0x92}, {value: 0x8133, lo: 0x9d, hi: 0x9d}, // Block 0x32, offset 0x127 {value: 0x0000, lo: 0x01}, {value: 0x8132, lo: 0xa9, hi: 0xa9}, // Block 0x33, offset 0x129 {value: 0x0004, lo: 0x02}, {value: 0x812f, lo: 0xb9, hi: 0xba}, {value: 0x812e, lo: 0xbb, hi: 0xbb}, // Block 0x34, offset 0x12c {value: 0x0000, lo: 0x02}, {value: 0x8133, lo: 0x97, hi: 0x97}, {value: 0x812e, lo: 0x98, hi: 0x98}, // Block 0x35, offset 0x12f {value: 0x0000, lo: 0x03}, {value: 0x8105, lo: 0xa0, hi: 0xa0}, {value: 0x8133, lo: 0xb5, hi: 0xbc}, {value: 0x812e, lo: 0xbf, hi: 0xbf}, // Block 0x36, offset 0x133 {value: 0x0000, lo: 0x05}, {value: 0x8133, lo: 0xb0, hi: 0xb4}, {value: 0x812e, lo: 0xb5, hi: 0xba}, {value: 0x8133, lo: 0xbb, hi: 0xbc}, {value: 0x812e, lo: 0xbd, hi: 0xbd}, {value: 0x812e, lo: 0xbf, hi: 0xbf}, // Block 0x37, offset 0x139 {value: 0x0000, lo: 0x06}, {value: 0x812e, lo: 0x80, hi: 0x80}, {value: 0x8133, lo: 0x81, hi: 0x82}, {value: 0x812e, lo: 0x83, hi: 0x84}, {value: 0x8133, lo: 0x85, hi: 0x89}, {value: 0x812e, lo: 0x8a, hi: 0x8a}, {value: 0x8133, lo: 0x8b, hi: 0x8e}, // Block 0x38, offset 0x140 {value: 0x0000, lo: 0x08}, {value: 0x3f27, lo: 0x80, hi: 0x80}, {value: 0x3f2f, lo: 0x81, hi: 0x81}, {value: 0xa000, lo: 0x82, hi: 0x82}, {value: 0x3f37, lo: 0x83, hi: 0x83}, {value: 0x8105, lo: 0x84, hi: 0x84}, {value: 0x8133, lo: 0xab, hi: 0xab}, {value: 0x812e, lo: 0xac, hi: 0xac}, {value: 0x8133, lo: 0xad, hi: 0xb3}, // Block 0x39, offset 0x149 {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0xaa, hi: 0xab}, // Block 0x3a, offset 0x14b {value: 0x0000, lo: 0x02}, {value: 0x8103, lo: 0xa6, hi: 0xa6}, {value: 0x8105, lo: 0xb2, hi: 0xb3}, // Block 0x3b, offset 0x14e {value: 0x0000, lo: 0x01}, {value: 0x8103, lo: 0xb7, hi: 0xb7}, // Block 0x3c, offset 0x150 {value: 0x0000, lo: 0x0a}, {value: 0x8133, lo: 0x90, hi: 0x92}, {value: 0x8101, lo: 0x94, hi: 0x94}, {value: 0x812e, lo: 0x95, hi: 0x99}, {value: 0x8133, lo: 0x9a, hi: 0x9b}, {value: 0x812e, lo: 0x9c, hi: 0x9f}, {value: 0x8133, lo: 0xa0, hi: 0xa0}, {value: 0x8101, lo: 0xa2, hi: 0xa8}, {value: 0x812e, lo: 0xad, hi: 0xad}, {value: 0x8133, lo: 0xb4, hi: 0xb4}, {value: 0x8133, lo: 0xb8, hi: 0xb9}, // Block 0x3d, offset 0x15b {value: 0x0002, lo: 0x0a}, {value: 0x0043, lo: 0xac, hi: 0xac}, {value: 0x00d1, lo: 0xad, hi: 0xad}, {value: 0x0045, lo: 0xae, hi: 0xae}, {value: 0x0049, lo: 0xb0, hi: 0xb1}, {value: 0x00ec, lo: 0xb2, hi: 0xb2}, {value: 0x004f, lo: 0xb3, hi: 0xba}, {value: 0x005f, lo: 0xbc, hi: 0xbc}, {value: 0x00fe, lo: 0xbd, hi: 0xbd}, {value: 0x0061, lo: 0xbe, hi: 0xbe}, {value: 0x0065, lo: 0xbf, hi: 0xbf}, // Block 0x3e, offset 0x166 {value: 0x0000, lo: 0x0d}, {value: 0x0001, lo: 0x80, hi: 0x8a}, {value: 0x0532, lo: 0x91, hi: 0x91}, {value: 0x4354, lo: 0x97, hi: 0x97}, {value: 0x001d, lo: 0xa4, hi: 0xa4}, {value: 0x19a0, lo: 0xa5, hi: 0xa5}, {value: 0x1c8c, lo: 0xa6, hi: 0xa6}, {value: 0x0001, lo: 0xaf, hi: 0xaf}, {value: 0x27c1, lo: 0xb3, hi: 0xb3}, {value: 0x2935, lo: 0xb4, hi: 0xb4}, {value: 0x27c8, lo: 0xb6, hi: 0xb6}, {value: 0x293f, lo: 0xb7, hi: 0xb7}, {value: 0x199a, lo: 0xbc, hi: 0xbc}, {value: 0x4322, lo: 0xbe, hi: 0xbe}, // Block 0x3f, offset 0x174 {value: 0x0002, lo: 0x0d}, {value: 0x1a60, lo: 0x87, hi: 0x87}, {value: 0x1a5d, lo: 0x88, hi: 0x88}, {value: 0x199d, lo: 0x89, hi: 0x89}, {value: 0x2ac5, lo: 0x97, hi: 0x97}, {value: 0x0001, lo: 0x9f, hi: 0x9f}, {value: 0x0021, lo: 0xb0, hi: 0xb0}, {value: 0x0093, lo: 0xb1, hi: 0xb1}, {value: 0x0029, lo: 0xb4, hi: 0xb9}, {value: 0x0017, lo: 0xba, hi: 0xba}, {value: 0x055e, lo: 0xbb, hi: 0xbb}, {value: 0x003b, lo: 0xbc, hi: 0xbc}, {value: 0x0011, lo: 0xbd, hi: 0xbe}, {value: 0x009d, lo: 0xbf, hi: 0xbf}, // Block 0x40, offset 0x182 {value: 0x0002, lo: 0x0f}, {value: 0x0021, lo: 0x80, hi: 0x89}, {value: 0x0017, lo: 0x8a, hi: 0x8a}, {value: 0x055e, lo: 0x8b, hi: 0x8b}, {value: 0x003b, lo: 0x8c, hi: 0x8c}, {value: 0x0011, lo: 0x8d, hi: 0x8e}, {value: 0x0083, lo: 0x90, hi: 0x90}, {value: 0x008b, lo: 0x91, hi: 0x91}, {value: 0x009f, lo: 0x92, hi: 0x92}, {value: 0x00b1, lo: 0x93, hi: 0x93}, {value: 0x011f, lo: 0x94, hi: 0x94}, {value: 0x0091, lo: 0x95, hi: 0x95}, {value: 0x0097, lo: 0x96, hi: 0x99}, {value: 0x00a1, lo: 0x9a, hi: 0x9a}, {value: 0x00a7, lo: 0x9b, hi: 0x9c}, {value: 0x1ac9, lo: 0xa8, hi: 0xa8}, // Block 0x41, offset 0x192 {value: 0x0000, lo: 0x0d}, {value: 0x8133, lo: 0x90, hi: 0x91}, {value: 0x8101, lo: 0x92, hi: 0x93}, {value: 0x8133, lo: 0x94, hi: 0x97}, {value: 0x8101, lo: 0x98, hi: 0x9a}, {value: 0x8133, lo: 0x9b, hi: 0x9c}, {value: 0x8133, lo: 0xa1, hi: 0xa1}, {value: 0x8101, lo: 0xa5, hi: 0xa6}, {value: 0x8133, lo: 0xa7, hi: 0xa7}, {value: 0x812e, lo: 0xa8, hi: 0xa8}, {value: 0x8133, lo: 0xa9, hi: 0xa9}, {value: 0x8101, lo: 0xaa, hi: 0xab}, {value: 0x812e, lo: 0xac, hi: 0xaf}, {value: 0x8133, lo: 0xb0, hi: 0xb0}, // Block 0x42, offset 0x1a0 {value: 0x0007, lo: 0x06}, {value: 0x22b0, lo: 0x89, hi: 0x89}, {value: 0xa000, lo: 0x90, hi: 0x90}, {value: 0xa000, lo: 0x92, hi: 0x92}, {value: 0xa000, lo: 0x94, hi: 0x94}, {value: 0x3b18, lo: 0x9a, hi: 0x9b}, {value: 0x3b26, lo: 0xae, hi: 0xae}, // Block 0x43, offset 0x1a7 {value: 0x000e, lo: 0x05}, {value: 0x3b2d, lo: 0x8d, hi: 0x8e}, {value: 0x3b34, lo: 0x8f, hi: 0x8f}, {value: 0xa000, lo: 0x90, hi: 0x90}, {value: 0xa000, lo: 0x92, hi: 0x92}, {value: 0xa000, lo: 0x94, hi: 0x94}, // Block 0x44, offset 0x1ad {value: 0x017a, lo: 0x0e}, {value: 0xa000, lo: 0x83, hi: 0x83}, {value: 0x3b42, lo: 0x84, hi: 0x84}, {value: 0xa000, lo: 0x88, hi: 0x88}, {value: 0x3b49, lo: 0x89, hi: 0x89}, {value: 0xa000, lo: 0x8b, hi: 0x8b}, {value: 0x3b50, lo: 0x8c, hi: 0x8c}, {value: 0xa000, lo: 0xa3, hi: 0xa3}, {value: 0x3b57, lo: 0xa4, hi: 0xa4}, {value: 0xa000, lo: 0xa5, hi: 0xa5}, {value: 0x3b5e, lo: 0xa6, hi: 0xa6}, {value: 0x27cf, lo: 0xac, hi: 0xad}, {value: 0x27d6, lo: 0xaf, hi: 0xaf}, {value: 0x2953, lo: 0xb0, hi: 0xb0}, {value: 0xa000, lo: 0xbc, hi: 0xbc}, // Block 0x45, offset 0x1bc {value: 0x0007, lo: 0x03}, {value: 0x3bc7, lo: 0xa0, hi: 0xa1}, {value: 0x3bf1, lo: 0xa2, hi: 0xa3}, {value: 0x3c1b, lo: 0xaa, hi: 0xad}, // Block 0x46, offset 0x1c0 {value: 0x0004, lo: 0x01}, {value: 0x0586, lo: 0xa9, hi: 0xaa}, // Block 0x47, offset 0x1c2 {value: 0x0002, lo: 0x03}, {value: 0x0057, lo: 0x80, hi: 0x8f}, {value: 0x0083, lo: 0x90, hi: 0xa9}, {value: 0x0021, lo: 0xaa, hi: 0xaa}, // Block 0x48, offset 0x1c6 {value: 0x0000, lo: 0x01}, {value: 0x2ad2, lo: 0x8c, hi: 0x8c}, // Block 0x49, offset 0x1c8 {value: 0x0266, lo: 0x02}, {value: 0x1cbc, lo: 0xb4, hi: 0xb4}, {value: 0x1a5a, lo: 0xb5, hi: 0xb6}, // Block 0x4a, offset 0x1cb {value: 0x0000, lo: 0x01}, {value: 0x4596, lo: 0x9c, hi: 0x9c}, // Block 0x4b, offset 0x1cd {value: 0x0000, lo: 0x02}, {value: 0x0095, lo: 0xbc, hi: 0xbc}, {value: 0x006d, lo: 0xbd, hi: 0xbd}, // Block 0x4c, offset 0x1d0 {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0xaf, hi: 0xb1}, // Block 0x4d, offset 0x1d2 {value: 0x0000, lo: 0x02}, {value: 0x057a, lo: 0xaf, hi: 0xaf}, {value: 0x8105, lo: 0xbf, hi: 0xbf}, // Block 0x4e, offset 0x1d5 {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0xa0, hi: 0xbf}, // Block 0x4f, offset 0x1d7 {value: 0x0000, lo: 0x01}, {value: 0x0ebe, lo: 0x9f, hi: 0x9f}, // Block 0x50, offset 0x1d9 {value: 0x0000, lo: 0x01}, {value: 0x172a, lo: 0xb3, hi: 0xb3}, // Block 0x51, offset 0x1db {value: 0x0004, lo: 0x0b}, {value: 0x1692, lo: 0x80, hi: 0x82}, {value: 0x16aa, lo: 0x83, hi: 0x83}, {value: 0x16c2, lo: 0x84, hi: 0x85}, {value: 0x16d2, lo: 0x86, hi: 0x89}, {value: 0x16e6, lo: 0x8a, hi: 0x8c}, {value: 0x16fa, lo: 0x8d, hi: 0x8d}, {value: 0x1702, lo: 0x8e, hi: 0x8e}, {value: 0x170a, lo: 0x8f, hi: 0x90}, {value: 0x1716, lo: 0x91, hi: 0x93}, {value: 0x1726, lo: 0x94, hi: 0x94}, {value: 0x172e, lo: 0x95, hi: 0x95}, // Block 0x52, offset 0x1e7 {value: 0x0004, lo: 0x09}, {value: 0x0001, lo: 0x80, hi: 0x80}, {value: 0x812d, lo: 0xaa, hi: 0xaa}, {value: 0x8132, lo: 0xab, hi: 0xab}, {value: 0x8134, lo: 0xac, hi: 0xac}, {value: 0x812f, lo: 0xad, hi: 0xad}, {value: 0x8130, lo: 0xae, hi: 0xae}, {value: 0x8130, lo: 0xaf, hi: 0xaf}, {value: 0x05ae, lo: 0xb6, hi: 0xb6}, {value: 0x0982, lo: 0xb8, hi: 0xba}, // Block 0x53, offset 0x1f1 {value: 0x0006, lo: 0x09}, {value: 0x0406, lo: 0xb1, hi: 0xb1}, {value: 0x040a, lo: 0xb2, hi: 0xb2}, {value: 0x4b7c, lo: 0xb3, hi: 0xb3}, {value: 0x040e, lo: 0xb4, hi: 0xb4}, {value: 0x4b82, lo: 0xb5, hi: 0xb6}, {value: 0x0412, lo: 0xb7, hi: 0xb7}, {value: 0x0416, lo: 0xb8, hi: 0xb8}, {value: 0x041a, lo: 0xb9, hi: 0xb9}, {value: 0x4b8e, lo: 0xba, hi: 0xbf}, // Block 0x54, offset 0x1fb {value: 0x0000, lo: 0x02}, {value: 0x8133, lo: 0xaf, hi: 0xaf}, {value: 0x8133, lo: 0xb4, hi: 0xbd}, // Block 0x55, offset 0x1fe {value: 0x0000, lo: 0x03}, {value: 0x02d8, lo: 0x9c, hi: 0x9c}, {value: 0x02de, lo: 0x9d, hi: 0x9d}, {value: 0x8133, lo: 0x9e, hi: 0x9f}, // Block 0x56, offset 0x202 {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0xb0, hi: 0xb1}, // Block 0x57, offset 0x204 {value: 0x0000, lo: 0x01}, {value: 0x173e, lo: 0xb0, hi: 0xb0}, // Block 0x58, offset 0x206 {value: 0x0006, lo: 0x04}, {value: 0x0047, lo: 0xb2, hi: 0xb3}, {value: 0x0063, lo: 0xb4, hi: 0xb4}, {value: 0x00dd, lo: 0xb8, hi: 0xb8}, {value: 0x00e9, lo: 0xb9, hi: 0xb9}, // Block 0x59, offset 0x20b {value: 0x0000, lo: 0x02}, {value: 0x8105, lo: 0x86, hi: 0x86}, {value: 0x8105, lo: 0xac, hi: 0xac}, // Block 0x5a, offset 0x20e {value: 0x0000, lo: 0x02}, {value: 0x8105, lo: 0x84, hi: 0x84}, {value: 0x8133, lo: 0xa0, hi: 0xb1}, // Block 0x5b, offset 0x211 {value: 0x0000, lo: 0x01}, {value: 0x812e, lo: 0xab, hi: 0xad}, // Block 0x5c, offset 0x213 {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0x93, hi: 0x93}, // Block 0x5d, offset 0x215 {value: 0x0000, lo: 0x01}, {value: 0x8103, lo: 0xb3, hi: 0xb3}, // Block 0x5e, offset 0x217 {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0x80, hi: 0x80}, // Block 0x5f, offset 0x219 {value: 0x0000, lo: 0x05}, {value: 0x8133, lo: 0xb0, hi: 0xb0}, {value: 0x8133, lo: 0xb2, hi: 0xb3}, {value: 0x812e, lo: 0xb4, hi: 0xb4}, {value: 0x8133, lo: 0xb7, hi: 0xb8}, {value: 0x8133, lo: 0xbe, hi: 0xbf}, // Block 0x60, offset 0x21f {value: 0x0000, lo: 0x02}, {value: 0x8133, lo: 0x81, hi: 0x81}, {value: 0x8105, lo: 0xb6, hi: 0xb6}, // Block 0x61, offset 0x222 {value: 0x000c, lo: 0x04}, {value: 0x173a, lo: 0x9c, hi: 0x9d}, {value: 0x014f, lo: 0x9e, hi: 0x9e}, {value: 0x174a, lo: 0x9f, hi: 0x9f}, {value: 0x01a6, lo: 0xa9, hi: 0xa9}, // Block 0x62, offset 0x227 {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0xad, hi: 0xad}, // Block 0x63, offset 0x229 {value: 0x0000, lo: 0x06}, {value: 0xe500, lo: 0x80, hi: 0x80}, {value: 0xc600, lo: 0x81, hi: 0x9b}, {value: 0xe500, lo: 0x9c, hi: 0x9c}, {value: 0xc600, lo: 0x9d, hi: 0xb7}, {value: 0xe500, lo: 0xb8, hi: 0xb8}, {value: 0xc600, lo: 0xb9, hi: 0xbf}, // Block 0x64, offset 0x230 {value: 0x0000, lo: 0x05}, {value: 0xc600, lo: 0x80, hi: 0x93}, {value: 0xe500, lo: 0x94, hi: 0x94}, {value: 0xc600, lo: 0x95, hi: 0xaf}, {value: 0xe500, lo: 0xb0, hi: 0xb0}, {value: 0xc600, lo: 0xb1, hi: 0xbf}, // Block 0x65, offset 0x236 {value: 0x0000, lo: 0x05}, {value: 0xc600, lo: 0x80, hi: 0x8b}, {value: 0xe500, lo: 0x8c, hi: 0x8c}, {value: 0xc600, lo: 0x8d, hi: 0xa7}, {value: 0xe500, lo: 0xa8, hi: 0xa8}, {value: 0xc600, lo: 0xa9, hi: 0xbf}, // Block 0x66, offset 0x23c {value: 0x0000, lo: 0x07}, {value: 0xc600, lo: 0x80, hi: 0x83}, {value: 0xe500, lo: 0x84, hi: 0x84}, {value: 0xc600, lo: 0x85, hi: 0x9f}, {value: 0xe500, lo: 0xa0, hi: 0xa0}, {value: 0xc600, lo: 0xa1, hi: 0xbb}, {value: 0xe500, lo: 0xbc, hi: 0xbc}, {value: 0xc600, lo: 0xbd, hi: 0xbf}, // Block 0x67, offset 0x244 {value: 0x0000, lo: 0x05}, {value: 0xc600, lo: 0x80, hi: 0x97}, {value: 0xe500, lo: 0x98, hi: 0x98}, {value: 0xc600, lo: 0x99, hi: 0xb3}, {value: 0xe500, lo: 0xb4, hi: 0xb4}, {value: 0xc600, lo: 0xb5, hi: 0xbf}, // Block 0x68, offset 0x24a {value: 0x0000, lo: 0x05}, {value: 0xc600, lo: 0x80, hi: 0x8f}, {value: 0xe500, lo: 0x90, hi: 0x90}, {value: 0xc600, lo: 0x91, hi: 0xab}, {value: 0xe500, lo: 0xac, hi: 0xac}, {value: 0xc600, lo: 0xad, hi: 0xbf}, // Block 0x69, offset 0x250 {value: 0x0000, lo: 0x05}, {value: 0xc600, lo: 0x80, hi: 0x87}, {value: 0xe500, lo: 0x88, hi: 0x88}, {value: 0xc600, lo: 0x89, hi: 0xa3}, {value: 0xe500, lo: 0xa4, hi: 0xa4}, {value: 0xc600, lo: 0xa5, hi: 0xbf}, // Block 0x6a, offset 0x256 {value: 0x0000, lo: 0x03}, {value: 0xc600, lo: 0x80, hi: 0x87}, {value: 0xe500, lo: 0x88, hi: 0x88}, {value: 0xc600, lo: 0x89, hi: 0xa3}, // Block 0x6b, offset 0x25a {value: 0x0002, lo: 0x01}, {value: 0x0003, lo: 0x81, hi: 0xbf}, // Block 0x6c, offset 0x25c {value: 0x0000, lo: 0x01}, {value: 0x812e, lo: 0xbd, hi: 0xbd}, // Block 0x6d, offset 0x25e {value: 0x0000, lo: 0x01}, {value: 0x812e, lo: 0xa0, hi: 0xa0}, // Block 0x6e, offset 0x260 {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0xb6, hi: 0xba}, // Block 0x6f, offset 0x262 {value: 0x002d, lo: 0x05}, {value: 0x812e, lo: 0x8d, hi: 0x8d}, {value: 0x8133, lo: 0x8f, hi: 0x8f}, {value: 0x8133, lo: 0xb8, hi: 0xb8}, {value: 0x8101, lo: 0xb9, hi: 0xba}, {value: 0x8105, lo: 0xbf, hi: 0xbf}, // Block 0x70, offset 0x268 {value: 0x0000, lo: 0x02}, {value: 0x8133, lo: 0xa5, hi: 0xa5}, {value: 0x812e, lo: 0xa6, hi: 0xa6}, // Block 0x71, offset 0x26b {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0xa4, hi: 0xa7}, // Block 0x72, offset 0x26d {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0xab, hi: 0xac}, // Block 0x73, offset 0x26f {value: 0x0000, lo: 0x01}, {value: 0x812e, lo: 0xbd, hi: 0xbf}, // Block 0x74, offset 0x271 {value: 0x0000, lo: 0x05}, {value: 0x812e, lo: 0x86, hi: 0x87}, {value: 0x8133, lo: 0x88, hi: 0x8a}, {value: 0x812e, lo: 0x8b, hi: 0x8b}, {value: 0x8133, lo: 0x8c, hi: 0x8c}, {value: 0x812e, lo: 0x8d, hi: 0x90}, // Block 0x75, offset 0x277 {value: 0x0005, lo: 0x03}, {value: 0x8133, lo: 0x82, hi: 0x82}, {value: 0x812e, lo: 0x83, hi: 0x84}, {value: 0x812e, lo: 0x85, hi: 0x85}, // Block 0x76, offset 0x27b {value: 0x0000, lo: 0x03}, {value: 0x8105, lo: 0x86, hi: 0x86}, {value: 0x8105, lo: 0xb0, hi: 0xb0}, {value: 0x8105, lo: 0xbf, hi: 0xbf}, // Block 0x77, offset 0x27f {value: 0x17fe, lo: 0x07}, {value: 0xa000, lo: 0x99, hi: 0x99}, {value: 0x4277, lo: 0x9a, hi: 0x9a}, {value: 0xa000, lo: 0x9b, hi: 0x9b}, {value: 0x4281, lo: 0x9c, hi: 0x9c}, {value: 0xa000, lo: 0xa5, hi: 0xa5}, {value: 0x428b, lo: 0xab, hi: 0xab}, {value: 0x8105, lo: 0xb9, hi: 0xba}, // Block 0x78, offset 0x287 {value: 0x0000, lo: 0x06}, {value: 0x8133, lo: 0x80, hi: 0x82}, {value: 0x9900, lo: 0xa7, hi: 0xa7}, {value: 0x4295, lo: 0xae, hi: 0xae}, {value: 0x429f, lo: 0xaf, hi: 0xaf}, {value: 0xa000, lo: 0xb1, hi: 0xb2}, {value: 0x8105, lo: 0xb3, hi: 0xb4}, // Block 0x79, offset 0x28e {value: 0x0000, lo: 0x02}, {value: 0x8105, lo: 0x80, hi: 0x80}, {value: 0x8103, lo: 0x8a, hi: 0x8a}, // Block 0x7a, offset 0x291 {value: 0x0000, lo: 0x02}, {value: 0x8105, lo: 0xb5, hi: 0xb5}, {value: 0x8103, lo: 0xb6, hi: 0xb6}, // Block 0x7b, offset 0x294 {value: 0x0002, lo: 0x01}, {value: 0x8103, lo: 0xa9, hi: 0xaa}, // Block 0x7c, offset 0x296 {value: 0x0000, lo: 0x02}, {value: 0x8103, lo: 0xbb, hi: 0xbc}, {value: 0x9900, lo: 0xbe, hi: 0xbe}, // Block 0x7d, offset 0x299 {value: 0x0000, lo: 0x07}, {value: 0xa000, lo: 0x87, hi: 0x87}, {value: 0x42a9, lo: 0x8b, hi: 0x8b}, {value: 0x42b3, lo: 0x8c, hi: 0x8c}, {value: 0x8105, lo: 0x8d, hi: 0x8d}, {value: 0x9900, lo: 0x97, hi: 0x97}, {value: 0x8133, lo: 0xa6, hi: 0xac}, {value: 0x8133, lo: 0xb0, hi: 0xb4}, // Block 0x7e, offset 0x2a1 {value: 0x0000, lo: 0x03}, {value: 0x8105, lo: 0x82, hi: 0x82}, {value: 0x8103, lo: 0x86, hi: 0x86}, {value: 0x8133, lo: 0x9e, hi: 0x9e}, // Block 0x7f, offset 0x2a5 {value: 0x5643, lo: 0x06}, {value: 0x9900, lo: 0xb0, hi: 0xb0}, {value: 0xa000, lo: 0xb9, hi: 0xb9}, {value: 0x9900, lo: 0xba, hi: 0xba}, {value: 0x42c7, lo: 0xbb, hi: 0xbb}, {value: 0x42bd, lo: 0xbc, hi: 0xbd}, {value: 0x42d1, lo: 0xbe, hi: 0xbe}, // Block 0x80, offset 0x2ac {value: 0x0000, lo: 0x02}, {value: 0x8105, lo: 0x82, hi: 0x82}, {value: 0x8103, lo: 0x83, hi: 0x83}, // Block 0x81, offset 0x2af {value: 0x0000, lo: 0x05}, {value: 0x9900, lo: 0xaf, hi: 0xaf}, {value: 0xa000, lo: 0xb8, hi: 0xb9}, {value: 0x42db, lo: 0xba, hi: 0xba}, {value: 0x42e5, lo: 0xbb, hi: 0xbb}, {value: 0x8105, lo: 0xbf, hi: 0xbf}, // Block 0x82, offset 0x2b5 {value: 0x0000, lo: 0x01}, {value: 0x8103, lo: 0x80, hi: 0x80}, // Block 0x83, offset 0x2b7 {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0xbf, hi: 0xbf}, // Block 0x84, offset 0x2b9 {value: 0x0000, lo: 0x02}, {value: 0x8105, lo: 0xb6, hi: 0xb6}, {value: 0x8103, lo: 0xb7, hi: 0xb7}, // Block 0x85, offset 0x2bc {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0xab, hi: 0xab}, // Block 0x86, offset 0x2be {value: 0x0000, lo: 0x02}, {value: 0x8105, lo: 0xb9, hi: 0xb9}, {value: 0x8103, lo: 0xba, hi: 0xba}, // Block 0x87, offset 0x2c1 {value: 0x0000, lo: 0x04}, {value: 0x9900, lo: 0xb0, hi: 0xb0}, {value: 0xa000, lo: 0xb5, hi: 0xb5}, {value: 0x42ef, lo: 0xb8, hi: 0xb8}, {value: 0x8105, lo: 0xbd, hi: 0xbe}, // Block 0x88, offset 0x2c6 {value: 0x0000, lo: 0x01}, {value: 0x8103, lo: 0x83, hi: 0x83}, // Block 0x89, offset 0x2c8 {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0xa0, hi: 0xa0}, // Block 0x8a, offset 0x2ca {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0xb4, hi: 0xb4}, // Block 0x8b, offset 0x2cc {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0x87, hi: 0x87}, // Block 0x8c, offset 0x2ce {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0x99, hi: 0x99}, // Block 0x8d, offset 0x2d0 {value: 0x0000, lo: 0x02}, {value: 0x8103, lo: 0x82, hi: 0x82}, {value: 0x8105, lo: 0x84, hi: 0x85}, // Block 0x8e, offset 0x2d3 {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0x97, hi: 0x97}, // Block 0x8f, offset 0x2d5 {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0x81, hi: 0x82}, // Block 0x90, offset 0x2d7 {value: 0x0000, lo: 0x01}, {value: 0x8101, lo: 0xb0, hi: 0xb4}, // Block 0x91, offset 0x2d9 {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0xb0, hi: 0xb6}, // Block 0x92, offset 0x2db {value: 0x0000, lo: 0x01}, {value: 0x8102, lo: 0xb0, hi: 0xb1}, // Block 0x93, offset 0x2dd {value: 0x0000, lo: 0x01}, {value: 0x8101, lo: 0x9e, hi: 0x9e}, // Block 0x94, offset 0x2df {value: 0x0000, lo: 0x0c}, {value: 0x46fd, lo: 0x9e, hi: 0x9e}, {value: 0x4707, lo: 0x9f, hi: 0x9f}, {value: 0x473b, lo: 0xa0, hi: 0xa0}, {value: 0x4749, lo: 0xa1, hi: 0xa1}, {value: 0x4757, lo: 0xa2, hi: 0xa2}, {value: 0x4765, lo: 0xa3, hi: 0xa3}, {value: 0x4773, lo: 0xa4, hi: 0xa4}, {value: 0x812c, lo: 0xa5, hi: 0xa6}, {value: 0x8101, lo: 0xa7, hi: 0xa9}, {value: 0x8131, lo: 0xad, hi: 0xad}, {value: 0x812c, lo: 0xae, hi: 0xb2}, {value: 0x812e, lo: 0xbb, hi: 0xbf}, // Block 0x95, offset 0x2ec {value: 0x0000, lo: 0x09}, {value: 0x812e, lo: 0x80, hi: 0x82}, {value: 0x8133, lo: 0x85, hi: 0x89}, {value: 0x812e, lo: 0x8a, hi: 0x8b}, {value: 0x8133, lo: 0xaa, hi: 0xad}, {value: 0x4711, lo: 0xbb, hi: 0xbb}, {value: 0x471b, lo: 0xbc, hi: 0xbc}, {value: 0x4781, lo: 0xbd, hi: 0xbd}, {value: 0x479d, lo: 0xbe, hi: 0xbe}, {value: 0x478f, lo: 0xbf, hi: 0xbf}, // Block 0x96, offset 0x2f6 {value: 0x0000, lo: 0x01}, {value: 0x47ab, lo: 0x80, hi: 0x80}, // Block 0x97, offset 0x2f8 {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0x82, hi: 0x84}, // Block 0x98, offset 0x2fa {value: 0x0002, lo: 0x03}, {value: 0x0043, lo: 0x80, hi: 0x99}, {value: 0x0083, lo: 0x9a, hi: 0xb3}, {value: 0x0043, lo: 0xb4, hi: 0xbf}, // Block 0x99, offset 0x2fe {value: 0x0002, lo: 0x04}, {value: 0x005b, lo: 0x80, hi: 0x8d}, {value: 0x0083, lo: 0x8e, hi: 0x94}, {value: 0x0093, lo: 0x96, hi: 0xa7}, {value: 0x0043, lo: 0xa8, hi: 0xbf}, // Block 0x9a, offset 0x303 {value: 0x0002, lo: 0x0b}, {value: 0x0073, lo: 0x80, hi: 0x81}, {value: 0x0083, lo: 0x82, hi: 0x9b}, {value: 0x0043, lo: 0x9c, hi: 0x9c}, {value: 0x0047, lo: 0x9e, hi: 0x9f}, {value: 0x004f, lo: 0xa2, hi: 0xa2}, {value: 0x0055, lo: 0xa5, hi: 0xa6}, {value: 0x005d, lo: 0xa9, hi: 0xac}, {value: 0x0067, lo: 0xae, hi: 0xb5}, {value: 0x0083, lo: 0xb6, hi: 0xb9}, {value: 0x008d, lo: 0xbb, hi: 0xbb}, {value: 0x0091, lo: 0xbd, hi: 0xbf}, // Block 0x9b, offset 0x30f {value: 0x0002, lo: 0x04}, {value: 0x0097, lo: 0x80, hi: 0x83}, {value: 0x00a1, lo: 0x85, hi: 0x8f}, {value: 0x0043, lo: 0x90, hi: 0xa9}, {value: 0x0083, lo: 0xaa, hi: 0xbf}, // Block 0x9c, offset 0x314 {value: 0x0002, lo: 0x08}, {value: 0x00af, lo: 0x80, hi: 0x83}, {value: 0x0043, lo: 0x84, hi: 0x85}, {value: 0x0049, lo: 0x87, hi: 0x8a}, {value: 0x0055, lo: 0x8d, hi: 0x94}, {value: 0x0067, lo: 0x96, hi: 0x9c}, {value: 0x0083, lo: 0x9e, hi: 0xb7}, {value: 0x0043, lo: 0xb8, hi: 0xb9}, {value: 0x0049, lo: 0xbb, hi: 0xbe}, // Block 0x9d, offset 0x31d {value: 0x0002, lo: 0x05}, {value: 0x0053, lo: 0x80, hi: 0x84}, {value: 0x005f, lo: 0x86, hi: 0x86}, {value: 0x0067, lo: 0x8a, hi: 0x90}, {value: 0x0083, lo: 0x92, hi: 0xab}, {value: 0x0043, lo: 0xac, hi: 0xbf}, // Block 0x9e, offset 0x323 {value: 0x0002, lo: 0x04}, {value: 0x006b, lo: 0x80, hi: 0x85}, {value: 0x0083, lo: 0x86, hi: 0x9f}, {value: 0x0043, lo: 0xa0, hi: 0xb9}, {value: 0x0083, lo: 0xba, hi: 0xbf}, // Block 0x9f, offset 0x328 {value: 0x0002, lo: 0x03}, {value: 0x008f, lo: 0x80, hi: 0x93}, {value: 0x0043, lo: 0x94, hi: 0xad}, {value: 0x0083, lo: 0xae, hi: 0xbf}, // Block 0xa0, offset 0x32c {value: 0x0002, lo: 0x04}, {value: 0x00a7, lo: 0x80, hi: 0x87}, {value: 0x0043, lo: 0x88, hi: 0xa1}, {value: 0x0083, lo: 0xa2, hi: 0xbb}, {value: 0x0043, lo: 0xbc, hi: 0xbf}, // Block 0xa1, offset 0x331 {value: 0x0002, lo: 0x03}, {value: 0x004b, lo: 0x80, hi: 0x95}, {value: 0x0083, lo: 0x96, hi: 0xaf}, {value: 0x0043, lo: 0xb0, hi: 0xbf}, // Block 0xa2, offset 0x335 {value: 0x0003, lo: 0x0f}, {value: 0x023c, lo: 0x80, hi: 0x80}, {value: 0x0556, lo: 0x81, hi: 0x81}, {value: 0x023f, lo: 0x82, hi: 0x9a}, {value: 0x0552, lo: 0x9b, hi: 0x9b}, {value: 0x024b, lo: 0x9c, hi: 0x9c}, {value: 0x0254, lo: 0x9d, hi: 0x9d}, {value: 0x025a, lo: 0x9e, hi: 0x9e}, {value: 0x027e, lo: 0x9f, hi: 0x9f}, {value: 0x026f, lo: 0xa0, hi: 0xa0}, {value: 0x026c, lo: 0xa1, hi: 0xa1}, {value: 0x01f7, lo: 0xa2, hi: 0xb2}, {value: 0x020c, lo: 0xb3, hi: 0xb3}, {value: 0x022a, lo: 0xb4, hi: 0xba}, {value: 0x0556, lo: 0xbb, hi: 0xbb}, {value: 0x023f, lo: 0xbc, hi: 0xbf}, // Block 0xa3, offset 0x345 {value: 0x0003, lo: 0x0d}, {value: 0x024b, lo: 0x80, hi: 0x94}, {value: 0x0552, lo: 0x95, hi: 0x95}, {value: 0x024b, lo: 0x96, hi: 0x96}, {value: 0x0254, lo: 0x97, hi: 0x97}, {value: 0x025a, lo: 0x98, hi: 0x98}, {value: 0x027e, lo: 0x99, hi: 0x99}, {value: 0x026f, lo: 0x9a, hi: 0x9a}, {value: 0x026c, lo: 0x9b, hi: 0x9b}, {value: 0x01f7, lo: 0x9c, hi: 0xac}, {value: 0x020c, lo: 0xad, hi: 0xad}, {value: 0x022a, lo: 0xae, hi: 0xb4}, {value: 0x0556, lo: 0xb5, hi: 0xb5}, {value: 0x023f, lo: 0xb6, hi: 0xbf}, // Block 0xa4, offset 0x353 {value: 0x0003, lo: 0x0d}, {value: 0x025d, lo: 0x80, hi: 0x8e}, {value: 0x0552, lo: 0x8f, hi: 0x8f}, {value: 0x024b, lo: 0x90, hi: 0x90}, {value: 0x0254, lo: 0x91, hi: 0x91}, {value: 0x025a, lo: 0x92, hi: 0x92}, {value: 0x027e, lo: 0x93, hi: 0x93}, {value: 0x026f, lo: 0x94, hi: 0x94}, {value: 0x026c, lo: 0x95, hi: 0x95}, {value: 0x01f7, lo: 0x96, hi: 0xa6}, {value: 0x020c, lo: 0xa7, hi: 0xa7}, {value: 0x022a, lo: 0xa8, hi: 0xae}, {value: 0x0556, lo: 0xaf, hi: 0xaf}, {value: 0x023f, lo: 0xb0, hi: 0xbf}, // Block 0xa5, offset 0x361 {value: 0x0003, lo: 0x0d}, {value: 0x026f, lo: 0x80, hi: 0x88}, {value: 0x0552, lo: 0x89, hi: 0x89}, {value: 0x024b, lo: 0x8a, hi: 0x8a}, {value: 0x0254, lo: 0x8b, hi: 0x8b}, {value: 0x025a, lo: 0x8c, hi: 0x8c}, {value: 0x027e, lo: 0x8d, hi: 0x8d}, {value: 0x026f, lo: 0x8e, hi: 0x8e}, {value: 0x026c, lo: 0x8f, hi: 0x8f}, {value: 0x01f7, lo: 0x90, hi: 0xa0}, {value: 0x020c, lo: 0xa1, hi: 0xa1}, {value: 0x022a, lo: 0xa2, hi: 0xa8}, {value: 0x0556, lo: 0xa9, hi: 0xa9}, {value: 0x023f, lo: 0xaa, hi: 0xbf}, // Block 0xa6, offset 0x36f {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0x8f, hi: 0x8f}, // Block 0xa7, offset 0x371 {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0xae, hi: 0xae}, // Block 0xa8, offset 0x373 {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0xac, hi: 0xaf}, // Block 0xa9, offset 0x375 {value: 0x0000, lo: 0x03}, {value: 0x8134, lo: 0xac, hi: 0xad}, {value: 0x812e, lo: 0xae, hi: 0xae}, {value: 0x8133, lo: 0xaf, hi: 0xaf}, // Block 0xaa, offset 0x379 {value: 0x0000, lo: 0x01}, {value: 0x812e, lo: 0x90, hi: 0x96}, // Block 0xab, offset 0x37b {value: 0x0000, lo: 0x02}, {value: 0x8133, lo: 0x84, hi: 0x89}, {value: 0x8103, lo: 0x8a, hi: 0x8a}, // Block 0xac, offset 0x37e {value: 0x0002, lo: 0x0a}, {value: 0x0063, lo: 0x80, hi: 0x89}, {value: 0x1a7e, lo: 0x8a, hi: 0x8a}, {value: 0x1ab1, lo: 0x8b, hi: 0x8b}, {value: 0x1acc, lo: 0x8c, hi: 0x8c}, {value: 0x1ad2, lo: 0x8d, hi: 0x8d}, {value: 0x1cf0, lo: 0x8e, hi: 0x8e}, {value: 0x1ade, lo: 0x8f, hi: 0x8f}, {value: 0x1aa8, lo: 0xaa, hi: 0xaa}, {value: 0x1aab, lo: 0xab, hi: 0xab}, {value: 0x1aae, lo: 0xac, hi: 0xac}, // Block 0xad, offset 0x389 {value: 0x0000, lo: 0x01}, {value: 0x1a6c, lo: 0x90, hi: 0x90}, // Block 0xae, offset 0x38b {value: 0x0028, lo: 0x09}, {value: 0x2999, lo: 0x80, hi: 0x80}, {value: 0x295d, lo: 0x81, hi: 0x81}, {value: 0x2967, lo: 0x82, hi: 0x82}, {value: 0x297b, lo: 0x83, hi: 0x84}, {value: 0x2985, lo: 0x85, hi: 0x86}, {value: 0x2971, lo: 0x87, hi: 0x87}, {value: 0x298f, lo: 0x88, hi: 0x88}, {value: 0x0c6a, lo: 0x90, hi: 0x90}, {value: 0x09e2, lo: 0x91, hi: 0x91}, // Block 0xaf, offset 0x395 {value: 0x0002, lo: 0x01}, {value: 0x0021, lo: 0xb0, hi: 0xb9}, } // recompMap: 7528 bytes (entries only) var recompMap map[uint32]rune var recompMapOnce sync.Once const recompMapPacked = "" + "\x00A\x03\x00\x00\x00\x00\xc0" + // 0x00410300: 0x000000C0 "\x00A\x03\x01\x00\x00\x00\xc1" + // 0x00410301: 0x000000C1 "\x00A\x03\x02\x00\x00\x00\xc2" + // 0x00410302: 0x000000C2 "\x00A\x03\x03\x00\x00\x00\xc3" + // 0x00410303: 0x000000C3 "\x00A\x03\b\x00\x00\x00\xc4" + // 0x00410308: 0x000000C4 "\x00A\x03\n\x00\x00\x00\xc5" + // 0x0041030A: 0x000000C5 "\x00C\x03'\x00\x00\x00\xc7" + // 0x00430327: 0x000000C7 "\x00E\x03\x00\x00\x00\x00\xc8" + // 0x00450300: 0x000000C8 "\x00E\x03\x01\x00\x00\x00\xc9" + // 0x00450301: 0x000000C9 "\x00E\x03\x02\x00\x00\x00\xca" + // 0x00450302: 0x000000CA "\x00E\x03\b\x00\x00\x00\xcb" + // 0x00450308: 0x000000CB "\x00I\x03\x00\x00\x00\x00\xcc" + // 0x00490300: 0x000000CC "\x00I\x03\x01\x00\x00\x00\xcd" + // 0x00490301: 0x000000CD "\x00I\x03\x02\x00\x00\x00\xce" + // 0x00490302: 0x000000CE "\x00I\x03\b\x00\x00\x00\xcf" + // 0x00490308: 0x000000CF "\x00N\x03\x03\x00\x00\x00\xd1" + // 0x004E0303: 0x000000D1 "\x00O\x03\x00\x00\x00\x00\xd2" + // 0x004F0300: 0x000000D2 "\x00O\x03\x01\x00\x00\x00\xd3" + // 0x004F0301: 0x000000D3 "\x00O\x03\x02\x00\x00\x00\xd4" + // 0x004F0302: 0x000000D4 "\x00O\x03\x03\x00\x00\x00\xd5" + // 0x004F0303: 0x000000D5 "\x00O\x03\b\x00\x00\x00\xd6" + // 0x004F0308: 0x000000D6 "\x00U\x03\x00\x00\x00\x00\xd9" + // 0x00550300: 0x000000D9 "\x00U\x03\x01\x00\x00\x00\xda" + // 0x00550301: 0x000000DA "\x00U\x03\x02\x00\x00\x00\xdb" + // 0x00550302: 0x000000DB "\x00U\x03\b\x00\x00\x00\xdc" + // 0x00550308: 0x000000DC "\x00Y\x03\x01\x00\x00\x00\xdd" + // 0x00590301: 0x000000DD "\x00a\x03\x00\x00\x00\x00\xe0" + // 0x00610300: 0x000000E0 "\x00a\x03\x01\x00\x00\x00\xe1" + // 0x00610301: 0x000000E1 "\x00a\x03\x02\x00\x00\x00\xe2" + // 0x00610302: 0x000000E2 "\x00a\x03\x03\x00\x00\x00\xe3" + // 0x00610303: 0x000000E3 "\x00a\x03\b\x00\x00\x00\xe4" + // 0x00610308: 0x000000E4 "\x00a\x03\n\x00\x00\x00\xe5" + // 0x0061030A: 0x000000E5 "\x00c\x03'\x00\x00\x00\xe7" + // 0x00630327: 0x000000E7 "\x00e\x03\x00\x00\x00\x00\xe8" + // 0x00650300: 0x000000E8 "\x00e\x03\x01\x00\x00\x00\xe9" + // 0x00650301: 0x000000E9 "\x00e\x03\x02\x00\x00\x00\xea" + // 0x00650302: 0x000000EA "\x00e\x03\b\x00\x00\x00\xeb" + // 0x00650308: 0x000000EB "\x00i\x03\x00\x00\x00\x00\xec" + // 0x00690300: 0x000000EC "\x00i\x03\x01\x00\x00\x00\xed" + // 0x00690301: 0x000000ED "\x00i\x03\x02\x00\x00\x00\xee" + // 0x00690302: 0x000000EE "\x00i\x03\b\x00\x00\x00\xef" + // 0x00690308: 0x000000EF "\x00n\x03\x03\x00\x00\x00\xf1" + // 0x006E0303: 0x000000F1 "\x00o\x03\x00\x00\x00\x00\xf2" + // 0x006F0300: 0x000000F2 "\x00o\x03\x01\x00\x00\x00\xf3" + // 0x006F0301: 0x000000F3 "\x00o\x03\x02\x00\x00\x00\xf4" + // 0x006F0302: 0x000000F4 "\x00o\x03\x03\x00\x00\x00\xf5" + // 0x006F0303: 0x000000F5 "\x00o\x03\b\x00\x00\x00\xf6" + // 0x006F0308: 0x000000F6 "\x00u\x03\x00\x00\x00\x00\xf9" + // 0x00750300: 0x000000F9 "\x00u\x03\x01\x00\x00\x00\xfa" + // 0x00750301: 0x000000FA "\x00u\x03\x02\x00\x00\x00\xfb" + // 0x00750302: 0x000000FB "\x00u\x03\b\x00\x00\x00\xfc" + // 0x00750308: 0x000000FC "\x00y\x03\x01\x00\x00\x00\xfd" + // 0x00790301: 0x000000FD "\x00y\x03\b\x00\x00\x00\xff" + // 0x00790308: 0x000000FF "\x00A\x03\x04\x00\x00\x01\x00" + // 0x00410304: 0x00000100 "\x00a\x03\x04\x00\x00\x01\x01" + // 0x00610304: 0x00000101 "\x00A\x03\x06\x00\x00\x01\x02" + // 0x00410306: 0x00000102 "\x00a\x03\x06\x00\x00\x01\x03" + // 0x00610306: 0x00000103 "\x00A\x03(\x00\x00\x01\x04" + // 0x00410328: 0x00000104 "\x00a\x03(\x00\x00\x01\x05" + // 0x00610328: 0x00000105 "\x00C\x03\x01\x00\x00\x01\x06" + // 0x00430301: 0x00000106 "\x00c\x03\x01\x00\x00\x01\a" + // 0x00630301: 0x00000107 "\x00C\x03\x02\x00\x00\x01\b" + // 0x00430302: 0x00000108 "\x00c\x03\x02\x00\x00\x01\t" + // 0x00630302: 0x00000109 "\x00C\x03\a\x00\x00\x01\n" + // 0x00430307: 0x0000010A "\x00c\x03\a\x00\x00\x01\v" + // 0x00630307: 0x0000010B "\x00C\x03\f\x00\x00\x01\f" + // 0x0043030C: 0x0000010C "\x00c\x03\f\x00\x00\x01\r" + // 0x0063030C: 0x0000010D "\x00D\x03\f\x00\x00\x01\x0e" + // 0x0044030C: 0x0000010E "\x00d\x03\f\x00\x00\x01\x0f" + // 0x0064030C: 0x0000010F "\x00E\x03\x04\x00\x00\x01\x12" + // 0x00450304: 0x00000112 "\x00e\x03\x04\x00\x00\x01\x13" + // 0x00650304: 0x00000113 "\x00E\x03\x06\x00\x00\x01\x14" + // 0x00450306: 0x00000114 "\x00e\x03\x06\x00\x00\x01\x15" + // 0x00650306: 0x00000115 "\x00E\x03\a\x00\x00\x01\x16" + // 0x00450307: 0x00000116 "\x00e\x03\a\x00\x00\x01\x17" + // 0x00650307: 0x00000117 "\x00E\x03(\x00\x00\x01\x18" + // 0x00450328: 0x00000118 "\x00e\x03(\x00\x00\x01\x19" + // 0x00650328: 0x00000119 "\x00E\x03\f\x00\x00\x01\x1a" + // 0x0045030C: 0x0000011A "\x00e\x03\f\x00\x00\x01\x1b" + // 0x0065030C: 0x0000011B "\x00G\x03\x02\x00\x00\x01\x1c" + // 0x00470302: 0x0000011C "\x00g\x03\x02\x00\x00\x01\x1d" + // 0x00670302: 0x0000011D "\x00G\x03\x06\x00\x00\x01\x1e" + // 0x00470306: 0x0000011E "\x00g\x03\x06\x00\x00\x01\x1f" + // 0x00670306: 0x0000011F "\x00G\x03\a\x00\x00\x01 " + // 0x00470307: 0x00000120 "\x00g\x03\a\x00\x00\x01!" + // 0x00670307: 0x00000121 "\x00G\x03'\x00\x00\x01\"" + // 0x00470327: 0x00000122 "\x00g\x03'\x00\x00\x01#" + // 0x00670327: 0x00000123 "\x00H\x03\x02\x00\x00\x01$" + // 0x00480302: 0x00000124 "\x00h\x03\x02\x00\x00\x01%" + // 0x00680302: 0x00000125 "\x00I\x03\x03\x00\x00\x01(" + // 0x00490303: 0x00000128 "\x00i\x03\x03\x00\x00\x01)" + // 0x00690303: 0x00000129 "\x00I\x03\x04\x00\x00\x01*" + // 0x00490304: 0x0000012A "\x00i\x03\x04\x00\x00\x01+" + // 0x00690304: 0x0000012B "\x00I\x03\x06\x00\x00\x01," + // 0x00490306: 0x0000012C "\x00i\x03\x06\x00\x00\x01-" + // 0x00690306: 0x0000012D "\x00I\x03(\x00\x00\x01." + // 0x00490328: 0x0000012E "\x00i\x03(\x00\x00\x01/" + // 0x00690328: 0x0000012F "\x00I\x03\a\x00\x00\x010" + // 0x00490307: 0x00000130 "\x00J\x03\x02\x00\x00\x014" + // 0x004A0302: 0x00000134 "\x00j\x03\x02\x00\x00\x015" + // 0x006A0302: 0x00000135 "\x00K\x03'\x00\x00\x016" + // 0x004B0327: 0x00000136 "\x00k\x03'\x00\x00\x017" + // 0x006B0327: 0x00000137 "\x00L\x03\x01\x00\x00\x019" + // 0x004C0301: 0x00000139 "\x00l\x03\x01\x00\x00\x01:" + // 0x006C0301: 0x0000013A "\x00L\x03'\x00\x00\x01;" + // 0x004C0327: 0x0000013B "\x00l\x03'\x00\x00\x01<" + // 0x006C0327: 0x0000013C "\x00L\x03\f\x00\x00\x01=" + // 0x004C030C: 0x0000013D "\x00l\x03\f\x00\x00\x01>" + // 0x006C030C: 0x0000013E "\x00N\x03\x01\x00\x00\x01C" + // 0x004E0301: 0x00000143 "\x00n\x03\x01\x00\x00\x01D" + // 0x006E0301: 0x00000144 "\x00N\x03'\x00\x00\x01E" + // 0x004E0327: 0x00000145 "\x00n\x03'\x00\x00\x01F" + // 0x006E0327: 0x00000146 "\x00N\x03\f\x00\x00\x01G" + // 0x004E030C: 0x00000147 "\x00n\x03\f\x00\x00\x01H" + // 0x006E030C: 0x00000148 "\x00O\x03\x04\x00\x00\x01L" + // 0x004F0304: 0x0000014C "\x00o\x03\x04\x00\x00\x01M" + // 0x006F0304: 0x0000014D "\x00O\x03\x06\x00\x00\x01N" + // 0x004F0306: 0x0000014E "\x00o\x03\x06\x00\x00\x01O" + // 0x006F0306: 0x0000014F "\x00O\x03\v\x00\x00\x01P" + // 0x004F030B: 0x00000150 "\x00o\x03\v\x00\x00\x01Q" + // 0x006F030B: 0x00000151 "\x00R\x03\x01\x00\x00\x01T" + // 0x00520301: 0x00000154 "\x00r\x03\x01\x00\x00\x01U" + // 0x00720301: 0x00000155 "\x00R\x03'\x00\x00\x01V" + // 0x00520327: 0x00000156 "\x00r\x03'\x00\x00\x01W" + // 0x00720327: 0x00000157 "\x00R\x03\f\x00\x00\x01X" + // 0x0052030C: 0x00000158 "\x00r\x03\f\x00\x00\x01Y" + // 0x0072030C: 0x00000159 "\x00S\x03\x01\x00\x00\x01Z" + // 0x00530301: 0x0000015A "\x00s\x03\x01\x00\x00\x01[" + // 0x00730301: 0x0000015B "\x00S\x03\x02\x00\x00\x01\\" + // 0x00530302: 0x0000015C "\x00s\x03\x02\x00\x00\x01]" + // 0x00730302: 0x0000015D "\x00S\x03'\x00\x00\x01^" + // 0x00530327: 0x0000015E "\x00s\x03'\x00\x00\x01_" + // 0x00730327: 0x0000015F "\x00S\x03\f\x00\x00\x01`" + // 0x0053030C: 0x00000160 "\x00s\x03\f\x00\x00\x01a" + // 0x0073030C: 0x00000161 "\x00T\x03'\x00\x00\x01b" + // 0x00540327: 0x00000162 "\x00t\x03'\x00\x00\x01c" + // 0x00740327: 0x00000163 "\x00T\x03\f\x00\x00\x01d" + // 0x0054030C: 0x00000164 "\x00t\x03\f\x00\x00\x01e" + // 0x0074030C: 0x00000165 "\x00U\x03\x03\x00\x00\x01h" + // 0x00550303: 0x00000168 "\x00u\x03\x03\x00\x00\x01i" + // 0x00750303: 0x00000169 "\x00U\x03\x04\x00\x00\x01j" + // 0x00550304: 0x0000016A "\x00u\x03\x04\x00\x00\x01k" + // 0x00750304: 0x0000016B "\x00U\x03\x06\x00\x00\x01l" + // 0x00550306: 0x0000016C "\x00u\x03\x06\x00\x00\x01m" + // 0x00750306: 0x0000016D "\x00U\x03\n\x00\x00\x01n" + // 0x0055030A: 0x0000016E "\x00u\x03\n\x00\x00\x01o" + // 0x0075030A: 0x0000016F "\x00U\x03\v\x00\x00\x01p" + // 0x0055030B: 0x00000170 "\x00u\x03\v\x00\x00\x01q" + // 0x0075030B: 0x00000171 "\x00U\x03(\x00\x00\x01r" + // 0x00550328: 0x00000172 "\x00u\x03(\x00\x00\x01s" + // 0x00750328: 0x00000173 "\x00W\x03\x02\x00\x00\x01t" + // 0x00570302: 0x00000174 "\x00w\x03\x02\x00\x00\x01u" + // 0x00770302: 0x00000175 "\x00Y\x03\x02\x00\x00\x01v" + // 0x00590302: 0x00000176 "\x00y\x03\x02\x00\x00\x01w" + // 0x00790302: 0x00000177 "\x00Y\x03\b\x00\x00\x01x" + // 0x00590308: 0x00000178 "\x00Z\x03\x01\x00\x00\x01y" + // 0x005A0301: 0x00000179 "\x00z\x03\x01\x00\x00\x01z" + // 0x007A0301: 0x0000017A "\x00Z\x03\a\x00\x00\x01{" + // 0x005A0307: 0x0000017B "\x00z\x03\a\x00\x00\x01|" + // 0x007A0307: 0x0000017C "\x00Z\x03\f\x00\x00\x01}" + // 0x005A030C: 0x0000017D "\x00z\x03\f\x00\x00\x01~" + // 0x007A030C: 0x0000017E "\x00O\x03\x1b\x00\x00\x01\xa0" + // 0x004F031B: 0x000001A0 "\x00o\x03\x1b\x00\x00\x01\xa1" + // 0x006F031B: 0x000001A1 "\x00U\x03\x1b\x00\x00\x01\xaf" + // 0x0055031B: 0x000001AF "\x00u\x03\x1b\x00\x00\x01\xb0" + // 0x0075031B: 0x000001B0 "\x00A\x03\f\x00\x00\x01\xcd" + // 0x0041030C: 0x000001CD "\x00a\x03\f\x00\x00\x01\xce" + // 0x0061030C: 0x000001CE "\x00I\x03\f\x00\x00\x01\xcf" + // 0x0049030C: 0x000001CF "\x00i\x03\f\x00\x00\x01\xd0" + // 0x0069030C: 0x000001D0 "\x00O\x03\f\x00\x00\x01\xd1" + // 0x004F030C: 0x000001D1 "\x00o\x03\f\x00\x00\x01\xd2" + // 0x006F030C: 0x000001D2 "\x00U\x03\f\x00\x00\x01\xd3" + // 0x0055030C: 0x000001D3 "\x00u\x03\f\x00\x00\x01\xd4" + // 0x0075030C: 0x000001D4 "\x00\xdc\x03\x04\x00\x00\x01\xd5" + // 0x00DC0304: 0x000001D5 "\x00\xfc\x03\x04\x00\x00\x01\xd6" + // 0x00FC0304: 0x000001D6 "\x00\xdc\x03\x01\x00\x00\x01\xd7" + // 0x00DC0301: 0x000001D7 "\x00\xfc\x03\x01\x00\x00\x01\xd8" + // 0x00FC0301: 0x000001D8 "\x00\xdc\x03\f\x00\x00\x01\xd9" + // 0x00DC030C: 0x000001D9 "\x00\xfc\x03\f\x00\x00\x01\xda" + // 0x00FC030C: 0x000001DA "\x00\xdc\x03\x00\x00\x00\x01\xdb" + // 0x00DC0300: 0x000001DB "\x00\xfc\x03\x00\x00\x00\x01\xdc" + // 0x00FC0300: 0x000001DC "\x00\xc4\x03\x04\x00\x00\x01\xde" + // 0x00C40304: 0x000001DE "\x00\xe4\x03\x04\x00\x00\x01\xdf" + // 0x00E40304: 0x000001DF "\x02&\x03\x04\x00\x00\x01\xe0" + // 0x02260304: 0x000001E0 "\x02'\x03\x04\x00\x00\x01\xe1" + // 0x02270304: 0x000001E1 "\x00\xc6\x03\x04\x00\x00\x01\xe2" + // 0x00C60304: 0x000001E2 "\x00\xe6\x03\x04\x00\x00\x01\xe3" + // 0x00E60304: 0x000001E3 "\x00G\x03\f\x00\x00\x01\xe6" + // 0x0047030C: 0x000001E6 "\x00g\x03\f\x00\x00\x01\xe7" + // 0x0067030C: 0x000001E7 "\x00K\x03\f\x00\x00\x01\xe8" + // 0x004B030C: 0x000001E8 "\x00k\x03\f\x00\x00\x01\xe9" + // 0x006B030C: 0x000001E9 "\x00O\x03(\x00\x00\x01\xea" + // 0x004F0328: 0x000001EA "\x00o\x03(\x00\x00\x01\xeb" + // 0x006F0328: 0x000001EB "\x01\xea\x03\x04\x00\x00\x01\xec" + // 0x01EA0304: 0x000001EC "\x01\xeb\x03\x04\x00\x00\x01\xed" + // 0x01EB0304: 0x000001ED "\x01\xb7\x03\f\x00\x00\x01\xee" + // 0x01B7030C: 0x000001EE "\x02\x92\x03\f\x00\x00\x01\xef" + // 0x0292030C: 0x000001EF "\x00j\x03\f\x00\x00\x01\xf0" + // 0x006A030C: 0x000001F0 "\x00G\x03\x01\x00\x00\x01\xf4" + // 0x00470301: 0x000001F4 "\x00g\x03\x01\x00\x00\x01\xf5" + // 0x00670301: 0x000001F5 "\x00N\x03\x00\x00\x00\x01\xf8" + // 0x004E0300: 0x000001F8 "\x00n\x03\x00\x00\x00\x01\xf9" + // 0x006E0300: 0x000001F9 "\x00\xc5\x03\x01\x00\x00\x01\xfa" + // 0x00C50301: 0x000001FA "\x00\xe5\x03\x01\x00\x00\x01\xfb" + // 0x00E50301: 0x000001FB "\x00\xc6\x03\x01\x00\x00\x01\xfc" + // 0x00C60301: 0x000001FC "\x00\xe6\x03\x01\x00\x00\x01\xfd" + // 0x00E60301: 0x000001FD "\x00\xd8\x03\x01\x00\x00\x01\xfe" + // 0x00D80301: 0x000001FE "\x00\xf8\x03\x01\x00\x00\x01\xff" + // 0x00F80301: 0x000001FF "\x00A\x03\x0f\x00\x00\x02\x00" + // 0x0041030F: 0x00000200 "\x00a\x03\x0f\x00\x00\x02\x01" + // 0x0061030F: 0x00000201 "\x00A\x03\x11\x00\x00\x02\x02" + // 0x00410311: 0x00000202 "\x00a\x03\x11\x00\x00\x02\x03" + // 0x00610311: 0x00000203 "\x00E\x03\x0f\x00\x00\x02\x04" + // 0x0045030F: 0x00000204 "\x00e\x03\x0f\x00\x00\x02\x05" + // 0x0065030F: 0x00000205 "\x00E\x03\x11\x00\x00\x02\x06" + // 0x00450311: 0x00000206 "\x00e\x03\x11\x00\x00\x02\a" + // 0x00650311: 0x00000207 "\x00I\x03\x0f\x00\x00\x02\b" + // 0x0049030F: 0x00000208 "\x00i\x03\x0f\x00\x00\x02\t" + // 0x0069030F: 0x00000209 "\x00I\x03\x11\x00\x00\x02\n" + // 0x00490311: 0x0000020A "\x00i\x03\x11\x00\x00\x02\v" + // 0x00690311: 0x0000020B "\x00O\x03\x0f\x00\x00\x02\f" + // 0x004F030F: 0x0000020C "\x00o\x03\x0f\x00\x00\x02\r" + // 0x006F030F: 0x0000020D "\x00O\x03\x11\x00\x00\x02\x0e" + // 0x004F0311: 0x0000020E "\x00o\x03\x11\x00\x00\x02\x0f" + // 0x006F0311: 0x0000020F "\x00R\x03\x0f\x00\x00\x02\x10" + // 0x0052030F: 0x00000210 "\x00r\x03\x0f\x00\x00\x02\x11" + // 0x0072030F: 0x00000211 "\x00R\x03\x11\x00\x00\x02\x12" + // 0x00520311: 0x00000212 "\x00r\x03\x11\x00\x00\x02\x13" + // 0x00720311: 0x00000213 "\x00U\x03\x0f\x00\x00\x02\x14" + // 0x0055030F: 0x00000214 "\x00u\x03\x0f\x00\x00\x02\x15" + // 0x0075030F: 0x00000215 "\x00U\x03\x11\x00\x00\x02\x16" + // 0x00550311: 0x00000216 "\x00u\x03\x11\x00\x00\x02\x17" + // 0x00750311: 0x00000217 "\x00S\x03&\x00\x00\x02\x18" + // 0x00530326: 0x00000218 "\x00s\x03&\x00\x00\x02\x19" + // 0x00730326: 0x00000219 "\x00T\x03&\x00\x00\x02\x1a" + // 0x00540326: 0x0000021A "\x00t\x03&\x00\x00\x02\x1b" + // 0x00740326: 0x0000021B "\x00H\x03\f\x00\x00\x02\x1e" + // 0x0048030C: 0x0000021E "\x00h\x03\f\x00\x00\x02\x1f" + // 0x0068030C: 0x0000021F "\x00A\x03\a\x00\x00\x02&" + // 0x00410307: 0x00000226 "\x00a\x03\a\x00\x00\x02'" + // 0x00610307: 0x00000227 "\x00E\x03'\x00\x00\x02(" + // 0x00450327: 0x00000228 "\x00e\x03'\x00\x00\x02)" + // 0x00650327: 0x00000229 "\x00\xd6\x03\x04\x00\x00\x02*" + // 0x00D60304: 0x0000022A "\x00\xf6\x03\x04\x00\x00\x02+" + // 0x00F60304: 0x0000022B "\x00\xd5\x03\x04\x00\x00\x02," + // 0x00D50304: 0x0000022C "\x00\xf5\x03\x04\x00\x00\x02-" + // 0x00F50304: 0x0000022D "\x00O\x03\a\x00\x00\x02." + // 0x004F0307: 0x0000022E "\x00o\x03\a\x00\x00\x02/" + // 0x006F0307: 0x0000022F "\x02.\x03\x04\x00\x00\x020" + // 0x022E0304: 0x00000230 "\x02/\x03\x04\x00\x00\x021" + // 0x022F0304: 0x00000231 "\x00Y\x03\x04\x00\x00\x022" + // 0x00590304: 0x00000232 "\x00y\x03\x04\x00\x00\x023" + // 0x00790304: 0x00000233 "\x00\xa8\x03\x01\x00\x00\x03\x85" + // 0x00A80301: 0x00000385 "\x03\x91\x03\x01\x00\x00\x03\x86" + // 0x03910301: 0x00000386 "\x03\x95\x03\x01\x00\x00\x03\x88" + // 0x03950301: 0x00000388 "\x03\x97\x03\x01\x00\x00\x03\x89" + // 0x03970301: 0x00000389 "\x03\x99\x03\x01\x00\x00\x03\x8a" + // 0x03990301: 0x0000038A "\x03\x9f\x03\x01\x00\x00\x03\x8c" + // 0x039F0301: 0x0000038C "\x03\xa5\x03\x01\x00\x00\x03\x8e" + // 0x03A50301: 0x0000038E "\x03\xa9\x03\x01\x00\x00\x03\x8f" + // 0x03A90301: 0x0000038F "\x03\xca\x03\x01\x00\x00\x03\x90" + // 0x03CA0301: 0x00000390 "\x03\x99\x03\b\x00\x00\x03\xaa" + // 0x03990308: 0x000003AA "\x03\xa5\x03\b\x00\x00\x03\xab" + // 0x03A50308: 0x000003AB "\x03\xb1\x03\x01\x00\x00\x03\xac" + // 0x03B10301: 0x000003AC "\x03\xb5\x03\x01\x00\x00\x03\xad" + // 0x03B50301: 0x000003AD "\x03\xb7\x03\x01\x00\x00\x03\xae" + // 0x03B70301: 0x000003AE "\x03\xb9\x03\x01\x00\x00\x03\xaf" + // 0x03B90301: 0x000003AF "\x03\xcb\x03\x01\x00\x00\x03\xb0" + // 0x03CB0301: 0x000003B0 "\x03\xb9\x03\b\x00\x00\x03\xca" + // 0x03B90308: 0x000003CA "\x03\xc5\x03\b\x00\x00\x03\xcb" + // 0x03C50308: 0x000003CB "\x03\xbf\x03\x01\x00\x00\x03\xcc" + // 0x03BF0301: 0x000003CC "\x03\xc5\x03\x01\x00\x00\x03\xcd" + // 0x03C50301: 0x000003CD "\x03\xc9\x03\x01\x00\x00\x03\xce" + // 0x03C90301: 0x000003CE "\x03\xd2\x03\x01\x00\x00\x03\xd3" + // 0x03D20301: 0x000003D3 "\x03\xd2\x03\b\x00\x00\x03\xd4" + // 0x03D20308: 0x000003D4 "\x04\x15\x03\x00\x00\x00\x04\x00" + // 0x04150300: 0x00000400 "\x04\x15\x03\b\x00\x00\x04\x01" + // 0x04150308: 0x00000401 "\x04\x13\x03\x01\x00\x00\x04\x03" + // 0x04130301: 0x00000403 "\x04\x06\x03\b\x00\x00\x04\a" + // 0x04060308: 0x00000407 "\x04\x1a\x03\x01\x00\x00\x04\f" + // 0x041A0301: 0x0000040C "\x04\x18\x03\x00\x00\x00\x04\r" + // 0x04180300: 0x0000040D "\x04#\x03\x06\x00\x00\x04\x0e" + // 0x04230306: 0x0000040E "\x04\x18\x03\x06\x00\x00\x04\x19" + // 0x04180306: 0x00000419 "\x048\x03\x06\x00\x00\x049" + // 0x04380306: 0x00000439 "\x045\x03\x00\x00\x00\x04P" + // 0x04350300: 0x00000450 "\x045\x03\b\x00\x00\x04Q" + // 0x04350308: 0x00000451 "\x043\x03\x01\x00\x00\x04S" + // 0x04330301: 0x00000453 "\x04V\x03\b\x00\x00\x04W" + // 0x04560308: 0x00000457 "\x04:\x03\x01\x00\x00\x04\\" + // 0x043A0301: 0x0000045C "\x048\x03\x00\x00\x00\x04]" + // 0x04380300: 0x0000045D "\x04C\x03\x06\x00\x00\x04^" + // 0x04430306: 0x0000045E "\x04t\x03\x0f\x00\x00\x04v" + // 0x0474030F: 0x00000476 "\x04u\x03\x0f\x00\x00\x04w" + // 0x0475030F: 0x00000477 "\x04\x16\x03\x06\x00\x00\x04\xc1" + // 0x04160306: 0x000004C1 "\x046\x03\x06\x00\x00\x04\xc2" + // 0x04360306: 0x000004C2 "\x04\x10\x03\x06\x00\x00\x04\xd0" + // 0x04100306: 0x000004D0 "\x040\x03\x06\x00\x00\x04\xd1" + // 0x04300306: 0x000004D1 "\x04\x10\x03\b\x00\x00\x04\xd2" + // 0x04100308: 0x000004D2 "\x040\x03\b\x00\x00\x04\xd3" + // 0x04300308: 0x000004D3 "\x04\x15\x03\x06\x00\x00\x04\xd6" + // 0x04150306: 0x000004D6 "\x045\x03\x06\x00\x00\x04\xd7" + // 0x04350306: 0x000004D7 "\x04\xd8\x03\b\x00\x00\x04\xda" + // 0x04D80308: 0x000004DA "\x04\xd9\x03\b\x00\x00\x04\xdb" + // 0x04D90308: 0x000004DB "\x04\x16\x03\b\x00\x00\x04\xdc" + // 0x04160308: 0x000004DC "\x046\x03\b\x00\x00\x04\xdd" + // 0x04360308: 0x000004DD "\x04\x17\x03\b\x00\x00\x04\xde" + // 0x04170308: 0x000004DE "\x047\x03\b\x00\x00\x04\xdf" + // 0x04370308: 0x000004DF "\x04\x18\x03\x04\x00\x00\x04\xe2" + // 0x04180304: 0x000004E2 "\x048\x03\x04\x00\x00\x04\xe3" + // 0x04380304: 0x000004E3 "\x04\x18\x03\b\x00\x00\x04\xe4" + // 0x04180308: 0x000004E4 "\x048\x03\b\x00\x00\x04\xe5" + // 0x04380308: 0x000004E5 "\x04\x1e\x03\b\x00\x00\x04\xe6" + // 0x041E0308: 0x000004E6 "\x04>\x03\b\x00\x00\x04\xe7" + // 0x043E0308: 0x000004E7 "\x04\xe8\x03\b\x00\x00\x04\xea" + // 0x04E80308: 0x000004EA "\x04\xe9\x03\b\x00\x00\x04\xeb" + // 0x04E90308: 0x000004EB "\x04-\x03\b\x00\x00\x04\xec" + // 0x042D0308: 0x000004EC "\x04M\x03\b\x00\x00\x04\xed" + // 0x044D0308: 0x000004ED "\x04#\x03\x04\x00\x00\x04\xee" + // 0x04230304: 0x000004EE "\x04C\x03\x04\x00\x00\x04\xef" + // 0x04430304: 0x000004EF "\x04#\x03\b\x00\x00\x04\xf0" + // 0x04230308: 0x000004F0 "\x04C\x03\b\x00\x00\x04\xf1" + // 0x04430308: 0x000004F1 "\x04#\x03\v\x00\x00\x04\xf2" + // 0x0423030B: 0x000004F2 "\x04C\x03\v\x00\x00\x04\xf3" + // 0x0443030B: 0x000004F3 "\x04'\x03\b\x00\x00\x04\xf4" + // 0x04270308: 0x000004F4 "\x04G\x03\b\x00\x00\x04\xf5" + // 0x04470308: 0x000004F5 "\x04+\x03\b\x00\x00\x04\xf8" + // 0x042B0308: 0x000004F8 "\x04K\x03\b\x00\x00\x04\xf9" + // 0x044B0308: 0x000004F9 "\x06'\x06S\x00\x00\x06\"" + // 0x06270653: 0x00000622 "\x06'\x06T\x00\x00\x06#" + // 0x06270654: 0x00000623 "\x06H\x06T\x00\x00\x06$" + // 0x06480654: 0x00000624 "\x06'\x06U\x00\x00\x06%" + // 0x06270655: 0x00000625 "\x06J\x06T\x00\x00\x06&" + // 0x064A0654: 0x00000626 "\x06\xd5\x06T\x00\x00\x06\xc0" + // 0x06D50654: 0x000006C0 "\x06\xc1\x06T\x00\x00\x06\xc2" + // 0x06C10654: 0x000006C2 "\x06\xd2\x06T\x00\x00\x06\xd3" + // 0x06D20654: 0x000006D3 "\t(\t<\x00\x00\t)" + // 0x0928093C: 0x00000929 "\t0\t<\x00\x00\t1" + // 0x0930093C: 0x00000931 "\t3\t<\x00\x00\t4" + // 0x0933093C: 0x00000934 "\t\xc7\t\xbe\x00\x00\t\xcb" + // 0x09C709BE: 0x000009CB "\t\xc7\t\xd7\x00\x00\t\xcc" + // 0x09C709D7: 0x000009CC "\vG\vV\x00\x00\vH" + // 0x0B470B56: 0x00000B48 "\vG\v>\x00\x00\vK" + // 0x0B470B3E: 0x00000B4B "\vG\vW\x00\x00\vL" + // 0x0B470B57: 0x00000B4C "\v\x92\v\xd7\x00\x00\v\x94" + // 0x0B920BD7: 0x00000B94 "\v\xc6\v\xbe\x00\x00\v\xca" + // 0x0BC60BBE: 0x00000BCA "\v\xc7\v\xbe\x00\x00\v\xcb" + // 0x0BC70BBE: 0x00000BCB "\v\xc6\v\xd7\x00\x00\v\xcc" + // 0x0BC60BD7: 0x00000BCC "\fF\fV\x00\x00\fH" + // 0x0C460C56: 0x00000C48 "\f\xbf\f\xd5\x00\x00\f\xc0" + // 0x0CBF0CD5: 0x00000CC0 "\f\xc6\f\xd5\x00\x00\f\xc7" + // 0x0CC60CD5: 0x00000CC7 "\f\xc6\f\xd6\x00\x00\f\xc8" + // 0x0CC60CD6: 0x00000CC8 "\f\xc6\f\xc2\x00\x00\f\xca" + // 0x0CC60CC2: 0x00000CCA "\f\xca\f\xd5\x00\x00\f\xcb" + // 0x0CCA0CD5: 0x00000CCB "\rF\r>\x00\x00\rJ" + // 0x0D460D3E: 0x00000D4A "\rG\r>\x00\x00\rK" + // 0x0D470D3E: 0x00000D4B "\rF\rW\x00\x00\rL" + // 0x0D460D57: 0x00000D4C "\r\xd9\r\xca\x00\x00\r\xda" + // 0x0DD90DCA: 0x00000DDA "\r\xd9\r\xcf\x00\x00\r\xdc" + // 0x0DD90DCF: 0x00000DDC "\r\xdc\r\xca\x00\x00\r\xdd" + // 0x0DDC0DCA: 0x00000DDD "\r\xd9\r\xdf\x00\x00\r\xde" + // 0x0DD90DDF: 0x00000DDE "\x10%\x10.\x00\x00\x10&" + // 0x1025102E: 0x00001026 "\x1b\x05\x1b5\x00\x00\x1b\x06" + // 0x1B051B35: 0x00001B06 "\x1b\a\x1b5\x00\x00\x1b\b" + // 0x1B071B35: 0x00001B08 "\x1b\t\x1b5\x00\x00\x1b\n" + // 0x1B091B35: 0x00001B0A "\x1b\v\x1b5\x00\x00\x1b\f" + // 0x1B0B1B35: 0x00001B0C "\x1b\r\x1b5\x00\x00\x1b\x0e" + // 0x1B0D1B35: 0x00001B0E "\x1b\x11\x1b5\x00\x00\x1b\x12" + // 0x1B111B35: 0x00001B12 "\x1b:\x1b5\x00\x00\x1b;" + // 0x1B3A1B35: 0x00001B3B "\x1b<\x1b5\x00\x00\x1b=" + // 0x1B3C1B35: 0x00001B3D "\x1b>\x1b5\x00\x00\x1b@" + // 0x1B3E1B35: 0x00001B40 "\x1b?\x1b5\x00\x00\x1bA" + // 0x1B3F1B35: 0x00001B41 "\x1bB\x1b5\x00\x00\x1bC" + // 0x1B421B35: 0x00001B43 "\x00A\x03%\x00\x00\x1e\x00" + // 0x00410325: 0x00001E00 "\x00a\x03%\x00\x00\x1e\x01" + // 0x00610325: 0x00001E01 "\x00B\x03\a\x00\x00\x1e\x02" + // 0x00420307: 0x00001E02 "\x00b\x03\a\x00\x00\x1e\x03" + // 0x00620307: 0x00001E03 "\x00B\x03#\x00\x00\x1e\x04" + // 0x00420323: 0x00001E04 "\x00b\x03#\x00\x00\x1e\x05" + // 0x00620323: 0x00001E05 "\x00B\x031\x00\x00\x1e\x06" + // 0x00420331: 0x00001E06 "\x00b\x031\x00\x00\x1e\a" + // 0x00620331: 0x00001E07 "\x00\xc7\x03\x01\x00\x00\x1e\b" + // 0x00C70301: 0x00001E08 "\x00\xe7\x03\x01\x00\x00\x1e\t" + // 0x00E70301: 0x00001E09 "\x00D\x03\a\x00\x00\x1e\n" + // 0x00440307: 0x00001E0A "\x00d\x03\a\x00\x00\x1e\v" + // 0x00640307: 0x00001E0B "\x00D\x03#\x00\x00\x1e\f" + // 0x00440323: 0x00001E0C "\x00d\x03#\x00\x00\x1e\r" + // 0x00640323: 0x00001E0D "\x00D\x031\x00\x00\x1e\x0e" + // 0x00440331: 0x00001E0E "\x00d\x031\x00\x00\x1e\x0f" + // 0x00640331: 0x00001E0F "\x00D\x03'\x00\x00\x1e\x10" + // 0x00440327: 0x00001E10 "\x00d\x03'\x00\x00\x1e\x11" + // 0x00640327: 0x00001E11 "\x00D\x03-\x00\x00\x1e\x12" + // 0x0044032D: 0x00001E12 "\x00d\x03-\x00\x00\x1e\x13" + // 0x0064032D: 0x00001E13 "\x01\x12\x03\x00\x00\x00\x1e\x14" + // 0x01120300: 0x00001E14 "\x01\x13\x03\x00\x00\x00\x1e\x15" + // 0x01130300: 0x00001E15 "\x01\x12\x03\x01\x00\x00\x1e\x16" + // 0x01120301: 0x00001E16 "\x01\x13\x03\x01\x00\x00\x1e\x17" + // 0x01130301: 0x00001E17 "\x00E\x03-\x00\x00\x1e\x18" + // 0x0045032D: 0x00001E18 "\x00e\x03-\x00\x00\x1e\x19" + // 0x0065032D: 0x00001E19 "\x00E\x030\x00\x00\x1e\x1a" + // 0x00450330: 0x00001E1A "\x00e\x030\x00\x00\x1e\x1b" + // 0x00650330: 0x00001E1B "\x02(\x03\x06\x00\x00\x1e\x1c" + // 0x02280306: 0x00001E1C "\x02)\x03\x06\x00\x00\x1e\x1d" + // 0x02290306: 0x00001E1D "\x00F\x03\a\x00\x00\x1e\x1e" + // 0x00460307: 0x00001E1E "\x00f\x03\a\x00\x00\x1e\x1f" + // 0x00660307: 0x00001E1F "\x00G\x03\x04\x00\x00\x1e " + // 0x00470304: 0x00001E20 "\x00g\x03\x04\x00\x00\x1e!" + // 0x00670304: 0x00001E21 "\x00H\x03\a\x00\x00\x1e\"" + // 0x00480307: 0x00001E22 "\x00h\x03\a\x00\x00\x1e#" + // 0x00680307: 0x00001E23 "\x00H\x03#\x00\x00\x1e$" + // 0x00480323: 0x00001E24 "\x00h\x03#\x00\x00\x1e%" + // 0x00680323: 0x00001E25 "\x00H\x03\b\x00\x00\x1e&" + // 0x00480308: 0x00001E26 "\x00h\x03\b\x00\x00\x1e'" + // 0x00680308: 0x00001E27 "\x00H\x03'\x00\x00\x1e(" + // 0x00480327: 0x00001E28 "\x00h\x03'\x00\x00\x1e)" + // 0x00680327: 0x00001E29 "\x00H\x03.\x00\x00\x1e*" + // 0x0048032E: 0x00001E2A "\x00h\x03.\x00\x00\x1e+" + // 0x0068032E: 0x00001E2B "\x00I\x030\x00\x00\x1e," + // 0x00490330: 0x00001E2C "\x00i\x030\x00\x00\x1e-" + // 0x00690330: 0x00001E2D "\x00\xcf\x03\x01\x00\x00\x1e." + // 0x00CF0301: 0x00001E2E "\x00\xef\x03\x01\x00\x00\x1e/" + // 0x00EF0301: 0x00001E2F "\x00K\x03\x01\x00\x00\x1e0" + // 0x004B0301: 0x00001E30 "\x00k\x03\x01\x00\x00\x1e1" + // 0x006B0301: 0x00001E31 "\x00K\x03#\x00\x00\x1e2" + // 0x004B0323: 0x00001E32 "\x00k\x03#\x00\x00\x1e3" + // 0x006B0323: 0x00001E33 "\x00K\x031\x00\x00\x1e4" + // 0x004B0331: 0x00001E34 "\x00k\x031\x00\x00\x1e5" + // 0x006B0331: 0x00001E35 "\x00L\x03#\x00\x00\x1e6" + // 0x004C0323: 0x00001E36 "\x00l\x03#\x00\x00\x1e7" + // 0x006C0323: 0x00001E37 "\x1e6\x03\x04\x00\x00\x1e8" + // 0x1E360304: 0x00001E38 "\x1e7\x03\x04\x00\x00\x1e9" + // 0x1E370304: 0x00001E39 "\x00L\x031\x00\x00\x1e:" + // 0x004C0331: 0x00001E3A "\x00l\x031\x00\x00\x1e;" + // 0x006C0331: 0x00001E3B "\x00L\x03-\x00\x00\x1e<" + // 0x004C032D: 0x00001E3C "\x00l\x03-\x00\x00\x1e=" + // 0x006C032D: 0x00001E3D "\x00M\x03\x01\x00\x00\x1e>" + // 0x004D0301: 0x00001E3E "\x00m\x03\x01\x00\x00\x1e?" + // 0x006D0301: 0x00001E3F "\x00M\x03\a\x00\x00\x1e@" + // 0x004D0307: 0x00001E40 "\x00m\x03\a\x00\x00\x1eA" + // 0x006D0307: 0x00001E41 "\x00M\x03#\x00\x00\x1eB" + // 0x004D0323: 0x00001E42 "\x00m\x03#\x00\x00\x1eC" + // 0x006D0323: 0x00001E43 "\x00N\x03\a\x00\x00\x1eD" + // 0x004E0307: 0x00001E44 "\x00n\x03\a\x00\x00\x1eE" + // 0x006E0307: 0x00001E45 "\x00N\x03#\x00\x00\x1eF" + // 0x004E0323: 0x00001E46 "\x00n\x03#\x00\x00\x1eG" + // 0x006E0323: 0x00001E47 "\x00N\x031\x00\x00\x1eH" + // 0x004E0331: 0x00001E48 "\x00n\x031\x00\x00\x1eI" + // 0x006E0331: 0x00001E49 "\x00N\x03-\x00\x00\x1eJ" + // 0x004E032D: 0x00001E4A "\x00n\x03-\x00\x00\x1eK" + // 0x006E032D: 0x00001E4B "\x00\xd5\x03\x01\x00\x00\x1eL" + // 0x00D50301: 0x00001E4C "\x00\xf5\x03\x01\x00\x00\x1eM" + // 0x00F50301: 0x00001E4D "\x00\xd5\x03\b\x00\x00\x1eN" + // 0x00D50308: 0x00001E4E "\x00\xf5\x03\b\x00\x00\x1eO" + // 0x00F50308: 0x00001E4F "\x01L\x03\x00\x00\x00\x1eP" + // 0x014C0300: 0x00001E50 "\x01M\x03\x00\x00\x00\x1eQ" + // 0x014D0300: 0x00001E51 "\x01L\x03\x01\x00\x00\x1eR" + // 0x014C0301: 0x00001E52 "\x01M\x03\x01\x00\x00\x1eS" + // 0x014D0301: 0x00001E53 "\x00P\x03\x01\x00\x00\x1eT" + // 0x00500301: 0x00001E54 "\x00p\x03\x01\x00\x00\x1eU" + // 0x00700301: 0x00001E55 "\x00P\x03\a\x00\x00\x1eV" + // 0x00500307: 0x00001E56 "\x00p\x03\a\x00\x00\x1eW" + // 0x00700307: 0x00001E57 "\x00R\x03\a\x00\x00\x1eX" + // 0x00520307: 0x00001E58 "\x00r\x03\a\x00\x00\x1eY" + // 0x00720307: 0x00001E59 "\x00R\x03#\x00\x00\x1eZ" + // 0x00520323: 0x00001E5A "\x00r\x03#\x00\x00\x1e[" + // 0x00720323: 0x00001E5B "\x1eZ\x03\x04\x00\x00\x1e\\" + // 0x1E5A0304: 0x00001E5C "\x1e[\x03\x04\x00\x00\x1e]" + // 0x1E5B0304: 0x00001E5D "\x00R\x031\x00\x00\x1e^" + // 0x00520331: 0x00001E5E "\x00r\x031\x00\x00\x1e_" + // 0x00720331: 0x00001E5F "\x00S\x03\a\x00\x00\x1e`" + // 0x00530307: 0x00001E60 "\x00s\x03\a\x00\x00\x1ea" + // 0x00730307: 0x00001E61 "\x00S\x03#\x00\x00\x1eb" + // 0x00530323: 0x00001E62 "\x00s\x03#\x00\x00\x1ec" + // 0x00730323: 0x00001E63 "\x01Z\x03\a\x00\x00\x1ed" + // 0x015A0307: 0x00001E64 "\x01[\x03\a\x00\x00\x1ee" + // 0x015B0307: 0x00001E65 "\x01`\x03\a\x00\x00\x1ef" + // 0x01600307: 0x00001E66 "\x01a\x03\a\x00\x00\x1eg" + // 0x01610307: 0x00001E67 "\x1eb\x03\a\x00\x00\x1eh" + // 0x1E620307: 0x00001E68 "\x1ec\x03\a\x00\x00\x1ei" + // 0x1E630307: 0x00001E69 "\x00T\x03\a\x00\x00\x1ej" + // 0x00540307: 0x00001E6A "\x00t\x03\a\x00\x00\x1ek" + // 0x00740307: 0x00001E6B "\x00T\x03#\x00\x00\x1el" + // 0x00540323: 0x00001E6C "\x00t\x03#\x00\x00\x1em" + // 0x00740323: 0x00001E6D "\x00T\x031\x00\x00\x1en" + // 0x00540331: 0x00001E6E "\x00t\x031\x00\x00\x1eo" + // 0x00740331: 0x00001E6F "\x00T\x03-\x00\x00\x1ep" + // 0x0054032D: 0x00001E70 "\x00t\x03-\x00\x00\x1eq" + // 0x0074032D: 0x00001E71 "\x00U\x03$\x00\x00\x1er" + // 0x00550324: 0x00001E72 "\x00u\x03$\x00\x00\x1es" + // 0x00750324: 0x00001E73 "\x00U\x030\x00\x00\x1et" + // 0x00550330: 0x00001E74 "\x00u\x030\x00\x00\x1eu" + // 0x00750330: 0x00001E75 "\x00U\x03-\x00\x00\x1ev" + // 0x0055032D: 0x00001E76 "\x00u\x03-\x00\x00\x1ew" + // 0x0075032D: 0x00001E77 "\x01h\x03\x01\x00\x00\x1ex" + // 0x01680301: 0x00001E78 "\x01i\x03\x01\x00\x00\x1ey" + // 0x01690301: 0x00001E79 "\x01j\x03\b\x00\x00\x1ez" + // 0x016A0308: 0x00001E7A "\x01k\x03\b\x00\x00\x1e{" + // 0x016B0308: 0x00001E7B "\x00V\x03\x03\x00\x00\x1e|" + // 0x00560303: 0x00001E7C "\x00v\x03\x03\x00\x00\x1e}" + // 0x00760303: 0x00001E7D "\x00V\x03#\x00\x00\x1e~" + // 0x00560323: 0x00001E7E "\x00v\x03#\x00\x00\x1e\x7f" + // 0x00760323: 0x00001E7F "\x00W\x03\x00\x00\x00\x1e\x80" + // 0x00570300: 0x00001E80 "\x00w\x03\x00\x00\x00\x1e\x81" + // 0x00770300: 0x00001E81 "\x00W\x03\x01\x00\x00\x1e\x82" + // 0x00570301: 0x00001E82 "\x00w\x03\x01\x00\x00\x1e\x83" + // 0x00770301: 0x00001E83 "\x00W\x03\b\x00\x00\x1e\x84" + // 0x00570308: 0x00001E84 "\x00w\x03\b\x00\x00\x1e\x85" + // 0x00770308: 0x00001E85 "\x00W\x03\a\x00\x00\x1e\x86" + // 0x00570307: 0x00001E86 "\x00w\x03\a\x00\x00\x1e\x87" + // 0x00770307: 0x00001E87 "\x00W\x03#\x00\x00\x1e\x88" + // 0x00570323: 0x00001E88 "\x00w\x03#\x00\x00\x1e\x89" + // 0x00770323: 0x00001E89 "\x00X\x03\a\x00\x00\x1e\x8a" + // 0x00580307: 0x00001E8A "\x00x\x03\a\x00\x00\x1e\x8b" + // 0x00780307: 0x00001E8B "\x00X\x03\b\x00\x00\x1e\x8c" + // 0x00580308: 0x00001E8C "\x00x\x03\b\x00\x00\x1e\x8d" + // 0x00780308: 0x00001E8D "\x00Y\x03\a\x00\x00\x1e\x8e" + // 0x00590307: 0x00001E8E "\x00y\x03\a\x00\x00\x1e\x8f" + // 0x00790307: 0x00001E8F "\x00Z\x03\x02\x00\x00\x1e\x90" + // 0x005A0302: 0x00001E90 "\x00z\x03\x02\x00\x00\x1e\x91" + // 0x007A0302: 0x00001E91 "\x00Z\x03#\x00\x00\x1e\x92" + // 0x005A0323: 0x00001E92 "\x00z\x03#\x00\x00\x1e\x93" + // 0x007A0323: 0x00001E93 "\x00Z\x031\x00\x00\x1e\x94" + // 0x005A0331: 0x00001E94 "\x00z\x031\x00\x00\x1e\x95" + // 0x007A0331: 0x00001E95 "\x00h\x031\x00\x00\x1e\x96" + // 0x00680331: 0x00001E96 "\x00t\x03\b\x00\x00\x1e\x97" + // 0x00740308: 0x00001E97 "\x00w\x03\n\x00\x00\x1e\x98" + // 0x0077030A: 0x00001E98 "\x00y\x03\n\x00\x00\x1e\x99" + // 0x0079030A: 0x00001E99 "\x01\x7f\x03\a\x00\x00\x1e\x9b" + // 0x017F0307: 0x00001E9B "\x00A\x03#\x00\x00\x1e\xa0" + // 0x00410323: 0x00001EA0 "\x00a\x03#\x00\x00\x1e\xa1" + // 0x00610323: 0x00001EA1 "\x00A\x03\t\x00\x00\x1e\xa2" + // 0x00410309: 0x00001EA2 "\x00a\x03\t\x00\x00\x1e\xa3" + // 0x00610309: 0x00001EA3 "\x00\xc2\x03\x01\x00\x00\x1e\xa4" + // 0x00C20301: 0x00001EA4 "\x00\xe2\x03\x01\x00\x00\x1e\xa5" + // 0x00E20301: 0x00001EA5 "\x00\xc2\x03\x00\x00\x00\x1e\xa6" + // 0x00C20300: 0x00001EA6 "\x00\xe2\x03\x00\x00\x00\x1e\xa7" + // 0x00E20300: 0x00001EA7 "\x00\xc2\x03\t\x00\x00\x1e\xa8" + // 0x00C20309: 0x00001EA8 "\x00\xe2\x03\t\x00\x00\x1e\xa9" + // 0x00E20309: 0x00001EA9 "\x00\xc2\x03\x03\x00\x00\x1e\xaa" + // 0x00C20303: 0x00001EAA "\x00\xe2\x03\x03\x00\x00\x1e\xab" + // 0x00E20303: 0x00001EAB "\x1e\xa0\x03\x02\x00\x00\x1e\xac" + // 0x1EA00302: 0x00001EAC "\x1e\xa1\x03\x02\x00\x00\x1e\xad" + // 0x1EA10302: 0x00001EAD "\x01\x02\x03\x01\x00\x00\x1e\xae" + // 0x01020301: 0x00001EAE "\x01\x03\x03\x01\x00\x00\x1e\xaf" + // 0x01030301: 0x00001EAF "\x01\x02\x03\x00\x00\x00\x1e\xb0" + // 0x01020300: 0x00001EB0 "\x01\x03\x03\x00\x00\x00\x1e\xb1" + // 0x01030300: 0x00001EB1 "\x01\x02\x03\t\x00\x00\x1e\xb2" + // 0x01020309: 0x00001EB2 "\x01\x03\x03\t\x00\x00\x1e\xb3" + // 0x01030309: 0x00001EB3 "\x01\x02\x03\x03\x00\x00\x1e\xb4" + // 0x01020303: 0x00001EB4 "\x01\x03\x03\x03\x00\x00\x1e\xb5" + // 0x01030303: 0x00001EB5 "\x1e\xa0\x03\x06\x00\x00\x1e\xb6" + // 0x1EA00306: 0x00001EB6 "\x1e\xa1\x03\x06\x00\x00\x1e\xb7" + // 0x1EA10306: 0x00001EB7 "\x00E\x03#\x00\x00\x1e\xb8" + // 0x00450323: 0x00001EB8 "\x00e\x03#\x00\x00\x1e\xb9" + // 0x00650323: 0x00001EB9 "\x00E\x03\t\x00\x00\x1e\xba" + // 0x00450309: 0x00001EBA "\x00e\x03\t\x00\x00\x1e\xbb" + // 0x00650309: 0x00001EBB "\x00E\x03\x03\x00\x00\x1e\xbc" + // 0x00450303: 0x00001EBC "\x00e\x03\x03\x00\x00\x1e\xbd" + // 0x00650303: 0x00001EBD "\x00\xca\x03\x01\x00\x00\x1e\xbe" + // 0x00CA0301: 0x00001EBE "\x00\xea\x03\x01\x00\x00\x1e\xbf" + // 0x00EA0301: 0x00001EBF "\x00\xca\x03\x00\x00\x00\x1e\xc0" + // 0x00CA0300: 0x00001EC0 "\x00\xea\x03\x00\x00\x00\x1e\xc1" + // 0x00EA0300: 0x00001EC1 "\x00\xca\x03\t\x00\x00\x1e\xc2" + // 0x00CA0309: 0x00001EC2 "\x00\xea\x03\t\x00\x00\x1e\xc3" + // 0x00EA0309: 0x00001EC3 "\x00\xca\x03\x03\x00\x00\x1e\xc4" + // 0x00CA0303: 0x00001EC4 "\x00\xea\x03\x03\x00\x00\x1e\xc5" + // 0x00EA0303: 0x00001EC5 "\x1e\xb8\x03\x02\x00\x00\x1e\xc6" + // 0x1EB80302: 0x00001EC6 "\x1e\xb9\x03\x02\x00\x00\x1e\xc7" + // 0x1EB90302: 0x00001EC7 "\x00I\x03\t\x00\x00\x1e\xc8" + // 0x00490309: 0x00001EC8 "\x00i\x03\t\x00\x00\x1e\xc9" + // 0x00690309: 0x00001EC9 "\x00I\x03#\x00\x00\x1e\xca" + // 0x00490323: 0x00001ECA "\x00i\x03#\x00\x00\x1e\xcb" + // 0x00690323: 0x00001ECB "\x00O\x03#\x00\x00\x1e\xcc" + // 0x004F0323: 0x00001ECC "\x00o\x03#\x00\x00\x1e\xcd" + // 0x006F0323: 0x00001ECD "\x00O\x03\t\x00\x00\x1e\xce" + // 0x004F0309: 0x00001ECE "\x00o\x03\t\x00\x00\x1e\xcf" + // 0x006F0309: 0x00001ECF "\x00\xd4\x03\x01\x00\x00\x1e\xd0" + // 0x00D40301: 0x00001ED0 "\x00\xf4\x03\x01\x00\x00\x1e\xd1" + // 0x00F40301: 0x00001ED1 "\x00\xd4\x03\x00\x00\x00\x1e\xd2" + // 0x00D40300: 0x00001ED2 "\x00\xf4\x03\x00\x00\x00\x1e\xd3" + // 0x00F40300: 0x00001ED3 "\x00\xd4\x03\t\x00\x00\x1e\xd4" + // 0x00D40309: 0x00001ED4 "\x00\xf4\x03\t\x00\x00\x1e\xd5" + // 0x00F40309: 0x00001ED5 "\x00\xd4\x03\x03\x00\x00\x1e\xd6" + // 0x00D40303: 0x00001ED6 "\x00\xf4\x03\x03\x00\x00\x1e\xd7" + // 0x00F40303: 0x00001ED7 "\x1e\xcc\x03\x02\x00\x00\x1e\xd8" + // 0x1ECC0302: 0x00001ED8 "\x1e\xcd\x03\x02\x00\x00\x1e\xd9" + // 0x1ECD0302: 0x00001ED9 "\x01\xa0\x03\x01\x00\x00\x1e\xda" + // 0x01A00301: 0x00001EDA "\x01\xa1\x03\x01\x00\x00\x1e\xdb" + // 0x01A10301: 0x00001EDB "\x01\xa0\x03\x00\x00\x00\x1e\xdc" + // 0x01A00300: 0x00001EDC "\x01\xa1\x03\x00\x00\x00\x1e\xdd" + // 0x01A10300: 0x00001EDD "\x01\xa0\x03\t\x00\x00\x1e\xde" + // 0x01A00309: 0x00001EDE "\x01\xa1\x03\t\x00\x00\x1e\xdf" + // 0x01A10309: 0x00001EDF "\x01\xa0\x03\x03\x00\x00\x1e\xe0" + // 0x01A00303: 0x00001EE0 "\x01\xa1\x03\x03\x00\x00\x1e\xe1" + // 0x01A10303: 0x00001EE1 "\x01\xa0\x03#\x00\x00\x1e\xe2" + // 0x01A00323: 0x00001EE2 "\x01\xa1\x03#\x00\x00\x1e\xe3" + // 0x01A10323: 0x00001EE3 "\x00U\x03#\x00\x00\x1e\xe4" + // 0x00550323: 0x00001EE4 "\x00u\x03#\x00\x00\x1e\xe5" + // 0x00750323: 0x00001EE5 "\x00U\x03\t\x00\x00\x1e\xe6" + // 0x00550309: 0x00001EE6 "\x00u\x03\t\x00\x00\x1e\xe7" + // 0x00750309: 0x00001EE7 "\x01\xaf\x03\x01\x00\x00\x1e\xe8" + // 0x01AF0301: 0x00001EE8 "\x01\xb0\x03\x01\x00\x00\x1e\xe9" + // 0x01B00301: 0x00001EE9 "\x01\xaf\x03\x00\x00\x00\x1e\xea" + // 0x01AF0300: 0x00001EEA "\x01\xb0\x03\x00\x00\x00\x1e\xeb" + // 0x01B00300: 0x00001EEB "\x01\xaf\x03\t\x00\x00\x1e\xec" + // 0x01AF0309: 0x00001EEC "\x01\xb0\x03\t\x00\x00\x1e\xed" + // 0x01B00309: 0x00001EED "\x01\xaf\x03\x03\x00\x00\x1e\xee" + // 0x01AF0303: 0x00001EEE "\x01\xb0\x03\x03\x00\x00\x1e\xef" + // 0x01B00303: 0x00001EEF "\x01\xaf\x03#\x00\x00\x1e\xf0" + // 0x01AF0323: 0x00001EF0 "\x01\xb0\x03#\x00\x00\x1e\xf1" + // 0x01B00323: 0x00001EF1 "\x00Y\x03\x00\x00\x00\x1e\xf2" + // 0x00590300: 0x00001EF2 "\x00y\x03\x00\x00\x00\x1e\xf3" + // 0x00790300: 0x00001EF3 "\x00Y\x03#\x00\x00\x1e\xf4" + // 0x00590323: 0x00001EF4 "\x00y\x03#\x00\x00\x1e\xf5" + // 0x00790323: 0x00001EF5 "\x00Y\x03\t\x00\x00\x1e\xf6" + // 0x00590309: 0x00001EF6 "\x00y\x03\t\x00\x00\x1e\xf7" + // 0x00790309: 0x00001EF7 "\x00Y\x03\x03\x00\x00\x1e\xf8" + // 0x00590303: 0x00001EF8 "\x00y\x03\x03\x00\x00\x1e\xf9" + // 0x00790303: 0x00001EF9 "\x03\xb1\x03\x13\x00\x00\x1f\x00" + // 0x03B10313: 0x00001F00 "\x03\xb1\x03\x14\x00\x00\x1f\x01" + // 0x03B10314: 0x00001F01 "\x1f\x00\x03\x00\x00\x00\x1f\x02" + // 0x1F000300: 0x00001F02 "\x1f\x01\x03\x00\x00\x00\x1f\x03" + // 0x1F010300: 0x00001F03 "\x1f\x00\x03\x01\x00\x00\x1f\x04" + // 0x1F000301: 0x00001F04 "\x1f\x01\x03\x01\x00\x00\x1f\x05" + // 0x1F010301: 0x00001F05 "\x1f\x00\x03B\x00\x00\x1f\x06" + // 0x1F000342: 0x00001F06 "\x1f\x01\x03B\x00\x00\x1f\a" + // 0x1F010342: 0x00001F07 "\x03\x91\x03\x13\x00\x00\x1f\b" + // 0x03910313: 0x00001F08 "\x03\x91\x03\x14\x00\x00\x1f\t" + // 0x03910314: 0x00001F09 "\x1f\b\x03\x00\x00\x00\x1f\n" + // 0x1F080300: 0x00001F0A "\x1f\t\x03\x00\x00\x00\x1f\v" + // 0x1F090300: 0x00001F0B "\x1f\b\x03\x01\x00\x00\x1f\f" + // 0x1F080301: 0x00001F0C "\x1f\t\x03\x01\x00\x00\x1f\r" + // 0x1F090301: 0x00001F0D "\x1f\b\x03B\x00\x00\x1f\x0e" + // 0x1F080342: 0x00001F0E "\x1f\t\x03B\x00\x00\x1f\x0f" + // 0x1F090342: 0x00001F0F "\x03\xb5\x03\x13\x00\x00\x1f\x10" + // 0x03B50313: 0x00001F10 "\x03\xb5\x03\x14\x00\x00\x1f\x11" + // 0x03B50314: 0x00001F11 "\x1f\x10\x03\x00\x00\x00\x1f\x12" + // 0x1F100300: 0x00001F12 "\x1f\x11\x03\x00\x00\x00\x1f\x13" + // 0x1F110300: 0x00001F13 "\x1f\x10\x03\x01\x00\x00\x1f\x14" + // 0x1F100301: 0x00001F14 "\x1f\x11\x03\x01\x00\x00\x1f\x15" + // 0x1F110301: 0x00001F15 "\x03\x95\x03\x13\x00\x00\x1f\x18" + // 0x03950313: 0x00001F18 "\x03\x95\x03\x14\x00\x00\x1f\x19" + // 0x03950314: 0x00001F19 "\x1f\x18\x03\x00\x00\x00\x1f\x1a" + // 0x1F180300: 0x00001F1A "\x1f\x19\x03\x00\x00\x00\x1f\x1b" + // 0x1F190300: 0x00001F1B "\x1f\x18\x03\x01\x00\x00\x1f\x1c" + // 0x1F180301: 0x00001F1C "\x1f\x19\x03\x01\x00\x00\x1f\x1d" + // 0x1F190301: 0x00001F1D "\x03\xb7\x03\x13\x00\x00\x1f " + // 0x03B70313: 0x00001F20 "\x03\xb7\x03\x14\x00\x00\x1f!" + // 0x03B70314: 0x00001F21 "\x1f \x03\x00\x00\x00\x1f\"" + // 0x1F200300: 0x00001F22 "\x1f!\x03\x00\x00\x00\x1f#" + // 0x1F210300: 0x00001F23 "\x1f \x03\x01\x00\x00\x1f$" + // 0x1F200301: 0x00001F24 "\x1f!\x03\x01\x00\x00\x1f%" + // 0x1F210301: 0x00001F25 "\x1f \x03B\x00\x00\x1f&" + // 0x1F200342: 0x00001F26 "\x1f!\x03B\x00\x00\x1f'" + // 0x1F210342: 0x00001F27 "\x03\x97\x03\x13\x00\x00\x1f(" + // 0x03970313: 0x00001F28 "\x03\x97\x03\x14\x00\x00\x1f)" + // 0x03970314: 0x00001F29 "\x1f(\x03\x00\x00\x00\x1f*" + // 0x1F280300: 0x00001F2A "\x1f)\x03\x00\x00\x00\x1f+" + // 0x1F290300: 0x00001F2B "\x1f(\x03\x01\x00\x00\x1f," + // 0x1F280301: 0x00001F2C "\x1f)\x03\x01\x00\x00\x1f-" + // 0x1F290301: 0x00001F2D "\x1f(\x03B\x00\x00\x1f." + // 0x1F280342: 0x00001F2E "\x1f)\x03B\x00\x00\x1f/" + // 0x1F290342: 0x00001F2F "\x03\xb9\x03\x13\x00\x00\x1f0" + // 0x03B90313: 0x00001F30 "\x03\xb9\x03\x14\x00\x00\x1f1" + // 0x03B90314: 0x00001F31 "\x1f0\x03\x00\x00\x00\x1f2" + // 0x1F300300: 0x00001F32 "\x1f1\x03\x00\x00\x00\x1f3" + // 0x1F310300: 0x00001F33 "\x1f0\x03\x01\x00\x00\x1f4" + // 0x1F300301: 0x00001F34 "\x1f1\x03\x01\x00\x00\x1f5" + // 0x1F310301: 0x00001F35 "\x1f0\x03B\x00\x00\x1f6" + // 0x1F300342: 0x00001F36 "\x1f1\x03B\x00\x00\x1f7" + // 0x1F310342: 0x00001F37 "\x03\x99\x03\x13\x00\x00\x1f8" + // 0x03990313: 0x00001F38 "\x03\x99\x03\x14\x00\x00\x1f9" + // 0x03990314: 0x00001F39 "\x1f8\x03\x00\x00\x00\x1f:" + // 0x1F380300: 0x00001F3A "\x1f9\x03\x00\x00\x00\x1f;" + // 0x1F390300: 0x00001F3B "\x1f8\x03\x01\x00\x00\x1f<" + // 0x1F380301: 0x00001F3C "\x1f9\x03\x01\x00\x00\x1f=" + // 0x1F390301: 0x00001F3D "\x1f8\x03B\x00\x00\x1f>" + // 0x1F380342: 0x00001F3E "\x1f9\x03B\x00\x00\x1f?" + // 0x1F390342: 0x00001F3F "\x03\xbf\x03\x13\x00\x00\x1f@" + // 0x03BF0313: 0x00001F40 "\x03\xbf\x03\x14\x00\x00\x1fA" + // 0x03BF0314: 0x00001F41 "\x1f@\x03\x00\x00\x00\x1fB" + // 0x1F400300: 0x00001F42 "\x1fA\x03\x00\x00\x00\x1fC" + // 0x1F410300: 0x00001F43 "\x1f@\x03\x01\x00\x00\x1fD" + // 0x1F400301: 0x00001F44 "\x1fA\x03\x01\x00\x00\x1fE" + // 0x1F410301: 0x00001F45 "\x03\x9f\x03\x13\x00\x00\x1fH" + // 0x039F0313: 0x00001F48 "\x03\x9f\x03\x14\x00\x00\x1fI" + // 0x039F0314: 0x00001F49 "\x1fH\x03\x00\x00\x00\x1fJ" + // 0x1F480300: 0x00001F4A "\x1fI\x03\x00\x00\x00\x1fK" + // 0x1F490300: 0x00001F4B "\x1fH\x03\x01\x00\x00\x1fL" + // 0x1F480301: 0x00001F4C "\x1fI\x03\x01\x00\x00\x1fM" + // 0x1F490301: 0x00001F4D "\x03\xc5\x03\x13\x00\x00\x1fP" + // 0x03C50313: 0x00001F50 "\x03\xc5\x03\x14\x00\x00\x1fQ" + // 0x03C50314: 0x00001F51 "\x1fP\x03\x00\x00\x00\x1fR" + // 0x1F500300: 0x00001F52 "\x1fQ\x03\x00\x00\x00\x1fS" + // 0x1F510300: 0x00001F53 "\x1fP\x03\x01\x00\x00\x1fT" + // 0x1F500301: 0x00001F54 "\x1fQ\x03\x01\x00\x00\x1fU" + // 0x1F510301: 0x00001F55 "\x1fP\x03B\x00\x00\x1fV" + // 0x1F500342: 0x00001F56 "\x1fQ\x03B\x00\x00\x1fW" + // 0x1F510342: 0x00001F57 "\x03\xa5\x03\x14\x00\x00\x1fY" + // 0x03A50314: 0x00001F59 "\x1fY\x03\x00\x00\x00\x1f[" + // 0x1F590300: 0x00001F5B "\x1fY\x03\x01\x00\x00\x1f]" + // 0x1F590301: 0x00001F5D "\x1fY\x03B\x00\x00\x1f_" + // 0x1F590342: 0x00001F5F "\x03\xc9\x03\x13\x00\x00\x1f`" + // 0x03C90313: 0x00001F60 "\x03\xc9\x03\x14\x00\x00\x1fa" + // 0x03C90314: 0x00001F61 "\x1f`\x03\x00\x00\x00\x1fb" + // 0x1F600300: 0x00001F62 "\x1fa\x03\x00\x00\x00\x1fc" + // 0x1F610300: 0x00001F63 "\x1f`\x03\x01\x00\x00\x1fd" + // 0x1F600301: 0x00001F64 "\x1fa\x03\x01\x00\x00\x1fe" + // 0x1F610301: 0x00001F65 "\x1f`\x03B\x00\x00\x1ff" + // 0x1F600342: 0x00001F66 "\x1fa\x03B\x00\x00\x1fg" + // 0x1F610342: 0x00001F67 "\x03\xa9\x03\x13\x00\x00\x1fh" + // 0x03A90313: 0x00001F68 "\x03\xa9\x03\x14\x00\x00\x1fi" + // 0x03A90314: 0x00001F69 "\x1fh\x03\x00\x00\x00\x1fj" + // 0x1F680300: 0x00001F6A "\x1fi\x03\x00\x00\x00\x1fk" + // 0x1F690300: 0x00001F6B "\x1fh\x03\x01\x00\x00\x1fl" + // 0x1F680301: 0x00001F6C "\x1fi\x03\x01\x00\x00\x1fm" + // 0x1F690301: 0x00001F6D "\x1fh\x03B\x00\x00\x1fn" + // 0x1F680342: 0x00001F6E "\x1fi\x03B\x00\x00\x1fo" + // 0x1F690342: 0x00001F6F "\x03\xb1\x03\x00\x00\x00\x1fp" + // 0x03B10300: 0x00001F70 "\x03\xb5\x03\x00\x00\x00\x1fr" + // 0x03B50300: 0x00001F72 "\x03\xb7\x03\x00\x00\x00\x1ft" + // 0x03B70300: 0x00001F74 "\x03\xb9\x03\x00\x00\x00\x1fv" + // 0x03B90300: 0x00001F76 "\x03\xbf\x03\x00\x00\x00\x1fx" + // 0x03BF0300: 0x00001F78 "\x03\xc5\x03\x00\x00\x00\x1fz" + // 0x03C50300: 0x00001F7A "\x03\xc9\x03\x00\x00\x00\x1f|" + // 0x03C90300: 0x00001F7C "\x1f\x00\x03E\x00\x00\x1f\x80" + // 0x1F000345: 0x00001F80 "\x1f\x01\x03E\x00\x00\x1f\x81" + // 0x1F010345: 0x00001F81 "\x1f\x02\x03E\x00\x00\x1f\x82" + // 0x1F020345: 0x00001F82 "\x1f\x03\x03E\x00\x00\x1f\x83" + // 0x1F030345: 0x00001F83 "\x1f\x04\x03E\x00\x00\x1f\x84" + // 0x1F040345: 0x00001F84 "\x1f\x05\x03E\x00\x00\x1f\x85" + // 0x1F050345: 0x00001F85 "\x1f\x06\x03E\x00\x00\x1f\x86" + // 0x1F060345: 0x00001F86 "\x1f\a\x03E\x00\x00\x1f\x87" + // 0x1F070345: 0x00001F87 "\x1f\b\x03E\x00\x00\x1f\x88" + // 0x1F080345: 0x00001F88 "\x1f\t\x03E\x00\x00\x1f\x89" + // 0x1F090345: 0x00001F89 "\x1f\n\x03E\x00\x00\x1f\x8a" + // 0x1F0A0345: 0x00001F8A "\x1f\v\x03E\x00\x00\x1f\x8b" + // 0x1F0B0345: 0x00001F8B "\x1f\f\x03E\x00\x00\x1f\x8c" + // 0x1F0C0345: 0x00001F8C "\x1f\r\x03E\x00\x00\x1f\x8d" + // 0x1F0D0345: 0x00001F8D "\x1f\x0e\x03E\x00\x00\x1f\x8e" + // 0x1F0E0345: 0x00001F8E "\x1f\x0f\x03E\x00\x00\x1f\x8f" + // 0x1F0F0345: 0x00001F8F "\x1f \x03E\x00\x00\x1f\x90" + // 0x1F200345: 0x00001F90 "\x1f!\x03E\x00\x00\x1f\x91" + // 0x1F210345: 0x00001F91 "\x1f\"\x03E\x00\x00\x1f\x92" + // 0x1F220345: 0x00001F92 "\x1f#\x03E\x00\x00\x1f\x93" + // 0x1F230345: 0x00001F93 "\x1f$\x03E\x00\x00\x1f\x94" + // 0x1F240345: 0x00001F94 "\x1f%\x03E\x00\x00\x1f\x95" + // 0x1F250345: 0x00001F95 "\x1f&\x03E\x00\x00\x1f\x96" + // 0x1F260345: 0x00001F96 "\x1f'\x03E\x00\x00\x1f\x97" + // 0x1F270345: 0x00001F97 "\x1f(\x03E\x00\x00\x1f\x98" + // 0x1F280345: 0x00001F98 "\x1f)\x03E\x00\x00\x1f\x99" + // 0x1F290345: 0x00001F99 "\x1f*\x03E\x00\x00\x1f\x9a" + // 0x1F2A0345: 0x00001F9A "\x1f+\x03E\x00\x00\x1f\x9b" + // 0x1F2B0345: 0x00001F9B "\x1f,\x03E\x00\x00\x1f\x9c" + // 0x1F2C0345: 0x00001F9C "\x1f-\x03E\x00\x00\x1f\x9d" + // 0x1F2D0345: 0x00001F9D "\x1f.\x03E\x00\x00\x1f\x9e" + // 0x1F2E0345: 0x00001F9E "\x1f/\x03E\x00\x00\x1f\x9f" + // 0x1F2F0345: 0x00001F9F "\x1f`\x03E\x00\x00\x1f\xa0" + // 0x1F600345: 0x00001FA0 "\x1fa\x03E\x00\x00\x1f\xa1" + // 0x1F610345: 0x00001FA1 "\x1fb\x03E\x00\x00\x1f\xa2" + // 0x1F620345: 0x00001FA2 "\x1fc\x03E\x00\x00\x1f\xa3" + // 0x1F630345: 0x00001FA3 "\x1fd\x03E\x00\x00\x1f\xa4" + // 0x1F640345: 0x00001FA4 "\x1fe\x03E\x00\x00\x1f\xa5" + // 0x1F650345: 0x00001FA5 "\x1ff\x03E\x00\x00\x1f\xa6" + // 0x1F660345: 0x00001FA6 "\x1fg\x03E\x00\x00\x1f\xa7" + // 0x1F670345: 0x00001FA7 "\x1fh\x03E\x00\x00\x1f\xa8" + // 0x1F680345: 0x00001FA8 "\x1fi\x03E\x00\x00\x1f\xa9" + // 0x1F690345: 0x00001FA9 "\x1fj\x03E\x00\x00\x1f\xaa" + // 0x1F6A0345: 0x00001FAA "\x1fk\x03E\x00\x00\x1f\xab" + // 0x1F6B0345: 0x00001FAB "\x1fl\x03E\x00\x00\x1f\xac" + // 0x1F6C0345: 0x00001FAC "\x1fm\x03E\x00\x00\x1f\xad" + // 0x1F6D0345: 0x00001FAD "\x1fn\x03E\x00\x00\x1f\xae" + // 0x1F6E0345: 0x00001FAE "\x1fo\x03E\x00\x00\x1f\xaf" + // 0x1F6F0345: 0x00001FAF "\x03\xb1\x03\x06\x00\x00\x1f\xb0" + // 0x03B10306: 0x00001FB0 "\x03\xb1\x03\x04\x00\x00\x1f\xb1" + // 0x03B10304: 0x00001FB1 "\x1fp\x03E\x00\x00\x1f\xb2" + // 0x1F700345: 0x00001FB2 "\x03\xb1\x03E\x00\x00\x1f\xb3" + // 0x03B10345: 0x00001FB3 "\x03\xac\x03E\x00\x00\x1f\xb4" + // 0x03AC0345: 0x00001FB4 "\x03\xb1\x03B\x00\x00\x1f\xb6" + // 0x03B10342: 0x00001FB6 "\x1f\xb6\x03E\x00\x00\x1f\xb7" + // 0x1FB60345: 0x00001FB7 "\x03\x91\x03\x06\x00\x00\x1f\xb8" + // 0x03910306: 0x00001FB8 "\x03\x91\x03\x04\x00\x00\x1f\xb9" + // 0x03910304: 0x00001FB9 "\x03\x91\x03\x00\x00\x00\x1f\xba" + // 0x03910300: 0x00001FBA "\x03\x91\x03E\x00\x00\x1f\xbc" + // 0x03910345: 0x00001FBC "\x00\xa8\x03B\x00\x00\x1f\xc1" + // 0x00A80342: 0x00001FC1 "\x1ft\x03E\x00\x00\x1f\xc2" + // 0x1F740345: 0x00001FC2 "\x03\xb7\x03E\x00\x00\x1f\xc3" + // 0x03B70345: 0x00001FC3 "\x03\xae\x03E\x00\x00\x1f\xc4" + // 0x03AE0345: 0x00001FC4 "\x03\xb7\x03B\x00\x00\x1f\xc6" + // 0x03B70342: 0x00001FC6 "\x1f\xc6\x03E\x00\x00\x1f\xc7" + // 0x1FC60345: 0x00001FC7 "\x03\x95\x03\x00\x00\x00\x1f\xc8" + // 0x03950300: 0x00001FC8 "\x03\x97\x03\x00\x00\x00\x1f\xca" + // 0x03970300: 0x00001FCA "\x03\x97\x03E\x00\x00\x1f\xcc" + // 0x03970345: 0x00001FCC "\x1f\xbf\x03\x00\x00\x00\x1f\xcd" + // 0x1FBF0300: 0x00001FCD "\x1f\xbf\x03\x01\x00\x00\x1f\xce" + // 0x1FBF0301: 0x00001FCE "\x1f\xbf\x03B\x00\x00\x1f\xcf" + // 0x1FBF0342: 0x00001FCF "\x03\xb9\x03\x06\x00\x00\x1f\xd0" + // 0x03B90306: 0x00001FD0 "\x03\xb9\x03\x04\x00\x00\x1f\xd1" + // 0x03B90304: 0x00001FD1 "\x03\xca\x03\x00\x00\x00\x1f\xd2" + // 0x03CA0300: 0x00001FD2 "\x03\xb9\x03B\x00\x00\x1f\xd6" + // 0x03B90342: 0x00001FD6 "\x03\xca\x03B\x00\x00\x1f\xd7" + // 0x03CA0342: 0x00001FD7 "\x03\x99\x03\x06\x00\x00\x1f\xd8" + // 0x03990306: 0x00001FD8 "\x03\x99\x03\x04\x00\x00\x1f\xd9" + // 0x03990304: 0x00001FD9 "\x03\x99\x03\x00\x00\x00\x1f\xda" + // 0x03990300: 0x00001FDA "\x1f\xfe\x03\x00\x00\x00\x1f\xdd" + // 0x1FFE0300: 0x00001FDD "\x1f\xfe\x03\x01\x00\x00\x1f\xde" + // 0x1FFE0301: 0x00001FDE "\x1f\xfe\x03B\x00\x00\x1f\xdf" + // 0x1FFE0342: 0x00001FDF "\x03\xc5\x03\x06\x00\x00\x1f\xe0" + // 0x03C50306: 0x00001FE0 "\x03\xc5\x03\x04\x00\x00\x1f\xe1" + // 0x03C50304: 0x00001FE1 "\x03\xcb\x03\x00\x00\x00\x1f\xe2" + // 0x03CB0300: 0x00001FE2 "\x03\xc1\x03\x13\x00\x00\x1f\xe4" + // 0x03C10313: 0x00001FE4 "\x03\xc1\x03\x14\x00\x00\x1f\xe5" + // 0x03C10314: 0x00001FE5 "\x03\xc5\x03B\x00\x00\x1f\xe6" + // 0x03C50342: 0x00001FE6 "\x03\xcb\x03B\x00\x00\x1f\xe7" + // 0x03CB0342: 0x00001FE7 "\x03\xa5\x03\x06\x00\x00\x1f\xe8" + // 0x03A50306: 0x00001FE8 "\x03\xa5\x03\x04\x00\x00\x1f\xe9" + // 0x03A50304: 0x00001FE9 "\x03\xa5\x03\x00\x00\x00\x1f\xea" + // 0x03A50300: 0x00001FEA "\x03\xa1\x03\x14\x00\x00\x1f\xec" + // 0x03A10314: 0x00001FEC "\x00\xa8\x03\x00\x00\x00\x1f\xed" + // 0x00A80300: 0x00001FED "\x1f|\x03E\x00\x00\x1f\xf2" + // 0x1F7C0345: 0x00001FF2 "\x03\xc9\x03E\x00\x00\x1f\xf3" + // 0x03C90345: 0x00001FF3 "\x03\xce\x03E\x00\x00\x1f\xf4" + // 0x03CE0345: 0x00001FF4 "\x03\xc9\x03B\x00\x00\x1f\xf6" + // 0x03C90342: 0x00001FF6 "\x1f\xf6\x03E\x00\x00\x1f\xf7" + // 0x1FF60345: 0x00001FF7 "\x03\x9f\x03\x00\x00\x00\x1f\xf8" + // 0x039F0300: 0x00001FF8 "\x03\xa9\x03\x00\x00\x00\x1f\xfa" + // 0x03A90300: 0x00001FFA "\x03\xa9\x03E\x00\x00\x1f\xfc" + // 0x03A90345: 0x00001FFC "!\x90\x038\x00\x00!\x9a" + // 0x21900338: 0x0000219A "!\x92\x038\x00\x00!\x9b" + // 0x21920338: 0x0000219B "!\x94\x038\x00\x00!\xae" + // 0x21940338: 0x000021AE "!\xd0\x038\x00\x00!\xcd" + // 0x21D00338: 0x000021CD "!\xd4\x038\x00\x00!\xce" + // 0x21D40338: 0x000021CE "!\xd2\x038\x00\x00!\xcf" + // 0x21D20338: 0x000021CF "\"\x03\x038\x00\x00\"\x04" + // 0x22030338: 0x00002204 "\"\b\x038\x00\x00\"\t" + // 0x22080338: 0x00002209 "\"\v\x038\x00\x00\"\f" + // 0x220B0338: 0x0000220C "\"#\x038\x00\x00\"$" + // 0x22230338: 0x00002224 "\"%\x038\x00\x00\"&" + // 0x22250338: 0x00002226 "\"<\x038\x00\x00\"A" + // 0x223C0338: 0x00002241 "\"C\x038\x00\x00\"D" + // 0x22430338: 0x00002244 "\"E\x038\x00\x00\"G" + // 0x22450338: 0x00002247 "\"H\x038\x00\x00\"I" + // 0x22480338: 0x00002249 "\x00=\x038\x00\x00\"`" + // 0x003D0338: 0x00002260 "\"a\x038\x00\x00\"b" + // 0x22610338: 0x00002262 "\"M\x038\x00\x00\"m" + // 0x224D0338: 0x0000226D "\x00<\x038\x00\x00\"n" + // 0x003C0338: 0x0000226E "\x00>\x038\x00\x00\"o" + // 0x003E0338: 0x0000226F "\"d\x038\x00\x00\"p" + // 0x22640338: 0x00002270 "\"e\x038\x00\x00\"q" + // 0x22650338: 0x00002271 "\"r\x038\x00\x00\"t" + // 0x22720338: 0x00002274 "\"s\x038\x00\x00\"u" + // 0x22730338: 0x00002275 "\"v\x038\x00\x00\"x" + // 0x22760338: 0x00002278 "\"w\x038\x00\x00\"y" + // 0x22770338: 0x00002279 "\"z\x038\x00\x00\"\x80" + // 0x227A0338: 0x00002280 "\"{\x038\x00\x00\"\x81" + // 0x227B0338: 0x00002281 "\"\x82\x038\x00\x00\"\x84" + // 0x22820338: 0x00002284 "\"\x83\x038\x00\x00\"\x85" + // 0x22830338: 0x00002285 "\"\x86\x038\x00\x00\"\x88" + // 0x22860338: 0x00002288 "\"\x87\x038\x00\x00\"\x89" + // 0x22870338: 0x00002289 "\"\xa2\x038\x00\x00\"\xac" + // 0x22A20338: 0x000022AC "\"\xa8\x038\x00\x00\"\xad" + // 0x22A80338: 0x000022AD "\"\xa9\x038\x00\x00\"\xae" + // 0x22A90338: 0x000022AE "\"\xab\x038\x00\x00\"\xaf" + // 0x22AB0338: 0x000022AF "\"|\x038\x00\x00\"\xe0" + // 0x227C0338: 0x000022E0 "\"}\x038\x00\x00\"\xe1" + // 0x227D0338: 0x000022E1 "\"\x91\x038\x00\x00\"\xe2" + // 0x22910338: 0x000022E2 "\"\x92\x038\x00\x00\"\xe3" + // 0x22920338: 0x000022E3 "\"\xb2\x038\x00\x00\"\xea" + // 0x22B20338: 0x000022EA "\"\xb3\x038\x00\x00\"\xeb" + // 0x22B30338: 0x000022EB "\"\xb4\x038\x00\x00\"\xec" + // 0x22B40338: 0x000022EC "\"\xb5\x038\x00\x00\"\xed" + // 0x22B50338: 0x000022ED "0K0\x99\x00\x000L" + // 0x304B3099: 0x0000304C "0M0\x99\x00\x000N" + // 0x304D3099: 0x0000304E "0O0\x99\x00\x000P" + // 0x304F3099: 0x00003050 "0Q0\x99\x00\x000R" + // 0x30513099: 0x00003052 "0S0\x99\x00\x000T" + // 0x30533099: 0x00003054 "0U0\x99\x00\x000V" + // 0x30553099: 0x00003056 "0W0\x99\x00\x000X" + // 0x30573099: 0x00003058 "0Y0\x99\x00\x000Z" + // 0x30593099: 0x0000305A "0[0\x99\x00\x000\\" + // 0x305B3099: 0x0000305C "0]0\x99\x00\x000^" + // 0x305D3099: 0x0000305E "0_0\x99\x00\x000`" + // 0x305F3099: 0x00003060 "0a0\x99\x00\x000b" + // 0x30613099: 0x00003062 "0d0\x99\x00\x000e" + // 0x30643099: 0x00003065 "0f0\x99\x00\x000g" + // 0x30663099: 0x00003067 "0h0\x99\x00\x000i" + // 0x30683099: 0x00003069 "0o0\x99\x00\x000p" + // 0x306F3099: 0x00003070 "0o0\x9a\x00\x000q" + // 0x306F309A: 0x00003071 "0r0\x99\x00\x000s" + // 0x30723099: 0x00003073 "0r0\x9a\x00\x000t" + // 0x3072309A: 0x00003074 "0u0\x99\x00\x000v" + // 0x30753099: 0x00003076 "0u0\x9a\x00\x000w" + // 0x3075309A: 0x00003077 "0x0\x99\x00\x000y" + // 0x30783099: 0x00003079 "0x0\x9a\x00\x000z" + // 0x3078309A: 0x0000307A "0{0\x99\x00\x000|" + // 0x307B3099: 0x0000307C "0{0\x9a\x00\x000}" + // 0x307B309A: 0x0000307D "0F0\x99\x00\x000\x94" + // 0x30463099: 0x00003094 "0\x9d0\x99\x00\x000\x9e" + // 0x309D3099: 0x0000309E "0\xab0\x99\x00\x000\xac" + // 0x30AB3099: 0x000030AC "0\xad0\x99\x00\x000\xae" + // 0x30AD3099: 0x000030AE "0\xaf0\x99\x00\x000\xb0" + // 0x30AF3099: 0x000030B0 "0\xb10\x99\x00\x000\xb2" + // 0x30B13099: 0x000030B2 "0\xb30\x99\x00\x000\xb4" + // 0x30B33099: 0x000030B4 "0\xb50\x99\x00\x000\xb6" + // 0x30B53099: 0x000030B6 "0\xb70\x99\x00\x000\xb8" + // 0x30B73099: 0x000030B8 "0\xb90\x99\x00\x000\xba" + // 0x30B93099: 0x000030BA "0\xbb0\x99\x00\x000\xbc" + // 0x30BB3099: 0x000030BC "0\xbd0\x99\x00\x000\xbe" + // 0x30BD3099: 0x000030BE "0\xbf0\x99\x00\x000\xc0" + // 0x30BF3099: 0x000030C0 "0\xc10\x99\x00\x000\xc2" + // 0x30C13099: 0x000030C2 "0\xc40\x99\x00\x000\xc5" + // 0x30C43099: 0x000030C5 "0\xc60\x99\x00\x000\xc7" + // 0x30C63099: 0x000030C7 "0\xc80\x99\x00\x000\xc9" + // 0x30C83099: 0x000030C9 "0\xcf0\x99\x00\x000\xd0" + // 0x30CF3099: 0x000030D0 "0\xcf0\x9a\x00\x000\xd1" + // 0x30CF309A: 0x000030D1 "0\xd20\x99\x00\x000\xd3" + // 0x30D23099: 0x000030D3 "0\xd20\x9a\x00\x000\xd4" + // 0x30D2309A: 0x000030D4 "0\xd50\x99\x00\x000\xd6" + // 0x30D53099: 0x000030D6 "0\xd50\x9a\x00\x000\xd7" + // 0x30D5309A: 0x000030D7 "0\xd80\x99\x00\x000\xd9" + // 0x30D83099: 0x000030D9 "0\xd80\x9a\x00\x000\xda" + // 0x30D8309A: 0x000030DA "0\xdb0\x99\x00\x000\xdc" + // 0x30DB3099: 0x000030DC "0\xdb0\x9a\x00\x000\xdd" + // 0x30DB309A: 0x000030DD "0\xa60\x99\x00\x000\xf4" + // 0x30A63099: 0x000030F4 "0\xef0\x99\x00\x000\xf7" + // 0x30EF3099: 0x000030F7 "0\xf00\x99\x00\x000\xf8" + // 0x30F03099: 0x000030F8 "0\xf10\x99\x00\x000\xf9" + // 0x30F13099: 0x000030F9 "0\xf20\x99\x00\x000\xfa" + // 0x30F23099: 0x000030FA "0\xfd0\x99\x00\x000\xfe" + // 0x30FD3099: 0x000030FE "\x10\x99\x10\xba\x00\x01\x10\x9a" + // 0x109910BA: 0x0001109A "\x10\x9b\x10\xba\x00\x01\x10\x9c" + // 0x109B10BA: 0x0001109C "\x10\xa5\x10\xba\x00\x01\x10\xab" + // 0x10A510BA: 0x000110AB "\x111\x11'\x00\x01\x11." + // 0x11311127: 0x0001112E "\x112\x11'\x00\x01\x11/" + // 0x11321127: 0x0001112F "\x13G\x13>\x00\x01\x13K" + // 0x1347133E: 0x0001134B "\x13G\x13W\x00\x01\x13L" + // 0x13471357: 0x0001134C "\x14\xb9\x14\xba\x00\x01\x14\xbb" + // 0x14B914BA: 0x000114BB "\x14\xb9\x14\xb0\x00\x01\x14\xbc" + // 0x14B914B0: 0x000114BC "\x14\xb9\x14\xbd\x00\x01\x14\xbe" + // 0x14B914BD: 0x000114BE "\x15\xb8\x15\xaf\x00\x01\x15\xba" + // 0x15B815AF: 0x000115BA "\x15\xb9\x15\xaf\x00\x01\x15\xbb" + // 0x15B915AF: 0x000115BB "\x195\x190\x00\x01\x198" + // 0x19351930: 0x00011938 "" // Total size of tables: 56KB (57068 bytes) ================================================ FILE: vendor/golang.org/x/text/unicode/norm/tables17.0.0.go ================================================ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. //go:build go1.27 package norm import "sync" const ( // Version is the Unicode edition from which the tables are derived. Version = "17.0.0" // MaxTransformChunkSize indicates the maximum number of bytes that Transform // may need to write atomically for any Form. Making a destination buffer at // least this size ensures that Transform can always make progress and that // the user does not need to grow the buffer on an ErrShortDst. MaxTransformChunkSize = 35 + maxNonStarters*4 ) var ccc = [56]uint8{ 0, 1, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 84, 91, 103, 107, 118, 122, 129, 130, 132, 202, 214, 216, 218, 220, 222, 224, 226, 228, 230, 232, 233, 234, 240, } const ( firstMulti = 0x199A firstCCC = 0x2DD5 endMulti = 0x2EBF firstLeadingCCC = 0x4B3F firstCCCZeroExcept = 0x4C99 firstStarterWithNLead = 0x4CC0 lastDecomp = 0x4CC2 maxDecomp = 0x8000 ) // decomps: 19650 bytes var decomps = [...]byte{ // Bytes 0 - 3f 0x00, 0x41, 0x20, 0x41, 0x21, 0x41, 0x22, 0x41, 0x23, 0x41, 0x24, 0x41, 0x25, 0x41, 0x26, 0x41, 0x27, 0x41, 0x28, 0x41, 0x29, 0x41, 0x2A, 0x41, 0x2B, 0x41, 0x2C, 0x41, 0x2D, 0x41, 0x2E, 0x41, 0x2F, 0x41, 0x30, 0x41, 0x31, 0x41, 0x32, 0x41, 0x33, 0x41, 0x34, 0x41, 0x35, 0x41, 0x36, 0x41, 0x37, 0x41, 0x38, 0x41, 0x39, 0x41, 0x3A, 0x41, 0x3B, 0x41, 0x3C, 0x41, 0x3D, 0x41, 0x3E, 0x41, // Bytes 40 - 7f 0x3F, 0x41, 0x40, 0x41, 0x41, 0x41, 0x42, 0x41, 0x43, 0x41, 0x44, 0x41, 0x45, 0x41, 0x46, 0x41, 0x47, 0x41, 0x48, 0x41, 0x49, 0x41, 0x4A, 0x41, 0x4B, 0x41, 0x4C, 0x41, 0x4D, 0x41, 0x4E, 0x41, 0x4F, 0x41, 0x50, 0x41, 0x51, 0x41, 0x52, 0x41, 0x53, 0x41, 0x54, 0x41, 0x55, 0x41, 0x56, 0x41, 0x57, 0x41, 0x58, 0x41, 0x59, 0x41, 0x5A, 0x41, 0x5B, 0x41, 0x5C, 0x41, 0x5D, 0x41, 0x5E, 0x41, // Bytes 80 - bf 0x5F, 0x41, 0x60, 0x41, 0x61, 0x41, 0x62, 0x41, 0x63, 0x41, 0x64, 0x41, 0x65, 0x41, 0x66, 0x41, 0x67, 0x41, 0x68, 0x41, 0x69, 0x41, 0x6A, 0x41, 0x6B, 0x41, 0x6C, 0x41, 0x6D, 0x41, 0x6E, 0x41, 0x6F, 0x41, 0x70, 0x41, 0x71, 0x41, 0x72, 0x41, 0x73, 0x41, 0x74, 0x41, 0x75, 0x41, 0x76, 0x41, 0x77, 0x41, 0x78, 0x41, 0x79, 0x41, 0x7A, 0x41, 0x7B, 0x41, 0x7C, 0x41, 0x7D, 0x41, 0x7E, 0x42, // Bytes c0 - ff 0xC2, 0xA2, 0x42, 0xC2, 0xA3, 0x42, 0xC2, 0xA5, 0x42, 0xC2, 0xA6, 0x42, 0xC2, 0xAC, 0x42, 0xC2, 0xB7, 0x42, 0xC3, 0x86, 0x42, 0xC3, 0xA6, 0x42, 0xC3, 0xB0, 0x42, 0xC3, 0xB8, 0x42, 0xC4, 0xA6, 0x42, 0xC4, 0xA7, 0x42, 0xC4, 0xB1, 0x42, 0xC5, 0x8B, 0x42, 0xC5, 0x93, 0x42, 0xC6, 0x8E, 0x42, 0xC6, 0x90, 0x42, 0xC6, 0xAB, 0x42, 0xC7, 0x80, 0x42, 0xC7, 0x81, 0x42, 0xC7, 0x82, 0x42, 0xC8, // Bytes 100 - 13f 0xA2, 0x42, 0xC8, 0xB7, 0x42, 0xC9, 0x90, 0x42, 0xC9, 0x91, 0x42, 0xC9, 0x92, 0x42, 0xC9, 0x93, 0x42, 0xC9, 0x94, 0x42, 0xC9, 0x95, 0x42, 0xC9, 0x96, 0x42, 0xC9, 0x97, 0x42, 0xC9, 0x98, 0x42, 0xC9, 0x99, 0x42, 0xC9, 0x9B, 0x42, 0xC9, 0x9C, 0x42, 0xC9, 0x9E, 0x42, 0xC9, 0x9F, 0x42, 0xC9, 0xA0, 0x42, 0xC9, 0xA1, 0x42, 0xC9, 0xA2, 0x42, 0xC9, 0xA3, 0x42, 0xC9, 0xA4, 0x42, 0xC9, 0xA5, // Bytes 140 - 17f 0x42, 0xC9, 0xA6, 0x42, 0xC9, 0xA7, 0x42, 0xC9, 0xA8, 0x42, 0xC9, 0xA9, 0x42, 0xC9, 0xAA, 0x42, 0xC9, 0xAB, 0x42, 0xC9, 0xAC, 0x42, 0xC9, 0xAD, 0x42, 0xC9, 0xAE, 0x42, 0xC9, 0xAF, 0x42, 0xC9, 0xB0, 0x42, 0xC9, 0xB1, 0x42, 0xC9, 0xB2, 0x42, 0xC9, 0xB3, 0x42, 0xC9, 0xB4, 0x42, 0xC9, 0xB5, 0x42, 0xC9, 0xB6, 0x42, 0xC9, 0xB7, 0x42, 0xC9, 0xB8, 0x42, 0xC9, 0xB9, 0x42, 0xC9, 0xBA, 0x42, // Bytes 180 - 1bf 0xC9, 0xBB, 0x42, 0xC9, 0xBD, 0x42, 0xC9, 0xBE, 0x42, 0xCA, 0x80, 0x42, 0xCA, 0x81, 0x42, 0xCA, 0x82, 0x42, 0xCA, 0x83, 0x42, 0xCA, 0x84, 0x42, 0xCA, 0x88, 0x42, 0xCA, 0x89, 0x42, 0xCA, 0x8A, 0x42, 0xCA, 0x8B, 0x42, 0xCA, 0x8C, 0x42, 0xCA, 0x8D, 0x42, 0xCA, 0x8E, 0x42, 0xCA, 0x8F, 0x42, 0xCA, 0x90, 0x42, 0xCA, 0x91, 0x42, 0xCA, 0x92, 0x42, 0xCA, 0x95, 0x42, 0xCA, 0x98, 0x42, 0xCA, // Bytes 1c0 - 1ff 0x99, 0x42, 0xCA, 0x9B, 0x42, 0xCA, 0x9C, 0x42, 0xCA, 0x9D, 0x42, 0xCA, 0x9F, 0x42, 0xCA, 0xA1, 0x42, 0xCA, 0xA2, 0x42, 0xCA, 0xA3, 0x42, 0xCA, 0xA4, 0x42, 0xCA, 0xA5, 0x42, 0xCA, 0xA6, 0x42, 0xCA, 0xA7, 0x42, 0xCA, 0xA8, 0x42, 0xCA, 0xA9, 0x42, 0xCA, 0xAA, 0x42, 0xCA, 0xAB, 0x42, 0xCA, 0xB9, 0x42, 0xCB, 0x90, 0x42, 0xCB, 0x91, 0x42, 0xCE, 0x91, 0x42, 0xCE, 0x92, 0x42, 0xCE, 0x93, // Bytes 200 - 23f 0x42, 0xCE, 0x94, 0x42, 0xCE, 0x95, 0x42, 0xCE, 0x96, 0x42, 0xCE, 0x97, 0x42, 0xCE, 0x98, 0x42, 0xCE, 0x99, 0x42, 0xCE, 0x9A, 0x42, 0xCE, 0x9B, 0x42, 0xCE, 0x9C, 0x42, 0xCE, 0x9D, 0x42, 0xCE, 0x9E, 0x42, 0xCE, 0x9F, 0x42, 0xCE, 0xA0, 0x42, 0xCE, 0xA1, 0x42, 0xCE, 0xA3, 0x42, 0xCE, 0xA4, 0x42, 0xCE, 0xA5, 0x42, 0xCE, 0xA6, 0x42, 0xCE, 0xA7, 0x42, 0xCE, 0xA8, 0x42, 0xCE, 0xA9, 0x42, // Bytes 240 - 27f 0xCE, 0xB1, 0x42, 0xCE, 0xB2, 0x42, 0xCE, 0xB3, 0x42, 0xCE, 0xB4, 0x42, 0xCE, 0xB5, 0x42, 0xCE, 0xB6, 0x42, 0xCE, 0xB7, 0x42, 0xCE, 0xB8, 0x42, 0xCE, 0xB9, 0x42, 0xCE, 0xBA, 0x42, 0xCE, 0xBB, 0x42, 0xCE, 0xBC, 0x42, 0xCE, 0xBD, 0x42, 0xCE, 0xBE, 0x42, 0xCE, 0xBF, 0x42, 0xCF, 0x80, 0x42, 0xCF, 0x81, 0x42, 0xCF, 0x82, 0x42, 0xCF, 0x83, 0x42, 0xCF, 0x84, 0x42, 0xCF, 0x85, 0x42, 0xCF, // Bytes 280 - 2bf 0x86, 0x42, 0xCF, 0x87, 0x42, 0xCF, 0x88, 0x42, 0xCF, 0x89, 0x42, 0xCF, 0x9C, 0x42, 0xCF, 0x9D, 0x42, 0xD0, 0xB0, 0x42, 0xD0, 0xB1, 0x42, 0xD0, 0xB2, 0x42, 0xD0, 0xB3, 0x42, 0xD0, 0xB4, 0x42, 0xD0, 0xB5, 0x42, 0xD0, 0xB6, 0x42, 0xD0, 0xB7, 0x42, 0xD0, 0xB8, 0x42, 0xD0, 0xBA, 0x42, 0xD0, 0xBB, 0x42, 0xD0, 0xBC, 0x42, 0xD0, 0xBD, 0x42, 0xD0, 0xBE, 0x42, 0xD0, 0xBF, 0x42, 0xD1, 0x80, // Bytes 2c0 - 2ff 0x42, 0xD1, 0x81, 0x42, 0xD1, 0x82, 0x42, 0xD1, 0x83, 0x42, 0xD1, 0x84, 0x42, 0xD1, 0x85, 0x42, 0xD1, 0x86, 0x42, 0xD1, 0x87, 0x42, 0xD1, 0x88, 0x42, 0xD1, 0x8A, 0x42, 0xD1, 0x8B, 0x42, 0xD1, 0x8C, 0x42, 0xD1, 0x8D, 0x42, 0xD1, 0x8E, 0x42, 0xD1, 0x95, 0x42, 0xD1, 0x96, 0x42, 0xD1, 0x98, 0x42, 0xD1, 0x9F, 0x42, 0xD2, 0x91, 0x42, 0xD2, 0xAB, 0x42, 0xD2, 0xAF, 0x42, 0xD2, 0xB1, 0x42, // Bytes 300 - 33f 0xD3, 0x8F, 0x42, 0xD3, 0x99, 0x42, 0xD3, 0xA9, 0x42, 0xD7, 0x90, 0x42, 0xD7, 0x91, 0x42, 0xD7, 0x92, 0x42, 0xD7, 0x93, 0x42, 0xD7, 0x94, 0x42, 0xD7, 0x9B, 0x42, 0xD7, 0x9C, 0x42, 0xD7, 0x9D, 0x42, 0xD7, 0xA2, 0x42, 0xD7, 0xA8, 0x42, 0xD7, 0xAA, 0x42, 0xD8, 0xA1, 0x42, 0xD8, 0xA7, 0x42, 0xD8, 0xA8, 0x42, 0xD8, 0xA9, 0x42, 0xD8, 0xAA, 0x42, 0xD8, 0xAB, 0x42, 0xD8, 0xAC, 0x42, 0xD8, // Bytes 340 - 37f 0xAD, 0x42, 0xD8, 0xAE, 0x42, 0xD8, 0xAF, 0x42, 0xD8, 0xB0, 0x42, 0xD8, 0xB1, 0x42, 0xD8, 0xB2, 0x42, 0xD8, 0xB3, 0x42, 0xD8, 0xB4, 0x42, 0xD8, 0xB5, 0x42, 0xD8, 0xB6, 0x42, 0xD8, 0xB7, 0x42, 0xD8, 0xB8, 0x42, 0xD8, 0xB9, 0x42, 0xD8, 0xBA, 0x42, 0xD9, 0x81, 0x42, 0xD9, 0x82, 0x42, 0xD9, 0x83, 0x42, 0xD9, 0x84, 0x42, 0xD9, 0x85, 0x42, 0xD9, 0x86, 0x42, 0xD9, 0x87, 0x42, 0xD9, 0x88, // Bytes 380 - 3bf 0x42, 0xD9, 0x89, 0x42, 0xD9, 0x8A, 0x42, 0xD9, 0xAE, 0x42, 0xD9, 0xAF, 0x42, 0xD9, 0xB1, 0x42, 0xD9, 0xB9, 0x42, 0xD9, 0xBA, 0x42, 0xD9, 0xBB, 0x42, 0xD9, 0xBE, 0x42, 0xD9, 0xBF, 0x42, 0xDA, 0x80, 0x42, 0xDA, 0x83, 0x42, 0xDA, 0x84, 0x42, 0xDA, 0x86, 0x42, 0xDA, 0x87, 0x42, 0xDA, 0x88, 0x42, 0xDA, 0x8C, 0x42, 0xDA, 0x8D, 0x42, 0xDA, 0x8E, 0x42, 0xDA, 0x91, 0x42, 0xDA, 0x98, 0x42, // Bytes 3c0 - 3ff 0xDA, 0xA1, 0x42, 0xDA, 0xA4, 0x42, 0xDA, 0xA6, 0x42, 0xDA, 0xA9, 0x42, 0xDA, 0xAD, 0x42, 0xDA, 0xAF, 0x42, 0xDA, 0xB1, 0x42, 0xDA, 0xB3, 0x42, 0xDA, 0xBA, 0x42, 0xDA, 0xBB, 0x42, 0xDA, 0xBE, 0x42, 0xDB, 0x81, 0x42, 0xDB, 0x85, 0x42, 0xDB, 0x86, 0x42, 0xDB, 0x87, 0x42, 0xDB, 0x88, 0x42, 0xDB, 0x89, 0x42, 0xDB, 0x8B, 0x42, 0xDB, 0x8C, 0x42, 0xDB, 0x90, 0x42, 0xDB, 0x92, 0x43, 0xE0, // Bytes 400 - 43f 0xBC, 0x8B, 0x43, 0xE1, 0x83, 0x9C, 0x43, 0xE1, 0x84, 0x80, 0x43, 0xE1, 0x84, 0x81, 0x43, 0xE1, 0x84, 0x82, 0x43, 0xE1, 0x84, 0x83, 0x43, 0xE1, 0x84, 0x84, 0x43, 0xE1, 0x84, 0x85, 0x43, 0xE1, 0x84, 0x86, 0x43, 0xE1, 0x84, 0x87, 0x43, 0xE1, 0x84, 0x88, 0x43, 0xE1, 0x84, 0x89, 0x43, 0xE1, 0x84, 0x8A, 0x43, 0xE1, 0x84, 0x8B, 0x43, 0xE1, 0x84, 0x8C, 0x43, 0xE1, 0x84, 0x8D, 0x43, 0xE1, // Bytes 440 - 47f 0x84, 0x8E, 0x43, 0xE1, 0x84, 0x8F, 0x43, 0xE1, 0x84, 0x90, 0x43, 0xE1, 0x84, 0x91, 0x43, 0xE1, 0x84, 0x92, 0x43, 0xE1, 0x84, 0x94, 0x43, 0xE1, 0x84, 0x95, 0x43, 0xE1, 0x84, 0x9A, 0x43, 0xE1, 0x84, 0x9C, 0x43, 0xE1, 0x84, 0x9D, 0x43, 0xE1, 0x84, 0x9E, 0x43, 0xE1, 0x84, 0xA0, 0x43, 0xE1, 0x84, 0xA1, 0x43, 0xE1, 0x84, 0xA2, 0x43, 0xE1, 0x84, 0xA3, 0x43, 0xE1, 0x84, 0xA7, 0x43, 0xE1, // Bytes 480 - 4bf 0x84, 0xA9, 0x43, 0xE1, 0x84, 0xAB, 0x43, 0xE1, 0x84, 0xAC, 0x43, 0xE1, 0x84, 0xAD, 0x43, 0xE1, 0x84, 0xAE, 0x43, 0xE1, 0x84, 0xAF, 0x43, 0xE1, 0x84, 0xB2, 0x43, 0xE1, 0x84, 0xB6, 0x43, 0xE1, 0x85, 0x80, 0x43, 0xE1, 0x85, 0x87, 0x43, 0xE1, 0x85, 0x8C, 0x43, 0xE1, 0x85, 0x97, 0x43, 0xE1, 0x85, 0x98, 0x43, 0xE1, 0x85, 0x99, 0x43, 0xE1, 0x85, 0xA0, 0x43, 0xE1, 0x86, 0x84, 0x43, 0xE1, // Bytes 4c0 - 4ff 0x86, 0x85, 0x43, 0xE1, 0x86, 0x88, 0x43, 0xE1, 0x86, 0x91, 0x43, 0xE1, 0x86, 0x92, 0x43, 0xE1, 0x86, 0x94, 0x43, 0xE1, 0x86, 0x9E, 0x43, 0xE1, 0x86, 0xA1, 0x43, 0xE1, 0x87, 0x87, 0x43, 0xE1, 0x87, 0x88, 0x43, 0xE1, 0x87, 0x8C, 0x43, 0xE1, 0x87, 0x8E, 0x43, 0xE1, 0x87, 0x93, 0x43, 0xE1, 0x87, 0x97, 0x43, 0xE1, 0x87, 0x99, 0x43, 0xE1, 0x87, 0x9D, 0x43, 0xE1, 0x87, 0x9F, 0x43, 0xE1, // Bytes 500 - 53f 0x87, 0xB1, 0x43, 0xE1, 0x87, 0xB2, 0x43, 0xE1, 0xB4, 0x82, 0x43, 0xE1, 0xB4, 0x96, 0x43, 0xE1, 0xB4, 0x97, 0x43, 0xE1, 0xB4, 0x9C, 0x43, 0xE1, 0xB4, 0x9D, 0x43, 0xE1, 0xB4, 0xA5, 0x43, 0xE1, 0xB5, 0xBB, 0x43, 0xE1, 0xB6, 0x85, 0x43, 0xE1, 0xB6, 0x91, 0x43, 0xE2, 0x80, 0x82, 0x43, 0xE2, 0x80, 0x83, 0x43, 0xE2, 0x80, 0x90, 0x43, 0xE2, 0x80, 0x93, 0x43, 0xE2, 0x80, 0x94, 0x43, 0xE2, // Bytes 540 - 57f 0x82, 0xA9, 0x43, 0xE2, 0x86, 0x90, 0x43, 0xE2, 0x86, 0x91, 0x43, 0xE2, 0x86, 0x92, 0x43, 0xE2, 0x86, 0x93, 0x43, 0xE2, 0x88, 0x82, 0x43, 0xE2, 0x88, 0x87, 0x43, 0xE2, 0x88, 0x91, 0x43, 0xE2, 0x88, 0x92, 0x43, 0xE2, 0x94, 0x82, 0x43, 0xE2, 0x96, 0xA0, 0x43, 0xE2, 0x97, 0x8B, 0x43, 0xE2, 0xA6, 0x85, 0x43, 0xE2, 0xA6, 0x86, 0x43, 0xE2, 0xB1, 0xB1, 0x43, 0xE2, 0xB5, 0xA1, 0x43, 0xE3, // Bytes 580 - 5bf 0x80, 0x81, 0x43, 0xE3, 0x80, 0x82, 0x43, 0xE3, 0x80, 0x88, 0x43, 0xE3, 0x80, 0x89, 0x43, 0xE3, 0x80, 0x8A, 0x43, 0xE3, 0x80, 0x8B, 0x43, 0xE3, 0x80, 0x8C, 0x43, 0xE3, 0x80, 0x8D, 0x43, 0xE3, 0x80, 0x8E, 0x43, 0xE3, 0x80, 0x8F, 0x43, 0xE3, 0x80, 0x90, 0x43, 0xE3, 0x80, 0x91, 0x43, 0xE3, 0x80, 0x92, 0x43, 0xE3, 0x80, 0x94, 0x43, 0xE3, 0x80, 0x95, 0x43, 0xE3, 0x80, 0x96, 0x43, 0xE3, // Bytes 5c0 - 5ff 0x80, 0x97, 0x43, 0xE3, 0x82, 0xA1, 0x43, 0xE3, 0x82, 0xA2, 0x43, 0xE3, 0x82, 0xA3, 0x43, 0xE3, 0x82, 0xA4, 0x43, 0xE3, 0x82, 0xA5, 0x43, 0xE3, 0x82, 0xA6, 0x43, 0xE3, 0x82, 0xA7, 0x43, 0xE3, 0x82, 0xA8, 0x43, 0xE3, 0x82, 0xA9, 0x43, 0xE3, 0x82, 0xAA, 0x43, 0xE3, 0x82, 0xAB, 0x43, 0xE3, 0x82, 0xAD, 0x43, 0xE3, 0x82, 0xAF, 0x43, 0xE3, 0x82, 0xB1, 0x43, 0xE3, 0x82, 0xB3, 0x43, 0xE3, // Bytes 600 - 63f 0x82, 0xB5, 0x43, 0xE3, 0x82, 0xB7, 0x43, 0xE3, 0x82, 0xB9, 0x43, 0xE3, 0x82, 0xBB, 0x43, 0xE3, 0x82, 0xBD, 0x43, 0xE3, 0x82, 0xBF, 0x43, 0xE3, 0x83, 0x81, 0x43, 0xE3, 0x83, 0x83, 0x43, 0xE3, 0x83, 0x84, 0x43, 0xE3, 0x83, 0x86, 0x43, 0xE3, 0x83, 0x88, 0x43, 0xE3, 0x83, 0x8A, 0x43, 0xE3, 0x83, 0x8B, 0x43, 0xE3, 0x83, 0x8C, 0x43, 0xE3, 0x83, 0x8D, 0x43, 0xE3, 0x83, 0x8E, 0x43, 0xE3, // Bytes 640 - 67f 0x83, 0x8F, 0x43, 0xE3, 0x83, 0x92, 0x43, 0xE3, 0x83, 0x95, 0x43, 0xE3, 0x83, 0x98, 0x43, 0xE3, 0x83, 0x9B, 0x43, 0xE3, 0x83, 0x9E, 0x43, 0xE3, 0x83, 0x9F, 0x43, 0xE3, 0x83, 0xA0, 0x43, 0xE3, 0x83, 0xA1, 0x43, 0xE3, 0x83, 0xA2, 0x43, 0xE3, 0x83, 0xA3, 0x43, 0xE3, 0x83, 0xA4, 0x43, 0xE3, 0x83, 0xA5, 0x43, 0xE3, 0x83, 0xA6, 0x43, 0xE3, 0x83, 0xA7, 0x43, 0xE3, 0x83, 0xA8, 0x43, 0xE3, // Bytes 680 - 6bf 0x83, 0xA9, 0x43, 0xE3, 0x83, 0xAA, 0x43, 0xE3, 0x83, 0xAB, 0x43, 0xE3, 0x83, 0xAC, 0x43, 0xE3, 0x83, 0xAD, 0x43, 0xE3, 0x83, 0xAF, 0x43, 0xE3, 0x83, 0xB0, 0x43, 0xE3, 0x83, 0xB1, 0x43, 0xE3, 0x83, 0xB2, 0x43, 0xE3, 0x83, 0xB3, 0x43, 0xE3, 0x83, 0xBB, 0x43, 0xE3, 0x83, 0xBC, 0x43, 0xE3, 0x92, 0x9E, 0x43, 0xE3, 0x92, 0xB9, 0x43, 0xE3, 0x92, 0xBB, 0x43, 0xE3, 0x93, 0x9F, 0x43, 0xE3, // Bytes 6c0 - 6ff 0x94, 0x95, 0x43, 0xE3, 0x9B, 0xAE, 0x43, 0xE3, 0x9B, 0xBC, 0x43, 0xE3, 0x9E, 0x81, 0x43, 0xE3, 0xA0, 0xAF, 0x43, 0xE3, 0xA1, 0xA2, 0x43, 0xE3, 0xA1, 0xBC, 0x43, 0xE3, 0xA3, 0x87, 0x43, 0xE3, 0xA3, 0xA3, 0x43, 0xE3, 0xA4, 0x9C, 0x43, 0xE3, 0xA4, 0xBA, 0x43, 0xE3, 0xA8, 0xAE, 0x43, 0xE3, 0xA9, 0xAC, 0x43, 0xE3, 0xAB, 0xA4, 0x43, 0xE3, 0xAC, 0x88, 0x43, 0xE3, 0xAC, 0x99, 0x43, 0xE3, // Bytes 700 - 73f 0xAD, 0x89, 0x43, 0xE3, 0xAE, 0x9D, 0x43, 0xE3, 0xB0, 0x98, 0x43, 0xE3, 0xB1, 0x8E, 0x43, 0xE3, 0xB4, 0xB3, 0x43, 0xE3, 0xB6, 0x96, 0x43, 0xE3, 0xBA, 0xAC, 0x43, 0xE3, 0xBA, 0xB8, 0x43, 0xE3, 0xBC, 0x9B, 0x43, 0xE3, 0xBF, 0xBC, 0x43, 0xE4, 0x80, 0x88, 0x43, 0xE4, 0x80, 0x98, 0x43, 0xE4, 0x80, 0xB9, 0x43, 0xE4, 0x81, 0x86, 0x43, 0xE4, 0x82, 0x96, 0x43, 0xE4, 0x83, 0xA3, 0x43, 0xE4, // Bytes 740 - 77f 0x84, 0xAF, 0x43, 0xE4, 0x88, 0x82, 0x43, 0xE4, 0x88, 0xA7, 0x43, 0xE4, 0x8A, 0xA0, 0x43, 0xE4, 0x8C, 0x81, 0x43, 0xE4, 0x8C, 0xB4, 0x43, 0xE4, 0x8D, 0x99, 0x43, 0xE4, 0x8F, 0x95, 0x43, 0xE4, 0x8F, 0x99, 0x43, 0xE4, 0x90, 0x8B, 0x43, 0xE4, 0x91, 0xAB, 0x43, 0xE4, 0x94, 0xAB, 0x43, 0xE4, 0x95, 0x9D, 0x43, 0xE4, 0x95, 0xA1, 0x43, 0xE4, 0x95, 0xAB, 0x43, 0xE4, 0x97, 0x97, 0x43, 0xE4, // Bytes 780 - 7bf 0x97, 0xB9, 0x43, 0xE4, 0x98, 0xB5, 0x43, 0xE4, 0x9A, 0xBE, 0x43, 0xE4, 0x9B, 0x87, 0x43, 0xE4, 0xA6, 0x95, 0x43, 0xE4, 0xA7, 0xA6, 0x43, 0xE4, 0xA9, 0xAE, 0x43, 0xE4, 0xA9, 0xB6, 0x43, 0xE4, 0xAA, 0xB2, 0x43, 0xE4, 0xAC, 0xB3, 0x43, 0xE4, 0xAF, 0x8E, 0x43, 0xE4, 0xB3, 0x8E, 0x43, 0xE4, 0xB3, 0xAD, 0x43, 0xE4, 0xB3, 0xB8, 0x43, 0xE4, 0xB5, 0x96, 0x43, 0xE4, 0xB8, 0x80, 0x43, 0xE4, // Bytes 7c0 - 7ff 0xB8, 0x81, 0x43, 0xE4, 0xB8, 0x83, 0x43, 0xE4, 0xB8, 0x89, 0x43, 0xE4, 0xB8, 0x8A, 0x43, 0xE4, 0xB8, 0x8B, 0x43, 0xE4, 0xB8, 0x8D, 0x43, 0xE4, 0xB8, 0x99, 0x43, 0xE4, 0xB8, 0xA6, 0x43, 0xE4, 0xB8, 0xA8, 0x43, 0xE4, 0xB8, 0xAD, 0x43, 0xE4, 0xB8, 0xB2, 0x43, 0xE4, 0xB8, 0xB6, 0x43, 0xE4, 0xB8, 0xB8, 0x43, 0xE4, 0xB8, 0xB9, 0x43, 0xE4, 0xB8, 0xBD, 0x43, 0xE4, 0xB8, 0xBF, 0x43, 0xE4, // Bytes 800 - 83f 0xB9, 0x81, 0x43, 0xE4, 0xB9, 0x99, 0x43, 0xE4, 0xB9, 0x9D, 0x43, 0xE4, 0xBA, 0x82, 0x43, 0xE4, 0xBA, 0x85, 0x43, 0xE4, 0xBA, 0x86, 0x43, 0xE4, 0xBA, 0x8C, 0x43, 0xE4, 0xBA, 0x94, 0x43, 0xE4, 0xBA, 0xA0, 0x43, 0xE4, 0xBA, 0xA4, 0x43, 0xE4, 0xBA, 0xAE, 0x43, 0xE4, 0xBA, 0xBA, 0x43, 0xE4, 0xBB, 0x80, 0x43, 0xE4, 0xBB, 0x8C, 0x43, 0xE4, 0xBB, 0xA4, 0x43, 0xE4, 0xBC, 0x81, 0x43, 0xE4, // Bytes 840 - 87f 0xBC, 0x91, 0x43, 0xE4, 0xBD, 0xA0, 0x43, 0xE4, 0xBE, 0x80, 0x43, 0xE4, 0xBE, 0x86, 0x43, 0xE4, 0xBE, 0x8B, 0x43, 0xE4, 0xBE, 0xAE, 0x43, 0xE4, 0xBE, 0xBB, 0x43, 0xE4, 0xBE, 0xBF, 0x43, 0xE5, 0x80, 0x82, 0x43, 0xE5, 0x80, 0xAB, 0x43, 0xE5, 0x81, 0xBA, 0x43, 0xE5, 0x82, 0x99, 0x43, 0xE5, 0x83, 0x8F, 0x43, 0xE5, 0x83, 0x9A, 0x43, 0xE5, 0x83, 0xA7, 0x43, 0xE5, 0x84, 0xAA, 0x43, 0xE5, // Bytes 880 - 8bf 0x84, 0xBF, 0x43, 0xE5, 0x85, 0x80, 0x43, 0xE5, 0x85, 0x85, 0x43, 0xE5, 0x85, 0x8D, 0x43, 0xE5, 0x85, 0x94, 0x43, 0xE5, 0x85, 0xA4, 0x43, 0xE5, 0x85, 0xA5, 0x43, 0xE5, 0x85, 0xA7, 0x43, 0xE5, 0x85, 0xA8, 0x43, 0xE5, 0x85, 0xA9, 0x43, 0xE5, 0x85, 0xAB, 0x43, 0xE5, 0x85, 0xAD, 0x43, 0xE5, 0x85, 0xB7, 0x43, 0xE5, 0x86, 0x80, 0x43, 0xE5, 0x86, 0x82, 0x43, 0xE5, 0x86, 0x8D, 0x43, 0xE5, // Bytes 8c0 - 8ff 0x86, 0x92, 0x43, 0xE5, 0x86, 0x95, 0x43, 0xE5, 0x86, 0x96, 0x43, 0xE5, 0x86, 0x97, 0x43, 0xE5, 0x86, 0x99, 0x43, 0xE5, 0x86, 0xA4, 0x43, 0xE5, 0x86, 0xAB, 0x43, 0xE5, 0x86, 0xAC, 0x43, 0xE5, 0x86, 0xB5, 0x43, 0xE5, 0x86, 0xB7, 0x43, 0xE5, 0x87, 0x89, 0x43, 0xE5, 0x87, 0x8C, 0x43, 0xE5, 0x87, 0x9C, 0x43, 0xE5, 0x87, 0x9E, 0x43, 0xE5, 0x87, 0xA0, 0x43, 0xE5, 0x87, 0xB5, 0x43, 0xE5, // Bytes 900 - 93f 0x88, 0x80, 0x43, 0xE5, 0x88, 0x83, 0x43, 0xE5, 0x88, 0x87, 0x43, 0xE5, 0x88, 0x97, 0x43, 0xE5, 0x88, 0x9D, 0x43, 0xE5, 0x88, 0xA9, 0x43, 0xE5, 0x88, 0xBA, 0x43, 0xE5, 0x88, 0xBB, 0x43, 0xE5, 0x89, 0x86, 0x43, 0xE5, 0x89, 0x8D, 0x43, 0xE5, 0x89, 0xB2, 0x43, 0xE5, 0x89, 0xB7, 0x43, 0xE5, 0x8A, 0x89, 0x43, 0xE5, 0x8A, 0x9B, 0x43, 0xE5, 0x8A, 0xA3, 0x43, 0xE5, 0x8A, 0xB3, 0x43, 0xE5, // Bytes 940 - 97f 0x8A, 0xB4, 0x43, 0xE5, 0x8B, 0x87, 0x43, 0xE5, 0x8B, 0x89, 0x43, 0xE5, 0x8B, 0x92, 0x43, 0xE5, 0x8B, 0x9E, 0x43, 0xE5, 0x8B, 0xA4, 0x43, 0xE5, 0x8B, 0xB5, 0x43, 0xE5, 0x8B, 0xB9, 0x43, 0xE5, 0x8B, 0xBA, 0x43, 0xE5, 0x8C, 0x85, 0x43, 0xE5, 0x8C, 0x86, 0x43, 0xE5, 0x8C, 0x95, 0x43, 0xE5, 0x8C, 0x97, 0x43, 0xE5, 0x8C, 0x9A, 0x43, 0xE5, 0x8C, 0xB8, 0x43, 0xE5, 0x8C, 0xBB, 0x43, 0xE5, // Bytes 980 - 9bf 0x8C, 0xBF, 0x43, 0xE5, 0x8D, 0x81, 0x43, 0xE5, 0x8D, 0x84, 0x43, 0xE5, 0x8D, 0x85, 0x43, 0xE5, 0x8D, 0x89, 0x43, 0xE5, 0x8D, 0x91, 0x43, 0xE5, 0x8D, 0x94, 0x43, 0xE5, 0x8D, 0x9A, 0x43, 0xE5, 0x8D, 0x9C, 0x43, 0xE5, 0x8D, 0xA9, 0x43, 0xE5, 0x8D, 0xB0, 0x43, 0xE5, 0x8D, 0xB3, 0x43, 0xE5, 0x8D, 0xB5, 0x43, 0xE5, 0x8D, 0xBD, 0x43, 0xE5, 0x8D, 0xBF, 0x43, 0xE5, 0x8E, 0x82, 0x43, 0xE5, // Bytes 9c0 - 9ff 0x8E, 0xB6, 0x43, 0xE5, 0x8F, 0x83, 0x43, 0xE5, 0x8F, 0x88, 0x43, 0xE5, 0x8F, 0x8A, 0x43, 0xE5, 0x8F, 0x8C, 0x43, 0xE5, 0x8F, 0x9F, 0x43, 0xE5, 0x8F, 0xA3, 0x43, 0xE5, 0x8F, 0xA5, 0x43, 0xE5, 0x8F, 0xAB, 0x43, 0xE5, 0x8F, 0xAF, 0x43, 0xE5, 0x8F, 0xB1, 0x43, 0xE5, 0x8F, 0xB3, 0x43, 0xE5, 0x90, 0x86, 0x43, 0xE5, 0x90, 0x88, 0x43, 0xE5, 0x90, 0x8D, 0x43, 0xE5, 0x90, 0x8F, 0x43, 0xE5, // Bytes a00 - a3f 0x90, 0x9D, 0x43, 0xE5, 0x90, 0xB8, 0x43, 0xE5, 0x90, 0xB9, 0x43, 0xE5, 0x91, 0x82, 0x43, 0xE5, 0x91, 0x88, 0x43, 0xE5, 0x91, 0xA8, 0x43, 0xE5, 0x92, 0x9E, 0x43, 0xE5, 0x92, 0xA2, 0x43, 0xE5, 0x92, 0xBD, 0x43, 0xE5, 0x93, 0xB6, 0x43, 0xE5, 0x94, 0x90, 0x43, 0xE5, 0x95, 0x8F, 0x43, 0xE5, 0x95, 0x93, 0x43, 0xE5, 0x95, 0x95, 0x43, 0xE5, 0x95, 0xA3, 0x43, 0xE5, 0x96, 0x84, 0x43, 0xE5, // Bytes a40 - a7f 0x96, 0x87, 0x43, 0xE5, 0x96, 0x99, 0x43, 0xE5, 0x96, 0x9D, 0x43, 0xE5, 0x96, 0xAB, 0x43, 0xE5, 0x96, 0xB3, 0x43, 0xE5, 0x96, 0xB6, 0x43, 0xE5, 0x97, 0x80, 0x43, 0xE5, 0x97, 0x82, 0x43, 0xE5, 0x97, 0xA2, 0x43, 0xE5, 0x98, 0x86, 0x43, 0xE5, 0x99, 0x91, 0x43, 0xE5, 0x99, 0xA8, 0x43, 0xE5, 0x99, 0xB4, 0x43, 0xE5, 0x9B, 0x97, 0x43, 0xE5, 0x9B, 0x9B, 0x43, 0xE5, 0x9B, 0xB9, 0x43, 0xE5, // Bytes a80 - abf 0x9C, 0x96, 0x43, 0xE5, 0x9C, 0x97, 0x43, 0xE5, 0x9C, 0x9F, 0x43, 0xE5, 0x9C, 0xB0, 0x43, 0xE5, 0x9E, 0x8B, 0x43, 0xE5, 0x9F, 0x8E, 0x43, 0xE5, 0x9F, 0xB4, 0x43, 0xE5, 0xA0, 0x8D, 0x43, 0xE5, 0xA0, 0xB1, 0x43, 0xE5, 0xA0, 0xB2, 0x43, 0xE5, 0xA1, 0x80, 0x43, 0xE5, 0xA1, 0x9A, 0x43, 0xE5, 0xA1, 0x9E, 0x43, 0xE5, 0xA2, 0xA8, 0x43, 0xE5, 0xA2, 0xAC, 0x43, 0xE5, 0xA2, 0xB3, 0x43, 0xE5, // Bytes ac0 - aff 0xA3, 0x98, 0x43, 0xE5, 0xA3, 0x9F, 0x43, 0xE5, 0xA3, 0xAB, 0x43, 0xE5, 0xA3, 0xAE, 0x43, 0xE5, 0xA3, 0xB0, 0x43, 0xE5, 0xA3, 0xB2, 0x43, 0xE5, 0xA3, 0xB7, 0x43, 0xE5, 0xA4, 0x82, 0x43, 0xE5, 0xA4, 0x86, 0x43, 0xE5, 0xA4, 0x8A, 0x43, 0xE5, 0xA4, 0x95, 0x43, 0xE5, 0xA4, 0x9A, 0x43, 0xE5, 0xA4, 0x9C, 0x43, 0xE5, 0xA4, 0xA2, 0x43, 0xE5, 0xA4, 0xA7, 0x43, 0xE5, 0xA4, 0xA9, 0x43, 0xE5, // Bytes b00 - b3f 0xA5, 0x84, 0x43, 0xE5, 0xA5, 0x88, 0x43, 0xE5, 0xA5, 0x91, 0x43, 0xE5, 0xA5, 0x94, 0x43, 0xE5, 0xA5, 0xA2, 0x43, 0xE5, 0xA5, 0xB3, 0x43, 0xE5, 0xA7, 0x98, 0x43, 0xE5, 0xA7, 0xAC, 0x43, 0xE5, 0xA8, 0x9B, 0x43, 0xE5, 0xA8, 0xA7, 0x43, 0xE5, 0xA9, 0xA2, 0x43, 0xE5, 0xA9, 0xA6, 0x43, 0xE5, 0xAA, 0xB5, 0x43, 0xE5, 0xAC, 0x88, 0x43, 0xE5, 0xAC, 0xA8, 0x43, 0xE5, 0xAC, 0xBE, 0x43, 0xE5, // Bytes b40 - b7f 0xAD, 0x90, 0x43, 0xE5, 0xAD, 0x97, 0x43, 0xE5, 0xAD, 0xA6, 0x43, 0xE5, 0xAE, 0x80, 0x43, 0xE5, 0xAE, 0x85, 0x43, 0xE5, 0xAE, 0x97, 0x43, 0xE5, 0xAF, 0x83, 0x43, 0xE5, 0xAF, 0x98, 0x43, 0xE5, 0xAF, 0xA7, 0x43, 0xE5, 0xAF, 0xAE, 0x43, 0xE5, 0xAF, 0xB3, 0x43, 0xE5, 0xAF, 0xB8, 0x43, 0xE5, 0xAF, 0xBF, 0x43, 0xE5, 0xB0, 0x86, 0x43, 0xE5, 0xB0, 0x8F, 0x43, 0xE5, 0xB0, 0xA2, 0x43, 0xE5, // Bytes b80 - bbf 0xB0, 0xB8, 0x43, 0xE5, 0xB0, 0xBF, 0x43, 0xE5, 0xB1, 0xA0, 0x43, 0xE5, 0xB1, 0xA2, 0x43, 0xE5, 0xB1, 0xA4, 0x43, 0xE5, 0xB1, 0xA5, 0x43, 0xE5, 0xB1, 0xAE, 0x43, 0xE5, 0xB1, 0xB1, 0x43, 0xE5, 0xB2, 0x8D, 0x43, 0xE5, 0xB3, 0x80, 0x43, 0xE5, 0xB4, 0x99, 0x43, 0xE5, 0xB5, 0x83, 0x43, 0xE5, 0xB5, 0x90, 0x43, 0xE5, 0xB5, 0xAB, 0x43, 0xE5, 0xB5, 0xAE, 0x43, 0xE5, 0xB5, 0xBC, 0x43, 0xE5, // Bytes bc0 - bff 0xB6, 0xB2, 0x43, 0xE5, 0xB6, 0xBA, 0x43, 0xE5, 0xB7, 0x9B, 0x43, 0xE5, 0xB7, 0xA1, 0x43, 0xE5, 0xB7, 0xA2, 0x43, 0xE5, 0xB7, 0xA5, 0x43, 0xE5, 0xB7, 0xA6, 0x43, 0xE5, 0xB7, 0xB1, 0x43, 0xE5, 0xB7, 0xBD, 0x43, 0xE5, 0xB7, 0xBE, 0x43, 0xE5, 0xB8, 0xA8, 0x43, 0xE5, 0xB8, 0xBD, 0x43, 0xE5, 0xB9, 0xA9, 0x43, 0xE5, 0xB9, 0xB2, 0x43, 0xE5, 0xB9, 0xB4, 0x43, 0xE5, 0xB9, 0xBA, 0x43, 0xE5, // Bytes c00 - c3f 0xB9, 0xBC, 0x43, 0xE5, 0xB9, 0xBF, 0x43, 0xE5, 0xBA, 0xA6, 0x43, 0xE5, 0xBA, 0xB0, 0x43, 0xE5, 0xBA, 0xB3, 0x43, 0xE5, 0xBA, 0xB6, 0x43, 0xE5, 0xBB, 0x89, 0x43, 0xE5, 0xBB, 0x8A, 0x43, 0xE5, 0xBB, 0x92, 0x43, 0xE5, 0xBB, 0x93, 0x43, 0xE5, 0xBB, 0x99, 0x43, 0xE5, 0xBB, 0xAC, 0x43, 0xE5, 0xBB, 0xB4, 0x43, 0xE5, 0xBB, 0xBE, 0x43, 0xE5, 0xBC, 0x84, 0x43, 0xE5, 0xBC, 0x8B, 0x43, 0xE5, // Bytes c40 - c7f 0xBC, 0x93, 0x43, 0xE5, 0xBC, 0xA2, 0x43, 0xE5, 0xBD, 0x90, 0x43, 0xE5, 0xBD, 0x93, 0x43, 0xE5, 0xBD, 0xA1, 0x43, 0xE5, 0xBD, 0xA2, 0x43, 0xE5, 0xBD, 0xA9, 0x43, 0xE5, 0xBD, 0xAB, 0x43, 0xE5, 0xBD, 0xB3, 0x43, 0xE5, 0xBE, 0x8B, 0x43, 0xE5, 0xBE, 0x8C, 0x43, 0xE5, 0xBE, 0x97, 0x43, 0xE5, 0xBE, 0x9A, 0x43, 0xE5, 0xBE, 0xA9, 0x43, 0xE5, 0xBE, 0xAD, 0x43, 0xE5, 0xBF, 0x83, 0x43, 0xE5, // Bytes c80 - cbf 0xBF, 0x8D, 0x43, 0xE5, 0xBF, 0x97, 0x43, 0xE5, 0xBF, 0xB5, 0x43, 0xE5, 0xBF, 0xB9, 0x43, 0xE6, 0x80, 0x92, 0x43, 0xE6, 0x80, 0x9C, 0x43, 0xE6, 0x81, 0xB5, 0x43, 0xE6, 0x82, 0x81, 0x43, 0xE6, 0x82, 0x94, 0x43, 0xE6, 0x83, 0x87, 0x43, 0xE6, 0x83, 0x98, 0x43, 0xE6, 0x83, 0xA1, 0x43, 0xE6, 0x84, 0x88, 0x43, 0xE6, 0x85, 0x84, 0x43, 0xE6, 0x85, 0x88, 0x43, 0xE6, 0x85, 0x8C, 0x43, 0xE6, // Bytes cc0 - cff 0x85, 0x8E, 0x43, 0xE6, 0x85, 0xA0, 0x43, 0xE6, 0x85, 0xA8, 0x43, 0xE6, 0x85, 0xBA, 0x43, 0xE6, 0x86, 0x8E, 0x43, 0xE6, 0x86, 0x90, 0x43, 0xE6, 0x86, 0xA4, 0x43, 0xE6, 0x86, 0xAF, 0x43, 0xE6, 0x86, 0xB2, 0x43, 0xE6, 0x87, 0x9E, 0x43, 0xE6, 0x87, 0xB2, 0x43, 0xE6, 0x87, 0xB6, 0x43, 0xE6, 0x88, 0x80, 0x43, 0xE6, 0x88, 0x88, 0x43, 0xE6, 0x88, 0x90, 0x43, 0xE6, 0x88, 0x9B, 0x43, 0xE6, // Bytes d00 - d3f 0x88, 0xAE, 0x43, 0xE6, 0x88, 0xB4, 0x43, 0xE6, 0x88, 0xB6, 0x43, 0xE6, 0x89, 0x8B, 0x43, 0xE6, 0x89, 0x93, 0x43, 0xE6, 0x89, 0x9D, 0x43, 0xE6, 0x8A, 0x95, 0x43, 0xE6, 0x8A, 0xB1, 0x43, 0xE6, 0x8B, 0x89, 0x43, 0xE6, 0x8B, 0x8F, 0x43, 0xE6, 0x8B, 0x93, 0x43, 0xE6, 0x8B, 0x94, 0x43, 0xE6, 0x8B, 0xBC, 0x43, 0xE6, 0x8B, 0xBE, 0x43, 0xE6, 0x8C, 0x87, 0x43, 0xE6, 0x8C, 0xBD, 0x43, 0xE6, // Bytes d40 - d7f 0x8D, 0x90, 0x43, 0xE6, 0x8D, 0x95, 0x43, 0xE6, 0x8D, 0xA8, 0x43, 0xE6, 0x8D, 0xBB, 0x43, 0xE6, 0x8E, 0x83, 0x43, 0xE6, 0x8E, 0xA0, 0x43, 0xE6, 0x8E, 0xA9, 0x43, 0xE6, 0x8F, 0x84, 0x43, 0xE6, 0x8F, 0x85, 0x43, 0xE6, 0x8F, 0xA4, 0x43, 0xE6, 0x90, 0x9C, 0x43, 0xE6, 0x90, 0xA2, 0x43, 0xE6, 0x91, 0x92, 0x43, 0xE6, 0x91, 0xA9, 0x43, 0xE6, 0x91, 0xB7, 0x43, 0xE6, 0x91, 0xBE, 0x43, 0xE6, // Bytes d80 - dbf 0x92, 0x9A, 0x43, 0xE6, 0x92, 0x9D, 0x43, 0xE6, 0x93, 0x84, 0x43, 0xE6, 0x94, 0xAF, 0x43, 0xE6, 0x94, 0xB4, 0x43, 0xE6, 0x95, 0x8F, 0x43, 0xE6, 0x95, 0x96, 0x43, 0xE6, 0x95, 0xAC, 0x43, 0xE6, 0x95, 0xB8, 0x43, 0xE6, 0x96, 0x87, 0x43, 0xE6, 0x96, 0x97, 0x43, 0xE6, 0x96, 0x99, 0x43, 0xE6, 0x96, 0xA4, 0x43, 0xE6, 0x96, 0xB0, 0x43, 0xE6, 0x96, 0xB9, 0x43, 0xE6, 0x97, 0x85, 0x43, 0xE6, // Bytes dc0 - dff 0x97, 0xA0, 0x43, 0xE6, 0x97, 0xA2, 0x43, 0xE6, 0x97, 0xA3, 0x43, 0xE6, 0x97, 0xA5, 0x43, 0xE6, 0x98, 0x93, 0x43, 0xE6, 0x98, 0xA0, 0x43, 0xE6, 0x99, 0x89, 0x43, 0xE6, 0x99, 0xB4, 0x43, 0xE6, 0x9A, 0x88, 0x43, 0xE6, 0x9A, 0x91, 0x43, 0xE6, 0x9A, 0x9C, 0x43, 0xE6, 0x9A, 0xB4, 0x43, 0xE6, 0x9B, 0x86, 0x43, 0xE6, 0x9B, 0xB0, 0x43, 0xE6, 0x9B, 0xB4, 0x43, 0xE6, 0x9B, 0xB8, 0x43, 0xE6, // Bytes e00 - e3f 0x9C, 0x80, 0x43, 0xE6, 0x9C, 0x88, 0x43, 0xE6, 0x9C, 0x89, 0x43, 0xE6, 0x9C, 0x97, 0x43, 0xE6, 0x9C, 0x9B, 0x43, 0xE6, 0x9C, 0xA1, 0x43, 0xE6, 0x9C, 0xA8, 0x43, 0xE6, 0x9D, 0x8E, 0x43, 0xE6, 0x9D, 0x93, 0x43, 0xE6, 0x9D, 0x96, 0x43, 0xE6, 0x9D, 0x9E, 0x43, 0xE6, 0x9D, 0xBB, 0x43, 0xE6, 0x9E, 0x85, 0x43, 0xE6, 0x9E, 0x97, 0x43, 0xE6, 0x9F, 0xB3, 0x43, 0xE6, 0x9F, 0xBA, 0x43, 0xE6, // Bytes e40 - e7f 0xA0, 0x97, 0x43, 0xE6, 0xA0, 0x9F, 0x43, 0xE6, 0xA0, 0xAA, 0x43, 0xE6, 0xA1, 0x92, 0x43, 0xE6, 0xA2, 0x81, 0x43, 0xE6, 0xA2, 0x85, 0x43, 0xE6, 0xA2, 0x8E, 0x43, 0xE6, 0xA2, 0xA8, 0x43, 0xE6, 0xA4, 0x94, 0x43, 0xE6, 0xA5, 0x82, 0x43, 0xE6, 0xA6, 0xA3, 0x43, 0xE6, 0xA7, 0xAA, 0x43, 0xE6, 0xA8, 0x82, 0x43, 0xE6, 0xA8, 0x93, 0x43, 0xE6, 0xAA, 0xA8, 0x43, 0xE6, 0xAB, 0x93, 0x43, 0xE6, // Bytes e80 - ebf 0xAB, 0x9B, 0x43, 0xE6, 0xAC, 0x84, 0x43, 0xE6, 0xAC, 0xA0, 0x43, 0xE6, 0xAC, 0xA1, 0x43, 0xE6, 0xAD, 0x94, 0x43, 0xE6, 0xAD, 0xA2, 0x43, 0xE6, 0xAD, 0xA3, 0x43, 0xE6, 0xAD, 0xB2, 0x43, 0xE6, 0xAD, 0xB7, 0x43, 0xE6, 0xAD, 0xB9, 0x43, 0xE6, 0xAE, 0x9F, 0x43, 0xE6, 0xAE, 0xAE, 0x43, 0xE6, 0xAE, 0xB3, 0x43, 0xE6, 0xAE, 0xBA, 0x43, 0xE6, 0xAE, 0xBB, 0x43, 0xE6, 0xAF, 0x8B, 0x43, 0xE6, // Bytes ec0 - eff 0xAF, 0x8D, 0x43, 0xE6, 0xAF, 0x94, 0x43, 0xE6, 0xAF, 0x9B, 0x43, 0xE6, 0xB0, 0x8F, 0x43, 0xE6, 0xB0, 0x94, 0x43, 0xE6, 0xB0, 0xB4, 0x43, 0xE6, 0xB1, 0x8E, 0x43, 0xE6, 0xB1, 0xA7, 0x43, 0xE6, 0xB2, 0x88, 0x43, 0xE6, 0xB2, 0xBF, 0x43, 0xE6, 0xB3, 0x8C, 0x43, 0xE6, 0xB3, 0x8D, 0x43, 0xE6, 0xB3, 0xA5, 0x43, 0xE6, 0xB3, 0xA8, 0x43, 0xE6, 0xB4, 0x96, 0x43, 0xE6, 0xB4, 0x9B, 0x43, 0xE6, // Bytes f00 - f3f 0xB4, 0x9E, 0x43, 0xE6, 0xB4, 0xB4, 0x43, 0xE6, 0xB4, 0xBE, 0x43, 0xE6, 0xB5, 0x81, 0x43, 0xE6, 0xB5, 0xA9, 0x43, 0xE6, 0xB5, 0xAA, 0x43, 0xE6, 0xB5, 0xB7, 0x43, 0xE6, 0xB5, 0xB8, 0x43, 0xE6, 0xB6, 0x85, 0x43, 0xE6, 0xB7, 0x8B, 0x43, 0xE6, 0xB7, 0x9A, 0x43, 0xE6, 0xB7, 0xAA, 0x43, 0xE6, 0xB7, 0xB9, 0x43, 0xE6, 0xB8, 0x9A, 0x43, 0xE6, 0xB8, 0xAF, 0x43, 0xE6, 0xB9, 0xAE, 0x43, 0xE6, // Bytes f40 - f7f 0xBA, 0x80, 0x43, 0xE6, 0xBA, 0x9C, 0x43, 0xE6, 0xBA, 0xBA, 0x43, 0xE6, 0xBB, 0x87, 0x43, 0xE6, 0xBB, 0x8B, 0x43, 0xE6, 0xBB, 0x91, 0x43, 0xE6, 0xBB, 0x9B, 0x43, 0xE6, 0xBC, 0x8F, 0x43, 0xE6, 0xBC, 0x94, 0x43, 0xE6, 0xBC, 0xA2, 0x43, 0xE6, 0xBC, 0xA3, 0x43, 0xE6, 0xBD, 0xAE, 0x43, 0xE6, 0xBF, 0x86, 0x43, 0xE6, 0xBF, 0xAB, 0x43, 0xE6, 0xBF, 0xBE, 0x43, 0xE7, 0x80, 0x9B, 0x43, 0xE7, // Bytes f80 - fbf 0x80, 0x9E, 0x43, 0xE7, 0x80, 0xB9, 0x43, 0xE7, 0x81, 0x8A, 0x43, 0xE7, 0x81, 0xAB, 0x43, 0xE7, 0x81, 0xB0, 0x43, 0xE7, 0x81, 0xB7, 0x43, 0xE7, 0x81, 0xBD, 0x43, 0xE7, 0x82, 0x99, 0x43, 0xE7, 0x82, 0xAD, 0x43, 0xE7, 0x83, 0x88, 0x43, 0xE7, 0x83, 0x99, 0x43, 0xE7, 0x84, 0xA1, 0x43, 0xE7, 0x85, 0x85, 0x43, 0xE7, 0x85, 0x89, 0x43, 0xE7, 0x85, 0xAE, 0x43, 0xE7, 0x86, 0x9C, 0x43, 0xE7, // Bytes fc0 - fff 0x87, 0x8E, 0x43, 0xE7, 0x87, 0x90, 0x43, 0xE7, 0x88, 0x90, 0x43, 0xE7, 0x88, 0x9B, 0x43, 0xE7, 0x88, 0xA8, 0x43, 0xE7, 0x88, 0xAA, 0x43, 0xE7, 0x88, 0xAB, 0x43, 0xE7, 0x88, 0xB5, 0x43, 0xE7, 0x88, 0xB6, 0x43, 0xE7, 0x88, 0xBB, 0x43, 0xE7, 0x88, 0xBF, 0x43, 0xE7, 0x89, 0x87, 0x43, 0xE7, 0x89, 0x90, 0x43, 0xE7, 0x89, 0x99, 0x43, 0xE7, 0x89, 0x9B, 0x43, 0xE7, 0x89, 0xA2, 0x43, 0xE7, // Bytes 1000 - 103f 0x89, 0xB9, 0x43, 0xE7, 0x8A, 0x80, 0x43, 0xE7, 0x8A, 0x95, 0x43, 0xE7, 0x8A, 0xAC, 0x43, 0xE7, 0x8A, 0xAF, 0x43, 0xE7, 0x8B, 0x80, 0x43, 0xE7, 0x8B, 0xBC, 0x43, 0xE7, 0x8C, 0xAA, 0x43, 0xE7, 0x8D, 0xB5, 0x43, 0xE7, 0x8D, 0xBA, 0x43, 0xE7, 0x8E, 0x84, 0x43, 0xE7, 0x8E, 0x87, 0x43, 0xE7, 0x8E, 0x89, 0x43, 0xE7, 0x8E, 0x8B, 0x43, 0xE7, 0x8E, 0xA5, 0x43, 0xE7, 0x8E, 0xB2, 0x43, 0xE7, // Bytes 1040 - 107f 0x8F, 0x9E, 0x43, 0xE7, 0x90, 0x86, 0x43, 0xE7, 0x90, 0x89, 0x43, 0xE7, 0x90, 0xA2, 0x43, 0xE7, 0x91, 0x87, 0x43, 0xE7, 0x91, 0x9C, 0x43, 0xE7, 0x91, 0xA9, 0x43, 0xE7, 0x91, 0xB1, 0x43, 0xE7, 0x92, 0x85, 0x43, 0xE7, 0x92, 0x89, 0x43, 0xE7, 0x92, 0x98, 0x43, 0xE7, 0x93, 0x8A, 0x43, 0xE7, 0x93, 0x9C, 0x43, 0xE7, 0x93, 0xA6, 0x43, 0xE7, 0x94, 0x86, 0x43, 0xE7, 0x94, 0x98, 0x43, 0xE7, // Bytes 1080 - 10bf 0x94, 0x9F, 0x43, 0xE7, 0x94, 0xA4, 0x43, 0xE7, 0x94, 0xA8, 0x43, 0xE7, 0x94, 0xB0, 0x43, 0xE7, 0x94, 0xB2, 0x43, 0xE7, 0x94, 0xB3, 0x43, 0xE7, 0x94, 0xB7, 0x43, 0xE7, 0x94, 0xBB, 0x43, 0xE7, 0x94, 0xBE, 0x43, 0xE7, 0x95, 0x99, 0x43, 0xE7, 0x95, 0xA5, 0x43, 0xE7, 0x95, 0xB0, 0x43, 0xE7, 0x96, 0x8B, 0x43, 0xE7, 0x96, 0x92, 0x43, 0xE7, 0x97, 0xA2, 0x43, 0xE7, 0x98, 0x90, 0x43, 0xE7, // Bytes 10c0 - 10ff 0x98, 0x9D, 0x43, 0xE7, 0x98, 0x9F, 0x43, 0xE7, 0x99, 0x82, 0x43, 0xE7, 0x99, 0xA9, 0x43, 0xE7, 0x99, 0xB6, 0x43, 0xE7, 0x99, 0xBD, 0x43, 0xE7, 0x9A, 0xAE, 0x43, 0xE7, 0x9A, 0xBF, 0x43, 0xE7, 0x9B, 0x8A, 0x43, 0xE7, 0x9B, 0x9B, 0x43, 0xE7, 0x9B, 0xA3, 0x43, 0xE7, 0x9B, 0xA7, 0x43, 0xE7, 0x9B, 0xAE, 0x43, 0xE7, 0x9B, 0xB4, 0x43, 0xE7, 0x9C, 0x81, 0x43, 0xE7, 0x9C, 0x9E, 0x43, 0xE7, // Bytes 1100 - 113f 0x9C, 0x9F, 0x43, 0xE7, 0x9D, 0x80, 0x43, 0xE7, 0x9D, 0x8A, 0x43, 0xE7, 0x9E, 0x8B, 0x43, 0xE7, 0x9E, 0xA7, 0x43, 0xE7, 0x9F, 0x9B, 0x43, 0xE7, 0x9F, 0xA2, 0x43, 0xE7, 0x9F, 0xB3, 0x43, 0xE7, 0xA1, 0x8E, 0x43, 0xE7, 0xA1, 0xAB, 0x43, 0xE7, 0xA2, 0x8C, 0x43, 0xE7, 0xA2, 0x91, 0x43, 0xE7, 0xA3, 0x8A, 0x43, 0xE7, 0xA3, 0x8C, 0x43, 0xE7, 0xA3, 0xBB, 0x43, 0xE7, 0xA4, 0xAA, 0x43, 0xE7, // Bytes 1140 - 117f 0xA4, 0xBA, 0x43, 0xE7, 0xA4, 0xBC, 0x43, 0xE7, 0xA4, 0xBE, 0x43, 0xE7, 0xA5, 0x88, 0x43, 0xE7, 0xA5, 0x89, 0x43, 0xE7, 0xA5, 0x90, 0x43, 0xE7, 0xA5, 0x96, 0x43, 0xE7, 0xA5, 0x9D, 0x43, 0xE7, 0xA5, 0x9E, 0x43, 0xE7, 0xA5, 0xA5, 0x43, 0xE7, 0xA5, 0xBF, 0x43, 0xE7, 0xA6, 0x81, 0x43, 0xE7, 0xA6, 0x8D, 0x43, 0xE7, 0xA6, 0x8E, 0x43, 0xE7, 0xA6, 0x8F, 0x43, 0xE7, 0xA6, 0xAE, 0x43, 0xE7, // Bytes 1180 - 11bf 0xA6, 0xB8, 0x43, 0xE7, 0xA6, 0xBE, 0x43, 0xE7, 0xA7, 0x8A, 0x43, 0xE7, 0xA7, 0x98, 0x43, 0xE7, 0xA7, 0xAB, 0x43, 0xE7, 0xA8, 0x9C, 0x43, 0xE7, 0xA9, 0x80, 0x43, 0xE7, 0xA9, 0x8A, 0x43, 0xE7, 0xA9, 0x8F, 0x43, 0xE7, 0xA9, 0xB4, 0x43, 0xE7, 0xA9, 0xBA, 0x43, 0xE7, 0xAA, 0x81, 0x43, 0xE7, 0xAA, 0xB1, 0x43, 0xE7, 0xAB, 0x8B, 0x43, 0xE7, 0xAB, 0xAE, 0x43, 0xE7, 0xAB, 0xB9, 0x43, 0xE7, // Bytes 11c0 - 11ff 0xAC, 0xA0, 0x43, 0xE7, 0xAE, 0x8F, 0x43, 0xE7, 0xAF, 0x80, 0x43, 0xE7, 0xAF, 0x86, 0x43, 0xE7, 0xAF, 0x89, 0x43, 0xE7, 0xB0, 0xBE, 0x43, 0xE7, 0xB1, 0xA0, 0x43, 0xE7, 0xB1, 0xB3, 0x43, 0xE7, 0xB1, 0xBB, 0x43, 0xE7, 0xB2, 0x92, 0x43, 0xE7, 0xB2, 0xBE, 0x43, 0xE7, 0xB3, 0x92, 0x43, 0xE7, 0xB3, 0x96, 0x43, 0xE7, 0xB3, 0xA3, 0x43, 0xE7, 0xB3, 0xA7, 0x43, 0xE7, 0xB3, 0xA8, 0x43, 0xE7, // Bytes 1200 - 123f 0xB3, 0xB8, 0x43, 0xE7, 0xB4, 0x80, 0x43, 0xE7, 0xB4, 0x90, 0x43, 0xE7, 0xB4, 0xA2, 0x43, 0xE7, 0xB4, 0xAF, 0x43, 0xE7, 0xB5, 0x82, 0x43, 0xE7, 0xB5, 0x9B, 0x43, 0xE7, 0xB5, 0xA3, 0x43, 0xE7, 0xB6, 0xA0, 0x43, 0xE7, 0xB6, 0xBE, 0x43, 0xE7, 0xB7, 0x87, 0x43, 0xE7, 0xB7, 0xB4, 0x43, 0xE7, 0xB8, 0x82, 0x43, 0xE7, 0xB8, 0x89, 0x43, 0xE7, 0xB8, 0xB7, 0x43, 0xE7, 0xB9, 0x81, 0x43, 0xE7, // Bytes 1240 - 127f 0xB9, 0x85, 0x43, 0xE7, 0xBC, 0xB6, 0x43, 0xE7, 0xBC, 0xBE, 0x43, 0xE7, 0xBD, 0x91, 0x43, 0xE7, 0xBD, 0xB2, 0x43, 0xE7, 0xBD, 0xB9, 0x43, 0xE7, 0xBD, 0xBA, 0x43, 0xE7, 0xBE, 0x85, 0x43, 0xE7, 0xBE, 0x8A, 0x43, 0xE7, 0xBE, 0x95, 0x43, 0xE7, 0xBE, 0x9A, 0x43, 0xE7, 0xBE, 0xBD, 0x43, 0xE7, 0xBF, 0xBA, 0x43, 0xE8, 0x80, 0x81, 0x43, 0xE8, 0x80, 0x85, 0x43, 0xE8, 0x80, 0x8C, 0x43, 0xE8, // Bytes 1280 - 12bf 0x80, 0x92, 0x43, 0xE8, 0x80, 0xB3, 0x43, 0xE8, 0x81, 0x86, 0x43, 0xE8, 0x81, 0xA0, 0x43, 0xE8, 0x81, 0xAF, 0x43, 0xE8, 0x81, 0xB0, 0x43, 0xE8, 0x81, 0xBE, 0x43, 0xE8, 0x81, 0xBF, 0x43, 0xE8, 0x82, 0x89, 0x43, 0xE8, 0x82, 0x8B, 0x43, 0xE8, 0x82, 0xAD, 0x43, 0xE8, 0x82, 0xB2, 0x43, 0xE8, 0x84, 0x83, 0x43, 0xE8, 0x84, 0xBE, 0x43, 0xE8, 0x87, 0x98, 0x43, 0xE8, 0x87, 0xA3, 0x43, 0xE8, // Bytes 12c0 - 12ff 0x87, 0xA8, 0x43, 0xE8, 0x87, 0xAA, 0x43, 0xE8, 0x87, 0xAD, 0x43, 0xE8, 0x87, 0xB3, 0x43, 0xE8, 0x87, 0xBC, 0x43, 0xE8, 0x88, 0x81, 0x43, 0xE8, 0x88, 0x84, 0x43, 0xE8, 0x88, 0x8C, 0x43, 0xE8, 0x88, 0x98, 0x43, 0xE8, 0x88, 0x9B, 0x43, 0xE8, 0x88, 0x9F, 0x43, 0xE8, 0x89, 0xAE, 0x43, 0xE8, 0x89, 0xAF, 0x43, 0xE8, 0x89, 0xB2, 0x43, 0xE8, 0x89, 0xB8, 0x43, 0xE8, 0x89, 0xB9, 0x43, 0xE8, // Bytes 1300 - 133f 0x8A, 0x8B, 0x43, 0xE8, 0x8A, 0x91, 0x43, 0xE8, 0x8A, 0x9D, 0x43, 0xE8, 0x8A, 0xB1, 0x43, 0xE8, 0x8A, 0xB3, 0x43, 0xE8, 0x8A, 0xBD, 0x43, 0xE8, 0x8B, 0xA5, 0x43, 0xE8, 0x8B, 0xA6, 0x43, 0xE8, 0x8C, 0x9D, 0x43, 0xE8, 0x8C, 0xA3, 0x43, 0xE8, 0x8C, 0xB6, 0x43, 0xE8, 0x8D, 0x92, 0x43, 0xE8, 0x8D, 0x93, 0x43, 0xE8, 0x8D, 0xA3, 0x43, 0xE8, 0x8E, 0xAD, 0x43, 0xE8, 0x8E, 0xBD, 0x43, 0xE8, // Bytes 1340 - 137f 0x8F, 0x89, 0x43, 0xE8, 0x8F, 0x8A, 0x43, 0xE8, 0x8F, 0x8C, 0x43, 0xE8, 0x8F, 0x9C, 0x43, 0xE8, 0x8F, 0xA7, 0x43, 0xE8, 0x8F, 0xAF, 0x43, 0xE8, 0x8F, 0xB1, 0x43, 0xE8, 0x90, 0xBD, 0x43, 0xE8, 0x91, 0x89, 0x43, 0xE8, 0x91, 0x97, 0x43, 0xE8, 0x93, 0xAE, 0x43, 0xE8, 0x93, 0xB1, 0x43, 0xE8, 0x93, 0xB3, 0x43, 0xE8, 0x93, 0xBC, 0x43, 0xE8, 0x94, 0x96, 0x43, 0xE8, 0x95, 0xA4, 0x43, 0xE8, // Bytes 1380 - 13bf 0x97, 0x8D, 0x43, 0xE8, 0x97, 0xBA, 0x43, 0xE8, 0x98, 0x86, 0x43, 0xE8, 0x98, 0x92, 0x43, 0xE8, 0x98, 0xAD, 0x43, 0xE8, 0x98, 0xBF, 0x43, 0xE8, 0x99, 0x8D, 0x43, 0xE8, 0x99, 0x90, 0x43, 0xE8, 0x99, 0x9C, 0x43, 0xE8, 0x99, 0xA7, 0x43, 0xE8, 0x99, 0xA9, 0x43, 0xE8, 0x99, 0xAB, 0x43, 0xE8, 0x9A, 0x88, 0x43, 0xE8, 0x9A, 0xA9, 0x43, 0xE8, 0x9B, 0xA2, 0x43, 0xE8, 0x9C, 0x8E, 0x43, 0xE8, // Bytes 13c0 - 13ff 0x9C, 0xA8, 0x43, 0xE8, 0x9D, 0xAB, 0x43, 0xE8, 0x9D, 0xB9, 0x43, 0xE8, 0x9E, 0x86, 0x43, 0xE8, 0x9E, 0xBA, 0x43, 0xE8, 0x9F, 0xA1, 0x43, 0xE8, 0xA0, 0x81, 0x43, 0xE8, 0xA0, 0x9F, 0x43, 0xE8, 0xA1, 0x80, 0x43, 0xE8, 0xA1, 0x8C, 0x43, 0xE8, 0xA1, 0xA0, 0x43, 0xE8, 0xA1, 0xA3, 0x43, 0xE8, 0xA3, 0x82, 0x43, 0xE8, 0xA3, 0x8F, 0x43, 0xE8, 0xA3, 0x97, 0x43, 0xE8, 0xA3, 0x9E, 0x43, 0xE8, // Bytes 1400 - 143f 0xA3, 0xA1, 0x43, 0xE8, 0xA3, 0xB8, 0x43, 0xE8, 0xA3, 0xBA, 0x43, 0xE8, 0xA4, 0x90, 0x43, 0xE8, 0xA5, 0x81, 0x43, 0xE8, 0xA5, 0xA4, 0x43, 0xE8, 0xA5, 0xBE, 0x43, 0xE8, 0xA6, 0x86, 0x43, 0xE8, 0xA6, 0x8B, 0x43, 0xE8, 0xA6, 0x96, 0x43, 0xE8, 0xA7, 0x92, 0x43, 0xE8, 0xA7, 0xA3, 0x43, 0xE8, 0xA8, 0x80, 0x43, 0xE8, 0xAA, 0xA0, 0x43, 0xE8, 0xAA, 0xAA, 0x43, 0xE8, 0xAA, 0xBF, 0x43, 0xE8, // Bytes 1440 - 147f 0xAB, 0x8B, 0x43, 0xE8, 0xAB, 0x92, 0x43, 0xE8, 0xAB, 0x96, 0x43, 0xE8, 0xAB, 0xAD, 0x43, 0xE8, 0xAB, 0xB8, 0x43, 0xE8, 0xAB, 0xBE, 0x43, 0xE8, 0xAC, 0x81, 0x43, 0xE8, 0xAC, 0xB9, 0x43, 0xE8, 0xAD, 0x98, 0x43, 0xE8, 0xAE, 0x80, 0x43, 0xE8, 0xAE, 0x8A, 0x43, 0xE8, 0xB0, 0xB7, 0x43, 0xE8, 0xB1, 0x86, 0x43, 0xE8, 0xB1, 0x88, 0x43, 0xE8, 0xB1, 0x95, 0x43, 0xE8, 0xB1, 0xB8, 0x43, 0xE8, // Bytes 1480 - 14bf 0xB2, 0x9D, 0x43, 0xE8, 0xB2, 0xA1, 0x43, 0xE8, 0xB2, 0xA9, 0x43, 0xE8, 0xB2, 0xAB, 0x43, 0xE8, 0xB3, 0x81, 0x43, 0xE8, 0xB3, 0x82, 0x43, 0xE8, 0xB3, 0x87, 0x43, 0xE8, 0xB3, 0x88, 0x43, 0xE8, 0xB3, 0x93, 0x43, 0xE8, 0xB4, 0x88, 0x43, 0xE8, 0xB4, 0x9B, 0x43, 0xE8, 0xB5, 0xA4, 0x43, 0xE8, 0xB5, 0xB0, 0x43, 0xE8, 0xB5, 0xB7, 0x43, 0xE8, 0xB6, 0xB3, 0x43, 0xE8, 0xB6, 0xBC, 0x43, 0xE8, // Bytes 14c0 - 14ff 0xB7, 0x8B, 0x43, 0xE8, 0xB7, 0xAF, 0x43, 0xE8, 0xB7, 0xB0, 0x43, 0xE8, 0xBA, 0xAB, 0x43, 0xE8, 0xBB, 0x8A, 0x43, 0xE8, 0xBB, 0x94, 0x43, 0xE8, 0xBC, 0xA6, 0x43, 0xE8, 0xBC, 0xAA, 0x43, 0xE8, 0xBC, 0xB8, 0x43, 0xE8, 0xBC, 0xBB, 0x43, 0xE8, 0xBD, 0xA2, 0x43, 0xE8, 0xBE, 0x9B, 0x43, 0xE8, 0xBE, 0x9E, 0x43, 0xE8, 0xBE, 0xB0, 0x43, 0xE8, 0xBE, 0xB5, 0x43, 0xE8, 0xBE, 0xB6, 0x43, 0xE9, // Bytes 1500 - 153f 0x80, 0xA3, 0x43, 0xE9, 0x80, 0xB8, 0x43, 0xE9, 0x81, 0x8A, 0x43, 0xE9, 0x81, 0xA9, 0x43, 0xE9, 0x81, 0xB2, 0x43, 0xE9, 0x81, 0xBC, 0x43, 0xE9, 0x82, 0x8F, 0x43, 0xE9, 0x82, 0x91, 0x43, 0xE9, 0x82, 0x94, 0x43, 0xE9, 0x83, 0x8E, 0x43, 0xE9, 0x83, 0x9E, 0x43, 0xE9, 0x83, 0xB1, 0x43, 0xE9, 0x83, 0xBD, 0x43, 0xE9, 0x84, 0x91, 0x43, 0xE9, 0x84, 0x9B, 0x43, 0xE9, 0x85, 0x89, 0x43, 0xE9, // Bytes 1540 - 157f 0x85, 0x8D, 0x43, 0xE9, 0x85, 0xAA, 0x43, 0xE9, 0x86, 0x99, 0x43, 0xE9, 0x86, 0xB4, 0x43, 0xE9, 0x87, 0x86, 0x43, 0xE9, 0x87, 0x8C, 0x43, 0xE9, 0x87, 0x8F, 0x43, 0xE9, 0x87, 0x91, 0x43, 0xE9, 0x88, 0xB4, 0x43, 0xE9, 0x88, 0xB8, 0x43, 0xE9, 0x89, 0xB6, 0x43, 0xE9, 0x89, 0xBC, 0x43, 0xE9, 0x8B, 0x97, 0x43, 0xE9, 0x8B, 0x98, 0x43, 0xE9, 0x8C, 0x84, 0x43, 0xE9, 0x8D, 0x8A, 0x43, 0xE9, // Bytes 1580 - 15bf 0x8F, 0xB9, 0x43, 0xE9, 0x90, 0x95, 0x43, 0xE9, 0x95, 0xB7, 0x43, 0xE9, 0x96, 0x80, 0x43, 0xE9, 0x96, 0x8B, 0x43, 0xE9, 0x96, 0xAD, 0x43, 0xE9, 0x96, 0xB7, 0x43, 0xE9, 0x98, 0x9C, 0x43, 0xE9, 0x98, 0xAE, 0x43, 0xE9, 0x99, 0x8B, 0x43, 0xE9, 0x99, 0x8D, 0x43, 0xE9, 0x99, 0xB5, 0x43, 0xE9, 0x99, 0xB8, 0x43, 0xE9, 0x99, 0xBC, 0x43, 0xE9, 0x9A, 0x86, 0x43, 0xE9, 0x9A, 0xA3, 0x43, 0xE9, // Bytes 15c0 - 15ff 0x9A, 0xB6, 0x43, 0xE9, 0x9A, 0xB7, 0x43, 0xE9, 0x9A, 0xB8, 0x43, 0xE9, 0x9A, 0xB9, 0x43, 0xE9, 0x9B, 0x83, 0x43, 0xE9, 0x9B, 0xA2, 0x43, 0xE9, 0x9B, 0xA3, 0x43, 0xE9, 0x9B, 0xA8, 0x43, 0xE9, 0x9B, 0xB6, 0x43, 0xE9, 0x9B, 0xB7, 0x43, 0xE9, 0x9C, 0xA3, 0x43, 0xE9, 0x9C, 0xB2, 0x43, 0xE9, 0x9D, 0x88, 0x43, 0xE9, 0x9D, 0x91, 0x43, 0xE9, 0x9D, 0x96, 0x43, 0xE9, 0x9D, 0x9E, 0x43, 0xE9, // Bytes 1600 - 163f 0x9D, 0xA2, 0x43, 0xE9, 0x9D, 0xA9, 0x43, 0xE9, 0x9F, 0x8B, 0x43, 0xE9, 0x9F, 0x9B, 0x43, 0xE9, 0x9F, 0xA0, 0x43, 0xE9, 0x9F, 0xAD, 0x43, 0xE9, 0x9F, 0xB3, 0x43, 0xE9, 0x9F, 0xBF, 0x43, 0xE9, 0xA0, 0x81, 0x43, 0xE9, 0xA0, 0x85, 0x43, 0xE9, 0xA0, 0x8B, 0x43, 0xE9, 0xA0, 0x98, 0x43, 0xE9, 0xA0, 0xA9, 0x43, 0xE9, 0xA0, 0xBB, 0x43, 0xE9, 0xA1, 0x9E, 0x43, 0xE9, 0xA2, 0xA8, 0x43, 0xE9, // Bytes 1640 - 167f 0xA3, 0x9B, 0x43, 0xE9, 0xA3, 0x9F, 0x43, 0xE9, 0xA3, 0xA2, 0x43, 0xE9, 0xA3, 0xAF, 0x43, 0xE9, 0xA3, 0xBC, 0x43, 0xE9, 0xA4, 0xA8, 0x43, 0xE9, 0xA4, 0xA9, 0x43, 0xE9, 0xA6, 0x96, 0x43, 0xE9, 0xA6, 0x99, 0x43, 0xE9, 0xA6, 0xA7, 0x43, 0xE9, 0xA6, 0xAC, 0x43, 0xE9, 0xA7, 0x82, 0x43, 0xE9, 0xA7, 0xB1, 0x43, 0xE9, 0xA7, 0xBE, 0x43, 0xE9, 0xA9, 0xAA, 0x43, 0xE9, 0xAA, 0xA8, 0x43, 0xE9, // Bytes 1680 - 16bf 0xAB, 0x98, 0x43, 0xE9, 0xAB, 0x9F, 0x43, 0xE9, 0xAC, 0x92, 0x43, 0xE9, 0xAC, 0xA5, 0x43, 0xE9, 0xAC, 0xAF, 0x43, 0xE9, 0xAC, 0xB2, 0x43, 0xE9, 0xAC, 0xBC, 0x43, 0xE9, 0xAD, 0x9A, 0x43, 0xE9, 0xAD, 0xAF, 0x43, 0xE9, 0xB1, 0x80, 0x43, 0xE9, 0xB1, 0x97, 0x43, 0xE9, 0xB3, 0xA5, 0x43, 0xE9, 0xB3, 0xBD, 0x43, 0xE9, 0xB5, 0xA7, 0x43, 0xE9, 0xB6, 0xB4, 0x43, 0xE9, 0xB7, 0xBA, 0x43, 0xE9, // Bytes 16c0 - 16ff 0xB8, 0x9E, 0x43, 0xE9, 0xB9, 0xB5, 0x43, 0xE9, 0xB9, 0xBF, 0x43, 0xE9, 0xBA, 0x97, 0x43, 0xE9, 0xBA, 0x9F, 0x43, 0xE9, 0xBA, 0xA5, 0x43, 0xE9, 0xBA, 0xBB, 0x43, 0xE9, 0xBB, 0x83, 0x43, 0xE9, 0xBB, 0x8D, 0x43, 0xE9, 0xBB, 0x8E, 0x43, 0xE9, 0xBB, 0x91, 0x43, 0xE9, 0xBB, 0xB9, 0x43, 0xE9, 0xBB, 0xBD, 0x43, 0xE9, 0xBB, 0xBE, 0x43, 0xE9, 0xBC, 0x85, 0x43, 0xE9, 0xBC, 0x8E, 0x43, 0xE9, // Bytes 1700 - 173f 0xBC, 0x8F, 0x43, 0xE9, 0xBC, 0x93, 0x43, 0xE9, 0xBC, 0x96, 0x43, 0xE9, 0xBC, 0xA0, 0x43, 0xE9, 0xBC, 0xBB, 0x43, 0xE9, 0xBD, 0x83, 0x43, 0xE9, 0xBD, 0x8A, 0x43, 0xE9, 0xBD, 0x92, 0x43, 0xE9, 0xBE, 0x8D, 0x43, 0xE9, 0xBE, 0x8E, 0x43, 0xE9, 0xBE, 0x9C, 0x43, 0xE9, 0xBE, 0x9F, 0x43, 0xE9, 0xBE, 0xA0, 0x43, 0xEA, 0x99, 0x91, 0x43, 0xEA, 0x9A, 0x89, 0x43, 0xEA, 0x9C, 0xA7, 0x43, 0xEA, // Bytes 1740 - 177f 0x9D, 0xAF, 0x43, 0xEA, 0x9E, 0x8E, 0x43, 0xEA, 0xAC, 0xB7, 0x43, 0xEA, 0xAD, 0x92, 0x43, 0xEA, 0xAD, 0xA6, 0x43, 0xEA, 0xAD, 0xA7, 0x44, 0xF0, 0x9D, 0xBC, 0x84, 0x44, 0xF0, 0x9D, 0xBC, 0x85, 0x44, 0xF0, 0x9D, 0xBC, 0x86, 0x44, 0xF0, 0x9D, 0xBC, 0x88, 0x44, 0xF0, 0x9D, 0xBC, 0x8A, 0x44, 0xF0, 0x9D, 0xBC, 0x9E, 0x44, 0xF0, 0xA0, 0x84, 0xA2, 0x44, 0xF0, 0xA0, 0x94, 0x9C, 0x44, 0xF0, // Bytes 1780 - 17bf 0xA0, 0x94, 0xA5, 0x44, 0xF0, 0xA0, 0x95, 0x8B, 0x44, 0xF0, 0xA0, 0x98, 0xBA, 0x44, 0xF0, 0xA0, 0xA0, 0x84, 0x44, 0xF0, 0xA0, 0xA3, 0x9E, 0x44, 0xF0, 0xA0, 0xA8, 0xAC, 0x44, 0xF0, 0xA0, 0xAD, 0xA3, 0x44, 0xF0, 0xA1, 0x93, 0xA4, 0x44, 0xF0, 0xA1, 0x9A, 0xA8, 0x44, 0xF0, 0xA1, 0x9B, 0xAA, 0x44, 0xF0, 0xA1, 0xA7, 0x88, 0x44, 0xF0, 0xA1, 0xAC, 0x98, 0x44, 0xF0, 0xA1, 0xB4, 0x8B, 0x44, // Bytes 17c0 - 17ff 0xF0, 0xA1, 0xB7, 0xA4, 0x44, 0xF0, 0xA1, 0xB7, 0xA6, 0x44, 0xF0, 0xA2, 0x86, 0x83, 0x44, 0xF0, 0xA2, 0x86, 0x9F, 0x44, 0xF0, 0xA2, 0x8C, 0xB1, 0x44, 0xF0, 0xA2, 0x9B, 0x94, 0x44, 0xF0, 0xA2, 0xA1, 0x84, 0x44, 0xF0, 0xA2, 0xA1, 0x8A, 0x44, 0xF0, 0xA2, 0xAC, 0x8C, 0x44, 0xF0, 0xA2, 0xAF, 0xB1, 0x44, 0xF0, 0xA3, 0x80, 0x8A, 0x44, 0xF0, 0xA3, 0x8A, 0xB8, 0x44, 0xF0, 0xA3, 0x8D, 0x9F, // Bytes 1800 - 183f 0x44, 0xF0, 0xA3, 0x8E, 0x93, 0x44, 0xF0, 0xA3, 0x8E, 0x9C, 0x44, 0xF0, 0xA3, 0x8F, 0x83, 0x44, 0xF0, 0xA3, 0x8F, 0x95, 0x44, 0xF0, 0xA3, 0x91, 0xAD, 0x44, 0xF0, 0xA3, 0x9A, 0xA3, 0x44, 0xF0, 0xA3, 0xA2, 0xA7, 0x44, 0xF0, 0xA3, 0xAA, 0x8D, 0x44, 0xF0, 0xA3, 0xAB, 0xBA, 0x44, 0xF0, 0xA3, 0xB2, 0xBC, 0x44, 0xF0, 0xA3, 0xB4, 0x9E, 0x44, 0xF0, 0xA3, 0xBB, 0x91, 0x44, 0xF0, 0xA3, 0xBD, // Bytes 1840 - 187f 0x9E, 0x44, 0xF0, 0xA3, 0xBE, 0x8E, 0x44, 0xF0, 0xA4, 0x89, 0xA3, 0x44, 0xF0, 0xA4, 0x8B, 0xAE, 0x44, 0xF0, 0xA4, 0x8E, 0xAB, 0x44, 0xF0, 0xA4, 0x98, 0x88, 0x44, 0xF0, 0xA4, 0x9C, 0xB5, 0x44, 0xF0, 0xA4, 0xA0, 0x94, 0x44, 0xF0, 0xA4, 0xB0, 0xB6, 0x44, 0xF0, 0xA4, 0xB2, 0x92, 0x44, 0xF0, 0xA4, 0xBE, 0xA1, 0x44, 0xF0, 0xA4, 0xBE, 0xB8, 0x44, 0xF0, 0xA5, 0x81, 0x84, 0x44, 0xF0, 0xA5, // Bytes 1880 - 18bf 0x83, 0xB2, 0x44, 0xF0, 0xA5, 0x83, 0xB3, 0x44, 0xF0, 0xA5, 0x84, 0x99, 0x44, 0xF0, 0xA5, 0x84, 0xB3, 0x44, 0xF0, 0xA5, 0x89, 0x89, 0x44, 0xF0, 0xA5, 0x90, 0x9D, 0x44, 0xF0, 0xA5, 0x98, 0xA6, 0x44, 0xF0, 0xA5, 0x9A, 0x9A, 0x44, 0xF0, 0xA5, 0x9B, 0x85, 0x44, 0xF0, 0xA5, 0xA5, 0xBC, 0x44, 0xF0, 0xA5, 0xAA, 0xA7, 0x44, 0xF0, 0xA5, 0xAE, 0xAB, 0x44, 0xF0, 0xA5, 0xB2, 0x80, 0x44, 0xF0, // Bytes 18c0 - 18ff 0xA5, 0xB3, 0x90, 0x44, 0xF0, 0xA5, 0xBE, 0x86, 0x44, 0xF0, 0xA6, 0x87, 0x9A, 0x44, 0xF0, 0xA6, 0x88, 0xA8, 0x44, 0xF0, 0xA6, 0x89, 0x87, 0x44, 0xF0, 0xA6, 0x8B, 0x99, 0x44, 0xF0, 0xA6, 0x8C, 0xBE, 0x44, 0xF0, 0xA6, 0x93, 0x9A, 0x44, 0xF0, 0xA6, 0x94, 0xA3, 0x44, 0xF0, 0xA6, 0x96, 0xA8, 0x44, 0xF0, 0xA6, 0x9E, 0xA7, 0x44, 0xF0, 0xA6, 0x9E, 0xB5, 0x44, 0xF0, 0xA6, 0xAC, 0xBC, 0x44, // Bytes 1900 - 193f 0xF0, 0xA6, 0xB0, 0xB6, 0x44, 0xF0, 0xA6, 0xB3, 0x95, 0x44, 0xF0, 0xA6, 0xB5, 0xAB, 0x44, 0xF0, 0xA6, 0xBC, 0xAC, 0x44, 0xF0, 0xA6, 0xBE, 0xB1, 0x44, 0xF0, 0xA7, 0x83, 0x92, 0x44, 0xF0, 0xA7, 0x8F, 0x8A, 0x44, 0xF0, 0xA7, 0x99, 0xA7, 0x44, 0xF0, 0xA7, 0xA2, 0xAE, 0x44, 0xF0, 0xA7, 0xA5, 0xA6, 0x44, 0xF0, 0xA7, 0xB2, 0xA8, 0x44, 0xF0, 0xA7, 0xBB, 0x93, 0x44, 0xF0, 0xA7, 0xBC, 0xAF, // Bytes 1940 - 197f 0x44, 0xF0, 0xA8, 0x97, 0x92, 0x44, 0xF0, 0xA8, 0x97, 0xAD, 0x44, 0xF0, 0xA8, 0x9C, 0xAE, 0x44, 0xF0, 0xA8, 0xAF, 0xBA, 0x44, 0xF0, 0xA8, 0xB5, 0xB7, 0x44, 0xF0, 0xA9, 0x85, 0x85, 0x44, 0xF0, 0xA9, 0x87, 0x9F, 0x44, 0xF0, 0xA9, 0x88, 0x9A, 0x44, 0xF0, 0xA9, 0x90, 0x8A, 0x44, 0xF0, 0xA9, 0x92, 0x96, 0x44, 0xF0, 0xA9, 0x96, 0xB6, 0x44, 0xF0, 0xA9, 0xAC, 0xB0, 0x44, 0xF0, 0xAA, 0x83, // Bytes 1980 - 19bf 0x8E, 0x44, 0xF0, 0xAA, 0x84, 0x85, 0x44, 0xF0, 0xAA, 0x88, 0x8E, 0x44, 0xF0, 0xAA, 0x8A, 0x91, 0x44, 0xF0, 0xAA, 0x8E, 0x92, 0x44, 0xF0, 0xAA, 0x98, 0x80, 0x42, 0x21, 0x21, 0x42, 0x21, 0x3F, 0x42, 0x2E, 0x2E, 0x42, 0x30, 0x2C, 0x42, 0x30, 0x2E, 0x42, 0x31, 0x2C, 0x42, 0x31, 0x2E, 0x42, 0x31, 0x30, 0x42, 0x31, 0x31, 0x42, 0x31, 0x32, 0x42, 0x31, 0x33, 0x42, 0x31, 0x34, 0x42, 0x31, // Bytes 19c0 - 19ff 0x35, 0x42, 0x31, 0x36, 0x42, 0x31, 0x37, 0x42, 0x31, 0x38, 0x42, 0x31, 0x39, 0x42, 0x32, 0x2C, 0x42, 0x32, 0x2E, 0x42, 0x32, 0x30, 0x42, 0x32, 0x31, 0x42, 0x32, 0x32, 0x42, 0x32, 0x33, 0x42, 0x32, 0x34, 0x42, 0x32, 0x35, 0x42, 0x32, 0x36, 0x42, 0x32, 0x37, 0x42, 0x32, 0x38, 0x42, 0x32, 0x39, 0x42, 0x33, 0x2C, 0x42, 0x33, 0x2E, 0x42, 0x33, 0x30, 0x42, 0x33, 0x31, 0x42, 0x33, 0x32, // Bytes 1a00 - 1a3f 0x42, 0x33, 0x33, 0x42, 0x33, 0x34, 0x42, 0x33, 0x35, 0x42, 0x33, 0x36, 0x42, 0x33, 0x37, 0x42, 0x33, 0x38, 0x42, 0x33, 0x39, 0x42, 0x34, 0x2C, 0x42, 0x34, 0x2E, 0x42, 0x34, 0x30, 0x42, 0x34, 0x31, 0x42, 0x34, 0x32, 0x42, 0x34, 0x33, 0x42, 0x34, 0x34, 0x42, 0x34, 0x35, 0x42, 0x34, 0x36, 0x42, 0x34, 0x37, 0x42, 0x34, 0x38, 0x42, 0x34, 0x39, 0x42, 0x35, 0x2C, 0x42, 0x35, 0x2E, 0x42, // Bytes 1a40 - 1a7f 0x35, 0x30, 0x42, 0x36, 0x2C, 0x42, 0x36, 0x2E, 0x42, 0x37, 0x2C, 0x42, 0x37, 0x2E, 0x42, 0x38, 0x2C, 0x42, 0x38, 0x2E, 0x42, 0x39, 0x2C, 0x42, 0x39, 0x2E, 0x42, 0x3D, 0x3D, 0x42, 0x3F, 0x21, 0x42, 0x3F, 0x3F, 0x42, 0x41, 0x55, 0x42, 0x42, 0x71, 0x42, 0x43, 0x44, 0x42, 0x44, 0x4A, 0x42, 0x44, 0x5A, 0x42, 0x44, 0x7A, 0x42, 0x47, 0x42, 0x42, 0x47, 0x79, 0x42, 0x48, 0x50, 0x42, 0x48, // Bytes 1a80 - 1abf 0x56, 0x42, 0x48, 0x67, 0x42, 0x48, 0x7A, 0x42, 0x49, 0x49, 0x42, 0x49, 0x4A, 0x42, 0x49, 0x55, 0x42, 0x49, 0x56, 0x42, 0x49, 0x58, 0x42, 0x4B, 0x42, 0x42, 0x4B, 0x4B, 0x42, 0x4B, 0x4D, 0x42, 0x4C, 0x4A, 0x42, 0x4C, 0x6A, 0x42, 0x4D, 0x42, 0x42, 0x4D, 0x43, 0x42, 0x4D, 0x44, 0x42, 0x4D, 0x52, 0x42, 0x4D, 0x56, 0x42, 0x4D, 0x57, 0x42, 0x4E, 0x4A, 0x42, 0x4E, 0x6A, 0x42, 0x4E, 0x6F, // Bytes 1ac0 - 1aff 0x42, 0x50, 0x48, 0x42, 0x50, 0x52, 0x42, 0x50, 0x61, 0x42, 0x52, 0x73, 0x42, 0x53, 0x44, 0x42, 0x53, 0x4D, 0x42, 0x53, 0x53, 0x42, 0x53, 0x76, 0x42, 0x54, 0x4D, 0x42, 0x56, 0x49, 0x42, 0x57, 0x43, 0x42, 0x57, 0x5A, 0x42, 0x57, 0x62, 0x42, 0x58, 0x49, 0x42, 0x63, 0x63, 0x42, 0x63, 0x64, 0x42, 0x63, 0x6D, 0x42, 0x64, 0x42, 0x42, 0x64, 0x61, 0x42, 0x64, 0x6C, 0x42, 0x64, 0x6D, 0x42, // Bytes 1b00 - 1b3f 0x64, 0x7A, 0x42, 0x65, 0x56, 0x42, 0x66, 0x66, 0x42, 0x66, 0x69, 0x42, 0x66, 0x6C, 0x42, 0x66, 0x6D, 0x42, 0x68, 0x61, 0x42, 0x69, 0x69, 0x42, 0x69, 0x6A, 0x42, 0x69, 0x6E, 0x42, 0x69, 0x76, 0x42, 0x69, 0x78, 0x42, 0x6B, 0x41, 0x42, 0x6B, 0x56, 0x42, 0x6B, 0x57, 0x42, 0x6B, 0x67, 0x42, 0x6B, 0x6C, 0x42, 0x6B, 0x6D, 0x42, 0x6B, 0x74, 0x42, 0x6C, 0x6A, 0x42, 0x6C, 0x6D, 0x42, 0x6C, // Bytes 1b40 - 1b7f 0x6E, 0x42, 0x6C, 0x78, 0x42, 0x6D, 0x32, 0x42, 0x6D, 0x33, 0x42, 0x6D, 0x41, 0x42, 0x6D, 0x56, 0x42, 0x6D, 0x57, 0x42, 0x6D, 0x62, 0x42, 0x6D, 0x67, 0x42, 0x6D, 0x6C, 0x42, 0x6D, 0x6D, 0x42, 0x6D, 0x73, 0x42, 0x6E, 0x41, 0x42, 0x6E, 0x46, 0x42, 0x6E, 0x56, 0x42, 0x6E, 0x57, 0x42, 0x6E, 0x6A, 0x42, 0x6E, 0x6D, 0x42, 0x6E, 0x73, 0x42, 0x6F, 0x56, 0x42, 0x70, 0x41, 0x42, 0x70, 0x46, // Bytes 1b80 - 1bbf 0x42, 0x70, 0x56, 0x42, 0x70, 0x57, 0x42, 0x70, 0x63, 0x42, 0x70, 0x73, 0x42, 0x73, 0x72, 0x42, 0x73, 0x74, 0x42, 0x76, 0x69, 0x42, 0x78, 0x69, 0x43, 0x28, 0x31, 0x29, 0x43, 0x28, 0x32, 0x29, 0x43, 0x28, 0x33, 0x29, 0x43, 0x28, 0x34, 0x29, 0x43, 0x28, 0x35, 0x29, 0x43, 0x28, 0x36, 0x29, 0x43, 0x28, 0x37, 0x29, 0x43, 0x28, 0x38, 0x29, 0x43, 0x28, 0x39, 0x29, 0x43, 0x28, 0x41, 0x29, // Bytes 1bc0 - 1bff 0x43, 0x28, 0x42, 0x29, 0x43, 0x28, 0x43, 0x29, 0x43, 0x28, 0x44, 0x29, 0x43, 0x28, 0x45, 0x29, 0x43, 0x28, 0x46, 0x29, 0x43, 0x28, 0x47, 0x29, 0x43, 0x28, 0x48, 0x29, 0x43, 0x28, 0x49, 0x29, 0x43, 0x28, 0x4A, 0x29, 0x43, 0x28, 0x4B, 0x29, 0x43, 0x28, 0x4C, 0x29, 0x43, 0x28, 0x4D, 0x29, 0x43, 0x28, 0x4E, 0x29, 0x43, 0x28, 0x4F, 0x29, 0x43, 0x28, 0x50, 0x29, 0x43, 0x28, 0x51, 0x29, // Bytes 1c00 - 1c3f 0x43, 0x28, 0x52, 0x29, 0x43, 0x28, 0x53, 0x29, 0x43, 0x28, 0x54, 0x29, 0x43, 0x28, 0x55, 0x29, 0x43, 0x28, 0x56, 0x29, 0x43, 0x28, 0x57, 0x29, 0x43, 0x28, 0x58, 0x29, 0x43, 0x28, 0x59, 0x29, 0x43, 0x28, 0x5A, 0x29, 0x43, 0x28, 0x61, 0x29, 0x43, 0x28, 0x62, 0x29, 0x43, 0x28, 0x63, 0x29, 0x43, 0x28, 0x64, 0x29, 0x43, 0x28, 0x65, 0x29, 0x43, 0x28, 0x66, 0x29, 0x43, 0x28, 0x67, 0x29, // Bytes 1c40 - 1c7f 0x43, 0x28, 0x68, 0x29, 0x43, 0x28, 0x69, 0x29, 0x43, 0x28, 0x6A, 0x29, 0x43, 0x28, 0x6B, 0x29, 0x43, 0x28, 0x6C, 0x29, 0x43, 0x28, 0x6D, 0x29, 0x43, 0x28, 0x6E, 0x29, 0x43, 0x28, 0x6F, 0x29, 0x43, 0x28, 0x70, 0x29, 0x43, 0x28, 0x71, 0x29, 0x43, 0x28, 0x72, 0x29, 0x43, 0x28, 0x73, 0x29, 0x43, 0x28, 0x74, 0x29, 0x43, 0x28, 0x75, 0x29, 0x43, 0x28, 0x76, 0x29, 0x43, 0x28, 0x77, 0x29, // Bytes 1c80 - 1cbf 0x43, 0x28, 0x78, 0x29, 0x43, 0x28, 0x79, 0x29, 0x43, 0x28, 0x7A, 0x29, 0x43, 0x2E, 0x2E, 0x2E, 0x43, 0x31, 0x30, 0x2E, 0x43, 0x31, 0x31, 0x2E, 0x43, 0x31, 0x32, 0x2E, 0x43, 0x31, 0x33, 0x2E, 0x43, 0x31, 0x34, 0x2E, 0x43, 0x31, 0x35, 0x2E, 0x43, 0x31, 0x36, 0x2E, 0x43, 0x31, 0x37, 0x2E, 0x43, 0x31, 0x38, 0x2E, 0x43, 0x31, 0x39, 0x2E, 0x43, 0x32, 0x30, 0x2E, 0x43, 0x3A, 0x3A, 0x3D, // Bytes 1cc0 - 1cff 0x43, 0x3D, 0x3D, 0x3D, 0x43, 0x43, 0x6F, 0x2E, 0x43, 0x46, 0x41, 0x58, 0x43, 0x47, 0x48, 0x7A, 0x43, 0x47, 0x50, 0x61, 0x43, 0x49, 0x49, 0x49, 0x43, 0x4C, 0x54, 0x44, 0x43, 0x4C, 0xC2, 0xB7, 0x43, 0x4D, 0x48, 0x7A, 0x43, 0x4D, 0x50, 0x61, 0x43, 0x4D, 0xCE, 0xA9, 0x43, 0x50, 0x50, 0x4D, 0x43, 0x50, 0x50, 0x56, 0x43, 0x50, 0x54, 0x45, 0x43, 0x54, 0x45, 0x4C, 0x43, 0x54, 0x48, 0x7A, // Bytes 1d00 - 1d3f 0x43, 0x56, 0x49, 0x49, 0x43, 0x58, 0x49, 0x49, 0x43, 0x61, 0x2F, 0x63, 0x43, 0x61, 0x2F, 0x73, 0x43, 0x61, 0xCA, 0xBE, 0x43, 0x62, 0x61, 0x72, 0x43, 0x63, 0x2F, 0x6F, 0x43, 0x63, 0x2F, 0x75, 0x43, 0x63, 0x61, 0x6C, 0x43, 0x63, 0x6D, 0x32, 0x43, 0x63, 0x6D, 0x33, 0x43, 0x64, 0x6D, 0x32, 0x43, 0x64, 0x6D, 0x33, 0x43, 0x65, 0x72, 0x67, 0x43, 0x66, 0x66, 0x69, 0x43, 0x66, 0x66, 0x6C, // Bytes 1d40 - 1d7f 0x43, 0x67, 0x61, 0x6C, 0x43, 0x68, 0x50, 0x61, 0x43, 0x69, 0x69, 0x69, 0x43, 0x6B, 0x48, 0x7A, 0x43, 0x6B, 0x50, 0x61, 0x43, 0x6B, 0x6D, 0x32, 0x43, 0x6B, 0x6D, 0x33, 0x43, 0x6B, 0xCE, 0xA9, 0x43, 0x6C, 0x6F, 0x67, 0x43, 0x6C, 0xC2, 0xB7, 0x43, 0x6D, 0x69, 0x6C, 0x43, 0x6D, 0x6D, 0x32, 0x43, 0x6D, 0x6D, 0x33, 0x43, 0x6D, 0x6F, 0x6C, 0x43, 0x72, 0x61, 0x64, 0x43, 0x76, 0x69, 0x69, // Bytes 1d80 - 1dbf 0x43, 0x78, 0x69, 0x69, 0x43, 0xC2, 0xB0, 0x43, 0x43, 0xC2, 0xB0, 0x46, 0x43, 0xCA, 0xBC, 0x6E, 0x43, 0xCE, 0xBC, 0x41, 0x43, 0xCE, 0xBC, 0x46, 0x43, 0xCE, 0xBC, 0x56, 0x43, 0xCE, 0xBC, 0x57, 0x43, 0xCE, 0xBC, 0x67, 0x43, 0xCE, 0xBC, 0x6C, 0x43, 0xCE, 0xBC, 0x6D, 0x43, 0xCE, 0xBC, 0x73, 0x44, 0x28, 0x31, 0x30, 0x29, 0x44, 0x28, 0x31, 0x31, 0x29, 0x44, 0x28, 0x31, 0x32, 0x29, 0x44, // Bytes 1dc0 - 1dff 0x28, 0x31, 0x33, 0x29, 0x44, 0x28, 0x31, 0x34, 0x29, 0x44, 0x28, 0x31, 0x35, 0x29, 0x44, 0x28, 0x31, 0x36, 0x29, 0x44, 0x28, 0x31, 0x37, 0x29, 0x44, 0x28, 0x31, 0x38, 0x29, 0x44, 0x28, 0x31, 0x39, 0x29, 0x44, 0x28, 0x32, 0x30, 0x29, 0x44, 0x30, 0xE7, 0x82, 0xB9, 0x44, 0x31, 0xE2, 0x81, 0x84, 0x44, 0x31, 0xE6, 0x97, 0xA5, 0x44, 0x31, 0xE6, 0x9C, 0x88, 0x44, 0x31, 0xE7, 0x82, 0xB9, // Bytes 1e00 - 1e3f 0x44, 0x32, 0xE6, 0x97, 0xA5, 0x44, 0x32, 0xE6, 0x9C, 0x88, 0x44, 0x32, 0xE7, 0x82, 0xB9, 0x44, 0x33, 0xE6, 0x97, 0xA5, 0x44, 0x33, 0xE6, 0x9C, 0x88, 0x44, 0x33, 0xE7, 0x82, 0xB9, 0x44, 0x34, 0xE6, 0x97, 0xA5, 0x44, 0x34, 0xE6, 0x9C, 0x88, 0x44, 0x34, 0xE7, 0x82, 0xB9, 0x44, 0x35, 0xE6, 0x97, 0xA5, 0x44, 0x35, 0xE6, 0x9C, 0x88, 0x44, 0x35, 0xE7, 0x82, 0xB9, 0x44, 0x36, 0xE6, 0x97, // Bytes 1e40 - 1e7f 0xA5, 0x44, 0x36, 0xE6, 0x9C, 0x88, 0x44, 0x36, 0xE7, 0x82, 0xB9, 0x44, 0x37, 0xE6, 0x97, 0xA5, 0x44, 0x37, 0xE6, 0x9C, 0x88, 0x44, 0x37, 0xE7, 0x82, 0xB9, 0x44, 0x38, 0xE6, 0x97, 0xA5, 0x44, 0x38, 0xE6, 0x9C, 0x88, 0x44, 0x38, 0xE7, 0x82, 0xB9, 0x44, 0x39, 0xE6, 0x97, 0xA5, 0x44, 0x39, 0xE6, 0x9C, 0x88, 0x44, 0x39, 0xE7, 0x82, 0xB9, 0x44, 0x56, 0x49, 0x49, 0x49, 0x44, 0x61, 0x2E, // Bytes 1e80 - 1ebf 0x6D, 0x2E, 0x44, 0x6B, 0x63, 0x61, 0x6C, 0x44, 0x70, 0x2E, 0x6D, 0x2E, 0x44, 0x76, 0x69, 0x69, 0x69, 0x44, 0xD5, 0xA5, 0xD6, 0x82, 0x44, 0xD5, 0xB4, 0xD5, 0xA5, 0x44, 0xD5, 0xB4, 0xD5, 0xAB, 0x44, 0xD5, 0xB4, 0xD5, 0xAD, 0x44, 0xD5, 0xB4, 0xD5, 0xB6, 0x44, 0xD5, 0xBE, 0xD5, 0xB6, 0x44, 0xD7, 0x90, 0xD7, 0x9C, 0x44, 0xD8, 0xA7, 0xD9, 0xB4, 0x44, 0xD8, 0xA8, 0xD8, 0xAC, 0x44, 0xD8, // Bytes 1ec0 - 1eff 0xA8, 0xD8, 0xAD, 0x44, 0xD8, 0xA8, 0xD8, 0xAE, 0x44, 0xD8, 0xA8, 0xD8, 0xB1, 0x44, 0xD8, 0xA8, 0xD8, 0xB2, 0x44, 0xD8, 0xA8, 0xD9, 0x85, 0x44, 0xD8, 0xA8, 0xD9, 0x86, 0x44, 0xD8, 0xA8, 0xD9, 0x87, 0x44, 0xD8, 0xA8, 0xD9, 0x89, 0x44, 0xD8, 0xA8, 0xD9, 0x8A, 0x44, 0xD8, 0xAA, 0xD8, 0xAC, 0x44, 0xD8, 0xAA, 0xD8, 0xAD, 0x44, 0xD8, 0xAA, 0xD8, 0xAE, 0x44, 0xD8, 0xAA, 0xD8, 0xB1, 0x44, // Bytes 1f00 - 1f3f 0xD8, 0xAA, 0xD8, 0xB2, 0x44, 0xD8, 0xAA, 0xD9, 0x85, 0x44, 0xD8, 0xAA, 0xD9, 0x86, 0x44, 0xD8, 0xAA, 0xD9, 0x87, 0x44, 0xD8, 0xAA, 0xD9, 0x89, 0x44, 0xD8, 0xAA, 0xD9, 0x8A, 0x44, 0xD8, 0xAB, 0xD8, 0xAC, 0x44, 0xD8, 0xAB, 0xD8, 0xB1, 0x44, 0xD8, 0xAB, 0xD8, 0xB2, 0x44, 0xD8, 0xAB, 0xD9, 0x85, 0x44, 0xD8, 0xAB, 0xD9, 0x86, 0x44, 0xD8, 0xAB, 0xD9, 0x87, 0x44, 0xD8, 0xAB, 0xD9, 0x89, // Bytes 1f40 - 1f7f 0x44, 0xD8, 0xAB, 0xD9, 0x8A, 0x44, 0xD8, 0xAC, 0xD8, 0xAD, 0x44, 0xD8, 0xAC, 0xD9, 0x85, 0x44, 0xD8, 0xAC, 0xD9, 0x89, 0x44, 0xD8, 0xAC, 0xD9, 0x8A, 0x44, 0xD8, 0xAD, 0xD8, 0xAC, 0x44, 0xD8, 0xAD, 0xD9, 0x85, 0x44, 0xD8, 0xAD, 0xD9, 0x89, 0x44, 0xD8, 0xAD, 0xD9, 0x8A, 0x44, 0xD8, 0xAE, 0xD8, 0xAC, 0x44, 0xD8, 0xAE, 0xD8, 0xAD, 0x44, 0xD8, 0xAE, 0xD9, 0x85, 0x44, 0xD8, 0xAE, 0xD9, // Bytes 1f80 - 1fbf 0x89, 0x44, 0xD8, 0xAE, 0xD9, 0x8A, 0x44, 0xD8, 0xB3, 0xD8, 0xAC, 0x44, 0xD8, 0xB3, 0xD8, 0xAD, 0x44, 0xD8, 0xB3, 0xD8, 0xAE, 0x44, 0xD8, 0xB3, 0xD8, 0xB1, 0x44, 0xD8, 0xB3, 0xD9, 0x85, 0x44, 0xD8, 0xB3, 0xD9, 0x87, 0x44, 0xD8, 0xB3, 0xD9, 0x89, 0x44, 0xD8, 0xB3, 0xD9, 0x8A, 0x44, 0xD8, 0xB4, 0xD8, 0xAC, 0x44, 0xD8, 0xB4, 0xD8, 0xAD, 0x44, 0xD8, 0xB4, 0xD8, 0xAE, 0x44, 0xD8, 0xB4, // Bytes 1fc0 - 1fff 0xD8, 0xB1, 0x44, 0xD8, 0xB4, 0xD9, 0x85, 0x44, 0xD8, 0xB4, 0xD9, 0x87, 0x44, 0xD8, 0xB4, 0xD9, 0x89, 0x44, 0xD8, 0xB4, 0xD9, 0x8A, 0x44, 0xD8, 0xB5, 0xD8, 0xAD, 0x44, 0xD8, 0xB5, 0xD8, 0xAE, 0x44, 0xD8, 0xB5, 0xD8, 0xB1, 0x44, 0xD8, 0xB5, 0xD9, 0x85, 0x44, 0xD8, 0xB5, 0xD9, 0x89, 0x44, 0xD8, 0xB5, 0xD9, 0x8A, 0x44, 0xD8, 0xB6, 0xD8, 0xAC, 0x44, 0xD8, 0xB6, 0xD8, 0xAD, 0x44, 0xD8, // Bytes 2000 - 203f 0xB6, 0xD8, 0xAE, 0x44, 0xD8, 0xB6, 0xD8, 0xB1, 0x44, 0xD8, 0xB6, 0xD9, 0x85, 0x44, 0xD8, 0xB6, 0xD9, 0x89, 0x44, 0xD8, 0xB6, 0xD9, 0x8A, 0x44, 0xD8, 0xB7, 0xD8, 0xAD, 0x44, 0xD8, 0xB7, 0xD9, 0x85, 0x44, 0xD8, 0xB7, 0xD9, 0x89, 0x44, 0xD8, 0xB7, 0xD9, 0x8A, 0x44, 0xD8, 0xB8, 0xD9, 0x85, 0x44, 0xD8, 0xB9, 0xD8, 0xAC, 0x44, 0xD8, 0xB9, 0xD9, 0x85, 0x44, 0xD8, 0xB9, 0xD9, 0x89, 0x44, // Bytes 2040 - 207f 0xD8, 0xB9, 0xD9, 0x8A, 0x44, 0xD8, 0xBA, 0xD8, 0xAC, 0x44, 0xD8, 0xBA, 0xD9, 0x85, 0x44, 0xD8, 0xBA, 0xD9, 0x89, 0x44, 0xD8, 0xBA, 0xD9, 0x8A, 0x44, 0xD9, 0x81, 0xD8, 0xAC, 0x44, 0xD9, 0x81, 0xD8, 0xAD, 0x44, 0xD9, 0x81, 0xD8, 0xAE, 0x44, 0xD9, 0x81, 0xD9, 0x85, 0x44, 0xD9, 0x81, 0xD9, 0x89, 0x44, 0xD9, 0x81, 0xD9, 0x8A, 0x44, 0xD9, 0x82, 0xD8, 0xAD, 0x44, 0xD9, 0x82, 0xD9, 0x85, // Bytes 2080 - 20bf 0x44, 0xD9, 0x82, 0xD9, 0x89, 0x44, 0xD9, 0x82, 0xD9, 0x8A, 0x44, 0xD9, 0x83, 0xD8, 0xA7, 0x44, 0xD9, 0x83, 0xD8, 0xAC, 0x44, 0xD9, 0x83, 0xD8, 0xAD, 0x44, 0xD9, 0x83, 0xD8, 0xAE, 0x44, 0xD9, 0x83, 0xD9, 0x84, 0x44, 0xD9, 0x83, 0xD9, 0x85, 0x44, 0xD9, 0x83, 0xD9, 0x89, 0x44, 0xD9, 0x83, 0xD9, 0x8A, 0x44, 0xD9, 0x84, 0xD8, 0xA7, 0x44, 0xD9, 0x84, 0xD8, 0xAC, 0x44, 0xD9, 0x84, 0xD8, // Bytes 20c0 - 20ff 0xAD, 0x44, 0xD9, 0x84, 0xD8, 0xAE, 0x44, 0xD9, 0x84, 0xD9, 0x85, 0x44, 0xD9, 0x84, 0xD9, 0x87, 0x44, 0xD9, 0x84, 0xD9, 0x89, 0x44, 0xD9, 0x84, 0xD9, 0x8A, 0x44, 0xD9, 0x85, 0xD8, 0xA7, 0x44, 0xD9, 0x85, 0xD8, 0xAC, 0x44, 0xD9, 0x85, 0xD8, 0xAD, 0x44, 0xD9, 0x85, 0xD8, 0xAE, 0x44, 0xD9, 0x85, 0xD9, 0x85, 0x44, 0xD9, 0x85, 0xD9, 0x89, 0x44, 0xD9, 0x85, 0xD9, 0x8A, 0x44, 0xD9, 0x86, // Bytes 2100 - 213f 0xD8, 0xAC, 0x44, 0xD9, 0x86, 0xD8, 0xAD, 0x44, 0xD9, 0x86, 0xD8, 0xAE, 0x44, 0xD9, 0x86, 0xD8, 0xB1, 0x44, 0xD9, 0x86, 0xD8, 0xB2, 0x44, 0xD9, 0x86, 0xD9, 0x85, 0x44, 0xD9, 0x86, 0xD9, 0x86, 0x44, 0xD9, 0x86, 0xD9, 0x87, 0x44, 0xD9, 0x86, 0xD9, 0x89, 0x44, 0xD9, 0x86, 0xD9, 0x8A, 0x44, 0xD9, 0x87, 0xD8, 0xAC, 0x44, 0xD9, 0x87, 0xD9, 0x85, 0x44, 0xD9, 0x87, 0xD9, 0x89, 0x44, 0xD9, // Bytes 2140 - 217f 0x87, 0xD9, 0x8A, 0x44, 0xD9, 0x88, 0xD9, 0xB4, 0x44, 0xD9, 0x8A, 0xD8, 0xAC, 0x44, 0xD9, 0x8A, 0xD8, 0xAD, 0x44, 0xD9, 0x8A, 0xD8, 0xAE, 0x44, 0xD9, 0x8A, 0xD8, 0xB1, 0x44, 0xD9, 0x8A, 0xD8, 0xB2, 0x44, 0xD9, 0x8A, 0xD9, 0x85, 0x44, 0xD9, 0x8A, 0xD9, 0x86, 0x44, 0xD9, 0x8A, 0xD9, 0x87, 0x44, 0xD9, 0x8A, 0xD9, 0x89, 0x44, 0xD9, 0x8A, 0xD9, 0x8A, 0x44, 0xD9, 0x8A, 0xD9, 0xB4, 0x44, // Bytes 2180 - 21bf 0xDB, 0x87, 0xD9, 0xB4, 0x45, 0x28, 0xE1, 0x84, 0x80, 0x29, 0x45, 0x28, 0xE1, 0x84, 0x82, 0x29, 0x45, 0x28, 0xE1, 0x84, 0x83, 0x29, 0x45, 0x28, 0xE1, 0x84, 0x85, 0x29, 0x45, 0x28, 0xE1, 0x84, 0x86, 0x29, 0x45, 0x28, 0xE1, 0x84, 0x87, 0x29, 0x45, 0x28, 0xE1, 0x84, 0x89, 0x29, 0x45, 0x28, 0xE1, 0x84, 0x8B, 0x29, 0x45, 0x28, 0xE1, 0x84, 0x8C, 0x29, 0x45, 0x28, 0xE1, 0x84, 0x8E, 0x29, // Bytes 21c0 - 21ff 0x45, 0x28, 0xE1, 0x84, 0x8F, 0x29, 0x45, 0x28, 0xE1, 0x84, 0x90, 0x29, 0x45, 0x28, 0xE1, 0x84, 0x91, 0x29, 0x45, 0x28, 0xE1, 0x84, 0x92, 0x29, 0x45, 0x28, 0xE4, 0xB8, 0x80, 0x29, 0x45, 0x28, 0xE4, 0xB8, 0x83, 0x29, 0x45, 0x28, 0xE4, 0xB8, 0x89, 0x29, 0x45, 0x28, 0xE4, 0xB9, 0x9D, 0x29, 0x45, 0x28, 0xE4, 0xBA, 0x8C, 0x29, 0x45, 0x28, 0xE4, 0xBA, 0x94, 0x29, 0x45, 0x28, 0xE4, 0xBB, // Bytes 2200 - 223f 0xA3, 0x29, 0x45, 0x28, 0xE4, 0xBC, 0x81, 0x29, 0x45, 0x28, 0xE4, 0xBC, 0x91, 0x29, 0x45, 0x28, 0xE5, 0x85, 0xAB, 0x29, 0x45, 0x28, 0xE5, 0x85, 0xAD, 0x29, 0x45, 0x28, 0xE5, 0x8A, 0xB4, 0x29, 0x45, 0x28, 0xE5, 0x8D, 0x81, 0x29, 0x45, 0x28, 0xE5, 0x8D, 0x94, 0x29, 0x45, 0x28, 0xE5, 0x90, 0x8D, 0x29, 0x45, 0x28, 0xE5, 0x91, 0xBC, 0x29, 0x45, 0x28, 0xE5, 0x9B, 0x9B, 0x29, 0x45, 0x28, // Bytes 2240 - 227f 0xE5, 0x9C, 0x9F, 0x29, 0x45, 0x28, 0xE5, 0xAD, 0xA6, 0x29, 0x45, 0x28, 0xE6, 0x97, 0xA5, 0x29, 0x45, 0x28, 0xE6, 0x9C, 0x88, 0x29, 0x45, 0x28, 0xE6, 0x9C, 0x89, 0x29, 0x45, 0x28, 0xE6, 0x9C, 0xA8, 0x29, 0x45, 0x28, 0xE6, 0xA0, 0xAA, 0x29, 0x45, 0x28, 0xE6, 0xB0, 0xB4, 0x29, 0x45, 0x28, 0xE7, 0x81, 0xAB, 0x29, 0x45, 0x28, 0xE7, 0x89, 0xB9, 0x29, 0x45, 0x28, 0xE7, 0x9B, 0xA3, 0x29, // Bytes 2280 - 22bf 0x45, 0x28, 0xE7, 0xA4, 0xBE, 0x29, 0x45, 0x28, 0xE7, 0xA5, 0x9D, 0x29, 0x45, 0x28, 0xE7, 0xA5, 0xAD, 0x29, 0x45, 0x28, 0xE8, 0x87, 0xAA, 0x29, 0x45, 0x28, 0xE8, 0x87, 0xB3, 0x29, 0x45, 0x28, 0xE8, 0xB2, 0xA1, 0x29, 0x45, 0x28, 0xE8, 0xB3, 0x87, 0x29, 0x45, 0x28, 0xE9, 0x87, 0x91, 0x29, 0x45, 0x30, 0xE2, 0x81, 0x84, 0x33, 0x45, 0x31, 0x30, 0xE6, 0x97, 0xA5, 0x45, 0x31, 0x30, 0xE6, // Bytes 22c0 - 22ff 0x9C, 0x88, 0x45, 0x31, 0x30, 0xE7, 0x82, 0xB9, 0x45, 0x31, 0x31, 0xE6, 0x97, 0xA5, 0x45, 0x31, 0x31, 0xE6, 0x9C, 0x88, 0x45, 0x31, 0x31, 0xE7, 0x82, 0xB9, 0x45, 0x31, 0x32, 0xE6, 0x97, 0xA5, 0x45, 0x31, 0x32, 0xE6, 0x9C, 0x88, 0x45, 0x31, 0x32, 0xE7, 0x82, 0xB9, 0x45, 0x31, 0x33, 0xE6, 0x97, 0xA5, 0x45, 0x31, 0x33, 0xE7, 0x82, 0xB9, 0x45, 0x31, 0x34, 0xE6, 0x97, 0xA5, 0x45, 0x31, // Bytes 2300 - 233f 0x34, 0xE7, 0x82, 0xB9, 0x45, 0x31, 0x35, 0xE6, 0x97, 0xA5, 0x45, 0x31, 0x35, 0xE7, 0x82, 0xB9, 0x45, 0x31, 0x36, 0xE6, 0x97, 0xA5, 0x45, 0x31, 0x36, 0xE7, 0x82, 0xB9, 0x45, 0x31, 0x37, 0xE6, 0x97, 0xA5, 0x45, 0x31, 0x37, 0xE7, 0x82, 0xB9, 0x45, 0x31, 0x38, 0xE6, 0x97, 0xA5, 0x45, 0x31, 0x38, 0xE7, 0x82, 0xB9, 0x45, 0x31, 0x39, 0xE6, 0x97, 0xA5, 0x45, 0x31, 0x39, 0xE7, 0x82, 0xB9, // Bytes 2340 - 237f 0x45, 0x31, 0xE2, 0x81, 0x84, 0x32, 0x45, 0x31, 0xE2, 0x81, 0x84, 0x33, 0x45, 0x31, 0xE2, 0x81, 0x84, 0x34, 0x45, 0x31, 0xE2, 0x81, 0x84, 0x35, 0x45, 0x31, 0xE2, 0x81, 0x84, 0x36, 0x45, 0x31, 0xE2, 0x81, 0x84, 0x37, 0x45, 0x31, 0xE2, 0x81, 0x84, 0x38, 0x45, 0x31, 0xE2, 0x81, 0x84, 0x39, 0x45, 0x32, 0x30, 0xE6, 0x97, 0xA5, 0x45, 0x32, 0x30, 0xE7, 0x82, 0xB9, 0x45, 0x32, 0x31, 0xE6, // Bytes 2380 - 23bf 0x97, 0xA5, 0x45, 0x32, 0x31, 0xE7, 0x82, 0xB9, 0x45, 0x32, 0x32, 0xE6, 0x97, 0xA5, 0x45, 0x32, 0x32, 0xE7, 0x82, 0xB9, 0x45, 0x32, 0x33, 0xE6, 0x97, 0xA5, 0x45, 0x32, 0x33, 0xE7, 0x82, 0xB9, 0x45, 0x32, 0x34, 0xE6, 0x97, 0xA5, 0x45, 0x32, 0x34, 0xE7, 0x82, 0xB9, 0x45, 0x32, 0x35, 0xE6, 0x97, 0xA5, 0x45, 0x32, 0x36, 0xE6, 0x97, 0xA5, 0x45, 0x32, 0x37, 0xE6, 0x97, 0xA5, 0x45, 0x32, // Bytes 23c0 - 23ff 0x38, 0xE6, 0x97, 0xA5, 0x45, 0x32, 0x39, 0xE6, 0x97, 0xA5, 0x45, 0x32, 0xE2, 0x81, 0x84, 0x33, 0x45, 0x32, 0xE2, 0x81, 0x84, 0x35, 0x45, 0x33, 0x30, 0xE6, 0x97, 0xA5, 0x45, 0x33, 0x31, 0xE6, 0x97, 0xA5, 0x45, 0x33, 0xE2, 0x81, 0x84, 0x34, 0x45, 0x33, 0xE2, 0x81, 0x84, 0x35, 0x45, 0x33, 0xE2, 0x81, 0x84, 0x38, 0x45, 0x34, 0xE2, 0x81, 0x84, 0x35, 0x45, 0x35, 0xE2, 0x81, 0x84, 0x36, // Bytes 2400 - 243f 0x45, 0x35, 0xE2, 0x81, 0x84, 0x38, 0x45, 0x37, 0xE2, 0x81, 0x84, 0x38, 0x45, 0x41, 0xE2, 0x88, 0x95, 0x6D, 0x45, 0x56, 0xE2, 0x88, 0x95, 0x6D, 0x45, 0x6D, 0xE2, 0x88, 0x95, 0x73, 0x46, 0x31, 0xE2, 0x81, 0x84, 0x31, 0x30, 0x46, 0x43, 0xE2, 0x88, 0x95, 0x6B, 0x67, 0x46, 0x6D, 0xE2, 0x88, 0x95, 0x73, 0x32, 0x46, 0xD8, 0xA8, 0xD8, 0xAD, 0xD9, 0x8A, 0x46, 0xD8, 0xA8, 0xD8, 0xAE, 0xD9, // Bytes 2440 - 247f 0x8A, 0x46, 0xD8, 0xAA, 0xD8, 0xAC, 0xD9, 0x85, 0x46, 0xD8, 0xAA, 0xD8, 0xAC, 0xD9, 0x89, 0x46, 0xD8, 0xAA, 0xD8, 0xAC, 0xD9, 0x8A, 0x46, 0xD8, 0xAA, 0xD8, 0xAD, 0xD8, 0xAC, 0x46, 0xD8, 0xAA, 0xD8, 0xAD, 0xD9, 0x85, 0x46, 0xD8, 0xAA, 0xD8, 0xAE, 0xD9, 0x85, 0x46, 0xD8, 0xAA, 0xD8, 0xAE, 0xD9, 0x89, 0x46, 0xD8, 0xAA, 0xD8, 0xAE, 0xD9, 0x8A, 0x46, 0xD8, 0xAA, 0xD9, 0x85, 0xD8, 0xAC, // Bytes 2480 - 24bf 0x46, 0xD8, 0xAA, 0xD9, 0x85, 0xD8, 0xAD, 0x46, 0xD8, 0xAA, 0xD9, 0x85, 0xD8, 0xAE, 0x46, 0xD8, 0xAA, 0xD9, 0x85, 0xD9, 0x89, 0x46, 0xD8, 0xAA, 0xD9, 0x85, 0xD9, 0x8A, 0x46, 0xD8, 0xAC, 0xD8, 0xAD, 0xD9, 0x89, 0x46, 0xD8, 0xAC, 0xD8, 0xAD, 0xD9, 0x8A, 0x46, 0xD8, 0xAC, 0xD9, 0x85, 0xD8, 0xAD, 0x46, 0xD8, 0xAC, 0xD9, 0x85, 0xD9, 0x89, 0x46, 0xD8, 0xAC, 0xD9, 0x85, 0xD9, 0x8A, 0x46, // Bytes 24c0 - 24ff 0xD8, 0xAD, 0xD8, 0xAC, 0xD9, 0x8A, 0x46, 0xD8, 0xAD, 0xD9, 0x85, 0xD9, 0x89, 0x46, 0xD8, 0xAD, 0xD9, 0x85, 0xD9, 0x8A, 0x46, 0xD8, 0xB3, 0xD8, 0xAC, 0xD8, 0xAD, 0x46, 0xD8, 0xB3, 0xD8, 0xAC, 0xD9, 0x89, 0x46, 0xD8, 0xB3, 0xD8, 0xAD, 0xD8, 0xAC, 0x46, 0xD8, 0xB3, 0xD8, 0xAE, 0xD9, 0x89, 0x46, 0xD8, 0xB3, 0xD8, 0xAE, 0xD9, 0x8A, 0x46, 0xD8, 0xB3, 0xD9, 0x85, 0xD8, 0xAC, 0x46, 0xD8, // Bytes 2500 - 253f 0xB3, 0xD9, 0x85, 0xD8, 0xAD, 0x46, 0xD8, 0xB3, 0xD9, 0x85, 0xD9, 0x85, 0x46, 0xD8, 0xB4, 0xD8, 0xAC, 0xD9, 0x8A, 0x46, 0xD8, 0xB4, 0xD8, 0xAD, 0xD9, 0x85, 0x46, 0xD8, 0xB4, 0xD8, 0xAD, 0xD9, 0x8A, 0x46, 0xD8, 0xB4, 0xD9, 0x85, 0xD8, 0xAE, 0x46, 0xD8, 0xB4, 0xD9, 0x85, 0xD9, 0x85, 0x46, 0xD8, 0xB5, 0xD8, 0xAD, 0xD8, 0xAD, 0x46, 0xD8, 0xB5, 0xD8, 0xAD, 0xD9, 0x8A, 0x46, 0xD8, 0xB5, // Bytes 2540 - 257f 0xD9, 0x84, 0xD9, 0x89, 0x46, 0xD8, 0xB5, 0xD9, 0x84, 0xDB, 0x92, 0x46, 0xD8, 0xB5, 0xD9, 0x85, 0xD9, 0x85, 0x46, 0xD8, 0xB6, 0xD8, 0xAD, 0xD9, 0x89, 0x46, 0xD8, 0xB6, 0xD8, 0xAD, 0xD9, 0x8A, 0x46, 0xD8, 0xB6, 0xD8, 0xAE, 0xD9, 0x85, 0x46, 0xD8, 0xB7, 0xD9, 0x85, 0xD8, 0xAD, 0x46, 0xD8, 0xB7, 0xD9, 0x85, 0xD9, 0x85, 0x46, 0xD8, 0xB7, 0xD9, 0x85, 0xD9, 0x8A, 0x46, 0xD8, 0xB9, 0xD8, // Bytes 2580 - 25bf 0xAC, 0xD9, 0x85, 0x46, 0xD8, 0xB9, 0xD9, 0x85, 0xD9, 0x85, 0x46, 0xD8, 0xB9, 0xD9, 0x85, 0xD9, 0x89, 0x46, 0xD8, 0xB9, 0xD9, 0x85, 0xD9, 0x8A, 0x46, 0xD8, 0xBA, 0xD9, 0x85, 0xD9, 0x85, 0x46, 0xD8, 0xBA, 0xD9, 0x85, 0xD9, 0x89, 0x46, 0xD8, 0xBA, 0xD9, 0x85, 0xD9, 0x8A, 0x46, 0xD9, 0x81, 0xD8, 0xAE, 0xD9, 0x85, 0x46, 0xD9, 0x81, 0xD9, 0x85, 0xD9, 0x8A, 0x46, 0xD9, 0x82, 0xD9, 0x84, // Bytes 25c0 - 25ff 0xDB, 0x92, 0x46, 0xD9, 0x82, 0xD9, 0x85, 0xD8, 0xAD, 0x46, 0xD9, 0x82, 0xD9, 0x85, 0xD9, 0x85, 0x46, 0xD9, 0x82, 0xD9, 0x85, 0xD9, 0x8A, 0x46, 0xD9, 0x83, 0xD9, 0x85, 0xD9, 0x85, 0x46, 0xD9, 0x83, 0xD9, 0x85, 0xD9, 0x8A, 0x46, 0xD9, 0x84, 0xD8, 0xAC, 0xD8, 0xAC, 0x46, 0xD9, 0x84, 0xD8, 0xAC, 0xD9, 0x85, 0x46, 0xD9, 0x84, 0xD8, 0xAC, 0xD9, 0x8A, 0x46, 0xD9, 0x84, 0xD8, 0xAD, 0xD9, // Bytes 2600 - 263f 0x85, 0x46, 0xD9, 0x84, 0xD8, 0xAD, 0xD9, 0x89, 0x46, 0xD9, 0x84, 0xD8, 0xAD, 0xD9, 0x8A, 0x46, 0xD9, 0x84, 0xD8, 0xAE, 0xD9, 0x85, 0x46, 0xD9, 0x84, 0xD9, 0x85, 0xD8, 0xAD, 0x46, 0xD9, 0x84, 0xD9, 0x85, 0xD9, 0x8A, 0x46, 0xD9, 0x85, 0xD8, 0xAC, 0xD8, 0xAD, 0x46, 0xD9, 0x85, 0xD8, 0xAC, 0xD8, 0xAE, 0x46, 0xD9, 0x85, 0xD8, 0xAC, 0xD9, 0x85, 0x46, 0xD9, 0x85, 0xD8, 0xAC, 0xD9, 0x8A, // Bytes 2640 - 267f 0x46, 0xD9, 0x85, 0xD8, 0xAD, 0xD8, 0xAC, 0x46, 0xD9, 0x85, 0xD8, 0xAD, 0xD9, 0x85, 0x46, 0xD9, 0x85, 0xD8, 0xAD, 0xD9, 0x8A, 0x46, 0xD9, 0x85, 0xD8, 0xAE, 0xD8, 0xAC, 0x46, 0xD9, 0x85, 0xD8, 0xAE, 0xD9, 0x85, 0x46, 0xD9, 0x85, 0xD8, 0xAE, 0xD9, 0x8A, 0x46, 0xD9, 0x85, 0xD9, 0x85, 0xD9, 0x8A, 0x46, 0xD9, 0x86, 0xD8, 0xAC, 0xD8, 0xAD, 0x46, 0xD9, 0x86, 0xD8, 0xAC, 0xD9, 0x85, 0x46, // Bytes 2680 - 26bf 0xD9, 0x86, 0xD8, 0xAC, 0xD9, 0x89, 0x46, 0xD9, 0x86, 0xD8, 0xAC, 0xD9, 0x8A, 0x46, 0xD9, 0x86, 0xD8, 0xAD, 0xD9, 0x85, 0x46, 0xD9, 0x86, 0xD8, 0xAD, 0xD9, 0x89, 0x46, 0xD9, 0x86, 0xD8, 0xAD, 0xD9, 0x8A, 0x46, 0xD9, 0x86, 0xD9, 0x85, 0xD9, 0x89, 0x46, 0xD9, 0x86, 0xD9, 0x85, 0xD9, 0x8A, 0x46, 0xD9, 0x87, 0xD9, 0x85, 0xD8, 0xAC, 0x46, 0xD9, 0x87, 0xD9, 0x85, 0xD9, 0x85, 0x46, 0xD9, // Bytes 26c0 - 26ff 0x8A, 0xD8, 0xAC, 0xD9, 0x8A, 0x46, 0xD9, 0x8A, 0xD8, 0xAD, 0xD9, 0x8A, 0x46, 0xD9, 0x8A, 0xD9, 0x85, 0xD9, 0x85, 0x46, 0xD9, 0x8A, 0xD9, 0x85, 0xD9, 0x8A, 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xD8, 0xA7, 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xD8, 0xAC, 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xD8, 0xAD, 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xD8, 0xAE, 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xD8, 0xB1, 0x46, 0xD9, 0x8A, // Bytes 2700 - 273f 0xD9, 0x94, 0xD8, 0xB2, 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xD9, 0x85, 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xD9, 0x86, 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xD9, 0x87, 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xD9, 0x88, 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xD9, 0x89, 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xD9, 0x8A, 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xDB, 0x86, 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xDB, 0x87, 0x46, 0xD9, 0x8A, 0xD9, // Bytes 2740 - 277f 0x94, 0xDB, 0x88, 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xDB, 0x90, 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xDB, 0x95, 0x46, 0xE0, 0xB9, 0x8D, 0xE0, 0xB8, 0xB2, 0x46, 0xE0, 0xBA, 0xAB, 0xE0, 0xBA, 0x99, 0x46, 0xE0, 0xBA, 0xAB, 0xE0, 0xBA, 0xA1, 0x46, 0xE0, 0xBB, 0x8D, 0xE0, 0xBA, 0xB2, 0x46, 0xE0, 0xBD, 0x80, 0xE0, 0xBE, 0xB5, 0x46, 0xE0, 0xBD, 0x82, 0xE0, 0xBE, 0xB7, 0x46, 0xE0, 0xBD, 0x8C, 0xE0, // Bytes 2780 - 27bf 0xBE, 0xB7, 0x46, 0xE0, 0xBD, 0x91, 0xE0, 0xBE, 0xB7, 0x46, 0xE0, 0xBD, 0x96, 0xE0, 0xBE, 0xB7, 0x46, 0xE0, 0xBD, 0x9B, 0xE0, 0xBE, 0xB7, 0x46, 0xE0, 0xBE, 0x90, 0xE0, 0xBE, 0xB5, 0x46, 0xE0, 0xBE, 0x92, 0xE0, 0xBE, 0xB7, 0x46, 0xE0, 0xBE, 0x9C, 0xE0, 0xBE, 0xB7, 0x46, 0xE0, 0xBE, 0xA1, 0xE0, 0xBE, 0xB7, 0x46, 0xE0, 0xBE, 0xA6, 0xE0, 0xBE, 0xB7, 0x46, 0xE0, 0xBE, 0xAB, 0xE0, 0xBE, // Bytes 27c0 - 27ff 0xB7, 0x46, 0xE2, 0x80, 0xB2, 0xE2, 0x80, 0xB2, 0x46, 0xE2, 0x80, 0xB5, 0xE2, 0x80, 0xB5, 0x46, 0xE2, 0x88, 0xAB, 0xE2, 0x88, 0xAB, 0x46, 0xE2, 0x88, 0xAE, 0xE2, 0x88, 0xAE, 0x46, 0xE3, 0x81, 0xBB, 0xE3, 0x81, 0x8B, 0x46, 0xE3, 0x82, 0x88, 0xE3, 0x82, 0x8A, 0x46, 0xE3, 0x82, 0xAD, 0xE3, 0x83, 0xAD, 0x46, 0xE3, 0x82, 0xB3, 0xE3, 0x82, 0xB3, 0x46, 0xE3, 0x82, 0xB3, 0xE3, 0x83, 0x88, // Bytes 2800 - 283f 0x46, 0xE3, 0x83, 0x88, 0xE3, 0x83, 0xB3, 0x46, 0xE3, 0x83, 0x8A, 0xE3, 0x83, 0x8E, 0x46, 0xE3, 0x83, 0x9B, 0xE3, 0x83, 0xB3, 0x46, 0xE3, 0x83, 0x9F, 0xE3, 0x83, 0xAA, 0x46, 0xE3, 0x83, 0xAA, 0xE3, 0x83, 0xA9, 0x46, 0xE3, 0x83, 0xAC, 0xE3, 0x83, 0xA0, 0x46, 0xE4, 0xBB, 0xA4, 0xE5, 0x92, 0x8C, 0x46, 0xE5, 0xA4, 0xA7, 0xE6, 0xAD, 0xA3, 0x46, 0xE5, 0xB9, 0xB3, 0xE6, 0x88, 0x90, 0x46, // Bytes 2840 - 287f 0xE6, 0x98, 0x8E, 0xE6, 0xB2, 0xBB, 0x46, 0xE6, 0x98, 0xAD, 0xE5, 0x92, 0x8C, 0x47, 0x72, 0x61, 0x64, 0xE2, 0x88, 0x95, 0x73, 0x47, 0xE3, 0x80, 0x94, 0x53, 0xE3, 0x80, 0x95, 0x48, 0x28, 0xE1, 0x84, 0x80, 0xE1, 0x85, 0xA1, 0x29, 0x48, 0x28, 0xE1, 0x84, 0x82, 0xE1, 0x85, 0xA1, 0x29, 0x48, 0x28, 0xE1, 0x84, 0x83, 0xE1, 0x85, 0xA1, 0x29, 0x48, 0x28, 0xE1, 0x84, 0x85, 0xE1, 0x85, 0xA1, // Bytes 2880 - 28bf 0x29, 0x48, 0x28, 0xE1, 0x84, 0x86, 0xE1, 0x85, 0xA1, 0x29, 0x48, 0x28, 0xE1, 0x84, 0x87, 0xE1, 0x85, 0xA1, 0x29, 0x48, 0x28, 0xE1, 0x84, 0x89, 0xE1, 0x85, 0xA1, 0x29, 0x48, 0x28, 0xE1, 0x84, 0x8B, 0xE1, 0x85, 0xA1, 0x29, 0x48, 0x28, 0xE1, 0x84, 0x8C, 0xE1, 0x85, 0xA1, 0x29, 0x48, 0x28, 0xE1, 0x84, 0x8C, 0xE1, 0x85, 0xAE, 0x29, 0x48, 0x28, 0xE1, 0x84, 0x8E, 0xE1, 0x85, 0xA1, 0x29, // Bytes 28c0 - 28ff 0x48, 0x28, 0xE1, 0x84, 0x8F, 0xE1, 0x85, 0xA1, 0x29, 0x48, 0x28, 0xE1, 0x84, 0x90, 0xE1, 0x85, 0xA1, 0x29, 0x48, 0x28, 0xE1, 0x84, 0x91, 0xE1, 0x85, 0xA1, 0x29, 0x48, 0x28, 0xE1, 0x84, 0x92, 0xE1, 0x85, 0xA1, 0x29, 0x48, 0x72, 0x61, 0x64, 0xE2, 0x88, 0x95, 0x73, 0x32, 0x48, 0xD8, 0xA7, 0xD9, 0x83, 0xD8, 0xA8, 0xD8, 0xB1, 0x48, 0xD8, 0xA7, 0xD9, 0x84, 0xD9, 0x84, 0xD9, 0x87, 0x48, // Bytes 2900 - 293f 0xD8, 0xB1, 0xD8, 0xB3, 0xD9, 0x88, 0xD9, 0x84, 0x48, 0xD8, 0xB1, 0xDB, 0x8C, 0xD8, 0xA7, 0xD9, 0x84, 0x48, 0xD8, 0xB5, 0xD9, 0x84, 0xD8, 0xB9, 0xD9, 0x85, 0x48, 0xD8, 0xB9, 0xD9, 0x84, 0xD9, 0x8A, 0xD9, 0x87, 0x48, 0xD9, 0x85, 0xD8, 0xAD, 0xD9, 0x85, 0xD8, 0xAF, 0x48, 0xD9, 0x88, 0xD8, 0xB3, 0xD9, 0x84, 0xD9, 0x85, 0x49, 0xE2, 0x80, 0xB2, 0xE2, 0x80, 0xB2, 0xE2, 0x80, 0xB2, 0x49, // Bytes 2940 - 297f 0xE2, 0x80, 0xB5, 0xE2, 0x80, 0xB5, 0xE2, 0x80, 0xB5, 0x49, 0xE2, 0x88, 0xAB, 0xE2, 0x88, 0xAB, 0xE2, 0x88, 0xAB, 0x49, 0xE2, 0x88, 0xAE, 0xE2, 0x88, 0xAE, 0xE2, 0x88, 0xAE, 0x49, 0xE3, 0x80, 0x94, 0xE4, 0xB8, 0x89, 0xE3, 0x80, 0x95, 0x49, 0xE3, 0x80, 0x94, 0xE4, 0xBA, 0x8C, 0xE3, 0x80, 0x95, 0x49, 0xE3, 0x80, 0x94, 0xE5, 0x8B, 0x9D, 0xE3, 0x80, 0x95, 0x49, 0xE3, 0x80, 0x94, 0xE5, // Bytes 2980 - 29bf 0xAE, 0x89, 0xE3, 0x80, 0x95, 0x49, 0xE3, 0x80, 0x94, 0xE6, 0x89, 0x93, 0xE3, 0x80, 0x95, 0x49, 0xE3, 0x80, 0x94, 0xE6, 0x95, 0x97, 0xE3, 0x80, 0x95, 0x49, 0xE3, 0x80, 0x94, 0xE6, 0x9C, 0xAC, 0xE3, 0x80, 0x95, 0x49, 0xE3, 0x80, 0x94, 0xE7, 0x82, 0xB9, 0xE3, 0x80, 0x95, 0x49, 0xE3, 0x80, 0x94, 0xE7, 0x9B, 0x97, 0xE3, 0x80, 0x95, 0x49, 0xE3, 0x82, 0xA2, 0xE3, 0x83, 0xBC, 0xE3, 0x83, // Bytes 29c0 - 29ff 0xAB, 0x49, 0xE3, 0x82, 0xA4, 0xE3, 0x83, 0xB3, 0xE3, 0x83, 0x81, 0x49, 0xE3, 0x82, 0xA6, 0xE3, 0x82, 0xA9, 0xE3, 0x83, 0xB3, 0x49, 0xE3, 0x82, 0xAA, 0xE3, 0x83, 0xB3, 0xE3, 0x82, 0xB9, 0x49, 0xE3, 0x82, 0xAA, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0xA0, 0x49, 0xE3, 0x82, 0xAB, 0xE3, 0x82, 0xA4, 0xE3, 0x83, 0xAA, 0x49, 0xE3, 0x82, 0xB1, 0xE3, 0x83, 0xBC, 0xE3, 0x82, 0xB9, 0x49, 0xE3, 0x82, // Bytes 2a00 - 2a3f 0xB3, 0xE3, 0x83, 0xAB, 0xE3, 0x83, 0x8A, 0x49, 0xE3, 0x82, 0xBB, 0xE3, 0x83, 0xB3, 0xE3, 0x83, 0x81, 0x49, 0xE3, 0x82, 0xBB, 0xE3, 0x83, 0xB3, 0xE3, 0x83, 0x88, 0x49, 0xE3, 0x83, 0x86, 0xE3, 0x82, 0x99, 0xE3, 0x82, 0xB7, 0x49, 0xE3, 0x83, 0x88, 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xAB, 0x49, 0xE3, 0x83, 0x8E, 0xE3, 0x83, 0x83, 0xE3, 0x83, 0x88, 0x49, 0xE3, 0x83, 0x8F, 0xE3, 0x82, 0xA4, // Bytes 2a40 - 2a7f 0xE3, 0x83, 0x84, 0x49, 0xE3, 0x83, 0x92, 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xAB, 0x49, 0xE3, 0x83, 0x92, 0xE3, 0x82, 0x9A, 0xE3, 0x82, 0xB3, 0x49, 0xE3, 0x83, 0x95, 0xE3, 0x83, 0xA9, 0xE3, 0x83, 0xB3, 0x49, 0xE3, 0x83, 0x98, 0xE3, 0x82, 0x9A, 0xE3, 0x82, 0xBD, 0x49, 0xE3, 0x83, 0x98, 0xE3, 0x83, 0xAB, 0xE3, 0x83, 0x84, 0x49, 0xE3, 0x83, 0x9B, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0xAB, 0x49, // Bytes 2a80 - 2abf 0xE3, 0x83, 0x9B, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0xB3, 0x49, 0xE3, 0x83, 0x9E, 0xE3, 0x82, 0xA4, 0xE3, 0x83, 0xAB, 0x49, 0xE3, 0x83, 0x9E, 0xE3, 0x83, 0x83, 0xE3, 0x83, 0x8F, 0x49, 0xE3, 0x83, 0x9E, 0xE3, 0x83, 0xAB, 0xE3, 0x82, 0xAF, 0x49, 0xE3, 0x83, 0xA4, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0xAB, 0x49, 0xE3, 0x83, 0xA6, 0xE3, 0x82, 0xA2, 0xE3, 0x83, 0xB3, 0x49, 0xE3, 0x83, 0xAF, 0xE3, // Bytes 2ac0 - 2aff 0x83, 0x83, 0xE3, 0x83, 0x88, 0x4C, 0xE2, 0x80, 0xB2, 0xE2, 0x80, 0xB2, 0xE2, 0x80, 0xB2, 0xE2, 0x80, 0xB2, 0x4C, 0xE2, 0x88, 0xAB, 0xE2, 0x88, 0xAB, 0xE2, 0x88, 0xAB, 0xE2, 0x88, 0xAB, 0x4C, 0xE3, 0x82, 0xA2, 0xE3, 0x83, 0xAB, 0xE3, 0x83, 0x95, 0xE3, 0x82, 0xA1, 0x4C, 0xE3, 0x82, 0xA8, 0xE3, 0x83, 0xBC, 0xE3, 0x82, 0xAB, 0xE3, 0x83, 0xBC, 0x4C, 0xE3, 0x82, 0xAB, 0xE3, 0x82, 0x99, // Bytes 2b00 - 2b3f 0xE3, 0x83, 0xAD, 0xE3, 0x83, 0xB3, 0x4C, 0xE3, 0x82, 0xAB, 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xB3, 0xE3, 0x83, 0x9E, 0x4C, 0xE3, 0x82, 0xAB, 0xE3, 0x83, 0xA9, 0xE3, 0x83, 0x83, 0xE3, 0x83, 0x88, 0x4C, 0xE3, 0x82, 0xAB, 0xE3, 0x83, 0xAD, 0xE3, 0x83, 0xAA, 0xE3, 0x83, 0xBC, 0x4C, 0xE3, 0x82, 0xAD, 0xE3, 0x82, 0x99, 0xE3, 0x83, 0x8B, 0xE3, 0x83, 0xBC, 0x4C, 0xE3, 0x82, 0xAD, 0xE3, 0x83, // Bytes 2b40 - 2b7f 0xA5, 0xE3, 0x83, 0xAA, 0xE3, 0x83, 0xBC, 0x4C, 0xE3, 0x82, 0xAF, 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xA9, 0xE3, 0x83, 0xA0, 0x4C, 0xE3, 0x82, 0xAF, 0xE3, 0x83, 0xAD, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0x8D, 0x4C, 0xE3, 0x82, 0xB5, 0xE3, 0x82, 0xA4, 0xE3, 0x82, 0xAF, 0xE3, 0x83, 0xAB, 0x4C, 0xE3, 0x82, 0xBF, 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xBC, 0xE3, 0x82, 0xB9, 0x4C, 0xE3, 0x83, 0x8F, 0xE3, // Bytes 2b80 - 2bbf 0x82, 0x9A, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0x84, 0x4C, 0xE3, 0x83, 0x92, 0xE3, 0x82, 0x9A, 0xE3, 0x82, 0xAF, 0xE3, 0x83, 0xAB, 0x4C, 0xE3, 0x83, 0x95, 0xE3, 0x82, 0xA3, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0x88, 0x4C, 0xE3, 0x83, 0x98, 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xBC, 0xE3, 0x82, 0xBF, 0x4C, 0xE3, 0x83, 0x98, 0xE3, 0x82, 0x9A, 0xE3, 0x83, 0x8B, 0xE3, 0x83, 0x92, 0x4C, 0xE3, 0x83, 0x98, // Bytes 2bc0 - 2bff 0xE3, 0x82, 0x9A, 0xE3, 0x83, 0xB3, 0xE3, 0x82, 0xB9, 0x4C, 0xE3, 0x83, 0x9B, 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xAB, 0xE3, 0x83, 0x88, 0x4C, 0xE3, 0x83, 0x9E, 0xE3, 0x82, 0xA4, 0xE3, 0x82, 0xAF, 0xE3, 0x83, 0xAD, 0x4C, 0xE3, 0x83, 0x9F, 0xE3, 0x82, 0xAF, 0xE3, 0x83, 0xAD, 0xE3, 0x83, 0xB3, 0x4C, 0xE3, 0x83, 0xA1, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0x88, 0xE3, 0x83, 0xAB, 0x4C, 0xE3, 0x83, // Bytes 2c00 - 2c3f 0xAA, 0xE3, 0x83, 0x83, 0xE3, 0x83, 0x88, 0xE3, 0x83, 0xAB, 0x4C, 0xE3, 0x83, 0xAB, 0xE3, 0x83, 0x92, 0xE3, 0x82, 0x9A, 0xE3, 0x83, 0xBC, 0x4C, 0xE6, 0xA0, 0xAA, 0xE5, 0xBC, 0x8F, 0xE4, 0xBC, 0x9A, 0xE7, 0xA4, 0xBE, 0x4E, 0x28, 0xE1, 0x84, 0x8B, 0xE1, 0x85, 0xA9, 0xE1, 0x84, 0x92, 0xE1, 0x85, 0xAE, 0x29, 0x4F, 0xD8, 0xAC, 0xD9, 0x84, 0x20, 0xD8, 0xAC, 0xD9, 0x84, 0xD8, 0xA7, 0xD9, // Bytes 2c40 - 2c7f 0x84, 0xD9, 0x87, 0x4F, 0xE3, 0x82, 0xA2, 0xE3, 0x83, 0x8F, 0xE3, 0x82, 0x9A, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0x88, 0x4F, 0xE3, 0x82, 0xA2, 0xE3, 0x83, 0xB3, 0xE3, 0x83, 0x98, 0xE3, 0x82, 0x9A, 0xE3, 0x82, 0xA2, 0x4F, 0xE3, 0x82, 0xAD, 0xE3, 0x83, 0xAD, 0xE3, 0x83, 0xAF, 0xE3, 0x83, 0x83, 0xE3, 0x83, 0x88, 0x4F, 0xE3, 0x82, 0xB5, 0xE3, 0x83, 0xB3, 0xE3, 0x83, 0x81, 0xE3, 0x83, 0xBC, // Bytes 2c80 - 2cbf 0xE3, 0x83, 0xA0, 0x4F, 0xE3, 0x83, 0x8F, 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0xAC, 0xE3, 0x83, 0xAB, 0x4F, 0xE3, 0x83, 0x98, 0xE3, 0x82, 0xAF, 0xE3, 0x82, 0xBF, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0xAB, 0x4F, 0xE3, 0x83, 0x9B, 0xE3, 0x82, 0x9A, 0xE3, 0x82, 0xA4, 0xE3, 0x83, 0xB3, 0xE3, 0x83, 0x88, 0x4F, 0xE3, 0x83, 0x9E, 0xE3, 0x83, 0xB3, 0xE3, 0x82, 0xB7, 0xE3, 0x83, 0xA7, // Bytes 2cc0 - 2cff 0xE3, 0x83, 0xB3, 0x4F, 0xE3, 0x83, 0xA1, 0xE3, 0x82, 0xAB, 0xE3, 0x82, 0x99, 0xE3, 0x83, 0x88, 0xE3, 0x83, 0xB3, 0x4F, 0xE3, 0x83, 0xAB, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0x95, 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xAB, 0x51, 0x28, 0xE1, 0x84, 0x8B, 0xE1, 0x85, 0xA9, 0xE1, 0x84, 0x8C, 0xE1, 0x85, 0xA5, 0xE1, 0x86, 0xAB, 0x29, 0x52, 0xE3, 0x82, 0xAD, 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xAB, 0xE3, // Bytes 2d00 - 2d3f 0x82, 0xBF, 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xBC, 0x52, 0xE3, 0x82, 0xAD, 0xE3, 0x83, 0xAD, 0xE3, 0x82, 0xAF, 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xA9, 0xE3, 0x83, 0xA0, 0x52, 0xE3, 0x82, 0xAD, 0xE3, 0x83, 0xAD, 0xE3, 0x83, 0xA1, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0x88, 0xE3, 0x83, 0xAB, 0x52, 0xE3, 0x82, 0xAF, 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xA9, 0xE3, 0x83, 0xA0, 0xE3, 0x83, 0x88, 0xE3, 0x83, // Bytes 2d40 - 2d7f 0xB3, 0x52, 0xE3, 0x82, 0xAF, 0xE3, 0x83, 0xAB, 0xE3, 0x82, 0xBB, 0xE3, 0x82, 0x99, 0xE3, 0x82, 0xA4, 0xE3, 0x83, 0xAD, 0x52, 0xE3, 0x83, 0x8F, 0xE3, 0x82, 0x9A, 0xE3, 0x83, 0xBC, 0xE3, 0x82, 0xBB, 0xE3, 0x83, 0xB3, 0xE3, 0x83, 0x88, 0x52, 0xE3, 0x83, 0x92, 0xE3, 0x82, 0x9A, 0xE3, 0x82, 0xA2, 0xE3, 0x82, 0xB9, 0xE3, 0x83, 0x88, 0xE3, 0x83, 0xAB, 0x52, 0xE3, 0x83, 0x95, 0xE3, 0x82, // Bytes 2d80 - 2dbf 0x99, 0xE3, 0x83, 0x83, 0xE3, 0x82, 0xB7, 0xE3, 0x82, 0xA7, 0xE3, 0x83, 0xAB, 0x52, 0xE3, 0x83, 0x9F, 0xE3, 0x83, 0xAA, 0xE3, 0x83, 0x8F, 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0xAB, 0x52, 0xE3, 0x83, 0xAC, 0xE3, 0x83, 0xB3, 0xE3, 0x83, 0x88, 0xE3, 0x82, 0xB1, 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xB3, 0x5F, 0xD8, 0xB5, 0xD9, 0x84, 0xD9, 0x89, 0x20, 0xD8, 0xA7, 0xD9, 0x84, 0xD9, // Bytes 2dc0 - 2dff 0x84, 0xD9, 0x87, 0x20, 0xD8, 0xB9, 0xD9, 0x84, 0xD9, 0x8A, 0xD9, 0x87, 0x20, 0xD9, 0x88, 0xD8, 0xB3, 0xD9, 0x84, 0xD9, 0x85, 0x44, 0x44, 0x5A, 0xCC, 0x8C, 0xCD, 0x44, 0x44, 0x7A, 0xCC, 0x8C, 0xCD, 0x44, 0x64, 0x7A, 0xCC, 0x8C, 0xCD, 0x46, 0xD9, 0x84, 0xD8, 0xA7, 0xD9, 0x93, 0xCD, 0x46, 0xD9, 0x84, 0xD8, 0xA7, 0xD9, 0x94, 0xCD, 0x46, 0xD9, 0x84, 0xD8, 0xA7, 0xD9, 0x95, 0xB9, 0x49, // Bytes 2e00 - 2e3f 0xE3, 0x83, 0xA1, 0xE3, 0x82, 0xAB, 0xE3, 0x82, 0x99, 0x11, 0x4C, 0xE1, 0x84, 0x8C, 0xE1, 0x85, 0xAE, 0xE1, 0x84, 0x8B, 0xE1, 0x85, 0xB4, 0x01, 0x4C, 0xE3, 0x82, 0xAD, 0xE3, 0x82, 0x99, 0xE3, 0x82, 0xAB, 0xE3, 0x82, 0x99, 0x11, 0x4C, 0xE3, 0x82, 0xB3, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0x9B, 0xE3, 0x82, 0x9A, 0x11, 0x4C, 0xE3, 0x83, 0xA4, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0x88, 0xE3, 0x82, // Bytes 2e40 - 2e7f 0x99, 0x11, 0x4F, 0xE1, 0x84, 0x8E, 0xE1, 0x85, 0xA1, 0xE1, 0x86, 0xB7, 0xE1, 0x84, 0x80, 0xE1, 0x85, 0xA9, 0x01, 0x4F, 0xE3, 0x82, 0xA4, 0xE3, 0x83, 0x8B, 0xE3, 0x83, 0xB3, 0xE3, 0x82, 0xAF, 0xE3, 0x82, 0x99, 0x11, 0x4F, 0xE3, 0x82, 0xB7, 0xE3, 0x83, 0xAA, 0xE3, 0x83, 0xB3, 0xE3, 0x82, 0xAF, 0xE3, 0x82, 0x99, 0x11, 0x4F, 0xE3, 0x83, 0x98, 0xE3, 0x82, 0x9A, 0xE3, 0x83, 0xBC, 0xE3, // Bytes 2e80 - 2ebf 0x82, 0xB7, 0xE3, 0x82, 0x99, 0x11, 0x4F, 0xE3, 0x83, 0x9B, 0xE3, 0x82, 0x9A, 0xE3, 0x83, 0xB3, 0xE3, 0x83, 0x88, 0xE3, 0x82, 0x99, 0x11, 0x52, 0xE3, 0x82, 0xA8, 0xE3, 0x82, 0xB9, 0xE3, 0x82, 0xAF, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0x88, 0xE3, 0x82, 0x99, 0x11, 0x52, 0xE3, 0x83, 0x95, 0xE3, 0x82, 0xA1, 0xE3, 0x83, 0xA9, 0xE3, 0x83, 0x83, 0xE3, 0x83, 0x88, 0xE3, 0x82, 0x99, 0x11, 0x03, // Bytes 2ec0 - 2eff 0x3C, 0xCC, 0xB8, 0x05, 0x03, 0x3D, 0xCC, 0xB8, 0x05, 0x03, 0x3E, 0xCC, 0xB8, 0x05, 0x03, 0x41, 0xCC, 0x80, 0xCD, 0x03, 0x41, 0xCC, 0x81, 0xCD, 0x03, 0x41, 0xCC, 0x83, 0xCD, 0x03, 0x41, 0xCC, 0x84, 0xCD, 0x03, 0x41, 0xCC, 0x89, 0xCD, 0x03, 0x41, 0xCC, 0x8C, 0xCD, 0x03, 0x41, 0xCC, 0x8F, 0xCD, 0x03, 0x41, 0xCC, 0x91, 0xCD, 0x03, 0x41, 0xCC, 0xA5, 0xB9, 0x03, 0x41, 0xCC, 0xA8, 0xA9, // Bytes 2f00 - 2f3f 0x03, 0x42, 0xCC, 0x87, 0xCD, 0x03, 0x42, 0xCC, 0xA3, 0xB9, 0x03, 0x42, 0xCC, 0xB1, 0xB9, 0x03, 0x43, 0xCC, 0x81, 0xCD, 0x03, 0x43, 0xCC, 0x82, 0xCD, 0x03, 0x43, 0xCC, 0x87, 0xCD, 0x03, 0x43, 0xCC, 0x8C, 0xCD, 0x03, 0x44, 0xCC, 0x87, 0xCD, 0x03, 0x44, 0xCC, 0x8C, 0xCD, 0x03, 0x44, 0xCC, 0xA3, 0xB9, 0x03, 0x44, 0xCC, 0xA7, 0xA9, 0x03, 0x44, 0xCC, 0xAD, 0xB9, 0x03, 0x44, 0xCC, 0xB1, // Bytes 2f40 - 2f7f 0xB9, 0x03, 0x45, 0xCC, 0x80, 0xCD, 0x03, 0x45, 0xCC, 0x81, 0xCD, 0x03, 0x45, 0xCC, 0x83, 0xCD, 0x03, 0x45, 0xCC, 0x86, 0xCD, 0x03, 0x45, 0xCC, 0x87, 0xCD, 0x03, 0x45, 0xCC, 0x88, 0xCD, 0x03, 0x45, 0xCC, 0x89, 0xCD, 0x03, 0x45, 0xCC, 0x8C, 0xCD, 0x03, 0x45, 0xCC, 0x8F, 0xCD, 0x03, 0x45, 0xCC, 0x91, 0xCD, 0x03, 0x45, 0xCC, 0xA8, 0xA9, 0x03, 0x45, 0xCC, 0xAD, 0xB9, 0x03, 0x45, 0xCC, // Bytes 2f80 - 2fbf 0xB0, 0xB9, 0x03, 0x46, 0xCC, 0x87, 0xCD, 0x03, 0x47, 0xCC, 0x81, 0xCD, 0x03, 0x47, 0xCC, 0x82, 0xCD, 0x03, 0x47, 0xCC, 0x84, 0xCD, 0x03, 0x47, 0xCC, 0x86, 0xCD, 0x03, 0x47, 0xCC, 0x87, 0xCD, 0x03, 0x47, 0xCC, 0x8C, 0xCD, 0x03, 0x47, 0xCC, 0xA7, 0xA9, 0x03, 0x48, 0xCC, 0x82, 0xCD, 0x03, 0x48, 0xCC, 0x87, 0xCD, 0x03, 0x48, 0xCC, 0x88, 0xCD, 0x03, 0x48, 0xCC, 0x8C, 0xCD, 0x03, 0x48, // Bytes 2fc0 - 2fff 0xCC, 0xA3, 0xB9, 0x03, 0x48, 0xCC, 0xA7, 0xA9, 0x03, 0x48, 0xCC, 0xAE, 0xB9, 0x03, 0x49, 0xCC, 0x80, 0xCD, 0x03, 0x49, 0xCC, 0x81, 0xCD, 0x03, 0x49, 0xCC, 0x82, 0xCD, 0x03, 0x49, 0xCC, 0x83, 0xCD, 0x03, 0x49, 0xCC, 0x84, 0xCD, 0x03, 0x49, 0xCC, 0x86, 0xCD, 0x03, 0x49, 0xCC, 0x87, 0xCD, 0x03, 0x49, 0xCC, 0x89, 0xCD, 0x03, 0x49, 0xCC, 0x8C, 0xCD, 0x03, 0x49, 0xCC, 0x8F, 0xCD, 0x03, // Bytes 3000 - 303f 0x49, 0xCC, 0x91, 0xCD, 0x03, 0x49, 0xCC, 0xA3, 0xB9, 0x03, 0x49, 0xCC, 0xA8, 0xA9, 0x03, 0x49, 0xCC, 0xB0, 0xB9, 0x03, 0x4A, 0xCC, 0x82, 0xCD, 0x03, 0x4B, 0xCC, 0x81, 0xCD, 0x03, 0x4B, 0xCC, 0x8C, 0xCD, 0x03, 0x4B, 0xCC, 0xA3, 0xB9, 0x03, 0x4B, 0xCC, 0xA7, 0xA9, 0x03, 0x4B, 0xCC, 0xB1, 0xB9, 0x03, 0x4C, 0xCC, 0x81, 0xCD, 0x03, 0x4C, 0xCC, 0x8C, 0xCD, 0x03, 0x4C, 0xCC, 0xA7, 0xA9, // Bytes 3040 - 307f 0x03, 0x4C, 0xCC, 0xAD, 0xB9, 0x03, 0x4C, 0xCC, 0xB1, 0xB9, 0x03, 0x4D, 0xCC, 0x81, 0xCD, 0x03, 0x4D, 0xCC, 0x87, 0xCD, 0x03, 0x4D, 0xCC, 0xA3, 0xB9, 0x03, 0x4E, 0xCC, 0x80, 0xCD, 0x03, 0x4E, 0xCC, 0x81, 0xCD, 0x03, 0x4E, 0xCC, 0x83, 0xCD, 0x03, 0x4E, 0xCC, 0x87, 0xCD, 0x03, 0x4E, 0xCC, 0x8C, 0xCD, 0x03, 0x4E, 0xCC, 0xA3, 0xB9, 0x03, 0x4E, 0xCC, 0xA7, 0xA9, 0x03, 0x4E, 0xCC, 0xAD, // Bytes 3080 - 30bf 0xB9, 0x03, 0x4E, 0xCC, 0xB1, 0xB9, 0x03, 0x4F, 0xCC, 0x80, 0xCD, 0x03, 0x4F, 0xCC, 0x81, 0xCD, 0x03, 0x4F, 0xCC, 0x86, 0xCD, 0x03, 0x4F, 0xCC, 0x89, 0xCD, 0x03, 0x4F, 0xCC, 0x8B, 0xCD, 0x03, 0x4F, 0xCC, 0x8C, 0xCD, 0x03, 0x4F, 0xCC, 0x8F, 0xCD, 0x03, 0x4F, 0xCC, 0x91, 0xCD, 0x03, 0x50, 0xCC, 0x81, 0xCD, 0x03, 0x50, 0xCC, 0x87, 0xCD, 0x03, 0x52, 0xCC, 0x81, 0xCD, 0x03, 0x52, 0xCC, // Bytes 30c0 - 30ff 0x87, 0xCD, 0x03, 0x52, 0xCC, 0x8C, 0xCD, 0x03, 0x52, 0xCC, 0x8F, 0xCD, 0x03, 0x52, 0xCC, 0x91, 0xCD, 0x03, 0x52, 0xCC, 0xA7, 0xA9, 0x03, 0x52, 0xCC, 0xB1, 0xB9, 0x03, 0x53, 0xCC, 0x82, 0xCD, 0x03, 0x53, 0xCC, 0x87, 0xCD, 0x03, 0x53, 0xCC, 0xA6, 0xB9, 0x03, 0x53, 0xCC, 0xA7, 0xA9, 0x03, 0x54, 0xCC, 0x87, 0xCD, 0x03, 0x54, 0xCC, 0x8C, 0xCD, 0x03, 0x54, 0xCC, 0xA3, 0xB9, 0x03, 0x54, // Bytes 3100 - 313f 0xCC, 0xA6, 0xB9, 0x03, 0x54, 0xCC, 0xA7, 0xA9, 0x03, 0x54, 0xCC, 0xAD, 0xB9, 0x03, 0x54, 0xCC, 0xB1, 0xB9, 0x03, 0x55, 0xCC, 0x80, 0xCD, 0x03, 0x55, 0xCC, 0x81, 0xCD, 0x03, 0x55, 0xCC, 0x82, 0xCD, 0x03, 0x55, 0xCC, 0x86, 0xCD, 0x03, 0x55, 0xCC, 0x89, 0xCD, 0x03, 0x55, 0xCC, 0x8A, 0xCD, 0x03, 0x55, 0xCC, 0x8B, 0xCD, 0x03, 0x55, 0xCC, 0x8C, 0xCD, 0x03, 0x55, 0xCC, 0x8F, 0xCD, 0x03, // Bytes 3140 - 317f 0x55, 0xCC, 0x91, 0xCD, 0x03, 0x55, 0xCC, 0xA3, 0xB9, 0x03, 0x55, 0xCC, 0xA4, 0xB9, 0x03, 0x55, 0xCC, 0xA8, 0xA9, 0x03, 0x55, 0xCC, 0xAD, 0xB9, 0x03, 0x55, 0xCC, 0xB0, 0xB9, 0x03, 0x56, 0xCC, 0x83, 0xCD, 0x03, 0x56, 0xCC, 0xA3, 0xB9, 0x03, 0x57, 0xCC, 0x80, 0xCD, 0x03, 0x57, 0xCC, 0x81, 0xCD, 0x03, 0x57, 0xCC, 0x82, 0xCD, 0x03, 0x57, 0xCC, 0x87, 0xCD, 0x03, 0x57, 0xCC, 0x88, 0xCD, // Bytes 3180 - 31bf 0x03, 0x57, 0xCC, 0xA3, 0xB9, 0x03, 0x58, 0xCC, 0x87, 0xCD, 0x03, 0x58, 0xCC, 0x88, 0xCD, 0x03, 0x59, 0xCC, 0x80, 0xCD, 0x03, 0x59, 0xCC, 0x81, 0xCD, 0x03, 0x59, 0xCC, 0x82, 0xCD, 0x03, 0x59, 0xCC, 0x83, 0xCD, 0x03, 0x59, 0xCC, 0x84, 0xCD, 0x03, 0x59, 0xCC, 0x87, 0xCD, 0x03, 0x59, 0xCC, 0x88, 0xCD, 0x03, 0x59, 0xCC, 0x89, 0xCD, 0x03, 0x59, 0xCC, 0xA3, 0xB9, 0x03, 0x5A, 0xCC, 0x81, // Bytes 31c0 - 31ff 0xCD, 0x03, 0x5A, 0xCC, 0x82, 0xCD, 0x03, 0x5A, 0xCC, 0x87, 0xCD, 0x03, 0x5A, 0xCC, 0x8C, 0xCD, 0x03, 0x5A, 0xCC, 0xA3, 0xB9, 0x03, 0x5A, 0xCC, 0xB1, 0xB9, 0x03, 0x61, 0xCC, 0x80, 0xCD, 0x03, 0x61, 0xCC, 0x81, 0xCD, 0x03, 0x61, 0xCC, 0x83, 0xCD, 0x03, 0x61, 0xCC, 0x84, 0xCD, 0x03, 0x61, 0xCC, 0x89, 0xCD, 0x03, 0x61, 0xCC, 0x8C, 0xCD, 0x03, 0x61, 0xCC, 0x8F, 0xCD, 0x03, 0x61, 0xCC, // Bytes 3200 - 323f 0x91, 0xCD, 0x03, 0x61, 0xCC, 0xA5, 0xB9, 0x03, 0x61, 0xCC, 0xA8, 0xA9, 0x03, 0x62, 0xCC, 0x87, 0xCD, 0x03, 0x62, 0xCC, 0xA3, 0xB9, 0x03, 0x62, 0xCC, 0xB1, 0xB9, 0x03, 0x63, 0xCC, 0x81, 0xCD, 0x03, 0x63, 0xCC, 0x82, 0xCD, 0x03, 0x63, 0xCC, 0x87, 0xCD, 0x03, 0x63, 0xCC, 0x8C, 0xCD, 0x03, 0x64, 0xCC, 0x87, 0xCD, 0x03, 0x64, 0xCC, 0x8C, 0xCD, 0x03, 0x64, 0xCC, 0xA3, 0xB9, 0x03, 0x64, // Bytes 3240 - 327f 0xCC, 0xA7, 0xA9, 0x03, 0x64, 0xCC, 0xAD, 0xB9, 0x03, 0x64, 0xCC, 0xB1, 0xB9, 0x03, 0x65, 0xCC, 0x80, 0xCD, 0x03, 0x65, 0xCC, 0x81, 0xCD, 0x03, 0x65, 0xCC, 0x83, 0xCD, 0x03, 0x65, 0xCC, 0x86, 0xCD, 0x03, 0x65, 0xCC, 0x87, 0xCD, 0x03, 0x65, 0xCC, 0x88, 0xCD, 0x03, 0x65, 0xCC, 0x89, 0xCD, 0x03, 0x65, 0xCC, 0x8C, 0xCD, 0x03, 0x65, 0xCC, 0x8F, 0xCD, 0x03, 0x65, 0xCC, 0x91, 0xCD, 0x03, // Bytes 3280 - 32bf 0x65, 0xCC, 0xA8, 0xA9, 0x03, 0x65, 0xCC, 0xAD, 0xB9, 0x03, 0x65, 0xCC, 0xB0, 0xB9, 0x03, 0x66, 0xCC, 0x87, 0xCD, 0x03, 0x67, 0xCC, 0x81, 0xCD, 0x03, 0x67, 0xCC, 0x82, 0xCD, 0x03, 0x67, 0xCC, 0x84, 0xCD, 0x03, 0x67, 0xCC, 0x86, 0xCD, 0x03, 0x67, 0xCC, 0x87, 0xCD, 0x03, 0x67, 0xCC, 0x8C, 0xCD, 0x03, 0x67, 0xCC, 0xA7, 0xA9, 0x03, 0x68, 0xCC, 0x82, 0xCD, 0x03, 0x68, 0xCC, 0x87, 0xCD, // Bytes 32c0 - 32ff 0x03, 0x68, 0xCC, 0x88, 0xCD, 0x03, 0x68, 0xCC, 0x8C, 0xCD, 0x03, 0x68, 0xCC, 0xA3, 0xB9, 0x03, 0x68, 0xCC, 0xA7, 0xA9, 0x03, 0x68, 0xCC, 0xAE, 0xB9, 0x03, 0x68, 0xCC, 0xB1, 0xB9, 0x03, 0x69, 0xCC, 0x80, 0xCD, 0x03, 0x69, 0xCC, 0x81, 0xCD, 0x03, 0x69, 0xCC, 0x82, 0xCD, 0x03, 0x69, 0xCC, 0x83, 0xCD, 0x03, 0x69, 0xCC, 0x84, 0xCD, 0x03, 0x69, 0xCC, 0x86, 0xCD, 0x03, 0x69, 0xCC, 0x89, // Bytes 3300 - 333f 0xCD, 0x03, 0x69, 0xCC, 0x8C, 0xCD, 0x03, 0x69, 0xCC, 0x8F, 0xCD, 0x03, 0x69, 0xCC, 0x91, 0xCD, 0x03, 0x69, 0xCC, 0xA3, 0xB9, 0x03, 0x69, 0xCC, 0xA8, 0xA9, 0x03, 0x69, 0xCC, 0xB0, 0xB9, 0x03, 0x6A, 0xCC, 0x82, 0xCD, 0x03, 0x6A, 0xCC, 0x8C, 0xCD, 0x03, 0x6B, 0xCC, 0x81, 0xCD, 0x03, 0x6B, 0xCC, 0x8C, 0xCD, 0x03, 0x6B, 0xCC, 0xA3, 0xB9, 0x03, 0x6B, 0xCC, 0xA7, 0xA9, 0x03, 0x6B, 0xCC, // Bytes 3340 - 337f 0xB1, 0xB9, 0x03, 0x6C, 0xCC, 0x81, 0xCD, 0x03, 0x6C, 0xCC, 0x8C, 0xCD, 0x03, 0x6C, 0xCC, 0xA7, 0xA9, 0x03, 0x6C, 0xCC, 0xAD, 0xB9, 0x03, 0x6C, 0xCC, 0xB1, 0xB9, 0x03, 0x6D, 0xCC, 0x81, 0xCD, 0x03, 0x6D, 0xCC, 0x87, 0xCD, 0x03, 0x6D, 0xCC, 0xA3, 0xB9, 0x03, 0x6E, 0xCC, 0x80, 0xCD, 0x03, 0x6E, 0xCC, 0x81, 0xCD, 0x03, 0x6E, 0xCC, 0x83, 0xCD, 0x03, 0x6E, 0xCC, 0x87, 0xCD, 0x03, 0x6E, // Bytes 3380 - 33bf 0xCC, 0x8C, 0xCD, 0x03, 0x6E, 0xCC, 0xA3, 0xB9, 0x03, 0x6E, 0xCC, 0xA7, 0xA9, 0x03, 0x6E, 0xCC, 0xAD, 0xB9, 0x03, 0x6E, 0xCC, 0xB1, 0xB9, 0x03, 0x6F, 0xCC, 0x80, 0xCD, 0x03, 0x6F, 0xCC, 0x81, 0xCD, 0x03, 0x6F, 0xCC, 0x86, 0xCD, 0x03, 0x6F, 0xCC, 0x89, 0xCD, 0x03, 0x6F, 0xCC, 0x8B, 0xCD, 0x03, 0x6F, 0xCC, 0x8C, 0xCD, 0x03, 0x6F, 0xCC, 0x8F, 0xCD, 0x03, 0x6F, 0xCC, 0x91, 0xCD, 0x03, // Bytes 33c0 - 33ff 0x70, 0xCC, 0x81, 0xCD, 0x03, 0x70, 0xCC, 0x87, 0xCD, 0x03, 0x72, 0xCC, 0x81, 0xCD, 0x03, 0x72, 0xCC, 0x87, 0xCD, 0x03, 0x72, 0xCC, 0x8C, 0xCD, 0x03, 0x72, 0xCC, 0x8F, 0xCD, 0x03, 0x72, 0xCC, 0x91, 0xCD, 0x03, 0x72, 0xCC, 0xA7, 0xA9, 0x03, 0x72, 0xCC, 0xB1, 0xB9, 0x03, 0x73, 0xCC, 0x82, 0xCD, 0x03, 0x73, 0xCC, 0x87, 0xCD, 0x03, 0x73, 0xCC, 0xA6, 0xB9, 0x03, 0x73, 0xCC, 0xA7, 0xA9, // Bytes 3400 - 343f 0x03, 0x74, 0xCC, 0x87, 0xCD, 0x03, 0x74, 0xCC, 0x88, 0xCD, 0x03, 0x74, 0xCC, 0x8C, 0xCD, 0x03, 0x74, 0xCC, 0xA3, 0xB9, 0x03, 0x74, 0xCC, 0xA6, 0xB9, 0x03, 0x74, 0xCC, 0xA7, 0xA9, 0x03, 0x74, 0xCC, 0xAD, 0xB9, 0x03, 0x74, 0xCC, 0xB1, 0xB9, 0x03, 0x75, 0xCC, 0x80, 0xCD, 0x03, 0x75, 0xCC, 0x81, 0xCD, 0x03, 0x75, 0xCC, 0x82, 0xCD, 0x03, 0x75, 0xCC, 0x86, 0xCD, 0x03, 0x75, 0xCC, 0x89, // Bytes 3440 - 347f 0xCD, 0x03, 0x75, 0xCC, 0x8A, 0xCD, 0x03, 0x75, 0xCC, 0x8B, 0xCD, 0x03, 0x75, 0xCC, 0x8C, 0xCD, 0x03, 0x75, 0xCC, 0x8F, 0xCD, 0x03, 0x75, 0xCC, 0x91, 0xCD, 0x03, 0x75, 0xCC, 0xA3, 0xB9, 0x03, 0x75, 0xCC, 0xA4, 0xB9, 0x03, 0x75, 0xCC, 0xA8, 0xA9, 0x03, 0x75, 0xCC, 0xAD, 0xB9, 0x03, 0x75, 0xCC, 0xB0, 0xB9, 0x03, 0x76, 0xCC, 0x83, 0xCD, 0x03, 0x76, 0xCC, 0xA3, 0xB9, 0x03, 0x77, 0xCC, // Bytes 3480 - 34bf 0x80, 0xCD, 0x03, 0x77, 0xCC, 0x81, 0xCD, 0x03, 0x77, 0xCC, 0x82, 0xCD, 0x03, 0x77, 0xCC, 0x87, 0xCD, 0x03, 0x77, 0xCC, 0x88, 0xCD, 0x03, 0x77, 0xCC, 0x8A, 0xCD, 0x03, 0x77, 0xCC, 0xA3, 0xB9, 0x03, 0x78, 0xCC, 0x87, 0xCD, 0x03, 0x78, 0xCC, 0x88, 0xCD, 0x03, 0x79, 0xCC, 0x80, 0xCD, 0x03, 0x79, 0xCC, 0x81, 0xCD, 0x03, 0x79, 0xCC, 0x82, 0xCD, 0x03, 0x79, 0xCC, 0x83, 0xCD, 0x03, 0x79, // Bytes 34c0 - 34ff 0xCC, 0x84, 0xCD, 0x03, 0x79, 0xCC, 0x87, 0xCD, 0x03, 0x79, 0xCC, 0x88, 0xCD, 0x03, 0x79, 0xCC, 0x89, 0xCD, 0x03, 0x79, 0xCC, 0x8A, 0xCD, 0x03, 0x79, 0xCC, 0xA3, 0xB9, 0x03, 0x7A, 0xCC, 0x81, 0xCD, 0x03, 0x7A, 0xCC, 0x82, 0xCD, 0x03, 0x7A, 0xCC, 0x87, 0xCD, 0x03, 0x7A, 0xCC, 0x8C, 0xCD, 0x03, 0x7A, 0xCC, 0xA3, 0xB9, 0x03, 0x7A, 0xCC, 0xB1, 0xB9, 0x04, 0xC2, 0xA8, 0xCC, 0x80, 0xCE, // Bytes 3500 - 353f 0x04, 0xC2, 0xA8, 0xCC, 0x81, 0xCE, 0x04, 0xC2, 0xA8, 0xCD, 0x82, 0xCE, 0x04, 0xC3, 0x86, 0xCC, 0x81, 0xCD, 0x04, 0xC3, 0x86, 0xCC, 0x84, 0xCD, 0x04, 0xC3, 0x98, 0xCC, 0x81, 0xCD, 0x04, 0xC3, 0xA6, 0xCC, 0x81, 0xCD, 0x04, 0xC3, 0xA6, 0xCC, 0x84, 0xCD, 0x04, 0xC3, 0xB8, 0xCC, 0x81, 0xCD, 0x04, 0xC5, 0xBF, 0xCC, 0x87, 0xCD, 0x04, 0xC6, 0xB7, 0xCC, 0x8C, 0xCD, 0x04, 0xCA, 0x92, 0xCC, // Bytes 3540 - 357f 0x8C, 0xCD, 0x04, 0xCE, 0x91, 0xCC, 0x80, 0xCD, 0x04, 0xCE, 0x91, 0xCC, 0x81, 0xCD, 0x04, 0xCE, 0x91, 0xCC, 0x84, 0xCD, 0x04, 0xCE, 0x91, 0xCC, 0x86, 0xCD, 0x04, 0xCE, 0x91, 0xCD, 0x85, 0xDD, 0x04, 0xCE, 0x95, 0xCC, 0x80, 0xCD, 0x04, 0xCE, 0x95, 0xCC, 0x81, 0xCD, 0x04, 0xCE, 0x97, 0xCC, 0x80, 0xCD, 0x04, 0xCE, 0x97, 0xCC, 0x81, 0xCD, 0x04, 0xCE, 0x97, 0xCD, 0x85, 0xDD, 0x04, 0xCE, // Bytes 3580 - 35bf 0x99, 0xCC, 0x80, 0xCD, 0x04, 0xCE, 0x99, 0xCC, 0x81, 0xCD, 0x04, 0xCE, 0x99, 0xCC, 0x84, 0xCD, 0x04, 0xCE, 0x99, 0xCC, 0x86, 0xCD, 0x04, 0xCE, 0x99, 0xCC, 0x88, 0xCD, 0x04, 0xCE, 0x9F, 0xCC, 0x80, 0xCD, 0x04, 0xCE, 0x9F, 0xCC, 0x81, 0xCD, 0x04, 0xCE, 0xA1, 0xCC, 0x94, 0xCD, 0x04, 0xCE, 0xA5, 0xCC, 0x80, 0xCD, 0x04, 0xCE, 0xA5, 0xCC, 0x81, 0xCD, 0x04, 0xCE, 0xA5, 0xCC, 0x84, 0xCD, // Bytes 35c0 - 35ff 0x04, 0xCE, 0xA5, 0xCC, 0x86, 0xCD, 0x04, 0xCE, 0xA5, 0xCC, 0x88, 0xCD, 0x04, 0xCE, 0xA9, 0xCC, 0x80, 0xCD, 0x04, 0xCE, 0xA9, 0xCC, 0x81, 0xCD, 0x04, 0xCE, 0xA9, 0xCD, 0x85, 0xDD, 0x04, 0xCE, 0xB1, 0xCC, 0x84, 0xCD, 0x04, 0xCE, 0xB1, 0xCC, 0x86, 0xCD, 0x04, 0xCE, 0xB1, 0xCD, 0x85, 0xDD, 0x04, 0xCE, 0xB5, 0xCC, 0x80, 0xCD, 0x04, 0xCE, 0xB5, 0xCC, 0x81, 0xCD, 0x04, 0xCE, 0xB7, 0xCD, // Bytes 3600 - 363f 0x85, 0xDD, 0x04, 0xCE, 0xB9, 0xCC, 0x80, 0xCD, 0x04, 0xCE, 0xB9, 0xCC, 0x81, 0xCD, 0x04, 0xCE, 0xB9, 0xCC, 0x84, 0xCD, 0x04, 0xCE, 0xB9, 0xCC, 0x86, 0xCD, 0x04, 0xCE, 0xB9, 0xCD, 0x82, 0xCD, 0x04, 0xCE, 0xBF, 0xCC, 0x80, 0xCD, 0x04, 0xCE, 0xBF, 0xCC, 0x81, 0xCD, 0x04, 0xCF, 0x81, 0xCC, 0x93, 0xCD, 0x04, 0xCF, 0x81, 0xCC, 0x94, 0xCD, 0x04, 0xCF, 0x85, 0xCC, 0x80, 0xCD, 0x04, 0xCF, // Bytes 3640 - 367f 0x85, 0xCC, 0x81, 0xCD, 0x04, 0xCF, 0x85, 0xCC, 0x84, 0xCD, 0x04, 0xCF, 0x85, 0xCC, 0x86, 0xCD, 0x04, 0xCF, 0x85, 0xCD, 0x82, 0xCD, 0x04, 0xCF, 0x89, 0xCD, 0x85, 0xDD, 0x04, 0xCF, 0x92, 0xCC, 0x81, 0xCD, 0x04, 0xCF, 0x92, 0xCC, 0x88, 0xCD, 0x04, 0xD0, 0x86, 0xCC, 0x88, 0xCD, 0x04, 0xD0, 0x90, 0xCC, 0x86, 0xCD, 0x04, 0xD0, 0x90, 0xCC, 0x88, 0xCD, 0x04, 0xD0, 0x93, 0xCC, 0x81, 0xCD, // Bytes 3680 - 36bf 0x04, 0xD0, 0x95, 0xCC, 0x80, 0xCD, 0x04, 0xD0, 0x95, 0xCC, 0x86, 0xCD, 0x04, 0xD0, 0x95, 0xCC, 0x88, 0xCD, 0x04, 0xD0, 0x96, 0xCC, 0x86, 0xCD, 0x04, 0xD0, 0x96, 0xCC, 0x88, 0xCD, 0x04, 0xD0, 0x97, 0xCC, 0x88, 0xCD, 0x04, 0xD0, 0x98, 0xCC, 0x80, 0xCD, 0x04, 0xD0, 0x98, 0xCC, 0x84, 0xCD, 0x04, 0xD0, 0x98, 0xCC, 0x86, 0xCD, 0x04, 0xD0, 0x98, 0xCC, 0x88, 0xCD, 0x04, 0xD0, 0x9A, 0xCC, // Bytes 36c0 - 36ff 0x81, 0xCD, 0x04, 0xD0, 0x9E, 0xCC, 0x88, 0xCD, 0x04, 0xD0, 0xA3, 0xCC, 0x84, 0xCD, 0x04, 0xD0, 0xA3, 0xCC, 0x86, 0xCD, 0x04, 0xD0, 0xA3, 0xCC, 0x88, 0xCD, 0x04, 0xD0, 0xA3, 0xCC, 0x8B, 0xCD, 0x04, 0xD0, 0xA7, 0xCC, 0x88, 0xCD, 0x04, 0xD0, 0xAB, 0xCC, 0x88, 0xCD, 0x04, 0xD0, 0xAD, 0xCC, 0x88, 0xCD, 0x04, 0xD0, 0xB0, 0xCC, 0x86, 0xCD, 0x04, 0xD0, 0xB0, 0xCC, 0x88, 0xCD, 0x04, 0xD0, // Bytes 3700 - 373f 0xB3, 0xCC, 0x81, 0xCD, 0x04, 0xD0, 0xB5, 0xCC, 0x80, 0xCD, 0x04, 0xD0, 0xB5, 0xCC, 0x86, 0xCD, 0x04, 0xD0, 0xB5, 0xCC, 0x88, 0xCD, 0x04, 0xD0, 0xB6, 0xCC, 0x86, 0xCD, 0x04, 0xD0, 0xB6, 0xCC, 0x88, 0xCD, 0x04, 0xD0, 0xB7, 0xCC, 0x88, 0xCD, 0x04, 0xD0, 0xB8, 0xCC, 0x80, 0xCD, 0x04, 0xD0, 0xB8, 0xCC, 0x84, 0xCD, 0x04, 0xD0, 0xB8, 0xCC, 0x86, 0xCD, 0x04, 0xD0, 0xB8, 0xCC, 0x88, 0xCD, // Bytes 3740 - 377f 0x04, 0xD0, 0xBA, 0xCC, 0x81, 0xCD, 0x04, 0xD0, 0xBE, 0xCC, 0x88, 0xCD, 0x04, 0xD1, 0x83, 0xCC, 0x84, 0xCD, 0x04, 0xD1, 0x83, 0xCC, 0x86, 0xCD, 0x04, 0xD1, 0x83, 0xCC, 0x88, 0xCD, 0x04, 0xD1, 0x83, 0xCC, 0x8B, 0xCD, 0x04, 0xD1, 0x87, 0xCC, 0x88, 0xCD, 0x04, 0xD1, 0x8B, 0xCC, 0x88, 0xCD, 0x04, 0xD1, 0x8D, 0xCC, 0x88, 0xCD, 0x04, 0xD1, 0x96, 0xCC, 0x88, 0xCD, 0x04, 0xD1, 0xB4, 0xCC, // Bytes 3780 - 37bf 0x8F, 0xCD, 0x04, 0xD1, 0xB5, 0xCC, 0x8F, 0xCD, 0x04, 0xD3, 0x98, 0xCC, 0x88, 0xCD, 0x04, 0xD3, 0x99, 0xCC, 0x88, 0xCD, 0x04, 0xD3, 0xA8, 0xCC, 0x88, 0xCD, 0x04, 0xD3, 0xA9, 0xCC, 0x88, 0xCD, 0x04, 0xD8, 0xA7, 0xD9, 0x93, 0xCD, 0x04, 0xD8, 0xA7, 0xD9, 0x94, 0xCD, 0x04, 0xD8, 0xA7, 0xD9, 0x95, 0xB9, 0x04, 0xD9, 0x88, 0xD9, 0x94, 0xCD, 0x04, 0xD9, 0x8A, 0xD9, 0x94, 0xCD, 0x04, 0xDB, // Bytes 37c0 - 37ff 0x81, 0xD9, 0x94, 0xCD, 0x04, 0xDB, 0x92, 0xD9, 0x94, 0xCD, 0x04, 0xDB, 0x95, 0xD9, 0x94, 0xCD, 0x05, 0x41, 0xCC, 0x82, 0xCC, 0x80, 0xCE, 0x05, 0x41, 0xCC, 0x82, 0xCC, 0x81, 0xCE, 0x05, 0x41, 0xCC, 0x82, 0xCC, 0x83, 0xCE, 0x05, 0x41, 0xCC, 0x82, 0xCC, 0x89, 0xCE, 0x05, 0x41, 0xCC, 0x86, 0xCC, 0x80, 0xCE, 0x05, 0x41, 0xCC, 0x86, 0xCC, 0x81, 0xCE, 0x05, 0x41, 0xCC, 0x86, 0xCC, 0x83, // Bytes 3800 - 383f 0xCE, 0x05, 0x41, 0xCC, 0x86, 0xCC, 0x89, 0xCE, 0x05, 0x41, 0xCC, 0x87, 0xCC, 0x84, 0xCE, 0x05, 0x41, 0xCC, 0x88, 0xCC, 0x84, 0xCE, 0x05, 0x41, 0xCC, 0x8A, 0xCC, 0x81, 0xCE, 0x05, 0x41, 0xCC, 0xA3, 0xCC, 0x82, 0xCE, 0x05, 0x41, 0xCC, 0xA3, 0xCC, 0x86, 0xCE, 0x05, 0x43, 0xCC, 0xA7, 0xCC, 0x81, 0xCE, 0x05, 0x45, 0xCC, 0x82, 0xCC, 0x80, 0xCE, 0x05, 0x45, 0xCC, 0x82, 0xCC, 0x81, 0xCE, // Bytes 3840 - 387f 0x05, 0x45, 0xCC, 0x82, 0xCC, 0x83, 0xCE, 0x05, 0x45, 0xCC, 0x82, 0xCC, 0x89, 0xCE, 0x05, 0x45, 0xCC, 0x84, 0xCC, 0x80, 0xCE, 0x05, 0x45, 0xCC, 0x84, 0xCC, 0x81, 0xCE, 0x05, 0x45, 0xCC, 0xA3, 0xCC, 0x82, 0xCE, 0x05, 0x45, 0xCC, 0xA7, 0xCC, 0x86, 0xCE, 0x05, 0x49, 0xCC, 0x88, 0xCC, 0x81, 0xCE, 0x05, 0x4C, 0xCC, 0xA3, 0xCC, 0x84, 0xCE, 0x05, 0x4F, 0xCC, 0x82, 0xCC, 0x80, 0xCE, 0x05, // Bytes 3880 - 38bf 0x4F, 0xCC, 0x82, 0xCC, 0x81, 0xCE, 0x05, 0x4F, 0xCC, 0x82, 0xCC, 0x83, 0xCE, 0x05, 0x4F, 0xCC, 0x82, 0xCC, 0x89, 0xCE, 0x05, 0x4F, 0xCC, 0x83, 0xCC, 0x81, 0xCE, 0x05, 0x4F, 0xCC, 0x83, 0xCC, 0x84, 0xCE, 0x05, 0x4F, 0xCC, 0x83, 0xCC, 0x88, 0xCE, 0x05, 0x4F, 0xCC, 0x84, 0xCC, 0x80, 0xCE, 0x05, 0x4F, 0xCC, 0x84, 0xCC, 0x81, 0xCE, 0x05, 0x4F, 0xCC, 0x87, 0xCC, 0x84, 0xCE, 0x05, 0x4F, // Bytes 38c0 - 38ff 0xCC, 0x88, 0xCC, 0x84, 0xCE, 0x05, 0x4F, 0xCC, 0x9B, 0xCC, 0x80, 0xCE, 0x05, 0x4F, 0xCC, 0x9B, 0xCC, 0x81, 0xCE, 0x05, 0x4F, 0xCC, 0x9B, 0xCC, 0x83, 0xCE, 0x05, 0x4F, 0xCC, 0x9B, 0xCC, 0x89, 0xCE, 0x05, 0x4F, 0xCC, 0x9B, 0xCC, 0xA3, 0xBA, 0x05, 0x4F, 0xCC, 0xA3, 0xCC, 0x82, 0xCE, 0x05, 0x4F, 0xCC, 0xA8, 0xCC, 0x84, 0xCE, 0x05, 0x52, 0xCC, 0xA3, 0xCC, 0x84, 0xCE, 0x05, 0x53, 0xCC, // Bytes 3900 - 393f 0x81, 0xCC, 0x87, 0xCE, 0x05, 0x53, 0xCC, 0x8C, 0xCC, 0x87, 0xCE, 0x05, 0x53, 0xCC, 0xA3, 0xCC, 0x87, 0xCE, 0x05, 0x55, 0xCC, 0x83, 0xCC, 0x81, 0xCE, 0x05, 0x55, 0xCC, 0x84, 0xCC, 0x88, 0xCE, 0x05, 0x55, 0xCC, 0x88, 0xCC, 0x80, 0xCE, 0x05, 0x55, 0xCC, 0x88, 0xCC, 0x81, 0xCE, 0x05, 0x55, 0xCC, 0x88, 0xCC, 0x84, 0xCE, 0x05, 0x55, 0xCC, 0x88, 0xCC, 0x8C, 0xCE, 0x05, 0x55, 0xCC, 0x9B, // Bytes 3940 - 397f 0xCC, 0x80, 0xCE, 0x05, 0x55, 0xCC, 0x9B, 0xCC, 0x81, 0xCE, 0x05, 0x55, 0xCC, 0x9B, 0xCC, 0x83, 0xCE, 0x05, 0x55, 0xCC, 0x9B, 0xCC, 0x89, 0xCE, 0x05, 0x55, 0xCC, 0x9B, 0xCC, 0xA3, 0xBA, 0x05, 0x61, 0xCC, 0x82, 0xCC, 0x80, 0xCE, 0x05, 0x61, 0xCC, 0x82, 0xCC, 0x81, 0xCE, 0x05, 0x61, 0xCC, 0x82, 0xCC, 0x83, 0xCE, 0x05, 0x61, 0xCC, 0x82, 0xCC, 0x89, 0xCE, 0x05, 0x61, 0xCC, 0x86, 0xCC, // Bytes 3980 - 39bf 0x80, 0xCE, 0x05, 0x61, 0xCC, 0x86, 0xCC, 0x81, 0xCE, 0x05, 0x61, 0xCC, 0x86, 0xCC, 0x83, 0xCE, 0x05, 0x61, 0xCC, 0x86, 0xCC, 0x89, 0xCE, 0x05, 0x61, 0xCC, 0x87, 0xCC, 0x84, 0xCE, 0x05, 0x61, 0xCC, 0x88, 0xCC, 0x84, 0xCE, 0x05, 0x61, 0xCC, 0x8A, 0xCC, 0x81, 0xCE, 0x05, 0x61, 0xCC, 0xA3, 0xCC, 0x82, 0xCE, 0x05, 0x61, 0xCC, 0xA3, 0xCC, 0x86, 0xCE, 0x05, 0x63, 0xCC, 0xA7, 0xCC, 0x81, // Bytes 39c0 - 39ff 0xCE, 0x05, 0x65, 0xCC, 0x82, 0xCC, 0x80, 0xCE, 0x05, 0x65, 0xCC, 0x82, 0xCC, 0x81, 0xCE, 0x05, 0x65, 0xCC, 0x82, 0xCC, 0x83, 0xCE, 0x05, 0x65, 0xCC, 0x82, 0xCC, 0x89, 0xCE, 0x05, 0x65, 0xCC, 0x84, 0xCC, 0x80, 0xCE, 0x05, 0x65, 0xCC, 0x84, 0xCC, 0x81, 0xCE, 0x05, 0x65, 0xCC, 0xA3, 0xCC, 0x82, 0xCE, 0x05, 0x65, 0xCC, 0xA7, 0xCC, 0x86, 0xCE, 0x05, 0x69, 0xCC, 0x88, 0xCC, 0x81, 0xCE, // Bytes 3a00 - 3a3f 0x05, 0x6C, 0xCC, 0xA3, 0xCC, 0x84, 0xCE, 0x05, 0x6F, 0xCC, 0x82, 0xCC, 0x80, 0xCE, 0x05, 0x6F, 0xCC, 0x82, 0xCC, 0x81, 0xCE, 0x05, 0x6F, 0xCC, 0x82, 0xCC, 0x83, 0xCE, 0x05, 0x6F, 0xCC, 0x82, 0xCC, 0x89, 0xCE, 0x05, 0x6F, 0xCC, 0x83, 0xCC, 0x81, 0xCE, 0x05, 0x6F, 0xCC, 0x83, 0xCC, 0x84, 0xCE, 0x05, 0x6F, 0xCC, 0x83, 0xCC, 0x88, 0xCE, 0x05, 0x6F, 0xCC, 0x84, 0xCC, 0x80, 0xCE, 0x05, // Bytes 3a40 - 3a7f 0x6F, 0xCC, 0x84, 0xCC, 0x81, 0xCE, 0x05, 0x6F, 0xCC, 0x87, 0xCC, 0x84, 0xCE, 0x05, 0x6F, 0xCC, 0x88, 0xCC, 0x84, 0xCE, 0x05, 0x6F, 0xCC, 0x9B, 0xCC, 0x80, 0xCE, 0x05, 0x6F, 0xCC, 0x9B, 0xCC, 0x81, 0xCE, 0x05, 0x6F, 0xCC, 0x9B, 0xCC, 0x83, 0xCE, 0x05, 0x6F, 0xCC, 0x9B, 0xCC, 0x89, 0xCE, 0x05, 0x6F, 0xCC, 0x9B, 0xCC, 0xA3, 0xBA, 0x05, 0x6F, 0xCC, 0xA3, 0xCC, 0x82, 0xCE, 0x05, 0x6F, // Bytes 3a80 - 3abf 0xCC, 0xA8, 0xCC, 0x84, 0xCE, 0x05, 0x72, 0xCC, 0xA3, 0xCC, 0x84, 0xCE, 0x05, 0x73, 0xCC, 0x81, 0xCC, 0x87, 0xCE, 0x05, 0x73, 0xCC, 0x8C, 0xCC, 0x87, 0xCE, 0x05, 0x73, 0xCC, 0xA3, 0xCC, 0x87, 0xCE, 0x05, 0x75, 0xCC, 0x83, 0xCC, 0x81, 0xCE, 0x05, 0x75, 0xCC, 0x84, 0xCC, 0x88, 0xCE, 0x05, 0x75, 0xCC, 0x88, 0xCC, 0x80, 0xCE, 0x05, 0x75, 0xCC, 0x88, 0xCC, 0x81, 0xCE, 0x05, 0x75, 0xCC, // Bytes 3ac0 - 3aff 0x88, 0xCC, 0x84, 0xCE, 0x05, 0x75, 0xCC, 0x88, 0xCC, 0x8C, 0xCE, 0x05, 0x75, 0xCC, 0x9B, 0xCC, 0x80, 0xCE, 0x05, 0x75, 0xCC, 0x9B, 0xCC, 0x81, 0xCE, 0x05, 0x75, 0xCC, 0x9B, 0xCC, 0x83, 0xCE, 0x05, 0x75, 0xCC, 0x9B, 0xCC, 0x89, 0xCE, 0x05, 0x75, 0xCC, 0x9B, 0xCC, 0xA3, 0xBA, 0x05, 0xE1, 0xBE, 0xBF, 0xCC, 0x80, 0xCE, 0x05, 0xE1, 0xBE, 0xBF, 0xCC, 0x81, 0xCE, 0x05, 0xE1, 0xBE, 0xBF, // Bytes 3b00 - 3b3f 0xCD, 0x82, 0xCE, 0x05, 0xE1, 0xBF, 0xBE, 0xCC, 0x80, 0xCE, 0x05, 0xE1, 0xBF, 0xBE, 0xCC, 0x81, 0xCE, 0x05, 0xE1, 0xBF, 0xBE, 0xCD, 0x82, 0xCE, 0x05, 0xE2, 0x86, 0x90, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x86, 0x92, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x86, 0x94, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x87, 0x90, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x87, 0x92, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x87, 0x94, 0xCC, // Bytes 3b40 - 3b7f 0xB8, 0x05, 0x05, 0xE2, 0x88, 0x83, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x88, 0x88, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x88, 0x8B, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x88, 0xA3, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x88, 0xA5, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x88, 0xBC, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x89, 0x83, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x89, 0x85, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x89, 0x88, 0xCC, 0xB8, // Bytes 3b80 - 3bbf 0x05, 0x05, 0xE2, 0x89, 0x8D, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x89, 0xA1, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x89, 0xA4, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x89, 0xA5, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x89, 0xB2, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x89, 0xB3, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x89, 0xB6, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x89, 0xB7, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x89, 0xBA, 0xCC, 0xB8, 0x05, // Bytes 3bc0 - 3bff 0x05, 0xE2, 0x89, 0xBB, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x89, 0xBC, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x89, 0xBD, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x8A, 0x82, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x8A, 0x83, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x8A, 0x86, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x8A, 0x87, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x8A, 0x91, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x8A, 0x92, 0xCC, 0xB8, 0x05, 0x05, // Bytes 3c00 - 3c3f 0xE2, 0x8A, 0xA2, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x8A, 0xA8, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x8A, 0xA9, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x8A, 0xAB, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x8A, 0xB2, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x8A, 0xB3, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x8A, 0xB4, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x8A, 0xB5, 0xCC, 0xB8, 0x05, 0x06, 0xCE, 0x91, 0xCC, 0x93, 0xCD, 0x85, 0xDE, 0x06, // Bytes 3c40 - 3c7f 0xCE, 0x91, 0xCC, 0x94, 0xCD, 0x85, 0xDE, 0x06, 0xCE, 0x95, 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x06, 0xCE, 0x95, 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x06, 0xCE, 0x95, 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x06, 0xCE, 0x95, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x06, 0xCE, 0x97, 0xCC, 0x93, 0xCD, 0x85, 0xDE, 0x06, 0xCE, 0x97, 0xCC, 0x94, 0xCD, 0x85, 0xDE, 0x06, 0xCE, 0x99, 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x06, // Bytes 3c80 - 3cbf 0xCE, 0x99, 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x06, 0xCE, 0x99, 0xCC, 0x93, 0xCD, 0x82, 0xCE, 0x06, 0xCE, 0x99, 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x06, 0xCE, 0x99, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x06, 0xCE, 0x99, 0xCC, 0x94, 0xCD, 0x82, 0xCE, 0x06, 0xCE, 0x9F, 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x06, 0xCE, 0x9F, 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x06, 0xCE, 0x9F, 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x06, // Bytes 3cc0 - 3cff 0xCE, 0x9F, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x06, 0xCE, 0xA5, 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x06, 0xCE, 0xA5, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x06, 0xCE, 0xA5, 0xCC, 0x94, 0xCD, 0x82, 0xCE, 0x06, 0xCE, 0xA9, 0xCC, 0x93, 0xCD, 0x85, 0xDE, 0x06, 0xCE, 0xA9, 0xCC, 0x94, 0xCD, 0x85, 0xDE, 0x06, 0xCE, 0xB1, 0xCC, 0x80, 0xCD, 0x85, 0xDE, 0x06, 0xCE, 0xB1, 0xCC, 0x81, 0xCD, 0x85, 0xDE, 0x06, // Bytes 3d00 - 3d3f 0xCE, 0xB1, 0xCC, 0x93, 0xCD, 0x85, 0xDE, 0x06, 0xCE, 0xB1, 0xCC, 0x94, 0xCD, 0x85, 0xDE, 0x06, 0xCE, 0xB1, 0xCD, 0x82, 0xCD, 0x85, 0xDE, 0x06, 0xCE, 0xB5, 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x06, 0xCE, 0xB5, 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x06, 0xCE, 0xB5, 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x06, 0xCE, 0xB5, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x06, 0xCE, 0xB7, 0xCC, 0x80, 0xCD, 0x85, 0xDE, 0x06, // Bytes 3d40 - 3d7f 0xCE, 0xB7, 0xCC, 0x81, 0xCD, 0x85, 0xDE, 0x06, 0xCE, 0xB7, 0xCC, 0x93, 0xCD, 0x85, 0xDE, 0x06, 0xCE, 0xB7, 0xCC, 0x94, 0xCD, 0x85, 0xDE, 0x06, 0xCE, 0xB7, 0xCD, 0x82, 0xCD, 0x85, 0xDE, 0x06, 0xCE, 0xB9, 0xCC, 0x88, 0xCC, 0x80, 0xCE, 0x06, 0xCE, 0xB9, 0xCC, 0x88, 0xCC, 0x81, 0xCE, 0x06, 0xCE, 0xB9, 0xCC, 0x88, 0xCD, 0x82, 0xCE, 0x06, 0xCE, 0xB9, 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x06, // Bytes 3d80 - 3dbf 0xCE, 0xB9, 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x06, 0xCE, 0xB9, 0xCC, 0x93, 0xCD, 0x82, 0xCE, 0x06, 0xCE, 0xB9, 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x06, 0xCE, 0xB9, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x06, 0xCE, 0xB9, 0xCC, 0x94, 0xCD, 0x82, 0xCE, 0x06, 0xCE, 0xBF, 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x06, 0xCE, 0xBF, 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x06, 0xCE, 0xBF, 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x06, // Bytes 3dc0 - 3dff 0xCE, 0xBF, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x06, 0xCF, 0x85, 0xCC, 0x88, 0xCC, 0x80, 0xCE, 0x06, 0xCF, 0x85, 0xCC, 0x88, 0xCC, 0x81, 0xCE, 0x06, 0xCF, 0x85, 0xCC, 0x88, 0xCD, 0x82, 0xCE, 0x06, 0xCF, 0x85, 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x06, 0xCF, 0x85, 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x06, 0xCF, 0x85, 0xCC, 0x93, 0xCD, 0x82, 0xCE, 0x06, 0xCF, 0x85, 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x06, // Bytes 3e00 - 3e3f 0xCF, 0x85, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x06, 0xCF, 0x85, 0xCC, 0x94, 0xCD, 0x82, 0xCE, 0x06, 0xCF, 0x89, 0xCC, 0x80, 0xCD, 0x85, 0xDE, 0x06, 0xCF, 0x89, 0xCC, 0x81, 0xCD, 0x85, 0xDE, 0x06, 0xCF, 0x89, 0xCC, 0x93, 0xCD, 0x85, 0xDE, 0x06, 0xCF, 0x89, 0xCC, 0x94, 0xCD, 0x85, 0xDE, 0x06, 0xCF, 0x89, 0xCD, 0x82, 0xCD, 0x85, 0xDE, 0x06, 0xE0, 0xA4, 0xA8, 0xE0, 0xA4, 0xBC, 0x0D, 0x06, // Bytes 3e40 - 3e7f 0xE0, 0xA4, 0xB0, 0xE0, 0xA4, 0xBC, 0x0D, 0x06, 0xE0, 0xA4, 0xB3, 0xE0, 0xA4, 0xBC, 0x0D, 0x06, 0xE0, 0xA7, 0x87, 0xE0, 0xA6, 0xBE, 0x01, 0x06, 0xE0, 0xA7, 0x87, 0xE0, 0xA7, 0x97, 0x01, 0x06, 0xE0, 0xAD, 0x87, 0xE0, 0xAC, 0xBE, 0x01, 0x06, 0xE0, 0xAD, 0x87, 0xE0, 0xAD, 0x96, 0x01, 0x06, 0xE0, 0xAD, 0x87, 0xE0, 0xAD, 0x97, 0x01, 0x06, 0xE0, 0xAE, 0x92, 0xE0, 0xAF, 0x97, 0x01, 0x06, // Bytes 3e80 - 3ebf 0xE0, 0xAF, 0x86, 0xE0, 0xAE, 0xBE, 0x01, 0x06, 0xE0, 0xAF, 0x86, 0xE0, 0xAF, 0x97, 0x01, 0x06, 0xE0, 0xAF, 0x87, 0xE0, 0xAE, 0xBE, 0x01, 0x06, 0xE0, 0xB1, 0x86, 0xE0, 0xB1, 0x96, 0x89, 0x06, 0xE0, 0xB2, 0xBF, 0xE0, 0xB3, 0x95, 0x01, 0x06, 0xE0, 0xB3, 0x86, 0xE0, 0xB3, 0x95, 0x01, 0x06, 0xE0, 0xB3, 0x86, 0xE0, 0xB3, 0x96, 0x01, 0x06, 0xE0, 0xB5, 0x86, 0xE0, 0xB4, 0xBE, 0x01, 0x06, // Bytes 3ec0 - 3eff 0xE0, 0xB5, 0x86, 0xE0, 0xB5, 0x97, 0x01, 0x06, 0xE0, 0xB5, 0x87, 0xE0, 0xB4, 0xBE, 0x01, 0x06, 0xE0, 0xB7, 0x99, 0xE0, 0xB7, 0x8A, 0x15, 0x06, 0xE0, 0xB7, 0x99, 0xE0, 0xB7, 0x9F, 0x01, 0x06, 0xE1, 0x80, 0xA5, 0xE1, 0x80, 0xAE, 0x01, 0x06, 0xE1, 0xAC, 0x85, 0xE1, 0xAC, 0xB5, 0x01, 0x06, 0xE1, 0xAC, 0x87, 0xE1, 0xAC, 0xB5, 0x01, 0x06, 0xE1, 0xAC, 0x89, 0xE1, 0xAC, 0xB5, 0x01, 0x06, // Bytes 3f00 - 3f3f 0xE1, 0xAC, 0x8B, 0xE1, 0xAC, 0xB5, 0x01, 0x06, 0xE1, 0xAC, 0x8D, 0xE1, 0xAC, 0xB5, 0x01, 0x06, 0xE1, 0xAC, 0x91, 0xE1, 0xAC, 0xB5, 0x01, 0x06, 0xE1, 0xAC, 0xBA, 0xE1, 0xAC, 0xB5, 0x01, 0x06, 0xE1, 0xAC, 0xBC, 0xE1, 0xAC, 0xB5, 0x01, 0x06, 0xE1, 0xAC, 0xBE, 0xE1, 0xAC, 0xB5, 0x01, 0x06, 0xE1, 0xAC, 0xBF, 0xE1, 0xAC, 0xB5, 0x01, 0x06, 0xE1, 0xAD, 0x82, 0xE1, 0xAC, 0xB5, 0x01, 0x06, // Bytes 3f40 - 3f7f 0xE3, 0x81, 0x86, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x81, 0x8B, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x81, 0x8D, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x81, 0x8F, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x81, 0x91, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x81, 0x93, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x81, 0x95, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x81, 0x97, 0xE3, 0x82, 0x99, 0x11, 0x06, // Bytes 3f80 - 3fbf 0xE3, 0x81, 0x99, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x81, 0x9B, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x81, 0x9D, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x81, 0x9F, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x81, 0xA1, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x81, 0xA4, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x81, 0xA6, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x81, 0xA8, 0xE3, 0x82, 0x99, 0x11, 0x06, // Bytes 3fc0 - 3fff 0xE3, 0x81, 0xAF, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x81, 0xAF, 0xE3, 0x82, 0x9A, 0x11, 0x06, 0xE3, 0x81, 0xB2, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x81, 0xB2, 0xE3, 0x82, 0x9A, 0x11, 0x06, 0xE3, 0x81, 0xB5, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x81, 0xB5, 0xE3, 0x82, 0x9A, 0x11, 0x06, 0xE3, 0x81, 0xB8, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x81, 0xB8, 0xE3, 0x82, 0x9A, 0x11, 0x06, // Bytes 4000 - 403f 0xE3, 0x81, 0xBB, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x81, 0xBB, 0xE3, 0x82, 0x9A, 0x11, 0x06, 0xE3, 0x82, 0x9D, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x82, 0xA6, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x82, 0xAB, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x82, 0xAD, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x82, 0xAF, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x82, 0xB1, 0xE3, 0x82, 0x99, 0x11, 0x06, // Bytes 4040 - 407f 0xE3, 0x82, 0xB3, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x82, 0xB5, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x82, 0xB7, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x82, 0xB9, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x82, 0xBB, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x82, 0xBD, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x82, 0xBF, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x83, 0x81, 0xE3, 0x82, 0x99, 0x11, 0x06, // Bytes 4080 - 40bf 0xE3, 0x83, 0x84, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x83, 0x86, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x83, 0x88, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x83, 0x8F, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x83, 0x8F, 0xE3, 0x82, 0x9A, 0x11, 0x06, 0xE3, 0x83, 0x92, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x83, 0x92, 0xE3, 0x82, 0x9A, 0x11, 0x06, 0xE3, 0x83, 0x95, 0xE3, 0x82, 0x99, 0x11, 0x06, // Bytes 40c0 - 40ff 0xE3, 0x83, 0x95, 0xE3, 0x82, 0x9A, 0x11, 0x06, 0xE3, 0x83, 0x98, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x83, 0x98, 0xE3, 0x82, 0x9A, 0x11, 0x06, 0xE3, 0x83, 0x9B, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x83, 0x9B, 0xE3, 0x82, 0x9A, 0x11, 0x06, 0xE3, 0x83, 0xAF, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x83, 0xB0, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x83, 0xB1, 0xE3, 0x82, 0x99, 0x11, 0x06, // Bytes 4100 - 413f 0xE3, 0x83, 0xB2, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xE3, 0x83, 0xBD, 0xE3, 0x82, 0x99, 0x11, 0x06, 0xF0, 0x90, 0x97, 0x92, 0xCC, 0x87, 0xCD, 0x06, 0xF0, 0x90, 0x97, 0x9A, 0xCC, 0x87, 0xCD, 0x08, 0xCE, 0x91, 0xCC, 0x93, 0xCC, 0x80, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0x91, 0xCC, 0x93, 0xCC, 0x81, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0x91, 0xCC, 0x93, 0xCD, 0x82, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0x91, // Bytes 4140 - 417f 0xCC, 0x94, 0xCC, 0x80, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0x91, 0xCC, 0x94, 0xCC, 0x81, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0x91, 0xCC, 0x94, 0xCD, 0x82, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0x97, 0xCC, 0x93, 0xCC, 0x80, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0x97, 0xCC, 0x93, 0xCC, 0x81, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0x97, 0xCC, 0x93, 0xCD, 0x82, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0x97, 0xCC, 0x94, 0xCC, 0x80, // Bytes 4180 - 41bf 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0x97, 0xCC, 0x94, 0xCC, 0x81, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0x97, 0xCC, 0x94, 0xCD, 0x82, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xA9, 0xCC, 0x93, 0xCC, 0x80, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xA9, 0xCC, 0x93, 0xCC, 0x81, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xA9, 0xCC, 0x93, 0xCD, 0x82, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xA9, 0xCC, 0x94, 0xCC, 0x80, 0xCD, 0x85, 0xDF, 0x08, // Bytes 41c0 - 41ff 0xCE, 0xA9, 0xCC, 0x94, 0xCC, 0x81, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xA9, 0xCC, 0x94, 0xCD, 0x82, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xB1, 0xCC, 0x93, 0xCC, 0x80, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xB1, 0xCC, 0x93, 0xCC, 0x81, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xB1, 0xCC, 0x93, 0xCD, 0x82, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xB1, 0xCC, 0x94, 0xCC, 0x80, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xB1, 0xCC, 0x94, // Bytes 4200 - 423f 0xCC, 0x81, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xB1, 0xCC, 0x94, 0xCD, 0x82, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xB7, 0xCC, 0x93, 0xCC, 0x80, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xB7, 0xCC, 0x93, 0xCC, 0x81, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xB7, 0xCC, 0x93, 0xCD, 0x82, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xB7, 0xCC, 0x94, 0xCC, 0x80, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xB7, 0xCC, 0x94, 0xCC, 0x81, 0xCD, 0x85, // Bytes 4240 - 427f 0xDF, 0x08, 0xCE, 0xB7, 0xCC, 0x94, 0xCD, 0x82, 0xCD, 0x85, 0xDF, 0x08, 0xCF, 0x89, 0xCC, 0x93, 0xCC, 0x80, 0xCD, 0x85, 0xDF, 0x08, 0xCF, 0x89, 0xCC, 0x93, 0xCC, 0x81, 0xCD, 0x85, 0xDF, 0x08, 0xCF, 0x89, 0xCC, 0x93, 0xCD, 0x82, 0xCD, 0x85, 0xDF, 0x08, 0xCF, 0x89, 0xCC, 0x94, 0xCC, 0x80, 0xCD, 0x85, 0xDF, 0x08, 0xCF, 0x89, 0xCC, 0x94, 0xCC, 0x81, 0xCD, 0x85, 0xDF, 0x08, 0xCF, 0x89, // Bytes 4280 - 42bf 0xCC, 0x94, 0xCD, 0x82, 0xCD, 0x85, 0xDF, 0x08, 0xF0, 0x91, 0x82, 0x99, 0xF0, 0x91, 0x82, 0xBA, 0x0D, 0x08, 0xF0, 0x91, 0x82, 0x9B, 0xF0, 0x91, 0x82, 0xBA, 0x0D, 0x08, 0xF0, 0x91, 0x82, 0xA5, 0xF0, 0x91, 0x82, 0xBA, 0x0D, 0x08, 0xF0, 0x91, 0x84, 0xB1, 0xF0, 0x91, 0x84, 0xA7, 0x01, 0x08, 0xF0, 0x91, 0x84, 0xB2, 0xF0, 0x91, 0x84, 0xA7, 0x01, 0x08, 0xF0, 0x91, 0x8D, 0x87, 0xF0, 0x91, // Bytes 42c0 - 42ff 0x8C, 0xBE, 0x01, 0x08, 0xF0, 0x91, 0x8D, 0x87, 0xF0, 0x91, 0x8D, 0x97, 0x01, 0x08, 0xF0, 0x91, 0x8E, 0x82, 0xF0, 0x91, 0x8F, 0x89, 0x01, 0x08, 0xF0, 0x91, 0x8E, 0x84, 0xF0, 0x91, 0x8E, 0xBB, 0x01, 0x08, 0xF0, 0x91, 0x8E, 0x8B, 0xF0, 0x91, 0x8F, 0x82, 0x01, 0x08, 0xF0, 0x91, 0x8E, 0x90, 0xF0, 0x91, 0x8F, 0x89, 0x01, 0x08, 0xF0, 0x91, 0x92, 0xB9, 0xF0, 0x91, 0x92, 0xB0, 0x01, 0x08, // Bytes 4300 - 433f 0xF0, 0x91, 0x92, 0xB9, 0xF0, 0x91, 0x92, 0xBA, 0x01, 0x08, 0xF0, 0x91, 0x92, 0xB9, 0xF0, 0x91, 0x92, 0xBD, 0x01, 0x08, 0xF0, 0x91, 0x96, 0xB8, 0xF0, 0x91, 0x96, 0xAF, 0x01, 0x08, 0xF0, 0x91, 0x96, 0xB9, 0xF0, 0x91, 0x96, 0xAF, 0x01, 0x08, 0xF0, 0x91, 0xA4, 0xB5, 0xF0, 0x91, 0xA4, 0xB0, 0x01, 0x09, 0xE0, 0xB3, 0x86, 0xE0, 0xB3, 0x82, 0xE0, 0xB3, 0x95, 0x02, 0x09, 0xE0, 0xB7, 0x99, // Bytes 4340 - 437f 0xE0, 0xB7, 0x8F, 0xE0, 0xB7, 0x8A, 0x16, 0x0C, 0xF0, 0x96, 0xB5, 0xA3, 0xF0, 0x96, 0xB5, 0xA7, 0xF0, 0x96, 0xB5, 0xA7, 0x02, 0x42, 0xC2, 0xB4, 0x01, 0x43, 0x20, 0xCC, 0x81, 0xCD, 0x43, 0x20, 0xCC, 0x83, 0xCD, 0x43, 0x20, 0xCC, 0x84, 0xCD, 0x43, 0x20, 0xCC, 0x85, 0xCD, 0x43, 0x20, 0xCC, 0x86, 0xCD, 0x43, 0x20, 0xCC, 0x87, 0xCD, 0x43, 0x20, 0xCC, 0x88, 0xCD, 0x43, 0x20, 0xCC, 0x8A, // Bytes 4380 - 43bf 0xCD, 0x43, 0x20, 0xCC, 0x8B, 0xCD, 0x43, 0x20, 0xCC, 0x93, 0xCD, 0x43, 0x20, 0xCC, 0x94, 0xCD, 0x43, 0x20, 0xCC, 0xA7, 0xA9, 0x43, 0x20, 0xCC, 0xA8, 0xA9, 0x43, 0x20, 0xCC, 0xB3, 0xB9, 0x43, 0x20, 0xCD, 0x82, 0xCD, 0x43, 0x20, 0xCD, 0x85, 0xDD, 0x43, 0x20, 0xD9, 0x8B, 0x5D, 0x43, 0x20, 0xD9, 0x8C, 0x61, 0x43, 0x20, 0xD9, 0x8D, 0x65, 0x43, 0x20, 0xD9, 0x8E, 0x69, 0x43, 0x20, 0xD9, // Bytes 43c0 - 43ff 0x8F, 0x6D, 0x43, 0x20, 0xD9, 0x90, 0x71, 0x43, 0x20, 0xD9, 0x91, 0x75, 0x43, 0x20, 0xD9, 0x92, 0x79, 0x43, 0x41, 0xCC, 0x8A, 0xCD, 0x43, 0x73, 0xCC, 0x87, 0xCD, 0x44, 0x20, 0xE3, 0x82, 0x99, 0x11, 0x44, 0x20, 0xE3, 0x82, 0x9A, 0x11, 0x44, 0xC2, 0xA8, 0xCC, 0x81, 0xCE, 0x44, 0xCE, 0x91, 0xCC, 0x81, 0xCD, 0x44, 0xCE, 0x95, 0xCC, 0x81, 0xCD, 0x44, 0xCE, 0x97, 0xCC, 0x81, 0xCD, 0x44, // Bytes 4400 - 443f 0xCE, 0x99, 0xCC, 0x81, 0xCD, 0x44, 0xCE, 0x9F, 0xCC, 0x81, 0xCD, 0x44, 0xCE, 0xA5, 0xCC, 0x81, 0xCD, 0x44, 0xCE, 0xA5, 0xCC, 0x88, 0xCD, 0x44, 0xCE, 0xA9, 0xCC, 0x81, 0xCD, 0x44, 0xCE, 0xB1, 0xCC, 0x81, 0xCD, 0x44, 0xCE, 0xB5, 0xCC, 0x81, 0xCD, 0x44, 0xCE, 0xB7, 0xCC, 0x81, 0xCD, 0x44, 0xCE, 0xB9, 0xCC, 0x81, 0xCD, 0x44, 0xCE, 0xBF, 0xCC, 0x81, 0xCD, 0x44, 0xCF, 0x85, 0xCC, 0x81, // Bytes 4440 - 447f 0xCD, 0x44, 0xCF, 0x89, 0xCC, 0x81, 0xCD, 0x44, 0xD7, 0x90, 0xD6, 0xB7, 0x35, 0x44, 0xD7, 0x90, 0xD6, 0xB8, 0x39, 0x44, 0xD7, 0x90, 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0x91, 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0x91, 0xD6, 0xBF, 0x4D, 0x44, 0xD7, 0x92, 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0x93, 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0x94, 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0x95, 0xD6, 0xB9, 0x3D, 0x44, 0xD7, 0x95, // Bytes 4480 - 44bf 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0x96, 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0x98, 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0x99, 0xD6, 0xB4, 0x29, 0x44, 0xD7, 0x99, 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0x9A, 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0x9B, 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0x9B, 0xD6, 0xBF, 0x4D, 0x44, 0xD7, 0x9C, 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0x9E, 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0xA0, 0xD6, 0xBC, 0x45, 0x44, // Bytes 44c0 - 44ff 0xD7, 0xA1, 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0xA3, 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0xA4, 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0xA4, 0xD6, 0xBF, 0x4D, 0x44, 0xD7, 0xA6, 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0xA7, 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0xA8, 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0xA9, 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0xA9, 0xD7, 0x81, 0x51, 0x44, 0xD7, 0xA9, 0xD7, 0x82, 0x55, 0x44, 0xD7, 0xAA, 0xD6, 0xBC, // Bytes 4500 - 453f 0x45, 0x44, 0xD7, 0xB2, 0xD6, 0xB7, 0x35, 0x44, 0xD8, 0xA7, 0xD9, 0x8B, 0x5D, 0x44, 0xD8, 0xA7, 0xD9, 0x93, 0xCD, 0x44, 0xD8, 0xA7, 0xD9, 0x94, 0xCD, 0x44, 0xD8, 0xA7, 0xD9, 0x95, 0xB9, 0x44, 0xD8, 0xB0, 0xD9, 0xB0, 0x7D, 0x44, 0xD8, 0xB1, 0xD9, 0xB0, 0x7D, 0x44, 0xD9, 0x80, 0xD9, 0x8B, 0x5D, 0x44, 0xD9, 0x80, 0xD9, 0x8E, 0x69, 0x44, 0xD9, 0x80, 0xD9, 0x8F, 0x6D, 0x44, 0xD9, 0x80, // Bytes 4540 - 457f 0xD9, 0x90, 0x71, 0x44, 0xD9, 0x80, 0xD9, 0x91, 0x75, 0x44, 0xD9, 0x80, 0xD9, 0x92, 0x79, 0x44, 0xD9, 0x87, 0xD9, 0xB0, 0x7D, 0x44, 0xD9, 0x88, 0xD9, 0x94, 0xCD, 0x44, 0xD9, 0x89, 0xD9, 0xB0, 0x7D, 0x44, 0xD9, 0x8A, 0xD9, 0x94, 0xCD, 0x44, 0xDB, 0x92, 0xD9, 0x94, 0xCD, 0x44, 0xDB, 0x95, 0xD9, 0x94, 0xCD, 0x45, 0x20, 0xCC, 0x88, 0xCC, 0x80, 0xCE, 0x45, 0x20, 0xCC, 0x88, 0xCC, 0x81, // Bytes 4580 - 45bf 0xCE, 0x45, 0x20, 0xCC, 0x88, 0xCD, 0x82, 0xCE, 0x45, 0x20, 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x45, 0x20, 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x45, 0x20, 0xCC, 0x93, 0xCD, 0x82, 0xCE, 0x45, 0x20, 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x45, 0x20, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x45, 0x20, 0xCC, 0x94, 0xCD, 0x82, 0xCE, 0x45, 0x20, 0xD9, 0x8C, 0xD9, 0x91, 0x76, 0x45, 0x20, 0xD9, 0x8D, 0xD9, 0x91, 0x76, // Bytes 45c0 - 45ff 0x45, 0x20, 0xD9, 0x8E, 0xD9, 0x91, 0x76, 0x45, 0x20, 0xD9, 0x8F, 0xD9, 0x91, 0x76, 0x45, 0x20, 0xD9, 0x90, 0xD9, 0x91, 0x76, 0x45, 0x20, 0xD9, 0x91, 0xD9, 0xB0, 0x7E, 0x45, 0xE2, 0xAB, 0x9D, 0xCC, 0xB8, 0x05, 0x46, 0xCE, 0xB9, 0xCC, 0x88, 0xCC, 0x81, 0xCE, 0x46, 0xCF, 0x85, 0xCC, 0x88, 0xCC, 0x81, 0xCE, 0x46, 0xD7, 0xA9, 0xD6, 0xBC, 0xD7, 0x81, 0x52, 0x46, 0xD7, 0xA9, 0xD6, 0xBC, // Bytes 4600 - 463f 0xD7, 0x82, 0x56, 0x46, 0xD9, 0x80, 0xD9, 0x8E, 0xD9, 0x91, 0x76, 0x46, 0xD9, 0x80, 0xD9, 0x8F, 0xD9, 0x91, 0x76, 0x46, 0xD9, 0x80, 0xD9, 0x90, 0xD9, 0x91, 0x76, 0x46, 0xE0, 0xA4, 0x95, 0xE0, 0xA4, 0xBC, 0x0D, 0x46, 0xE0, 0xA4, 0x96, 0xE0, 0xA4, 0xBC, 0x0D, 0x46, 0xE0, 0xA4, 0x97, 0xE0, 0xA4, 0xBC, 0x0D, 0x46, 0xE0, 0xA4, 0x9C, 0xE0, 0xA4, 0xBC, 0x0D, 0x46, 0xE0, 0xA4, 0xA1, 0xE0, // Bytes 4640 - 467f 0xA4, 0xBC, 0x0D, 0x46, 0xE0, 0xA4, 0xA2, 0xE0, 0xA4, 0xBC, 0x0D, 0x46, 0xE0, 0xA4, 0xAB, 0xE0, 0xA4, 0xBC, 0x0D, 0x46, 0xE0, 0xA4, 0xAF, 0xE0, 0xA4, 0xBC, 0x0D, 0x46, 0xE0, 0xA6, 0xA1, 0xE0, 0xA6, 0xBC, 0x0D, 0x46, 0xE0, 0xA6, 0xA2, 0xE0, 0xA6, 0xBC, 0x0D, 0x46, 0xE0, 0xA6, 0xAF, 0xE0, 0xA6, 0xBC, 0x0D, 0x46, 0xE0, 0xA8, 0x96, 0xE0, 0xA8, 0xBC, 0x0D, 0x46, 0xE0, 0xA8, 0x97, 0xE0, // Bytes 4680 - 46bf 0xA8, 0xBC, 0x0D, 0x46, 0xE0, 0xA8, 0x9C, 0xE0, 0xA8, 0xBC, 0x0D, 0x46, 0xE0, 0xA8, 0xAB, 0xE0, 0xA8, 0xBC, 0x0D, 0x46, 0xE0, 0xA8, 0xB2, 0xE0, 0xA8, 0xBC, 0x0D, 0x46, 0xE0, 0xA8, 0xB8, 0xE0, 0xA8, 0xBC, 0x0D, 0x46, 0xE0, 0xAC, 0xA1, 0xE0, 0xAC, 0xBC, 0x0D, 0x46, 0xE0, 0xAC, 0xA2, 0xE0, 0xAC, 0xBC, 0x0D, 0x46, 0xE0, 0xBE, 0xB2, 0xE0, 0xBE, 0x80, 0xA1, 0x46, 0xE0, 0xBE, 0xB3, 0xE0, // Bytes 46c0 - 46ff 0xBE, 0x80, 0xA1, 0x46, 0xE1, 0x84, 0x80, 0xE1, 0x85, 0xA1, 0x01, 0x46, 0xE1, 0x84, 0x82, 0xE1, 0x85, 0xA1, 0x01, 0x46, 0xE1, 0x84, 0x83, 0xE1, 0x85, 0xA1, 0x01, 0x46, 0xE1, 0x84, 0x85, 0xE1, 0x85, 0xA1, 0x01, 0x46, 0xE1, 0x84, 0x86, 0xE1, 0x85, 0xA1, 0x01, 0x46, 0xE1, 0x84, 0x87, 0xE1, 0x85, 0xA1, 0x01, 0x46, 0xE1, 0x84, 0x89, 0xE1, 0x85, 0xA1, 0x01, 0x46, 0xE1, 0x84, 0x8B, 0xE1, // Bytes 4700 - 473f 0x85, 0xA1, 0x01, 0x46, 0xE1, 0x84, 0x8B, 0xE1, 0x85, 0xAE, 0x01, 0x46, 0xE1, 0x84, 0x8C, 0xE1, 0x85, 0xA1, 0x01, 0x46, 0xE1, 0x84, 0x8E, 0xE1, 0x85, 0xA1, 0x01, 0x46, 0xE1, 0x84, 0x8F, 0xE1, 0x85, 0xA1, 0x01, 0x46, 0xE1, 0x84, 0x90, 0xE1, 0x85, 0xA1, 0x01, 0x46, 0xE1, 0x84, 0x91, 0xE1, 0x85, 0xA1, 0x01, 0x46, 0xE1, 0x84, 0x92, 0xE1, 0x85, 0xA1, 0x01, 0x46, 0xE3, 0x83, 0x86, 0xE3, // Bytes 4740 - 477f 0x82, 0x99, 0x11, 0x48, 0xF0, 0x9D, 0x85, 0x97, 0xF0, 0x9D, 0x85, 0xA5, 0xB1, 0x48, 0xF0, 0x9D, 0x85, 0x98, 0xF0, 0x9D, 0x85, 0xA5, 0xB1, 0x48, 0xF0, 0x9D, 0x86, 0xB9, 0xF0, 0x9D, 0x85, 0xA5, 0xB1, 0x48, 0xF0, 0x9D, 0x86, 0xBA, 0xF0, 0x9D, 0x85, 0xA5, 0xB1, 0x49, 0xE0, 0xBE, 0xB2, 0xE0, 0xBD, 0xB1, 0xE0, 0xBE, 0x80, 0xA2, 0x49, 0xE0, 0xBE, 0xB3, 0xE0, 0xBD, 0xB1, 0xE0, 0xBE, 0x80, // Bytes 4780 - 47bf 0xA2, 0x4C, 0xF0, 0x9D, 0x85, 0x98, 0xF0, 0x9D, 0x85, 0xA5, 0xF0, 0x9D, 0x85, 0xAE, 0xB2, 0x4C, 0xF0, 0x9D, 0x85, 0x98, 0xF0, 0x9D, 0x85, 0xA5, 0xF0, 0x9D, 0x85, 0xAF, 0xB2, 0x4C, 0xF0, 0x9D, 0x85, 0x98, 0xF0, 0x9D, 0x85, 0xA5, 0xF0, 0x9D, 0x85, 0xB0, 0xB2, 0x4C, 0xF0, 0x9D, 0x85, 0x98, 0xF0, 0x9D, 0x85, 0xA5, 0xF0, 0x9D, 0x85, 0xB1, 0xB2, 0x4C, 0xF0, 0x9D, 0x85, 0x98, 0xF0, 0x9D, // Bytes 47c0 - 47ff 0x85, 0xA5, 0xF0, 0x9D, 0x85, 0xB2, 0xB2, 0x4C, 0xF0, 0x9D, 0x86, 0xB9, 0xF0, 0x9D, 0x85, 0xA5, 0xF0, 0x9D, 0x85, 0xAE, 0xB2, 0x4C, 0xF0, 0x9D, 0x86, 0xB9, 0xF0, 0x9D, 0x85, 0xA5, 0xF0, 0x9D, 0x85, 0xAF, 0xB2, 0x4C, 0xF0, 0x9D, 0x86, 0xBA, 0xF0, 0x9D, 0x85, 0xA5, 0xF0, 0x9D, 0x85, 0xAE, 0xB2, 0x4C, 0xF0, 0x9D, 0x86, 0xBA, 0xF0, 0x9D, 0x85, 0xA5, 0xF0, 0x9D, 0x85, 0xAF, 0xB2, 0x83, // Bytes 4800 - 483f 0x41, 0xCC, 0x82, 0xCD, 0x83, 0x41, 0xCC, 0x86, 0xCD, 0x83, 0x41, 0xCC, 0x87, 0xCD, 0x83, 0x41, 0xCC, 0x88, 0xCD, 0x83, 0x41, 0xCC, 0x8A, 0xCD, 0x83, 0x41, 0xCC, 0xA3, 0xB9, 0x83, 0x43, 0xCC, 0xA7, 0xA9, 0x83, 0x45, 0xCC, 0x82, 0xCD, 0x83, 0x45, 0xCC, 0x84, 0xCD, 0x83, 0x45, 0xCC, 0xA3, 0xB9, 0x83, 0x45, 0xCC, 0xA7, 0xA9, 0x83, 0x49, 0xCC, 0x88, 0xCD, 0x83, 0x4C, 0xCC, 0xA3, 0xB9, // Bytes 4840 - 487f 0x83, 0x4F, 0xCC, 0x82, 0xCD, 0x83, 0x4F, 0xCC, 0x83, 0xCD, 0x83, 0x4F, 0xCC, 0x84, 0xCD, 0x83, 0x4F, 0xCC, 0x87, 0xCD, 0x83, 0x4F, 0xCC, 0x88, 0xCD, 0x83, 0x4F, 0xCC, 0x9B, 0xB1, 0x83, 0x4F, 0xCC, 0xA3, 0xB9, 0x83, 0x4F, 0xCC, 0xA8, 0xA9, 0x83, 0x52, 0xCC, 0xA3, 0xB9, 0x83, 0x53, 0xCC, 0x81, 0xCD, 0x83, 0x53, 0xCC, 0x8C, 0xCD, 0x83, 0x53, 0xCC, 0xA3, 0xB9, 0x83, 0x55, 0xCC, 0x83, // Bytes 4880 - 48bf 0xCD, 0x83, 0x55, 0xCC, 0x84, 0xCD, 0x83, 0x55, 0xCC, 0x88, 0xCD, 0x83, 0x55, 0xCC, 0x9B, 0xB1, 0x83, 0x61, 0xCC, 0x82, 0xCD, 0x83, 0x61, 0xCC, 0x86, 0xCD, 0x83, 0x61, 0xCC, 0x87, 0xCD, 0x83, 0x61, 0xCC, 0x88, 0xCD, 0x83, 0x61, 0xCC, 0x8A, 0xCD, 0x83, 0x61, 0xCC, 0xA3, 0xB9, 0x83, 0x63, 0xCC, 0xA7, 0xA9, 0x83, 0x65, 0xCC, 0x82, 0xCD, 0x83, 0x65, 0xCC, 0x84, 0xCD, 0x83, 0x65, 0xCC, // Bytes 48c0 - 48ff 0xA3, 0xB9, 0x83, 0x65, 0xCC, 0xA7, 0xA9, 0x83, 0x69, 0xCC, 0x88, 0xCD, 0x83, 0x6C, 0xCC, 0xA3, 0xB9, 0x83, 0x6F, 0xCC, 0x82, 0xCD, 0x83, 0x6F, 0xCC, 0x83, 0xCD, 0x83, 0x6F, 0xCC, 0x84, 0xCD, 0x83, 0x6F, 0xCC, 0x87, 0xCD, 0x83, 0x6F, 0xCC, 0x88, 0xCD, 0x83, 0x6F, 0xCC, 0x9B, 0xB1, 0x83, 0x6F, 0xCC, 0xA3, 0xB9, 0x83, 0x6F, 0xCC, 0xA8, 0xA9, 0x83, 0x72, 0xCC, 0xA3, 0xB9, 0x83, 0x73, // Bytes 4900 - 493f 0xCC, 0x81, 0xCD, 0x83, 0x73, 0xCC, 0x8C, 0xCD, 0x83, 0x73, 0xCC, 0xA3, 0xB9, 0x83, 0x75, 0xCC, 0x83, 0xCD, 0x83, 0x75, 0xCC, 0x84, 0xCD, 0x83, 0x75, 0xCC, 0x88, 0xCD, 0x83, 0x75, 0xCC, 0x9B, 0xB1, 0x84, 0xCE, 0x91, 0xCC, 0x93, 0xCD, 0x84, 0xCE, 0x91, 0xCC, 0x94, 0xCD, 0x84, 0xCE, 0x95, 0xCC, 0x93, 0xCD, 0x84, 0xCE, 0x95, 0xCC, 0x94, 0xCD, 0x84, 0xCE, 0x97, 0xCC, 0x93, 0xCD, 0x84, // Bytes 4940 - 497f 0xCE, 0x97, 0xCC, 0x94, 0xCD, 0x84, 0xCE, 0x99, 0xCC, 0x93, 0xCD, 0x84, 0xCE, 0x99, 0xCC, 0x94, 0xCD, 0x84, 0xCE, 0x9F, 0xCC, 0x93, 0xCD, 0x84, 0xCE, 0x9F, 0xCC, 0x94, 0xCD, 0x84, 0xCE, 0xA5, 0xCC, 0x94, 0xCD, 0x84, 0xCE, 0xA9, 0xCC, 0x93, 0xCD, 0x84, 0xCE, 0xA9, 0xCC, 0x94, 0xCD, 0x84, 0xCE, 0xB1, 0xCC, 0x80, 0xCD, 0x84, 0xCE, 0xB1, 0xCC, 0x81, 0xCD, 0x84, 0xCE, 0xB1, 0xCC, 0x93, // Bytes 4980 - 49bf 0xCD, 0x84, 0xCE, 0xB1, 0xCC, 0x94, 0xCD, 0x84, 0xCE, 0xB1, 0xCD, 0x82, 0xCD, 0x84, 0xCE, 0xB5, 0xCC, 0x93, 0xCD, 0x84, 0xCE, 0xB5, 0xCC, 0x94, 0xCD, 0x84, 0xCE, 0xB7, 0xCC, 0x80, 0xCD, 0x84, 0xCE, 0xB7, 0xCC, 0x81, 0xCD, 0x84, 0xCE, 0xB7, 0xCC, 0x93, 0xCD, 0x84, 0xCE, 0xB7, 0xCC, 0x94, 0xCD, 0x84, 0xCE, 0xB7, 0xCD, 0x82, 0xCD, 0x84, 0xCE, 0xB9, 0xCC, 0x88, 0xCD, 0x84, 0xCE, 0xB9, // Bytes 49c0 - 49ff 0xCC, 0x93, 0xCD, 0x84, 0xCE, 0xB9, 0xCC, 0x94, 0xCD, 0x84, 0xCE, 0xBF, 0xCC, 0x93, 0xCD, 0x84, 0xCE, 0xBF, 0xCC, 0x94, 0xCD, 0x84, 0xCF, 0x85, 0xCC, 0x88, 0xCD, 0x84, 0xCF, 0x85, 0xCC, 0x93, 0xCD, 0x84, 0xCF, 0x85, 0xCC, 0x94, 0xCD, 0x84, 0xCF, 0x89, 0xCC, 0x80, 0xCD, 0x84, 0xCF, 0x89, 0xCC, 0x81, 0xCD, 0x84, 0xCF, 0x89, 0xCC, 0x93, 0xCD, 0x84, 0xCF, 0x89, 0xCC, 0x94, 0xCD, 0x84, // Bytes 4a00 - 4a3f 0xCF, 0x89, 0xCD, 0x82, 0xCD, 0x86, 0xCE, 0x91, 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x86, 0xCE, 0x91, 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x86, 0xCE, 0x91, 0xCC, 0x93, 0xCD, 0x82, 0xCE, 0x86, 0xCE, 0x91, 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x86, 0xCE, 0x91, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x86, 0xCE, 0x91, 0xCC, 0x94, 0xCD, 0x82, 0xCE, 0x86, 0xCE, 0x97, 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x86, 0xCE, 0x97, // Bytes 4a40 - 4a7f 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x86, 0xCE, 0x97, 0xCC, 0x93, 0xCD, 0x82, 0xCE, 0x86, 0xCE, 0x97, 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x86, 0xCE, 0x97, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x86, 0xCE, 0x97, 0xCC, 0x94, 0xCD, 0x82, 0xCE, 0x86, 0xCE, 0xA9, 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x86, 0xCE, 0xA9, 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x86, 0xCE, 0xA9, 0xCC, 0x93, 0xCD, 0x82, 0xCE, 0x86, 0xCE, 0xA9, // Bytes 4a80 - 4abf 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x86, 0xCE, 0xA9, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x86, 0xCE, 0xA9, 0xCC, 0x94, 0xCD, 0x82, 0xCE, 0x86, 0xCE, 0xB1, 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x86, 0xCE, 0xB1, 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x86, 0xCE, 0xB1, 0xCC, 0x93, 0xCD, 0x82, 0xCE, 0x86, 0xCE, 0xB1, 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x86, 0xCE, 0xB1, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x86, 0xCE, 0xB1, // Bytes 4ac0 - 4aff 0xCC, 0x94, 0xCD, 0x82, 0xCE, 0x86, 0xCE, 0xB7, 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x86, 0xCE, 0xB7, 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x86, 0xCE, 0xB7, 0xCC, 0x93, 0xCD, 0x82, 0xCE, 0x86, 0xCE, 0xB7, 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x86, 0xCE, 0xB7, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x86, 0xCE, 0xB7, 0xCC, 0x94, 0xCD, 0x82, 0xCE, 0x86, 0xCF, 0x89, 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x86, 0xCF, 0x89, // Bytes 4b00 - 4b3f 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x86, 0xCF, 0x89, 0xCC, 0x93, 0xCD, 0x82, 0xCE, 0x86, 0xCF, 0x89, 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x86, 0xCF, 0x89, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x86, 0xCF, 0x89, 0xCC, 0x94, 0xCD, 0x82, 0xCE, 0x86, 0xE0, 0xB3, 0x86, 0xE0, 0xB3, 0x82, 0x01, 0x86, 0xE0, 0xB7, 0x99, 0xE0, 0xB7, 0x8F, 0x01, 0x88, 0xF0, 0x96, 0xB5, 0xA3, 0xF0, 0x96, 0xB5, 0xA7, 0x01, 0x42, // Bytes 4b40 - 4b7f 0xCC, 0x80, 0xCD, 0x33, 0x42, 0xCC, 0x81, 0xCD, 0x33, 0x42, 0xCC, 0x93, 0xCD, 0x33, 0x43, 0xE1, 0x85, 0xA1, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xA2, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xA3, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xA4, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xA5, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xA6, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xA7, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xA8, 0x01, 0x00, 0x43, 0xE1, // Bytes 4b80 - 4bbf 0x85, 0xA9, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xAA, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xAB, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xAC, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xAD, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xAE, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xAF, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xB0, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xB1, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xB2, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xB3, 0x01, 0x00, // Bytes 4bc0 - 4bff 0x43, 0xE1, 0x85, 0xB4, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xB5, 0x01, 0x00, 0x43, 0xE1, 0x86, 0xAA, 0x01, 0x00, 0x43, 0xE1, 0x86, 0xAC, 0x01, 0x00, 0x43, 0xE1, 0x86, 0xAD, 0x01, 0x00, 0x43, 0xE1, 0x86, 0xB0, 0x01, 0x00, 0x43, 0xE1, 0x86, 0xB1, 0x01, 0x00, 0x43, 0xE1, 0x86, 0xB2, 0x01, 0x00, 0x43, 0xE1, 0x86, 0xB3, 0x01, 0x00, 0x43, 0xE1, 0x86, 0xB4, 0x01, 0x00, 0x43, 0xE1, 0x86, 0xB5, // Bytes 4c00 - 4c3f 0x01, 0x00, 0x44, 0xCC, 0x88, 0xCC, 0x81, 0xCE, 0x33, 0x68, 0xF0, 0x91, 0x8F, 0x82, 0xF0, 0x91, 0x8E, 0xB8, 0x02, 0x00, 0x68, 0xF0, 0x91, 0x8F, 0x82, 0xF0, 0x91, 0x8F, 0x82, 0x02, 0x00, 0x68, 0xF0, 0x91, 0x8F, 0x82, 0xF0, 0x91, 0x8F, 0x89, 0x02, 0x00, 0x68, 0xF0, 0x96, 0x84, 0x9E, 0xF0, 0x96, 0x84, 0x9F, 0x02, 0x00, 0x68, 0xF0, 0x96, 0x84, 0x9E, 0xF0, 0x96, 0x84, 0xA0, 0x02, 0x00, // Bytes 4c40 - 4c7f 0x68, 0xF0, 0x96, 0x84, 0xA9, 0xF0, 0x96, 0x84, 0x9F, 0x02, 0x00, 0x68, 0xF0, 0x96, 0xB5, 0xA7, 0xF0, 0x96, 0xB5, 0xA7, 0x02, 0x00, 0x6C, 0xF0, 0x96, 0x84, 0x9E, 0xF0, 0x96, 0x84, 0x9E, 0xF0, 0x96, 0x84, 0x9F, 0x03, 0x00, 0x6C, 0xF0, 0x96, 0x84, 0x9E, 0xF0, 0x96, 0x84, 0x9E, 0xF0, 0x96, 0x84, 0xA0, 0x03, 0x00, 0x6C, 0xF0, 0x96, 0x84, 0x9E, 0xF0, 0x96, 0x84, 0xA9, 0xF0, 0x96, 0x84, // Bytes 4c80 - 4cbf 0x9F, 0x03, 0x00, 0xE8, 0xF0, 0x96, 0x84, 0x9E, 0xF0, 0x96, 0x84, 0x9E, 0x02, 0x00, 0xE8, 0xF0, 0x96, 0x84, 0x9E, 0xF0, 0x96, 0x84, 0xA9, 0x02, 0x00, 0x43, 0xE3, 0x82, 0x99, 0x11, 0x04, 0x43, 0xE3, 0x82, 0x9A, 0x11, 0x04, 0x46, 0xE0, 0xBD, 0xB1, 0xE0, 0xBD, 0xB2, 0xA2, 0x27, 0x46, 0xE0, 0xBD, 0xB1, 0xE0, 0xBD, 0xB4, 0xA6, 0x27, 0x46, 0xE0, 0xBD, 0xB1, 0xE0, 0xBE, 0x80, 0xA2, 0x27, // Bytes 4cc0 - 4cff 0x00, 0x01, } // lookup returns the trie value for the first UTF-8 encoding in s and // the width in bytes of this encoding. The size will be 0 if s does not // hold enough bytes to complete the encoding. len(s) must be greater than 0. func (t *nfcTrie) lookup(s []byte) (v uint16, sz int) { c0 := s[0] switch { case c0 < 0x80: // is ASCII return nfcValues[c0], 1 case c0 < 0xC2: return 0, 1 // Illegal UTF-8: not a starter, not ASCII. case c0 < 0xE0: // 2-byte UTF-8 if len(s) < 2 { return 0, 0 } i := nfcIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c1), 2 case c0 < 0xF0: // 3-byte UTF-8 if len(s) < 3 { return 0, 0 } i := nfcIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = nfcIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c2), 3 case c0 < 0xF8: // 4-byte UTF-8 if len(s) < 4 { return 0, 0 } i := nfcIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = nfcIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } o = uint32(i)<<6 + uint32(c2) i = nfcIndex[o] c3 := s[3] if c3 < 0x80 || 0xC0 <= c3 { return 0, 3 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c3), 4 } // Illegal rune return 0, 1 } // lookupUnsafe returns the trie value for the first UTF-8 encoding in s. // s must start with a full and valid UTF-8 encoded rune. func (t *nfcTrie) lookupUnsafe(s []byte) uint16 { c0 := s[0] if c0 < 0x80 { // is ASCII return nfcValues[c0] } i := nfcIndex[c0] if c0 < 0xE0 { // 2-byte UTF-8 return t.lookupValue(uint32(i), s[1]) } i = nfcIndex[uint32(i)<<6+uint32(s[1])] if c0 < 0xF0 { // 3-byte UTF-8 return t.lookupValue(uint32(i), s[2]) } i = nfcIndex[uint32(i)<<6+uint32(s[2])] if c0 < 0xF8 { // 4-byte UTF-8 return t.lookupValue(uint32(i), s[3]) } return 0 } // lookupString returns the trie value for the first UTF-8 encoding in s and // the width in bytes of this encoding. The size will be 0 if s does not // hold enough bytes to complete the encoding. len(s) must be greater than 0. func (t *nfcTrie) lookupString(s string) (v uint16, sz int) { c0 := s[0] switch { case c0 < 0x80: // is ASCII return nfcValues[c0], 1 case c0 < 0xC2: return 0, 1 // Illegal UTF-8: not a starter, not ASCII. case c0 < 0xE0: // 2-byte UTF-8 if len(s) < 2 { return 0, 0 } i := nfcIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c1), 2 case c0 < 0xF0: // 3-byte UTF-8 if len(s) < 3 { return 0, 0 } i := nfcIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = nfcIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c2), 3 case c0 < 0xF8: // 4-byte UTF-8 if len(s) < 4 { return 0, 0 } i := nfcIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = nfcIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } o = uint32(i)<<6 + uint32(c2) i = nfcIndex[o] c3 := s[3] if c3 < 0x80 || 0xC0 <= c3 { return 0, 3 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c3), 4 } // Illegal rune return 0, 1 } // lookupStringUnsafe returns the trie value for the first UTF-8 encoding in s. // s must start with a full and valid UTF-8 encoded rune. func (t *nfcTrie) lookupStringUnsafe(s string) uint16 { c0 := s[0] if c0 < 0x80 { // is ASCII return nfcValues[c0] } i := nfcIndex[c0] if c0 < 0xE0 { // 2-byte UTF-8 return t.lookupValue(uint32(i), s[1]) } i = nfcIndex[uint32(i)<<6+uint32(s[1])] if c0 < 0xF0 { // 3-byte UTF-8 return t.lookupValue(uint32(i), s[2]) } i = nfcIndex[uint32(i)<<6+uint32(s[2])] if c0 < 0xF8 { // 4-byte UTF-8 return t.lookupValue(uint32(i), s[3]) } return 0 } // nfcTrie. Total size: 11042 bytes (10.78 KiB). Checksum: cd75f956cd2316a9. type nfcTrie struct{} func newNfcTrie(i int) *nfcTrie { return &nfcTrie{} } // lookupValue determines the type of block n and looks up the value for b. func (t *nfcTrie) lookupValue(n uint32, b byte) uint16 { switch { case n < 46: return uint16(nfcValues[n<<6+uint32(b)]) default: n -= 46 return uint16(nfcSparse.lookup(n, b)) } } // nfcValues: 48 blocks, 3072 entries, 6144 bytes // The third block is the zero block. var nfcValues = [3072]uint16{ // Block 0x0, offset 0x0 0x3c: 0xa000, 0x3d: 0xa000, 0x3e: 0xa000, // Block 0x1, offset 0x40 0x41: 0xa000, 0x42: 0xa000, 0x43: 0xa000, 0x44: 0xa000, 0x45: 0xa000, 0x46: 0xa000, 0x47: 0xa000, 0x48: 0xa000, 0x49: 0xa000, 0x4a: 0xa000, 0x4b: 0xa000, 0x4c: 0xa000, 0x4d: 0xa000, 0x4e: 0xa000, 0x4f: 0xa000, 0x50: 0xa000, 0x52: 0xa000, 0x53: 0xa000, 0x54: 0xa000, 0x55: 0xa000, 0x56: 0xa000, 0x57: 0xa000, 0x58: 0xa000, 0x59: 0xa000, 0x5a: 0xa000, 0x61: 0xa000, 0x62: 0xa000, 0x63: 0xa000, 0x64: 0xa000, 0x65: 0xa000, 0x66: 0xa000, 0x67: 0xa000, 0x68: 0xa000, 0x69: 0xa000, 0x6a: 0xa000, 0x6b: 0xa000, 0x6c: 0xa000, 0x6d: 0xa000, 0x6e: 0xa000, 0x6f: 0xa000, 0x70: 0xa000, 0x72: 0xa000, 0x73: 0xa000, 0x74: 0xa000, 0x75: 0xa000, 0x76: 0xa000, 0x77: 0xa000, 0x78: 0xa000, 0x79: 0xa000, 0x7a: 0xa000, // Block 0x2, offset 0x80 // Block 0x3, offset 0xc0 0xc0: 0x2ece, 0xc1: 0x2ed3, 0xc2: 0x47ff, 0xc3: 0x2ed8, 0xc4: 0x480e, 0xc5: 0x4813, 0xc6: 0xa000, 0xc7: 0x481d, 0xc8: 0x2f41, 0xc9: 0x2f46, 0xca: 0x4822, 0xcb: 0x2f5a, 0xcc: 0x2fcd, 0xcd: 0x2fd2, 0xce: 0x2fd7, 0xcf: 0x4836, 0xd1: 0x3063, 0xd2: 0x3086, 0xd3: 0x308b, 0xd4: 0x4840, 0xd5: 0x4845, 0xd6: 0x4854, 0xd8: 0xa000, 0xd9: 0x3112, 0xda: 0x3117, 0xdb: 0x311c, 0xdc: 0x4886, 0xdd: 0x3194, 0xe0: 0x31da, 0xe1: 0x31df, 0xe2: 0x4890, 0xe3: 0x31e4, 0xe4: 0x489f, 0xe5: 0x48a4, 0xe6: 0xa000, 0xe7: 0x48ae, 0xe8: 0x324d, 0xe9: 0x3252, 0xea: 0x48b3, 0xeb: 0x3266, 0xec: 0x32de, 0xed: 0x32e3, 0xee: 0x32e8, 0xef: 0x48c7, 0xf1: 0x3374, 0xf2: 0x3397, 0xf3: 0x339c, 0xf4: 0x48d1, 0xf5: 0x48d6, 0xf6: 0x48e5, 0xf8: 0xa000, 0xf9: 0x3428, 0xfa: 0x342d, 0xfb: 0x3432, 0xfc: 0x4917, 0xfd: 0x34af, 0xff: 0x34c8, // Block 0x4, offset 0x100 0x100: 0x2edd, 0x101: 0x31e9, 0x102: 0x4804, 0x103: 0x4895, 0x104: 0x2efb, 0x105: 0x3207, 0x106: 0x2f0f, 0x107: 0x321b, 0x108: 0x2f14, 0x109: 0x3220, 0x10a: 0x2f19, 0x10b: 0x3225, 0x10c: 0x2f1e, 0x10d: 0x322a, 0x10e: 0x2f28, 0x10f: 0x3234, 0x112: 0x4827, 0x113: 0x48b8, 0x114: 0x2f50, 0x115: 0x325c, 0x116: 0x2f55, 0x117: 0x3261, 0x118: 0x2f73, 0x119: 0x327f, 0x11a: 0x2f64, 0x11b: 0x3270, 0x11c: 0x2f8c, 0x11d: 0x3298, 0x11e: 0x2f96, 0x11f: 0x32a2, 0x120: 0x2f9b, 0x121: 0x32a7, 0x122: 0x2fa5, 0x123: 0x32b1, 0x124: 0x2faa, 0x125: 0x32b6, 0x128: 0x2fdc, 0x129: 0x32ed, 0x12a: 0x2fe1, 0x12b: 0x32f2, 0x12c: 0x2fe6, 0x12d: 0x32f7, 0x12e: 0x3009, 0x12f: 0x3315, 0x130: 0x2feb, 0x134: 0x3013, 0x135: 0x331f, 0x136: 0x3027, 0x137: 0x3338, 0x139: 0x3031, 0x13a: 0x3342, 0x13b: 0x303b, 0x13c: 0x334c, 0x13d: 0x3036, 0x13e: 0x3347, // Block 0x5, offset 0x140 0x143: 0x305e, 0x144: 0x336f, 0x145: 0x3077, 0x146: 0x3388, 0x147: 0x306d, 0x148: 0x337e, 0x14c: 0x484a, 0x14d: 0x48db, 0x14e: 0x3090, 0x14f: 0x33a1, 0x150: 0x309a, 0x151: 0x33ab, 0x154: 0x30b8, 0x155: 0x33c9, 0x156: 0x30d1, 0x157: 0x33e2, 0x158: 0x30c2, 0x159: 0x33d3, 0x15a: 0x486d, 0x15b: 0x48fe, 0x15c: 0x30db, 0x15d: 0x33ec, 0x15e: 0x30ea, 0x15f: 0x33fb, 0x160: 0x4872, 0x161: 0x4903, 0x162: 0x3103, 0x163: 0x3419, 0x164: 0x30f4, 0x165: 0x340a, 0x168: 0x487c, 0x169: 0x490d, 0x16a: 0x4881, 0x16b: 0x4912, 0x16c: 0x3121, 0x16d: 0x3437, 0x16e: 0x312b, 0x16f: 0x3441, 0x170: 0x3130, 0x171: 0x3446, 0x172: 0x314e, 0x173: 0x3464, 0x174: 0x3171, 0x175: 0x3487, 0x176: 0x3199, 0x177: 0x34b4, 0x178: 0x31ad, 0x179: 0x31bc, 0x17a: 0x34dc, 0x17b: 0x31c6, 0x17c: 0x34e6, 0x17d: 0x31cb, 0x17e: 0x34eb, 0x17f: 0xa000, // Block 0x6, offset 0x180 0x184: 0x8100, 0x185: 0x8100, 0x186: 0x8100, 0x18d: 0x2ee7, 0x18e: 0x31f3, 0x18f: 0x2ff5, 0x190: 0x3301, 0x191: 0x309f, 0x192: 0x33b0, 0x193: 0x3135, 0x194: 0x344b, 0x195: 0x392e, 0x196: 0x3abd, 0x197: 0x3927, 0x198: 0x3ab6, 0x199: 0x3935, 0x19a: 0x3ac4, 0x19b: 0x3920, 0x19c: 0x3aaf, 0x19e: 0x380f, 0x19f: 0x399e, 0x1a0: 0x3808, 0x1a1: 0x3997, 0x1a2: 0x3512, 0x1a3: 0x3524, 0x1a6: 0x2fa0, 0x1a7: 0x32ac, 0x1a8: 0x301d, 0x1a9: 0x332e, 0x1aa: 0x4863, 0x1ab: 0x48f4, 0x1ac: 0x38ef, 0x1ad: 0x3a7e, 0x1ae: 0x3536, 0x1af: 0x353c, 0x1b0: 0x3324, 0x1b4: 0x2f87, 0x1b5: 0x3293, 0x1b8: 0x3059, 0x1b9: 0x336a, 0x1ba: 0x3816, 0x1bb: 0x39a5, 0x1bc: 0x350c, 0x1bd: 0x351e, 0x1be: 0x3518, 0x1bf: 0x352a, // Block 0x7, offset 0x1c0 0x1c0: 0x2eec, 0x1c1: 0x31f8, 0x1c2: 0x2ef1, 0x1c3: 0x31fd, 0x1c4: 0x2f69, 0x1c5: 0x3275, 0x1c6: 0x2f6e, 0x1c7: 0x327a, 0x1c8: 0x2ffa, 0x1c9: 0x3306, 0x1ca: 0x2fff, 0x1cb: 0x330b, 0x1cc: 0x30a4, 0x1cd: 0x33b5, 0x1ce: 0x30a9, 0x1cf: 0x33ba, 0x1d0: 0x30c7, 0x1d1: 0x33d8, 0x1d2: 0x30cc, 0x1d3: 0x33dd, 0x1d4: 0x313a, 0x1d5: 0x3450, 0x1d6: 0x313f, 0x1d7: 0x3455, 0x1d8: 0x30e5, 0x1d9: 0x33f6, 0x1da: 0x30fe, 0x1db: 0x3414, 0x1de: 0x2fb9, 0x1df: 0x32c5, 0x1e6: 0x4809, 0x1e7: 0x489a, 0x1e8: 0x4831, 0x1e9: 0x48c2, 0x1ea: 0x38be, 0x1eb: 0x3a4d, 0x1ec: 0x389b, 0x1ed: 0x3a2a, 0x1ee: 0x484f, 0x1ef: 0x48e0, 0x1f0: 0x38b7, 0x1f1: 0x3a46, 0x1f2: 0x31a3, 0x1f3: 0x34be, // Block 0x8, offset 0x200 0x200: 0x9933, 0x201: 0x9933, 0x202: 0x9933, 0x203: 0x9933, 0x204: 0x9933, 0x205: 0x8133, 0x206: 0x9933, 0x207: 0x9933, 0x208: 0x9933, 0x209: 0x9933, 0x20a: 0x9933, 0x20b: 0x9933, 0x20c: 0x9933, 0x20d: 0x8133, 0x20e: 0x8133, 0x20f: 0x9933, 0x210: 0x8133, 0x211: 0x9933, 0x212: 0x8133, 0x213: 0x9933, 0x214: 0x9933, 0x215: 0x8134, 0x216: 0x812e, 0x217: 0x812e, 0x218: 0x812e, 0x219: 0x812e, 0x21a: 0x8134, 0x21b: 0x992c, 0x21c: 0x812e, 0x21d: 0x812e, 0x21e: 0x812e, 0x21f: 0x812e, 0x220: 0x812e, 0x221: 0x812a, 0x222: 0x812a, 0x223: 0x992e, 0x224: 0x992e, 0x225: 0x992e, 0x226: 0x992e, 0x227: 0x992a, 0x228: 0x992a, 0x229: 0x812e, 0x22a: 0x812e, 0x22b: 0x812e, 0x22c: 0x812e, 0x22d: 0x992e, 0x22e: 0x992e, 0x22f: 0x812e, 0x230: 0x992e, 0x231: 0x992e, 0x232: 0x812e, 0x233: 0x812e, 0x234: 0x8101, 0x235: 0x8101, 0x236: 0x8101, 0x237: 0x8101, 0x238: 0x9901, 0x239: 0x812e, 0x23a: 0x812e, 0x23b: 0x812e, 0x23c: 0x812e, 0x23d: 0x8133, 0x23e: 0x8133, 0x23f: 0x8133, // Block 0x9, offset 0x240 0x240: 0x4b3f, 0x241: 0x4b44, 0x242: 0x9933, 0x243: 0x4b49, 0x244: 0x4c02, 0x245: 0x9937, 0x246: 0x8133, 0x247: 0x812e, 0x248: 0x812e, 0x249: 0x812e, 0x24a: 0x8133, 0x24b: 0x8133, 0x24c: 0x8133, 0x24d: 0x812e, 0x24e: 0x812e, 0x250: 0x8133, 0x251: 0x8133, 0x252: 0x8133, 0x253: 0x812e, 0x254: 0x812e, 0x255: 0x812e, 0x256: 0x812e, 0x257: 0x8133, 0x258: 0x8134, 0x259: 0x812e, 0x25a: 0x812e, 0x25b: 0x8133, 0x25c: 0x8135, 0x25d: 0x8136, 0x25e: 0x8136, 0x25f: 0x8135, 0x260: 0x8136, 0x261: 0x8136, 0x262: 0x8135, 0x263: 0x8133, 0x264: 0x8133, 0x265: 0x8133, 0x266: 0x8133, 0x267: 0x8133, 0x268: 0x8133, 0x269: 0x8133, 0x26a: 0x8133, 0x26b: 0x8133, 0x26c: 0x8133, 0x26d: 0x8133, 0x26e: 0x8133, 0x26f: 0x8133, 0x274: 0x01ee, 0x27a: 0x8100, 0x27e: 0x0037, // Block 0xa, offset 0x280 0x284: 0x8100, 0x285: 0x3500, 0x286: 0x3548, 0x287: 0x00ce, 0x288: 0x3566, 0x289: 0x3572, 0x28a: 0x3584, 0x28c: 0x35a2, 0x28e: 0x35b4, 0x28f: 0x35d2, 0x290: 0x3d67, 0x291: 0xa000, 0x295: 0xa000, 0x297: 0xa000, 0x299: 0xa000, 0x29f: 0xa000, 0x2a1: 0xa000, 0x2a5: 0xa000, 0x2a9: 0xa000, 0x2aa: 0x3596, 0x2ab: 0x35c6, 0x2ac: 0x4975, 0x2ad: 0x35f6, 0x2ae: 0x499f, 0x2af: 0x3608, 0x2b0: 0x3dcf, 0x2b1: 0xa000, 0x2b5: 0xa000, 0x2b7: 0xa000, 0x2b9: 0xa000, 0x2bf: 0xa000, // Block 0xb, offset 0x2c0 0x2c0: 0x3680, 0x2c1: 0x368c, 0x2c3: 0x367a, 0x2c6: 0xa000, 0x2c7: 0x3668, 0x2cc: 0x36bc, 0x2cd: 0x36a4, 0x2ce: 0x36ce, 0x2d0: 0xa000, 0x2d3: 0xa000, 0x2d5: 0xa000, 0x2d6: 0xa000, 0x2d7: 0xa000, 0x2d8: 0xa000, 0x2d9: 0x36b0, 0x2da: 0xa000, 0x2de: 0xa000, 0x2e3: 0xa000, 0x2e7: 0xa000, 0x2eb: 0xa000, 0x2ed: 0xa000, 0x2f0: 0xa000, 0x2f3: 0xa000, 0x2f5: 0xa000, 0x2f6: 0xa000, 0x2f7: 0xa000, 0x2f8: 0xa000, 0x2f9: 0x3734, 0x2fa: 0xa000, 0x2fe: 0xa000, // Block 0xc, offset 0x300 0x301: 0x3692, 0x302: 0x3716, 0x310: 0x366e, 0x311: 0x36f2, 0x312: 0x3674, 0x313: 0x36f8, 0x316: 0x3686, 0x317: 0x370a, 0x318: 0xa000, 0x319: 0xa000, 0x31a: 0x3788, 0x31b: 0x378e, 0x31c: 0x3698, 0x31d: 0x371c, 0x31e: 0x369e, 0x31f: 0x3722, 0x322: 0x36aa, 0x323: 0x372e, 0x324: 0x36b6, 0x325: 0x373a, 0x326: 0x36c2, 0x327: 0x3746, 0x328: 0xa000, 0x329: 0xa000, 0x32a: 0x3794, 0x32b: 0x379a, 0x32c: 0x36ec, 0x32d: 0x3770, 0x32e: 0x36c8, 0x32f: 0x374c, 0x330: 0x36d4, 0x331: 0x3758, 0x332: 0x36da, 0x333: 0x375e, 0x334: 0x36e0, 0x335: 0x3764, 0x338: 0x36e6, 0x339: 0x376a, // Block 0xd, offset 0x340 0x351: 0x812e, 0x352: 0x8133, 0x353: 0x8133, 0x354: 0x8133, 0x355: 0x8133, 0x356: 0x812e, 0x357: 0x8133, 0x358: 0x8133, 0x359: 0x8133, 0x35a: 0x812f, 0x35b: 0x812e, 0x35c: 0x8133, 0x35d: 0x8133, 0x35e: 0x8133, 0x35f: 0x8133, 0x360: 0x8133, 0x361: 0x8133, 0x362: 0x812e, 0x363: 0x812e, 0x364: 0x812e, 0x365: 0x812e, 0x366: 0x812e, 0x367: 0x812e, 0x368: 0x8133, 0x369: 0x8133, 0x36a: 0x812e, 0x36b: 0x8133, 0x36c: 0x8133, 0x36d: 0x812f, 0x36e: 0x8132, 0x36f: 0x8133, 0x370: 0x8106, 0x371: 0x8107, 0x372: 0x8108, 0x373: 0x8109, 0x374: 0x810a, 0x375: 0x810b, 0x376: 0x810c, 0x377: 0x810d, 0x378: 0x810e, 0x379: 0x810f, 0x37a: 0x810f, 0x37b: 0x8110, 0x37c: 0x8111, 0x37d: 0x8112, 0x37f: 0x8113, // Block 0xe, offset 0x380 0x388: 0xa000, 0x38a: 0xa000, 0x38b: 0x8117, 0x38c: 0x8118, 0x38d: 0x8119, 0x38e: 0x811a, 0x38f: 0x811b, 0x390: 0x811c, 0x391: 0x811d, 0x392: 0x811e, 0x393: 0x9933, 0x394: 0x9933, 0x395: 0x992e, 0x396: 0x812e, 0x397: 0x8133, 0x398: 0x8133, 0x399: 0x8133, 0x39a: 0x8133, 0x39b: 0x8133, 0x39c: 0x812e, 0x39d: 0x8133, 0x39e: 0x8133, 0x39f: 0x812e, 0x3b0: 0x811f, // Block 0xf, offset 0x3c0 0x3ca: 0x8133, 0x3cb: 0x8133, 0x3cc: 0x8133, 0x3cd: 0x8133, 0x3ce: 0x8133, 0x3cf: 0x812e, 0x3d0: 0x812e, 0x3d1: 0x812e, 0x3d2: 0x812e, 0x3d3: 0x812e, 0x3d4: 0x8133, 0x3d5: 0x8133, 0x3d6: 0x8133, 0x3d7: 0x8133, 0x3d8: 0x8133, 0x3d9: 0x8133, 0x3da: 0x8133, 0x3db: 0x8133, 0x3dc: 0x8133, 0x3dd: 0x8133, 0x3de: 0x8133, 0x3df: 0x8133, 0x3e0: 0x8133, 0x3e1: 0x8133, 0x3e3: 0x812e, 0x3e4: 0x8133, 0x3e5: 0x8133, 0x3e6: 0x812e, 0x3e7: 0x8133, 0x3e8: 0x8133, 0x3e9: 0x812e, 0x3ea: 0x8133, 0x3eb: 0x8133, 0x3ec: 0x8133, 0x3ed: 0x812e, 0x3ee: 0x812e, 0x3ef: 0x812e, 0x3f0: 0x8117, 0x3f1: 0x8118, 0x3f2: 0x8119, 0x3f3: 0x8133, 0x3f4: 0x8133, 0x3f5: 0x8133, 0x3f6: 0x812e, 0x3f7: 0x8133, 0x3f8: 0x8133, 0x3f9: 0x812e, 0x3fa: 0x812e, 0x3fb: 0x8133, 0x3fc: 0x8133, 0x3fd: 0x8133, 0x3fe: 0x8133, 0x3ff: 0x8133, // Block 0x10, offset 0x400 0x405: 0xa000, 0x406: 0x3ee7, 0x407: 0xa000, 0x408: 0x3eef, 0x409: 0xa000, 0x40a: 0x3ef7, 0x40b: 0xa000, 0x40c: 0x3eff, 0x40d: 0xa000, 0x40e: 0x3f07, 0x411: 0xa000, 0x412: 0x3f0f, 0x434: 0x8103, 0x435: 0x9900, 0x43a: 0xa000, 0x43b: 0x3f17, 0x43c: 0xa000, 0x43d: 0x3f1f, 0x43e: 0xa000, 0x43f: 0xa000, // Block 0x11, offset 0x440 0x440: 0x8133, 0x441: 0x8133, 0x442: 0x812e, 0x443: 0x8133, 0x444: 0x8133, 0x445: 0x8133, 0x446: 0x8133, 0x447: 0x8133, 0x448: 0x8133, 0x449: 0x8133, 0x44a: 0x812e, 0x44b: 0x8133, 0x44c: 0x8133, 0x44d: 0x8136, 0x44e: 0x812b, 0x44f: 0x812e, 0x450: 0x812a, 0x451: 0x8133, 0x452: 0x8133, 0x453: 0x8133, 0x454: 0x8133, 0x455: 0x8133, 0x456: 0x8133, 0x457: 0x8133, 0x458: 0x8133, 0x459: 0x8133, 0x45a: 0x8133, 0x45b: 0x8133, 0x45c: 0x8133, 0x45d: 0x8133, 0x45e: 0x8133, 0x45f: 0x8133, 0x460: 0x8133, 0x461: 0x8133, 0x462: 0x8133, 0x463: 0x8133, 0x464: 0x8133, 0x465: 0x8133, 0x466: 0x8133, 0x467: 0x8133, 0x468: 0x8133, 0x469: 0x8133, 0x46a: 0x8133, 0x46b: 0x8133, 0x46c: 0x8133, 0x46d: 0x8133, 0x46e: 0x8133, 0x46f: 0x8133, 0x470: 0x8133, 0x471: 0x8133, 0x472: 0x8133, 0x473: 0x8133, 0x474: 0x8133, 0x475: 0x8133, 0x476: 0x8134, 0x477: 0x8132, 0x478: 0x8132, 0x479: 0x812e, 0x47a: 0x812d, 0x47b: 0x8133, 0x47c: 0x8135, 0x47d: 0x812e, 0x47e: 0x8133, 0x47f: 0x812e, // Block 0x12, offset 0x480 0x480: 0x2ef6, 0x481: 0x3202, 0x482: 0x2f00, 0x483: 0x320c, 0x484: 0x2f05, 0x485: 0x3211, 0x486: 0x2f0a, 0x487: 0x3216, 0x488: 0x382b, 0x489: 0x39ba, 0x48a: 0x2f23, 0x48b: 0x322f, 0x48c: 0x2f2d, 0x48d: 0x3239, 0x48e: 0x2f3c, 0x48f: 0x3248, 0x490: 0x2f32, 0x491: 0x323e, 0x492: 0x2f37, 0x493: 0x3243, 0x494: 0x384e, 0x495: 0x39dd, 0x496: 0x3855, 0x497: 0x39e4, 0x498: 0x2f78, 0x499: 0x3284, 0x49a: 0x2f7d, 0x49b: 0x3289, 0x49c: 0x3863, 0x49d: 0x39f2, 0x49e: 0x2f82, 0x49f: 0x328e, 0x4a0: 0x2f91, 0x4a1: 0x329d, 0x4a2: 0x2faf, 0x4a3: 0x32bb, 0x4a4: 0x2fbe, 0x4a5: 0x32ca, 0x4a6: 0x2fb4, 0x4a7: 0x32c0, 0x4a8: 0x2fc3, 0x4a9: 0x32cf, 0x4aa: 0x2fc8, 0x4ab: 0x32d4, 0x4ac: 0x300e, 0x4ad: 0x331a, 0x4ae: 0x386a, 0x4af: 0x39f9, 0x4b0: 0x3018, 0x4b1: 0x3329, 0x4b2: 0x3022, 0x4b3: 0x3333, 0x4b4: 0x302c, 0x4b5: 0x333d, 0x4b6: 0x483b, 0x4b7: 0x48cc, 0x4b8: 0x3871, 0x4b9: 0x3a00, 0x4ba: 0x3045, 0x4bb: 0x3356, 0x4bc: 0x3040, 0x4bd: 0x3351, 0x4be: 0x304a, 0x4bf: 0x335b, // Block 0x13, offset 0x4c0 0x4c0: 0x304f, 0x4c1: 0x3360, 0x4c2: 0x3054, 0x4c3: 0x3365, 0x4c4: 0x3068, 0x4c5: 0x3379, 0x4c6: 0x3072, 0x4c7: 0x3383, 0x4c8: 0x3081, 0x4c9: 0x3392, 0x4ca: 0x307c, 0x4cb: 0x338d, 0x4cc: 0x3894, 0x4cd: 0x3a23, 0x4ce: 0x38a2, 0x4cf: 0x3a31, 0x4d0: 0x38a9, 0x4d1: 0x3a38, 0x4d2: 0x38b0, 0x4d3: 0x3a3f, 0x4d4: 0x30ae, 0x4d5: 0x33bf, 0x4d6: 0x30b3, 0x4d7: 0x33c4, 0x4d8: 0x30bd, 0x4d9: 0x33ce, 0x4da: 0x4868, 0x4db: 0x48f9, 0x4dc: 0x38f6, 0x4dd: 0x3a85, 0x4de: 0x30d6, 0x4df: 0x33e7, 0x4e0: 0x30e0, 0x4e1: 0x33f1, 0x4e2: 0x4877, 0x4e3: 0x4908, 0x4e4: 0x38fd, 0x4e5: 0x3a8c, 0x4e6: 0x3904, 0x4e7: 0x3a93, 0x4e8: 0x390b, 0x4e9: 0x3a9a, 0x4ea: 0x30ef, 0x4eb: 0x3400, 0x4ec: 0x30f9, 0x4ed: 0x340f, 0x4ee: 0x310d, 0x4ef: 0x3423, 0x4f0: 0x3108, 0x4f1: 0x341e, 0x4f2: 0x3149, 0x4f3: 0x345f, 0x4f4: 0x3158, 0x4f5: 0x346e, 0x4f6: 0x3153, 0x4f7: 0x3469, 0x4f8: 0x3912, 0x4f9: 0x3aa1, 0x4fa: 0x3919, 0x4fb: 0x3aa8, 0x4fc: 0x315d, 0x4fd: 0x3473, 0x4fe: 0x3162, 0x4ff: 0x3478, // Block 0x14, offset 0x500 0x500: 0x3167, 0x501: 0x347d, 0x502: 0x316c, 0x503: 0x3482, 0x504: 0x317b, 0x505: 0x3491, 0x506: 0x3176, 0x507: 0x348c, 0x508: 0x3180, 0x509: 0x349b, 0x50a: 0x3185, 0x50b: 0x34a0, 0x50c: 0x318a, 0x50d: 0x34a5, 0x50e: 0x31a8, 0x50f: 0x34c3, 0x510: 0x31c1, 0x511: 0x34e1, 0x512: 0x31d0, 0x513: 0x34f0, 0x514: 0x31d5, 0x515: 0x34f5, 0x516: 0x32d9, 0x517: 0x3405, 0x518: 0x3496, 0x519: 0x34d2, 0x51b: 0x3530, 0x520: 0x4818, 0x521: 0x48a9, 0x522: 0x2ee2, 0x523: 0x31ee, 0x524: 0x37d7, 0x525: 0x3966, 0x526: 0x37d0, 0x527: 0x395f, 0x528: 0x37e5, 0x529: 0x3974, 0x52a: 0x37de, 0x52b: 0x396d, 0x52c: 0x381d, 0x52d: 0x39ac, 0x52e: 0x37f3, 0x52f: 0x3982, 0x530: 0x37ec, 0x531: 0x397b, 0x532: 0x3801, 0x533: 0x3990, 0x534: 0x37fa, 0x535: 0x3989, 0x536: 0x3824, 0x537: 0x39b3, 0x538: 0x482c, 0x539: 0x48bd, 0x53a: 0x2f5f, 0x53b: 0x326b, 0x53c: 0x2f4b, 0x53d: 0x3257, 0x53e: 0x3839, 0x53f: 0x39c8, // Block 0x15, offset 0x540 0x540: 0x3832, 0x541: 0x39c1, 0x542: 0x3847, 0x543: 0x39d6, 0x544: 0x3840, 0x545: 0x39cf, 0x546: 0x385c, 0x547: 0x39eb, 0x548: 0x2ff0, 0x549: 0x32fc, 0x54a: 0x3004, 0x54b: 0x3310, 0x54c: 0x485e, 0x54d: 0x48ef, 0x54e: 0x3095, 0x54f: 0x33a6, 0x550: 0x387f, 0x551: 0x3a0e, 0x552: 0x3878, 0x553: 0x3a07, 0x554: 0x388d, 0x555: 0x3a1c, 0x556: 0x3886, 0x557: 0x3a15, 0x558: 0x38e8, 0x559: 0x3a77, 0x55a: 0x38cc, 0x55b: 0x3a5b, 0x55c: 0x38c5, 0x55d: 0x3a54, 0x55e: 0x38da, 0x55f: 0x3a69, 0x560: 0x38d3, 0x561: 0x3a62, 0x562: 0x38e1, 0x563: 0x3a70, 0x564: 0x3144, 0x565: 0x345a, 0x566: 0x3126, 0x567: 0x343c, 0x568: 0x3943, 0x569: 0x3ad2, 0x56a: 0x393c, 0x56b: 0x3acb, 0x56c: 0x3951, 0x56d: 0x3ae0, 0x56e: 0x394a, 0x56f: 0x3ad9, 0x570: 0x3958, 0x571: 0x3ae7, 0x572: 0x318f, 0x573: 0x34aa, 0x574: 0x31b7, 0x575: 0x34d7, 0x576: 0x31b2, 0x577: 0x34cd, 0x578: 0x319e, 0x579: 0x34b9, // Block 0x16, offset 0x580 0x580: 0x497b, 0x581: 0x4981, 0x582: 0x4a95, 0x583: 0x4aad, 0x584: 0x4a9d, 0x585: 0x4ab5, 0x586: 0x4aa5, 0x587: 0x4abd, 0x588: 0x4921, 0x589: 0x4927, 0x58a: 0x4a05, 0x58b: 0x4a1d, 0x58c: 0x4a0d, 0x58d: 0x4a25, 0x58e: 0x4a15, 0x58f: 0x4a2d, 0x590: 0x498d, 0x591: 0x4993, 0x592: 0x3d17, 0x593: 0x3d27, 0x594: 0x3d1f, 0x595: 0x3d2f, 0x598: 0x492d, 0x599: 0x4933, 0x59a: 0x3c47, 0x59b: 0x3c57, 0x59c: 0x3c4f, 0x59d: 0x3c5f, 0x5a0: 0x49a5, 0x5a1: 0x49ab, 0x5a2: 0x4ac5, 0x5a3: 0x4add, 0x5a4: 0x4acd, 0x5a5: 0x4ae5, 0x5a6: 0x4ad5, 0x5a7: 0x4aed, 0x5a8: 0x4939, 0x5a9: 0x493f, 0x5aa: 0x4a35, 0x5ab: 0x4a4d, 0x5ac: 0x4a3d, 0x5ad: 0x4a55, 0x5ae: 0x4a45, 0x5af: 0x4a5d, 0x5b0: 0x49bd, 0x5b1: 0x49c3, 0x5b2: 0x3d77, 0x5b3: 0x3d8f, 0x5b4: 0x3d7f, 0x5b5: 0x3d97, 0x5b6: 0x3d87, 0x5b7: 0x3d9f, 0x5b8: 0x4945, 0x5b9: 0x494b, 0x5ba: 0x3c77, 0x5bb: 0x3c8f, 0x5bc: 0x3c7f, 0x5bd: 0x3c97, 0x5be: 0x3c87, 0x5bf: 0x3c9f, // Block 0x17, offset 0x5c0 0x5c0: 0x49c9, 0x5c1: 0x49cf, 0x5c2: 0x3da7, 0x5c3: 0x3db7, 0x5c4: 0x3daf, 0x5c5: 0x3dbf, 0x5c8: 0x4951, 0x5c9: 0x4957, 0x5ca: 0x3ca7, 0x5cb: 0x3cb7, 0x5cc: 0x3caf, 0x5cd: 0x3cbf, 0x5d0: 0x49db, 0x5d1: 0x49e1, 0x5d2: 0x3ddf, 0x5d3: 0x3df7, 0x5d4: 0x3de7, 0x5d5: 0x3dff, 0x5d6: 0x3def, 0x5d7: 0x3e07, 0x5d9: 0x495d, 0x5db: 0x3cc7, 0x5dd: 0x3ccf, 0x5df: 0x3cd7, 0x5e0: 0x49f3, 0x5e1: 0x49f9, 0x5e2: 0x4af5, 0x5e3: 0x4b0d, 0x5e4: 0x4afd, 0x5e5: 0x4b15, 0x5e6: 0x4b05, 0x5e7: 0x4b1d, 0x5e8: 0x4963, 0x5e9: 0x4969, 0x5ea: 0x4a65, 0x5eb: 0x4a7d, 0x5ec: 0x4a6d, 0x5ed: 0x4a85, 0x5ee: 0x4a75, 0x5ef: 0x4a8d, 0x5f0: 0x496f, 0x5f1: 0x441d, 0x5f2: 0x35f0, 0x5f3: 0x4423, 0x5f4: 0x4999, 0x5f5: 0x4429, 0x5f6: 0x3602, 0x5f7: 0x442f, 0x5f8: 0x3620, 0x5f9: 0x4435, 0x5fa: 0x3638, 0x5fb: 0x443b, 0x5fc: 0x49e7, 0x5fd: 0x4441, // Block 0x18, offset 0x600 0x600: 0x3cff, 0x601: 0x3d07, 0x602: 0x41d3, 0x603: 0x41f1, 0x604: 0x41dd, 0x605: 0x41fb, 0x606: 0x41e7, 0x607: 0x4205, 0x608: 0x3c37, 0x609: 0x3c3f, 0x60a: 0x411f, 0x60b: 0x413d, 0x60c: 0x4129, 0x60d: 0x4147, 0x60e: 0x4133, 0x60f: 0x4151, 0x610: 0x3d47, 0x611: 0x3d4f, 0x612: 0x420f, 0x613: 0x422d, 0x614: 0x4219, 0x615: 0x4237, 0x616: 0x4223, 0x617: 0x4241, 0x618: 0x3c67, 0x619: 0x3c6f, 0x61a: 0x415b, 0x61b: 0x4179, 0x61c: 0x4165, 0x61d: 0x4183, 0x61e: 0x416f, 0x61f: 0x418d, 0x620: 0x3e1f, 0x621: 0x3e27, 0x622: 0x424b, 0x623: 0x4269, 0x624: 0x4255, 0x625: 0x4273, 0x626: 0x425f, 0x627: 0x427d, 0x628: 0x3cdf, 0x629: 0x3ce7, 0x62a: 0x4197, 0x62b: 0x41b5, 0x62c: 0x41a1, 0x62d: 0x41bf, 0x62e: 0x41ab, 0x62f: 0x41c9, 0x630: 0x35e4, 0x631: 0x35de, 0x632: 0x3cef, 0x633: 0x35ea, 0x634: 0x3cf7, 0x636: 0x4987, 0x637: 0x3d0f, 0x638: 0x3554, 0x639: 0x354e, 0x63a: 0x3542, 0x63b: 0x43ed, 0x63c: 0x355a, 0x63d: 0x8100, 0x63e: 0x0257, 0x63f: 0xa100, // Block 0x19, offset 0x640 0x640: 0x8100, 0x641: 0x3506, 0x642: 0x3d37, 0x643: 0x35fc, 0x644: 0x3d3f, 0x646: 0x49b1, 0x647: 0x3d57, 0x648: 0x3560, 0x649: 0x43f3, 0x64a: 0x356c, 0x64b: 0x43f9, 0x64c: 0x3578, 0x64d: 0x3aee, 0x64e: 0x3af5, 0x64f: 0x3afc, 0x650: 0x3614, 0x651: 0x360e, 0x652: 0x3d5f, 0x653: 0x45e3, 0x656: 0x361a, 0x657: 0x3d6f, 0x658: 0x3590, 0x659: 0x358a, 0x65a: 0x357e, 0x65b: 0x43ff, 0x65d: 0x3b03, 0x65e: 0x3b0a, 0x65f: 0x3b11, 0x660: 0x364a, 0x661: 0x3644, 0x662: 0x3dc7, 0x663: 0x45eb, 0x664: 0x362c, 0x665: 0x3632, 0x666: 0x3650, 0x667: 0x3dd7, 0x668: 0x35c0, 0x669: 0x35ba, 0x66a: 0x35ae, 0x66b: 0x440b, 0x66c: 0x35a8, 0x66d: 0x34fa, 0x66e: 0x43e7, 0x66f: 0x0081, 0x672: 0x3e0f, 0x673: 0x3656, 0x674: 0x3e17, 0x676: 0x49ff, 0x677: 0x3e2f, 0x678: 0x359c, 0x679: 0x4405, 0x67a: 0x35cc, 0x67b: 0x4417, 0x67c: 0x35d8, 0x67d: 0x4355, 0x67e: 0xa100, // Block 0x1a, offset 0x680 0x681: 0x3b65, 0x683: 0xa000, 0x684: 0x3b6c, 0x685: 0xa000, 0x687: 0x3b73, 0x688: 0xa000, 0x689: 0x3b7a, 0x68d: 0xa000, 0x6a0: 0x2ec4, 0x6a1: 0xa000, 0x6a2: 0x3b88, 0x6a4: 0xa000, 0x6a5: 0xa000, 0x6ad: 0x3b81, 0x6ae: 0x2ebf, 0x6af: 0x2ec9, 0x6b0: 0x3b8f, 0x6b1: 0x3b96, 0x6b2: 0xa000, 0x6b3: 0xa000, 0x6b4: 0x3b9d, 0x6b5: 0x3ba4, 0x6b6: 0xa000, 0x6b7: 0xa000, 0x6b8: 0x3bab, 0x6b9: 0x3bb2, 0x6ba: 0xa000, 0x6bb: 0xa000, 0x6bc: 0xa000, 0x6bd: 0xa000, // Block 0x1b, offset 0x6c0 0x6c0: 0x3bb9, 0x6c1: 0x3bc0, 0x6c2: 0xa000, 0x6c3: 0xa000, 0x6c4: 0x3bd5, 0x6c5: 0x3bdc, 0x6c6: 0xa000, 0x6c7: 0xa000, 0x6c8: 0x3be3, 0x6c9: 0x3bea, 0x6d1: 0xa000, 0x6d2: 0xa000, 0x6e2: 0xa000, 0x6e8: 0xa000, 0x6e9: 0xa000, 0x6eb: 0xa000, 0x6ec: 0x3bff, 0x6ed: 0x3c06, 0x6ee: 0x3c0d, 0x6ef: 0x3c14, 0x6f2: 0xa000, 0x6f3: 0xa000, 0x6f4: 0xa000, 0x6f5: 0xa000, // Block 0x1c, offset 0x700 0x706: 0xa000, 0x70b: 0xa000, 0x70c: 0x3f47, 0x70d: 0xa000, 0x70e: 0x3f4f, 0x70f: 0xa000, 0x710: 0x3f57, 0x711: 0xa000, 0x712: 0x3f5f, 0x713: 0xa000, 0x714: 0x3f67, 0x715: 0xa000, 0x716: 0x3f6f, 0x717: 0xa000, 0x718: 0x3f77, 0x719: 0xa000, 0x71a: 0x3f7f, 0x71b: 0xa000, 0x71c: 0x3f87, 0x71d: 0xa000, 0x71e: 0x3f8f, 0x71f: 0xa000, 0x720: 0x3f97, 0x721: 0xa000, 0x722: 0x3f9f, 0x724: 0xa000, 0x725: 0x3fa7, 0x726: 0xa000, 0x727: 0x3faf, 0x728: 0xa000, 0x729: 0x3fb7, 0x72f: 0xa000, 0x730: 0x3fbf, 0x731: 0x3fc7, 0x732: 0xa000, 0x733: 0x3fcf, 0x734: 0x3fd7, 0x735: 0xa000, 0x736: 0x3fdf, 0x737: 0x3fe7, 0x738: 0xa000, 0x739: 0x3fef, 0x73a: 0x3ff7, 0x73b: 0xa000, 0x73c: 0x3fff, 0x73d: 0x4007, // Block 0x1d, offset 0x740 0x754: 0x3f3f, 0x759: 0x9904, 0x75a: 0x9904, 0x75b: 0x8100, 0x75c: 0x8100, 0x75d: 0xa000, 0x75e: 0x400f, 0x766: 0xa000, 0x76b: 0xa000, 0x76c: 0x401f, 0x76d: 0xa000, 0x76e: 0x4027, 0x76f: 0xa000, 0x770: 0x402f, 0x771: 0xa000, 0x772: 0x4037, 0x773: 0xa000, 0x774: 0x403f, 0x775: 0xa000, 0x776: 0x4047, 0x777: 0xa000, 0x778: 0x404f, 0x779: 0xa000, 0x77a: 0x4057, 0x77b: 0xa000, 0x77c: 0x405f, 0x77d: 0xa000, 0x77e: 0x4067, 0x77f: 0xa000, // Block 0x1e, offset 0x780 0x780: 0x406f, 0x781: 0xa000, 0x782: 0x4077, 0x784: 0xa000, 0x785: 0x407f, 0x786: 0xa000, 0x787: 0x4087, 0x788: 0xa000, 0x789: 0x408f, 0x78f: 0xa000, 0x790: 0x4097, 0x791: 0x409f, 0x792: 0xa000, 0x793: 0x40a7, 0x794: 0x40af, 0x795: 0xa000, 0x796: 0x40b7, 0x797: 0x40bf, 0x798: 0xa000, 0x799: 0x40c7, 0x79a: 0x40cf, 0x79b: 0xa000, 0x79c: 0x40d7, 0x79d: 0x40df, 0x7af: 0xa000, 0x7b0: 0xa000, 0x7b1: 0xa000, 0x7b2: 0xa000, 0x7b4: 0x4017, 0x7b7: 0x40e7, 0x7b8: 0x40ef, 0x7b9: 0x40f7, 0x7ba: 0x40ff, 0x7bd: 0xa000, 0x7be: 0x4107, // Block 0x1f, offset 0x7c0 0x7c0: 0x1472, 0x7c1: 0x0df6, 0x7c2: 0x14ce, 0x7c3: 0x149a, 0x7c4: 0x0f52, 0x7c5: 0x07e6, 0x7c6: 0x09da, 0x7c7: 0x1726, 0x7c8: 0x1726, 0x7c9: 0x0b06, 0x7ca: 0x155a, 0x7cb: 0x0a3e, 0x7cc: 0x0b02, 0x7cd: 0x0cea, 0x7ce: 0x10ca, 0x7cf: 0x125a, 0x7d0: 0x1392, 0x7d1: 0x13ce, 0x7d2: 0x1402, 0x7d3: 0x1516, 0x7d4: 0x0e6e, 0x7d5: 0x0efa, 0x7d6: 0x0fa6, 0x7d7: 0x103e, 0x7d8: 0x135a, 0x7d9: 0x1542, 0x7da: 0x166e, 0x7db: 0x080a, 0x7dc: 0x09ae, 0x7dd: 0x0e82, 0x7de: 0x0fca, 0x7df: 0x138e, 0x7e0: 0x16be, 0x7e1: 0x0bae, 0x7e2: 0x0f72, 0x7e3: 0x137e, 0x7e4: 0x1412, 0x7e5: 0x0d1e, 0x7e6: 0x12b6, 0x7e7: 0x13da, 0x7e8: 0x0c1a, 0x7e9: 0x0e0a, 0x7ea: 0x0f12, 0x7eb: 0x1016, 0x7ec: 0x1522, 0x7ed: 0x084a, 0x7ee: 0x08e2, 0x7ef: 0x094e, 0x7f0: 0x0d86, 0x7f1: 0x0e7a, 0x7f2: 0x0fc6, 0x7f3: 0x10ea, 0x7f4: 0x1272, 0x7f5: 0x1386, 0x7f6: 0x139e, 0x7f7: 0x14c2, 0x7f8: 0x15ea, 0x7f9: 0x169e, 0x7fa: 0x16ba, 0x7fb: 0x1126, 0x7fc: 0x1166, 0x7fd: 0x121e, 0x7fe: 0x133e, 0x7ff: 0x1576, // Block 0x20, offset 0x800 0x800: 0x16c6, 0x801: 0x1446, 0x802: 0x0ac2, 0x803: 0x0c36, 0x804: 0x11d6, 0x805: 0x1296, 0x806: 0x0ffa, 0x807: 0x112e, 0x808: 0x1492, 0x809: 0x15e2, 0x80a: 0x0abe, 0x80b: 0x0b8a, 0x80c: 0x0e72, 0x80d: 0x0f26, 0x80e: 0x0f5a, 0x80f: 0x120e, 0x810: 0x1236, 0x811: 0x15a2, 0x812: 0x094a, 0x813: 0x12a2, 0x814: 0x08ee, 0x815: 0x08ea, 0x816: 0x1192, 0x817: 0x1222, 0x818: 0x1356, 0x819: 0x15aa, 0x81a: 0x1462, 0x81b: 0x0d22, 0x81c: 0x0e6e, 0x81d: 0x1452, 0x81e: 0x07f2, 0x81f: 0x0b5e, 0x820: 0x0c8e, 0x821: 0x102a, 0x822: 0x10aa, 0x823: 0x096e, 0x824: 0x1136, 0x825: 0x085a, 0x826: 0x0c72, 0x827: 0x07d2, 0x828: 0x0ee6, 0x829: 0x0d9e, 0x82a: 0x120a, 0x82b: 0x09c2, 0x82c: 0x0aae, 0x82d: 0x10f6, 0x82e: 0x135e, 0x82f: 0x1436, 0x830: 0x0eb2, 0x831: 0x14f2, 0x832: 0x0ede, 0x833: 0x0d32, 0x834: 0x1316, 0x835: 0x0d52, 0x836: 0x10a6, 0x837: 0x0826, 0x838: 0x08a2, 0x839: 0x08e6, 0x83a: 0x0e4e, 0x83b: 0x11f6, 0x83c: 0x12ee, 0x83d: 0x1442, 0x83e: 0x1556, 0x83f: 0x0956, // Block 0x21, offset 0x840 0x840: 0x0a0a, 0x841: 0x0b12, 0x842: 0x0c2a, 0x843: 0x0dba, 0x844: 0x0f76, 0x845: 0x113a, 0x846: 0x1592, 0x847: 0x1676, 0x848: 0x16ca, 0x849: 0x16e2, 0x84a: 0x0932, 0x84b: 0x0dee, 0x84c: 0x0e9e, 0x84d: 0x14e6, 0x84e: 0x0bf6, 0x84f: 0x0cd2, 0x850: 0x0cee, 0x851: 0x0d7e, 0x852: 0x0f66, 0x853: 0x0fb2, 0x854: 0x1062, 0x855: 0x1186, 0x856: 0x122a, 0x857: 0x128e, 0x858: 0x14d6, 0x859: 0x1366, 0x85a: 0x14fe, 0x85b: 0x157a, 0x85c: 0x090a, 0x85d: 0x0936, 0x85e: 0x0a1e, 0x85f: 0x0fa2, 0x860: 0x13ee, 0x861: 0x1436, 0x862: 0x0c16, 0x863: 0x0c86, 0x864: 0x0d4a, 0x865: 0x0eaa, 0x866: 0x11d2, 0x867: 0x101e, 0x868: 0x0836, 0x869: 0x0a7a, 0x86a: 0x0b5e, 0x86b: 0x0bc2, 0x86c: 0x0c92, 0x86d: 0x103a, 0x86e: 0x1056, 0x86f: 0x1266, 0x870: 0x1286, 0x871: 0x155e, 0x872: 0x15de, 0x873: 0x15ee, 0x874: 0x162a, 0x875: 0x084e, 0x876: 0x117a, 0x877: 0x154a, 0x878: 0x15c6, 0x879: 0x0caa, 0x87a: 0x0812, 0x87b: 0x0872, 0x87c: 0x0b62, 0x87d: 0x0b82, 0x87e: 0x0daa, 0x87f: 0x0e6e, // Block 0x22, offset 0x880 0x880: 0x0fbe, 0x881: 0x10c6, 0x882: 0x1372, 0x883: 0x1512, 0x884: 0x171e, 0x885: 0x0dde, 0x886: 0x159e, 0x887: 0x092e, 0x888: 0x0e2a, 0x889: 0x0e36, 0x88a: 0x0f0a, 0x88b: 0x0f42, 0x88c: 0x1046, 0x88d: 0x10a2, 0x88e: 0x1122, 0x88f: 0x1206, 0x890: 0x1636, 0x891: 0x08aa, 0x892: 0x0cfe, 0x893: 0x15ae, 0x894: 0x0862, 0x895: 0x0ba6, 0x896: 0x0f2a, 0x897: 0x14da, 0x898: 0x0c62, 0x899: 0x0cb2, 0x89a: 0x0e3e, 0x89b: 0x102a, 0x89c: 0x15b6, 0x89d: 0x0912, 0x89e: 0x09fa, 0x89f: 0x0b92, 0x8a0: 0x0dce, 0x8a1: 0x0e1a, 0x8a2: 0x0e5a, 0x8a3: 0x0eee, 0x8a4: 0x1042, 0x8a5: 0x10b6, 0x8a6: 0x1252, 0x8a7: 0x13f2, 0x8a8: 0x13fe, 0x8a9: 0x1552, 0x8aa: 0x15d2, 0x8ab: 0x097e, 0x8ac: 0x0f46, 0x8ad: 0x09fe, 0x8ae: 0x0fc2, 0x8af: 0x1066, 0x8b0: 0x1382, 0x8b1: 0x15ba, 0x8b2: 0x16a6, 0x8b3: 0x16ce, 0x8b4: 0x0e32, 0x8b5: 0x0f22, 0x8b6: 0x12be, 0x8b7: 0x11b2, 0x8b8: 0x11be, 0x8b9: 0x11e2, 0x8ba: 0x1012, 0x8bb: 0x0f9a, 0x8bc: 0x145e, 0x8bd: 0x082e, 0x8be: 0x1326, 0x8bf: 0x0916, // Block 0x23, offset 0x8c0 0x8c0: 0x0906, 0x8c1: 0x0c06, 0x8c2: 0x0d26, 0x8c3: 0x11ee, 0x8c4: 0x0b4e, 0x8c5: 0x0efe, 0x8c6: 0x0dea, 0x8c7: 0x14e2, 0x8c8: 0x13e2, 0x8c9: 0x15a6, 0x8ca: 0x141e, 0x8cb: 0x0c22, 0x8cc: 0x0882, 0x8cd: 0x0a56, 0x8d0: 0x0aaa, 0x8d2: 0x0dda, 0x8d5: 0x08f2, 0x8d6: 0x101a, 0x8d7: 0x10de, 0x8d8: 0x1142, 0x8d9: 0x115e, 0x8da: 0x1162, 0x8db: 0x1176, 0x8dc: 0x15f6, 0x8dd: 0x11e6, 0x8de: 0x126a, 0x8e0: 0x138a, 0x8e2: 0x144e, 0x8e5: 0x1502, 0x8e6: 0x152e, 0x8ea: 0x164a, 0x8eb: 0x164e, 0x8ec: 0x1652, 0x8ed: 0x16b6, 0x8ee: 0x1526, 0x8ef: 0x15c2, 0x8f0: 0x0852, 0x8f1: 0x0876, 0x8f2: 0x088a, 0x8f3: 0x0946, 0x8f4: 0x0952, 0x8f5: 0x0992, 0x8f6: 0x0a46, 0x8f7: 0x0a62, 0x8f8: 0x0a6a, 0x8f9: 0x0aa6, 0x8fa: 0x0ab2, 0x8fb: 0x0b8e, 0x8fc: 0x0b96, 0x8fd: 0x0c9e, 0x8fe: 0x0cc6, 0x8ff: 0x0cce, // Block 0x24, offset 0x900 0x900: 0x0ce6, 0x901: 0x0d92, 0x902: 0x0dc2, 0x903: 0x0de2, 0x904: 0x0e52, 0x905: 0x0f16, 0x906: 0x0f32, 0x907: 0x0f62, 0x908: 0x0fb6, 0x909: 0x0fd6, 0x90a: 0x104a, 0x90b: 0x112a, 0x90c: 0x1146, 0x90d: 0x114e, 0x90e: 0x114a, 0x90f: 0x1152, 0x910: 0x1156, 0x911: 0x115a, 0x912: 0x116e, 0x913: 0x1172, 0x914: 0x1196, 0x915: 0x11aa, 0x916: 0x11c6, 0x917: 0x122a, 0x918: 0x1232, 0x919: 0x123a, 0x91a: 0x124e, 0x91b: 0x1276, 0x91c: 0x12c6, 0x91d: 0x12fa, 0x91e: 0x12fa, 0x91f: 0x1362, 0x920: 0x140a, 0x921: 0x1422, 0x922: 0x1456, 0x923: 0x145a, 0x924: 0x149e, 0x925: 0x14a2, 0x926: 0x14fa, 0x927: 0x1502, 0x928: 0x15d6, 0x929: 0x161a, 0x92a: 0x1632, 0x92b: 0x0c96, 0x92c: 0x184b, 0x92d: 0x12de, 0x930: 0x07da, 0x931: 0x08de, 0x932: 0x089e, 0x933: 0x0846, 0x934: 0x0886, 0x935: 0x08b2, 0x936: 0x0942, 0x937: 0x095e, 0x938: 0x0a46, 0x939: 0x0a32, 0x93a: 0x0a42, 0x93b: 0x0a5e, 0x93c: 0x0aaa, 0x93d: 0x0aba, 0x93e: 0x0afe, 0x93f: 0x0b0a, // Block 0x25, offset 0x940 0x940: 0x0b26, 0x941: 0x0b36, 0x942: 0x0c1e, 0x943: 0x0c26, 0x944: 0x0c56, 0x945: 0x0c76, 0x946: 0x0ca6, 0x947: 0x0cbe, 0x948: 0x0cae, 0x949: 0x0cce, 0x94a: 0x0cc2, 0x94b: 0x0ce6, 0x94c: 0x0d02, 0x94d: 0x0d5a, 0x94e: 0x0d66, 0x94f: 0x0d6e, 0x950: 0x0d96, 0x951: 0x0dda, 0x952: 0x0e0a, 0x953: 0x0e0e, 0x954: 0x0e22, 0x955: 0x0ea2, 0x956: 0x0eb2, 0x957: 0x0f0a, 0x958: 0x0f56, 0x959: 0x0f4e, 0x95a: 0x0f62, 0x95b: 0x0f7e, 0x95c: 0x0fb6, 0x95d: 0x110e, 0x95e: 0x0fda, 0x95f: 0x100e, 0x960: 0x101a, 0x961: 0x105a, 0x962: 0x1076, 0x963: 0x109a, 0x964: 0x10be, 0x965: 0x10c2, 0x966: 0x10de, 0x967: 0x10e2, 0x968: 0x10f2, 0x969: 0x1106, 0x96a: 0x1102, 0x96b: 0x1132, 0x96c: 0x11ae, 0x96d: 0x11c6, 0x96e: 0x11de, 0x96f: 0x1216, 0x970: 0x122a, 0x971: 0x1246, 0x972: 0x1276, 0x973: 0x132a, 0x974: 0x1352, 0x975: 0x13c6, 0x976: 0x140e, 0x977: 0x141a, 0x978: 0x1422, 0x979: 0x143a, 0x97a: 0x144e, 0x97b: 0x143e, 0x97c: 0x1456, 0x97d: 0x1452, 0x97e: 0x144a, 0x97f: 0x145a, // Block 0x26, offset 0x980 0x980: 0x1466, 0x981: 0x14a2, 0x982: 0x14de, 0x983: 0x150e, 0x984: 0x1546, 0x985: 0x1566, 0x986: 0x15b2, 0x987: 0x15d6, 0x988: 0x15f6, 0x989: 0x160a, 0x98a: 0x161a, 0x98b: 0x1626, 0x98c: 0x1632, 0x98d: 0x1686, 0x98e: 0x1726, 0x98f: 0x17e2, 0x990: 0x17dd, 0x991: 0x180f, 0x992: 0x0702, 0x993: 0x072a, 0x994: 0x072e, 0x995: 0x1891, 0x996: 0x18be, 0x997: 0x1936, 0x998: 0x1712, 0x999: 0x1722, // Block 0x27, offset 0x9c0 0x9c0: 0x07f6, 0x9c1: 0x07ee, 0x9c2: 0x07fe, 0x9c3: 0x1774, 0x9c4: 0x0842, 0x9c5: 0x0852, 0x9c6: 0x0856, 0x9c7: 0x085e, 0x9c8: 0x0866, 0x9c9: 0x086a, 0x9ca: 0x0876, 0x9cb: 0x086e, 0x9cc: 0x06ae, 0x9cd: 0x1788, 0x9ce: 0x088a, 0x9cf: 0x088e, 0x9d0: 0x0892, 0x9d1: 0x08ae, 0x9d2: 0x1779, 0x9d3: 0x06b2, 0x9d4: 0x089a, 0x9d5: 0x08ba, 0x9d6: 0x1783, 0x9d7: 0x08ca, 0x9d8: 0x08d2, 0x9d9: 0x0832, 0x9da: 0x08da, 0x9db: 0x08de, 0x9dc: 0x195e, 0x9dd: 0x08fa, 0x9de: 0x0902, 0x9df: 0x06ba, 0x9e0: 0x091a, 0x9e1: 0x091e, 0x9e2: 0x0926, 0x9e3: 0x092a, 0x9e4: 0x06be, 0x9e5: 0x0942, 0x9e6: 0x0946, 0x9e7: 0x0952, 0x9e8: 0x095e, 0x9e9: 0x0962, 0x9ea: 0x0966, 0x9eb: 0x096e, 0x9ec: 0x098e, 0x9ed: 0x0992, 0x9ee: 0x099a, 0x9ef: 0x09aa, 0x9f0: 0x09b2, 0x9f1: 0x09b6, 0x9f2: 0x09b6, 0x9f3: 0x09b6, 0x9f4: 0x1797, 0x9f5: 0x0f8e, 0x9f6: 0x09ca, 0x9f7: 0x09d2, 0x9f8: 0x179c, 0x9f9: 0x09de, 0x9fa: 0x09e6, 0x9fb: 0x09ee, 0x9fc: 0x0a16, 0x9fd: 0x0a02, 0x9fe: 0x0a0e, 0x9ff: 0x0a12, // Block 0x28, offset 0xa00 0xa00: 0x0a1a, 0xa01: 0x0a22, 0xa02: 0x0a26, 0xa03: 0x0a2e, 0xa04: 0x0a36, 0xa05: 0x0a3a, 0xa06: 0x0a3a, 0xa07: 0x0a42, 0xa08: 0x0a4a, 0xa09: 0x0a4e, 0xa0a: 0x0a5a, 0xa0b: 0x0a7e, 0xa0c: 0x0a62, 0xa0d: 0x0a82, 0xa0e: 0x0a66, 0xa0f: 0x0a6e, 0xa10: 0x0906, 0xa11: 0x0aca, 0xa12: 0x0a92, 0xa13: 0x0a96, 0xa14: 0x0a9a, 0xa15: 0x0a8e, 0xa16: 0x0aa2, 0xa17: 0x0a9e, 0xa18: 0x0ab6, 0xa19: 0x17a1, 0xa1a: 0x0ad2, 0xa1b: 0x0ad6, 0xa1c: 0x0ade, 0xa1d: 0x0aea, 0xa1e: 0x0af2, 0xa1f: 0x0b0e, 0xa20: 0x17a6, 0xa21: 0x17ab, 0xa22: 0x0b1a, 0xa23: 0x0b1e, 0xa24: 0x0b22, 0xa25: 0x0b16, 0xa26: 0x0b2a, 0xa27: 0x06c2, 0xa28: 0x06c6, 0xa29: 0x0b32, 0xa2a: 0x0b3a, 0xa2b: 0x0b3a, 0xa2c: 0x17b0, 0xa2d: 0x0b56, 0xa2e: 0x0b5a, 0xa2f: 0x0b5e, 0xa30: 0x0b66, 0xa31: 0x17b5, 0xa32: 0x0b6e, 0xa33: 0x0b72, 0xa34: 0x0c4a, 0xa35: 0x0b7a, 0xa36: 0x06ca, 0xa37: 0x0b86, 0xa38: 0x0b96, 0xa39: 0x0ba2, 0xa3a: 0x0b9e, 0xa3b: 0x17bf, 0xa3c: 0x0baa, 0xa3d: 0x17c4, 0xa3e: 0x0bb6, 0xa3f: 0x0bb2, // Block 0x29, offset 0xa40 0xa40: 0x0bba, 0xa41: 0x0bca, 0xa42: 0x0bce, 0xa43: 0x06ce, 0xa44: 0x0bde, 0xa45: 0x0be6, 0xa46: 0x0bea, 0xa47: 0x0bee, 0xa48: 0x06d2, 0xa49: 0x17c9, 0xa4a: 0x06d6, 0xa4b: 0x0c0a, 0xa4c: 0x0c0e, 0xa4d: 0x0c12, 0xa4e: 0x0c1a, 0xa4f: 0x1990, 0xa50: 0x0c32, 0xa51: 0x17d3, 0xa52: 0x17d3, 0xa53: 0x12d2, 0xa54: 0x0c42, 0xa55: 0x0c42, 0xa56: 0x06da, 0xa57: 0x17f6, 0xa58: 0x18c8, 0xa59: 0x0c52, 0xa5a: 0x0c5a, 0xa5b: 0x06de, 0xa5c: 0x0c6e, 0xa5d: 0x0c7e, 0xa5e: 0x0c82, 0xa5f: 0x0c8a, 0xa60: 0x0c9a, 0xa61: 0x06e6, 0xa62: 0x06e2, 0xa63: 0x0c9e, 0xa64: 0x17d8, 0xa65: 0x0ca2, 0xa66: 0x0cb6, 0xa67: 0x0cba, 0xa68: 0x0cbe, 0xa69: 0x0cba, 0xa6a: 0x0cca, 0xa6b: 0x0cce, 0xa6c: 0x0cde, 0xa6d: 0x0cd6, 0xa6e: 0x0cda, 0xa6f: 0x0ce2, 0xa70: 0x0ce6, 0xa71: 0x0cea, 0xa72: 0x0cf6, 0xa73: 0x0cfa, 0xa74: 0x0d12, 0xa75: 0x0d1a, 0xa76: 0x0d2a, 0xa77: 0x0d3e, 0xa78: 0x17e7, 0xa79: 0x0d3a, 0xa7a: 0x0d2e, 0xa7b: 0x0d46, 0xa7c: 0x0d4e, 0xa7d: 0x0d62, 0xa7e: 0x17ec, 0xa7f: 0x0d6a, // Block 0x2a, offset 0xa80 0xa80: 0x0d5e, 0xa81: 0x0d56, 0xa82: 0x06ea, 0xa83: 0x0d72, 0xa84: 0x0d7a, 0xa85: 0x0d82, 0xa86: 0x0d76, 0xa87: 0x06ee, 0xa88: 0x0d92, 0xa89: 0x0d9a, 0xa8a: 0x17f1, 0xa8b: 0x0dc6, 0xa8c: 0x0dfa, 0xa8d: 0x0dd6, 0xa8e: 0x06fa, 0xa8f: 0x0de2, 0xa90: 0x06f6, 0xa91: 0x06f2, 0xa92: 0x08be, 0xa93: 0x08c2, 0xa94: 0x0dfe, 0xa95: 0x0de6, 0xa96: 0x12a6, 0xa97: 0x075e, 0xa98: 0x0e0a, 0xa99: 0x0e0e, 0xa9a: 0x0e12, 0xa9b: 0x0e26, 0xa9c: 0x0e1e, 0xa9d: 0x180a, 0xa9e: 0x06fe, 0xa9f: 0x0e3a, 0xaa0: 0x0e2e, 0xaa1: 0x0e4a, 0xaa2: 0x0e52, 0xaa3: 0x1814, 0xaa4: 0x0e56, 0xaa5: 0x0e42, 0xaa6: 0x0e5e, 0xaa7: 0x0702, 0xaa8: 0x0e62, 0xaa9: 0x0e66, 0xaaa: 0x0e6a, 0xaab: 0x0e76, 0xaac: 0x1819, 0xaad: 0x0e7e, 0xaae: 0x0706, 0xaaf: 0x0e8a, 0xab0: 0x181e, 0xab1: 0x0e8e, 0xab2: 0x070a, 0xab3: 0x0e9a, 0xab4: 0x0ea6, 0xab5: 0x0eb2, 0xab6: 0x0eb6, 0xab7: 0x1823, 0xab8: 0x17ba, 0xab9: 0x1828, 0xaba: 0x0ed6, 0xabb: 0x182d, 0xabc: 0x0ee2, 0xabd: 0x0eea, 0xabe: 0x0eda, 0xabf: 0x0ef6, // Block 0x2b, offset 0xac0 0xac0: 0x0f06, 0xac1: 0x0f16, 0xac2: 0x0f0a, 0xac3: 0x0f0e, 0xac4: 0x0f1a, 0xac5: 0x0f1e, 0xac6: 0x1832, 0xac7: 0x0f02, 0xac8: 0x0f36, 0xac9: 0x0f3a, 0xaca: 0x070e, 0xacb: 0x0f4e, 0xacc: 0x0f4a, 0xacd: 0x1837, 0xace: 0x0f2e, 0xacf: 0x0f6a, 0xad0: 0x183c, 0xad1: 0x1841, 0xad2: 0x0f6e, 0xad3: 0x0f82, 0xad4: 0x0f7e, 0xad5: 0x0f7a, 0xad6: 0x0712, 0xad7: 0x0f86, 0xad8: 0x0f96, 0xad9: 0x0f92, 0xada: 0x0f9e, 0xadb: 0x177e, 0xadc: 0x0fae, 0xadd: 0x1846, 0xade: 0x0fba, 0xadf: 0x1850, 0xae0: 0x0fce, 0xae1: 0x0fda, 0xae2: 0x0fee, 0xae3: 0x1855, 0xae4: 0x1002, 0xae5: 0x1006, 0xae6: 0x185a, 0xae7: 0x185f, 0xae8: 0x1022, 0xae9: 0x1032, 0xaea: 0x0716, 0xaeb: 0x1036, 0xaec: 0x071a, 0xaed: 0x071a, 0xaee: 0x104e, 0xaef: 0x1052, 0xaf0: 0x105a, 0xaf1: 0x105e, 0xaf2: 0x106a, 0xaf3: 0x071e, 0xaf4: 0x1082, 0xaf5: 0x1864, 0xaf6: 0x109e, 0xaf7: 0x1869, 0xaf8: 0x10aa, 0xaf9: 0x17ce, 0xafa: 0x10ba, 0xafb: 0x186e, 0xafc: 0x1873, 0xafd: 0x1878, 0xafe: 0x0722, 0xaff: 0x0726, // Block 0x2c, offset 0xb00 0xb00: 0x10f2, 0xb01: 0x1882, 0xb02: 0x187d, 0xb03: 0x1887, 0xb04: 0x188c, 0xb05: 0x10fa, 0xb06: 0x10fe, 0xb07: 0x10fe, 0xb08: 0x1106, 0xb09: 0x072e, 0xb0a: 0x110a, 0xb0b: 0x0732, 0xb0c: 0x0736, 0xb0d: 0x1896, 0xb0e: 0x111e, 0xb0f: 0x1126, 0xb10: 0x1132, 0xb11: 0x073a, 0xb12: 0x189b, 0xb13: 0x1156, 0xb14: 0x18a0, 0xb15: 0x18a5, 0xb16: 0x1176, 0xb17: 0x118e, 0xb18: 0x073e, 0xb19: 0x1196, 0xb1a: 0x119a, 0xb1b: 0x119e, 0xb1c: 0x18aa, 0xb1d: 0x18af, 0xb1e: 0x18af, 0xb1f: 0x11b6, 0xb20: 0x0742, 0xb21: 0x18b4, 0xb22: 0x11ca, 0xb23: 0x11ce, 0xb24: 0x0746, 0xb25: 0x18b9, 0xb26: 0x11ea, 0xb27: 0x074a, 0xb28: 0x11fa, 0xb29: 0x11f2, 0xb2a: 0x1202, 0xb2b: 0x18c3, 0xb2c: 0x121a, 0xb2d: 0x074e, 0xb2e: 0x1226, 0xb2f: 0x122e, 0xb30: 0x123e, 0xb31: 0x0752, 0xb32: 0x18cd, 0xb33: 0x18d2, 0xb34: 0x0756, 0xb35: 0x18d7, 0xb36: 0x1256, 0xb37: 0x18dc, 0xb38: 0x1262, 0xb39: 0x126e, 0xb3a: 0x1276, 0xb3b: 0x18e1, 0xb3c: 0x18e6, 0xb3d: 0x128a, 0xb3e: 0x18eb, 0xb3f: 0x1292, // Block 0x2d, offset 0xb40 0xb40: 0x17fb, 0xb41: 0x075a, 0xb42: 0x12aa, 0xb43: 0x12ae, 0xb44: 0x0762, 0xb45: 0x12b2, 0xb46: 0x0b2e, 0xb47: 0x18f0, 0xb48: 0x18f5, 0xb49: 0x1800, 0xb4a: 0x1805, 0xb4b: 0x12d2, 0xb4c: 0x12d6, 0xb4d: 0x14ee, 0xb4e: 0x0766, 0xb4f: 0x1302, 0xb50: 0x12fe, 0xb51: 0x1306, 0xb52: 0x093a, 0xb53: 0x130a, 0xb54: 0x130e, 0xb55: 0x1312, 0xb56: 0x131a, 0xb57: 0x18fa, 0xb58: 0x1316, 0xb59: 0x131e, 0xb5a: 0x1332, 0xb5b: 0x1336, 0xb5c: 0x1322, 0xb5d: 0x133a, 0xb5e: 0x134e, 0xb5f: 0x1362, 0xb60: 0x132e, 0xb61: 0x1342, 0xb62: 0x1346, 0xb63: 0x134a, 0xb64: 0x18ff, 0xb65: 0x1909, 0xb66: 0x1904, 0xb67: 0x076a, 0xb68: 0x136a, 0xb69: 0x136e, 0xb6a: 0x1376, 0xb6b: 0x191d, 0xb6c: 0x137a, 0xb6d: 0x190e, 0xb6e: 0x076e, 0xb6f: 0x0772, 0xb70: 0x1913, 0xb71: 0x1918, 0xb72: 0x0776, 0xb73: 0x139a, 0xb74: 0x139e, 0xb75: 0x13a2, 0xb76: 0x13a6, 0xb77: 0x13b2, 0xb78: 0x13ae, 0xb79: 0x13ba, 0xb7a: 0x13b6, 0xb7b: 0x13c6, 0xb7c: 0x13be, 0xb7d: 0x13c2, 0xb7e: 0x13ca, 0xb7f: 0x077a, // Block 0x2e, offset 0xb80 0xb80: 0x13d2, 0xb81: 0x13d6, 0xb82: 0x077e, 0xb83: 0x13e6, 0xb84: 0x13ea, 0xb85: 0x1922, 0xb86: 0x13f6, 0xb87: 0x13fa, 0xb88: 0x0782, 0xb89: 0x1406, 0xb8a: 0x06b6, 0xb8b: 0x1927, 0xb8c: 0x192c, 0xb8d: 0x0786, 0xb8e: 0x078a, 0xb8f: 0x1432, 0xb90: 0x144a, 0xb91: 0x1466, 0xb92: 0x1476, 0xb93: 0x1931, 0xb94: 0x148a, 0xb95: 0x148e, 0xb96: 0x14a6, 0xb97: 0x14b2, 0xb98: 0x193b, 0xb99: 0x178d, 0xb9a: 0x14be, 0xb9b: 0x14ba, 0xb9c: 0x14c6, 0xb9d: 0x1792, 0xb9e: 0x14d2, 0xb9f: 0x14de, 0xba0: 0x1940, 0xba1: 0x1945, 0xba2: 0x151e, 0xba3: 0x152a, 0xba4: 0x1532, 0xba5: 0x194a, 0xba6: 0x1536, 0xba7: 0x1562, 0xba8: 0x156e, 0xba9: 0x1572, 0xbaa: 0x156a, 0xbab: 0x157e, 0xbac: 0x1582, 0xbad: 0x194f, 0xbae: 0x158e, 0xbaf: 0x078e, 0xbb0: 0x1596, 0xbb1: 0x1954, 0xbb2: 0x0792, 0xbb3: 0x15ce, 0xbb4: 0x0bbe, 0xbb5: 0x15e6, 0xbb6: 0x1959, 0xbb7: 0x1963, 0xbb8: 0x0796, 0xbb9: 0x079a, 0xbba: 0x160e, 0xbbb: 0x1968, 0xbbc: 0x079e, 0xbbd: 0x196d, 0xbbe: 0x1626, 0xbbf: 0x1626, // Block 0x2f, offset 0xbc0 0xbc0: 0x162e, 0xbc1: 0x1972, 0xbc2: 0x1646, 0xbc3: 0x07a2, 0xbc4: 0x1656, 0xbc5: 0x1662, 0xbc6: 0x166a, 0xbc7: 0x1672, 0xbc8: 0x07a6, 0xbc9: 0x1977, 0xbca: 0x1686, 0xbcb: 0x16a2, 0xbcc: 0x16ae, 0xbcd: 0x07aa, 0xbce: 0x07ae, 0xbcf: 0x16b2, 0xbd0: 0x197c, 0xbd1: 0x07b2, 0xbd2: 0x1981, 0xbd3: 0x1986, 0xbd4: 0x198b, 0xbd5: 0x16d6, 0xbd6: 0x07b6, 0xbd7: 0x16ea, 0xbd8: 0x16f2, 0xbd9: 0x16f6, 0xbda: 0x16fe, 0xbdb: 0x1706, 0xbdc: 0x170e, 0xbdd: 0x1995, } // nfcIndex: 22 blocks, 1408 entries, 1408 bytes // Block 0 is the zero block. var nfcIndex = [1408]uint8{ // Block 0x0, offset 0x0 // Block 0x1, offset 0x40 // Block 0x2, offset 0x80 // Block 0x3, offset 0xc0 0xc2: 0x2e, 0xc3: 0x01, 0xc4: 0x02, 0xc5: 0x03, 0xc6: 0x2f, 0xc7: 0x04, 0xc8: 0x05, 0xca: 0x30, 0xcb: 0x31, 0xcc: 0x06, 0xcd: 0x07, 0xce: 0x08, 0xcf: 0x32, 0xd0: 0x09, 0xd1: 0x33, 0xd2: 0x34, 0xd3: 0x0a, 0xd6: 0x0b, 0xd7: 0x35, 0xd8: 0x36, 0xd9: 0x0c, 0xdb: 0x37, 0xdc: 0x38, 0xdd: 0x39, 0xdf: 0x3a, 0xe0: 0x02, 0xe1: 0x03, 0xe2: 0x04, 0xe3: 0x05, 0xea: 0x06, 0xeb: 0x07, 0xec: 0x08, 0xed: 0x09, 0xef: 0x0a, 0xf0: 0x13, // Block 0x4, offset 0x100 0x120: 0x3b, 0x121: 0x3c, 0x122: 0x3d, 0x123: 0x0d, 0x124: 0x3e, 0x125: 0x3f, 0x126: 0x40, 0x127: 0x41, 0x128: 0x42, 0x129: 0x43, 0x12a: 0x44, 0x12b: 0x45, 0x12c: 0x40, 0x12d: 0x46, 0x12e: 0x47, 0x12f: 0x48, 0x130: 0x44, 0x131: 0x49, 0x132: 0x4a, 0x133: 0x4b, 0x134: 0x4c, 0x135: 0x4d, 0x137: 0x4e, 0x138: 0x4f, 0x139: 0x50, 0x13a: 0x51, 0x13b: 0x52, 0x13c: 0x53, 0x13d: 0x54, 0x13e: 0x55, 0x13f: 0x56, // Block 0x5, offset 0x140 0x140: 0x57, 0x142: 0x58, 0x144: 0x59, 0x145: 0x5a, 0x146: 0x5b, 0x147: 0x5c, 0x14d: 0x5d, 0x15c: 0x5e, 0x15f: 0x5f, 0x162: 0x60, 0x164: 0x61, 0x168: 0x62, 0x169: 0x63, 0x16a: 0x64, 0x16b: 0x65, 0x16c: 0x0e, 0x16d: 0x66, 0x16e: 0x67, 0x16f: 0x68, 0x170: 0x69, 0x173: 0x6a, 0x177: 0x0f, 0x178: 0x10, 0x179: 0x11, 0x17a: 0x12, 0x17b: 0x13, 0x17c: 0x14, 0x17d: 0x15, 0x17e: 0x16, 0x17f: 0x17, // Block 0x6, offset 0x180 0x180: 0x6b, 0x183: 0x6c, 0x184: 0x6d, 0x186: 0x6e, 0x187: 0x6f, 0x188: 0x70, 0x189: 0x18, 0x18a: 0x19, 0x18b: 0x71, 0x18c: 0x72, 0x1ab: 0x73, 0x1b3: 0x74, 0x1b5: 0x75, 0x1b7: 0x76, // Block 0x7, offset 0x1c0 0x1c0: 0x77, 0x1c1: 0x1a, 0x1c2: 0x1b, 0x1c3: 0x1c, 0x1c4: 0x78, 0x1c5: 0x79, 0x1c9: 0x7a, 0x1cc: 0x7b, 0x1cd: 0x7c, // Block 0x8, offset 0x200 0x219: 0x7d, 0x21a: 0x7e, 0x21b: 0x7f, 0x220: 0x80, 0x223: 0x81, 0x224: 0x82, 0x225: 0x83, 0x226: 0x84, 0x227: 0x85, 0x22a: 0x86, 0x22b: 0x87, 0x22f: 0x88, 0x230: 0x89, 0x231: 0x8a, 0x232: 0x8b, 0x233: 0x8c, 0x234: 0x8d, 0x235: 0x8e, 0x236: 0x8f, 0x237: 0x89, 0x238: 0x8a, 0x239: 0x8b, 0x23a: 0x8c, 0x23b: 0x8d, 0x23c: 0x8e, 0x23d: 0x8f, 0x23e: 0x89, 0x23f: 0x8a, // Block 0x9, offset 0x240 0x240: 0x8b, 0x241: 0x8c, 0x242: 0x8d, 0x243: 0x8e, 0x244: 0x8f, 0x245: 0x89, 0x246: 0x8a, 0x247: 0x8b, 0x248: 0x8c, 0x249: 0x8d, 0x24a: 0x8e, 0x24b: 0x8f, 0x24c: 0x89, 0x24d: 0x8a, 0x24e: 0x8b, 0x24f: 0x8c, 0x250: 0x8d, 0x251: 0x8e, 0x252: 0x8f, 0x253: 0x89, 0x254: 0x8a, 0x255: 0x8b, 0x256: 0x8c, 0x257: 0x8d, 0x258: 0x8e, 0x259: 0x8f, 0x25a: 0x89, 0x25b: 0x8a, 0x25c: 0x8b, 0x25d: 0x8c, 0x25e: 0x8d, 0x25f: 0x8e, 0x260: 0x8f, 0x261: 0x89, 0x262: 0x8a, 0x263: 0x8b, 0x264: 0x8c, 0x265: 0x8d, 0x266: 0x8e, 0x267: 0x8f, 0x268: 0x89, 0x269: 0x8a, 0x26a: 0x8b, 0x26b: 0x8c, 0x26c: 0x8d, 0x26d: 0x8e, 0x26e: 0x8f, 0x26f: 0x89, 0x270: 0x8a, 0x271: 0x8b, 0x272: 0x8c, 0x273: 0x8d, 0x274: 0x8e, 0x275: 0x8f, 0x276: 0x89, 0x277: 0x8a, 0x278: 0x8b, 0x279: 0x8c, 0x27a: 0x8d, 0x27b: 0x8e, 0x27c: 0x8f, 0x27d: 0x89, 0x27e: 0x8a, 0x27f: 0x8b, // Block 0xa, offset 0x280 0x280: 0x8c, 0x281: 0x8d, 0x282: 0x8e, 0x283: 0x8f, 0x284: 0x89, 0x285: 0x8a, 0x286: 0x8b, 0x287: 0x8c, 0x288: 0x8d, 0x289: 0x8e, 0x28a: 0x8f, 0x28b: 0x89, 0x28c: 0x8a, 0x28d: 0x8b, 0x28e: 0x8c, 0x28f: 0x8d, 0x290: 0x8e, 0x291: 0x8f, 0x292: 0x89, 0x293: 0x8a, 0x294: 0x8b, 0x295: 0x8c, 0x296: 0x8d, 0x297: 0x8e, 0x298: 0x8f, 0x299: 0x89, 0x29a: 0x8a, 0x29b: 0x8b, 0x29c: 0x8c, 0x29d: 0x8d, 0x29e: 0x8e, 0x29f: 0x8f, 0x2a0: 0x89, 0x2a1: 0x8a, 0x2a2: 0x8b, 0x2a3: 0x8c, 0x2a4: 0x8d, 0x2a5: 0x8e, 0x2a6: 0x8f, 0x2a7: 0x89, 0x2a8: 0x8a, 0x2a9: 0x8b, 0x2aa: 0x8c, 0x2ab: 0x8d, 0x2ac: 0x8e, 0x2ad: 0x8f, 0x2ae: 0x89, 0x2af: 0x8a, 0x2b0: 0x8b, 0x2b1: 0x8c, 0x2b2: 0x8d, 0x2b3: 0x8e, 0x2b4: 0x8f, 0x2b5: 0x89, 0x2b6: 0x8a, 0x2b7: 0x8b, 0x2b8: 0x8c, 0x2b9: 0x8d, 0x2ba: 0x8e, 0x2bb: 0x8f, 0x2bc: 0x89, 0x2bd: 0x8a, 0x2be: 0x8b, 0x2bf: 0x8c, // Block 0xb, offset 0x2c0 0x2c0: 0x8d, 0x2c1: 0x8e, 0x2c2: 0x8f, 0x2c3: 0x89, 0x2c4: 0x8a, 0x2c5: 0x8b, 0x2c6: 0x8c, 0x2c7: 0x8d, 0x2c8: 0x8e, 0x2c9: 0x8f, 0x2ca: 0x89, 0x2cb: 0x8a, 0x2cc: 0x8b, 0x2cd: 0x8c, 0x2ce: 0x8d, 0x2cf: 0x8e, 0x2d0: 0x8f, 0x2d1: 0x89, 0x2d2: 0x8a, 0x2d3: 0x8b, 0x2d4: 0x8c, 0x2d5: 0x8d, 0x2d6: 0x8e, 0x2d7: 0x8f, 0x2d8: 0x89, 0x2d9: 0x8a, 0x2da: 0x8b, 0x2db: 0x8c, 0x2dc: 0x8d, 0x2dd: 0x8e, 0x2de: 0x90, // Block 0xc, offset 0x300 0x324: 0x1d, 0x325: 0x1e, 0x326: 0x1f, 0x327: 0x20, 0x328: 0x21, 0x329: 0x22, 0x32a: 0x23, 0x32b: 0x24, 0x32c: 0x91, 0x32d: 0x92, 0x32e: 0x93, 0x331: 0x94, 0x332: 0x95, 0x333: 0x96, 0x334: 0x97, 0x338: 0x98, 0x339: 0x99, 0x33a: 0x9a, 0x33b: 0x9b, 0x33e: 0x9c, 0x33f: 0x9d, // Block 0xd, offset 0x340 0x347: 0x9e, 0x34b: 0x9f, 0x34d: 0xa0, 0x357: 0xa1, 0x368: 0xa2, 0x36b: 0xa3, 0x374: 0xa4, 0x375: 0xa5, 0x37a: 0xa6, 0x37b: 0xa7, 0x37d: 0xa8, 0x37e: 0xa9, // Block 0xe, offset 0x380 0x381: 0xaa, 0x382: 0xab, 0x384: 0xac, 0x385: 0x84, 0x387: 0xad, 0x388: 0xae, 0x38b: 0xaf, 0x38c: 0xb0, 0x38d: 0xb1, 0x38e: 0xb2, 0x38f: 0xb3, 0x391: 0xb4, 0x392: 0xb5, 0x393: 0xb6, 0x396: 0xb7, 0x397: 0xb8, 0x398: 0x75, 0x39a: 0xb9, 0x39c: 0xba, 0x3a0: 0xbb, 0x3a4: 0xbc, 0x3a5: 0xbd, 0x3a7: 0xbe, 0x3a8: 0xbf, 0x3a9: 0xc0, 0x3aa: 0xc1, 0x3b0: 0x75, 0x3b5: 0xc2, 0x3b6: 0xc3, 0x3bd: 0xc4, // Block 0xf, offset 0x3c0 0x3c4: 0xc5, 0x3eb: 0xc6, 0x3ec: 0xc7, 0x3f5: 0xc8, 0x3ff: 0xc9, // Block 0x10, offset 0x400 0x432: 0xca, // Block 0x11, offset 0x440 0x445: 0xcb, 0x446: 0xcc, 0x447: 0xcd, 0x449: 0xce, // Block 0x12, offset 0x480 0x480: 0xcf, 0x482: 0xd0, 0x484: 0xc7, 0x48a: 0xd1, 0x48b: 0xd2, 0x493: 0xd3, 0x497: 0xd4, 0x49b: 0xd5, 0x4a3: 0xd6, 0x4a5: 0xd7, // Block 0x13, offset 0x4c0 0x4c8: 0xd8, // Block 0x14, offset 0x500 0x520: 0x25, 0x521: 0x26, 0x522: 0x27, 0x523: 0x28, 0x524: 0x29, 0x525: 0x2a, 0x526: 0x2b, 0x527: 0x2c, 0x528: 0x2d, // Block 0x15, offset 0x540 0x550: 0x0b, 0x551: 0x0c, 0x556: 0x0d, 0x55b: 0x0e, 0x55d: 0x0f, 0x55e: 0x10, 0x55f: 0x11, 0x56f: 0x12, } // nfcSparseOffset: 171 entries, 342 bytes var nfcSparseOffset = []uint16{0x0, 0x5, 0x9, 0xb, 0xd, 0x18, 0x28, 0x2a, 0x2f, 0x3a, 0x49, 0x56, 0x5e, 0x63, 0x68, 0x6a, 0x6e, 0x76, 0x7d, 0x80, 0x88, 0x8c, 0x90, 0x92, 0x94, 0x9d, 0xa1, 0xa8, 0xad, 0xb0, 0xba, 0xbd, 0xc4, 0xcc, 0xcf, 0xd1, 0xd4, 0xd6, 0xdb, 0xec, 0xf8, 0xfa, 0x100, 0x102, 0x104, 0x106, 0x108, 0x10a, 0x10c, 0x10f, 0x112, 0x114, 0x117, 0x11a, 0x11e, 0x124, 0x130, 0x139, 0x13b, 0x13e, 0x140, 0x14b, 0x14f, 0x15d, 0x160, 0x166, 0x16c, 0x177, 0x17b, 0x17d, 0x17f, 0x181, 0x183, 0x185, 0x18b, 0x18f, 0x191, 0x193, 0x19b, 0x19f, 0x1a2, 0x1a4, 0x1a6, 0x1a9, 0x1ac, 0x1ae, 0x1b0, 0x1b2, 0x1b4, 0x1ba, 0x1bd, 0x1bf, 0x1c6, 0x1cc, 0x1d2, 0x1da, 0x1e0, 0x1e6, 0x1ec, 0x1f0, 0x1fe, 0x207, 0x20a, 0x20d, 0x20f, 0x212, 0x214, 0x218, 0x21d, 0x21f, 0x221, 0x226, 0x22c, 0x22e, 0x230, 0x232, 0x237, 0x23d, 0x240, 0x242, 0x244, 0x246, 0x249, 0x24f, 0x253, 0x257, 0x25f, 0x266, 0x269, 0x26c, 0x26e, 0x271, 0x279, 0x283, 0x28a, 0x28e, 0x295, 0x298, 0x29e, 0x2a0, 0x2a3, 0x2a5, 0x2a8, 0x2ad, 0x2af, 0x2b1, 0x2b3, 0x2b5, 0x2b7, 0x2ba, 0x2bc, 0x2be, 0x2cb, 0x2cd, 0x2cf, 0x2d5, 0x2d7, 0x2d9, 0x2e6, 0x2f0, 0x2f2, 0x2f4, 0x2fa, 0x2fc, 0x2fe, 0x300, 0x304, 0x307, 0x30c, 0x30e, 0x311} // nfcSparseValues: 787 entries, 3148 bytes var nfcSparseValues = [787]valueRange{ // Block 0x0, offset 0x0 {value: 0x0000, lo: 0x04}, {value: 0xa100, lo: 0xa8, hi: 0xa8}, {value: 0x8100, lo: 0xaf, hi: 0xaf}, {value: 0x8100, lo: 0xb4, hi: 0xb4}, {value: 0x8100, lo: 0xb8, hi: 0xb8}, // Block 0x1, offset 0x5 {value: 0x0091, lo: 0x03}, {value: 0x4859, lo: 0xa0, hi: 0xa1}, {value: 0x488b, lo: 0xaf, hi: 0xb0}, {value: 0xa000, lo: 0xb7, hi: 0xb7}, // Block 0x2, offset 0x9 {value: 0x0000, lo: 0x01}, {value: 0xa000, lo: 0x92, hi: 0x92}, // Block 0x3, offset 0xb {value: 0x0000, lo: 0x01}, {value: 0x8100, lo: 0x98, hi: 0x9d}, // Block 0x4, offset 0xd {value: 0x0006, lo: 0x0a}, {value: 0xa000, lo: 0x81, hi: 0x81}, {value: 0xa000, lo: 0x85, hi: 0x85}, {value: 0xa000, lo: 0x89, hi: 0x89}, {value: 0x49b7, lo: 0x8a, hi: 0x8a}, {value: 0x49d5, lo: 0x8b, hi: 0x8b}, {value: 0x3626, lo: 0x8c, hi: 0x8c}, {value: 0x363e, lo: 0x8d, hi: 0x8d}, {value: 0x49ed, lo: 0x8e, hi: 0x8e}, {value: 0xa000, lo: 0x92, hi: 0x92}, {value: 0x365c, lo: 0x93, hi: 0x94}, // Block 0x5, offset 0x18 {value: 0x0000, lo: 0x0f}, {value: 0xa000, lo: 0x83, hi: 0x83}, {value: 0xa000, lo: 0x87, hi: 0x87}, {value: 0xa000, lo: 0x8b, hi: 0x8b}, {value: 0xa000, lo: 0x8d, hi: 0x8d}, {value: 0x3704, lo: 0x90, hi: 0x90}, {value: 0x3710, lo: 0x91, hi: 0x91}, {value: 0x36fe, lo: 0x93, hi: 0x93}, {value: 0xa000, lo: 0x96, hi: 0x96}, {value: 0x3776, lo: 0x97, hi: 0x97}, {value: 0x3740, lo: 0x9c, hi: 0x9c}, {value: 0x3728, lo: 0x9d, hi: 0x9d}, {value: 0x3752, lo: 0x9e, hi: 0x9e}, {value: 0xa000, lo: 0xb4, hi: 0xb5}, {value: 0x377c, lo: 0xb6, hi: 0xb6}, {value: 0x3782, lo: 0xb7, hi: 0xb7}, // Block 0x6, offset 0x28 {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0x83, hi: 0x87}, // Block 0x7, offset 0x2a {value: 0x0001, lo: 0x04}, {value: 0x8114, lo: 0x81, hi: 0x82}, {value: 0x8133, lo: 0x84, hi: 0x84}, {value: 0x812e, lo: 0x85, hi: 0x85}, {value: 0x810e, lo: 0x87, hi: 0x87}, // Block 0x8, offset 0x2f {value: 0x0000, lo: 0x0a}, {value: 0x8133, lo: 0x90, hi: 0x97}, {value: 0x811a, lo: 0x98, hi: 0x98}, {value: 0x811b, lo: 0x99, hi: 0x99}, {value: 0x811c, lo: 0x9a, hi: 0x9a}, {value: 0x37a0, lo: 0xa2, hi: 0xa2}, {value: 0x37a6, lo: 0xa3, hi: 0xa3}, {value: 0x37b2, lo: 0xa4, hi: 0xa4}, {value: 0x37ac, lo: 0xa5, hi: 0xa5}, {value: 0x37b8, lo: 0xa6, hi: 0xa6}, {value: 0xa000, lo: 0xa7, hi: 0xa7}, // Block 0x9, offset 0x3a {value: 0x0000, lo: 0x0e}, {value: 0x37ca, lo: 0x80, hi: 0x80}, {value: 0xa000, lo: 0x81, hi: 0x81}, {value: 0x37be, lo: 0x82, hi: 0x82}, {value: 0xa000, lo: 0x92, hi: 0x92}, {value: 0x37c4, lo: 0x93, hi: 0x93}, {value: 0xa000, lo: 0x95, hi: 0x95}, {value: 0x8133, lo: 0x96, hi: 0x9c}, {value: 0x8133, lo: 0x9f, hi: 0xa2}, {value: 0x812e, lo: 0xa3, hi: 0xa3}, {value: 0x8133, lo: 0xa4, hi: 0xa4}, {value: 0x8133, lo: 0xa7, hi: 0xa8}, {value: 0x812e, lo: 0xaa, hi: 0xaa}, {value: 0x8133, lo: 0xab, hi: 0xac}, {value: 0x812e, lo: 0xad, hi: 0xad}, // Block 0xa, offset 0x49 {value: 0x0000, lo: 0x0c}, {value: 0x8120, lo: 0x91, hi: 0x91}, {value: 0x8133, lo: 0xb0, hi: 0xb0}, {value: 0x812e, lo: 0xb1, hi: 0xb1}, {value: 0x8133, lo: 0xb2, hi: 0xb3}, {value: 0x812e, lo: 0xb4, hi: 0xb4}, {value: 0x8133, lo: 0xb5, hi: 0xb6}, {value: 0x812e, lo: 0xb7, hi: 0xb9}, {value: 0x8133, lo: 0xba, hi: 0xba}, {value: 0x812e, lo: 0xbb, hi: 0xbc}, {value: 0x8133, lo: 0xbd, hi: 0xbd}, {value: 0x812e, lo: 0xbe, hi: 0xbe}, {value: 0x8133, lo: 0xbf, hi: 0xbf}, // Block 0xb, offset 0x56 {value: 0x0005, lo: 0x07}, {value: 0x8133, lo: 0x80, hi: 0x80}, {value: 0x8133, lo: 0x81, hi: 0x81}, {value: 0x812e, lo: 0x82, hi: 0x83}, {value: 0x812e, lo: 0x84, hi: 0x85}, {value: 0x812e, lo: 0x86, hi: 0x87}, {value: 0x812e, lo: 0x88, hi: 0x89}, {value: 0x8133, lo: 0x8a, hi: 0x8a}, // Block 0xc, offset 0x5e {value: 0x0000, lo: 0x04}, {value: 0x8133, lo: 0xab, hi: 0xb1}, {value: 0x812e, lo: 0xb2, hi: 0xb2}, {value: 0x8133, lo: 0xb3, hi: 0xb3}, {value: 0x812e, lo: 0xbd, hi: 0xbd}, // Block 0xd, offset 0x63 {value: 0x0000, lo: 0x04}, {value: 0x8133, lo: 0x96, hi: 0x99}, {value: 0x8133, lo: 0x9b, hi: 0xa3}, {value: 0x8133, lo: 0xa5, hi: 0xa7}, {value: 0x8133, lo: 0xa9, hi: 0xad}, // Block 0xe, offset 0x68 {value: 0x0000, lo: 0x01}, {value: 0x812e, lo: 0x99, hi: 0x9b}, // Block 0xf, offset 0x6a {value: 0x0000, lo: 0x03}, {value: 0x8133, lo: 0x97, hi: 0x98}, {value: 0x812e, lo: 0x99, hi: 0x9b}, {value: 0x8133, lo: 0x9c, hi: 0x9f}, // Block 0x10, offset 0x6e {value: 0x0000, lo: 0x07}, {value: 0xa000, lo: 0xa8, hi: 0xa8}, {value: 0x3e37, lo: 0xa9, hi: 0xa9}, {value: 0xa000, lo: 0xb0, hi: 0xb0}, {value: 0x3e3f, lo: 0xb1, hi: 0xb1}, {value: 0xa000, lo: 0xb3, hi: 0xb3}, {value: 0x3e47, lo: 0xb4, hi: 0xb4}, {value: 0x9903, lo: 0xbc, hi: 0xbc}, // Block 0x11, offset 0x76 {value: 0x0008, lo: 0x06}, {value: 0x8105, lo: 0x8d, hi: 0x8d}, {value: 0x8133, lo: 0x91, hi: 0x91}, {value: 0x812e, lo: 0x92, hi: 0x92}, {value: 0x8133, lo: 0x93, hi: 0x93}, {value: 0x8133, lo: 0x94, hi: 0x94}, {value: 0x461b, lo: 0x98, hi: 0x9f}, // Block 0x12, offset 0x7d {value: 0x0000, lo: 0x02}, {value: 0x8103, lo: 0xbc, hi: 0xbc}, {value: 0x9900, lo: 0xbe, hi: 0xbe}, // Block 0x13, offset 0x80 {value: 0x0008, lo: 0x07}, {value: 0xa000, lo: 0x87, hi: 0x87}, {value: 0x3e4f, lo: 0x8b, hi: 0x8c}, {value: 0x8105, lo: 0x8d, hi: 0x8d}, {value: 0x9900, lo: 0x97, hi: 0x97}, {value: 0x465b, lo: 0x9c, hi: 0x9d}, {value: 0x466b, lo: 0x9f, hi: 0x9f}, {value: 0x8133, lo: 0xbe, hi: 0xbe}, // Block 0x14, offset 0x88 {value: 0x0000, lo: 0x03}, {value: 0x4693, lo: 0xb3, hi: 0xb3}, {value: 0x469b, lo: 0xb6, hi: 0xb6}, {value: 0x8103, lo: 0xbc, hi: 0xbc}, // Block 0x15, offset 0x8c {value: 0x0008, lo: 0x03}, {value: 0x8105, lo: 0x8d, hi: 0x8d}, {value: 0x4673, lo: 0x99, hi: 0x9b}, {value: 0x468b, lo: 0x9e, hi: 0x9e}, // Block 0x16, offset 0x90 {value: 0x0000, lo: 0x01}, {value: 0x8103, lo: 0xbc, hi: 0xbc}, // Block 0x17, offset 0x92 {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0x8d, hi: 0x8d}, // Block 0x18, offset 0x94 {value: 0x0000, lo: 0x08}, {value: 0xa000, lo: 0x87, hi: 0x87}, {value: 0x3e67, lo: 0x88, hi: 0x88}, {value: 0x3e5f, lo: 0x8b, hi: 0x8b}, {value: 0x3e6f, lo: 0x8c, hi: 0x8c}, {value: 0x8105, lo: 0x8d, hi: 0x8d}, {value: 0x9900, lo: 0x96, hi: 0x97}, {value: 0x46a3, lo: 0x9c, hi: 0x9c}, {value: 0x46ab, lo: 0x9d, hi: 0x9d}, // Block 0x19, offset 0x9d {value: 0x0000, lo: 0x03}, {value: 0xa000, lo: 0x92, hi: 0x92}, {value: 0x3e77, lo: 0x94, hi: 0x94}, {value: 0x9900, lo: 0xbe, hi: 0xbe}, // Block 0x1a, offset 0xa1 {value: 0x0000, lo: 0x06}, {value: 0xa000, lo: 0x86, hi: 0x87}, {value: 0x3e7f, lo: 0x8a, hi: 0x8a}, {value: 0x3e8f, lo: 0x8b, hi: 0x8b}, {value: 0x3e87, lo: 0x8c, hi: 0x8c}, {value: 0x8105, lo: 0x8d, hi: 0x8d}, {value: 0x9900, lo: 0x97, hi: 0x97}, // Block 0x1b, offset 0xa8 {value: 0x1801, lo: 0x04}, {value: 0xa000, lo: 0x86, hi: 0x86}, {value: 0x3e97, lo: 0x88, hi: 0x88}, {value: 0x8105, lo: 0x8d, hi: 0x8d}, {value: 0x8121, lo: 0x95, hi: 0x96}, // Block 0x1c, offset 0xad {value: 0x0000, lo: 0x02}, {value: 0x8103, lo: 0xbc, hi: 0xbc}, {value: 0xa000, lo: 0xbf, hi: 0xbf}, // Block 0x1d, offset 0xb0 {value: 0x0000, lo: 0x09}, {value: 0x3e9f, lo: 0x80, hi: 0x80}, {value: 0x9900, lo: 0x82, hi: 0x82}, {value: 0xa000, lo: 0x86, hi: 0x86}, {value: 0x3ea7, lo: 0x87, hi: 0x87}, {value: 0x3eaf, lo: 0x88, hi: 0x88}, {value: 0x4b25, lo: 0x8a, hi: 0x8a}, {value: 0x4331, lo: 0x8b, hi: 0x8b}, {value: 0x8105, lo: 0x8d, hi: 0x8d}, {value: 0x9900, lo: 0x95, hi: 0x96}, // Block 0x1e, offset 0xba {value: 0x0000, lo: 0x02}, {value: 0x8105, lo: 0xbb, hi: 0xbc}, {value: 0x9900, lo: 0xbe, hi: 0xbe}, // Block 0x1f, offset 0xbd {value: 0x0000, lo: 0x06}, {value: 0xa000, lo: 0x86, hi: 0x87}, {value: 0x3eb7, lo: 0x8a, hi: 0x8a}, {value: 0x3ec7, lo: 0x8b, hi: 0x8b}, {value: 0x3ebf, lo: 0x8c, hi: 0x8c}, {value: 0x8105, lo: 0x8d, hi: 0x8d}, {value: 0x9900, lo: 0x97, hi: 0x97}, // Block 0x20, offset 0xc4 {value: 0x5a29, lo: 0x07}, {value: 0x9905, lo: 0x8a, hi: 0x8a}, {value: 0x9900, lo: 0x8f, hi: 0x8f}, {value: 0xa000, lo: 0x99, hi: 0x99}, {value: 0x3ecf, lo: 0x9a, hi: 0x9a}, {value: 0x4b2d, lo: 0x9c, hi: 0x9c}, {value: 0x433c, lo: 0x9d, hi: 0x9d}, {value: 0x3ed7, lo: 0x9e, hi: 0x9f}, // Block 0x21, offset 0xcc {value: 0x0000, lo: 0x02}, {value: 0x8123, lo: 0xb8, hi: 0xb9}, {value: 0x8105, lo: 0xba, hi: 0xba}, // Block 0x22, offset 0xcf {value: 0x0000, lo: 0x01}, {value: 0x8124, lo: 0x88, hi: 0x8b}, // Block 0x23, offset 0xd1 {value: 0x0000, lo: 0x02}, {value: 0x8125, lo: 0xb8, hi: 0xb9}, {value: 0x8105, lo: 0xba, hi: 0xba}, // Block 0x24, offset 0xd4 {value: 0x0000, lo: 0x01}, {value: 0x8126, lo: 0x88, hi: 0x8b}, // Block 0x25, offset 0xd6 {value: 0x0000, lo: 0x04}, {value: 0x812e, lo: 0x98, hi: 0x99}, {value: 0x812e, lo: 0xb5, hi: 0xb5}, {value: 0x812e, lo: 0xb7, hi: 0xb7}, {value: 0x812c, lo: 0xb9, hi: 0xb9}, // Block 0x26, offset 0xdb {value: 0x0000, lo: 0x10}, {value: 0x2774, lo: 0x83, hi: 0x83}, {value: 0x277b, lo: 0x8d, hi: 0x8d}, {value: 0x2782, lo: 0x92, hi: 0x92}, {value: 0x2789, lo: 0x97, hi: 0x97}, {value: 0x2790, lo: 0x9c, hi: 0x9c}, {value: 0x276d, lo: 0xa9, hi: 0xa9}, {value: 0x8127, lo: 0xb1, hi: 0xb1}, {value: 0x8128, lo: 0xb2, hi: 0xb2}, {value: 0x4ca5, lo: 0xb3, hi: 0xb3}, {value: 0x8129, lo: 0xb4, hi: 0xb4}, {value: 0x4cae, lo: 0xb5, hi: 0xb5}, {value: 0x46b3, lo: 0xb6, hi: 0xb6}, {value: 0x8200, lo: 0xb7, hi: 0xb7}, {value: 0x46bb, lo: 0xb8, hi: 0xb8}, {value: 0x8200, lo: 0xb9, hi: 0xb9}, {value: 0x8128, lo: 0xba, hi: 0xbd}, // Block 0x27, offset 0xec {value: 0x0000, lo: 0x0b}, {value: 0x8128, lo: 0x80, hi: 0x80}, {value: 0x4cb7, lo: 0x81, hi: 0x81}, {value: 0x8133, lo: 0x82, hi: 0x83}, {value: 0x8105, lo: 0x84, hi: 0x84}, {value: 0x8133, lo: 0x86, hi: 0x87}, {value: 0x279e, lo: 0x93, hi: 0x93}, {value: 0x27a5, lo: 0x9d, hi: 0x9d}, {value: 0x27ac, lo: 0xa2, hi: 0xa2}, {value: 0x27b3, lo: 0xa7, hi: 0xa7}, {value: 0x27ba, lo: 0xac, hi: 0xac}, {value: 0x2797, lo: 0xb9, hi: 0xb9}, // Block 0x28, offset 0xf8 {value: 0x0000, lo: 0x01}, {value: 0x812e, lo: 0x86, hi: 0x86}, // Block 0x29, offset 0xfa {value: 0x0000, lo: 0x05}, {value: 0xa000, lo: 0xa5, hi: 0xa5}, {value: 0x3edf, lo: 0xa6, hi: 0xa6}, {value: 0x9900, lo: 0xae, hi: 0xae}, {value: 0x8103, lo: 0xb7, hi: 0xb7}, {value: 0x8105, lo: 0xb9, hi: 0xba}, // Block 0x2a, offset 0x100 {value: 0x0000, lo: 0x01}, {value: 0x812e, lo: 0x8d, hi: 0x8d}, // Block 0x2b, offset 0x102 {value: 0x0000, lo: 0x01}, {value: 0xa000, lo: 0x80, hi: 0x92}, // Block 0x2c, offset 0x104 {value: 0x0000, lo: 0x01}, {value: 0xb900, lo: 0xa1, hi: 0xb5}, // Block 0x2d, offset 0x106 {value: 0x0000, lo: 0x01}, {value: 0x9900, lo: 0xa8, hi: 0xbf}, // Block 0x2e, offset 0x108 {value: 0x0000, lo: 0x01}, {value: 0x9900, lo: 0x80, hi: 0x82}, // Block 0x2f, offset 0x10a {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0x9d, hi: 0x9f}, // Block 0x30, offset 0x10c {value: 0x0000, lo: 0x02}, {value: 0x8105, lo: 0x94, hi: 0x95}, {value: 0x8105, lo: 0xb4, hi: 0xb4}, // Block 0x31, offset 0x10f {value: 0x0000, lo: 0x02}, {value: 0x8105, lo: 0x92, hi: 0x92}, {value: 0x8133, lo: 0x9d, hi: 0x9d}, // Block 0x32, offset 0x112 {value: 0x0000, lo: 0x01}, {value: 0x8132, lo: 0xa9, hi: 0xa9}, // Block 0x33, offset 0x114 {value: 0x0004, lo: 0x02}, {value: 0x812f, lo: 0xb9, hi: 0xba}, {value: 0x812e, lo: 0xbb, hi: 0xbb}, // Block 0x34, offset 0x117 {value: 0x0000, lo: 0x02}, {value: 0x8133, lo: 0x97, hi: 0x97}, {value: 0x812e, lo: 0x98, hi: 0x98}, // Block 0x35, offset 0x11a {value: 0x0000, lo: 0x03}, {value: 0x8105, lo: 0xa0, hi: 0xa0}, {value: 0x8133, lo: 0xb5, hi: 0xbc}, {value: 0x812e, lo: 0xbf, hi: 0xbf}, // Block 0x36, offset 0x11e {value: 0x0000, lo: 0x05}, {value: 0x8133, lo: 0xb0, hi: 0xb4}, {value: 0x812e, lo: 0xb5, hi: 0xba}, {value: 0x8133, lo: 0xbb, hi: 0xbc}, {value: 0x812e, lo: 0xbd, hi: 0xbd}, {value: 0x812e, lo: 0xbf, hi: 0xbf}, // Block 0x37, offset 0x124 {value: 0x0000, lo: 0x0b}, {value: 0x812e, lo: 0x80, hi: 0x80}, {value: 0x8133, lo: 0x81, hi: 0x82}, {value: 0x812e, lo: 0x83, hi: 0x84}, {value: 0x8133, lo: 0x85, hi: 0x89}, {value: 0x812e, lo: 0x8a, hi: 0x8a}, {value: 0x8133, lo: 0x8b, hi: 0x9c}, {value: 0x812e, lo: 0x9d, hi: 0x9d}, {value: 0x8133, lo: 0xa0, hi: 0xa5}, {value: 0x812e, lo: 0xa6, hi: 0xa6}, {value: 0x8133, lo: 0xa7, hi: 0xaa}, {value: 0x8136, lo: 0xab, hi: 0xab}, // Block 0x38, offset 0x130 {value: 0x0000, lo: 0x08}, {value: 0x3f27, lo: 0x80, hi: 0x80}, {value: 0x3f2f, lo: 0x81, hi: 0x81}, {value: 0xa000, lo: 0x82, hi: 0x82}, {value: 0x3f37, lo: 0x83, hi: 0x83}, {value: 0x8105, lo: 0x84, hi: 0x84}, {value: 0x8133, lo: 0xab, hi: 0xab}, {value: 0x812e, lo: 0xac, hi: 0xac}, {value: 0x8133, lo: 0xad, hi: 0xb3}, // Block 0x39, offset 0x139 {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0xaa, hi: 0xab}, // Block 0x3a, offset 0x13b {value: 0x0000, lo: 0x02}, {value: 0x8103, lo: 0xa6, hi: 0xa6}, {value: 0x8105, lo: 0xb2, hi: 0xb3}, // Block 0x3b, offset 0x13e {value: 0x0000, lo: 0x01}, {value: 0x8103, lo: 0xb7, hi: 0xb7}, // Block 0x3c, offset 0x140 {value: 0x0000, lo: 0x0a}, {value: 0x8133, lo: 0x90, hi: 0x92}, {value: 0x8101, lo: 0x94, hi: 0x94}, {value: 0x812e, lo: 0x95, hi: 0x99}, {value: 0x8133, lo: 0x9a, hi: 0x9b}, {value: 0x812e, lo: 0x9c, hi: 0x9f}, {value: 0x8133, lo: 0xa0, hi: 0xa0}, {value: 0x8101, lo: 0xa2, hi: 0xa8}, {value: 0x812e, lo: 0xad, hi: 0xad}, {value: 0x8133, lo: 0xb4, hi: 0xb4}, {value: 0x8133, lo: 0xb8, hi: 0xb9}, // Block 0x3d, offset 0x14b {value: 0x0004, lo: 0x03}, {value: 0x052a, lo: 0x80, hi: 0x81}, {value: 0x8100, lo: 0x97, hi: 0x97}, {value: 0x8100, lo: 0xbe, hi: 0xbe}, // Block 0x3e, offset 0x14f {value: 0x0000, lo: 0x0d}, {value: 0x8133, lo: 0x90, hi: 0x91}, {value: 0x8101, lo: 0x92, hi: 0x93}, {value: 0x8133, lo: 0x94, hi: 0x97}, {value: 0x8101, lo: 0x98, hi: 0x9a}, {value: 0x8133, lo: 0x9b, hi: 0x9c}, {value: 0x8133, lo: 0xa1, hi: 0xa1}, {value: 0x8101, lo: 0xa5, hi: 0xa6}, {value: 0x8133, lo: 0xa7, hi: 0xa7}, {value: 0x812e, lo: 0xa8, hi: 0xa8}, {value: 0x8133, lo: 0xa9, hi: 0xa9}, {value: 0x8101, lo: 0xaa, hi: 0xab}, {value: 0x812e, lo: 0xac, hi: 0xaf}, {value: 0x8133, lo: 0xb0, hi: 0xb0}, // Block 0x3f, offset 0x15d {value: 0x437a, lo: 0x02}, {value: 0x023c, lo: 0xa6, hi: 0xa6}, {value: 0x0057, lo: 0xaa, hi: 0xab}, // Block 0x40, offset 0x160 {value: 0x0007, lo: 0x05}, {value: 0xa000, lo: 0x90, hi: 0x90}, {value: 0xa000, lo: 0x92, hi: 0x92}, {value: 0xa000, lo: 0x94, hi: 0x94}, {value: 0x3b18, lo: 0x9a, hi: 0x9b}, {value: 0x3b26, lo: 0xae, hi: 0xae}, // Block 0x41, offset 0x166 {value: 0x000e, lo: 0x05}, {value: 0x3b2d, lo: 0x8d, hi: 0x8e}, {value: 0x3b34, lo: 0x8f, hi: 0x8f}, {value: 0xa000, lo: 0x90, hi: 0x90}, {value: 0xa000, lo: 0x92, hi: 0x92}, {value: 0xa000, lo: 0x94, hi: 0x94}, // Block 0x42, offset 0x16c {value: 0x64a9, lo: 0x0a}, {value: 0xa000, lo: 0x83, hi: 0x83}, {value: 0x3b42, lo: 0x84, hi: 0x84}, {value: 0xa000, lo: 0x88, hi: 0x88}, {value: 0x3b49, lo: 0x89, hi: 0x89}, {value: 0xa000, lo: 0x8b, hi: 0x8b}, {value: 0x3b50, lo: 0x8c, hi: 0x8c}, {value: 0xa000, lo: 0xa3, hi: 0xa3}, {value: 0x3b57, lo: 0xa4, hi: 0xa5}, {value: 0x3b5e, lo: 0xa6, hi: 0xa6}, {value: 0xa000, lo: 0xbc, hi: 0xbc}, // Block 0x43, offset 0x177 {value: 0x0007, lo: 0x03}, {value: 0x3bc7, lo: 0xa0, hi: 0xa1}, {value: 0x3bf1, lo: 0xa2, hi: 0xa3}, {value: 0x3c1b, lo: 0xaa, hi: 0xad}, // Block 0x44, offset 0x17b {value: 0x0004, lo: 0x01}, {value: 0x0586, lo: 0xa9, hi: 0xaa}, // Block 0x45, offset 0x17d {value: 0x0000, lo: 0x01}, {value: 0x45dc, lo: 0x9c, hi: 0x9c}, // Block 0x46, offset 0x17f {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0xaf, hi: 0xb1}, // Block 0x47, offset 0x181 {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0xbf, hi: 0xbf}, // Block 0x48, offset 0x183 {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0xa0, hi: 0xbf}, // Block 0x49, offset 0x185 {value: 0x0000, lo: 0x05}, {value: 0x812d, lo: 0xaa, hi: 0xaa}, {value: 0x8132, lo: 0xab, hi: 0xab}, {value: 0x8134, lo: 0xac, hi: 0xac}, {value: 0x812f, lo: 0xad, hi: 0xad}, {value: 0x8130, lo: 0xae, hi: 0xaf}, // Block 0x4a, offset 0x18b {value: 0x0000, lo: 0x03}, {value: 0x4cc0, lo: 0xb3, hi: 0xb3}, {value: 0x4cc0, lo: 0xb5, hi: 0xb6}, {value: 0x4cc0, lo: 0xba, hi: 0xbf}, // Block 0x4b, offset 0x18f {value: 0x0000, lo: 0x01}, {value: 0x4cc0, lo: 0x8f, hi: 0xa3}, // Block 0x4c, offset 0x191 {value: 0x0000, lo: 0x01}, {value: 0x8100, lo: 0xae, hi: 0xbe}, // Block 0x4d, offset 0x193 {value: 0x0000, lo: 0x07}, {value: 0x8100, lo: 0x84, hi: 0x84}, {value: 0x8100, lo: 0x87, hi: 0x87}, {value: 0x8100, lo: 0x90, hi: 0x90}, {value: 0x8100, lo: 0x9e, hi: 0x9e}, {value: 0x8100, lo: 0xa1, hi: 0xa1}, {value: 0x8100, lo: 0xb2, hi: 0xb2}, {value: 0x8100, lo: 0xbb, hi: 0xbb}, // Block 0x4e, offset 0x19b {value: 0x0000, lo: 0x03}, {value: 0x8100, lo: 0x80, hi: 0x80}, {value: 0x8100, lo: 0x8b, hi: 0x8b}, {value: 0x8100, lo: 0x8e, hi: 0x8e}, // Block 0x4f, offset 0x19f {value: 0x0000, lo: 0x02}, {value: 0x8133, lo: 0xaf, hi: 0xaf}, {value: 0x8133, lo: 0xb4, hi: 0xbd}, // Block 0x50, offset 0x1a2 {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0x9e, hi: 0x9f}, // Block 0x51, offset 0x1a4 {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0xb0, hi: 0xb1}, // Block 0x52, offset 0x1a6 {value: 0x0000, lo: 0x02}, {value: 0x8105, lo: 0x86, hi: 0x86}, {value: 0x8105, lo: 0xac, hi: 0xac}, // Block 0x53, offset 0x1a9 {value: 0x0000, lo: 0x02}, {value: 0x8105, lo: 0x84, hi: 0x84}, {value: 0x8133, lo: 0xa0, hi: 0xb1}, // Block 0x54, offset 0x1ac {value: 0x0000, lo: 0x01}, {value: 0x812e, lo: 0xab, hi: 0xad}, // Block 0x55, offset 0x1ae {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0x93, hi: 0x93}, // Block 0x56, offset 0x1b0 {value: 0x0000, lo: 0x01}, {value: 0x8103, lo: 0xb3, hi: 0xb3}, // Block 0x57, offset 0x1b2 {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0x80, hi: 0x80}, // Block 0x58, offset 0x1b4 {value: 0x0000, lo: 0x05}, {value: 0x8133, lo: 0xb0, hi: 0xb0}, {value: 0x8133, lo: 0xb2, hi: 0xb3}, {value: 0x812e, lo: 0xb4, hi: 0xb4}, {value: 0x8133, lo: 0xb7, hi: 0xb8}, {value: 0x8133, lo: 0xbe, hi: 0xbf}, // Block 0x59, offset 0x1ba {value: 0x0000, lo: 0x02}, {value: 0x8133, lo: 0x81, hi: 0x81}, {value: 0x8105, lo: 0xb6, hi: 0xb6}, // Block 0x5a, offset 0x1bd {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0xad, hi: 0xad}, // Block 0x5b, offset 0x1bf {value: 0x0000, lo: 0x06}, {value: 0xe500, lo: 0x80, hi: 0x80}, {value: 0xc600, lo: 0x81, hi: 0x9b}, {value: 0xe500, lo: 0x9c, hi: 0x9c}, {value: 0xc600, lo: 0x9d, hi: 0xb7}, {value: 0xe500, lo: 0xb8, hi: 0xb8}, {value: 0xc600, lo: 0xb9, hi: 0xbf}, // Block 0x5c, offset 0x1c6 {value: 0x0000, lo: 0x05}, {value: 0xc600, lo: 0x80, hi: 0x93}, {value: 0xe500, lo: 0x94, hi: 0x94}, {value: 0xc600, lo: 0x95, hi: 0xaf}, {value: 0xe500, lo: 0xb0, hi: 0xb0}, {value: 0xc600, lo: 0xb1, hi: 0xbf}, // Block 0x5d, offset 0x1cc {value: 0x0000, lo: 0x05}, {value: 0xc600, lo: 0x80, hi: 0x8b}, {value: 0xe500, lo: 0x8c, hi: 0x8c}, {value: 0xc600, lo: 0x8d, hi: 0xa7}, {value: 0xe500, lo: 0xa8, hi: 0xa8}, {value: 0xc600, lo: 0xa9, hi: 0xbf}, // Block 0x5e, offset 0x1d2 {value: 0x0000, lo: 0x07}, {value: 0xc600, lo: 0x80, hi: 0x83}, {value: 0xe500, lo: 0x84, hi: 0x84}, {value: 0xc600, lo: 0x85, hi: 0x9f}, {value: 0xe500, lo: 0xa0, hi: 0xa0}, {value: 0xc600, lo: 0xa1, hi: 0xbb}, {value: 0xe500, lo: 0xbc, hi: 0xbc}, {value: 0xc600, lo: 0xbd, hi: 0xbf}, // Block 0x5f, offset 0x1da {value: 0x0000, lo: 0x05}, {value: 0xc600, lo: 0x80, hi: 0x97}, {value: 0xe500, lo: 0x98, hi: 0x98}, {value: 0xc600, lo: 0x99, hi: 0xb3}, {value: 0xe500, lo: 0xb4, hi: 0xb4}, {value: 0xc600, lo: 0xb5, hi: 0xbf}, // Block 0x60, offset 0x1e0 {value: 0x0000, lo: 0x05}, {value: 0xc600, lo: 0x80, hi: 0x8f}, {value: 0xe500, lo: 0x90, hi: 0x90}, {value: 0xc600, lo: 0x91, hi: 0xab}, {value: 0xe500, lo: 0xac, hi: 0xac}, {value: 0xc600, lo: 0xad, hi: 0xbf}, // Block 0x61, offset 0x1e6 {value: 0x0000, lo: 0x05}, {value: 0xc600, lo: 0x80, hi: 0x87}, {value: 0xe500, lo: 0x88, hi: 0x88}, {value: 0xc600, lo: 0x89, hi: 0xa3}, {value: 0xe500, lo: 0xa4, hi: 0xa4}, {value: 0xc600, lo: 0xa5, hi: 0xbf}, // Block 0x62, offset 0x1ec {value: 0x0000, lo: 0x03}, {value: 0xc600, lo: 0x80, hi: 0x87}, {value: 0xe500, lo: 0x88, hi: 0x88}, {value: 0xc600, lo: 0x89, hi: 0xa3}, // Block 0x63, offset 0x1f0 {value: 0x0006, lo: 0x0d}, {value: 0x448f, lo: 0x9d, hi: 0x9d}, {value: 0x8116, lo: 0x9e, hi: 0x9e}, {value: 0x4501, lo: 0x9f, hi: 0x9f}, {value: 0x44ef, lo: 0xaa, hi: 0xab}, {value: 0x45f3, lo: 0xac, hi: 0xac}, {value: 0x45fb, lo: 0xad, hi: 0xad}, {value: 0x4447, lo: 0xae, hi: 0xb1}, {value: 0x4465, lo: 0xb2, hi: 0xb4}, {value: 0x447d, lo: 0xb5, hi: 0xb6}, {value: 0x4489, lo: 0xb8, hi: 0xb8}, {value: 0x4495, lo: 0xb9, hi: 0xbb}, {value: 0x44ad, lo: 0xbc, hi: 0xbc}, {value: 0x44b3, lo: 0xbe, hi: 0xbe}, // Block 0x64, offset 0x1fe {value: 0x0006, lo: 0x08}, {value: 0x44b9, lo: 0x80, hi: 0x81}, {value: 0x44c5, lo: 0x83, hi: 0x84}, {value: 0x44d7, lo: 0x86, hi: 0x89}, {value: 0x44fb, lo: 0x8a, hi: 0x8a}, {value: 0x4477, lo: 0x8b, hi: 0x8b}, {value: 0x445f, lo: 0x8c, hi: 0x8c}, {value: 0x44a7, lo: 0x8d, hi: 0x8d}, {value: 0x44d1, lo: 0x8e, hi: 0x8e}, // Block 0x65, offset 0x207 {value: 0x0000, lo: 0x02}, {value: 0x8100, lo: 0xa4, hi: 0xa5}, {value: 0x8100, lo: 0xb0, hi: 0xb1}, // Block 0x66, offset 0x20a {value: 0x0000, lo: 0x02}, {value: 0x8100, lo: 0x9b, hi: 0x9d}, {value: 0x8200, lo: 0x9e, hi: 0xa3}, // Block 0x67, offset 0x20d {value: 0x0000, lo: 0x01}, {value: 0x8100, lo: 0x90, hi: 0x90}, // Block 0x68, offset 0x20f {value: 0x0000, lo: 0x02}, {value: 0x8100, lo: 0x99, hi: 0x99}, {value: 0x8200, lo: 0xb2, hi: 0xb4}, // Block 0x69, offset 0x212 {value: 0x0000, lo: 0x01}, {value: 0x8100, lo: 0xbc, hi: 0xbd}, // Block 0x6a, offset 0x214 {value: 0x0000, lo: 0x03}, {value: 0x8133, lo: 0xa0, hi: 0xa6}, {value: 0x812e, lo: 0xa7, hi: 0xad}, {value: 0x8133, lo: 0xae, hi: 0xaf}, // Block 0x6b, offset 0x218 {value: 0x0000, lo: 0x04}, {value: 0x8100, lo: 0x89, hi: 0x8c}, {value: 0x8100, lo: 0xb0, hi: 0xb2}, {value: 0x8100, lo: 0xb4, hi: 0xb4}, {value: 0x8100, lo: 0xb6, hi: 0xbf}, // Block 0x6c, offset 0x21d {value: 0x0000, lo: 0x01}, {value: 0x8100, lo: 0x81, hi: 0x8c}, // Block 0x6d, offset 0x21f {value: 0x0000, lo: 0x01}, {value: 0x8100, lo: 0xb5, hi: 0xba}, // Block 0x6e, offset 0x221 {value: 0x0000, lo: 0x04}, {value: 0x4cc0, lo: 0x9e, hi: 0x9f}, {value: 0x4cc0, lo: 0xa3, hi: 0xa3}, {value: 0x4cc0, lo: 0xa5, hi: 0xa6}, {value: 0x4cc0, lo: 0xaa, hi: 0xaf}, // Block 0x6f, offset 0x226 {value: 0x0000, lo: 0x05}, {value: 0x4cc0, lo: 0x82, hi: 0x87}, {value: 0x4cc0, lo: 0x8a, hi: 0x8f}, {value: 0x4cc0, lo: 0x92, hi: 0x97}, {value: 0x4cc0, lo: 0x9a, hi: 0x9c}, {value: 0x8100, lo: 0xa3, hi: 0xa3}, // Block 0x70, offset 0x22c {value: 0x0000, lo: 0x01}, {value: 0x812e, lo: 0xbd, hi: 0xbd}, // Block 0x71, offset 0x22e {value: 0x0000, lo: 0x01}, {value: 0x812e, lo: 0xa0, hi: 0xa0}, // Block 0x72, offset 0x230 {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0xb6, hi: 0xba}, // Block 0x73, offset 0x232 {value: 0x0000, lo: 0x04}, {value: 0x410f, lo: 0x89, hi: 0x89}, {value: 0xa000, lo: 0x92, hi: 0x92}, {value: 0xa000, lo: 0x9a, hi: 0x9a}, {value: 0x4117, lo: 0xa4, hi: 0xa4}, // Block 0x74, offset 0x237 {value: 0x002d, lo: 0x05}, {value: 0x812e, lo: 0x8d, hi: 0x8d}, {value: 0x8133, lo: 0x8f, hi: 0x8f}, {value: 0x8133, lo: 0xb8, hi: 0xb8}, {value: 0x8101, lo: 0xb9, hi: 0xba}, {value: 0x8105, lo: 0xbf, hi: 0xbf}, // Block 0x75, offset 0x23d {value: 0x0000, lo: 0x02}, {value: 0x8133, lo: 0xa5, hi: 0xa5}, {value: 0x812e, lo: 0xa6, hi: 0xa6}, // Block 0x76, offset 0x240 {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0xa4, hi: 0xa7}, // Block 0x77, offset 0x242 {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0xa9, hi: 0xad}, // Block 0x78, offset 0x244 {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0xab, hi: 0xac}, // Block 0x79, offset 0x246 {value: 0x0000, lo: 0x02}, {value: 0x812e, lo: 0xba, hi: 0xbb}, {value: 0x812e, lo: 0xbd, hi: 0xbf}, // Block 0x7a, offset 0x249 {value: 0x0000, lo: 0x05}, {value: 0x812e, lo: 0x86, hi: 0x87}, {value: 0x8133, lo: 0x88, hi: 0x8a}, {value: 0x812e, lo: 0x8b, hi: 0x8b}, {value: 0x8133, lo: 0x8c, hi: 0x8c}, {value: 0x812e, lo: 0x8d, hi: 0x90}, // Block 0x7b, offset 0x24f {value: 0x0005, lo: 0x03}, {value: 0x8133, lo: 0x82, hi: 0x82}, {value: 0x812e, lo: 0x83, hi: 0x84}, {value: 0x812e, lo: 0x85, hi: 0x85}, // Block 0x7c, offset 0x253 {value: 0x0000, lo: 0x03}, {value: 0x8105, lo: 0x86, hi: 0x86}, {value: 0x8105, lo: 0xb0, hi: 0xb0}, {value: 0x8105, lo: 0xbf, hi: 0xbf}, // Block 0x7d, offset 0x257 {value: 0x17fe, lo: 0x07}, {value: 0xa000, lo: 0x99, hi: 0x99}, {value: 0x4287, lo: 0x9a, hi: 0x9a}, {value: 0xa000, lo: 0x9b, hi: 0x9b}, {value: 0x4291, lo: 0x9c, hi: 0x9c}, {value: 0xa000, lo: 0xa5, hi: 0xa5}, {value: 0x429b, lo: 0xab, hi: 0xab}, {value: 0x8105, lo: 0xb9, hi: 0xba}, // Block 0x7e, offset 0x25f {value: 0x0000, lo: 0x06}, {value: 0x8133, lo: 0x80, hi: 0x82}, {value: 0x9900, lo: 0xa7, hi: 0xa7}, {value: 0x42a5, lo: 0xae, hi: 0xae}, {value: 0x42af, lo: 0xaf, hi: 0xaf}, {value: 0xa000, lo: 0xb1, hi: 0xb2}, {value: 0x8105, lo: 0xb3, hi: 0xb4}, // Block 0x7f, offset 0x266 {value: 0x0000, lo: 0x02}, {value: 0x8105, lo: 0x80, hi: 0x80}, {value: 0x8103, lo: 0x8a, hi: 0x8a}, // Block 0x80, offset 0x269 {value: 0x0000, lo: 0x02}, {value: 0x8105, lo: 0xb5, hi: 0xb5}, {value: 0x8103, lo: 0xb6, hi: 0xb6}, // Block 0x81, offset 0x26c {value: 0x0002, lo: 0x01}, {value: 0x8103, lo: 0xa9, hi: 0xaa}, // Block 0x82, offset 0x26e {value: 0x0000, lo: 0x02}, {value: 0x8103, lo: 0xbb, hi: 0xbc}, {value: 0x9900, lo: 0xbe, hi: 0xbe}, // Block 0x83, offset 0x271 {value: 0x0000, lo: 0x07}, {value: 0xa000, lo: 0x87, hi: 0x87}, {value: 0x42b9, lo: 0x8b, hi: 0x8b}, {value: 0x42c3, lo: 0x8c, hi: 0x8c}, {value: 0x8105, lo: 0x8d, hi: 0x8d}, {value: 0x9900, lo: 0x97, hi: 0x97}, {value: 0x8133, lo: 0xa6, hi: 0xac}, {value: 0x8133, lo: 0xb0, hi: 0xb4}, // Block 0x84, offset 0x279 {value: 0x5d33, lo: 0x09}, {value: 0xa000, lo: 0x82, hi: 0x82}, {value: 0x42cd, lo: 0x83, hi: 0x84}, {value: 0x42d7, lo: 0x85, hi: 0x85}, {value: 0xa000, lo: 0x8b, hi: 0x8b}, {value: 0x42e1, lo: 0x8e, hi: 0x8e}, {value: 0xa000, lo: 0x90, hi: 0x90}, {value: 0x42eb, lo: 0x91, hi: 0x91}, {value: 0x9900, lo: 0xb8, hi: 0xb8}, {value: 0x9900, lo: 0xbb, hi: 0xbb}, // Block 0x85, offset 0x283 {value: 0x0000, lo: 0x06}, {value: 0xb900, lo: 0x82, hi: 0x82}, {value: 0x4c14, lo: 0x85, hi: 0x85}, {value: 0x4c09, lo: 0x87, hi: 0x87}, {value: 0x4c1f, lo: 0x88, hi: 0x88}, {value: 0x9900, lo: 0x89, hi: 0x89}, {value: 0x8105, lo: 0x8e, hi: 0x90}, // Block 0x86, offset 0x28a {value: 0x0000, lo: 0x03}, {value: 0x8105, lo: 0x82, hi: 0x82}, {value: 0x8103, lo: 0x86, hi: 0x86}, {value: 0x8133, lo: 0x9e, hi: 0x9e}, // Block 0x87, offset 0x28e {value: 0x560b, lo: 0x06}, {value: 0x9900, lo: 0xb0, hi: 0xb0}, {value: 0xa000, lo: 0xb9, hi: 0xb9}, {value: 0x9900, lo: 0xba, hi: 0xba}, {value: 0x42ff, lo: 0xbb, hi: 0xbb}, {value: 0x42f5, lo: 0xbc, hi: 0xbd}, {value: 0x4309, lo: 0xbe, hi: 0xbe}, // Block 0x88, offset 0x295 {value: 0x0000, lo: 0x02}, {value: 0x8105, lo: 0x82, hi: 0x82}, {value: 0x8103, lo: 0x83, hi: 0x83}, // Block 0x89, offset 0x298 {value: 0x0000, lo: 0x05}, {value: 0x9900, lo: 0xaf, hi: 0xaf}, {value: 0xa000, lo: 0xb8, hi: 0xb9}, {value: 0x4313, lo: 0xba, hi: 0xba}, {value: 0x431d, lo: 0xbb, hi: 0xbb}, {value: 0x8105, lo: 0xbf, hi: 0xbf}, // Block 0x8a, offset 0x29e {value: 0x0000, lo: 0x01}, {value: 0x8103, lo: 0x80, hi: 0x80}, // Block 0x8b, offset 0x2a0 {value: 0x0000, lo: 0x02}, {value: 0x8105, lo: 0xb6, hi: 0xb6}, {value: 0x8103, lo: 0xb7, hi: 0xb7}, // Block 0x8c, offset 0x2a3 {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0xab, hi: 0xab}, // Block 0x8d, offset 0x2a5 {value: 0x0000, lo: 0x02}, {value: 0x8105, lo: 0xb9, hi: 0xb9}, {value: 0x8103, lo: 0xba, hi: 0xba}, // Block 0x8e, offset 0x2a8 {value: 0x0000, lo: 0x04}, {value: 0x9900, lo: 0xb0, hi: 0xb0}, {value: 0xa000, lo: 0xb5, hi: 0xb5}, {value: 0x4327, lo: 0xb8, hi: 0xb8}, {value: 0x8105, lo: 0xbd, hi: 0xbe}, // Block 0x8f, offset 0x2ad {value: 0x0000, lo: 0x01}, {value: 0x8103, lo: 0x83, hi: 0x83}, // Block 0x90, offset 0x2af {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0xa0, hi: 0xa0}, // Block 0x91, offset 0x2b1 {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0xb4, hi: 0xb4}, // Block 0x92, offset 0x2b3 {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0x87, hi: 0x87}, // Block 0x93, offset 0x2b5 {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0x99, hi: 0x99}, // Block 0x94, offset 0x2b7 {value: 0x0000, lo: 0x02}, {value: 0x8103, lo: 0x82, hi: 0x82}, {value: 0x8105, lo: 0x84, hi: 0x85}, // Block 0x95, offset 0x2ba {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0x97, hi: 0x97}, // Block 0x96, offset 0x2bc {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0x81, hi: 0x82}, // Block 0x97, offset 0x2be {value: 0x0000, lo: 0x0c}, {value: 0xb900, lo: 0x9e, hi: 0x9e}, {value: 0x9900, lo: 0x9f, hi: 0xa0}, {value: 0x4c83, lo: 0xa1, hi: 0xa1}, {value: 0x4c8e, lo: 0xa2, hi: 0xa2}, {value: 0x4c2a, lo: 0xa3, hi: 0xa3}, {value: 0x4c40, lo: 0xa4, hi: 0xa4}, {value: 0x4c35, lo: 0xa5, hi: 0xa5}, {value: 0x4c56, lo: 0xa6, hi: 0xa6}, {value: 0x4c74, lo: 0xa7, hi: 0xa7}, {value: 0x4c65, lo: 0xa8, hi: 0xa8}, {value: 0xb900, lo: 0xa9, hi: 0xa9}, {value: 0x8105, lo: 0xaf, hi: 0xaf}, // Block 0x98, offset 0x2cb {value: 0x0000, lo: 0x01}, {value: 0x8101, lo: 0xb0, hi: 0xb4}, // Block 0x99, offset 0x2cd {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0xb0, hi: 0xb6}, // Block 0x9a, offset 0x2cf {value: 0x0000, lo: 0x05}, {value: 0xa000, lo: 0xa3, hi: 0xa3}, {value: 0xb900, lo: 0xa7, hi: 0xa7}, {value: 0x4c4b, lo: 0xa8, hi: 0xa8}, {value: 0x4b35, lo: 0xa9, hi: 0xa9}, {value: 0x4347, lo: 0xaa, hi: 0xaa}, // Block 0x9b, offset 0x2d5 {value: 0x0000, lo: 0x01}, {value: 0x8102, lo: 0xb0, hi: 0xb1}, // Block 0x9c, offset 0x2d7 {value: 0x0000, lo: 0x01}, {value: 0x8101, lo: 0x9e, hi: 0x9e}, // Block 0x9d, offset 0x2d9 {value: 0x0000, lo: 0x0c}, {value: 0x4743, lo: 0x9e, hi: 0x9e}, {value: 0x474d, lo: 0x9f, hi: 0x9f}, {value: 0x4781, lo: 0xa0, hi: 0xa0}, {value: 0x478f, lo: 0xa1, hi: 0xa1}, {value: 0x479d, lo: 0xa2, hi: 0xa2}, {value: 0x47ab, lo: 0xa3, hi: 0xa3}, {value: 0x47b9, lo: 0xa4, hi: 0xa4}, {value: 0x812c, lo: 0xa5, hi: 0xa6}, {value: 0x8101, lo: 0xa7, hi: 0xa9}, {value: 0x8131, lo: 0xad, hi: 0xad}, {value: 0x812c, lo: 0xae, hi: 0xb2}, {value: 0x812e, lo: 0xbb, hi: 0xbf}, // Block 0x9e, offset 0x2e6 {value: 0x0000, lo: 0x09}, {value: 0x812e, lo: 0x80, hi: 0x82}, {value: 0x8133, lo: 0x85, hi: 0x89}, {value: 0x812e, lo: 0x8a, hi: 0x8b}, {value: 0x8133, lo: 0xaa, hi: 0xad}, {value: 0x4757, lo: 0xbb, hi: 0xbb}, {value: 0x4761, lo: 0xbc, hi: 0xbc}, {value: 0x47c7, lo: 0xbd, hi: 0xbd}, {value: 0x47e3, lo: 0xbe, hi: 0xbe}, {value: 0x47d5, lo: 0xbf, hi: 0xbf}, // Block 0x9f, offset 0x2f0 {value: 0x0000, lo: 0x01}, {value: 0x47f1, lo: 0x80, hi: 0x80}, // Block 0xa0, offset 0x2f2 {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0x82, hi: 0x84}, // Block 0xa1, offset 0x2f4 {value: 0x0000, lo: 0x05}, {value: 0x8133, lo: 0x80, hi: 0x86}, {value: 0x8133, lo: 0x88, hi: 0x98}, {value: 0x8133, lo: 0x9b, hi: 0xa1}, {value: 0x8133, lo: 0xa3, hi: 0xa4}, {value: 0x8133, lo: 0xa6, hi: 0xaa}, // Block 0xa2, offset 0x2fa {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0x8f, hi: 0x8f}, // Block 0xa3, offset 0x2fc {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0xae, hi: 0xae}, // Block 0xa4, offset 0x2fe {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0xac, hi: 0xaf}, // Block 0xa5, offset 0x300 {value: 0x0000, lo: 0x03}, {value: 0x8134, lo: 0xac, hi: 0xad}, {value: 0x812e, lo: 0xae, hi: 0xae}, {value: 0x8133, lo: 0xaf, hi: 0xaf}, // Block 0xa6, offset 0x304 {value: 0x0000, lo: 0x02}, {value: 0x8133, lo: 0xae, hi: 0xae}, {value: 0x812e, lo: 0xaf, hi: 0xaf}, // Block 0xa7, offset 0x307 {value: 0x0000, lo: 0x04}, {value: 0x8133, lo: 0xa3, hi: 0xa3}, {value: 0x8133, lo: 0xa6, hi: 0xa6}, {value: 0x8133, lo: 0xae, hi: 0xaf}, {value: 0x8133, lo: 0xb5, hi: 0xb5}, // Block 0xa8, offset 0x30c {value: 0x0000, lo: 0x01}, {value: 0x812e, lo: 0x90, hi: 0x96}, // Block 0xa9, offset 0x30e {value: 0x0000, lo: 0x02}, {value: 0x8133, lo: 0x84, hi: 0x89}, {value: 0x8103, lo: 0x8a, hi: 0x8a}, // Block 0xaa, offset 0x311 {value: 0x0000, lo: 0x01}, {value: 0x8100, lo: 0x93, hi: 0x93}, } // lookup returns the trie value for the first UTF-8 encoding in s and // the width in bytes of this encoding. The size will be 0 if s does not // hold enough bytes to complete the encoding. len(s) must be greater than 0. func (t *nfkcTrie) lookup(s []byte) (v uint16, sz int) { c0 := s[0] switch { case c0 < 0x80: // is ASCII return nfkcValues[c0], 1 case c0 < 0xC2: return 0, 1 // Illegal UTF-8: not a starter, not ASCII. case c0 < 0xE0: // 2-byte UTF-8 if len(s) < 2 { return 0, 0 } i := nfkcIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c1), 2 case c0 < 0xF0: // 3-byte UTF-8 if len(s) < 3 { return 0, 0 } i := nfkcIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = nfkcIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c2), 3 case c0 < 0xF8: // 4-byte UTF-8 if len(s) < 4 { return 0, 0 } i := nfkcIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = nfkcIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } o = uint32(i)<<6 + uint32(c2) i = nfkcIndex[o] c3 := s[3] if c3 < 0x80 || 0xC0 <= c3 { return 0, 3 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c3), 4 } // Illegal rune return 0, 1 } // lookupUnsafe returns the trie value for the first UTF-8 encoding in s. // s must start with a full and valid UTF-8 encoded rune. func (t *nfkcTrie) lookupUnsafe(s []byte) uint16 { c0 := s[0] if c0 < 0x80 { // is ASCII return nfkcValues[c0] } i := nfkcIndex[c0] if c0 < 0xE0 { // 2-byte UTF-8 return t.lookupValue(uint32(i), s[1]) } i = nfkcIndex[uint32(i)<<6+uint32(s[1])] if c0 < 0xF0 { // 3-byte UTF-8 return t.lookupValue(uint32(i), s[2]) } i = nfkcIndex[uint32(i)<<6+uint32(s[2])] if c0 < 0xF8 { // 4-byte UTF-8 return t.lookupValue(uint32(i), s[3]) } return 0 } // lookupString returns the trie value for the first UTF-8 encoding in s and // the width in bytes of this encoding. The size will be 0 if s does not // hold enough bytes to complete the encoding. len(s) must be greater than 0. func (t *nfkcTrie) lookupString(s string) (v uint16, sz int) { c0 := s[0] switch { case c0 < 0x80: // is ASCII return nfkcValues[c0], 1 case c0 < 0xC2: return 0, 1 // Illegal UTF-8: not a starter, not ASCII. case c0 < 0xE0: // 2-byte UTF-8 if len(s) < 2 { return 0, 0 } i := nfkcIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c1), 2 case c0 < 0xF0: // 3-byte UTF-8 if len(s) < 3 { return 0, 0 } i := nfkcIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = nfkcIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c2), 3 case c0 < 0xF8: // 4-byte UTF-8 if len(s) < 4 { return 0, 0 } i := nfkcIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = nfkcIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } o = uint32(i)<<6 + uint32(c2) i = nfkcIndex[o] c3 := s[3] if c3 < 0x80 || 0xC0 <= c3 { return 0, 3 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c3), 4 } // Illegal rune return 0, 1 } // lookupStringUnsafe returns the trie value for the first UTF-8 encoding in s. // s must start with a full and valid UTF-8 encoded rune. func (t *nfkcTrie) lookupStringUnsafe(s string) uint16 { c0 := s[0] if c0 < 0x80 { // is ASCII return nfkcValues[c0] } i := nfkcIndex[c0] if c0 < 0xE0 { // 2-byte UTF-8 return t.lookupValue(uint32(i), s[1]) } i = nfkcIndex[uint32(i)<<6+uint32(s[1])] if c0 < 0xF0 { // 3-byte UTF-8 return t.lookupValue(uint32(i), s[2]) } i = nfkcIndex[uint32(i)<<6+uint32(s[2])] if c0 < 0xF8 { // 4-byte UTF-8 return t.lookupValue(uint32(i), s[3]) } return 0 } // nfkcTrie. Total size: 19650 bytes (19.19 KiB). Checksum: 29892d851eed0531. type nfkcTrie struct{} func newNfkcTrie(i int) *nfkcTrie { return &nfkcTrie{} } // lookupValue determines the type of block n and looks up the value for b. func (t *nfkcTrie) lookupValue(n uint32, b byte) uint16 { switch { case n < 95: return uint16(nfkcValues[n<<6+uint32(b)]) default: n -= 95 return uint16(nfkcSparse.lookup(n, b)) } } // nfkcValues: 97 blocks, 6208 entries, 12416 bytes // The third block is the zero block. var nfkcValues = [6208]uint16{ // Block 0x0, offset 0x0 0x3c: 0xa000, 0x3d: 0xa000, 0x3e: 0xa000, // Block 0x1, offset 0x40 0x41: 0xa000, 0x42: 0xa000, 0x43: 0xa000, 0x44: 0xa000, 0x45: 0xa000, 0x46: 0xa000, 0x47: 0xa000, 0x48: 0xa000, 0x49: 0xa000, 0x4a: 0xa000, 0x4b: 0xa000, 0x4c: 0xa000, 0x4d: 0xa000, 0x4e: 0xa000, 0x4f: 0xa000, 0x50: 0xa000, 0x52: 0xa000, 0x53: 0xa000, 0x54: 0xa000, 0x55: 0xa000, 0x56: 0xa000, 0x57: 0xa000, 0x58: 0xa000, 0x59: 0xa000, 0x5a: 0xa000, 0x61: 0xa000, 0x62: 0xa000, 0x63: 0xa000, 0x64: 0xa000, 0x65: 0xa000, 0x66: 0xa000, 0x67: 0xa000, 0x68: 0xa000, 0x69: 0xa000, 0x6a: 0xa000, 0x6b: 0xa000, 0x6c: 0xa000, 0x6d: 0xa000, 0x6e: 0xa000, 0x6f: 0xa000, 0x70: 0xa000, 0x72: 0xa000, 0x73: 0xa000, 0x74: 0xa000, 0x75: 0xa000, 0x76: 0xa000, 0x77: 0xa000, 0x78: 0xa000, 0x79: 0xa000, 0x7a: 0xa000, // Block 0x2, offset 0x80 // Block 0x3, offset 0xc0 0xc0: 0x2ece, 0xc1: 0x2ed3, 0xc2: 0x47ff, 0xc3: 0x2ed8, 0xc4: 0x480e, 0xc5: 0x4813, 0xc6: 0xa000, 0xc7: 0x481d, 0xc8: 0x2f41, 0xc9: 0x2f46, 0xca: 0x4822, 0xcb: 0x2f5a, 0xcc: 0x2fcd, 0xcd: 0x2fd2, 0xce: 0x2fd7, 0xcf: 0x4836, 0xd1: 0x3063, 0xd2: 0x3086, 0xd3: 0x308b, 0xd4: 0x4840, 0xd5: 0x4845, 0xd6: 0x4854, 0xd8: 0xa000, 0xd9: 0x3112, 0xda: 0x3117, 0xdb: 0x311c, 0xdc: 0x4886, 0xdd: 0x3194, 0xe0: 0x31da, 0xe1: 0x31df, 0xe2: 0x4890, 0xe3: 0x31e4, 0xe4: 0x489f, 0xe5: 0x48a4, 0xe6: 0xa000, 0xe7: 0x48ae, 0xe8: 0x324d, 0xe9: 0x3252, 0xea: 0x48b3, 0xeb: 0x3266, 0xec: 0x32de, 0xed: 0x32e3, 0xee: 0x32e8, 0xef: 0x48c7, 0xf1: 0x3374, 0xf2: 0x3397, 0xf3: 0x339c, 0xf4: 0x48d1, 0xf5: 0x48d6, 0xf6: 0x48e5, 0xf8: 0xa000, 0xf9: 0x3428, 0xfa: 0x342d, 0xfb: 0x3432, 0xfc: 0x4917, 0xfd: 0x34af, 0xff: 0x34c8, // Block 0x4, offset 0x100 0x100: 0x2edd, 0x101: 0x31e9, 0x102: 0x4804, 0x103: 0x4895, 0x104: 0x2efb, 0x105: 0x3207, 0x106: 0x2f0f, 0x107: 0x321b, 0x108: 0x2f14, 0x109: 0x3220, 0x10a: 0x2f19, 0x10b: 0x3225, 0x10c: 0x2f1e, 0x10d: 0x322a, 0x10e: 0x2f28, 0x10f: 0x3234, 0x112: 0x4827, 0x113: 0x48b8, 0x114: 0x2f50, 0x115: 0x325c, 0x116: 0x2f55, 0x117: 0x3261, 0x118: 0x2f73, 0x119: 0x327f, 0x11a: 0x2f64, 0x11b: 0x3270, 0x11c: 0x2f8c, 0x11d: 0x3298, 0x11e: 0x2f96, 0x11f: 0x32a2, 0x120: 0x2f9b, 0x121: 0x32a7, 0x122: 0x2fa5, 0x123: 0x32b1, 0x124: 0x2faa, 0x125: 0x32b6, 0x128: 0x2fdc, 0x129: 0x32ed, 0x12a: 0x2fe1, 0x12b: 0x32f2, 0x12c: 0x2fe6, 0x12d: 0x32f7, 0x12e: 0x3009, 0x12f: 0x3315, 0x130: 0x2feb, 0x132: 0x1a8a, 0x133: 0x1b17, 0x134: 0x3013, 0x135: 0x331f, 0x136: 0x3027, 0x137: 0x3338, 0x139: 0x3031, 0x13a: 0x3342, 0x13b: 0x303b, 0x13c: 0x334c, 0x13d: 0x3036, 0x13e: 0x3347, 0x13f: 0x1cdc, // Block 0x5, offset 0x140 0x140: 0x1d64, 0x143: 0x305e, 0x144: 0x336f, 0x145: 0x3077, 0x146: 0x3388, 0x147: 0x306d, 0x148: 0x337e, 0x149: 0x1d8c, 0x14c: 0x484a, 0x14d: 0x48db, 0x14e: 0x3090, 0x14f: 0x33a1, 0x150: 0x309a, 0x151: 0x33ab, 0x154: 0x30b8, 0x155: 0x33c9, 0x156: 0x30d1, 0x157: 0x33e2, 0x158: 0x30c2, 0x159: 0x33d3, 0x15a: 0x486d, 0x15b: 0x48fe, 0x15c: 0x30db, 0x15d: 0x33ec, 0x15e: 0x30ea, 0x15f: 0x33fb, 0x160: 0x4872, 0x161: 0x4903, 0x162: 0x3103, 0x163: 0x3419, 0x164: 0x30f4, 0x165: 0x340a, 0x168: 0x487c, 0x169: 0x490d, 0x16a: 0x4881, 0x16b: 0x4912, 0x16c: 0x3121, 0x16d: 0x3437, 0x16e: 0x312b, 0x16f: 0x3441, 0x170: 0x3130, 0x171: 0x3446, 0x172: 0x314e, 0x173: 0x3464, 0x174: 0x3171, 0x175: 0x3487, 0x176: 0x3199, 0x177: 0x34b4, 0x178: 0x31ad, 0x179: 0x31bc, 0x17a: 0x34dc, 0x17b: 0x31c6, 0x17c: 0x34e6, 0x17d: 0x31cb, 0x17e: 0x34eb, 0x17f: 0x00a7, // Block 0x6, offset 0x180 0x184: 0x2dd5, 0x185: 0x2ddb, 0x186: 0x2de1, 0x187: 0x1a9f, 0x188: 0x1aa2, 0x189: 0x1b38, 0x18a: 0x1ab7, 0x18b: 0x1aba, 0x18c: 0x1b6e, 0x18d: 0x2ee7, 0x18e: 0x31f3, 0x18f: 0x2ff5, 0x190: 0x3301, 0x191: 0x309f, 0x192: 0x33b0, 0x193: 0x3135, 0x194: 0x344b, 0x195: 0x392e, 0x196: 0x3abd, 0x197: 0x3927, 0x198: 0x3ab6, 0x199: 0x3935, 0x19a: 0x3ac4, 0x19b: 0x3920, 0x19c: 0x3aaf, 0x19e: 0x380f, 0x19f: 0x399e, 0x1a0: 0x3808, 0x1a1: 0x3997, 0x1a2: 0x3512, 0x1a3: 0x3524, 0x1a6: 0x2fa0, 0x1a7: 0x32ac, 0x1a8: 0x301d, 0x1a9: 0x332e, 0x1aa: 0x4863, 0x1ab: 0x48f4, 0x1ac: 0x38ef, 0x1ad: 0x3a7e, 0x1ae: 0x3536, 0x1af: 0x353c, 0x1b0: 0x3324, 0x1b1: 0x1a6f, 0x1b2: 0x1a72, 0x1b3: 0x1aff, 0x1b4: 0x2f87, 0x1b5: 0x3293, 0x1b8: 0x3059, 0x1b9: 0x336a, 0x1ba: 0x3816, 0x1bb: 0x39a5, 0x1bc: 0x350c, 0x1bd: 0x351e, 0x1be: 0x3518, 0x1bf: 0x352a, // Block 0x7, offset 0x1c0 0x1c0: 0x2eec, 0x1c1: 0x31f8, 0x1c2: 0x2ef1, 0x1c3: 0x31fd, 0x1c4: 0x2f69, 0x1c5: 0x3275, 0x1c6: 0x2f6e, 0x1c7: 0x327a, 0x1c8: 0x2ffa, 0x1c9: 0x3306, 0x1ca: 0x2fff, 0x1cb: 0x330b, 0x1cc: 0x30a4, 0x1cd: 0x33b5, 0x1ce: 0x30a9, 0x1cf: 0x33ba, 0x1d0: 0x30c7, 0x1d1: 0x33d8, 0x1d2: 0x30cc, 0x1d3: 0x33dd, 0x1d4: 0x313a, 0x1d5: 0x3450, 0x1d6: 0x313f, 0x1d7: 0x3455, 0x1d8: 0x30e5, 0x1d9: 0x33f6, 0x1da: 0x30fe, 0x1db: 0x3414, 0x1de: 0x2fb9, 0x1df: 0x32c5, 0x1e6: 0x4809, 0x1e7: 0x489a, 0x1e8: 0x4831, 0x1e9: 0x48c2, 0x1ea: 0x38be, 0x1eb: 0x3a4d, 0x1ec: 0x389b, 0x1ed: 0x3a2a, 0x1ee: 0x484f, 0x1ef: 0x48e0, 0x1f0: 0x38b7, 0x1f1: 0x3a46, 0x1f2: 0x31a3, 0x1f3: 0x34be, // Block 0x8, offset 0x200 0x200: 0x9933, 0x201: 0x9933, 0x202: 0x9933, 0x203: 0x9933, 0x204: 0x9933, 0x205: 0x8133, 0x206: 0x9933, 0x207: 0x9933, 0x208: 0x9933, 0x209: 0x9933, 0x20a: 0x9933, 0x20b: 0x9933, 0x20c: 0x9933, 0x20d: 0x8133, 0x20e: 0x8133, 0x20f: 0x9933, 0x210: 0x8133, 0x211: 0x9933, 0x212: 0x8133, 0x213: 0x9933, 0x214: 0x9933, 0x215: 0x8134, 0x216: 0x812e, 0x217: 0x812e, 0x218: 0x812e, 0x219: 0x812e, 0x21a: 0x8134, 0x21b: 0x992c, 0x21c: 0x812e, 0x21d: 0x812e, 0x21e: 0x812e, 0x21f: 0x812e, 0x220: 0x812e, 0x221: 0x812a, 0x222: 0x812a, 0x223: 0x992e, 0x224: 0x992e, 0x225: 0x992e, 0x226: 0x992e, 0x227: 0x992a, 0x228: 0x992a, 0x229: 0x812e, 0x22a: 0x812e, 0x22b: 0x812e, 0x22c: 0x812e, 0x22d: 0x992e, 0x22e: 0x992e, 0x22f: 0x812e, 0x230: 0x992e, 0x231: 0x992e, 0x232: 0x812e, 0x233: 0x812e, 0x234: 0x8101, 0x235: 0x8101, 0x236: 0x8101, 0x237: 0x8101, 0x238: 0x9901, 0x239: 0x812e, 0x23a: 0x812e, 0x23b: 0x812e, 0x23c: 0x812e, 0x23d: 0x8133, 0x23e: 0x8133, 0x23f: 0x8133, // Block 0x9, offset 0x240 0x240: 0x4b3f, 0x241: 0x4b44, 0x242: 0x9933, 0x243: 0x4b49, 0x244: 0x4c02, 0x245: 0x9937, 0x246: 0x8133, 0x247: 0x812e, 0x248: 0x812e, 0x249: 0x812e, 0x24a: 0x8133, 0x24b: 0x8133, 0x24c: 0x8133, 0x24d: 0x812e, 0x24e: 0x812e, 0x250: 0x8133, 0x251: 0x8133, 0x252: 0x8133, 0x253: 0x812e, 0x254: 0x812e, 0x255: 0x812e, 0x256: 0x812e, 0x257: 0x8133, 0x258: 0x8134, 0x259: 0x812e, 0x25a: 0x812e, 0x25b: 0x8133, 0x25c: 0x8135, 0x25d: 0x8136, 0x25e: 0x8136, 0x25f: 0x8135, 0x260: 0x8136, 0x261: 0x8136, 0x262: 0x8135, 0x263: 0x8133, 0x264: 0x8133, 0x265: 0x8133, 0x266: 0x8133, 0x267: 0x8133, 0x268: 0x8133, 0x269: 0x8133, 0x26a: 0x8133, 0x26b: 0x8133, 0x26c: 0x8133, 0x26d: 0x8133, 0x26e: 0x8133, 0x26f: 0x8133, 0x274: 0x01ee, 0x27a: 0x43a4, 0x27e: 0x0037, // Block 0xa, offset 0x280 0x284: 0x4359, 0x285: 0x457a, 0x286: 0x3548, 0x287: 0x00ce, 0x288: 0x3566, 0x289: 0x3572, 0x28a: 0x3584, 0x28c: 0x35a2, 0x28e: 0x35b4, 0x28f: 0x35d2, 0x290: 0x3d67, 0x291: 0xa000, 0x295: 0xa000, 0x297: 0xa000, 0x299: 0xa000, 0x29f: 0xa000, 0x2a1: 0xa000, 0x2a5: 0xa000, 0x2a9: 0xa000, 0x2aa: 0x3596, 0x2ab: 0x35c6, 0x2ac: 0x4975, 0x2ad: 0x35f6, 0x2ae: 0x499f, 0x2af: 0x3608, 0x2b0: 0x3dcf, 0x2b1: 0xa000, 0x2b5: 0xa000, 0x2b7: 0xa000, 0x2b9: 0xa000, 0x2bf: 0xa000, // Block 0xb, offset 0x2c0 0x2c1: 0xa000, 0x2c5: 0xa000, 0x2c9: 0xa000, 0x2ca: 0x49b7, 0x2cb: 0x49d5, 0x2cc: 0x3626, 0x2cd: 0x363e, 0x2ce: 0x49ed, 0x2d0: 0x0242, 0x2d1: 0x0254, 0x2d2: 0x0230, 0x2d3: 0x440b, 0x2d4: 0x4411, 0x2d5: 0x027e, 0x2d6: 0x026c, 0x2f0: 0x025a, 0x2f1: 0x026f, 0x2f2: 0x0272, 0x2f4: 0x020c, 0x2f5: 0x024b, 0x2f9: 0x022a, // Block 0xc, offset 0x300 0x300: 0x3680, 0x301: 0x368c, 0x303: 0x367a, 0x306: 0xa000, 0x307: 0x3668, 0x30c: 0x36bc, 0x30d: 0x36a4, 0x30e: 0x36ce, 0x310: 0xa000, 0x313: 0xa000, 0x315: 0xa000, 0x316: 0xa000, 0x317: 0xa000, 0x318: 0xa000, 0x319: 0x36b0, 0x31a: 0xa000, 0x31e: 0xa000, 0x323: 0xa000, 0x327: 0xa000, 0x32b: 0xa000, 0x32d: 0xa000, 0x330: 0xa000, 0x333: 0xa000, 0x335: 0xa000, 0x336: 0xa000, 0x337: 0xa000, 0x338: 0xa000, 0x339: 0x3734, 0x33a: 0xa000, 0x33e: 0xa000, // Block 0xd, offset 0x340 0x341: 0x3692, 0x342: 0x3716, 0x350: 0x366e, 0x351: 0x36f2, 0x352: 0x3674, 0x353: 0x36f8, 0x356: 0x3686, 0x357: 0x370a, 0x358: 0xa000, 0x359: 0xa000, 0x35a: 0x3788, 0x35b: 0x378e, 0x35c: 0x3698, 0x35d: 0x371c, 0x35e: 0x369e, 0x35f: 0x3722, 0x362: 0x36aa, 0x363: 0x372e, 0x364: 0x36b6, 0x365: 0x373a, 0x366: 0x36c2, 0x367: 0x3746, 0x368: 0xa000, 0x369: 0xa000, 0x36a: 0x3794, 0x36b: 0x379a, 0x36c: 0x36ec, 0x36d: 0x3770, 0x36e: 0x36c8, 0x36f: 0x374c, 0x370: 0x36d4, 0x371: 0x3758, 0x372: 0x36da, 0x373: 0x375e, 0x374: 0x36e0, 0x375: 0x3764, 0x378: 0x36e6, 0x379: 0x376a, // Block 0xe, offset 0x380 0x387: 0x1e91, 0x391: 0x812e, 0x392: 0x8133, 0x393: 0x8133, 0x394: 0x8133, 0x395: 0x8133, 0x396: 0x812e, 0x397: 0x8133, 0x398: 0x8133, 0x399: 0x8133, 0x39a: 0x812f, 0x39b: 0x812e, 0x39c: 0x8133, 0x39d: 0x8133, 0x39e: 0x8133, 0x39f: 0x8133, 0x3a0: 0x8133, 0x3a1: 0x8133, 0x3a2: 0x812e, 0x3a3: 0x812e, 0x3a4: 0x812e, 0x3a5: 0x812e, 0x3a6: 0x812e, 0x3a7: 0x812e, 0x3a8: 0x8133, 0x3a9: 0x8133, 0x3aa: 0x812e, 0x3ab: 0x8133, 0x3ac: 0x8133, 0x3ad: 0x812f, 0x3ae: 0x8132, 0x3af: 0x8133, 0x3b0: 0x8106, 0x3b1: 0x8107, 0x3b2: 0x8108, 0x3b3: 0x8109, 0x3b4: 0x810a, 0x3b5: 0x810b, 0x3b6: 0x810c, 0x3b7: 0x810d, 0x3b8: 0x810e, 0x3b9: 0x810f, 0x3ba: 0x810f, 0x3bb: 0x8110, 0x3bc: 0x8111, 0x3bd: 0x8112, 0x3bf: 0x8113, // Block 0xf, offset 0x3c0 0x3c8: 0xa000, 0x3ca: 0xa000, 0x3cb: 0x8117, 0x3cc: 0x8118, 0x3cd: 0x8119, 0x3ce: 0x811a, 0x3cf: 0x811b, 0x3d0: 0x811c, 0x3d1: 0x811d, 0x3d2: 0x811e, 0x3d3: 0x9933, 0x3d4: 0x9933, 0x3d5: 0x992e, 0x3d6: 0x812e, 0x3d7: 0x8133, 0x3d8: 0x8133, 0x3d9: 0x8133, 0x3da: 0x8133, 0x3db: 0x8133, 0x3dc: 0x812e, 0x3dd: 0x8133, 0x3de: 0x8133, 0x3df: 0x812e, 0x3f0: 0x811f, 0x3f5: 0x1eb4, 0x3f6: 0x2143, 0x3f7: 0x217f, 0x3f8: 0x217a, // Block 0x10, offset 0x400 0x40a: 0x8133, 0x40b: 0x8133, 0x40c: 0x8133, 0x40d: 0x8133, 0x40e: 0x8133, 0x40f: 0x812e, 0x410: 0x812e, 0x411: 0x812e, 0x412: 0x812e, 0x413: 0x812e, 0x414: 0x8133, 0x415: 0x8133, 0x416: 0x8133, 0x417: 0x8133, 0x418: 0x8133, 0x419: 0x8133, 0x41a: 0x8133, 0x41b: 0x8133, 0x41c: 0x8133, 0x41d: 0x8133, 0x41e: 0x8133, 0x41f: 0x8133, 0x420: 0x8133, 0x421: 0x8133, 0x423: 0x812e, 0x424: 0x8133, 0x425: 0x8133, 0x426: 0x812e, 0x427: 0x8133, 0x428: 0x8133, 0x429: 0x812e, 0x42a: 0x8133, 0x42b: 0x8133, 0x42c: 0x8133, 0x42d: 0x812e, 0x42e: 0x812e, 0x42f: 0x812e, 0x430: 0x8117, 0x431: 0x8118, 0x432: 0x8119, 0x433: 0x8133, 0x434: 0x8133, 0x435: 0x8133, 0x436: 0x812e, 0x437: 0x8133, 0x438: 0x8133, 0x439: 0x812e, 0x43a: 0x812e, 0x43b: 0x8133, 0x43c: 0x8133, 0x43d: 0x8133, 0x43e: 0x8133, 0x43f: 0x8133, // Block 0x11, offset 0x440 0x445: 0xa000, 0x446: 0x3ee7, 0x447: 0xa000, 0x448: 0x3eef, 0x449: 0xa000, 0x44a: 0x3ef7, 0x44b: 0xa000, 0x44c: 0x3eff, 0x44d: 0xa000, 0x44e: 0x3f07, 0x451: 0xa000, 0x452: 0x3f0f, 0x474: 0x8103, 0x475: 0x9900, 0x47a: 0xa000, 0x47b: 0x3f17, 0x47c: 0xa000, 0x47d: 0x3f1f, 0x47e: 0xa000, 0x47f: 0xa000, // Block 0x12, offset 0x480 0x480: 0x0069, 0x481: 0x006b, 0x482: 0x006f, 0x483: 0x0083, 0x484: 0x0104, 0x485: 0x0107, 0x486: 0x0506, 0x487: 0x0085, 0x488: 0x0089, 0x489: 0x008b, 0x48a: 0x011f, 0x48b: 0x0122, 0x48c: 0x0125, 0x48d: 0x008f, 0x48f: 0x0097, 0x490: 0x009b, 0x491: 0x00e6, 0x492: 0x009f, 0x493: 0x0110, 0x494: 0x050a, 0x495: 0x050e, 0x496: 0x00a1, 0x497: 0x00a9, 0x498: 0x00ab, 0x499: 0x0516, 0x49a: 0x015b, 0x49b: 0x00ad, 0x49c: 0x051a, 0x49d: 0x0242, 0x49e: 0x0245, 0x49f: 0x0248, 0x4a0: 0x027e, 0x4a1: 0x0281, 0x4a2: 0x0093, 0x4a3: 0x00a5, 0x4a4: 0x00ab, 0x4a5: 0x00ad, 0x4a6: 0x0242, 0x4a7: 0x0245, 0x4a8: 0x026f, 0x4a9: 0x027e, 0x4aa: 0x0281, 0x4b8: 0x02b4, // Block 0x13, offset 0x4c0 0x4db: 0x010a, 0x4dc: 0x0087, 0x4dd: 0x0113, 0x4de: 0x00d7, 0x4df: 0x0125, 0x4e0: 0x008d, 0x4e1: 0x012b, 0x4e2: 0x0131, 0x4e3: 0x013d, 0x4e4: 0x0146, 0x4e5: 0x0149, 0x4e6: 0x014c, 0x4e7: 0x051e, 0x4e8: 0x01c7, 0x4e9: 0x0155, 0x4ea: 0x0522, 0x4eb: 0x01ca, 0x4ec: 0x0161, 0x4ed: 0x015e, 0x4ee: 0x0164, 0x4ef: 0x0167, 0x4f0: 0x016a, 0x4f1: 0x016d, 0x4f2: 0x0176, 0x4f3: 0x018e, 0x4f4: 0x0191, 0x4f5: 0x00f2, 0x4f6: 0x019a, 0x4f7: 0x019d, 0x4f8: 0x0512, 0x4f9: 0x01a0, 0x4fa: 0x01a3, 0x4fb: 0x00b5, 0x4fc: 0x01af, 0x4fd: 0x01b2, 0x4fe: 0x01b5, 0x4ff: 0x0254, // Block 0x14, offset 0x500 0x500: 0x8133, 0x501: 0x8133, 0x502: 0x812e, 0x503: 0x8133, 0x504: 0x8133, 0x505: 0x8133, 0x506: 0x8133, 0x507: 0x8133, 0x508: 0x8133, 0x509: 0x8133, 0x50a: 0x812e, 0x50b: 0x8133, 0x50c: 0x8133, 0x50d: 0x8136, 0x50e: 0x812b, 0x50f: 0x812e, 0x510: 0x812a, 0x511: 0x8133, 0x512: 0x8133, 0x513: 0x8133, 0x514: 0x8133, 0x515: 0x8133, 0x516: 0x8133, 0x517: 0x8133, 0x518: 0x8133, 0x519: 0x8133, 0x51a: 0x8133, 0x51b: 0x8133, 0x51c: 0x8133, 0x51d: 0x8133, 0x51e: 0x8133, 0x51f: 0x8133, 0x520: 0x8133, 0x521: 0x8133, 0x522: 0x8133, 0x523: 0x8133, 0x524: 0x8133, 0x525: 0x8133, 0x526: 0x8133, 0x527: 0x8133, 0x528: 0x8133, 0x529: 0x8133, 0x52a: 0x8133, 0x52b: 0x8133, 0x52c: 0x8133, 0x52d: 0x8133, 0x52e: 0x8133, 0x52f: 0x8133, 0x530: 0x8133, 0x531: 0x8133, 0x532: 0x8133, 0x533: 0x8133, 0x534: 0x8133, 0x535: 0x8133, 0x536: 0x8134, 0x537: 0x8132, 0x538: 0x8132, 0x539: 0x812e, 0x53a: 0x812d, 0x53b: 0x8133, 0x53c: 0x8135, 0x53d: 0x812e, 0x53e: 0x8133, 0x53f: 0x812e, // Block 0x15, offset 0x540 0x540: 0x2ef6, 0x541: 0x3202, 0x542: 0x2f00, 0x543: 0x320c, 0x544: 0x2f05, 0x545: 0x3211, 0x546: 0x2f0a, 0x547: 0x3216, 0x548: 0x382b, 0x549: 0x39ba, 0x54a: 0x2f23, 0x54b: 0x322f, 0x54c: 0x2f2d, 0x54d: 0x3239, 0x54e: 0x2f3c, 0x54f: 0x3248, 0x550: 0x2f32, 0x551: 0x323e, 0x552: 0x2f37, 0x553: 0x3243, 0x554: 0x384e, 0x555: 0x39dd, 0x556: 0x3855, 0x557: 0x39e4, 0x558: 0x2f78, 0x559: 0x3284, 0x55a: 0x2f7d, 0x55b: 0x3289, 0x55c: 0x3863, 0x55d: 0x39f2, 0x55e: 0x2f82, 0x55f: 0x328e, 0x560: 0x2f91, 0x561: 0x329d, 0x562: 0x2faf, 0x563: 0x32bb, 0x564: 0x2fbe, 0x565: 0x32ca, 0x566: 0x2fb4, 0x567: 0x32c0, 0x568: 0x2fc3, 0x569: 0x32cf, 0x56a: 0x2fc8, 0x56b: 0x32d4, 0x56c: 0x300e, 0x56d: 0x331a, 0x56e: 0x386a, 0x56f: 0x39f9, 0x570: 0x3018, 0x571: 0x3329, 0x572: 0x3022, 0x573: 0x3333, 0x574: 0x302c, 0x575: 0x333d, 0x576: 0x483b, 0x577: 0x48cc, 0x578: 0x3871, 0x579: 0x3a00, 0x57a: 0x3045, 0x57b: 0x3356, 0x57c: 0x3040, 0x57d: 0x3351, 0x57e: 0x304a, 0x57f: 0x335b, // Block 0x16, offset 0x580 0x580: 0x304f, 0x581: 0x3360, 0x582: 0x3054, 0x583: 0x3365, 0x584: 0x3068, 0x585: 0x3379, 0x586: 0x3072, 0x587: 0x3383, 0x588: 0x3081, 0x589: 0x3392, 0x58a: 0x307c, 0x58b: 0x338d, 0x58c: 0x3894, 0x58d: 0x3a23, 0x58e: 0x38a2, 0x58f: 0x3a31, 0x590: 0x38a9, 0x591: 0x3a38, 0x592: 0x38b0, 0x593: 0x3a3f, 0x594: 0x30ae, 0x595: 0x33bf, 0x596: 0x30b3, 0x597: 0x33c4, 0x598: 0x30bd, 0x599: 0x33ce, 0x59a: 0x4868, 0x59b: 0x48f9, 0x59c: 0x38f6, 0x59d: 0x3a85, 0x59e: 0x30d6, 0x59f: 0x33e7, 0x5a0: 0x30e0, 0x5a1: 0x33f1, 0x5a2: 0x4877, 0x5a3: 0x4908, 0x5a4: 0x38fd, 0x5a5: 0x3a8c, 0x5a6: 0x3904, 0x5a7: 0x3a93, 0x5a8: 0x390b, 0x5a9: 0x3a9a, 0x5aa: 0x30ef, 0x5ab: 0x3400, 0x5ac: 0x30f9, 0x5ad: 0x340f, 0x5ae: 0x310d, 0x5af: 0x3423, 0x5b0: 0x3108, 0x5b1: 0x341e, 0x5b2: 0x3149, 0x5b3: 0x345f, 0x5b4: 0x3158, 0x5b5: 0x346e, 0x5b6: 0x3153, 0x5b7: 0x3469, 0x5b8: 0x3912, 0x5b9: 0x3aa1, 0x5ba: 0x3919, 0x5bb: 0x3aa8, 0x5bc: 0x315d, 0x5bd: 0x3473, 0x5be: 0x3162, 0x5bf: 0x3478, // Block 0x17, offset 0x5c0 0x5c0: 0x3167, 0x5c1: 0x347d, 0x5c2: 0x316c, 0x5c3: 0x3482, 0x5c4: 0x317b, 0x5c5: 0x3491, 0x5c6: 0x3176, 0x5c7: 0x348c, 0x5c8: 0x3180, 0x5c9: 0x349b, 0x5ca: 0x3185, 0x5cb: 0x34a0, 0x5cc: 0x318a, 0x5cd: 0x34a5, 0x5ce: 0x31a8, 0x5cf: 0x34c3, 0x5d0: 0x31c1, 0x5d1: 0x34e1, 0x5d2: 0x31d0, 0x5d3: 0x34f0, 0x5d4: 0x31d5, 0x5d5: 0x34f5, 0x5d6: 0x32d9, 0x5d7: 0x3405, 0x5d8: 0x3496, 0x5d9: 0x34d2, 0x5da: 0x1d10, 0x5db: 0x43d6, 0x5e0: 0x4818, 0x5e1: 0x48a9, 0x5e2: 0x2ee2, 0x5e3: 0x31ee, 0x5e4: 0x37d7, 0x5e5: 0x3966, 0x5e6: 0x37d0, 0x5e7: 0x395f, 0x5e8: 0x37e5, 0x5e9: 0x3974, 0x5ea: 0x37de, 0x5eb: 0x396d, 0x5ec: 0x381d, 0x5ed: 0x39ac, 0x5ee: 0x37f3, 0x5ef: 0x3982, 0x5f0: 0x37ec, 0x5f1: 0x397b, 0x5f2: 0x3801, 0x5f3: 0x3990, 0x5f4: 0x37fa, 0x5f5: 0x3989, 0x5f6: 0x3824, 0x5f7: 0x39b3, 0x5f8: 0x482c, 0x5f9: 0x48bd, 0x5fa: 0x2f5f, 0x5fb: 0x326b, 0x5fc: 0x2f4b, 0x5fd: 0x3257, 0x5fe: 0x3839, 0x5ff: 0x39c8, // Block 0x18, offset 0x600 0x600: 0x3832, 0x601: 0x39c1, 0x602: 0x3847, 0x603: 0x39d6, 0x604: 0x3840, 0x605: 0x39cf, 0x606: 0x385c, 0x607: 0x39eb, 0x608: 0x2ff0, 0x609: 0x32fc, 0x60a: 0x3004, 0x60b: 0x3310, 0x60c: 0x485e, 0x60d: 0x48ef, 0x60e: 0x3095, 0x60f: 0x33a6, 0x610: 0x387f, 0x611: 0x3a0e, 0x612: 0x3878, 0x613: 0x3a07, 0x614: 0x388d, 0x615: 0x3a1c, 0x616: 0x3886, 0x617: 0x3a15, 0x618: 0x38e8, 0x619: 0x3a77, 0x61a: 0x38cc, 0x61b: 0x3a5b, 0x61c: 0x38c5, 0x61d: 0x3a54, 0x61e: 0x38da, 0x61f: 0x3a69, 0x620: 0x38d3, 0x621: 0x3a62, 0x622: 0x38e1, 0x623: 0x3a70, 0x624: 0x3144, 0x625: 0x345a, 0x626: 0x3126, 0x627: 0x343c, 0x628: 0x3943, 0x629: 0x3ad2, 0x62a: 0x393c, 0x62b: 0x3acb, 0x62c: 0x3951, 0x62d: 0x3ae0, 0x62e: 0x394a, 0x62f: 0x3ad9, 0x630: 0x3958, 0x631: 0x3ae7, 0x632: 0x318f, 0x633: 0x34aa, 0x634: 0x31b7, 0x635: 0x34d7, 0x636: 0x31b2, 0x637: 0x34cd, 0x638: 0x319e, 0x639: 0x34b9, // Block 0x19, offset 0x640 0x640: 0x497b, 0x641: 0x4981, 0x642: 0x4a95, 0x643: 0x4aad, 0x644: 0x4a9d, 0x645: 0x4ab5, 0x646: 0x4aa5, 0x647: 0x4abd, 0x648: 0x4921, 0x649: 0x4927, 0x64a: 0x4a05, 0x64b: 0x4a1d, 0x64c: 0x4a0d, 0x64d: 0x4a25, 0x64e: 0x4a15, 0x64f: 0x4a2d, 0x650: 0x498d, 0x651: 0x4993, 0x652: 0x3d17, 0x653: 0x3d27, 0x654: 0x3d1f, 0x655: 0x3d2f, 0x658: 0x492d, 0x659: 0x4933, 0x65a: 0x3c47, 0x65b: 0x3c57, 0x65c: 0x3c4f, 0x65d: 0x3c5f, 0x660: 0x49a5, 0x661: 0x49ab, 0x662: 0x4ac5, 0x663: 0x4add, 0x664: 0x4acd, 0x665: 0x4ae5, 0x666: 0x4ad5, 0x667: 0x4aed, 0x668: 0x4939, 0x669: 0x493f, 0x66a: 0x4a35, 0x66b: 0x4a4d, 0x66c: 0x4a3d, 0x66d: 0x4a55, 0x66e: 0x4a45, 0x66f: 0x4a5d, 0x670: 0x49bd, 0x671: 0x49c3, 0x672: 0x3d77, 0x673: 0x3d8f, 0x674: 0x3d7f, 0x675: 0x3d97, 0x676: 0x3d87, 0x677: 0x3d9f, 0x678: 0x4945, 0x679: 0x494b, 0x67a: 0x3c77, 0x67b: 0x3c8f, 0x67c: 0x3c7f, 0x67d: 0x3c97, 0x67e: 0x3c87, 0x67f: 0x3c9f, // Block 0x1a, offset 0x680 0x680: 0x49c9, 0x681: 0x49cf, 0x682: 0x3da7, 0x683: 0x3db7, 0x684: 0x3daf, 0x685: 0x3dbf, 0x688: 0x4951, 0x689: 0x4957, 0x68a: 0x3ca7, 0x68b: 0x3cb7, 0x68c: 0x3caf, 0x68d: 0x3cbf, 0x690: 0x49db, 0x691: 0x49e1, 0x692: 0x3ddf, 0x693: 0x3df7, 0x694: 0x3de7, 0x695: 0x3dff, 0x696: 0x3def, 0x697: 0x3e07, 0x699: 0x495d, 0x69b: 0x3cc7, 0x69d: 0x3ccf, 0x69f: 0x3cd7, 0x6a0: 0x49f3, 0x6a1: 0x49f9, 0x6a2: 0x4af5, 0x6a3: 0x4b0d, 0x6a4: 0x4afd, 0x6a5: 0x4b15, 0x6a6: 0x4b05, 0x6a7: 0x4b1d, 0x6a8: 0x4963, 0x6a9: 0x4969, 0x6aa: 0x4a65, 0x6ab: 0x4a7d, 0x6ac: 0x4a6d, 0x6ad: 0x4a85, 0x6ae: 0x4a75, 0x6af: 0x4a8d, 0x6b0: 0x496f, 0x6b1: 0x441d, 0x6b2: 0x35f0, 0x6b3: 0x4423, 0x6b4: 0x4999, 0x6b5: 0x4429, 0x6b6: 0x3602, 0x6b7: 0x442f, 0x6b8: 0x3620, 0x6b9: 0x4435, 0x6ba: 0x3638, 0x6bb: 0x443b, 0x6bc: 0x49e7, 0x6bd: 0x4441, // Block 0x1b, offset 0x6c0 0x6c0: 0x3cff, 0x6c1: 0x3d07, 0x6c2: 0x41d3, 0x6c3: 0x41f1, 0x6c4: 0x41dd, 0x6c5: 0x41fb, 0x6c6: 0x41e7, 0x6c7: 0x4205, 0x6c8: 0x3c37, 0x6c9: 0x3c3f, 0x6ca: 0x411f, 0x6cb: 0x413d, 0x6cc: 0x4129, 0x6cd: 0x4147, 0x6ce: 0x4133, 0x6cf: 0x4151, 0x6d0: 0x3d47, 0x6d1: 0x3d4f, 0x6d2: 0x420f, 0x6d3: 0x422d, 0x6d4: 0x4219, 0x6d5: 0x4237, 0x6d6: 0x4223, 0x6d7: 0x4241, 0x6d8: 0x3c67, 0x6d9: 0x3c6f, 0x6da: 0x415b, 0x6db: 0x4179, 0x6dc: 0x4165, 0x6dd: 0x4183, 0x6de: 0x416f, 0x6df: 0x418d, 0x6e0: 0x3e1f, 0x6e1: 0x3e27, 0x6e2: 0x424b, 0x6e3: 0x4269, 0x6e4: 0x4255, 0x6e5: 0x4273, 0x6e6: 0x425f, 0x6e7: 0x427d, 0x6e8: 0x3cdf, 0x6e9: 0x3ce7, 0x6ea: 0x4197, 0x6eb: 0x41b5, 0x6ec: 0x41a1, 0x6ed: 0x41bf, 0x6ee: 0x41ab, 0x6ef: 0x41c9, 0x6f0: 0x35e4, 0x6f1: 0x35de, 0x6f2: 0x3cef, 0x6f3: 0x35ea, 0x6f4: 0x3cf7, 0x6f6: 0x4987, 0x6f7: 0x3d0f, 0x6f8: 0x3554, 0x6f9: 0x354e, 0x6fa: 0x3542, 0x6fb: 0x43ed, 0x6fc: 0x355a, 0x6fd: 0x4386, 0x6fe: 0x0257, 0x6ff: 0x4386, // Block 0x1c, offset 0x700 0x700: 0x439f, 0x701: 0x4581, 0x702: 0x3d37, 0x703: 0x35fc, 0x704: 0x3d3f, 0x706: 0x49b1, 0x707: 0x3d57, 0x708: 0x3560, 0x709: 0x43f3, 0x70a: 0x356c, 0x70b: 0x43f9, 0x70c: 0x3578, 0x70d: 0x4588, 0x70e: 0x458f, 0x70f: 0x4596, 0x710: 0x3614, 0x711: 0x360e, 0x712: 0x3d5f, 0x713: 0x45e3, 0x716: 0x361a, 0x717: 0x3d6f, 0x718: 0x3590, 0x719: 0x358a, 0x71a: 0x357e, 0x71b: 0x43ff, 0x71d: 0x459d, 0x71e: 0x45a4, 0x71f: 0x45ab, 0x720: 0x364a, 0x721: 0x3644, 0x722: 0x3dc7, 0x723: 0x45eb, 0x724: 0x362c, 0x725: 0x3632, 0x726: 0x3650, 0x727: 0x3dd7, 0x728: 0x35c0, 0x729: 0x35ba, 0x72a: 0x35ae, 0x72b: 0x440b, 0x72c: 0x35a8, 0x72d: 0x4573, 0x72e: 0x457a, 0x72f: 0x0081, 0x732: 0x3e0f, 0x733: 0x3656, 0x734: 0x3e17, 0x736: 0x49ff, 0x737: 0x3e2f, 0x738: 0x359c, 0x739: 0x4405, 0x73a: 0x35cc, 0x73b: 0x4417, 0x73c: 0x35d8, 0x73d: 0x4359, 0x73e: 0x438b, // Block 0x1d, offset 0x740 0x740: 0x1d08, 0x741: 0x1d0c, 0x742: 0x0047, 0x743: 0x1d84, 0x745: 0x1d18, 0x746: 0x1d1c, 0x747: 0x00ef, 0x749: 0x1d88, 0x74a: 0x008f, 0x74b: 0x0051, 0x74c: 0x0051, 0x74d: 0x0051, 0x74e: 0x0091, 0x74f: 0x00e0, 0x750: 0x0053, 0x751: 0x0053, 0x752: 0x0059, 0x753: 0x0099, 0x755: 0x005d, 0x756: 0x1abd, 0x759: 0x0061, 0x75a: 0x0063, 0x75b: 0x0065, 0x75c: 0x0065, 0x75d: 0x0065, 0x760: 0x1acf, 0x761: 0x1cf8, 0x762: 0x1ad8, 0x764: 0x0075, 0x766: 0x023c, 0x768: 0x0075, 0x76a: 0x0057, 0x76b: 0x43d1, 0x76c: 0x0045, 0x76d: 0x0047, 0x76f: 0x008b, 0x770: 0x004b, 0x771: 0x004d, 0x773: 0x005b, 0x774: 0x009f, 0x775: 0x0308, 0x776: 0x030b, 0x777: 0x030e, 0x778: 0x0311, 0x779: 0x0093, 0x77b: 0x1cc8, 0x77c: 0x026c, 0x77d: 0x0245, 0x77e: 0x01fd, 0x77f: 0x0224, // Block 0x1e, offset 0x780 0x780: 0x055a, 0x785: 0x0049, 0x786: 0x0089, 0x787: 0x008b, 0x788: 0x0093, 0x789: 0x0095, 0x790: 0x235e, 0x791: 0x236a, 0x792: 0x241e, 0x793: 0x2346, 0x794: 0x23ca, 0x795: 0x2352, 0x796: 0x23d0, 0x797: 0x23e8, 0x798: 0x23f4, 0x799: 0x2358, 0x79a: 0x23fa, 0x79b: 0x2364, 0x79c: 0x23ee, 0x79d: 0x2400, 0x79e: 0x2406, 0x79f: 0x1dec, 0x7a0: 0x0053, 0x7a1: 0x1a87, 0x7a2: 0x1cd4, 0x7a3: 0x1a90, 0x7a4: 0x006d, 0x7a5: 0x1adb, 0x7a6: 0x1d00, 0x7a7: 0x1e78, 0x7a8: 0x1a93, 0x7a9: 0x0071, 0x7aa: 0x1ae7, 0x7ab: 0x1d04, 0x7ac: 0x0059, 0x7ad: 0x0047, 0x7ae: 0x0049, 0x7af: 0x005b, 0x7b0: 0x0093, 0x7b1: 0x1b14, 0x7b2: 0x1d48, 0x7b3: 0x1b1d, 0x7b4: 0x00ad, 0x7b5: 0x1b92, 0x7b6: 0x1d7c, 0x7b7: 0x1e8c, 0x7b8: 0x1b20, 0x7b9: 0x00b1, 0x7ba: 0x1b95, 0x7bb: 0x1d80, 0x7bc: 0x0099, 0x7bd: 0x0087, 0x7be: 0x0089, 0x7bf: 0x009b, // Block 0x1f, offset 0x7c0 0x7c1: 0x3b65, 0x7c3: 0xa000, 0x7c4: 0x3b6c, 0x7c5: 0xa000, 0x7c7: 0x3b73, 0x7c8: 0xa000, 0x7c9: 0x3b7a, 0x7cd: 0xa000, 0x7e0: 0x2ec4, 0x7e1: 0xa000, 0x7e2: 0x3b88, 0x7e4: 0xa000, 0x7e5: 0xa000, 0x7ed: 0x3b81, 0x7ee: 0x2ebf, 0x7ef: 0x2ec9, 0x7f0: 0x3b8f, 0x7f1: 0x3b96, 0x7f2: 0xa000, 0x7f3: 0xa000, 0x7f4: 0x3b9d, 0x7f5: 0x3ba4, 0x7f6: 0xa000, 0x7f7: 0xa000, 0x7f8: 0x3bab, 0x7f9: 0x3bb2, 0x7fa: 0xa000, 0x7fb: 0xa000, 0x7fc: 0xa000, 0x7fd: 0xa000, // Block 0x20, offset 0x800 0x800: 0x3bb9, 0x801: 0x3bc0, 0x802: 0xa000, 0x803: 0xa000, 0x804: 0x3bd5, 0x805: 0x3bdc, 0x806: 0xa000, 0x807: 0xa000, 0x808: 0x3be3, 0x809: 0x3bea, 0x811: 0xa000, 0x812: 0xa000, 0x822: 0xa000, 0x828: 0xa000, 0x829: 0xa000, 0x82b: 0xa000, 0x82c: 0x3bff, 0x82d: 0x3c06, 0x82e: 0x3c0d, 0x82f: 0x3c14, 0x832: 0xa000, 0x833: 0xa000, 0x834: 0xa000, 0x835: 0xa000, // Block 0x21, offset 0x840 0x860: 0x0023, 0x861: 0x0025, 0x862: 0x0027, 0x863: 0x0029, 0x864: 0x002b, 0x865: 0x002d, 0x866: 0x002f, 0x867: 0x0031, 0x868: 0x0033, 0x869: 0x19af, 0x86a: 0x19b2, 0x86b: 0x19b5, 0x86c: 0x19b8, 0x86d: 0x19bb, 0x86e: 0x19be, 0x86f: 0x19c1, 0x870: 0x19c4, 0x871: 0x19c7, 0x872: 0x19ca, 0x873: 0x19d3, 0x874: 0x1b98, 0x875: 0x1b9c, 0x876: 0x1ba0, 0x877: 0x1ba4, 0x878: 0x1ba8, 0x879: 0x1bac, 0x87a: 0x1bb0, 0x87b: 0x1bb4, 0x87c: 0x1bb8, 0x87d: 0x1db0, 0x87e: 0x1db5, 0x87f: 0x1dba, // Block 0x22, offset 0x880 0x880: 0x1dbf, 0x881: 0x1dc4, 0x882: 0x1dc9, 0x883: 0x1dce, 0x884: 0x1dd3, 0x885: 0x1dd8, 0x886: 0x1ddd, 0x887: 0x1de2, 0x888: 0x19ac, 0x889: 0x19d0, 0x88a: 0x19f4, 0x88b: 0x1a18, 0x88c: 0x1a3c, 0x88d: 0x1a45, 0x88e: 0x1a4b, 0x88f: 0x1a51, 0x890: 0x1a57, 0x891: 0x1c90, 0x892: 0x1c94, 0x893: 0x1c98, 0x894: 0x1c9c, 0x895: 0x1ca0, 0x896: 0x1ca4, 0x897: 0x1ca8, 0x898: 0x1cac, 0x899: 0x1cb0, 0x89a: 0x1cb4, 0x89b: 0x1cb8, 0x89c: 0x1c24, 0x89d: 0x1c28, 0x89e: 0x1c2c, 0x89f: 0x1c30, 0x8a0: 0x1c34, 0x8a1: 0x1c38, 0x8a2: 0x1c3c, 0x8a3: 0x1c40, 0x8a4: 0x1c44, 0x8a5: 0x1c48, 0x8a6: 0x1c4c, 0x8a7: 0x1c50, 0x8a8: 0x1c54, 0x8a9: 0x1c58, 0x8aa: 0x1c5c, 0x8ab: 0x1c60, 0x8ac: 0x1c64, 0x8ad: 0x1c68, 0x8ae: 0x1c6c, 0x8af: 0x1c70, 0x8b0: 0x1c74, 0x8b1: 0x1c78, 0x8b2: 0x1c7c, 0x8b3: 0x1c80, 0x8b4: 0x1c84, 0x8b5: 0x1c88, 0x8b6: 0x0043, 0x8b7: 0x0045, 0x8b8: 0x0047, 0x8b9: 0x0049, 0x8ba: 0x004b, 0x8bb: 0x004d, 0x8bc: 0x004f, 0x8bd: 0x0051, 0x8be: 0x0053, 0x8bf: 0x0055, // Block 0x23, offset 0x8c0 0x8c0: 0x07ba, 0x8c1: 0x07de, 0x8c2: 0x07ea, 0x8c3: 0x07fa, 0x8c4: 0x0802, 0x8c5: 0x080e, 0x8c6: 0x0816, 0x8c7: 0x081e, 0x8c8: 0x082a, 0x8c9: 0x087e, 0x8ca: 0x0896, 0x8cb: 0x08a6, 0x8cc: 0x08b6, 0x8cd: 0x08c6, 0x8ce: 0x08d6, 0x8cf: 0x08f6, 0x8d0: 0x08fa, 0x8d1: 0x08fe, 0x8d2: 0x0932, 0x8d3: 0x095a, 0x8d4: 0x096a, 0x8d5: 0x0972, 0x8d6: 0x0976, 0x8d7: 0x0982, 0x8d8: 0x099e, 0x8d9: 0x09a2, 0x8da: 0x09ba, 0x8db: 0x09be, 0x8dc: 0x09c6, 0x8dd: 0x09d6, 0x8de: 0x0a72, 0x8df: 0x0a86, 0x8e0: 0x0ac6, 0x8e1: 0x0ada, 0x8e2: 0x0ae2, 0x8e3: 0x0ae6, 0x8e4: 0x0af6, 0x8e5: 0x0b12, 0x8e6: 0x0b3e, 0x8e7: 0x0b4a, 0x8e8: 0x0b6a, 0x8e9: 0x0b76, 0x8ea: 0x0b7a, 0x8eb: 0x0b7e, 0x8ec: 0x0b96, 0x8ed: 0x0b9a, 0x8ee: 0x0bc6, 0x8ef: 0x0bd2, 0x8f0: 0x0bda, 0x8f1: 0x0be2, 0x8f2: 0x0bf2, 0x8f3: 0x0bfa, 0x8f4: 0x0c02, 0x8f5: 0x0c2e, 0x8f6: 0x0c32, 0x8f7: 0x0c3a, 0x8f8: 0x0c3e, 0x8f9: 0x0c46, 0x8fa: 0x0c4e, 0x8fb: 0x0c5e, 0x8fc: 0x0c7a, 0x8fd: 0x0cf2, 0x8fe: 0x0d06, 0x8ff: 0x0d0a, // Block 0x24, offset 0x900 0x900: 0x0d8a, 0x901: 0x0d8e, 0x902: 0x0da2, 0x903: 0x0da6, 0x904: 0x0dae, 0x905: 0x0db6, 0x906: 0x0dbe, 0x907: 0x0dca, 0x908: 0x0df2, 0x909: 0x0e02, 0x90a: 0x0e16, 0x90b: 0x0e86, 0x90c: 0x0e92, 0x90d: 0x0ea2, 0x90e: 0x0eae, 0x90f: 0x0eba, 0x910: 0x0ec2, 0x911: 0x0ec6, 0x912: 0x0eca, 0x913: 0x0ece, 0x914: 0x0ed2, 0x915: 0x0f8a, 0x916: 0x0fd2, 0x917: 0x0fde, 0x918: 0x0fe2, 0x919: 0x0fe6, 0x91a: 0x0fea, 0x91b: 0x0ff2, 0x91c: 0x0ff6, 0x91d: 0x100a, 0x91e: 0x1026, 0x91f: 0x102e, 0x920: 0x106e, 0x921: 0x1072, 0x922: 0x107a, 0x923: 0x107e, 0x924: 0x1086, 0x925: 0x108a, 0x926: 0x10ae, 0x927: 0x10b2, 0x928: 0x10ce, 0x929: 0x10d2, 0x92a: 0x10d6, 0x92b: 0x10da, 0x92c: 0x10ee, 0x92d: 0x1112, 0x92e: 0x1116, 0x92f: 0x111a, 0x930: 0x113e, 0x931: 0x117e, 0x932: 0x1182, 0x933: 0x11a2, 0x934: 0x11b2, 0x935: 0x11ba, 0x936: 0x11da, 0x937: 0x11fe, 0x938: 0x1242, 0x939: 0x124a, 0x93a: 0x125e, 0x93b: 0x126a, 0x93c: 0x1272, 0x93d: 0x127a, 0x93e: 0x127e, 0x93f: 0x1282, // Block 0x25, offset 0x940 0x940: 0x129a, 0x941: 0x129e, 0x942: 0x12ba, 0x943: 0x12c2, 0x944: 0x12ca, 0x945: 0x12ce, 0x946: 0x12da, 0x947: 0x12e2, 0x948: 0x12e6, 0x949: 0x12ea, 0x94a: 0x12f2, 0x94b: 0x12f6, 0x94c: 0x1396, 0x94d: 0x13aa, 0x94e: 0x13de, 0x94f: 0x13e2, 0x950: 0x13ea, 0x951: 0x1416, 0x952: 0x141e, 0x953: 0x1426, 0x954: 0x142e, 0x955: 0x146a, 0x956: 0x146e, 0x957: 0x1476, 0x958: 0x147a, 0x959: 0x147e, 0x95a: 0x14aa, 0x95b: 0x14ae, 0x95c: 0x14b6, 0x95d: 0x14ca, 0x95e: 0x14ce, 0x95f: 0x14ea, 0x960: 0x14f2, 0x961: 0x14f6, 0x962: 0x151a, 0x963: 0x153a, 0x964: 0x154e, 0x965: 0x1552, 0x966: 0x155a, 0x967: 0x1586, 0x968: 0x158a, 0x969: 0x159a, 0x96a: 0x15be, 0x96b: 0x15ca, 0x96c: 0x15da, 0x96d: 0x15f2, 0x96e: 0x15fa, 0x96f: 0x15fe, 0x970: 0x1602, 0x971: 0x1606, 0x972: 0x1612, 0x973: 0x1616, 0x974: 0x161e, 0x975: 0x163a, 0x976: 0x163e, 0x977: 0x1642, 0x978: 0x165a, 0x979: 0x165e, 0x97a: 0x1666, 0x97b: 0x167a, 0x97c: 0x167e, 0x97d: 0x1682, 0x97e: 0x168a, 0x97f: 0x168e, // Block 0x26, offset 0x980 0x986: 0xa000, 0x98b: 0xa000, 0x98c: 0x3f47, 0x98d: 0xa000, 0x98e: 0x3f4f, 0x98f: 0xa000, 0x990: 0x3f57, 0x991: 0xa000, 0x992: 0x3f5f, 0x993: 0xa000, 0x994: 0x3f67, 0x995: 0xa000, 0x996: 0x3f6f, 0x997: 0xa000, 0x998: 0x3f77, 0x999: 0xa000, 0x99a: 0x3f7f, 0x99b: 0xa000, 0x99c: 0x3f87, 0x99d: 0xa000, 0x99e: 0x3f8f, 0x99f: 0xa000, 0x9a0: 0x3f97, 0x9a1: 0xa000, 0x9a2: 0x3f9f, 0x9a4: 0xa000, 0x9a5: 0x3fa7, 0x9a6: 0xa000, 0x9a7: 0x3faf, 0x9a8: 0xa000, 0x9a9: 0x3fb7, 0x9af: 0xa000, 0x9b0: 0x3fbf, 0x9b1: 0x3fc7, 0x9b2: 0xa000, 0x9b3: 0x3fcf, 0x9b4: 0x3fd7, 0x9b5: 0xa000, 0x9b6: 0x3fdf, 0x9b7: 0x3fe7, 0x9b8: 0xa000, 0x9b9: 0x3fef, 0x9ba: 0x3ff7, 0x9bb: 0xa000, 0x9bc: 0x3fff, 0x9bd: 0x4007, // Block 0x27, offset 0x9c0 0x9d4: 0x3f3f, 0x9d9: 0x9904, 0x9da: 0x9904, 0x9db: 0x43db, 0x9dc: 0x43e1, 0x9dd: 0xa000, 0x9de: 0x400f, 0x9df: 0x27e4, 0x9e6: 0xa000, 0x9eb: 0xa000, 0x9ec: 0x401f, 0x9ed: 0xa000, 0x9ee: 0x4027, 0x9ef: 0xa000, 0x9f0: 0x402f, 0x9f1: 0xa000, 0x9f2: 0x4037, 0x9f3: 0xa000, 0x9f4: 0x403f, 0x9f5: 0xa000, 0x9f6: 0x4047, 0x9f7: 0xa000, 0x9f8: 0x404f, 0x9f9: 0xa000, 0x9fa: 0x4057, 0x9fb: 0xa000, 0x9fc: 0x405f, 0x9fd: 0xa000, 0x9fe: 0x4067, 0x9ff: 0xa000, // Block 0x28, offset 0xa00 0xa00: 0x406f, 0xa01: 0xa000, 0xa02: 0x4077, 0xa04: 0xa000, 0xa05: 0x407f, 0xa06: 0xa000, 0xa07: 0x4087, 0xa08: 0xa000, 0xa09: 0x408f, 0xa0f: 0xa000, 0xa10: 0x4097, 0xa11: 0x409f, 0xa12: 0xa000, 0xa13: 0x40a7, 0xa14: 0x40af, 0xa15: 0xa000, 0xa16: 0x40b7, 0xa17: 0x40bf, 0xa18: 0xa000, 0xa19: 0x40c7, 0xa1a: 0x40cf, 0xa1b: 0xa000, 0xa1c: 0x40d7, 0xa1d: 0x40df, 0xa2f: 0xa000, 0xa30: 0xa000, 0xa31: 0xa000, 0xa32: 0xa000, 0xa34: 0x4017, 0xa37: 0x40e7, 0xa38: 0x40ef, 0xa39: 0x40f7, 0xa3a: 0x40ff, 0xa3d: 0xa000, 0xa3e: 0x4107, 0xa3f: 0x27f9, // Block 0x29, offset 0xa40 0xa40: 0x045a, 0xa41: 0x041e, 0xa42: 0x0422, 0xa43: 0x0426, 0xa44: 0x046e, 0xa45: 0x042a, 0xa46: 0x042e, 0xa47: 0x0432, 0xa48: 0x0436, 0xa49: 0x043a, 0xa4a: 0x043e, 0xa4b: 0x0442, 0xa4c: 0x0446, 0xa4d: 0x044a, 0xa4e: 0x044e, 0xa4f: 0x4b4e, 0xa50: 0x4b54, 0xa51: 0x4b5a, 0xa52: 0x4b60, 0xa53: 0x4b66, 0xa54: 0x4b6c, 0xa55: 0x4b72, 0xa56: 0x4b78, 0xa57: 0x4b7e, 0xa58: 0x4b84, 0xa59: 0x4b8a, 0xa5a: 0x4b90, 0xa5b: 0x4b96, 0xa5c: 0x4b9c, 0xa5d: 0x4ba2, 0xa5e: 0x4ba8, 0xa5f: 0x4bae, 0xa60: 0x4bb4, 0xa61: 0x4bba, 0xa62: 0x4bc0, 0xa63: 0x4bc6, 0xa64: 0x04b6, 0xa65: 0x0452, 0xa66: 0x0456, 0xa67: 0x04da, 0xa68: 0x04de, 0xa69: 0x04e2, 0xa6a: 0x04e6, 0xa6b: 0x04ea, 0xa6c: 0x04ee, 0xa6d: 0x04f2, 0xa6e: 0x045e, 0xa6f: 0x04f6, 0xa70: 0x04fa, 0xa71: 0x0462, 0xa72: 0x0466, 0xa73: 0x046a, 0xa74: 0x0472, 0xa75: 0x0476, 0xa76: 0x047a, 0xa77: 0x047e, 0xa78: 0x0482, 0xa79: 0x0486, 0xa7a: 0x048a, 0xa7b: 0x048e, 0xa7c: 0x0492, 0xa7d: 0x0496, 0xa7e: 0x049a, 0xa7f: 0x049e, // Block 0x2a, offset 0xa80 0xa80: 0x04a2, 0xa81: 0x04a6, 0xa82: 0x04fe, 0xa83: 0x0502, 0xa84: 0x04aa, 0xa85: 0x04ae, 0xa86: 0x04b2, 0xa87: 0x04ba, 0xa88: 0x04be, 0xa89: 0x04c2, 0xa8a: 0x04c6, 0xa8b: 0x04ca, 0xa8c: 0x04ce, 0xa8d: 0x04d2, 0xa8e: 0x04d6, 0xa92: 0x07ba, 0xa93: 0x0816, 0xa94: 0x07c6, 0xa95: 0x0a76, 0xa96: 0x07ca, 0xa97: 0x07e2, 0xa98: 0x07ce, 0xa99: 0x108e, 0xa9a: 0x0802, 0xa9b: 0x07d6, 0xa9c: 0x07be, 0xa9d: 0x0afa, 0xa9e: 0x0a8a, 0xa9f: 0x082a, // Block 0x2b, offset 0xac0 0xac0: 0x2184, 0xac1: 0x218a, 0xac2: 0x2190, 0xac3: 0x2196, 0xac4: 0x219c, 0xac5: 0x21a2, 0xac6: 0x21a8, 0xac7: 0x21ae, 0xac8: 0x21b4, 0xac9: 0x21ba, 0xaca: 0x21c0, 0xacb: 0x21c6, 0xacc: 0x21cc, 0xacd: 0x21d2, 0xace: 0x285d, 0xacf: 0x2866, 0xad0: 0x286f, 0xad1: 0x2878, 0xad2: 0x2881, 0xad3: 0x288a, 0xad4: 0x2893, 0xad5: 0x289c, 0xad6: 0x28a5, 0xad7: 0x28b7, 0xad8: 0x28c0, 0xad9: 0x28c9, 0xada: 0x28d2, 0xadb: 0x28db, 0xadc: 0x28ae, 0xadd: 0x2ce3, 0xade: 0x2c24, 0xae0: 0x21d8, 0xae1: 0x21f0, 0xae2: 0x21e4, 0xae3: 0x2238, 0xae4: 0x21f6, 0xae5: 0x2214, 0xae6: 0x21de, 0xae7: 0x220e, 0xae8: 0x21ea, 0xae9: 0x2220, 0xaea: 0x2250, 0xaeb: 0x226e, 0xaec: 0x2268, 0xaed: 0x225c, 0xaee: 0x22aa, 0xaef: 0x223e, 0xaf0: 0x224a, 0xaf1: 0x2262, 0xaf2: 0x2256, 0xaf3: 0x2280, 0xaf4: 0x222c, 0xaf5: 0x2274, 0xaf6: 0x229e, 0xaf7: 0x2286, 0xaf8: 0x221a, 0xaf9: 0x21fc, 0xafa: 0x2232, 0xafb: 0x2244, 0xafc: 0x227a, 0xafd: 0x2202, 0xafe: 0x22a4, 0xaff: 0x2226, // Block 0x2c, offset 0xb00 0xb00: 0x228c, 0xb01: 0x2208, 0xb02: 0x2292, 0xb03: 0x2298, 0xb04: 0x0a2a, 0xb05: 0x0bfe, 0xb06: 0x0da2, 0xb07: 0x11c2, 0xb10: 0x1cf4, 0xb11: 0x19d6, 0xb12: 0x19d9, 0xb13: 0x19dc, 0xb14: 0x19df, 0xb15: 0x19e2, 0xb16: 0x19e5, 0xb17: 0x19e8, 0xb18: 0x19eb, 0xb19: 0x19ee, 0xb1a: 0x19f7, 0xb1b: 0x19fa, 0xb1c: 0x19fd, 0xb1d: 0x1a00, 0xb1e: 0x1a03, 0xb1f: 0x1a06, 0xb20: 0x0406, 0xb21: 0x040e, 0xb22: 0x0412, 0xb23: 0x041a, 0xb24: 0x041e, 0xb25: 0x0422, 0xb26: 0x042a, 0xb27: 0x0432, 0xb28: 0x0436, 0xb29: 0x043e, 0xb2a: 0x0442, 0xb2b: 0x0446, 0xb2c: 0x044a, 0xb2d: 0x044e, 0xb2e: 0x46c3, 0xb2f: 0x46cb, 0xb30: 0x46d3, 0xb31: 0x46db, 0xb32: 0x46e3, 0xb33: 0x46eb, 0xb34: 0x46f3, 0xb35: 0x46fb, 0xb36: 0x470b, 0xb37: 0x4713, 0xb38: 0x471b, 0xb39: 0x4723, 0xb3a: 0x472b, 0xb3b: 0x4733, 0xb3c: 0x2e42, 0xb3d: 0x2e0a, 0xb3e: 0x4703, // Block 0x2d, offset 0xb40 0xb40: 0x07ba, 0xb41: 0x0816, 0xb42: 0x07c6, 0xb43: 0x0a76, 0xb44: 0x081a, 0xb45: 0x08aa, 0xb46: 0x07c2, 0xb47: 0x08a6, 0xb48: 0x0806, 0xb49: 0x0982, 0xb4a: 0x0e02, 0xb4b: 0x0f8a, 0xb4c: 0x0ed2, 0xb4d: 0x0e16, 0xb4e: 0x155a, 0xb4f: 0x0a86, 0xb50: 0x0dca, 0xb51: 0x0e46, 0xb52: 0x0e06, 0xb53: 0x1146, 0xb54: 0x09f6, 0xb55: 0x0ffe, 0xb56: 0x1482, 0xb57: 0x115a, 0xb58: 0x093e, 0xb59: 0x118a, 0xb5a: 0x1096, 0xb5b: 0x0b12, 0xb5c: 0x150a, 0xb5d: 0x087a, 0xb5e: 0x09a6, 0xb5f: 0x0ef2, 0xb60: 0x1622, 0xb61: 0x083e, 0xb62: 0x08ce, 0xb63: 0x0e96, 0xb64: 0x07ca, 0xb65: 0x07e2, 0xb66: 0x07ce, 0xb67: 0x0bd6, 0xb68: 0x09ea, 0xb69: 0x097a, 0xb6a: 0x0b52, 0xb6b: 0x0b46, 0xb6c: 0x10e6, 0xb6d: 0x083a, 0xb6e: 0x1496, 0xb6f: 0x0996, 0xb70: 0x0aee, 0xb71: 0x1a09, 0xb72: 0x1a0c, 0xb73: 0x1a0f, 0xb74: 0x1a12, 0xb75: 0x1a1b, 0xb76: 0x1a1e, 0xb77: 0x1a21, 0xb78: 0x1a24, 0xb79: 0x1a27, 0xb7a: 0x1a2a, 0xb7b: 0x1a2d, 0xb7c: 0x1a30, 0xb7d: 0x1a33, 0xb7e: 0x1a36, 0xb7f: 0x1a3f, // Block 0x2e, offset 0xb80 0xb80: 0x1df6, 0xb81: 0x1e05, 0xb82: 0x1e14, 0xb83: 0x1e23, 0xb84: 0x1e32, 0xb85: 0x1e41, 0xb86: 0x1e50, 0xb87: 0x1e5f, 0xb88: 0x1e6e, 0xb89: 0x22bc, 0xb8a: 0x22ce, 0xb8b: 0x22e0, 0xb8c: 0x1a81, 0xb8d: 0x1d34, 0xb8e: 0x1b02, 0xb8f: 0x1cd8, 0xb90: 0x05c6, 0xb91: 0x05ce, 0xb92: 0x05d6, 0xb93: 0x05de, 0xb94: 0x05e6, 0xb95: 0x05ea, 0xb96: 0x05ee, 0xb97: 0x05f2, 0xb98: 0x05f6, 0xb99: 0x05fa, 0xb9a: 0x05fe, 0xb9b: 0x0602, 0xb9c: 0x0606, 0xb9d: 0x060a, 0xb9e: 0x060e, 0xb9f: 0x0612, 0xba0: 0x0616, 0xba1: 0x061e, 0xba2: 0x0622, 0xba3: 0x0626, 0xba4: 0x062a, 0xba5: 0x062e, 0xba6: 0x0632, 0xba7: 0x0636, 0xba8: 0x063a, 0xba9: 0x063e, 0xbaa: 0x0642, 0xbab: 0x0646, 0xbac: 0x064a, 0xbad: 0x064e, 0xbae: 0x0652, 0xbaf: 0x0656, 0xbb0: 0x065a, 0xbb1: 0x065e, 0xbb2: 0x0662, 0xbb3: 0x066a, 0xbb4: 0x0672, 0xbb5: 0x067a, 0xbb6: 0x067e, 0xbb7: 0x0682, 0xbb8: 0x0686, 0xbb9: 0x068a, 0xbba: 0x068e, 0xbbb: 0x0692, 0xbbc: 0x0696, 0xbbd: 0x069a, 0xbbe: 0x069e, 0xbbf: 0x282a, // Block 0x2f, offset 0xbc0 0xbc0: 0x2c43, 0xbc1: 0x2adf, 0xbc2: 0x2c53, 0xbc3: 0x29b7, 0xbc4: 0x2e53, 0xbc5: 0x29c1, 0xbc6: 0x29cb, 0xbc7: 0x2e97, 0xbc8: 0x2aec, 0xbc9: 0x29d5, 0xbca: 0x29df, 0xbcb: 0x29e9, 0xbcc: 0x2b13, 0xbcd: 0x2b20, 0xbce: 0x2af9, 0xbcf: 0x2b06, 0xbd0: 0x2e18, 0xbd1: 0x2b2d, 0xbd2: 0x2b3a, 0xbd3: 0x2cf5, 0xbd4: 0x27eb, 0xbd5: 0x2d08, 0xbd6: 0x2d1b, 0xbd7: 0x2c63, 0xbd8: 0x2b47, 0xbd9: 0x2d2e, 0xbda: 0x2d41, 0xbdb: 0x2b54, 0xbdc: 0x29f3, 0xbdd: 0x29fd, 0xbde: 0x2e26, 0xbdf: 0x2b61, 0xbe0: 0x2c73, 0xbe1: 0x2e64, 0xbe2: 0x2a07, 0xbe3: 0x2a11, 0xbe4: 0x2b6e, 0xbe5: 0x2a1b, 0xbe6: 0x2a25, 0xbe7: 0x2800, 0xbe8: 0x2807, 0xbe9: 0x2a2f, 0xbea: 0x2a39, 0xbeb: 0x2d54, 0xbec: 0x2b7b, 0xbed: 0x2c83, 0xbee: 0x2d67, 0xbef: 0x2b88, 0xbf0: 0x2a4d, 0xbf1: 0x2a43, 0xbf2: 0x2eab, 0xbf3: 0x2b95, 0xbf4: 0x2d7a, 0xbf5: 0x2a57, 0xbf6: 0x2c93, 0xbf7: 0x2a61, 0xbf8: 0x2baf, 0xbf9: 0x2a6b, 0xbfa: 0x2bbc, 0xbfb: 0x2e75, 0xbfc: 0x2ba2, 0xbfd: 0x2ca3, 0xbfe: 0x2bc9, 0xbff: 0x280e, // Block 0x30, offset 0xc00 0xc00: 0x2e86, 0xc01: 0x2a75, 0xc02: 0x2a7f, 0xc03: 0x2bd6, 0xc04: 0x2a89, 0xc05: 0x2a93, 0xc06: 0x2a9d, 0xc07: 0x2cb3, 0xc08: 0x2be3, 0xc09: 0x2815, 0xc0a: 0x2d8d, 0xc0b: 0x2dff, 0xc0c: 0x2cc3, 0xc0d: 0x2bf0, 0xc0e: 0x2e34, 0xc0f: 0x2aa7, 0xc10: 0x2ab1, 0xc11: 0x2bfd, 0xc12: 0x281c, 0xc13: 0x2c0a, 0xc14: 0x2cd3, 0xc15: 0x2823, 0xc16: 0x2da0, 0xc17: 0x2abb, 0xc18: 0x1de7, 0xc19: 0x1dfb, 0xc1a: 0x1e0a, 0xc1b: 0x1e19, 0xc1c: 0x1e28, 0xc1d: 0x1e37, 0xc1e: 0x1e46, 0xc1f: 0x1e55, 0xc20: 0x1e64, 0xc21: 0x1e73, 0xc22: 0x22c2, 0xc23: 0x22d4, 0xc24: 0x22e6, 0xc25: 0x22f2, 0xc26: 0x22fe, 0xc27: 0x230a, 0xc28: 0x2316, 0xc29: 0x2322, 0xc2a: 0x232e, 0xc2b: 0x233a, 0xc2c: 0x2376, 0xc2d: 0x2382, 0xc2e: 0x238e, 0xc2f: 0x239a, 0xc30: 0x23a6, 0xc31: 0x1d44, 0xc32: 0x1af6, 0xc33: 0x1a63, 0xc34: 0x1d14, 0xc35: 0x1b77, 0xc36: 0x1b86, 0xc37: 0x1afc, 0xc38: 0x1d2c, 0xc39: 0x1d30, 0xc3a: 0x1a8d, 0xc3b: 0x2838, 0xc3c: 0x2846, 0xc3d: 0x2831, 0xc3e: 0x283f, 0xc3f: 0x2c17, // Block 0x31, offset 0xc40 0xc40: 0x1b7a, 0xc41: 0x1b62, 0xc42: 0x1d90, 0xc43: 0x1b4a, 0xc44: 0x1b23, 0xc45: 0x1a96, 0xc46: 0x1aa5, 0xc47: 0x1a75, 0xc48: 0x1d20, 0xc49: 0x1e82, 0xc4a: 0x1b7d, 0xc4b: 0x1b65, 0xc4c: 0x1d94, 0xc4d: 0x1da0, 0xc4e: 0x1b56, 0xc4f: 0x1b2c, 0xc50: 0x1a84, 0xc51: 0x1d4c, 0xc52: 0x1ce0, 0xc53: 0x1ccc, 0xc54: 0x1cfc, 0xc55: 0x1da4, 0xc56: 0x1b59, 0xc57: 0x1af9, 0xc58: 0x1b2f, 0xc59: 0x1b0e, 0xc5a: 0x1b71, 0xc5b: 0x1da8, 0xc5c: 0x1b5c, 0xc5d: 0x1af0, 0xc5e: 0x1b32, 0xc5f: 0x1d6c, 0xc60: 0x1d24, 0xc61: 0x1b44, 0xc62: 0x1d54, 0xc63: 0x1d70, 0xc64: 0x1d28, 0xc65: 0x1b47, 0xc66: 0x1d58, 0xc67: 0x2418, 0xc68: 0x242c, 0xc69: 0x1ac6, 0xc6a: 0x1d50, 0xc6b: 0x1ce4, 0xc6c: 0x1cd0, 0xc6d: 0x1d78, 0xc6e: 0x284d, 0xc6f: 0x28e4, 0xc70: 0x1b89, 0xc71: 0x1b74, 0xc72: 0x1dac, 0xc73: 0x1b5f, 0xc74: 0x1b80, 0xc75: 0x1b68, 0xc76: 0x1d98, 0xc77: 0x1b4d, 0xc78: 0x1b26, 0xc79: 0x1ab1, 0xc7a: 0x1b83, 0xc7b: 0x1b6b, 0xc7c: 0x1d9c, 0xc7d: 0x1b50, 0xc7e: 0x1b29, 0xc7f: 0x1ab4, // Block 0x32, offset 0xc80 0xc80: 0x1d5c, 0xc81: 0x1ce8, 0xc82: 0x1e7d, 0xc83: 0x1a66, 0xc84: 0x1aea, 0xc85: 0x1aed, 0xc86: 0x2425, 0xc87: 0x1cc4, 0xc88: 0x1af3, 0xc89: 0x1a78, 0xc8a: 0x1b11, 0xc8b: 0x1a7b, 0xc8c: 0x1b1a, 0xc8d: 0x1a99, 0xc8e: 0x1a9c, 0xc8f: 0x1b35, 0xc90: 0x1b3b, 0xc91: 0x1b3e, 0xc92: 0x1d60, 0xc93: 0x1b41, 0xc94: 0x1b53, 0xc95: 0x1d68, 0xc96: 0x1d74, 0xc97: 0x1ac0, 0xc98: 0x1e87, 0xc99: 0x1cec, 0xc9a: 0x1ac3, 0xc9b: 0x1b8c, 0xc9c: 0x1ad5, 0xc9d: 0x1ae4, 0xc9e: 0x2412, 0xc9f: 0x240c, 0xca0: 0x1df1, 0xca1: 0x1e00, 0xca2: 0x1e0f, 0xca3: 0x1e1e, 0xca4: 0x1e2d, 0xca5: 0x1e3c, 0xca6: 0x1e4b, 0xca7: 0x1e5a, 0xca8: 0x1e69, 0xca9: 0x22b6, 0xcaa: 0x22c8, 0xcab: 0x22da, 0xcac: 0x22ec, 0xcad: 0x22f8, 0xcae: 0x2304, 0xcaf: 0x2310, 0xcb0: 0x231c, 0xcb1: 0x2328, 0xcb2: 0x2334, 0xcb3: 0x2370, 0xcb4: 0x237c, 0xcb5: 0x2388, 0xcb6: 0x2394, 0xcb7: 0x23a0, 0xcb8: 0x23ac, 0xcb9: 0x23b2, 0xcba: 0x23b8, 0xcbb: 0x23be, 0xcbc: 0x23c4, 0xcbd: 0x23d6, 0xcbe: 0x23dc, 0xcbf: 0x1d40, // Block 0x33, offset 0xcc0 0xcc0: 0x1472, 0xcc1: 0x0df6, 0xcc2: 0x14ce, 0xcc3: 0x149a, 0xcc4: 0x0f52, 0xcc5: 0x07e6, 0xcc6: 0x09da, 0xcc7: 0x1726, 0xcc8: 0x1726, 0xcc9: 0x0b06, 0xcca: 0x155a, 0xccb: 0x0a3e, 0xccc: 0x0b02, 0xccd: 0x0cea, 0xcce: 0x10ca, 0xccf: 0x125a, 0xcd0: 0x1392, 0xcd1: 0x13ce, 0xcd2: 0x1402, 0xcd3: 0x1516, 0xcd4: 0x0e6e, 0xcd5: 0x0efa, 0xcd6: 0x0fa6, 0xcd7: 0x103e, 0xcd8: 0x135a, 0xcd9: 0x1542, 0xcda: 0x166e, 0xcdb: 0x080a, 0xcdc: 0x09ae, 0xcdd: 0x0e82, 0xcde: 0x0fca, 0xcdf: 0x138e, 0xce0: 0x16be, 0xce1: 0x0bae, 0xce2: 0x0f72, 0xce3: 0x137e, 0xce4: 0x1412, 0xce5: 0x0d1e, 0xce6: 0x12b6, 0xce7: 0x13da, 0xce8: 0x0c1a, 0xce9: 0x0e0a, 0xcea: 0x0f12, 0xceb: 0x1016, 0xcec: 0x1522, 0xced: 0x084a, 0xcee: 0x08e2, 0xcef: 0x094e, 0xcf0: 0x0d86, 0xcf1: 0x0e7a, 0xcf2: 0x0fc6, 0xcf3: 0x10ea, 0xcf4: 0x1272, 0xcf5: 0x1386, 0xcf6: 0x139e, 0xcf7: 0x14c2, 0xcf8: 0x15ea, 0xcf9: 0x169e, 0xcfa: 0x16ba, 0xcfb: 0x1126, 0xcfc: 0x1166, 0xcfd: 0x121e, 0xcfe: 0x133e, 0xcff: 0x1576, // Block 0x34, offset 0xd00 0xd00: 0x16c6, 0xd01: 0x1446, 0xd02: 0x0ac2, 0xd03: 0x0c36, 0xd04: 0x11d6, 0xd05: 0x1296, 0xd06: 0x0ffa, 0xd07: 0x112e, 0xd08: 0x1492, 0xd09: 0x15e2, 0xd0a: 0x0abe, 0xd0b: 0x0b8a, 0xd0c: 0x0e72, 0xd0d: 0x0f26, 0xd0e: 0x0f5a, 0xd0f: 0x120e, 0xd10: 0x1236, 0xd11: 0x15a2, 0xd12: 0x094a, 0xd13: 0x12a2, 0xd14: 0x08ee, 0xd15: 0x08ea, 0xd16: 0x1192, 0xd17: 0x1222, 0xd18: 0x1356, 0xd19: 0x15aa, 0xd1a: 0x1462, 0xd1b: 0x0d22, 0xd1c: 0x0e6e, 0xd1d: 0x1452, 0xd1e: 0x07f2, 0xd1f: 0x0b5e, 0xd20: 0x0c8e, 0xd21: 0x102a, 0xd22: 0x10aa, 0xd23: 0x096e, 0xd24: 0x1136, 0xd25: 0x085a, 0xd26: 0x0c72, 0xd27: 0x07d2, 0xd28: 0x0ee6, 0xd29: 0x0d9e, 0xd2a: 0x120a, 0xd2b: 0x09c2, 0xd2c: 0x0aae, 0xd2d: 0x10f6, 0xd2e: 0x135e, 0xd2f: 0x1436, 0xd30: 0x0eb2, 0xd31: 0x14f2, 0xd32: 0x0ede, 0xd33: 0x0d32, 0xd34: 0x1316, 0xd35: 0x0d52, 0xd36: 0x10a6, 0xd37: 0x0826, 0xd38: 0x08a2, 0xd39: 0x08e6, 0xd3a: 0x0e4e, 0xd3b: 0x11f6, 0xd3c: 0x12ee, 0xd3d: 0x1442, 0xd3e: 0x1556, 0xd3f: 0x0956, // Block 0x35, offset 0xd40 0xd40: 0x0a0a, 0xd41: 0x0b12, 0xd42: 0x0c2a, 0xd43: 0x0dba, 0xd44: 0x0f76, 0xd45: 0x113a, 0xd46: 0x1592, 0xd47: 0x1676, 0xd48: 0x16ca, 0xd49: 0x16e2, 0xd4a: 0x0932, 0xd4b: 0x0dee, 0xd4c: 0x0e9e, 0xd4d: 0x14e6, 0xd4e: 0x0bf6, 0xd4f: 0x0cd2, 0xd50: 0x0cee, 0xd51: 0x0d7e, 0xd52: 0x0f66, 0xd53: 0x0fb2, 0xd54: 0x1062, 0xd55: 0x1186, 0xd56: 0x122a, 0xd57: 0x128e, 0xd58: 0x14d6, 0xd59: 0x1366, 0xd5a: 0x14fe, 0xd5b: 0x157a, 0xd5c: 0x090a, 0xd5d: 0x0936, 0xd5e: 0x0a1e, 0xd5f: 0x0fa2, 0xd60: 0x13ee, 0xd61: 0x1436, 0xd62: 0x0c16, 0xd63: 0x0c86, 0xd64: 0x0d4a, 0xd65: 0x0eaa, 0xd66: 0x11d2, 0xd67: 0x101e, 0xd68: 0x0836, 0xd69: 0x0a7a, 0xd6a: 0x0b5e, 0xd6b: 0x0bc2, 0xd6c: 0x0c92, 0xd6d: 0x103a, 0xd6e: 0x1056, 0xd6f: 0x1266, 0xd70: 0x1286, 0xd71: 0x155e, 0xd72: 0x15de, 0xd73: 0x15ee, 0xd74: 0x162a, 0xd75: 0x084e, 0xd76: 0x117a, 0xd77: 0x154a, 0xd78: 0x15c6, 0xd79: 0x0caa, 0xd7a: 0x0812, 0xd7b: 0x0872, 0xd7c: 0x0b62, 0xd7d: 0x0b82, 0xd7e: 0x0daa, 0xd7f: 0x0e6e, // Block 0x36, offset 0xd80 0xd80: 0x0fbe, 0xd81: 0x10c6, 0xd82: 0x1372, 0xd83: 0x1512, 0xd84: 0x171e, 0xd85: 0x0dde, 0xd86: 0x159e, 0xd87: 0x092e, 0xd88: 0x0e2a, 0xd89: 0x0e36, 0xd8a: 0x0f0a, 0xd8b: 0x0f42, 0xd8c: 0x1046, 0xd8d: 0x10a2, 0xd8e: 0x1122, 0xd8f: 0x1206, 0xd90: 0x1636, 0xd91: 0x08aa, 0xd92: 0x0cfe, 0xd93: 0x15ae, 0xd94: 0x0862, 0xd95: 0x0ba6, 0xd96: 0x0f2a, 0xd97: 0x14da, 0xd98: 0x0c62, 0xd99: 0x0cb2, 0xd9a: 0x0e3e, 0xd9b: 0x102a, 0xd9c: 0x15b6, 0xd9d: 0x0912, 0xd9e: 0x09fa, 0xd9f: 0x0b92, 0xda0: 0x0dce, 0xda1: 0x0e1a, 0xda2: 0x0e5a, 0xda3: 0x0eee, 0xda4: 0x1042, 0xda5: 0x10b6, 0xda6: 0x1252, 0xda7: 0x13f2, 0xda8: 0x13fe, 0xda9: 0x1552, 0xdaa: 0x15d2, 0xdab: 0x097e, 0xdac: 0x0f46, 0xdad: 0x09fe, 0xdae: 0x0fc2, 0xdaf: 0x1066, 0xdb0: 0x1382, 0xdb1: 0x15ba, 0xdb2: 0x16a6, 0xdb3: 0x16ce, 0xdb4: 0x0e32, 0xdb5: 0x0f22, 0xdb6: 0x12be, 0xdb7: 0x11b2, 0xdb8: 0x11be, 0xdb9: 0x11e2, 0xdba: 0x1012, 0xdbb: 0x0f9a, 0xdbc: 0x145e, 0xdbd: 0x082e, 0xdbe: 0x1326, 0xdbf: 0x0916, // Block 0x37, offset 0xdc0 0xdc0: 0x0906, 0xdc1: 0x0c06, 0xdc2: 0x0d26, 0xdc3: 0x11ee, 0xdc4: 0x0b4e, 0xdc5: 0x0efe, 0xdc6: 0x0dea, 0xdc7: 0x14e2, 0xdc8: 0x13e2, 0xdc9: 0x15a6, 0xdca: 0x141e, 0xdcb: 0x0c22, 0xdcc: 0x0882, 0xdcd: 0x0a56, 0xdd0: 0x0aaa, 0xdd2: 0x0dda, 0xdd5: 0x08f2, 0xdd6: 0x101a, 0xdd7: 0x10de, 0xdd8: 0x1142, 0xdd9: 0x115e, 0xdda: 0x1162, 0xddb: 0x1176, 0xddc: 0x15f6, 0xddd: 0x11e6, 0xdde: 0x126a, 0xde0: 0x138a, 0xde2: 0x144e, 0xde5: 0x1502, 0xde6: 0x152e, 0xdea: 0x164a, 0xdeb: 0x164e, 0xdec: 0x1652, 0xded: 0x16b6, 0xdee: 0x1526, 0xdef: 0x15c2, 0xdf0: 0x0852, 0xdf1: 0x0876, 0xdf2: 0x088a, 0xdf3: 0x0946, 0xdf4: 0x0952, 0xdf5: 0x0992, 0xdf6: 0x0a46, 0xdf7: 0x0a62, 0xdf8: 0x0a6a, 0xdf9: 0x0aa6, 0xdfa: 0x0ab2, 0xdfb: 0x0b8e, 0xdfc: 0x0b96, 0xdfd: 0x0c9e, 0xdfe: 0x0cc6, 0xdff: 0x0cce, // Block 0x38, offset 0xe00 0xe00: 0x0ce6, 0xe01: 0x0d92, 0xe02: 0x0dc2, 0xe03: 0x0de2, 0xe04: 0x0e52, 0xe05: 0x0f16, 0xe06: 0x0f32, 0xe07: 0x0f62, 0xe08: 0x0fb6, 0xe09: 0x0fd6, 0xe0a: 0x104a, 0xe0b: 0x112a, 0xe0c: 0x1146, 0xe0d: 0x114e, 0xe0e: 0x114a, 0xe0f: 0x1152, 0xe10: 0x1156, 0xe11: 0x115a, 0xe12: 0x116e, 0xe13: 0x1172, 0xe14: 0x1196, 0xe15: 0x11aa, 0xe16: 0x11c6, 0xe17: 0x122a, 0xe18: 0x1232, 0xe19: 0x123a, 0xe1a: 0x124e, 0xe1b: 0x1276, 0xe1c: 0x12c6, 0xe1d: 0x12fa, 0xe1e: 0x12fa, 0xe1f: 0x1362, 0xe20: 0x140a, 0xe21: 0x1422, 0xe22: 0x1456, 0xe23: 0x145a, 0xe24: 0x149e, 0xe25: 0x14a2, 0xe26: 0x14fa, 0xe27: 0x1502, 0xe28: 0x15d6, 0xe29: 0x161a, 0xe2a: 0x1632, 0xe2b: 0x0c96, 0xe2c: 0x184b, 0xe2d: 0x12de, 0xe30: 0x07da, 0xe31: 0x08de, 0xe32: 0x089e, 0xe33: 0x0846, 0xe34: 0x0886, 0xe35: 0x08b2, 0xe36: 0x0942, 0xe37: 0x095e, 0xe38: 0x0a46, 0xe39: 0x0a32, 0xe3a: 0x0a42, 0xe3b: 0x0a5e, 0xe3c: 0x0aaa, 0xe3d: 0x0aba, 0xe3e: 0x0afe, 0xe3f: 0x0b0a, // Block 0x39, offset 0xe40 0xe40: 0x0b26, 0xe41: 0x0b36, 0xe42: 0x0c1e, 0xe43: 0x0c26, 0xe44: 0x0c56, 0xe45: 0x0c76, 0xe46: 0x0ca6, 0xe47: 0x0cbe, 0xe48: 0x0cae, 0xe49: 0x0cce, 0xe4a: 0x0cc2, 0xe4b: 0x0ce6, 0xe4c: 0x0d02, 0xe4d: 0x0d5a, 0xe4e: 0x0d66, 0xe4f: 0x0d6e, 0xe50: 0x0d96, 0xe51: 0x0dda, 0xe52: 0x0e0a, 0xe53: 0x0e0e, 0xe54: 0x0e22, 0xe55: 0x0ea2, 0xe56: 0x0eb2, 0xe57: 0x0f0a, 0xe58: 0x0f56, 0xe59: 0x0f4e, 0xe5a: 0x0f62, 0xe5b: 0x0f7e, 0xe5c: 0x0fb6, 0xe5d: 0x110e, 0xe5e: 0x0fda, 0xe5f: 0x100e, 0xe60: 0x101a, 0xe61: 0x105a, 0xe62: 0x1076, 0xe63: 0x109a, 0xe64: 0x10be, 0xe65: 0x10c2, 0xe66: 0x10de, 0xe67: 0x10e2, 0xe68: 0x10f2, 0xe69: 0x1106, 0xe6a: 0x1102, 0xe6b: 0x1132, 0xe6c: 0x11ae, 0xe6d: 0x11c6, 0xe6e: 0x11de, 0xe6f: 0x1216, 0xe70: 0x122a, 0xe71: 0x1246, 0xe72: 0x1276, 0xe73: 0x132a, 0xe74: 0x1352, 0xe75: 0x13c6, 0xe76: 0x140e, 0xe77: 0x141a, 0xe78: 0x1422, 0xe79: 0x143a, 0xe7a: 0x144e, 0xe7b: 0x143e, 0xe7c: 0x1456, 0xe7d: 0x1452, 0xe7e: 0x144a, 0xe7f: 0x145a, // Block 0x3a, offset 0xe80 0xe80: 0x1466, 0xe81: 0x14a2, 0xe82: 0x14de, 0xe83: 0x150e, 0xe84: 0x1546, 0xe85: 0x1566, 0xe86: 0x15b2, 0xe87: 0x15d6, 0xe88: 0x15f6, 0xe89: 0x160a, 0xe8a: 0x161a, 0xe8b: 0x1626, 0xe8c: 0x1632, 0xe8d: 0x1686, 0xe8e: 0x1726, 0xe8f: 0x17e2, 0xe90: 0x17dd, 0xe91: 0x180f, 0xe92: 0x0702, 0xe93: 0x072a, 0xe94: 0x072e, 0xe95: 0x1891, 0xe96: 0x18be, 0xe97: 0x1936, 0xe98: 0x1712, 0xe99: 0x1722, // Block 0x3b, offset 0xec0 0xec0: 0x1b05, 0xec1: 0x1b08, 0xec2: 0x1b0b, 0xec3: 0x1d38, 0xec4: 0x1d3c, 0xec5: 0x1b8f, 0xec6: 0x1b8f, 0xed3: 0x1ea5, 0xed4: 0x1e96, 0xed5: 0x1e9b, 0xed6: 0x1eaa, 0xed7: 0x1ea0, 0xedd: 0x448f, 0xede: 0x8116, 0xedf: 0x4501, 0xee0: 0x0320, 0xee1: 0x0308, 0xee2: 0x0311, 0xee3: 0x0314, 0xee4: 0x0317, 0xee5: 0x031a, 0xee6: 0x031d, 0xee7: 0x0323, 0xee8: 0x0326, 0xee9: 0x0017, 0xeea: 0x44ef, 0xeeb: 0x44f5, 0xeec: 0x45f3, 0xeed: 0x45fb, 0xeee: 0x4447, 0xeef: 0x444d, 0xef0: 0x4453, 0xef1: 0x4459, 0xef2: 0x4465, 0xef3: 0x446b, 0xef4: 0x4471, 0xef5: 0x447d, 0xef6: 0x4483, 0xef8: 0x4489, 0xef9: 0x4495, 0xefa: 0x449b, 0xefb: 0x44a1, 0xefc: 0x44ad, 0xefe: 0x44b3, // Block 0x3c, offset 0xf00 0xf00: 0x44b9, 0xf01: 0x44bf, 0xf03: 0x44c5, 0xf04: 0x44cb, 0xf06: 0x44d7, 0xf07: 0x44dd, 0xf08: 0x44e3, 0xf09: 0x44e9, 0xf0a: 0x44fb, 0xf0b: 0x4477, 0xf0c: 0x445f, 0xf0d: 0x44a7, 0xf0e: 0x44d1, 0xf0f: 0x1eaf, 0xf10: 0x038c, 0xf11: 0x038c, 0xf12: 0x0395, 0xf13: 0x0395, 0xf14: 0x0395, 0xf15: 0x0395, 0xf16: 0x0398, 0xf17: 0x0398, 0xf18: 0x0398, 0xf19: 0x0398, 0xf1a: 0x039e, 0xf1b: 0x039e, 0xf1c: 0x039e, 0xf1d: 0x039e, 0xf1e: 0x0392, 0xf1f: 0x0392, 0xf20: 0x0392, 0xf21: 0x0392, 0xf22: 0x039b, 0xf23: 0x039b, 0xf24: 0x039b, 0xf25: 0x039b, 0xf26: 0x038f, 0xf27: 0x038f, 0xf28: 0x038f, 0xf29: 0x038f, 0xf2a: 0x03c2, 0xf2b: 0x03c2, 0xf2c: 0x03c2, 0xf2d: 0x03c2, 0xf2e: 0x03c5, 0xf2f: 0x03c5, 0xf30: 0x03c5, 0xf31: 0x03c5, 0xf32: 0x03a4, 0xf33: 0x03a4, 0xf34: 0x03a4, 0xf35: 0x03a4, 0xf36: 0x03a1, 0xf37: 0x03a1, 0xf38: 0x03a1, 0xf39: 0x03a1, 0xf3a: 0x03a7, 0xf3b: 0x03a7, 0xf3c: 0x03a7, 0xf3d: 0x03a7, 0xf3e: 0x03aa, 0xf3f: 0x03aa, // Block 0x3d, offset 0xf40 0xf40: 0x03aa, 0xf41: 0x03aa, 0xf42: 0x03b3, 0xf43: 0x03b3, 0xf44: 0x03b0, 0xf45: 0x03b0, 0xf46: 0x03b6, 0xf47: 0x03b6, 0xf48: 0x03ad, 0xf49: 0x03ad, 0xf4a: 0x03bc, 0xf4b: 0x03bc, 0xf4c: 0x03b9, 0xf4d: 0x03b9, 0xf4e: 0x03c8, 0xf4f: 0x03c8, 0xf50: 0x03c8, 0xf51: 0x03c8, 0xf52: 0x03ce, 0xf53: 0x03ce, 0xf54: 0x03ce, 0xf55: 0x03ce, 0xf56: 0x03d4, 0xf57: 0x03d4, 0xf58: 0x03d4, 0xf59: 0x03d4, 0xf5a: 0x03d1, 0xf5b: 0x03d1, 0xf5c: 0x03d1, 0xf5d: 0x03d1, 0xf5e: 0x03d7, 0xf5f: 0x03d7, 0xf60: 0x03da, 0xf61: 0x03da, 0xf62: 0x03da, 0xf63: 0x03da, 0xf64: 0x456d, 0xf65: 0x456d, 0xf66: 0x03e0, 0xf67: 0x03e0, 0xf68: 0x03e0, 0xf69: 0x03e0, 0xf6a: 0x03dd, 0xf6b: 0x03dd, 0xf6c: 0x03dd, 0xf6d: 0x03dd, 0xf6e: 0x03fb, 0xf6f: 0x03fb, 0xf70: 0x4567, 0xf71: 0x4567, // Block 0x3e, offset 0xf80 0xf93: 0x03cb, 0xf94: 0x03cb, 0xf95: 0x03cb, 0xf96: 0x03cb, 0xf97: 0x03e9, 0xf98: 0x03e9, 0xf99: 0x03e6, 0xf9a: 0x03e6, 0xf9b: 0x03ec, 0xf9c: 0x03ec, 0xf9d: 0x217f, 0xf9e: 0x03f2, 0xf9f: 0x03f2, 0xfa0: 0x03e3, 0xfa1: 0x03e3, 0xfa2: 0x03ef, 0xfa3: 0x03ef, 0xfa4: 0x03f8, 0xfa5: 0x03f8, 0xfa6: 0x03f8, 0xfa7: 0x03f8, 0xfa8: 0x0380, 0xfa9: 0x0380, 0xfaa: 0x26da, 0xfab: 0x26da, 0xfac: 0x274a, 0xfad: 0x274a, 0xfae: 0x2719, 0xfaf: 0x2719, 0xfb0: 0x2735, 0xfb1: 0x2735, 0xfb2: 0x272e, 0xfb3: 0x272e, 0xfb4: 0x273c, 0xfb5: 0x273c, 0xfb6: 0x2743, 0xfb7: 0x2743, 0xfb8: 0x2743, 0xfb9: 0x2720, 0xfba: 0x2720, 0xfbb: 0x2720, 0xfbc: 0x03f5, 0xfbd: 0x03f5, 0xfbe: 0x03f5, 0xfbf: 0x03f5, // Block 0x3f, offset 0xfc0 0xfc0: 0x26e1, 0xfc1: 0x26e8, 0xfc2: 0x2704, 0xfc3: 0x2720, 0xfc4: 0x2727, 0xfc5: 0x1eb9, 0xfc6: 0x1ebe, 0xfc7: 0x1ec3, 0xfc8: 0x1ed2, 0xfc9: 0x1ee1, 0xfca: 0x1ee6, 0xfcb: 0x1eeb, 0xfcc: 0x1ef0, 0xfcd: 0x1ef5, 0xfce: 0x1f04, 0xfcf: 0x1f13, 0xfd0: 0x1f18, 0xfd1: 0x1f1d, 0xfd2: 0x1f2c, 0xfd3: 0x1f3b, 0xfd4: 0x1f40, 0xfd5: 0x1f45, 0xfd6: 0x1f4a, 0xfd7: 0x1f59, 0xfd8: 0x1f5e, 0xfd9: 0x1f6d, 0xfda: 0x1f72, 0xfdb: 0x1f77, 0xfdc: 0x1f86, 0xfdd: 0x1f8b, 0xfde: 0x1f90, 0xfdf: 0x1f9a, 0xfe0: 0x1fd6, 0xfe1: 0x1fe5, 0xfe2: 0x1ff4, 0xfe3: 0x1ff9, 0xfe4: 0x1ffe, 0xfe5: 0x2008, 0xfe6: 0x2017, 0xfe7: 0x201c, 0xfe8: 0x202b, 0xfe9: 0x2030, 0xfea: 0x2035, 0xfeb: 0x2044, 0xfec: 0x2049, 0xfed: 0x2058, 0xfee: 0x205d, 0xfef: 0x2062, 0xff0: 0x2067, 0xff1: 0x206c, 0xff2: 0x2071, 0xff3: 0x2076, 0xff4: 0x207b, 0xff5: 0x2080, 0xff6: 0x2085, 0xff7: 0x208a, 0xff8: 0x208f, 0xff9: 0x2094, 0xffa: 0x2099, 0xffb: 0x209e, 0xffc: 0x20a3, 0xffd: 0x20a8, 0xffe: 0x20ad, 0xfff: 0x20b7, // Block 0x40, offset 0x1000 0x1000: 0x20bc, 0x1001: 0x20c1, 0x1002: 0x20c6, 0x1003: 0x20d0, 0x1004: 0x20d5, 0x1005: 0x20df, 0x1006: 0x20e4, 0x1007: 0x20e9, 0x1008: 0x20ee, 0x1009: 0x20f3, 0x100a: 0x20f8, 0x100b: 0x20fd, 0x100c: 0x2102, 0x100d: 0x2107, 0x100e: 0x2116, 0x100f: 0x2125, 0x1010: 0x212a, 0x1011: 0x212f, 0x1012: 0x2134, 0x1013: 0x2139, 0x1014: 0x213e, 0x1015: 0x2148, 0x1016: 0x214d, 0x1017: 0x2152, 0x1018: 0x2161, 0x1019: 0x2170, 0x101a: 0x2175, 0x101b: 0x451f, 0x101c: 0x4525, 0x101d: 0x455b, 0x101e: 0x45b2, 0x101f: 0x45b9, 0x1020: 0x45c0, 0x1021: 0x45c7, 0x1022: 0x45ce, 0x1023: 0x45d5, 0x1024: 0x26f6, 0x1025: 0x26fd, 0x1026: 0x2704, 0x1027: 0x270b, 0x1028: 0x2720, 0x1029: 0x2727, 0x102a: 0x1ec8, 0x102b: 0x1ecd, 0x102c: 0x1ed2, 0x102d: 0x1ed7, 0x102e: 0x1ee1, 0x102f: 0x1ee6, 0x1030: 0x1efa, 0x1031: 0x1eff, 0x1032: 0x1f04, 0x1033: 0x1f09, 0x1034: 0x1f13, 0x1035: 0x1f18, 0x1036: 0x1f22, 0x1037: 0x1f27, 0x1038: 0x1f2c, 0x1039: 0x1f31, 0x103a: 0x1f3b, 0x103b: 0x1f40, 0x103c: 0x206c, 0x103d: 0x2071, 0x103e: 0x2080, 0x103f: 0x2085, // Block 0x41, offset 0x1040 0x1040: 0x208a, 0x1041: 0x209e, 0x1042: 0x20a3, 0x1043: 0x20a8, 0x1044: 0x20ad, 0x1045: 0x20c6, 0x1046: 0x20d0, 0x1047: 0x20d5, 0x1048: 0x20da, 0x1049: 0x20ee, 0x104a: 0x210c, 0x104b: 0x2111, 0x104c: 0x2116, 0x104d: 0x211b, 0x104e: 0x2125, 0x104f: 0x212a, 0x1050: 0x455b, 0x1051: 0x2157, 0x1052: 0x215c, 0x1053: 0x2161, 0x1054: 0x2166, 0x1055: 0x2170, 0x1056: 0x2175, 0x1057: 0x26e1, 0x1058: 0x26e8, 0x1059: 0x26ef, 0x105a: 0x2704, 0x105b: 0x2712, 0x105c: 0x1eb9, 0x105d: 0x1ebe, 0x105e: 0x1ec3, 0x105f: 0x1ed2, 0x1060: 0x1edc, 0x1061: 0x1eeb, 0x1062: 0x1ef0, 0x1063: 0x1ef5, 0x1064: 0x1f04, 0x1065: 0x1f0e, 0x1066: 0x1f2c, 0x1067: 0x1f45, 0x1068: 0x1f4a, 0x1069: 0x1f59, 0x106a: 0x1f5e, 0x106b: 0x1f6d, 0x106c: 0x1f77, 0x106d: 0x1f86, 0x106e: 0x1f8b, 0x106f: 0x1f90, 0x1070: 0x1f9a, 0x1071: 0x1fd6, 0x1072: 0x1fdb, 0x1073: 0x1fe5, 0x1074: 0x1ff4, 0x1075: 0x1ff9, 0x1076: 0x1ffe, 0x1077: 0x2008, 0x1078: 0x2017, 0x1079: 0x202b, 0x107a: 0x2030, 0x107b: 0x2035, 0x107c: 0x2044, 0x107d: 0x2049, 0x107e: 0x2058, 0x107f: 0x205d, // Block 0x42, offset 0x1080 0x1080: 0x2062, 0x1081: 0x2067, 0x1082: 0x2076, 0x1083: 0x207b, 0x1084: 0x208f, 0x1085: 0x2094, 0x1086: 0x2099, 0x1087: 0x209e, 0x1088: 0x20a3, 0x1089: 0x20b7, 0x108a: 0x20bc, 0x108b: 0x20c1, 0x108c: 0x20c6, 0x108d: 0x20cb, 0x108e: 0x20df, 0x108f: 0x20e4, 0x1090: 0x20e9, 0x1091: 0x20ee, 0x1092: 0x20fd, 0x1093: 0x2102, 0x1094: 0x2107, 0x1095: 0x2116, 0x1096: 0x2120, 0x1097: 0x212f, 0x1098: 0x2134, 0x1099: 0x454f, 0x109a: 0x2148, 0x109b: 0x214d, 0x109c: 0x2152, 0x109d: 0x2161, 0x109e: 0x216b, 0x109f: 0x2704, 0x10a0: 0x2712, 0x10a1: 0x1ed2, 0x10a2: 0x1edc, 0x10a3: 0x1f04, 0x10a4: 0x1f0e, 0x10a5: 0x1f2c, 0x10a6: 0x1f36, 0x10a7: 0x1f9a, 0x10a8: 0x1f9f, 0x10a9: 0x1fc2, 0x10aa: 0x1fc7, 0x10ab: 0x209e, 0x10ac: 0x20a3, 0x10ad: 0x20c6, 0x10ae: 0x2116, 0x10af: 0x2120, 0x10b0: 0x2161, 0x10b1: 0x216b, 0x10b2: 0x4603, 0x10b3: 0x460b, 0x10b4: 0x4613, 0x10b5: 0x2021, 0x10b6: 0x2026, 0x10b7: 0x203a, 0x10b8: 0x203f, 0x10b9: 0x204e, 0x10ba: 0x2053, 0x10bb: 0x1fa4, 0x10bc: 0x1fa9, 0x10bd: 0x1fcc, 0x10be: 0x1fd1, 0x10bf: 0x1f63, // Block 0x43, offset 0x10c0 0x10c0: 0x1f68, 0x10c1: 0x1f4f, 0x10c2: 0x1f54, 0x10c3: 0x1f7c, 0x10c4: 0x1f81, 0x10c5: 0x1fea, 0x10c6: 0x1fef, 0x10c7: 0x200d, 0x10c8: 0x2012, 0x10c9: 0x1fae, 0x10ca: 0x1fb3, 0x10cb: 0x1fb8, 0x10cc: 0x1fc2, 0x10cd: 0x1fbd, 0x10ce: 0x1f95, 0x10cf: 0x1fe0, 0x10d0: 0x2003, 0x10d1: 0x2021, 0x10d2: 0x2026, 0x10d3: 0x203a, 0x10d4: 0x203f, 0x10d5: 0x204e, 0x10d6: 0x2053, 0x10d7: 0x1fa4, 0x10d8: 0x1fa9, 0x10d9: 0x1fcc, 0x10da: 0x1fd1, 0x10db: 0x1f63, 0x10dc: 0x1f68, 0x10dd: 0x1f4f, 0x10de: 0x1f54, 0x10df: 0x1f7c, 0x10e0: 0x1f81, 0x10e1: 0x1fea, 0x10e2: 0x1fef, 0x10e3: 0x200d, 0x10e4: 0x2012, 0x10e5: 0x1fae, 0x10e6: 0x1fb3, 0x10e7: 0x1fb8, 0x10e8: 0x1fc2, 0x10e9: 0x1fbd, 0x10ea: 0x1f95, 0x10eb: 0x1fe0, 0x10ec: 0x2003, 0x10ed: 0x1fae, 0x10ee: 0x1fb3, 0x10ef: 0x1fb8, 0x10f0: 0x1fc2, 0x10f1: 0x1f9f, 0x10f2: 0x1fc7, 0x10f3: 0x201c, 0x10f4: 0x1f86, 0x10f5: 0x1f8b, 0x10f6: 0x1f90, 0x10f7: 0x1fae, 0x10f8: 0x1fb3, 0x10f9: 0x1fb8, 0x10fa: 0x201c, 0x10fb: 0x202b, 0x10fc: 0x4507, 0x10fd: 0x4507, // Block 0x44, offset 0x1100 0x1110: 0x2441, 0x1111: 0x2456, 0x1112: 0x2456, 0x1113: 0x245d, 0x1114: 0x2464, 0x1115: 0x2479, 0x1116: 0x2480, 0x1117: 0x2487, 0x1118: 0x24aa, 0x1119: 0x24aa, 0x111a: 0x24cd, 0x111b: 0x24c6, 0x111c: 0x24e2, 0x111d: 0x24d4, 0x111e: 0x24db, 0x111f: 0x24fe, 0x1120: 0x24fe, 0x1121: 0x24f7, 0x1122: 0x2505, 0x1123: 0x2505, 0x1124: 0x252f, 0x1125: 0x252f, 0x1126: 0x254b, 0x1127: 0x2513, 0x1128: 0x2513, 0x1129: 0x250c, 0x112a: 0x2521, 0x112b: 0x2521, 0x112c: 0x2528, 0x112d: 0x2528, 0x112e: 0x2552, 0x112f: 0x2560, 0x1130: 0x2560, 0x1131: 0x2567, 0x1132: 0x2567, 0x1133: 0x256e, 0x1134: 0x2575, 0x1135: 0x257c, 0x1136: 0x2583, 0x1137: 0x2583, 0x1138: 0x258a, 0x1139: 0x2598, 0x113a: 0x25a6, 0x113b: 0x259f, 0x113c: 0x25ad, 0x113d: 0x25ad, 0x113e: 0x25c2, 0x113f: 0x25c9, // Block 0x45, offset 0x1140 0x1140: 0x25fa, 0x1141: 0x2608, 0x1142: 0x2601, 0x1143: 0x25e5, 0x1144: 0x25e5, 0x1145: 0x260f, 0x1146: 0x260f, 0x1147: 0x2616, 0x1148: 0x2616, 0x1149: 0x2640, 0x114a: 0x2647, 0x114b: 0x264e, 0x114c: 0x2624, 0x114d: 0x2632, 0x114e: 0x2655, 0x114f: 0x265c, 0x1152: 0x262b, 0x1153: 0x26b0, 0x1154: 0x26b7, 0x1155: 0x268d, 0x1156: 0x2694, 0x1157: 0x2678, 0x1158: 0x2678, 0x1159: 0x267f, 0x115a: 0x26a9, 0x115b: 0x26a2, 0x115c: 0x26cc, 0x115d: 0x26cc, 0x115e: 0x243a, 0x115f: 0x244f, 0x1160: 0x2448, 0x1161: 0x2472, 0x1162: 0x246b, 0x1163: 0x2495, 0x1164: 0x248e, 0x1165: 0x24b8, 0x1166: 0x249c, 0x1167: 0x24b1, 0x1168: 0x24e9, 0x1169: 0x2536, 0x116a: 0x251a, 0x116b: 0x2559, 0x116c: 0x25f3, 0x116d: 0x261d, 0x116e: 0x26c5, 0x116f: 0x26be, 0x1170: 0x26d3, 0x1171: 0x266a, 0x1172: 0x25d0, 0x1173: 0x269b, 0x1174: 0x25c2, 0x1175: 0x25fa, 0x1176: 0x2591, 0x1177: 0x25de, 0x1178: 0x2671, 0x1179: 0x2663, 0x117a: 0x25ec, 0x117b: 0x25d7, 0x117c: 0x25ec, 0x117d: 0x2671, 0x117e: 0x24a3, 0x117f: 0x24bf, // Block 0x46, offset 0x1180 0x1180: 0x2639, 0x1181: 0x25b4, 0x1182: 0x2433, 0x1183: 0x25d7, 0x1184: 0x257c, 0x1185: 0x254b, 0x1186: 0x24f0, 0x1187: 0x2686, 0x11b0: 0x2544, 0x11b1: 0x25bb, 0x11b2: 0x28f6, 0x11b3: 0x28ed, 0x11b4: 0x2923, 0x11b5: 0x2911, 0x11b6: 0x28ff, 0x11b7: 0x291a, 0x11b8: 0x292c, 0x11b9: 0x253d, 0x11ba: 0x2db3, 0x11bb: 0x2c33, 0x11bc: 0x2908, // Block 0x47, offset 0x11c0 0x11d0: 0x0019, 0x11d1: 0x057e, 0x11d2: 0x0582, 0x11d3: 0x0035, 0x11d4: 0x0037, 0x11d5: 0x0003, 0x11d6: 0x003f, 0x11d7: 0x05ba, 0x11d8: 0x05be, 0x11d9: 0x1c8c, 0x11e0: 0x8133, 0x11e1: 0x8133, 0x11e2: 0x8133, 0x11e3: 0x8133, 0x11e4: 0x8133, 0x11e5: 0x8133, 0x11e6: 0x8133, 0x11e7: 0x812e, 0x11e8: 0x812e, 0x11e9: 0x812e, 0x11ea: 0x812e, 0x11eb: 0x812e, 0x11ec: 0x812e, 0x11ed: 0x812e, 0x11ee: 0x8133, 0x11ef: 0x8133, 0x11f0: 0x19a0, 0x11f1: 0x053a, 0x11f2: 0x0536, 0x11f3: 0x007f, 0x11f4: 0x007f, 0x11f5: 0x0011, 0x11f6: 0x0013, 0x11f7: 0x00b7, 0x11f8: 0x00bb, 0x11f9: 0x05b2, 0x11fa: 0x05b6, 0x11fb: 0x05a6, 0x11fc: 0x05aa, 0x11fd: 0x058e, 0x11fe: 0x0592, 0x11ff: 0x0586, // Block 0x48, offset 0x1200 0x1200: 0x058a, 0x1201: 0x0596, 0x1202: 0x059a, 0x1203: 0x059e, 0x1204: 0x05a2, 0x1207: 0x0077, 0x1208: 0x007b, 0x1209: 0x4368, 0x120a: 0x4368, 0x120b: 0x4368, 0x120c: 0x4368, 0x120d: 0x007f, 0x120e: 0x007f, 0x120f: 0x007f, 0x1210: 0x0019, 0x1211: 0x057e, 0x1212: 0x001d, 0x1214: 0x0037, 0x1215: 0x0035, 0x1216: 0x003f, 0x1217: 0x0003, 0x1218: 0x053a, 0x1219: 0x0011, 0x121a: 0x0013, 0x121b: 0x00b7, 0x121c: 0x00bb, 0x121d: 0x05b2, 0x121e: 0x05b6, 0x121f: 0x0007, 0x1220: 0x000d, 0x1221: 0x0015, 0x1222: 0x0017, 0x1223: 0x001b, 0x1224: 0x0039, 0x1225: 0x003d, 0x1226: 0x003b, 0x1228: 0x0079, 0x1229: 0x0009, 0x122a: 0x000b, 0x122b: 0x0041, 0x1230: 0x43a9, 0x1231: 0x452b, 0x1232: 0x43ae, 0x1234: 0x43b3, 0x1236: 0x43b8, 0x1237: 0x4531, 0x1238: 0x43bd, 0x1239: 0x4537, 0x123a: 0x43c2, 0x123b: 0x453d, 0x123c: 0x43c7, 0x123d: 0x4543, 0x123e: 0x43cc, 0x123f: 0x4549, // Block 0x49, offset 0x1240 0x1240: 0x0329, 0x1241: 0x450d, 0x1242: 0x450d, 0x1243: 0x4513, 0x1244: 0x4513, 0x1245: 0x4555, 0x1246: 0x4555, 0x1247: 0x4519, 0x1248: 0x4519, 0x1249: 0x4561, 0x124a: 0x4561, 0x124b: 0x4561, 0x124c: 0x4561, 0x124d: 0x032c, 0x124e: 0x032c, 0x124f: 0x032f, 0x1250: 0x032f, 0x1251: 0x032f, 0x1252: 0x032f, 0x1253: 0x0332, 0x1254: 0x0332, 0x1255: 0x0335, 0x1256: 0x0335, 0x1257: 0x0335, 0x1258: 0x0335, 0x1259: 0x0338, 0x125a: 0x0338, 0x125b: 0x0338, 0x125c: 0x0338, 0x125d: 0x033b, 0x125e: 0x033b, 0x125f: 0x033b, 0x1260: 0x033b, 0x1261: 0x033e, 0x1262: 0x033e, 0x1263: 0x033e, 0x1264: 0x033e, 0x1265: 0x0341, 0x1266: 0x0341, 0x1267: 0x0341, 0x1268: 0x0341, 0x1269: 0x0344, 0x126a: 0x0344, 0x126b: 0x0347, 0x126c: 0x0347, 0x126d: 0x034a, 0x126e: 0x034a, 0x126f: 0x034d, 0x1270: 0x034d, 0x1271: 0x0350, 0x1272: 0x0350, 0x1273: 0x0350, 0x1274: 0x0350, 0x1275: 0x0353, 0x1276: 0x0353, 0x1277: 0x0353, 0x1278: 0x0353, 0x1279: 0x0356, 0x127a: 0x0356, 0x127b: 0x0356, 0x127c: 0x0356, 0x127d: 0x0359, 0x127e: 0x0359, 0x127f: 0x0359, // Block 0x4a, offset 0x1280 0x1280: 0x0359, 0x1281: 0x035c, 0x1282: 0x035c, 0x1283: 0x035c, 0x1284: 0x035c, 0x1285: 0x035f, 0x1286: 0x035f, 0x1287: 0x035f, 0x1288: 0x035f, 0x1289: 0x0362, 0x128a: 0x0362, 0x128b: 0x0362, 0x128c: 0x0362, 0x128d: 0x0365, 0x128e: 0x0365, 0x128f: 0x0365, 0x1290: 0x0365, 0x1291: 0x0368, 0x1292: 0x0368, 0x1293: 0x0368, 0x1294: 0x0368, 0x1295: 0x036b, 0x1296: 0x036b, 0x1297: 0x036b, 0x1298: 0x036b, 0x1299: 0x036e, 0x129a: 0x036e, 0x129b: 0x036e, 0x129c: 0x036e, 0x129d: 0x0371, 0x129e: 0x0371, 0x129f: 0x0371, 0x12a0: 0x0371, 0x12a1: 0x0374, 0x12a2: 0x0374, 0x12a3: 0x0374, 0x12a4: 0x0374, 0x12a5: 0x0377, 0x12a6: 0x0377, 0x12a7: 0x0377, 0x12a8: 0x0377, 0x12a9: 0x037a, 0x12aa: 0x037a, 0x12ab: 0x037a, 0x12ac: 0x037a, 0x12ad: 0x037d, 0x12ae: 0x037d, 0x12af: 0x0380, 0x12b0: 0x0380, 0x12b1: 0x0383, 0x12b2: 0x0383, 0x12b3: 0x0383, 0x12b4: 0x0383, 0x12b5: 0x2de7, 0x12b6: 0x2de7, 0x12b7: 0x2def, 0x12b8: 0x2def, 0x12b9: 0x2df7, 0x12ba: 0x2df7, 0x12bb: 0x20b2, 0x12bc: 0x20b2, // Block 0x4b, offset 0x12c0 0x12c0: 0x0081, 0x12c1: 0x0083, 0x12c2: 0x0085, 0x12c3: 0x0087, 0x12c4: 0x0089, 0x12c5: 0x008b, 0x12c6: 0x008d, 0x12c7: 0x008f, 0x12c8: 0x0091, 0x12c9: 0x0093, 0x12ca: 0x0095, 0x12cb: 0x0097, 0x12cc: 0x0099, 0x12cd: 0x009b, 0x12ce: 0x009d, 0x12cf: 0x009f, 0x12d0: 0x00a1, 0x12d1: 0x00a3, 0x12d2: 0x00a5, 0x12d3: 0x00a7, 0x12d4: 0x00a9, 0x12d5: 0x00ab, 0x12d6: 0x00ad, 0x12d7: 0x00af, 0x12d8: 0x00b1, 0x12d9: 0x00b3, 0x12da: 0x00b5, 0x12db: 0x00b7, 0x12dc: 0x00b9, 0x12dd: 0x00bb, 0x12de: 0x00bd, 0x12df: 0x056e, 0x12e0: 0x0572, 0x12e1: 0x0582, 0x12e2: 0x0596, 0x12e3: 0x059a, 0x12e4: 0x057e, 0x12e5: 0x06a6, 0x12e6: 0x069e, 0x12e7: 0x05c2, 0x12e8: 0x05ca, 0x12e9: 0x05d2, 0x12ea: 0x05da, 0x12eb: 0x05e2, 0x12ec: 0x0666, 0x12ed: 0x066e, 0x12ee: 0x0676, 0x12ef: 0x061a, 0x12f0: 0x06aa, 0x12f1: 0x05c6, 0x12f2: 0x05ce, 0x12f3: 0x05d6, 0x12f4: 0x05de, 0x12f5: 0x05e6, 0x12f6: 0x05ea, 0x12f7: 0x05ee, 0x12f8: 0x05f2, 0x12f9: 0x05f6, 0x12fa: 0x05fa, 0x12fb: 0x05fe, 0x12fc: 0x0602, 0x12fd: 0x0606, 0x12fe: 0x060a, 0x12ff: 0x060e, // Block 0x4c, offset 0x1300 0x1300: 0x0612, 0x1301: 0x0616, 0x1302: 0x061e, 0x1303: 0x0622, 0x1304: 0x0626, 0x1305: 0x062a, 0x1306: 0x062e, 0x1307: 0x0632, 0x1308: 0x0636, 0x1309: 0x063a, 0x130a: 0x063e, 0x130b: 0x0642, 0x130c: 0x0646, 0x130d: 0x064a, 0x130e: 0x064e, 0x130f: 0x0652, 0x1310: 0x0656, 0x1311: 0x065a, 0x1312: 0x065e, 0x1313: 0x0662, 0x1314: 0x066a, 0x1315: 0x0672, 0x1316: 0x067a, 0x1317: 0x067e, 0x1318: 0x0682, 0x1319: 0x0686, 0x131a: 0x068a, 0x131b: 0x068e, 0x131c: 0x0692, 0x131d: 0x06a2, 0x131e: 0x4c99, 0x131f: 0x4c9f, 0x1320: 0x04b6, 0x1321: 0x0406, 0x1322: 0x040a, 0x1323: 0x4bcc, 0x1324: 0x040e, 0x1325: 0x4bd2, 0x1326: 0x4bd8, 0x1327: 0x0412, 0x1328: 0x0416, 0x1329: 0x041a, 0x132a: 0x4bde, 0x132b: 0x4be4, 0x132c: 0x4bea, 0x132d: 0x4bf0, 0x132e: 0x4bf6, 0x132f: 0x4bfc, 0x1330: 0x045a, 0x1331: 0x041e, 0x1332: 0x0422, 0x1333: 0x0426, 0x1334: 0x046e, 0x1335: 0x042a, 0x1336: 0x042e, 0x1337: 0x0432, 0x1338: 0x0436, 0x1339: 0x043a, 0x133a: 0x043e, 0x133b: 0x0442, 0x133c: 0x0446, 0x133d: 0x044a, 0x133e: 0x044e, // Block 0x4d, offset 0x1340 0x1342: 0x4b4e, 0x1343: 0x4b54, 0x1344: 0x4b5a, 0x1345: 0x4b60, 0x1346: 0x4b66, 0x1347: 0x4b6c, 0x134a: 0x4b72, 0x134b: 0x4b78, 0x134c: 0x4b7e, 0x134d: 0x4b84, 0x134e: 0x4b8a, 0x134f: 0x4b90, 0x1352: 0x4b96, 0x1353: 0x4b9c, 0x1354: 0x4ba2, 0x1355: 0x4ba8, 0x1356: 0x4bae, 0x1357: 0x4bb4, 0x135a: 0x4bba, 0x135b: 0x4bc0, 0x135c: 0x4bc6, 0x1360: 0x00bf, 0x1361: 0x00c2, 0x1362: 0x00cb, 0x1363: 0x4363, 0x1364: 0x00c8, 0x1365: 0x00c5, 0x1366: 0x053e, 0x1368: 0x0562, 0x1369: 0x0542, 0x136a: 0x0546, 0x136b: 0x054a, 0x136c: 0x054e, 0x136d: 0x0566, 0x136e: 0x056a, // Block 0x4e, offset 0x1380 0x1381: 0x01f1, 0x1382: 0x01f4, 0x1383: 0x00d4, 0x1384: 0x01be, 0x1385: 0x010d, 0x1387: 0x01d3, 0x1388: 0x174e, 0x1389: 0x01d9, 0x138a: 0x01d6, 0x138b: 0x0116, 0x138c: 0x0119, 0x138d: 0x0526, 0x138e: 0x011c, 0x138f: 0x0128, 0x1390: 0x01e5, 0x1391: 0x013a, 0x1392: 0x0134, 0x1393: 0x012e, 0x1394: 0x01c1, 0x1395: 0x00e0, 0x1396: 0x01c4, 0x1397: 0x0143, 0x1398: 0x0194, 0x1399: 0x01e8, 0x139a: 0x01eb, 0x139b: 0x0152, 0x139c: 0x1756, 0x139d: 0x1742, 0x139e: 0x0158, 0x139f: 0x175b, 0x13a0: 0x01a9, 0x13a1: 0x1760, 0x13a2: 0x00da, 0x13a3: 0x0170, 0x13a4: 0x0173, 0x13a5: 0x00a3, 0x13a6: 0x017c, 0x13a7: 0x1765, 0x13a8: 0x0182, 0x13a9: 0x0185, 0x13aa: 0x0188, 0x13ab: 0x01e2, 0x13ac: 0x01dc, 0x13ad: 0x1752, 0x13ae: 0x01df, 0x13af: 0x0197, 0x13b0: 0x0576, 0x13b2: 0x01ac, 0x13b3: 0x01cd, 0x13b4: 0x01d0, 0x13b5: 0x01bb, 0x13b6: 0x00f5, 0x13b7: 0x00f8, 0x13b8: 0x00fb, 0x13b9: 0x176a, 0x13ba: 0x176f, // Block 0x4f, offset 0x13c0 0x13c0: 0x0063, 0x13c1: 0x0065, 0x13c2: 0x0067, 0x13c3: 0x0069, 0x13c4: 0x006b, 0x13c5: 0x006d, 0x13c6: 0x006f, 0x13c7: 0x0071, 0x13c8: 0x0073, 0x13c9: 0x0075, 0x13ca: 0x0083, 0x13cb: 0x0085, 0x13cc: 0x0087, 0x13cd: 0x0089, 0x13ce: 0x008b, 0x13cf: 0x008d, 0x13d0: 0x008f, 0x13d1: 0x0091, 0x13d2: 0x0093, 0x13d3: 0x0095, 0x13d4: 0x0097, 0x13d5: 0x0099, 0x13d6: 0x009b, 0x13d7: 0x009d, 0x13d8: 0x009f, 0x13d9: 0x00a1, 0x13da: 0x00a3, 0x13db: 0x00a5, 0x13dc: 0x00a7, 0x13dd: 0x00a9, 0x13de: 0x00ab, 0x13df: 0x00ad, 0x13e0: 0x00af, 0x13e1: 0x00b1, 0x13e2: 0x00b3, 0x13e3: 0x00b5, 0x13e4: 0x00e3, 0x13e5: 0x0101, 0x13e8: 0x01f7, 0x13e9: 0x01fa, 0x13ea: 0x01fd, 0x13eb: 0x0200, 0x13ec: 0x0203, 0x13ed: 0x0206, 0x13ee: 0x0209, 0x13ef: 0x020c, 0x13f0: 0x020f, 0x13f1: 0x0212, 0x13f2: 0x0215, 0x13f3: 0x0218, 0x13f4: 0x021b, 0x13f5: 0x021e, 0x13f6: 0x0221, 0x13f7: 0x0224, 0x13f8: 0x0227, 0x13f9: 0x020c, 0x13fa: 0x022a, 0x13fb: 0x022d, 0x13fc: 0x0230, 0x13fd: 0x0233, 0x13fe: 0x0236, 0x13ff: 0x0239, // Block 0x50, offset 0x1400 0x1400: 0x0281, 0x1401: 0x0284, 0x1402: 0x0287, 0x1403: 0x0552, 0x1404: 0x024b, 0x1405: 0x0254, 0x1406: 0x025a, 0x1407: 0x027e, 0x1408: 0x026f, 0x1409: 0x026c, 0x140a: 0x028a, 0x140b: 0x028d, 0x140e: 0x0021, 0x140f: 0x0023, 0x1410: 0x0025, 0x1411: 0x0027, 0x1412: 0x0029, 0x1413: 0x002b, 0x1414: 0x002d, 0x1415: 0x002f, 0x1416: 0x0031, 0x1417: 0x0033, 0x1418: 0x0021, 0x1419: 0x0023, 0x141a: 0x0025, 0x141b: 0x0027, 0x141c: 0x0029, 0x141d: 0x002b, 0x141e: 0x002d, 0x141f: 0x002f, 0x1420: 0x0031, 0x1421: 0x0033, 0x1422: 0x0021, 0x1423: 0x0023, 0x1424: 0x0025, 0x1425: 0x0027, 0x1426: 0x0029, 0x1427: 0x002b, 0x1428: 0x002d, 0x1429: 0x002f, 0x142a: 0x0031, 0x142b: 0x0033, 0x142c: 0x0021, 0x142d: 0x0023, 0x142e: 0x0025, 0x142f: 0x0027, 0x1430: 0x0029, 0x1431: 0x002b, 0x1432: 0x002d, 0x1433: 0x002f, 0x1434: 0x0031, 0x1435: 0x0033, 0x1436: 0x0021, 0x1437: 0x0023, 0x1438: 0x0025, 0x1439: 0x0027, 0x143a: 0x0029, 0x143b: 0x002b, 0x143c: 0x002d, 0x143d: 0x002f, 0x143e: 0x0031, 0x143f: 0x0033, // Block 0x51, offset 0x1440 0x1440: 0x8133, 0x1441: 0x8133, 0x1442: 0x8133, 0x1443: 0x8133, 0x1444: 0x8133, 0x1445: 0x8133, 0x1446: 0x8133, 0x1448: 0x8133, 0x1449: 0x8133, 0x144a: 0x8133, 0x144b: 0x8133, 0x144c: 0x8133, 0x144d: 0x8133, 0x144e: 0x8133, 0x144f: 0x8133, 0x1450: 0x8133, 0x1451: 0x8133, 0x1452: 0x8133, 0x1453: 0x8133, 0x1454: 0x8133, 0x1455: 0x8133, 0x1456: 0x8133, 0x1457: 0x8133, 0x1458: 0x8133, 0x145b: 0x8133, 0x145c: 0x8133, 0x145d: 0x8133, 0x145e: 0x8133, 0x145f: 0x8133, 0x1460: 0x8133, 0x1461: 0x8133, 0x1463: 0x8133, 0x1464: 0x8133, 0x1466: 0x8133, 0x1467: 0x8133, 0x1468: 0x8133, 0x1469: 0x8133, 0x146a: 0x8133, 0x1470: 0x0290, 0x1471: 0x0293, 0x1472: 0x0296, 0x1473: 0x0299, 0x1474: 0x029c, 0x1475: 0x029f, 0x1476: 0x02a2, 0x1477: 0x02a5, 0x1478: 0x02a8, 0x1479: 0x02ab, 0x147a: 0x02ae, 0x147b: 0x02b1, 0x147c: 0x02b7, 0x147d: 0x02ba, 0x147e: 0x02bd, 0x147f: 0x02c0, // Block 0x52, offset 0x1480 0x1480: 0x02c3, 0x1481: 0x02c6, 0x1482: 0x02c9, 0x1483: 0x02cc, 0x1484: 0x02cf, 0x1485: 0x02d2, 0x1486: 0x02d5, 0x1487: 0x02db, 0x1488: 0x02e1, 0x1489: 0x02e4, 0x148a: 0x1736, 0x148b: 0x0302, 0x148c: 0x02ea, 0x148d: 0x02ed, 0x148e: 0x0305, 0x148f: 0x02f9, 0x1490: 0x02ff, 0x1491: 0x0290, 0x1492: 0x0293, 0x1493: 0x0296, 0x1494: 0x0299, 0x1495: 0x029c, 0x1496: 0x029f, 0x1497: 0x02a2, 0x1498: 0x02a5, 0x1499: 0x02a8, 0x149a: 0x02ab, 0x149b: 0x02ae, 0x149c: 0x02b7, 0x149d: 0x02ba, 0x149e: 0x02c0, 0x149f: 0x02c6, 0x14a0: 0x02c9, 0x14a1: 0x02cc, 0x14a2: 0x02cf, 0x14a3: 0x02d2, 0x14a4: 0x02d5, 0x14a5: 0x02d8, 0x14a6: 0x02db, 0x14a7: 0x02f3, 0x14a8: 0x02ea, 0x14a9: 0x02e7, 0x14aa: 0x02f0, 0x14ab: 0x02f6, 0x14ac: 0x1732, 0x14ad: 0x02fc, // Block 0x53, offset 0x14c0 0x14c0: 0x032c, 0x14c1: 0x032f, 0x14c2: 0x033b, 0x14c3: 0x0344, 0x14c5: 0x037d, 0x14c6: 0x034d, 0x14c7: 0x033e, 0x14c8: 0x035c, 0x14c9: 0x0383, 0x14ca: 0x036e, 0x14cb: 0x0371, 0x14cc: 0x0374, 0x14cd: 0x0377, 0x14ce: 0x0350, 0x14cf: 0x0362, 0x14d0: 0x0368, 0x14d1: 0x0356, 0x14d2: 0x036b, 0x14d3: 0x034a, 0x14d4: 0x0353, 0x14d5: 0x0335, 0x14d6: 0x0338, 0x14d7: 0x0341, 0x14d8: 0x0347, 0x14d9: 0x0359, 0x14da: 0x035f, 0x14db: 0x0365, 0x14dc: 0x0386, 0x14dd: 0x03d7, 0x14de: 0x03bf, 0x14df: 0x0389, 0x14e1: 0x032f, 0x14e2: 0x033b, 0x14e4: 0x037a, 0x14e7: 0x033e, 0x14e9: 0x0383, 0x14ea: 0x036e, 0x14eb: 0x0371, 0x14ec: 0x0374, 0x14ed: 0x0377, 0x14ee: 0x0350, 0x14ef: 0x0362, 0x14f0: 0x0368, 0x14f1: 0x0356, 0x14f2: 0x036b, 0x14f4: 0x0353, 0x14f5: 0x0335, 0x14f6: 0x0338, 0x14f7: 0x0341, 0x14f9: 0x0359, 0x14fb: 0x0365, // Block 0x54, offset 0x1500 0x1502: 0x033b, 0x1507: 0x033e, 0x1509: 0x0383, 0x150b: 0x0371, 0x150d: 0x0377, 0x150e: 0x0350, 0x150f: 0x0362, 0x1511: 0x0356, 0x1512: 0x036b, 0x1514: 0x0353, 0x1517: 0x0341, 0x1519: 0x0359, 0x151b: 0x0365, 0x151d: 0x03d7, 0x151f: 0x0389, 0x1521: 0x032f, 0x1522: 0x033b, 0x1524: 0x037a, 0x1527: 0x033e, 0x1528: 0x035c, 0x1529: 0x0383, 0x152a: 0x036e, 0x152c: 0x0374, 0x152d: 0x0377, 0x152e: 0x0350, 0x152f: 0x0362, 0x1530: 0x0368, 0x1531: 0x0356, 0x1532: 0x036b, 0x1534: 0x0353, 0x1535: 0x0335, 0x1536: 0x0338, 0x1537: 0x0341, 0x1539: 0x0359, 0x153a: 0x035f, 0x153b: 0x0365, 0x153c: 0x0386, 0x153e: 0x03bf, // Block 0x55, offset 0x1540 0x1540: 0x032c, 0x1541: 0x032f, 0x1542: 0x033b, 0x1543: 0x0344, 0x1544: 0x037a, 0x1545: 0x037d, 0x1546: 0x034d, 0x1547: 0x033e, 0x1548: 0x035c, 0x1549: 0x0383, 0x154b: 0x0371, 0x154c: 0x0374, 0x154d: 0x0377, 0x154e: 0x0350, 0x154f: 0x0362, 0x1550: 0x0368, 0x1551: 0x0356, 0x1552: 0x036b, 0x1553: 0x034a, 0x1554: 0x0353, 0x1555: 0x0335, 0x1556: 0x0338, 0x1557: 0x0341, 0x1558: 0x0347, 0x1559: 0x0359, 0x155a: 0x035f, 0x155b: 0x0365, 0x1561: 0x032f, 0x1562: 0x033b, 0x1563: 0x0344, 0x1565: 0x037d, 0x1566: 0x034d, 0x1567: 0x033e, 0x1568: 0x035c, 0x1569: 0x0383, 0x156b: 0x0371, 0x156c: 0x0374, 0x156d: 0x0377, 0x156e: 0x0350, 0x156f: 0x0362, 0x1570: 0x0368, 0x1571: 0x0356, 0x1572: 0x036b, 0x1573: 0x034a, 0x1574: 0x0353, 0x1575: 0x0335, 0x1576: 0x0338, 0x1577: 0x0341, 0x1578: 0x0347, 0x1579: 0x0359, 0x157a: 0x035f, 0x157b: 0x0365, // Block 0x56, offset 0x1580 0x1580: 0x19a6, 0x1581: 0x19a3, 0x1582: 0x19a9, 0x1583: 0x19cd, 0x1584: 0x19f1, 0x1585: 0x1a15, 0x1586: 0x1a39, 0x1587: 0x1a42, 0x1588: 0x1a48, 0x1589: 0x1a4e, 0x158a: 0x1a54, 0x1590: 0x1bbc, 0x1591: 0x1bc0, 0x1592: 0x1bc4, 0x1593: 0x1bc8, 0x1594: 0x1bcc, 0x1595: 0x1bd0, 0x1596: 0x1bd4, 0x1597: 0x1bd8, 0x1598: 0x1bdc, 0x1599: 0x1be0, 0x159a: 0x1be4, 0x159b: 0x1be8, 0x159c: 0x1bec, 0x159d: 0x1bf0, 0x159e: 0x1bf4, 0x159f: 0x1bf8, 0x15a0: 0x1bfc, 0x15a1: 0x1c00, 0x15a2: 0x1c04, 0x15a3: 0x1c08, 0x15a4: 0x1c0c, 0x15a5: 0x1c10, 0x15a6: 0x1c14, 0x15a7: 0x1c18, 0x15a8: 0x1c1c, 0x15a9: 0x1c20, 0x15aa: 0x2855, 0x15ab: 0x0047, 0x15ac: 0x0065, 0x15ad: 0x1a69, 0x15ae: 0x1ae1, 0x15b0: 0x0043, 0x15b1: 0x0045, 0x15b2: 0x0047, 0x15b3: 0x0049, 0x15b4: 0x004b, 0x15b5: 0x004d, 0x15b6: 0x004f, 0x15b7: 0x0051, 0x15b8: 0x0053, 0x15b9: 0x0055, 0x15ba: 0x0057, 0x15bb: 0x0059, 0x15bc: 0x005b, 0x15bd: 0x005d, 0x15be: 0x005f, 0x15bf: 0x0061, // Block 0x57, offset 0x15c0 0x15c0: 0x27dd, 0x15c1: 0x27f2, 0x15c2: 0x05fe, 0x15d0: 0x0d0a, 0x15d1: 0x0b42, 0x15d2: 0x09ce, 0x15d3: 0x473b, 0x15d4: 0x0816, 0x15d5: 0x0aea, 0x15d6: 0x142a, 0x15d7: 0x0afa, 0x15d8: 0x0822, 0x15d9: 0x0dd2, 0x15da: 0x0faa, 0x15db: 0x0daa, 0x15dc: 0x0922, 0x15dd: 0x0c66, 0x15de: 0x08ba, 0x15df: 0x0db2, 0x15e0: 0x090e, 0x15e1: 0x1212, 0x15e2: 0x107e, 0x15e3: 0x1486, 0x15e4: 0x0ace, 0x15e5: 0x0a06, 0x15e6: 0x0f5e, 0x15e7: 0x0d16, 0x15e8: 0x0d42, 0x15e9: 0x07ba, 0x15ea: 0x07c6, 0x15eb: 0x1506, 0x15ec: 0x0bd6, 0x15ed: 0x07e2, 0x15ee: 0x09ea, 0x15ef: 0x0d36, 0x15f0: 0x14ae, 0x15f1: 0x0d0e, 0x15f2: 0x116a, 0x15f3: 0x11a6, 0x15f4: 0x09f2, 0x15f5: 0x0f3e, 0x15f6: 0x0e06, 0x15f7: 0x0e02, 0x15f8: 0x1092, 0x15f9: 0x0926, 0x15fa: 0x0a52, 0x15fb: 0x153e, // Block 0x58, offset 0x1600 0x1600: 0x07f6, 0x1601: 0x07ee, 0x1602: 0x07fe, 0x1603: 0x1774, 0x1604: 0x0842, 0x1605: 0x0852, 0x1606: 0x0856, 0x1607: 0x085e, 0x1608: 0x0866, 0x1609: 0x086a, 0x160a: 0x0876, 0x160b: 0x086e, 0x160c: 0x06ae, 0x160d: 0x1788, 0x160e: 0x088a, 0x160f: 0x088e, 0x1610: 0x0892, 0x1611: 0x08ae, 0x1612: 0x1779, 0x1613: 0x06b2, 0x1614: 0x089a, 0x1615: 0x08ba, 0x1616: 0x1783, 0x1617: 0x08ca, 0x1618: 0x08d2, 0x1619: 0x0832, 0x161a: 0x08da, 0x161b: 0x08de, 0x161c: 0x195e, 0x161d: 0x08fa, 0x161e: 0x0902, 0x161f: 0x06ba, 0x1620: 0x091a, 0x1621: 0x091e, 0x1622: 0x0926, 0x1623: 0x092a, 0x1624: 0x06be, 0x1625: 0x0942, 0x1626: 0x0946, 0x1627: 0x0952, 0x1628: 0x095e, 0x1629: 0x0962, 0x162a: 0x0966, 0x162b: 0x096e, 0x162c: 0x098e, 0x162d: 0x0992, 0x162e: 0x099a, 0x162f: 0x09aa, 0x1630: 0x09b2, 0x1631: 0x09b6, 0x1632: 0x09b6, 0x1633: 0x09b6, 0x1634: 0x1797, 0x1635: 0x0f8e, 0x1636: 0x09ca, 0x1637: 0x09d2, 0x1638: 0x179c, 0x1639: 0x09de, 0x163a: 0x09e6, 0x163b: 0x09ee, 0x163c: 0x0a16, 0x163d: 0x0a02, 0x163e: 0x0a0e, 0x163f: 0x0a12, // Block 0x59, offset 0x1640 0x1640: 0x0a1a, 0x1641: 0x0a22, 0x1642: 0x0a26, 0x1643: 0x0a2e, 0x1644: 0x0a36, 0x1645: 0x0a3a, 0x1646: 0x0a3a, 0x1647: 0x0a42, 0x1648: 0x0a4a, 0x1649: 0x0a4e, 0x164a: 0x0a5a, 0x164b: 0x0a7e, 0x164c: 0x0a62, 0x164d: 0x0a82, 0x164e: 0x0a66, 0x164f: 0x0a6e, 0x1650: 0x0906, 0x1651: 0x0aca, 0x1652: 0x0a92, 0x1653: 0x0a96, 0x1654: 0x0a9a, 0x1655: 0x0a8e, 0x1656: 0x0aa2, 0x1657: 0x0a9e, 0x1658: 0x0ab6, 0x1659: 0x17a1, 0x165a: 0x0ad2, 0x165b: 0x0ad6, 0x165c: 0x0ade, 0x165d: 0x0aea, 0x165e: 0x0af2, 0x165f: 0x0b0e, 0x1660: 0x17a6, 0x1661: 0x17ab, 0x1662: 0x0b1a, 0x1663: 0x0b1e, 0x1664: 0x0b22, 0x1665: 0x0b16, 0x1666: 0x0b2a, 0x1667: 0x06c2, 0x1668: 0x06c6, 0x1669: 0x0b32, 0x166a: 0x0b3a, 0x166b: 0x0b3a, 0x166c: 0x17b0, 0x166d: 0x0b56, 0x166e: 0x0b5a, 0x166f: 0x0b5e, 0x1670: 0x0b66, 0x1671: 0x17b5, 0x1672: 0x0b6e, 0x1673: 0x0b72, 0x1674: 0x0c4a, 0x1675: 0x0b7a, 0x1676: 0x06ca, 0x1677: 0x0b86, 0x1678: 0x0b96, 0x1679: 0x0ba2, 0x167a: 0x0b9e, 0x167b: 0x17bf, 0x167c: 0x0baa, 0x167d: 0x17c4, 0x167e: 0x0bb6, 0x167f: 0x0bb2, // Block 0x5a, offset 0x1680 0x1680: 0x0bba, 0x1681: 0x0bca, 0x1682: 0x0bce, 0x1683: 0x06ce, 0x1684: 0x0bde, 0x1685: 0x0be6, 0x1686: 0x0bea, 0x1687: 0x0bee, 0x1688: 0x06d2, 0x1689: 0x17c9, 0x168a: 0x06d6, 0x168b: 0x0c0a, 0x168c: 0x0c0e, 0x168d: 0x0c12, 0x168e: 0x0c1a, 0x168f: 0x1990, 0x1690: 0x0c32, 0x1691: 0x17d3, 0x1692: 0x17d3, 0x1693: 0x12d2, 0x1694: 0x0c42, 0x1695: 0x0c42, 0x1696: 0x06da, 0x1697: 0x17f6, 0x1698: 0x18c8, 0x1699: 0x0c52, 0x169a: 0x0c5a, 0x169b: 0x06de, 0x169c: 0x0c6e, 0x169d: 0x0c7e, 0x169e: 0x0c82, 0x169f: 0x0c8a, 0x16a0: 0x0c9a, 0x16a1: 0x06e6, 0x16a2: 0x06e2, 0x16a3: 0x0c9e, 0x16a4: 0x17d8, 0x16a5: 0x0ca2, 0x16a6: 0x0cb6, 0x16a7: 0x0cba, 0x16a8: 0x0cbe, 0x16a9: 0x0cba, 0x16aa: 0x0cca, 0x16ab: 0x0cce, 0x16ac: 0x0cde, 0x16ad: 0x0cd6, 0x16ae: 0x0cda, 0x16af: 0x0ce2, 0x16b0: 0x0ce6, 0x16b1: 0x0cea, 0x16b2: 0x0cf6, 0x16b3: 0x0cfa, 0x16b4: 0x0d12, 0x16b5: 0x0d1a, 0x16b6: 0x0d2a, 0x16b7: 0x0d3e, 0x16b8: 0x17e7, 0x16b9: 0x0d3a, 0x16ba: 0x0d2e, 0x16bb: 0x0d46, 0x16bc: 0x0d4e, 0x16bd: 0x0d62, 0x16be: 0x17ec, 0x16bf: 0x0d6a, // Block 0x5b, offset 0x16c0 0x16c0: 0x0d5e, 0x16c1: 0x0d56, 0x16c2: 0x06ea, 0x16c3: 0x0d72, 0x16c4: 0x0d7a, 0x16c5: 0x0d82, 0x16c6: 0x0d76, 0x16c7: 0x06ee, 0x16c8: 0x0d92, 0x16c9: 0x0d9a, 0x16ca: 0x17f1, 0x16cb: 0x0dc6, 0x16cc: 0x0dfa, 0x16cd: 0x0dd6, 0x16ce: 0x06fa, 0x16cf: 0x0de2, 0x16d0: 0x06f6, 0x16d1: 0x06f2, 0x16d2: 0x08be, 0x16d3: 0x08c2, 0x16d4: 0x0dfe, 0x16d5: 0x0de6, 0x16d6: 0x12a6, 0x16d7: 0x075e, 0x16d8: 0x0e0a, 0x16d9: 0x0e0e, 0x16da: 0x0e12, 0x16db: 0x0e26, 0x16dc: 0x0e1e, 0x16dd: 0x180a, 0x16de: 0x06fe, 0x16df: 0x0e3a, 0x16e0: 0x0e2e, 0x16e1: 0x0e4a, 0x16e2: 0x0e52, 0x16e3: 0x1814, 0x16e4: 0x0e56, 0x16e5: 0x0e42, 0x16e6: 0x0e5e, 0x16e7: 0x0702, 0x16e8: 0x0e62, 0x16e9: 0x0e66, 0x16ea: 0x0e6a, 0x16eb: 0x0e76, 0x16ec: 0x1819, 0x16ed: 0x0e7e, 0x16ee: 0x0706, 0x16ef: 0x0e8a, 0x16f0: 0x181e, 0x16f1: 0x0e8e, 0x16f2: 0x070a, 0x16f3: 0x0e9a, 0x16f4: 0x0ea6, 0x16f5: 0x0eb2, 0x16f6: 0x0eb6, 0x16f7: 0x1823, 0x16f8: 0x17ba, 0x16f9: 0x1828, 0x16fa: 0x0ed6, 0x16fb: 0x182d, 0x16fc: 0x0ee2, 0x16fd: 0x0eea, 0x16fe: 0x0eda, 0x16ff: 0x0ef6, // Block 0x5c, offset 0x1700 0x1700: 0x0f06, 0x1701: 0x0f16, 0x1702: 0x0f0a, 0x1703: 0x0f0e, 0x1704: 0x0f1a, 0x1705: 0x0f1e, 0x1706: 0x1832, 0x1707: 0x0f02, 0x1708: 0x0f36, 0x1709: 0x0f3a, 0x170a: 0x070e, 0x170b: 0x0f4e, 0x170c: 0x0f4a, 0x170d: 0x1837, 0x170e: 0x0f2e, 0x170f: 0x0f6a, 0x1710: 0x183c, 0x1711: 0x1841, 0x1712: 0x0f6e, 0x1713: 0x0f82, 0x1714: 0x0f7e, 0x1715: 0x0f7a, 0x1716: 0x0712, 0x1717: 0x0f86, 0x1718: 0x0f96, 0x1719: 0x0f92, 0x171a: 0x0f9e, 0x171b: 0x177e, 0x171c: 0x0fae, 0x171d: 0x1846, 0x171e: 0x0fba, 0x171f: 0x1850, 0x1720: 0x0fce, 0x1721: 0x0fda, 0x1722: 0x0fee, 0x1723: 0x1855, 0x1724: 0x1002, 0x1725: 0x1006, 0x1726: 0x185a, 0x1727: 0x185f, 0x1728: 0x1022, 0x1729: 0x1032, 0x172a: 0x0716, 0x172b: 0x1036, 0x172c: 0x071a, 0x172d: 0x071a, 0x172e: 0x104e, 0x172f: 0x1052, 0x1730: 0x105a, 0x1731: 0x105e, 0x1732: 0x106a, 0x1733: 0x071e, 0x1734: 0x1082, 0x1735: 0x1864, 0x1736: 0x109e, 0x1737: 0x1869, 0x1738: 0x10aa, 0x1739: 0x17ce, 0x173a: 0x10ba, 0x173b: 0x186e, 0x173c: 0x1873, 0x173d: 0x1878, 0x173e: 0x0722, 0x173f: 0x0726, // Block 0x5d, offset 0x1740 0x1740: 0x10f2, 0x1741: 0x1882, 0x1742: 0x187d, 0x1743: 0x1887, 0x1744: 0x188c, 0x1745: 0x10fa, 0x1746: 0x10fe, 0x1747: 0x10fe, 0x1748: 0x1106, 0x1749: 0x072e, 0x174a: 0x110a, 0x174b: 0x0732, 0x174c: 0x0736, 0x174d: 0x1896, 0x174e: 0x111e, 0x174f: 0x1126, 0x1750: 0x1132, 0x1751: 0x073a, 0x1752: 0x189b, 0x1753: 0x1156, 0x1754: 0x18a0, 0x1755: 0x18a5, 0x1756: 0x1176, 0x1757: 0x118e, 0x1758: 0x073e, 0x1759: 0x1196, 0x175a: 0x119a, 0x175b: 0x119e, 0x175c: 0x18aa, 0x175d: 0x18af, 0x175e: 0x18af, 0x175f: 0x11b6, 0x1760: 0x0742, 0x1761: 0x18b4, 0x1762: 0x11ca, 0x1763: 0x11ce, 0x1764: 0x0746, 0x1765: 0x18b9, 0x1766: 0x11ea, 0x1767: 0x074a, 0x1768: 0x11fa, 0x1769: 0x11f2, 0x176a: 0x1202, 0x176b: 0x18c3, 0x176c: 0x121a, 0x176d: 0x074e, 0x176e: 0x1226, 0x176f: 0x122e, 0x1770: 0x123e, 0x1771: 0x0752, 0x1772: 0x18cd, 0x1773: 0x18d2, 0x1774: 0x0756, 0x1775: 0x18d7, 0x1776: 0x1256, 0x1777: 0x18dc, 0x1778: 0x1262, 0x1779: 0x126e, 0x177a: 0x1276, 0x177b: 0x18e1, 0x177c: 0x18e6, 0x177d: 0x128a, 0x177e: 0x18eb, 0x177f: 0x1292, // Block 0x5e, offset 0x1780 0x1780: 0x17fb, 0x1781: 0x075a, 0x1782: 0x12aa, 0x1783: 0x12ae, 0x1784: 0x0762, 0x1785: 0x12b2, 0x1786: 0x0b2e, 0x1787: 0x18f0, 0x1788: 0x18f5, 0x1789: 0x1800, 0x178a: 0x1805, 0x178b: 0x12d2, 0x178c: 0x12d6, 0x178d: 0x14ee, 0x178e: 0x0766, 0x178f: 0x1302, 0x1790: 0x12fe, 0x1791: 0x1306, 0x1792: 0x093a, 0x1793: 0x130a, 0x1794: 0x130e, 0x1795: 0x1312, 0x1796: 0x131a, 0x1797: 0x18fa, 0x1798: 0x1316, 0x1799: 0x131e, 0x179a: 0x1332, 0x179b: 0x1336, 0x179c: 0x1322, 0x179d: 0x133a, 0x179e: 0x134e, 0x179f: 0x1362, 0x17a0: 0x132e, 0x17a1: 0x1342, 0x17a2: 0x1346, 0x17a3: 0x134a, 0x17a4: 0x18ff, 0x17a5: 0x1909, 0x17a6: 0x1904, 0x17a7: 0x076a, 0x17a8: 0x136a, 0x17a9: 0x136e, 0x17aa: 0x1376, 0x17ab: 0x191d, 0x17ac: 0x137a, 0x17ad: 0x190e, 0x17ae: 0x076e, 0x17af: 0x0772, 0x17b0: 0x1913, 0x17b1: 0x1918, 0x17b2: 0x0776, 0x17b3: 0x139a, 0x17b4: 0x139e, 0x17b5: 0x13a2, 0x17b6: 0x13a6, 0x17b7: 0x13b2, 0x17b8: 0x13ae, 0x17b9: 0x13ba, 0x17ba: 0x13b6, 0x17bb: 0x13c6, 0x17bc: 0x13be, 0x17bd: 0x13c2, 0x17be: 0x13ca, 0x17bf: 0x077a, // Block 0x5f, offset 0x17c0 0x17c0: 0x13d2, 0x17c1: 0x13d6, 0x17c2: 0x077e, 0x17c3: 0x13e6, 0x17c4: 0x13ea, 0x17c5: 0x1922, 0x17c6: 0x13f6, 0x17c7: 0x13fa, 0x17c8: 0x0782, 0x17c9: 0x1406, 0x17ca: 0x06b6, 0x17cb: 0x1927, 0x17cc: 0x192c, 0x17cd: 0x0786, 0x17ce: 0x078a, 0x17cf: 0x1432, 0x17d0: 0x144a, 0x17d1: 0x1466, 0x17d2: 0x1476, 0x17d3: 0x1931, 0x17d4: 0x148a, 0x17d5: 0x148e, 0x17d6: 0x14a6, 0x17d7: 0x14b2, 0x17d8: 0x193b, 0x17d9: 0x178d, 0x17da: 0x14be, 0x17db: 0x14ba, 0x17dc: 0x14c6, 0x17dd: 0x1792, 0x17de: 0x14d2, 0x17df: 0x14de, 0x17e0: 0x1940, 0x17e1: 0x1945, 0x17e2: 0x151e, 0x17e3: 0x152a, 0x17e4: 0x1532, 0x17e5: 0x194a, 0x17e6: 0x1536, 0x17e7: 0x1562, 0x17e8: 0x156e, 0x17e9: 0x1572, 0x17ea: 0x156a, 0x17eb: 0x157e, 0x17ec: 0x1582, 0x17ed: 0x194f, 0x17ee: 0x158e, 0x17ef: 0x078e, 0x17f0: 0x1596, 0x17f1: 0x1954, 0x17f2: 0x0792, 0x17f3: 0x15ce, 0x17f4: 0x0bbe, 0x17f5: 0x15e6, 0x17f6: 0x1959, 0x17f7: 0x1963, 0x17f8: 0x0796, 0x17f9: 0x079a, 0x17fa: 0x160e, 0x17fb: 0x1968, 0x17fc: 0x079e, 0x17fd: 0x196d, 0x17fe: 0x1626, 0x17ff: 0x1626, // Block 0x60, offset 0x1800 0x1800: 0x162e, 0x1801: 0x1972, 0x1802: 0x1646, 0x1803: 0x07a2, 0x1804: 0x1656, 0x1805: 0x1662, 0x1806: 0x166a, 0x1807: 0x1672, 0x1808: 0x07a6, 0x1809: 0x1977, 0x180a: 0x1686, 0x180b: 0x16a2, 0x180c: 0x16ae, 0x180d: 0x07aa, 0x180e: 0x07ae, 0x180f: 0x16b2, 0x1810: 0x197c, 0x1811: 0x07b2, 0x1812: 0x1981, 0x1813: 0x1986, 0x1814: 0x198b, 0x1815: 0x16d6, 0x1816: 0x07b6, 0x1817: 0x16ea, 0x1818: 0x16f2, 0x1819: 0x16f6, 0x181a: 0x16fe, 0x181b: 0x1706, 0x181c: 0x170e, 0x181d: 0x1995, } // nfkcIndex: 23 blocks, 1472 entries, 2944 bytes // Block 0 is the zero block. var nfkcIndex = [1472]uint16{ // Block 0x0, offset 0x0 // Block 0x1, offset 0x40 // Block 0x2, offset 0x80 // Block 0x3, offset 0xc0 0xc2: 0x5f, 0xc3: 0x01, 0xc4: 0x02, 0xc5: 0x03, 0xc6: 0x60, 0xc7: 0x04, 0xc8: 0x05, 0xca: 0x61, 0xcb: 0x62, 0xcc: 0x06, 0xcd: 0x07, 0xce: 0x08, 0xcf: 0x09, 0xd0: 0x0a, 0xd1: 0x63, 0xd2: 0x64, 0xd3: 0x0b, 0xd6: 0x0c, 0xd7: 0x65, 0xd8: 0x66, 0xd9: 0x0d, 0xdb: 0x67, 0xdc: 0x68, 0xdd: 0x69, 0xdf: 0x6a, 0xe0: 0x02, 0xe1: 0x03, 0xe2: 0x04, 0xe3: 0x05, 0xea: 0x06, 0xeb: 0x07, 0xec: 0x08, 0xed: 0x09, 0xef: 0x0a, 0xf0: 0x14, // Block 0x4, offset 0x100 0x120: 0x6b, 0x121: 0x6c, 0x122: 0x6d, 0x123: 0x0e, 0x124: 0x6e, 0x125: 0x6f, 0x126: 0x70, 0x127: 0x71, 0x128: 0x72, 0x129: 0x73, 0x12a: 0x74, 0x12b: 0x75, 0x12c: 0x70, 0x12d: 0x76, 0x12e: 0x77, 0x12f: 0x78, 0x130: 0x74, 0x131: 0x79, 0x132: 0x7a, 0x133: 0x7b, 0x134: 0x7c, 0x135: 0x7d, 0x137: 0x7e, 0x138: 0x7f, 0x139: 0x80, 0x13a: 0x81, 0x13b: 0x82, 0x13c: 0x83, 0x13d: 0x84, 0x13e: 0x85, 0x13f: 0x86, // Block 0x5, offset 0x140 0x140: 0x87, 0x142: 0x88, 0x143: 0x89, 0x144: 0x8a, 0x145: 0x8b, 0x146: 0x8c, 0x147: 0x8d, 0x14d: 0x8e, 0x15c: 0x8f, 0x15f: 0x90, 0x162: 0x91, 0x164: 0x92, 0x168: 0x93, 0x169: 0x94, 0x16a: 0x95, 0x16b: 0x96, 0x16c: 0x0f, 0x16d: 0x97, 0x16e: 0x98, 0x16f: 0x99, 0x170: 0x9a, 0x173: 0x9b, 0x174: 0x9c, 0x175: 0x10, 0x176: 0x11, 0x177: 0x12, 0x178: 0x13, 0x179: 0x14, 0x17a: 0x15, 0x17b: 0x16, 0x17c: 0x17, 0x17d: 0x18, 0x17e: 0x19, 0x17f: 0x1a, // Block 0x6, offset 0x180 0x180: 0x9d, 0x181: 0x9e, 0x182: 0x9f, 0x183: 0xa0, 0x184: 0x1b, 0x185: 0x1c, 0x186: 0xa1, 0x187: 0xa2, 0x188: 0xa3, 0x189: 0x1d, 0x18a: 0x1e, 0x18b: 0xa4, 0x18c: 0xa5, 0x191: 0x1f, 0x192: 0x20, 0x193: 0xa6, 0x1a8: 0xa7, 0x1a9: 0xa8, 0x1ab: 0xa9, 0x1b1: 0xaa, 0x1b3: 0xab, 0x1b5: 0xac, 0x1b7: 0xad, 0x1ba: 0xae, 0x1bb: 0xaf, 0x1bc: 0x21, 0x1bd: 0x22, 0x1be: 0x23, 0x1bf: 0xb0, // Block 0x7, offset 0x1c0 0x1c0: 0xb1, 0x1c1: 0x24, 0x1c2: 0x25, 0x1c3: 0x26, 0x1c4: 0xb2, 0x1c5: 0x27, 0x1c6: 0x28, 0x1c8: 0x29, 0x1c9: 0x2a, 0x1ca: 0x2b, 0x1cb: 0x2c, 0x1cc: 0x2d, 0x1cd: 0x2e, 0x1ce: 0x2f, 0x1cf: 0x30, // Block 0x8, offset 0x200 0x219: 0xb3, 0x21a: 0xb4, 0x21b: 0xb5, 0x21d: 0xb6, 0x21f: 0xb7, 0x220: 0xb8, 0x223: 0xb9, 0x224: 0xba, 0x225: 0xbb, 0x226: 0xbc, 0x227: 0xbd, 0x22a: 0xbe, 0x22b: 0xbf, 0x22d: 0xc0, 0x22f: 0xc1, 0x230: 0xc2, 0x231: 0xc3, 0x232: 0xc4, 0x233: 0xc5, 0x234: 0xc6, 0x235: 0xc7, 0x236: 0xc8, 0x237: 0xc2, 0x238: 0xc3, 0x239: 0xc4, 0x23a: 0xc5, 0x23b: 0xc6, 0x23c: 0xc7, 0x23d: 0xc8, 0x23e: 0xc2, 0x23f: 0xc3, // Block 0x9, offset 0x240 0x240: 0xc4, 0x241: 0xc5, 0x242: 0xc6, 0x243: 0xc7, 0x244: 0xc8, 0x245: 0xc2, 0x246: 0xc3, 0x247: 0xc4, 0x248: 0xc5, 0x249: 0xc6, 0x24a: 0xc7, 0x24b: 0xc8, 0x24c: 0xc2, 0x24d: 0xc3, 0x24e: 0xc4, 0x24f: 0xc5, 0x250: 0xc6, 0x251: 0xc7, 0x252: 0xc8, 0x253: 0xc2, 0x254: 0xc3, 0x255: 0xc4, 0x256: 0xc5, 0x257: 0xc6, 0x258: 0xc7, 0x259: 0xc8, 0x25a: 0xc2, 0x25b: 0xc3, 0x25c: 0xc4, 0x25d: 0xc5, 0x25e: 0xc6, 0x25f: 0xc7, 0x260: 0xc8, 0x261: 0xc2, 0x262: 0xc3, 0x263: 0xc4, 0x264: 0xc5, 0x265: 0xc6, 0x266: 0xc7, 0x267: 0xc8, 0x268: 0xc2, 0x269: 0xc3, 0x26a: 0xc4, 0x26b: 0xc5, 0x26c: 0xc6, 0x26d: 0xc7, 0x26e: 0xc8, 0x26f: 0xc2, 0x270: 0xc3, 0x271: 0xc4, 0x272: 0xc5, 0x273: 0xc6, 0x274: 0xc7, 0x275: 0xc8, 0x276: 0xc2, 0x277: 0xc3, 0x278: 0xc4, 0x279: 0xc5, 0x27a: 0xc6, 0x27b: 0xc7, 0x27c: 0xc8, 0x27d: 0xc2, 0x27e: 0xc3, 0x27f: 0xc4, // Block 0xa, offset 0x280 0x280: 0xc5, 0x281: 0xc6, 0x282: 0xc7, 0x283: 0xc8, 0x284: 0xc2, 0x285: 0xc3, 0x286: 0xc4, 0x287: 0xc5, 0x288: 0xc6, 0x289: 0xc7, 0x28a: 0xc8, 0x28b: 0xc2, 0x28c: 0xc3, 0x28d: 0xc4, 0x28e: 0xc5, 0x28f: 0xc6, 0x290: 0xc7, 0x291: 0xc8, 0x292: 0xc2, 0x293: 0xc3, 0x294: 0xc4, 0x295: 0xc5, 0x296: 0xc6, 0x297: 0xc7, 0x298: 0xc8, 0x299: 0xc2, 0x29a: 0xc3, 0x29b: 0xc4, 0x29c: 0xc5, 0x29d: 0xc6, 0x29e: 0xc7, 0x29f: 0xc8, 0x2a0: 0xc2, 0x2a1: 0xc3, 0x2a2: 0xc4, 0x2a3: 0xc5, 0x2a4: 0xc6, 0x2a5: 0xc7, 0x2a6: 0xc8, 0x2a7: 0xc2, 0x2a8: 0xc3, 0x2a9: 0xc4, 0x2aa: 0xc5, 0x2ab: 0xc6, 0x2ac: 0xc7, 0x2ad: 0xc8, 0x2ae: 0xc2, 0x2af: 0xc3, 0x2b0: 0xc4, 0x2b1: 0xc5, 0x2b2: 0xc6, 0x2b3: 0xc7, 0x2b4: 0xc8, 0x2b5: 0xc2, 0x2b6: 0xc3, 0x2b7: 0xc4, 0x2b8: 0xc5, 0x2b9: 0xc6, 0x2ba: 0xc7, 0x2bb: 0xc8, 0x2bc: 0xc2, 0x2bd: 0xc3, 0x2be: 0xc4, 0x2bf: 0xc5, // Block 0xb, offset 0x2c0 0x2c0: 0xc6, 0x2c1: 0xc7, 0x2c2: 0xc8, 0x2c3: 0xc2, 0x2c4: 0xc3, 0x2c5: 0xc4, 0x2c6: 0xc5, 0x2c7: 0xc6, 0x2c8: 0xc7, 0x2c9: 0xc8, 0x2ca: 0xc2, 0x2cb: 0xc3, 0x2cc: 0xc4, 0x2cd: 0xc5, 0x2ce: 0xc6, 0x2cf: 0xc7, 0x2d0: 0xc8, 0x2d1: 0xc2, 0x2d2: 0xc3, 0x2d3: 0xc4, 0x2d4: 0xc5, 0x2d5: 0xc6, 0x2d6: 0xc7, 0x2d7: 0xc8, 0x2d8: 0xc2, 0x2d9: 0xc3, 0x2da: 0xc4, 0x2db: 0xc5, 0x2dc: 0xc6, 0x2dd: 0xc7, 0x2de: 0xc9, // Block 0xc, offset 0x300 0x324: 0x31, 0x325: 0x32, 0x326: 0x33, 0x327: 0x34, 0x328: 0x35, 0x329: 0x36, 0x32a: 0x37, 0x32b: 0x38, 0x32c: 0x39, 0x32d: 0x3a, 0x32e: 0x3b, 0x32f: 0x3c, 0x330: 0x3d, 0x331: 0x3e, 0x332: 0x3f, 0x333: 0x40, 0x334: 0x41, 0x335: 0x42, 0x336: 0x43, 0x337: 0x44, 0x338: 0x45, 0x339: 0x46, 0x33a: 0x47, 0x33b: 0x48, 0x33c: 0xca, 0x33d: 0x49, 0x33e: 0x4a, 0x33f: 0x4b, // Block 0xd, offset 0x340 0x347: 0xcb, 0x34b: 0xcc, 0x34d: 0xcd, 0x357: 0xce, 0x35e: 0x4c, 0x368: 0xcf, 0x36b: 0xd0, 0x374: 0xd1, 0x375: 0xd2, 0x37a: 0xd3, 0x37b: 0xd4, 0x37d: 0xd5, 0x37e: 0xd6, // Block 0xe, offset 0x380 0x381: 0xd7, 0x382: 0xd8, 0x384: 0xd9, 0x385: 0xbc, 0x387: 0xda, 0x388: 0xdb, 0x38b: 0xdc, 0x38c: 0xdd, 0x38d: 0xde, 0x38e: 0xdf, 0x38f: 0xe0, 0x391: 0xe1, 0x392: 0xe2, 0x393: 0xe3, 0x396: 0xe4, 0x397: 0xe5, 0x398: 0xe6, 0x39a: 0xe7, 0x39c: 0xe8, 0x3a0: 0xe9, 0x3a4: 0xea, 0x3a5: 0xeb, 0x3a7: 0xec, 0x3a8: 0xed, 0x3a9: 0xee, 0x3aa: 0xef, 0x3b0: 0xe6, 0x3b5: 0xf0, 0x3b6: 0xf1, 0x3bd: 0xf2, // Block 0xf, offset 0x3c0 0x3c4: 0xf3, 0x3eb: 0xf4, 0x3ec: 0xf5, 0x3f5: 0xf6, 0x3ff: 0xf7, // Block 0x10, offset 0x400 0x432: 0xf8, // Block 0x11, offset 0x440 0x473: 0xf9, // Block 0x12, offset 0x480 0x485: 0xfa, 0x486: 0xfb, 0x487: 0xfc, 0x489: 0xfd, 0x490: 0xfe, 0x491: 0xff, 0x492: 0x100, 0x493: 0x101, 0x494: 0x102, 0x495: 0x103, 0x496: 0x104, 0x497: 0x105, 0x498: 0x106, 0x499: 0x107, 0x49a: 0x4d, 0x49b: 0x108, 0x49c: 0x109, 0x49d: 0x10a, 0x49e: 0x10b, 0x49f: 0x4e, // Block 0x13, offset 0x4c0 0x4c0: 0x4f, 0x4c1: 0x50, 0x4c2: 0x10c, 0x4c4: 0xf5, 0x4ca: 0x10d, 0x4cb: 0x10e, 0x4d3: 0x10f, 0x4d7: 0x110, 0x4db: 0x111, 0x4e3: 0x112, 0x4e5: 0x113, 0x4f8: 0x51, 0x4f9: 0x52, 0x4fa: 0x53, // Block 0x14, offset 0x500 0x504: 0x54, 0x505: 0x114, 0x506: 0x115, 0x508: 0x55, 0x509: 0x116, 0x52f: 0x117, // Block 0x15, offset 0x540 0x560: 0x56, 0x561: 0x57, 0x562: 0x58, 0x563: 0x59, 0x564: 0x5a, 0x565: 0x5b, 0x566: 0x5c, 0x567: 0x5d, 0x568: 0x5e, // Block 0x16, offset 0x580 0x590: 0x0b, 0x591: 0x0c, 0x596: 0x0d, 0x59b: 0x0e, 0x59c: 0x0f, 0x59d: 0x10, 0x59e: 0x11, 0x59f: 0x12, 0x5af: 0x13, } // nfkcSparseOffset: 185 entries, 370 bytes var nfkcSparseOffset = []uint16{0x0, 0xe, 0x12, 0x1c, 0x26, 0x36, 0x38, 0x3d, 0x48, 0x57, 0x64, 0x6c, 0x71, 0x76, 0x78, 0x7c, 0x84, 0x8b, 0x8e, 0x96, 0x9a, 0x9e, 0xa0, 0xa2, 0xab, 0xaf, 0xb6, 0xbb, 0xbe, 0xc8, 0xcb, 0xd2, 0xda, 0xde, 0xe0, 0xe4, 0xe8, 0xee, 0xff, 0x10b, 0x10d, 0x113, 0x115, 0x117, 0x119, 0x11b, 0x11d, 0x11f, 0x121, 0x124, 0x127, 0x129, 0x12c, 0x12f, 0x133, 0x139, 0x145, 0x14e, 0x150, 0x153, 0x155, 0x160, 0x16b, 0x179, 0x187, 0x197, 0x1a5, 0x1ac, 0x1b2, 0x1c1, 0x1c5, 0x1c7, 0x1cb, 0x1cd, 0x1d0, 0x1d2, 0x1d5, 0x1d7, 0x1da, 0x1dc, 0x1de, 0x1e0, 0x1ec, 0x1f6, 0x200, 0x203, 0x207, 0x209, 0x20b, 0x211, 0x214, 0x217, 0x219, 0x21b, 0x21d, 0x21f, 0x225, 0x228, 0x22d, 0x22f, 0x236, 0x23c, 0x242, 0x24a, 0x250, 0x256, 0x25c, 0x260, 0x262, 0x264, 0x266, 0x268, 0x26d, 0x273, 0x276, 0x278, 0x27a, 0x27c, 0x27f, 0x285, 0x289, 0x28d, 0x295, 0x29c, 0x29f, 0x2a2, 0x2a4, 0x2a7, 0x2af, 0x2b9, 0x2c0, 0x2c4, 0x2cb, 0x2ce, 0x2d4, 0x2d6, 0x2d8, 0x2db, 0x2dd, 0x2e0, 0x2e5, 0x2e7, 0x2e9, 0x2eb, 0x2ed, 0x2ef, 0x2f2, 0x2f4, 0x2f6, 0x303, 0x305, 0x307, 0x30d, 0x30f, 0x311, 0x314, 0x321, 0x32b, 0x32d, 0x32f, 0x333, 0x338, 0x344, 0x349, 0x352, 0x358, 0x35d, 0x361, 0x366, 0x36a, 0x37a, 0x388, 0x396, 0x3a4, 0x3a6, 0x3a8, 0x3aa, 0x3ae, 0x3b1, 0x3b6, 0x3b8, 0x3bb, 0x3c6, 0x3c8, 0x3d2} // nfkcSparseValues: 980 entries, 3920 bytes var nfkcSparseValues = [980]valueRange{ // Block 0x0, offset 0x0 {value: 0x0002, lo: 0x0d}, {value: 0x0001, lo: 0xa0, hi: 0xa0}, {value: 0x4377, lo: 0xa8, hi: 0xa8}, {value: 0x0083, lo: 0xaa, hi: 0xaa}, {value: 0x4363, lo: 0xaf, hi: 0xaf}, {value: 0x0025, lo: 0xb2, hi: 0xb3}, {value: 0x4359, lo: 0xb4, hi: 0xb4}, {value: 0x0260, lo: 0xb5, hi: 0xb5}, {value: 0x4390, lo: 0xb8, hi: 0xb8}, {value: 0x0023, lo: 0xb9, hi: 0xb9}, {value: 0x009f, lo: 0xba, hi: 0xba}, {value: 0x234c, lo: 0xbc, hi: 0xbc}, {value: 0x2340, lo: 0xbd, hi: 0xbd}, {value: 0x23e2, lo: 0xbe, hi: 0xbe}, // Block 0x1, offset 0xe {value: 0x0091, lo: 0x03}, {value: 0x4859, lo: 0xa0, hi: 0xa1}, {value: 0x488b, lo: 0xaf, hi: 0xb0}, {value: 0xa000, lo: 0xb7, hi: 0xb7}, // Block 0x2, offset 0x12 {value: 0x0004, lo: 0x09}, {value: 0xa000, lo: 0x92, hi: 0x92}, {value: 0x0091, lo: 0xb0, hi: 0xb0}, {value: 0x0140, lo: 0xb1, hi: 0xb1}, {value: 0x0095, lo: 0xb2, hi: 0xb2}, {value: 0x00a5, lo: 0xb3, hi: 0xb3}, {value: 0x0179, lo: 0xb4, hi: 0xb4}, {value: 0x017f, lo: 0xb5, hi: 0xb5}, {value: 0x018b, lo: 0xb6, hi: 0xb6}, {value: 0x00af, lo: 0xb7, hi: 0xb8}, // Block 0x3, offset 0x1c {value: 0x000a, lo: 0x09}, {value: 0x436d, lo: 0x98, hi: 0x98}, {value: 0x4372, lo: 0x99, hi: 0x9a}, {value: 0x4395, lo: 0x9b, hi: 0x9b}, {value: 0x435e, lo: 0x9c, hi: 0x9c}, {value: 0x4381, lo: 0x9d, hi: 0x9d}, {value: 0x0137, lo: 0xa0, hi: 0xa0}, {value: 0x0099, lo: 0xa1, hi: 0xa1}, {value: 0x00a7, lo: 0xa2, hi: 0xa3}, {value: 0x01b8, lo: 0xa4, hi: 0xa4}, // Block 0x4, offset 0x26 {value: 0x0000, lo: 0x0f}, {value: 0xa000, lo: 0x83, hi: 0x83}, {value: 0xa000, lo: 0x87, hi: 0x87}, {value: 0xa000, lo: 0x8b, hi: 0x8b}, {value: 0xa000, lo: 0x8d, hi: 0x8d}, {value: 0x3704, lo: 0x90, hi: 0x90}, {value: 0x3710, lo: 0x91, hi: 0x91}, {value: 0x36fe, lo: 0x93, hi: 0x93}, {value: 0xa000, lo: 0x96, hi: 0x96}, {value: 0x3776, lo: 0x97, hi: 0x97}, {value: 0x3740, lo: 0x9c, hi: 0x9c}, {value: 0x3728, lo: 0x9d, hi: 0x9d}, {value: 0x3752, lo: 0x9e, hi: 0x9e}, {value: 0xa000, lo: 0xb4, hi: 0xb5}, {value: 0x377c, lo: 0xb6, hi: 0xb6}, {value: 0x3782, lo: 0xb7, hi: 0xb7}, // Block 0x5, offset 0x36 {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0x83, hi: 0x87}, // Block 0x6, offset 0x38 {value: 0x0001, lo: 0x04}, {value: 0x8114, lo: 0x81, hi: 0x82}, {value: 0x8133, lo: 0x84, hi: 0x84}, {value: 0x812e, lo: 0x85, hi: 0x85}, {value: 0x810e, lo: 0x87, hi: 0x87}, // Block 0x7, offset 0x3d {value: 0x0000, lo: 0x0a}, {value: 0x8133, lo: 0x90, hi: 0x97}, {value: 0x811a, lo: 0x98, hi: 0x98}, {value: 0x811b, lo: 0x99, hi: 0x99}, {value: 0x811c, lo: 0x9a, hi: 0x9a}, {value: 0x37a0, lo: 0xa2, hi: 0xa2}, {value: 0x37a6, lo: 0xa3, hi: 0xa3}, {value: 0x37b2, lo: 0xa4, hi: 0xa4}, {value: 0x37ac, lo: 0xa5, hi: 0xa5}, {value: 0x37b8, lo: 0xa6, hi: 0xa6}, {value: 0xa000, lo: 0xa7, hi: 0xa7}, // Block 0x8, offset 0x48 {value: 0x0000, lo: 0x0e}, {value: 0x37ca, lo: 0x80, hi: 0x80}, {value: 0xa000, lo: 0x81, hi: 0x81}, {value: 0x37be, lo: 0x82, hi: 0x82}, {value: 0xa000, lo: 0x92, hi: 0x92}, {value: 0x37c4, lo: 0x93, hi: 0x93}, {value: 0xa000, lo: 0x95, hi: 0x95}, {value: 0x8133, lo: 0x96, hi: 0x9c}, {value: 0x8133, lo: 0x9f, hi: 0xa2}, {value: 0x812e, lo: 0xa3, hi: 0xa3}, {value: 0x8133, lo: 0xa4, hi: 0xa4}, {value: 0x8133, lo: 0xa7, hi: 0xa8}, {value: 0x812e, lo: 0xaa, hi: 0xaa}, {value: 0x8133, lo: 0xab, hi: 0xac}, {value: 0x812e, lo: 0xad, hi: 0xad}, // Block 0x9, offset 0x57 {value: 0x0000, lo: 0x0c}, {value: 0x8120, lo: 0x91, hi: 0x91}, {value: 0x8133, lo: 0xb0, hi: 0xb0}, {value: 0x812e, lo: 0xb1, hi: 0xb1}, {value: 0x8133, lo: 0xb2, hi: 0xb3}, {value: 0x812e, lo: 0xb4, hi: 0xb4}, {value: 0x8133, lo: 0xb5, hi: 0xb6}, {value: 0x812e, lo: 0xb7, hi: 0xb9}, {value: 0x8133, lo: 0xba, hi: 0xba}, {value: 0x812e, lo: 0xbb, hi: 0xbc}, {value: 0x8133, lo: 0xbd, hi: 0xbd}, {value: 0x812e, lo: 0xbe, hi: 0xbe}, {value: 0x8133, lo: 0xbf, hi: 0xbf}, // Block 0xa, offset 0x64 {value: 0x0005, lo: 0x07}, {value: 0x8133, lo: 0x80, hi: 0x80}, {value: 0x8133, lo: 0x81, hi: 0x81}, {value: 0x812e, lo: 0x82, hi: 0x83}, {value: 0x812e, lo: 0x84, hi: 0x85}, {value: 0x812e, lo: 0x86, hi: 0x87}, {value: 0x812e, lo: 0x88, hi: 0x89}, {value: 0x8133, lo: 0x8a, hi: 0x8a}, // Block 0xb, offset 0x6c {value: 0x0000, lo: 0x04}, {value: 0x8133, lo: 0xab, hi: 0xb1}, {value: 0x812e, lo: 0xb2, hi: 0xb2}, {value: 0x8133, lo: 0xb3, hi: 0xb3}, {value: 0x812e, lo: 0xbd, hi: 0xbd}, // Block 0xc, offset 0x71 {value: 0x0000, lo: 0x04}, {value: 0x8133, lo: 0x96, hi: 0x99}, {value: 0x8133, lo: 0x9b, hi: 0xa3}, {value: 0x8133, lo: 0xa5, hi: 0xa7}, {value: 0x8133, lo: 0xa9, hi: 0xad}, // Block 0xd, offset 0x76 {value: 0x0000, lo: 0x01}, {value: 0x812e, lo: 0x99, hi: 0x9b}, // Block 0xe, offset 0x78 {value: 0x0000, lo: 0x03}, {value: 0x8133, lo: 0x97, hi: 0x98}, {value: 0x812e, lo: 0x99, hi: 0x9b}, {value: 0x8133, lo: 0x9c, hi: 0x9f}, // Block 0xf, offset 0x7c {value: 0x0000, lo: 0x07}, {value: 0xa000, lo: 0xa8, hi: 0xa8}, {value: 0x3e37, lo: 0xa9, hi: 0xa9}, {value: 0xa000, lo: 0xb0, hi: 0xb0}, {value: 0x3e3f, lo: 0xb1, hi: 0xb1}, {value: 0xa000, lo: 0xb3, hi: 0xb3}, {value: 0x3e47, lo: 0xb4, hi: 0xb4}, {value: 0x9903, lo: 0xbc, hi: 0xbc}, // Block 0x10, offset 0x84 {value: 0x0008, lo: 0x06}, {value: 0x8105, lo: 0x8d, hi: 0x8d}, {value: 0x8133, lo: 0x91, hi: 0x91}, {value: 0x812e, lo: 0x92, hi: 0x92}, {value: 0x8133, lo: 0x93, hi: 0x93}, {value: 0x8133, lo: 0x94, hi: 0x94}, {value: 0x461b, lo: 0x98, hi: 0x9f}, // Block 0x11, offset 0x8b {value: 0x0000, lo: 0x02}, {value: 0x8103, lo: 0xbc, hi: 0xbc}, {value: 0x9900, lo: 0xbe, hi: 0xbe}, // Block 0x12, offset 0x8e {value: 0x0008, lo: 0x07}, {value: 0xa000, lo: 0x87, hi: 0x87}, {value: 0x3e4f, lo: 0x8b, hi: 0x8c}, {value: 0x8105, lo: 0x8d, hi: 0x8d}, {value: 0x9900, lo: 0x97, hi: 0x97}, {value: 0x465b, lo: 0x9c, hi: 0x9d}, {value: 0x466b, lo: 0x9f, hi: 0x9f}, {value: 0x8133, lo: 0xbe, hi: 0xbe}, // Block 0x13, offset 0x96 {value: 0x0000, lo: 0x03}, {value: 0x4693, lo: 0xb3, hi: 0xb3}, {value: 0x469b, lo: 0xb6, hi: 0xb6}, {value: 0x8103, lo: 0xbc, hi: 0xbc}, // Block 0x14, offset 0x9a {value: 0x0008, lo: 0x03}, {value: 0x8105, lo: 0x8d, hi: 0x8d}, {value: 0x4673, lo: 0x99, hi: 0x9b}, {value: 0x468b, lo: 0x9e, hi: 0x9e}, // Block 0x15, offset 0x9e {value: 0x0000, lo: 0x01}, {value: 0x8103, lo: 0xbc, hi: 0xbc}, // Block 0x16, offset 0xa0 {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0x8d, hi: 0x8d}, // Block 0x17, offset 0xa2 {value: 0x0000, lo: 0x08}, {value: 0xa000, lo: 0x87, hi: 0x87}, {value: 0x3e67, lo: 0x88, hi: 0x88}, {value: 0x3e5f, lo: 0x8b, hi: 0x8b}, {value: 0x3e6f, lo: 0x8c, hi: 0x8c}, {value: 0x8105, lo: 0x8d, hi: 0x8d}, {value: 0x9900, lo: 0x96, hi: 0x97}, {value: 0x46a3, lo: 0x9c, hi: 0x9c}, {value: 0x46ab, lo: 0x9d, hi: 0x9d}, // Block 0x18, offset 0xab {value: 0x0000, lo: 0x03}, {value: 0xa000, lo: 0x92, hi: 0x92}, {value: 0x3e77, lo: 0x94, hi: 0x94}, {value: 0x9900, lo: 0xbe, hi: 0xbe}, // Block 0x19, offset 0xaf {value: 0x0000, lo: 0x06}, {value: 0xa000, lo: 0x86, hi: 0x87}, {value: 0x3e7f, lo: 0x8a, hi: 0x8a}, {value: 0x3e8f, lo: 0x8b, hi: 0x8b}, {value: 0x3e87, lo: 0x8c, hi: 0x8c}, {value: 0x8105, lo: 0x8d, hi: 0x8d}, {value: 0x9900, lo: 0x97, hi: 0x97}, // Block 0x1a, offset 0xb6 {value: 0x1801, lo: 0x04}, {value: 0xa000, lo: 0x86, hi: 0x86}, {value: 0x3e97, lo: 0x88, hi: 0x88}, {value: 0x8105, lo: 0x8d, hi: 0x8d}, {value: 0x8121, lo: 0x95, hi: 0x96}, // Block 0x1b, offset 0xbb {value: 0x0000, lo: 0x02}, {value: 0x8103, lo: 0xbc, hi: 0xbc}, {value: 0xa000, lo: 0xbf, hi: 0xbf}, // Block 0x1c, offset 0xbe {value: 0x0000, lo: 0x09}, {value: 0x3e9f, lo: 0x80, hi: 0x80}, {value: 0x9900, lo: 0x82, hi: 0x82}, {value: 0xa000, lo: 0x86, hi: 0x86}, {value: 0x3ea7, lo: 0x87, hi: 0x87}, {value: 0x3eaf, lo: 0x88, hi: 0x88}, {value: 0x4b25, lo: 0x8a, hi: 0x8a}, {value: 0x4331, lo: 0x8b, hi: 0x8b}, {value: 0x8105, lo: 0x8d, hi: 0x8d}, {value: 0x9900, lo: 0x95, hi: 0x96}, // Block 0x1d, offset 0xc8 {value: 0x0000, lo: 0x02}, {value: 0x8105, lo: 0xbb, hi: 0xbc}, {value: 0x9900, lo: 0xbe, hi: 0xbe}, // Block 0x1e, offset 0xcb {value: 0x0000, lo: 0x06}, {value: 0xa000, lo: 0x86, hi: 0x87}, {value: 0x3eb7, lo: 0x8a, hi: 0x8a}, {value: 0x3ec7, lo: 0x8b, hi: 0x8b}, {value: 0x3ebf, lo: 0x8c, hi: 0x8c}, {value: 0x8105, lo: 0x8d, hi: 0x8d}, {value: 0x9900, lo: 0x97, hi: 0x97}, // Block 0x1f, offset 0xd2 {value: 0x5a29, lo: 0x07}, {value: 0x9905, lo: 0x8a, hi: 0x8a}, {value: 0x9900, lo: 0x8f, hi: 0x8f}, {value: 0xa000, lo: 0x99, hi: 0x99}, {value: 0x3ecf, lo: 0x9a, hi: 0x9a}, {value: 0x4b2d, lo: 0x9c, hi: 0x9c}, {value: 0x433c, lo: 0x9d, hi: 0x9d}, {value: 0x3ed7, lo: 0x9e, hi: 0x9f}, // Block 0x20, offset 0xda {value: 0x0000, lo: 0x03}, {value: 0x2751, lo: 0xb3, hi: 0xb3}, {value: 0x8123, lo: 0xb8, hi: 0xb9}, {value: 0x8105, lo: 0xba, hi: 0xba}, // Block 0x21, offset 0xde {value: 0x0000, lo: 0x01}, {value: 0x8124, lo: 0x88, hi: 0x8b}, // Block 0x22, offset 0xe0 {value: 0x0000, lo: 0x03}, {value: 0x2766, lo: 0xb3, hi: 0xb3}, {value: 0x8125, lo: 0xb8, hi: 0xb9}, {value: 0x8105, lo: 0xba, hi: 0xba}, // Block 0x23, offset 0xe4 {value: 0x0000, lo: 0x03}, {value: 0x8126, lo: 0x88, hi: 0x8b}, {value: 0x2758, lo: 0x9c, hi: 0x9c}, {value: 0x275f, lo: 0x9d, hi: 0x9d}, // Block 0x24, offset 0xe8 {value: 0x0000, lo: 0x05}, {value: 0x03fe, lo: 0x8c, hi: 0x8c}, {value: 0x812e, lo: 0x98, hi: 0x99}, {value: 0x812e, lo: 0xb5, hi: 0xb5}, {value: 0x812e, lo: 0xb7, hi: 0xb7}, {value: 0x812c, lo: 0xb9, hi: 0xb9}, // Block 0x25, offset 0xee {value: 0x0000, lo: 0x10}, {value: 0x2774, lo: 0x83, hi: 0x83}, {value: 0x277b, lo: 0x8d, hi: 0x8d}, {value: 0x2782, lo: 0x92, hi: 0x92}, {value: 0x2789, lo: 0x97, hi: 0x97}, {value: 0x2790, lo: 0x9c, hi: 0x9c}, {value: 0x276d, lo: 0xa9, hi: 0xa9}, {value: 0x8127, lo: 0xb1, hi: 0xb1}, {value: 0x8128, lo: 0xb2, hi: 0xb2}, {value: 0x4ca5, lo: 0xb3, hi: 0xb3}, {value: 0x8129, lo: 0xb4, hi: 0xb4}, {value: 0x4cae, lo: 0xb5, hi: 0xb5}, {value: 0x46b3, lo: 0xb6, hi: 0xb6}, {value: 0x476b, lo: 0xb7, hi: 0xb7}, {value: 0x46bb, lo: 0xb8, hi: 0xb8}, {value: 0x4776, lo: 0xb9, hi: 0xb9}, {value: 0x8128, lo: 0xba, hi: 0xbd}, // Block 0x26, offset 0xff {value: 0x0000, lo: 0x0b}, {value: 0x8128, lo: 0x80, hi: 0x80}, {value: 0x4cb7, lo: 0x81, hi: 0x81}, {value: 0x8133, lo: 0x82, hi: 0x83}, {value: 0x8105, lo: 0x84, hi: 0x84}, {value: 0x8133, lo: 0x86, hi: 0x87}, {value: 0x279e, lo: 0x93, hi: 0x93}, {value: 0x27a5, lo: 0x9d, hi: 0x9d}, {value: 0x27ac, lo: 0xa2, hi: 0xa2}, {value: 0x27b3, lo: 0xa7, hi: 0xa7}, {value: 0x27ba, lo: 0xac, hi: 0xac}, {value: 0x2797, lo: 0xb9, hi: 0xb9}, // Block 0x27, offset 0x10b {value: 0x0000, lo: 0x01}, {value: 0x812e, lo: 0x86, hi: 0x86}, // Block 0x28, offset 0x10d {value: 0x0000, lo: 0x05}, {value: 0xa000, lo: 0xa5, hi: 0xa5}, {value: 0x3edf, lo: 0xa6, hi: 0xa6}, {value: 0x9900, lo: 0xae, hi: 0xae}, {value: 0x8103, lo: 0xb7, hi: 0xb7}, {value: 0x8105, lo: 0xb9, hi: 0xba}, // Block 0x29, offset 0x113 {value: 0x0000, lo: 0x01}, {value: 0x812e, lo: 0x8d, hi: 0x8d}, // Block 0x2a, offset 0x115 {value: 0x0000, lo: 0x01}, {value: 0x0402, lo: 0xbc, hi: 0xbc}, // Block 0x2b, offset 0x117 {value: 0x0000, lo: 0x01}, {value: 0xa000, lo: 0x80, hi: 0x92}, // Block 0x2c, offset 0x119 {value: 0x0000, lo: 0x01}, {value: 0xb900, lo: 0xa1, hi: 0xb5}, // Block 0x2d, offset 0x11b {value: 0x0000, lo: 0x01}, {value: 0x9900, lo: 0xa8, hi: 0xbf}, // Block 0x2e, offset 0x11d {value: 0x0000, lo: 0x01}, {value: 0x9900, lo: 0x80, hi: 0x82}, // Block 0x2f, offset 0x11f {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0x9d, hi: 0x9f}, // Block 0x30, offset 0x121 {value: 0x0000, lo: 0x02}, {value: 0x8105, lo: 0x94, hi: 0x95}, {value: 0x8105, lo: 0xb4, hi: 0xb4}, // Block 0x31, offset 0x124 {value: 0x0000, lo: 0x02}, {value: 0x8105, lo: 0x92, hi: 0x92}, {value: 0x8133, lo: 0x9d, hi: 0x9d}, // Block 0x32, offset 0x127 {value: 0x0000, lo: 0x01}, {value: 0x8132, lo: 0xa9, hi: 0xa9}, // Block 0x33, offset 0x129 {value: 0x0004, lo: 0x02}, {value: 0x812f, lo: 0xb9, hi: 0xba}, {value: 0x812e, lo: 0xbb, hi: 0xbb}, // Block 0x34, offset 0x12c {value: 0x0000, lo: 0x02}, {value: 0x8133, lo: 0x97, hi: 0x97}, {value: 0x812e, lo: 0x98, hi: 0x98}, // Block 0x35, offset 0x12f {value: 0x0000, lo: 0x03}, {value: 0x8105, lo: 0xa0, hi: 0xa0}, {value: 0x8133, lo: 0xb5, hi: 0xbc}, {value: 0x812e, lo: 0xbf, hi: 0xbf}, // Block 0x36, offset 0x133 {value: 0x0000, lo: 0x05}, {value: 0x8133, lo: 0xb0, hi: 0xb4}, {value: 0x812e, lo: 0xb5, hi: 0xba}, {value: 0x8133, lo: 0xbb, hi: 0xbc}, {value: 0x812e, lo: 0xbd, hi: 0xbd}, {value: 0x812e, lo: 0xbf, hi: 0xbf}, // Block 0x37, offset 0x139 {value: 0x0000, lo: 0x0b}, {value: 0x812e, lo: 0x80, hi: 0x80}, {value: 0x8133, lo: 0x81, hi: 0x82}, {value: 0x812e, lo: 0x83, hi: 0x84}, {value: 0x8133, lo: 0x85, hi: 0x89}, {value: 0x812e, lo: 0x8a, hi: 0x8a}, {value: 0x8133, lo: 0x8b, hi: 0x9c}, {value: 0x812e, lo: 0x9d, hi: 0x9d}, {value: 0x8133, lo: 0xa0, hi: 0xa5}, {value: 0x812e, lo: 0xa6, hi: 0xa6}, {value: 0x8133, lo: 0xa7, hi: 0xaa}, {value: 0x8136, lo: 0xab, hi: 0xab}, // Block 0x38, offset 0x145 {value: 0x0000, lo: 0x08}, {value: 0x3f27, lo: 0x80, hi: 0x80}, {value: 0x3f2f, lo: 0x81, hi: 0x81}, {value: 0xa000, lo: 0x82, hi: 0x82}, {value: 0x3f37, lo: 0x83, hi: 0x83}, {value: 0x8105, lo: 0x84, hi: 0x84}, {value: 0x8133, lo: 0xab, hi: 0xab}, {value: 0x812e, lo: 0xac, hi: 0xac}, {value: 0x8133, lo: 0xad, hi: 0xb3}, // Block 0x39, offset 0x14e {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0xaa, hi: 0xab}, // Block 0x3a, offset 0x150 {value: 0x0000, lo: 0x02}, {value: 0x8103, lo: 0xa6, hi: 0xa6}, {value: 0x8105, lo: 0xb2, hi: 0xb3}, // Block 0x3b, offset 0x153 {value: 0x0000, lo: 0x01}, {value: 0x8103, lo: 0xb7, hi: 0xb7}, // Block 0x3c, offset 0x155 {value: 0x0000, lo: 0x0a}, {value: 0x8133, lo: 0x90, hi: 0x92}, {value: 0x8101, lo: 0x94, hi: 0x94}, {value: 0x812e, lo: 0x95, hi: 0x99}, {value: 0x8133, lo: 0x9a, hi: 0x9b}, {value: 0x812e, lo: 0x9c, hi: 0x9f}, {value: 0x8133, lo: 0xa0, hi: 0xa0}, {value: 0x8101, lo: 0xa2, hi: 0xa8}, {value: 0x812e, lo: 0xad, hi: 0xad}, {value: 0x8133, lo: 0xb4, hi: 0xb4}, {value: 0x8133, lo: 0xb8, hi: 0xb9}, // Block 0x3d, offset 0x160 {value: 0x0002, lo: 0x0a}, {value: 0x0043, lo: 0xac, hi: 0xac}, {value: 0x00d1, lo: 0xad, hi: 0xad}, {value: 0x0045, lo: 0xae, hi: 0xae}, {value: 0x0049, lo: 0xb0, hi: 0xb1}, {value: 0x00ec, lo: 0xb2, hi: 0xb2}, {value: 0x004f, lo: 0xb3, hi: 0xba}, {value: 0x005f, lo: 0xbc, hi: 0xbc}, {value: 0x00fe, lo: 0xbd, hi: 0xbd}, {value: 0x0061, lo: 0xbe, hi: 0xbe}, {value: 0x0065, lo: 0xbf, hi: 0xbf}, // Block 0x3e, offset 0x16b {value: 0x0000, lo: 0x0d}, {value: 0x0001, lo: 0x80, hi: 0x8a}, {value: 0x0532, lo: 0x91, hi: 0x91}, {value: 0x439a, lo: 0x97, hi: 0x97}, {value: 0x001d, lo: 0xa4, hi: 0xa4}, {value: 0x19a0, lo: 0xa5, hi: 0xa5}, {value: 0x1c8c, lo: 0xa6, hi: 0xa6}, {value: 0x0001, lo: 0xaf, hi: 0xaf}, {value: 0x27c1, lo: 0xb3, hi: 0xb3}, {value: 0x2935, lo: 0xb4, hi: 0xb4}, {value: 0x27c8, lo: 0xb6, hi: 0xb6}, {value: 0x293f, lo: 0xb7, hi: 0xb7}, {value: 0x199a, lo: 0xbc, hi: 0xbc}, {value: 0x4368, lo: 0xbe, hi: 0xbe}, // Block 0x3f, offset 0x179 {value: 0x0002, lo: 0x0d}, {value: 0x1a60, lo: 0x87, hi: 0x87}, {value: 0x1a5d, lo: 0x88, hi: 0x88}, {value: 0x199d, lo: 0x89, hi: 0x89}, {value: 0x2ac5, lo: 0x97, hi: 0x97}, {value: 0x0001, lo: 0x9f, hi: 0x9f}, {value: 0x0021, lo: 0xb0, hi: 0xb0}, {value: 0x0093, lo: 0xb1, hi: 0xb1}, {value: 0x0029, lo: 0xb4, hi: 0xb9}, {value: 0x0017, lo: 0xba, hi: 0xba}, {value: 0x055e, lo: 0xbb, hi: 0xbb}, {value: 0x003b, lo: 0xbc, hi: 0xbc}, {value: 0x0011, lo: 0xbd, hi: 0xbe}, {value: 0x009d, lo: 0xbf, hi: 0xbf}, // Block 0x40, offset 0x187 {value: 0x0002, lo: 0x0f}, {value: 0x0021, lo: 0x80, hi: 0x89}, {value: 0x0017, lo: 0x8a, hi: 0x8a}, {value: 0x055e, lo: 0x8b, hi: 0x8b}, {value: 0x003b, lo: 0x8c, hi: 0x8c}, {value: 0x0011, lo: 0x8d, hi: 0x8e}, {value: 0x0083, lo: 0x90, hi: 0x90}, {value: 0x008b, lo: 0x91, hi: 0x91}, {value: 0x009f, lo: 0x92, hi: 0x92}, {value: 0x00b1, lo: 0x93, hi: 0x93}, {value: 0x011f, lo: 0x94, hi: 0x94}, {value: 0x0091, lo: 0x95, hi: 0x95}, {value: 0x0097, lo: 0x96, hi: 0x99}, {value: 0x00a1, lo: 0x9a, hi: 0x9a}, {value: 0x00a7, lo: 0x9b, hi: 0x9c}, {value: 0x1ac9, lo: 0xa8, hi: 0xa8}, // Block 0x41, offset 0x197 {value: 0x0000, lo: 0x0d}, {value: 0x8133, lo: 0x90, hi: 0x91}, {value: 0x8101, lo: 0x92, hi: 0x93}, {value: 0x8133, lo: 0x94, hi: 0x97}, {value: 0x8101, lo: 0x98, hi: 0x9a}, {value: 0x8133, lo: 0x9b, hi: 0x9c}, {value: 0x8133, lo: 0xa1, hi: 0xa1}, {value: 0x8101, lo: 0xa5, hi: 0xa6}, {value: 0x8133, lo: 0xa7, hi: 0xa7}, {value: 0x812e, lo: 0xa8, hi: 0xa8}, {value: 0x8133, lo: 0xa9, hi: 0xa9}, {value: 0x8101, lo: 0xaa, hi: 0xab}, {value: 0x812e, lo: 0xac, hi: 0xaf}, {value: 0x8133, lo: 0xb0, hi: 0xb0}, // Block 0x42, offset 0x1a5 {value: 0x0007, lo: 0x06}, {value: 0x22b0, lo: 0x89, hi: 0x89}, {value: 0xa000, lo: 0x90, hi: 0x90}, {value: 0xa000, lo: 0x92, hi: 0x92}, {value: 0xa000, lo: 0x94, hi: 0x94}, {value: 0x3b18, lo: 0x9a, hi: 0x9b}, {value: 0x3b26, lo: 0xae, hi: 0xae}, // Block 0x43, offset 0x1ac {value: 0x000e, lo: 0x05}, {value: 0x3b2d, lo: 0x8d, hi: 0x8e}, {value: 0x3b34, lo: 0x8f, hi: 0x8f}, {value: 0xa000, lo: 0x90, hi: 0x90}, {value: 0xa000, lo: 0x92, hi: 0x92}, {value: 0xa000, lo: 0x94, hi: 0x94}, // Block 0x44, offset 0x1b2 {value: 0x017a, lo: 0x0e}, {value: 0xa000, lo: 0x83, hi: 0x83}, {value: 0x3b42, lo: 0x84, hi: 0x84}, {value: 0xa000, lo: 0x88, hi: 0x88}, {value: 0x3b49, lo: 0x89, hi: 0x89}, {value: 0xa000, lo: 0x8b, hi: 0x8b}, {value: 0x3b50, lo: 0x8c, hi: 0x8c}, {value: 0xa000, lo: 0xa3, hi: 0xa3}, {value: 0x3b57, lo: 0xa4, hi: 0xa4}, {value: 0xa000, lo: 0xa5, hi: 0xa5}, {value: 0x3b5e, lo: 0xa6, hi: 0xa6}, {value: 0x27cf, lo: 0xac, hi: 0xad}, {value: 0x27d6, lo: 0xaf, hi: 0xaf}, {value: 0x2953, lo: 0xb0, hi: 0xb0}, {value: 0xa000, lo: 0xbc, hi: 0xbc}, // Block 0x45, offset 0x1c1 {value: 0x0007, lo: 0x03}, {value: 0x3bc7, lo: 0xa0, hi: 0xa1}, {value: 0x3bf1, lo: 0xa2, hi: 0xa3}, {value: 0x3c1b, lo: 0xaa, hi: 0xad}, // Block 0x46, offset 0x1c5 {value: 0x0004, lo: 0x01}, {value: 0x0586, lo: 0xa9, hi: 0xaa}, // Block 0x47, offset 0x1c7 {value: 0x0002, lo: 0x03}, {value: 0x0057, lo: 0x80, hi: 0x8f}, {value: 0x0083, lo: 0x90, hi: 0xa9}, {value: 0x0021, lo: 0xaa, hi: 0xaa}, // Block 0x48, offset 0x1cb {value: 0x0000, lo: 0x01}, {value: 0x2ad2, lo: 0x8c, hi: 0x8c}, // Block 0x49, offset 0x1cd {value: 0x0266, lo: 0x02}, {value: 0x1cbc, lo: 0xb4, hi: 0xb4}, {value: 0x1a5a, lo: 0xb5, hi: 0xb6}, // Block 0x4a, offset 0x1d0 {value: 0x0000, lo: 0x01}, {value: 0x45dc, lo: 0x9c, hi: 0x9c}, // Block 0x4b, offset 0x1d2 {value: 0x0000, lo: 0x02}, {value: 0x0095, lo: 0xbc, hi: 0xbc}, {value: 0x006d, lo: 0xbd, hi: 0xbd}, // Block 0x4c, offset 0x1d5 {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0xaf, hi: 0xb1}, // Block 0x4d, offset 0x1d7 {value: 0x0000, lo: 0x02}, {value: 0x057a, lo: 0xaf, hi: 0xaf}, {value: 0x8105, lo: 0xbf, hi: 0xbf}, // Block 0x4e, offset 0x1da {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0xa0, hi: 0xbf}, // Block 0x4f, offset 0x1dc {value: 0x0000, lo: 0x01}, {value: 0x0ebe, lo: 0x9f, hi: 0x9f}, // Block 0x50, offset 0x1de {value: 0x0000, lo: 0x01}, {value: 0x172a, lo: 0xb3, hi: 0xb3}, // Block 0x51, offset 0x1e0 {value: 0x0004, lo: 0x0b}, {value: 0x1692, lo: 0x80, hi: 0x82}, {value: 0x16aa, lo: 0x83, hi: 0x83}, {value: 0x16c2, lo: 0x84, hi: 0x85}, {value: 0x16d2, lo: 0x86, hi: 0x89}, {value: 0x16e6, lo: 0x8a, hi: 0x8c}, {value: 0x16fa, lo: 0x8d, hi: 0x8d}, {value: 0x1702, lo: 0x8e, hi: 0x8e}, {value: 0x170a, lo: 0x8f, hi: 0x90}, {value: 0x1716, lo: 0x91, hi: 0x93}, {value: 0x1726, lo: 0x94, hi: 0x94}, {value: 0x172e, lo: 0x95, hi: 0x95}, // Block 0x52, offset 0x1ec {value: 0x0004, lo: 0x09}, {value: 0x0001, lo: 0x80, hi: 0x80}, {value: 0x812d, lo: 0xaa, hi: 0xaa}, {value: 0x8132, lo: 0xab, hi: 0xab}, {value: 0x8134, lo: 0xac, hi: 0xac}, {value: 0x812f, lo: 0xad, hi: 0xad}, {value: 0x8130, lo: 0xae, hi: 0xae}, {value: 0x8130, lo: 0xaf, hi: 0xaf}, {value: 0x05ae, lo: 0xb6, hi: 0xb6}, {value: 0x0982, lo: 0xb8, hi: 0xba}, // Block 0x53, offset 0x1f6 {value: 0x0006, lo: 0x09}, {value: 0x0406, lo: 0xb1, hi: 0xb1}, {value: 0x040a, lo: 0xb2, hi: 0xb2}, {value: 0x4bcc, lo: 0xb3, hi: 0xb3}, {value: 0x040e, lo: 0xb4, hi: 0xb4}, {value: 0x4bd2, lo: 0xb5, hi: 0xb6}, {value: 0x0412, lo: 0xb7, hi: 0xb7}, {value: 0x0416, lo: 0xb8, hi: 0xb8}, {value: 0x041a, lo: 0xb9, hi: 0xb9}, {value: 0x4bde, lo: 0xba, hi: 0xbf}, // Block 0x54, offset 0x200 {value: 0x0000, lo: 0x02}, {value: 0x8133, lo: 0xaf, hi: 0xaf}, {value: 0x8133, lo: 0xb4, hi: 0xbd}, // Block 0x55, offset 0x203 {value: 0x0000, lo: 0x03}, {value: 0x02d8, lo: 0x9c, hi: 0x9c}, {value: 0x02de, lo: 0x9d, hi: 0x9d}, {value: 0x8133, lo: 0x9e, hi: 0x9f}, // Block 0x56, offset 0x207 {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0xb0, hi: 0xb1}, // Block 0x57, offset 0x209 {value: 0x0000, lo: 0x01}, {value: 0x173e, lo: 0xb0, hi: 0xb0}, // Block 0x58, offset 0x20b {value: 0x0006, lo: 0x05}, {value: 0x0067, lo: 0xb1, hi: 0xb1}, {value: 0x0047, lo: 0xb2, hi: 0xb3}, {value: 0x0063, lo: 0xb4, hi: 0xb4}, {value: 0x00dd, lo: 0xb8, hi: 0xb8}, {value: 0x00e9, lo: 0xb9, hi: 0xb9}, // Block 0x59, offset 0x211 {value: 0x0000, lo: 0x02}, {value: 0x8105, lo: 0x86, hi: 0x86}, {value: 0x8105, lo: 0xac, hi: 0xac}, // Block 0x5a, offset 0x214 {value: 0x0000, lo: 0x02}, {value: 0x8105, lo: 0x84, hi: 0x84}, {value: 0x8133, lo: 0xa0, hi: 0xb1}, // Block 0x5b, offset 0x217 {value: 0x0000, lo: 0x01}, {value: 0x812e, lo: 0xab, hi: 0xad}, // Block 0x5c, offset 0x219 {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0x93, hi: 0x93}, // Block 0x5d, offset 0x21b {value: 0x0000, lo: 0x01}, {value: 0x8103, lo: 0xb3, hi: 0xb3}, // Block 0x5e, offset 0x21d {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0x80, hi: 0x80}, // Block 0x5f, offset 0x21f {value: 0x0000, lo: 0x05}, {value: 0x8133, lo: 0xb0, hi: 0xb0}, {value: 0x8133, lo: 0xb2, hi: 0xb3}, {value: 0x812e, lo: 0xb4, hi: 0xb4}, {value: 0x8133, lo: 0xb7, hi: 0xb8}, {value: 0x8133, lo: 0xbe, hi: 0xbf}, // Block 0x60, offset 0x225 {value: 0x0000, lo: 0x02}, {value: 0x8133, lo: 0x81, hi: 0x81}, {value: 0x8105, lo: 0xb6, hi: 0xb6}, // Block 0x61, offset 0x228 {value: 0x000c, lo: 0x04}, {value: 0x173a, lo: 0x9c, hi: 0x9d}, {value: 0x014f, lo: 0x9e, hi: 0x9e}, {value: 0x174a, lo: 0x9f, hi: 0x9f}, {value: 0x01a6, lo: 0xa9, hi: 0xa9}, // Block 0x62, offset 0x22d {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0xad, hi: 0xad}, // Block 0x63, offset 0x22f {value: 0x0000, lo: 0x06}, {value: 0xe500, lo: 0x80, hi: 0x80}, {value: 0xc600, lo: 0x81, hi: 0x9b}, {value: 0xe500, lo: 0x9c, hi: 0x9c}, {value: 0xc600, lo: 0x9d, hi: 0xb7}, {value: 0xe500, lo: 0xb8, hi: 0xb8}, {value: 0xc600, lo: 0xb9, hi: 0xbf}, // Block 0x64, offset 0x236 {value: 0x0000, lo: 0x05}, {value: 0xc600, lo: 0x80, hi: 0x93}, {value: 0xe500, lo: 0x94, hi: 0x94}, {value: 0xc600, lo: 0x95, hi: 0xaf}, {value: 0xe500, lo: 0xb0, hi: 0xb0}, {value: 0xc600, lo: 0xb1, hi: 0xbf}, // Block 0x65, offset 0x23c {value: 0x0000, lo: 0x05}, {value: 0xc600, lo: 0x80, hi: 0x8b}, {value: 0xe500, lo: 0x8c, hi: 0x8c}, {value: 0xc600, lo: 0x8d, hi: 0xa7}, {value: 0xe500, lo: 0xa8, hi: 0xa8}, {value: 0xc600, lo: 0xa9, hi: 0xbf}, // Block 0x66, offset 0x242 {value: 0x0000, lo: 0x07}, {value: 0xc600, lo: 0x80, hi: 0x83}, {value: 0xe500, lo: 0x84, hi: 0x84}, {value: 0xc600, lo: 0x85, hi: 0x9f}, {value: 0xe500, lo: 0xa0, hi: 0xa0}, {value: 0xc600, lo: 0xa1, hi: 0xbb}, {value: 0xe500, lo: 0xbc, hi: 0xbc}, {value: 0xc600, lo: 0xbd, hi: 0xbf}, // Block 0x67, offset 0x24a {value: 0x0000, lo: 0x05}, {value: 0xc600, lo: 0x80, hi: 0x97}, {value: 0xe500, lo: 0x98, hi: 0x98}, {value: 0xc600, lo: 0x99, hi: 0xb3}, {value: 0xe500, lo: 0xb4, hi: 0xb4}, {value: 0xc600, lo: 0xb5, hi: 0xbf}, // Block 0x68, offset 0x250 {value: 0x0000, lo: 0x05}, {value: 0xc600, lo: 0x80, hi: 0x8f}, {value: 0xe500, lo: 0x90, hi: 0x90}, {value: 0xc600, lo: 0x91, hi: 0xab}, {value: 0xe500, lo: 0xac, hi: 0xac}, {value: 0xc600, lo: 0xad, hi: 0xbf}, // Block 0x69, offset 0x256 {value: 0x0000, lo: 0x05}, {value: 0xc600, lo: 0x80, hi: 0x87}, {value: 0xe500, lo: 0x88, hi: 0x88}, {value: 0xc600, lo: 0x89, hi: 0xa3}, {value: 0xe500, lo: 0xa4, hi: 0xa4}, {value: 0xc600, lo: 0xa5, hi: 0xbf}, // Block 0x6a, offset 0x25c {value: 0x0000, lo: 0x03}, {value: 0xc600, lo: 0x80, hi: 0x87}, {value: 0xe500, lo: 0x88, hi: 0x88}, {value: 0xc600, lo: 0x89, hi: 0xa3}, // Block 0x6b, offset 0x260 {value: 0x0002, lo: 0x01}, {value: 0x0003, lo: 0x81, hi: 0xbf}, // Block 0x6c, offset 0x262 {value: 0x0000, lo: 0x01}, {value: 0x812e, lo: 0xbd, hi: 0xbd}, // Block 0x6d, offset 0x264 {value: 0x0000, lo: 0x01}, {value: 0x812e, lo: 0xa0, hi: 0xa0}, // Block 0x6e, offset 0x266 {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0xb6, hi: 0xba}, // Block 0x6f, offset 0x268 {value: 0x0000, lo: 0x04}, {value: 0x410f, lo: 0x89, hi: 0x89}, {value: 0xa000, lo: 0x92, hi: 0x92}, {value: 0xa000, lo: 0x9a, hi: 0x9a}, {value: 0x4117, lo: 0xa4, hi: 0xa4}, // Block 0x70, offset 0x26d {value: 0x002d, lo: 0x05}, {value: 0x812e, lo: 0x8d, hi: 0x8d}, {value: 0x8133, lo: 0x8f, hi: 0x8f}, {value: 0x8133, lo: 0xb8, hi: 0xb8}, {value: 0x8101, lo: 0xb9, hi: 0xba}, {value: 0x8105, lo: 0xbf, hi: 0xbf}, // Block 0x71, offset 0x273 {value: 0x0000, lo: 0x02}, {value: 0x8133, lo: 0xa5, hi: 0xa5}, {value: 0x812e, lo: 0xa6, hi: 0xa6}, // Block 0x72, offset 0x276 {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0xa4, hi: 0xa7}, // Block 0x73, offset 0x278 {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0xa9, hi: 0xad}, // Block 0x74, offset 0x27a {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0xab, hi: 0xac}, // Block 0x75, offset 0x27c {value: 0x0000, lo: 0x02}, {value: 0x812e, lo: 0xba, hi: 0xbb}, {value: 0x812e, lo: 0xbd, hi: 0xbf}, // Block 0x76, offset 0x27f {value: 0x0000, lo: 0x05}, {value: 0x812e, lo: 0x86, hi: 0x87}, {value: 0x8133, lo: 0x88, hi: 0x8a}, {value: 0x812e, lo: 0x8b, hi: 0x8b}, {value: 0x8133, lo: 0x8c, hi: 0x8c}, {value: 0x812e, lo: 0x8d, hi: 0x90}, // Block 0x77, offset 0x285 {value: 0x0005, lo: 0x03}, {value: 0x8133, lo: 0x82, hi: 0x82}, {value: 0x812e, lo: 0x83, hi: 0x84}, {value: 0x812e, lo: 0x85, hi: 0x85}, // Block 0x78, offset 0x289 {value: 0x0000, lo: 0x03}, {value: 0x8105, lo: 0x86, hi: 0x86}, {value: 0x8105, lo: 0xb0, hi: 0xb0}, {value: 0x8105, lo: 0xbf, hi: 0xbf}, // Block 0x79, offset 0x28d {value: 0x17fe, lo: 0x07}, {value: 0xa000, lo: 0x99, hi: 0x99}, {value: 0x4287, lo: 0x9a, hi: 0x9a}, {value: 0xa000, lo: 0x9b, hi: 0x9b}, {value: 0x4291, lo: 0x9c, hi: 0x9c}, {value: 0xa000, lo: 0xa5, hi: 0xa5}, {value: 0x429b, lo: 0xab, hi: 0xab}, {value: 0x8105, lo: 0xb9, hi: 0xba}, // Block 0x7a, offset 0x295 {value: 0x0000, lo: 0x06}, {value: 0x8133, lo: 0x80, hi: 0x82}, {value: 0x9900, lo: 0xa7, hi: 0xa7}, {value: 0x42a5, lo: 0xae, hi: 0xae}, {value: 0x42af, lo: 0xaf, hi: 0xaf}, {value: 0xa000, lo: 0xb1, hi: 0xb2}, {value: 0x8105, lo: 0xb3, hi: 0xb4}, // Block 0x7b, offset 0x29c {value: 0x0000, lo: 0x02}, {value: 0x8105, lo: 0x80, hi: 0x80}, {value: 0x8103, lo: 0x8a, hi: 0x8a}, // Block 0x7c, offset 0x29f {value: 0x0000, lo: 0x02}, {value: 0x8105, lo: 0xb5, hi: 0xb5}, {value: 0x8103, lo: 0xb6, hi: 0xb6}, // Block 0x7d, offset 0x2a2 {value: 0x0002, lo: 0x01}, {value: 0x8103, lo: 0xa9, hi: 0xaa}, // Block 0x7e, offset 0x2a4 {value: 0x0000, lo: 0x02}, {value: 0x8103, lo: 0xbb, hi: 0xbc}, {value: 0x9900, lo: 0xbe, hi: 0xbe}, // Block 0x7f, offset 0x2a7 {value: 0x0000, lo: 0x07}, {value: 0xa000, lo: 0x87, hi: 0x87}, {value: 0x42b9, lo: 0x8b, hi: 0x8b}, {value: 0x42c3, lo: 0x8c, hi: 0x8c}, {value: 0x8105, lo: 0x8d, hi: 0x8d}, {value: 0x9900, lo: 0x97, hi: 0x97}, {value: 0x8133, lo: 0xa6, hi: 0xac}, {value: 0x8133, lo: 0xb0, hi: 0xb4}, // Block 0x80, offset 0x2af {value: 0x5d33, lo: 0x09}, {value: 0xa000, lo: 0x82, hi: 0x82}, {value: 0x42cd, lo: 0x83, hi: 0x84}, {value: 0x42d7, lo: 0x85, hi: 0x85}, {value: 0xa000, lo: 0x8b, hi: 0x8b}, {value: 0x42e1, lo: 0x8e, hi: 0x8e}, {value: 0xa000, lo: 0x90, hi: 0x90}, {value: 0x42eb, lo: 0x91, hi: 0x91}, {value: 0x9900, lo: 0xb8, hi: 0xb8}, {value: 0x9900, lo: 0xbb, hi: 0xbb}, // Block 0x81, offset 0x2b9 {value: 0x0000, lo: 0x06}, {value: 0xb900, lo: 0x82, hi: 0x82}, {value: 0x4c14, lo: 0x85, hi: 0x85}, {value: 0x4c09, lo: 0x87, hi: 0x87}, {value: 0x4c1f, lo: 0x88, hi: 0x88}, {value: 0x9900, lo: 0x89, hi: 0x89}, {value: 0x8105, lo: 0x8e, hi: 0x90}, // Block 0x82, offset 0x2c0 {value: 0x0000, lo: 0x03}, {value: 0x8105, lo: 0x82, hi: 0x82}, {value: 0x8103, lo: 0x86, hi: 0x86}, {value: 0x8133, lo: 0x9e, hi: 0x9e}, // Block 0x83, offset 0x2c4 {value: 0x560b, lo: 0x06}, {value: 0x9900, lo: 0xb0, hi: 0xb0}, {value: 0xa000, lo: 0xb9, hi: 0xb9}, {value: 0x9900, lo: 0xba, hi: 0xba}, {value: 0x42ff, lo: 0xbb, hi: 0xbb}, {value: 0x42f5, lo: 0xbc, hi: 0xbd}, {value: 0x4309, lo: 0xbe, hi: 0xbe}, // Block 0x84, offset 0x2cb {value: 0x0000, lo: 0x02}, {value: 0x8105, lo: 0x82, hi: 0x82}, {value: 0x8103, lo: 0x83, hi: 0x83}, // Block 0x85, offset 0x2ce {value: 0x0000, lo: 0x05}, {value: 0x9900, lo: 0xaf, hi: 0xaf}, {value: 0xa000, lo: 0xb8, hi: 0xb9}, {value: 0x4313, lo: 0xba, hi: 0xba}, {value: 0x431d, lo: 0xbb, hi: 0xbb}, {value: 0x8105, lo: 0xbf, hi: 0xbf}, // Block 0x86, offset 0x2d4 {value: 0x0000, lo: 0x01}, {value: 0x8103, lo: 0x80, hi: 0x80}, // Block 0x87, offset 0x2d6 {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0xbf, hi: 0xbf}, // Block 0x88, offset 0x2d8 {value: 0x0000, lo: 0x02}, {value: 0x8105, lo: 0xb6, hi: 0xb6}, {value: 0x8103, lo: 0xb7, hi: 0xb7}, // Block 0x89, offset 0x2db {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0xab, hi: 0xab}, // Block 0x8a, offset 0x2dd {value: 0x0000, lo: 0x02}, {value: 0x8105, lo: 0xb9, hi: 0xb9}, {value: 0x8103, lo: 0xba, hi: 0xba}, // Block 0x8b, offset 0x2e0 {value: 0x0000, lo: 0x04}, {value: 0x9900, lo: 0xb0, hi: 0xb0}, {value: 0xa000, lo: 0xb5, hi: 0xb5}, {value: 0x4327, lo: 0xb8, hi: 0xb8}, {value: 0x8105, lo: 0xbd, hi: 0xbe}, // Block 0x8c, offset 0x2e5 {value: 0x0000, lo: 0x01}, {value: 0x8103, lo: 0x83, hi: 0x83}, // Block 0x8d, offset 0x2e7 {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0xa0, hi: 0xa0}, // Block 0x8e, offset 0x2e9 {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0xb4, hi: 0xb4}, // Block 0x8f, offset 0x2eb {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0x87, hi: 0x87}, // Block 0x90, offset 0x2ed {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0x99, hi: 0x99}, // Block 0x91, offset 0x2ef {value: 0x0000, lo: 0x02}, {value: 0x8103, lo: 0x82, hi: 0x82}, {value: 0x8105, lo: 0x84, hi: 0x85}, // Block 0x92, offset 0x2f2 {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0x97, hi: 0x97}, // Block 0x93, offset 0x2f4 {value: 0x0000, lo: 0x01}, {value: 0x8105, lo: 0x81, hi: 0x82}, // Block 0x94, offset 0x2f6 {value: 0x0000, lo: 0x0c}, {value: 0xb900, lo: 0x9e, hi: 0x9e}, {value: 0x9900, lo: 0x9f, hi: 0xa0}, {value: 0x4c83, lo: 0xa1, hi: 0xa1}, {value: 0x4c8e, lo: 0xa2, hi: 0xa2}, {value: 0x4c2a, lo: 0xa3, hi: 0xa3}, {value: 0x4c40, lo: 0xa4, hi: 0xa4}, {value: 0x4c35, lo: 0xa5, hi: 0xa5}, {value: 0x4c56, lo: 0xa6, hi: 0xa6}, {value: 0x4c74, lo: 0xa7, hi: 0xa7}, {value: 0x4c65, lo: 0xa8, hi: 0xa8}, {value: 0xb900, lo: 0xa9, hi: 0xa9}, {value: 0x8105, lo: 0xaf, hi: 0xaf}, // Block 0x95, offset 0x303 {value: 0x0000, lo: 0x01}, {value: 0x8101, lo: 0xb0, hi: 0xb4}, // Block 0x96, offset 0x305 {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0xb0, hi: 0xb6}, // Block 0x97, offset 0x307 {value: 0x0000, lo: 0x05}, {value: 0xa000, lo: 0xa3, hi: 0xa3}, {value: 0xb900, lo: 0xa7, hi: 0xa7}, {value: 0x4c4b, lo: 0xa8, hi: 0xa8}, {value: 0x4b35, lo: 0xa9, hi: 0xa9}, {value: 0x4347, lo: 0xaa, hi: 0xaa}, // Block 0x98, offset 0x30d {value: 0x0000, lo: 0x01}, {value: 0x8102, lo: 0xb0, hi: 0xb1}, // Block 0x99, offset 0x30f {value: 0x0000, lo: 0x01}, {value: 0x8101, lo: 0x9e, hi: 0x9e}, // Block 0x9a, offset 0x311 {value: 0x0002, lo: 0x02}, {value: 0x0043, lo: 0x96, hi: 0xaf}, {value: 0x0021, lo: 0xb0, hi: 0xb9}, // Block 0x9b, offset 0x314 {value: 0x0000, lo: 0x0c}, {value: 0x4743, lo: 0x9e, hi: 0x9e}, {value: 0x474d, lo: 0x9f, hi: 0x9f}, {value: 0x4781, lo: 0xa0, hi: 0xa0}, {value: 0x478f, lo: 0xa1, hi: 0xa1}, {value: 0x479d, lo: 0xa2, hi: 0xa2}, {value: 0x47ab, lo: 0xa3, hi: 0xa3}, {value: 0x47b9, lo: 0xa4, hi: 0xa4}, {value: 0x812c, lo: 0xa5, hi: 0xa6}, {value: 0x8101, lo: 0xa7, hi: 0xa9}, {value: 0x8131, lo: 0xad, hi: 0xad}, {value: 0x812c, lo: 0xae, hi: 0xb2}, {value: 0x812e, lo: 0xbb, hi: 0xbf}, // Block 0x9c, offset 0x321 {value: 0x0000, lo: 0x09}, {value: 0x812e, lo: 0x80, hi: 0x82}, {value: 0x8133, lo: 0x85, hi: 0x89}, {value: 0x812e, lo: 0x8a, hi: 0x8b}, {value: 0x8133, lo: 0xaa, hi: 0xad}, {value: 0x4757, lo: 0xbb, hi: 0xbb}, {value: 0x4761, lo: 0xbc, hi: 0xbc}, {value: 0x47c7, lo: 0xbd, hi: 0xbd}, {value: 0x47e3, lo: 0xbe, hi: 0xbe}, {value: 0x47d5, lo: 0xbf, hi: 0xbf}, // Block 0x9d, offset 0x32b {value: 0x0000, lo: 0x01}, {value: 0x47f1, lo: 0x80, hi: 0x80}, // Block 0x9e, offset 0x32d {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0x82, hi: 0x84}, // Block 0x9f, offset 0x32f {value: 0x0002, lo: 0x03}, {value: 0x0043, lo: 0x80, hi: 0x99}, {value: 0x0083, lo: 0x9a, hi: 0xb3}, {value: 0x0043, lo: 0xb4, hi: 0xbf}, // Block 0xa0, offset 0x333 {value: 0x0002, lo: 0x04}, {value: 0x005b, lo: 0x80, hi: 0x8d}, {value: 0x0083, lo: 0x8e, hi: 0x94}, {value: 0x0093, lo: 0x96, hi: 0xa7}, {value: 0x0043, lo: 0xa8, hi: 0xbf}, // Block 0xa1, offset 0x338 {value: 0x0002, lo: 0x0b}, {value: 0x0073, lo: 0x80, hi: 0x81}, {value: 0x0083, lo: 0x82, hi: 0x9b}, {value: 0x0043, lo: 0x9c, hi: 0x9c}, {value: 0x0047, lo: 0x9e, hi: 0x9f}, {value: 0x004f, lo: 0xa2, hi: 0xa2}, {value: 0x0055, lo: 0xa5, hi: 0xa6}, {value: 0x005d, lo: 0xa9, hi: 0xac}, {value: 0x0067, lo: 0xae, hi: 0xb5}, {value: 0x0083, lo: 0xb6, hi: 0xb9}, {value: 0x008d, lo: 0xbb, hi: 0xbb}, {value: 0x0091, lo: 0xbd, hi: 0xbf}, // Block 0xa2, offset 0x344 {value: 0x0002, lo: 0x04}, {value: 0x0097, lo: 0x80, hi: 0x83}, {value: 0x00a1, lo: 0x85, hi: 0x8f}, {value: 0x0043, lo: 0x90, hi: 0xa9}, {value: 0x0083, lo: 0xaa, hi: 0xbf}, // Block 0xa3, offset 0x349 {value: 0x0002, lo: 0x08}, {value: 0x00af, lo: 0x80, hi: 0x83}, {value: 0x0043, lo: 0x84, hi: 0x85}, {value: 0x0049, lo: 0x87, hi: 0x8a}, {value: 0x0055, lo: 0x8d, hi: 0x94}, {value: 0x0067, lo: 0x96, hi: 0x9c}, {value: 0x0083, lo: 0x9e, hi: 0xb7}, {value: 0x0043, lo: 0xb8, hi: 0xb9}, {value: 0x0049, lo: 0xbb, hi: 0xbe}, // Block 0xa4, offset 0x352 {value: 0x0002, lo: 0x05}, {value: 0x0053, lo: 0x80, hi: 0x84}, {value: 0x005f, lo: 0x86, hi: 0x86}, {value: 0x0067, lo: 0x8a, hi: 0x90}, {value: 0x0083, lo: 0x92, hi: 0xab}, {value: 0x0043, lo: 0xac, hi: 0xbf}, // Block 0xa5, offset 0x358 {value: 0x0002, lo: 0x04}, {value: 0x006b, lo: 0x80, hi: 0x85}, {value: 0x0083, lo: 0x86, hi: 0x9f}, {value: 0x0043, lo: 0xa0, hi: 0xb9}, {value: 0x0083, lo: 0xba, hi: 0xbf}, // Block 0xa6, offset 0x35d {value: 0x0002, lo: 0x03}, {value: 0x008f, lo: 0x80, hi: 0x93}, {value: 0x0043, lo: 0x94, hi: 0xad}, {value: 0x0083, lo: 0xae, hi: 0xbf}, // Block 0xa7, offset 0x361 {value: 0x0002, lo: 0x04}, {value: 0x00a7, lo: 0x80, hi: 0x87}, {value: 0x0043, lo: 0x88, hi: 0xa1}, {value: 0x0083, lo: 0xa2, hi: 0xbb}, {value: 0x0043, lo: 0xbc, hi: 0xbf}, // Block 0xa8, offset 0x366 {value: 0x0002, lo: 0x03}, {value: 0x004b, lo: 0x80, hi: 0x95}, {value: 0x0083, lo: 0x96, hi: 0xaf}, {value: 0x0043, lo: 0xb0, hi: 0xbf}, // Block 0xa9, offset 0x36a {value: 0x0003, lo: 0x0f}, {value: 0x023c, lo: 0x80, hi: 0x80}, {value: 0x0556, lo: 0x81, hi: 0x81}, {value: 0x023f, lo: 0x82, hi: 0x9a}, {value: 0x0552, lo: 0x9b, hi: 0x9b}, {value: 0x024b, lo: 0x9c, hi: 0x9c}, {value: 0x0254, lo: 0x9d, hi: 0x9d}, {value: 0x025a, lo: 0x9e, hi: 0x9e}, {value: 0x027e, lo: 0x9f, hi: 0x9f}, {value: 0x026f, lo: 0xa0, hi: 0xa0}, {value: 0x026c, lo: 0xa1, hi: 0xa1}, {value: 0x01f7, lo: 0xa2, hi: 0xb2}, {value: 0x020c, lo: 0xb3, hi: 0xb3}, {value: 0x022a, lo: 0xb4, hi: 0xba}, {value: 0x0556, lo: 0xbb, hi: 0xbb}, {value: 0x023f, lo: 0xbc, hi: 0xbf}, // Block 0xaa, offset 0x37a {value: 0x0003, lo: 0x0d}, {value: 0x024b, lo: 0x80, hi: 0x94}, {value: 0x0552, lo: 0x95, hi: 0x95}, {value: 0x024b, lo: 0x96, hi: 0x96}, {value: 0x0254, lo: 0x97, hi: 0x97}, {value: 0x025a, lo: 0x98, hi: 0x98}, {value: 0x027e, lo: 0x99, hi: 0x99}, {value: 0x026f, lo: 0x9a, hi: 0x9a}, {value: 0x026c, lo: 0x9b, hi: 0x9b}, {value: 0x01f7, lo: 0x9c, hi: 0xac}, {value: 0x020c, lo: 0xad, hi: 0xad}, {value: 0x022a, lo: 0xae, hi: 0xb4}, {value: 0x0556, lo: 0xb5, hi: 0xb5}, {value: 0x023f, lo: 0xb6, hi: 0xbf}, // Block 0xab, offset 0x388 {value: 0x0003, lo: 0x0d}, {value: 0x025d, lo: 0x80, hi: 0x8e}, {value: 0x0552, lo: 0x8f, hi: 0x8f}, {value: 0x024b, lo: 0x90, hi: 0x90}, {value: 0x0254, lo: 0x91, hi: 0x91}, {value: 0x025a, lo: 0x92, hi: 0x92}, {value: 0x027e, lo: 0x93, hi: 0x93}, {value: 0x026f, lo: 0x94, hi: 0x94}, {value: 0x026c, lo: 0x95, hi: 0x95}, {value: 0x01f7, lo: 0x96, hi: 0xa6}, {value: 0x020c, lo: 0xa7, hi: 0xa7}, {value: 0x022a, lo: 0xa8, hi: 0xae}, {value: 0x0556, lo: 0xaf, hi: 0xaf}, {value: 0x023f, lo: 0xb0, hi: 0xbf}, // Block 0xac, offset 0x396 {value: 0x0003, lo: 0x0d}, {value: 0x026f, lo: 0x80, hi: 0x88}, {value: 0x0552, lo: 0x89, hi: 0x89}, {value: 0x024b, lo: 0x8a, hi: 0x8a}, {value: 0x0254, lo: 0x8b, hi: 0x8b}, {value: 0x025a, lo: 0x8c, hi: 0x8c}, {value: 0x027e, lo: 0x8d, hi: 0x8d}, {value: 0x026f, lo: 0x8e, hi: 0x8e}, {value: 0x026c, lo: 0x8f, hi: 0x8f}, {value: 0x01f7, lo: 0x90, hi: 0xa0}, {value: 0x020c, lo: 0xa1, hi: 0xa1}, {value: 0x022a, lo: 0xa2, hi: 0xa8}, {value: 0x0556, lo: 0xa9, hi: 0xa9}, {value: 0x023f, lo: 0xaa, hi: 0xbf}, // Block 0xad, offset 0x3a4 {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0x8f, hi: 0x8f}, // Block 0xae, offset 0x3a6 {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0xae, hi: 0xae}, // Block 0xaf, offset 0x3a8 {value: 0x0000, lo: 0x01}, {value: 0x8133, lo: 0xac, hi: 0xaf}, // Block 0xb0, offset 0x3aa {value: 0x0000, lo: 0x03}, {value: 0x8134, lo: 0xac, hi: 0xad}, {value: 0x812e, lo: 0xae, hi: 0xae}, {value: 0x8133, lo: 0xaf, hi: 0xaf}, // Block 0xb1, offset 0x3ae {value: 0x0000, lo: 0x02}, {value: 0x8133, lo: 0xae, hi: 0xae}, {value: 0x812e, lo: 0xaf, hi: 0xaf}, // Block 0xb2, offset 0x3b1 {value: 0x0000, lo: 0x04}, {value: 0x8133, lo: 0xa3, hi: 0xa3}, {value: 0x8133, lo: 0xa6, hi: 0xa6}, {value: 0x8133, lo: 0xae, hi: 0xaf}, {value: 0x8133, lo: 0xb5, hi: 0xb5}, // Block 0xb3, offset 0x3b6 {value: 0x0000, lo: 0x01}, {value: 0x812e, lo: 0x90, hi: 0x96}, // Block 0xb4, offset 0x3b8 {value: 0x0000, lo: 0x02}, {value: 0x8133, lo: 0x84, hi: 0x89}, {value: 0x8103, lo: 0x8a, hi: 0x8a}, // Block 0xb5, offset 0x3bb {value: 0x0002, lo: 0x0a}, {value: 0x0063, lo: 0x80, hi: 0x89}, {value: 0x1a7e, lo: 0x8a, hi: 0x8a}, {value: 0x1ab1, lo: 0x8b, hi: 0x8b}, {value: 0x1acc, lo: 0x8c, hi: 0x8c}, {value: 0x1ad2, lo: 0x8d, hi: 0x8d}, {value: 0x1cf0, lo: 0x8e, hi: 0x8e}, {value: 0x1ade, lo: 0x8f, hi: 0x8f}, {value: 0x1aa8, lo: 0xaa, hi: 0xaa}, {value: 0x1aab, lo: 0xab, hi: 0xab}, {value: 0x1aae, lo: 0xac, hi: 0xac}, // Block 0xb6, offset 0x3c6 {value: 0x0000, lo: 0x01}, {value: 0x1a6c, lo: 0x90, hi: 0x90}, // Block 0xb7, offset 0x3c8 {value: 0x0028, lo: 0x09}, {value: 0x2999, lo: 0x80, hi: 0x80}, {value: 0x295d, lo: 0x81, hi: 0x81}, {value: 0x2967, lo: 0x82, hi: 0x82}, {value: 0x297b, lo: 0x83, hi: 0x84}, {value: 0x2985, lo: 0x85, hi: 0x86}, {value: 0x2971, lo: 0x87, hi: 0x87}, {value: 0x298f, lo: 0x88, hi: 0x88}, {value: 0x0c6a, lo: 0x90, hi: 0x90}, {value: 0x09e2, lo: 0x91, hi: 0x91}, // Block 0xb8, offset 0x3d2 {value: 0x0002, lo: 0x01}, {value: 0x0021, lo: 0xb0, hi: 0xb9}, } // recompMap: 7688 bytes (entries only) var recompMap map[uint32]rune var recompMapOnce sync.Once const recompMapPacked = "" + "\x00A\x03\x00\x00\x00\x00\xc0" + // 0x00410300: 0x000000C0 "\x00A\x03\x01\x00\x00\x00\xc1" + // 0x00410301: 0x000000C1 "\x00A\x03\x02\x00\x00\x00\xc2" + // 0x00410302: 0x000000C2 "\x00A\x03\x03\x00\x00\x00\xc3" + // 0x00410303: 0x000000C3 "\x00A\x03\b\x00\x00\x00\xc4" + // 0x00410308: 0x000000C4 "\x00A\x03\n\x00\x00\x00\xc5" + // 0x0041030A: 0x000000C5 "\x00C\x03'\x00\x00\x00\xc7" + // 0x00430327: 0x000000C7 "\x00E\x03\x00\x00\x00\x00\xc8" + // 0x00450300: 0x000000C8 "\x00E\x03\x01\x00\x00\x00\xc9" + // 0x00450301: 0x000000C9 "\x00E\x03\x02\x00\x00\x00\xca" + // 0x00450302: 0x000000CA "\x00E\x03\b\x00\x00\x00\xcb" + // 0x00450308: 0x000000CB "\x00I\x03\x00\x00\x00\x00\xcc" + // 0x00490300: 0x000000CC "\x00I\x03\x01\x00\x00\x00\xcd" + // 0x00490301: 0x000000CD "\x00I\x03\x02\x00\x00\x00\xce" + // 0x00490302: 0x000000CE "\x00I\x03\b\x00\x00\x00\xcf" + // 0x00490308: 0x000000CF "\x00N\x03\x03\x00\x00\x00\xd1" + // 0x004E0303: 0x000000D1 "\x00O\x03\x00\x00\x00\x00\xd2" + // 0x004F0300: 0x000000D2 "\x00O\x03\x01\x00\x00\x00\xd3" + // 0x004F0301: 0x000000D3 "\x00O\x03\x02\x00\x00\x00\xd4" + // 0x004F0302: 0x000000D4 "\x00O\x03\x03\x00\x00\x00\xd5" + // 0x004F0303: 0x000000D5 "\x00O\x03\b\x00\x00\x00\xd6" + // 0x004F0308: 0x000000D6 "\x00U\x03\x00\x00\x00\x00\xd9" + // 0x00550300: 0x000000D9 "\x00U\x03\x01\x00\x00\x00\xda" + // 0x00550301: 0x000000DA "\x00U\x03\x02\x00\x00\x00\xdb" + // 0x00550302: 0x000000DB "\x00U\x03\b\x00\x00\x00\xdc" + // 0x00550308: 0x000000DC "\x00Y\x03\x01\x00\x00\x00\xdd" + // 0x00590301: 0x000000DD "\x00a\x03\x00\x00\x00\x00\xe0" + // 0x00610300: 0x000000E0 "\x00a\x03\x01\x00\x00\x00\xe1" + // 0x00610301: 0x000000E1 "\x00a\x03\x02\x00\x00\x00\xe2" + // 0x00610302: 0x000000E2 "\x00a\x03\x03\x00\x00\x00\xe3" + // 0x00610303: 0x000000E3 "\x00a\x03\b\x00\x00\x00\xe4" + // 0x00610308: 0x000000E4 "\x00a\x03\n\x00\x00\x00\xe5" + // 0x0061030A: 0x000000E5 "\x00c\x03'\x00\x00\x00\xe7" + // 0x00630327: 0x000000E7 "\x00e\x03\x00\x00\x00\x00\xe8" + // 0x00650300: 0x000000E8 "\x00e\x03\x01\x00\x00\x00\xe9" + // 0x00650301: 0x000000E9 "\x00e\x03\x02\x00\x00\x00\xea" + // 0x00650302: 0x000000EA "\x00e\x03\b\x00\x00\x00\xeb" + // 0x00650308: 0x000000EB "\x00i\x03\x00\x00\x00\x00\xec" + // 0x00690300: 0x000000EC "\x00i\x03\x01\x00\x00\x00\xed" + // 0x00690301: 0x000000ED "\x00i\x03\x02\x00\x00\x00\xee" + // 0x00690302: 0x000000EE "\x00i\x03\b\x00\x00\x00\xef" + // 0x00690308: 0x000000EF "\x00n\x03\x03\x00\x00\x00\xf1" + // 0x006E0303: 0x000000F1 "\x00o\x03\x00\x00\x00\x00\xf2" + // 0x006F0300: 0x000000F2 "\x00o\x03\x01\x00\x00\x00\xf3" + // 0x006F0301: 0x000000F3 "\x00o\x03\x02\x00\x00\x00\xf4" + // 0x006F0302: 0x000000F4 "\x00o\x03\x03\x00\x00\x00\xf5" + // 0x006F0303: 0x000000F5 "\x00o\x03\b\x00\x00\x00\xf6" + // 0x006F0308: 0x000000F6 "\x00u\x03\x00\x00\x00\x00\xf9" + // 0x00750300: 0x000000F9 "\x00u\x03\x01\x00\x00\x00\xfa" + // 0x00750301: 0x000000FA "\x00u\x03\x02\x00\x00\x00\xfb" + // 0x00750302: 0x000000FB "\x00u\x03\b\x00\x00\x00\xfc" + // 0x00750308: 0x000000FC "\x00y\x03\x01\x00\x00\x00\xfd" + // 0x00790301: 0x000000FD "\x00y\x03\b\x00\x00\x00\xff" + // 0x00790308: 0x000000FF "\x00A\x03\x04\x00\x00\x01\x00" + // 0x00410304: 0x00000100 "\x00a\x03\x04\x00\x00\x01\x01" + // 0x00610304: 0x00000101 "\x00A\x03\x06\x00\x00\x01\x02" + // 0x00410306: 0x00000102 "\x00a\x03\x06\x00\x00\x01\x03" + // 0x00610306: 0x00000103 "\x00A\x03(\x00\x00\x01\x04" + // 0x00410328: 0x00000104 "\x00a\x03(\x00\x00\x01\x05" + // 0x00610328: 0x00000105 "\x00C\x03\x01\x00\x00\x01\x06" + // 0x00430301: 0x00000106 "\x00c\x03\x01\x00\x00\x01\a" + // 0x00630301: 0x00000107 "\x00C\x03\x02\x00\x00\x01\b" + // 0x00430302: 0x00000108 "\x00c\x03\x02\x00\x00\x01\t" + // 0x00630302: 0x00000109 "\x00C\x03\a\x00\x00\x01\n" + // 0x00430307: 0x0000010A "\x00c\x03\a\x00\x00\x01\v" + // 0x00630307: 0x0000010B "\x00C\x03\f\x00\x00\x01\f" + // 0x0043030C: 0x0000010C "\x00c\x03\f\x00\x00\x01\r" + // 0x0063030C: 0x0000010D "\x00D\x03\f\x00\x00\x01\x0e" + // 0x0044030C: 0x0000010E "\x00d\x03\f\x00\x00\x01\x0f" + // 0x0064030C: 0x0000010F "\x00E\x03\x04\x00\x00\x01\x12" + // 0x00450304: 0x00000112 "\x00e\x03\x04\x00\x00\x01\x13" + // 0x00650304: 0x00000113 "\x00E\x03\x06\x00\x00\x01\x14" + // 0x00450306: 0x00000114 "\x00e\x03\x06\x00\x00\x01\x15" + // 0x00650306: 0x00000115 "\x00E\x03\a\x00\x00\x01\x16" + // 0x00450307: 0x00000116 "\x00e\x03\a\x00\x00\x01\x17" + // 0x00650307: 0x00000117 "\x00E\x03(\x00\x00\x01\x18" + // 0x00450328: 0x00000118 "\x00e\x03(\x00\x00\x01\x19" + // 0x00650328: 0x00000119 "\x00E\x03\f\x00\x00\x01\x1a" + // 0x0045030C: 0x0000011A "\x00e\x03\f\x00\x00\x01\x1b" + // 0x0065030C: 0x0000011B "\x00G\x03\x02\x00\x00\x01\x1c" + // 0x00470302: 0x0000011C "\x00g\x03\x02\x00\x00\x01\x1d" + // 0x00670302: 0x0000011D "\x00G\x03\x06\x00\x00\x01\x1e" + // 0x00470306: 0x0000011E "\x00g\x03\x06\x00\x00\x01\x1f" + // 0x00670306: 0x0000011F "\x00G\x03\a\x00\x00\x01 " + // 0x00470307: 0x00000120 "\x00g\x03\a\x00\x00\x01!" + // 0x00670307: 0x00000121 "\x00G\x03'\x00\x00\x01\"" + // 0x00470327: 0x00000122 "\x00g\x03'\x00\x00\x01#" + // 0x00670327: 0x00000123 "\x00H\x03\x02\x00\x00\x01$" + // 0x00480302: 0x00000124 "\x00h\x03\x02\x00\x00\x01%" + // 0x00680302: 0x00000125 "\x00I\x03\x03\x00\x00\x01(" + // 0x00490303: 0x00000128 "\x00i\x03\x03\x00\x00\x01)" + // 0x00690303: 0x00000129 "\x00I\x03\x04\x00\x00\x01*" + // 0x00490304: 0x0000012A "\x00i\x03\x04\x00\x00\x01+" + // 0x00690304: 0x0000012B "\x00I\x03\x06\x00\x00\x01," + // 0x00490306: 0x0000012C "\x00i\x03\x06\x00\x00\x01-" + // 0x00690306: 0x0000012D "\x00I\x03(\x00\x00\x01." + // 0x00490328: 0x0000012E "\x00i\x03(\x00\x00\x01/" + // 0x00690328: 0x0000012F "\x00I\x03\a\x00\x00\x010" + // 0x00490307: 0x00000130 "\x00J\x03\x02\x00\x00\x014" + // 0x004A0302: 0x00000134 "\x00j\x03\x02\x00\x00\x015" + // 0x006A0302: 0x00000135 "\x00K\x03'\x00\x00\x016" + // 0x004B0327: 0x00000136 "\x00k\x03'\x00\x00\x017" + // 0x006B0327: 0x00000137 "\x00L\x03\x01\x00\x00\x019" + // 0x004C0301: 0x00000139 "\x00l\x03\x01\x00\x00\x01:" + // 0x006C0301: 0x0000013A "\x00L\x03'\x00\x00\x01;" + // 0x004C0327: 0x0000013B "\x00l\x03'\x00\x00\x01<" + // 0x006C0327: 0x0000013C "\x00L\x03\f\x00\x00\x01=" + // 0x004C030C: 0x0000013D "\x00l\x03\f\x00\x00\x01>" + // 0x006C030C: 0x0000013E "\x00N\x03\x01\x00\x00\x01C" + // 0x004E0301: 0x00000143 "\x00n\x03\x01\x00\x00\x01D" + // 0x006E0301: 0x00000144 "\x00N\x03'\x00\x00\x01E" + // 0x004E0327: 0x00000145 "\x00n\x03'\x00\x00\x01F" + // 0x006E0327: 0x00000146 "\x00N\x03\f\x00\x00\x01G" + // 0x004E030C: 0x00000147 "\x00n\x03\f\x00\x00\x01H" + // 0x006E030C: 0x00000148 "\x00O\x03\x04\x00\x00\x01L" + // 0x004F0304: 0x0000014C "\x00o\x03\x04\x00\x00\x01M" + // 0x006F0304: 0x0000014D "\x00O\x03\x06\x00\x00\x01N" + // 0x004F0306: 0x0000014E "\x00o\x03\x06\x00\x00\x01O" + // 0x006F0306: 0x0000014F "\x00O\x03\v\x00\x00\x01P" + // 0x004F030B: 0x00000150 "\x00o\x03\v\x00\x00\x01Q" + // 0x006F030B: 0x00000151 "\x00R\x03\x01\x00\x00\x01T" + // 0x00520301: 0x00000154 "\x00r\x03\x01\x00\x00\x01U" + // 0x00720301: 0x00000155 "\x00R\x03'\x00\x00\x01V" + // 0x00520327: 0x00000156 "\x00r\x03'\x00\x00\x01W" + // 0x00720327: 0x00000157 "\x00R\x03\f\x00\x00\x01X" + // 0x0052030C: 0x00000158 "\x00r\x03\f\x00\x00\x01Y" + // 0x0072030C: 0x00000159 "\x00S\x03\x01\x00\x00\x01Z" + // 0x00530301: 0x0000015A "\x00s\x03\x01\x00\x00\x01[" + // 0x00730301: 0x0000015B "\x00S\x03\x02\x00\x00\x01\\" + // 0x00530302: 0x0000015C "\x00s\x03\x02\x00\x00\x01]" + // 0x00730302: 0x0000015D "\x00S\x03'\x00\x00\x01^" + // 0x00530327: 0x0000015E "\x00s\x03'\x00\x00\x01_" + // 0x00730327: 0x0000015F "\x00S\x03\f\x00\x00\x01`" + // 0x0053030C: 0x00000160 "\x00s\x03\f\x00\x00\x01a" + // 0x0073030C: 0x00000161 "\x00T\x03'\x00\x00\x01b" + // 0x00540327: 0x00000162 "\x00t\x03'\x00\x00\x01c" + // 0x00740327: 0x00000163 "\x00T\x03\f\x00\x00\x01d" + // 0x0054030C: 0x00000164 "\x00t\x03\f\x00\x00\x01e" + // 0x0074030C: 0x00000165 "\x00U\x03\x03\x00\x00\x01h" + // 0x00550303: 0x00000168 "\x00u\x03\x03\x00\x00\x01i" + // 0x00750303: 0x00000169 "\x00U\x03\x04\x00\x00\x01j" + // 0x00550304: 0x0000016A "\x00u\x03\x04\x00\x00\x01k" + // 0x00750304: 0x0000016B "\x00U\x03\x06\x00\x00\x01l" + // 0x00550306: 0x0000016C "\x00u\x03\x06\x00\x00\x01m" + // 0x00750306: 0x0000016D "\x00U\x03\n\x00\x00\x01n" + // 0x0055030A: 0x0000016E "\x00u\x03\n\x00\x00\x01o" + // 0x0075030A: 0x0000016F "\x00U\x03\v\x00\x00\x01p" + // 0x0055030B: 0x00000170 "\x00u\x03\v\x00\x00\x01q" + // 0x0075030B: 0x00000171 "\x00U\x03(\x00\x00\x01r" + // 0x00550328: 0x00000172 "\x00u\x03(\x00\x00\x01s" + // 0x00750328: 0x00000173 "\x00W\x03\x02\x00\x00\x01t" + // 0x00570302: 0x00000174 "\x00w\x03\x02\x00\x00\x01u" + // 0x00770302: 0x00000175 "\x00Y\x03\x02\x00\x00\x01v" + // 0x00590302: 0x00000176 "\x00y\x03\x02\x00\x00\x01w" + // 0x00790302: 0x00000177 "\x00Y\x03\b\x00\x00\x01x" + // 0x00590308: 0x00000178 "\x00Z\x03\x01\x00\x00\x01y" + // 0x005A0301: 0x00000179 "\x00z\x03\x01\x00\x00\x01z" + // 0x007A0301: 0x0000017A "\x00Z\x03\a\x00\x00\x01{" + // 0x005A0307: 0x0000017B "\x00z\x03\a\x00\x00\x01|" + // 0x007A0307: 0x0000017C "\x00Z\x03\f\x00\x00\x01}" + // 0x005A030C: 0x0000017D "\x00z\x03\f\x00\x00\x01~" + // 0x007A030C: 0x0000017E "\x00O\x03\x1b\x00\x00\x01\xa0" + // 0x004F031B: 0x000001A0 "\x00o\x03\x1b\x00\x00\x01\xa1" + // 0x006F031B: 0x000001A1 "\x00U\x03\x1b\x00\x00\x01\xaf" + // 0x0055031B: 0x000001AF "\x00u\x03\x1b\x00\x00\x01\xb0" + // 0x0075031B: 0x000001B0 "\x00A\x03\f\x00\x00\x01\xcd" + // 0x0041030C: 0x000001CD "\x00a\x03\f\x00\x00\x01\xce" + // 0x0061030C: 0x000001CE "\x00I\x03\f\x00\x00\x01\xcf" + // 0x0049030C: 0x000001CF "\x00i\x03\f\x00\x00\x01\xd0" + // 0x0069030C: 0x000001D0 "\x00O\x03\f\x00\x00\x01\xd1" + // 0x004F030C: 0x000001D1 "\x00o\x03\f\x00\x00\x01\xd2" + // 0x006F030C: 0x000001D2 "\x00U\x03\f\x00\x00\x01\xd3" + // 0x0055030C: 0x000001D3 "\x00u\x03\f\x00\x00\x01\xd4" + // 0x0075030C: 0x000001D4 "\x00\xdc\x03\x04\x00\x00\x01\xd5" + // 0x00DC0304: 0x000001D5 "\x00\xfc\x03\x04\x00\x00\x01\xd6" + // 0x00FC0304: 0x000001D6 "\x00\xdc\x03\x01\x00\x00\x01\xd7" + // 0x00DC0301: 0x000001D7 "\x00\xfc\x03\x01\x00\x00\x01\xd8" + // 0x00FC0301: 0x000001D8 "\x00\xdc\x03\f\x00\x00\x01\xd9" + // 0x00DC030C: 0x000001D9 "\x00\xfc\x03\f\x00\x00\x01\xda" + // 0x00FC030C: 0x000001DA "\x00\xdc\x03\x00\x00\x00\x01\xdb" + // 0x00DC0300: 0x000001DB "\x00\xfc\x03\x00\x00\x00\x01\xdc" + // 0x00FC0300: 0x000001DC "\x00\xc4\x03\x04\x00\x00\x01\xde" + // 0x00C40304: 0x000001DE "\x00\xe4\x03\x04\x00\x00\x01\xdf" + // 0x00E40304: 0x000001DF "\x02&\x03\x04\x00\x00\x01\xe0" + // 0x02260304: 0x000001E0 "\x02'\x03\x04\x00\x00\x01\xe1" + // 0x02270304: 0x000001E1 "\x00\xc6\x03\x04\x00\x00\x01\xe2" + // 0x00C60304: 0x000001E2 "\x00\xe6\x03\x04\x00\x00\x01\xe3" + // 0x00E60304: 0x000001E3 "\x00G\x03\f\x00\x00\x01\xe6" + // 0x0047030C: 0x000001E6 "\x00g\x03\f\x00\x00\x01\xe7" + // 0x0067030C: 0x000001E7 "\x00K\x03\f\x00\x00\x01\xe8" + // 0x004B030C: 0x000001E8 "\x00k\x03\f\x00\x00\x01\xe9" + // 0x006B030C: 0x000001E9 "\x00O\x03(\x00\x00\x01\xea" + // 0x004F0328: 0x000001EA "\x00o\x03(\x00\x00\x01\xeb" + // 0x006F0328: 0x000001EB "\x01\xea\x03\x04\x00\x00\x01\xec" + // 0x01EA0304: 0x000001EC "\x01\xeb\x03\x04\x00\x00\x01\xed" + // 0x01EB0304: 0x000001ED "\x01\xb7\x03\f\x00\x00\x01\xee" + // 0x01B7030C: 0x000001EE "\x02\x92\x03\f\x00\x00\x01\xef" + // 0x0292030C: 0x000001EF "\x00j\x03\f\x00\x00\x01\xf0" + // 0x006A030C: 0x000001F0 "\x00G\x03\x01\x00\x00\x01\xf4" + // 0x00470301: 0x000001F4 "\x00g\x03\x01\x00\x00\x01\xf5" + // 0x00670301: 0x000001F5 "\x00N\x03\x00\x00\x00\x01\xf8" + // 0x004E0300: 0x000001F8 "\x00n\x03\x00\x00\x00\x01\xf9" + // 0x006E0300: 0x000001F9 "\x00\xc5\x03\x01\x00\x00\x01\xfa" + // 0x00C50301: 0x000001FA "\x00\xe5\x03\x01\x00\x00\x01\xfb" + // 0x00E50301: 0x000001FB "\x00\xc6\x03\x01\x00\x00\x01\xfc" + // 0x00C60301: 0x000001FC "\x00\xe6\x03\x01\x00\x00\x01\xfd" + // 0x00E60301: 0x000001FD "\x00\xd8\x03\x01\x00\x00\x01\xfe" + // 0x00D80301: 0x000001FE "\x00\xf8\x03\x01\x00\x00\x01\xff" + // 0x00F80301: 0x000001FF "\x00A\x03\x0f\x00\x00\x02\x00" + // 0x0041030F: 0x00000200 "\x00a\x03\x0f\x00\x00\x02\x01" + // 0x0061030F: 0x00000201 "\x00A\x03\x11\x00\x00\x02\x02" + // 0x00410311: 0x00000202 "\x00a\x03\x11\x00\x00\x02\x03" + // 0x00610311: 0x00000203 "\x00E\x03\x0f\x00\x00\x02\x04" + // 0x0045030F: 0x00000204 "\x00e\x03\x0f\x00\x00\x02\x05" + // 0x0065030F: 0x00000205 "\x00E\x03\x11\x00\x00\x02\x06" + // 0x00450311: 0x00000206 "\x00e\x03\x11\x00\x00\x02\a" + // 0x00650311: 0x00000207 "\x00I\x03\x0f\x00\x00\x02\b" + // 0x0049030F: 0x00000208 "\x00i\x03\x0f\x00\x00\x02\t" + // 0x0069030F: 0x00000209 "\x00I\x03\x11\x00\x00\x02\n" + // 0x00490311: 0x0000020A "\x00i\x03\x11\x00\x00\x02\v" + // 0x00690311: 0x0000020B "\x00O\x03\x0f\x00\x00\x02\f" + // 0x004F030F: 0x0000020C "\x00o\x03\x0f\x00\x00\x02\r" + // 0x006F030F: 0x0000020D "\x00O\x03\x11\x00\x00\x02\x0e" + // 0x004F0311: 0x0000020E "\x00o\x03\x11\x00\x00\x02\x0f" + // 0x006F0311: 0x0000020F "\x00R\x03\x0f\x00\x00\x02\x10" + // 0x0052030F: 0x00000210 "\x00r\x03\x0f\x00\x00\x02\x11" + // 0x0072030F: 0x00000211 "\x00R\x03\x11\x00\x00\x02\x12" + // 0x00520311: 0x00000212 "\x00r\x03\x11\x00\x00\x02\x13" + // 0x00720311: 0x00000213 "\x00U\x03\x0f\x00\x00\x02\x14" + // 0x0055030F: 0x00000214 "\x00u\x03\x0f\x00\x00\x02\x15" + // 0x0075030F: 0x00000215 "\x00U\x03\x11\x00\x00\x02\x16" + // 0x00550311: 0x00000216 "\x00u\x03\x11\x00\x00\x02\x17" + // 0x00750311: 0x00000217 "\x00S\x03&\x00\x00\x02\x18" + // 0x00530326: 0x00000218 "\x00s\x03&\x00\x00\x02\x19" + // 0x00730326: 0x00000219 "\x00T\x03&\x00\x00\x02\x1a" + // 0x00540326: 0x0000021A "\x00t\x03&\x00\x00\x02\x1b" + // 0x00740326: 0x0000021B "\x00H\x03\f\x00\x00\x02\x1e" + // 0x0048030C: 0x0000021E "\x00h\x03\f\x00\x00\x02\x1f" + // 0x0068030C: 0x0000021F "\x00A\x03\a\x00\x00\x02&" + // 0x00410307: 0x00000226 "\x00a\x03\a\x00\x00\x02'" + // 0x00610307: 0x00000227 "\x00E\x03'\x00\x00\x02(" + // 0x00450327: 0x00000228 "\x00e\x03'\x00\x00\x02)" + // 0x00650327: 0x00000229 "\x00\xd6\x03\x04\x00\x00\x02*" + // 0x00D60304: 0x0000022A "\x00\xf6\x03\x04\x00\x00\x02+" + // 0x00F60304: 0x0000022B "\x00\xd5\x03\x04\x00\x00\x02," + // 0x00D50304: 0x0000022C "\x00\xf5\x03\x04\x00\x00\x02-" + // 0x00F50304: 0x0000022D "\x00O\x03\a\x00\x00\x02." + // 0x004F0307: 0x0000022E "\x00o\x03\a\x00\x00\x02/" + // 0x006F0307: 0x0000022F "\x02.\x03\x04\x00\x00\x020" + // 0x022E0304: 0x00000230 "\x02/\x03\x04\x00\x00\x021" + // 0x022F0304: 0x00000231 "\x00Y\x03\x04\x00\x00\x022" + // 0x00590304: 0x00000232 "\x00y\x03\x04\x00\x00\x023" + // 0x00790304: 0x00000233 "\x00\xa8\x03\x01\x00\x00\x03\x85" + // 0x00A80301: 0x00000385 "\x03\x91\x03\x01\x00\x00\x03\x86" + // 0x03910301: 0x00000386 "\x03\x95\x03\x01\x00\x00\x03\x88" + // 0x03950301: 0x00000388 "\x03\x97\x03\x01\x00\x00\x03\x89" + // 0x03970301: 0x00000389 "\x03\x99\x03\x01\x00\x00\x03\x8a" + // 0x03990301: 0x0000038A "\x03\x9f\x03\x01\x00\x00\x03\x8c" + // 0x039F0301: 0x0000038C "\x03\xa5\x03\x01\x00\x00\x03\x8e" + // 0x03A50301: 0x0000038E "\x03\xa9\x03\x01\x00\x00\x03\x8f" + // 0x03A90301: 0x0000038F "\x03\xca\x03\x01\x00\x00\x03\x90" + // 0x03CA0301: 0x00000390 "\x03\x99\x03\b\x00\x00\x03\xaa" + // 0x03990308: 0x000003AA "\x03\xa5\x03\b\x00\x00\x03\xab" + // 0x03A50308: 0x000003AB "\x03\xb1\x03\x01\x00\x00\x03\xac" + // 0x03B10301: 0x000003AC "\x03\xb5\x03\x01\x00\x00\x03\xad" + // 0x03B50301: 0x000003AD "\x03\xb7\x03\x01\x00\x00\x03\xae" + // 0x03B70301: 0x000003AE "\x03\xb9\x03\x01\x00\x00\x03\xaf" + // 0x03B90301: 0x000003AF "\x03\xcb\x03\x01\x00\x00\x03\xb0" + // 0x03CB0301: 0x000003B0 "\x03\xb9\x03\b\x00\x00\x03\xca" + // 0x03B90308: 0x000003CA "\x03\xc5\x03\b\x00\x00\x03\xcb" + // 0x03C50308: 0x000003CB "\x03\xbf\x03\x01\x00\x00\x03\xcc" + // 0x03BF0301: 0x000003CC "\x03\xc5\x03\x01\x00\x00\x03\xcd" + // 0x03C50301: 0x000003CD "\x03\xc9\x03\x01\x00\x00\x03\xce" + // 0x03C90301: 0x000003CE "\x03\xd2\x03\x01\x00\x00\x03\xd3" + // 0x03D20301: 0x000003D3 "\x03\xd2\x03\b\x00\x00\x03\xd4" + // 0x03D20308: 0x000003D4 "\x04\x15\x03\x00\x00\x00\x04\x00" + // 0x04150300: 0x00000400 "\x04\x15\x03\b\x00\x00\x04\x01" + // 0x04150308: 0x00000401 "\x04\x13\x03\x01\x00\x00\x04\x03" + // 0x04130301: 0x00000403 "\x04\x06\x03\b\x00\x00\x04\a" + // 0x04060308: 0x00000407 "\x04\x1a\x03\x01\x00\x00\x04\f" + // 0x041A0301: 0x0000040C "\x04\x18\x03\x00\x00\x00\x04\r" + // 0x04180300: 0x0000040D "\x04#\x03\x06\x00\x00\x04\x0e" + // 0x04230306: 0x0000040E "\x04\x18\x03\x06\x00\x00\x04\x19" + // 0x04180306: 0x00000419 "\x048\x03\x06\x00\x00\x049" + // 0x04380306: 0x00000439 "\x045\x03\x00\x00\x00\x04P" + // 0x04350300: 0x00000450 "\x045\x03\b\x00\x00\x04Q" + // 0x04350308: 0x00000451 "\x043\x03\x01\x00\x00\x04S" + // 0x04330301: 0x00000453 "\x04V\x03\b\x00\x00\x04W" + // 0x04560308: 0x00000457 "\x04:\x03\x01\x00\x00\x04\\" + // 0x043A0301: 0x0000045C "\x048\x03\x00\x00\x00\x04]" + // 0x04380300: 0x0000045D "\x04C\x03\x06\x00\x00\x04^" + // 0x04430306: 0x0000045E "\x04t\x03\x0f\x00\x00\x04v" + // 0x0474030F: 0x00000476 "\x04u\x03\x0f\x00\x00\x04w" + // 0x0475030F: 0x00000477 "\x04\x16\x03\x06\x00\x00\x04\xc1" + // 0x04160306: 0x000004C1 "\x046\x03\x06\x00\x00\x04\xc2" + // 0x04360306: 0x000004C2 "\x04\x10\x03\x06\x00\x00\x04\xd0" + // 0x04100306: 0x000004D0 "\x040\x03\x06\x00\x00\x04\xd1" + // 0x04300306: 0x000004D1 "\x04\x10\x03\b\x00\x00\x04\xd2" + // 0x04100308: 0x000004D2 "\x040\x03\b\x00\x00\x04\xd3" + // 0x04300308: 0x000004D3 "\x04\x15\x03\x06\x00\x00\x04\xd6" + // 0x04150306: 0x000004D6 "\x045\x03\x06\x00\x00\x04\xd7" + // 0x04350306: 0x000004D7 "\x04\xd8\x03\b\x00\x00\x04\xda" + // 0x04D80308: 0x000004DA "\x04\xd9\x03\b\x00\x00\x04\xdb" + // 0x04D90308: 0x000004DB "\x04\x16\x03\b\x00\x00\x04\xdc" + // 0x04160308: 0x000004DC "\x046\x03\b\x00\x00\x04\xdd" + // 0x04360308: 0x000004DD "\x04\x17\x03\b\x00\x00\x04\xde" + // 0x04170308: 0x000004DE "\x047\x03\b\x00\x00\x04\xdf" + // 0x04370308: 0x000004DF "\x04\x18\x03\x04\x00\x00\x04\xe2" + // 0x04180304: 0x000004E2 "\x048\x03\x04\x00\x00\x04\xe3" + // 0x04380304: 0x000004E3 "\x04\x18\x03\b\x00\x00\x04\xe4" + // 0x04180308: 0x000004E4 "\x048\x03\b\x00\x00\x04\xe5" + // 0x04380308: 0x000004E5 "\x04\x1e\x03\b\x00\x00\x04\xe6" + // 0x041E0308: 0x000004E6 "\x04>\x03\b\x00\x00\x04\xe7" + // 0x043E0308: 0x000004E7 "\x04\xe8\x03\b\x00\x00\x04\xea" + // 0x04E80308: 0x000004EA "\x04\xe9\x03\b\x00\x00\x04\xeb" + // 0x04E90308: 0x000004EB "\x04-\x03\b\x00\x00\x04\xec" + // 0x042D0308: 0x000004EC "\x04M\x03\b\x00\x00\x04\xed" + // 0x044D0308: 0x000004ED "\x04#\x03\x04\x00\x00\x04\xee" + // 0x04230304: 0x000004EE "\x04C\x03\x04\x00\x00\x04\xef" + // 0x04430304: 0x000004EF "\x04#\x03\b\x00\x00\x04\xf0" + // 0x04230308: 0x000004F0 "\x04C\x03\b\x00\x00\x04\xf1" + // 0x04430308: 0x000004F1 "\x04#\x03\v\x00\x00\x04\xf2" + // 0x0423030B: 0x000004F2 "\x04C\x03\v\x00\x00\x04\xf3" + // 0x0443030B: 0x000004F3 "\x04'\x03\b\x00\x00\x04\xf4" + // 0x04270308: 0x000004F4 "\x04G\x03\b\x00\x00\x04\xf5" + // 0x04470308: 0x000004F5 "\x04+\x03\b\x00\x00\x04\xf8" + // 0x042B0308: 0x000004F8 "\x04K\x03\b\x00\x00\x04\xf9" + // 0x044B0308: 0x000004F9 "\x06'\x06S\x00\x00\x06\"" + // 0x06270653: 0x00000622 "\x06'\x06T\x00\x00\x06#" + // 0x06270654: 0x00000623 "\x06H\x06T\x00\x00\x06$" + // 0x06480654: 0x00000624 "\x06'\x06U\x00\x00\x06%" + // 0x06270655: 0x00000625 "\x06J\x06T\x00\x00\x06&" + // 0x064A0654: 0x00000626 "\x06\xd5\x06T\x00\x00\x06\xc0" + // 0x06D50654: 0x000006C0 "\x06\xc1\x06T\x00\x00\x06\xc2" + // 0x06C10654: 0x000006C2 "\x06\xd2\x06T\x00\x00\x06\xd3" + // 0x06D20654: 0x000006D3 "\t(\t<\x00\x00\t)" + // 0x0928093C: 0x00000929 "\t0\t<\x00\x00\t1" + // 0x0930093C: 0x00000931 "\t3\t<\x00\x00\t4" + // 0x0933093C: 0x00000934 "\t\xc7\t\xbe\x00\x00\t\xcb" + // 0x09C709BE: 0x000009CB "\t\xc7\t\xd7\x00\x00\t\xcc" + // 0x09C709D7: 0x000009CC "\vG\vV\x00\x00\vH" + // 0x0B470B56: 0x00000B48 "\vG\v>\x00\x00\vK" + // 0x0B470B3E: 0x00000B4B "\vG\vW\x00\x00\vL" + // 0x0B470B57: 0x00000B4C "\v\x92\v\xd7\x00\x00\v\x94" + // 0x0B920BD7: 0x00000B94 "\v\xc6\v\xbe\x00\x00\v\xca" + // 0x0BC60BBE: 0x00000BCA "\v\xc7\v\xbe\x00\x00\v\xcb" + // 0x0BC70BBE: 0x00000BCB "\v\xc6\v\xd7\x00\x00\v\xcc" + // 0x0BC60BD7: 0x00000BCC "\fF\fV\x00\x00\fH" + // 0x0C460C56: 0x00000C48 "\f\xbf\f\xd5\x00\x00\f\xc0" + // 0x0CBF0CD5: 0x00000CC0 "\f\xc6\f\xd5\x00\x00\f\xc7" + // 0x0CC60CD5: 0x00000CC7 "\f\xc6\f\xd6\x00\x00\f\xc8" + // 0x0CC60CD6: 0x00000CC8 "\f\xc6\f\xc2\x00\x00\f\xca" + // 0x0CC60CC2: 0x00000CCA "\f\xca\f\xd5\x00\x00\f\xcb" + // 0x0CCA0CD5: 0x00000CCB "\rF\r>\x00\x00\rJ" + // 0x0D460D3E: 0x00000D4A "\rG\r>\x00\x00\rK" + // 0x0D470D3E: 0x00000D4B "\rF\rW\x00\x00\rL" + // 0x0D460D57: 0x00000D4C "\r\xd9\r\xca\x00\x00\r\xda" + // 0x0DD90DCA: 0x00000DDA "\r\xd9\r\xcf\x00\x00\r\xdc" + // 0x0DD90DCF: 0x00000DDC "\r\xdc\r\xca\x00\x00\r\xdd" + // 0x0DDC0DCA: 0x00000DDD "\r\xd9\r\xdf\x00\x00\r\xde" + // 0x0DD90DDF: 0x00000DDE "\x10%\x10.\x00\x00\x10&" + // 0x1025102E: 0x00001026 "\x1b\x05\x1b5\x00\x00\x1b\x06" + // 0x1B051B35: 0x00001B06 "\x1b\a\x1b5\x00\x00\x1b\b" + // 0x1B071B35: 0x00001B08 "\x1b\t\x1b5\x00\x00\x1b\n" + // 0x1B091B35: 0x00001B0A "\x1b\v\x1b5\x00\x00\x1b\f" + // 0x1B0B1B35: 0x00001B0C "\x1b\r\x1b5\x00\x00\x1b\x0e" + // 0x1B0D1B35: 0x00001B0E "\x1b\x11\x1b5\x00\x00\x1b\x12" + // 0x1B111B35: 0x00001B12 "\x1b:\x1b5\x00\x00\x1b;" + // 0x1B3A1B35: 0x00001B3B "\x1b<\x1b5\x00\x00\x1b=" + // 0x1B3C1B35: 0x00001B3D "\x1b>\x1b5\x00\x00\x1b@" + // 0x1B3E1B35: 0x00001B40 "\x1b?\x1b5\x00\x00\x1bA" + // 0x1B3F1B35: 0x00001B41 "\x1bB\x1b5\x00\x00\x1bC" + // 0x1B421B35: 0x00001B43 "\x00A\x03%\x00\x00\x1e\x00" + // 0x00410325: 0x00001E00 "\x00a\x03%\x00\x00\x1e\x01" + // 0x00610325: 0x00001E01 "\x00B\x03\a\x00\x00\x1e\x02" + // 0x00420307: 0x00001E02 "\x00b\x03\a\x00\x00\x1e\x03" + // 0x00620307: 0x00001E03 "\x00B\x03#\x00\x00\x1e\x04" + // 0x00420323: 0x00001E04 "\x00b\x03#\x00\x00\x1e\x05" + // 0x00620323: 0x00001E05 "\x00B\x031\x00\x00\x1e\x06" + // 0x00420331: 0x00001E06 "\x00b\x031\x00\x00\x1e\a" + // 0x00620331: 0x00001E07 "\x00\xc7\x03\x01\x00\x00\x1e\b" + // 0x00C70301: 0x00001E08 "\x00\xe7\x03\x01\x00\x00\x1e\t" + // 0x00E70301: 0x00001E09 "\x00D\x03\a\x00\x00\x1e\n" + // 0x00440307: 0x00001E0A "\x00d\x03\a\x00\x00\x1e\v" + // 0x00640307: 0x00001E0B "\x00D\x03#\x00\x00\x1e\f" + // 0x00440323: 0x00001E0C "\x00d\x03#\x00\x00\x1e\r" + // 0x00640323: 0x00001E0D "\x00D\x031\x00\x00\x1e\x0e" + // 0x00440331: 0x00001E0E "\x00d\x031\x00\x00\x1e\x0f" + // 0x00640331: 0x00001E0F "\x00D\x03'\x00\x00\x1e\x10" + // 0x00440327: 0x00001E10 "\x00d\x03'\x00\x00\x1e\x11" + // 0x00640327: 0x00001E11 "\x00D\x03-\x00\x00\x1e\x12" + // 0x0044032D: 0x00001E12 "\x00d\x03-\x00\x00\x1e\x13" + // 0x0064032D: 0x00001E13 "\x01\x12\x03\x00\x00\x00\x1e\x14" + // 0x01120300: 0x00001E14 "\x01\x13\x03\x00\x00\x00\x1e\x15" + // 0x01130300: 0x00001E15 "\x01\x12\x03\x01\x00\x00\x1e\x16" + // 0x01120301: 0x00001E16 "\x01\x13\x03\x01\x00\x00\x1e\x17" + // 0x01130301: 0x00001E17 "\x00E\x03-\x00\x00\x1e\x18" + // 0x0045032D: 0x00001E18 "\x00e\x03-\x00\x00\x1e\x19" + // 0x0065032D: 0x00001E19 "\x00E\x030\x00\x00\x1e\x1a" + // 0x00450330: 0x00001E1A "\x00e\x030\x00\x00\x1e\x1b" + // 0x00650330: 0x00001E1B "\x02(\x03\x06\x00\x00\x1e\x1c" + // 0x02280306: 0x00001E1C "\x02)\x03\x06\x00\x00\x1e\x1d" + // 0x02290306: 0x00001E1D "\x00F\x03\a\x00\x00\x1e\x1e" + // 0x00460307: 0x00001E1E "\x00f\x03\a\x00\x00\x1e\x1f" + // 0x00660307: 0x00001E1F "\x00G\x03\x04\x00\x00\x1e " + // 0x00470304: 0x00001E20 "\x00g\x03\x04\x00\x00\x1e!" + // 0x00670304: 0x00001E21 "\x00H\x03\a\x00\x00\x1e\"" + // 0x00480307: 0x00001E22 "\x00h\x03\a\x00\x00\x1e#" + // 0x00680307: 0x00001E23 "\x00H\x03#\x00\x00\x1e$" + // 0x00480323: 0x00001E24 "\x00h\x03#\x00\x00\x1e%" + // 0x00680323: 0x00001E25 "\x00H\x03\b\x00\x00\x1e&" + // 0x00480308: 0x00001E26 "\x00h\x03\b\x00\x00\x1e'" + // 0x00680308: 0x00001E27 "\x00H\x03'\x00\x00\x1e(" + // 0x00480327: 0x00001E28 "\x00h\x03'\x00\x00\x1e)" + // 0x00680327: 0x00001E29 "\x00H\x03.\x00\x00\x1e*" + // 0x0048032E: 0x00001E2A "\x00h\x03.\x00\x00\x1e+" + // 0x0068032E: 0x00001E2B "\x00I\x030\x00\x00\x1e," + // 0x00490330: 0x00001E2C "\x00i\x030\x00\x00\x1e-" + // 0x00690330: 0x00001E2D "\x00\xcf\x03\x01\x00\x00\x1e." + // 0x00CF0301: 0x00001E2E "\x00\xef\x03\x01\x00\x00\x1e/" + // 0x00EF0301: 0x00001E2F "\x00K\x03\x01\x00\x00\x1e0" + // 0x004B0301: 0x00001E30 "\x00k\x03\x01\x00\x00\x1e1" + // 0x006B0301: 0x00001E31 "\x00K\x03#\x00\x00\x1e2" + // 0x004B0323: 0x00001E32 "\x00k\x03#\x00\x00\x1e3" + // 0x006B0323: 0x00001E33 "\x00K\x031\x00\x00\x1e4" + // 0x004B0331: 0x00001E34 "\x00k\x031\x00\x00\x1e5" + // 0x006B0331: 0x00001E35 "\x00L\x03#\x00\x00\x1e6" + // 0x004C0323: 0x00001E36 "\x00l\x03#\x00\x00\x1e7" + // 0x006C0323: 0x00001E37 "\x1e6\x03\x04\x00\x00\x1e8" + // 0x1E360304: 0x00001E38 "\x1e7\x03\x04\x00\x00\x1e9" + // 0x1E370304: 0x00001E39 "\x00L\x031\x00\x00\x1e:" + // 0x004C0331: 0x00001E3A "\x00l\x031\x00\x00\x1e;" + // 0x006C0331: 0x00001E3B "\x00L\x03-\x00\x00\x1e<" + // 0x004C032D: 0x00001E3C "\x00l\x03-\x00\x00\x1e=" + // 0x006C032D: 0x00001E3D "\x00M\x03\x01\x00\x00\x1e>" + // 0x004D0301: 0x00001E3E "\x00m\x03\x01\x00\x00\x1e?" + // 0x006D0301: 0x00001E3F "\x00M\x03\a\x00\x00\x1e@" + // 0x004D0307: 0x00001E40 "\x00m\x03\a\x00\x00\x1eA" + // 0x006D0307: 0x00001E41 "\x00M\x03#\x00\x00\x1eB" + // 0x004D0323: 0x00001E42 "\x00m\x03#\x00\x00\x1eC" + // 0x006D0323: 0x00001E43 "\x00N\x03\a\x00\x00\x1eD" + // 0x004E0307: 0x00001E44 "\x00n\x03\a\x00\x00\x1eE" + // 0x006E0307: 0x00001E45 "\x00N\x03#\x00\x00\x1eF" + // 0x004E0323: 0x00001E46 "\x00n\x03#\x00\x00\x1eG" + // 0x006E0323: 0x00001E47 "\x00N\x031\x00\x00\x1eH" + // 0x004E0331: 0x00001E48 "\x00n\x031\x00\x00\x1eI" + // 0x006E0331: 0x00001E49 "\x00N\x03-\x00\x00\x1eJ" + // 0x004E032D: 0x00001E4A "\x00n\x03-\x00\x00\x1eK" + // 0x006E032D: 0x00001E4B "\x00\xd5\x03\x01\x00\x00\x1eL" + // 0x00D50301: 0x00001E4C "\x00\xf5\x03\x01\x00\x00\x1eM" + // 0x00F50301: 0x00001E4D "\x00\xd5\x03\b\x00\x00\x1eN" + // 0x00D50308: 0x00001E4E "\x00\xf5\x03\b\x00\x00\x1eO" + // 0x00F50308: 0x00001E4F "\x01L\x03\x00\x00\x00\x1eP" + // 0x014C0300: 0x00001E50 "\x01M\x03\x00\x00\x00\x1eQ" + // 0x014D0300: 0x00001E51 "\x01L\x03\x01\x00\x00\x1eR" + // 0x014C0301: 0x00001E52 "\x01M\x03\x01\x00\x00\x1eS" + // 0x014D0301: 0x00001E53 "\x00P\x03\x01\x00\x00\x1eT" + // 0x00500301: 0x00001E54 "\x00p\x03\x01\x00\x00\x1eU" + // 0x00700301: 0x00001E55 "\x00P\x03\a\x00\x00\x1eV" + // 0x00500307: 0x00001E56 "\x00p\x03\a\x00\x00\x1eW" + // 0x00700307: 0x00001E57 "\x00R\x03\a\x00\x00\x1eX" + // 0x00520307: 0x00001E58 "\x00r\x03\a\x00\x00\x1eY" + // 0x00720307: 0x00001E59 "\x00R\x03#\x00\x00\x1eZ" + // 0x00520323: 0x00001E5A "\x00r\x03#\x00\x00\x1e[" + // 0x00720323: 0x00001E5B "\x1eZ\x03\x04\x00\x00\x1e\\" + // 0x1E5A0304: 0x00001E5C "\x1e[\x03\x04\x00\x00\x1e]" + // 0x1E5B0304: 0x00001E5D "\x00R\x031\x00\x00\x1e^" + // 0x00520331: 0x00001E5E "\x00r\x031\x00\x00\x1e_" + // 0x00720331: 0x00001E5F "\x00S\x03\a\x00\x00\x1e`" + // 0x00530307: 0x00001E60 "\x00s\x03\a\x00\x00\x1ea" + // 0x00730307: 0x00001E61 "\x00S\x03#\x00\x00\x1eb" + // 0x00530323: 0x00001E62 "\x00s\x03#\x00\x00\x1ec" + // 0x00730323: 0x00001E63 "\x01Z\x03\a\x00\x00\x1ed" + // 0x015A0307: 0x00001E64 "\x01[\x03\a\x00\x00\x1ee" + // 0x015B0307: 0x00001E65 "\x01`\x03\a\x00\x00\x1ef" + // 0x01600307: 0x00001E66 "\x01a\x03\a\x00\x00\x1eg" + // 0x01610307: 0x00001E67 "\x1eb\x03\a\x00\x00\x1eh" + // 0x1E620307: 0x00001E68 "\x1ec\x03\a\x00\x00\x1ei" + // 0x1E630307: 0x00001E69 "\x00T\x03\a\x00\x00\x1ej" + // 0x00540307: 0x00001E6A "\x00t\x03\a\x00\x00\x1ek" + // 0x00740307: 0x00001E6B "\x00T\x03#\x00\x00\x1el" + // 0x00540323: 0x00001E6C "\x00t\x03#\x00\x00\x1em" + // 0x00740323: 0x00001E6D "\x00T\x031\x00\x00\x1en" + // 0x00540331: 0x00001E6E "\x00t\x031\x00\x00\x1eo" + // 0x00740331: 0x00001E6F "\x00T\x03-\x00\x00\x1ep" + // 0x0054032D: 0x00001E70 "\x00t\x03-\x00\x00\x1eq" + // 0x0074032D: 0x00001E71 "\x00U\x03$\x00\x00\x1er" + // 0x00550324: 0x00001E72 "\x00u\x03$\x00\x00\x1es" + // 0x00750324: 0x00001E73 "\x00U\x030\x00\x00\x1et" + // 0x00550330: 0x00001E74 "\x00u\x030\x00\x00\x1eu" + // 0x00750330: 0x00001E75 "\x00U\x03-\x00\x00\x1ev" + // 0x0055032D: 0x00001E76 "\x00u\x03-\x00\x00\x1ew" + // 0x0075032D: 0x00001E77 "\x01h\x03\x01\x00\x00\x1ex" + // 0x01680301: 0x00001E78 "\x01i\x03\x01\x00\x00\x1ey" + // 0x01690301: 0x00001E79 "\x01j\x03\b\x00\x00\x1ez" + // 0x016A0308: 0x00001E7A "\x01k\x03\b\x00\x00\x1e{" + // 0x016B0308: 0x00001E7B "\x00V\x03\x03\x00\x00\x1e|" + // 0x00560303: 0x00001E7C "\x00v\x03\x03\x00\x00\x1e}" + // 0x00760303: 0x00001E7D "\x00V\x03#\x00\x00\x1e~" + // 0x00560323: 0x00001E7E "\x00v\x03#\x00\x00\x1e\x7f" + // 0x00760323: 0x00001E7F "\x00W\x03\x00\x00\x00\x1e\x80" + // 0x00570300: 0x00001E80 "\x00w\x03\x00\x00\x00\x1e\x81" + // 0x00770300: 0x00001E81 "\x00W\x03\x01\x00\x00\x1e\x82" + // 0x00570301: 0x00001E82 "\x00w\x03\x01\x00\x00\x1e\x83" + // 0x00770301: 0x00001E83 "\x00W\x03\b\x00\x00\x1e\x84" + // 0x00570308: 0x00001E84 "\x00w\x03\b\x00\x00\x1e\x85" + // 0x00770308: 0x00001E85 "\x00W\x03\a\x00\x00\x1e\x86" + // 0x00570307: 0x00001E86 "\x00w\x03\a\x00\x00\x1e\x87" + // 0x00770307: 0x00001E87 "\x00W\x03#\x00\x00\x1e\x88" + // 0x00570323: 0x00001E88 "\x00w\x03#\x00\x00\x1e\x89" + // 0x00770323: 0x00001E89 "\x00X\x03\a\x00\x00\x1e\x8a" + // 0x00580307: 0x00001E8A "\x00x\x03\a\x00\x00\x1e\x8b" + // 0x00780307: 0x00001E8B "\x00X\x03\b\x00\x00\x1e\x8c" + // 0x00580308: 0x00001E8C "\x00x\x03\b\x00\x00\x1e\x8d" + // 0x00780308: 0x00001E8D "\x00Y\x03\a\x00\x00\x1e\x8e" + // 0x00590307: 0x00001E8E "\x00y\x03\a\x00\x00\x1e\x8f" + // 0x00790307: 0x00001E8F "\x00Z\x03\x02\x00\x00\x1e\x90" + // 0x005A0302: 0x00001E90 "\x00z\x03\x02\x00\x00\x1e\x91" + // 0x007A0302: 0x00001E91 "\x00Z\x03#\x00\x00\x1e\x92" + // 0x005A0323: 0x00001E92 "\x00z\x03#\x00\x00\x1e\x93" + // 0x007A0323: 0x00001E93 "\x00Z\x031\x00\x00\x1e\x94" + // 0x005A0331: 0x00001E94 "\x00z\x031\x00\x00\x1e\x95" + // 0x007A0331: 0x00001E95 "\x00h\x031\x00\x00\x1e\x96" + // 0x00680331: 0x00001E96 "\x00t\x03\b\x00\x00\x1e\x97" + // 0x00740308: 0x00001E97 "\x00w\x03\n\x00\x00\x1e\x98" + // 0x0077030A: 0x00001E98 "\x00y\x03\n\x00\x00\x1e\x99" + // 0x0079030A: 0x00001E99 "\x01\x7f\x03\a\x00\x00\x1e\x9b" + // 0x017F0307: 0x00001E9B "\x00A\x03#\x00\x00\x1e\xa0" + // 0x00410323: 0x00001EA0 "\x00a\x03#\x00\x00\x1e\xa1" + // 0x00610323: 0x00001EA1 "\x00A\x03\t\x00\x00\x1e\xa2" + // 0x00410309: 0x00001EA2 "\x00a\x03\t\x00\x00\x1e\xa3" + // 0x00610309: 0x00001EA3 "\x00\xc2\x03\x01\x00\x00\x1e\xa4" + // 0x00C20301: 0x00001EA4 "\x00\xe2\x03\x01\x00\x00\x1e\xa5" + // 0x00E20301: 0x00001EA5 "\x00\xc2\x03\x00\x00\x00\x1e\xa6" + // 0x00C20300: 0x00001EA6 "\x00\xe2\x03\x00\x00\x00\x1e\xa7" + // 0x00E20300: 0x00001EA7 "\x00\xc2\x03\t\x00\x00\x1e\xa8" + // 0x00C20309: 0x00001EA8 "\x00\xe2\x03\t\x00\x00\x1e\xa9" + // 0x00E20309: 0x00001EA9 "\x00\xc2\x03\x03\x00\x00\x1e\xaa" + // 0x00C20303: 0x00001EAA "\x00\xe2\x03\x03\x00\x00\x1e\xab" + // 0x00E20303: 0x00001EAB "\x1e\xa0\x03\x02\x00\x00\x1e\xac" + // 0x1EA00302: 0x00001EAC "\x1e\xa1\x03\x02\x00\x00\x1e\xad" + // 0x1EA10302: 0x00001EAD "\x01\x02\x03\x01\x00\x00\x1e\xae" + // 0x01020301: 0x00001EAE "\x01\x03\x03\x01\x00\x00\x1e\xaf" + // 0x01030301: 0x00001EAF "\x01\x02\x03\x00\x00\x00\x1e\xb0" + // 0x01020300: 0x00001EB0 "\x01\x03\x03\x00\x00\x00\x1e\xb1" + // 0x01030300: 0x00001EB1 "\x01\x02\x03\t\x00\x00\x1e\xb2" + // 0x01020309: 0x00001EB2 "\x01\x03\x03\t\x00\x00\x1e\xb3" + // 0x01030309: 0x00001EB3 "\x01\x02\x03\x03\x00\x00\x1e\xb4" + // 0x01020303: 0x00001EB4 "\x01\x03\x03\x03\x00\x00\x1e\xb5" + // 0x01030303: 0x00001EB5 "\x1e\xa0\x03\x06\x00\x00\x1e\xb6" + // 0x1EA00306: 0x00001EB6 "\x1e\xa1\x03\x06\x00\x00\x1e\xb7" + // 0x1EA10306: 0x00001EB7 "\x00E\x03#\x00\x00\x1e\xb8" + // 0x00450323: 0x00001EB8 "\x00e\x03#\x00\x00\x1e\xb9" + // 0x00650323: 0x00001EB9 "\x00E\x03\t\x00\x00\x1e\xba" + // 0x00450309: 0x00001EBA "\x00e\x03\t\x00\x00\x1e\xbb" + // 0x00650309: 0x00001EBB "\x00E\x03\x03\x00\x00\x1e\xbc" + // 0x00450303: 0x00001EBC "\x00e\x03\x03\x00\x00\x1e\xbd" + // 0x00650303: 0x00001EBD "\x00\xca\x03\x01\x00\x00\x1e\xbe" + // 0x00CA0301: 0x00001EBE "\x00\xea\x03\x01\x00\x00\x1e\xbf" + // 0x00EA0301: 0x00001EBF "\x00\xca\x03\x00\x00\x00\x1e\xc0" + // 0x00CA0300: 0x00001EC0 "\x00\xea\x03\x00\x00\x00\x1e\xc1" + // 0x00EA0300: 0x00001EC1 "\x00\xca\x03\t\x00\x00\x1e\xc2" + // 0x00CA0309: 0x00001EC2 "\x00\xea\x03\t\x00\x00\x1e\xc3" + // 0x00EA0309: 0x00001EC3 "\x00\xca\x03\x03\x00\x00\x1e\xc4" + // 0x00CA0303: 0x00001EC4 "\x00\xea\x03\x03\x00\x00\x1e\xc5" + // 0x00EA0303: 0x00001EC5 "\x1e\xb8\x03\x02\x00\x00\x1e\xc6" + // 0x1EB80302: 0x00001EC6 "\x1e\xb9\x03\x02\x00\x00\x1e\xc7" + // 0x1EB90302: 0x00001EC7 "\x00I\x03\t\x00\x00\x1e\xc8" + // 0x00490309: 0x00001EC8 "\x00i\x03\t\x00\x00\x1e\xc9" + // 0x00690309: 0x00001EC9 "\x00I\x03#\x00\x00\x1e\xca" + // 0x00490323: 0x00001ECA "\x00i\x03#\x00\x00\x1e\xcb" + // 0x00690323: 0x00001ECB "\x00O\x03#\x00\x00\x1e\xcc" + // 0x004F0323: 0x00001ECC "\x00o\x03#\x00\x00\x1e\xcd" + // 0x006F0323: 0x00001ECD "\x00O\x03\t\x00\x00\x1e\xce" + // 0x004F0309: 0x00001ECE "\x00o\x03\t\x00\x00\x1e\xcf" + // 0x006F0309: 0x00001ECF "\x00\xd4\x03\x01\x00\x00\x1e\xd0" + // 0x00D40301: 0x00001ED0 "\x00\xf4\x03\x01\x00\x00\x1e\xd1" + // 0x00F40301: 0x00001ED1 "\x00\xd4\x03\x00\x00\x00\x1e\xd2" + // 0x00D40300: 0x00001ED2 "\x00\xf4\x03\x00\x00\x00\x1e\xd3" + // 0x00F40300: 0x00001ED3 "\x00\xd4\x03\t\x00\x00\x1e\xd4" + // 0x00D40309: 0x00001ED4 "\x00\xf4\x03\t\x00\x00\x1e\xd5" + // 0x00F40309: 0x00001ED5 "\x00\xd4\x03\x03\x00\x00\x1e\xd6" + // 0x00D40303: 0x00001ED6 "\x00\xf4\x03\x03\x00\x00\x1e\xd7" + // 0x00F40303: 0x00001ED7 "\x1e\xcc\x03\x02\x00\x00\x1e\xd8" + // 0x1ECC0302: 0x00001ED8 "\x1e\xcd\x03\x02\x00\x00\x1e\xd9" + // 0x1ECD0302: 0x00001ED9 "\x01\xa0\x03\x01\x00\x00\x1e\xda" + // 0x01A00301: 0x00001EDA "\x01\xa1\x03\x01\x00\x00\x1e\xdb" + // 0x01A10301: 0x00001EDB "\x01\xa0\x03\x00\x00\x00\x1e\xdc" + // 0x01A00300: 0x00001EDC "\x01\xa1\x03\x00\x00\x00\x1e\xdd" + // 0x01A10300: 0x00001EDD "\x01\xa0\x03\t\x00\x00\x1e\xde" + // 0x01A00309: 0x00001EDE "\x01\xa1\x03\t\x00\x00\x1e\xdf" + // 0x01A10309: 0x00001EDF "\x01\xa0\x03\x03\x00\x00\x1e\xe0" + // 0x01A00303: 0x00001EE0 "\x01\xa1\x03\x03\x00\x00\x1e\xe1" + // 0x01A10303: 0x00001EE1 "\x01\xa0\x03#\x00\x00\x1e\xe2" + // 0x01A00323: 0x00001EE2 "\x01\xa1\x03#\x00\x00\x1e\xe3" + // 0x01A10323: 0x00001EE3 "\x00U\x03#\x00\x00\x1e\xe4" + // 0x00550323: 0x00001EE4 "\x00u\x03#\x00\x00\x1e\xe5" + // 0x00750323: 0x00001EE5 "\x00U\x03\t\x00\x00\x1e\xe6" + // 0x00550309: 0x00001EE6 "\x00u\x03\t\x00\x00\x1e\xe7" + // 0x00750309: 0x00001EE7 "\x01\xaf\x03\x01\x00\x00\x1e\xe8" + // 0x01AF0301: 0x00001EE8 "\x01\xb0\x03\x01\x00\x00\x1e\xe9" + // 0x01B00301: 0x00001EE9 "\x01\xaf\x03\x00\x00\x00\x1e\xea" + // 0x01AF0300: 0x00001EEA "\x01\xb0\x03\x00\x00\x00\x1e\xeb" + // 0x01B00300: 0x00001EEB "\x01\xaf\x03\t\x00\x00\x1e\xec" + // 0x01AF0309: 0x00001EEC "\x01\xb0\x03\t\x00\x00\x1e\xed" + // 0x01B00309: 0x00001EED "\x01\xaf\x03\x03\x00\x00\x1e\xee" + // 0x01AF0303: 0x00001EEE "\x01\xb0\x03\x03\x00\x00\x1e\xef" + // 0x01B00303: 0x00001EEF "\x01\xaf\x03#\x00\x00\x1e\xf0" + // 0x01AF0323: 0x00001EF0 "\x01\xb0\x03#\x00\x00\x1e\xf1" + // 0x01B00323: 0x00001EF1 "\x00Y\x03\x00\x00\x00\x1e\xf2" + // 0x00590300: 0x00001EF2 "\x00y\x03\x00\x00\x00\x1e\xf3" + // 0x00790300: 0x00001EF3 "\x00Y\x03#\x00\x00\x1e\xf4" + // 0x00590323: 0x00001EF4 "\x00y\x03#\x00\x00\x1e\xf5" + // 0x00790323: 0x00001EF5 "\x00Y\x03\t\x00\x00\x1e\xf6" + // 0x00590309: 0x00001EF6 "\x00y\x03\t\x00\x00\x1e\xf7" + // 0x00790309: 0x00001EF7 "\x00Y\x03\x03\x00\x00\x1e\xf8" + // 0x00590303: 0x00001EF8 "\x00y\x03\x03\x00\x00\x1e\xf9" + // 0x00790303: 0x00001EF9 "\x03\xb1\x03\x13\x00\x00\x1f\x00" + // 0x03B10313: 0x00001F00 "\x03\xb1\x03\x14\x00\x00\x1f\x01" + // 0x03B10314: 0x00001F01 "\x1f\x00\x03\x00\x00\x00\x1f\x02" + // 0x1F000300: 0x00001F02 "\x1f\x01\x03\x00\x00\x00\x1f\x03" + // 0x1F010300: 0x00001F03 "\x1f\x00\x03\x01\x00\x00\x1f\x04" + // 0x1F000301: 0x00001F04 "\x1f\x01\x03\x01\x00\x00\x1f\x05" + // 0x1F010301: 0x00001F05 "\x1f\x00\x03B\x00\x00\x1f\x06" + // 0x1F000342: 0x00001F06 "\x1f\x01\x03B\x00\x00\x1f\a" + // 0x1F010342: 0x00001F07 "\x03\x91\x03\x13\x00\x00\x1f\b" + // 0x03910313: 0x00001F08 "\x03\x91\x03\x14\x00\x00\x1f\t" + // 0x03910314: 0x00001F09 "\x1f\b\x03\x00\x00\x00\x1f\n" + // 0x1F080300: 0x00001F0A "\x1f\t\x03\x00\x00\x00\x1f\v" + // 0x1F090300: 0x00001F0B "\x1f\b\x03\x01\x00\x00\x1f\f" + // 0x1F080301: 0x00001F0C "\x1f\t\x03\x01\x00\x00\x1f\r" + // 0x1F090301: 0x00001F0D "\x1f\b\x03B\x00\x00\x1f\x0e" + // 0x1F080342: 0x00001F0E "\x1f\t\x03B\x00\x00\x1f\x0f" + // 0x1F090342: 0x00001F0F "\x03\xb5\x03\x13\x00\x00\x1f\x10" + // 0x03B50313: 0x00001F10 "\x03\xb5\x03\x14\x00\x00\x1f\x11" + // 0x03B50314: 0x00001F11 "\x1f\x10\x03\x00\x00\x00\x1f\x12" + // 0x1F100300: 0x00001F12 "\x1f\x11\x03\x00\x00\x00\x1f\x13" + // 0x1F110300: 0x00001F13 "\x1f\x10\x03\x01\x00\x00\x1f\x14" + // 0x1F100301: 0x00001F14 "\x1f\x11\x03\x01\x00\x00\x1f\x15" + // 0x1F110301: 0x00001F15 "\x03\x95\x03\x13\x00\x00\x1f\x18" + // 0x03950313: 0x00001F18 "\x03\x95\x03\x14\x00\x00\x1f\x19" + // 0x03950314: 0x00001F19 "\x1f\x18\x03\x00\x00\x00\x1f\x1a" + // 0x1F180300: 0x00001F1A "\x1f\x19\x03\x00\x00\x00\x1f\x1b" + // 0x1F190300: 0x00001F1B "\x1f\x18\x03\x01\x00\x00\x1f\x1c" + // 0x1F180301: 0x00001F1C "\x1f\x19\x03\x01\x00\x00\x1f\x1d" + // 0x1F190301: 0x00001F1D "\x03\xb7\x03\x13\x00\x00\x1f " + // 0x03B70313: 0x00001F20 "\x03\xb7\x03\x14\x00\x00\x1f!" + // 0x03B70314: 0x00001F21 "\x1f \x03\x00\x00\x00\x1f\"" + // 0x1F200300: 0x00001F22 "\x1f!\x03\x00\x00\x00\x1f#" + // 0x1F210300: 0x00001F23 "\x1f \x03\x01\x00\x00\x1f$" + // 0x1F200301: 0x00001F24 "\x1f!\x03\x01\x00\x00\x1f%" + // 0x1F210301: 0x00001F25 "\x1f \x03B\x00\x00\x1f&" + // 0x1F200342: 0x00001F26 "\x1f!\x03B\x00\x00\x1f'" + // 0x1F210342: 0x00001F27 "\x03\x97\x03\x13\x00\x00\x1f(" + // 0x03970313: 0x00001F28 "\x03\x97\x03\x14\x00\x00\x1f)" + // 0x03970314: 0x00001F29 "\x1f(\x03\x00\x00\x00\x1f*" + // 0x1F280300: 0x00001F2A "\x1f)\x03\x00\x00\x00\x1f+" + // 0x1F290300: 0x00001F2B "\x1f(\x03\x01\x00\x00\x1f," + // 0x1F280301: 0x00001F2C "\x1f)\x03\x01\x00\x00\x1f-" + // 0x1F290301: 0x00001F2D "\x1f(\x03B\x00\x00\x1f." + // 0x1F280342: 0x00001F2E "\x1f)\x03B\x00\x00\x1f/" + // 0x1F290342: 0x00001F2F "\x03\xb9\x03\x13\x00\x00\x1f0" + // 0x03B90313: 0x00001F30 "\x03\xb9\x03\x14\x00\x00\x1f1" + // 0x03B90314: 0x00001F31 "\x1f0\x03\x00\x00\x00\x1f2" + // 0x1F300300: 0x00001F32 "\x1f1\x03\x00\x00\x00\x1f3" + // 0x1F310300: 0x00001F33 "\x1f0\x03\x01\x00\x00\x1f4" + // 0x1F300301: 0x00001F34 "\x1f1\x03\x01\x00\x00\x1f5" + // 0x1F310301: 0x00001F35 "\x1f0\x03B\x00\x00\x1f6" + // 0x1F300342: 0x00001F36 "\x1f1\x03B\x00\x00\x1f7" + // 0x1F310342: 0x00001F37 "\x03\x99\x03\x13\x00\x00\x1f8" + // 0x03990313: 0x00001F38 "\x03\x99\x03\x14\x00\x00\x1f9" + // 0x03990314: 0x00001F39 "\x1f8\x03\x00\x00\x00\x1f:" + // 0x1F380300: 0x00001F3A "\x1f9\x03\x00\x00\x00\x1f;" + // 0x1F390300: 0x00001F3B "\x1f8\x03\x01\x00\x00\x1f<" + // 0x1F380301: 0x00001F3C "\x1f9\x03\x01\x00\x00\x1f=" + // 0x1F390301: 0x00001F3D "\x1f8\x03B\x00\x00\x1f>" + // 0x1F380342: 0x00001F3E "\x1f9\x03B\x00\x00\x1f?" + // 0x1F390342: 0x00001F3F "\x03\xbf\x03\x13\x00\x00\x1f@" + // 0x03BF0313: 0x00001F40 "\x03\xbf\x03\x14\x00\x00\x1fA" + // 0x03BF0314: 0x00001F41 "\x1f@\x03\x00\x00\x00\x1fB" + // 0x1F400300: 0x00001F42 "\x1fA\x03\x00\x00\x00\x1fC" + // 0x1F410300: 0x00001F43 "\x1f@\x03\x01\x00\x00\x1fD" + // 0x1F400301: 0x00001F44 "\x1fA\x03\x01\x00\x00\x1fE" + // 0x1F410301: 0x00001F45 "\x03\x9f\x03\x13\x00\x00\x1fH" + // 0x039F0313: 0x00001F48 "\x03\x9f\x03\x14\x00\x00\x1fI" + // 0x039F0314: 0x00001F49 "\x1fH\x03\x00\x00\x00\x1fJ" + // 0x1F480300: 0x00001F4A "\x1fI\x03\x00\x00\x00\x1fK" + // 0x1F490300: 0x00001F4B "\x1fH\x03\x01\x00\x00\x1fL" + // 0x1F480301: 0x00001F4C "\x1fI\x03\x01\x00\x00\x1fM" + // 0x1F490301: 0x00001F4D "\x03\xc5\x03\x13\x00\x00\x1fP" + // 0x03C50313: 0x00001F50 "\x03\xc5\x03\x14\x00\x00\x1fQ" + // 0x03C50314: 0x00001F51 "\x1fP\x03\x00\x00\x00\x1fR" + // 0x1F500300: 0x00001F52 "\x1fQ\x03\x00\x00\x00\x1fS" + // 0x1F510300: 0x00001F53 "\x1fP\x03\x01\x00\x00\x1fT" + // 0x1F500301: 0x00001F54 "\x1fQ\x03\x01\x00\x00\x1fU" + // 0x1F510301: 0x00001F55 "\x1fP\x03B\x00\x00\x1fV" + // 0x1F500342: 0x00001F56 "\x1fQ\x03B\x00\x00\x1fW" + // 0x1F510342: 0x00001F57 "\x03\xa5\x03\x14\x00\x00\x1fY" + // 0x03A50314: 0x00001F59 "\x1fY\x03\x00\x00\x00\x1f[" + // 0x1F590300: 0x00001F5B "\x1fY\x03\x01\x00\x00\x1f]" + // 0x1F590301: 0x00001F5D "\x1fY\x03B\x00\x00\x1f_" + // 0x1F590342: 0x00001F5F "\x03\xc9\x03\x13\x00\x00\x1f`" + // 0x03C90313: 0x00001F60 "\x03\xc9\x03\x14\x00\x00\x1fa" + // 0x03C90314: 0x00001F61 "\x1f`\x03\x00\x00\x00\x1fb" + // 0x1F600300: 0x00001F62 "\x1fa\x03\x00\x00\x00\x1fc" + // 0x1F610300: 0x00001F63 "\x1f`\x03\x01\x00\x00\x1fd" + // 0x1F600301: 0x00001F64 "\x1fa\x03\x01\x00\x00\x1fe" + // 0x1F610301: 0x00001F65 "\x1f`\x03B\x00\x00\x1ff" + // 0x1F600342: 0x00001F66 "\x1fa\x03B\x00\x00\x1fg" + // 0x1F610342: 0x00001F67 "\x03\xa9\x03\x13\x00\x00\x1fh" + // 0x03A90313: 0x00001F68 "\x03\xa9\x03\x14\x00\x00\x1fi" + // 0x03A90314: 0x00001F69 "\x1fh\x03\x00\x00\x00\x1fj" + // 0x1F680300: 0x00001F6A "\x1fi\x03\x00\x00\x00\x1fk" + // 0x1F690300: 0x00001F6B "\x1fh\x03\x01\x00\x00\x1fl" + // 0x1F680301: 0x00001F6C "\x1fi\x03\x01\x00\x00\x1fm" + // 0x1F690301: 0x00001F6D "\x1fh\x03B\x00\x00\x1fn" + // 0x1F680342: 0x00001F6E "\x1fi\x03B\x00\x00\x1fo" + // 0x1F690342: 0x00001F6F "\x03\xb1\x03\x00\x00\x00\x1fp" + // 0x03B10300: 0x00001F70 "\x03\xb5\x03\x00\x00\x00\x1fr" + // 0x03B50300: 0x00001F72 "\x03\xb7\x03\x00\x00\x00\x1ft" + // 0x03B70300: 0x00001F74 "\x03\xb9\x03\x00\x00\x00\x1fv" + // 0x03B90300: 0x00001F76 "\x03\xbf\x03\x00\x00\x00\x1fx" + // 0x03BF0300: 0x00001F78 "\x03\xc5\x03\x00\x00\x00\x1fz" + // 0x03C50300: 0x00001F7A "\x03\xc9\x03\x00\x00\x00\x1f|" + // 0x03C90300: 0x00001F7C "\x1f\x00\x03E\x00\x00\x1f\x80" + // 0x1F000345: 0x00001F80 "\x1f\x01\x03E\x00\x00\x1f\x81" + // 0x1F010345: 0x00001F81 "\x1f\x02\x03E\x00\x00\x1f\x82" + // 0x1F020345: 0x00001F82 "\x1f\x03\x03E\x00\x00\x1f\x83" + // 0x1F030345: 0x00001F83 "\x1f\x04\x03E\x00\x00\x1f\x84" + // 0x1F040345: 0x00001F84 "\x1f\x05\x03E\x00\x00\x1f\x85" + // 0x1F050345: 0x00001F85 "\x1f\x06\x03E\x00\x00\x1f\x86" + // 0x1F060345: 0x00001F86 "\x1f\a\x03E\x00\x00\x1f\x87" + // 0x1F070345: 0x00001F87 "\x1f\b\x03E\x00\x00\x1f\x88" + // 0x1F080345: 0x00001F88 "\x1f\t\x03E\x00\x00\x1f\x89" + // 0x1F090345: 0x00001F89 "\x1f\n\x03E\x00\x00\x1f\x8a" + // 0x1F0A0345: 0x00001F8A "\x1f\v\x03E\x00\x00\x1f\x8b" + // 0x1F0B0345: 0x00001F8B "\x1f\f\x03E\x00\x00\x1f\x8c" + // 0x1F0C0345: 0x00001F8C "\x1f\r\x03E\x00\x00\x1f\x8d" + // 0x1F0D0345: 0x00001F8D "\x1f\x0e\x03E\x00\x00\x1f\x8e" + // 0x1F0E0345: 0x00001F8E "\x1f\x0f\x03E\x00\x00\x1f\x8f" + // 0x1F0F0345: 0x00001F8F "\x1f \x03E\x00\x00\x1f\x90" + // 0x1F200345: 0x00001F90 "\x1f!\x03E\x00\x00\x1f\x91" + // 0x1F210345: 0x00001F91 "\x1f\"\x03E\x00\x00\x1f\x92" + // 0x1F220345: 0x00001F92 "\x1f#\x03E\x00\x00\x1f\x93" + // 0x1F230345: 0x00001F93 "\x1f$\x03E\x00\x00\x1f\x94" + // 0x1F240345: 0x00001F94 "\x1f%\x03E\x00\x00\x1f\x95" + // 0x1F250345: 0x00001F95 "\x1f&\x03E\x00\x00\x1f\x96" + // 0x1F260345: 0x00001F96 "\x1f'\x03E\x00\x00\x1f\x97" + // 0x1F270345: 0x00001F97 "\x1f(\x03E\x00\x00\x1f\x98" + // 0x1F280345: 0x00001F98 "\x1f)\x03E\x00\x00\x1f\x99" + // 0x1F290345: 0x00001F99 "\x1f*\x03E\x00\x00\x1f\x9a" + // 0x1F2A0345: 0x00001F9A "\x1f+\x03E\x00\x00\x1f\x9b" + // 0x1F2B0345: 0x00001F9B "\x1f,\x03E\x00\x00\x1f\x9c" + // 0x1F2C0345: 0x00001F9C "\x1f-\x03E\x00\x00\x1f\x9d" + // 0x1F2D0345: 0x00001F9D "\x1f.\x03E\x00\x00\x1f\x9e" + // 0x1F2E0345: 0x00001F9E "\x1f/\x03E\x00\x00\x1f\x9f" + // 0x1F2F0345: 0x00001F9F "\x1f`\x03E\x00\x00\x1f\xa0" + // 0x1F600345: 0x00001FA0 "\x1fa\x03E\x00\x00\x1f\xa1" + // 0x1F610345: 0x00001FA1 "\x1fb\x03E\x00\x00\x1f\xa2" + // 0x1F620345: 0x00001FA2 "\x1fc\x03E\x00\x00\x1f\xa3" + // 0x1F630345: 0x00001FA3 "\x1fd\x03E\x00\x00\x1f\xa4" + // 0x1F640345: 0x00001FA4 "\x1fe\x03E\x00\x00\x1f\xa5" + // 0x1F650345: 0x00001FA5 "\x1ff\x03E\x00\x00\x1f\xa6" + // 0x1F660345: 0x00001FA6 "\x1fg\x03E\x00\x00\x1f\xa7" + // 0x1F670345: 0x00001FA7 "\x1fh\x03E\x00\x00\x1f\xa8" + // 0x1F680345: 0x00001FA8 "\x1fi\x03E\x00\x00\x1f\xa9" + // 0x1F690345: 0x00001FA9 "\x1fj\x03E\x00\x00\x1f\xaa" + // 0x1F6A0345: 0x00001FAA "\x1fk\x03E\x00\x00\x1f\xab" + // 0x1F6B0345: 0x00001FAB "\x1fl\x03E\x00\x00\x1f\xac" + // 0x1F6C0345: 0x00001FAC "\x1fm\x03E\x00\x00\x1f\xad" + // 0x1F6D0345: 0x00001FAD "\x1fn\x03E\x00\x00\x1f\xae" + // 0x1F6E0345: 0x00001FAE "\x1fo\x03E\x00\x00\x1f\xaf" + // 0x1F6F0345: 0x00001FAF "\x03\xb1\x03\x06\x00\x00\x1f\xb0" + // 0x03B10306: 0x00001FB0 "\x03\xb1\x03\x04\x00\x00\x1f\xb1" + // 0x03B10304: 0x00001FB1 "\x1fp\x03E\x00\x00\x1f\xb2" + // 0x1F700345: 0x00001FB2 "\x03\xb1\x03E\x00\x00\x1f\xb3" + // 0x03B10345: 0x00001FB3 "\x03\xac\x03E\x00\x00\x1f\xb4" + // 0x03AC0345: 0x00001FB4 "\x03\xb1\x03B\x00\x00\x1f\xb6" + // 0x03B10342: 0x00001FB6 "\x1f\xb6\x03E\x00\x00\x1f\xb7" + // 0x1FB60345: 0x00001FB7 "\x03\x91\x03\x06\x00\x00\x1f\xb8" + // 0x03910306: 0x00001FB8 "\x03\x91\x03\x04\x00\x00\x1f\xb9" + // 0x03910304: 0x00001FB9 "\x03\x91\x03\x00\x00\x00\x1f\xba" + // 0x03910300: 0x00001FBA "\x03\x91\x03E\x00\x00\x1f\xbc" + // 0x03910345: 0x00001FBC "\x00\xa8\x03B\x00\x00\x1f\xc1" + // 0x00A80342: 0x00001FC1 "\x1ft\x03E\x00\x00\x1f\xc2" + // 0x1F740345: 0x00001FC2 "\x03\xb7\x03E\x00\x00\x1f\xc3" + // 0x03B70345: 0x00001FC3 "\x03\xae\x03E\x00\x00\x1f\xc4" + // 0x03AE0345: 0x00001FC4 "\x03\xb7\x03B\x00\x00\x1f\xc6" + // 0x03B70342: 0x00001FC6 "\x1f\xc6\x03E\x00\x00\x1f\xc7" + // 0x1FC60345: 0x00001FC7 "\x03\x95\x03\x00\x00\x00\x1f\xc8" + // 0x03950300: 0x00001FC8 "\x03\x97\x03\x00\x00\x00\x1f\xca" + // 0x03970300: 0x00001FCA "\x03\x97\x03E\x00\x00\x1f\xcc" + // 0x03970345: 0x00001FCC "\x1f\xbf\x03\x00\x00\x00\x1f\xcd" + // 0x1FBF0300: 0x00001FCD "\x1f\xbf\x03\x01\x00\x00\x1f\xce" + // 0x1FBF0301: 0x00001FCE "\x1f\xbf\x03B\x00\x00\x1f\xcf" + // 0x1FBF0342: 0x00001FCF "\x03\xb9\x03\x06\x00\x00\x1f\xd0" + // 0x03B90306: 0x00001FD0 "\x03\xb9\x03\x04\x00\x00\x1f\xd1" + // 0x03B90304: 0x00001FD1 "\x03\xca\x03\x00\x00\x00\x1f\xd2" + // 0x03CA0300: 0x00001FD2 "\x03\xb9\x03B\x00\x00\x1f\xd6" + // 0x03B90342: 0x00001FD6 "\x03\xca\x03B\x00\x00\x1f\xd7" + // 0x03CA0342: 0x00001FD7 "\x03\x99\x03\x06\x00\x00\x1f\xd8" + // 0x03990306: 0x00001FD8 "\x03\x99\x03\x04\x00\x00\x1f\xd9" + // 0x03990304: 0x00001FD9 "\x03\x99\x03\x00\x00\x00\x1f\xda" + // 0x03990300: 0x00001FDA "\x1f\xfe\x03\x00\x00\x00\x1f\xdd" + // 0x1FFE0300: 0x00001FDD "\x1f\xfe\x03\x01\x00\x00\x1f\xde" + // 0x1FFE0301: 0x00001FDE "\x1f\xfe\x03B\x00\x00\x1f\xdf" + // 0x1FFE0342: 0x00001FDF "\x03\xc5\x03\x06\x00\x00\x1f\xe0" + // 0x03C50306: 0x00001FE0 "\x03\xc5\x03\x04\x00\x00\x1f\xe1" + // 0x03C50304: 0x00001FE1 "\x03\xcb\x03\x00\x00\x00\x1f\xe2" + // 0x03CB0300: 0x00001FE2 "\x03\xc1\x03\x13\x00\x00\x1f\xe4" + // 0x03C10313: 0x00001FE4 "\x03\xc1\x03\x14\x00\x00\x1f\xe5" + // 0x03C10314: 0x00001FE5 "\x03\xc5\x03B\x00\x00\x1f\xe6" + // 0x03C50342: 0x00001FE6 "\x03\xcb\x03B\x00\x00\x1f\xe7" + // 0x03CB0342: 0x00001FE7 "\x03\xa5\x03\x06\x00\x00\x1f\xe8" + // 0x03A50306: 0x00001FE8 "\x03\xa5\x03\x04\x00\x00\x1f\xe9" + // 0x03A50304: 0x00001FE9 "\x03\xa5\x03\x00\x00\x00\x1f\xea" + // 0x03A50300: 0x00001FEA "\x03\xa1\x03\x14\x00\x00\x1f\xec" + // 0x03A10314: 0x00001FEC "\x00\xa8\x03\x00\x00\x00\x1f\xed" + // 0x00A80300: 0x00001FED "\x1f|\x03E\x00\x00\x1f\xf2" + // 0x1F7C0345: 0x00001FF2 "\x03\xc9\x03E\x00\x00\x1f\xf3" + // 0x03C90345: 0x00001FF3 "\x03\xce\x03E\x00\x00\x1f\xf4" + // 0x03CE0345: 0x00001FF4 "\x03\xc9\x03B\x00\x00\x1f\xf6" + // 0x03C90342: 0x00001FF6 "\x1f\xf6\x03E\x00\x00\x1f\xf7" + // 0x1FF60345: 0x00001FF7 "\x03\x9f\x03\x00\x00\x00\x1f\xf8" + // 0x039F0300: 0x00001FF8 "\x03\xa9\x03\x00\x00\x00\x1f\xfa" + // 0x03A90300: 0x00001FFA "\x03\xa9\x03E\x00\x00\x1f\xfc" + // 0x03A90345: 0x00001FFC "!\x90\x038\x00\x00!\x9a" + // 0x21900338: 0x0000219A "!\x92\x038\x00\x00!\x9b" + // 0x21920338: 0x0000219B "!\x94\x038\x00\x00!\xae" + // 0x21940338: 0x000021AE "!\xd0\x038\x00\x00!\xcd" + // 0x21D00338: 0x000021CD "!\xd4\x038\x00\x00!\xce" + // 0x21D40338: 0x000021CE "!\xd2\x038\x00\x00!\xcf" + // 0x21D20338: 0x000021CF "\"\x03\x038\x00\x00\"\x04" + // 0x22030338: 0x00002204 "\"\b\x038\x00\x00\"\t" + // 0x22080338: 0x00002209 "\"\v\x038\x00\x00\"\f" + // 0x220B0338: 0x0000220C "\"#\x038\x00\x00\"$" + // 0x22230338: 0x00002224 "\"%\x038\x00\x00\"&" + // 0x22250338: 0x00002226 "\"<\x038\x00\x00\"A" + // 0x223C0338: 0x00002241 "\"C\x038\x00\x00\"D" + // 0x22430338: 0x00002244 "\"E\x038\x00\x00\"G" + // 0x22450338: 0x00002247 "\"H\x038\x00\x00\"I" + // 0x22480338: 0x00002249 "\x00=\x038\x00\x00\"`" + // 0x003D0338: 0x00002260 "\"a\x038\x00\x00\"b" + // 0x22610338: 0x00002262 "\"M\x038\x00\x00\"m" + // 0x224D0338: 0x0000226D "\x00<\x038\x00\x00\"n" + // 0x003C0338: 0x0000226E "\x00>\x038\x00\x00\"o" + // 0x003E0338: 0x0000226F "\"d\x038\x00\x00\"p" + // 0x22640338: 0x00002270 "\"e\x038\x00\x00\"q" + // 0x22650338: 0x00002271 "\"r\x038\x00\x00\"t" + // 0x22720338: 0x00002274 "\"s\x038\x00\x00\"u" + // 0x22730338: 0x00002275 "\"v\x038\x00\x00\"x" + // 0x22760338: 0x00002278 "\"w\x038\x00\x00\"y" + // 0x22770338: 0x00002279 "\"z\x038\x00\x00\"\x80" + // 0x227A0338: 0x00002280 "\"{\x038\x00\x00\"\x81" + // 0x227B0338: 0x00002281 "\"\x82\x038\x00\x00\"\x84" + // 0x22820338: 0x00002284 "\"\x83\x038\x00\x00\"\x85" + // 0x22830338: 0x00002285 "\"\x86\x038\x00\x00\"\x88" + // 0x22860338: 0x00002288 "\"\x87\x038\x00\x00\"\x89" + // 0x22870338: 0x00002289 "\"\xa2\x038\x00\x00\"\xac" + // 0x22A20338: 0x000022AC "\"\xa8\x038\x00\x00\"\xad" + // 0x22A80338: 0x000022AD "\"\xa9\x038\x00\x00\"\xae" + // 0x22A90338: 0x000022AE "\"\xab\x038\x00\x00\"\xaf" + // 0x22AB0338: 0x000022AF "\"|\x038\x00\x00\"\xe0" + // 0x227C0338: 0x000022E0 "\"}\x038\x00\x00\"\xe1" + // 0x227D0338: 0x000022E1 "\"\x91\x038\x00\x00\"\xe2" + // 0x22910338: 0x000022E2 "\"\x92\x038\x00\x00\"\xe3" + // 0x22920338: 0x000022E3 "\"\xb2\x038\x00\x00\"\xea" + // 0x22B20338: 0x000022EA "\"\xb3\x038\x00\x00\"\xeb" + // 0x22B30338: 0x000022EB "\"\xb4\x038\x00\x00\"\xec" + // 0x22B40338: 0x000022EC "\"\xb5\x038\x00\x00\"\xed" + // 0x22B50338: 0x000022ED "0K0\x99\x00\x000L" + // 0x304B3099: 0x0000304C "0M0\x99\x00\x000N" + // 0x304D3099: 0x0000304E "0O0\x99\x00\x000P" + // 0x304F3099: 0x00003050 "0Q0\x99\x00\x000R" + // 0x30513099: 0x00003052 "0S0\x99\x00\x000T" + // 0x30533099: 0x00003054 "0U0\x99\x00\x000V" + // 0x30553099: 0x00003056 "0W0\x99\x00\x000X" + // 0x30573099: 0x00003058 "0Y0\x99\x00\x000Z" + // 0x30593099: 0x0000305A "0[0\x99\x00\x000\\" + // 0x305B3099: 0x0000305C "0]0\x99\x00\x000^" + // 0x305D3099: 0x0000305E "0_0\x99\x00\x000`" + // 0x305F3099: 0x00003060 "0a0\x99\x00\x000b" + // 0x30613099: 0x00003062 "0d0\x99\x00\x000e" + // 0x30643099: 0x00003065 "0f0\x99\x00\x000g" + // 0x30663099: 0x00003067 "0h0\x99\x00\x000i" + // 0x30683099: 0x00003069 "0o0\x99\x00\x000p" + // 0x306F3099: 0x00003070 "0o0\x9a\x00\x000q" + // 0x306F309A: 0x00003071 "0r0\x99\x00\x000s" + // 0x30723099: 0x00003073 "0r0\x9a\x00\x000t" + // 0x3072309A: 0x00003074 "0u0\x99\x00\x000v" + // 0x30753099: 0x00003076 "0u0\x9a\x00\x000w" + // 0x3075309A: 0x00003077 "0x0\x99\x00\x000y" + // 0x30783099: 0x00003079 "0x0\x9a\x00\x000z" + // 0x3078309A: 0x0000307A "0{0\x99\x00\x000|" + // 0x307B3099: 0x0000307C "0{0\x9a\x00\x000}" + // 0x307B309A: 0x0000307D "0F0\x99\x00\x000\x94" + // 0x30463099: 0x00003094 "0\x9d0\x99\x00\x000\x9e" + // 0x309D3099: 0x0000309E "0\xab0\x99\x00\x000\xac" + // 0x30AB3099: 0x000030AC "0\xad0\x99\x00\x000\xae" + // 0x30AD3099: 0x000030AE "0\xaf0\x99\x00\x000\xb0" + // 0x30AF3099: 0x000030B0 "0\xb10\x99\x00\x000\xb2" + // 0x30B13099: 0x000030B2 "0\xb30\x99\x00\x000\xb4" + // 0x30B33099: 0x000030B4 "0\xb50\x99\x00\x000\xb6" + // 0x30B53099: 0x000030B6 "0\xb70\x99\x00\x000\xb8" + // 0x30B73099: 0x000030B8 "0\xb90\x99\x00\x000\xba" + // 0x30B93099: 0x000030BA "0\xbb0\x99\x00\x000\xbc" + // 0x30BB3099: 0x000030BC "0\xbd0\x99\x00\x000\xbe" + // 0x30BD3099: 0x000030BE "0\xbf0\x99\x00\x000\xc0" + // 0x30BF3099: 0x000030C0 "0\xc10\x99\x00\x000\xc2" + // 0x30C13099: 0x000030C2 "0\xc40\x99\x00\x000\xc5" + // 0x30C43099: 0x000030C5 "0\xc60\x99\x00\x000\xc7" + // 0x30C63099: 0x000030C7 "0\xc80\x99\x00\x000\xc9" + // 0x30C83099: 0x000030C9 "0\xcf0\x99\x00\x000\xd0" + // 0x30CF3099: 0x000030D0 "0\xcf0\x9a\x00\x000\xd1" + // 0x30CF309A: 0x000030D1 "0\xd20\x99\x00\x000\xd3" + // 0x30D23099: 0x000030D3 "0\xd20\x9a\x00\x000\xd4" + // 0x30D2309A: 0x000030D4 "0\xd50\x99\x00\x000\xd6" + // 0x30D53099: 0x000030D6 "0\xd50\x9a\x00\x000\xd7" + // 0x30D5309A: 0x000030D7 "0\xd80\x99\x00\x000\xd9" + // 0x30D83099: 0x000030D9 "0\xd80\x9a\x00\x000\xda" + // 0x30D8309A: 0x000030DA "0\xdb0\x99\x00\x000\xdc" + // 0x30DB3099: 0x000030DC "0\xdb0\x9a\x00\x000\xdd" + // 0x30DB309A: 0x000030DD "0\xa60\x99\x00\x000\xf4" + // 0x30A63099: 0x000030F4 "0\xef0\x99\x00\x000\xf7" + // 0x30EF3099: 0x000030F7 "0\xf00\x99\x00\x000\xf8" + // 0x30F03099: 0x000030F8 "0\xf10\x99\x00\x000\xf9" + // 0x30F13099: 0x000030F9 "0\xf20\x99\x00\x000\xfa" + // 0x30F23099: 0x000030FA "0\xfd0\x99\x00\x000\xfe" + // 0x30FD3099: 0x000030FE "\x05\xd2\x03\a\x00\x01\x05\xc9" + // 0x05D20307: 0x000105C9 "\x05\xda\x03\a\x00\x01\x05\xe4" + // 0x05DA0307: 0x000105E4 "\x10\x99\x10\xba\x00\x01\x10\x9a" + // 0x109910BA: 0x0001109A "\x10\x9b\x10\xba\x00\x01\x10\x9c" + // 0x109B10BA: 0x0001109C "\x10\xa5\x10\xba\x00\x01\x10\xab" + // 0x10A510BA: 0x000110AB "\x111\x11'\x00\x01\x11." + // 0x11311127: 0x0001112E "\x112\x11'\x00\x01\x11/" + // 0x11321127: 0x0001112F "\x13G\x13>\x00\x01\x13K" + // 0x1347133E: 0x0001134B "\x13G\x13W\x00\x01\x13L" + // 0x13471357: 0x0001134C "\x13\x82\x13\xc9\x00\x01\x13\x83" + // 0x138213C9: 0x00011383 "\x13\x84\x13\xbb\x00\x01\x13\x85" + // 0x138413BB: 0x00011385 "\x13\x8b\x13\xc2\x00\x01\x13\x8e" + // 0x138B13C2: 0x0001138E "\x13\x90\x13\xc9\x00\x01\x13\x91" + // 0x139013C9: 0x00011391 "\x13\xc2\x13\xc2\x00\x01\x13\xc5" + // 0x13C213C2: 0x000113C5 "\x13\xc2\x13\xb8\x00\x01\x13\xc7" + // 0x13C213B8: 0x000113C7 "\x13\xc2\x13\xc9\x00\x01\x13\xc8" + // 0x13C213C9: 0x000113C8 "\x14\xb9\x14\xba\x00\x01\x14\xbb" + // 0x14B914BA: 0x000114BB "\x14\xb9\x14\xb0\x00\x01\x14\xbc" + // 0x14B914B0: 0x000114BC "\x14\xb9\x14\xbd\x00\x01\x14\xbe" + // 0x14B914BD: 0x000114BE "\x15\xb8\x15\xaf\x00\x01\x15\xba" + // 0x15B815AF: 0x000115BA "\x15\xb9\x15\xaf\x00\x01\x15\xbb" + // 0x15B915AF: 0x000115BB "\x195\x190\x00\x01\x198" + // 0x19351930: 0x00011938 "a\x1ea\x1e\x00\x01a!" + // 0x611E611E: 0x00016121 "a\x1ea)\x00\x01a\"" + // 0x611E6129: 0x00016122 "a\x1ea\x1f\x00\x01a#" + // 0x611E611F: 0x00016123 "a)a\x1f\x00\x01a$" + // 0x6129611F: 0x00016124 "a\x1ea \x00\x01a%" + // 0x611E6120: 0x00016125 "a!a\x1f\x00\x01a&" + // 0x6121611F: 0x00016126 "a\"a\x1f\x00\x01a'" + // 0x6122611F: 0x00016127 "a!a \x00\x01a(" + // 0x61216120: 0x00016128 "mgmg\x00\x01mh" + // 0x6D676D67: 0x00016D68 "mcmg\x00\x01mi" + // 0x6D636D67: 0x00016D69 "mimg\x00\x01mj" + // 0x6D696D67: 0x00016D6A "" // Total size of tables: 57KB (58086 bytes) ================================================ FILE: vendor/golang.org/x/text/unicode/norm/transform.go ================================================ // Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package norm import ( "unicode/utf8" "golang.org/x/text/transform" ) // Reset implements the Reset method of the transform.Transformer interface. func (Form) Reset() {} // Transform implements the Transform method of the transform.Transformer // interface. It may need to write segments of up to MaxSegmentSize at once. // Users should either catch ErrShortDst and allow dst to grow or have dst be at // least of size MaxTransformChunkSize to be guaranteed of progress. func (f Form) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) { // Cap the maximum number of src bytes to check. b := src eof := atEOF if ns := len(dst); ns < len(b) { err = transform.ErrShortDst eof = false b = b[:ns] } i, ok := formTable[f].quickSpan(inputBytes(b), 0, len(b), eof) n := copy(dst, b[:i]) if !ok { nDst, nSrc, err = f.transform(dst[n:], src[n:], atEOF) return nDst + n, nSrc + n, err } if err == nil && n < len(src) && !atEOF { err = transform.ErrShortSrc } return n, n, err } func flushTransform(rb *reorderBuffer) bool { // Write out (must fully fit in dst, or else it is an ErrShortDst). if len(rb.out) < rb.nrune*utf8.UTFMax { return false } rb.out = rb.out[rb.flushCopy(rb.out):] return true } var errs = []error{nil, transform.ErrShortDst, transform.ErrShortSrc} // transform implements the transform.Transformer interface. It is only called // when quickSpan does not pass for a given string. func (f Form) transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) { // TODO: get rid of reorderBuffer. See CL 23460044. rb := reorderBuffer{} rb.init(f, src) for { // Load segment into reorder buffer. rb.setFlusher(dst[nDst:], flushTransform) end := decomposeSegment(&rb, nSrc, atEOF) if end < 0 { return nDst, nSrc, errs[-end] } nDst = len(dst) - len(rb.out) nSrc = end // Next quickSpan. end = rb.nsrc eof := atEOF if n := nSrc + len(dst) - nDst; n < end { err = transform.ErrShortDst end = n eof = false } end, ok := rb.f.quickSpan(rb.src, nSrc, end, eof) n := copy(dst[nDst:], rb.src.bytes[nSrc:end]) nSrc += n nDst += n if ok { if err == nil && n < rb.nsrc && !atEOF { err = transform.ErrShortSrc } return nDst, nSrc, err } } } ================================================ FILE: vendor/golang.org/x/text/unicode/norm/trie.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package norm type valueRange struct { value uint16 // header: value:stride lo, hi byte // header: lo:n } type sparseBlocks struct { values []valueRange offset []uint16 } var nfcSparse = sparseBlocks{ values: nfcSparseValues[:], offset: nfcSparseOffset[:], } var nfkcSparse = sparseBlocks{ values: nfkcSparseValues[:], offset: nfkcSparseOffset[:], } var ( nfcData = newNfcTrie(0) nfkcData = newNfkcTrie(0) ) // lookup determines the type of block n and looks up the value for b. // For n < t.cutoff, the block is a simple lookup table. Otherwise, the block // is a list of ranges with an accompanying value. Given a matching range r, // the value for b is by r.value + (b - r.lo) * stride. func (t *sparseBlocks) lookup(n uint32, b byte) uint16 { offset := t.offset[n] header := t.values[offset] lo := offset + 1 hi := lo + uint16(header.lo) for lo < hi { m := lo + (hi-lo)/2 r := t.values[m] if r.lo <= b && b <= r.hi { return r.value + uint16(b-r.lo)*header.value } if b < r.lo { hi = m } else { lo = m + 1 } } return 0 } ================================================ FILE: vendor/google.golang.org/genproto/googleapis/api/LICENSE ================================================ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: vendor/google.golang.org/genproto/googleapis/api/annotations/annotations.pb.go ================================================ // Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 // protoc v4.24.4 // source: google/api/annotations.proto package annotations import ( reflect "reflect" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" descriptorpb "google.golang.org/protobuf/types/descriptorpb" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) var file_google_api_annotations_proto_extTypes = []protoimpl.ExtensionInfo{ { ExtendedType: (*descriptorpb.MethodOptions)(nil), ExtensionType: (*HttpRule)(nil), Field: 72295728, Name: "google.api.http", Tag: "bytes,72295728,opt,name=http", Filename: "google/api/annotations.proto", }, } // Extension fields to descriptorpb.MethodOptions. var ( // See `HttpRule`. // // optional google.api.HttpRule http = 72295728; E_Http = &file_google_api_annotations_proto_extTypes[0] ) var File_google_api_annotations_proto protoreflect.FileDescriptor var file_google_api_annotations_proto_rawDesc = []byte{ 0x0a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x1a, 0x15, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x68, 0x74, 0x74, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x3a, 0x4b, 0x0a, 0x04, 0x68, 0x74, 0x74, 0x70, 0x12, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xb0, 0xca, 0xbc, 0x22, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x04, 0x68, 0x74, 0x74, 0x70, 0x42, 0x6e, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x42, 0x10, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0xa2, 0x02, 0x04, 0x47, 0x41, 0x50, 0x49, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var file_google_api_annotations_proto_goTypes = []interface{}{ (*descriptorpb.MethodOptions)(nil), // 0: google.protobuf.MethodOptions (*HttpRule)(nil), // 1: google.api.HttpRule } var file_google_api_annotations_proto_depIdxs = []int32{ 0, // 0: google.api.http:extendee -> google.protobuf.MethodOptions 1, // 1: google.api.http:type_name -> google.api.HttpRule 2, // [2:2] is the sub-list for method output_type 2, // [2:2] is the sub-list for method input_type 1, // [1:2] is the sub-list for extension type_name 0, // [0:1] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name } func init() { file_google_api_annotations_proto_init() } func file_google_api_annotations_proto_init() { if File_google_api_annotations_proto != nil { return } file_google_api_http_proto_init() type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_google_api_annotations_proto_rawDesc, NumEnums: 0, NumMessages: 0, NumExtensions: 1, NumServices: 0, }, GoTypes: file_google_api_annotations_proto_goTypes, DependencyIndexes: file_google_api_annotations_proto_depIdxs, ExtensionInfos: file_google_api_annotations_proto_extTypes, }.Build() File_google_api_annotations_proto = out.File file_google_api_annotations_proto_rawDesc = nil file_google_api_annotations_proto_goTypes = nil file_google_api_annotations_proto_depIdxs = nil } ================================================ FILE: vendor/google.golang.org/genproto/googleapis/api/annotations/client.pb.go ================================================ // Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 // protoc v4.24.4 // source: google/api/client.proto package annotations import ( reflect "reflect" sync "sync" api "google.golang.org/genproto/googleapis/api" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" descriptorpb "google.golang.org/protobuf/types/descriptorpb" durationpb "google.golang.org/protobuf/types/known/durationpb" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) // The organization for which the client libraries are being published. // Affects the url where generated docs are published, etc. type ClientLibraryOrganization int32 const ( // Not useful. ClientLibraryOrganization_CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED ClientLibraryOrganization = 0 // Google Cloud Platform Org. ClientLibraryOrganization_CLOUD ClientLibraryOrganization = 1 // Ads (Advertising) Org. ClientLibraryOrganization_ADS ClientLibraryOrganization = 2 // Photos Org. ClientLibraryOrganization_PHOTOS ClientLibraryOrganization = 3 // Street View Org. ClientLibraryOrganization_STREET_VIEW ClientLibraryOrganization = 4 // Shopping Org. ClientLibraryOrganization_SHOPPING ClientLibraryOrganization = 5 // Geo Org. ClientLibraryOrganization_GEO ClientLibraryOrganization = 6 // Generative AI - https://developers.generativeai.google ClientLibraryOrganization_GENERATIVE_AI ClientLibraryOrganization = 7 ) // Enum value maps for ClientLibraryOrganization. var ( ClientLibraryOrganization_name = map[int32]string{ 0: "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED", 1: "CLOUD", 2: "ADS", 3: "PHOTOS", 4: "STREET_VIEW", 5: "SHOPPING", 6: "GEO", 7: "GENERATIVE_AI", } ClientLibraryOrganization_value = map[string]int32{ "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, "CLOUD": 1, "ADS": 2, "PHOTOS": 3, "STREET_VIEW": 4, "SHOPPING": 5, "GEO": 6, "GENERATIVE_AI": 7, } ) func (x ClientLibraryOrganization) Enum() *ClientLibraryOrganization { p := new(ClientLibraryOrganization) *p = x return p } func (x ClientLibraryOrganization) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (ClientLibraryOrganization) Descriptor() protoreflect.EnumDescriptor { return file_google_api_client_proto_enumTypes[0].Descriptor() } func (ClientLibraryOrganization) Type() protoreflect.EnumType { return &file_google_api_client_proto_enumTypes[0] } func (x ClientLibraryOrganization) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Use ClientLibraryOrganization.Descriptor instead. func (ClientLibraryOrganization) EnumDescriptor() ([]byte, []int) { return file_google_api_client_proto_rawDescGZIP(), []int{0} } // To where should client libraries be published? type ClientLibraryDestination int32 const ( // Client libraries will neither be generated nor published to package // managers. ClientLibraryDestination_CLIENT_LIBRARY_DESTINATION_UNSPECIFIED ClientLibraryDestination = 0 // Generate the client library in a repo under github.com/googleapis, // but don't publish it to package managers. ClientLibraryDestination_GITHUB ClientLibraryDestination = 10 // Publish the library to package managers like nuget.org and npmjs.com. ClientLibraryDestination_PACKAGE_MANAGER ClientLibraryDestination = 20 ) // Enum value maps for ClientLibraryDestination. var ( ClientLibraryDestination_name = map[int32]string{ 0: "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED", 10: "GITHUB", 20: "PACKAGE_MANAGER", } ClientLibraryDestination_value = map[string]int32{ "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, "GITHUB": 10, "PACKAGE_MANAGER": 20, } ) func (x ClientLibraryDestination) Enum() *ClientLibraryDestination { p := new(ClientLibraryDestination) *p = x return p } func (x ClientLibraryDestination) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (ClientLibraryDestination) Descriptor() protoreflect.EnumDescriptor { return file_google_api_client_proto_enumTypes[1].Descriptor() } func (ClientLibraryDestination) Type() protoreflect.EnumType { return &file_google_api_client_proto_enumTypes[1] } func (x ClientLibraryDestination) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Use ClientLibraryDestination.Descriptor instead. func (ClientLibraryDestination) EnumDescriptor() ([]byte, []int) { return file_google_api_client_proto_rawDescGZIP(), []int{1} } // Required information for every language. type CommonLanguageSettings struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Link to automatically generated reference documentation. Example: // https://cloud.google.com/nodejs/docs/reference/asset/latest // // Deprecated: Do not use. ReferenceDocsUri string `protobuf:"bytes,1,opt,name=reference_docs_uri,json=referenceDocsUri,proto3" json:"reference_docs_uri,omitempty"` // The destination where API teams want this client library to be published. Destinations []ClientLibraryDestination `protobuf:"varint,2,rep,packed,name=destinations,proto3,enum=google.api.ClientLibraryDestination" json:"destinations,omitempty"` // Configuration for which RPCs should be generated in the GAPIC client. SelectiveGapicGeneration *SelectiveGapicGeneration `protobuf:"bytes,3,opt,name=selective_gapic_generation,json=selectiveGapicGeneration,proto3" json:"selective_gapic_generation,omitempty"` } func (x *CommonLanguageSettings) Reset() { *x = CommonLanguageSettings{} if protoimpl.UnsafeEnabled { mi := &file_google_api_client_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CommonLanguageSettings) String() string { return protoimpl.X.MessageStringOf(x) } func (*CommonLanguageSettings) ProtoMessage() {} func (x *CommonLanguageSettings) ProtoReflect() protoreflect.Message { mi := &file_google_api_client_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use CommonLanguageSettings.ProtoReflect.Descriptor instead. func (*CommonLanguageSettings) Descriptor() ([]byte, []int) { return file_google_api_client_proto_rawDescGZIP(), []int{0} } // Deprecated: Do not use. func (x *CommonLanguageSettings) GetReferenceDocsUri() string { if x != nil { return x.ReferenceDocsUri } return "" } func (x *CommonLanguageSettings) GetDestinations() []ClientLibraryDestination { if x != nil { return x.Destinations } return nil } func (x *CommonLanguageSettings) GetSelectiveGapicGeneration() *SelectiveGapicGeneration { if x != nil { return x.SelectiveGapicGeneration } return nil } // Details about how and where to publish client libraries. type ClientLibrarySettings struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Version of the API to apply these settings to. This is the full protobuf // package for the API, ending in the version element. // Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` // Launch stage of this version of the API. LaunchStage api.LaunchStage `protobuf:"varint,2,opt,name=launch_stage,json=launchStage,proto3,enum=google.api.LaunchStage" json:"launch_stage,omitempty"` // When using transport=rest, the client request will encode enums as // numbers rather than strings. RestNumericEnums bool `protobuf:"varint,3,opt,name=rest_numeric_enums,json=restNumericEnums,proto3" json:"rest_numeric_enums,omitempty"` // Settings for legacy Java features, supported in the Service YAML. JavaSettings *JavaSettings `protobuf:"bytes,21,opt,name=java_settings,json=javaSettings,proto3" json:"java_settings,omitempty"` // Settings for C++ client libraries. CppSettings *CppSettings `protobuf:"bytes,22,opt,name=cpp_settings,json=cppSettings,proto3" json:"cpp_settings,omitempty"` // Settings for PHP client libraries. PhpSettings *PhpSettings `protobuf:"bytes,23,opt,name=php_settings,json=phpSettings,proto3" json:"php_settings,omitempty"` // Settings for Python client libraries. PythonSettings *PythonSettings `protobuf:"bytes,24,opt,name=python_settings,json=pythonSettings,proto3" json:"python_settings,omitempty"` // Settings for Node client libraries. NodeSettings *NodeSettings `protobuf:"bytes,25,opt,name=node_settings,json=nodeSettings,proto3" json:"node_settings,omitempty"` // Settings for .NET client libraries. DotnetSettings *DotnetSettings `protobuf:"bytes,26,opt,name=dotnet_settings,json=dotnetSettings,proto3" json:"dotnet_settings,omitempty"` // Settings for Ruby client libraries. RubySettings *RubySettings `protobuf:"bytes,27,opt,name=ruby_settings,json=rubySettings,proto3" json:"ruby_settings,omitempty"` // Settings for Go client libraries. GoSettings *GoSettings `protobuf:"bytes,28,opt,name=go_settings,json=goSettings,proto3" json:"go_settings,omitempty"` } func (x *ClientLibrarySettings) Reset() { *x = ClientLibrarySettings{} if protoimpl.UnsafeEnabled { mi := &file_google_api_client_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *ClientLibrarySettings) String() string { return protoimpl.X.MessageStringOf(x) } func (*ClientLibrarySettings) ProtoMessage() {} func (x *ClientLibrarySettings) ProtoReflect() protoreflect.Message { mi := &file_google_api_client_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use ClientLibrarySettings.ProtoReflect.Descriptor instead. func (*ClientLibrarySettings) Descriptor() ([]byte, []int) { return file_google_api_client_proto_rawDescGZIP(), []int{1} } func (x *ClientLibrarySettings) GetVersion() string { if x != nil { return x.Version } return "" } func (x *ClientLibrarySettings) GetLaunchStage() api.LaunchStage { if x != nil { return x.LaunchStage } return api.LaunchStage_LAUNCH_STAGE_UNSPECIFIED } func (x *ClientLibrarySettings) GetRestNumericEnums() bool { if x != nil { return x.RestNumericEnums } return false } func (x *ClientLibrarySettings) GetJavaSettings() *JavaSettings { if x != nil { return x.JavaSettings } return nil } func (x *ClientLibrarySettings) GetCppSettings() *CppSettings { if x != nil { return x.CppSettings } return nil } func (x *ClientLibrarySettings) GetPhpSettings() *PhpSettings { if x != nil { return x.PhpSettings } return nil } func (x *ClientLibrarySettings) GetPythonSettings() *PythonSettings { if x != nil { return x.PythonSettings } return nil } func (x *ClientLibrarySettings) GetNodeSettings() *NodeSettings { if x != nil { return x.NodeSettings } return nil } func (x *ClientLibrarySettings) GetDotnetSettings() *DotnetSettings { if x != nil { return x.DotnetSettings } return nil } func (x *ClientLibrarySettings) GetRubySettings() *RubySettings { if x != nil { return x.RubySettings } return nil } func (x *ClientLibrarySettings) GetGoSettings() *GoSettings { if x != nil { return x.GoSettings } return nil } // This message configures the settings for publishing [Google Cloud Client // libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) // generated from the service config. type Publishing struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // A list of API method settings, e.g. the behavior for methods that use the // long-running operation pattern. MethodSettings []*MethodSettings `protobuf:"bytes,2,rep,name=method_settings,json=methodSettings,proto3" json:"method_settings,omitempty"` // Link to a *public* URI where users can report issues. Example: // https://issuetracker.google.com/issues/new?component=190865&template=1161103 NewIssueUri string `protobuf:"bytes,101,opt,name=new_issue_uri,json=newIssueUri,proto3" json:"new_issue_uri,omitempty"` // Link to product home page. Example: // https://cloud.google.com/asset-inventory/docs/overview DocumentationUri string `protobuf:"bytes,102,opt,name=documentation_uri,json=documentationUri,proto3" json:"documentation_uri,omitempty"` // Used as a tracking tag when collecting data about the APIs developer // relations artifacts like docs, packages delivered to package managers, // etc. Example: "speech". ApiShortName string `protobuf:"bytes,103,opt,name=api_short_name,json=apiShortName,proto3" json:"api_short_name,omitempty"` // GitHub label to apply to issues and pull requests opened for this API. GithubLabel string `protobuf:"bytes,104,opt,name=github_label,json=githubLabel,proto3" json:"github_label,omitempty"` // GitHub teams to be added to CODEOWNERS in the directory in GitHub // containing source code for the client libraries for this API. CodeownerGithubTeams []string `protobuf:"bytes,105,rep,name=codeowner_github_teams,json=codeownerGithubTeams,proto3" json:"codeowner_github_teams,omitempty"` // A prefix used in sample code when demarking regions to be included in // documentation. DocTagPrefix string `protobuf:"bytes,106,opt,name=doc_tag_prefix,json=docTagPrefix,proto3" json:"doc_tag_prefix,omitempty"` // For whom the client library is being published. Organization ClientLibraryOrganization `protobuf:"varint,107,opt,name=organization,proto3,enum=google.api.ClientLibraryOrganization" json:"organization,omitempty"` // Client library settings. If the same version string appears multiple // times in this list, then the last one wins. Settings from earlier // settings with the same version string are discarded. LibrarySettings []*ClientLibrarySettings `protobuf:"bytes,109,rep,name=library_settings,json=librarySettings,proto3" json:"library_settings,omitempty"` // Optional link to proto reference documentation. Example: // https://cloud.google.com/pubsub/lite/docs/reference/rpc ProtoReferenceDocumentationUri string `protobuf:"bytes,110,opt,name=proto_reference_documentation_uri,json=protoReferenceDocumentationUri,proto3" json:"proto_reference_documentation_uri,omitempty"` // Optional link to REST reference documentation. Example: // https://cloud.google.com/pubsub/lite/docs/reference/rest RestReferenceDocumentationUri string `protobuf:"bytes,111,opt,name=rest_reference_documentation_uri,json=restReferenceDocumentationUri,proto3" json:"rest_reference_documentation_uri,omitempty"` } func (x *Publishing) Reset() { *x = Publishing{} if protoimpl.UnsafeEnabled { mi := &file_google_api_client_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Publishing) String() string { return protoimpl.X.MessageStringOf(x) } func (*Publishing) ProtoMessage() {} func (x *Publishing) ProtoReflect() protoreflect.Message { mi := &file_google_api_client_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Publishing.ProtoReflect.Descriptor instead. func (*Publishing) Descriptor() ([]byte, []int) { return file_google_api_client_proto_rawDescGZIP(), []int{2} } func (x *Publishing) GetMethodSettings() []*MethodSettings { if x != nil { return x.MethodSettings } return nil } func (x *Publishing) GetNewIssueUri() string { if x != nil { return x.NewIssueUri } return "" } func (x *Publishing) GetDocumentationUri() string { if x != nil { return x.DocumentationUri } return "" } func (x *Publishing) GetApiShortName() string { if x != nil { return x.ApiShortName } return "" } func (x *Publishing) GetGithubLabel() string { if x != nil { return x.GithubLabel } return "" } func (x *Publishing) GetCodeownerGithubTeams() []string { if x != nil { return x.CodeownerGithubTeams } return nil } func (x *Publishing) GetDocTagPrefix() string { if x != nil { return x.DocTagPrefix } return "" } func (x *Publishing) GetOrganization() ClientLibraryOrganization { if x != nil { return x.Organization } return ClientLibraryOrganization_CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED } func (x *Publishing) GetLibrarySettings() []*ClientLibrarySettings { if x != nil { return x.LibrarySettings } return nil } func (x *Publishing) GetProtoReferenceDocumentationUri() string { if x != nil { return x.ProtoReferenceDocumentationUri } return "" } func (x *Publishing) GetRestReferenceDocumentationUri() string { if x != nil { return x.RestReferenceDocumentationUri } return "" } // Settings for Java client libraries. type JavaSettings struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // The package name to use in Java. Clobbers the java_package option // set in the protobuf. This should be used **only** by APIs // who have already set the language_settings.java.package_name" field // in gapic.yaml. API teams should use the protobuf java_package option // where possible. // // Example of a YAML configuration:: // // publishing: // java_settings: // library_package: com.google.cloud.pubsub.v1 LibraryPackage string `protobuf:"bytes,1,opt,name=library_package,json=libraryPackage,proto3" json:"library_package,omitempty"` // Configure the Java class name to use instead of the service's for its // corresponding generated GAPIC client. Keys are fully-qualified // service names as they appear in the protobuf (including the full // the language_settings.java.interface_names" field in gapic.yaml. API // teams should otherwise use the service name as it appears in the // protobuf. // // Example of a YAML configuration:: // // publishing: // java_settings: // service_class_names: // - google.pubsub.v1.Publisher: TopicAdmin // - google.pubsub.v1.Subscriber: SubscriptionAdmin ServiceClassNames map[string]string `protobuf:"bytes,2,rep,name=service_class_names,json=serviceClassNames,proto3" json:"service_class_names,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // Some settings. Common *CommonLanguageSettings `protobuf:"bytes,3,opt,name=common,proto3" json:"common,omitempty"` } func (x *JavaSettings) Reset() { *x = JavaSettings{} if protoimpl.UnsafeEnabled { mi := &file_google_api_client_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *JavaSettings) String() string { return protoimpl.X.MessageStringOf(x) } func (*JavaSettings) ProtoMessage() {} func (x *JavaSettings) ProtoReflect() protoreflect.Message { mi := &file_google_api_client_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use JavaSettings.ProtoReflect.Descriptor instead. func (*JavaSettings) Descriptor() ([]byte, []int) { return file_google_api_client_proto_rawDescGZIP(), []int{3} } func (x *JavaSettings) GetLibraryPackage() string { if x != nil { return x.LibraryPackage } return "" } func (x *JavaSettings) GetServiceClassNames() map[string]string { if x != nil { return x.ServiceClassNames } return nil } func (x *JavaSettings) GetCommon() *CommonLanguageSettings { if x != nil { return x.Common } return nil } // Settings for C++ client libraries. type CppSettings struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Some settings. Common *CommonLanguageSettings `protobuf:"bytes,1,opt,name=common,proto3" json:"common,omitempty"` } func (x *CppSettings) Reset() { *x = CppSettings{} if protoimpl.UnsafeEnabled { mi := &file_google_api_client_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CppSettings) String() string { return protoimpl.X.MessageStringOf(x) } func (*CppSettings) ProtoMessage() {} func (x *CppSettings) ProtoReflect() protoreflect.Message { mi := &file_google_api_client_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use CppSettings.ProtoReflect.Descriptor instead. func (*CppSettings) Descriptor() ([]byte, []int) { return file_google_api_client_proto_rawDescGZIP(), []int{4} } func (x *CppSettings) GetCommon() *CommonLanguageSettings { if x != nil { return x.Common } return nil } // Settings for Php client libraries. type PhpSettings struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Some settings. Common *CommonLanguageSettings `protobuf:"bytes,1,opt,name=common,proto3" json:"common,omitempty"` } func (x *PhpSettings) Reset() { *x = PhpSettings{} if protoimpl.UnsafeEnabled { mi := &file_google_api_client_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *PhpSettings) String() string { return protoimpl.X.MessageStringOf(x) } func (*PhpSettings) ProtoMessage() {} func (x *PhpSettings) ProtoReflect() protoreflect.Message { mi := &file_google_api_client_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use PhpSettings.ProtoReflect.Descriptor instead. func (*PhpSettings) Descriptor() ([]byte, []int) { return file_google_api_client_proto_rawDescGZIP(), []int{5} } func (x *PhpSettings) GetCommon() *CommonLanguageSettings { if x != nil { return x.Common } return nil } // Settings for Python client libraries. type PythonSettings struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Some settings. Common *CommonLanguageSettings `protobuf:"bytes,1,opt,name=common,proto3" json:"common,omitempty"` // Experimental features to be included during client library generation. ExperimentalFeatures *PythonSettings_ExperimentalFeatures `protobuf:"bytes,2,opt,name=experimental_features,json=experimentalFeatures,proto3" json:"experimental_features,omitempty"` } func (x *PythonSettings) Reset() { *x = PythonSettings{} if protoimpl.UnsafeEnabled { mi := &file_google_api_client_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *PythonSettings) String() string { return protoimpl.X.MessageStringOf(x) } func (*PythonSettings) ProtoMessage() {} func (x *PythonSettings) ProtoReflect() protoreflect.Message { mi := &file_google_api_client_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use PythonSettings.ProtoReflect.Descriptor instead. func (*PythonSettings) Descriptor() ([]byte, []int) { return file_google_api_client_proto_rawDescGZIP(), []int{6} } func (x *PythonSettings) GetCommon() *CommonLanguageSettings { if x != nil { return x.Common } return nil } func (x *PythonSettings) GetExperimentalFeatures() *PythonSettings_ExperimentalFeatures { if x != nil { return x.ExperimentalFeatures } return nil } // Settings for Node client libraries. type NodeSettings struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Some settings. Common *CommonLanguageSettings `protobuf:"bytes,1,opt,name=common,proto3" json:"common,omitempty"` } func (x *NodeSettings) Reset() { *x = NodeSettings{} if protoimpl.UnsafeEnabled { mi := &file_google_api_client_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *NodeSettings) String() string { return protoimpl.X.MessageStringOf(x) } func (*NodeSettings) ProtoMessage() {} func (x *NodeSettings) ProtoReflect() protoreflect.Message { mi := &file_google_api_client_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use NodeSettings.ProtoReflect.Descriptor instead. func (*NodeSettings) Descriptor() ([]byte, []int) { return file_google_api_client_proto_rawDescGZIP(), []int{7} } func (x *NodeSettings) GetCommon() *CommonLanguageSettings { if x != nil { return x.Common } return nil } // Settings for Dotnet client libraries. type DotnetSettings struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Some settings. Common *CommonLanguageSettings `protobuf:"bytes,1,opt,name=common,proto3" json:"common,omitempty"` // Map from original service names to renamed versions. // This is used when the default generated types // would cause a naming conflict. (Neither name is // fully-qualified.) // Example: Subscriber to SubscriberServiceApi. RenamedServices map[string]string `protobuf:"bytes,2,rep,name=renamed_services,json=renamedServices,proto3" json:"renamed_services,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // Map from full resource types to the effective short name // for the resource. This is used when otherwise resource // named from different services would cause naming collisions. // Example entry: // "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" RenamedResources map[string]string `protobuf:"bytes,3,rep,name=renamed_resources,json=renamedResources,proto3" json:"renamed_resources,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // List of full resource types to ignore during generation. // This is typically used for API-specific Location resources, // which should be handled by the generator as if they were actually // the common Location resources. // Example entry: "documentai.googleapis.com/Location" IgnoredResources []string `protobuf:"bytes,4,rep,name=ignored_resources,json=ignoredResources,proto3" json:"ignored_resources,omitempty"` // Namespaces which must be aliased in snippets due to // a known (but non-generator-predictable) naming collision ForcedNamespaceAliases []string `protobuf:"bytes,5,rep,name=forced_namespace_aliases,json=forcedNamespaceAliases,proto3" json:"forced_namespace_aliases,omitempty"` // Method signatures (in the form "service.method(signature)") // which are provided separately, so shouldn't be generated. // Snippets *calling* these methods are still generated, however. HandwrittenSignatures []string `protobuf:"bytes,6,rep,name=handwritten_signatures,json=handwrittenSignatures,proto3" json:"handwritten_signatures,omitempty"` } func (x *DotnetSettings) Reset() { *x = DotnetSettings{} if protoimpl.UnsafeEnabled { mi := &file_google_api_client_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *DotnetSettings) String() string { return protoimpl.X.MessageStringOf(x) } func (*DotnetSettings) ProtoMessage() {} func (x *DotnetSettings) ProtoReflect() protoreflect.Message { mi := &file_google_api_client_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use DotnetSettings.ProtoReflect.Descriptor instead. func (*DotnetSettings) Descriptor() ([]byte, []int) { return file_google_api_client_proto_rawDescGZIP(), []int{8} } func (x *DotnetSettings) GetCommon() *CommonLanguageSettings { if x != nil { return x.Common } return nil } func (x *DotnetSettings) GetRenamedServices() map[string]string { if x != nil { return x.RenamedServices } return nil } func (x *DotnetSettings) GetRenamedResources() map[string]string { if x != nil { return x.RenamedResources } return nil } func (x *DotnetSettings) GetIgnoredResources() []string { if x != nil { return x.IgnoredResources } return nil } func (x *DotnetSettings) GetForcedNamespaceAliases() []string { if x != nil { return x.ForcedNamespaceAliases } return nil } func (x *DotnetSettings) GetHandwrittenSignatures() []string { if x != nil { return x.HandwrittenSignatures } return nil } // Settings for Ruby client libraries. type RubySettings struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Some settings. Common *CommonLanguageSettings `protobuf:"bytes,1,opt,name=common,proto3" json:"common,omitempty"` } func (x *RubySettings) Reset() { *x = RubySettings{} if protoimpl.UnsafeEnabled { mi := &file_google_api_client_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *RubySettings) String() string { return protoimpl.X.MessageStringOf(x) } func (*RubySettings) ProtoMessage() {} func (x *RubySettings) ProtoReflect() protoreflect.Message { mi := &file_google_api_client_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use RubySettings.ProtoReflect.Descriptor instead. func (*RubySettings) Descriptor() ([]byte, []int) { return file_google_api_client_proto_rawDescGZIP(), []int{9} } func (x *RubySettings) GetCommon() *CommonLanguageSettings { if x != nil { return x.Common } return nil } // Settings for Go client libraries. type GoSettings struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Some settings. Common *CommonLanguageSettings `protobuf:"bytes,1,opt,name=common,proto3" json:"common,omitempty"` // Map of service names to renamed services. Keys are the package relative // service names and values are the name to be used for the service client // and call options. // // publishing: // // go_settings: // renamed_services: // Publisher: TopicAdmin RenamedServices map[string]string `protobuf:"bytes,2,rep,name=renamed_services,json=renamedServices,proto3" json:"renamed_services,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (x *GoSettings) Reset() { *x = GoSettings{} if protoimpl.UnsafeEnabled { mi := &file_google_api_client_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *GoSettings) String() string { return protoimpl.X.MessageStringOf(x) } func (*GoSettings) ProtoMessage() {} func (x *GoSettings) ProtoReflect() protoreflect.Message { mi := &file_google_api_client_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use GoSettings.ProtoReflect.Descriptor instead. func (*GoSettings) Descriptor() ([]byte, []int) { return file_google_api_client_proto_rawDescGZIP(), []int{10} } func (x *GoSettings) GetCommon() *CommonLanguageSettings { if x != nil { return x.Common } return nil } func (x *GoSettings) GetRenamedServices() map[string]string { if x != nil { return x.RenamedServices } return nil } // Describes the generator configuration for a method. type MethodSettings struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // The fully qualified name of the method, for which the options below apply. // This is used to find the method to apply the options. // // Example: // // publishing: // method_settings: // - selector: google.storage.control.v2.StorageControl.CreateFolder // # method settings for CreateFolder... Selector string `protobuf:"bytes,1,opt,name=selector,proto3" json:"selector,omitempty"` // Describes settings to use for long-running operations when generating // API methods for RPCs. Complements RPCs that use the annotations in // google/longrunning/operations.proto. // // Example of a YAML configuration:: // // publishing: // method_settings: // - selector: google.cloud.speech.v2.Speech.BatchRecognize // long_running: // initial_poll_delay: 60s # 1 minute // poll_delay_multiplier: 1.5 // max_poll_delay: 360s # 6 minutes // total_poll_timeout: 54000s # 90 minutes LongRunning *MethodSettings_LongRunning `protobuf:"bytes,2,opt,name=long_running,json=longRunning,proto3" json:"long_running,omitempty"` // List of top-level fields of the request message, that should be // automatically populated by the client libraries based on their // (google.api.field_info).format. Currently supported format: UUID4. // // Example of a YAML configuration: // // publishing: // method_settings: // - selector: google.example.v1.ExampleService.CreateExample // auto_populated_fields: // - request_id AutoPopulatedFields []string `protobuf:"bytes,3,rep,name=auto_populated_fields,json=autoPopulatedFields,proto3" json:"auto_populated_fields,omitempty"` } func (x *MethodSettings) Reset() { *x = MethodSettings{} if protoimpl.UnsafeEnabled { mi := &file_google_api_client_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *MethodSettings) String() string { return protoimpl.X.MessageStringOf(x) } func (*MethodSettings) ProtoMessage() {} func (x *MethodSettings) ProtoReflect() protoreflect.Message { mi := &file_google_api_client_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use MethodSettings.ProtoReflect.Descriptor instead. func (*MethodSettings) Descriptor() ([]byte, []int) { return file_google_api_client_proto_rawDescGZIP(), []int{11} } func (x *MethodSettings) GetSelector() string { if x != nil { return x.Selector } return "" } func (x *MethodSettings) GetLongRunning() *MethodSettings_LongRunning { if x != nil { return x.LongRunning } return nil } func (x *MethodSettings) GetAutoPopulatedFields() []string { if x != nil { return x.AutoPopulatedFields } return nil } // This message is used to configure the generation of a subset of the RPCs in // a service for client libraries. type SelectiveGapicGeneration struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // An allowlist of the fully qualified names of RPCs that should be included // on public client surfaces. Methods []string `protobuf:"bytes,1,rep,name=methods,proto3" json:"methods,omitempty"` // Setting this to true indicates to the client generators that methods // that would be excluded from the generation should instead be generated // in a way that indicates these methods should not be consumed by // end users. How this is expressed is up to individual language // implementations to decide. Some examples may be: added annotations, // obfuscated identifiers, or other language idiomatic patterns. GenerateOmittedAsInternal bool `protobuf:"varint,2,opt,name=generate_omitted_as_internal,json=generateOmittedAsInternal,proto3" json:"generate_omitted_as_internal,omitempty"` } func (x *SelectiveGapicGeneration) Reset() { *x = SelectiveGapicGeneration{} if protoimpl.UnsafeEnabled { mi := &file_google_api_client_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *SelectiveGapicGeneration) String() string { return protoimpl.X.MessageStringOf(x) } func (*SelectiveGapicGeneration) ProtoMessage() {} func (x *SelectiveGapicGeneration) ProtoReflect() protoreflect.Message { mi := &file_google_api_client_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use SelectiveGapicGeneration.ProtoReflect.Descriptor instead. func (*SelectiveGapicGeneration) Descriptor() ([]byte, []int) { return file_google_api_client_proto_rawDescGZIP(), []int{12} } func (x *SelectiveGapicGeneration) GetMethods() []string { if x != nil { return x.Methods } return nil } func (x *SelectiveGapicGeneration) GetGenerateOmittedAsInternal() bool { if x != nil { return x.GenerateOmittedAsInternal } return false } // Experimental features to be included during client library generation. // These fields will be deprecated once the feature graduates and is enabled // by default. type PythonSettings_ExperimentalFeatures struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Enables generation of asynchronous REST clients if `rest` transport is // enabled. By default, asynchronous REST clients will not be generated. // This feature will be enabled by default 1 month after launching the // feature in preview packages. RestAsyncIoEnabled bool `protobuf:"varint,1,opt,name=rest_async_io_enabled,json=restAsyncIoEnabled,proto3" json:"rest_async_io_enabled,omitempty"` // Enables generation of protobuf code using new types that are more // Pythonic which are included in `protobuf>=5.29.x`. This feature will be // enabled by default 1 month after launching the feature in preview // packages. ProtobufPythonicTypesEnabled bool `protobuf:"varint,2,opt,name=protobuf_pythonic_types_enabled,json=protobufPythonicTypesEnabled,proto3" json:"protobuf_pythonic_types_enabled,omitempty"` // Disables generation of an unversioned Python package for this client // library. This means that the module names will need to be versioned in // import statements. For example `import google.cloud.library_v2` instead // of `import google.cloud.library`. UnversionedPackageDisabled bool `protobuf:"varint,3,opt,name=unversioned_package_disabled,json=unversionedPackageDisabled,proto3" json:"unversioned_package_disabled,omitempty"` } func (x *PythonSettings_ExperimentalFeatures) Reset() { *x = PythonSettings_ExperimentalFeatures{} if protoimpl.UnsafeEnabled { mi := &file_google_api_client_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *PythonSettings_ExperimentalFeatures) String() string { return protoimpl.X.MessageStringOf(x) } func (*PythonSettings_ExperimentalFeatures) ProtoMessage() {} func (x *PythonSettings_ExperimentalFeatures) ProtoReflect() protoreflect.Message { mi := &file_google_api_client_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use PythonSettings_ExperimentalFeatures.ProtoReflect.Descriptor instead. func (*PythonSettings_ExperimentalFeatures) Descriptor() ([]byte, []int) { return file_google_api_client_proto_rawDescGZIP(), []int{6, 0} } func (x *PythonSettings_ExperimentalFeatures) GetRestAsyncIoEnabled() bool { if x != nil { return x.RestAsyncIoEnabled } return false } func (x *PythonSettings_ExperimentalFeatures) GetProtobufPythonicTypesEnabled() bool { if x != nil { return x.ProtobufPythonicTypesEnabled } return false } func (x *PythonSettings_ExperimentalFeatures) GetUnversionedPackageDisabled() bool { if x != nil { return x.UnversionedPackageDisabled } return false } // Describes settings to use when generating API methods that use the // long-running operation pattern. // All default values below are from those used in the client library // generators (e.g. // [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). type MethodSettings_LongRunning struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Initial delay after which the first poll request will be made. // Default value: 5 seconds. InitialPollDelay *durationpb.Duration `protobuf:"bytes,1,opt,name=initial_poll_delay,json=initialPollDelay,proto3" json:"initial_poll_delay,omitempty"` // Multiplier to gradually increase delay between subsequent polls until it // reaches max_poll_delay. // Default value: 1.5. PollDelayMultiplier float32 `protobuf:"fixed32,2,opt,name=poll_delay_multiplier,json=pollDelayMultiplier,proto3" json:"poll_delay_multiplier,omitempty"` // Maximum time between two subsequent poll requests. // Default value: 45 seconds. MaxPollDelay *durationpb.Duration `protobuf:"bytes,3,opt,name=max_poll_delay,json=maxPollDelay,proto3" json:"max_poll_delay,omitempty"` // Total polling timeout. // Default value: 5 minutes. TotalPollTimeout *durationpb.Duration `protobuf:"bytes,4,opt,name=total_poll_timeout,json=totalPollTimeout,proto3" json:"total_poll_timeout,omitempty"` } func (x *MethodSettings_LongRunning) Reset() { *x = MethodSettings_LongRunning{} if protoimpl.UnsafeEnabled { mi := &file_google_api_client_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *MethodSettings_LongRunning) String() string { return protoimpl.X.MessageStringOf(x) } func (*MethodSettings_LongRunning) ProtoMessage() {} func (x *MethodSettings_LongRunning) ProtoReflect() protoreflect.Message { mi := &file_google_api_client_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use MethodSettings_LongRunning.ProtoReflect.Descriptor instead. func (*MethodSettings_LongRunning) Descriptor() ([]byte, []int) { return file_google_api_client_proto_rawDescGZIP(), []int{11, 0} } func (x *MethodSettings_LongRunning) GetInitialPollDelay() *durationpb.Duration { if x != nil { return x.InitialPollDelay } return nil } func (x *MethodSettings_LongRunning) GetPollDelayMultiplier() float32 { if x != nil { return x.PollDelayMultiplier } return 0 } func (x *MethodSettings_LongRunning) GetMaxPollDelay() *durationpb.Duration { if x != nil { return x.MaxPollDelay } return nil } func (x *MethodSettings_LongRunning) GetTotalPollTimeout() *durationpb.Duration { if x != nil { return x.TotalPollTimeout } return nil } var file_google_api_client_proto_extTypes = []protoimpl.ExtensionInfo{ { ExtendedType: (*descriptorpb.MethodOptions)(nil), ExtensionType: ([]string)(nil), Field: 1051, Name: "google.api.method_signature", Tag: "bytes,1051,rep,name=method_signature", Filename: "google/api/client.proto", }, { ExtendedType: (*descriptorpb.ServiceOptions)(nil), ExtensionType: (*string)(nil), Field: 1049, Name: "google.api.default_host", Tag: "bytes,1049,opt,name=default_host", Filename: "google/api/client.proto", }, { ExtendedType: (*descriptorpb.ServiceOptions)(nil), ExtensionType: (*string)(nil), Field: 1050, Name: "google.api.oauth_scopes", Tag: "bytes,1050,opt,name=oauth_scopes", Filename: "google/api/client.proto", }, { ExtendedType: (*descriptorpb.ServiceOptions)(nil), ExtensionType: (*string)(nil), Field: 525000001, Name: "google.api.api_version", Tag: "bytes,525000001,opt,name=api_version", Filename: "google/api/client.proto", }, } // Extension fields to descriptorpb.MethodOptions. var ( // A definition of a client library method signature. // // In client libraries, each proto RPC corresponds to one or more methods // which the end user is able to call, and calls the underlying RPC. // Normally, this method receives a single argument (a struct or instance // corresponding to the RPC request object). Defining this field will // add one or more overloads providing flattened or simpler method signatures // in some languages. // // The fields on the method signature are provided as a comma-separated // string. // // For example, the proto RPC and annotation: // // rpc CreateSubscription(CreateSubscriptionRequest) // returns (Subscription) { // option (google.api.method_signature) = "name,topic"; // } // // Would add the following Java overload (in addition to the method accepting // the request object): // // public final Subscription createSubscription(String name, String topic) // // The following backwards-compatibility guidelines apply: // // - Adding this annotation to an unannotated method is backwards // compatible. // - Adding this annotation to a method which already has existing // method signature annotations is backwards compatible if and only if // the new method signature annotation is last in the sequence. // - Modifying or removing an existing method signature annotation is // a breaking change. // - Re-ordering existing method signature annotations is a breaking // change. // // repeated string method_signature = 1051; E_MethodSignature = &file_google_api_client_proto_extTypes[0] ) // Extension fields to descriptorpb.ServiceOptions. var ( // The hostname for this service. // This should be specified with no prefix or protocol. // // Example: // // service Foo { // option (google.api.default_host) = "foo.googleapi.com"; // ... // } // // optional string default_host = 1049; E_DefaultHost = &file_google_api_client_proto_extTypes[1] // OAuth scopes needed for the client. // // Example: // // service Foo { // option (google.api.oauth_scopes) = \ // "https://www.googleapis.com/auth/cloud-platform"; // ... // } // // If there is more than one scope, use a comma-separated string: // // Example: // // service Foo { // option (google.api.oauth_scopes) = \ // "https://www.googleapis.com/auth/cloud-platform," // "https://www.googleapis.com/auth/monitoring"; // ... // } // // optional string oauth_scopes = 1050; E_OauthScopes = &file_google_api_client_proto_extTypes[2] // The API version of this service, which should be sent by version-aware // clients to the service. This allows services to abide by the schema and // behavior of the service at the time this API version was deployed. // The format of the API version must be treated as opaque by clients. // Services may use a format with an apparent structure, but clients must // not rely on this to determine components within an API version, or attempt // to construct other valid API versions. Note that this is for upcoming // functionality and may not be implemented for all services. // // Example: // // service Foo { // option (google.api.api_version) = "v1_20230821_preview"; // } // // optional string api_version = 525000001; E_ApiVersion = &file_google_api_client_proto_extTypes[3] ) var File_google_api_client_proto protoreflect.FileDescriptor var file_google_api_client_proto_rawDesc = []byte{ 0x0a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x1a, 0x1d, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x5f, 0x73, 0x74, 0x61, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf8, 0x01, 0x0a, 0x16, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x30, 0x0a, 0x12, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x5f, 0x64, 0x6f, 0x63, 0x73, 0x5f, 0x75, 0x72, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x02, 0x18, 0x01, 0x52, 0x10, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x44, 0x6f, 0x63, 0x73, 0x55, 0x72, 0x69, 0x12, 0x48, 0x0a, 0x0c, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x62, 0x0a, 0x1a, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x67, 0x61, 0x70, 0x69, 0x63, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x47, 0x61, 0x70, 0x69, 0x63, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x18, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x47, 0x61, 0x70, 0x69, 0x63, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x93, 0x05, 0x0a, 0x15, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3a, 0x0a, 0x0c, 0x6c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x5f, 0x73, 0x74, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x53, 0x74, 0x61, 0x67, 0x65, 0x52, 0x0b, 0x6c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x53, 0x74, 0x61, 0x67, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x72, 0x65, 0x73, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x72, 0x65, 0x73, 0x74, 0x4e, 0x75, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x45, 0x6e, 0x75, 0x6d, 0x73, 0x12, 0x3d, 0x0a, 0x0d, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4a, 0x61, 0x76, 0x61, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x0c, 0x6a, 0x61, 0x76, 0x61, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x3a, 0x0a, 0x0c, 0x63, 0x70, 0x70, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x16, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x70, 0x70, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x0b, 0x63, 0x70, 0x70, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x3a, 0x0a, 0x0c, 0x70, 0x68, 0x70, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x17, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x68, 0x70, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x0b, 0x70, 0x68, 0x70, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x43, 0x0a, 0x0f, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x18, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x0e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x3d, 0x0a, 0x0d, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x19, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x0c, 0x6e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x43, 0x0a, 0x0f, 0x64, 0x6f, 0x74, 0x6e, 0x65, 0x74, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x6f, 0x74, 0x6e, 0x65, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x0e, 0x64, 0x6f, 0x74, 0x6e, 0x65, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x3d, 0x0a, 0x0d, 0x72, 0x75, 0x62, 0x79, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x75, 0x62, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x0c, 0x72, 0x75, 0x62, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x37, 0x0a, 0x0b, 0x67, 0x6f, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x6f, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x0a, 0x67, 0x6f, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x22, 0xf4, 0x04, 0x0a, 0x0a, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x12, 0x43, 0x0a, 0x0f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x0e, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x22, 0x0a, 0x0d, 0x6e, 0x65, 0x77, 0x5f, 0x69, 0x73, 0x73, 0x75, 0x65, 0x5f, 0x75, 0x72, 0x69, 0x18, 0x65, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6e, 0x65, 0x77, 0x49, 0x73, 0x73, 0x75, 0x65, 0x55, 0x72, 0x69, 0x12, 0x2b, 0x0a, 0x11, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x75, 0x72, 0x69, 0x18, 0x66, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x72, 0x69, 0x12, 0x24, 0x0a, 0x0e, 0x61, 0x70, 0x69, 0x5f, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x67, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x70, 0x69, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x68, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x34, 0x0a, 0x16, 0x63, 0x6f, 0x64, 0x65, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x5f, 0x74, 0x65, 0x61, 0x6d, 0x73, 0x18, 0x69, 0x20, 0x03, 0x28, 0x09, 0x52, 0x14, 0x63, 0x6f, 0x64, 0x65, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x47, 0x69, 0x74, 0x68, 0x75, 0x62, 0x54, 0x65, 0x61, 0x6d, 0x73, 0x12, 0x24, 0x0a, 0x0e, 0x64, 0x6f, 0x63, 0x5f, 0x74, 0x61, 0x67, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x6a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x6f, 0x63, 0x54, 0x61, 0x67, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x49, 0x0a, 0x0c, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x6b, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4c, 0x0a, 0x10, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x6d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x0f, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x49, 0x0a, 0x21, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x5f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x75, 0x72, 0x69, 0x18, 0x6e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x1e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x72, 0x69, 0x12, 0x47, 0x0a, 0x20, 0x72, 0x65, 0x73, 0x74, 0x5f, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x5f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x75, 0x72, 0x69, 0x18, 0x6f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x1d, 0x72, 0x65, 0x73, 0x74, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x72, 0x69, 0x22, 0x9a, 0x02, 0x0a, 0x0c, 0x4a, 0x61, 0x76, 0x61, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x5f, 0x0a, 0x13, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4a, 0x61, 0x76, 0x61, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x3a, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x1a, 0x44, 0x0a, 0x16, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x49, 0x0a, 0x0b, 0x43, 0x70, 0x70, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x3a, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x22, 0x49, 0x0a, 0x0b, 0x50, 0x68, 0x70, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x3a, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x22, 0x87, 0x03, 0x0a, 0x0e, 0x50, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x3a, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x64, 0x0a, 0x15, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x5f, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x45, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x52, 0x14, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x1a, 0xd2, 0x01, 0x0a, 0x14, 0x45, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x31, 0x0a, 0x15, 0x72, 0x65, 0x73, 0x74, 0x5f, 0x61, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x69, 0x6f, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x72, 0x65, 0x73, 0x74, 0x41, 0x73, 0x79, 0x6e, 0x63, 0x49, 0x6f, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x45, 0x0a, 0x1f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x69, 0x63, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1c, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x50, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x69, 0x63, 0x54, 0x79, 0x70, 0x65, 0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x40, 0x0a, 0x1c, 0x75, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1a, 0x75, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x22, 0x4a, 0x0a, 0x0c, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x3a, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x22, 0xae, 0x04, 0x0a, 0x0e, 0x44, 0x6f, 0x74, 0x6e, 0x65, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x3a, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x5a, 0x0a, 0x10, 0x72, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x64, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x6f, 0x74, 0x6e, 0x65, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x52, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x72, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x5d, 0x0a, 0x11, 0x72, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x6f, 0x74, 0x6e, 0x65, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x52, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x10, 0x72, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x18, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x64, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x16, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x65, 0x73, 0x12, 0x35, 0x0a, 0x16, 0x68, 0x61, 0x6e, 0x64, 0x77, 0x72, 0x69, 0x74, 0x74, 0x65, 0x6e, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x15, 0x68, 0x61, 0x6e, 0x64, 0x77, 0x72, 0x69, 0x74, 0x74, 0x65, 0x6e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x1a, 0x42, 0x0a, 0x14, 0x52, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x43, 0x0a, 0x15, 0x52, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x4a, 0x0a, 0x0c, 0x52, 0x75, 0x62, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x3a, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x22, 0xe4, 0x01, 0x0a, 0x0a, 0x47, 0x6f, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x3a, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x56, 0x0a, 0x10, 0x72, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x64, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x6f, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x52, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x72, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x1a, 0x42, 0x0a, 0x14, 0x52, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xc2, 0x03, 0x0a, 0x0e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x49, 0x0a, 0x0c, 0x6c, 0x6f, 0x6e, 0x67, 0x5f, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x4c, 0x6f, 0x6e, 0x67, 0x52, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x52, 0x0b, 0x6c, 0x6f, 0x6e, 0x67, 0x52, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x12, 0x32, 0x0a, 0x15, 0x61, 0x75, 0x74, 0x6f, 0x5f, 0x70, 0x6f, 0x70, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x13, 0x61, 0x75, 0x74, 0x6f, 0x50, 0x6f, 0x70, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x1a, 0x94, 0x02, 0x0a, 0x0b, 0x4c, 0x6f, 0x6e, 0x67, 0x52, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x12, 0x47, 0x0a, 0x12, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x70, 0x6f, 0x6c, 0x6c, 0x5f, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x10, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x50, 0x6f, 0x6c, 0x6c, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x12, 0x32, 0x0a, 0x15, 0x70, 0x6f, 0x6c, 0x6c, 0x5f, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x5f, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x02, 0x52, 0x13, 0x70, 0x6f, 0x6c, 0x6c, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, 0x3f, 0x0a, 0x0e, 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x6f, 0x6c, 0x6c, 0x5f, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x6d, 0x61, 0x78, 0x50, 0x6f, 0x6c, 0x6c, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x12, 0x47, 0x0a, 0x12, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x70, 0x6f, 0x6c, 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x10, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x50, 0x6f, 0x6c, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x22, 0x75, 0x0a, 0x18, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x47, 0x61, 0x70, 0x69, 0x63, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x12, 0x3f, 0x0a, 0x1c, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x6f, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x73, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x19, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x4f, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x41, 0x73, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2a, 0xa3, 0x01, 0x0a, 0x19, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x0a, 0x27, 0x43, 0x4c, 0x49, 0x45, 0x4e, 0x54, 0x5f, 0x4c, 0x49, 0x42, 0x52, 0x41, 0x52, 0x59, 0x5f, 0x4f, 0x52, 0x47, 0x41, 0x4e, 0x49, 0x5a, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x43, 0x4c, 0x4f, 0x55, 0x44, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x44, 0x53, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x50, 0x48, 0x4f, 0x54, 0x4f, 0x53, 0x10, 0x03, 0x12, 0x0f, 0x0a, 0x0b, 0x53, 0x54, 0x52, 0x45, 0x45, 0x54, 0x5f, 0x56, 0x49, 0x45, 0x57, 0x10, 0x04, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x48, 0x4f, 0x50, 0x50, 0x49, 0x4e, 0x47, 0x10, 0x05, 0x12, 0x07, 0x0a, 0x03, 0x47, 0x45, 0x4f, 0x10, 0x06, 0x12, 0x11, 0x0a, 0x0d, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x49, 0x56, 0x45, 0x5f, 0x41, 0x49, 0x10, 0x07, 0x2a, 0x67, 0x0a, 0x18, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x0a, 0x26, 0x43, 0x4c, 0x49, 0x45, 0x4e, 0x54, 0x5f, 0x4c, 0x49, 0x42, 0x52, 0x41, 0x52, 0x59, 0x5f, 0x44, 0x45, 0x53, 0x54, 0x49, 0x4e, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x47, 0x49, 0x54, 0x48, 0x55, 0x42, 0x10, 0x0a, 0x12, 0x13, 0x0a, 0x0f, 0x50, 0x41, 0x43, 0x4b, 0x41, 0x47, 0x45, 0x5f, 0x4d, 0x41, 0x4e, 0x41, 0x47, 0x45, 0x52, 0x10, 0x14, 0x3a, 0x4a, 0x0a, 0x10, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x9b, 0x08, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x3a, 0x43, 0x0a, 0x0c, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x99, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x48, 0x6f, 0x73, 0x74, 0x3a, 0x43, 0x0a, 0x0c, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x9a, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x3a, 0x44, 0x0a, 0x0b, 0x61, 0x70, 0x69, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xc1, 0xba, 0xab, 0xfa, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x42, 0x0b, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0xa2, 0x02, 0x04, 0x47, 0x41, 0x50, 0x49, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_google_api_client_proto_rawDescOnce sync.Once file_google_api_client_proto_rawDescData = file_google_api_client_proto_rawDesc ) func file_google_api_client_proto_rawDescGZIP() []byte { file_google_api_client_proto_rawDescOnce.Do(func() { file_google_api_client_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_api_client_proto_rawDescData) }) return file_google_api_client_proto_rawDescData } var file_google_api_client_proto_enumTypes = make([]protoimpl.EnumInfo, 2) var file_google_api_client_proto_msgTypes = make([]protoimpl.MessageInfo, 19) var file_google_api_client_proto_goTypes = []interface{}{ (ClientLibraryOrganization)(0), // 0: google.api.ClientLibraryOrganization (ClientLibraryDestination)(0), // 1: google.api.ClientLibraryDestination (*CommonLanguageSettings)(nil), // 2: google.api.CommonLanguageSettings (*ClientLibrarySettings)(nil), // 3: google.api.ClientLibrarySettings (*Publishing)(nil), // 4: google.api.Publishing (*JavaSettings)(nil), // 5: google.api.JavaSettings (*CppSettings)(nil), // 6: google.api.CppSettings (*PhpSettings)(nil), // 7: google.api.PhpSettings (*PythonSettings)(nil), // 8: google.api.PythonSettings (*NodeSettings)(nil), // 9: google.api.NodeSettings (*DotnetSettings)(nil), // 10: google.api.DotnetSettings (*RubySettings)(nil), // 11: google.api.RubySettings (*GoSettings)(nil), // 12: google.api.GoSettings (*MethodSettings)(nil), // 13: google.api.MethodSettings (*SelectiveGapicGeneration)(nil), // 14: google.api.SelectiveGapicGeneration nil, // 15: google.api.JavaSettings.ServiceClassNamesEntry (*PythonSettings_ExperimentalFeatures)(nil), // 16: google.api.PythonSettings.ExperimentalFeatures nil, // 17: google.api.DotnetSettings.RenamedServicesEntry nil, // 18: google.api.DotnetSettings.RenamedResourcesEntry nil, // 19: google.api.GoSettings.RenamedServicesEntry (*MethodSettings_LongRunning)(nil), // 20: google.api.MethodSettings.LongRunning (api.LaunchStage)(0), // 21: google.api.LaunchStage (*durationpb.Duration)(nil), // 22: google.protobuf.Duration (*descriptorpb.MethodOptions)(nil), // 23: google.protobuf.MethodOptions (*descriptorpb.ServiceOptions)(nil), // 24: google.protobuf.ServiceOptions } var file_google_api_client_proto_depIdxs = []int32{ 1, // 0: google.api.CommonLanguageSettings.destinations:type_name -> google.api.ClientLibraryDestination 14, // 1: google.api.CommonLanguageSettings.selective_gapic_generation:type_name -> google.api.SelectiveGapicGeneration 21, // 2: google.api.ClientLibrarySettings.launch_stage:type_name -> google.api.LaunchStage 5, // 3: google.api.ClientLibrarySettings.java_settings:type_name -> google.api.JavaSettings 6, // 4: google.api.ClientLibrarySettings.cpp_settings:type_name -> google.api.CppSettings 7, // 5: google.api.ClientLibrarySettings.php_settings:type_name -> google.api.PhpSettings 8, // 6: google.api.ClientLibrarySettings.python_settings:type_name -> google.api.PythonSettings 9, // 7: google.api.ClientLibrarySettings.node_settings:type_name -> google.api.NodeSettings 10, // 8: google.api.ClientLibrarySettings.dotnet_settings:type_name -> google.api.DotnetSettings 11, // 9: google.api.ClientLibrarySettings.ruby_settings:type_name -> google.api.RubySettings 12, // 10: google.api.ClientLibrarySettings.go_settings:type_name -> google.api.GoSettings 13, // 11: google.api.Publishing.method_settings:type_name -> google.api.MethodSettings 0, // 12: google.api.Publishing.organization:type_name -> google.api.ClientLibraryOrganization 3, // 13: google.api.Publishing.library_settings:type_name -> google.api.ClientLibrarySettings 15, // 14: google.api.JavaSettings.service_class_names:type_name -> google.api.JavaSettings.ServiceClassNamesEntry 2, // 15: google.api.JavaSettings.common:type_name -> google.api.CommonLanguageSettings 2, // 16: google.api.CppSettings.common:type_name -> google.api.CommonLanguageSettings 2, // 17: google.api.PhpSettings.common:type_name -> google.api.CommonLanguageSettings 2, // 18: google.api.PythonSettings.common:type_name -> google.api.CommonLanguageSettings 16, // 19: google.api.PythonSettings.experimental_features:type_name -> google.api.PythonSettings.ExperimentalFeatures 2, // 20: google.api.NodeSettings.common:type_name -> google.api.CommonLanguageSettings 2, // 21: google.api.DotnetSettings.common:type_name -> google.api.CommonLanguageSettings 17, // 22: google.api.DotnetSettings.renamed_services:type_name -> google.api.DotnetSettings.RenamedServicesEntry 18, // 23: google.api.DotnetSettings.renamed_resources:type_name -> google.api.DotnetSettings.RenamedResourcesEntry 2, // 24: google.api.RubySettings.common:type_name -> google.api.CommonLanguageSettings 2, // 25: google.api.GoSettings.common:type_name -> google.api.CommonLanguageSettings 19, // 26: google.api.GoSettings.renamed_services:type_name -> google.api.GoSettings.RenamedServicesEntry 20, // 27: google.api.MethodSettings.long_running:type_name -> google.api.MethodSettings.LongRunning 22, // 28: google.api.MethodSettings.LongRunning.initial_poll_delay:type_name -> google.protobuf.Duration 22, // 29: google.api.MethodSettings.LongRunning.max_poll_delay:type_name -> google.protobuf.Duration 22, // 30: google.api.MethodSettings.LongRunning.total_poll_timeout:type_name -> google.protobuf.Duration 23, // 31: google.api.method_signature:extendee -> google.protobuf.MethodOptions 24, // 32: google.api.default_host:extendee -> google.protobuf.ServiceOptions 24, // 33: google.api.oauth_scopes:extendee -> google.protobuf.ServiceOptions 24, // 34: google.api.api_version:extendee -> google.protobuf.ServiceOptions 35, // [35:35] is the sub-list for method output_type 35, // [35:35] is the sub-list for method input_type 35, // [35:35] is the sub-list for extension type_name 31, // [31:35] is the sub-list for extension extendee 0, // [0:31] is the sub-list for field type_name } func init() { file_google_api_client_proto_init() } func file_google_api_client_proto_init() { if File_google_api_client_proto != nil { return } if !protoimpl.UnsafeEnabled { file_google_api_client_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CommonLanguageSettings); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_google_api_client_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ClientLibrarySettings); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_google_api_client_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Publishing); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_google_api_client_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*JavaSettings); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_google_api_client_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CppSettings); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_google_api_client_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PhpSettings); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_google_api_client_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PythonSettings); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_google_api_client_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*NodeSettings); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_google_api_client_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DotnetSettings); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_google_api_client_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RubySettings); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_google_api_client_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GoSettings); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_google_api_client_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MethodSettings); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_google_api_client_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SelectiveGapicGeneration); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_google_api_client_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PythonSettings_ExperimentalFeatures); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_google_api_client_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MethodSettings_LongRunning); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_google_api_client_proto_rawDesc, NumEnums: 2, NumMessages: 19, NumExtensions: 4, NumServices: 0, }, GoTypes: file_google_api_client_proto_goTypes, DependencyIndexes: file_google_api_client_proto_depIdxs, EnumInfos: file_google_api_client_proto_enumTypes, MessageInfos: file_google_api_client_proto_msgTypes, ExtensionInfos: file_google_api_client_proto_extTypes, }.Build() File_google_api_client_proto = out.File file_google_api_client_proto_rawDesc = nil file_google_api_client_proto_goTypes = nil file_google_api_client_proto_depIdxs = nil } ================================================ FILE: vendor/google.golang.org/genproto/googleapis/api/annotations/field_behavior.pb.go ================================================ // Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 // protoc v4.24.4 // source: google/api/field_behavior.proto package annotations import ( reflect "reflect" sync "sync" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" descriptorpb "google.golang.org/protobuf/types/descriptorpb" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) // An indicator of the behavior of a given field (for example, that a field // is required in requests, or given as output but ignored as input). // This **does not** change the behavior in protocol buffers itself; it only // denotes the behavior and may affect how API tooling handles the field. // // Note: This enum **may** receive new values in the future. type FieldBehavior int32 const ( // Conventional default for enums. Do not use this. FieldBehavior_FIELD_BEHAVIOR_UNSPECIFIED FieldBehavior = 0 // Specifically denotes a field as optional. // While all fields in protocol buffers are optional, this may be specified // for emphasis if appropriate. FieldBehavior_OPTIONAL FieldBehavior = 1 // Denotes a field as required. // This indicates that the field **must** be provided as part of the request, // and failure to do so will cause an error (usually `INVALID_ARGUMENT`). FieldBehavior_REQUIRED FieldBehavior = 2 // Denotes a field as output only. // This indicates that the field is provided in responses, but including the // field in a request does nothing (the server *must* ignore it and // *must not* throw an error as a result of the field's presence). FieldBehavior_OUTPUT_ONLY FieldBehavior = 3 // Denotes a field as input only. // This indicates that the field is provided in requests, and the // corresponding field is not included in output. FieldBehavior_INPUT_ONLY FieldBehavior = 4 // Denotes a field as immutable. // This indicates that the field may be set once in a request to create a // resource, but may not be changed thereafter. FieldBehavior_IMMUTABLE FieldBehavior = 5 // Denotes that a (repeated) field is an unordered list. // This indicates that the service may provide the elements of the list // in any arbitrary order, rather than the order the user originally // provided. Additionally, the list's order may or may not be stable. FieldBehavior_UNORDERED_LIST FieldBehavior = 6 // Denotes that this field returns a non-empty default value if not set. // This indicates that if the user provides the empty value in a request, // a non-empty value will be returned. The user will not be aware of what // non-empty value to expect. FieldBehavior_NON_EMPTY_DEFAULT FieldBehavior = 7 // Denotes that the field in a resource (a message annotated with // google.api.resource) is used in the resource name to uniquely identify the // resource. For AIP-compliant APIs, this should only be applied to the // `name` field on the resource. // // This behavior should not be applied to references to other resources within // the message. // // The identifier field of resources often have different field behavior // depending on the request it is embedded in (e.g. for Create methods name // is optional and unused, while for Update methods it is required). Instead // of method-specific annotations, only `IDENTIFIER` is required. FieldBehavior_IDENTIFIER FieldBehavior = 8 ) // Enum value maps for FieldBehavior. var ( FieldBehavior_name = map[int32]string{ 0: "FIELD_BEHAVIOR_UNSPECIFIED", 1: "OPTIONAL", 2: "REQUIRED", 3: "OUTPUT_ONLY", 4: "INPUT_ONLY", 5: "IMMUTABLE", 6: "UNORDERED_LIST", 7: "NON_EMPTY_DEFAULT", 8: "IDENTIFIER", } FieldBehavior_value = map[string]int32{ "FIELD_BEHAVIOR_UNSPECIFIED": 0, "OPTIONAL": 1, "REQUIRED": 2, "OUTPUT_ONLY": 3, "INPUT_ONLY": 4, "IMMUTABLE": 5, "UNORDERED_LIST": 6, "NON_EMPTY_DEFAULT": 7, "IDENTIFIER": 8, } ) func (x FieldBehavior) Enum() *FieldBehavior { p := new(FieldBehavior) *p = x return p } func (x FieldBehavior) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (FieldBehavior) Descriptor() protoreflect.EnumDescriptor { return file_google_api_field_behavior_proto_enumTypes[0].Descriptor() } func (FieldBehavior) Type() protoreflect.EnumType { return &file_google_api_field_behavior_proto_enumTypes[0] } func (x FieldBehavior) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Use FieldBehavior.Descriptor instead. func (FieldBehavior) EnumDescriptor() ([]byte, []int) { return file_google_api_field_behavior_proto_rawDescGZIP(), []int{0} } var file_google_api_field_behavior_proto_extTypes = []protoimpl.ExtensionInfo{ { ExtendedType: (*descriptorpb.FieldOptions)(nil), ExtensionType: ([]FieldBehavior)(nil), Field: 1052, Name: "google.api.field_behavior", Tag: "varint,1052,rep,name=field_behavior,enum=google.api.FieldBehavior", Filename: "google/api/field_behavior.proto", }, } // Extension fields to descriptorpb.FieldOptions. var ( // A designation of a specific field behavior (required, output only, etc.) // in protobuf messages. // // Examples: // // string name = 1 [(google.api.field_behavior) = REQUIRED]; // State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; // google.protobuf.Duration ttl = 1 // [(google.api.field_behavior) = INPUT_ONLY]; // google.protobuf.Timestamp expire_time = 1 // [(google.api.field_behavior) = OUTPUT_ONLY, // (google.api.field_behavior) = IMMUTABLE]; // // repeated google.api.FieldBehavior field_behavior = 1052; E_FieldBehavior = &file_google_api_field_behavior_proto_extTypes[0] ) var File_google_api_field_behavior_proto protoreflect.FileDescriptor var file_google_api_field_behavior_proto_rawDesc = []byte{ 0x0a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2a, 0xb6, 0x01, 0x0a, 0x0d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x12, 0x1e, 0x0a, 0x1a, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x5f, 0x42, 0x45, 0x48, 0x41, 0x56, 0x49, 0x4f, 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x52, 0x45, 0x51, 0x55, 0x49, 0x52, 0x45, 0x44, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x4f, 0x55, 0x54, 0x50, 0x55, 0x54, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x03, 0x12, 0x0e, 0x0a, 0x0a, 0x49, 0x4e, 0x50, 0x55, 0x54, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x04, 0x12, 0x0d, 0x0a, 0x09, 0x49, 0x4d, 0x4d, 0x55, 0x54, 0x41, 0x42, 0x4c, 0x45, 0x10, 0x05, 0x12, 0x12, 0x0a, 0x0e, 0x55, 0x4e, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x45, 0x44, 0x5f, 0x4c, 0x49, 0x53, 0x54, 0x10, 0x06, 0x12, 0x15, 0x0a, 0x11, 0x4e, 0x4f, 0x4e, 0x5f, 0x45, 0x4d, 0x50, 0x54, 0x59, 0x5f, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x07, 0x12, 0x0e, 0x0a, 0x0a, 0x49, 0x44, 0x45, 0x4e, 0x54, 0x49, 0x46, 0x49, 0x45, 0x52, 0x10, 0x08, 0x3a, 0x64, 0x0a, 0x0e, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x9c, 0x08, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x42, 0x02, 0x10, 0x00, 0x52, 0x0d, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x42, 0x70, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x42, 0x12, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0xa2, 0x02, 0x04, 0x47, 0x41, 0x50, 0x49, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_google_api_field_behavior_proto_rawDescOnce sync.Once file_google_api_field_behavior_proto_rawDescData = file_google_api_field_behavior_proto_rawDesc ) func file_google_api_field_behavior_proto_rawDescGZIP() []byte { file_google_api_field_behavior_proto_rawDescOnce.Do(func() { file_google_api_field_behavior_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_api_field_behavior_proto_rawDescData) }) return file_google_api_field_behavior_proto_rawDescData } var file_google_api_field_behavior_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_google_api_field_behavior_proto_goTypes = []interface{}{ (FieldBehavior)(0), // 0: google.api.FieldBehavior (*descriptorpb.FieldOptions)(nil), // 1: google.protobuf.FieldOptions } var file_google_api_field_behavior_proto_depIdxs = []int32{ 1, // 0: google.api.field_behavior:extendee -> google.protobuf.FieldOptions 0, // 1: google.api.field_behavior:type_name -> google.api.FieldBehavior 2, // [2:2] is the sub-list for method output_type 2, // [2:2] is the sub-list for method input_type 1, // [1:2] is the sub-list for extension type_name 0, // [0:1] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name } func init() { file_google_api_field_behavior_proto_init() } func file_google_api_field_behavior_proto_init() { if File_google_api_field_behavior_proto != nil { return } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_google_api_field_behavior_proto_rawDesc, NumEnums: 1, NumMessages: 0, NumExtensions: 1, NumServices: 0, }, GoTypes: file_google_api_field_behavior_proto_goTypes, DependencyIndexes: file_google_api_field_behavior_proto_depIdxs, EnumInfos: file_google_api_field_behavior_proto_enumTypes, ExtensionInfos: file_google_api_field_behavior_proto_extTypes, }.Build() File_google_api_field_behavior_proto = out.File file_google_api_field_behavior_proto_rawDesc = nil file_google_api_field_behavior_proto_goTypes = nil file_google_api_field_behavior_proto_depIdxs = nil } ================================================ FILE: vendor/google.golang.org/genproto/googleapis/api/annotations/field_info.pb.go ================================================ // Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 // protoc v4.24.4 // source: google/api/field_info.proto package annotations import ( reflect "reflect" sync "sync" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" descriptorpb "google.golang.org/protobuf/types/descriptorpb" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) // The standard format of a field value. The supported formats are all backed // by either an RFC defined by the IETF or a Google-defined AIP. type FieldInfo_Format int32 const ( // Default, unspecified value. FieldInfo_FORMAT_UNSPECIFIED FieldInfo_Format = 0 // Universally Unique Identifier, version 4, value as defined by // https://datatracker.ietf.org/doc/html/rfc4122. The value may be // normalized to entirely lowercase letters. For example, the value // `F47AC10B-58CC-0372-8567-0E02B2C3D479` would be normalized to // `f47ac10b-58cc-0372-8567-0e02b2c3d479`. FieldInfo_UUID4 FieldInfo_Format = 1 // Internet Protocol v4 value as defined by [RFC // 791](https://datatracker.ietf.org/doc/html/rfc791). The value may be // condensed, with leading zeros in each octet stripped. For example, // `001.022.233.040` would be condensed to `1.22.233.40`. FieldInfo_IPV4 FieldInfo_Format = 2 // Internet Protocol v6 value as defined by [RFC // 2460](https://datatracker.ietf.org/doc/html/rfc2460). The value may be // normalized to entirely lowercase letters with zeros compressed, following // [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952). For example, // the value `2001:0DB8:0::0` would be normalized to `2001:db8::`. FieldInfo_IPV6 FieldInfo_Format = 3 // An IP address in either v4 or v6 format as described by the individual // values defined herein. See the comments on the IPV4 and IPV6 types for // allowed normalizations of each. FieldInfo_IPV4_OR_IPV6 FieldInfo_Format = 4 ) // Enum value maps for FieldInfo_Format. var ( FieldInfo_Format_name = map[int32]string{ 0: "FORMAT_UNSPECIFIED", 1: "UUID4", 2: "IPV4", 3: "IPV6", 4: "IPV4_OR_IPV6", } FieldInfo_Format_value = map[string]int32{ "FORMAT_UNSPECIFIED": 0, "UUID4": 1, "IPV4": 2, "IPV6": 3, "IPV4_OR_IPV6": 4, } ) func (x FieldInfo_Format) Enum() *FieldInfo_Format { p := new(FieldInfo_Format) *p = x return p } func (x FieldInfo_Format) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (FieldInfo_Format) Descriptor() protoreflect.EnumDescriptor { return file_google_api_field_info_proto_enumTypes[0].Descriptor() } func (FieldInfo_Format) Type() protoreflect.EnumType { return &file_google_api_field_info_proto_enumTypes[0] } func (x FieldInfo_Format) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Use FieldInfo_Format.Descriptor instead. func (FieldInfo_Format) EnumDescriptor() ([]byte, []int) { return file_google_api_field_info_proto_rawDescGZIP(), []int{0, 0} } // Rich semantic information of an API field beyond basic typing. type FieldInfo struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // The standard format of a field value. This does not explicitly configure // any API consumer, just documents the API's format for the field it is // applied to. Format FieldInfo_Format `protobuf:"varint,1,opt,name=format,proto3,enum=google.api.FieldInfo_Format" json:"format,omitempty"` // The type(s) that the annotated, generic field may represent. // // Currently, this must only be used on fields of type `google.protobuf.Any`. // Supporting other generic types may be considered in the future. ReferencedTypes []*TypeReference `protobuf:"bytes,2,rep,name=referenced_types,json=referencedTypes,proto3" json:"referenced_types,omitempty"` } func (x *FieldInfo) Reset() { *x = FieldInfo{} if protoimpl.UnsafeEnabled { mi := &file_google_api_field_info_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *FieldInfo) String() string { return protoimpl.X.MessageStringOf(x) } func (*FieldInfo) ProtoMessage() {} func (x *FieldInfo) ProtoReflect() protoreflect.Message { mi := &file_google_api_field_info_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use FieldInfo.ProtoReflect.Descriptor instead. func (*FieldInfo) Descriptor() ([]byte, []int) { return file_google_api_field_info_proto_rawDescGZIP(), []int{0} } func (x *FieldInfo) GetFormat() FieldInfo_Format { if x != nil { return x.Format } return FieldInfo_FORMAT_UNSPECIFIED } func (x *FieldInfo) GetReferencedTypes() []*TypeReference { if x != nil { return x.ReferencedTypes } return nil } // A reference to a message type, for use in [FieldInfo][google.api.FieldInfo]. type TypeReference struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // The name of the type that the annotated, generic field may represent. // If the type is in the same protobuf package, the value can be the simple // message name e.g., `"MyMessage"`. Otherwise, the value must be the // fully-qualified message name e.g., `"google.library.v1.Book"`. // // If the type(s) are unknown to the service (e.g. the field accepts generic // user input), use the wildcard `"*"` to denote this behavior. // // See [AIP-202](https://google.aip.dev/202#type-references) for more details. TypeName string `protobuf:"bytes,1,opt,name=type_name,json=typeName,proto3" json:"type_name,omitempty"` } func (x *TypeReference) Reset() { *x = TypeReference{} if protoimpl.UnsafeEnabled { mi := &file_google_api_field_info_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *TypeReference) String() string { return protoimpl.X.MessageStringOf(x) } func (*TypeReference) ProtoMessage() {} func (x *TypeReference) ProtoReflect() protoreflect.Message { mi := &file_google_api_field_info_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use TypeReference.ProtoReflect.Descriptor instead. func (*TypeReference) Descriptor() ([]byte, []int) { return file_google_api_field_info_proto_rawDescGZIP(), []int{1} } func (x *TypeReference) GetTypeName() string { if x != nil { return x.TypeName } return "" } var file_google_api_field_info_proto_extTypes = []protoimpl.ExtensionInfo{ { ExtendedType: (*descriptorpb.FieldOptions)(nil), ExtensionType: (*FieldInfo)(nil), Field: 291403980, Name: "google.api.field_info", Tag: "bytes,291403980,opt,name=field_info", Filename: "google/api/field_info.proto", }, } // Extension fields to descriptorpb.FieldOptions. var ( // Rich semantic descriptor of an API field beyond the basic typing. // // Examples: // // string request_id = 1 [(google.api.field_info).format = UUID4]; // string old_ip_address = 2 [(google.api.field_info).format = IPV4]; // string new_ip_address = 3 [(google.api.field_info).format = IPV6]; // string actual_ip_address = 4 [ // (google.api.field_info).format = IPV4_OR_IPV6 // ]; // google.protobuf.Any generic_field = 5 [ // (google.api.field_info).referenced_types = {type_name: "ActualType"}, // (google.api.field_info).referenced_types = {type_name: "OtherType"}, // ]; // google.protobuf.Any generic_user_input = 5 [ // (google.api.field_info).referenced_types = {type_name: "*"}, // ]; // // optional google.api.FieldInfo field_info = 291403980; E_FieldInfo = &file_google_api_field_info_proto_extTypes[0] ) var File_google_api_field_info_proto protoreflect.FileDescriptor var file_google_api_field_info_proto_rawDesc = []byte{ 0x0a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xda, 0x01, 0x0a, 0x09, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x34, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x44, 0x0a, 0x10, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x0f, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x64, 0x54, 0x79, 0x70, 0x65, 0x73, 0x22, 0x51, 0x0a, 0x06, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x16, 0x0a, 0x12, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x55, 0x55, 0x49, 0x44, 0x34, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x50, 0x56, 0x34, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x50, 0x56, 0x36, 0x10, 0x03, 0x12, 0x10, 0x0a, 0x0c, 0x49, 0x50, 0x56, 0x34, 0x5f, 0x4f, 0x52, 0x5f, 0x49, 0x50, 0x56, 0x36, 0x10, 0x04, 0x22, 0x2c, 0x0a, 0x0d, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x79, 0x70, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x3a, 0x57, 0x0a, 0x0a, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xcc, 0xf1, 0xf9, 0x8a, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x6c, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x42, 0x0e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0xa2, 0x02, 0x04, 0x47, 0x41, 0x50, 0x49, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_google_api_field_info_proto_rawDescOnce sync.Once file_google_api_field_info_proto_rawDescData = file_google_api_field_info_proto_rawDesc ) func file_google_api_field_info_proto_rawDescGZIP() []byte { file_google_api_field_info_proto_rawDescOnce.Do(func() { file_google_api_field_info_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_api_field_info_proto_rawDescData) }) return file_google_api_field_info_proto_rawDescData } var file_google_api_field_info_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_google_api_field_info_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_google_api_field_info_proto_goTypes = []interface{}{ (FieldInfo_Format)(0), // 0: google.api.FieldInfo.Format (*FieldInfo)(nil), // 1: google.api.FieldInfo (*TypeReference)(nil), // 2: google.api.TypeReference (*descriptorpb.FieldOptions)(nil), // 3: google.protobuf.FieldOptions } var file_google_api_field_info_proto_depIdxs = []int32{ 0, // 0: google.api.FieldInfo.format:type_name -> google.api.FieldInfo.Format 2, // 1: google.api.FieldInfo.referenced_types:type_name -> google.api.TypeReference 3, // 2: google.api.field_info:extendee -> google.protobuf.FieldOptions 1, // 3: google.api.field_info:type_name -> google.api.FieldInfo 4, // [4:4] is the sub-list for method output_type 4, // [4:4] is the sub-list for method input_type 3, // [3:4] is the sub-list for extension type_name 2, // [2:3] is the sub-list for extension extendee 0, // [0:2] is the sub-list for field type_name } func init() { file_google_api_field_info_proto_init() } func file_google_api_field_info_proto_init() { if File_google_api_field_info_proto != nil { return } if !protoimpl.UnsafeEnabled { file_google_api_field_info_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*FieldInfo); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_google_api_field_info_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*TypeReference); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_google_api_field_info_proto_rawDesc, NumEnums: 1, NumMessages: 2, NumExtensions: 1, NumServices: 0, }, GoTypes: file_google_api_field_info_proto_goTypes, DependencyIndexes: file_google_api_field_info_proto_depIdxs, EnumInfos: file_google_api_field_info_proto_enumTypes, MessageInfos: file_google_api_field_info_proto_msgTypes, ExtensionInfos: file_google_api_field_info_proto_extTypes, }.Build() File_google_api_field_info_proto = out.File file_google_api_field_info_proto_rawDesc = nil file_google_api_field_info_proto_goTypes = nil file_google_api_field_info_proto_depIdxs = nil } ================================================ FILE: vendor/google.golang.org/genproto/googleapis/api/annotations/http.pb.go ================================================ // Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 // protoc v4.24.4 // source: google/api/http.proto package annotations import ( reflect "reflect" sync "sync" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) // Defines the HTTP configuration for an API service. It contains a list of // [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method // to one or more HTTP REST API methods. type Http struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // A list of HTTP configuration rules that apply to individual API methods. // // **NOTE:** All service configuration rules follow "last one wins" order. Rules []*HttpRule `protobuf:"bytes,1,rep,name=rules,proto3" json:"rules,omitempty"` // When set to true, URL path parameters will be fully URI-decoded except in // cases of single segment matches in reserved expansion, where "%2F" will be // left encoded. // // The default behavior is to not decode RFC 6570 reserved characters in multi // segment matches. FullyDecodeReservedExpansion bool `protobuf:"varint,2,opt,name=fully_decode_reserved_expansion,json=fullyDecodeReservedExpansion,proto3" json:"fully_decode_reserved_expansion,omitempty"` } func (x *Http) Reset() { *x = Http{} if protoimpl.UnsafeEnabled { mi := &file_google_api_http_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Http) String() string { return protoimpl.X.MessageStringOf(x) } func (*Http) ProtoMessage() {} func (x *Http) ProtoReflect() protoreflect.Message { mi := &file_google_api_http_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Http.ProtoReflect.Descriptor instead. func (*Http) Descriptor() ([]byte, []int) { return file_google_api_http_proto_rawDescGZIP(), []int{0} } func (x *Http) GetRules() []*HttpRule { if x != nil { return x.Rules } return nil } func (x *Http) GetFullyDecodeReservedExpansion() bool { if x != nil { return x.FullyDecodeReservedExpansion } return false } // gRPC Transcoding // // gRPC Transcoding is a feature for mapping between a gRPC method and one or // more HTTP REST endpoints. It allows developers to build a single API service // that supports both gRPC APIs and REST APIs. Many systems, including [Google // APIs](https://github.com/googleapis/googleapis), // [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC // Gateway](https://github.com/grpc-ecosystem/grpc-gateway), // and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature // and use it for large scale production services. // // `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies // how different portions of the gRPC request message are mapped to the URL // path, URL query parameters, and HTTP request body. It also controls how the // gRPC response message is mapped to the HTTP response body. `HttpRule` is // typically specified as an `google.api.http` annotation on the gRPC method. // // Each mapping specifies a URL path template and an HTTP method. The path // template may refer to one or more fields in the gRPC request message, as long // as each field is a non-repeated field with a primitive (non-message) type. // The path template controls how fields of the request message are mapped to // the URL path. // // Example: // // service Messaging { // rpc GetMessage(GetMessageRequest) returns (Message) { // option (google.api.http) = { // get: "/v1/{name=messages/*}" // }; // } // } // message GetMessageRequest { // string name = 1; // Mapped to URL path. // } // message Message { // string text = 1; // The resource content. // } // // This enables an HTTP REST to gRPC mapping as below: // // - HTTP: `GET /v1/messages/123456` // - gRPC: `GetMessage(name: "messages/123456")` // // Any fields in the request message which are not bound by the path template // automatically become HTTP query parameters if there is no HTTP request body. // For example: // // service Messaging { // rpc GetMessage(GetMessageRequest) returns (Message) { // option (google.api.http) = { // get:"/v1/messages/{message_id}" // }; // } // } // message GetMessageRequest { // message SubMessage { // string subfield = 1; // } // string message_id = 1; // Mapped to URL path. // int64 revision = 2; // Mapped to URL query parameter `revision`. // SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. // } // // This enables a HTTP JSON to RPC mapping as below: // // - HTTP: `GET /v1/messages/123456?revision=2&sub.subfield=foo` // - gRPC: `GetMessage(message_id: "123456" revision: 2 sub: // SubMessage(subfield: "foo"))` // // Note that fields which are mapped to URL query parameters must have a // primitive type or a repeated primitive type or a non-repeated message type. // In the case of a repeated type, the parameter can be repeated in the URL // as `...?param=A¶m=B`. In the case of a message type, each field of the // message is mapped to a separate parameter, such as // `...?foo.a=A&foo.b=B&foo.c=C`. // // For HTTP methods that allow a request body, the `body` field // specifies the mapping. Consider a REST update method on the // message resource collection: // // service Messaging { // rpc UpdateMessage(UpdateMessageRequest) returns (Message) { // option (google.api.http) = { // patch: "/v1/messages/{message_id}" // body: "message" // }; // } // } // message UpdateMessageRequest { // string message_id = 1; // mapped to the URL // Message message = 2; // mapped to the body // } // // The following HTTP JSON to RPC mapping is enabled, where the // representation of the JSON in the request body is determined by // protos JSON encoding: // // - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }` // - gRPC: `UpdateMessage(message_id: "123456" message { text: "Hi!" })` // // The special name `*` can be used in the body mapping to define that // every field not bound by the path template should be mapped to the // request body. This enables the following alternative definition of // the update method: // // service Messaging { // rpc UpdateMessage(Message) returns (Message) { // option (google.api.http) = { // patch: "/v1/messages/{message_id}" // body: "*" // }; // } // } // message Message { // string message_id = 1; // string text = 2; // } // // The following HTTP JSON to RPC mapping is enabled: // // - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }` // - gRPC: `UpdateMessage(message_id: "123456" text: "Hi!")` // // Note that when using `*` in the body mapping, it is not possible to // have HTTP parameters, as all fields not bound by the path end in // the body. This makes this option more rarely used in practice when // defining REST APIs. The common usage of `*` is in custom methods // which don't use the URL at all for transferring data. // // It is possible to define multiple HTTP methods for one RPC by using // the `additional_bindings` option. Example: // // service Messaging { // rpc GetMessage(GetMessageRequest) returns (Message) { // option (google.api.http) = { // get: "/v1/messages/{message_id}" // additional_bindings { // get: "/v1/users/{user_id}/messages/{message_id}" // } // }; // } // } // message GetMessageRequest { // string message_id = 1; // string user_id = 2; // } // // This enables the following two alternative HTTP JSON to RPC mappings: // // - HTTP: `GET /v1/messages/123456` // - gRPC: `GetMessage(message_id: "123456")` // // - HTTP: `GET /v1/users/me/messages/123456` // - gRPC: `GetMessage(user_id: "me" message_id: "123456")` // // # Rules for HTTP mapping // // 1. Leaf request fields (recursive expansion nested messages in the request // message) are classified into three categories: // - Fields referred by the path template. They are passed via the URL path. // - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They // are passed via the HTTP // request body. // - All other fields are passed via the URL query parameters, and the // parameter name is the field path in the request message. A repeated // field can be represented as multiple query parameters under the same // name. // 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL // query parameter, all fields // are passed via URL path and HTTP request body. // 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP // request body, all // fields are passed via URL path and URL query parameters. // // Path template syntax // // Template = "/" Segments [ Verb ] ; // Segments = Segment { "/" Segment } ; // Segment = "*" | "**" | LITERAL | Variable ; // Variable = "{" FieldPath [ "=" Segments ] "}" ; // FieldPath = IDENT { "." IDENT } ; // Verb = ":" LITERAL ; // // The syntax `*` matches a single URL path segment. The syntax `**` matches // zero or more URL path segments, which must be the last part of the URL path // except the `Verb`. // // The syntax `Variable` matches part of the URL path as specified by its // template. A variable template must not contain other variables. If a variable // matches a single path segment, its template may be omitted, e.g. `{var}` // is equivalent to `{var=*}`. // // The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` // contains any reserved character, such characters should be percent-encoded // before the matching. // // If a variable contains exactly one path segment, such as `"{var}"` or // `"{var=*}"`, when such a variable is expanded into a URL path on the client // side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The // server side does the reverse decoding. Such variables show up in the // [Discovery // Document](https://developers.google.com/discovery/v1/reference/apis) as // `{var}`. // // If a variable contains multiple path segments, such as `"{var=foo/*}"` // or `"{var=**}"`, when such a variable is expanded into a URL path on the // client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. // The server side does the reverse decoding, except "%2F" and "%2f" are left // unchanged. Such variables show up in the // [Discovery // Document](https://developers.google.com/discovery/v1/reference/apis) as // `{+var}`. // // # Using gRPC API Service Configuration // // gRPC API Service Configuration (service config) is a configuration language // for configuring a gRPC service to become a user-facing product. The // service config is simply the YAML representation of the `google.api.Service` // proto message. // // As an alternative to annotating your proto file, you can configure gRPC // transcoding in your service config YAML files. You do this by specifying a // `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same // effect as the proto annotation. This can be particularly useful if you // have a proto that is reused in multiple services. Note that any transcoding // specified in the service config will override any matching transcoding // configuration in the proto. // // The following example selects a gRPC method and applies an `HttpRule` to it: // // http: // rules: // - selector: example.v1.Messaging.GetMessage // get: /v1/messages/{message_id}/{sub.subfield} // // # Special notes // // When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the // proto to JSON conversion must follow the [proto3 // specification](https://developers.google.com/protocol-buffers/docs/proto3#json). // // While the single segment variable follows the semantics of // [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String // Expansion, the multi segment variable **does not** follow RFC 6570 Section // 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion // does not expand special characters like `?` and `#`, which would lead // to invalid URLs. As the result, gRPC Transcoding uses a custom encoding // for multi segment variables. // // The path variables **must not** refer to any repeated or mapped field, // because client libraries are not capable of handling such variable expansion. // // The path variables **must not** capture the leading "/" character. The reason // is that the most common use case "{var}" does not capture the leading "/" // character. For consistency, all path variables must share the same behavior. // // Repeated message fields must not be mapped to URL query parameters, because // no client library can support such complicated mapping. // // If an API needs to use a JSON array for request or response body, it can map // the request or response body to a repeated field. However, some gRPC // Transcoding implementations may not support this feature. type HttpRule struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Selects a method to which this rule applies. // // Refer to [selector][google.api.DocumentationRule.selector] for syntax // details. Selector string `protobuf:"bytes,1,opt,name=selector,proto3" json:"selector,omitempty"` // Determines the URL pattern is matched by this rules. This pattern can be // used with any of the {get|put|post|delete|patch} methods. A custom method // can be defined using the 'custom' field. // // Types that are assignable to Pattern: // // *HttpRule_Get // *HttpRule_Put // *HttpRule_Post // *HttpRule_Delete // *HttpRule_Patch // *HttpRule_Custom Pattern isHttpRule_Pattern `protobuf_oneof:"pattern"` // The name of the request field whose value is mapped to the HTTP request // body, or `*` for mapping all request fields not captured by the path // pattern to the HTTP body, or omitted for not having any HTTP request body. // // NOTE: the referred field must be present at the top-level of the request // message type. Body string `protobuf:"bytes,7,opt,name=body,proto3" json:"body,omitempty"` // Optional. The name of the response field whose value is mapped to the HTTP // response body. When omitted, the entire response message will be used // as the HTTP response body. // // NOTE: The referred field must be present at the top-level of the response // message type. ResponseBody string `protobuf:"bytes,12,opt,name=response_body,json=responseBody,proto3" json:"response_body,omitempty"` // Additional HTTP bindings for the selector. Nested bindings must // not contain an `additional_bindings` field themselves (that is, // the nesting may only be one level deep). AdditionalBindings []*HttpRule `protobuf:"bytes,11,rep,name=additional_bindings,json=additionalBindings,proto3" json:"additional_bindings,omitempty"` } func (x *HttpRule) Reset() { *x = HttpRule{} if protoimpl.UnsafeEnabled { mi := &file_google_api_http_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *HttpRule) String() string { return protoimpl.X.MessageStringOf(x) } func (*HttpRule) ProtoMessage() {} func (x *HttpRule) ProtoReflect() protoreflect.Message { mi := &file_google_api_http_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use HttpRule.ProtoReflect.Descriptor instead. func (*HttpRule) Descriptor() ([]byte, []int) { return file_google_api_http_proto_rawDescGZIP(), []int{1} } func (x *HttpRule) GetSelector() string { if x != nil { return x.Selector } return "" } func (m *HttpRule) GetPattern() isHttpRule_Pattern { if m != nil { return m.Pattern } return nil } func (x *HttpRule) GetGet() string { if x, ok := x.GetPattern().(*HttpRule_Get); ok { return x.Get } return "" } func (x *HttpRule) GetPut() string { if x, ok := x.GetPattern().(*HttpRule_Put); ok { return x.Put } return "" } func (x *HttpRule) GetPost() string { if x, ok := x.GetPattern().(*HttpRule_Post); ok { return x.Post } return "" } func (x *HttpRule) GetDelete() string { if x, ok := x.GetPattern().(*HttpRule_Delete); ok { return x.Delete } return "" } func (x *HttpRule) GetPatch() string { if x, ok := x.GetPattern().(*HttpRule_Patch); ok { return x.Patch } return "" } func (x *HttpRule) GetCustom() *CustomHttpPattern { if x, ok := x.GetPattern().(*HttpRule_Custom); ok { return x.Custom } return nil } func (x *HttpRule) GetBody() string { if x != nil { return x.Body } return "" } func (x *HttpRule) GetResponseBody() string { if x != nil { return x.ResponseBody } return "" } func (x *HttpRule) GetAdditionalBindings() []*HttpRule { if x != nil { return x.AdditionalBindings } return nil } type isHttpRule_Pattern interface { isHttpRule_Pattern() } type HttpRule_Get struct { // Maps to HTTP GET. Used for listing and getting information about // resources. Get string `protobuf:"bytes,2,opt,name=get,proto3,oneof"` } type HttpRule_Put struct { // Maps to HTTP PUT. Used for replacing a resource. Put string `protobuf:"bytes,3,opt,name=put,proto3,oneof"` } type HttpRule_Post struct { // Maps to HTTP POST. Used for creating a resource or performing an action. Post string `protobuf:"bytes,4,opt,name=post,proto3,oneof"` } type HttpRule_Delete struct { // Maps to HTTP DELETE. Used for deleting a resource. Delete string `protobuf:"bytes,5,opt,name=delete,proto3,oneof"` } type HttpRule_Patch struct { // Maps to HTTP PATCH. Used for updating a resource. Patch string `protobuf:"bytes,6,opt,name=patch,proto3,oneof"` } type HttpRule_Custom struct { // The custom pattern is used for specifying an HTTP method that is not // included in the `pattern` field, such as HEAD, or "*" to leave the // HTTP method unspecified for this rule. The wild-card rule is useful // for services that provide content to Web (HTML) clients. Custom *CustomHttpPattern `protobuf:"bytes,8,opt,name=custom,proto3,oneof"` } func (*HttpRule_Get) isHttpRule_Pattern() {} func (*HttpRule_Put) isHttpRule_Pattern() {} func (*HttpRule_Post) isHttpRule_Pattern() {} func (*HttpRule_Delete) isHttpRule_Pattern() {} func (*HttpRule_Patch) isHttpRule_Pattern() {} func (*HttpRule_Custom) isHttpRule_Pattern() {} // A custom pattern is used for defining custom HTTP verb. type CustomHttpPattern struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // The name of this custom HTTP verb. Kind string `protobuf:"bytes,1,opt,name=kind,proto3" json:"kind,omitempty"` // The path matched by this custom verb. Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` } func (x *CustomHttpPattern) Reset() { *x = CustomHttpPattern{} if protoimpl.UnsafeEnabled { mi := &file_google_api_http_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CustomHttpPattern) String() string { return protoimpl.X.MessageStringOf(x) } func (*CustomHttpPattern) ProtoMessage() {} func (x *CustomHttpPattern) ProtoReflect() protoreflect.Message { mi := &file_google_api_http_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use CustomHttpPattern.ProtoReflect.Descriptor instead. func (*CustomHttpPattern) Descriptor() ([]byte, []int) { return file_google_api_http_proto_rawDescGZIP(), []int{2} } func (x *CustomHttpPattern) GetKind() string { if x != nil { return x.Kind } return "" } func (x *CustomHttpPattern) GetPath() string { if x != nil { return x.Path } return "" } var File_google_api_http_proto protoreflect.FileDescriptor var file_google_api_http_proto_rawDesc = []byte{ 0x0a, 0x15, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x68, 0x74, 0x74, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x22, 0x79, 0x0a, 0x04, 0x48, 0x74, 0x74, 0x70, 0x12, 0x2a, 0x0a, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x45, 0x0a, 0x1f, 0x66, 0x75, 0x6c, 0x6c, 0x79, 0x5f, 0x64, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x5f, 0x65, 0x78, 0x70, 0x61, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1c, 0x66, 0x75, 0x6c, 0x6c, 0x79, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x45, 0x78, 0x70, 0x61, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xda, 0x02, 0x0a, 0x08, 0x48, 0x74, 0x74, 0x70, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x03, 0x67, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x03, 0x67, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x03, 0x70, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x03, 0x70, 0x75, 0x74, 0x12, 0x14, 0x0a, 0x04, 0x70, 0x6f, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, 0x70, 0x6f, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x16, 0x0a, 0x05, 0x70, 0x61, 0x74, 0x63, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x70, 0x61, 0x74, 0x63, 0x68, 0x12, 0x37, 0x0a, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x48, 0x74, 0x74, 0x70, 0x50, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x48, 0x00, 0x52, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x45, 0x0a, 0x13, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x62, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x12, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x42, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x22, 0x3b, 0x0a, 0x11, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x48, 0x74, 0x74, 0x70, 0x50, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x42, 0x67, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x42, 0x09, 0x48, 0x74, 0x74, 0x70, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0xa2, 0x02, 0x04, 0x47, 0x41, 0x50, 0x49, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_google_api_http_proto_rawDescOnce sync.Once file_google_api_http_proto_rawDescData = file_google_api_http_proto_rawDesc ) func file_google_api_http_proto_rawDescGZIP() []byte { file_google_api_http_proto_rawDescOnce.Do(func() { file_google_api_http_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_api_http_proto_rawDescData) }) return file_google_api_http_proto_rawDescData } var file_google_api_http_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_google_api_http_proto_goTypes = []interface{}{ (*Http)(nil), // 0: google.api.Http (*HttpRule)(nil), // 1: google.api.HttpRule (*CustomHttpPattern)(nil), // 2: google.api.CustomHttpPattern } var file_google_api_http_proto_depIdxs = []int32{ 1, // 0: google.api.Http.rules:type_name -> google.api.HttpRule 2, // 1: google.api.HttpRule.custom:type_name -> google.api.CustomHttpPattern 1, // 2: google.api.HttpRule.additional_bindings:type_name -> google.api.HttpRule 3, // [3:3] is the sub-list for method output_type 3, // [3:3] is the sub-list for method input_type 3, // [3:3] is the sub-list for extension type_name 3, // [3:3] is the sub-list for extension extendee 0, // [0:3] is the sub-list for field type_name } func init() { file_google_api_http_proto_init() } func file_google_api_http_proto_init() { if File_google_api_http_proto != nil { return } if !protoimpl.UnsafeEnabled { file_google_api_http_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Http); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_google_api_http_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*HttpRule); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_google_api_http_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CustomHttpPattern); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } file_google_api_http_proto_msgTypes[1].OneofWrappers = []interface{}{ (*HttpRule_Get)(nil), (*HttpRule_Put)(nil), (*HttpRule_Post)(nil), (*HttpRule_Delete)(nil), (*HttpRule_Patch)(nil), (*HttpRule_Custom)(nil), } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_google_api_http_proto_rawDesc, NumEnums: 0, NumMessages: 3, NumExtensions: 0, NumServices: 0, }, GoTypes: file_google_api_http_proto_goTypes, DependencyIndexes: file_google_api_http_proto_depIdxs, MessageInfos: file_google_api_http_proto_msgTypes, }.Build() File_google_api_http_proto = out.File file_google_api_http_proto_rawDesc = nil file_google_api_http_proto_goTypes = nil file_google_api_http_proto_depIdxs = nil } ================================================ FILE: vendor/google.golang.org/genproto/googleapis/api/annotations/resource.pb.go ================================================ // Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 // protoc v4.24.4 // source: google/api/resource.proto package annotations import ( reflect "reflect" sync "sync" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" descriptorpb "google.golang.org/protobuf/types/descriptorpb" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) // A description of the historical or future-looking state of the // resource pattern. type ResourceDescriptor_History int32 const ( // The "unset" value. ResourceDescriptor_HISTORY_UNSPECIFIED ResourceDescriptor_History = 0 // The resource originally had one pattern and launched as such, and // additional patterns were added later. ResourceDescriptor_ORIGINALLY_SINGLE_PATTERN ResourceDescriptor_History = 1 // The resource has one pattern, but the API owner expects to add more // later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents // that from being necessary once there are multiple patterns.) ResourceDescriptor_FUTURE_MULTI_PATTERN ResourceDescriptor_History = 2 ) // Enum value maps for ResourceDescriptor_History. var ( ResourceDescriptor_History_name = map[int32]string{ 0: "HISTORY_UNSPECIFIED", 1: "ORIGINALLY_SINGLE_PATTERN", 2: "FUTURE_MULTI_PATTERN", } ResourceDescriptor_History_value = map[string]int32{ "HISTORY_UNSPECIFIED": 0, "ORIGINALLY_SINGLE_PATTERN": 1, "FUTURE_MULTI_PATTERN": 2, } ) func (x ResourceDescriptor_History) Enum() *ResourceDescriptor_History { p := new(ResourceDescriptor_History) *p = x return p } func (x ResourceDescriptor_History) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (ResourceDescriptor_History) Descriptor() protoreflect.EnumDescriptor { return file_google_api_resource_proto_enumTypes[0].Descriptor() } func (ResourceDescriptor_History) Type() protoreflect.EnumType { return &file_google_api_resource_proto_enumTypes[0] } func (x ResourceDescriptor_History) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Use ResourceDescriptor_History.Descriptor instead. func (ResourceDescriptor_History) EnumDescriptor() ([]byte, []int) { return file_google_api_resource_proto_rawDescGZIP(), []int{0, 0} } // A flag representing a specific style that a resource claims to conform to. type ResourceDescriptor_Style int32 const ( // The unspecified value. Do not use. ResourceDescriptor_STYLE_UNSPECIFIED ResourceDescriptor_Style = 0 // This resource is intended to be "declarative-friendly". // // Declarative-friendly resources must be more strictly consistent, and // setting this to true communicates to tools that this resource should // adhere to declarative-friendly expectations. // // Note: This is used by the API linter (linter.aip.dev) to enable // additional checks. ResourceDescriptor_DECLARATIVE_FRIENDLY ResourceDescriptor_Style = 1 ) // Enum value maps for ResourceDescriptor_Style. var ( ResourceDescriptor_Style_name = map[int32]string{ 0: "STYLE_UNSPECIFIED", 1: "DECLARATIVE_FRIENDLY", } ResourceDescriptor_Style_value = map[string]int32{ "STYLE_UNSPECIFIED": 0, "DECLARATIVE_FRIENDLY": 1, } ) func (x ResourceDescriptor_Style) Enum() *ResourceDescriptor_Style { p := new(ResourceDescriptor_Style) *p = x return p } func (x ResourceDescriptor_Style) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (ResourceDescriptor_Style) Descriptor() protoreflect.EnumDescriptor { return file_google_api_resource_proto_enumTypes[1].Descriptor() } func (ResourceDescriptor_Style) Type() protoreflect.EnumType { return &file_google_api_resource_proto_enumTypes[1] } func (x ResourceDescriptor_Style) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Use ResourceDescriptor_Style.Descriptor instead. func (ResourceDescriptor_Style) EnumDescriptor() ([]byte, []int) { return file_google_api_resource_proto_rawDescGZIP(), []int{0, 1} } // A simple descriptor of a resource type. // // ResourceDescriptor annotates a resource message (either by means of a // protobuf annotation or use in the service config), and associates the // resource's schema, the resource type, and the pattern of the resource name. // // Example: // // message Topic { // // Indicates this message defines a resource schema. // // Declares the resource type in the format of {service}/{kind}. // // For Kubernetes resources, the format is {api group}/{kind}. // option (google.api.resource) = { // type: "pubsub.googleapis.com/Topic" // pattern: "projects/{project}/topics/{topic}" // }; // } // // The ResourceDescriptor Yaml config will look like: // // resources: // - type: "pubsub.googleapis.com/Topic" // pattern: "projects/{project}/topics/{topic}" // // Sometimes, resources have multiple patterns, typically because they can // live under multiple parents. // // Example: // // message LogEntry { // option (google.api.resource) = { // type: "logging.googleapis.com/LogEntry" // pattern: "projects/{project}/logs/{log}" // pattern: "folders/{folder}/logs/{log}" // pattern: "organizations/{organization}/logs/{log}" // pattern: "billingAccounts/{billing_account}/logs/{log}" // }; // } // // The ResourceDescriptor Yaml config will look like: // // resources: // - type: 'logging.googleapis.com/LogEntry' // pattern: "projects/{project}/logs/{log}" // pattern: "folders/{folder}/logs/{log}" // pattern: "organizations/{organization}/logs/{log}" // pattern: "billingAccounts/{billing_account}/logs/{log}" type ResourceDescriptor struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // The resource type. It must be in the format of // {service_name}/{resource_type_kind}. The `resource_type_kind` must be // singular and must not include version numbers. // // Example: `storage.googleapis.com/Bucket` // // The value of the resource_type_kind must follow the regular expression // /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and // should use PascalCase (UpperCamelCase). The maximum number of // characters allowed for the `resource_type_kind` is 100. Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` // Optional. The relative resource name pattern associated with this resource // type. The DNS prefix of the full resource name shouldn't be specified here. // // The path pattern must follow the syntax, which aligns with HTTP binding // syntax: // // Template = Segment { "/" Segment } ; // Segment = LITERAL | Variable ; // Variable = "{" LITERAL "}" ; // // Examples: // // - "projects/{project}/topics/{topic}" // - "projects/{project}/knowledgeBases/{knowledge_base}" // // The components in braces correspond to the IDs for each resource in the // hierarchy. It is expected that, if multiple patterns are provided, // the same component name (e.g. "project") refers to IDs of the same // type of resource. Pattern []string `protobuf:"bytes,2,rep,name=pattern,proto3" json:"pattern,omitempty"` // Optional. The field on the resource that designates the resource name // field. If omitted, this is assumed to be "name". NameField string `protobuf:"bytes,3,opt,name=name_field,json=nameField,proto3" json:"name_field,omitempty"` // Optional. The historical or future-looking state of the resource pattern. // // Example: // // // The InspectTemplate message originally only supported resource // // names with organization, and project was added later. // message InspectTemplate { // option (google.api.resource) = { // type: "dlp.googleapis.com/InspectTemplate" // pattern: // "organizations/{organization}/inspectTemplates/{inspect_template}" // pattern: "projects/{project}/inspectTemplates/{inspect_template}" // history: ORIGINALLY_SINGLE_PATTERN // }; // } History ResourceDescriptor_History `protobuf:"varint,4,opt,name=history,proto3,enum=google.api.ResourceDescriptor_History" json:"history,omitempty"` // The plural name used in the resource name and permission names, such as // 'projects' for the resource name of 'projects/{project}' and the permission // name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception // to this is for Nested Collections that have stuttering names, as defined // in [AIP-122](https://google.aip.dev/122#nested-collections), where the // collection ID in the resource name pattern does not necessarily directly // match the `plural` value. // // It is the same concept of the `plural` field in k8s CRD spec // https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ // // Note: The plural form is required even for singleton resources. See // https://aip.dev/156 Plural string `protobuf:"bytes,5,opt,name=plural,proto3" json:"plural,omitempty"` // The same concept of the `singular` field in k8s CRD spec // https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ // Such as "project" for the `resourcemanager.googleapis.com/Project` type. Singular string `protobuf:"bytes,6,opt,name=singular,proto3" json:"singular,omitempty"` // Style flag(s) for this resource. // These indicate that a resource is expected to conform to a given // style. See the specific style flags for additional information. Style []ResourceDescriptor_Style `protobuf:"varint,10,rep,packed,name=style,proto3,enum=google.api.ResourceDescriptor_Style" json:"style,omitempty"` } func (x *ResourceDescriptor) Reset() { *x = ResourceDescriptor{} if protoimpl.UnsafeEnabled { mi := &file_google_api_resource_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *ResourceDescriptor) String() string { return protoimpl.X.MessageStringOf(x) } func (*ResourceDescriptor) ProtoMessage() {} func (x *ResourceDescriptor) ProtoReflect() protoreflect.Message { mi := &file_google_api_resource_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use ResourceDescriptor.ProtoReflect.Descriptor instead. func (*ResourceDescriptor) Descriptor() ([]byte, []int) { return file_google_api_resource_proto_rawDescGZIP(), []int{0} } func (x *ResourceDescriptor) GetType() string { if x != nil { return x.Type } return "" } func (x *ResourceDescriptor) GetPattern() []string { if x != nil { return x.Pattern } return nil } func (x *ResourceDescriptor) GetNameField() string { if x != nil { return x.NameField } return "" } func (x *ResourceDescriptor) GetHistory() ResourceDescriptor_History { if x != nil { return x.History } return ResourceDescriptor_HISTORY_UNSPECIFIED } func (x *ResourceDescriptor) GetPlural() string { if x != nil { return x.Plural } return "" } func (x *ResourceDescriptor) GetSingular() string { if x != nil { return x.Singular } return "" } func (x *ResourceDescriptor) GetStyle() []ResourceDescriptor_Style { if x != nil { return x.Style } return nil } // Defines a proto annotation that describes a string field that refers to // an API resource. type ResourceReference struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // The resource type that the annotated field references. // // Example: // // message Subscription { // string topic = 2 [(google.api.resource_reference) = { // type: "pubsub.googleapis.com/Topic" // }]; // } // // Occasionally, a field may reference an arbitrary resource. In this case, // APIs use the special value * in their resource reference. // // Example: // // message GetIamPolicyRequest { // string resource = 2 [(google.api.resource_reference) = { // type: "*" // }]; // } Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` // The resource type of a child collection that the annotated field // references. This is useful for annotating the `parent` field that // doesn't have a fixed resource type. // // Example: // // message ListLogEntriesRequest { // string parent = 1 [(google.api.resource_reference) = { // child_type: "logging.googleapis.com/LogEntry" // }; // } ChildType string `protobuf:"bytes,2,opt,name=child_type,json=childType,proto3" json:"child_type,omitempty"` } func (x *ResourceReference) Reset() { *x = ResourceReference{} if protoimpl.UnsafeEnabled { mi := &file_google_api_resource_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *ResourceReference) String() string { return protoimpl.X.MessageStringOf(x) } func (*ResourceReference) ProtoMessage() {} func (x *ResourceReference) ProtoReflect() protoreflect.Message { mi := &file_google_api_resource_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use ResourceReference.ProtoReflect.Descriptor instead. func (*ResourceReference) Descriptor() ([]byte, []int) { return file_google_api_resource_proto_rawDescGZIP(), []int{1} } func (x *ResourceReference) GetType() string { if x != nil { return x.Type } return "" } func (x *ResourceReference) GetChildType() string { if x != nil { return x.ChildType } return "" } var file_google_api_resource_proto_extTypes = []protoimpl.ExtensionInfo{ { ExtendedType: (*descriptorpb.FieldOptions)(nil), ExtensionType: (*ResourceReference)(nil), Field: 1055, Name: "google.api.resource_reference", Tag: "bytes,1055,opt,name=resource_reference", Filename: "google/api/resource.proto", }, { ExtendedType: (*descriptorpb.FileOptions)(nil), ExtensionType: ([]*ResourceDescriptor)(nil), Field: 1053, Name: "google.api.resource_definition", Tag: "bytes,1053,rep,name=resource_definition", Filename: "google/api/resource.proto", }, { ExtendedType: (*descriptorpb.MessageOptions)(nil), ExtensionType: (*ResourceDescriptor)(nil), Field: 1053, Name: "google.api.resource", Tag: "bytes,1053,opt,name=resource", Filename: "google/api/resource.proto", }, } // Extension fields to descriptorpb.FieldOptions. var ( // An annotation that describes a resource reference, see // [ResourceReference][]. // // optional google.api.ResourceReference resource_reference = 1055; E_ResourceReference = &file_google_api_resource_proto_extTypes[0] ) // Extension fields to descriptorpb.FileOptions. var ( // An annotation that describes a resource definition without a corresponding // message; see [ResourceDescriptor][]. // // repeated google.api.ResourceDescriptor resource_definition = 1053; E_ResourceDefinition = &file_google_api_resource_proto_extTypes[1] ) // Extension fields to descriptorpb.MessageOptions. var ( // An annotation that describes a resource definition, see // [ResourceDescriptor][]. // // optional google.api.ResourceDescriptor resource = 1053; E_Resource = &file_google_api_resource_proto_extTypes[2] ) var File_google_api_resource_proto protoreflect.FileDescriptor var file_google_api_resource_proto_rawDesc = []byte{ 0x0a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xaa, 0x03, 0x0a, 0x12, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x40, 0x0a, 0x07, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x07, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x6c, 0x75, 0x72, 0x61, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x6c, 0x75, 0x72, 0x61, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x69, 0x6e, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x69, 0x6e, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x12, 0x3a, 0x0a, 0x05, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x52, 0x05, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x22, 0x5b, 0x0a, 0x07, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x17, 0x0a, 0x13, 0x48, 0x49, 0x53, 0x54, 0x4f, 0x52, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1d, 0x0a, 0x19, 0x4f, 0x52, 0x49, 0x47, 0x49, 0x4e, 0x41, 0x4c, 0x4c, 0x59, 0x5f, 0x53, 0x49, 0x4e, 0x47, 0x4c, 0x45, 0x5f, 0x50, 0x41, 0x54, 0x54, 0x45, 0x52, 0x4e, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x46, 0x55, 0x54, 0x55, 0x52, 0x45, 0x5f, 0x4d, 0x55, 0x4c, 0x54, 0x49, 0x5f, 0x50, 0x41, 0x54, 0x54, 0x45, 0x52, 0x4e, 0x10, 0x02, 0x22, 0x38, 0x0a, 0x05, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x54, 0x59, 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x18, 0x0a, 0x14, 0x44, 0x45, 0x43, 0x4c, 0x41, 0x52, 0x41, 0x54, 0x49, 0x56, 0x45, 0x5f, 0x46, 0x52, 0x49, 0x45, 0x4e, 0x44, 0x4c, 0x59, 0x10, 0x01, 0x22, 0x46, 0x0a, 0x11, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x6c, 0x0a, 0x12, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x9f, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x11, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x3a, 0x6e, 0x0a, 0x13, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x9d, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x12, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x5c, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x9d, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x6b, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x42, 0x0d, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0xa2, 0x02, 0x04, 0x47, 0x41, 0x50, 0x49, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_google_api_resource_proto_rawDescOnce sync.Once file_google_api_resource_proto_rawDescData = file_google_api_resource_proto_rawDesc ) func file_google_api_resource_proto_rawDescGZIP() []byte { file_google_api_resource_proto_rawDescOnce.Do(func() { file_google_api_resource_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_api_resource_proto_rawDescData) }) return file_google_api_resource_proto_rawDescData } var file_google_api_resource_proto_enumTypes = make([]protoimpl.EnumInfo, 2) var file_google_api_resource_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_google_api_resource_proto_goTypes = []interface{}{ (ResourceDescriptor_History)(0), // 0: google.api.ResourceDescriptor.History (ResourceDescriptor_Style)(0), // 1: google.api.ResourceDescriptor.Style (*ResourceDescriptor)(nil), // 2: google.api.ResourceDescriptor (*ResourceReference)(nil), // 3: google.api.ResourceReference (*descriptorpb.FieldOptions)(nil), // 4: google.protobuf.FieldOptions (*descriptorpb.FileOptions)(nil), // 5: google.protobuf.FileOptions (*descriptorpb.MessageOptions)(nil), // 6: google.protobuf.MessageOptions } var file_google_api_resource_proto_depIdxs = []int32{ 0, // 0: google.api.ResourceDescriptor.history:type_name -> google.api.ResourceDescriptor.History 1, // 1: google.api.ResourceDescriptor.style:type_name -> google.api.ResourceDescriptor.Style 4, // 2: google.api.resource_reference:extendee -> google.protobuf.FieldOptions 5, // 3: google.api.resource_definition:extendee -> google.protobuf.FileOptions 6, // 4: google.api.resource:extendee -> google.protobuf.MessageOptions 3, // 5: google.api.resource_reference:type_name -> google.api.ResourceReference 2, // 6: google.api.resource_definition:type_name -> google.api.ResourceDescriptor 2, // 7: google.api.resource:type_name -> google.api.ResourceDescriptor 8, // [8:8] is the sub-list for method output_type 8, // [8:8] is the sub-list for method input_type 5, // [5:8] is the sub-list for extension type_name 2, // [2:5] is the sub-list for extension extendee 0, // [0:2] is the sub-list for field type_name } func init() { file_google_api_resource_proto_init() } func file_google_api_resource_proto_init() { if File_google_api_resource_proto != nil { return } if !protoimpl.UnsafeEnabled { file_google_api_resource_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ResourceDescriptor); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_google_api_resource_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ResourceReference); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_google_api_resource_proto_rawDesc, NumEnums: 2, NumMessages: 2, NumExtensions: 3, NumServices: 0, }, GoTypes: file_google_api_resource_proto_goTypes, DependencyIndexes: file_google_api_resource_proto_depIdxs, EnumInfos: file_google_api_resource_proto_enumTypes, MessageInfos: file_google_api_resource_proto_msgTypes, ExtensionInfos: file_google_api_resource_proto_extTypes, }.Build() File_google_api_resource_proto = out.File file_google_api_resource_proto_rawDesc = nil file_google_api_resource_proto_goTypes = nil file_google_api_resource_proto_depIdxs = nil } ================================================ FILE: vendor/google.golang.org/genproto/googleapis/api/annotations/routing.pb.go ================================================ // Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 // protoc v4.24.4 // source: google/api/routing.proto package annotations import ( reflect "reflect" sync "sync" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" descriptorpb "google.golang.org/protobuf/types/descriptorpb" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) // Specifies the routing information that should be sent along with the request // in the form of routing header. // **NOTE:** All service configuration rules follow the "last one wins" order. // // The examples below will apply to an RPC which has the following request type: // // Message Definition: // // message Request { // // The name of the Table // // Values can be of the following formats: // // - `projects//tables/` // // - `projects//instances//tables/
` // // - `region//zones//tables/
` // string table_name = 1; // // // This value specifies routing for replication. // // It can be in the following formats: // // - `profiles/` // // - a legacy `profile_id` that can be any string // string app_profile_id = 2; // } // // Example message: // // { // table_name: projects/proj_foo/instances/instance_bar/table/table_baz, // app_profile_id: profiles/prof_qux // } // // The routing header consists of one or multiple key-value pairs. Every key // and value must be percent-encoded, and joined together in the format of // `key1=value1&key2=value2`. // The examples below skip the percent-encoding for readability. // // # Example 1 // // Extracting a field from the request to put into the routing header // unchanged, with the key equal to the field name. // // annotation: // // option (google.api.routing) = { // // Take the `app_profile_id`. // routing_parameters { // field: "app_profile_id" // } // }; // // result: // // x-goog-request-params: app_profile_id=profiles/prof_qux // // # Example 2 // // Extracting a field from the request to put into the routing header // unchanged, with the key different from the field name. // // annotation: // // option (google.api.routing) = { // // Take the `app_profile_id`, but name it `routing_id` in the header. // routing_parameters { // field: "app_profile_id" // path_template: "{routing_id=**}" // } // }; // // result: // // x-goog-request-params: routing_id=profiles/prof_qux // // # Example 3 // // Extracting a field from the request to put into the routing // header, while matching a path template syntax on the field's value. // // NB: it is more useful to send nothing than to send garbage for the purpose // of dynamic routing, since garbage pollutes cache. Thus the matching. // // # Sub-example 3a // // The field matches the template. // // annotation: // // option (google.api.routing) = { // // Take the `table_name`, if it's well-formed (with project-based // // syntax). // routing_parameters { // field: "table_name" // path_template: "{table_name=projects/*/instances/*/**}" // } // }; // // result: // // x-goog-request-params: // table_name=projects/proj_foo/instances/instance_bar/table/table_baz // // # Sub-example 3b // // The field does not match the template. // // annotation: // // option (google.api.routing) = { // // Take the `table_name`, if it's well-formed (with region-based // // syntax). // routing_parameters { // field: "table_name" // path_template: "{table_name=regions/*/zones/*/**}" // } // }; // // result: // // // // # Sub-example 3c // // Multiple alternative conflictingly named path templates are // specified. The one that matches is used to construct the header. // // annotation: // // option (google.api.routing) = { // // Take the `table_name`, if it's well-formed, whether // // using the region- or projects-based syntax. // // routing_parameters { // field: "table_name" // path_template: "{table_name=regions/*/zones/*/**}" // } // routing_parameters { // field: "table_name" // path_template: "{table_name=projects/*/instances/*/**}" // } // }; // // result: // // x-goog-request-params: // table_name=projects/proj_foo/instances/instance_bar/table/table_baz // // # Example 4 // // Extracting a single routing header key-value pair by matching a // template syntax on (a part of) a single request field. // // annotation: // // option (google.api.routing) = { // // Take just the project id from the `table_name` field. // routing_parameters { // field: "table_name" // path_template: "{routing_id=projects/*}/**" // } // }; // // result: // // x-goog-request-params: routing_id=projects/proj_foo // // # Example 5 // // Extracting a single routing header key-value pair by matching // several conflictingly named path templates on (parts of) a single request // field. The last template to match "wins" the conflict. // // annotation: // // option (google.api.routing) = { // // If the `table_name` does not have instances information, // // take just the project id for routing. // // Otherwise take project + instance. // // routing_parameters { // field: "table_name" // path_template: "{routing_id=projects/*}/**" // } // routing_parameters { // field: "table_name" // path_template: "{routing_id=projects/*/instances/*}/**" // } // }; // // result: // // x-goog-request-params: // routing_id=projects/proj_foo/instances/instance_bar // // # Example 6 // // Extracting multiple routing header key-value pairs by matching // several non-conflicting path templates on (parts of) a single request field. // // # Sub-example 6a // // Make the templates strict, so that if the `table_name` does not // have an instance information, nothing is sent. // // annotation: // // option (google.api.routing) = { // // The routing code needs two keys instead of one composite // // but works only for the tables with the "project-instance" name // // syntax. // // routing_parameters { // field: "table_name" // path_template: "{project_id=projects/*}/instances/*/**" // } // routing_parameters { // field: "table_name" // path_template: "projects/*/{instance_id=instances/*}/**" // } // }; // // result: // // x-goog-request-params: // project_id=projects/proj_foo&instance_id=instances/instance_bar // // # Sub-example 6b // // Make the templates loose, so that if the `table_name` does not // have an instance information, just the project id part is sent. // // annotation: // // option (google.api.routing) = { // // The routing code wants two keys instead of one composite // // but will work with just the `project_id` for tables without // // an instance in the `table_name`. // // routing_parameters { // field: "table_name" // path_template: "{project_id=projects/*}/**" // } // routing_parameters { // field: "table_name" // path_template: "projects/*/{instance_id=instances/*}/**" // } // }; // // result (is the same as 6a for our example message because it has the instance // information): // // x-goog-request-params: // project_id=projects/proj_foo&instance_id=instances/instance_bar // // # Example 7 // // Extracting multiple routing header key-value pairs by matching // several path templates on multiple request fields. // // NB: note that here there is no way to specify sending nothing if one of the // fields does not match its template. E.g. if the `table_name` is in the wrong // format, the `project_id` will not be sent, but the `routing_id` will be. // The backend routing code has to be aware of that and be prepared to not // receive a full complement of keys if it expects multiple. // // annotation: // // option (google.api.routing) = { // // The routing needs both `project_id` and `routing_id` // // (from the `app_profile_id` field) for routing. // // routing_parameters { // field: "table_name" // path_template: "{project_id=projects/*}/**" // } // routing_parameters { // field: "app_profile_id" // path_template: "{routing_id=**}" // } // }; // // result: // // x-goog-request-params: // project_id=projects/proj_foo&routing_id=profiles/prof_qux // // # Example 8 // // Extracting a single routing header key-value pair by matching // several conflictingly named path templates on several request fields. The // last template to match "wins" the conflict. // // annotation: // // option (google.api.routing) = { // // The `routing_id` can be a project id or a region id depending on // // the table name format, but only if the `app_profile_id` is not set. // // If `app_profile_id` is set it should be used instead. // // routing_parameters { // field: "table_name" // path_template: "{routing_id=projects/*}/**" // } // routing_parameters { // field: "table_name" // path_template: "{routing_id=regions/*}/**" // } // routing_parameters { // field: "app_profile_id" // path_template: "{routing_id=**}" // } // }; // // result: // // x-goog-request-params: routing_id=profiles/prof_qux // // # Example 9 // // Bringing it all together. // // annotation: // // option (google.api.routing) = { // // For routing both `table_location` and a `routing_id` are needed. // // // // table_location can be either an instance id or a region+zone id. // // // // For `routing_id`, take the value of `app_profile_id` // // - If it's in the format `profiles/`, send // // just the `` part. // // - If it's any other literal, send it as is. // // If the `app_profile_id` is empty, and the `table_name` starts with // // the project_id, send that instead. // // routing_parameters { // field: "table_name" // path_template: "projects/*/{table_location=instances/*}/tables/*" // } // routing_parameters { // field: "table_name" // path_template: "{table_location=regions/*/zones/*}/tables/*" // } // routing_parameters { // field: "table_name" // path_template: "{routing_id=projects/*}/**" // } // routing_parameters { // field: "app_profile_id" // path_template: "{routing_id=**}" // } // routing_parameters { // field: "app_profile_id" // path_template: "profiles/{routing_id=*}" // } // }; // // result: // // x-goog-request-params: // table_location=instances/instance_bar&routing_id=prof_qux type RoutingRule struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // A collection of Routing Parameter specifications. // **NOTE:** If multiple Routing Parameters describe the same key // (via the `path_template` field or via the `field` field when // `path_template` is not provided), "last one wins" rule // determines which Parameter gets used. // See the examples for more details. RoutingParameters []*RoutingParameter `protobuf:"bytes,2,rep,name=routing_parameters,json=routingParameters,proto3" json:"routing_parameters,omitempty"` } func (x *RoutingRule) Reset() { *x = RoutingRule{} if protoimpl.UnsafeEnabled { mi := &file_google_api_routing_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *RoutingRule) String() string { return protoimpl.X.MessageStringOf(x) } func (*RoutingRule) ProtoMessage() {} func (x *RoutingRule) ProtoReflect() protoreflect.Message { mi := &file_google_api_routing_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use RoutingRule.ProtoReflect.Descriptor instead. func (*RoutingRule) Descriptor() ([]byte, []int) { return file_google_api_routing_proto_rawDescGZIP(), []int{0} } func (x *RoutingRule) GetRoutingParameters() []*RoutingParameter { if x != nil { return x.RoutingParameters } return nil } // A projection from an input message to the GRPC or REST header. type RoutingParameter struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // A request field to extract the header key-value pair from. Field string `protobuf:"bytes,1,opt,name=field,proto3" json:"field,omitempty"` // A pattern matching the key-value field. Optional. // If not specified, the whole field specified in the `field` field will be // taken as value, and its name used as key. If specified, it MUST contain // exactly one named segment (along with any number of unnamed segments) The // pattern will be matched over the field specified in the `field` field, then // if the match is successful: // - the name of the single named segment will be used as a header name, // - the match value of the segment will be used as a header value; // if the match is NOT successful, nothing will be sent. // // Example: // // -- This is a field in the request message // | that the header value will be extracted from. // | // | -- This is the key name in the // | | routing header. // V | // field: "table_name" v // path_template: "projects/*/{table_location=instances/*}/tables/*" // ^ ^ // | | // In the {} brackets is the pattern that -- | // specifies what to extract from the | // field as a value to be sent. | // | // The string in the field must match the whole pattern -- // before brackets, inside brackets, after brackets. // // When looking at this specific example, we can see that: // - A key-value pair with the key `table_location` // and the value matching `instances/*` should be added // to the x-goog-request-params routing header. // - The value is extracted from the request message's `table_name` field // if it matches the full pattern specified: // `projects/*/instances/*/tables/*`. // // **NB:** If the `path_template` field is not provided, the key name is // equal to the field name, and the whole field should be sent as a value. // This makes the pattern for the field and the value functionally equivalent // to `**`, and the configuration // // { // field: "table_name" // } // // is a functionally equivalent shorthand to: // // { // field: "table_name" // path_template: "{table_name=**}" // } // // See Example 1 for more details. PathTemplate string `protobuf:"bytes,2,opt,name=path_template,json=pathTemplate,proto3" json:"path_template,omitempty"` } func (x *RoutingParameter) Reset() { *x = RoutingParameter{} if protoimpl.UnsafeEnabled { mi := &file_google_api_routing_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *RoutingParameter) String() string { return protoimpl.X.MessageStringOf(x) } func (*RoutingParameter) ProtoMessage() {} func (x *RoutingParameter) ProtoReflect() protoreflect.Message { mi := &file_google_api_routing_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use RoutingParameter.ProtoReflect.Descriptor instead. func (*RoutingParameter) Descriptor() ([]byte, []int) { return file_google_api_routing_proto_rawDescGZIP(), []int{1} } func (x *RoutingParameter) GetField() string { if x != nil { return x.Field } return "" } func (x *RoutingParameter) GetPathTemplate() string { if x != nil { return x.PathTemplate } return "" } var file_google_api_routing_proto_extTypes = []protoimpl.ExtensionInfo{ { ExtendedType: (*descriptorpb.MethodOptions)(nil), ExtensionType: (*RoutingRule)(nil), Field: 72295729, Name: "google.api.routing", Tag: "bytes,72295729,opt,name=routing", Filename: "google/api/routing.proto", }, } // Extension fields to descriptorpb.MethodOptions. var ( // See RoutingRule. // // optional google.api.RoutingRule routing = 72295729; E_Routing = &file_google_api_routing_proto_extTypes[0] ) var File_google_api_routing_proto protoreflect.FileDescriptor var file_google_api_routing_proto_rawDesc = []byte{ 0x0a, 0x18, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5a, 0x0a, 0x0b, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x4b, 0x0a, 0x12, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x52, 0x11, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x22, 0x4d, 0x0a, 0x10, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x61, 0x74, 0x68, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x61, 0x74, 0x68, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x3a, 0x54, 0x0a, 0x07, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xb1, 0xca, 0xbc, 0x22, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x07, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x42, 0x6a, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x42, 0x0c, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0xa2, 0x02, 0x04, 0x47, 0x41, 0x50, 0x49, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_google_api_routing_proto_rawDescOnce sync.Once file_google_api_routing_proto_rawDescData = file_google_api_routing_proto_rawDesc ) func file_google_api_routing_proto_rawDescGZIP() []byte { file_google_api_routing_proto_rawDescOnce.Do(func() { file_google_api_routing_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_api_routing_proto_rawDescData) }) return file_google_api_routing_proto_rawDescData } var file_google_api_routing_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_google_api_routing_proto_goTypes = []interface{}{ (*RoutingRule)(nil), // 0: google.api.RoutingRule (*RoutingParameter)(nil), // 1: google.api.RoutingParameter (*descriptorpb.MethodOptions)(nil), // 2: google.protobuf.MethodOptions } var file_google_api_routing_proto_depIdxs = []int32{ 1, // 0: google.api.RoutingRule.routing_parameters:type_name -> google.api.RoutingParameter 2, // 1: google.api.routing:extendee -> google.protobuf.MethodOptions 0, // 2: google.api.routing:type_name -> google.api.RoutingRule 3, // [3:3] is the sub-list for method output_type 3, // [3:3] is the sub-list for method input_type 2, // [2:3] is the sub-list for extension type_name 1, // [1:2] is the sub-list for extension extendee 0, // [0:1] is the sub-list for field type_name } func init() { file_google_api_routing_proto_init() } func file_google_api_routing_proto_init() { if File_google_api_routing_proto != nil { return } if !protoimpl.UnsafeEnabled { file_google_api_routing_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RoutingRule); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_google_api_routing_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RoutingParameter); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_google_api_routing_proto_rawDesc, NumEnums: 0, NumMessages: 2, NumExtensions: 1, NumServices: 0, }, GoTypes: file_google_api_routing_proto_goTypes, DependencyIndexes: file_google_api_routing_proto_depIdxs, MessageInfos: file_google_api_routing_proto_msgTypes, ExtensionInfos: file_google_api_routing_proto_extTypes, }.Build() File_google_api_routing_proto = out.File file_google_api_routing_proto_rawDesc = nil file_google_api_routing_proto_goTypes = nil file_google_api_routing_proto_depIdxs = nil } ================================================ FILE: vendor/google.golang.org/genproto/googleapis/api/launch_stage.pb.go ================================================ // Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 // protoc v4.24.4 // source: google/api/launch_stage.proto package api import ( reflect "reflect" sync "sync" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) // The launch stage as defined by [Google Cloud Platform // Launch Stages](https://cloud.google.com/terms/launch-stages). type LaunchStage int32 const ( // Do not use this default value. LaunchStage_LAUNCH_STAGE_UNSPECIFIED LaunchStage = 0 // The feature is not yet implemented. Users can not use it. LaunchStage_UNIMPLEMENTED LaunchStage = 6 // Prelaunch features are hidden from users and are only visible internally. LaunchStage_PRELAUNCH LaunchStage = 7 // Early Access features are limited to a closed group of testers. To use // these features, you must sign up in advance and sign a Trusted Tester // agreement (which includes confidentiality provisions). These features may // be unstable, changed in backward-incompatible ways, and are not // guaranteed to be released. LaunchStage_EARLY_ACCESS LaunchStage = 1 // Alpha is a limited availability test for releases before they are cleared // for widespread use. By Alpha, all significant design issues are resolved // and we are in the process of verifying functionality. Alpha customers // need to apply for access, agree to applicable terms, and have their // projects allowlisted. Alpha releases don't have to be feature complete, // no SLAs are provided, and there are no technical support obligations, but // they will be far enough along that customers can actually use them in // test environments or for limited-use tests -- just like they would in // normal production cases. LaunchStage_ALPHA LaunchStage = 2 // Beta is the point at which we are ready to open a release for any // customer to use. There are no SLA or technical support obligations in a // Beta release. Products will be complete from a feature perspective, but // may have some open outstanding issues. Beta releases are suitable for // limited production use cases. LaunchStage_BETA LaunchStage = 3 // GA features are open to all developers and are considered stable and // fully qualified for production use. LaunchStage_GA LaunchStage = 4 // Deprecated features are scheduled to be shut down and removed. For more // information, see the "Deprecation Policy" section of our [Terms of // Service](https://cloud.google.com/terms/) // and the [Google Cloud Platform Subject to the Deprecation // Policy](https://cloud.google.com/terms/deprecation) documentation. LaunchStage_DEPRECATED LaunchStage = 5 ) // Enum value maps for LaunchStage. var ( LaunchStage_name = map[int32]string{ 0: "LAUNCH_STAGE_UNSPECIFIED", 6: "UNIMPLEMENTED", 7: "PRELAUNCH", 1: "EARLY_ACCESS", 2: "ALPHA", 3: "BETA", 4: "GA", 5: "DEPRECATED", } LaunchStage_value = map[string]int32{ "LAUNCH_STAGE_UNSPECIFIED": 0, "UNIMPLEMENTED": 6, "PRELAUNCH": 7, "EARLY_ACCESS": 1, "ALPHA": 2, "BETA": 3, "GA": 4, "DEPRECATED": 5, } ) func (x LaunchStage) Enum() *LaunchStage { p := new(LaunchStage) *p = x return p } func (x LaunchStage) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (LaunchStage) Descriptor() protoreflect.EnumDescriptor { return file_google_api_launch_stage_proto_enumTypes[0].Descriptor() } func (LaunchStage) Type() protoreflect.EnumType { return &file_google_api_launch_stage_proto_enumTypes[0] } func (x LaunchStage) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Use LaunchStage.Descriptor instead. func (LaunchStage) EnumDescriptor() ([]byte, []int) { return file_google_api_launch_stage_proto_rawDescGZIP(), []int{0} } var File_google_api_launch_stage_proto protoreflect.FileDescriptor var file_google_api_launch_stage_proto_rawDesc = []byte{ 0x0a, 0x1d, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x5f, 0x73, 0x74, 0x61, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2a, 0x8c, 0x01, 0x0a, 0x0b, 0x4c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x53, 0x74, 0x61, 0x67, 0x65, 0x12, 0x1c, 0x0a, 0x18, 0x4c, 0x41, 0x55, 0x4e, 0x43, 0x48, 0x5f, 0x53, 0x54, 0x41, 0x47, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x55, 0x4e, 0x49, 0x4d, 0x50, 0x4c, 0x45, 0x4d, 0x45, 0x4e, 0x54, 0x45, 0x44, 0x10, 0x06, 0x12, 0x0d, 0x0a, 0x09, 0x50, 0x52, 0x45, 0x4c, 0x41, 0x55, 0x4e, 0x43, 0x48, 0x10, 0x07, 0x12, 0x10, 0x0a, 0x0c, 0x45, 0x41, 0x52, 0x4c, 0x59, 0x5f, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x4c, 0x50, 0x48, 0x41, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x42, 0x45, 0x54, 0x41, 0x10, 0x03, 0x12, 0x06, 0x0a, 0x02, 0x47, 0x41, 0x10, 0x04, 0x12, 0x0e, 0x0a, 0x0a, 0x44, 0x45, 0x50, 0x52, 0x45, 0x43, 0x41, 0x54, 0x45, 0x44, 0x10, 0x05, 0x42, 0x5a, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x42, 0x10, 0x4c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x53, 0x74, 0x61, 0x67, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2d, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x3b, 0x61, 0x70, 0x69, 0xa2, 0x02, 0x04, 0x47, 0x41, 0x50, 0x49, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_google_api_launch_stage_proto_rawDescOnce sync.Once file_google_api_launch_stage_proto_rawDescData = file_google_api_launch_stage_proto_rawDesc ) func file_google_api_launch_stage_proto_rawDescGZIP() []byte { file_google_api_launch_stage_proto_rawDescOnce.Do(func() { file_google_api_launch_stage_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_api_launch_stage_proto_rawDescData) }) return file_google_api_launch_stage_proto_rawDescData } var file_google_api_launch_stage_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_google_api_launch_stage_proto_goTypes = []interface{}{ (LaunchStage)(0), // 0: google.api.LaunchStage } var file_google_api_launch_stage_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name } func init() { file_google_api_launch_stage_proto_init() } func file_google_api_launch_stage_proto_init() { if File_google_api_launch_stage_proto != nil { return } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_google_api_launch_stage_proto_rawDesc, NumEnums: 1, NumMessages: 0, NumExtensions: 0, NumServices: 0, }, GoTypes: file_google_api_launch_stage_proto_goTypes, DependencyIndexes: file_google_api_launch_stage_proto_depIdxs, EnumInfos: file_google_api_launch_stage_proto_enumTypes, }.Build() File_google_api_launch_stage_proto = out.File file_google_api_launch_stage_proto_rawDesc = nil file_google_api_launch_stage_proto_goTypes = nil file_google_api_launch_stage_proto_depIdxs = nil } ================================================ FILE: vendor/google.golang.org/genproto/googleapis/rpc/LICENSE ================================================ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: vendor/google.golang.org/genproto/googleapis/rpc/status/status.pb.go ================================================ // Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 // protoc v4.24.4 // source: google/rpc/status.proto package status import ( reflect "reflect" sync "sync" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" anypb "google.golang.org/protobuf/types/known/anypb" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) // The `Status` type defines a logical error model that is suitable for // different programming environments, including REST APIs and RPC APIs. It is // used by [gRPC](https://github.com/grpc). Each `Status` message contains // three pieces of data: error code, error message, and error details. // // You can find out more about this error model and how to work with it in the // [API Design Guide](https://cloud.google.com/apis/design/errors). type Status struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // The status code, which should be an enum value of // [google.rpc.Code][google.rpc.Code]. Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` // A developer-facing error message, which should be in English. Any // user-facing error message should be localized and sent in the // [google.rpc.Status.details][google.rpc.Status.details] field, or localized // by the client. Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` // A list of messages that carry the error details. There is a common set of // message types for APIs to use. Details []*anypb.Any `protobuf:"bytes,3,rep,name=details,proto3" json:"details,omitempty"` } func (x *Status) Reset() { *x = Status{} if protoimpl.UnsafeEnabled { mi := &file_google_rpc_status_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Status) String() string { return protoimpl.X.MessageStringOf(x) } func (*Status) ProtoMessage() {} func (x *Status) ProtoReflect() protoreflect.Message { mi := &file_google_rpc_status_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Status.ProtoReflect.Descriptor instead. func (*Status) Descriptor() ([]byte, []int) { return file_google_rpc_status_proto_rawDescGZIP(), []int{0} } func (x *Status) GetCode() int32 { if x != nil { return x.Code } return 0 } func (x *Status) GetMessage() string { if x != nil { return x.Message } return "" } func (x *Status) GetDetails() []*anypb.Any { if x != nil { return x.Details } return nil } var File_google_rpc_status_proto protoreflect.FileDescriptor var file_google_rpc_status_proto_rawDesc = []byte{ 0x0a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x66, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x2e, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x42, 0x61, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, 0x42, 0x0b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x37, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x3b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0xf8, 0x01, 0x01, 0xa2, 0x02, 0x03, 0x52, 0x50, 0x43, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_google_rpc_status_proto_rawDescOnce sync.Once file_google_rpc_status_proto_rawDescData = file_google_rpc_status_proto_rawDesc ) func file_google_rpc_status_proto_rawDescGZIP() []byte { file_google_rpc_status_proto_rawDescOnce.Do(func() { file_google_rpc_status_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_rpc_status_proto_rawDescData) }) return file_google_rpc_status_proto_rawDescData } var file_google_rpc_status_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_google_rpc_status_proto_goTypes = []interface{}{ (*Status)(nil), // 0: google.rpc.Status (*anypb.Any)(nil), // 1: google.protobuf.Any } var file_google_rpc_status_proto_depIdxs = []int32{ 1, // 0: google.rpc.Status.details:type_name -> google.protobuf.Any 1, // [1:1] is the sub-list for method output_type 1, // [1:1] is the sub-list for method input_type 1, // [1:1] is the sub-list for extension type_name 1, // [1:1] is the sub-list for extension extendee 0, // [0:1] is the sub-list for field type_name } func init() { file_google_rpc_status_proto_init() } func file_google_rpc_status_proto_init() { if File_google_rpc_status_proto != nil { return } if !protoimpl.UnsafeEnabled { file_google_rpc_status_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Status); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_google_rpc_status_proto_rawDesc, NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, GoTypes: file_google_rpc_status_proto_goTypes, DependencyIndexes: file_google_rpc_status_proto_depIdxs, MessageInfos: file_google_rpc_status_proto_msgTypes, }.Build() File_google_rpc_status_proto = out.File file_google_rpc_status_proto_rawDesc = nil file_google_rpc_status_proto_goTypes = nil file_google_rpc_status_proto_depIdxs = nil } ================================================ FILE: vendor/google.golang.org/grpc/AUTHORS ================================================ Google Inc. ================================================ FILE: vendor/google.golang.org/grpc/CODE-OF-CONDUCT.md ================================================ ## Community Code of Conduct gRPC follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md). ================================================ FILE: vendor/google.golang.org/grpc/CONTRIBUTING.md ================================================ # How to contribute We welcome your patches and contributions to gRPC! Please read the gRPC organization's [governance rules](https://github.com/grpc/grpc-community/blob/master/governance.md) before proceeding. If you are new to GitHub, please start by reading [Pull Request howto](https://help.github.com/articles/about-pull-requests/) ## Legal requirements In order to protect both you and ourselves, you will need to sign the [Contributor License Agreement](https://identity.linuxfoundation.org/projects/cncf). When you create your first PR, a link will be added as a comment that contains the steps needed to complete this process. ## Getting Started A great way to start is by searching through our open issues. [Unassigned issues labeled as "help wanted"](https://github.com/grpc/grpc-go/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20label%3A%22Status%3A%20Help%20Wanted%22%20no%3Aassignee) are especially nice for first-time contributors, as they should be well-defined problems that already have agreed-upon solutions. ## Code Style We follow [Google's published Go style guide](https://google.github.io/styleguide/go/). Note that there are three primary documents that make up this style guide; please follow them as closely as possible. If a reviewer recommends something that contradicts those guidelines, there may be valid reasons to do so, but it should be rare. ## Guidelines for Pull Requests Please read the following carefully to ensure your contributions can be merged smoothly and quickly. ### PR Contents - Create **small PRs** that are narrowly focused on **addressing a single concern**. We often receive PRs that attempt to fix several things at the same time, and if one part of the PR has a problem, that will hold up the entire PR. - If your change does not address an **open issue** with an **agreed resolution**, consider opening an issue and discussing it first. If you are suggesting a behavioral or API change, consider starting with a [gRFC proposal](https://github.com/grpc/proposal). Many new features that are not bug fixes will require cross-language agreement. - If you want to fix **formatting or style**, consider whether your changes are an obvious improvement or might be considered a personal preference. If a style change is based on preference, it likely will not be accepted. If it corrects widely agreed-upon anti-patterns, then please do create a PR and explain the benefits of the change. - For correcting **misspellings**, please be aware that we use some terms that are sometimes flagged by spell checkers. As an example, "if an only if" is often written as "iff". Please do not make spelling correction changes unless you are certain they are misspellings. - **All tests need to be passing** before your change can be merged. We recommend you run tests locally before creating your PR to catch breakages early on: - `./scripts/vet.sh` to catch vet errors. - `go test -cpu 1,4 -timeout 7m ./...` to run the tests. - `go test -race -cpu 1,4 -timeout 7m ./...` to run tests in race mode. Note that we have a multi-module repo, so `go test` commands may need to be run from the root of each module in order to cause all tests to run. *Alternatively*, you may find it easier to push your changes to your fork on GitHub, which will trigger a GitHub Actions run that you can use to verify everything is passing. - Note that there are two GitHub actions checks that need not be green: 1. We test the freshness of the generated proto code we maintain via the `vet-proto` check. If the source proto files are updated, but our repo is not updated, an optional checker will fail. This will be fixed by our team in a separate PR and will not prevent the merge of your PR. 2. We run a checker that will fail if there is any change in dependencies of an exported package via the `dependencies` check. If new dependencies are added that are not appropriate, we may not accept your PR (see below). - If you are adding a **new file**, make sure it has the **copyright message** template at the top as a comment. You can copy the message from an existing file and update the year. - The grpc package should only depend on standard Go packages and a small number of exceptions. **If your contribution introduces new dependencies**, you will need a discussion with gRPC-Go maintainers. ### PR Descriptions - **PR titles** should start with the name of the component being addressed, or the type of change. Examples: transport, client, server, round_robin, xds, cleanup, deps. - Read and follow the **guidelines for PR titles and descriptions** here: https://google.github.io/eng-practices/review/developer/cl-descriptions.html *particularly* the sections "First Line" and "Body is Informative". Note: your PR description will be used as the git commit message in a squash-and-merge if your PR is approved. We may make changes to this as necessary. - **Does this PR relate to an open issue?** On the first line, please use the tag `Fixes #` to ensure the issue is closed when the PR is merged. Or use `Updates #` if the PR is related to an open issue, but does not fix it. Consider filing an issue if one does not already exist. - PR descriptions *must* conclude with **release notes** as follows: ``` RELEASE NOTES: * : ``` This need not match the PR title. The summary must: * be something that gRPC users will understand. * clearly explain the feature being added, the issue being fixed, or the behavior being changed, etc. If fixing a bug, be clear about how the bug can be triggered by an end-user. * begin with a capital letter and use complete sentences. * be as short as possible to describe the change being made. If a PR is *not* end-user visible -- e.g. a cleanup, testing change, or GitHub-related, use `RELEASE NOTES: n/a`. ### PR Process - Please **self-review** your code changes before sending your PR. This will prevent simple, obvious errors from causing delays. - Maintain a **clean commit history** and use **meaningful commit messages**. PRs with messy commit histories are difficult to review and won't be merged. Before sending your PR, ensure your changes are based on top of the latest `upstream/master` commits, and avoid rebasing in the middle of a code review. You should **never use `git push -f`** unless absolutely necessary during a review, as it can interfere with GitHub's tracking of comments. - Unless your PR is trivial, you should **expect reviewer comments** that you will need to address before merging. We'll label the PR as `Status: Requires Reporter Clarification` if we expect you to respond to these comments in a timely manner. If the PR remains inactive for 6 days, it will be marked as `stale`, and we will automatically close it after 7 days if we don't hear back from you. Please feel free to ping issues or bugs if you do not get a response within a week. ================================================ FILE: vendor/google.golang.org/grpc/GOVERNANCE.md ================================================ This repository is governed by the gRPC organization's [governance rules](https://github.com/grpc/grpc-community/blob/master/governance.md). ================================================ FILE: vendor/google.golang.org/grpc/LICENSE ================================================ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: vendor/google.golang.org/grpc/MAINTAINERS.md ================================================ This page lists all active maintainers of this repository. If you were a maintainer and would like to add your name to the Emeritus list, please send us a PR. See [GOVERNANCE.md](https://github.com/grpc/grpc-community/blob/master/governance.md) for governance guidelines and how to become a maintainer. See [CONTRIBUTING.md](https://github.com/grpc/grpc-community/blob/master/CONTRIBUTING.md) for general contribution guidelines. ## Maintainers (in alphabetical order) - [arjan-bal](https://github.com/arjan-bal), Google LLC - [arvindbr8](https://github.com/arvindbr8), Google LLC - [atollena](https://github.com/atollena), Datadog, Inc. - [dfawley](https://github.com/dfawley), Google LLC - [easwars](https://github.com/easwars), Google LLC - [gtcooke94](https://github.com/gtcooke94), Google LLC ## Emeritus Maintainers (in alphabetical order) - [adelez](https://github.com/adelez) - [aranjans](https://github.com/aranjans) - [canguler](https://github.com/canguler) - [cesarghali](https://github.com/cesarghali) - [erm-g](https://github.com/erm-g) - [iamqizhao](https://github.com/iamqizhao) - [jeanbza](https://github.com/jeanbza) - [jtattermusch](https://github.com/jtattermusch) - [lyuxuan](https://github.com/lyuxuan) - [makmukhi](https://github.com/makmukhi) - [matt-kwong](https://github.com/matt-kwong) - [menghanl](https://github.com/menghanl) - [nicolasnoble](https://github.com/nicolasnoble) - [purnesh42h](https://github.com/purnesh42h) - [srini100](https://github.com/srini100) - [yongni](https://github.com/yongni) - [zasweq](https://github.com/zasweq) ================================================ FILE: vendor/google.golang.org/grpc/Makefile ================================================ all: vet test testrace build: go build google.golang.org/grpc/... clean: go clean -i google.golang.org/grpc/... deps: GO111MODULE=on go get -d -v google.golang.org/grpc/... proto: @ if ! which protoc > /dev/null; then \ echo "error: protoc not installed" >&2; \ exit 1; \ fi go generate google.golang.org/grpc/... test: go test -cpu 1,4 -timeout 7m google.golang.org/grpc/... testsubmodule: cd security/advancedtls && go test -cpu 1,4 -timeout 7m google.golang.org/grpc/security/advancedtls/... cd security/authorization && go test -cpu 1,4 -timeout 7m google.golang.org/grpc/security/authorization/... testrace: go test -race -cpu 1,4 -timeout 7m google.golang.org/grpc/... testdeps: GO111MODULE=on go get -d -v -t google.golang.org/grpc/... vet: vetdeps ./scripts/vet.sh vetdeps: ./scripts/vet.sh -install .PHONY: \ all \ build \ clean \ deps \ proto \ test \ testsubmodule \ testrace \ testdeps \ vet \ vetdeps ================================================ FILE: vendor/google.golang.org/grpc/NOTICE.txt ================================================ Copyright 2014 gRPC authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: vendor/google.golang.org/grpc/README.md ================================================ # gRPC-Go [![GoDoc](https://pkg.go.dev/badge/google.golang.org/grpc)][API] [![GoReportCard](https://goreportcard.com/badge/grpc/grpc-go)](https://goreportcard.com/report/github.com/grpc/grpc-go) [![codecov](https://codecov.io/gh/grpc/grpc-go/graph/badge.svg)](https://codecov.io/gh/grpc/grpc-go) The [Go][] implementation of [gRPC][]: A high performance, open source, general RPC framework that puts mobile and HTTP/2 first. For more information see the [Go gRPC docs][], or jump directly into the [quick start][]. ## Prerequisites - **[Go][]**: any one of the **two latest major** [releases][go-releases]. ## Installation Simply add the following import to your code, and then `go [build|run|test]` will automatically fetch the necessary dependencies: ```go import "google.golang.org/grpc" ``` > **Note:** If you are trying to access `grpc-go` from **China**, see the > [FAQ](#FAQ) below. ## Learn more - [Go gRPC docs][], which include a [quick start][] and [API reference][API] among other resources - [Low-level technical docs](Documentation) from this repository - [Performance benchmark][] - [Examples](examples) - [Contribution guidelines](CONTRIBUTING.md) ## FAQ ### I/O Timeout Errors The `golang.org` domain may be blocked from some countries. `go get` usually produces an error like the following when this happens: ```console $ go get -u google.golang.org/grpc package google.golang.org/grpc: unrecognized import path "google.golang.org/grpc" (https fetch: Get https://google.golang.org/grpc?go-get=1: dial tcp 216.239.37.1:443: i/o timeout) ``` To build Go code, there are several options: - Set up a VPN and access google.golang.org through that. - With Go module support: it is possible to use the `replace` feature of `go mod` to create aliases for golang.org packages. In your project's directory: ```sh go mod edit -replace=google.golang.org/grpc=github.com/grpc/grpc-go@latest go mod tidy go mod vendor go build -mod=vendor ``` Again, this will need to be done for all transitive dependencies hosted on golang.org as well. For details, refer to [golang/go issue #28652](https://github.com/golang/go/issues/28652). ### Compiling error, undefined: grpc.SupportPackageIsVersion Please update to the latest version of gRPC-Go using `go get google.golang.org/grpc`. ### How to turn on logging The default logger is controlled by environment variables. Turn everything on like this: ```console $ export GRPC_GO_LOG_VERBOSITY_LEVEL=99 $ export GRPC_GO_LOG_SEVERITY_LEVEL=info ``` ### The RPC failed with error `"code = Unavailable desc = transport is closing"` This error means the connection the RPC is using was closed, and there are many possible reasons, including: 1. mis-configured transport credentials, connection failed on handshaking 1. bytes disrupted, possibly by a proxy in between 1. server shutdown 1. Keepalive parameters caused connection shutdown, for example if you have configured your server to terminate connections regularly to [trigger DNS lookups](https://github.com/grpc/grpc-go/issues/3170#issuecomment-552517779). If this is the case, you may want to increase your [MaxConnectionAgeGrace](https://pkg.go.dev/google.golang.org/grpc/keepalive?tab=doc#ServerParameters), to allow longer RPC calls to finish. It can be tricky to debug this because the error happens on the client side but the root cause of the connection being closed is on the server side. Turn on logging on __both client and server__, and see if there are any transport errors. [API]: https://pkg.go.dev/google.golang.org/grpc [Go]: https://golang.org [Go module]: https://github.com/golang/go/wiki/Modules [gRPC]: https://grpc.io [Go gRPC docs]: https://grpc.io/docs/languages/go [Performance benchmark]: https://performance-dot-grpc-testing.appspot.com/explore?dashboard=5180705743044608 [quick start]: https://grpc.io/docs/languages/go/quickstart [go-releases]: https://golang.org/doc/devel/release.html ================================================ FILE: vendor/google.golang.org/grpc/SECURITY.md ================================================ # Security Policy For information on gRPC Security Policy and reporting potential security issues, please see [gRPC CVE Process](https://github.com/grpc/proposal/blob/master/P4-grpc-cve-process.md). ================================================ FILE: vendor/google.golang.org/grpc/attributes/attributes.go ================================================ /* * * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package attributes defines a generic key/value store used in various gRPC // components. // // # Experimental // // Notice: This package is EXPERIMENTAL and may be changed or removed in a // later release. package attributes import ( "fmt" "strings" ) // Attributes is an immutable struct for storing and retrieving generic // key/value pairs. Keys must be hashable, and users should define their own // types for keys. Values should not be modified after they are added to an // Attributes or if they were received from one. If values implement 'Equal(o // any) bool', it will be called by (*Attributes).Equal to determine whether // two values with the same key should be considered equal. type Attributes struct { m map[any]any } // New returns a new Attributes containing the key/value pair. func New(key, value any) *Attributes { return &Attributes{m: map[any]any{key: value}} } // WithValue returns a new Attributes containing the previous keys and values // and the new key/value pair. If the same key appears multiple times, the // last value overwrites all previous values for that key. To remove an // existing key, use a nil value. value should not be modified later. func (a *Attributes) WithValue(key, value any) *Attributes { if a == nil { return New(key, value) } n := &Attributes{m: make(map[any]any, len(a.m)+1)} for k, v := range a.m { n.m[k] = v } n.m[key] = value return n } // Value returns the value associated with these attributes for key, or nil if // no value is associated with key. The returned value should not be modified. func (a *Attributes) Value(key any) any { if a == nil { return nil } return a.m[key] } // Equal returns whether a and o are equivalent. If 'Equal(o any) bool' is // implemented for a value in the attributes, it is called to determine if the // value matches the one stored in the other attributes. If Equal is not // implemented, standard equality is used to determine if the two values are // equal. Note that some types (e.g. maps) aren't comparable by default, so // they must be wrapped in a struct, or in an alias type, with Equal defined. func (a *Attributes) Equal(o *Attributes) bool { if a == nil && o == nil { return true } if a == nil || o == nil { return false } if len(a.m) != len(o.m) { return false } for k, v := range a.m { ov, ok := o.m[k] if !ok { // o missing element of a return false } if eq, ok := v.(interface{ Equal(o any) bool }); ok { if !eq.Equal(ov) { return false } } else if v != ov { // Fallback to a standard equality check if Value is unimplemented. return false } } return true } // String prints the attribute map. If any key or values throughout the map // implement fmt.Stringer, it calls that method and appends. func (a *Attributes) String() string { var sb strings.Builder sb.WriteString("{") first := true for k, v := range a.m { if !first { sb.WriteString(", ") } sb.WriteString(fmt.Sprintf("%q: %q ", str(k), str(v))) first = false } sb.WriteString("}") return sb.String() } func str(x any) (s string) { if v, ok := x.(fmt.Stringer); ok { return fmt.Sprint(v) } else if v, ok := x.(string); ok { return v } return fmt.Sprintf("<%p>", x) } // MarshalJSON helps implement the json.Marshaler interface, thereby rendering // the Attributes correctly when printing (via pretty.JSON) structs containing // Attributes as fields. // // Is it impossible to unmarshal attributes from a JSON representation and this // method is meant only for debugging purposes. func (a *Attributes) MarshalJSON() ([]byte, error) { return []byte(a.String()), nil } ================================================ FILE: vendor/google.golang.org/grpc/backoff/backoff.go ================================================ /* * * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package backoff provides configuration options for backoff. // // More details can be found at: // https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md. // // All APIs in this package are experimental. package backoff import "time" // Config defines the configuration options for backoff. type Config struct { // BaseDelay is the amount of time to backoff after the first failure. BaseDelay time.Duration // Multiplier is the factor with which to multiply backoffs after a // failed retry. Should ideally be greater than 1. Multiplier float64 // Jitter is the factor with which backoffs are randomized. Jitter float64 // MaxDelay is the upper bound of backoff delay. MaxDelay time.Duration } // DefaultConfig is a backoff configuration with the default values specified // at https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md. // // This should be useful for callers who want to configure backoff with // non-default values only for a subset of the options. var DefaultConfig = Config{ BaseDelay: 1.0 * time.Second, Multiplier: 1.6, Jitter: 0.2, MaxDelay: 120 * time.Second, } ================================================ FILE: vendor/google.golang.org/grpc/backoff.go ================================================ /* * * Copyright 2017 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // See internal/backoff package for the backoff implementation. This file is // kept for the exported types and API backward compatibility. package grpc import ( "time" "google.golang.org/grpc/backoff" ) // DefaultBackoffConfig uses values specified for backoff in // https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md. // // Deprecated: use ConnectParams instead. Will be supported throughout 1.x. var DefaultBackoffConfig = BackoffConfig{ MaxDelay: 120 * time.Second, } // BackoffConfig defines the parameters for the default gRPC backoff strategy. // // Deprecated: use ConnectParams instead. Will be supported throughout 1.x. type BackoffConfig struct { // MaxDelay is the upper bound of backoff delay. MaxDelay time.Duration } // ConnectParams defines the parameters for connecting and retrying. Users are // encouraged to use this instead of the BackoffConfig type defined above. See // here for more details: // https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md. // // # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. type ConnectParams struct { // Backoff specifies the configuration options for connection backoff. Backoff backoff.Config // MinConnectTimeout is the minimum amount of time we are willing to give a // connection to complete. MinConnectTimeout time.Duration } ================================================ FILE: vendor/google.golang.org/grpc/balancer/balancer.go ================================================ /* * * Copyright 2017 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package balancer defines APIs for load balancing in gRPC. // All APIs in this package are experimental. package balancer import ( "context" "encoding/json" "errors" "net" "strings" "google.golang.org/grpc/channelz" "google.golang.org/grpc/connectivity" "google.golang.org/grpc/credentials" estats "google.golang.org/grpc/experimental/stats" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/internal" "google.golang.org/grpc/metadata" "google.golang.org/grpc/resolver" "google.golang.org/grpc/serviceconfig" ) var ( // m is a map from name to balancer builder. m = make(map[string]Builder) logger = grpclog.Component("balancer") ) // Register registers the balancer builder to the balancer map. b.Name // (lowercased) will be used as the name registered with this builder. If the // Builder implements ConfigParser, ParseConfig will be called when new service // configs are received by the resolver, and the result will be provided to the // Balancer in UpdateClientConnState. // // NOTE: this function must only be called during initialization time (i.e. in // an init() function), and is not thread-safe. If multiple Balancers are // registered with the same name, the one registered last will take effect. func Register(b Builder) { name := strings.ToLower(b.Name()) if name != b.Name() { // TODO: Skip the use of strings.ToLower() to index the map after v1.59 // is released to switch to case sensitive balancer registry. Also, // remove this warning and update the docstrings for Register and Get. logger.Warningf("Balancer registered with name %q. grpc-go will be switching to case sensitive balancer registries soon", b.Name()) } m[name] = b } // unregisterForTesting deletes the balancer with the given name from the // balancer map. // // This function is not thread-safe. func unregisterForTesting(name string) { delete(m, name) } func init() { internal.BalancerUnregister = unregisterForTesting internal.ConnectedAddress = connectedAddress internal.SetConnectedAddress = setConnectedAddress } // Get returns the resolver builder registered with the given name. // Note that the compare is done in a case-insensitive fashion. // If no builder is register with the name, nil will be returned. func Get(name string) Builder { if strings.ToLower(name) != name { // TODO: Skip the use of strings.ToLower() to index the map after v1.59 // is released to switch to case sensitive balancer registry. Also, // remove this warning and update the docstrings for Register and Get. logger.Warningf("Balancer retrieved for name %q. grpc-go will be switching to case sensitive balancer registries soon", name) } if b, ok := m[strings.ToLower(name)]; ok { return b } return nil } // NewSubConnOptions contains options to create new SubConn. type NewSubConnOptions struct { // CredsBundle is the credentials bundle that will be used in the created // SubConn. If it's nil, the original creds from grpc DialOptions will be // used. // // Deprecated: Use the Attributes field in resolver.Address to pass // arbitrary data to the credential handshaker. CredsBundle credentials.Bundle // HealthCheckEnabled indicates whether health check service should be // enabled on this SubConn HealthCheckEnabled bool // StateListener is called when the state of the subconn changes. If nil, // Balancer.UpdateSubConnState will be called instead. Will never be // invoked until after Connect() is called on the SubConn created with // these options. StateListener func(SubConnState) } // State contains the balancer's state relevant to the gRPC ClientConn. type State struct { // State contains the connectivity state of the balancer, which is used to // determine the state of the ClientConn. ConnectivityState connectivity.State // Picker is used to choose connections (SubConns) for RPCs. Picker Picker } // ClientConn represents a gRPC ClientConn. // // This interface is to be implemented by gRPC. Users should not need a // brand new implementation of this interface. For the situations like // testing, the new implementation should embed this interface. This allows // gRPC to add new methods to this interface. // // NOTICE: This interface is intended to be implemented by gRPC, or intercepted // by custom load balancing polices. Users should not need their own complete // implementation of this interface -- they should always delegate to a // ClientConn passed to Builder.Build() by embedding it in their // implementations. An embedded ClientConn must never be nil, or runtime panics // will occur. type ClientConn interface { // NewSubConn is called by balancer to create a new SubConn. // It doesn't block and wait for the connections to be established. // Behaviors of the SubConn can be controlled by options. // // Deprecated: please be aware that in a future version, SubConns will only // support one address per SubConn. NewSubConn([]resolver.Address, NewSubConnOptions) (SubConn, error) // RemoveSubConn removes the SubConn from ClientConn. // The SubConn will be shutdown. // // Deprecated: use SubConn.Shutdown instead. RemoveSubConn(SubConn) // UpdateAddresses updates the addresses used in the passed in SubConn. // gRPC checks if the currently connected address is still in the new list. // If so, the connection will be kept. Else, the connection will be // gracefully closed, and a new connection will be created. // // This may trigger a state transition for the SubConn. // // Deprecated: this method will be removed. Create new SubConns for new // addresses instead. UpdateAddresses(SubConn, []resolver.Address) // UpdateState notifies gRPC that the balancer's internal state has // changed. // // gRPC will update the connectivity state of the ClientConn, and will call // Pick on the new Picker to pick new SubConns. UpdateState(State) // ResolveNow is called by balancer to notify gRPC to do a name resolving. ResolveNow(resolver.ResolveNowOptions) // Target returns the dial target for this ClientConn. // // Deprecated: Use the Target field in the BuildOptions instead. Target() string // MetricsRecorder provides the metrics recorder that balancers can use to // record metrics. Balancer implementations which do not register metrics on // metrics registry and record on them can ignore this method. The returned // MetricsRecorder is guaranteed to never be nil. MetricsRecorder() estats.MetricsRecorder // EnforceClientConnEmbedding is included to force implementers to embed // another implementation of this interface, allowing gRPC to add methods // without breaking users. internal.EnforceClientConnEmbedding } // BuildOptions contains additional information for Build. type BuildOptions struct { // DialCreds is the transport credentials to use when communicating with a // remote load balancer server. Balancer implementations which do not // communicate with a remote load balancer server can ignore this field. DialCreds credentials.TransportCredentials // CredsBundle is the credentials bundle to use when communicating with a // remote load balancer server. Balancer implementations which do not // communicate with a remote load balancer server can ignore this field. CredsBundle credentials.Bundle // Dialer is the custom dialer to use when communicating with a remote load // balancer server. Balancer implementations which do not communicate with a // remote load balancer server can ignore this field. Dialer func(context.Context, string) (net.Conn, error) // Authority is the server name to use as part of the authentication // handshake when communicating with a remote load balancer server. Balancer // implementations which do not communicate with a remote load balancer // server can ignore this field. Authority string // ChannelzParent is the parent ClientConn's channelz channel. ChannelzParent channelz.Identifier // CustomUserAgent is the custom user agent set on the parent ClientConn. // The balancer should set the same custom user agent if it creates a // ClientConn. CustomUserAgent string // Target contains the parsed address info of the dial target. It is the // same resolver.Target as passed to the resolver. See the documentation for // the resolver.Target type for details about what it contains. Target resolver.Target } // Builder creates a balancer. type Builder interface { // Build creates a new balancer with the ClientConn. Build(cc ClientConn, opts BuildOptions) Balancer // Name returns the name of balancers built by this builder. // It will be used to pick balancers (for example in service config). Name() string } // ConfigParser parses load balancer configs. type ConfigParser interface { // ParseConfig parses the JSON load balancer config provided into an // internal form or returns an error if the config is invalid. For future // compatibility reasons, unknown fields in the config should be ignored. ParseConfig(LoadBalancingConfigJSON json.RawMessage) (serviceconfig.LoadBalancingConfig, error) } // PickInfo contains additional information for the Pick operation. type PickInfo struct { // FullMethodName is the method name that NewClientStream() is called // with. The canonical format is /service/Method. FullMethodName string // Ctx is the RPC's context, and may contain relevant RPC-level information // like the outgoing header metadata. Ctx context.Context } // DoneInfo contains additional information for done. type DoneInfo struct { // Err is the rpc error the RPC finished with. It could be nil. Err error // Trailer contains the metadata from the RPC's trailer, if present. Trailer metadata.MD // BytesSent indicates if any bytes have been sent to the server. BytesSent bool // BytesReceived indicates if any byte has been received from the server. BytesReceived bool // ServerLoad is the load received from server. It's usually sent as part of // trailing metadata. // // The only supported type now is *orca_v3.LoadReport. ServerLoad any } var ( // ErrNoSubConnAvailable indicates no SubConn is available for pick(). // gRPC will block the RPC until a new picker is available via UpdateState(). ErrNoSubConnAvailable = errors.New("no SubConn is available") // ErrTransientFailure indicates all SubConns are in TransientFailure. // WaitForReady RPCs will block, non-WaitForReady RPCs will fail. // // Deprecated: return an appropriate error based on the last resolution or // connection attempt instead. The behavior is the same for any non-gRPC // status error. ErrTransientFailure = errors.New("all SubConns are in TransientFailure") ) // PickResult contains information related to a connection chosen for an RPC. type PickResult struct { // SubConn is the connection to use for this pick, if its state is Ready. // If the state is not Ready, gRPC will block the RPC until a new Picker is // provided by the balancer (using ClientConn.UpdateState). The SubConn // must be one returned by ClientConn.NewSubConn. SubConn SubConn // Done is called when the RPC is completed. If the SubConn is not ready, // this will be called with a nil parameter. If the SubConn is not a valid // type, Done may not be called. May be nil if the balancer does not wish // to be notified when the RPC completes. Done func(DoneInfo) // Metadata provides a way for LB policies to inject arbitrary per-call // metadata. Any metadata returned here will be merged with existing // metadata added by the client application. // // LB policies with child policies are responsible for propagating metadata // injected by their children to the ClientConn, as part of Pick(). Metadata metadata.MD } // TransientFailureError returns e. It exists for backward compatibility and // will be deleted soon. // // Deprecated: no longer necessary, picker errors are treated this way by // default. func TransientFailureError(e error) error { return e } // Picker is used by gRPC to pick a SubConn to send an RPC. // Balancer is expected to generate a new picker from its snapshot every time its // internal state has changed. // // The pickers used by gRPC can be updated by ClientConn.UpdateState(). type Picker interface { // Pick returns the connection to use for this RPC and related information. // // Pick should not block. If the balancer needs to do I/O or any blocking // or time-consuming work to service this call, it should return // ErrNoSubConnAvailable, and the Pick call will be repeated by gRPC when // the Picker is updated (using ClientConn.UpdateState). // // If an error is returned: // // - If the error is ErrNoSubConnAvailable, gRPC will block until a new // Picker is provided by the balancer (using ClientConn.UpdateState). // // - If the error is a status error (implemented by the grpc/status // package), gRPC will terminate the RPC with the code and message // provided. // // - For all other errors, wait for ready RPCs will wait, but non-wait for // ready RPCs will be terminated with this error's Error() string and // status code Unavailable. Pick(info PickInfo) (PickResult, error) } // Balancer takes input from gRPC, manages SubConns, and collects and aggregates // the connectivity states. // // It also generates and updates the Picker used by gRPC to pick SubConns for RPCs. // // UpdateClientConnState, ResolverError, UpdateSubConnState, and Close are // guaranteed to be called synchronously from the same goroutine. There's no // guarantee on picker.Pick, it may be called anytime. type Balancer interface { // UpdateClientConnState is called by gRPC when the state of the ClientConn // changes. If the error returned is ErrBadResolverState, the ClientConn // will begin calling ResolveNow on the active name resolver with // exponential backoff until a subsequent call to UpdateClientConnState // returns a nil error. Any other errors are currently ignored. UpdateClientConnState(ClientConnState) error // ResolverError is called by gRPC when the name resolver reports an error. ResolverError(error) // UpdateSubConnState is called by gRPC when the state of a SubConn // changes. // // Deprecated: Use NewSubConnOptions.StateListener when creating the // SubConn instead. UpdateSubConnState(SubConn, SubConnState) // Close closes the balancer. The balancer is not currently required to // call SubConn.Shutdown for its existing SubConns; however, this will be // required in a future release, so it is recommended. Close() // ExitIdle instructs the LB policy to reconnect to backends / exit the // IDLE state, if appropriate and possible. Note that SubConns that enter // the IDLE state will not reconnect until SubConn.Connect is called. ExitIdle() } // ExitIdler is an optional interface for balancers to implement. If // implemented, ExitIdle will be called when ClientConn.Connect is called, if // the ClientConn is idle. If unimplemented, ClientConn.Connect will cause // all SubConns to connect. // // Deprecated: All balancers must implement this interface. This interface will // be removed in a future release. type ExitIdler interface { // ExitIdle instructs the LB policy to reconnect to backends / exit the // IDLE state, if appropriate and possible. Note that SubConns that enter // the IDLE state will not reconnect until SubConn.Connect is called. ExitIdle() } // ClientConnState describes the state of a ClientConn relevant to the // balancer. type ClientConnState struct { ResolverState resolver.State // The parsed load balancing configuration returned by the builder's // ParseConfig method, if implemented. BalancerConfig serviceconfig.LoadBalancingConfig } // ErrBadResolverState may be returned by UpdateClientConnState to indicate a // problem with the provided name resolver data. var ErrBadResolverState = errors.New("bad resolver state") ================================================ FILE: vendor/google.golang.org/grpc/balancer/base/balancer.go ================================================ /* * * Copyright 2017 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package base import ( "errors" "fmt" "google.golang.org/grpc/balancer" "google.golang.org/grpc/connectivity" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/resolver" ) var logger = grpclog.Component("balancer") type baseBuilder struct { name string pickerBuilder PickerBuilder config Config } func (bb *baseBuilder) Build(cc balancer.ClientConn, _ balancer.BuildOptions) balancer.Balancer { bal := &baseBalancer{ cc: cc, pickerBuilder: bb.pickerBuilder, subConns: resolver.NewAddressMapV2[balancer.SubConn](), scStates: make(map[balancer.SubConn]connectivity.State), csEvltr: &balancer.ConnectivityStateEvaluator{}, config: bb.config, state: connectivity.Connecting, } // Initialize picker to a picker that always returns // ErrNoSubConnAvailable, because when state of a SubConn changes, we // may call UpdateState with this picker. bal.picker = NewErrPicker(balancer.ErrNoSubConnAvailable) return bal } func (bb *baseBuilder) Name() string { return bb.name } type baseBalancer struct { cc balancer.ClientConn pickerBuilder PickerBuilder csEvltr *balancer.ConnectivityStateEvaluator state connectivity.State subConns *resolver.AddressMapV2[balancer.SubConn] scStates map[balancer.SubConn]connectivity.State picker balancer.Picker config Config resolverErr error // the last error reported by the resolver; cleared on successful resolution connErr error // the last connection error; cleared upon leaving TransientFailure } func (b *baseBalancer) ResolverError(err error) { b.resolverErr = err if b.subConns.Len() == 0 { b.state = connectivity.TransientFailure } if b.state != connectivity.TransientFailure { // The picker will not change since the balancer does not currently // report an error. return } b.regeneratePicker() b.cc.UpdateState(balancer.State{ ConnectivityState: b.state, Picker: b.picker, }) } func (b *baseBalancer) UpdateClientConnState(s balancer.ClientConnState) error { // TODO: handle s.ResolverState.ServiceConfig? if logger.V(2) { logger.Info("base.baseBalancer: got new ClientConn state: ", s) } // Successful resolution; clear resolver error and ensure we return nil. b.resolverErr = nil // addrsSet is the set converted from addrs, it's used for quick lookup of an address. addrsSet := resolver.NewAddressMapV2[any]() for _, a := range s.ResolverState.Addresses { addrsSet.Set(a, nil) if _, ok := b.subConns.Get(a); !ok { // a is a new address (not existing in b.subConns). var sc balancer.SubConn opts := balancer.NewSubConnOptions{ HealthCheckEnabled: b.config.HealthCheck, StateListener: func(scs balancer.SubConnState) { b.updateSubConnState(sc, scs) }, } sc, err := b.cc.NewSubConn([]resolver.Address{a}, opts) if err != nil { logger.Warningf("base.baseBalancer: failed to create new SubConn: %v", err) continue } b.subConns.Set(a, sc) b.scStates[sc] = connectivity.Idle b.csEvltr.RecordTransition(connectivity.Shutdown, connectivity.Idle) sc.Connect() } } for _, a := range b.subConns.Keys() { sc, _ := b.subConns.Get(a) // a was removed by resolver. if _, ok := addrsSet.Get(a); !ok { sc.Shutdown() b.subConns.Delete(a) // Keep the state of this sc in b.scStates until sc's state becomes Shutdown. // The entry will be deleted in updateSubConnState. } } // If resolver state contains no addresses, return an error so ClientConn // will trigger re-resolve. Also records this as a resolver error, so when // the overall state turns transient failure, the error message will have // the zero address information. if len(s.ResolverState.Addresses) == 0 { b.ResolverError(errors.New("produced zero addresses")) return balancer.ErrBadResolverState } b.regeneratePicker() b.cc.UpdateState(balancer.State{ConnectivityState: b.state, Picker: b.picker}) return nil } // mergeErrors builds an error from the last connection error and the last // resolver error. Must only be called if b.state is TransientFailure. func (b *baseBalancer) mergeErrors() error { // connErr must always be non-nil unless there are no SubConns, in which // case resolverErr must be non-nil. if b.connErr == nil { return fmt.Errorf("last resolver error: %v", b.resolverErr) } if b.resolverErr == nil { return fmt.Errorf("last connection error: %v", b.connErr) } return fmt.Errorf("last connection error: %v; last resolver error: %v", b.connErr, b.resolverErr) } // regeneratePicker takes a snapshot of the balancer, and generates a picker // from it. The picker is // - errPicker if the balancer is in TransientFailure, // - built by the pickerBuilder with all READY SubConns otherwise. func (b *baseBalancer) regeneratePicker() { if b.state == connectivity.TransientFailure { b.picker = NewErrPicker(b.mergeErrors()) return } readySCs := make(map[balancer.SubConn]SubConnInfo) // Filter out all ready SCs from full subConn map. for _, addr := range b.subConns.Keys() { sc, _ := b.subConns.Get(addr) if st, ok := b.scStates[sc]; ok && st == connectivity.Ready { readySCs[sc] = SubConnInfo{Address: addr} } } b.picker = b.pickerBuilder.Build(PickerBuildInfo{ReadySCs: readySCs}) } // UpdateSubConnState is a nop because a StateListener is always set in NewSubConn. func (b *baseBalancer) UpdateSubConnState(sc balancer.SubConn, state balancer.SubConnState) { logger.Errorf("base.baseBalancer: UpdateSubConnState(%v, %+v) called unexpectedly", sc, state) } func (b *baseBalancer) updateSubConnState(sc balancer.SubConn, state balancer.SubConnState) { s := state.ConnectivityState if logger.V(2) { logger.Infof("base.baseBalancer: handle SubConn state change: %p, %v", sc, s) } oldS, ok := b.scStates[sc] if !ok { if logger.V(2) { logger.Infof("base.baseBalancer: got state changes for an unknown SubConn: %p, %v", sc, s) } return } if oldS == connectivity.TransientFailure && (s == connectivity.Connecting || s == connectivity.Idle) { // Once a subconn enters TRANSIENT_FAILURE, ignore subsequent IDLE or // CONNECTING transitions to prevent the aggregated state from being // always CONNECTING when many backends exist but are all down. if s == connectivity.Idle { sc.Connect() } return } b.scStates[sc] = s switch s { case connectivity.Idle: sc.Connect() case connectivity.Shutdown: // When an address was removed by resolver, b called Shutdown but kept // the sc's state in scStates. Remove state for this sc here. delete(b.scStates, sc) case connectivity.TransientFailure: // Save error to be reported via picker. b.connErr = state.ConnectionError } b.state = b.csEvltr.RecordTransition(oldS, s) // Regenerate picker when one of the following happens: // - this sc entered or left ready // - the aggregated state of balancer is TransientFailure // (may need to update error message) if (s == connectivity.Ready) != (oldS == connectivity.Ready) || b.state == connectivity.TransientFailure { b.regeneratePicker() } b.cc.UpdateState(balancer.State{ConnectivityState: b.state, Picker: b.picker}) } // Close is a nop because base balancer doesn't have internal state to clean up, // and it doesn't need to call Shutdown for the SubConns. func (b *baseBalancer) Close() { } // ExitIdle is a nop because the base balancer attempts to stay connected to // all SubConns at all times. func (b *baseBalancer) ExitIdle() { } // NewErrPicker returns a Picker that always returns err on Pick(). func NewErrPicker(err error) balancer.Picker { return &errPicker{err: err} } // NewErrPickerV2 is temporarily defined for backward compatibility reasons. // // Deprecated: use NewErrPicker instead. var NewErrPickerV2 = NewErrPicker type errPicker struct { err error // Pick() always returns this err. } func (p *errPicker) Pick(balancer.PickInfo) (balancer.PickResult, error) { return balancer.PickResult{}, p.err } ================================================ FILE: vendor/google.golang.org/grpc/balancer/base/base.go ================================================ /* * * Copyright 2017 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package base defines a balancer base that can be used to build balancers with // different picking algorithms. // // The base balancer creates a new SubConn for each resolved address. The // provided picker will only be notified about READY SubConns. // // This package is the base of round_robin balancer, its purpose is to be used // to build round_robin like balancers with complex picking algorithms. // Balancers with more complicated logic should try to implement a balancer // builder from scratch. // // All APIs in this package are experimental. package base import ( "google.golang.org/grpc/balancer" "google.golang.org/grpc/resolver" ) // PickerBuilder creates balancer.Picker. type PickerBuilder interface { // Build returns a picker that will be used by gRPC to pick a SubConn. Build(info PickerBuildInfo) balancer.Picker } // PickerBuildInfo contains information needed by the picker builder to // construct a picker. type PickerBuildInfo struct { // ReadySCs is a map from all ready SubConns to the Addresses used to // create them. ReadySCs map[balancer.SubConn]SubConnInfo } // SubConnInfo contains information about a SubConn created by the base // balancer. type SubConnInfo struct { Address resolver.Address // the address used to create this SubConn } // Config contains the config info about the base balancer builder. type Config struct { // HealthCheck indicates whether health checking should be enabled for this specific balancer. HealthCheck bool } // NewBalancerBuilder returns a base balancer builder configured by the provided config. func NewBalancerBuilder(name string, pb PickerBuilder, config Config) balancer.Builder { return &baseBuilder{ name: name, pickerBuilder: pb, config: config, } } ================================================ FILE: vendor/google.golang.org/grpc/balancer/conn_state_evaluator.go ================================================ /* * * Copyright 2022 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package balancer import "google.golang.org/grpc/connectivity" // ConnectivityStateEvaluator takes the connectivity states of multiple SubConns // and returns one aggregated connectivity state. // // It's not thread safe. type ConnectivityStateEvaluator struct { numReady uint64 // Number of addrConns in ready state. numConnecting uint64 // Number of addrConns in connecting state. numTransientFailure uint64 // Number of addrConns in transient failure state. numIdle uint64 // Number of addrConns in idle state. } // RecordTransition records state change happening in subConn and based on that // it evaluates what aggregated state should be. // // - If at least one SubConn in Ready, the aggregated state is Ready; // - Else if at least one SubConn in Connecting, the aggregated state is Connecting; // - Else if at least one SubConn is Idle, the aggregated state is Idle; // - Else if at least one SubConn is TransientFailure (or there are no SubConns), the aggregated state is Transient Failure. // // Shutdown is not considered. func (cse *ConnectivityStateEvaluator) RecordTransition(oldState, newState connectivity.State) connectivity.State { // Update counters. for idx, state := range []connectivity.State{oldState, newState} { updateVal := 2*uint64(idx) - 1 // -1 for oldState and +1 for new. switch state { case connectivity.Ready: cse.numReady += updateVal case connectivity.Connecting: cse.numConnecting += updateVal case connectivity.TransientFailure: cse.numTransientFailure += updateVal case connectivity.Idle: cse.numIdle += updateVal } } return cse.CurrentState() } // CurrentState returns the current aggregate conn state by evaluating the counters func (cse *ConnectivityStateEvaluator) CurrentState() connectivity.State { // Evaluate. if cse.numReady > 0 { return connectivity.Ready } if cse.numConnecting > 0 { return connectivity.Connecting } if cse.numIdle > 0 { return connectivity.Idle } return connectivity.TransientFailure } ================================================ FILE: vendor/google.golang.org/grpc/balancer/endpointsharding/endpointsharding.go ================================================ /* * * Copyright 2024 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package endpointsharding implements a load balancing policy that manages // homogeneous child policies each owning a single endpoint. // // # Experimental // // Notice: This package is EXPERIMENTAL and may be changed or removed in a // later release. package endpointsharding import ( "errors" rand "math/rand/v2" "sync" "sync/atomic" "google.golang.org/grpc/balancer" "google.golang.org/grpc/balancer/base" "google.golang.org/grpc/connectivity" "google.golang.org/grpc/resolver" ) var randIntN = rand.IntN // ChildState is the balancer state of a child along with the endpoint which // identifies the child balancer. type ChildState struct { Endpoint resolver.Endpoint State balancer.State // Balancer exposes only the ExitIdler interface of the child LB policy. // Other methods of the child policy are called only by endpointsharding. Balancer ExitIdler } // ExitIdler provides access to only the ExitIdle method of the child balancer. type ExitIdler interface { // ExitIdle instructs the LB policy to reconnect to backends / exit the // IDLE state, if appropriate and possible. Note that SubConns that enter // the IDLE state will not reconnect until SubConn.Connect is called. ExitIdle() } // Options are the options to configure the behaviour of the // endpointsharding balancer. type Options struct { // DisableAutoReconnect allows the balancer to keep child balancer in the // IDLE state until they are explicitly triggered to exit using the // ChildState obtained from the endpointsharding picker. When set to false, // the endpointsharding balancer will automatically call ExitIdle on child // connections that report IDLE. DisableAutoReconnect bool } // ChildBuilderFunc creates a new balancer with the ClientConn. It has the same // type as the balancer.Builder.Build method. type ChildBuilderFunc func(cc balancer.ClientConn, opts balancer.BuildOptions) balancer.Balancer // NewBalancer returns a load balancing policy that manages homogeneous child // policies each owning a single endpoint. The endpointsharding balancer // forwards the LoadBalancingConfig in ClientConn state updates to its children. func NewBalancer(cc balancer.ClientConn, opts balancer.BuildOptions, childBuilder ChildBuilderFunc, esOpts Options) balancer.Balancer { es := &endpointSharding{ cc: cc, bOpts: opts, esOpts: esOpts, childBuilder: childBuilder, } es.children.Store(resolver.NewEndpointMap[*balancerWrapper]()) return es } // endpointSharding is a balancer that wraps child balancers. It creates a child // balancer with child config for every unique Endpoint received. It updates the // child states on any update from parent or child. type endpointSharding struct { cc balancer.ClientConn bOpts balancer.BuildOptions esOpts Options childBuilder ChildBuilderFunc // childMu synchronizes calls to any single child. It must be held for all // calls into a child. To avoid deadlocks, do not acquire childMu while // holding mu. childMu sync.Mutex children atomic.Pointer[resolver.EndpointMap[*balancerWrapper]] // inhibitChildUpdates is set during UpdateClientConnState/ResolverError // calls (calls to children will each produce an update, only want one // update). inhibitChildUpdates atomic.Bool // mu synchronizes access to the state stored in balancerWrappers in the // children field. mu must not be held during calls into a child since // synchronous calls back from the child may require taking mu, causing a // deadlock. To avoid deadlocks, do not acquire childMu while holding mu. mu sync.Mutex } // rotateEndpoints returns a slice of all the input endpoints rotated a random // amount. func rotateEndpoints(es []resolver.Endpoint) []resolver.Endpoint { les := len(es) if les == 0 { return es } r := randIntN(les) // Make a copy to avoid mutating data beyond the end of es. ret := make([]resolver.Endpoint, les) copy(ret, es[r:]) copy(ret[les-r:], es[:r]) return ret } // UpdateClientConnState creates a child for new endpoints and deletes children // for endpoints that are no longer present. It also updates all the children, // and sends a single synchronous update of the childrens' aggregated state at // the end of the UpdateClientConnState operation. If any endpoint has no // addresses it will ignore that endpoint. Otherwise, returns first error found // from a child, but fully processes the new update. func (es *endpointSharding) UpdateClientConnState(state balancer.ClientConnState) error { es.childMu.Lock() defer es.childMu.Unlock() es.inhibitChildUpdates.Store(true) defer func() { es.inhibitChildUpdates.Store(false) es.updateState() }() var ret error children := es.children.Load() newChildren := resolver.NewEndpointMap[*balancerWrapper]() // Update/Create new children. for _, endpoint := range rotateEndpoints(state.ResolverState.Endpoints) { if _, ok := newChildren.Get(endpoint); ok { // Endpoint child was already created, continue to avoid duplicate // update. continue } childBalancer, ok := children.Get(endpoint) if ok { // Endpoint attributes may have changed, update the stored endpoint. es.mu.Lock() childBalancer.childState.Endpoint = endpoint es.mu.Unlock() } else { childBalancer = &balancerWrapper{ childState: ChildState{Endpoint: endpoint}, ClientConn: es.cc, es: es, } childBalancer.childState.Balancer = childBalancer childBalancer.child = es.childBuilder(childBalancer, es.bOpts) } newChildren.Set(endpoint, childBalancer) if err := childBalancer.updateClientConnStateLocked(balancer.ClientConnState{ BalancerConfig: state.BalancerConfig, ResolverState: resolver.State{ Endpoints: []resolver.Endpoint{endpoint}, Attributes: state.ResolverState.Attributes, }, }); err != nil && ret == nil { // Return first error found, and always commit full processing of // updating children. If desired to process more specific errors // across all endpoints, caller should make these specific // validations, this is a current limitation for simplicity sake. ret = err } } // Delete old children that are no longer present. for _, e := range children.Keys() { child, _ := children.Get(e) if _, ok := newChildren.Get(e); !ok { child.closeLocked() } } es.children.Store(newChildren) if newChildren.Len() == 0 { return balancer.ErrBadResolverState } return ret } // ResolverError forwards the resolver error to all of the endpointSharding's // children and sends a single synchronous update of the childStates at the end // of the ResolverError operation. func (es *endpointSharding) ResolverError(err error) { es.childMu.Lock() defer es.childMu.Unlock() es.inhibitChildUpdates.Store(true) defer func() { es.inhibitChildUpdates.Store(false) es.updateState() }() children := es.children.Load() for _, child := range children.Values() { child.resolverErrorLocked(err) } } func (es *endpointSharding) UpdateSubConnState(balancer.SubConn, balancer.SubConnState) { // UpdateSubConnState is deprecated. } func (es *endpointSharding) Close() { es.childMu.Lock() defer es.childMu.Unlock() children := es.children.Load() for _, child := range children.Values() { child.closeLocked() } } func (es *endpointSharding) ExitIdle() { es.childMu.Lock() defer es.childMu.Unlock() for _, bw := range es.children.Load().Values() { if !bw.isClosed { bw.child.ExitIdle() } } } // updateState updates this component's state. It sends the aggregated state, // and a picker with round robin behavior with all the child states present if // needed. func (es *endpointSharding) updateState() { if es.inhibitChildUpdates.Load() { return } var readyPickers, connectingPickers, idlePickers, transientFailurePickers []balancer.Picker es.mu.Lock() defer es.mu.Unlock() children := es.children.Load() childStates := make([]ChildState, 0, children.Len()) for _, child := range children.Values() { childState := child.childState childStates = append(childStates, childState) childPicker := childState.State.Picker switch childState.State.ConnectivityState { case connectivity.Ready: readyPickers = append(readyPickers, childPicker) case connectivity.Connecting: connectingPickers = append(connectingPickers, childPicker) case connectivity.Idle: idlePickers = append(idlePickers, childPicker) case connectivity.TransientFailure: transientFailurePickers = append(transientFailurePickers, childPicker) // connectivity.Shutdown shouldn't appear. } } // Construct the round robin picker based off the aggregated state. Whatever // the aggregated state, use the pickers present that are currently in that // state only. var aggState connectivity.State var pickers []balancer.Picker if len(readyPickers) >= 1 { aggState = connectivity.Ready pickers = readyPickers } else if len(connectingPickers) >= 1 { aggState = connectivity.Connecting pickers = connectingPickers } else if len(idlePickers) >= 1 { aggState = connectivity.Idle pickers = idlePickers } else if len(transientFailurePickers) >= 1 { aggState = connectivity.TransientFailure pickers = transientFailurePickers } else { aggState = connectivity.TransientFailure pickers = []balancer.Picker{base.NewErrPicker(errors.New("no children to pick from"))} } // No children (resolver error before valid update). p := &pickerWithChildStates{ pickers: pickers, childStates: childStates, next: uint32(randIntN(len(pickers))), } es.cc.UpdateState(balancer.State{ ConnectivityState: aggState, Picker: p, }) } // pickerWithChildStates delegates to the pickers it holds in a round robin // fashion. It also contains the childStates of all the endpointSharding's // children. type pickerWithChildStates struct { pickers []balancer.Picker childStates []ChildState next uint32 } func (p *pickerWithChildStates) Pick(info balancer.PickInfo) (balancer.PickResult, error) { nextIndex := atomic.AddUint32(&p.next, 1) picker := p.pickers[nextIndex%uint32(len(p.pickers))] return picker.Pick(info) } // ChildStatesFromPicker returns the state of all the children managed by the // endpoint sharding balancer that created this picker. func ChildStatesFromPicker(picker balancer.Picker) []ChildState { p, ok := picker.(*pickerWithChildStates) if !ok { return nil } return p.childStates } // balancerWrapper is a wrapper of a balancer. It ID's a child balancer by // endpoint, and persists recent child balancer state. type balancerWrapper struct { // The following fields are initialized at build time and read-only after // that and therefore do not need to be guarded by a mutex. // child contains the wrapped balancer. Access its methods only through // methods on balancerWrapper to ensure proper synchronization child balancer.Balancer balancer.ClientConn // embed to intercept UpdateState, doesn't deal with SubConns es *endpointSharding // Access to the following fields is guarded by es.mu. childState ChildState isClosed bool } func (bw *balancerWrapper) UpdateState(state balancer.State) { bw.es.mu.Lock() bw.childState.State = state bw.es.mu.Unlock() if state.ConnectivityState == connectivity.Idle && !bw.es.esOpts.DisableAutoReconnect { bw.ExitIdle() } bw.es.updateState() } // ExitIdle pings an IDLE child balancer to exit idle in a new goroutine to // avoid deadlocks due to synchronous balancer state updates. func (bw *balancerWrapper) ExitIdle() { go func() { bw.es.childMu.Lock() if !bw.isClosed { bw.child.ExitIdle() } bw.es.childMu.Unlock() }() } // updateClientConnStateLocked delivers the ClientConnState to the child // balancer. Callers must hold the child mutex of the parent endpointsharding // balancer. func (bw *balancerWrapper) updateClientConnStateLocked(ccs balancer.ClientConnState) error { return bw.child.UpdateClientConnState(ccs) } // closeLocked closes the child balancer. Callers must hold the child mutext of // the parent endpointsharding balancer. func (bw *balancerWrapper) closeLocked() { bw.child.Close() bw.isClosed = true } func (bw *balancerWrapper) resolverErrorLocked(err error) { bw.child.ResolverError(err) } ================================================ FILE: vendor/google.golang.org/grpc/balancer/grpclb/state/state.go ================================================ /* * * Copyright 2020 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package state declares grpclb types to be set by resolvers wishing to pass // information to grpclb via resolver.State Attributes. package state import ( "google.golang.org/grpc/resolver" ) // keyType is the key to use for storing State in Attributes. type keyType string const key = keyType("grpc.grpclb.state") // State contains gRPCLB-relevant data passed from the name resolver. type State struct { // BalancerAddresses contains the remote load balancer address(es). If // set, overrides any resolver-provided addresses with Type of GRPCLB. BalancerAddresses []resolver.Address } // Set returns a copy of the provided state with attributes containing s. s's // data should not be mutated after calling Set. func Set(state resolver.State, s *State) resolver.State { state.Attributes = state.Attributes.WithValue(key, s) return state } // Get returns the grpclb State in the resolver.State, or nil if not present. // The returned data should not be mutated. func Get(state resolver.State) *State { s, _ := state.Attributes.Value(key).(*State) return s } ================================================ FILE: vendor/google.golang.org/grpc/balancer/pickfirst/internal/internal.go ================================================ /* * Copyright 2024 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package internal contains code internal to the pickfirst package. package internal import ( rand "math/rand/v2" "time" ) var ( // RandShuffle pseudo-randomizes the order of addresses. RandShuffle = rand.Shuffle // TimeAfterFunc allows mocking the timer for testing connection delay // related functionality. TimeAfterFunc = func(d time.Duration, f func()) func() { timer := time.AfterFunc(d, f) return func() { timer.Stop() } } ) ================================================ FILE: vendor/google.golang.org/grpc/balancer/pickfirst/pickfirst.go ================================================ /* * * Copyright 2017 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package pickfirst contains the pick_first load balancing policy which // is the universal leaf policy. package pickfirst import ( "encoding/json" "errors" "fmt" "net" "net/netip" "sync" "time" "google.golang.org/grpc/balancer" "google.golang.org/grpc/balancer/pickfirst/internal" "google.golang.org/grpc/connectivity" expstats "google.golang.org/grpc/experimental/stats" "google.golang.org/grpc/grpclog" internalgrpclog "google.golang.org/grpc/internal/grpclog" "google.golang.org/grpc/internal/pretty" "google.golang.org/grpc/resolver" "google.golang.org/grpc/serviceconfig" ) func init() { balancer.Register(pickfirstBuilder{}) } // Name is the name of the pick_first balancer. const Name = "pick_first" // enableHealthListenerKeyType is a unique key type used in resolver // attributes to indicate whether the health listener usage is enabled. type enableHealthListenerKeyType struct{} var ( logger = grpclog.Component("pick-first-leaf-lb") disconnectionsMetric = expstats.RegisterInt64Count(expstats.MetricDescriptor{ Name: "grpc.lb.pick_first.disconnections", Description: "EXPERIMENTAL. Number of times the selected subchannel becomes disconnected.", Unit: "{disconnection}", Labels: []string{"grpc.target"}, Default: false, }) connectionAttemptsSucceededMetric = expstats.RegisterInt64Count(expstats.MetricDescriptor{ Name: "grpc.lb.pick_first.connection_attempts_succeeded", Description: "EXPERIMENTAL. Number of successful connection attempts.", Unit: "{attempt}", Labels: []string{"grpc.target"}, Default: false, }) connectionAttemptsFailedMetric = expstats.RegisterInt64Count(expstats.MetricDescriptor{ Name: "grpc.lb.pick_first.connection_attempts_failed", Description: "EXPERIMENTAL. Number of failed connection attempts.", Unit: "{attempt}", Labels: []string{"grpc.target"}, Default: false, }) ) const ( // TODO: change to pick-first when this becomes the default pick_first policy. logPrefix = "[pick-first-leaf-lb %p] " // connectionDelayInterval is the time to wait for during the happy eyeballs // pass before starting the next connection attempt. connectionDelayInterval = 250 * time.Millisecond ) type ipAddrFamily int const ( // ipAddrFamilyUnknown represents strings that can't be parsed as an IP // address. ipAddrFamilyUnknown ipAddrFamily = iota ipAddrFamilyV4 ipAddrFamilyV6 ) type pickfirstBuilder struct{} func (pickfirstBuilder) Build(cc balancer.ClientConn, bo balancer.BuildOptions) balancer.Balancer { b := &pickfirstBalancer{ cc: cc, target: bo.Target.String(), metricsRecorder: cc.MetricsRecorder(), subConns: resolver.NewAddressMapV2[*scData](), state: connectivity.Connecting, cancelConnectionTimer: func() {}, } b.logger = internalgrpclog.NewPrefixLogger(logger, fmt.Sprintf(logPrefix, b)) return b } func (b pickfirstBuilder) Name() string { return Name } func (pickfirstBuilder) ParseConfig(js json.RawMessage) (serviceconfig.LoadBalancingConfig, error) { var cfg pfConfig if err := json.Unmarshal(js, &cfg); err != nil { return nil, fmt.Errorf("pickfirst: unable to unmarshal LB policy config: %s, error: %v", string(js), err) } return cfg, nil } // EnableHealthListener updates the state to configure pickfirst for using a // generic health listener. // // # Experimental // // Notice: This API is EXPERIMENTAL and may be changed or removed in a later // release. func EnableHealthListener(state resolver.State) resolver.State { state.Attributes = state.Attributes.WithValue(enableHealthListenerKeyType{}, true) return state } type pfConfig struct { serviceconfig.LoadBalancingConfig `json:"-"` // If set to true, instructs the LB policy to shuffle the order of the list // of endpoints received from the name resolver before attempting to // connect to them. ShuffleAddressList bool `json:"shuffleAddressList"` } // scData keeps track of the current state of the subConn. // It is not safe for concurrent access. type scData struct { // The following fields are initialized at build time and read-only after // that. subConn balancer.SubConn addr resolver.Address rawConnectivityState connectivity.State // The effective connectivity state based on raw connectivity, health state // and after following sticky TransientFailure behaviour defined in A62. effectiveState connectivity.State lastErr error connectionFailedInFirstPass bool } func (b *pickfirstBalancer) newSCData(addr resolver.Address) (*scData, error) { sd := &scData{ rawConnectivityState: connectivity.Idle, effectiveState: connectivity.Idle, addr: addr, } sc, err := b.cc.NewSubConn([]resolver.Address{addr}, balancer.NewSubConnOptions{ StateListener: func(state balancer.SubConnState) { b.updateSubConnState(sd, state) }, }) if err != nil { return nil, err } sd.subConn = sc return sd, nil } type pickfirstBalancer struct { // The following fields are initialized at build time and read-only after // that and therefore do not need to be guarded by a mutex. logger *internalgrpclog.PrefixLogger cc balancer.ClientConn target string metricsRecorder expstats.MetricsRecorder // guaranteed to be non nil // The mutex is used to ensure synchronization of updates triggered // from the idle picker and the already serialized resolver, // SubConn state updates. mu sync.Mutex // State reported to the channel based on SubConn states and resolver // updates. state connectivity.State // scData for active subonns mapped by address. subConns *resolver.AddressMapV2[*scData] addressList addressList firstPass bool numTF int cancelConnectionTimer func() healthCheckingEnabled bool } // ResolverError is called by the ClientConn when the name resolver produces // an error or when pickfirst determined the resolver update to be invalid. func (b *pickfirstBalancer) ResolverError(err error) { b.mu.Lock() defer b.mu.Unlock() b.resolverErrorLocked(err) } func (b *pickfirstBalancer) resolverErrorLocked(err error) { if b.logger.V(2) { b.logger.Infof("Received error from the name resolver: %v", err) } // The picker will not change since the balancer does not currently // report an error. If the balancer hasn't received a single good resolver // update yet, transition to TRANSIENT_FAILURE. if b.state != connectivity.TransientFailure && b.addressList.size() > 0 { if b.logger.V(2) { b.logger.Infof("Ignoring resolver error because balancer is using a previous good update.") } return } b.updateBalancerState(balancer.State{ ConnectivityState: connectivity.TransientFailure, Picker: &picker{err: fmt.Errorf("name resolver error: %v", err)}, }) } func (b *pickfirstBalancer) UpdateClientConnState(state balancer.ClientConnState) error { b.mu.Lock() defer b.mu.Unlock() b.cancelConnectionTimer() if len(state.ResolverState.Addresses) == 0 && len(state.ResolverState.Endpoints) == 0 { // Cleanup state pertaining to the previous resolver state. // Treat an empty address list like an error by calling b.ResolverError. b.closeSubConnsLocked() b.addressList.updateAddrs(nil) b.resolverErrorLocked(errors.New("produced zero addresses")) return balancer.ErrBadResolverState } b.healthCheckingEnabled = state.ResolverState.Attributes.Value(enableHealthListenerKeyType{}) != nil cfg, ok := state.BalancerConfig.(pfConfig) if state.BalancerConfig != nil && !ok { return fmt.Errorf("pickfirst: received illegal BalancerConfig (type %T): %v: %w", state.BalancerConfig, state.BalancerConfig, balancer.ErrBadResolverState) } if b.logger.V(2) { b.logger.Infof("Received new config %s, resolver state %s", pretty.ToJSON(cfg), pretty.ToJSON(state.ResolverState)) } var newAddrs []resolver.Address if endpoints := state.ResolverState.Endpoints; len(endpoints) != 0 { // Perform the optional shuffling described in gRFC A62. The shuffling // will change the order of endpoints but not touch the order of the // addresses within each endpoint. - A61 if cfg.ShuffleAddressList { endpoints = append([]resolver.Endpoint{}, endpoints...) internal.RandShuffle(len(endpoints), func(i, j int) { endpoints[i], endpoints[j] = endpoints[j], endpoints[i] }) } // "Flatten the list by concatenating the ordered list of addresses for // each of the endpoints, in order." - A61 for _, endpoint := range endpoints { newAddrs = append(newAddrs, endpoint.Addresses...) } } else { // Endpoints not set, process addresses until we migrate resolver // emissions fully to Endpoints. The top channel does wrap emitted // addresses with endpoints, however some balancers such as weighted // target do not forward the corresponding correct endpoints down/split // endpoints properly. Once all balancers correctly forward endpoints // down, can delete this else conditional. newAddrs = state.ResolverState.Addresses if cfg.ShuffleAddressList { newAddrs = append([]resolver.Address{}, newAddrs...) internal.RandShuffle(len(newAddrs), func(i, j int) { newAddrs[i], newAddrs[j] = newAddrs[j], newAddrs[i] }) } } // If an address appears in multiple endpoints or in the same endpoint // multiple times, we keep it only once. We will create only one SubConn // for the address because an AddressMap is used to store SubConns. // Not de-duplicating would result in attempting to connect to the same // SubConn multiple times in the same pass. We don't want this. newAddrs = deDupAddresses(newAddrs) newAddrs = interleaveAddresses(newAddrs) prevAddr := b.addressList.currentAddress() prevSCData, found := b.subConns.Get(prevAddr) prevAddrsCount := b.addressList.size() isPrevRawConnectivityStateReady := found && prevSCData.rawConnectivityState == connectivity.Ready b.addressList.updateAddrs(newAddrs) // If the previous ready SubConn exists in new address list, // keep this connection and don't create new SubConns. if isPrevRawConnectivityStateReady && b.addressList.seekTo(prevAddr) { return nil } b.reconcileSubConnsLocked(newAddrs) // If it's the first resolver update or the balancer was already READY // (but the new address list does not contain the ready SubConn) or // CONNECTING, enter CONNECTING. // We may be in TRANSIENT_FAILURE due to a previous empty address list, // we should still enter CONNECTING because the sticky TF behaviour // mentioned in A62 applies only when the TRANSIENT_FAILURE is reported // due to connectivity failures. if isPrevRawConnectivityStateReady || b.state == connectivity.Connecting || prevAddrsCount == 0 { // Start connection attempt at first address. b.forceUpdateConcludedStateLocked(balancer.State{ ConnectivityState: connectivity.Connecting, Picker: &picker{err: balancer.ErrNoSubConnAvailable}, }) b.startFirstPassLocked() } else if b.state == connectivity.TransientFailure { // If we're in TRANSIENT_FAILURE, we stay in TRANSIENT_FAILURE until // we're READY. See A62. b.startFirstPassLocked() } return nil } // UpdateSubConnState is unused as a StateListener is always registered when // creating SubConns. func (b *pickfirstBalancer) UpdateSubConnState(subConn balancer.SubConn, state balancer.SubConnState) { b.logger.Errorf("UpdateSubConnState(%v, %+v) called unexpectedly", subConn, state) } func (b *pickfirstBalancer) Close() { b.mu.Lock() defer b.mu.Unlock() b.closeSubConnsLocked() b.cancelConnectionTimer() b.state = connectivity.Shutdown } // ExitIdle moves the balancer out of idle state. It can be called concurrently // by the idlePicker and clientConn so access to variables should be // synchronized. func (b *pickfirstBalancer) ExitIdle() { b.mu.Lock() defer b.mu.Unlock() if b.state == connectivity.Idle { // Move the balancer into CONNECTING state immediately. This is done to // avoid staying in IDLE if a resolver update arrives before the first // SubConn reports CONNECTING. b.updateBalancerState(balancer.State{ ConnectivityState: connectivity.Connecting, Picker: &picker{err: balancer.ErrNoSubConnAvailable}, }) b.startFirstPassLocked() } } func (b *pickfirstBalancer) startFirstPassLocked() { b.firstPass = true b.numTF = 0 // Reset the connection attempt record for existing SubConns. for _, sd := range b.subConns.Values() { sd.connectionFailedInFirstPass = false } b.requestConnectionLocked() } func (b *pickfirstBalancer) closeSubConnsLocked() { for _, sd := range b.subConns.Values() { sd.subConn.Shutdown() } b.subConns = resolver.NewAddressMapV2[*scData]() } // deDupAddresses ensures that each address appears only once in the slice. func deDupAddresses(addrs []resolver.Address) []resolver.Address { seenAddrs := resolver.NewAddressMapV2[bool]() retAddrs := []resolver.Address{} for _, addr := range addrs { if _, ok := seenAddrs.Get(addr); ok { continue } seenAddrs.Set(addr, true) retAddrs = append(retAddrs, addr) } return retAddrs } // interleaveAddresses interleaves addresses of both families (IPv4 and IPv6) // as per RFC-8305 section 4. // Whichever address family is first in the list is followed by an address of // the other address family; that is, if the first address in the list is IPv6, // then the first IPv4 address should be moved up in the list to be second in // the list. It doesn't support configuring "First Address Family Count", i.e. // there will always be a single member of the first address family at the // beginning of the interleaved list. // Addresses that are neither IPv4 nor IPv6 are treated as part of a third // "unknown" family for interleaving. // See: https://datatracker.ietf.org/doc/html/rfc8305#autoid-6 func interleaveAddresses(addrs []resolver.Address) []resolver.Address { familyAddrsMap := map[ipAddrFamily][]resolver.Address{} interleavingOrder := []ipAddrFamily{} for _, addr := range addrs { family := addressFamily(addr.Addr) if _, found := familyAddrsMap[family]; !found { interleavingOrder = append(interleavingOrder, family) } familyAddrsMap[family] = append(familyAddrsMap[family], addr) } interleavedAddrs := make([]resolver.Address, 0, len(addrs)) for curFamilyIdx := 0; len(interleavedAddrs) < len(addrs); curFamilyIdx = (curFamilyIdx + 1) % len(interleavingOrder) { // Some IP types may have fewer addresses than others, so we look for // the next type that has a remaining member to add to the interleaved // list. family := interleavingOrder[curFamilyIdx] remainingMembers := familyAddrsMap[family] if len(remainingMembers) > 0 { interleavedAddrs = append(interleavedAddrs, remainingMembers[0]) familyAddrsMap[family] = remainingMembers[1:] } } return interleavedAddrs } // addressFamily returns the ipAddrFamily after parsing the address string. // If the address isn't of the format "ip-address:port", it returns // ipAddrFamilyUnknown. The address may be valid even if it's not an IP when // using a resolver like passthrough where the address may be a hostname in // some format that the dialer can resolve. func addressFamily(address string) ipAddrFamily { // Parse the IP after removing the port. host, _, err := net.SplitHostPort(address) if err != nil { return ipAddrFamilyUnknown } ip, err := netip.ParseAddr(host) if err != nil { return ipAddrFamilyUnknown } switch { case ip.Is4() || ip.Is4In6(): return ipAddrFamilyV4 case ip.Is6(): return ipAddrFamilyV6 default: return ipAddrFamilyUnknown } } // reconcileSubConnsLocked updates the active subchannels based on a new address // list from the resolver. It does this by: // - closing subchannels: any existing subchannels associated with addresses // that are no longer in the updated list are shut down. // - removing subchannels: entries for these closed subchannels are removed // from the subchannel map. // // This ensures that the subchannel map accurately reflects the current set of // addresses received from the name resolver. func (b *pickfirstBalancer) reconcileSubConnsLocked(newAddrs []resolver.Address) { newAddrsMap := resolver.NewAddressMapV2[bool]() for _, addr := range newAddrs { newAddrsMap.Set(addr, true) } for _, oldAddr := range b.subConns.Keys() { if _, ok := newAddrsMap.Get(oldAddr); ok { continue } val, _ := b.subConns.Get(oldAddr) val.subConn.Shutdown() b.subConns.Delete(oldAddr) } } // shutdownRemainingLocked shuts down remaining subConns. Called when a subConn // becomes ready, which means that all other subConn must be shutdown. func (b *pickfirstBalancer) shutdownRemainingLocked(selected *scData) { b.cancelConnectionTimer() for _, sd := range b.subConns.Values() { if sd.subConn != selected.subConn { sd.subConn.Shutdown() } } b.subConns = resolver.NewAddressMapV2[*scData]() b.subConns.Set(selected.addr, selected) } // requestConnectionLocked starts connecting on the subchannel corresponding to // the current address. If no subchannel exists, one is created. If the current // subchannel is in TransientFailure, a connection to the next address is // attempted until a subchannel is found. func (b *pickfirstBalancer) requestConnectionLocked() { if !b.addressList.isValid() { return } var lastErr error for valid := true; valid; valid = b.addressList.increment() { curAddr := b.addressList.currentAddress() sd, ok := b.subConns.Get(curAddr) if !ok { var err error // We want to assign the new scData to sd from the outer scope, // hence we can't use := below. sd, err = b.newSCData(curAddr) if err != nil { // This should never happen, unless the clientConn is being shut // down. if b.logger.V(2) { b.logger.Infof("Failed to create a subConn for address %v: %v", curAddr.String(), err) } // Do nothing, the LB policy will be closed soon. return } b.subConns.Set(curAddr, sd) } switch sd.rawConnectivityState { case connectivity.Idle: sd.subConn.Connect() b.scheduleNextConnectionLocked() return case connectivity.TransientFailure: // The SubConn is being re-used and failed during a previous pass // over the addressList. It has not completed backoff yet. // Mark it as having failed and try the next address. sd.connectionFailedInFirstPass = true lastErr = sd.lastErr continue case connectivity.Connecting: // Wait for the connection attempt to complete or the timer to fire // before attempting the next address. b.scheduleNextConnectionLocked() return default: b.logger.Errorf("SubConn with unexpected state %v present in SubConns map.", sd.rawConnectivityState) return } } // All the remaining addresses in the list are in TRANSIENT_FAILURE, end the // first pass if possible. b.endFirstPassIfPossibleLocked(lastErr) } func (b *pickfirstBalancer) scheduleNextConnectionLocked() { b.cancelConnectionTimer() if !b.addressList.hasNext() { return } curAddr := b.addressList.currentAddress() cancelled := false // Access to this is protected by the balancer's mutex. closeFn := internal.TimeAfterFunc(connectionDelayInterval, func() { b.mu.Lock() defer b.mu.Unlock() // If the scheduled task is cancelled while acquiring the mutex, return. if cancelled { return } if b.logger.V(2) { b.logger.Infof("Happy Eyeballs timer expired while waiting for connection to %q.", curAddr.Addr) } if b.addressList.increment() { b.requestConnectionLocked() } }) // Access to the cancellation callback held by the balancer is guarded by // the balancer's mutex, so it's safe to set the boolean from the callback. b.cancelConnectionTimer = sync.OnceFunc(func() { cancelled = true closeFn() }) } func (b *pickfirstBalancer) updateSubConnState(sd *scData, newState balancer.SubConnState) { b.mu.Lock() defer b.mu.Unlock() oldState := sd.rawConnectivityState sd.rawConnectivityState = newState.ConnectivityState // Previously relevant SubConns can still callback with state updates. // To prevent pickers from returning these obsolete SubConns, this logic // is included to check if the current list of active SubConns includes this // SubConn. if !b.isActiveSCData(sd) { return } if newState.ConnectivityState == connectivity.Shutdown { sd.effectiveState = connectivity.Shutdown return } // Record a connection attempt when exiting CONNECTING. if newState.ConnectivityState == connectivity.TransientFailure { sd.connectionFailedInFirstPass = true connectionAttemptsFailedMetric.Record(b.metricsRecorder, 1, b.target) } if newState.ConnectivityState == connectivity.Ready { connectionAttemptsSucceededMetric.Record(b.metricsRecorder, 1, b.target) b.shutdownRemainingLocked(sd) if !b.addressList.seekTo(sd.addr) { // This should not fail as we should have only one SubConn after // entering READY. The SubConn should be present in the addressList. b.logger.Errorf("Address %q not found address list in %v", sd.addr, b.addressList.addresses) return } if !b.healthCheckingEnabled { if b.logger.V(2) { b.logger.Infof("SubConn %p reported connectivity state READY and the health listener is disabled. Transitioning SubConn to READY.", sd.subConn) } sd.effectiveState = connectivity.Ready b.updateBalancerState(balancer.State{ ConnectivityState: connectivity.Ready, Picker: &picker{result: balancer.PickResult{SubConn: sd.subConn}}, }) return } if b.logger.V(2) { b.logger.Infof("SubConn %p reported connectivity state READY. Registering health listener.", sd.subConn) } // Send a CONNECTING update to take the SubConn out of sticky-TF if // required. sd.effectiveState = connectivity.Connecting b.updateBalancerState(balancer.State{ ConnectivityState: connectivity.Connecting, Picker: &picker{err: balancer.ErrNoSubConnAvailable}, }) sd.subConn.RegisterHealthListener(func(scs balancer.SubConnState) { b.updateSubConnHealthState(sd, scs) }) return } // If the LB policy is READY, and it receives a subchannel state change, // it means that the READY subchannel has failed. // A SubConn can also transition from CONNECTING directly to IDLE when // a transport is successfully created, but the connection fails // before the SubConn can send the notification for READY. We treat // this as a successful connection and transition to IDLE. // TODO: https://github.com/grpc/grpc-go/issues/7862 - Remove the second // part of the if condition below once the issue is fixed. if oldState == connectivity.Ready || (oldState == connectivity.Connecting && newState.ConnectivityState == connectivity.Idle) { // Once a transport fails, the balancer enters IDLE and starts from // the first address when the picker is used. b.shutdownRemainingLocked(sd) sd.effectiveState = newState.ConnectivityState // READY SubConn interspliced in between CONNECTING and IDLE, need to // account for that. if oldState == connectivity.Connecting { // A known issue (https://github.com/grpc/grpc-go/issues/7862) // causes a race that prevents the READY state change notification. // This works around it. connectionAttemptsSucceededMetric.Record(b.metricsRecorder, 1, b.target) } disconnectionsMetric.Record(b.metricsRecorder, 1, b.target) b.addressList.reset() b.updateBalancerState(balancer.State{ ConnectivityState: connectivity.Idle, Picker: &idlePicker{exitIdle: sync.OnceFunc(b.ExitIdle)}, }) return } if b.firstPass { switch newState.ConnectivityState { case connectivity.Connecting: // The effective state can be in either IDLE, CONNECTING or // TRANSIENT_FAILURE. If it's TRANSIENT_FAILURE, stay in // TRANSIENT_FAILURE until it's READY. See A62. if sd.effectiveState != connectivity.TransientFailure { sd.effectiveState = connectivity.Connecting b.updateBalancerState(balancer.State{ ConnectivityState: connectivity.Connecting, Picker: &picker{err: balancer.ErrNoSubConnAvailable}, }) } case connectivity.TransientFailure: sd.lastErr = newState.ConnectionError sd.effectiveState = connectivity.TransientFailure // Since we're re-using common SubConns while handling resolver // updates, we could receive an out of turn TRANSIENT_FAILURE from // a pass over the previous address list. Happy Eyeballs will also // cause out of order updates to arrive. if curAddr := b.addressList.currentAddress(); equalAddressIgnoringBalAttributes(&curAddr, &sd.addr) { b.cancelConnectionTimer() if b.addressList.increment() { b.requestConnectionLocked() return } } // End the first pass if we've seen a TRANSIENT_FAILURE from all // SubConns once. b.endFirstPassIfPossibleLocked(newState.ConnectionError) } return } // We have finished the first pass, keep re-connecting failing SubConns. switch newState.ConnectivityState { case connectivity.TransientFailure: b.numTF = (b.numTF + 1) % b.subConns.Len() sd.lastErr = newState.ConnectionError if b.numTF%b.subConns.Len() == 0 { b.updateBalancerState(balancer.State{ ConnectivityState: connectivity.TransientFailure, Picker: &picker{err: newState.ConnectionError}, }) } // We don't need to request re-resolution since the SubConn already // does that before reporting TRANSIENT_FAILURE. // TODO: #7534 - Move re-resolution requests from SubConn into // pick_first. case connectivity.Idle: sd.subConn.Connect() } } // endFirstPassIfPossibleLocked ends the first happy-eyeballs pass if all the // addresses are tried and their SubConns have reported a failure. func (b *pickfirstBalancer) endFirstPassIfPossibleLocked(lastErr error) { // An optimization to avoid iterating over the entire SubConn map. if b.addressList.isValid() { return } // Connect() has been called on all the SubConns. The first pass can be // ended if all the SubConns have reported a failure. for _, sd := range b.subConns.Values() { if !sd.connectionFailedInFirstPass { return } } b.firstPass = false b.updateBalancerState(balancer.State{ ConnectivityState: connectivity.TransientFailure, Picker: &picker{err: lastErr}, }) // Start re-connecting all the SubConns that are already in IDLE. for _, sd := range b.subConns.Values() { if sd.rawConnectivityState == connectivity.Idle { sd.subConn.Connect() } } } func (b *pickfirstBalancer) isActiveSCData(sd *scData) bool { activeSD, found := b.subConns.Get(sd.addr) return found && activeSD == sd } func (b *pickfirstBalancer) updateSubConnHealthState(sd *scData, state balancer.SubConnState) { b.mu.Lock() defer b.mu.Unlock() // Previously relevant SubConns can still callback with state updates. // To prevent pickers from returning these obsolete SubConns, this logic // is included to check if the current list of active SubConns includes // this SubConn. if !b.isActiveSCData(sd) { return } sd.effectiveState = state.ConnectivityState switch state.ConnectivityState { case connectivity.Ready: b.updateBalancerState(balancer.State{ ConnectivityState: connectivity.Ready, Picker: &picker{result: balancer.PickResult{SubConn: sd.subConn}}, }) case connectivity.TransientFailure: b.updateBalancerState(balancer.State{ ConnectivityState: connectivity.TransientFailure, Picker: &picker{err: fmt.Errorf("pickfirst: health check failure: %v", state.ConnectionError)}, }) case connectivity.Connecting: b.updateBalancerState(balancer.State{ ConnectivityState: connectivity.Connecting, Picker: &picker{err: balancer.ErrNoSubConnAvailable}, }) default: b.logger.Errorf("Got unexpected health update for SubConn %p: %v", state) } } // updateBalancerState stores the state reported to the channel and calls // ClientConn.UpdateState(). As an optimization, it avoids sending duplicate // updates to the channel. func (b *pickfirstBalancer) updateBalancerState(newState balancer.State) { // In case of TransientFailures allow the picker to be updated to update // the connectivity error, in all other cases don't send duplicate state // updates. if newState.ConnectivityState == b.state && b.state != connectivity.TransientFailure { return } b.forceUpdateConcludedStateLocked(newState) } // forceUpdateConcludedStateLocked stores the state reported to the channel and // calls ClientConn.UpdateState(). // A separate function is defined to force update the ClientConn state since the // channel doesn't correctly assume that LB policies start in CONNECTING and // relies on LB policy to send an initial CONNECTING update. func (b *pickfirstBalancer) forceUpdateConcludedStateLocked(newState balancer.State) { b.state = newState.ConnectivityState b.cc.UpdateState(newState) } type picker struct { result balancer.PickResult err error } func (p *picker) Pick(balancer.PickInfo) (balancer.PickResult, error) { return p.result, p.err } // idlePicker is used when the SubConn is IDLE and kicks the SubConn into // CONNECTING when Pick is called. type idlePicker struct { exitIdle func() } func (i *idlePicker) Pick(balancer.PickInfo) (balancer.PickResult, error) { i.exitIdle() return balancer.PickResult{}, balancer.ErrNoSubConnAvailable } // addressList manages sequentially iterating over addresses present in a list // of endpoints. It provides a 1 dimensional view of the addresses present in // the endpoints. // This type is not safe for concurrent access. type addressList struct { addresses []resolver.Address idx int } func (al *addressList) isValid() bool { return al.idx < len(al.addresses) } func (al *addressList) size() int { return len(al.addresses) } // increment moves to the next index in the address list. // This method returns false if it went off the list, true otherwise. func (al *addressList) increment() bool { if !al.isValid() { return false } al.idx++ return al.idx < len(al.addresses) } // currentAddress returns the current address pointed to in the addressList. // If the list is in an invalid state, it returns an empty address instead. func (al *addressList) currentAddress() resolver.Address { if !al.isValid() { return resolver.Address{} } return al.addresses[al.idx] } func (al *addressList) reset() { al.idx = 0 } func (al *addressList) updateAddrs(addrs []resolver.Address) { al.addresses = addrs al.reset() } // seekTo returns false if the needle was not found and the current index was // left unchanged. func (al *addressList) seekTo(needle resolver.Address) bool { for ai, addr := range al.addresses { if !equalAddressIgnoringBalAttributes(&addr, &needle) { continue } al.idx = ai return true } return false } // hasNext returns whether incrementing the addressList will result in moving // past the end of the list. If the list has already moved past the end, it // returns false. func (al *addressList) hasNext() bool { if !al.isValid() { return false } return al.idx+1 < len(al.addresses) } // equalAddressIgnoringBalAttributes returns true is a and b are considered // equal. This is different from the Equal method on the resolver.Address type // which considers all fields to determine equality. Here, we only consider // fields that are meaningful to the SubConn. func equalAddressIgnoringBalAttributes(a, b *resolver.Address) bool { return a.Addr == b.Addr && a.ServerName == b.ServerName && a.Attributes.Equal(b.Attributes) } ================================================ FILE: vendor/google.golang.org/grpc/balancer/roundrobin/roundrobin.go ================================================ /* * * Copyright 2017 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package roundrobin defines a roundrobin balancer. Roundrobin balancer is // installed as one of the default balancers in gRPC, users don't need to // explicitly install this balancer. package roundrobin import ( "fmt" "google.golang.org/grpc/balancer" "google.golang.org/grpc/balancer/endpointsharding" "google.golang.org/grpc/balancer/pickfirst" "google.golang.org/grpc/grpclog" internalgrpclog "google.golang.org/grpc/internal/grpclog" ) // Name is the name of round_robin balancer. const Name = "round_robin" var logger = grpclog.Component("roundrobin") func init() { balancer.Register(builder{}) } type builder struct{} func (bb builder) Name() string { return Name } func (bb builder) Build(cc balancer.ClientConn, opts balancer.BuildOptions) balancer.Balancer { childBuilder := balancer.Get(pickfirst.Name).Build bal := &rrBalancer{ cc: cc, Balancer: endpointsharding.NewBalancer(cc, opts, childBuilder, endpointsharding.Options{}), } bal.logger = internalgrpclog.NewPrefixLogger(logger, fmt.Sprintf("[%p] ", bal)) bal.logger.Infof("Created") return bal } type rrBalancer struct { balancer.Balancer cc balancer.ClientConn logger *internalgrpclog.PrefixLogger } func (b *rrBalancer) UpdateClientConnState(ccs balancer.ClientConnState) error { return b.Balancer.UpdateClientConnState(balancer.ClientConnState{ // Enable the health listener in pickfirst children for client side health // checks and outlier detection, if configured. ResolverState: pickfirst.EnableHealthListener(ccs.ResolverState), }) } ================================================ FILE: vendor/google.golang.org/grpc/balancer/subconn.go ================================================ /* * * Copyright 2024 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package balancer import ( "google.golang.org/grpc/connectivity" "google.golang.org/grpc/internal" "google.golang.org/grpc/resolver" ) // A SubConn represents a single connection to a gRPC backend service. // // All SubConns start in IDLE, and will not try to connect. To trigger a // connection attempt, Balancers must call Connect. // // If the connection attempt fails, the SubConn will transition to // TRANSIENT_FAILURE for a backoff period, and then return to IDLE. If the // connection attempt succeeds, it will transition to READY. // // If a READY SubConn becomes disconnected, the SubConn will transition to IDLE. // // If a connection re-enters IDLE, Balancers must call Connect again to trigger // a new connection attempt. // // Each SubConn contains a list of addresses. gRPC will try to connect to the // addresses in sequence, and stop trying the remainder once the first // connection is successful. However, this behavior is deprecated. SubConns // should only use a single address. // // NOTICE: This interface is intended to be implemented by gRPC, or intercepted // by custom load balancing polices. Users should not need their own complete // implementation of this interface -- they should always delegate to a SubConn // returned by ClientConn.NewSubConn() by embedding it in their implementations. // An embedded SubConn must never be nil, or runtime panics will occur. type SubConn interface { // UpdateAddresses updates the addresses used in this SubConn. // gRPC checks if currently-connected address is still in the new list. // If it's in the list, the connection will be kept. // If it's not in the list, the connection will gracefully close, and // a new connection will be created. // // This will trigger a state transition for the SubConn. // // Deprecated: this method will be removed. Create new SubConns for new // addresses instead. UpdateAddresses([]resolver.Address) // Connect starts the connecting for this SubConn. Connect() // GetOrBuildProducer returns a reference to the existing Producer for this // ProducerBuilder in this SubConn, or, if one does not currently exist, // creates a new one and returns it. Returns a close function which may be // called when the Producer is no longer needed. Otherwise the producer // will automatically be closed upon connection loss or subchannel close. // Should only be called on a SubConn in state Ready. Otherwise the // producer will be unable to create streams. GetOrBuildProducer(ProducerBuilder) (p Producer, close func()) // Shutdown shuts down the SubConn gracefully. Any started RPCs will be // allowed to complete. No future calls should be made on the SubConn. // One final state update will be delivered to the StateListener (or // UpdateSubConnState; deprecated) with ConnectivityState of Shutdown to // indicate the shutdown operation. This may be delivered before // in-progress RPCs are complete and the actual connection is closed. Shutdown() // RegisterHealthListener registers a health listener that receives health // updates for a Ready SubConn. Only one health listener can be registered // at a time. A health listener should be registered each time the SubConn's // connectivity state changes to READY. Registering a health listener when // the connectivity state is not READY may result in undefined behaviour. // This method must not be called synchronously while handling an update // from a previously registered health listener. RegisterHealthListener(func(SubConnState)) // EnforceSubConnEmbedding is included to force implementers to embed // another implementation of this interface, allowing gRPC to add methods // without breaking users. internal.EnforceSubConnEmbedding } // A ProducerBuilder is a simple constructor for a Producer. It is used by the // SubConn to create producers when needed. type ProducerBuilder interface { // Build creates a Producer. The first parameter is always a // grpc.ClientConnInterface (a type to allow creating RPCs/streams on the // associated SubConn), but is declared as `any` to avoid a dependency // cycle. Build also returns a close function that will be called when all // references to the Producer have been given up for a SubConn, or when a // connectivity state change occurs on the SubConn. The close function // should always block until all asynchronous cleanup work is completed. Build(grpcClientConnInterface any) (p Producer, close func()) } // SubConnState describes the state of a SubConn. type SubConnState struct { // ConnectivityState is the connectivity state of the SubConn. ConnectivityState connectivity.State // ConnectionError is set if the ConnectivityState is TransientFailure, // describing the reason the SubConn failed. Otherwise, it is nil. ConnectionError error // connectedAddr contains the connected address when ConnectivityState is // Ready. Otherwise, it is indeterminate. connectedAddress resolver.Address } // connectedAddress returns the connected address for a SubConnState. The // address is only valid if the state is READY. func connectedAddress(scs SubConnState) resolver.Address { return scs.connectedAddress } // setConnectedAddress sets the connected address for a SubConnState. func setConnectedAddress(scs *SubConnState, addr resolver.Address) { scs.connectedAddress = addr } // A Producer is a type shared among potentially many consumers. It is // associated with a SubConn, and an implementation will typically contain // other methods to provide additional functionality, e.g. configuration or // subscription registration. type Producer any ================================================ FILE: vendor/google.golang.org/grpc/balancer_wrapper.go ================================================ /* * * Copyright 2017 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package grpc import ( "context" "fmt" "sync" "google.golang.org/grpc/balancer" "google.golang.org/grpc/codes" "google.golang.org/grpc/connectivity" "google.golang.org/grpc/experimental/stats" "google.golang.org/grpc/internal" "google.golang.org/grpc/internal/balancer/gracefulswitch" "google.golang.org/grpc/internal/channelz" "google.golang.org/grpc/internal/grpcsync" "google.golang.org/grpc/resolver" "google.golang.org/grpc/status" ) var ( setConnectedAddress = internal.SetConnectedAddress.(func(*balancer.SubConnState, resolver.Address)) // noOpRegisterHealthListenerFn is used when client side health checking is // disabled. It sends a single READY update on the registered listener. noOpRegisterHealthListenerFn = func(_ context.Context, listener func(balancer.SubConnState)) func() { listener(balancer.SubConnState{ConnectivityState: connectivity.Ready}) return func() {} } ) // ccBalancerWrapper sits between the ClientConn and the Balancer. // // ccBalancerWrapper implements methods corresponding to the ones on the // balancer.Balancer interface. The ClientConn is free to call these methods // concurrently and the ccBalancerWrapper ensures that calls from the ClientConn // to the Balancer happen in order by performing them in the serializer, without // any mutexes held. // // ccBalancerWrapper also implements the balancer.ClientConn interface and is // passed to the Balancer implementations. It invokes unexported methods on the // ClientConn to handle these calls from the Balancer. // // It uses the gracefulswitch.Balancer internally to ensure that balancer // switches happen in a graceful manner. type ccBalancerWrapper struct { internal.EnforceClientConnEmbedding // The following fields are initialized when the wrapper is created and are // read-only afterwards, and therefore can be accessed without a mutex. cc *ClientConn opts balancer.BuildOptions serializer *grpcsync.CallbackSerializer serializerCancel context.CancelFunc // The following fields are only accessed within the serializer or during // initialization. curBalancerName string balancer *gracefulswitch.Balancer // The following field is protected by mu. Caller must take cc.mu before // taking mu. mu sync.Mutex closed bool } // newCCBalancerWrapper creates a new balancer wrapper in idle state. The // underlying balancer is not created until the updateClientConnState() method // is invoked. func newCCBalancerWrapper(cc *ClientConn) *ccBalancerWrapper { ctx, cancel := context.WithCancel(cc.ctx) ccb := &ccBalancerWrapper{ cc: cc, opts: balancer.BuildOptions{ DialCreds: cc.dopts.copts.TransportCredentials, CredsBundle: cc.dopts.copts.CredsBundle, Dialer: cc.dopts.copts.Dialer, Authority: cc.authority, CustomUserAgent: cc.dopts.copts.UserAgent, ChannelzParent: cc.channelz, Target: cc.parsedTarget, }, serializer: grpcsync.NewCallbackSerializer(ctx), serializerCancel: cancel, } ccb.balancer = gracefulswitch.NewBalancer(ccb, ccb.opts) return ccb } func (ccb *ccBalancerWrapper) MetricsRecorder() stats.MetricsRecorder { return ccb.cc.metricsRecorderList } // updateClientConnState is invoked by grpc to push a ClientConnState update to // the underlying balancer. This is always executed from the serializer, so // it is safe to call into the balancer here. func (ccb *ccBalancerWrapper) updateClientConnState(ccs *balancer.ClientConnState) error { errCh := make(chan error) uccs := func(ctx context.Context) { defer close(errCh) if ctx.Err() != nil || ccb.balancer == nil { return } name := gracefulswitch.ChildName(ccs.BalancerConfig) if ccb.curBalancerName != name { ccb.curBalancerName = name channelz.Infof(logger, ccb.cc.channelz, "Channel switches to new LB policy %q", name) } err := ccb.balancer.UpdateClientConnState(*ccs) if logger.V(2) && err != nil { logger.Infof("error from balancer.UpdateClientConnState: %v", err) } errCh <- err } onFailure := func() { close(errCh) } // UpdateClientConnState can race with Close, and when the latter wins, the // serializer is closed, and the attempt to schedule the callback will fail. // It is acceptable to ignore this failure. But since we want to handle the // state update in a blocking fashion (when we successfully schedule the // callback), we have to use the ScheduleOr method and not the MaybeSchedule // method on the serializer. ccb.serializer.ScheduleOr(uccs, onFailure) return <-errCh } // resolverError is invoked by grpc to push a resolver error to the underlying // balancer. The call to the balancer is executed from the serializer. func (ccb *ccBalancerWrapper) resolverError(err error) { ccb.serializer.TrySchedule(func(ctx context.Context) { if ctx.Err() != nil || ccb.balancer == nil { return } ccb.balancer.ResolverError(err) }) } // close initiates async shutdown of the wrapper. cc.mu must be held when // calling this function. To determine the wrapper has finished shutting down, // the channel should block on ccb.serializer.Done() without cc.mu held. func (ccb *ccBalancerWrapper) close() { ccb.mu.Lock() ccb.closed = true ccb.mu.Unlock() channelz.Info(logger, ccb.cc.channelz, "ccBalancerWrapper: closing") ccb.serializer.TrySchedule(func(context.Context) { if ccb.balancer == nil { return } ccb.balancer.Close() ccb.balancer = nil }) ccb.serializerCancel() } // exitIdle invokes the balancer's exitIdle method in the serializer. func (ccb *ccBalancerWrapper) exitIdle() { ccb.serializer.TrySchedule(func(ctx context.Context) { if ctx.Err() != nil || ccb.balancer == nil { return } ccb.balancer.ExitIdle() }) } func (ccb *ccBalancerWrapper) NewSubConn(addrs []resolver.Address, opts balancer.NewSubConnOptions) (balancer.SubConn, error) { ccb.cc.mu.Lock() defer ccb.cc.mu.Unlock() ccb.mu.Lock() if ccb.closed { ccb.mu.Unlock() return nil, fmt.Errorf("balancer is being closed; no new SubConns allowed") } ccb.mu.Unlock() if len(addrs) == 0 { return nil, fmt.Errorf("grpc: cannot create SubConn with empty address list") } ac, err := ccb.cc.newAddrConnLocked(addrs, opts) if err != nil { channelz.Warningf(logger, ccb.cc.channelz, "acBalancerWrapper: NewSubConn: failed to newAddrConn: %v", err) return nil, err } acbw := &acBalancerWrapper{ ccb: ccb, ac: ac, producers: make(map[balancer.ProducerBuilder]*refCountedProducer), stateListener: opts.StateListener, healthData: newHealthData(connectivity.Idle), } ac.acbw = acbw return acbw, nil } func (ccb *ccBalancerWrapper) RemoveSubConn(balancer.SubConn) { // The graceful switch balancer will never call this. logger.Errorf("ccb RemoveSubConn(%v) called unexpectedly, sc") } func (ccb *ccBalancerWrapper) UpdateAddresses(sc balancer.SubConn, addrs []resolver.Address) { acbw, ok := sc.(*acBalancerWrapper) if !ok { return } acbw.UpdateAddresses(addrs) } func (ccb *ccBalancerWrapper) UpdateState(s balancer.State) { ccb.cc.mu.Lock() defer ccb.cc.mu.Unlock() if ccb.cc.conns == nil { // The CC has been closed; ignore this update. return } ccb.mu.Lock() if ccb.closed { ccb.mu.Unlock() return } ccb.mu.Unlock() // Update picker before updating state. Even though the ordering here does // not matter, it can lead to multiple calls of Pick in the common start-up // case where we wait for ready and then perform an RPC. If the picker is // updated later, we could call the "connecting" picker when the state is // updated, and then call the "ready" picker after the picker gets updated. // Note that there is no need to check if the balancer wrapper was closed, // as we know the graceful switch LB policy will not call cc if it has been // closed. ccb.cc.pickerWrapper.updatePicker(s.Picker) ccb.cc.csMgr.updateState(s.ConnectivityState) } func (ccb *ccBalancerWrapper) ResolveNow(o resolver.ResolveNowOptions) { ccb.cc.mu.RLock() defer ccb.cc.mu.RUnlock() ccb.mu.Lock() if ccb.closed { ccb.mu.Unlock() return } ccb.mu.Unlock() ccb.cc.resolveNowLocked(o) } func (ccb *ccBalancerWrapper) Target() string { return ccb.cc.target } // acBalancerWrapper is a wrapper on top of ac for balancers. // It implements balancer.SubConn interface. type acBalancerWrapper struct { internal.EnforceSubConnEmbedding ac *addrConn // read-only ccb *ccBalancerWrapper // read-only stateListener func(balancer.SubConnState) producersMu sync.Mutex producers map[balancer.ProducerBuilder]*refCountedProducer // Access to healthData is protected by healthMu. healthMu sync.Mutex // healthData is stored as a pointer to detect when the health listener is // dropped or updated. This is required as closures can't be compared for // equality. healthData *healthData } // healthData holds data related to health state reporting. type healthData struct { // connectivityState stores the most recent connectivity state delivered // to the LB policy. This is stored to avoid sending updates when the // SubConn has already exited connectivity state READY. connectivityState connectivity.State // closeHealthProducer stores function to close the ref counted health // producer. The health producer is automatically closed when the SubConn // state changes. closeHealthProducer func() } func newHealthData(s connectivity.State) *healthData { return &healthData{ connectivityState: s, closeHealthProducer: func() {}, } } // updateState is invoked by grpc to push a subConn state update to the // underlying balancer. func (acbw *acBalancerWrapper) updateState(s connectivity.State, curAddr resolver.Address, err error) { acbw.ccb.serializer.TrySchedule(func(ctx context.Context) { if ctx.Err() != nil || acbw.ccb.balancer == nil { return } // Invalidate all producers on any state change. acbw.closeProducers() // Even though it is optional for balancers, gracefulswitch ensures // opts.StateListener is set, so this cannot ever be nil. // TODO: delete this comment when UpdateSubConnState is removed. scs := balancer.SubConnState{ConnectivityState: s, ConnectionError: err} if s == connectivity.Ready { setConnectedAddress(&scs, curAddr) } // Invalidate the health listener by updating the healthData. acbw.healthMu.Lock() // A race may occur if a health listener is registered soon after the // connectivity state is set but before the stateListener is called. // Two cases may arise: // 1. The new state is not READY: RegisterHealthListener has checks to // ensure no updates are sent when the connectivity state is not // READY. // 2. The new state is READY: This means that the old state wasn't Ready. // The RegisterHealthListener API mentions that a health listener // must not be registered when a SubConn is not ready to avoid such // races. When this happens, the LB policy would get health updates // on the old listener. When the LB policy registers a new listener // on receiving the connectivity update, the health updates will be // sent to the new health listener. acbw.healthData = newHealthData(scs.ConnectivityState) acbw.healthMu.Unlock() acbw.stateListener(scs) }) } func (acbw *acBalancerWrapper) String() string { return fmt.Sprintf("SubConn(id:%d)", acbw.ac.channelz.ID) } func (acbw *acBalancerWrapper) UpdateAddresses(addrs []resolver.Address) { acbw.ac.updateAddrs(addrs) } func (acbw *acBalancerWrapper) Connect() { go acbw.ac.connect() } func (acbw *acBalancerWrapper) Shutdown() { acbw.closeProducers() acbw.ccb.cc.removeAddrConn(acbw.ac, errConnDrain) } // NewStream begins a streaming RPC on the addrConn. If the addrConn is not // ready, blocks until it is or ctx expires. Returns an error when the context // expires or the addrConn is shut down. func (acbw *acBalancerWrapper) NewStream(ctx context.Context, desc *StreamDesc, method string, opts ...CallOption) (ClientStream, error) { transport := acbw.ac.getReadyTransport() if transport == nil { return nil, status.Errorf(codes.Unavailable, "SubConn state is not Ready") } return newNonRetryClientStream(ctx, desc, method, transport, acbw.ac, opts...) } // Invoke performs a unary RPC. If the addrConn is not ready, returns // errSubConnNotReady. func (acbw *acBalancerWrapper) Invoke(ctx context.Context, method string, args any, reply any, opts ...CallOption) error { cs, err := acbw.NewStream(ctx, unaryStreamDesc, method, opts...) if err != nil { return err } if err := cs.SendMsg(args); err != nil { return err } return cs.RecvMsg(reply) } type refCountedProducer struct { producer balancer.Producer refs int // number of current refs to the producer close func() // underlying producer's close function } func (acbw *acBalancerWrapper) GetOrBuildProducer(pb balancer.ProducerBuilder) (balancer.Producer, func()) { acbw.producersMu.Lock() defer acbw.producersMu.Unlock() // Look up existing producer from this builder. pData := acbw.producers[pb] if pData == nil { // Not found; create a new one and add it to the producers map. p, closeFn := pb.Build(acbw) pData = &refCountedProducer{producer: p, close: closeFn} acbw.producers[pb] = pData } // Account for this new reference. pData.refs++ // Return a cleanup function wrapped in a OnceFunc to remove this reference // and delete the refCountedProducer from the map if the total reference // count goes to zero. unref := func() { acbw.producersMu.Lock() // If closeProducers has already closed this producer instance, refs is // set to 0, so the check after decrementing will never pass, and the // producer will not be double-closed. pData.refs-- if pData.refs == 0 { defer pData.close() // Run outside the acbw mutex delete(acbw.producers, pb) } acbw.producersMu.Unlock() } return pData.producer, sync.OnceFunc(unref) } func (acbw *acBalancerWrapper) closeProducers() { acbw.producersMu.Lock() defer acbw.producersMu.Unlock() for pb, pData := range acbw.producers { pData.refs = 0 pData.close() delete(acbw.producers, pb) } } // healthProducerRegisterFn is a type alias for the health producer's function // for registering listeners. type healthProducerRegisterFn = func(context.Context, balancer.SubConn, string, func(balancer.SubConnState)) func() // healthListenerRegFn returns a function to register a listener for health // updates. If client side health checks are disabled, the registered listener // will get a single READY (raw connectivity state) update. // // Client side health checking is enabled when all the following // conditions are satisfied: // 1. Health checking is not disabled using the dial option. // 2. The health package is imported. // 3. The health check config is present in the service config. func (acbw *acBalancerWrapper) healthListenerRegFn() func(context.Context, func(balancer.SubConnState)) func() { if acbw.ccb.cc.dopts.disableHealthCheck { return noOpRegisterHealthListenerFn } cfg := acbw.ac.cc.healthCheckConfig() if cfg == nil { return noOpRegisterHealthListenerFn } regHealthLisFn := internal.RegisterClientHealthCheckListener if regHealthLisFn == nil { // The health package is not imported. channelz.Error(logger, acbw.ac.channelz, "Health check is requested but health package is not imported.") return noOpRegisterHealthListenerFn } return func(ctx context.Context, listener func(balancer.SubConnState)) func() { return regHealthLisFn.(healthProducerRegisterFn)(ctx, acbw, cfg.ServiceName, listener) } } // RegisterHealthListener accepts a health listener from the LB policy. It sends // updates to the health listener as long as the SubConn's connectivity state // doesn't change and a new health listener is not registered. To invalidate // the currently registered health listener, acbw updates the healthData. If a // nil listener is registered, the active health listener is dropped. func (acbw *acBalancerWrapper) RegisterHealthListener(listener func(balancer.SubConnState)) { acbw.healthMu.Lock() defer acbw.healthMu.Unlock() acbw.healthData.closeHealthProducer() // listeners should not be registered when the connectivity state // isn't Ready. This may happen when the balancer registers a listener // after the connectivityState is updated, but before it is notified // of the update. if acbw.healthData.connectivityState != connectivity.Ready { return } // Replace the health data to stop sending updates to any previously // registered health listeners. hd := newHealthData(connectivity.Ready) acbw.healthData = hd if listener == nil { return } registerFn := acbw.healthListenerRegFn() acbw.ccb.serializer.TrySchedule(func(ctx context.Context) { if ctx.Err() != nil || acbw.ccb.balancer == nil { return } // Don't send updates if a new listener is registered. acbw.healthMu.Lock() defer acbw.healthMu.Unlock() if acbw.healthData != hd { return } // Serialize the health updates from the health producer with // other calls into the LB policy. listenerWrapper := func(scs balancer.SubConnState) { acbw.ccb.serializer.TrySchedule(func(ctx context.Context) { if ctx.Err() != nil || acbw.ccb.balancer == nil { return } acbw.healthMu.Lock() defer acbw.healthMu.Unlock() if acbw.healthData != hd { return } listener(scs) }) } hd.closeHealthProducer = registerFn(ctx, listenerWrapper) }) } ================================================ FILE: vendor/google.golang.org/grpc/binarylog/grpc_binarylog_v1/binarylog.pb.go ================================================ // Copyright 2018 The gRPC Authors // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // The canonical version of this proto can be found at // https://github.com/grpc/grpc-proto/blob/master/grpc/binlog/v1/binarylog.proto // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.10 // protoc v5.27.1 // source: grpc/binlog/v1/binarylog.proto package grpc_binarylog_v1 import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" durationpb "google.golang.org/protobuf/types/known/durationpb" timestamppb "google.golang.org/protobuf/types/known/timestamppb" reflect "reflect" sync "sync" unsafe "unsafe" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) // Enumerates the type of event // Note the terminology is different from the RPC semantics // definition, but the same meaning is expressed here. type GrpcLogEntry_EventType int32 const ( GrpcLogEntry_EVENT_TYPE_UNKNOWN GrpcLogEntry_EventType = 0 // Header sent from client to server GrpcLogEntry_EVENT_TYPE_CLIENT_HEADER GrpcLogEntry_EventType = 1 // Header sent from server to client GrpcLogEntry_EVENT_TYPE_SERVER_HEADER GrpcLogEntry_EventType = 2 // Message sent from client to server GrpcLogEntry_EVENT_TYPE_CLIENT_MESSAGE GrpcLogEntry_EventType = 3 // Message sent from server to client GrpcLogEntry_EVENT_TYPE_SERVER_MESSAGE GrpcLogEntry_EventType = 4 // A signal that client is done sending GrpcLogEntry_EVENT_TYPE_CLIENT_HALF_CLOSE GrpcLogEntry_EventType = 5 // Trailer indicates the end of the RPC. // On client side, this event means a trailer was either received // from the network or the gRPC library locally generated a status // to inform the application about a failure. // On server side, this event means the server application requested // to send a trailer. Note: EVENT_TYPE_CANCEL may still arrive after // this due to races on server side. GrpcLogEntry_EVENT_TYPE_SERVER_TRAILER GrpcLogEntry_EventType = 6 // A signal that the RPC is cancelled. On client side, this // indicates the client application requests a cancellation. // On server side, this indicates that cancellation was detected. // Note: This marks the end of the RPC. Events may arrive after // this due to races. For example, on client side a trailer // may arrive even though the application requested to cancel the RPC. GrpcLogEntry_EVENT_TYPE_CANCEL GrpcLogEntry_EventType = 7 ) // Enum value maps for GrpcLogEntry_EventType. var ( GrpcLogEntry_EventType_name = map[int32]string{ 0: "EVENT_TYPE_UNKNOWN", 1: "EVENT_TYPE_CLIENT_HEADER", 2: "EVENT_TYPE_SERVER_HEADER", 3: "EVENT_TYPE_CLIENT_MESSAGE", 4: "EVENT_TYPE_SERVER_MESSAGE", 5: "EVENT_TYPE_CLIENT_HALF_CLOSE", 6: "EVENT_TYPE_SERVER_TRAILER", 7: "EVENT_TYPE_CANCEL", } GrpcLogEntry_EventType_value = map[string]int32{ "EVENT_TYPE_UNKNOWN": 0, "EVENT_TYPE_CLIENT_HEADER": 1, "EVENT_TYPE_SERVER_HEADER": 2, "EVENT_TYPE_CLIENT_MESSAGE": 3, "EVENT_TYPE_SERVER_MESSAGE": 4, "EVENT_TYPE_CLIENT_HALF_CLOSE": 5, "EVENT_TYPE_SERVER_TRAILER": 6, "EVENT_TYPE_CANCEL": 7, } ) func (x GrpcLogEntry_EventType) Enum() *GrpcLogEntry_EventType { p := new(GrpcLogEntry_EventType) *p = x return p } func (x GrpcLogEntry_EventType) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (GrpcLogEntry_EventType) Descriptor() protoreflect.EnumDescriptor { return file_grpc_binlog_v1_binarylog_proto_enumTypes[0].Descriptor() } func (GrpcLogEntry_EventType) Type() protoreflect.EnumType { return &file_grpc_binlog_v1_binarylog_proto_enumTypes[0] } func (x GrpcLogEntry_EventType) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Use GrpcLogEntry_EventType.Descriptor instead. func (GrpcLogEntry_EventType) EnumDescriptor() ([]byte, []int) { return file_grpc_binlog_v1_binarylog_proto_rawDescGZIP(), []int{0, 0} } // Enumerates the entity that generates the log entry type GrpcLogEntry_Logger int32 const ( GrpcLogEntry_LOGGER_UNKNOWN GrpcLogEntry_Logger = 0 GrpcLogEntry_LOGGER_CLIENT GrpcLogEntry_Logger = 1 GrpcLogEntry_LOGGER_SERVER GrpcLogEntry_Logger = 2 ) // Enum value maps for GrpcLogEntry_Logger. var ( GrpcLogEntry_Logger_name = map[int32]string{ 0: "LOGGER_UNKNOWN", 1: "LOGGER_CLIENT", 2: "LOGGER_SERVER", } GrpcLogEntry_Logger_value = map[string]int32{ "LOGGER_UNKNOWN": 0, "LOGGER_CLIENT": 1, "LOGGER_SERVER": 2, } ) func (x GrpcLogEntry_Logger) Enum() *GrpcLogEntry_Logger { p := new(GrpcLogEntry_Logger) *p = x return p } func (x GrpcLogEntry_Logger) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (GrpcLogEntry_Logger) Descriptor() protoreflect.EnumDescriptor { return file_grpc_binlog_v1_binarylog_proto_enumTypes[1].Descriptor() } func (GrpcLogEntry_Logger) Type() protoreflect.EnumType { return &file_grpc_binlog_v1_binarylog_proto_enumTypes[1] } func (x GrpcLogEntry_Logger) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Use GrpcLogEntry_Logger.Descriptor instead. func (GrpcLogEntry_Logger) EnumDescriptor() ([]byte, []int) { return file_grpc_binlog_v1_binarylog_proto_rawDescGZIP(), []int{0, 1} } type Address_Type int32 const ( Address_TYPE_UNKNOWN Address_Type = 0 // address is in 1.2.3.4 form Address_TYPE_IPV4 Address_Type = 1 // address is in IPv6 canonical form (RFC5952 section 4) // The scope is NOT included in the address string. Address_TYPE_IPV6 Address_Type = 2 // address is UDS string Address_TYPE_UNIX Address_Type = 3 ) // Enum value maps for Address_Type. var ( Address_Type_name = map[int32]string{ 0: "TYPE_UNKNOWN", 1: "TYPE_IPV4", 2: "TYPE_IPV6", 3: "TYPE_UNIX", } Address_Type_value = map[string]int32{ "TYPE_UNKNOWN": 0, "TYPE_IPV4": 1, "TYPE_IPV6": 2, "TYPE_UNIX": 3, } ) func (x Address_Type) Enum() *Address_Type { p := new(Address_Type) *p = x return p } func (x Address_Type) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (Address_Type) Descriptor() protoreflect.EnumDescriptor { return file_grpc_binlog_v1_binarylog_proto_enumTypes[2].Descriptor() } func (Address_Type) Type() protoreflect.EnumType { return &file_grpc_binlog_v1_binarylog_proto_enumTypes[2] } func (x Address_Type) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Use Address_Type.Descriptor instead. func (Address_Type) EnumDescriptor() ([]byte, []int) { return file_grpc_binlog_v1_binarylog_proto_rawDescGZIP(), []int{7, 0} } // Log entry we store in binary logs type GrpcLogEntry struct { state protoimpl.MessageState `protogen:"open.v1"` // The timestamp of the binary log message Timestamp *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // Uniquely identifies a call. The value must not be 0 in order to disambiguate // from an unset value. // Each call may have several log entries, they will all have the same call_id. // Nothing is guaranteed about their value other than they are unique across // different RPCs in the same gRPC process. CallId uint64 `protobuf:"varint,2,opt,name=call_id,json=callId,proto3" json:"call_id,omitempty"` // The entry sequence id for this call. The first GrpcLogEntry has a // value of 1, to disambiguate from an unset value. The purpose of // this field is to detect missing entries in environments where // durability or ordering is not guaranteed. SequenceIdWithinCall uint64 `protobuf:"varint,3,opt,name=sequence_id_within_call,json=sequenceIdWithinCall,proto3" json:"sequence_id_within_call,omitempty"` Type GrpcLogEntry_EventType `protobuf:"varint,4,opt,name=type,proto3,enum=grpc.binarylog.v1.GrpcLogEntry_EventType" json:"type,omitempty"` Logger GrpcLogEntry_Logger `protobuf:"varint,5,opt,name=logger,proto3,enum=grpc.binarylog.v1.GrpcLogEntry_Logger" json:"logger,omitempty"` // One of the above Logger enum // The logger uses one of the following fields to record the payload, // according to the type of the log entry. // // Types that are valid to be assigned to Payload: // // *GrpcLogEntry_ClientHeader // *GrpcLogEntry_ServerHeader // *GrpcLogEntry_Message // *GrpcLogEntry_Trailer Payload isGrpcLogEntry_Payload `protobuf_oneof:"payload"` // true if payload does not represent the full message or metadata. PayloadTruncated bool `protobuf:"varint,10,opt,name=payload_truncated,json=payloadTruncated,proto3" json:"payload_truncated,omitempty"` // Peer address information, will only be recorded on the first // incoming event. On client side, peer is logged on // EVENT_TYPE_SERVER_HEADER normally or EVENT_TYPE_SERVER_TRAILER in // the case of trailers-only. On server side, peer is always // logged on EVENT_TYPE_CLIENT_HEADER. Peer *Address `protobuf:"bytes,11,opt,name=peer,proto3" json:"peer,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *GrpcLogEntry) Reset() { *x = GrpcLogEntry{} mi := &file_grpc_binlog_v1_binarylog_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *GrpcLogEntry) String() string { return protoimpl.X.MessageStringOf(x) } func (*GrpcLogEntry) ProtoMessage() {} func (x *GrpcLogEntry) ProtoReflect() protoreflect.Message { mi := &file_grpc_binlog_v1_binarylog_proto_msgTypes[0] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use GrpcLogEntry.ProtoReflect.Descriptor instead. func (*GrpcLogEntry) Descriptor() ([]byte, []int) { return file_grpc_binlog_v1_binarylog_proto_rawDescGZIP(), []int{0} } func (x *GrpcLogEntry) GetTimestamp() *timestamppb.Timestamp { if x != nil { return x.Timestamp } return nil } func (x *GrpcLogEntry) GetCallId() uint64 { if x != nil { return x.CallId } return 0 } func (x *GrpcLogEntry) GetSequenceIdWithinCall() uint64 { if x != nil { return x.SequenceIdWithinCall } return 0 } func (x *GrpcLogEntry) GetType() GrpcLogEntry_EventType { if x != nil { return x.Type } return GrpcLogEntry_EVENT_TYPE_UNKNOWN } func (x *GrpcLogEntry) GetLogger() GrpcLogEntry_Logger { if x != nil { return x.Logger } return GrpcLogEntry_LOGGER_UNKNOWN } func (x *GrpcLogEntry) GetPayload() isGrpcLogEntry_Payload { if x != nil { return x.Payload } return nil } func (x *GrpcLogEntry) GetClientHeader() *ClientHeader { if x != nil { if x, ok := x.Payload.(*GrpcLogEntry_ClientHeader); ok { return x.ClientHeader } } return nil } func (x *GrpcLogEntry) GetServerHeader() *ServerHeader { if x != nil { if x, ok := x.Payload.(*GrpcLogEntry_ServerHeader); ok { return x.ServerHeader } } return nil } func (x *GrpcLogEntry) GetMessage() *Message { if x != nil { if x, ok := x.Payload.(*GrpcLogEntry_Message); ok { return x.Message } } return nil } func (x *GrpcLogEntry) GetTrailer() *Trailer { if x != nil { if x, ok := x.Payload.(*GrpcLogEntry_Trailer); ok { return x.Trailer } } return nil } func (x *GrpcLogEntry) GetPayloadTruncated() bool { if x != nil { return x.PayloadTruncated } return false } func (x *GrpcLogEntry) GetPeer() *Address { if x != nil { return x.Peer } return nil } type isGrpcLogEntry_Payload interface { isGrpcLogEntry_Payload() } type GrpcLogEntry_ClientHeader struct { ClientHeader *ClientHeader `protobuf:"bytes,6,opt,name=client_header,json=clientHeader,proto3,oneof"` } type GrpcLogEntry_ServerHeader struct { ServerHeader *ServerHeader `protobuf:"bytes,7,opt,name=server_header,json=serverHeader,proto3,oneof"` } type GrpcLogEntry_Message struct { // Used by EVENT_TYPE_CLIENT_MESSAGE, EVENT_TYPE_SERVER_MESSAGE Message *Message `protobuf:"bytes,8,opt,name=message,proto3,oneof"` } type GrpcLogEntry_Trailer struct { Trailer *Trailer `protobuf:"bytes,9,opt,name=trailer,proto3,oneof"` } func (*GrpcLogEntry_ClientHeader) isGrpcLogEntry_Payload() {} func (*GrpcLogEntry_ServerHeader) isGrpcLogEntry_Payload() {} func (*GrpcLogEntry_Message) isGrpcLogEntry_Payload() {} func (*GrpcLogEntry_Trailer) isGrpcLogEntry_Payload() {} type ClientHeader struct { state protoimpl.MessageState `protogen:"open.v1"` // This contains only the metadata from the application. Metadata *Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` // The name of the RPC method, which looks something like: // // // Note the leading "/" character. MethodName string `protobuf:"bytes,2,opt,name=method_name,json=methodName,proto3" json:"method_name,omitempty"` // A single process may be used to run multiple virtual // servers with different identities. // The authority is the name of such a server identity. // It is typically a portion of the URI in the form of // or : . Authority string `protobuf:"bytes,3,opt,name=authority,proto3" json:"authority,omitempty"` // the RPC timeout Timeout *durationpb.Duration `protobuf:"bytes,4,opt,name=timeout,proto3" json:"timeout,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *ClientHeader) Reset() { *x = ClientHeader{} mi := &file_grpc_binlog_v1_binarylog_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *ClientHeader) String() string { return protoimpl.X.MessageStringOf(x) } func (*ClientHeader) ProtoMessage() {} func (x *ClientHeader) ProtoReflect() protoreflect.Message { mi := &file_grpc_binlog_v1_binarylog_proto_msgTypes[1] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use ClientHeader.ProtoReflect.Descriptor instead. func (*ClientHeader) Descriptor() ([]byte, []int) { return file_grpc_binlog_v1_binarylog_proto_rawDescGZIP(), []int{1} } func (x *ClientHeader) GetMetadata() *Metadata { if x != nil { return x.Metadata } return nil } func (x *ClientHeader) GetMethodName() string { if x != nil { return x.MethodName } return "" } func (x *ClientHeader) GetAuthority() string { if x != nil { return x.Authority } return "" } func (x *ClientHeader) GetTimeout() *durationpb.Duration { if x != nil { return x.Timeout } return nil } type ServerHeader struct { state protoimpl.MessageState `protogen:"open.v1"` // This contains only the metadata from the application. Metadata *Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *ServerHeader) Reset() { *x = ServerHeader{} mi := &file_grpc_binlog_v1_binarylog_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *ServerHeader) String() string { return protoimpl.X.MessageStringOf(x) } func (*ServerHeader) ProtoMessage() {} func (x *ServerHeader) ProtoReflect() protoreflect.Message { mi := &file_grpc_binlog_v1_binarylog_proto_msgTypes[2] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use ServerHeader.ProtoReflect.Descriptor instead. func (*ServerHeader) Descriptor() ([]byte, []int) { return file_grpc_binlog_v1_binarylog_proto_rawDescGZIP(), []int{2} } func (x *ServerHeader) GetMetadata() *Metadata { if x != nil { return x.Metadata } return nil } type Trailer struct { state protoimpl.MessageState `protogen:"open.v1"` // This contains only the metadata from the application. Metadata *Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` // The gRPC status code. StatusCode uint32 `protobuf:"varint,2,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"` // An original status message before any transport specific // encoding. StatusMessage string `protobuf:"bytes,3,opt,name=status_message,json=statusMessage,proto3" json:"status_message,omitempty"` // The value of the 'grpc-status-details-bin' metadata key. If // present, this is always an encoded 'google.rpc.Status' message. StatusDetails []byte `protobuf:"bytes,4,opt,name=status_details,json=statusDetails,proto3" json:"status_details,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *Trailer) Reset() { *x = Trailer{} mi := &file_grpc_binlog_v1_binarylog_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *Trailer) String() string { return protoimpl.X.MessageStringOf(x) } func (*Trailer) ProtoMessage() {} func (x *Trailer) ProtoReflect() protoreflect.Message { mi := &file_grpc_binlog_v1_binarylog_proto_msgTypes[3] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Trailer.ProtoReflect.Descriptor instead. func (*Trailer) Descriptor() ([]byte, []int) { return file_grpc_binlog_v1_binarylog_proto_rawDescGZIP(), []int{3} } func (x *Trailer) GetMetadata() *Metadata { if x != nil { return x.Metadata } return nil } func (x *Trailer) GetStatusCode() uint32 { if x != nil { return x.StatusCode } return 0 } func (x *Trailer) GetStatusMessage() string { if x != nil { return x.StatusMessage } return "" } func (x *Trailer) GetStatusDetails() []byte { if x != nil { return x.StatusDetails } return nil } // Message payload, used by CLIENT_MESSAGE and SERVER_MESSAGE type Message struct { state protoimpl.MessageState `protogen:"open.v1"` // Length of the message. It may not be the same as the length of the // data field, as the logging payload can be truncated or omitted. Length uint32 `protobuf:"varint,1,opt,name=length,proto3" json:"length,omitempty"` // May be truncated or omitted. Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *Message) Reset() { *x = Message{} mi := &file_grpc_binlog_v1_binarylog_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *Message) String() string { return protoimpl.X.MessageStringOf(x) } func (*Message) ProtoMessage() {} func (x *Message) ProtoReflect() protoreflect.Message { mi := &file_grpc_binlog_v1_binarylog_proto_msgTypes[4] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Message.ProtoReflect.Descriptor instead. func (*Message) Descriptor() ([]byte, []int) { return file_grpc_binlog_v1_binarylog_proto_rawDescGZIP(), []int{4} } func (x *Message) GetLength() uint32 { if x != nil { return x.Length } return 0 } func (x *Message) GetData() []byte { if x != nil { return x.Data } return nil } // A list of metadata pairs, used in the payload of client header, // server header, and server trailer. // Implementations may omit some entries to honor the header limits // of GRPC_BINARY_LOG_CONFIG. // // Header keys added by gRPC are omitted. To be more specific, // implementations will not log the following entries, and this is // not to be treated as a truncation: // - entries handled by grpc that are not user visible, such as those // that begin with 'grpc-' (with exception of grpc-trace-bin) // or keys like 'lb-token' // - transport specific entries, including but not limited to: // ':path', ':authority', 'content-encoding', 'user-agent', 'te', etc // - entries added for call credentials // // Implementations must always log grpc-trace-bin if it is present. // Practically speaking it will only be visible on server side because // grpc-trace-bin is managed by low level client side mechanisms // inaccessible from the application level. On server side, the // header is just a normal metadata key. // The pair will not count towards the size limit. type Metadata struct { state protoimpl.MessageState `protogen:"open.v1"` Entry []*MetadataEntry `protobuf:"bytes,1,rep,name=entry,proto3" json:"entry,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *Metadata) Reset() { *x = Metadata{} mi := &file_grpc_binlog_v1_binarylog_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *Metadata) String() string { return protoimpl.X.MessageStringOf(x) } func (*Metadata) ProtoMessage() {} func (x *Metadata) ProtoReflect() protoreflect.Message { mi := &file_grpc_binlog_v1_binarylog_proto_msgTypes[5] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Metadata.ProtoReflect.Descriptor instead. func (*Metadata) Descriptor() ([]byte, []int) { return file_grpc_binlog_v1_binarylog_proto_rawDescGZIP(), []int{5} } func (x *Metadata) GetEntry() []*MetadataEntry { if x != nil { return x.Entry } return nil } // A metadata key value pair type MetadataEntry struct { state protoimpl.MessageState `protogen:"open.v1"` Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *MetadataEntry) Reset() { *x = MetadataEntry{} mi := &file_grpc_binlog_v1_binarylog_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *MetadataEntry) String() string { return protoimpl.X.MessageStringOf(x) } func (*MetadataEntry) ProtoMessage() {} func (x *MetadataEntry) ProtoReflect() protoreflect.Message { mi := &file_grpc_binlog_v1_binarylog_proto_msgTypes[6] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use MetadataEntry.ProtoReflect.Descriptor instead. func (*MetadataEntry) Descriptor() ([]byte, []int) { return file_grpc_binlog_v1_binarylog_proto_rawDescGZIP(), []int{6} } func (x *MetadataEntry) GetKey() string { if x != nil { return x.Key } return "" } func (x *MetadataEntry) GetValue() []byte { if x != nil { return x.Value } return nil } // Address information type Address struct { state protoimpl.MessageState `protogen:"open.v1"` Type Address_Type `protobuf:"varint,1,opt,name=type,proto3,enum=grpc.binarylog.v1.Address_Type" json:"type,omitempty"` Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` // only for TYPE_IPV4 and TYPE_IPV6 IpPort uint32 `protobuf:"varint,3,opt,name=ip_port,json=ipPort,proto3" json:"ip_port,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *Address) Reset() { *x = Address{} mi := &file_grpc_binlog_v1_binarylog_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *Address) String() string { return protoimpl.X.MessageStringOf(x) } func (*Address) ProtoMessage() {} func (x *Address) ProtoReflect() protoreflect.Message { mi := &file_grpc_binlog_v1_binarylog_proto_msgTypes[7] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Address.ProtoReflect.Descriptor instead. func (*Address) Descriptor() ([]byte, []int) { return file_grpc_binlog_v1_binarylog_proto_rawDescGZIP(), []int{7} } func (x *Address) GetType() Address_Type { if x != nil { return x.Type } return Address_TYPE_UNKNOWN } func (x *Address) GetAddress() string { if x != nil { return x.Address } return "" } func (x *Address) GetIpPort() uint32 { if x != nil { return x.IpPort } return 0 } var File_grpc_binlog_v1_binarylog_proto protoreflect.FileDescriptor const file_grpc_binlog_v1_binarylog_proto_rawDesc = "" + "\n" + "\x1egrpc/binlog/v1/binarylog.proto\x12\x11grpc.binarylog.v1\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xbb\a\n" + "\fGrpcLogEntry\x128\n" + "\ttimestamp\x18\x01 \x01(\v2\x1a.google.protobuf.TimestampR\ttimestamp\x12\x17\n" + "\acall_id\x18\x02 \x01(\x04R\x06callId\x125\n" + "\x17sequence_id_within_call\x18\x03 \x01(\x04R\x14sequenceIdWithinCall\x12=\n" + "\x04type\x18\x04 \x01(\x0e2).grpc.binarylog.v1.GrpcLogEntry.EventTypeR\x04type\x12>\n" + "\x06logger\x18\x05 \x01(\x0e2&.grpc.binarylog.v1.GrpcLogEntry.LoggerR\x06logger\x12F\n" + "\rclient_header\x18\x06 \x01(\v2\x1f.grpc.binarylog.v1.ClientHeaderH\x00R\fclientHeader\x12F\n" + "\rserver_header\x18\a \x01(\v2\x1f.grpc.binarylog.v1.ServerHeaderH\x00R\fserverHeader\x126\n" + "\amessage\x18\b \x01(\v2\x1a.grpc.binarylog.v1.MessageH\x00R\amessage\x126\n" + "\atrailer\x18\t \x01(\v2\x1a.grpc.binarylog.v1.TrailerH\x00R\atrailer\x12+\n" + "\x11payload_truncated\x18\n" + " \x01(\bR\x10payloadTruncated\x12.\n" + "\x04peer\x18\v \x01(\v2\x1a.grpc.binarylog.v1.AddressR\x04peer\"\xf5\x01\n" + "\tEventType\x12\x16\n" + "\x12EVENT_TYPE_UNKNOWN\x10\x00\x12\x1c\n" + "\x18EVENT_TYPE_CLIENT_HEADER\x10\x01\x12\x1c\n" + "\x18EVENT_TYPE_SERVER_HEADER\x10\x02\x12\x1d\n" + "\x19EVENT_TYPE_CLIENT_MESSAGE\x10\x03\x12\x1d\n" + "\x19EVENT_TYPE_SERVER_MESSAGE\x10\x04\x12 \n" + "\x1cEVENT_TYPE_CLIENT_HALF_CLOSE\x10\x05\x12\x1d\n" + "\x19EVENT_TYPE_SERVER_TRAILER\x10\x06\x12\x15\n" + "\x11EVENT_TYPE_CANCEL\x10\a\"B\n" + "\x06Logger\x12\x12\n" + "\x0eLOGGER_UNKNOWN\x10\x00\x12\x11\n" + "\rLOGGER_CLIENT\x10\x01\x12\x11\n" + "\rLOGGER_SERVER\x10\x02B\t\n" + "\apayload\"\xbb\x01\n" + "\fClientHeader\x127\n" + "\bmetadata\x18\x01 \x01(\v2\x1b.grpc.binarylog.v1.MetadataR\bmetadata\x12\x1f\n" + "\vmethod_name\x18\x02 \x01(\tR\n" + "methodName\x12\x1c\n" + "\tauthority\x18\x03 \x01(\tR\tauthority\x123\n" + "\atimeout\x18\x04 \x01(\v2\x19.google.protobuf.DurationR\atimeout\"G\n" + "\fServerHeader\x127\n" + "\bmetadata\x18\x01 \x01(\v2\x1b.grpc.binarylog.v1.MetadataR\bmetadata\"\xb1\x01\n" + "\aTrailer\x127\n" + "\bmetadata\x18\x01 \x01(\v2\x1b.grpc.binarylog.v1.MetadataR\bmetadata\x12\x1f\n" + "\vstatus_code\x18\x02 \x01(\rR\n" + "statusCode\x12%\n" + "\x0estatus_message\x18\x03 \x01(\tR\rstatusMessage\x12%\n" + "\x0estatus_details\x18\x04 \x01(\fR\rstatusDetails\"5\n" + "\aMessage\x12\x16\n" + "\x06length\x18\x01 \x01(\rR\x06length\x12\x12\n" + "\x04data\x18\x02 \x01(\fR\x04data\"B\n" + "\bMetadata\x126\n" + "\x05entry\x18\x01 \x03(\v2 .grpc.binarylog.v1.MetadataEntryR\x05entry\"7\n" + "\rMetadataEntry\x12\x10\n" + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + "\x05value\x18\x02 \x01(\fR\x05value\"\xb8\x01\n" + "\aAddress\x123\n" + "\x04type\x18\x01 \x01(\x0e2\x1f.grpc.binarylog.v1.Address.TypeR\x04type\x12\x18\n" + "\aaddress\x18\x02 \x01(\tR\aaddress\x12\x17\n" + "\aip_port\x18\x03 \x01(\rR\x06ipPort\"E\n" + "\x04Type\x12\x10\n" + "\fTYPE_UNKNOWN\x10\x00\x12\r\n" + "\tTYPE_IPV4\x10\x01\x12\r\n" + "\tTYPE_IPV6\x10\x02\x12\r\n" + "\tTYPE_UNIX\x10\x03B\\\n" + "\x14io.grpc.binarylog.v1B\x0eBinaryLogProtoP\x01Z2google.golang.org/grpc/binarylog/grpc_binarylog_v1b\x06proto3" var ( file_grpc_binlog_v1_binarylog_proto_rawDescOnce sync.Once file_grpc_binlog_v1_binarylog_proto_rawDescData []byte ) func file_grpc_binlog_v1_binarylog_proto_rawDescGZIP() []byte { file_grpc_binlog_v1_binarylog_proto_rawDescOnce.Do(func() { file_grpc_binlog_v1_binarylog_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_grpc_binlog_v1_binarylog_proto_rawDesc), len(file_grpc_binlog_v1_binarylog_proto_rawDesc))) }) return file_grpc_binlog_v1_binarylog_proto_rawDescData } var file_grpc_binlog_v1_binarylog_proto_enumTypes = make([]protoimpl.EnumInfo, 3) var file_grpc_binlog_v1_binarylog_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_grpc_binlog_v1_binarylog_proto_goTypes = []any{ (GrpcLogEntry_EventType)(0), // 0: grpc.binarylog.v1.GrpcLogEntry.EventType (GrpcLogEntry_Logger)(0), // 1: grpc.binarylog.v1.GrpcLogEntry.Logger (Address_Type)(0), // 2: grpc.binarylog.v1.Address.Type (*GrpcLogEntry)(nil), // 3: grpc.binarylog.v1.GrpcLogEntry (*ClientHeader)(nil), // 4: grpc.binarylog.v1.ClientHeader (*ServerHeader)(nil), // 5: grpc.binarylog.v1.ServerHeader (*Trailer)(nil), // 6: grpc.binarylog.v1.Trailer (*Message)(nil), // 7: grpc.binarylog.v1.Message (*Metadata)(nil), // 8: grpc.binarylog.v1.Metadata (*MetadataEntry)(nil), // 9: grpc.binarylog.v1.MetadataEntry (*Address)(nil), // 10: grpc.binarylog.v1.Address (*timestamppb.Timestamp)(nil), // 11: google.protobuf.Timestamp (*durationpb.Duration)(nil), // 12: google.protobuf.Duration } var file_grpc_binlog_v1_binarylog_proto_depIdxs = []int32{ 11, // 0: grpc.binarylog.v1.GrpcLogEntry.timestamp:type_name -> google.protobuf.Timestamp 0, // 1: grpc.binarylog.v1.GrpcLogEntry.type:type_name -> grpc.binarylog.v1.GrpcLogEntry.EventType 1, // 2: grpc.binarylog.v1.GrpcLogEntry.logger:type_name -> grpc.binarylog.v1.GrpcLogEntry.Logger 4, // 3: grpc.binarylog.v1.GrpcLogEntry.client_header:type_name -> grpc.binarylog.v1.ClientHeader 5, // 4: grpc.binarylog.v1.GrpcLogEntry.server_header:type_name -> grpc.binarylog.v1.ServerHeader 7, // 5: grpc.binarylog.v1.GrpcLogEntry.message:type_name -> grpc.binarylog.v1.Message 6, // 6: grpc.binarylog.v1.GrpcLogEntry.trailer:type_name -> grpc.binarylog.v1.Trailer 10, // 7: grpc.binarylog.v1.GrpcLogEntry.peer:type_name -> grpc.binarylog.v1.Address 8, // 8: grpc.binarylog.v1.ClientHeader.metadata:type_name -> grpc.binarylog.v1.Metadata 12, // 9: grpc.binarylog.v1.ClientHeader.timeout:type_name -> google.protobuf.Duration 8, // 10: grpc.binarylog.v1.ServerHeader.metadata:type_name -> grpc.binarylog.v1.Metadata 8, // 11: grpc.binarylog.v1.Trailer.metadata:type_name -> grpc.binarylog.v1.Metadata 9, // 12: grpc.binarylog.v1.Metadata.entry:type_name -> grpc.binarylog.v1.MetadataEntry 2, // 13: grpc.binarylog.v1.Address.type:type_name -> grpc.binarylog.v1.Address.Type 14, // [14:14] is the sub-list for method output_type 14, // [14:14] is the sub-list for method input_type 14, // [14:14] is the sub-list for extension type_name 14, // [14:14] is the sub-list for extension extendee 0, // [0:14] is the sub-list for field type_name } func init() { file_grpc_binlog_v1_binarylog_proto_init() } func file_grpc_binlog_v1_binarylog_proto_init() { if File_grpc_binlog_v1_binarylog_proto != nil { return } file_grpc_binlog_v1_binarylog_proto_msgTypes[0].OneofWrappers = []any{ (*GrpcLogEntry_ClientHeader)(nil), (*GrpcLogEntry_ServerHeader)(nil), (*GrpcLogEntry_Message)(nil), (*GrpcLogEntry_Trailer)(nil), } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_grpc_binlog_v1_binarylog_proto_rawDesc), len(file_grpc_binlog_v1_binarylog_proto_rawDesc)), NumEnums: 3, NumMessages: 8, NumExtensions: 0, NumServices: 0, }, GoTypes: file_grpc_binlog_v1_binarylog_proto_goTypes, DependencyIndexes: file_grpc_binlog_v1_binarylog_proto_depIdxs, EnumInfos: file_grpc_binlog_v1_binarylog_proto_enumTypes, MessageInfos: file_grpc_binlog_v1_binarylog_proto_msgTypes, }.Build() File_grpc_binlog_v1_binarylog_proto = out.File file_grpc_binlog_v1_binarylog_proto_goTypes = nil file_grpc_binlog_v1_binarylog_proto_depIdxs = nil } ================================================ FILE: vendor/google.golang.org/grpc/call.go ================================================ /* * * Copyright 2014 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package grpc import ( "context" ) // Invoke sends the RPC request on the wire and returns after response is // received. This is typically called by generated code. // // All errors returned by Invoke are compatible with the status package. func (cc *ClientConn) Invoke(ctx context.Context, method string, args, reply any, opts ...CallOption) error { // allow interceptor to see all applicable call options, which means those // configured as defaults from dial option as well as per-call options opts = combine(cc.dopts.callOptions, opts) if cc.dopts.unaryInt != nil { return cc.dopts.unaryInt(ctx, method, args, reply, cc, invoke, opts...) } return invoke(ctx, method, args, reply, cc, opts...) } func combine(o1 []CallOption, o2 []CallOption) []CallOption { // we don't use append because o1 could have extra capacity whose // elements would be overwritten, which could cause inadvertent // sharing (and race conditions) between concurrent calls if len(o1) == 0 { return o2 } else if len(o2) == 0 { return o1 } ret := make([]CallOption, len(o1)+len(o2)) copy(ret, o1) copy(ret[len(o1):], o2) return ret } // Invoke sends the RPC request on the wire and returns after response is // received. This is typically called by generated code. // // DEPRECATED: Use ClientConn.Invoke instead. func Invoke(ctx context.Context, method string, args, reply any, cc *ClientConn, opts ...CallOption) error { return cc.Invoke(ctx, method, args, reply, opts...) } var unaryStreamDesc = &StreamDesc{ServerStreams: false, ClientStreams: false} func invoke(ctx context.Context, method string, req, reply any, cc *ClientConn, opts ...CallOption) error { cs, err := newClientStream(ctx, unaryStreamDesc, cc, method, opts...) if err != nil { return err } if err := cs.SendMsg(req); err != nil { return err } return cs.RecvMsg(reply) } ================================================ FILE: vendor/google.golang.org/grpc/channelz/channelz.go ================================================ /* * * Copyright 2020 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package channelz exports internals of the channelz implementation as required // by other gRPC packages. // // The implementation of the channelz spec as defined in // https://github.com/grpc/proposal/blob/master/A14-channelz.md, is provided by // the `internal/channelz` package. // // # Experimental // // Notice: All APIs in this package are experimental and may be removed in a // later release. package channelz import "google.golang.org/grpc/internal/channelz" // Identifier is an opaque identifier which uniquely identifies an entity in the // channelz database. type Identifier = channelz.Identifier ================================================ FILE: vendor/google.golang.org/grpc/clientconn.go ================================================ /* * * Copyright 2014 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package grpc import ( "context" "errors" "fmt" "math" "net/url" "slices" "strings" "sync" "sync/atomic" "time" "google.golang.org/grpc/balancer" "google.golang.org/grpc/balancer/base" "google.golang.org/grpc/balancer/pickfirst" "google.golang.org/grpc/codes" "google.golang.org/grpc/connectivity" "google.golang.org/grpc/credentials" expstats "google.golang.org/grpc/experimental/stats" "google.golang.org/grpc/internal" "google.golang.org/grpc/internal/channelz" "google.golang.org/grpc/internal/grpcsync" "google.golang.org/grpc/internal/idle" iresolver "google.golang.org/grpc/internal/resolver" istats "google.golang.org/grpc/internal/stats" "google.golang.org/grpc/internal/transport" "google.golang.org/grpc/keepalive" "google.golang.org/grpc/resolver" "google.golang.org/grpc/serviceconfig" "google.golang.org/grpc/stats" "google.golang.org/grpc/status" _ "google.golang.org/grpc/balancer/roundrobin" // To register roundrobin. _ "google.golang.org/grpc/internal/resolver/passthrough" // To register passthrough resolver. _ "google.golang.org/grpc/internal/resolver/unix" // To register unix resolver. _ "google.golang.org/grpc/resolver/dns" // To register dns resolver. ) const ( // minimum time to give a connection to complete minConnectTimeout = 20 * time.Second ) var ( // ErrClientConnClosing indicates that the operation is illegal because // the ClientConn is closing. // // Deprecated: this error should not be relied upon by users; use the status // code of Canceled instead. ErrClientConnClosing = status.Error(codes.Canceled, "grpc: the client connection is closing") // errConnDrain indicates that the connection starts to be drained and does not accept any new RPCs. errConnDrain = errors.New("grpc: the connection is drained") // errConnClosing indicates that the connection is closing. errConnClosing = errors.New("grpc: the connection is closing") // errConnIdling indicates the connection is being closed as the channel // is moving to an idle mode due to inactivity. errConnIdling = errors.New("grpc: the connection is closing due to channel idleness") // invalidDefaultServiceConfigErrPrefix is used to prefix the json parsing error for the default // service config. invalidDefaultServiceConfigErrPrefix = "grpc: the provided default service config is invalid" // PickFirstBalancerName is the name of the pick_first balancer. PickFirstBalancerName = pickfirst.Name ) // The following errors are returned from Dial and DialContext var ( // errNoTransportSecurity indicates that there is no transport security // being set for ClientConn. Users should either set one or explicitly // call WithInsecure DialOption to disable security. errNoTransportSecurity = errors.New("grpc: no transport security set (use grpc.WithTransportCredentials(insecure.NewCredentials()) explicitly or set credentials)") // errTransportCredsAndBundle indicates that creds bundle is used together // with other individual Transport Credentials. errTransportCredsAndBundle = errors.New("grpc: credentials.Bundle may not be used with individual TransportCredentials") // errNoTransportCredsInBundle indicated that the configured creds bundle // returned a transport credentials which was nil. errNoTransportCredsInBundle = errors.New("grpc: credentials.Bundle must return non-nil transport credentials") // errTransportCredentialsMissing indicates that users want to transmit // security information (e.g., OAuth2 token) which requires secure // connection on an insecure connection. errTransportCredentialsMissing = errors.New("grpc: the credentials require transport level security (use grpc.WithTransportCredentials() to set)") ) var ( disconnectionsMetric = expstats.RegisterInt64Count(expstats.MetricDescriptor{ Name: "grpc.subchannel.disconnections", Description: "EXPERIMENTAL. Number of times the selected subchannel becomes disconnected.", Unit: "{disconnection}", Labels: []string{"grpc.target"}, OptionalLabels: []string{"grpc.lb.backend_service", "grpc.lb.locality", "grpc.disconnect_error"}, Default: false, }) connectionAttemptsSucceededMetric = expstats.RegisterInt64Count(expstats.MetricDescriptor{ Name: "grpc.subchannel.connection_attempts_succeeded", Description: "EXPERIMENTAL. Number of successful connection attempts.", Unit: "{attempt}", Labels: []string{"grpc.target"}, OptionalLabels: []string{"grpc.lb.backend_service", "grpc.lb.locality"}, Default: false, }) connectionAttemptsFailedMetric = expstats.RegisterInt64Count(expstats.MetricDescriptor{ Name: "grpc.subchannel.connection_attempts_failed", Description: "EXPERIMENTAL. Number of failed connection attempts.", Unit: "{attempt}", Labels: []string{"grpc.target"}, OptionalLabels: []string{"grpc.lb.backend_service", "grpc.lb.locality"}, Default: false, }) openConnectionsMetric = expstats.RegisterInt64UpDownCount(expstats.MetricDescriptor{ Name: "grpc.subchannel.open_connections", Description: "EXPERIMENTAL. Number of open connections.", Unit: "{attempt}", Labels: []string{"grpc.target"}, OptionalLabels: []string{"grpc.lb.backend_service", "grpc.security_level", "grpc.lb.locality"}, Default: false, }) ) const ( defaultClientMaxReceiveMessageSize = 1024 * 1024 * 4 defaultClientMaxSendMessageSize = math.MaxInt32 // http2IOBufSize specifies the buffer size for sending frames. defaultWriteBufSize = 32 * 1024 defaultReadBufSize = 32 * 1024 ) type defaultConfigSelector struct { sc *ServiceConfig } func (dcs *defaultConfigSelector) SelectConfig(rpcInfo iresolver.RPCInfo) (*iresolver.RPCConfig, error) { return &iresolver.RPCConfig{ Context: rpcInfo.Context, MethodConfig: getMethodConfig(dcs.sc, rpcInfo.Method), }, nil } // NewClient creates a new gRPC "channel" for the target URI provided. No I/O // is performed. Use of the ClientConn for RPCs will automatically cause it to // connect. The Connect method may be called to manually create a connection, // but for most users this should be unnecessary. // // The target name syntax is defined in // https://github.com/grpc/grpc/blob/master/doc/naming.md. E.g. to use the dns // name resolver, a "dns:///" prefix may be applied to the target. The default // name resolver will be used if no scheme is detected, or if the parsed scheme // is not a registered name resolver. The default resolver is "dns" but can be // overridden using the resolver package's SetDefaultScheme. // // Examples: // // - "foo.googleapis.com:8080" // - "dns:///foo.googleapis.com:8080" // - "dns:///foo.googleapis.com" // - "dns:///10.0.0.213:8080" // - "dns:///%5B2001:db8:85a3:8d3:1319:8a2e:370:7348%5D:443" // - "dns://8.8.8.8/foo.googleapis.com:8080" // - "dns://8.8.8.8/foo.googleapis.com" // - "zookeeper://zk.example.com:9900/example_service" // // The DialOptions returned by WithBlock, WithTimeout, // WithReturnConnectionError, and FailOnNonTempDialError are ignored by this // function. func NewClient(target string, opts ...DialOption) (conn *ClientConn, err error) { cc := &ClientConn{ target: target, conns: make(map[*addrConn]struct{}), dopts: defaultDialOptions(), } cc.retryThrottler.Store((*retryThrottler)(nil)) cc.safeConfigSelector.UpdateConfigSelector(&defaultConfigSelector{nil}) cc.ctx, cc.cancel = context.WithCancel(context.Background()) // Apply dial options. disableGlobalOpts := false for _, opt := range opts { if _, ok := opt.(*disableGlobalDialOptions); ok { disableGlobalOpts = true break } } if !disableGlobalOpts { for _, opt := range globalDialOptions { opt.apply(&cc.dopts) } } for _, opt := range opts { opt.apply(&cc.dopts) } // Determine the resolver to use. if err := cc.initParsedTargetAndResolverBuilder(); err != nil { return nil, err } for _, opt := range globalPerTargetDialOptions { opt.DialOptionForTarget(cc.parsedTarget.URL).apply(&cc.dopts) } chainUnaryClientInterceptors(cc) chainStreamClientInterceptors(cc) if err := cc.validateTransportCredentials(); err != nil { return nil, err } if cc.dopts.defaultServiceConfigRawJSON != nil { scpr := parseServiceConfig(*cc.dopts.defaultServiceConfigRawJSON, cc.dopts.maxCallAttempts) if scpr.Err != nil { return nil, fmt.Errorf("%s: %v", invalidDefaultServiceConfigErrPrefix, scpr.Err) } cc.dopts.defaultServiceConfig, _ = scpr.Config.(*ServiceConfig) } cc.keepaliveParams = cc.dopts.copts.KeepaliveParams if err = cc.initAuthority(); err != nil { return nil, err } // Register ClientConn with channelz. Note that this is only done after // channel creation cannot fail. cc.channelzRegistration(target) channelz.Infof(logger, cc.channelz, "parsed dial target is: %#v", cc.parsedTarget) channelz.Infof(logger, cc.channelz, "Channel authority set to %q", cc.authority) cc.csMgr = newConnectivityStateManager(cc.ctx, cc.channelz) cc.pickerWrapper = newPickerWrapper() cc.metricsRecorderList = istats.NewMetricsRecorderList(cc.dopts.copts.StatsHandlers) cc.statsHandler = istats.NewCombinedHandler(cc.dopts.copts.StatsHandlers...) cc.initIdleStateLocked() // Safe to call without the lock, since nothing else has a reference to cc. cc.idlenessMgr = idle.NewManager((*idler)(cc), cc.dopts.idleTimeout) return cc, nil } // Dial calls DialContext(context.Background(), target, opts...). // // Deprecated: use NewClient instead. Will be supported throughout 1.x. func Dial(target string, opts ...DialOption) (*ClientConn, error) { return DialContext(context.Background(), target, opts...) } // DialContext calls NewClient and then exits idle mode. If WithBlock(true) is // used, it calls Connect and WaitForStateChange until either the context // expires or the state of the ClientConn is Ready. // // One subtle difference between NewClient and Dial and DialContext is that the // former uses "dns" as the default name resolver, while the latter use // "passthrough" for backward compatibility. This distinction should not matter // to most users, but could matter to legacy users that specify a custom dialer // and expect it to receive the target string directly. // // Deprecated: use NewClient instead. Will be supported throughout 1.x. func DialContext(ctx context.Context, target string, opts ...DialOption) (conn *ClientConn, err error) { // At the end of this method, we kick the channel out of idle, rather than // waiting for the first rpc. // // WithLocalDNSResolution dial option in `grpc.Dial` ensures that it // preserves behavior: when default scheme passthrough is used, skip // hostname resolution, when "dns" is used for resolution, perform // resolution on the client. opts = append([]DialOption{withDefaultScheme("passthrough"), WithLocalDNSResolution()}, opts...) cc, err := NewClient(target, opts...) if err != nil { return nil, err } // We start the channel off in idle mode, but kick it out of idle now, // instead of waiting for the first RPC. This is the legacy behavior of // Dial. defer func() { if err != nil { cc.Close() } }() // This creates the name resolver, load balancer, etc. if err := cc.exitIdleMode(); err != nil { return nil, fmt.Errorf("failed to exit idle mode: %w", err) } cc.idlenessMgr.UnsafeSetNotIdle() // Return now for non-blocking dials. if !cc.dopts.block { return cc, nil } if cc.dopts.timeout > 0 { var cancel context.CancelFunc ctx, cancel = context.WithTimeout(ctx, cc.dopts.timeout) defer cancel() } defer func() { select { case <-ctx.Done(): switch { case ctx.Err() == err: conn = nil case err == nil || !cc.dopts.returnLastError: conn, err = nil, ctx.Err() default: conn, err = nil, fmt.Errorf("%v: %v", ctx.Err(), err) } default: } }() // A blocking dial blocks until the clientConn is ready. for { s := cc.GetState() if s == connectivity.Idle { cc.Connect() } if s == connectivity.Ready { return cc, nil } else if cc.dopts.copts.FailOnNonTempDialError && s == connectivity.TransientFailure { if err = cc.connectionError(); err != nil { terr, ok := err.(interface { Temporary() bool }) if ok && !terr.Temporary() { return nil, err } } } if !cc.WaitForStateChange(ctx, s) { // ctx got timeout or canceled. if err = cc.connectionError(); err != nil && cc.dopts.returnLastError { return nil, err } return nil, ctx.Err() } } } // addTraceEvent is a helper method to add a trace event on the channel. If the // channel is a nested one, the same event is also added on the parent channel. func (cc *ClientConn) addTraceEvent(msg string) { ted := &channelz.TraceEvent{ Desc: fmt.Sprintf("Channel %s", msg), Severity: channelz.CtInfo, } if cc.dopts.channelzParent != nil { ted.Parent = &channelz.TraceEvent{ Desc: fmt.Sprintf("Nested channel(id:%d) %s", cc.channelz.ID, msg), Severity: channelz.CtInfo, } } channelz.AddTraceEvent(logger, cc.channelz, 1, ted) } type idler ClientConn func (i *idler) EnterIdleMode() { (*ClientConn)(i).enterIdleMode() } func (i *idler) ExitIdleMode() { // Ignore the error returned from this method, because from the perspective // of the caller (idleness manager), the channel would have always moved out // of IDLE by the time this method returns. (*ClientConn)(i).exitIdleMode() } // exitIdleMode moves the channel out of idle mode by recreating the name // resolver and load balancer. This should never be called directly; use // cc.idlenessMgr.ExitIdleMode instead. func (cc *ClientConn) exitIdleMode() error { cc.mu.Lock() if cc.conns == nil { cc.mu.Unlock() return errConnClosing } cc.mu.Unlock() // Set state to CONNECTING before building the name resolver // so the channel does not remain in IDLE. cc.csMgr.updateState(connectivity.Connecting) // This needs to be called without cc.mu because this builds a new resolver // which might update state or report error inline, which would then need to // acquire cc.mu. if err := cc.resolverWrapper.start(); err != nil { // If resolver creation fails, treat it like an error reported by the // resolver before any valid updates. Set channel's state to // TransientFailure, and set an erroring picker with the resolver build // error, which will returned as part of any subsequent RPCs. logger.Warningf("Failed to start resolver: %v", err) cc.csMgr.updateState(connectivity.TransientFailure) cc.mu.Lock() cc.updateResolverStateAndUnlock(resolver.State{}, err) return fmt.Errorf("failed to start resolver: %w", err) } cc.addTraceEvent("exiting idle mode") return nil } // initIdleStateLocked initializes common state to how it should be while idle. func (cc *ClientConn) initIdleStateLocked() { cc.resolverWrapper = newCCResolverWrapper(cc) cc.balancerWrapper = newCCBalancerWrapper(cc) cc.firstResolveEvent = grpcsync.NewEvent() // cc.conns == nil is a proxy for the ClientConn being closed. So, instead // of setting it to nil here, we recreate the map. This also means that we // don't have to do this when exiting idle mode. cc.conns = make(map[*addrConn]struct{}) } // enterIdleMode puts the channel in idle mode, and as part of it shuts down the // name resolver, load balancer, and any subchannels. This should never be // called directly; use cc.idlenessMgr.EnterIdleMode instead. func (cc *ClientConn) enterIdleMode() { cc.mu.Lock() if cc.conns == nil { cc.mu.Unlock() return } conns := cc.conns rWrapper := cc.resolverWrapper rWrapper.close() cc.pickerWrapper.reset() bWrapper := cc.balancerWrapper bWrapper.close() cc.csMgr.updateState(connectivity.Idle) cc.addTraceEvent("entering idle mode") cc.initIdleStateLocked() cc.mu.Unlock() // Block until the name resolver and LB policy are closed. <-rWrapper.serializer.Done() <-bWrapper.serializer.Done() // Close all subchannels after the LB policy is closed. for ac := range conns { ac.tearDown(errConnIdling) } } // validateTransportCredentials performs a series of checks on the configured // transport credentials. It returns a non-nil error if any of these conditions // are met: // - no transport creds and no creds bundle is configured // - both transport creds and creds bundle are configured // - creds bundle is configured, but it lacks a transport credentials // - insecure transport creds configured alongside call creds that require // transport level security // // If none of the above conditions are met, the configured credentials are // deemed valid and a nil error is returned. func (cc *ClientConn) validateTransportCredentials() error { if cc.dopts.copts.TransportCredentials == nil && cc.dopts.copts.CredsBundle == nil { return errNoTransportSecurity } if cc.dopts.copts.TransportCredentials != nil && cc.dopts.copts.CredsBundle != nil { return errTransportCredsAndBundle } if cc.dopts.copts.CredsBundle != nil && cc.dopts.copts.CredsBundle.TransportCredentials() == nil { return errNoTransportCredsInBundle } transportCreds := cc.dopts.copts.TransportCredentials if transportCreds == nil { transportCreds = cc.dopts.copts.CredsBundle.TransportCredentials() } if transportCreds.Info().SecurityProtocol == "insecure" { for _, cd := range cc.dopts.copts.PerRPCCredentials { if cd.RequireTransportSecurity() { return errTransportCredentialsMissing } } } return nil } // channelzRegistration registers the newly created ClientConn with channelz and // stores the returned identifier in `cc.channelz`. A channelz trace event is // emitted for ClientConn creation. If the newly created ClientConn is a nested // one, i.e a valid parent ClientConn ID is specified via a dial option, the // trace event is also added to the parent. // // Doesn't grab cc.mu as this method is expected to be called only at Dial time. func (cc *ClientConn) channelzRegistration(target string) { parentChannel, _ := cc.dopts.channelzParent.(*channelz.Channel) cc.channelz = channelz.RegisterChannel(parentChannel, target) cc.addTraceEvent(fmt.Sprintf("created for target %q", target)) } // chainUnaryClientInterceptors chains all unary client interceptors into one. func chainUnaryClientInterceptors(cc *ClientConn) { interceptors := cc.dopts.chainUnaryInts // Prepend dopts.unaryInt to the chaining interceptors if it exists, since unaryInt will // be executed before any other chained interceptors. if cc.dopts.unaryInt != nil { interceptors = append([]UnaryClientInterceptor{cc.dopts.unaryInt}, interceptors...) } var chainedInt UnaryClientInterceptor if len(interceptors) == 0 { chainedInt = nil } else if len(interceptors) == 1 { chainedInt = interceptors[0] } else { chainedInt = func(ctx context.Context, method string, req, reply any, cc *ClientConn, invoker UnaryInvoker, opts ...CallOption) error { return interceptors[0](ctx, method, req, reply, cc, getChainUnaryInvoker(interceptors, 0, invoker), opts...) } } cc.dopts.unaryInt = chainedInt } // getChainUnaryInvoker recursively generate the chained unary invoker. func getChainUnaryInvoker(interceptors []UnaryClientInterceptor, curr int, finalInvoker UnaryInvoker) UnaryInvoker { if curr == len(interceptors)-1 { return finalInvoker } return func(ctx context.Context, method string, req, reply any, cc *ClientConn, opts ...CallOption) error { return interceptors[curr+1](ctx, method, req, reply, cc, getChainUnaryInvoker(interceptors, curr+1, finalInvoker), opts...) } } // chainStreamClientInterceptors chains all stream client interceptors into one. func chainStreamClientInterceptors(cc *ClientConn) { interceptors := cc.dopts.chainStreamInts // Prepend dopts.streamInt to the chaining interceptors if it exists, since streamInt will // be executed before any other chained interceptors. if cc.dopts.streamInt != nil { interceptors = append([]StreamClientInterceptor{cc.dopts.streamInt}, interceptors...) } var chainedInt StreamClientInterceptor if len(interceptors) == 0 { chainedInt = nil } else if len(interceptors) == 1 { chainedInt = interceptors[0] } else { chainedInt = func(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, streamer Streamer, opts ...CallOption) (ClientStream, error) { return interceptors[0](ctx, desc, cc, method, getChainStreamer(interceptors, 0, streamer), opts...) } } cc.dopts.streamInt = chainedInt } // getChainStreamer recursively generate the chained client stream constructor. func getChainStreamer(interceptors []StreamClientInterceptor, curr int, finalStreamer Streamer) Streamer { if curr == len(interceptors)-1 { return finalStreamer } return func(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, opts ...CallOption) (ClientStream, error) { return interceptors[curr+1](ctx, desc, cc, method, getChainStreamer(interceptors, curr+1, finalStreamer), opts...) } } // newConnectivityStateManager creates an connectivityStateManager with // the specified channel. func newConnectivityStateManager(ctx context.Context, channel *channelz.Channel) *connectivityStateManager { return &connectivityStateManager{ channelz: channel, pubSub: grpcsync.NewPubSub(ctx), } } // connectivityStateManager keeps the connectivity.State of ClientConn. // This struct will eventually be exported so the balancers can access it. // // TODO: If possible, get rid of the `connectivityStateManager` type, and // provide this functionality using the `PubSub`, to avoid keeping track of // the connectivity state at two places. type connectivityStateManager struct { mu sync.Mutex state connectivity.State notifyChan chan struct{} channelz *channelz.Channel pubSub *grpcsync.PubSub } // updateState updates the connectivity.State of ClientConn. // If there's a change it notifies goroutines waiting on state change to // happen. func (csm *connectivityStateManager) updateState(state connectivity.State) { csm.mu.Lock() defer csm.mu.Unlock() if csm.state == connectivity.Shutdown { return } if csm.state == state { return } csm.state = state csm.channelz.ChannelMetrics.State.Store(&state) csm.pubSub.Publish(state) channelz.Infof(logger, csm.channelz, "Channel Connectivity change to %v", state) if csm.notifyChan != nil { // There are other goroutines waiting on this channel. close(csm.notifyChan) csm.notifyChan = nil } } func (csm *connectivityStateManager) getState() connectivity.State { csm.mu.Lock() defer csm.mu.Unlock() return csm.state } func (csm *connectivityStateManager) getNotifyChan() <-chan struct{} { csm.mu.Lock() defer csm.mu.Unlock() if csm.notifyChan == nil { csm.notifyChan = make(chan struct{}) } return csm.notifyChan } // ClientConnInterface defines the functions clients need to perform unary and // streaming RPCs. It is implemented by *ClientConn, and is only intended to // be referenced by generated code. type ClientConnInterface interface { // Invoke performs a unary RPC and returns after the response is received // into reply. Invoke(ctx context.Context, method string, args any, reply any, opts ...CallOption) error // NewStream begins a streaming RPC. NewStream(ctx context.Context, desc *StreamDesc, method string, opts ...CallOption) (ClientStream, error) } // Assert *ClientConn implements ClientConnInterface. var _ ClientConnInterface = (*ClientConn)(nil) // ClientConn represents a virtual connection to a conceptual endpoint, to // perform RPCs. // // A ClientConn is free to have zero or more actual connections to the endpoint // based on configuration, load, etc. It is also free to determine which actual // endpoints to use and may change it every RPC, permitting client-side load // balancing. // // A ClientConn encapsulates a range of functionality including name // resolution, TCP connection establishment (with retries and backoff) and TLS // handshakes. It also handles errors on established connections by // re-resolving the name and reconnecting. type ClientConn struct { ctx context.Context // Initialized using the background context at dial time. cancel context.CancelFunc // Cancelled on close. // The following are initialized at dial time, and are read-only after that. target string // User's dial target. parsedTarget resolver.Target // See initParsedTargetAndResolverBuilder(). authority string // See initAuthority(). dopts dialOptions // Default and user specified dial options. channelz *channelz.Channel // Channelz object. resolverBuilder resolver.Builder // See initParsedTargetAndResolverBuilder(). idlenessMgr *idle.Manager metricsRecorderList *istats.MetricsRecorderList statsHandler stats.Handler // The following provide their own synchronization, and therefore don't // require cc.mu to be held to access them. csMgr *connectivityStateManager pickerWrapper *pickerWrapper safeConfigSelector iresolver.SafeConfigSelector retryThrottler atomic.Value // Updated from service config. // mu protects the following fields. // TODO: split mu so the same mutex isn't used for everything. mu sync.RWMutex resolverWrapper *ccResolverWrapper // Always recreated whenever entering idle to simplify Close. balancerWrapper *ccBalancerWrapper // Always recreated whenever entering idle to simplify Close. sc *ServiceConfig // Latest service config received from the resolver. conns map[*addrConn]struct{} // Set to nil on close. keepaliveParams keepalive.ClientParameters // May be updated upon receipt of a GoAway. // firstResolveEvent is used to track whether the name resolver sent us at // least one update. RPCs block on this event. May be accessed without mu // if we know we cannot be asked to enter idle mode while accessing it (e.g. // when the idle manager has already been closed, or if we are already // entering idle mode). firstResolveEvent *grpcsync.Event lceMu sync.Mutex // protects lastConnectionError lastConnectionError error } // WaitForStateChange waits until the connectivity.State of ClientConn changes from sourceState or // ctx expires. A true value is returned in former case and false in latter. func (cc *ClientConn) WaitForStateChange(ctx context.Context, sourceState connectivity.State) bool { ch := cc.csMgr.getNotifyChan() if cc.csMgr.getState() != sourceState { return true } select { case <-ctx.Done(): return false case <-ch: return true } } // GetState returns the connectivity.State of ClientConn. func (cc *ClientConn) GetState() connectivity.State { return cc.csMgr.getState() } // Connect causes all subchannels in the ClientConn to attempt to connect if // the channel is idle. Does not wait for the connection attempts to begin // before returning. // // # Experimental // // Notice: This API is EXPERIMENTAL and may be changed or removed in a later // release. func (cc *ClientConn) Connect() { cc.idlenessMgr.ExitIdleMode() // If the ClientConn was not in idle mode, we need to call ExitIdle on the // LB policy so that connections can be created. cc.mu.Lock() cc.balancerWrapper.exitIdle() cc.mu.Unlock() } // waitForResolvedAddrs blocks until the resolver provides addresses or the // context expires, whichever happens first. // // Error is nil unless the context expires first; otherwise returns a status // error based on the context. // // The returned boolean indicates whether it did block or not. If the // resolution has already happened once before, it returns false without // blocking. Otherwise, it wait for the resolution and return true if // resolution has succeeded or return false along with error if resolution has // failed. func (cc *ClientConn) waitForResolvedAddrs(ctx context.Context) (bool, error) { // This is on the RPC path, so we use a fast path to avoid the // more-expensive "select" below after the resolver has returned once. if cc.firstResolveEvent.HasFired() { return false, nil } internal.NewStreamWaitingForResolver() select { case <-cc.firstResolveEvent.Done(): return true, nil case <-ctx.Done(): return false, status.FromContextError(ctx.Err()).Err() case <-cc.ctx.Done(): return false, ErrClientConnClosing } } var emptyServiceConfig *ServiceConfig func init() { cfg := parseServiceConfig("{}", defaultMaxCallAttempts) if cfg.Err != nil { panic(fmt.Sprintf("impossible error parsing empty service config: %v", cfg.Err)) } emptyServiceConfig = cfg.Config.(*ServiceConfig) internal.SubscribeToConnectivityStateChanges = func(cc *ClientConn, s grpcsync.Subscriber) func() { return cc.csMgr.pubSub.Subscribe(s) } internal.EnterIdleModeForTesting = func(cc *ClientConn) { cc.idlenessMgr.EnterIdleModeForTesting() } internal.ExitIdleModeForTesting = func(cc *ClientConn) { cc.idlenessMgr.ExitIdleMode() } } func (cc *ClientConn) maybeApplyDefaultServiceConfig() { if cc.sc != nil { cc.applyServiceConfigAndBalancer(cc.sc, nil) return } if cc.dopts.defaultServiceConfig != nil { cc.applyServiceConfigAndBalancer(cc.dopts.defaultServiceConfig, &defaultConfigSelector{cc.dopts.defaultServiceConfig}) } else { cc.applyServiceConfigAndBalancer(emptyServiceConfig, &defaultConfigSelector{emptyServiceConfig}) } } func (cc *ClientConn) updateResolverStateAndUnlock(s resolver.State, err error) error { defer cc.firstResolveEvent.Fire() // Check if the ClientConn is already closed. Some fields (e.g. // balancerWrapper) are set to nil when closing the ClientConn, and could // cause nil pointer panic if we don't have this check. if cc.conns == nil { cc.mu.Unlock() return nil } if err != nil { // May need to apply the initial service config in case the resolver // doesn't support service configs, or doesn't provide a service config // with the new addresses. cc.maybeApplyDefaultServiceConfig() cc.balancerWrapper.resolverError(err) // No addresses are valid with err set; return early. cc.mu.Unlock() return balancer.ErrBadResolverState } var ret error if cc.dopts.disableServiceConfig { channelz.Infof(logger, cc.channelz, "ignoring service config from resolver (%v) and applying the default because service config is disabled", s.ServiceConfig) cc.maybeApplyDefaultServiceConfig() } else if s.ServiceConfig == nil { cc.maybeApplyDefaultServiceConfig() // TODO: do we need to apply a failing LB policy if there is no // default, per the error handling design? } else { if sc, ok := s.ServiceConfig.Config.(*ServiceConfig); s.ServiceConfig.Err == nil && ok { configSelector := iresolver.GetConfigSelector(s) if configSelector != nil { if len(s.ServiceConfig.Config.(*ServiceConfig).Methods) != 0 { channelz.Infof(logger, cc.channelz, "method configs in service config will be ignored due to presence of config selector") } } else { configSelector = &defaultConfigSelector{sc} } cc.applyServiceConfigAndBalancer(sc, configSelector) } else { ret = balancer.ErrBadResolverState if cc.sc == nil { // Apply the failing LB only if we haven't received valid service config // from the name resolver in the past. cc.applyFailingLBLocked(s.ServiceConfig) cc.mu.Unlock() return ret } } } balCfg := cc.sc.lbConfig bw := cc.balancerWrapper cc.mu.Unlock() uccsErr := bw.updateClientConnState(&balancer.ClientConnState{ResolverState: s, BalancerConfig: balCfg}) if ret == nil { ret = uccsErr // prefer ErrBadResolver state since any other error is // currently meaningless to the caller. } return ret } // applyFailingLBLocked is akin to configuring an LB policy on the channel which // always fails RPCs. Here, an actual LB policy is not configured, but an always // erroring picker is configured, which returns errors with information about // what was invalid in the received service config. A config selector with no // service config is configured, and the connectivity state of the channel is // set to TransientFailure. func (cc *ClientConn) applyFailingLBLocked(sc *serviceconfig.ParseResult) { var err error if sc.Err != nil { err = status.Errorf(codes.Unavailable, "error parsing service config: %v", sc.Err) } else { err = status.Errorf(codes.Unavailable, "illegal service config type: %T", sc.Config) } cc.safeConfigSelector.UpdateConfigSelector(&defaultConfigSelector{nil}) cc.pickerWrapper.updatePicker(base.NewErrPicker(err)) cc.csMgr.updateState(connectivity.TransientFailure) } // Makes a copy of the input addresses slice. Addresses are passed during // subconn creation and address update operations. func copyAddresses(in []resolver.Address) []resolver.Address { out := make([]resolver.Address, len(in)) copy(out, in) return out } // newAddrConnLocked creates an addrConn for addrs and adds it to cc.conns. // // Caller needs to make sure len(addrs) > 0. func (cc *ClientConn) newAddrConnLocked(addrs []resolver.Address, opts balancer.NewSubConnOptions) (*addrConn, error) { if cc.conns == nil { return nil, ErrClientConnClosing } ac := &addrConn{ state: connectivity.Idle, cc: cc, addrs: copyAddresses(addrs), scopts: opts, dopts: cc.dopts, channelz: channelz.RegisterSubChannel(cc.channelz, ""), resetBackoff: make(chan struct{}), } ac.updateTelemetryLabelsLocked() ac.ctx, ac.cancel = context.WithCancel(cc.ctx) // Start with our address set to the first address; this may be updated if // we connect to different addresses. ac.channelz.ChannelMetrics.Target.Store(&addrs[0].Addr) channelz.AddTraceEvent(logger, ac.channelz, 0, &channelz.TraceEvent{ Desc: "Subchannel created", Severity: channelz.CtInfo, Parent: &channelz.TraceEvent{ Desc: fmt.Sprintf("Subchannel(id:%d) created", ac.channelz.ID), Severity: channelz.CtInfo, }, }) // Track ac in cc. This needs to be done before any getTransport(...) is called. cc.conns[ac] = struct{}{} return ac, nil } // removeAddrConn removes the addrConn in the subConn from clientConn. // It also tears down the ac with the given error. func (cc *ClientConn) removeAddrConn(ac *addrConn, err error) { cc.mu.Lock() if cc.conns == nil { cc.mu.Unlock() return } delete(cc.conns, ac) cc.mu.Unlock() ac.tearDown(err) } // Target returns the target string of the ClientConn. func (cc *ClientConn) Target() string { return cc.target } // CanonicalTarget returns the canonical target string used when creating cc. // // This always has the form "://[authority]/". For example: // // - "dns:///example.com:42" // - "dns://8.8.8.8/example.com:42" // - "unix:///path/to/socket" func (cc *ClientConn) CanonicalTarget() string { return cc.parsedTarget.String() } func (cc *ClientConn) incrCallsStarted() { cc.channelz.ChannelMetrics.CallsStarted.Add(1) cc.channelz.ChannelMetrics.LastCallStartedTimestamp.Store(time.Now().UnixNano()) } func (cc *ClientConn) incrCallsSucceeded() { cc.channelz.ChannelMetrics.CallsSucceeded.Add(1) } func (cc *ClientConn) incrCallsFailed() { cc.channelz.ChannelMetrics.CallsFailed.Add(1) } // connect starts creating a transport. // It does nothing if the ac is not IDLE. // TODO(bar) Move this to the addrConn section. func (ac *addrConn) connect() error { ac.mu.Lock() if ac.state == connectivity.Shutdown { if logger.V(2) { logger.Infof("connect called on shutdown addrConn; ignoring.") } ac.mu.Unlock() return errConnClosing } if ac.state != connectivity.Idle { if logger.V(2) { logger.Infof("connect called on addrConn in non-idle state (%v); ignoring.", ac.state) } ac.mu.Unlock() return nil } ac.resetTransportAndUnlock() return nil } // equalAddressIgnoringBalAttributes returns true is a and b are considered equal. // This is different from the Equal method on the resolver.Address type which // considers all fields to determine equality. Here, we only consider fields // that are meaningful to the subConn. func equalAddressIgnoringBalAttributes(a, b *resolver.Address) bool { return a.Addr == b.Addr && a.ServerName == b.ServerName && a.Attributes.Equal(b.Attributes) && a.Metadata == b.Metadata } func equalAddressesIgnoringBalAttributes(a, b []resolver.Address) bool { return slices.EqualFunc(a, b, func(a, b resolver.Address) bool { return equalAddressIgnoringBalAttributes(&a, &b) }) } // updateAddrs updates ac.addrs with the new addresses list and handles active // connections or connection attempts. func (ac *addrConn) updateAddrs(addrs []resolver.Address) { addrs = copyAddresses(addrs) limit := len(addrs) if limit > 5 { limit = 5 } channelz.Infof(logger, ac.channelz, "addrConn: updateAddrs addrs (%d of %d): %v", limit, len(addrs), addrs[:limit]) ac.mu.Lock() if equalAddressesIgnoringBalAttributes(ac.addrs, addrs) { ac.mu.Unlock() return } ac.addrs = addrs ac.updateTelemetryLabelsLocked() if ac.state == connectivity.Shutdown || ac.state == connectivity.TransientFailure || ac.state == connectivity.Idle { // We were not connecting, so do nothing but update the addresses. ac.mu.Unlock() return } if ac.state == connectivity.Ready { // Try to find the connected address. for _, a := range addrs { a.ServerName = ac.cc.getServerName(a) if equalAddressIgnoringBalAttributes(&a, &ac.curAddr) { // We are connected to a valid address, so do nothing but // update the addresses. ac.mu.Unlock() return } } } // We are either connected to the wrong address or currently connecting. // Stop the current iteration and restart. ac.cancel() ac.ctx, ac.cancel = context.WithCancel(ac.cc.ctx) // We have to defer here because GracefulClose => onClose, which requires // locking ac.mu. if ac.transport != nil { defer ac.transport.GracefulClose() ac.transport = nil } if len(addrs) == 0 { ac.updateConnectivityState(connectivity.Idle, nil) } // Since we were connecting/connected, we should start a new connection // attempt. go ac.resetTransportAndUnlock() } // getServerName determines the serverName to be used in the connection // handshake. The default value for the serverName is the authority on the // ClientConn, which either comes from the user's dial target or through an // authority override specified using the WithAuthority dial option. Name // resolvers can specify a per-address override for the serverName through the // resolver.Address.ServerName field which is used only if the WithAuthority // dial option was not used. The rationale is that per-address authority // overrides specified by the name resolver can represent a security risk, while // an override specified by the user is more dependable since they probably know // what they are doing. func (cc *ClientConn) getServerName(addr resolver.Address) string { if cc.dopts.authority != "" { return cc.dopts.authority } if addr.ServerName != "" { return addr.ServerName } return cc.authority } func getMethodConfig(sc *ServiceConfig, method string) MethodConfig { if sc == nil { return MethodConfig{} } if m, ok := sc.Methods[method]; ok { return m } i := strings.LastIndex(method, "/") if m, ok := sc.Methods[method[:i+1]]; ok { return m } return sc.Methods[""] } // GetMethodConfig gets the method config of the input method. // If there's an exact match for input method (i.e. /service/method), we return // the corresponding MethodConfig. // If there isn't an exact match for the input method, we look for the service's default // config under the service (i.e /service/) and then for the default for all services (empty string). // // If there is a default MethodConfig for the service, we return it. // Otherwise, we return an empty MethodConfig. func (cc *ClientConn) GetMethodConfig(method string) MethodConfig { // TODO: Avoid the locking here. cc.mu.RLock() defer cc.mu.RUnlock() return getMethodConfig(cc.sc, method) } func (cc *ClientConn) healthCheckConfig() *healthCheckConfig { cc.mu.RLock() defer cc.mu.RUnlock() if cc.sc == nil { return nil } return cc.sc.healthCheckConfig } func (cc *ClientConn) applyServiceConfigAndBalancer(sc *ServiceConfig, configSelector iresolver.ConfigSelector) { if sc == nil { // should never reach here. return } cc.sc = sc if configSelector != nil { cc.safeConfigSelector.UpdateConfigSelector(configSelector) } if cc.sc.retryThrottling != nil { newThrottler := &retryThrottler{ tokens: cc.sc.retryThrottling.MaxTokens, max: cc.sc.retryThrottling.MaxTokens, thresh: cc.sc.retryThrottling.MaxTokens / 2, ratio: cc.sc.retryThrottling.TokenRatio, } cc.retryThrottler.Store(newThrottler) } else { cc.retryThrottler.Store((*retryThrottler)(nil)) } } func (cc *ClientConn) resolveNow(o resolver.ResolveNowOptions) { cc.mu.RLock() cc.resolverWrapper.resolveNow(o) cc.mu.RUnlock() } func (cc *ClientConn) resolveNowLocked(o resolver.ResolveNowOptions) { cc.resolverWrapper.resolveNow(o) } // ResetConnectBackoff wakes up all subchannels in transient failure and causes // them to attempt another connection immediately. It also resets the backoff // times used for subsequent attempts regardless of the current state. // // In general, this function should not be used. Typical service or network // outages result in a reasonable client reconnection strategy by default. // However, if a previously unavailable network becomes available, this may be // used to trigger an immediate reconnect. // // # Experimental // // Notice: This API is EXPERIMENTAL and may be changed or removed in a // later release. func (cc *ClientConn) ResetConnectBackoff() { cc.mu.Lock() conns := cc.conns cc.mu.Unlock() for ac := range conns { ac.resetConnectBackoff() } } // Close tears down the ClientConn and all underlying connections. func (cc *ClientConn) Close() error { defer func() { cc.cancel() <-cc.csMgr.pubSub.Done() }() // Prevent calls to enter/exit idle immediately, and ensure we are not // currently entering/exiting idle mode. cc.idlenessMgr.Close() cc.mu.Lock() if cc.conns == nil { cc.mu.Unlock() return ErrClientConnClosing } conns := cc.conns cc.conns = nil cc.csMgr.updateState(connectivity.Shutdown) // We can safely unlock and continue to access all fields now as // cc.conns==nil, preventing any further operations on cc. cc.mu.Unlock() cc.resolverWrapper.close() // The order of closing matters here since the balancer wrapper assumes the // picker is closed before it is closed. cc.pickerWrapper.close() cc.balancerWrapper.close() <-cc.resolverWrapper.serializer.Done() <-cc.balancerWrapper.serializer.Done() var wg sync.WaitGroup for ac := range conns { wg.Add(1) go func(ac *addrConn) { defer wg.Done() ac.tearDown(ErrClientConnClosing) }(ac) } wg.Wait() cc.addTraceEvent("deleted") // TraceEvent needs to be called before RemoveEntry, as TraceEvent may add // trace reference to the entity being deleted, and thus prevent it from being // deleted right away. channelz.RemoveEntry(cc.channelz.ID) return nil } // addrConn is a network connection to a given address. type addrConn struct { ctx context.Context cancel context.CancelFunc cc *ClientConn dopts dialOptions acbw *acBalancerWrapper scopts balancer.NewSubConnOptions // transport is set when there's a viable transport (note: ac state may not be READY as LB channel // health checking may require server to report healthy to set ac to READY), and is reset // to nil when the current transport should no longer be used to create a stream (e.g. after GoAway // is received, transport is closed, ac has been torn down). transport transport.ClientTransport // The current transport. // This mutex is used on the RPC path, so its usage should be minimized as // much as possible. // TODO: Find a lock-free way to retrieve the transport and state from the // addrConn. mu sync.Mutex curAddr resolver.Address // The current address. addrs []resolver.Address // All addresses that the resolver resolved to. // Use updateConnectivityState for updating addrConn's connectivity state. state connectivity.State backoffIdx int // Needs to be stateful for resetConnectBackoff. resetBackoff chan struct{} channelz *channelz.SubChannel localityLabel string backendServiceLabel string } // Note: this requires a lock on ac.mu. func (ac *addrConn) updateConnectivityState(s connectivity.State, lastErr error) { if ac.state == s { return } // If we are transitioning out of Ready, it means there is a disconnection. // A SubConn can also transition from CONNECTING directly to IDLE when // a transport is successfully created, but the connection fails // before the SubConn can send the notification for READY. We treat // this as a successful connection and transition to IDLE. // TODO: https://github.com/grpc/grpc-go/issues/7862 - Remove the second // part of the if condition below once the issue is fixed. if ac.state == connectivity.Ready || (ac.state == connectivity.Connecting && s == connectivity.Idle) { disconnectionsMetric.Record(ac.cc.metricsRecorderList, 1, ac.cc.target, ac.backendServiceLabel, ac.localityLabel, "unknown") openConnectionsMetric.Record(ac.cc.metricsRecorderList, -1, ac.cc.target, ac.backendServiceLabel, ac.securityLevelLocked(), ac.localityLabel) } ac.state = s ac.channelz.ChannelMetrics.State.Store(&s) if lastErr == nil { channelz.Infof(logger, ac.channelz, "Subchannel Connectivity change to %v", s) } else { channelz.Infof(logger, ac.channelz, "Subchannel Connectivity change to %v, last error: %s", s, lastErr) } ac.acbw.updateState(s, ac.curAddr, lastErr) } // adjustParams updates parameters used to create transports upon // receiving a GoAway. func (ac *addrConn) adjustParams(r transport.GoAwayReason) { if r == transport.GoAwayTooManyPings { v := 2 * ac.dopts.copts.KeepaliveParams.Time ac.cc.mu.Lock() if v > ac.cc.keepaliveParams.Time { ac.cc.keepaliveParams.Time = v } ac.cc.mu.Unlock() } } // resetTransportAndUnlock unconditionally connects the addrConn. // // ac.mu must be held by the caller, and this function will guarantee it is released. func (ac *addrConn) resetTransportAndUnlock() { acCtx := ac.ctx if acCtx.Err() != nil { ac.mu.Unlock() return } addrs := ac.addrs backoffFor := ac.dopts.bs.Backoff(ac.backoffIdx) // This will be the duration that dial gets to finish. dialDuration := minConnectTimeout if ac.dopts.minConnectTimeout != nil { dialDuration = ac.dopts.minConnectTimeout() } if dialDuration < backoffFor { // Give dial more time as we keep failing to connect. dialDuration = backoffFor } // We can potentially spend all the time trying the first address, and // if the server accepts the connection and then hangs, the following // addresses will never be tried. // // The spec doesn't mention what should be done for multiple addresses. // https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md#proposed-backoff-algorithm connectDeadline := time.Now().Add(dialDuration) ac.updateConnectivityState(connectivity.Connecting, nil) ac.mu.Unlock() if err := ac.tryAllAddrs(acCtx, addrs, connectDeadline); err != nil { if !errors.Is(err, context.Canceled) { connectionAttemptsFailedMetric.Record(ac.cc.metricsRecorderList, 1, ac.cc.target, ac.backendServiceLabel, ac.localityLabel) } else { if logger.V(2) { // This records cancelled connection attempts which can be later // replaced by a metric. logger.Infof("Context cancellation detected; not recording this as a failed connection attempt.") } } // TODO: #7534 - Move re-resolution requests into the pick_first LB policy // to ensure one resolution request per pass instead of per subconn failure. ac.cc.resolveNow(resolver.ResolveNowOptions{}) ac.mu.Lock() if acCtx.Err() != nil { // addrConn was torn down. ac.mu.Unlock() return } // After exhausting all addresses, the addrConn enters // TRANSIENT_FAILURE. ac.updateConnectivityState(connectivity.TransientFailure, err) // Backoff. b := ac.resetBackoff ac.mu.Unlock() timer := time.NewTimer(backoffFor) select { case <-timer.C: ac.mu.Lock() ac.backoffIdx++ ac.mu.Unlock() case <-b: timer.Stop() case <-acCtx.Done(): timer.Stop() return } ac.mu.Lock() if acCtx.Err() == nil { ac.updateConnectivityState(connectivity.Idle, err) } ac.mu.Unlock() return } // Success; reset backoff. ac.mu.Lock() connectionAttemptsSucceededMetric.Record(ac.cc.metricsRecorderList, 1, ac.cc.target, ac.backendServiceLabel, ac.localityLabel) openConnectionsMetric.Record(ac.cc.metricsRecorderList, 1, ac.cc.target, ac.backendServiceLabel, ac.securityLevelLocked(), ac.localityLabel) ac.backoffIdx = 0 ac.mu.Unlock() } // updateTelemetryLabelsLocked calculates and caches the telemetry labels based on the // first address in addrConn. func (ac *addrConn) updateTelemetryLabelsLocked() { labelsFunc, ok := internal.AddressToTelemetryLabels.(func(resolver.Address) map[string]string) if !ok || len(ac.addrs) == 0 { // Reset defaults ac.localityLabel = "" ac.backendServiceLabel = "" return } labels := labelsFunc(ac.addrs[0]) ac.localityLabel = labels["grpc.lb.locality"] ac.backendServiceLabel = labels["grpc.lb.backend_service"] } type securityLevelKey struct{} func (ac *addrConn) securityLevelLocked() string { var secLevel string // During disconnection, ac.transport is nil. Fall back to the security level // stored in the current address during connection. if ac.transport == nil { secLevel, _ = ac.curAddr.Attributes.Value(securityLevelKey{}).(string) return secLevel } authInfo := ac.transport.Peer().AuthInfo if ci, ok := authInfo.(interface { GetCommonAuthInfo() credentials.CommonAuthInfo }); ok { secLevel = ci.GetCommonAuthInfo().SecurityLevel.String() // Store the security level in the current address' attributes so // that it remains available for disconnection metrics after the // transport is closed. ac.curAddr.Attributes = ac.curAddr.Attributes.WithValue(securityLevelKey{}, secLevel) } return secLevel } // tryAllAddrs tries to create a connection to the addresses, and stop when at // the first successful one. It returns an error if no address was successfully // connected, or updates ac appropriately with the new transport. func (ac *addrConn) tryAllAddrs(ctx context.Context, addrs []resolver.Address, connectDeadline time.Time) error { var firstConnErr error for _, addr := range addrs { ac.channelz.ChannelMetrics.Target.Store(&addr.Addr) if ctx.Err() != nil { return errConnClosing } ac.mu.Lock() ac.cc.mu.RLock() ac.dopts.copts.KeepaliveParams = ac.cc.keepaliveParams ac.cc.mu.RUnlock() copts := ac.dopts.copts if ac.scopts.CredsBundle != nil { copts.CredsBundle = ac.scopts.CredsBundle } ac.mu.Unlock() channelz.Infof(logger, ac.channelz, "Subchannel picks a new address %q to connect", addr.Addr) err := ac.createTransport(ctx, addr, copts, connectDeadline) if err == nil { return nil } if firstConnErr == nil { firstConnErr = err } ac.cc.updateConnectionError(err) } // Couldn't connect to any address. return firstConnErr } // createTransport creates a connection to addr. It returns an error if the // address was not successfully connected, or updates ac appropriately with the // new transport. func (ac *addrConn) createTransport(ctx context.Context, addr resolver.Address, copts transport.ConnectOptions, connectDeadline time.Time) error { addr.ServerName = ac.cc.getServerName(addr) hctx, hcancel := context.WithCancel(ctx) onClose := func(r transport.GoAwayReason) { ac.mu.Lock() defer ac.mu.Unlock() // adjust params based on GoAwayReason ac.adjustParams(r) if ctx.Err() != nil { // Already shut down or connection attempt canceled. tearDown() or // updateAddrs() already cleared the transport and canceled hctx // via ac.ctx, and we expected this connection to be closed, so do // nothing here. return } hcancel() if ac.transport == nil { // We're still connecting to this address, which could error. Do // not update the connectivity state or resolve; these will happen // at the end of the tryAllAddrs connection loop in the event of an // error. return } ac.transport = nil // Refresh the name resolver on any connection loss. ac.cc.resolveNow(resolver.ResolveNowOptions{}) // Always go idle and wait for the LB policy to initiate a new // connection attempt. ac.updateConnectivityState(connectivity.Idle, nil) } connectCtx, cancel := context.WithDeadline(ctx, connectDeadline) defer cancel() copts.ChannelzParent = ac.channelz newTr, err := transport.NewHTTP2Client(connectCtx, ac.cc.ctx, addr, copts, onClose) if err != nil { if logger.V(2) { logger.Infof("Creating new client transport to %q: %v", addr, err) } // newTr is either nil, or closed. hcancel() channelz.Warningf(logger, ac.channelz, "grpc: addrConn.createTransport failed to connect to %s. Err: %v", addr, err) return err } ac.mu.Lock() defer ac.mu.Unlock() if ctx.Err() != nil { // This can happen if the subConn was removed while in `Connecting` // state. tearDown() would have set the state to `Shutdown`, but // would not have closed the transport since ac.transport would not // have been set at that point. // // We run this in a goroutine because newTr.Close() calls onClose() // inline, which requires locking ac.mu. // // The error we pass to Close() is immaterial since there are no open // streams at this point, so no trailers with error details will be sent // out. We just need to pass a non-nil error. // // This can also happen when updateAddrs is called during a connection // attempt. go newTr.Close(transport.ErrConnClosing) return nil } if hctx.Err() != nil { // onClose was already called for this connection, but the connection // was successfully established first. Consider it a success and set // the new state to Idle. ac.updateConnectivityState(connectivity.Idle, nil) return nil } ac.curAddr = addr ac.transport = newTr ac.startHealthCheck(hctx) // Will set state to READY if appropriate. return nil } // startHealthCheck starts the health checking stream (RPC) to watch the health // stats of this connection if health checking is requested and configured. // // LB channel health checking is enabled when all requirements below are met: // 1. it is not disabled by the user with the WithDisableHealthCheck DialOption // 2. internal.HealthCheckFunc is set by importing the grpc/health package // 3. a service config with non-empty healthCheckConfig field is provided // 4. the load balancer requests it // // It sets addrConn to READY if the health checking stream is not started. // // Caller must hold ac.mu. func (ac *addrConn) startHealthCheck(ctx context.Context) { var healthcheckManagingState bool defer func() { if !healthcheckManagingState { ac.updateConnectivityState(connectivity.Ready, nil) } }() if ac.cc.dopts.disableHealthCheck { return } healthCheckConfig := ac.cc.healthCheckConfig() if healthCheckConfig == nil { return } if !ac.scopts.HealthCheckEnabled { return } healthCheckFunc := internal.HealthCheckFunc if healthCheckFunc == nil { // The health package is not imported to set health check function. // // TODO: add a link to the health check doc in the error message. channelz.Error(logger, ac.channelz, "Health check is requested but health check function is not set.") return } healthcheckManagingState = true // Set up the health check helper functions. currentTr := ac.transport newStream := func(method string) (any, error) { ac.mu.Lock() if ac.transport != currentTr { ac.mu.Unlock() return nil, status.Error(codes.Canceled, "the provided transport is no longer valid to use") } ac.mu.Unlock() return newNonRetryClientStream(ctx, &StreamDesc{ServerStreams: true}, method, currentTr, ac) } setConnectivityState := func(s connectivity.State, lastErr error) { ac.mu.Lock() defer ac.mu.Unlock() if ac.transport != currentTr { return } ac.updateConnectivityState(s, lastErr) } // Start the health checking stream. go func() { err := healthCheckFunc(ctx, newStream, setConnectivityState, healthCheckConfig.ServiceName) if err != nil { if status.Code(err) == codes.Unimplemented { channelz.Error(logger, ac.channelz, "Subchannel health check is unimplemented at server side, thus health check is disabled") } else { channelz.Errorf(logger, ac.channelz, "Health checking failed: %v", err) } } }() } func (ac *addrConn) resetConnectBackoff() { ac.mu.Lock() close(ac.resetBackoff) ac.backoffIdx = 0 ac.resetBackoff = make(chan struct{}) ac.mu.Unlock() } // getReadyTransport returns the transport if ac's state is READY or nil if not. func (ac *addrConn) getReadyTransport() transport.ClientTransport { ac.mu.Lock() defer ac.mu.Unlock() if ac.state == connectivity.Ready { return ac.transport } return nil } // tearDown starts to tear down the addrConn. // // Note that tearDown doesn't remove ac from ac.cc.conns, so the addrConn struct // will leak. In most cases, call cc.removeAddrConn() instead. func (ac *addrConn) tearDown(err error) { ac.mu.Lock() if ac.state == connectivity.Shutdown { ac.mu.Unlock() return } curTr := ac.transport ac.transport = nil // We have to set the state to Shutdown before anything else to prevent races // between setting the state and logic that waits on context cancellation / etc. ac.updateConnectivityState(connectivity.Shutdown, nil) ac.cancel() ac.curAddr = resolver.Address{} channelz.AddTraceEvent(logger, ac.channelz, 0, &channelz.TraceEvent{ Desc: "Subchannel deleted", Severity: channelz.CtInfo, Parent: &channelz.TraceEvent{ Desc: fmt.Sprintf("Subchannel(id:%d) deleted", ac.channelz.ID), Severity: channelz.CtInfo, }, }) // TraceEvent needs to be called before RemoveEntry, as TraceEvent may add // trace reference to the entity being deleted, and thus prevent it from // being deleted right away. channelz.RemoveEntry(ac.channelz.ID) ac.mu.Unlock() // We have to release the lock before the call to GracefulClose/Close here // because both of them call onClose(), which requires locking ac.mu. if curTr != nil { if err == errConnDrain { // Close the transport gracefully when the subConn is being shutdown. // // GracefulClose() may be executed multiple times if: // - multiple GoAway frames are received from the server // - there are concurrent name resolver or balancer triggered // address removal and GoAway curTr.GracefulClose() } else { // Hard close the transport when the channel is entering idle or is // being shutdown. In the case where the channel is being shutdown, // closing of transports is also taken care of by cancellation of cc.ctx. // But in the case where the channel is entering idle, we need to // explicitly close the transports here. Instead of distinguishing // between these two cases, it is simpler to close the transport // unconditionally here. curTr.Close(err) } } } type retryThrottler struct { max float64 thresh float64 ratio float64 mu sync.Mutex tokens float64 // TODO(dfawley): replace with atomic and remove lock. } // throttle subtracts a retry token from the pool and returns whether a retry // should be throttled (disallowed) based upon the retry throttling policy in // the service config. func (rt *retryThrottler) throttle() bool { if rt == nil { return false } rt.mu.Lock() defer rt.mu.Unlock() rt.tokens-- if rt.tokens < 0 { rt.tokens = 0 } return rt.tokens <= rt.thresh } func (rt *retryThrottler) successfulRPC() { if rt == nil { return } rt.mu.Lock() defer rt.mu.Unlock() rt.tokens += rt.ratio if rt.tokens > rt.max { rt.tokens = rt.max } } func (ac *addrConn) incrCallsStarted() { ac.channelz.ChannelMetrics.CallsStarted.Add(1) ac.channelz.ChannelMetrics.LastCallStartedTimestamp.Store(time.Now().UnixNano()) } func (ac *addrConn) incrCallsSucceeded() { ac.channelz.ChannelMetrics.CallsSucceeded.Add(1) } func (ac *addrConn) incrCallsFailed() { ac.channelz.ChannelMetrics.CallsFailed.Add(1) } // ErrClientConnTimeout indicates that the ClientConn cannot establish the // underlying connections within the specified timeout. // // Deprecated: This error is never returned by grpc and should not be // referenced by users. var ErrClientConnTimeout = errors.New("grpc: timed out when dialing") // getResolver finds the scheme in the cc's resolvers or the global registry. // scheme should always be lowercase (typically by virtue of url.Parse() // performing proper RFC3986 behavior). func (cc *ClientConn) getResolver(scheme string) resolver.Builder { for _, rb := range cc.dopts.resolvers { if scheme == rb.Scheme() { return rb } } return resolver.Get(scheme) } func (cc *ClientConn) updateConnectionError(err error) { cc.lceMu.Lock() cc.lastConnectionError = err cc.lceMu.Unlock() } func (cc *ClientConn) connectionError() error { cc.lceMu.Lock() defer cc.lceMu.Unlock() return cc.lastConnectionError } // initParsedTargetAndResolverBuilder parses the user's dial target and stores // the parsed target in `cc.parsedTarget`. // // The resolver to use is determined based on the scheme in the parsed target // and the same is stored in `cc.resolverBuilder`. // // Doesn't grab cc.mu as this method is expected to be called only at Dial time. func (cc *ClientConn) initParsedTargetAndResolverBuilder() error { logger.Infof("original dial target is: %q", cc.target) var rb resolver.Builder parsedTarget, err := parseTarget(cc.target) if err == nil { rb = cc.getResolver(parsedTarget.URL.Scheme) if rb != nil { cc.parsedTarget = parsedTarget cc.resolverBuilder = rb return nil } } // We are here because the user's dial target did not contain a scheme or // specified an unregistered scheme. We should fallback to the default // scheme, except when a custom dialer is specified in which case, we should // always use passthrough scheme. For either case, we need to respect any overridden // global defaults set by the user. defScheme := cc.dopts.defaultScheme if internal.UserSetDefaultScheme { defScheme = resolver.GetDefaultScheme() } canonicalTarget := defScheme + ":///" + cc.target parsedTarget, err = parseTarget(canonicalTarget) if err != nil { return err } rb = cc.getResolver(parsedTarget.URL.Scheme) if rb == nil { return fmt.Errorf("could not get resolver for default scheme: %q", parsedTarget.URL.Scheme) } cc.parsedTarget = parsedTarget cc.resolverBuilder = rb return nil } // parseTarget uses RFC 3986 semantics to parse the given target into a // resolver.Target struct containing url. Query params are stripped from the // endpoint. func parseTarget(target string) (resolver.Target, error) { u, err := url.Parse(target) if err != nil { return resolver.Target{}, err } return resolver.Target{URL: *u}, nil } // encodeAuthority escapes the authority string based on valid chars defined in // https://datatracker.ietf.org/doc/html/rfc3986#section-3.2. func encodeAuthority(authority string) string { const upperhex = "0123456789ABCDEF" // Return for characters that must be escaped as per // Valid chars are mentioned here: // https://datatracker.ietf.org/doc/html/rfc3986#section-3.2 shouldEscape := func(c byte) bool { // Alphanum are always allowed. if 'a' <= c && c <= 'z' || 'A' <= c && c <= 'Z' || '0' <= c && c <= '9' { return false } switch c { case '-', '_', '.', '~': // Unreserved characters return false case '!', '$', '&', '\'', '(', ')', '*', '+', ',', ';', '=': // Subdelim characters return false case ':', '[', ']', '@': // Authority related delimiters return false } // Everything else must be escaped. return true } hexCount := 0 for i := 0; i < len(authority); i++ { c := authority[i] if shouldEscape(c) { hexCount++ } } if hexCount == 0 { return authority } required := len(authority) + 2*hexCount t := make([]byte, required) j := 0 // This logic is a barebones version of escape in the go net/url library. for i := 0; i < len(authority); i++ { switch c := authority[i]; { case shouldEscape(c): t[j] = '%' t[j+1] = upperhex[c>>4] t[j+2] = upperhex[c&15] j += 3 default: t[j] = authority[i] j++ } } return string(t) } // Determine channel authority. The order of precedence is as follows: // - user specified authority override using `WithAuthority` dial option // - creds' notion of server name for the authentication handshake // - endpoint from dial target of the form "scheme://[authority]/endpoint" // // Stores the determined authority in `cc.authority`. // // Returns a non-nil error if the authority returned by the transport // credentials do not match the authority configured through the dial option. // // Doesn't grab cc.mu as this method is expected to be called only at Dial time. func (cc *ClientConn) initAuthority() error { dopts := cc.dopts // Historically, we had two options for users to specify the serverName or // authority for a channel. One was through the transport credentials // (either in its constructor, or through the OverrideServerName() method). // The other option (for cases where WithInsecure() dial option was used) // was to use the WithAuthority() dial option. // // A few things have changed since: // - `insecure` package with an implementation of the `TransportCredentials` // interface for the insecure case // - WithAuthority() dial option support for secure credentials authorityFromCreds := "" if creds := dopts.copts.TransportCredentials; creds != nil && creds.Info().ServerName != "" { authorityFromCreds = creds.Info().ServerName } authorityFromDialOption := dopts.authority if (authorityFromCreds != "" && authorityFromDialOption != "") && authorityFromCreds != authorityFromDialOption { return fmt.Errorf("ClientConn's authority from transport creds %q and dial option %q don't match", authorityFromCreds, authorityFromDialOption) } endpoint := cc.parsedTarget.Endpoint() if authorityFromDialOption != "" { cc.authority = authorityFromDialOption } else if authorityFromCreds != "" { cc.authority = authorityFromCreds } else if auth, ok := cc.resolverBuilder.(resolver.AuthorityOverrider); ok { cc.authority = auth.OverrideAuthority(cc.parsedTarget) } else if strings.HasPrefix(endpoint, ":") { cc.authority = "localhost" + encodeAuthority(endpoint) } else { cc.authority = encodeAuthority(endpoint) } return nil } ================================================ FILE: vendor/google.golang.org/grpc/codec.go ================================================ /* * * Copyright 2014 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package grpc import ( "google.golang.org/grpc/encoding" _ "google.golang.org/grpc/encoding/proto" // to register the Codec for "proto" "google.golang.org/grpc/mem" ) // baseCodec captures the new encoding.CodecV2 interface without the Name // function, allowing it to be implemented by older Codec and encoding.Codec // implementations. The omitted Name function is only needed for the register in // the encoding package and is not part of the core functionality. type baseCodec interface { Marshal(v any) (mem.BufferSlice, error) Unmarshal(data mem.BufferSlice, v any) error } // getCodec returns an encoding.CodecV2 for the codec of the given name (if // registered). Initially checks the V2 registry with encoding.GetCodecV2 and // returns the V2 codec if it is registered. Otherwise, it checks the V1 registry // with encoding.GetCodec and if it is registered wraps it with newCodecV1Bridge // to turn it into an encoding.CodecV2. Returns nil otherwise. func getCodec(name string) encoding.CodecV2 { if codecV1 := encoding.GetCodec(name); codecV1 != nil { return newCodecV1Bridge(codecV1) } return encoding.GetCodecV2(name) } func newCodecV0Bridge(c Codec) baseCodec { return codecV0Bridge{codec: c} } func newCodecV1Bridge(c encoding.Codec) encoding.CodecV2 { return codecV1Bridge{ codecV0Bridge: codecV0Bridge{codec: c}, name: c.Name(), } } var _ baseCodec = codecV0Bridge{} type codecV0Bridge struct { codec interface { Marshal(v any) ([]byte, error) Unmarshal(data []byte, v any) error } } func (c codecV0Bridge) Marshal(v any) (mem.BufferSlice, error) { data, err := c.codec.Marshal(v) if err != nil { return nil, err } return mem.BufferSlice{mem.SliceBuffer(data)}, nil } func (c codecV0Bridge) Unmarshal(data mem.BufferSlice, v any) (err error) { return c.codec.Unmarshal(data.Materialize(), v) } var _ encoding.CodecV2 = codecV1Bridge{} type codecV1Bridge struct { codecV0Bridge name string } func (c codecV1Bridge) Name() string { return c.name } // Codec defines the interface gRPC uses to encode and decode messages. // Note that implementations of this interface must be thread safe; // a Codec's methods can be called from concurrent goroutines. // // Deprecated: use encoding.Codec instead. type Codec interface { // Marshal returns the wire format of v. Marshal(v any) ([]byte, error) // Unmarshal parses the wire format into v. Unmarshal(data []byte, v any) error // String returns the name of the Codec implementation. This is unused by // gRPC. String() string } ================================================ FILE: vendor/google.golang.org/grpc/codes/code_string.go ================================================ /* * * Copyright 2017 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package codes import ( "strconv" "google.golang.org/grpc/internal" ) func init() { internal.CanonicalString = canonicalString } func (c Code) String() string { switch c { case OK: return "OK" case Canceled: return "Canceled" case Unknown: return "Unknown" case InvalidArgument: return "InvalidArgument" case DeadlineExceeded: return "DeadlineExceeded" case NotFound: return "NotFound" case AlreadyExists: return "AlreadyExists" case PermissionDenied: return "PermissionDenied" case ResourceExhausted: return "ResourceExhausted" case FailedPrecondition: return "FailedPrecondition" case Aborted: return "Aborted" case OutOfRange: return "OutOfRange" case Unimplemented: return "Unimplemented" case Internal: return "Internal" case Unavailable: return "Unavailable" case DataLoss: return "DataLoss" case Unauthenticated: return "Unauthenticated" default: return "Code(" + strconv.FormatInt(int64(c), 10) + ")" } } func canonicalString(c Code) string { switch c { case OK: return "OK" case Canceled: return "CANCELLED" case Unknown: return "UNKNOWN" case InvalidArgument: return "INVALID_ARGUMENT" case DeadlineExceeded: return "DEADLINE_EXCEEDED" case NotFound: return "NOT_FOUND" case AlreadyExists: return "ALREADY_EXISTS" case PermissionDenied: return "PERMISSION_DENIED" case ResourceExhausted: return "RESOURCE_EXHAUSTED" case FailedPrecondition: return "FAILED_PRECONDITION" case Aborted: return "ABORTED" case OutOfRange: return "OUT_OF_RANGE" case Unimplemented: return "UNIMPLEMENTED" case Internal: return "INTERNAL" case Unavailable: return "UNAVAILABLE" case DataLoss: return "DATA_LOSS" case Unauthenticated: return "UNAUTHENTICATED" default: return "CODE(" + strconv.FormatInt(int64(c), 10) + ")" } } ================================================ FILE: vendor/google.golang.org/grpc/codes/codes.go ================================================ /* * * Copyright 2014 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package codes defines the canonical error codes used by gRPC. It is // consistent across various languages. package codes // import "google.golang.org/grpc/codes" import ( "fmt" "strconv" ) // A Code is a status code defined according to the [gRPC documentation]. // // Only the codes defined as consts in this package are valid codes. Do not use // other code values. Behavior of other codes is implementation-specific and // interoperability between implementations is not guaranteed. // // [gRPC documentation]: https://github.com/grpc/grpc/blob/master/doc/statuscodes.md type Code uint32 const ( // OK is returned on success. OK Code = 0 // Canceled indicates the operation was canceled (typically by the caller). // // The gRPC framework will generate this error code when cancellation // is requested. Canceled Code = 1 // Unknown error. An example of where this error may be returned is // if a Status value received from another address space belongs to // an error-space that is not known in this address space. Also // errors raised by APIs that do not return enough error information // may be converted to this error. // // The gRPC framework will generate this error code in the above two // mentioned cases. Unknown Code = 2 // InvalidArgument indicates client specified an invalid argument. // Note that this differs from FailedPrecondition. It indicates arguments // that are problematic regardless of the state of the system // (e.g., a malformed file name). // // This error code will not be generated by the gRPC framework. InvalidArgument Code = 3 // DeadlineExceeded means operation expired before completion. // For operations that change the state of the system, this error may be // returned even if the operation has completed successfully. For // example, a successful response from a server could have been delayed // long enough for the deadline to expire. // // The gRPC framework will generate this error code when the deadline is // exceeded. DeadlineExceeded Code = 4 // NotFound means some requested entity (e.g., file or directory) was // not found. // // This error code will not be generated by the gRPC framework. NotFound Code = 5 // AlreadyExists means an attempt to create an entity failed because one // already exists. // // This error code will not be generated by the gRPC framework. AlreadyExists Code = 6 // PermissionDenied indicates the caller does not have permission to // execute the specified operation. It must not be used for rejections // caused by exhausting some resource (use ResourceExhausted // instead for those errors). It must not be // used if the caller cannot be identified (use Unauthenticated // instead for those errors). // // This error code will not be generated by the gRPC core framework, // but expect authentication middleware to use it. PermissionDenied Code = 7 // ResourceExhausted indicates some resource has been exhausted, perhaps // a per-user quota, or perhaps the entire file system is out of space. // // This error code will be generated by the gRPC framework in // out-of-memory and server overload situations, or when a message is // larger than the configured maximum size. ResourceExhausted Code = 8 // FailedPrecondition indicates operation was rejected because the // system is not in a state required for the operation's execution. // For example, directory to be deleted may be non-empty, an rmdir // operation is applied to a non-directory, etc. // // A litmus test that may help a service implementor in deciding // between FailedPrecondition, Aborted, and Unavailable: // (a) Use Unavailable if the client can retry just the failing call. // (b) Use Aborted if the client should retry at a higher-level // (e.g., restarting a read-modify-write sequence). // (c) Use FailedPrecondition if the client should not retry until // the system state has been explicitly fixed. E.g., if an "rmdir" // fails because the directory is non-empty, FailedPrecondition // should be returned since the client should not retry unless // they have first fixed up the directory by deleting files from it. // (d) Use FailedPrecondition if the client performs conditional // REST Get/Update/Delete on a resource and the resource on the // server does not match the condition. E.g., conflicting // read-modify-write on the same resource. // // This error code will not be generated by the gRPC framework. FailedPrecondition Code = 9 // Aborted indicates the operation was aborted, typically due to a // concurrency issue like sequencer check failures, transaction aborts, // etc. // // See litmus test above for deciding between FailedPrecondition, // Aborted, and Unavailable. // // This error code will not be generated by the gRPC framework. Aborted Code = 10 // OutOfRange means operation was attempted past the valid range. // E.g., seeking or reading past end of file. // // Unlike InvalidArgument, this error indicates a problem that may // be fixed if the system state changes. For example, a 32-bit file // system will generate InvalidArgument if asked to read at an // offset that is not in the range [0,2^32-1], but it will generate // OutOfRange if asked to read from an offset past the current // file size. // // There is a fair bit of overlap between FailedPrecondition and // OutOfRange. We recommend using OutOfRange (the more specific // error) when it applies so that callers who are iterating through // a space can easily look for an OutOfRange error to detect when // they are done. // // This error code will not be generated by the gRPC framework. OutOfRange Code = 11 // Unimplemented indicates operation is not implemented or not // supported/enabled in this service. // // This error code will be generated by the gRPC framework. Most // commonly, you will see this error code when a method implementation // is missing on the server. It can also be generated for unknown // compression algorithms or a disagreement as to whether an RPC should // be streaming. Unimplemented Code = 12 // Internal errors. Means some invariants expected by underlying // system has been broken. If you see one of these errors, // something is very broken. // // This error code will be generated by the gRPC framework in several // internal error conditions. Internal Code = 13 // Unavailable indicates the service is currently unavailable. // This is a most likely a transient condition and may be corrected // by retrying with a backoff. Note that it is not always safe to retry // non-idempotent operations. // // See litmus test above for deciding between FailedPrecondition, // Aborted, and Unavailable. // // This error code will be generated by the gRPC framework during // abrupt shutdown of a server process or network connection. Unavailable Code = 14 // DataLoss indicates unrecoverable data loss or corruption. // // This error code will not be generated by the gRPC framework. DataLoss Code = 15 // Unauthenticated indicates the request does not have valid // authentication credentials for the operation. // // The gRPC framework will generate this error code when the // authentication metadata is invalid or a Credentials callback fails, // but also expect authentication middleware to generate it. Unauthenticated Code = 16 _maxCode = 17 ) var strToCode = map[string]Code{ `"OK"`: OK, `"CANCELLED"`:/* [sic] */ Canceled, `"UNKNOWN"`: Unknown, `"INVALID_ARGUMENT"`: InvalidArgument, `"DEADLINE_EXCEEDED"`: DeadlineExceeded, `"NOT_FOUND"`: NotFound, `"ALREADY_EXISTS"`: AlreadyExists, `"PERMISSION_DENIED"`: PermissionDenied, `"RESOURCE_EXHAUSTED"`: ResourceExhausted, `"FAILED_PRECONDITION"`: FailedPrecondition, `"ABORTED"`: Aborted, `"OUT_OF_RANGE"`: OutOfRange, `"UNIMPLEMENTED"`: Unimplemented, `"INTERNAL"`: Internal, `"UNAVAILABLE"`: Unavailable, `"DATA_LOSS"`: DataLoss, `"UNAUTHENTICATED"`: Unauthenticated, } // UnmarshalJSON unmarshals b into the Code. func (c *Code) UnmarshalJSON(b []byte) error { // From json.Unmarshaler: By convention, to approximate the behavior of // Unmarshal itself, Unmarshalers implement UnmarshalJSON([]byte("null")) as // a no-op. if string(b) == "null" { return nil } if c == nil { return fmt.Errorf("nil receiver passed to UnmarshalJSON") } if ci, err := strconv.ParseUint(string(b), 10, 32); err == nil { if ci >= _maxCode { return fmt.Errorf("invalid code: %d", ci) } *c = Code(ci) return nil } if jc, ok := strToCode[string(b)]; ok { *c = jc return nil } return fmt.Errorf("invalid code: %q", string(b)) } ================================================ FILE: vendor/google.golang.org/grpc/connectivity/connectivity.go ================================================ /* * * Copyright 2017 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package connectivity defines connectivity semantics. // For details, see https://github.com/grpc/grpc/blob/master/doc/connectivity-semantics-and-api.md. package connectivity import ( "google.golang.org/grpc/grpclog" ) var logger = grpclog.Component("core") // State indicates the state of connectivity. // It can be the state of a ClientConn or SubConn. type State int func (s State) String() string { switch s { case Idle: return "IDLE" case Connecting: return "CONNECTING" case Ready: return "READY" case TransientFailure: return "TRANSIENT_FAILURE" case Shutdown: return "SHUTDOWN" default: logger.Errorf("unknown connectivity state: %d", s) return "INVALID_STATE" } } const ( // Idle indicates the ClientConn is idle. Idle State = iota // Connecting indicates the ClientConn is connecting. Connecting // Ready indicates the ClientConn is ready for work. Ready // TransientFailure indicates the ClientConn has seen a failure but expects to recover. TransientFailure // Shutdown indicates the ClientConn has started shutting down. Shutdown ) // ServingMode indicates the current mode of operation of the server. // // Only xDS enabled gRPC servers currently report their serving mode. type ServingMode int const ( // ServingModeStarting indicates that the server is starting up. ServingModeStarting ServingMode = iota // ServingModeServing indicates that the server contains all required // configuration and is serving RPCs. ServingModeServing // ServingModeNotServing indicates that the server is not accepting new // connections. Existing connections will be closed gracefully, allowing // in-progress RPCs to complete. A server enters this mode when it does not // contain the required configuration to serve RPCs. ServingModeNotServing ) func (s ServingMode) String() string { switch s { case ServingModeStarting: return "STARTING" case ServingModeServing: return "SERVING" case ServingModeNotServing: return "NOT_SERVING" default: logger.Errorf("unknown serving mode: %d", s) return "INVALID_MODE" } } ================================================ FILE: vendor/google.golang.org/grpc/credentials/credentials.go ================================================ /* * * Copyright 2014 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package credentials implements various credentials supported by gRPC library, // which encapsulate all the state needed by a client to authenticate with a // server and make various assertions, e.g., about the client's identity, role, // or whether it is authorized to make a particular call. package credentials // import "google.golang.org/grpc/credentials" import ( "context" "errors" "fmt" "net" "google.golang.org/grpc/attributes" icredentials "google.golang.org/grpc/internal/credentials" "google.golang.org/protobuf/proto" ) // PerRPCCredentials defines the common interface for the credentials which need to // attach security information to every RPC (e.g., oauth2). type PerRPCCredentials interface { // GetRequestMetadata gets the current request metadata, refreshing tokens // if required. This should be called by the transport layer on each // request, and the data should be populated in headers or other // context. If a status code is returned, it will be used as the status for // the RPC (restricted to an allowable set of codes as defined by gRFC // A54). uri is the URI of the entry point for the request. When supported // by the underlying implementation, ctx can be used for timeout and // cancellation. Additionally, RequestInfo data will be available via ctx // to this call. GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) // RequireTransportSecurity indicates whether the credentials requires // transport security. RequireTransportSecurity() bool } // SecurityLevel defines the protection level on an established connection. // // This API is experimental. type SecurityLevel int const ( // InvalidSecurityLevel indicates an invalid security level. // The zero SecurityLevel value is invalid for backward compatibility. InvalidSecurityLevel SecurityLevel = iota // NoSecurity indicates a connection is insecure. NoSecurity // IntegrityOnly indicates a connection only provides integrity protection. IntegrityOnly // PrivacyAndIntegrity indicates a connection provides both privacy and integrity protection. PrivacyAndIntegrity ) // String returns SecurityLevel in a string format. func (s SecurityLevel) String() string { switch s { case NoSecurity: return "NoSecurity" case IntegrityOnly: return "IntegrityOnly" case PrivacyAndIntegrity: return "PrivacyAndIntegrity" } return fmt.Sprintf("invalid SecurityLevel: %v", int(s)) } // CommonAuthInfo contains authenticated information common to AuthInfo implementations. // It should be embedded in a struct implementing AuthInfo to provide additional information // about the credentials. // // This API is experimental. type CommonAuthInfo struct { SecurityLevel SecurityLevel } // GetCommonAuthInfo returns the pointer to CommonAuthInfo struct. func (c CommonAuthInfo) GetCommonAuthInfo() CommonAuthInfo { return c } // ProtocolInfo provides static information regarding transport credentials. type ProtocolInfo struct { // ProtocolVersion is the gRPC wire protocol version. // // Deprecated: this is unused by gRPC. ProtocolVersion string // SecurityProtocol is the security protocol in use. SecurityProtocol string // SecurityVersion is the security protocol version. It is a static version string from the // credentials, not a value that reflects per-connection protocol negotiation. To retrieve // details about the credentials used for a connection, use the Peer's AuthInfo field instead. // // Deprecated: please use Peer.AuthInfo. SecurityVersion string // ServerName is the user-configured server name. If set, this overrides // the default :authority header used for all RPCs on the channel using the // containing credentials, unless grpc.WithAuthority is set on the channel, // in which case that setting will take precedence. // // This must be a valid `:authority` header according to // [RFC3986](https://datatracker.ietf.org/doc/html/rfc3986#section-3.2). // // Deprecated: Users should use grpc.WithAuthority to override the authority // on a channel instead of configuring the credentials. ServerName string } // AuthInfo defines the common interface for the auth information the users are interested in. // A struct that implements AuthInfo should embed CommonAuthInfo by including additional // information about the credentials in it. type AuthInfo interface { AuthType() string } // AuthorityValidator validates the authority used to override the `:authority` // header. This is an optional interface that implementations of AuthInfo can // implement if they support per-RPC authority overrides. It is invoked when the // application attempts to override the HTTP/2 `:authority` header using the // CallAuthority call option. type AuthorityValidator interface { // ValidateAuthority checks the authority value used to override the // `:authority` header. The authority parameter is the override value // provided by the application via the CallAuthority option. This value // typically corresponds to the server hostname or endpoint the RPC is // targeting. It returns non-nil error if the validation fails. ValidateAuthority(authority string) error } // ErrConnDispatched indicates that rawConn has been dispatched out of gRPC // and the caller should not close rawConn. var ErrConnDispatched = errors.New("credentials: rawConn is dispatched out of gRPC") // TransportCredentials defines the common interface for all the live gRPC wire // protocols and supported transport security protocols (e.g., TLS, SSL). type TransportCredentials interface { // ClientHandshake does the authentication handshake specified by the // corresponding authentication protocol on rawConn for clients. It returns // the authenticated connection and the corresponding auth information // about the connection. The auth information should embed CommonAuthInfo // to return additional information about the credentials. Implementations // must use the provided context to implement timely cancellation. gRPC // will try to reconnect if the error returned is a temporary error // (io.EOF, context.DeadlineExceeded or err.Temporary() == true). If the // returned error is a wrapper error, implementations should make sure that // the error implements Temporary() to have the correct retry behaviors. // Additionally, ClientHandshakeInfo data will be available via the context // passed to this call. // // The second argument to this method is the `:authority` header value used // while creating new streams on this connection after authentication // succeeds. Implementations must use this as the server name during the // authentication handshake. // // If the returned net.Conn is closed, it MUST close the net.Conn provided. ClientHandshake(context.Context, string, net.Conn) (net.Conn, AuthInfo, error) // ServerHandshake does the authentication handshake for servers. It returns // the authenticated connection and the corresponding auth information about // the connection. The auth information should embed CommonAuthInfo to return additional information // about the credentials. // // If the returned net.Conn is closed, it MUST close the net.Conn provided. ServerHandshake(net.Conn) (net.Conn, AuthInfo, error) // Info provides the ProtocolInfo of this TransportCredentials. Info() ProtocolInfo // Clone makes a copy of this TransportCredentials. Clone() TransportCredentials // OverrideServerName specifies the value used for the following: // // - verifying the hostname on the returned certificates // - as SNI in the client's handshake to support virtual hosting // - as the value for `:authority` header at stream creation time // // The provided string should be a valid `:authority` header according to // [RFC3986](https://datatracker.ietf.org/doc/html/rfc3986#section-3.2). // // Deprecated: this method is unused by gRPC. Users should use // grpc.WithAuthority to override the authority on a channel instead of // configuring the credentials. OverrideServerName(string) error } // Bundle is a combination of TransportCredentials and PerRPCCredentials. // // It also contains a mode switching method, so it can be used as a combination // of different credential policies. // // Bundle cannot be used together with individual TransportCredentials. // PerRPCCredentials from Bundle will be appended to other PerRPCCredentials. // // This API is experimental. type Bundle interface { // TransportCredentials returns the transport credentials from the Bundle. // // Implementations must return non-nil transport credentials. If transport // security is not needed by the Bundle, implementations may choose to // return insecure.NewCredentials(). TransportCredentials() TransportCredentials // PerRPCCredentials returns the per-RPC credentials from the Bundle. // // May be nil if per-RPC credentials are not needed. PerRPCCredentials() PerRPCCredentials // NewWithMode should make a copy of Bundle, and switch mode. Modifying the // existing Bundle may cause races. // // NewWithMode returns nil if the requested mode is not supported. NewWithMode(mode string) (Bundle, error) } // RequestInfo contains request data attached to the context passed to GetRequestMetadata calls. // // This API is experimental. type RequestInfo struct { // The method passed to Invoke or NewStream for this RPC. (For proto methods, this has the format "/some.Service/Method") Method string // AuthInfo contains the information from a security handshake (TransportCredentials.ClientHandshake, TransportCredentials.ServerHandshake) AuthInfo AuthInfo } // requestInfoKey is a struct to be used as the key to store RequestInfo in a // context. type requestInfoKey struct{} // RequestInfoFromContext extracts the RequestInfo from the context if it exists. // // This API is experimental. func RequestInfoFromContext(ctx context.Context) (ri RequestInfo, ok bool) { ri, ok = ctx.Value(requestInfoKey{}).(RequestInfo) return ri, ok } // NewContextWithRequestInfo creates a new context from ctx and attaches ri to it. // // This RequestInfo will be accessible via RequestInfoFromContext. // // Intended to be used from tests for PerRPCCredentials implementations (that // often need to check connection's SecurityLevel). Should not be used from // non-test code: the gRPC client already prepares a context with the correct // RequestInfo attached when calling PerRPCCredentials.GetRequestMetadata. // // This API is experimental. func NewContextWithRequestInfo(ctx context.Context, ri RequestInfo) context.Context { return context.WithValue(ctx, requestInfoKey{}, ri) } // ClientHandshakeInfo holds data to be passed to ClientHandshake. This makes // it possible to pass arbitrary data to the handshaker from gRPC, resolver, // balancer etc. Individual credential implementations control the actual // format of the data that they are willing to receive. // // This API is experimental. type ClientHandshakeInfo struct { // Attributes contains the attributes for the address. It could be provided // by the gRPC, resolver, balancer etc. Attributes *attributes.Attributes } // ClientHandshakeInfoFromContext returns the ClientHandshakeInfo struct stored // in ctx. // // This API is experimental. func ClientHandshakeInfoFromContext(ctx context.Context) ClientHandshakeInfo { chi, _ := icredentials.ClientHandshakeInfoFromContext(ctx).(ClientHandshakeInfo) return chi } // CheckSecurityLevel checks if a connection's security level is greater than or equal to the specified one. // It returns success if 1) the condition is satisfied or 2) AuthInfo struct does not implement GetCommonAuthInfo() method // or 3) CommonAuthInfo.SecurityLevel has an invalid zero value. For 2) and 3), it is for the purpose of backward-compatibility. // // This API is experimental. func CheckSecurityLevel(ai AuthInfo, level SecurityLevel) error { type internalInfo interface { GetCommonAuthInfo() CommonAuthInfo } if ai == nil { return errors.New("AuthInfo is nil") } if ci, ok := ai.(internalInfo); ok { // CommonAuthInfo.SecurityLevel has an invalid value. if ci.GetCommonAuthInfo().SecurityLevel == InvalidSecurityLevel { return nil } if ci.GetCommonAuthInfo().SecurityLevel < level { return fmt.Errorf("requires SecurityLevel %v; connection has %v", level, ci.GetCommonAuthInfo().SecurityLevel) } } // The condition is satisfied or AuthInfo struct does not implement GetCommonAuthInfo() method. return nil } // ChannelzSecurityInfo defines the interface that security protocols should implement // in order to provide security info to channelz. // // This API is experimental. type ChannelzSecurityInfo interface { GetSecurityValue() ChannelzSecurityValue } // ChannelzSecurityValue defines the interface that GetSecurityValue() return value // should satisfy. This interface should only be satisfied by *TLSChannelzSecurityValue // and *OtherChannelzSecurityValue. // // This API is experimental. type ChannelzSecurityValue interface { isChannelzSecurityValue() } // OtherChannelzSecurityValue defines the struct that non-TLS protocol should return // from GetSecurityValue(), which contains protocol specific security info. Note // the Value field will be sent to users of channelz requesting channel info, and // thus sensitive info should better be avoided. // // This API is experimental. type OtherChannelzSecurityValue struct { ChannelzSecurityValue Name string Value proto.Message } ================================================ FILE: vendor/google.golang.org/grpc/credentials/insecure/insecure.go ================================================ /* * * Copyright 2020 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package insecure provides an implementation of the // credentials.TransportCredentials interface which disables transport security. package insecure import ( "context" "net" "google.golang.org/grpc/credentials" ) // NewCredentials returns a credentials which disables transport security. // // Note that using this credentials with per-RPC credentials which require // transport security is incompatible and will cause RPCs to fail. func NewCredentials() credentials.TransportCredentials { return insecureTC{} } // insecureTC implements the insecure transport credentials. The handshake // methods simply return the passed in net.Conn and set the security level to // NoSecurity. type insecureTC struct{} func (insecureTC) ClientHandshake(_ context.Context, _ string, conn net.Conn) (net.Conn, credentials.AuthInfo, error) { return conn, info{credentials.CommonAuthInfo{SecurityLevel: credentials.NoSecurity}}, nil } func (insecureTC) ServerHandshake(conn net.Conn) (net.Conn, credentials.AuthInfo, error) { return conn, info{credentials.CommonAuthInfo{SecurityLevel: credentials.NoSecurity}}, nil } func (insecureTC) Info() credentials.ProtocolInfo { return credentials.ProtocolInfo{SecurityProtocol: "insecure"} } func (insecureTC) Clone() credentials.TransportCredentials { return insecureTC{} } func (insecureTC) OverrideServerName(string) error { return nil } // info contains the auth information for an insecure connection. // It implements the AuthInfo interface. type info struct { credentials.CommonAuthInfo } // AuthType returns the type of info as a string. func (info) AuthType() string { return "insecure" } // ValidateAuthority allows any value to be overridden for the :authority // header. func (info) ValidateAuthority(string) error { return nil } // insecureBundle implements an insecure bundle. // An insecure bundle provides a thin wrapper around insecureTC to support // the credentials.Bundle interface. type insecureBundle struct{} // NewBundle returns a bundle with disabled transport security and no per rpc credential. func NewBundle() credentials.Bundle { return insecureBundle{} } // NewWithMode returns a new insecure Bundle. The mode is ignored. func (insecureBundle) NewWithMode(string) (credentials.Bundle, error) { return insecureBundle{}, nil } // PerRPCCredentials returns an nil implementation as insecure // bundle does not support a per rpc credential. func (insecureBundle) PerRPCCredentials() credentials.PerRPCCredentials { return nil } // TransportCredentials returns the underlying insecure transport credential. func (insecureBundle) TransportCredentials() credentials.TransportCredentials { return NewCredentials() } ================================================ FILE: vendor/google.golang.org/grpc/credentials/tls.go ================================================ /* * * Copyright 2014 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package credentials import ( "context" "crypto/tls" "crypto/x509" "errors" "fmt" "net" "net/url" "os" "google.golang.org/grpc/grpclog" credinternal "google.golang.org/grpc/internal/credentials" "google.golang.org/grpc/internal/envconfig" ) const alpnFailureHelpMessage = "If you upgraded from a grpc-go version earlier than 1.67, your TLS connections may have stopped working due to ALPN enforcement. For more details, see: https://github.com/grpc/grpc-go/issues/434" var logger = grpclog.Component("credentials") // TLSInfo contains the auth information for a TLS authenticated connection. // It implements the AuthInfo interface. type TLSInfo struct { State tls.ConnectionState CommonAuthInfo // This API is experimental. SPIFFEID *url.URL } // AuthType returns the type of TLSInfo as a string. func (t TLSInfo) AuthType() string { return "tls" } // ValidateAuthority validates the provided authority being used to override the // :authority header by verifying it against the peer certificates. It returns a // non-nil error if the validation fails. func (t TLSInfo) ValidateAuthority(authority string) error { var errs []error for _, cert := range t.State.PeerCertificates { var err error if err = cert.VerifyHostname(authority); err == nil { return nil } errs = append(errs, err) } return fmt.Errorf("credentials: invalid authority %q: %v", authority, errors.Join(errs...)) } // cipherSuiteLookup returns the string version of a TLS cipher suite ID. func cipherSuiteLookup(cipherSuiteID uint16) string { for _, s := range tls.CipherSuites() { if s.ID == cipherSuiteID { return s.Name } } for _, s := range tls.InsecureCipherSuites() { if s.ID == cipherSuiteID { return s.Name } } return fmt.Sprintf("unknown ID: %v", cipherSuiteID) } // GetSecurityValue returns security info requested by channelz. func (t TLSInfo) GetSecurityValue() ChannelzSecurityValue { v := &TLSChannelzSecurityValue{ StandardName: cipherSuiteLookup(t.State.CipherSuite), } // Currently there's no way to get LocalCertificate info from tls package. if len(t.State.PeerCertificates) > 0 { v.RemoteCertificate = t.State.PeerCertificates[0].Raw } return v } // tlsCreds is the credentials required for authenticating a connection using TLS. type tlsCreds struct { // TLS configuration config *tls.Config } func (c tlsCreds) Info() ProtocolInfo { return ProtocolInfo{ SecurityProtocol: "tls", SecurityVersion: "1.2", ServerName: c.config.ServerName, } } func (c *tlsCreds) ClientHandshake(ctx context.Context, authority string, rawConn net.Conn) (_ net.Conn, _ AuthInfo, err error) { // use local cfg to avoid clobbering ServerName if using multiple endpoints cfg := credinternal.CloneTLSConfig(c.config) serverName, _, err := net.SplitHostPort(authority) if err != nil { // If the authority had no host port or if the authority cannot be parsed, use it as-is. serverName = authority } cfg.ServerName = serverName conn := tls.Client(rawConn, cfg) errChannel := make(chan error, 1) go func() { errChannel <- conn.Handshake() close(errChannel) }() select { case err := <-errChannel: if err != nil { conn.Close() return nil, nil, err } case <-ctx.Done(): conn.Close() return nil, nil, ctx.Err() } // The negotiated protocol can be either of the following: // 1. h2: When the server supports ALPN. Only HTTP/2 can be negotiated since // it is the only protocol advertised by the client during the handshake. // The tls library ensures that the server chooses a protocol advertised // by the client. // 2. "" (empty string): If the server doesn't support ALPN. ALPN is a requirement // for using HTTP/2 over TLS. We can terminate the connection immediately. np := conn.ConnectionState().NegotiatedProtocol if np == "" { if envconfig.EnforceALPNEnabled { conn.Close() return nil, nil, fmt.Errorf("credentials: cannot check peer: missing selected ALPN property. %s", alpnFailureHelpMessage) } logger.Warningf("Allowing TLS connection to server %q with ALPN disabled. TLS connections to servers with ALPN disabled will be disallowed in future grpc-go releases", cfg.ServerName) } tlsInfo := TLSInfo{ State: conn.ConnectionState(), CommonAuthInfo: CommonAuthInfo{ SecurityLevel: PrivacyAndIntegrity, }, } id := credinternal.SPIFFEIDFromState(conn.ConnectionState()) if id != nil { tlsInfo.SPIFFEID = id } return credinternal.WrapSyscallConn(rawConn, conn), tlsInfo, nil } func (c *tlsCreds) ServerHandshake(rawConn net.Conn) (net.Conn, AuthInfo, error) { conn := tls.Server(rawConn, c.config) if err := conn.Handshake(); err != nil { conn.Close() return nil, nil, err } cs := conn.ConnectionState() // The negotiated application protocol can be empty only if the client doesn't // support ALPN. In such cases, we can close the connection since ALPN is required // for using HTTP/2 over TLS. if cs.NegotiatedProtocol == "" { if envconfig.EnforceALPNEnabled { conn.Close() return nil, nil, fmt.Errorf("credentials: cannot check peer: missing selected ALPN property. %s", alpnFailureHelpMessage) } else if logger.V(2) { logger.Info("Allowing TLS connection from client with ALPN disabled. TLS connections with ALPN disabled will be disallowed in future grpc-go releases") } } tlsInfo := TLSInfo{ State: cs, CommonAuthInfo: CommonAuthInfo{ SecurityLevel: PrivacyAndIntegrity, }, } id := credinternal.SPIFFEIDFromState(conn.ConnectionState()) if id != nil { tlsInfo.SPIFFEID = id } return credinternal.WrapSyscallConn(rawConn, conn), tlsInfo, nil } func (c *tlsCreds) Clone() TransportCredentials { return NewTLS(c.config) } func (c *tlsCreds) OverrideServerName(serverNameOverride string) error { c.config.ServerName = serverNameOverride return nil } // The following cipher suites are forbidden for use with HTTP/2 by // https://datatracker.ietf.org/doc/html/rfc7540#appendix-A var tls12ForbiddenCipherSuites = map[uint16]struct{}{ tls.TLS_RSA_WITH_AES_128_CBC_SHA: {}, tls.TLS_RSA_WITH_AES_256_CBC_SHA: {}, tls.TLS_RSA_WITH_AES_128_GCM_SHA256: {}, tls.TLS_RSA_WITH_AES_256_GCM_SHA384: {}, tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA: {}, tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA: {}, tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA: {}, tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA: {}, } // NewTLS uses c to construct a TransportCredentials based on TLS. func NewTLS(c *tls.Config) TransportCredentials { config := applyDefaults(c) if config.GetConfigForClient != nil { oldFn := config.GetConfigForClient config.GetConfigForClient = func(hello *tls.ClientHelloInfo) (*tls.Config, error) { cfgForClient, err := oldFn(hello) if err != nil || cfgForClient == nil { return cfgForClient, err } return applyDefaults(cfgForClient), nil } } return &tlsCreds{config: config} } func applyDefaults(c *tls.Config) *tls.Config { config := credinternal.CloneTLSConfig(c) config.NextProtos = credinternal.AppendH2ToNextProtos(config.NextProtos) // If the user did not configure a MinVersion and did not configure a // MaxVersion < 1.2, use MinVersion=1.2, which is required by // https://datatracker.ietf.org/doc/html/rfc7540#section-9.2 if config.MinVersion == 0 && (config.MaxVersion == 0 || config.MaxVersion >= tls.VersionTLS12) { config.MinVersion = tls.VersionTLS12 } // If the user did not configure CipherSuites, use all "secure" cipher // suites reported by the TLS package, but remove some explicitly forbidden // by https://datatracker.ietf.org/doc/html/rfc7540#appendix-A if config.CipherSuites == nil { for _, cs := range tls.CipherSuites() { if _, ok := tls12ForbiddenCipherSuites[cs.ID]; !ok { config.CipherSuites = append(config.CipherSuites, cs.ID) } } } return config } // NewClientTLSFromCert constructs TLS credentials from the provided root // certificate authority certificate(s) to validate server connections. If // certificates to establish the identity of the client need to be included in // the credentials (eg: for mTLS), use NewTLS instead, where a complete // tls.Config can be specified. // // serverNameOverride is for testing only. If set to a non empty string, it will // override the virtual host name of authority (e.g. :authority header field) in // requests. Users should use grpc.WithAuthority passed to grpc.NewClient to // override the authority of the client instead. func NewClientTLSFromCert(cp *x509.CertPool, serverNameOverride string) TransportCredentials { return NewTLS(&tls.Config{ServerName: serverNameOverride, RootCAs: cp}) } // NewClientTLSFromFile constructs TLS credentials from the provided root // certificate authority certificate file(s) to validate server connections. If // certificates to establish the identity of the client need to be included in // the credentials (eg: for mTLS), use NewTLS instead, where a complete // tls.Config can be specified. // // serverNameOverride is for testing only. If set to a non empty string, it will // override the virtual host name of authority (e.g. :authority header field) in // requests. Users should use grpc.WithAuthority passed to grpc.NewClient to // override the authority of the client instead. func NewClientTLSFromFile(certFile, serverNameOverride string) (TransportCredentials, error) { b, err := os.ReadFile(certFile) if err != nil { return nil, err } cp := x509.NewCertPool() if !cp.AppendCertsFromPEM(b) { return nil, fmt.Errorf("credentials: failed to append certificates") } return NewTLS(&tls.Config{ServerName: serverNameOverride, RootCAs: cp}), nil } // NewServerTLSFromCert constructs TLS credentials from the input certificate for server. func NewServerTLSFromCert(cert *tls.Certificate) TransportCredentials { return NewTLS(&tls.Config{Certificates: []tls.Certificate{*cert}}) } // NewServerTLSFromFile constructs TLS credentials from the input certificate file and key // file for server. func NewServerTLSFromFile(certFile, keyFile string) (TransportCredentials, error) { cert, err := tls.LoadX509KeyPair(certFile, keyFile) if err != nil { return nil, err } return NewTLS(&tls.Config{Certificates: []tls.Certificate{cert}}), nil } // TLSChannelzSecurityValue defines the struct that TLS protocol should return // from GetSecurityValue(), containing security info like cipher and certificate used. // // # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. type TLSChannelzSecurityValue struct { ChannelzSecurityValue StandardName string LocalCertificate []byte RemoteCertificate []byte } ================================================ FILE: vendor/google.golang.org/grpc/dialoptions.go ================================================ /* * * Copyright 2018 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package grpc import ( "context" "net" "net/url" "time" "google.golang.org/grpc/backoff" "google.golang.org/grpc/channelz" "google.golang.org/grpc/credentials" "google.golang.org/grpc/credentials/insecure" "google.golang.org/grpc/internal" internalbackoff "google.golang.org/grpc/internal/backoff" "google.golang.org/grpc/internal/binarylog" "google.golang.org/grpc/internal/transport" "google.golang.org/grpc/keepalive" "google.golang.org/grpc/mem" "google.golang.org/grpc/resolver" "google.golang.org/grpc/stats" ) const ( // https://github.com/grpc/proposal/blob/master/A6-client-retries.md#limits-on-retries-and-hedges defaultMaxCallAttempts = 5 ) func init() { internal.AddGlobalDialOptions = func(opt ...DialOption) { globalDialOptions = append(globalDialOptions, opt...) } internal.ClearGlobalDialOptions = func() { globalDialOptions = nil } internal.AddGlobalPerTargetDialOptions = func(opt any) { if ptdo, ok := opt.(perTargetDialOption); ok { globalPerTargetDialOptions = append(globalPerTargetDialOptions, ptdo) } } internal.ClearGlobalPerTargetDialOptions = func() { globalPerTargetDialOptions = nil } internal.WithBinaryLogger = withBinaryLogger internal.JoinDialOptions = newJoinDialOption internal.DisableGlobalDialOptions = newDisableGlobalDialOptions internal.WithBufferPool = withBufferPool } // dialOptions configure a Dial call. dialOptions are set by the DialOption // values passed to Dial. type dialOptions struct { unaryInt UnaryClientInterceptor streamInt StreamClientInterceptor chainUnaryInts []UnaryClientInterceptor chainStreamInts []StreamClientInterceptor compressorV0 Compressor dc Decompressor bs internalbackoff.Strategy block bool returnLastError bool timeout time.Duration authority string binaryLogger binarylog.Logger copts transport.ConnectOptions callOptions []CallOption channelzParent channelz.Identifier disableServiceConfig bool disableRetry bool disableHealthCheck bool minConnectTimeout func() time.Duration defaultServiceConfig *ServiceConfig // defaultServiceConfig is parsed from defaultServiceConfigRawJSON. defaultServiceConfigRawJSON *string resolvers []resolver.Builder idleTimeout time.Duration defaultScheme string maxCallAttempts int enableLocalDNSResolution bool // Specifies if target hostnames should be resolved when proxying is enabled. useProxy bool // Specifies if a server should be connected via proxy. } // DialOption configures how we set up the connection. type DialOption interface { apply(*dialOptions) } var globalDialOptions []DialOption // perTargetDialOption takes a parsed target and returns a dial option to apply. // // This gets called after NewClient() parses the target, and allows per target // configuration set through a returned DialOption. The DialOption will not take // effect if specifies a resolver builder, as that Dial Option is factored in // while parsing target. type perTargetDialOption interface { // DialOption returns a Dial Option to apply. DialOptionForTarget(parsedTarget url.URL) DialOption } var globalPerTargetDialOptions []perTargetDialOption // EmptyDialOption does not alter the dial configuration. It can be embedded in // another structure to build custom dial options. // // # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. type EmptyDialOption struct{} func (EmptyDialOption) apply(*dialOptions) {} type disableGlobalDialOptions struct{} func (disableGlobalDialOptions) apply(*dialOptions) {} // newDisableGlobalDialOptions returns a DialOption that prevents the ClientConn // from applying the global DialOptions (set via AddGlobalDialOptions). func newDisableGlobalDialOptions() DialOption { return &disableGlobalDialOptions{} } // funcDialOption wraps a function that modifies dialOptions into an // implementation of the DialOption interface. type funcDialOption struct { f func(*dialOptions) } func (fdo *funcDialOption) apply(do *dialOptions) { fdo.f(do) } func newFuncDialOption(f func(*dialOptions)) *funcDialOption { return &funcDialOption{ f: f, } } type joinDialOption struct { opts []DialOption } func (jdo *joinDialOption) apply(do *dialOptions) { for _, opt := range jdo.opts { opt.apply(do) } } func newJoinDialOption(opts ...DialOption) DialOption { return &joinDialOption{opts: opts} } // WithSharedWriteBuffer allows reusing per-connection transport write buffer. // If this option is set to true every connection will release the buffer after // flushing the data on the wire. // // # Experimental // // Notice: This API is EXPERIMENTAL and may be changed or removed in a // later release. func WithSharedWriteBuffer(val bool) DialOption { return newFuncDialOption(func(o *dialOptions) { o.copts.SharedWriteBuffer = val }) } // WithWriteBufferSize determines how much data can be batched before doing a // write on the wire. The default value for this buffer is 32KB. // // Zero or negative values will disable the write buffer such that each write // will be on underlying connection. Note: A Send call may not directly // translate to a write. func WithWriteBufferSize(s int) DialOption { return newFuncDialOption(func(o *dialOptions) { o.copts.WriteBufferSize = s }) } // WithReadBufferSize lets you set the size of read buffer, this determines how // much data can be read at most for each read syscall. // // The default value for this buffer is 32KB. Zero or negative values will // disable read buffer for a connection so data framer can access the // underlying conn directly. func WithReadBufferSize(s int) DialOption { return newFuncDialOption(func(o *dialOptions) { o.copts.ReadBufferSize = s }) } // WithInitialWindowSize returns a DialOption which sets the value for initial // window size on a stream. The lower bound for window size is 64K and any value // smaller than that will be ignored. func WithInitialWindowSize(s int32) DialOption { return newFuncDialOption(func(o *dialOptions) { o.copts.InitialWindowSize = s o.copts.StaticWindowSize = true }) } // WithInitialConnWindowSize returns a DialOption which sets the value for // initial window size on a connection. The lower bound for window size is 64K // and any value smaller than that will be ignored. func WithInitialConnWindowSize(s int32) DialOption { return newFuncDialOption(func(o *dialOptions) { o.copts.InitialConnWindowSize = s o.copts.StaticWindowSize = true }) } // WithStaticStreamWindowSize returns a DialOption which sets the initial // stream window size to the value provided and disables dynamic flow control. func WithStaticStreamWindowSize(s int32) DialOption { return newFuncDialOption(func(o *dialOptions) { o.copts.InitialWindowSize = s o.copts.StaticWindowSize = true }) } // WithStaticConnWindowSize returns a DialOption which sets the initial // connection window size to the value provided and disables dynamic flow // control. func WithStaticConnWindowSize(s int32) DialOption { return newFuncDialOption(func(o *dialOptions) { o.copts.InitialConnWindowSize = s o.copts.StaticWindowSize = true }) } // WithMaxMsgSize returns a DialOption which sets the maximum message size the // client can receive. // // Deprecated: use WithDefaultCallOptions(MaxCallRecvMsgSize(s)) instead. Will // be supported throughout 1.x. func WithMaxMsgSize(s int) DialOption { return WithDefaultCallOptions(MaxCallRecvMsgSize(s)) } // WithDefaultCallOptions returns a DialOption which sets the default // CallOptions for calls over the connection. func WithDefaultCallOptions(cos ...CallOption) DialOption { return newFuncDialOption(func(o *dialOptions) { o.callOptions = append(o.callOptions, cos...) }) } // WithCodec returns a DialOption which sets a codec for message marshaling and // unmarshaling. // // Deprecated: use WithDefaultCallOptions(ForceCodec(_)) instead. Will be // supported throughout 1.x. func WithCodec(c Codec) DialOption { return WithDefaultCallOptions(CallCustomCodec(c)) } // WithCompressor returns a DialOption which sets a Compressor to use for // message compression. It has lower priority than the compressor set by the // UseCompressor CallOption. // // Deprecated: use UseCompressor instead. Will be supported throughout 1.x. func WithCompressor(cp Compressor) DialOption { return newFuncDialOption(func(o *dialOptions) { o.compressorV0 = cp }) } // WithDecompressor returns a DialOption which sets a Decompressor to use for // incoming message decompression. If incoming response messages are encoded // using the decompressor's Type(), it will be used. Otherwise, the message // encoding will be used to look up the compressor registered via // encoding.RegisterCompressor, which will then be used to decompress the // message. If no compressor is registered for the encoding, an Unimplemented // status error will be returned. // // Deprecated: use encoding.RegisterCompressor instead. Will be supported // throughout 1.x. func WithDecompressor(dc Decompressor) DialOption { return newFuncDialOption(func(o *dialOptions) { o.dc = dc }) } // WithConnectParams configures the ClientConn to use the provided ConnectParams // for creating and maintaining connections to servers. // // The backoff configuration specified as part of the ConnectParams overrides // all defaults specified in // https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md. Consider // using the backoff.DefaultConfig as a base, in cases where you want to // override only a subset of the backoff configuration. func WithConnectParams(p ConnectParams) DialOption { return newFuncDialOption(func(o *dialOptions) { o.bs = internalbackoff.Exponential{Config: p.Backoff} o.minConnectTimeout = func() time.Duration { return p.MinConnectTimeout } }) } // WithBackoffMaxDelay configures the dialer to use the provided maximum delay // when backing off after failed connection attempts. // // Deprecated: use WithConnectParams instead. Will be supported throughout 1.x. func WithBackoffMaxDelay(md time.Duration) DialOption { return WithBackoffConfig(BackoffConfig{MaxDelay: md}) } // WithBackoffConfig configures the dialer to use the provided backoff // parameters after connection failures. // // Deprecated: use WithConnectParams instead. Will be supported throughout 1.x. func WithBackoffConfig(b BackoffConfig) DialOption { bc := backoff.DefaultConfig bc.MaxDelay = b.MaxDelay return withBackoff(internalbackoff.Exponential{Config: bc}) } // withBackoff sets the backoff strategy used for connectRetryNum after a failed // connection attempt. // // This can be exported if arbitrary backoff strategies are allowed by gRPC. func withBackoff(bs internalbackoff.Strategy) DialOption { return newFuncDialOption(func(o *dialOptions) { o.bs = bs }) } // WithBlock returns a DialOption which makes callers of Dial block until the // underlying connection is up. Without this, Dial returns immediately and // connecting the server happens in background. // // Use of this feature is not recommended. For more information, please see: // https://github.com/grpc/grpc-go/blob/master/Documentation/anti-patterns.md // // Deprecated: this DialOption is not supported by NewClient. // Will be supported throughout 1.x. func WithBlock() DialOption { return newFuncDialOption(func(o *dialOptions) { o.block = true }) } // WithReturnConnectionError returns a DialOption which makes the client connection // return a string containing both the last connection error that occurred and // the context.DeadlineExceeded error. // Implies WithBlock() // // Use of this feature is not recommended. For more information, please see: // https://github.com/grpc/grpc-go/blob/master/Documentation/anti-patterns.md // // Deprecated: this DialOption is not supported by NewClient. // Will be supported throughout 1.x. func WithReturnConnectionError() DialOption { return newFuncDialOption(func(o *dialOptions) { o.block = true o.returnLastError = true }) } // WithInsecure returns a DialOption which disables transport security for this // ClientConn. Under the hood, it uses insecure.NewCredentials(). // // Note that using this DialOption with per-RPC credentials (through // WithCredentialsBundle or WithPerRPCCredentials) which require transport // security is incompatible and will cause RPCs to fail. // // Deprecated: use WithTransportCredentials and insecure.NewCredentials() // instead. Will be supported throughout 1.x. func WithInsecure() DialOption { return newFuncDialOption(func(o *dialOptions) { o.copts.TransportCredentials = insecure.NewCredentials() }) } // WithNoProxy returns a DialOption which disables the use of proxies for this // ClientConn. This is ignored if WithDialer or WithContextDialer are used. // // # Experimental // // Notice: This API is EXPERIMENTAL and may be changed or removed in a // later release. func WithNoProxy() DialOption { return newFuncDialOption(func(o *dialOptions) { o.useProxy = false }) } // WithLocalDNSResolution forces local DNS name resolution even when a proxy is // specified in the environment. By default, the server name is provided // directly to the proxy as part of the CONNECT handshake. This is ignored if // WithNoProxy is used. // // # Experimental // // Notice: This API is EXPERIMENTAL and may be changed or removed in a // later release. func WithLocalDNSResolution() DialOption { return newFuncDialOption(func(o *dialOptions) { o.enableLocalDNSResolution = true }) } // WithTransportCredentials returns a DialOption which configures a connection // level security credentials (e.g., TLS/SSL). This should not be used together // with WithCredentialsBundle. func WithTransportCredentials(creds credentials.TransportCredentials) DialOption { return newFuncDialOption(func(o *dialOptions) { o.copts.TransportCredentials = creds }) } // WithPerRPCCredentials returns a DialOption which sets credentials and places // auth state on each outbound RPC. func WithPerRPCCredentials(creds credentials.PerRPCCredentials) DialOption { return newFuncDialOption(func(o *dialOptions) { o.copts.PerRPCCredentials = append(o.copts.PerRPCCredentials, creds) }) } // WithCredentialsBundle returns a DialOption to set a credentials bundle for // the ClientConn.WithCreds. This should not be used together with // WithTransportCredentials. // // # Experimental // // Notice: This API is EXPERIMENTAL and may be changed or removed in a // later release. func WithCredentialsBundle(b credentials.Bundle) DialOption { return newFuncDialOption(func(o *dialOptions) { o.copts.CredsBundle = b }) } // WithTimeout returns a DialOption that configures a timeout for dialing a // ClientConn initially. This is valid if and only if WithBlock() is present. // // Deprecated: this DialOption is not supported by NewClient. // Will be supported throughout 1.x. func WithTimeout(d time.Duration) DialOption { return newFuncDialOption(func(o *dialOptions) { o.timeout = d }) } // WithContextDialer returns a DialOption that sets a dialer to create // connections. If FailOnNonTempDialError() is set to true, and an error is // returned by f, gRPC checks the error's Temporary() method to decide if it // should try to reconnect to the network address. // // Note that gRPC by default performs name resolution on the target passed to // NewClient. To bypass name resolution and cause the target string to be // passed directly to the dialer here instead, use the "passthrough" resolver // by specifying it in the target string, e.g. "passthrough:target". // // Note: All supported releases of Go (as of December 2023) override the OS // defaults for TCP keepalive time and interval to 15s. To enable TCP keepalive // with OS defaults for keepalive time and interval, use a net.Dialer that sets // the KeepAlive field to a negative value, and sets the SO_KEEPALIVE socket // option to true from the Control field. For a concrete example of how to do // this, see internal.NetDialerWithTCPKeepalive(). // // For more information, please see [issue 23459] in the Go GitHub repo. // // [issue 23459]: https://github.com/golang/go/issues/23459 func WithContextDialer(f func(context.Context, string) (net.Conn, error)) DialOption { return newFuncDialOption(func(o *dialOptions) { o.copts.Dialer = f }) } // WithDialer returns a DialOption that specifies a function to use for dialing // network addresses. If FailOnNonTempDialError() is set to true, and an error // is returned by f, gRPC checks the error's Temporary() method to decide if it // should try to reconnect to the network address. // // Deprecated: use WithContextDialer instead. Will be supported throughout // 1.x. func WithDialer(f func(string, time.Duration) (net.Conn, error)) DialOption { return WithContextDialer( func(ctx context.Context, addr string) (net.Conn, error) { if deadline, ok := ctx.Deadline(); ok { return f(addr, time.Until(deadline)) } return f(addr, 0) }) } // WithStatsHandler returns a DialOption that specifies the stats handler for // all the RPCs and underlying network connections in this ClientConn. func WithStatsHandler(h stats.Handler) DialOption { return newFuncDialOption(func(o *dialOptions) { if h == nil { logger.Error("ignoring nil parameter in grpc.WithStatsHandler ClientOption") // Do not allow a nil stats handler, which would otherwise cause // panics. return } o.copts.StatsHandlers = append(o.copts.StatsHandlers, h) }) } // withBinaryLogger returns a DialOption that specifies the binary logger for // this ClientConn. func withBinaryLogger(bl binarylog.Logger) DialOption { return newFuncDialOption(func(o *dialOptions) { o.binaryLogger = bl }) } // FailOnNonTempDialError returns a DialOption that specifies if gRPC fails on // non-temporary dial errors. If f is true, and dialer returns a non-temporary // error, gRPC will fail the connection to the network address and won't try to // reconnect. The default value of FailOnNonTempDialError is false. // // FailOnNonTempDialError only affects the initial dial, and does not do // anything useful unless you are also using WithBlock(). // // Use of this feature is not recommended. For more information, please see: // https://github.com/grpc/grpc-go/blob/master/Documentation/anti-patterns.md // // Deprecated: this DialOption is not supported by NewClient. // This API may be changed or removed in a // later release. func FailOnNonTempDialError(f bool) DialOption { return newFuncDialOption(func(o *dialOptions) { o.copts.FailOnNonTempDialError = f }) } // WithUserAgent returns a DialOption that specifies a user agent string for all // the RPCs. func WithUserAgent(s string) DialOption { return newFuncDialOption(func(o *dialOptions) { o.copts.UserAgent = s + " " + grpcUA }) } // WithKeepaliveParams returns a DialOption that specifies keepalive parameters // for the client transport. // // Keepalive is disabled by default. func WithKeepaliveParams(kp keepalive.ClientParameters) DialOption { if kp.Time < internal.KeepaliveMinPingTime { logger.Warningf("Adjusting keepalive ping interval to minimum period of %v", internal.KeepaliveMinPingTime) kp.Time = internal.KeepaliveMinPingTime } return newFuncDialOption(func(o *dialOptions) { o.copts.KeepaliveParams = kp }) } // WithUnaryInterceptor returns a DialOption that specifies the interceptor for // unary RPCs. func WithUnaryInterceptor(f UnaryClientInterceptor) DialOption { return newFuncDialOption(func(o *dialOptions) { o.unaryInt = f }) } // WithChainUnaryInterceptor returns a DialOption that specifies the chained // interceptor for unary RPCs. The first interceptor will be the outer most, // while the last interceptor will be the inner most wrapper around the real call. // All interceptors added by this method will be chained, and the interceptor // defined by WithUnaryInterceptor will always be prepended to the chain. func WithChainUnaryInterceptor(interceptors ...UnaryClientInterceptor) DialOption { return newFuncDialOption(func(o *dialOptions) { o.chainUnaryInts = append(o.chainUnaryInts, interceptors...) }) } // WithStreamInterceptor returns a DialOption that specifies the interceptor for // streaming RPCs. func WithStreamInterceptor(f StreamClientInterceptor) DialOption { return newFuncDialOption(func(o *dialOptions) { o.streamInt = f }) } // WithChainStreamInterceptor returns a DialOption that specifies the chained // interceptor for streaming RPCs. The first interceptor will be the outer most, // while the last interceptor will be the inner most wrapper around the real call. // All interceptors added by this method will be chained, and the interceptor // defined by WithStreamInterceptor will always be prepended to the chain. func WithChainStreamInterceptor(interceptors ...StreamClientInterceptor) DialOption { return newFuncDialOption(func(o *dialOptions) { o.chainStreamInts = append(o.chainStreamInts, interceptors...) }) } // WithAuthority returns a DialOption that specifies the value to be used as the // :authority pseudo-header and as the server name in authentication handshake. // This overrides all other ways of setting authority on the channel, but can be // overridden per-call by using grpc.CallAuthority. func WithAuthority(a string) DialOption { return newFuncDialOption(func(o *dialOptions) { o.authority = a }) } // WithChannelzParentID returns a DialOption that specifies the channelz ID of // current ClientConn's parent. This function is used in nested channel creation // (e.g. grpclb dial). // // # Experimental // // Notice: This API is EXPERIMENTAL and may be changed or removed in a // later release. func WithChannelzParentID(c channelz.Identifier) DialOption { return newFuncDialOption(func(o *dialOptions) { o.channelzParent = c }) } // WithDisableServiceConfig returns a DialOption that causes gRPC to ignore any // service config provided by the resolver and provides a hint to the resolver // to not fetch service configs. // // Note that this dial option only disables service config from resolver. If // default service config is provided, gRPC will use the default service config. func WithDisableServiceConfig() DialOption { return newFuncDialOption(func(o *dialOptions) { o.disableServiceConfig = true }) } // WithDefaultServiceConfig returns a DialOption that configures the default // service config, which will be used in cases where: // // 1. WithDisableServiceConfig is also used, or // // 2. The name resolver does not provide a service config or provides an // invalid service config. // // The parameter s is the JSON representation of the default service config. // For more information about service configs, see: // https://github.com/grpc/grpc/blob/master/doc/service_config.md // For a simple example of usage, see: // examples/features/load_balancing/client/main.go func WithDefaultServiceConfig(s string) DialOption { return newFuncDialOption(func(o *dialOptions) { o.defaultServiceConfigRawJSON = &s }) } // WithDisableRetry returns a DialOption that disables retries, even if the // service config enables them. This does not impact transparent retries, which // will happen automatically if no data is written to the wire or if the RPC is // unprocessed by the remote server. func WithDisableRetry() DialOption { return newFuncDialOption(func(o *dialOptions) { o.disableRetry = true }) } // MaxHeaderListSizeDialOption is a DialOption that specifies the maximum // (uncompressed) size of header list that the client is prepared to accept. type MaxHeaderListSizeDialOption struct { MaxHeaderListSize uint32 } func (o MaxHeaderListSizeDialOption) apply(do *dialOptions) { do.copts.MaxHeaderListSize = &o.MaxHeaderListSize } // WithMaxHeaderListSize returns a DialOption that specifies the maximum // (uncompressed) size of header list that the client is prepared to accept. func WithMaxHeaderListSize(s uint32) DialOption { return MaxHeaderListSizeDialOption{ MaxHeaderListSize: s, } } // WithDisableHealthCheck disables the LB channel health checking for all // SubConns of this ClientConn. // // # Experimental // // Notice: This API is EXPERIMENTAL and may be changed or removed in a // later release. func WithDisableHealthCheck() DialOption { return newFuncDialOption(func(o *dialOptions) { o.disableHealthCheck = true }) } func defaultDialOptions() dialOptions { return dialOptions{ copts: transport.ConnectOptions{ ReadBufferSize: defaultReadBufSize, WriteBufferSize: defaultWriteBufSize, UserAgent: grpcUA, BufferPool: mem.DefaultBufferPool(), }, bs: internalbackoff.DefaultExponential, idleTimeout: 30 * time.Minute, defaultScheme: "dns", maxCallAttempts: defaultMaxCallAttempts, useProxy: true, enableLocalDNSResolution: false, } } // withMinConnectDeadline specifies the function that clientconn uses to // get minConnectDeadline. This can be used to make connection attempts happen // faster/slower. // // For testing purpose only. func withMinConnectDeadline(f func() time.Duration) DialOption { return newFuncDialOption(func(o *dialOptions) { o.minConnectTimeout = f }) } // withDefaultScheme is used to allow Dial to use "passthrough" as the default // name resolver, while NewClient uses "dns" otherwise. func withDefaultScheme(s string) DialOption { return newFuncDialOption(func(o *dialOptions) { o.defaultScheme = s }) } // WithResolvers allows a list of resolver implementations to be registered // locally with the ClientConn without needing to be globally registered via // resolver.Register. They will be matched against the scheme used for the // current Dial only, and will take precedence over the global registry. // // # Experimental // // Notice: This API is EXPERIMENTAL and may be changed or removed in a // later release. func WithResolvers(rs ...resolver.Builder) DialOption { return newFuncDialOption(func(o *dialOptions) { o.resolvers = append(o.resolvers, rs...) }) } // WithIdleTimeout returns a DialOption that configures an idle timeout for the // channel. If the channel is idle for the configured timeout, i.e there are no // ongoing RPCs and no new RPCs are initiated, the channel will enter idle mode // and as a result the name resolver and load balancer will be shut down. The // channel will exit idle mode when the Connect() method is called or when an // RPC is initiated. // // A default timeout of 30 minutes will be used if this dial option is not set // at dial time and idleness can be disabled by passing a timeout of zero. // // # Experimental // // Notice: This API is EXPERIMENTAL and may be changed or removed in a // later release. func WithIdleTimeout(d time.Duration) DialOption { return newFuncDialOption(func(o *dialOptions) { o.idleTimeout = d }) } // WithMaxCallAttempts returns a DialOption that configures the maximum number // of attempts per call (including retries and hedging) using the channel. // Service owners may specify a higher value for these parameters, but higher // values will be treated as equal to the maximum value by the client // implementation. This mitigates security concerns related to the service // config being transferred to the client via DNS. // // A value of 5 will be used if this dial option is not set or n < 2. func WithMaxCallAttempts(n int) DialOption { return newFuncDialOption(func(o *dialOptions) { if n < 2 { n = defaultMaxCallAttempts } o.maxCallAttempts = n }) } func withBufferPool(bufferPool mem.BufferPool) DialOption { return newFuncDialOption(func(o *dialOptions) { o.copts.BufferPool = bufferPool }) } ================================================ FILE: vendor/google.golang.org/grpc/doc.go ================================================ /* * * Copyright 2015 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ //go:generate ./scripts/regenerate.sh /* Package grpc implements an RPC system called gRPC. See grpc.io for more information about gRPC. */ package grpc // import "google.golang.org/grpc" ================================================ FILE: vendor/google.golang.org/grpc/encoding/encoding.go ================================================ /* * * Copyright 2017 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package encoding defines the interface for the compressor and codec, and // functions to register and retrieve compressors and codecs. // // # Experimental // // Notice: This package is EXPERIMENTAL and may be changed or removed in a // later release. package encoding import ( "io" "slices" "strings" "google.golang.org/grpc/encoding/internal" "google.golang.org/grpc/internal/grpcutil" ) // Identity specifies the optional encoding for uncompressed streams. // It is intended for grpc internal use only. const Identity = "identity" func init() { internal.RegisterCompressorForTesting = func(c Compressor) func() { name := c.Name() curCompressor, found := registeredCompressor[name] RegisterCompressor(c) return func() { if found { registeredCompressor[name] = curCompressor return } delete(registeredCompressor, name) grpcutil.RegisteredCompressorNames = slices.DeleteFunc(grpcutil.RegisteredCompressorNames, func(s string) bool { return s == name }) } } } // Compressor is used for compressing and decompressing when sending or // receiving messages. // // If a Compressor implements `DecompressedSize(compressedBytes []byte) int`, // gRPC will invoke it to determine the size of the buffer allocated for the // result of decompression. A return value of -1 indicates unknown size. type Compressor interface { // Compress writes the data written to wc to w after compressing it. If an // error occurs while initializing the compressor, that error is returned // instead. Compress(w io.Writer) (io.WriteCloser, error) // Decompress reads data from r, decompresses it, and provides the // uncompressed data via the returned io.Reader. If an error occurs while // initializing the decompressor, that error is returned instead. Decompress(r io.Reader) (io.Reader, error) // Name is the name of the compression codec and is used to set the content // coding header. The result must be static; the result cannot change // between calls. Name() string } var registeredCompressor = make(map[string]Compressor) // RegisterCompressor registers the compressor with gRPC by its name. It can // be activated when sending an RPC via grpc.UseCompressor(). It will be // automatically accessed when receiving a message based on the content coding // header. Servers also use it to send a response with the same encoding as // the request. // // NOTE: this function must only be called during initialization time (i.e. in // an init() function), and is not thread-safe. If multiple Compressors are // registered with the same name, the one registered last will take effect. func RegisterCompressor(c Compressor) { registeredCompressor[c.Name()] = c if !grpcutil.IsCompressorNameRegistered(c.Name()) { grpcutil.RegisteredCompressorNames = append(grpcutil.RegisteredCompressorNames, c.Name()) } } // GetCompressor returns Compressor for the given compressor name. func GetCompressor(name string) Compressor { return registeredCompressor[name] } // Codec defines the interface gRPC uses to encode and decode messages. Note // that implementations of this interface must be thread safe; a Codec's // methods can be called from concurrent goroutines. type Codec interface { // Marshal returns the wire format of v. Marshal(v any) ([]byte, error) // Unmarshal parses the wire format into v. Unmarshal(data []byte, v any) error // Name returns the name of the Codec implementation. The returned string // will be used as part of content type in transmission. The result must be // static; the result cannot change between calls. Name() string } var registeredCodecs = make(map[string]any) // RegisterCodec registers the provided Codec for use with all gRPC clients and // servers. // // The Codec will be stored and looked up by result of its Name() method, which // should match the content-subtype of the encoding handled by the Codec. This // is case-insensitive, and is stored and looked up as lowercase. If the // result of calling Name() is an empty string, RegisterCodec will panic. See // Content-Type on // https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#requests for // more details. // // NOTE: this function must only be called during initialization time (i.e. in // an init() function), and is not thread-safe. If multiple Codecs are // registered with the same name, the one registered last will take effect. func RegisterCodec(codec Codec) { if codec == nil { panic("cannot register a nil Codec") } if codec.Name() == "" { panic("cannot register Codec with empty string result for Name()") } contentSubtype := strings.ToLower(codec.Name()) registeredCodecs[contentSubtype] = codec } // GetCodec gets a registered Codec by content-subtype, or nil if no Codec is // registered for the content-subtype. // // The content-subtype is expected to be lowercase. func GetCodec(contentSubtype string) Codec { c, _ := registeredCodecs[contentSubtype].(Codec) return c } ================================================ FILE: vendor/google.golang.org/grpc/encoding/encoding_v2.go ================================================ /* * * Copyright 2024 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package encoding import ( "strings" "google.golang.org/grpc/mem" ) // CodecV2 defines the interface gRPC uses to encode and decode messages. Note // that implementations of this interface must be thread safe; a CodecV2's // methods can be called from concurrent goroutines. type CodecV2 interface { // Marshal returns the wire format of v. The buffers in the returned // [mem.BufferSlice] must have at least one reference each, which will be freed // by gRPC when they are no longer needed. Marshal(v any) (out mem.BufferSlice, err error) // Unmarshal parses the wire format into v. Note that data will be freed as soon // as this function returns. If the codec wishes to guarantee access to the data // after this function, it must take its own reference that it frees when it is // no longer needed. Unmarshal(data mem.BufferSlice, v any) error // Name returns the name of the Codec implementation. The returned string // will be used as part of content type in transmission. The result must be // static; the result cannot change between calls. Name() string } // RegisterCodecV2 registers the provided CodecV2 for use with all gRPC clients and // servers. // // The CodecV2 will be stored and looked up by result of its Name() method, which // should match the content-subtype of the encoding handled by the CodecV2. This // is case-insensitive, and is stored and looked up as lowercase. If the // result of calling Name() is an empty string, RegisterCodecV2 will panic. See // Content-Type on // https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#requests for // more details. // // If both a Codec and CodecV2 are registered with the same name, the CodecV2 // will be used. // // NOTE: this function must only be called during initialization time (i.e. in // an init() function), and is not thread-safe. If multiple Codecs are // registered with the same name, the one registered last will take effect. func RegisterCodecV2(codec CodecV2) { if codec == nil { panic("cannot register a nil CodecV2") } if codec.Name() == "" { panic("cannot register CodecV2 with empty string result for Name()") } contentSubtype := strings.ToLower(codec.Name()) registeredCodecs[contentSubtype] = codec } // GetCodecV2 gets a registered CodecV2 by content-subtype, or nil if no CodecV2 is // registered for the content-subtype. // // The content-subtype is expected to be lowercase. func GetCodecV2(contentSubtype string) CodecV2 { c, _ := registeredCodecs[contentSubtype].(CodecV2) return c } ================================================ FILE: vendor/google.golang.org/grpc/encoding/internal/internal.go ================================================ /* * * Copyright 2025 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package internal contains code internal to the encoding package. package internal // RegisterCompressorForTesting registers a compressor in the global compressor // registry. It returns a cleanup function that should be called at the end // of the test to unregister the compressor. // // This prevents compressors registered in one test from appearing in the // encoding headers of subsequent tests. var RegisterCompressorForTesting any // func RegisterCompressor(c Compressor) func() ================================================ FILE: vendor/google.golang.org/grpc/encoding/proto/proto.go ================================================ /* * * Copyright 2024 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package proto defines the protobuf codec. Importing this package will // register the codec. package proto import ( "fmt" "google.golang.org/grpc/encoding" "google.golang.org/grpc/mem" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/protoadapt" ) // Name is the name registered for the proto compressor. const Name = "proto" func init() { encoding.RegisterCodecV2(&codecV2{}) } // codec is a CodecV2 implementation with protobuf. It is the default codec for // gRPC. type codecV2 struct{} func (c *codecV2) Marshal(v any) (data mem.BufferSlice, err error) { vv := messageV2Of(v) if vv == nil { return nil, fmt.Errorf("proto: failed to marshal, message is %T, want proto.Message", v) } // Important: if we remove this Size call then we cannot use // UseCachedSize in MarshalOptions below. size := proto.Size(vv) // MarshalOptions with UseCachedSize allows reusing the result from the // previous Size call. This is safe here because: // // 1. We just computed the size. // 2. We assume the message is not being mutated concurrently. // // Important: If the proto.Size call above is removed, using UseCachedSize // becomes unsafe and may lead to incorrect marshaling. // // For more details, see the doc of UseCachedSize: // https://pkg.go.dev/google.golang.org/protobuf/proto#MarshalOptions marshalOptions := proto.MarshalOptions{UseCachedSize: true} if mem.IsBelowBufferPoolingThreshold(size) { buf, err := marshalOptions.Marshal(vv) if err != nil { return nil, err } data = append(data, mem.SliceBuffer(buf)) } else { pool := mem.DefaultBufferPool() buf := pool.Get(size) if _, err := marshalOptions.MarshalAppend((*buf)[:0], vv); err != nil { pool.Put(buf) return nil, err } data = append(data, mem.NewBuffer(buf, pool)) } return data, nil } func (c *codecV2) Unmarshal(data mem.BufferSlice, v any) (err error) { vv := messageV2Of(v) if vv == nil { return fmt.Errorf("failed to unmarshal, message is %T, want proto.Message", v) } buf := data.MaterializeToBuffer(mem.DefaultBufferPool()) defer buf.Free() // TODO: Upgrade proto.Unmarshal to support mem.BufferSlice. Right now, it's not // really possible without a major overhaul of the proto package, but the // vtprotobuf library may be able to support this. return proto.Unmarshal(buf.ReadOnlyData(), vv) } func messageV2Of(v any) proto.Message { switch v := v.(type) { case protoadapt.MessageV1: return protoadapt.MessageV2Of(v) case protoadapt.MessageV2: return v } return nil } func (c *codecV2) Name() string { return Name } ================================================ FILE: vendor/google.golang.org/grpc/experimental/stats/metricregistry.go ================================================ /* * * Copyright 2024 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package stats import ( "maps" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/internal" "google.golang.org/grpc/stats" ) func init() { internal.SnapshotMetricRegistryForTesting = snapshotMetricsRegistryForTesting } var logger = grpclog.Component("metrics-registry") // DefaultMetrics are the default metrics registered through global metrics // registry. This is written to at initialization time only, and is read only // after initialization. var DefaultMetrics = stats.NewMetricSet() // MetricDescriptor is the data for a registered metric. type MetricDescriptor struct { // The name of this metric. This name must be unique across the whole binary // (including any per call metrics). See // https://github.com/grpc/proposal/blob/master/A79-non-per-call-metrics-architecture.md#metric-instrument-naming-conventions // for metric naming conventions. Name string // The description of this metric. Description string // The unit (e.g. entries, seconds) of this metric. Unit string // The required label keys for this metric. These are intended to // metrics emitted from a stats handler. Labels []string // The optional label keys for this metric. These are intended to attached // to metrics emitted from a stats handler if configured. OptionalLabels []string // Whether this metric is on by default. Default bool // The type of metric. This is set by the metric registry, and not intended // to be set by a component registering a metric. Type MetricType // Bounds are the bounds of this metric. This only applies to histogram // metrics. If unset or set with length 0, stats handlers will fall back to // default bounds. Bounds []float64 } // MetricType is the type of metric. type MetricType int // Type of metric supported by this instrument registry. const ( MetricTypeIntCount MetricType = iota MetricTypeFloatCount MetricTypeIntHisto MetricTypeFloatHisto MetricTypeIntGauge MetricTypeIntUpDownCount MetricTypeIntAsyncGauge ) // Int64CountHandle is a typed handle for a int count metric. This handle // is passed at the recording point in order to know which metric to record // on. type Int64CountHandle MetricDescriptor // Descriptor returns the int64 count handle typecast to a pointer to a // MetricDescriptor. func (h *Int64CountHandle) Descriptor() *MetricDescriptor { return (*MetricDescriptor)(h) } // Record records the int64 count value on the metrics recorder provided. func (h *Int64CountHandle) Record(recorder MetricsRecorder, incr int64, labels ...string) { recorder.RecordInt64Count(h, incr, labels...) } // Int64UpDownCountHandle is a typed handle for an int up-down counter metric. // This handle is passed at the recording point in order to know which metric // to record on. type Int64UpDownCountHandle MetricDescriptor // Descriptor returns the int64 up-down counter handle typecast to a pointer to a // MetricDescriptor. func (h *Int64UpDownCountHandle) Descriptor() *MetricDescriptor { return (*MetricDescriptor)(h) } // Record records the int64 up-down counter value on the metrics recorder provided. // The value 'v' can be positive to increment or negative to decrement. func (h *Int64UpDownCountHandle) Record(recorder MetricsRecorder, v int64, labels ...string) { recorder.RecordInt64UpDownCount(h, v, labels...) } // Float64CountHandle is a typed handle for a float count metric. This handle is // passed at the recording point in order to know which metric to record on. type Float64CountHandle MetricDescriptor // Descriptor returns the float64 count handle typecast to a pointer to a // MetricDescriptor. func (h *Float64CountHandle) Descriptor() *MetricDescriptor { return (*MetricDescriptor)(h) } // Record records the float64 count value on the metrics recorder provided. func (h *Float64CountHandle) Record(recorder MetricsRecorder, incr float64, labels ...string) { recorder.RecordFloat64Count(h, incr, labels...) } // Int64HistoHandle is a typed handle for an int histogram metric. This handle // is passed at the recording point in order to know which metric to record on. type Int64HistoHandle MetricDescriptor // Descriptor returns the int64 histo handle typecast to a pointer to a // MetricDescriptor. func (h *Int64HistoHandle) Descriptor() *MetricDescriptor { return (*MetricDescriptor)(h) } // Record records the int64 histo value on the metrics recorder provided. func (h *Int64HistoHandle) Record(recorder MetricsRecorder, incr int64, labels ...string) { recorder.RecordInt64Histo(h, incr, labels...) } // Float64HistoHandle is a typed handle for a float histogram metric. This // handle is passed at the recording point in order to know which metric to // record on. type Float64HistoHandle MetricDescriptor // Descriptor returns the float64 histo handle typecast to a pointer to a // MetricDescriptor. func (h *Float64HistoHandle) Descriptor() *MetricDescriptor { return (*MetricDescriptor)(h) } // Record records the float64 histo value on the metrics recorder provided. func (h *Float64HistoHandle) Record(recorder MetricsRecorder, incr float64, labels ...string) { recorder.RecordFloat64Histo(h, incr, labels...) } // Int64GaugeHandle is a typed handle for an int gauge metric. This handle is // passed at the recording point in order to know which metric to record on. type Int64GaugeHandle MetricDescriptor // Descriptor returns the int64 gauge handle typecast to a pointer to a // MetricDescriptor. func (h *Int64GaugeHandle) Descriptor() *MetricDescriptor { return (*MetricDescriptor)(h) } // Record records the int64 histo value on the metrics recorder provided. func (h *Int64GaugeHandle) Record(recorder MetricsRecorder, incr int64, labels ...string) { recorder.RecordInt64Gauge(h, incr, labels...) } // AsyncMetric is a marker interface for asynchronous metric types. type AsyncMetric interface { isAsync() Descriptor() *MetricDescriptor } // Int64AsyncGaugeHandle is a typed handle for an int gauge metric. This handle is // passed at the recording point in order to know which metric to record on. type Int64AsyncGaugeHandle MetricDescriptor // isAsync implements the AsyncMetric interface. func (h *Int64AsyncGaugeHandle) isAsync() {} // Descriptor returns the int64 gauge handle typecast to a pointer to a // MetricDescriptor. func (h *Int64AsyncGaugeHandle) Descriptor() *MetricDescriptor { return (*MetricDescriptor)(h) } // Record records the int64 gauge value on the metrics recorder provided. func (h *Int64AsyncGaugeHandle) Record(recorder AsyncMetricsRecorder, value int64, labels ...string) { recorder.RecordInt64AsyncGauge(h, value, labels...) } // registeredMetrics are the registered metric descriptor names. var registeredMetrics = make(map[string]bool) // metricsRegistry contains all of the registered metrics. // // This is written to only at init time, and read only after that. var metricsRegistry = make(map[string]*MetricDescriptor) // DescriptorForMetric returns the MetricDescriptor from the global registry. // // Returns nil if MetricDescriptor not present. func DescriptorForMetric(metricName string) *MetricDescriptor { return metricsRegistry[metricName] } func registerMetric(metricName string, def bool) { if registeredMetrics[metricName] { logger.Fatalf("metric %v already registered", metricName) } registeredMetrics[metricName] = true if def { DefaultMetrics = DefaultMetrics.Add(metricName) } } // RegisterInt64Count registers the metric description onto the global registry. // It returns a typed handle to use to recording data. // // NOTE: this function must only be called during initialization time (i.e. in // an init() function), and is not thread-safe. If multiple metrics are // registered with the same name, this function will panic. func RegisterInt64Count(descriptor MetricDescriptor) *Int64CountHandle { registerMetric(descriptor.Name, descriptor.Default) descriptor.Type = MetricTypeIntCount descPtr := &descriptor metricsRegistry[descriptor.Name] = descPtr return (*Int64CountHandle)(descPtr) } // RegisterFloat64Count registers the metric description onto the global // registry. It returns a typed handle to use to recording data. // // NOTE: this function must only be called during initialization time (i.e. in // an init() function), and is not thread-safe. If multiple metrics are // registered with the same name, this function will panic. func RegisterFloat64Count(descriptor MetricDescriptor) *Float64CountHandle { registerMetric(descriptor.Name, descriptor.Default) descriptor.Type = MetricTypeFloatCount descPtr := &descriptor metricsRegistry[descriptor.Name] = descPtr return (*Float64CountHandle)(descPtr) } // RegisterInt64Histo registers the metric description onto the global registry. // It returns a typed handle to use to recording data. // // NOTE: this function must only be called during initialization time (i.e. in // an init() function), and is not thread-safe. If multiple metrics are // registered with the same name, this function will panic. func RegisterInt64Histo(descriptor MetricDescriptor) *Int64HistoHandle { registerMetric(descriptor.Name, descriptor.Default) descriptor.Type = MetricTypeIntHisto descPtr := &descriptor metricsRegistry[descriptor.Name] = descPtr return (*Int64HistoHandle)(descPtr) } // RegisterFloat64Histo registers the metric description onto the global // registry. It returns a typed handle to use to recording data. // // NOTE: this function must only be called during initialization time (i.e. in // an init() function), and is not thread-safe. If multiple metrics are // registered with the same name, this function will panic. func RegisterFloat64Histo(descriptor MetricDescriptor) *Float64HistoHandle { registerMetric(descriptor.Name, descriptor.Default) descriptor.Type = MetricTypeFloatHisto descPtr := &descriptor metricsRegistry[descriptor.Name] = descPtr return (*Float64HistoHandle)(descPtr) } // RegisterInt64Gauge registers the metric description onto the global registry. // It returns a typed handle to use to recording data. // // NOTE: this function must only be called during initialization time (i.e. in // an init() function), and is not thread-safe. If multiple metrics are // registered with the same name, this function will panic. func RegisterInt64Gauge(descriptor MetricDescriptor) *Int64GaugeHandle { registerMetric(descriptor.Name, descriptor.Default) descriptor.Type = MetricTypeIntGauge descPtr := &descriptor metricsRegistry[descriptor.Name] = descPtr return (*Int64GaugeHandle)(descPtr) } // RegisterInt64UpDownCount registers the metric description onto the global registry. // It returns a typed handle to use for recording data. // // NOTE: this function must only be called during initialization time (i.e. in // an init() function), and is not thread-safe. If multiple metrics are // registered with the same name, this function will panic. func RegisterInt64UpDownCount(descriptor MetricDescriptor) *Int64UpDownCountHandle { registerMetric(descriptor.Name, descriptor.Default) // Set the specific metric type for the up-down counter descriptor.Type = MetricTypeIntUpDownCount descPtr := &descriptor metricsRegistry[descriptor.Name] = descPtr return (*Int64UpDownCountHandle)(descPtr) } // RegisterInt64AsyncGauge registers the metric description onto the global registry. // It returns a typed handle to use for recording data. // // NOTE: this function must only be called during initialization time (i.e. in // an init() function), and is not thread-safe. If multiple metrics are // registered with the same name, this function will panic. func RegisterInt64AsyncGauge(descriptor MetricDescriptor) *Int64AsyncGaugeHandle { registerMetric(descriptor.Name, descriptor.Default) descriptor.Type = MetricTypeIntAsyncGauge descPtr := &descriptor metricsRegistry[descriptor.Name] = descPtr return (*Int64AsyncGaugeHandle)(descPtr) } // snapshotMetricsRegistryForTesting snapshots the global data of the metrics // registry. Returns a cleanup function that sets the metrics registry to its // original state. func snapshotMetricsRegistryForTesting() func() { oldDefaultMetrics := DefaultMetrics oldRegisteredMetrics := registeredMetrics oldMetricsRegistry := metricsRegistry registeredMetrics = make(map[string]bool) metricsRegistry = make(map[string]*MetricDescriptor) maps.Copy(registeredMetrics, registeredMetrics) maps.Copy(metricsRegistry, metricsRegistry) return func() { DefaultMetrics = oldDefaultMetrics registeredMetrics = oldRegisteredMetrics metricsRegistry = oldMetricsRegistry } } ================================================ FILE: vendor/google.golang.org/grpc/experimental/stats/metrics.go ================================================ /* * * Copyright 2024 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package stats contains experimental metrics/stats API's. package stats import "google.golang.org/grpc/stats" // MetricsRecorder records on metrics derived from metric registry. type MetricsRecorder interface { // RecordInt64Count records the measurement alongside labels on the int // count associated with the provided handle. RecordInt64Count(handle *Int64CountHandle, incr int64, labels ...string) // RecordFloat64Count records the measurement alongside labels on the float // count associated with the provided handle. RecordFloat64Count(handle *Float64CountHandle, incr float64, labels ...string) // RecordInt64Histo records the measurement alongside labels on the int // histo associated with the provided handle. RecordInt64Histo(handle *Int64HistoHandle, incr int64, labels ...string) // RecordFloat64Histo records the measurement alongside labels on the float // histo associated with the provided handle. RecordFloat64Histo(handle *Float64HistoHandle, incr float64, labels ...string) // RecordInt64Gauge records the measurement alongside labels on the int // gauge associated with the provided handle. RecordInt64Gauge(handle *Int64GaugeHandle, incr int64, labels ...string) // RecordInt64UpDownCounter records the measurement alongside labels on the int // count associated with the provided handle. RecordInt64UpDownCount(handle *Int64UpDownCountHandle, incr int64, labels ...string) } // AsyncMetricsRecorder records on asynchronous metrics derived from metric registry. type AsyncMetricsRecorder interface { // RecordInt64AsyncGauge records the measurement alongside labels on the int // count associated with the provided handle asynchronously RecordInt64AsyncGauge(handle *Int64AsyncGaugeHandle, incr int64, labels ...string) } // Metrics is an experimental legacy alias of the now-stable stats.MetricSet. // Metrics will be deleted in a future release. type Metrics = stats.MetricSet // Metric was replaced by direct usage of strings. type Metric = string // NewMetrics is an experimental legacy alias of the now-stable // stats.NewMetricSet. NewMetrics will be deleted in a future release. func NewMetrics(metrics ...Metric) *Metrics { return stats.NewMetricSet(metrics...) } ================================================ FILE: vendor/google.golang.org/grpc/grpclog/component.go ================================================ /* * * Copyright 2020 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package grpclog import ( "fmt" ) // componentData records the settings for a component. type componentData struct { name string } var cache = map[string]*componentData{} func (c *componentData) InfoDepth(depth int, args ...any) { args = append([]any{"[" + string(c.name) + "]"}, args...) InfoDepth(depth+1, args...) } func (c *componentData) WarningDepth(depth int, args ...any) { args = append([]any{"[" + string(c.name) + "]"}, args...) WarningDepth(depth+1, args...) } func (c *componentData) ErrorDepth(depth int, args ...any) { args = append([]any{"[" + string(c.name) + "]"}, args...) ErrorDepth(depth+1, args...) } func (c *componentData) FatalDepth(depth int, args ...any) { args = append([]any{"[" + string(c.name) + "]"}, args...) FatalDepth(depth+1, args...) } func (c *componentData) Info(args ...any) { c.InfoDepth(1, args...) } func (c *componentData) Warning(args ...any) { c.WarningDepth(1, args...) } func (c *componentData) Error(args ...any) { c.ErrorDepth(1, args...) } func (c *componentData) Fatal(args ...any) { c.FatalDepth(1, args...) } func (c *componentData) Infof(format string, args ...any) { c.InfoDepth(1, fmt.Sprintf(format, args...)) } func (c *componentData) Warningf(format string, args ...any) { c.WarningDepth(1, fmt.Sprintf(format, args...)) } func (c *componentData) Errorf(format string, args ...any) { c.ErrorDepth(1, fmt.Sprintf(format, args...)) } func (c *componentData) Fatalf(format string, args ...any) { c.FatalDepth(1, fmt.Sprintf(format, args...)) } func (c *componentData) Infoln(args ...any) { c.InfoDepth(1, args...) } func (c *componentData) Warningln(args ...any) { c.WarningDepth(1, args...) } func (c *componentData) Errorln(args ...any) { c.ErrorDepth(1, args...) } func (c *componentData) Fatalln(args ...any) { c.FatalDepth(1, args...) } func (c *componentData) V(l int) bool { return V(l) } // Component creates a new component and returns it for logging. If a component // with the name already exists, nothing will be created and it will be // returned. SetLoggerV2 will panic if it is called with a logger created by // Component. func Component(componentName string) DepthLoggerV2 { if cData, ok := cache[componentName]; ok { return cData } c := &componentData{componentName} cache[componentName] = c return c } ================================================ FILE: vendor/google.golang.org/grpc/grpclog/grpclog.go ================================================ /* * * Copyright 2017 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package grpclog defines logging for grpc. // // In the default logger, severity level can be set by environment variable // GRPC_GO_LOG_SEVERITY_LEVEL, verbosity level can be set by // GRPC_GO_LOG_VERBOSITY_LEVEL. package grpclog import ( "os" "google.golang.org/grpc/grpclog/internal" ) func init() { SetLoggerV2(newLoggerV2()) } // V reports whether verbosity level l is at least the requested verbose level. func V(l int) bool { return internal.LoggerV2Impl.V(l) } // Info logs to the INFO log. func Info(args ...any) { internal.LoggerV2Impl.Info(args...) } // Infof logs to the INFO log. Arguments are handled in the manner of fmt.Printf. func Infof(format string, args ...any) { internal.LoggerV2Impl.Infof(format, args...) } // Infoln logs to the INFO log. Arguments are handled in the manner of fmt.Println. func Infoln(args ...any) { internal.LoggerV2Impl.Infoln(args...) } // Warning logs to the WARNING log. func Warning(args ...any) { internal.LoggerV2Impl.Warning(args...) } // Warningf logs to the WARNING log. Arguments are handled in the manner of fmt.Printf. func Warningf(format string, args ...any) { internal.LoggerV2Impl.Warningf(format, args...) } // Warningln logs to the WARNING log. Arguments are handled in the manner of fmt.Println. func Warningln(args ...any) { internal.LoggerV2Impl.Warningln(args...) } // Error logs to the ERROR log. func Error(args ...any) { internal.LoggerV2Impl.Error(args...) } // Errorf logs to the ERROR log. Arguments are handled in the manner of fmt.Printf. func Errorf(format string, args ...any) { internal.LoggerV2Impl.Errorf(format, args...) } // Errorln logs to the ERROR log. Arguments are handled in the manner of fmt.Println. func Errorln(args ...any) { internal.LoggerV2Impl.Errorln(args...) } // Fatal logs to the FATAL log. Arguments are handled in the manner of fmt.Print. // It calls os.Exit() with exit code 1. func Fatal(args ...any) { internal.LoggerV2Impl.Fatal(args...) // Make sure fatal logs will exit. os.Exit(1) } // Fatalf logs to the FATAL log. Arguments are handled in the manner of fmt.Printf. // It calls os.Exit() with exit code 1. func Fatalf(format string, args ...any) { internal.LoggerV2Impl.Fatalf(format, args...) // Make sure fatal logs will exit. os.Exit(1) } // Fatalln logs to the FATAL log. Arguments are handled in the manner of fmt.Println. // It calls os.Exit() with exit code 1. func Fatalln(args ...any) { internal.LoggerV2Impl.Fatalln(args...) // Make sure fatal logs will exit. os.Exit(1) } // Print prints to the logger. Arguments are handled in the manner of fmt.Print. // // Deprecated: use Info. func Print(args ...any) { internal.LoggerV2Impl.Info(args...) } // Printf prints to the logger. Arguments are handled in the manner of fmt.Printf. // // Deprecated: use Infof. func Printf(format string, args ...any) { internal.LoggerV2Impl.Infof(format, args...) } // Println prints to the logger. Arguments are handled in the manner of fmt.Println. // // Deprecated: use Infoln. func Println(args ...any) { internal.LoggerV2Impl.Infoln(args...) } // InfoDepth logs to the INFO log at the specified depth. // // # Experimental // // Notice: This API is EXPERIMENTAL and may be changed or removed in a // later release. func InfoDepth(depth int, args ...any) { if internal.DepthLoggerV2Impl != nil { internal.DepthLoggerV2Impl.InfoDepth(depth, args...) } else { internal.LoggerV2Impl.Infoln(args...) } } // WarningDepth logs to the WARNING log at the specified depth. // // # Experimental // // Notice: This API is EXPERIMENTAL and may be changed or removed in a // later release. func WarningDepth(depth int, args ...any) { if internal.DepthLoggerV2Impl != nil { internal.DepthLoggerV2Impl.WarningDepth(depth, args...) } else { internal.LoggerV2Impl.Warningln(args...) } } // ErrorDepth logs to the ERROR log at the specified depth. // // # Experimental // // Notice: This API is EXPERIMENTAL and may be changed or removed in a // later release. func ErrorDepth(depth int, args ...any) { if internal.DepthLoggerV2Impl != nil { internal.DepthLoggerV2Impl.ErrorDepth(depth, args...) } else { internal.LoggerV2Impl.Errorln(args...) } } // FatalDepth logs to the FATAL log at the specified depth. // // # Experimental // // Notice: This API is EXPERIMENTAL and may be changed or removed in a // later release. func FatalDepth(depth int, args ...any) { if internal.DepthLoggerV2Impl != nil { internal.DepthLoggerV2Impl.FatalDepth(depth, args...) } else { internal.LoggerV2Impl.Fatalln(args...) } os.Exit(1) } ================================================ FILE: vendor/google.golang.org/grpc/grpclog/internal/grpclog.go ================================================ /* * * Copyright 2024 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package internal contains functionality internal to the grpclog package. package internal // LoggerV2Impl is the logger used for the non-depth log functions. var LoggerV2Impl LoggerV2 // DepthLoggerV2Impl is the logger used for the depth log functions. var DepthLoggerV2Impl DepthLoggerV2 ================================================ FILE: vendor/google.golang.org/grpc/grpclog/internal/logger.go ================================================ /* * * Copyright 2024 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package internal // Logger mimics golang's standard Logger as an interface. // // Deprecated: use LoggerV2. type Logger interface { Fatal(args ...any) Fatalf(format string, args ...any) Fatalln(args ...any) Print(args ...any) Printf(format string, args ...any) Println(args ...any) } // LoggerWrapper wraps Logger into a LoggerV2. type LoggerWrapper struct { Logger } // Info logs to INFO log. Arguments are handled in the manner of fmt.Print. func (l *LoggerWrapper) Info(args ...any) { l.Logger.Print(args...) } // Infoln logs to INFO log. Arguments are handled in the manner of fmt.Println. func (l *LoggerWrapper) Infoln(args ...any) { l.Logger.Println(args...) } // Infof logs to INFO log. Arguments are handled in the manner of fmt.Printf. func (l *LoggerWrapper) Infof(format string, args ...any) { l.Logger.Printf(format, args...) } // Warning logs to WARNING log. Arguments are handled in the manner of fmt.Print. func (l *LoggerWrapper) Warning(args ...any) { l.Logger.Print(args...) } // Warningln logs to WARNING log. Arguments are handled in the manner of fmt.Println. func (l *LoggerWrapper) Warningln(args ...any) { l.Logger.Println(args...) } // Warningf logs to WARNING log. Arguments are handled in the manner of fmt.Printf. func (l *LoggerWrapper) Warningf(format string, args ...any) { l.Logger.Printf(format, args...) } // Error logs to ERROR log. Arguments are handled in the manner of fmt.Print. func (l *LoggerWrapper) Error(args ...any) { l.Logger.Print(args...) } // Errorln logs to ERROR log. Arguments are handled in the manner of fmt.Println. func (l *LoggerWrapper) Errorln(args ...any) { l.Logger.Println(args...) } // Errorf logs to ERROR log. Arguments are handled in the manner of fmt.Printf. func (l *LoggerWrapper) Errorf(format string, args ...any) { l.Logger.Printf(format, args...) } // V reports whether verbosity level l is at least the requested verbose level. func (*LoggerWrapper) V(int) bool { // Returns true for all verbose level. return true } ================================================ FILE: vendor/google.golang.org/grpc/grpclog/internal/loggerv2.go ================================================ /* * * Copyright 2024 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package internal import ( "encoding/json" "fmt" "io" "log" "os" ) // LoggerV2 does underlying logging work for grpclog. type LoggerV2 interface { // Info logs to INFO log. Arguments are handled in the manner of fmt.Print. Info(args ...any) // Infoln logs to INFO log. Arguments are handled in the manner of fmt.Println. Infoln(args ...any) // Infof logs to INFO log. Arguments are handled in the manner of fmt.Printf. Infof(format string, args ...any) // Warning logs to WARNING log. Arguments are handled in the manner of fmt.Print. Warning(args ...any) // Warningln logs to WARNING log. Arguments are handled in the manner of fmt.Println. Warningln(args ...any) // Warningf logs to WARNING log. Arguments are handled in the manner of fmt.Printf. Warningf(format string, args ...any) // Error logs to ERROR log. Arguments are handled in the manner of fmt.Print. Error(args ...any) // Errorln logs to ERROR log. Arguments are handled in the manner of fmt.Println. Errorln(args ...any) // Errorf logs to ERROR log. Arguments are handled in the manner of fmt.Printf. Errorf(format string, args ...any) // Fatal logs to ERROR log. Arguments are handled in the manner of fmt.Print. // gRPC ensures that all Fatal logs will exit with os.Exit(1). // Implementations may also call os.Exit() with a non-zero exit code. Fatal(args ...any) // Fatalln logs to ERROR log. Arguments are handled in the manner of fmt.Println. // gRPC ensures that all Fatal logs will exit with os.Exit(1). // Implementations may also call os.Exit() with a non-zero exit code. Fatalln(args ...any) // Fatalf logs to ERROR log. Arguments are handled in the manner of fmt.Printf. // gRPC ensures that all Fatal logs will exit with os.Exit(1). // Implementations may also call os.Exit() with a non-zero exit code. Fatalf(format string, args ...any) // V reports whether verbosity level l is at least the requested verbose level. V(l int) bool } // DepthLoggerV2 logs at a specified call frame. If a LoggerV2 also implements // DepthLoggerV2, the below functions will be called with the appropriate stack // depth set for trivial functions the logger may ignore. // // # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. type DepthLoggerV2 interface { LoggerV2 // InfoDepth logs to INFO log at the specified depth. Arguments are handled in the manner of fmt.Println. InfoDepth(depth int, args ...any) // WarningDepth logs to WARNING log at the specified depth. Arguments are handled in the manner of fmt.Println. WarningDepth(depth int, args ...any) // ErrorDepth logs to ERROR log at the specified depth. Arguments are handled in the manner of fmt.Println. ErrorDepth(depth int, args ...any) // FatalDepth logs to FATAL log at the specified depth. Arguments are handled in the manner of fmt.Println. FatalDepth(depth int, args ...any) } const ( // infoLog indicates Info severity. infoLog int = iota // warningLog indicates Warning severity. warningLog // errorLog indicates Error severity. errorLog // fatalLog indicates Fatal severity. fatalLog ) // severityName contains the string representation of each severity. var severityName = []string{ infoLog: "INFO", warningLog: "WARNING", errorLog: "ERROR", fatalLog: "FATAL", } // sprintf is fmt.Sprintf. // These vars exist to make it possible to test that expensive format calls aren't made unnecessarily. var sprintf = fmt.Sprintf // sprint is fmt.Sprint. // These vars exist to make it possible to test that expensive format calls aren't made unnecessarily. var sprint = fmt.Sprint // sprintln is fmt.Sprintln. // These vars exist to make it possible to test that expensive format calls aren't made unnecessarily. var sprintln = fmt.Sprintln // exit is os.Exit. // This var exists to make it possible to test functions calling os.Exit. var exit = os.Exit // loggerT is the default logger used by grpclog. type loggerT struct { m []*log.Logger v int jsonFormat bool } func (g *loggerT) output(severity int, s string) { sevStr := severityName[severity] if !g.jsonFormat { g.m[severity].Output(2, sevStr+": "+s) return } // TODO: we can also include the logging component, but that needs more // (API) changes. b, _ := json.Marshal(map[string]string{ "severity": sevStr, "message": s, }) g.m[severity].Output(2, string(b)) } func (g *loggerT) printf(severity int, format string, args ...any) { // Note the discard check is duplicated in each print func, rather than in // output, to avoid the expensive Sprint calls. // De-duplicating this by moving to output would be a significant performance regression! if lg := g.m[severity]; lg.Writer() == io.Discard { return } g.output(severity, sprintf(format, args...)) } func (g *loggerT) print(severity int, v ...any) { if lg := g.m[severity]; lg.Writer() == io.Discard { return } g.output(severity, sprint(v...)) } func (g *loggerT) println(severity int, v ...any) { if lg := g.m[severity]; lg.Writer() == io.Discard { return } g.output(severity, sprintln(v...)) } func (g *loggerT) Info(args ...any) { g.print(infoLog, args...) } func (g *loggerT) Infoln(args ...any) { g.println(infoLog, args...) } func (g *loggerT) Infof(format string, args ...any) { g.printf(infoLog, format, args...) } func (g *loggerT) Warning(args ...any) { g.print(warningLog, args...) } func (g *loggerT) Warningln(args ...any) { g.println(warningLog, args...) } func (g *loggerT) Warningf(format string, args ...any) { g.printf(warningLog, format, args...) } func (g *loggerT) Error(args ...any) { g.print(errorLog, args...) } func (g *loggerT) Errorln(args ...any) { g.println(errorLog, args...) } func (g *loggerT) Errorf(format string, args ...any) { g.printf(errorLog, format, args...) } func (g *loggerT) Fatal(args ...any) { g.print(fatalLog, args...) exit(1) } func (g *loggerT) Fatalln(args ...any) { g.println(fatalLog, args...) exit(1) } func (g *loggerT) Fatalf(format string, args ...any) { g.printf(fatalLog, format, args...) exit(1) } func (g *loggerT) V(l int) bool { return l <= g.v } // LoggerV2Config configures the LoggerV2 implementation. type LoggerV2Config struct { // Verbosity sets the verbosity level of the logger. Verbosity int // FormatJSON controls whether the logger should output logs in JSON format. FormatJSON bool } // combineLoggers returns a combined logger for both higher & lower severity logs, // or only one if the other is io.Discard. // // This uses io.Discard instead of io.MultiWriter when all loggers // are set to io.Discard. Both this package and the standard log package have // significant optimizations for io.Discard, which io.MultiWriter lacks (as of // this writing). func combineLoggers(lower, higher io.Writer) io.Writer { if lower == io.Discard { return higher } if higher == io.Discard { return lower } return io.MultiWriter(lower, higher) } // NewLoggerV2 creates a new LoggerV2 instance with the provided configuration. // The infoW, warningW, and errorW writers are used to write log messages of // different severity levels. func NewLoggerV2(infoW, warningW, errorW io.Writer, c LoggerV2Config) LoggerV2 { flag := log.LstdFlags if c.FormatJSON { flag = 0 } warningW = combineLoggers(infoW, warningW) errorW = combineLoggers(errorW, warningW) fatalW := errorW m := []*log.Logger{ log.New(infoW, "", flag), log.New(warningW, "", flag), log.New(errorW, "", flag), log.New(fatalW, "", flag), } return &loggerT{m: m, v: c.Verbosity, jsonFormat: c.FormatJSON} } ================================================ FILE: vendor/google.golang.org/grpc/grpclog/logger.go ================================================ /* * * Copyright 2015 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package grpclog import "google.golang.org/grpc/grpclog/internal" // Logger mimics golang's standard Logger as an interface. // // Deprecated: use LoggerV2. type Logger internal.Logger // SetLogger sets the logger that is used in grpc. Call only from // init() functions. // // Deprecated: use SetLoggerV2. func SetLogger(l Logger) { internal.LoggerV2Impl = &internal.LoggerWrapper{Logger: l} } ================================================ FILE: vendor/google.golang.org/grpc/grpclog/loggerv2.go ================================================ /* * * Copyright 2017 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package grpclog import ( "io" "os" "strconv" "strings" "google.golang.org/grpc/grpclog/internal" ) // LoggerV2 does underlying logging work for grpclog. type LoggerV2 internal.LoggerV2 // SetLoggerV2 sets logger that is used in grpc to a V2 logger. // Not mutex-protected, should be called before any gRPC functions. func SetLoggerV2(l LoggerV2) { if _, ok := l.(*componentData); ok { panic("cannot use component logger as grpclog logger") } internal.LoggerV2Impl = l internal.DepthLoggerV2Impl, _ = l.(internal.DepthLoggerV2) } // NewLoggerV2 creates a loggerV2 with the provided writers. // Fatal logs will be written to errorW, warningW, infoW, followed by exit(1). // Error logs will be written to errorW, warningW and infoW. // Warning logs will be written to warningW and infoW. // Info logs will be written to infoW. func NewLoggerV2(infoW, warningW, errorW io.Writer) LoggerV2 { return internal.NewLoggerV2(infoW, warningW, errorW, internal.LoggerV2Config{}) } // NewLoggerV2WithVerbosity creates a loggerV2 with the provided writers and // verbosity level. func NewLoggerV2WithVerbosity(infoW, warningW, errorW io.Writer, v int) LoggerV2 { return internal.NewLoggerV2(infoW, warningW, errorW, internal.LoggerV2Config{Verbosity: v}) } // newLoggerV2 creates a loggerV2 to be used as default logger. // All logs are written to stderr. func newLoggerV2() LoggerV2 { errorW := io.Discard warningW := io.Discard infoW := io.Discard logLevel := os.Getenv("GRPC_GO_LOG_SEVERITY_LEVEL") switch logLevel { case "", "ERROR", "error": // If env is unset, set level to ERROR. errorW = os.Stderr case "WARNING", "warning": warningW = os.Stderr case "INFO", "info": infoW = os.Stderr } var v int vLevel := os.Getenv("GRPC_GO_LOG_VERBOSITY_LEVEL") if vl, err := strconv.Atoi(vLevel); err == nil { v = vl } jsonFormat := strings.EqualFold(os.Getenv("GRPC_GO_LOG_FORMATTER"), "json") return internal.NewLoggerV2(infoW, warningW, errorW, internal.LoggerV2Config{ Verbosity: v, FormatJSON: jsonFormat, }) } // DepthLoggerV2 logs at a specified call frame. If a LoggerV2 also implements // DepthLoggerV2, the below functions will be called with the appropriate stack // depth set for trivial functions the logger may ignore. // // # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. type DepthLoggerV2 internal.DepthLoggerV2 ================================================ FILE: vendor/google.golang.org/grpc/interceptor.go ================================================ /* * * Copyright 2016 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package grpc import ( "context" ) // UnaryInvoker is called by UnaryClientInterceptor to complete RPCs. type UnaryInvoker func(ctx context.Context, method string, req, reply any, cc *ClientConn, opts ...CallOption) error // UnaryClientInterceptor intercepts the execution of a unary RPC on the client. // Unary interceptors can be specified as a DialOption, using // WithUnaryInterceptor() or WithChainUnaryInterceptor(), when creating a // ClientConn. When a unary interceptor(s) is set on a ClientConn, gRPC // delegates all unary RPC invocations to the interceptor, and it is the // responsibility of the interceptor to call invoker to complete the processing // of the RPC. // // method is the RPC name. req and reply are the corresponding request and // response messages. cc is the ClientConn on which the RPC was invoked. invoker // is the handler to complete the RPC and it is the responsibility of the // interceptor to call it. opts contain all applicable call options, including // defaults from the ClientConn as well as per-call options. // // The returned error must be compatible with the status package. type UnaryClientInterceptor func(ctx context.Context, method string, req, reply any, cc *ClientConn, invoker UnaryInvoker, opts ...CallOption) error // Streamer is called by StreamClientInterceptor to create a ClientStream. type Streamer func(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, opts ...CallOption) (ClientStream, error) // StreamClientInterceptor intercepts the creation of a ClientStream. Stream // interceptors can be specified as a DialOption, using WithStreamInterceptor() // or WithChainStreamInterceptor(), when creating a ClientConn. When a stream // interceptor(s) is set on the ClientConn, gRPC delegates all stream creations // to the interceptor, and it is the responsibility of the interceptor to call // streamer. // // desc contains a description of the stream. cc is the ClientConn on which the // RPC was invoked. streamer is the handler to create a ClientStream and it is // the responsibility of the interceptor to call it. opts contain all applicable // call options, including defaults from the ClientConn as well as per-call // options. // // StreamClientInterceptor may return a custom ClientStream to intercept all I/O // operations. The returned error must be compatible with the status package. type StreamClientInterceptor func(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, streamer Streamer, opts ...CallOption) (ClientStream, error) // UnaryServerInfo consists of various information about a unary RPC on // server side. All per-rpc information may be mutated by the interceptor. type UnaryServerInfo struct { // Server is the service implementation the user provides. This is read-only. Server any // FullMethod is the full RPC method string, i.e., /package.service/method. FullMethod string } // UnaryHandler defines the handler invoked by UnaryServerInterceptor to complete the normal // execution of a unary RPC. // // If a UnaryHandler returns an error, it should either be produced by the // status package, or be one of the context errors. Otherwise, gRPC will use // codes.Unknown as the status code and err.Error() as the status message of the // RPC. type UnaryHandler func(ctx context.Context, req any) (any, error) // UnaryServerInterceptor provides a hook to intercept the execution of a unary RPC on the server. info // contains all the information of this RPC the interceptor can operate on. And handler is the wrapper // of the service method implementation. It is the responsibility of the interceptor to invoke handler // to complete the RPC. type UnaryServerInterceptor func(ctx context.Context, req any, info *UnaryServerInfo, handler UnaryHandler) (resp any, err error) // StreamServerInfo consists of various information about a streaming RPC on // server side. All per-rpc information may be mutated by the interceptor. type StreamServerInfo struct { // FullMethod is the full RPC method string, i.e., /package.service/method. FullMethod string // IsClientStream indicates whether the RPC is a client streaming RPC. IsClientStream bool // IsServerStream indicates whether the RPC is a server streaming RPC. IsServerStream bool } // StreamServerInterceptor provides a hook to intercept the execution of a streaming RPC on the server. // info contains all the information of this RPC the interceptor can operate on. And handler is the // service method implementation. It is the responsibility of the interceptor to invoke handler to // complete the RPC. type StreamServerInterceptor func(srv any, ss ServerStream, info *StreamServerInfo, handler StreamHandler) error ================================================ FILE: vendor/google.golang.org/grpc/internal/backoff/backoff.go ================================================ /* * * Copyright 2017 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package backoff implement the backoff strategy for gRPC. // // This is kept in internal until the gRPC project decides whether or not to // allow alternative backoff strategies. package backoff import ( "context" "errors" rand "math/rand/v2" "time" grpcbackoff "google.golang.org/grpc/backoff" ) // Strategy defines the methodology for backing off after a grpc connection // failure. type Strategy interface { // Backoff returns the amount of time to wait before the next retry given // the number of consecutive failures. Backoff(retries int) time.Duration } // DefaultExponential is an exponential backoff implementation using the // default values for all the configurable knobs defined in // https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md. var DefaultExponential = Exponential{Config: grpcbackoff.DefaultConfig} // Exponential implements exponential backoff algorithm as defined in // https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md. type Exponential struct { // Config contains all options to configure the backoff algorithm. Config grpcbackoff.Config } // Backoff returns the amount of time to wait before the next retry given the // number of retries. func (bc Exponential) Backoff(retries int) time.Duration { if retries == 0 { return bc.Config.BaseDelay } backoff, max := float64(bc.Config.BaseDelay), float64(bc.Config.MaxDelay) for backoff < max && retries > 0 { backoff *= bc.Config.Multiplier retries-- } if backoff > max { backoff = max } // Randomize backoff delays so that if a cluster of requests start at // the same time, they won't operate in lockstep. backoff *= 1 + bc.Config.Jitter*(rand.Float64()*2-1) if backoff < 0 { return 0 } return time.Duration(backoff) } // ErrResetBackoff is the error to be returned by the function executed by RunF, // to instruct the latter to reset its backoff state. var ErrResetBackoff = errors.New("reset backoff state") // RunF provides a convenient way to run a function f repeatedly until the // context expires or f returns a non-nil error that is not ErrResetBackoff. // When f returns ErrResetBackoff, RunF continues to run f, but resets its // backoff state before doing so. backoff accepts an integer representing the // number of retries, and returns the amount of time to backoff. func RunF(ctx context.Context, f func() error, backoff func(int) time.Duration) { attempt := 0 timer := time.NewTimer(0) for ctx.Err() == nil { select { case <-timer.C: case <-ctx.Done(): timer.Stop() return } err := f() if errors.Is(err, ErrResetBackoff) { timer.Reset(0) attempt = 0 continue } if err != nil { return } timer.Reset(backoff(attempt)) attempt++ } } ================================================ FILE: vendor/google.golang.org/grpc/internal/balancer/gracefulswitch/config.go ================================================ /* * * Copyright 2024 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package gracefulswitch import ( "encoding/json" "fmt" "google.golang.org/grpc/balancer" "google.golang.org/grpc/serviceconfig" ) type lbConfig struct { serviceconfig.LoadBalancingConfig childBuilder balancer.Builder childConfig serviceconfig.LoadBalancingConfig } // ChildName returns the name of the child balancer of the gracefulswitch // Balancer. func ChildName(l serviceconfig.LoadBalancingConfig) string { return l.(*lbConfig).childBuilder.Name() } // ParseConfig parses a child config list and returns a LB config for the // gracefulswitch Balancer. // // cfg is expected to be a json.RawMessage containing a JSON array of LB policy // names + configs as the format of the "loadBalancingConfig" field in // ServiceConfig. It returns a type that should be passed to // UpdateClientConnState in the BalancerConfig field. func ParseConfig(cfg json.RawMessage) (serviceconfig.LoadBalancingConfig, error) { var lbCfg []map[string]json.RawMessage if err := json.Unmarshal(cfg, &lbCfg); err != nil { return nil, err } for i, e := range lbCfg { if len(e) != 1 { return nil, fmt.Errorf("expected a JSON struct with one entry; received entry %v at index %d", e, i) } var name string var jsonCfg json.RawMessage for name, jsonCfg = range e { } builder := balancer.Get(name) if builder == nil { // Skip unregistered balancer names. continue } parser, ok := builder.(balancer.ConfigParser) if !ok { // This is a valid child with no config. return &lbConfig{childBuilder: builder}, nil } cfg, err := parser.ParseConfig(jsonCfg) if err != nil { return nil, fmt.Errorf("error parsing config for policy %q: %v", name, err) } return &lbConfig{childBuilder: builder, childConfig: cfg}, nil } return nil, fmt.Errorf("no supported policies found in config: %v", string(cfg)) } ================================================ FILE: vendor/google.golang.org/grpc/internal/balancer/gracefulswitch/gracefulswitch.go ================================================ /* * * Copyright 2022 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package gracefulswitch implements a graceful switch load balancer. package gracefulswitch import ( "errors" "fmt" "sync" "google.golang.org/grpc/balancer" "google.golang.org/grpc/balancer/base" "google.golang.org/grpc/connectivity" "google.golang.org/grpc/resolver" ) var errBalancerClosed = errors.New("gracefulSwitchBalancer is closed") var _ balancer.Balancer = (*Balancer)(nil) // NewBalancer returns a graceful switch Balancer. func NewBalancer(cc balancer.ClientConn, opts balancer.BuildOptions) *Balancer { return &Balancer{ cc: cc, bOpts: opts, } } // Balancer is a utility to gracefully switch from one balancer to // a new balancer. It implements the balancer.Balancer interface. type Balancer struct { bOpts balancer.BuildOptions cc balancer.ClientConn // mu protects the following fields and all fields within balancerCurrent // and balancerPending. mu does not need to be held when calling into the // child balancers, as all calls into these children happen only as a direct // result of a call into the gracefulSwitchBalancer, which are also // guaranteed to be synchronous. There is one exception: an UpdateState call // from a child balancer when current and pending are populated can lead to // calling Close() on the current. To prevent that racing with an // UpdateSubConnState from the channel, we hold currentMu during Close and // UpdateSubConnState calls. mu sync.Mutex balancerCurrent *balancerWrapper balancerPending *balancerWrapper closed bool // set to true when this balancer is closed // currentMu must be locked before mu. This mutex guards against this // sequence of events: UpdateSubConnState() called, finds the // balancerCurrent, gives up lock, updateState comes in, causes Close() on // balancerCurrent before the UpdateSubConnState is called on the // balancerCurrent. currentMu sync.Mutex // activeGoroutines tracks all the goroutines that this balancer has started // and that should be waited on when the balancer closes. activeGoroutines sync.WaitGroup } // swap swaps out the current lb with the pending lb and updates the ClientConn. // The caller must hold gsb.mu. func (gsb *Balancer) swap() { gsb.cc.UpdateState(gsb.balancerPending.lastState) cur := gsb.balancerCurrent gsb.balancerCurrent = gsb.balancerPending gsb.balancerPending = nil gsb.activeGoroutines.Add(1) go func() { defer gsb.activeGoroutines.Done() gsb.currentMu.Lock() defer gsb.currentMu.Unlock() cur.Close() }() } // Helper function that checks if the balancer passed in is current or pending. // The caller must hold gsb.mu. func (gsb *Balancer) balancerCurrentOrPending(bw *balancerWrapper) bool { return bw == gsb.balancerCurrent || bw == gsb.balancerPending } // SwitchTo initializes the graceful switch process, which completes based on // connectivity state changes on the current/pending balancer. Thus, the switch // process is not complete when this method returns. This method must be called // synchronously alongside the rest of the balancer.Balancer methods this // Graceful Switch Balancer implements. // // Deprecated: use ParseConfig and pass a parsed config to UpdateClientConnState // to cause the Balancer to automatically change to the new child when necessary. func (gsb *Balancer) SwitchTo(builder balancer.Builder) error { _, err := gsb.switchTo(builder) return err } func (gsb *Balancer) switchTo(builder balancer.Builder) (*balancerWrapper, error) { gsb.mu.Lock() if gsb.closed { gsb.mu.Unlock() return nil, errBalancerClosed } bw := &balancerWrapper{ ClientConn: gsb.cc, builder: builder, gsb: gsb, lastState: balancer.State{ ConnectivityState: connectivity.Connecting, Picker: base.NewErrPicker(balancer.ErrNoSubConnAvailable), }, subconns: make(map[balancer.SubConn]bool), } balToClose := gsb.balancerPending // nil if there is no pending balancer if gsb.balancerCurrent == nil { gsb.balancerCurrent = bw } else { gsb.balancerPending = bw } gsb.mu.Unlock() balToClose.Close() // This function takes a builder instead of a balancer because builder.Build // can call back inline, and this utility needs to handle the callbacks. newBalancer := builder.Build(bw, gsb.bOpts) if newBalancer == nil { // This is illegal and should never happen; we clear the balancerWrapper // we were constructing if it happens to avoid a potential panic. gsb.mu.Lock() if gsb.balancerPending != nil { gsb.balancerPending = nil } else { gsb.balancerCurrent = nil } gsb.mu.Unlock() return nil, balancer.ErrBadResolverState } // This write doesn't need to take gsb.mu because this field never gets read // or written to on any calls from the current or pending. Calls from grpc // to this balancer are guaranteed to be called synchronously, so this // bw.Balancer field will never be forwarded to until this SwitchTo() // function returns. bw.Balancer = newBalancer return bw, nil } // Returns nil if the graceful switch balancer is closed. func (gsb *Balancer) latestBalancer() *balancerWrapper { gsb.mu.Lock() defer gsb.mu.Unlock() if gsb.balancerPending != nil { return gsb.balancerPending } return gsb.balancerCurrent } // UpdateClientConnState forwards the update to the latest balancer created. // // If the state's BalancerConfig is the config returned by a call to // gracefulswitch.ParseConfig, then this function will automatically SwitchTo // the balancer indicated by the config before forwarding its config to it, if // necessary. func (gsb *Balancer) UpdateClientConnState(state balancer.ClientConnState) error { // The resolver data is only relevant to the most recent LB Policy. balToUpdate := gsb.latestBalancer() gsbCfg, ok := state.BalancerConfig.(*lbConfig) if ok { // Switch to the child in the config unless it is already active. if balToUpdate == nil || gsbCfg.childBuilder.Name() != balToUpdate.builder.Name() { var err error balToUpdate, err = gsb.switchTo(gsbCfg.childBuilder) if err != nil { return fmt.Errorf("could not switch to new child balancer: %w", err) } } // Unwrap the child balancer's config. state.BalancerConfig = gsbCfg.childConfig } if balToUpdate == nil { return errBalancerClosed } // Perform this call without gsb.mu to prevent deadlocks if the child calls // back into the channel. The latest balancer can never be closed during a // call from the channel, even without gsb.mu held. return balToUpdate.UpdateClientConnState(state) } // ResolverError forwards the error to the latest balancer created. func (gsb *Balancer) ResolverError(err error) { // The resolver data is only relevant to the most recent LB Policy. balToUpdate := gsb.latestBalancer() if balToUpdate == nil { gsb.cc.UpdateState(balancer.State{ ConnectivityState: connectivity.TransientFailure, Picker: base.NewErrPicker(err), }) return } // Perform this call without gsb.mu to prevent deadlocks if the child calls // back into the channel. The latest balancer can never be closed during a // call from the channel, even without gsb.mu held. balToUpdate.ResolverError(err) } // ExitIdle forwards the call to the latest balancer created. // // If the latest balancer does not support ExitIdle, the subConns are // re-connected to manually. func (gsb *Balancer) ExitIdle() { balToUpdate := gsb.latestBalancer() if balToUpdate == nil { return } // There is no need to protect this read with a mutex, as the write to the // Balancer field happens in SwitchTo, which completes before this can be // called. balToUpdate.ExitIdle() } // updateSubConnState forwards the update to the appropriate child. func (gsb *Balancer) updateSubConnState(sc balancer.SubConn, state balancer.SubConnState, cb func(balancer.SubConnState)) { gsb.currentMu.Lock() defer gsb.currentMu.Unlock() gsb.mu.Lock() // Forward update to the appropriate child. Even if there is a pending // balancer, the current balancer should continue to get SubConn updates to // maintain the proper state while the pending is still connecting. var balToUpdate *balancerWrapper if gsb.balancerCurrent != nil && gsb.balancerCurrent.subconns[sc] { balToUpdate = gsb.balancerCurrent } else if gsb.balancerPending != nil && gsb.balancerPending.subconns[sc] { balToUpdate = gsb.balancerPending } if balToUpdate == nil { // SubConn belonged to a stale lb policy that has not yet fully closed, // or the balancer was already closed. gsb.mu.Unlock() return } if state.ConnectivityState == connectivity.Shutdown { delete(balToUpdate.subconns, sc) } gsb.mu.Unlock() if cb != nil { cb(state) } else { balToUpdate.UpdateSubConnState(sc, state) } } // UpdateSubConnState forwards the update to the appropriate child. func (gsb *Balancer) UpdateSubConnState(sc balancer.SubConn, state balancer.SubConnState) { gsb.updateSubConnState(sc, state, nil) } // Close closes any active child balancers. func (gsb *Balancer) Close() { gsb.mu.Lock() gsb.closed = true currentBalancerToClose := gsb.balancerCurrent gsb.balancerCurrent = nil pendingBalancerToClose := gsb.balancerPending gsb.balancerPending = nil gsb.mu.Unlock() currentBalancerToClose.Close() pendingBalancerToClose.Close() gsb.activeGoroutines.Wait() } // balancerWrapper wraps a balancer.Balancer, and overrides some Balancer // methods to help cleanup SubConns created by the wrapped balancer. // // It implements the balancer.ClientConn interface and is passed down in that // capacity to the wrapped balancer. It maintains a set of subConns created by // the wrapped balancer and calls from the latter to create/update/shutdown // SubConns update this set before being forwarded to the parent ClientConn. // State updates from the wrapped balancer can result in invocation of the // graceful switch logic. type balancerWrapper struct { balancer.ClientConn balancer.Balancer gsb *Balancer builder balancer.Builder lastState balancer.State subconns map[balancer.SubConn]bool // subconns created by this balancer } // Close closes the underlying LB policy and shuts down the subconns it // created. bw must not be referenced via balancerCurrent or balancerPending in // gsb when called. gsb.mu must not be held. Does not panic with a nil // receiver. func (bw *balancerWrapper) Close() { // before Close is called. if bw == nil { return } // There is no need to protect this read with a mutex, as Close() is // impossible to be called concurrently with the write in SwitchTo(). The // callsites of Close() for this balancer in Graceful Switch Balancer will // never be called until SwitchTo() returns. bw.Balancer.Close() bw.gsb.mu.Lock() for sc := range bw.subconns { sc.Shutdown() } bw.gsb.mu.Unlock() } func (bw *balancerWrapper) UpdateState(state balancer.State) { // Hold the mutex for this entire call to ensure it cannot occur // concurrently with other updateState() calls. This causes updates to // lastState and calls to cc.UpdateState to happen atomically. bw.gsb.mu.Lock() defer bw.gsb.mu.Unlock() bw.lastState = state // If Close() acquires the mutex before UpdateState(), the balancer // will already have been removed from the current or pending state when // reaching this point. if !bw.gsb.balancerCurrentOrPending(bw) { // Returning here ensures that (*Balancer).swap() is not invoked after // (*Balancer).Close() and therefore prevents "use after close". return } if bw == bw.gsb.balancerCurrent { // In the case that the current balancer exits READY, and there is a pending // balancer, you can forward the pending balancer's cached State up to // ClientConn and swap the pending into the current. This is because there // is no reason to gracefully switch from and keep using the old policy as // the ClientConn is not connected to any backends. if state.ConnectivityState != connectivity.Ready && bw.gsb.balancerPending != nil { bw.gsb.swap() return } // Even if there is a pending balancer waiting to be gracefully switched to, // continue to forward current balancer updates to the Client Conn. Ignoring // state + picker from the current would cause undefined behavior/cause the // system to behave incorrectly from the current LB policies perspective. // Also, the current LB is still being used by grpc to choose SubConns per // RPC, and thus should use the most updated form of the current balancer. bw.gsb.cc.UpdateState(state) return } // This method is now dealing with a state update from the pending balancer. // If the current balancer is currently in a state other than READY, the new // policy can be swapped into place immediately. This is because there is no // reason to gracefully switch from and keep using the old policy as the // ClientConn is not connected to any backends. if state.ConnectivityState != connectivity.Connecting || bw.gsb.balancerCurrent.lastState.ConnectivityState != connectivity.Ready { bw.gsb.swap() } } func (bw *balancerWrapper) NewSubConn(addrs []resolver.Address, opts balancer.NewSubConnOptions) (balancer.SubConn, error) { bw.gsb.mu.Lock() if !bw.gsb.balancerCurrentOrPending(bw) { bw.gsb.mu.Unlock() return nil, fmt.Errorf("%T at address %p that called NewSubConn is deleted", bw, bw) } bw.gsb.mu.Unlock() var sc balancer.SubConn oldListener := opts.StateListener opts.StateListener = func(state balancer.SubConnState) { bw.gsb.updateSubConnState(sc, state, oldListener) } sc, err := bw.gsb.cc.NewSubConn(addrs, opts) if err != nil { return nil, err } bw.gsb.mu.Lock() if !bw.gsb.balancerCurrentOrPending(bw) { // balancer was closed during this call sc.Shutdown() bw.gsb.mu.Unlock() return nil, fmt.Errorf("%T at address %p that called NewSubConn is deleted", bw, bw) } bw.subconns[sc] = true bw.gsb.mu.Unlock() return sc, nil } func (bw *balancerWrapper) ResolveNow(opts resolver.ResolveNowOptions) { // Ignore ResolveNow requests from anything other than the most recent // balancer, because older balancers were already removed from the config. if bw != bw.gsb.latestBalancer() { return } bw.gsb.cc.ResolveNow(opts) } func (bw *balancerWrapper) RemoveSubConn(sc balancer.SubConn) { // Note: existing third party balancers may call this, so it must remain // until RemoveSubConn is fully removed. sc.Shutdown() } func (bw *balancerWrapper) UpdateAddresses(sc balancer.SubConn, addrs []resolver.Address) { bw.gsb.mu.Lock() if !bw.gsb.balancerCurrentOrPending(bw) { bw.gsb.mu.Unlock() return } bw.gsb.mu.Unlock() bw.gsb.cc.UpdateAddresses(sc, addrs) } ================================================ FILE: vendor/google.golang.org/grpc/internal/balancerload/load.go ================================================ /* * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // Package balancerload defines APIs to parse server loads in trailers. The // parsed loads are sent to balancers in DoneInfo. package balancerload import ( "google.golang.org/grpc/metadata" ) // Parser converts loads from metadata into a concrete type. type Parser interface { // Parse parses loads from metadata. Parse(md metadata.MD) any } var parser Parser // SetParser sets the load parser. // // Not mutex-protected, should be called before any gRPC functions. func SetParser(lr Parser) { parser = lr } // Parse calls parser.Read(). func Parse(md metadata.MD) any { if parser == nil { return nil } return parser.Parse(md) } ================================================ FILE: vendor/google.golang.org/grpc/internal/binarylog/binarylog.go ================================================ /* * * Copyright 2018 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package binarylog implementation binary logging as defined in // https://github.com/grpc/proposal/blob/master/A16-binary-logging.md. package binarylog import ( "fmt" "os" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/internal/grpcutil" ) var grpclogLogger = grpclog.Component("binarylog") // Logger specifies MethodLoggers for method names with a Log call that // takes a context. // // This is used in the 1.0 release of gcp/observability, and thus must not be // deleted or changed. type Logger interface { GetMethodLogger(methodName string) MethodLogger } // binLogger is the global binary logger for the binary. One of this should be // built at init time from the configuration (environment variable or flags). // // It is used to get a MethodLogger for each individual method. var binLogger Logger // SetLogger sets the binary logger. // // Only call this at init time. func SetLogger(l Logger) { binLogger = l } // GetLogger gets the binary logger. // // Only call this at init time. func GetLogger() Logger { return binLogger } // GetMethodLogger returns the MethodLogger for the given methodName. // // methodName should be in the format of "/service/method". // // Each MethodLogger returned by this method is a new instance. This is to // generate sequence id within the call. func GetMethodLogger(methodName string) MethodLogger { if binLogger == nil { return nil } return binLogger.GetMethodLogger(methodName) } func init() { const envStr = "GRPC_BINARY_LOG_FILTER" configStr := os.Getenv(envStr) binLogger = NewLoggerFromConfigString(configStr) } // MethodLoggerConfig contains the setting for logging behavior of a method // logger. Currently, it contains the max length of header and message. type MethodLoggerConfig struct { // Max length of header and message. Header, Message uint64 } // LoggerConfig contains the config for loggers to create method loggers. type LoggerConfig struct { All *MethodLoggerConfig Services map[string]*MethodLoggerConfig Methods map[string]*MethodLoggerConfig Blacklist map[string]struct{} } type logger struct { config LoggerConfig } // NewLoggerFromConfig builds a logger with the given LoggerConfig. func NewLoggerFromConfig(config LoggerConfig) Logger { return &logger{config: config} } // newEmptyLogger creates an empty logger. The map fields need to be filled in // using the set* functions. func newEmptyLogger() *logger { return &logger{} } // Set method logger for "*". func (l *logger) setDefaultMethodLogger(ml *MethodLoggerConfig) error { if l.config.All != nil { return fmt.Errorf("conflicting global rules found") } l.config.All = ml return nil } // Set method logger for "service/*". // // New MethodLogger with same service overrides the old one. func (l *logger) setServiceMethodLogger(service string, ml *MethodLoggerConfig) error { if _, ok := l.config.Services[service]; ok { return fmt.Errorf("conflicting service rules for service %v found", service) } if l.config.Services == nil { l.config.Services = make(map[string]*MethodLoggerConfig) } l.config.Services[service] = ml return nil } // Set method logger for "service/method". // // New MethodLogger with same method overrides the old one. func (l *logger) setMethodMethodLogger(method string, ml *MethodLoggerConfig) error { if _, ok := l.config.Blacklist[method]; ok { return fmt.Errorf("conflicting blacklist rules for method %v found", method) } if _, ok := l.config.Methods[method]; ok { return fmt.Errorf("conflicting method rules for method %v found", method) } if l.config.Methods == nil { l.config.Methods = make(map[string]*MethodLoggerConfig) } l.config.Methods[method] = ml return nil } // Set blacklist method for "-service/method". func (l *logger) setBlacklist(method string) error { if _, ok := l.config.Blacklist[method]; ok { return fmt.Errorf("conflicting blacklist rules for method %v found", method) } if _, ok := l.config.Methods[method]; ok { return fmt.Errorf("conflicting method rules for method %v found", method) } if l.config.Blacklist == nil { l.config.Blacklist = make(map[string]struct{}) } l.config.Blacklist[method] = struct{}{} return nil } // getMethodLogger returns the MethodLogger for the given methodName. // // methodName should be in the format of "/service/method". // // Each MethodLogger returned by this method is a new instance. This is to // generate sequence id within the call. func (l *logger) GetMethodLogger(methodName string) MethodLogger { s, m, err := grpcutil.ParseMethod(methodName) if err != nil { grpclogLogger.Infof("binarylogging: failed to parse %q: %v", methodName, err) return nil } if ml, ok := l.config.Methods[s+"/"+m]; ok { return NewTruncatingMethodLogger(ml.Header, ml.Message) } if _, ok := l.config.Blacklist[s+"/"+m]; ok { return nil } if ml, ok := l.config.Services[s]; ok { return NewTruncatingMethodLogger(ml.Header, ml.Message) } if l.config.All == nil { return nil } return NewTruncatingMethodLogger(l.config.All.Header, l.config.All.Message) } ================================================ FILE: vendor/google.golang.org/grpc/internal/binarylog/binarylog_testutil.go ================================================ /* * * Copyright 2018 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // This file contains exported variables/functions that are exported for testing // only. // // An ideal way for this would be to put those in a *_test.go but in binarylog // package. But this doesn't work with staticcheck with go module. Error was: // "MdToMetadataProto not declared by package binarylog". This could be caused // by the way staticcheck looks for files for a certain package, which doesn't // support *_test.go files. // // Move those to binary_test.go when staticcheck is fixed. package binarylog var ( // AllLogger is a logger that logs all headers/messages for all RPCs. It's // for testing only. AllLogger = NewLoggerFromConfigString("*") // MdToMetadataProto converts metadata to a binary logging proto message. // It's for testing only. MdToMetadataProto = mdToMetadataProto // AddrToProto converts an address to a binary logging proto message. It's // for testing only. AddrToProto = addrToProto ) ================================================ FILE: vendor/google.golang.org/grpc/internal/binarylog/env_config.go ================================================ /* * * Copyright 2018 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package binarylog import ( "errors" "fmt" "regexp" "strconv" "strings" ) // NewLoggerFromConfigString reads the string and build a logger. It can be used // to build a new logger and assign it to binarylog.Logger. // // Example filter config strings: // - "" Nothing will be logged // - "*" All headers and messages will be fully logged. // - "*{h}" Only headers will be logged. // - "*{m:256}" Only the first 256 bytes of each message will be logged. // - "Foo/*" Logs every method in service Foo // - "Foo/*,-Foo/Bar" Logs every method in service Foo except method /Foo/Bar // - "Foo/*,Foo/Bar{m:256}" Logs the first 256 bytes of each message in method // /Foo/Bar, logs all headers and messages in every other method in service // Foo. // // If two configs exist for one certain method or service, the one specified // later overrides the previous config. func NewLoggerFromConfigString(s string) Logger { if s == "" { return nil } l := newEmptyLogger() methods := strings.Split(s, ",") for _, method := range methods { if err := l.fillMethodLoggerWithConfigString(method); err != nil { grpclogLogger.Warningf("failed to parse binary log config: %v", err) return nil } } return l } // fillMethodLoggerWithConfigString parses config, creates TruncatingMethodLogger and adds // it to the right map in the logger. func (l *logger) fillMethodLoggerWithConfigString(config string) error { // "" is invalid. if config == "" { return errors.New("empty string is not a valid method binary logging config") } // "-service/method", blacklist, no * or {} allowed. if config[0] == '-' { s, m, suffix, err := parseMethodConfigAndSuffix(config[1:]) if err != nil { return fmt.Errorf("invalid config: %q, %v", config, err) } if m == "*" { return fmt.Errorf("invalid config: %q, %v", config, "* not allowed in blacklist config") } if suffix != "" { return fmt.Errorf("invalid config: %q, %v", config, "header/message limit not allowed in blacklist config") } if err := l.setBlacklist(s + "/" + m); err != nil { return fmt.Errorf("invalid config: %v", err) } return nil } // "*{h:256;m:256}" if config[0] == '*' { hdr, msg, err := parseHeaderMessageLengthConfig(config[1:]) if err != nil { return fmt.Errorf("invalid config: %q, %v", config, err) } if err := l.setDefaultMethodLogger(&MethodLoggerConfig{Header: hdr, Message: msg}); err != nil { return fmt.Errorf("invalid config: %v", err) } return nil } s, m, suffix, err := parseMethodConfigAndSuffix(config) if err != nil { return fmt.Errorf("invalid config: %q, %v", config, err) } hdr, msg, err := parseHeaderMessageLengthConfig(suffix) if err != nil { return fmt.Errorf("invalid header/message length config: %q, %v", suffix, err) } if m == "*" { if err := l.setServiceMethodLogger(s, &MethodLoggerConfig{Header: hdr, Message: msg}); err != nil { return fmt.Errorf("invalid config: %v", err) } } else { if err := l.setMethodMethodLogger(s+"/"+m, &MethodLoggerConfig{Header: hdr, Message: msg}); err != nil { return fmt.Errorf("invalid config: %v", err) } } return nil } const ( // TODO: this const is only used by env_config now. But could be useful for // other config. Move to binarylog.go if necessary. maxUInt = ^uint64(0) // For "p.s/m" plus any suffix. Suffix will be parsed again. See test for // expected output. longMethodConfigRegexpStr = `^([\w./]+)/((?:\w+)|[*])(.+)?$` // For suffix from above, "{h:123,m:123}". See test for expected output. optionalLengthRegexpStr = `(?::(\d+))?` // Optional ":123". headerConfigRegexpStr = `^{h` + optionalLengthRegexpStr + `}$` messageConfigRegexpStr = `^{m` + optionalLengthRegexpStr + `}$` headerMessageConfigRegexpStr = `^{h` + optionalLengthRegexpStr + `;m` + optionalLengthRegexpStr + `}$` ) var ( longMethodConfigRegexp = regexp.MustCompile(longMethodConfigRegexpStr) headerConfigRegexp = regexp.MustCompile(headerConfigRegexpStr) messageConfigRegexp = regexp.MustCompile(messageConfigRegexpStr) headerMessageConfigRegexp = regexp.MustCompile(headerMessageConfigRegexpStr) ) // Turn "service/method{h;m}" into "service", "method", "{h;m}". func parseMethodConfigAndSuffix(c string) (service, method, suffix string, _ error) { // Regexp result: // // in: "p.s/m{h:123,m:123}", // out: []string{"p.s/m{h:123,m:123}", "p.s", "m", "{h:123,m:123}"}, match := longMethodConfigRegexp.FindStringSubmatch(c) if match == nil { return "", "", "", fmt.Errorf("%q contains invalid substring", c) } service = match[1] method = match[2] suffix = match[3] return } // Turn "{h:123;m:345}" into 123, 345. // // Return maxUInt if length is unspecified. func parseHeaderMessageLengthConfig(c string) (hdrLenStr, msgLenStr uint64, err error) { if c == "" { return maxUInt, maxUInt, nil } // Header config only. if match := headerConfigRegexp.FindStringSubmatch(c); match != nil { if s := match[1]; s != "" { hdrLenStr, err = strconv.ParseUint(s, 10, 64) if err != nil { return 0, 0, fmt.Errorf("failed to convert %q to uint", s) } return hdrLenStr, 0, nil } return maxUInt, 0, nil } // Message config only. if match := messageConfigRegexp.FindStringSubmatch(c); match != nil { if s := match[1]; s != "" { msgLenStr, err = strconv.ParseUint(s, 10, 64) if err != nil { return 0, 0, fmt.Errorf("failed to convert %q to uint", s) } return 0, msgLenStr, nil } return 0, maxUInt, nil } // Header and message config both. if match := headerMessageConfigRegexp.FindStringSubmatch(c); match != nil { // Both hdr and msg are specified, but one or two of them might be empty. hdrLenStr = maxUInt msgLenStr = maxUInt if s := match[1]; s != "" { hdrLenStr, err = strconv.ParseUint(s, 10, 64) if err != nil { return 0, 0, fmt.Errorf("failed to convert %q to uint", s) } } if s := match[2]; s != "" { msgLenStr, err = strconv.ParseUint(s, 10, 64) if err != nil { return 0, 0, fmt.Errorf("failed to convert %q to uint", s) } } return hdrLenStr, msgLenStr, nil } return 0, 0, fmt.Errorf("%q contains invalid substring", c) } ================================================ FILE: vendor/google.golang.org/grpc/internal/binarylog/method_logger.go ================================================ /* * * Copyright 2018 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package binarylog import ( "context" "net" "strings" "sync/atomic" "time" binlogpb "google.golang.org/grpc/binarylog/grpc_binarylog_v1" "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/types/known/durationpb" "google.golang.org/protobuf/types/known/timestamppb" ) type callIDGenerator struct { id uint64 } func (g *callIDGenerator) next() uint64 { id := atomic.AddUint64(&g.id, 1) return id } // reset is for testing only, and doesn't need to be thread safe. func (g *callIDGenerator) reset() { g.id = 0 } var idGen callIDGenerator // MethodLogger is the sub-logger for each method. // // This is used in the 1.0 release of gcp/observability, and thus must not be // deleted or changed. type MethodLogger interface { Log(context.Context, LogEntryConfig) } // TruncatingMethodLogger is a method logger that truncates headers and messages // based on configured fields. type TruncatingMethodLogger struct { headerMaxLen, messageMaxLen uint64 callID uint64 idWithinCallGen *callIDGenerator sink Sink // TODO(blog): make this pluggable. } // NewTruncatingMethodLogger returns a new truncating method logger. // // This is used in the 1.0 release of gcp/observability, and thus must not be // deleted or changed. func NewTruncatingMethodLogger(h, m uint64) *TruncatingMethodLogger { return &TruncatingMethodLogger{ headerMaxLen: h, messageMaxLen: m, callID: idGen.next(), idWithinCallGen: &callIDGenerator{}, sink: DefaultSink, // TODO(blog): make it pluggable. } } // Build is an internal only method for building the proto message out of the // input event. It's made public to enable other library to reuse as much logic // in TruncatingMethodLogger as possible. func (ml *TruncatingMethodLogger) Build(c LogEntryConfig) *binlogpb.GrpcLogEntry { m := c.toProto() timestamp := timestamppb.Now() m.Timestamp = timestamp m.CallId = ml.callID m.SequenceIdWithinCall = ml.idWithinCallGen.next() switch pay := m.Payload.(type) { case *binlogpb.GrpcLogEntry_ClientHeader: m.PayloadTruncated = ml.truncateMetadata(pay.ClientHeader.GetMetadata()) case *binlogpb.GrpcLogEntry_ServerHeader: m.PayloadTruncated = ml.truncateMetadata(pay.ServerHeader.GetMetadata()) case *binlogpb.GrpcLogEntry_Message: m.PayloadTruncated = ml.truncateMessage(pay.Message) } return m } // Log creates a proto binary log entry, and logs it to the sink. func (ml *TruncatingMethodLogger) Log(_ context.Context, c LogEntryConfig) { ml.sink.Write(ml.Build(c)) } func (ml *TruncatingMethodLogger) truncateMetadata(mdPb *binlogpb.Metadata) (truncated bool) { if ml.headerMaxLen == maxUInt { return false } var ( bytesLimit = ml.headerMaxLen index int ) // At the end of the loop, index will be the first entry where the total // size is greater than the limit: // // len(entry[:index]) <= ml.hdr && len(entry[:index+1]) > ml.hdr. for ; index < len(mdPb.Entry); index++ { entry := mdPb.Entry[index] if entry.Key == "grpc-trace-bin" { // "grpc-trace-bin" is a special key. It's kept in the log entry, // but not counted towards the size limit. continue } currentEntryLen := uint64(len(entry.GetKey())) + uint64(len(entry.GetValue())) if currentEntryLen > bytesLimit { break } bytesLimit -= currentEntryLen } truncated = index < len(mdPb.Entry) mdPb.Entry = mdPb.Entry[:index] return truncated } func (ml *TruncatingMethodLogger) truncateMessage(msgPb *binlogpb.Message) (truncated bool) { if ml.messageMaxLen == maxUInt { return false } if ml.messageMaxLen >= uint64(len(msgPb.Data)) { return false } msgPb.Data = msgPb.Data[:ml.messageMaxLen] return true } // LogEntryConfig represents the configuration for binary log entry. // // This is used in the 1.0 release of gcp/observability, and thus must not be // deleted or changed. type LogEntryConfig interface { toProto() *binlogpb.GrpcLogEntry } // ClientHeader configs the binary log entry to be a ClientHeader entry. type ClientHeader struct { OnClientSide bool Header metadata.MD MethodName string Authority string Timeout time.Duration // PeerAddr is required only when it's on server side. PeerAddr net.Addr } func (c *ClientHeader) toProto() *binlogpb.GrpcLogEntry { // This function doesn't need to set all the fields (e.g. seq ID). The Log // function will set the fields when necessary. clientHeader := &binlogpb.ClientHeader{ Metadata: mdToMetadataProto(c.Header), MethodName: c.MethodName, Authority: c.Authority, } if c.Timeout > 0 { clientHeader.Timeout = durationpb.New(c.Timeout) } ret := &binlogpb.GrpcLogEntry{ Type: binlogpb.GrpcLogEntry_EVENT_TYPE_CLIENT_HEADER, Payload: &binlogpb.GrpcLogEntry_ClientHeader{ ClientHeader: clientHeader, }, } if c.OnClientSide { ret.Logger = binlogpb.GrpcLogEntry_LOGGER_CLIENT } else { ret.Logger = binlogpb.GrpcLogEntry_LOGGER_SERVER } if c.PeerAddr != nil { ret.Peer = addrToProto(c.PeerAddr) } return ret } // ServerHeader configs the binary log entry to be a ServerHeader entry. type ServerHeader struct { OnClientSide bool Header metadata.MD // PeerAddr is required only when it's on client side. PeerAddr net.Addr } func (c *ServerHeader) toProto() *binlogpb.GrpcLogEntry { ret := &binlogpb.GrpcLogEntry{ Type: binlogpb.GrpcLogEntry_EVENT_TYPE_SERVER_HEADER, Payload: &binlogpb.GrpcLogEntry_ServerHeader{ ServerHeader: &binlogpb.ServerHeader{ Metadata: mdToMetadataProto(c.Header), }, }, } if c.OnClientSide { ret.Logger = binlogpb.GrpcLogEntry_LOGGER_CLIENT } else { ret.Logger = binlogpb.GrpcLogEntry_LOGGER_SERVER } if c.PeerAddr != nil { ret.Peer = addrToProto(c.PeerAddr) } return ret } // ClientMessage configs the binary log entry to be a ClientMessage entry. type ClientMessage struct { OnClientSide bool // Message can be a proto.Message or []byte. Other messages formats are not // supported. Message any } func (c *ClientMessage) toProto() *binlogpb.GrpcLogEntry { var ( data []byte err error ) if m, ok := c.Message.(proto.Message); ok { data, err = proto.Marshal(m) if err != nil { grpclogLogger.Infof("binarylogging: failed to marshal proto message: %v", err) } } else if b, ok := c.Message.([]byte); ok { data = b } else { grpclogLogger.Infof("binarylogging: message to log is neither proto.message nor []byte") } ret := &binlogpb.GrpcLogEntry{ Type: binlogpb.GrpcLogEntry_EVENT_TYPE_CLIENT_MESSAGE, Payload: &binlogpb.GrpcLogEntry_Message{ Message: &binlogpb.Message{ Length: uint32(len(data)), Data: data, }, }, } if c.OnClientSide { ret.Logger = binlogpb.GrpcLogEntry_LOGGER_CLIENT } else { ret.Logger = binlogpb.GrpcLogEntry_LOGGER_SERVER } return ret } // ServerMessage configs the binary log entry to be a ServerMessage entry. type ServerMessage struct { OnClientSide bool // Message can be a proto.Message or []byte. Other messages formats are not // supported. Message any } func (c *ServerMessage) toProto() *binlogpb.GrpcLogEntry { var ( data []byte err error ) if m, ok := c.Message.(proto.Message); ok { data, err = proto.Marshal(m) if err != nil { grpclogLogger.Infof("binarylogging: failed to marshal proto message: %v", err) } } else if b, ok := c.Message.([]byte); ok { data = b } else { grpclogLogger.Infof("binarylogging: message to log is neither proto.message nor []byte") } ret := &binlogpb.GrpcLogEntry{ Type: binlogpb.GrpcLogEntry_EVENT_TYPE_SERVER_MESSAGE, Payload: &binlogpb.GrpcLogEntry_Message{ Message: &binlogpb.Message{ Length: uint32(len(data)), Data: data, }, }, } if c.OnClientSide { ret.Logger = binlogpb.GrpcLogEntry_LOGGER_CLIENT } else { ret.Logger = binlogpb.GrpcLogEntry_LOGGER_SERVER } return ret } // ClientHalfClose configs the binary log entry to be a ClientHalfClose entry. type ClientHalfClose struct { OnClientSide bool } func (c *ClientHalfClose) toProto() *binlogpb.GrpcLogEntry { ret := &binlogpb.GrpcLogEntry{ Type: binlogpb.GrpcLogEntry_EVENT_TYPE_CLIENT_HALF_CLOSE, Payload: nil, // No payload here. } if c.OnClientSide { ret.Logger = binlogpb.GrpcLogEntry_LOGGER_CLIENT } else { ret.Logger = binlogpb.GrpcLogEntry_LOGGER_SERVER } return ret } // ServerTrailer configs the binary log entry to be a ServerTrailer entry. type ServerTrailer struct { OnClientSide bool Trailer metadata.MD // Err is the status error. Err error // PeerAddr is required only when it's on client side and the RPC is trailer // only. PeerAddr net.Addr } func (c *ServerTrailer) toProto() *binlogpb.GrpcLogEntry { st, ok := status.FromError(c.Err) if !ok { grpclogLogger.Info("binarylogging: error in trailer is not a status error") } var ( detailsBytes []byte err error ) stProto := st.Proto() if stProto != nil && len(stProto.Details) != 0 { detailsBytes, err = proto.Marshal(stProto) if err != nil { grpclogLogger.Infof("binarylogging: failed to marshal status proto: %v", err) } } ret := &binlogpb.GrpcLogEntry{ Type: binlogpb.GrpcLogEntry_EVENT_TYPE_SERVER_TRAILER, Payload: &binlogpb.GrpcLogEntry_Trailer{ Trailer: &binlogpb.Trailer{ Metadata: mdToMetadataProto(c.Trailer), StatusCode: uint32(st.Code()), StatusMessage: st.Message(), StatusDetails: detailsBytes, }, }, } if c.OnClientSide { ret.Logger = binlogpb.GrpcLogEntry_LOGGER_CLIENT } else { ret.Logger = binlogpb.GrpcLogEntry_LOGGER_SERVER } if c.PeerAddr != nil { ret.Peer = addrToProto(c.PeerAddr) } return ret } // Cancel configs the binary log entry to be a Cancel entry. type Cancel struct { OnClientSide bool } func (c *Cancel) toProto() *binlogpb.GrpcLogEntry { ret := &binlogpb.GrpcLogEntry{ Type: binlogpb.GrpcLogEntry_EVENT_TYPE_CANCEL, Payload: nil, } if c.OnClientSide { ret.Logger = binlogpb.GrpcLogEntry_LOGGER_CLIENT } else { ret.Logger = binlogpb.GrpcLogEntry_LOGGER_SERVER } return ret } // metadataKeyOmit returns whether the metadata entry with this key should be // omitted. func metadataKeyOmit(key string) bool { switch key { case "lb-token", ":path", ":authority", "content-encoding", "content-type", "user-agent", "te": return true case "grpc-trace-bin": // grpc-trace-bin is special because it's visible to users. return false } return strings.HasPrefix(key, "grpc-") } func mdToMetadataProto(md metadata.MD) *binlogpb.Metadata { ret := &binlogpb.Metadata{} for k, vv := range md { if metadataKeyOmit(k) { continue } for _, v := range vv { ret.Entry = append(ret.Entry, &binlogpb.MetadataEntry{ Key: k, Value: []byte(v), }, ) } } return ret } func addrToProto(addr net.Addr) *binlogpb.Address { ret := &binlogpb.Address{} switch a := addr.(type) { case *net.TCPAddr: if a.IP.To4() != nil { ret.Type = binlogpb.Address_TYPE_IPV4 } else if a.IP.To16() != nil { ret.Type = binlogpb.Address_TYPE_IPV6 } else { ret.Type = binlogpb.Address_TYPE_UNKNOWN // Do not set address and port fields. break } ret.Address = a.IP.String() ret.IpPort = uint32(a.Port) case *net.UnixAddr: ret.Type = binlogpb.Address_TYPE_UNIX ret.Address = a.String() default: ret.Type = binlogpb.Address_TYPE_UNKNOWN } return ret } ================================================ FILE: vendor/google.golang.org/grpc/internal/binarylog/sink.go ================================================ /* * * Copyright 2018 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package binarylog import ( "bufio" "encoding/binary" "io" "sync" "time" binlogpb "google.golang.org/grpc/binarylog/grpc_binarylog_v1" "google.golang.org/protobuf/proto" ) var ( // DefaultSink is the sink where the logs will be written to. It's exported // for the binarylog package to update. DefaultSink Sink = &noopSink{} // TODO(blog): change this default (file in /tmp). ) // Sink writes log entry into the binary log sink. // // sink is a copy of the exported binarylog.Sink, to avoid circular dependency. type Sink interface { // Write will be called to write the log entry into the sink. // // It should be thread-safe so it can be called in parallel. Write(*binlogpb.GrpcLogEntry) error // Close will be called when the Sink is replaced by a new Sink. Close() error } type noopSink struct{} func (ns *noopSink) Write(*binlogpb.GrpcLogEntry) error { return nil } func (ns *noopSink) Close() error { return nil } // newWriterSink creates a binary log sink with the given writer. // // Write() marshals the proto message and writes it to the given writer. Each // message is prefixed with a 4 byte big endian unsigned integer as the length. // // No buffer is done, Close() doesn't try to close the writer. func newWriterSink(w io.Writer) Sink { return &writerSink{out: w} } type writerSink struct { out io.Writer } func (ws *writerSink) Write(e *binlogpb.GrpcLogEntry) error { b, err := proto.Marshal(e) if err != nil { grpclogLogger.Errorf("binary logging: failed to marshal proto message: %v", err) return err } hdr := make([]byte, 4) binary.BigEndian.PutUint32(hdr, uint32(len(b))) if _, err := ws.out.Write(hdr); err != nil { return err } if _, err := ws.out.Write(b); err != nil { return err } return nil } func (ws *writerSink) Close() error { return nil } type bufferedSink struct { mu sync.Mutex closer io.Closer out Sink // out is built on buf. buf *bufio.Writer // buf is kept for flush. flusherStarted bool writeTicker *time.Ticker done chan struct{} } func (fs *bufferedSink) Write(e *binlogpb.GrpcLogEntry) error { fs.mu.Lock() defer fs.mu.Unlock() if !fs.flusherStarted { // Start the write loop when Write is called. fs.startFlushGoroutine() fs.flusherStarted = true } if err := fs.out.Write(e); err != nil { return err } return nil } const ( bufFlushDuration = 60 * time.Second ) func (fs *bufferedSink) startFlushGoroutine() { fs.writeTicker = time.NewTicker(bufFlushDuration) go func() { for { select { case <-fs.done: return case <-fs.writeTicker.C: } fs.mu.Lock() if err := fs.buf.Flush(); err != nil { grpclogLogger.Warningf("failed to flush to Sink: %v", err) } fs.mu.Unlock() } }() } func (fs *bufferedSink) Close() error { fs.mu.Lock() defer fs.mu.Unlock() if fs.writeTicker != nil { fs.writeTicker.Stop() } close(fs.done) if err := fs.buf.Flush(); err != nil { grpclogLogger.Warningf("failed to flush to Sink: %v", err) } if err := fs.closer.Close(); err != nil { grpclogLogger.Warningf("failed to close the underlying WriterCloser: %v", err) } if err := fs.out.Close(); err != nil { grpclogLogger.Warningf("failed to close the Sink: %v", err) } return nil } // NewBufferedSink creates a binary log sink with the given WriteCloser. // // Write() marshals the proto message and writes it to the given writer. Each // message is prefixed with a 4 byte big endian unsigned integer as the length. // // Content is kept in a buffer, and is flushed every 60 seconds. // // Close closes the WriteCloser. func NewBufferedSink(o io.WriteCloser) Sink { bufW := bufio.NewWriter(o) return &bufferedSink{ closer: o, out: newWriterSink(bufW), buf: bufW, done: make(chan struct{}), } } ================================================ FILE: vendor/google.golang.org/grpc/internal/buffer/unbounded.go ================================================ /* * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package buffer provides an implementation of an unbounded buffer. package buffer import ( "errors" "sync" ) // Unbounded is an implementation of an unbounded buffer which does not use // extra goroutines. This is typically used for passing updates from one entity // to another within gRPC. // // All methods on this type are thread-safe and don't block on anything except // the underlying mutex used for synchronization. // // Unbounded supports values of any type to be stored in it by using a channel // of `any`. This means that a call to Put() incurs an extra memory allocation, // and also that users need a type assertion while reading. For performance // critical code paths, using Unbounded is strongly discouraged and defining a // new type specific implementation of this buffer is preferred. See // internal/transport/transport.go for an example of this. type Unbounded struct { c chan any closed bool closing bool mu sync.Mutex backlog []any } // NewUnbounded returns a new instance of Unbounded. func NewUnbounded() *Unbounded { return &Unbounded{c: make(chan any, 1)} } var errBufferClosed = errors.New("Put called on closed buffer.Unbounded") // Put adds t to the unbounded buffer. func (b *Unbounded) Put(t any) error { b.mu.Lock() defer b.mu.Unlock() if b.closing { return errBufferClosed } if len(b.backlog) == 0 { select { case b.c <- t: return nil default: } } b.backlog = append(b.backlog, t) return nil } // Load sends the earliest buffered data, if any, onto the read channel returned // by Get(). Users are expected to call this every time they successfully read a // value from the read channel. func (b *Unbounded) Load() { b.mu.Lock() defer b.mu.Unlock() if len(b.backlog) > 0 { select { case b.c <- b.backlog[0]: b.backlog[0] = nil b.backlog = b.backlog[1:] default: } } else if b.closing && !b.closed { b.closed = true close(b.c) } } // Get returns a read channel on which values added to the buffer, via Put(), // are sent on. // // Upon reading a value from this channel, users are expected to call Load() to // send the next buffered value onto the channel if there is any. // // If the unbounded buffer is closed, the read channel returned by this method // is closed after all data is drained. func (b *Unbounded) Get() <-chan any { return b.c } // Close closes the unbounded buffer. No subsequent data may be Put(), and the // channel returned from Get() will be closed after all the data is read and // Load() is called for the final time. func (b *Unbounded) Close() { b.mu.Lock() defer b.mu.Unlock() if b.closing { return } b.closing = true if len(b.backlog) == 0 { b.closed = true close(b.c) } } ================================================ FILE: vendor/google.golang.org/grpc/internal/channelz/channel.go ================================================ /* * * Copyright 2024 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package channelz import ( "fmt" "sync/atomic" "google.golang.org/grpc/connectivity" ) // Channel represents a channel within channelz, which includes metrics and // internal channelz data, such as channelz id, child list, etc. type Channel struct { Entity // ID is the channelz id of this channel. ID int64 // RefName is the human readable reference string of this channel. RefName string closeCalled bool nestedChans map[int64]string subChans map[int64]string Parent *Channel trace *ChannelTrace // traceRefCount is the number of trace events that reference this channel. // Non-zero traceRefCount means the trace of this channel cannot be deleted. traceRefCount int32 // ChannelMetrics holds connectivity state, target and call metrics for the // channel within channelz. ChannelMetrics ChannelMetrics } // Implemented to make Channel implement the Identifier interface used for // nesting. func (c *Channel) channelzIdentifier() {} // String returns a string representation of the Channel, including its parent // entity and ID. func (c *Channel) String() string { if c.Parent == nil { return fmt.Sprintf("Channel #%d", c.ID) } return fmt.Sprintf("%s Channel #%d", c.Parent, c.ID) } func (c *Channel) id() int64 { return c.ID } // SubChans returns a copy of the map of sub-channels associated with the // Channel. func (c *Channel) SubChans() map[int64]string { db.mu.RLock() defer db.mu.RUnlock() return copyMap(c.subChans) } // NestedChans returns a copy of the map of nested channels associated with the // Channel. func (c *Channel) NestedChans() map[int64]string { db.mu.RLock() defer db.mu.RUnlock() return copyMap(c.nestedChans) } // Trace returns a copy of the Channel's trace data. func (c *Channel) Trace() *ChannelTrace { db.mu.RLock() defer db.mu.RUnlock() return c.trace.copy() } // ChannelMetrics holds connectivity state, target and call metrics for the // channel within channelz. type ChannelMetrics struct { // The current connectivity state of the channel. State atomic.Pointer[connectivity.State] // The target this channel originally tried to connect to. May be absent Target atomic.Pointer[string] // The number of calls started on the channel. CallsStarted atomic.Int64 // The number of calls that have completed with an OK status. CallsSucceeded atomic.Int64 // The number of calls that have a completed with a non-OK status. CallsFailed atomic.Int64 // The last time a call was started on the channel. LastCallStartedTimestamp atomic.Int64 } // CopyFrom copies the metrics in o to c. For testing only. func (c *ChannelMetrics) CopyFrom(o *ChannelMetrics) { c.State.Store(o.State.Load()) c.Target.Store(o.Target.Load()) c.CallsStarted.Store(o.CallsStarted.Load()) c.CallsSucceeded.Store(o.CallsSucceeded.Load()) c.CallsFailed.Store(o.CallsFailed.Load()) c.LastCallStartedTimestamp.Store(o.LastCallStartedTimestamp.Load()) } // Equal returns true iff the metrics of c are the same as the metrics of o. // For testing only. func (c *ChannelMetrics) Equal(o any) bool { oc, ok := o.(*ChannelMetrics) if !ok { return false } if (c.State.Load() == nil) != (oc.State.Load() == nil) { return false } if c.State.Load() != nil && *c.State.Load() != *oc.State.Load() { return false } if (c.Target.Load() == nil) != (oc.Target.Load() == nil) { return false } if c.Target.Load() != nil && *c.Target.Load() != *oc.Target.Load() { return false } return c.CallsStarted.Load() == oc.CallsStarted.Load() && c.CallsFailed.Load() == oc.CallsFailed.Load() && c.CallsSucceeded.Load() == oc.CallsSucceeded.Load() && c.LastCallStartedTimestamp.Load() == oc.LastCallStartedTimestamp.Load() } func strFromPointer(s *string) string { if s == nil { return "" } return *s } // String returns a string representation of the ChannelMetrics, including its // state, target, and call metrics. func (c *ChannelMetrics) String() string { return fmt.Sprintf("State: %v, Target: %s, CallsStarted: %v, CallsSucceeded: %v, CallsFailed: %v, LastCallStartedTimestamp: %v", c.State.Load(), strFromPointer(c.Target.Load()), c.CallsStarted.Load(), c.CallsSucceeded.Load(), c.CallsFailed.Load(), c.LastCallStartedTimestamp.Load(), ) } // NewChannelMetricForTesting creates a new instance of ChannelMetrics with // specified initial values for testing purposes. func NewChannelMetricForTesting(state connectivity.State, target string, started, succeeded, failed, timestamp int64) *ChannelMetrics { c := &ChannelMetrics{} c.State.Store(&state) c.Target.Store(&target) c.CallsStarted.Store(started) c.CallsSucceeded.Store(succeeded) c.CallsFailed.Store(failed) c.LastCallStartedTimestamp.Store(timestamp) return c } func (c *Channel) addChild(id int64, e entry) { switch v := e.(type) { case *SubChannel: c.subChans[id] = v.RefName case *Channel: c.nestedChans[id] = v.RefName default: logger.Errorf("cannot add a child (id = %d) of type %T to a channel", id, e) } } func (c *Channel) deleteChild(id int64) { delete(c.subChans, id) delete(c.nestedChans, id) c.deleteSelfIfReady() } func (c *Channel) triggerDelete() { c.closeCalled = true c.deleteSelfIfReady() } func (c *Channel) getParentID() int64 { if c.Parent == nil { return -1 } return c.Parent.ID } // deleteSelfFromTree tries to delete the channel from the channelz entry relation tree, which means // deleting the channel reference from its parent's child list. // // In order for a channel to be deleted from the tree, it must meet the criteria that, removal of the // corresponding grpc object has been invoked, and the channel does not have any children left. // // The returned boolean value indicates whether the channel has been successfully deleted from tree. func (c *Channel) deleteSelfFromTree() (deleted bool) { if !c.closeCalled || len(c.subChans)+len(c.nestedChans) != 0 { return false } // not top channel if c.Parent != nil { c.Parent.deleteChild(c.ID) } return true } // deleteSelfFromMap checks whether it is valid to delete the channel from the map, which means // deleting the channel from channelz's tracking entirely. Users can no longer use id to query the // channel, and its memory will be garbage collected. // // The trace reference count of the channel must be 0 in order to be deleted from the map. This is // specified in the channel tracing gRFC that as long as some other trace has reference to an entity, // the trace of the referenced entity must not be deleted. In order to release the resource allocated // by grpc, the reference to the grpc object is reset to a dummy object. // // deleteSelfFromMap must be called after deleteSelfFromTree returns true. // // It returns a bool to indicate whether the channel can be safely deleted from map. func (c *Channel) deleteSelfFromMap() (delete bool) { return c.getTraceRefCount() == 0 } // deleteSelfIfReady tries to delete the channel itself from the channelz database. // The delete process includes two steps: // 1. delete the channel from the entry relation tree, i.e. delete the channel reference from its // parent's child list. // 2. delete the channel from the map, i.e. delete the channel entirely from channelz. Lookup by id // will return entry not found error. func (c *Channel) deleteSelfIfReady() { if !c.deleteSelfFromTree() { return } if !c.deleteSelfFromMap() { return } db.deleteEntry(c.ID) c.trace.clear() } func (c *Channel) getChannelTrace() *ChannelTrace { return c.trace } func (c *Channel) incrTraceRefCount() { atomic.AddInt32(&c.traceRefCount, 1) } func (c *Channel) decrTraceRefCount() { atomic.AddInt32(&c.traceRefCount, -1) } func (c *Channel) getTraceRefCount() int { i := atomic.LoadInt32(&c.traceRefCount) return int(i) } func (c *Channel) getRefName() string { return c.RefName } ================================================ FILE: vendor/google.golang.org/grpc/internal/channelz/channelmap.go ================================================ /* * * Copyright 2018 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package channelz import ( "fmt" "sort" "sync" "time" ) // entry represents a node in the channelz database. type entry interface { // addChild adds a child e, whose channelz id is id to child list addChild(id int64, e entry) // deleteChild deletes a child with channelz id to be id from child list deleteChild(id int64) // triggerDelete tries to delete self from channelz database. However, if // child list is not empty, then deletion from the database is on hold until // the last child is deleted from database. triggerDelete() // deleteSelfIfReady check whether triggerDelete() has been called before, // and whether child list is now empty. If both conditions are met, then // delete self from database. deleteSelfIfReady() // getParentID returns parent ID of the entry. 0 value parent ID means no parent. getParentID() int64 Entity } // channelMap is the storage data structure for channelz. // // Methods of channelMap can be divided into two categories with respect to // locking. // // 1. Methods acquire the global lock. // 2. Methods that can only be called when global lock is held. // // A second type of method need always to be called inside a first type of method. type channelMap struct { mu sync.RWMutex topLevelChannels map[int64]struct{} channels map[int64]*Channel subChannels map[int64]*SubChannel sockets map[int64]*Socket servers map[int64]*Server } func newChannelMap() *channelMap { return &channelMap{ topLevelChannels: make(map[int64]struct{}), channels: make(map[int64]*Channel), subChannels: make(map[int64]*SubChannel), sockets: make(map[int64]*Socket), servers: make(map[int64]*Server), } } func (c *channelMap) addServer(id int64, s *Server) { c.mu.Lock() defer c.mu.Unlock() s.cm = c c.servers[id] = s } func (c *channelMap) addChannel(id int64, cn *Channel, isTopChannel bool, pid int64) { c.mu.Lock() defer c.mu.Unlock() cn.trace.cm = c c.channels[id] = cn if isTopChannel { c.topLevelChannels[id] = struct{}{} } else if p := c.channels[pid]; p != nil { p.addChild(id, cn) } else { logger.Infof("channel %d references invalid parent ID %d", id, pid) } } func (c *channelMap) addSubChannel(id int64, sc *SubChannel, pid int64) { c.mu.Lock() defer c.mu.Unlock() sc.trace.cm = c c.subChannels[id] = sc if p := c.channels[pid]; p != nil { p.addChild(id, sc) } else { logger.Infof("subchannel %d references invalid parent ID %d", id, pid) } } func (c *channelMap) addSocket(s *Socket) { c.mu.Lock() defer c.mu.Unlock() s.cm = c c.sockets[s.ID] = s if s.Parent == nil { logger.Infof("normal socket %d has no parent", s.ID) } s.Parent.(entry).addChild(s.ID, s) } // removeEntry triggers the removal of an entry, which may not indeed delete the // entry, if it has to wait on the deletion of its children and until no other // entity's channel trace references it. It may lead to a chain of entry // deletion. For example, deleting the last socket of a gracefully shutting down // server will lead to the server being also deleted. func (c *channelMap) removeEntry(id int64) { c.mu.Lock() defer c.mu.Unlock() c.findEntry(id).triggerDelete() } // tracedChannel represents tracing operations which are present on both // channels and subChannels. type tracedChannel interface { getChannelTrace() *ChannelTrace incrTraceRefCount() decrTraceRefCount() getRefName() string } // c.mu must be held by the caller func (c *channelMap) decrTraceRefCount(id int64) { e := c.findEntry(id) if v, ok := e.(tracedChannel); ok { v.decrTraceRefCount() e.deleteSelfIfReady() } } // c.mu must be held by the caller. func (c *channelMap) findEntry(id int64) entry { if v, ok := c.channels[id]; ok { return v } if v, ok := c.subChannels[id]; ok { return v } if v, ok := c.servers[id]; ok { return v } if v, ok := c.sockets[id]; ok { return v } return &dummyEntry{idNotFound: id} } // c.mu must be held by the caller // // deleteEntry deletes an entry from the channelMap. Before calling this method, // caller must check this entry is ready to be deleted, i.e removeEntry() has // been called on it, and no children still exist. func (c *channelMap) deleteEntry(id int64) entry { if v, ok := c.sockets[id]; ok { delete(c.sockets, id) return v } if v, ok := c.subChannels[id]; ok { delete(c.subChannels, id) return v } if v, ok := c.channels[id]; ok { delete(c.channels, id) delete(c.topLevelChannels, id) return v } if v, ok := c.servers[id]; ok { delete(c.servers, id) return v } return &dummyEntry{idNotFound: id} } func (c *channelMap) traceEvent(id int64, desc *TraceEvent) { c.mu.Lock() defer c.mu.Unlock() child := c.findEntry(id) childTC, ok := child.(tracedChannel) if !ok { return } childTC.getChannelTrace().append(&traceEvent{Desc: desc.Desc, Severity: desc.Severity, Timestamp: time.Now()}) if desc.Parent != nil { parent := c.findEntry(child.getParentID()) var chanType RefChannelType switch child.(type) { case *Channel: chanType = RefChannel case *SubChannel: chanType = RefSubChannel } if parentTC, ok := parent.(tracedChannel); ok { parentTC.getChannelTrace().append(&traceEvent{ Desc: desc.Parent.Desc, Severity: desc.Parent.Severity, Timestamp: time.Now(), RefID: id, RefName: childTC.getRefName(), RefType: chanType, }) childTC.incrTraceRefCount() } } } type int64Slice []int64 func (s int64Slice) Len() int { return len(s) } func (s int64Slice) Swap(i, j int) { s[i], s[j] = s[j], s[i] } func (s int64Slice) Less(i, j int) bool { return s[i] < s[j] } func copyMap(m map[int64]string) map[int64]string { n := make(map[int64]string) for k, v := range m { n[k] = v } return n } func (c *channelMap) getTopChannels(id int64, maxResults int) ([]*Channel, bool) { if maxResults <= 0 { maxResults = EntriesPerPage } c.mu.RLock() defer c.mu.RUnlock() l := int64(len(c.topLevelChannels)) ids := make([]int64, 0, l) for k := range c.topLevelChannels { ids = append(ids, k) } sort.Sort(int64Slice(ids)) idx := sort.Search(len(ids), func(i int) bool { return ids[i] >= id }) end := true var t []*Channel for _, v := range ids[idx:] { if len(t) == maxResults { end = false break } if cn, ok := c.channels[v]; ok { t = append(t, cn) } } return t, end } func (c *channelMap) getServers(id int64, maxResults int) ([]*Server, bool) { if maxResults <= 0 { maxResults = EntriesPerPage } c.mu.RLock() defer c.mu.RUnlock() ids := make([]int64, 0, len(c.servers)) for k := range c.servers { ids = append(ids, k) } sort.Sort(int64Slice(ids)) idx := sort.Search(len(ids), func(i int) bool { return ids[i] >= id }) end := true var s []*Server for _, v := range ids[idx:] { if len(s) == maxResults { end = false break } if svr, ok := c.servers[v]; ok { s = append(s, svr) } } return s, end } func (c *channelMap) getServerSockets(id int64, startID int64, maxResults int) ([]*Socket, bool) { if maxResults <= 0 { maxResults = EntriesPerPage } c.mu.RLock() defer c.mu.RUnlock() svr, ok := c.servers[id] if !ok { // server with id doesn't exist. return nil, true } svrskts := svr.sockets ids := make([]int64, 0, len(svrskts)) sks := make([]*Socket, 0, min(len(svrskts), maxResults)) for k := range svrskts { ids = append(ids, k) } sort.Sort(int64Slice(ids)) idx := sort.Search(len(ids), func(i int) bool { return ids[i] >= startID }) end := true for _, v := range ids[idx:] { if len(sks) == maxResults { end = false break } if ns, ok := c.sockets[v]; ok { sks = append(sks, ns) } } return sks, end } func (c *channelMap) getChannel(id int64) *Channel { c.mu.RLock() defer c.mu.RUnlock() return c.channels[id] } func (c *channelMap) getSubChannel(id int64) *SubChannel { c.mu.RLock() defer c.mu.RUnlock() return c.subChannels[id] } func (c *channelMap) getSocket(id int64) *Socket { c.mu.RLock() defer c.mu.RUnlock() return c.sockets[id] } func (c *channelMap) getServer(id int64) *Server { c.mu.RLock() defer c.mu.RUnlock() return c.servers[id] } type dummyEntry struct { // dummyEntry is a fake entry to handle entry not found case. idNotFound int64 Entity } func (d *dummyEntry) String() string { return fmt.Sprintf("non-existent entity #%d", d.idNotFound) } func (d *dummyEntry) ID() int64 { return d.idNotFound } func (d *dummyEntry) addChild(id int64, e entry) { // Note: It is possible for a normal program to reach here under race // condition. For example, there could be a race between ClientConn.Close() // info being propagated to addrConn and http2Client. ClientConn.Close() // cancel the context and result in http2Client to error. The error info is // then caught by transport monitor and before addrConn.tearDown() is called // in side ClientConn.Close(). Therefore, the addrConn will create a new // transport. And when registering the new transport in channelz, its parent // addrConn could have already been torn down and deleted from channelz // tracking, and thus reach the code here. logger.Infof("attempt to add child of type %T with id %d to a parent (id=%d) that doesn't currently exist", e, id, d.idNotFound) } func (d *dummyEntry) deleteChild(id int64) { // It is possible for a normal program to reach here under race condition. // Refer to the example described in addChild(). logger.Infof("attempt to delete child with id %d from a parent (id=%d) that doesn't currently exist", id, d.idNotFound) } func (d *dummyEntry) triggerDelete() { logger.Warningf("attempt to delete an entry (id=%d) that doesn't currently exist", d.idNotFound) } func (*dummyEntry) deleteSelfIfReady() { // code should not reach here. deleteSelfIfReady is always called on an existing entry. } func (*dummyEntry) getParentID() int64 { return 0 } // Entity is implemented by all channelz types. type Entity interface { isEntity() fmt.Stringer id() int64 } ================================================ FILE: vendor/google.golang.org/grpc/internal/channelz/funcs.go ================================================ /* * * Copyright 2018 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package channelz defines internal APIs for enabling channelz service, entry // registration/deletion, and accessing channelz data. It also defines channelz // metric struct formats. package channelz import ( "sync/atomic" "time" "google.golang.org/grpc/internal" ) var ( // IDGen is the global channelz entity ID generator. It should not be used // outside this package except by tests. IDGen IDGenerator db = newChannelMap() // EntriesPerPage defines the number of channelz entries to be shown on a web page. EntriesPerPage = 50 curState int32 ) // TurnOn turns on channelz data collection. func TurnOn() { atomic.StoreInt32(&curState, 1) } func init() { internal.ChannelzTurnOffForTesting = func() { atomic.StoreInt32(&curState, 0) } } // IsOn returns whether channelz data collection is on. func IsOn() bool { return atomic.LoadInt32(&curState) == 1 } // GetTopChannels returns a slice of top channel's ChannelMetric, along with a // boolean indicating whether there's more top channels to be queried for. // // The arg id specifies that only top channel with id at or above it will be // included in the result. The returned slice is up to a length of the arg // maxResults or EntriesPerPage if maxResults is zero, and is sorted in ascending // id order. func GetTopChannels(id int64, maxResults int) ([]*Channel, bool) { return db.getTopChannels(id, maxResults) } // GetServers returns a slice of server's ServerMetric, along with a // boolean indicating whether there's more servers to be queried for. // // The arg id specifies that only server with id at or above it will be included // in the result. The returned slice is up to a length of the arg maxResults or // EntriesPerPage if maxResults is zero, and is sorted in ascending id order. func GetServers(id int64, maxResults int) ([]*Server, bool) { return db.getServers(id, maxResults) } // GetServerSockets returns a slice of server's (identified by id) normal socket's // SocketMetrics, along with a boolean indicating whether there's more sockets to // be queried for. // // The arg startID specifies that only sockets with id at or above it will be // included in the result. The returned slice is up to a length of the arg maxResults // or EntriesPerPage if maxResults is zero, and is sorted in ascending id order. func GetServerSockets(id int64, startID int64, maxResults int) ([]*Socket, bool) { return db.getServerSockets(id, startID, maxResults) } // GetChannel returns the Channel for the channel (identified by id). func GetChannel(id int64) *Channel { return db.getChannel(id) } // GetSubChannel returns the SubChannel for the subchannel (identified by id). func GetSubChannel(id int64) *SubChannel { return db.getSubChannel(id) } // GetSocket returns the Socket for the socket (identified by id). func GetSocket(id int64) *Socket { return db.getSocket(id) } // GetServer returns the ServerMetric for the server (identified by id). func GetServer(id int64) *Server { return db.getServer(id) } // RegisterChannel registers the given channel c in the channelz database with // target as its target and reference name, and adds it to the child list of its // parent. parent == nil means no parent. // // Returns a unique channelz identifier assigned to this channel. // // If channelz is not turned ON, the channelz database is not mutated. func RegisterChannel(parent *Channel, target string) *Channel { id := IDGen.genID() if !IsOn() { return &Channel{ID: id} } isTopChannel := parent == nil cn := &Channel{ ID: id, RefName: target, nestedChans: make(map[int64]string), subChans: make(map[int64]string), Parent: parent, trace: &ChannelTrace{CreationTime: time.Now(), Events: make([]*traceEvent, 0, getMaxTraceEntry())}, } cn.ChannelMetrics.Target.Store(&target) db.addChannel(id, cn, isTopChannel, cn.getParentID()) return cn } // RegisterSubChannel registers the given subChannel c in the channelz database // with ref as its reference name, and adds it to the child list of its parent // (identified by pid). // // Returns a unique channelz identifier assigned to this subChannel. // // If channelz is not turned ON, the channelz database is not mutated. func RegisterSubChannel(parent *Channel, ref string) *SubChannel { id := IDGen.genID() sc := &SubChannel{ ID: id, RefName: ref, parent: parent, } if !IsOn() { return sc } sc.sockets = make(map[int64]string) sc.trace = &ChannelTrace{CreationTime: time.Now(), Events: make([]*traceEvent, 0, getMaxTraceEntry())} db.addSubChannel(id, sc, parent.ID) return sc } // RegisterServer registers the given server s in channelz database. It returns // the unique channelz tracking id assigned to this server. // // If channelz is not turned ON, the channelz database is not mutated. func RegisterServer(ref string) *Server { id := IDGen.genID() if !IsOn() { return &Server{ID: id} } svr := &Server{ RefName: ref, sockets: make(map[int64]string), listenSockets: make(map[int64]string), ID: id, } db.addServer(id, svr) return svr } // RegisterSocket registers the given normal socket s in channelz database // with ref as its reference name, and adds it to the child list of its parent // (identified by skt.Parent, which must be set). It returns the unique channelz // tracking id assigned to this normal socket. // // If channelz is not turned ON, the channelz database is not mutated. func RegisterSocket(skt *Socket) *Socket { skt.ID = IDGen.genID() if IsOn() { db.addSocket(skt) } return skt } // RemoveEntry removes an entry with unique channelz tracking id to be id from // channelz database. // // If channelz is not turned ON, this function is a no-op. func RemoveEntry(id int64) { if !IsOn() { return } db.removeEntry(id) } // IDGenerator is an incrementing atomic that tracks IDs for channelz entities. type IDGenerator struct { id int64 } // Reset resets the generated ID back to zero. Should only be used at // initialization or by tests sensitive to the ID number. func (i *IDGenerator) Reset() { atomic.StoreInt64(&i.id, 0) } func (i *IDGenerator) genID() int64 { return atomic.AddInt64(&i.id, 1) } // Identifier is an opaque channelz identifier used to expose channelz symbols // outside of grpc. Currently only implemented by Channel since no other // types require exposure outside grpc. type Identifier interface { Entity channelzIdentifier() } ================================================ FILE: vendor/google.golang.org/grpc/internal/channelz/logging.go ================================================ /* * * Copyright 2020 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package channelz import ( "fmt" "google.golang.org/grpc/grpclog" ) var logger = grpclog.Component("channelz") // Info logs and adds a trace event if channelz is on. func Info(l grpclog.DepthLoggerV2, e Entity, args ...any) { AddTraceEvent(l, e, 1, &TraceEvent{ Desc: fmt.Sprint(args...), Severity: CtInfo, }) } // Infof logs and adds a trace event if channelz is on. func Infof(l grpclog.DepthLoggerV2, e Entity, format string, args ...any) { AddTraceEvent(l, e, 1, &TraceEvent{ Desc: fmt.Sprintf(format, args...), Severity: CtInfo, }) } // Warning logs and adds a trace event if channelz is on. func Warning(l grpclog.DepthLoggerV2, e Entity, args ...any) { AddTraceEvent(l, e, 1, &TraceEvent{ Desc: fmt.Sprint(args...), Severity: CtWarning, }) } // Warningf logs and adds a trace event if channelz is on. func Warningf(l grpclog.DepthLoggerV2, e Entity, format string, args ...any) { AddTraceEvent(l, e, 1, &TraceEvent{ Desc: fmt.Sprintf(format, args...), Severity: CtWarning, }) } // Error logs and adds a trace event if channelz is on. func Error(l grpclog.DepthLoggerV2, e Entity, args ...any) { AddTraceEvent(l, e, 1, &TraceEvent{ Desc: fmt.Sprint(args...), Severity: CtError, }) } // Errorf logs and adds a trace event if channelz is on. func Errorf(l grpclog.DepthLoggerV2, e Entity, format string, args ...any) { AddTraceEvent(l, e, 1, &TraceEvent{ Desc: fmt.Sprintf(format, args...), Severity: CtError, }) } ================================================ FILE: vendor/google.golang.org/grpc/internal/channelz/server.go ================================================ /* * * Copyright 2024 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package channelz import ( "fmt" "sync/atomic" ) // Server is the channelz representation of a server. type Server struct { Entity ID int64 RefName string ServerMetrics ServerMetrics closeCalled bool sockets map[int64]string listenSockets map[int64]string cm *channelMap } // ServerMetrics defines a struct containing metrics for servers. type ServerMetrics struct { // The number of incoming calls started on the server. CallsStarted atomic.Int64 // The number of incoming calls that have completed with an OK status. CallsSucceeded atomic.Int64 // The number of incoming calls that have a completed with a non-OK status. CallsFailed atomic.Int64 // The last time a call was started on the server. LastCallStartedTimestamp atomic.Int64 } // NewServerMetricsForTesting returns an initialized ServerMetrics. func NewServerMetricsForTesting(started, succeeded, failed, timestamp int64) *ServerMetrics { sm := &ServerMetrics{} sm.CallsStarted.Store(started) sm.CallsSucceeded.Store(succeeded) sm.CallsFailed.Store(failed) sm.LastCallStartedTimestamp.Store(timestamp) return sm } // CopyFrom copies the metrics data from the provided ServerMetrics // instance into the current instance. func (sm *ServerMetrics) CopyFrom(o *ServerMetrics) { sm.CallsStarted.Store(o.CallsStarted.Load()) sm.CallsSucceeded.Store(o.CallsSucceeded.Load()) sm.CallsFailed.Store(o.CallsFailed.Load()) sm.LastCallStartedTimestamp.Store(o.LastCallStartedTimestamp.Load()) } // ListenSockets returns the listening sockets for s. func (s *Server) ListenSockets() map[int64]string { db.mu.RLock() defer db.mu.RUnlock() return copyMap(s.listenSockets) } // String returns a printable description of s. func (s *Server) String() string { return fmt.Sprintf("Server #%d", s.ID) } func (s *Server) id() int64 { return s.ID } func (s *Server) addChild(id int64, e entry) { switch v := e.(type) { case *Socket: switch v.SocketType { case SocketTypeNormal: s.sockets[id] = v.RefName case SocketTypeListen: s.listenSockets[id] = v.RefName } default: logger.Errorf("cannot add a child (id = %d) of type %T to a server", id, e) } } func (s *Server) deleteChild(id int64) { delete(s.sockets, id) delete(s.listenSockets, id) s.deleteSelfIfReady() } func (s *Server) triggerDelete() { s.closeCalled = true s.deleteSelfIfReady() } func (s *Server) deleteSelfIfReady() { if !s.closeCalled || len(s.sockets)+len(s.listenSockets) != 0 { return } s.cm.deleteEntry(s.ID) } func (s *Server) getParentID() int64 { return 0 } ================================================ FILE: vendor/google.golang.org/grpc/internal/channelz/socket.go ================================================ /* * * Copyright 2024 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package channelz import ( "fmt" "net" "sync/atomic" "google.golang.org/grpc/credentials" ) // SocketMetrics defines the struct that the implementor of Socket interface // should return from ChannelzMetric(). type SocketMetrics struct { // The number of streams that have been started. StreamsStarted atomic.Int64 // The number of streams that have ended successfully: // On client side, receiving frame with eos bit set. // On server side, sending frame with eos bit set. StreamsSucceeded atomic.Int64 // The number of streams that have ended unsuccessfully: // On client side, termination without receiving frame with eos bit set. // On server side, termination without sending frame with eos bit set. StreamsFailed atomic.Int64 // The number of messages successfully sent on this socket. MessagesSent atomic.Int64 MessagesReceived atomic.Int64 // The number of keep alives sent. This is typically implemented with HTTP/2 // ping messages. KeepAlivesSent atomic.Int64 // The last time a stream was created by this endpoint. Usually unset for // servers. LastLocalStreamCreatedTimestamp atomic.Int64 // The last time a stream was created by the remote endpoint. Usually unset // for clients. LastRemoteStreamCreatedTimestamp atomic.Int64 // The last time a message was sent by this endpoint. LastMessageSentTimestamp atomic.Int64 // The last time a message was received by this endpoint. LastMessageReceivedTimestamp atomic.Int64 } // EphemeralSocketMetrics are metrics that change rapidly and are tracked // outside of channelz. type EphemeralSocketMetrics struct { // The amount of window, granted to the local endpoint by the remote endpoint. // This may be slightly out of date due to network latency. This does NOT // include stream level or TCP level flow control info. LocalFlowControlWindow int64 // The amount of window, granted to the remote endpoint by the local endpoint. // This may be slightly out of date due to network latency. This does NOT // include stream level or TCP level flow control info. RemoteFlowControlWindow int64 } // SocketType represents the type of socket. type SocketType string // SocketType can be one of these. const ( SocketTypeNormal = "NormalSocket" SocketTypeListen = "ListenSocket" ) // Socket represents a socket within channelz which includes socket // metrics and data related to socket activity and provides methods // for managing and interacting with sockets. type Socket struct { Entity SocketType SocketType ID int64 Parent Entity cm *channelMap SocketMetrics SocketMetrics EphemeralMetrics func() *EphemeralSocketMetrics RefName string // The locally bound address. Immutable. LocalAddr net.Addr // The remote bound address. May be absent. Immutable. RemoteAddr net.Addr // Optional, represents the name of the remote endpoint, if different than // the original target name. Immutable. RemoteName string // Immutable. SocketOptions *SocketOptionData // Immutable. Security credentials.ChannelzSecurityValue } // String returns a string representation of the Socket, including its parent // entity, socket type, and ID. func (ls *Socket) String() string { return fmt.Sprintf("%s %s #%d", ls.Parent, ls.SocketType, ls.ID) } func (ls *Socket) id() int64 { return ls.ID } func (ls *Socket) addChild(id int64, e entry) { logger.Errorf("cannot add a child (id = %d) of type %T to a listen socket", id, e) } func (ls *Socket) deleteChild(id int64) { logger.Errorf("cannot delete a child (id = %d) from a listen socket", id) } func (ls *Socket) triggerDelete() { ls.cm.deleteEntry(ls.ID) ls.Parent.(entry).deleteChild(ls.ID) } func (ls *Socket) deleteSelfIfReady() { logger.Errorf("cannot call deleteSelfIfReady on a listen socket") } func (ls *Socket) getParentID() int64 { return ls.Parent.id() } ================================================ FILE: vendor/google.golang.org/grpc/internal/channelz/subchannel.go ================================================ /* * * Copyright 2024 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package channelz import ( "fmt" "sync/atomic" ) // SubChannel is the channelz representation of a subchannel. type SubChannel struct { Entity // ID is the channelz id of this subchannel. ID int64 // RefName is the human readable reference string of this subchannel. RefName string closeCalled bool sockets map[int64]string parent *Channel trace *ChannelTrace traceRefCount int32 ChannelMetrics ChannelMetrics } func (sc *SubChannel) String() string { return fmt.Sprintf("%s SubChannel #%d", sc.parent, sc.ID) } func (sc *SubChannel) id() int64 { return sc.ID } // Sockets returns a copy of the sockets map associated with the SubChannel. func (sc *SubChannel) Sockets() map[int64]string { db.mu.RLock() defer db.mu.RUnlock() return copyMap(sc.sockets) } // Trace returns a copy of the ChannelTrace associated with the SubChannel. func (sc *SubChannel) Trace() *ChannelTrace { db.mu.RLock() defer db.mu.RUnlock() return sc.trace.copy() } func (sc *SubChannel) addChild(id int64, e entry) { if v, ok := e.(*Socket); ok && v.SocketType == SocketTypeNormal { sc.sockets[id] = v.RefName } else { logger.Errorf("cannot add a child (id = %d) of type %T to a subChannel", id, e) } } func (sc *SubChannel) deleteChild(id int64) { delete(sc.sockets, id) sc.deleteSelfIfReady() } func (sc *SubChannel) triggerDelete() { sc.closeCalled = true sc.deleteSelfIfReady() } func (sc *SubChannel) getParentID() int64 { return sc.parent.ID } // deleteSelfFromTree tries to delete the subchannel from the channelz entry relation tree, which // means deleting the subchannel reference from its parent's child list. // // In order for a subchannel to be deleted from the tree, it must meet the criteria that, removal of // the corresponding grpc object has been invoked, and the subchannel does not have any children left. // // The returned boolean value indicates whether the channel has been successfully deleted from tree. func (sc *SubChannel) deleteSelfFromTree() (deleted bool) { if !sc.closeCalled || len(sc.sockets) != 0 { return false } sc.parent.deleteChild(sc.ID) return true } // deleteSelfFromMap checks whether it is valid to delete the subchannel from the map, which means // deleting the subchannel from channelz's tracking entirely. Users can no longer use id to query // the subchannel, and its memory will be garbage collected. // // The trace reference count of the subchannel must be 0 in order to be deleted from the map. This is // specified in the channel tracing gRFC that as long as some other trace has reference to an entity, // the trace of the referenced entity must not be deleted. In order to release the resource allocated // by grpc, the reference to the grpc object is reset to a dummy object. // // deleteSelfFromMap must be called after deleteSelfFromTree returns true. // // It returns a bool to indicate whether the channel can be safely deleted from map. func (sc *SubChannel) deleteSelfFromMap() (delete bool) { return sc.getTraceRefCount() == 0 } // deleteSelfIfReady tries to delete the subchannel itself from the channelz database. // The delete process includes two steps: // 1. delete the subchannel from the entry relation tree, i.e. delete the subchannel reference from // its parent's child list. // 2. delete the subchannel from the map, i.e. delete the subchannel entirely from channelz. Lookup // by id will return entry not found error. func (sc *SubChannel) deleteSelfIfReady() { if !sc.deleteSelfFromTree() { return } if !sc.deleteSelfFromMap() { return } db.deleteEntry(sc.ID) sc.trace.clear() } func (sc *SubChannel) getChannelTrace() *ChannelTrace { return sc.trace } func (sc *SubChannel) incrTraceRefCount() { atomic.AddInt32(&sc.traceRefCount, 1) } func (sc *SubChannel) decrTraceRefCount() { atomic.AddInt32(&sc.traceRefCount, -1) } func (sc *SubChannel) getTraceRefCount() int { i := atomic.LoadInt32(&sc.traceRefCount) return int(i) } func (sc *SubChannel) getRefName() string { return sc.RefName } ================================================ FILE: vendor/google.golang.org/grpc/internal/channelz/syscall_linux.go ================================================ /* * * Copyright 2018 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package channelz import ( "syscall" "golang.org/x/sys/unix" ) // SocketOptionData defines the struct to hold socket option data, and related // getter function to obtain info from fd. type SocketOptionData struct { Linger *unix.Linger RecvTimeout *unix.Timeval SendTimeout *unix.Timeval TCPInfo *unix.TCPInfo } // Getsockopt defines the function to get socket options requested by channelz. // It is to be passed to syscall.RawConn.Control(). func (s *SocketOptionData) Getsockopt(fd uintptr) { if v, err := unix.GetsockoptLinger(int(fd), syscall.SOL_SOCKET, syscall.SO_LINGER); err == nil { s.Linger = v } if v, err := unix.GetsockoptTimeval(int(fd), syscall.SOL_SOCKET, syscall.SO_RCVTIMEO); err == nil { s.RecvTimeout = v } if v, err := unix.GetsockoptTimeval(int(fd), syscall.SOL_SOCKET, syscall.SO_SNDTIMEO); err == nil { s.SendTimeout = v } if v, err := unix.GetsockoptTCPInfo(int(fd), syscall.SOL_TCP, syscall.TCP_INFO); err == nil { s.TCPInfo = v } } // GetSocketOption gets the socket option info of the conn. func GetSocketOption(socket any) *SocketOptionData { c, ok := socket.(syscall.Conn) if !ok { return nil } data := &SocketOptionData{} if rawConn, err := c.SyscallConn(); err == nil { rawConn.Control(data.Getsockopt) return data } return nil } ================================================ FILE: vendor/google.golang.org/grpc/internal/channelz/syscall_nonlinux.go ================================================ //go:build !linux /* * * Copyright 2018 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package channelz import ( "sync" ) var once sync.Once // SocketOptionData defines the struct to hold socket option data, and related // getter function to obtain info from fd. // Windows OS doesn't support Socket Option type SocketOptionData struct { } // Getsockopt defines the function to get socket options requested by channelz. // It is to be passed to syscall.RawConn.Control(). // Windows OS doesn't support Socket Option func (s *SocketOptionData) Getsockopt(uintptr) { once.Do(func() { logger.Warning("Channelz: socket options are not supported on non-linux environments") }) } // GetSocketOption gets the socket option info of the conn. func GetSocketOption(any) *SocketOptionData { return nil } ================================================ FILE: vendor/google.golang.org/grpc/internal/channelz/trace.go ================================================ /* * * Copyright 2018 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package channelz import ( "fmt" "sync" "sync/atomic" "time" "google.golang.org/grpc/grpclog" ) const ( defaultMaxTraceEntry int32 = 30 ) var maxTraceEntry = defaultMaxTraceEntry // SetMaxTraceEntry sets maximum number of trace entries per entity (i.e. // channel/subchannel). Setting it to 0 will disable channel tracing. func SetMaxTraceEntry(i int32) { atomic.StoreInt32(&maxTraceEntry, i) } // ResetMaxTraceEntryToDefault resets the maximum number of trace entries per // entity to default. func ResetMaxTraceEntryToDefault() { atomic.StoreInt32(&maxTraceEntry, defaultMaxTraceEntry) } func getMaxTraceEntry() int { i := atomic.LoadInt32(&maxTraceEntry) return int(i) } // traceEvent is an internal representation of a single trace event type traceEvent struct { // Desc is a simple description of the trace event. Desc string // Severity states the severity of this trace event. Severity Severity // Timestamp is the event time. Timestamp time.Time // RefID is the id of the entity that gets referenced in the event. RefID is 0 if no other entity is // involved in this event. // e.g. SubChannel (id: 4[]) Created. --> RefID = 4, RefName = "" (inside []) RefID int64 // RefName is the reference name for the entity that gets referenced in the event. RefName string // RefType indicates the referenced entity type, i.e Channel or SubChannel. RefType RefChannelType } // TraceEvent is what the caller of AddTraceEvent should provide to describe the // event to be added to the channel trace. // // The Parent field is optional. It is used for an event that will be recorded // in the entity's parent trace. type TraceEvent struct { Desc string Severity Severity Parent *TraceEvent } // ChannelTrace provides tracing information for a channel. // It tracks various events and metadata related to the channel's lifecycle // and operations. type ChannelTrace struct { cm *channelMap clearCalled bool // The time when the trace was created. CreationTime time.Time // A counter for the number of events recorded in the // trace. EventNum int64 mu sync.Mutex // A slice of traceEvent pointers representing the events recorded for // this channel. Events []*traceEvent } func (c *ChannelTrace) copy() *ChannelTrace { return &ChannelTrace{ CreationTime: c.CreationTime, EventNum: c.EventNum, Events: append(([]*traceEvent)(nil), c.Events...), } } func (c *ChannelTrace) append(e *traceEvent) { c.mu.Lock() if len(c.Events) == getMaxTraceEntry() { del := c.Events[0] c.Events = c.Events[1:] if del.RefID != 0 { // start recursive cleanup in a goroutine to not block the call originated from grpc. go func() { // need to acquire c.cm.mu lock to call the unlocked attemptCleanup func. c.cm.mu.Lock() c.cm.decrTraceRefCount(del.RefID) c.cm.mu.Unlock() }() } } e.Timestamp = time.Now() c.Events = append(c.Events, e) c.EventNum++ c.mu.Unlock() } func (c *ChannelTrace) clear() { if c.clearCalled { return } c.clearCalled = true c.mu.Lock() for _, e := range c.Events { if e.RefID != 0 { // caller should have already held the c.cm.mu lock. c.cm.decrTraceRefCount(e.RefID) } } c.mu.Unlock() } // Severity is the severity level of a trace event. // The canonical enumeration of all valid values is here: // https://github.com/grpc/grpc-proto/blob/9b13d199cc0d4703c7ea26c9c330ba695866eb23/grpc/channelz/v1/channelz.proto#L126. type Severity int const ( // CtUnknown indicates unknown severity of a trace event. CtUnknown Severity = iota // CtInfo indicates info level severity of a trace event. CtInfo // CtWarning indicates warning level severity of a trace event. CtWarning // CtError indicates error level severity of a trace event. CtError ) // RefChannelType is the type of the entity being referenced in a trace event. type RefChannelType int const ( // RefUnknown indicates an unknown entity type, the zero value for this type. RefUnknown RefChannelType = iota // RefChannel indicates the referenced entity is a Channel. RefChannel // RefSubChannel indicates the referenced entity is a SubChannel. RefSubChannel // RefServer indicates the referenced entity is a Server. RefServer // RefListenSocket indicates the referenced entity is a ListenSocket. RefListenSocket // RefNormalSocket indicates the referenced entity is a NormalSocket. RefNormalSocket ) var refChannelTypeToString = map[RefChannelType]string{ RefUnknown: "Unknown", RefChannel: "Channel", RefSubChannel: "SubChannel", RefServer: "Server", RefListenSocket: "ListenSocket", RefNormalSocket: "NormalSocket", } // String returns a string representation of the RefChannelType func (r RefChannelType) String() string { return refChannelTypeToString[r] } // AddTraceEvent adds trace related to the entity with specified id, using the // provided TraceEventDesc. // // If channelz is not turned ON, this will simply log the event descriptions. func AddTraceEvent(l grpclog.DepthLoggerV2, e Entity, depth int, desc *TraceEvent) { // Log only the trace description associated with the bottom most entity. d := fmt.Sprintf("[%s] %s", e, desc.Desc) switch desc.Severity { case CtUnknown, CtInfo: l.InfoDepth(depth+1, d) case CtWarning: l.WarningDepth(depth+1, d) case CtError: l.ErrorDepth(depth+1, d) } if getMaxTraceEntry() == 0 { return } if IsOn() { db.traceEvent(e.id(), desc) } } ================================================ FILE: vendor/google.golang.org/grpc/internal/credentials/credentials.go ================================================ /* * Copyright 2021 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package credentials import ( "context" ) // clientHandshakeInfoKey is a struct used as the key to store // ClientHandshakeInfo in a context. type clientHandshakeInfoKey struct{} // ClientHandshakeInfoFromContext extracts the ClientHandshakeInfo from ctx. func ClientHandshakeInfoFromContext(ctx context.Context) any { return ctx.Value(clientHandshakeInfoKey{}) } // NewClientHandshakeInfoContext creates a context with chi. func NewClientHandshakeInfoContext(ctx context.Context, chi any) context.Context { return context.WithValue(ctx, clientHandshakeInfoKey{}, chi) } ================================================ FILE: vendor/google.golang.org/grpc/internal/credentials/spiffe.go ================================================ /* * * Copyright 2020 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package credentials defines APIs for parsing SPIFFE ID. // // All APIs in this package are experimental. package credentials import ( "crypto/tls" "crypto/x509" "net/url" "google.golang.org/grpc/grpclog" ) var logger = grpclog.Component("credentials") // SPIFFEIDFromState parses the SPIFFE ID from State. If the SPIFFE ID format // is invalid, return nil with warning. func SPIFFEIDFromState(state tls.ConnectionState) *url.URL { if len(state.PeerCertificates) == 0 || len(state.PeerCertificates[0].URIs) == 0 { return nil } return SPIFFEIDFromCert(state.PeerCertificates[0]) } // SPIFFEIDFromCert parses the SPIFFE ID from x509.Certificate. If the SPIFFE // ID format is invalid, return nil with warning. func SPIFFEIDFromCert(cert *x509.Certificate) *url.URL { if cert == nil || cert.URIs == nil { return nil } var spiffeID *url.URL for _, uri := range cert.URIs { if uri == nil || uri.Scheme != "spiffe" || uri.Opaque != "" || (uri.User != nil && uri.User.Username() != "") { continue } // From this point, we assume the uri is intended for a SPIFFE ID. if len(uri.String()) > 2048 { logger.Warning("invalid SPIFFE ID: total ID length larger than 2048 bytes") return nil } if len(uri.Host) == 0 || len(uri.Path) == 0 { logger.Warning("invalid SPIFFE ID: domain or workload ID is empty") return nil } if len(uri.Host) > 255 { logger.Warning("invalid SPIFFE ID: domain length larger than 255 characters") return nil } // A valid SPIFFE certificate can only have exactly one URI SAN field. if len(cert.URIs) > 1 { logger.Warning("invalid SPIFFE ID: multiple URI SANs") return nil } spiffeID = uri } return spiffeID } ================================================ FILE: vendor/google.golang.org/grpc/internal/credentials/syscallconn.go ================================================ /* * * Copyright 2018 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package credentials import ( "net" "syscall" ) type sysConn = syscall.Conn // syscallConn keeps reference of rawConn to support syscall.Conn for channelz. // SyscallConn() (the method in interface syscall.Conn) is explicitly // implemented on this type, // // Interface syscall.Conn is implemented by most net.Conn implementations (e.g. // TCPConn, UnixConn), but is not part of net.Conn interface. So wrapper conns // that embed net.Conn don't implement syscall.Conn. (Side note: tls.Conn // doesn't embed net.Conn, so even if syscall.Conn is part of net.Conn, it won't // help here). type syscallConn struct { net.Conn // sysConn is a type alias of syscall.Conn. It's necessary because the name // `Conn` collides with `net.Conn`. sysConn } // WrapSyscallConn tries to wrap rawConn and newConn into a net.Conn that // implements syscall.Conn. rawConn will be used to support syscall, and newConn // will be used for read/write. // // This function returns newConn if rawConn doesn't implement syscall.Conn. func WrapSyscallConn(rawConn, newConn net.Conn) net.Conn { sysConn, ok := rawConn.(syscall.Conn) if !ok { return newConn } return &syscallConn{ Conn: newConn, sysConn: sysConn, } } ================================================ FILE: vendor/google.golang.org/grpc/internal/credentials/util.go ================================================ /* * * Copyright 2020 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package credentials import ( "crypto/tls" ) const alpnProtoStrH2 = "h2" // AppendH2ToNextProtos appends h2 to next protos. func AppendH2ToNextProtos(ps []string) []string { for _, p := range ps { if p == alpnProtoStrH2 { return ps } } ret := make([]string, 0, len(ps)+1) ret = append(ret, ps...) return append(ret, alpnProtoStrH2) } // CloneTLSConfig returns a shallow clone of the exported // fields of cfg, ignoring the unexported sync.Once, which // contains a mutex and must not be copied. // // If cfg is nil, a new zero tls.Config is returned. // // TODO: inline this function if possible. func CloneTLSConfig(cfg *tls.Config) *tls.Config { if cfg == nil { return &tls.Config{} } return cfg.Clone() } ================================================ FILE: vendor/google.golang.org/grpc/internal/envconfig/envconfig.go ================================================ /* * * Copyright 2018 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package envconfig contains grpc settings configured by environment variables. package envconfig import ( "os" "strconv" "strings" ) var ( // EnableTXTServiceConfig is set if the DNS resolver should perform TXT // lookups for service config ("GRPC_ENABLE_TXT_SERVICE_CONFIG" is not // "false"). EnableTXTServiceConfig = boolFromEnv("GRPC_ENABLE_TXT_SERVICE_CONFIG", true) // TXTErrIgnore is set if TXT errors should be ignored // ("GRPC_GO_IGNORE_TXT_ERRORS" is not "false"). TXTErrIgnore = boolFromEnv("GRPC_GO_IGNORE_TXT_ERRORS", true) // RingHashCap indicates the maximum ring size which defaults to 4096 // entries but may be overridden by setting the environment variable // "GRPC_RING_HASH_CAP". This does not override the default bounds // checking which NACKs configs specifying ring sizes > 8*1024*1024 (~8M). RingHashCap = uint64FromEnv("GRPC_RING_HASH_CAP", 4096, 1, 8*1024*1024) // ALTSMaxConcurrentHandshakes is the maximum number of concurrent ALTS // handshakes that can be performed. ALTSMaxConcurrentHandshakes = uint64FromEnv("GRPC_ALTS_MAX_CONCURRENT_HANDSHAKES", 100, 1, 100) // EnforceALPNEnabled is set if TLS connections to servers with ALPN disabled // should be rejected. The HTTP/2 protocol requires ALPN to be enabled, this // option is present for backward compatibility. This option may be overridden // by setting the environment variable "GRPC_ENFORCE_ALPN_ENABLED" to "true" // or "false". EnforceALPNEnabled = boolFromEnv("GRPC_ENFORCE_ALPN_ENABLED", true) // XDSEndpointHashKeyBackwardCompat controls the parsing of the endpoint hash // key from EDS LbEndpoint metadata. Endpoint hash keys can be disabled by // setting "GRPC_XDS_ENDPOINT_HASH_KEY_BACKWARD_COMPAT" to "true". When the // implementation of A76 is stable, we will flip the default value to false // in a subsequent release. A final release will remove this environment // variable, enabling the new behavior unconditionally. XDSEndpointHashKeyBackwardCompat = boolFromEnv("GRPC_XDS_ENDPOINT_HASH_KEY_BACKWARD_COMPAT", true) // RingHashSetRequestHashKey is set if the ring hash balancer can get the // request hash header by setting the "requestHashHeader" field, according // to gRFC A76. It can be enabled by setting the environment variable // "GRPC_EXPERIMENTAL_RING_HASH_SET_REQUEST_HASH_KEY" to "true". RingHashSetRequestHashKey = boolFromEnv("GRPC_EXPERIMENTAL_RING_HASH_SET_REQUEST_HASH_KEY", false) // ALTSHandshakerKeepaliveParams is set if we should add the // KeepaliveParams when dial the ALTS handshaker service. ALTSHandshakerKeepaliveParams = boolFromEnv("GRPC_EXPERIMENTAL_ALTS_HANDSHAKER_KEEPALIVE_PARAMS", false) // EnableDefaultPortForProxyTarget controls whether the resolver adds a default port 443 // to a target address that lacks one. This flag only has an effect when all of // the following conditions are met: // - A connect proxy is being used. // - Target resolution is disabled. // - The DNS resolver is being used. EnableDefaultPortForProxyTarget = boolFromEnv("GRPC_EXPERIMENTAL_ENABLE_DEFAULT_PORT_FOR_PROXY_TARGET", true) // XDSAuthorityRewrite indicates whether xDS authority rewriting is enabled. // This feature is defined in gRFC A81 and is enabled by setting the // environment variable GRPC_EXPERIMENTAL_XDS_AUTHORITY_REWRITE to "true". XDSAuthorityRewrite = boolFromEnv("GRPC_EXPERIMENTAL_XDS_AUTHORITY_REWRITE", false) ) func boolFromEnv(envVar string, def bool) bool { if def { // The default is true; return true unless the variable is "false". return !strings.EqualFold(os.Getenv(envVar), "false") } // The default is false; return false unless the variable is "true". return strings.EqualFold(os.Getenv(envVar), "true") } func uint64FromEnv(envVar string, def, min, max uint64) uint64 { v, err := strconv.ParseUint(os.Getenv(envVar), 10, 64) if err != nil { return def } if v < min { return min } if v > max { return max } return v } ================================================ FILE: vendor/google.golang.org/grpc/internal/envconfig/observability.go ================================================ /* * * Copyright 2022 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package envconfig import "os" const ( envObservabilityConfig = "GRPC_GCP_OBSERVABILITY_CONFIG" envObservabilityConfigFile = "GRPC_GCP_OBSERVABILITY_CONFIG_FILE" ) var ( // ObservabilityConfig is the json configuration for the gcp/observability // package specified directly in the envObservabilityConfig env var. // // This is used in the 1.0 release of gcp/observability, and thus must not be // deleted or changed. ObservabilityConfig = os.Getenv(envObservabilityConfig) // ObservabilityConfigFile is the json configuration for the // gcp/observability specified in a file with the location specified in // envObservabilityConfigFile env var. // // This is used in the 1.0 release of gcp/observability, and thus must not be // deleted or changed. ObservabilityConfigFile = os.Getenv(envObservabilityConfigFile) ) ================================================ FILE: vendor/google.golang.org/grpc/internal/envconfig/xds.go ================================================ /* * * Copyright 2020 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package envconfig import ( "os" ) const ( // XDSBootstrapFileNameEnv is the env variable to set bootstrap file name. // Do not use this and read from env directly. Its value is read and kept in // variable XDSBootstrapFileName. // // When both bootstrap FileName and FileContent are set, FileName is used. XDSBootstrapFileNameEnv = "GRPC_XDS_BOOTSTRAP" // XDSBootstrapFileContentEnv is the env variable to set bootstrap file // content. Do not use this and read from env directly. Its value is read // and kept in variable XDSBootstrapFileContent. // // When both bootstrap FileName and FileContent are set, FileName is used. XDSBootstrapFileContentEnv = "GRPC_XDS_BOOTSTRAP_CONFIG" ) var ( // XDSBootstrapFileName holds the name of the file which contains xDS // bootstrap configuration. Users can specify the location of the bootstrap // file by setting the environment variable "GRPC_XDS_BOOTSTRAP". // // When both bootstrap FileName and FileContent are set, FileName is used. XDSBootstrapFileName = os.Getenv(XDSBootstrapFileNameEnv) // XDSBootstrapFileContent holds the content of the xDS bootstrap // configuration. Users can specify the bootstrap config by setting the // environment variable "GRPC_XDS_BOOTSTRAP_CONFIG". // // When both bootstrap FileName and FileContent are set, FileName is used. XDSBootstrapFileContent = os.Getenv(XDSBootstrapFileContentEnv) // C2PResolverTestOnlyTrafficDirectorURI is the TD URI for testing. C2PResolverTestOnlyTrafficDirectorURI = os.Getenv("GRPC_TEST_ONLY_GOOGLE_C2P_RESOLVER_TRAFFIC_DIRECTOR_URI") // XDSDualstackEndpointsEnabled is true if gRPC should read the // "additional addresses" in the xDS endpoint resource. XDSDualstackEndpointsEnabled = boolFromEnv("GRPC_EXPERIMENTAL_XDS_DUALSTACK_ENDPOINTS", true) // XDSSystemRootCertsEnabled is true when xDS enabled gRPC clients can use // the system's default root certificates for TLS certificate validation. // For more details, see: // https://github.com/grpc/proposal/blob/master/A82-xds-system-root-certs.md. XDSSystemRootCertsEnabled = boolFromEnv("GRPC_EXPERIMENTAL_XDS_SYSTEM_ROOT_CERTS", false) // XDSSPIFFEEnabled controls if SPIFFE Bundle Maps can be used as roots of // trust. For more details, see: // https://github.com/grpc/proposal/blob/master/A87-mtls-spiffe-support.md XDSSPIFFEEnabled = boolFromEnv("GRPC_EXPERIMENTAL_XDS_MTLS_SPIFFE", false) // XDSHTTPConnectEnabled is true if gRPC should parse custom Metadata // configuring use of an HTTP CONNECT proxy via xDS from cluster resources. // For more details, see: // https://github.com/grpc/proposal/blob/master/A86-xds-http-connect.md XDSHTTPConnectEnabled = boolFromEnv("GRPC_EXPERIMENTAL_XDS_HTTP_CONNECT", false) // XDSBootstrapCallCredsEnabled controls if call credentials can be used in // xDS bootstrap configuration via the `call_creds` field. For more details, // see: https://github.com/grpc/proposal/blob/master/A97-xds-jwt-call-creds.md XDSBootstrapCallCredsEnabled = boolFromEnv("GRPC_EXPERIMENTAL_XDS_BOOTSTRAP_CALL_CREDS", false) ) ================================================ FILE: vendor/google.golang.org/grpc/internal/experimental.go ================================================ /* * Copyright 2023 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package internal var ( // WithBufferPool is implemented by the grpc package and returns a dial // option to configure a shared buffer pool for a grpc.ClientConn. WithBufferPool any // func (grpc.SharedBufferPool) grpc.DialOption // BufferPool is implemented by the grpc package and returns a server // option to configure a shared buffer pool for a grpc.Server. BufferPool any // func (grpc.SharedBufferPool) grpc.ServerOption // AcceptCompressors is implemented by the grpc package and returns // a call option that restricts the grpc-accept-encoding header for a call. AcceptCompressors any // func(...string) grpc.CallOption ) ================================================ FILE: vendor/google.golang.org/grpc/internal/grpclog/prefix_logger.go ================================================ /* * * Copyright 2020 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package grpclog provides logging functionality for internal gRPC packages, // outside of the functionality provided by the external `grpclog` package. package grpclog import ( "fmt" "google.golang.org/grpc/grpclog" ) // PrefixLogger does logging with a prefix. // // Logging method on a nil logs without any prefix. type PrefixLogger struct { logger grpclog.DepthLoggerV2 prefix string } // Infof does info logging. func (pl *PrefixLogger) Infof(format string, args ...any) { if pl != nil { // Handle nil, so the tests can pass in a nil logger. format = pl.prefix + format pl.logger.InfoDepth(1, fmt.Sprintf(format, args...)) return } grpclog.InfoDepth(1, fmt.Sprintf(format, args...)) } // Warningf does warning logging. func (pl *PrefixLogger) Warningf(format string, args ...any) { if pl != nil { format = pl.prefix + format pl.logger.WarningDepth(1, fmt.Sprintf(format, args...)) return } grpclog.WarningDepth(1, fmt.Sprintf(format, args...)) } // Errorf does error logging. func (pl *PrefixLogger) Errorf(format string, args ...any) { if pl != nil { format = pl.prefix + format pl.logger.ErrorDepth(1, fmt.Sprintf(format, args...)) return } grpclog.ErrorDepth(1, fmt.Sprintf(format, args...)) } // V reports whether verbosity level l is at least the requested verbose level. func (pl *PrefixLogger) V(l int) bool { if pl != nil { return pl.logger.V(l) } return true } // NewPrefixLogger creates a prefix logger with the given prefix. func NewPrefixLogger(logger grpclog.DepthLoggerV2, prefix string) *PrefixLogger { return &PrefixLogger{logger: logger, prefix: prefix} } ================================================ FILE: vendor/google.golang.org/grpc/internal/grpcsync/callback_serializer.go ================================================ /* * * Copyright 2022 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package grpcsync import ( "context" "google.golang.org/grpc/internal/buffer" ) // CallbackSerializer provides a mechanism to schedule callbacks in a // synchronized manner. It provides a FIFO guarantee on the order of execution // of scheduled callbacks. New callbacks can be scheduled by invoking the // Schedule() method. // // This type is safe for concurrent access. type CallbackSerializer struct { // done is closed once the serializer is shut down completely, i.e all // scheduled callbacks are executed and the serializer has deallocated all // its resources. done chan struct{} callbacks *buffer.Unbounded } // NewCallbackSerializer returns a new CallbackSerializer instance. The provided // context will be passed to the scheduled callbacks. Users should cancel the // provided context to shutdown the CallbackSerializer. It is guaranteed that no // callbacks will be added once this context is canceled, and any pending un-run // callbacks will be executed before the serializer is shut down. func NewCallbackSerializer(ctx context.Context) *CallbackSerializer { cs := &CallbackSerializer{ done: make(chan struct{}), callbacks: buffer.NewUnbounded(), } go cs.run(ctx) return cs } // TrySchedule tries to schedule the provided callback function f to be // executed in the order it was added. This is a best-effort operation. If the // context passed to NewCallbackSerializer was canceled before this method is // called, the callback will not be scheduled. // // Callbacks are expected to honor the context when performing any blocking // operations, and should return early when the context is canceled. func (cs *CallbackSerializer) TrySchedule(f func(ctx context.Context)) { cs.callbacks.Put(f) } // ScheduleOr schedules the provided callback function f to be executed in the // order it was added. If the context passed to NewCallbackSerializer has been // canceled before this method is called, the onFailure callback will be // executed inline instead. // // Callbacks are expected to honor the context when performing any blocking // operations, and should return early when the context is canceled. func (cs *CallbackSerializer) ScheduleOr(f func(ctx context.Context), onFailure func()) { if cs.callbacks.Put(f) != nil { onFailure() } } func (cs *CallbackSerializer) run(ctx context.Context) { defer close(cs.done) // Close the buffer when the context is canceled // to prevent new callbacks from being added. context.AfterFunc(ctx, cs.callbacks.Close) // Run all callbacks. for cb := range cs.callbacks.Get() { cs.callbacks.Load() cb.(func(context.Context))(ctx) } } // Done returns a channel that is closed after the context passed to // NewCallbackSerializer is canceled and all callbacks have been executed. func (cs *CallbackSerializer) Done() <-chan struct{} { return cs.done } ================================================ FILE: vendor/google.golang.org/grpc/internal/grpcsync/event.go ================================================ /* * * Copyright 2018 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package grpcsync implements additional synchronization primitives built upon // the sync package. package grpcsync import ( "sync/atomic" ) // Event represents a one-time event that may occur in the future. type Event struct { fired atomic.Bool c chan struct{} } // Fire causes e to complete. It is safe to call multiple times, and // concurrently. It returns true iff this call to Fire caused the signaling // channel returned by Done to close. If Fire returns false, it is possible // the Done channel has not been closed yet. func (e *Event) Fire() bool { if e.fired.CompareAndSwap(false, true) { close(e.c) return true } return false } // Done returns a channel that will be closed when Fire is called. func (e *Event) Done() <-chan struct{} { return e.c } // HasFired returns true if Fire has been called. func (e *Event) HasFired() bool { return e.fired.Load() } // NewEvent returns a new, ready-to-use Event. func NewEvent() *Event { return &Event{c: make(chan struct{})} } ================================================ FILE: vendor/google.golang.org/grpc/internal/grpcsync/pubsub.go ================================================ /* * * Copyright 2023 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package grpcsync import ( "context" "sync" ) // Subscriber represents an entity that is subscribed to messages published on // a PubSub. It wraps the callback to be invoked by the PubSub when a new // message is published. type Subscriber interface { // OnMessage is invoked when a new message is published. Implementations // must not block in this method. OnMessage(msg any) } // PubSub is a simple one-to-many publish-subscribe system that supports // messages of arbitrary type. It guarantees that messages are delivered in // the same order in which they were published. // // Publisher invokes the Publish() method to publish new messages, while // subscribers interested in receiving these messages register a callback // via the Subscribe() method. // // Once a PubSub is stopped, no more messages can be published, but any pending // published messages will be delivered to the subscribers. Done may be used // to determine when all published messages have been delivered. type PubSub struct { cs *CallbackSerializer // Access to the below fields are guarded by this mutex. mu sync.Mutex msg any subscribers map[Subscriber]bool } // NewPubSub returns a new PubSub instance. Users should cancel the // provided context to shutdown the PubSub. func NewPubSub(ctx context.Context) *PubSub { return &PubSub{ cs: NewCallbackSerializer(ctx), subscribers: map[Subscriber]bool{}, } } // Subscribe registers the provided Subscriber to the PubSub. // // If the PubSub contains a previously published message, the Subscriber's // OnMessage() callback will be invoked asynchronously with the existing // message to begin with, and subsequently for every newly published message. // // The caller is responsible for invoking the returned cancel function to // unsubscribe itself from the PubSub. func (ps *PubSub) Subscribe(sub Subscriber) (cancel func()) { ps.mu.Lock() defer ps.mu.Unlock() ps.subscribers[sub] = true if ps.msg != nil { msg := ps.msg ps.cs.TrySchedule(func(context.Context) { ps.mu.Lock() defer ps.mu.Unlock() if !ps.subscribers[sub] { return } sub.OnMessage(msg) }) } return func() { ps.mu.Lock() defer ps.mu.Unlock() delete(ps.subscribers, sub) } } // Publish publishes the provided message to the PubSub, and invokes // callbacks registered by subscribers asynchronously. func (ps *PubSub) Publish(msg any) { ps.mu.Lock() defer ps.mu.Unlock() ps.msg = msg for sub := range ps.subscribers { s := sub ps.cs.TrySchedule(func(context.Context) { ps.mu.Lock() defer ps.mu.Unlock() if !ps.subscribers[s] { return } s.OnMessage(msg) }) } } // Done returns a channel that is closed after the context passed to NewPubSub // is canceled and all updates have been sent to subscribers. func (ps *PubSub) Done() <-chan struct{} { return ps.cs.Done() } ================================================ FILE: vendor/google.golang.org/grpc/internal/grpcutil/compressor.go ================================================ /* * * Copyright 2022 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package grpcutil import ( "strings" ) // RegisteredCompressorNames holds names of the registered compressors. var RegisteredCompressorNames []string // IsCompressorNameRegistered returns true when name is available in registry. func IsCompressorNameRegistered(name string) bool { for _, compressor := range RegisteredCompressorNames { if compressor == name { return true } } return false } // RegisteredCompressors returns a string of registered compressor names // separated by comma. func RegisteredCompressors() string { return strings.Join(RegisteredCompressorNames, ",") } ================================================ FILE: vendor/google.golang.org/grpc/internal/grpcutil/encode_duration.go ================================================ /* * * Copyright 2020 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package grpcutil import ( "strconv" "time" ) const maxTimeoutValue int64 = 100000000 - 1 // div does integer division and round-up the result. Note that this is // equivalent to (d+r-1)/r but has less chance to overflow. func div(d, r time.Duration) int64 { if d%r > 0 { return int64(d/r + 1) } return int64(d / r) } // EncodeDuration encodes the duration to the format grpc-timeout header // accepts. // // https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#requests func EncodeDuration(t time.Duration) string { // TODO: This is simplistic and not bandwidth efficient. Improve it. if t <= 0 { return "0n" } if d := div(t, time.Nanosecond); d <= maxTimeoutValue { return strconv.FormatInt(d, 10) + "n" } if d := div(t, time.Microsecond); d <= maxTimeoutValue { return strconv.FormatInt(d, 10) + "u" } if d := div(t, time.Millisecond); d <= maxTimeoutValue { return strconv.FormatInt(d, 10) + "m" } if d := div(t, time.Second); d <= maxTimeoutValue { return strconv.FormatInt(d, 10) + "S" } if d := div(t, time.Minute); d <= maxTimeoutValue { return strconv.FormatInt(d, 10) + "M" } // Note that maxTimeoutValue * time.Hour > MaxInt64. return strconv.FormatInt(div(t, time.Hour), 10) + "H" } ================================================ FILE: vendor/google.golang.org/grpc/internal/grpcutil/grpcutil.go ================================================ /* * * Copyright 2021 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package grpcutil provides utility functions used across the gRPC codebase. package grpcutil ================================================ FILE: vendor/google.golang.org/grpc/internal/grpcutil/metadata.go ================================================ /* * * Copyright 2020 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package grpcutil import ( "context" "google.golang.org/grpc/metadata" ) type mdExtraKey struct{} // WithExtraMetadata creates a new context with incoming md attached. func WithExtraMetadata(ctx context.Context, md metadata.MD) context.Context { return context.WithValue(ctx, mdExtraKey{}, md) } // ExtraMetadata returns the incoming metadata in ctx if it exists. The // returned MD should not be modified. Writing to it may cause races. // Modification should be made to copies of the returned MD. func ExtraMetadata(ctx context.Context) (md metadata.MD, ok bool) { md, ok = ctx.Value(mdExtraKey{}).(metadata.MD) return } ================================================ FILE: vendor/google.golang.org/grpc/internal/grpcutil/method.go ================================================ /* * * Copyright 2018 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package grpcutil import ( "errors" "strings" ) // ParseMethod splits service and method from the input. It expects format // "/service/method". func ParseMethod(methodName string) (service, method string, _ error) { if !strings.HasPrefix(methodName, "/") { return "", "", errors.New("invalid method name: should start with /") } methodName = methodName[1:] pos := strings.LastIndex(methodName, "/") if pos < 0 { return "", "", errors.New("invalid method name: suffix /method is missing") } return methodName[:pos], methodName[pos+1:], nil } // baseContentType is the base content-type for gRPC. This is a valid // content-type on its own, but can also include a content-subtype such as // "proto" as a suffix after "+" or ";". See // https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#requests // for more details. const baseContentType = "application/grpc" // ContentSubtype returns the content-subtype for the given content-type. The // given content-type must be a valid content-type that starts with // "application/grpc". A content-subtype will follow "application/grpc" after a // "+" or ";". See // https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#requests for // more details. // // If contentType is not a valid content-type for gRPC, the boolean // will be false, otherwise true. If content-type == "application/grpc", // "application/grpc+", or "application/grpc;", the boolean will be true, // but no content-subtype will be returned. // // contentType is assumed to be lowercase already. func ContentSubtype(contentType string) (string, bool) { if contentType == baseContentType { return "", true } if !strings.HasPrefix(contentType, baseContentType) { return "", false } // guaranteed since != baseContentType and has baseContentType prefix switch contentType[len(baseContentType)] { case '+', ';': // this will return true for "application/grpc+" or "application/grpc;" // which the previous validContentType function tested to be valid, so we // just say that no content-subtype is specified in this case return contentType[len(baseContentType)+1:], true default: return "", false } } // ContentType builds full content type with the given sub-type. // // contentSubtype is assumed to be lowercase func ContentType(contentSubtype string) string { if contentSubtype == "" { return baseContentType } return baseContentType + "+" + contentSubtype } ================================================ FILE: vendor/google.golang.org/grpc/internal/grpcutil/regex.go ================================================ /* * * Copyright 2021 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package grpcutil import "regexp" // FullMatchWithRegex returns whether the full text matches the regex provided. func FullMatchWithRegex(re *regexp.Regexp, text string) bool { if len(text) == 0 { return re.MatchString(text) } re.Longest() rem := re.FindString(text) return len(rem) == len(text) } ================================================ FILE: vendor/google.golang.org/grpc/internal/idle/idle.go ================================================ /* * * Copyright 2023 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package idle contains a component for managing idleness (entering and exiting) // based on RPC activity. package idle import ( "math" "sync" "sync/atomic" "time" ) // For overriding in unit tests. var timeAfterFunc = func(d time.Duration, f func()) *time.Timer { return time.AfterFunc(d, f) } // ClientConn is the functionality provided by grpc.ClientConn to enter and exit // from idle mode. type ClientConn interface { ExitIdleMode() EnterIdleMode() } // Manager implements idleness detection and calls the ClientConn to enter/exit // idle mode when appropriate. Must be created by NewManager. type Manager struct { // State accessed atomically. lastCallEndTime int64 // Unix timestamp in nanos; time when the most recent RPC completed. activeCallsCount int32 // Count of active RPCs; -math.MaxInt32 means channel is idle or is trying to get there. activeSinceLastTimerCheck int32 // Boolean; True if there was an RPC since the last timer callback. closed int32 // Boolean; True when the manager is closed. // Can be accessed without atomics or mutex since these are set at creation // time and read-only after that. cc ClientConn // Functionality provided by grpc.ClientConn. timeout time.Duration // idleMu is used to guarantee mutual exclusion in two scenarios: // - Opposing intentions: // - a: Idle timeout has fired and handleIdleTimeout() is trying to put // the channel in idle mode because the channel has been inactive. // - b: At the same time an RPC is made on the channel, and OnCallBegin() // is trying to prevent the channel from going idle. // - Competing intentions: // - The channel is in idle mode and there are multiple RPCs starting at // the same time, all trying to move the channel out of idle. Only one // of them should succeed in doing so, while the other RPCs should // piggyback on the first one and be successfully handled. idleMu sync.RWMutex actuallyIdle bool timer *time.Timer } // NewManager creates a new idleness manager implementation for the // given idle timeout. It begins in idle mode. func NewManager(cc ClientConn, timeout time.Duration) *Manager { return &Manager{ cc: cc, timeout: timeout, actuallyIdle: true, activeCallsCount: -math.MaxInt32, } } // resetIdleTimerLocked resets the idle timer to the given duration. Called // when exiting idle mode or when the timer fires and we need to reset it. func (m *Manager) resetIdleTimerLocked(d time.Duration) { if m.isClosed() || m.timeout == 0 || m.actuallyIdle { return } // It is safe to ignore the return value from Reset() because this method is // only ever called from the timer callback or when exiting idle mode. if m.timer != nil { m.timer.Stop() } m.timer = timeAfterFunc(d, m.handleIdleTimeout) } func (m *Manager) resetIdleTimer(d time.Duration) { m.idleMu.Lock() defer m.idleMu.Unlock() m.resetIdleTimerLocked(d) } // handleIdleTimeout is the timer callback that is invoked upon expiry of the // configured idle timeout. The channel is considered inactive if there are no // ongoing calls and no RPC activity since the last time the timer fired. func (m *Manager) handleIdleTimeout() { if m.isClosed() { return } if atomic.LoadInt32(&m.activeCallsCount) > 0 { m.resetIdleTimer(m.timeout) return } // There has been activity on the channel since we last got here. Reset the // timer and return. if atomic.LoadInt32(&m.activeSinceLastTimerCheck) == 1 { // Set the timer to fire after a duration of idle timeout, calculated // from the time the most recent RPC completed. atomic.StoreInt32(&m.activeSinceLastTimerCheck, 0) m.resetIdleTimer(time.Duration(atomic.LoadInt64(&m.lastCallEndTime)-time.Now().UnixNano()) + m.timeout) return } // Now that we've checked that there has been no activity, attempt to enter // idle mode, which is very likely to succeed. if m.tryEnterIdleMode(true) { // Successfully entered idle mode. No timer needed until we exit idle. return } // Failed to enter idle mode due to a concurrent RPC that kept the channel // active, or because of an error from the channel. Undo the attempt to // enter idle, and reset the timer to try again later. m.resetIdleTimer(m.timeout) } // tryEnterIdleMode instructs the channel to enter idle mode. But before // that, it performs a last minute check to ensure that no new RPC has come in, // making the channel active. // // checkActivity controls if a check for RPC activity, since the last time the // idle_timeout fired, is made. // Return value indicates whether or not the channel moved to idle mode. // // Holds idleMu which ensures mutual exclusion with exitIdleMode. func (m *Manager) tryEnterIdleMode(checkActivity bool) bool { // Setting the activeCallsCount to -math.MaxInt32 indicates to OnCallBegin() // that the channel is either in idle mode or is trying to get there. if !atomic.CompareAndSwapInt32(&m.activeCallsCount, 0, -math.MaxInt32) { // This CAS operation can fail if an RPC started after we checked for // activity in the timer handler, or one was ongoing from before the // last time the timer fired, or if a test is attempting to enter idle // mode without checking. In all cases, abort going into idle mode. return false } // N.B. if we fail to enter idle mode after this, we must re-add // math.MaxInt32 to m.activeCallsCount. m.idleMu.Lock() defer m.idleMu.Unlock() if atomic.LoadInt32(&m.activeCallsCount) != -math.MaxInt32 { // We raced and lost to a new RPC. Very rare, but stop entering idle. atomic.AddInt32(&m.activeCallsCount, math.MaxInt32) return false } if checkActivity && atomic.LoadInt32(&m.activeSinceLastTimerCheck) == 1 { // A very short RPC could have come in (and also finished) after we // checked for calls count and activity in handleIdleTimeout(), but // before the CAS operation. So, we need to check for activity again. atomic.AddInt32(&m.activeCallsCount, math.MaxInt32) return false } // No new RPCs have come in since we set the active calls count value to // -math.MaxInt32. And since we have the lock, it is safe to enter idle mode // unconditionally now. m.cc.EnterIdleMode() m.actuallyIdle = true return true } // EnterIdleModeForTesting instructs the channel to enter idle mode. func (m *Manager) EnterIdleModeForTesting() { m.tryEnterIdleMode(false) } // OnCallBegin is invoked at the start of every RPC. func (m *Manager) OnCallBegin() { if m.isClosed() { return } if atomic.AddInt32(&m.activeCallsCount, 1) > 0 { // Channel is not idle now. Set the activity bit and allow the call. atomic.StoreInt32(&m.activeSinceLastTimerCheck, 1) return } // Channel is either in idle mode or is in the process of moving to idle // mode. Attempt to exit idle mode to allow this RPC. m.ExitIdleMode() atomic.StoreInt32(&m.activeSinceLastTimerCheck, 1) } // ExitIdleMode instructs m to call the ClientConn's ExitIdleMode and update its // internal state. func (m *Manager) ExitIdleMode() { // Holds idleMu which ensures mutual exclusion with tryEnterIdleMode. m.idleMu.Lock() defer m.idleMu.Unlock() if m.isClosed() || !m.actuallyIdle { // This can happen in three scenarios: // - handleIdleTimeout() set the calls count to -math.MaxInt32 and called // tryEnterIdleMode(). But before the latter could grab the lock, an RPC // came in and OnCallBegin() noticed that the calls count is negative. // - Channel is in idle mode, and multiple new RPCs come in at the same // time, all of them notice a negative calls count in OnCallBegin and get // here. The first one to get the lock would get the channel to exit idle. // - Channel is not in idle mode, and the user calls Connect which calls // m.ExitIdleMode. // // In any case, there is nothing to do here. return } m.cc.ExitIdleMode() // Undo the idle entry process. This also respects any new RPC attempts. atomic.AddInt32(&m.activeCallsCount, math.MaxInt32) m.actuallyIdle = false // Start a new timer to fire after the configured idle timeout. m.resetIdleTimerLocked(m.timeout) } // UnsafeSetNotIdle instructs the Manager to update its internal state to // reflect the reality that the channel is no longer in IDLE mode. // // N.B. This method is intended only for internal use by the gRPC client // when it exits IDLE mode **manually** from `Dial`. The callsite must ensure: // - The channel was **actually in IDLE mode** immediately prior to the call. // - There is **no concurrent activity** that could cause the channel to exit // IDLE mode *naturally* at the same time. func (m *Manager) UnsafeSetNotIdle() { m.idleMu.Lock() defer m.idleMu.Unlock() atomic.AddInt32(&m.activeCallsCount, math.MaxInt32) m.actuallyIdle = false m.resetIdleTimerLocked(m.timeout) } // OnCallEnd is invoked at the end of every RPC. func (m *Manager) OnCallEnd() { if m.isClosed() { return } // Record the time at which the most recent call finished. atomic.StoreInt64(&m.lastCallEndTime, time.Now().UnixNano()) // Decrement the active calls count. This count can temporarily go negative // when the timer callback is in the process of moving the channel to idle // mode, but one or more RPCs come in and complete before the timer callback // can get done with the process of moving to idle mode. atomic.AddInt32(&m.activeCallsCount, -1) } func (m *Manager) isClosed() bool { return atomic.LoadInt32(&m.closed) == 1 } // Close stops the timer associated with the Manager, if it exists. func (m *Manager) Close() { atomic.StoreInt32(&m.closed, 1) m.idleMu.Lock() if m.timer != nil { m.timer.Stop() m.timer = nil } m.idleMu.Unlock() } ================================================ FILE: vendor/google.golang.org/grpc/internal/internal.go ================================================ /* * Copyright 2016 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package internal contains gRPC-internal code, to avoid polluting // the godoc of the top-level grpc package. It must not import any grpc // symbols to avoid circular dependencies. package internal import ( "context" "time" "google.golang.org/grpc/connectivity" "google.golang.org/grpc/serviceconfig" ) var ( // HealthCheckFunc is used to provide client-side LB channel health checking HealthCheckFunc HealthChecker // RegisterClientHealthCheckListener is used to provide a listener for // updates from the client-side health checking service. It returns a // function that can be called to stop the health producer. RegisterClientHealthCheckListener any // func(ctx context.Context, sc balancer.SubConn, serviceName string, listener func(balancer.SubConnState)) func() // BalancerUnregister is exported by package balancer to unregister a balancer. BalancerUnregister func(name string) // KeepaliveMinPingTime is the minimum ping interval. This must be 10s by // default, but tests may wish to set it lower for convenience. KeepaliveMinPingTime = 10 * time.Second // KeepaliveMinServerPingTime is the minimum ping interval for servers. // This must be 1s by default, but tests may wish to set it lower for // convenience. KeepaliveMinServerPingTime = time.Second // ParseServiceConfig parses a JSON representation of the service config. ParseServiceConfig any // func(string) *serviceconfig.ParseResult // EqualServiceConfigForTesting is for testing service config generation and // parsing. Both a and b should be returned by ParseServiceConfig. // This function compares the config without rawJSON stripped, in case the // there's difference in white space. EqualServiceConfigForTesting func(a, b serviceconfig.Config) bool // GetCertificateProviderBuilder returns the registered builder for the // given name. This is set by package certprovider for use from xDS // bootstrap code while parsing certificate provider configs in the // bootstrap file. GetCertificateProviderBuilder any // func(string) certprovider.Builder // GetXDSHandshakeInfoForTesting returns a pointer to the xds.HandshakeInfo // stored in the passed in attributes. This is set by // credentials/xds/xds.go. GetXDSHandshakeInfoForTesting any // func (*attributes.Attributes) *unsafe.Pointer // GetServerCredentials returns the transport credentials configured on a // gRPC server. An xDS-enabled server needs to know what type of credentials // is configured on the underlying gRPC server. This is set by server.go. GetServerCredentials any // func (*grpc.Server) credentials.TransportCredentials // MetricsRecorderForServer returns the MetricsRecorderList derived from a // server's stats handlers. MetricsRecorderForServer any // func (*grpc.Server) estats.MetricsRecorder // CanonicalString returns the canonical string of the code defined here: // https://github.com/grpc/grpc/blob/master/doc/statuscodes.md. // // This is used in the 1.0 release of gcp/observability, and thus must not be // deleted or changed. CanonicalString any // func (codes.Code) string // IsRegisteredMethod returns whether the passed in method is registered as // a method on the server. IsRegisteredMethod any // func(*grpc.Server, string) bool // ServerFromContext returns the server from the context. ServerFromContext any // func(context.Context) *grpc.Server // AddGlobalServerOptions adds an array of ServerOption that will be // effective globally for newly created servers. The priority will be: 1. // user-provided; 2. this method; 3. default values. // // This is used in the 1.0 release of gcp/observability, and thus must not be // deleted or changed. AddGlobalServerOptions any // func(opt ...ServerOption) // ClearGlobalServerOptions clears the array of extra ServerOption. This // method is useful in testing and benchmarking. // // This is used in the 1.0 release of gcp/observability, and thus must not be // deleted or changed. ClearGlobalServerOptions func() // AddGlobalDialOptions adds an array of DialOption that will be effective // globally for newly created client channels. The priority will be: 1. // user-provided; 2. this method; 3. default values. // // This is used in the 1.0 release of gcp/observability, and thus must not be // deleted or changed. AddGlobalDialOptions any // func(opt ...DialOption) // DisableGlobalDialOptions returns a DialOption that prevents the // ClientConn from applying the global DialOptions (set via // AddGlobalDialOptions). // // This is used in the 1.0 release of gcp/observability, and thus must not be // deleted or changed. DisableGlobalDialOptions any // func() grpc.DialOption // ClearGlobalDialOptions clears the array of extra DialOption. This // method is useful in testing and benchmarking. // // This is used in the 1.0 release of gcp/observability, and thus must not be // deleted or changed. ClearGlobalDialOptions func() // AddGlobalPerTargetDialOptions adds a PerTargetDialOption that will be // configured for newly created ClientConns. AddGlobalPerTargetDialOptions any // func (opt any) // ClearGlobalPerTargetDialOptions clears the slice of global late apply // dial options. ClearGlobalPerTargetDialOptions func() // JoinDialOptions combines the dial options passed as arguments into a // single dial option. JoinDialOptions any // func(...grpc.DialOption) grpc.DialOption // JoinServerOptions combines the server options passed as arguments into a // single server option. JoinServerOptions any // func(...grpc.ServerOption) grpc.ServerOption // WithBinaryLogger returns a DialOption that specifies the binary logger // for a ClientConn. // // This is used in the 1.0 release of gcp/observability, and thus must not be // deleted or changed. WithBinaryLogger any // func(binarylog.Logger) grpc.DialOption // BinaryLogger returns a ServerOption that can set the binary logger for a // server. // // This is used in the 1.0 release of gcp/observability, and thus must not be // deleted or changed. BinaryLogger any // func(binarylog.Logger) grpc.ServerOption // SubscribeToConnectivityStateChanges adds a grpcsync.Subscriber to a // provided grpc.ClientConn. SubscribeToConnectivityStateChanges any // func(*grpc.ClientConn, grpcsync.Subscriber) // NewXDSResolverWithConfigForTesting creates a new xds resolver builder using // the provided xds bootstrap config instead of the global configuration from // the supported environment variables. The resolver.Builder is meant to be // used in conjunction with the grpc.WithResolvers DialOption. // // Testing Only // // This function should ONLY be used for testing and may not work with some // other features, including the CSDS service. NewXDSResolverWithConfigForTesting any // func([]byte) (resolver.Builder, error) // NewXDSResolverWithPoolForTesting creates a new xDS resolver builder // using the provided xDS pool instead of creating a new one using the // bootstrap configuration specified by the supported environment variables. // The resolver.Builder is meant to be used in conjunction with the // grpc.WithResolvers DialOption. The resolver.Builder does not take // ownership of the provided xDS client and it is the responsibility of the // caller to close the client when no longer required. // // Testing Only // // This function should ONLY be used for testing and may not work with some // other features, including the CSDS service. NewXDSResolverWithPoolForTesting any // func(*xdsclient.Pool) (resolver.Builder, error) // NewXDSResolverWithClientForTesting creates a new xDS resolver builder // using the provided xDS client instead of creating a new one using the // bootstrap configuration specified by the supported environment variables. // The resolver.Builder is meant to be used in conjunction with the // grpc.WithResolvers DialOption. The resolver.Builder does not take // ownership of the provided xDS client and it is the responsibility of the // caller to close the client when no longer required. // // Testing Only // // This function should ONLY be used for testing and may not work with some // other features, including the CSDS service. NewXDSResolverWithClientForTesting any // func(xdsclient.XDSClient) (resolver.Builder, error) // ORCAAllowAnyMinReportingInterval is for examples/orca use ONLY. ORCAAllowAnyMinReportingInterval any // func(so *orca.ServiceOptions) // GRPCResolverSchemeExtraMetadata determines when gRPC will add extra // metadata to RPCs. GRPCResolverSchemeExtraMetadata = "xds" // EnterIdleModeForTesting gets the ClientConn to enter IDLE mode. EnterIdleModeForTesting any // func(*grpc.ClientConn) // ExitIdleModeForTesting gets the ClientConn to exit IDLE mode. ExitIdleModeForTesting any // func(*grpc.ClientConn) error // ChannelzTurnOffForTesting disables the Channelz service for testing // purposes. ChannelzTurnOffForTesting func() // TriggerXDSResourceNotFoundForTesting causes the provided xDS Client to // invoke resource-not-found error for the given resource type and name. TriggerXDSResourceNotFoundForTesting any // func(xdsclient.XDSClient, xdsresource.Type, string) error // FromOutgoingContextRaw returns the un-merged, intermediary contents of // metadata.rawMD. FromOutgoingContextRaw any // func(context.Context) (metadata.MD, [][]string, bool) // UserSetDefaultScheme is set to true if the user has overridden the // default resolver scheme. UserSetDefaultScheme = false // ConnectedAddress returns the connected address for a SubConnState. The // address is only valid if the state is READY. ConnectedAddress any // func (scs SubConnState) resolver.Address // SetConnectedAddress sets the connected address for a SubConnState. SetConnectedAddress any // func(scs *SubConnState, addr resolver.Address) // SnapshotMetricRegistryForTesting snapshots the global data of the metric // registry. Returns a cleanup function that sets the metric registry to its // original state. Only called in testing functions. SnapshotMetricRegistryForTesting func() func() // SetDefaultBufferPoolForTesting updates the default buffer pool, for // testing purposes. SetDefaultBufferPoolForTesting any // func(mem.BufferPool) // SetBufferPoolingThresholdForTesting updates the buffer pooling threshold, for // testing purposes. SetBufferPoolingThresholdForTesting any // func(int) // TimeAfterFunc is used to create timers. During tests the function is // replaced to track allocated timers and fail the test if a timer isn't // cancelled. TimeAfterFunc = func(d time.Duration, f func()) Timer { return time.AfterFunc(d, f) } // NewStreamWaitingForResolver is a test hook that is triggered when a // new stream blocks while waiting for name resolution. This can be // used in tests to synchronize resolver updates and avoid race conditions. // When set, the function will be called before the stream enters // the blocking state. NewStreamWaitingForResolver = func() {} // AddressToTelemetryLabels is an xDS-provided function to extract telemetry // labels from a resolver.Address. Callers must assert its type before calling. AddressToTelemetryLabels any // func(addr resolver.Address) map[string]string ) // HealthChecker defines the signature of the client-side LB channel health // checking function. // // The implementation is expected to create a health checking RPC stream by // calling newStream(), watch for the health status of serviceName, and report // its health back by calling setConnectivityState(). // // The health checking protocol is defined at: // https://github.com/grpc/grpc/blob/master/doc/health-checking.md type HealthChecker func(ctx context.Context, newStream func(string) (any, error), setConnectivityState func(connectivity.State, error), serviceName string) error const ( // CredsBundleModeFallback switches GoogleDefaultCreds to fallback mode. CredsBundleModeFallback = "fallback" // CredsBundleModeBalancer switches GoogleDefaultCreds to grpclb balancer // mode. CredsBundleModeBalancer = "balancer" // CredsBundleModeBackendFromBalancer switches GoogleDefaultCreds to mode // that supports backend returned by grpclb balancer. CredsBundleModeBackendFromBalancer = "backend-from-balancer" ) // RLSLoadBalancingPolicyName is the name of the RLS LB policy. // // It currently has an experimental suffix which would be removed once // end-to-end testing of the policy is completed. const RLSLoadBalancingPolicyName = "rls_experimental" // EnforceSubConnEmbedding is used to enforce proper SubConn implementation // embedding. type EnforceSubConnEmbedding interface { enforceSubConnEmbedding() } // EnforceClientConnEmbedding is used to enforce proper ClientConn implementation // embedding. type EnforceClientConnEmbedding interface { enforceClientConnEmbedding() } // Timer is an interface to allow injecting different time.Timer implementations // during tests. type Timer interface { Stop() bool } ================================================ FILE: vendor/google.golang.org/grpc/internal/metadata/metadata.go ================================================ /* * * Copyright 2020 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package metadata contains functions to set and get metadata from addresses. // // This package is experimental. package metadata import ( "fmt" "strings" "google.golang.org/grpc/metadata" "google.golang.org/grpc/resolver" ) type mdKeyType string const mdKey = mdKeyType("grpc.internal.address.metadata") type mdValue metadata.MD func (m mdValue) Equal(o any) bool { om, ok := o.(mdValue) if !ok { return false } if len(m) != len(om) { return false } for k, v := range m { ov := om[k] if len(ov) != len(v) { return false } for i, ve := range v { if ov[i] != ve { return false } } } return true } // Get returns the metadata of addr. func Get(addr resolver.Address) metadata.MD { attrs := addr.Attributes if attrs == nil { return nil } md, _ := attrs.Value(mdKey).(mdValue) return metadata.MD(md) } // Set sets (overrides) the metadata in addr. // // When a SubConn is created with this address, the RPCs sent on it will all // have this metadata. func Set(addr resolver.Address, md metadata.MD) resolver.Address { addr.Attributes = addr.Attributes.WithValue(mdKey, mdValue(md)) return addr } // Validate validates every pair in md with ValidatePair. func Validate(md metadata.MD) error { for k, vals := range md { if err := ValidatePair(k, vals...); err != nil { return err } } return nil } // hasNotPrintable return true if msg contains any characters which are not in %x20-%x7E func hasNotPrintable(msg string) bool { // for i that saving a conversion if not using for range for i := 0; i < len(msg); i++ { if msg[i] < 0x20 || msg[i] > 0x7E { return true } } return false } // ValidateKey validates a key with the following rules (pseudo-headers are // skipped): // - the key must contain one or more characters. // - the characters in the key must be in [0-9 a-z _ - .]. func ValidateKey(key string) error { // key should not be empty if key == "" { return fmt.Errorf("there is an empty key in the header") } // pseudo-header will be ignored if key[0] == ':' { return nil } // check key, for i that saving a conversion if not using for range for i := 0; i < len(key); i++ { r := key[i] if !(r >= 'a' && r <= 'z') && !(r >= '0' && r <= '9') && r != '.' && r != '-' && r != '_' { return fmt.Errorf("header key %q contains illegal characters not in [0-9a-z-_.]", key) } } return nil } // ValidatePair validates a key-value pair with the following rules // (pseudo-header are skipped): // - the key must contain one or more characters. // - the characters in the key must be in [0-9 a-z _ - .]. // - if the key ends with a "-bin" suffix, no validation of the corresponding // value is performed. // - the characters in every value must be printable (in [%x20-%x7E]). func ValidatePair(key string, vals ...string) error { if err := ValidateKey(key); err != nil { return err } if strings.HasSuffix(key, "-bin") { return nil } // check value for _, val := range vals { if hasNotPrintable(val) { return fmt.Errorf("header key %q contains value with non-printable ASCII characters", key) } } return nil } ================================================ FILE: vendor/google.golang.org/grpc/internal/pretty/pretty.go ================================================ /* * * Copyright 2021 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package pretty defines helper functions to pretty-print structs for logging. package pretty import ( "bytes" "encoding/json" "fmt" "google.golang.org/protobuf/encoding/protojson" "google.golang.org/protobuf/protoadapt" ) const jsonIndent = " " // ToJSON marshals the input into a json string. // // If marshal fails, it falls back to fmt.Sprintf("%+v"). func ToJSON(e any) string { if ee, ok := e.(protoadapt.MessageV1); ok { e = protoadapt.MessageV2Of(ee) } if ee, ok := e.(protoadapt.MessageV2); ok { mm := protojson.MarshalOptions{ Indent: jsonIndent, Multiline: true, } ret, err := mm.Marshal(ee) if err != nil { // This may fail for proto.Anys, e.g. for xDS v2, LDS, the v2 // messages are not imported, and this will fail because the message // is not found. return fmt.Sprintf("%+v", ee) } return string(ret) } ret, err := json.MarshalIndent(e, "", jsonIndent) if err != nil { return fmt.Sprintf("%+v", e) } return string(ret) } // FormatJSON formats the input json bytes with indentation. // // If Indent fails, it returns the unchanged input as string. func FormatJSON(b []byte) string { var out bytes.Buffer err := json.Indent(&out, b, "", jsonIndent) if err != nil { return string(b) } return out.String() } ================================================ FILE: vendor/google.golang.org/grpc/internal/proxyattributes/proxyattributes.go ================================================ /* * * Copyright 2024 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package proxyattributes contains functions for getting and setting proxy // attributes like the CONNECT address and user info. package proxyattributes import ( "net/url" "google.golang.org/grpc/resolver" ) type keyType string const proxyOptionsKey = keyType("grpc.resolver.delegatingresolver.proxyOptions") // Options holds the proxy connection details needed during the CONNECT // handshake. type Options struct { User *url.Userinfo ConnectAddr string } // Set returns a copy of addr with opts set in its attributes. func Set(addr resolver.Address, opts Options) resolver.Address { addr.Attributes = addr.Attributes.WithValue(proxyOptionsKey, opts) return addr } // Get returns the Options for the proxy [resolver.Address] and a boolean // value representing if the attribute is present or not. The returned data // should not be mutated. func Get(addr resolver.Address) (Options, bool) { if a := addr.Attributes.Value(proxyOptionsKey); a != nil { return a.(Options), true } return Options{}, false } ================================================ FILE: vendor/google.golang.org/grpc/internal/resolver/config_selector.go ================================================ /* * * Copyright 2020 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package resolver provides internal resolver-related functionality. package resolver import ( "context" "sync" "google.golang.org/grpc/internal/serviceconfig" "google.golang.org/grpc/metadata" "google.golang.org/grpc/resolver" ) // ConfigSelector controls what configuration to use for every RPC. type ConfigSelector interface { // Selects the configuration for the RPC, or terminates it using the error. // This error will be converted by the gRPC library to a status error with // code UNKNOWN if it is not returned as a status error. SelectConfig(RPCInfo) (*RPCConfig, error) } // RPCInfo contains RPC information needed by a ConfigSelector. type RPCInfo struct { // Context is the user's context for the RPC and contains headers and // application timeout. It is passed for interception purposes and for // efficiency reasons. SelectConfig should not be blocking. Context context.Context Method string // i.e. "/Service/Method" } // RPCConfig describes the configuration to use for each RPC. type RPCConfig struct { // The context to use for the remainder of the RPC; can pass info to LB // policy or affect timeout or metadata. Context context.Context MethodConfig serviceconfig.MethodConfig // configuration to use for this RPC OnCommitted func() // Called when the RPC has been committed (retries no longer possible) Interceptor ClientInterceptor } // ClientStream is the same as grpc.ClientStream, but defined here for circular // dependency reasons. type ClientStream interface { // Header returns the header metadata received from the server if there // is any. It blocks if the metadata is not ready to read. Header() (metadata.MD, error) // Trailer returns the trailer metadata from the server, if there is any. // It must only be called after stream.CloseAndRecv has returned, or // stream.Recv has returned a non-nil error (including io.EOF). Trailer() metadata.MD // CloseSend closes the send direction of the stream. It closes the stream // when non-nil error is met. It is also not safe to call CloseSend // concurrently with SendMsg. CloseSend() error // Context returns the context for this stream. // // It should not be called until after Header or RecvMsg has returned. Once // called, subsequent client-side retries are disabled. Context() context.Context // SendMsg is generally called by generated code. On error, SendMsg aborts // the stream. If the error was generated by the client, the status is // returned directly; otherwise, io.EOF is returned and the status of // the stream may be discovered using RecvMsg. // // SendMsg blocks until: // - There is sufficient flow control to schedule m with the transport, or // - The stream is done, or // - The stream breaks. // // SendMsg does not wait until the message is received by the server. An // untimely stream closure may result in lost messages. To ensure delivery, // users should ensure the RPC completed successfully using RecvMsg. // // It is safe to have a goroutine calling SendMsg and another goroutine // calling RecvMsg on the same stream at the same time, but it is not safe // to call SendMsg on the same stream in different goroutines. It is also // not safe to call CloseSend concurrently with SendMsg. SendMsg(m any) error // RecvMsg blocks until it receives a message into m or the stream is // done. It returns io.EOF when the stream completes successfully. On // any other error, the stream is aborted and the error contains the RPC // status. // // It is safe to have a goroutine calling SendMsg and another goroutine // calling RecvMsg on the same stream at the same time, but it is not // safe to call RecvMsg on the same stream in different goroutines. RecvMsg(m any) error } // ClientInterceptor is an interceptor for gRPC client streams. type ClientInterceptor interface { // NewStream produces a ClientStream for an RPC which may optionally use // the provided function to produce a stream for delegation. Note: // RPCInfo.Context should not be used (will be nil). // // done is invoked when the RPC is finished using its connection, or could // not be assigned a connection. RPC operations may still occur on // ClientStream after done is called, since the interceptor is invoked by // application-layer operations. done must never be nil when called. NewStream(ctx context.Context, ri RPCInfo, done func(), newStream func(ctx context.Context, done func()) (ClientStream, error)) (ClientStream, error) } // ServerInterceptor is an interceptor for incoming RPC's on gRPC server side. type ServerInterceptor interface { // AllowRPC checks if an incoming RPC is allowed to proceed based on // information about connection RPC was received on, and HTTP Headers. This // information will be piped into context. AllowRPC(ctx context.Context) error // TODO: Make this a real interceptor for filters such as rate limiting. } type csKeyType string const csKey = csKeyType("grpc.internal.resolver.configSelector") // SetConfigSelector sets the config selector in state and returns the new // state. func SetConfigSelector(state resolver.State, cs ConfigSelector) resolver.State { state.Attributes = state.Attributes.WithValue(csKey, cs) return state } // GetConfigSelector retrieves the config selector from state, if present, and // returns it or nil if absent. func GetConfigSelector(state resolver.State) ConfigSelector { cs, _ := state.Attributes.Value(csKey).(ConfigSelector) return cs } // SafeConfigSelector allows for safe switching of ConfigSelector // implementations such that previous values are guaranteed to not be in use // when UpdateConfigSelector returns. type SafeConfigSelector struct { mu sync.RWMutex cs ConfigSelector } // UpdateConfigSelector swaps to the provided ConfigSelector and blocks until // all uses of the previous ConfigSelector have completed. func (scs *SafeConfigSelector) UpdateConfigSelector(cs ConfigSelector) { scs.mu.Lock() defer scs.mu.Unlock() scs.cs = cs } // SelectConfig defers to the current ConfigSelector in scs. func (scs *SafeConfigSelector) SelectConfig(r RPCInfo) (*RPCConfig, error) { scs.mu.RLock() defer scs.mu.RUnlock() return scs.cs.SelectConfig(r) } ================================================ FILE: vendor/google.golang.org/grpc/internal/resolver/delegatingresolver/delegatingresolver.go ================================================ /* * * Copyright 2024 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package delegatingresolver implements a resolver capable of resolving both // target URIs and proxy addresses. package delegatingresolver import ( "fmt" "net" "net/http" "net/url" "sync" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/internal/envconfig" "google.golang.org/grpc/internal/proxyattributes" "google.golang.org/grpc/internal/transport" "google.golang.org/grpc/internal/transport/networktype" "google.golang.org/grpc/resolver" "google.golang.org/grpc/serviceconfig" ) var ( logger = grpclog.Component("delegating-resolver") // HTTPSProxyFromEnvironment will be overwritten in the tests HTTPSProxyFromEnvironment = http.ProxyFromEnvironment ) const defaultPort = "443" // delegatingResolver manages both target URI and proxy address resolution by // delegating these tasks to separate child resolvers. Essentially, it acts as // an intermediary between the gRPC ClientConn and the child resolvers. // // It implements the [resolver.Resolver] interface. type delegatingResolver struct { target resolver.Target // parsed target URI to be resolved cc resolver.ClientConn // gRPC ClientConn proxyURL *url.URL // proxy URL, derived from proxy environment and target // We do not hold both mu and childMu in the same goroutine. Avoid holding // both locks when calling into the child, as the child resolver may // synchronously callback into the channel. mu sync.Mutex // protects all the fields below targetResolverState *resolver.State // state of the target resolver proxyAddrs []resolver.Address // resolved proxy addresses; empty if no proxy is configured // childMu serializes calls into child resolvers. It also protects access to // the following fields. childMu sync.Mutex targetResolver resolver.Resolver // resolver for the target URI, based on its scheme proxyResolver resolver.Resolver // resolver for the proxy URI; nil if no proxy is configured } // nopResolver is a resolver that does nothing. type nopResolver struct{} func (nopResolver) ResolveNow(resolver.ResolveNowOptions) {} func (nopResolver) Close() {} // proxyURLForTarget determines the proxy URL for the given address based on the // environment. It can return the following: // - nil URL, nil error: No proxy is configured or the address is excluded // using the `NO_PROXY` environment variable or if req.URL.Host is // "localhost" (with or without // a port number) // - nil URL, non-nil error: An error occurred while retrieving the proxy URL. // - non-nil URL, nil error: A proxy is configured, and the proxy URL was // retrieved successfully without any errors. func proxyURLForTarget(address string) (*url.URL, error) { req := &http.Request{URL: &url.URL{ Scheme: "https", Host: address, }} return HTTPSProxyFromEnvironment(req) } // New creates a new delegating resolver that can create up to two child // resolvers: // - one to resolve the proxy address specified using the supported // environment variables. This uses the registered resolver for the "dns" // scheme. It is lazily built when a target resolver update contains at least // one TCP address. // - one to resolve the target URI using the resolver specified by the scheme // in the target URI or specified by the user using the WithResolvers dial // option. As a special case, if the target URI's scheme is "dns" and a // proxy is specified using the supported environment variables, the target // URI's path portion is used as the resolved address unless target // resolution is enabled using the dial option. func New(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions, targetResolverBuilder resolver.Builder, targetResolutionEnabled bool) (resolver.Resolver, error) { r := &delegatingResolver{ target: target, cc: cc, proxyResolver: nopResolver{}, targetResolver: nopResolver{}, } addr := target.Endpoint() var err error if target.URL.Scheme == "dns" && !targetResolutionEnabled && envconfig.EnableDefaultPortForProxyTarget { addr, err = parseTarget(addr) if err != nil { return nil, fmt.Errorf("delegating_resolver: invalid target address %q: %v", target.Endpoint(), err) } } r.proxyURL, err = proxyURLForTarget(addr) if err != nil { return nil, fmt.Errorf("delegating_resolver: failed to determine proxy URL for target %q: %v", target, err) } // proxy is not configured or proxy address excluded using `NO_PROXY` env // var, so only target resolver is used. if r.proxyURL == nil { return targetResolverBuilder.Build(target, cc, opts) } if logger.V(2) { logger.Infof("Proxy URL detected : %s", r.proxyURL) } // Resolver updates from one child may trigger calls into the other. Block // updates until the children are initialized. r.childMu.Lock() defer r.childMu.Unlock() // When the scheme is 'dns' and target resolution on client is not enabled, // resolution should be handled by the proxy, not the client. Therefore, we // bypass the target resolver and store the unresolved target address. if target.URL.Scheme == "dns" && !targetResolutionEnabled { r.targetResolverState = &resolver.State{ Addresses: []resolver.Address{{Addr: addr}}, Endpoints: []resolver.Endpoint{{Addresses: []resolver.Address{{Addr: addr}}}}, } r.updateTargetResolverState(*r.targetResolverState) return r, nil } wcc := &wrappingClientConn{ stateListener: r.updateTargetResolverState, parent: r, } if r.targetResolver, err = targetResolverBuilder.Build(target, wcc, opts); err != nil { return nil, fmt.Errorf("delegating_resolver: unable to build the resolver for target %s: %v", target, err) } return r, nil } // proxyURIResolver creates a resolver for resolving proxy URIs using the "dns" // scheme. It adjusts the proxyURL to conform to the "dns:///" format and builds // a resolver with a wrappingClientConn to capture resolved addresses. func (r *delegatingResolver) proxyURIResolver(opts resolver.BuildOptions) (resolver.Resolver, error) { proxyBuilder := resolver.Get("dns") if proxyBuilder == nil { panic("delegating_resolver: resolver for proxy not found for scheme dns") } url := *r.proxyURL url.Scheme = "dns" url.Path = "/" + r.proxyURL.Host url.Host = "" // Clear the Host field to conform to the "dns:///" format proxyTarget := resolver.Target{URL: url} wcc := &wrappingClientConn{ stateListener: r.updateProxyResolverState, parent: r, } return proxyBuilder.Build(proxyTarget, wcc, opts) } func (r *delegatingResolver) ResolveNow(o resolver.ResolveNowOptions) { r.childMu.Lock() defer r.childMu.Unlock() r.targetResolver.ResolveNow(o) r.proxyResolver.ResolveNow(o) } func (r *delegatingResolver) Close() { r.childMu.Lock() defer r.childMu.Unlock() r.targetResolver.Close() r.targetResolver = nil r.proxyResolver.Close() r.proxyResolver = nil } func needsProxyResolver(state *resolver.State) bool { for _, addr := range state.Addresses { if !skipProxy(addr) { return true } } for _, endpoint := range state.Endpoints { for _, addr := range endpoint.Addresses { if !skipProxy(addr) { return true } } } return false } // parseTarget takes a target string and ensures it is a valid "host:port" target. // // It does the following: // 1. If the target already has a port (e.g., "host:port", "[ipv6]:port"), // it is returned as is. // 2. If the host part is empty (e.g., ":80"), it defaults to "localhost", // returning "localhost:80". // 3. If the target is missing a port (e.g., "host", "ipv6"), the defaultPort // is added. // // An error is returned for empty targets or targets with a trailing colon // but no port (e.g., "host:"). func parseTarget(target string) (string, error) { if target == "" { return "", fmt.Errorf("missing address") } host, port, err := net.SplitHostPort(target) if err != nil { // If SplitHostPort fails, it's likely because the port is missing. // We append the default port and return the result. return net.JoinHostPort(target, defaultPort), nil } // If SplitHostPort succeeds, we check for edge cases. if port == "" { // A success with an empty port means the target had a trailing colon, // e.g., "host:", which is an error. return "", fmt.Errorf("missing port after port-separator colon") } if host == "" { // A success with an empty host means the target was like ":80". // We default the host to "localhost". host = "localhost" } return net.JoinHostPort(host, port), nil } func skipProxy(address resolver.Address) bool { // Avoid proxy when network is not tcp. networkType, ok := networktype.Get(address) if !ok { networkType, _ = transport.ParseDialTarget(address.Addr) } if networkType != "tcp" { return true } req := &http.Request{URL: &url.URL{ Scheme: "https", Host: address.Addr, }} // Avoid proxy when address included in `NO_PROXY` environment variable or // fails to get the proxy address. url, err := HTTPSProxyFromEnvironment(req) if err != nil || url == nil { return true } return false } // updateClientConnStateLocked constructs a combined list of addresses by // pairing each proxy address with every target address of type TCP. For each // pair, it creates a new [resolver.Address] using the proxy address and // attaches the corresponding target address and user info as attributes. Target // addresses that are not of type TCP are appended to the list as-is. The // function returns nil if either resolver has not yet provided an update, and // returns the result of ClientConn.UpdateState once both resolvers have // provided at least one update. func (r *delegatingResolver) updateClientConnStateLocked() error { if r.targetResolverState == nil || r.proxyAddrs == nil { return nil } // If multiple resolved proxy addresses are present, we send only the // unresolved proxy host and let net.Dial handle the proxy host name // resolution when creating the transport. Sending all resolved addresses // would increase the number of addresses passed to the ClientConn and // subsequently to load balancing (LB) policies like Round Robin, leading // to additional TCP connections. However, if there's only one resolved // proxy address, we send it directly, as it doesn't affect the address // count returned by the target resolver and the address count sent to the // ClientConn. var proxyAddr resolver.Address if len(r.proxyAddrs) == 1 { proxyAddr = r.proxyAddrs[0] } else { proxyAddr = resolver.Address{Addr: r.proxyURL.Host} } var addresses []resolver.Address for _, targetAddr := range (*r.targetResolverState).Addresses { if skipProxy(targetAddr) { addresses = append(addresses, targetAddr) continue } addresses = append(addresses, proxyattributes.Set(proxyAddr, proxyattributes.Options{ User: r.proxyURL.User, ConnectAddr: targetAddr.Addr, })) } // For each target endpoint, construct a new [resolver.Endpoint] that // includes all addresses from all proxy endpoints and the addresses from // that target endpoint, preserving the number of target endpoints. var endpoints []resolver.Endpoint for _, endpt := range (*r.targetResolverState).Endpoints { var addrs []resolver.Address for _, targetAddr := range endpt.Addresses { // Avoid proxy when network is not tcp. if skipProxy(targetAddr) { addrs = append(addrs, targetAddr) continue } for _, proxyAddr := range r.proxyAddrs { addrs = append(addrs, proxyattributes.Set(proxyAddr, proxyattributes.Options{ User: r.proxyURL.User, ConnectAddr: targetAddr.Addr, })) } } endpoints = append(endpoints, resolver.Endpoint{Addresses: addrs}) } // Use the targetResolverState for its service config and attributes // contents. The state update is only sent after both the target and proxy // resolvers have sent their updates, and curState has been updated with the // combined addresses. curState := *r.targetResolverState curState.Addresses = addresses curState.Endpoints = endpoints return r.cc.UpdateState(curState) } // updateProxyResolverState updates the proxy resolver state by storing proxy // addresses and endpoints, marking the resolver as ready, and triggering a // state update if both proxy and target resolvers are ready. If the ClientConn // returns a non-nil error, it calls `ResolveNow()` on the target resolver. It // is a StateListener function of wrappingClientConn passed to the proxy // resolver. func (r *delegatingResolver) updateProxyResolverState(state resolver.State) error { r.mu.Lock() defer r.mu.Unlock() if logger.V(2) { logger.Infof("Addresses received from proxy resolver: %s", state.Addresses) } if len(state.Endpoints) > 0 { // We expect exactly one address per endpoint because the proxy resolver // uses "dns" resolution. r.proxyAddrs = make([]resolver.Address, 0, len(state.Endpoints)) for _, endpoint := range state.Endpoints { r.proxyAddrs = append(r.proxyAddrs, endpoint.Addresses...) } } else if state.Addresses != nil { r.proxyAddrs = state.Addresses } else { r.proxyAddrs = []resolver.Address{} // ensure proxyAddrs is non-nil to indicate an update has been received } err := r.updateClientConnStateLocked() // Another possible approach was to block until updates are received from // both resolvers. But this is not used because calling `New()` triggers // `Build()` for the first resolver, which calls `UpdateState()`. And the // second resolver hasn't sent an update yet, so it would cause `New()` to // block indefinitely. if err != nil { go func() { r.childMu.Lock() defer r.childMu.Unlock() if r.targetResolver != nil { r.targetResolver.ResolveNow(resolver.ResolveNowOptions{}) } }() } return err } // updateTargetResolverState is the StateListener function provided to the // target resolver via wrappingClientConn. It updates the resolver state and // marks the target resolver as ready. If the update includes at least one TCP // address and the proxy resolver has not yet been constructed, it initializes // the proxy resolver. A combined state update is triggered once both resolvers // are ready. If all addresses are non-TCP, it proceeds without waiting for the // proxy resolver. If ClientConn.UpdateState returns a non-nil error, // ResolveNow() is called on the proxy resolver. func (r *delegatingResolver) updateTargetResolverState(state resolver.State) error { r.mu.Lock() defer r.mu.Unlock() if logger.V(2) { logger.Infof("Addresses received from target resolver: %v", state.Addresses) } r.targetResolverState = &state // If all addresses returned by the target resolver have a non-TCP network // type, or are listed in the `NO_PROXY` environment variable, do not wait // for proxy update. if !needsProxyResolver(r.targetResolverState) { return r.cc.UpdateState(*r.targetResolverState) } // The proxy resolver may be rebuilt multiple times, specifically each time // the target resolver sends an update, even if the target resolver is built // successfully but building the proxy resolver fails. if len(r.proxyAddrs) == 0 { go func() { r.childMu.Lock() defer r.childMu.Unlock() if _, ok := r.proxyResolver.(nopResolver); !ok { return } proxyResolver, err := r.proxyURIResolver(resolver.BuildOptions{}) if err != nil { r.cc.ReportError(fmt.Errorf("delegating_resolver: unable to build the proxy resolver: %v", err)) return } r.proxyResolver = proxyResolver }() } err := r.updateClientConnStateLocked() if err != nil { go func() { r.childMu.Lock() defer r.childMu.Unlock() if r.proxyResolver != nil { r.proxyResolver.ResolveNow(resolver.ResolveNowOptions{}) } }() } return nil } // wrappingClientConn serves as an intermediary between the parent ClientConn // and the child resolvers created here. It implements the resolver.ClientConn // interface and is passed in that capacity to the child resolvers. type wrappingClientConn struct { // Callback to deliver resolver state updates stateListener func(state resolver.State) error parent *delegatingResolver } // UpdateState receives resolver state updates and forwards them to the // appropriate listener function (either for the proxy or target resolver). func (wcc *wrappingClientConn) UpdateState(state resolver.State) error { return wcc.stateListener(state) } // ReportError intercepts errors from the child resolvers and passes them to // ClientConn. func (wcc *wrappingClientConn) ReportError(err error) { wcc.parent.cc.ReportError(err) } // NewAddress intercepts the new resolved address from the child resolvers and // passes them to ClientConn. func (wcc *wrappingClientConn) NewAddress(addrs []resolver.Address) { wcc.UpdateState(resolver.State{Addresses: addrs}) } // ParseServiceConfig parses the provided service config and returns an object // that provides the parsed config. func (wcc *wrappingClientConn) ParseServiceConfig(serviceConfigJSON string) *serviceconfig.ParseResult { return wcc.parent.cc.ParseServiceConfig(serviceConfigJSON) } ================================================ FILE: vendor/google.golang.org/grpc/internal/resolver/dns/dns_resolver.go ================================================ /* * * Copyright 2018 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package dns implements a dns resolver to be installed as the default resolver // in grpc. package dns import ( "context" "encoding/json" "fmt" rand "math/rand/v2" "net" "net/netip" "os" "strconv" "strings" "sync" "time" grpclbstate "google.golang.org/grpc/balancer/grpclb/state" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/internal/backoff" "google.golang.org/grpc/internal/envconfig" "google.golang.org/grpc/internal/resolver/dns/internal" "google.golang.org/grpc/resolver" "google.golang.org/grpc/serviceconfig" ) var ( // EnableSRVLookups controls whether the DNS resolver attempts to fetch gRPCLB // addresses from SRV records. Must not be changed after init time. EnableSRVLookups = false // MinResolutionInterval is the minimum interval at which re-resolutions are // allowed. This helps to prevent excessive re-resolution. MinResolutionInterval = 30 * time.Second // ResolvingTimeout specifies the maximum duration for a DNS resolution request. // If the timeout expires before a response is received, the request will be canceled. // // It is recommended to set this value at application startup. Avoid modifying this variable // after initialization as it's not thread-safe for concurrent modification. ResolvingTimeout = 30 * time.Second logger = grpclog.Component("dns") ) func init() { resolver.Register(NewBuilder()) internal.TimeAfterFunc = time.After internal.TimeNowFunc = time.Now internal.TimeUntilFunc = time.Until internal.NewNetResolver = newNetResolver internal.AddressDialer = addressDialer } const ( defaultPort = "443" defaultDNSSvrPort = "53" golang = "GO" // txtPrefix is the prefix string to be prepended to the host name for txt // record lookup. txtPrefix = "_grpc_config." // In DNS, service config is encoded in a TXT record via the mechanism // described in RFC-1464 using the attribute name grpc_config. txtAttribute = "grpc_config=" ) var addressDialer = func(address string) func(context.Context, string, string) (net.Conn, error) { return func(ctx context.Context, network, _ string) (net.Conn, error) { var dialer net.Dialer return dialer.DialContext(ctx, network, address) } } var newNetResolver = func(authority string) (internal.NetResolver, error) { if authority == "" { return net.DefaultResolver, nil } host, port, err := parseTarget(authority, defaultDNSSvrPort) if err != nil { return nil, err } authorityWithPort := net.JoinHostPort(host, port) return &net.Resolver{ PreferGo: true, Dial: internal.AddressDialer(authorityWithPort), }, nil } // NewBuilder creates a dnsBuilder which is used to factory DNS resolvers. func NewBuilder() resolver.Builder { return &dnsBuilder{} } type dnsBuilder struct{} // Build creates and starts a DNS resolver that watches the name resolution of // the target. func (b *dnsBuilder) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error) { host, port, err := parseTarget(target.Endpoint(), defaultPort) if err != nil { return nil, err } // IP address. if ipAddr, err := formatIP(host); err == nil { addr := []resolver.Address{{Addr: ipAddr + ":" + port}} cc.UpdateState(resolver.State{Addresses: addr}) return deadResolver{}, nil } // DNS address (non-IP). ctx, cancel := context.WithCancel(context.Background()) d := &dnsResolver{ host: host, port: port, ctx: ctx, cancel: cancel, cc: cc, rn: make(chan struct{}, 1), enableServiceConfig: envconfig.EnableTXTServiceConfig && !opts.DisableServiceConfig, } d.resolver, err = internal.NewNetResolver(target.URL.Host) if err != nil { return nil, err } d.wg.Add(1) go d.watcher() return d, nil } // Scheme returns the naming scheme of this resolver builder, which is "dns". func (b *dnsBuilder) Scheme() string { return "dns" } // deadResolver is a resolver that does nothing. type deadResolver struct{} func (deadResolver) ResolveNow(resolver.ResolveNowOptions) {} func (deadResolver) Close() {} // dnsResolver watches for the name resolution update for a non-IP target. type dnsResolver struct { host string port string resolver internal.NetResolver ctx context.Context cancel context.CancelFunc cc resolver.ClientConn // rn channel is used by ResolveNow() to force an immediate resolution of the // target. rn chan struct{} // wg is used to enforce Close() to return after the watcher() goroutine has // finished. Otherwise, data race will be possible. [Race Example] in // dns_resolver_test we replace the real lookup functions with mocked ones to // facilitate testing. If Close() doesn't wait for watcher() goroutine // finishes, race detector sometimes will warn lookup (READ the lookup // function pointers) inside watcher() goroutine has data race with // replaceNetFunc (WRITE the lookup function pointers). wg sync.WaitGroup enableServiceConfig bool } // ResolveNow invoke an immediate resolution of the target that this // dnsResolver watches. func (d *dnsResolver) ResolveNow(resolver.ResolveNowOptions) { select { case d.rn <- struct{}{}: default: } } // Close closes the dnsResolver. func (d *dnsResolver) Close() { d.cancel() d.wg.Wait() } func (d *dnsResolver) watcher() { defer d.wg.Done() backoffIndex := 1 for { state, err := d.lookup() if err != nil { // Report error to the underlying grpc.ClientConn. d.cc.ReportError(err) } else { err = d.cc.UpdateState(*state) } var nextResolutionTime time.Time if err == nil { // Success resolving, wait for the next ResolveNow. However, also wait 30 // seconds at the very least to prevent constantly re-resolving. backoffIndex = 1 nextResolutionTime = internal.TimeNowFunc().Add(MinResolutionInterval) select { case <-d.ctx.Done(): return case <-d.rn: } } else { // Poll on an error found in DNS Resolver or an error received from // ClientConn. nextResolutionTime = internal.TimeNowFunc().Add(backoff.DefaultExponential.Backoff(backoffIndex)) backoffIndex++ } select { case <-d.ctx.Done(): return case <-internal.TimeAfterFunc(internal.TimeUntilFunc(nextResolutionTime)): } } } func (d *dnsResolver) lookupSRV(ctx context.Context) ([]resolver.Address, error) { // Skip this particular host to avoid timeouts with some versions of // systemd-resolved. if !EnableSRVLookups || d.host == "metadata.google.internal." { return nil, nil } var newAddrs []resolver.Address _, srvs, err := d.resolver.LookupSRV(ctx, "grpclb", "tcp", d.host) if err != nil { err = handleDNSError(err, "SRV") // may become nil return nil, err } for _, s := range srvs { lbAddrs, err := d.resolver.LookupHost(ctx, s.Target) if err != nil { err = handleDNSError(err, "A") // may become nil if err == nil { // If there are other SRV records, look them up and ignore this // one that does not exist. continue } return nil, err } for _, a := range lbAddrs { ip, err := formatIP(a) if err != nil { return nil, fmt.Errorf("dns: error parsing A record IP address %v: %v", a, err) } addr := ip + ":" + strconv.Itoa(int(s.Port)) newAddrs = append(newAddrs, resolver.Address{Addr: addr, ServerName: s.Target}) } } return newAddrs, nil } func handleDNSError(err error, lookupType string) error { dnsErr, ok := err.(*net.DNSError) if ok && !dnsErr.IsTimeout && !dnsErr.IsTemporary { // Timeouts and temporary errors should be communicated to gRPC to // attempt another DNS query (with backoff). Other errors should be // suppressed (they may represent the absence of a TXT record). return nil } if err != nil { err = fmt.Errorf("dns: %v record lookup error: %v", lookupType, err) logger.Info(err) } return err } func (d *dnsResolver) lookupTXT(ctx context.Context) *serviceconfig.ParseResult { ss, err := d.resolver.LookupTXT(ctx, txtPrefix+d.host) if err != nil { if envconfig.TXTErrIgnore { return nil } if err = handleDNSError(err, "TXT"); err != nil { return &serviceconfig.ParseResult{Err: err} } return nil } var res string for _, s := range ss { res += s } // TXT record must have "grpc_config=" attribute in order to be used as // service config. if !strings.HasPrefix(res, txtAttribute) { logger.Warningf("dns: TXT record %v missing %v attribute", res, txtAttribute) // This is not an error; it is the equivalent of not having a service // config. return nil } sc := canaryingSC(strings.TrimPrefix(res, txtAttribute)) return d.cc.ParseServiceConfig(sc) } func (d *dnsResolver) lookupHost(ctx context.Context) ([]resolver.Address, error) { addrs, err := d.resolver.LookupHost(ctx, d.host) if err != nil { err = handleDNSError(err, "A") return nil, err } newAddrs := make([]resolver.Address, 0, len(addrs)) for _, a := range addrs { ip, err := formatIP(a) if err != nil { return nil, fmt.Errorf("dns: error parsing A record IP address %v: %v", a, err) } addr := ip + ":" + d.port newAddrs = append(newAddrs, resolver.Address{Addr: addr}) } return newAddrs, nil } func (d *dnsResolver) lookup() (*resolver.State, error) { ctx, cancel := context.WithTimeout(d.ctx, ResolvingTimeout) defer cancel() srv, srvErr := d.lookupSRV(ctx) addrs, hostErr := d.lookupHost(ctx) if hostErr != nil && (srvErr != nil || len(srv) == 0) { return nil, hostErr } state := resolver.State{Addresses: addrs} if len(srv) > 0 { state = grpclbstate.Set(state, &grpclbstate.State{BalancerAddresses: srv}) } if d.enableServiceConfig { state.ServiceConfig = d.lookupTXT(ctx) } return &state, nil } // formatIP returns an error if addr is not a valid textual representation of // an IP address. If addr is an IPv4 address, return the addr and error = nil. // If addr is an IPv6 address, return the addr enclosed in square brackets and // error = nil. func formatIP(addr string) (string, error) { ip, err := netip.ParseAddr(addr) if err != nil { return "", err } if ip.Is4() { return addr, nil } return "[" + addr + "]", nil } // parseTarget takes the user input target string and default port, returns // formatted host and port info. If target doesn't specify a port, set the port // to be the defaultPort. If target is in IPv6 format and host-name is enclosed // in square brackets, brackets are stripped when setting the host. // examples: // target: "www.google.com" defaultPort: "443" returns host: "www.google.com", port: "443" // target: "ipv4-host:80" defaultPort: "443" returns host: "ipv4-host", port: "80" // target: "[ipv6-host]" defaultPort: "443" returns host: "ipv6-host", port: "443" // target: ":80" defaultPort: "443" returns host: "localhost", port: "80" func parseTarget(target, defaultPort string) (host, port string, err error) { if target == "" { return "", "", internal.ErrMissingAddr } if _, err := netip.ParseAddr(target); err == nil { // target is an IPv4 or IPv6(without brackets) address return target, defaultPort, nil } if host, port, err = net.SplitHostPort(target); err == nil { if port == "" { // If the port field is empty (target ends with colon), e.g. "[::1]:", // this is an error. return "", "", internal.ErrEndsWithColon } // target has port, i.e ipv4-host:port, [ipv6-host]:port, host-name:port if host == "" { // Keep consistent with net.Dial(): If the host is empty, as in ":80", // the local system is assumed. host = "localhost" } return host, port, nil } if host, port, err = net.SplitHostPort(target + ":" + defaultPort); err == nil { // target doesn't have port return host, port, nil } return "", "", fmt.Errorf("invalid target address %v, error info: %v", target, err) } type rawChoice struct { ClientLanguage *[]string `json:"clientLanguage,omitempty"` Percentage *int `json:"percentage,omitempty"` ClientHostName *[]string `json:"clientHostName,omitempty"` ServiceConfig *json.RawMessage `json:"serviceConfig,omitempty"` } func containsString(a *[]string, b string) bool { if a == nil { return true } for _, c := range *a { if c == b { return true } } return false } func chosenByPercentage(a *int) bool { if a == nil { return true } return rand.IntN(100)+1 <= *a } func canaryingSC(js string) string { if js == "" { return "" } var rcs []rawChoice err := json.Unmarshal([]byte(js), &rcs) if err != nil { logger.Warningf("dns: error parsing service config json: %v", err) return "" } cliHostname, err := os.Hostname() if err != nil { logger.Warningf("dns: error getting client hostname: %v", err) return "" } var sc string for _, c := range rcs { if !containsString(c.ClientLanguage, golang) || !chosenByPercentage(c.Percentage) || !containsString(c.ClientHostName, cliHostname) || c.ServiceConfig == nil { continue } sc = string(*c.ServiceConfig) break } return sc } ================================================ FILE: vendor/google.golang.org/grpc/internal/resolver/dns/internal/internal.go ================================================ /* * * Copyright 2023 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package internal contains functionality internal to the dns resolver package. package internal import ( "context" "errors" "net" "time" ) // NetResolver groups the methods on net.Resolver that are used by the DNS // resolver implementation. This allows the default net.Resolver instance to be // overridden from tests. type NetResolver interface { LookupHost(ctx context.Context, host string) (addrs []string, err error) LookupSRV(ctx context.Context, service, proto, name string) (cname string, addrs []*net.SRV, err error) LookupTXT(ctx context.Context, name string) (txts []string, err error) } var ( // ErrMissingAddr is the error returned when building a DNS resolver when // the provided target name is empty. ErrMissingAddr = errors.New("dns resolver: missing address") // ErrEndsWithColon is the error returned when building a DNS resolver when // the provided target name ends with a colon that is supposed to be the // separator between host and port. E.g. "::" is a valid address as it is // an IPv6 address (host only) and "[::]:" is invalid as it ends with a // colon as the host and port separator ErrEndsWithColon = errors.New("dns resolver: missing port after port-separator colon") ) // The following vars are overridden from tests. var ( // TimeAfterFunc is used by the DNS resolver to wait for the given duration // to elapse. In non-test code, this is implemented by time.After. In test // code, this can be used to control the amount of time the resolver is // blocked waiting for the duration to elapse. TimeAfterFunc func(time.Duration) <-chan time.Time // TimeNowFunc is used by the DNS resolver to get the current time. // In non-test code, this is implemented by time.Now. In test code, // this can be used to control the current time for the resolver. TimeNowFunc func() time.Time // TimeUntilFunc is used by the DNS resolver to calculate the remaining // wait time for re-resolution. In non-test code, this is implemented by // time.Until. In test code, this can be used to control the remaining // time for resolver to wait for re-resolution. TimeUntilFunc func(time.Time) time.Duration // NewNetResolver returns the net.Resolver instance for the given target. NewNetResolver func(string) (NetResolver, error) // AddressDialer is the dialer used to dial the DNS server. It accepts the // Host portion of the URL corresponding to the user's dial target and // returns a dial function. AddressDialer func(address string) func(context.Context, string, string) (net.Conn, error) ) ================================================ FILE: vendor/google.golang.org/grpc/internal/resolver/passthrough/passthrough.go ================================================ /* * * Copyright 2017 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package passthrough implements a pass-through resolver. It sends the target // name without scheme back to gRPC as resolved address. package passthrough import ( "errors" "google.golang.org/grpc/resolver" ) const scheme = "passthrough" type passthroughBuilder struct{} func (*passthroughBuilder) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error) { if target.Endpoint() == "" && opts.Dialer == nil { return nil, errors.New("passthrough: received empty target in Build()") } r := &passthroughResolver{ target: target, cc: cc, } r.start() return r, nil } func (*passthroughBuilder) Scheme() string { return scheme } type passthroughResolver struct { target resolver.Target cc resolver.ClientConn } func (r *passthroughResolver) start() { r.cc.UpdateState(resolver.State{Addresses: []resolver.Address{{Addr: r.target.Endpoint()}}}) } func (*passthroughResolver) ResolveNow(resolver.ResolveNowOptions) {} func (*passthroughResolver) Close() {} func init() { resolver.Register(&passthroughBuilder{}) } ================================================ FILE: vendor/google.golang.org/grpc/internal/resolver/unix/unix.go ================================================ /* * * Copyright 2020 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package unix implements a resolver for unix targets. package unix import ( "fmt" "google.golang.org/grpc/internal/transport/networktype" "google.golang.org/grpc/resolver" ) const unixScheme = "unix" const unixAbstractScheme = "unix-abstract" type builder struct { scheme string } func (b *builder) Build(target resolver.Target, cc resolver.ClientConn, _ resolver.BuildOptions) (resolver.Resolver, error) { if target.URL.Host != "" { return nil, fmt.Errorf("invalid (non-empty) authority: %v", target.URL.Host) } // gRPC was parsing the dial target manually before PR #4817, and we // switched to using url.Parse() in that PR. To avoid breaking existing // resolver implementations we ended up stripping the leading "/" from the // endpoint. This obviously does not work for the "unix" scheme. Hence we // end up using the parsed URL instead. endpoint := target.URL.Path if endpoint == "" { endpoint = target.URL.Opaque } addr := resolver.Address{Addr: endpoint} if b.scheme == unixAbstractScheme { // We can not prepend \0 as c++ gRPC does, as in Golang '@' is used to signify we do // not want trailing \0 in address. addr.Addr = "@" + addr.Addr } cc.UpdateState(resolver.State{Addresses: []resolver.Address{networktype.Set(addr, "unix")}}) return &nopResolver{}, nil } func (b *builder) Scheme() string { return b.scheme } func (b *builder) OverrideAuthority(resolver.Target) string { return "localhost" } type nopResolver struct { } func (*nopResolver) ResolveNow(resolver.ResolveNowOptions) {} func (*nopResolver) Close() {} func init() { resolver.Register(&builder{scheme: unixScheme}) resolver.Register(&builder{scheme: unixAbstractScheme}) } ================================================ FILE: vendor/google.golang.org/grpc/internal/serviceconfig/duration.go ================================================ /* * * Copyright 2023 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package serviceconfig import ( "encoding/json" "fmt" "math" "strconv" "strings" "time" ) // Duration defines JSON marshal and unmarshal methods to conform to the // protobuf JSON spec defined [here]. // // [here]: https://protobuf.dev/reference/protobuf/google.protobuf/#duration type Duration time.Duration func (d Duration) String() string { return fmt.Sprint(time.Duration(d)) } // MarshalJSON converts from d to a JSON string output. func (d Duration) MarshalJSON() ([]byte, error) { ns := time.Duration(d).Nanoseconds() sec := ns / int64(time.Second) ns = ns % int64(time.Second) var sign string if sec < 0 || ns < 0 { sign, sec, ns = "-", -1*sec, -1*ns } // Generated output always contains 0, 3, 6, or 9 fractional digits, // depending on required precision. str := fmt.Sprintf("%s%d.%09d", sign, sec, ns) str = strings.TrimSuffix(str, "000") str = strings.TrimSuffix(str, "000") str = strings.TrimSuffix(str, ".000") return []byte(fmt.Sprintf("\"%ss\"", str)), nil } // UnmarshalJSON unmarshals b as a duration JSON string into d. func (d *Duration) UnmarshalJSON(b []byte) error { var s string if err := json.Unmarshal(b, &s); err != nil { return err } if !strings.HasSuffix(s, "s") { return fmt.Errorf("malformed duration %q: missing seconds unit", s) } neg := false if s[0] == '-' { neg = true s = s[1:] } ss := strings.SplitN(s[:len(s)-1], ".", 3) if len(ss) > 2 { return fmt.Errorf("malformed duration %q: too many decimals", s) } // hasDigits is set if either the whole or fractional part of the number is // present, since both are optional but one is required. hasDigits := false var sec, ns int64 if len(ss[0]) > 0 { var err error if sec, err = strconv.ParseInt(ss[0], 10, 64); err != nil { return fmt.Errorf("malformed duration %q: %v", s, err) } // Maximum seconds value per the durationpb spec. const maxProtoSeconds = 315_576_000_000 if sec > maxProtoSeconds { return fmt.Errorf("out of range: %q", s) } hasDigits = true } if len(ss) == 2 && len(ss[1]) > 0 { if len(ss[1]) > 9 { return fmt.Errorf("malformed duration %q: too many digits after decimal", s) } var err error if ns, err = strconv.ParseInt(ss[1], 10, 64); err != nil { return fmt.Errorf("malformed duration %q: %v", s, err) } for i := 9; i > len(ss[1]); i-- { ns *= 10 } hasDigits = true } if !hasDigits { return fmt.Errorf("malformed duration %q: contains no numbers", s) } if neg { sec *= -1 ns *= -1 } // Maximum/minimum seconds/nanoseconds representable by Go's time.Duration. const maxSeconds = math.MaxInt64 / int64(time.Second) const maxNanosAtMaxSeconds = math.MaxInt64 % int64(time.Second) const minSeconds = math.MinInt64 / int64(time.Second) const minNanosAtMinSeconds = math.MinInt64 % int64(time.Second) if sec > maxSeconds || (sec == maxSeconds && ns >= maxNanosAtMaxSeconds) { *d = Duration(math.MaxInt64) } else if sec < minSeconds || (sec == minSeconds && ns <= minNanosAtMinSeconds) { *d = Duration(math.MinInt64) } else { *d = Duration(sec*int64(time.Second) + ns) } return nil } ================================================ FILE: vendor/google.golang.org/grpc/internal/serviceconfig/serviceconfig.go ================================================ /* * * Copyright 2020 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package serviceconfig contains utility functions to parse service config. package serviceconfig import ( "encoding/json" "fmt" "time" "google.golang.org/grpc/balancer" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" externalserviceconfig "google.golang.org/grpc/serviceconfig" ) var logger = grpclog.Component("core") // BalancerConfig wraps the name and config associated with one load balancing // policy. It corresponds to a single entry of the loadBalancingConfig field // from ServiceConfig. // // It implements the json.Unmarshaler interface. // // https://github.com/grpc/grpc-proto/blob/54713b1e8bc6ed2d4f25fb4dff527842150b91b2/grpc/service_config/service_config.proto#L247 type BalancerConfig struct { Name string Config externalserviceconfig.LoadBalancingConfig } type intermediateBalancerConfig []map[string]json.RawMessage // MarshalJSON implements the json.Marshaler interface. // // It marshals the balancer and config into a length-1 slice // ([]map[string]config). func (bc *BalancerConfig) MarshalJSON() ([]byte, error) { if bc.Config == nil { // If config is nil, return empty config `{}`. return []byte(fmt.Sprintf(`[{%q: %v}]`, bc.Name, "{}")), nil } c, err := json.Marshal(bc.Config) if err != nil { return nil, err } return []byte(fmt.Sprintf(`[{%q: %s}]`, bc.Name, c)), nil } // UnmarshalJSON implements the json.Unmarshaler interface. // // ServiceConfig contains a list of loadBalancingConfigs, each with a name and // config. This method iterates through that list in order, and stops at the // first policy that is supported. // - If the config for the first supported policy is invalid, the whole service // config is invalid. // - If the list doesn't contain any supported policy, the whole service config // is invalid. func (bc *BalancerConfig) UnmarshalJSON(b []byte) error { var ir intermediateBalancerConfig err := json.Unmarshal(b, &ir) if err != nil { return err } var names []string for i, lbcfg := range ir { if len(lbcfg) != 1 { return fmt.Errorf("invalid loadBalancingConfig: entry %v does not contain exactly 1 policy/config pair: %q", i, lbcfg) } var ( name string jsonCfg json.RawMessage ) // Get the key:value pair from the map. We have already made sure that // the map contains a single entry. for name, jsonCfg = range lbcfg { } names = append(names, name) builder := balancer.Get(name) if builder == nil { // If the balancer is not registered, move on to the next config. // This is not an error. continue } bc.Name = name parser, ok := builder.(balancer.ConfigParser) if !ok { if string(jsonCfg) != "{}" { logger.Warningf("non-empty balancer configuration %q, but balancer does not implement ParseConfig", string(jsonCfg)) } // Stop at this, though the builder doesn't support parsing config. return nil } cfg, err := parser.ParseConfig(jsonCfg) if err != nil { return fmt.Errorf("error parsing loadBalancingConfig for policy %q: %v", name, err) } bc.Config = cfg return nil } // This is reached when the for loop iterates over all entries, but didn't // return. This means we had a loadBalancingConfig slice but did not // encounter a registered policy. The config is considered invalid in this // case. return fmt.Errorf("invalid loadBalancingConfig: no supported policies found in %v", names) } // MethodConfig defines the configuration recommended by the service providers for a // particular method. type MethodConfig struct { // WaitForReady indicates whether RPCs sent to this method should wait until // the connection is ready by default (!failfast). The value specified via the // gRPC client API will override the value set here. WaitForReady *bool // Timeout is the default timeout for RPCs sent to this method. The actual // deadline used will be the minimum of the value specified here and the value // set by the application via the gRPC client API. If either one is not set, // then the other will be used. If neither is set, then the RPC has no deadline. Timeout *time.Duration // MaxReqSize is the maximum allowed payload size for an individual request in a // stream (client->server) in bytes. The size which is measured is the serialized // payload after per-message compression (but before stream compression) in bytes. // The actual value used is the minimum of the value specified here and the value set // by the application via the gRPC client API. If either one is not set, then the other // will be used. If neither is set, then the built-in default is used. MaxReqSize *int // MaxRespSize is the maximum allowed payload size for an individual response in a // stream (server->client) in bytes. MaxRespSize *int // RetryPolicy configures retry options for the method. RetryPolicy *RetryPolicy } // RetryPolicy defines the go-native version of the retry policy defined by the // service config here: // https://github.com/grpc/proposal/blob/master/A6-client-retries.md#integration-with-service-config type RetryPolicy struct { // MaxAttempts is the maximum number of attempts, including the original RPC. // // This field is required and must be two or greater. MaxAttempts int // Exponential backoff parameters. The initial retry attempt will occur at // random(0, initialBackoff). In general, the nth attempt will occur at // random(0, // min(initialBackoff*backoffMultiplier**(n-1), maxBackoff)). // // These fields are required and must be greater than zero. InitialBackoff time.Duration MaxBackoff time.Duration BackoffMultiplier float64 // The set of status codes which may be retried. // // Status codes are specified as strings, e.g., "UNAVAILABLE". // // This field is required and must be non-empty. // Note: a set is used to store this for easy lookup. RetryableStatusCodes map[codes.Code]bool } ================================================ FILE: vendor/google.golang.org/grpc/internal/stats/labels.go ================================================ /* * * Copyright 2024 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package stats provides internal stats related functionality. package stats import "context" // Labels are the labels for metrics. type Labels struct { // TelemetryLabels are the telemetry labels to record. TelemetryLabels map[string]string } type labelsKey struct{} // GetLabels returns the Labels stored in the context, or nil if there is one. func GetLabels(ctx context.Context) *Labels { labels, _ := ctx.Value(labelsKey{}).(*Labels) return labels } // SetLabels sets the Labels in the context. func SetLabels(ctx context.Context, labels *Labels) context.Context { // could also append return context.WithValue(ctx, labelsKey{}, labels) } ================================================ FILE: vendor/google.golang.org/grpc/internal/stats/metrics_recorder_list.go ================================================ /* * Copyright 2024 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package stats import ( "fmt" estats "google.golang.org/grpc/experimental/stats" "google.golang.org/grpc/stats" ) // MetricsRecorderList forwards Record calls to all of its metricsRecorders. // // It eats any record calls where the label values provided do not match the // number of label keys. type MetricsRecorderList struct { // metricsRecorders are the metrics recorders this list will forward to. metricsRecorders []estats.MetricsRecorder } // NewMetricsRecorderList creates a new metric recorder list with all the stats // handlers provided which implement the MetricsRecorder interface. // If no stats handlers provided implement the MetricsRecorder interface, // the MetricsRecorder list returned is a no-op. func NewMetricsRecorderList(shs []stats.Handler) *MetricsRecorderList { var mrs []estats.MetricsRecorder for _, sh := range shs { if mr, ok := sh.(estats.MetricsRecorder); ok { mrs = append(mrs, mr) } } return &MetricsRecorderList{ metricsRecorders: mrs, } } func verifyLabels(desc *estats.MetricDescriptor, labelsRecv ...string) { if got, want := len(labelsRecv), len(desc.Labels)+len(desc.OptionalLabels); got != want { panic(fmt.Sprintf("Received %d labels in call to record metric %q, but expected %d.", got, desc.Name, want)) } } // RecordInt64Count records the measurement alongside labels on the int // count associated with the provided handle. func (l *MetricsRecorderList) RecordInt64Count(handle *estats.Int64CountHandle, incr int64, labels ...string) { verifyLabels(handle.Descriptor(), labels...) for _, metricRecorder := range l.metricsRecorders { metricRecorder.RecordInt64Count(handle, incr, labels...) } } // RecordInt64UpDownCount records the measurement alongside labels on the int // count associated with the provided handle. func (l *MetricsRecorderList) RecordInt64UpDownCount(handle *estats.Int64UpDownCountHandle, incr int64, labels ...string) { verifyLabels(handle.Descriptor(), labels...) for _, metricRecorder := range l.metricsRecorders { metricRecorder.RecordInt64UpDownCount(handle, incr, labels...) } } // RecordFloat64Count records the measurement alongside labels on the float // count associated with the provided handle. func (l *MetricsRecorderList) RecordFloat64Count(handle *estats.Float64CountHandle, incr float64, labels ...string) { verifyLabels(handle.Descriptor(), labels...) for _, metricRecorder := range l.metricsRecorders { metricRecorder.RecordFloat64Count(handle, incr, labels...) } } // RecordInt64Histo records the measurement alongside labels on the int // histo associated with the provided handle. func (l *MetricsRecorderList) RecordInt64Histo(handle *estats.Int64HistoHandle, incr int64, labels ...string) { verifyLabels(handle.Descriptor(), labels...) for _, metricRecorder := range l.metricsRecorders { metricRecorder.RecordInt64Histo(handle, incr, labels...) } } // RecordFloat64Histo records the measurement alongside labels on the float // histo associated with the provided handle. func (l *MetricsRecorderList) RecordFloat64Histo(handle *estats.Float64HistoHandle, incr float64, labels ...string) { verifyLabels(handle.Descriptor(), labels...) for _, metricRecorder := range l.metricsRecorders { metricRecorder.RecordFloat64Histo(handle, incr, labels...) } } // RecordInt64Gauge records the measurement alongside labels on the int // gauge associated with the provided handle. func (l *MetricsRecorderList) RecordInt64Gauge(handle *estats.Int64GaugeHandle, incr int64, labels ...string) { verifyLabels(handle.Descriptor(), labels...) for _, metricRecorder := range l.metricsRecorders { metricRecorder.RecordInt64Gauge(handle, incr, labels...) } } ================================================ FILE: vendor/google.golang.org/grpc/internal/stats/stats.go ================================================ /* * * Copyright 2025 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package stats import ( "context" "google.golang.org/grpc/stats" ) type combinedHandler struct { handlers []stats.Handler } // NewCombinedHandler combines multiple stats.Handlers into a single handler. // // It returns nil if no handlers are provided. If only one handler is // provided, it is returned directly without wrapping. func NewCombinedHandler(handlers ...stats.Handler) stats.Handler { switch len(handlers) { case 0: return nil case 1: return handlers[0] default: return &combinedHandler{handlers: handlers} } } func (ch *combinedHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) context.Context { for _, h := range ch.handlers { ctx = h.TagRPC(ctx, info) } return ctx } func (ch *combinedHandler) HandleRPC(ctx context.Context, stats stats.RPCStats) { for _, h := range ch.handlers { h.HandleRPC(ctx, stats) } } func (ch *combinedHandler) TagConn(ctx context.Context, info *stats.ConnTagInfo) context.Context { for _, h := range ch.handlers { ctx = h.TagConn(ctx, info) } return ctx } func (ch *combinedHandler) HandleConn(ctx context.Context, stats stats.ConnStats) { for _, h := range ch.handlers { h.HandleConn(ctx, stats) } } ================================================ FILE: vendor/google.golang.org/grpc/internal/status/status.go ================================================ /* * * Copyright 2020 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package status implements errors returned by gRPC. These errors are // serialized and transmitted on the wire between server and client, and allow // for additional data to be transmitted via the Details field in the status // proto. gRPC service handlers should return an error created by this // package, and gRPC clients should expect a corresponding error to be // returned from the RPC call. // // This package upholds the invariants that a non-nil error may not // contain an OK code, and an OK code must result in a nil error. package status import ( "errors" "fmt" spb "google.golang.org/genproto/googleapis/rpc/status" "google.golang.org/grpc/codes" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/protoadapt" "google.golang.org/protobuf/types/known/anypb" ) // Status represents an RPC status code, message, and details. It is immutable // and should be created with New, Newf, or FromProto. type Status struct { s *spb.Status } // NewWithProto returns a new status including details from statusProto. This // is meant to be used by the gRPC library only. func NewWithProto(code codes.Code, message string, statusProto []string) *Status { if len(statusProto) != 1 { // No grpc-status-details bin header, or multiple; just ignore. return &Status{s: &spb.Status{Code: int32(code), Message: message}} } st := &spb.Status{} if err := proto.Unmarshal([]byte(statusProto[0]), st); err != nil { // Probably not a google.rpc.Status proto; do not provide details. return &Status{s: &spb.Status{Code: int32(code), Message: message}} } if st.Code == int32(code) { // The codes match between the grpc-status header and the // grpc-status-details-bin header; use the full details proto. return &Status{s: st} } return &Status{ s: &spb.Status{ Code: int32(codes.Internal), Message: fmt.Sprintf( "grpc-status-details-bin mismatch: grpc-status=%v, grpc-message=%q, grpc-status-details-bin=%+v", code, message, st, ), }, } } // New returns a Status representing c and msg. func New(c codes.Code, msg string) *Status { return &Status{s: &spb.Status{Code: int32(c), Message: msg}} } // Newf returns New(c, fmt.Sprintf(format, a...)). func Newf(c codes.Code, format string, a ...any) *Status { return New(c, fmt.Sprintf(format, a...)) } // FromProto returns a Status representing s. func FromProto(s *spb.Status) *Status { return &Status{s: proto.Clone(s).(*spb.Status)} } // Err returns an error representing c and msg. If c is OK, returns nil. func Err(c codes.Code, msg string) error { return New(c, msg).Err() } // Errorf returns Error(c, fmt.Sprintf(format, a...)). func Errorf(c codes.Code, format string, a ...any) error { return Err(c, fmt.Sprintf(format, a...)) } // Code returns the status code contained in s. func (s *Status) Code() codes.Code { if s == nil || s.s == nil { return codes.OK } return codes.Code(s.s.Code) } // Message returns the message contained in s. func (s *Status) Message() string { if s == nil || s.s == nil { return "" } return s.s.Message } // Proto returns s's status as an spb.Status proto message. func (s *Status) Proto() *spb.Status { if s == nil { return nil } return proto.Clone(s.s).(*spb.Status) } // Err returns an immutable error representing s; returns nil if s.Code() is OK. func (s *Status) Err() error { if s.Code() == codes.OK { return nil } return &Error{s: s} } // WithDetails returns a new status with the provided details messages appended to the status. // If any errors are encountered, it returns nil and the first error encountered. func (s *Status) WithDetails(details ...protoadapt.MessageV1) (*Status, error) { if s.Code() == codes.OK { return nil, errors.New("no error details for status with code OK") } // s.Code() != OK implies that s.Proto() != nil. p := s.Proto() for _, detail := range details { m, err := anypb.New(protoadapt.MessageV2Of(detail)) if err != nil { return nil, err } p.Details = append(p.Details, m) } return &Status{s: p}, nil } // Details returns a slice of details messages attached to the status. // If a detail cannot be decoded, the error is returned in place of the detail. // If the detail can be decoded, the proto message returned is of the same // type that was given to WithDetails(). func (s *Status) Details() []any { if s == nil || s.s == nil { return nil } details := make([]any, 0, len(s.s.Details)) for _, any := range s.s.Details { detail, err := any.UnmarshalNew() if err != nil { details = append(details, err) continue } // The call to MessageV1Of is required to unwrap the proto message if // it implemented only the MessageV1 API. The proto message would have // been wrapped in a V2 wrapper in Status.WithDetails. V2 messages are // added to a global registry used by any.UnmarshalNew(). // MessageV1Of has the following behaviour: // 1. If the given message is a wrapped MessageV1, it returns the // unwrapped value. // 2. If the given message already implements MessageV1, it returns it // as is. // 3. Else, it wraps the MessageV2 in a MessageV1 wrapper. // // Since the Status.WithDetails() API only accepts MessageV1, calling // MessageV1Of ensures we return the same type that was given to // WithDetails: // * If the give type implemented only MessageV1, the unwrapping from // point 1 above will restore the type. // * If the given type implemented both MessageV1 and MessageV2, point 2 // above will ensure no wrapping is performed. // * If the given type implemented only MessageV2 and was wrapped using // MessageV1Of before passing to WithDetails(), it would be unwrapped // in WithDetails by calling MessageV2Of(). Point 3 above will ensure // that the type is wrapped in a MessageV1 wrapper again before // returning. Note that protoc-gen-go doesn't generate code which // implements ONLY MessageV2 at the time of writing. // // NOTE: Status details can also be added using the FromProto method. // This could theoretically allow passing a Detail message that only // implements the V2 API. In such a case the message will be wrapped in // a MessageV1 wrapper when fetched using Details(). // Since protoc-gen-go generates only code that implements both V1 and // V2 APIs for backward compatibility, this is not a concern. details = append(details, protoadapt.MessageV1Of(detail)) } return details } func (s *Status) String() string { return fmt.Sprintf("rpc error: code = %s desc = %s", s.Code(), s.Message()) } // Error wraps a pointer of a status proto. It implements error and Status, // and a nil *Error should never be returned by this package. type Error struct { s *Status } func (e *Error) Error() string { return e.s.String() } // GRPCStatus returns the Status represented by se. func (e *Error) GRPCStatus() *Status { return e.s } // Is implements future error.Is functionality. // A Error is equivalent if the code and message are identical. func (e *Error) Is(target error) bool { tse, ok := target.(*Error) if !ok { return false } return proto.Equal(e.s.s, tse.s.s) } // IsRestrictedControlPlaneCode returns whether the status includes a code // restricted for control plane usage as defined by gRFC A54. func IsRestrictedControlPlaneCode(s *Status) bool { switch s.Code() { case codes.InvalidArgument, codes.NotFound, codes.AlreadyExists, codes.FailedPrecondition, codes.Aborted, codes.OutOfRange, codes.DataLoss: return true } return false } // RawStatusProto returns the internal protobuf message for use by gRPC itself. func RawStatusProto(s *Status) *spb.Status { if s == nil { return nil } return s.s } ================================================ FILE: vendor/google.golang.org/grpc/internal/syscall/syscall_linux.go ================================================ /* * * Copyright 2018 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package syscall provides functionalities that grpc uses to get low-level operating system // stats/info. package syscall import ( "fmt" "net" "syscall" "time" "golang.org/x/sys/unix" "google.golang.org/grpc/grpclog" ) var logger = grpclog.Component("core") // GetCPUTime returns the how much CPU time has passed since the start of this process. func GetCPUTime() int64 { var ts unix.Timespec if err := unix.ClockGettime(unix.CLOCK_PROCESS_CPUTIME_ID, &ts); err != nil { logger.Fatal(err) } return ts.Nano() } // Rusage is an alias for syscall.Rusage under linux environment. type Rusage = syscall.Rusage // GetRusage returns the resource usage of current process. func GetRusage() *Rusage { rusage := new(Rusage) syscall.Getrusage(syscall.RUSAGE_SELF, rusage) return rusage } // CPUTimeDiff returns the differences of user CPU time and system CPU time used // between two Rusage structs. func CPUTimeDiff(first *Rusage, latest *Rusage) (float64, float64) { var ( utimeDiffs = latest.Utime.Sec - first.Utime.Sec utimeDiffus = latest.Utime.Usec - first.Utime.Usec stimeDiffs = latest.Stime.Sec - first.Stime.Sec stimeDiffus = latest.Stime.Usec - first.Stime.Usec ) uTimeElapsed := float64(utimeDiffs) + float64(utimeDiffus)*1.0e-6 sTimeElapsed := float64(stimeDiffs) + float64(stimeDiffus)*1.0e-6 return uTimeElapsed, sTimeElapsed } // SetTCPUserTimeout sets the TCP user timeout on a connection's socket func SetTCPUserTimeout(conn net.Conn, timeout time.Duration) error { tcpconn, ok := conn.(*net.TCPConn) if !ok { // not a TCP connection. exit early return nil } rawConn, err := tcpconn.SyscallConn() if err != nil { return fmt.Errorf("error getting raw connection: %v", err) } err = rawConn.Control(func(fd uintptr) { err = syscall.SetsockoptInt(int(fd), syscall.IPPROTO_TCP, unix.TCP_USER_TIMEOUT, int(timeout/time.Millisecond)) }) if err != nil { return fmt.Errorf("error setting option on socket: %v", err) } return nil } // GetTCPUserTimeout gets the TCP user timeout on a connection's socket func GetTCPUserTimeout(conn net.Conn) (opt int, err error) { tcpconn, ok := conn.(*net.TCPConn) if !ok { err = fmt.Errorf("conn is not *net.TCPConn. got %T", conn) return } rawConn, err := tcpconn.SyscallConn() if err != nil { err = fmt.Errorf("error getting raw connection: %v", err) return } err = rawConn.Control(func(fd uintptr) { opt, err = syscall.GetsockoptInt(int(fd), syscall.IPPROTO_TCP, unix.TCP_USER_TIMEOUT) }) if err != nil { err = fmt.Errorf("error getting option on socket: %v", err) return } return } ================================================ FILE: vendor/google.golang.org/grpc/internal/syscall/syscall_nonlinux.go ================================================ //go:build !linux // +build !linux /* * * Copyright 2018 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package syscall provides functionalities that grpc uses to get low-level // operating system stats/info. package syscall import ( "net" "sync" "time" "google.golang.org/grpc/grpclog" ) var once sync.Once var logger = grpclog.Component("core") func log() { once.Do(func() { logger.Info("CPU time info is unavailable on non-linux environments.") }) } // GetCPUTime returns the how much CPU time has passed since the start of this // process. It always returns 0 under non-linux environments. func GetCPUTime() int64 { log() return 0 } // Rusage is an empty struct under non-linux environments. type Rusage struct{} // GetRusage is a no-op function under non-linux environments. func GetRusage() *Rusage { log() return nil } // CPUTimeDiff returns the differences of user CPU time and system CPU time used // between two Rusage structs. It a no-op function for non-linux environments. func CPUTimeDiff(*Rusage, *Rusage) (float64, float64) { log() return 0, 0 } // SetTCPUserTimeout is a no-op function under non-linux environments. func SetTCPUserTimeout(net.Conn, time.Duration) error { log() return nil } // GetTCPUserTimeout is a no-op function under non-linux environments. // A negative return value indicates the operation is not supported func GetTCPUserTimeout(net.Conn) (int, error) { log() return -1, nil } ================================================ FILE: vendor/google.golang.org/grpc/internal/tcp_keepalive_others.go ================================================ //go:build !unix && !windows /* * Copyright 2023 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package internal import ( "net" ) // NetDialerWithTCPKeepalive returns a vanilla net.Dialer on non-unix platforms. func NetDialerWithTCPKeepalive() *net.Dialer { return &net.Dialer{} } ================================================ FILE: vendor/google.golang.org/grpc/internal/tcp_keepalive_unix.go ================================================ //go:build unix /* * Copyright 2023 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package internal import ( "net" "syscall" "time" "golang.org/x/sys/unix" ) // NetDialerWithTCPKeepalive returns a net.Dialer that enables TCP keepalives on // the underlying connection with OS default values for keepalive parameters. // // TODO: Once https://github.com/golang/go/issues/62254 lands, and the // appropriate Go version becomes less than our least supported Go version, we // should look into using the new API to make things more straightforward. func NetDialerWithTCPKeepalive() *net.Dialer { return &net.Dialer{ // Setting a negative value here prevents the Go stdlib from overriding // the values of TCP keepalive time and interval. It also prevents the // Go stdlib from enabling TCP keepalives by default. KeepAlive: time.Duration(-1), // This method is called after the underlying network socket is created, // but before dialing the socket (or calling its connect() method). The // combination of unconditionally enabling TCP keepalives here, and // disabling the overriding of TCP keepalive parameters by setting the // KeepAlive field to a negative value above, results in OS defaults for // the TCP keepalive interval and time parameters. Control: func(_, _ string, c syscall.RawConn) error { return c.Control(func(fd uintptr) { unix.SetsockoptInt(int(fd), unix.SOL_SOCKET, unix.SO_KEEPALIVE, 1) }) }, } } ================================================ FILE: vendor/google.golang.org/grpc/internal/tcp_keepalive_windows.go ================================================ //go:build windows /* * Copyright 2023 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package internal import ( "net" "syscall" "time" "golang.org/x/sys/windows" ) // NetDialerWithTCPKeepalive returns a net.Dialer that enables TCP keepalives on // the underlying connection with OS default values for keepalive parameters. // // TODO: Once https://github.com/golang/go/issues/62254 lands, and the // appropriate Go version becomes less than our least supported Go version, we // should look into using the new API to make things more straightforward. func NetDialerWithTCPKeepalive() *net.Dialer { return &net.Dialer{ // Setting a negative value here prevents the Go stdlib from overriding // the values of TCP keepalive time and interval. It also prevents the // Go stdlib from enabling TCP keepalives by default. KeepAlive: time.Duration(-1), // This method is called after the underlying network socket is created, // but before dialing the socket (or calling its connect() method). The // combination of unconditionally enabling TCP keepalives here, and // disabling the overriding of TCP keepalive parameters by setting the // KeepAlive field to a negative value above, results in OS defaults for // the TCP keepalive interval and time parameters. Control: func(_, _ string, c syscall.RawConn) error { return c.Control(func(fd uintptr) { windows.SetsockoptInt(windows.Handle(fd), windows.SOL_SOCKET, windows.SO_KEEPALIVE, 1) }) }, } } ================================================ FILE: vendor/google.golang.org/grpc/internal/transport/bdp_estimator.go ================================================ /* * * Copyright 2017 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package transport import ( "sync" "time" ) const ( // bdpLimit is the maximum value the flow control windows will be increased // to. TCP typically limits this to 4MB, but some systems go up to 16MB. // Since this is only a limit, it is safe to make it optimistic. bdpLimit = (1 << 20) * 16 // alpha is a constant factor used to keep a moving average // of RTTs. alpha = 0.9 // If the current bdp sample is greater than or equal to // our beta * our estimated bdp and the current bandwidth // sample is the maximum bandwidth observed so far, we // increase our bbp estimate by a factor of gamma. beta = 0.66 // To put our bdp to be smaller than or equal to twice the real BDP, // we should multiply our current sample with 4/3, however to round things out // we use 2 as the multiplication factor. gamma = 2 ) // Adding arbitrary data to ping so that its ack can be identified. // Easter-egg: what does the ping message say? var bdpPing = &ping{data: [8]byte{2, 4, 16, 16, 9, 14, 7, 7}} type bdpEstimator struct { // sentAt is the time when the ping was sent. sentAt time.Time mu sync.Mutex // bdp is the current bdp estimate. bdp uint32 // sample is the number of bytes received in one measurement cycle. sample uint32 // bwMax is the maximum bandwidth noted so far (bytes/sec). bwMax float64 // bool to keep track of the beginning of a new measurement cycle. isSent bool // Callback to update the window sizes. updateFlowControl func(n uint32) // sampleCount is the number of samples taken so far. sampleCount uint64 // round trip time (seconds) rtt float64 } // timesnap registers the time bdp ping was sent out so that // network rtt can be calculated when its ack is received. // It is called (by controller) when the bdpPing is // being written on the wire. func (b *bdpEstimator) timesnap(d [8]byte) { if bdpPing.data != d { return } b.sentAt = time.Now() } // add adds bytes to the current sample for calculating bdp. // It returns true only if a ping must be sent. This can be used // by the caller (handleData) to make decision about batching // a window update with it. func (b *bdpEstimator) add(n uint32) bool { b.mu.Lock() defer b.mu.Unlock() if b.bdp == bdpLimit { return false } if !b.isSent { b.isSent = true b.sample = n b.sentAt = time.Time{} b.sampleCount++ return true } b.sample += n return false } // calculate is called when an ack for a bdp ping is received. // Here we calculate the current bdp and bandwidth sample and // decide if the flow control windows should go up. func (b *bdpEstimator) calculate(d [8]byte) { // Check if the ping acked for was the bdp ping. if bdpPing.data != d { return } b.mu.Lock() rttSample := time.Since(b.sentAt).Seconds() if b.sampleCount < 10 { // Bootstrap rtt with an average of first 10 rtt samples. b.rtt += (rttSample - b.rtt) / float64(b.sampleCount) } else { // Heed to the recent past more. b.rtt += (rttSample - b.rtt) * float64(alpha) } b.isSent = false // The number of bytes accumulated so far in the sample is smaller // than or equal to 1.5 times the real BDP on a saturated connection. bwCurrent := float64(b.sample) / (b.rtt * float64(1.5)) if bwCurrent > b.bwMax { b.bwMax = bwCurrent } // If the current sample (which is smaller than or equal to the 1.5 times the real BDP) is // greater than or equal to 2/3rd our perceived bdp AND this is the maximum bandwidth seen so far, we // should update our perception of the network BDP. if float64(b.sample) >= beta*float64(b.bdp) && bwCurrent == b.bwMax && b.bdp != bdpLimit { sampleFloat := float64(b.sample) b.bdp = uint32(gamma * sampleFloat) if b.bdp > bdpLimit { b.bdp = bdpLimit } bdp := b.bdp b.mu.Unlock() b.updateFlowControl(bdp) return } b.mu.Unlock() } ================================================ FILE: vendor/google.golang.org/grpc/internal/transport/client_stream.go ================================================ /* * * Copyright 2024 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package transport import ( "sync/atomic" "golang.org/x/net/http2" "google.golang.org/grpc/mem" "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" ) // ClientStream implements streaming functionality for a gRPC client. type ClientStream struct { Stream // Embed for common stream functionality. ct *http2Client done chan struct{} // closed at the end of stream to unblock writers. doneFunc func() // invoked at the end of stream. headerChan chan struct{} // closed to indicate the end of header metadata. header metadata.MD // the received header metadata status *status.Status // the status error received from the server // Non-pointer fields are at the end to optimize GC allocations. // headerValid indicates whether a valid header was received. Only // meaningful after headerChan is closed (always call waitOnHeader() before // reading its value). headerValid bool noHeaders bool // set if the client never received headers (set only after the stream is done). headerChanClosed uint32 // set when headerChan is closed. Used to avoid closing headerChan multiple times. bytesReceived atomic.Bool // indicates whether any bytes have been received on this stream unprocessed atomic.Bool // set if the server sends a refused stream or GOAWAY including this stream } // Read reads an n byte message from the input stream. func (s *ClientStream) Read(n int) (mem.BufferSlice, error) { b, err := s.Stream.read(n) if err == nil { s.ct.incrMsgRecv() } return b, err } // Close closes the stream and propagates err to any readers. func (s *ClientStream) Close(err error) { var ( rst bool rstCode http2.ErrCode ) if err != nil { rst = true rstCode = http2.ErrCodeCancel } s.ct.closeStream(s, err, rst, rstCode, status.Convert(err), nil, false) } // Write writes the hdr and data bytes to the output stream. func (s *ClientStream) Write(hdr []byte, data mem.BufferSlice, opts *WriteOptions) error { return s.ct.write(s, hdr, data, opts) } // BytesReceived indicates whether any bytes have been received on this stream. func (s *ClientStream) BytesReceived() bool { return s.bytesReceived.Load() } // Unprocessed indicates whether the server did not process this stream -- // i.e. it sent a refused stream or GOAWAY including this stream ID. func (s *ClientStream) Unprocessed() bool { return s.unprocessed.Load() } func (s *ClientStream) waitOnHeader() { select { case <-s.ctx.Done(): // Close the stream to prevent headers/trailers from changing after // this function returns. s.Close(ContextErr(s.ctx.Err())) // headerChan could possibly not be closed yet if closeStream raced // with operateHeaders; wait until it is closed explicitly here. <-s.headerChan case <-s.headerChan: } } // RecvCompress returns the compression algorithm applied to the inbound // message. It is empty string if there is no compression applied. func (s *ClientStream) RecvCompress() string { s.waitOnHeader() return s.recvCompress } // Done returns a channel which is closed when it receives the final status // from the server. func (s *ClientStream) Done() <-chan struct{} { return s.done } // Header returns the header metadata of the stream. Acquires the key-value // pairs of header metadata once it is available. It blocks until i) the // metadata is ready or ii) there is no header metadata or iii) the stream is // canceled/expired. func (s *ClientStream) Header() (metadata.MD, error) { s.waitOnHeader() if !s.headerValid || s.noHeaders { return nil, s.status.Err() } return s.header.Copy(), nil } // TrailersOnly blocks until a header or trailers-only frame is received and // then returns true if the stream was trailers-only. If the stream ends // before headers are received, returns true, nil. func (s *ClientStream) TrailersOnly() bool { s.waitOnHeader() return s.noHeaders } // Status returns the status received from the server. // Status can be read safely only after the stream has ended, // that is, after Done() is closed. func (s *ClientStream) Status() *status.Status { return s.status } func (s *ClientStream) requestRead(n int) { s.ct.adjustWindow(s, uint32(n)) } func (s *ClientStream) updateWindow(n int) { s.ct.updateWindow(s, uint32(n)) } ================================================ FILE: vendor/google.golang.org/grpc/internal/transport/controlbuf.go ================================================ /* * * Copyright 2014 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package transport import ( "bytes" "errors" "fmt" "net" "runtime" "strconv" "sync" "sync/atomic" "golang.org/x/net/http2" "golang.org/x/net/http2/hpack" "google.golang.org/grpc/internal/grpclog" "google.golang.org/grpc/internal/grpcutil" "google.golang.org/grpc/mem" "google.golang.org/grpc/status" ) var updateHeaderTblSize = func(e *hpack.Encoder, v uint32) { e.SetMaxDynamicTableSizeLimit(v) } // itemNodePool is used to reduce heap allocations. var itemNodePool = sync.Pool{ New: func() any { return &itemNode{} }, } type itemNode struct { it any next *itemNode } type itemList struct { head *itemNode tail *itemNode } func (il *itemList) enqueue(i any) { n := itemNodePool.Get().(*itemNode) n.next = nil n.it = i if il.tail == nil { il.head, il.tail = n, n return } il.tail.next = n il.tail = n } // peek returns the first item in the list without removing it from the // list. func (il *itemList) peek() any { return il.head.it } func (il *itemList) dequeue() any { if il.head == nil { return nil } i := il.head.it temp := il.head il.head = il.head.next itemNodePool.Put(temp) if il.head == nil { il.tail = nil } return i } func (il *itemList) dequeueAll() *itemNode { h := il.head il.head, il.tail = nil, nil return h } func (il *itemList) isEmpty() bool { return il.head == nil } // The following defines various control items which could flow through // the control buffer of transport. They represent different aspects of // control tasks, e.g., flow control, settings, streaming resetting, etc. // maxQueuedTransportResponseFrames is the most queued "transport response" // frames we will buffer before preventing new reads from occurring on the // transport. These are control frames sent in response to client requests, // such as RST_STREAM due to bad headers or settings acks. const maxQueuedTransportResponseFrames = 50 type cbItem interface { isTransportResponseFrame() bool } // registerStream is used to register an incoming stream with loopy writer. type registerStream struct { streamID uint32 wq *writeQuota } func (*registerStream) isTransportResponseFrame() bool { return false } // headerFrame is also used to register stream on the client-side. type headerFrame struct { streamID uint32 hf []hpack.HeaderField endStream bool // Valid on server side. initStream func(uint32) error // Used only on the client side. onWrite func() wq *writeQuota // write quota for the stream created. cleanup *cleanupStream // Valid on the server side. onOrphaned func(error) // Valid on client-side } func (h *headerFrame) isTransportResponseFrame() bool { return h.cleanup != nil && h.cleanup.rst // Results in a RST_STREAM } type cleanupStream struct { streamID uint32 rst bool rstCode http2.ErrCode onWrite func() } func (c *cleanupStream) isTransportResponseFrame() bool { return c.rst } // Results in a RST_STREAM type earlyAbortStream struct { httpStatus uint32 streamID uint32 contentSubtype string status *status.Status rst bool } func (*earlyAbortStream) isTransportResponseFrame() bool { return false } type dataFrame struct { streamID uint32 endStream bool h []byte data mem.BufferSlice processing bool // onEachWrite is called every time // a part of data is written out. onEachWrite func() } func (*dataFrame) isTransportResponseFrame() bool { return false } type incomingWindowUpdate struct { streamID uint32 increment uint32 } func (*incomingWindowUpdate) isTransportResponseFrame() bool { return false } type outgoingWindowUpdate struct { streamID uint32 increment uint32 } func (*outgoingWindowUpdate) isTransportResponseFrame() bool { return false // window updates are throttled by thresholds } type incomingSettings struct { ss []http2.Setting } func (*incomingSettings) isTransportResponseFrame() bool { return true } // Results in a settings ACK type outgoingSettings struct { ss []http2.Setting } func (*outgoingSettings) isTransportResponseFrame() bool { return false } type incomingGoAway struct { } func (*incomingGoAway) isTransportResponseFrame() bool { return false } type goAway struct { code http2.ErrCode debugData []byte headsUp bool closeConn error // if set, loopyWriter will exit with this error } func (*goAway) isTransportResponseFrame() bool { return false } type ping struct { ack bool data [8]byte } func (*ping) isTransportResponseFrame() bool { return true } type outFlowControlSizeRequest struct { resp chan uint32 } func (*outFlowControlSizeRequest) isTransportResponseFrame() bool { return false } // closeConnection is an instruction to tell the loopy writer to flush the // framer and exit, which will cause the transport's connection to be closed // (by the client or server). The transport itself will close after the reader // encounters the EOF caused by the connection closure. type closeConnection struct{} func (closeConnection) isTransportResponseFrame() bool { return false } type outStreamState int const ( active outStreamState = iota empty waitingOnStreamQuota ) type outStream struct { id uint32 state outStreamState itl *itemList bytesOutStanding int wq *writeQuota reader mem.Reader next *outStream prev *outStream } func (s *outStream) deleteSelf() { if s.prev != nil { s.prev.next = s.next } if s.next != nil { s.next.prev = s.prev } s.next, s.prev = nil, nil } type outStreamList struct { // Following are sentinel objects that mark the // beginning and end of the list. They do not // contain any item lists. All valid objects are // inserted in between them. // This is needed so that an outStream object can // deleteSelf() in O(1) time without knowing which // list it belongs to. head *outStream tail *outStream } func newOutStreamList() *outStreamList { head, tail := new(outStream), new(outStream) head.next = tail tail.prev = head return &outStreamList{ head: head, tail: tail, } } func (l *outStreamList) enqueue(s *outStream) { e := l.tail.prev e.next = s s.prev = e s.next = l.tail l.tail.prev = s } // remove from the beginning of the list. func (l *outStreamList) dequeue() *outStream { b := l.head.next if b == l.tail { return nil } b.deleteSelf() return b } // controlBuffer is a way to pass information to loopy. // // Information is passed as specific struct types called control frames. A // control frame not only represents data, messages or headers to be sent out // but can also be used to instruct loopy to update its internal state. It // shouldn't be confused with an HTTP2 frame, although some of the control // frames like dataFrame and headerFrame do go out on wire as HTTP2 frames. type controlBuffer struct { wakeupCh chan struct{} // Unblocks readers waiting for something to read. done <-chan struct{} // Closed when the transport is done. // Mutex guards all the fields below, except trfChan which can be read // atomically without holding mu. mu sync.Mutex consumerWaiting bool // True when readers are blocked waiting for new data. closed bool // True when the controlbuf is finished. list *itemList // List of queued control frames. // transportResponseFrames counts the number of queued items that represent // the response of an action initiated by the peer. trfChan is created // when transportResponseFrames >= maxQueuedTransportResponseFrames and is // closed and nilled when transportResponseFrames drops below the // threshold. Both fields are protected by mu. transportResponseFrames int trfChan atomic.Pointer[chan struct{}] } func newControlBuffer(done <-chan struct{}) *controlBuffer { return &controlBuffer{ wakeupCh: make(chan struct{}, 1), list: &itemList{}, done: done, } } // throttle blocks if there are too many frames in the control buf that // represent the response of an action initiated by the peer, like // incomingSettings cleanupStreams etc. func (c *controlBuffer) throttle() { if ch := c.trfChan.Load(); ch != nil { select { case <-(*ch): case <-c.done: } } } // put adds an item to the controlbuf. func (c *controlBuffer) put(it cbItem) error { _, err := c.executeAndPut(nil, it) return err } // executeAndPut runs f, and if the return value is true, adds the given item to // the controlbuf. The item could be nil, in which case, this method simply // executes f and does not add the item to the controlbuf. // // The first return value indicates whether the item was successfully added to // the control buffer. A non-nil error, specifically ErrConnClosing, is returned // if the control buffer is already closed. func (c *controlBuffer) executeAndPut(f func() bool, it cbItem) (bool, error) { c.mu.Lock() defer c.mu.Unlock() if c.closed { return false, ErrConnClosing } if f != nil { if !f() { // f wasn't successful return false, nil } } if it == nil { return true, nil } var wakeUp bool if c.consumerWaiting { wakeUp = true c.consumerWaiting = false } c.list.enqueue(it) if it.isTransportResponseFrame() { c.transportResponseFrames++ if c.transportResponseFrames == maxQueuedTransportResponseFrames { // We are adding the frame that puts us over the threshold; create // a throttling channel. ch := make(chan struct{}) c.trfChan.Store(&ch) } } if wakeUp { select { case c.wakeupCh <- struct{}{}: default: } } return true, nil } // get returns the next control frame from the control buffer. If block is true // **and** there are no control frames in the control buffer, the call blocks // until one of the conditions is met: there is a frame to return or the // transport is closed. func (c *controlBuffer) get(block bool) (any, error) { for { c.mu.Lock() frame, err := c.getOnceLocked() if frame != nil || err != nil || !block { // If we read a frame or an error, we can return to the caller. The // call to getOnceLocked() returns a nil frame and a nil error if // there is nothing to read, and in that case, if the caller asked // us not to block, we can return now as well. c.mu.Unlock() return frame, err } c.consumerWaiting = true c.mu.Unlock() // Release the lock above and wait to be woken up. select { case <-c.wakeupCh: case <-c.done: return nil, errors.New("transport closed by client") } } } // Callers must not use this method, but should instead use get(). // // Caller must hold c.mu. func (c *controlBuffer) getOnceLocked() (any, error) { if c.closed { return false, ErrConnClosing } if c.list.isEmpty() { return nil, nil } h := c.list.dequeue().(cbItem) if h.isTransportResponseFrame() { if c.transportResponseFrames == maxQueuedTransportResponseFrames { // We are removing the frame that put us over the // threshold; close and clear the throttling channel. ch := c.trfChan.Swap(nil) close(*ch) } c.transportResponseFrames-- } return h, nil } // finish closes the control buffer, cleaning up any streams that have queued // header frames. Once this method returns, no more frames can be added to the // control buffer, and attempts to do so will return ErrConnClosing. func (c *controlBuffer) finish() { c.mu.Lock() defer c.mu.Unlock() if c.closed { return } c.closed = true // There may be headers for streams in the control buffer. // These streams need to be cleaned out since the transport // is still not aware of these yet. for head := c.list.dequeueAll(); head != nil; head = head.next { switch v := head.it.(type) { case *headerFrame: if v.onOrphaned != nil { // It will be nil on the server-side. v.onOrphaned(ErrConnClosing) } case *dataFrame: if !v.processing { v.data.Free() } } } // In case throttle() is currently in flight, it needs to be unblocked. // Otherwise, the transport may not close, since the transport is closed by // the reader encountering the connection error. ch := c.trfChan.Swap(nil) if ch != nil { close(*ch) } } type side int const ( clientSide side = iota serverSide ) // maxWriteBufSize is the maximum length (number of elements) the cached // writeBuf can grow to. The length depends on the number of buffers // contained within the BufferSlice produced by the codec, which is // generally small. // // If a writeBuf larger than this limit is required, it will be allocated // and freed after use, rather than being cached. This avoids holding // on to large amounts of memory. const maxWriteBufSize = 64 // Loopy receives frames from the control buffer. // Each frame is handled individually; most of the work done by loopy goes // into handling data frames. Loopy maintains a queue of active streams, and each // stream maintains a queue of data frames; as loopy receives data frames // it gets added to the queue of the relevant stream. // Loopy goes over this list of active streams by processing one node every iteration, // thereby closely resembling a round-robin scheduling over all streams. While // processing a stream, loopy writes out data bytes from this stream capped by the min // of http2MaxFrameLen, connection-level flow control and stream-level flow control. type loopyWriter struct { side side cbuf *controlBuffer sendQuota uint32 oiws uint32 // outbound initial window size. // estdStreams is map of all established streams that are not cleaned-up yet. // On client-side, this is all streams whose headers were sent out. // On server-side, this is all streams whose headers were received. estdStreams map[uint32]*outStream // Established streams. // activeStreams is a linked-list of all streams that have data to send and some // stream-level flow control quota. // Each of these streams internally have a list of data items(and perhaps trailers // on the server-side) to be sent out. activeStreams *outStreamList framer *framer hBuf *bytes.Buffer // The buffer for HPACK encoding. hEnc *hpack.Encoder // HPACK encoder. bdpEst *bdpEstimator draining bool conn net.Conn logger *grpclog.PrefixLogger bufferPool mem.BufferPool // Side-specific handlers ssGoAwayHandler func(*goAway) (bool, error) writeBuf [][]byte // cached slice to avoid heap allocations for calls to mem.Reader.Peek. } func newLoopyWriter(s side, fr *framer, cbuf *controlBuffer, bdpEst *bdpEstimator, conn net.Conn, logger *grpclog.PrefixLogger, goAwayHandler func(*goAway) (bool, error), bufferPool mem.BufferPool) *loopyWriter { var buf bytes.Buffer l := &loopyWriter{ side: s, cbuf: cbuf, sendQuota: defaultWindowSize, oiws: defaultWindowSize, estdStreams: make(map[uint32]*outStream), activeStreams: newOutStreamList(), framer: fr, hBuf: &buf, hEnc: hpack.NewEncoder(&buf), bdpEst: bdpEst, conn: conn, logger: logger, ssGoAwayHandler: goAwayHandler, bufferPool: bufferPool, } return l } const minBatchSize = 1000 // run should be run in a separate goroutine. // It reads control frames from controlBuf and processes them by: // 1. Updating loopy's internal state, or/and // 2. Writing out HTTP2 frames on the wire. // // Loopy keeps all active streams with data to send in a linked-list. // All streams in the activeStreams linked-list must have both: // 1. Data to send, and // 2. Stream level flow control quota available. // // In each iteration of run loop, other than processing the incoming control // frame, loopy calls processData, which processes one node from the // activeStreams linked-list. This results in writing of HTTP2 frames into an // underlying write buffer. When there's no more control frames to read from // controlBuf, loopy flushes the write buffer. As an optimization, to increase // the batch size for each flush, loopy yields the processor, once if the batch // size is too low to give stream goroutines a chance to fill it up. // // Upon exiting, if the error causing the exit is not an I/O error, run() // flushes the underlying connection. The connection is always left open to // allow different closing behavior on the client and server. func (l *loopyWriter) run() (err error) { defer func() { if l.logger.V(logLevel) { l.logger.Infof("loopyWriter exiting with error: %v", err) } if !isIOError(err) { l.framer.writer.Flush() } l.cbuf.finish() }() for { it, err := l.cbuf.get(true) if err != nil { return err } if err = l.handle(it); err != nil { return err } if _, err = l.processData(); err != nil { return err } gosched := true hasdata: for { it, err := l.cbuf.get(false) if err != nil { return err } if it != nil { if err = l.handle(it); err != nil { return err } if _, err = l.processData(); err != nil { return err } continue hasdata } isEmpty, err := l.processData() if err != nil { return err } if !isEmpty { continue hasdata } if gosched { gosched = false if l.framer.writer.offset < minBatchSize { runtime.Gosched() continue hasdata } } l.framer.writer.Flush() break hasdata } } } func (l *loopyWriter) outgoingWindowUpdateHandler(w *outgoingWindowUpdate) error { return l.framer.fr.WriteWindowUpdate(w.streamID, w.increment) } func (l *loopyWriter) incomingWindowUpdateHandler(w *incomingWindowUpdate) { // Otherwise update the quota. if w.streamID == 0 { l.sendQuota += w.increment return } // Find the stream and update it. if str, ok := l.estdStreams[w.streamID]; ok { str.bytesOutStanding -= int(w.increment) if strQuota := int(l.oiws) - str.bytesOutStanding; strQuota > 0 && str.state == waitingOnStreamQuota { str.state = active l.activeStreams.enqueue(str) return } } } func (l *loopyWriter) outgoingSettingsHandler(s *outgoingSettings) error { return l.framer.fr.WriteSettings(s.ss...) } func (l *loopyWriter) incomingSettingsHandler(s *incomingSettings) error { l.applySettings(s.ss) return l.framer.fr.WriteSettingsAck() } func (l *loopyWriter) registerStreamHandler(h *registerStream) { str := &outStream{ id: h.streamID, state: empty, itl: &itemList{}, wq: h.wq, } l.estdStreams[h.streamID] = str } func (l *loopyWriter) headerHandler(h *headerFrame) error { if l.side == serverSide { str, ok := l.estdStreams[h.streamID] if !ok { if l.logger.V(logLevel) { l.logger.Infof("Unrecognized streamID %d in loopyWriter", h.streamID) } return nil } // Case 1.A: Server is responding back with headers. if !h.endStream { return l.writeHeader(h.streamID, h.endStream, h.hf, h.onWrite) } // else: Case 1.B: Server wants to close stream. if str.state != empty { // either active or waiting on stream quota. // add it str's list of items. str.itl.enqueue(h) return nil } if err := l.writeHeader(h.streamID, h.endStream, h.hf, h.onWrite); err != nil { return err } return l.cleanupStreamHandler(h.cleanup) } // Case 2: Client wants to originate stream. str := &outStream{ id: h.streamID, state: empty, itl: &itemList{}, wq: h.wq, } return l.originateStream(str, h) } func (l *loopyWriter) originateStream(str *outStream, hdr *headerFrame) error { // l.draining is set when handling GoAway. In which case, we want to avoid // creating new streams. if l.draining { // TODO: provide a better error with the reason we are in draining. hdr.onOrphaned(errStreamDrain) return nil } if err := hdr.initStream(str.id); err != nil { return err } if err := l.writeHeader(str.id, hdr.endStream, hdr.hf, hdr.onWrite); err != nil { return err } l.estdStreams[str.id] = str return nil } func (l *loopyWriter) writeHeader(streamID uint32, endStream bool, hf []hpack.HeaderField, onWrite func()) error { if onWrite != nil { onWrite() } l.hBuf.Reset() for _, f := range hf { if err := l.hEnc.WriteField(f); err != nil { if l.logger.V(logLevel) { l.logger.Warningf("Encountered error while encoding headers: %v", err) } } } var ( err error endHeaders, first bool ) first = true for !endHeaders { size := l.hBuf.Len() if size > http2MaxFrameLen { size = http2MaxFrameLen } else { endHeaders = true } if first { first = false err = l.framer.fr.WriteHeaders(http2.HeadersFrameParam{ StreamID: streamID, BlockFragment: l.hBuf.Next(size), EndStream: endStream, EndHeaders: endHeaders, }) } else { err = l.framer.fr.WriteContinuation( streamID, endHeaders, l.hBuf.Next(size), ) } if err != nil { return err } } return nil } func (l *loopyWriter) preprocessData(df *dataFrame) { str, ok := l.estdStreams[df.streamID] if !ok { return } // If we got data for a stream it means that // stream was originated and the headers were sent out. str.itl.enqueue(df) if str.state == empty { str.state = active l.activeStreams.enqueue(str) } } func (l *loopyWriter) pingHandler(p *ping) error { if !p.ack { l.bdpEst.timesnap(p.data) } return l.framer.fr.WritePing(p.ack, p.data) } func (l *loopyWriter) outFlowControlSizeRequestHandler(o *outFlowControlSizeRequest) { o.resp <- l.sendQuota } func (l *loopyWriter) cleanupStreamHandler(c *cleanupStream) error { c.onWrite() if str, ok := l.estdStreams[c.streamID]; ok { // On the server side it could be a trailers-only response or // a RST_STREAM before stream initialization thus the stream might // not be established yet. delete(l.estdStreams, c.streamID) str.reader.Close() str.deleteSelf() for head := str.itl.dequeueAll(); head != nil; head = head.next { if df, ok := head.it.(*dataFrame); ok { if !df.processing { df.data.Free() } } } } if c.rst { // If RST_STREAM needs to be sent. if err := l.framer.fr.WriteRSTStream(c.streamID, c.rstCode); err != nil { return err } } if l.draining && len(l.estdStreams) == 0 { // Flush and close the connection; we are done with it. return errors.New("finished processing active streams while in draining mode") } return nil } func (l *loopyWriter) earlyAbortStreamHandler(eas *earlyAbortStream) error { if l.side == clientSide { return errors.New("earlyAbortStream not handled on client") } // In case the caller forgets to set the http status, default to 200. if eas.httpStatus == 0 { eas.httpStatus = 200 } headerFields := []hpack.HeaderField{ {Name: ":status", Value: strconv.Itoa(int(eas.httpStatus))}, {Name: "content-type", Value: grpcutil.ContentType(eas.contentSubtype)}, {Name: "grpc-status", Value: strconv.Itoa(int(eas.status.Code()))}, {Name: "grpc-message", Value: encodeGrpcMessage(eas.status.Message())}, } if err := l.writeHeader(eas.streamID, true, headerFields, nil); err != nil { return err } if eas.rst { if err := l.framer.fr.WriteRSTStream(eas.streamID, http2.ErrCodeNo); err != nil { return err } } return nil } func (l *loopyWriter) incomingGoAwayHandler(*incomingGoAway) error { if l.side == clientSide { l.draining = true if len(l.estdStreams) == 0 { // Flush and close the connection; we are done with it. return errors.New("received GOAWAY with no active streams") } } return nil } func (l *loopyWriter) goAwayHandler(g *goAway) error { // Handling of outgoing GoAway is very specific to side. if l.ssGoAwayHandler != nil { draining, err := l.ssGoAwayHandler(g) if err != nil { return err } l.draining = draining } return nil } func (l *loopyWriter) handle(i any) error { switch i := i.(type) { case *incomingWindowUpdate: l.incomingWindowUpdateHandler(i) case *outgoingWindowUpdate: return l.outgoingWindowUpdateHandler(i) case *incomingSettings: return l.incomingSettingsHandler(i) case *outgoingSettings: return l.outgoingSettingsHandler(i) case *headerFrame: return l.headerHandler(i) case *registerStream: l.registerStreamHandler(i) case *cleanupStream: return l.cleanupStreamHandler(i) case *earlyAbortStream: return l.earlyAbortStreamHandler(i) case *incomingGoAway: return l.incomingGoAwayHandler(i) case *dataFrame: l.preprocessData(i) case *ping: return l.pingHandler(i) case *goAway: return l.goAwayHandler(i) case *outFlowControlSizeRequest: l.outFlowControlSizeRequestHandler(i) case closeConnection: // Just return a non-I/O error and run() will flush and close the // connection. return ErrConnClosing default: return fmt.Errorf("transport: unknown control message type %T", i) } return nil } func (l *loopyWriter) applySettings(ss []http2.Setting) { for _, s := range ss { switch s.ID { case http2.SettingInitialWindowSize: o := l.oiws l.oiws = s.Val if o < l.oiws { // If the new limit is greater make all depleted streams active. for _, stream := range l.estdStreams { if stream.state == waitingOnStreamQuota { stream.state = active l.activeStreams.enqueue(stream) } } } case http2.SettingHeaderTableSize: updateHeaderTblSize(l.hEnc, s.Val) } } } // processData removes the first stream from active streams, writes out at most 16KB // of its data and then puts it at the end of activeStreams if there's still more data // to be sent and stream has some stream-level flow control. func (l *loopyWriter) processData() (bool, error) { if l.sendQuota == 0 { return true, nil } str := l.activeStreams.dequeue() // Remove the first stream. if str == nil { return true, nil } reader := &str.reader dataItem := str.itl.peek().(*dataFrame) // Peek at the first data item this stream. if !dataItem.processing { dataItem.processing = true reader.Reset(dataItem.data) dataItem.data.Free() } // A data item is represented by a dataFrame, since it later translates into // multiple HTTP2 data frames. // Every dataFrame has two buffers; h that keeps grpc-message header and data // that is the actual message. As an optimization to keep wire traffic low, data // from data is copied to h to make as big as the maximum possible HTTP2 frame // size. if len(dataItem.h) == 0 && reader.Remaining() == 0 { // Empty data frame // Client sends out empty data frame with endStream = true if err := l.framer.writeData(dataItem.streamID, dataItem.endStream, nil); err != nil { return false, err } str.itl.dequeue() // remove the empty data item from stream reader.Close() if str.itl.isEmpty() { str.state = empty } else if trailer, ok := str.itl.peek().(*headerFrame); ok { // the next item is trailers. if err := l.writeHeader(trailer.streamID, trailer.endStream, trailer.hf, trailer.onWrite); err != nil { return false, err } if err := l.cleanupStreamHandler(trailer.cleanup); err != nil { return false, err } } else { l.activeStreams.enqueue(str) } return false, nil } // Figure out the maximum size we can send maxSize := http2MaxFrameLen if strQuota := int(l.oiws) - str.bytesOutStanding; strQuota <= 0 { // stream-level flow control. str.state = waitingOnStreamQuota return false, nil } else if maxSize > strQuota { maxSize = strQuota } if maxSize > int(l.sendQuota) { // connection-level flow control. maxSize = int(l.sendQuota) } // Compute how much of the header and data we can send within quota and max frame length hSize := min(maxSize, len(dataItem.h)) dSize := min(maxSize-hSize, reader.Remaining()) remainingBytes := len(dataItem.h) + reader.Remaining() - hSize - dSize size := hSize + dSize l.writeBuf = l.writeBuf[:0] if hSize > 0 { l.writeBuf = append(l.writeBuf, dataItem.h[:hSize]) } if dSize > 0 { var err error l.writeBuf, err = reader.Peek(dSize, l.writeBuf) if err != nil { // This must never happen since the reader must have at least dSize // bytes. // Log an error to fail tests. l.logger.Errorf("unexpected error while reading Data frame payload: %v", err) return false, err } } // Now that outgoing flow controls are checked we can replenish str's write quota str.wq.replenish(size) var endStream bool // If this is the last data message on this stream and all of it can be written in this iteration. if dataItem.endStream && remainingBytes == 0 { endStream = true } if dataItem.onEachWrite != nil { dataItem.onEachWrite() } err := l.framer.writeData(dataItem.streamID, endStream, l.writeBuf) reader.Discard(dSize) if cap(l.writeBuf) > maxWriteBufSize { l.writeBuf = nil } else { clear(l.writeBuf) } if err != nil { return false, err } str.bytesOutStanding += size l.sendQuota -= uint32(size) dataItem.h = dataItem.h[hSize:] if remainingBytes == 0 { // All the data from that message was written out. reader.Close() str.itl.dequeue() } if str.itl.isEmpty() { str.state = empty } else if trailer, ok := str.itl.peek().(*headerFrame); ok { // The next item is trailers. if err := l.writeHeader(trailer.streamID, trailer.endStream, trailer.hf, trailer.onWrite); err != nil { return false, err } if err := l.cleanupStreamHandler(trailer.cleanup); err != nil { return false, err } } else if int(l.oiws)-str.bytesOutStanding <= 0 { // Ran out of stream quota. str.state = waitingOnStreamQuota } else { // Otherwise add it back to the list of active streams. l.activeStreams.enqueue(str) } return false, nil } ================================================ FILE: vendor/google.golang.org/grpc/internal/transport/defaults.go ================================================ /* * * Copyright 2018 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package transport import ( "math" "time" ) const ( // The default value of flow control window size in HTTP2 spec. defaultWindowSize = 65535 // The initial window size for flow control. initialWindowSize = defaultWindowSize // for an RPC infinity = time.Duration(math.MaxInt64) defaultClientKeepaliveTime = infinity defaultClientKeepaliveTimeout = 20 * time.Second defaultMaxStreamsClient = 100 defaultMaxConnectionIdle = infinity defaultMaxConnectionAge = infinity defaultMaxConnectionAgeGrace = infinity defaultServerKeepaliveTime = 2 * time.Hour defaultServerKeepaliveTimeout = 20 * time.Second defaultKeepalivePolicyMinTime = 5 * time.Minute // max window limit set by HTTP2 Specs. maxWindowSize = math.MaxInt32 // defaultWriteQuota is the default value for number of data // bytes that each stream can schedule before some of it being // flushed out. defaultWriteQuota = 64 * 1024 defaultClientMaxHeaderListSize = uint32(16 << 20) defaultServerMaxHeaderListSize = uint32(16 << 20) ) // MaxStreamID is the upper bound for the stream ID before the current // transport gracefully closes and new transport is created for subsequent RPCs. // This is set to 75% of 2^31-1. Streams are identified with an unsigned 31-bit // integer. It's exported so that tests can override it. var MaxStreamID = uint32(math.MaxInt32 * 3 / 4) ================================================ FILE: vendor/google.golang.org/grpc/internal/transport/flowcontrol.go ================================================ /* * * Copyright 2014 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package transport import ( "fmt" "math" "sync" "sync/atomic" ) // writeQuota is a soft limit on the amount of data a stream can // schedule before some of it is written out. type writeQuota struct { _ noCopy // get waits on read from when quota goes less than or equal to zero. // replenish writes on it when quota goes positive again. ch chan struct{} // done is triggered in error case. done <-chan struct{} // replenish is called by loopyWriter to give quota back to. // It is implemented as a field so that it can be updated // by tests. replenish func(n int) quota int32 } // init allows a writeQuota to be initialized in-place, which is useful for // resetting a buffer or for avoiding a heap allocation when the buffer is // embedded in another struct. func (w *writeQuota) init(sz int32, done <-chan struct{}) { w.quota = sz w.ch = make(chan struct{}, 1) w.done = done w.replenish = w.realReplenish } func (w *writeQuota) get(sz int32) error { for { if atomic.LoadInt32(&w.quota) > 0 { atomic.AddInt32(&w.quota, -sz) return nil } select { case <-w.ch: continue case <-w.done: return errStreamDone } } } func (w *writeQuota) realReplenish(n int) { sz := int32(n) newQuota := atomic.AddInt32(&w.quota, sz) previousQuota := newQuota - sz if previousQuota <= 0 && newQuota > 0 { select { case w.ch <- struct{}{}: default: } } } type trInFlow struct { limit uint32 unacked uint32 effectiveWindowSize uint32 } func (f *trInFlow) newLimit(n uint32) uint32 { d := n - f.limit f.limit = n f.updateEffectiveWindowSize() return d } func (f *trInFlow) onData(n uint32) uint32 { f.unacked += n if f.unacked < f.limit/4 { f.updateEffectiveWindowSize() return 0 } return f.reset() } func (f *trInFlow) reset() uint32 { w := f.unacked f.unacked = 0 f.updateEffectiveWindowSize() return w } func (f *trInFlow) updateEffectiveWindowSize() { atomic.StoreUint32(&f.effectiveWindowSize, f.limit-f.unacked) } func (f *trInFlow) getSize() uint32 { return atomic.LoadUint32(&f.effectiveWindowSize) } // TODO(mmukhi): Simplify this code. // inFlow deals with inbound flow control type inFlow struct { mu sync.Mutex // The inbound flow control limit for pending data. limit uint32 // pendingData is the overall data which have been received but not been // consumed by applications. pendingData uint32 // The amount of data the application has consumed but grpc has not sent // window update for them. Used to reduce window update frequency. pendingUpdate uint32 // delta is the extra window update given by receiver when an application // is reading data bigger in size than the inFlow limit. delta uint32 } // newLimit updates the inflow window to a new value n. // It assumes that n is always greater than the old limit. func (f *inFlow) newLimit(n uint32) { f.mu.Lock() f.limit = n f.mu.Unlock() } func (f *inFlow) maybeAdjust(n uint32) uint32 { if n > uint32(math.MaxInt32) { n = uint32(math.MaxInt32) } f.mu.Lock() defer f.mu.Unlock() // estSenderQuota is the receiver's view of the maximum number of bytes the sender // can send without a window update. estSenderQuota := int32(f.limit - (f.pendingData + f.pendingUpdate)) // estUntransmittedData is the maximum number of bytes the sends might not have put // on the wire yet. A value of 0 or less means that we have already received all or // more bytes than the application is requesting to read. estUntransmittedData := int32(n - f.pendingData) // Casting into int32 since it could be negative. // This implies that unless we send a window update, the sender won't be able to send all the bytes // for this message. Therefore we must send an update over the limit since there's an active read // request from the application. if estUntransmittedData > estSenderQuota { // Sender's window shouldn't go more than 2^31 - 1 as specified in the HTTP spec. if f.limit+n > maxWindowSize { f.delta = maxWindowSize - f.limit } else { // Send a window update for the whole message and not just the difference between // estUntransmittedData and estSenderQuota. This will be helpful in case the message // is padded; We will fallback on the current available window(at least a 1/4th of the limit). f.delta = n } return f.delta } return 0 } // onData is invoked when some data frame is received. It updates pendingData. func (f *inFlow) onData(n uint32) error { f.mu.Lock() f.pendingData += n if f.pendingData+f.pendingUpdate > f.limit+f.delta { limit := f.limit rcvd := f.pendingData + f.pendingUpdate f.mu.Unlock() return fmt.Errorf("received %d-bytes data exceeding the limit %d bytes", rcvd, limit) } f.mu.Unlock() return nil } // onRead is invoked when the application reads the data. It returns the window size // to be sent to the peer. func (f *inFlow) onRead(n uint32) uint32 { f.mu.Lock() if f.pendingData == 0 { f.mu.Unlock() return 0 } f.pendingData -= n if n > f.delta { n -= f.delta f.delta = 0 } else { f.delta -= n n = 0 } f.pendingUpdate += n if f.pendingUpdate >= f.limit/4 { wu := f.pendingUpdate f.pendingUpdate = 0 f.mu.Unlock() return wu } f.mu.Unlock() return 0 } ================================================ FILE: vendor/google.golang.org/grpc/internal/transport/handler_server.go ================================================ /* * * Copyright 2016 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // This file is the implementation of a gRPC server using HTTP/2 which // uses the standard Go http2 Server implementation (via the // http.Handler interface), rather than speaking low-level HTTP/2 // frames itself. It is the implementation of *grpc.Server.ServeHTTP. package transport import ( "context" "errors" "fmt" "io" "net" "net/http" "strings" "sync" "time" "golang.org/x/net/http2" "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials" "google.golang.org/grpc/internal/grpclog" "google.golang.org/grpc/internal/grpcutil" "google.golang.org/grpc/mem" "google.golang.org/grpc/metadata" "google.golang.org/grpc/peer" "google.golang.org/grpc/stats" "google.golang.org/grpc/status" "google.golang.org/protobuf/proto" ) // NewServerHandlerTransport returns a ServerTransport handling gRPC from // inside an http.Handler, or writes an HTTP error to w and returns an error. // It requires that the http Server supports HTTP/2. func NewServerHandlerTransport(w http.ResponseWriter, r *http.Request, stats stats.Handler, bufferPool mem.BufferPool) (ServerTransport, error) { if r.Method != http.MethodPost { w.Header().Set("Allow", http.MethodPost) msg := fmt.Sprintf("invalid gRPC request method %q", r.Method) http.Error(w, msg, http.StatusMethodNotAllowed) return nil, errors.New(msg) } contentType := r.Header.Get("Content-Type") // TODO: do we assume contentType is lowercase? we did before contentSubtype, validContentType := grpcutil.ContentSubtype(contentType) if !validContentType { msg := fmt.Sprintf("invalid gRPC request content-type %q", contentType) http.Error(w, msg, http.StatusUnsupportedMediaType) return nil, errors.New(msg) } if r.ProtoMajor != 2 { msg := "gRPC requires HTTP/2" http.Error(w, msg, http.StatusHTTPVersionNotSupported) return nil, errors.New(msg) } if _, ok := w.(http.Flusher); !ok { msg := "gRPC requires a ResponseWriter supporting http.Flusher" http.Error(w, msg, http.StatusInternalServerError) return nil, errors.New(msg) } var localAddr net.Addr if la := r.Context().Value(http.LocalAddrContextKey); la != nil { localAddr, _ = la.(net.Addr) } var authInfo credentials.AuthInfo if r.TLS != nil { authInfo = credentials.TLSInfo{State: *r.TLS, CommonAuthInfo: credentials.CommonAuthInfo{SecurityLevel: credentials.PrivacyAndIntegrity}} } p := peer.Peer{ Addr: strAddr(r.RemoteAddr), LocalAddr: localAddr, AuthInfo: authInfo, } st := &serverHandlerTransport{ rw: w, req: r, closedCh: make(chan struct{}), writes: make(chan func()), peer: p, contentType: contentType, contentSubtype: contentSubtype, stats: stats, bufferPool: bufferPool, } st.logger = prefixLoggerForServerHandlerTransport(st) if v := r.Header.Get("grpc-timeout"); v != "" { to, err := decodeTimeout(v) if err != nil { msg := fmt.Sprintf("malformed grpc-timeout: %v", err) http.Error(w, msg, http.StatusBadRequest) return nil, status.Error(codes.Internal, msg) } st.timeoutSet = true st.timeout = to } metakv := []string{"content-type", contentType} if r.Host != "" { metakv = append(metakv, ":authority", r.Host) } for k, vv := range r.Header { k = strings.ToLower(k) if isReservedHeader(k) && !isWhitelistedHeader(k) { continue } for _, v := range vv { v, err := decodeMetadataHeader(k, v) if err != nil { msg := fmt.Sprintf("malformed binary metadata %q in header %q: %v", v, k, err) http.Error(w, msg, http.StatusBadRequest) return nil, status.Error(codes.Internal, msg) } metakv = append(metakv, k, v) } } st.headerMD = metadata.Pairs(metakv...) return st, nil } // serverHandlerTransport is an implementation of ServerTransport // which replies to exactly one gRPC request (exactly one HTTP request), // using the net/http.Handler interface. This http.Handler is guaranteed // at this point to be speaking over HTTP/2, so it's able to speak valid // gRPC. type serverHandlerTransport struct { rw http.ResponseWriter req *http.Request timeoutSet bool timeout time.Duration headerMD metadata.MD peer peer.Peer closeOnce sync.Once closedCh chan struct{} // closed on Close // writes is a channel of code to run serialized in the // ServeHTTP (HandleStreams) goroutine. The channel is closed // when WriteStatus is called. writes chan func() // block concurrent WriteStatus calls // e.g. grpc/(*serverStream).SendMsg/RecvMsg writeStatusMu sync.Mutex // we just mirror the request content-type contentType string // we store both contentType and contentSubtype so we don't keep recreating them // TODO make sure this is consistent across handler_server and http2_server contentSubtype string stats stats.Handler logger *grpclog.PrefixLogger bufferPool mem.BufferPool } func (ht *serverHandlerTransport) Close(err error) { ht.closeOnce.Do(func() { if ht.logger.V(logLevel) { ht.logger.Infof("Closing: %v", err) } close(ht.closedCh) }) } func (ht *serverHandlerTransport) Peer() *peer.Peer { return &peer.Peer{ Addr: ht.peer.Addr, LocalAddr: ht.peer.LocalAddr, AuthInfo: ht.peer.AuthInfo, } } // strAddr is a net.Addr backed by either a TCP "ip:port" string, or // the empty string if unknown. type strAddr string func (a strAddr) Network() string { if a != "" { // Per the documentation on net/http.Request.RemoteAddr, if this is // set, it's set to the IP:port of the peer (hence, TCP): // https://golang.org/pkg/net/http/#Request // // If we want to support Unix sockets later, we can // add our own grpc-specific convention within the // grpc codebase to set RemoteAddr to a different // format, or probably better: we can attach it to the // context and use that from serverHandlerTransport.RemoteAddr. return "tcp" } return "" } func (a strAddr) String() string { return string(a) } // do runs fn in the ServeHTTP goroutine. func (ht *serverHandlerTransport) do(fn func()) error { select { case <-ht.closedCh: return ErrConnClosing case ht.writes <- fn: return nil } } func (ht *serverHandlerTransport) writeStatus(s *ServerStream, st *status.Status) error { ht.writeStatusMu.Lock() defer ht.writeStatusMu.Unlock() headersWritten := s.updateHeaderSent() err := ht.do(func() { if !headersWritten { ht.writePendingHeaders(s) } // And flush, in case no header or body has been sent yet. // This forces a separation of headers and trailers if this is the // first call (for example, in end2end tests's TestNoService). ht.rw.(http.Flusher).Flush() h := ht.rw.Header() h.Set("Grpc-Status", fmt.Sprintf("%d", st.Code())) if m := st.Message(); m != "" { h.Set("Grpc-Message", encodeGrpcMessage(m)) } s.hdrMu.Lock() defer s.hdrMu.Unlock() if p := st.Proto(); p != nil && len(p.Details) > 0 { delete(s.trailer, grpcStatusDetailsBinHeader) stBytes, err := proto.Marshal(p) if err != nil { // TODO: return error instead, when callers are able to handle it. panic(err) } h.Set(grpcStatusDetailsBinHeader, encodeBinHeader(stBytes)) } if len(s.trailer) > 0 { for k, vv := range s.trailer { // Clients don't tolerate reading restricted headers after some non restricted ones were sent. if isReservedHeader(k) { continue } for _, v := range vv { // http2 ResponseWriter mechanism to send undeclared Trailers after // the headers have possibly been written. h.Add(http2.TrailerPrefix+k, encodeMetadataHeader(k, v)) } } } }) if err == nil && ht.stats != nil { // transport has not been closed // Note: The trailer fields are compressed with hpack after this call returns. // No WireLength field is set here. s.hdrMu.Lock() ht.stats.HandleRPC(s.Context(), &stats.OutTrailer{ Trailer: s.trailer.Copy(), }) s.hdrMu.Unlock() } ht.Close(errors.New("finished writing status")) return err } // writePendingHeaders sets common and custom headers on the first // write call (Write, WriteHeader, or WriteStatus) func (ht *serverHandlerTransport) writePendingHeaders(s *ServerStream) { ht.writeCommonHeaders(s) ht.writeCustomHeaders(s) } // writeCommonHeaders sets common headers on the first write // call (Write, WriteHeader, or WriteStatus). func (ht *serverHandlerTransport) writeCommonHeaders(s *ServerStream) { h := ht.rw.Header() h["Date"] = nil // suppress Date to make tests happy; TODO: restore h.Set("Content-Type", ht.contentType) // Predeclare trailers we'll set later in WriteStatus (after the body). // This is a SHOULD in the HTTP RFC, and the way you add (known) // Trailers per the net/http.ResponseWriter contract. // See https://golang.org/pkg/net/http/#ResponseWriter // and https://golang.org/pkg/net/http/#example_ResponseWriter_trailers h.Add("Trailer", "Grpc-Status") h.Add("Trailer", "Grpc-Message") h.Add("Trailer", "Grpc-Status-Details-Bin") if s.sendCompress != "" { h.Set("Grpc-Encoding", s.sendCompress) } } // writeCustomHeaders sets custom headers set on the stream via SetHeader // on the first write call (Write, WriteHeader, or WriteStatus) func (ht *serverHandlerTransport) writeCustomHeaders(s *ServerStream) { h := ht.rw.Header() s.hdrMu.Lock() for k, vv := range s.header { if isReservedHeader(k) { continue } for _, v := range vv { h.Add(k, encodeMetadataHeader(k, v)) } } s.hdrMu.Unlock() } func (ht *serverHandlerTransport) write(s *ServerStream, hdr []byte, data mem.BufferSlice, _ *WriteOptions) error { // Always take a reference because otherwise there is no guarantee the data will // be available after this function returns. This is what callers to Write // expect. data.Ref() headersWritten := s.updateHeaderSent() err := ht.do(func() { defer data.Free() if !headersWritten { ht.writePendingHeaders(s) } ht.rw.Write(hdr) for _, b := range data { _, _ = ht.rw.Write(b.ReadOnlyData()) } ht.rw.(http.Flusher).Flush() }) if err != nil { data.Free() return err } return nil } func (ht *serverHandlerTransport) writeHeader(s *ServerStream, md metadata.MD) error { if err := s.SetHeader(md); err != nil { return err } headersWritten := s.updateHeaderSent() err := ht.do(func() { if !headersWritten { ht.writePendingHeaders(s) } ht.rw.WriteHeader(200) ht.rw.(http.Flusher).Flush() }) if err == nil && ht.stats != nil { // Note: The header fields are compressed with hpack after this call returns. // No WireLength field is set here. ht.stats.HandleRPC(s.Context(), &stats.OutHeader{ Header: md.Copy(), Compression: s.sendCompress, }) } return err } func (ht *serverHandlerTransport) adjustWindow(*ServerStream, uint32) { } func (ht *serverHandlerTransport) updateWindow(*ServerStream, uint32) { } func (ht *serverHandlerTransport) HandleStreams(ctx context.Context, startStream func(*ServerStream)) { // With this transport type there will be exactly 1 stream: this HTTP request. var cancel context.CancelFunc if ht.timeoutSet { ctx, cancel = context.WithTimeout(ctx, ht.timeout) } else { ctx, cancel = context.WithCancel(ctx) } // requestOver is closed when the status has been written via WriteStatus. requestOver := make(chan struct{}) go func() { select { case <-requestOver: case <-ht.closedCh: case <-ht.req.Context().Done(): } cancel() ht.Close(errors.New("request is done processing")) }() ctx = metadata.NewIncomingContext(ctx, ht.headerMD) req := ht.req s := &ServerStream{ Stream: Stream{ id: 0, // irrelevant ctx: ctx, method: req.URL.Path, recvCompress: req.Header.Get("grpc-encoding"), contentSubtype: ht.contentSubtype, }, cancel: cancel, st: ht, headerWireLength: 0, // won't have access to header wire length until golang/go#18997. } s.Stream.buf.init() s.readRequester = s s.trReader = transportReader{ reader: recvBufferReader{ctx: s.ctx, ctxDone: s.ctx.Done(), recv: &s.buf}, windowHandler: s, } // readerDone is closed when the Body.Read-ing goroutine exits. readerDone := make(chan struct{}) go func() { defer close(readerDone) for { buf := ht.bufferPool.Get(http2MaxFrameLen) n, err := req.Body.Read(*buf) if n > 0 { *buf = (*buf)[:n] s.buf.put(recvMsg{buffer: mem.NewBuffer(buf, ht.bufferPool)}) } else { ht.bufferPool.Put(buf) } if err != nil { s.buf.put(recvMsg{err: mapRecvMsgError(err)}) return } } }() // startStream is provided by the *grpc.Server's serveStreams. // It starts a goroutine serving s and exits immediately. // The goroutine that is started is the one that then calls // into ht, calling WriteHeader, Write, WriteStatus, Close, etc. startStream(s) ht.runStream() close(requestOver) // Wait for reading goroutine to finish. req.Body.Close() <-readerDone } func (ht *serverHandlerTransport) runStream() { for { select { case fn := <-ht.writes: fn() case <-ht.closedCh: return } } } func (ht *serverHandlerTransport) incrMsgRecv() {} func (ht *serverHandlerTransport) Drain(string) { panic("Drain() is not implemented") } // mapRecvMsgError returns the non-nil err into the appropriate // error value as expected by callers of *grpc.parser.recvMsg. // In particular, in can only be: // - io.EOF // - io.ErrUnexpectedEOF // - of type transport.ConnectionError // - an error from the status package func mapRecvMsgError(err error) error { if err == io.EOF || err == io.ErrUnexpectedEOF { return err } if se, ok := err.(http2.StreamError); ok { if code, ok := http2ErrConvTab[se.Code]; ok { return status.Error(code, se.Error()) } } if strings.Contains(err.Error(), "body closed by handler") { return status.Error(codes.Canceled, err.Error()) } return connectionErrorf(true, err, "%s", err.Error()) } ================================================ FILE: vendor/google.golang.org/grpc/internal/transport/http2_client.go ================================================ /* * * Copyright 2014 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package transport import ( "context" "fmt" "io" "math" "net" "net/http" "path/filepath" "strconv" "strings" "sync" "sync/atomic" "time" "golang.org/x/net/http2" "golang.org/x/net/http2/hpack" "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials" "google.golang.org/grpc/internal" "google.golang.org/grpc/internal/channelz" icredentials "google.golang.org/grpc/internal/credentials" "google.golang.org/grpc/internal/grpclog" "google.golang.org/grpc/internal/grpcsync" "google.golang.org/grpc/internal/grpcutil" imetadata "google.golang.org/grpc/internal/metadata" "google.golang.org/grpc/internal/proxyattributes" istats "google.golang.org/grpc/internal/stats" istatus "google.golang.org/grpc/internal/status" isyscall "google.golang.org/grpc/internal/syscall" "google.golang.org/grpc/internal/transport/networktype" "google.golang.org/grpc/keepalive" "google.golang.org/grpc/mem" "google.golang.org/grpc/metadata" "google.golang.org/grpc/peer" "google.golang.org/grpc/resolver" "google.golang.org/grpc/stats" "google.golang.org/grpc/status" ) // clientConnectionCounter counts the number of connections a client has // initiated (equal to the number of http2Clients created). Must be accessed // atomically. var clientConnectionCounter uint64 var goAwayLoopyWriterTimeout = 5 * time.Second var metadataFromOutgoingContextRaw = internal.FromOutgoingContextRaw.(func(context.Context) (metadata.MD, [][]string, bool)) // http2Client implements the ClientTransport interface with HTTP2. type http2Client struct { lastRead int64 // Keep this field 64-bit aligned. Accessed atomically. ctx context.Context cancel context.CancelFunc ctxDone <-chan struct{} // Cache the ctx.Done() chan. userAgent string // address contains the resolver returned address for this transport. // If the `ServerName` field is set, it takes precedence over `CallHdr.Host` // passed to `NewStream`, when determining the :authority header. address resolver.Address md metadata.MD conn net.Conn // underlying communication channel loopy *loopyWriter remoteAddr net.Addr localAddr net.Addr authInfo credentials.AuthInfo // auth info about the connection readerDone chan struct{} // sync point to enable testing. writerDone chan struct{} // sync point to enable testing. // goAway is closed to notify the upper layer (i.e., addrConn.transportMonitor) // that the server sent GoAway on this transport. goAway chan struct{} keepaliveDone chan struct{} // Closed when the keepalive goroutine exits. framer *framer // controlBuf delivers all the control related tasks (e.g., window // updates, reset streams, and various settings) to the controller. // Do not access controlBuf with mu held. controlBuf *controlBuffer fc *trInFlow // The scheme used: https if TLS is on, http otherwise. scheme string isSecure bool perRPCCreds []credentials.PerRPCCredentials kp keepalive.ClientParameters keepaliveEnabled bool statsHandler stats.Handler initialWindowSize int32 // configured by peer through SETTINGS_MAX_HEADER_LIST_SIZE maxSendHeaderListSize *uint32 bdpEst *bdpEstimator maxConcurrentStreams uint32 streamQuota int64 streamsQuotaAvailable chan struct{} waitingStreams uint32 registeredCompressors string // Do not access controlBuf with mu held. mu sync.Mutex // guard the following variables nextID uint32 state transportState activeStreams map[uint32]*ClientStream // prevGoAway ID records the Last-Stream-ID in the previous GOAway frame. prevGoAwayID uint32 // goAwayReason records the http2.ErrCode and debug data received with the // GoAway frame. goAwayReason GoAwayReason // goAwayDebugMessage contains a detailed human readable string about a // GoAway frame, useful for error messages. goAwayDebugMessage string // A condition variable used to signal when the keepalive goroutine should // go dormant. The condition for dormancy is based on the number of active // streams and the `PermitWithoutStream` keepalive client parameter. And // since the number of active streams is guarded by the above mutex, we use // the same for this condition variable as well. kpDormancyCond *sync.Cond // A boolean to track whether the keepalive goroutine is dormant or not. // This is checked before attempting to signal the above condition // variable. kpDormant bool channelz *channelz.Socket onClose func(GoAwayReason) bufferPool mem.BufferPool connectionID uint64 logger *grpclog.PrefixLogger } func dial(ctx context.Context, fn func(context.Context, string) (net.Conn, error), addr resolver.Address, grpcUA string) (net.Conn, error) { address := addr.Addr networkType, ok := networktype.Get(addr) if fn != nil { // Special handling for unix scheme with custom dialer. Back in the day, // we did not have a unix resolver and therefore targets with a unix // scheme would end up using the passthrough resolver. So, user's used a // custom dialer in this case and expected the original dial target to // be passed to the custom dialer. Now, we have a unix resolver. But if // a custom dialer is specified, we want to retain the old behavior in // terms of the address being passed to the custom dialer. if networkType == "unix" && !strings.HasPrefix(address, "\x00") { // Supported unix targets are either "unix://absolute-path" or // "unix:relative-path". if filepath.IsAbs(address) { return fn(ctx, "unix://"+address) } return fn(ctx, "unix:"+address) } return fn(ctx, address) } if !ok { networkType, address = ParseDialTarget(address) } if opts, present := proxyattributes.Get(addr); present { return proxyDial(ctx, addr, grpcUA, opts) } return internal.NetDialerWithTCPKeepalive().DialContext(ctx, networkType, address) } func isTemporary(err error) bool { switch err := err.(type) { case interface { Temporary() bool }: return err.Temporary() case interface { Timeout() bool }: // Timeouts may be resolved upon retry, and are thus treated as // temporary. return err.Timeout() } return true } // NewHTTP2Client constructs a connected ClientTransport to addr based on HTTP2 // and starts to receive messages on it. Non-nil error returns if construction // fails. func NewHTTP2Client(connectCtx, ctx context.Context, addr resolver.Address, opts ConnectOptions, onClose func(GoAwayReason)) (_ ClientTransport, err error) { scheme := "http" ctx, cancel := context.WithCancel(ctx) defer func() { if err != nil { cancel() } }() // gRPC, resolver, balancer etc. can specify arbitrary data in the // Attributes field of resolver.Address, which is shoved into connectCtx // and passed to the dialer and credential handshaker. This makes it possible for // address specific arbitrary data to reach custom dialers and credential handshakers. connectCtx = icredentials.NewClientHandshakeInfoContext(connectCtx, credentials.ClientHandshakeInfo{Attributes: addr.Attributes}) conn, err := dial(connectCtx, opts.Dialer, addr, opts.UserAgent) if err != nil { if opts.FailOnNonTempDialError { return nil, connectionErrorf(isTemporary(err), err, "transport: error while dialing: %v", err) } return nil, connectionErrorf(true, err, "transport: Error while dialing: %v", err) } // Any further errors will close the underlying connection defer func(conn net.Conn) { if err != nil { conn.Close() } }(conn) // The following defer and goroutine monitor the connectCtx for cancellation // and deadline. On context expiration, the connection is hard closed and // this function will naturally fail as a result. Otherwise, the defer // waits for the goroutine to exit to prevent the context from being // monitored (and to prevent the connection from ever being closed) after // returning from this function. ctxMonitorDone := grpcsync.NewEvent() newClientCtx, newClientDone := context.WithCancel(connectCtx) defer func() { newClientDone() // Awaken the goroutine below if connectCtx hasn't expired. <-ctxMonitorDone.Done() // Wait for the goroutine below to exit. }() go func(conn net.Conn) { defer ctxMonitorDone.Fire() // Signal this goroutine has exited. <-newClientCtx.Done() // Block until connectCtx expires or the defer above executes. if err := connectCtx.Err(); err != nil { // connectCtx expired before exiting the function. Hard close the connection. if logger.V(logLevel) { logger.Infof("Aborting due to connect deadline expiring: %v", err) } conn.Close() } }(conn) kp := opts.KeepaliveParams // Validate keepalive parameters. if kp.Time == 0 { kp.Time = defaultClientKeepaliveTime } if kp.Timeout == 0 { kp.Timeout = defaultClientKeepaliveTimeout } keepaliveEnabled := false if kp.Time != infinity { if err = isyscall.SetTCPUserTimeout(conn, kp.Timeout); err != nil { return nil, connectionErrorf(false, err, "transport: failed to set TCP_USER_TIMEOUT: %v", err) } keepaliveEnabled = true } var ( isSecure bool authInfo credentials.AuthInfo ) transportCreds := opts.TransportCredentials perRPCCreds := opts.PerRPCCredentials if b := opts.CredsBundle; b != nil { if t := b.TransportCredentials(); t != nil { transportCreds = t } if t := b.PerRPCCredentials(); t != nil { perRPCCreds = append(perRPCCreds, t) } } if transportCreds != nil { conn, authInfo, err = transportCreds.ClientHandshake(connectCtx, addr.ServerName, conn) if err != nil { return nil, connectionErrorf(isTemporary(err), err, "transport: authentication handshake failed: %v", err) } for _, cd := range perRPCCreds { if cd.RequireTransportSecurity() { if ci, ok := authInfo.(interface { GetCommonAuthInfo() credentials.CommonAuthInfo }); ok { secLevel := ci.GetCommonAuthInfo().SecurityLevel if secLevel != credentials.InvalidSecurityLevel && secLevel < credentials.PrivacyAndIntegrity { return nil, connectionErrorf(true, nil, "transport: cannot send secure credentials on an insecure connection") } } } } isSecure = true if transportCreds.Info().SecurityProtocol == "tls" { scheme = "https" } } icwz := int32(initialWindowSize) if opts.InitialConnWindowSize >= defaultWindowSize { icwz = opts.InitialConnWindowSize } writeBufSize := opts.WriteBufferSize readBufSize := opts.ReadBufferSize maxHeaderListSize := defaultClientMaxHeaderListSize if opts.MaxHeaderListSize != nil { maxHeaderListSize = *opts.MaxHeaderListSize } t := &http2Client{ ctx: ctx, ctxDone: ctx.Done(), // Cache Done chan. cancel: cancel, userAgent: opts.UserAgent, registeredCompressors: grpcutil.RegisteredCompressors(), address: addr, conn: conn, remoteAddr: conn.RemoteAddr(), localAddr: conn.LocalAddr(), authInfo: authInfo, readerDone: make(chan struct{}), writerDone: make(chan struct{}), goAway: make(chan struct{}), keepaliveDone: make(chan struct{}), framer: newFramer(conn, writeBufSize, readBufSize, opts.SharedWriteBuffer, maxHeaderListSize, opts.BufferPool), fc: &trInFlow{limit: uint32(icwz)}, scheme: scheme, activeStreams: make(map[uint32]*ClientStream), isSecure: isSecure, perRPCCreds: perRPCCreds, kp: kp, statsHandler: istats.NewCombinedHandler(opts.StatsHandlers...), initialWindowSize: initialWindowSize, nextID: 1, maxConcurrentStreams: defaultMaxStreamsClient, streamQuota: defaultMaxStreamsClient, streamsQuotaAvailable: make(chan struct{}, 1), keepaliveEnabled: keepaliveEnabled, bufferPool: opts.BufferPool, onClose: onClose, } var czSecurity credentials.ChannelzSecurityValue if au, ok := authInfo.(credentials.ChannelzSecurityInfo); ok { czSecurity = au.GetSecurityValue() } t.channelz = channelz.RegisterSocket( &channelz.Socket{ SocketType: channelz.SocketTypeNormal, Parent: opts.ChannelzParent, SocketMetrics: channelz.SocketMetrics{}, EphemeralMetrics: t.socketMetrics, LocalAddr: t.localAddr, RemoteAddr: t.remoteAddr, SocketOptions: channelz.GetSocketOption(t.conn), Security: czSecurity, }) t.logger = prefixLoggerForClientTransport(t) // Add peer information to the http2client context. t.ctx = peer.NewContext(t.ctx, t.Peer()) if md, ok := addr.Metadata.(*metadata.MD); ok { t.md = *md } else if md := imetadata.Get(addr); md != nil { t.md = md } t.controlBuf = newControlBuffer(t.ctxDone) if opts.InitialWindowSize >= defaultWindowSize { t.initialWindowSize = opts.InitialWindowSize } if !opts.StaticWindowSize { t.bdpEst = &bdpEstimator{ bdp: initialWindowSize, updateFlowControl: t.updateFlowControl, } } if t.statsHandler != nil { t.ctx = t.statsHandler.TagConn(t.ctx, &stats.ConnTagInfo{ RemoteAddr: t.remoteAddr, LocalAddr: t.localAddr, }) t.statsHandler.HandleConn(t.ctx, &stats.ConnBegin{ Client: true, }) } if t.keepaliveEnabled { t.kpDormancyCond = sync.NewCond(&t.mu) go t.keepalive() } // Start the reader goroutine for incoming messages. Each transport has a // dedicated goroutine which reads HTTP2 frames from the network. Then it // dispatches the frame to the corresponding stream entity. When the // server preface is received, readerErrCh is closed. If an error occurs // first, an error is pushed to the channel. This must be checked before // returning from this function. readerErrCh := make(chan error, 1) go t.reader(readerErrCh) defer func() { if err != nil { // writerDone should be closed since the loopy goroutine // wouldn't have started in the case this function returns an error. close(t.writerDone) t.Close(err) } }() // Send connection preface to server. n, err := t.conn.Write(clientPreface) if err != nil { err = connectionErrorf(true, err, "transport: failed to write client preface: %v", err) return nil, err } if n != len(clientPreface) { err = connectionErrorf(true, nil, "transport: preface mismatch, wrote %d bytes; want %d", n, len(clientPreface)) return nil, err } var ss []http2.Setting if t.initialWindowSize != defaultWindowSize { ss = append(ss, http2.Setting{ ID: http2.SettingInitialWindowSize, Val: uint32(t.initialWindowSize), }) } if opts.MaxHeaderListSize != nil { ss = append(ss, http2.Setting{ ID: http2.SettingMaxHeaderListSize, Val: *opts.MaxHeaderListSize, }) } err = t.framer.fr.WriteSettings(ss...) if err != nil { err = connectionErrorf(true, err, "transport: failed to write initial settings frame: %v", err) return nil, err } // Adjust the connection flow control window if needed. if delta := uint32(icwz - defaultWindowSize); delta > 0 { if err := t.framer.fr.WriteWindowUpdate(0, delta); err != nil { err = connectionErrorf(true, err, "transport: failed to write window update: %v", err) return nil, err } } t.connectionID = atomic.AddUint64(&clientConnectionCounter, 1) if err := t.framer.writer.Flush(); err != nil { return nil, err } // Block until the server preface is received successfully or an error occurs. if err = <-readerErrCh; err != nil { return nil, err } go func() { t.loopy = newLoopyWriter(clientSide, t.framer, t.controlBuf, t.bdpEst, t.conn, t.logger, t.outgoingGoAwayHandler, t.bufferPool) if err := t.loopy.run(); !isIOError(err) { // Immediately close the connection, as the loopy writer returns // when there are no more active streams and we were draining (the // server sent a GOAWAY). For I/O errors, the reader will hit it // after draining any remaining incoming data. t.conn.Close() } close(t.writerDone) }() return t, nil } func (t *http2Client) newStream(ctx context.Context, callHdr *CallHdr) *ClientStream { // TODO(zhaoq): Handle uint32 overflow of Stream.id. s := &ClientStream{ Stream: Stream{ method: callHdr.Method, sendCompress: callHdr.SendCompress, contentSubtype: callHdr.ContentSubtype, }, ct: t, done: make(chan struct{}), headerChan: make(chan struct{}), doneFunc: callHdr.DoneFunc, } s.Stream.buf.init() s.Stream.wq.init(defaultWriteQuota, s.done) s.readRequester = s // The client side stream context should have exactly the same life cycle with the user provided context. // That means, s.ctx should be read-only. And s.ctx is done iff ctx is done. // So we use the original context here instead of creating a copy. s.ctx = ctx s.trReader = transportReader{ reader: recvBufferReader{ ctx: s.ctx, ctxDone: s.ctx.Done(), recv: &s.buf, clientStream: s, }, windowHandler: s, } return s } func (t *http2Client) Peer() *peer.Peer { return &peer.Peer{ Addr: t.remoteAddr, AuthInfo: t.authInfo, // Can be nil LocalAddr: t.localAddr, } } // OutgoingGoAwayHandler writes a GOAWAY to the connection. Always returns (false, err) as we want the GoAway // to be the last frame loopy writes to the transport. func (t *http2Client) outgoingGoAwayHandler(g *goAway) (bool, error) { t.mu.Lock() maxStreamID := t.nextID - 2 t.mu.Unlock() if err := t.framer.fr.WriteGoAway(maxStreamID, http2.ErrCodeNo, g.debugData); err != nil { return false, err } return false, g.closeConn } func (t *http2Client) createHeaderFields(ctx context.Context, callHdr *CallHdr) ([]hpack.HeaderField, error) { aud := t.createAudience(callHdr) ri := credentials.RequestInfo{ Method: callHdr.Method, AuthInfo: t.authInfo, } ctxWithRequestInfo := credentials.NewContextWithRequestInfo(ctx, ri) authData, err := t.getTrAuthData(ctxWithRequestInfo, aud) if err != nil { return nil, err } callAuthData, err := t.getCallAuthData(ctxWithRequestInfo, aud, callHdr) if err != nil { return nil, err } // TODO(mmukhi): Benchmark if the performance gets better if count the metadata and other header fields // first and create a slice of that exact size. // Make the slice of certain predictable size to reduce allocations made by append. hfLen := 7 // :method, :scheme, :path, :authority, content-type, user-agent, te hfLen += len(authData) + len(callAuthData) registeredCompressors := t.registeredCompressors if callHdr.AcceptedCompressors != nil { registeredCompressors = *callHdr.AcceptedCompressors } if callHdr.PreviousAttempts > 0 { hfLen++ } if callHdr.SendCompress != "" { hfLen++ } if registeredCompressors != "" { hfLen++ } if _, ok := ctx.Deadline(); ok { hfLen++ } headerFields := make([]hpack.HeaderField, 0, hfLen) headerFields = append(headerFields, hpack.HeaderField{Name: ":method", Value: "POST"}) headerFields = append(headerFields, hpack.HeaderField{Name: ":scheme", Value: t.scheme}) headerFields = append(headerFields, hpack.HeaderField{Name: ":path", Value: callHdr.Method}) headerFields = append(headerFields, hpack.HeaderField{Name: ":authority", Value: callHdr.Host}) headerFields = append(headerFields, hpack.HeaderField{Name: "content-type", Value: grpcutil.ContentType(callHdr.ContentSubtype)}) headerFields = append(headerFields, hpack.HeaderField{Name: "user-agent", Value: t.userAgent}) headerFields = append(headerFields, hpack.HeaderField{Name: "te", Value: "trailers"}) if callHdr.PreviousAttempts > 0 { headerFields = append(headerFields, hpack.HeaderField{Name: "grpc-previous-rpc-attempts", Value: strconv.Itoa(callHdr.PreviousAttempts)}) } if callHdr.SendCompress != "" { headerFields = append(headerFields, hpack.HeaderField{Name: "grpc-encoding", Value: callHdr.SendCompress}) // Include the outgoing compressor name when compressor is not registered // via encoding.RegisterCompressor. This is possible when client uses // WithCompressor dial option. if !grpcutil.IsCompressorNameRegistered(callHdr.SendCompress) { if registeredCompressors != "" { registeredCompressors += "," } registeredCompressors += callHdr.SendCompress } } if registeredCompressors != "" { headerFields = append(headerFields, hpack.HeaderField{Name: "grpc-accept-encoding", Value: registeredCompressors}) } if dl, ok := ctx.Deadline(); ok { // Send out timeout regardless its value. The server can detect timeout context by itself. // TODO(mmukhi): Perhaps this field should be updated when actually writing out to the wire. timeout := time.Until(dl) if timeout <= 0 { return nil, status.Error(codes.DeadlineExceeded, context.DeadlineExceeded.Error()) } headerFields = append(headerFields, hpack.HeaderField{Name: "grpc-timeout", Value: grpcutil.EncodeDuration(timeout)}) } for k, v := range authData { headerFields = append(headerFields, hpack.HeaderField{Name: k, Value: encodeMetadataHeader(k, v)}) } for k, v := range callAuthData { headerFields = append(headerFields, hpack.HeaderField{Name: k, Value: encodeMetadataHeader(k, v)}) } if md, added, ok := metadataFromOutgoingContextRaw(ctx); ok { var k string for k, vv := range md { // HTTP doesn't allow you to set pseudoheaders after non pseudoheaders were set. if isReservedHeader(k) { continue } for _, v := range vv { headerFields = append(headerFields, hpack.HeaderField{Name: k, Value: encodeMetadataHeader(k, v)}) } } for _, vv := range added { for i, v := range vv { if i%2 == 0 { k = strings.ToLower(v) continue } // HTTP doesn't allow you to set pseudoheaders after non pseudoheaders were set. if isReservedHeader(k) { continue } headerFields = append(headerFields, hpack.HeaderField{Name: k, Value: encodeMetadataHeader(k, v)}) } } } for k, vv := range t.md { if isReservedHeader(k) { continue } for _, v := range vv { headerFields = append(headerFields, hpack.HeaderField{Name: k, Value: encodeMetadataHeader(k, v)}) } } return headerFields, nil } func (t *http2Client) createAudience(callHdr *CallHdr) string { // Create an audience string only if needed. if len(t.perRPCCreds) == 0 && callHdr.Creds == nil { return "" } // Construct URI required to get auth request metadata. // Omit port if it is the default one. host := strings.TrimSuffix(callHdr.Host, ":443") pos := strings.LastIndex(callHdr.Method, "/") if pos == -1 { pos = len(callHdr.Method) } return "https://" + host + callHdr.Method[:pos] } func (t *http2Client) getTrAuthData(ctx context.Context, audience string) (map[string]string, error) { if len(t.perRPCCreds) == 0 { return nil, nil } authData := map[string]string{} for _, c := range t.perRPCCreds { data, err := c.GetRequestMetadata(ctx, audience) if err != nil { if st, ok := status.FromError(err); ok { // Restrict the code to the list allowed by gRFC A54. if istatus.IsRestrictedControlPlaneCode(st) { err = status.Errorf(codes.Internal, "transport: received per-RPC creds error with illegal status: %v", err) } return nil, err } return nil, status.Errorf(codes.Unauthenticated, "transport: per-RPC creds failed due to error: %v", err) } for k, v := range data { // Capital header names are illegal in HTTP/2. k = strings.ToLower(k) authData[k] = v } } return authData, nil } func (t *http2Client) getCallAuthData(ctx context.Context, audience string, callHdr *CallHdr) (map[string]string, error) { var callAuthData map[string]string // Check if credentials.PerRPCCredentials were provided via call options. // Note: if these credentials are provided both via dial options and call // options, then both sets of credentials will be applied. if callCreds := callHdr.Creds; callCreds != nil { if callCreds.RequireTransportSecurity() { ri, _ := credentials.RequestInfoFromContext(ctx) if !t.isSecure || credentials.CheckSecurityLevel(ri.AuthInfo, credentials.PrivacyAndIntegrity) != nil { return nil, status.Error(codes.Unauthenticated, "transport: cannot send secure credentials on an insecure connection") } } data, err := callCreds.GetRequestMetadata(ctx, audience) if err != nil { if st, ok := status.FromError(err); ok { // Restrict the code to the list allowed by gRFC A54. if istatus.IsRestrictedControlPlaneCode(st) { err = status.Errorf(codes.Internal, "transport: received per-RPC creds error with illegal status: %v", err) } return nil, err } return nil, status.Errorf(codes.Internal, "transport: per-RPC creds failed due to error: %v", err) } callAuthData = make(map[string]string, len(data)) for k, v := range data { // Capital header names are illegal in HTTP/2 k = strings.ToLower(k) callAuthData[k] = v } } return callAuthData, nil } // NewStreamError wraps an error and reports additional information. Typically // NewStream errors result in transparent retry, as they mean nothing went onto // the wire. However, there are two notable exceptions: // // 1. If the stream headers violate the max header list size allowed by the // server. It's possible this could succeed on another transport, even if // it's unlikely, but do not transparently retry. // 2. If the credentials errored when requesting their headers. In this case, // it's possible a retry can fix the problem, but indefinitely transparently // retrying is not appropriate as it is likely the credentials, if they can // eventually succeed, would need I/O to do so. type NewStreamError struct { Err error AllowTransparentRetry bool } func (e NewStreamError) Error() string { return e.Err.Error() } // NewStream creates a stream and registers it into the transport as "active" // streams. All non-nil errors returned will be *NewStreamError. func (t *http2Client) NewStream(ctx context.Context, callHdr *CallHdr) (*ClientStream, error) { ctx = peer.NewContext(ctx, t.Peer()) // ServerName field of the resolver returned address takes precedence over // Host field of CallHdr to determine the :authority header. This is because, // the ServerName field takes precedence for server authentication during // TLS handshake, and the :authority header should match the value used // for server authentication. if t.address.ServerName != "" { newCallHdr := *callHdr newCallHdr.Host = t.address.ServerName callHdr = &newCallHdr } // The authority specified via the `CallAuthority` CallOption takes the // highest precedence when determining the `:authority` header. It overrides // any value present in the Host field of CallHdr. Before applying this // override, the authority string is validated. If the credentials do not // implement the AuthorityValidator interface, or if validation fails, the // RPC is failed with a status code of `UNAVAILABLE`. if callHdr.Authority != "" { auth, ok := t.authInfo.(credentials.AuthorityValidator) if !ok { return nil, &NewStreamError{Err: status.Errorf(codes.Unavailable, "credentials type %q does not implement the AuthorityValidator interface, but authority override specified with CallAuthority call option", t.authInfo.AuthType())} } if err := auth.ValidateAuthority(callHdr.Authority); err != nil { return nil, &NewStreamError{Err: status.Errorf(codes.Unavailable, "failed to validate authority %q : %v", callHdr.Authority, err)} } newCallHdr := *callHdr newCallHdr.Host = callHdr.Authority callHdr = &newCallHdr } headerFields, err := t.createHeaderFields(ctx, callHdr) if err != nil { return nil, &NewStreamError{Err: err, AllowTransparentRetry: false} } s := t.newStream(ctx, callHdr) cleanup := func(err error) { if s.swapState(streamDone) == streamDone { // If it was already done, return. return } // The stream was unprocessed by the server. s.unprocessed.Store(true) s.write(recvMsg{err: err}) close(s.done) // If headerChan isn't closed, then close it. if atomic.CompareAndSwapUint32(&s.headerChanClosed, 0, 1) { close(s.headerChan) } } hdr := &headerFrame{ hf: headerFields, endStream: false, initStream: func(uint32) error { t.mu.Lock() // TODO: handle transport closure in loopy instead and remove this // initStream is never called when transport is draining. if t.state == closing { t.mu.Unlock() cleanup(ErrConnClosing) return ErrConnClosing } if channelz.IsOn() { t.channelz.SocketMetrics.StreamsStarted.Add(1) t.channelz.SocketMetrics.LastLocalStreamCreatedTimestamp.Store(time.Now().UnixNano()) } // If the keepalive goroutine has gone dormant, wake it up. if t.kpDormant { t.kpDormancyCond.Signal() } t.mu.Unlock() return nil }, onOrphaned: cleanup, wq: &s.wq, } firstTry := true var ch chan struct{} transportDrainRequired := false checkForStreamQuota := func() bool { if t.streamQuota <= 0 { // Can go negative if server decreases it. if firstTry { t.waitingStreams++ } ch = t.streamsQuotaAvailable return false } if !firstTry { t.waitingStreams-- } t.streamQuota-- t.mu.Lock() if t.state == draining || t.activeStreams == nil { // Can be niled from Close(). t.mu.Unlock() return false // Don't create a stream if the transport is already closed. } hdr.streamID = t.nextID t.nextID += 2 // Drain client transport if nextID > MaxStreamID which signals gRPC that // the connection is closed and a new one must be created for subsequent RPCs. transportDrainRequired = t.nextID > MaxStreamID s.id = hdr.streamID s.fc = inFlow{limit: uint32(t.initialWindowSize)} t.activeStreams[s.id] = s t.mu.Unlock() if t.streamQuota > 0 && t.waitingStreams > 0 { select { case t.streamsQuotaAvailable <- struct{}{}: default: } } return true } var hdrListSizeErr error checkForHeaderListSize := func() bool { if t.maxSendHeaderListSize == nil { return true } var sz int64 for _, f := range hdr.hf { if sz += int64(f.Size()); sz > int64(*t.maxSendHeaderListSize) { hdrListSizeErr = status.Errorf(codes.Internal, "header list size to send violates the maximum size (%d bytes) set by server", *t.maxSendHeaderListSize) return false } } return true } for { success, err := t.controlBuf.executeAndPut(func() bool { return checkForHeaderListSize() && checkForStreamQuota() }, hdr) if err != nil { // Connection closed. return nil, &NewStreamError{Err: err, AllowTransparentRetry: true} } if success { break } if hdrListSizeErr != nil { return nil, &NewStreamError{Err: hdrListSizeErr} } firstTry = false select { case <-ch: case <-ctx.Done(): return nil, &NewStreamError{Err: ContextErr(ctx.Err())} case <-t.goAway: return nil, &NewStreamError{Err: errStreamDrain, AllowTransparentRetry: true} case <-t.ctx.Done(): return nil, &NewStreamError{Err: ErrConnClosing, AllowTransparentRetry: true} } } if t.statsHandler != nil { header, ok := metadata.FromOutgoingContext(ctx) if ok { header.Set("user-agent", t.userAgent) } else { header = metadata.Pairs("user-agent", t.userAgent) } // Note: The header fields are compressed with hpack after this call returns. // No WireLength field is set here. t.statsHandler.HandleRPC(s.ctx, &stats.OutHeader{ Client: true, FullMethod: callHdr.Method, RemoteAddr: t.remoteAddr, LocalAddr: t.localAddr, Compression: callHdr.SendCompress, Header: header, }) } if transportDrainRequired { if t.logger.V(logLevel) { t.logger.Infof("Draining transport: t.nextID > MaxStreamID") } t.GracefulClose() } return s, nil } func (t *http2Client) closeStream(s *ClientStream, err error, rst bool, rstCode http2.ErrCode, st *status.Status, mdata map[string][]string, eosReceived bool) { // Set stream status to done. if s.swapState(streamDone) == streamDone { // If it was already done, return. If multiple closeStream calls // happen simultaneously, wait for the first to finish. <-s.done return } // status and trailers can be updated here without any synchronization because the stream goroutine will // only read it after it sees an io.EOF error from read or write and we'll write those errors // only after updating this. s.status = st if len(mdata) > 0 { s.trailer = mdata } if err != nil { // This will unblock reads eventually. s.write(recvMsg{err: err}) } // If headerChan isn't closed, then close it. if atomic.CompareAndSwapUint32(&s.headerChanClosed, 0, 1) { s.noHeaders = true close(s.headerChan) } cleanup := &cleanupStream{ streamID: s.id, onWrite: func() { t.mu.Lock() if t.activeStreams != nil { delete(t.activeStreams, s.id) } t.mu.Unlock() if channelz.IsOn() { if eosReceived { t.channelz.SocketMetrics.StreamsSucceeded.Add(1) } else { t.channelz.SocketMetrics.StreamsFailed.Add(1) } } }, rst: rst, rstCode: rstCode, } addBackStreamQuota := func() bool { t.streamQuota++ if t.streamQuota > 0 && t.waitingStreams > 0 { select { case t.streamsQuotaAvailable <- struct{}{}: default: } } return true } t.controlBuf.executeAndPut(addBackStreamQuota, cleanup) // This will unblock write. close(s.done) if s.doneFunc != nil { s.doneFunc() } } // Close kicks off the shutdown process of the transport. This should be called // only once on a transport. Once it is called, the transport should not be // accessed anymore. func (t *http2Client) Close(err error) { t.conn.SetWriteDeadline(time.Now().Add(time.Second * 10)) // For background on the deadline value chosen here, see // https://github.com/grpc/grpc-go/issues/8425#issuecomment-3057938248 . t.conn.SetReadDeadline(time.Now().Add(time.Second)) t.mu.Lock() // Make sure we only close once. if t.state == closing { t.mu.Unlock() return } if t.logger.V(logLevel) { t.logger.Infof("Closing: %v", err) } // Call t.onClose ASAP to prevent the client from attempting to create new // streams. if t.state != draining { t.onClose(GoAwayInvalid) } t.state = closing streams := t.activeStreams t.activeStreams = nil if t.kpDormant { // If the keepalive goroutine is blocked on this condition variable, we // should unblock it so that the goroutine eventually exits. t.kpDormancyCond.Signal() } // Append info about previous goaways if there were any, since this may be important // for understanding the root cause for this connection to be closed. goAwayDebugMessage := t.goAwayDebugMessage t.mu.Unlock() // Per HTTP/2 spec, a GOAWAY frame must be sent before closing the // connection. See https://httpwg.org/specs/rfc7540.html#GOAWAY. It // also waits for loopyWriter to be closed with a timer to avoid the // long blocking in case the connection is blackholed, i.e. TCP is // just stuck. t.controlBuf.put(&goAway{code: http2.ErrCodeNo, debugData: []byte("client transport shutdown"), closeConn: err}) timer := time.NewTimer(goAwayLoopyWriterTimeout) defer timer.Stop() select { case <-t.writerDone: // success case <-timer.C: t.logger.Infof("Failed to write a GOAWAY frame as part of connection close after %s. Giving up and closing the transport.", goAwayLoopyWriterTimeout) } t.cancel() t.conn.Close() // Waits for the reader and keepalive goroutines to exit before returning to // ensure all resources are cleaned up before Close can return. <-t.readerDone if t.keepaliveEnabled { <-t.keepaliveDone } channelz.RemoveEntry(t.channelz.ID) var st *status.Status if len(goAwayDebugMessage) > 0 { st = status.Newf(codes.Unavailable, "closing transport due to: %v, received prior goaway: %v", err, goAwayDebugMessage) err = st.Err() } else { st = status.New(codes.Unavailable, err.Error()) } // Notify all active streams. for _, s := range streams { t.closeStream(s, err, false, http2.ErrCodeNo, st, nil, false) } if t.statsHandler != nil { t.statsHandler.HandleConn(t.ctx, &stats.ConnEnd{ Client: true, }) } } // GracefulClose sets the state to draining, which prevents new streams from // being created and causes the transport to be closed when the last active // stream is closed. If there are no active streams, the transport is closed // immediately. This does nothing if the transport is already draining or // closing. func (t *http2Client) GracefulClose() { t.mu.Lock() // Make sure we move to draining only from active. if t.state == draining || t.state == closing { t.mu.Unlock() return } if t.logger.V(logLevel) { t.logger.Infof("GracefulClose called") } t.onClose(GoAwayInvalid) t.state = draining active := len(t.activeStreams) t.mu.Unlock() if active == 0 { t.Close(connectionErrorf(true, nil, "no active streams left to process while draining")) return } t.controlBuf.put(&incomingGoAway{}) } // Write formats the data into HTTP2 data frame(s) and sends it out. The caller // should proceed only if Write returns nil. func (t *http2Client) write(s *ClientStream, hdr []byte, data mem.BufferSlice, opts *WriteOptions) error { if opts.Last { // If it's the last message, update stream state. if !s.compareAndSwapState(streamActive, streamWriteDone) { return errStreamDone } } else if s.getState() != streamActive { return errStreamDone } df := &dataFrame{ streamID: s.id, endStream: opts.Last, h: hdr, data: data, } dataLen := data.Len() if hdr != nil || dataLen != 0 { // If it's not an empty data frame, check quota. if err := s.wq.get(int32(len(hdr) + dataLen)); err != nil { return err } } data.Ref() if err := t.controlBuf.put(df); err != nil { data.Free() return err } t.incrMsgSent() return nil } func (t *http2Client) getStream(f http2.Frame) *ClientStream { t.mu.Lock() s := t.activeStreams[f.Header().StreamID] t.mu.Unlock() return s } // adjustWindow sends out extra window update over the initial window size // of stream if the application is requesting data larger in size than // the window. func (t *http2Client) adjustWindow(s *ClientStream, n uint32) { if w := s.fc.maybeAdjust(n); w > 0 { t.controlBuf.put(&outgoingWindowUpdate{streamID: s.id, increment: w}) } } // updateWindow adjusts the inbound quota for the stream. // Window updates will be sent out when the cumulative quota // exceeds the corresponding threshold. func (t *http2Client) updateWindow(s *ClientStream, n uint32) { if w := s.fc.onRead(n); w > 0 { t.controlBuf.put(&outgoingWindowUpdate{streamID: s.id, increment: w}) } } // updateFlowControl updates the incoming flow control windows // for the transport and the stream based on the current bdp // estimation. func (t *http2Client) updateFlowControl(n uint32) { updateIWS := func() bool { t.initialWindowSize = int32(n) t.mu.Lock() for _, s := range t.activeStreams { s.fc.newLimit(n) } t.mu.Unlock() return true } t.controlBuf.executeAndPut(updateIWS, &outgoingWindowUpdate{streamID: 0, increment: t.fc.newLimit(n)}) t.controlBuf.put(&outgoingSettings{ ss: []http2.Setting{ { ID: http2.SettingInitialWindowSize, Val: n, }, }, }) } func (t *http2Client) handleData(f *parsedDataFrame) { size := f.Header().Length var sendBDPPing bool if t.bdpEst != nil { sendBDPPing = t.bdpEst.add(size) } // Decouple connection's flow control from application's read. // An update on connection's flow control should not depend on // whether user application has read the data or not. Such a // restriction is already imposed on the stream's flow control, // and therefore the sender will be blocked anyways. // Decoupling the connection flow control will prevent other // active(fast) streams from starving in presence of slow or // inactive streams. // if w := t.fc.onData(size); w > 0 { t.controlBuf.put(&outgoingWindowUpdate{ streamID: 0, increment: w, }) } if sendBDPPing { // Avoid excessive ping detection (e.g. in an L7 proxy) // by sending a window update prior to the BDP ping. if w := t.fc.reset(); w > 0 { t.controlBuf.put(&outgoingWindowUpdate{ streamID: 0, increment: w, }) } t.controlBuf.put(bdpPing) } // Select the right stream to dispatch. s := t.getStream(f) if s == nil { return } if size > 0 { if err := s.fc.onData(size); err != nil { t.closeStream(s, io.EOF, true, http2.ErrCodeFlowControl, status.New(codes.Internal, err.Error()), nil, false) return } dataLen := f.data.Len() if f.Header().Flags.Has(http2.FlagDataPadded) { if w := s.fc.onRead(size - uint32(dataLen)); w > 0 { t.controlBuf.put(&outgoingWindowUpdate{s.id, w}) } } if dataLen > 0 { f.data.Ref() s.write(recvMsg{buffer: f.data}) } } // The server has closed the stream without sending trailers. Record that // the read direction is closed, and set the status appropriately. if f.StreamEnded() { t.closeStream(s, io.EOF, false, http2.ErrCodeNo, status.New(codes.Internal, "server closed the stream without sending trailers"), nil, true) } } func (t *http2Client) handleRSTStream(f *http2.RSTStreamFrame) { s := t.getStream(f) if s == nil { return } if f.ErrCode == http2.ErrCodeRefusedStream { // The stream was unprocessed by the server. s.unprocessed.Store(true) } statusCode, ok := http2ErrConvTab[f.ErrCode] if !ok { if t.logger.V(logLevel) { t.logger.Infof("Received a RST_STREAM frame with code %q, but found no mapped gRPC status", f.ErrCode) } statusCode = codes.Unknown } if statusCode == codes.Canceled { if d, ok := s.ctx.Deadline(); ok && !d.After(time.Now()) { // Our deadline was already exceeded, and that was likely the cause // of this cancellation. Alter the status code accordingly. statusCode = codes.DeadlineExceeded } } st := status.Newf(statusCode, "stream terminated by RST_STREAM with error code: %v", f.ErrCode) t.closeStream(s, st.Err(), false, http2.ErrCodeNo, st, nil, false) } func (t *http2Client) handleSettings(f *http2.SettingsFrame, isFirst bool) { if f.IsAck() { return } var maxStreams *uint32 var ss []http2.Setting var updateFuncs []func() f.ForeachSetting(func(s http2.Setting) error { switch s.ID { case http2.SettingMaxConcurrentStreams: maxStreams = new(uint32) *maxStreams = s.Val case http2.SettingMaxHeaderListSize: updateFuncs = append(updateFuncs, func() { t.maxSendHeaderListSize = new(uint32) *t.maxSendHeaderListSize = s.Val }) default: ss = append(ss, s) } return nil }) if isFirst && maxStreams == nil { maxStreams = new(uint32) *maxStreams = math.MaxUint32 } sf := &incomingSettings{ ss: ss, } if maxStreams != nil { updateStreamQuota := func() { delta := int64(*maxStreams) - int64(t.maxConcurrentStreams) t.maxConcurrentStreams = *maxStreams t.streamQuota += delta if delta > 0 && t.waitingStreams > 0 { close(t.streamsQuotaAvailable) // wake all of them up. t.streamsQuotaAvailable = make(chan struct{}, 1) } } updateFuncs = append(updateFuncs, updateStreamQuota) } t.controlBuf.executeAndPut(func() bool { for _, f := range updateFuncs { f() } return true }, sf) } func (t *http2Client) handlePing(f *http2.PingFrame) { if f.IsAck() { // Maybe it's a BDP ping. if t.bdpEst != nil { t.bdpEst.calculate(f.Data) } return } pingAck := &ping{ack: true} copy(pingAck.data[:], f.Data[:]) t.controlBuf.put(pingAck) } func (t *http2Client) handleGoAway(f *http2.GoAwayFrame) error { t.mu.Lock() if t.state == closing { t.mu.Unlock() return nil } if f.ErrCode == http2.ErrCodeEnhanceYourCalm && string(f.DebugData()) == "too_many_pings" { // When a client receives a GOAWAY with error code ENHANCE_YOUR_CALM and debug // data equal to ASCII "too_many_pings", it should log the occurrence at a log level that is // enabled by default and double the configure KEEPALIVE_TIME used for new connections // on that channel. logger.Errorf("Client received GoAway with error code ENHANCE_YOUR_CALM and debug data equal to ASCII \"too_many_pings\".") } id := f.LastStreamID if id > 0 && id%2 == 0 { t.mu.Unlock() return connectionErrorf(true, nil, "received goaway with non-zero even-numbered stream id: %v", id) } // A client can receive multiple GoAways from the server (see // https://github.com/grpc/grpc-go/issues/1387). The idea is that the first // GoAway will be sent with an ID of MaxInt32 and the second GoAway will be // sent after an RTT delay with the ID of the last stream the server will // process. // // Therefore, when we get the first GoAway we don't necessarily close any // streams. While in case of second GoAway we close all streams created after // the GoAwayId. This way streams that were in-flight while the GoAway from // server was being sent don't get killed. select { case <-t.goAway: // t.goAway has been closed (i.e.,multiple GoAways). // If there are multiple GoAways the first one should always have an ID greater than the following ones. if id > t.prevGoAwayID { t.mu.Unlock() return connectionErrorf(true, nil, "received goaway with stream id: %v, which exceeds stream id of previous goaway: %v", id, t.prevGoAwayID) } default: t.setGoAwayReason(f) close(t.goAway) defer t.controlBuf.put(&incomingGoAway{}) // Defer as t.mu is currently held. // Notify the clientconn about the GOAWAY before we set the state to // draining, to allow the client to stop attempting to create streams // before disallowing new streams on this connection. if t.state != draining { t.onClose(t.goAwayReason) t.state = draining } } // All streams with IDs greater than the GoAwayId // and smaller than the previous GoAway ID should be killed. upperLimit := t.prevGoAwayID if upperLimit == 0 { // This is the first GoAway Frame. upperLimit = math.MaxUint32 // Kill all streams after the GoAway ID. } t.prevGoAwayID = id if len(t.activeStreams) == 0 { t.mu.Unlock() return connectionErrorf(true, nil, "received goaway and there are no active streams") } streamsToClose := make([]*ClientStream, 0) for streamID, stream := range t.activeStreams { if streamID > id && streamID <= upperLimit { // The stream was unprocessed by the server. stream.unprocessed.Store(true) streamsToClose = append(streamsToClose, stream) } } t.mu.Unlock() // Called outside t.mu because closeStream can take controlBuf's mu, which // could induce deadlock and is not allowed. for _, stream := range streamsToClose { t.closeStream(stream, errStreamDrain, false, http2.ErrCodeNo, statusGoAway, nil, false) } return nil } // setGoAwayReason sets the value of t.goAwayReason based // on the GoAway frame received. // It expects a lock on transport's mutex to be held by // the caller. func (t *http2Client) setGoAwayReason(f *http2.GoAwayFrame) { t.goAwayReason = GoAwayNoReason if f.ErrCode == http2.ErrCodeEnhanceYourCalm { if string(f.DebugData()) == "too_many_pings" { t.goAwayReason = GoAwayTooManyPings } } if len(f.DebugData()) == 0 { t.goAwayDebugMessage = fmt.Sprintf("code: %s", f.ErrCode) } else { t.goAwayDebugMessage = fmt.Sprintf("code: %s, debug data: %q", f.ErrCode, string(f.DebugData())) } } func (t *http2Client) GetGoAwayReason() (GoAwayReason, string) { t.mu.Lock() defer t.mu.Unlock() return t.goAwayReason, t.goAwayDebugMessage } func (t *http2Client) handleWindowUpdate(f *http2.WindowUpdateFrame) { t.controlBuf.put(&incomingWindowUpdate{ streamID: f.Header().StreamID, increment: f.Increment, }) } // operateHeaders takes action on the decoded headers. func (t *http2Client) operateHeaders(frame *http2.MetaHeadersFrame) { s := t.getStream(frame) if s == nil { return } endStream := frame.StreamEnded() s.bytesReceived.Store(true) initialHeader := atomic.LoadUint32(&s.headerChanClosed) == 0 if !initialHeader && !endStream { // As specified by gRPC over HTTP2, a HEADERS frame (and associated CONTINUATION frames) can only appear at the start or end of a stream. Therefore, second HEADERS frame must have EOS bit set. st := status.New(codes.Internal, "a HEADERS frame cannot appear in the middle of a stream") t.closeStream(s, st.Err(), true, http2.ErrCodeProtocol, st, nil, false) return } // frame.Truncated is set to true when framer detects that the current header // list size hits MaxHeaderListSize limit. if frame.Truncated { se := status.New(codes.Internal, "peer header list size exceeded limit") t.closeStream(s, se.Err(), true, http2.ErrCodeFrameSize, se, nil, endStream) return } var ( // If a gRPC Response-Headers has already been received, then it means // that the peer is speaking gRPC and we are in gRPC mode. isGRPC = !initialHeader mdata = make(map[string][]string) contentTypeErr = "malformed header: missing HTTP content-type" grpcMessage string recvCompress string httpStatusErr string // the code from the grpc-status header, if present grpcStatusCode = codes.Unknown // headerError is set if an error is encountered while parsing the headers headerError string httpStatus string ) for _, hf := range frame.Fields { switch hf.Name { case "content-type": if _, validContentType := grpcutil.ContentSubtype(hf.Value); !validContentType { contentTypeErr = fmt.Sprintf("transport: received unexpected content-type %q", hf.Value) break } contentTypeErr = "" mdata[hf.Name] = append(mdata[hf.Name], hf.Value) isGRPC = true case "grpc-encoding": recvCompress = hf.Value case "grpc-status": code, err := strconv.ParseInt(hf.Value, 10, 32) if err != nil { se := status.New(codes.Unknown, fmt.Sprintf("transport: malformed grpc-status: %v", err)) t.closeStream(s, se.Err(), true, http2.ErrCodeProtocol, se, nil, endStream) return } grpcStatusCode = codes.Code(uint32(code)) case "grpc-message": grpcMessage = decodeGrpcMessage(hf.Value) case ":status": httpStatus = hf.Value default: if isReservedHeader(hf.Name) && !isWhitelistedHeader(hf.Name) { break } v, err := decodeMetadataHeader(hf.Name, hf.Value) if err != nil { headerError = fmt.Sprintf("transport: malformed %s: %v", hf.Name, err) logger.Warningf("Failed to decode metadata header (%q, %q): %v", hf.Name, hf.Value, err) break } mdata[hf.Name] = append(mdata[hf.Name], v) } } // If a non-gRPC response is received, then evaluate the HTTP status to // process the response and close the stream. // In case http status doesn't provide any error information (status : 200), // then evalute response code to be Unknown. if !isGRPC { var grpcErrorCode = codes.Internal if httpStatus == "" { httpStatusErr = "malformed header: missing HTTP status" } else { // Parse the status codes (e.g. "200", 404"). statusCode, err := strconv.Atoi(httpStatus) if err != nil { se := status.New(grpcErrorCode, fmt.Sprintf("transport: malformed http-status: %v", err)) t.closeStream(s, se.Err(), true, http2.ErrCodeProtocol, se, nil, endStream) return } if statusCode >= 100 && statusCode < 200 { if endStream { se := status.New(codes.Internal, fmt.Sprintf( "protocol error: informational header with status code %d must not have END_STREAM set", statusCode)) t.closeStream(s, se.Err(), true, http2.ErrCodeProtocol, se, nil, endStream) } // In case of informational headers, return. return } httpStatusErr = fmt.Sprintf( "unexpected HTTP status code received from server: %d (%s)", statusCode, http.StatusText(statusCode), ) var ok bool grpcErrorCode, ok = HTTPStatusConvTab[statusCode] if !ok { grpcErrorCode = codes.Unknown } } var errs []string if httpStatusErr != "" { errs = append(errs, httpStatusErr) } if contentTypeErr != "" { errs = append(errs, contentTypeErr) } se := status.New(grpcErrorCode, strings.Join(errs, "; ")) t.closeStream(s, se.Err(), true, http2.ErrCodeProtocol, se, nil, endStream) return } if headerError != "" { se := status.New(codes.Internal, headerError) t.closeStream(s, se.Err(), true, http2.ErrCodeProtocol, se, nil, endStream) return } // For headers, set them in s.header and close headerChan. For trailers or // trailers-only, closeStream will set the trailers and close headerChan as // needed. if !endStream { // If headerChan hasn't been closed yet (expected, given we checked it // above, but something else could have potentially closed the whole // stream). if atomic.CompareAndSwapUint32(&s.headerChanClosed, 0, 1) { s.headerValid = true // These values can be set without any synchronization because // stream goroutine will read it only after seeing a closed // headerChan which we'll close after setting this. s.recvCompress = recvCompress if len(mdata) > 0 { s.header = mdata } close(s.headerChan) } } if t.statsHandler != nil { if !endStream { t.statsHandler.HandleRPC(s.ctx, &stats.InHeader{ Client: true, WireLength: int(frame.Header().Length), Header: metadata.MD(mdata).Copy(), Compression: s.recvCompress, }) } else { t.statsHandler.HandleRPC(s.ctx, &stats.InTrailer{ Client: true, WireLength: int(frame.Header().Length), Trailer: metadata.MD(mdata).Copy(), }) } } if !endStream { return } status := istatus.NewWithProto(grpcStatusCode, grpcMessage, mdata[grpcStatusDetailsBinHeader]) // If client received END_STREAM from server while stream was still active, // send RST_STREAM. rstStream := s.getState() == streamActive t.closeStream(s, io.EOF, rstStream, http2.ErrCodeNo, status, mdata, true) } // readServerPreface reads and handles the initial settings frame from the // server. func (t *http2Client) readServerPreface() error { frame, err := t.framer.fr.ReadFrame() if err != nil { return connectionErrorf(true, err, "error reading server preface: %v", err) } sf, ok := frame.(*http2.SettingsFrame) if !ok { return connectionErrorf(true, nil, "initial http2 frame from server is not a settings frame: %T", frame) } t.handleSettings(sf, true) return nil } // reader verifies the server preface and reads all subsequent data from // network connection. If the server preface is not read successfully, an // error is pushed to errCh; otherwise errCh is closed with no error. func (t *http2Client) reader(errCh chan<- error) { var errClose error defer func() { close(t.readerDone) if errClose != nil { t.Close(errClose) } }() if err := t.readServerPreface(); err != nil { errCh <- err return } close(errCh) if t.keepaliveEnabled { atomic.StoreInt64(&t.lastRead, time.Now().UnixNano()) } // loop to keep reading incoming messages on this transport. for { t.controlBuf.throttle() frame, err := t.framer.readFrame() if t.keepaliveEnabled { atomic.StoreInt64(&t.lastRead, time.Now().UnixNano()) } if err != nil { // Abort an active stream if the http2.Framer returns a // http2.StreamError. This can happen only if the server's response // is malformed http2. if se, ok := err.(http2.StreamError); ok { t.mu.Lock() s := t.activeStreams[se.StreamID] t.mu.Unlock() if s != nil { // use error detail to provide better err message code := http2ErrConvTab[se.Code] errorDetail := t.framer.errorDetail() var msg string if errorDetail != nil { msg = errorDetail.Error() } else { msg = "received invalid frame" } t.closeStream(s, status.Error(code, msg), true, http2.ErrCodeProtocol, status.New(code, msg), nil, false) } continue } // Transport error. errClose = connectionErrorf(true, err, "error reading from server: %v", err) return } switch frame := frame.(type) { case *http2.MetaHeadersFrame: t.operateHeaders(frame) case *parsedDataFrame: t.handleData(frame) frame.data.Free() case *http2.RSTStreamFrame: t.handleRSTStream(frame) case *http2.SettingsFrame: t.handleSettings(frame, false) case *http2.PingFrame: t.handlePing(frame) case *http2.GoAwayFrame: errClose = t.handleGoAway(frame) case *http2.WindowUpdateFrame: t.handleWindowUpdate(frame) default: if logger.V(logLevel) { logger.Errorf("transport: http2Client.reader got unhandled frame type %v.", frame) } } } } // keepalive running in a separate goroutine makes sure the connection is alive by sending pings. func (t *http2Client) keepalive() { var err error defer func() { close(t.keepaliveDone) if err != nil { t.Close(err) } }() p := &ping{data: [8]byte{}} // True iff a ping has been sent, and no data has been received since then. outstandingPing := false // Amount of time remaining before which we should receive an ACK for the // last sent ping. timeoutLeft := time.Duration(0) // Records the last value of t.lastRead before we go block on the timer. // This is required to check for read activity since then. prevNano := time.Now().UnixNano() timer := time.NewTimer(t.kp.Time) for { select { case <-timer.C: lastRead := atomic.LoadInt64(&t.lastRead) if lastRead > prevNano { // There has been read activity since the last time we were here. outstandingPing = false // Next timer should fire at kp.Time seconds from lastRead time. timer.Reset(time.Duration(lastRead) + t.kp.Time - time.Duration(time.Now().UnixNano())) prevNano = lastRead continue } if outstandingPing && timeoutLeft <= 0 { err = connectionErrorf(true, nil, "keepalive ping failed to receive ACK within timeout") return } t.mu.Lock() if t.state == closing { // If the transport is closing, we should exit from the // keepalive goroutine here. If not, we could have a race // between the call to Signal() from Close() and the call to // Wait() here, whereby the keepalive goroutine ends up // blocking on the condition variable which will never be // signalled again. t.mu.Unlock() return } if len(t.activeStreams) < 1 && !t.kp.PermitWithoutStream { // If a ping was sent out previously (because there were active // streams at that point) which wasn't acked and its timeout // hadn't fired, but we got here and are about to go dormant, // we should make sure that we unconditionally send a ping once // we awaken. outstandingPing = false t.kpDormant = true t.kpDormancyCond.Wait() } t.kpDormant = false t.mu.Unlock() // We get here either because we were dormant and a new stream was // created which unblocked the Wait() call, or because the // keepalive timer expired. In both cases, we need to send a ping. if !outstandingPing { if channelz.IsOn() { t.channelz.SocketMetrics.KeepAlivesSent.Add(1) } t.controlBuf.put(p) timeoutLeft = t.kp.Timeout outstandingPing = true } // The amount of time to sleep here is the minimum of kp.Time and // timeoutLeft. This will ensure that we wait only for kp.Time // before sending out the next ping (for cases where the ping is // acked). sleepDuration := min(t.kp.Time, timeoutLeft) timeoutLeft -= sleepDuration timer.Reset(sleepDuration) case <-t.ctx.Done(): if !timer.Stop() { <-timer.C } return } } } func (t *http2Client) Error() <-chan struct{} { return t.ctx.Done() } func (t *http2Client) GoAway() <-chan struct{} { return t.goAway } func (t *http2Client) socketMetrics() *channelz.EphemeralSocketMetrics { return &channelz.EphemeralSocketMetrics{ LocalFlowControlWindow: int64(t.fc.getSize()), RemoteFlowControlWindow: t.getOutFlowWindow(), } } func (t *http2Client) incrMsgSent() { if channelz.IsOn() { t.channelz.SocketMetrics.MessagesSent.Add(1) t.channelz.SocketMetrics.LastMessageSentTimestamp.Store(time.Now().UnixNano()) } } func (t *http2Client) incrMsgRecv() { if channelz.IsOn() { t.channelz.SocketMetrics.MessagesReceived.Add(1) t.channelz.SocketMetrics.LastMessageReceivedTimestamp.Store(time.Now().UnixNano()) } } func (t *http2Client) getOutFlowWindow() int64 { resp := make(chan uint32, 1) timer := time.NewTimer(time.Second) defer timer.Stop() t.controlBuf.put(&outFlowControlSizeRequest{resp}) select { case sz := <-resp: return int64(sz) case <-t.ctxDone: return -1 case <-timer.C: return -2 } } func (t *http2Client) stateForTesting() transportState { t.mu.Lock() defer t.mu.Unlock() return t.state } ================================================ FILE: vendor/google.golang.org/grpc/internal/transport/http2_server.go ================================================ /* * * Copyright 2014 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package transport import ( "bytes" "context" "errors" "fmt" "io" "math" rand "math/rand/v2" "net" "net/http" "strconv" "sync" "sync/atomic" "time" "golang.org/x/net/http2" "golang.org/x/net/http2/hpack" "google.golang.org/protobuf/proto" "google.golang.org/grpc/internal" "google.golang.org/grpc/internal/grpclog" "google.golang.org/grpc/internal/grpcutil" "google.golang.org/grpc/internal/pretty" istatus "google.golang.org/grpc/internal/status" "google.golang.org/grpc/internal/syscall" "google.golang.org/grpc/mem" "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials" "google.golang.org/grpc/internal/channelz" "google.golang.org/grpc/internal/grpcsync" "google.golang.org/grpc/keepalive" "google.golang.org/grpc/metadata" "google.golang.org/grpc/peer" "google.golang.org/grpc/stats" "google.golang.org/grpc/status" "google.golang.org/grpc/tap" ) var ( // ErrIllegalHeaderWrite indicates that setting header is illegal because of // the stream's state. ErrIllegalHeaderWrite = status.Error(codes.Internal, "transport: SendHeader called multiple times") // ErrHeaderListSizeLimitViolation indicates that the header list size is larger // than the limit set by peer. ErrHeaderListSizeLimitViolation = status.Error(codes.Internal, "transport: trying to send header list size larger than the limit set by peer") ) // serverConnectionCounter counts the number of connections a server has seen // (equal to the number of http2Servers created). Must be accessed atomically. var serverConnectionCounter uint64 // http2Server implements the ServerTransport interface with HTTP2. type http2Server struct { lastRead int64 // Keep this field 64-bit aligned. Accessed atomically. done chan struct{} conn net.Conn loopy *loopyWriter readerDone chan struct{} // sync point to enable testing. loopyWriterDone chan struct{} peer peer.Peer inTapHandle tap.ServerInHandle framer *framer // The max number of concurrent streams. maxStreams uint32 // controlBuf delivers all the control related tasks (e.g., window // updates, reset streams, and various settings) to the controller. controlBuf *controlBuffer fc *trInFlow stats stats.Handler // Keepalive and max-age parameters for the server. kp keepalive.ServerParameters // Keepalive enforcement policy. kep keepalive.EnforcementPolicy // The time instance last ping was received. lastPingAt time.Time // Number of times the client has violated keepalive ping policy so far. pingStrikes uint8 // Flag to signify that number of ping strikes should be reset to 0. // This is set whenever data or header frames are sent. // 1 means yes. resetPingStrikes uint32 // Accessed atomically. initialWindowSize int32 bdpEst *bdpEstimator maxSendHeaderListSize *uint32 mu sync.Mutex // guard the following // drainEvent is initialized when Drain() is called the first time. After // which the server writes out the first GoAway(with ID 2^31-1) frame. Then // an independent goroutine will be launched to later send the second // GoAway. During this time we don't want to write another first GoAway(with // ID 2^31 -1) frame. Thus call to Drain() will be a no-op if drainEvent is // already initialized since draining is already underway. drainEvent *grpcsync.Event state transportState activeStreams map[uint32]*ServerStream // idle is the time instant when the connection went idle. // This is either the beginning of the connection or when the number of // RPCs go down to 0. // When the connection is busy, this value is set to 0. idle time.Time // Fields below are for channelz metric collection. channelz *channelz.Socket bufferPool mem.BufferPool connectionID uint64 // maxStreamMu guards the maximum stream ID // This lock may not be taken if mu is already held. maxStreamMu sync.Mutex maxStreamID uint32 // max stream ID ever seen logger *grpclog.PrefixLogger // setResetPingStrikes is stored as a closure instead of making this a // method on http2Server to avoid a heap allocation when converting a method // to a closure for passing to frames objects. setResetPingStrikes func() } // NewServerTransport creates a http2 transport with conn and configuration // options from config. // // It returns a non-nil transport and a nil error on success. On failure, it // returns a nil transport and a non-nil error. For a special case where the // underlying conn gets closed before the client preface could be read, it // returns a nil transport and a nil error. func NewServerTransport(conn net.Conn, config *ServerConfig) (_ ServerTransport, err error) { var authInfo credentials.AuthInfo rawConn := conn if config.Credentials != nil { var err error conn, authInfo, err = config.Credentials.ServerHandshake(rawConn) if err != nil { // ErrConnDispatched means that the connection was dispatched away // from gRPC; those connections should be left open. io.EOF means // the connection was closed before handshaking completed, which can // happen naturally from probers. Return these errors directly. if err == credentials.ErrConnDispatched || err == io.EOF { return nil, err } return nil, connectionErrorf(false, err, "ServerHandshake(%q) failed: %v", rawConn.RemoteAddr(), err) } } writeBufSize := config.WriteBufferSize readBufSize := config.ReadBufferSize maxHeaderListSize := defaultServerMaxHeaderListSize if config.MaxHeaderListSize != nil { maxHeaderListSize = *config.MaxHeaderListSize } framer := newFramer(conn, writeBufSize, readBufSize, config.SharedWriteBuffer, maxHeaderListSize, config.BufferPool) // Send initial settings as connection preface to client. isettings := []http2.Setting{{ ID: http2.SettingMaxFrameSize, Val: http2MaxFrameLen, }} if config.MaxStreams != math.MaxUint32 { isettings = append(isettings, http2.Setting{ ID: http2.SettingMaxConcurrentStreams, Val: config.MaxStreams, }) } iwz := int32(initialWindowSize) if config.InitialWindowSize >= defaultWindowSize { iwz = config.InitialWindowSize } icwz := int32(initialWindowSize) if config.InitialConnWindowSize >= defaultWindowSize { icwz = config.InitialConnWindowSize } if iwz != defaultWindowSize { isettings = append(isettings, http2.Setting{ ID: http2.SettingInitialWindowSize, Val: uint32(iwz)}) } if config.MaxHeaderListSize != nil { isettings = append(isettings, http2.Setting{ ID: http2.SettingMaxHeaderListSize, Val: *config.MaxHeaderListSize, }) } if config.HeaderTableSize != nil { isettings = append(isettings, http2.Setting{ ID: http2.SettingHeaderTableSize, Val: *config.HeaderTableSize, }) } if err := framer.fr.WriteSettings(isettings...); err != nil { return nil, connectionErrorf(false, err, "transport: %v", err) } // Adjust the connection flow control window if needed. if delta := uint32(icwz - defaultWindowSize); delta > 0 { if err := framer.fr.WriteWindowUpdate(0, delta); err != nil { return nil, connectionErrorf(false, err, "transport: %v", err) } } kp := config.KeepaliveParams if kp.MaxConnectionIdle == 0 { kp.MaxConnectionIdle = defaultMaxConnectionIdle } if kp.MaxConnectionAge == 0 { kp.MaxConnectionAge = defaultMaxConnectionAge } // Add a jitter to MaxConnectionAge. kp.MaxConnectionAge += getJitter(kp.MaxConnectionAge) if kp.MaxConnectionAgeGrace == 0 { kp.MaxConnectionAgeGrace = defaultMaxConnectionAgeGrace } if kp.Time == 0 { kp.Time = defaultServerKeepaliveTime } if kp.Timeout == 0 { kp.Timeout = defaultServerKeepaliveTimeout } if kp.Time != infinity { if err = syscall.SetTCPUserTimeout(rawConn, kp.Timeout); err != nil { return nil, connectionErrorf(false, err, "transport: failed to set TCP_USER_TIMEOUT: %v", err) } } kep := config.KeepalivePolicy if kep.MinTime == 0 { kep.MinTime = defaultKeepalivePolicyMinTime } done := make(chan struct{}) peer := peer.Peer{ Addr: conn.RemoteAddr(), LocalAddr: conn.LocalAddr(), AuthInfo: authInfo, } t := &http2Server{ done: done, conn: conn, peer: peer, framer: framer, readerDone: make(chan struct{}), loopyWriterDone: make(chan struct{}), maxStreams: config.MaxStreams, inTapHandle: config.InTapHandle, fc: &trInFlow{limit: uint32(icwz)}, state: reachable, activeStreams: make(map[uint32]*ServerStream), stats: config.StatsHandler, kp: kp, idle: time.Now(), kep: kep, initialWindowSize: iwz, bufferPool: config.BufferPool, } t.setResetPingStrikes = func() { atomic.StoreUint32(&t.resetPingStrikes, 1) } var czSecurity credentials.ChannelzSecurityValue if au, ok := authInfo.(credentials.ChannelzSecurityInfo); ok { czSecurity = au.GetSecurityValue() } t.channelz = channelz.RegisterSocket( &channelz.Socket{ SocketType: channelz.SocketTypeNormal, Parent: config.ChannelzParent, SocketMetrics: channelz.SocketMetrics{}, EphemeralMetrics: t.socketMetrics, LocalAddr: t.peer.LocalAddr, RemoteAddr: t.peer.Addr, SocketOptions: channelz.GetSocketOption(t.conn), Security: czSecurity, }, ) t.logger = prefixLoggerForServerTransport(t) t.controlBuf = newControlBuffer(t.done) if !config.StaticWindowSize { t.bdpEst = &bdpEstimator{ bdp: initialWindowSize, updateFlowControl: t.updateFlowControl, } } t.connectionID = atomic.AddUint64(&serverConnectionCounter, 1) t.framer.writer.Flush() defer func() { if err != nil { t.Close(err) } }() // Check the validity of client preface. preface := make([]byte, len(clientPreface)) if _, err := io.ReadFull(t.conn, preface); err != nil { // In deployments where a gRPC server runs behind a cloud load balancer // which performs regular TCP level health checks, the connection is // closed immediately by the latter. Returning io.EOF here allows the // grpc server implementation to recognize this scenario and suppress // logging to reduce spam. if err == io.EOF { return nil, io.EOF } return nil, connectionErrorf(false, err, "transport: http2Server.HandleStreams failed to receive the preface from client: %v", err) } if !bytes.Equal(preface, clientPreface) { return nil, connectionErrorf(false, nil, "transport: http2Server.HandleStreams received bogus greeting from client: %q", preface) } frame, err := t.framer.fr.ReadFrame() if err == io.EOF || err == io.ErrUnexpectedEOF { return nil, err } if err != nil { return nil, connectionErrorf(false, err, "transport: http2Server.HandleStreams failed to read initial settings frame: %v", err) } atomic.StoreInt64(&t.lastRead, time.Now().UnixNano()) sf, ok := frame.(*http2.SettingsFrame) if !ok { return nil, connectionErrorf(false, nil, "transport: http2Server.HandleStreams saw invalid preface type %T from client", frame) } t.handleSettings(sf) go func() { t.loopy = newLoopyWriter(serverSide, t.framer, t.controlBuf, t.bdpEst, t.conn, t.logger, t.outgoingGoAwayHandler, t.bufferPool) err := t.loopy.run() close(t.loopyWriterDone) if !isIOError(err) { // Close the connection if a non-I/O error occurs (for I/O errors // the reader will also encounter the error and close). Wait 1 // second before closing the connection, or when the reader is done // (i.e. the client already closed the connection or a connection // error occurred). This avoids the potential problem where there // is unread data on the receive side of the connection, which, if // closed, would lead to a TCP RST instead of FIN, and the client // encountering errors. For more info: // https://github.com/grpc/grpc-go/issues/5358 timer := time.NewTimer(time.Second) defer timer.Stop() select { case <-t.readerDone: case <-timer.C: } t.conn.Close() } }() go t.keepalive() return t, nil } // operateHeaders takes action on the decoded headers. Returns an error if fatal // error encountered and transport needs to close, otherwise returns nil. func (t *http2Server) operateHeaders(ctx context.Context, frame *http2.MetaHeadersFrame, handle func(*ServerStream)) error { // Acquire max stream ID lock for entire duration t.maxStreamMu.Lock() defer t.maxStreamMu.Unlock() streamID := frame.Header().StreamID // frame.Truncated is set to true when framer detects that the current header // list size hits MaxHeaderListSize limit. if frame.Truncated { t.controlBuf.put(&cleanupStream{ streamID: streamID, rst: true, rstCode: http2.ErrCodeFrameSize, onWrite: func() {}, }) return nil } if streamID%2 != 1 || streamID <= t.maxStreamID { // illegal gRPC stream id. return fmt.Errorf("received an illegal stream id: %v. headers frame: %+v", streamID, frame) } t.maxStreamID = streamID s := &ServerStream{ Stream: Stream{ id: streamID, fc: inFlow{limit: uint32(t.initialWindowSize)}, }, st: t, headerWireLength: int(frame.Header().Length), } s.Stream.buf.init() var ( // if false, content-type was missing or invalid isGRPC = false contentType = "" mdata = make(metadata.MD, len(frame.Fields)) httpMethod string // these are set if an error is encountered while parsing the headers protocolError bool headerError *status.Status timeoutSet bool timeout time.Duration ) for _, hf := range frame.Fields { switch hf.Name { case "content-type": contentSubtype, validContentType := grpcutil.ContentSubtype(hf.Value) if !validContentType { contentType = hf.Value break } mdata[hf.Name] = append(mdata[hf.Name], hf.Value) s.contentSubtype = contentSubtype isGRPC = true case "grpc-accept-encoding": mdata[hf.Name] = append(mdata[hf.Name], hf.Value) if hf.Value == "" { continue } compressors := hf.Value if s.clientAdvertisedCompressors != "" { compressors = s.clientAdvertisedCompressors + "," + compressors } s.clientAdvertisedCompressors = compressors case "grpc-encoding": s.recvCompress = hf.Value case ":method": httpMethod = hf.Value case ":path": s.method = hf.Value case "grpc-timeout": timeoutSet = true var err error if timeout, err = decodeTimeout(hf.Value); err != nil { headerError = status.Newf(codes.Internal, "malformed grpc-timeout: %v", err) } // "Transports must consider requests containing the Connection header // as malformed." - A41 case "connection": if t.logger.V(logLevel) { t.logger.Infof("Received a HEADERS frame with a :connection header which makes the request malformed, as per the HTTP/2 spec") } protocolError = true default: if isReservedHeader(hf.Name) && !isWhitelistedHeader(hf.Name) { break } v, err := decodeMetadataHeader(hf.Name, hf.Value) if err != nil { headerError = status.Newf(codes.Internal, "malformed binary metadata %q in header %q: %v", hf.Value, hf.Name, err) t.logger.Warningf("Failed to decode metadata header (%q, %q): %v", hf.Name, hf.Value, err) break } mdata[hf.Name] = append(mdata[hf.Name], v) } } // "If multiple Host headers or multiple :authority headers are present, the // request must be rejected with an HTTP status code 400 as required by Host // validation in RFC 7230 §5.4, gRPC status code INTERNAL, or RST_STREAM // with HTTP/2 error code PROTOCOL_ERROR." - A41. Since this is a HTTP/2 // error, this takes precedence over a client not speaking gRPC. if len(mdata[":authority"]) > 1 || len(mdata["host"]) > 1 { errMsg := fmt.Sprintf("num values of :authority: %v, num values of host: %v, both must only have 1 value as per HTTP/2 spec", len(mdata[":authority"]), len(mdata["host"])) if t.logger.V(logLevel) { t.logger.Infof("Aborting the stream early: %v", errMsg) } t.controlBuf.put(&earlyAbortStream{ httpStatus: http.StatusBadRequest, streamID: streamID, contentSubtype: s.contentSubtype, status: status.New(codes.Internal, errMsg), rst: !frame.StreamEnded(), }) return nil } if protocolError { t.controlBuf.put(&cleanupStream{ streamID: streamID, rst: true, rstCode: http2.ErrCodeProtocol, onWrite: func() {}, }) return nil } if !isGRPC { t.controlBuf.put(&earlyAbortStream{ httpStatus: http.StatusUnsupportedMediaType, streamID: streamID, contentSubtype: s.contentSubtype, status: status.Newf(codes.InvalidArgument, "invalid gRPC request content-type %q", contentType), rst: !frame.StreamEnded(), }) return nil } if headerError != nil { t.controlBuf.put(&earlyAbortStream{ httpStatus: http.StatusBadRequest, streamID: streamID, contentSubtype: s.contentSubtype, status: headerError, rst: !frame.StreamEnded(), }) return nil } // "If :authority is missing, Host must be renamed to :authority." - A41 if len(mdata[":authority"]) == 0 { // No-op if host isn't present, no eventual :authority header is a valid // RPC. if host, ok := mdata["host"]; ok { mdata[":authority"] = host delete(mdata, "host") } } else { // "If :authority is present, Host must be discarded" - A41 delete(mdata, "host") } if frame.StreamEnded() { // s is just created by the caller. No lock needed. s.state = streamReadDone } if timeoutSet { s.ctx, s.cancel = context.WithTimeout(ctx, timeout) } else { s.ctx, s.cancel = context.WithCancel(ctx) } // Attach the received metadata to the context. if len(mdata) > 0 { s.ctx = metadata.NewIncomingContext(s.ctx, mdata) } t.mu.Lock() if t.state != reachable { t.mu.Unlock() s.cancel() return nil } if uint32(len(t.activeStreams)) >= t.maxStreams { t.mu.Unlock() t.controlBuf.put(&cleanupStream{ streamID: streamID, rst: true, rstCode: http2.ErrCodeRefusedStream, onWrite: func() {}, }) s.cancel() return nil } if httpMethod != http.MethodPost { t.mu.Unlock() errMsg := fmt.Sprintf("Received a HEADERS frame with :method %q which should be POST", httpMethod) if t.logger.V(logLevel) { t.logger.Infof("Aborting the stream early: %v", errMsg) } t.controlBuf.put(&earlyAbortStream{ httpStatus: http.StatusMethodNotAllowed, streamID: streamID, contentSubtype: s.contentSubtype, status: status.New(codes.Internal, errMsg), rst: !frame.StreamEnded(), }) s.cancel() return nil } if t.inTapHandle != nil { var err error if s.ctx, err = t.inTapHandle(s.ctx, &tap.Info{FullMethodName: s.method, Header: mdata}); err != nil { t.mu.Unlock() if t.logger.V(logLevel) { t.logger.Infof("Aborting the stream early due to InTapHandle failure: %v", err) } stat, ok := status.FromError(err) if !ok { stat = status.New(codes.PermissionDenied, err.Error()) } t.controlBuf.put(&earlyAbortStream{ httpStatus: http.StatusOK, streamID: s.id, contentSubtype: s.contentSubtype, status: stat, rst: !frame.StreamEnded(), }) return nil } } if s.ctx.Err() != nil { t.mu.Unlock() // Early abort in case the timeout was zero or so low it already fired. t.controlBuf.put(&earlyAbortStream{ httpStatus: http.StatusOK, streamID: s.id, contentSubtype: s.contentSubtype, status: status.New(codes.DeadlineExceeded, context.DeadlineExceeded.Error()), rst: !frame.StreamEnded(), }) return nil } t.activeStreams[streamID] = s if len(t.activeStreams) == 1 { t.idle = time.Time{} } // Start a timer to close the stream on reaching the deadline. if timeoutSet { // We need to wait for s.cancel to be updated before calling // t.closeStream to avoid data races. cancelUpdated := make(chan struct{}) timer := internal.TimeAfterFunc(timeout, func() { <-cancelUpdated t.closeStream(s, true, http2.ErrCodeCancel, false) }) oldCancel := s.cancel s.cancel = func() { oldCancel() timer.Stop() } close(cancelUpdated) } t.mu.Unlock() if channelz.IsOn() { t.channelz.SocketMetrics.StreamsStarted.Add(1) t.channelz.SocketMetrics.LastRemoteStreamCreatedTimestamp.Store(time.Now().UnixNano()) } s.readRequester = s s.ctxDone = s.ctx.Done() s.Stream.wq.init(defaultWriteQuota, s.ctxDone) s.trReader = transportReader{ reader: recvBufferReader{ ctx: s.ctx, ctxDone: s.ctxDone, recv: &s.buf, }, windowHandler: s, } // Register the stream with loopy. t.controlBuf.put(®isterStream{ streamID: s.id, wq: &s.wq, }) handle(s) return nil } // HandleStreams receives incoming streams using the given handler. This is // typically run in a separate goroutine. // traceCtx attaches trace to ctx and returns the new context. func (t *http2Server) HandleStreams(ctx context.Context, handle func(*ServerStream)) { defer func() { close(t.readerDone) <-t.loopyWriterDone }() for { t.controlBuf.throttle() frame, err := t.framer.readFrame() atomic.StoreInt64(&t.lastRead, time.Now().UnixNano()) if err != nil { if se, ok := err.(http2.StreamError); ok { if t.logger.V(logLevel) { t.logger.Warningf("Encountered http2.StreamError: %v", se) } t.mu.Lock() s := t.activeStreams[se.StreamID] t.mu.Unlock() if s != nil { t.closeStream(s, true, se.Code, false) } else { t.controlBuf.put(&cleanupStream{ streamID: se.StreamID, rst: true, rstCode: se.Code, onWrite: func() {}, }) } continue } t.Close(err) return } switch frame := frame.(type) { case *http2.MetaHeadersFrame: if err := t.operateHeaders(ctx, frame, handle); err != nil { // Any error processing client headers, e.g. invalid stream ID, // is considered a protocol violation. t.controlBuf.put(&goAway{ code: http2.ErrCodeProtocol, debugData: []byte(err.Error()), closeConn: err, }) continue } case *parsedDataFrame: t.handleData(frame) frame.data.Free() case *http2.RSTStreamFrame: t.handleRSTStream(frame) case *http2.SettingsFrame: t.handleSettings(frame) case *http2.PingFrame: t.handlePing(frame) case *http2.WindowUpdateFrame: t.handleWindowUpdate(frame) case *http2.GoAwayFrame: // TODO: Handle GoAway from the client appropriately. default: if t.logger.V(logLevel) { t.logger.Infof("Received unsupported frame type %T", frame) } } } } func (t *http2Server) getStream(f http2.Frame) (*ServerStream, bool) { t.mu.Lock() defer t.mu.Unlock() if t.activeStreams == nil { // The transport is closing. return nil, false } s, ok := t.activeStreams[f.Header().StreamID] if !ok { // The stream is already done. return nil, false } return s, true } // adjustWindow sends out extra window update over the initial window size // of stream if the application is requesting data larger in size than // the window. func (t *http2Server) adjustWindow(s *ServerStream, n uint32) { if w := s.fc.maybeAdjust(n); w > 0 { t.controlBuf.put(&outgoingWindowUpdate{streamID: s.id, increment: w}) } } // updateWindow adjusts the inbound quota for the stream and the transport. // Window updates will deliver to the controller for sending when // the cumulative quota exceeds the corresponding threshold. func (t *http2Server) updateWindow(s *ServerStream, n uint32) { if w := s.fc.onRead(n); w > 0 { t.controlBuf.put(&outgoingWindowUpdate{streamID: s.id, increment: w, }) } } // updateFlowControl updates the incoming flow control windows // for the transport and the stream based on the current bdp // estimation. func (t *http2Server) updateFlowControl(n uint32) { t.mu.Lock() for _, s := range t.activeStreams { s.fc.newLimit(n) } t.initialWindowSize = int32(n) t.mu.Unlock() t.controlBuf.put(&outgoingWindowUpdate{ streamID: 0, increment: t.fc.newLimit(n), }) t.controlBuf.put(&outgoingSettings{ ss: []http2.Setting{ { ID: http2.SettingInitialWindowSize, Val: n, }, }, }) } func (t *http2Server) handleData(f *parsedDataFrame) { size := f.Header().Length var sendBDPPing bool if t.bdpEst != nil { sendBDPPing = t.bdpEst.add(size) } // Decouple connection's flow control from application's read. // An update on connection's flow control should not depend on // whether user application has read the data or not. Such a // restriction is already imposed on the stream's flow control, // and therefore the sender will be blocked anyways. // Decoupling the connection flow control will prevent other // active(fast) streams from starving in presence of slow or // inactive streams. if w := t.fc.onData(size); w > 0 { t.controlBuf.put(&outgoingWindowUpdate{ streamID: 0, increment: w, }) } if sendBDPPing { // Avoid excessive ping detection (e.g. in an L7 proxy) // by sending a window update prior to the BDP ping. if w := t.fc.reset(); w > 0 { t.controlBuf.put(&outgoingWindowUpdate{ streamID: 0, increment: w, }) } t.controlBuf.put(bdpPing) } // Select the right stream to dispatch. s, ok := t.getStream(f) if !ok { return } if s.getState() == streamReadDone { t.closeStream(s, true, http2.ErrCodeStreamClosed, false) return } if size > 0 { if err := s.fc.onData(size); err != nil { t.closeStream(s, true, http2.ErrCodeFlowControl, false) return } dataLen := f.data.Len() if f.Header().Flags.Has(http2.FlagDataPadded) { if w := s.fc.onRead(size - uint32(dataLen)); w > 0 { t.controlBuf.put(&outgoingWindowUpdate{s.id, w}) } } if dataLen > 0 { f.data.Ref() s.write(recvMsg{buffer: f.data}) } } if f.StreamEnded() { // Received the end of stream from the client. s.compareAndSwapState(streamActive, streamReadDone) s.write(recvMsg{err: io.EOF}) } } func (t *http2Server) handleRSTStream(f *http2.RSTStreamFrame) { // If the stream is not deleted from the transport's active streams map, then do a regular close stream. if s, ok := t.getStream(f); ok { t.closeStream(s, false, 0, false) return } // If the stream is already deleted from the active streams map, then put a cleanupStream item into controlbuf to delete the stream from loopy writer's established streams map. t.controlBuf.put(&cleanupStream{ streamID: f.Header().StreamID, rst: false, rstCode: 0, onWrite: func() {}, }) } func (t *http2Server) handleSettings(f *http2.SettingsFrame) { if f.IsAck() { return } var ss []http2.Setting var updateFuncs []func() f.ForeachSetting(func(s http2.Setting) error { switch s.ID { case http2.SettingMaxHeaderListSize: updateFuncs = append(updateFuncs, func() { t.maxSendHeaderListSize = new(uint32) *t.maxSendHeaderListSize = s.Val }) default: ss = append(ss, s) } return nil }) t.controlBuf.executeAndPut(func() bool { for _, f := range updateFuncs { f() } return true }, &incomingSettings{ ss: ss, }) } const ( maxPingStrikes = 2 defaultPingTimeout = 2 * time.Hour ) func (t *http2Server) handlePing(f *http2.PingFrame) { if f.IsAck() { if f.Data == goAwayPing.data && t.drainEvent != nil { t.drainEvent.Fire() return } // Maybe it's a BDP ping. if t.bdpEst != nil { t.bdpEst.calculate(f.Data) } return } pingAck := &ping{ack: true} copy(pingAck.data[:], f.Data[:]) t.controlBuf.put(pingAck) now := time.Now() defer func() { t.lastPingAt = now }() // A reset ping strikes means that we don't need to check for policy // violation for this ping and the pingStrikes counter should be set // to 0. if atomic.CompareAndSwapUint32(&t.resetPingStrikes, 1, 0) { t.pingStrikes = 0 return } t.mu.Lock() ns := len(t.activeStreams) t.mu.Unlock() if ns < 1 && !t.kep.PermitWithoutStream { // Keepalive shouldn't be active thus, this new ping should // have come after at least defaultPingTimeout. if t.lastPingAt.Add(defaultPingTimeout).After(now) { t.pingStrikes++ } } else { // Check if keepalive policy is respected. if t.lastPingAt.Add(t.kep.MinTime).After(now) { t.pingStrikes++ } } if t.pingStrikes > maxPingStrikes { // Send goaway and close the connection. t.controlBuf.put(&goAway{code: http2.ErrCodeEnhanceYourCalm, debugData: []byte("too_many_pings"), closeConn: errors.New("got too many pings from the client")}) } } func (t *http2Server) handleWindowUpdate(f *http2.WindowUpdateFrame) { t.controlBuf.put(&incomingWindowUpdate{ streamID: f.Header().StreamID, increment: f.Increment, }) } func appendHeaderFieldsFromMD(headerFields []hpack.HeaderField, md metadata.MD) []hpack.HeaderField { for k, vv := range md { if isReservedHeader(k) { // Clients don't tolerate reading restricted headers after some non restricted ones were sent. continue } for _, v := range vv { headerFields = append(headerFields, hpack.HeaderField{Name: k, Value: encodeMetadataHeader(k, v)}) } } return headerFields } func (t *http2Server) checkForHeaderListSize(it any) bool { if t.maxSendHeaderListSize == nil { return true } hdrFrame := it.(*headerFrame) var sz int64 for _, f := range hdrFrame.hf { if sz += int64(f.Size()); sz > int64(*t.maxSendHeaderListSize) { if t.logger.V(logLevel) { t.logger.Infof("Header list size to send violates the maximum size (%d bytes) set by client", *t.maxSendHeaderListSize) } return false } } return true } func (t *http2Server) streamContextErr(s *ServerStream) error { select { case <-t.done: return ErrConnClosing default: } return ContextErr(s.ctx.Err()) } // WriteHeader sends the header metadata md back to the client. func (t *http2Server) writeHeader(s *ServerStream, md metadata.MD) error { s.hdrMu.Lock() defer s.hdrMu.Unlock() if s.getState() == streamDone { return t.streamContextErr(s) } if s.updateHeaderSent() { return ErrIllegalHeaderWrite } if md.Len() > 0 { if s.header.Len() > 0 { s.header = metadata.Join(s.header, md) } else { s.header = md } } if err := t.writeHeaderLocked(s); err != nil { switch e := err.(type) { case ConnectionError: return status.Error(codes.Unavailable, e.Desc) default: return status.Convert(err).Err() } } return nil } func (t *http2Server) writeHeaderLocked(s *ServerStream) error { // TODO(mmukhi): Benchmark if the performance gets better if count the metadata and other header fields // first and create a slice of that exact size. headerFields := make([]hpack.HeaderField, 0, 2) // at least :status, content-type will be there if none else. headerFields = append(headerFields, hpack.HeaderField{Name: ":status", Value: "200"}) headerFields = append(headerFields, hpack.HeaderField{Name: "content-type", Value: grpcutil.ContentType(s.contentSubtype)}) if s.sendCompress != "" { headerFields = append(headerFields, hpack.HeaderField{Name: "grpc-encoding", Value: s.sendCompress}) } headerFields = appendHeaderFieldsFromMD(headerFields, s.header) hf := &headerFrame{ streamID: s.id, hf: headerFields, endStream: false, onWrite: t.setResetPingStrikes, } success, err := t.controlBuf.executeAndPut(func() bool { return t.checkForHeaderListSize(hf) }, hf) if !success { if err != nil { return err } t.closeStream(s, true, http2.ErrCodeInternal, false) return ErrHeaderListSizeLimitViolation } if t.stats != nil { // Note: Headers are compressed with hpack after this call returns. // No WireLength field is set here. t.stats.HandleRPC(s.Context(), &stats.OutHeader{ Header: s.header.Copy(), Compression: s.sendCompress, }) } return nil } // writeStatus sends stream status to the client and terminates the stream. // There is no further I/O operations being able to perform on this stream. // TODO(zhaoq): Now it indicates the end of entire stream. Revisit if early // OK is adopted. func (t *http2Server) writeStatus(s *ServerStream, st *status.Status) error { s.hdrMu.Lock() defer s.hdrMu.Unlock() if s.getState() == streamDone { return nil } // TODO(mmukhi): Benchmark if the performance gets better if count the metadata and other header fields // first and create a slice of that exact size. headerFields := make([]hpack.HeaderField, 0, 2) // grpc-status and grpc-message will be there if none else. if !s.updateHeaderSent() { // No headers have been sent. if len(s.header) > 0 { // Send a separate header frame. if err := t.writeHeaderLocked(s); err != nil { return err } } else { // Send a trailer only response. headerFields = append(headerFields, hpack.HeaderField{Name: ":status", Value: "200"}) headerFields = append(headerFields, hpack.HeaderField{Name: "content-type", Value: grpcutil.ContentType(s.contentSubtype)}) } } headerFields = append(headerFields, hpack.HeaderField{Name: "grpc-status", Value: strconv.Itoa(int(st.Code()))}) headerFields = append(headerFields, hpack.HeaderField{Name: "grpc-message", Value: encodeGrpcMessage(st.Message())}) if p := istatus.RawStatusProto(st); len(p.GetDetails()) > 0 { // Do not use the user's grpc-status-details-bin (if present) if we are // even attempting to set our own. delete(s.trailer, grpcStatusDetailsBinHeader) stBytes, err := proto.Marshal(p) if err != nil { // TODO: return error instead, when callers are able to handle it. t.logger.Errorf("Failed to marshal rpc status: %s, error: %v", pretty.ToJSON(p), err) } else { headerFields = append(headerFields, hpack.HeaderField{Name: grpcStatusDetailsBinHeader, Value: encodeBinHeader(stBytes)}) } } // Attach the trailer metadata. headerFields = appendHeaderFieldsFromMD(headerFields, s.trailer) trailingHeader := &headerFrame{ streamID: s.id, hf: headerFields, endStream: true, onWrite: t.setResetPingStrikes, } success, err := t.controlBuf.executeAndPut(func() bool { return t.checkForHeaderListSize(trailingHeader) }, nil) if !success { if err != nil { return err } t.closeStream(s, true, http2.ErrCodeInternal, false) return ErrHeaderListSizeLimitViolation } // Send a RST_STREAM after the trailers if the client has not already half-closed. rst := s.getState() == streamActive t.finishStream(s, rst, http2.ErrCodeNo, trailingHeader, true) if t.stats != nil { // Note: The trailer fields are compressed with hpack after this call returns. // No WireLength field is set here. t.stats.HandleRPC(s.Context(), &stats.OutTrailer{ Trailer: s.trailer.Copy(), }) } return nil } // Write converts the data into HTTP2 data frame and sends it out. Non-nil error // is returns if it fails (e.g., framing error, transport error). func (t *http2Server) write(s *ServerStream, hdr []byte, data mem.BufferSlice, _ *WriteOptions) error { if !s.isHeaderSent() { // Headers haven't been written yet. if err := t.writeHeader(s, nil); err != nil { return err } } else { // Writing headers checks for this condition. if s.getState() == streamDone { return t.streamContextErr(s) } } df := &dataFrame{ streamID: s.id, h: hdr, data: data, onEachWrite: t.setResetPingStrikes, } dataLen := data.Len() if err := s.wq.get(int32(len(hdr) + dataLen)); err != nil { return t.streamContextErr(s) } data.Ref() if err := t.controlBuf.put(df); err != nil { data.Free() return err } t.incrMsgSent() return nil } // keepalive running in a separate goroutine does the following: // 1. Gracefully closes an idle connection after a duration of keepalive.MaxConnectionIdle. // 2. Gracefully closes any connection after a duration of keepalive.MaxConnectionAge. // 3. Forcibly closes a connection after an additive period of keepalive.MaxConnectionAgeGrace over keepalive.MaxConnectionAge. // 4. Makes sure a connection is alive by sending pings with a frequency of keepalive.Time and closes a non-responsive connection // after an additional duration of keepalive.Timeout. func (t *http2Server) keepalive() { p := &ping{} // True iff a ping has been sent, and no data has been received since then. outstandingPing := false // Amount of time remaining before which we should receive an ACK for the // last sent ping. kpTimeoutLeft := time.Duration(0) // Records the last value of t.lastRead before we go block on the timer. // This is required to check for read activity since then. prevNano := time.Now().UnixNano() // Initialize the different timers to their default values. idleTimer := time.NewTimer(t.kp.MaxConnectionIdle) ageTimer := time.NewTimer(t.kp.MaxConnectionAge) kpTimer := time.NewTimer(t.kp.Time) defer func() { // We need to drain the underlying channel in these timers after a call // to Stop(), only if we are interested in resetting them. Clearly we // are not interested in resetting them here. idleTimer.Stop() ageTimer.Stop() kpTimer.Stop() }() for { select { case <-idleTimer.C: t.mu.Lock() idle := t.idle if idle.IsZero() { // The connection is non-idle. t.mu.Unlock() idleTimer.Reset(t.kp.MaxConnectionIdle) continue } val := t.kp.MaxConnectionIdle - time.Since(idle) t.mu.Unlock() if val <= 0 { // The connection has been idle for a duration of keepalive.MaxConnectionIdle or more. // Gracefully close the connection. t.Drain("max_idle") return } idleTimer.Reset(val) case <-ageTimer.C: t.Drain("max_age") ageTimer.Reset(t.kp.MaxConnectionAgeGrace) select { case <-ageTimer.C: // Close the connection after grace period. if t.logger.V(logLevel) { t.logger.Infof("Closing server transport due to maximum connection age") } t.controlBuf.put(closeConnection{}) case <-t.done: } return case <-kpTimer.C: lastRead := atomic.LoadInt64(&t.lastRead) if lastRead > prevNano { // There has been read activity since the last time we were // here. Setup the timer to fire at kp.Time seconds from // lastRead time and continue. outstandingPing = false kpTimer.Reset(time.Duration(lastRead) + t.kp.Time - time.Duration(time.Now().UnixNano())) prevNano = lastRead continue } if outstandingPing && kpTimeoutLeft <= 0 { t.Close(fmt.Errorf("keepalive ping not acked within timeout %s", t.kp.Timeout)) return } if !outstandingPing { if channelz.IsOn() { t.channelz.SocketMetrics.KeepAlivesSent.Add(1) } t.controlBuf.put(p) kpTimeoutLeft = t.kp.Timeout outstandingPing = true } // The amount of time to sleep here is the minimum of kp.Time and // timeoutLeft. This will ensure that we wait only for kp.Time // before sending out the next ping (for cases where the ping is // acked). sleepDuration := min(t.kp.Time, kpTimeoutLeft) kpTimeoutLeft -= sleepDuration kpTimer.Reset(sleepDuration) case <-t.done: return } } } // Close starts shutting down the http2Server transport. // TODO(zhaoq): Now the destruction is not blocked on any pending streams. This // could cause some resource issue. Revisit this later. func (t *http2Server) Close(err error) { t.mu.Lock() if t.state == closing { t.mu.Unlock() return } if t.logger.V(logLevel) { t.logger.Infof("Closing: %v", err) } t.state = closing streams := t.activeStreams t.activeStreams = nil t.mu.Unlock() t.controlBuf.finish() close(t.done) if err := t.conn.Close(); err != nil && t.logger.V(logLevel) { t.logger.Infof("Error closing underlying net.Conn during Close: %v", err) } channelz.RemoveEntry(t.channelz.ID) // Cancel all active streams. for _, s := range streams { s.cancel() } } // deleteStream deletes the stream s from transport's active streams. func (t *http2Server) deleteStream(s *ServerStream, eosReceived bool) { t.mu.Lock() _, isActive := t.activeStreams[s.id] if isActive { delete(t.activeStreams, s.id) if len(t.activeStreams) == 0 { t.idle = time.Now() } } t.mu.Unlock() if isActive && channelz.IsOn() { if eosReceived { t.channelz.SocketMetrics.StreamsSucceeded.Add(1) } else { t.channelz.SocketMetrics.StreamsFailed.Add(1) } } } // finishStream closes the stream and puts the trailing headerFrame into controlbuf. func (t *http2Server) finishStream(s *ServerStream, rst bool, rstCode http2.ErrCode, hdr *headerFrame, eosReceived bool) { // In case stream sending and receiving are invoked in separate // goroutines (e.g., bi-directional streaming), cancel needs to be // called to interrupt the potential blocking on other goroutines. s.cancel() oldState := s.swapState(streamDone) if oldState == streamDone { // If the stream was already done, return. return } hdr.cleanup = &cleanupStream{ streamID: s.id, rst: rst, rstCode: rstCode, onWrite: func() { t.deleteStream(s, eosReceived) }, } t.controlBuf.put(hdr) } // closeStream clears the footprint of a stream when the stream is not needed any more. func (t *http2Server) closeStream(s *ServerStream, rst bool, rstCode http2.ErrCode, eosReceived bool) { // In case stream sending and receiving are invoked in separate // goroutines (e.g., bi-directional streaming), cancel needs to be // called to interrupt the potential blocking on other goroutines. s.cancel() // We can't return early even if the stream's state is "done" as the state // might have been set by the `finishStream` method. Deleting the stream via // `finishStream` can get blocked on flow control. s.swapState(streamDone) t.deleteStream(s, eosReceived) t.controlBuf.put(&cleanupStream{ streamID: s.id, rst: rst, rstCode: rstCode, onWrite: func() {}, }) } func (t *http2Server) Drain(debugData string) { t.mu.Lock() defer t.mu.Unlock() if t.drainEvent != nil { return } t.drainEvent = grpcsync.NewEvent() t.controlBuf.put(&goAway{code: http2.ErrCodeNo, debugData: []byte(debugData), headsUp: true}) } var goAwayPing = &ping{data: [8]byte{1, 6, 1, 8, 0, 3, 3, 9}} // Handles outgoing GoAway and returns true if loopy needs to put itself // in draining mode. func (t *http2Server) outgoingGoAwayHandler(g *goAway) (bool, error) { t.maxStreamMu.Lock() t.mu.Lock() if t.state == closing { // TODO(mmukhi): This seems unnecessary. t.mu.Unlock() t.maxStreamMu.Unlock() // The transport is closing. return false, ErrConnClosing } if !g.headsUp { // Stop accepting more streams now. t.state = draining sid := t.maxStreamID retErr := g.closeConn if len(t.activeStreams) == 0 { retErr = errors.New("second GOAWAY written and no active streams left to process") } t.mu.Unlock() t.maxStreamMu.Unlock() if err := t.framer.fr.WriteGoAway(sid, g.code, g.debugData); err != nil { return false, err } t.framer.writer.Flush() if retErr != nil { return false, retErr } return true, nil } t.mu.Unlock() t.maxStreamMu.Unlock() // For a graceful close, send out a GoAway with stream ID of MaxUInt32, // Follow that with a ping and wait for the ack to come back or a timer // to expire. During this time accept new streams since they might have // originated before the GoAway reaches the client. // After getting the ack or timer expiration send out another GoAway this // time with an ID of the max stream server intends to process. if err := t.framer.fr.WriteGoAway(math.MaxUint32, http2.ErrCodeNo, g.debugData); err != nil { return false, err } if err := t.framer.fr.WritePing(false, goAwayPing.data); err != nil { return false, err } go func() { timer := time.NewTimer(5 * time.Second) defer timer.Stop() select { case <-t.drainEvent.Done(): case <-timer.C: case <-t.done: return } t.controlBuf.put(&goAway{code: g.code, debugData: g.debugData}) }() return false, nil } func (t *http2Server) socketMetrics() *channelz.EphemeralSocketMetrics { return &channelz.EphemeralSocketMetrics{ LocalFlowControlWindow: int64(t.fc.getSize()), RemoteFlowControlWindow: t.getOutFlowWindow(), } } func (t *http2Server) incrMsgSent() { if channelz.IsOn() { t.channelz.SocketMetrics.MessagesSent.Add(1) t.channelz.SocketMetrics.LastMessageSentTimestamp.Add(1) } } func (t *http2Server) incrMsgRecv() { if channelz.IsOn() { t.channelz.SocketMetrics.MessagesReceived.Add(1) t.channelz.SocketMetrics.LastMessageReceivedTimestamp.Add(1) } } func (t *http2Server) getOutFlowWindow() int64 { resp := make(chan uint32, 1) timer := time.NewTimer(time.Second) defer timer.Stop() t.controlBuf.put(&outFlowControlSizeRequest{resp}) select { case sz := <-resp: return int64(sz) case <-t.done: return -1 case <-timer.C: return -2 } } // Peer returns the peer of the transport. func (t *http2Server) Peer() *peer.Peer { return &peer.Peer{ Addr: t.peer.Addr, LocalAddr: t.peer.LocalAddr, AuthInfo: t.peer.AuthInfo, // Can be nil } } func getJitter(v time.Duration) time.Duration { if v == infinity { return 0 } // Generate a jitter between +/- 10% of the value. r := int64(v / 10) j := rand.Int64N(2*r) - r return time.Duration(j) } type connectionKey struct{} // GetConnection gets the connection from the context. func GetConnection(ctx context.Context) net.Conn { conn, _ := ctx.Value(connectionKey{}).(net.Conn) return conn } // SetConnection adds the connection to the context to be able to get // information about the destination ip and port for an incoming RPC. This also // allows any unary or streaming interceptors to see the connection. func SetConnection(ctx context.Context, conn net.Conn) context.Context { return context.WithValue(ctx, connectionKey{}, conn) } ================================================ FILE: vendor/google.golang.org/grpc/internal/transport/http_util.go ================================================ /* * * Copyright 2014 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package transport import ( "bufio" "encoding/base64" "errors" "fmt" "io" "math" "net/http" "net/url" "strconv" "strings" "sync" "time" "unicode/utf8" "golang.org/x/net/http2" "golang.org/x/net/http2/hpack" "google.golang.org/grpc/codes" "google.golang.org/grpc/mem" ) const ( // http2MaxFrameLen specifies the max length of a HTTP2 frame. http2MaxFrameLen = 16384 // 16KB frame // https://httpwg.org/specs/rfc7540.html#SettingValues http2InitHeaderTableSize = 4096 ) var ( clientPreface = []byte(http2.ClientPreface) http2ErrConvTab = map[http2.ErrCode]codes.Code{ http2.ErrCodeNo: codes.Internal, http2.ErrCodeProtocol: codes.Internal, http2.ErrCodeInternal: codes.Internal, http2.ErrCodeFlowControl: codes.ResourceExhausted, http2.ErrCodeSettingsTimeout: codes.Internal, http2.ErrCodeStreamClosed: codes.Internal, http2.ErrCodeFrameSize: codes.Internal, http2.ErrCodeRefusedStream: codes.Unavailable, http2.ErrCodeCancel: codes.Canceled, http2.ErrCodeCompression: codes.Internal, http2.ErrCodeConnect: codes.Internal, http2.ErrCodeEnhanceYourCalm: codes.ResourceExhausted, http2.ErrCodeInadequateSecurity: codes.PermissionDenied, http2.ErrCodeHTTP11Required: codes.Internal, } // HTTPStatusConvTab is the HTTP status code to gRPC error code conversion table. HTTPStatusConvTab = map[int]codes.Code{ // 400 Bad Request - INTERNAL. http.StatusBadRequest: codes.Internal, // 401 Unauthorized - UNAUTHENTICATED. http.StatusUnauthorized: codes.Unauthenticated, // 403 Forbidden - PERMISSION_DENIED. http.StatusForbidden: codes.PermissionDenied, // 404 Not Found - UNIMPLEMENTED. http.StatusNotFound: codes.Unimplemented, // 429 Too Many Requests - UNAVAILABLE. http.StatusTooManyRequests: codes.Unavailable, // 502 Bad Gateway - UNAVAILABLE. http.StatusBadGateway: codes.Unavailable, // 503 Service Unavailable - UNAVAILABLE. http.StatusServiceUnavailable: codes.Unavailable, // 504 Gateway timeout - UNAVAILABLE. http.StatusGatewayTimeout: codes.Unavailable, } ) var grpcStatusDetailsBinHeader = "grpc-status-details-bin" // isReservedHeader checks whether hdr belongs to HTTP2 headers // reserved by gRPC protocol. Any other headers are classified as the // user-specified metadata. func isReservedHeader(hdr string) bool { if hdr != "" && hdr[0] == ':' { return true } switch hdr { case "content-type", "user-agent", "grpc-message-type", "grpc-encoding", "grpc-message", "grpc-status", "grpc-timeout", // Intentionally exclude grpc-previous-rpc-attempts and // grpc-retry-pushback-ms, which are "reserved", but their API // intentionally works via metadata. "te": return true default: return false } } // isWhitelistedHeader checks whether hdr should be propagated into metadata // visible to users, even though it is classified as "reserved", above. func isWhitelistedHeader(hdr string) bool { switch hdr { case ":authority", "user-agent": return true default: return false } } const binHdrSuffix = "-bin" func encodeBinHeader(v []byte) string { return base64.RawStdEncoding.EncodeToString(v) } func decodeBinHeader(v string) ([]byte, error) { if len(v)%4 == 0 { // Input was padded, or padding was not necessary. return base64.StdEncoding.DecodeString(v) } return base64.RawStdEncoding.DecodeString(v) } func encodeMetadataHeader(k, v string) string { if strings.HasSuffix(k, binHdrSuffix) { return encodeBinHeader(([]byte)(v)) } return v } func decodeMetadataHeader(k, v string) (string, error) { if strings.HasSuffix(k, binHdrSuffix) { b, err := decodeBinHeader(v) return string(b), err } return v, nil } type timeoutUnit uint8 const ( hour timeoutUnit = 'H' minute timeoutUnit = 'M' second timeoutUnit = 'S' millisecond timeoutUnit = 'm' microsecond timeoutUnit = 'u' nanosecond timeoutUnit = 'n' ) func timeoutUnitToDuration(u timeoutUnit) (d time.Duration, ok bool) { switch u { case hour: return time.Hour, true case minute: return time.Minute, true case second: return time.Second, true case millisecond: return time.Millisecond, true case microsecond: return time.Microsecond, true case nanosecond: return time.Nanosecond, true default: } return } func decodeTimeout(s string) (time.Duration, error) { size := len(s) if size < 2 { return 0, fmt.Errorf("transport: timeout string is too short: %q", s) } if size > 9 { // Spec allows for 8 digits plus the unit. return 0, fmt.Errorf("transport: timeout string is too long: %q", s) } unit := timeoutUnit(s[size-1]) d, ok := timeoutUnitToDuration(unit) if !ok { return 0, fmt.Errorf("transport: timeout unit is not recognized: %q", s) } t, err := strconv.ParseUint(s[:size-1], 10, 64) if err != nil { return 0, err } const maxHours = math.MaxInt64 / uint64(time.Hour) if d == time.Hour && t > maxHours { // This timeout would overflow math.MaxInt64; clamp it. return time.Duration(math.MaxInt64), nil } return d * time.Duration(t), nil } const ( spaceByte = ' ' tildeByte = '~' percentByte = '%' ) // encodeGrpcMessage is used to encode status code in header field // "grpc-message". It does percent encoding and also replaces invalid utf-8 // characters with Unicode replacement character. // // It checks to see if each individual byte in msg is an allowable byte, and // then either percent encoding or passing it through. When percent encoding, // the byte is converted into hexadecimal notation with a '%' prepended. func encodeGrpcMessage(msg string) string { if msg == "" { return "" } lenMsg := len(msg) for i := 0; i < lenMsg; i++ { c := msg[i] if !(c >= spaceByte && c <= tildeByte && c != percentByte) { return encodeGrpcMessageUnchecked(msg) } } return msg } func encodeGrpcMessageUnchecked(msg string) string { var sb strings.Builder for len(msg) > 0 { r, size := utf8.DecodeRuneInString(msg) for _, b := range []byte(string(r)) { if size > 1 { // If size > 1, r is not ascii. Always do percent encoding. fmt.Fprintf(&sb, "%%%02X", b) continue } // The for loop is necessary even if size == 1. r could be // utf8.RuneError. // // fmt.Sprintf("%%%02X", utf8.RuneError) gives "%FFFD". if b >= spaceByte && b <= tildeByte && b != percentByte { sb.WriteByte(b) } else { fmt.Fprintf(&sb, "%%%02X", b) } } msg = msg[size:] } return sb.String() } // decodeGrpcMessage decodes the msg encoded by encodeGrpcMessage. func decodeGrpcMessage(msg string) string { if msg == "" { return "" } lenMsg := len(msg) for i := 0; i < lenMsg; i++ { if msg[i] == percentByte && i+2 < lenMsg { return decodeGrpcMessageUnchecked(msg) } } return msg } func decodeGrpcMessageUnchecked(msg string) string { var sb strings.Builder lenMsg := len(msg) for i := 0; i < lenMsg; i++ { c := msg[i] if c == percentByte && i+2 < lenMsg { parsed, err := strconv.ParseUint(msg[i+1:i+3], 16, 8) if err != nil { sb.WriteByte(c) } else { sb.WriteByte(byte(parsed)) i += 2 } } else { sb.WriteByte(c) } } return sb.String() } type bufWriter struct { pool *sync.Pool buf []byte offset int batchSize int conn io.Writer err error } func newBufWriter(conn io.Writer, batchSize int, pool *sync.Pool) *bufWriter { w := &bufWriter{ batchSize: batchSize, conn: conn, pool: pool, } // this indicates that we should use non shared buf if pool == nil { w.buf = make([]byte, batchSize) } return w } func (w *bufWriter) Write(b []byte) (int, error) { if w.err != nil { return 0, w.err } if w.batchSize == 0 { // Buffer has been disabled. n, err := w.conn.Write(b) return n, toIOError(err) } if w.buf == nil { b := w.pool.Get().(*[]byte) w.buf = *b } written := 0 for len(b) > 0 { copied := copy(w.buf[w.offset:], b) b = b[copied:] written += copied w.offset += copied if w.offset < w.batchSize { continue } if err := w.flushKeepBuffer(); err != nil { return written, err } } return written, nil } func (w *bufWriter) Flush() error { err := w.flushKeepBuffer() // Only release the buffer if we are in a "shared" mode if w.buf != nil && w.pool != nil { b := w.buf w.pool.Put(&b) w.buf = nil } return err } func (w *bufWriter) flushKeepBuffer() error { if w.err != nil { return w.err } if w.offset == 0 { return nil } _, w.err = w.conn.Write(w.buf[:w.offset]) w.err = toIOError(w.err) w.offset = 0 return w.err } type ioError struct { error } func (i ioError) Unwrap() error { return i.error } func isIOError(err error) bool { return errors.As(err, &ioError{}) } func toIOError(err error) error { if err == nil { return nil } return ioError{error: err} } type parsedDataFrame struct { http2.FrameHeader data mem.Buffer } func (df *parsedDataFrame) StreamEnded() bool { return df.FrameHeader.Flags.Has(http2.FlagDataEndStream) } type framer struct { writer *bufWriter fr *http2.Framer headerBuf []byte // cached slice for framer headers to reduce heap allocs. reader io.Reader dataFrame parsedDataFrame // Cached data frame to avoid heap allocations. pool mem.BufferPool errDetail error } var writeBufferPoolMap = make(map[int]*sync.Pool) var writeBufferMutex sync.Mutex func newFramer(conn io.ReadWriter, writeBufferSize, readBufferSize int, sharedWriteBuffer bool, maxHeaderListSize uint32, memPool mem.BufferPool) *framer { if writeBufferSize < 0 { writeBufferSize = 0 } var r io.Reader = conn if readBufferSize > 0 { r = bufio.NewReaderSize(r, readBufferSize) } var pool *sync.Pool if sharedWriteBuffer { pool = getWriteBufferPool(writeBufferSize) } w := newBufWriter(conn, writeBufferSize, pool) f := &framer{ writer: w, fr: http2.NewFramer(w, r), reader: r, pool: memPool, } f.fr.SetMaxReadFrameSize(http2MaxFrameLen) // Opt-in to Frame reuse API on framer to reduce garbage. // Frames aren't safe to read from after a subsequent call to ReadFrame. f.fr.SetReuseFrames() f.fr.MaxHeaderListSize = maxHeaderListSize f.fr.ReadMetaHeaders = hpack.NewDecoder(http2InitHeaderTableSize, nil) return f } // writeData writes a DATA frame. // // It is the caller's responsibility not to violate the maximum frame size. func (f *framer) writeData(streamID uint32, endStream bool, data [][]byte) error { var flags http2.Flags if endStream { flags = http2.FlagDataEndStream } length := uint32(0) for _, d := range data { length += uint32(len(d)) } // TODO: Replace the header write with the framer API being added in // https://github.com/golang/go/issues/66655. f.headerBuf = append(f.headerBuf[:0], byte(length>>16), byte(length>>8), byte(length), byte(http2.FrameData), byte(flags), byte(streamID>>24), byte(streamID>>16), byte(streamID>>8), byte(streamID)) if _, err := f.writer.Write(f.headerBuf); err != nil { return err } for _, d := range data { if _, err := f.writer.Write(d); err != nil { return err } } return nil } // readFrame reads a single frame. The returned Frame is only valid // until the next call to readFrame. func (f *framer) readFrame() (any, error) { f.errDetail = nil fh, err := f.fr.ReadFrameHeader() if err != nil { f.errDetail = f.fr.ErrorDetail() return nil, err } // Read the data frame directly from the underlying io.Reader to avoid // copies. if fh.Type == http2.FrameData { err = f.readDataFrame(fh) return &f.dataFrame, err } fr, err := f.fr.ReadFrameForHeader(fh) if err != nil { f.errDetail = f.fr.ErrorDetail() return nil, err } return fr, err } // errorDetail returns a more detailed error of the last error // returned by framer.readFrame. For instance, if readFrame // returns a StreamError with code PROTOCOL_ERROR, errorDetail // will say exactly what was invalid. errorDetail is not guaranteed // to return a non-nil value. // errorDetail is reset after the next call to readFrame. func (f *framer) errorDetail() error { return f.errDetail } func (f *framer) readDataFrame(fh http2.FrameHeader) (err error) { if fh.StreamID == 0 { // DATA frames MUST be associated with a stream. If a // DATA frame is received whose stream identifier // field is 0x0, the recipient MUST respond with a // connection error (Section 5.4.1) of type // PROTOCOL_ERROR. f.errDetail = errors.New("DATA frame with stream ID 0") return http2.ConnectionError(http2.ErrCodeProtocol) } // Converting a *[]byte to a mem.SliceBuffer incurs a heap allocation. This // conversion is performed by mem.NewBuffer. To avoid the extra allocation // a []byte is allocated directly if required and cast to a mem.SliceBuffer. var buf []byte // poolHandle is the pointer returned by the buffer pool (if it's used.). var poolHandle *[]byte useBufferPool := !mem.IsBelowBufferPoolingThreshold(int(fh.Length)) if useBufferPool { poolHandle = f.pool.Get(int(fh.Length)) buf = *poolHandle defer func() { if err != nil { f.pool.Put(poolHandle) } }() } else { buf = make([]byte, int(fh.Length)) } if fh.Flags.Has(http2.FlagDataPadded) { if fh.Length == 0 { return io.ErrUnexpectedEOF } // This initial 1-byte read can be inefficient for unbuffered readers, // but it allows the rest of the payload to be read directly to the // start of the destination slice. This makes it easy to return the // original slice back to the buffer pool. if _, err := io.ReadFull(f.reader, buf[:1]); err != nil { return err } padSize := buf[0] buf = buf[:len(buf)-1] if int(padSize) > len(buf) { // If the length of the padding is greater than the // length of the frame payload, the recipient MUST // treat this as a connection error. // Filed: https://github.com/http2/http2-spec/issues/610 f.errDetail = errors.New("pad size larger than data payload") return http2.ConnectionError(http2.ErrCodeProtocol) } if _, err := io.ReadFull(f.reader, buf); err != nil { return err } buf = buf[:len(buf)-int(padSize)] } else if _, err := io.ReadFull(f.reader, buf); err != nil { return err } f.dataFrame.FrameHeader = fh if useBufferPool { // Update the handle to point to the (potentially re-sliced) buf. *poolHandle = buf f.dataFrame.data = mem.NewBuffer(poolHandle, f.pool) } else { f.dataFrame.data = mem.SliceBuffer(buf) } return nil } func (df *parsedDataFrame) Header() http2.FrameHeader { return df.FrameHeader } func getWriteBufferPool(size int) *sync.Pool { writeBufferMutex.Lock() defer writeBufferMutex.Unlock() pool, ok := writeBufferPoolMap[size] if ok { return pool } pool = &sync.Pool{ New: func() any { b := make([]byte, size) return &b }, } writeBufferPoolMap[size] = pool return pool } // ParseDialTarget returns the network and address to pass to dialer. func ParseDialTarget(target string) (string, string) { net := "tcp" m1 := strings.Index(target, ":") m2 := strings.Index(target, ":/") // handle unix:addr which will fail with url.Parse if m1 >= 0 && m2 < 0 { if n := target[0:m1]; n == "unix" { return n, target[m1+1:] } } if m2 >= 0 { t, err := url.Parse(target) if err != nil { return net, target } scheme := t.Scheme addr := t.Path if scheme == "unix" { if addr == "" { addr = t.Host } return scheme, addr } } return net, target } ================================================ FILE: vendor/google.golang.org/grpc/internal/transport/logging.go ================================================ /* * * Copyright 2023 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package transport import ( "fmt" "google.golang.org/grpc/grpclog" internalgrpclog "google.golang.org/grpc/internal/grpclog" ) var logger = grpclog.Component("transport") func prefixLoggerForServerTransport(p *http2Server) *internalgrpclog.PrefixLogger { return internalgrpclog.NewPrefixLogger(logger, fmt.Sprintf("[server-transport %p] ", p)) } func prefixLoggerForServerHandlerTransport(p *serverHandlerTransport) *internalgrpclog.PrefixLogger { return internalgrpclog.NewPrefixLogger(logger, fmt.Sprintf("[server-handler-transport %p] ", p)) } func prefixLoggerForClientTransport(p *http2Client) *internalgrpclog.PrefixLogger { return internalgrpclog.NewPrefixLogger(logger, fmt.Sprintf("[client-transport %p] ", p)) } ================================================ FILE: vendor/google.golang.org/grpc/internal/transport/networktype/networktype.go ================================================ /* * * Copyright 2020 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package networktype declares the network type to be used in the default // dialer. Attribute of a resolver.Address. package networktype import ( "google.golang.org/grpc/resolver" ) // keyType is the key to use for storing State in Attributes. type keyType string const key = keyType("grpc.internal.transport.networktype") // Set returns a copy of the provided address with attributes containing networkType. func Set(address resolver.Address, networkType string) resolver.Address { address.Attributes = address.Attributes.WithValue(key, networkType) return address } // Get returns the network type in the resolver.Address and true, or "", false // if not present. func Get(address resolver.Address) (string, bool) { v := address.Attributes.Value(key) if v == nil { return "", false } return v.(string), true } ================================================ FILE: vendor/google.golang.org/grpc/internal/transport/proxy.go ================================================ /* * * Copyright 2017 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package transport import ( "bufio" "context" "encoding/base64" "fmt" "io" "net" "net/http" "net/http/httputil" "net/url" "google.golang.org/grpc/internal" "google.golang.org/grpc/internal/proxyattributes" "google.golang.org/grpc/resolver" ) const proxyAuthHeaderKey = "Proxy-Authorization" // To read a response from a net.Conn, http.ReadResponse() takes a bufio.Reader. // It's possible that this reader reads more than what's need for the response // and stores those bytes in the buffer. bufConn wraps the original net.Conn // and the bufio.Reader to make sure we don't lose the bytes in the buffer. type bufConn struct { net.Conn r io.Reader } func (c *bufConn) Read(b []byte) (int, error) { return c.r.Read(b) } func basicAuth(username, password string) string { auth := username + ":" + password return base64.StdEncoding.EncodeToString([]byte(auth)) } func doHTTPConnectHandshake(ctx context.Context, conn net.Conn, grpcUA string, opts proxyattributes.Options) (_ net.Conn, err error) { defer func() { if err != nil { conn.Close() } }() req := &http.Request{ Method: http.MethodConnect, URL: &url.URL{Host: opts.ConnectAddr}, Header: map[string][]string{"User-Agent": {grpcUA}}, } if user := opts.User; user != nil { u := user.Username() p, _ := user.Password() req.Header.Add(proxyAuthHeaderKey, "Basic "+basicAuth(u, p)) } if err := sendHTTPRequest(ctx, req, conn); err != nil { return nil, fmt.Errorf("failed to write the HTTP request: %v", err) } r := bufio.NewReader(conn) resp, err := http.ReadResponse(r, req) if err != nil { return nil, fmt.Errorf("reading server HTTP response: %v", err) } defer resp.Body.Close() if resp.StatusCode != http.StatusOK { dump, err := httputil.DumpResponse(resp, true) if err != nil { return nil, fmt.Errorf("failed to do connect handshake, status code: %s", resp.Status) } return nil, fmt.Errorf("failed to do connect handshake, response: %q", dump) } // The buffer could contain extra bytes from the target server, so we can't // discard it. However, in many cases where the server waits for the client // to send the first message (e.g. when TLS is being used), the buffer will // be empty, so we can avoid the overhead of reading through this buffer. if r.Buffered() != 0 { return &bufConn{Conn: conn, r: r}, nil } return conn, nil } // proxyDial establishes a TCP connection to the specified address and performs an HTTP CONNECT handshake. func proxyDial(ctx context.Context, addr resolver.Address, grpcUA string, opts proxyattributes.Options) (net.Conn, error) { conn, err := internal.NetDialerWithTCPKeepalive().DialContext(ctx, "tcp", addr.Addr) if err != nil { return nil, err } return doHTTPConnectHandshake(ctx, conn, grpcUA, opts) } func sendHTTPRequest(ctx context.Context, req *http.Request, conn net.Conn) error { req = req.WithContext(ctx) if err := req.Write(conn); err != nil { return fmt.Errorf("failed to write the HTTP request: %v", err) } return nil } ================================================ FILE: vendor/google.golang.org/grpc/internal/transport/server_stream.go ================================================ /* * * Copyright 2024 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package transport import ( "context" "errors" "strings" "sync" "sync/atomic" "google.golang.org/grpc/mem" "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" ) // ServerStream implements streaming functionality for a gRPC server. type ServerStream struct { Stream // Embed for common stream functionality. st internalServerTransport ctxDone <-chan struct{} // closed at the end of stream. Cache of ctx.Done() (for performance) // cancel is invoked at the end of stream to cancel ctx. It also stops the // timer for monitoring the rpc deadline if configured. cancel func() // Holds compressor names passed in grpc-accept-encoding metadata from the // client. clientAdvertisedCompressors string // hdrMu protects outgoing header and trailer metadata. hdrMu sync.Mutex header metadata.MD // the outgoing header metadata. Updated by WriteHeader. headerSent atomic.Bool // atomically set when the headers are sent out. headerWireLength int } // Read reads an n byte message from the input stream. func (s *ServerStream) Read(n int) (mem.BufferSlice, error) { b, err := s.Stream.read(n) if err == nil { s.st.incrMsgRecv() } return b, err } // SendHeader sends the header metadata for the given stream. func (s *ServerStream) SendHeader(md metadata.MD) error { return s.st.writeHeader(s, md) } // Write writes the hdr and data bytes to the output stream. func (s *ServerStream) Write(hdr []byte, data mem.BufferSlice, opts *WriteOptions) error { return s.st.write(s, hdr, data, opts) } // WriteStatus sends the status of a stream to the client. WriteStatus is // the final call made on a stream and always occurs. func (s *ServerStream) WriteStatus(st *status.Status) error { return s.st.writeStatus(s, st) } // isHeaderSent indicates whether headers have been sent. func (s *ServerStream) isHeaderSent() bool { return s.headerSent.Load() } // updateHeaderSent updates headerSent and returns true // if it was already set. func (s *ServerStream) updateHeaderSent() bool { return s.headerSent.Swap(true) } // RecvCompress returns the compression algorithm applied to the inbound // message. It is empty string if there is no compression applied. func (s *ServerStream) RecvCompress() string { return s.recvCompress } // SendCompress returns the send compressor name. func (s *ServerStream) SendCompress() string { return s.sendCompress } // ContentSubtype returns the content-subtype for a request. For example, a // content-subtype of "proto" will result in a content-type of // "application/grpc+proto". This will always be lowercase. See // https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#requests for // more details. func (s *ServerStream) ContentSubtype() string { return s.contentSubtype } // SetSendCompress sets the compression algorithm to the stream. func (s *ServerStream) SetSendCompress(name string) error { if s.isHeaderSent() || s.getState() == streamDone { return errors.New("transport: set send compressor called after headers sent or stream done") } s.sendCompress = name return nil } // SetContext sets the context of the stream. This will be deleted once the // stats handler callouts all move to gRPC layer. func (s *ServerStream) SetContext(ctx context.Context) { s.ctx = ctx } // ClientAdvertisedCompressors returns the compressor names advertised by the // client via grpc-accept-encoding header. func (s *ServerStream) ClientAdvertisedCompressors() []string { values := strings.Split(s.clientAdvertisedCompressors, ",") for i, v := range values { values[i] = strings.TrimSpace(v) } return values } // Header returns the header metadata of the stream. It returns the out header // after t.WriteHeader is called. It does not block and must not be called // until after WriteHeader. func (s *ServerStream) Header() (metadata.MD, error) { // Return the header in stream. It will be the out // header after t.WriteHeader is called. return s.header.Copy(), nil } // HeaderWireLength returns the size of the headers of the stream as received // from the wire. func (s *ServerStream) HeaderWireLength() int { return s.headerWireLength } // SetHeader sets the header metadata. This can be called multiple times. // This should not be called in parallel to other data writes. func (s *ServerStream) SetHeader(md metadata.MD) error { if md.Len() == 0 { return nil } if s.isHeaderSent() || s.getState() == streamDone { return ErrIllegalHeaderWrite } s.hdrMu.Lock() s.header = metadata.Join(s.header, md) s.hdrMu.Unlock() return nil } // SetTrailer sets the trailer metadata which will be sent with the RPC status // by the server. This can be called multiple times. // This should not be called parallel to other data writes. func (s *ServerStream) SetTrailer(md metadata.MD) error { if md.Len() == 0 { return nil } if s.getState() == streamDone { return ErrIllegalHeaderWrite } s.hdrMu.Lock() s.trailer = metadata.Join(s.trailer, md) s.hdrMu.Unlock() return nil } func (s *ServerStream) requestRead(n int) { s.st.adjustWindow(s, uint32(n)) } func (s *ServerStream) updateWindow(n int) { s.st.updateWindow(s, uint32(n)) } ================================================ FILE: vendor/google.golang.org/grpc/internal/transport/transport.go ================================================ /* * * Copyright 2014 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package transport defines and implements message oriented communication // channel to complete various transactions (e.g., an RPC). It is meant for // grpc-internal usage and is not intended to be imported directly by users. package transport import ( "context" "errors" "fmt" "io" "net" "sync" "sync/atomic" "time" "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials" "google.golang.org/grpc/internal/channelz" "google.golang.org/grpc/keepalive" "google.golang.org/grpc/mem" "google.golang.org/grpc/metadata" "google.golang.org/grpc/peer" "google.golang.org/grpc/stats" "google.golang.org/grpc/status" "google.golang.org/grpc/tap" ) const logLevel = 2 // recvMsg represents the received msg from the transport. All transport // protocol specific info has been removed. type recvMsg struct { buffer mem.Buffer // nil: received some data // io.EOF: stream is completed. data is nil. // other non-nil error: transport failure. data is nil. err error } // recvBuffer is an unbounded channel of recvMsg structs. // // Note: recvBuffer differs from buffer.Unbounded only in the fact that it // holds a channel of recvMsg structs instead of objects implementing "item" // interface. recvBuffer is written to much more often and using strict recvMsg // structs helps avoid allocation in "recvBuffer.put" type recvBuffer struct { c chan recvMsg mu sync.Mutex backlog []recvMsg err error } // init allows a recvBuffer to be initialized in-place, which is useful // for resetting a buffer or for avoiding a heap allocation when the buffer // is embedded in another struct. func (b *recvBuffer) init() { b.c = make(chan recvMsg, 1) } func (b *recvBuffer) put(r recvMsg) { b.mu.Lock() if b.err != nil { // drop the buffer on the floor. Since b.err is not nil, any subsequent reads // will always return an error, making this buffer inaccessible. r.buffer.Free() b.mu.Unlock() // An error had occurred earlier, don't accept more // data or errors. return } b.err = r.err if len(b.backlog) == 0 { select { case b.c <- r: b.mu.Unlock() return default: } } b.backlog = append(b.backlog, r) b.mu.Unlock() } func (b *recvBuffer) load() { b.mu.Lock() if len(b.backlog) > 0 { select { case b.c <- b.backlog[0]: b.backlog[0] = recvMsg{} b.backlog = b.backlog[1:] default: } } b.mu.Unlock() } // get returns the channel that receives a recvMsg in the buffer. // // Upon receipt of a recvMsg, the caller should call load to send another // recvMsg onto the channel if there is any. func (b *recvBuffer) get() <-chan recvMsg { return b.c } // recvBufferReader implements io.Reader interface to read the data from // recvBuffer. type recvBufferReader struct { _ noCopy clientStream *ClientStream // The client transport stream is closed with a status representing ctx.Err() and nil trailer metadata. ctx context.Context ctxDone <-chan struct{} // cache of ctx.Done() (for performance). recv *recvBuffer last mem.Buffer // Stores the remaining data in the previous calls. err error } func (r *recvBufferReader) ReadMessageHeader(header []byte) (n int, err error) { if r.err != nil { return 0, r.err } if r.last != nil { n, r.last = mem.ReadUnsafe(header, r.last) return n, nil } if r.clientStream != nil { n, r.err = r.readMessageHeaderClient(header) } else { n, r.err = r.readMessageHeader(header) } return n, r.err } // Read reads the next n bytes from last. If last is drained, it tries to read // additional data from recv. It blocks if there no additional data available in // recv. If Read returns any non-nil error, it will continue to return that // error. func (r *recvBufferReader) Read(n int) (buf mem.Buffer, err error) { if r.err != nil { return nil, r.err } if r.last != nil { buf = r.last if r.last.Len() > n { buf, r.last = mem.SplitUnsafe(buf, n) } else { r.last = nil } return buf, nil } if r.clientStream != nil { buf, r.err = r.readClient(n) } else { buf, r.err = r.read(n) } return buf, r.err } func (r *recvBufferReader) readMessageHeader(header []byte) (n int, err error) { select { case <-r.ctxDone: return 0, ContextErr(r.ctx.Err()) case m := <-r.recv.get(): return r.readMessageHeaderAdditional(m, header) } } func (r *recvBufferReader) read(n int) (buf mem.Buffer, err error) { select { case <-r.ctxDone: return nil, ContextErr(r.ctx.Err()) case m := <-r.recv.get(): return r.readAdditional(m, n) } } func (r *recvBufferReader) readMessageHeaderClient(header []byte) (n int, err error) { // If the context is canceled, then closes the stream with nil metadata. // closeStream writes its error parameter to r.recv as a recvMsg. // r.readAdditional acts on that message and returns the necessary error. select { case <-r.ctxDone: // Note that this adds the ctx error to the end of recv buffer, and // reads from the head. This will delay the error until recv buffer is // empty, thus will delay ctx cancellation in Recv(). // // It's done this way to fix a race between ctx cancel and trailer. The // race was, stream.Recv() may return ctx error if ctxDone wins the // race, but stream.Trailer() may return a non-nil md because the stream // was not marked as done when trailer is received. This closeStream // call will mark stream as done, thus fix the race. // // TODO: delaying ctx error seems like a unnecessary side effect. What // we really want is to mark the stream as done, and return ctx error // faster. r.clientStream.Close(ContextErr(r.ctx.Err())) m := <-r.recv.get() return r.readMessageHeaderAdditional(m, header) case m := <-r.recv.get(): return r.readMessageHeaderAdditional(m, header) } } func (r *recvBufferReader) readClient(n int) (buf mem.Buffer, err error) { // If the context is canceled, then closes the stream with nil metadata. // closeStream writes its error parameter to r.recv as a recvMsg. // r.readAdditional acts on that message and returns the necessary error. select { case <-r.ctxDone: // Note that this adds the ctx error to the end of recv buffer, and // reads from the head. This will delay the error until recv buffer is // empty, thus will delay ctx cancellation in Recv(). // // It's done this way to fix a race between ctx cancel and trailer. The // race was, stream.Recv() may return ctx error if ctxDone wins the // race, but stream.Trailer() may return a non-nil md because the stream // was not marked as done when trailer is received. This closeStream // call will mark stream as done, thus fix the race. // // TODO: delaying ctx error seems like a unnecessary side effect. What // we really want is to mark the stream as done, and return ctx error // faster. r.clientStream.Close(ContextErr(r.ctx.Err())) m := <-r.recv.get() return r.readAdditional(m, n) case m := <-r.recv.get(): return r.readAdditional(m, n) } } func (r *recvBufferReader) readMessageHeaderAdditional(m recvMsg, header []byte) (n int, err error) { r.recv.load() if m.err != nil { if m.buffer != nil { m.buffer.Free() } return 0, m.err } n, r.last = mem.ReadUnsafe(header, m.buffer) return n, nil } func (r *recvBufferReader) readAdditional(m recvMsg, n int) (b mem.Buffer, err error) { r.recv.load() if m.err != nil { if m.buffer != nil { m.buffer.Free() } return nil, m.err } if m.buffer.Len() > n { m.buffer, r.last = mem.SplitUnsafe(m.buffer, n) } return m.buffer, nil } type streamState uint32 const ( streamActive streamState = iota streamWriteDone // EndStream sent streamReadDone // EndStream received streamDone // the entire stream is finished. ) // Stream represents an RPC in the transport layer. type Stream struct { ctx context.Context // the associated context of the stream method string // the associated RPC method of the stream recvCompress string sendCompress string readRequester readRequester // contentSubtype is the content-subtype for requests. // this must be lowercase or the behavior is undefined. contentSubtype string trailer metadata.MD // the key-value map of trailer metadata. // Non-pointer fields are at the end to optimize GC performance. state streamState id uint32 buf recvBuffer trReader transportReader fc inFlow wq writeQuota } // readRequester is used to state application's intentions to read data. This // is used to adjust flow control, if needed. type readRequester interface { requestRead(int) } func (s *Stream) swapState(st streamState) streamState { return streamState(atomic.SwapUint32((*uint32)(&s.state), uint32(st))) } func (s *Stream) compareAndSwapState(oldState, newState streamState) bool { return atomic.CompareAndSwapUint32((*uint32)(&s.state), uint32(oldState), uint32(newState)) } func (s *Stream) getState() streamState { return streamState(atomic.LoadUint32((*uint32)(&s.state))) } // Trailer returns the cached trailer metadata. Note that if it is not called // after the entire stream is done, it could return an empty MD. // It can be safely read only after stream has ended that is either read // or write have returned io.EOF. func (s *Stream) Trailer() metadata.MD { return s.trailer.Copy() } // Context returns the context of the stream. func (s *Stream) Context() context.Context { return s.ctx } // Method returns the method for the stream. func (s *Stream) Method() string { return s.method } func (s *Stream) write(m recvMsg) { s.buf.put(m) } // ReadMessageHeader reads data into the provided header slice from the stream. // It first checks if there was an error during a previous read operation and // returns it if present. It then requests a read operation for the length of // the header. It continues to read from the stream until the entire header // slice is filled or an error occurs. If an `io.EOF` error is encountered with // partially read data, it is converted to `io.ErrUnexpectedEOF` to indicate an // unexpected end of the stream. The method returns any error encountered during // the read process or nil if the header was successfully read. func (s *Stream) ReadMessageHeader(header []byte) (err error) { // Don't request a read if there was an error earlier if er := s.trReader.er; er != nil { return er } s.readRequester.requestRead(len(header)) for len(header) != 0 { n, err := s.trReader.ReadMessageHeader(header) header = header[n:] if len(header) == 0 { err = nil } if err != nil { if n > 0 && err == io.EOF { err = io.ErrUnexpectedEOF } return err } } return nil } // Read reads n bytes from the wire for this stream. func (s *Stream) read(n int) (data mem.BufferSlice, err error) { // Don't request a read if there was an error earlier if er := s.trReader.er; er != nil { return nil, er } s.readRequester.requestRead(n) for n != 0 { buf, err := s.trReader.Read(n) var bufLen int if buf != nil { bufLen = buf.Len() } n -= bufLen if n == 0 { err = nil } if err != nil { if bufLen > 0 && err == io.EOF { err = io.ErrUnexpectedEOF } data.Free() return nil, err } data = append(data, buf) } return data, nil } // noCopy may be embedded into structs which must not be copied // after the first use. // // See https://golang.org/issues/8005#issuecomment-190753527 // for details. type noCopy struct { } func (*noCopy) Lock() {} func (*noCopy) Unlock() {} // transportReader reads all the data available for this Stream from the transport and // passes them into the decoder, which converts them into a gRPC message stream. // The error is io.EOF when the stream is done or another non-nil error if // the stream broke. type transportReader struct { _ noCopy // The handler to control the window update procedure for both this // particular stream and the associated transport. windowHandler windowHandler er error reader recvBufferReader } // The handler to control the window update procedure for both this // particular stream and the associated transport. type windowHandler interface { updateWindow(int) } func (t *transportReader) ReadMessageHeader(header []byte) (int, error) { n, err := t.reader.ReadMessageHeader(header) if err != nil { t.er = err return 0, err } t.windowHandler.updateWindow(n) return n, nil } func (t *transportReader) Read(n int) (mem.Buffer, error) { buf, err := t.reader.Read(n) if err != nil { t.er = err return buf, err } t.windowHandler.updateWindow(buf.Len()) return buf, nil } // GoString is implemented by Stream so context.String() won't // race when printing %#v. func (s *Stream) GoString() string { return fmt.Sprintf("", s, s.method) } // state of transport type transportState int const ( reachable transportState = iota closing draining ) // ServerConfig consists of all the configurations to establish a server transport. type ServerConfig struct { MaxStreams uint32 ConnectionTimeout time.Duration Credentials credentials.TransportCredentials InTapHandle tap.ServerInHandle StatsHandler stats.Handler KeepaliveParams keepalive.ServerParameters KeepalivePolicy keepalive.EnforcementPolicy InitialWindowSize int32 InitialConnWindowSize int32 WriteBufferSize int ReadBufferSize int SharedWriteBuffer bool ChannelzParent *channelz.Server MaxHeaderListSize *uint32 HeaderTableSize *uint32 BufferPool mem.BufferPool StaticWindowSize bool } // ConnectOptions covers all relevant options for communicating with the server. type ConnectOptions struct { // UserAgent is the application user agent. UserAgent string // Dialer specifies how to dial a network address. Dialer func(context.Context, string) (net.Conn, error) // FailOnNonTempDialError specifies if gRPC fails on non-temporary dial errors. FailOnNonTempDialError bool // PerRPCCredentials stores the PerRPCCredentials required to issue RPCs. PerRPCCredentials []credentials.PerRPCCredentials // TransportCredentials stores the Authenticator required to setup a client // connection. Only one of TransportCredentials and CredsBundle is non-nil. TransportCredentials credentials.TransportCredentials // CredsBundle is the credentials bundle to be used. Only one of // TransportCredentials and CredsBundle is non-nil. CredsBundle credentials.Bundle // KeepaliveParams stores the keepalive parameters. KeepaliveParams keepalive.ClientParameters // StatsHandlers stores the handler for stats. StatsHandlers []stats.Handler // InitialWindowSize sets the initial window size for a stream. InitialWindowSize int32 // InitialConnWindowSize sets the initial window size for a connection. InitialConnWindowSize int32 // WriteBufferSize sets the size of write buffer which in turn determines how much data can be batched before it's written on the wire. WriteBufferSize int // ReadBufferSize sets the size of read buffer, which in turn determines how much data can be read at most for one read syscall. ReadBufferSize int // SharedWriteBuffer indicates whether connections should reuse write buffer SharedWriteBuffer bool // ChannelzParent sets the addrConn id which initiated the creation of this client transport. ChannelzParent *channelz.SubChannel // MaxHeaderListSize sets the max (uncompressed) size of header list that is prepared to be received. MaxHeaderListSize *uint32 // The mem.BufferPool to use when reading/writing to the wire. BufferPool mem.BufferPool // StaticWindowSize controls whether dynamic window sizing is enabled. StaticWindowSize bool } // WriteOptions provides additional hints and information for message // transmission. type WriteOptions struct { // Last indicates whether this write is the last piece for // this stream. Last bool } // CallHdr carries the information of a particular RPC. type CallHdr struct { // Host specifies the peer's host. Host string // Method specifies the operation to perform. Method string // SendCompress specifies the compression algorithm applied on // outbound message. SendCompress string // AcceptedCompressors overrides the grpc-accept-encoding header for this // call. When nil, the transport advertises the default set of registered // compressors. A non-nil pointer overrides that value (including the empty // string to advertise none). AcceptedCompressors *string // Creds specifies credentials.PerRPCCredentials for a call. Creds credentials.PerRPCCredentials // ContentSubtype specifies the content-subtype for a request. For example, a // content-subtype of "proto" will result in a content-type of // "application/grpc+proto". The value of ContentSubtype must be all // lowercase, otherwise the behavior is undefined. See // https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#requests // for more details. ContentSubtype string PreviousAttempts int // value of grpc-previous-rpc-attempts header to set DoneFunc func() // called when the stream is finished // Authority is used to explicitly override the `:authority` header. If set, // this value takes precedence over the Host field and will be used as the // value for the `:authority` header. Authority string } // ClientTransport is the common interface for all gRPC client-side transport // implementations. type ClientTransport interface { // Close tears down this transport. Once it returns, the transport // should not be accessed any more. The caller must make sure this // is called only once. Close(err error) // GracefulClose starts to tear down the transport: the transport will stop // accepting new RPCs and NewStream will return error. Once all streams are // finished, the transport will close. // // It does not block. GracefulClose() // NewStream creates a Stream for an RPC. NewStream(ctx context.Context, callHdr *CallHdr) (*ClientStream, error) // Error returns a channel that is closed when some I/O error // happens. Typically the caller should have a goroutine to monitor // this in order to take action (e.g., close the current transport // and create a new one) in error case. It should not return nil // once the transport is initiated. Error() <-chan struct{} // GoAway returns a channel that is closed when ClientTransport // receives the draining signal from the server (e.g., GOAWAY frame in // HTTP/2). GoAway() <-chan struct{} // GetGoAwayReason returns the reason why GoAway frame was received, along // with a human readable string with debug info. GetGoAwayReason() (GoAwayReason, string) // Peer returns information about the peer associated with the Transport. // The returned information includes authentication and network address details. Peer() *peer.Peer } // ServerTransport is the common interface for all gRPC server-side transport // implementations. // // Methods may be called concurrently from multiple goroutines, but // Write methods for a given Stream will be called serially. type ServerTransport interface { // HandleStreams receives incoming streams using the given handler. HandleStreams(context.Context, func(*ServerStream)) // Close tears down the transport. Once it is called, the transport // should not be accessed any more. All the pending streams and their // handlers will be terminated asynchronously. Close(err error) // Peer returns the peer of the server transport. Peer() *peer.Peer // Drain notifies the client this ServerTransport stops accepting new RPCs. Drain(debugData string) } type internalServerTransport interface { ServerTransport writeHeader(s *ServerStream, md metadata.MD) error write(s *ServerStream, hdr []byte, data mem.BufferSlice, opts *WriteOptions) error writeStatus(s *ServerStream, st *status.Status) error incrMsgRecv() adjustWindow(s *ServerStream, n uint32) updateWindow(s *ServerStream, n uint32) } // connectionErrorf creates an ConnectionError with the specified error description. func connectionErrorf(temp bool, e error, format string, a ...any) ConnectionError { return ConnectionError{ Desc: fmt.Sprintf(format, a...), temp: temp, err: e, } } // ConnectionError is an error that results in the termination of the // entire connection and the retry of all the active streams. type ConnectionError struct { Desc string temp bool err error } func (e ConnectionError) Error() string { return fmt.Sprintf("connection error: desc = %q", e.Desc) } // Temporary indicates if this connection error is temporary or fatal. func (e ConnectionError) Temporary() bool { return e.temp } // Origin returns the original error of this connection error. func (e ConnectionError) Origin() error { // Never return nil error here. // If the original error is nil, return itself. if e.err == nil { return e } return e.err } // Unwrap returns the original error of this connection error or nil when the // origin is nil. func (e ConnectionError) Unwrap() error { return e.err } var ( // ErrConnClosing indicates that the transport is closing. ErrConnClosing = connectionErrorf(true, nil, "transport is closing") // errStreamDrain indicates that the stream is rejected because the // connection is draining. This could be caused by goaway or balancer // removing the address. errStreamDrain = status.Error(codes.Unavailable, "the connection is draining") // errStreamDone is returned from write at the client side to indicate application // layer of an error. errStreamDone = errors.New("the stream is done") // StatusGoAway indicates that the server sent a GOAWAY that included this // stream's ID in unprocessed RPCs. statusGoAway = status.New(codes.Unavailable, "the stream is rejected because server is draining the connection") ) // GoAwayReason contains the reason for the GoAway frame received. type GoAwayReason uint8 const ( // GoAwayInvalid indicates that no GoAway frame is received. GoAwayInvalid GoAwayReason = 0 // GoAwayNoReason is the default value when GoAway frame is received. GoAwayNoReason GoAwayReason = 1 // GoAwayTooManyPings indicates that a GoAway frame with // ErrCodeEnhanceYourCalm was received and that the debug data said // "too_many_pings". GoAwayTooManyPings GoAwayReason = 2 ) // ContextErr converts the error from context package into a status error. func ContextErr(err error) error { switch err { case context.DeadlineExceeded: return status.Error(codes.DeadlineExceeded, err.Error()) case context.Canceled: return status.Error(codes.Canceled, err.Error()) } return status.Errorf(codes.Internal, "Unexpected error from context packet: %v", err) } ================================================ FILE: vendor/google.golang.org/grpc/keepalive/keepalive.go ================================================ /* * * Copyright 2017 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package keepalive defines configurable parameters for point-to-point // healthcheck. package keepalive import ( "time" ) // ClientParameters is used to set keepalive parameters on the client-side. // These configure how the client will actively probe to notice when a // connection is broken and send pings so intermediaries will be aware of the // liveness of the connection. Make sure these parameters are set in // coordination with the keepalive policy on the server, as incompatible // settings can result in closing of connection. type ClientParameters struct { // After a duration of this time if the client doesn't see any activity it // pings the server to see if the transport is still alive. // If set below 10s, a minimum value of 10s will be used instead. // // Note that gRPC servers have a default EnforcementPolicy.MinTime of 5 // minutes (which means the client shouldn't ping more frequently than every // 5 minutes). // // Though not ideal, it's not a strong requirement for Time to be less than // EnforcementPolicy.MinTime. Time will automatically double if the server // disconnects due to its enforcement policy. // // For more details, see // https://github.com/grpc/proposal/blob/master/A8-client-side-keepalive.md Time time.Duration // After having pinged for keepalive check, the client waits for a duration // of Timeout and if no activity is seen even after that the connection is // closed. // // If keepalive is enabled, and this value is not explicitly set, the default // is 20 seconds. Timeout time.Duration // If true, client sends keepalive pings even with no active RPCs. If false, // when there are no active RPCs, Time and Timeout will be ignored and no // keepalive pings will be sent. PermitWithoutStream bool } // ServerParameters is used to set keepalive and max-age parameters on the // server-side. type ServerParameters struct { // MaxConnectionIdle is a duration for the amount of time after which an // idle connection would be closed by sending a GoAway. Idleness duration is // defined since the most recent time the number of outstanding RPCs became // zero or the connection establishment. MaxConnectionIdle time.Duration // The current default value is infinity. // MaxConnectionAge is a duration for the maximum amount of time a // connection may exist before it will be closed by sending a GoAway. A // random jitter of +/-10% will be added to MaxConnectionAge to spread out // connection storms. MaxConnectionAge time.Duration // The current default value is infinity. // MaxConnectionAgeGrace is an additive period after MaxConnectionAge after // which the connection will be forcibly closed. MaxConnectionAgeGrace time.Duration // The current default value is infinity. // After a duration of this time if the server doesn't see any activity it // pings the client to see if the transport is still alive. // If set below 1s, a minimum value of 1s will be used instead. Time time.Duration // The current default value is 2 hours. // After having pinged for keepalive check, the server waits for a duration // of Timeout and if no activity is seen even after that the connection is // closed. Timeout time.Duration // The current default value is 20 seconds. } // EnforcementPolicy is used to set keepalive enforcement policy on the // server-side. Server will close connection with a client that violates this // policy. type EnforcementPolicy struct { // MinTime is the minimum amount of time a client should wait before sending // a keepalive ping. MinTime time.Duration // The current default value is 5 minutes. // If true, server allows keepalive pings even when there are no active // streams(RPCs). If false, and client sends ping when there are no active // streams, server will send GOAWAY and close the connection. PermitWithoutStream bool // false by default. } ================================================ FILE: vendor/google.golang.org/grpc/mem/buffer_pool.go ================================================ /* * * Copyright 2024 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package mem import ( "sort" "sync" "google.golang.org/grpc/internal" ) // BufferPool is a pool of buffers that can be shared and reused, resulting in // decreased memory allocation. type BufferPool interface { // Get returns a buffer with specified length from the pool. Get(length int) *[]byte // Put returns a buffer to the pool. // // The provided pointer must hold a prefix of the buffer obtained via // BufferPool.Get to ensure the buffer's entire capacity can be re-used. Put(*[]byte) } const goPageSize = 4 << 10 // 4KiB. N.B. this must be a power of 2. var defaultBufferPoolSizes = []int{ 256, goPageSize, 16 << 10, // 16KB (max HTTP/2 frame size used by gRPC) 32 << 10, // 32KB (default buffer size for io.Copy) 1 << 20, // 1MB } var defaultBufferPool BufferPool func init() { defaultBufferPool = NewTieredBufferPool(defaultBufferPoolSizes...) internal.SetDefaultBufferPoolForTesting = func(pool BufferPool) { defaultBufferPool = pool } internal.SetBufferPoolingThresholdForTesting = func(threshold int) { bufferPoolingThreshold = threshold } } // DefaultBufferPool returns the current default buffer pool. It is a BufferPool // created with NewBufferPool that uses a set of default sizes optimized for // expected workflows. func DefaultBufferPool() BufferPool { return defaultBufferPool } // NewTieredBufferPool returns a BufferPool implementation that uses multiple // underlying pools of the given pool sizes. func NewTieredBufferPool(poolSizes ...int) BufferPool { sort.Ints(poolSizes) pools := make([]*sizedBufferPool, len(poolSizes)) for i, s := range poolSizes { pools[i] = newSizedBufferPool(s) } return &tieredBufferPool{ sizedPools: pools, } } // tieredBufferPool implements the BufferPool interface with multiple tiers of // buffer pools for different sizes of buffers. type tieredBufferPool struct { sizedPools []*sizedBufferPool fallbackPool simpleBufferPool } func (p *tieredBufferPool) Get(size int) *[]byte { return p.getPool(size).Get(size) } func (p *tieredBufferPool) Put(buf *[]byte) { p.getPool(cap(*buf)).Put(buf) } func (p *tieredBufferPool) getPool(size int) BufferPool { poolIdx := sort.Search(len(p.sizedPools), func(i int) bool { return p.sizedPools[i].defaultSize >= size }) if poolIdx == len(p.sizedPools) { return &p.fallbackPool } return p.sizedPools[poolIdx] } // sizedBufferPool is a BufferPool implementation that is optimized for specific // buffer sizes. For example, HTTP/2 frames within gRPC have a default max size // of 16kb and a sizedBufferPool can be configured to only return buffers with a // capacity of 16kb. Note that however it does not support returning larger // buffers and in fact panics if such a buffer is requested. Because of this, // this BufferPool implementation is not meant to be used on its own and rather // is intended to be embedded in a tieredBufferPool such that Get is only // invoked when the required size is smaller than or equal to defaultSize. type sizedBufferPool struct { pool sync.Pool defaultSize int } func (p *sizedBufferPool) Get(size int) *[]byte { buf, ok := p.pool.Get().(*[]byte) if !ok { buf := make([]byte, size, p.defaultSize) return &buf } b := *buf clear(b[:cap(b)]) *buf = b[:size] return buf } func (p *sizedBufferPool) Put(buf *[]byte) { if cap(*buf) < p.defaultSize { // Ignore buffers that are too small to fit in the pool. Otherwise, when // Get is called it will panic as it tries to index outside the bounds // of the buffer. return } p.pool.Put(buf) } func newSizedBufferPool(size int) *sizedBufferPool { return &sizedBufferPool{ defaultSize: size, } } var _ BufferPool = (*simpleBufferPool)(nil) // simpleBufferPool is an implementation of the BufferPool interface that // attempts to pool buffers with a sync.Pool. When Get is invoked, it tries to // acquire a buffer from the pool but if that buffer is too small, it returns it // to the pool and creates a new one. type simpleBufferPool struct { pool sync.Pool } func (p *simpleBufferPool) Get(size int) *[]byte { bs, ok := p.pool.Get().(*[]byte) if ok && cap(*bs) >= size { clear((*bs)[:cap(*bs)]) *bs = (*bs)[:size] return bs } // A buffer was pulled from the pool, but it is too small. Put it back in // the pool and create one large enough. if ok { p.pool.Put(bs) } // If we're going to allocate, round up to the nearest page. This way if // requests frequently arrive with small variation we don't allocate // repeatedly if we get unlucky and they increase over time. By default we // only allocate here if size > 1MiB. Because goPageSize is a power of 2, we // can round up efficiently. allocSize := (size + goPageSize - 1) & ^(goPageSize - 1) b := make([]byte, size, allocSize) return &b } func (p *simpleBufferPool) Put(buf *[]byte) { p.pool.Put(buf) } var _ BufferPool = NopBufferPool{} // NopBufferPool is a buffer pool that returns new buffers without pooling. type NopBufferPool struct{} // Get returns a buffer with specified length from the pool. func (NopBufferPool) Get(length int) *[]byte { b := make([]byte, length) return &b } // Put returns a buffer to the pool. func (NopBufferPool) Put(*[]byte) { } ================================================ FILE: vendor/google.golang.org/grpc/mem/buffer_slice.go ================================================ /* * * Copyright 2024 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package mem import ( "fmt" "io" ) const ( // 32 KiB is what io.Copy uses. readAllBufSize = 32 * 1024 ) // BufferSlice offers a means to represent data that spans one or more Buffer // instances. A BufferSlice is meant to be immutable after creation, and methods // like Ref create and return copies of the slice. This is why all methods have // value receivers rather than pointer receivers. // // Note that any of the methods that read the underlying buffers such as Ref, // Len or CopyTo etc., will panic if any underlying buffers have already been // freed. It is recommended to not directly interact with any of the underlying // buffers directly, rather such interactions should be mediated through the // various methods on this type. // // By convention, any APIs that return (mem.BufferSlice, error) should reduce // the burden on the caller by never returning a mem.BufferSlice that needs to // be freed if the error is non-nil, unless explicitly stated. type BufferSlice []Buffer // Len returns the sum of the length of all the Buffers in this slice. // // # Warning // // Invoking the built-in len on a BufferSlice will return the number of buffers // in the slice, and *not* the value returned by this function. func (s BufferSlice) Len() int { var length int for _, b := range s { length += b.Len() } return length } // Ref invokes Ref on each buffer in the slice. func (s BufferSlice) Ref() { for _, b := range s { b.Ref() } } // Free invokes Buffer.Free() on each Buffer in the slice. func (s BufferSlice) Free() { for _, b := range s { b.Free() } } // CopyTo copies each of the underlying Buffer's data into the given buffer, // returning the number of bytes copied. Has the same semantics as the copy // builtin in that it will copy as many bytes as it can, stopping when either dst // is full or s runs out of data, returning the minimum of s.Len() and len(dst). func (s BufferSlice) CopyTo(dst []byte) int { off := 0 for _, b := range s { off += copy(dst[off:], b.ReadOnlyData()) } return off } // Materialize concatenates all the underlying Buffer's data into a single // contiguous buffer using CopyTo. func (s BufferSlice) Materialize() []byte { l := s.Len() if l == 0 { return nil } out := make([]byte, l) s.CopyTo(out) return out } // MaterializeToBuffer functions like Materialize except that it writes the data // to a single Buffer pulled from the given BufferPool. // // As a special case, if the input BufferSlice only actually has one Buffer, this // function simply increases the refcount before returning said Buffer. Freeing this // buffer won't release it until the BufferSlice is itself released. func (s BufferSlice) MaterializeToBuffer(pool BufferPool) Buffer { if len(s) == 1 { s[0].Ref() return s[0] } sLen := s.Len() if sLen == 0 { return emptyBuffer{} } buf := pool.Get(sLen) s.CopyTo(*buf) return NewBuffer(buf, pool) } // Reader returns a new Reader for the input slice after taking references to // each underlying buffer. func (s BufferSlice) Reader() *Reader { s.Ref() return &Reader{ data: s, len: s.Len(), } } // Reader exposes a BufferSlice's data as an io.Reader, allowing it to interface // with other systems. // // Buffers will be freed as they are read. // // A Reader can be constructed from a BufferSlice; alternatively the zero value // of a Reader may be used after calling Reset on it. type Reader struct { data BufferSlice len int // The index into data[0].ReadOnlyData(). bufferIdx int } // Remaining returns the number of unread bytes remaining in the slice. func (r *Reader) Remaining() int { return r.len } // Reset frees the currently held buffer slice and starts reading from the // provided slice. This allows reusing the reader object. func (r *Reader) Reset(s BufferSlice) { r.data.Free() s.Ref() r.data = s r.len = s.Len() r.bufferIdx = 0 } // Close frees the underlying BufferSlice and never returns an error. Subsequent // calls to Read will return (0, io.EOF). func (r *Reader) Close() error { r.data.Free() r.data = nil r.len = 0 return nil } func (r *Reader) freeFirstBufferIfEmpty() bool { if len(r.data) == 0 || r.bufferIdx != len(r.data[0].ReadOnlyData()) { return false } r.data[0].Free() r.data = r.data[1:] r.bufferIdx = 0 return true } func (r *Reader) Read(buf []byte) (n int, _ error) { if r.len == 0 { return 0, io.EOF } for len(buf) != 0 && r.len != 0 { // Copy as much as possible from the first Buffer in the slice into the // given byte slice. data := r.data[0].ReadOnlyData() copied := copy(buf, data[r.bufferIdx:]) r.len -= copied // Reduce len by the number of bytes copied. r.bufferIdx += copied // Increment the buffer index. n += copied // Increment the total number of bytes read. buf = buf[copied:] // Shrink the given byte slice. // If we have copied all the data from the first Buffer, free it and advance to // the next in the slice. r.freeFirstBufferIfEmpty() } return n, nil } // ReadByte reads a single byte. func (r *Reader) ReadByte() (byte, error) { if r.len == 0 { return 0, io.EOF } // There may be any number of empty buffers in the slice, clear them all until a // non-empty buffer is reached. This is guaranteed to exit since r.len is not 0. for r.freeFirstBufferIfEmpty() { } b := r.data[0].ReadOnlyData()[r.bufferIdx] r.len-- r.bufferIdx++ // Free the first buffer in the slice if the last byte was read r.freeFirstBufferIfEmpty() return b, nil } var _ io.Writer = (*writer)(nil) type writer struct { buffers *BufferSlice pool BufferPool } func (w *writer) Write(p []byte) (n int, err error) { b := Copy(p, w.pool) *w.buffers = append(*w.buffers, b) return b.Len(), nil } // NewWriter wraps the given BufferSlice and BufferPool to implement the // io.Writer interface. Every call to Write copies the contents of the given // buffer into a new Buffer pulled from the given pool and the Buffer is // added to the given BufferSlice. func NewWriter(buffers *BufferSlice, pool BufferPool) io.Writer { return &writer{buffers: buffers, pool: pool} } // ReadAll reads from r until an error or EOF and returns the data it read. // A successful call returns err == nil, not err == EOF. Because ReadAll is // defined to read from src until EOF, it does not treat an EOF from Read // as an error to be reported. // // Important: A failed call returns a non-nil error and may also return // partially read buffers. It is the responsibility of the caller to free the // BufferSlice returned, or its memory will not be reused. func ReadAll(r io.Reader, pool BufferPool) (BufferSlice, error) { var result BufferSlice if wt, ok := r.(io.WriterTo); ok { // This is more optimal since wt knows the size of chunks it wants to // write and, hence, we can allocate buffers of an optimal size to fit // them. E.g. might be a single big chunk, and we wouldn't chop it // into pieces. w := NewWriter(&result, pool) _, err := wt.WriteTo(w) return result, err } nextBuffer: for { buf := pool.Get(readAllBufSize) // We asked for 32KiB but may have been given a bigger buffer. // Use all of it if that's the case. *buf = (*buf)[:cap(*buf)] usedCap := 0 for { n, err := r.Read((*buf)[usedCap:]) usedCap += n if err != nil { if usedCap == 0 { // Nothing in this buf, put it back pool.Put(buf) } else { *buf = (*buf)[:usedCap] result = append(result, NewBuffer(buf, pool)) } if err == io.EOF { err = nil } return result, err } if len(*buf) == usedCap { result = append(result, NewBuffer(buf, pool)) continue nextBuffer } } } } // Discard skips the next n bytes, returning the number of bytes discarded. // // It frees buffers as they are fully consumed. // // If Discard skips fewer than n bytes, it also returns an error. func (r *Reader) Discard(n int) (discarded int, err error) { total := n for n > 0 && r.len > 0 { curData := r.data[0].ReadOnlyData() curSize := min(n, len(curData)-r.bufferIdx) n -= curSize r.len -= curSize r.bufferIdx += curSize if r.bufferIdx >= len(curData) { r.data[0].Free() r.data = r.data[1:] r.bufferIdx = 0 } } discarded = total - n if n > 0 { return discarded, fmt.Errorf("insufficient bytes in reader") } return discarded, nil } // Peek returns the next n bytes without advancing the reader. // // Peek appends results to the provided res slice and returns the updated slice. // This pattern allows re-using the storage of res if it has sufficient // capacity. // // The returned subslices are views into the underlying buffers and are only // valid until the reader is advanced past the corresponding buffer. // // If Peek returns fewer than n bytes, it also returns an error. func (r *Reader) Peek(n int, res [][]byte) ([][]byte, error) { for i := 0; n > 0 && i < len(r.data); i++ { curData := r.data[i].ReadOnlyData() start := 0 if i == 0 { start = r.bufferIdx } curSize := min(n, len(curData)-start) if curSize == 0 { continue } res = append(res, curData[start:start+curSize]) n -= curSize } if n > 0 { return nil, fmt.Errorf("insufficient bytes in reader") } return res, nil } ================================================ FILE: vendor/google.golang.org/grpc/mem/buffers.go ================================================ /* * * Copyright 2024 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package mem provides utilities that facilitate memory reuse in byte slices // that are used as buffers. // // # Experimental // // Notice: All APIs in this package are EXPERIMENTAL and may be changed or // removed in a later release. package mem import ( "fmt" "sync" "sync/atomic" ) // A Buffer represents a reference counted piece of data (in bytes) that can be // acquired by a call to NewBuffer() or Copy(). A reference to a Buffer may be // released by calling Free(), which invokes the free function given at creation // only after all references are released. // // Note that a Buffer is not safe for concurrent access and instead each // goroutine should use its own reference to the data, which can be acquired via // a call to Ref(). // // Attempts to access the underlying data after releasing the reference to the // Buffer will panic. type Buffer interface { // ReadOnlyData returns the underlying byte slice. Note that it is undefined // behavior to modify the contents of this slice in any way. ReadOnlyData() []byte // Ref increases the reference counter for this Buffer. Ref() // Free decrements this Buffer's reference counter and frees the underlying // byte slice if the counter reaches 0 as a result of this call. Free() // Len returns the Buffer's size. Len() int split(n int) (left, right Buffer) read(buf []byte) (int, Buffer) } var ( bufferPoolingThreshold = 1 << 10 bufferObjectPool = sync.Pool{New: func() any { return new(buffer) }} refObjectPool = sync.Pool{New: func() any { return new(atomic.Int32) }} ) // IsBelowBufferPoolingThreshold returns true if the given size is less than or // equal to the threshold for buffer pooling. This is used to determine whether // to pool buffers or allocate them directly. func IsBelowBufferPoolingThreshold(size int) bool { return size <= bufferPoolingThreshold } type buffer struct { origData *[]byte data []byte refs *atomic.Int32 pool BufferPool } func newBuffer() *buffer { return bufferObjectPool.Get().(*buffer) } // NewBuffer creates a new Buffer from the given data, initializing the reference // counter to 1. The data will then be returned to the given pool when all // references to the returned Buffer are released. As a special case to avoid // additional allocations, if the given buffer pool is nil, the returned buffer // will be a "no-op" Buffer where invoking Buffer.Free() does nothing and the // underlying data is never freed. // // Note that the backing array of the given data is not copied. func NewBuffer(data *[]byte, pool BufferPool) Buffer { // Use the buffer's capacity instead of the length, otherwise buffers may // not be reused under certain conditions. For example, if a large buffer // is acquired from the pool, but fewer bytes than the buffering threshold // are written to it, the buffer will not be returned to the pool. if pool == nil || IsBelowBufferPoolingThreshold(cap(*data)) { return (SliceBuffer)(*data) } b := newBuffer() b.origData = data b.data = *data b.pool = pool b.refs = refObjectPool.Get().(*atomic.Int32) b.refs.Add(1) return b } // Copy creates a new Buffer from the given data, initializing the reference // counter to 1. // // It acquires a []byte from the given pool and copies over the backing array // of the given data. The []byte acquired from the pool is returned to the // pool when all references to the returned Buffer are released. func Copy(data []byte, pool BufferPool) Buffer { if IsBelowBufferPoolingThreshold(len(data)) { buf := make(SliceBuffer, len(data)) copy(buf, data) return buf } buf := pool.Get(len(data)) copy(*buf, data) return NewBuffer(buf, pool) } func (b *buffer) ReadOnlyData() []byte { if b.refs == nil { panic("Cannot read freed buffer") } return b.data } func (b *buffer) Ref() { if b.refs == nil { panic("Cannot ref freed buffer") } b.refs.Add(1) } func (b *buffer) Free() { if b.refs == nil { panic("Cannot free freed buffer") } refs := b.refs.Add(-1) switch { case refs > 0: return case refs == 0: if b.pool != nil { b.pool.Put(b.origData) } refObjectPool.Put(b.refs) b.origData = nil b.data = nil b.refs = nil b.pool = nil bufferObjectPool.Put(b) default: panic("Cannot free freed buffer") } } func (b *buffer) Len() int { return len(b.ReadOnlyData()) } func (b *buffer) split(n int) (Buffer, Buffer) { if b.refs == nil { panic("Cannot split freed buffer") } b.refs.Add(1) split := newBuffer() split.origData = b.origData split.data = b.data[n:] split.refs = b.refs split.pool = b.pool b.data = b.data[:n] return b, split } func (b *buffer) read(buf []byte) (int, Buffer) { if b.refs == nil { panic("Cannot read freed buffer") } n := copy(buf, b.data) if n == len(b.data) { b.Free() return n, nil } b.data = b.data[n:] return n, b } func (b *buffer) String() string { return fmt.Sprintf("mem.Buffer(%p, data: %p, length: %d)", b, b.ReadOnlyData(), len(b.ReadOnlyData())) } // ReadUnsafe reads bytes from the given Buffer into the provided slice. // It does not perform safety checks. func ReadUnsafe(dst []byte, buf Buffer) (int, Buffer) { return buf.read(dst) } // SplitUnsafe modifies the receiver to point to the first n bytes while it // returns a new reference to the remaining bytes. The returned Buffer // functions just like a normal reference acquired using Ref(). func SplitUnsafe(buf Buffer, n int) (left, right Buffer) { return buf.split(n) } type emptyBuffer struct{} func (e emptyBuffer) ReadOnlyData() []byte { return nil } func (e emptyBuffer) Ref() {} func (e emptyBuffer) Free() {} func (e emptyBuffer) Len() int { return 0 } func (e emptyBuffer) split(int) (left, right Buffer) { return e, e } func (e emptyBuffer) read([]byte) (int, Buffer) { return 0, e } // SliceBuffer is a Buffer implementation that wraps a byte slice. It provides // methods for reading, splitting, and managing the byte slice. type SliceBuffer []byte // ReadOnlyData returns the byte slice. func (s SliceBuffer) ReadOnlyData() []byte { return s } // Ref is a noop implementation of Ref. func (s SliceBuffer) Ref() {} // Free is a noop implementation of Free. func (s SliceBuffer) Free() {} // Len is a noop implementation of Len. func (s SliceBuffer) Len() int { return len(s) } func (s SliceBuffer) split(n int) (left, right Buffer) { return s[:n], s[n:] } func (s SliceBuffer) read(buf []byte) (int, Buffer) { n := copy(buf, s) if n == len(s) { return n, nil } return n, s[n:] } ================================================ FILE: vendor/google.golang.org/grpc/metadata/metadata.go ================================================ /* * * Copyright 2014 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package metadata define the structure of the metadata supported by gRPC library. // Please refer to https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md // for more information about custom-metadata. package metadata // import "google.golang.org/grpc/metadata" import ( "context" "fmt" "strings" "google.golang.org/grpc/internal" ) func init() { internal.FromOutgoingContextRaw = fromOutgoingContextRaw } // DecodeKeyValue returns k, v, nil. // // Deprecated: use k and v directly instead. func DecodeKeyValue(k, v string) (string, string, error) { return k, v, nil } // MD is a mapping from metadata keys to values. Users should use the following // two convenience functions New and Pairs to generate MD. type MD map[string][]string // New creates an MD from a given key-value map. // // Only the following ASCII characters are allowed in keys: // - digits: 0-9 // - uppercase letters: A-Z (normalized to lower) // - lowercase letters: a-z // - special characters: -_. // // Uppercase letters are automatically converted to lowercase. // // Keys beginning with "grpc-" are reserved for grpc-internal use only and may // result in errors if set in metadata. func New(m map[string]string) MD { md := make(MD, len(m)) for k, val := range m { key := strings.ToLower(k) md[key] = append(md[key], val) } return md } // Pairs returns an MD formed by the mapping of key, value ... // Pairs panics if len(kv) is odd. // // Only the following ASCII characters are allowed in keys: // - digits: 0-9 // - uppercase letters: A-Z (normalized to lower) // - lowercase letters: a-z // - special characters: -_. // // Uppercase letters are automatically converted to lowercase. // // Keys beginning with "grpc-" are reserved for grpc-internal use only and may // result in errors if set in metadata. func Pairs(kv ...string) MD { if len(kv)%2 == 1 { panic(fmt.Sprintf("metadata: Pairs got the odd number of input pairs for metadata: %d", len(kv))) } md := make(MD, len(kv)/2) for i := 0; i < len(kv); i += 2 { key := strings.ToLower(kv[i]) md[key] = append(md[key], kv[i+1]) } return md } // Len returns the number of items in md. func (md MD) Len() int { return len(md) } // Copy returns a copy of md. func (md MD) Copy() MD { out := make(MD, len(md)) for k, v := range md { out[k] = copyOf(v) } return out } // Get obtains the values for a given key. // // k is converted to lowercase before searching in md. func (md MD) Get(k string) []string { k = strings.ToLower(k) return md[k] } // Set sets the value of a given key with a slice of values. // // k is converted to lowercase before storing in md. func (md MD) Set(k string, vals ...string) { if len(vals) == 0 { return } k = strings.ToLower(k) md[k] = vals } // Append adds the values to key k, not overwriting what was already stored at // that key. // // k is converted to lowercase before storing in md. func (md MD) Append(k string, vals ...string) { if len(vals) == 0 { return } k = strings.ToLower(k) md[k] = append(md[k], vals...) } // Delete removes the values for a given key k which is converted to lowercase // before removing it from md. func (md MD) Delete(k string) { k = strings.ToLower(k) delete(md, k) } // Join joins any number of mds into a single MD. // // The order of values for each key is determined by the order in which the mds // containing those values are presented to Join. func Join(mds ...MD) MD { out := MD{} for _, md := range mds { for k, v := range md { out[k] = append(out[k], v...) } } return out } type mdIncomingKey struct{} type mdOutgoingKey struct{} // NewIncomingContext creates a new context with incoming md attached. md must // not be modified after calling this function. func NewIncomingContext(ctx context.Context, md MD) context.Context { return context.WithValue(ctx, mdIncomingKey{}, md) } // NewOutgoingContext creates a new context with outgoing md attached. If used // in conjunction with AppendToOutgoingContext, NewOutgoingContext will // overwrite any previously-appended metadata. md must not be modified after // calling this function. func NewOutgoingContext(ctx context.Context, md MD) context.Context { return context.WithValue(ctx, mdOutgoingKey{}, rawMD{md: md}) } // AppendToOutgoingContext returns a new context with the provided kv merged // with any existing metadata in the context. Please refer to the documentation // of Pairs for a description of kv. func AppendToOutgoingContext(ctx context.Context, kv ...string) context.Context { if len(kv)%2 == 1 { panic(fmt.Sprintf("metadata: AppendToOutgoingContext got an odd number of input pairs for metadata: %d", len(kv))) } md, _ := ctx.Value(mdOutgoingKey{}).(rawMD) added := make([][]string, len(md.added)+1) copy(added, md.added) kvCopy := make([]string, 0, len(kv)) for i := 0; i < len(kv); i += 2 { kvCopy = append(kvCopy, strings.ToLower(kv[i]), kv[i+1]) } added[len(added)-1] = kvCopy return context.WithValue(ctx, mdOutgoingKey{}, rawMD{md: md.md, added: added}) } // FromIncomingContext returns the incoming metadata in ctx if it exists. // // All keys in the returned MD are lowercase. func FromIncomingContext(ctx context.Context) (MD, bool) { md, ok := ctx.Value(mdIncomingKey{}).(MD) if !ok { return nil, false } out := make(MD, len(md)) for k, v := range md { // We need to manually convert all keys to lower case, because MD is a // map, and there's no guarantee that the MD attached to the context is // created using our helper functions. key := strings.ToLower(k) out[key] = copyOf(v) } return out, true } // ValueFromIncomingContext returns the metadata value corresponding to the metadata // key from the incoming metadata if it exists. Keys are matched in a case insensitive // manner. func ValueFromIncomingContext(ctx context.Context, key string) []string { md, ok := ctx.Value(mdIncomingKey{}).(MD) if !ok { return nil } if v, ok := md[key]; ok { return copyOf(v) } for k, v := range md { // Case insensitive comparison: MD is a map, and there's no guarantee // that the MD attached to the context is created using our helper // functions. if strings.EqualFold(k, key) { return copyOf(v) } } return nil } func copyOf(v []string) []string { vals := make([]string, len(v)) copy(vals, v) return vals } // fromOutgoingContextRaw returns the un-merged, intermediary contents of rawMD. // // Remember to perform strings.ToLower on the keys, for both the returned MD (MD // is a map, there's no guarantee it's created using our helper functions) and // the extra kv pairs (AppendToOutgoingContext doesn't turn them into // lowercase). func fromOutgoingContextRaw(ctx context.Context) (MD, [][]string, bool) { raw, ok := ctx.Value(mdOutgoingKey{}).(rawMD) if !ok { return nil, nil, false } return raw.md, raw.added, true } // FromOutgoingContext returns the outgoing metadata in ctx if it exists. // // All keys in the returned MD are lowercase. func FromOutgoingContext(ctx context.Context) (MD, bool) { raw, ok := ctx.Value(mdOutgoingKey{}).(rawMD) if !ok { return nil, false } mdSize := len(raw.md) for i := range raw.added { mdSize += len(raw.added[i]) / 2 } out := make(MD, mdSize) for k, v := range raw.md { // We need to manually convert all keys to lower case, because MD is a // map, and there's no guarantee that the MD attached to the context is // created using our helper functions. key := strings.ToLower(k) out[key] = copyOf(v) } for _, added := range raw.added { if len(added)%2 == 1 { panic(fmt.Sprintf("metadata: FromOutgoingContext got an odd number of input pairs for metadata: %d", len(added))) } for i := 0; i < len(added); i += 2 { key := strings.ToLower(added[i]) out[key] = append(out[key], added[i+1]) } } return out, ok } type rawMD struct { md MD added [][]string } ================================================ FILE: vendor/google.golang.org/grpc/peer/peer.go ================================================ /* * * Copyright 2014 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package peer defines various peer information associated with RPCs and // corresponding utils. package peer import ( "context" "fmt" "net" "strings" "google.golang.org/grpc/credentials" ) // Peer contains the information of the peer for an RPC, such as the address // and authentication information. type Peer struct { // Addr is the peer address. Addr net.Addr // LocalAddr is the local address. LocalAddr net.Addr // AuthInfo is the authentication information of the transport. // It is nil if there is no transport security being used. AuthInfo credentials.AuthInfo } // String ensures the Peer types implements the Stringer interface in order to // allow to print a context with a peerKey value effectively. func (p *Peer) String() string { if p == nil { return "Peer" } sb := &strings.Builder{} sb.WriteString("Peer{") if p.Addr != nil { fmt.Fprintf(sb, "Addr: '%s', ", p.Addr.String()) } else { fmt.Fprintf(sb, "Addr: , ") } if p.LocalAddr != nil { fmt.Fprintf(sb, "LocalAddr: '%s', ", p.LocalAddr.String()) } else { fmt.Fprintf(sb, "LocalAddr: , ") } if p.AuthInfo != nil { fmt.Fprintf(sb, "AuthInfo: '%s'", p.AuthInfo.AuthType()) } else { fmt.Fprintf(sb, "AuthInfo: ") } sb.WriteString("}") return sb.String() } type peerKey struct{} // NewContext creates a new context with peer information attached. func NewContext(ctx context.Context, p *Peer) context.Context { return context.WithValue(ctx, peerKey{}, p) } // FromContext returns the peer information in ctx if it exists. func FromContext(ctx context.Context) (p *Peer, ok bool) { p, ok = ctx.Value(peerKey{}).(*Peer) return } ================================================ FILE: vendor/google.golang.org/grpc/picker_wrapper.go ================================================ /* * * Copyright 2017 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package grpc import ( "context" "fmt" "io" "sync/atomic" "google.golang.org/grpc/balancer" "google.golang.org/grpc/codes" "google.golang.org/grpc/internal/channelz" istatus "google.golang.org/grpc/internal/status" "google.golang.org/grpc/internal/transport" "google.golang.org/grpc/status" ) // pickerGeneration stores a picker and a channel used to signal that a picker // newer than this one is available. type pickerGeneration struct { // picker is the picker produced by the LB policy. May be nil if a picker // has never been produced. picker balancer.Picker // blockingCh is closed when the picker has been invalidated because there // is a new one available. blockingCh chan struct{} } // pickerWrapper is a wrapper of balancer.Picker. It blocks on certain pick // actions and unblock when there's a picker update. type pickerWrapper struct { // If pickerGen holds a nil pointer, the pickerWrapper is closed. pickerGen atomic.Pointer[pickerGeneration] } func newPickerWrapper() *pickerWrapper { pw := &pickerWrapper{} pw.pickerGen.Store(&pickerGeneration{ blockingCh: make(chan struct{}), }) return pw } // updatePicker is called by UpdateState calls from the LB policy. It // unblocks all blocked pick. func (pw *pickerWrapper) updatePicker(p balancer.Picker) { old := pw.pickerGen.Swap(&pickerGeneration{ picker: p, blockingCh: make(chan struct{}), }) close(old.blockingCh) } // doneChannelzWrapper performs the following: // - increments the calls started channelz counter // - wraps the done function in the passed in result to increment the calls // failed or calls succeeded channelz counter before invoking the actual // done function. func doneChannelzWrapper(acbw *acBalancerWrapper, result *balancer.PickResult) { ac := acbw.ac ac.incrCallsStarted() done := result.Done result.Done = func(b balancer.DoneInfo) { if b.Err != nil && b.Err != io.EOF { ac.incrCallsFailed() } else { ac.incrCallsSucceeded() } if done != nil { done(b) } } } type pick struct { transport transport.ClientTransport // the selected transport result balancer.PickResult // the contents of the pick from the LB policy blocked bool // set if a picker call queued for a new picker } // pick returns the transport that will be used for the RPC. // It may block in the following cases: // - there's no picker // - the current picker returns ErrNoSubConnAvailable // - the current picker returns other errors and failfast is false. // - the subConn returned by the current picker is not READY // When one of these situations happens, pick blocks until the picker gets updated. func (pw *pickerWrapper) pick(ctx context.Context, failfast bool, info balancer.PickInfo) (pick, error) { var ch chan struct{} var lastPickErr error pickBlocked := false for { pg := pw.pickerGen.Load() if pg == nil { return pick{}, ErrClientConnClosing } if pg.picker == nil { ch = pg.blockingCh } if ch == pg.blockingCh { // This could happen when either: // - pw.picker is nil (the previous if condition), or // - we have already called pick on the current picker. select { case <-ctx.Done(): var errStr string if lastPickErr != nil { errStr = "latest balancer error: " + lastPickErr.Error() } else { errStr = fmt.Sprintf("%v while waiting for connections to become ready", ctx.Err()) } switch ctx.Err() { case context.DeadlineExceeded: return pick{}, status.Error(codes.DeadlineExceeded, errStr) case context.Canceled: return pick{}, status.Error(codes.Canceled, errStr) } case <-ch: } continue } // If the channel is set, it means that the pick call had to wait for a // new picker at some point. Either it's the first iteration and this // function received the first picker, or a picker errored with // ErrNoSubConnAvailable or errored with failfast set to false, which // will trigger a continue to the next iteration. In the first case this // conditional will hit if this call had to block (the channel is set). // In the second case, the only way it will get to this conditional is // if there is a new picker. if ch != nil { pickBlocked = true } ch = pg.blockingCh p := pg.picker pickResult, err := p.Pick(info) if err != nil { if err == balancer.ErrNoSubConnAvailable { continue } if st, ok := status.FromError(err); ok { // Status error: end the RPC unconditionally with this status. // First restrict the code to the list allowed by gRFC A54. if istatus.IsRestrictedControlPlaneCode(st) { err = status.Errorf(codes.Internal, "received picker error with illegal status: %v", err) } return pick{}, dropError{error: err} } // For all other errors, wait for ready RPCs should block and other // RPCs should fail with unavailable. if !failfast { lastPickErr = err continue } return pick{}, status.Error(codes.Unavailable, err.Error()) } acbw, ok := pickResult.SubConn.(*acBalancerWrapper) if !ok { logger.Errorf("subconn returned from pick is type %T, not *acBalancerWrapper", pickResult.SubConn) continue } if t := acbw.ac.getReadyTransport(); t != nil { if channelz.IsOn() { doneChannelzWrapper(acbw, &pickResult) } return pick{transport: t, result: pickResult, blocked: pickBlocked}, nil } if pickResult.Done != nil { // Calling done with nil error, no bytes sent and no bytes received. // DoneInfo with default value works. pickResult.Done(balancer.DoneInfo{}) } logger.Infof("blockingPicker: the picked transport is not ready, loop back to repick") // If ok == false, ac.state is not READY. // A valid picker always returns READY subConn. This means the state of ac // just changed, and picker will be updated shortly. // continue back to the beginning of the for loop to repick. } } func (pw *pickerWrapper) close() { old := pw.pickerGen.Swap(nil) close(old.blockingCh) } // reset clears the pickerWrapper and prepares it for being used again when idle // mode is exited. func (pw *pickerWrapper) reset() { old := pw.pickerGen.Swap(&pickerGeneration{blockingCh: make(chan struct{})}) close(old.blockingCh) } // dropError is a wrapper error that indicates the LB policy wishes to drop the // RPC and not retry it. type dropError struct { error } ================================================ FILE: vendor/google.golang.org/grpc/preloader.go ================================================ /* * * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package grpc import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/mem" "google.golang.org/grpc/status" ) // PreparedMsg is responsible for creating a Marshalled and Compressed object. // // # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. type PreparedMsg struct { // Struct for preparing msg before sending them encodedData mem.BufferSlice hdr []byte payload mem.BufferSlice pf payloadFormat } // Encode marshalls and compresses the message using the codec and compressor for the stream. func (p *PreparedMsg) Encode(s Stream, msg any) error { ctx := s.Context() rpcInfo, ok := rpcInfoFromContext(ctx) if !ok { return status.Errorf(codes.Internal, "grpc: unable to get rpcInfo") } // check if the context has the relevant information to prepareMsg if rpcInfo.preloaderInfo.codec == nil { return status.Errorf(codes.Internal, "grpc: rpcInfo.preloaderInfo.codec is nil") } // prepare the msg data, err := encode(rpcInfo.preloaderInfo.codec, msg) if err != nil { return err } materializedData := data.Materialize() data.Free() p.encodedData = mem.BufferSlice{mem.SliceBuffer(materializedData)} // TODO: it should be possible to grab the bufferPool from the underlying // stream implementation with a type cast to its actual type (such as // addrConnStream) and accessing the buffer pool directly. var compData mem.BufferSlice compData, p.pf, err = compress(p.encodedData, rpcInfo.preloaderInfo.cp, rpcInfo.preloaderInfo.comp, mem.DefaultBufferPool()) if err != nil { return err } if p.pf.isCompressed() { materializedCompData := compData.Materialize() compData.Free() compData = mem.BufferSlice{mem.SliceBuffer(materializedCompData)} } p.hdr, p.payload = msgHeader(p.encodedData, compData, p.pf) return nil } ================================================ FILE: vendor/google.golang.org/grpc/resolver/dns/dns_resolver.go ================================================ /* * * Copyright 2018 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package dns implements a dns resolver to be installed as the default resolver // in grpc. package dns import ( "time" "google.golang.org/grpc/internal/resolver/dns" "google.golang.org/grpc/resolver" ) // SetResolvingTimeout sets the maximum duration for DNS resolution requests. // // This function affects the global timeout used by all channels using the DNS // name resolver scheme. // // It must be called only at application startup, before any gRPC calls are // made. Modifying this value after initialization is not thread-safe. // // The default value is 30 seconds. Setting the timeout too low may result in // premature timeouts during resolution, while setting it too high may lead to // unnecessary delays in service discovery. Choose a value appropriate for your // specific needs and network environment. func SetResolvingTimeout(timeout time.Duration) { dns.ResolvingTimeout = timeout } // NewBuilder creates a dnsBuilder which is used to factory DNS resolvers. // // Deprecated: import grpc and use resolver.Get("dns") instead. func NewBuilder() resolver.Builder { return dns.NewBuilder() } // SetMinResolutionInterval sets the default minimum interval at which DNS // re-resolutions are allowed. This helps to prevent excessive re-resolution. // // It must be called only at application startup, before any gRPC calls are // made. Modifying this value after initialization is not thread-safe. func SetMinResolutionInterval(d time.Duration) { dns.MinResolutionInterval = d } ================================================ FILE: vendor/google.golang.org/grpc/resolver/map.go ================================================ /* * * Copyright 2021 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package resolver import ( "encoding/base64" "sort" "strings" ) type addressMapEntry[T any] struct { addr Address value T } // AddressMap is an AddressMapV2[any]. It will be deleted in an upcoming // release of grpc-go. // // Deprecated: use the generic AddressMapV2 type instead. type AddressMap = AddressMapV2[any] // AddressMapV2 is a map of addresses to arbitrary values taking into account // Attributes. BalancerAttributes are ignored, as are Metadata and Type. // Multiple accesses may not be performed concurrently. Must be created via // NewAddressMap; do not construct directly. type AddressMapV2[T any] struct { // The underlying map is keyed by an Address with fields that we don't care // about being set to their zero values. The only fields that we care about // are `Addr`, `ServerName` and `Attributes`. Since we need to be able to // distinguish between addresses with same `Addr` and `ServerName`, but // different `Attributes`, we cannot store the `Attributes` in the map key. // // The comparison operation for structs work as follows: // Struct values are comparable if all their fields are comparable. Two // struct values are equal if their corresponding non-blank fields are equal. // // The value type of the map contains a slice of addresses which match the key // in their `Addr` and `ServerName` fields and contain the corresponding value // associated with them. m map[Address]addressMapEntryList[T] } func toMapKey(addr *Address) Address { return Address{Addr: addr.Addr, ServerName: addr.ServerName} } type addressMapEntryList[T any] []*addressMapEntry[T] // NewAddressMap creates a new AddressMapV2[any]. // // Deprecated: use the generic NewAddressMapV2 constructor instead. func NewAddressMap() *AddressMap { return NewAddressMapV2[any]() } // NewAddressMapV2 creates a new AddressMapV2. func NewAddressMapV2[T any]() *AddressMapV2[T] { return &AddressMapV2[T]{m: make(map[Address]addressMapEntryList[T])} } // find returns the index of addr in the addressMapEntry slice, or -1 if not // present. func (l addressMapEntryList[T]) find(addr Address) int { for i, entry := range l { // Attributes are the only thing to match on here, since `Addr` and // `ServerName` are already equal. if entry.addr.Attributes.Equal(addr.Attributes) { return i } } return -1 } // Get returns the value for the address in the map, if present. func (a *AddressMapV2[T]) Get(addr Address) (value T, ok bool) { addrKey := toMapKey(&addr) entryList := a.m[addrKey] if entry := entryList.find(addr); entry != -1 { return entryList[entry].value, true } return value, false } // Set updates or adds the value to the address in the map. func (a *AddressMapV2[T]) Set(addr Address, value T) { addrKey := toMapKey(&addr) entryList := a.m[addrKey] if entry := entryList.find(addr); entry != -1 { entryList[entry].value = value return } a.m[addrKey] = append(entryList, &addressMapEntry[T]{addr: addr, value: value}) } // Delete removes addr from the map. func (a *AddressMapV2[T]) Delete(addr Address) { addrKey := toMapKey(&addr) entryList := a.m[addrKey] entry := entryList.find(addr) if entry == -1 { return } if len(entryList) == 1 { entryList = nil } else { copy(entryList[entry:], entryList[entry+1:]) entryList = entryList[:len(entryList)-1] } a.m[addrKey] = entryList } // Len returns the number of entries in the map. func (a *AddressMapV2[T]) Len() int { ret := 0 for _, entryList := range a.m { ret += len(entryList) } return ret } // Keys returns a slice of all current map keys. func (a *AddressMapV2[T]) Keys() []Address { ret := make([]Address, 0, a.Len()) for _, entryList := range a.m { for _, entry := range entryList { ret = append(ret, entry.addr) } } return ret } // Values returns a slice of all current map values. func (a *AddressMapV2[T]) Values() []T { ret := make([]T, 0, a.Len()) for _, entryList := range a.m { for _, entry := range entryList { ret = append(ret, entry.value) } } return ret } type endpointMapKey string // EndpointMap is a map of endpoints to arbitrary values keyed on only the // unordered set of address strings within an endpoint. This map is not thread // safe, thus it is unsafe to access concurrently. Must be created via // NewEndpointMap; do not construct directly. type EndpointMap[T any] struct { endpoints map[endpointMapKey]endpointData[T] } type endpointData[T any] struct { // decodedKey stores the original key to avoid decoding when iterating on // EndpointMap keys. decodedKey Endpoint value T } // NewEndpointMap creates a new EndpointMap. func NewEndpointMap[T any]() *EndpointMap[T] { return &EndpointMap[T]{ endpoints: make(map[endpointMapKey]endpointData[T]), } } // encodeEndpoint returns a string that uniquely identifies the unordered set of // addresses within an endpoint. func encodeEndpoint(e Endpoint) endpointMapKey { addrs := make([]string, 0, len(e.Addresses)) // base64 encoding the address strings restricts the characters present // within the strings. This allows us to use a delimiter without the need of // escape characters. for _, addr := range e.Addresses { addrs = append(addrs, base64.StdEncoding.EncodeToString([]byte(addr.Addr))) } sort.Strings(addrs) // " " should not appear in base64 encoded strings. return endpointMapKey(strings.Join(addrs, " ")) } // Get returns the value for the address in the map, if present. func (em *EndpointMap[T]) Get(e Endpoint) (value T, ok bool) { val, found := em.endpoints[encodeEndpoint(e)] if found { return val.value, true } return value, false } // Set updates or adds the value to the address in the map. func (em *EndpointMap[T]) Set(e Endpoint, value T) { en := encodeEndpoint(e) em.endpoints[en] = endpointData[T]{ decodedKey: Endpoint{Addresses: e.Addresses}, value: value, } } // Len returns the number of entries in the map. func (em *EndpointMap[T]) Len() int { return len(em.endpoints) } // Keys returns a slice of all current map keys, as endpoints specifying the // addresses present in the endpoint keys, in which uniqueness is determined by // the unordered set of addresses. Thus, endpoint information returned is not // the full endpoint data (drops duplicated addresses and attributes) but can be // used for EndpointMap accesses. func (em *EndpointMap[T]) Keys() []Endpoint { ret := make([]Endpoint, 0, len(em.endpoints)) for _, en := range em.endpoints { ret = append(ret, en.decodedKey) } return ret } // Values returns a slice of all current map values. func (em *EndpointMap[T]) Values() []T { ret := make([]T, 0, len(em.endpoints)) for _, val := range em.endpoints { ret = append(ret, val.value) } return ret } // Delete removes the specified endpoint from the map. func (em *EndpointMap[T]) Delete(e Endpoint) { en := encodeEndpoint(e) delete(em.endpoints, en) } ================================================ FILE: vendor/google.golang.org/grpc/resolver/resolver.go ================================================ /* * * Copyright 2017 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package resolver defines APIs for name resolution in gRPC. // All APIs in this package are experimental. package resolver import ( "context" "errors" "fmt" "net" "net/url" "strings" "google.golang.org/grpc/attributes" "google.golang.org/grpc/credentials" "google.golang.org/grpc/experimental/stats" "google.golang.org/grpc/internal" "google.golang.org/grpc/serviceconfig" ) var ( // m is a map from scheme to resolver builder. m = make(map[string]Builder) // defaultScheme is the default scheme to use. defaultScheme = "passthrough" ) // TODO(bar) install dns resolver in init(){}. // Register registers the resolver builder to the resolver map. b.Scheme will // be used as the scheme registered with this builder. The registry is case // sensitive, and schemes should not contain any uppercase characters. // // NOTE: this function must only be called during initialization time (i.e. in // an init() function), and is not thread-safe. If multiple Resolvers are // registered with the same name, the one registered last will take effect. func Register(b Builder) { m[b.Scheme()] = b } // Get returns the resolver builder registered with the given scheme. // // If no builder is register with the scheme, nil will be returned. func Get(scheme string) Builder { if b, ok := m[scheme]; ok { return b } return nil } // SetDefaultScheme sets the default scheme that will be used. The default // scheme is initially set to "passthrough". // // NOTE: this function must only be called during initialization time (i.e. in // an init() function), and is not thread-safe. The scheme set last overrides // previously set values. func SetDefaultScheme(scheme string) { defaultScheme = scheme internal.UserSetDefaultScheme = true } // GetDefaultScheme gets the default scheme that will be used by grpc.Dial. If // SetDefaultScheme is never called, the default scheme used by grpc.NewClient is "dns" instead. func GetDefaultScheme() string { return defaultScheme } // Address represents a server the client connects to. // // # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. type Address struct { // Addr is the server address on which a connection will be established. Addr string // ServerName is the name of this address. // If non-empty, the ServerName is used as the transport certification authority for // the address, instead of the hostname from the Dial target string. In most cases, // this should not be set. // // WARNING: ServerName must only be populated with trusted values. It // is insecure to populate it with data from untrusted inputs since untrusted // values could be used to bypass the authority checks performed by TLS. ServerName string // Attributes contains arbitrary data about this address intended for // consumption by the SubConn. Attributes *attributes.Attributes // BalancerAttributes contains arbitrary data about this address intended // for consumption by the LB policy. These attributes do not affect SubConn // creation, connection establishment, handshaking, etc. // // Deprecated: when an Address is inside an Endpoint, this field should not // be used, and it will eventually be removed entirely. BalancerAttributes *attributes.Attributes // Metadata is the information associated with Addr, which may be used // to make load balancing decision. // // Deprecated: use Attributes instead. Metadata any } // Equal returns whether a and o are identical. Metadata is compared directly, // not with any recursive introspection. // // This method compares all fields of the address. When used to tell apart // addresses during subchannel creation or connection establishment, it might be // more appropriate for the caller to implement custom equality logic. func (a Address) Equal(o Address) bool { return a.Addr == o.Addr && a.ServerName == o.ServerName && a.Attributes.Equal(o.Attributes) && a.BalancerAttributes.Equal(o.BalancerAttributes) && a.Metadata == o.Metadata } // String returns JSON formatted string representation of the address. func (a Address) String() string { var sb strings.Builder sb.WriteString(fmt.Sprintf("{Addr: %q, ", a.Addr)) sb.WriteString(fmt.Sprintf("ServerName: %q, ", a.ServerName)) if a.Attributes != nil { sb.WriteString(fmt.Sprintf("Attributes: %v, ", a.Attributes.String())) } if a.BalancerAttributes != nil { sb.WriteString(fmt.Sprintf("BalancerAttributes: %v", a.BalancerAttributes.String())) } sb.WriteString("}") return sb.String() } // BuildOptions includes additional information for the builder to create // the resolver. type BuildOptions struct { // DisableServiceConfig indicates whether a resolver implementation should // fetch service config data. DisableServiceConfig bool // DialCreds is the transport credentials used by the ClientConn for // communicating with the target gRPC service (set via // WithTransportCredentials). In cases where a name resolution service // requires the same credentials, the resolver may use this field. In most // cases though, it is not appropriate, and this field may be ignored. DialCreds credentials.TransportCredentials // CredsBundle is the credentials bundle used by the ClientConn for // communicating with the target gRPC service (set via // WithCredentialsBundle). In cases where a name resolution service // requires the same credentials, the resolver may use this field. In most // cases though, it is not appropriate, and this field may be ignored. CredsBundle credentials.Bundle // Dialer is the custom dialer used by the ClientConn for dialling the // target gRPC service (set via WithDialer). In cases where a name // resolution service requires the same dialer, the resolver may use this // field. In most cases though, it is not appropriate, and this field may // be ignored. Dialer func(context.Context, string) (net.Conn, error) // Authority is the effective authority of the clientconn for which the // resolver is built. Authority string // MetricsRecorder is the metrics recorder to do recording. MetricsRecorder stats.MetricsRecorder } // An Endpoint is one network endpoint, or server, which may have multiple // addresses with which it can be accessed. type Endpoint struct { // Addresses contains a list of addresses used to access this endpoint. Addresses []Address // Attributes contains arbitrary data about this endpoint intended for // consumption by the LB policy. Attributes *attributes.Attributes } // State contains the current Resolver state relevant to the ClientConn. type State struct { // Addresses is the latest set of resolved addresses for the target. // // If a resolver sets Addresses but does not set Endpoints, one Endpoint // will be created for each Address before the State is passed to the LB // policy. The BalancerAttributes of each entry in Addresses will be set // in Endpoints.Attributes, and be cleared in the Endpoint's Address's // BalancerAttributes. // // Soon, Addresses will be deprecated and replaced fully by Endpoints. Addresses []Address // Endpoints is the latest set of resolved endpoints for the target. // // If a resolver produces a State containing Endpoints but not Addresses, // it must take care to ensure the LB policies it selects will support // Endpoints. Endpoints []Endpoint // ServiceConfig contains the result from parsing the latest service // config. If it is nil, it indicates no service config is present or the // resolver does not provide service configs. ServiceConfig *serviceconfig.ParseResult // Attributes contains arbitrary data about the resolver intended for // consumption by the load balancing policy. Attributes *attributes.Attributes } // ClientConn contains the callbacks for resolver to notify any updates // to the gRPC ClientConn. // // This interface is to be implemented by gRPC. Users should not need a // brand new implementation of this interface. For the situations like // testing, the new implementation should embed this interface. This allows // gRPC to add new methods to this interface. type ClientConn interface { // UpdateState updates the state of the ClientConn appropriately. // // If an error is returned, the resolver should try to resolve the // target again. The resolver should use a backoff timer to prevent // overloading the server with requests. If a resolver is certain that // reresolving will not change the result, e.g. because it is // a watch-based resolver, returned errors can be ignored. // // If the resolved State is the same as the last reported one, calling // UpdateState can be omitted. UpdateState(State) error // ReportError notifies the ClientConn that the Resolver encountered an // error. The ClientConn then forwards this error to the load balancing // policy. ReportError(error) // NewAddress is called by resolver to notify ClientConn a new list // of resolved addresses. // The address list should be the complete list of resolved addresses. // // Deprecated: Use UpdateState instead. NewAddress(addresses []Address) // ParseServiceConfig parses the provided service config and returns an // object that provides the parsed config. ParseServiceConfig(serviceConfigJSON string) *serviceconfig.ParseResult } // Target represents a target for gRPC, as specified in: // https://github.com/grpc/grpc/blob/master/doc/naming.md. // It is parsed from the target string that gets passed into Dial or DialContext // by the user. And gRPC passes it to the resolver and the balancer. // // If the target follows the naming spec, and the parsed scheme is registered // with gRPC, we will parse the target string according to the spec. If the // target does not contain a scheme or if the parsed scheme is not registered // (i.e. no corresponding resolver available to resolve the endpoint), we will // apply the default scheme, and will attempt to reparse it. type Target struct { // URL contains the parsed dial target with an optional default scheme added // to it if the original dial target contained no scheme or contained an // unregistered scheme. Any query params specified in the original dial // target can be accessed from here. URL url.URL } // Endpoint retrieves endpoint without leading "/" from either `URL.Path` // or `URL.Opaque`. The latter is used when the former is empty. func (t Target) Endpoint() string { endpoint := t.URL.Path if endpoint == "" { endpoint = t.URL.Opaque } // For targets of the form "[scheme]://[authority]/endpoint, the endpoint // value returned from url.Parse() contains a leading "/". Although this is // in accordance with RFC 3986, we do not want to break existing resolver // implementations which expect the endpoint without the leading "/". So, we // end up stripping the leading "/" here. But this will result in an // incorrect parsing for something like "unix:///path/to/socket". Since we // own the "unix" resolver, we can workaround in the unix resolver by using // the `URL` field. return strings.TrimPrefix(endpoint, "/") } // String returns the canonical string representation of Target. func (t Target) String() string { return t.URL.Scheme + "://" + t.URL.Host + "/" + t.Endpoint() } // Builder creates a resolver that will be used to watch name resolution updates. type Builder interface { // Build creates a new resolver for the given target. // // gRPC dial calls Build synchronously, and fails if the returned error is // not nil. Build(target Target, cc ClientConn, opts BuildOptions) (Resolver, error) // Scheme returns the scheme supported by this resolver. Scheme is defined // at https://github.com/grpc/grpc/blob/master/doc/naming.md. The returned // string should not contain uppercase characters, as they will not match // the parsed target's scheme as defined in RFC 3986. Scheme() string } // ResolveNowOptions includes additional information for ResolveNow. type ResolveNowOptions struct{} // Resolver watches for the updates on the specified target. // Updates include address updates and service config updates. type Resolver interface { // ResolveNow will be called by gRPC to try to resolve the target name // again. It's just a hint, resolver can ignore this if it's not necessary. // // It could be called multiple times concurrently. ResolveNow(ResolveNowOptions) // Close closes the resolver. Close() } // AuthorityOverrider is implemented by Builders that wish to override the // default authority for the ClientConn. // By default, the authority used is target.Endpoint(). type AuthorityOverrider interface { // OverrideAuthority returns the authority to use for a ClientConn with the // given target. The implementation must generate it without blocking, // typically in line, and must keep it unchanged. // // The returned string must be a valid ":authority" header value, i.e. be // encoded according to // [RFC3986](https://datatracker.ietf.org/doc/html/rfc3986#section-3.2) as // necessary. OverrideAuthority(Target) string } // ValidateEndpoints validates endpoints from a petiole policy's perspective. // Petiole policies should call this before calling into their children. See // [gRPC A61](https://github.com/grpc/proposal/blob/master/A61-IPv4-IPv6-dualstack-backends.md) // for details. func ValidateEndpoints(endpoints []Endpoint) error { if len(endpoints) == 0 { return errors.New("endpoints list is empty") } for _, endpoint := range endpoints { for range endpoint.Addresses { return nil } } return errors.New("endpoints list contains no addresses") } ================================================ FILE: vendor/google.golang.org/grpc/resolver_wrapper.go ================================================ /* * * Copyright 2017 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package grpc import ( "context" "strings" "sync" "google.golang.org/grpc/internal/channelz" "google.golang.org/grpc/internal/grpcsync" "google.golang.org/grpc/internal/pretty" "google.golang.org/grpc/internal/resolver/delegatingresolver" "google.golang.org/grpc/resolver" "google.golang.org/grpc/serviceconfig" ) // ccResolverWrapper is a wrapper on top of cc for resolvers. // It implements resolver.ClientConn interface. type ccResolverWrapper struct { // The following fields are initialized when the wrapper is created and are // read-only afterwards, and therefore can be accessed without a mutex. cc *ClientConn ignoreServiceConfig bool serializer *grpcsync.CallbackSerializer serializerCancel context.CancelFunc resolver resolver.Resolver // only accessed within the serializer // The following fields are protected by mu. Caller must take cc.mu before // taking mu. mu sync.Mutex curState resolver.State closed bool } // newCCResolverWrapper initializes the ccResolverWrapper. It can only be used // after calling start, which builds the resolver. func newCCResolverWrapper(cc *ClientConn) *ccResolverWrapper { ctx, cancel := context.WithCancel(cc.ctx) return &ccResolverWrapper{ cc: cc, ignoreServiceConfig: cc.dopts.disableServiceConfig, serializer: grpcsync.NewCallbackSerializer(ctx), serializerCancel: cancel, } } // start builds the name resolver using the resolver.Builder in cc and returns // any error encountered. It must always be the first operation performed on // any newly created ccResolverWrapper, except that close may be called instead. func (ccr *ccResolverWrapper) start() error { errCh := make(chan error) ccr.serializer.TrySchedule(func(ctx context.Context) { if ctx.Err() != nil { errCh <- ctx.Err() return } opts := resolver.BuildOptions{ DisableServiceConfig: ccr.cc.dopts.disableServiceConfig, DialCreds: ccr.cc.dopts.copts.TransportCredentials, CredsBundle: ccr.cc.dopts.copts.CredsBundle, Dialer: ccr.cc.dopts.copts.Dialer, Authority: ccr.cc.authority, MetricsRecorder: ccr.cc.metricsRecorderList, } var err error // The delegating resolver is used unless: // - A custom dialer is provided via WithContextDialer dialoption or // - Proxy usage is disabled through WithNoProxy dialoption. // In these cases, the resolver is built based on the scheme of target, // using the appropriate resolver builder. if ccr.cc.dopts.copts.Dialer != nil || !ccr.cc.dopts.useProxy { ccr.resolver, err = ccr.cc.resolverBuilder.Build(ccr.cc.parsedTarget, ccr, opts) } else { ccr.resolver, err = delegatingresolver.New(ccr.cc.parsedTarget, ccr, opts, ccr.cc.resolverBuilder, ccr.cc.dopts.enableLocalDNSResolution) } errCh <- err }) return <-errCh } func (ccr *ccResolverWrapper) resolveNow(o resolver.ResolveNowOptions) { ccr.serializer.TrySchedule(func(ctx context.Context) { if ctx.Err() != nil || ccr.resolver == nil { return } ccr.resolver.ResolveNow(o) }) } // close initiates async shutdown of the wrapper. To determine the wrapper has // finished shutting down, the channel should block on ccr.serializer.Done() // without cc.mu held. func (ccr *ccResolverWrapper) close() { channelz.Info(logger, ccr.cc.channelz, "Closing the name resolver") ccr.mu.Lock() ccr.closed = true ccr.mu.Unlock() ccr.serializer.TrySchedule(func(context.Context) { if ccr.resolver == nil { return } ccr.resolver.Close() ccr.resolver = nil }) ccr.serializerCancel() } // UpdateState is called by resolver implementations to report new state to gRPC // which includes addresses and service config. func (ccr *ccResolverWrapper) UpdateState(s resolver.State) error { ccr.cc.mu.Lock() ccr.mu.Lock() if ccr.closed { ccr.mu.Unlock() ccr.cc.mu.Unlock() return nil } if s.Endpoints == nil { s.Endpoints = addressesToEndpoints(s.Addresses) } ccr.addChannelzTraceEvent(s) ccr.curState = s ccr.mu.Unlock() return ccr.cc.updateResolverStateAndUnlock(s, nil) } // ReportError is called by resolver implementations to report errors // encountered during name resolution to gRPC. func (ccr *ccResolverWrapper) ReportError(err error) { ccr.cc.mu.Lock() ccr.mu.Lock() if ccr.closed { ccr.mu.Unlock() ccr.cc.mu.Unlock() return } ccr.mu.Unlock() channelz.Warningf(logger, ccr.cc.channelz, "ccResolverWrapper: reporting error to cc: %v", err) ccr.cc.updateResolverStateAndUnlock(resolver.State{}, err) } // NewAddress is called by the resolver implementation to send addresses to // gRPC. func (ccr *ccResolverWrapper) NewAddress(addrs []resolver.Address) { ccr.cc.mu.Lock() ccr.mu.Lock() if ccr.closed { ccr.mu.Unlock() ccr.cc.mu.Unlock() return } s := resolver.State{ Addresses: addrs, ServiceConfig: ccr.curState.ServiceConfig, Endpoints: addressesToEndpoints(addrs), } ccr.addChannelzTraceEvent(s) ccr.curState = s ccr.mu.Unlock() ccr.cc.updateResolverStateAndUnlock(s, nil) } // ParseServiceConfig is called by resolver implementations to parse a JSON // representation of the service config. func (ccr *ccResolverWrapper) ParseServiceConfig(scJSON string) *serviceconfig.ParseResult { return parseServiceConfig(scJSON, ccr.cc.dopts.maxCallAttempts) } // addChannelzTraceEvent adds a channelz trace event containing the new // state received from resolver implementations. func (ccr *ccResolverWrapper) addChannelzTraceEvent(s resolver.State) { if !logger.V(0) && !channelz.IsOn() { return } var updates []string var oldSC, newSC *ServiceConfig var oldOK, newOK bool if ccr.curState.ServiceConfig != nil { oldSC, oldOK = ccr.curState.ServiceConfig.Config.(*ServiceConfig) } if s.ServiceConfig != nil { newSC, newOK = s.ServiceConfig.Config.(*ServiceConfig) } if oldOK != newOK || (oldOK && newOK && oldSC.rawJSONString != newSC.rawJSONString) { updates = append(updates, "service config updated") } if len(ccr.curState.Addresses) > 0 && len(s.Addresses) == 0 { updates = append(updates, "resolver returned an empty address list") } else if len(ccr.curState.Addresses) == 0 && len(s.Addresses) > 0 { updates = append(updates, "resolver returned new addresses") } channelz.Infof(logger, ccr.cc.channelz, "Resolver state updated: %s (%v)", pretty.ToJSON(s), strings.Join(updates, "; ")) } func addressesToEndpoints(addrs []resolver.Address) []resolver.Endpoint { endpoints := make([]resolver.Endpoint, 0, len(addrs)) for _, a := range addrs { ep := resolver.Endpoint{Addresses: []resolver.Address{a}, Attributes: a.BalancerAttributes} ep.Addresses[0].BalancerAttributes = nil endpoints = append(endpoints, ep) } return endpoints } ================================================ FILE: vendor/google.golang.org/grpc/rpc_util.go ================================================ /* * * Copyright 2014 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package grpc import ( "compress/gzip" "context" "encoding/binary" "fmt" "io" "math" "strings" "sync" "time" "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials" "google.golang.org/grpc/encoding" "google.golang.org/grpc/encoding/proto" "google.golang.org/grpc/internal" "google.golang.org/grpc/internal/grpcutil" "google.golang.org/grpc/internal/transport" "google.golang.org/grpc/mem" "google.golang.org/grpc/metadata" "google.golang.org/grpc/peer" "google.golang.org/grpc/stats" "google.golang.org/grpc/status" ) func init() { internal.AcceptCompressors = acceptCompressors } // Compressor defines the interface gRPC uses to compress a message. // // Deprecated: use package encoding. type Compressor interface { // Do compresses p into w. Do(w io.Writer, p []byte) error // Type returns the compression algorithm the Compressor uses. Type() string } type gzipCompressor struct { pool sync.Pool } // NewGZIPCompressor creates a Compressor based on GZIP. // // Deprecated: use package encoding/gzip. func NewGZIPCompressor() Compressor { c, _ := NewGZIPCompressorWithLevel(gzip.DefaultCompression) return c } // NewGZIPCompressorWithLevel is like NewGZIPCompressor but specifies the gzip compression level instead // of assuming DefaultCompression. // // The error returned will be nil if the level is valid. // // Deprecated: use package encoding/gzip. func NewGZIPCompressorWithLevel(level int) (Compressor, error) { if level < gzip.DefaultCompression || level > gzip.BestCompression { return nil, fmt.Errorf("grpc: invalid compression level: %d", level) } return &gzipCompressor{ pool: sync.Pool{ New: func() any { w, err := gzip.NewWriterLevel(io.Discard, level) if err != nil { panic(err) } return w }, }, }, nil } func (c *gzipCompressor) Do(w io.Writer, p []byte) error { z := c.pool.Get().(*gzip.Writer) defer c.pool.Put(z) z.Reset(w) if _, err := z.Write(p); err != nil { return err } return z.Close() } func (c *gzipCompressor) Type() string { return "gzip" } // Decompressor defines the interface gRPC uses to decompress a message. // // Deprecated: use package encoding. type Decompressor interface { // Do reads the data from r and uncompress them. Do(r io.Reader) ([]byte, error) // Type returns the compression algorithm the Decompressor uses. Type() string } type gzipDecompressor struct { pool sync.Pool } // NewGZIPDecompressor creates a Decompressor based on GZIP. // // Deprecated: use package encoding/gzip. func NewGZIPDecompressor() Decompressor { return &gzipDecompressor{} } func (d *gzipDecompressor) Do(r io.Reader) ([]byte, error) { var z *gzip.Reader switch maybeZ := d.pool.Get().(type) { case nil: newZ, err := gzip.NewReader(r) if err != nil { return nil, err } z = newZ case *gzip.Reader: z = maybeZ if err := z.Reset(r); err != nil { d.pool.Put(z) return nil, err } } defer func() { z.Close() d.pool.Put(z) }() return io.ReadAll(z) } func (d *gzipDecompressor) Type() string { return "gzip" } // callInfo contains all related configuration and information about an RPC. type callInfo struct { compressorName string failFast bool maxReceiveMessageSize *int maxSendMessageSize *int creds credentials.PerRPCCredentials contentSubtype string codec baseCodec maxRetryRPCBufferSize int onFinish []func(err error) authority string acceptedResponseCompressors []string } func acceptedCompressorAllows(allowed []string, name string) bool { if allowed == nil { return true } if name == "" || name == encoding.Identity { return true } for _, a := range allowed { if a == name { return true } } return false } func defaultCallInfo() *callInfo { return &callInfo{ failFast: true, maxRetryRPCBufferSize: 256 * 1024, // 256KB } } func newAcceptedCompressionConfig(names []string) ([]string, error) { if len(names) == 0 { return nil, nil } var allowed []string seen := make(map[string]struct{}, len(names)) for _, name := range names { name = strings.TrimSpace(name) if name == "" || name == encoding.Identity { continue } if !grpcutil.IsCompressorNameRegistered(name) { return nil, status.Errorf(codes.InvalidArgument, "grpc: compressor %q is not registered", name) } if _, dup := seen[name]; dup { continue } seen[name] = struct{}{} allowed = append(allowed, name) } return allowed, nil } // CallOption configures a Call before it starts or extracts information from // a Call after it completes. type CallOption interface { // before is called before the call is sent to any server. If before // returns a non-nil error, the RPC fails with that error. before(*callInfo) error // after is called after the call has completed. after cannot return an // error, so any failures should be reported via output parameters. after(*callInfo, *csAttempt) } // EmptyCallOption does not alter the Call configuration. // It can be embedded in another structure to carry satellite data for use // by interceptors. type EmptyCallOption struct{} func (EmptyCallOption) before(*callInfo) error { return nil } func (EmptyCallOption) after(*callInfo, *csAttempt) {} // StaticMethod returns a CallOption which specifies that a call is being made // to a method that is static, which means the method is known at compile time // and doesn't change at runtime. This can be used as a signal to stats plugins // that this method is safe to include as a key to a measurement. func StaticMethod() CallOption { return StaticMethodCallOption{} } // StaticMethodCallOption is a CallOption that specifies that a call comes // from a static method. type StaticMethodCallOption struct { EmptyCallOption } // Header returns a CallOptions that retrieves the header metadata // for a unary RPC. func Header(md *metadata.MD) CallOption { return HeaderCallOption{HeaderAddr: md} } // HeaderCallOption is a CallOption for collecting response header metadata. // The metadata field will be populated *after* the RPC completes. // // # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. type HeaderCallOption struct { HeaderAddr *metadata.MD } func (o HeaderCallOption) before(*callInfo) error { return nil } func (o HeaderCallOption) after(_ *callInfo, attempt *csAttempt) { *o.HeaderAddr, _ = attempt.transportStream.Header() } // Trailer returns a CallOptions that retrieves the trailer metadata // for a unary RPC. func Trailer(md *metadata.MD) CallOption { return TrailerCallOption{TrailerAddr: md} } // TrailerCallOption is a CallOption for collecting response trailer metadata. // The metadata field will be populated *after* the RPC completes. // // # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. type TrailerCallOption struct { TrailerAddr *metadata.MD } func (o TrailerCallOption) before(*callInfo) error { return nil } func (o TrailerCallOption) after(_ *callInfo, attempt *csAttempt) { *o.TrailerAddr = attempt.transportStream.Trailer() } // Peer returns a CallOption that retrieves peer information for a unary RPC. // The peer field will be populated *after* the RPC completes. func Peer(p *peer.Peer) CallOption { return PeerCallOption{PeerAddr: p} } // PeerCallOption is a CallOption for collecting the identity of the remote // peer. The peer field will be populated *after* the RPC completes. // // # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. type PeerCallOption struct { PeerAddr *peer.Peer } func (o PeerCallOption) before(*callInfo) error { return nil } func (o PeerCallOption) after(_ *callInfo, attempt *csAttempt) { if x, ok := peer.FromContext(attempt.transportStream.Context()); ok { *o.PeerAddr = *x } } // WaitForReady configures the RPC's behavior when the client is in // TRANSIENT_FAILURE, which occurs when all addresses fail to connect. If // waitForReady is false, the RPC will fail immediately. Otherwise, the client // will wait until a connection becomes available or the RPC's deadline is // reached. // // By default, RPCs do not "wait for ready". func WaitForReady(waitForReady bool) CallOption { return FailFastCallOption{FailFast: !waitForReady} } // FailFast is the opposite of WaitForReady. // // Deprecated: use WaitForReady. func FailFast(failFast bool) CallOption { return FailFastCallOption{FailFast: failFast} } // FailFastCallOption is a CallOption for indicating whether an RPC should fail // fast or not. // // # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. type FailFastCallOption struct { FailFast bool } func (o FailFastCallOption) before(c *callInfo) error { c.failFast = o.FailFast return nil } func (o FailFastCallOption) after(*callInfo, *csAttempt) {} // OnFinish returns a CallOption that configures a callback to be called when // the call completes. The error passed to the callback is the status of the // RPC, and may be nil. The onFinish callback provided will only be called once // by gRPC. This is mainly used to be used by streaming interceptors, to be // notified when the RPC completes along with information about the status of // the RPC. // // # Experimental // // Notice: This API is EXPERIMENTAL and may be changed or removed in a // later release. func OnFinish(onFinish func(err error)) CallOption { return OnFinishCallOption{ OnFinish: onFinish, } } // OnFinishCallOption is CallOption that indicates a callback to be called when // the call completes. // // # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. type OnFinishCallOption struct { OnFinish func(error) } func (o OnFinishCallOption) before(c *callInfo) error { c.onFinish = append(c.onFinish, o.OnFinish) return nil } func (o OnFinishCallOption) after(*callInfo, *csAttempt) {} // MaxCallRecvMsgSize returns a CallOption which sets the maximum message size // in bytes the client can receive. If this is not set, gRPC uses the default // 4MB. func MaxCallRecvMsgSize(bytes int) CallOption { return MaxRecvMsgSizeCallOption{MaxRecvMsgSize: bytes} } // MaxRecvMsgSizeCallOption is a CallOption that indicates the maximum message // size in bytes the client can receive. // // # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. type MaxRecvMsgSizeCallOption struct { MaxRecvMsgSize int } func (o MaxRecvMsgSizeCallOption) before(c *callInfo) error { c.maxReceiveMessageSize = &o.MaxRecvMsgSize return nil } func (o MaxRecvMsgSizeCallOption) after(*callInfo, *csAttempt) {} // CallAuthority returns a CallOption that sets the HTTP/2 :authority header of // an RPC to the specified value. When using CallAuthority, the credentials in // use must implement the AuthorityValidator interface. // // # Experimental // // Notice: This API is EXPERIMENTAL and may be changed or removed in a later // release. func CallAuthority(authority string) CallOption { return AuthorityOverrideCallOption{Authority: authority} } // AuthorityOverrideCallOption is a CallOption that indicates the HTTP/2 // :authority header value to use for the call. // // # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a later // release. type AuthorityOverrideCallOption struct { Authority string } func (o AuthorityOverrideCallOption) before(c *callInfo) error { c.authority = o.Authority return nil } func (o AuthorityOverrideCallOption) after(*callInfo, *csAttempt) {} // MaxCallSendMsgSize returns a CallOption which sets the maximum message size // in bytes the client can send. If this is not set, gRPC uses the default // `math.MaxInt32`. func MaxCallSendMsgSize(bytes int) CallOption { return MaxSendMsgSizeCallOption{MaxSendMsgSize: bytes} } // MaxSendMsgSizeCallOption is a CallOption that indicates the maximum message // size in bytes the client can send. // // # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. type MaxSendMsgSizeCallOption struct { MaxSendMsgSize int } func (o MaxSendMsgSizeCallOption) before(c *callInfo) error { c.maxSendMessageSize = &o.MaxSendMsgSize return nil } func (o MaxSendMsgSizeCallOption) after(*callInfo, *csAttempt) {} // PerRPCCredentials returns a CallOption that sets credentials.PerRPCCredentials // for a call. func PerRPCCredentials(creds credentials.PerRPCCredentials) CallOption { return PerRPCCredsCallOption{Creds: creds} } // PerRPCCredsCallOption is a CallOption that indicates the per-RPC // credentials to use for the call. // // # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. type PerRPCCredsCallOption struct { Creds credentials.PerRPCCredentials } func (o PerRPCCredsCallOption) before(c *callInfo) error { c.creds = o.Creds return nil } func (o PerRPCCredsCallOption) after(*callInfo, *csAttempt) {} // UseCompressor returns a CallOption which sets the compressor used when // sending the request. If WithCompressor is also set, UseCompressor has // higher priority. // // # Experimental // // Notice: This API is EXPERIMENTAL and may be changed or removed in a // later release. func UseCompressor(name string) CallOption { return CompressorCallOption{CompressorType: name} } // CompressorCallOption is a CallOption that indicates the compressor to use. // // # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. type CompressorCallOption struct { CompressorType string } func (o CompressorCallOption) before(c *callInfo) error { c.compressorName = o.CompressorType return nil } func (o CompressorCallOption) after(*callInfo, *csAttempt) {} // acceptCompressors returns a CallOption that limits the compression algorithms // advertised in the grpc-accept-encoding header for response messages. // Compression algorithms not in the provided list will not be advertised, and // responses compressed with non-listed algorithms will be rejected. func acceptCompressors(names ...string) CallOption { cp := append([]string(nil), names...) return acceptCompressorsCallOption{names: cp} } // acceptCompressorsCallOption is a CallOption that limits response compression. type acceptCompressorsCallOption struct { names []string } func (o acceptCompressorsCallOption) before(c *callInfo) error { allowed, err := newAcceptedCompressionConfig(o.names) if err != nil { return err } c.acceptedResponseCompressors = allowed return nil } func (acceptCompressorsCallOption) after(*callInfo, *csAttempt) {} // CallContentSubtype returns a CallOption that will set the content-subtype // for a call. For example, if content-subtype is "json", the Content-Type over // the wire will be "application/grpc+json". The content-subtype is converted // to lowercase before being included in Content-Type. See Content-Type on // https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#requests for // more details. // // If ForceCodec is not also used, the content-subtype will be used to look up // the Codec to use in the registry controlled by RegisterCodec. See the // documentation on RegisterCodec for details on registration. The lookup of // content-subtype is case-insensitive. If no such Codec is found, the call // will result in an error with code codes.Internal. // // If ForceCodec is also used, that Codec will be used for all request and // response messages, with the content-subtype set to the given contentSubtype // here for requests. func CallContentSubtype(contentSubtype string) CallOption { return ContentSubtypeCallOption{ContentSubtype: strings.ToLower(contentSubtype)} } // ContentSubtypeCallOption is a CallOption that indicates the content-subtype // used for marshaling messages. // // # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. type ContentSubtypeCallOption struct { ContentSubtype string } func (o ContentSubtypeCallOption) before(c *callInfo) error { c.contentSubtype = o.ContentSubtype return nil } func (o ContentSubtypeCallOption) after(*callInfo, *csAttempt) {} // ForceCodec returns a CallOption that will set codec to be used for all // request and response messages for a call. The result of calling Name() will // be used as the content-subtype after converting to lowercase, unless // CallContentSubtype is also used. // // See Content-Type on // https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#requests for // more details. Also see the documentation on RegisterCodec and // CallContentSubtype for more details on the interaction between Codec and // content-subtype. // // This function is provided for advanced users; prefer to use only // CallContentSubtype to select a registered codec instead. // // # Experimental // // Notice: This API is EXPERIMENTAL and may be changed or removed in a // later release. func ForceCodec(codec encoding.Codec) CallOption { return ForceCodecCallOption{Codec: codec} } // ForceCodecCallOption is a CallOption that indicates the codec used for // marshaling messages. // // # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. type ForceCodecCallOption struct { Codec encoding.Codec } func (o ForceCodecCallOption) before(c *callInfo) error { c.codec = newCodecV1Bridge(o.Codec) return nil } func (o ForceCodecCallOption) after(*callInfo, *csAttempt) {} // ForceCodecV2 returns a CallOption that will set codec to be used for all // request and response messages for a call. The result of calling Name() will // be used as the content-subtype after converting to lowercase, unless // CallContentSubtype is also used. // // See Content-Type on // https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#requests for // more details. Also see the documentation on RegisterCodec and // CallContentSubtype for more details on the interaction between Codec and // content-subtype. // // This function is provided for advanced users; prefer to use only // CallContentSubtype to select a registered codec instead. // // # Experimental // // Notice: This API is EXPERIMENTAL and may be changed or removed in a // later release. func ForceCodecV2(codec encoding.CodecV2) CallOption { return ForceCodecV2CallOption{CodecV2: codec} } // ForceCodecV2CallOption is a CallOption that indicates the codec used for // marshaling messages. // // # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. type ForceCodecV2CallOption struct { CodecV2 encoding.CodecV2 } func (o ForceCodecV2CallOption) before(c *callInfo) error { c.codec = o.CodecV2 return nil } func (o ForceCodecV2CallOption) after(*callInfo, *csAttempt) {} // CallCustomCodec behaves like ForceCodec, but accepts a grpc.Codec instead of // an encoding.Codec. // // Deprecated: use ForceCodec instead. func CallCustomCodec(codec Codec) CallOption { return CustomCodecCallOption{Codec: codec} } // CustomCodecCallOption is a CallOption that indicates the codec used for // marshaling messages. // // # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. type CustomCodecCallOption struct { Codec Codec } func (o CustomCodecCallOption) before(c *callInfo) error { c.codec = newCodecV0Bridge(o.Codec) return nil } func (o CustomCodecCallOption) after(*callInfo, *csAttempt) {} // MaxRetryRPCBufferSize returns a CallOption that limits the amount of memory // used for buffering this RPC's requests for retry purposes. // // # Experimental // // Notice: This API is EXPERIMENTAL and may be changed or removed in a // later release. func MaxRetryRPCBufferSize(bytes int) CallOption { return MaxRetryRPCBufferSizeCallOption{bytes} } // MaxRetryRPCBufferSizeCallOption is a CallOption indicating the amount of // memory to be used for caching this RPC for retry purposes. // // # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. type MaxRetryRPCBufferSizeCallOption struct { MaxRetryRPCBufferSize int } func (o MaxRetryRPCBufferSizeCallOption) before(c *callInfo) error { c.maxRetryRPCBufferSize = o.MaxRetryRPCBufferSize return nil } func (o MaxRetryRPCBufferSizeCallOption) after(*callInfo, *csAttempt) {} // The format of the payload: compressed or not? type payloadFormat uint8 const ( compressionNone payloadFormat = 0 // no compression compressionMade payloadFormat = 1 // compressed ) func (pf payloadFormat) isCompressed() bool { return pf == compressionMade } type streamReader interface { ReadMessageHeader(header []byte) error Read(n int) (mem.BufferSlice, error) } // noCopy may be embedded into structs which must not be copied // after the first use. // // See https://golang.org/issues/8005#issuecomment-190753527 // for details. type noCopy struct { } func (*noCopy) Lock() {} func (*noCopy) Unlock() {} // parser reads complete gRPC messages from the underlying reader. type parser struct { _ noCopy // r is the underlying reader. // See the comment on recvMsg for the permissible // error types. r streamReader // The header of a gRPC message. Find more detail at // https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md header [5]byte // bufferPool is the pool of shared receive buffers. bufferPool mem.BufferPool } // recvMsg reads a complete gRPC message from the stream. // // It returns the message and its payload (compression/encoding) // format. The caller owns the returned msg memory. // // If there is an error, possible values are: // - io.EOF, when no messages remain // - io.ErrUnexpectedEOF // - of type transport.ConnectionError // - an error from the status package // // No other error values or types must be returned, which also means // that the underlying streamReader must not return an incompatible // error. func (p *parser) recvMsg(maxReceiveMessageSize int) (payloadFormat, mem.BufferSlice, error) { err := p.r.ReadMessageHeader(p.header[:]) if err != nil { return 0, nil, err } pf := payloadFormat(p.header[0]) length := binary.BigEndian.Uint32(p.header[1:]) if int64(length) > int64(maxInt) { return 0, nil, status.Errorf(codes.ResourceExhausted, "grpc: received message larger than max length allowed on current machine (%d vs. %d)", length, maxInt) } if int(length) > maxReceiveMessageSize { return 0, nil, status.Errorf(codes.ResourceExhausted, "grpc: received message larger than max (%d vs. %d)", length, maxReceiveMessageSize) } data, err := p.r.Read(int(length)) if err != nil { if err == io.EOF { err = io.ErrUnexpectedEOF } return 0, nil, err } return pf, data, nil } // encode serializes msg and returns a buffer containing the message, or an // error if it is too large to be transmitted by grpc. If msg is nil, it // generates an empty message. func encode(c baseCodec, msg any) (mem.BufferSlice, error) { if msg == nil { // NOTE: typed nils will not be caught by this check return nil, nil } b, err := c.Marshal(msg) if err != nil { return nil, status.Errorf(codes.Internal, "grpc: error while marshaling: %v", err.Error()) } if bufSize := uint(b.Len()); bufSize > math.MaxUint32 { b.Free() return nil, status.Errorf(codes.ResourceExhausted, "grpc: message too large (%d bytes)", bufSize) } return b, nil } // compress returns the input bytes compressed by compressor or cp. // If both compressors are nil, or if the message has zero length, returns nil, // indicating no compression was done. // // TODO(dfawley): eliminate cp parameter by wrapping Compressor in an encoding.Compressor. func compress(in mem.BufferSlice, cp Compressor, compressor encoding.Compressor, pool mem.BufferPool) (mem.BufferSlice, payloadFormat, error) { if (compressor == nil && cp == nil) || in.Len() == 0 { return nil, compressionNone, nil } var out mem.BufferSlice w := mem.NewWriter(&out, pool) wrapErr := func(err error) error { out.Free() return status.Errorf(codes.Internal, "grpc: error while compressing: %v", err.Error()) } if compressor != nil { z, err := compressor.Compress(w) if err != nil { return nil, 0, wrapErr(err) } for _, b := range in { if _, err := z.Write(b.ReadOnlyData()); err != nil { return nil, 0, wrapErr(err) } } if err := z.Close(); err != nil { return nil, 0, wrapErr(err) } } else { // This is obviously really inefficient since it fully materializes the data, but // there is no way around this with the old Compressor API. At least it attempts // to return the buffer to the provider, in the hopes it can be reused (maybe // even by a subsequent call to this very function). buf := in.MaterializeToBuffer(pool) defer buf.Free() if err := cp.Do(w, buf.ReadOnlyData()); err != nil { return nil, 0, wrapErr(err) } } return out, compressionMade, nil } const ( payloadLen = 1 sizeLen = 4 headerLen = payloadLen + sizeLen ) // msgHeader returns a 5-byte header for the message being transmitted and the // payload, which is compData if non-nil or data otherwise. func msgHeader(data, compData mem.BufferSlice, pf payloadFormat) (hdr []byte, payload mem.BufferSlice) { hdr = make([]byte, headerLen) hdr[0] = byte(pf) var length uint32 if pf.isCompressed() { length = uint32(compData.Len()) payload = compData } else { length = uint32(data.Len()) payload = data } // Write length of payload into buf binary.BigEndian.PutUint32(hdr[payloadLen:], length) return hdr, payload } func outPayload(client bool, msg any, dataLength, payloadLength int, t time.Time) *stats.OutPayload { return &stats.OutPayload{ Client: client, Payload: msg, Length: dataLength, WireLength: payloadLength + headerLen, CompressedLength: payloadLength, SentTime: t, } } func checkRecvPayload(pf payloadFormat, recvCompress string, haveCompressor bool, isServer bool) *status.Status { switch pf { case compressionNone: case compressionMade: if recvCompress == "" || recvCompress == encoding.Identity { return status.New(codes.Internal, "grpc: compressed flag set with identity or empty encoding") } if !haveCompressor { if isServer { return status.Newf(codes.Unimplemented, "grpc: Decompressor is not installed for grpc-encoding %q", recvCompress) } return status.Newf(codes.Internal, "grpc: Decompressor is not installed for grpc-encoding %q", recvCompress) } default: return status.Newf(codes.Internal, "grpc: received unexpected payload format %d", pf) } return nil } type payloadInfo struct { compressedLength int // The compressed length got from wire. uncompressedBytes mem.BufferSlice } func (p *payloadInfo) free() { if p != nil && p.uncompressedBytes != nil { p.uncompressedBytes.Free() } } // recvAndDecompress reads a message from the stream, decompressing it if necessary. // // Cancelling the returned cancel function releases the buffer back to the pool. So the caller should cancel as soon as // the buffer is no longer needed. // TODO: Refactor this function to reduce the number of arguments. // See: https://google.github.io/styleguide/go/best-practices.html#function-argument-lists func recvAndDecompress(p *parser, s recvCompressor, dc Decompressor, maxReceiveMessageSize int, payInfo *payloadInfo, compressor encoding.Compressor, isServer bool) (out mem.BufferSlice, err error) { pf, compressed, err := p.recvMsg(maxReceiveMessageSize) if err != nil { return nil, err } compressedLength := compressed.Len() if st := checkRecvPayload(pf, s.RecvCompress(), compressor != nil || dc != nil, isServer); st != nil { compressed.Free() return nil, st.Err() } if pf.isCompressed() { defer compressed.Free() // To match legacy behavior, if the decompressor is set by WithDecompressor or RPCDecompressor, // use this decompressor as the default. out, err = decompress(compressor, compressed, dc, maxReceiveMessageSize, p.bufferPool) if err != nil { return nil, err } } else { out = compressed } if payInfo != nil { payInfo.compressedLength = compressedLength out.Ref() payInfo.uncompressedBytes = out } return out, nil } // decompress processes the given data by decompressing it using either a custom decompressor or a standard compressor. // If a custom decompressor is provided, it takes precedence. The function validates that the decompressed data // does not exceed the specified maximum size and returns an error if this limit is exceeded. // On success, it returns the decompressed data. Otherwise, it returns an error if decompression fails or the data exceeds the size limit. func decompress(compressor encoding.Compressor, d mem.BufferSlice, dc Decompressor, maxReceiveMessageSize int, pool mem.BufferPool) (mem.BufferSlice, error) { if dc != nil { uncompressed, err := dc.Do(d.Reader()) if err != nil { return nil, status.Errorf(codes.Internal, "grpc: failed to decompress the received message: %v", err) } if len(uncompressed) > maxReceiveMessageSize { return nil, status.Errorf(codes.ResourceExhausted, "grpc: message after decompression larger than max (%d vs. %d)", len(uncompressed), maxReceiveMessageSize) } return mem.BufferSlice{mem.SliceBuffer(uncompressed)}, nil } if compressor != nil { dcReader, err := compressor.Decompress(d.Reader()) if err != nil { return nil, status.Errorf(codes.Internal, "grpc: failed to decompress the message: %v", err) } // Read at most one byte more than the limit from the decompressor. // Unless the limit is MaxInt64, in which case, that's impossible, so // apply no limit. if limit := int64(maxReceiveMessageSize); limit < math.MaxInt64 { dcReader = io.LimitReader(dcReader, limit+1) } out, err := mem.ReadAll(dcReader, pool) if err != nil { out.Free() return nil, status.Errorf(codes.Internal, "grpc: failed to read decompressed data: %v", err) } if out.Len() > maxReceiveMessageSize { out.Free() return nil, status.Errorf(codes.ResourceExhausted, "grpc: received message after decompression larger than max %d", maxReceiveMessageSize) } return out, nil } return nil, status.Errorf(codes.Internal, "grpc: no decompressor available for compressed payload") } type recvCompressor interface { RecvCompress() string } // For the two compressor parameters, both should not be set, but if they are, // dc takes precedence over compressor. // TODO(dfawley): wrap the old compressor/decompressor using the new API? func recv(p *parser, c baseCodec, s recvCompressor, dc Decompressor, m any, maxReceiveMessageSize int, payInfo *payloadInfo, compressor encoding.Compressor, isServer bool) error { data, err := recvAndDecompress(p, s, dc, maxReceiveMessageSize, payInfo, compressor, isServer) if err != nil { return err } // If the codec wants its own reference to the data, it can get it. Otherwise, always // free the buffers. defer data.Free() if err := c.Unmarshal(data, m); err != nil { return status.Errorf(codes.Internal, "grpc: failed to unmarshal the received message: %v", err) } return nil } // Information about RPC type rpcInfo struct { failfast bool preloaderInfo compressorInfo } // Information about Preloader // Responsible for storing codec, and compressors // If stream (s) has context s.Context which stores rpcInfo that has non nil // pointers to codec, and compressors, then we can use preparedMsg for Async message prep // and reuse marshalled bytes type compressorInfo struct { codec baseCodec cp Compressor comp encoding.Compressor } type rpcInfoContextKey struct{} func newContextWithRPCInfo(ctx context.Context, failfast bool, codec baseCodec, cp Compressor, comp encoding.Compressor) context.Context { return context.WithValue(ctx, rpcInfoContextKey{}, &rpcInfo{ failfast: failfast, preloaderInfo: compressorInfo{ codec: codec, cp: cp, comp: comp, }, }) } func rpcInfoFromContext(ctx context.Context) (s *rpcInfo, ok bool) { s, ok = ctx.Value(rpcInfoContextKey{}).(*rpcInfo) return } // Code returns the error code for err if it was produced by the rpc system. // Otherwise, it returns codes.Unknown. // // Deprecated: use status.Code instead. func Code(err error) codes.Code { return status.Code(err) } // ErrorDesc returns the error description of err if it was produced by the rpc system. // Otherwise, it returns err.Error() or empty string when err is nil. // // Deprecated: use status.Convert and Message method instead. func ErrorDesc(err error) string { return status.Convert(err).Message() } // Errorf returns an error containing an error code and a description; // Errorf returns nil if c is OK. // // Deprecated: use status.Errorf instead. func Errorf(c codes.Code, format string, a ...any) error { return status.Errorf(c, format, a...) } var errContextCanceled = status.Error(codes.Canceled, context.Canceled.Error()) var errContextDeadline = status.Error(codes.DeadlineExceeded, context.DeadlineExceeded.Error()) // toRPCErr converts an error into an error from the status package. func toRPCErr(err error) error { switch err { case nil, io.EOF: return err case context.DeadlineExceeded: return errContextDeadline case context.Canceled: return errContextCanceled case io.ErrUnexpectedEOF: return status.Error(codes.Internal, err.Error()) } switch e := err.(type) { case transport.ConnectionError: return status.Error(codes.Unavailable, e.Desc) case *transport.NewStreamError: return toRPCErr(e.Err) } if _, ok := status.FromError(err); ok { return err } return status.Error(codes.Unknown, err.Error()) } // setCallInfoCodec should only be called after CallOptions have been applied. func setCallInfoCodec(c *callInfo) error { if c.codec != nil { // codec was already set by a CallOption; use it, but set the content // subtype if it is not set. if c.contentSubtype == "" { // c.codec is a baseCodec to hide the difference between grpc.Codec and // encoding.Codec (Name vs. String method name). We only support // setting content subtype from encoding.Codec to avoid a behavior // change with the deprecated version. if ec, ok := c.codec.(encoding.CodecV2); ok { c.contentSubtype = strings.ToLower(ec.Name()) } } return nil } if c.contentSubtype == "" { // No codec specified in CallOptions; use proto by default. c.codec = getCodec(proto.Name) return nil } // c.contentSubtype is already lowercased in CallContentSubtype c.codec = getCodec(c.contentSubtype) if c.codec == nil { return status.Errorf(codes.Internal, "no codec registered for content-subtype %s", c.contentSubtype) } return nil } // The SupportPackageIsVersion variables are referenced from generated protocol // buffer files to ensure compatibility with the gRPC version used. The latest // support package version is 9. // // Older versions are kept for compatibility. // // These constants should not be referenced from any other code. const ( SupportPackageIsVersion3 = true SupportPackageIsVersion4 = true SupportPackageIsVersion5 = true SupportPackageIsVersion6 = true SupportPackageIsVersion7 = true SupportPackageIsVersion8 = true SupportPackageIsVersion9 = true ) const grpcUA = "grpc-go/" + Version ================================================ FILE: vendor/google.golang.org/grpc/server.go ================================================ /* * * Copyright 2014 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package grpc import ( "context" "errors" "fmt" "io" "math" "net" "net/http" "reflect" "runtime" "strings" "sync" "sync/atomic" "time" "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials" "google.golang.org/grpc/encoding" "google.golang.org/grpc/encoding/proto" estats "google.golang.org/grpc/experimental/stats" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/internal" "google.golang.org/grpc/internal/binarylog" "google.golang.org/grpc/internal/channelz" "google.golang.org/grpc/internal/grpcsync" "google.golang.org/grpc/internal/grpcutil" istats "google.golang.org/grpc/internal/stats" "google.golang.org/grpc/internal/transport" "google.golang.org/grpc/keepalive" "google.golang.org/grpc/mem" "google.golang.org/grpc/metadata" "google.golang.org/grpc/peer" "google.golang.org/grpc/stats" "google.golang.org/grpc/status" "google.golang.org/grpc/tap" ) const ( defaultServerMaxReceiveMessageSize = 1024 * 1024 * 4 defaultServerMaxSendMessageSize = math.MaxInt32 // Server transports are tracked in a map which is keyed on listener // address. For regular gRPC traffic, connections are accepted in Serve() // through a call to Accept(), and we use the actual listener address as key // when we add it to the map. But for connections received through // ServeHTTP(), we do not have a listener and hence use this dummy value. listenerAddressForServeHTTP = "listenerAddressForServeHTTP" ) func init() { internal.GetServerCredentials = func(srv *Server) credentials.TransportCredentials { return srv.opts.creds } internal.IsRegisteredMethod = func(srv *Server, method string) bool { return srv.isRegisteredMethod(method) } internal.ServerFromContext = serverFromContext internal.AddGlobalServerOptions = func(opt ...ServerOption) { globalServerOptions = append(globalServerOptions, opt...) } internal.ClearGlobalServerOptions = func() { globalServerOptions = nil } internal.BinaryLogger = binaryLogger internal.JoinServerOptions = newJoinServerOption internal.BufferPool = bufferPool internal.MetricsRecorderForServer = func(srv *Server) estats.MetricsRecorder { return istats.NewMetricsRecorderList(srv.opts.statsHandlers) } } var statusOK = status.New(codes.OK, "") var logger = grpclog.Component("core") // MethodHandler is a function type that processes a unary RPC method call. type MethodHandler func(srv any, ctx context.Context, dec func(any) error, interceptor UnaryServerInterceptor) (any, error) // MethodDesc represents an RPC service's method specification. type MethodDesc struct { MethodName string Handler MethodHandler } // ServiceDesc represents an RPC service's specification. type ServiceDesc struct { ServiceName string // The pointer to the service interface. Used to check whether the user // provided implementation satisfies the interface requirements. HandlerType any Methods []MethodDesc Streams []StreamDesc Metadata any } // serviceInfo wraps information about a service. It is very similar to // ServiceDesc and is constructed from it for internal purposes. type serviceInfo struct { // Contains the implementation for the methods in this service. serviceImpl any methods map[string]*MethodDesc streams map[string]*StreamDesc mdata any } // Server is a gRPC server to serve RPC requests. type Server struct { opts serverOptions statsHandler stats.Handler mu sync.Mutex // guards following lis map[net.Listener]bool // conns contains all active server transports. It is a map keyed on a // listener address with the value being the set of active transports // belonging to that listener. conns map[string]map[transport.ServerTransport]bool serve bool drain bool cv *sync.Cond // signaled when connections close for GracefulStop services map[string]*serviceInfo // service name -> service info events traceEventLog quit *grpcsync.Event done *grpcsync.Event channelzRemoveOnce sync.Once serveWG sync.WaitGroup // counts active Serve goroutines for Stop/GracefulStop handlersWG sync.WaitGroup // counts active method handler goroutines channelz *channelz.Server serverWorkerChannel chan func() serverWorkerChannelClose func() } type serverOptions struct { creds credentials.TransportCredentials codec baseCodec cp Compressor dc Decompressor unaryInt UnaryServerInterceptor streamInt StreamServerInterceptor chainUnaryInts []UnaryServerInterceptor chainStreamInts []StreamServerInterceptor binaryLogger binarylog.Logger inTapHandle tap.ServerInHandle statsHandlers []stats.Handler maxConcurrentStreams uint32 maxReceiveMessageSize int maxSendMessageSize int unknownStreamDesc *StreamDesc keepaliveParams keepalive.ServerParameters keepalivePolicy keepalive.EnforcementPolicy initialWindowSize int32 initialConnWindowSize int32 writeBufferSize int readBufferSize int sharedWriteBuffer bool connectionTimeout time.Duration maxHeaderListSize *uint32 headerTableSize *uint32 numServerWorkers uint32 bufferPool mem.BufferPool waitForHandlers bool staticWindowSize bool } var defaultServerOptions = serverOptions{ maxConcurrentStreams: math.MaxUint32, maxReceiveMessageSize: defaultServerMaxReceiveMessageSize, maxSendMessageSize: defaultServerMaxSendMessageSize, connectionTimeout: 120 * time.Second, writeBufferSize: defaultWriteBufSize, readBufferSize: defaultReadBufSize, bufferPool: mem.DefaultBufferPool(), } var globalServerOptions []ServerOption // A ServerOption sets options such as credentials, codec and keepalive parameters, etc. type ServerOption interface { apply(*serverOptions) } // EmptyServerOption does not alter the server configuration. It can be embedded // in another structure to build custom server options. // // # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. type EmptyServerOption struct{} func (EmptyServerOption) apply(*serverOptions) {} // funcServerOption wraps a function that modifies serverOptions into an // implementation of the ServerOption interface. type funcServerOption struct { f func(*serverOptions) } func (fdo *funcServerOption) apply(do *serverOptions) { fdo.f(do) } func newFuncServerOption(f func(*serverOptions)) *funcServerOption { return &funcServerOption{ f: f, } } // joinServerOption provides a way to combine arbitrary number of server // options into one. type joinServerOption struct { opts []ServerOption } func (mdo *joinServerOption) apply(do *serverOptions) { for _, opt := range mdo.opts { opt.apply(do) } } func newJoinServerOption(opts ...ServerOption) ServerOption { return &joinServerOption{opts: opts} } // SharedWriteBuffer allows reusing per-connection transport write buffer. // If this option is set to true every connection will release the buffer after // flushing the data on the wire. // // # Experimental // // Notice: This API is EXPERIMENTAL and may be changed or removed in a // later release. func SharedWriteBuffer(val bool) ServerOption { return newFuncServerOption(func(o *serverOptions) { o.sharedWriteBuffer = val }) } // WriteBufferSize determines how much data can be batched before doing a write // on the wire. The default value for this buffer is 32KB. Zero or negative // values will disable the write buffer such that each write will be on underlying // connection. Note: A Send call may not directly translate to a write. func WriteBufferSize(s int) ServerOption { return newFuncServerOption(func(o *serverOptions) { o.writeBufferSize = s }) } // ReadBufferSize lets you set the size of read buffer, this determines how much // data can be read at most for one read syscall. The default value for this // buffer is 32KB. Zero or negative values will disable read buffer for a // connection so data framer can access the underlying conn directly. func ReadBufferSize(s int) ServerOption { return newFuncServerOption(func(o *serverOptions) { o.readBufferSize = s }) } // InitialWindowSize returns a ServerOption that sets window size for stream. // The lower bound for window size is 64K and any value smaller than that will be ignored. func InitialWindowSize(s int32) ServerOption { return newFuncServerOption(func(o *serverOptions) { o.initialWindowSize = s o.staticWindowSize = true }) } // InitialConnWindowSize returns a ServerOption that sets window size for a connection. // The lower bound for window size is 64K and any value smaller than that will be ignored. func InitialConnWindowSize(s int32) ServerOption { return newFuncServerOption(func(o *serverOptions) { o.initialConnWindowSize = s o.staticWindowSize = true }) } // StaticStreamWindowSize returns a ServerOption to set the initial stream // window size to the value provided and disables dynamic flow control. // The lower bound for window size is 64K and any value smaller than that // will be ignored. func StaticStreamWindowSize(s int32) ServerOption { return newFuncServerOption(func(o *serverOptions) { o.initialWindowSize = s o.staticWindowSize = true }) } // StaticConnWindowSize returns a ServerOption to set the initial connection // window size to the value provided and disables dynamic flow control. // The lower bound for window size is 64K and any value smaller than that // will be ignored. func StaticConnWindowSize(s int32) ServerOption { return newFuncServerOption(func(o *serverOptions) { o.initialConnWindowSize = s o.staticWindowSize = true }) } // KeepaliveParams returns a ServerOption that sets keepalive and max-age parameters for the server. func KeepaliveParams(kp keepalive.ServerParameters) ServerOption { if kp.Time > 0 && kp.Time < internal.KeepaliveMinServerPingTime { logger.Warning("Adjusting keepalive ping interval to minimum period of 1s") kp.Time = internal.KeepaliveMinServerPingTime } return newFuncServerOption(func(o *serverOptions) { o.keepaliveParams = kp }) } // KeepaliveEnforcementPolicy returns a ServerOption that sets keepalive enforcement policy for the server. func KeepaliveEnforcementPolicy(kep keepalive.EnforcementPolicy) ServerOption { return newFuncServerOption(func(o *serverOptions) { o.keepalivePolicy = kep }) } // CustomCodec returns a ServerOption that sets a codec for message marshaling and unmarshaling. // // This will override any lookups by content-subtype for Codecs registered with RegisterCodec. // // Deprecated: register codecs using encoding.RegisterCodec. The server will // automatically use registered codecs based on the incoming requests' headers. // See also // https://github.com/grpc/grpc-go/blob/master/Documentation/encoding.md#using-a-codec. // Will be supported throughout 1.x. func CustomCodec(codec Codec) ServerOption { return newFuncServerOption(func(o *serverOptions) { o.codec = newCodecV0Bridge(codec) }) } // ForceServerCodec returns a ServerOption that sets a codec for message // marshaling and unmarshaling. // // This will override any lookups by content-subtype for Codecs registered // with RegisterCodec. // // See Content-Type on // https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#requests for // more details. Also see the documentation on RegisterCodec and // CallContentSubtype for more details on the interaction between encoding.Codec // and content-subtype. // // This function is provided for advanced users; prefer to register codecs // using encoding.RegisterCodec. // The server will automatically use registered codecs based on the incoming // requests' headers. See also // https://github.com/grpc/grpc-go/blob/master/Documentation/encoding.md#using-a-codec. // Will be supported throughout 1.x. // // # Experimental // // Notice: This API is EXPERIMENTAL and may be changed or removed in a // later release. func ForceServerCodec(codec encoding.Codec) ServerOption { return newFuncServerOption(func(o *serverOptions) { o.codec = newCodecV1Bridge(codec) }) } // ForceServerCodecV2 is the equivalent of ForceServerCodec, but for the new // CodecV2 interface. // // Will be supported throughout 1.x. // // # Experimental // // Notice: This API is EXPERIMENTAL and may be changed or removed in a // later release. func ForceServerCodecV2(codecV2 encoding.CodecV2) ServerOption { return newFuncServerOption(func(o *serverOptions) { o.codec = codecV2 }) } // RPCCompressor returns a ServerOption that sets a compressor for outbound // messages. For backward compatibility, all outbound messages will be sent // using this compressor, regardless of incoming message compression. By // default, server messages will be sent using the same compressor with which // request messages were sent. // // Deprecated: use encoding.RegisterCompressor instead. Will be supported // throughout 1.x. func RPCCompressor(cp Compressor) ServerOption { return newFuncServerOption(func(o *serverOptions) { o.cp = cp }) } // RPCDecompressor returns a ServerOption that sets a decompressor for inbound // messages. It has higher priority than decompressors registered via // encoding.RegisterCompressor. // // Deprecated: use encoding.RegisterCompressor instead. Will be supported // throughout 1.x. func RPCDecompressor(dc Decompressor) ServerOption { return newFuncServerOption(func(o *serverOptions) { o.dc = dc }) } // MaxMsgSize returns a ServerOption to set the max message size in bytes the server can receive. // If this is not set, gRPC uses the default limit. // // Deprecated: use MaxRecvMsgSize instead. Will be supported throughout 1.x. func MaxMsgSize(m int) ServerOption { return MaxRecvMsgSize(m) } // MaxRecvMsgSize returns a ServerOption to set the max message size in bytes the server can receive. // If this is not set, gRPC uses the default 4MB. func MaxRecvMsgSize(m int) ServerOption { return newFuncServerOption(func(o *serverOptions) { o.maxReceiveMessageSize = m }) } // MaxSendMsgSize returns a ServerOption to set the max message size in bytes the server can send. // If this is not set, gRPC uses the default `math.MaxInt32`. func MaxSendMsgSize(m int) ServerOption { return newFuncServerOption(func(o *serverOptions) { o.maxSendMessageSize = m }) } // MaxConcurrentStreams returns a ServerOption that will apply a limit on the number // of concurrent streams to each ServerTransport. func MaxConcurrentStreams(n uint32) ServerOption { if n == 0 { n = math.MaxUint32 } return newFuncServerOption(func(o *serverOptions) { o.maxConcurrentStreams = n }) } // Creds returns a ServerOption that sets credentials for server connections. func Creds(c credentials.TransportCredentials) ServerOption { return newFuncServerOption(func(o *serverOptions) { o.creds = c }) } // UnaryInterceptor returns a ServerOption that sets the UnaryServerInterceptor for the // server. Only one unary interceptor can be installed. The construction of multiple // interceptors (e.g., chaining) can be implemented at the caller. func UnaryInterceptor(i UnaryServerInterceptor) ServerOption { return newFuncServerOption(func(o *serverOptions) { if o.unaryInt != nil { panic("The unary server interceptor was already set and may not be reset.") } o.unaryInt = i }) } // ChainUnaryInterceptor returns a ServerOption that specifies the chained interceptor // for unary RPCs. The first interceptor will be the outer most, // while the last interceptor will be the inner most wrapper around the real call. // All unary interceptors added by this method will be chained. func ChainUnaryInterceptor(interceptors ...UnaryServerInterceptor) ServerOption { return newFuncServerOption(func(o *serverOptions) { o.chainUnaryInts = append(o.chainUnaryInts, interceptors...) }) } // StreamInterceptor returns a ServerOption that sets the StreamServerInterceptor for the // server. Only one stream interceptor can be installed. func StreamInterceptor(i StreamServerInterceptor) ServerOption { return newFuncServerOption(func(o *serverOptions) { if o.streamInt != nil { panic("The stream server interceptor was already set and may not be reset.") } o.streamInt = i }) } // ChainStreamInterceptor returns a ServerOption that specifies the chained interceptor // for streaming RPCs. The first interceptor will be the outer most, // while the last interceptor will be the inner most wrapper around the real call. // All stream interceptors added by this method will be chained. func ChainStreamInterceptor(interceptors ...StreamServerInterceptor) ServerOption { return newFuncServerOption(func(o *serverOptions) { o.chainStreamInts = append(o.chainStreamInts, interceptors...) }) } // InTapHandle returns a ServerOption that sets the tap handle for all the server // transport to be created. Only one can be installed. // // # Experimental // // Notice: This API is EXPERIMENTAL and may be changed or removed in a // later release. func InTapHandle(h tap.ServerInHandle) ServerOption { return newFuncServerOption(func(o *serverOptions) { if o.inTapHandle != nil { panic("The tap handle was already set and may not be reset.") } o.inTapHandle = h }) } // StatsHandler returns a ServerOption that sets the stats handler for the server. func StatsHandler(h stats.Handler) ServerOption { return newFuncServerOption(func(o *serverOptions) { if h == nil { logger.Error("ignoring nil parameter in grpc.StatsHandler ServerOption") // Do not allow a nil stats handler, which would otherwise cause // panics. return } o.statsHandlers = append(o.statsHandlers, h) }) } // binaryLogger returns a ServerOption that can set the binary logger for the // server. func binaryLogger(bl binarylog.Logger) ServerOption { return newFuncServerOption(func(o *serverOptions) { o.binaryLogger = bl }) } // UnknownServiceHandler returns a ServerOption that allows for adding a custom // unknown service handler. The provided method is a bidi-streaming RPC service // handler that will be invoked instead of returning the "unimplemented" gRPC // error whenever a request is received for an unregistered service or method. // The handling function and stream interceptor (if set) have full access to // the ServerStream, including its Context. func UnknownServiceHandler(streamHandler StreamHandler) ServerOption { return newFuncServerOption(func(o *serverOptions) { o.unknownStreamDesc = &StreamDesc{ StreamName: "unknown_service_handler", Handler: streamHandler, // We need to assume that the users of the streamHandler will want to use both. ClientStreams: true, ServerStreams: true, } }) } // ConnectionTimeout returns a ServerOption that sets the timeout for // connection establishment (up to and including HTTP/2 handshaking) for all // new connections. If this is not set, the default is 120 seconds. A zero or // negative value will result in an immediate timeout. // // # Experimental // // Notice: This API is EXPERIMENTAL and may be changed or removed in a // later release. func ConnectionTimeout(d time.Duration) ServerOption { return newFuncServerOption(func(o *serverOptions) { o.connectionTimeout = d }) } // MaxHeaderListSizeServerOption is a ServerOption that sets the max // (uncompressed) size of header list that the server is prepared to accept. type MaxHeaderListSizeServerOption struct { MaxHeaderListSize uint32 } func (o MaxHeaderListSizeServerOption) apply(so *serverOptions) { so.maxHeaderListSize = &o.MaxHeaderListSize } // MaxHeaderListSize returns a ServerOption that sets the max (uncompressed) size // of header list that the server is prepared to accept. func MaxHeaderListSize(s uint32) ServerOption { return MaxHeaderListSizeServerOption{ MaxHeaderListSize: s, } } // HeaderTableSize returns a ServerOption that sets the size of dynamic // header table for stream. // // # Experimental // // Notice: This API is EXPERIMENTAL and may be changed or removed in a // later release. func HeaderTableSize(s uint32) ServerOption { return newFuncServerOption(func(o *serverOptions) { o.headerTableSize = &s }) } // NumStreamWorkers returns a ServerOption that sets the number of worker // goroutines that should be used to process incoming streams. Setting this to // zero (default) will disable workers and spawn a new goroutine for each // stream. // // # Experimental // // Notice: This API is EXPERIMENTAL and may be changed or removed in a // later release. func NumStreamWorkers(numServerWorkers uint32) ServerOption { // TODO: If/when this API gets stabilized (i.e. stream workers become the // only way streams are processed), change the behavior of the zero value to // a sane default. Preliminary experiments suggest that a value equal to the // number of CPUs available is most performant; requires thorough testing. return newFuncServerOption(func(o *serverOptions) { o.numServerWorkers = numServerWorkers }) } // WaitForHandlers cause Stop to wait until all outstanding method handlers have // exited before returning. If false, Stop will return as soon as all // connections have closed, but method handlers may still be running. By // default, Stop does not wait for method handlers to return. // // # Experimental // // Notice: This API is EXPERIMENTAL and may be changed or removed in a // later release. func WaitForHandlers(w bool) ServerOption { return newFuncServerOption(func(o *serverOptions) { o.waitForHandlers = w }) } func bufferPool(bufferPool mem.BufferPool) ServerOption { return newFuncServerOption(func(o *serverOptions) { o.bufferPool = bufferPool }) } // serverWorkerResetThreshold defines how often the stack must be reset. Every // N requests, by spawning a new goroutine in its place, a worker can reset its // stack so that large stacks don't live in memory forever. 2^16 should allow // each goroutine stack to live for at least a few seconds in a typical // workload (assuming a QPS of a few thousand requests/sec). const serverWorkerResetThreshold = 1 << 16 // serverWorker blocks on a *transport.ServerStream channel forever and waits // for data to be fed by serveStreams. This allows multiple requests to be // processed by the same goroutine, removing the need for expensive stack // re-allocations (see the runtime.morestack problem [1]). // // [1] https://github.com/golang/go/issues/18138 func (s *Server) serverWorker() { for completed := 0; completed < serverWorkerResetThreshold; completed++ { f, ok := <-s.serverWorkerChannel if !ok { return } f() } go s.serverWorker() } // initServerWorkers creates worker goroutines and a channel to process incoming // connections to reduce the time spent overall on runtime.morestack. func (s *Server) initServerWorkers() { s.serverWorkerChannel = make(chan func()) s.serverWorkerChannelClose = sync.OnceFunc(func() { close(s.serverWorkerChannel) }) for i := uint32(0); i < s.opts.numServerWorkers; i++ { go s.serverWorker() } } // NewServer creates a gRPC server which has no service registered and has not // started to accept requests yet. func NewServer(opt ...ServerOption) *Server { opts := defaultServerOptions for _, o := range globalServerOptions { o.apply(&opts) } for _, o := range opt { o.apply(&opts) } s := &Server{ lis: make(map[net.Listener]bool), opts: opts, statsHandler: istats.NewCombinedHandler(opts.statsHandlers...), conns: make(map[string]map[transport.ServerTransport]bool), services: make(map[string]*serviceInfo), quit: grpcsync.NewEvent(), done: grpcsync.NewEvent(), channelz: channelz.RegisterServer(""), } chainUnaryServerInterceptors(s) chainStreamServerInterceptors(s) s.cv = sync.NewCond(&s.mu) if EnableTracing { _, file, line, _ := runtime.Caller(1) s.events = newTraceEventLog("grpc.Server", fmt.Sprintf("%s:%d", file, line)) } if s.opts.numServerWorkers > 0 { s.initServerWorkers() } channelz.Info(logger, s.channelz, "Server created") return s } // printf records an event in s's event log, unless s has been stopped. // REQUIRES s.mu is held. func (s *Server) printf(format string, a ...any) { if s.events != nil { s.events.Printf(format, a...) } } // errorf records an error in s's event log, unless s has been stopped. // REQUIRES s.mu is held. func (s *Server) errorf(format string, a ...any) { if s.events != nil { s.events.Errorf(format, a...) } } // ServiceRegistrar wraps a single method that supports service registration. It // enables users to pass concrete types other than grpc.Server to the service // registration methods exported by the IDL generated code. type ServiceRegistrar interface { // RegisterService registers a service and its implementation to the // concrete type implementing this interface. It may not be called // once the server has started serving. // desc describes the service and its methods and handlers. impl is the // service implementation which is passed to the method handlers. RegisterService(desc *ServiceDesc, impl any) } // RegisterService registers a service and its implementation to the gRPC // server. It is called from the IDL generated code. This must be called before // invoking Serve. If ss is non-nil (for legacy code), its type is checked to // ensure it implements sd.HandlerType. func (s *Server) RegisterService(sd *ServiceDesc, ss any) { if ss != nil { ht := reflect.TypeOf(sd.HandlerType).Elem() st := reflect.TypeOf(ss) if !st.Implements(ht) { logger.Fatalf("grpc: Server.RegisterService found the handler of type %v that does not satisfy %v", st, ht) } } s.register(sd, ss) } func (s *Server) register(sd *ServiceDesc, ss any) { s.mu.Lock() defer s.mu.Unlock() s.printf("RegisterService(%q)", sd.ServiceName) if s.serve { logger.Fatalf("grpc: Server.RegisterService after Server.Serve for %q", sd.ServiceName) } if _, ok := s.services[sd.ServiceName]; ok { logger.Fatalf("grpc: Server.RegisterService found duplicate service registration for %q", sd.ServiceName) } info := &serviceInfo{ serviceImpl: ss, methods: make(map[string]*MethodDesc), streams: make(map[string]*StreamDesc), mdata: sd.Metadata, } for i := range sd.Methods { d := &sd.Methods[i] info.methods[d.MethodName] = d } for i := range sd.Streams { d := &sd.Streams[i] info.streams[d.StreamName] = d } s.services[sd.ServiceName] = info } // MethodInfo contains the information of an RPC including its method name and type. type MethodInfo struct { // Name is the method name only, without the service name or package name. Name string // IsClientStream indicates whether the RPC is a client streaming RPC. IsClientStream bool // IsServerStream indicates whether the RPC is a server streaming RPC. IsServerStream bool } // ServiceInfo contains unary RPC method info, streaming RPC method info and metadata for a service. type ServiceInfo struct { Methods []MethodInfo // Metadata is the metadata specified in ServiceDesc when registering service. Metadata any } // GetServiceInfo returns a map from service names to ServiceInfo. // Service names include the package names, in the form of .. func (s *Server) GetServiceInfo() map[string]ServiceInfo { ret := make(map[string]ServiceInfo) for n, srv := range s.services { methods := make([]MethodInfo, 0, len(srv.methods)+len(srv.streams)) for m := range srv.methods { methods = append(methods, MethodInfo{ Name: m, IsClientStream: false, IsServerStream: false, }) } for m, d := range srv.streams { methods = append(methods, MethodInfo{ Name: m, IsClientStream: d.ClientStreams, IsServerStream: d.ServerStreams, }) } ret[n] = ServiceInfo{ Methods: methods, Metadata: srv.mdata, } } return ret } // ErrServerStopped indicates that the operation is now illegal because of // the server being stopped. var ErrServerStopped = errors.New("grpc: the server has been stopped") type listenSocket struct { net.Listener channelz *channelz.Socket } func (l *listenSocket) Close() error { err := l.Listener.Close() channelz.RemoveEntry(l.channelz.ID) channelz.Info(logger, l.channelz, "ListenSocket deleted") return err } // Serve accepts incoming connections on the listener lis, creating a new // ServerTransport and service goroutine for each. The service goroutines // read gRPC requests and then call the registered handlers to reply to them. // Serve returns when lis.Accept fails with fatal errors. lis will be closed when // this method returns. // Serve will return a non-nil error unless Stop or GracefulStop is called. // // Note: All supported releases of Go (as of December 2023) override the OS // defaults for TCP keepalive time and interval to 15s. To enable TCP keepalive // with OS defaults for keepalive time and interval, callers need to do the // following two things: // - pass a net.Listener created by calling the Listen method on a // net.ListenConfig with the `KeepAlive` field set to a negative value. This // will result in the Go standard library not overriding OS defaults for TCP // keepalive interval and time. But this will also result in the Go standard // library not enabling TCP keepalives by default. // - override the Accept method on the passed in net.Listener and set the // SO_KEEPALIVE socket option to enable TCP keepalives, with OS defaults. func (s *Server) Serve(lis net.Listener) error { s.mu.Lock() s.printf("serving") s.serve = true if s.lis == nil { // Serve called after Stop or GracefulStop. s.mu.Unlock() lis.Close() return ErrServerStopped } s.serveWG.Add(1) defer func() { s.serveWG.Done() if s.quit.HasFired() { // Stop or GracefulStop called; block until done and return nil. <-s.done.Done() } }() ls := &listenSocket{ Listener: lis, channelz: channelz.RegisterSocket(&channelz.Socket{ SocketType: channelz.SocketTypeListen, Parent: s.channelz, RefName: lis.Addr().String(), LocalAddr: lis.Addr(), SocketOptions: channelz.GetSocketOption(lis)}, ), } s.lis[ls] = true defer func() { s.mu.Lock() if s.lis != nil && s.lis[ls] { ls.Close() delete(s.lis, ls) } s.mu.Unlock() }() s.mu.Unlock() channelz.Info(logger, ls.channelz, "ListenSocket created") var tempDelay time.Duration // how long to sleep on accept failure for { rawConn, err := lis.Accept() if err != nil { if ne, ok := err.(interface { Temporary() bool }); ok && ne.Temporary() { if tempDelay == 0 { tempDelay = 5 * time.Millisecond } else { tempDelay *= 2 } if max := 1 * time.Second; tempDelay > max { tempDelay = max } s.mu.Lock() s.printf("Accept error: %v; retrying in %v", err, tempDelay) s.mu.Unlock() timer := time.NewTimer(tempDelay) select { case <-timer.C: case <-s.quit.Done(): timer.Stop() return nil } continue } s.mu.Lock() s.printf("done serving; Accept = %v", err) s.mu.Unlock() if s.quit.HasFired() { return nil } return err } tempDelay = 0 // Start a new goroutine to deal with rawConn so we don't stall this Accept // loop goroutine. // // Make sure we account for the goroutine so GracefulStop doesn't nil out // s.conns before this conn can be added. s.serveWG.Add(1) go func() { s.handleRawConn(lis.Addr().String(), rawConn) s.serveWG.Done() }() } } // handleRawConn forks a goroutine to handle a just-accepted connection that // has not had any I/O performed on it yet. func (s *Server) handleRawConn(lisAddr string, rawConn net.Conn) { if s.quit.HasFired() { rawConn.Close() return } rawConn.SetDeadline(time.Now().Add(s.opts.connectionTimeout)) // Finish handshaking (HTTP2) st := s.newHTTP2Transport(rawConn) rawConn.SetDeadline(time.Time{}) if st == nil { return } if cc, ok := rawConn.(interface { PassServerTransport(transport.ServerTransport) }); ok { cc.PassServerTransport(st) } if !s.addConn(lisAddr, st) { return } go func() { s.serveStreams(context.Background(), st, rawConn) s.removeConn(lisAddr, st) }() } // newHTTP2Transport sets up a http/2 transport (using the // gRPC http2 server transport in transport/http2_server.go). func (s *Server) newHTTP2Transport(c net.Conn) transport.ServerTransport { config := &transport.ServerConfig{ MaxStreams: s.opts.maxConcurrentStreams, ConnectionTimeout: s.opts.connectionTimeout, Credentials: s.opts.creds, InTapHandle: s.opts.inTapHandle, StatsHandler: s.statsHandler, KeepaliveParams: s.opts.keepaliveParams, KeepalivePolicy: s.opts.keepalivePolicy, InitialWindowSize: s.opts.initialWindowSize, InitialConnWindowSize: s.opts.initialConnWindowSize, WriteBufferSize: s.opts.writeBufferSize, ReadBufferSize: s.opts.readBufferSize, SharedWriteBuffer: s.opts.sharedWriteBuffer, ChannelzParent: s.channelz, MaxHeaderListSize: s.opts.maxHeaderListSize, HeaderTableSize: s.opts.headerTableSize, BufferPool: s.opts.bufferPool, StaticWindowSize: s.opts.staticWindowSize, } st, err := transport.NewServerTransport(c, config) if err != nil { s.mu.Lock() s.errorf("NewServerTransport(%q) failed: %v", c.RemoteAddr(), err) s.mu.Unlock() // ErrConnDispatched means that the connection was dispatched away from // gRPC; those connections should be left open. if err != credentials.ErrConnDispatched { // Don't log on ErrConnDispatched and io.EOF to prevent log spam. if err != io.EOF { channelz.Info(logger, s.channelz, "grpc: Server.Serve failed to create ServerTransport: ", err) } c.Close() } return nil } return st } func (s *Server) serveStreams(ctx context.Context, st transport.ServerTransport, rawConn net.Conn) { ctx = transport.SetConnection(ctx, rawConn) ctx = peer.NewContext(ctx, st.Peer()) if s.statsHandler != nil { ctx = s.statsHandler.TagConn(ctx, &stats.ConnTagInfo{ RemoteAddr: st.Peer().Addr, LocalAddr: st.Peer().LocalAddr, }) s.statsHandler.HandleConn(ctx, &stats.ConnBegin{}) } defer func() { st.Close(errors.New("finished serving streams for the server transport")) if s.statsHandler != nil { s.statsHandler.HandleConn(ctx, &stats.ConnEnd{}) } }() streamQuota := newHandlerQuota(s.opts.maxConcurrentStreams) st.HandleStreams(ctx, func(stream *transport.ServerStream) { s.handlersWG.Add(1) streamQuota.acquire() f := func() { defer streamQuota.release() defer s.handlersWG.Done() s.handleStream(st, stream) } if s.opts.numServerWorkers > 0 { select { case s.serverWorkerChannel <- f: return default: // If all stream workers are busy, fallback to the default code path. } } go f() }) } var _ http.Handler = (*Server)(nil) // ServeHTTP implements the Go standard library's http.Handler // interface by responding to the gRPC request r, by looking up // the requested gRPC method in the gRPC server s. // // The provided HTTP request must have arrived on an HTTP/2 // connection. When using the Go standard library's server, // practically this means that the Request must also have arrived // over TLS. // // To share one port (such as 443 for https) between gRPC and an // existing http.Handler, use a root http.Handler such as: // // if r.ProtoMajor == 2 && strings.HasPrefix( // r.Header.Get("Content-Type"), "application/grpc") { // grpcServer.ServeHTTP(w, r) // } else { // yourMux.ServeHTTP(w, r) // } // // Note that ServeHTTP uses Go's HTTP/2 server implementation which is totally // separate from grpc-go's HTTP/2 server. Performance and features may vary // between the two paths. ServeHTTP does not support some gRPC features // available through grpc-go's HTTP/2 server. // // # Experimental // // Notice: This API is EXPERIMENTAL and may be changed or removed in a // later release. func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { st, err := transport.NewServerHandlerTransport(w, r, s.statsHandler, s.opts.bufferPool) if err != nil { // Errors returned from transport.NewServerHandlerTransport have // already been written to w. return } if !s.addConn(listenerAddressForServeHTTP, st) { return } defer s.removeConn(listenerAddressForServeHTTP, st) s.serveStreams(r.Context(), st, nil) } func (s *Server) addConn(addr string, st transport.ServerTransport) bool { s.mu.Lock() defer s.mu.Unlock() if s.conns == nil { st.Close(errors.New("Server.addConn called when server has already been stopped")) return false } if s.drain { // Transport added after we drained our existing conns: drain it // immediately. st.Drain("") } if s.conns[addr] == nil { // Create a map entry if this is the first connection on this listener. s.conns[addr] = make(map[transport.ServerTransport]bool) } s.conns[addr][st] = true return true } func (s *Server) removeConn(addr string, st transport.ServerTransport) { s.mu.Lock() defer s.mu.Unlock() conns := s.conns[addr] if conns != nil { delete(conns, st) if len(conns) == 0 { // If the last connection for this address is being removed, also // remove the map entry corresponding to the address. This is used // in GracefulStop() when waiting for all connections to be closed. delete(s.conns, addr) } s.cv.Broadcast() } } func (s *Server) incrCallsStarted() { s.channelz.ServerMetrics.CallsStarted.Add(1) s.channelz.ServerMetrics.LastCallStartedTimestamp.Store(time.Now().UnixNano()) } func (s *Server) incrCallsSucceeded() { s.channelz.ServerMetrics.CallsSucceeded.Add(1) } func (s *Server) incrCallsFailed() { s.channelz.ServerMetrics.CallsFailed.Add(1) } func (s *Server) sendResponse(ctx context.Context, stream *transport.ServerStream, msg any, cp Compressor, opts *transport.WriteOptions, comp encoding.Compressor) error { data, err := encode(s.getCodec(stream.ContentSubtype()), msg) if err != nil { channelz.Error(logger, s.channelz, "grpc: server failed to encode response: ", err) return err } compData, pf, err := compress(data, cp, comp, s.opts.bufferPool) if err != nil { data.Free() channelz.Error(logger, s.channelz, "grpc: server failed to compress response: ", err) return err } hdr, payload := msgHeader(data, compData, pf) defer func() { compData.Free() data.Free() // payload does not need to be freed here, it is either data or compData, both of // which are already freed. }() dataLen := data.Len() payloadLen := payload.Len() // TODO(dfawley): should we be checking len(data) instead? if payloadLen > s.opts.maxSendMessageSize { return status.Errorf(codes.ResourceExhausted, "grpc: trying to send message larger than max (%d vs. %d)", payloadLen, s.opts.maxSendMessageSize) } err = stream.Write(hdr, payload, opts) if err == nil && s.statsHandler != nil { s.statsHandler.HandleRPC(ctx, outPayload(false, msg, dataLen, payloadLen, time.Now())) } return err } // chainUnaryServerInterceptors chains all unary server interceptors into one. func chainUnaryServerInterceptors(s *Server) { // Prepend opts.unaryInt to the chaining interceptors if it exists, since unaryInt will // be executed before any other chained interceptors. interceptors := s.opts.chainUnaryInts if s.opts.unaryInt != nil { interceptors = append([]UnaryServerInterceptor{s.opts.unaryInt}, s.opts.chainUnaryInts...) } var chainedInt UnaryServerInterceptor if len(interceptors) == 0 { chainedInt = nil } else if len(interceptors) == 1 { chainedInt = interceptors[0] } else { chainedInt = chainUnaryInterceptors(interceptors) } s.opts.unaryInt = chainedInt } func chainUnaryInterceptors(interceptors []UnaryServerInterceptor) UnaryServerInterceptor { return func(ctx context.Context, req any, info *UnaryServerInfo, handler UnaryHandler) (any, error) { return interceptors[0](ctx, req, info, getChainUnaryHandler(interceptors, 0, info, handler)) } } func getChainUnaryHandler(interceptors []UnaryServerInterceptor, curr int, info *UnaryServerInfo, finalHandler UnaryHandler) UnaryHandler { if curr == len(interceptors)-1 { return finalHandler } return func(ctx context.Context, req any) (any, error) { return interceptors[curr+1](ctx, req, info, getChainUnaryHandler(interceptors, curr+1, info, finalHandler)) } } func (s *Server) processUnaryRPC(ctx context.Context, stream *transport.ServerStream, info *serviceInfo, md *MethodDesc, trInfo *traceInfo) (err error) { sh := s.statsHandler if sh != nil || trInfo != nil || channelz.IsOn() { if channelz.IsOn() { s.incrCallsStarted() } var statsBegin *stats.Begin if sh != nil { statsBegin = &stats.Begin{ BeginTime: time.Now(), IsClientStream: false, IsServerStream: false, } sh.HandleRPC(ctx, statsBegin) } if trInfo != nil { trInfo.tr.LazyLog(&trInfo.firstLine, false) } // The deferred error handling for tracing, stats handler and channelz are // combined into one function to reduce stack usage -- a defer takes ~56-64 // bytes on the stack, so overflowing the stack will require a stack // re-allocation, which is expensive. // // To maintain behavior similar to separate deferred statements, statements // should be executed in the reverse order. That is, tracing first, stats // handler second, and channelz last. Note that panics *within* defers will // lead to different behavior, but that's an acceptable compromise; that // would be undefined behavior territory anyway. defer func() { if trInfo != nil { if err != nil && err != io.EOF { trInfo.tr.LazyLog(&fmtStringer{"%v", []any{err}}, true) trInfo.tr.SetError() } trInfo.tr.Finish() } if sh != nil { end := &stats.End{ BeginTime: statsBegin.BeginTime, EndTime: time.Now(), } if err != nil && err != io.EOF { end.Error = toRPCErr(err) } sh.HandleRPC(ctx, end) } if channelz.IsOn() { if err != nil && err != io.EOF { s.incrCallsFailed() } else { s.incrCallsSucceeded() } } }() } var binlogs []binarylog.MethodLogger if ml := binarylog.GetMethodLogger(stream.Method()); ml != nil { binlogs = append(binlogs, ml) } if s.opts.binaryLogger != nil { if ml := s.opts.binaryLogger.GetMethodLogger(stream.Method()); ml != nil { binlogs = append(binlogs, ml) } } if len(binlogs) != 0 { md, _ := metadata.FromIncomingContext(ctx) logEntry := &binarylog.ClientHeader{ Header: md, MethodName: stream.Method(), PeerAddr: nil, } if deadline, ok := ctx.Deadline(); ok { logEntry.Timeout = time.Until(deadline) if logEntry.Timeout < 0 { logEntry.Timeout = 0 } } if a := md[":authority"]; len(a) > 0 { logEntry.Authority = a[0] } if peer, ok := peer.FromContext(ctx); ok { logEntry.PeerAddr = peer.Addr } for _, binlog := range binlogs { binlog.Log(ctx, logEntry) } } // comp and cp are used for compression. decomp and dc are used for // decompression. If comp and decomp are both set, they are the same; // however they are kept separate to ensure that at most one of the // compressor/decompressor variable pairs are set for use later. var comp, decomp encoding.Compressor var cp Compressor var dc Decompressor var sendCompressorName string // If dc is set and matches the stream's compression, use it. Otherwise, try // to find a matching registered compressor for decomp. if rc := stream.RecvCompress(); s.opts.dc != nil && s.opts.dc.Type() == rc { dc = s.opts.dc } else if rc != "" && rc != encoding.Identity { decomp = encoding.GetCompressor(rc) if decomp == nil { st := status.Newf(codes.Unimplemented, "grpc: Decompressor is not installed for grpc-encoding %q", rc) stream.WriteStatus(st) return st.Err() } } // If cp is set, use it. Otherwise, attempt to compress the response using // the incoming message compression method. // // NOTE: this needs to be ahead of all handling, https://github.com/grpc/grpc-go/issues/686. if s.opts.cp != nil { cp = s.opts.cp sendCompressorName = cp.Type() } else if rc := stream.RecvCompress(); rc != "" && rc != encoding.Identity { // Legacy compressor not specified; attempt to respond with same encoding. comp = encoding.GetCompressor(rc) if comp != nil { sendCompressorName = comp.Name() } } if sendCompressorName != "" { if err := stream.SetSendCompress(sendCompressorName); err != nil { return status.Errorf(codes.Internal, "grpc: failed to set send compressor: %v", err) } } var payInfo *payloadInfo if sh != nil || len(binlogs) != 0 { payInfo = &payloadInfo{} defer payInfo.free() } d, err := recvAndDecompress(&parser{r: stream, bufferPool: s.opts.bufferPool}, stream, dc, s.opts.maxReceiveMessageSize, payInfo, decomp, true) if err != nil { if e := stream.WriteStatus(status.Convert(err)); e != nil { channelz.Warningf(logger, s.channelz, "grpc: Server.processUnaryRPC failed to write status: %v", e) } return err } freed := false dataFree := func() { if !freed { d.Free() freed = true } } defer dataFree() df := func(v any) error { defer dataFree() if err := s.getCodec(stream.ContentSubtype()).Unmarshal(d, v); err != nil { return status.Errorf(codes.Internal, "grpc: error unmarshalling request: %v", err) } if sh != nil { sh.HandleRPC(ctx, &stats.InPayload{ RecvTime: time.Now(), Payload: v, Length: d.Len(), WireLength: payInfo.compressedLength + headerLen, CompressedLength: payInfo.compressedLength, }) } if len(binlogs) != 0 { cm := &binarylog.ClientMessage{ Message: d.Materialize(), } for _, binlog := range binlogs { binlog.Log(ctx, cm) } } if trInfo != nil { trInfo.tr.LazyLog(&payload{sent: false, msg: v}, true) } return nil } ctx = NewContextWithServerTransportStream(ctx, stream) reply, appErr := md.Handler(info.serviceImpl, ctx, df, s.opts.unaryInt) if appErr != nil { appStatus, ok := status.FromError(appErr) if !ok { // Convert non-status application error to a status error with code // Unknown, but handle context errors specifically. appStatus = status.FromContextError(appErr) appErr = appStatus.Err() } if trInfo != nil { trInfo.tr.LazyLog(stringer(appStatus.Message()), true) trInfo.tr.SetError() } if e := stream.WriteStatus(appStatus); e != nil { channelz.Warningf(logger, s.channelz, "grpc: Server.processUnaryRPC failed to write status: %v", e) } if len(binlogs) != 0 { if h, _ := stream.Header(); h.Len() > 0 { // Only log serverHeader if there was header. Otherwise it can // be trailer only. sh := &binarylog.ServerHeader{ Header: h, } for _, binlog := range binlogs { binlog.Log(ctx, sh) } } st := &binarylog.ServerTrailer{ Trailer: stream.Trailer(), Err: appErr, } for _, binlog := range binlogs { binlog.Log(ctx, st) } } return appErr } if trInfo != nil { trInfo.tr.LazyLog(stringer("OK"), false) } opts := &transport.WriteOptions{Last: true} // Server handler could have set new compressor by calling SetSendCompressor. // In case it is set, we need to use it for compressing outbound message. if stream.SendCompress() != sendCompressorName { comp = encoding.GetCompressor(stream.SendCompress()) } if err := s.sendResponse(ctx, stream, reply, cp, opts, comp); err != nil { if err == io.EOF { // The entire stream is done (for unary RPC only). return err } if sts, ok := status.FromError(err); ok { if e := stream.WriteStatus(sts); e != nil { channelz.Warningf(logger, s.channelz, "grpc: Server.processUnaryRPC failed to write status: %v", e) } } else { switch st := err.(type) { case transport.ConnectionError: // Nothing to do here. default: panic(fmt.Sprintf("grpc: Unexpected error (%T) from sendResponse: %v", st, st)) } } if len(binlogs) != 0 { h, _ := stream.Header() sh := &binarylog.ServerHeader{ Header: h, } st := &binarylog.ServerTrailer{ Trailer: stream.Trailer(), Err: appErr, } for _, binlog := range binlogs { binlog.Log(ctx, sh) binlog.Log(ctx, st) } } return err } if len(binlogs) != 0 { h, _ := stream.Header() sh := &binarylog.ServerHeader{ Header: h, } sm := &binarylog.ServerMessage{ Message: reply, } for _, binlog := range binlogs { binlog.Log(ctx, sh) binlog.Log(ctx, sm) } } if trInfo != nil { trInfo.tr.LazyLog(&payload{sent: true, msg: reply}, true) } // TODO: Should we be logging if writing status failed here, like above? // Should the logging be in WriteStatus? Should we ignore the WriteStatus // error or allow the stats handler to see it? if len(binlogs) != 0 { st := &binarylog.ServerTrailer{ Trailer: stream.Trailer(), Err: appErr, } for _, binlog := range binlogs { binlog.Log(ctx, st) } } return stream.WriteStatus(statusOK) } // chainStreamServerInterceptors chains all stream server interceptors into one. func chainStreamServerInterceptors(s *Server) { // Prepend opts.streamInt to the chaining interceptors if it exists, since streamInt will // be executed before any other chained interceptors. interceptors := s.opts.chainStreamInts if s.opts.streamInt != nil { interceptors = append([]StreamServerInterceptor{s.opts.streamInt}, s.opts.chainStreamInts...) } var chainedInt StreamServerInterceptor if len(interceptors) == 0 { chainedInt = nil } else if len(interceptors) == 1 { chainedInt = interceptors[0] } else { chainedInt = chainStreamInterceptors(interceptors) } s.opts.streamInt = chainedInt } func chainStreamInterceptors(interceptors []StreamServerInterceptor) StreamServerInterceptor { return func(srv any, ss ServerStream, info *StreamServerInfo, handler StreamHandler) error { return interceptors[0](srv, ss, info, getChainStreamHandler(interceptors, 0, info, handler)) } } func getChainStreamHandler(interceptors []StreamServerInterceptor, curr int, info *StreamServerInfo, finalHandler StreamHandler) StreamHandler { if curr == len(interceptors)-1 { return finalHandler } return func(srv any, stream ServerStream) error { return interceptors[curr+1](srv, stream, info, getChainStreamHandler(interceptors, curr+1, info, finalHandler)) } } func (s *Server) processStreamingRPC(ctx context.Context, stream *transport.ServerStream, info *serviceInfo, sd *StreamDesc, trInfo *traceInfo) (err error) { if channelz.IsOn() { s.incrCallsStarted() } sh := s.statsHandler var statsBegin *stats.Begin if sh != nil { statsBegin = &stats.Begin{ BeginTime: time.Now(), IsClientStream: sd.ClientStreams, IsServerStream: sd.ServerStreams, } sh.HandleRPC(ctx, statsBegin) } ctx = NewContextWithServerTransportStream(ctx, stream) ss := &serverStream{ ctx: ctx, s: stream, p: parser{r: stream, bufferPool: s.opts.bufferPool}, codec: s.getCodec(stream.ContentSubtype()), desc: sd, maxReceiveMessageSize: s.opts.maxReceiveMessageSize, maxSendMessageSize: s.opts.maxSendMessageSize, trInfo: trInfo, statsHandler: sh, } if sh != nil || trInfo != nil || channelz.IsOn() { // See comment in processUnaryRPC on defers. defer func() { if trInfo != nil { ss.mu.Lock() if err != nil && err != io.EOF { ss.trInfo.tr.LazyLog(&fmtStringer{"%v", []any{err}}, true) ss.trInfo.tr.SetError() } ss.trInfo.tr.Finish() ss.trInfo.tr = nil ss.mu.Unlock() } if sh != nil { end := &stats.End{ BeginTime: statsBegin.BeginTime, EndTime: time.Now(), } if err != nil && err != io.EOF { end.Error = toRPCErr(err) } sh.HandleRPC(ctx, end) } if channelz.IsOn() { if err != nil && err != io.EOF { s.incrCallsFailed() } else { s.incrCallsSucceeded() } } }() } if ml := binarylog.GetMethodLogger(stream.Method()); ml != nil { ss.binlogs = append(ss.binlogs, ml) } if s.opts.binaryLogger != nil { if ml := s.opts.binaryLogger.GetMethodLogger(stream.Method()); ml != nil { ss.binlogs = append(ss.binlogs, ml) } } if len(ss.binlogs) != 0 { md, _ := metadata.FromIncomingContext(ctx) logEntry := &binarylog.ClientHeader{ Header: md, MethodName: stream.Method(), PeerAddr: nil, } if deadline, ok := ctx.Deadline(); ok { logEntry.Timeout = time.Until(deadline) if logEntry.Timeout < 0 { logEntry.Timeout = 0 } } if a := md[":authority"]; len(a) > 0 { logEntry.Authority = a[0] } if peer, ok := peer.FromContext(ss.Context()); ok { logEntry.PeerAddr = peer.Addr } for _, binlog := range ss.binlogs { binlog.Log(ctx, logEntry) } } // If dc is set and matches the stream's compression, use it. Otherwise, try // to find a matching registered compressor for decomp. if rc := stream.RecvCompress(); s.opts.dc != nil && s.opts.dc.Type() == rc { ss.decompressorV0 = s.opts.dc } else if rc != "" && rc != encoding.Identity { ss.decompressorV1 = encoding.GetCompressor(rc) if ss.decompressorV1 == nil { st := status.Newf(codes.Unimplemented, "grpc: Decompressor is not installed for grpc-encoding %q", rc) ss.s.WriteStatus(st) return st.Err() } } // If cp is set, use it. Otherwise, attempt to compress the response using // the incoming message compression method. // // NOTE: this needs to be ahead of all handling, https://github.com/grpc/grpc-go/issues/686. if s.opts.cp != nil { ss.compressorV0 = s.opts.cp ss.sendCompressorName = s.opts.cp.Type() } else if rc := stream.RecvCompress(); rc != "" && rc != encoding.Identity { // Legacy compressor not specified; attempt to respond with same encoding. ss.compressorV1 = encoding.GetCompressor(rc) if ss.compressorV1 != nil { ss.sendCompressorName = rc } } if ss.sendCompressorName != "" { if err := stream.SetSendCompress(ss.sendCompressorName); err != nil { return status.Errorf(codes.Internal, "grpc: failed to set send compressor: %v", err) } } ss.ctx = newContextWithRPCInfo(ss.ctx, false, ss.codec, ss.compressorV0, ss.compressorV1) if trInfo != nil { trInfo.tr.LazyLog(&trInfo.firstLine, false) } var appErr error var server any if info != nil { server = info.serviceImpl } if s.opts.streamInt == nil { appErr = sd.Handler(server, ss) } else { info := &StreamServerInfo{ FullMethod: stream.Method(), IsClientStream: sd.ClientStreams, IsServerStream: sd.ServerStreams, } appErr = s.opts.streamInt(server, ss, info, sd.Handler) } if appErr != nil { appStatus, ok := status.FromError(appErr) if !ok { // Convert non-status application error to a status error with code // Unknown, but handle context errors specifically. appStatus = status.FromContextError(appErr) appErr = appStatus.Err() } if trInfo != nil { ss.mu.Lock() ss.trInfo.tr.LazyLog(stringer(appStatus.Message()), true) ss.trInfo.tr.SetError() ss.mu.Unlock() } if len(ss.binlogs) != 0 { st := &binarylog.ServerTrailer{ Trailer: ss.s.Trailer(), Err: appErr, } for _, binlog := range ss.binlogs { binlog.Log(ctx, st) } } ss.s.WriteStatus(appStatus) // TODO: Should we log an error from WriteStatus here and below? return appErr } if trInfo != nil { ss.mu.Lock() ss.trInfo.tr.LazyLog(stringer("OK"), false) ss.mu.Unlock() } if len(ss.binlogs) != 0 { st := &binarylog.ServerTrailer{ Trailer: ss.s.Trailer(), Err: appErr, } for _, binlog := range ss.binlogs { binlog.Log(ctx, st) } } return ss.s.WriteStatus(statusOK) } func (s *Server) handleStream(t transport.ServerTransport, stream *transport.ServerStream) { ctx := stream.Context() ctx = contextWithServer(ctx, s) var ti *traceInfo if EnableTracing { tr := newTrace("grpc.Recv."+methodFamily(stream.Method()), stream.Method()) ctx = newTraceContext(ctx, tr) ti = &traceInfo{ tr: tr, firstLine: firstLine{ client: false, remoteAddr: t.Peer().Addr, }, } if dl, ok := ctx.Deadline(); ok { ti.firstLine.deadline = time.Until(dl) } } sm := stream.Method() if sm != "" && sm[0] == '/' { sm = sm[1:] } pos := strings.LastIndex(sm, "/") if pos == -1 { if ti != nil { ti.tr.LazyLog(&fmtStringer{"Malformed method name %q", []any{sm}}, true) ti.tr.SetError() } errDesc := fmt.Sprintf("malformed method name: %q", stream.Method()) if err := stream.WriteStatus(status.New(codes.Unimplemented, errDesc)); err != nil { if ti != nil { ti.tr.LazyLog(&fmtStringer{"%v", []any{err}}, true) ti.tr.SetError() } channelz.Warningf(logger, s.channelz, "grpc: Server.handleStream failed to write status: %v", err) } if ti != nil { ti.tr.Finish() } return } service := sm[:pos] method := sm[pos+1:] // FromIncomingContext is expensive: skip if there are no statsHandlers if s.statsHandler != nil { md, _ := metadata.FromIncomingContext(ctx) ctx = s.statsHandler.TagRPC(ctx, &stats.RPCTagInfo{FullMethodName: stream.Method()}) s.statsHandler.HandleRPC(ctx, &stats.InHeader{ FullMethod: stream.Method(), RemoteAddr: t.Peer().Addr, LocalAddr: t.Peer().LocalAddr, Compression: stream.RecvCompress(), WireLength: stream.HeaderWireLength(), Header: md, }) } // To have calls in stream callouts work. Will delete once all stats handler // calls come from the gRPC layer. stream.SetContext(ctx) srv, knownService := s.services[service] if knownService { if md, ok := srv.methods[method]; ok { s.processUnaryRPC(ctx, stream, srv, md, ti) return } if sd, ok := srv.streams[method]; ok { s.processStreamingRPC(ctx, stream, srv, sd, ti) return } } // Unknown service, or known server unknown method. if unknownDesc := s.opts.unknownStreamDesc; unknownDesc != nil { s.processStreamingRPC(ctx, stream, nil, unknownDesc, ti) return } var errDesc string if !knownService { errDesc = fmt.Sprintf("unknown service %v", service) } else { errDesc = fmt.Sprintf("unknown method %v for service %v", method, service) } if ti != nil { ti.tr.LazyPrintf("%s", errDesc) ti.tr.SetError() } if err := stream.WriteStatus(status.New(codes.Unimplemented, errDesc)); err != nil { if ti != nil { ti.tr.LazyLog(&fmtStringer{"%v", []any{err}}, true) ti.tr.SetError() } channelz.Warningf(logger, s.channelz, "grpc: Server.handleStream failed to write status: %v", err) } if ti != nil { ti.tr.Finish() } } // The key to save ServerTransportStream in the context. type streamKey struct{} // NewContextWithServerTransportStream creates a new context from ctx and // attaches stream to it. // // # Experimental // // Notice: This API is EXPERIMENTAL and may be changed or removed in a // later release. func NewContextWithServerTransportStream(ctx context.Context, stream ServerTransportStream) context.Context { return context.WithValue(ctx, streamKey{}, stream) } // ServerTransportStream is a minimal interface that a transport stream must // implement. This can be used to mock an actual transport stream for tests of // handler code that use, for example, grpc.SetHeader (which requires some // stream to be in context). // // See also NewContextWithServerTransportStream. // // # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. type ServerTransportStream interface { Method() string SetHeader(md metadata.MD) error SendHeader(md metadata.MD) error SetTrailer(md metadata.MD) error } // ServerTransportStreamFromContext returns the ServerTransportStream saved in // ctx. Returns nil if the given context has no stream associated with it // (which implies it is not an RPC invocation context). // // # Experimental // // Notice: This API is EXPERIMENTAL and may be changed or removed in a // later release. func ServerTransportStreamFromContext(ctx context.Context) ServerTransportStream { s, _ := ctx.Value(streamKey{}).(ServerTransportStream) return s } // Stop stops the gRPC server. It immediately closes all open // connections and listeners. // It cancels all active RPCs on the server side and the corresponding // pending RPCs on the client side will get notified by connection // errors. func (s *Server) Stop() { s.stop(false) } // GracefulStop stops the gRPC server gracefully. It stops the server from // accepting new connections and RPCs and blocks until all the pending RPCs are // finished. func (s *Server) GracefulStop() { s.stop(true) } func (s *Server) stop(graceful bool) { s.quit.Fire() defer s.done.Fire() s.channelzRemoveOnce.Do(func() { channelz.RemoveEntry(s.channelz.ID) }) s.mu.Lock() s.closeListenersLocked() // Wait for serving threads to be ready to exit. Only then can we be sure no // new conns will be created. s.mu.Unlock() s.serveWG.Wait() s.mu.Lock() defer s.mu.Unlock() if graceful { s.drainAllServerTransportsLocked() } else { s.closeServerTransportsLocked() } for len(s.conns) != 0 { s.cv.Wait() } s.conns = nil if s.opts.numServerWorkers > 0 { // Closing the channel (only once, via sync.OnceFunc) after all the // connections have been closed above ensures that there are no // goroutines executing the callback passed to st.HandleStreams (where // the channel is written to). s.serverWorkerChannelClose() } if graceful || s.opts.waitForHandlers { s.handlersWG.Wait() } if s.events != nil { s.events.Finish() s.events = nil } } // s.mu must be held by the caller. func (s *Server) closeServerTransportsLocked() { for _, conns := range s.conns { for st := range conns { st.Close(errors.New("Server.Stop called")) } } } // s.mu must be held by the caller. func (s *Server) drainAllServerTransportsLocked() { if !s.drain { for _, conns := range s.conns { for st := range conns { st.Drain("graceful_stop") } } s.drain = true } } // s.mu must be held by the caller. func (s *Server) closeListenersLocked() { for lis := range s.lis { lis.Close() } s.lis = nil } // contentSubtype must be lowercase // cannot return nil func (s *Server) getCodec(contentSubtype string) baseCodec { if s.opts.codec != nil { return s.opts.codec } if contentSubtype == "" { return getCodec(proto.Name) } codec := getCodec(contentSubtype) if codec == nil { logger.Warningf("Unsupported codec %q. Defaulting to %q for now. This will start to fail in future releases.", contentSubtype, proto.Name) return getCodec(proto.Name) } return codec } type serverKey struct{} // serverFromContext gets the Server from the context. func serverFromContext(ctx context.Context) *Server { s, _ := ctx.Value(serverKey{}).(*Server) return s } // contextWithServer sets the Server in the context. func contextWithServer(ctx context.Context, server *Server) context.Context { return context.WithValue(ctx, serverKey{}, server) } // isRegisteredMethod returns whether the passed in method is registered as a // method on the server. /service/method and service/method will match if the // service and method are registered on the server. func (s *Server) isRegisteredMethod(serviceMethod string) bool { if serviceMethod != "" && serviceMethod[0] == '/' { serviceMethod = serviceMethod[1:] } pos := strings.LastIndex(serviceMethod, "/") if pos == -1 { // Invalid method name syntax. return false } service := serviceMethod[:pos] method := serviceMethod[pos+1:] srv, knownService := s.services[service] if knownService { if _, ok := srv.methods[method]; ok { return true } if _, ok := srv.streams[method]; ok { return true } } return false } // SetHeader sets the header metadata to be sent from the server to the client. // The context provided must be the context passed to the server's handler. // // Streaming RPCs should prefer the SetHeader method of the ServerStream. // // When called multiple times, all the provided metadata will be merged. All // the metadata will be sent out when one of the following happens: // // - grpc.SendHeader is called, or for streaming handlers, stream.SendHeader. // - The first response message is sent. For unary handlers, this occurs when // the handler returns; for streaming handlers, this can happen when stream's // SendMsg method is called. // - An RPC status is sent out (error or success). This occurs when the handler // returns. // // SetHeader will fail if called after any of the events above. // // The error returned is compatible with the status package. However, the // status code will often not match the RPC status as seen by the client // application, and therefore, should not be relied upon for this purpose. func SetHeader(ctx context.Context, md metadata.MD) error { if md.Len() == 0 { return nil } stream := ServerTransportStreamFromContext(ctx) if stream == nil { return status.Errorf(codes.Internal, "grpc: failed to fetch the stream from the context %v", ctx) } return stream.SetHeader(md) } // SendHeader sends header metadata. It may be called at most once, and may not // be called after any event that causes headers to be sent (see SetHeader for // a complete list). The provided md and headers set by SetHeader() will be // sent. // // The error returned is compatible with the status package. However, the // status code will often not match the RPC status as seen by the client // application, and therefore, should not be relied upon for this purpose. func SendHeader(ctx context.Context, md metadata.MD) error { stream := ServerTransportStreamFromContext(ctx) if stream == nil { return status.Errorf(codes.Internal, "grpc: failed to fetch the stream from the context %v", ctx) } if err := stream.SendHeader(md); err != nil { return toRPCErr(err) } return nil } // SetSendCompressor sets a compressor for outbound messages from the server. // It must not be called after any event that causes headers to be sent // (see ServerStream.SetHeader for the complete list). Provided compressor is // used when below conditions are met: // // - compressor is registered via encoding.RegisterCompressor // - compressor name must exist in the client advertised compressor names // sent in grpc-accept-encoding header. Use ClientSupportedCompressors to // get client supported compressor names. // // The context provided must be the context passed to the server's handler. // It must be noted that compressor name encoding.Identity disables the // outbound compression. // By default, server messages will be sent using the same compressor with // which request messages were sent. // // It is not safe to call SetSendCompressor concurrently with SendHeader and // SendMsg. // // # Experimental // // Notice: This function is EXPERIMENTAL and may be changed or removed in a // later release. func SetSendCompressor(ctx context.Context, name string) error { stream, ok := ServerTransportStreamFromContext(ctx).(*transport.ServerStream) if !ok || stream == nil { return fmt.Errorf("failed to fetch the stream from the given context") } if err := validateSendCompressor(name, stream.ClientAdvertisedCompressors()); err != nil { return fmt.Errorf("unable to set send compressor: %w", err) } return stream.SetSendCompress(name) } // ClientSupportedCompressors returns compressor names advertised by the client // via grpc-accept-encoding header. // // The context provided must be the context passed to the server's handler. // // # Experimental // // Notice: This function is EXPERIMENTAL and may be changed or removed in a // later release. func ClientSupportedCompressors(ctx context.Context) ([]string, error) { stream, ok := ServerTransportStreamFromContext(ctx).(*transport.ServerStream) if !ok || stream == nil { return nil, fmt.Errorf("failed to fetch the stream from the given context %v", ctx) } return stream.ClientAdvertisedCompressors(), nil } // SetTrailer sets the trailer metadata that will be sent when an RPC returns. // When called more than once, all the provided metadata will be merged. // // The error returned is compatible with the status package. However, the // status code will often not match the RPC status as seen by the client // application, and therefore, should not be relied upon for this purpose. func SetTrailer(ctx context.Context, md metadata.MD) error { if md.Len() == 0 { return nil } stream := ServerTransportStreamFromContext(ctx) if stream == nil { return status.Errorf(codes.Internal, "grpc: failed to fetch the stream from the context %v", ctx) } return stream.SetTrailer(md) } // Method returns the method string for the server context. The returned // string is in the format of "/service/method". func Method(ctx context.Context) (string, bool) { s := ServerTransportStreamFromContext(ctx) if s == nil { return "", false } return s.Method(), true } // validateSendCompressor returns an error when given compressor name cannot be // handled by the server or the client based on the advertised compressors. func validateSendCompressor(name string, clientCompressors []string) error { if name == encoding.Identity { return nil } if !grpcutil.IsCompressorNameRegistered(name) { return fmt.Errorf("compressor not registered %q", name) } for _, c := range clientCompressors { if c == name { return nil // found match } } return fmt.Errorf("client does not support compressor %q", name) } // atomicSemaphore implements a blocking, counting semaphore. acquire should be // called synchronously; release may be called asynchronously. type atomicSemaphore struct { n atomic.Int64 wait chan struct{} } func (q *atomicSemaphore) acquire() { if q.n.Add(-1) < 0 { // We ran out of quota. Block until a release happens. <-q.wait } } func (q *atomicSemaphore) release() { // N.B. the "<= 0" check below should allow for this to work with multiple // concurrent calls to acquire, but also note that with synchronous calls to // acquire, as our system does, n will never be less than -1. There are // fairness issues (queuing) to consider if this was to be generalized. if q.n.Add(1) <= 0 { // An acquire was waiting on us. Unblock it. q.wait <- struct{}{} } } func newHandlerQuota(n uint32) *atomicSemaphore { a := &atomicSemaphore{wait: make(chan struct{}, 1)} a.n.Store(int64(n)) return a } ================================================ FILE: vendor/google.golang.org/grpc/service_config.go ================================================ /* * * Copyright 2017 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package grpc import ( "encoding/json" "errors" "fmt" "reflect" "time" "google.golang.org/grpc/balancer" "google.golang.org/grpc/balancer/pickfirst" "google.golang.org/grpc/codes" "google.golang.org/grpc/internal" "google.golang.org/grpc/internal/balancer/gracefulswitch" internalserviceconfig "google.golang.org/grpc/internal/serviceconfig" "google.golang.org/grpc/serviceconfig" ) const maxInt = int(^uint(0) >> 1) // MethodConfig defines the configuration recommended by the service providers for a // particular method. // // Deprecated: Users should not use this struct. Service config should be received // through name resolver, as specified here // https://github.com/grpc/grpc/blob/master/doc/service_config.md type MethodConfig = internalserviceconfig.MethodConfig // ServiceConfig is provided by the service provider and contains parameters for how // clients that connect to the service should behave. // // Deprecated: Users should not use this struct. Service config should be received // through name resolver, as specified here // https://github.com/grpc/grpc/blob/master/doc/service_config.md type ServiceConfig struct { serviceconfig.Config // lbConfig is the service config's load balancing configuration. If // lbConfig and LB are both present, lbConfig will be used. lbConfig serviceconfig.LoadBalancingConfig // Methods contains a map for the methods in this service. If there is an // exact match for a method (i.e. /service/method) in the map, use the // corresponding MethodConfig. If there's no exact match, look for the // default config for the service (/service/) and use the corresponding // MethodConfig if it exists. Otherwise, the method has no MethodConfig to // use. Methods map[string]MethodConfig // If a retryThrottlingPolicy is provided, gRPC will automatically throttle // retry attempts and hedged RPCs when the client’s ratio of failures to // successes exceeds a threshold. // // For each server name, the gRPC client will maintain a token_count which is // initially set to maxTokens, and can take values between 0 and maxTokens. // // Every outgoing RPC (regardless of service or method invoked) will change // token_count as follows: // // - Every failed RPC will decrement the token_count by 1. // - Every successful RPC will increment the token_count by tokenRatio. // // If token_count is less than or equal to maxTokens / 2, then RPCs will not // be retried and hedged RPCs will not be sent. retryThrottling *retryThrottlingPolicy // healthCheckConfig must be set as one of the requirement to enable LB channel // health check. healthCheckConfig *healthCheckConfig // rawJSONString stores service config json string that get parsed into // this service config struct. rawJSONString string } // healthCheckConfig defines the go-native version of the LB channel health check config. type healthCheckConfig struct { // serviceName is the service name to use in the health-checking request. ServiceName string } type jsonRetryPolicy struct { MaxAttempts int InitialBackoff internalserviceconfig.Duration MaxBackoff internalserviceconfig.Duration BackoffMultiplier float64 RetryableStatusCodes []codes.Code } // retryThrottlingPolicy defines the go-native version of the retry throttling // policy defined by the service config here: // https://github.com/grpc/proposal/blob/master/A6-client-retries.md#integration-with-service-config type retryThrottlingPolicy struct { // The number of tokens starts at maxTokens. The token_count will always be // between 0 and maxTokens. // // This field is required and must be greater than zero. MaxTokens float64 // The amount of tokens to add on each successful RPC. Typically this will // be some number between 0 and 1, e.g., 0.1. // // This field is required and must be greater than zero. Up to 3 decimal // places are supported. TokenRatio float64 } type jsonName struct { Service string Method string } var ( errDuplicatedName = errors.New("duplicated name") errEmptyServiceNonEmptyMethod = errors.New("cannot combine empty 'service' and non-empty 'method'") ) func (j jsonName) generatePath() (string, error) { if j.Service == "" { if j.Method != "" { return "", errEmptyServiceNonEmptyMethod } return "", nil } res := "/" + j.Service + "/" if j.Method != "" { res += j.Method } return res, nil } // TODO(lyuxuan): delete this struct after cleaning up old service config implementation. type jsonMC struct { Name *[]jsonName WaitForReady *bool Timeout *internalserviceconfig.Duration MaxRequestMessageBytes *int64 MaxResponseMessageBytes *int64 RetryPolicy *jsonRetryPolicy } // TODO(lyuxuan): delete this struct after cleaning up old service config implementation. type jsonSC struct { LoadBalancingPolicy *string LoadBalancingConfig *json.RawMessage MethodConfig *[]jsonMC RetryThrottling *retryThrottlingPolicy HealthCheckConfig *healthCheckConfig } func init() { internal.ParseServiceConfig = func(js string) *serviceconfig.ParseResult { return parseServiceConfig(js, defaultMaxCallAttempts) } } func parseServiceConfig(js string, maxAttempts int) *serviceconfig.ParseResult { if len(js) == 0 { return &serviceconfig.ParseResult{Err: fmt.Errorf("no JSON service config provided")} } var rsc jsonSC err := json.Unmarshal([]byte(js), &rsc) if err != nil { logger.Warningf("grpc: unmarshalling service config %s: %v", js, err) return &serviceconfig.ParseResult{Err: err} } sc := ServiceConfig{ Methods: make(map[string]MethodConfig), retryThrottling: rsc.RetryThrottling, healthCheckConfig: rsc.HealthCheckConfig, rawJSONString: js, } c := rsc.LoadBalancingConfig if c == nil { name := pickfirst.Name if rsc.LoadBalancingPolicy != nil { name = *rsc.LoadBalancingPolicy } if balancer.Get(name) == nil { name = pickfirst.Name } cfg := []map[string]any{{name: struct{}{}}} strCfg, err := json.Marshal(cfg) if err != nil { return &serviceconfig.ParseResult{Err: fmt.Errorf("unexpected error marshaling simple LB config: %w", err)} } r := json.RawMessage(strCfg) c = &r } cfg, err := gracefulswitch.ParseConfig(*c) if err != nil { return &serviceconfig.ParseResult{Err: err} } sc.lbConfig = cfg if rsc.MethodConfig == nil { return &serviceconfig.ParseResult{Config: &sc} } paths := map[string]struct{}{} for _, m := range *rsc.MethodConfig { if m.Name == nil { continue } mc := MethodConfig{ WaitForReady: m.WaitForReady, Timeout: (*time.Duration)(m.Timeout), } if mc.RetryPolicy, err = convertRetryPolicy(m.RetryPolicy, maxAttempts); err != nil { logger.Warningf("grpc: unmarshalling service config %s: %v", js, err) return &serviceconfig.ParseResult{Err: err} } if m.MaxRequestMessageBytes != nil { if *m.MaxRequestMessageBytes > int64(maxInt) { mc.MaxReqSize = newInt(maxInt) } else { mc.MaxReqSize = newInt(int(*m.MaxRequestMessageBytes)) } } if m.MaxResponseMessageBytes != nil { if *m.MaxResponseMessageBytes > int64(maxInt) { mc.MaxRespSize = newInt(maxInt) } else { mc.MaxRespSize = newInt(int(*m.MaxResponseMessageBytes)) } } for i, n := range *m.Name { path, err := n.generatePath() if err != nil { logger.Warningf("grpc: error unmarshalling service config %s due to methodConfig[%d]: %v", js, i, err) return &serviceconfig.ParseResult{Err: err} } if _, ok := paths[path]; ok { err = errDuplicatedName logger.Warningf("grpc: error unmarshalling service config %s due to methodConfig[%d]: %v", js, i, err) return &serviceconfig.ParseResult{Err: err} } paths[path] = struct{}{} sc.Methods[path] = mc } } if sc.retryThrottling != nil { if mt := sc.retryThrottling.MaxTokens; mt <= 0 || mt > 1000 { return &serviceconfig.ParseResult{Err: fmt.Errorf("invalid retry throttling config: maxTokens (%v) out of range (0, 1000]", mt)} } if tr := sc.retryThrottling.TokenRatio; tr <= 0 { return &serviceconfig.ParseResult{Err: fmt.Errorf("invalid retry throttling config: tokenRatio (%v) may not be negative", tr)} } } return &serviceconfig.ParseResult{Config: &sc} } func isValidRetryPolicy(jrp *jsonRetryPolicy) bool { return jrp.MaxAttempts > 1 && jrp.InitialBackoff > 0 && jrp.MaxBackoff > 0 && jrp.BackoffMultiplier > 0 && len(jrp.RetryableStatusCodes) > 0 } func convertRetryPolicy(jrp *jsonRetryPolicy, maxAttempts int) (p *internalserviceconfig.RetryPolicy, err error) { if jrp == nil { return nil, nil } if !isValidRetryPolicy(jrp) { return nil, fmt.Errorf("invalid retry policy (%+v): ", jrp) } if jrp.MaxAttempts < maxAttempts { maxAttempts = jrp.MaxAttempts } rp := &internalserviceconfig.RetryPolicy{ MaxAttempts: maxAttempts, InitialBackoff: time.Duration(jrp.InitialBackoff), MaxBackoff: time.Duration(jrp.MaxBackoff), BackoffMultiplier: jrp.BackoffMultiplier, RetryableStatusCodes: make(map[codes.Code]bool), } for _, code := range jrp.RetryableStatusCodes { rp.RetryableStatusCodes[code] = true } return rp, nil } func minPointers(a, b *int) *int { if *a < *b { return a } return b } func getMaxSize(mcMax, doptMax *int, defaultVal int) *int { if mcMax == nil && doptMax == nil { return &defaultVal } if mcMax != nil && doptMax != nil { return minPointers(mcMax, doptMax) } if mcMax != nil { return mcMax } return doptMax } func newInt(b int) *int { return &b } func init() { internal.EqualServiceConfigForTesting = equalServiceConfig } // equalServiceConfig compares two configs. The rawJSONString field is ignored, // because they may diff in white spaces. // // If any of them is NOT *ServiceConfig, return false. func equalServiceConfig(a, b serviceconfig.Config) bool { if a == nil && b == nil { return true } aa, ok := a.(*ServiceConfig) if !ok { return false } bb, ok := b.(*ServiceConfig) if !ok { return false } aaRaw := aa.rawJSONString aa.rawJSONString = "" bbRaw := bb.rawJSONString bb.rawJSONString = "" defer func() { aa.rawJSONString = aaRaw bb.rawJSONString = bbRaw }() // Using reflect.DeepEqual instead of cmp.Equal because many balancer // configs are unexported, and cmp.Equal cannot compare unexported fields // from unexported structs. return reflect.DeepEqual(aa, bb) } ================================================ FILE: vendor/google.golang.org/grpc/serviceconfig/serviceconfig.go ================================================ /* * * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package serviceconfig defines types and methods for operating on gRPC // service configs. // // # Experimental // // Notice: This package is EXPERIMENTAL and may be changed or removed in a // later release. package serviceconfig // Config represents an opaque data structure holding a service config. type Config interface { isServiceConfig() } // LoadBalancingConfig represents an opaque data structure holding a load // balancing config. type LoadBalancingConfig interface { isLoadBalancingConfig() } // ParseResult contains a service config or an error. Exactly one must be // non-nil. type ParseResult struct { Config Config Err error } ================================================ FILE: vendor/google.golang.org/grpc/stats/handlers.go ================================================ /* * * Copyright 2016 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package stats import ( "context" "net" ) // ConnTagInfo defines the relevant information needed by connection context tagger. type ConnTagInfo struct { // RemoteAddr is the remote address of the corresponding connection. RemoteAddr net.Addr // LocalAddr is the local address of the corresponding connection. LocalAddr net.Addr } // RPCTagInfo defines the relevant information needed by RPC context tagger. type RPCTagInfo struct { // FullMethodName is the RPC method in the format of /package.service/method. FullMethodName string // FailFast indicates if this RPC is failfast. // This field is only valid on client side, it's always false on server side. FailFast bool // NameResolutionDelay indicates if the RPC needed to wait for the // initial name resolver update before it could begin. This should only // happen if the channel is IDLE when the RPC is started. Note that // all retry or hedging attempts for an RPC that experienced a delay // will have it set. // // This field is only valid on the client side; it is always false on // the server side. NameResolutionDelay bool } // Handler defines the interface for the related stats handling (e.g., RPCs, connections). type Handler interface { // TagRPC can attach some information to the given context. // The context used for the rest lifetime of the RPC will be derived from // the returned context. TagRPC(context.Context, *RPCTagInfo) context.Context // HandleRPC processes the RPC stats. HandleRPC(context.Context, RPCStats) // TagConn can attach some information to the given context. // The returned context will be used for stats handling. // For conn stats handling, the context used in HandleConn for this // connection will be derived from the context returned. // For RPC stats handling, // - On server side, the context used in HandleRPC for all RPCs on this // connection will be derived from the context returned. // - On client side, the context is not derived from the context returned. TagConn(context.Context, *ConnTagInfo) context.Context // HandleConn processes the Conn stats. HandleConn(context.Context, ConnStats) } ================================================ FILE: vendor/google.golang.org/grpc/stats/metrics.go ================================================ /* * Copyright 2024 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package stats import "maps" // MetricSet is a set of metrics to record. Once created, MetricSet is immutable, // however Add and Remove can make copies with specific metrics added or // removed, respectively. // // Do not construct directly; use NewMetricSet instead. type MetricSet struct { // metrics are the set of metrics to initialize. metrics map[string]bool } // NewMetricSet returns a MetricSet containing metricNames. func NewMetricSet(metricNames ...string) *MetricSet { newMetrics := make(map[string]bool) for _, metric := range metricNames { newMetrics[metric] = true } return &MetricSet{metrics: newMetrics} } // Metrics returns the metrics set. The returned map is read-only and must not // be modified. func (m *MetricSet) Metrics() map[string]bool { return m.metrics } // Add adds the metricNames to the metrics set and returns a new copy with the // additional metrics. func (m *MetricSet) Add(metricNames ...string) *MetricSet { newMetrics := make(map[string]bool) for metric := range m.metrics { newMetrics[metric] = true } for _, metric := range metricNames { newMetrics[metric] = true } return &MetricSet{metrics: newMetrics} } // Join joins the metrics passed in with the metrics set, and returns a new copy // with the merged metrics. func (m *MetricSet) Join(metrics *MetricSet) *MetricSet { newMetrics := make(map[string]bool) maps.Copy(newMetrics, m.metrics) maps.Copy(newMetrics, metrics.metrics) return &MetricSet{metrics: newMetrics} } // Remove removes the metricNames from the metrics set and returns a new copy // with the metrics removed. func (m *MetricSet) Remove(metricNames ...string) *MetricSet { newMetrics := make(map[string]bool) for metric := range m.metrics { newMetrics[metric] = true } for _, metric := range metricNames { delete(newMetrics, metric) } return &MetricSet{metrics: newMetrics} } ================================================ FILE: vendor/google.golang.org/grpc/stats/stats.go ================================================ /* * * Copyright 2016 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package stats is for collecting and reporting various network and RPC stats. // This package is for monitoring purpose only. All fields are read-only. // All APIs are experimental. package stats // import "google.golang.org/grpc/stats" import ( "context" "net" "time" "google.golang.org/grpc/metadata" ) // RPCStats contains stats information about RPCs. type RPCStats interface { isRPCStats() // IsClient returns true if this RPCStats is from client side. IsClient() bool } // Begin contains stats for the start of an RPC attempt. // // - Server-side: Triggered after `InHeader`, as headers are processed // before the RPC lifecycle begins. // - Client-side: The first stats event recorded. // // FailFast is only valid if this Begin is from client side. type Begin struct { // Client is true if this Begin is from client side. Client bool // BeginTime is the time when the RPC attempt begins. BeginTime time.Time // FailFast indicates if this RPC is failfast. FailFast bool // IsClientStream indicates whether the RPC is a client streaming RPC. IsClientStream bool // IsServerStream indicates whether the RPC is a server streaming RPC. IsServerStream bool // IsTransparentRetryAttempt indicates whether this attempt was initiated // due to transparently retrying a previous attempt. IsTransparentRetryAttempt bool } // IsClient indicates if the stats information is from client side. func (s *Begin) IsClient() bool { return s.Client } func (s *Begin) isRPCStats() {} // DelayedPickComplete indicates that the RPC is unblocked following a delay in // selecting a connection for the call. type DelayedPickComplete struct{} // IsClient indicates DelayedPickComplete is available on the client. func (*DelayedPickComplete) IsClient() bool { return true } func (*DelayedPickComplete) isRPCStats() {} // PickerUpdated indicates that the RPC is unblocked following a delay in // selecting a connection for the call. // // Deprecated: will be removed in a future release; use DelayedPickComplete // instead. type PickerUpdated = DelayedPickComplete // InPayload contains stats about an incoming payload. type InPayload struct { // Client is true if this InPayload is from client side. Client bool // Payload is the payload with original type. This may be modified after // the call to HandleRPC which provides the InPayload returns and must be // copied if needed later. Payload any // Length is the size of the uncompressed payload data. Does not include any // framing (gRPC or HTTP/2). Length int // CompressedLength is the size of the compressed payload data. Does not // include any framing (gRPC or HTTP/2). Same as Length if compression not // enabled. CompressedLength int // WireLength is the size of the compressed payload data plus gRPC framing. // Does not include HTTP/2 framing. WireLength int // RecvTime is the time when the payload is received. RecvTime time.Time } // IsClient indicates if the stats information is from client side. func (s *InPayload) IsClient() bool { return s.Client } func (s *InPayload) isRPCStats() {} // InHeader contains stats about header reception. // // - Server-side: The first stats event after the RPC request is received. type InHeader struct { // Client is true if this InHeader is from client side. Client bool // WireLength is the wire length of header. WireLength int // Compression is the compression algorithm used for the RPC. Compression string // Header contains the header metadata received. Header metadata.MD // The following fields are valid only if Client is false. // FullMethod is the full RPC method string, i.e., /package.service/method. FullMethod string // RemoteAddr is the remote address of the corresponding connection. RemoteAddr net.Addr // LocalAddr is the local address of the corresponding connection. LocalAddr net.Addr } // IsClient indicates if the stats information is from client side. func (s *InHeader) IsClient() bool { return s.Client } func (s *InHeader) isRPCStats() {} // InTrailer contains stats about trailer reception. type InTrailer struct { // Client is true if this InTrailer is from client side. Client bool // WireLength is the wire length of trailer. WireLength int // Trailer contains the trailer metadata received from the server. This // field is only valid if this InTrailer is from the client side. Trailer metadata.MD } // IsClient indicates if the stats information is from client side. func (s *InTrailer) IsClient() bool { return s.Client } func (s *InTrailer) isRPCStats() {} // OutPayload contains stats about an outgoing payload. type OutPayload struct { // Client is true if this OutPayload is from client side. Client bool // Payload is the payload with original type. This may be modified after // the call to HandleRPC which provides the OutPayload returns and must be // copied if needed later. Payload any // Length is the size of the uncompressed payload data. Does not include any // framing (gRPC or HTTP/2). Length int // CompressedLength is the size of the compressed payload data. Does not // include any framing (gRPC or HTTP/2). Same as Length if compression not // enabled. CompressedLength int // WireLength is the size of the compressed payload data plus gRPC framing. // Does not include HTTP/2 framing. WireLength int // SentTime is the time when the payload is sent. SentTime time.Time } // IsClient indicates if this stats information is from client side. func (s *OutPayload) IsClient() bool { return s.Client } func (s *OutPayload) isRPCStats() {} // OutHeader contains stats about header transmission. // // - Client-side: Only occurs after 'Begin', as headers are always the first // thing sent on a stream. type OutHeader struct { // Client is true if this OutHeader is from client side. Client bool // Compression is the compression algorithm used for the RPC. Compression string // Header contains the header metadata sent. Header metadata.MD // The following fields are valid only if Client is true. // FullMethod is the full RPC method string, i.e., /package.service/method. FullMethod string // RemoteAddr is the remote address of the corresponding connection. RemoteAddr net.Addr // LocalAddr is the local address of the corresponding connection. LocalAddr net.Addr } // IsClient indicates if this stats information is from client side. func (s *OutHeader) IsClient() bool { return s.Client } func (s *OutHeader) isRPCStats() {} // OutTrailer contains stats about trailer transmission. type OutTrailer struct { // Client is true if this OutTrailer is from client side. Client bool // WireLength is the wire length of trailer. // // Deprecated: This field is never set. The length is not known when this // message is emitted because the trailer fields are compressed with hpack // after that. WireLength int // Trailer contains the trailer metadata sent to the client. This // field is only valid if this OutTrailer is from the server side. Trailer metadata.MD } // IsClient indicates if this stats information is from client side. func (s *OutTrailer) IsClient() bool { return s.Client } func (s *OutTrailer) isRPCStats() {} // End contains stats about RPC completion. type End struct { // Client is true if this End is from client side. Client bool // BeginTime is the time when the RPC began. BeginTime time.Time // EndTime is the time when the RPC ends. EndTime time.Time // Trailer contains the trailer metadata received from the server. This // field is only valid if this End is from the client side. // Deprecated: use Trailer in InTrailer instead. Trailer metadata.MD // Error is the error the RPC ended with. It is an error generated from // status.Status and can be converted back to status.Status using // status.FromError if non-nil. Error error } // IsClient indicates if this is from client side. func (s *End) IsClient() bool { return s.Client } func (s *End) isRPCStats() {} // ConnStats contains stats information about connections. type ConnStats interface { isConnStats() // IsClient returns true if this ConnStats is from client side. IsClient() bool } // ConnBegin contains stats about connection establishment. type ConnBegin struct { // Client is true if this ConnBegin is from client side. Client bool } // IsClient indicates if this is from client side. func (s *ConnBegin) IsClient() bool { return s.Client } func (s *ConnBegin) isConnStats() {} // ConnEnd contains stats about connection termination. type ConnEnd struct { // Client is true if this ConnEnd is from client side. Client bool } // IsClient indicates if this is from client side. func (s *ConnEnd) IsClient() bool { return s.Client } func (s *ConnEnd) isConnStats() {} // SetTags attaches stats tagging data to the context, which will be sent in // the outgoing RPC with the header grpc-tags-bin. Subsequent calls to // SetTags will overwrite the values from earlier calls. // // Deprecated: set the `grpc-tags-bin` header in the metadata instead. func SetTags(ctx context.Context, b []byte) context.Context { return metadata.AppendToOutgoingContext(ctx, "grpc-tags-bin", string(b)) } // Tags returns the tags from the context for the inbound RPC. // // Deprecated: obtain the `grpc-tags-bin` header from metadata instead. func Tags(ctx context.Context) []byte { traceValues := metadata.ValueFromIncomingContext(ctx, "grpc-tags-bin") if len(traceValues) == 0 { return nil } return []byte(traceValues[len(traceValues)-1]) } // SetTrace attaches stats tagging data to the context, which will be sent in // the outgoing RPC with the header grpc-trace-bin. Subsequent calls to // SetTrace will overwrite the values from earlier calls. // // Deprecated: set the `grpc-trace-bin` header in the metadata instead. func SetTrace(ctx context.Context, b []byte) context.Context { return metadata.AppendToOutgoingContext(ctx, "grpc-trace-bin", string(b)) } // Trace returns the trace from the context for the inbound RPC. // // Deprecated: obtain the `grpc-trace-bin` header from metadata instead. func Trace(ctx context.Context) []byte { traceValues := metadata.ValueFromIncomingContext(ctx, "grpc-trace-bin") if len(traceValues) == 0 { return nil } return []byte(traceValues[len(traceValues)-1]) } ================================================ FILE: vendor/google.golang.org/grpc/status/status.go ================================================ /* * * Copyright 2017 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package status implements errors returned by gRPC. These errors are // serialized and transmitted on the wire between server and client, and allow // for additional data to be transmitted via the Details field in the status // proto. gRPC service handlers should return an error created by this // package, and gRPC clients should expect a corresponding error to be // returned from the RPC call. // // This package upholds the invariants that a non-nil error may not // contain an OK code, and an OK code must result in a nil error. package status import ( "context" "errors" "fmt" spb "google.golang.org/genproto/googleapis/rpc/status" "google.golang.org/grpc/codes" "google.golang.org/grpc/internal/status" ) // Status references google.golang.org/grpc/internal/status. It represents an // RPC status code, message, and details. It is immutable and should be // created with New, Newf, or FromProto. // https://godoc.org/google.golang.org/grpc/internal/status type Status = status.Status // New returns a Status representing c and msg. func New(c codes.Code, msg string) *Status { return status.New(c, msg) } // Newf returns New(c, fmt.Sprintf(format, a...)). func Newf(c codes.Code, format string, a ...any) *Status { return New(c, fmt.Sprintf(format, a...)) } // Error returns an error representing c and msg. If c is OK, returns nil. func Error(c codes.Code, msg string) error { return New(c, msg).Err() } // Errorf returns Error(c, fmt.Sprintf(format, a...)). func Errorf(c codes.Code, format string, a ...any) error { return Error(c, fmt.Sprintf(format, a...)) } // ErrorProto returns an error representing s. If s.Code is OK, returns nil. func ErrorProto(s *spb.Status) error { return FromProto(s).Err() } // FromProto returns a Status representing s. func FromProto(s *spb.Status) *Status { return status.FromProto(s) } // FromError returns a Status representation of err. // // - If err was produced by this package or implements the method `GRPCStatus() // *Status` and `GRPCStatus()` does not return nil, or if err wraps a type // satisfying this, the Status from `GRPCStatus()` is returned. For wrapped // errors, the message returned contains the entire err.Error() text and not // just the wrapped status. In that case, ok is true. // // - If err is nil, a Status is returned with codes.OK and no message, and ok // is true. // // - If err implements the method `GRPCStatus() *Status` and `GRPCStatus()` // returns nil (which maps to Codes.OK), or if err wraps a type // satisfying this, a Status is returned with codes.Unknown and err's // Error() message, and ok is false. // // - Otherwise, err is an error not compatible with this package. In this // case, a Status is returned with codes.Unknown and err's Error() message, // and ok is false. func FromError(err error) (s *Status, ok bool) { if err == nil { return nil, true } type grpcstatus interface{ GRPCStatus() *Status } if gs, ok := err.(grpcstatus); ok { grpcStatus := gs.GRPCStatus() if grpcStatus == nil { // Error has status nil, which maps to codes.OK. There // is no sensible behavior for this, so we turn it into // an error with codes.Unknown and discard the existing // status. return New(codes.Unknown, err.Error()), false } return grpcStatus, true } var gs grpcstatus if errors.As(err, &gs) { grpcStatus := gs.GRPCStatus() if grpcStatus == nil { // Error wraps an error that has status nil, which maps // to codes.OK. There is no sensible behavior for this, // so we turn it into an error with codes.Unknown and // discard the existing status. return New(codes.Unknown, err.Error()), false } p := grpcStatus.Proto() p.Message = err.Error() return status.FromProto(p), true } return New(codes.Unknown, err.Error()), false } // Convert is a convenience function which removes the need to handle the // boolean return value from FromError. func Convert(err error) *Status { s, _ := FromError(err) return s } // Code returns the Code of the error if it is a Status error or if it wraps a // Status error. If that is not the case, it returns codes.OK if err is nil, or // codes.Unknown otherwise. func Code(err error) codes.Code { // Don't use FromError to avoid allocation of OK status. if err == nil { return codes.OK } return Convert(err).Code() } // FromContextError converts a context error or wrapped context error into a // Status. It returns a Status with codes.OK if err is nil, or a Status with // codes.Unknown if err is non-nil and not a context error. func FromContextError(err error) *Status { if err == nil { return nil } if errors.Is(err, context.DeadlineExceeded) { return New(codes.DeadlineExceeded, err.Error()) } if errors.Is(err, context.Canceled) { return New(codes.Canceled, err.Error()) } return New(codes.Unknown, err.Error()) } ================================================ FILE: vendor/google.golang.org/grpc/stream.go ================================================ /* * * Copyright 2014 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package grpc import ( "context" "errors" "io" "math" rand "math/rand/v2" "strconv" "strings" "sync" "time" "google.golang.org/grpc/balancer" "google.golang.org/grpc/codes" "google.golang.org/grpc/encoding" "google.golang.org/grpc/internal" "google.golang.org/grpc/internal/balancerload" "google.golang.org/grpc/internal/binarylog" "google.golang.org/grpc/internal/channelz" "google.golang.org/grpc/internal/grpcutil" imetadata "google.golang.org/grpc/internal/metadata" iresolver "google.golang.org/grpc/internal/resolver" "google.golang.org/grpc/internal/serviceconfig" istatus "google.golang.org/grpc/internal/status" "google.golang.org/grpc/internal/transport" "google.golang.org/grpc/mem" "google.golang.org/grpc/metadata" "google.golang.org/grpc/peer" "google.golang.org/grpc/stats" "google.golang.org/grpc/status" ) var metadataFromOutgoingContextRaw = internal.FromOutgoingContextRaw.(func(context.Context) (metadata.MD, [][]string, bool)) // StreamHandler defines the handler called by gRPC server to complete the // execution of a streaming RPC. // // If a StreamHandler returns an error, it should either be produced by the // status package, or be one of the context errors. Otherwise, gRPC will use // codes.Unknown as the status code and err.Error() as the status message of the // RPC. type StreamHandler func(srv any, stream ServerStream) error // StreamDesc represents a streaming RPC service's method specification. Used // on the server when registering services and on the client when initiating // new streams. type StreamDesc struct { // StreamName and Handler are only used when registering handlers on a // server. StreamName string // the name of the method excluding the service Handler StreamHandler // the handler called for the method // ServerStreams and ClientStreams are used for registering handlers on a // server as well as defining RPC behavior when passed to NewClientStream // and ClientConn.NewStream. At least one must be true. ServerStreams bool // indicates the server can perform streaming sends ClientStreams bool // indicates the client can perform streaming sends } // Stream defines the common interface a client or server stream has to satisfy. // // Deprecated: See ClientStream and ServerStream documentation instead. type Stream interface { // Deprecated: See ClientStream and ServerStream documentation instead. Context() context.Context // Deprecated: See ClientStream and ServerStream documentation instead. SendMsg(m any) error // Deprecated: See ClientStream and ServerStream documentation instead. RecvMsg(m any) error } // ClientStream defines the client-side behavior of a streaming RPC. // // All errors returned from ClientStream methods are compatible with the // status package. type ClientStream interface { // Header returns the header metadata received from the server if there // is any. It blocks if the metadata is not ready to read. If the metadata // is nil and the error is also nil, then the stream was terminated without // headers, and the status can be discovered by calling RecvMsg. Header() (metadata.MD, error) // Trailer returns the trailer metadata from the server, if there is any. // It must only be called after stream.CloseAndRecv has returned, or // stream.Recv has returned a non-nil error (including io.EOF). Trailer() metadata.MD // CloseSend closes the send direction of the stream. This method always // returns a nil error. The status of the stream may be discovered using // RecvMsg. It is also not safe to call CloseSend concurrently with SendMsg. CloseSend() error // Context returns the context for this stream. // // It should not be called until after Header or RecvMsg has returned. Once // called, subsequent client-side retries are disabled. Context() context.Context // SendMsg is generally called by generated code. On error, SendMsg aborts // the stream. If the error was generated by the client, the status is // returned directly; otherwise, io.EOF is returned and the status of // the stream may be discovered using RecvMsg. For unary or server-streaming // RPCs (StreamDesc.ClientStreams is false), a nil error is returned // unconditionally. // // SendMsg blocks until: // - There is sufficient flow control to schedule m with the transport, or // - The stream is done, or // - The stream breaks. // // SendMsg does not wait until the message is received by the server. An // untimely stream closure may result in lost messages. To ensure delivery, // users should ensure the RPC completed successfully using RecvMsg. // // It is safe to have a goroutine calling SendMsg and another goroutine // calling RecvMsg on the same stream at the same time, but it is not safe // to call SendMsg on the same stream in different goroutines. It is also // not safe to call CloseSend concurrently with SendMsg. // // It is not safe to modify the message after calling SendMsg. Tracing // libraries and stats handlers may use the message lazily. SendMsg(m any) error // RecvMsg blocks until it receives a message into m or the stream is // done. It returns io.EOF when the stream completes successfully. On // any other error, the stream is aborted and the error contains the RPC // status. // // It is safe to have a goroutine calling SendMsg and another goroutine // calling RecvMsg on the same stream at the same time, but it is not // safe to call RecvMsg on the same stream in different goroutines. RecvMsg(m any) error } // NewStream creates a new Stream for the client side. This is typically // called by generated code. ctx is used for the lifetime of the stream. // // To ensure resources are not leaked due to the stream returned, one of the following // actions must be performed: // // 1. Call Close on the ClientConn. // 2. Cancel the context provided. // 3. Call RecvMsg until a non-nil error is returned. A protobuf-generated // client-streaming RPC, for instance, might use the helper function // CloseAndRecv (note that CloseSend does not Recv, therefore is not // guaranteed to release all resources). // 4. Receive a non-nil, non-io.EOF error from Header or SendMsg. // // If none of the above happen, a goroutine and a context will be leaked, and grpc // will not call the optionally-configured stats handler with a stats.End message. func (cc *ClientConn) NewStream(ctx context.Context, desc *StreamDesc, method string, opts ...CallOption) (ClientStream, error) { // allow interceptor to see all applicable call options, which means those // configured as defaults from dial option as well as per-call options opts = combine(cc.dopts.callOptions, opts) if cc.dopts.streamInt != nil { return cc.dopts.streamInt(ctx, desc, cc, method, newClientStream, opts...) } return newClientStream(ctx, desc, cc, method, opts...) } // NewClientStream is a wrapper for ClientConn.NewStream. func NewClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, opts ...CallOption) (ClientStream, error) { return cc.NewStream(ctx, desc, method, opts...) } var emptyMethodConfig = serviceconfig.MethodConfig{} // endOfClientStream performs cleanup actions required for both successful and // failed streams. This includes incrementing channelz stats and invoking all // registered OnFinish call options. func endOfClientStream(cc *ClientConn, err error, opts ...CallOption) { if channelz.IsOn() { if err != nil { cc.incrCallsFailed() } else { cc.incrCallsSucceeded() } } for _, o := range opts { if o, ok := o.(OnFinishCallOption); ok { o.OnFinish(err) } } } func newClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, opts ...CallOption) (_ ClientStream, err error) { if channelz.IsOn() { cc.incrCallsStarted() } defer func() { if err != nil { // Ensure cleanup when stream creation fails. endOfClientStream(cc, err, opts...) } }() // Start tracking the RPC for idleness purposes. This is where a stream is // created for both streaming and unary RPCs, and hence is a good place to // track active RPC count. cc.idlenessMgr.OnCallBegin() // Add a calloption, to decrement the active call count, that gets executed // when the RPC completes. opts = append([]CallOption{OnFinish(func(error) { cc.idlenessMgr.OnCallEnd() })}, opts...) if md, added, ok := metadataFromOutgoingContextRaw(ctx); ok { // validate md if err := imetadata.Validate(md); err != nil { return nil, status.Error(codes.Internal, err.Error()) } // validate added for _, kvs := range added { for i := 0; i < len(kvs); i += 2 { if err := imetadata.ValidatePair(kvs[i], kvs[i+1]); err != nil { return nil, status.Error(codes.Internal, err.Error()) } } } } // Provide an opportunity for the first RPC to see the first service config // provided by the resolver. nameResolutionDelayed, err := cc.waitForResolvedAddrs(ctx) if err != nil { return nil, err } mc := &emptyMethodConfig var onCommit func() newStream := func(ctx context.Context, done func()) (iresolver.ClientStream, error) { return newClientStreamWithParams(ctx, desc, cc, method, mc, onCommit, done, nameResolutionDelayed, opts...) } rpcInfo := iresolver.RPCInfo{Context: ctx, Method: method} rpcConfig, err := cc.safeConfigSelector.SelectConfig(rpcInfo) if err != nil { if st, ok := status.FromError(err); ok { // Restrict the code to the list allowed by gRFC A54. if istatus.IsRestrictedControlPlaneCode(st) { err = status.Errorf(codes.Internal, "config selector returned illegal status: %v", err) } return nil, err } return nil, toRPCErr(err) } if rpcConfig != nil { if rpcConfig.Context != nil { ctx = rpcConfig.Context } mc = &rpcConfig.MethodConfig onCommit = rpcConfig.OnCommitted if rpcConfig.Interceptor != nil { rpcInfo.Context = nil ns := newStream newStream = func(ctx context.Context, done func()) (iresolver.ClientStream, error) { cs, err := rpcConfig.Interceptor.NewStream(ctx, rpcInfo, done, ns) if err != nil { return nil, toRPCErr(err) } return cs, nil } } } return newStream(ctx, func() {}) } func newClientStreamWithParams(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, mc *serviceconfig.MethodConfig, onCommit, doneFunc func(), nameResolutionDelayed bool, opts ...CallOption) (_ iresolver.ClientStream, err error) { callInfo := defaultCallInfo() if mc.WaitForReady != nil { callInfo.failFast = !*mc.WaitForReady } // Possible context leak: // The cancel function for the child context we create will only be called // when RecvMsg returns a non-nil error, if the ClientConn is closed, or if // an error is generated by SendMsg. // https://github.com/grpc/grpc-go/issues/1818. var cancel context.CancelFunc if mc.Timeout != nil && *mc.Timeout >= 0 { ctx, cancel = context.WithTimeout(ctx, *mc.Timeout) } else { ctx, cancel = context.WithCancel(ctx) } defer func() { if err != nil { cancel() } }() for _, o := range opts { if err := o.before(callInfo); err != nil { return nil, toRPCErr(err) } } callInfo.maxSendMessageSize = getMaxSize(mc.MaxReqSize, callInfo.maxSendMessageSize, defaultClientMaxSendMessageSize) callInfo.maxReceiveMessageSize = getMaxSize(mc.MaxRespSize, callInfo.maxReceiveMessageSize, defaultClientMaxReceiveMessageSize) if err := setCallInfoCodec(callInfo); err != nil { return nil, err } callHdr := &transport.CallHdr{ Host: cc.authority, Method: method, ContentSubtype: callInfo.contentSubtype, DoneFunc: doneFunc, Authority: callInfo.authority, } if allowed := callInfo.acceptedResponseCompressors; len(allowed) > 0 { headerValue := strings.Join(allowed, ",") callHdr.AcceptedCompressors = &headerValue } // Set our outgoing compression according to the UseCompressor CallOption, if // set. In that case, also find the compressor from the encoding package. // Otherwise, use the compressor configured by the WithCompressor DialOption, // if set. var compressorV0 Compressor var compressorV1 encoding.Compressor if ct := callInfo.compressorName; ct != "" { callHdr.SendCompress = ct if ct != encoding.Identity { compressorV1 = encoding.GetCompressor(ct) if compressorV1 == nil { return nil, status.Errorf(codes.Internal, "grpc: Compressor is not installed for requested grpc-encoding %q", ct) } } } else if cc.dopts.compressorV0 != nil { callHdr.SendCompress = cc.dopts.compressorV0.Type() compressorV0 = cc.dopts.compressorV0 } if callInfo.creds != nil { callHdr.Creds = callInfo.creds } cs := &clientStream{ callHdr: callHdr, ctx: ctx, methodConfig: mc, opts: opts, callInfo: callInfo, cc: cc, desc: desc, codec: callInfo.codec, compressorV0: compressorV0, compressorV1: compressorV1, cancel: cancel, firstAttempt: true, onCommit: onCommit, nameResolutionDelay: nameResolutionDelayed, } if !cc.dopts.disableRetry { cs.retryThrottler = cc.retryThrottler.Load().(*retryThrottler) } if ml := binarylog.GetMethodLogger(method); ml != nil { cs.binlogs = append(cs.binlogs, ml) } if cc.dopts.binaryLogger != nil { if ml := cc.dopts.binaryLogger.GetMethodLogger(method); ml != nil { cs.binlogs = append(cs.binlogs, ml) } } // Pick the transport to use and create a new stream on the transport. // Assign cs.attempt upon success. op := func(a *csAttempt) error { if err := a.getTransport(); err != nil { return err } if err := a.newStream(); err != nil { return err } // Because this operation is always called either here (while creating // the clientStream) or by the retry code while locked when replaying // the operation, it is safe to access cs.attempt directly. cs.attempt = a return nil } if err := cs.withRetry(op, func() { cs.bufferForRetryLocked(0, op, nil) }); err != nil { return nil, err } if len(cs.binlogs) != 0 { md, _ := metadata.FromOutgoingContext(ctx) logEntry := &binarylog.ClientHeader{ OnClientSide: true, Header: md, MethodName: method, Authority: cs.cc.authority, } if deadline, ok := ctx.Deadline(); ok { logEntry.Timeout = time.Until(deadline) if logEntry.Timeout < 0 { logEntry.Timeout = 0 } } for _, binlog := range cs.binlogs { binlog.Log(cs.ctx, logEntry) } } if desc != unaryStreamDesc { // Listen on cc and stream contexts to cleanup when the user closes the // ClientConn or cancels the stream context. In all other cases, an error // should already be injected into the recv buffer by the transport, which // the client will eventually receive, and then we will cancel the stream's // context in clientStream.finish. go func() { select { case <-cc.ctx.Done(): cs.finish(ErrClientConnClosing) case <-ctx.Done(): cs.finish(toRPCErr(ctx.Err())) } }() } return cs, nil } // newAttemptLocked creates a new csAttempt without a transport or stream. func (cs *clientStream) newAttemptLocked(isTransparent bool) (*csAttempt, error) { if err := cs.ctx.Err(); err != nil { return nil, toRPCErr(err) } if err := cs.cc.ctx.Err(); err != nil { return nil, ErrClientConnClosing } ctx := newContextWithRPCInfo(cs.ctx, cs.callInfo.failFast, cs.callInfo.codec, cs.compressorV0, cs.compressorV1) method := cs.callHdr.Method var beginTime time.Time sh := cs.cc.statsHandler if sh != nil { beginTime = time.Now() ctx = sh.TagRPC(ctx, &stats.RPCTagInfo{ FullMethodName: method, FailFast: cs.callInfo.failFast, NameResolutionDelay: cs.nameResolutionDelay, }) sh.HandleRPC(ctx, &stats.Begin{ Client: true, BeginTime: beginTime, FailFast: cs.callInfo.failFast, IsClientStream: cs.desc.ClientStreams, IsServerStream: cs.desc.ServerStreams, IsTransparentRetryAttempt: isTransparent, }) } var trInfo *traceInfo if EnableTracing { trInfo = &traceInfo{ tr: newTrace("grpc.Sent."+methodFamily(method), method), firstLine: firstLine{ client: true, }, } if deadline, ok := ctx.Deadline(); ok { trInfo.firstLine.deadline = time.Until(deadline) } trInfo.tr.LazyLog(&trInfo.firstLine, false) ctx = newTraceContext(ctx, trInfo.tr) } if cs.cc.parsedTarget.URL.Scheme == internal.GRPCResolverSchemeExtraMetadata { // Add extra metadata (metadata that will be added by transport) to context // so the balancer can see them. ctx = grpcutil.WithExtraMetadata(ctx, metadata.Pairs( "content-type", grpcutil.ContentType(cs.callHdr.ContentSubtype), )) } return &csAttempt{ ctx: ctx, beginTime: beginTime, cs: cs, decompressorV0: cs.cc.dopts.dc, statsHandler: sh, trInfo: trInfo, }, nil } func (a *csAttempt) getTransport() error { cs := a.cs pickInfo := balancer.PickInfo{Ctx: a.ctx, FullMethodName: cs.callHdr.Method} pick, err := cs.cc.pickerWrapper.pick(a.ctx, cs.callInfo.failFast, pickInfo) a.transport, a.pickResult = pick.transport, pick.result if err != nil { if de, ok := err.(dropError); ok { err = de.error a.drop = true } return err } if a.trInfo != nil { a.trInfo.firstLine.SetRemoteAddr(a.transport.Peer().Addr) } if pick.blocked && a.statsHandler != nil { a.statsHandler.HandleRPC(a.ctx, &stats.DelayedPickComplete{}) } return nil } func (a *csAttempt) newStream() error { cs := a.cs cs.callHdr.PreviousAttempts = cs.numRetries // Merge metadata stored in PickResult, if any, with existing call metadata. // It is safe to overwrite the csAttempt's context here, since all state // maintained in it are local to the attempt. When the attempt has to be // retried, a new instance of csAttempt will be created. if a.pickResult.Metadata != nil { // We currently do not have a function it the metadata package which // merges given metadata with existing metadata in a context. Existing // function `AppendToOutgoingContext()` takes a variadic argument of key // value pairs. // // TODO: Make it possible to retrieve key value pairs from metadata.MD // in a form passable to AppendToOutgoingContext(), or create a version // of AppendToOutgoingContext() that accepts a metadata.MD. md, _ := metadata.FromOutgoingContext(a.ctx) md = metadata.Join(md, a.pickResult.Metadata) a.ctx = metadata.NewOutgoingContext(a.ctx, md) } s, err := a.transport.NewStream(a.ctx, cs.callHdr) if err != nil { nse, ok := err.(*transport.NewStreamError) if !ok { // Unexpected. return err } if nse.AllowTransparentRetry { a.allowTransparentRetry = true } // Unwrap and convert error. return toRPCErr(nse.Err) } a.transportStream = s a.ctx = s.Context() a.parser = parser{r: s, bufferPool: a.cs.cc.dopts.copts.BufferPool} return nil } // clientStream implements a client side Stream. type clientStream struct { callHdr *transport.CallHdr opts []CallOption callInfo *callInfo cc *ClientConn desc *StreamDesc codec baseCodec compressorV0 Compressor compressorV1 encoding.Compressor cancel context.CancelFunc // cancels all attempts sentLast bool // sent an end stream receivedFirstMsg bool // set after the first message is received methodConfig *MethodConfig ctx context.Context // the application's context, wrapped by stats/tracing retryThrottler *retryThrottler // The throttler active when the RPC began. binlogs []binarylog.MethodLogger // serverHeaderBinlogged is a boolean for whether server header has been // logged. Server header will be logged when the first time one of those // happens: stream.Header(), stream.Recv(). // // It's only read and used by Recv() and Header(), so it doesn't need to be // synchronized. serverHeaderBinlogged bool mu sync.Mutex firstAttempt bool // if true, transparent retry is valid numRetries int // exclusive of transparent retry attempt(s) numRetriesSincePushback int // retries since pushback; to reset backoff finished bool // TODO: replace with atomic cmpxchg or sync.Once? // attempt is the active client stream attempt. // The only place where it is written is the newAttemptLocked method and this method never writes nil. // So, attempt can be nil only inside newClientStream function when clientStream is first created. // One of the first things done after clientStream's creation, is to call newAttemptLocked which either // assigns a non nil value to the attempt or returns an error. If an error is returned from newAttemptLocked, // then newClientStream calls finish on the clientStream and returns. So, finish method is the only // place where we need to check if the attempt is nil. attempt *csAttempt // TODO(hedging): hedging will have multiple attempts simultaneously. committed bool // active attempt committed for retry? onCommit func() replayBuffer []replayOp // operations to replay on retry replayBufferSize int // current size of replayBuffer // nameResolutionDelay indicates if there was a delay in the name resolution. // This field is only valid on client side, it's always false on server side. nameResolutionDelay bool } type replayOp struct { op func(a *csAttempt) error cleanup func() } // csAttempt implements a single transport stream attempt within a // clientStream. type csAttempt struct { ctx context.Context cs *clientStream transport transport.ClientTransport transportStream *transport.ClientStream parser parser pickResult balancer.PickResult finished bool decompressorV0 Decompressor decompressorV1 encoding.Compressor decompressorSet bool mu sync.Mutex // guards trInfo.tr // trInfo may be nil (if EnableTracing is false). // trInfo.tr is set when created (if EnableTracing is true), // and cleared when the finish method is called. trInfo *traceInfo statsHandler stats.Handler beginTime time.Time // set for newStream errors that may be transparently retried allowTransparentRetry bool // set for pick errors that are returned as a status drop bool } func (cs *clientStream) commitAttemptLocked() { if !cs.committed && cs.onCommit != nil { cs.onCommit() } cs.committed = true for _, op := range cs.replayBuffer { if op.cleanup != nil { op.cleanup() } } cs.replayBuffer = nil } func (cs *clientStream) commitAttempt() { cs.mu.Lock() cs.commitAttemptLocked() cs.mu.Unlock() } // shouldRetry returns nil if the RPC should be retried; otherwise it returns // the error that should be returned by the operation. If the RPC should be // retried, the bool indicates whether it is being retried transparently. func (a *csAttempt) shouldRetry(err error) (bool, error) { cs := a.cs if cs.finished || cs.committed || a.drop { // RPC is finished or committed or was dropped by the picker; cannot retry. return false, err } if a.transportStream == nil && a.allowTransparentRetry { return true, nil } // Wait for the trailers. unprocessed := false if a.transportStream != nil { <-a.transportStream.Done() unprocessed = a.transportStream.Unprocessed() } if cs.firstAttempt && unprocessed { // First attempt, stream unprocessed: transparently retry. return true, nil } if cs.cc.dopts.disableRetry { return false, err } pushback := 0 hasPushback := false if a.transportStream != nil { if !a.transportStream.TrailersOnly() { return false, err } // TODO(retry): Move down if the spec changes to not check server pushback // before considering this a failure for throttling. sps := a.transportStream.Trailer()["grpc-retry-pushback-ms"] if len(sps) == 1 { var e error if pushback, e = strconv.Atoi(sps[0]); e != nil || pushback < 0 { channelz.Infof(logger, cs.cc.channelz, "Server retry pushback specified to abort (%q).", sps[0]) cs.retryThrottler.throttle() // This counts as a failure for throttling. return false, err } hasPushback = true } else if len(sps) > 1 { channelz.Warningf(logger, cs.cc.channelz, "Server retry pushback specified multiple values (%q); not retrying.", sps) cs.retryThrottler.throttle() // This counts as a failure for throttling. return false, err } } var code codes.Code if a.transportStream != nil { code = a.transportStream.Status().Code() } else { code = status.Code(err) } rp := cs.methodConfig.RetryPolicy if rp == nil || !rp.RetryableStatusCodes[code] { return false, err } // Note: the ordering here is important; we count this as a failure // only if the code matched a retryable code. if cs.retryThrottler.throttle() { return false, err } if cs.numRetries+1 >= rp.MaxAttempts { return false, err } var dur time.Duration if hasPushback { dur = time.Millisecond * time.Duration(pushback) cs.numRetriesSincePushback = 0 } else { fact := math.Pow(rp.BackoffMultiplier, float64(cs.numRetriesSincePushback)) cur := min(float64(rp.InitialBackoff)*fact, float64(rp.MaxBackoff)) // Apply jitter by multiplying with a random factor between 0.8 and 1.2 cur *= 0.8 + 0.4*rand.Float64() dur = time.Duration(int64(cur)) cs.numRetriesSincePushback++ } // TODO(dfawley): we could eagerly fail here if dur puts us past the // deadline, but unsure if it is worth doing. t := time.NewTimer(dur) select { case <-t.C: cs.numRetries++ return false, nil case <-cs.ctx.Done(): t.Stop() return false, status.FromContextError(cs.ctx.Err()).Err() } } // Returns nil if a retry was performed and succeeded; error otherwise. func (cs *clientStream) retryLocked(attempt *csAttempt, lastErr error) error { for { attempt.finish(toRPCErr(lastErr)) isTransparent, err := attempt.shouldRetry(lastErr) if err != nil { cs.commitAttemptLocked() return err } cs.firstAttempt = false attempt, err = cs.newAttemptLocked(isTransparent) if err != nil { // Only returns error if the clientconn is closed or the context of // the stream is canceled. return err } // Note that the first op in replayBuffer always sets cs.attempt // if it is able to pick a transport and create a stream. if lastErr = cs.replayBufferLocked(attempt); lastErr == nil { return nil } } } func (cs *clientStream) Context() context.Context { cs.commitAttempt() // No need to lock before using attempt, since we know it is committed and // cannot change. if cs.attempt.transportStream != nil { return cs.attempt.transportStream.Context() } return cs.ctx } func (cs *clientStream) withRetry(op func(a *csAttempt) error, onSuccess func()) error { cs.mu.Lock() for { if cs.committed { cs.mu.Unlock() // toRPCErr is used in case the error from the attempt comes from // NewClientStream, which intentionally doesn't return a status // error to allow for further inspection; all other errors should // already be status errors. return toRPCErr(op(cs.attempt)) } if len(cs.replayBuffer) == 0 { // For the first op, which controls creation of the stream and // assigns cs.attempt, we need to create a new attempt inline // before executing the first op. On subsequent ops, the attempt // is created immediately before replaying the ops. var err error if cs.attempt, err = cs.newAttemptLocked(false /* isTransparent */); err != nil { cs.mu.Unlock() cs.finish(err) return err } } a := cs.attempt cs.mu.Unlock() err := op(a) cs.mu.Lock() if a != cs.attempt { // We started another attempt already. continue } if err == io.EOF { <-a.transportStream.Done() } if err == nil || (err == io.EOF && a.transportStream.Status().Code() == codes.OK) { onSuccess() cs.mu.Unlock() return err } if err := cs.retryLocked(a, err); err != nil { cs.mu.Unlock() return err } } } func (cs *clientStream) Header() (metadata.MD, error) { var m metadata.MD err := cs.withRetry(func(a *csAttempt) error { var err error m, err = a.transportStream.Header() return toRPCErr(err) }, cs.commitAttemptLocked) if m == nil && err == nil { // The stream ended with success. Finish the clientStream. err = io.EOF } if err != nil { cs.finish(err) // Do not return the error. The user should get it by calling Recv(). return nil, nil } if len(cs.binlogs) != 0 && !cs.serverHeaderBinlogged && m != nil { // Only log if binary log is on and header has not been logged, and // there is actually headers to log. logEntry := &binarylog.ServerHeader{ OnClientSide: true, Header: m, PeerAddr: nil, } if peer, ok := peer.FromContext(cs.Context()); ok { logEntry.PeerAddr = peer.Addr } cs.serverHeaderBinlogged = true for _, binlog := range cs.binlogs { binlog.Log(cs.ctx, logEntry) } } return m, nil } func (cs *clientStream) Trailer() metadata.MD { // On RPC failure, we never need to retry, because usage requires that // RecvMsg() returned a non-nil error before calling this function is valid. // We would have retried earlier if necessary. // // Commit the attempt anyway, just in case users are not following those // directions -- it will prevent races and should not meaningfully impact // performance. cs.commitAttempt() if cs.attempt.transportStream == nil { return nil } return cs.attempt.transportStream.Trailer() } func (cs *clientStream) replayBufferLocked(attempt *csAttempt) error { for _, f := range cs.replayBuffer { if err := f.op(attempt); err != nil { return err } } return nil } func (cs *clientStream) bufferForRetryLocked(sz int, op func(a *csAttempt) error, cleanup func()) { // Note: we still will buffer if retry is disabled (for transparent retries). if cs.committed { return } cs.replayBufferSize += sz if cs.replayBufferSize > cs.callInfo.maxRetryRPCBufferSize { cs.commitAttemptLocked() cleanup() return } cs.replayBuffer = append(cs.replayBuffer, replayOp{op: op, cleanup: cleanup}) } func (cs *clientStream) SendMsg(m any) (err error) { defer func() { if err != nil && err != io.EOF { // Call finish on the client stream for errors generated by this SendMsg // call, as these indicate problems created by this client. (Transport // errors are converted to an io.EOF error in csAttempt.sendMsg; the real // error will be returned from RecvMsg eventually in that case, or be // retried.) cs.finish(err) } }() if cs.sentLast { return status.Errorf(codes.Internal, "SendMsg called after CloseSend") } if !cs.desc.ClientStreams { cs.sentLast = true } // load hdr, payload, data hdr, data, payload, pf, err := prepareMsg(m, cs.codec, cs.compressorV0, cs.compressorV1, cs.cc.dopts.copts.BufferPool) if err != nil { return err } defer func() { data.Free() // only free payload if compression was made, and therefore it is a different set // of buffers from data. if pf.isCompressed() { payload.Free() } }() dataLen := data.Len() payloadLen := payload.Len() // TODO(dfawley): should we be checking len(data) instead? if payloadLen > *cs.callInfo.maxSendMessageSize { return status.Errorf(codes.ResourceExhausted, "trying to send message larger than max (%d vs. %d)", payloadLen, *cs.callInfo.maxSendMessageSize) } // always take an extra ref in case data == payload (i.e. when the data isn't // compressed). The original ref will always be freed by the deferred free above. payload.Ref() op := func(a *csAttempt) error { return a.sendMsg(m, hdr, payload, dataLen, payloadLen) } // onSuccess is invoked when the op is captured for a subsequent retry. If the // stream was established by a previous message and therefore retries are // disabled, onSuccess will not be invoked, and payloadRef can be freed // immediately. onSuccessCalled := false err = cs.withRetry(op, func() { cs.bufferForRetryLocked(len(hdr)+payloadLen, op, payload.Free) onSuccessCalled = true }) if !onSuccessCalled { payload.Free() } if len(cs.binlogs) != 0 && err == nil { cm := &binarylog.ClientMessage{ OnClientSide: true, Message: data.Materialize(), } for _, binlog := range cs.binlogs { binlog.Log(cs.ctx, cm) } } return err } func (cs *clientStream) RecvMsg(m any) error { if len(cs.binlogs) != 0 && !cs.serverHeaderBinlogged { // Call Header() to binary log header if it's not already logged. cs.Header() } var recvInfo *payloadInfo if len(cs.binlogs) != 0 { recvInfo = &payloadInfo{} defer recvInfo.free() } err := cs.withRetry(func(a *csAttempt) error { return a.recvMsg(m, recvInfo) }, cs.commitAttemptLocked) if len(cs.binlogs) != 0 && err == nil { sm := &binarylog.ServerMessage{ OnClientSide: true, Message: recvInfo.uncompressedBytes.Materialize(), } for _, binlog := range cs.binlogs { binlog.Log(cs.ctx, sm) } } if err != nil || !cs.desc.ServerStreams { // err != nil or non-server-streaming indicates end of stream. cs.finish(err) } return err } func (cs *clientStream) CloseSend() error { if cs.sentLast { // Return a nil error on repeated calls to this method. return nil } cs.sentLast = true op := func(a *csAttempt) error { a.transportStream.Write(nil, nil, &transport.WriteOptions{Last: true}) // Always return nil; io.EOF is the only error that might make sense // instead, but there is no need to signal the client to call RecvMsg // as the only use left for the stream after CloseSend is to call // RecvMsg. This also matches historical behavior. return nil } cs.withRetry(op, func() { cs.bufferForRetryLocked(0, op, nil) }) if len(cs.binlogs) != 0 { chc := &binarylog.ClientHalfClose{ OnClientSide: true, } for _, binlog := range cs.binlogs { binlog.Log(cs.ctx, chc) } } // We don't return an error here as we expect users to read all messages // from the stream and get the RPC status from RecvMsg(). Note that // SendMsg() must return an error when one occurs so the application // knows to stop sending messages, but that does not apply here. return nil } func (cs *clientStream) finish(err error) { if err == io.EOF { // Ending a stream with EOF indicates a success. err = nil } cs.mu.Lock() if cs.finished { cs.mu.Unlock() return } cs.finished = true cs.commitAttemptLocked() if cs.attempt != nil { cs.attempt.finish(err) // after functions all rely upon having a stream. if cs.attempt.transportStream != nil { for _, o := range cs.opts { o.after(cs.callInfo, cs.attempt) } } } cs.mu.Unlock() // Only one of cancel or trailer needs to be logged. if len(cs.binlogs) != 0 { switch err { case errContextCanceled, errContextDeadline, ErrClientConnClosing: c := &binarylog.Cancel{ OnClientSide: true, } for _, binlog := range cs.binlogs { binlog.Log(cs.ctx, c) } default: logEntry := &binarylog.ServerTrailer{ OnClientSide: true, Trailer: cs.Trailer(), Err: err, } if peer, ok := peer.FromContext(cs.Context()); ok { logEntry.PeerAddr = peer.Addr } for _, binlog := range cs.binlogs { binlog.Log(cs.ctx, logEntry) } } } if err == nil { cs.retryThrottler.successfulRPC() } endOfClientStream(cs.cc, err, cs.opts...) cs.cancel() } func (a *csAttempt) sendMsg(m any, hdr []byte, payld mem.BufferSlice, dataLength, payloadLength int) error { cs := a.cs if a.trInfo != nil { a.mu.Lock() if a.trInfo.tr != nil { a.trInfo.tr.LazyLog(&payload{sent: true, msg: m}, true) } a.mu.Unlock() } if err := a.transportStream.Write(hdr, payld, &transport.WriteOptions{Last: !cs.desc.ClientStreams}); err != nil { if !cs.desc.ClientStreams { // For non-client-streaming RPCs, we return nil instead of EOF on error // because the generated code requires it. finish is not called; RecvMsg() // will call it with the stream's status independently. return nil } return io.EOF } if a.statsHandler != nil { a.statsHandler.HandleRPC(a.ctx, outPayload(true, m, dataLength, payloadLength, time.Now())) } return nil } func (a *csAttempt) recvMsg(m any, payInfo *payloadInfo) (err error) { cs := a.cs if a.statsHandler != nil && payInfo == nil { payInfo = &payloadInfo{} defer payInfo.free() } if !a.decompressorSet { // Block until we receive headers containing received message encoding. if ct := a.transportStream.RecvCompress(); ct != "" && ct != encoding.Identity { if a.decompressorV0 == nil || a.decompressorV0.Type() != ct { // No configured decompressor, or it does not match the incoming // message encoding; attempt to find a registered compressor that does. a.decompressorV0 = nil a.decompressorV1 = encoding.GetCompressor(ct) } // Validate that the compression method is acceptable for this call. if !acceptedCompressorAllows(cs.callInfo.acceptedResponseCompressors, ct) { return status.Errorf(codes.Internal, "grpc: peer compressed the response with %q which is not allowed by AcceptCompressors", ct) } } else { // No compression is used; disable our decompressor. a.decompressorV0 = nil } // Only initialize this state once per stream. a.decompressorSet = true } if err := recv(&a.parser, cs.codec, a.transportStream, a.decompressorV0, m, *cs.callInfo.maxReceiveMessageSize, payInfo, a.decompressorV1, false); err != nil { if err == io.EOF { if statusErr := a.transportStream.Status().Err(); statusErr != nil { return statusErr } // Received no msg and status OK for non-server streaming rpcs. if !cs.desc.ServerStreams && !cs.receivedFirstMsg { return status.Error(codes.Internal, "cardinality violation: received no response message from non-server-streaming RPC") } return io.EOF // indicates successful end of stream. } return toRPCErr(err) } cs.receivedFirstMsg = true if a.trInfo != nil { a.mu.Lock() if a.trInfo.tr != nil { a.trInfo.tr.LazyLog(&payload{sent: false, msg: m}, true) } a.mu.Unlock() } if a.statsHandler != nil { a.statsHandler.HandleRPC(a.ctx, &stats.InPayload{ Client: true, RecvTime: time.Now(), Payload: m, WireLength: payInfo.compressedLength + headerLen, CompressedLength: payInfo.compressedLength, Length: payInfo.uncompressedBytes.Len(), }) } if cs.desc.ServerStreams { // Subsequent messages should be received by subsequent RecvMsg calls. return nil } // Special handling for non-server-stream rpcs. // This recv expects EOF or errors, so we don't collect inPayload. if err := recv(&a.parser, cs.codec, a.transportStream, a.decompressorV0, m, *cs.callInfo.maxReceiveMessageSize, nil, a.decompressorV1, false); err == io.EOF { return a.transportStream.Status().Err() // non-server streaming Recv returns nil on success } else if err != nil { return toRPCErr(err) } return status.Error(codes.Internal, "cardinality violation: expected for non server-streaming RPCs, but received another message") } func (a *csAttempt) finish(err error) { a.mu.Lock() if a.finished { a.mu.Unlock() return } a.finished = true if err == io.EOF { // Ending a stream with EOF indicates a success. err = nil } var tr metadata.MD if a.transportStream != nil { a.transportStream.Close(err) tr = a.transportStream.Trailer() } if a.pickResult.Done != nil { br := false if a.transportStream != nil { br = a.transportStream.BytesReceived() } a.pickResult.Done(balancer.DoneInfo{ Err: err, Trailer: tr, BytesSent: a.transportStream != nil, BytesReceived: br, ServerLoad: balancerload.Parse(tr), }) } if a.statsHandler != nil { a.statsHandler.HandleRPC(a.ctx, &stats.End{ Client: true, BeginTime: a.beginTime, EndTime: time.Now(), Trailer: tr, Error: err, }) } if a.trInfo != nil && a.trInfo.tr != nil { if err == nil { a.trInfo.tr.LazyPrintf("RPC: [OK]") } else { a.trInfo.tr.LazyPrintf("RPC: [%v]", err) a.trInfo.tr.SetError() } a.trInfo.tr.Finish() a.trInfo.tr = nil } a.mu.Unlock() } // newNonRetryClientStream creates a ClientStream with the specified transport, on the // given addrConn. // // It's expected that the given transport is either the same one in addrConn, or // is already closed. To avoid race, transport is specified separately, instead // of using ac.transport. // // Main difference between this and ClientConn.NewStream: // - no retry // - no service config (or wait for service config) // - no tracing or stats func newNonRetryClientStream(ctx context.Context, desc *StreamDesc, method string, t transport.ClientTransport, ac *addrConn, opts ...CallOption) (_ ClientStream, err error) { if t == nil { // TODO: return RPC error here? return nil, errors.New("transport provided is nil") } // defaultCallInfo contains unnecessary info(i.e. failfast, maxRetryRPCBufferSize), so we just initialize an empty struct. c := &callInfo{} // Possible context leak: // The cancel function for the child context we create will only be called // when RecvMsg returns a non-nil error, if the ClientConn is closed, or if // an error is generated by SendMsg. // https://github.com/grpc/grpc-go/issues/1818. ctx, cancel := context.WithCancel(ctx) defer func() { if err != nil { cancel() } }() for _, o := range opts { if err := o.before(c); err != nil { return nil, toRPCErr(err) } } c.maxReceiveMessageSize = getMaxSize(nil, c.maxReceiveMessageSize, defaultClientMaxReceiveMessageSize) c.maxSendMessageSize = getMaxSize(nil, c.maxSendMessageSize, defaultServerMaxSendMessageSize) if err := setCallInfoCodec(c); err != nil { return nil, err } callHdr := &transport.CallHdr{ Host: ac.cc.authority, Method: method, ContentSubtype: c.contentSubtype, } // Set our outgoing compression according to the UseCompressor CallOption, if // set. In that case, also find the compressor from the encoding package. // Otherwise, use the compressor configured by the WithCompressor DialOption, // if set. var cp Compressor var comp encoding.Compressor if ct := c.compressorName; ct != "" { callHdr.SendCompress = ct if ct != encoding.Identity { comp = encoding.GetCompressor(ct) if comp == nil { return nil, status.Errorf(codes.Internal, "grpc: Compressor is not installed for requested grpc-encoding %q", ct) } } } else if ac.cc.dopts.compressorV0 != nil { callHdr.SendCompress = ac.cc.dopts.compressorV0.Type() cp = ac.cc.dopts.compressorV0 } if c.creds != nil { callHdr.Creds = c.creds } // Use a special addrConnStream to avoid retry. as := &addrConnStream{ callHdr: callHdr, ac: ac, ctx: ctx, cancel: cancel, opts: opts, callInfo: c, desc: desc, codec: c.codec, sendCompressorV0: cp, sendCompressorV1: comp, transport: t, } s, err := as.transport.NewStream(as.ctx, as.callHdr) if err != nil { err = toRPCErr(err) return nil, err } as.transportStream = s as.parser = parser{r: s, bufferPool: ac.dopts.copts.BufferPool} ac.incrCallsStarted() if desc != unaryStreamDesc { // Listen on stream context to cleanup when the stream context is // canceled. Also listen for the addrConn's context in case the // addrConn is closed or reconnects to a different address. In all // other cases, an error should already be injected into the recv // buffer by the transport, which the client will eventually receive, // and then we will cancel the stream's context in // addrConnStream.finish. go func() { ac.mu.Lock() acCtx := ac.ctx ac.mu.Unlock() select { case <-acCtx.Done(): as.finish(status.Error(codes.Canceled, "grpc: the SubConn is closing")) case <-ctx.Done(): as.finish(toRPCErr(ctx.Err())) } }() } return as, nil } type addrConnStream struct { transportStream *transport.ClientStream ac *addrConn callHdr *transport.CallHdr cancel context.CancelFunc opts []CallOption callInfo *callInfo transport transport.ClientTransport ctx context.Context sentLast bool receivedFirstMsg bool desc *StreamDesc codec baseCodec sendCompressorV0 Compressor sendCompressorV1 encoding.Compressor decompressorSet bool decompressorV0 Decompressor decompressorV1 encoding.Compressor parser parser // mu guards finished and is held for the entire finish method. mu sync.Mutex finished bool } func (as *addrConnStream) Header() (metadata.MD, error) { m, err := as.transportStream.Header() if err != nil { as.finish(toRPCErr(err)) } return m, err } func (as *addrConnStream) Trailer() metadata.MD { return as.transportStream.Trailer() } func (as *addrConnStream) CloseSend() error { if as.sentLast { // Return a nil error on repeated calls to this method. return nil } as.sentLast = true as.transportStream.Write(nil, nil, &transport.WriteOptions{Last: true}) // Always return nil; io.EOF is the only error that might make sense // instead, but there is no need to signal the client to call RecvMsg // as the only use left for the stream after CloseSend is to call // RecvMsg. This also matches historical behavior. return nil } func (as *addrConnStream) Context() context.Context { return as.transportStream.Context() } func (as *addrConnStream) SendMsg(m any) (err error) { defer func() { if err != nil && err != io.EOF { // Call finish on the client stream for errors generated by this SendMsg // call, as these indicate problems created by this client. (Transport // errors are converted to an io.EOF error in csAttempt.sendMsg; the real // error will be returned from RecvMsg eventually in that case, or be // retried.) as.finish(err) } }() if as.sentLast { return status.Errorf(codes.Internal, "SendMsg called after CloseSend") } if !as.desc.ClientStreams { as.sentLast = true } // load hdr, payload, data hdr, data, payload, pf, err := prepareMsg(m, as.codec, as.sendCompressorV0, as.sendCompressorV1, as.ac.dopts.copts.BufferPool) if err != nil { return err } defer func() { data.Free() // only free payload if compression was made, and therefore it is a different set // of buffers from data. if pf.isCompressed() { payload.Free() } }() // TODO(dfawley): should we be checking len(data) instead? if payload.Len() > *as.callInfo.maxSendMessageSize { return status.Errorf(codes.ResourceExhausted, "trying to send message larger than max (%d vs. %d)", payload.Len(), *as.callInfo.maxSendMessageSize) } if err := as.transportStream.Write(hdr, payload, &transport.WriteOptions{Last: !as.desc.ClientStreams}); err != nil { if !as.desc.ClientStreams { // For non-client-streaming RPCs, we return nil instead of EOF on error // because the generated code requires it. finish is not called; RecvMsg() // will call it with the stream's status independently. return nil } return io.EOF } return nil } func (as *addrConnStream) RecvMsg(m any) (err error) { defer func() { if err != nil || !as.desc.ServerStreams { // err != nil or non-server-streaming indicates end of stream. as.finish(err) } }() if !as.decompressorSet { // Block until we receive headers containing received message encoding. if ct := as.transportStream.RecvCompress(); ct != "" && ct != encoding.Identity { if as.decompressorV0 == nil || as.decompressorV0.Type() != ct { // No configured decompressor, or it does not match the incoming // message encoding; attempt to find a registered compressor that does. as.decompressorV0 = nil as.decompressorV1 = encoding.GetCompressor(ct) } // Validate that the compression method is acceptable for this call. if !acceptedCompressorAllows(as.callInfo.acceptedResponseCompressors, ct) { return status.Errorf(codes.Internal, "grpc: peer compressed the response with %q which is not allowed by AcceptCompressors", ct) } } else { // No compression is used; disable our decompressor. as.decompressorV0 = nil } // Only initialize this state once per stream. as.decompressorSet = true } if err := recv(&as.parser, as.codec, as.transportStream, as.decompressorV0, m, *as.callInfo.maxReceiveMessageSize, nil, as.decompressorV1, false); err != nil { if err == io.EOF { if statusErr := as.transportStream.Status().Err(); statusErr != nil { return statusErr } // Received no msg and status OK for non-server streaming rpcs. if !as.desc.ServerStreams && !as.receivedFirstMsg { return status.Error(codes.Internal, "cardinality violation: received no response message from non-server-streaming RPC") } return io.EOF // indicates successful end of stream. } return toRPCErr(err) } as.receivedFirstMsg = true if as.desc.ServerStreams { // Subsequent messages should be received by subsequent RecvMsg calls. return nil } // Special handling for non-server-stream rpcs. // This recv expects EOF or errors, so we don't collect inPayload. if err := recv(&as.parser, as.codec, as.transportStream, as.decompressorV0, m, *as.callInfo.maxReceiveMessageSize, nil, as.decompressorV1, false); err == io.EOF { return as.transportStream.Status().Err() // non-server streaming Recv returns nil on success } else if err != nil { return toRPCErr(err) } return status.Error(codes.Internal, "cardinality violation: expected for non server-streaming RPCs, but received another message") } func (as *addrConnStream) finish(err error) { as.mu.Lock() if as.finished { as.mu.Unlock() return } as.finished = true if err == io.EOF { // Ending a stream with EOF indicates a success. err = nil } if as.transportStream != nil { as.transportStream.Close(err) } if err != nil { as.ac.incrCallsFailed() } else { as.ac.incrCallsSucceeded() } as.cancel() as.mu.Unlock() } // ServerStream defines the server-side behavior of a streaming RPC. // // Errors returned from ServerStream methods are compatible with the status // package. However, the status code will often not match the RPC status as // seen by the client application, and therefore, should not be relied upon for // this purpose. type ServerStream interface { // SetHeader sets the header metadata. It may be called multiple times. // When call multiple times, all the provided metadata will be merged. // All the metadata will be sent out when one of the following happens: // - ServerStream.SendHeader() is called; // - The first response is sent out; // - An RPC status is sent out (error or success). SetHeader(metadata.MD) error // SendHeader sends the header metadata. // The provided md and headers set by SetHeader() will be sent. // It fails if called multiple times. SendHeader(metadata.MD) error // SetTrailer sets the trailer metadata which will be sent with the RPC status. // When called more than once, all the provided metadata will be merged. SetTrailer(metadata.MD) // Context returns the context for this stream. Context() context.Context // SendMsg sends a message. On error, SendMsg aborts the stream and the // error is returned directly. // // SendMsg blocks until: // - There is sufficient flow control to schedule m with the transport, or // - The stream is done, or // - The stream breaks. // // SendMsg does not wait until the message is received by the client. An // untimely stream closure may result in lost messages. // // It is safe to have a goroutine calling SendMsg and another goroutine // calling RecvMsg on the same stream at the same time, but it is not safe // to call SendMsg on the same stream in different goroutines. // // It is not safe to modify the message after calling SendMsg. Tracing // libraries and stats handlers may use the message lazily. SendMsg(m any) error // RecvMsg blocks until it receives a message into m or the stream is // done. It returns io.EOF when the client has performed a CloseSend. On // any non-EOF error, the stream is aborted and the error contains the // RPC status. // // It is safe to have a goroutine calling SendMsg and another goroutine // calling RecvMsg on the same stream at the same time, but it is not // safe to call RecvMsg on the same stream in different goroutines. RecvMsg(m any) error } // serverStream implements a server side Stream. type serverStream struct { ctx context.Context s *transport.ServerStream p parser codec baseCodec desc *StreamDesc compressorV0 Compressor compressorV1 encoding.Compressor decompressorV0 Decompressor decompressorV1 encoding.Compressor sendCompressorName string recvFirstMsg bool // set after the first message is received maxReceiveMessageSize int maxSendMessageSize int trInfo *traceInfo statsHandler stats.Handler binlogs []binarylog.MethodLogger // serverHeaderBinlogged indicates whether server header has been logged. It // will happen when one of the following two happens: stream.SendHeader(), // stream.Send(). // // It's only checked in send and sendHeader, doesn't need to be // synchronized. serverHeaderBinlogged bool mu sync.Mutex // protects trInfo.tr after the service handler runs. } func (ss *serverStream) Context() context.Context { return ss.ctx } func (ss *serverStream) SetHeader(md metadata.MD) error { if md.Len() == 0 { return nil } err := imetadata.Validate(md) if err != nil { return status.Error(codes.Internal, err.Error()) } return ss.s.SetHeader(md) } func (ss *serverStream) SendHeader(md metadata.MD) error { err := imetadata.Validate(md) if err != nil { return status.Error(codes.Internal, err.Error()) } err = ss.s.SendHeader(md) if len(ss.binlogs) != 0 && !ss.serverHeaderBinlogged { h, _ := ss.s.Header() sh := &binarylog.ServerHeader{ Header: h, } ss.serverHeaderBinlogged = true for _, binlog := range ss.binlogs { binlog.Log(ss.ctx, sh) } } return err } func (ss *serverStream) SetTrailer(md metadata.MD) { if md.Len() == 0 { return } if err := imetadata.Validate(md); err != nil { logger.Errorf("stream: failed to validate md when setting trailer, err: %v", err) } ss.s.SetTrailer(md) } func (ss *serverStream) SendMsg(m any) (err error) { defer func() { if ss.trInfo != nil { ss.mu.Lock() if ss.trInfo.tr != nil { if err == nil { ss.trInfo.tr.LazyLog(&payload{sent: true, msg: m}, true) } else { ss.trInfo.tr.LazyLog(&fmtStringer{"%v", []any{err}}, true) ss.trInfo.tr.SetError() } } ss.mu.Unlock() } if err != nil && err != io.EOF { st, _ := status.FromError(toRPCErr(err)) ss.s.WriteStatus(st) // Non-user specified status was sent out. This should be an error // case (as a server side Cancel maybe). // // This is not handled specifically now. User will return a final // status from the service handler, we will log that error instead. // This behavior is similar to an interceptor. } }() // Server handler could have set new compressor by calling SetSendCompressor. // In case it is set, we need to use it for compressing outbound message. if sendCompressorsName := ss.s.SendCompress(); sendCompressorsName != ss.sendCompressorName { ss.compressorV1 = encoding.GetCompressor(sendCompressorsName) ss.sendCompressorName = sendCompressorsName } // load hdr, payload, data hdr, data, payload, pf, err := prepareMsg(m, ss.codec, ss.compressorV0, ss.compressorV1, ss.p.bufferPool) if err != nil { return err } defer func() { data.Free() // only free payload if compression was made, and therefore it is a different set // of buffers from data. if pf.isCompressed() { payload.Free() } }() dataLen := data.Len() payloadLen := payload.Len() // TODO(dfawley): should we be checking len(data) instead? if payloadLen > ss.maxSendMessageSize { return status.Errorf(codes.ResourceExhausted, "trying to send message larger than max (%d vs. %d)", payloadLen, ss.maxSendMessageSize) } if err := ss.s.Write(hdr, payload, &transport.WriteOptions{Last: false}); err != nil { return toRPCErr(err) } if len(ss.binlogs) != 0 { if !ss.serverHeaderBinlogged { h, _ := ss.s.Header() sh := &binarylog.ServerHeader{ Header: h, } ss.serverHeaderBinlogged = true for _, binlog := range ss.binlogs { binlog.Log(ss.ctx, sh) } } sm := &binarylog.ServerMessage{ Message: data.Materialize(), } for _, binlog := range ss.binlogs { binlog.Log(ss.ctx, sm) } } if ss.statsHandler != nil { ss.statsHandler.HandleRPC(ss.s.Context(), outPayload(false, m, dataLen, payloadLen, time.Now())) } return nil } func (ss *serverStream) RecvMsg(m any) (err error) { defer func() { if ss.trInfo != nil { ss.mu.Lock() if ss.trInfo.tr != nil { if err == nil { ss.trInfo.tr.LazyLog(&payload{sent: false, msg: m}, true) } else if err != io.EOF { ss.trInfo.tr.LazyLog(&fmtStringer{"%v", []any{err}}, true) ss.trInfo.tr.SetError() } } ss.mu.Unlock() } if err != nil && err != io.EOF { st, _ := status.FromError(toRPCErr(err)) ss.s.WriteStatus(st) // Non-user specified status was sent out. This should be an error // case (as a server side Cancel maybe). // // This is not handled specifically now. User will return a final // status from the service handler, we will log that error instead. // This behavior is similar to an interceptor. } }() var payInfo *payloadInfo if ss.statsHandler != nil || len(ss.binlogs) != 0 { payInfo = &payloadInfo{} defer payInfo.free() } if err := recv(&ss.p, ss.codec, ss.s, ss.decompressorV0, m, ss.maxReceiveMessageSize, payInfo, ss.decompressorV1, true); err != nil { if err == io.EOF { if len(ss.binlogs) != 0 { chc := &binarylog.ClientHalfClose{} for _, binlog := range ss.binlogs { binlog.Log(ss.ctx, chc) } } // Received no request msg for non-client streaming rpcs. if !ss.desc.ClientStreams && !ss.recvFirstMsg { return status.Error(codes.Internal, "cardinality violation: received no request message from non-client-streaming RPC") } return err } if err == io.ErrUnexpectedEOF { err = status.Error(codes.Internal, io.ErrUnexpectedEOF.Error()) } return toRPCErr(err) } ss.recvFirstMsg = true if ss.statsHandler != nil { ss.statsHandler.HandleRPC(ss.s.Context(), &stats.InPayload{ RecvTime: time.Now(), Payload: m, Length: payInfo.uncompressedBytes.Len(), WireLength: payInfo.compressedLength + headerLen, CompressedLength: payInfo.compressedLength, }) } if len(ss.binlogs) != 0 { cm := &binarylog.ClientMessage{ Message: payInfo.uncompressedBytes.Materialize(), } for _, binlog := range ss.binlogs { binlog.Log(ss.ctx, cm) } } if ss.desc.ClientStreams { // Subsequent messages should be received by subsequent RecvMsg calls. return nil } // Special handling for non-client-stream rpcs. // This recv expects EOF or errors, so we don't collect inPayload. if err := recv(&ss.p, ss.codec, ss.s, ss.decompressorV0, m, ss.maxReceiveMessageSize, nil, ss.decompressorV1, true); err == io.EOF { return nil } else if err != nil { return err } return status.Error(codes.Internal, "cardinality violation: received multiple request messages for non-client-streaming RPC") } // MethodFromServerStream returns the method string for the input stream. // The returned string is in the format of "/service/method". func MethodFromServerStream(stream ServerStream) (string, bool) { return Method(stream.Context()) } // prepareMsg returns the hdr, payload and data using the compressors passed or // using the passed preparedmsg. The returned boolean indicates whether // compression was made and therefore whether the payload needs to be freed in // addition to the returned data. Freeing the payload if the returned boolean is // false can lead to undefined behavior. func prepareMsg(m any, codec baseCodec, cp Compressor, comp encoding.Compressor, pool mem.BufferPool) (hdr []byte, data, payload mem.BufferSlice, pf payloadFormat, err error) { if preparedMsg, ok := m.(*PreparedMsg); ok { return preparedMsg.hdr, preparedMsg.encodedData, preparedMsg.payload, preparedMsg.pf, nil } // The input interface is not a prepared msg. // Marshal and Compress the data at this point data, err = encode(codec, m) if err != nil { return nil, nil, nil, 0, err } compData, pf, err := compress(data, cp, comp, pool) if err != nil { data.Free() return nil, nil, nil, 0, err } hdr, payload = msgHeader(data, compData, pf) return hdr, data, payload, pf, nil } ================================================ FILE: vendor/google.golang.org/grpc/stream_interfaces.go ================================================ /* * * Copyright 2024 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package grpc // ServerStreamingClient represents the client side of a server-streaming (one // request, many responses) RPC. It is generic over the type of the response // message. It is used in generated code. type ServerStreamingClient[Res any] interface { // Recv receives the next response message from the server. The client may // repeatedly call Recv to read messages from the response stream. If // io.EOF is returned, the stream has terminated with an OK status. Any // other error is compatible with the status package and indicates the // RPC's status code and message. Recv() (*Res, error) // ClientStream is embedded to provide Context, Header, and Trailer // functionality. No other methods in the ClientStream should be called // directly. ClientStream } // ServerStreamingServer represents the server side of a server-streaming (one // request, many responses) RPC. It is generic over the type of the response // message. It is used in generated code. // // To terminate the response stream, return from the handler method and return // an error from the status package, or use nil to indicate an OK status code. type ServerStreamingServer[Res any] interface { // Send sends a response message to the client. The server handler may // call Send multiple times to send multiple messages to the client. An // error is returned if the stream was terminated unexpectedly, and the // handler method should return, as the stream is no longer usable. Send(*Res) error // ServerStream is embedded to provide Context, SetHeader, SendHeader, and // SetTrailer functionality. No other methods in the ServerStream should // be called directly. ServerStream } // ClientStreamingClient represents the client side of a client-streaming (many // requests, one response) RPC. It is generic over both the type of the request // message stream and the type of the unary response message. It is used in // generated code. type ClientStreamingClient[Req any, Res any] interface { // Send sends a request message to the server. The client may call Send // multiple times to send multiple messages to the server. On error, Send // aborts the stream. If the error was generated by the client, the status // is returned directly. Otherwise, io.EOF is returned, and the status of // the stream may be discovered using CloseAndRecv(). Send(*Req) error // CloseAndRecv closes the request stream and waits for the server's // response. This method must be called once and only once after sending // all request messages. Any error returned is implemented by the status // package. CloseAndRecv() (*Res, error) // ClientStream is embedded to provide Context, Header, and Trailer // functionality. No other methods in the ClientStream should be called // directly. ClientStream } // ClientStreamingServer represents the server side of a client-streaming (many // requests, one response) RPC. It is generic over both the type of the request // message stream and the type of the unary response message. It is used in // generated code. // // To terminate the RPC, call SendAndClose and return nil from the method // handler or do not call SendAndClose and return an error from the status // package. type ClientStreamingServer[Req any, Res any] interface { // Recv receives the next request message from the client. The server may // repeatedly call Recv to read messages from the request stream. If // io.EOF is returned, it indicates the client called CloseAndRecv on its // ClientStreamingClient. Any other error indicates the stream was // terminated unexpectedly, and the handler method should return, as the // stream is no longer usable. Recv() (*Req, error) // SendAndClose sends a single response message to the client and closes // the stream. This method must be called once and only once after all // request messages have been processed. Recv should not be called after // calling SendAndClose. SendAndClose(*Res) error // ServerStream is embedded to provide Context, SetHeader, SendHeader, and // SetTrailer functionality. No other methods in the ServerStream should // be called directly. ServerStream } // BidiStreamingClient represents the client side of a bidirectional-streaming // (many requests, many responses) RPC. It is generic over both the type of the // request message stream and the type of the response message stream. It is // used in generated code. type BidiStreamingClient[Req any, Res any] interface { // Send sends a request message to the server. The client may call Send // multiple times to send multiple messages to the server. On error, Send // aborts the stream. If the error was generated by the client, the status // is returned directly. Otherwise, io.EOF is returned, and the status of // the stream may be discovered using Recv(). Send(*Req) error // Recv receives the next response message from the server. The client may // repeatedly call Recv to read messages from the response stream. If // io.EOF is returned, the stream has terminated with an OK status. Any // other error is compatible with the status package and indicates the // RPC's status code and message. Recv() (*Res, error) // ClientStream is embedded to provide Context, Header, Trailer, and // CloseSend functionality. No other methods in the ClientStream should be // called directly. ClientStream } // BidiStreamingServer represents the server side of a bidirectional-streaming // (many requests, many responses) RPC. It is generic over both the type of the // request message stream and the type of the response message stream. It is // used in generated code. // // To terminate the stream, return from the handler method and return // an error from the status package, or use nil to indicate an OK status code. type BidiStreamingServer[Req any, Res any] interface { // Recv receives the next request message from the client. The server may // repeatedly call Recv to read messages from the request stream. If // io.EOF is returned, it indicates the client called CloseSend on its // BidiStreamingClient. Any other error indicates the stream was // terminated unexpectedly, and the handler method should return, as the // stream is no longer usable. Recv() (*Req, error) // Send sends a response message to the client. The server handler may // call Send multiple times to send multiple messages to the client. An // error is returned if the stream was terminated unexpectedly, and the // handler method should return, as the stream is no longer usable. Send(*Res) error // ServerStream is embedded to provide Context, SetHeader, SendHeader, and // SetTrailer functionality. No other methods in the ServerStream should // be called directly. ServerStream } // GenericClientStream implements the ServerStreamingClient, ClientStreamingClient, // and BidiStreamingClient interfaces. It is used in generated code. type GenericClientStream[Req any, Res any] struct { ClientStream } var _ ServerStreamingClient[string] = (*GenericClientStream[int, string])(nil) var _ ClientStreamingClient[int, string] = (*GenericClientStream[int, string])(nil) var _ BidiStreamingClient[int, string] = (*GenericClientStream[int, string])(nil) // Send pushes one message into the stream of requests to be consumed by the // server. The type of message which can be sent is determined by the Req type // parameter of the GenericClientStream receiver. func (x *GenericClientStream[Req, Res]) Send(m *Req) error { return x.ClientStream.SendMsg(m) } // Recv reads one message from the stream of responses generated by the server. // The type of the message returned is determined by the Res type parameter // of the GenericClientStream receiver. func (x *GenericClientStream[Req, Res]) Recv() (*Res, error) { m := new(Res) if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err } return m, nil } // CloseAndRecv closes the sending side of the stream, then receives the unary // response from the server. The type of message which it returns is determined // by the Res type parameter of the GenericClientStream receiver. func (x *GenericClientStream[Req, Res]) CloseAndRecv() (*Res, error) { if err := x.ClientStream.CloseSend(); err != nil { return nil, err } m := new(Res) if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err } return m, nil } // GenericServerStream implements the ServerStreamingServer, ClientStreamingServer, // and BidiStreamingServer interfaces. It is used in generated code. type GenericServerStream[Req any, Res any] struct { ServerStream } var _ ServerStreamingServer[string] = (*GenericServerStream[int, string])(nil) var _ ClientStreamingServer[int, string] = (*GenericServerStream[int, string])(nil) var _ BidiStreamingServer[int, string] = (*GenericServerStream[int, string])(nil) // Send pushes one message into the stream of responses to be consumed by the // client. The type of message which can be sent is determined by the Res // type parameter of the serverStreamServer receiver. func (x *GenericServerStream[Req, Res]) Send(m *Res) error { return x.ServerStream.SendMsg(m) } // SendAndClose pushes the unary response to the client. The type of message // which can be sent is determined by the Res type parameter of the // clientStreamServer receiver. func (x *GenericServerStream[Req, Res]) SendAndClose(m *Res) error { return x.ServerStream.SendMsg(m) } // Recv reads one message from the stream of requests generated by the client. // The type of the message returned is determined by the Req type parameter // of the clientStreamServer receiver. func (x *GenericServerStream[Req, Res]) Recv() (*Req, error) { m := new(Req) if err := x.ServerStream.RecvMsg(m); err != nil { return nil, err } return m, nil } ================================================ FILE: vendor/google.golang.org/grpc/tap/tap.go ================================================ /* * * Copyright 2016 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package tap defines the function handles which are executed on the transport // layer of gRPC-Go and related information. // // # Experimental // // Notice: This API is EXPERIMENTAL and may be changed or removed in a // later release. package tap import ( "context" "google.golang.org/grpc/metadata" ) // Info defines the relevant information needed by the handles. type Info struct { // FullMethodName is the string of grpc method (in the format of // /package.service/method). FullMethodName string // Header contains the header metadata received. Header metadata.MD // TODO: More to be added. } // ServerInHandle defines the function which runs before a new stream is // created on the server side. If it returns a non-nil error, the stream will // not be created and an error will be returned to the client. If the error // returned is a status error, that status code and message will be used, // otherwise PermissionDenied will be the code and err.Error() will be the // message. // // It's intended to be used in situations where you don't want to waste the // resources to accept the new stream (e.g. rate-limiting). For other general // usages, please use interceptors. // // Note that it is executed in the per-connection I/O goroutine(s) instead of // per-RPC goroutine. Therefore, users should NOT have any // blocking/time-consuming work in this handle. Otherwise all the RPCs would // slow down. Also, for the same reason, this handle won't be called // concurrently by gRPC. type ServerInHandle func(ctx context.Context, info *Info) (context.Context, error) ================================================ FILE: vendor/google.golang.org/grpc/trace.go ================================================ /* * * Copyright 2015 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package grpc import ( "bytes" "fmt" "io" "net" "strings" "sync" "time" ) // EnableTracing controls whether to trace RPCs using the golang.org/x/net/trace package. // This should only be set before any RPCs are sent or received by this program. var EnableTracing bool // methodFamily returns the trace family for the given method. // It turns "/pkg.Service/GetFoo" into "pkg.Service". func methodFamily(m string) string { m = strings.TrimPrefix(m, "/") // remove leading slash if i := strings.Index(m, "/"); i >= 0 { m = m[:i] // remove everything from second slash } return m } // traceEventLog mirrors golang.org/x/net/trace.EventLog. // // It exists in order to avoid importing x/net/trace on grpcnotrace builds. type traceEventLog interface { Printf(format string, a ...any) Errorf(format string, a ...any) Finish() } // traceLog mirrors golang.org/x/net/trace.Trace. // // It exists in order to avoid importing x/net/trace on grpcnotrace builds. type traceLog interface { LazyLog(x fmt.Stringer, sensitive bool) LazyPrintf(format string, a ...any) SetError() SetRecycler(f func(any)) SetTraceInfo(traceID, spanID uint64) SetMaxEvents(m int) Finish() } // traceInfo contains tracing information for an RPC. type traceInfo struct { tr traceLog firstLine firstLine } // firstLine is the first line of an RPC trace. // It may be mutated after construction; remoteAddr specifically may change // during client-side use. type firstLine struct { mu sync.Mutex client bool // whether this is a client (outgoing) RPC remoteAddr net.Addr deadline time.Duration // may be zero } func (f *firstLine) SetRemoteAddr(addr net.Addr) { f.mu.Lock() f.remoteAddr = addr f.mu.Unlock() } func (f *firstLine) String() string { f.mu.Lock() defer f.mu.Unlock() var line bytes.Buffer io.WriteString(&line, "RPC: ") if f.client { io.WriteString(&line, "to") } else { io.WriteString(&line, "from") } fmt.Fprintf(&line, " %v deadline:", f.remoteAddr) if f.deadline != 0 { fmt.Fprint(&line, f.deadline) } else { io.WriteString(&line, "none") } return line.String() } const truncateSize = 100 func truncate(x string, l int) string { if l > len(x) { return x } return x[:l] } // payload represents an RPC request or response payload. type payload struct { sent bool // whether this is an outgoing payload msg any // e.g. a proto.Message // TODO(dsymonds): add stringifying info to codec, and limit how much we hold here? } func (p payload) String() string { if p.sent { return truncate(fmt.Sprintf("sent: %v", p.msg), truncateSize) } return truncate(fmt.Sprintf("recv: %v", p.msg), truncateSize) } type fmtStringer struct { format string a []any } func (f *fmtStringer) String() string { return fmt.Sprintf(f.format, f.a...) } type stringer string func (s stringer) String() string { return string(s) } ================================================ FILE: vendor/google.golang.org/grpc/trace_notrace.go ================================================ //go:build grpcnotrace /* * * Copyright 2024 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package grpc // grpcnotrace can be used to avoid importing golang.org/x/net/trace, which in // turn enables binaries using gRPC-Go for dead code elimination, which can // yield 10-15% improvements in binary size when tracing is not needed. import ( "context" "fmt" ) type notrace struct{} func (notrace) LazyLog(x fmt.Stringer, sensitive bool) {} func (notrace) LazyPrintf(format string, a ...any) {} func (notrace) SetError() {} func (notrace) SetRecycler(f func(any)) {} func (notrace) SetTraceInfo(traceID, spanID uint64) {} func (notrace) SetMaxEvents(m int) {} func (notrace) Finish() {} func newTrace(family, title string) traceLog { return notrace{} } func newTraceContext(ctx context.Context, tr traceLog) context.Context { return ctx } func newTraceEventLog(family, title string) traceEventLog { return nil } ================================================ FILE: vendor/google.golang.org/grpc/trace_withtrace.go ================================================ //go:build !grpcnotrace /* * * Copyright 2024 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package grpc import ( "context" t "golang.org/x/net/trace" ) func newTrace(family, title string) traceLog { return t.New(family, title) } func newTraceContext(ctx context.Context, tr traceLog) context.Context { return t.NewContext(ctx, tr) } func newTraceEventLog(family, title string) traceEventLog { return t.NewEventLog(family, title) } ================================================ FILE: vendor/google.golang.org/grpc/version.go ================================================ /* * * Copyright 2018 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package grpc // Version is the current grpc version. const Version = "1.78.0" ================================================ FILE: vendor/google.golang.org/protobuf/LICENSE ================================================ Copyright (c) 2018 The Go Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: vendor/google.golang.org/protobuf/PATENTS ================================================ Additional IP Rights Grant (Patents) "This implementation" means the copyrightable works distributed by Google as part of the Go project. Google hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, transfer and otherwise run, modify and propagate the contents of this implementation of Go, where such license applies only to those patent claims, both currently owned or controlled by Google and acquired in the future, licensable by Google that are necessarily infringed by this implementation of Go. This grant does not include claims that would be infringed only as a consequence of further modification of this implementation. If you or your agent or exclusive licensee institute or order or agree to the institution of patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that this implementation of Go or any code incorporated within this implementation of Go constitutes direct or contributory patent infringement, or inducement of patent infringement, then any patent rights granted to you under this License for this implementation of Go shall terminate as of the date such litigation is filed. ================================================ FILE: vendor/google.golang.org/protobuf/encoding/protojson/decode.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package protojson import ( "encoding/base64" "fmt" "math" "strconv" "strings" "google.golang.org/protobuf/encoding/protowire" "google.golang.org/protobuf/internal/encoding/json" "google.golang.org/protobuf/internal/encoding/messageset" "google.golang.org/protobuf/internal/errors" "google.golang.org/protobuf/internal/flags" "google.golang.org/protobuf/internal/genid" "google.golang.org/protobuf/internal/pragma" "google.golang.org/protobuf/internal/set" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/reflect/protoregistry" ) // Unmarshal reads the given []byte into the given [proto.Message]. // The provided message must be mutable (e.g., a non-nil pointer to a message). func Unmarshal(b []byte, m proto.Message) error { return UnmarshalOptions{}.Unmarshal(b, m) } // UnmarshalOptions is a configurable JSON format parser. type UnmarshalOptions struct { pragma.NoUnkeyedLiterals // If AllowPartial is set, input for messages that will result in missing // required fields will not return an error. AllowPartial bool // If DiscardUnknown is set, unknown fields and enum name values are ignored. DiscardUnknown bool // Resolver is used for looking up types when unmarshaling // google.protobuf.Any messages or extension fields. // If nil, this defaults to using protoregistry.GlobalTypes. Resolver interface { protoregistry.MessageTypeResolver protoregistry.ExtensionTypeResolver } // RecursionLimit limits how deeply messages may be nested. // If zero, a default limit is applied. RecursionLimit int } // Unmarshal reads the given []byte and populates the given [proto.Message] // using options in the UnmarshalOptions object. // It will clear the message first before setting the fields. // If it returns an error, the given message may be partially set. // The provided message must be mutable (e.g., a non-nil pointer to a message). func (o UnmarshalOptions) Unmarshal(b []byte, m proto.Message) error { return o.unmarshal(b, m) } // unmarshal is a centralized function that all unmarshal operations go through. // For profiling purposes, avoid changing the name of this function or // introducing other code paths for unmarshal that do not go through this. func (o UnmarshalOptions) unmarshal(b []byte, m proto.Message) error { proto.Reset(m) if o.Resolver == nil { o.Resolver = protoregistry.GlobalTypes } if o.RecursionLimit == 0 { o.RecursionLimit = protowire.DefaultRecursionLimit } dec := decoder{json.NewDecoder(b), o} if err := dec.unmarshalMessage(m.ProtoReflect(), false); err != nil { return err } // Check for EOF. tok, err := dec.Read() if err != nil { return err } if tok.Kind() != json.EOF { return dec.unexpectedTokenError(tok) } if o.AllowPartial { return nil } return proto.CheckInitialized(m) } type decoder struct { *json.Decoder opts UnmarshalOptions } // newError returns an error object with position info. func (d decoder) newError(pos int, f string, x ...any) error { line, column := d.Position(pos) head := fmt.Sprintf("(line %d:%d): ", line, column) return errors.New(head+f, x...) } // unexpectedTokenError returns a syntax error for the given unexpected token. func (d decoder) unexpectedTokenError(tok json.Token) error { return d.syntaxError(tok.Pos(), "unexpected token %s", tok.RawString()) } // syntaxError returns a syntax error for given position. func (d decoder) syntaxError(pos int, f string, x ...any) error { line, column := d.Position(pos) head := fmt.Sprintf("syntax error (line %d:%d): ", line, column) return errors.New(head+f, x...) } // unmarshalMessage unmarshals a message into the given protoreflect.Message. func (d decoder) unmarshalMessage(m protoreflect.Message, skipTypeURL bool) error { d.opts.RecursionLimit-- if d.opts.RecursionLimit < 0 { return errors.New("exceeded max recursion depth") } if unmarshal := wellKnownTypeUnmarshaler(m.Descriptor().FullName()); unmarshal != nil { return unmarshal(d, m) } tok, err := d.Read() if err != nil { return err } if tok.Kind() != json.ObjectOpen { return d.unexpectedTokenError(tok) } messageDesc := m.Descriptor() if !flags.ProtoLegacy && messageset.IsMessageSet(messageDesc) { return errors.New("no support for proto1 MessageSets") } var seenNums set.Ints var seenOneofs set.Ints fieldDescs := messageDesc.Fields() for { // Read field name. tok, err := d.Read() if err != nil { return err } switch tok.Kind() { default: return d.unexpectedTokenError(tok) case json.ObjectClose: return nil case json.Name: // Continue below. } name := tok.Name() // Unmarshaling a non-custom embedded message in Any will contain the // JSON field "@type" which should be skipped because it is not a field // of the embedded message, but simply an artifact of the Any format. if skipTypeURL && name == "@type" { d.Read() continue } // Get the FieldDescriptor. var fd protoreflect.FieldDescriptor if strings.HasPrefix(name, "[") && strings.HasSuffix(name, "]") { // Only extension names are in [name] format. extName := protoreflect.FullName(name[1 : len(name)-1]) extType, err := d.opts.Resolver.FindExtensionByName(extName) if err != nil && err != protoregistry.NotFound { return d.newError(tok.Pos(), "unable to resolve %s: %v", tok.RawString(), err) } if extType != nil { fd = extType.TypeDescriptor() if !messageDesc.ExtensionRanges().Has(fd.Number()) || fd.ContainingMessage().FullName() != messageDesc.FullName() { return d.newError(tok.Pos(), "message %v cannot be extended by %v", messageDesc.FullName(), fd.FullName()) } } } else { // The name can either be the JSON name or the proto field name. fd = fieldDescs.ByJSONName(name) if fd == nil { fd = fieldDescs.ByTextName(name) } } if fd == nil { // Field is unknown. if d.opts.DiscardUnknown { if err := d.skipJSONValue(); err != nil { return err } continue } return d.newError(tok.Pos(), "unknown field %v", tok.RawString()) } // Do not allow duplicate fields. num := uint64(fd.Number()) if seenNums.Has(num) { return d.newError(tok.Pos(), "duplicate field %v", tok.RawString()) } seenNums.Set(num) // No need to set values for JSON null unless the field type is // google.protobuf.Value or google.protobuf.NullValue. if tok, _ := d.Peek(); tok.Kind() == json.Null && !isKnownValue(fd) && !isNullValue(fd) { d.Read() continue } switch { case fd.IsList(): list := m.Mutable(fd).List() if err := d.unmarshalList(list, fd); err != nil { return err } case fd.IsMap(): mmap := m.Mutable(fd).Map() if err := d.unmarshalMap(mmap, fd); err != nil { return err } default: // If field is a oneof, check if it has already been set. if od := fd.ContainingOneof(); od != nil { idx := uint64(od.Index()) if seenOneofs.Has(idx) { return d.newError(tok.Pos(), "error parsing %s, oneof %v is already set", tok.RawString(), od.FullName()) } seenOneofs.Set(idx) } // Required or optional fields. if err := d.unmarshalSingular(m, fd); err != nil { return err } } } } func isKnownValue(fd protoreflect.FieldDescriptor) bool { md := fd.Message() return md != nil && md.FullName() == genid.Value_message_fullname } func isNullValue(fd protoreflect.FieldDescriptor) bool { ed := fd.Enum() return ed != nil && ed.FullName() == genid.NullValue_enum_fullname } // unmarshalSingular unmarshals to the non-repeated field specified // by the given FieldDescriptor. func (d decoder) unmarshalSingular(m protoreflect.Message, fd protoreflect.FieldDescriptor) error { var val protoreflect.Value var err error switch fd.Kind() { case protoreflect.MessageKind, protoreflect.GroupKind: val = m.NewField(fd) err = d.unmarshalMessage(val.Message(), false) default: val, err = d.unmarshalScalar(fd) } if err != nil { return err } if val.IsValid() { m.Set(fd, val) } return nil } // unmarshalScalar unmarshals to a scalar/enum protoreflect.Value specified by // the given FieldDescriptor. func (d decoder) unmarshalScalar(fd protoreflect.FieldDescriptor) (protoreflect.Value, error) { const b32 int = 32 const b64 int = 64 tok, err := d.Read() if err != nil { return protoreflect.Value{}, err } kind := fd.Kind() switch kind { case protoreflect.BoolKind: if tok.Kind() == json.Bool { return protoreflect.ValueOfBool(tok.Bool()), nil } case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: if v, ok := unmarshalInt(tok, b32); ok { return v, nil } case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: if v, ok := unmarshalInt(tok, b64); ok { return v, nil } case protoreflect.Uint32Kind, protoreflect.Fixed32Kind: if v, ok := unmarshalUint(tok, b32); ok { return v, nil } case protoreflect.Uint64Kind, protoreflect.Fixed64Kind: if v, ok := unmarshalUint(tok, b64); ok { return v, nil } case protoreflect.FloatKind: if v, ok := unmarshalFloat(tok, b32); ok { return v, nil } case protoreflect.DoubleKind: if v, ok := unmarshalFloat(tok, b64); ok { return v, nil } case protoreflect.StringKind: if tok.Kind() == json.String { return protoreflect.ValueOfString(tok.ParsedString()), nil } case protoreflect.BytesKind: if v, ok := unmarshalBytes(tok); ok { return v, nil } case protoreflect.EnumKind: if v, ok := unmarshalEnum(tok, fd, d.opts.DiscardUnknown); ok { return v, nil } default: panic(fmt.Sprintf("unmarshalScalar: invalid scalar kind %v", kind)) } return protoreflect.Value{}, d.newError(tok.Pos(), "invalid value for %v field %v: %v", kind, fd.JSONName(), tok.RawString()) } func unmarshalInt(tok json.Token, bitSize int) (protoreflect.Value, bool) { switch tok.Kind() { case json.Number: return getInt(tok, bitSize) case json.String: // Decode number from string. s := strings.TrimSpace(tok.ParsedString()) if len(s) != len(tok.ParsedString()) { return protoreflect.Value{}, false } dec := json.NewDecoder([]byte(s)) tok, err := dec.Read() if err != nil { return protoreflect.Value{}, false } return getInt(tok, bitSize) } return protoreflect.Value{}, false } func getInt(tok json.Token, bitSize int) (protoreflect.Value, bool) { n, ok := tok.Int(bitSize) if !ok { return protoreflect.Value{}, false } if bitSize == 32 { return protoreflect.ValueOfInt32(int32(n)), true } return protoreflect.ValueOfInt64(n), true } func unmarshalUint(tok json.Token, bitSize int) (protoreflect.Value, bool) { switch tok.Kind() { case json.Number: return getUint(tok, bitSize) case json.String: // Decode number from string. s := strings.TrimSpace(tok.ParsedString()) if len(s) != len(tok.ParsedString()) { return protoreflect.Value{}, false } dec := json.NewDecoder([]byte(s)) tok, err := dec.Read() if err != nil { return protoreflect.Value{}, false } return getUint(tok, bitSize) } return protoreflect.Value{}, false } func getUint(tok json.Token, bitSize int) (protoreflect.Value, bool) { n, ok := tok.Uint(bitSize) if !ok { return protoreflect.Value{}, false } if bitSize == 32 { return protoreflect.ValueOfUint32(uint32(n)), true } return protoreflect.ValueOfUint64(n), true } func unmarshalFloat(tok json.Token, bitSize int) (protoreflect.Value, bool) { switch tok.Kind() { case json.Number: return getFloat(tok, bitSize) case json.String: s := tok.ParsedString() switch s { case "NaN": if bitSize == 32 { return protoreflect.ValueOfFloat32(float32(math.NaN())), true } return protoreflect.ValueOfFloat64(math.NaN()), true case "Infinity": if bitSize == 32 { return protoreflect.ValueOfFloat32(float32(math.Inf(+1))), true } return protoreflect.ValueOfFloat64(math.Inf(+1)), true case "-Infinity": if bitSize == 32 { return protoreflect.ValueOfFloat32(float32(math.Inf(-1))), true } return protoreflect.ValueOfFloat64(math.Inf(-1)), true } // Decode number from string. if len(s) != len(strings.TrimSpace(s)) { return protoreflect.Value{}, false } dec := json.NewDecoder([]byte(s)) tok, err := dec.Read() if err != nil { return protoreflect.Value{}, false } return getFloat(tok, bitSize) } return protoreflect.Value{}, false } func getFloat(tok json.Token, bitSize int) (protoreflect.Value, bool) { n, ok := tok.Float(bitSize) if !ok { return protoreflect.Value{}, false } if bitSize == 32 { return protoreflect.ValueOfFloat32(float32(n)), true } return protoreflect.ValueOfFloat64(n), true } func unmarshalBytes(tok json.Token) (protoreflect.Value, bool) { if tok.Kind() != json.String { return protoreflect.Value{}, false } s := tok.ParsedString() enc := base64.StdEncoding if strings.ContainsAny(s, "-_") { enc = base64.URLEncoding } if len(s)%4 != 0 { enc = enc.WithPadding(base64.NoPadding) } b, err := enc.DecodeString(s) if err != nil { return protoreflect.Value{}, false } return protoreflect.ValueOfBytes(b), true } func unmarshalEnum(tok json.Token, fd protoreflect.FieldDescriptor, discardUnknown bool) (protoreflect.Value, bool) { switch tok.Kind() { case json.String: // Lookup EnumNumber based on name. s := tok.ParsedString() if enumVal := fd.Enum().Values().ByName(protoreflect.Name(s)); enumVal != nil { return protoreflect.ValueOfEnum(enumVal.Number()), true } if discardUnknown { return protoreflect.Value{}, true } case json.Number: if n, ok := tok.Int(32); ok { return protoreflect.ValueOfEnum(protoreflect.EnumNumber(n)), true } case json.Null: // This is only valid for google.protobuf.NullValue. if isNullValue(fd) { return protoreflect.ValueOfEnum(0), true } } return protoreflect.Value{}, false } func (d decoder) unmarshalList(list protoreflect.List, fd protoreflect.FieldDescriptor) error { tok, err := d.Read() if err != nil { return err } if tok.Kind() != json.ArrayOpen { return d.unexpectedTokenError(tok) } switch fd.Kind() { case protoreflect.MessageKind, protoreflect.GroupKind: for { tok, err := d.Peek() if err != nil { return err } if tok.Kind() == json.ArrayClose { d.Read() return nil } val := list.NewElement() if err := d.unmarshalMessage(val.Message(), false); err != nil { return err } list.Append(val) } default: for { tok, err := d.Peek() if err != nil { return err } if tok.Kind() == json.ArrayClose { d.Read() return nil } val, err := d.unmarshalScalar(fd) if err != nil { return err } if val.IsValid() { list.Append(val) } } } return nil } func (d decoder) unmarshalMap(mmap protoreflect.Map, fd protoreflect.FieldDescriptor) error { tok, err := d.Read() if err != nil { return err } if tok.Kind() != json.ObjectOpen { return d.unexpectedTokenError(tok) } // Determine ahead whether map entry is a scalar type or a message type in // order to call the appropriate unmarshalMapValue func inside the for loop // below. var unmarshalMapValue func() (protoreflect.Value, error) switch fd.MapValue().Kind() { case protoreflect.MessageKind, protoreflect.GroupKind: unmarshalMapValue = func() (protoreflect.Value, error) { val := mmap.NewValue() if err := d.unmarshalMessage(val.Message(), false); err != nil { return protoreflect.Value{}, err } return val, nil } default: unmarshalMapValue = func() (protoreflect.Value, error) { return d.unmarshalScalar(fd.MapValue()) } } Loop: for { // Read field name. tok, err := d.Read() if err != nil { return err } switch tok.Kind() { default: return d.unexpectedTokenError(tok) case json.ObjectClose: break Loop case json.Name: // Continue. } // Unmarshal field name. pkey, err := d.unmarshalMapKey(tok, fd.MapKey()) if err != nil { return err } // Check for duplicate field name. if mmap.Has(pkey) { return d.newError(tok.Pos(), "duplicate map key %v", tok.RawString()) } // Read and unmarshal field value. pval, err := unmarshalMapValue() if err != nil { return err } if pval.IsValid() { mmap.Set(pkey, pval) } } return nil } // unmarshalMapKey converts given token of Name kind into a protoreflect.MapKey. // A map key type is any integral or string type. func (d decoder) unmarshalMapKey(tok json.Token, fd protoreflect.FieldDescriptor) (protoreflect.MapKey, error) { const b32 = 32 const b64 = 64 const base10 = 10 name := tok.Name() kind := fd.Kind() switch kind { case protoreflect.StringKind: return protoreflect.ValueOfString(name).MapKey(), nil case protoreflect.BoolKind: switch name { case "true": return protoreflect.ValueOfBool(true).MapKey(), nil case "false": return protoreflect.ValueOfBool(false).MapKey(), nil } case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: if n, err := strconv.ParseInt(name, base10, b32); err == nil { return protoreflect.ValueOfInt32(int32(n)).MapKey(), nil } case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: if n, err := strconv.ParseInt(name, base10, b64); err == nil { return protoreflect.ValueOfInt64(int64(n)).MapKey(), nil } case protoreflect.Uint32Kind, protoreflect.Fixed32Kind: if n, err := strconv.ParseUint(name, base10, b32); err == nil { return protoreflect.ValueOfUint32(uint32(n)).MapKey(), nil } case protoreflect.Uint64Kind, protoreflect.Fixed64Kind: if n, err := strconv.ParseUint(name, base10, b64); err == nil { return protoreflect.ValueOfUint64(uint64(n)).MapKey(), nil } default: panic(fmt.Sprintf("invalid kind for map key: %v", kind)) } return protoreflect.MapKey{}, d.newError(tok.Pos(), "invalid value for %v key: %s", kind, tok.RawString()) } ================================================ FILE: vendor/google.golang.org/protobuf/encoding/protojson/doc.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package protojson marshals and unmarshals protocol buffer messages as JSON // format. It follows the guide at // https://protobuf.dev/programming-guides/proto3#json. // // This package produces a different output than the standard [encoding/json] // package, which does not operate correctly on protocol buffer messages. package protojson ================================================ FILE: vendor/google.golang.org/protobuf/encoding/protojson/encode.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package protojson import ( "encoding/base64" "fmt" "google.golang.org/protobuf/internal/encoding/json" "google.golang.org/protobuf/internal/encoding/messageset" "google.golang.org/protobuf/internal/errors" "google.golang.org/protobuf/internal/filedesc" "google.golang.org/protobuf/internal/flags" "google.golang.org/protobuf/internal/genid" "google.golang.org/protobuf/internal/order" "google.golang.org/protobuf/internal/pragma" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/reflect/protoregistry" ) const defaultIndent = " " // Format formats the message as a multiline string. // This function is only intended for human consumption and ignores errors. // Do not depend on the output being stable. Its output will change across // different builds of your program, even when using the same version of the // protobuf module. func Format(m proto.Message) string { return MarshalOptions{Multiline: true}.Format(m) } // Marshal writes the given [proto.Message] in JSON format using default options. // Do not depend on the output being stable. Its output will change across // different builds of your program, even when using the same version of the // protobuf module. func Marshal(m proto.Message) ([]byte, error) { return MarshalOptions{}.Marshal(m) } // MarshalOptions is a configurable JSON format marshaler. type MarshalOptions struct { pragma.NoUnkeyedLiterals // Multiline specifies whether the marshaler should format the output in // indented-form with every textual element on a new line. // If Indent is an empty string, then an arbitrary indent is chosen. Multiline bool // Indent specifies the set of indentation characters to use in a multiline // formatted output such that every entry is preceded by Indent and // terminated by a newline. If non-empty, then Multiline is treated as true. // Indent can only be composed of space or tab characters. Indent string // AllowPartial allows messages that have missing required fields to marshal // without returning an error. If AllowPartial is false (the default), // Marshal will return error if there are any missing required fields. AllowPartial bool // UseProtoNames uses proto field name instead of lowerCamelCase name in JSON // field names. UseProtoNames bool // UseEnumNumbers emits enum values as numbers. UseEnumNumbers bool // EmitUnpopulated specifies whether to emit unpopulated fields. It does not // emit unpopulated oneof fields or unpopulated extension fields. // The JSON value emitted for unpopulated fields are as follows: // ╔═══════╤════════════════════════════╗ // ║ JSON │ Protobuf field ║ // ╠═══════╪════════════════════════════╣ // ║ false │ proto3 boolean fields ║ // ║ 0 │ proto3 numeric fields ║ // ║ "" │ proto3 string/bytes fields ║ // ║ null │ proto2 scalar fields ║ // ║ null │ message fields ║ // ║ [] │ list fields ║ // ║ {} │ map fields ║ // ╚═══════╧════════════════════════════╝ EmitUnpopulated bool // EmitDefaultValues specifies whether to emit default-valued primitive fields, // empty lists, and empty maps. The fields affected are as follows: // ╔═══════╤════════════════════════════════════════╗ // ║ JSON │ Protobuf field ║ // ╠═══════╪════════════════════════════════════════╣ // ║ false │ non-optional scalar boolean fields ║ // ║ 0 │ non-optional scalar numeric fields ║ // ║ "" │ non-optional scalar string/byte fields ║ // ║ [] │ empty repeated fields ║ // ║ {} │ empty map fields ║ // ╚═══════╧════════════════════════════════════════╝ // // Behaves similarly to EmitUnpopulated, but does not emit "null"-value fields, // i.e. presence-sensing fields that are omitted will remain omitted to preserve // presence-sensing. // EmitUnpopulated takes precedence over EmitDefaultValues since the former generates // a strict superset of the latter. EmitDefaultValues bool // Resolver is used for looking up types when expanding google.protobuf.Any // messages. If nil, this defaults to using protoregistry.GlobalTypes. Resolver interface { protoregistry.ExtensionTypeResolver protoregistry.MessageTypeResolver } } // Format formats the message as a string. // This method is only intended for human consumption and ignores errors. // Do not depend on the output being stable. Its output will change across // different builds of your program, even when using the same version of the // protobuf module. func (o MarshalOptions) Format(m proto.Message) string { if m == nil || !m.ProtoReflect().IsValid() { return "" // invalid syntax, but okay since this is for debugging } o.AllowPartial = true b, _ := o.Marshal(m) return string(b) } // Marshal marshals the given [proto.Message] in the JSON format using options in // Do not depend on the output being stable. Its output will change across // different builds of your program, even when using the same version of the // protobuf module. func (o MarshalOptions) Marshal(m proto.Message) ([]byte, error) { return o.marshal(nil, m) } // MarshalAppend appends the JSON format encoding of m to b, // returning the result. func (o MarshalOptions) MarshalAppend(b []byte, m proto.Message) ([]byte, error) { return o.marshal(b, m) } // marshal is a centralized function that all marshal operations go through. // For profiling purposes, avoid changing the name of this function or // introducing other code paths for marshal that do not go through this. func (o MarshalOptions) marshal(b []byte, m proto.Message) ([]byte, error) { if o.Multiline && o.Indent == "" { o.Indent = defaultIndent } if o.Resolver == nil { o.Resolver = protoregistry.GlobalTypes } internalEnc, err := json.NewEncoder(b, o.Indent) if err != nil { return nil, err } // Treat nil message interface as an empty message, // in which case the output in an empty JSON object. if m == nil { return append(b, '{', '}'), nil } enc := encoder{internalEnc, o} if err := enc.marshalMessage(m.ProtoReflect(), ""); err != nil { return nil, err } if o.AllowPartial { return enc.Bytes(), nil } return enc.Bytes(), proto.CheckInitialized(m) } type encoder struct { *json.Encoder opts MarshalOptions } // typeFieldDesc is a synthetic field descriptor used for the "@type" field. var typeFieldDesc = func() protoreflect.FieldDescriptor { var fd filedesc.Field fd.L0.FullName = "@type" fd.L0.Index = -1 fd.L1.Cardinality = protoreflect.Optional fd.L1.Kind = protoreflect.StringKind return &fd }() // typeURLFieldRanger wraps a protoreflect.Message and modifies its Range method // to additionally iterate over a synthetic field for the type URL. type typeURLFieldRanger struct { order.FieldRanger typeURL string } func (m typeURLFieldRanger) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if !f(typeFieldDesc, protoreflect.ValueOfString(m.typeURL)) { return } m.FieldRanger.Range(f) } // unpopulatedFieldRanger wraps a protoreflect.Message and modifies its Range // method to additionally iterate over unpopulated fields. type unpopulatedFieldRanger struct { protoreflect.Message skipNull bool } func (m unpopulatedFieldRanger) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { fds := m.Descriptor().Fields() for i := 0; i < fds.Len(); i++ { fd := fds.Get(i) if m.Has(fd) || fd.ContainingOneof() != nil { continue // ignore populated fields and fields within a oneofs } v := m.Get(fd) if fd.HasPresence() { if m.skipNull { continue } v = protoreflect.Value{} // use invalid value to emit null } if !f(fd, v) { return } } m.Message.Range(f) } // marshalMessage marshals the fields in the given protoreflect.Message. // If the typeURL is non-empty, then a synthetic "@type" field is injected // containing the URL as the value. func (e encoder) marshalMessage(m protoreflect.Message, typeURL string) error { if !flags.ProtoLegacy && messageset.IsMessageSet(m.Descriptor()) { return errors.New("no support for proto1 MessageSets") } if marshal := wellKnownTypeMarshaler(m.Descriptor().FullName()); marshal != nil { return marshal(e, m) } e.StartObject() defer e.EndObject() var fields order.FieldRanger = m switch { case e.opts.EmitUnpopulated: fields = unpopulatedFieldRanger{Message: m, skipNull: false} case e.opts.EmitDefaultValues: fields = unpopulatedFieldRanger{Message: m, skipNull: true} } if typeURL != "" { fields = typeURLFieldRanger{fields, typeURL} } var err error order.RangeFields(fields, order.IndexNameFieldOrder, func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool { name := fd.JSONName() if e.opts.UseProtoNames { name = fd.TextName() } if err = e.WriteName(name); err != nil { return false } if err = e.marshalValue(v, fd); err != nil { return false } return true }) return err } // marshalValue marshals the given protoreflect.Value. func (e encoder) marshalValue(val protoreflect.Value, fd protoreflect.FieldDescriptor) error { switch { case fd.IsList(): return e.marshalList(val.List(), fd) case fd.IsMap(): return e.marshalMap(val.Map(), fd) default: return e.marshalSingular(val, fd) } } // marshalSingular marshals the given non-repeated field value. This includes // all scalar types, enums, messages, and groups. func (e encoder) marshalSingular(val protoreflect.Value, fd protoreflect.FieldDescriptor) error { if !val.IsValid() { e.WriteNull() return nil } switch kind := fd.Kind(); kind { case protoreflect.BoolKind: e.WriteBool(val.Bool()) case protoreflect.StringKind: if e.WriteString(val.String()) != nil { return errors.InvalidUTF8(string(fd.FullName())) } case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: e.WriteInt(val.Int()) case protoreflect.Uint32Kind, protoreflect.Fixed32Kind: e.WriteUint(val.Uint()) case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Uint64Kind, protoreflect.Sfixed64Kind, protoreflect.Fixed64Kind: // 64-bit integers are written out as JSON string. e.WriteString(val.String()) case protoreflect.FloatKind: // Encoder.WriteFloat handles the special numbers NaN and infinites. e.WriteFloat(val.Float(), 32) case protoreflect.DoubleKind: // Encoder.WriteFloat handles the special numbers NaN and infinites. e.WriteFloat(val.Float(), 64) case protoreflect.BytesKind: e.WriteString(base64.StdEncoding.EncodeToString(val.Bytes())) case protoreflect.EnumKind: if fd.Enum().FullName() == genid.NullValue_enum_fullname { e.WriteNull() } else { desc := fd.Enum().Values().ByNumber(val.Enum()) if e.opts.UseEnumNumbers || desc == nil { e.WriteInt(int64(val.Enum())) } else { e.WriteString(string(desc.Name())) } } case protoreflect.MessageKind, protoreflect.GroupKind: if err := e.marshalMessage(val.Message(), ""); err != nil { return err } default: panic(fmt.Sprintf("%v has unknown kind: %v", fd.FullName(), kind)) } return nil } // marshalList marshals the given protoreflect.List. func (e encoder) marshalList(list protoreflect.List, fd protoreflect.FieldDescriptor) error { e.StartArray() defer e.EndArray() for i := 0; i < list.Len(); i++ { item := list.Get(i) if err := e.marshalSingular(item, fd); err != nil { return err } } return nil } // marshalMap marshals given protoreflect.Map. func (e encoder) marshalMap(mmap protoreflect.Map, fd protoreflect.FieldDescriptor) error { e.StartObject() defer e.EndObject() var err error order.RangeEntries(mmap, order.GenericKeyOrder, func(k protoreflect.MapKey, v protoreflect.Value) bool { if err = e.WriteName(k.String()); err != nil { return false } if err = e.marshalSingular(v, fd.MapValue()); err != nil { return false } return true }) return err } ================================================ FILE: vendor/google.golang.org/protobuf/encoding/protojson/well_known_types.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package protojson import ( "bytes" "fmt" "math" "strconv" "strings" "time" "google.golang.org/protobuf/internal/encoding/json" "google.golang.org/protobuf/internal/errors" "google.golang.org/protobuf/internal/genid" "google.golang.org/protobuf/internal/strs" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" ) type marshalFunc func(encoder, protoreflect.Message) error // wellKnownTypeMarshaler returns a marshal function if the message type // has specialized serialization behavior. It returns nil otherwise. func wellKnownTypeMarshaler(name protoreflect.FullName) marshalFunc { if name.Parent() == genid.GoogleProtobuf_package { switch name.Name() { case genid.Any_message_name: return encoder.marshalAny case genid.Timestamp_message_name: return encoder.marshalTimestamp case genid.Duration_message_name: return encoder.marshalDuration case genid.BoolValue_message_name, genid.Int32Value_message_name, genid.Int64Value_message_name, genid.UInt32Value_message_name, genid.UInt64Value_message_name, genid.FloatValue_message_name, genid.DoubleValue_message_name, genid.StringValue_message_name, genid.BytesValue_message_name: return encoder.marshalWrapperType case genid.Struct_message_name: return encoder.marshalStruct case genid.ListValue_message_name: return encoder.marshalListValue case genid.Value_message_name: return encoder.marshalKnownValue case genid.FieldMask_message_name: return encoder.marshalFieldMask case genid.Empty_message_name: return encoder.marshalEmpty } } return nil } type unmarshalFunc func(decoder, protoreflect.Message) error // wellKnownTypeUnmarshaler returns a unmarshal function if the message type // has specialized serialization behavior. It returns nil otherwise. func wellKnownTypeUnmarshaler(name protoreflect.FullName) unmarshalFunc { if name.Parent() == genid.GoogleProtobuf_package { switch name.Name() { case genid.Any_message_name: return decoder.unmarshalAny case genid.Timestamp_message_name: return decoder.unmarshalTimestamp case genid.Duration_message_name: return decoder.unmarshalDuration case genid.BoolValue_message_name, genid.Int32Value_message_name, genid.Int64Value_message_name, genid.UInt32Value_message_name, genid.UInt64Value_message_name, genid.FloatValue_message_name, genid.DoubleValue_message_name, genid.StringValue_message_name, genid.BytesValue_message_name: return decoder.unmarshalWrapperType case genid.Struct_message_name: return decoder.unmarshalStruct case genid.ListValue_message_name: return decoder.unmarshalListValue case genid.Value_message_name: return decoder.unmarshalKnownValue case genid.FieldMask_message_name: return decoder.unmarshalFieldMask case genid.Empty_message_name: return decoder.unmarshalEmpty } } return nil } // The JSON representation of an Any message uses the regular representation of // the deserialized, embedded message, with an additional field `@type` which // contains the type URL. If the embedded message type is well-known and has a // custom JSON representation, that representation will be embedded adding a // field `value` which holds the custom JSON in addition to the `@type` field. func (e encoder) marshalAny(m protoreflect.Message) error { fds := m.Descriptor().Fields() fdType := fds.ByNumber(genid.Any_TypeUrl_field_number) fdValue := fds.ByNumber(genid.Any_Value_field_number) if !m.Has(fdType) { if !m.Has(fdValue) { // If message is empty, marshal out empty JSON object. e.StartObject() e.EndObject() return nil } else { // Return error if type_url field is not set, but value is set. return errors.New("%s: %v is not set", genid.Any_message_fullname, genid.Any_TypeUrl_field_name) } } typeVal := m.Get(fdType) valueVal := m.Get(fdValue) // Resolve the type in order to unmarshal value field. typeURL := typeVal.String() emt, err := e.opts.Resolver.FindMessageByURL(typeURL) if err != nil { return errors.New("%s: unable to resolve %q: %v", genid.Any_message_fullname, typeURL, err) } em := emt.New() err = proto.UnmarshalOptions{ AllowPartial: true, // never check required fields inside an Any Resolver: e.opts.Resolver, }.Unmarshal(valueVal.Bytes(), em.Interface()) if err != nil { return errors.New("%s: unable to unmarshal %q: %v", genid.Any_message_fullname, typeURL, err) } // If type of value has custom JSON encoding, marshal out a field "value" // with corresponding custom JSON encoding of the embedded message as a // field. if marshal := wellKnownTypeMarshaler(emt.Descriptor().FullName()); marshal != nil { e.StartObject() defer e.EndObject() // Marshal out @type field. e.WriteName("@type") if err := e.WriteString(typeURL); err != nil { return err } e.WriteName("value") return marshal(e, em) } // Else, marshal out the embedded message's fields in this Any object. if err := e.marshalMessage(em, typeURL); err != nil { return err } return nil } func (d decoder) unmarshalAny(m protoreflect.Message) error { // Peek to check for json.ObjectOpen to avoid advancing a read. start, err := d.Peek() if err != nil { return err } if start.Kind() != json.ObjectOpen { return d.unexpectedTokenError(start) } // Use another decoder to parse the unread bytes for @type field. This // avoids advancing a read from current decoder because the current JSON // object may contain the fields of the embedded type. dec := decoder{d.Clone(), UnmarshalOptions{RecursionLimit: d.opts.RecursionLimit}} tok, err := findTypeURL(dec) switch err { case errEmptyObject: // An empty JSON object translates to an empty Any message. d.Read() // Read json.ObjectOpen. d.Read() // Read json.ObjectClose. return nil case errMissingType: if d.opts.DiscardUnknown { // Treat all fields as unknowns, similar to an empty object. return d.skipJSONValue() } // Use start.Pos() for line position. return d.newError(start.Pos(), err.Error()) default: if err != nil { return err } } typeURL := tok.ParsedString() emt, err := d.opts.Resolver.FindMessageByURL(typeURL) if err != nil { return d.newError(tok.Pos(), "unable to resolve %v: %q", tok.RawString(), err) } // Create new message for the embedded message type and unmarshal into it. em := emt.New() if unmarshal := wellKnownTypeUnmarshaler(emt.Descriptor().FullName()); unmarshal != nil { // If embedded message is a custom type, // unmarshal the JSON "value" field into it. if err := d.unmarshalAnyValue(unmarshal, em); err != nil { return err } } else { // Else unmarshal the current JSON object into it. if err := d.unmarshalMessage(em, true); err != nil { return err } } // Serialize the embedded message and assign the resulting bytes to the // proto value field. b, err := proto.MarshalOptions{ AllowPartial: true, // No need to check required fields inside an Any. Deterministic: true, }.Marshal(em.Interface()) if err != nil { return d.newError(start.Pos(), "error in marshaling Any.value field: %v", err) } fds := m.Descriptor().Fields() fdType := fds.ByNumber(genid.Any_TypeUrl_field_number) fdValue := fds.ByNumber(genid.Any_Value_field_number) m.Set(fdType, protoreflect.ValueOfString(typeURL)) m.Set(fdValue, protoreflect.ValueOfBytes(b)) return nil } var errEmptyObject = fmt.Errorf(`empty object`) var errMissingType = fmt.Errorf(`missing "@type" field`) // findTypeURL returns the token for the "@type" field value from the given // JSON bytes. It is expected that the given bytes start with json.ObjectOpen. // It returns errEmptyObject if the JSON object is empty or errMissingType if // @type field does not exist. It returns other error if the @type field is not // valid or other decoding issues. func findTypeURL(d decoder) (json.Token, error) { var typeURL string var typeTok json.Token numFields := 0 // Skip start object. d.Read() Loop: for { tok, err := d.Read() if err != nil { return json.Token{}, err } switch tok.Kind() { case json.ObjectClose: if typeURL == "" { // Did not find @type field. if numFields > 0 { return json.Token{}, errMissingType } return json.Token{}, errEmptyObject } break Loop case json.Name: numFields++ if tok.Name() != "@type" { // Skip value. if err := d.skipJSONValue(); err != nil { return json.Token{}, err } continue } // Return error if this was previously set already. if typeURL != "" { return json.Token{}, d.newError(tok.Pos(), `duplicate "@type" field`) } // Read field value. tok, err := d.Read() if err != nil { return json.Token{}, err } if tok.Kind() != json.String { return json.Token{}, d.newError(tok.Pos(), `@type field value is not a string: %v`, tok.RawString()) } typeURL = tok.ParsedString() if typeURL == "" { return json.Token{}, d.newError(tok.Pos(), `@type field contains empty value`) } typeTok = tok } } return typeTok, nil } // skipJSONValue parses a JSON value (null, boolean, string, number, object and // array) in order to advance the read to the next JSON value. It relies on // the decoder returning an error if the types are not in valid sequence. func (d decoder) skipJSONValue() error { var open int for { tok, err := d.Read() if err != nil { return err } switch tok.Kind() { case json.ObjectClose, json.ArrayClose: open-- case json.ObjectOpen, json.ArrayOpen: open++ if open > d.opts.RecursionLimit { return errors.New("exceeded max recursion depth") } case json.EOF: // This can only happen if there's a bug in Decoder.Read. // Avoid an infinite loop if this does happen. return errors.New("unexpected EOF") } if open == 0 { return nil } } } // unmarshalAnyValue unmarshals the given custom-type message from the JSON // object's "value" field. func (d decoder) unmarshalAnyValue(unmarshal unmarshalFunc, m protoreflect.Message) error { // Skip ObjectOpen, and start reading the fields. d.Read() var found bool // Used for detecting duplicate "value". for { tok, err := d.Read() if err != nil { return err } switch tok.Kind() { case json.ObjectClose: if !found { // We tolerate an omitted `value` field with the google.protobuf.Empty Well-Known-Type, // for compatibility with other proto runtimes that have interpreted the spec differently. if m.Descriptor().FullName() != genid.Empty_message_fullname { return d.newError(tok.Pos(), `missing "value" field`) } } return nil case json.Name: switch tok.Name() { case "@type": // Skip the value as this was previously parsed already. d.Read() case "value": if found { return d.newError(tok.Pos(), `duplicate "value" field`) } // Unmarshal the field value into the given message. if err := unmarshal(d, m); err != nil { return err } found = true default: if d.opts.DiscardUnknown { if err := d.skipJSONValue(); err != nil { return err } continue } return d.newError(tok.Pos(), "unknown field %v", tok.RawString()) } } } } // Wrapper types are encoded as JSON primitives like string, number or boolean. func (e encoder) marshalWrapperType(m protoreflect.Message) error { fd := m.Descriptor().Fields().ByNumber(genid.WrapperValue_Value_field_number) val := m.Get(fd) return e.marshalSingular(val, fd) } func (d decoder) unmarshalWrapperType(m protoreflect.Message) error { fd := m.Descriptor().Fields().ByNumber(genid.WrapperValue_Value_field_number) val, err := d.unmarshalScalar(fd) if err != nil { return err } m.Set(fd, val) return nil } // The JSON representation for Empty is an empty JSON object. func (e encoder) marshalEmpty(protoreflect.Message) error { e.StartObject() e.EndObject() return nil } func (d decoder) unmarshalEmpty(protoreflect.Message) error { tok, err := d.Read() if err != nil { return err } if tok.Kind() != json.ObjectOpen { return d.unexpectedTokenError(tok) } for { tok, err := d.Read() if err != nil { return err } switch tok.Kind() { case json.ObjectClose: return nil case json.Name: if d.opts.DiscardUnknown { if err := d.skipJSONValue(); err != nil { return err } continue } return d.newError(tok.Pos(), "unknown field %v", tok.RawString()) default: return d.unexpectedTokenError(tok) } } } // The JSON representation for Struct is a JSON object that contains the encoded // Struct.fields map and follows the serialization rules for a map. func (e encoder) marshalStruct(m protoreflect.Message) error { fd := m.Descriptor().Fields().ByNumber(genid.Struct_Fields_field_number) return e.marshalMap(m.Get(fd).Map(), fd) } func (d decoder) unmarshalStruct(m protoreflect.Message) error { fd := m.Descriptor().Fields().ByNumber(genid.Struct_Fields_field_number) return d.unmarshalMap(m.Mutable(fd).Map(), fd) } // The JSON representation for ListValue is JSON array that contains the encoded // ListValue.values repeated field and follows the serialization rules for a // repeated field. func (e encoder) marshalListValue(m protoreflect.Message) error { fd := m.Descriptor().Fields().ByNumber(genid.ListValue_Values_field_number) return e.marshalList(m.Get(fd).List(), fd) } func (d decoder) unmarshalListValue(m protoreflect.Message) error { fd := m.Descriptor().Fields().ByNumber(genid.ListValue_Values_field_number) return d.unmarshalList(m.Mutable(fd).List(), fd) } // The JSON representation for a Value is dependent on the oneof field that is // set. Each of the field in the oneof has its own custom serialization rule. A // Value message needs to be a oneof field set, else it is an error. func (e encoder) marshalKnownValue(m protoreflect.Message) error { od := m.Descriptor().Oneofs().ByName(genid.Value_Kind_oneof_name) fd := m.WhichOneof(od) if fd == nil { return errors.New("%s: none of the oneof fields is set", genid.Value_message_fullname) } if fd.Number() == genid.Value_NumberValue_field_number { if v := m.Get(fd).Float(); math.IsNaN(v) || math.IsInf(v, 0) { return errors.New("%s: invalid %v value", genid.Value_NumberValue_field_fullname, v) } } return e.marshalSingular(m.Get(fd), fd) } func (d decoder) unmarshalKnownValue(m protoreflect.Message) error { tok, err := d.Peek() if err != nil { return err } var fd protoreflect.FieldDescriptor var val protoreflect.Value switch tok.Kind() { case json.Null: d.Read() fd = m.Descriptor().Fields().ByNumber(genid.Value_NullValue_field_number) val = protoreflect.ValueOfEnum(0) case json.Bool: tok, err := d.Read() if err != nil { return err } fd = m.Descriptor().Fields().ByNumber(genid.Value_BoolValue_field_number) val = protoreflect.ValueOfBool(tok.Bool()) case json.Number: tok, err := d.Read() if err != nil { return err } fd = m.Descriptor().Fields().ByNumber(genid.Value_NumberValue_field_number) var ok bool val, ok = unmarshalFloat(tok, 64) if !ok { return d.newError(tok.Pos(), "invalid %v: %v", genid.Value_message_fullname, tok.RawString()) } case json.String: // A JSON string may have been encoded from the number_value field, // e.g. "NaN", "Infinity", etc. Parsing a proto double type also allows // for it to be in JSON string form. Given this custom encoding spec, // however, there is no way to identify that and hence a JSON string is // always assigned to the string_value field, which means that certain // encoding cannot be parsed back to the same field. tok, err := d.Read() if err != nil { return err } fd = m.Descriptor().Fields().ByNumber(genid.Value_StringValue_field_number) val = protoreflect.ValueOfString(tok.ParsedString()) case json.ObjectOpen: fd = m.Descriptor().Fields().ByNumber(genid.Value_StructValue_field_number) val = m.NewField(fd) if err := d.unmarshalStruct(val.Message()); err != nil { return err } case json.ArrayOpen: fd = m.Descriptor().Fields().ByNumber(genid.Value_ListValue_field_number) val = m.NewField(fd) if err := d.unmarshalListValue(val.Message()); err != nil { return err } default: return d.newError(tok.Pos(), "invalid %v: %v", genid.Value_message_fullname, tok.RawString()) } m.Set(fd, val) return nil } // The JSON representation for a Duration is a JSON string that ends in the // suffix "s" (indicating seconds) and is preceded by the number of seconds, // with nanoseconds expressed as fractional seconds. // // Durations less than one second are represented with a 0 seconds field and a // positive or negative nanos field. For durations of one second or more, a // non-zero value for the nanos field must be of the same sign as the seconds // field. // // Duration.seconds must be from -315,576,000,000 to +315,576,000,000 inclusive. // Duration.nanos must be from -999,999,999 to +999,999,999 inclusive. const ( secondsInNanos = 999999999 maxSecondsInDuration = 315576000000 ) func (e encoder) marshalDuration(m protoreflect.Message) error { fds := m.Descriptor().Fields() fdSeconds := fds.ByNumber(genid.Duration_Seconds_field_number) fdNanos := fds.ByNumber(genid.Duration_Nanos_field_number) secsVal := m.Get(fdSeconds) nanosVal := m.Get(fdNanos) secs := secsVal.Int() nanos := nanosVal.Int() if secs < -maxSecondsInDuration || secs > maxSecondsInDuration { return errors.New("%s: seconds out of range %v", genid.Duration_message_fullname, secs) } if nanos < -secondsInNanos || nanos > secondsInNanos { return errors.New("%s: nanos out of range %v", genid.Duration_message_fullname, nanos) } if (secs > 0 && nanos < 0) || (secs < 0 && nanos > 0) { return errors.New("%s: signs of seconds and nanos do not match", genid.Duration_message_fullname) } // Generated output always contains 0, 3, 6, or 9 fractional digits, // depending on required precision, followed by the suffix "s". var sign string if secs < 0 || nanos < 0 { sign, secs, nanos = "-", -1*secs, -1*nanos } x := fmt.Sprintf("%s%d.%09d", sign, secs, nanos) x = strings.TrimSuffix(x, "000") x = strings.TrimSuffix(x, "000") x = strings.TrimSuffix(x, ".000") e.WriteString(x + "s") return nil } func (d decoder) unmarshalDuration(m protoreflect.Message) error { tok, err := d.Read() if err != nil { return err } if tok.Kind() != json.String { return d.unexpectedTokenError(tok) } secs, nanos, ok := parseDuration(tok.ParsedString()) if !ok { return d.newError(tok.Pos(), "invalid %v value %v", genid.Duration_message_fullname, tok.RawString()) } // Validate seconds. No need to validate nanos because parseDuration would // have covered that already. if secs < -maxSecondsInDuration || secs > maxSecondsInDuration { return d.newError(tok.Pos(), "%v value out of range: %v", genid.Duration_message_fullname, tok.RawString()) } fds := m.Descriptor().Fields() fdSeconds := fds.ByNumber(genid.Duration_Seconds_field_number) fdNanos := fds.ByNumber(genid.Duration_Nanos_field_number) m.Set(fdSeconds, protoreflect.ValueOfInt64(secs)) m.Set(fdNanos, protoreflect.ValueOfInt32(nanos)) return nil } // parseDuration parses the given input string for seconds and nanoseconds value // for the Duration JSON format. The format is a decimal number with a suffix // 's'. It can have optional plus/minus sign. There needs to be at least an // integer or fractional part. Fractional part is limited to 9 digits only for // nanoseconds precision, regardless of whether there are trailing zero digits. // Example values are 1s, 0.1s, 1.s, .1s, +1s, -1s, -.1s. func parseDuration(input string) (int64, int32, bool) { b := []byte(input) size := len(b) if size < 2 { return 0, 0, false } if b[size-1] != 's' { return 0, 0, false } b = b[:size-1] // Read optional plus/minus symbol. var neg bool switch b[0] { case '-': neg = true b = b[1:] case '+': b = b[1:] } if len(b) == 0 { return 0, 0, false } // Read the integer part. var intp []byte switch { case b[0] == '0': b = b[1:] case '1' <= b[0] && b[0] <= '9': intp = b[0:] b = b[1:] n := 1 for len(b) > 0 && '0' <= b[0] && b[0] <= '9' { n++ b = b[1:] } intp = intp[:n] case b[0] == '.': // Continue below. default: return 0, 0, false } hasFrac := false var frac [9]byte if len(b) > 0 { if b[0] != '.' { return 0, 0, false } // Read the fractional part. b = b[1:] n := 0 for len(b) > 0 && n < 9 && '0' <= b[0] && b[0] <= '9' { frac[n] = b[0] n++ b = b[1:] } // It is not valid if there are more bytes left. if len(b) > 0 { return 0, 0, false } // Pad fractional part with 0s. for i := n; i < 9; i++ { frac[i] = '0' } hasFrac = true } var secs int64 if len(intp) > 0 { var err error secs, err = strconv.ParseInt(string(intp), 10, 64) if err != nil { return 0, 0, false } } var nanos int64 if hasFrac { nanob := bytes.TrimLeft(frac[:], "0") if len(nanob) > 0 { var err error nanos, err = strconv.ParseInt(string(nanob), 10, 32) if err != nil { return 0, 0, false } } } if neg { if secs > 0 { secs = -secs } if nanos > 0 { nanos = -nanos } } return secs, int32(nanos), true } // The JSON representation for a Timestamp is a JSON string in the RFC 3339 // format, i.e. "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where // {year} is always expressed using four digits while {month}, {day}, {hour}, // {min}, and {sec} are zero-padded to two digits each. The fractional seconds, // which can go up to 9 digits, up to 1 nanosecond resolution, is optional. The // "Z" suffix indicates the timezone ("UTC"); the timezone is required. Encoding // should always use UTC (as indicated by "Z") and a decoder should be able to // accept both UTC and other timezones (as indicated by an offset). // // Timestamp.seconds must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z // inclusive. // Timestamp.nanos must be from 0 to 999,999,999 inclusive. const ( maxTimestampSeconds = 253402300799 minTimestampSeconds = -62135596800 ) func (e encoder) marshalTimestamp(m protoreflect.Message) error { fds := m.Descriptor().Fields() fdSeconds := fds.ByNumber(genid.Timestamp_Seconds_field_number) fdNanos := fds.ByNumber(genid.Timestamp_Nanos_field_number) secsVal := m.Get(fdSeconds) nanosVal := m.Get(fdNanos) secs := secsVal.Int() nanos := nanosVal.Int() if secs < minTimestampSeconds || secs > maxTimestampSeconds { return errors.New("%s: seconds out of range %v", genid.Timestamp_message_fullname, secs) } if nanos < 0 || nanos > secondsInNanos { return errors.New("%s: nanos out of range %v", genid.Timestamp_message_fullname, nanos) } // Uses RFC 3339, where generated output will be Z-normalized and uses 0, 3, // 6 or 9 fractional digits. t := time.Unix(secs, nanos).UTC() x := t.Format("2006-01-02T15:04:05.000000000") x = strings.TrimSuffix(x, "000") x = strings.TrimSuffix(x, "000") x = strings.TrimSuffix(x, ".000") e.WriteString(x + "Z") return nil } func (d decoder) unmarshalTimestamp(m protoreflect.Message) error { tok, err := d.Read() if err != nil { return err } if tok.Kind() != json.String { return d.unexpectedTokenError(tok) } s := tok.ParsedString() t, err := time.Parse(time.RFC3339Nano, s) if err != nil { return d.newError(tok.Pos(), "invalid %v value %v", genid.Timestamp_message_fullname, tok.RawString()) } // Validate seconds. secs := t.Unix() if secs < minTimestampSeconds || secs > maxTimestampSeconds { return d.newError(tok.Pos(), "%v value out of range: %v", genid.Timestamp_message_fullname, tok.RawString()) } // Validate subseconds. i := strings.LastIndexByte(s, '.') // start of subsecond field j := strings.LastIndexAny(s, "Z-+") // start of timezone field if i >= 0 && j >= i && j-i > len(".999999999") { return d.newError(tok.Pos(), "invalid %v value %v", genid.Timestamp_message_fullname, tok.RawString()) } fds := m.Descriptor().Fields() fdSeconds := fds.ByNumber(genid.Timestamp_Seconds_field_number) fdNanos := fds.ByNumber(genid.Timestamp_Nanos_field_number) m.Set(fdSeconds, protoreflect.ValueOfInt64(secs)) m.Set(fdNanos, protoreflect.ValueOfInt32(int32(t.Nanosecond()))) return nil } // The JSON representation for a FieldMask is a JSON string where paths are // separated by a comma. Fields name in each path are converted to/from // lower-camel naming conventions. Encoding should fail if the path name would // end up differently after a round-trip. func (e encoder) marshalFieldMask(m protoreflect.Message) error { fd := m.Descriptor().Fields().ByNumber(genid.FieldMask_Paths_field_number) list := m.Get(fd).List() paths := make([]string, 0, list.Len()) for i := 0; i < list.Len(); i++ { s := list.Get(i).String() if !protoreflect.FullName(s).IsValid() { return errors.New("%s contains invalid path: %q", genid.FieldMask_Paths_field_fullname, s) } // Return error if conversion to camelCase is not reversible. cc := strs.JSONCamelCase(s) if s != strs.JSONSnakeCase(cc) { return errors.New("%s contains irreversible value %q", genid.FieldMask_Paths_field_fullname, s) } paths = append(paths, cc) } e.WriteString(strings.Join(paths, ",")) return nil } func (d decoder) unmarshalFieldMask(m protoreflect.Message) error { tok, err := d.Read() if err != nil { return err } if tok.Kind() != json.String { return d.unexpectedTokenError(tok) } str := strings.TrimSpace(tok.ParsedString()) if str == "" { return nil } paths := strings.Split(str, ",") fd := m.Descriptor().Fields().ByNumber(genid.FieldMask_Paths_field_number) list := m.Mutable(fd).List() for _, s0 := range paths { s := strs.JSONSnakeCase(s0) if strings.Contains(s0, "_") || !protoreflect.FullName(s).IsValid() { return d.newError(tok.Pos(), "%v contains invalid path: %q", genid.FieldMask_Paths_field_fullname, s0) } list.Append(protoreflect.ValueOfString(s)) } return nil } ================================================ FILE: vendor/google.golang.org/protobuf/encoding/prototext/decode.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package prototext import ( "fmt" "unicode/utf8" "google.golang.org/protobuf/internal/encoding/messageset" "google.golang.org/protobuf/internal/encoding/text" "google.golang.org/protobuf/internal/errors" "google.golang.org/protobuf/internal/flags" "google.golang.org/protobuf/internal/genid" "google.golang.org/protobuf/internal/pragma" "google.golang.org/protobuf/internal/set" "google.golang.org/protobuf/internal/strs" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/reflect/protoregistry" ) // Unmarshal reads the given []byte into the given [proto.Message]. // The provided message must be mutable (e.g., a non-nil pointer to a message). func Unmarshal(b []byte, m proto.Message) error { return UnmarshalOptions{}.Unmarshal(b, m) } // UnmarshalOptions is a configurable textproto format unmarshaler. type UnmarshalOptions struct { pragma.NoUnkeyedLiterals // AllowPartial accepts input for messages that will result in missing // required fields. If AllowPartial is false (the default), Unmarshal will // return error if there are any missing required fields. AllowPartial bool // DiscardUnknown specifies whether to ignore unknown fields when parsing. // An unknown field is any field whose field name or field number does not // resolve to any known or extension field in the message. // By default, unmarshal rejects unknown fields as an error. DiscardUnknown bool // Resolver is used for looking up types when unmarshaling // google.protobuf.Any messages or extension fields. // If nil, this defaults to using protoregistry.GlobalTypes. Resolver interface { protoregistry.MessageTypeResolver protoregistry.ExtensionTypeResolver } } // Unmarshal reads the given []byte and populates the given [proto.Message] // using options in the UnmarshalOptions object. // The provided message must be mutable (e.g., a non-nil pointer to a message). func (o UnmarshalOptions) Unmarshal(b []byte, m proto.Message) error { return o.unmarshal(b, m) } // unmarshal is a centralized function that all unmarshal operations go through. // For profiling purposes, avoid changing the name of this function or // introducing other code paths for unmarshal that do not go through this. func (o UnmarshalOptions) unmarshal(b []byte, m proto.Message) error { proto.Reset(m) if o.Resolver == nil { o.Resolver = protoregistry.GlobalTypes } dec := decoder{text.NewDecoder(b), o} if err := dec.unmarshalMessage(m.ProtoReflect(), false); err != nil { return err } if o.AllowPartial { return nil } return proto.CheckInitialized(m) } type decoder struct { *text.Decoder opts UnmarshalOptions } // newError returns an error object with position info. func (d decoder) newError(pos int, f string, x ...any) error { line, column := d.Position(pos) head := fmt.Sprintf("(line %d:%d): ", line, column) return errors.New(head+f, x...) } // unexpectedTokenError returns a syntax error for the given unexpected token. func (d decoder) unexpectedTokenError(tok text.Token) error { return d.syntaxError(tok.Pos(), "unexpected token: %s", tok.RawString()) } // syntaxError returns a syntax error for given position. func (d decoder) syntaxError(pos int, f string, x ...any) error { line, column := d.Position(pos) head := fmt.Sprintf("syntax error (line %d:%d): ", line, column) return errors.New(head+f, x...) } // unmarshalMessage unmarshals into the given protoreflect.Message. func (d decoder) unmarshalMessage(m protoreflect.Message, checkDelims bool) error { messageDesc := m.Descriptor() if !flags.ProtoLegacy && messageset.IsMessageSet(messageDesc) { return errors.New("no support for proto1 MessageSets") } if messageDesc.FullName() == genid.Any_message_fullname { return d.unmarshalAny(m, checkDelims) } if checkDelims { tok, err := d.Read() if err != nil { return err } if tok.Kind() != text.MessageOpen { return d.unexpectedTokenError(tok) } } var seenNums set.Ints var seenOneofs set.Ints fieldDescs := messageDesc.Fields() for { // Read field name. tok, err := d.Read() if err != nil { return err } switch typ := tok.Kind(); typ { case text.Name: // Continue below. case text.EOF: if checkDelims { return text.ErrUnexpectedEOF } return nil default: if checkDelims && typ == text.MessageClose { return nil } return d.unexpectedTokenError(tok) } // Resolve the field descriptor. var name protoreflect.Name var fd protoreflect.FieldDescriptor var xt protoreflect.ExtensionType var xtErr error var isFieldNumberName bool switch tok.NameKind() { case text.IdentName: name = protoreflect.Name(tok.IdentName()) fd = fieldDescs.ByTextName(string(name)) case text.TypeName: // Handle extensions only. This code path is not for Any. xt, xtErr = d.opts.Resolver.FindExtensionByName(protoreflect.FullName(tok.TypeName())) case text.FieldNumber: isFieldNumberName = true num := protoreflect.FieldNumber(tok.FieldNumber()) if !num.IsValid() { return d.newError(tok.Pos(), "invalid field number: %d", num) } fd = fieldDescs.ByNumber(num) if fd == nil { xt, xtErr = d.opts.Resolver.FindExtensionByNumber(messageDesc.FullName(), num) } } if xt != nil { fd = xt.TypeDescriptor() if !messageDesc.ExtensionRanges().Has(fd.Number()) || fd.ContainingMessage().FullName() != messageDesc.FullName() { return d.newError(tok.Pos(), "message %v cannot be extended by %v", messageDesc.FullName(), fd.FullName()) } } else if xtErr != nil && xtErr != protoregistry.NotFound { return d.newError(tok.Pos(), "unable to resolve [%s]: %v", tok.RawString(), xtErr) } // Handle unknown fields. if fd == nil { if d.opts.DiscardUnknown || messageDesc.ReservedNames().Has(name) { d.skipValue() continue } return d.newError(tok.Pos(), "unknown field: %v", tok.RawString()) } // Handle fields identified by field number. if isFieldNumberName { // TODO: Add an option to permit parsing field numbers. // // This requires careful thought as the MarshalOptions.EmitUnknown // option allows formatting unknown fields as the field number and the // best-effort textual representation of the field value. In that case, // it may not be possible to unmarshal the value from a parser that does // have information about the unknown field. return d.newError(tok.Pos(), "cannot specify field by number: %v", tok.RawString()) } switch { case fd.IsList(): kind := fd.Kind() if kind != protoreflect.MessageKind && kind != protoreflect.GroupKind && !tok.HasSeparator() { return d.syntaxError(tok.Pos(), "missing field separator :") } list := m.Mutable(fd).List() if err := d.unmarshalList(fd, list); err != nil { return err } case fd.IsMap(): mmap := m.Mutable(fd).Map() if err := d.unmarshalMap(fd, mmap); err != nil { return err } default: kind := fd.Kind() if kind != protoreflect.MessageKind && kind != protoreflect.GroupKind && !tok.HasSeparator() { return d.syntaxError(tok.Pos(), "missing field separator :") } // If field is a oneof, check if it has already been set. if od := fd.ContainingOneof(); od != nil { idx := uint64(od.Index()) if seenOneofs.Has(idx) { return d.newError(tok.Pos(), "error parsing %q, oneof %v is already set", tok.RawString(), od.FullName()) } seenOneofs.Set(idx) } num := uint64(fd.Number()) if seenNums.Has(num) { return d.newError(tok.Pos(), "non-repeated field %q is repeated", tok.RawString()) } if err := d.unmarshalSingular(fd, m); err != nil { return err } seenNums.Set(num) } } return nil } // unmarshalSingular unmarshals a non-repeated field value specified by the // given FieldDescriptor. func (d decoder) unmarshalSingular(fd protoreflect.FieldDescriptor, m protoreflect.Message) error { var val protoreflect.Value var err error switch fd.Kind() { case protoreflect.MessageKind, protoreflect.GroupKind: val = m.NewField(fd) err = d.unmarshalMessage(val.Message(), true) default: val, err = d.unmarshalScalar(fd) } if err == nil { m.Set(fd, val) } return err } // unmarshalScalar unmarshals a scalar/enum protoreflect.Value specified by the // given FieldDescriptor. func (d decoder) unmarshalScalar(fd protoreflect.FieldDescriptor) (protoreflect.Value, error) { tok, err := d.Read() if err != nil { return protoreflect.Value{}, err } if tok.Kind() != text.Scalar { return protoreflect.Value{}, d.unexpectedTokenError(tok) } kind := fd.Kind() switch kind { case protoreflect.BoolKind: if b, ok := tok.Bool(); ok { return protoreflect.ValueOfBool(b), nil } case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: if n, ok := tok.Int32(); ok { return protoreflect.ValueOfInt32(n), nil } case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: if n, ok := tok.Int64(); ok { return protoreflect.ValueOfInt64(n), nil } case protoreflect.Uint32Kind, protoreflect.Fixed32Kind: if n, ok := tok.Uint32(); ok { return protoreflect.ValueOfUint32(n), nil } case protoreflect.Uint64Kind, protoreflect.Fixed64Kind: if n, ok := tok.Uint64(); ok { return protoreflect.ValueOfUint64(n), nil } case protoreflect.FloatKind: if n, ok := tok.Float32(); ok { return protoreflect.ValueOfFloat32(n), nil } case protoreflect.DoubleKind: if n, ok := tok.Float64(); ok { return protoreflect.ValueOfFloat64(n), nil } case protoreflect.StringKind: if s, ok := tok.String(); ok { if strs.EnforceUTF8(fd) && !utf8.ValidString(s) { return protoreflect.Value{}, d.newError(tok.Pos(), "contains invalid UTF-8") } return protoreflect.ValueOfString(s), nil } case protoreflect.BytesKind: if b, ok := tok.String(); ok { return protoreflect.ValueOfBytes([]byte(b)), nil } case protoreflect.EnumKind: if lit, ok := tok.Enum(); ok { // Lookup EnumNumber based on name. if enumVal := fd.Enum().Values().ByName(protoreflect.Name(lit)); enumVal != nil { return protoreflect.ValueOfEnum(enumVal.Number()), nil } } if num, ok := tok.Int32(); ok { return protoreflect.ValueOfEnum(protoreflect.EnumNumber(num)), nil } default: panic(fmt.Sprintf("invalid scalar kind %v", kind)) } return protoreflect.Value{}, d.newError(tok.Pos(), "invalid value for %v type: %v", kind, tok.RawString()) } // unmarshalList unmarshals into given protoreflect.List. A list value can // either be in [] syntax or simply just a single scalar/message value. func (d decoder) unmarshalList(fd protoreflect.FieldDescriptor, list protoreflect.List) error { tok, err := d.Peek() if err != nil { return err } switch fd.Kind() { case protoreflect.MessageKind, protoreflect.GroupKind: switch tok.Kind() { case text.ListOpen: d.Read() for { tok, err := d.Peek() if err != nil { return err } switch tok.Kind() { case text.ListClose: d.Read() return nil case text.MessageOpen: pval := list.NewElement() if err := d.unmarshalMessage(pval.Message(), true); err != nil { return err } list.Append(pval) default: return d.unexpectedTokenError(tok) } } case text.MessageOpen: pval := list.NewElement() if err := d.unmarshalMessage(pval.Message(), true); err != nil { return err } list.Append(pval) return nil } default: switch tok.Kind() { case text.ListOpen: d.Read() for { tok, err := d.Peek() if err != nil { return err } switch tok.Kind() { case text.ListClose: d.Read() return nil case text.Scalar: pval, err := d.unmarshalScalar(fd) if err != nil { return err } list.Append(pval) default: return d.unexpectedTokenError(tok) } } case text.Scalar: pval, err := d.unmarshalScalar(fd) if err != nil { return err } list.Append(pval) return nil } } return d.unexpectedTokenError(tok) } // unmarshalMap unmarshals into given protoreflect.Map. A map value is a // textproto message containing {key: , value: }. func (d decoder) unmarshalMap(fd protoreflect.FieldDescriptor, mmap protoreflect.Map) error { // Determine ahead whether map entry is a scalar type or a message type in // order to call the appropriate unmarshalMapValue func inside // unmarshalMapEntry. var unmarshalMapValue func() (protoreflect.Value, error) switch fd.MapValue().Kind() { case protoreflect.MessageKind, protoreflect.GroupKind: unmarshalMapValue = func() (protoreflect.Value, error) { pval := mmap.NewValue() if err := d.unmarshalMessage(pval.Message(), true); err != nil { return protoreflect.Value{}, err } return pval, nil } default: unmarshalMapValue = func() (protoreflect.Value, error) { return d.unmarshalScalar(fd.MapValue()) } } tok, err := d.Read() if err != nil { return err } switch tok.Kind() { case text.MessageOpen: return d.unmarshalMapEntry(fd, mmap, unmarshalMapValue) case text.ListOpen: for { tok, err := d.Read() if err != nil { return err } switch tok.Kind() { case text.ListClose: return nil case text.MessageOpen: if err := d.unmarshalMapEntry(fd, mmap, unmarshalMapValue); err != nil { return err } default: return d.unexpectedTokenError(tok) } } default: return d.unexpectedTokenError(tok) } } // unmarshalMap unmarshals into given protoreflect.Map. A map value is a // textproto message containing {key: , value: }. func (d decoder) unmarshalMapEntry(fd protoreflect.FieldDescriptor, mmap protoreflect.Map, unmarshalMapValue func() (protoreflect.Value, error)) error { var key protoreflect.MapKey var pval protoreflect.Value Loop: for { // Read field name. tok, err := d.Read() if err != nil { return err } switch tok.Kind() { case text.Name: if tok.NameKind() != text.IdentName { if !d.opts.DiscardUnknown { return d.newError(tok.Pos(), "unknown map entry field %q", tok.RawString()) } d.skipValue() continue Loop } // Continue below. case text.MessageClose: break Loop default: return d.unexpectedTokenError(tok) } switch name := protoreflect.Name(tok.IdentName()); name { case genid.MapEntry_Key_field_name: if !tok.HasSeparator() { return d.syntaxError(tok.Pos(), "missing field separator :") } if key.IsValid() { return d.newError(tok.Pos(), "map entry %q cannot be repeated", name) } val, err := d.unmarshalScalar(fd.MapKey()) if err != nil { return err } key = val.MapKey() case genid.MapEntry_Value_field_name: if kind := fd.MapValue().Kind(); (kind != protoreflect.MessageKind) && (kind != protoreflect.GroupKind) { if !tok.HasSeparator() { return d.syntaxError(tok.Pos(), "missing field separator :") } } if pval.IsValid() { return d.newError(tok.Pos(), "map entry %q cannot be repeated", name) } pval, err = unmarshalMapValue() if err != nil { return err } default: if !d.opts.DiscardUnknown { return d.newError(tok.Pos(), "unknown map entry field %q", name) } d.skipValue() } } if !key.IsValid() { key = fd.MapKey().Default().MapKey() } if !pval.IsValid() { switch fd.MapValue().Kind() { case protoreflect.MessageKind, protoreflect.GroupKind: // If value field is not set for message/group types, construct an // empty one as default. pval = mmap.NewValue() default: pval = fd.MapValue().Default() } } mmap.Set(key, pval) return nil } // unmarshalAny unmarshals an Any textproto. It can either be in expanded form // or non-expanded form. func (d decoder) unmarshalAny(m protoreflect.Message, checkDelims bool) error { var typeURL string var bValue []byte var seenTypeUrl bool var seenValue bool var isExpanded bool if checkDelims { tok, err := d.Read() if err != nil { return err } if tok.Kind() != text.MessageOpen { return d.unexpectedTokenError(tok) } } Loop: for { // Read field name. Can only have 3 possible field names, i.e. type_url, // value and type URL name inside []. tok, err := d.Read() if err != nil { return err } if typ := tok.Kind(); typ != text.Name { if checkDelims { if typ == text.MessageClose { break Loop } } else if typ == text.EOF { break Loop } return d.unexpectedTokenError(tok) } switch tok.NameKind() { case text.IdentName: // Both type_url and value fields require field separator :. if !tok.HasSeparator() { return d.syntaxError(tok.Pos(), "missing field separator :") } switch name := protoreflect.Name(tok.IdentName()); name { case genid.Any_TypeUrl_field_name: if seenTypeUrl { return d.newError(tok.Pos(), "duplicate %v field", genid.Any_TypeUrl_field_fullname) } if isExpanded { return d.newError(tok.Pos(), "conflict with [%s] field", typeURL) } tok, err := d.Read() if err != nil { return err } var ok bool typeURL, ok = tok.String() if !ok { return d.newError(tok.Pos(), "invalid %v field value: %v", genid.Any_TypeUrl_field_fullname, tok.RawString()) } seenTypeUrl = true case genid.Any_Value_field_name: if seenValue { return d.newError(tok.Pos(), "duplicate %v field", genid.Any_Value_field_fullname) } if isExpanded { return d.newError(tok.Pos(), "conflict with [%s] field", typeURL) } tok, err := d.Read() if err != nil { return err } s, ok := tok.String() if !ok { return d.newError(tok.Pos(), "invalid %v field value: %v", genid.Any_Value_field_fullname, tok.RawString()) } bValue = []byte(s) seenValue = true default: if !d.opts.DiscardUnknown { return d.newError(tok.Pos(), "invalid field name %q in %v message", tok.RawString(), genid.Any_message_fullname) } } case text.TypeName: if isExpanded { return d.newError(tok.Pos(), "cannot have more than one type") } if seenTypeUrl { return d.newError(tok.Pos(), "conflict with type_url field") } typeURL = tok.TypeName() var err error bValue, err = d.unmarshalExpandedAny(typeURL, tok.Pos()) if err != nil { return err } isExpanded = true default: if !d.opts.DiscardUnknown { return d.newError(tok.Pos(), "invalid field name %q in %v message", tok.RawString(), genid.Any_message_fullname) } } } fds := m.Descriptor().Fields() if len(typeURL) > 0 { m.Set(fds.ByNumber(genid.Any_TypeUrl_field_number), protoreflect.ValueOfString(typeURL)) } if len(bValue) > 0 { m.Set(fds.ByNumber(genid.Any_Value_field_number), protoreflect.ValueOfBytes(bValue)) } return nil } func (d decoder) unmarshalExpandedAny(typeURL string, pos int) ([]byte, error) { mt, err := d.opts.Resolver.FindMessageByURL(typeURL) if err != nil { return nil, d.newError(pos, "unable to resolve message [%v]: %v", typeURL, err) } // Create new message for the embedded message type and unmarshal the value // field into it. m := mt.New() if err := d.unmarshalMessage(m, true); err != nil { return nil, err } // Serialize the embedded message and return the resulting bytes. b, err := proto.MarshalOptions{ AllowPartial: true, // Never check required fields inside an Any. Deterministic: true, }.Marshal(m.Interface()) if err != nil { return nil, d.newError(pos, "error in marshaling message into Any.value: %v", err) } return b, nil } // skipValue makes the decoder parse a field value in order to advance the read // to the next field. It relies on Read returning an error if the types are not // in valid sequence. func (d decoder) skipValue() error { tok, err := d.Read() if err != nil { return err } // Only need to continue reading for messages and lists. switch tok.Kind() { case text.MessageOpen: return d.skipMessageValue() case text.ListOpen: for { tok, err := d.Read() if err != nil { return err } switch tok.Kind() { case text.ListClose: return nil case text.MessageOpen: if err := d.skipMessageValue(); err != nil { return err } default: // Skip items. This will not validate whether skipped values are // of the same type or not, same behavior as C++ // TextFormat::Parser::AllowUnknownField(true) version 3.8.0. } } } return nil } // skipMessageValue makes the decoder parse and skip over all fields in a // message. It assumes that the previous read type is MessageOpen. func (d decoder) skipMessageValue() error { for { tok, err := d.Read() if err != nil { return err } switch tok.Kind() { case text.MessageClose: return nil case text.Name: if err := d.skipValue(); err != nil { return err } } } } ================================================ FILE: vendor/google.golang.org/protobuf/encoding/prototext/doc.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package prototext marshals and unmarshals protocol buffer messages as the // textproto format. package prototext ================================================ FILE: vendor/google.golang.org/protobuf/encoding/prototext/encode.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package prototext import ( "fmt" "strconv" "unicode/utf8" "google.golang.org/protobuf/encoding/protowire" "google.golang.org/protobuf/internal/encoding/messageset" "google.golang.org/protobuf/internal/encoding/text" "google.golang.org/protobuf/internal/errors" "google.golang.org/protobuf/internal/flags" "google.golang.org/protobuf/internal/genid" "google.golang.org/protobuf/internal/order" "google.golang.org/protobuf/internal/pragma" "google.golang.org/protobuf/internal/strs" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/reflect/protoregistry" ) const defaultIndent = " " // Format formats the message as a multiline string. // This function is only intended for human consumption and ignores errors. // Do not depend on the output being stable. Its output will change across // different builds of your program, even when using the same version of the // protobuf module. func Format(m proto.Message) string { return MarshalOptions{Multiline: true}.Format(m) } // Marshal writes the given [proto.Message] in textproto format using default // options. Do not depend on the output being stable. Its output will change // across different builds of your program, even when using the same version of // the protobuf module. func Marshal(m proto.Message) ([]byte, error) { return MarshalOptions{}.Marshal(m) } // MarshalOptions is a configurable text format marshaler. type MarshalOptions struct { pragma.NoUnkeyedLiterals // Multiline specifies whether the marshaler should format the output in // indented-form with every textual element on a new line. // If Indent is an empty string, then an arbitrary indent is chosen. Multiline bool // Indent specifies the set of indentation characters to use in a multiline // formatted output such that every entry is preceded by Indent and // terminated by a newline. If non-empty, then Multiline is treated as true. // Indent can only be composed of space or tab characters. Indent string // EmitASCII specifies whether to format strings and bytes as ASCII only // as opposed to using UTF-8 encoding when possible. EmitASCII bool // allowInvalidUTF8 specifies whether to permit the encoding of strings // with invalid UTF-8. This is unexported as it is intended to only // be specified by the Format method. allowInvalidUTF8 bool // AllowPartial allows messages that have missing required fields to marshal // without returning an error. If AllowPartial is false (the default), // Marshal will return error if there are any missing required fields. AllowPartial bool // EmitUnknown specifies whether to emit unknown fields in the output. // If specified, the unmarshaler may be unable to parse the output. // The default is to exclude unknown fields. EmitUnknown bool // Resolver is used for looking up types when expanding google.protobuf.Any // messages. If nil, this defaults to using protoregistry.GlobalTypes. Resolver interface { protoregistry.ExtensionTypeResolver protoregistry.MessageTypeResolver } } // Format formats the message as a string. // This method is only intended for human consumption and ignores errors. // Do not depend on the output being stable. Its output will change across // different builds of your program, even when using the same version of the // protobuf module. func (o MarshalOptions) Format(m proto.Message) string { if m == nil || !m.ProtoReflect().IsValid() { return "" // invalid syntax, but okay since this is for debugging } o.allowInvalidUTF8 = true o.AllowPartial = true o.EmitUnknown = true b, _ := o.Marshal(m) return string(b) } // Marshal writes the given [proto.Message] in textproto format using options in // MarshalOptions object. Do not depend on the output being stable. Its output // will change across different builds of your program, even when using the // same version of the protobuf module. func (o MarshalOptions) Marshal(m proto.Message) ([]byte, error) { return o.marshal(nil, m) } // MarshalAppend appends the textproto format encoding of m to b, // returning the result. func (o MarshalOptions) MarshalAppend(b []byte, m proto.Message) ([]byte, error) { return o.marshal(b, m) } // marshal is a centralized function that all marshal operations go through. // For profiling purposes, avoid changing the name of this function or // introducing other code paths for marshal that do not go through this. func (o MarshalOptions) marshal(b []byte, m proto.Message) ([]byte, error) { var delims = [2]byte{'{', '}'} if o.Multiline && o.Indent == "" { o.Indent = defaultIndent } if o.Resolver == nil { o.Resolver = protoregistry.GlobalTypes } internalEnc, err := text.NewEncoder(b, o.Indent, delims, o.EmitASCII) if err != nil { return nil, err } // Treat nil message interface as an empty message, // in which case there is nothing to output. if m == nil { return b, nil } enc := encoder{internalEnc, o} err = enc.marshalMessage(m.ProtoReflect(), false) if err != nil { return nil, err } out := enc.Bytes() if len(o.Indent) > 0 && len(out) > 0 { out = append(out, '\n') } if o.AllowPartial { return out, nil } return out, proto.CheckInitialized(m) } type encoder struct { *text.Encoder opts MarshalOptions } // marshalMessage marshals the given protoreflect.Message. func (e encoder) marshalMessage(m protoreflect.Message, inclDelims bool) error { messageDesc := m.Descriptor() if !flags.ProtoLegacy && messageset.IsMessageSet(messageDesc) { return errors.New("no support for proto1 MessageSets") } if inclDelims { e.StartMessage() defer e.EndMessage() } // Handle Any expansion. if messageDesc.FullName() == genid.Any_message_fullname { if e.marshalAny(m) { return nil } // If unable to expand, continue on to marshal Any as a regular message. } // Marshal fields. var err error order.RangeFields(m, order.IndexNameFieldOrder, func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool { if err = e.marshalField(fd.TextName(), v, fd); err != nil { return false } return true }) if err != nil { return err } // Marshal unknown fields. if e.opts.EmitUnknown { e.marshalUnknown(m.GetUnknown()) } return nil } // marshalField marshals the given field with protoreflect.Value. func (e encoder) marshalField(name string, val protoreflect.Value, fd protoreflect.FieldDescriptor) error { switch { case fd.IsList(): return e.marshalList(name, val.List(), fd) case fd.IsMap(): return e.marshalMap(name, val.Map(), fd) default: e.WriteName(name) return e.marshalSingular(val, fd) } } // marshalSingular marshals the given non-repeated field value. This includes // all scalar types, enums, messages, and groups. func (e encoder) marshalSingular(val protoreflect.Value, fd protoreflect.FieldDescriptor) error { kind := fd.Kind() switch kind { case protoreflect.BoolKind: e.WriteBool(val.Bool()) case protoreflect.StringKind: s := val.String() if !e.opts.allowInvalidUTF8 && strs.EnforceUTF8(fd) && !utf8.ValidString(s) { return errors.InvalidUTF8(string(fd.FullName())) } e.WriteString(s) case protoreflect.Int32Kind, protoreflect.Int64Kind, protoreflect.Sint32Kind, protoreflect.Sint64Kind, protoreflect.Sfixed32Kind, protoreflect.Sfixed64Kind: e.WriteInt(val.Int()) case protoreflect.Uint32Kind, protoreflect.Uint64Kind, protoreflect.Fixed32Kind, protoreflect.Fixed64Kind: e.WriteUint(val.Uint()) case protoreflect.FloatKind: // Encoder.WriteFloat handles the special numbers NaN and infinites. e.WriteFloat(val.Float(), 32) case protoreflect.DoubleKind: // Encoder.WriteFloat handles the special numbers NaN and infinites. e.WriteFloat(val.Float(), 64) case protoreflect.BytesKind: e.WriteString(string(val.Bytes())) case protoreflect.EnumKind: num := val.Enum() if desc := fd.Enum().Values().ByNumber(num); desc != nil { e.WriteLiteral(string(desc.Name())) } else { // Use numeric value if there is no enum description. e.WriteInt(int64(num)) } case protoreflect.MessageKind, protoreflect.GroupKind: return e.marshalMessage(val.Message(), true) default: panic(fmt.Sprintf("%v has unknown kind: %v", fd.FullName(), kind)) } return nil } // marshalList marshals the given protoreflect.List as multiple name-value fields. func (e encoder) marshalList(name string, list protoreflect.List, fd protoreflect.FieldDescriptor) error { size := list.Len() for i := 0; i < size; i++ { e.WriteName(name) if err := e.marshalSingular(list.Get(i), fd); err != nil { return err } } return nil } // marshalMap marshals the given protoreflect.Map as multiple name-value fields. func (e encoder) marshalMap(name string, mmap protoreflect.Map, fd protoreflect.FieldDescriptor) error { var err error order.RangeEntries(mmap, order.GenericKeyOrder, func(key protoreflect.MapKey, val protoreflect.Value) bool { e.WriteName(name) e.StartMessage() defer e.EndMessage() e.WriteName(string(genid.MapEntry_Key_field_name)) err = e.marshalSingular(key.Value(), fd.MapKey()) if err != nil { return false } e.WriteName(string(genid.MapEntry_Value_field_name)) err = e.marshalSingular(val, fd.MapValue()) if err != nil { return false } return true }) return err } // marshalUnknown parses the given []byte and marshals fields out. // This function assumes proper encoding in the given []byte. func (e encoder) marshalUnknown(b []byte) { const dec = 10 const hex = 16 for len(b) > 0 { num, wtype, n := protowire.ConsumeTag(b) b = b[n:] e.WriteName(strconv.FormatInt(int64(num), dec)) switch wtype { case protowire.VarintType: var v uint64 v, n = protowire.ConsumeVarint(b) e.WriteUint(v) case protowire.Fixed32Type: var v uint32 v, n = protowire.ConsumeFixed32(b) e.WriteLiteral("0x" + strconv.FormatUint(uint64(v), hex)) case protowire.Fixed64Type: var v uint64 v, n = protowire.ConsumeFixed64(b) e.WriteLiteral("0x" + strconv.FormatUint(v, hex)) case protowire.BytesType: var v []byte v, n = protowire.ConsumeBytes(b) e.WriteString(string(v)) case protowire.StartGroupType: e.StartMessage() var v []byte v, n = protowire.ConsumeGroup(num, b) e.marshalUnknown(v) e.EndMessage() default: panic(fmt.Sprintf("prototext: error parsing unknown field wire type: %v", wtype)) } b = b[n:] } } // marshalAny marshals the given google.protobuf.Any message in expanded form. // It returns true if it was able to marshal, else false. func (e encoder) marshalAny(any protoreflect.Message) bool { // Construct the embedded message. fds := any.Descriptor().Fields() fdType := fds.ByNumber(genid.Any_TypeUrl_field_number) typeURL := any.Get(fdType).String() mt, err := e.opts.Resolver.FindMessageByURL(typeURL) if err != nil { return false } m := mt.New().Interface() // Unmarshal bytes into embedded message. fdValue := fds.ByNumber(genid.Any_Value_field_number) value := any.Get(fdValue) err = proto.UnmarshalOptions{ AllowPartial: true, Resolver: e.opts.Resolver, }.Unmarshal(value.Bytes(), m) if err != nil { return false } // Get current encoder position. If marshaling fails, reset encoder output // back to this position. pos := e.Snapshot() // Field name is the proto field name enclosed in []. e.WriteName("[" + typeURL + "]") err = e.marshalMessage(m.ProtoReflect(), true) if err != nil { e.Reset(pos) return false } return true } ================================================ FILE: vendor/google.golang.org/protobuf/encoding/protowire/wire.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package protowire parses and formats the raw wire encoding. // See https://protobuf.dev/programming-guides/encoding. // // For marshaling and unmarshaling entire protobuf messages, // use the [google.golang.org/protobuf/proto] package instead. package protowire import ( "io" "math" "math/bits" "google.golang.org/protobuf/internal/errors" ) // Number represents the field number. type Number int32 const ( MinValidNumber Number = 1 FirstReservedNumber Number = 19000 LastReservedNumber Number = 19999 MaxValidNumber Number = 1<<29 - 1 DefaultRecursionLimit = 10000 ) // IsValid reports whether the field number is semantically valid. func (n Number) IsValid() bool { return MinValidNumber <= n && n <= MaxValidNumber } // Type represents the wire type. type Type int8 const ( VarintType Type = 0 Fixed32Type Type = 5 Fixed64Type Type = 1 BytesType Type = 2 StartGroupType Type = 3 EndGroupType Type = 4 ) const ( _ = -iota errCodeTruncated errCodeFieldNumber errCodeOverflow errCodeReserved errCodeEndGroup errCodeRecursionDepth ) var ( errFieldNumber = errors.New("invalid field number") errOverflow = errors.New("variable length integer overflow") errReserved = errors.New("cannot parse reserved wire type") errEndGroup = errors.New("mismatching end group marker") errParse = errors.New("parse error") ) // ParseError converts an error code into an error value. // This returns nil if n is a non-negative number. func ParseError(n int) error { if n >= 0 { return nil } switch n { case errCodeTruncated: return io.ErrUnexpectedEOF case errCodeFieldNumber: return errFieldNumber case errCodeOverflow: return errOverflow case errCodeReserved: return errReserved case errCodeEndGroup: return errEndGroup default: return errParse } } // ConsumeField parses an entire field record (both tag and value) and returns // the field number, the wire type, and the total length. // This returns a negative length upon an error (see [ParseError]). // // The total length includes the tag header and the end group marker (if the // field is a group). func ConsumeField(b []byte) (Number, Type, int) { num, typ, n := ConsumeTag(b) if n < 0 { return 0, 0, n // forward error code } m := ConsumeFieldValue(num, typ, b[n:]) if m < 0 { return 0, 0, m // forward error code } return num, typ, n + m } // ConsumeFieldValue parses a field value and returns its length. // This assumes that the field [Number] and wire [Type] have already been parsed. // This returns a negative length upon an error (see [ParseError]). // // When parsing a group, the length includes the end group marker and // the end group is verified to match the starting field number. func ConsumeFieldValue(num Number, typ Type, b []byte) (n int) { return consumeFieldValueD(num, typ, b, DefaultRecursionLimit) } func consumeFieldValueD(num Number, typ Type, b []byte, depth int) (n int) { switch typ { case VarintType: _, n = ConsumeVarint(b) return n case Fixed32Type: _, n = ConsumeFixed32(b) return n case Fixed64Type: _, n = ConsumeFixed64(b) return n case BytesType: _, n = ConsumeBytes(b) return n case StartGroupType: if depth < 0 { return errCodeRecursionDepth } n0 := len(b) for { num2, typ2, n := ConsumeTag(b) if n < 0 { return n // forward error code } b = b[n:] if typ2 == EndGroupType { if num != num2 { return errCodeEndGroup } return n0 - len(b) } n = consumeFieldValueD(num2, typ2, b, depth-1) if n < 0 { return n // forward error code } b = b[n:] } case EndGroupType: return errCodeEndGroup default: return errCodeReserved } } // AppendTag encodes num and typ as a varint-encoded tag and appends it to b. func AppendTag(b []byte, num Number, typ Type) []byte { return AppendVarint(b, EncodeTag(num, typ)) } // ConsumeTag parses b as a varint-encoded tag, reporting its length. // This returns a negative length upon an error (see [ParseError]). func ConsumeTag(b []byte) (Number, Type, int) { v, n := ConsumeVarint(b) if n < 0 { return 0, 0, n // forward error code } num, typ := DecodeTag(v) if num < MinValidNumber { return 0, 0, errCodeFieldNumber } return num, typ, n } func SizeTag(num Number) int { return SizeVarint(EncodeTag(num, 0)) // wire type has no effect on size } // AppendVarint appends v to b as a varint-encoded uint64. func AppendVarint(b []byte, v uint64) []byte { switch { case v < 1<<7: b = append(b, byte(v)) case v < 1<<14: b = append(b, byte((v>>0)&0x7f|0x80), byte(v>>7)) case v < 1<<21: b = append(b, byte((v>>0)&0x7f|0x80), byte((v>>7)&0x7f|0x80), byte(v>>14)) case v < 1<<28: b = append(b, byte((v>>0)&0x7f|0x80), byte((v>>7)&0x7f|0x80), byte((v>>14)&0x7f|0x80), byte(v>>21)) case v < 1<<35: b = append(b, byte((v>>0)&0x7f|0x80), byte((v>>7)&0x7f|0x80), byte((v>>14)&0x7f|0x80), byte((v>>21)&0x7f|0x80), byte(v>>28)) case v < 1<<42: b = append(b, byte((v>>0)&0x7f|0x80), byte((v>>7)&0x7f|0x80), byte((v>>14)&0x7f|0x80), byte((v>>21)&0x7f|0x80), byte((v>>28)&0x7f|0x80), byte(v>>35)) case v < 1<<49: b = append(b, byte((v>>0)&0x7f|0x80), byte((v>>7)&0x7f|0x80), byte((v>>14)&0x7f|0x80), byte((v>>21)&0x7f|0x80), byte((v>>28)&0x7f|0x80), byte((v>>35)&0x7f|0x80), byte(v>>42)) case v < 1<<56: b = append(b, byte((v>>0)&0x7f|0x80), byte((v>>7)&0x7f|0x80), byte((v>>14)&0x7f|0x80), byte((v>>21)&0x7f|0x80), byte((v>>28)&0x7f|0x80), byte((v>>35)&0x7f|0x80), byte((v>>42)&0x7f|0x80), byte(v>>49)) case v < 1<<63: b = append(b, byte((v>>0)&0x7f|0x80), byte((v>>7)&0x7f|0x80), byte((v>>14)&0x7f|0x80), byte((v>>21)&0x7f|0x80), byte((v>>28)&0x7f|0x80), byte((v>>35)&0x7f|0x80), byte((v>>42)&0x7f|0x80), byte((v>>49)&0x7f|0x80), byte(v>>56)) default: b = append(b, byte((v>>0)&0x7f|0x80), byte((v>>7)&0x7f|0x80), byte((v>>14)&0x7f|0x80), byte((v>>21)&0x7f|0x80), byte((v>>28)&0x7f|0x80), byte((v>>35)&0x7f|0x80), byte((v>>42)&0x7f|0x80), byte((v>>49)&0x7f|0x80), byte((v>>56)&0x7f|0x80), 1) } return b } // ConsumeVarint parses b as a varint-encoded uint64, reporting its length. // This returns a negative length upon an error (see [ParseError]). func ConsumeVarint(b []byte) (v uint64, n int) { var y uint64 if len(b) <= 0 { return 0, errCodeTruncated } v = uint64(b[0]) if v < 0x80 { return v, 1 } v -= 0x80 if len(b) <= 1 { return 0, errCodeTruncated } y = uint64(b[1]) v += y << 7 if y < 0x80 { return v, 2 } v -= 0x80 << 7 if len(b) <= 2 { return 0, errCodeTruncated } y = uint64(b[2]) v += y << 14 if y < 0x80 { return v, 3 } v -= 0x80 << 14 if len(b) <= 3 { return 0, errCodeTruncated } y = uint64(b[3]) v += y << 21 if y < 0x80 { return v, 4 } v -= 0x80 << 21 if len(b) <= 4 { return 0, errCodeTruncated } y = uint64(b[4]) v += y << 28 if y < 0x80 { return v, 5 } v -= 0x80 << 28 if len(b) <= 5 { return 0, errCodeTruncated } y = uint64(b[5]) v += y << 35 if y < 0x80 { return v, 6 } v -= 0x80 << 35 if len(b) <= 6 { return 0, errCodeTruncated } y = uint64(b[6]) v += y << 42 if y < 0x80 { return v, 7 } v -= 0x80 << 42 if len(b) <= 7 { return 0, errCodeTruncated } y = uint64(b[7]) v += y << 49 if y < 0x80 { return v, 8 } v -= 0x80 << 49 if len(b) <= 8 { return 0, errCodeTruncated } y = uint64(b[8]) v += y << 56 if y < 0x80 { return v, 9 } v -= 0x80 << 56 if len(b) <= 9 { return 0, errCodeTruncated } y = uint64(b[9]) v += y << 63 if y < 2 { return v, 10 } return 0, errCodeOverflow } // SizeVarint returns the encoded size of a varint. // The size is guaranteed to be within 1 and 10, inclusive. func SizeVarint(v uint64) int { // This computes 1 + (bits.Len64(v)-1)/7. // 9/64 is a good enough approximation of 1/7 // // The Go compiler can translate the bits.LeadingZeros64 call into the LZCNT // instruction, which is very fast on CPUs from the last few years. The // specific way of expressing the calculation matches C++ Protobuf, see // https://godbolt.org/z/4P3h53oM4 for the C++ code and how gcc/clang // optimize that function for GOAMD64=v1 and GOAMD64=v3 (-march=haswell). // By OR'ing v with 1, we guarantee that v is never 0, without changing the // result of SizeVarint. LZCNT is not defined for 0, meaning the compiler // needs to add extra instructions to handle that case. // // The Go compiler currently (go1.24.4) does not make use of this knowledge. // This opportunity (removing the XOR instruction, which handles the 0 case) // results in a small (1%) performance win across CPU architectures. // // Independently of avoiding the 0 case, we need the v |= 1 line because // it allows the Go compiler to eliminate an extra XCHGL barrier. v |= 1 // It would be clearer to write log2value := 63 - uint32(...), but // writing uint32(...) ^ 63 is much more efficient (-14% ARM, -20% Intel). // Proof of identity for our value range [0..63]: // https://go.dev/play/p/Pdn9hEWYakX log2value := uint32(bits.LeadingZeros64(v)) ^ 63 return int((log2value*9 + (64 + 9)) / 64) } // AppendFixed32 appends v to b as a little-endian uint32. func AppendFixed32(b []byte, v uint32) []byte { return append(b, byte(v>>0), byte(v>>8), byte(v>>16), byte(v>>24)) } // ConsumeFixed32 parses b as a little-endian uint32, reporting its length. // This returns a negative length upon an error (see [ParseError]). func ConsumeFixed32(b []byte) (v uint32, n int) { if len(b) < 4 { return 0, errCodeTruncated } v = uint32(b[0])<<0 | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24 return v, 4 } // SizeFixed32 returns the encoded size of a fixed32; which is always 4. func SizeFixed32() int { return 4 } // AppendFixed64 appends v to b as a little-endian uint64. func AppendFixed64(b []byte, v uint64) []byte { return append(b, byte(v>>0), byte(v>>8), byte(v>>16), byte(v>>24), byte(v>>32), byte(v>>40), byte(v>>48), byte(v>>56)) } // ConsumeFixed64 parses b as a little-endian uint64, reporting its length. // This returns a negative length upon an error (see [ParseError]). func ConsumeFixed64(b []byte) (v uint64, n int) { if len(b) < 8 { return 0, errCodeTruncated } v = uint64(b[0])<<0 | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56 return v, 8 } // SizeFixed64 returns the encoded size of a fixed64; which is always 8. func SizeFixed64() int { return 8 } // AppendBytes appends v to b as a length-prefixed bytes value. func AppendBytes(b []byte, v []byte) []byte { return append(AppendVarint(b, uint64(len(v))), v...) } // ConsumeBytes parses b as a length-prefixed bytes value, reporting its length. // This returns a negative length upon an error (see [ParseError]). func ConsumeBytes(b []byte) (v []byte, n int) { m, n := ConsumeVarint(b) if n < 0 { return nil, n // forward error code } if m > uint64(len(b[n:])) { return nil, errCodeTruncated } return b[n:][:m], n + int(m) } // SizeBytes returns the encoded size of a length-prefixed bytes value, // given only the length. func SizeBytes(n int) int { return SizeVarint(uint64(n)) + n } // AppendString appends v to b as a length-prefixed bytes value. func AppendString(b []byte, v string) []byte { return append(AppendVarint(b, uint64(len(v))), v...) } // ConsumeString parses b as a length-prefixed bytes value, reporting its length. // This returns a negative length upon an error (see [ParseError]). func ConsumeString(b []byte) (v string, n int) { bb, n := ConsumeBytes(b) return string(bb), n } // AppendGroup appends v to b as group value, with a trailing end group marker. // The value v must not contain the end marker. func AppendGroup(b []byte, num Number, v []byte) []byte { return AppendVarint(append(b, v...), EncodeTag(num, EndGroupType)) } // ConsumeGroup parses b as a group value until the trailing end group marker, // and verifies that the end marker matches the provided num. The value v // does not contain the end marker, while the length does contain the end marker. // This returns a negative length upon an error (see [ParseError]). func ConsumeGroup(num Number, b []byte) (v []byte, n int) { n = ConsumeFieldValue(num, StartGroupType, b) if n < 0 { return nil, n // forward error code } b = b[:n] // Truncate off end group marker, but need to handle denormalized varints. // Assuming end marker is never 0 (which is always the case since // EndGroupType is non-zero), we can truncate all trailing bytes where the // lower 7 bits are all zero (implying that the varint is denormalized). for len(b) > 0 && b[len(b)-1]&0x7f == 0 { b = b[:len(b)-1] } b = b[:len(b)-SizeTag(num)] return b, n } // SizeGroup returns the encoded size of a group, given only the length. func SizeGroup(num Number, n int) int { return n + SizeTag(num) } // DecodeTag decodes the field [Number] and wire [Type] from its unified form. // The [Number] is -1 if the decoded field number overflows int32. // Other than overflow, this does not check for field number validity. func DecodeTag(x uint64) (Number, Type) { // NOTE: MessageSet allows for larger field numbers than normal. if x>>3 > uint64(math.MaxInt32) { return -1, 0 } return Number(x >> 3), Type(x & 7) } // EncodeTag encodes the field [Number] and wire [Type] into its unified form. func EncodeTag(num Number, typ Type) uint64 { return uint64(num)<<3 | uint64(typ&7) } // DecodeZigZag decodes a zig-zag-encoded uint64 as an int64. // // Input: {…, 5, 3, 1, 0, 2, 4, 6, …} // Output: {…, -3, -2, -1, 0, +1, +2, +3, …} func DecodeZigZag(x uint64) int64 { return int64(x>>1) ^ int64(x)<<63>>63 } // EncodeZigZag encodes an int64 as a zig-zag-encoded uint64. // // Input: {…, -3, -2, -1, 0, +1, +2, +3, …} // Output: {…, 5, 3, 1, 0, 2, 4, 6, …} func EncodeZigZag(x int64) uint64 { return uint64(x<<1) ^ uint64(x>>63) } // DecodeBool decodes a uint64 as a bool. // // Input: { 0, 1, 2, …} // Output: {false, true, true, …} func DecodeBool(x uint64) bool { return x != 0 } // EncodeBool encodes a bool as a uint64. // // Input: {false, true} // Output: { 0, 1} func EncodeBool(x bool) uint64 { if x { return 1 } return 0 } ================================================ FILE: vendor/google.golang.org/protobuf/internal/descfmt/stringer.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package descfmt provides functionality to format descriptors. package descfmt import ( "fmt" "io" "reflect" "strconv" "strings" "google.golang.org/protobuf/internal/detrand" "google.golang.org/protobuf/internal/pragma" "google.golang.org/protobuf/reflect/protoreflect" ) type list interface { Len() int pragma.DoNotImplement } func FormatList(s fmt.State, r rune, vs list) { io.WriteString(s, formatListOpt(vs, true, r == 'v' && (s.Flag('+') || s.Flag('#')))) } func formatListOpt(vs list, isRoot, allowMulti bool) string { start, end := "[", "]" if isRoot { var name string switch vs.(type) { case protoreflect.Names: name = "Names" case protoreflect.FieldNumbers: name = "FieldNumbers" case protoreflect.FieldRanges: name = "FieldRanges" case protoreflect.EnumRanges: name = "EnumRanges" case protoreflect.FileImports: name = "FileImports" case protoreflect.Descriptor: name = reflect.ValueOf(vs).MethodByName("Get").Type().Out(0).Name() + "s" default: name = reflect.ValueOf(vs).Elem().Type().Name() } start, end = name+"{", "}" } var ss []string switch vs := vs.(type) { case protoreflect.Names: for i := 0; i < vs.Len(); i++ { ss = append(ss, fmt.Sprint(vs.Get(i))) } return start + joinStrings(ss, false) + end case protoreflect.FieldNumbers: for i := 0; i < vs.Len(); i++ { ss = append(ss, fmt.Sprint(vs.Get(i))) } return start + joinStrings(ss, false) + end case protoreflect.FieldRanges: for i := 0; i < vs.Len(); i++ { r := vs.Get(i) if r[0]+1 == r[1] { ss = append(ss, fmt.Sprintf("%d", r[0])) } else { ss = append(ss, fmt.Sprintf("%d:%d", r[0], r[1])) // enum ranges are end exclusive } } return start + joinStrings(ss, false) + end case protoreflect.EnumRanges: for i := 0; i < vs.Len(); i++ { r := vs.Get(i) if r[0] == r[1] { ss = append(ss, fmt.Sprintf("%d", r[0])) } else { ss = append(ss, fmt.Sprintf("%d:%d", r[0], int64(r[1])+1)) // enum ranges are end inclusive } } return start + joinStrings(ss, false) + end case protoreflect.FileImports: for i := 0; i < vs.Len(); i++ { var rs records rv := reflect.ValueOf(vs.Get(i)) rs.Append(rv, []methodAndName{ {rv.MethodByName("Path"), "Path"}, {rv.MethodByName("Package"), "Package"}, {rv.MethodByName("IsPublic"), "IsPublic"}, {rv.MethodByName("IsWeak"), "IsWeak"}, }...) ss = append(ss, "{"+rs.Join()+"}") } return start + joinStrings(ss, allowMulti) + end default: _, isEnumValue := vs.(protoreflect.EnumValueDescriptors) for i := 0; i < vs.Len(); i++ { m := reflect.ValueOf(vs).MethodByName("Get") v := m.Call([]reflect.Value{reflect.ValueOf(i)})[0].Interface() ss = append(ss, formatDescOpt(v.(protoreflect.Descriptor), false, allowMulti && !isEnumValue, nil)) } return start + joinStrings(ss, allowMulti && isEnumValue) + end } } type methodAndName struct { method reflect.Value name string } func FormatDesc(s fmt.State, r rune, t protoreflect.Descriptor) { io.WriteString(s, formatDescOpt(t, true, r == 'v' && (s.Flag('+') || s.Flag('#')), nil)) } func InternalFormatDescOptForTesting(t protoreflect.Descriptor, isRoot, allowMulti bool, record func(string)) string { return formatDescOpt(t, isRoot, allowMulti, record) } func formatDescOpt(t protoreflect.Descriptor, isRoot, allowMulti bool, record func(string)) string { rv := reflect.ValueOf(t) rt := rv.MethodByName("ProtoType").Type().In(0) start, end := "{", "}" if isRoot { start = rt.Name() + "{" } _, isFile := t.(protoreflect.FileDescriptor) rs := records{ allowMulti: allowMulti, record: record, } if t.IsPlaceholder() { if isFile { rs.Append(rv, []methodAndName{ {rv.MethodByName("Path"), "Path"}, {rv.MethodByName("Package"), "Package"}, {rv.MethodByName("IsPlaceholder"), "IsPlaceholder"}, }...) } else { rs.Append(rv, []methodAndName{ {rv.MethodByName("FullName"), "FullName"}, {rv.MethodByName("IsPlaceholder"), "IsPlaceholder"}, }...) } } else { switch { case isFile: rs.Append(rv, methodAndName{rv.MethodByName("Syntax"), "Syntax"}) case isRoot: rs.Append(rv, []methodAndName{ {rv.MethodByName("Syntax"), "Syntax"}, {rv.MethodByName("FullName"), "FullName"}, }...) default: rs.Append(rv, methodAndName{rv.MethodByName("Name"), "Name"}) } switch t := t.(type) { case protoreflect.FieldDescriptor: accessors := []methodAndName{ {rv.MethodByName("Number"), "Number"}, {rv.MethodByName("Cardinality"), "Cardinality"}, {rv.MethodByName("Kind"), "Kind"}, {rv.MethodByName("HasJSONName"), "HasJSONName"}, {rv.MethodByName("JSONName"), "JSONName"}, {rv.MethodByName("HasPresence"), "HasPresence"}, {rv.MethodByName("IsExtension"), "IsExtension"}, {rv.MethodByName("IsPacked"), "IsPacked"}, {rv.MethodByName("IsWeak"), "IsWeak"}, {rv.MethodByName("IsList"), "IsList"}, {rv.MethodByName("IsMap"), "IsMap"}, {rv.MethodByName("MapKey"), "MapKey"}, {rv.MethodByName("MapValue"), "MapValue"}, {rv.MethodByName("HasDefault"), "HasDefault"}, {rv.MethodByName("Default"), "Default"}, {rv.MethodByName("ContainingOneof"), "ContainingOneof"}, {rv.MethodByName("ContainingMessage"), "ContainingMessage"}, {rv.MethodByName("Message"), "Message"}, {rv.MethodByName("Enum"), "Enum"}, } for _, s := range accessors { switch s.name { case "MapKey": if k := t.MapKey(); k != nil { rs.recs = append(rs.recs, [2]string{"MapKey", k.Kind().String()}) } case "MapValue": if v := t.MapValue(); v != nil { switch v.Kind() { case protoreflect.EnumKind: rs.AppendRecs("MapValue", [2]string{"MapValue", string(v.Enum().FullName())}) case protoreflect.MessageKind, protoreflect.GroupKind: rs.AppendRecs("MapValue", [2]string{"MapValue", string(v.Message().FullName())}) default: rs.AppendRecs("MapValue", [2]string{"MapValue", v.Kind().String()}) } } case "ContainingOneof": if od := t.ContainingOneof(); od != nil { rs.AppendRecs("ContainingOneof", [2]string{"Oneof", string(od.Name())}) } case "ContainingMessage": if t.IsExtension() { rs.AppendRecs("ContainingMessage", [2]string{"Extendee", string(t.ContainingMessage().FullName())}) } case "Message": if !t.IsMap() { rs.Append(rv, s) } default: rs.Append(rv, s) } } case protoreflect.OneofDescriptor: var ss []string fs := t.Fields() for i := 0; i < fs.Len(); i++ { ss = append(ss, string(fs.Get(i).Name())) } if len(ss) > 0 { rs.AppendRecs("Fields", [2]string{"Fields", "[" + joinStrings(ss, false) + "]"}) } case protoreflect.FileDescriptor: rs.Append(rv, []methodAndName{ {rv.MethodByName("Path"), "Path"}, {rv.MethodByName("Package"), "Package"}, {rv.MethodByName("Imports"), "Imports"}, {rv.MethodByName("Messages"), "Messages"}, {rv.MethodByName("Enums"), "Enums"}, {rv.MethodByName("Extensions"), "Extensions"}, {rv.MethodByName("Services"), "Services"}, }...) case protoreflect.MessageDescriptor: rs.Append(rv, []methodAndName{ {rv.MethodByName("IsMapEntry"), "IsMapEntry"}, {rv.MethodByName("Fields"), "Fields"}, {rv.MethodByName("Oneofs"), "Oneofs"}, {rv.MethodByName("ReservedNames"), "ReservedNames"}, {rv.MethodByName("ReservedRanges"), "ReservedRanges"}, {rv.MethodByName("RequiredNumbers"), "RequiredNumbers"}, {rv.MethodByName("ExtensionRanges"), "ExtensionRanges"}, {rv.MethodByName("Messages"), "Messages"}, {rv.MethodByName("Enums"), "Enums"}, {rv.MethodByName("Extensions"), "Extensions"}, }...) case protoreflect.EnumDescriptor: rs.Append(rv, []methodAndName{ {rv.MethodByName("Values"), "Values"}, {rv.MethodByName("ReservedNames"), "ReservedNames"}, {rv.MethodByName("ReservedRanges"), "ReservedRanges"}, {rv.MethodByName("IsClosed"), "IsClosed"}, }...) case protoreflect.EnumValueDescriptor: rs.Append(rv, []methodAndName{ {rv.MethodByName("Number"), "Number"}, }...) case protoreflect.ServiceDescriptor: rs.Append(rv, []methodAndName{ {rv.MethodByName("Methods"), "Methods"}, }...) case protoreflect.MethodDescriptor: rs.Append(rv, []methodAndName{ {rv.MethodByName("Input"), "Input"}, {rv.MethodByName("Output"), "Output"}, {rv.MethodByName("IsStreamingClient"), "IsStreamingClient"}, {rv.MethodByName("IsStreamingServer"), "IsStreamingServer"}, }...) } if m := rv.MethodByName("GoType"); m.IsValid() { rs.Append(rv, methodAndName{m, "GoType"}) } } return start + rs.Join() + end } type records struct { recs [][2]string allowMulti bool // record is a function that will be called for every Append() or // AppendRecs() call, to be used for testing with the // InternalFormatDescOptForTesting function. record func(string) } func (rs *records) AppendRecs(fieldName string, newRecs [2]string) { if rs.record != nil { rs.record(fieldName) } rs.recs = append(rs.recs, newRecs) } func (rs *records) Append(v reflect.Value, accessors ...methodAndName) { for _, a := range accessors { if rs.record != nil { rs.record(a.name) } var rv reflect.Value if a.method.IsValid() { rv = a.method.Call(nil)[0] } if v.Kind() == reflect.Struct && !rv.IsValid() { rv = v.FieldByName(a.name) } if !rv.IsValid() { panic(fmt.Sprintf("unknown accessor: %v.%s", v.Type(), a.name)) } if _, ok := rv.Interface().(protoreflect.Value); ok { rv = rv.MethodByName("Interface").Call(nil)[0] if !rv.IsNil() { rv = rv.Elem() } } // Ignore zero values. var isZero bool switch rv.Kind() { case reflect.Interface, reflect.Slice: isZero = rv.IsNil() case reflect.Bool: isZero = rv.Bool() == false case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: isZero = rv.Int() == 0 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: isZero = rv.Uint() == 0 case reflect.String: isZero = rv.String() == "" } if n, ok := rv.Interface().(list); ok { isZero = n.Len() == 0 } if isZero { continue } // Format the value. var s string v := rv.Interface() switch v := v.(type) { case list: s = formatListOpt(v, false, rs.allowMulti) case protoreflect.FieldDescriptor, protoreflect.OneofDescriptor, protoreflect.EnumValueDescriptor, protoreflect.MethodDescriptor: s = string(v.(protoreflect.Descriptor).Name()) case protoreflect.Descriptor: s = string(v.FullName()) case string: s = strconv.Quote(v) case []byte: s = fmt.Sprintf("%q", v) default: s = fmt.Sprint(v) } rs.recs = append(rs.recs, [2]string{a.name, s}) } } func (rs *records) Join() string { var ss []string // In single line mode, simply join all records with commas. if !rs.allowMulti { for _, r := range rs.recs { ss = append(ss, r[0]+formatColon(0)+r[1]) } return joinStrings(ss, false) } // In allowMulti line mode, align single line records for more readable output. var maxLen int flush := func(i int) { for _, r := range rs.recs[len(ss):i] { ss = append(ss, r[0]+formatColon(maxLen-len(r[0]))+r[1]) } maxLen = 0 } for i, r := range rs.recs { if isMulti := strings.Contains(r[1], "\n"); isMulti { flush(i) ss = append(ss, r[0]+formatColon(0)+strings.Join(strings.Split(r[1], "\n"), "\n\t")) } else if maxLen < len(r[0]) { maxLen = len(r[0]) } } flush(len(rs.recs)) return joinStrings(ss, true) } func formatColon(padding int) string { // Deliberately introduce instability into the debug output to // discourage users from performing string comparisons. // This provides us flexibility to change the output in the future. if detrand.Bool() { return ":" + strings.Repeat(" ", 1+padding) // use non-breaking spaces (U+00a0) } else { return ":" + strings.Repeat(" ", 1+padding) // use regular spaces (U+0020) } } func joinStrings(ss []string, isMulti bool) string { if len(ss) == 0 { return "" } if isMulti { return "\n\t" + strings.Join(ss, "\n\t") + "\n" } return strings.Join(ss, ", ") } ================================================ FILE: vendor/google.golang.org/protobuf/internal/descopts/options.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package descopts contains the nil pointers to concrete descriptor options. // // This package exists as a form of reverse dependency injection so that certain // packages (e.g., internal/filedesc and internal/filetype can avoid a direct // dependency on the descriptor proto package). package descopts import "google.golang.org/protobuf/reflect/protoreflect" // These variables are set by the init function in descriptor.pb.go via logic // in internal/filetype. In other words, so long as the descriptor proto package // is linked in, these variables will be populated. // // Each variable is populated with a nil pointer to the options struct. var ( File protoreflect.ProtoMessage Enum protoreflect.ProtoMessage EnumValue protoreflect.ProtoMessage Message protoreflect.ProtoMessage Field protoreflect.ProtoMessage Oneof protoreflect.ProtoMessage ExtensionRange protoreflect.ProtoMessage Service protoreflect.ProtoMessage Method protoreflect.ProtoMessage ) ================================================ FILE: vendor/google.golang.org/protobuf/internal/detrand/rand.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package detrand provides deterministically random functionality. // // The pseudo-randomness of these functions is seeded by the program binary // itself and guarantees that the output does not change within a program, // while ensuring that the output is unstable across different builds. package detrand import ( "encoding/binary" "hash/fnv" "os" ) // Disable disables detrand such that all functions returns the zero value. // This function is not concurrent-safe and must be called during program init. func Disable() { randSeed = 0 } // Bool returns a deterministically random boolean. func Bool() bool { return randSeed%2 == 1 } // Intn returns a deterministically random integer between 0 and n-1, inclusive. func Intn(n int) int { if n <= 0 { panic("must be positive") } return int(randSeed % uint64(n)) } // randSeed is a best-effort at an approximate hash of the Go binary. var randSeed = binaryHash() func binaryHash() uint64 { // Open the Go binary. s, err := os.Executable() if err != nil { return 0 } f, err := os.Open(s) if err != nil { return 0 } defer f.Close() // Hash the size and several samples of the Go binary. const numSamples = 8 var buf [64]byte h := fnv.New64() fi, err := f.Stat() if err != nil { return 0 } binary.LittleEndian.PutUint64(buf[:8], uint64(fi.Size())) h.Write(buf[:8]) for i := int64(0); i < numSamples; i++ { if _, err := f.ReadAt(buf[:], i*fi.Size()/numSamples); err != nil { return 0 } h.Write(buf[:]) } return h.Sum64() } ================================================ FILE: vendor/google.golang.org/protobuf/internal/editiondefaults/defaults.go ================================================ // Copyright 2024 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package editiondefaults contains the binary representation of the editions // defaults. package editiondefaults import _ "embed" //go:embed editions_defaults.binpb var Defaults []byte ================================================ FILE: vendor/google.golang.org/protobuf/internal/editionssupport/editions.go ================================================ // Copyright 2024 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package editionssupport defines constants for editions that are supported. package editionssupport import "google.golang.org/protobuf/types/descriptorpb" const ( Minimum = descriptorpb.Edition_EDITION_PROTO2 Maximum = descriptorpb.Edition_EDITION_2024 // MaximumKnown is the maximum edition that is known to Go Protobuf, but not // declared as supported. In other words: end users cannot use it, but // testprotos inside Go Protobuf can. MaximumKnown = descriptorpb.Edition_EDITION_2024 ) ================================================ FILE: vendor/google.golang.org/protobuf/internal/encoding/defval/default.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package defval marshals and unmarshals textual forms of default values. // // This package handles both the form historically used in Go struct field tags // and also the form used by google.protobuf.FieldDescriptorProto.default_value // since they differ in superficial ways. package defval import ( "fmt" "math" "strconv" ptext "google.golang.org/protobuf/internal/encoding/text" "google.golang.org/protobuf/internal/errors" "google.golang.org/protobuf/reflect/protoreflect" ) // Format is the serialization format used to represent the default value. type Format int const ( _ Format = iota // Descriptor uses the serialization format that protoc uses with the // google.protobuf.FieldDescriptorProto.default_value field. Descriptor // GoTag uses the historical serialization format in Go struct field tags. GoTag ) // Unmarshal deserializes the default string s according to the given kind k. // When k is an enum, a list of enum value descriptors must be provided. func Unmarshal(s string, k protoreflect.Kind, evs protoreflect.EnumValueDescriptors, f Format) (protoreflect.Value, protoreflect.EnumValueDescriptor, error) { switch k { case protoreflect.BoolKind: if f == GoTag { switch s { case "1": return protoreflect.ValueOfBool(true), nil, nil case "0": return protoreflect.ValueOfBool(false), nil, nil } } else { switch s { case "true": return protoreflect.ValueOfBool(true), nil, nil case "false": return protoreflect.ValueOfBool(false), nil, nil } } case protoreflect.EnumKind: if f == GoTag { // Go tags use the numeric form of the enum value. if n, err := strconv.ParseInt(s, 10, 32); err == nil { if ev := evs.ByNumber(protoreflect.EnumNumber(n)); ev != nil { return protoreflect.ValueOfEnum(ev.Number()), ev, nil } } } else { // Descriptor default_value use the enum identifier. ev := evs.ByName(protoreflect.Name(s)) if ev != nil { return protoreflect.ValueOfEnum(ev.Number()), ev, nil } } case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: if v, err := strconv.ParseInt(s, 10, 32); err == nil { return protoreflect.ValueOfInt32(int32(v)), nil, nil } case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: if v, err := strconv.ParseInt(s, 10, 64); err == nil { return protoreflect.ValueOfInt64(int64(v)), nil, nil } case protoreflect.Uint32Kind, protoreflect.Fixed32Kind: if v, err := strconv.ParseUint(s, 10, 32); err == nil { return protoreflect.ValueOfUint32(uint32(v)), nil, nil } case protoreflect.Uint64Kind, protoreflect.Fixed64Kind: if v, err := strconv.ParseUint(s, 10, 64); err == nil { return protoreflect.ValueOfUint64(uint64(v)), nil, nil } case protoreflect.FloatKind, protoreflect.DoubleKind: var v float64 var err error switch s { case "-inf": v = math.Inf(-1) case "inf": v = math.Inf(+1) case "nan": v = math.NaN() default: v, err = strconv.ParseFloat(s, 64) } if err == nil { if k == protoreflect.FloatKind { return protoreflect.ValueOfFloat32(float32(v)), nil, nil } else { return protoreflect.ValueOfFloat64(float64(v)), nil, nil } } case protoreflect.StringKind: // String values are already unescaped and can be used as is. return protoreflect.ValueOfString(s), nil, nil case protoreflect.BytesKind: if b, ok := unmarshalBytes(s); ok { return protoreflect.ValueOfBytes(b), nil, nil } } return protoreflect.Value{}, nil, errors.New("could not parse value for %v: %q", k, s) } // Marshal serializes v as the default string according to the given kind k. // When specifying the Descriptor format for an enum kind, the associated // enum value descriptor must be provided. func Marshal(v protoreflect.Value, ev protoreflect.EnumValueDescriptor, k protoreflect.Kind, f Format) (string, error) { switch k { case protoreflect.BoolKind: if f == GoTag { if v.Bool() { return "1", nil } else { return "0", nil } } else { if v.Bool() { return "true", nil } else { return "false", nil } } case protoreflect.EnumKind: if f == GoTag { return strconv.FormatInt(int64(v.Enum()), 10), nil } else { return string(ev.Name()), nil } case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind, protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: return strconv.FormatInt(v.Int(), 10), nil case protoreflect.Uint32Kind, protoreflect.Fixed32Kind, protoreflect.Uint64Kind, protoreflect.Fixed64Kind: return strconv.FormatUint(v.Uint(), 10), nil case protoreflect.FloatKind, protoreflect.DoubleKind: f := v.Float() switch { case math.IsInf(f, -1): return "-inf", nil case math.IsInf(f, +1): return "inf", nil case math.IsNaN(f): return "nan", nil default: if k == protoreflect.FloatKind { return strconv.FormatFloat(f, 'g', -1, 32), nil } else { return strconv.FormatFloat(f, 'g', -1, 64), nil } } case protoreflect.StringKind: // String values are serialized as is without any escaping. return v.String(), nil case protoreflect.BytesKind: if s, ok := marshalBytes(v.Bytes()); ok { return s, nil } } return "", errors.New("could not format value for %v: %v", k, v) } // unmarshalBytes deserializes bytes by applying C unescaping. func unmarshalBytes(s string) ([]byte, bool) { // Bytes values use the same escaping as the text format, // however they lack the surrounding double quotes. v, err := ptext.UnmarshalString(`"` + s + `"`) if err != nil { return nil, false } return []byte(v), true } // marshalBytes serializes bytes by using C escaping. // To match the exact output of protoc, this is identical to the // CEscape function in strutil.cc of the protoc source code. func marshalBytes(b []byte) (string, bool) { var s []byte for _, c := range b { switch c { case '\n': s = append(s, `\n`...) case '\r': s = append(s, `\r`...) case '\t': s = append(s, `\t`...) case '"': s = append(s, `\"`...) case '\'': s = append(s, `\'`...) case '\\': s = append(s, `\\`...) default: if printableASCII := c >= 0x20 && c <= 0x7e; printableASCII { s = append(s, c) } else { s = append(s, fmt.Sprintf(`\%03o`, c)...) } } } return string(s), true } ================================================ FILE: vendor/google.golang.org/protobuf/internal/encoding/json/decode.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package json import ( "bytes" "fmt" "io" "regexp" "unicode/utf8" "google.golang.org/protobuf/internal/errors" ) // call specifies which Decoder method was invoked. type call uint8 const ( readCall call = iota peekCall ) const unexpectedFmt = "unexpected token %s" // ErrUnexpectedEOF means that EOF was encountered in the middle of the input. var ErrUnexpectedEOF = errors.New("%v", io.ErrUnexpectedEOF) // Decoder is a token-based JSON decoder. type Decoder struct { // lastCall is last method called, either readCall or peekCall. // Initial value is readCall. lastCall call // lastToken contains the last read token. lastToken Token // lastErr contains the last read error. lastErr error // openStack is a stack containing ObjectOpen and ArrayOpen values. The // top of stack represents the object or the array the current value is // directly located in. openStack []Kind // orig is used in reporting line and column. orig []byte // in contains the unconsumed input. in []byte } // NewDecoder returns a Decoder to read the given []byte. func NewDecoder(b []byte) *Decoder { return &Decoder{orig: b, in: b} } // Peek looks ahead and returns the next token kind without advancing a read. func (d *Decoder) Peek() (Token, error) { defer func() { d.lastCall = peekCall }() if d.lastCall == readCall { d.lastToken, d.lastErr = d.Read() } return d.lastToken, d.lastErr } // Read returns the next JSON token. // It will return an error if there is no valid token. func (d *Decoder) Read() (Token, error) { const scalar = Null | Bool | Number | String defer func() { d.lastCall = readCall }() if d.lastCall == peekCall { return d.lastToken, d.lastErr } tok, err := d.parseNext() if err != nil { return Token{}, err } switch tok.kind { case EOF: if len(d.openStack) != 0 || d.lastToken.kind&scalar|ObjectClose|ArrayClose == 0 { return Token{}, ErrUnexpectedEOF } case Null: if !d.isValueNext() { return Token{}, d.newSyntaxError(tok.pos, unexpectedFmt, tok.RawString()) } case Bool, Number: if !d.isValueNext() { return Token{}, d.newSyntaxError(tok.pos, unexpectedFmt, tok.RawString()) } case String: if d.isValueNext() { break } // This string token should only be for a field name. if d.lastToken.kind&(ObjectOpen|comma) == 0 { return Token{}, d.newSyntaxError(tok.pos, unexpectedFmt, tok.RawString()) } if len(d.in) == 0 { return Token{}, ErrUnexpectedEOF } if c := d.in[0]; c != ':' { return Token{}, d.newSyntaxError(d.currPos(), `unexpected character %s, missing ":" after field name`, string(c)) } tok.kind = Name d.consume(1) case ObjectOpen, ArrayOpen: if !d.isValueNext() { return Token{}, d.newSyntaxError(tok.pos, unexpectedFmt, tok.RawString()) } d.openStack = append(d.openStack, tok.kind) case ObjectClose: if len(d.openStack) == 0 || d.lastToken.kind&(Name|comma) != 0 || d.openStack[len(d.openStack)-1] != ObjectOpen { return Token{}, d.newSyntaxError(tok.pos, unexpectedFmt, tok.RawString()) } d.openStack = d.openStack[:len(d.openStack)-1] case ArrayClose: if len(d.openStack) == 0 || d.lastToken.kind == comma || d.openStack[len(d.openStack)-1] != ArrayOpen { return Token{}, d.newSyntaxError(tok.pos, unexpectedFmt, tok.RawString()) } d.openStack = d.openStack[:len(d.openStack)-1] case comma: if len(d.openStack) == 0 || d.lastToken.kind&(scalar|ObjectClose|ArrayClose) == 0 { return Token{}, d.newSyntaxError(tok.pos, unexpectedFmt, tok.RawString()) } } // Update d.lastToken only after validating token to be in the right sequence. d.lastToken = tok if d.lastToken.kind == comma { return d.Read() } return tok, nil } // Any sequence that looks like a non-delimiter (for error reporting). var errRegexp = regexp.MustCompile(`^([-+._a-zA-Z0-9]{1,32}|.)`) // parseNext parses for the next JSON token. It returns a Token object for // different types, except for Name. It does not handle whether the next token // is in a valid sequence or not. func (d *Decoder) parseNext() (Token, error) { // Trim leading spaces. d.consume(0) in := d.in if len(in) == 0 { return d.consumeToken(EOF, 0), nil } switch in[0] { case 'n': if n := matchWithDelim("null", in); n != 0 { return d.consumeToken(Null, n), nil } case 't': if n := matchWithDelim("true", in); n != 0 { return d.consumeBoolToken(true, n), nil } case 'f': if n := matchWithDelim("false", in); n != 0 { return d.consumeBoolToken(false, n), nil } case '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': if n, ok := parseNumber(in); ok { return d.consumeToken(Number, n), nil } case '"': s, n, err := d.parseString(in) if err != nil { return Token{}, err } return d.consumeStringToken(s, n), nil case '{': return d.consumeToken(ObjectOpen, 1), nil case '}': return d.consumeToken(ObjectClose, 1), nil case '[': return d.consumeToken(ArrayOpen, 1), nil case ']': return d.consumeToken(ArrayClose, 1), nil case ',': return d.consumeToken(comma, 1), nil } return Token{}, d.newSyntaxError(d.currPos(), "invalid value %s", errRegexp.Find(in)) } // newSyntaxError returns an error with line and column information useful for // syntax errors. func (d *Decoder) newSyntaxError(pos int, f string, x ...any) error { e := errors.New(f, x...) line, column := d.Position(pos) return errors.New("syntax error (line %d:%d): %v", line, column, e) } // Position returns line and column number of given index of the original input. // It will panic if index is out of range. func (d *Decoder) Position(idx int) (line int, column int) { b := d.orig[:idx] line = bytes.Count(b, []byte("\n")) + 1 if i := bytes.LastIndexByte(b, '\n'); i >= 0 { b = b[i+1:] } column = utf8.RuneCount(b) + 1 // ignore multi-rune characters return line, column } // currPos returns the current index position of d.in from d.orig. func (d *Decoder) currPos() int { return len(d.orig) - len(d.in) } // matchWithDelim matches s with the input b and verifies that the match // terminates with a delimiter of some form (e.g., r"[^-+_.a-zA-Z0-9]"). // As a special case, EOF is considered a delimiter. It returns the length of s // if there is a match, else 0. func matchWithDelim(s string, b []byte) int { if !bytes.HasPrefix(b, []byte(s)) { return 0 } n := len(s) if n < len(b) && isNotDelim(b[n]) { return 0 } return n } // isNotDelim returns true if given byte is a not delimiter character. func isNotDelim(c byte) bool { return (c == '-' || c == '+' || c == '.' || c == '_' || ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || ('0' <= c && c <= '9')) } // consume consumes n bytes of input and any subsequent whitespace. func (d *Decoder) consume(n int) { d.in = d.in[n:] for len(d.in) > 0 { switch d.in[0] { case ' ', '\n', '\r', '\t': d.in = d.in[1:] default: return } } } // isValueNext returns true if next type should be a JSON value: Null, // Number, String or Bool. func (d *Decoder) isValueNext() bool { if len(d.openStack) == 0 { return d.lastToken.kind == 0 } start := d.openStack[len(d.openStack)-1] switch start { case ObjectOpen: return d.lastToken.kind&Name != 0 case ArrayOpen: return d.lastToken.kind&(ArrayOpen|comma) != 0 } panic(fmt.Sprintf( "unreachable logic in Decoder.isValueNext, lastToken.kind: %v, openStack: %v", d.lastToken.kind, start)) } // consumeToken constructs a Token for given Kind with raw value derived from // current d.in and given size, and consumes the given size-length of it. func (d *Decoder) consumeToken(kind Kind, size int) Token { tok := Token{ kind: kind, raw: d.in[:size], pos: len(d.orig) - len(d.in), } d.consume(size) return tok } // consumeBoolToken constructs a Token for a Bool kind with raw value derived from // current d.in and given size. func (d *Decoder) consumeBoolToken(b bool, size int) Token { tok := Token{ kind: Bool, raw: d.in[:size], pos: len(d.orig) - len(d.in), boo: b, } d.consume(size) return tok } // consumeStringToken constructs a Token for a String kind with raw value derived // from current d.in and given size. func (d *Decoder) consumeStringToken(s string, size int) Token { tok := Token{ kind: String, raw: d.in[:size], pos: len(d.orig) - len(d.in), str: s, } d.consume(size) return tok } // Clone returns a copy of the Decoder for use in reading ahead the next JSON // object, array or other values without affecting current Decoder. func (d *Decoder) Clone() *Decoder { ret := *d ret.openStack = append([]Kind(nil), ret.openStack...) return &ret } ================================================ FILE: vendor/google.golang.org/protobuf/internal/encoding/json/decode_number.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package json import ( "bytes" "strconv" ) // parseNumber reads the given []byte for a valid JSON number. If it is valid, // it returns the number of bytes. Parsing logic follows the definition in // https://tools.ietf.org/html/rfc7159#section-6, and is based off // encoding/json.isValidNumber function. func parseNumber(input []byte) (int, bool) { var n int s := input if len(s) == 0 { return 0, false } // Optional - if s[0] == '-' { s = s[1:] n++ if len(s) == 0 { return 0, false } } // Digits switch { case s[0] == '0': s = s[1:] n++ case '1' <= s[0] && s[0] <= '9': s = s[1:] n++ for len(s) > 0 && '0' <= s[0] && s[0] <= '9' { s = s[1:] n++ } default: return 0, false } // . followed by 1 or more digits. if len(s) >= 2 && s[0] == '.' && '0' <= s[1] && s[1] <= '9' { s = s[2:] n += 2 for len(s) > 0 && '0' <= s[0] && s[0] <= '9' { s = s[1:] n++ } } // e or E followed by an optional - or + and // 1 or more digits. if len(s) >= 2 && (s[0] == 'e' || s[0] == 'E') { s = s[1:] n++ if s[0] == '+' || s[0] == '-' { s = s[1:] n++ if len(s) == 0 { return 0, false } } for len(s) > 0 && '0' <= s[0] && s[0] <= '9' { s = s[1:] n++ } } // Check that next byte is a delimiter or it is at the end. if n < len(input) && isNotDelim(input[n]) { return 0, false } return n, true } // numberParts is the result of parsing out a valid JSON number. It contains // the parts of a number. The parts are used for integer conversion. type numberParts struct { neg bool intp []byte frac []byte exp []byte } // parseNumber constructs numberParts from given []byte. The logic here is // similar to consumeNumber above with the difference of having to construct // numberParts. The slice fields in numberParts are subslices of the input. func parseNumberParts(input []byte) (numberParts, bool) { var neg bool var intp []byte var frac []byte var exp []byte s := input if len(s) == 0 { return numberParts{}, false } // Optional - if s[0] == '-' { neg = true s = s[1:] if len(s) == 0 { return numberParts{}, false } } // Digits switch { case s[0] == '0': // Skip first 0 and no need to store. s = s[1:] case '1' <= s[0] && s[0] <= '9': intp = s n := 1 s = s[1:] for len(s) > 0 && '0' <= s[0] && s[0] <= '9' { s = s[1:] n++ } intp = intp[:n] default: return numberParts{}, false } // . followed by 1 or more digits. if len(s) >= 2 && s[0] == '.' && '0' <= s[1] && s[1] <= '9' { frac = s[1:] n := 1 s = s[2:] for len(s) > 0 && '0' <= s[0] && s[0] <= '9' { s = s[1:] n++ } frac = frac[:n] } // e or E followed by an optional - or + and // 1 or more digits. if len(s) >= 2 && (s[0] == 'e' || s[0] == 'E') { s = s[1:] exp = s n := 0 if s[0] == '+' || s[0] == '-' { s = s[1:] n++ if len(s) == 0 { return numberParts{}, false } } for len(s) > 0 && '0' <= s[0] && s[0] <= '9' { s = s[1:] n++ } exp = exp[:n] } return numberParts{ neg: neg, intp: intp, frac: bytes.TrimRight(frac, "0"), // Remove unnecessary 0s to the right. exp: exp, }, true } // normalizeToIntString returns an integer string in normal form without the // E-notation for given numberParts. It will return false if it is not an // integer or if the exponent exceeds than max/min int value. func normalizeToIntString(n numberParts) (string, bool) { intpSize := len(n.intp) fracSize := len(n.frac) if intpSize == 0 && fracSize == 0 { return "0", true } var exp int if len(n.exp) > 0 { i, err := strconv.ParseInt(string(n.exp), 10, 32) if err != nil { return "", false } exp = int(i) } var num []byte if exp >= 0 { // For positive E, shift fraction digits into integer part and also pad // with zeroes as needed. // If there are more digits in fraction than the E value, then the // number is not an integer. if fracSize > exp { return "", false } // Make sure resulting digits are within max value limit to avoid // unnecessarily constructing a large byte slice that may simply fail // later on. const maxDigits = 20 // Max uint64 value has 20 decimal digits. if intpSize+exp > maxDigits { return "", false } // Set cap to make a copy of integer part when appended. num = n.intp[:len(n.intp):len(n.intp)] num = append(num, n.frac...) for i := 0; i < exp-fracSize; i++ { num = append(num, '0') } } else { // For negative E, shift digits in integer part out. // If there are fractions, then the number is not an integer. if fracSize > 0 { return "", false } // index is where the decimal point will be after adjusting for negative // exponent. index := intpSize + exp if index < 0 { return "", false } num = n.intp // If any of the digits being shifted to the right of the decimal point // is non-zero, then the number is not an integer. for i := index; i < intpSize; i++ { if num[i] != '0' { return "", false } } num = num[:index] } if n.neg { return "-" + string(num), true } return string(num), true } ================================================ FILE: vendor/google.golang.org/protobuf/internal/encoding/json/decode_string.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package json import ( "strconv" "unicode" "unicode/utf16" "unicode/utf8" "google.golang.org/protobuf/internal/strs" ) func (d *Decoder) parseString(in []byte) (string, int, error) { in0 := in if len(in) == 0 { return "", 0, ErrUnexpectedEOF } if in[0] != '"' { return "", 0, d.newSyntaxError(d.currPos(), "invalid character %q at start of string", in[0]) } in = in[1:] i := indexNeedEscapeInBytes(in) in, out := in[i:], in[:i:i] // set cap to prevent mutations for len(in) > 0 { switch r, n := utf8.DecodeRune(in); { case r == utf8.RuneError && n == 1: return "", 0, d.newSyntaxError(d.currPos(), "invalid UTF-8 in string") case r < ' ': return "", 0, d.newSyntaxError(d.currPos(), "invalid character %q in string", r) case r == '"': in = in[1:] n := len(in0) - len(in) return string(out), n, nil case r == '\\': if len(in) < 2 { return "", 0, ErrUnexpectedEOF } switch r := in[1]; r { case '"', '\\', '/': in, out = in[2:], append(out, r) case 'b': in, out = in[2:], append(out, '\b') case 'f': in, out = in[2:], append(out, '\f') case 'n': in, out = in[2:], append(out, '\n') case 'r': in, out = in[2:], append(out, '\r') case 't': in, out = in[2:], append(out, '\t') case 'u': if len(in) < 6 { return "", 0, ErrUnexpectedEOF } v, err := strconv.ParseUint(string(in[2:6]), 16, 16) if err != nil { return "", 0, d.newSyntaxError(d.currPos(), "invalid escape code %q in string", in[:6]) } in = in[6:] r := rune(v) if utf16.IsSurrogate(r) { if len(in) < 6 { return "", 0, ErrUnexpectedEOF } v, err := strconv.ParseUint(string(in[2:6]), 16, 16) r = utf16.DecodeRune(r, rune(v)) if in[0] != '\\' || in[1] != 'u' || r == unicode.ReplacementChar || err != nil { return "", 0, d.newSyntaxError(d.currPos(), "invalid escape code %q in string", in[:6]) } in = in[6:] } out = append(out, string(r)...) default: return "", 0, d.newSyntaxError(d.currPos(), "invalid escape code %q in string", in[:2]) } default: i := indexNeedEscapeInBytes(in[n:]) in, out = in[n+i:], append(out, in[:n+i]...) } } return "", 0, ErrUnexpectedEOF } // indexNeedEscapeInBytes returns the index of the character that needs // escaping. If no characters need escaping, this returns the input length. func indexNeedEscapeInBytes(b []byte) int { return indexNeedEscapeInString(strs.UnsafeString(b)) } ================================================ FILE: vendor/google.golang.org/protobuf/internal/encoding/json/decode_token.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package json import ( "bytes" "fmt" "strconv" ) // Kind represents a token kind expressible in the JSON format. type Kind uint16 const ( Invalid Kind = (1 << iota) / 2 EOF Null Bool Number String Name ObjectOpen ObjectClose ArrayOpen ArrayClose // comma is only for parsing in between tokens and // does not need to be exported. comma ) func (k Kind) String() string { switch k { case EOF: return "eof" case Null: return "null" case Bool: return "bool" case Number: return "number" case String: return "string" case ObjectOpen: return "{" case ObjectClose: return "}" case Name: return "name" case ArrayOpen: return "[" case ArrayClose: return "]" case comma: return "," } return "" } // Token provides a parsed token kind and value. // // Values are provided by the difference accessor methods. The accessor methods // Name, Bool, and ParsedString will panic if called on the wrong kind. There // are different accessor methods for the Number kind for converting to the // appropriate Go numeric type and those methods have the ok return value. type Token struct { // Token kind. kind Kind // pos provides the position of the token in the original input. pos int // raw bytes of the serialized token. // This is a subslice into the original input. raw []byte // boo is parsed boolean value. boo bool // str is parsed string value. str string } // Kind returns the token kind. func (t Token) Kind() Kind { return t.kind } // RawString returns the read value in string. func (t Token) RawString() string { return string(t.raw) } // Pos returns the token position from the input. func (t Token) Pos() int { return t.pos } // Name returns the object name if token is Name, else it panics. func (t Token) Name() string { if t.kind == Name { return t.str } panic(fmt.Sprintf("Token is not a Name: %v", t.RawString())) } // Bool returns the bool value if token kind is Bool, else it panics. func (t Token) Bool() bool { if t.kind == Bool { return t.boo } panic(fmt.Sprintf("Token is not a Bool: %v", t.RawString())) } // ParsedString returns the string value for a JSON string token or the read // value in string if token is not a string. func (t Token) ParsedString() string { if t.kind == String { return t.str } panic(fmt.Sprintf("Token is not a String: %v", t.RawString())) } // Float returns the floating-point number if token kind is Number. // // The floating-point precision is specified by the bitSize parameter: 32 for // float32 or 64 for float64. If bitSize=32, the result still has type float64, // but it will be convertible to float32 without changing its value. It will // return false if the number exceeds the floating point limits for given // bitSize. func (t Token) Float(bitSize int) (float64, bool) { if t.kind != Number { return 0, false } f, err := strconv.ParseFloat(t.RawString(), bitSize) if err != nil { return 0, false } return f, true } // Int returns the signed integer number if token is Number. // // The given bitSize specifies the integer type that the result must fit into. // It returns false if the number is not an integer value or if the result // exceeds the limits for given bitSize. func (t Token) Int(bitSize int) (int64, bool) { s, ok := t.getIntStr() if !ok { return 0, false } n, err := strconv.ParseInt(s, 10, bitSize) if err != nil { return 0, false } return n, true } // Uint returns the signed integer number if token is Number. // // The given bitSize specifies the unsigned integer type that the result must // fit into. It returns false if the number is not an unsigned integer value // or if the result exceeds the limits for given bitSize. func (t Token) Uint(bitSize int) (uint64, bool) { s, ok := t.getIntStr() if !ok { return 0, false } n, err := strconv.ParseUint(s, 10, bitSize) if err != nil { return 0, false } return n, true } func (t Token) getIntStr() (string, bool) { if t.kind != Number { return "", false } parts, ok := parseNumberParts(t.raw) if !ok { return "", false } return normalizeToIntString(parts) } // TokenEquals returns true if given Tokens are equal, else false. func TokenEquals(x, y Token) bool { return x.kind == y.kind && x.pos == y.pos && bytes.Equal(x.raw, y.raw) && x.boo == y.boo && x.str == y.str } ================================================ FILE: vendor/google.golang.org/protobuf/internal/encoding/json/encode.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package json import ( "math" "math/bits" "strconv" "strings" "unicode/utf8" "google.golang.org/protobuf/internal/detrand" "google.golang.org/protobuf/internal/errors" ) // kind represents an encoding type. type kind uint8 const ( _ kind = (1 << iota) / 2 name scalar objectOpen objectClose arrayOpen arrayClose ) // Encoder provides methods to write out JSON constructs and values. The user is // responsible for producing valid sequences of JSON constructs and values. type Encoder struct { indent string lastKind kind indents []byte out []byte } // NewEncoder returns an Encoder. // // If indent is a non-empty string, it causes every entry for an Array or Object // to be preceded by the indent and trailed by a newline. func NewEncoder(buf []byte, indent string) (*Encoder, error) { e := &Encoder{ out: buf, } if len(indent) > 0 { if strings.Trim(indent, " \t") != "" { return nil, errors.New("indent may only be composed of space or tab characters") } e.indent = indent } return e, nil } // Bytes returns the content of the written bytes. func (e *Encoder) Bytes() []byte { return e.out } // WriteNull writes out the null value. func (e *Encoder) WriteNull() { e.prepareNext(scalar) e.out = append(e.out, "null"...) } // WriteBool writes out the given boolean value. func (e *Encoder) WriteBool(b bool) { e.prepareNext(scalar) if b { e.out = append(e.out, "true"...) } else { e.out = append(e.out, "false"...) } } // WriteString writes out the given string in JSON string value. Returns error // if input string contains invalid UTF-8. func (e *Encoder) WriteString(s string) error { e.prepareNext(scalar) var err error if e.out, err = appendString(e.out, s); err != nil { return err } return nil } // Sentinel error used for indicating invalid UTF-8. var errInvalidUTF8 = errors.New("invalid UTF-8") func appendString(out []byte, in string) ([]byte, error) { out = append(out, '"') i := indexNeedEscapeInString(in) in, out = in[i:], append(out, in[:i]...) for len(in) > 0 { switch r, n := utf8.DecodeRuneInString(in); { case r == utf8.RuneError && n == 1: return out, errInvalidUTF8 case r < ' ' || r == '"' || r == '\\': out = append(out, '\\') switch r { case '"', '\\': out = append(out, byte(r)) case '\b': out = append(out, 'b') case '\f': out = append(out, 'f') case '\n': out = append(out, 'n') case '\r': out = append(out, 'r') case '\t': out = append(out, 't') default: out = append(out, 'u') out = append(out, "0000"[1+(bits.Len32(uint32(r))-1)/4:]...) out = strconv.AppendUint(out, uint64(r), 16) } in = in[n:] default: i := indexNeedEscapeInString(in[n:]) in, out = in[n+i:], append(out, in[:n+i]...) } } out = append(out, '"') return out, nil } // indexNeedEscapeInString returns the index of the character that needs // escaping. If no characters need escaping, this returns the input length. func indexNeedEscapeInString(s string) int { for i, r := range s { if r < ' ' || r == '\\' || r == '"' || r == utf8.RuneError { return i } } return len(s) } // WriteFloat writes out the given float and bitSize in JSON number value. func (e *Encoder) WriteFloat(n float64, bitSize int) { e.prepareNext(scalar) e.out = appendFloat(e.out, n, bitSize) } // appendFloat formats given float in bitSize, and appends to the given []byte. func appendFloat(out []byte, n float64, bitSize int) []byte { switch { case math.IsNaN(n): return append(out, `"NaN"`...) case math.IsInf(n, +1): return append(out, `"Infinity"`...) case math.IsInf(n, -1): return append(out, `"-Infinity"`...) } // JSON number formatting logic based on encoding/json. // See floatEncoder.encode for reference. fmt := byte('f') if abs := math.Abs(n); abs != 0 { if bitSize == 64 && (abs < 1e-6 || abs >= 1e21) || bitSize == 32 && (float32(abs) < 1e-6 || float32(abs) >= 1e21) { fmt = 'e' } } out = strconv.AppendFloat(out, n, fmt, -1, bitSize) if fmt == 'e' { n := len(out) if n >= 4 && out[n-4] == 'e' && out[n-3] == '-' && out[n-2] == '0' { out[n-2] = out[n-1] out = out[:n-1] } } return out } // WriteInt writes out the given signed integer in JSON number value. func (e *Encoder) WriteInt(n int64) { e.prepareNext(scalar) e.out = strconv.AppendInt(e.out, n, 10) } // WriteUint writes out the given unsigned integer in JSON number value. func (e *Encoder) WriteUint(n uint64) { e.prepareNext(scalar) e.out = strconv.AppendUint(e.out, n, 10) } // StartObject writes out the '{' symbol. func (e *Encoder) StartObject() { e.prepareNext(objectOpen) e.out = append(e.out, '{') } // EndObject writes out the '}' symbol. func (e *Encoder) EndObject() { e.prepareNext(objectClose) e.out = append(e.out, '}') } // WriteName writes out the given string in JSON string value and the name // separator ':'. Returns error if input string contains invalid UTF-8, which // should not be likely as protobuf field names should be valid. func (e *Encoder) WriteName(s string) error { e.prepareNext(name) var err error // Append to output regardless of error. e.out, err = appendString(e.out, s) e.out = append(e.out, ':') return err } // StartArray writes out the '[' symbol. func (e *Encoder) StartArray() { e.prepareNext(arrayOpen) e.out = append(e.out, '[') } // EndArray writes out the ']' symbol. func (e *Encoder) EndArray() { e.prepareNext(arrayClose) e.out = append(e.out, ']') } // prepareNext adds possible comma and indentation for the next value based // on last type and indent option. It also updates lastKind to next. func (e *Encoder) prepareNext(next kind) { defer func() { // Set lastKind to next. e.lastKind = next }() if len(e.indent) == 0 { // Need to add comma on the following condition. if e.lastKind&(scalar|objectClose|arrayClose) != 0 && next&(name|scalar|objectOpen|arrayOpen) != 0 { e.out = append(e.out, ',') // For single-line output, add a random extra space after each // comma to make output unstable. if detrand.Bool() { e.out = append(e.out, ' ') } } return } switch { case e.lastKind&(objectOpen|arrayOpen) != 0: // If next type is NOT closing, add indent and newline. if next&(objectClose|arrayClose) == 0 { e.indents = append(e.indents, e.indent...) e.out = append(e.out, '\n') e.out = append(e.out, e.indents...) } case e.lastKind&(scalar|objectClose|arrayClose) != 0: switch { // If next type is either a value or name, add comma and newline. case next&(name|scalar|objectOpen|arrayOpen) != 0: e.out = append(e.out, ',', '\n') // If next type is a closing object or array, adjust indentation. case next&(objectClose|arrayClose) != 0: e.indents = e.indents[:len(e.indents)-len(e.indent)] e.out = append(e.out, '\n') } e.out = append(e.out, e.indents...) case e.lastKind&name != 0: e.out = append(e.out, ' ') // For multi-line output, add a random extra space after key: to make // output unstable. if detrand.Bool() { e.out = append(e.out, ' ') } } } ================================================ FILE: vendor/google.golang.org/protobuf/internal/encoding/messageset/messageset.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package messageset encodes and decodes the obsolete MessageSet wire format. package messageset import ( "math" "google.golang.org/protobuf/encoding/protowire" "google.golang.org/protobuf/internal/errors" "google.golang.org/protobuf/reflect/protoreflect" ) // The MessageSet wire format is equivalent to a message defined as follows, // where each Item defines an extension field with a field number of 'type_id' // and content of 'message'. MessageSet extensions must be non-repeated message // fields. // // message MessageSet { // repeated group Item = 1 { // required int32 type_id = 2; // required string message = 3; // } // } const ( FieldItem = protowire.Number(1) FieldTypeID = protowire.Number(2) FieldMessage = protowire.Number(3) ) // ExtensionName is the field name for extensions of MessageSet. // // A valid MessageSet extension must be of the form: // // message MyMessage { // extend proto2.bridge.MessageSet { // optional MyMessage message_set_extension = 1234; // } // ... // } const ExtensionName = "message_set_extension" // IsMessageSet returns whether the message uses the MessageSet wire format. func IsMessageSet(md protoreflect.MessageDescriptor) bool { xmd, ok := md.(interface{ IsMessageSet() bool }) return ok && xmd.IsMessageSet() } // IsMessageSetExtension reports this field properly extends a MessageSet. func IsMessageSetExtension(fd protoreflect.FieldDescriptor) bool { switch { case fd.Name() != ExtensionName: return false case !IsMessageSet(fd.ContainingMessage()): return false case fd.FullName().Parent() != fd.Message().FullName(): return false } return true } // SizeField returns the size of a MessageSet item field containing an extension // with the given field number, not counting the contents of the message subfield. func SizeField(num protowire.Number) int { return 2*protowire.SizeTag(FieldItem) + protowire.SizeTag(FieldTypeID) + protowire.SizeVarint(uint64(num)) } // Unmarshal parses a MessageSet. // // It calls fn with the type ID and value of each item in the MessageSet. // Unknown fields are discarded. // // If wantLen is true, the item values include the varint length prefix. // This is ugly, but simplifies the fast-path decoder in internal/impl. func Unmarshal(b []byte, wantLen bool, fn func(typeID protowire.Number, value []byte) error) error { for len(b) > 0 { num, wtyp, n := protowire.ConsumeTag(b) if n < 0 { return protowire.ParseError(n) } b = b[n:] if num != FieldItem || wtyp != protowire.StartGroupType { n := protowire.ConsumeFieldValue(num, wtyp, b) if n < 0 { return protowire.ParseError(n) } b = b[n:] continue } typeID, value, n, err := ConsumeFieldValue(b, wantLen) if err != nil { return err } b = b[n:] if typeID == 0 { continue } if err := fn(typeID, value); err != nil { return err } } return nil } // ConsumeFieldValue parses b as a MessageSet item field value until and including // the trailing end group marker. It assumes the start group tag has already been parsed. // It returns the contents of the type_id and message subfields and the total // item length. // // If wantLen is true, the returned message value includes the length prefix. func ConsumeFieldValue(b []byte, wantLen bool) (typeid protowire.Number, message []byte, n int, err error) { ilen := len(b) for { num, wtyp, n := protowire.ConsumeTag(b) if n < 0 { return 0, nil, 0, protowire.ParseError(n) } b = b[n:] switch { case num == FieldItem && wtyp == protowire.EndGroupType: if wantLen && len(message) == 0 { // The message field was missing, which should never happen. // Be prepared for this case anyway. message = protowire.AppendVarint(message, 0) } return typeid, message, ilen - len(b), nil case num == FieldTypeID && wtyp == protowire.VarintType: v, n := protowire.ConsumeVarint(b) if n < 0 { return 0, nil, 0, protowire.ParseError(n) } b = b[n:] if v < 1 || v > math.MaxInt32 { return 0, nil, 0, errors.New("invalid type_id in message set") } typeid = protowire.Number(v) case num == FieldMessage && wtyp == protowire.BytesType: m, n := protowire.ConsumeBytes(b) if n < 0 { return 0, nil, 0, protowire.ParseError(n) } if message == nil { if wantLen { message = b[:n:n] } else { message = m[:len(m):len(m)] } } else { // This case should never happen in practice, but handle it for // correctness: The MessageSet item contains multiple message // fields, which need to be merged. // // In the case where we're returning the length, this becomes // quite inefficient since we need to strip the length off // the existing data and reconstruct it with the combined length. if wantLen { _, nn := protowire.ConsumeVarint(message) m0 := message[nn:] message = nil message = protowire.AppendVarint(message, uint64(len(m0)+len(m))) message = append(message, m0...) message = append(message, m...) } else { message = append(message, m...) } } b = b[n:] default: // We have no place to put it, so we just ignore unknown fields. n := protowire.ConsumeFieldValue(num, wtyp, b) if n < 0 { return 0, nil, 0, protowire.ParseError(n) } b = b[n:] } } } // AppendFieldStart appends the start of a MessageSet item field containing // an extension with the given number. The caller must add the message // subfield (including the tag). func AppendFieldStart(b []byte, num protowire.Number) []byte { b = protowire.AppendTag(b, FieldItem, protowire.StartGroupType) b = protowire.AppendTag(b, FieldTypeID, protowire.VarintType) b = protowire.AppendVarint(b, uint64(num)) return b } // AppendFieldEnd appends the trailing end group marker for a MessageSet item field. func AppendFieldEnd(b []byte) []byte { return protowire.AppendTag(b, FieldItem, protowire.EndGroupType) } // SizeUnknown returns the size of an unknown fields section in MessageSet format. // // See AppendUnknown. func SizeUnknown(unknown []byte) (size int) { for len(unknown) > 0 { num, typ, n := protowire.ConsumeTag(unknown) if n < 0 || typ != protowire.BytesType { return 0 } unknown = unknown[n:] _, n = protowire.ConsumeBytes(unknown) if n < 0 { return 0 } unknown = unknown[n:] size += SizeField(num) + protowire.SizeTag(FieldMessage) + n } return size } // AppendUnknown appends unknown fields to b in MessageSet format. // // For historic reasons, unresolved items in a MessageSet are stored in a // message's unknown fields section in non-MessageSet format. That is, an // unknown item with typeID T and value V appears in the unknown fields as // a field with number T and value V. // // This function converts the unknown fields back into MessageSet form. func AppendUnknown(b, unknown []byte) ([]byte, error) { for len(unknown) > 0 { num, typ, n := protowire.ConsumeTag(unknown) if n < 0 || typ != protowire.BytesType { return nil, errors.New("invalid data in message set unknown fields") } unknown = unknown[n:] _, n = protowire.ConsumeBytes(unknown) if n < 0 { return nil, errors.New("invalid data in message set unknown fields") } b = AppendFieldStart(b, num) b = protowire.AppendTag(b, FieldMessage, protowire.BytesType) b = append(b, unknown[:n]...) b = AppendFieldEnd(b) unknown = unknown[n:] } return b, nil } ================================================ FILE: vendor/google.golang.org/protobuf/internal/encoding/tag/tag.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package tag marshals and unmarshals the legacy struct tags as generated // by historical versions of protoc-gen-go. package tag import ( "reflect" "strconv" "strings" "google.golang.org/protobuf/internal/encoding/defval" "google.golang.org/protobuf/internal/filedesc" "google.golang.org/protobuf/internal/strs" "google.golang.org/protobuf/reflect/protoreflect" ) var byteType = reflect.TypeOf(byte(0)) // Unmarshal decodes the tag into a prototype.Field. // // The goType is needed to determine the original protoreflect.Kind since the // tag does not record sufficient information to determine that. // The type is the underlying field type (e.g., a repeated field may be // represented by []T, but the Go type passed in is just T). // A list of enum value descriptors must be provided for enum fields. // This does not populate the Enum or Message. // // This function is a best effort attempt; parsing errors are ignored. func Unmarshal(tag string, goType reflect.Type, evs protoreflect.EnumValueDescriptors) protoreflect.FieldDescriptor { f := new(filedesc.Field) f.L0.ParentFile = filedesc.SurrogateProto2 packed := false for len(tag) > 0 { i := strings.IndexByte(tag, ',') if i < 0 { i = len(tag) } switch s := tag[:i]; { case strings.HasPrefix(s, "name="): f.L0.FullName = protoreflect.FullName(s[len("name="):]) case strings.Trim(s, "0123456789") == "": n, _ := strconv.ParseUint(s, 10, 32) f.L1.Number = protoreflect.FieldNumber(n) case s == "opt": f.L1.Cardinality = protoreflect.Optional case s == "req": f.L1.Cardinality = protoreflect.Required case s == "rep": f.L1.Cardinality = protoreflect.Repeated case s == "varint": switch goType.Kind() { case reflect.Bool: f.L1.Kind = protoreflect.BoolKind case reflect.Int32: f.L1.Kind = protoreflect.Int32Kind case reflect.Int64: f.L1.Kind = protoreflect.Int64Kind case reflect.Uint32: f.L1.Kind = protoreflect.Uint32Kind case reflect.Uint64: f.L1.Kind = protoreflect.Uint64Kind } case s == "zigzag32": if goType.Kind() == reflect.Int32 { f.L1.Kind = protoreflect.Sint32Kind } case s == "zigzag64": if goType.Kind() == reflect.Int64 { f.L1.Kind = protoreflect.Sint64Kind } case s == "fixed32": switch goType.Kind() { case reflect.Int32: f.L1.Kind = protoreflect.Sfixed32Kind case reflect.Uint32: f.L1.Kind = protoreflect.Fixed32Kind case reflect.Float32: f.L1.Kind = protoreflect.FloatKind } case s == "fixed64": switch goType.Kind() { case reflect.Int64: f.L1.Kind = protoreflect.Sfixed64Kind case reflect.Uint64: f.L1.Kind = protoreflect.Fixed64Kind case reflect.Float64: f.L1.Kind = protoreflect.DoubleKind } case s == "bytes": switch { case goType.Kind() == reflect.String: f.L1.Kind = protoreflect.StringKind case goType.Kind() == reflect.Slice && goType.Elem() == byteType: f.L1.Kind = protoreflect.BytesKind default: f.L1.Kind = protoreflect.MessageKind } case s == "group": f.L1.Kind = protoreflect.GroupKind case strings.HasPrefix(s, "enum="): f.L1.Kind = protoreflect.EnumKind case strings.HasPrefix(s, "json="): jsonName := s[len("json="):] if jsonName != strs.JSONCamelCase(string(f.L0.FullName.Name())) { f.L1.StringName.InitJSON(jsonName) } case s == "packed": packed = true case strings.HasPrefix(s, "def="): // The default tag is special in that everything afterwards is the // default regardless of the presence of commas. s, i = tag[len("def="):], len(tag) v, ev, _ := defval.Unmarshal(s, f.L1.Kind, evs, defval.GoTag) f.L1.Default = filedesc.DefaultValue(v, ev) case s == "proto3": f.L0.ParentFile = filedesc.SurrogateProto3 } tag = strings.TrimPrefix(tag[i:], ",") } // Update EditionFeatures after the loop and after we know whether this is // a proto2 or proto3 field. f.L1.EditionFeatures = f.L0.ParentFile.L1.EditionFeatures if packed { f.L1.EditionFeatures.IsPacked = true } // The generator uses the group message name instead of the field name. // We obtain the real field name by lowercasing the group name. if f.L1.Kind == protoreflect.GroupKind { f.L0.FullName = protoreflect.FullName(strings.ToLower(string(f.L0.FullName))) } return f } // Marshal encodes the protoreflect.FieldDescriptor as a tag. // // The enumName must be provided if the kind is an enum. // Historically, the formulation of the enum "name" was the proto package // dot-concatenated with the generated Go identifier for the enum type. // Depending on the context on how Marshal is called, there are different ways // through which that information is determined. As such it is the caller's // responsibility to provide a function to obtain that information. func Marshal(fd protoreflect.FieldDescriptor, enumName string) string { var tag []string switch fd.Kind() { case protoreflect.BoolKind, protoreflect.EnumKind, protoreflect.Int32Kind, protoreflect.Uint32Kind, protoreflect.Int64Kind, protoreflect.Uint64Kind: tag = append(tag, "varint") case protoreflect.Sint32Kind: tag = append(tag, "zigzag32") case protoreflect.Sint64Kind: tag = append(tag, "zigzag64") case protoreflect.Sfixed32Kind, protoreflect.Fixed32Kind, protoreflect.FloatKind: tag = append(tag, "fixed32") case protoreflect.Sfixed64Kind, protoreflect.Fixed64Kind, protoreflect.DoubleKind: tag = append(tag, "fixed64") case protoreflect.StringKind, protoreflect.BytesKind, protoreflect.MessageKind: tag = append(tag, "bytes") case protoreflect.GroupKind: tag = append(tag, "group") } tag = append(tag, strconv.Itoa(int(fd.Number()))) switch fd.Cardinality() { case protoreflect.Optional: tag = append(tag, "opt") case protoreflect.Required: tag = append(tag, "req") case protoreflect.Repeated: tag = append(tag, "rep") } if fd.IsPacked() { tag = append(tag, "packed") } name := string(fd.Name()) if fd.Kind() == protoreflect.GroupKind { // The name of the FieldDescriptor for a group field is // lowercased. To find the original capitalization, we // look in the field's MessageType. name = string(fd.Message().Name()) } tag = append(tag, "name="+name) if jsonName := fd.JSONName(); jsonName != "" && jsonName != name && !fd.IsExtension() { // NOTE: The jsonName != name condition is suspect, but it preserve // the exact same semantics from the previous generator. tag = append(tag, "json="+jsonName) } // The previous implementation does not tag extension fields as proto3, // even when the field is defined in a proto3 file. Match that behavior // for consistency. if fd.Syntax() == protoreflect.Proto3 && !fd.IsExtension() { tag = append(tag, "proto3") } if fd.Kind() == protoreflect.EnumKind && enumName != "" { tag = append(tag, "enum="+enumName) } if fd.ContainingOneof() != nil { tag = append(tag, "oneof") } // This must appear last in the tag, since commas in strings aren't escaped. if fd.HasDefault() { def, _ := defval.Marshal(fd.Default(), fd.DefaultEnumValue(), fd.Kind(), defval.GoTag) tag = append(tag, "def="+def) } return strings.Join(tag, ",") } ================================================ FILE: vendor/google.golang.org/protobuf/internal/encoding/text/decode.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package text import ( "bytes" "fmt" "io" "strconv" "unicode/utf8" "google.golang.org/protobuf/internal/errors" ) // Decoder is a token-based textproto decoder. type Decoder struct { // lastCall is last method called, either readCall or peekCall. // Initial value is readCall. lastCall call // lastToken contains the last read token. lastToken Token // lastErr contains the last read error. lastErr error // openStack is a stack containing the byte characters for MessageOpen and // ListOpen kinds. The top of stack represents the message or the list that // the current token is nested in. An empty stack means the current token is // at the top level message. The characters '{' and '<' both represent the // MessageOpen kind. openStack []byte // orig is used in reporting line and column. orig []byte // in contains the unconsumed input. in []byte } // NewDecoder returns a Decoder to read the given []byte. func NewDecoder(b []byte) *Decoder { return &Decoder{orig: b, in: b} } // ErrUnexpectedEOF means that EOF was encountered in the middle of the input. var ErrUnexpectedEOF = errors.New("%v", io.ErrUnexpectedEOF) // call specifies which Decoder method was invoked. type call uint8 const ( readCall call = iota peekCall ) // Peek looks ahead and returns the next token and error without advancing a read. func (d *Decoder) Peek() (Token, error) { defer func() { d.lastCall = peekCall }() if d.lastCall == readCall { d.lastToken, d.lastErr = d.Read() } return d.lastToken, d.lastErr } // Read returns the next token. // It will return an error if there is no valid token. func (d *Decoder) Read() (Token, error) { defer func() { d.lastCall = readCall }() if d.lastCall == peekCall { return d.lastToken, d.lastErr } tok, err := d.parseNext(d.lastToken.kind) if err != nil { return Token{}, err } switch tok.kind { case comma, semicolon: tok, err = d.parseNext(tok.kind) if err != nil { return Token{}, err } } d.lastToken = tok return tok, nil } const ( mismatchedFmt = "mismatched close character %q" unexpectedFmt = "unexpected character %q" ) // parseNext parses the next Token based on given last kind. func (d *Decoder) parseNext(lastKind Kind) (Token, error) { // Trim leading spaces. d.consume(0) isEOF := false if len(d.in) == 0 { isEOF = true } switch lastKind { case EOF: return d.consumeToken(EOF, 0, 0), nil case bof: // Start of top level message. Next token can be EOF or Name. if isEOF { return d.consumeToken(EOF, 0, 0), nil } return d.parseFieldName() case Name: // Next token can be MessageOpen, ListOpen or Scalar. if isEOF { return Token{}, ErrUnexpectedEOF } switch ch := d.in[0]; ch { case '{', '<': d.pushOpenStack(ch) return d.consumeToken(MessageOpen, 1, 0), nil case '[': d.pushOpenStack(ch) return d.consumeToken(ListOpen, 1, 0), nil default: return d.parseScalar() } case Scalar: openKind, closeCh := d.currentOpenKind() switch openKind { case bof: // Top level message. // Next token can be EOF, comma, semicolon or Name. if isEOF { return d.consumeToken(EOF, 0, 0), nil } switch d.in[0] { case ',': return d.consumeToken(comma, 1, 0), nil case ';': return d.consumeToken(semicolon, 1, 0), nil default: return d.parseFieldName() } case MessageOpen: // Next token can be MessageClose, comma, semicolon or Name. if isEOF { return Token{}, ErrUnexpectedEOF } switch ch := d.in[0]; ch { case closeCh: d.popOpenStack() return d.consumeToken(MessageClose, 1, 0), nil case otherCloseChar[closeCh]: return Token{}, d.newSyntaxError(mismatchedFmt, ch) case ',': return d.consumeToken(comma, 1, 0), nil case ';': return d.consumeToken(semicolon, 1, 0), nil default: return d.parseFieldName() } case ListOpen: // Next token can be ListClose or comma. if isEOF { return Token{}, ErrUnexpectedEOF } switch ch := d.in[0]; ch { case ']': d.popOpenStack() return d.consumeToken(ListClose, 1, 0), nil case ',': return d.consumeToken(comma, 1, 0), nil default: return Token{}, d.newSyntaxError(unexpectedFmt, ch) } } case MessageOpen: // Next token can be MessageClose or Name. if isEOF { return Token{}, ErrUnexpectedEOF } _, closeCh := d.currentOpenKind() switch ch := d.in[0]; ch { case closeCh: d.popOpenStack() return d.consumeToken(MessageClose, 1, 0), nil case otherCloseChar[closeCh]: return Token{}, d.newSyntaxError(mismatchedFmt, ch) default: return d.parseFieldName() } case MessageClose: openKind, closeCh := d.currentOpenKind() switch openKind { case bof: // Top level message. // Next token can be EOF, comma, semicolon or Name. if isEOF { return d.consumeToken(EOF, 0, 0), nil } switch ch := d.in[0]; ch { case ',': return d.consumeToken(comma, 1, 0), nil case ';': return d.consumeToken(semicolon, 1, 0), nil default: return d.parseFieldName() } case MessageOpen: // Next token can be MessageClose, comma, semicolon or Name. if isEOF { return Token{}, ErrUnexpectedEOF } switch ch := d.in[0]; ch { case closeCh: d.popOpenStack() return d.consumeToken(MessageClose, 1, 0), nil case otherCloseChar[closeCh]: return Token{}, d.newSyntaxError(mismatchedFmt, ch) case ',': return d.consumeToken(comma, 1, 0), nil case ';': return d.consumeToken(semicolon, 1, 0), nil default: return d.parseFieldName() } case ListOpen: // Next token can be ListClose or comma if isEOF { return Token{}, ErrUnexpectedEOF } switch ch := d.in[0]; ch { case closeCh: d.popOpenStack() return d.consumeToken(ListClose, 1, 0), nil case ',': return d.consumeToken(comma, 1, 0), nil default: return Token{}, d.newSyntaxError(unexpectedFmt, ch) } } case ListOpen: // Next token can be ListClose, MessageStart or Scalar. if isEOF { return Token{}, ErrUnexpectedEOF } switch ch := d.in[0]; ch { case ']': d.popOpenStack() return d.consumeToken(ListClose, 1, 0), nil case '{', '<': d.pushOpenStack(ch) return d.consumeToken(MessageOpen, 1, 0), nil default: return d.parseScalar() } case ListClose: openKind, closeCh := d.currentOpenKind() switch openKind { case bof: // Top level message. // Next token can be EOF, comma, semicolon or Name. if isEOF { return d.consumeToken(EOF, 0, 0), nil } switch ch := d.in[0]; ch { case ',': return d.consumeToken(comma, 1, 0), nil case ';': return d.consumeToken(semicolon, 1, 0), nil default: return d.parseFieldName() } case MessageOpen: // Next token can be MessageClose, comma, semicolon or Name. if isEOF { return Token{}, ErrUnexpectedEOF } switch ch := d.in[0]; ch { case closeCh: d.popOpenStack() return d.consumeToken(MessageClose, 1, 0), nil case otherCloseChar[closeCh]: return Token{}, d.newSyntaxError(mismatchedFmt, ch) case ',': return d.consumeToken(comma, 1, 0), nil case ';': return d.consumeToken(semicolon, 1, 0), nil default: return d.parseFieldName() } default: // It is not possible to have this case. Let it panic below. } case comma, semicolon: openKind, closeCh := d.currentOpenKind() switch openKind { case bof: // Top level message. Next token can be EOF or Name. if isEOF { return d.consumeToken(EOF, 0, 0), nil } return d.parseFieldName() case MessageOpen: // Next token can be MessageClose or Name. if isEOF { return Token{}, ErrUnexpectedEOF } switch ch := d.in[0]; ch { case closeCh: d.popOpenStack() return d.consumeToken(MessageClose, 1, 0), nil case otherCloseChar[closeCh]: return Token{}, d.newSyntaxError(mismatchedFmt, ch) default: return d.parseFieldName() } case ListOpen: if lastKind == semicolon { // It is not be possible to have this case as logic here // should not have produced a semicolon Token when inside a // list. Let it panic below. break } // Next token can be MessageOpen or Scalar. if isEOF { return Token{}, ErrUnexpectedEOF } switch ch := d.in[0]; ch { case '{', '<': d.pushOpenStack(ch) return d.consumeToken(MessageOpen, 1, 0), nil default: return d.parseScalar() } } } line, column := d.Position(len(d.orig) - len(d.in)) panic(fmt.Sprintf("Decoder.parseNext: bug at handling line %d:%d with lastKind=%v", line, column, lastKind)) } var otherCloseChar = map[byte]byte{ '}': '>', '>': '}', } // currentOpenKind indicates whether current position is inside a message, list // or top-level message by returning MessageOpen, ListOpen or bof respectively. // If the returned kind is either a MessageOpen or ListOpen, it also returns the // corresponding closing character. func (d *Decoder) currentOpenKind() (Kind, byte) { if len(d.openStack) == 0 { return bof, 0 } openCh := d.openStack[len(d.openStack)-1] switch openCh { case '{': return MessageOpen, '}' case '<': return MessageOpen, '>' case '[': return ListOpen, ']' } panic(fmt.Sprintf("Decoder: openStack contains invalid byte %c", openCh)) } func (d *Decoder) pushOpenStack(ch byte) { d.openStack = append(d.openStack, ch) } func (d *Decoder) popOpenStack() { d.openStack = d.openStack[:len(d.openStack)-1] } // parseFieldName parses field name and separator. func (d *Decoder) parseFieldName() (tok Token, err error) { defer func() { if err == nil && d.tryConsumeChar(':') { tok.attrs |= hasSeparator } }() // Extension or Any type URL. if d.in[0] == '[' { return d.parseTypeName() } // Identifier. if size := parseIdent(d.in, false); size > 0 { return d.consumeToken(Name, size, uint8(IdentName)), nil } // Field number. Identify if input is a valid number that is not negative // and is decimal integer within 32-bit range. if num := parseNumber(d.in); num.size > 0 { str := num.string(d.in) if !num.neg && num.kind == numDec { if _, err := strconv.ParseInt(str, 10, 32); err == nil { return d.consumeToken(Name, num.size, uint8(FieldNumber)), nil } } return Token{}, d.newSyntaxError("invalid field number: %s", str) } return Token{}, d.newSyntaxError("invalid field name: %s", errId(d.in)) } // parseTypeName parses an Any type URL or an extension field name. The name is // enclosed in [ and ] characters. We allow almost arbitrary type URL prefixes, // closely following the text-format spec [1,2]. We implement "ExtensionName | // AnyName" as follows (with some exceptions for backwards compatibility): // // char = [-_a-zA-Z0-9] // url_char = char | [.~!$&'()*+,;=] | "%", hex, hex // // Ident = char, { char } // TypeName = Ident, { ".", Ident } ; // UrlPrefix = url_char, { url_char | "/" } ; // ExtensionName = "[", TypeName, "]" ; // AnyName = "[", UrlPrefix, "/", TypeName, "]" ; // // Additionally, we allow arbitrary whitespace and comments between [ and ]. // // [1] https://protobuf.dev/reference/protobuf/textformat-spec/#characters // [2] https://protobuf.dev/reference/protobuf/textformat-spec/#field-names func (d *Decoder) parseTypeName() (Token, error) { // Use alias s to advance first in order to use d.in for error handling. // Caller already checks for [ as first character (d.in[0] == '['). s := consume(d.in[1:], 0) if len(s) == 0 { return Token{}, ErrUnexpectedEOF } // Collect everything between [ and ] in name. var name []byte var closed bool for len(s) > 0 && !closed { switch { case s[0] == ']': s = s[1:] closed = true case s[0] == '/' || isTypeNameChar(s[0]) || isUrlExtraChar(s[0]): name = append(name, s[0]) s = consume(s[1:], 0) // URL percent-encoded chars case s[0] == '%': if len(s) < 3 || !isHexChar(s[1]) || !isHexChar(s[2]) { return Token{}, d.parseTypeNameError(s, 3) } name = append(name, s[0], s[1], s[2]) s = consume(s[3:], 0) default: return Token{}, d.parseTypeNameError(s, 1) } } if !closed { return Token{}, ErrUnexpectedEOF } // Split collected name on last '/' into urlPrefix and typeName (if '/' is // present). typeName := name if i := bytes.LastIndexByte(name, '/'); i != -1 { urlPrefix := name[:i] typeName = name[i+1:] // urlPrefix may be empty (for backwards compatibility). // If non-empty, it must not start with '/'. if len(urlPrefix) > 0 && urlPrefix[0] == '/' { return Token{}, d.parseTypeNameError(s, 0) } } // typeName must not be empty (note: "" splits to [""]) and all identifier // parts must not be empty. for _, ident := range bytes.Split(typeName, []byte{'.'}) { if len(ident) == 0 { return Token{}, d.parseTypeNameError(s, 0) } } // typeName must not contain any percent-encoded or special URL chars. for _, b := range typeName { if b == '%' || (b != '.' && isUrlExtraChar(b)) { return Token{}, d.parseTypeNameError(s, 0) } } startPos := len(d.orig) - len(d.in) endPos := len(d.orig) - len(s) d.in = s d.consume(0) return Token{ kind: Name, attrs: uint8(TypeName), pos: startPos, raw: d.orig[startPos:endPos], str: string(name), }, nil } func (d *Decoder) parseTypeNameError(s []byte, numUnconsumedChars int) error { return d.newSyntaxError( "invalid type URL/extension field name: %s", d.in[:len(d.in)-len(s)+min(numUnconsumedChars, len(s))], ) } func isHexChar(b byte) bool { return ('0' <= b && b <= '9') || ('a' <= b && b <= 'f') || ('A' <= b && b <= 'F') } func isTypeNameChar(b byte) bool { return b == '-' || b == '_' || ('0' <= b && b <= '9') || ('a' <= b && b <= 'z') || ('A' <= b && b <= 'Z') } // isUrlExtraChar complements isTypeNameChar with extra characters that we allow // in URLs but not in type names. Note that '/' is not included so that it can // be treated specially. func isUrlExtraChar(b byte) bool { switch b { case '.', '~', '!', '$', '&', '(', ')', '*', '+', ',', ';', '=': return true default: return false } } // parseIdent parses an unquoted proto identifier and returns size. // If allowNeg is true, it allows '-' to be the first character in the // identifier. This is used when parsing literal values like -infinity, etc. // Regular expression matches an identifier: `^[_a-zA-Z][_a-zA-Z0-9]*` func parseIdent(input []byte, allowNeg bool) int { var size int s := input if len(s) == 0 { return 0 } if allowNeg && s[0] == '-' { s = s[1:] size++ if len(s) == 0 { return 0 } } switch { case s[0] == '_', 'a' <= s[0] && s[0] <= 'z', 'A' <= s[0] && s[0] <= 'Z': s = s[1:] size++ default: return 0 } for len(s) > 0 && (s[0] == '_' || 'a' <= s[0] && s[0] <= 'z' || 'A' <= s[0] && s[0] <= 'Z' || '0' <= s[0] && s[0] <= '9') { s = s[1:] size++ } if len(s) > 0 && !isDelim(s[0]) { return 0 } return size } // parseScalar parses for a string, literal or number value. func (d *Decoder) parseScalar() (Token, error) { if d.in[0] == '"' || d.in[0] == '\'' { return d.parseStringValue() } if tok, ok := d.parseLiteralValue(); ok { return tok, nil } if tok, ok := d.parseNumberValue(); ok { return tok, nil } return Token{}, d.newSyntaxError("invalid scalar value: %s", errId(d.in)) } // parseLiteralValue parses a literal value. A literal value is used for // bools, special floats and enums. This function simply identifies that the // field value is a literal. func (d *Decoder) parseLiteralValue() (Token, bool) { size := parseIdent(d.in, true) if size == 0 { return Token{}, false } return d.consumeToken(Scalar, size, literalValue), true } // consumeToken constructs a Token for given Kind from d.in and consumes given // size-length from it. func (d *Decoder) consumeToken(kind Kind, size int, attrs uint8) Token { // Important to compute raw and pos before consuming. tok := Token{ kind: kind, attrs: attrs, pos: len(d.orig) - len(d.in), raw: d.in[:size], } d.consume(size) return tok } // newSyntaxError returns a syntax error with line and column information for // current position. func (d *Decoder) newSyntaxError(f string, x ...any) error { e := errors.New(f, x...) line, column := d.Position(len(d.orig) - len(d.in)) return errors.New("syntax error (line %d:%d): %v", line, column, e) } // Position returns line and column number of given index of the original input. // It will panic if index is out of range. func (d *Decoder) Position(idx int) (line int, column int) { b := d.orig[:idx] line = bytes.Count(b, []byte("\n")) + 1 if i := bytes.LastIndexByte(b, '\n'); i >= 0 { b = b[i+1:] } column = utf8.RuneCount(b) + 1 // ignore multi-rune characters return line, column } func (d *Decoder) tryConsumeChar(c byte) bool { if len(d.in) > 0 && d.in[0] == c { d.consume(1) return true } return false } // consume consumes n bytes of input and any subsequent whitespace or comments. func (d *Decoder) consume(n int) { d.in = consume(d.in, n) return } // consume consumes n bytes of input and any subsequent whitespace or comments. func consume(b []byte, n int) []byte { b = b[n:] for len(b) > 0 { switch b[0] { case ' ', '\n', '\r', '\t': b = b[1:] case '#': if i := bytes.IndexByte(b, '\n'); i >= 0 { b = b[i+len("\n"):] } else { b = nil } default: return b } } return b } // errId extracts a byte sequence that looks like an invalid ID // (for the purposes of error reporting). func errId(seq []byte) []byte { const maxLen = 32 for i := 0; i < len(seq); { if i > maxLen { return append(seq[:i:i], "…"...) } r, size := utf8.DecodeRune(seq[i:]) if r > utf8.RuneSelf || (r != '/' && isDelim(byte(r))) { if i == 0 { // Either the first byte is invalid UTF-8 or a // delimiter, or the first rune is non-ASCII. // Return it as-is. i = size } return seq[:i:i] } i += size } // No delimiter found. return seq } // isDelim returns true if given byte is a delimiter character. func isDelim(c byte) bool { return !(c == '-' || c == '+' || c == '.' || c == '_' || ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || ('0' <= c && c <= '9')) } ================================================ FILE: vendor/google.golang.org/protobuf/internal/encoding/text/decode_number.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package text // parseNumberValue parses a number from the input and returns a Token object. func (d *Decoder) parseNumberValue() (Token, bool) { in := d.in num := parseNumber(in) if num.size == 0 { return Token{}, false } numAttrs := num.kind if num.neg { numAttrs |= isNegative } tok := Token{ kind: Scalar, attrs: numberValue, pos: len(d.orig) - len(d.in), raw: d.in[:num.size], str: num.string(d.in), numAttrs: numAttrs, } d.consume(num.size) return tok, true } const ( numDec uint8 = (1 << iota) / 2 numHex numOct numFloat ) // number is the result of parsing out a valid number from parseNumber. It // contains data for doing float or integer conversion via the strconv package // in conjunction with the input bytes. type number struct { kind uint8 neg bool size int // if neg, this is the length of whitespace and comments between // the minus sign and the rest fo the number literal sep int } func (num number) string(data []byte) string { strSize := num.size last := num.size - 1 if num.kind == numFloat && (data[last] == 'f' || data[last] == 'F') { strSize = last } if num.neg && num.sep > 0 { // strip whitespace/comments between negative sign and the rest strLen := strSize - num.sep str := make([]byte, strLen) str[0] = data[0] copy(str[1:], data[num.sep+1:strSize]) return string(str) } return string(data[:strSize]) } // parseNumber constructs a number object from given input. It allows for the // following patterns: // // integer: ^-?([1-9][0-9]*|0[xX][0-9a-fA-F]+|0[0-7]*) // float: ^-?((0|[1-9][0-9]*)?([.][0-9]*)?([eE][+-]?[0-9]+)?[fF]?) // // It also returns the number of parsed bytes for the given number, 0 if it is // not a number. func parseNumber(input []byte) number { kind := numDec var size int var neg bool s := input if len(s) == 0 { return number{} } // Optional - var sep int if s[0] == '-' { neg = true s = s[1:] size++ // Consume any whitespace or comments between the // negative sign and the rest of the number lenBefore := len(s) s = consume(s, 0) sep = lenBefore - len(s) size += sep if len(s) == 0 { return number{} } } switch { case s[0] == '0': if len(s) > 1 { switch { case s[1] == 'x' || s[1] == 'X': // Parse as hex number. kind = numHex n := 2 s = s[2:] for len(s) > 0 && (('0' <= s[0] && s[0] <= '9') || ('a' <= s[0] && s[0] <= 'f') || ('A' <= s[0] && s[0] <= 'F')) { s = s[1:] n++ } if n == 2 { return number{} } size += n case '0' <= s[1] && s[1] <= '7': // Parse as octal number. kind = numOct n := 2 s = s[2:] for len(s) > 0 && '0' <= s[0] && s[0] <= '7' { s = s[1:] n++ } size += n } if kind&(numHex|numOct) > 0 { if len(s) > 0 && !isDelim(s[0]) { return number{} } return number{kind: kind, neg: neg, size: size, sep: sep} } } s = s[1:] size++ case '1' <= s[0] && s[0] <= '9': n := 1 s = s[1:] for len(s) > 0 && '0' <= s[0] && s[0] <= '9' { s = s[1:] n++ } size += n case s[0] == '.': // Set kind to numFloat to signify the intent to parse as float. And // that it needs to have other digits after '.'. kind = numFloat default: return number{} } // . followed by 0 or more digits. if len(s) > 0 && s[0] == '.' { n := 1 s = s[1:] // If decimal point was before any digits, it should be followed by // other digits. if len(s) == 0 && kind == numFloat { return number{} } for len(s) > 0 && '0' <= s[0] && s[0] <= '9' { s = s[1:] n++ } size += n kind = numFloat } // e or E followed by an optional - or + and 1 or more digits. if len(s) >= 2 && (s[0] == 'e' || s[0] == 'E') { kind = numFloat s = s[1:] n := 1 if s[0] == '+' || s[0] == '-' { s = s[1:] n++ if len(s) == 0 { return number{} } } for len(s) > 0 && '0' <= s[0] && s[0] <= '9' { s = s[1:] n++ } size += n } // Optional suffix f or F for floats. if len(s) > 0 && (s[0] == 'f' || s[0] == 'F') { kind = numFloat s = s[1:] size++ } // Check that next byte is a delimiter or it is at the end. if len(s) > 0 && !isDelim(s[0]) { return number{} } return number{kind: kind, neg: neg, size: size, sep: sep} } ================================================ FILE: vendor/google.golang.org/protobuf/internal/encoding/text/decode_string.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package text import ( "bytes" "strconv" "strings" "unicode" "unicode/utf16" "unicode/utf8" "google.golang.org/protobuf/internal/strs" ) // parseStringValue parses string field token. // This differs from parseString since the text format allows // multiple back-to-back string literals where they are semantically treated // as a single large string with all values concatenated. // // E.g., `"foo" "bar" "baz"` => "foobarbaz" func (d *Decoder) parseStringValue() (Token, error) { // Note that the ending quote is sufficient to unambiguously mark the end // of a string. Thus, the text grammar does not require intervening // whitespace or control characters in-between strings. // Thus, the following is valid: // `"foo"'bar'"baz"` => "foobarbaz" in0 := d.in var ss []string for len(d.in) > 0 && (d.in[0] == '"' || d.in[0] == '\'') { s, err := d.parseString() if err != nil { return Token{}, err } ss = append(ss, s) } // d.in already points to the end of the value at this point. return Token{ kind: Scalar, attrs: stringValue, pos: len(d.orig) - len(in0), raw: in0[:len(in0)-len(d.in)], str: strings.Join(ss, ""), }, nil } // parseString parses a string value enclosed in " or '. func (d *Decoder) parseString() (string, error) { in := d.in if len(in) == 0 { return "", ErrUnexpectedEOF } quote := in[0] in = in[1:] i := indexNeedEscapeInBytes(in) in, out := in[i:], in[:i:i] // set cap to prevent mutations for len(in) > 0 { switch r, n := utf8.DecodeRune(in); { case r == utf8.RuneError && n == 1: return "", d.newSyntaxError("invalid UTF-8 detected") case r == 0 || r == '\n': return "", d.newSyntaxError("invalid character %q in string", r) case r == rune(quote): in = in[1:] d.consume(len(d.in) - len(in)) return string(out), nil case r == '\\': if len(in) < 2 { return "", ErrUnexpectedEOF } switch r := in[1]; r { case '"', '\'', '\\', '?': in, out = in[2:], append(out, r) case 'a': in, out = in[2:], append(out, '\a') case 'b': in, out = in[2:], append(out, '\b') case 'n': in, out = in[2:], append(out, '\n') case 'r': in, out = in[2:], append(out, '\r') case 't': in, out = in[2:], append(out, '\t') case 'v': in, out = in[2:], append(out, '\v') case 'f': in, out = in[2:], append(out, '\f') case '0', '1', '2', '3', '4', '5', '6', '7': // One, two, or three octal characters. n := len(in[1:]) - len(bytes.TrimLeft(in[1:], "01234567")) if n > 3 { n = 3 } v, err := strconv.ParseUint(string(in[1:1+n]), 8, 8) if err != nil { return "", d.newSyntaxError("invalid octal escape code %q in string", in[:1+n]) } in, out = in[1+n:], append(out, byte(v)) case 'x': // One or two hexadecimal characters. n := len(in[2:]) - len(bytes.TrimLeft(in[2:], "0123456789abcdefABCDEF")) if n > 2 { n = 2 } v, err := strconv.ParseUint(string(in[2:2+n]), 16, 8) if err != nil { return "", d.newSyntaxError("invalid hex escape code %q in string", in[:2+n]) } in, out = in[2+n:], append(out, byte(v)) case 'u', 'U': // Four or eight hexadecimal characters n := 6 if r == 'U' { n = 10 } if len(in) < n { return "", ErrUnexpectedEOF } v, err := strconv.ParseUint(string(in[2:n]), 16, 32) if utf8.MaxRune < v || err != nil { return "", d.newSyntaxError("invalid Unicode escape code %q in string", in[:n]) } in = in[n:] r := rune(v) if utf16.IsSurrogate(r) { if len(in) < 6 { return "", ErrUnexpectedEOF } v, err := strconv.ParseUint(string(in[2:6]), 16, 16) r = utf16.DecodeRune(r, rune(v)) if in[0] != '\\' || in[1] != 'u' || r == unicode.ReplacementChar || err != nil { return "", d.newSyntaxError("invalid Unicode escape code %q in string", in[:6]) } in = in[6:] } out = append(out, string(r)...) default: return "", d.newSyntaxError("invalid escape code %q in string", in[:2]) } default: i := indexNeedEscapeInBytes(in[n:]) in, out = in[n+i:], append(out, in[:n+i]...) } } return "", ErrUnexpectedEOF } // indexNeedEscapeInString returns the index of the character that needs // escaping. If no characters need escaping, this returns the input length. func indexNeedEscapeInBytes(b []byte) int { return indexNeedEscapeInString(strs.UnsafeString(b)) } // UnmarshalString returns an unescaped string given a textproto string value. // String value needs to contain single or double quotes. This is only used by // internal/encoding/defval package for unmarshaling bytes. func UnmarshalString(s string) (string, error) { d := NewDecoder([]byte(s)) return d.parseString() } ================================================ FILE: vendor/google.golang.org/protobuf/internal/encoding/text/decode_token.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package text import ( "bytes" "fmt" "math" "strconv" "strings" "google.golang.org/protobuf/internal/flags" ) // Kind represents a token kind expressible in the textproto format. type Kind uint8 // Kind values. const ( Invalid Kind = iota EOF Name // Name indicates the field name. Scalar // Scalar are scalar values, e.g. "string", 47, ENUM_LITERAL, true. MessageOpen MessageClose ListOpen ListClose // comma and semi-colon are only for parsing in between values and should not be exposed. comma semicolon // bof indicates beginning of file, which is the default token // kind at the beginning of parsing. bof = Invalid ) func (t Kind) String() string { switch t { case Invalid: return "" case EOF: return "eof" case Scalar: return "scalar" case Name: return "name" case MessageOpen: return "{" case MessageClose: return "}" case ListOpen: return "[" case ListClose: return "]" case comma: return "," case semicolon: return ";" default: return fmt.Sprintf("", uint8(t)) } } // NameKind represents different types of field names. type NameKind uint8 // NameKind values. const ( IdentName NameKind = iota + 1 TypeName FieldNumber ) func (t NameKind) String() string { switch t { case IdentName: return "IdentName" case TypeName: return "TypeName" case FieldNumber: return "FieldNumber" default: return fmt.Sprintf("", uint8(t)) } } // Bit mask in Token.attrs to indicate if a Name token is followed by the // separator char ':'. The field name separator char is optional for message // field or repeated message field, but required for all other types. Decoder // simply indicates whether a Name token is followed by separator or not. It is // up to the prototext package to validate. const hasSeparator = 1 << 7 // Scalar value types. const ( numberValue = iota + 1 stringValue literalValue ) // Bit mask in Token.numAttrs to indicate that the number is a negative. const isNegative = 1 << 7 // Token provides a parsed token kind and value. Values are provided by the // different accessor methods. type Token struct { // Kind of the Token object. kind Kind // attrs contains metadata for the following Kinds: // Name: hasSeparator bit and one of NameKind. // Scalar: one of numberValue, stringValue, literalValue. attrs uint8 // numAttrs contains metadata for numberValue: // - highest bit is whether negative or positive. // - lower bits indicate one of numDec, numHex, numOct, numFloat. numAttrs uint8 // pos provides the position of the token in the original input. pos int // raw bytes of the serialized token. // This is a subslice into the original input. raw []byte // str contains parsed string for the following: // - stringValue of Scalar kind // - numberValue of Scalar kind // - TypeName of Name kind str string } // Kind returns the token kind. func (t Token) Kind() Kind { return t.kind } // RawString returns the read value in string. func (t Token) RawString() string { return string(t.raw) } // Pos returns the token position from the input. func (t Token) Pos() int { return t.pos } // NameKind returns IdentName, TypeName or FieldNumber. // It panics if type is not Name. func (t Token) NameKind() NameKind { if t.kind == Name { return NameKind(t.attrs &^ hasSeparator) } panic(fmt.Sprintf("Token is not a Name type: %s", t.kind)) } // HasSeparator returns true if the field name is followed by the separator char // ':', else false. It panics if type is not Name. func (t Token) HasSeparator() bool { if t.kind == Name { return t.attrs&hasSeparator != 0 } panic(fmt.Sprintf("Token is not a Name type: %s", t.kind)) } // IdentName returns the value for IdentName type. func (t Token) IdentName() string { if t.kind == Name && t.attrs&uint8(IdentName) != 0 { return string(t.raw) } panic(fmt.Sprintf("Token is not an IdentName: %s:%s", t.kind, NameKind(t.attrs&^hasSeparator))) } // TypeName returns the value for TypeName type. func (t Token) TypeName() string { if t.kind == Name && t.attrs&uint8(TypeName) != 0 { return t.str } panic(fmt.Sprintf("Token is not a TypeName: %s:%s", t.kind, NameKind(t.attrs&^hasSeparator))) } // FieldNumber returns the value for FieldNumber type. It returns a // non-negative int32 value. Caller will still need to validate for the correct // field number range. func (t Token) FieldNumber() int32 { if t.kind != Name || t.attrs&uint8(FieldNumber) == 0 { panic(fmt.Sprintf("Token is not a FieldNumber: %s:%s", t.kind, NameKind(t.attrs&^hasSeparator))) } // Following should not return an error as it had already been called right // before this Token was constructed. num, _ := strconv.ParseInt(string(t.raw), 10, 32) return int32(num) } // String returns the string value for a Scalar type. func (t Token) String() (string, bool) { if t.kind != Scalar || t.attrs != stringValue { return "", false } return t.str, true } // Enum returns the literal value for a Scalar type for use as enum literals. func (t Token) Enum() (string, bool) { if t.kind != Scalar || t.attrs != literalValue || (len(t.raw) > 0 && t.raw[0] == '-') { return "", false } return string(t.raw), true } // Bool returns the bool value for a Scalar type. func (t Token) Bool() (bool, bool) { if t.kind != Scalar { return false, false } switch t.attrs { case literalValue: if b, ok := boolLits[string(t.raw)]; ok { return b, true } case numberValue: // Unsigned integer representation of 0 or 1 is permitted: 00, 0x0, 01, // 0x1, etc. n, err := strconv.ParseUint(t.str, 0, 64) if err == nil { switch n { case 0: return false, true case 1: return true, true } } } return false, false } // These exact boolean literals are the ones supported in C++. var boolLits = map[string]bool{ "t": true, "true": true, "True": true, "f": false, "false": false, "False": false, } // Uint64 returns the uint64 value for a Scalar type. func (t Token) Uint64() (uint64, bool) { if t.kind != Scalar || t.attrs != numberValue || t.numAttrs&isNegative > 0 || t.numAttrs&numFloat > 0 { return 0, false } n, err := strconv.ParseUint(t.str, 0, 64) if err != nil { return 0, false } return n, true } // Uint32 returns the uint32 value for a Scalar type. func (t Token) Uint32() (uint32, bool) { if t.kind != Scalar || t.attrs != numberValue || t.numAttrs&isNegative > 0 || t.numAttrs&numFloat > 0 { return 0, false } n, err := strconv.ParseUint(t.str, 0, 32) if err != nil { return 0, false } return uint32(n), true } // Int64 returns the int64 value for a Scalar type. func (t Token) Int64() (int64, bool) { if t.kind != Scalar || t.attrs != numberValue || t.numAttrs&numFloat > 0 { return 0, false } if n, err := strconv.ParseInt(t.str, 0, 64); err == nil { return n, true } // C++ accepts large positive hex numbers as negative values. // This feature is here for proto1 backwards compatibility purposes. if flags.ProtoLegacy && (t.numAttrs == numHex) { if n, err := strconv.ParseUint(t.str, 0, 64); err == nil { return int64(n), true } } return 0, false } // Int32 returns the int32 value for a Scalar type. func (t Token) Int32() (int32, bool) { if t.kind != Scalar || t.attrs != numberValue || t.numAttrs&numFloat > 0 { return 0, false } if n, err := strconv.ParseInt(t.str, 0, 32); err == nil { return int32(n), true } // C++ accepts large positive hex numbers as negative values. // This feature is here for proto1 backwards compatibility purposes. if flags.ProtoLegacy && (t.numAttrs == numHex) { if n, err := strconv.ParseUint(t.str, 0, 32); err == nil { return int32(n), true } } return 0, false } // Float64 returns the float64 value for a Scalar type. func (t Token) Float64() (float64, bool) { if t.kind != Scalar { return 0, false } switch t.attrs { case literalValue: if f, ok := floatLits[strings.ToLower(string(t.raw))]; ok { return f, true } case numberValue: n, err := strconv.ParseFloat(t.str, 64) if err == nil { return n, true } nerr := err.(*strconv.NumError) if nerr.Err == strconv.ErrRange { return n, true } } return 0, false } // Float32 returns the float32 value for a Scalar type. func (t Token) Float32() (float32, bool) { if t.kind != Scalar { return 0, false } switch t.attrs { case literalValue: if f, ok := floatLits[strings.ToLower(string(t.raw))]; ok { return float32(f), true } case numberValue: n, err := strconv.ParseFloat(t.str, 64) if err == nil { // Overflows are treated as (-)infinity. return float32(n), true } nerr := err.(*strconv.NumError) if nerr.Err == strconv.ErrRange { return float32(n), true } } return 0, false } // These are the supported float literals which C++ permits case-insensitive // variants of these. var floatLits = map[string]float64{ "nan": math.NaN(), "inf": math.Inf(1), "infinity": math.Inf(1), "-inf": math.Inf(-1), "-infinity": math.Inf(-1), } // TokenEquals returns true if given Tokens are equal, else false. func TokenEquals(x, y Token) bool { return x.kind == y.kind && x.attrs == y.attrs && x.numAttrs == y.numAttrs && x.pos == y.pos && bytes.Equal(x.raw, y.raw) && x.str == y.str } ================================================ FILE: vendor/google.golang.org/protobuf/internal/encoding/text/doc.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package text implements the text format for protocol buffers. // This package has no semantic understanding for protocol buffers and is only // a parser and composer for the format. // // There is no formal specification for the protobuf text format, as such the // C++ implementation (see google::protobuf::TextFormat) is the reference // implementation of the text format. // // This package is neither a superset nor a subset of the C++ implementation. // This implementation permits a more liberal grammar in some cases to be // backwards compatible with the historical Go implementation. // Future parsings unique to Go should not be added. // Some grammars allowed by the C++ implementation are deliberately // not implemented here because they are considered a bug by the protobuf team // and should not be replicated. // // The Go implementation should implement a sufficient amount of the C++ // grammar such that the default text serialization by C++ can be parsed by Go. // However, just because the C++ parser accepts some input does not mean that // the Go implementation should as well. // // The text format is almost a superset of JSON except: // - message keys are not quoted strings, but identifiers // - the top-level value must be a message without the delimiters package text ================================================ FILE: vendor/google.golang.org/protobuf/internal/encoding/text/encode.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package text import ( "math" "math/bits" "strconv" "strings" "unicode/utf8" "google.golang.org/protobuf/internal/detrand" "google.golang.org/protobuf/internal/errors" ) // encType represents an encoding type. type encType uint8 const ( _ encType = (1 << iota) / 2 name scalar messageOpen messageClose ) // Encoder provides methods to write out textproto constructs and values. The user is // responsible for producing valid sequences of constructs and values. type Encoder struct { encoderState indent string delims [2]byte outputASCII bool } type encoderState struct { lastType encType indents []byte out []byte } // NewEncoder returns an Encoder. // // If indent is a non-empty string, it causes every entry in a List or Message // to be preceded by the indent and trailed by a newline. // // If delims is not the zero value, it controls the delimiter characters used // for messages (e.g., "{}" vs "<>"). // // If outputASCII is true, strings will be serialized in such a way that // multi-byte UTF-8 sequences are escaped. This property ensures that the // overall output is ASCII (as opposed to UTF-8). func NewEncoder(buf []byte, indent string, delims [2]byte, outputASCII bool) (*Encoder, error) { e := &Encoder{ encoderState: encoderState{out: buf}, } if len(indent) > 0 { if strings.Trim(indent, " \t") != "" { return nil, errors.New("indent may only be composed of space and tab characters") } e.indent = indent } switch delims { case [2]byte{0, 0}: e.delims = [2]byte{'{', '}'} case [2]byte{'{', '}'}, [2]byte{'<', '>'}: e.delims = delims default: return nil, errors.New("delimiters may only be \"{}\" or \"<>\"") } e.outputASCII = outputASCII return e, nil } // Bytes returns the content of the written bytes. func (e *Encoder) Bytes() []byte { return e.out } // StartMessage writes out the '{' or '<' symbol. func (e *Encoder) StartMessage() { e.prepareNext(messageOpen) e.out = append(e.out, e.delims[0]) } // EndMessage writes out the '}' or '>' symbol. func (e *Encoder) EndMessage() { e.prepareNext(messageClose) e.out = append(e.out, e.delims[1]) } // WriteName writes out the field name and the separator ':'. func (e *Encoder) WriteName(s string) { e.prepareNext(name) e.out = append(e.out, s...) e.out = append(e.out, ':') } // WriteBool writes out the given boolean value. func (e *Encoder) WriteBool(b bool) { if b { e.WriteLiteral("true") } else { e.WriteLiteral("false") } } // WriteString writes out the given string value. func (e *Encoder) WriteString(s string) { e.prepareNext(scalar) e.out = appendString(e.out, s, e.outputASCII) } func appendString(out []byte, in string, outputASCII bool) []byte { out = append(out, '"') i := indexNeedEscapeInString(in) in, out = in[i:], append(out, in[:i]...) for len(in) > 0 { switch r, n := utf8.DecodeRuneInString(in); { case r == utf8.RuneError && n == 1: // We do not report invalid UTF-8 because strings in the text format // are used to represent both the proto string and bytes type. r = rune(in[0]) fallthrough case r < ' ' || r == '"' || r == '\\' || r == 0x7f: out = append(out, '\\') switch r { case '"', '\\': out = append(out, byte(r)) case '\n': out = append(out, 'n') case '\r': out = append(out, 'r') case '\t': out = append(out, 't') default: out = append(out, 'x') out = append(out, "00"[1+(bits.Len32(uint32(r))-1)/4:]...) out = strconv.AppendUint(out, uint64(r), 16) } in = in[n:] case r >= utf8.RuneSelf && (outputASCII || r <= 0x009f): out = append(out, '\\') if r <= math.MaxUint16 { out = append(out, 'u') out = append(out, "0000"[1+(bits.Len32(uint32(r))-1)/4:]...) out = strconv.AppendUint(out, uint64(r), 16) } else { out = append(out, 'U') out = append(out, "00000000"[1+(bits.Len32(uint32(r))-1)/4:]...) out = strconv.AppendUint(out, uint64(r), 16) } in = in[n:] default: i := indexNeedEscapeInString(in[n:]) in, out = in[n+i:], append(out, in[:n+i]...) } } out = append(out, '"') return out } // indexNeedEscapeInString returns the index of the character that needs // escaping. If no characters need escaping, this returns the input length. func indexNeedEscapeInString(s string) int { for i := 0; i < len(s); i++ { if c := s[i]; c < ' ' || c == '"' || c == '\'' || c == '\\' || c >= 0x7f { return i } } return len(s) } // WriteFloat writes out the given float value for given bitSize. func (e *Encoder) WriteFloat(n float64, bitSize int) { e.prepareNext(scalar) e.out = appendFloat(e.out, n, bitSize) } func appendFloat(out []byte, n float64, bitSize int) []byte { switch { case math.IsNaN(n): return append(out, "nan"...) case math.IsInf(n, +1): return append(out, "inf"...) case math.IsInf(n, -1): return append(out, "-inf"...) default: return strconv.AppendFloat(out, n, 'g', -1, bitSize) } } // WriteInt writes out the given signed integer value. func (e *Encoder) WriteInt(n int64) { e.prepareNext(scalar) e.out = strconv.AppendInt(e.out, n, 10) } // WriteUint writes out the given unsigned integer value. func (e *Encoder) WriteUint(n uint64) { e.prepareNext(scalar) e.out = strconv.AppendUint(e.out, n, 10) } // WriteLiteral writes out the given string as a literal value without quotes. // This is used for writing enum literal strings. func (e *Encoder) WriteLiteral(s string) { e.prepareNext(scalar) e.out = append(e.out, s...) } // prepareNext adds possible space and indentation for the next value based // on last encType and indent option. It also updates e.lastType to next. func (e *Encoder) prepareNext(next encType) { defer func() { e.lastType = next }() // Single line. if len(e.indent) == 0 { // Add space after each field before the next one. if e.lastType&(scalar|messageClose) != 0 && next == name { e.out = append(e.out, ' ') // Add a random extra space to make output unstable. if detrand.Bool() { e.out = append(e.out, ' ') } } return } // Multi-line. switch { case e.lastType == name: e.out = append(e.out, ' ') // Add a random extra space after name: to make output unstable. if detrand.Bool() { e.out = append(e.out, ' ') } case e.lastType == messageOpen && next != messageClose: e.indents = append(e.indents, e.indent...) e.out = append(e.out, '\n') e.out = append(e.out, e.indents...) case e.lastType&(scalar|messageClose) != 0: if next == messageClose { e.indents = e.indents[:len(e.indents)-len(e.indent)] } e.out = append(e.out, '\n') e.out = append(e.out, e.indents...) } } // Snapshot returns the current snapshot for use in Reset. func (e *Encoder) Snapshot() encoderState { return e.encoderState } // Reset resets the Encoder to the given encoderState from a Snapshot. func (e *Encoder) Reset(es encoderState) { e.encoderState = es } // AppendString appends the escaped form of the input string to b. func AppendString(b []byte, s string) []byte { return appendString(b, s, false) } ================================================ FILE: vendor/google.golang.org/protobuf/internal/errors/errors.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package errors implements functions to manipulate errors. package errors import ( "errors" "fmt" "google.golang.org/protobuf/internal/detrand" ) // Error is a sentinel matching all errors produced by this package. var Error = errors.New("protobuf error") // New formats a string according to the format specifier and arguments and // returns an error that has a "proto" prefix. func New(f string, x ...any) error { return &prefixError{s: format(f, x...)} } type prefixError struct{ s string } var prefix = func() string { // Deliberately introduce instability into the error message string to // discourage users from performing error string comparisons. if detrand.Bool() { return "proto: " // use non-breaking spaces (U+00a0) } else { return "proto: " // use regular spaces (U+0020) } }() func (e *prefixError) Error() string { return prefix + e.s } func (e *prefixError) Unwrap() error { return Error } // Wrap returns an error that has a "proto" prefix, the formatted string described // by the format specifier and arguments, and a suffix of err. The error wraps err. func Wrap(err error, f string, x ...any) error { return &wrapError{ s: format(f, x...), err: err, } } type wrapError struct { s string err error } func (e *wrapError) Error() string { return format("%v%v: %v", prefix, e.s, e.err) } func (e *wrapError) Unwrap() error { return e.err } func (e *wrapError) Is(target error) bool { return target == Error } func format(f string, x ...any) string { // avoid "proto: " prefix when chaining for i := 0; i < len(x); i++ { switch e := x[i].(type) { case *prefixError: x[i] = e.s case *wrapError: x[i] = format("%v: %v", e.s, e.err) } } return fmt.Sprintf(f, x...) } func InvalidUTF8(name string) error { return New("field %v contains invalid UTF-8", name) } func RequiredNotSet(name string) error { return New("required field %v not set", name) } type SizeMismatchError struct { Calculated, Measured int } func (e *SizeMismatchError) Error() string { return fmt.Sprintf("size mismatch (see https://github.com/golang/protobuf/issues/1609): calculated=%d, measured=%d", e.Calculated, e.Measured) } func MismatchedSizeCalculation(calculated, measured int) error { return &SizeMismatchError{ Calculated: calculated, Measured: measured, } } ================================================ FILE: vendor/google.golang.org/protobuf/internal/filedesc/build.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package filedesc provides functionality for constructing descriptors. // // The types in this package implement interfaces in the protoreflect package // related to protobuf descripriptors. package filedesc import ( "google.golang.org/protobuf/encoding/protowire" "google.golang.org/protobuf/internal/genid" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/reflect/protoregistry" ) // Builder construct a protoreflect.FileDescriptor from the raw descriptor. type Builder struct { // GoPackagePath is the Go package path that is invoking this builder. GoPackagePath string // RawDescriptor is the wire-encoded bytes of FileDescriptorProto // and must be populated. RawDescriptor []byte // NumEnums is the total number of enums declared in the file. NumEnums int32 // NumMessages is the total number of messages declared in the file. // It includes the implicit message declarations for map entries. NumMessages int32 // NumExtensions is the total number of extensions declared in the file. NumExtensions int32 // NumServices is the total number of services declared in the file. NumServices int32 // TypeResolver resolves extension field types for descriptor options. // If nil, it uses protoregistry.GlobalTypes. TypeResolver interface { protoregistry.ExtensionTypeResolver } // FileRegistry is use to lookup file, enum, and message dependencies. // Once constructed, the file descriptor is registered here. // If nil, it uses protoregistry.GlobalFiles. FileRegistry interface { FindFileByPath(string) (protoreflect.FileDescriptor, error) FindDescriptorByName(protoreflect.FullName) (protoreflect.Descriptor, error) RegisterFile(protoreflect.FileDescriptor) error } } // resolverByIndex is an interface Builder.FileRegistry may implement. // If so, it permits looking up an enum or message dependency based on the // sub-list and element index into filetype.Builder.DependencyIndexes. type resolverByIndex interface { FindEnumByIndex(int32, int32, []Enum, []Message) protoreflect.EnumDescriptor FindMessageByIndex(int32, int32, []Enum, []Message) protoreflect.MessageDescriptor } // Indexes of each sub-list in filetype.Builder.DependencyIndexes. const ( listFieldDeps int32 = iota listExtTargets listExtDeps listMethInDeps listMethOutDeps ) // Out is the output of the Builder. type Out struct { File protoreflect.FileDescriptor // Enums is all enum descriptors in "flattened ordering". Enums []Enum // Messages is all message descriptors in "flattened ordering". // It includes the implicit message declarations for map entries. Messages []Message // Extensions is all extension descriptors in "flattened ordering". Extensions []Extension // Service is all service descriptors in "flattened ordering". Services []Service } // Build constructs a FileDescriptor given the parameters set in Builder. // It assumes that the inputs are well-formed and panics if any inconsistencies // are encountered. // // If NumEnums+NumMessages+NumExtensions+NumServices is zero, // then Build automatically derives them from the raw descriptor. func (db Builder) Build() (out Out) { // Populate the counts if uninitialized. if db.NumEnums+db.NumMessages+db.NumExtensions+db.NumServices == 0 { db.unmarshalCounts(db.RawDescriptor, true) } // Initialize resolvers and registries if unpopulated. if db.TypeResolver == nil { db.TypeResolver = protoregistry.GlobalTypes } if db.FileRegistry == nil { db.FileRegistry = protoregistry.GlobalFiles } fd := newRawFile(db) out.File = fd out.Enums = fd.allEnums out.Messages = fd.allMessages out.Extensions = fd.allExtensions out.Services = fd.allServices if err := db.FileRegistry.RegisterFile(fd); err != nil { panic(err) } return out } // unmarshalCounts counts the number of enum, message, extension, and service // declarations in the raw message, which is either a FileDescriptorProto // or a MessageDescriptorProto depending on whether isFile is set. func (db *Builder) unmarshalCounts(b []byte, isFile bool) { for len(b) > 0 { num, typ, n := protowire.ConsumeTag(b) b = b[n:] switch typ { case protowire.BytesType: v, m := protowire.ConsumeBytes(b) b = b[m:] if isFile { switch num { case genid.FileDescriptorProto_EnumType_field_number: db.NumEnums++ case genid.FileDescriptorProto_MessageType_field_number: db.unmarshalCounts(v, false) db.NumMessages++ case genid.FileDescriptorProto_Extension_field_number: db.NumExtensions++ case genid.FileDescriptorProto_Service_field_number: db.NumServices++ } } else { switch num { case genid.DescriptorProto_EnumType_field_number: db.NumEnums++ case genid.DescriptorProto_NestedType_field_number: db.unmarshalCounts(v, false) db.NumMessages++ case genid.DescriptorProto_Extension_field_number: db.NumExtensions++ } } default: m := protowire.ConsumeFieldValue(num, typ, b) b = b[m:] } } } ================================================ FILE: vendor/google.golang.org/protobuf/internal/filedesc/desc.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package filedesc import ( "bytes" "fmt" "strings" "sync" "sync/atomic" "google.golang.org/protobuf/internal/descfmt" "google.golang.org/protobuf/internal/descopts" "google.golang.org/protobuf/internal/encoding/defval" "google.golang.org/protobuf/internal/encoding/messageset" "google.golang.org/protobuf/internal/genid" "google.golang.org/protobuf/internal/pragma" "google.golang.org/protobuf/internal/strs" "google.golang.org/protobuf/reflect/protoreflect" ) // Edition is an Enum for proto2.Edition type Edition int32 // These values align with the value of Enum in descriptor.proto which allows // direct conversion between the proto enum and this enum. const ( EditionUnknown Edition = 0 EditionProto2 Edition = 998 EditionProto3 Edition = 999 Edition2023 Edition = 1000 Edition2024 Edition = 1001 EditionUnstable Edition = 9999 EditionUnsupported Edition = 100000 ) // The types in this file may have a suffix: // • L0: Contains fields common to all descriptors (except File) and // must be initialized up front. // • L1: Contains fields specific to a descriptor and // must be initialized up front. If the associated proto uses Editions, the // Editions features must always be resolved. If not explicitly set, the // appropriate default must be resolved and set. // • L2: Contains fields that are lazily initialized when constructing // from the raw file descriptor. When constructing as a literal, the L2 // fields must be initialized up front. // // The types are exported so that packages like reflect/protodesc can // directly construct descriptors. type ( File struct { fileRaw L1 FileL1 once uint32 // atomically set if L2 is valid mu sync.Mutex // protects L2 L2 *FileL2 } FileL1 struct { Syntax protoreflect.Syntax Edition Edition // Only used if Syntax == Editions Path string Package protoreflect.FullName Enums Enums Messages Messages Extensions Extensions Services Services EditionFeatures EditionFeatures } FileL2 struct { Options func() protoreflect.ProtoMessage Imports FileImports OptionImports func() protoreflect.FileImports Locations SourceLocations } // EditionFeatures is a frequently-instantiated struct, so please take care // to minimize padding when adding new fields to this struct (add them in // the right place/order). EditionFeatures struct { // StripEnumPrefix determines if the plugin generates enum value // constants as-is, with their prefix stripped, or both variants. StripEnumPrefix int // IsFieldPresence is true if field_presence is EXPLICIT // https://protobuf.dev/editions/features/#field_presence IsFieldPresence bool // IsFieldPresence is true if field_presence is LEGACY_REQUIRED // https://protobuf.dev/editions/features/#field_presence IsLegacyRequired bool // IsOpenEnum is true if enum_type is OPEN // https://protobuf.dev/editions/features/#enum_type IsOpenEnum bool // IsPacked is true if repeated_field_encoding is PACKED // https://protobuf.dev/editions/features/#repeated_field_encoding IsPacked bool // IsUTF8Validated is true if utf_validation is VERIFY // https://protobuf.dev/editions/features/#utf8_validation IsUTF8Validated bool // IsDelimitedEncoded is true if message_encoding is DELIMITED // https://protobuf.dev/editions/features/#message_encoding IsDelimitedEncoded bool // IsJSONCompliant is true if json_format is ALLOW // https://protobuf.dev/editions/features/#json_format IsJSONCompliant bool // GenerateLegacyUnmarshalJSON determines if the plugin generates the // UnmarshalJSON([]byte) error method for enums. GenerateLegacyUnmarshalJSON bool // APILevel controls which API (Open, Hybrid or Opaque) should be used // for generated code (.pb.go files). APILevel int } ) func (fd *File) ParentFile() protoreflect.FileDescriptor { return fd } func (fd *File) Parent() protoreflect.Descriptor { return nil } func (fd *File) Index() int { return 0 } func (fd *File) Syntax() protoreflect.Syntax { return fd.L1.Syntax } func (fd *File) Name() protoreflect.Name { return fd.L1.Package.Name() } func (fd *File) FullName() protoreflect.FullName { return fd.L1.Package } func (fd *File) IsPlaceholder() bool { return false } func (fd *File) Options() protoreflect.ProtoMessage { if f := fd.lazyInit().Options; f != nil { return f() } return descopts.File } func (fd *File) Path() string { return fd.L1.Path } func (fd *File) Package() protoreflect.FullName { return fd.L1.Package } func (fd *File) Imports() protoreflect.FileImports { return &fd.lazyInit().Imports } func (fd *File) Enums() protoreflect.EnumDescriptors { return &fd.L1.Enums } func (fd *File) Messages() protoreflect.MessageDescriptors { return &fd.L1.Messages } func (fd *File) Extensions() protoreflect.ExtensionDescriptors { return &fd.L1.Extensions } func (fd *File) Services() protoreflect.ServiceDescriptors { return &fd.L1.Services } func (fd *File) SourceLocations() protoreflect.SourceLocations { return &fd.lazyInit().Locations } func (fd *File) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, fd) } func (fd *File) ProtoType(protoreflect.FileDescriptor) {} func (fd *File) ProtoInternal(pragma.DoNotImplement) {} // The next two are not part of the FileDescriptor interface. They are just used to reconstruct // the original FileDescriptor proto. func (fd *File) Edition() int32 { return int32(fd.L1.Edition) } func (fd *File) OptionImports() protoreflect.FileImports { if f := fd.lazyInit().OptionImports; f != nil { return f() } return emptyFiles } func (fd *File) lazyInit() *FileL2 { if atomic.LoadUint32(&fd.once) == 0 { fd.lazyInitOnce() } return fd.L2 } func (fd *File) lazyInitOnce() { fd.mu.Lock() if fd.L2 == nil { fd.lazyRawInit() // recursively initializes all L2 structures } atomic.StoreUint32(&fd.once, 1) fd.mu.Unlock() } // GoPackagePath is a pseudo-internal API for determining the Go package path // that this file descriptor is declared in. // // WARNING: This method is exempt from the compatibility promise and may be // removed in the future without warning. func (fd *File) GoPackagePath() string { return fd.builder.GoPackagePath } type ( Enum struct { Base L1 EnumL1 L2 *EnumL2 // protected by fileDesc.once } EnumL1 struct { EditionFeatures EditionFeatures Visibility int32 eagerValues bool // controls whether EnumL2.Values is already populated } EnumL2 struct { Options func() protoreflect.ProtoMessage Values EnumValues ReservedNames Names ReservedRanges EnumRanges } EnumValue struct { Base L1 EnumValueL1 } EnumValueL1 struct { Options func() protoreflect.ProtoMessage Number protoreflect.EnumNumber } ) func (ed *Enum) Options() protoreflect.ProtoMessage { if f := ed.lazyInit().Options; f != nil { return f() } return descopts.Enum } func (ed *Enum) Values() protoreflect.EnumValueDescriptors { if ed.L1.eagerValues { return &ed.L2.Values } return &ed.lazyInit().Values } func (ed *Enum) ReservedNames() protoreflect.Names { return &ed.lazyInit().ReservedNames } func (ed *Enum) ReservedRanges() protoreflect.EnumRanges { return &ed.lazyInit().ReservedRanges } func (ed *Enum) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, ed) } func (ed *Enum) ProtoType(protoreflect.EnumDescriptor) {} // This is not part of the EnumDescriptor interface. It is just used to reconstruct // the original FileDescriptor proto. func (ed *Enum) Visibility() int32 { return ed.L1.Visibility } func (ed *Enum) lazyInit() *EnumL2 { ed.L0.ParentFile.lazyInit() // implicitly initializes L2 return ed.L2 } func (ed *Enum) IsClosed() bool { return !ed.L1.EditionFeatures.IsOpenEnum } func (ed *EnumValue) Options() protoreflect.ProtoMessage { if f := ed.L1.Options; f != nil { return f() } return descopts.EnumValue } func (ed *EnumValue) Number() protoreflect.EnumNumber { return ed.L1.Number } func (ed *EnumValue) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, ed) } func (ed *EnumValue) ProtoType(protoreflect.EnumValueDescriptor) {} type ( Message struct { Base L1 MessageL1 L2 *MessageL2 // protected by fileDesc.once } MessageL1 struct { Enums Enums Messages Messages Extensions Extensions EditionFeatures EditionFeatures Visibility int32 IsMapEntry bool // promoted from google.protobuf.MessageOptions IsMessageSet bool // promoted from google.protobuf.MessageOptions } MessageL2 struct { Options func() protoreflect.ProtoMessage Fields Fields Oneofs Oneofs ReservedNames Names ReservedRanges FieldRanges RequiredNumbers FieldNumbers // must be consistent with Fields.Cardinality ExtensionRanges FieldRanges ExtensionRangeOptions []func() protoreflect.ProtoMessage // must be same length as ExtensionRanges } Field struct { Base L1 FieldL1 } FieldL1 struct { Options func() protoreflect.ProtoMessage Number protoreflect.FieldNumber Cardinality protoreflect.Cardinality // must be consistent with Message.RequiredNumbers Kind protoreflect.Kind StringName stringName IsProto3Optional bool // promoted from google.protobuf.FieldDescriptorProto IsLazy bool // promoted from google.protobuf.FieldOptions Default defaultValue ContainingOneof protoreflect.OneofDescriptor // must be consistent with Message.Oneofs.Fields Enum protoreflect.EnumDescriptor Message protoreflect.MessageDescriptor EditionFeatures EditionFeatures } Oneof struct { Base L1 OneofL1 } OneofL1 struct { Options func() protoreflect.ProtoMessage Fields OneofFields // must be consistent with Message.Fields.ContainingOneof EditionFeatures EditionFeatures } ) func (md *Message) Options() protoreflect.ProtoMessage { if f := md.lazyInit().Options; f != nil { return f() } return descopts.Message } func (md *Message) IsMapEntry() bool { return md.L1.IsMapEntry } func (md *Message) Fields() protoreflect.FieldDescriptors { return &md.lazyInit().Fields } func (md *Message) Oneofs() protoreflect.OneofDescriptors { return &md.lazyInit().Oneofs } func (md *Message) ReservedNames() protoreflect.Names { return &md.lazyInit().ReservedNames } func (md *Message) ReservedRanges() protoreflect.FieldRanges { return &md.lazyInit().ReservedRanges } func (md *Message) RequiredNumbers() protoreflect.FieldNumbers { return &md.lazyInit().RequiredNumbers } func (md *Message) ExtensionRanges() protoreflect.FieldRanges { return &md.lazyInit().ExtensionRanges } func (md *Message) ExtensionRangeOptions(i int) protoreflect.ProtoMessage { if f := md.lazyInit().ExtensionRangeOptions[i]; f != nil { return f() } return descopts.ExtensionRange } func (md *Message) Enums() protoreflect.EnumDescriptors { return &md.L1.Enums } func (md *Message) Messages() protoreflect.MessageDescriptors { return &md.L1.Messages } func (md *Message) Extensions() protoreflect.ExtensionDescriptors { return &md.L1.Extensions } func (md *Message) ProtoType(protoreflect.MessageDescriptor) {} func (md *Message) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, md) } // This is not part of the MessageDescriptor interface. It is just used to reconstruct // the original FileDescriptor proto. func (md *Message) Visibility() int32 { return md.L1.Visibility } func (md *Message) lazyInit() *MessageL2 { md.L0.ParentFile.lazyInit() // implicitly initializes L2 return md.L2 } // IsMessageSet is a pseudo-internal API for checking whether a message // should serialize in the proto1 message format. // // WARNING: This method is exempt from the compatibility promise and may be // removed in the future without warning. func (md *Message) IsMessageSet() bool { return md.L1.IsMessageSet } func (fd *Field) Options() protoreflect.ProtoMessage { if f := fd.L1.Options; f != nil { return f() } return descopts.Field } func (fd *Field) Number() protoreflect.FieldNumber { return fd.L1.Number } func (fd *Field) Cardinality() protoreflect.Cardinality { return fd.L1.Cardinality } func (fd *Field) Kind() protoreflect.Kind { return fd.L1.Kind } func (fd *Field) HasJSONName() bool { return fd.L1.StringName.hasJSON } func (fd *Field) JSONName() string { return fd.L1.StringName.getJSON(fd) } func (fd *Field) TextName() string { return fd.L1.StringName.getText(fd) } func (fd *Field) HasPresence() bool { if fd.L1.Cardinality == protoreflect.Repeated { return false } return fd.IsExtension() || fd.L1.EditionFeatures.IsFieldPresence || fd.L1.Message != nil || fd.L1.ContainingOneof != nil } func (fd *Field) HasOptionalKeyword() bool { return (fd.L0.ParentFile.L1.Syntax == protoreflect.Proto2 && fd.L1.Cardinality == protoreflect.Optional && fd.L1.ContainingOneof == nil) || fd.L1.IsProto3Optional } func (fd *Field) IsPacked() bool { if fd.L1.Cardinality != protoreflect.Repeated { return false } switch fd.L1.Kind { case protoreflect.StringKind, protoreflect.BytesKind, protoreflect.MessageKind, protoreflect.GroupKind: return false } return fd.L1.EditionFeatures.IsPacked } func (fd *Field) IsExtension() bool { return false } func (fd *Field) IsWeak() bool { return false } func (fd *Field) IsLazy() bool { return fd.L1.IsLazy } func (fd *Field) IsList() bool { return fd.Cardinality() == protoreflect.Repeated && !fd.IsMap() } func (fd *Field) IsMap() bool { return fd.Message() != nil && fd.Message().IsMapEntry() } func (fd *Field) MapKey() protoreflect.FieldDescriptor { if !fd.IsMap() { return nil } return fd.Message().Fields().ByNumber(genid.MapEntry_Key_field_number) } func (fd *Field) MapValue() protoreflect.FieldDescriptor { if !fd.IsMap() { return nil } return fd.Message().Fields().ByNumber(genid.MapEntry_Value_field_number) } func (fd *Field) HasDefault() bool { return fd.L1.Default.has } func (fd *Field) Default() protoreflect.Value { return fd.L1.Default.get(fd) } func (fd *Field) DefaultEnumValue() protoreflect.EnumValueDescriptor { return fd.L1.Default.enum } func (fd *Field) ContainingOneof() protoreflect.OneofDescriptor { return fd.L1.ContainingOneof } func (fd *Field) ContainingMessage() protoreflect.MessageDescriptor { return fd.L0.Parent.(protoreflect.MessageDescriptor) } func (fd *Field) Enum() protoreflect.EnumDescriptor { return fd.L1.Enum } func (fd *Field) Message() protoreflect.MessageDescriptor { return fd.L1.Message } func (fd *Field) IsMapEntry() bool { parent, ok := fd.L0.Parent.(protoreflect.MessageDescriptor) return ok && parent.IsMapEntry() } func (fd *Field) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, fd) } func (fd *Field) ProtoType(protoreflect.FieldDescriptor) {} // EnforceUTF8 is a pseudo-internal API to determine whether to enforce UTF-8 // validation for the string field. This exists for Google-internal use only // since proto3 did not enforce UTF-8 validity prior to the open-source release. // If this method does not exist, the default is to enforce valid UTF-8. // // WARNING: This method is exempt from the compatibility promise and may be // removed in the future without warning. func (fd *Field) EnforceUTF8() bool { return fd.L1.EditionFeatures.IsUTF8Validated } func (od *Oneof) IsSynthetic() bool { return od.L0.ParentFile.L1.Syntax == protoreflect.Proto3 && len(od.L1.Fields.List) == 1 && od.L1.Fields.List[0].HasOptionalKeyword() } func (od *Oneof) Options() protoreflect.ProtoMessage { if f := od.L1.Options; f != nil { return f() } return descopts.Oneof } func (od *Oneof) Fields() protoreflect.FieldDescriptors { return &od.L1.Fields } func (od *Oneof) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, od) } func (od *Oneof) ProtoType(protoreflect.OneofDescriptor) {} type ( Extension struct { Base L1 ExtensionL1 L2 *ExtensionL2 // protected by fileDesc.once } ExtensionL1 struct { Number protoreflect.FieldNumber Extendee protoreflect.MessageDescriptor Cardinality protoreflect.Cardinality Kind protoreflect.Kind IsLazy bool EditionFeatures EditionFeatures } ExtensionL2 struct { Options func() protoreflect.ProtoMessage StringName stringName IsProto3Optional bool // promoted from google.protobuf.FieldDescriptorProto Default defaultValue Enum protoreflect.EnumDescriptor Message protoreflect.MessageDescriptor } ) func (xd *Extension) Options() protoreflect.ProtoMessage { if f := xd.lazyInit().Options; f != nil { return f() } return descopts.Field } func (xd *Extension) Number() protoreflect.FieldNumber { return xd.L1.Number } func (xd *Extension) Cardinality() protoreflect.Cardinality { return xd.L1.Cardinality } func (xd *Extension) Kind() protoreflect.Kind { return xd.L1.Kind } func (xd *Extension) HasJSONName() bool { return xd.lazyInit().StringName.hasJSON } func (xd *Extension) JSONName() string { return xd.lazyInit().StringName.getJSON(xd) } func (xd *Extension) TextName() string { return xd.lazyInit().StringName.getText(xd) } func (xd *Extension) HasPresence() bool { return xd.L1.Cardinality != protoreflect.Repeated } func (xd *Extension) HasOptionalKeyword() bool { return (xd.L0.ParentFile.L1.Syntax == protoreflect.Proto2 && xd.L1.Cardinality == protoreflect.Optional) || xd.lazyInit().IsProto3Optional } func (xd *Extension) IsPacked() bool { if xd.L1.Cardinality != protoreflect.Repeated { return false } switch xd.L1.Kind { case protoreflect.StringKind, protoreflect.BytesKind, protoreflect.MessageKind, protoreflect.GroupKind: return false } return xd.L1.EditionFeatures.IsPacked } func (xd *Extension) IsExtension() bool { return true } func (xd *Extension) IsWeak() bool { return false } func (xd *Extension) IsLazy() bool { return xd.L1.IsLazy } func (xd *Extension) IsList() bool { return xd.Cardinality() == protoreflect.Repeated } func (xd *Extension) IsMap() bool { return false } func (xd *Extension) MapKey() protoreflect.FieldDescriptor { return nil } func (xd *Extension) MapValue() protoreflect.FieldDescriptor { return nil } func (xd *Extension) HasDefault() bool { return xd.lazyInit().Default.has } func (xd *Extension) Default() protoreflect.Value { return xd.lazyInit().Default.get(xd) } func (xd *Extension) DefaultEnumValue() protoreflect.EnumValueDescriptor { return xd.lazyInit().Default.enum } func (xd *Extension) ContainingOneof() protoreflect.OneofDescriptor { return nil } func (xd *Extension) ContainingMessage() protoreflect.MessageDescriptor { return xd.L1.Extendee } func (xd *Extension) Enum() protoreflect.EnumDescriptor { return xd.lazyInit().Enum } func (xd *Extension) Message() protoreflect.MessageDescriptor { return xd.lazyInit().Message } func (xd *Extension) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, xd) } func (xd *Extension) ProtoType(protoreflect.FieldDescriptor) {} func (xd *Extension) ProtoInternal(pragma.DoNotImplement) {} func (xd *Extension) lazyInit() *ExtensionL2 { xd.L0.ParentFile.lazyInit() // implicitly initializes L2 return xd.L2 } type ( Service struct { Base L1 ServiceL1 L2 *ServiceL2 // protected by fileDesc.once } ServiceL1 struct{} ServiceL2 struct { Options func() protoreflect.ProtoMessage Methods Methods } Method struct { Base L1 MethodL1 } MethodL1 struct { Options func() protoreflect.ProtoMessage Input protoreflect.MessageDescriptor Output protoreflect.MessageDescriptor IsStreamingClient bool IsStreamingServer bool } ) func (sd *Service) Options() protoreflect.ProtoMessage { if f := sd.lazyInit().Options; f != nil { return f() } return descopts.Service } func (sd *Service) Methods() protoreflect.MethodDescriptors { return &sd.lazyInit().Methods } func (sd *Service) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, sd) } func (sd *Service) ProtoType(protoreflect.ServiceDescriptor) {} func (sd *Service) ProtoInternal(pragma.DoNotImplement) {} func (sd *Service) lazyInit() *ServiceL2 { sd.L0.ParentFile.lazyInit() // implicitly initializes L2 return sd.L2 } func (md *Method) Options() protoreflect.ProtoMessage { if f := md.L1.Options; f != nil { return f() } return descopts.Method } func (md *Method) Input() protoreflect.MessageDescriptor { return md.L1.Input } func (md *Method) Output() protoreflect.MessageDescriptor { return md.L1.Output } func (md *Method) IsStreamingClient() bool { return md.L1.IsStreamingClient } func (md *Method) IsStreamingServer() bool { return md.L1.IsStreamingServer } func (md *Method) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, md) } func (md *Method) ProtoType(protoreflect.MethodDescriptor) {} func (md *Method) ProtoInternal(pragma.DoNotImplement) {} // Surrogate files are can be used to create standalone descriptors // where the syntax is only information derived from the parent file. var ( SurrogateProto2 = &File{L1: FileL1{Syntax: protoreflect.Proto2}, L2: &FileL2{}} SurrogateProto3 = &File{L1: FileL1{Syntax: protoreflect.Proto3}, L2: &FileL2{}} SurrogateEdition2023 = &File{L1: FileL1{Syntax: protoreflect.Editions, Edition: Edition2023}, L2: &FileL2{}} ) type ( Base struct { L0 BaseL0 } BaseL0 struct { FullName protoreflect.FullName // must be populated ParentFile *File // must be populated Parent protoreflect.Descriptor Index int } ) func (d *Base) Name() protoreflect.Name { return d.L0.FullName.Name() } func (d *Base) FullName() protoreflect.FullName { return d.L0.FullName } func (d *Base) ParentFile() protoreflect.FileDescriptor { if d.L0.ParentFile == SurrogateProto2 || d.L0.ParentFile == SurrogateProto3 { return nil // surrogate files are not real parents } return d.L0.ParentFile } func (d *Base) Parent() protoreflect.Descriptor { return d.L0.Parent } func (d *Base) Index() int { return d.L0.Index } func (d *Base) Syntax() protoreflect.Syntax { return d.L0.ParentFile.Syntax() } func (d *Base) IsPlaceholder() bool { return false } func (d *Base) ProtoInternal(pragma.DoNotImplement) {} type stringName struct { hasJSON bool once sync.Once nameJSON string nameText string } // InitJSON initializes the name. It is exported for use by other internal packages. func (s *stringName) InitJSON(name string) { s.hasJSON = true s.nameJSON = name } // Returns true if this field is structured like the synthetic field of a proto2 // group. This allows us to expand our treatment of delimited fields without // breaking proto2 files that have been upgraded to editions. func isGroupLike(fd protoreflect.FieldDescriptor) bool { // Groups are always group types. if fd.Kind() != protoreflect.GroupKind { return false } // Group fields are always the lowercase type name. if strings.ToLower(string(fd.Message().Name())) != string(fd.Name()) { return false } // Groups could only be defined in the same file they're used. if fd.Message().ParentFile() != fd.ParentFile() { return false } // Group messages are always defined in the same scope as the field. File // level extensions will compare NULL == NULL here, which is why the file // comparison above is necessary to ensure both come from the same file. if fd.IsExtension() { return fd.Parent() == fd.Message().Parent() } return fd.ContainingMessage() == fd.Message().Parent() } func (s *stringName) lazyInit(fd protoreflect.FieldDescriptor) *stringName { s.once.Do(func() { if fd.IsExtension() { // For extensions, JSON and text are formatted the same way. var name string if messageset.IsMessageSetExtension(fd) { name = string("[" + fd.FullName().Parent() + "]") } else { name = string("[" + fd.FullName() + "]") } s.nameJSON = name s.nameText = name } else { // Format the JSON name. if !s.hasJSON { s.nameJSON = strs.JSONCamelCase(string(fd.Name())) } // Format the text name. s.nameText = string(fd.Name()) if isGroupLike(fd) { s.nameText = string(fd.Message().Name()) } } }) return s } func (s *stringName) getJSON(fd protoreflect.FieldDescriptor) string { return s.lazyInit(fd).nameJSON } func (s *stringName) getText(fd protoreflect.FieldDescriptor) string { return s.lazyInit(fd).nameText } func DefaultValue(v protoreflect.Value, ev protoreflect.EnumValueDescriptor) defaultValue { dv := defaultValue{has: v.IsValid(), val: v, enum: ev} if b, ok := v.Interface().([]byte); ok { // Store a copy of the default bytes, so that we can detect // accidental mutations of the original value. dv.bytes = append([]byte(nil), b...) } return dv } func unmarshalDefault(b []byte, k protoreflect.Kind, pf *File, ed protoreflect.EnumDescriptor) defaultValue { var evs protoreflect.EnumValueDescriptors if k == protoreflect.EnumKind { // If the enum is declared within the same file, be careful not to // blindly call the Values method, lest we bind ourselves in a deadlock. if e, ok := ed.(*Enum); ok && e.L0.ParentFile == pf { evs = &e.L2.Values } else { evs = ed.Values() } // If we are unable to resolve the enum dependency, use a placeholder // enum value since we will not be able to parse the default value. if ed.IsPlaceholder() && protoreflect.Name(b).IsValid() { v := protoreflect.ValueOfEnum(0) ev := PlaceholderEnumValue(ed.FullName().Parent().Append(protoreflect.Name(b))) return DefaultValue(v, ev) } } v, ev, err := defval.Unmarshal(string(b), k, evs, defval.Descriptor) if err != nil { panic(err) } return DefaultValue(v, ev) } type defaultValue struct { has bool val protoreflect.Value enum protoreflect.EnumValueDescriptor bytes []byte } func (dv *defaultValue) get(fd protoreflect.FieldDescriptor) protoreflect.Value { // Return the zero value as the default if unpopulated. if !dv.has { if fd.Cardinality() == protoreflect.Repeated { return protoreflect.Value{} } switch fd.Kind() { case protoreflect.BoolKind: return protoreflect.ValueOfBool(false) case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: return protoreflect.ValueOfInt32(0) case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: return protoreflect.ValueOfInt64(0) case protoreflect.Uint32Kind, protoreflect.Fixed32Kind: return protoreflect.ValueOfUint32(0) case protoreflect.Uint64Kind, protoreflect.Fixed64Kind: return protoreflect.ValueOfUint64(0) case protoreflect.FloatKind: return protoreflect.ValueOfFloat32(0) case protoreflect.DoubleKind: return protoreflect.ValueOfFloat64(0) case protoreflect.StringKind: return protoreflect.ValueOfString("") case protoreflect.BytesKind: return protoreflect.ValueOfBytes(nil) case protoreflect.EnumKind: if evs := fd.Enum().Values(); evs.Len() > 0 { return protoreflect.ValueOfEnum(evs.Get(0).Number()) } return protoreflect.ValueOfEnum(0) } } if len(dv.bytes) > 0 && !bytes.Equal(dv.bytes, dv.val.Bytes()) { // TODO: Avoid panic if we're running with the race detector // and instead spawn a goroutine that periodically resets // this value back to the original to induce a race. panic(fmt.Sprintf("detected mutation on the default bytes for %v", fd.FullName())) } return dv.val } ================================================ FILE: vendor/google.golang.org/protobuf/internal/filedesc/desc_init.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package filedesc import ( "fmt" "sync" "google.golang.org/protobuf/encoding/protowire" "google.golang.org/protobuf/internal/genid" "google.golang.org/protobuf/internal/strs" "google.golang.org/protobuf/reflect/protoreflect" ) // fileRaw is a data struct used when initializing a file descriptor from // a raw FileDescriptorProto. type fileRaw struct { builder Builder allEnums []Enum allMessages []Message allExtensions []Extension allServices []Service } func newRawFile(db Builder) *File { fd := &File{fileRaw: fileRaw{builder: db}} fd.initDecls(db.NumEnums, db.NumMessages, db.NumExtensions, db.NumServices) fd.unmarshalSeed(db.RawDescriptor) // Extended message targets are eagerly resolved since registration // needs this information at program init time. for i := range fd.allExtensions { xd := &fd.allExtensions[i] xd.L1.Extendee = fd.resolveMessageDependency(xd.L1.Extendee, listExtTargets, int32(i)) } fd.checkDecls() return fd } // initDecls pre-allocates slices for the exact number of enums, messages // (including map entries), extensions, and services declared in the proto file. // This is done to avoid regrowing the slice, which would change the address // for any previously seen declaration. // // The alloc methods "allocates" slices by pulling from the capacity. func (fd *File) initDecls(numEnums, numMessages, numExtensions, numServices int32) { fd.allEnums = make([]Enum, 0, numEnums) fd.allMessages = make([]Message, 0, numMessages) fd.allExtensions = make([]Extension, 0, numExtensions) fd.allServices = make([]Service, 0, numServices) } func (fd *File) allocEnums(n int) []Enum { total := len(fd.allEnums) es := fd.allEnums[total : total+n] fd.allEnums = fd.allEnums[:total+n] return es } func (fd *File) allocMessages(n int) []Message { total := len(fd.allMessages) ms := fd.allMessages[total : total+n] fd.allMessages = fd.allMessages[:total+n] return ms } func (fd *File) allocExtensions(n int) []Extension { total := len(fd.allExtensions) xs := fd.allExtensions[total : total+n] fd.allExtensions = fd.allExtensions[:total+n] return xs } func (fd *File) allocServices(n int) []Service { total := len(fd.allServices) xs := fd.allServices[total : total+n] fd.allServices = fd.allServices[:total+n] return xs } // checkDecls performs a sanity check that the expected number of expected // declarations matches the number that were found in the descriptor proto. func (fd *File) checkDecls() { switch { case len(fd.allEnums) != cap(fd.allEnums): case len(fd.allMessages) != cap(fd.allMessages): case len(fd.allExtensions) != cap(fd.allExtensions): case len(fd.allServices) != cap(fd.allServices): default: return } panic("mismatching cardinality") } func (fd *File) unmarshalSeed(b []byte) { sb := getBuilder() defer putBuilder(sb) var prevField protoreflect.FieldNumber var numEnums, numMessages, numExtensions, numServices int var posEnums, posMessages, posExtensions, posServices int var options []byte b0 := b for len(b) > 0 { num, typ, n := protowire.ConsumeTag(b) b = b[n:] switch typ { case protowire.BytesType: v, m := protowire.ConsumeBytes(b) b = b[m:] switch num { case genid.FileDescriptorProto_Syntax_field_number: switch string(v) { case "proto2": fd.L1.Syntax = protoreflect.Proto2 fd.L1.Edition = EditionProto2 case "proto3": fd.L1.Syntax = protoreflect.Proto3 fd.L1.Edition = EditionProto3 case "editions": fd.L1.Syntax = protoreflect.Editions default: panic("invalid syntax") } case genid.FileDescriptorProto_Name_field_number: fd.L1.Path = sb.MakeString(v) case genid.FileDescriptorProto_Package_field_number: fd.L1.Package = protoreflect.FullName(sb.MakeString(v)) case genid.FileDescriptorProto_Options_field_number: options = v case genid.FileDescriptorProto_EnumType_field_number: if prevField != genid.FileDescriptorProto_EnumType_field_number { if numEnums > 0 { panic("non-contiguous repeated field") } posEnums = len(b0) - len(b) - n - m } numEnums++ case genid.FileDescriptorProto_MessageType_field_number: if prevField != genid.FileDescriptorProto_MessageType_field_number { if numMessages > 0 { panic("non-contiguous repeated field") } posMessages = len(b0) - len(b) - n - m } numMessages++ case genid.FileDescriptorProto_Extension_field_number: if prevField != genid.FileDescriptorProto_Extension_field_number { if numExtensions > 0 { panic("non-contiguous repeated field") } posExtensions = len(b0) - len(b) - n - m } numExtensions++ case genid.FileDescriptorProto_Service_field_number: if prevField != genid.FileDescriptorProto_Service_field_number { if numServices > 0 { panic("non-contiguous repeated field") } posServices = len(b0) - len(b) - n - m } numServices++ } prevField = num case protowire.VarintType: v, m := protowire.ConsumeVarint(b) b = b[m:] switch num { case genid.FileDescriptorProto_Edition_field_number: fd.L1.Edition = Edition(v) } default: m := protowire.ConsumeFieldValue(num, typ, b) b = b[m:] prevField = -1 // ignore known field numbers of unknown wire type } } // If syntax is missing, it is assumed to be proto2. if fd.L1.Syntax == 0 { fd.L1.Syntax = protoreflect.Proto2 fd.L1.Edition = EditionProto2 } fd.L1.EditionFeatures = getFeaturesFor(fd.L1.Edition) // Parse editions features from options if any if options != nil { fd.unmarshalSeedOptions(options) } // Must allocate all declarations before parsing each descriptor type // to ensure we handled all descriptors in "flattened ordering". if numEnums > 0 { fd.L1.Enums.List = fd.allocEnums(numEnums) } if numMessages > 0 { fd.L1.Messages.List = fd.allocMessages(numMessages) } if numExtensions > 0 { fd.L1.Extensions.List = fd.allocExtensions(numExtensions) } if numServices > 0 { fd.L1.Services.List = fd.allocServices(numServices) } if numEnums > 0 { b := b0[posEnums:] for i := range fd.L1.Enums.List { _, n := protowire.ConsumeVarint(b) v, m := protowire.ConsumeBytes(b[n:]) fd.L1.Enums.List[i].unmarshalSeed(v, sb, fd, fd, i) b = b[n+m:] } } if numMessages > 0 { b := b0[posMessages:] for i := range fd.L1.Messages.List { _, n := protowire.ConsumeVarint(b) v, m := protowire.ConsumeBytes(b[n:]) fd.L1.Messages.List[i].unmarshalSeed(v, sb, fd, fd, i) b = b[n+m:] } } if numExtensions > 0 { b := b0[posExtensions:] for i := range fd.L1.Extensions.List { _, n := protowire.ConsumeVarint(b) v, m := protowire.ConsumeBytes(b[n:]) fd.L1.Extensions.List[i].unmarshalSeed(v, sb, fd, fd, i) b = b[n+m:] } } if numServices > 0 { b := b0[posServices:] for i := range fd.L1.Services.List { _, n := protowire.ConsumeVarint(b) v, m := protowire.ConsumeBytes(b[n:]) fd.L1.Services.List[i].unmarshalSeed(v, sb, fd, fd, i) b = b[n+m:] } } } func (fd *File) unmarshalSeedOptions(b []byte) { for b := b; len(b) > 0; { num, typ, n := protowire.ConsumeTag(b) b = b[n:] switch typ { case protowire.BytesType: v, m := protowire.ConsumeBytes(b) b = b[m:] switch num { case genid.FileOptions_Features_field_number: if fd.Syntax() != protoreflect.Editions { panic(fmt.Sprintf("invalid descriptor: using edition features in a proto with syntax %s", fd.Syntax())) } fd.L1.EditionFeatures = unmarshalFeatureSet(v, fd.L1.EditionFeatures) } default: m := protowire.ConsumeFieldValue(num, typ, b) b = b[m:] } } } func (ed *Enum) unmarshalSeed(b []byte, sb *strs.Builder, pf *File, pd protoreflect.Descriptor, i int) { ed.L0.ParentFile = pf ed.L0.Parent = pd ed.L0.Index = i ed.L1.EditionFeatures = featuresFromParentDesc(ed.Parent()) var numValues int for b := b; len(b) > 0; { num, typ, n := protowire.ConsumeTag(b) b = b[n:] switch typ { case protowire.BytesType: v, m := protowire.ConsumeBytes(b) b = b[m:] switch num { case genid.EnumDescriptorProto_Name_field_number: ed.L0.FullName = appendFullName(sb, pd.FullName(), v) case genid.EnumDescriptorProto_Value_field_number: numValues++ } case protowire.VarintType: v, m := protowire.ConsumeVarint(b) b = b[m:] switch num { case genid.EnumDescriptorProto_Visibility_field_number: ed.L1.Visibility = int32(v) } default: m := protowire.ConsumeFieldValue(num, typ, b) b = b[m:] } } // Only construct enum value descriptors for top-level enums since // they are needed for registration. if pd != pf { return } ed.L1.eagerValues = true ed.L2 = new(EnumL2) ed.L2.Values.List = make([]EnumValue, numValues) for i := 0; len(b) > 0; { num, typ, n := protowire.ConsumeTag(b) b = b[n:] switch typ { case protowire.BytesType: v, m := protowire.ConsumeBytes(b) b = b[m:] switch num { case genid.EnumDescriptorProto_Value_field_number: ed.L2.Values.List[i].unmarshalFull(v, sb, pf, ed, i) i++ } default: m := protowire.ConsumeFieldValue(num, typ, b) b = b[m:] } } } func (md *Message) unmarshalSeed(b []byte, sb *strs.Builder, pf *File, pd protoreflect.Descriptor, i int) { md.L0.ParentFile = pf md.L0.Parent = pd md.L0.Index = i md.L1.EditionFeatures = featuresFromParentDesc(md.Parent()) var prevField protoreflect.FieldNumber var numEnums, numMessages, numExtensions int var posEnums, posMessages, posExtensions int b0 := b for len(b) > 0 { num, typ, n := protowire.ConsumeTag(b) b = b[n:] switch typ { case protowire.BytesType: v, m := protowire.ConsumeBytes(b) b = b[m:] switch num { case genid.DescriptorProto_Name_field_number: md.L0.FullName = appendFullName(sb, pd.FullName(), v) case genid.DescriptorProto_EnumType_field_number: if prevField != genid.DescriptorProto_EnumType_field_number { if numEnums > 0 { panic("non-contiguous repeated field") } posEnums = len(b0) - len(b) - n - m } numEnums++ case genid.DescriptorProto_NestedType_field_number: if prevField != genid.DescriptorProto_NestedType_field_number { if numMessages > 0 { panic("non-contiguous repeated field") } posMessages = len(b0) - len(b) - n - m } numMessages++ case genid.DescriptorProto_Extension_field_number: if prevField != genid.DescriptorProto_Extension_field_number { if numExtensions > 0 { panic("non-contiguous repeated field") } posExtensions = len(b0) - len(b) - n - m } numExtensions++ case genid.DescriptorProto_Options_field_number: md.unmarshalSeedOptions(v) } prevField = num case protowire.VarintType: v, m := protowire.ConsumeVarint(b) b = b[m:] switch num { case genid.DescriptorProto_Visibility_field_number: md.L1.Visibility = int32(v) } default: m := protowire.ConsumeFieldValue(num, typ, b) b = b[m:] prevField = -1 // ignore known field numbers of unknown wire type } } // Must allocate all declarations before parsing each descriptor type // to ensure we handled all descriptors in "flattened ordering". if numEnums > 0 { md.L1.Enums.List = pf.allocEnums(numEnums) } if numMessages > 0 { md.L1.Messages.List = pf.allocMessages(numMessages) } if numExtensions > 0 { md.L1.Extensions.List = pf.allocExtensions(numExtensions) } if numEnums > 0 { b := b0[posEnums:] for i := range md.L1.Enums.List { _, n := protowire.ConsumeVarint(b) v, m := protowire.ConsumeBytes(b[n:]) md.L1.Enums.List[i].unmarshalSeed(v, sb, pf, md, i) b = b[n+m:] } } if numMessages > 0 { b := b0[posMessages:] for i := range md.L1.Messages.List { _, n := protowire.ConsumeVarint(b) v, m := protowire.ConsumeBytes(b[n:]) md.L1.Messages.List[i].unmarshalSeed(v, sb, pf, md, i) b = b[n+m:] } } if numExtensions > 0 { b := b0[posExtensions:] for i := range md.L1.Extensions.List { _, n := protowire.ConsumeVarint(b) v, m := protowire.ConsumeBytes(b[n:]) md.L1.Extensions.List[i].unmarshalSeed(v, sb, pf, md, i) b = b[n+m:] } } } func (md *Message) unmarshalSeedOptions(b []byte) { for len(b) > 0 { num, typ, n := protowire.ConsumeTag(b) b = b[n:] switch typ { case protowire.VarintType: v, m := protowire.ConsumeVarint(b) b = b[m:] switch num { case genid.MessageOptions_MapEntry_field_number: md.L1.IsMapEntry = protowire.DecodeBool(v) case genid.MessageOptions_MessageSetWireFormat_field_number: md.L1.IsMessageSet = protowire.DecodeBool(v) } case protowire.BytesType: v, m := protowire.ConsumeBytes(b) b = b[m:] switch num { case genid.MessageOptions_Features_field_number: md.L1.EditionFeatures = unmarshalFeatureSet(v, md.L1.EditionFeatures) } default: m := protowire.ConsumeFieldValue(num, typ, b) b = b[m:] } } } func (xd *Extension) unmarshalSeed(b []byte, sb *strs.Builder, pf *File, pd protoreflect.Descriptor, i int) { xd.L0.ParentFile = pf xd.L0.Parent = pd xd.L0.Index = i xd.L1.EditionFeatures = featuresFromParentDesc(pd) for len(b) > 0 { num, typ, n := protowire.ConsumeTag(b) b = b[n:] switch typ { case protowire.VarintType: v, m := protowire.ConsumeVarint(b) b = b[m:] switch num { case genid.FieldDescriptorProto_Number_field_number: xd.L1.Number = protoreflect.FieldNumber(v) case genid.FieldDescriptorProto_Label_field_number: xd.L1.Cardinality = protoreflect.Cardinality(v) case genid.FieldDescriptorProto_Type_field_number: xd.L1.Kind = protoreflect.Kind(v) } case protowire.BytesType: v, m := protowire.ConsumeBytes(b) b = b[m:] switch num { case genid.FieldDescriptorProto_Name_field_number: xd.L0.FullName = appendFullName(sb, pd.FullName(), v) case genid.FieldDescriptorProto_Extendee_field_number: xd.L1.Extendee = PlaceholderMessage(makeFullName(sb, v)) case genid.FieldDescriptorProto_Options_field_number: xd.unmarshalOptions(v) } default: m := protowire.ConsumeFieldValue(num, typ, b) b = b[m:] } } if xd.L1.Kind == protoreflect.MessageKind && xd.L1.EditionFeatures.IsDelimitedEncoded { xd.L1.Kind = protoreflect.GroupKind } } func (xd *Extension) unmarshalOptions(b []byte) { for len(b) > 0 { num, typ, n := protowire.ConsumeTag(b) b = b[n:] switch typ { case protowire.VarintType: v, m := protowire.ConsumeVarint(b) b = b[m:] switch num { case genid.FieldOptions_Packed_field_number: xd.L1.EditionFeatures.IsPacked = protowire.DecodeBool(v) case genid.FieldOptions_Lazy_field_number: xd.L1.IsLazy = protowire.DecodeBool(v) } case protowire.BytesType: v, m := protowire.ConsumeBytes(b) b = b[m:] switch num { case genid.FieldOptions_Features_field_number: xd.L1.EditionFeatures = unmarshalFeatureSet(v, xd.L1.EditionFeatures) } default: m := protowire.ConsumeFieldValue(num, typ, b) b = b[m:] } } } func (sd *Service) unmarshalSeed(b []byte, sb *strs.Builder, pf *File, pd protoreflect.Descriptor, i int) { sd.L0.ParentFile = pf sd.L0.Parent = pd sd.L0.Index = i for len(b) > 0 { num, typ, n := protowire.ConsumeTag(b) b = b[n:] switch typ { case protowire.BytesType: v, m := protowire.ConsumeBytes(b) b = b[m:] switch num { case genid.ServiceDescriptorProto_Name_field_number: sd.L0.FullName = appendFullName(sb, pd.FullName(), v) } default: m := protowire.ConsumeFieldValue(num, typ, b) b = b[m:] } } } var nameBuilderPool = sync.Pool{ New: func() any { return new(strs.Builder) }, } func getBuilder() *strs.Builder { return nameBuilderPool.Get().(*strs.Builder) } func putBuilder(b *strs.Builder) { nameBuilderPool.Put(b) } // makeFullName converts b to a protoreflect.FullName, // where b must start with a leading dot. func makeFullName(sb *strs.Builder, b []byte) protoreflect.FullName { if len(b) == 0 || b[0] != '.' { panic("name reference must be fully qualified") } return protoreflect.FullName(sb.MakeString(b[1:])) } func appendFullName(sb *strs.Builder, prefix protoreflect.FullName, suffix []byte) protoreflect.FullName { return sb.AppendFullName(prefix, protoreflect.Name(strs.UnsafeString(suffix))) } ================================================ FILE: vendor/google.golang.org/protobuf/internal/filedesc/desc_lazy.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package filedesc import ( "reflect" "sync" "google.golang.org/protobuf/encoding/protowire" "google.golang.org/protobuf/internal/descopts" "google.golang.org/protobuf/internal/genid" "google.golang.org/protobuf/internal/strs" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" ) func (fd *File) lazyRawInit() { fd.unmarshalFull(fd.builder.RawDescriptor) fd.resolveMessages() fd.resolveExtensions() fd.resolveServices() } func (file *File) resolveMessages() { var depIdx int32 for i := range file.allMessages { md := &file.allMessages[i] // Resolve message field dependencies. for j := range md.L2.Fields.List { fd := &md.L2.Fields.List[j] // Resolve message field dependency. switch fd.L1.Kind { case protoreflect.EnumKind: fd.L1.Enum = file.resolveEnumDependency(fd.L1.Enum, listFieldDeps, depIdx) depIdx++ case protoreflect.MessageKind, protoreflect.GroupKind: fd.L1.Message = file.resolveMessageDependency(fd.L1.Message, listFieldDeps, depIdx) depIdx++ if fd.L1.Kind == protoreflect.GroupKind && (fd.IsMap() || fd.IsMapEntry()) { // A map field might inherit delimited encoding from a file-wide default feature. // But maps never actually use delimited encoding. (At least for now...) fd.L1.Kind = protoreflect.MessageKind } } // Default is resolved here since it depends on Enum being resolved. if v := fd.L1.Default.val; v.IsValid() { fd.L1.Default = unmarshalDefault(v.Bytes(), fd.L1.Kind, file, fd.L1.Enum) } } } } func (file *File) resolveExtensions() { var depIdx int32 for i := range file.allExtensions { xd := &file.allExtensions[i] // Resolve extension field dependency. switch xd.L1.Kind { case protoreflect.EnumKind: xd.L2.Enum = file.resolveEnumDependency(xd.L2.Enum, listExtDeps, depIdx) depIdx++ case protoreflect.MessageKind, protoreflect.GroupKind: xd.L2.Message = file.resolveMessageDependency(xd.L2.Message, listExtDeps, depIdx) depIdx++ } // Default is resolved here since it depends on Enum being resolved. if v := xd.L2.Default.val; v.IsValid() { xd.L2.Default = unmarshalDefault(v.Bytes(), xd.L1.Kind, file, xd.L2.Enum) } } } func (file *File) resolveServices() { var depIdx int32 for i := range file.allServices { sd := &file.allServices[i] // Resolve method dependencies. for j := range sd.L2.Methods.List { md := &sd.L2.Methods.List[j] md.L1.Input = file.resolveMessageDependency(md.L1.Input, listMethInDeps, depIdx) md.L1.Output = file.resolveMessageDependency(md.L1.Output, listMethOutDeps, depIdx) depIdx++ } } } func (file *File) resolveEnumDependency(ed protoreflect.EnumDescriptor, i, j int32) protoreflect.EnumDescriptor { r := file.builder.FileRegistry if r, ok := r.(resolverByIndex); ok { if ed2 := r.FindEnumByIndex(i, j, file.allEnums, file.allMessages); ed2 != nil { return ed2 } } for i := range file.allEnums { if ed2 := &file.allEnums[i]; ed2.L0.FullName == ed.FullName() { return ed2 } } if d, _ := r.FindDescriptorByName(ed.FullName()); d != nil { return d.(protoreflect.EnumDescriptor) } return ed } func (file *File) resolveMessageDependency(md protoreflect.MessageDescriptor, i, j int32) protoreflect.MessageDescriptor { r := file.builder.FileRegistry if r, ok := r.(resolverByIndex); ok { if md2 := r.FindMessageByIndex(i, j, file.allEnums, file.allMessages); md2 != nil { return md2 } } for i := range file.allMessages { if md2 := &file.allMessages[i]; md2.L0.FullName == md.FullName() { return md2 } } if d, _ := r.FindDescriptorByName(md.FullName()); d != nil { return d.(protoreflect.MessageDescriptor) } return md } func (fd *File) unmarshalFull(b []byte) { sb := getBuilder() defer putBuilder(sb) var enumIdx, messageIdx, extensionIdx, serviceIdx int var rawOptions []byte var optionImports []string fd.L2 = new(FileL2) for len(b) > 0 { num, typ, n := protowire.ConsumeTag(b) b = b[n:] switch typ { case protowire.VarintType: v, m := protowire.ConsumeVarint(b) b = b[m:] switch num { case genid.FileDescriptorProto_PublicDependency_field_number: fd.L2.Imports[v].IsPublic = true } case protowire.BytesType: v, m := protowire.ConsumeBytes(b) b = b[m:] switch num { case genid.FileDescriptorProto_Dependency_field_number: path := sb.MakeString(v) imp, _ := fd.builder.FileRegistry.FindFileByPath(path) if imp == nil { imp = PlaceholderFile(path) } fd.L2.Imports = append(fd.L2.Imports, protoreflect.FileImport{FileDescriptor: imp}) case genid.FileDescriptorProto_OptionDependency_field_number: optionImports = append(optionImports, sb.MakeString(v)) case genid.FileDescriptorProto_EnumType_field_number: fd.L1.Enums.List[enumIdx].unmarshalFull(v, sb) enumIdx++ case genid.FileDescriptorProto_MessageType_field_number: fd.L1.Messages.List[messageIdx].unmarshalFull(v, sb) messageIdx++ case genid.FileDescriptorProto_Extension_field_number: fd.L1.Extensions.List[extensionIdx].unmarshalFull(v, sb) extensionIdx++ case genid.FileDescriptorProto_Service_field_number: fd.L1.Services.List[serviceIdx].unmarshalFull(v, sb) serviceIdx++ case genid.FileDescriptorProto_Options_field_number: rawOptions = appendOptions(rawOptions, v) } default: m := protowire.ConsumeFieldValue(num, typ, b) b = b[m:] } } fd.L2.Options = fd.builder.optionsUnmarshaler(&descopts.File, rawOptions) if len(optionImports) > 0 { var imps FileImports var once sync.Once fd.L2.OptionImports = func() protoreflect.FileImports { once.Do(func() { imps = make(FileImports, len(optionImports)) for i, path := range optionImports { imp, _ := fd.builder.FileRegistry.FindFileByPath(path) if imp == nil { imp = PlaceholderFile(path) } imps[i] = protoreflect.FileImport{FileDescriptor: imp} } }) return &imps } } } func (ed *Enum) unmarshalFull(b []byte, sb *strs.Builder) { var rawValues [][]byte var rawOptions []byte if !ed.L1.eagerValues { ed.L2 = new(EnumL2) } for len(b) > 0 { num, typ, n := protowire.ConsumeTag(b) b = b[n:] switch typ { case protowire.BytesType: v, m := protowire.ConsumeBytes(b) b = b[m:] switch num { case genid.EnumDescriptorProto_Value_field_number: rawValues = append(rawValues, v) case genid.EnumDescriptorProto_ReservedName_field_number: ed.L2.ReservedNames.List = append(ed.L2.ReservedNames.List, protoreflect.Name(sb.MakeString(v))) case genid.EnumDescriptorProto_ReservedRange_field_number: ed.L2.ReservedRanges.List = append(ed.L2.ReservedRanges.List, unmarshalEnumReservedRange(v)) case genid.EnumDescriptorProto_Options_field_number: rawOptions = appendOptions(rawOptions, v) } default: m := protowire.ConsumeFieldValue(num, typ, b) b = b[m:] } } if !ed.L1.eagerValues && len(rawValues) > 0 { ed.L2.Values.List = make([]EnumValue, len(rawValues)) for i, b := range rawValues { ed.L2.Values.List[i].unmarshalFull(b, sb, ed.L0.ParentFile, ed, i) } } ed.L2.Options = ed.L0.ParentFile.builder.optionsUnmarshaler(&descopts.Enum, rawOptions) } func unmarshalEnumReservedRange(b []byte) (r [2]protoreflect.EnumNumber) { for len(b) > 0 { num, typ, n := protowire.ConsumeTag(b) b = b[n:] switch typ { case protowire.VarintType: v, m := protowire.ConsumeVarint(b) b = b[m:] switch num { case genid.EnumDescriptorProto_EnumReservedRange_Start_field_number: r[0] = protoreflect.EnumNumber(v) case genid.EnumDescriptorProto_EnumReservedRange_End_field_number: r[1] = protoreflect.EnumNumber(v) } default: m := protowire.ConsumeFieldValue(num, typ, b) b = b[m:] } } return r } func (vd *EnumValue) unmarshalFull(b []byte, sb *strs.Builder, pf *File, pd protoreflect.Descriptor, i int) { vd.L0.ParentFile = pf vd.L0.Parent = pd vd.L0.Index = i var rawOptions []byte for len(b) > 0 { num, typ, n := protowire.ConsumeTag(b) b = b[n:] switch typ { case protowire.VarintType: v, m := protowire.ConsumeVarint(b) b = b[m:] switch num { case genid.EnumValueDescriptorProto_Number_field_number: vd.L1.Number = protoreflect.EnumNumber(v) } case protowire.BytesType: v, m := protowire.ConsumeBytes(b) b = b[m:] switch num { case genid.EnumValueDescriptorProto_Name_field_number: // NOTE: Enum values are in the same scope as the enum parent. vd.L0.FullName = appendFullName(sb, pd.Parent().FullName(), v) case genid.EnumValueDescriptorProto_Options_field_number: rawOptions = appendOptions(rawOptions, v) } default: m := protowire.ConsumeFieldValue(num, typ, b) b = b[m:] } } vd.L1.Options = pf.builder.optionsUnmarshaler(&descopts.EnumValue, rawOptions) } func (md *Message) unmarshalFull(b []byte, sb *strs.Builder) { var rawFields, rawOneofs [][]byte var enumIdx, messageIdx, extensionIdx int var rawOptions []byte md.L2 = new(MessageL2) for len(b) > 0 { num, typ, n := protowire.ConsumeTag(b) b = b[n:] switch typ { case protowire.BytesType: v, m := protowire.ConsumeBytes(b) b = b[m:] switch num { case genid.DescriptorProto_Field_field_number: rawFields = append(rawFields, v) case genid.DescriptorProto_OneofDecl_field_number: rawOneofs = append(rawOneofs, v) case genid.DescriptorProto_ReservedName_field_number: md.L2.ReservedNames.List = append(md.L2.ReservedNames.List, protoreflect.Name(sb.MakeString(v))) case genid.DescriptorProto_ReservedRange_field_number: md.L2.ReservedRanges.List = append(md.L2.ReservedRanges.List, unmarshalMessageReservedRange(v)) case genid.DescriptorProto_ExtensionRange_field_number: r, rawOptions := unmarshalMessageExtensionRange(v) opts := md.L0.ParentFile.builder.optionsUnmarshaler(&descopts.ExtensionRange, rawOptions) md.L2.ExtensionRanges.List = append(md.L2.ExtensionRanges.List, r) md.L2.ExtensionRangeOptions = append(md.L2.ExtensionRangeOptions, opts) case genid.DescriptorProto_EnumType_field_number: md.L1.Enums.List[enumIdx].unmarshalFull(v, sb) enumIdx++ case genid.DescriptorProto_NestedType_field_number: md.L1.Messages.List[messageIdx].unmarshalFull(v, sb) messageIdx++ case genid.DescriptorProto_Extension_field_number: md.L1.Extensions.List[extensionIdx].unmarshalFull(v, sb) extensionIdx++ case genid.DescriptorProto_Options_field_number: rawOptions = appendOptions(rawOptions, v) } default: m := protowire.ConsumeFieldValue(num, typ, b) b = b[m:] } } if len(rawFields) > 0 || len(rawOneofs) > 0 { md.L2.Fields.List = make([]Field, len(rawFields)) md.L2.Oneofs.List = make([]Oneof, len(rawOneofs)) for i, b := range rawFields { fd := &md.L2.Fields.List[i] fd.unmarshalFull(b, sb, md.L0.ParentFile, md, i) if fd.L1.Cardinality == protoreflect.Required { md.L2.RequiredNumbers.List = append(md.L2.RequiredNumbers.List, fd.L1.Number) } } for i, b := range rawOneofs { od := &md.L2.Oneofs.List[i] od.unmarshalFull(b, sb, md.L0.ParentFile, md, i) } } md.L2.Options = md.L0.ParentFile.builder.optionsUnmarshaler(&descopts.Message, rawOptions) } func unmarshalMessageReservedRange(b []byte) (r [2]protoreflect.FieldNumber) { for len(b) > 0 { num, typ, n := protowire.ConsumeTag(b) b = b[n:] switch typ { case protowire.VarintType: v, m := protowire.ConsumeVarint(b) b = b[m:] switch num { case genid.DescriptorProto_ReservedRange_Start_field_number: r[0] = protoreflect.FieldNumber(v) case genid.DescriptorProto_ReservedRange_End_field_number: r[1] = protoreflect.FieldNumber(v) } default: m := protowire.ConsumeFieldValue(num, typ, b) b = b[m:] } } return r } func unmarshalMessageExtensionRange(b []byte) (r [2]protoreflect.FieldNumber, rawOptions []byte) { for len(b) > 0 { num, typ, n := protowire.ConsumeTag(b) b = b[n:] switch typ { case protowire.VarintType: v, m := protowire.ConsumeVarint(b) b = b[m:] switch num { case genid.DescriptorProto_ExtensionRange_Start_field_number: r[0] = protoreflect.FieldNumber(v) case genid.DescriptorProto_ExtensionRange_End_field_number: r[1] = protoreflect.FieldNumber(v) } case protowire.BytesType: v, m := protowire.ConsumeBytes(b) b = b[m:] switch num { case genid.DescriptorProto_ExtensionRange_Options_field_number: rawOptions = appendOptions(rawOptions, v) } default: m := protowire.ConsumeFieldValue(num, typ, b) b = b[m:] } } return r, rawOptions } func (fd *Field) unmarshalFull(b []byte, sb *strs.Builder, pf *File, pd protoreflect.Descriptor, i int) { fd.L0.ParentFile = pf fd.L0.Parent = pd fd.L0.Index = i fd.L1.EditionFeatures = featuresFromParentDesc(fd.Parent()) var rawTypeName []byte var rawOptions []byte for len(b) > 0 { num, typ, n := protowire.ConsumeTag(b) b = b[n:] switch typ { case protowire.VarintType: v, m := protowire.ConsumeVarint(b) b = b[m:] switch num { case genid.FieldDescriptorProto_Number_field_number: fd.L1.Number = protoreflect.FieldNumber(v) case genid.FieldDescriptorProto_Label_field_number: fd.L1.Cardinality = protoreflect.Cardinality(v) case genid.FieldDescriptorProto_Type_field_number: fd.L1.Kind = protoreflect.Kind(v) case genid.FieldDescriptorProto_OneofIndex_field_number: // In Message.unmarshalFull, we allocate slices for both // the field and oneof descriptors before unmarshaling either // of them. This ensures pointers to slice elements are stable. od := &pd.(*Message).L2.Oneofs.List[v] od.L1.Fields.List = append(od.L1.Fields.List, fd) if fd.L1.ContainingOneof != nil { panic("oneof type already set") } fd.L1.ContainingOneof = od case genid.FieldDescriptorProto_Proto3Optional_field_number: fd.L1.IsProto3Optional = protowire.DecodeBool(v) } case protowire.BytesType: v, m := protowire.ConsumeBytes(b) b = b[m:] switch num { case genid.FieldDescriptorProto_Name_field_number: fd.L0.FullName = appendFullName(sb, pd.FullName(), v) case genid.FieldDescriptorProto_JsonName_field_number: fd.L1.StringName.InitJSON(sb.MakeString(v)) case genid.FieldDescriptorProto_DefaultValue_field_number: fd.L1.Default.val = protoreflect.ValueOfBytes(v) // temporarily store as bytes; later resolved in resolveMessages case genid.FieldDescriptorProto_TypeName_field_number: rawTypeName = v case genid.FieldDescriptorProto_Options_field_number: fd.unmarshalOptions(v) rawOptions = appendOptions(rawOptions, v) } default: m := protowire.ConsumeFieldValue(num, typ, b) b = b[m:] } } if fd.L1.Kind == protoreflect.MessageKind && fd.L1.EditionFeatures.IsDelimitedEncoded { fd.L1.Kind = protoreflect.GroupKind } if fd.L1.EditionFeatures.IsLegacyRequired { fd.L1.Cardinality = protoreflect.Required } if rawTypeName != nil { name := makeFullName(sb, rawTypeName) switch fd.L1.Kind { case protoreflect.EnumKind: fd.L1.Enum = PlaceholderEnum(name) case protoreflect.MessageKind, protoreflect.GroupKind: fd.L1.Message = PlaceholderMessage(name) } } fd.L1.Options = pf.builder.optionsUnmarshaler(&descopts.Field, rawOptions) } func (fd *Field) unmarshalOptions(b []byte) { const FieldOptions_EnforceUTF8 = 13 for len(b) > 0 { num, typ, n := protowire.ConsumeTag(b) b = b[n:] switch typ { case protowire.VarintType: v, m := protowire.ConsumeVarint(b) b = b[m:] switch num { case genid.FieldOptions_Packed_field_number: fd.L1.EditionFeatures.IsPacked = protowire.DecodeBool(v) case genid.FieldOptions_Lazy_field_number: fd.L1.IsLazy = protowire.DecodeBool(v) case FieldOptions_EnforceUTF8: fd.L1.EditionFeatures.IsUTF8Validated = protowire.DecodeBool(v) } case protowire.BytesType: v, m := protowire.ConsumeBytes(b) b = b[m:] switch num { case genid.FieldOptions_Features_field_number: fd.L1.EditionFeatures = unmarshalFeatureSet(v, fd.L1.EditionFeatures) } default: m := protowire.ConsumeFieldValue(num, typ, b) b = b[m:] } } } func (od *Oneof) unmarshalFull(b []byte, sb *strs.Builder, pf *File, pd protoreflect.Descriptor, i int) { od.L0.ParentFile = pf od.L0.Parent = pd od.L0.Index = i var rawOptions []byte for len(b) > 0 { num, typ, n := protowire.ConsumeTag(b) b = b[n:] switch typ { case protowire.BytesType: v, m := protowire.ConsumeBytes(b) b = b[m:] switch num { case genid.OneofDescriptorProto_Name_field_number: od.L0.FullName = appendFullName(sb, pd.FullName(), v) case genid.OneofDescriptorProto_Options_field_number: rawOptions = appendOptions(rawOptions, v) } default: m := protowire.ConsumeFieldValue(num, typ, b) b = b[m:] } } od.L1.Options = pf.builder.optionsUnmarshaler(&descopts.Oneof, rawOptions) } func (xd *Extension) unmarshalFull(b []byte, sb *strs.Builder) { var rawTypeName []byte var rawOptions []byte xd.L2 = new(ExtensionL2) for len(b) > 0 { num, typ, n := protowire.ConsumeTag(b) b = b[n:] switch typ { case protowire.VarintType: v, m := protowire.ConsumeVarint(b) b = b[m:] switch num { case genid.FieldDescriptorProto_Proto3Optional_field_number: xd.L2.IsProto3Optional = protowire.DecodeBool(v) } case protowire.BytesType: v, m := protowire.ConsumeBytes(b) b = b[m:] switch num { case genid.FieldDescriptorProto_JsonName_field_number: xd.L2.StringName.InitJSON(sb.MakeString(v)) case genid.FieldDescriptorProto_DefaultValue_field_number: xd.L2.Default.val = protoreflect.ValueOfBytes(v) // temporarily store as bytes; later resolved in resolveExtensions case genid.FieldDescriptorProto_TypeName_field_number: rawTypeName = v case genid.FieldDescriptorProto_Options_field_number: rawOptions = appendOptions(rawOptions, v) } default: m := protowire.ConsumeFieldValue(num, typ, b) b = b[m:] } } if rawTypeName != nil { name := makeFullName(sb, rawTypeName) switch xd.L1.Kind { case protoreflect.EnumKind: xd.L2.Enum = PlaceholderEnum(name) case protoreflect.MessageKind, protoreflect.GroupKind: xd.L2.Message = PlaceholderMessage(name) } } xd.L2.Options = xd.L0.ParentFile.builder.optionsUnmarshaler(&descopts.Field, rawOptions) } func (sd *Service) unmarshalFull(b []byte, sb *strs.Builder) { var rawMethods [][]byte var rawOptions []byte sd.L2 = new(ServiceL2) for len(b) > 0 { num, typ, n := protowire.ConsumeTag(b) b = b[n:] switch typ { case protowire.BytesType: v, m := protowire.ConsumeBytes(b) b = b[m:] switch num { case genid.ServiceDescriptorProto_Method_field_number: rawMethods = append(rawMethods, v) case genid.ServiceDescriptorProto_Options_field_number: rawOptions = appendOptions(rawOptions, v) } default: m := protowire.ConsumeFieldValue(num, typ, b) b = b[m:] } } if len(rawMethods) > 0 { sd.L2.Methods.List = make([]Method, len(rawMethods)) for i, b := range rawMethods { sd.L2.Methods.List[i].unmarshalFull(b, sb, sd.L0.ParentFile, sd, i) } } sd.L2.Options = sd.L0.ParentFile.builder.optionsUnmarshaler(&descopts.Service, rawOptions) } func (md *Method) unmarshalFull(b []byte, sb *strs.Builder, pf *File, pd protoreflect.Descriptor, i int) { md.L0.ParentFile = pf md.L0.Parent = pd md.L0.Index = i var rawOptions []byte for len(b) > 0 { num, typ, n := protowire.ConsumeTag(b) b = b[n:] switch typ { case protowire.VarintType: v, m := protowire.ConsumeVarint(b) b = b[m:] switch num { case genid.MethodDescriptorProto_ClientStreaming_field_number: md.L1.IsStreamingClient = protowire.DecodeBool(v) case genid.MethodDescriptorProto_ServerStreaming_field_number: md.L1.IsStreamingServer = protowire.DecodeBool(v) } case protowire.BytesType: v, m := protowire.ConsumeBytes(b) b = b[m:] switch num { case genid.MethodDescriptorProto_Name_field_number: md.L0.FullName = appendFullName(sb, pd.FullName(), v) case genid.MethodDescriptorProto_InputType_field_number: md.L1.Input = PlaceholderMessage(makeFullName(sb, v)) case genid.MethodDescriptorProto_OutputType_field_number: md.L1.Output = PlaceholderMessage(makeFullName(sb, v)) case genid.MethodDescriptorProto_Options_field_number: rawOptions = appendOptions(rawOptions, v) } default: m := protowire.ConsumeFieldValue(num, typ, b) b = b[m:] } } md.L1.Options = pf.builder.optionsUnmarshaler(&descopts.Method, rawOptions) } // appendOptions appends src to dst, where the returned slice is never nil. // This is necessary to distinguish between empty and unpopulated options. func appendOptions(dst, src []byte) []byte { if dst == nil { dst = []byte{} } return append(dst, src...) } // optionsUnmarshaler constructs a lazy unmarshal function for an options message. // // The type of message to unmarshal to is passed as a pointer since the // vars in descopts may not yet be populated at the time this function is called. func (db *Builder) optionsUnmarshaler(p *protoreflect.ProtoMessage, b []byte) func() protoreflect.ProtoMessage { if b == nil { return nil } var opts protoreflect.ProtoMessage var once sync.Once return func() protoreflect.ProtoMessage { once.Do(func() { if *p == nil { panic("Descriptor.Options called without importing the descriptor package") } opts = reflect.New(reflect.TypeOf(*p).Elem()).Interface().(protoreflect.ProtoMessage) if err := (proto.UnmarshalOptions{ AllowPartial: true, Resolver: db.TypeResolver, }).Unmarshal(b, opts); err != nil { panic(err) } }) return opts } } ================================================ FILE: vendor/google.golang.org/protobuf/internal/filedesc/desc_list.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package filedesc import ( "fmt" "math" "sort" "sync" "google.golang.org/protobuf/internal/genid" "google.golang.org/protobuf/encoding/protowire" "google.golang.org/protobuf/internal/descfmt" "google.golang.org/protobuf/internal/errors" "google.golang.org/protobuf/internal/pragma" "google.golang.org/protobuf/reflect/protoreflect" ) type FileImports []protoreflect.FileImport func (p *FileImports) Len() int { return len(*p) } func (p *FileImports) Get(i int) protoreflect.FileImport { return (*p)[i] } func (p *FileImports) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) } func (p *FileImports) ProtoInternal(pragma.DoNotImplement) {} type Names struct { List []protoreflect.Name once sync.Once has map[protoreflect.Name]int // protected by once } func (p *Names) Len() int { return len(p.List) } func (p *Names) Get(i int) protoreflect.Name { return p.List[i] } func (p *Names) Has(s protoreflect.Name) bool { return p.lazyInit().has[s] > 0 } func (p *Names) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) } func (p *Names) ProtoInternal(pragma.DoNotImplement) {} func (p *Names) lazyInit() *Names { p.once.Do(func() { if len(p.List) > 0 { p.has = make(map[protoreflect.Name]int, len(p.List)) for _, s := range p.List { p.has[s] = p.has[s] + 1 } } }) return p } // CheckValid reports any errors with the set of names with an error message // that completes the sentence: "ranges is invalid because it has ..." func (p *Names) CheckValid() error { for s, n := range p.lazyInit().has { switch { case n > 1: return errors.New("duplicate name: %q", s) case false && !s.IsValid(): // NOTE: The C++ implementation does not validate the identifier. // See https://github.com/protocolbuffers/protobuf/issues/6335. return errors.New("invalid name: %q", s) } } return nil } type EnumRanges struct { List [][2]protoreflect.EnumNumber // start inclusive; end inclusive once sync.Once sorted [][2]protoreflect.EnumNumber // protected by once } func (p *EnumRanges) Len() int { return len(p.List) } func (p *EnumRanges) Get(i int) [2]protoreflect.EnumNumber { return p.List[i] } func (p *EnumRanges) Has(n protoreflect.EnumNumber) bool { for ls := p.lazyInit().sorted; len(ls) > 0; { i := len(ls) / 2 switch r := enumRange(ls[i]); { case n < r.Start(): ls = ls[:i] // search lower case n > r.End(): ls = ls[i+1:] // search upper default: return true } } return false } func (p *EnumRanges) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) } func (p *EnumRanges) ProtoInternal(pragma.DoNotImplement) {} func (p *EnumRanges) lazyInit() *EnumRanges { p.once.Do(func() { p.sorted = append(p.sorted, p.List...) sort.Slice(p.sorted, func(i, j int) bool { return p.sorted[i][0] < p.sorted[j][0] }) }) return p } // CheckValid reports any errors with the set of names with an error message // that completes the sentence: "ranges is invalid because it has ..." func (p *EnumRanges) CheckValid() error { var rp enumRange for i, r := range p.lazyInit().sorted { r := enumRange(r) switch { case !(r.Start() <= r.End()): return errors.New("invalid range: %v", r) case !(rp.End() < r.Start()) && i > 0: return errors.New("overlapping ranges: %v with %v", rp, r) } rp = r } return nil } type enumRange [2]protoreflect.EnumNumber func (r enumRange) Start() protoreflect.EnumNumber { return r[0] } // inclusive func (r enumRange) End() protoreflect.EnumNumber { return r[1] } // inclusive func (r enumRange) String() string { if r.Start() == r.End() { return fmt.Sprintf("%d", r.Start()) } return fmt.Sprintf("%d to %d", r.Start(), r.End()) } type FieldRanges struct { List [][2]protoreflect.FieldNumber // start inclusive; end exclusive once sync.Once sorted [][2]protoreflect.FieldNumber // protected by once } func (p *FieldRanges) Len() int { return len(p.List) } func (p *FieldRanges) Get(i int) [2]protoreflect.FieldNumber { return p.List[i] } func (p *FieldRanges) Has(n protoreflect.FieldNumber) bool { for ls := p.lazyInit().sorted; len(ls) > 0; { i := len(ls) / 2 switch r := fieldRange(ls[i]); { case n < r.Start(): ls = ls[:i] // search lower case n > r.End(): ls = ls[i+1:] // search upper default: return true } } return false } func (p *FieldRanges) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) } func (p *FieldRanges) ProtoInternal(pragma.DoNotImplement) {} func (p *FieldRanges) lazyInit() *FieldRanges { p.once.Do(func() { p.sorted = append(p.sorted, p.List...) sort.Slice(p.sorted, func(i, j int) bool { return p.sorted[i][0] < p.sorted[j][0] }) }) return p } // CheckValid reports any errors with the set of ranges with an error message // that completes the sentence: "ranges is invalid because it has ..." func (p *FieldRanges) CheckValid(isMessageSet bool) error { var rp fieldRange for i, r := range p.lazyInit().sorted { r := fieldRange(r) switch { case !isValidFieldNumber(r.Start(), isMessageSet): return errors.New("invalid field number: %d", r.Start()) case !isValidFieldNumber(r.End(), isMessageSet): return errors.New("invalid field number: %d", r.End()) case !(r.Start() <= r.End()): return errors.New("invalid range: %v", r) case !(rp.End() < r.Start()) && i > 0: return errors.New("overlapping ranges: %v with %v", rp, r) } rp = r } return nil } // isValidFieldNumber reports whether the field number is valid. // Unlike the FieldNumber.IsValid method, it allows ranges that cover the // reserved number range. func isValidFieldNumber(n protoreflect.FieldNumber, isMessageSet bool) bool { return protowire.MinValidNumber <= n && (n <= protowire.MaxValidNumber || isMessageSet) } // CheckOverlap reports an error if p and q overlap. func (p *FieldRanges) CheckOverlap(q *FieldRanges) error { rps := p.lazyInit().sorted rqs := q.lazyInit().sorted for pi, qi := 0, 0; pi < len(rps) && qi < len(rqs); { rp := fieldRange(rps[pi]) rq := fieldRange(rqs[qi]) if !(rp.End() < rq.Start() || rq.End() < rp.Start()) { return errors.New("overlapping ranges: %v with %v", rp, rq) } if rp.Start() < rq.Start() { pi++ } else { qi++ } } return nil } type fieldRange [2]protoreflect.FieldNumber func (r fieldRange) Start() protoreflect.FieldNumber { return r[0] } // inclusive func (r fieldRange) End() protoreflect.FieldNumber { return r[1] - 1 } // inclusive func (r fieldRange) String() string { if r.Start() == r.End() { return fmt.Sprintf("%d", r.Start()) } return fmt.Sprintf("%d to %d", r.Start(), r.End()) } type FieldNumbers struct { List []protoreflect.FieldNumber once sync.Once has map[protoreflect.FieldNumber]struct{} // protected by once } func (p *FieldNumbers) Len() int { return len(p.List) } func (p *FieldNumbers) Get(i int) protoreflect.FieldNumber { return p.List[i] } func (p *FieldNumbers) Has(n protoreflect.FieldNumber) bool { p.once.Do(func() { if len(p.List) > 0 { p.has = make(map[protoreflect.FieldNumber]struct{}, len(p.List)) for _, n := range p.List { p.has[n] = struct{}{} } } }) _, ok := p.has[n] return ok } func (p *FieldNumbers) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) } func (p *FieldNumbers) ProtoInternal(pragma.DoNotImplement) {} type OneofFields struct { List []protoreflect.FieldDescriptor once sync.Once byName map[protoreflect.Name]protoreflect.FieldDescriptor // protected by once byJSON map[string]protoreflect.FieldDescriptor // protected by once byText map[string]protoreflect.FieldDescriptor // protected by once byNum map[protoreflect.FieldNumber]protoreflect.FieldDescriptor // protected by once } func (p *OneofFields) Len() int { return len(p.List) } func (p *OneofFields) Get(i int) protoreflect.FieldDescriptor { return p.List[i] } func (p *OneofFields) ByName(s protoreflect.Name) protoreflect.FieldDescriptor { return p.lazyInit().byName[s] } func (p *OneofFields) ByJSONName(s string) protoreflect.FieldDescriptor { return p.lazyInit().byJSON[s] } func (p *OneofFields) ByTextName(s string) protoreflect.FieldDescriptor { return p.lazyInit().byText[s] } func (p *OneofFields) ByNumber(n protoreflect.FieldNumber) protoreflect.FieldDescriptor { return p.lazyInit().byNum[n] } func (p *OneofFields) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) } func (p *OneofFields) ProtoInternal(pragma.DoNotImplement) {} func (p *OneofFields) lazyInit() *OneofFields { p.once.Do(func() { if len(p.List) > 0 { p.byName = make(map[protoreflect.Name]protoreflect.FieldDescriptor, len(p.List)) p.byJSON = make(map[string]protoreflect.FieldDescriptor, len(p.List)) p.byText = make(map[string]protoreflect.FieldDescriptor, len(p.List)) p.byNum = make(map[protoreflect.FieldNumber]protoreflect.FieldDescriptor, len(p.List)) for _, f := range p.List { // Field names and numbers are guaranteed to be unique. p.byName[f.Name()] = f p.byJSON[f.JSONName()] = f p.byText[f.TextName()] = f p.byNum[f.Number()] = f } } }) return p } type SourceLocations struct { // List is a list of SourceLocations. // The SourceLocation.Next field does not need to be populated // as it will be lazily populated upon first need. List []protoreflect.SourceLocation // File is the parent file descriptor that these locations are relative to. // If non-nil, ByDescriptor verifies that the provided descriptor // is a child of this file descriptor. File protoreflect.FileDescriptor once sync.Once byPath map[pathKey]int } func (p *SourceLocations) Len() int { return len(p.List) } func (p *SourceLocations) Get(i int) protoreflect.SourceLocation { return p.lazyInit().List[i] } func (p *SourceLocations) byKey(k pathKey) protoreflect.SourceLocation { if i, ok := p.lazyInit().byPath[k]; ok { return p.List[i] } return protoreflect.SourceLocation{} } func (p *SourceLocations) ByPath(path protoreflect.SourcePath) protoreflect.SourceLocation { return p.byKey(newPathKey(path)) } func (p *SourceLocations) ByDescriptor(desc protoreflect.Descriptor) protoreflect.SourceLocation { if p.File != nil && desc != nil && p.File != desc.ParentFile() { return protoreflect.SourceLocation{} // mismatching parent files } var pathArr [16]int32 path := pathArr[:0] for { switch desc.(type) { case protoreflect.FileDescriptor: // Reverse the path since it was constructed in reverse. for i, j := 0, len(path)-1; i < j; i, j = i+1, j-1 { path[i], path[j] = path[j], path[i] } return p.byKey(newPathKey(path)) case protoreflect.MessageDescriptor: path = append(path, int32(desc.Index())) desc = desc.Parent() switch desc.(type) { case protoreflect.FileDescriptor: path = append(path, int32(genid.FileDescriptorProto_MessageType_field_number)) case protoreflect.MessageDescriptor: path = append(path, int32(genid.DescriptorProto_NestedType_field_number)) default: return protoreflect.SourceLocation{} } case protoreflect.FieldDescriptor: isExtension := desc.(protoreflect.FieldDescriptor).IsExtension() path = append(path, int32(desc.Index())) desc = desc.Parent() if isExtension { switch desc.(type) { case protoreflect.FileDescriptor: path = append(path, int32(genid.FileDescriptorProto_Extension_field_number)) case protoreflect.MessageDescriptor: path = append(path, int32(genid.DescriptorProto_Extension_field_number)) default: return protoreflect.SourceLocation{} } } else { switch desc.(type) { case protoreflect.MessageDescriptor: path = append(path, int32(genid.DescriptorProto_Field_field_number)) default: return protoreflect.SourceLocation{} } } case protoreflect.OneofDescriptor: path = append(path, int32(desc.Index())) desc = desc.Parent() switch desc.(type) { case protoreflect.MessageDescriptor: path = append(path, int32(genid.DescriptorProto_OneofDecl_field_number)) default: return protoreflect.SourceLocation{} } case protoreflect.EnumDescriptor: path = append(path, int32(desc.Index())) desc = desc.Parent() switch desc.(type) { case protoreflect.FileDescriptor: path = append(path, int32(genid.FileDescriptorProto_EnumType_field_number)) case protoreflect.MessageDescriptor: path = append(path, int32(genid.DescriptorProto_EnumType_field_number)) default: return protoreflect.SourceLocation{} } case protoreflect.EnumValueDescriptor: path = append(path, int32(desc.Index())) desc = desc.Parent() switch desc.(type) { case protoreflect.EnumDescriptor: path = append(path, int32(genid.EnumDescriptorProto_Value_field_number)) default: return protoreflect.SourceLocation{} } case protoreflect.ServiceDescriptor: path = append(path, int32(desc.Index())) desc = desc.Parent() switch desc.(type) { case protoreflect.FileDescriptor: path = append(path, int32(genid.FileDescriptorProto_Service_field_number)) default: return protoreflect.SourceLocation{} } case protoreflect.MethodDescriptor: path = append(path, int32(desc.Index())) desc = desc.Parent() switch desc.(type) { case protoreflect.ServiceDescriptor: path = append(path, int32(genid.ServiceDescriptorProto_Method_field_number)) default: return protoreflect.SourceLocation{} } default: return protoreflect.SourceLocation{} } } } func (p *SourceLocations) lazyInit() *SourceLocations { p.once.Do(func() { if len(p.List) > 0 { // Collect all the indexes for a given path. pathIdxs := make(map[pathKey][]int, len(p.List)) for i, l := range p.List { k := newPathKey(l.Path) pathIdxs[k] = append(pathIdxs[k], i) } // Update the next index for all locations. p.byPath = make(map[pathKey]int, len(p.List)) for k, idxs := range pathIdxs { for i := 0; i < len(idxs)-1; i++ { p.List[idxs[i]].Next = idxs[i+1] } p.List[idxs[len(idxs)-1]].Next = 0 p.byPath[k] = idxs[0] // record the first location for this path } } }) return p } func (p *SourceLocations) ProtoInternal(pragma.DoNotImplement) {} // pathKey is a comparable representation of protoreflect.SourcePath. type pathKey struct { arr [16]uint8 // first n-1 path segments; last element is the length str string // used if the path does not fit in arr } func newPathKey(p protoreflect.SourcePath) (k pathKey) { if len(p) < len(k.arr) { for i, ps := range p { if ps < 0 || math.MaxUint8 <= ps { return pathKey{str: p.String()} } k.arr[i] = uint8(ps) } k.arr[len(k.arr)-1] = uint8(len(p)) return k } return pathKey{str: p.String()} } ================================================ FILE: vendor/google.golang.org/protobuf/internal/filedesc/desc_list_gen.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Code generated by generate-types. DO NOT EDIT. package filedesc import ( "fmt" "strings" "sync" "google.golang.org/protobuf/internal/descfmt" "google.golang.org/protobuf/internal/pragma" "google.golang.org/protobuf/reflect/protoreflect" ) type Enums struct { List []Enum once sync.Once byName map[protoreflect.Name]*Enum // protected by once } func (p *Enums) Len() int { return len(p.List) } func (p *Enums) Get(i int) protoreflect.EnumDescriptor { return &p.List[i] } func (p *Enums) ByName(s protoreflect.Name) protoreflect.EnumDescriptor { if d := p.lazyInit().byName[s]; d != nil { return d } return nil } func (p *Enums) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) } func (p *Enums) ProtoInternal(pragma.DoNotImplement) {} func (p *Enums) lazyInit() *Enums { p.once.Do(func() { if len(p.List) > 0 { p.byName = make(map[protoreflect.Name]*Enum, len(p.List)) for i := range p.List { d := &p.List[i] if _, ok := p.byName[d.Name()]; !ok { p.byName[d.Name()] = d } } } }) return p } type EnumValues struct { List []EnumValue once sync.Once byName map[protoreflect.Name]*EnumValue // protected by once byNum map[protoreflect.EnumNumber]*EnumValue // protected by once } func (p *EnumValues) Len() int { return len(p.List) } func (p *EnumValues) Get(i int) protoreflect.EnumValueDescriptor { return &p.List[i] } func (p *EnumValues) ByName(s protoreflect.Name) protoreflect.EnumValueDescriptor { if d := p.lazyInit().byName[s]; d != nil { return d } return nil } func (p *EnumValues) ByNumber(n protoreflect.EnumNumber) protoreflect.EnumValueDescriptor { if d := p.lazyInit().byNum[n]; d != nil { return d } return nil } func (p *EnumValues) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) } func (p *EnumValues) ProtoInternal(pragma.DoNotImplement) {} func (p *EnumValues) lazyInit() *EnumValues { p.once.Do(func() { if len(p.List) > 0 { p.byName = make(map[protoreflect.Name]*EnumValue, len(p.List)) p.byNum = make(map[protoreflect.EnumNumber]*EnumValue, len(p.List)) for i := range p.List { d := &p.List[i] if _, ok := p.byName[d.Name()]; !ok { p.byName[d.Name()] = d } if _, ok := p.byNum[d.Number()]; !ok { p.byNum[d.Number()] = d } } } }) return p } type Messages struct { List []Message once sync.Once byName map[protoreflect.Name]*Message // protected by once } func (p *Messages) Len() int { return len(p.List) } func (p *Messages) Get(i int) protoreflect.MessageDescriptor { return &p.List[i] } func (p *Messages) ByName(s protoreflect.Name) protoreflect.MessageDescriptor { if d := p.lazyInit().byName[s]; d != nil { return d } return nil } func (p *Messages) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) } func (p *Messages) ProtoInternal(pragma.DoNotImplement) {} func (p *Messages) lazyInit() *Messages { p.once.Do(func() { if len(p.List) > 0 { p.byName = make(map[protoreflect.Name]*Message, len(p.List)) for i := range p.List { d := &p.List[i] if _, ok := p.byName[d.Name()]; !ok { p.byName[d.Name()] = d } } } }) return p } type Fields struct { List []Field once sync.Once byName map[protoreflect.Name]*Field // protected by once byJSON map[string]*Field // protected by once byText map[string]*Field // protected by once byNum map[protoreflect.FieldNumber]*Field // protected by once } func (p *Fields) Len() int { return len(p.List) } func (p *Fields) Get(i int) protoreflect.FieldDescriptor { return &p.List[i] } func (p *Fields) ByName(s protoreflect.Name) protoreflect.FieldDescriptor { if d := p.lazyInit().byName[s]; d != nil { return d } return nil } func (p *Fields) ByJSONName(s string) protoreflect.FieldDescriptor { if d := p.lazyInit().byJSON[s]; d != nil { return d } return nil } func (p *Fields) ByTextName(s string) protoreflect.FieldDescriptor { if d := p.lazyInit().byText[s]; d != nil { return d } return nil } func (p *Fields) ByNumber(n protoreflect.FieldNumber) protoreflect.FieldDescriptor { if d := p.lazyInit().byNum[n]; d != nil { return d } return nil } func (p *Fields) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) } func (p *Fields) ProtoInternal(pragma.DoNotImplement) {} func (p *Fields) lazyInit() *Fields { p.once.Do(func() { if len(p.List) > 0 { p.byName = make(map[protoreflect.Name]*Field, len(p.List)) p.byJSON = make(map[string]*Field, len(p.List)) p.byText = make(map[string]*Field, len(p.List)) p.byNum = make(map[protoreflect.FieldNumber]*Field, len(p.List)) for i := range p.List { d := &p.List[i] if _, ok := p.byName[d.Name()]; !ok { p.byName[d.Name()] = d } if _, ok := p.byJSON[d.JSONName()]; !ok { p.byJSON[d.JSONName()] = d } if _, ok := p.byText[d.TextName()]; !ok { p.byText[d.TextName()] = d } if isGroupLike(d) { lowerJSONName := strings.ToLower(d.JSONName()) if _, ok := p.byJSON[lowerJSONName]; !ok { p.byJSON[lowerJSONName] = d } lowerTextName := strings.ToLower(d.TextName()) if _, ok := p.byText[lowerTextName]; !ok { p.byText[lowerTextName] = d } } if _, ok := p.byNum[d.Number()]; !ok { p.byNum[d.Number()] = d } } } }) return p } type Oneofs struct { List []Oneof once sync.Once byName map[protoreflect.Name]*Oneof // protected by once } func (p *Oneofs) Len() int { return len(p.List) } func (p *Oneofs) Get(i int) protoreflect.OneofDescriptor { return &p.List[i] } func (p *Oneofs) ByName(s protoreflect.Name) protoreflect.OneofDescriptor { if d := p.lazyInit().byName[s]; d != nil { return d } return nil } func (p *Oneofs) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) } func (p *Oneofs) ProtoInternal(pragma.DoNotImplement) {} func (p *Oneofs) lazyInit() *Oneofs { p.once.Do(func() { if len(p.List) > 0 { p.byName = make(map[protoreflect.Name]*Oneof, len(p.List)) for i := range p.List { d := &p.List[i] if _, ok := p.byName[d.Name()]; !ok { p.byName[d.Name()] = d } } } }) return p } type Extensions struct { List []Extension once sync.Once byName map[protoreflect.Name]*Extension // protected by once } func (p *Extensions) Len() int { return len(p.List) } func (p *Extensions) Get(i int) protoreflect.ExtensionDescriptor { return &p.List[i] } func (p *Extensions) ByName(s protoreflect.Name) protoreflect.ExtensionDescriptor { if d := p.lazyInit().byName[s]; d != nil { return d } return nil } func (p *Extensions) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) } func (p *Extensions) ProtoInternal(pragma.DoNotImplement) {} func (p *Extensions) lazyInit() *Extensions { p.once.Do(func() { if len(p.List) > 0 { p.byName = make(map[protoreflect.Name]*Extension, len(p.List)) for i := range p.List { d := &p.List[i] if _, ok := p.byName[d.Name()]; !ok { p.byName[d.Name()] = d } } } }) return p } type Services struct { List []Service once sync.Once byName map[protoreflect.Name]*Service // protected by once } func (p *Services) Len() int { return len(p.List) } func (p *Services) Get(i int) protoreflect.ServiceDescriptor { return &p.List[i] } func (p *Services) ByName(s protoreflect.Name) protoreflect.ServiceDescriptor { if d := p.lazyInit().byName[s]; d != nil { return d } return nil } func (p *Services) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) } func (p *Services) ProtoInternal(pragma.DoNotImplement) {} func (p *Services) lazyInit() *Services { p.once.Do(func() { if len(p.List) > 0 { p.byName = make(map[protoreflect.Name]*Service, len(p.List)) for i := range p.List { d := &p.List[i] if _, ok := p.byName[d.Name()]; !ok { p.byName[d.Name()] = d } } } }) return p } type Methods struct { List []Method once sync.Once byName map[protoreflect.Name]*Method // protected by once } func (p *Methods) Len() int { return len(p.List) } func (p *Methods) Get(i int) protoreflect.MethodDescriptor { return &p.List[i] } func (p *Methods) ByName(s protoreflect.Name) protoreflect.MethodDescriptor { if d := p.lazyInit().byName[s]; d != nil { return d } return nil } func (p *Methods) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) } func (p *Methods) ProtoInternal(pragma.DoNotImplement) {} func (p *Methods) lazyInit() *Methods { p.once.Do(func() { if len(p.List) > 0 { p.byName = make(map[protoreflect.Name]*Method, len(p.List)) for i := range p.List { d := &p.List[i] if _, ok := p.byName[d.Name()]; !ok { p.byName[d.Name()] = d } } } }) return p } ================================================ FILE: vendor/google.golang.org/protobuf/internal/filedesc/editions.go ================================================ // Copyright 2024 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package filedesc import ( "fmt" "google.golang.org/protobuf/encoding/protowire" "google.golang.org/protobuf/internal/editiondefaults" "google.golang.org/protobuf/internal/genid" "google.golang.org/protobuf/reflect/protoreflect" ) var ( defaultsCache = make(map[Edition]EditionFeatures) defaultsKeys = []Edition{} ) func init() { unmarshalEditionDefaults(editiondefaults.Defaults) SurrogateProto2.L1.EditionFeatures = getFeaturesFor(EditionProto2) SurrogateProto3.L1.EditionFeatures = getFeaturesFor(EditionProto3) SurrogateEdition2023.L1.EditionFeatures = getFeaturesFor(Edition2023) } func unmarshalGoFeature(b []byte, parent EditionFeatures) EditionFeatures { for len(b) > 0 { num, _, n := protowire.ConsumeTag(b) b = b[n:] switch num { case genid.GoFeatures_LegacyUnmarshalJsonEnum_field_number: v, m := protowire.ConsumeVarint(b) b = b[m:] parent.GenerateLegacyUnmarshalJSON = protowire.DecodeBool(v) case genid.GoFeatures_ApiLevel_field_number: v, m := protowire.ConsumeVarint(b) b = b[m:] parent.APILevel = int(v) case genid.GoFeatures_StripEnumPrefix_field_number: v, m := protowire.ConsumeVarint(b) b = b[m:] parent.StripEnumPrefix = int(v) default: panic(fmt.Sprintf("unknown field number %d while unmarshalling GoFeatures", num)) } } return parent } func unmarshalFeatureSet(b []byte, parent EditionFeatures) EditionFeatures { for len(b) > 0 { num, typ, n := protowire.ConsumeTag(b) b = b[n:] switch typ { case protowire.VarintType: v, m := protowire.ConsumeVarint(b) b = b[m:] switch num { case genid.FeatureSet_FieldPresence_field_number: parent.IsFieldPresence = v == genid.FeatureSet_EXPLICIT_enum_value || v == genid.FeatureSet_LEGACY_REQUIRED_enum_value parent.IsLegacyRequired = v == genid.FeatureSet_LEGACY_REQUIRED_enum_value case genid.FeatureSet_EnumType_field_number: parent.IsOpenEnum = v == genid.FeatureSet_OPEN_enum_value case genid.FeatureSet_RepeatedFieldEncoding_field_number: parent.IsPacked = v == genid.FeatureSet_PACKED_enum_value case genid.FeatureSet_Utf8Validation_field_number: parent.IsUTF8Validated = v == genid.FeatureSet_VERIFY_enum_value case genid.FeatureSet_MessageEncoding_field_number: parent.IsDelimitedEncoded = v == genid.FeatureSet_DELIMITED_enum_value case genid.FeatureSet_JsonFormat_field_number: parent.IsJSONCompliant = v == genid.FeatureSet_ALLOW_enum_value case genid.FeatureSet_EnforceNamingStyle_field_number: // EnforceNamingStyle is enforced in protoc, languages other than C++ // are not supposed to do anything with this feature. case genid.FeatureSet_DefaultSymbolVisibility_field_number: // DefaultSymbolVisibility is enforced in protoc, runtimes should not // inspect this value. default: panic(fmt.Sprintf("unknown field number %d while unmarshalling FeatureSet", num)) } case protowire.BytesType: v, m := protowire.ConsumeBytes(b) b = b[m:] switch num { case genid.FeatureSet_Go_ext_number: parent = unmarshalGoFeature(v, parent) } } } return parent } func featuresFromParentDesc(parentDesc protoreflect.Descriptor) EditionFeatures { var parentFS EditionFeatures switch p := parentDesc.(type) { case *File: parentFS = p.L1.EditionFeatures case *Message: parentFS = p.L1.EditionFeatures default: panic(fmt.Sprintf("unknown parent type %T", parentDesc)) } return parentFS } func unmarshalEditionDefault(b []byte) { var ed Edition var fs EditionFeatures for len(b) > 0 { num, typ, n := protowire.ConsumeTag(b) b = b[n:] switch typ { case protowire.VarintType: v, m := protowire.ConsumeVarint(b) b = b[m:] switch num { case genid.FeatureSetDefaults_FeatureSetEditionDefault_Edition_field_number: ed = Edition(v) } case protowire.BytesType: v, m := protowire.ConsumeBytes(b) b = b[m:] switch num { case genid.FeatureSetDefaults_FeatureSetEditionDefault_FixedFeatures_field_number: fs = unmarshalFeatureSet(v, fs) case genid.FeatureSetDefaults_FeatureSetEditionDefault_OverridableFeatures_field_number: fs = unmarshalFeatureSet(v, fs) } } } defaultsCache[ed] = fs defaultsKeys = append(defaultsKeys, ed) } func unmarshalEditionDefaults(b []byte) { for len(b) > 0 { num, _, n := protowire.ConsumeTag(b) b = b[n:] switch num { case genid.FeatureSetDefaults_Defaults_field_number: def, m := protowire.ConsumeBytes(b) b = b[m:] unmarshalEditionDefault(def) case genid.FeatureSetDefaults_MinimumEdition_field_number, genid.FeatureSetDefaults_MaximumEdition_field_number: // We don't care about the minimum and maximum editions. If the // edition we are looking for later on is not in the cache we know // it is outside of the range between minimum and maximum edition. _, m := protowire.ConsumeVarint(b) b = b[m:] default: panic(fmt.Sprintf("unknown field number %d while unmarshalling EditionDefault", num)) } } } func getFeaturesFor(ed Edition) EditionFeatures { match := EditionUnknown for _, key := range defaultsKeys { if key > ed { break } match = key } if match == EditionUnknown { panic(fmt.Sprintf("unsupported edition: %v", ed)) } return defaultsCache[match] } ================================================ FILE: vendor/google.golang.org/protobuf/internal/filedesc/placeholder.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package filedesc import ( "google.golang.org/protobuf/internal/descopts" "google.golang.org/protobuf/internal/pragma" "google.golang.org/protobuf/reflect/protoreflect" ) var ( emptyNames = new(Names) emptyEnumRanges = new(EnumRanges) emptyFieldRanges = new(FieldRanges) emptyFieldNumbers = new(FieldNumbers) emptySourceLocations = new(SourceLocations) emptyFiles = new(FileImports) emptyMessages = new(Messages) emptyFields = new(Fields) emptyOneofs = new(Oneofs) emptyEnums = new(Enums) emptyEnumValues = new(EnumValues) emptyExtensions = new(Extensions) emptyServices = new(Services) ) // PlaceholderFile is a placeholder, representing only the file path. type PlaceholderFile string func (f PlaceholderFile) ParentFile() protoreflect.FileDescriptor { return f } func (f PlaceholderFile) Parent() protoreflect.Descriptor { return nil } func (f PlaceholderFile) Index() int { return 0 } func (f PlaceholderFile) Syntax() protoreflect.Syntax { return 0 } func (f PlaceholderFile) Name() protoreflect.Name { return "" } func (f PlaceholderFile) FullName() protoreflect.FullName { return "" } func (f PlaceholderFile) IsPlaceholder() bool { return true } func (f PlaceholderFile) Options() protoreflect.ProtoMessage { return descopts.File } func (f PlaceholderFile) Path() string { return string(f) } func (f PlaceholderFile) Package() protoreflect.FullName { return "" } func (f PlaceholderFile) Imports() protoreflect.FileImports { return emptyFiles } func (f PlaceholderFile) Messages() protoreflect.MessageDescriptors { return emptyMessages } func (f PlaceholderFile) Enums() protoreflect.EnumDescriptors { return emptyEnums } func (f PlaceholderFile) Extensions() protoreflect.ExtensionDescriptors { return emptyExtensions } func (f PlaceholderFile) Services() protoreflect.ServiceDescriptors { return emptyServices } func (f PlaceholderFile) SourceLocations() protoreflect.SourceLocations { return emptySourceLocations } func (f PlaceholderFile) ProtoType(protoreflect.FileDescriptor) { return } func (f PlaceholderFile) ProtoInternal(pragma.DoNotImplement) { return } // PlaceholderEnum is a placeholder, representing only the full name. type PlaceholderEnum protoreflect.FullName func (e PlaceholderEnum) ParentFile() protoreflect.FileDescriptor { return nil } func (e PlaceholderEnum) Parent() protoreflect.Descriptor { return nil } func (e PlaceholderEnum) Index() int { return 0 } func (e PlaceholderEnum) Syntax() protoreflect.Syntax { return 0 } func (e PlaceholderEnum) Name() protoreflect.Name { return protoreflect.FullName(e).Name() } func (e PlaceholderEnum) FullName() protoreflect.FullName { return protoreflect.FullName(e) } func (e PlaceholderEnum) IsPlaceholder() bool { return true } func (e PlaceholderEnum) Options() protoreflect.ProtoMessage { return descopts.Enum } func (e PlaceholderEnum) Values() protoreflect.EnumValueDescriptors { return emptyEnumValues } func (e PlaceholderEnum) ReservedNames() protoreflect.Names { return emptyNames } func (e PlaceholderEnum) ReservedRanges() protoreflect.EnumRanges { return emptyEnumRanges } func (e PlaceholderEnum) IsClosed() bool { return false } func (e PlaceholderEnum) ProtoType(protoreflect.EnumDescriptor) { return } func (e PlaceholderEnum) ProtoInternal(pragma.DoNotImplement) { return } // PlaceholderEnumValue is a placeholder, representing only the full name. type PlaceholderEnumValue protoreflect.FullName func (e PlaceholderEnumValue) ParentFile() protoreflect.FileDescriptor { return nil } func (e PlaceholderEnumValue) Parent() protoreflect.Descriptor { return nil } func (e PlaceholderEnumValue) Index() int { return 0 } func (e PlaceholderEnumValue) Syntax() protoreflect.Syntax { return 0 } func (e PlaceholderEnumValue) Name() protoreflect.Name { return protoreflect.FullName(e).Name() } func (e PlaceholderEnumValue) FullName() protoreflect.FullName { return protoreflect.FullName(e) } func (e PlaceholderEnumValue) IsPlaceholder() bool { return true } func (e PlaceholderEnumValue) Options() protoreflect.ProtoMessage { return descopts.EnumValue } func (e PlaceholderEnumValue) Number() protoreflect.EnumNumber { return 0 } func (e PlaceholderEnumValue) ProtoType(protoreflect.EnumValueDescriptor) { return } func (e PlaceholderEnumValue) ProtoInternal(pragma.DoNotImplement) { return } // PlaceholderMessage is a placeholder, representing only the full name. type PlaceholderMessage protoreflect.FullName func (m PlaceholderMessage) ParentFile() protoreflect.FileDescriptor { return nil } func (m PlaceholderMessage) Parent() protoreflect.Descriptor { return nil } func (m PlaceholderMessage) Index() int { return 0 } func (m PlaceholderMessage) Syntax() protoreflect.Syntax { return 0 } func (m PlaceholderMessage) Name() protoreflect.Name { return protoreflect.FullName(m).Name() } func (m PlaceholderMessage) FullName() protoreflect.FullName { return protoreflect.FullName(m) } func (m PlaceholderMessage) IsPlaceholder() bool { return true } func (m PlaceholderMessage) Options() protoreflect.ProtoMessage { return descopts.Message } func (m PlaceholderMessage) IsMapEntry() bool { return false } func (m PlaceholderMessage) Fields() protoreflect.FieldDescriptors { return emptyFields } func (m PlaceholderMessage) Oneofs() protoreflect.OneofDescriptors { return emptyOneofs } func (m PlaceholderMessage) ReservedNames() protoreflect.Names { return emptyNames } func (m PlaceholderMessage) ReservedRanges() protoreflect.FieldRanges { return emptyFieldRanges } func (m PlaceholderMessage) RequiredNumbers() protoreflect.FieldNumbers { return emptyFieldNumbers } func (m PlaceholderMessage) ExtensionRanges() protoreflect.FieldRanges { return emptyFieldRanges } func (m PlaceholderMessage) ExtensionRangeOptions(int) protoreflect.ProtoMessage { panic("index out of range") } func (m PlaceholderMessage) Messages() protoreflect.MessageDescriptors { return emptyMessages } func (m PlaceholderMessage) Enums() protoreflect.EnumDescriptors { return emptyEnums } func (m PlaceholderMessage) Extensions() protoreflect.ExtensionDescriptors { return emptyExtensions } func (m PlaceholderMessage) ProtoType(protoreflect.MessageDescriptor) { return } func (m PlaceholderMessage) ProtoInternal(pragma.DoNotImplement) { return } ================================================ FILE: vendor/google.golang.org/protobuf/internal/filedesc/presence.go ================================================ // Copyright 2025 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package filedesc import "google.golang.org/protobuf/reflect/protoreflect" // UsePresenceForField reports whether the presence bitmap should be used for // the specified field. func UsePresenceForField(fd protoreflect.FieldDescriptor) (usePresence, canBeLazy bool) { switch { case fd.ContainingOneof() != nil && !fd.ContainingOneof().IsSynthetic(): // Oneof fields never use the presence bitmap. // // Synthetic oneofs are an exception: Those are used to implement proto3 // optional fields and hence should follow non-oneof field semantics. return false, false case fd.IsMap(): // Map-typed fields never use the presence bitmap. return false, false case fd.Kind() == protoreflect.MessageKind || fd.Kind() == protoreflect.GroupKind: // Lazy fields always use the presence bitmap (only messages can be lazy). isLazy := fd.(interface{ IsLazy() bool }).IsLazy() return isLazy, isLazy default: // If the field has presence, use the presence bitmap. return fd.HasPresence(), false } } ================================================ FILE: vendor/google.golang.org/protobuf/internal/filetype/build.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package filetype provides functionality for wrapping descriptors // with Go type information. package filetype import ( "reflect" "google.golang.org/protobuf/internal/descopts" "google.golang.org/protobuf/internal/filedesc" pimpl "google.golang.org/protobuf/internal/impl" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/reflect/protoregistry" ) // Builder constructs type descriptors from a raw file descriptor // and associated Go types for each enum and message declaration. // // # Flattened Ordering // // The protobuf type system represents declarations as a tree. Certain nodes in // the tree require us to either associate it with a concrete Go type or to // resolve a dependency, which is information that must be provided separately // since it cannot be derived from the file descriptor alone. // // However, representing a tree as Go literals is difficult to simply do in a // space and time efficient way. Thus, we store them as a flattened list of // objects where the serialization order from the tree-based form is important. // // The "flattened ordering" is defined as a tree traversal of all enum, message, // extension, and service declarations using the following algorithm: // // def VisitFileDecls(fd): // for e in fd.Enums: yield e // for m in fd.Messages: yield m // for x in fd.Extensions: yield x // for s in fd.Services: yield s // for m in fd.Messages: yield from VisitMessageDecls(m) // // def VisitMessageDecls(md): // for e in md.Enums: yield e // for m in md.Messages: yield m // for x in md.Extensions: yield x // for m in md.Messages: yield from VisitMessageDecls(m) // // The traversal starts at the root file descriptor and yields each direct // declaration within each node before traversing into sub-declarations // that children themselves may have. type Builder struct { // File is the underlying file descriptor builder. File filedesc.Builder // GoTypes is a unique set of the Go types for all declarations and // dependencies. Each type is represented as a zero value of the Go type. // // Declarations are Go types generated for enums and messages directly // declared (not publicly imported) in the proto source file. // Messages for map entries are accounted for, but represented by nil. // Enum declarations in "flattened ordering" come first, followed by // message declarations in "flattened ordering". // // Dependencies are Go types for enums or messages referenced by // message fields, for parent extended messages of // extension fields, for enums or messages referenced by extension fields, // and for input and output messages referenced by service methods. // Dependencies must come after declarations, but the ordering of // dependencies themselves is unspecified. GoTypes []any // DependencyIndexes is an ordered list of indexes into GoTypes for the // dependencies of messages, extensions, or services. // // There are 5 sub-lists in "flattened ordering" concatenated back-to-back: // 0. Message field dependencies: list of the enum or message type // referred to by every message field. // 1. Extension field targets: list of the extended parent message of // every extension. // 2. Extension field dependencies: list of the enum or message type // referred to by every extension field. // 3. Service method inputs: list of the input message type // referred to by every service method. // 4. Service method outputs: list of the output message type // referred to by every service method. // // The offset into DependencyIndexes for the start of each sub-list // is appended to the end in reverse order. DependencyIndexes []int32 // EnumInfos is a list of enum infos in "flattened ordering". EnumInfos []pimpl.EnumInfo // MessageInfos is a list of message infos in "flattened ordering". // If provided, the GoType and PBType for each element is populated. // // Requirement: len(MessageInfos) == len(Build.Messages) MessageInfos []pimpl.MessageInfo // ExtensionInfos is a list of extension infos in "flattened ordering". // Each element is initialized and registered with the protoregistry package. // // Requirement: len(LegacyExtensions) == len(Build.Extensions) ExtensionInfos []pimpl.ExtensionInfo // TypeRegistry is the registry to register each type descriptor. // If nil, it uses protoregistry.GlobalTypes. TypeRegistry interface { RegisterMessage(protoreflect.MessageType) error RegisterEnum(protoreflect.EnumType) error RegisterExtension(protoreflect.ExtensionType) error } } // Out is the output of the builder. type Out struct { File protoreflect.FileDescriptor } func (tb Builder) Build() (out Out) { // Replace the resolver with one that resolves dependencies by index, // which is faster and more reliable than relying on the global registry. if tb.File.FileRegistry == nil { tb.File.FileRegistry = protoregistry.GlobalFiles } tb.File.FileRegistry = &resolverByIndex{ goTypes: tb.GoTypes, depIdxs: tb.DependencyIndexes, fileRegistry: tb.File.FileRegistry, } // Initialize registry if unpopulated. if tb.TypeRegistry == nil { tb.TypeRegistry = protoregistry.GlobalTypes } fbOut := tb.File.Build() out.File = fbOut.File // Process enums. enumGoTypes := tb.GoTypes[:len(fbOut.Enums)] if len(tb.EnumInfos) != len(fbOut.Enums) { panic("mismatching enum lengths") } if len(fbOut.Enums) > 0 { for i := range fbOut.Enums { tb.EnumInfos[i] = pimpl.EnumInfo{ GoReflectType: reflect.TypeOf(enumGoTypes[i]), Desc: &fbOut.Enums[i], } // Register enum types. if err := tb.TypeRegistry.RegisterEnum(&tb.EnumInfos[i]); err != nil { panic(err) } } } // Process messages. messageGoTypes := tb.GoTypes[len(fbOut.Enums):][:len(fbOut.Messages)] if len(tb.MessageInfos) != len(fbOut.Messages) { panic("mismatching message lengths") } if len(fbOut.Messages) > 0 { for i := range fbOut.Messages { if messageGoTypes[i] == nil { continue // skip map entry } tb.MessageInfos[i].GoReflectType = reflect.TypeOf(messageGoTypes[i]) tb.MessageInfos[i].Desc = &fbOut.Messages[i] // Register message types. if err := tb.TypeRegistry.RegisterMessage(&tb.MessageInfos[i]); err != nil { panic(err) } } // As a special-case for descriptor.proto, // locally register concrete message type for the options. if out.File.Path() == "google/protobuf/descriptor.proto" && out.File.Package() == "google.protobuf" { for i := range fbOut.Messages { switch fbOut.Messages[i].Name() { case "FileOptions": descopts.File = messageGoTypes[i].(protoreflect.ProtoMessage) case "EnumOptions": descopts.Enum = messageGoTypes[i].(protoreflect.ProtoMessage) case "EnumValueOptions": descopts.EnumValue = messageGoTypes[i].(protoreflect.ProtoMessage) case "MessageOptions": descopts.Message = messageGoTypes[i].(protoreflect.ProtoMessage) case "FieldOptions": descopts.Field = messageGoTypes[i].(protoreflect.ProtoMessage) case "OneofOptions": descopts.Oneof = messageGoTypes[i].(protoreflect.ProtoMessage) case "ExtensionRangeOptions": descopts.ExtensionRange = messageGoTypes[i].(protoreflect.ProtoMessage) case "ServiceOptions": descopts.Service = messageGoTypes[i].(protoreflect.ProtoMessage) case "MethodOptions": descopts.Method = messageGoTypes[i].(protoreflect.ProtoMessage) } } } } // Process extensions. if len(tb.ExtensionInfos) != len(fbOut.Extensions) { panic("mismatching extension lengths") } var depIdx int32 for i := range fbOut.Extensions { // For enum and message kinds, determine the referent Go type so // that we can construct their constructors. const listExtDeps = 2 var goType reflect.Type switch fbOut.Extensions[i].L1.Kind { case protoreflect.EnumKind: j := depIdxs.Get(tb.DependencyIndexes, listExtDeps, depIdx) goType = reflect.TypeOf(tb.GoTypes[j]) depIdx++ case protoreflect.MessageKind, protoreflect.GroupKind: j := depIdxs.Get(tb.DependencyIndexes, listExtDeps, depIdx) goType = reflect.TypeOf(tb.GoTypes[j]) depIdx++ default: goType = goTypeForPBKind[fbOut.Extensions[i].L1.Kind] } if fbOut.Extensions[i].IsList() { goType = reflect.SliceOf(goType) } pimpl.InitExtensionInfo(&tb.ExtensionInfos[i], &fbOut.Extensions[i], goType) // Register extension types. if err := tb.TypeRegistry.RegisterExtension(&tb.ExtensionInfos[i]); err != nil { panic(err) } } return out } var goTypeForPBKind = map[protoreflect.Kind]reflect.Type{ protoreflect.BoolKind: reflect.TypeOf(bool(false)), protoreflect.Int32Kind: reflect.TypeOf(int32(0)), protoreflect.Sint32Kind: reflect.TypeOf(int32(0)), protoreflect.Sfixed32Kind: reflect.TypeOf(int32(0)), protoreflect.Int64Kind: reflect.TypeOf(int64(0)), protoreflect.Sint64Kind: reflect.TypeOf(int64(0)), protoreflect.Sfixed64Kind: reflect.TypeOf(int64(0)), protoreflect.Uint32Kind: reflect.TypeOf(uint32(0)), protoreflect.Fixed32Kind: reflect.TypeOf(uint32(0)), protoreflect.Uint64Kind: reflect.TypeOf(uint64(0)), protoreflect.Fixed64Kind: reflect.TypeOf(uint64(0)), protoreflect.FloatKind: reflect.TypeOf(float32(0)), protoreflect.DoubleKind: reflect.TypeOf(float64(0)), protoreflect.StringKind: reflect.TypeOf(string("")), protoreflect.BytesKind: reflect.TypeOf([]byte(nil)), } type depIdxs []int32 // Get retrieves the jth element of the ith sub-list. func (x depIdxs) Get(i, j int32) int32 { return x[x[int32(len(x))-i-1]+j] } type ( resolverByIndex struct { goTypes []any depIdxs depIdxs fileRegistry } fileRegistry interface { FindFileByPath(string) (protoreflect.FileDescriptor, error) FindDescriptorByName(protoreflect.FullName) (protoreflect.Descriptor, error) RegisterFile(protoreflect.FileDescriptor) error } ) func (r *resolverByIndex) FindEnumByIndex(i, j int32, es []filedesc.Enum, ms []filedesc.Message) protoreflect.EnumDescriptor { if depIdx := int(r.depIdxs.Get(i, j)); int(depIdx) < len(es)+len(ms) { return &es[depIdx] } else { return pimpl.Export{}.EnumDescriptorOf(r.goTypes[depIdx]) } } func (r *resolverByIndex) FindMessageByIndex(i, j int32, es []filedesc.Enum, ms []filedesc.Message) protoreflect.MessageDescriptor { if depIdx := int(r.depIdxs.Get(i, j)); depIdx < len(es)+len(ms) { return &ms[depIdx-len(es)] } else { return pimpl.Export{}.MessageDescriptorOf(r.goTypes[depIdx]) } } ================================================ FILE: vendor/google.golang.org/protobuf/internal/flags/flags.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package flags provides a set of flags controlled by build tags. package flags // ProtoLegacy specifies whether to enable support for legacy functionality // such as MessageSets, and various other obscure behavior // that is necessary to maintain backwards compatibility with proto1 or // the pre-release variants of proto2 and proto3. // // This is disabled by default unless built with the "protolegacy" tag. // // WARNING: The compatibility agreement covers nothing provided by this flag. // As such, functionality may suddenly be removed or changed at our discretion. const ProtoLegacy = protoLegacy // LazyUnmarshalExtensions specifies whether to lazily unmarshal extensions. // // Lazy extension unmarshaling validates the contents of message-valued // extension fields at unmarshal time, but defers creating the message // structure until the extension is first accessed. const LazyUnmarshalExtensions = ProtoLegacy ================================================ FILE: vendor/google.golang.org/protobuf/internal/flags/proto_legacy_disable.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build !protolegacy // +build !protolegacy package flags const protoLegacy = false ================================================ FILE: vendor/google.golang.org/protobuf/internal/flags/proto_legacy_enable.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build protolegacy // +build protolegacy package flags const protoLegacy = true ================================================ FILE: vendor/google.golang.org/protobuf/internal/genid/any_gen.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Code generated by generate-protos. DO NOT EDIT. package genid import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" ) const File_google_protobuf_any_proto = "google/protobuf/any.proto" // Names for google.protobuf.Any. const ( Any_message_name protoreflect.Name = "Any" Any_message_fullname protoreflect.FullName = "google.protobuf.Any" ) // Field names for google.protobuf.Any. const ( Any_TypeUrl_field_name protoreflect.Name = "type_url" Any_Value_field_name protoreflect.Name = "value" Any_TypeUrl_field_fullname protoreflect.FullName = "google.protobuf.Any.type_url" Any_Value_field_fullname protoreflect.FullName = "google.protobuf.Any.value" ) // Field numbers for google.protobuf.Any. const ( Any_TypeUrl_field_number protoreflect.FieldNumber = 1 Any_Value_field_number protoreflect.FieldNumber = 2 ) ================================================ FILE: vendor/google.golang.org/protobuf/internal/genid/api_gen.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Code generated by generate-protos. DO NOT EDIT. package genid import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" ) const File_google_protobuf_api_proto = "google/protobuf/api.proto" // Names for google.protobuf.Api. const ( Api_message_name protoreflect.Name = "Api" Api_message_fullname protoreflect.FullName = "google.protobuf.Api" ) // Field names for google.protobuf.Api. const ( Api_Name_field_name protoreflect.Name = "name" Api_Methods_field_name protoreflect.Name = "methods" Api_Options_field_name protoreflect.Name = "options" Api_Version_field_name protoreflect.Name = "version" Api_SourceContext_field_name protoreflect.Name = "source_context" Api_Mixins_field_name protoreflect.Name = "mixins" Api_Syntax_field_name protoreflect.Name = "syntax" Api_Edition_field_name protoreflect.Name = "edition" Api_Name_field_fullname protoreflect.FullName = "google.protobuf.Api.name" Api_Methods_field_fullname protoreflect.FullName = "google.protobuf.Api.methods" Api_Options_field_fullname protoreflect.FullName = "google.protobuf.Api.options" Api_Version_field_fullname protoreflect.FullName = "google.protobuf.Api.version" Api_SourceContext_field_fullname protoreflect.FullName = "google.protobuf.Api.source_context" Api_Mixins_field_fullname protoreflect.FullName = "google.protobuf.Api.mixins" Api_Syntax_field_fullname protoreflect.FullName = "google.protobuf.Api.syntax" Api_Edition_field_fullname protoreflect.FullName = "google.protobuf.Api.edition" ) // Field numbers for google.protobuf.Api. const ( Api_Name_field_number protoreflect.FieldNumber = 1 Api_Methods_field_number protoreflect.FieldNumber = 2 Api_Options_field_number protoreflect.FieldNumber = 3 Api_Version_field_number protoreflect.FieldNumber = 4 Api_SourceContext_field_number protoreflect.FieldNumber = 5 Api_Mixins_field_number protoreflect.FieldNumber = 6 Api_Syntax_field_number protoreflect.FieldNumber = 7 Api_Edition_field_number protoreflect.FieldNumber = 8 ) // Names for google.protobuf.Method. const ( Method_message_name protoreflect.Name = "Method" Method_message_fullname protoreflect.FullName = "google.protobuf.Method" ) // Field names for google.protobuf.Method. const ( Method_Name_field_name protoreflect.Name = "name" Method_RequestTypeUrl_field_name protoreflect.Name = "request_type_url" Method_RequestStreaming_field_name protoreflect.Name = "request_streaming" Method_ResponseTypeUrl_field_name protoreflect.Name = "response_type_url" Method_ResponseStreaming_field_name protoreflect.Name = "response_streaming" Method_Options_field_name protoreflect.Name = "options" Method_Syntax_field_name protoreflect.Name = "syntax" Method_Edition_field_name protoreflect.Name = "edition" Method_Name_field_fullname protoreflect.FullName = "google.protobuf.Method.name" Method_RequestTypeUrl_field_fullname protoreflect.FullName = "google.protobuf.Method.request_type_url" Method_RequestStreaming_field_fullname protoreflect.FullName = "google.protobuf.Method.request_streaming" Method_ResponseTypeUrl_field_fullname protoreflect.FullName = "google.protobuf.Method.response_type_url" Method_ResponseStreaming_field_fullname protoreflect.FullName = "google.protobuf.Method.response_streaming" Method_Options_field_fullname protoreflect.FullName = "google.protobuf.Method.options" Method_Syntax_field_fullname protoreflect.FullName = "google.protobuf.Method.syntax" Method_Edition_field_fullname protoreflect.FullName = "google.protobuf.Method.edition" ) // Field numbers for google.protobuf.Method. const ( Method_Name_field_number protoreflect.FieldNumber = 1 Method_RequestTypeUrl_field_number protoreflect.FieldNumber = 2 Method_RequestStreaming_field_number protoreflect.FieldNumber = 3 Method_ResponseTypeUrl_field_number protoreflect.FieldNumber = 4 Method_ResponseStreaming_field_number protoreflect.FieldNumber = 5 Method_Options_field_number protoreflect.FieldNumber = 6 Method_Syntax_field_number protoreflect.FieldNumber = 7 Method_Edition_field_number protoreflect.FieldNumber = 8 ) // Names for google.protobuf.Mixin. const ( Mixin_message_name protoreflect.Name = "Mixin" Mixin_message_fullname protoreflect.FullName = "google.protobuf.Mixin" ) // Field names for google.protobuf.Mixin. const ( Mixin_Name_field_name protoreflect.Name = "name" Mixin_Root_field_name protoreflect.Name = "root" Mixin_Name_field_fullname protoreflect.FullName = "google.protobuf.Mixin.name" Mixin_Root_field_fullname protoreflect.FullName = "google.protobuf.Mixin.root" ) // Field numbers for google.protobuf.Mixin. const ( Mixin_Name_field_number protoreflect.FieldNumber = 1 Mixin_Root_field_number protoreflect.FieldNumber = 2 ) ================================================ FILE: vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Code generated by generate-protos. DO NOT EDIT. package genid import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" ) const File_google_protobuf_descriptor_proto = "google/protobuf/descriptor.proto" // Full and short names for google.protobuf.Edition. const ( Edition_enum_fullname = "google.protobuf.Edition" Edition_enum_name = "Edition" ) // Enum values for google.protobuf.Edition. const ( Edition_EDITION_UNKNOWN_enum_value = 0 Edition_EDITION_LEGACY_enum_value = 900 Edition_EDITION_PROTO2_enum_value = 998 Edition_EDITION_PROTO3_enum_value = 999 Edition_EDITION_2023_enum_value = 1000 Edition_EDITION_2024_enum_value = 1001 Edition_EDITION_UNSTABLE_enum_value = 9999 Edition_EDITION_1_TEST_ONLY_enum_value = 1 Edition_EDITION_2_TEST_ONLY_enum_value = 2 Edition_EDITION_99997_TEST_ONLY_enum_value = 99997 Edition_EDITION_99998_TEST_ONLY_enum_value = 99998 Edition_EDITION_99999_TEST_ONLY_enum_value = 99999 Edition_EDITION_MAX_enum_value = 2147483647 ) // Full and short names for google.protobuf.SymbolVisibility. const ( SymbolVisibility_enum_fullname = "google.protobuf.SymbolVisibility" SymbolVisibility_enum_name = "SymbolVisibility" ) // Enum values for google.protobuf.SymbolVisibility. const ( SymbolVisibility_VISIBILITY_UNSET_enum_value = 0 SymbolVisibility_VISIBILITY_LOCAL_enum_value = 1 SymbolVisibility_VISIBILITY_EXPORT_enum_value = 2 ) // Names for google.protobuf.FileDescriptorSet. const ( FileDescriptorSet_message_name protoreflect.Name = "FileDescriptorSet" FileDescriptorSet_message_fullname protoreflect.FullName = "google.protobuf.FileDescriptorSet" ) // Field names for google.protobuf.FileDescriptorSet. const ( FileDescriptorSet_File_field_name protoreflect.Name = "file" FileDescriptorSet_File_field_fullname protoreflect.FullName = "google.protobuf.FileDescriptorSet.file" ) // Field numbers for google.protobuf.FileDescriptorSet. const ( FileDescriptorSet_File_field_number protoreflect.FieldNumber = 1 ) // Names for google.protobuf.FileDescriptorProto. const ( FileDescriptorProto_message_name protoreflect.Name = "FileDescriptorProto" FileDescriptorProto_message_fullname protoreflect.FullName = "google.protobuf.FileDescriptorProto" ) // Field names for google.protobuf.FileDescriptorProto. const ( FileDescriptorProto_Name_field_name protoreflect.Name = "name" FileDescriptorProto_Package_field_name protoreflect.Name = "package" FileDescriptorProto_Dependency_field_name protoreflect.Name = "dependency" FileDescriptorProto_PublicDependency_field_name protoreflect.Name = "public_dependency" FileDescriptorProto_WeakDependency_field_name protoreflect.Name = "weak_dependency" FileDescriptorProto_OptionDependency_field_name protoreflect.Name = "option_dependency" FileDescriptorProto_MessageType_field_name protoreflect.Name = "message_type" FileDescriptorProto_EnumType_field_name protoreflect.Name = "enum_type" FileDescriptorProto_Service_field_name protoreflect.Name = "service" FileDescriptorProto_Extension_field_name protoreflect.Name = "extension" FileDescriptorProto_Options_field_name protoreflect.Name = "options" FileDescriptorProto_SourceCodeInfo_field_name protoreflect.Name = "source_code_info" FileDescriptorProto_Syntax_field_name protoreflect.Name = "syntax" FileDescriptorProto_Edition_field_name protoreflect.Name = "edition" FileDescriptorProto_Name_field_fullname protoreflect.FullName = "google.protobuf.FileDescriptorProto.name" FileDescriptorProto_Package_field_fullname protoreflect.FullName = "google.protobuf.FileDescriptorProto.package" FileDescriptorProto_Dependency_field_fullname protoreflect.FullName = "google.protobuf.FileDescriptorProto.dependency" FileDescriptorProto_PublicDependency_field_fullname protoreflect.FullName = "google.protobuf.FileDescriptorProto.public_dependency" FileDescriptorProto_WeakDependency_field_fullname protoreflect.FullName = "google.protobuf.FileDescriptorProto.weak_dependency" FileDescriptorProto_OptionDependency_field_fullname protoreflect.FullName = "google.protobuf.FileDescriptorProto.option_dependency" FileDescriptorProto_MessageType_field_fullname protoreflect.FullName = "google.protobuf.FileDescriptorProto.message_type" FileDescriptorProto_EnumType_field_fullname protoreflect.FullName = "google.protobuf.FileDescriptorProto.enum_type" FileDescriptorProto_Service_field_fullname protoreflect.FullName = "google.protobuf.FileDescriptorProto.service" FileDescriptorProto_Extension_field_fullname protoreflect.FullName = "google.protobuf.FileDescriptorProto.extension" FileDescriptorProto_Options_field_fullname protoreflect.FullName = "google.protobuf.FileDescriptorProto.options" FileDescriptorProto_SourceCodeInfo_field_fullname protoreflect.FullName = "google.protobuf.FileDescriptorProto.source_code_info" FileDescriptorProto_Syntax_field_fullname protoreflect.FullName = "google.protobuf.FileDescriptorProto.syntax" FileDescriptorProto_Edition_field_fullname protoreflect.FullName = "google.protobuf.FileDescriptorProto.edition" ) // Field numbers for google.protobuf.FileDescriptorProto. const ( FileDescriptorProto_Name_field_number protoreflect.FieldNumber = 1 FileDescriptorProto_Package_field_number protoreflect.FieldNumber = 2 FileDescriptorProto_Dependency_field_number protoreflect.FieldNumber = 3 FileDescriptorProto_PublicDependency_field_number protoreflect.FieldNumber = 10 FileDescriptorProto_WeakDependency_field_number protoreflect.FieldNumber = 11 FileDescriptorProto_OptionDependency_field_number protoreflect.FieldNumber = 15 FileDescriptorProto_MessageType_field_number protoreflect.FieldNumber = 4 FileDescriptorProto_EnumType_field_number protoreflect.FieldNumber = 5 FileDescriptorProto_Service_field_number protoreflect.FieldNumber = 6 FileDescriptorProto_Extension_field_number protoreflect.FieldNumber = 7 FileDescriptorProto_Options_field_number protoreflect.FieldNumber = 8 FileDescriptorProto_SourceCodeInfo_field_number protoreflect.FieldNumber = 9 FileDescriptorProto_Syntax_field_number protoreflect.FieldNumber = 12 FileDescriptorProto_Edition_field_number protoreflect.FieldNumber = 14 ) // Names for google.protobuf.DescriptorProto. const ( DescriptorProto_message_name protoreflect.Name = "DescriptorProto" DescriptorProto_message_fullname protoreflect.FullName = "google.protobuf.DescriptorProto" ) // Field names for google.protobuf.DescriptorProto. const ( DescriptorProto_Name_field_name protoreflect.Name = "name" DescriptorProto_Field_field_name protoreflect.Name = "field" DescriptorProto_Extension_field_name protoreflect.Name = "extension" DescriptorProto_NestedType_field_name protoreflect.Name = "nested_type" DescriptorProto_EnumType_field_name protoreflect.Name = "enum_type" DescriptorProto_ExtensionRange_field_name protoreflect.Name = "extension_range" DescriptorProto_OneofDecl_field_name protoreflect.Name = "oneof_decl" DescriptorProto_Options_field_name protoreflect.Name = "options" DescriptorProto_ReservedRange_field_name protoreflect.Name = "reserved_range" DescriptorProto_ReservedName_field_name protoreflect.Name = "reserved_name" DescriptorProto_Visibility_field_name protoreflect.Name = "visibility" DescriptorProto_Name_field_fullname protoreflect.FullName = "google.protobuf.DescriptorProto.name" DescriptorProto_Field_field_fullname protoreflect.FullName = "google.protobuf.DescriptorProto.field" DescriptorProto_Extension_field_fullname protoreflect.FullName = "google.protobuf.DescriptorProto.extension" DescriptorProto_NestedType_field_fullname protoreflect.FullName = "google.protobuf.DescriptorProto.nested_type" DescriptorProto_EnumType_field_fullname protoreflect.FullName = "google.protobuf.DescriptorProto.enum_type" DescriptorProto_ExtensionRange_field_fullname protoreflect.FullName = "google.protobuf.DescriptorProto.extension_range" DescriptorProto_OneofDecl_field_fullname protoreflect.FullName = "google.protobuf.DescriptorProto.oneof_decl" DescriptorProto_Options_field_fullname protoreflect.FullName = "google.protobuf.DescriptorProto.options" DescriptorProto_ReservedRange_field_fullname protoreflect.FullName = "google.protobuf.DescriptorProto.reserved_range" DescriptorProto_ReservedName_field_fullname protoreflect.FullName = "google.protobuf.DescriptorProto.reserved_name" DescriptorProto_Visibility_field_fullname protoreflect.FullName = "google.protobuf.DescriptorProto.visibility" ) // Field numbers for google.protobuf.DescriptorProto. const ( DescriptorProto_Name_field_number protoreflect.FieldNumber = 1 DescriptorProto_Field_field_number protoreflect.FieldNumber = 2 DescriptorProto_Extension_field_number protoreflect.FieldNumber = 6 DescriptorProto_NestedType_field_number protoreflect.FieldNumber = 3 DescriptorProto_EnumType_field_number protoreflect.FieldNumber = 4 DescriptorProto_ExtensionRange_field_number protoreflect.FieldNumber = 5 DescriptorProto_OneofDecl_field_number protoreflect.FieldNumber = 8 DescriptorProto_Options_field_number protoreflect.FieldNumber = 7 DescriptorProto_ReservedRange_field_number protoreflect.FieldNumber = 9 DescriptorProto_ReservedName_field_number protoreflect.FieldNumber = 10 DescriptorProto_Visibility_field_number protoreflect.FieldNumber = 11 ) // Names for google.protobuf.DescriptorProto.ExtensionRange. const ( DescriptorProto_ExtensionRange_message_name protoreflect.Name = "ExtensionRange" DescriptorProto_ExtensionRange_message_fullname protoreflect.FullName = "google.protobuf.DescriptorProto.ExtensionRange" ) // Field names for google.protobuf.DescriptorProto.ExtensionRange. const ( DescriptorProto_ExtensionRange_Start_field_name protoreflect.Name = "start" DescriptorProto_ExtensionRange_End_field_name protoreflect.Name = "end" DescriptorProto_ExtensionRange_Options_field_name protoreflect.Name = "options" DescriptorProto_ExtensionRange_Start_field_fullname protoreflect.FullName = "google.protobuf.DescriptorProto.ExtensionRange.start" DescriptorProto_ExtensionRange_End_field_fullname protoreflect.FullName = "google.protobuf.DescriptorProto.ExtensionRange.end" DescriptorProto_ExtensionRange_Options_field_fullname protoreflect.FullName = "google.protobuf.DescriptorProto.ExtensionRange.options" ) // Field numbers for google.protobuf.DescriptorProto.ExtensionRange. const ( DescriptorProto_ExtensionRange_Start_field_number protoreflect.FieldNumber = 1 DescriptorProto_ExtensionRange_End_field_number protoreflect.FieldNumber = 2 DescriptorProto_ExtensionRange_Options_field_number protoreflect.FieldNumber = 3 ) // Names for google.protobuf.DescriptorProto.ReservedRange. const ( DescriptorProto_ReservedRange_message_name protoreflect.Name = "ReservedRange" DescriptorProto_ReservedRange_message_fullname protoreflect.FullName = "google.protobuf.DescriptorProto.ReservedRange" ) // Field names for google.protobuf.DescriptorProto.ReservedRange. const ( DescriptorProto_ReservedRange_Start_field_name protoreflect.Name = "start" DescriptorProto_ReservedRange_End_field_name protoreflect.Name = "end" DescriptorProto_ReservedRange_Start_field_fullname protoreflect.FullName = "google.protobuf.DescriptorProto.ReservedRange.start" DescriptorProto_ReservedRange_End_field_fullname protoreflect.FullName = "google.protobuf.DescriptorProto.ReservedRange.end" ) // Field numbers for google.protobuf.DescriptorProto.ReservedRange. const ( DescriptorProto_ReservedRange_Start_field_number protoreflect.FieldNumber = 1 DescriptorProto_ReservedRange_End_field_number protoreflect.FieldNumber = 2 ) // Names for google.protobuf.ExtensionRangeOptions. const ( ExtensionRangeOptions_message_name protoreflect.Name = "ExtensionRangeOptions" ExtensionRangeOptions_message_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions" ) // Field names for google.protobuf.ExtensionRangeOptions. const ( ExtensionRangeOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option" ExtensionRangeOptions_Declaration_field_name protoreflect.Name = "declaration" ExtensionRangeOptions_Features_field_name protoreflect.Name = "features" ExtensionRangeOptions_Verification_field_name protoreflect.Name = "verification" ExtensionRangeOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.uninterpreted_option" ExtensionRangeOptions_Declaration_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.declaration" ExtensionRangeOptions_Features_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.features" ExtensionRangeOptions_Verification_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.verification" ) // Field numbers for google.protobuf.ExtensionRangeOptions. const ( ExtensionRangeOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999 ExtensionRangeOptions_Declaration_field_number protoreflect.FieldNumber = 2 ExtensionRangeOptions_Features_field_number protoreflect.FieldNumber = 50 ExtensionRangeOptions_Verification_field_number protoreflect.FieldNumber = 3 ) // Full and short names for google.protobuf.ExtensionRangeOptions.VerificationState. const ( ExtensionRangeOptions_VerificationState_enum_fullname = "google.protobuf.ExtensionRangeOptions.VerificationState" ExtensionRangeOptions_VerificationState_enum_name = "VerificationState" ) // Enum values for google.protobuf.ExtensionRangeOptions.VerificationState. const ( ExtensionRangeOptions_DECLARATION_enum_value = 0 ExtensionRangeOptions_UNVERIFIED_enum_value = 1 ) // Names for google.protobuf.ExtensionRangeOptions.Declaration. const ( ExtensionRangeOptions_Declaration_message_name protoreflect.Name = "Declaration" ExtensionRangeOptions_Declaration_message_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.Declaration" ) // Field names for google.protobuf.ExtensionRangeOptions.Declaration. const ( ExtensionRangeOptions_Declaration_Number_field_name protoreflect.Name = "number" ExtensionRangeOptions_Declaration_FullName_field_name protoreflect.Name = "full_name" ExtensionRangeOptions_Declaration_Type_field_name protoreflect.Name = "type" ExtensionRangeOptions_Declaration_Reserved_field_name protoreflect.Name = "reserved" ExtensionRangeOptions_Declaration_Repeated_field_name protoreflect.Name = "repeated" ExtensionRangeOptions_Declaration_Number_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.Declaration.number" ExtensionRangeOptions_Declaration_FullName_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.Declaration.full_name" ExtensionRangeOptions_Declaration_Type_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.Declaration.type" ExtensionRangeOptions_Declaration_Reserved_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.Declaration.reserved" ExtensionRangeOptions_Declaration_Repeated_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.Declaration.repeated" ) // Field numbers for google.protobuf.ExtensionRangeOptions.Declaration. const ( ExtensionRangeOptions_Declaration_Number_field_number protoreflect.FieldNumber = 1 ExtensionRangeOptions_Declaration_FullName_field_number protoreflect.FieldNumber = 2 ExtensionRangeOptions_Declaration_Type_field_number protoreflect.FieldNumber = 3 ExtensionRangeOptions_Declaration_Reserved_field_number protoreflect.FieldNumber = 5 ExtensionRangeOptions_Declaration_Repeated_field_number protoreflect.FieldNumber = 6 ) // Names for google.protobuf.FieldDescriptorProto. const ( FieldDescriptorProto_message_name protoreflect.Name = "FieldDescriptorProto" FieldDescriptorProto_message_fullname protoreflect.FullName = "google.protobuf.FieldDescriptorProto" ) // Field names for google.protobuf.FieldDescriptorProto. const ( FieldDescriptorProto_Name_field_name protoreflect.Name = "name" FieldDescriptorProto_Number_field_name protoreflect.Name = "number" FieldDescriptorProto_Label_field_name protoreflect.Name = "label" FieldDescriptorProto_Type_field_name protoreflect.Name = "type" FieldDescriptorProto_TypeName_field_name protoreflect.Name = "type_name" FieldDescriptorProto_Extendee_field_name protoreflect.Name = "extendee" FieldDescriptorProto_DefaultValue_field_name protoreflect.Name = "default_value" FieldDescriptorProto_OneofIndex_field_name protoreflect.Name = "oneof_index" FieldDescriptorProto_JsonName_field_name protoreflect.Name = "json_name" FieldDescriptorProto_Options_field_name protoreflect.Name = "options" FieldDescriptorProto_Proto3Optional_field_name protoreflect.Name = "proto3_optional" FieldDescriptorProto_Name_field_fullname protoreflect.FullName = "google.protobuf.FieldDescriptorProto.name" FieldDescriptorProto_Number_field_fullname protoreflect.FullName = "google.protobuf.FieldDescriptorProto.number" FieldDescriptorProto_Label_field_fullname protoreflect.FullName = "google.protobuf.FieldDescriptorProto.label" FieldDescriptorProto_Type_field_fullname protoreflect.FullName = "google.protobuf.FieldDescriptorProto.type" FieldDescriptorProto_TypeName_field_fullname protoreflect.FullName = "google.protobuf.FieldDescriptorProto.type_name" FieldDescriptorProto_Extendee_field_fullname protoreflect.FullName = "google.protobuf.FieldDescriptorProto.extendee" FieldDescriptorProto_DefaultValue_field_fullname protoreflect.FullName = "google.protobuf.FieldDescriptorProto.default_value" FieldDescriptorProto_OneofIndex_field_fullname protoreflect.FullName = "google.protobuf.FieldDescriptorProto.oneof_index" FieldDescriptorProto_JsonName_field_fullname protoreflect.FullName = "google.protobuf.FieldDescriptorProto.json_name" FieldDescriptorProto_Options_field_fullname protoreflect.FullName = "google.protobuf.FieldDescriptorProto.options" FieldDescriptorProto_Proto3Optional_field_fullname protoreflect.FullName = "google.protobuf.FieldDescriptorProto.proto3_optional" ) // Field numbers for google.protobuf.FieldDescriptorProto. const ( FieldDescriptorProto_Name_field_number protoreflect.FieldNumber = 1 FieldDescriptorProto_Number_field_number protoreflect.FieldNumber = 3 FieldDescriptorProto_Label_field_number protoreflect.FieldNumber = 4 FieldDescriptorProto_Type_field_number protoreflect.FieldNumber = 5 FieldDescriptorProto_TypeName_field_number protoreflect.FieldNumber = 6 FieldDescriptorProto_Extendee_field_number protoreflect.FieldNumber = 2 FieldDescriptorProto_DefaultValue_field_number protoreflect.FieldNumber = 7 FieldDescriptorProto_OneofIndex_field_number protoreflect.FieldNumber = 9 FieldDescriptorProto_JsonName_field_number protoreflect.FieldNumber = 10 FieldDescriptorProto_Options_field_number protoreflect.FieldNumber = 8 FieldDescriptorProto_Proto3Optional_field_number protoreflect.FieldNumber = 17 ) // Full and short names for google.protobuf.FieldDescriptorProto.Type. const ( FieldDescriptorProto_Type_enum_fullname = "google.protobuf.FieldDescriptorProto.Type" FieldDescriptorProto_Type_enum_name = "Type" ) // Enum values for google.protobuf.FieldDescriptorProto.Type. const ( FieldDescriptorProto_TYPE_DOUBLE_enum_value = 1 FieldDescriptorProto_TYPE_FLOAT_enum_value = 2 FieldDescriptorProto_TYPE_INT64_enum_value = 3 FieldDescriptorProto_TYPE_UINT64_enum_value = 4 FieldDescriptorProto_TYPE_INT32_enum_value = 5 FieldDescriptorProto_TYPE_FIXED64_enum_value = 6 FieldDescriptorProto_TYPE_FIXED32_enum_value = 7 FieldDescriptorProto_TYPE_BOOL_enum_value = 8 FieldDescriptorProto_TYPE_STRING_enum_value = 9 FieldDescriptorProto_TYPE_GROUP_enum_value = 10 FieldDescriptorProto_TYPE_MESSAGE_enum_value = 11 FieldDescriptorProto_TYPE_BYTES_enum_value = 12 FieldDescriptorProto_TYPE_UINT32_enum_value = 13 FieldDescriptorProto_TYPE_ENUM_enum_value = 14 FieldDescriptorProto_TYPE_SFIXED32_enum_value = 15 FieldDescriptorProto_TYPE_SFIXED64_enum_value = 16 FieldDescriptorProto_TYPE_SINT32_enum_value = 17 FieldDescriptorProto_TYPE_SINT64_enum_value = 18 ) // Full and short names for google.protobuf.FieldDescriptorProto.Label. const ( FieldDescriptorProto_Label_enum_fullname = "google.protobuf.FieldDescriptorProto.Label" FieldDescriptorProto_Label_enum_name = "Label" ) // Enum values for google.protobuf.FieldDescriptorProto.Label. const ( FieldDescriptorProto_LABEL_OPTIONAL_enum_value = 1 FieldDescriptorProto_LABEL_REPEATED_enum_value = 3 FieldDescriptorProto_LABEL_REQUIRED_enum_value = 2 ) // Names for google.protobuf.OneofDescriptorProto. const ( OneofDescriptorProto_message_name protoreflect.Name = "OneofDescriptorProto" OneofDescriptorProto_message_fullname protoreflect.FullName = "google.protobuf.OneofDescriptorProto" ) // Field names for google.protobuf.OneofDescriptorProto. const ( OneofDescriptorProto_Name_field_name protoreflect.Name = "name" OneofDescriptorProto_Options_field_name protoreflect.Name = "options" OneofDescriptorProto_Name_field_fullname protoreflect.FullName = "google.protobuf.OneofDescriptorProto.name" OneofDescriptorProto_Options_field_fullname protoreflect.FullName = "google.protobuf.OneofDescriptorProto.options" ) // Field numbers for google.protobuf.OneofDescriptorProto. const ( OneofDescriptorProto_Name_field_number protoreflect.FieldNumber = 1 OneofDescriptorProto_Options_field_number protoreflect.FieldNumber = 2 ) // Names for google.protobuf.EnumDescriptorProto. const ( EnumDescriptorProto_message_name protoreflect.Name = "EnumDescriptorProto" EnumDescriptorProto_message_fullname protoreflect.FullName = "google.protobuf.EnumDescriptorProto" ) // Field names for google.protobuf.EnumDescriptorProto. const ( EnumDescriptorProto_Name_field_name protoreflect.Name = "name" EnumDescriptorProto_Value_field_name protoreflect.Name = "value" EnumDescriptorProto_Options_field_name protoreflect.Name = "options" EnumDescriptorProto_ReservedRange_field_name protoreflect.Name = "reserved_range" EnumDescriptorProto_ReservedName_field_name protoreflect.Name = "reserved_name" EnumDescriptorProto_Visibility_field_name protoreflect.Name = "visibility" EnumDescriptorProto_Name_field_fullname protoreflect.FullName = "google.protobuf.EnumDescriptorProto.name" EnumDescriptorProto_Value_field_fullname protoreflect.FullName = "google.protobuf.EnumDescriptorProto.value" EnumDescriptorProto_Options_field_fullname protoreflect.FullName = "google.protobuf.EnumDescriptorProto.options" EnumDescriptorProto_ReservedRange_field_fullname protoreflect.FullName = "google.protobuf.EnumDescriptorProto.reserved_range" EnumDescriptorProto_ReservedName_field_fullname protoreflect.FullName = "google.protobuf.EnumDescriptorProto.reserved_name" EnumDescriptorProto_Visibility_field_fullname protoreflect.FullName = "google.protobuf.EnumDescriptorProto.visibility" ) // Field numbers for google.protobuf.EnumDescriptorProto. const ( EnumDescriptorProto_Name_field_number protoreflect.FieldNumber = 1 EnumDescriptorProto_Value_field_number protoreflect.FieldNumber = 2 EnumDescriptorProto_Options_field_number protoreflect.FieldNumber = 3 EnumDescriptorProto_ReservedRange_field_number protoreflect.FieldNumber = 4 EnumDescriptorProto_ReservedName_field_number protoreflect.FieldNumber = 5 EnumDescriptorProto_Visibility_field_number protoreflect.FieldNumber = 6 ) // Names for google.protobuf.EnumDescriptorProto.EnumReservedRange. const ( EnumDescriptorProto_EnumReservedRange_message_name protoreflect.Name = "EnumReservedRange" EnumDescriptorProto_EnumReservedRange_message_fullname protoreflect.FullName = "google.protobuf.EnumDescriptorProto.EnumReservedRange" ) // Field names for google.protobuf.EnumDescriptorProto.EnumReservedRange. const ( EnumDescriptorProto_EnumReservedRange_Start_field_name protoreflect.Name = "start" EnumDescriptorProto_EnumReservedRange_End_field_name protoreflect.Name = "end" EnumDescriptorProto_EnumReservedRange_Start_field_fullname protoreflect.FullName = "google.protobuf.EnumDescriptorProto.EnumReservedRange.start" EnumDescriptorProto_EnumReservedRange_End_field_fullname protoreflect.FullName = "google.protobuf.EnumDescriptorProto.EnumReservedRange.end" ) // Field numbers for google.protobuf.EnumDescriptorProto.EnumReservedRange. const ( EnumDescriptorProto_EnumReservedRange_Start_field_number protoreflect.FieldNumber = 1 EnumDescriptorProto_EnumReservedRange_End_field_number protoreflect.FieldNumber = 2 ) // Names for google.protobuf.EnumValueDescriptorProto. const ( EnumValueDescriptorProto_message_name protoreflect.Name = "EnumValueDescriptorProto" EnumValueDescriptorProto_message_fullname protoreflect.FullName = "google.protobuf.EnumValueDescriptorProto" ) // Field names for google.protobuf.EnumValueDescriptorProto. const ( EnumValueDescriptorProto_Name_field_name protoreflect.Name = "name" EnumValueDescriptorProto_Number_field_name protoreflect.Name = "number" EnumValueDescriptorProto_Options_field_name protoreflect.Name = "options" EnumValueDescriptorProto_Name_field_fullname protoreflect.FullName = "google.protobuf.EnumValueDescriptorProto.name" EnumValueDescriptorProto_Number_field_fullname protoreflect.FullName = "google.protobuf.EnumValueDescriptorProto.number" EnumValueDescriptorProto_Options_field_fullname protoreflect.FullName = "google.protobuf.EnumValueDescriptorProto.options" ) // Field numbers for google.protobuf.EnumValueDescriptorProto. const ( EnumValueDescriptorProto_Name_field_number protoreflect.FieldNumber = 1 EnumValueDescriptorProto_Number_field_number protoreflect.FieldNumber = 2 EnumValueDescriptorProto_Options_field_number protoreflect.FieldNumber = 3 ) // Names for google.protobuf.ServiceDescriptorProto. const ( ServiceDescriptorProto_message_name protoreflect.Name = "ServiceDescriptorProto" ServiceDescriptorProto_message_fullname protoreflect.FullName = "google.protobuf.ServiceDescriptorProto" ) // Field names for google.protobuf.ServiceDescriptorProto. const ( ServiceDescriptorProto_Name_field_name protoreflect.Name = "name" ServiceDescriptorProto_Method_field_name protoreflect.Name = "method" ServiceDescriptorProto_Options_field_name protoreflect.Name = "options" ServiceDescriptorProto_Name_field_fullname protoreflect.FullName = "google.protobuf.ServiceDescriptorProto.name" ServiceDescriptorProto_Method_field_fullname protoreflect.FullName = "google.protobuf.ServiceDescriptorProto.method" ServiceDescriptorProto_Options_field_fullname protoreflect.FullName = "google.protobuf.ServiceDescriptorProto.options" ) // Field numbers for google.protobuf.ServiceDescriptorProto. const ( ServiceDescriptorProto_Name_field_number protoreflect.FieldNumber = 1 ServiceDescriptorProto_Method_field_number protoreflect.FieldNumber = 2 ServiceDescriptorProto_Options_field_number protoreflect.FieldNumber = 3 ) // Names for google.protobuf.MethodDescriptorProto. const ( MethodDescriptorProto_message_name protoreflect.Name = "MethodDescriptorProto" MethodDescriptorProto_message_fullname protoreflect.FullName = "google.protobuf.MethodDescriptorProto" ) // Field names for google.protobuf.MethodDescriptorProto. const ( MethodDescriptorProto_Name_field_name protoreflect.Name = "name" MethodDescriptorProto_InputType_field_name protoreflect.Name = "input_type" MethodDescriptorProto_OutputType_field_name protoreflect.Name = "output_type" MethodDescriptorProto_Options_field_name protoreflect.Name = "options" MethodDescriptorProto_ClientStreaming_field_name protoreflect.Name = "client_streaming" MethodDescriptorProto_ServerStreaming_field_name protoreflect.Name = "server_streaming" MethodDescriptorProto_Name_field_fullname protoreflect.FullName = "google.protobuf.MethodDescriptorProto.name" MethodDescriptorProto_InputType_field_fullname protoreflect.FullName = "google.protobuf.MethodDescriptorProto.input_type" MethodDescriptorProto_OutputType_field_fullname protoreflect.FullName = "google.protobuf.MethodDescriptorProto.output_type" MethodDescriptorProto_Options_field_fullname protoreflect.FullName = "google.protobuf.MethodDescriptorProto.options" MethodDescriptorProto_ClientStreaming_field_fullname protoreflect.FullName = "google.protobuf.MethodDescriptorProto.client_streaming" MethodDescriptorProto_ServerStreaming_field_fullname protoreflect.FullName = "google.protobuf.MethodDescriptorProto.server_streaming" ) // Field numbers for google.protobuf.MethodDescriptorProto. const ( MethodDescriptorProto_Name_field_number protoreflect.FieldNumber = 1 MethodDescriptorProto_InputType_field_number protoreflect.FieldNumber = 2 MethodDescriptorProto_OutputType_field_number protoreflect.FieldNumber = 3 MethodDescriptorProto_Options_field_number protoreflect.FieldNumber = 4 MethodDescriptorProto_ClientStreaming_field_number protoreflect.FieldNumber = 5 MethodDescriptorProto_ServerStreaming_field_number protoreflect.FieldNumber = 6 ) // Names for google.protobuf.FileOptions. const ( FileOptions_message_name protoreflect.Name = "FileOptions" FileOptions_message_fullname protoreflect.FullName = "google.protobuf.FileOptions" ) // Field names for google.protobuf.FileOptions. const ( FileOptions_JavaPackage_field_name protoreflect.Name = "java_package" FileOptions_JavaOuterClassname_field_name protoreflect.Name = "java_outer_classname" FileOptions_JavaMultipleFiles_field_name protoreflect.Name = "java_multiple_files" FileOptions_JavaGenerateEqualsAndHash_field_name protoreflect.Name = "java_generate_equals_and_hash" FileOptions_JavaStringCheckUtf8_field_name protoreflect.Name = "java_string_check_utf8" FileOptions_OptimizeFor_field_name protoreflect.Name = "optimize_for" FileOptions_GoPackage_field_name protoreflect.Name = "go_package" FileOptions_CcGenericServices_field_name protoreflect.Name = "cc_generic_services" FileOptions_JavaGenericServices_field_name protoreflect.Name = "java_generic_services" FileOptions_PyGenericServices_field_name protoreflect.Name = "py_generic_services" FileOptions_Deprecated_field_name protoreflect.Name = "deprecated" FileOptions_CcEnableArenas_field_name protoreflect.Name = "cc_enable_arenas" FileOptions_ObjcClassPrefix_field_name protoreflect.Name = "objc_class_prefix" FileOptions_CsharpNamespace_field_name protoreflect.Name = "csharp_namespace" FileOptions_SwiftPrefix_field_name protoreflect.Name = "swift_prefix" FileOptions_PhpClassPrefix_field_name protoreflect.Name = "php_class_prefix" FileOptions_PhpNamespace_field_name protoreflect.Name = "php_namespace" FileOptions_PhpMetadataNamespace_field_name protoreflect.Name = "php_metadata_namespace" FileOptions_RubyPackage_field_name protoreflect.Name = "ruby_package" FileOptions_Features_field_name protoreflect.Name = "features" FileOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option" FileOptions_JavaPackage_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.java_package" FileOptions_JavaOuterClassname_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.java_outer_classname" FileOptions_JavaMultipleFiles_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.java_multiple_files" FileOptions_JavaGenerateEqualsAndHash_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.java_generate_equals_and_hash" FileOptions_JavaStringCheckUtf8_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.java_string_check_utf8" FileOptions_OptimizeFor_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.optimize_for" FileOptions_GoPackage_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.go_package" FileOptions_CcGenericServices_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.cc_generic_services" FileOptions_JavaGenericServices_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.java_generic_services" FileOptions_PyGenericServices_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.py_generic_services" FileOptions_Deprecated_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.deprecated" FileOptions_CcEnableArenas_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.cc_enable_arenas" FileOptions_ObjcClassPrefix_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.objc_class_prefix" FileOptions_CsharpNamespace_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.csharp_namespace" FileOptions_SwiftPrefix_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.swift_prefix" FileOptions_PhpClassPrefix_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.php_class_prefix" FileOptions_PhpNamespace_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.php_namespace" FileOptions_PhpMetadataNamespace_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.php_metadata_namespace" FileOptions_RubyPackage_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.ruby_package" FileOptions_Features_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.features" FileOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.uninterpreted_option" ) // Field numbers for google.protobuf.FileOptions. const ( FileOptions_JavaPackage_field_number protoreflect.FieldNumber = 1 FileOptions_JavaOuterClassname_field_number protoreflect.FieldNumber = 8 FileOptions_JavaMultipleFiles_field_number protoreflect.FieldNumber = 10 FileOptions_JavaGenerateEqualsAndHash_field_number protoreflect.FieldNumber = 20 FileOptions_JavaStringCheckUtf8_field_number protoreflect.FieldNumber = 27 FileOptions_OptimizeFor_field_number protoreflect.FieldNumber = 9 FileOptions_GoPackage_field_number protoreflect.FieldNumber = 11 FileOptions_CcGenericServices_field_number protoreflect.FieldNumber = 16 FileOptions_JavaGenericServices_field_number protoreflect.FieldNumber = 17 FileOptions_PyGenericServices_field_number protoreflect.FieldNumber = 18 FileOptions_Deprecated_field_number protoreflect.FieldNumber = 23 FileOptions_CcEnableArenas_field_number protoreflect.FieldNumber = 31 FileOptions_ObjcClassPrefix_field_number protoreflect.FieldNumber = 36 FileOptions_CsharpNamespace_field_number protoreflect.FieldNumber = 37 FileOptions_SwiftPrefix_field_number protoreflect.FieldNumber = 39 FileOptions_PhpClassPrefix_field_number protoreflect.FieldNumber = 40 FileOptions_PhpNamespace_field_number protoreflect.FieldNumber = 41 FileOptions_PhpMetadataNamespace_field_number protoreflect.FieldNumber = 44 FileOptions_RubyPackage_field_number protoreflect.FieldNumber = 45 FileOptions_Features_field_number protoreflect.FieldNumber = 50 FileOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999 ) // Full and short names for google.protobuf.FileOptions.OptimizeMode. const ( FileOptions_OptimizeMode_enum_fullname = "google.protobuf.FileOptions.OptimizeMode" FileOptions_OptimizeMode_enum_name = "OptimizeMode" ) // Enum values for google.protobuf.FileOptions.OptimizeMode. const ( FileOptions_SPEED_enum_value = 1 FileOptions_CODE_SIZE_enum_value = 2 FileOptions_LITE_RUNTIME_enum_value = 3 ) // Names for google.protobuf.MessageOptions. const ( MessageOptions_message_name protoreflect.Name = "MessageOptions" MessageOptions_message_fullname protoreflect.FullName = "google.protobuf.MessageOptions" ) // Field names for google.protobuf.MessageOptions. const ( MessageOptions_MessageSetWireFormat_field_name protoreflect.Name = "message_set_wire_format" MessageOptions_NoStandardDescriptorAccessor_field_name protoreflect.Name = "no_standard_descriptor_accessor" MessageOptions_Deprecated_field_name protoreflect.Name = "deprecated" MessageOptions_MapEntry_field_name protoreflect.Name = "map_entry" MessageOptions_DeprecatedLegacyJsonFieldConflicts_field_name protoreflect.Name = "deprecated_legacy_json_field_conflicts" MessageOptions_Features_field_name protoreflect.Name = "features" MessageOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option" MessageOptions_MessageSetWireFormat_field_fullname protoreflect.FullName = "google.protobuf.MessageOptions.message_set_wire_format" MessageOptions_NoStandardDescriptorAccessor_field_fullname protoreflect.FullName = "google.protobuf.MessageOptions.no_standard_descriptor_accessor" MessageOptions_Deprecated_field_fullname protoreflect.FullName = "google.protobuf.MessageOptions.deprecated" MessageOptions_MapEntry_field_fullname protoreflect.FullName = "google.protobuf.MessageOptions.map_entry" MessageOptions_DeprecatedLegacyJsonFieldConflicts_field_fullname protoreflect.FullName = "google.protobuf.MessageOptions.deprecated_legacy_json_field_conflicts" MessageOptions_Features_field_fullname protoreflect.FullName = "google.protobuf.MessageOptions.features" MessageOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.MessageOptions.uninterpreted_option" ) // Field numbers for google.protobuf.MessageOptions. const ( MessageOptions_MessageSetWireFormat_field_number protoreflect.FieldNumber = 1 MessageOptions_NoStandardDescriptorAccessor_field_number protoreflect.FieldNumber = 2 MessageOptions_Deprecated_field_number protoreflect.FieldNumber = 3 MessageOptions_MapEntry_field_number protoreflect.FieldNumber = 7 MessageOptions_DeprecatedLegacyJsonFieldConflicts_field_number protoreflect.FieldNumber = 11 MessageOptions_Features_field_number protoreflect.FieldNumber = 12 MessageOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999 ) // Names for google.protobuf.FieldOptions. const ( FieldOptions_message_name protoreflect.Name = "FieldOptions" FieldOptions_message_fullname protoreflect.FullName = "google.protobuf.FieldOptions" ) // Field names for google.protobuf.FieldOptions. const ( FieldOptions_Ctype_field_name protoreflect.Name = "ctype" FieldOptions_Packed_field_name protoreflect.Name = "packed" FieldOptions_Jstype_field_name protoreflect.Name = "jstype" FieldOptions_Lazy_field_name protoreflect.Name = "lazy" FieldOptions_UnverifiedLazy_field_name protoreflect.Name = "unverified_lazy" FieldOptions_Deprecated_field_name protoreflect.Name = "deprecated" FieldOptions_Weak_field_name protoreflect.Name = "weak" FieldOptions_DebugRedact_field_name protoreflect.Name = "debug_redact" FieldOptions_Retention_field_name protoreflect.Name = "retention" FieldOptions_Targets_field_name protoreflect.Name = "targets" FieldOptions_EditionDefaults_field_name protoreflect.Name = "edition_defaults" FieldOptions_Features_field_name protoreflect.Name = "features" FieldOptions_FeatureSupport_field_name protoreflect.Name = "feature_support" FieldOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option" FieldOptions_Ctype_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.ctype" FieldOptions_Packed_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.packed" FieldOptions_Jstype_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.jstype" FieldOptions_Lazy_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.lazy" FieldOptions_UnverifiedLazy_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.unverified_lazy" FieldOptions_Deprecated_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.deprecated" FieldOptions_Weak_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.weak" FieldOptions_DebugRedact_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.debug_redact" FieldOptions_Retention_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.retention" FieldOptions_Targets_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.targets" FieldOptions_EditionDefaults_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.edition_defaults" FieldOptions_Features_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.features" FieldOptions_FeatureSupport_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.feature_support" FieldOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.uninterpreted_option" ) // Field numbers for google.protobuf.FieldOptions. const ( FieldOptions_Ctype_field_number protoreflect.FieldNumber = 1 FieldOptions_Packed_field_number protoreflect.FieldNumber = 2 FieldOptions_Jstype_field_number protoreflect.FieldNumber = 6 FieldOptions_Lazy_field_number protoreflect.FieldNumber = 5 FieldOptions_UnverifiedLazy_field_number protoreflect.FieldNumber = 15 FieldOptions_Deprecated_field_number protoreflect.FieldNumber = 3 FieldOptions_Weak_field_number protoreflect.FieldNumber = 10 FieldOptions_DebugRedact_field_number protoreflect.FieldNumber = 16 FieldOptions_Retention_field_number protoreflect.FieldNumber = 17 FieldOptions_Targets_field_number protoreflect.FieldNumber = 19 FieldOptions_EditionDefaults_field_number protoreflect.FieldNumber = 20 FieldOptions_Features_field_number protoreflect.FieldNumber = 21 FieldOptions_FeatureSupport_field_number protoreflect.FieldNumber = 22 FieldOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999 ) // Full and short names for google.protobuf.FieldOptions.CType. const ( FieldOptions_CType_enum_fullname = "google.protobuf.FieldOptions.CType" FieldOptions_CType_enum_name = "CType" ) // Enum values for google.protobuf.FieldOptions.CType. const ( FieldOptions_STRING_enum_value = 0 FieldOptions_CORD_enum_value = 1 FieldOptions_STRING_PIECE_enum_value = 2 ) // Full and short names for google.protobuf.FieldOptions.JSType. const ( FieldOptions_JSType_enum_fullname = "google.protobuf.FieldOptions.JSType" FieldOptions_JSType_enum_name = "JSType" ) // Enum values for google.protobuf.FieldOptions.JSType. const ( FieldOptions_JS_NORMAL_enum_value = 0 FieldOptions_JS_STRING_enum_value = 1 FieldOptions_JS_NUMBER_enum_value = 2 ) // Full and short names for google.protobuf.FieldOptions.OptionRetention. const ( FieldOptions_OptionRetention_enum_fullname = "google.protobuf.FieldOptions.OptionRetention" FieldOptions_OptionRetention_enum_name = "OptionRetention" ) // Enum values for google.protobuf.FieldOptions.OptionRetention. const ( FieldOptions_RETENTION_UNKNOWN_enum_value = 0 FieldOptions_RETENTION_RUNTIME_enum_value = 1 FieldOptions_RETENTION_SOURCE_enum_value = 2 ) // Full and short names for google.protobuf.FieldOptions.OptionTargetType. const ( FieldOptions_OptionTargetType_enum_fullname = "google.protobuf.FieldOptions.OptionTargetType" FieldOptions_OptionTargetType_enum_name = "OptionTargetType" ) // Enum values for google.protobuf.FieldOptions.OptionTargetType. const ( FieldOptions_TARGET_TYPE_UNKNOWN_enum_value = 0 FieldOptions_TARGET_TYPE_FILE_enum_value = 1 FieldOptions_TARGET_TYPE_EXTENSION_RANGE_enum_value = 2 FieldOptions_TARGET_TYPE_MESSAGE_enum_value = 3 FieldOptions_TARGET_TYPE_FIELD_enum_value = 4 FieldOptions_TARGET_TYPE_ONEOF_enum_value = 5 FieldOptions_TARGET_TYPE_ENUM_enum_value = 6 FieldOptions_TARGET_TYPE_ENUM_ENTRY_enum_value = 7 FieldOptions_TARGET_TYPE_SERVICE_enum_value = 8 FieldOptions_TARGET_TYPE_METHOD_enum_value = 9 ) // Names for google.protobuf.FieldOptions.EditionDefault. const ( FieldOptions_EditionDefault_message_name protoreflect.Name = "EditionDefault" FieldOptions_EditionDefault_message_fullname protoreflect.FullName = "google.protobuf.FieldOptions.EditionDefault" ) // Field names for google.protobuf.FieldOptions.EditionDefault. const ( FieldOptions_EditionDefault_Edition_field_name protoreflect.Name = "edition" FieldOptions_EditionDefault_Value_field_name protoreflect.Name = "value" FieldOptions_EditionDefault_Edition_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.EditionDefault.edition" FieldOptions_EditionDefault_Value_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.EditionDefault.value" ) // Field numbers for google.protobuf.FieldOptions.EditionDefault. const ( FieldOptions_EditionDefault_Edition_field_number protoreflect.FieldNumber = 3 FieldOptions_EditionDefault_Value_field_number protoreflect.FieldNumber = 2 ) // Names for google.protobuf.FieldOptions.FeatureSupport. const ( FieldOptions_FeatureSupport_message_name protoreflect.Name = "FeatureSupport" FieldOptions_FeatureSupport_message_fullname protoreflect.FullName = "google.protobuf.FieldOptions.FeatureSupport" ) // Field names for google.protobuf.FieldOptions.FeatureSupport. const ( FieldOptions_FeatureSupport_EditionIntroduced_field_name protoreflect.Name = "edition_introduced" FieldOptions_FeatureSupport_EditionDeprecated_field_name protoreflect.Name = "edition_deprecated" FieldOptions_FeatureSupport_DeprecationWarning_field_name protoreflect.Name = "deprecation_warning" FieldOptions_FeatureSupport_EditionRemoved_field_name protoreflect.Name = "edition_removed" FieldOptions_FeatureSupport_EditionIntroduced_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.FeatureSupport.edition_introduced" FieldOptions_FeatureSupport_EditionDeprecated_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.FeatureSupport.edition_deprecated" FieldOptions_FeatureSupport_DeprecationWarning_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.FeatureSupport.deprecation_warning" FieldOptions_FeatureSupport_EditionRemoved_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.FeatureSupport.edition_removed" ) // Field numbers for google.protobuf.FieldOptions.FeatureSupport. const ( FieldOptions_FeatureSupport_EditionIntroduced_field_number protoreflect.FieldNumber = 1 FieldOptions_FeatureSupport_EditionDeprecated_field_number protoreflect.FieldNumber = 2 FieldOptions_FeatureSupport_DeprecationWarning_field_number protoreflect.FieldNumber = 3 FieldOptions_FeatureSupport_EditionRemoved_field_number protoreflect.FieldNumber = 4 ) // Names for google.protobuf.OneofOptions. const ( OneofOptions_message_name protoreflect.Name = "OneofOptions" OneofOptions_message_fullname protoreflect.FullName = "google.protobuf.OneofOptions" ) // Field names for google.protobuf.OneofOptions. const ( OneofOptions_Features_field_name protoreflect.Name = "features" OneofOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option" OneofOptions_Features_field_fullname protoreflect.FullName = "google.protobuf.OneofOptions.features" OneofOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.OneofOptions.uninterpreted_option" ) // Field numbers for google.protobuf.OneofOptions. const ( OneofOptions_Features_field_number protoreflect.FieldNumber = 1 OneofOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999 ) // Names for google.protobuf.EnumOptions. const ( EnumOptions_message_name protoreflect.Name = "EnumOptions" EnumOptions_message_fullname protoreflect.FullName = "google.protobuf.EnumOptions" ) // Field names for google.protobuf.EnumOptions. const ( EnumOptions_AllowAlias_field_name protoreflect.Name = "allow_alias" EnumOptions_Deprecated_field_name protoreflect.Name = "deprecated" EnumOptions_DeprecatedLegacyJsonFieldConflicts_field_name protoreflect.Name = "deprecated_legacy_json_field_conflicts" EnumOptions_Features_field_name protoreflect.Name = "features" EnumOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option" EnumOptions_AllowAlias_field_fullname protoreflect.FullName = "google.protobuf.EnumOptions.allow_alias" EnumOptions_Deprecated_field_fullname protoreflect.FullName = "google.protobuf.EnumOptions.deprecated" EnumOptions_DeprecatedLegacyJsonFieldConflicts_field_fullname protoreflect.FullName = "google.protobuf.EnumOptions.deprecated_legacy_json_field_conflicts" EnumOptions_Features_field_fullname protoreflect.FullName = "google.protobuf.EnumOptions.features" EnumOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.EnumOptions.uninterpreted_option" ) // Field numbers for google.protobuf.EnumOptions. const ( EnumOptions_AllowAlias_field_number protoreflect.FieldNumber = 2 EnumOptions_Deprecated_field_number protoreflect.FieldNumber = 3 EnumOptions_DeprecatedLegacyJsonFieldConflicts_field_number protoreflect.FieldNumber = 6 EnumOptions_Features_field_number protoreflect.FieldNumber = 7 EnumOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999 ) // Names for google.protobuf.EnumValueOptions. const ( EnumValueOptions_message_name protoreflect.Name = "EnumValueOptions" EnumValueOptions_message_fullname protoreflect.FullName = "google.protobuf.EnumValueOptions" ) // Field names for google.protobuf.EnumValueOptions. const ( EnumValueOptions_Deprecated_field_name protoreflect.Name = "deprecated" EnumValueOptions_Features_field_name protoreflect.Name = "features" EnumValueOptions_DebugRedact_field_name protoreflect.Name = "debug_redact" EnumValueOptions_FeatureSupport_field_name protoreflect.Name = "feature_support" EnumValueOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option" EnumValueOptions_Deprecated_field_fullname protoreflect.FullName = "google.protobuf.EnumValueOptions.deprecated" EnumValueOptions_Features_field_fullname protoreflect.FullName = "google.protobuf.EnumValueOptions.features" EnumValueOptions_DebugRedact_field_fullname protoreflect.FullName = "google.protobuf.EnumValueOptions.debug_redact" EnumValueOptions_FeatureSupport_field_fullname protoreflect.FullName = "google.protobuf.EnumValueOptions.feature_support" EnumValueOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.EnumValueOptions.uninterpreted_option" ) // Field numbers for google.protobuf.EnumValueOptions. const ( EnumValueOptions_Deprecated_field_number protoreflect.FieldNumber = 1 EnumValueOptions_Features_field_number protoreflect.FieldNumber = 2 EnumValueOptions_DebugRedact_field_number protoreflect.FieldNumber = 3 EnumValueOptions_FeatureSupport_field_number protoreflect.FieldNumber = 4 EnumValueOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999 ) // Names for google.protobuf.ServiceOptions. const ( ServiceOptions_message_name protoreflect.Name = "ServiceOptions" ServiceOptions_message_fullname protoreflect.FullName = "google.protobuf.ServiceOptions" ) // Field names for google.protobuf.ServiceOptions. const ( ServiceOptions_Features_field_name protoreflect.Name = "features" ServiceOptions_Deprecated_field_name protoreflect.Name = "deprecated" ServiceOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option" ServiceOptions_Features_field_fullname protoreflect.FullName = "google.protobuf.ServiceOptions.features" ServiceOptions_Deprecated_field_fullname protoreflect.FullName = "google.protobuf.ServiceOptions.deprecated" ServiceOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.ServiceOptions.uninterpreted_option" ) // Field numbers for google.protobuf.ServiceOptions. const ( ServiceOptions_Features_field_number protoreflect.FieldNumber = 34 ServiceOptions_Deprecated_field_number protoreflect.FieldNumber = 33 ServiceOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999 ) // Names for google.protobuf.MethodOptions. const ( MethodOptions_message_name protoreflect.Name = "MethodOptions" MethodOptions_message_fullname protoreflect.FullName = "google.protobuf.MethodOptions" ) // Field names for google.protobuf.MethodOptions. const ( MethodOptions_Deprecated_field_name protoreflect.Name = "deprecated" MethodOptions_IdempotencyLevel_field_name protoreflect.Name = "idempotency_level" MethodOptions_Features_field_name protoreflect.Name = "features" MethodOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option" MethodOptions_Deprecated_field_fullname protoreflect.FullName = "google.protobuf.MethodOptions.deprecated" MethodOptions_IdempotencyLevel_field_fullname protoreflect.FullName = "google.protobuf.MethodOptions.idempotency_level" MethodOptions_Features_field_fullname protoreflect.FullName = "google.protobuf.MethodOptions.features" MethodOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.MethodOptions.uninterpreted_option" ) // Field numbers for google.protobuf.MethodOptions. const ( MethodOptions_Deprecated_field_number protoreflect.FieldNumber = 33 MethodOptions_IdempotencyLevel_field_number protoreflect.FieldNumber = 34 MethodOptions_Features_field_number protoreflect.FieldNumber = 35 MethodOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999 ) // Full and short names for google.protobuf.MethodOptions.IdempotencyLevel. const ( MethodOptions_IdempotencyLevel_enum_fullname = "google.protobuf.MethodOptions.IdempotencyLevel" MethodOptions_IdempotencyLevel_enum_name = "IdempotencyLevel" ) // Enum values for google.protobuf.MethodOptions.IdempotencyLevel. const ( MethodOptions_IDEMPOTENCY_UNKNOWN_enum_value = 0 MethodOptions_NO_SIDE_EFFECTS_enum_value = 1 MethodOptions_IDEMPOTENT_enum_value = 2 ) // Names for google.protobuf.UninterpretedOption. const ( UninterpretedOption_message_name protoreflect.Name = "UninterpretedOption" UninterpretedOption_message_fullname protoreflect.FullName = "google.protobuf.UninterpretedOption" ) // Field names for google.protobuf.UninterpretedOption. const ( UninterpretedOption_Name_field_name protoreflect.Name = "name" UninterpretedOption_IdentifierValue_field_name protoreflect.Name = "identifier_value" UninterpretedOption_PositiveIntValue_field_name protoreflect.Name = "positive_int_value" UninterpretedOption_NegativeIntValue_field_name protoreflect.Name = "negative_int_value" UninterpretedOption_DoubleValue_field_name protoreflect.Name = "double_value" UninterpretedOption_StringValue_field_name protoreflect.Name = "string_value" UninterpretedOption_AggregateValue_field_name protoreflect.Name = "aggregate_value" UninterpretedOption_Name_field_fullname protoreflect.FullName = "google.protobuf.UninterpretedOption.name" UninterpretedOption_IdentifierValue_field_fullname protoreflect.FullName = "google.protobuf.UninterpretedOption.identifier_value" UninterpretedOption_PositiveIntValue_field_fullname protoreflect.FullName = "google.protobuf.UninterpretedOption.positive_int_value" UninterpretedOption_NegativeIntValue_field_fullname protoreflect.FullName = "google.protobuf.UninterpretedOption.negative_int_value" UninterpretedOption_DoubleValue_field_fullname protoreflect.FullName = "google.protobuf.UninterpretedOption.double_value" UninterpretedOption_StringValue_field_fullname protoreflect.FullName = "google.protobuf.UninterpretedOption.string_value" UninterpretedOption_AggregateValue_field_fullname protoreflect.FullName = "google.protobuf.UninterpretedOption.aggregate_value" ) // Field numbers for google.protobuf.UninterpretedOption. const ( UninterpretedOption_Name_field_number protoreflect.FieldNumber = 2 UninterpretedOption_IdentifierValue_field_number protoreflect.FieldNumber = 3 UninterpretedOption_PositiveIntValue_field_number protoreflect.FieldNumber = 4 UninterpretedOption_NegativeIntValue_field_number protoreflect.FieldNumber = 5 UninterpretedOption_DoubleValue_field_number protoreflect.FieldNumber = 6 UninterpretedOption_StringValue_field_number protoreflect.FieldNumber = 7 UninterpretedOption_AggregateValue_field_number protoreflect.FieldNumber = 8 ) // Names for google.protobuf.UninterpretedOption.NamePart. const ( UninterpretedOption_NamePart_message_name protoreflect.Name = "NamePart" UninterpretedOption_NamePart_message_fullname protoreflect.FullName = "google.protobuf.UninterpretedOption.NamePart" ) // Field names for google.protobuf.UninterpretedOption.NamePart. const ( UninterpretedOption_NamePart_NamePart_field_name protoreflect.Name = "name_part" UninterpretedOption_NamePart_IsExtension_field_name protoreflect.Name = "is_extension" UninterpretedOption_NamePart_NamePart_field_fullname protoreflect.FullName = "google.protobuf.UninterpretedOption.NamePart.name_part" UninterpretedOption_NamePart_IsExtension_field_fullname protoreflect.FullName = "google.protobuf.UninterpretedOption.NamePart.is_extension" ) // Field numbers for google.protobuf.UninterpretedOption.NamePart. const ( UninterpretedOption_NamePart_NamePart_field_number protoreflect.FieldNumber = 1 UninterpretedOption_NamePart_IsExtension_field_number protoreflect.FieldNumber = 2 ) // Names for google.protobuf.FeatureSet. const ( FeatureSet_message_name protoreflect.Name = "FeatureSet" FeatureSet_message_fullname protoreflect.FullName = "google.protobuf.FeatureSet" ) // Field names for google.protobuf.FeatureSet. const ( FeatureSet_FieldPresence_field_name protoreflect.Name = "field_presence" FeatureSet_EnumType_field_name protoreflect.Name = "enum_type" FeatureSet_RepeatedFieldEncoding_field_name protoreflect.Name = "repeated_field_encoding" FeatureSet_Utf8Validation_field_name protoreflect.Name = "utf8_validation" FeatureSet_MessageEncoding_field_name protoreflect.Name = "message_encoding" FeatureSet_JsonFormat_field_name protoreflect.Name = "json_format" FeatureSet_EnforceNamingStyle_field_name protoreflect.Name = "enforce_naming_style" FeatureSet_DefaultSymbolVisibility_field_name protoreflect.Name = "default_symbol_visibility" FeatureSet_FieldPresence_field_fullname protoreflect.FullName = "google.protobuf.FeatureSet.field_presence" FeatureSet_EnumType_field_fullname protoreflect.FullName = "google.protobuf.FeatureSet.enum_type" FeatureSet_RepeatedFieldEncoding_field_fullname protoreflect.FullName = "google.protobuf.FeatureSet.repeated_field_encoding" FeatureSet_Utf8Validation_field_fullname protoreflect.FullName = "google.protobuf.FeatureSet.utf8_validation" FeatureSet_MessageEncoding_field_fullname protoreflect.FullName = "google.protobuf.FeatureSet.message_encoding" FeatureSet_JsonFormat_field_fullname protoreflect.FullName = "google.protobuf.FeatureSet.json_format" FeatureSet_EnforceNamingStyle_field_fullname protoreflect.FullName = "google.protobuf.FeatureSet.enforce_naming_style" FeatureSet_DefaultSymbolVisibility_field_fullname protoreflect.FullName = "google.protobuf.FeatureSet.default_symbol_visibility" ) // Field numbers for google.protobuf.FeatureSet. const ( FeatureSet_FieldPresence_field_number protoreflect.FieldNumber = 1 FeatureSet_EnumType_field_number protoreflect.FieldNumber = 2 FeatureSet_RepeatedFieldEncoding_field_number protoreflect.FieldNumber = 3 FeatureSet_Utf8Validation_field_number protoreflect.FieldNumber = 4 FeatureSet_MessageEncoding_field_number protoreflect.FieldNumber = 5 FeatureSet_JsonFormat_field_number protoreflect.FieldNumber = 6 FeatureSet_EnforceNamingStyle_field_number protoreflect.FieldNumber = 7 FeatureSet_DefaultSymbolVisibility_field_number protoreflect.FieldNumber = 8 ) // Full and short names for google.protobuf.FeatureSet.FieldPresence. const ( FeatureSet_FieldPresence_enum_fullname = "google.protobuf.FeatureSet.FieldPresence" FeatureSet_FieldPresence_enum_name = "FieldPresence" ) // Enum values for google.protobuf.FeatureSet.FieldPresence. const ( FeatureSet_FIELD_PRESENCE_UNKNOWN_enum_value = 0 FeatureSet_EXPLICIT_enum_value = 1 FeatureSet_IMPLICIT_enum_value = 2 FeatureSet_LEGACY_REQUIRED_enum_value = 3 ) // Full and short names for google.protobuf.FeatureSet.EnumType. const ( FeatureSet_EnumType_enum_fullname = "google.protobuf.FeatureSet.EnumType" FeatureSet_EnumType_enum_name = "EnumType" ) // Enum values for google.protobuf.FeatureSet.EnumType. const ( FeatureSet_ENUM_TYPE_UNKNOWN_enum_value = 0 FeatureSet_OPEN_enum_value = 1 FeatureSet_CLOSED_enum_value = 2 ) // Full and short names for google.protobuf.FeatureSet.RepeatedFieldEncoding. const ( FeatureSet_RepeatedFieldEncoding_enum_fullname = "google.protobuf.FeatureSet.RepeatedFieldEncoding" FeatureSet_RepeatedFieldEncoding_enum_name = "RepeatedFieldEncoding" ) // Enum values for google.protobuf.FeatureSet.RepeatedFieldEncoding. const ( FeatureSet_REPEATED_FIELD_ENCODING_UNKNOWN_enum_value = 0 FeatureSet_PACKED_enum_value = 1 FeatureSet_EXPANDED_enum_value = 2 ) // Full and short names for google.protobuf.FeatureSet.Utf8Validation. const ( FeatureSet_Utf8Validation_enum_fullname = "google.protobuf.FeatureSet.Utf8Validation" FeatureSet_Utf8Validation_enum_name = "Utf8Validation" ) // Enum values for google.protobuf.FeatureSet.Utf8Validation. const ( FeatureSet_UTF8_VALIDATION_UNKNOWN_enum_value = 0 FeatureSet_VERIFY_enum_value = 2 FeatureSet_NONE_enum_value = 3 ) // Full and short names for google.protobuf.FeatureSet.MessageEncoding. const ( FeatureSet_MessageEncoding_enum_fullname = "google.protobuf.FeatureSet.MessageEncoding" FeatureSet_MessageEncoding_enum_name = "MessageEncoding" ) // Enum values for google.protobuf.FeatureSet.MessageEncoding. const ( FeatureSet_MESSAGE_ENCODING_UNKNOWN_enum_value = 0 FeatureSet_LENGTH_PREFIXED_enum_value = 1 FeatureSet_DELIMITED_enum_value = 2 ) // Full and short names for google.protobuf.FeatureSet.JsonFormat. const ( FeatureSet_JsonFormat_enum_fullname = "google.protobuf.FeatureSet.JsonFormat" FeatureSet_JsonFormat_enum_name = "JsonFormat" ) // Enum values for google.protobuf.FeatureSet.JsonFormat. const ( FeatureSet_JSON_FORMAT_UNKNOWN_enum_value = 0 FeatureSet_ALLOW_enum_value = 1 FeatureSet_LEGACY_BEST_EFFORT_enum_value = 2 ) // Full and short names for google.protobuf.FeatureSet.EnforceNamingStyle. const ( FeatureSet_EnforceNamingStyle_enum_fullname = "google.protobuf.FeatureSet.EnforceNamingStyle" FeatureSet_EnforceNamingStyle_enum_name = "EnforceNamingStyle" ) // Enum values for google.protobuf.FeatureSet.EnforceNamingStyle. const ( FeatureSet_ENFORCE_NAMING_STYLE_UNKNOWN_enum_value = 0 FeatureSet_STYLE2024_enum_value = 1 FeatureSet_STYLE_LEGACY_enum_value = 2 ) // Names for google.protobuf.FeatureSet.VisibilityFeature. const ( FeatureSet_VisibilityFeature_message_name protoreflect.Name = "VisibilityFeature" FeatureSet_VisibilityFeature_message_fullname protoreflect.FullName = "google.protobuf.FeatureSet.VisibilityFeature" ) // Full and short names for google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility. const ( FeatureSet_VisibilityFeature_DefaultSymbolVisibility_enum_fullname = "google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility" FeatureSet_VisibilityFeature_DefaultSymbolVisibility_enum_name = "DefaultSymbolVisibility" ) // Enum values for google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility. const ( FeatureSet_VisibilityFeature_DEFAULT_SYMBOL_VISIBILITY_UNKNOWN_enum_value = 0 FeatureSet_VisibilityFeature_EXPORT_ALL_enum_value = 1 FeatureSet_VisibilityFeature_EXPORT_TOP_LEVEL_enum_value = 2 FeatureSet_VisibilityFeature_LOCAL_ALL_enum_value = 3 FeatureSet_VisibilityFeature_STRICT_enum_value = 4 ) // Names for google.protobuf.FeatureSetDefaults. const ( FeatureSetDefaults_message_name protoreflect.Name = "FeatureSetDefaults" FeatureSetDefaults_message_fullname protoreflect.FullName = "google.protobuf.FeatureSetDefaults" ) // Field names for google.protobuf.FeatureSetDefaults. const ( FeatureSetDefaults_Defaults_field_name protoreflect.Name = "defaults" FeatureSetDefaults_MinimumEdition_field_name protoreflect.Name = "minimum_edition" FeatureSetDefaults_MaximumEdition_field_name protoreflect.Name = "maximum_edition" FeatureSetDefaults_Defaults_field_fullname protoreflect.FullName = "google.protobuf.FeatureSetDefaults.defaults" FeatureSetDefaults_MinimumEdition_field_fullname protoreflect.FullName = "google.protobuf.FeatureSetDefaults.minimum_edition" FeatureSetDefaults_MaximumEdition_field_fullname protoreflect.FullName = "google.protobuf.FeatureSetDefaults.maximum_edition" ) // Field numbers for google.protobuf.FeatureSetDefaults. const ( FeatureSetDefaults_Defaults_field_number protoreflect.FieldNumber = 1 FeatureSetDefaults_MinimumEdition_field_number protoreflect.FieldNumber = 4 FeatureSetDefaults_MaximumEdition_field_number protoreflect.FieldNumber = 5 ) // Names for google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault. const ( FeatureSetDefaults_FeatureSetEditionDefault_message_name protoreflect.Name = "FeatureSetEditionDefault" FeatureSetDefaults_FeatureSetEditionDefault_message_fullname protoreflect.FullName = "google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault" ) // Field names for google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault. const ( FeatureSetDefaults_FeatureSetEditionDefault_Edition_field_name protoreflect.Name = "edition" FeatureSetDefaults_FeatureSetEditionDefault_OverridableFeatures_field_name protoreflect.Name = "overridable_features" FeatureSetDefaults_FeatureSetEditionDefault_FixedFeatures_field_name protoreflect.Name = "fixed_features" FeatureSetDefaults_FeatureSetEditionDefault_Edition_field_fullname protoreflect.FullName = "google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.edition" FeatureSetDefaults_FeatureSetEditionDefault_OverridableFeatures_field_fullname protoreflect.FullName = "google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.overridable_features" FeatureSetDefaults_FeatureSetEditionDefault_FixedFeatures_field_fullname protoreflect.FullName = "google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fixed_features" ) // Field numbers for google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault. const ( FeatureSetDefaults_FeatureSetEditionDefault_Edition_field_number protoreflect.FieldNumber = 3 FeatureSetDefaults_FeatureSetEditionDefault_OverridableFeatures_field_number protoreflect.FieldNumber = 4 FeatureSetDefaults_FeatureSetEditionDefault_FixedFeatures_field_number protoreflect.FieldNumber = 5 ) // Names for google.protobuf.SourceCodeInfo. const ( SourceCodeInfo_message_name protoreflect.Name = "SourceCodeInfo" SourceCodeInfo_message_fullname protoreflect.FullName = "google.protobuf.SourceCodeInfo" ) // Field names for google.protobuf.SourceCodeInfo. const ( SourceCodeInfo_Location_field_name protoreflect.Name = "location" SourceCodeInfo_Location_field_fullname protoreflect.FullName = "google.protobuf.SourceCodeInfo.location" ) // Field numbers for google.protobuf.SourceCodeInfo. const ( SourceCodeInfo_Location_field_number protoreflect.FieldNumber = 1 ) // Names for google.protobuf.SourceCodeInfo.Location. const ( SourceCodeInfo_Location_message_name protoreflect.Name = "Location" SourceCodeInfo_Location_message_fullname protoreflect.FullName = "google.protobuf.SourceCodeInfo.Location" ) // Field names for google.protobuf.SourceCodeInfo.Location. const ( SourceCodeInfo_Location_Path_field_name protoreflect.Name = "path" SourceCodeInfo_Location_Span_field_name protoreflect.Name = "span" SourceCodeInfo_Location_LeadingComments_field_name protoreflect.Name = "leading_comments" SourceCodeInfo_Location_TrailingComments_field_name protoreflect.Name = "trailing_comments" SourceCodeInfo_Location_LeadingDetachedComments_field_name protoreflect.Name = "leading_detached_comments" SourceCodeInfo_Location_Path_field_fullname protoreflect.FullName = "google.protobuf.SourceCodeInfo.Location.path" SourceCodeInfo_Location_Span_field_fullname protoreflect.FullName = "google.protobuf.SourceCodeInfo.Location.span" SourceCodeInfo_Location_LeadingComments_field_fullname protoreflect.FullName = "google.protobuf.SourceCodeInfo.Location.leading_comments" SourceCodeInfo_Location_TrailingComments_field_fullname protoreflect.FullName = "google.protobuf.SourceCodeInfo.Location.trailing_comments" SourceCodeInfo_Location_LeadingDetachedComments_field_fullname protoreflect.FullName = "google.protobuf.SourceCodeInfo.Location.leading_detached_comments" ) // Field numbers for google.protobuf.SourceCodeInfo.Location. const ( SourceCodeInfo_Location_Path_field_number protoreflect.FieldNumber = 1 SourceCodeInfo_Location_Span_field_number protoreflect.FieldNumber = 2 SourceCodeInfo_Location_LeadingComments_field_number protoreflect.FieldNumber = 3 SourceCodeInfo_Location_TrailingComments_field_number protoreflect.FieldNumber = 4 SourceCodeInfo_Location_LeadingDetachedComments_field_number protoreflect.FieldNumber = 6 ) // Names for google.protobuf.GeneratedCodeInfo. const ( GeneratedCodeInfo_message_name protoreflect.Name = "GeneratedCodeInfo" GeneratedCodeInfo_message_fullname protoreflect.FullName = "google.protobuf.GeneratedCodeInfo" ) // Field names for google.protobuf.GeneratedCodeInfo. const ( GeneratedCodeInfo_Annotation_field_name protoreflect.Name = "annotation" GeneratedCodeInfo_Annotation_field_fullname protoreflect.FullName = "google.protobuf.GeneratedCodeInfo.annotation" ) // Field numbers for google.protobuf.GeneratedCodeInfo. const ( GeneratedCodeInfo_Annotation_field_number protoreflect.FieldNumber = 1 ) // Names for google.protobuf.GeneratedCodeInfo.Annotation. const ( GeneratedCodeInfo_Annotation_message_name protoreflect.Name = "Annotation" GeneratedCodeInfo_Annotation_message_fullname protoreflect.FullName = "google.protobuf.GeneratedCodeInfo.Annotation" ) // Field names for google.protobuf.GeneratedCodeInfo.Annotation. const ( GeneratedCodeInfo_Annotation_Path_field_name protoreflect.Name = "path" GeneratedCodeInfo_Annotation_SourceFile_field_name protoreflect.Name = "source_file" GeneratedCodeInfo_Annotation_Begin_field_name protoreflect.Name = "begin" GeneratedCodeInfo_Annotation_End_field_name protoreflect.Name = "end" GeneratedCodeInfo_Annotation_Semantic_field_name protoreflect.Name = "semantic" GeneratedCodeInfo_Annotation_Path_field_fullname protoreflect.FullName = "google.protobuf.GeneratedCodeInfo.Annotation.path" GeneratedCodeInfo_Annotation_SourceFile_field_fullname protoreflect.FullName = "google.protobuf.GeneratedCodeInfo.Annotation.source_file" GeneratedCodeInfo_Annotation_Begin_field_fullname protoreflect.FullName = "google.protobuf.GeneratedCodeInfo.Annotation.begin" GeneratedCodeInfo_Annotation_End_field_fullname protoreflect.FullName = "google.protobuf.GeneratedCodeInfo.Annotation.end" GeneratedCodeInfo_Annotation_Semantic_field_fullname protoreflect.FullName = "google.protobuf.GeneratedCodeInfo.Annotation.semantic" ) // Field numbers for google.protobuf.GeneratedCodeInfo.Annotation. const ( GeneratedCodeInfo_Annotation_Path_field_number protoreflect.FieldNumber = 1 GeneratedCodeInfo_Annotation_SourceFile_field_number protoreflect.FieldNumber = 2 GeneratedCodeInfo_Annotation_Begin_field_number protoreflect.FieldNumber = 3 GeneratedCodeInfo_Annotation_End_field_number protoreflect.FieldNumber = 4 GeneratedCodeInfo_Annotation_Semantic_field_number protoreflect.FieldNumber = 5 ) // Full and short names for google.protobuf.GeneratedCodeInfo.Annotation.Semantic. const ( GeneratedCodeInfo_Annotation_Semantic_enum_fullname = "google.protobuf.GeneratedCodeInfo.Annotation.Semantic" GeneratedCodeInfo_Annotation_Semantic_enum_name = "Semantic" ) // Enum values for google.protobuf.GeneratedCodeInfo.Annotation.Semantic. const ( GeneratedCodeInfo_Annotation_NONE_enum_value = 0 GeneratedCodeInfo_Annotation_SET_enum_value = 1 GeneratedCodeInfo_Annotation_ALIAS_enum_value = 2 ) ================================================ FILE: vendor/google.golang.org/protobuf/internal/genid/doc.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package genid contains constants for declarations in descriptor.proto // and the well-known types. package genid import "google.golang.org/protobuf/reflect/protoreflect" const GoogleProtobuf_package protoreflect.FullName = "google.protobuf" ================================================ FILE: vendor/google.golang.org/protobuf/internal/genid/duration_gen.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Code generated by generate-protos. DO NOT EDIT. package genid import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" ) const File_google_protobuf_duration_proto = "google/protobuf/duration.proto" // Names for google.protobuf.Duration. const ( Duration_message_name protoreflect.Name = "Duration" Duration_message_fullname protoreflect.FullName = "google.protobuf.Duration" ) // Field names for google.protobuf.Duration. const ( Duration_Seconds_field_name protoreflect.Name = "seconds" Duration_Nanos_field_name protoreflect.Name = "nanos" Duration_Seconds_field_fullname protoreflect.FullName = "google.protobuf.Duration.seconds" Duration_Nanos_field_fullname protoreflect.FullName = "google.protobuf.Duration.nanos" ) // Field numbers for google.protobuf.Duration. const ( Duration_Seconds_field_number protoreflect.FieldNumber = 1 Duration_Nanos_field_number protoreflect.FieldNumber = 2 ) ================================================ FILE: vendor/google.golang.org/protobuf/internal/genid/empty_gen.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Code generated by generate-protos. DO NOT EDIT. package genid import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" ) const File_google_protobuf_empty_proto = "google/protobuf/empty.proto" // Names for google.protobuf.Empty. const ( Empty_message_name protoreflect.Name = "Empty" Empty_message_fullname protoreflect.FullName = "google.protobuf.Empty" ) ================================================ FILE: vendor/google.golang.org/protobuf/internal/genid/field_mask_gen.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Code generated by generate-protos. DO NOT EDIT. package genid import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" ) const File_google_protobuf_field_mask_proto = "google/protobuf/field_mask.proto" // Names for google.protobuf.FieldMask. const ( FieldMask_message_name protoreflect.Name = "FieldMask" FieldMask_message_fullname protoreflect.FullName = "google.protobuf.FieldMask" ) // Field names for google.protobuf.FieldMask. const ( FieldMask_Paths_field_name protoreflect.Name = "paths" FieldMask_Paths_field_fullname protoreflect.FullName = "google.protobuf.FieldMask.paths" ) // Field numbers for google.protobuf.FieldMask. const ( FieldMask_Paths_field_number protoreflect.FieldNumber = 1 ) ================================================ FILE: vendor/google.golang.org/protobuf/internal/genid/go_features_gen.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Code generated by generate-protos. DO NOT EDIT. package genid import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" ) const File_google_protobuf_go_features_proto = "google/protobuf/go_features.proto" // Names for pb.GoFeatures. const ( GoFeatures_message_name protoreflect.Name = "GoFeatures" GoFeatures_message_fullname protoreflect.FullName = "pb.GoFeatures" ) // Field names for pb.GoFeatures. const ( GoFeatures_LegacyUnmarshalJsonEnum_field_name protoreflect.Name = "legacy_unmarshal_json_enum" GoFeatures_ApiLevel_field_name protoreflect.Name = "api_level" GoFeatures_StripEnumPrefix_field_name protoreflect.Name = "strip_enum_prefix" GoFeatures_LegacyUnmarshalJsonEnum_field_fullname protoreflect.FullName = "pb.GoFeatures.legacy_unmarshal_json_enum" GoFeatures_ApiLevel_field_fullname protoreflect.FullName = "pb.GoFeatures.api_level" GoFeatures_StripEnumPrefix_field_fullname protoreflect.FullName = "pb.GoFeatures.strip_enum_prefix" ) // Field numbers for pb.GoFeatures. const ( GoFeatures_LegacyUnmarshalJsonEnum_field_number protoreflect.FieldNumber = 1 GoFeatures_ApiLevel_field_number protoreflect.FieldNumber = 2 GoFeatures_StripEnumPrefix_field_number protoreflect.FieldNumber = 3 ) // Full and short names for pb.GoFeatures.APILevel. const ( GoFeatures_APILevel_enum_fullname = "pb.GoFeatures.APILevel" GoFeatures_APILevel_enum_name = "APILevel" ) // Enum values for pb.GoFeatures.APILevel. const ( GoFeatures_API_LEVEL_UNSPECIFIED_enum_value = 0 GoFeatures_API_OPEN_enum_value = 1 GoFeatures_API_HYBRID_enum_value = 2 GoFeatures_API_OPAQUE_enum_value = 3 ) // Full and short names for pb.GoFeatures.StripEnumPrefix. const ( GoFeatures_StripEnumPrefix_enum_fullname = "pb.GoFeatures.StripEnumPrefix" GoFeatures_StripEnumPrefix_enum_name = "StripEnumPrefix" ) // Enum values for pb.GoFeatures.StripEnumPrefix. const ( GoFeatures_STRIP_ENUM_PREFIX_UNSPECIFIED_enum_value = 0 GoFeatures_STRIP_ENUM_PREFIX_KEEP_enum_value = 1 GoFeatures_STRIP_ENUM_PREFIX_GENERATE_BOTH_enum_value = 2 GoFeatures_STRIP_ENUM_PREFIX_STRIP_enum_value = 3 ) // Extension numbers const ( FeatureSet_Go_ext_number protoreflect.FieldNumber = 1002 ) ================================================ FILE: vendor/google.golang.org/protobuf/internal/genid/goname.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package genid // Go names of implementation-specific struct fields in generated messages. const ( State_goname = "state" SizeCache_goname = "sizeCache" SizeCacheA_goname = "XXX_sizecache" UnknownFields_goname = "unknownFields" UnknownFieldsA_goname = "XXX_unrecognized" ExtensionFields_goname = "extensionFields" ExtensionFieldsA_goname = "XXX_InternalExtensions" ExtensionFieldsB_goname = "XXX_extensions" ) ================================================ FILE: vendor/google.golang.org/protobuf/internal/genid/map_entry.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package genid import "google.golang.org/protobuf/reflect/protoreflect" // Generic field names and numbers for synthetic map entry messages. const ( MapEntry_Key_field_name protoreflect.Name = "key" MapEntry_Value_field_name protoreflect.Name = "value" MapEntry_Key_field_number protoreflect.FieldNumber = 1 MapEntry_Value_field_number protoreflect.FieldNumber = 2 ) ================================================ FILE: vendor/google.golang.org/protobuf/internal/genid/name.go ================================================ // Copyright 2024 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package genid const ( NoUnkeyedLiteral_goname = "noUnkeyedLiteral" NoUnkeyedLiteralA_goname = "XXX_NoUnkeyedLiteral" BuilderSuffix_goname = "_builder" ) ================================================ FILE: vendor/google.golang.org/protobuf/internal/genid/source_context_gen.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Code generated by generate-protos. DO NOT EDIT. package genid import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" ) const File_google_protobuf_source_context_proto = "google/protobuf/source_context.proto" // Names for google.protobuf.SourceContext. const ( SourceContext_message_name protoreflect.Name = "SourceContext" SourceContext_message_fullname protoreflect.FullName = "google.protobuf.SourceContext" ) // Field names for google.protobuf.SourceContext. const ( SourceContext_FileName_field_name protoreflect.Name = "file_name" SourceContext_FileName_field_fullname protoreflect.FullName = "google.protobuf.SourceContext.file_name" ) // Field numbers for google.protobuf.SourceContext. const ( SourceContext_FileName_field_number protoreflect.FieldNumber = 1 ) ================================================ FILE: vendor/google.golang.org/protobuf/internal/genid/struct_gen.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Code generated by generate-protos. DO NOT EDIT. package genid import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" ) const File_google_protobuf_struct_proto = "google/protobuf/struct.proto" // Full and short names for google.protobuf.NullValue. const ( NullValue_enum_fullname = "google.protobuf.NullValue" NullValue_enum_name = "NullValue" ) // Enum values for google.protobuf.NullValue. const ( NullValue_NULL_VALUE_enum_value = 0 ) // Names for google.protobuf.Struct. const ( Struct_message_name protoreflect.Name = "Struct" Struct_message_fullname protoreflect.FullName = "google.protobuf.Struct" ) // Field names for google.protobuf.Struct. const ( Struct_Fields_field_name protoreflect.Name = "fields" Struct_Fields_field_fullname protoreflect.FullName = "google.protobuf.Struct.fields" ) // Field numbers for google.protobuf.Struct. const ( Struct_Fields_field_number protoreflect.FieldNumber = 1 ) // Names for google.protobuf.Struct.FieldsEntry. const ( Struct_FieldsEntry_message_name protoreflect.Name = "FieldsEntry" Struct_FieldsEntry_message_fullname protoreflect.FullName = "google.protobuf.Struct.FieldsEntry" ) // Field names for google.protobuf.Struct.FieldsEntry. const ( Struct_FieldsEntry_Key_field_name protoreflect.Name = "key" Struct_FieldsEntry_Value_field_name protoreflect.Name = "value" Struct_FieldsEntry_Key_field_fullname protoreflect.FullName = "google.protobuf.Struct.FieldsEntry.key" Struct_FieldsEntry_Value_field_fullname protoreflect.FullName = "google.protobuf.Struct.FieldsEntry.value" ) // Field numbers for google.protobuf.Struct.FieldsEntry. const ( Struct_FieldsEntry_Key_field_number protoreflect.FieldNumber = 1 Struct_FieldsEntry_Value_field_number protoreflect.FieldNumber = 2 ) // Names for google.protobuf.Value. const ( Value_message_name protoreflect.Name = "Value" Value_message_fullname protoreflect.FullName = "google.protobuf.Value" ) // Field names for google.protobuf.Value. const ( Value_NullValue_field_name protoreflect.Name = "null_value" Value_NumberValue_field_name protoreflect.Name = "number_value" Value_StringValue_field_name protoreflect.Name = "string_value" Value_BoolValue_field_name protoreflect.Name = "bool_value" Value_StructValue_field_name protoreflect.Name = "struct_value" Value_ListValue_field_name protoreflect.Name = "list_value" Value_NullValue_field_fullname protoreflect.FullName = "google.protobuf.Value.null_value" Value_NumberValue_field_fullname protoreflect.FullName = "google.protobuf.Value.number_value" Value_StringValue_field_fullname protoreflect.FullName = "google.protobuf.Value.string_value" Value_BoolValue_field_fullname protoreflect.FullName = "google.protobuf.Value.bool_value" Value_StructValue_field_fullname protoreflect.FullName = "google.protobuf.Value.struct_value" Value_ListValue_field_fullname protoreflect.FullName = "google.protobuf.Value.list_value" ) // Field numbers for google.protobuf.Value. const ( Value_NullValue_field_number protoreflect.FieldNumber = 1 Value_NumberValue_field_number protoreflect.FieldNumber = 2 Value_StringValue_field_number protoreflect.FieldNumber = 3 Value_BoolValue_field_number protoreflect.FieldNumber = 4 Value_StructValue_field_number protoreflect.FieldNumber = 5 Value_ListValue_field_number protoreflect.FieldNumber = 6 ) // Oneof names for google.protobuf.Value. const ( Value_Kind_oneof_name protoreflect.Name = "kind" Value_Kind_oneof_fullname protoreflect.FullName = "google.protobuf.Value.kind" ) // Names for google.protobuf.ListValue. const ( ListValue_message_name protoreflect.Name = "ListValue" ListValue_message_fullname protoreflect.FullName = "google.protobuf.ListValue" ) // Field names for google.protobuf.ListValue. const ( ListValue_Values_field_name protoreflect.Name = "values" ListValue_Values_field_fullname protoreflect.FullName = "google.protobuf.ListValue.values" ) // Field numbers for google.protobuf.ListValue. const ( ListValue_Values_field_number protoreflect.FieldNumber = 1 ) ================================================ FILE: vendor/google.golang.org/protobuf/internal/genid/timestamp_gen.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Code generated by generate-protos. DO NOT EDIT. package genid import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" ) const File_google_protobuf_timestamp_proto = "google/protobuf/timestamp.proto" // Names for google.protobuf.Timestamp. const ( Timestamp_message_name protoreflect.Name = "Timestamp" Timestamp_message_fullname protoreflect.FullName = "google.protobuf.Timestamp" ) // Field names for google.protobuf.Timestamp. const ( Timestamp_Seconds_field_name protoreflect.Name = "seconds" Timestamp_Nanos_field_name protoreflect.Name = "nanos" Timestamp_Seconds_field_fullname protoreflect.FullName = "google.protobuf.Timestamp.seconds" Timestamp_Nanos_field_fullname protoreflect.FullName = "google.protobuf.Timestamp.nanos" ) // Field numbers for google.protobuf.Timestamp. const ( Timestamp_Seconds_field_number protoreflect.FieldNumber = 1 Timestamp_Nanos_field_number protoreflect.FieldNumber = 2 ) ================================================ FILE: vendor/google.golang.org/protobuf/internal/genid/type_gen.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Code generated by generate-protos. DO NOT EDIT. package genid import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" ) const File_google_protobuf_type_proto = "google/protobuf/type.proto" // Full and short names for google.protobuf.Syntax. const ( Syntax_enum_fullname = "google.protobuf.Syntax" Syntax_enum_name = "Syntax" ) // Enum values for google.protobuf.Syntax. const ( Syntax_SYNTAX_PROTO2_enum_value = 0 Syntax_SYNTAX_PROTO3_enum_value = 1 Syntax_SYNTAX_EDITIONS_enum_value = 2 ) // Names for google.protobuf.Type. const ( Type_message_name protoreflect.Name = "Type" Type_message_fullname protoreflect.FullName = "google.protobuf.Type" ) // Field names for google.protobuf.Type. const ( Type_Name_field_name protoreflect.Name = "name" Type_Fields_field_name protoreflect.Name = "fields" Type_Oneofs_field_name protoreflect.Name = "oneofs" Type_Options_field_name protoreflect.Name = "options" Type_SourceContext_field_name protoreflect.Name = "source_context" Type_Syntax_field_name protoreflect.Name = "syntax" Type_Edition_field_name protoreflect.Name = "edition" Type_Name_field_fullname protoreflect.FullName = "google.protobuf.Type.name" Type_Fields_field_fullname protoreflect.FullName = "google.protobuf.Type.fields" Type_Oneofs_field_fullname protoreflect.FullName = "google.protobuf.Type.oneofs" Type_Options_field_fullname protoreflect.FullName = "google.protobuf.Type.options" Type_SourceContext_field_fullname protoreflect.FullName = "google.protobuf.Type.source_context" Type_Syntax_field_fullname protoreflect.FullName = "google.protobuf.Type.syntax" Type_Edition_field_fullname protoreflect.FullName = "google.protobuf.Type.edition" ) // Field numbers for google.protobuf.Type. const ( Type_Name_field_number protoreflect.FieldNumber = 1 Type_Fields_field_number protoreflect.FieldNumber = 2 Type_Oneofs_field_number protoreflect.FieldNumber = 3 Type_Options_field_number protoreflect.FieldNumber = 4 Type_SourceContext_field_number protoreflect.FieldNumber = 5 Type_Syntax_field_number protoreflect.FieldNumber = 6 Type_Edition_field_number protoreflect.FieldNumber = 7 ) // Names for google.protobuf.Field. const ( Field_message_name protoreflect.Name = "Field" Field_message_fullname protoreflect.FullName = "google.protobuf.Field" ) // Field names for google.protobuf.Field. const ( Field_Kind_field_name protoreflect.Name = "kind" Field_Cardinality_field_name protoreflect.Name = "cardinality" Field_Number_field_name protoreflect.Name = "number" Field_Name_field_name protoreflect.Name = "name" Field_TypeUrl_field_name protoreflect.Name = "type_url" Field_OneofIndex_field_name protoreflect.Name = "oneof_index" Field_Packed_field_name protoreflect.Name = "packed" Field_Options_field_name protoreflect.Name = "options" Field_JsonName_field_name protoreflect.Name = "json_name" Field_DefaultValue_field_name protoreflect.Name = "default_value" Field_Kind_field_fullname protoreflect.FullName = "google.protobuf.Field.kind" Field_Cardinality_field_fullname protoreflect.FullName = "google.protobuf.Field.cardinality" Field_Number_field_fullname protoreflect.FullName = "google.protobuf.Field.number" Field_Name_field_fullname protoreflect.FullName = "google.protobuf.Field.name" Field_TypeUrl_field_fullname protoreflect.FullName = "google.protobuf.Field.type_url" Field_OneofIndex_field_fullname protoreflect.FullName = "google.protobuf.Field.oneof_index" Field_Packed_field_fullname protoreflect.FullName = "google.protobuf.Field.packed" Field_Options_field_fullname protoreflect.FullName = "google.protobuf.Field.options" Field_JsonName_field_fullname protoreflect.FullName = "google.protobuf.Field.json_name" Field_DefaultValue_field_fullname protoreflect.FullName = "google.protobuf.Field.default_value" ) // Field numbers for google.protobuf.Field. const ( Field_Kind_field_number protoreflect.FieldNumber = 1 Field_Cardinality_field_number protoreflect.FieldNumber = 2 Field_Number_field_number protoreflect.FieldNumber = 3 Field_Name_field_number protoreflect.FieldNumber = 4 Field_TypeUrl_field_number protoreflect.FieldNumber = 6 Field_OneofIndex_field_number protoreflect.FieldNumber = 7 Field_Packed_field_number protoreflect.FieldNumber = 8 Field_Options_field_number protoreflect.FieldNumber = 9 Field_JsonName_field_number protoreflect.FieldNumber = 10 Field_DefaultValue_field_number protoreflect.FieldNumber = 11 ) // Full and short names for google.protobuf.Field.Kind. const ( Field_Kind_enum_fullname = "google.protobuf.Field.Kind" Field_Kind_enum_name = "Kind" ) // Enum values for google.protobuf.Field.Kind. const ( Field_TYPE_UNKNOWN_enum_value = 0 Field_TYPE_DOUBLE_enum_value = 1 Field_TYPE_FLOAT_enum_value = 2 Field_TYPE_INT64_enum_value = 3 Field_TYPE_UINT64_enum_value = 4 Field_TYPE_INT32_enum_value = 5 Field_TYPE_FIXED64_enum_value = 6 Field_TYPE_FIXED32_enum_value = 7 Field_TYPE_BOOL_enum_value = 8 Field_TYPE_STRING_enum_value = 9 Field_TYPE_GROUP_enum_value = 10 Field_TYPE_MESSAGE_enum_value = 11 Field_TYPE_BYTES_enum_value = 12 Field_TYPE_UINT32_enum_value = 13 Field_TYPE_ENUM_enum_value = 14 Field_TYPE_SFIXED32_enum_value = 15 Field_TYPE_SFIXED64_enum_value = 16 Field_TYPE_SINT32_enum_value = 17 Field_TYPE_SINT64_enum_value = 18 ) // Full and short names for google.protobuf.Field.Cardinality. const ( Field_Cardinality_enum_fullname = "google.protobuf.Field.Cardinality" Field_Cardinality_enum_name = "Cardinality" ) // Enum values for google.protobuf.Field.Cardinality. const ( Field_CARDINALITY_UNKNOWN_enum_value = 0 Field_CARDINALITY_OPTIONAL_enum_value = 1 Field_CARDINALITY_REQUIRED_enum_value = 2 Field_CARDINALITY_REPEATED_enum_value = 3 ) // Names for google.protobuf.Enum. const ( Enum_message_name protoreflect.Name = "Enum" Enum_message_fullname protoreflect.FullName = "google.protobuf.Enum" ) // Field names for google.protobuf.Enum. const ( Enum_Name_field_name protoreflect.Name = "name" Enum_Enumvalue_field_name protoreflect.Name = "enumvalue" Enum_Options_field_name protoreflect.Name = "options" Enum_SourceContext_field_name protoreflect.Name = "source_context" Enum_Syntax_field_name protoreflect.Name = "syntax" Enum_Edition_field_name protoreflect.Name = "edition" Enum_Name_field_fullname protoreflect.FullName = "google.protobuf.Enum.name" Enum_Enumvalue_field_fullname protoreflect.FullName = "google.protobuf.Enum.enumvalue" Enum_Options_field_fullname protoreflect.FullName = "google.protobuf.Enum.options" Enum_SourceContext_field_fullname protoreflect.FullName = "google.protobuf.Enum.source_context" Enum_Syntax_field_fullname protoreflect.FullName = "google.protobuf.Enum.syntax" Enum_Edition_field_fullname protoreflect.FullName = "google.protobuf.Enum.edition" ) // Field numbers for google.protobuf.Enum. const ( Enum_Name_field_number protoreflect.FieldNumber = 1 Enum_Enumvalue_field_number protoreflect.FieldNumber = 2 Enum_Options_field_number protoreflect.FieldNumber = 3 Enum_SourceContext_field_number protoreflect.FieldNumber = 4 Enum_Syntax_field_number protoreflect.FieldNumber = 5 Enum_Edition_field_number protoreflect.FieldNumber = 6 ) // Names for google.protobuf.EnumValue. const ( EnumValue_message_name protoreflect.Name = "EnumValue" EnumValue_message_fullname protoreflect.FullName = "google.protobuf.EnumValue" ) // Field names for google.protobuf.EnumValue. const ( EnumValue_Name_field_name protoreflect.Name = "name" EnumValue_Number_field_name protoreflect.Name = "number" EnumValue_Options_field_name protoreflect.Name = "options" EnumValue_Name_field_fullname protoreflect.FullName = "google.protobuf.EnumValue.name" EnumValue_Number_field_fullname protoreflect.FullName = "google.protobuf.EnumValue.number" EnumValue_Options_field_fullname protoreflect.FullName = "google.protobuf.EnumValue.options" ) // Field numbers for google.protobuf.EnumValue. const ( EnumValue_Name_field_number protoreflect.FieldNumber = 1 EnumValue_Number_field_number protoreflect.FieldNumber = 2 EnumValue_Options_field_number protoreflect.FieldNumber = 3 ) // Names for google.protobuf.Option. const ( Option_message_name protoreflect.Name = "Option" Option_message_fullname protoreflect.FullName = "google.protobuf.Option" ) // Field names for google.protobuf.Option. const ( Option_Name_field_name protoreflect.Name = "name" Option_Value_field_name protoreflect.Name = "value" Option_Name_field_fullname protoreflect.FullName = "google.protobuf.Option.name" Option_Value_field_fullname protoreflect.FullName = "google.protobuf.Option.value" ) // Field numbers for google.protobuf.Option. const ( Option_Name_field_number protoreflect.FieldNumber = 1 Option_Value_field_number protoreflect.FieldNumber = 2 ) ================================================ FILE: vendor/google.golang.org/protobuf/internal/genid/wrappers.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package genid import "google.golang.org/protobuf/reflect/protoreflect" // Generic field name and number for messages in wrappers.proto. const ( WrapperValue_Value_field_name protoreflect.Name = "value" WrapperValue_Value_field_number protoreflect.FieldNumber = 1 ) ================================================ FILE: vendor/google.golang.org/protobuf/internal/genid/wrappers_gen.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Code generated by generate-protos. DO NOT EDIT. package genid import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" ) const File_google_protobuf_wrappers_proto = "google/protobuf/wrappers.proto" // Names for google.protobuf.DoubleValue. const ( DoubleValue_message_name protoreflect.Name = "DoubleValue" DoubleValue_message_fullname protoreflect.FullName = "google.protobuf.DoubleValue" ) // Field names for google.protobuf.DoubleValue. const ( DoubleValue_Value_field_name protoreflect.Name = "value" DoubleValue_Value_field_fullname protoreflect.FullName = "google.protobuf.DoubleValue.value" ) // Field numbers for google.protobuf.DoubleValue. const ( DoubleValue_Value_field_number protoreflect.FieldNumber = 1 ) // Names for google.protobuf.FloatValue. const ( FloatValue_message_name protoreflect.Name = "FloatValue" FloatValue_message_fullname protoreflect.FullName = "google.protobuf.FloatValue" ) // Field names for google.protobuf.FloatValue. const ( FloatValue_Value_field_name protoreflect.Name = "value" FloatValue_Value_field_fullname protoreflect.FullName = "google.protobuf.FloatValue.value" ) // Field numbers for google.protobuf.FloatValue. const ( FloatValue_Value_field_number protoreflect.FieldNumber = 1 ) // Names for google.protobuf.Int64Value. const ( Int64Value_message_name protoreflect.Name = "Int64Value" Int64Value_message_fullname protoreflect.FullName = "google.protobuf.Int64Value" ) // Field names for google.protobuf.Int64Value. const ( Int64Value_Value_field_name protoreflect.Name = "value" Int64Value_Value_field_fullname protoreflect.FullName = "google.protobuf.Int64Value.value" ) // Field numbers for google.protobuf.Int64Value. const ( Int64Value_Value_field_number protoreflect.FieldNumber = 1 ) // Names for google.protobuf.UInt64Value. const ( UInt64Value_message_name protoreflect.Name = "UInt64Value" UInt64Value_message_fullname protoreflect.FullName = "google.protobuf.UInt64Value" ) // Field names for google.protobuf.UInt64Value. const ( UInt64Value_Value_field_name protoreflect.Name = "value" UInt64Value_Value_field_fullname protoreflect.FullName = "google.protobuf.UInt64Value.value" ) // Field numbers for google.protobuf.UInt64Value. const ( UInt64Value_Value_field_number protoreflect.FieldNumber = 1 ) // Names for google.protobuf.Int32Value. const ( Int32Value_message_name protoreflect.Name = "Int32Value" Int32Value_message_fullname protoreflect.FullName = "google.protobuf.Int32Value" ) // Field names for google.protobuf.Int32Value. const ( Int32Value_Value_field_name protoreflect.Name = "value" Int32Value_Value_field_fullname protoreflect.FullName = "google.protobuf.Int32Value.value" ) // Field numbers for google.protobuf.Int32Value. const ( Int32Value_Value_field_number protoreflect.FieldNumber = 1 ) // Names for google.protobuf.UInt32Value. const ( UInt32Value_message_name protoreflect.Name = "UInt32Value" UInt32Value_message_fullname protoreflect.FullName = "google.protobuf.UInt32Value" ) // Field names for google.protobuf.UInt32Value. const ( UInt32Value_Value_field_name protoreflect.Name = "value" UInt32Value_Value_field_fullname protoreflect.FullName = "google.protobuf.UInt32Value.value" ) // Field numbers for google.protobuf.UInt32Value. const ( UInt32Value_Value_field_number protoreflect.FieldNumber = 1 ) // Names for google.protobuf.BoolValue. const ( BoolValue_message_name protoreflect.Name = "BoolValue" BoolValue_message_fullname protoreflect.FullName = "google.protobuf.BoolValue" ) // Field names for google.protobuf.BoolValue. const ( BoolValue_Value_field_name protoreflect.Name = "value" BoolValue_Value_field_fullname protoreflect.FullName = "google.protobuf.BoolValue.value" ) // Field numbers for google.protobuf.BoolValue. const ( BoolValue_Value_field_number protoreflect.FieldNumber = 1 ) // Names for google.protobuf.StringValue. const ( StringValue_message_name protoreflect.Name = "StringValue" StringValue_message_fullname protoreflect.FullName = "google.protobuf.StringValue" ) // Field names for google.protobuf.StringValue. const ( StringValue_Value_field_name protoreflect.Name = "value" StringValue_Value_field_fullname protoreflect.FullName = "google.protobuf.StringValue.value" ) // Field numbers for google.protobuf.StringValue. const ( StringValue_Value_field_number protoreflect.FieldNumber = 1 ) // Names for google.protobuf.BytesValue. const ( BytesValue_message_name protoreflect.Name = "BytesValue" BytesValue_message_fullname protoreflect.FullName = "google.protobuf.BytesValue" ) // Field names for google.protobuf.BytesValue. const ( BytesValue_Value_field_name protoreflect.Name = "value" BytesValue_Value_field_fullname protoreflect.FullName = "google.protobuf.BytesValue.value" ) // Field numbers for google.protobuf.BytesValue. const ( BytesValue_Value_field_number protoreflect.FieldNumber = 1 ) ================================================ FILE: vendor/google.golang.org/protobuf/internal/impl/api_export.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package impl import ( "fmt" "reflect" "strconv" "google.golang.org/protobuf/encoding/prototext" "google.golang.org/protobuf/internal/errors" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/runtime/protoiface" ) // Export is a zero-length named type that exists only to export a set of // functions that we do not want to appear in godoc. type Export struct{} // NewError formats a string according to the format specifier and arguments and // returns an error that has a "proto" prefix. func (Export) NewError(f string, x ...any) error { return errors.New(f, x...) } // enum is any enum type generated by protoc-gen-go // and must be a named int32 type. type enum = any // EnumOf returns the protoreflect.Enum interface over e. // It returns nil if e is nil. func (Export) EnumOf(e enum) protoreflect.Enum { switch e := e.(type) { case nil: return nil case protoreflect.Enum: return e default: return legacyWrapEnum(reflect.ValueOf(e)) } } // EnumDescriptorOf returns the protoreflect.EnumDescriptor for e. // It returns nil if e is nil. func (Export) EnumDescriptorOf(e enum) protoreflect.EnumDescriptor { switch e := e.(type) { case nil: return nil case protoreflect.Enum: return e.Descriptor() default: return LegacyLoadEnumDesc(reflect.TypeOf(e)) } } // EnumTypeOf returns the protoreflect.EnumType for e. // It returns nil if e is nil. func (Export) EnumTypeOf(e enum) protoreflect.EnumType { switch e := e.(type) { case nil: return nil case protoreflect.Enum: return e.Type() default: return legacyLoadEnumType(reflect.TypeOf(e)) } } // EnumStringOf returns the enum value as a string, either as the name if // the number is resolvable, or the number formatted as a string. func (Export) EnumStringOf(ed protoreflect.EnumDescriptor, n protoreflect.EnumNumber) string { ev := ed.Values().ByNumber(n) if ev != nil { return string(ev.Name()) } return strconv.Itoa(int(n)) } // message is any message type generated by protoc-gen-go // and must be a pointer to a named struct type. type message = any // legacyMessageWrapper wraps a v2 message as a v1 message. type legacyMessageWrapper struct{ m protoreflect.ProtoMessage } func (m legacyMessageWrapper) Reset() { proto.Reset(m.m) } func (m legacyMessageWrapper) String() string { return Export{}.MessageStringOf(m.m) } func (m legacyMessageWrapper) ProtoMessage() {} // ProtoMessageV1Of converts either a v1 or v2 message to a v1 message. // It returns nil if m is nil. func (Export) ProtoMessageV1Of(m message) protoiface.MessageV1 { switch mv := m.(type) { case nil: return nil case protoiface.MessageV1: return mv case unwrapper: return Export{}.ProtoMessageV1Of(mv.protoUnwrap()) case protoreflect.ProtoMessage: return legacyMessageWrapper{mv} default: panic(fmt.Sprintf("message %T is neither a v1 or v2 Message", m)) } } func (Export) protoMessageV2Of(m message) protoreflect.ProtoMessage { switch mv := m.(type) { case nil: return nil case protoreflect.ProtoMessage: return mv case legacyMessageWrapper: return mv.m case protoiface.MessageV1: return nil default: panic(fmt.Sprintf("message %T is neither a v1 or v2 Message", m)) } } // ProtoMessageV2Of converts either a v1 or v2 message to a v2 message. // It returns nil if m is nil. func (Export) ProtoMessageV2Of(m message) protoreflect.ProtoMessage { if m == nil { return nil } if mv := (Export{}).protoMessageV2Of(m); mv != nil { return mv } return legacyWrapMessage(reflect.ValueOf(m)).Interface() } // MessageOf returns the protoreflect.Message interface over m. // It returns nil if m is nil. func (Export) MessageOf(m message) protoreflect.Message { if m == nil { return nil } if mv := (Export{}).protoMessageV2Of(m); mv != nil { return mv.ProtoReflect() } return legacyWrapMessage(reflect.ValueOf(m)) } // MessageDescriptorOf returns the protoreflect.MessageDescriptor for m. // It returns nil if m is nil. func (Export) MessageDescriptorOf(m message) protoreflect.MessageDescriptor { if m == nil { return nil } if mv := (Export{}).protoMessageV2Of(m); mv != nil { return mv.ProtoReflect().Descriptor() } return LegacyLoadMessageDesc(reflect.TypeOf(m)) } // MessageTypeOf returns the protoreflect.MessageType for m. // It returns nil if m is nil. func (Export) MessageTypeOf(m message) protoreflect.MessageType { if m == nil { return nil } if mv := (Export{}).protoMessageV2Of(m); mv != nil { return mv.ProtoReflect().Type() } return legacyLoadMessageType(reflect.TypeOf(m), "") } // MessageStringOf returns the message value as a string, // which is the message serialized in the protobuf text format. func (Export) MessageStringOf(m protoreflect.ProtoMessage) string { return prototext.MarshalOptions{Multiline: false}.Format(m) } ================================================ FILE: vendor/google.golang.org/protobuf/internal/impl/api_export_opaque.go ================================================ // Copyright 2024 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package impl import ( "strconv" "sync/atomic" "unsafe" "google.golang.org/protobuf/reflect/protoreflect" ) func (Export) UnmarshalField(msg any, fieldNum int32) { UnmarshalField(msg.(protoreflect.ProtoMessage).ProtoReflect(), protoreflect.FieldNumber(fieldNum)) } // Present checks the presence set for a certain field number (zero // based, ordered by appearance in original proto file). part is // a pointer to the correct element in the bitmask array, num is the // field number unaltered. Example (field number 70 -> part = // &m.XXX_presence[1], num = 70) func (Export) Present(part *uint32, num uint32) bool { // This hook will read an unprotected shadow presence set if // we're unning under the race detector raceDetectHookPresent(part, num) return atomic.LoadUint32(part)&(1<<(num%32)) > 0 } // SetPresent adds a field to the presence set. part is a pointer to // the relevant element in the array and num is the field number // unaltered. size is the number of fields in the protocol // buffer. func (Export) SetPresent(part *uint32, num uint32, size uint32) { // This hook will mutate an unprotected shadow presence set if // we're running under the race detector raceDetectHookSetPresent(part, num, presenceSize(size)) for { old := atomic.LoadUint32(part) if atomic.CompareAndSwapUint32(part, old, old|(1<<(num%32))) { return } } } // SetPresentNonAtomic is like SetPresent, but operates non-atomically. // It is meant for use by builder methods, where the message is known not // to be accessible yet by other goroutines. func (Export) SetPresentNonAtomic(part *uint32, num uint32, size uint32) { // This hook will mutate an unprotected shadow presence set if // we're running under the race detector raceDetectHookSetPresent(part, num, presenceSize(size)) *part |= 1 << (num % 32) } // ClearPresence removes a field from the presence set. part is a // pointer to the relevant element in the presence array and num is // the field number unaltered. func (Export) ClearPresent(part *uint32, num uint32) { // This hook will mutate an unprotected shadow presence set if // we're running under the race detector raceDetectHookClearPresent(part, num) for { old := atomic.LoadUint32(part) if atomic.CompareAndSwapUint32(part, old, old&^(1<<(num%32))) { return } } } // interfaceToPointer takes a pointer to an empty interface whose value is a // pointer type, and converts it into a "pointer" that points to the same // target func interfaceToPointer(i *any) pointer { return pointer{p: (*[2]unsafe.Pointer)(unsafe.Pointer(i))[1]} } func (p pointer) atomicGetPointer() pointer { return pointer{p: atomic.LoadPointer((*unsafe.Pointer)(p.p))} } func (p pointer) atomicSetPointer(q pointer) { atomic.StorePointer((*unsafe.Pointer)(p.p), q.p) } // AtomicCheckPointerIsNil takes an interface (which is a pointer to a // pointer) and returns true if the pointed-to pointer is nil (using an // atomic load). This function is inlineable and, on x86, just becomes a // simple load and compare. func (Export) AtomicCheckPointerIsNil(ptr any) bool { return interfaceToPointer(&ptr).atomicGetPointer().IsNil() } // AtomicSetPointer takes two interfaces (first is a pointer to a pointer, // second is a pointer) and atomically sets the second pointer into location // referenced by first pointer. Unfortunately, atomicSetPointer() does not inline // (even on x86), so this does not become a simple store on x86. func (Export) AtomicSetPointer(dstPtr, valPtr any) { interfaceToPointer(&dstPtr).atomicSetPointer(interfaceToPointer(&valPtr)) } // AtomicLoadPointer loads the pointer at the location pointed at by src, // and stores that pointer value into the location pointed at by dst. func (Export) AtomicLoadPointer(ptr Pointer, dst Pointer) { *(*unsafe.Pointer)(unsafe.Pointer(dst)) = atomic.LoadPointer((*unsafe.Pointer)(unsafe.Pointer(ptr))) } // AtomicInitializePointer makes ptr and dst point to the same value. // // If *ptr is a nil pointer, it sets *ptr = *dst. // // If *ptr is a non-nil pointer, it sets *dst = *ptr. func (Export) AtomicInitializePointer(ptr Pointer, dst Pointer) { if !atomic.CompareAndSwapPointer((*unsafe.Pointer)(ptr), unsafe.Pointer(nil), *(*unsafe.Pointer)(dst)) { *(*unsafe.Pointer)(unsafe.Pointer(dst)) = atomic.LoadPointer((*unsafe.Pointer)(unsafe.Pointer(ptr))) } } // MessageFieldStringOf returns the field formatted as a string, // either as the field name if resolvable otherwise as a decimal string. func (Export) MessageFieldStringOf(md protoreflect.MessageDescriptor, n protoreflect.FieldNumber) string { fd := md.Fields().ByNumber(n) if fd != nil { return string(fd.Name()) } return strconv.Itoa(int(n)) } ================================================ FILE: vendor/google.golang.org/protobuf/internal/impl/bitmap.go ================================================ // Copyright 2024 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build !race package impl // There is no additional data as we're not running under race detector. type RaceDetectHookData struct{} // Empty stubs for when not using the race detector. Calls to these from index.go should be optimized away. func (presence) raceDetectHookPresent(num uint32) {} func (presence) raceDetectHookSetPresent(num uint32, size presenceSize) {} func (presence) raceDetectHookClearPresent(num uint32) {} func (presence) raceDetectHookAllocAndCopy(src presence) {} // raceDetectHookPresent is called by the generated file interface // (*proto.internalFuncs) Present to optionally read an unprotected // shadow bitmap when race detection is enabled. In regular code it is // a noop. func raceDetectHookPresent(field *uint32, num uint32) {} // raceDetectHookSetPresent is called by the generated file interface // (*proto.internalFuncs) SetPresent to optionally write an unprotected // shadow bitmap when race detection is enabled. In regular code it is // a noop. func raceDetectHookSetPresent(field *uint32, num uint32, size presenceSize) {} // raceDetectHookClearPresent is called by the generated file interface // (*proto.internalFuncs) ClearPresent to optionally write an unprotected // shadow bitmap when race detection is enabled. In regular code it is // a noop. func raceDetectHookClearPresent(field *uint32, num uint32) {} ================================================ FILE: vendor/google.golang.org/protobuf/internal/impl/bitmap_race.go ================================================ // Copyright 2024 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build race package impl // When running under race detector, we add a presence map of bytes, that we can access // in the hook functions so that we trigger the race detection whenever we have concurrent // Read-Writes or Write-Writes. The race detector does not otherwise detect invalid concurrent // access to lazy fields as all updates of bitmaps and pointers are done using atomic operations. type RaceDetectHookData struct { shadowPresence *[]byte } // Hooks for presence bitmap operations that allocate, read and write the shadowPresence // using non-atomic operations. func (data *RaceDetectHookData) raceDetectHookAlloc(size presenceSize) { sp := make([]byte, size) atomicStoreShadowPresence(&data.shadowPresence, &sp) } func (p presence) raceDetectHookPresent(num uint32) { data := p.toRaceDetectData() if data == nil { return } sp := atomicLoadShadowPresence(&data.shadowPresence) if sp != nil { _ = (*sp)[num] } } func (p presence) raceDetectHookSetPresent(num uint32, size presenceSize) { data := p.toRaceDetectData() if data == nil { return } sp := atomicLoadShadowPresence(&data.shadowPresence) if sp == nil { data.raceDetectHookAlloc(size) sp = atomicLoadShadowPresence(&data.shadowPresence) } (*sp)[num] = 1 } func (p presence) raceDetectHookClearPresent(num uint32) { data := p.toRaceDetectData() if data == nil { return } sp := atomicLoadShadowPresence(&data.shadowPresence) if sp != nil { (*sp)[num] = 0 } } // raceDetectHookAllocAndCopy allocates a new shadowPresence slice at lazy and copies // shadowPresence bytes from src to lazy. func (p presence) raceDetectHookAllocAndCopy(q presence) { sData := q.toRaceDetectData() dData := p.toRaceDetectData() if sData == nil { return } srcSp := atomicLoadShadowPresence(&sData.shadowPresence) if srcSp == nil { atomicStoreShadowPresence(&dData.shadowPresence, nil) return } n := len(*srcSp) dSlice := make([]byte, n) atomicStoreShadowPresence(&dData.shadowPresence, &dSlice) for i := 0; i < n; i++ { dSlice[i] = (*srcSp)[i] } } // raceDetectHookPresent is called by the generated file interface // (*proto.internalFuncs) Present to optionally read an unprotected // shadow bitmap when race detection is enabled. In regular code it is // a noop. func raceDetectHookPresent(field *uint32, num uint32) { data := findPointerToRaceDetectData(field, num) if data == nil { return } sp := atomicLoadShadowPresence(&data.shadowPresence) if sp != nil { _ = (*sp)[num] } } // raceDetectHookSetPresent is called by the generated file interface // (*proto.internalFuncs) SetPresent to optionally write an unprotected // shadow bitmap when race detection is enabled. In regular code it is // a noop. func raceDetectHookSetPresent(field *uint32, num uint32, size presenceSize) { data := findPointerToRaceDetectData(field, num) if data == nil { return } sp := atomicLoadShadowPresence(&data.shadowPresence) if sp == nil { data.raceDetectHookAlloc(size) sp = atomicLoadShadowPresence(&data.shadowPresence) } (*sp)[num] = 1 } // raceDetectHookClearPresent is called by the generated file interface // (*proto.internalFuncs) ClearPresent to optionally write an unprotected // shadow bitmap when race detection is enabled. In regular code it is // a noop. func raceDetectHookClearPresent(field *uint32, num uint32) { data := findPointerToRaceDetectData(field, num) if data == nil { return } sp := atomicLoadShadowPresence(&data.shadowPresence) if sp != nil { (*sp)[num] = 0 } } ================================================ FILE: vendor/google.golang.org/protobuf/internal/impl/checkinit.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package impl import ( "sync" "google.golang.org/protobuf/internal/errors" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/runtime/protoiface" ) func (mi *MessageInfo) checkInitialized(in protoiface.CheckInitializedInput) (protoiface.CheckInitializedOutput, error) { var p pointer if ms, ok := in.Message.(*messageState); ok { p = ms.pointer() } else { p = in.Message.(*messageReflectWrapper).pointer() } return protoiface.CheckInitializedOutput{}, mi.checkInitializedPointer(p) } func (mi *MessageInfo) checkInitializedPointer(p pointer) error { mi.init() if !mi.needsInitCheck { return nil } if p.IsNil() { for _, f := range mi.orderedCoderFields { if f.isRequired { return errors.RequiredNotSet(string(mi.Desc.Fields().ByNumber(f.num).FullName())) } } return nil } var presence presence if mi.presenceOffset.IsValid() { presence = p.Apply(mi.presenceOffset).PresenceInfo() } if mi.extensionOffset.IsValid() { e := p.Apply(mi.extensionOffset).Extensions() if err := mi.isInitExtensions(e); err != nil { return err } } for _, f := range mi.orderedCoderFields { if !f.isRequired && f.funcs.isInit == nil { continue } if f.presenceIndex != noPresence { if !presence.Present(f.presenceIndex) { if f.isRequired { return errors.RequiredNotSet(string(mi.Desc.Fields().ByNumber(f.num).FullName())) } continue } if f.funcs.isInit != nil { f.mi.init() if f.mi.needsInitCheck { if f.isLazy && p.Apply(f.offset).AtomicGetPointer().IsNil() { lazy := *p.Apply(mi.lazyOffset).LazyInfoPtr() if !lazy.AllowedPartial() { // Nothing to see here, it was checked on unmarshal continue } mi.lazyUnmarshal(p, f.num) } if err := f.funcs.isInit(p.Apply(f.offset), f); err != nil { return err } } } continue } fptr := p.Apply(f.offset) if f.isPointer && fptr.Elem().IsNil() { if f.isRequired { return errors.RequiredNotSet(string(mi.Desc.Fields().ByNumber(f.num).FullName())) } continue } if f.funcs.isInit == nil { continue } if err := f.funcs.isInit(fptr, f); err != nil { return err } } return nil } func (mi *MessageInfo) isInitExtensions(ext *map[int32]ExtensionField) error { if ext == nil { return nil } for _, x := range *ext { ei := getExtensionFieldInfo(x.Type()) if ei.funcs.isInit == nil || x.isUnexpandedLazy() { continue } v := x.Value() if !v.IsValid() { continue } if err := ei.funcs.isInit(v); err != nil { return err } } return nil } var ( needsInitCheckMu sync.Mutex needsInitCheckMap sync.Map ) // needsInitCheck reports whether a message needs to be checked for partial initialization. // // It returns true if the message transitively includes any required or extension fields. func needsInitCheck(md protoreflect.MessageDescriptor) bool { if v, ok := needsInitCheckMap.Load(md); ok { if has, ok := v.(bool); ok { return has } } needsInitCheckMu.Lock() defer needsInitCheckMu.Unlock() return needsInitCheckLocked(md) } func needsInitCheckLocked(md protoreflect.MessageDescriptor) (has bool) { if v, ok := needsInitCheckMap.Load(md); ok { // If has is true, we've previously determined that this message // needs init checks. // // If has is false, we've previously determined that it can never // be uninitialized. // // If has is not a bool, we've just encountered a cycle in the // message graph. In this case, it is safe to return false: If // the message does have required fields, we'll detect them later // in the graph traversal. has, ok := v.(bool) return ok && has } needsInitCheckMap.Store(md, struct{}{}) // avoid cycles while descending into this message defer func() { needsInitCheckMap.Store(md, has) }() if md.RequiredNumbers().Len() > 0 { return true } if md.ExtensionRanges().Len() > 0 { return true } for i := 0; i < md.Fields().Len(); i++ { fd := md.Fields().Get(i) // Map keys are never messages, so just consider the map value. if fd.IsMap() { fd = fd.MapValue() } fmd := fd.Message() if fmd != nil && needsInitCheckLocked(fmd) { return true } } return false } ================================================ FILE: vendor/google.golang.org/protobuf/internal/impl/codec_extension.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package impl import ( "sync" "sync/atomic" "google.golang.org/protobuf/encoding/protowire" "google.golang.org/protobuf/internal/errors" "google.golang.org/protobuf/reflect/protoreflect" ) type extensionFieldInfo struct { wiretag uint64 tagsize int unmarshalNeedsValue bool funcs valueCoderFuncs validation validationInfo } func getExtensionFieldInfo(xt protoreflect.ExtensionType) *extensionFieldInfo { if xi, ok := xt.(*ExtensionInfo); ok { xi.lazyInit() return xi.info } // Ideally we'd cache the resulting *extensionFieldInfo so we don't have to // recompute this metadata repeatedly. But without support for something like // weak references, such a cache would pin temporary values (like dynamic // extension types, constructed for the duration of a user request) to the // heap forever, causing memory usage of the cache to grow unbounded. // See discussion in https://github.com/golang/protobuf/issues/1521. return makeExtensionFieldInfo(xt.TypeDescriptor()) } func makeExtensionFieldInfo(xd protoreflect.ExtensionDescriptor) *extensionFieldInfo { var wiretag uint64 if !xd.IsPacked() { wiretag = protowire.EncodeTag(xd.Number(), wireTypes[xd.Kind()]) } else { wiretag = protowire.EncodeTag(xd.Number(), protowire.BytesType) } e := &extensionFieldInfo{ wiretag: wiretag, tagsize: protowire.SizeVarint(wiretag), funcs: encoderFuncsForValue(xd), } // Does the unmarshal function need a value passed to it? // This is true for composite types, where we pass in a message, list, or map to fill in, // and for enums, where we pass in a prototype value to specify the concrete enum type. switch xd.Kind() { case protoreflect.MessageKind, protoreflect.GroupKind, protoreflect.EnumKind: e.unmarshalNeedsValue = true default: if xd.Cardinality() == protoreflect.Repeated { e.unmarshalNeedsValue = true } } return e } type lazyExtensionValue struct { atomicOnce uint32 // atomically set if value is valid mu sync.Mutex xi *extensionFieldInfo value protoreflect.Value b []byte } type ExtensionField struct { typ protoreflect.ExtensionType // value is either the value of GetValue, // or a *lazyExtensionValue that then returns the value of GetValue. value protoreflect.Value lazy *lazyExtensionValue } func (f *ExtensionField) appendLazyBytes(xt protoreflect.ExtensionType, xi *extensionFieldInfo, num protowire.Number, wtyp protowire.Type, b []byte) { if f.lazy == nil { f.lazy = &lazyExtensionValue{xi: xi} } f.typ = xt f.lazy.xi = xi f.lazy.b = protowire.AppendTag(f.lazy.b, num, wtyp) f.lazy.b = append(f.lazy.b, b...) } func (f *ExtensionField) canLazy(xt protoreflect.ExtensionType) bool { if f.typ == nil { return true } if f.typ == xt && f.lazy != nil && atomic.LoadUint32(&f.lazy.atomicOnce) == 0 { return true } return false } // isUnexpandedLazy returns true if the ExensionField is lazy and not // yet expanded, which means it's present and already checked for // initialized required fields. func (f *ExtensionField) isUnexpandedLazy() bool { return f.lazy != nil && atomic.LoadUint32(&f.lazy.atomicOnce) == 0 } // lazyBuffer retrieves the buffer for a lazy extension if it's not yet expanded. // // The returned buffer has to be kept over whatever operation we're planning, // as re-retrieving it will fail after the message is lazily decoded. func (f *ExtensionField) lazyBuffer() []byte { // This function might be in the critical path, so check the atomic without // taking a look first, then only take the lock if needed. if !f.isUnexpandedLazy() { return nil } f.lazy.mu.Lock() defer f.lazy.mu.Unlock() return f.lazy.b } func (f *ExtensionField) lazyInit() { f.lazy.mu.Lock() defer f.lazy.mu.Unlock() if atomic.LoadUint32(&f.lazy.atomicOnce) == 1 { return } if f.lazy.xi != nil { b := f.lazy.b val := f.typ.New() for len(b) > 0 { var tag uint64 if b[0] < 0x80 { tag = uint64(b[0]) b = b[1:] } else if len(b) >= 2 && b[1] < 128 { tag = uint64(b[0]&0x7f) + uint64(b[1])<<7 b = b[2:] } else { var n int tag, n = protowire.ConsumeVarint(b) if n < 0 { panic(errors.New("bad tag in lazy extension decoding")) } b = b[n:] } num := protowire.Number(tag >> 3) wtyp := protowire.Type(tag & 7) var out unmarshalOutput var err error val, out, err = f.lazy.xi.funcs.unmarshal(b, val, num, wtyp, lazyUnmarshalOptions) if err != nil { panic(errors.New("decode failure in lazy extension decoding: %v", err)) } b = b[out.n:] } f.lazy.value = val } else { panic("No support for lazy fns for ExtensionField") } f.lazy.xi = nil f.lazy.b = nil atomic.StoreUint32(&f.lazy.atomicOnce, 1) } // Set sets the type and value of the extension field. // This must not be called concurrently. func (f *ExtensionField) Set(t protoreflect.ExtensionType, v protoreflect.Value) { f.typ = t f.value = v f.lazy = nil } // Value returns the value of the extension field. // This may be called concurrently. func (f *ExtensionField) Value() protoreflect.Value { if f.lazy != nil { if atomic.LoadUint32(&f.lazy.atomicOnce) == 0 { f.lazyInit() } return f.lazy.value } return f.value } // Type returns the type of the extension field. // This may be called concurrently. func (f ExtensionField) Type() protoreflect.ExtensionType { return f.typ } // IsSet returns whether the extension field is set. // This may be called concurrently. func (f ExtensionField) IsSet() bool { return f.typ != nil } // IsLazy reports whether a field is lazily encoded. // It is exported for testing. func IsLazy(m protoreflect.Message, fd protoreflect.FieldDescriptor) bool { var mi *MessageInfo var p pointer switch m := m.(type) { case *messageState: mi = m.messageInfo() p = m.pointer() case *messageReflectWrapper: mi = m.messageInfo() p = m.pointer() default: return false } xd, ok := fd.(protoreflect.ExtensionTypeDescriptor) if !ok { return false } xt := xd.Type() ext := mi.extensionMap(p) if ext == nil { return false } f, ok := (*ext)[int32(fd.Number())] if !ok { return false } return f.typ == xt && f.lazy != nil && atomic.LoadUint32(&f.lazy.atomicOnce) == 0 } ================================================ FILE: vendor/google.golang.org/protobuf/internal/impl/codec_field.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package impl import ( "reflect" "google.golang.org/protobuf/encoding/protowire" "google.golang.org/protobuf/internal/errors" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/runtime/protoiface" ) type errInvalidUTF8 struct{} func (errInvalidUTF8) Error() string { return "string field contains invalid UTF-8" } func (errInvalidUTF8) InvalidUTF8() bool { return true } func (errInvalidUTF8) Unwrap() error { return errors.Error } // initOneofFieldCoders initializes the fast-path functions for the fields in a oneof. // // For size, marshal, and isInit operations, functions are set only on the first field // in the oneof. The functions are called when the oneof is non-nil, and will dispatch // to the appropriate field-specific function as necessary. // // The unmarshal function is set on each field individually as usual. func (mi *MessageInfo) initOneofFieldCoders(od protoreflect.OneofDescriptor, si structInfo) { fs := si.oneofsByName[od.Name()] ft := fs.Type oneofFields := make(map[reflect.Type]*coderFieldInfo) needIsInit := false fields := od.Fields() for i, lim := 0, fields.Len(); i < lim; i++ { fd := od.Fields().Get(i) num := fd.Number() // Make a copy of the original coderFieldInfo for use in unmarshaling. // // oneofFields[oneofType].funcs.marshal is the field-specific marshal function. // // mi.coderFields[num].marshal is set on only the first field in the oneof, // and dispatches to the field-specific marshaler in oneofFields. cf := *mi.coderFields[num] ot := si.oneofWrappersByNumber[num] cf.ft = ot.Field(0).Type cf.mi, cf.funcs = fieldCoder(fd, cf.ft) oneofFields[ot] = &cf if cf.funcs.isInit != nil { needIsInit = true } mi.coderFields[num].funcs.unmarshal = func(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (unmarshalOutput, error) { var vw reflect.Value // pointer to wrapper type vi := p.AsValueOf(ft).Elem() // oneof field value of interface kind if !vi.IsNil() && !vi.Elem().IsNil() && vi.Elem().Elem().Type() == ot { vw = vi.Elem() } else { vw = reflect.New(ot) } out, err := cf.funcs.unmarshal(b, pointerOfValue(vw).Apply(zeroOffset), wtyp, &cf, opts) if err != nil { return out, err } if cf.funcs.isInit == nil { out.initialized = true } vi.Set(vw) return out, nil } } getInfo := func(p pointer) (pointer, *coderFieldInfo) { v := p.AsValueOf(ft).Elem() if v.IsNil() { return pointer{}, nil } v = v.Elem() // interface -> *struct if v.IsNil() { return pointer{}, nil } return pointerOfValue(v).Apply(zeroOffset), oneofFields[v.Elem().Type()] } first := mi.coderFields[od.Fields().Get(0).Number()] first.funcs.size = func(p pointer, _ *coderFieldInfo, opts marshalOptions) int { p, info := getInfo(p) if info == nil || info.funcs.size == nil { return 0 } return info.funcs.size(p, info, opts) } first.funcs.marshal = func(b []byte, p pointer, _ *coderFieldInfo, opts marshalOptions) ([]byte, error) { p, info := getInfo(p) if info == nil || info.funcs.marshal == nil { return b, nil } return info.funcs.marshal(b, p, info, opts) } first.funcs.merge = func(dst, src pointer, _ *coderFieldInfo, opts mergeOptions) { srcp, srcinfo := getInfo(src) if srcinfo == nil || srcinfo.funcs.merge == nil { return } dstp, dstinfo := getInfo(dst) if dstinfo != srcinfo { dst.AsValueOf(ft).Elem().Set(reflect.New(src.AsValueOf(ft).Elem().Elem().Elem().Type())) dstp = pointerOfValue(dst.AsValueOf(ft).Elem().Elem()).Apply(zeroOffset) } srcinfo.funcs.merge(dstp, srcp, srcinfo, opts) } if needIsInit { first.funcs.isInit = func(p pointer, _ *coderFieldInfo) error { p, info := getInfo(p) if info == nil || info.funcs.isInit == nil { return nil } return info.funcs.isInit(p, info) } } } func makeMessageFieldCoder(fd protoreflect.FieldDescriptor, ft reflect.Type) pointerCoderFuncs { if mi := getMessageInfo(ft); mi != nil { funcs := pointerCoderFuncs{ size: sizeMessageInfo, marshal: appendMessageInfo, unmarshal: consumeMessageInfo, merge: mergeMessage, } if needsInitCheck(mi.Desc) { funcs.isInit = isInitMessageInfo } return funcs } else { return pointerCoderFuncs{ size: func(p pointer, f *coderFieldInfo, opts marshalOptions) int { m := asMessage(p.AsValueOf(ft).Elem()) return sizeMessage(m, f.tagsize, opts) }, marshal: func(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { m := asMessage(p.AsValueOf(ft).Elem()) return appendMessage(b, m, f.wiretag, opts) }, unmarshal: func(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (unmarshalOutput, error) { mp := p.AsValueOf(ft).Elem() if mp.IsNil() { mp.Set(reflect.New(ft.Elem())) } return consumeMessage(b, asMessage(mp), wtyp, opts) }, isInit: func(p pointer, f *coderFieldInfo) error { m := asMessage(p.AsValueOf(ft).Elem()) return proto.CheckInitialized(m) }, merge: mergeMessage, } } } func sizeMessageInfo(p pointer, f *coderFieldInfo, opts marshalOptions) int { return protowire.SizeBytes(f.mi.sizePointer(p.Elem(), opts)) + f.tagsize } func appendMessageInfo(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { calculatedSize := f.mi.sizePointer(p.Elem(), opts) b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendVarint(b, uint64(calculatedSize)) before := len(b) b, err := f.mi.marshalAppendPointer(b, p.Elem(), opts) if measuredSize := len(b) - before; calculatedSize != measuredSize && err == nil { return nil, errors.MismatchedSizeCalculation(calculatedSize, measuredSize) } return b, err } func consumeMessageInfo(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.BytesType { return out, errUnknown } v, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } if p.Elem().IsNil() { p.SetPointer(pointerOfValue(reflect.New(f.mi.GoReflectType.Elem()))) } o, err := f.mi.unmarshalPointer(v, p.Elem(), 0, opts) if err != nil { return out, err } out.n = n out.initialized = o.initialized return out, nil } func isInitMessageInfo(p pointer, f *coderFieldInfo) error { return f.mi.checkInitializedPointer(p.Elem()) } func sizeMessage(m proto.Message, tagsize int, opts marshalOptions) int { return protowire.SizeBytes(opts.Options().Size(m)) + tagsize } func appendMessage(b []byte, m proto.Message, wiretag uint64, opts marshalOptions) ([]byte, error) { mopts := opts.Options() calculatedSize := mopts.Size(m) b = protowire.AppendVarint(b, wiretag) b = protowire.AppendVarint(b, uint64(calculatedSize)) before := len(b) b, err := mopts.MarshalAppend(b, m) if measuredSize := len(b) - before; calculatedSize != measuredSize && err == nil { return nil, errors.MismatchedSizeCalculation(calculatedSize, measuredSize) } return b, err } func consumeMessage(b []byte, m proto.Message, wtyp protowire.Type, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.BytesType { return out, errUnknown } v, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } o, err := opts.Options().UnmarshalState(protoiface.UnmarshalInput{ Buf: v, Message: m.ProtoReflect(), }) if err != nil { return out, err } out.n = n out.initialized = o.Flags&protoiface.UnmarshalInitialized != 0 return out, nil } func sizeMessageValue(v protoreflect.Value, tagsize int, opts marshalOptions) int { m := v.Message().Interface() return sizeMessage(m, tagsize, opts) } func appendMessageValue(b []byte, v protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { m := v.Message().Interface() return appendMessage(b, m, wiretag, opts) } func consumeMessageValue(b []byte, v protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (protoreflect.Value, unmarshalOutput, error) { m := v.Message().Interface() out, err := consumeMessage(b, m, wtyp, opts) return v, out, err } func isInitMessageValue(v protoreflect.Value) error { m := v.Message().Interface() return proto.CheckInitialized(m) } var coderMessageValue = valueCoderFuncs{ size: sizeMessageValue, marshal: appendMessageValue, unmarshal: consumeMessageValue, isInit: isInitMessageValue, merge: mergeMessageValue, } func sizeGroupValue(v protoreflect.Value, tagsize int, opts marshalOptions) int { m := v.Message().Interface() return sizeGroup(m, tagsize, opts) } func appendGroupValue(b []byte, v protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { m := v.Message().Interface() return appendGroup(b, m, wiretag, opts) } func consumeGroupValue(b []byte, v protoreflect.Value, num protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (protoreflect.Value, unmarshalOutput, error) { m := v.Message().Interface() out, err := consumeGroup(b, m, num, wtyp, opts) return v, out, err } var coderGroupValue = valueCoderFuncs{ size: sizeGroupValue, marshal: appendGroupValue, unmarshal: consumeGroupValue, isInit: isInitMessageValue, merge: mergeMessageValue, } func makeGroupFieldCoder(fd protoreflect.FieldDescriptor, ft reflect.Type) pointerCoderFuncs { num := fd.Number() if mi := getMessageInfo(ft); mi != nil { funcs := pointerCoderFuncs{ size: sizeGroupType, marshal: appendGroupType, unmarshal: consumeGroupType, merge: mergeMessage, } if needsInitCheck(mi.Desc) { funcs.isInit = isInitMessageInfo } return funcs } else { return pointerCoderFuncs{ size: func(p pointer, f *coderFieldInfo, opts marshalOptions) int { m := asMessage(p.AsValueOf(ft).Elem()) return sizeGroup(m, f.tagsize, opts) }, marshal: func(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { m := asMessage(p.AsValueOf(ft).Elem()) return appendGroup(b, m, f.wiretag, opts) }, unmarshal: func(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (unmarshalOutput, error) { mp := p.AsValueOf(ft).Elem() if mp.IsNil() { mp.Set(reflect.New(ft.Elem())) } return consumeGroup(b, asMessage(mp), num, wtyp, opts) }, isInit: func(p pointer, f *coderFieldInfo) error { m := asMessage(p.AsValueOf(ft).Elem()) return proto.CheckInitialized(m) }, merge: mergeMessage, } } } func sizeGroupType(p pointer, f *coderFieldInfo, opts marshalOptions) int { return 2*f.tagsize + f.mi.sizePointer(p.Elem(), opts) } func appendGroupType(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { b = protowire.AppendVarint(b, f.wiretag) // start group b, err := f.mi.marshalAppendPointer(b, p.Elem(), opts) b = protowire.AppendVarint(b, f.wiretag+1) // end group return b, err } func consumeGroupType(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.StartGroupType { return out, errUnknown } if p.Elem().IsNil() { p.SetPointer(pointerOfValue(reflect.New(f.mi.GoReflectType.Elem()))) } return f.mi.unmarshalPointer(b, p.Elem(), f.num, opts) } func sizeGroup(m proto.Message, tagsize int, opts marshalOptions) int { return 2*tagsize + opts.Options().Size(m) } func appendGroup(b []byte, m proto.Message, wiretag uint64, opts marshalOptions) ([]byte, error) { b = protowire.AppendVarint(b, wiretag) // start group b, err := opts.Options().MarshalAppend(b, m) b = protowire.AppendVarint(b, wiretag+1) // end group return b, err } func consumeGroup(b []byte, m proto.Message, num protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.StartGroupType { return out, errUnknown } b, n := protowire.ConsumeGroup(num, b) if n < 0 { return out, errDecode } o, err := opts.Options().UnmarshalState(protoiface.UnmarshalInput{ Buf: b, Message: m.ProtoReflect(), }) if err != nil { return out, err } out.n = n out.initialized = o.Flags&protoiface.UnmarshalInitialized != 0 return out, nil } func makeMessageSliceFieldCoder(fd protoreflect.FieldDescriptor, ft reflect.Type) pointerCoderFuncs { if mi := getMessageInfo(ft); mi != nil { funcs := pointerCoderFuncs{ size: sizeMessageSliceInfo, marshal: appendMessageSliceInfo, unmarshal: consumeMessageSliceInfo, merge: mergeMessageSlice, } if needsInitCheck(mi.Desc) { funcs.isInit = isInitMessageSliceInfo } return funcs } return pointerCoderFuncs{ size: func(p pointer, f *coderFieldInfo, opts marshalOptions) int { return sizeMessageSlice(p, ft, f.tagsize, opts) }, marshal: func(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { return appendMessageSlice(b, p, f.wiretag, ft, opts) }, unmarshal: func(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (unmarshalOutput, error) { return consumeMessageSlice(b, p, ft, wtyp, opts) }, isInit: func(p pointer, f *coderFieldInfo) error { return isInitMessageSlice(p, ft) }, merge: mergeMessageSlice, } } func sizeMessageSliceInfo(p pointer, f *coderFieldInfo, opts marshalOptions) int { s := p.PointerSlice() n := 0 for _, v := range s { n += protowire.SizeBytes(f.mi.sizePointer(v, opts)) + f.tagsize } return n } func appendMessageSliceInfo(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { s := p.PointerSlice() var err error for _, v := range s { b = protowire.AppendVarint(b, f.wiretag) siz := f.mi.sizePointer(v, opts) b = protowire.AppendVarint(b, uint64(siz)) before := len(b) b, err = f.mi.marshalAppendPointer(b, v, opts) if err != nil { return b, err } if measuredSize := len(b) - before; siz != measuredSize { return nil, errors.MismatchedSizeCalculation(siz, measuredSize) } } return b, nil } func consumeMessageSliceInfo(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.BytesType { return out, errUnknown } v, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } m := reflect.New(f.mi.GoReflectType.Elem()).Interface() mp := pointerOfIface(m) o, err := f.mi.unmarshalPointer(v, mp, 0, opts) if err != nil { return out, err } p.AppendPointerSlice(mp) out.n = n out.initialized = o.initialized return out, nil } func isInitMessageSliceInfo(p pointer, f *coderFieldInfo) error { s := p.PointerSlice() for _, v := range s { if err := f.mi.checkInitializedPointer(v); err != nil { return err } } return nil } func sizeMessageSlice(p pointer, goType reflect.Type, tagsize int, opts marshalOptions) int { mopts := opts.Options() s := p.PointerSlice() n := 0 for _, v := range s { m := asMessage(v.AsValueOf(goType.Elem())) n += protowire.SizeBytes(mopts.Size(m)) + tagsize } return n } func appendMessageSlice(b []byte, p pointer, wiretag uint64, goType reflect.Type, opts marshalOptions) ([]byte, error) { mopts := opts.Options() s := p.PointerSlice() var err error for _, v := range s { m := asMessage(v.AsValueOf(goType.Elem())) b = protowire.AppendVarint(b, wiretag) siz := mopts.Size(m) b = protowire.AppendVarint(b, uint64(siz)) before := len(b) b, err = mopts.MarshalAppend(b, m) if err != nil { return b, err } if measuredSize := len(b) - before; siz != measuredSize { return nil, errors.MismatchedSizeCalculation(siz, measuredSize) } } return b, nil } func consumeMessageSlice(b []byte, p pointer, goType reflect.Type, wtyp protowire.Type, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.BytesType { return out, errUnknown } v, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } mp := reflect.New(goType.Elem()) o, err := opts.Options().UnmarshalState(protoiface.UnmarshalInput{ Buf: v, Message: asMessage(mp).ProtoReflect(), }) if err != nil { return out, err } p.AppendPointerSlice(pointerOfValue(mp)) out.n = n out.initialized = o.Flags&protoiface.UnmarshalInitialized != 0 return out, nil } func isInitMessageSlice(p pointer, goType reflect.Type) error { s := p.PointerSlice() for _, v := range s { m := asMessage(v.AsValueOf(goType.Elem())) if err := proto.CheckInitialized(m); err != nil { return err } } return nil } // Slices of messages func sizeMessageSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) int { mopts := opts.Options() list := listv.List() n := 0 for i, llen := 0, list.Len(); i < llen; i++ { m := list.Get(i).Message().Interface() n += protowire.SizeBytes(mopts.Size(m)) + tagsize } return n } func appendMessageSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { list := listv.List() mopts := opts.Options() for i, llen := 0, list.Len(); i < llen; i++ { m := list.Get(i).Message().Interface() b = protowire.AppendVarint(b, wiretag) siz := mopts.Size(m) b = protowire.AppendVarint(b, uint64(siz)) before := len(b) var err error b, err = mopts.MarshalAppend(b, m) if err != nil { return b, err } if measuredSize := len(b) - before; siz != measuredSize { return nil, errors.MismatchedSizeCalculation(siz, measuredSize) } } return b, nil } func consumeMessageSliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) { list := listv.List() if wtyp != protowire.BytesType { return protoreflect.Value{}, out, errUnknown } v, n := protowire.ConsumeBytes(b) if n < 0 { return protoreflect.Value{}, out, errDecode } m := list.NewElement() o, err := opts.Options().UnmarshalState(protoiface.UnmarshalInput{ Buf: v, Message: m.Message(), }) if err != nil { return protoreflect.Value{}, out, err } list.Append(m) out.n = n out.initialized = o.Flags&protoiface.UnmarshalInitialized != 0 return listv, out, nil } func isInitMessageSliceValue(listv protoreflect.Value) error { list := listv.List() for i, llen := 0, list.Len(); i < llen; i++ { m := list.Get(i).Message().Interface() if err := proto.CheckInitialized(m); err != nil { return err } } return nil } var coderMessageSliceValue = valueCoderFuncs{ size: sizeMessageSliceValue, marshal: appendMessageSliceValue, unmarshal: consumeMessageSliceValue, isInit: isInitMessageSliceValue, merge: mergeMessageListValue, } func sizeGroupSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) int { mopts := opts.Options() list := listv.List() n := 0 for i, llen := 0, list.Len(); i < llen; i++ { m := list.Get(i).Message().Interface() n += 2*tagsize + mopts.Size(m) } return n } func appendGroupSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { list := listv.List() mopts := opts.Options() for i, llen := 0, list.Len(); i < llen; i++ { m := list.Get(i).Message().Interface() b = protowire.AppendVarint(b, wiretag) // start group var err error b, err = mopts.MarshalAppend(b, m) if err != nil { return b, err } b = protowire.AppendVarint(b, wiretag+1) // end group } return b, nil } func consumeGroupSliceValue(b []byte, listv protoreflect.Value, num protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) { list := listv.List() if wtyp != protowire.StartGroupType { return protoreflect.Value{}, out, errUnknown } b, n := protowire.ConsumeGroup(num, b) if n < 0 { return protoreflect.Value{}, out, errDecode } m := list.NewElement() o, err := opts.Options().UnmarshalState(protoiface.UnmarshalInput{ Buf: b, Message: m.Message(), }) if err != nil { return protoreflect.Value{}, out, err } list.Append(m) out.n = n out.initialized = o.Flags&protoiface.UnmarshalInitialized != 0 return listv, out, nil } var coderGroupSliceValue = valueCoderFuncs{ size: sizeGroupSliceValue, marshal: appendGroupSliceValue, unmarshal: consumeGroupSliceValue, isInit: isInitMessageSliceValue, merge: mergeMessageListValue, } func makeGroupSliceFieldCoder(fd protoreflect.FieldDescriptor, ft reflect.Type) pointerCoderFuncs { num := fd.Number() if mi := getMessageInfo(ft); mi != nil { funcs := pointerCoderFuncs{ size: sizeGroupSliceInfo, marshal: appendGroupSliceInfo, unmarshal: consumeGroupSliceInfo, merge: mergeMessageSlice, } if needsInitCheck(mi.Desc) { funcs.isInit = isInitMessageSliceInfo } return funcs } return pointerCoderFuncs{ size: func(p pointer, f *coderFieldInfo, opts marshalOptions) int { return sizeGroupSlice(p, ft, f.tagsize, opts) }, marshal: func(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { return appendGroupSlice(b, p, f.wiretag, ft, opts) }, unmarshal: func(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (unmarshalOutput, error) { return consumeGroupSlice(b, p, num, wtyp, ft, opts) }, isInit: func(p pointer, f *coderFieldInfo) error { return isInitMessageSlice(p, ft) }, merge: mergeMessageSlice, } } func sizeGroupSlice(p pointer, messageType reflect.Type, tagsize int, opts marshalOptions) int { mopts := opts.Options() s := p.PointerSlice() n := 0 for _, v := range s { m := asMessage(v.AsValueOf(messageType.Elem())) n += 2*tagsize + mopts.Size(m) } return n } func appendGroupSlice(b []byte, p pointer, wiretag uint64, messageType reflect.Type, opts marshalOptions) ([]byte, error) { s := p.PointerSlice() var err error for _, v := range s { m := asMessage(v.AsValueOf(messageType.Elem())) b = protowire.AppendVarint(b, wiretag) // start group b, err = opts.Options().MarshalAppend(b, m) if err != nil { return b, err } b = protowire.AppendVarint(b, wiretag+1) // end group } return b, nil } func consumeGroupSlice(b []byte, p pointer, num protowire.Number, wtyp protowire.Type, goType reflect.Type, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.StartGroupType { return out, errUnknown } b, n := protowire.ConsumeGroup(num, b) if n < 0 { return out, errDecode } mp := reflect.New(goType.Elem()) o, err := opts.Options().UnmarshalState(protoiface.UnmarshalInput{ Buf: b, Message: asMessage(mp).ProtoReflect(), }) if err != nil { return out, err } p.AppendPointerSlice(pointerOfValue(mp)) out.n = n out.initialized = o.Flags&protoiface.UnmarshalInitialized != 0 return out, nil } func sizeGroupSliceInfo(p pointer, f *coderFieldInfo, opts marshalOptions) int { s := p.PointerSlice() n := 0 for _, v := range s { n += 2*f.tagsize + f.mi.sizePointer(v, opts) } return n } func appendGroupSliceInfo(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { s := p.PointerSlice() var err error for _, v := range s { b = protowire.AppendVarint(b, f.wiretag) // start group b, err = f.mi.marshalAppendPointer(b, v, opts) if err != nil { return b, err } b = protowire.AppendVarint(b, f.wiretag+1) // end group } return b, nil } func consumeGroupSliceInfo(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (unmarshalOutput, error) { if wtyp != protowire.StartGroupType { return unmarshalOutput{}, errUnknown } m := reflect.New(f.mi.GoReflectType.Elem()).Interface() mp := pointerOfIface(m) out, err := f.mi.unmarshalPointer(b, mp, f.num, opts) if err != nil { return out, err } p.AppendPointerSlice(mp) return out, nil } func asMessage(v reflect.Value) protoreflect.ProtoMessage { if m, ok := v.Interface().(protoreflect.ProtoMessage); ok { return m } return legacyWrapMessage(v).Interface() } ================================================ FILE: vendor/google.golang.org/protobuf/internal/impl/codec_field_opaque.go ================================================ // Copyright 2024 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package impl import ( "fmt" "reflect" "google.golang.org/protobuf/encoding/protowire" "google.golang.org/protobuf/internal/errors" "google.golang.org/protobuf/reflect/protoreflect" ) func makeOpaqueMessageFieldCoder(fd protoreflect.FieldDescriptor, ft reflect.Type) (*MessageInfo, pointerCoderFuncs) { mi := getMessageInfo(ft) if mi == nil { panic(fmt.Sprintf("invalid field: %v: unsupported message type %v", fd.FullName(), ft)) } switch fd.Kind() { case protoreflect.MessageKind: return mi, pointerCoderFuncs{ size: sizeOpaqueMessage, marshal: appendOpaqueMessage, unmarshal: consumeOpaqueMessage, isInit: isInitOpaqueMessage, merge: mergeOpaqueMessage, } case protoreflect.GroupKind: return mi, pointerCoderFuncs{ size: sizeOpaqueGroup, marshal: appendOpaqueGroup, unmarshal: consumeOpaqueGroup, isInit: isInitOpaqueMessage, merge: mergeOpaqueMessage, } } panic("unexpected field kind") } func sizeOpaqueMessage(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { return protowire.SizeBytes(f.mi.sizePointer(p.AtomicGetPointer(), opts)) + f.tagsize } func appendOpaqueMessage(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { mp := p.AtomicGetPointer() calculatedSize := f.mi.sizePointer(mp, opts) b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendVarint(b, uint64(calculatedSize)) before := len(b) b, err := f.mi.marshalAppendPointer(b, mp, opts) if measuredSize := len(b) - before; calculatedSize != measuredSize && err == nil { return nil, errors.MismatchedSizeCalculation(calculatedSize, measuredSize) } return b, err } func consumeOpaqueMessage(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.BytesType { return out, errUnknown } v, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } mp := p.AtomicGetPointer() if mp.IsNil() { mp = p.AtomicSetPointerIfNil(pointerOfValue(reflect.New(f.mi.GoReflectType.Elem()))) } o, err := f.mi.unmarshalPointer(v, mp, 0, opts) if err != nil { return out, err } out.n = n out.initialized = o.initialized return out, nil } func isInitOpaqueMessage(p pointer, f *coderFieldInfo) error { mp := p.AtomicGetPointer() if mp.IsNil() { return nil } return f.mi.checkInitializedPointer(mp) } func mergeOpaqueMessage(dst, src pointer, f *coderFieldInfo, opts mergeOptions) { dstmp := dst.AtomicGetPointer() if dstmp.IsNil() { dstmp = dst.AtomicSetPointerIfNil(pointerOfValue(reflect.New(f.mi.GoReflectType.Elem()))) } f.mi.mergePointer(dstmp, src.AtomicGetPointer(), opts) } func sizeOpaqueGroup(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { return 2*f.tagsize + f.mi.sizePointer(p.AtomicGetPointer(), opts) } func appendOpaqueGroup(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { b = protowire.AppendVarint(b, f.wiretag) // start group b, err := f.mi.marshalAppendPointer(b, p.AtomicGetPointer(), opts) b = protowire.AppendVarint(b, f.wiretag+1) // end group return b, err } func consumeOpaqueGroup(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.StartGroupType { return out, errUnknown } mp := p.AtomicGetPointer() if mp.IsNil() { mp = p.AtomicSetPointerIfNil(pointerOfValue(reflect.New(f.mi.GoReflectType.Elem()))) } o, e := f.mi.unmarshalPointer(b, mp, f.num, opts) return o, e } func makeOpaqueRepeatedMessageFieldCoder(fd protoreflect.FieldDescriptor, ft reflect.Type) (*MessageInfo, pointerCoderFuncs) { if ft.Kind() != reflect.Ptr || ft.Elem().Kind() != reflect.Slice { panic(fmt.Sprintf("invalid field: %v: unsupported type for opaque repeated message: %v", fd.FullName(), ft)) } mt := ft.Elem().Elem() // *[]*T -> *T mi := getMessageInfo(mt) if mi == nil { panic(fmt.Sprintf("invalid field: %v: unsupported message type %v", fd.FullName(), mt)) } switch fd.Kind() { case protoreflect.MessageKind: return mi, pointerCoderFuncs{ size: sizeOpaqueMessageSlice, marshal: appendOpaqueMessageSlice, unmarshal: consumeOpaqueMessageSlice, isInit: isInitOpaqueMessageSlice, merge: mergeOpaqueMessageSlice, } case protoreflect.GroupKind: return mi, pointerCoderFuncs{ size: sizeOpaqueGroupSlice, marshal: appendOpaqueGroupSlice, unmarshal: consumeOpaqueGroupSlice, isInit: isInitOpaqueMessageSlice, merge: mergeOpaqueMessageSlice, } } panic("unexpected field kind") } func sizeOpaqueMessageSlice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { s := p.AtomicGetPointer().PointerSlice() n := 0 for _, v := range s { n += protowire.SizeBytes(f.mi.sizePointer(v, opts)) + f.tagsize } return n } func appendOpaqueMessageSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { s := p.AtomicGetPointer().PointerSlice() var err error for _, v := range s { b = protowire.AppendVarint(b, f.wiretag) siz := f.mi.sizePointer(v, opts) b = protowire.AppendVarint(b, uint64(siz)) before := len(b) b, err = f.mi.marshalAppendPointer(b, v, opts) if err != nil { return b, err } if measuredSize := len(b) - before; siz != measuredSize { return nil, errors.MismatchedSizeCalculation(siz, measuredSize) } } return b, nil } func consumeOpaqueMessageSlice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.BytesType { return out, errUnknown } v, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } mp := pointerOfValue(reflect.New(f.mi.GoReflectType.Elem())) o, err := f.mi.unmarshalPointer(v, mp, 0, opts) if err != nil { return out, err } sp := p.AtomicGetPointer() if sp.IsNil() { sp = p.AtomicSetPointerIfNil(pointerOfValue(reflect.New(f.ft.Elem()))) } sp.AppendPointerSlice(mp) out.n = n out.initialized = o.initialized return out, nil } func isInitOpaqueMessageSlice(p pointer, f *coderFieldInfo) error { sp := p.AtomicGetPointer() if sp.IsNil() { return nil } s := sp.PointerSlice() for _, v := range s { if err := f.mi.checkInitializedPointer(v); err != nil { return err } } return nil } func mergeOpaqueMessageSlice(dst, src pointer, f *coderFieldInfo, opts mergeOptions) { ds := dst.AtomicGetPointer() if ds.IsNil() { ds = dst.AtomicSetPointerIfNil(pointerOfValue(reflect.New(f.ft.Elem()))) } for _, sp := range src.AtomicGetPointer().PointerSlice() { dm := pointerOfValue(reflect.New(f.mi.GoReflectType.Elem())) f.mi.mergePointer(dm, sp, opts) ds.AppendPointerSlice(dm) } } func sizeOpaqueGroupSlice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { s := p.AtomicGetPointer().PointerSlice() n := 0 for _, v := range s { n += 2*f.tagsize + f.mi.sizePointer(v, opts) } return n } func appendOpaqueGroupSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { s := p.AtomicGetPointer().PointerSlice() var err error for _, v := range s { b = protowire.AppendVarint(b, f.wiretag) // start group b, err = f.mi.marshalAppendPointer(b, v, opts) if err != nil { return b, err } b = protowire.AppendVarint(b, f.wiretag+1) // end group } return b, nil } func consumeOpaqueGroupSlice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.StartGroupType { return out, errUnknown } mp := pointerOfValue(reflect.New(f.mi.GoReflectType.Elem())) out, err = f.mi.unmarshalPointer(b, mp, f.num, opts) if err != nil { return out, err } sp := p.AtomicGetPointer() if sp.IsNil() { sp = p.AtomicSetPointerIfNil(pointerOfValue(reflect.New(f.ft.Elem()))) } sp.AppendPointerSlice(mp) return out, err } ================================================ FILE: vendor/google.golang.org/protobuf/internal/impl/codec_gen.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Code generated by generate-types. DO NOT EDIT. package impl import ( "math" "unicode/utf8" "google.golang.org/protobuf/encoding/protowire" "google.golang.org/protobuf/reflect/protoreflect" ) // sizeBool returns the size of wire encoding a bool pointer as a Bool. func sizeBool(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { v := *p.Bool() return f.tagsize + protowire.SizeVarint(protowire.EncodeBool(v)) } // appendBool wire encodes a bool pointer as a Bool. func appendBool(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := *p.Bool() b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendVarint(b, protowire.EncodeBool(v)) return b, nil } // consumeBool wire decodes a bool pointer as a Bool. func consumeBool(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.VarintType { return out, errUnknown } var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return out, errDecode } *p.Bool() = protowire.DecodeBool(v) out.n = n return out, nil } var coderBool = pointerCoderFuncs{ size: sizeBool, marshal: appendBool, unmarshal: consumeBool, merge: mergeBool, } // sizeBoolNoZero returns the size of wire encoding a bool pointer as a Bool. // The zero value is not encoded. func sizeBoolNoZero(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { v := *p.Bool() if v == false { return 0 } return f.tagsize + protowire.SizeVarint(protowire.EncodeBool(v)) } // appendBoolNoZero wire encodes a bool pointer as a Bool. // The zero value is not encoded. func appendBoolNoZero(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := *p.Bool() if v == false { return b, nil } b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendVarint(b, protowire.EncodeBool(v)) return b, nil } var coderBoolNoZero = pointerCoderFuncs{ size: sizeBoolNoZero, marshal: appendBoolNoZero, unmarshal: consumeBool, merge: mergeBoolNoZero, } // sizeBoolPtr returns the size of wire encoding a *bool pointer as a Bool. // It panics if the pointer is nil. func sizeBoolPtr(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { v := **p.BoolPtr() return f.tagsize + protowire.SizeVarint(protowire.EncodeBool(v)) } // appendBoolPtr wire encodes a *bool pointer as a Bool. // It panics if the pointer is nil. func appendBoolPtr(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := **p.BoolPtr() b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendVarint(b, protowire.EncodeBool(v)) return b, nil } // consumeBoolPtr wire decodes a *bool pointer as a Bool. func consumeBoolPtr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.VarintType { return out, errUnknown } var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return out, errDecode } vp := p.BoolPtr() if *vp == nil { *vp = new(bool) } **vp = protowire.DecodeBool(v) out.n = n return out, nil } var coderBoolPtr = pointerCoderFuncs{ size: sizeBoolPtr, marshal: appendBoolPtr, unmarshal: consumeBoolPtr, merge: mergeBoolPtr, } // sizeBoolSlice returns the size of wire encoding a []bool pointer as a repeated Bool. func sizeBoolSlice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { s := *p.BoolSlice() for _, v := range s { size += f.tagsize + protowire.SizeVarint(protowire.EncodeBool(v)) } return size } // appendBoolSlice encodes a []bool pointer as a repeated Bool. func appendBoolSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { s := *p.BoolSlice() for _, v := range s { b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendVarint(b, protowire.EncodeBool(v)) } return b, nil } // consumeBoolSlice wire decodes a []bool pointer as a repeated Bool. func consumeBoolSlice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { sp := p.BoolSlice() if wtyp == protowire.BytesType { b, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } count := 0 for _, v := range b { if v < 0x80 { count++ } } if count > 0 { p.growBoolSlice(count) } s := *sp for len(b) > 0 { var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return out, errDecode } s = append(s, protowire.DecodeBool(v)) b = b[n:] } *sp = s out.n = n return out, nil } if wtyp != protowire.VarintType { return out, errUnknown } var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return out, errDecode } *sp = append(*sp, protowire.DecodeBool(v)) out.n = n return out, nil } var coderBoolSlice = pointerCoderFuncs{ size: sizeBoolSlice, marshal: appendBoolSlice, unmarshal: consumeBoolSlice, merge: mergeBoolSlice, } // sizeBoolPackedSlice returns the size of wire encoding a []bool pointer as a packed repeated Bool. func sizeBoolPackedSlice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { s := *p.BoolSlice() if len(s) == 0 { return 0 } n := 0 for _, v := range s { n += protowire.SizeVarint(protowire.EncodeBool(v)) } return f.tagsize + protowire.SizeBytes(n) } // appendBoolPackedSlice encodes a []bool pointer as a packed repeated Bool. func appendBoolPackedSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { s := *p.BoolSlice() if len(s) == 0 { return b, nil } b = protowire.AppendVarint(b, f.wiretag) n := 0 for _, v := range s { n += protowire.SizeVarint(protowire.EncodeBool(v)) } b = protowire.AppendVarint(b, uint64(n)) for _, v := range s { b = protowire.AppendVarint(b, protowire.EncodeBool(v)) } return b, nil } var coderBoolPackedSlice = pointerCoderFuncs{ size: sizeBoolPackedSlice, marshal: appendBoolPackedSlice, unmarshal: consumeBoolSlice, merge: mergeBoolSlice, } // sizeBoolValue returns the size of wire encoding a bool value as a Bool. func sizeBoolValue(v protoreflect.Value, tagsize int, opts marshalOptions) int { return tagsize + protowire.SizeVarint(protowire.EncodeBool(v.Bool())) } // appendBoolValue encodes a bool value as a Bool. func appendBoolValue(b []byte, v protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { b = protowire.AppendVarint(b, wiretag) b = protowire.AppendVarint(b, protowire.EncodeBool(v.Bool())) return b, nil } // consumeBoolValue decodes a bool value as a Bool. func consumeBoolValue(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) { if wtyp != protowire.VarintType { return protoreflect.Value{}, out, errUnknown } var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return protoreflect.Value{}, out, errDecode } out.n = n return protoreflect.ValueOfBool(protowire.DecodeBool(v)), out, nil } var coderBoolValue = valueCoderFuncs{ size: sizeBoolValue, marshal: appendBoolValue, unmarshal: consumeBoolValue, merge: mergeScalarValue, } // sizeBoolSliceValue returns the size of wire encoding a []bool value as a repeated Bool. func sizeBoolSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) { list := listv.List() for i, llen := 0, list.Len(); i < llen; i++ { v := list.Get(i) size += tagsize + protowire.SizeVarint(protowire.EncodeBool(v.Bool())) } return size } // appendBoolSliceValue encodes a []bool value as a repeated Bool. func appendBoolSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { list := listv.List() for i, llen := 0, list.Len(); i < llen; i++ { v := list.Get(i) b = protowire.AppendVarint(b, wiretag) b = protowire.AppendVarint(b, protowire.EncodeBool(v.Bool())) } return b, nil } // consumeBoolSliceValue wire decodes a []bool value as a repeated Bool. func consumeBoolSliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) { list := listv.List() if wtyp == protowire.BytesType { b, n := protowire.ConsumeBytes(b) if n < 0 { return protoreflect.Value{}, out, errDecode } for len(b) > 0 { var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return protoreflect.Value{}, out, errDecode } list.Append(protoreflect.ValueOfBool(protowire.DecodeBool(v))) b = b[n:] } out.n = n return listv, out, nil } if wtyp != protowire.VarintType { return protoreflect.Value{}, out, errUnknown } var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return protoreflect.Value{}, out, errDecode } list.Append(protoreflect.ValueOfBool(protowire.DecodeBool(v))) out.n = n return listv, out, nil } var coderBoolSliceValue = valueCoderFuncs{ size: sizeBoolSliceValue, marshal: appendBoolSliceValue, unmarshal: consumeBoolSliceValue, merge: mergeListValue, } // sizeBoolPackedSliceValue returns the size of wire encoding a []bool value as a packed repeated Bool. func sizeBoolPackedSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) { list := listv.List() llen := list.Len() if llen == 0 { return 0 } n := 0 for i, llen := 0, llen; i < llen; i++ { v := list.Get(i) n += protowire.SizeVarint(protowire.EncodeBool(v.Bool())) } return tagsize + protowire.SizeBytes(n) } // appendBoolPackedSliceValue encodes a []bool value as a packed repeated Bool. func appendBoolPackedSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { list := listv.List() llen := list.Len() if llen == 0 { return b, nil } b = protowire.AppendVarint(b, wiretag) n := 0 for i := 0; i < llen; i++ { v := list.Get(i) n += protowire.SizeVarint(protowire.EncodeBool(v.Bool())) } b = protowire.AppendVarint(b, uint64(n)) for i := 0; i < llen; i++ { v := list.Get(i) b = protowire.AppendVarint(b, protowire.EncodeBool(v.Bool())) } return b, nil } var coderBoolPackedSliceValue = valueCoderFuncs{ size: sizeBoolPackedSliceValue, marshal: appendBoolPackedSliceValue, unmarshal: consumeBoolSliceValue, merge: mergeListValue, } // sizeEnumValue returns the size of wire encoding a value as a Enum. func sizeEnumValue(v protoreflect.Value, tagsize int, opts marshalOptions) int { return tagsize + protowire.SizeVarint(uint64(v.Enum())) } // appendEnumValue encodes a value as a Enum. func appendEnumValue(b []byte, v protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { b = protowire.AppendVarint(b, wiretag) b = protowire.AppendVarint(b, uint64(v.Enum())) return b, nil } // consumeEnumValue decodes a value as a Enum. func consumeEnumValue(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) { if wtyp != protowire.VarintType { return protoreflect.Value{}, out, errUnknown } var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return protoreflect.Value{}, out, errDecode } out.n = n return protoreflect.ValueOfEnum(protoreflect.EnumNumber(v)), out, nil } var coderEnumValue = valueCoderFuncs{ size: sizeEnumValue, marshal: appendEnumValue, unmarshal: consumeEnumValue, merge: mergeScalarValue, } // sizeEnumSliceValue returns the size of wire encoding a [] value as a repeated Enum. func sizeEnumSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) { list := listv.List() for i, llen := 0, list.Len(); i < llen; i++ { v := list.Get(i) size += tagsize + protowire.SizeVarint(uint64(v.Enum())) } return size } // appendEnumSliceValue encodes a [] value as a repeated Enum. func appendEnumSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { list := listv.List() for i, llen := 0, list.Len(); i < llen; i++ { v := list.Get(i) b = protowire.AppendVarint(b, wiretag) b = protowire.AppendVarint(b, uint64(v.Enum())) } return b, nil } // consumeEnumSliceValue wire decodes a [] value as a repeated Enum. func consumeEnumSliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) { list := listv.List() if wtyp == protowire.BytesType { b, n := protowire.ConsumeBytes(b) if n < 0 { return protoreflect.Value{}, out, errDecode } for len(b) > 0 { var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return protoreflect.Value{}, out, errDecode } list.Append(protoreflect.ValueOfEnum(protoreflect.EnumNumber(v))) b = b[n:] } out.n = n return listv, out, nil } if wtyp != protowire.VarintType { return protoreflect.Value{}, out, errUnknown } var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return protoreflect.Value{}, out, errDecode } list.Append(protoreflect.ValueOfEnum(protoreflect.EnumNumber(v))) out.n = n return listv, out, nil } var coderEnumSliceValue = valueCoderFuncs{ size: sizeEnumSliceValue, marshal: appendEnumSliceValue, unmarshal: consumeEnumSliceValue, merge: mergeListValue, } // sizeEnumPackedSliceValue returns the size of wire encoding a [] value as a packed repeated Enum. func sizeEnumPackedSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) { list := listv.List() llen := list.Len() if llen == 0 { return 0 } n := 0 for i, llen := 0, llen; i < llen; i++ { v := list.Get(i) n += protowire.SizeVarint(uint64(v.Enum())) } return tagsize + protowire.SizeBytes(n) } // appendEnumPackedSliceValue encodes a [] value as a packed repeated Enum. func appendEnumPackedSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { list := listv.List() llen := list.Len() if llen == 0 { return b, nil } b = protowire.AppendVarint(b, wiretag) n := 0 for i := 0; i < llen; i++ { v := list.Get(i) n += protowire.SizeVarint(uint64(v.Enum())) } b = protowire.AppendVarint(b, uint64(n)) for i := 0; i < llen; i++ { v := list.Get(i) b = protowire.AppendVarint(b, uint64(v.Enum())) } return b, nil } var coderEnumPackedSliceValue = valueCoderFuncs{ size: sizeEnumPackedSliceValue, marshal: appendEnumPackedSliceValue, unmarshal: consumeEnumSliceValue, merge: mergeListValue, } // sizeInt32 returns the size of wire encoding a int32 pointer as a Int32. func sizeInt32(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { v := *p.Int32() return f.tagsize + protowire.SizeVarint(uint64(v)) } // appendInt32 wire encodes a int32 pointer as a Int32. func appendInt32(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := *p.Int32() b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendVarint(b, uint64(v)) return b, nil } // consumeInt32 wire decodes a int32 pointer as a Int32. func consumeInt32(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.VarintType { return out, errUnknown } var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return out, errDecode } *p.Int32() = int32(v) out.n = n return out, nil } var coderInt32 = pointerCoderFuncs{ size: sizeInt32, marshal: appendInt32, unmarshal: consumeInt32, merge: mergeInt32, } // sizeInt32NoZero returns the size of wire encoding a int32 pointer as a Int32. // The zero value is not encoded. func sizeInt32NoZero(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { v := *p.Int32() if v == 0 { return 0 } return f.tagsize + protowire.SizeVarint(uint64(v)) } // appendInt32NoZero wire encodes a int32 pointer as a Int32. // The zero value is not encoded. func appendInt32NoZero(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := *p.Int32() if v == 0 { return b, nil } b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendVarint(b, uint64(v)) return b, nil } var coderInt32NoZero = pointerCoderFuncs{ size: sizeInt32NoZero, marshal: appendInt32NoZero, unmarshal: consumeInt32, merge: mergeInt32NoZero, } // sizeInt32Ptr returns the size of wire encoding a *int32 pointer as a Int32. // It panics if the pointer is nil. func sizeInt32Ptr(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { v := **p.Int32Ptr() return f.tagsize + protowire.SizeVarint(uint64(v)) } // appendInt32Ptr wire encodes a *int32 pointer as a Int32. // It panics if the pointer is nil. func appendInt32Ptr(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := **p.Int32Ptr() b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendVarint(b, uint64(v)) return b, nil } // consumeInt32Ptr wire decodes a *int32 pointer as a Int32. func consumeInt32Ptr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.VarintType { return out, errUnknown } var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return out, errDecode } vp := p.Int32Ptr() if *vp == nil { *vp = new(int32) } **vp = int32(v) out.n = n return out, nil } var coderInt32Ptr = pointerCoderFuncs{ size: sizeInt32Ptr, marshal: appendInt32Ptr, unmarshal: consumeInt32Ptr, merge: mergeInt32Ptr, } // sizeInt32Slice returns the size of wire encoding a []int32 pointer as a repeated Int32. func sizeInt32Slice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { s := *p.Int32Slice() for _, v := range s { size += f.tagsize + protowire.SizeVarint(uint64(v)) } return size } // appendInt32Slice encodes a []int32 pointer as a repeated Int32. func appendInt32Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { s := *p.Int32Slice() for _, v := range s { b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendVarint(b, uint64(v)) } return b, nil } // consumeInt32Slice wire decodes a []int32 pointer as a repeated Int32. func consumeInt32Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { sp := p.Int32Slice() if wtyp == protowire.BytesType { b, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } count := 0 for _, v := range b { if v < 0x80 { count++ } } if count > 0 { p.growInt32Slice(count) } s := *sp for len(b) > 0 { var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return out, errDecode } s = append(s, int32(v)) b = b[n:] } *sp = s out.n = n return out, nil } if wtyp != protowire.VarintType { return out, errUnknown } var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return out, errDecode } *sp = append(*sp, int32(v)) out.n = n return out, nil } var coderInt32Slice = pointerCoderFuncs{ size: sizeInt32Slice, marshal: appendInt32Slice, unmarshal: consumeInt32Slice, merge: mergeInt32Slice, } // sizeInt32PackedSlice returns the size of wire encoding a []int32 pointer as a packed repeated Int32. func sizeInt32PackedSlice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { s := *p.Int32Slice() if len(s) == 0 { return 0 } n := 0 for _, v := range s { n += protowire.SizeVarint(uint64(v)) } return f.tagsize + protowire.SizeBytes(n) } // appendInt32PackedSlice encodes a []int32 pointer as a packed repeated Int32. func appendInt32PackedSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { s := *p.Int32Slice() if len(s) == 0 { return b, nil } b = protowire.AppendVarint(b, f.wiretag) n := 0 for _, v := range s { n += protowire.SizeVarint(uint64(v)) } b = protowire.AppendVarint(b, uint64(n)) for _, v := range s { b = protowire.AppendVarint(b, uint64(v)) } return b, nil } var coderInt32PackedSlice = pointerCoderFuncs{ size: sizeInt32PackedSlice, marshal: appendInt32PackedSlice, unmarshal: consumeInt32Slice, merge: mergeInt32Slice, } // sizeInt32Value returns the size of wire encoding a int32 value as a Int32. func sizeInt32Value(v protoreflect.Value, tagsize int, opts marshalOptions) int { return tagsize + protowire.SizeVarint(uint64(int32(v.Int()))) } // appendInt32Value encodes a int32 value as a Int32. func appendInt32Value(b []byte, v protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { b = protowire.AppendVarint(b, wiretag) b = protowire.AppendVarint(b, uint64(int32(v.Int()))) return b, nil } // consumeInt32Value decodes a int32 value as a Int32. func consumeInt32Value(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) { if wtyp != protowire.VarintType { return protoreflect.Value{}, out, errUnknown } var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return protoreflect.Value{}, out, errDecode } out.n = n return protoreflect.ValueOfInt32(int32(v)), out, nil } var coderInt32Value = valueCoderFuncs{ size: sizeInt32Value, marshal: appendInt32Value, unmarshal: consumeInt32Value, merge: mergeScalarValue, } // sizeInt32SliceValue returns the size of wire encoding a []int32 value as a repeated Int32. func sizeInt32SliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) { list := listv.List() for i, llen := 0, list.Len(); i < llen; i++ { v := list.Get(i) size += tagsize + protowire.SizeVarint(uint64(int32(v.Int()))) } return size } // appendInt32SliceValue encodes a []int32 value as a repeated Int32. func appendInt32SliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { list := listv.List() for i, llen := 0, list.Len(); i < llen; i++ { v := list.Get(i) b = protowire.AppendVarint(b, wiretag) b = protowire.AppendVarint(b, uint64(int32(v.Int()))) } return b, nil } // consumeInt32SliceValue wire decodes a []int32 value as a repeated Int32. func consumeInt32SliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) { list := listv.List() if wtyp == protowire.BytesType { b, n := protowire.ConsumeBytes(b) if n < 0 { return protoreflect.Value{}, out, errDecode } for len(b) > 0 { var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return protoreflect.Value{}, out, errDecode } list.Append(protoreflect.ValueOfInt32(int32(v))) b = b[n:] } out.n = n return listv, out, nil } if wtyp != protowire.VarintType { return protoreflect.Value{}, out, errUnknown } var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return protoreflect.Value{}, out, errDecode } list.Append(protoreflect.ValueOfInt32(int32(v))) out.n = n return listv, out, nil } var coderInt32SliceValue = valueCoderFuncs{ size: sizeInt32SliceValue, marshal: appendInt32SliceValue, unmarshal: consumeInt32SliceValue, merge: mergeListValue, } // sizeInt32PackedSliceValue returns the size of wire encoding a []int32 value as a packed repeated Int32. func sizeInt32PackedSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) { list := listv.List() llen := list.Len() if llen == 0 { return 0 } n := 0 for i, llen := 0, llen; i < llen; i++ { v := list.Get(i) n += protowire.SizeVarint(uint64(int32(v.Int()))) } return tagsize + protowire.SizeBytes(n) } // appendInt32PackedSliceValue encodes a []int32 value as a packed repeated Int32. func appendInt32PackedSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { list := listv.List() llen := list.Len() if llen == 0 { return b, nil } b = protowire.AppendVarint(b, wiretag) n := 0 for i := 0; i < llen; i++ { v := list.Get(i) n += protowire.SizeVarint(uint64(int32(v.Int()))) } b = protowire.AppendVarint(b, uint64(n)) for i := 0; i < llen; i++ { v := list.Get(i) b = protowire.AppendVarint(b, uint64(int32(v.Int()))) } return b, nil } var coderInt32PackedSliceValue = valueCoderFuncs{ size: sizeInt32PackedSliceValue, marshal: appendInt32PackedSliceValue, unmarshal: consumeInt32SliceValue, merge: mergeListValue, } // sizeSint32 returns the size of wire encoding a int32 pointer as a Sint32. func sizeSint32(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { v := *p.Int32() return f.tagsize + protowire.SizeVarint(protowire.EncodeZigZag(int64(v))) } // appendSint32 wire encodes a int32 pointer as a Sint32. func appendSint32(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := *p.Int32() b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendVarint(b, protowire.EncodeZigZag(int64(v))) return b, nil } // consumeSint32 wire decodes a int32 pointer as a Sint32. func consumeSint32(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.VarintType { return out, errUnknown } var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return out, errDecode } *p.Int32() = int32(protowire.DecodeZigZag(v & math.MaxUint32)) out.n = n return out, nil } var coderSint32 = pointerCoderFuncs{ size: sizeSint32, marshal: appendSint32, unmarshal: consumeSint32, merge: mergeInt32, } // sizeSint32NoZero returns the size of wire encoding a int32 pointer as a Sint32. // The zero value is not encoded. func sizeSint32NoZero(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { v := *p.Int32() if v == 0 { return 0 } return f.tagsize + protowire.SizeVarint(protowire.EncodeZigZag(int64(v))) } // appendSint32NoZero wire encodes a int32 pointer as a Sint32. // The zero value is not encoded. func appendSint32NoZero(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := *p.Int32() if v == 0 { return b, nil } b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendVarint(b, protowire.EncodeZigZag(int64(v))) return b, nil } var coderSint32NoZero = pointerCoderFuncs{ size: sizeSint32NoZero, marshal: appendSint32NoZero, unmarshal: consumeSint32, merge: mergeInt32NoZero, } // sizeSint32Ptr returns the size of wire encoding a *int32 pointer as a Sint32. // It panics if the pointer is nil. func sizeSint32Ptr(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { v := **p.Int32Ptr() return f.tagsize + protowire.SizeVarint(protowire.EncodeZigZag(int64(v))) } // appendSint32Ptr wire encodes a *int32 pointer as a Sint32. // It panics if the pointer is nil. func appendSint32Ptr(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := **p.Int32Ptr() b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendVarint(b, protowire.EncodeZigZag(int64(v))) return b, nil } // consumeSint32Ptr wire decodes a *int32 pointer as a Sint32. func consumeSint32Ptr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.VarintType { return out, errUnknown } var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return out, errDecode } vp := p.Int32Ptr() if *vp == nil { *vp = new(int32) } **vp = int32(protowire.DecodeZigZag(v & math.MaxUint32)) out.n = n return out, nil } var coderSint32Ptr = pointerCoderFuncs{ size: sizeSint32Ptr, marshal: appendSint32Ptr, unmarshal: consumeSint32Ptr, merge: mergeInt32Ptr, } // sizeSint32Slice returns the size of wire encoding a []int32 pointer as a repeated Sint32. func sizeSint32Slice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { s := *p.Int32Slice() for _, v := range s { size += f.tagsize + protowire.SizeVarint(protowire.EncodeZigZag(int64(v))) } return size } // appendSint32Slice encodes a []int32 pointer as a repeated Sint32. func appendSint32Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { s := *p.Int32Slice() for _, v := range s { b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendVarint(b, protowire.EncodeZigZag(int64(v))) } return b, nil } // consumeSint32Slice wire decodes a []int32 pointer as a repeated Sint32. func consumeSint32Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { sp := p.Int32Slice() if wtyp == protowire.BytesType { b, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } count := 0 for _, v := range b { if v < 0x80 { count++ } } if count > 0 { p.growInt32Slice(count) } s := *sp for len(b) > 0 { var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return out, errDecode } s = append(s, int32(protowire.DecodeZigZag(v&math.MaxUint32))) b = b[n:] } *sp = s out.n = n return out, nil } if wtyp != protowire.VarintType { return out, errUnknown } var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return out, errDecode } *sp = append(*sp, int32(protowire.DecodeZigZag(v&math.MaxUint32))) out.n = n return out, nil } var coderSint32Slice = pointerCoderFuncs{ size: sizeSint32Slice, marshal: appendSint32Slice, unmarshal: consumeSint32Slice, merge: mergeInt32Slice, } // sizeSint32PackedSlice returns the size of wire encoding a []int32 pointer as a packed repeated Sint32. func sizeSint32PackedSlice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { s := *p.Int32Slice() if len(s) == 0 { return 0 } n := 0 for _, v := range s { n += protowire.SizeVarint(protowire.EncodeZigZag(int64(v))) } return f.tagsize + protowire.SizeBytes(n) } // appendSint32PackedSlice encodes a []int32 pointer as a packed repeated Sint32. func appendSint32PackedSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { s := *p.Int32Slice() if len(s) == 0 { return b, nil } b = protowire.AppendVarint(b, f.wiretag) n := 0 for _, v := range s { n += protowire.SizeVarint(protowire.EncodeZigZag(int64(v))) } b = protowire.AppendVarint(b, uint64(n)) for _, v := range s { b = protowire.AppendVarint(b, protowire.EncodeZigZag(int64(v))) } return b, nil } var coderSint32PackedSlice = pointerCoderFuncs{ size: sizeSint32PackedSlice, marshal: appendSint32PackedSlice, unmarshal: consumeSint32Slice, merge: mergeInt32Slice, } // sizeSint32Value returns the size of wire encoding a int32 value as a Sint32. func sizeSint32Value(v protoreflect.Value, tagsize int, opts marshalOptions) int { return tagsize + protowire.SizeVarint(protowire.EncodeZigZag(int64(int32(v.Int())))) } // appendSint32Value encodes a int32 value as a Sint32. func appendSint32Value(b []byte, v protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { b = protowire.AppendVarint(b, wiretag) b = protowire.AppendVarint(b, protowire.EncodeZigZag(int64(int32(v.Int())))) return b, nil } // consumeSint32Value decodes a int32 value as a Sint32. func consumeSint32Value(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) { if wtyp != protowire.VarintType { return protoreflect.Value{}, out, errUnknown } var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return protoreflect.Value{}, out, errDecode } out.n = n return protoreflect.ValueOfInt32(int32(protowire.DecodeZigZag(v & math.MaxUint32))), out, nil } var coderSint32Value = valueCoderFuncs{ size: sizeSint32Value, marshal: appendSint32Value, unmarshal: consumeSint32Value, merge: mergeScalarValue, } // sizeSint32SliceValue returns the size of wire encoding a []int32 value as a repeated Sint32. func sizeSint32SliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) { list := listv.List() for i, llen := 0, list.Len(); i < llen; i++ { v := list.Get(i) size += tagsize + protowire.SizeVarint(protowire.EncodeZigZag(int64(int32(v.Int())))) } return size } // appendSint32SliceValue encodes a []int32 value as a repeated Sint32. func appendSint32SliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { list := listv.List() for i, llen := 0, list.Len(); i < llen; i++ { v := list.Get(i) b = protowire.AppendVarint(b, wiretag) b = protowire.AppendVarint(b, protowire.EncodeZigZag(int64(int32(v.Int())))) } return b, nil } // consumeSint32SliceValue wire decodes a []int32 value as a repeated Sint32. func consumeSint32SliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) { list := listv.List() if wtyp == protowire.BytesType { b, n := protowire.ConsumeBytes(b) if n < 0 { return protoreflect.Value{}, out, errDecode } for len(b) > 0 { var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return protoreflect.Value{}, out, errDecode } list.Append(protoreflect.ValueOfInt32(int32(protowire.DecodeZigZag(v & math.MaxUint32)))) b = b[n:] } out.n = n return listv, out, nil } if wtyp != protowire.VarintType { return protoreflect.Value{}, out, errUnknown } var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return protoreflect.Value{}, out, errDecode } list.Append(protoreflect.ValueOfInt32(int32(protowire.DecodeZigZag(v & math.MaxUint32)))) out.n = n return listv, out, nil } var coderSint32SliceValue = valueCoderFuncs{ size: sizeSint32SliceValue, marshal: appendSint32SliceValue, unmarshal: consumeSint32SliceValue, merge: mergeListValue, } // sizeSint32PackedSliceValue returns the size of wire encoding a []int32 value as a packed repeated Sint32. func sizeSint32PackedSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) { list := listv.List() llen := list.Len() if llen == 0 { return 0 } n := 0 for i, llen := 0, llen; i < llen; i++ { v := list.Get(i) n += protowire.SizeVarint(protowire.EncodeZigZag(int64(int32(v.Int())))) } return tagsize + protowire.SizeBytes(n) } // appendSint32PackedSliceValue encodes a []int32 value as a packed repeated Sint32. func appendSint32PackedSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { list := listv.List() llen := list.Len() if llen == 0 { return b, nil } b = protowire.AppendVarint(b, wiretag) n := 0 for i := 0; i < llen; i++ { v := list.Get(i) n += protowire.SizeVarint(protowire.EncodeZigZag(int64(int32(v.Int())))) } b = protowire.AppendVarint(b, uint64(n)) for i := 0; i < llen; i++ { v := list.Get(i) b = protowire.AppendVarint(b, protowire.EncodeZigZag(int64(int32(v.Int())))) } return b, nil } var coderSint32PackedSliceValue = valueCoderFuncs{ size: sizeSint32PackedSliceValue, marshal: appendSint32PackedSliceValue, unmarshal: consumeSint32SliceValue, merge: mergeListValue, } // sizeUint32 returns the size of wire encoding a uint32 pointer as a Uint32. func sizeUint32(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { v := *p.Uint32() return f.tagsize + protowire.SizeVarint(uint64(v)) } // appendUint32 wire encodes a uint32 pointer as a Uint32. func appendUint32(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := *p.Uint32() b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendVarint(b, uint64(v)) return b, nil } // consumeUint32 wire decodes a uint32 pointer as a Uint32. func consumeUint32(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.VarintType { return out, errUnknown } var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return out, errDecode } *p.Uint32() = uint32(v) out.n = n return out, nil } var coderUint32 = pointerCoderFuncs{ size: sizeUint32, marshal: appendUint32, unmarshal: consumeUint32, merge: mergeUint32, } // sizeUint32NoZero returns the size of wire encoding a uint32 pointer as a Uint32. // The zero value is not encoded. func sizeUint32NoZero(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { v := *p.Uint32() if v == 0 { return 0 } return f.tagsize + protowire.SizeVarint(uint64(v)) } // appendUint32NoZero wire encodes a uint32 pointer as a Uint32. // The zero value is not encoded. func appendUint32NoZero(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := *p.Uint32() if v == 0 { return b, nil } b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendVarint(b, uint64(v)) return b, nil } var coderUint32NoZero = pointerCoderFuncs{ size: sizeUint32NoZero, marshal: appendUint32NoZero, unmarshal: consumeUint32, merge: mergeUint32NoZero, } // sizeUint32Ptr returns the size of wire encoding a *uint32 pointer as a Uint32. // It panics if the pointer is nil. func sizeUint32Ptr(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { v := **p.Uint32Ptr() return f.tagsize + protowire.SizeVarint(uint64(v)) } // appendUint32Ptr wire encodes a *uint32 pointer as a Uint32. // It panics if the pointer is nil. func appendUint32Ptr(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := **p.Uint32Ptr() b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendVarint(b, uint64(v)) return b, nil } // consumeUint32Ptr wire decodes a *uint32 pointer as a Uint32. func consumeUint32Ptr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.VarintType { return out, errUnknown } var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return out, errDecode } vp := p.Uint32Ptr() if *vp == nil { *vp = new(uint32) } **vp = uint32(v) out.n = n return out, nil } var coderUint32Ptr = pointerCoderFuncs{ size: sizeUint32Ptr, marshal: appendUint32Ptr, unmarshal: consumeUint32Ptr, merge: mergeUint32Ptr, } // sizeUint32Slice returns the size of wire encoding a []uint32 pointer as a repeated Uint32. func sizeUint32Slice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { s := *p.Uint32Slice() for _, v := range s { size += f.tagsize + protowire.SizeVarint(uint64(v)) } return size } // appendUint32Slice encodes a []uint32 pointer as a repeated Uint32. func appendUint32Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { s := *p.Uint32Slice() for _, v := range s { b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendVarint(b, uint64(v)) } return b, nil } // consumeUint32Slice wire decodes a []uint32 pointer as a repeated Uint32. func consumeUint32Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { sp := p.Uint32Slice() if wtyp == protowire.BytesType { b, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } count := 0 for _, v := range b { if v < 0x80 { count++ } } if count > 0 { p.growUint32Slice(count) } s := *sp for len(b) > 0 { var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return out, errDecode } s = append(s, uint32(v)) b = b[n:] } *sp = s out.n = n return out, nil } if wtyp != protowire.VarintType { return out, errUnknown } var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return out, errDecode } *sp = append(*sp, uint32(v)) out.n = n return out, nil } var coderUint32Slice = pointerCoderFuncs{ size: sizeUint32Slice, marshal: appendUint32Slice, unmarshal: consumeUint32Slice, merge: mergeUint32Slice, } // sizeUint32PackedSlice returns the size of wire encoding a []uint32 pointer as a packed repeated Uint32. func sizeUint32PackedSlice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { s := *p.Uint32Slice() if len(s) == 0 { return 0 } n := 0 for _, v := range s { n += protowire.SizeVarint(uint64(v)) } return f.tagsize + protowire.SizeBytes(n) } // appendUint32PackedSlice encodes a []uint32 pointer as a packed repeated Uint32. func appendUint32PackedSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { s := *p.Uint32Slice() if len(s) == 0 { return b, nil } b = protowire.AppendVarint(b, f.wiretag) n := 0 for _, v := range s { n += protowire.SizeVarint(uint64(v)) } b = protowire.AppendVarint(b, uint64(n)) for _, v := range s { b = protowire.AppendVarint(b, uint64(v)) } return b, nil } var coderUint32PackedSlice = pointerCoderFuncs{ size: sizeUint32PackedSlice, marshal: appendUint32PackedSlice, unmarshal: consumeUint32Slice, merge: mergeUint32Slice, } // sizeUint32Value returns the size of wire encoding a uint32 value as a Uint32. func sizeUint32Value(v protoreflect.Value, tagsize int, opts marshalOptions) int { return tagsize + protowire.SizeVarint(uint64(uint32(v.Uint()))) } // appendUint32Value encodes a uint32 value as a Uint32. func appendUint32Value(b []byte, v protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { b = protowire.AppendVarint(b, wiretag) b = protowire.AppendVarint(b, uint64(uint32(v.Uint()))) return b, nil } // consumeUint32Value decodes a uint32 value as a Uint32. func consumeUint32Value(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) { if wtyp != protowire.VarintType { return protoreflect.Value{}, out, errUnknown } var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return protoreflect.Value{}, out, errDecode } out.n = n return protoreflect.ValueOfUint32(uint32(v)), out, nil } var coderUint32Value = valueCoderFuncs{ size: sizeUint32Value, marshal: appendUint32Value, unmarshal: consumeUint32Value, merge: mergeScalarValue, } // sizeUint32SliceValue returns the size of wire encoding a []uint32 value as a repeated Uint32. func sizeUint32SliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) { list := listv.List() for i, llen := 0, list.Len(); i < llen; i++ { v := list.Get(i) size += tagsize + protowire.SizeVarint(uint64(uint32(v.Uint()))) } return size } // appendUint32SliceValue encodes a []uint32 value as a repeated Uint32. func appendUint32SliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { list := listv.List() for i, llen := 0, list.Len(); i < llen; i++ { v := list.Get(i) b = protowire.AppendVarint(b, wiretag) b = protowire.AppendVarint(b, uint64(uint32(v.Uint()))) } return b, nil } // consumeUint32SliceValue wire decodes a []uint32 value as a repeated Uint32. func consumeUint32SliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) { list := listv.List() if wtyp == protowire.BytesType { b, n := protowire.ConsumeBytes(b) if n < 0 { return protoreflect.Value{}, out, errDecode } for len(b) > 0 { var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return protoreflect.Value{}, out, errDecode } list.Append(protoreflect.ValueOfUint32(uint32(v))) b = b[n:] } out.n = n return listv, out, nil } if wtyp != protowire.VarintType { return protoreflect.Value{}, out, errUnknown } var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return protoreflect.Value{}, out, errDecode } list.Append(protoreflect.ValueOfUint32(uint32(v))) out.n = n return listv, out, nil } var coderUint32SliceValue = valueCoderFuncs{ size: sizeUint32SliceValue, marshal: appendUint32SliceValue, unmarshal: consumeUint32SliceValue, merge: mergeListValue, } // sizeUint32PackedSliceValue returns the size of wire encoding a []uint32 value as a packed repeated Uint32. func sizeUint32PackedSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) { list := listv.List() llen := list.Len() if llen == 0 { return 0 } n := 0 for i, llen := 0, llen; i < llen; i++ { v := list.Get(i) n += protowire.SizeVarint(uint64(uint32(v.Uint()))) } return tagsize + protowire.SizeBytes(n) } // appendUint32PackedSliceValue encodes a []uint32 value as a packed repeated Uint32. func appendUint32PackedSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { list := listv.List() llen := list.Len() if llen == 0 { return b, nil } b = protowire.AppendVarint(b, wiretag) n := 0 for i := 0; i < llen; i++ { v := list.Get(i) n += protowire.SizeVarint(uint64(uint32(v.Uint()))) } b = protowire.AppendVarint(b, uint64(n)) for i := 0; i < llen; i++ { v := list.Get(i) b = protowire.AppendVarint(b, uint64(uint32(v.Uint()))) } return b, nil } var coderUint32PackedSliceValue = valueCoderFuncs{ size: sizeUint32PackedSliceValue, marshal: appendUint32PackedSliceValue, unmarshal: consumeUint32SliceValue, merge: mergeListValue, } // sizeInt64 returns the size of wire encoding a int64 pointer as a Int64. func sizeInt64(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { v := *p.Int64() return f.tagsize + protowire.SizeVarint(uint64(v)) } // appendInt64 wire encodes a int64 pointer as a Int64. func appendInt64(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := *p.Int64() b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendVarint(b, uint64(v)) return b, nil } // consumeInt64 wire decodes a int64 pointer as a Int64. func consumeInt64(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.VarintType { return out, errUnknown } var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return out, errDecode } *p.Int64() = int64(v) out.n = n return out, nil } var coderInt64 = pointerCoderFuncs{ size: sizeInt64, marshal: appendInt64, unmarshal: consumeInt64, merge: mergeInt64, } // sizeInt64NoZero returns the size of wire encoding a int64 pointer as a Int64. // The zero value is not encoded. func sizeInt64NoZero(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { v := *p.Int64() if v == 0 { return 0 } return f.tagsize + protowire.SizeVarint(uint64(v)) } // appendInt64NoZero wire encodes a int64 pointer as a Int64. // The zero value is not encoded. func appendInt64NoZero(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := *p.Int64() if v == 0 { return b, nil } b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendVarint(b, uint64(v)) return b, nil } var coderInt64NoZero = pointerCoderFuncs{ size: sizeInt64NoZero, marshal: appendInt64NoZero, unmarshal: consumeInt64, merge: mergeInt64NoZero, } // sizeInt64Ptr returns the size of wire encoding a *int64 pointer as a Int64. // It panics if the pointer is nil. func sizeInt64Ptr(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { v := **p.Int64Ptr() return f.tagsize + protowire.SizeVarint(uint64(v)) } // appendInt64Ptr wire encodes a *int64 pointer as a Int64. // It panics if the pointer is nil. func appendInt64Ptr(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := **p.Int64Ptr() b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendVarint(b, uint64(v)) return b, nil } // consumeInt64Ptr wire decodes a *int64 pointer as a Int64. func consumeInt64Ptr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.VarintType { return out, errUnknown } var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return out, errDecode } vp := p.Int64Ptr() if *vp == nil { *vp = new(int64) } **vp = int64(v) out.n = n return out, nil } var coderInt64Ptr = pointerCoderFuncs{ size: sizeInt64Ptr, marshal: appendInt64Ptr, unmarshal: consumeInt64Ptr, merge: mergeInt64Ptr, } // sizeInt64Slice returns the size of wire encoding a []int64 pointer as a repeated Int64. func sizeInt64Slice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { s := *p.Int64Slice() for _, v := range s { size += f.tagsize + protowire.SizeVarint(uint64(v)) } return size } // appendInt64Slice encodes a []int64 pointer as a repeated Int64. func appendInt64Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { s := *p.Int64Slice() for _, v := range s { b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendVarint(b, uint64(v)) } return b, nil } // consumeInt64Slice wire decodes a []int64 pointer as a repeated Int64. func consumeInt64Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { sp := p.Int64Slice() if wtyp == protowire.BytesType { b, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } count := 0 for _, v := range b { if v < 0x80 { count++ } } if count > 0 { p.growInt64Slice(count) } s := *sp for len(b) > 0 { var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return out, errDecode } s = append(s, int64(v)) b = b[n:] } *sp = s out.n = n return out, nil } if wtyp != protowire.VarintType { return out, errUnknown } var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return out, errDecode } *sp = append(*sp, int64(v)) out.n = n return out, nil } var coderInt64Slice = pointerCoderFuncs{ size: sizeInt64Slice, marshal: appendInt64Slice, unmarshal: consumeInt64Slice, merge: mergeInt64Slice, } // sizeInt64PackedSlice returns the size of wire encoding a []int64 pointer as a packed repeated Int64. func sizeInt64PackedSlice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { s := *p.Int64Slice() if len(s) == 0 { return 0 } n := 0 for _, v := range s { n += protowire.SizeVarint(uint64(v)) } return f.tagsize + protowire.SizeBytes(n) } // appendInt64PackedSlice encodes a []int64 pointer as a packed repeated Int64. func appendInt64PackedSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { s := *p.Int64Slice() if len(s) == 0 { return b, nil } b = protowire.AppendVarint(b, f.wiretag) n := 0 for _, v := range s { n += protowire.SizeVarint(uint64(v)) } b = protowire.AppendVarint(b, uint64(n)) for _, v := range s { b = protowire.AppendVarint(b, uint64(v)) } return b, nil } var coderInt64PackedSlice = pointerCoderFuncs{ size: sizeInt64PackedSlice, marshal: appendInt64PackedSlice, unmarshal: consumeInt64Slice, merge: mergeInt64Slice, } // sizeInt64Value returns the size of wire encoding a int64 value as a Int64. func sizeInt64Value(v protoreflect.Value, tagsize int, opts marshalOptions) int { return tagsize + protowire.SizeVarint(uint64(v.Int())) } // appendInt64Value encodes a int64 value as a Int64. func appendInt64Value(b []byte, v protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { b = protowire.AppendVarint(b, wiretag) b = protowire.AppendVarint(b, uint64(v.Int())) return b, nil } // consumeInt64Value decodes a int64 value as a Int64. func consumeInt64Value(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) { if wtyp != protowire.VarintType { return protoreflect.Value{}, out, errUnknown } var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return protoreflect.Value{}, out, errDecode } out.n = n return protoreflect.ValueOfInt64(int64(v)), out, nil } var coderInt64Value = valueCoderFuncs{ size: sizeInt64Value, marshal: appendInt64Value, unmarshal: consumeInt64Value, merge: mergeScalarValue, } // sizeInt64SliceValue returns the size of wire encoding a []int64 value as a repeated Int64. func sizeInt64SliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) { list := listv.List() for i, llen := 0, list.Len(); i < llen; i++ { v := list.Get(i) size += tagsize + protowire.SizeVarint(uint64(v.Int())) } return size } // appendInt64SliceValue encodes a []int64 value as a repeated Int64. func appendInt64SliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { list := listv.List() for i, llen := 0, list.Len(); i < llen; i++ { v := list.Get(i) b = protowire.AppendVarint(b, wiretag) b = protowire.AppendVarint(b, uint64(v.Int())) } return b, nil } // consumeInt64SliceValue wire decodes a []int64 value as a repeated Int64. func consumeInt64SliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) { list := listv.List() if wtyp == protowire.BytesType { b, n := protowire.ConsumeBytes(b) if n < 0 { return protoreflect.Value{}, out, errDecode } for len(b) > 0 { var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return protoreflect.Value{}, out, errDecode } list.Append(protoreflect.ValueOfInt64(int64(v))) b = b[n:] } out.n = n return listv, out, nil } if wtyp != protowire.VarintType { return protoreflect.Value{}, out, errUnknown } var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return protoreflect.Value{}, out, errDecode } list.Append(protoreflect.ValueOfInt64(int64(v))) out.n = n return listv, out, nil } var coderInt64SliceValue = valueCoderFuncs{ size: sizeInt64SliceValue, marshal: appendInt64SliceValue, unmarshal: consumeInt64SliceValue, merge: mergeListValue, } // sizeInt64PackedSliceValue returns the size of wire encoding a []int64 value as a packed repeated Int64. func sizeInt64PackedSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) { list := listv.List() llen := list.Len() if llen == 0 { return 0 } n := 0 for i, llen := 0, llen; i < llen; i++ { v := list.Get(i) n += protowire.SizeVarint(uint64(v.Int())) } return tagsize + protowire.SizeBytes(n) } // appendInt64PackedSliceValue encodes a []int64 value as a packed repeated Int64. func appendInt64PackedSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { list := listv.List() llen := list.Len() if llen == 0 { return b, nil } b = protowire.AppendVarint(b, wiretag) n := 0 for i := 0; i < llen; i++ { v := list.Get(i) n += protowire.SizeVarint(uint64(v.Int())) } b = protowire.AppendVarint(b, uint64(n)) for i := 0; i < llen; i++ { v := list.Get(i) b = protowire.AppendVarint(b, uint64(v.Int())) } return b, nil } var coderInt64PackedSliceValue = valueCoderFuncs{ size: sizeInt64PackedSliceValue, marshal: appendInt64PackedSliceValue, unmarshal: consumeInt64SliceValue, merge: mergeListValue, } // sizeSint64 returns the size of wire encoding a int64 pointer as a Sint64. func sizeSint64(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { v := *p.Int64() return f.tagsize + protowire.SizeVarint(protowire.EncodeZigZag(v)) } // appendSint64 wire encodes a int64 pointer as a Sint64. func appendSint64(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := *p.Int64() b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendVarint(b, protowire.EncodeZigZag(v)) return b, nil } // consumeSint64 wire decodes a int64 pointer as a Sint64. func consumeSint64(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.VarintType { return out, errUnknown } var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return out, errDecode } *p.Int64() = protowire.DecodeZigZag(v) out.n = n return out, nil } var coderSint64 = pointerCoderFuncs{ size: sizeSint64, marshal: appendSint64, unmarshal: consumeSint64, merge: mergeInt64, } // sizeSint64NoZero returns the size of wire encoding a int64 pointer as a Sint64. // The zero value is not encoded. func sizeSint64NoZero(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { v := *p.Int64() if v == 0 { return 0 } return f.tagsize + protowire.SizeVarint(protowire.EncodeZigZag(v)) } // appendSint64NoZero wire encodes a int64 pointer as a Sint64. // The zero value is not encoded. func appendSint64NoZero(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := *p.Int64() if v == 0 { return b, nil } b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendVarint(b, protowire.EncodeZigZag(v)) return b, nil } var coderSint64NoZero = pointerCoderFuncs{ size: sizeSint64NoZero, marshal: appendSint64NoZero, unmarshal: consumeSint64, merge: mergeInt64NoZero, } // sizeSint64Ptr returns the size of wire encoding a *int64 pointer as a Sint64. // It panics if the pointer is nil. func sizeSint64Ptr(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { v := **p.Int64Ptr() return f.tagsize + protowire.SizeVarint(protowire.EncodeZigZag(v)) } // appendSint64Ptr wire encodes a *int64 pointer as a Sint64. // It panics if the pointer is nil. func appendSint64Ptr(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := **p.Int64Ptr() b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendVarint(b, protowire.EncodeZigZag(v)) return b, nil } // consumeSint64Ptr wire decodes a *int64 pointer as a Sint64. func consumeSint64Ptr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.VarintType { return out, errUnknown } var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return out, errDecode } vp := p.Int64Ptr() if *vp == nil { *vp = new(int64) } **vp = protowire.DecodeZigZag(v) out.n = n return out, nil } var coderSint64Ptr = pointerCoderFuncs{ size: sizeSint64Ptr, marshal: appendSint64Ptr, unmarshal: consumeSint64Ptr, merge: mergeInt64Ptr, } // sizeSint64Slice returns the size of wire encoding a []int64 pointer as a repeated Sint64. func sizeSint64Slice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { s := *p.Int64Slice() for _, v := range s { size += f.tagsize + protowire.SizeVarint(protowire.EncodeZigZag(v)) } return size } // appendSint64Slice encodes a []int64 pointer as a repeated Sint64. func appendSint64Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { s := *p.Int64Slice() for _, v := range s { b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendVarint(b, protowire.EncodeZigZag(v)) } return b, nil } // consumeSint64Slice wire decodes a []int64 pointer as a repeated Sint64. func consumeSint64Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { sp := p.Int64Slice() if wtyp == protowire.BytesType { b, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } count := 0 for _, v := range b { if v < 0x80 { count++ } } if count > 0 { p.growInt64Slice(count) } s := *sp for len(b) > 0 { var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return out, errDecode } s = append(s, protowire.DecodeZigZag(v)) b = b[n:] } *sp = s out.n = n return out, nil } if wtyp != protowire.VarintType { return out, errUnknown } var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return out, errDecode } *sp = append(*sp, protowire.DecodeZigZag(v)) out.n = n return out, nil } var coderSint64Slice = pointerCoderFuncs{ size: sizeSint64Slice, marshal: appendSint64Slice, unmarshal: consumeSint64Slice, merge: mergeInt64Slice, } // sizeSint64PackedSlice returns the size of wire encoding a []int64 pointer as a packed repeated Sint64. func sizeSint64PackedSlice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { s := *p.Int64Slice() if len(s) == 0 { return 0 } n := 0 for _, v := range s { n += protowire.SizeVarint(protowire.EncodeZigZag(v)) } return f.tagsize + protowire.SizeBytes(n) } // appendSint64PackedSlice encodes a []int64 pointer as a packed repeated Sint64. func appendSint64PackedSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { s := *p.Int64Slice() if len(s) == 0 { return b, nil } b = protowire.AppendVarint(b, f.wiretag) n := 0 for _, v := range s { n += protowire.SizeVarint(protowire.EncodeZigZag(v)) } b = protowire.AppendVarint(b, uint64(n)) for _, v := range s { b = protowire.AppendVarint(b, protowire.EncodeZigZag(v)) } return b, nil } var coderSint64PackedSlice = pointerCoderFuncs{ size: sizeSint64PackedSlice, marshal: appendSint64PackedSlice, unmarshal: consumeSint64Slice, merge: mergeInt64Slice, } // sizeSint64Value returns the size of wire encoding a int64 value as a Sint64. func sizeSint64Value(v protoreflect.Value, tagsize int, opts marshalOptions) int { return tagsize + protowire.SizeVarint(protowire.EncodeZigZag(v.Int())) } // appendSint64Value encodes a int64 value as a Sint64. func appendSint64Value(b []byte, v protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { b = protowire.AppendVarint(b, wiretag) b = protowire.AppendVarint(b, protowire.EncodeZigZag(v.Int())) return b, nil } // consumeSint64Value decodes a int64 value as a Sint64. func consumeSint64Value(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) { if wtyp != protowire.VarintType { return protoreflect.Value{}, out, errUnknown } var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return protoreflect.Value{}, out, errDecode } out.n = n return protoreflect.ValueOfInt64(protowire.DecodeZigZag(v)), out, nil } var coderSint64Value = valueCoderFuncs{ size: sizeSint64Value, marshal: appendSint64Value, unmarshal: consumeSint64Value, merge: mergeScalarValue, } // sizeSint64SliceValue returns the size of wire encoding a []int64 value as a repeated Sint64. func sizeSint64SliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) { list := listv.List() for i, llen := 0, list.Len(); i < llen; i++ { v := list.Get(i) size += tagsize + protowire.SizeVarint(protowire.EncodeZigZag(v.Int())) } return size } // appendSint64SliceValue encodes a []int64 value as a repeated Sint64. func appendSint64SliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { list := listv.List() for i, llen := 0, list.Len(); i < llen; i++ { v := list.Get(i) b = protowire.AppendVarint(b, wiretag) b = protowire.AppendVarint(b, protowire.EncodeZigZag(v.Int())) } return b, nil } // consumeSint64SliceValue wire decodes a []int64 value as a repeated Sint64. func consumeSint64SliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) { list := listv.List() if wtyp == protowire.BytesType { b, n := protowire.ConsumeBytes(b) if n < 0 { return protoreflect.Value{}, out, errDecode } for len(b) > 0 { var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return protoreflect.Value{}, out, errDecode } list.Append(protoreflect.ValueOfInt64(protowire.DecodeZigZag(v))) b = b[n:] } out.n = n return listv, out, nil } if wtyp != protowire.VarintType { return protoreflect.Value{}, out, errUnknown } var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return protoreflect.Value{}, out, errDecode } list.Append(protoreflect.ValueOfInt64(protowire.DecodeZigZag(v))) out.n = n return listv, out, nil } var coderSint64SliceValue = valueCoderFuncs{ size: sizeSint64SliceValue, marshal: appendSint64SliceValue, unmarshal: consumeSint64SliceValue, merge: mergeListValue, } // sizeSint64PackedSliceValue returns the size of wire encoding a []int64 value as a packed repeated Sint64. func sizeSint64PackedSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) { list := listv.List() llen := list.Len() if llen == 0 { return 0 } n := 0 for i, llen := 0, llen; i < llen; i++ { v := list.Get(i) n += protowire.SizeVarint(protowire.EncodeZigZag(v.Int())) } return tagsize + protowire.SizeBytes(n) } // appendSint64PackedSliceValue encodes a []int64 value as a packed repeated Sint64. func appendSint64PackedSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { list := listv.List() llen := list.Len() if llen == 0 { return b, nil } b = protowire.AppendVarint(b, wiretag) n := 0 for i := 0; i < llen; i++ { v := list.Get(i) n += protowire.SizeVarint(protowire.EncodeZigZag(v.Int())) } b = protowire.AppendVarint(b, uint64(n)) for i := 0; i < llen; i++ { v := list.Get(i) b = protowire.AppendVarint(b, protowire.EncodeZigZag(v.Int())) } return b, nil } var coderSint64PackedSliceValue = valueCoderFuncs{ size: sizeSint64PackedSliceValue, marshal: appendSint64PackedSliceValue, unmarshal: consumeSint64SliceValue, merge: mergeListValue, } // sizeUint64 returns the size of wire encoding a uint64 pointer as a Uint64. func sizeUint64(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { v := *p.Uint64() return f.tagsize + protowire.SizeVarint(v) } // appendUint64 wire encodes a uint64 pointer as a Uint64. func appendUint64(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := *p.Uint64() b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendVarint(b, v) return b, nil } // consumeUint64 wire decodes a uint64 pointer as a Uint64. func consumeUint64(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.VarintType { return out, errUnknown } var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return out, errDecode } *p.Uint64() = v out.n = n return out, nil } var coderUint64 = pointerCoderFuncs{ size: sizeUint64, marshal: appendUint64, unmarshal: consumeUint64, merge: mergeUint64, } // sizeUint64NoZero returns the size of wire encoding a uint64 pointer as a Uint64. // The zero value is not encoded. func sizeUint64NoZero(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { v := *p.Uint64() if v == 0 { return 0 } return f.tagsize + protowire.SizeVarint(v) } // appendUint64NoZero wire encodes a uint64 pointer as a Uint64. // The zero value is not encoded. func appendUint64NoZero(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := *p.Uint64() if v == 0 { return b, nil } b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendVarint(b, v) return b, nil } var coderUint64NoZero = pointerCoderFuncs{ size: sizeUint64NoZero, marshal: appendUint64NoZero, unmarshal: consumeUint64, merge: mergeUint64NoZero, } // sizeUint64Ptr returns the size of wire encoding a *uint64 pointer as a Uint64. // It panics if the pointer is nil. func sizeUint64Ptr(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { v := **p.Uint64Ptr() return f.tagsize + protowire.SizeVarint(v) } // appendUint64Ptr wire encodes a *uint64 pointer as a Uint64. // It panics if the pointer is nil. func appendUint64Ptr(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := **p.Uint64Ptr() b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendVarint(b, v) return b, nil } // consumeUint64Ptr wire decodes a *uint64 pointer as a Uint64. func consumeUint64Ptr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.VarintType { return out, errUnknown } var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return out, errDecode } vp := p.Uint64Ptr() if *vp == nil { *vp = new(uint64) } **vp = v out.n = n return out, nil } var coderUint64Ptr = pointerCoderFuncs{ size: sizeUint64Ptr, marshal: appendUint64Ptr, unmarshal: consumeUint64Ptr, merge: mergeUint64Ptr, } // sizeUint64Slice returns the size of wire encoding a []uint64 pointer as a repeated Uint64. func sizeUint64Slice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { s := *p.Uint64Slice() for _, v := range s { size += f.tagsize + protowire.SizeVarint(v) } return size } // appendUint64Slice encodes a []uint64 pointer as a repeated Uint64. func appendUint64Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { s := *p.Uint64Slice() for _, v := range s { b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendVarint(b, v) } return b, nil } // consumeUint64Slice wire decodes a []uint64 pointer as a repeated Uint64. func consumeUint64Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { sp := p.Uint64Slice() if wtyp == protowire.BytesType { b, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } count := 0 for _, v := range b { if v < 0x80 { count++ } } if count > 0 { p.growUint64Slice(count) } s := *sp for len(b) > 0 { var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return out, errDecode } s = append(s, v) b = b[n:] } *sp = s out.n = n return out, nil } if wtyp != protowire.VarintType { return out, errUnknown } var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return out, errDecode } *sp = append(*sp, v) out.n = n return out, nil } var coderUint64Slice = pointerCoderFuncs{ size: sizeUint64Slice, marshal: appendUint64Slice, unmarshal: consumeUint64Slice, merge: mergeUint64Slice, } // sizeUint64PackedSlice returns the size of wire encoding a []uint64 pointer as a packed repeated Uint64. func sizeUint64PackedSlice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { s := *p.Uint64Slice() if len(s) == 0 { return 0 } n := 0 for _, v := range s { n += protowire.SizeVarint(v) } return f.tagsize + protowire.SizeBytes(n) } // appendUint64PackedSlice encodes a []uint64 pointer as a packed repeated Uint64. func appendUint64PackedSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { s := *p.Uint64Slice() if len(s) == 0 { return b, nil } b = protowire.AppendVarint(b, f.wiretag) n := 0 for _, v := range s { n += protowire.SizeVarint(v) } b = protowire.AppendVarint(b, uint64(n)) for _, v := range s { b = protowire.AppendVarint(b, v) } return b, nil } var coderUint64PackedSlice = pointerCoderFuncs{ size: sizeUint64PackedSlice, marshal: appendUint64PackedSlice, unmarshal: consumeUint64Slice, merge: mergeUint64Slice, } // sizeUint64Value returns the size of wire encoding a uint64 value as a Uint64. func sizeUint64Value(v protoreflect.Value, tagsize int, opts marshalOptions) int { return tagsize + protowire.SizeVarint(v.Uint()) } // appendUint64Value encodes a uint64 value as a Uint64. func appendUint64Value(b []byte, v protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { b = protowire.AppendVarint(b, wiretag) b = protowire.AppendVarint(b, v.Uint()) return b, nil } // consumeUint64Value decodes a uint64 value as a Uint64. func consumeUint64Value(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) { if wtyp != protowire.VarintType { return protoreflect.Value{}, out, errUnknown } var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return protoreflect.Value{}, out, errDecode } out.n = n return protoreflect.ValueOfUint64(v), out, nil } var coderUint64Value = valueCoderFuncs{ size: sizeUint64Value, marshal: appendUint64Value, unmarshal: consumeUint64Value, merge: mergeScalarValue, } // sizeUint64SliceValue returns the size of wire encoding a []uint64 value as a repeated Uint64. func sizeUint64SliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) { list := listv.List() for i, llen := 0, list.Len(); i < llen; i++ { v := list.Get(i) size += tagsize + protowire.SizeVarint(v.Uint()) } return size } // appendUint64SliceValue encodes a []uint64 value as a repeated Uint64. func appendUint64SliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { list := listv.List() for i, llen := 0, list.Len(); i < llen; i++ { v := list.Get(i) b = protowire.AppendVarint(b, wiretag) b = protowire.AppendVarint(b, v.Uint()) } return b, nil } // consumeUint64SliceValue wire decodes a []uint64 value as a repeated Uint64. func consumeUint64SliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) { list := listv.List() if wtyp == protowire.BytesType { b, n := protowire.ConsumeBytes(b) if n < 0 { return protoreflect.Value{}, out, errDecode } for len(b) > 0 { var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return protoreflect.Value{}, out, errDecode } list.Append(protoreflect.ValueOfUint64(v)) b = b[n:] } out.n = n return listv, out, nil } if wtyp != protowire.VarintType { return protoreflect.Value{}, out, errUnknown } var v uint64 var n int if len(b) >= 1 && b[0] < 0x80 { v = uint64(b[0]) n = 1 } else if len(b) >= 2 && b[1] < 128 { v = uint64(b[0]&0x7f) + uint64(b[1])<<7 n = 2 } else { v, n = protowire.ConsumeVarint(b) } if n < 0 { return protoreflect.Value{}, out, errDecode } list.Append(protoreflect.ValueOfUint64(v)) out.n = n return listv, out, nil } var coderUint64SliceValue = valueCoderFuncs{ size: sizeUint64SliceValue, marshal: appendUint64SliceValue, unmarshal: consumeUint64SliceValue, merge: mergeListValue, } // sizeUint64PackedSliceValue returns the size of wire encoding a []uint64 value as a packed repeated Uint64. func sizeUint64PackedSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) { list := listv.List() llen := list.Len() if llen == 0 { return 0 } n := 0 for i, llen := 0, llen; i < llen; i++ { v := list.Get(i) n += protowire.SizeVarint(v.Uint()) } return tagsize + protowire.SizeBytes(n) } // appendUint64PackedSliceValue encodes a []uint64 value as a packed repeated Uint64. func appendUint64PackedSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { list := listv.List() llen := list.Len() if llen == 0 { return b, nil } b = protowire.AppendVarint(b, wiretag) n := 0 for i := 0; i < llen; i++ { v := list.Get(i) n += protowire.SizeVarint(v.Uint()) } b = protowire.AppendVarint(b, uint64(n)) for i := 0; i < llen; i++ { v := list.Get(i) b = protowire.AppendVarint(b, v.Uint()) } return b, nil } var coderUint64PackedSliceValue = valueCoderFuncs{ size: sizeUint64PackedSliceValue, marshal: appendUint64PackedSliceValue, unmarshal: consumeUint64SliceValue, merge: mergeListValue, } // sizeSfixed32 returns the size of wire encoding a int32 pointer as a Sfixed32. func sizeSfixed32(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { return f.tagsize + protowire.SizeFixed32() } // appendSfixed32 wire encodes a int32 pointer as a Sfixed32. func appendSfixed32(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := *p.Int32() b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendFixed32(b, uint32(v)) return b, nil } // consumeSfixed32 wire decodes a int32 pointer as a Sfixed32. func consumeSfixed32(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.Fixed32Type { return out, errUnknown } v, n := protowire.ConsumeFixed32(b) if n < 0 { return out, errDecode } *p.Int32() = int32(v) out.n = n return out, nil } var coderSfixed32 = pointerCoderFuncs{ size: sizeSfixed32, marshal: appendSfixed32, unmarshal: consumeSfixed32, merge: mergeInt32, } // sizeSfixed32NoZero returns the size of wire encoding a int32 pointer as a Sfixed32. // The zero value is not encoded. func sizeSfixed32NoZero(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { v := *p.Int32() if v == 0 { return 0 } return f.tagsize + protowire.SizeFixed32() } // appendSfixed32NoZero wire encodes a int32 pointer as a Sfixed32. // The zero value is not encoded. func appendSfixed32NoZero(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := *p.Int32() if v == 0 { return b, nil } b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendFixed32(b, uint32(v)) return b, nil } var coderSfixed32NoZero = pointerCoderFuncs{ size: sizeSfixed32NoZero, marshal: appendSfixed32NoZero, unmarshal: consumeSfixed32, merge: mergeInt32NoZero, } // sizeSfixed32Ptr returns the size of wire encoding a *int32 pointer as a Sfixed32. // It panics if the pointer is nil. func sizeSfixed32Ptr(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { return f.tagsize + protowire.SizeFixed32() } // appendSfixed32Ptr wire encodes a *int32 pointer as a Sfixed32. // It panics if the pointer is nil. func appendSfixed32Ptr(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := **p.Int32Ptr() b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendFixed32(b, uint32(v)) return b, nil } // consumeSfixed32Ptr wire decodes a *int32 pointer as a Sfixed32. func consumeSfixed32Ptr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.Fixed32Type { return out, errUnknown } v, n := protowire.ConsumeFixed32(b) if n < 0 { return out, errDecode } vp := p.Int32Ptr() if *vp == nil { *vp = new(int32) } **vp = int32(v) out.n = n return out, nil } var coderSfixed32Ptr = pointerCoderFuncs{ size: sizeSfixed32Ptr, marshal: appendSfixed32Ptr, unmarshal: consumeSfixed32Ptr, merge: mergeInt32Ptr, } // sizeSfixed32Slice returns the size of wire encoding a []int32 pointer as a repeated Sfixed32. func sizeSfixed32Slice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { s := *p.Int32Slice() size = len(s) * (f.tagsize + protowire.SizeFixed32()) return size } // appendSfixed32Slice encodes a []int32 pointer as a repeated Sfixed32. func appendSfixed32Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { s := *p.Int32Slice() for _, v := range s { b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendFixed32(b, uint32(v)) } return b, nil } // consumeSfixed32Slice wire decodes a []int32 pointer as a repeated Sfixed32. func consumeSfixed32Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { sp := p.Int32Slice() if wtyp == protowire.BytesType { b, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } count := len(b) / protowire.SizeFixed32() if count > 0 { p.growInt32Slice(count) } s := *sp for len(b) > 0 { v, n := protowire.ConsumeFixed32(b) if n < 0 { return out, errDecode } s = append(s, int32(v)) b = b[n:] } *sp = s out.n = n return out, nil } if wtyp != protowire.Fixed32Type { return out, errUnknown } v, n := protowire.ConsumeFixed32(b) if n < 0 { return out, errDecode } *sp = append(*sp, int32(v)) out.n = n return out, nil } var coderSfixed32Slice = pointerCoderFuncs{ size: sizeSfixed32Slice, marshal: appendSfixed32Slice, unmarshal: consumeSfixed32Slice, merge: mergeInt32Slice, } // sizeSfixed32PackedSlice returns the size of wire encoding a []int32 pointer as a packed repeated Sfixed32. func sizeSfixed32PackedSlice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { s := *p.Int32Slice() if len(s) == 0 { return 0 } n := len(s) * protowire.SizeFixed32() return f.tagsize + protowire.SizeBytes(n) } // appendSfixed32PackedSlice encodes a []int32 pointer as a packed repeated Sfixed32. func appendSfixed32PackedSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { s := *p.Int32Slice() if len(s) == 0 { return b, nil } b = protowire.AppendVarint(b, f.wiretag) n := len(s) * protowire.SizeFixed32() b = protowire.AppendVarint(b, uint64(n)) for _, v := range s { b = protowire.AppendFixed32(b, uint32(v)) } return b, nil } var coderSfixed32PackedSlice = pointerCoderFuncs{ size: sizeSfixed32PackedSlice, marshal: appendSfixed32PackedSlice, unmarshal: consumeSfixed32Slice, merge: mergeInt32Slice, } // sizeSfixed32Value returns the size of wire encoding a int32 value as a Sfixed32. func sizeSfixed32Value(v protoreflect.Value, tagsize int, opts marshalOptions) int { return tagsize + protowire.SizeFixed32() } // appendSfixed32Value encodes a int32 value as a Sfixed32. func appendSfixed32Value(b []byte, v protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { b = protowire.AppendVarint(b, wiretag) b = protowire.AppendFixed32(b, uint32(v.Int())) return b, nil } // consumeSfixed32Value decodes a int32 value as a Sfixed32. func consumeSfixed32Value(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) { if wtyp != protowire.Fixed32Type { return protoreflect.Value{}, out, errUnknown } v, n := protowire.ConsumeFixed32(b) if n < 0 { return protoreflect.Value{}, out, errDecode } out.n = n return protoreflect.ValueOfInt32(int32(v)), out, nil } var coderSfixed32Value = valueCoderFuncs{ size: sizeSfixed32Value, marshal: appendSfixed32Value, unmarshal: consumeSfixed32Value, merge: mergeScalarValue, } // sizeSfixed32SliceValue returns the size of wire encoding a []int32 value as a repeated Sfixed32. func sizeSfixed32SliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) { list := listv.List() size = list.Len() * (tagsize + protowire.SizeFixed32()) return size } // appendSfixed32SliceValue encodes a []int32 value as a repeated Sfixed32. func appendSfixed32SliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { list := listv.List() for i, llen := 0, list.Len(); i < llen; i++ { v := list.Get(i) b = protowire.AppendVarint(b, wiretag) b = protowire.AppendFixed32(b, uint32(v.Int())) } return b, nil } // consumeSfixed32SliceValue wire decodes a []int32 value as a repeated Sfixed32. func consumeSfixed32SliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) { list := listv.List() if wtyp == protowire.BytesType { b, n := protowire.ConsumeBytes(b) if n < 0 { return protoreflect.Value{}, out, errDecode } for len(b) > 0 { v, n := protowire.ConsumeFixed32(b) if n < 0 { return protoreflect.Value{}, out, errDecode } list.Append(protoreflect.ValueOfInt32(int32(v))) b = b[n:] } out.n = n return listv, out, nil } if wtyp != protowire.Fixed32Type { return protoreflect.Value{}, out, errUnknown } v, n := protowire.ConsumeFixed32(b) if n < 0 { return protoreflect.Value{}, out, errDecode } list.Append(protoreflect.ValueOfInt32(int32(v))) out.n = n return listv, out, nil } var coderSfixed32SliceValue = valueCoderFuncs{ size: sizeSfixed32SliceValue, marshal: appendSfixed32SliceValue, unmarshal: consumeSfixed32SliceValue, merge: mergeListValue, } // sizeSfixed32PackedSliceValue returns the size of wire encoding a []int32 value as a packed repeated Sfixed32. func sizeSfixed32PackedSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) { list := listv.List() llen := list.Len() if llen == 0 { return 0 } n := llen * protowire.SizeFixed32() return tagsize + protowire.SizeBytes(n) } // appendSfixed32PackedSliceValue encodes a []int32 value as a packed repeated Sfixed32. func appendSfixed32PackedSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { list := listv.List() llen := list.Len() if llen == 0 { return b, nil } b = protowire.AppendVarint(b, wiretag) n := llen * protowire.SizeFixed32() b = protowire.AppendVarint(b, uint64(n)) for i := 0; i < llen; i++ { v := list.Get(i) b = protowire.AppendFixed32(b, uint32(v.Int())) } return b, nil } var coderSfixed32PackedSliceValue = valueCoderFuncs{ size: sizeSfixed32PackedSliceValue, marshal: appendSfixed32PackedSliceValue, unmarshal: consumeSfixed32SliceValue, merge: mergeListValue, } // sizeFixed32 returns the size of wire encoding a uint32 pointer as a Fixed32. func sizeFixed32(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { return f.tagsize + protowire.SizeFixed32() } // appendFixed32 wire encodes a uint32 pointer as a Fixed32. func appendFixed32(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := *p.Uint32() b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendFixed32(b, v) return b, nil } // consumeFixed32 wire decodes a uint32 pointer as a Fixed32. func consumeFixed32(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.Fixed32Type { return out, errUnknown } v, n := protowire.ConsumeFixed32(b) if n < 0 { return out, errDecode } *p.Uint32() = v out.n = n return out, nil } var coderFixed32 = pointerCoderFuncs{ size: sizeFixed32, marshal: appendFixed32, unmarshal: consumeFixed32, merge: mergeUint32, } // sizeFixed32NoZero returns the size of wire encoding a uint32 pointer as a Fixed32. // The zero value is not encoded. func sizeFixed32NoZero(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { v := *p.Uint32() if v == 0 { return 0 } return f.tagsize + protowire.SizeFixed32() } // appendFixed32NoZero wire encodes a uint32 pointer as a Fixed32. // The zero value is not encoded. func appendFixed32NoZero(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := *p.Uint32() if v == 0 { return b, nil } b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendFixed32(b, v) return b, nil } var coderFixed32NoZero = pointerCoderFuncs{ size: sizeFixed32NoZero, marshal: appendFixed32NoZero, unmarshal: consumeFixed32, merge: mergeUint32NoZero, } // sizeFixed32Ptr returns the size of wire encoding a *uint32 pointer as a Fixed32. // It panics if the pointer is nil. func sizeFixed32Ptr(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { return f.tagsize + protowire.SizeFixed32() } // appendFixed32Ptr wire encodes a *uint32 pointer as a Fixed32. // It panics if the pointer is nil. func appendFixed32Ptr(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := **p.Uint32Ptr() b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendFixed32(b, v) return b, nil } // consumeFixed32Ptr wire decodes a *uint32 pointer as a Fixed32. func consumeFixed32Ptr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.Fixed32Type { return out, errUnknown } v, n := protowire.ConsumeFixed32(b) if n < 0 { return out, errDecode } vp := p.Uint32Ptr() if *vp == nil { *vp = new(uint32) } **vp = v out.n = n return out, nil } var coderFixed32Ptr = pointerCoderFuncs{ size: sizeFixed32Ptr, marshal: appendFixed32Ptr, unmarshal: consumeFixed32Ptr, merge: mergeUint32Ptr, } // sizeFixed32Slice returns the size of wire encoding a []uint32 pointer as a repeated Fixed32. func sizeFixed32Slice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { s := *p.Uint32Slice() size = len(s) * (f.tagsize + protowire.SizeFixed32()) return size } // appendFixed32Slice encodes a []uint32 pointer as a repeated Fixed32. func appendFixed32Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { s := *p.Uint32Slice() for _, v := range s { b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendFixed32(b, v) } return b, nil } // consumeFixed32Slice wire decodes a []uint32 pointer as a repeated Fixed32. func consumeFixed32Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { sp := p.Uint32Slice() if wtyp == protowire.BytesType { b, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } count := len(b) / protowire.SizeFixed32() if count > 0 { p.growUint32Slice(count) } s := *sp for len(b) > 0 { v, n := protowire.ConsumeFixed32(b) if n < 0 { return out, errDecode } s = append(s, v) b = b[n:] } *sp = s out.n = n return out, nil } if wtyp != protowire.Fixed32Type { return out, errUnknown } v, n := protowire.ConsumeFixed32(b) if n < 0 { return out, errDecode } *sp = append(*sp, v) out.n = n return out, nil } var coderFixed32Slice = pointerCoderFuncs{ size: sizeFixed32Slice, marshal: appendFixed32Slice, unmarshal: consumeFixed32Slice, merge: mergeUint32Slice, } // sizeFixed32PackedSlice returns the size of wire encoding a []uint32 pointer as a packed repeated Fixed32. func sizeFixed32PackedSlice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { s := *p.Uint32Slice() if len(s) == 0 { return 0 } n := len(s) * protowire.SizeFixed32() return f.tagsize + protowire.SizeBytes(n) } // appendFixed32PackedSlice encodes a []uint32 pointer as a packed repeated Fixed32. func appendFixed32PackedSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { s := *p.Uint32Slice() if len(s) == 0 { return b, nil } b = protowire.AppendVarint(b, f.wiretag) n := len(s) * protowire.SizeFixed32() b = protowire.AppendVarint(b, uint64(n)) for _, v := range s { b = protowire.AppendFixed32(b, v) } return b, nil } var coderFixed32PackedSlice = pointerCoderFuncs{ size: sizeFixed32PackedSlice, marshal: appendFixed32PackedSlice, unmarshal: consumeFixed32Slice, merge: mergeUint32Slice, } // sizeFixed32Value returns the size of wire encoding a uint32 value as a Fixed32. func sizeFixed32Value(v protoreflect.Value, tagsize int, opts marshalOptions) int { return tagsize + protowire.SizeFixed32() } // appendFixed32Value encodes a uint32 value as a Fixed32. func appendFixed32Value(b []byte, v protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { b = protowire.AppendVarint(b, wiretag) b = protowire.AppendFixed32(b, uint32(v.Uint())) return b, nil } // consumeFixed32Value decodes a uint32 value as a Fixed32. func consumeFixed32Value(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) { if wtyp != protowire.Fixed32Type { return protoreflect.Value{}, out, errUnknown } v, n := protowire.ConsumeFixed32(b) if n < 0 { return protoreflect.Value{}, out, errDecode } out.n = n return protoreflect.ValueOfUint32(uint32(v)), out, nil } var coderFixed32Value = valueCoderFuncs{ size: sizeFixed32Value, marshal: appendFixed32Value, unmarshal: consumeFixed32Value, merge: mergeScalarValue, } // sizeFixed32SliceValue returns the size of wire encoding a []uint32 value as a repeated Fixed32. func sizeFixed32SliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) { list := listv.List() size = list.Len() * (tagsize + protowire.SizeFixed32()) return size } // appendFixed32SliceValue encodes a []uint32 value as a repeated Fixed32. func appendFixed32SliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { list := listv.List() for i, llen := 0, list.Len(); i < llen; i++ { v := list.Get(i) b = protowire.AppendVarint(b, wiretag) b = protowire.AppendFixed32(b, uint32(v.Uint())) } return b, nil } // consumeFixed32SliceValue wire decodes a []uint32 value as a repeated Fixed32. func consumeFixed32SliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) { list := listv.List() if wtyp == protowire.BytesType { b, n := protowire.ConsumeBytes(b) if n < 0 { return protoreflect.Value{}, out, errDecode } for len(b) > 0 { v, n := protowire.ConsumeFixed32(b) if n < 0 { return protoreflect.Value{}, out, errDecode } list.Append(protoreflect.ValueOfUint32(uint32(v))) b = b[n:] } out.n = n return listv, out, nil } if wtyp != protowire.Fixed32Type { return protoreflect.Value{}, out, errUnknown } v, n := protowire.ConsumeFixed32(b) if n < 0 { return protoreflect.Value{}, out, errDecode } list.Append(protoreflect.ValueOfUint32(uint32(v))) out.n = n return listv, out, nil } var coderFixed32SliceValue = valueCoderFuncs{ size: sizeFixed32SliceValue, marshal: appendFixed32SliceValue, unmarshal: consumeFixed32SliceValue, merge: mergeListValue, } // sizeFixed32PackedSliceValue returns the size of wire encoding a []uint32 value as a packed repeated Fixed32. func sizeFixed32PackedSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) { list := listv.List() llen := list.Len() if llen == 0 { return 0 } n := llen * protowire.SizeFixed32() return tagsize + protowire.SizeBytes(n) } // appendFixed32PackedSliceValue encodes a []uint32 value as a packed repeated Fixed32. func appendFixed32PackedSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { list := listv.List() llen := list.Len() if llen == 0 { return b, nil } b = protowire.AppendVarint(b, wiretag) n := llen * protowire.SizeFixed32() b = protowire.AppendVarint(b, uint64(n)) for i := 0; i < llen; i++ { v := list.Get(i) b = protowire.AppendFixed32(b, uint32(v.Uint())) } return b, nil } var coderFixed32PackedSliceValue = valueCoderFuncs{ size: sizeFixed32PackedSliceValue, marshal: appendFixed32PackedSliceValue, unmarshal: consumeFixed32SliceValue, merge: mergeListValue, } // sizeFloat returns the size of wire encoding a float32 pointer as a Float. func sizeFloat(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { return f.tagsize + protowire.SizeFixed32() } // appendFloat wire encodes a float32 pointer as a Float. func appendFloat(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := *p.Float32() b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendFixed32(b, math.Float32bits(v)) return b, nil } // consumeFloat wire decodes a float32 pointer as a Float. func consumeFloat(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.Fixed32Type { return out, errUnknown } v, n := protowire.ConsumeFixed32(b) if n < 0 { return out, errDecode } *p.Float32() = math.Float32frombits(v) out.n = n return out, nil } var coderFloat = pointerCoderFuncs{ size: sizeFloat, marshal: appendFloat, unmarshal: consumeFloat, merge: mergeFloat32, } // sizeFloatNoZero returns the size of wire encoding a float32 pointer as a Float. // The zero value is not encoded. func sizeFloatNoZero(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { v := *p.Float32() if v == 0 && !math.Signbit(float64(v)) { return 0 } return f.tagsize + protowire.SizeFixed32() } // appendFloatNoZero wire encodes a float32 pointer as a Float. // The zero value is not encoded. func appendFloatNoZero(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := *p.Float32() if v == 0 && !math.Signbit(float64(v)) { return b, nil } b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendFixed32(b, math.Float32bits(v)) return b, nil } var coderFloatNoZero = pointerCoderFuncs{ size: sizeFloatNoZero, marshal: appendFloatNoZero, unmarshal: consumeFloat, merge: mergeFloat32NoZero, } // sizeFloatPtr returns the size of wire encoding a *float32 pointer as a Float. // It panics if the pointer is nil. func sizeFloatPtr(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { return f.tagsize + protowire.SizeFixed32() } // appendFloatPtr wire encodes a *float32 pointer as a Float. // It panics if the pointer is nil. func appendFloatPtr(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := **p.Float32Ptr() b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendFixed32(b, math.Float32bits(v)) return b, nil } // consumeFloatPtr wire decodes a *float32 pointer as a Float. func consumeFloatPtr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.Fixed32Type { return out, errUnknown } v, n := protowire.ConsumeFixed32(b) if n < 0 { return out, errDecode } vp := p.Float32Ptr() if *vp == nil { *vp = new(float32) } **vp = math.Float32frombits(v) out.n = n return out, nil } var coderFloatPtr = pointerCoderFuncs{ size: sizeFloatPtr, marshal: appendFloatPtr, unmarshal: consumeFloatPtr, merge: mergeFloat32Ptr, } // sizeFloatSlice returns the size of wire encoding a []float32 pointer as a repeated Float. func sizeFloatSlice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { s := *p.Float32Slice() size = len(s) * (f.tagsize + protowire.SizeFixed32()) return size } // appendFloatSlice encodes a []float32 pointer as a repeated Float. func appendFloatSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { s := *p.Float32Slice() for _, v := range s { b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendFixed32(b, math.Float32bits(v)) } return b, nil } // consumeFloatSlice wire decodes a []float32 pointer as a repeated Float. func consumeFloatSlice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { sp := p.Float32Slice() if wtyp == protowire.BytesType { b, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } count := len(b) / protowire.SizeFixed32() if count > 0 { p.growFloat32Slice(count) } s := *sp for len(b) > 0 { v, n := protowire.ConsumeFixed32(b) if n < 0 { return out, errDecode } s = append(s, math.Float32frombits(v)) b = b[n:] } *sp = s out.n = n return out, nil } if wtyp != protowire.Fixed32Type { return out, errUnknown } v, n := protowire.ConsumeFixed32(b) if n < 0 { return out, errDecode } *sp = append(*sp, math.Float32frombits(v)) out.n = n return out, nil } var coderFloatSlice = pointerCoderFuncs{ size: sizeFloatSlice, marshal: appendFloatSlice, unmarshal: consumeFloatSlice, merge: mergeFloat32Slice, } // sizeFloatPackedSlice returns the size of wire encoding a []float32 pointer as a packed repeated Float. func sizeFloatPackedSlice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { s := *p.Float32Slice() if len(s) == 0 { return 0 } n := len(s) * protowire.SizeFixed32() return f.tagsize + protowire.SizeBytes(n) } // appendFloatPackedSlice encodes a []float32 pointer as a packed repeated Float. func appendFloatPackedSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { s := *p.Float32Slice() if len(s) == 0 { return b, nil } b = protowire.AppendVarint(b, f.wiretag) n := len(s) * protowire.SizeFixed32() b = protowire.AppendVarint(b, uint64(n)) for _, v := range s { b = protowire.AppendFixed32(b, math.Float32bits(v)) } return b, nil } var coderFloatPackedSlice = pointerCoderFuncs{ size: sizeFloatPackedSlice, marshal: appendFloatPackedSlice, unmarshal: consumeFloatSlice, merge: mergeFloat32Slice, } // sizeFloatValue returns the size of wire encoding a float32 value as a Float. func sizeFloatValue(v protoreflect.Value, tagsize int, opts marshalOptions) int { return tagsize + protowire.SizeFixed32() } // appendFloatValue encodes a float32 value as a Float. func appendFloatValue(b []byte, v protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { b = protowire.AppendVarint(b, wiretag) b = protowire.AppendFixed32(b, math.Float32bits(float32(v.Float()))) return b, nil } // consumeFloatValue decodes a float32 value as a Float. func consumeFloatValue(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) { if wtyp != protowire.Fixed32Type { return protoreflect.Value{}, out, errUnknown } v, n := protowire.ConsumeFixed32(b) if n < 0 { return protoreflect.Value{}, out, errDecode } out.n = n return protoreflect.ValueOfFloat32(math.Float32frombits(uint32(v))), out, nil } var coderFloatValue = valueCoderFuncs{ size: sizeFloatValue, marshal: appendFloatValue, unmarshal: consumeFloatValue, merge: mergeScalarValue, } // sizeFloatSliceValue returns the size of wire encoding a []float32 value as a repeated Float. func sizeFloatSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) { list := listv.List() size = list.Len() * (tagsize + protowire.SizeFixed32()) return size } // appendFloatSliceValue encodes a []float32 value as a repeated Float. func appendFloatSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { list := listv.List() for i, llen := 0, list.Len(); i < llen; i++ { v := list.Get(i) b = protowire.AppendVarint(b, wiretag) b = protowire.AppendFixed32(b, math.Float32bits(float32(v.Float()))) } return b, nil } // consumeFloatSliceValue wire decodes a []float32 value as a repeated Float. func consumeFloatSliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) { list := listv.List() if wtyp == protowire.BytesType { b, n := protowire.ConsumeBytes(b) if n < 0 { return protoreflect.Value{}, out, errDecode } for len(b) > 0 { v, n := protowire.ConsumeFixed32(b) if n < 0 { return protoreflect.Value{}, out, errDecode } list.Append(protoreflect.ValueOfFloat32(math.Float32frombits(uint32(v)))) b = b[n:] } out.n = n return listv, out, nil } if wtyp != protowire.Fixed32Type { return protoreflect.Value{}, out, errUnknown } v, n := protowire.ConsumeFixed32(b) if n < 0 { return protoreflect.Value{}, out, errDecode } list.Append(protoreflect.ValueOfFloat32(math.Float32frombits(uint32(v)))) out.n = n return listv, out, nil } var coderFloatSliceValue = valueCoderFuncs{ size: sizeFloatSliceValue, marshal: appendFloatSliceValue, unmarshal: consumeFloatSliceValue, merge: mergeListValue, } // sizeFloatPackedSliceValue returns the size of wire encoding a []float32 value as a packed repeated Float. func sizeFloatPackedSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) { list := listv.List() llen := list.Len() if llen == 0 { return 0 } n := llen * protowire.SizeFixed32() return tagsize + protowire.SizeBytes(n) } // appendFloatPackedSliceValue encodes a []float32 value as a packed repeated Float. func appendFloatPackedSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { list := listv.List() llen := list.Len() if llen == 0 { return b, nil } b = protowire.AppendVarint(b, wiretag) n := llen * protowire.SizeFixed32() b = protowire.AppendVarint(b, uint64(n)) for i := 0; i < llen; i++ { v := list.Get(i) b = protowire.AppendFixed32(b, math.Float32bits(float32(v.Float()))) } return b, nil } var coderFloatPackedSliceValue = valueCoderFuncs{ size: sizeFloatPackedSliceValue, marshal: appendFloatPackedSliceValue, unmarshal: consumeFloatSliceValue, merge: mergeListValue, } // sizeSfixed64 returns the size of wire encoding a int64 pointer as a Sfixed64. func sizeSfixed64(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { return f.tagsize + protowire.SizeFixed64() } // appendSfixed64 wire encodes a int64 pointer as a Sfixed64. func appendSfixed64(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := *p.Int64() b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendFixed64(b, uint64(v)) return b, nil } // consumeSfixed64 wire decodes a int64 pointer as a Sfixed64. func consumeSfixed64(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.Fixed64Type { return out, errUnknown } v, n := protowire.ConsumeFixed64(b) if n < 0 { return out, errDecode } *p.Int64() = int64(v) out.n = n return out, nil } var coderSfixed64 = pointerCoderFuncs{ size: sizeSfixed64, marshal: appendSfixed64, unmarshal: consumeSfixed64, merge: mergeInt64, } // sizeSfixed64NoZero returns the size of wire encoding a int64 pointer as a Sfixed64. // The zero value is not encoded. func sizeSfixed64NoZero(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { v := *p.Int64() if v == 0 { return 0 } return f.tagsize + protowire.SizeFixed64() } // appendSfixed64NoZero wire encodes a int64 pointer as a Sfixed64. // The zero value is not encoded. func appendSfixed64NoZero(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := *p.Int64() if v == 0 { return b, nil } b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendFixed64(b, uint64(v)) return b, nil } var coderSfixed64NoZero = pointerCoderFuncs{ size: sizeSfixed64NoZero, marshal: appendSfixed64NoZero, unmarshal: consumeSfixed64, merge: mergeInt64NoZero, } // sizeSfixed64Ptr returns the size of wire encoding a *int64 pointer as a Sfixed64. // It panics if the pointer is nil. func sizeSfixed64Ptr(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { return f.tagsize + protowire.SizeFixed64() } // appendSfixed64Ptr wire encodes a *int64 pointer as a Sfixed64. // It panics if the pointer is nil. func appendSfixed64Ptr(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := **p.Int64Ptr() b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendFixed64(b, uint64(v)) return b, nil } // consumeSfixed64Ptr wire decodes a *int64 pointer as a Sfixed64. func consumeSfixed64Ptr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.Fixed64Type { return out, errUnknown } v, n := protowire.ConsumeFixed64(b) if n < 0 { return out, errDecode } vp := p.Int64Ptr() if *vp == nil { *vp = new(int64) } **vp = int64(v) out.n = n return out, nil } var coderSfixed64Ptr = pointerCoderFuncs{ size: sizeSfixed64Ptr, marshal: appendSfixed64Ptr, unmarshal: consumeSfixed64Ptr, merge: mergeInt64Ptr, } // sizeSfixed64Slice returns the size of wire encoding a []int64 pointer as a repeated Sfixed64. func sizeSfixed64Slice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { s := *p.Int64Slice() size = len(s) * (f.tagsize + protowire.SizeFixed64()) return size } // appendSfixed64Slice encodes a []int64 pointer as a repeated Sfixed64. func appendSfixed64Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { s := *p.Int64Slice() for _, v := range s { b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendFixed64(b, uint64(v)) } return b, nil } // consumeSfixed64Slice wire decodes a []int64 pointer as a repeated Sfixed64. func consumeSfixed64Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { sp := p.Int64Slice() if wtyp == protowire.BytesType { b, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } count := len(b) / protowire.SizeFixed64() if count > 0 { p.growInt64Slice(count) } s := *sp for len(b) > 0 { v, n := protowire.ConsumeFixed64(b) if n < 0 { return out, errDecode } s = append(s, int64(v)) b = b[n:] } *sp = s out.n = n return out, nil } if wtyp != protowire.Fixed64Type { return out, errUnknown } v, n := protowire.ConsumeFixed64(b) if n < 0 { return out, errDecode } *sp = append(*sp, int64(v)) out.n = n return out, nil } var coderSfixed64Slice = pointerCoderFuncs{ size: sizeSfixed64Slice, marshal: appendSfixed64Slice, unmarshal: consumeSfixed64Slice, merge: mergeInt64Slice, } // sizeSfixed64PackedSlice returns the size of wire encoding a []int64 pointer as a packed repeated Sfixed64. func sizeSfixed64PackedSlice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { s := *p.Int64Slice() if len(s) == 0 { return 0 } n := len(s) * protowire.SizeFixed64() return f.tagsize + protowire.SizeBytes(n) } // appendSfixed64PackedSlice encodes a []int64 pointer as a packed repeated Sfixed64. func appendSfixed64PackedSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { s := *p.Int64Slice() if len(s) == 0 { return b, nil } b = protowire.AppendVarint(b, f.wiretag) n := len(s) * protowire.SizeFixed64() b = protowire.AppendVarint(b, uint64(n)) for _, v := range s { b = protowire.AppendFixed64(b, uint64(v)) } return b, nil } var coderSfixed64PackedSlice = pointerCoderFuncs{ size: sizeSfixed64PackedSlice, marshal: appendSfixed64PackedSlice, unmarshal: consumeSfixed64Slice, merge: mergeInt64Slice, } // sizeSfixed64Value returns the size of wire encoding a int64 value as a Sfixed64. func sizeSfixed64Value(v protoreflect.Value, tagsize int, opts marshalOptions) int { return tagsize + protowire.SizeFixed64() } // appendSfixed64Value encodes a int64 value as a Sfixed64. func appendSfixed64Value(b []byte, v protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { b = protowire.AppendVarint(b, wiretag) b = protowire.AppendFixed64(b, uint64(v.Int())) return b, nil } // consumeSfixed64Value decodes a int64 value as a Sfixed64. func consumeSfixed64Value(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) { if wtyp != protowire.Fixed64Type { return protoreflect.Value{}, out, errUnknown } v, n := protowire.ConsumeFixed64(b) if n < 0 { return protoreflect.Value{}, out, errDecode } out.n = n return protoreflect.ValueOfInt64(int64(v)), out, nil } var coderSfixed64Value = valueCoderFuncs{ size: sizeSfixed64Value, marshal: appendSfixed64Value, unmarshal: consumeSfixed64Value, merge: mergeScalarValue, } // sizeSfixed64SliceValue returns the size of wire encoding a []int64 value as a repeated Sfixed64. func sizeSfixed64SliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) { list := listv.List() size = list.Len() * (tagsize + protowire.SizeFixed64()) return size } // appendSfixed64SliceValue encodes a []int64 value as a repeated Sfixed64. func appendSfixed64SliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { list := listv.List() for i, llen := 0, list.Len(); i < llen; i++ { v := list.Get(i) b = protowire.AppendVarint(b, wiretag) b = protowire.AppendFixed64(b, uint64(v.Int())) } return b, nil } // consumeSfixed64SliceValue wire decodes a []int64 value as a repeated Sfixed64. func consumeSfixed64SliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) { list := listv.List() if wtyp == protowire.BytesType { b, n := protowire.ConsumeBytes(b) if n < 0 { return protoreflect.Value{}, out, errDecode } for len(b) > 0 { v, n := protowire.ConsumeFixed64(b) if n < 0 { return protoreflect.Value{}, out, errDecode } list.Append(protoreflect.ValueOfInt64(int64(v))) b = b[n:] } out.n = n return listv, out, nil } if wtyp != protowire.Fixed64Type { return protoreflect.Value{}, out, errUnknown } v, n := protowire.ConsumeFixed64(b) if n < 0 { return protoreflect.Value{}, out, errDecode } list.Append(protoreflect.ValueOfInt64(int64(v))) out.n = n return listv, out, nil } var coderSfixed64SliceValue = valueCoderFuncs{ size: sizeSfixed64SliceValue, marshal: appendSfixed64SliceValue, unmarshal: consumeSfixed64SliceValue, merge: mergeListValue, } // sizeSfixed64PackedSliceValue returns the size of wire encoding a []int64 value as a packed repeated Sfixed64. func sizeSfixed64PackedSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) { list := listv.List() llen := list.Len() if llen == 0 { return 0 } n := llen * protowire.SizeFixed64() return tagsize + protowire.SizeBytes(n) } // appendSfixed64PackedSliceValue encodes a []int64 value as a packed repeated Sfixed64. func appendSfixed64PackedSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { list := listv.List() llen := list.Len() if llen == 0 { return b, nil } b = protowire.AppendVarint(b, wiretag) n := llen * protowire.SizeFixed64() b = protowire.AppendVarint(b, uint64(n)) for i := 0; i < llen; i++ { v := list.Get(i) b = protowire.AppendFixed64(b, uint64(v.Int())) } return b, nil } var coderSfixed64PackedSliceValue = valueCoderFuncs{ size: sizeSfixed64PackedSliceValue, marshal: appendSfixed64PackedSliceValue, unmarshal: consumeSfixed64SliceValue, merge: mergeListValue, } // sizeFixed64 returns the size of wire encoding a uint64 pointer as a Fixed64. func sizeFixed64(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { return f.tagsize + protowire.SizeFixed64() } // appendFixed64 wire encodes a uint64 pointer as a Fixed64. func appendFixed64(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := *p.Uint64() b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendFixed64(b, v) return b, nil } // consumeFixed64 wire decodes a uint64 pointer as a Fixed64. func consumeFixed64(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.Fixed64Type { return out, errUnknown } v, n := protowire.ConsumeFixed64(b) if n < 0 { return out, errDecode } *p.Uint64() = v out.n = n return out, nil } var coderFixed64 = pointerCoderFuncs{ size: sizeFixed64, marshal: appendFixed64, unmarshal: consumeFixed64, merge: mergeUint64, } // sizeFixed64NoZero returns the size of wire encoding a uint64 pointer as a Fixed64. // The zero value is not encoded. func sizeFixed64NoZero(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { v := *p.Uint64() if v == 0 { return 0 } return f.tagsize + protowire.SizeFixed64() } // appendFixed64NoZero wire encodes a uint64 pointer as a Fixed64. // The zero value is not encoded. func appendFixed64NoZero(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := *p.Uint64() if v == 0 { return b, nil } b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendFixed64(b, v) return b, nil } var coderFixed64NoZero = pointerCoderFuncs{ size: sizeFixed64NoZero, marshal: appendFixed64NoZero, unmarshal: consumeFixed64, merge: mergeUint64NoZero, } // sizeFixed64Ptr returns the size of wire encoding a *uint64 pointer as a Fixed64. // It panics if the pointer is nil. func sizeFixed64Ptr(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { return f.tagsize + protowire.SizeFixed64() } // appendFixed64Ptr wire encodes a *uint64 pointer as a Fixed64. // It panics if the pointer is nil. func appendFixed64Ptr(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := **p.Uint64Ptr() b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendFixed64(b, v) return b, nil } // consumeFixed64Ptr wire decodes a *uint64 pointer as a Fixed64. func consumeFixed64Ptr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.Fixed64Type { return out, errUnknown } v, n := protowire.ConsumeFixed64(b) if n < 0 { return out, errDecode } vp := p.Uint64Ptr() if *vp == nil { *vp = new(uint64) } **vp = v out.n = n return out, nil } var coderFixed64Ptr = pointerCoderFuncs{ size: sizeFixed64Ptr, marshal: appendFixed64Ptr, unmarshal: consumeFixed64Ptr, merge: mergeUint64Ptr, } // sizeFixed64Slice returns the size of wire encoding a []uint64 pointer as a repeated Fixed64. func sizeFixed64Slice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { s := *p.Uint64Slice() size = len(s) * (f.tagsize + protowire.SizeFixed64()) return size } // appendFixed64Slice encodes a []uint64 pointer as a repeated Fixed64. func appendFixed64Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { s := *p.Uint64Slice() for _, v := range s { b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendFixed64(b, v) } return b, nil } // consumeFixed64Slice wire decodes a []uint64 pointer as a repeated Fixed64. func consumeFixed64Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { sp := p.Uint64Slice() if wtyp == protowire.BytesType { b, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } count := len(b) / protowire.SizeFixed64() if count > 0 { p.growUint64Slice(count) } s := *sp for len(b) > 0 { v, n := protowire.ConsumeFixed64(b) if n < 0 { return out, errDecode } s = append(s, v) b = b[n:] } *sp = s out.n = n return out, nil } if wtyp != protowire.Fixed64Type { return out, errUnknown } v, n := protowire.ConsumeFixed64(b) if n < 0 { return out, errDecode } *sp = append(*sp, v) out.n = n return out, nil } var coderFixed64Slice = pointerCoderFuncs{ size: sizeFixed64Slice, marshal: appendFixed64Slice, unmarshal: consumeFixed64Slice, merge: mergeUint64Slice, } // sizeFixed64PackedSlice returns the size of wire encoding a []uint64 pointer as a packed repeated Fixed64. func sizeFixed64PackedSlice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { s := *p.Uint64Slice() if len(s) == 0 { return 0 } n := len(s) * protowire.SizeFixed64() return f.tagsize + protowire.SizeBytes(n) } // appendFixed64PackedSlice encodes a []uint64 pointer as a packed repeated Fixed64. func appendFixed64PackedSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { s := *p.Uint64Slice() if len(s) == 0 { return b, nil } b = protowire.AppendVarint(b, f.wiretag) n := len(s) * protowire.SizeFixed64() b = protowire.AppendVarint(b, uint64(n)) for _, v := range s { b = protowire.AppendFixed64(b, v) } return b, nil } var coderFixed64PackedSlice = pointerCoderFuncs{ size: sizeFixed64PackedSlice, marshal: appendFixed64PackedSlice, unmarshal: consumeFixed64Slice, merge: mergeUint64Slice, } // sizeFixed64Value returns the size of wire encoding a uint64 value as a Fixed64. func sizeFixed64Value(v protoreflect.Value, tagsize int, opts marshalOptions) int { return tagsize + protowire.SizeFixed64() } // appendFixed64Value encodes a uint64 value as a Fixed64. func appendFixed64Value(b []byte, v protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { b = protowire.AppendVarint(b, wiretag) b = protowire.AppendFixed64(b, v.Uint()) return b, nil } // consumeFixed64Value decodes a uint64 value as a Fixed64. func consumeFixed64Value(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) { if wtyp != protowire.Fixed64Type { return protoreflect.Value{}, out, errUnknown } v, n := protowire.ConsumeFixed64(b) if n < 0 { return protoreflect.Value{}, out, errDecode } out.n = n return protoreflect.ValueOfUint64(v), out, nil } var coderFixed64Value = valueCoderFuncs{ size: sizeFixed64Value, marshal: appendFixed64Value, unmarshal: consumeFixed64Value, merge: mergeScalarValue, } // sizeFixed64SliceValue returns the size of wire encoding a []uint64 value as a repeated Fixed64. func sizeFixed64SliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) { list := listv.List() size = list.Len() * (tagsize + protowire.SizeFixed64()) return size } // appendFixed64SliceValue encodes a []uint64 value as a repeated Fixed64. func appendFixed64SliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { list := listv.List() for i, llen := 0, list.Len(); i < llen; i++ { v := list.Get(i) b = protowire.AppendVarint(b, wiretag) b = protowire.AppendFixed64(b, v.Uint()) } return b, nil } // consumeFixed64SliceValue wire decodes a []uint64 value as a repeated Fixed64. func consumeFixed64SliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) { list := listv.List() if wtyp == protowire.BytesType { b, n := protowire.ConsumeBytes(b) if n < 0 { return protoreflect.Value{}, out, errDecode } for len(b) > 0 { v, n := protowire.ConsumeFixed64(b) if n < 0 { return protoreflect.Value{}, out, errDecode } list.Append(protoreflect.ValueOfUint64(v)) b = b[n:] } out.n = n return listv, out, nil } if wtyp != protowire.Fixed64Type { return protoreflect.Value{}, out, errUnknown } v, n := protowire.ConsumeFixed64(b) if n < 0 { return protoreflect.Value{}, out, errDecode } list.Append(protoreflect.ValueOfUint64(v)) out.n = n return listv, out, nil } var coderFixed64SliceValue = valueCoderFuncs{ size: sizeFixed64SliceValue, marshal: appendFixed64SliceValue, unmarshal: consumeFixed64SliceValue, merge: mergeListValue, } // sizeFixed64PackedSliceValue returns the size of wire encoding a []uint64 value as a packed repeated Fixed64. func sizeFixed64PackedSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) { list := listv.List() llen := list.Len() if llen == 0 { return 0 } n := llen * protowire.SizeFixed64() return tagsize + protowire.SizeBytes(n) } // appendFixed64PackedSliceValue encodes a []uint64 value as a packed repeated Fixed64. func appendFixed64PackedSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { list := listv.List() llen := list.Len() if llen == 0 { return b, nil } b = protowire.AppendVarint(b, wiretag) n := llen * protowire.SizeFixed64() b = protowire.AppendVarint(b, uint64(n)) for i := 0; i < llen; i++ { v := list.Get(i) b = protowire.AppendFixed64(b, v.Uint()) } return b, nil } var coderFixed64PackedSliceValue = valueCoderFuncs{ size: sizeFixed64PackedSliceValue, marshal: appendFixed64PackedSliceValue, unmarshal: consumeFixed64SliceValue, merge: mergeListValue, } // sizeDouble returns the size of wire encoding a float64 pointer as a Double. func sizeDouble(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { return f.tagsize + protowire.SizeFixed64() } // appendDouble wire encodes a float64 pointer as a Double. func appendDouble(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := *p.Float64() b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendFixed64(b, math.Float64bits(v)) return b, nil } // consumeDouble wire decodes a float64 pointer as a Double. func consumeDouble(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.Fixed64Type { return out, errUnknown } v, n := protowire.ConsumeFixed64(b) if n < 0 { return out, errDecode } *p.Float64() = math.Float64frombits(v) out.n = n return out, nil } var coderDouble = pointerCoderFuncs{ size: sizeDouble, marshal: appendDouble, unmarshal: consumeDouble, merge: mergeFloat64, } // sizeDoubleNoZero returns the size of wire encoding a float64 pointer as a Double. // The zero value is not encoded. func sizeDoubleNoZero(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { v := *p.Float64() if v == 0 && !math.Signbit(float64(v)) { return 0 } return f.tagsize + protowire.SizeFixed64() } // appendDoubleNoZero wire encodes a float64 pointer as a Double. // The zero value is not encoded. func appendDoubleNoZero(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := *p.Float64() if v == 0 && !math.Signbit(float64(v)) { return b, nil } b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendFixed64(b, math.Float64bits(v)) return b, nil } var coderDoubleNoZero = pointerCoderFuncs{ size: sizeDoubleNoZero, marshal: appendDoubleNoZero, unmarshal: consumeDouble, merge: mergeFloat64NoZero, } // sizeDoublePtr returns the size of wire encoding a *float64 pointer as a Double. // It panics if the pointer is nil. func sizeDoublePtr(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { return f.tagsize + protowire.SizeFixed64() } // appendDoublePtr wire encodes a *float64 pointer as a Double. // It panics if the pointer is nil. func appendDoublePtr(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := **p.Float64Ptr() b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendFixed64(b, math.Float64bits(v)) return b, nil } // consumeDoublePtr wire decodes a *float64 pointer as a Double. func consumeDoublePtr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.Fixed64Type { return out, errUnknown } v, n := protowire.ConsumeFixed64(b) if n < 0 { return out, errDecode } vp := p.Float64Ptr() if *vp == nil { *vp = new(float64) } **vp = math.Float64frombits(v) out.n = n return out, nil } var coderDoublePtr = pointerCoderFuncs{ size: sizeDoublePtr, marshal: appendDoublePtr, unmarshal: consumeDoublePtr, merge: mergeFloat64Ptr, } // sizeDoubleSlice returns the size of wire encoding a []float64 pointer as a repeated Double. func sizeDoubleSlice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { s := *p.Float64Slice() size = len(s) * (f.tagsize + protowire.SizeFixed64()) return size } // appendDoubleSlice encodes a []float64 pointer as a repeated Double. func appendDoubleSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { s := *p.Float64Slice() for _, v := range s { b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendFixed64(b, math.Float64bits(v)) } return b, nil } // consumeDoubleSlice wire decodes a []float64 pointer as a repeated Double. func consumeDoubleSlice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { sp := p.Float64Slice() if wtyp == protowire.BytesType { b, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } count := len(b) / protowire.SizeFixed64() if count > 0 { p.growFloat64Slice(count) } s := *sp for len(b) > 0 { v, n := protowire.ConsumeFixed64(b) if n < 0 { return out, errDecode } s = append(s, math.Float64frombits(v)) b = b[n:] } *sp = s out.n = n return out, nil } if wtyp != protowire.Fixed64Type { return out, errUnknown } v, n := protowire.ConsumeFixed64(b) if n < 0 { return out, errDecode } *sp = append(*sp, math.Float64frombits(v)) out.n = n return out, nil } var coderDoubleSlice = pointerCoderFuncs{ size: sizeDoubleSlice, marshal: appendDoubleSlice, unmarshal: consumeDoubleSlice, merge: mergeFloat64Slice, } // sizeDoublePackedSlice returns the size of wire encoding a []float64 pointer as a packed repeated Double. func sizeDoublePackedSlice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { s := *p.Float64Slice() if len(s) == 0 { return 0 } n := len(s) * protowire.SizeFixed64() return f.tagsize + protowire.SizeBytes(n) } // appendDoublePackedSlice encodes a []float64 pointer as a packed repeated Double. func appendDoublePackedSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { s := *p.Float64Slice() if len(s) == 0 { return b, nil } b = protowire.AppendVarint(b, f.wiretag) n := len(s) * protowire.SizeFixed64() b = protowire.AppendVarint(b, uint64(n)) for _, v := range s { b = protowire.AppendFixed64(b, math.Float64bits(v)) } return b, nil } var coderDoublePackedSlice = pointerCoderFuncs{ size: sizeDoublePackedSlice, marshal: appendDoublePackedSlice, unmarshal: consumeDoubleSlice, merge: mergeFloat64Slice, } // sizeDoubleValue returns the size of wire encoding a float64 value as a Double. func sizeDoubleValue(v protoreflect.Value, tagsize int, opts marshalOptions) int { return tagsize + protowire.SizeFixed64() } // appendDoubleValue encodes a float64 value as a Double. func appendDoubleValue(b []byte, v protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { b = protowire.AppendVarint(b, wiretag) b = protowire.AppendFixed64(b, math.Float64bits(v.Float())) return b, nil } // consumeDoubleValue decodes a float64 value as a Double. func consumeDoubleValue(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) { if wtyp != protowire.Fixed64Type { return protoreflect.Value{}, out, errUnknown } v, n := protowire.ConsumeFixed64(b) if n < 0 { return protoreflect.Value{}, out, errDecode } out.n = n return protoreflect.ValueOfFloat64(math.Float64frombits(v)), out, nil } var coderDoubleValue = valueCoderFuncs{ size: sizeDoubleValue, marshal: appendDoubleValue, unmarshal: consumeDoubleValue, merge: mergeScalarValue, } // sizeDoubleSliceValue returns the size of wire encoding a []float64 value as a repeated Double. func sizeDoubleSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) { list := listv.List() size = list.Len() * (tagsize + protowire.SizeFixed64()) return size } // appendDoubleSliceValue encodes a []float64 value as a repeated Double. func appendDoubleSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { list := listv.List() for i, llen := 0, list.Len(); i < llen; i++ { v := list.Get(i) b = protowire.AppendVarint(b, wiretag) b = protowire.AppendFixed64(b, math.Float64bits(v.Float())) } return b, nil } // consumeDoubleSliceValue wire decodes a []float64 value as a repeated Double. func consumeDoubleSliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) { list := listv.List() if wtyp == protowire.BytesType { b, n := protowire.ConsumeBytes(b) if n < 0 { return protoreflect.Value{}, out, errDecode } for len(b) > 0 { v, n := protowire.ConsumeFixed64(b) if n < 0 { return protoreflect.Value{}, out, errDecode } list.Append(protoreflect.ValueOfFloat64(math.Float64frombits(v))) b = b[n:] } out.n = n return listv, out, nil } if wtyp != protowire.Fixed64Type { return protoreflect.Value{}, out, errUnknown } v, n := protowire.ConsumeFixed64(b) if n < 0 { return protoreflect.Value{}, out, errDecode } list.Append(protoreflect.ValueOfFloat64(math.Float64frombits(v))) out.n = n return listv, out, nil } var coderDoubleSliceValue = valueCoderFuncs{ size: sizeDoubleSliceValue, marshal: appendDoubleSliceValue, unmarshal: consumeDoubleSliceValue, merge: mergeListValue, } // sizeDoublePackedSliceValue returns the size of wire encoding a []float64 value as a packed repeated Double. func sizeDoublePackedSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) { list := listv.List() llen := list.Len() if llen == 0 { return 0 } n := llen * protowire.SizeFixed64() return tagsize + protowire.SizeBytes(n) } // appendDoublePackedSliceValue encodes a []float64 value as a packed repeated Double. func appendDoublePackedSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { list := listv.List() llen := list.Len() if llen == 0 { return b, nil } b = protowire.AppendVarint(b, wiretag) n := llen * protowire.SizeFixed64() b = protowire.AppendVarint(b, uint64(n)) for i := 0; i < llen; i++ { v := list.Get(i) b = protowire.AppendFixed64(b, math.Float64bits(v.Float())) } return b, nil } var coderDoublePackedSliceValue = valueCoderFuncs{ size: sizeDoublePackedSliceValue, marshal: appendDoublePackedSliceValue, unmarshal: consumeDoubleSliceValue, merge: mergeListValue, } // sizeString returns the size of wire encoding a string pointer as a String. func sizeString(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { v := *p.String() return f.tagsize + protowire.SizeBytes(len(v)) } // appendString wire encodes a string pointer as a String. func appendString(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := *p.String() b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendString(b, v) return b, nil } // consumeString wire decodes a string pointer as a String. func consumeString(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.BytesType { return out, errUnknown } v, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } *p.String() = string(v) out.n = n return out, nil } var coderString = pointerCoderFuncs{ size: sizeString, marshal: appendString, unmarshal: consumeString, merge: mergeString, } // appendStringValidateUTF8 wire encodes a string pointer as a String. func appendStringValidateUTF8(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := *p.String() b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendString(b, v) if !utf8.ValidString(v) { return b, errInvalidUTF8{} } return b, nil } // consumeStringValidateUTF8 wire decodes a string pointer as a String. func consumeStringValidateUTF8(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.BytesType { return out, errUnknown } v, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } if !utf8.Valid(v) { return out, errInvalidUTF8{} } *p.String() = string(v) out.n = n return out, nil } var coderStringValidateUTF8 = pointerCoderFuncs{ size: sizeString, marshal: appendStringValidateUTF8, unmarshal: consumeStringValidateUTF8, merge: mergeString, } // sizeStringNoZero returns the size of wire encoding a string pointer as a String. // The zero value is not encoded. func sizeStringNoZero(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { v := *p.String() if len(v) == 0 { return 0 } return f.tagsize + protowire.SizeBytes(len(v)) } // appendStringNoZero wire encodes a string pointer as a String. // The zero value is not encoded. func appendStringNoZero(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := *p.String() if len(v) == 0 { return b, nil } b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendString(b, v) return b, nil } var coderStringNoZero = pointerCoderFuncs{ size: sizeStringNoZero, marshal: appendStringNoZero, unmarshal: consumeString, merge: mergeStringNoZero, } // appendStringNoZeroValidateUTF8 wire encodes a string pointer as a String. // The zero value is not encoded. func appendStringNoZeroValidateUTF8(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := *p.String() if len(v) == 0 { return b, nil } b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendString(b, v) if !utf8.ValidString(v) { return b, errInvalidUTF8{} } return b, nil } var coderStringNoZeroValidateUTF8 = pointerCoderFuncs{ size: sizeStringNoZero, marshal: appendStringNoZeroValidateUTF8, unmarshal: consumeStringValidateUTF8, merge: mergeStringNoZero, } // sizeStringPtr returns the size of wire encoding a *string pointer as a String. // It panics if the pointer is nil. func sizeStringPtr(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { v := **p.StringPtr() return f.tagsize + protowire.SizeBytes(len(v)) } // appendStringPtr wire encodes a *string pointer as a String. // It panics if the pointer is nil. func appendStringPtr(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := **p.StringPtr() b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendString(b, v) return b, nil } // consumeStringPtr wire decodes a *string pointer as a String. func consumeStringPtr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.BytesType { return out, errUnknown } v, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } vp := p.StringPtr() if *vp == nil { *vp = new(string) } **vp = string(v) out.n = n return out, nil } var coderStringPtr = pointerCoderFuncs{ size: sizeStringPtr, marshal: appendStringPtr, unmarshal: consumeStringPtr, merge: mergeStringPtr, } // appendStringPtrValidateUTF8 wire encodes a *string pointer as a String. // It panics if the pointer is nil. func appendStringPtrValidateUTF8(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := **p.StringPtr() b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendString(b, v) if !utf8.ValidString(v) { return b, errInvalidUTF8{} } return b, nil } // consumeStringPtrValidateUTF8 wire decodes a *string pointer as a String. func consumeStringPtrValidateUTF8(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.BytesType { return out, errUnknown } v, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } if !utf8.Valid(v) { return out, errInvalidUTF8{} } vp := p.StringPtr() if *vp == nil { *vp = new(string) } **vp = string(v) out.n = n return out, nil } var coderStringPtrValidateUTF8 = pointerCoderFuncs{ size: sizeStringPtr, marshal: appendStringPtrValidateUTF8, unmarshal: consumeStringPtrValidateUTF8, merge: mergeStringPtr, } // sizeStringSlice returns the size of wire encoding a []string pointer as a repeated String. func sizeStringSlice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { s := *p.StringSlice() for _, v := range s { size += f.tagsize + protowire.SizeBytes(len(v)) } return size } // appendStringSlice encodes a []string pointer as a repeated String. func appendStringSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { s := *p.StringSlice() for _, v := range s { b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendString(b, v) } return b, nil } // consumeStringSlice wire decodes a []string pointer as a repeated String. func consumeStringSlice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { sp := p.StringSlice() if wtyp != protowire.BytesType { return out, errUnknown } v, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } *sp = append(*sp, string(v)) out.n = n return out, nil } var coderStringSlice = pointerCoderFuncs{ size: sizeStringSlice, marshal: appendStringSlice, unmarshal: consumeStringSlice, merge: mergeStringSlice, } // appendStringSliceValidateUTF8 encodes a []string pointer as a repeated String. func appendStringSliceValidateUTF8(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { s := *p.StringSlice() for _, v := range s { b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendString(b, v) if !utf8.ValidString(v) { return b, errInvalidUTF8{} } } return b, nil } // consumeStringSliceValidateUTF8 wire decodes a []string pointer as a repeated String. func consumeStringSliceValidateUTF8(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.BytesType { return out, errUnknown } v, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } if !utf8.Valid(v) { return out, errInvalidUTF8{} } sp := p.StringSlice() *sp = append(*sp, string(v)) out.n = n return out, nil } var coderStringSliceValidateUTF8 = pointerCoderFuncs{ size: sizeStringSlice, marshal: appendStringSliceValidateUTF8, unmarshal: consumeStringSliceValidateUTF8, merge: mergeStringSlice, } // sizeStringValue returns the size of wire encoding a string value as a String. func sizeStringValue(v protoreflect.Value, tagsize int, opts marshalOptions) int { return tagsize + protowire.SizeBytes(len(v.String())) } // appendStringValue encodes a string value as a String. func appendStringValue(b []byte, v protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { b = protowire.AppendVarint(b, wiretag) b = protowire.AppendString(b, v.String()) return b, nil } // consumeStringValue decodes a string value as a String. func consumeStringValue(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) { if wtyp != protowire.BytesType { return protoreflect.Value{}, out, errUnknown } v, n := protowire.ConsumeBytes(b) if n < 0 { return protoreflect.Value{}, out, errDecode } out.n = n return protoreflect.ValueOfString(string(v)), out, nil } var coderStringValue = valueCoderFuncs{ size: sizeStringValue, marshal: appendStringValue, unmarshal: consumeStringValue, merge: mergeScalarValue, } // appendStringValueValidateUTF8 encodes a string value as a String. func appendStringValueValidateUTF8(b []byte, v protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { b = protowire.AppendVarint(b, wiretag) b = protowire.AppendString(b, v.String()) if !utf8.ValidString(v.String()) { return b, errInvalidUTF8{} } return b, nil } // consumeStringValueValidateUTF8 decodes a string value as a String. func consumeStringValueValidateUTF8(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) { if wtyp != protowire.BytesType { return protoreflect.Value{}, out, errUnknown } v, n := protowire.ConsumeBytes(b) if n < 0 { return protoreflect.Value{}, out, errDecode } if !utf8.Valid(v) { return protoreflect.Value{}, out, errInvalidUTF8{} } out.n = n return protoreflect.ValueOfString(string(v)), out, nil } var coderStringValueValidateUTF8 = valueCoderFuncs{ size: sizeStringValue, marshal: appendStringValueValidateUTF8, unmarshal: consumeStringValueValidateUTF8, merge: mergeScalarValue, } // sizeStringSliceValue returns the size of wire encoding a []string value as a repeated String. func sizeStringSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) { list := listv.List() for i, llen := 0, list.Len(); i < llen; i++ { v := list.Get(i) size += tagsize + protowire.SizeBytes(len(v.String())) } return size } // appendStringSliceValue encodes a []string value as a repeated String. func appendStringSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { list := listv.List() for i, llen := 0, list.Len(); i < llen; i++ { v := list.Get(i) b = protowire.AppendVarint(b, wiretag) b = protowire.AppendString(b, v.String()) } return b, nil } // consumeStringSliceValue wire decodes a []string value as a repeated String. func consumeStringSliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) { list := listv.List() if wtyp != protowire.BytesType { return protoreflect.Value{}, out, errUnknown } v, n := protowire.ConsumeBytes(b) if n < 0 { return protoreflect.Value{}, out, errDecode } list.Append(protoreflect.ValueOfString(string(v))) out.n = n return listv, out, nil } var coderStringSliceValue = valueCoderFuncs{ size: sizeStringSliceValue, marshal: appendStringSliceValue, unmarshal: consumeStringSliceValue, merge: mergeListValue, } // sizeBytes returns the size of wire encoding a []byte pointer as a Bytes. func sizeBytes(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { v := *p.Bytes() return f.tagsize + protowire.SizeBytes(len(v)) } // appendBytes wire encodes a []byte pointer as a Bytes. func appendBytes(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := *p.Bytes() b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendBytes(b, v) return b, nil } // consumeBytes wire decodes a []byte pointer as a Bytes. func consumeBytes(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.BytesType { return out, errUnknown } v, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } *p.Bytes() = append(emptyBuf[:], v...) out.n = n return out, nil } var coderBytes = pointerCoderFuncs{ size: sizeBytes, marshal: appendBytes, unmarshal: consumeBytes, merge: mergeBytes, } // appendBytesValidateUTF8 wire encodes a []byte pointer as a Bytes. func appendBytesValidateUTF8(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := *p.Bytes() b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendBytes(b, v) if !utf8.Valid(v) { return b, errInvalidUTF8{} } return b, nil } // consumeBytesValidateUTF8 wire decodes a []byte pointer as a Bytes. func consumeBytesValidateUTF8(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.BytesType { return out, errUnknown } v, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } if !utf8.Valid(v) { return out, errInvalidUTF8{} } *p.Bytes() = append(emptyBuf[:], v...) out.n = n return out, nil } var coderBytesValidateUTF8 = pointerCoderFuncs{ size: sizeBytes, marshal: appendBytesValidateUTF8, unmarshal: consumeBytesValidateUTF8, merge: mergeBytes, } // sizeBytesNoZero returns the size of wire encoding a []byte pointer as a Bytes. // The zero value is not encoded. func sizeBytesNoZero(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { v := *p.Bytes() if len(v) == 0 { return 0 } return f.tagsize + protowire.SizeBytes(len(v)) } // appendBytesNoZero wire encodes a []byte pointer as a Bytes. // The zero value is not encoded. func appendBytesNoZero(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := *p.Bytes() if len(v) == 0 { return b, nil } b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendBytes(b, v) return b, nil } // consumeBytesNoZero wire decodes a []byte pointer as a Bytes. // The zero value is not decoded. func consumeBytesNoZero(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.BytesType { return out, errUnknown } v, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } *p.Bytes() = append(([]byte)(nil), v...) out.n = n return out, nil } var coderBytesNoZero = pointerCoderFuncs{ size: sizeBytesNoZero, marshal: appendBytesNoZero, unmarshal: consumeBytesNoZero, merge: mergeBytesNoZero, } // appendBytesNoZeroValidateUTF8 wire encodes a []byte pointer as a Bytes. // The zero value is not encoded. func appendBytesNoZeroValidateUTF8(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { v := *p.Bytes() if len(v) == 0 { return b, nil } b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendBytes(b, v) if !utf8.Valid(v) { return b, errInvalidUTF8{} } return b, nil } // consumeBytesNoZeroValidateUTF8 wire decodes a []byte pointer as a Bytes. func consumeBytesNoZeroValidateUTF8(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.BytesType { return out, errUnknown } v, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } if !utf8.Valid(v) { return out, errInvalidUTF8{} } *p.Bytes() = append(([]byte)(nil), v...) out.n = n return out, nil } var coderBytesNoZeroValidateUTF8 = pointerCoderFuncs{ size: sizeBytesNoZero, marshal: appendBytesNoZeroValidateUTF8, unmarshal: consumeBytesNoZeroValidateUTF8, merge: mergeBytesNoZero, } // sizeBytesSlice returns the size of wire encoding a [][]byte pointer as a repeated Bytes. func sizeBytesSlice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { s := *p.BytesSlice() for _, v := range s { size += f.tagsize + protowire.SizeBytes(len(v)) } return size } // appendBytesSlice encodes a [][]byte pointer as a repeated Bytes. func appendBytesSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { s := *p.BytesSlice() for _, v := range s { b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendBytes(b, v) } return b, nil } // consumeBytesSlice wire decodes a [][]byte pointer as a repeated Bytes. func consumeBytesSlice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { sp := p.BytesSlice() if wtyp != protowire.BytesType { return out, errUnknown } v, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } *sp = append(*sp, append(emptyBuf[:], v...)) out.n = n return out, nil } var coderBytesSlice = pointerCoderFuncs{ size: sizeBytesSlice, marshal: appendBytesSlice, unmarshal: consumeBytesSlice, merge: mergeBytesSlice, } // appendBytesSliceValidateUTF8 encodes a [][]byte pointer as a repeated Bytes. func appendBytesSliceValidateUTF8(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { s := *p.BytesSlice() for _, v := range s { b = protowire.AppendVarint(b, f.wiretag) b = protowire.AppendBytes(b, v) if !utf8.Valid(v) { return b, errInvalidUTF8{} } } return b, nil } // consumeBytesSliceValidateUTF8 wire decodes a [][]byte pointer as a repeated Bytes. func consumeBytesSliceValidateUTF8(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { if wtyp != protowire.BytesType { return out, errUnknown } v, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } if !utf8.Valid(v) { return out, errInvalidUTF8{} } sp := p.BytesSlice() *sp = append(*sp, append(emptyBuf[:], v...)) out.n = n return out, nil } var coderBytesSliceValidateUTF8 = pointerCoderFuncs{ size: sizeBytesSlice, marshal: appendBytesSliceValidateUTF8, unmarshal: consumeBytesSliceValidateUTF8, merge: mergeBytesSlice, } // sizeBytesValue returns the size of wire encoding a []byte value as a Bytes. func sizeBytesValue(v protoreflect.Value, tagsize int, opts marshalOptions) int { return tagsize + protowire.SizeBytes(len(v.Bytes())) } // appendBytesValue encodes a []byte value as a Bytes. func appendBytesValue(b []byte, v protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { b = protowire.AppendVarint(b, wiretag) b = protowire.AppendBytes(b, v.Bytes()) return b, nil } // consumeBytesValue decodes a []byte value as a Bytes. func consumeBytesValue(b []byte, _ protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) { if wtyp != protowire.BytesType { return protoreflect.Value{}, out, errUnknown } v, n := protowire.ConsumeBytes(b) if n < 0 { return protoreflect.Value{}, out, errDecode } out.n = n return protoreflect.ValueOfBytes(append(emptyBuf[:], v...)), out, nil } var coderBytesValue = valueCoderFuncs{ size: sizeBytesValue, marshal: appendBytesValue, unmarshal: consumeBytesValue, merge: mergeBytesValue, } // sizeBytesSliceValue returns the size of wire encoding a [][]byte value as a repeated Bytes. func sizeBytesSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) (size int) { list := listv.List() for i, llen := 0, list.Len(); i < llen; i++ { v := list.Get(i) size += tagsize + protowire.SizeBytes(len(v.Bytes())) } return size } // appendBytesSliceValue encodes a [][]byte value as a repeated Bytes. func appendBytesSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) { list := listv.List() for i, llen := 0, list.Len(); i < llen; i++ { v := list.Get(i) b = protowire.AppendVarint(b, wiretag) b = protowire.AppendBytes(b, v.Bytes()) } return b, nil } // consumeBytesSliceValue wire decodes a [][]byte value as a repeated Bytes. func consumeBytesSliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) { list := listv.List() if wtyp != protowire.BytesType { return protoreflect.Value{}, out, errUnknown } v, n := protowire.ConsumeBytes(b) if n < 0 { return protoreflect.Value{}, out, errDecode } list.Append(protoreflect.ValueOfBytes(append(emptyBuf[:], v...))) out.n = n return listv, out, nil } var coderBytesSliceValue = valueCoderFuncs{ size: sizeBytesSliceValue, marshal: appendBytesSliceValue, unmarshal: consumeBytesSliceValue, merge: mergeBytesListValue, } // We append to an empty array rather than a nil []byte to get non-nil zero-length byte slices. var emptyBuf [0]byte var wireTypes = map[protoreflect.Kind]protowire.Type{ protoreflect.BoolKind: protowire.VarintType, protoreflect.EnumKind: protowire.VarintType, protoreflect.Int32Kind: protowire.VarintType, protoreflect.Sint32Kind: protowire.VarintType, protoreflect.Uint32Kind: protowire.VarintType, protoreflect.Int64Kind: protowire.VarintType, protoreflect.Sint64Kind: protowire.VarintType, protoreflect.Uint64Kind: protowire.VarintType, protoreflect.Sfixed32Kind: protowire.Fixed32Type, protoreflect.Fixed32Kind: protowire.Fixed32Type, protoreflect.FloatKind: protowire.Fixed32Type, protoreflect.Sfixed64Kind: protowire.Fixed64Type, protoreflect.Fixed64Kind: protowire.Fixed64Type, protoreflect.DoubleKind: protowire.Fixed64Type, protoreflect.StringKind: protowire.BytesType, protoreflect.BytesKind: protowire.BytesType, protoreflect.MessageKind: protowire.BytesType, protoreflect.GroupKind: protowire.StartGroupType, } ================================================ FILE: vendor/google.golang.org/protobuf/internal/impl/codec_map.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package impl import ( "reflect" "sort" "google.golang.org/protobuf/encoding/protowire" "google.golang.org/protobuf/internal/errors" "google.golang.org/protobuf/internal/genid" "google.golang.org/protobuf/reflect/protoreflect" ) type mapInfo struct { goType reflect.Type keyWiretag uint64 valWiretag uint64 keyFuncs valueCoderFuncs valFuncs valueCoderFuncs keyZero protoreflect.Value keyKind protoreflect.Kind conv *mapConverter } func encoderFuncsForMap(fd protoreflect.FieldDescriptor, ft reflect.Type) (valueMessage *MessageInfo, funcs pointerCoderFuncs) { // TODO: Consider generating specialized map coders. keyField := fd.MapKey() valField := fd.MapValue() keyWiretag := protowire.EncodeTag(1, wireTypes[keyField.Kind()]) valWiretag := protowire.EncodeTag(2, wireTypes[valField.Kind()]) keyFuncs := encoderFuncsForValue(keyField) valFuncs := encoderFuncsForValue(valField) conv := newMapConverter(ft, fd) mapi := &mapInfo{ goType: ft, keyWiretag: keyWiretag, valWiretag: valWiretag, keyFuncs: keyFuncs, valFuncs: valFuncs, keyZero: keyField.Default(), keyKind: keyField.Kind(), conv: conv, } if valField.Kind() == protoreflect.MessageKind { valueMessage = getMessageInfo(ft.Elem()) } funcs = pointerCoderFuncs{ size: func(p pointer, f *coderFieldInfo, opts marshalOptions) int { return sizeMap(p.AsValueOf(ft).Elem(), mapi, f, opts) }, marshal: func(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { return appendMap(b, p.AsValueOf(ft).Elem(), mapi, f, opts) }, unmarshal: func(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (unmarshalOutput, error) { mp := p.AsValueOf(ft) if mp.Elem().IsNil() { mp.Elem().Set(reflect.MakeMap(mapi.goType)) } if f.mi == nil { return consumeMap(b, mp.Elem(), wtyp, mapi, f, opts) } else { return consumeMapOfMessage(b, mp.Elem(), wtyp, mapi, f, opts) } }, } switch valField.Kind() { case protoreflect.MessageKind: funcs.merge = mergeMapOfMessage case protoreflect.BytesKind: funcs.merge = mergeMapOfBytes default: funcs.merge = mergeMap } if valFuncs.isInit != nil { funcs.isInit = func(p pointer, f *coderFieldInfo) error { return isInitMap(p.AsValueOf(ft).Elem(), mapi, f) } } return valueMessage, funcs } const ( mapKeyTagSize = 1 // field 1, tag size 1. mapValTagSize = 1 // field 2, tag size 2. ) func sizeMap(mapv reflect.Value, mapi *mapInfo, f *coderFieldInfo, opts marshalOptions) int { if mapv.Len() == 0 { return 0 } n := 0 iter := mapv.MapRange() for iter.Next() { key := mapi.conv.keyConv.PBValueOf(iter.Key()).MapKey() keySize := mapi.keyFuncs.size(key.Value(), mapKeyTagSize, opts) var valSize int value := mapi.conv.valConv.PBValueOf(iter.Value()) if f.mi == nil { valSize = mapi.valFuncs.size(value, mapValTagSize, opts) } else { p := pointerOfValue(iter.Value()) valSize += mapValTagSize valSize += protowire.SizeBytes(f.mi.sizePointer(p, opts)) } n += f.tagsize + protowire.SizeBytes(keySize+valSize) } return n } func consumeMap(b []byte, mapv reflect.Value, wtyp protowire.Type, mapi *mapInfo, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { if opts.depth--; opts.depth < 0 { return out, errRecursionDepth } if wtyp != protowire.BytesType { return out, errUnknown } b, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } var ( key = mapi.keyZero val = mapi.conv.valConv.New() ) for len(b) > 0 { num, wtyp, n := protowire.ConsumeTag(b) if n < 0 { return out, errDecode } if num > protowire.MaxValidNumber { return out, errDecode } b = b[n:] err := errUnknown switch num { case genid.MapEntry_Key_field_number: var v protoreflect.Value var o unmarshalOutput v, o, err = mapi.keyFuncs.unmarshal(b, key, num, wtyp, opts) if err != nil { break } key = v n = o.n case genid.MapEntry_Value_field_number: var v protoreflect.Value var o unmarshalOutput v, o, err = mapi.valFuncs.unmarshal(b, val, num, wtyp, opts) if err != nil { break } val = v n = o.n } if err == errUnknown { n = protowire.ConsumeFieldValue(num, wtyp, b) if n < 0 { return out, errDecode } } else if err != nil { return out, err } b = b[n:] } mapv.SetMapIndex(mapi.conv.keyConv.GoValueOf(key), mapi.conv.valConv.GoValueOf(val)) out.n = n return out, nil } func consumeMapOfMessage(b []byte, mapv reflect.Value, wtyp protowire.Type, mapi *mapInfo, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { if opts.depth--; opts.depth < 0 { return out, errRecursionDepth } if wtyp != protowire.BytesType { return out, errUnknown } b, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } var ( key = mapi.keyZero val = reflect.New(f.mi.GoReflectType.Elem()) ) for len(b) > 0 { num, wtyp, n := protowire.ConsumeTag(b) if n < 0 { return out, errDecode } if num > protowire.MaxValidNumber { return out, errDecode } b = b[n:] err := errUnknown switch num { case 1: var v protoreflect.Value var o unmarshalOutput v, o, err = mapi.keyFuncs.unmarshal(b, key, num, wtyp, opts) if err != nil { break } key = v n = o.n case 2: if wtyp != protowire.BytesType { break } var v []byte v, n = protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } var o unmarshalOutput o, err = f.mi.unmarshalPointer(v, pointerOfValue(val), 0, opts) if o.initialized { // Consider this map item initialized so long as we see // an initialized value. out.initialized = true } } if err == errUnknown { n = protowire.ConsumeFieldValue(num, wtyp, b) if n < 0 { return out, errDecode } } else if err != nil { return out, err } b = b[n:] } mapv.SetMapIndex(mapi.conv.keyConv.GoValueOf(key), val) out.n = n return out, nil } func appendMapItem(b []byte, keyrv, valrv reflect.Value, mapi *mapInfo, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { if f.mi == nil { key := mapi.conv.keyConv.PBValueOf(keyrv).MapKey() val := mapi.conv.valConv.PBValueOf(valrv) size := 0 size += mapi.keyFuncs.size(key.Value(), mapKeyTagSize, opts) size += mapi.valFuncs.size(val, mapValTagSize, opts) b = protowire.AppendVarint(b, uint64(size)) before := len(b) b, err := mapi.keyFuncs.marshal(b, key.Value(), mapi.keyWiretag, opts) if err != nil { return nil, err } b, err = mapi.valFuncs.marshal(b, val, mapi.valWiretag, opts) if measuredSize := len(b) - before; size != measuredSize && err == nil { return nil, errors.MismatchedSizeCalculation(size, measuredSize) } return b, err } else { key := mapi.conv.keyConv.PBValueOf(keyrv).MapKey() val := pointerOfValue(valrv) valSize := f.mi.sizePointer(val, opts) size := 0 size += mapi.keyFuncs.size(key.Value(), mapKeyTagSize, opts) size += mapValTagSize + protowire.SizeBytes(valSize) b = protowire.AppendVarint(b, uint64(size)) b, err := mapi.keyFuncs.marshal(b, key.Value(), mapi.keyWiretag, opts) if err != nil { return nil, err } b = protowire.AppendVarint(b, mapi.valWiretag) b = protowire.AppendVarint(b, uint64(valSize)) before := len(b) b, err = f.mi.marshalAppendPointer(b, val, opts) if measuredSize := len(b) - before; valSize != measuredSize && err == nil { return nil, errors.MismatchedSizeCalculation(valSize, measuredSize) } return b, err } } func appendMap(b []byte, mapv reflect.Value, mapi *mapInfo, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { if mapv.Len() == 0 { return b, nil } if opts.Deterministic() { return appendMapDeterministic(b, mapv, mapi, f, opts) } iter := mapv.MapRange() for iter.Next() { var err error b = protowire.AppendVarint(b, f.wiretag) b, err = appendMapItem(b, iter.Key(), iter.Value(), mapi, f, opts) if err != nil { return b, err } } return b, nil } func appendMapDeterministic(b []byte, mapv reflect.Value, mapi *mapInfo, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { keys := mapv.MapKeys() sort.Slice(keys, func(i, j int) bool { switch keys[i].Kind() { case reflect.Bool: return !keys[i].Bool() && keys[j].Bool() case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: return keys[i].Int() < keys[j].Int() case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: return keys[i].Uint() < keys[j].Uint() case reflect.Float32, reflect.Float64: return keys[i].Float() < keys[j].Float() case reflect.String: return keys[i].String() < keys[j].String() default: panic("invalid kind: " + keys[i].Kind().String()) } }) for _, key := range keys { var err error b = protowire.AppendVarint(b, f.wiretag) b, err = appendMapItem(b, key, mapv.MapIndex(key), mapi, f, opts) if err != nil { return b, err } } return b, nil } func isInitMap(mapv reflect.Value, mapi *mapInfo, f *coderFieldInfo) error { if mi := f.mi; mi != nil { mi.init() if !mi.needsInitCheck { return nil } iter := mapv.MapRange() for iter.Next() { val := pointerOfValue(iter.Value()) if err := mi.checkInitializedPointer(val); err != nil { return err } } } else { iter := mapv.MapRange() for iter.Next() { val := mapi.conv.valConv.PBValueOf(iter.Value()) if err := mapi.valFuncs.isInit(val); err != nil { return err } } } return nil } func mergeMap(dst, src pointer, f *coderFieldInfo, opts mergeOptions) { dstm := dst.AsValueOf(f.ft).Elem() srcm := src.AsValueOf(f.ft).Elem() if srcm.Len() == 0 { return } if dstm.IsNil() { dstm.Set(reflect.MakeMap(f.ft)) } iter := srcm.MapRange() for iter.Next() { dstm.SetMapIndex(iter.Key(), iter.Value()) } } func mergeMapOfBytes(dst, src pointer, f *coderFieldInfo, opts mergeOptions) { dstm := dst.AsValueOf(f.ft).Elem() srcm := src.AsValueOf(f.ft).Elem() if srcm.Len() == 0 { return } if dstm.IsNil() { dstm.Set(reflect.MakeMap(f.ft)) } iter := srcm.MapRange() for iter.Next() { dstm.SetMapIndex(iter.Key(), reflect.ValueOf(append(emptyBuf[:], iter.Value().Bytes()...))) } } func mergeMapOfMessage(dst, src pointer, f *coderFieldInfo, opts mergeOptions) { dstm := dst.AsValueOf(f.ft).Elem() srcm := src.AsValueOf(f.ft).Elem() if srcm.Len() == 0 { return } if dstm.IsNil() { dstm.Set(reflect.MakeMap(f.ft)) } iter := srcm.MapRange() for iter.Next() { val := reflect.New(f.ft.Elem().Elem()) if f.mi != nil { f.mi.mergePointer(pointerOfValue(val), pointerOfValue(iter.Value()), opts) } else { opts.Merge(asMessage(val), asMessage(iter.Value())) } dstm.SetMapIndex(iter.Key(), val) } } ================================================ FILE: vendor/google.golang.org/protobuf/internal/impl/codec_message.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package impl import ( "fmt" "reflect" "sort" "google.golang.org/protobuf/encoding/protowire" "google.golang.org/protobuf/internal/encoding/messageset" "google.golang.org/protobuf/internal/order" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/runtime/protoiface" ) // coderMessageInfo contains per-message information used by the fast-path functions. // This is a different type from MessageInfo to keep MessageInfo as general-purpose as // possible. type coderMessageInfo struct { methods protoiface.Methods orderedCoderFields []*coderFieldInfo denseCoderFields []*coderFieldInfo coderFields map[protowire.Number]*coderFieldInfo sizecacheOffset offset unknownOffset offset unknownPtrKind bool extensionOffset offset needsInitCheck bool isMessageSet bool numRequiredFields uint8 lazyOffset offset presenceOffset offset presenceSize presenceSize } type coderFieldInfo struct { funcs pointerCoderFuncs // fast-path per-field functions mi *MessageInfo // field's message ft reflect.Type validation validationInfo // information used by message validation num protoreflect.FieldNumber // field number offset offset // struct field offset wiretag uint64 // field tag (number + wire type) tagsize int // size of the varint-encoded tag isPointer bool // true if IsNil may be called on the struct field isRequired bool // true if field is required isLazy bool presenceIndex uint32 } const noPresence = 0xffffffff func (mi *MessageInfo) makeCoderMethods(t reflect.Type, si structInfo) { mi.sizecacheOffset = invalidOffset mi.unknownOffset = invalidOffset mi.extensionOffset = invalidOffset mi.lazyOffset = invalidOffset mi.presenceOffset = si.presenceOffset if si.sizecacheOffset.IsValid() && si.sizecacheType == sizecacheType { mi.sizecacheOffset = si.sizecacheOffset } if si.unknownOffset.IsValid() && (si.unknownType == unknownFieldsAType || si.unknownType == unknownFieldsBType) { mi.unknownOffset = si.unknownOffset mi.unknownPtrKind = si.unknownType.Kind() == reflect.Ptr } if si.extensionOffset.IsValid() && si.extensionType == extensionFieldsType { mi.extensionOffset = si.extensionOffset } mi.coderFields = make(map[protowire.Number]*coderFieldInfo) fields := mi.Desc.Fields() preallocFields := make([]coderFieldInfo, fields.Len()) for i := 0; i < fields.Len(); i++ { fd := fields.Get(i) fs := si.fieldsByNumber[fd.Number()] isOneof := fd.ContainingOneof() != nil && !fd.ContainingOneof().IsSynthetic() if isOneof { fs = si.oneofsByName[fd.ContainingOneof().Name()] } ft := fs.Type var wiretag uint64 if !fd.IsPacked() { wiretag = protowire.EncodeTag(fd.Number(), wireTypes[fd.Kind()]) } else { wiretag = protowire.EncodeTag(fd.Number(), protowire.BytesType) } var fieldOffset offset var funcs pointerCoderFuncs var childMessage *MessageInfo switch { case ft == nil: // This never occurs for generated message types. // It implies that a hand-crafted type has missing Go fields // for specific protobuf message fields. funcs = pointerCoderFuncs{ size: func(p pointer, f *coderFieldInfo, opts marshalOptions) int { return 0 }, marshal: func(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { return nil, nil }, unmarshal: func(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (unmarshalOutput, error) { panic("missing Go struct field for " + string(fd.FullName())) }, isInit: func(p pointer, f *coderFieldInfo) error { panic("missing Go struct field for " + string(fd.FullName())) }, merge: func(dst, src pointer, f *coderFieldInfo, opts mergeOptions) { panic("missing Go struct field for " + string(fd.FullName())) }, } case isOneof: fieldOffset = offsetOf(fs) default: fieldOffset = offsetOf(fs) childMessage, funcs = fieldCoder(fd, ft) } cf := &preallocFields[i] *cf = coderFieldInfo{ num: fd.Number(), offset: fieldOffset, wiretag: wiretag, ft: ft, tagsize: protowire.SizeVarint(wiretag), funcs: funcs, mi: childMessage, validation: newFieldValidationInfo(mi, si, fd, ft), isPointer: fd.Cardinality() == protoreflect.Repeated || fd.HasPresence(), isRequired: fd.Cardinality() == protoreflect.Required, presenceIndex: noPresence, } mi.orderedCoderFields = append(mi.orderedCoderFields, cf) mi.coderFields[cf.num] = cf } for i, oneofs := 0, mi.Desc.Oneofs(); i < oneofs.Len(); i++ { if od := oneofs.Get(i); !od.IsSynthetic() { mi.initOneofFieldCoders(od, si) } } if messageset.IsMessageSet(mi.Desc) { if !mi.extensionOffset.IsValid() { panic(fmt.Sprintf("%v: MessageSet with no extensions field", mi.Desc.FullName())) } if !mi.unknownOffset.IsValid() { panic(fmt.Sprintf("%v: MessageSet with no unknown field", mi.Desc.FullName())) } mi.isMessageSet = true } sort.Slice(mi.orderedCoderFields, func(i, j int) bool { return mi.orderedCoderFields[i].num < mi.orderedCoderFields[j].num }) var maxDense protoreflect.FieldNumber for _, cf := range mi.orderedCoderFields { if cf.num >= 16 && cf.num >= 2*maxDense { break } maxDense = cf.num } mi.denseCoderFields = make([]*coderFieldInfo, maxDense+1) for _, cf := range mi.orderedCoderFields { if int(cf.num) >= len(mi.denseCoderFields) { break } mi.denseCoderFields[cf.num] = cf } // To preserve compatibility with historic wire output, marshal oneofs last. if mi.Desc.Oneofs().Len() > 0 { sort.Slice(mi.orderedCoderFields, func(i, j int) bool { fi := fields.ByNumber(mi.orderedCoderFields[i].num) fj := fields.ByNumber(mi.orderedCoderFields[j].num) return order.LegacyFieldOrder(fi, fj) }) } mi.needsInitCheck = needsInitCheck(mi.Desc) if mi.methods.Marshal == nil && mi.methods.Size == nil { mi.methods.Flags |= protoiface.SupportMarshalDeterministic mi.methods.Marshal = mi.marshal mi.methods.Size = mi.size } if mi.methods.Unmarshal == nil { mi.methods.Flags |= protoiface.SupportUnmarshalDiscardUnknown mi.methods.Unmarshal = mi.unmarshal } if mi.methods.CheckInitialized == nil { mi.methods.CheckInitialized = mi.checkInitialized } if mi.methods.Merge == nil { mi.methods.Merge = mi.merge } if mi.methods.Equal == nil { mi.methods.Equal = equal } } // getUnknownBytes returns a *[]byte for the unknown fields. // It is the caller's responsibility to check whether the pointer is nil. // This function is specially designed to be inlineable. func (mi *MessageInfo) getUnknownBytes(p pointer) *[]byte { if mi.unknownPtrKind { return *p.Apply(mi.unknownOffset).BytesPtr() } else { return p.Apply(mi.unknownOffset).Bytes() } } // mutableUnknownBytes returns a *[]byte for the unknown fields. // The returned pointer is guaranteed to not be nil. func (mi *MessageInfo) mutableUnknownBytes(p pointer) *[]byte { if mi.unknownPtrKind { bp := p.Apply(mi.unknownOffset).BytesPtr() if *bp == nil { *bp = new([]byte) } return *bp } else { return p.Apply(mi.unknownOffset).Bytes() } } ================================================ FILE: vendor/google.golang.org/protobuf/internal/impl/codec_message_opaque.go ================================================ // Copyright 2024 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package impl import ( "fmt" "reflect" "sort" "google.golang.org/protobuf/encoding/protowire" "google.golang.org/protobuf/internal/encoding/messageset" "google.golang.org/protobuf/internal/filedesc" "google.golang.org/protobuf/internal/order" "google.golang.org/protobuf/reflect/protoreflect" piface "google.golang.org/protobuf/runtime/protoiface" ) func (mi *MessageInfo) makeOpaqueCoderMethods(t reflect.Type, si opaqueStructInfo) { mi.sizecacheOffset = si.sizecacheOffset mi.unknownOffset = si.unknownOffset mi.unknownPtrKind = si.unknownType.Kind() == reflect.Ptr mi.extensionOffset = si.extensionOffset mi.lazyOffset = si.lazyOffset mi.presenceOffset = si.presenceOffset mi.coderFields = make(map[protowire.Number]*coderFieldInfo) fields := mi.Desc.Fields() for i := 0; i < fields.Len(); i++ { fd := fields.Get(i) fs := si.fieldsByNumber[fd.Number()] if fd.ContainingOneof() != nil && !fd.ContainingOneof().IsSynthetic() { fs = si.oneofsByName[fd.ContainingOneof().Name()] } ft := fs.Type var wiretag uint64 if !fd.IsPacked() { wiretag = protowire.EncodeTag(fd.Number(), wireTypes[fd.Kind()]) } else { wiretag = protowire.EncodeTag(fd.Number(), protowire.BytesType) } var fieldOffset offset var funcs pointerCoderFuncs var childMessage *MessageInfo switch { case fd.ContainingOneof() != nil && !fd.ContainingOneof().IsSynthetic(): fieldOffset = offsetOf(fs) case fd.Message() != nil && !fd.IsMap(): fieldOffset = offsetOf(fs) if fd.IsList() { childMessage, funcs = makeOpaqueRepeatedMessageFieldCoder(fd, ft) } else { childMessage, funcs = makeOpaqueMessageFieldCoder(fd, ft) } default: fieldOffset = offsetOf(fs) childMessage, funcs = fieldCoder(fd, ft) } cf := &coderFieldInfo{ num: fd.Number(), offset: fieldOffset, wiretag: wiretag, ft: ft, tagsize: protowire.SizeVarint(wiretag), funcs: funcs, mi: childMessage, validation: newFieldValidationInfo(mi, si.structInfo, fd, ft), isPointer: (fd.Cardinality() == protoreflect.Repeated || fd.Kind() == protoreflect.MessageKind || fd.Kind() == protoreflect.GroupKind), isRequired: fd.Cardinality() == protoreflect.Required, presenceIndex: noPresence, } // TODO: Use presence for all fields. // // In some cases, such as maps, presence means only "might be set" rather // than "is definitely set", but every field should have a presence bit to // permit us to skip over definitely-unset fields at marshal time. var hasPresence bool hasPresence, cf.isLazy = filedesc.UsePresenceForField(fd) if hasPresence { cf.presenceIndex, mi.presenceSize = presenceIndex(mi.Desc, fd) } mi.orderedCoderFields = append(mi.orderedCoderFields, cf) mi.coderFields[cf.num] = cf } for i, oneofs := 0, mi.Desc.Oneofs(); i < oneofs.Len(); i++ { if od := oneofs.Get(i); !od.IsSynthetic() { mi.initOneofFieldCoders(od, si.structInfo) } } if messageset.IsMessageSet(mi.Desc) { if !mi.extensionOffset.IsValid() { panic(fmt.Sprintf("%v: MessageSet with no extensions field", mi.Desc.FullName())) } if !mi.unknownOffset.IsValid() { panic(fmt.Sprintf("%v: MessageSet with no unknown field", mi.Desc.FullName())) } mi.isMessageSet = true } sort.Slice(mi.orderedCoderFields, func(i, j int) bool { return mi.orderedCoderFields[i].num < mi.orderedCoderFields[j].num }) var maxDense protoreflect.FieldNumber for _, cf := range mi.orderedCoderFields { if cf.num >= 16 && cf.num >= 2*maxDense { break } maxDense = cf.num } mi.denseCoderFields = make([]*coderFieldInfo, maxDense+1) for _, cf := range mi.orderedCoderFields { if int(cf.num) > len(mi.denseCoderFields) { break } mi.denseCoderFields[cf.num] = cf } // To preserve compatibility with historic wire output, marshal oneofs last. if mi.Desc.Oneofs().Len() > 0 { sort.Slice(mi.orderedCoderFields, func(i, j int) bool { fi := fields.ByNumber(mi.orderedCoderFields[i].num) fj := fields.ByNumber(mi.orderedCoderFields[j].num) return order.LegacyFieldOrder(fi, fj) }) } mi.needsInitCheck = needsInitCheck(mi.Desc) if mi.methods.Marshal == nil && mi.methods.Size == nil { mi.methods.Flags |= piface.SupportMarshalDeterministic mi.methods.Marshal = mi.marshal mi.methods.Size = mi.size } if mi.methods.Unmarshal == nil { mi.methods.Flags |= piface.SupportUnmarshalDiscardUnknown mi.methods.Unmarshal = mi.unmarshal } if mi.methods.CheckInitialized == nil { mi.methods.CheckInitialized = mi.checkInitialized } if mi.methods.Merge == nil { mi.methods.Merge = mi.merge } if mi.methods.Equal == nil { mi.methods.Equal = equal } } ================================================ FILE: vendor/google.golang.org/protobuf/internal/impl/codec_messageset.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package impl import ( "sort" "google.golang.org/protobuf/encoding/protowire" "google.golang.org/protobuf/internal/encoding/messageset" "google.golang.org/protobuf/internal/errors" "google.golang.org/protobuf/internal/flags" ) func sizeMessageSet(mi *MessageInfo, p pointer, opts marshalOptions) (size int) { if !flags.ProtoLegacy { return 0 } ext := *p.Apply(mi.extensionOffset).Extensions() for _, x := range ext { xi := getExtensionFieldInfo(x.Type()) if xi.funcs.size == nil { continue } num, _ := protowire.DecodeTag(xi.wiretag) size += messageset.SizeField(num) if fullyLazyExtensions(opts) { // Don't expand the extension, instead use the buffer to calculate size if lb := x.lazyBuffer(); lb != nil { // We got hold of the buffer, so it's still lazy. // Don't count the tag size in the extension buffer, it's already added. size += protowire.SizeTag(messageset.FieldMessage) + len(lb) - xi.tagsize continue } } size += xi.funcs.size(x.Value(), protowire.SizeTag(messageset.FieldMessage), opts) } if u := mi.getUnknownBytes(p); u != nil { size += messageset.SizeUnknown(*u) } return size } func marshalMessageSet(mi *MessageInfo, b []byte, p pointer, opts marshalOptions) ([]byte, error) { if !flags.ProtoLegacy { return b, errors.New("no support for message_set_wire_format") } ext := *p.Apply(mi.extensionOffset).Extensions() switch len(ext) { case 0: case 1: // Fast-path for one extension: Don't bother sorting the keys. for _, x := range ext { var err error b, err = marshalMessageSetField(mi, b, x, opts) if err != nil { return b, err } } default: // Sort the keys to provide a deterministic encoding. // Not sure this is required, but the old code does it. keys := make([]int, 0, len(ext)) for k := range ext { keys = append(keys, int(k)) } sort.Ints(keys) for _, k := range keys { var err error b, err = marshalMessageSetField(mi, b, ext[int32(k)], opts) if err != nil { return b, err } } } if u := mi.getUnknownBytes(p); u != nil { var err error b, err = messageset.AppendUnknown(b, *u) if err != nil { return b, err } } return b, nil } func marshalMessageSetField(mi *MessageInfo, b []byte, x ExtensionField, opts marshalOptions) ([]byte, error) { xi := getExtensionFieldInfo(x.Type()) num, _ := protowire.DecodeTag(xi.wiretag) b = messageset.AppendFieldStart(b, num) if fullyLazyExtensions(opts) { // Don't expand the extension if it's still in wire format, instead use the buffer content. if lb := x.lazyBuffer(); lb != nil { // The tag inside the lazy buffer is a different tag (the extension // number), but what we need here is the tag for FieldMessage: b = protowire.AppendVarint(b, protowire.EncodeTag(messageset.FieldMessage, protowire.BytesType)) b = append(b, lb[xi.tagsize:]...) b = messageset.AppendFieldEnd(b) return b, nil } } b, err := xi.funcs.marshal(b, x.Value(), protowire.EncodeTag(messageset.FieldMessage, protowire.BytesType), opts) if err != nil { return b, err } b = messageset.AppendFieldEnd(b) return b, nil } func unmarshalMessageSet(mi *MessageInfo, b []byte, p pointer, opts unmarshalOptions) (out unmarshalOutput, err error) { if !flags.ProtoLegacy { return out, errors.New("no support for message_set_wire_format") } ep := p.Apply(mi.extensionOffset).Extensions() if *ep == nil { *ep = make(map[int32]ExtensionField) } ext := *ep initialized := true err = messageset.Unmarshal(b, true, func(num protowire.Number, v []byte) error { o, err := mi.unmarshalExtension(v, num, protowire.BytesType, ext, opts) if err == errUnknown { u := mi.mutableUnknownBytes(p) *u = protowire.AppendTag(*u, num, protowire.BytesType) *u = append(*u, v...) return nil } if !o.initialized { initialized = false } return err }) out.n = len(b) out.initialized = initialized return out, err } ================================================ FILE: vendor/google.golang.org/protobuf/internal/impl/codec_tables.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package impl import ( "fmt" "reflect" "google.golang.org/protobuf/encoding/protowire" "google.golang.org/protobuf/internal/strs" "google.golang.org/protobuf/reflect/protoreflect" ) // pointerCoderFuncs is a set of pointer encoding functions. type pointerCoderFuncs struct { mi *MessageInfo size func(p pointer, f *coderFieldInfo, opts marshalOptions) int marshal func(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) unmarshal func(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (unmarshalOutput, error) isInit func(p pointer, f *coderFieldInfo) error merge func(dst, src pointer, f *coderFieldInfo, opts mergeOptions) } // valueCoderFuncs is a set of protoreflect.Value encoding functions. type valueCoderFuncs struct { size func(v protoreflect.Value, tagsize int, opts marshalOptions) int marshal func(b []byte, v protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) unmarshal func(b []byte, v protoreflect.Value, num protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (protoreflect.Value, unmarshalOutput, error) isInit func(v protoreflect.Value) error merge func(dst, src protoreflect.Value, opts mergeOptions) protoreflect.Value } // fieldCoder returns pointer functions for a field, used for operating on // struct fields. func fieldCoder(fd protoreflect.FieldDescriptor, ft reflect.Type) (*MessageInfo, pointerCoderFuncs) { switch { case fd.IsMap(): return encoderFuncsForMap(fd, ft) case fd.Cardinality() == protoreflect.Repeated && !fd.IsPacked(): // Repeated fields (not packed). if ft.Kind() != reflect.Slice { break } ft := ft.Elem() switch fd.Kind() { case protoreflect.BoolKind: if ft.Kind() == reflect.Bool { return nil, coderBoolSlice } case protoreflect.EnumKind: if ft.Kind() == reflect.Int32 { return nil, coderEnumSlice } case protoreflect.Int32Kind: if ft.Kind() == reflect.Int32 { return nil, coderInt32Slice } case protoreflect.Sint32Kind: if ft.Kind() == reflect.Int32 { return nil, coderSint32Slice } case protoreflect.Uint32Kind: if ft.Kind() == reflect.Uint32 { return nil, coderUint32Slice } case protoreflect.Int64Kind: if ft.Kind() == reflect.Int64 { return nil, coderInt64Slice } case protoreflect.Sint64Kind: if ft.Kind() == reflect.Int64 { return nil, coderSint64Slice } case protoreflect.Uint64Kind: if ft.Kind() == reflect.Uint64 { return nil, coderUint64Slice } case protoreflect.Sfixed32Kind: if ft.Kind() == reflect.Int32 { return nil, coderSfixed32Slice } case protoreflect.Fixed32Kind: if ft.Kind() == reflect.Uint32 { return nil, coderFixed32Slice } case protoreflect.FloatKind: if ft.Kind() == reflect.Float32 { return nil, coderFloatSlice } case protoreflect.Sfixed64Kind: if ft.Kind() == reflect.Int64 { return nil, coderSfixed64Slice } case protoreflect.Fixed64Kind: if ft.Kind() == reflect.Uint64 { return nil, coderFixed64Slice } case protoreflect.DoubleKind: if ft.Kind() == reflect.Float64 { return nil, coderDoubleSlice } case protoreflect.StringKind: if ft.Kind() == reflect.String && strs.EnforceUTF8(fd) { return nil, coderStringSliceValidateUTF8 } if ft.Kind() == reflect.String { return nil, coderStringSlice } if ft.Kind() == reflect.Slice && ft.Elem().Kind() == reflect.Uint8 && strs.EnforceUTF8(fd) { return nil, coderBytesSliceValidateUTF8 } if ft.Kind() == reflect.Slice && ft.Elem().Kind() == reflect.Uint8 { return nil, coderBytesSlice } case protoreflect.BytesKind: if ft.Kind() == reflect.String { return nil, coderStringSlice } if ft.Kind() == reflect.Slice && ft.Elem().Kind() == reflect.Uint8 { return nil, coderBytesSlice } case protoreflect.MessageKind: return getMessageInfo(ft), makeMessageSliceFieldCoder(fd, ft) case protoreflect.GroupKind: return getMessageInfo(ft), makeGroupSliceFieldCoder(fd, ft) } case fd.Cardinality() == protoreflect.Repeated && fd.IsPacked(): // Packed repeated fields. // // Only repeated fields of primitive numeric types // (Varint, Fixed32, or Fixed64 wire type) can be packed. if ft.Kind() != reflect.Slice { break } ft := ft.Elem() switch fd.Kind() { case protoreflect.BoolKind: if ft.Kind() == reflect.Bool { return nil, coderBoolPackedSlice } case protoreflect.EnumKind: if ft.Kind() == reflect.Int32 { return nil, coderEnumPackedSlice } case protoreflect.Int32Kind: if ft.Kind() == reflect.Int32 { return nil, coderInt32PackedSlice } case protoreflect.Sint32Kind: if ft.Kind() == reflect.Int32 { return nil, coderSint32PackedSlice } case protoreflect.Uint32Kind: if ft.Kind() == reflect.Uint32 { return nil, coderUint32PackedSlice } case protoreflect.Int64Kind: if ft.Kind() == reflect.Int64 { return nil, coderInt64PackedSlice } case protoreflect.Sint64Kind: if ft.Kind() == reflect.Int64 { return nil, coderSint64PackedSlice } case protoreflect.Uint64Kind: if ft.Kind() == reflect.Uint64 { return nil, coderUint64PackedSlice } case protoreflect.Sfixed32Kind: if ft.Kind() == reflect.Int32 { return nil, coderSfixed32PackedSlice } case protoreflect.Fixed32Kind: if ft.Kind() == reflect.Uint32 { return nil, coderFixed32PackedSlice } case protoreflect.FloatKind: if ft.Kind() == reflect.Float32 { return nil, coderFloatPackedSlice } case protoreflect.Sfixed64Kind: if ft.Kind() == reflect.Int64 { return nil, coderSfixed64PackedSlice } case protoreflect.Fixed64Kind: if ft.Kind() == reflect.Uint64 { return nil, coderFixed64PackedSlice } case protoreflect.DoubleKind: if ft.Kind() == reflect.Float64 { return nil, coderDoublePackedSlice } } case fd.Kind() == protoreflect.MessageKind: return getMessageInfo(ft), makeMessageFieldCoder(fd, ft) case fd.Kind() == protoreflect.GroupKind: return getMessageInfo(ft), makeGroupFieldCoder(fd, ft) case !fd.HasPresence() && fd.ContainingOneof() == nil: // Populated oneof fields always encode even if set to the zero value, // which normally are not encoded in proto3. switch fd.Kind() { case protoreflect.BoolKind: if ft.Kind() == reflect.Bool { return nil, coderBoolNoZero } case protoreflect.EnumKind: if ft.Kind() == reflect.Int32 { return nil, coderEnumNoZero } case protoreflect.Int32Kind: if ft.Kind() == reflect.Int32 { return nil, coderInt32NoZero } case protoreflect.Sint32Kind: if ft.Kind() == reflect.Int32 { return nil, coderSint32NoZero } case protoreflect.Uint32Kind: if ft.Kind() == reflect.Uint32 { return nil, coderUint32NoZero } case protoreflect.Int64Kind: if ft.Kind() == reflect.Int64 { return nil, coderInt64NoZero } case protoreflect.Sint64Kind: if ft.Kind() == reflect.Int64 { return nil, coderSint64NoZero } case protoreflect.Uint64Kind: if ft.Kind() == reflect.Uint64 { return nil, coderUint64NoZero } case protoreflect.Sfixed32Kind: if ft.Kind() == reflect.Int32 { return nil, coderSfixed32NoZero } case protoreflect.Fixed32Kind: if ft.Kind() == reflect.Uint32 { return nil, coderFixed32NoZero } case protoreflect.FloatKind: if ft.Kind() == reflect.Float32 { return nil, coderFloatNoZero } case protoreflect.Sfixed64Kind: if ft.Kind() == reflect.Int64 { return nil, coderSfixed64NoZero } case protoreflect.Fixed64Kind: if ft.Kind() == reflect.Uint64 { return nil, coderFixed64NoZero } case protoreflect.DoubleKind: if ft.Kind() == reflect.Float64 { return nil, coderDoubleNoZero } case protoreflect.StringKind: if ft.Kind() == reflect.String && strs.EnforceUTF8(fd) { return nil, coderStringNoZeroValidateUTF8 } if ft.Kind() == reflect.String { return nil, coderStringNoZero } if ft.Kind() == reflect.Slice && ft.Elem().Kind() == reflect.Uint8 && strs.EnforceUTF8(fd) { return nil, coderBytesNoZeroValidateUTF8 } if ft.Kind() == reflect.Slice && ft.Elem().Kind() == reflect.Uint8 { return nil, coderBytesNoZero } case protoreflect.BytesKind: if ft.Kind() == reflect.String { return nil, coderStringNoZero } if ft.Kind() == reflect.Slice && ft.Elem().Kind() == reflect.Uint8 { return nil, coderBytesNoZero } } case ft.Kind() == reflect.Ptr: ft := ft.Elem() switch fd.Kind() { case protoreflect.BoolKind: if ft.Kind() == reflect.Bool { return nil, coderBoolPtr } case protoreflect.EnumKind: if ft.Kind() == reflect.Int32 { return nil, coderEnumPtr } case protoreflect.Int32Kind: if ft.Kind() == reflect.Int32 { return nil, coderInt32Ptr } case protoreflect.Sint32Kind: if ft.Kind() == reflect.Int32 { return nil, coderSint32Ptr } case protoreflect.Uint32Kind: if ft.Kind() == reflect.Uint32 { return nil, coderUint32Ptr } case protoreflect.Int64Kind: if ft.Kind() == reflect.Int64 { return nil, coderInt64Ptr } case protoreflect.Sint64Kind: if ft.Kind() == reflect.Int64 { return nil, coderSint64Ptr } case protoreflect.Uint64Kind: if ft.Kind() == reflect.Uint64 { return nil, coderUint64Ptr } case protoreflect.Sfixed32Kind: if ft.Kind() == reflect.Int32 { return nil, coderSfixed32Ptr } case protoreflect.Fixed32Kind: if ft.Kind() == reflect.Uint32 { return nil, coderFixed32Ptr } case protoreflect.FloatKind: if ft.Kind() == reflect.Float32 { return nil, coderFloatPtr } case protoreflect.Sfixed64Kind: if ft.Kind() == reflect.Int64 { return nil, coderSfixed64Ptr } case protoreflect.Fixed64Kind: if ft.Kind() == reflect.Uint64 { return nil, coderFixed64Ptr } case protoreflect.DoubleKind: if ft.Kind() == reflect.Float64 { return nil, coderDoublePtr } case protoreflect.StringKind: if ft.Kind() == reflect.String && strs.EnforceUTF8(fd) { return nil, coderStringPtrValidateUTF8 } if ft.Kind() == reflect.String { return nil, coderStringPtr } case protoreflect.BytesKind: if ft.Kind() == reflect.String { return nil, coderStringPtr } } default: switch fd.Kind() { case protoreflect.BoolKind: if ft.Kind() == reflect.Bool { return nil, coderBool } case protoreflect.EnumKind: if ft.Kind() == reflect.Int32 { return nil, coderEnum } case protoreflect.Int32Kind: if ft.Kind() == reflect.Int32 { return nil, coderInt32 } case protoreflect.Sint32Kind: if ft.Kind() == reflect.Int32 { return nil, coderSint32 } case protoreflect.Uint32Kind: if ft.Kind() == reflect.Uint32 { return nil, coderUint32 } case protoreflect.Int64Kind: if ft.Kind() == reflect.Int64 { return nil, coderInt64 } case protoreflect.Sint64Kind: if ft.Kind() == reflect.Int64 { return nil, coderSint64 } case protoreflect.Uint64Kind: if ft.Kind() == reflect.Uint64 { return nil, coderUint64 } case protoreflect.Sfixed32Kind: if ft.Kind() == reflect.Int32 { return nil, coderSfixed32 } case protoreflect.Fixed32Kind: if ft.Kind() == reflect.Uint32 { return nil, coderFixed32 } case protoreflect.FloatKind: if ft.Kind() == reflect.Float32 { return nil, coderFloat } case protoreflect.Sfixed64Kind: if ft.Kind() == reflect.Int64 { return nil, coderSfixed64 } case protoreflect.Fixed64Kind: if ft.Kind() == reflect.Uint64 { return nil, coderFixed64 } case protoreflect.DoubleKind: if ft.Kind() == reflect.Float64 { return nil, coderDouble } case protoreflect.StringKind: if ft.Kind() == reflect.String && strs.EnforceUTF8(fd) { return nil, coderStringValidateUTF8 } if ft.Kind() == reflect.String { return nil, coderString } if ft.Kind() == reflect.Slice && ft.Elem().Kind() == reflect.Uint8 && strs.EnforceUTF8(fd) { return nil, coderBytesValidateUTF8 } if ft.Kind() == reflect.Slice && ft.Elem().Kind() == reflect.Uint8 { return nil, coderBytes } case protoreflect.BytesKind: if ft.Kind() == reflect.String { return nil, coderString } if ft.Kind() == reflect.Slice && ft.Elem().Kind() == reflect.Uint8 { return nil, coderBytes } } } panic(fmt.Sprintf("invalid type: no encoder for %v %v %v/%v", fd.FullName(), fd.Cardinality(), fd.Kind(), ft)) } // encoderFuncsForValue returns value functions for a field, used for // extension values and map encoding. func encoderFuncsForValue(fd protoreflect.FieldDescriptor) valueCoderFuncs { switch { case fd.Cardinality() == protoreflect.Repeated && !fd.IsPacked(): switch fd.Kind() { case protoreflect.BoolKind: return coderBoolSliceValue case protoreflect.EnumKind: return coderEnumSliceValue case protoreflect.Int32Kind: return coderInt32SliceValue case protoreflect.Sint32Kind: return coderSint32SliceValue case protoreflect.Uint32Kind: return coderUint32SliceValue case protoreflect.Int64Kind: return coderInt64SliceValue case protoreflect.Sint64Kind: return coderSint64SliceValue case protoreflect.Uint64Kind: return coderUint64SliceValue case protoreflect.Sfixed32Kind: return coderSfixed32SliceValue case protoreflect.Fixed32Kind: return coderFixed32SliceValue case protoreflect.FloatKind: return coderFloatSliceValue case protoreflect.Sfixed64Kind: return coderSfixed64SliceValue case protoreflect.Fixed64Kind: return coderFixed64SliceValue case protoreflect.DoubleKind: return coderDoubleSliceValue case protoreflect.StringKind: // We don't have a UTF-8 validating coder for repeated string fields. // Value coders are used for extensions and maps. // Extensions are never proto3, and maps never contain lists. return coderStringSliceValue case protoreflect.BytesKind: return coderBytesSliceValue case protoreflect.MessageKind: return coderMessageSliceValue case protoreflect.GroupKind: return coderGroupSliceValue } case fd.Cardinality() == protoreflect.Repeated && fd.IsPacked(): switch fd.Kind() { case protoreflect.BoolKind: return coderBoolPackedSliceValue case protoreflect.EnumKind: return coderEnumPackedSliceValue case protoreflect.Int32Kind: return coderInt32PackedSliceValue case protoreflect.Sint32Kind: return coderSint32PackedSliceValue case protoreflect.Uint32Kind: return coderUint32PackedSliceValue case protoreflect.Int64Kind: return coderInt64PackedSliceValue case protoreflect.Sint64Kind: return coderSint64PackedSliceValue case protoreflect.Uint64Kind: return coderUint64PackedSliceValue case protoreflect.Sfixed32Kind: return coderSfixed32PackedSliceValue case protoreflect.Fixed32Kind: return coderFixed32PackedSliceValue case protoreflect.FloatKind: return coderFloatPackedSliceValue case protoreflect.Sfixed64Kind: return coderSfixed64PackedSliceValue case protoreflect.Fixed64Kind: return coderFixed64PackedSliceValue case protoreflect.DoubleKind: return coderDoublePackedSliceValue } default: switch fd.Kind() { default: case protoreflect.BoolKind: return coderBoolValue case protoreflect.EnumKind: return coderEnumValue case protoreflect.Int32Kind: return coderInt32Value case protoreflect.Sint32Kind: return coderSint32Value case protoreflect.Uint32Kind: return coderUint32Value case protoreflect.Int64Kind: return coderInt64Value case protoreflect.Sint64Kind: return coderSint64Value case protoreflect.Uint64Kind: return coderUint64Value case protoreflect.Sfixed32Kind: return coderSfixed32Value case protoreflect.Fixed32Kind: return coderFixed32Value case protoreflect.FloatKind: return coderFloatValue case protoreflect.Sfixed64Kind: return coderSfixed64Value case protoreflect.Fixed64Kind: return coderFixed64Value case protoreflect.DoubleKind: return coderDoubleValue case protoreflect.StringKind: if strs.EnforceUTF8(fd) { return coderStringValueValidateUTF8 } return coderStringValue case protoreflect.BytesKind: return coderBytesValue case protoreflect.MessageKind: return coderMessageValue case protoreflect.GroupKind: return coderGroupValue } } panic(fmt.Sprintf("invalid field: no encoder for %v %v %v", fd.FullName(), fd.Cardinality(), fd.Kind())) } ================================================ FILE: vendor/google.golang.org/protobuf/internal/impl/codec_unsafe.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package impl // When using unsafe pointers, we can just treat enum values as int32s. var ( coderEnumNoZero = coderInt32NoZero coderEnum = coderInt32 coderEnumPtr = coderInt32Ptr coderEnumSlice = coderInt32Slice coderEnumPackedSlice = coderInt32PackedSlice ) ================================================ FILE: vendor/google.golang.org/protobuf/internal/impl/convert.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package impl import ( "fmt" "reflect" "google.golang.org/protobuf/reflect/protoreflect" ) // unwrapper unwraps the value to the underlying value. // This is implemented by List and Map. type unwrapper interface { protoUnwrap() any } // A Converter coverts to/from Go reflect.Value types and protobuf protoreflect.Value types. type Converter interface { // PBValueOf converts a reflect.Value to a protoreflect.Value. PBValueOf(reflect.Value) protoreflect.Value // GoValueOf converts a protoreflect.Value to a reflect.Value. GoValueOf(protoreflect.Value) reflect.Value // IsValidPB returns whether a protoreflect.Value is compatible with this type. IsValidPB(protoreflect.Value) bool // IsValidGo returns whether a reflect.Value is compatible with this type. IsValidGo(reflect.Value) bool // New returns a new field value. // For scalars, it returns the default value of the field. // For composite types, it returns a new mutable value. New() protoreflect.Value // Zero returns a new field value. // For scalars, it returns the default value of the field. // For composite types, it returns an immutable, empty value. Zero() protoreflect.Value } // NewConverter matches a Go type with a protobuf field and returns a Converter // that converts between the two. Enums must be a named int32 kind that // implements protoreflect.Enum, and messages must be pointer to a named // struct type that implements protoreflect.ProtoMessage. // // This matcher deliberately supports a wider range of Go types than what // protoc-gen-go historically generated to be able to automatically wrap some // v1 messages generated by other forks of protoc-gen-go. func NewConverter(t reflect.Type, fd protoreflect.FieldDescriptor) Converter { switch { case fd.IsList(): return newListConverter(t, fd) case fd.IsMap(): return newMapConverter(t, fd) default: return newSingularConverter(t, fd) } } var ( boolType = reflect.TypeOf(bool(false)) int32Type = reflect.TypeOf(int32(0)) int64Type = reflect.TypeOf(int64(0)) uint32Type = reflect.TypeOf(uint32(0)) uint64Type = reflect.TypeOf(uint64(0)) float32Type = reflect.TypeOf(float32(0)) float64Type = reflect.TypeOf(float64(0)) stringType = reflect.TypeOf(string("")) bytesType = reflect.TypeOf([]byte(nil)) byteType = reflect.TypeOf(byte(0)) ) var ( boolZero = protoreflect.ValueOfBool(false) int32Zero = protoreflect.ValueOfInt32(0) int64Zero = protoreflect.ValueOfInt64(0) uint32Zero = protoreflect.ValueOfUint32(0) uint64Zero = protoreflect.ValueOfUint64(0) float32Zero = protoreflect.ValueOfFloat32(0) float64Zero = protoreflect.ValueOfFloat64(0) stringZero = protoreflect.ValueOfString("") bytesZero = protoreflect.ValueOfBytes(nil) ) func newSingularConverter(t reflect.Type, fd protoreflect.FieldDescriptor) Converter { defVal := func(fd protoreflect.FieldDescriptor, zero protoreflect.Value) protoreflect.Value { if fd.Cardinality() == protoreflect.Repeated { // Default isn't defined for repeated fields. return zero } return fd.Default() } switch fd.Kind() { case protoreflect.BoolKind: if t.Kind() == reflect.Bool { return &boolConverter{t, defVal(fd, boolZero)} } case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: if t.Kind() == reflect.Int32 { return &int32Converter{t, defVal(fd, int32Zero)} } case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: if t.Kind() == reflect.Int64 { return &int64Converter{t, defVal(fd, int64Zero)} } case protoreflect.Uint32Kind, protoreflect.Fixed32Kind: if t.Kind() == reflect.Uint32 { return &uint32Converter{t, defVal(fd, uint32Zero)} } case protoreflect.Uint64Kind, protoreflect.Fixed64Kind: if t.Kind() == reflect.Uint64 { return &uint64Converter{t, defVal(fd, uint64Zero)} } case protoreflect.FloatKind: if t.Kind() == reflect.Float32 { return &float32Converter{t, defVal(fd, float32Zero)} } case protoreflect.DoubleKind: if t.Kind() == reflect.Float64 { return &float64Converter{t, defVal(fd, float64Zero)} } case protoreflect.StringKind: if t.Kind() == reflect.String || (t.Kind() == reflect.Slice && t.Elem() == byteType) { return &stringConverter{t, defVal(fd, stringZero)} } case protoreflect.BytesKind: if t.Kind() == reflect.String || (t.Kind() == reflect.Slice && t.Elem() == byteType) { return &bytesConverter{t, defVal(fd, bytesZero)} } case protoreflect.EnumKind: // Handle enums, which must be a named int32 type. if t.Kind() == reflect.Int32 { return newEnumConverter(t, fd) } case protoreflect.MessageKind, protoreflect.GroupKind: return newMessageConverter(t) } panic(fmt.Sprintf("invalid Go type %v for field %v", t, fd.FullName())) } type boolConverter struct { goType reflect.Type def protoreflect.Value } func (c *boolConverter) PBValueOf(v reflect.Value) protoreflect.Value { if v.Type() != c.goType { panic(fmt.Sprintf("invalid type: got %v, want %v", v.Type(), c.goType)) } return protoreflect.ValueOfBool(v.Bool()) } func (c *boolConverter) GoValueOf(v protoreflect.Value) reflect.Value { return reflect.ValueOf(v.Bool()).Convert(c.goType) } func (c *boolConverter) IsValidPB(v protoreflect.Value) bool { _, ok := v.Interface().(bool) return ok } func (c *boolConverter) IsValidGo(v reflect.Value) bool { return v.IsValid() && v.Type() == c.goType } func (c *boolConverter) New() protoreflect.Value { return c.def } func (c *boolConverter) Zero() protoreflect.Value { return c.def } type int32Converter struct { goType reflect.Type def protoreflect.Value } func (c *int32Converter) PBValueOf(v reflect.Value) protoreflect.Value { if v.Type() != c.goType { panic(fmt.Sprintf("invalid type: got %v, want %v", v.Type(), c.goType)) } return protoreflect.ValueOfInt32(int32(v.Int())) } func (c *int32Converter) GoValueOf(v protoreflect.Value) reflect.Value { return reflect.ValueOf(int32(v.Int())).Convert(c.goType) } func (c *int32Converter) IsValidPB(v protoreflect.Value) bool { _, ok := v.Interface().(int32) return ok } func (c *int32Converter) IsValidGo(v reflect.Value) bool { return v.IsValid() && v.Type() == c.goType } func (c *int32Converter) New() protoreflect.Value { return c.def } func (c *int32Converter) Zero() protoreflect.Value { return c.def } type int64Converter struct { goType reflect.Type def protoreflect.Value } func (c *int64Converter) PBValueOf(v reflect.Value) protoreflect.Value { if v.Type() != c.goType { panic(fmt.Sprintf("invalid type: got %v, want %v", v.Type(), c.goType)) } return protoreflect.ValueOfInt64(int64(v.Int())) } func (c *int64Converter) GoValueOf(v protoreflect.Value) reflect.Value { return reflect.ValueOf(int64(v.Int())).Convert(c.goType) } func (c *int64Converter) IsValidPB(v protoreflect.Value) bool { _, ok := v.Interface().(int64) return ok } func (c *int64Converter) IsValidGo(v reflect.Value) bool { return v.IsValid() && v.Type() == c.goType } func (c *int64Converter) New() protoreflect.Value { return c.def } func (c *int64Converter) Zero() protoreflect.Value { return c.def } type uint32Converter struct { goType reflect.Type def protoreflect.Value } func (c *uint32Converter) PBValueOf(v reflect.Value) protoreflect.Value { if v.Type() != c.goType { panic(fmt.Sprintf("invalid type: got %v, want %v", v.Type(), c.goType)) } return protoreflect.ValueOfUint32(uint32(v.Uint())) } func (c *uint32Converter) GoValueOf(v protoreflect.Value) reflect.Value { return reflect.ValueOf(uint32(v.Uint())).Convert(c.goType) } func (c *uint32Converter) IsValidPB(v protoreflect.Value) bool { _, ok := v.Interface().(uint32) return ok } func (c *uint32Converter) IsValidGo(v reflect.Value) bool { return v.IsValid() && v.Type() == c.goType } func (c *uint32Converter) New() protoreflect.Value { return c.def } func (c *uint32Converter) Zero() protoreflect.Value { return c.def } type uint64Converter struct { goType reflect.Type def protoreflect.Value } func (c *uint64Converter) PBValueOf(v reflect.Value) protoreflect.Value { if v.Type() != c.goType { panic(fmt.Sprintf("invalid type: got %v, want %v", v.Type(), c.goType)) } return protoreflect.ValueOfUint64(uint64(v.Uint())) } func (c *uint64Converter) GoValueOf(v protoreflect.Value) reflect.Value { return reflect.ValueOf(uint64(v.Uint())).Convert(c.goType) } func (c *uint64Converter) IsValidPB(v protoreflect.Value) bool { _, ok := v.Interface().(uint64) return ok } func (c *uint64Converter) IsValidGo(v reflect.Value) bool { return v.IsValid() && v.Type() == c.goType } func (c *uint64Converter) New() protoreflect.Value { return c.def } func (c *uint64Converter) Zero() protoreflect.Value { return c.def } type float32Converter struct { goType reflect.Type def protoreflect.Value } func (c *float32Converter) PBValueOf(v reflect.Value) protoreflect.Value { if v.Type() != c.goType { panic(fmt.Sprintf("invalid type: got %v, want %v", v.Type(), c.goType)) } return protoreflect.ValueOfFloat32(float32(v.Float())) } func (c *float32Converter) GoValueOf(v protoreflect.Value) reflect.Value { return reflect.ValueOf(float32(v.Float())).Convert(c.goType) } func (c *float32Converter) IsValidPB(v protoreflect.Value) bool { _, ok := v.Interface().(float32) return ok } func (c *float32Converter) IsValidGo(v reflect.Value) bool { return v.IsValid() && v.Type() == c.goType } func (c *float32Converter) New() protoreflect.Value { return c.def } func (c *float32Converter) Zero() protoreflect.Value { return c.def } type float64Converter struct { goType reflect.Type def protoreflect.Value } func (c *float64Converter) PBValueOf(v reflect.Value) protoreflect.Value { if v.Type() != c.goType { panic(fmt.Sprintf("invalid type: got %v, want %v", v.Type(), c.goType)) } return protoreflect.ValueOfFloat64(float64(v.Float())) } func (c *float64Converter) GoValueOf(v protoreflect.Value) reflect.Value { return reflect.ValueOf(float64(v.Float())).Convert(c.goType) } func (c *float64Converter) IsValidPB(v protoreflect.Value) bool { _, ok := v.Interface().(float64) return ok } func (c *float64Converter) IsValidGo(v reflect.Value) bool { return v.IsValid() && v.Type() == c.goType } func (c *float64Converter) New() protoreflect.Value { return c.def } func (c *float64Converter) Zero() protoreflect.Value { return c.def } type stringConverter struct { goType reflect.Type def protoreflect.Value } func (c *stringConverter) PBValueOf(v reflect.Value) protoreflect.Value { if v.Type() != c.goType { panic(fmt.Sprintf("invalid type: got %v, want %v", v.Type(), c.goType)) } return protoreflect.ValueOfString(v.Convert(stringType).String()) } func (c *stringConverter) GoValueOf(v protoreflect.Value) reflect.Value { // protoreflect.Value.String never panics, so we go through an interface // conversion here to check the type. s := v.Interface().(string) if c.goType.Kind() == reflect.Slice && s == "" { return reflect.Zero(c.goType) // ensure empty string is []byte(nil) } return reflect.ValueOf(s).Convert(c.goType) } func (c *stringConverter) IsValidPB(v protoreflect.Value) bool { _, ok := v.Interface().(string) return ok } func (c *stringConverter) IsValidGo(v reflect.Value) bool { return v.IsValid() && v.Type() == c.goType } func (c *stringConverter) New() protoreflect.Value { return c.def } func (c *stringConverter) Zero() protoreflect.Value { return c.def } type bytesConverter struct { goType reflect.Type def protoreflect.Value } func (c *bytesConverter) PBValueOf(v reflect.Value) protoreflect.Value { if v.Type() != c.goType { panic(fmt.Sprintf("invalid type: got %v, want %v", v.Type(), c.goType)) } if c.goType.Kind() == reflect.String && v.Len() == 0 { return protoreflect.ValueOfBytes(nil) // ensure empty string is []byte(nil) } return protoreflect.ValueOfBytes(v.Convert(bytesType).Bytes()) } func (c *bytesConverter) GoValueOf(v protoreflect.Value) reflect.Value { return reflect.ValueOf(v.Bytes()).Convert(c.goType) } func (c *bytesConverter) IsValidPB(v protoreflect.Value) bool { _, ok := v.Interface().([]byte) return ok } func (c *bytesConverter) IsValidGo(v reflect.Value) bool { return v.IsValid() && v.Type() == c.goType } func (c *bytesConverter) New() protoreflect.Value { return c.def } func (c *bytesConverter) Zero() protoreflect.Value { return c.def } type enumConverter struct { goType reflect.Type def protoreflect.Value } func newEnumConverter(goType reflect.Type, fd protoreflect.FieldDescriptor) Converter { var def protoreflect.Value if fd.Cardinality() == protoreflect.Repeated { def = protoreflect.ValueOfEnum(fd.Enum().Values().Get(0).Number()) } else { def = fd.Default() } return &enumConverter{goType, def} } func (c *enumConverter) PBValueOf(v reflect.Value) protoreflect.Value { if v.Type() != c.goType { panic(fmt.Sprintf("invalid type: got %v, want %v", v.Type(), c.goType)) } return protoreflect.ValueOfEnum(protoreflect.EnumNumber(v.Int())) } func (c *enumConverter) GoValueOf(v protoreflect.Value) reflect.Value { return reflect.ValueOf(v.Enum()).Convert(c.goType) } func (c *enumConverter) IsValidPB(v protoreflect.Value) bool { _, ok := v.Interface().(protoreflect.EnumNumber) return ok } func (c *enumConverter) IsValidGo(v reflect.Value) bool { return v.IsValid() && v.Type() == c.goType } func (c *enumConverter) New() protoreflect.Value { return c.def } func (c *enumConverter) Zero() protoreflect.Value { return c.def } type messageConverter struct { goType reflect.Type } func newMessageConverter(goType reflect.Type) Converter { return &messageConverter{goType} } func (c *messageConverter) PBValueOf(v reflect.Value) protoreflect.Value { if v.Type() != c.goType { panic(fmt.Sprintf("invalid type: got %v, want %v", v.Type(), c.goType)) } if c.isNonPointer() { if v.CanAddr() { v = v.Addr() // T => *T } else { v = reflect.Zero(reflect.PtrTo(v.Type())) } } if m, ok := v.Interface().(protoreflect.ProtoMessage); ok { return protoreflect.ValueOfMessage(m.ProtoReflect()) } return protoreflect.ValueOfMessage(legacyWrapMessage(v)) } func (c *messageConverter) GoValueOf(v protoreflect.Value) reflect.Value { m := v.Message() var rv reflect.Value if u, ok := m.(unwrapper); ok { rv = reflect.ValueOf(u.protoUnwrap()) } else { rv = reflect.ValueOf(m.Interface()) } if c.isNonPointer() { if rv.Type() != reflect.PtrTo(c.goType) { panic(fmt.Sprintf("invalid type: got %v, want %v", rv.Type(), reflect.PtrTo(c.goType))) } if !rv.IsNil() { rv = rv.Elem() // *T => T } else { rv = reflect.Zero(rv.Type().Elem()) } } if rv.Type() != c.goType { panic(fmt.Sprintf("invalid type: got %v, want %v", rv.Type(), c.goType)) } return rv } func (c *messageConverter) IsValidPB(v protoreflect.Value) bool { m := v.Message() var rv reflect.Value if u, ok := m.(unwrapper); ok { rv = reflect.ValueOf(u.protoUnwrap()) } else { rv = reflect.ValueOf(m.Interface()) } if c.isNonPointer() { return rv.Type() == reflect.PtrTo(c.goType) } return rv.Type() == c.goType } func (c *messageConverter) IsValidGo(v reflect.Value) bool { return v.IsValid() && v.Type() == c.goType } func (c *messageConverter) New() protoreflect.Value { if c.isNonPointer() { return c.PBValueOf(reflect.New(c.goType).Elem()) } return c.PBValueOf(reflect.New(c.goType.Elem())) } func (c *messageConverter) Zero() protoreflect.Value { return c.PBValueOf(reflect.Zero(c.goType)) } // isNonPointer reports whether the type is a non-pointer type. // This never occurs for generated message types. func (c *messageConverter) isNonPointer() bool { return c.goType.Kind() != reflect.Ptr } ================================================ FILE: vendor/google.golang.org/protobuf/internal/impl/convert_list.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package impl import ( "fmt" "reflect" "google.golang.org/protobuf/reflect/protoreflect" ) func newListConverter(t reflect.Type, fd protoreflect.FieldDescriptor) Converter { switch { case t.Kind() == reflect.Ptr && t.Elem().Kind() == reflect.Slice: return &listPtrConverter{t, newSingularConverter(t.Elem().Elem(), fd)} case t.Kind() == reflect.Slice: return &listConverter{t, newSingularConverter(t.Elem(), fd)} } panic(fmt.Sprintf("invalid Go type %v for field %v", t, fd.FullName())) } type listConverter struct { goType reflect.Type // []T c Converter } func (c *listConverter) PBValueOf(v reflect.Value) protoreflect.Value { if v.Type() != c.goType { panic(fmt.Sprintf("invalid type: got %v, want %v", v.Type(), c.goType)) } pv := reflect.New(c.goType) pv.Elem().Set(v) return protoreflect.ValueOfList(&listReflect{pv, c.c}) } func (c *listConverter) GoValueOf(v protoreflect.Value) reflect.Value { rv := v.List().(*listReflect).v if rv.IsNil() { return reflect.Zero(c.goType) } return rv.Elem() } func (c *listConverter) IsValidPB(v protoreflect.Value) bool { list, ok := v.Interface().(*listReflect) if !ok { return false } return list.v.Type().Elem() == c.goType } func (c *listConverter) IsValidGo(v reflect.Value) bool { return v.IsValid() && v.Type() == c.goType } func (c *listConverter) New() protoreflect.Value { return protoreflect.ValueOfList(&listReflect{reflect.New(c.goType), c.c}) } func (c *listConverter) Zero() protoreflect.Value { return protoreflect.ValueOfList(&listReflect{reflect.Zero(reflect.PtrTo(c.goType)), c.c}) } type listPtrConverter struct { goType reflect.Type // *[]T c Converter } func (c *listPtrConverter) PBValueOf(v reflect.Value) protoreflect.Value { if v.Type() != c.goType { panic(fmt.Sprintf("invalid type: got %v, want %v", v.Type(), c.goType)) } return protoreflect.ValueOfList(&listReflect{v, c.c}) } func (c *listPtrConverter) GoValueOf(v protoreflect.Value) reflect.Value { return v.List().(*listReflect).v } func (c *listPtrConverter) IsValidPB(v protoreflect.Value) bool { list, ok := v.Interface().(*listReflect) if !ok { return false } return list.v.Type() == c.goType } func (c *listPtrConverter) IsValidGo(v reflect.Value) bool { return v.IsValid() && v.Type() == c.goType } func (c *listPtrConverter) New() protoreflect.Value { return c.PBValueOf(reflect.New(c.goType.Elem())) } func (c *listPtrConverter) Zero() protoreflect.Value { return c.PBValueOf(reflect.Zero(c.goType)) } type listReflect struct { v reflect.Value // *[]T conv Converter } func (ls *listReflect) Len() int { if ls.v.IsNil() { return 0 } return ls.v.Elem().Len() } func (ls *listReflect) Get(i int) protoreflect.Value { return ls.conv.PBValueOf(ls.v.Elem().Index(i)) } func (ls *listReflect) Set(i int, v protoreflect.Value) { ls.v.Elem().Index(i).Set(ls.conv.GoValueOf(v)) } func (ls *listReflect) Append(v protoreflect.Value) { ls.v.Elem().Set(reflect.Append(ls.v.Elem(), ls.conv.GoValueOf(v))) } func (ls *listReflect) AppendMutable() protoreflect.Value { if _, ok := ls.conv.(*messageConverter); !ok { panic("invalid AppendMutable on list with non-message type") } v := ls.NewElement() ls.Append(v) return v } func (ls *listReflect) Truncate(i int) { ls.v.Elem().Set(ls.v.Elem().Slice(0, i)) } func (ls *listReflect) NewElement() protoreflect.Value { return ls.conv.New() } func (ls *listReflect) IsValid() bool { return !ls.v.IsNil() } func (ls *listReflect) protoUnwrap() any { return ls.v.Interface() } ================================================ FILE: vendor/google.golang.org/protobuf/internal/impl/convert_map.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package impl import ( "fmt" "reflect" "google.golang.org/protobuf/reflect/protoreflect" ) type mapConverter struct { goType reflect.Type // map[K]V keyConv, valConv Converter } func newMapConverter(t reflect.Type, fd protoreflect.FieldDescriptor) *mapConverter { if t.Kind() != reflect.Map { panic(fmt.Sprintf("invalid Go type %v for field %v", t, fd.FullName())) } return &mapConverter{ goType: t, keyConv: newSingularConverter(t.Key(), fd.MapKey()), valConv: newSingularConverter(t.Elem(), fd.MapValue()), } } func (c *mapConverter) PBValueOf(v reflect.Value) protoreflect.Value { if v.Type() != c.goType { panic(fmt.Sprintf("invalid type: got %v, want %v", v.Type(), c.goType)) } return protoreflect.ValueOfMap(&mapReflect{v, c.keyConv, c.valConv}) } func (c *mapConverter) GoValueOf(v protoreflect.Value) reflect.Value { return v.Map().(*mapReflect).v } func (c *mapConverter) IsValidPB(v protoreflect.Value) bool { mapv, ok := v.Interface().(*mapReflect) if !ok { return false } return mapv.v.Type() == c.goType } func (c *mapConverter) IsValidGo(v reflect.Value) bool { return v.IsValid() && v.Type() == c.goType } func (c *mapConverter) New() protoreflect.Value { return c.PBValueOf(reflect.MakeMap(c.goType)) } func (c *mapConverter) Zero() protoreflect.Value { return c.PBValueOf(reflect.Zero(c.goType)) } type mapReflect struct { v reflect.Value // map[K]V keyConv Converter valConv Converter } func (ms *mapReflect) Len() int { return ms.v.Len() } func (ms *mapReflect) Has(k protoreflect.MapKey) bool { rk := ms.keyConv.GoValueOf(k.Value()) rv := ms.v.MapIndex(rk) return rv.IsValid() } func (ms *mapReflect) Get(k protoreflect.MapKey) protoreflect.Value { rk := ms.keyConv.GoValueOf(k.Value()) rv := ms.v.MapIndex(rk) if !rv.IsValid() { return protoreflect.Value{} } return ms.valConv.PBValueOf(rv) } func (ms *mapReflect) Set(k protoreflect.MapKey, v protoreflect.Value) { rk := ms.keyConv.GoValueOf(k.Value()) rv := ms.valConv.GoValueOf(v) ms.v.SetMapIndex(rk, rv) } func (ms *mapReflect) Clear(k protoreflect.MapKey) { rk := ms.keyConv.GoValueOf(k.Value()) ms.v.SetMapIndex(rk, reflect.Value{}) } func (ms *mapReflect) Mutable(k protoreflect.MapKey) protoreflect.Value { if _, ok := ms.valConv.(*messageConverter); !ok { panic("invalid Mutable on map with non-message value type") } v := ms.Get(k) if !v.IsValid() { v = ms.NewValue() ms.Set(k, v) } return v } func (ms *mapReflect) Range(f func(protoreflect.MapKey, protoreflect.Value) bool) { iter := ms.v.MapRange() for iter.Next() { k := ms.keyConv.PBValueOf(iter.Key()).MapKey() v := ms.valConv.PBValueOf(iter.Value()) if !f(k, v) { return } } } func (ms *mapReflect) NewValue() protoreflect.Value { return ms.valConv.New() } func (ms *mapReflect) IsValid() bool { return !ms.v.IsNil() } func (ms *mapReflect) protoUnwrap() any { return ms.v.Interface() } ================================================ FILE: vendor/google.golang.org/protobuf/internal/impl/decode.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package impl import ( "math/bits" "google.golang.org/protobuf/encoding/protowire" "google.golang.org/protobuf/internal/errors" "google.golang.org/protobuf/internal/flags" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/reflect/protoregistry" "google.golang.org/protobuf/runtime/protoiface" ) var errDecode = errors.New("cannot parse invalid wire-format data") var errRecursionDepth = errors.New("exceeded maximum recursion depth") type unmarshalOptions struct { flags protoiface.UnmarshalInputFlags resolver interface { FindExtensionByName(field protoreflect.FullName) (protoreflect.ExtensionType, error) FindExtensionByNumber(message protoreflect.FullName, field protoreflect.FieldNumber) (protoreflect.ExtensionType, error) } depth int } func (o unmarshalOptions) Options() proto.UnmarshalOptions { return proto.UnmarshalOptions{ Merge: true, AllowPartial: true, DiscardUnknown: o.DiscardUnknown(), Resolver: o.resolver, NoLazyDecoding: o.NoLazyDecoding(), } } func (o unmarshalOptions) DiscardUnknown() bool { return o.flags&protoiface.UnmarshalDiscardUnknown != 0 } func (o unmarshalOptions) AliasBuffer() bool { return o.flags&protoiface.UnmarshalAliasBuffer != 0 } func (o unmarshalOptions) Validated() bool { return o.flags&protoiface.UnmarshalValidated != 0 } func (o unmarshalOptions) NoLazyDecoding() bool { return o.flags&protoiface.UnmarshalNoLazyDecoding != 0 } func (o unmarshalOptions) CanBeLazy() bool { if o.resolver != protoregistry.GlobalTypes { return false } // We ignore the UnmarshalInvalidateSizeCache even though it's not in the default set return (o.flags & ^(protoiface.UnmarshalAliasBuffer | protoiface.UnmarshalValidated | protoiface.UnmarshalCheckRequired)) == 0 } var lazyUnmarshalOptions = unmarshalOptions{ resolver: protoregistry.GlobalTypes, flags: protoiface.UnmarshalAliasBuffer | protoiface.UnmarshalValidated, depth: protowire.DefaultRecursionLimit, } type unmarshalOutput struct { n int // number of bytes consumed initialized bool } // unmarshal is protoreflect.Methods.Unmarshal. func (mi *MessageInfo) unmarshal(in protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { var p pointer if ms, ok := in.Message.(*messageState); ok { p = ms.pointer() } else { p = in.Message.(*messageReflectWrapper).pointer() } out, err := mi.unmarshalPointer(in.Buf, p, 0, unmarshalOptions{ flags: in.Flags, resolver: in.Resolver, depth: in.Depth, }) var flags protoiface.UnmarshalOutputFlags if out.initialized { flags |= protoiface.UnmarshalInitialized } return protoiface.UnmarshalOutput{ Flags: flags, }, err } // errUnknown is returned during unmarshaling to indicate a parse error that // should result in a field being placed in the unknown fields section (for example, // when the wire type doesn't match) as opposed to the entire unmarshal operation // failing (for example, when a field extends past the available input). // // This is a sentinel error which should never be visible to the user. var errUnknown = errors.New("unknown") func (mi *MessageInfo) unmarshalPointer(b []byte, p pointer, groupTag protowire.Number, opts unmarshalOptions) (out unmarshalOutput, err error) { mi.init() if opts.depth--; opts.depth < 0 { return out, errRecursionDepth } if flags.ProtoLegacy && mi.isMessageSet { return unmarshalMessageSet(mi, b, p, opts) } lazyDecoding := LazyEnabled() // default if opts.NoLazyDecoding() { lazyDecoding = false // explicitly disabled } if mi.lazyOffset.IsValid() && lazyDecoding { return mi.unmarshalPointerLazy(b, p, groupTag, opts) } return mi.unmarshalPointerEager(b, p, groupTag, opts) } // unmarshalPointerEager is the message unmarshalling function for all messages that are not lazy. // The corresponding function for Lazy is in google_lazy.go. func (mi *MessageInfo) unmarshalPointerEager(b []byte, p pointer, groupTag protowire.Number, opts unmarshalOptions) (out unmarshalOutput, err error) { initialized := true var requiredMask uint64 var exts *map[int32]ExtensionField var presence presence if mi.presenceOffset.IsValid() { presence = p.Apply(mi.presenceOffset).PresenceInfo() } start := len(b) for len(b) > 0 { // Parse the tag (field number and wire type). var tag uint64 if b[0] < 0x80 { tag = uint64(b[0]) b = b[1:] } else if len(b) >= 2 && b[1] < 128 { tag = uint64(b[0]&0x7f) + uint64(b[1])<<7 b = b[2:] } else { var n int tag, n = protowire.ConsumeVarint(b) if n < 0 { return out, errDecode } b = b[n:] } var num protowire.Number if n := tag >> 3; n < uint64(protowire.MinValidNumber) || n > uint64(protowire.MaxValidNumber) { return out, errDecode } else { num = protowire.Number(n) } wtyp := protowire.Type(tag & 7) if wtyp == protowire.EndGroupType { if num != groupTag { return out, errDecode } groupTag = 0 break } var f *coderFieldInfo if int(num) < len(mi.denseCoderFields) { f = mi.denseCoderFields[num] } else { f = mi.coderFields[num] } var n int err := errUnknown switch { case f != nil: if f.funcs.unmarshal == nil { break } var o unmarshalOutput o, err = f.funcs.unmarshal(b, p.Apply(f.offset), wtyp, f, opts) n = o.n if err != nil { break } requiredMask |= f.validation.requiredBit if f.funcs.isInit != nil && !o.initialized { initialized = false } if f.presenceIndex != noPresence { presence.SetPresentUnatomic(f.presenceIndex, mi.presenceSize) } default: // Possible extension. if exts == nil && mi.extensionOffset.IsValid() { exts = p.Apply(mi.extensionOffset).Extensions() if *exts == nil { *exts = make(map[int32]ExtensionField) } } if exts == nil { break } var o unmarshalOutput o, err = mi.unmarshalExtension(b, num, wtyp, *exts, opts) if err != nil { break } n = o.n if !o.initialized { initialized = false } } if err != nil { if err != errUnknown { return out, err } n = protowire.ConsumeFieldValue(num, wtyp, b) if n < 0 { return out, errDecode } if !opts.DiscardUnknown() && mi.unknownOffset.IsValid() { u := mi.mutableUnknownBytes(p) *u = protowire.AppendTag(*u, num, wtyp) *u = append(*u, b[:n]...) } } b = b[n:] } if groupTag != 0 { return out, errDecode } if mi.numRequiredFields > 0 && bits.OnesCount64(requiredMask) != int(mi.numRequiredFields) { initialized = false } if initialized { out.initialized = true } out.n = start - len(b) return out, nil } func (mi *MessageInfo) unmarshalExtension(b []byte, num protowire.Number, wtyp protowire.Type, exts map[int32]ExtensionField, opts unmarshalOptions) (out unmarshalOutput, err error) { x := exts[int32(num)] xt := x.Type() if xt == nil { var err error xt, err = opts.resolver.FindExtensionByNumber(mi.Desc.FullName(), num) if err != nil { if err == protoregistry.NotFound { return out, errUnknown } return out, errors.New("%v: unable to resolve extension %v: %v", mi.Desc.FullName(), num, err) } } xi := getExtensionFieldInfo(xt) if xi.funcs.unmarshal == nil { return out, errUnknown } if flags.LazyUnmarshalExtensions { if opts.CanBeLazy() && x.canLazy(xt) { out, valid := skipExtension(b, xi, num, wtyp, opts) switch valid { case ValidationValid: if out.initialized { x.appendLazyBytes(xt, xi, num, wtyp, b[:out.n]) exts[int32(num)] = x return out, nil } case ValidationInvalid: return out, errDecode case ValidationUnknown: } } } ival := x.Value() if !ival.IsValid() && xi.unmarshalNeedsValue { // Create a new message, list, or map value to fill in. // For enums, create a prototype value to let the unmarshal func know the // concrete type. ival = xt.New() } v, out, err := xi.funcs.unmarshal(b, ival, num, wtyp, opts) if err != nil { return out, err } if xi.funcs.isInit == nil { out.initialized = true } x.Set(xt, v) exts[int32(num)] = x return out, nil } func skipExtension(b []byte, xi *extensionFieldInfo, num protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (out unmarshalOutput, _ ValidationStatus) { if xi.validation.mi == nil { return out, ValidationUnknown } xi.validation.mi.init() switch xi.validation.typ { case validationTypeMessage: if wtyp != protowire.BytesType { return out, ValidationUnknown } v, n := protowire.ConsumeBytes(b) if n < 0 { return out, ValidationUnknown } if opts.Validated() { out.initialized = true out.n = n return out, ValidationValid } out, st := xi.validation.mi.validate(v, 0, opts) out.n = n return out, st case validationTypeGroup: if wtyp != protowire.StartGroupType { return out, ValidationUnknown } out, st := xi.validation.mi.validate(b, num, opts) return out, st default: return out, ValidationUnknown } } ================================================ FILE: vendor/google.golang.org/protobuf/internal/impl/encode.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package impl import ( "math" "sort" "sync/atomic" "google.golang.org/protobuf/internal/flags" "google.golang.org/protobuf/internal/protolazy" "google.golang.org/protobuf/proto" piface "google.golang.org/protobuf/runtime/protoiface" ) type marshalOptions struct { flags piface.MarshalInputFlags } func (o marshalOptions) Options() proto.MarshalOptions { return proto.MarshalOptions{ AllowPartial: true, Deterministic: o.Deterministic(), UseCachedSize: o.UseCachedSize(), } } func (o marshalOptions) Deterministic() bool { return o.flags&piface.MarshalDeterministic != 0 } func (o marshalOptions) UseCachedSize() bool { return o.flags&piface.MarshalUseCachedSize != 0 } // size is protoreflect.Methods.Size. func (mi *MessageInfo) size(in piface.SizeInput) piface.SizeOutput { var p pointer if ms, ok := in.Message.(*messageState); ok { p = ms.pointer() } else { p = in.Message.(*messageReflectWrapper).pointer() } size := mi.sizePointer(p, marshalOptions{ flags: in.Flags, }) return piface.SizeOutput{Size: size} } func (mi *MessageInfo) sizePointer(p pointer, opts marshalOptions) (size int) { mi.init() if p.IsNil() { return 0 } if opts.UseCachedSize() && mi.sizecacheOffset.IsValid() { // The size cache contains the size + 1, to allow the // zero value to be invalid, while also allowing for a // 0 size to be cached. if size := atomic.LoadInt32(p.Apply(mi.sizecacheOffset).Int32()); size > 0 { return int(size - 1) } } return mi.sizePointerSlow(p, opts) } func (mi *MessageInfo) sizePointerSlow(p pointer, opts marshalOptions) (size int) { if flags.ProtoLegacy && mi.isMessageSet { size = sizeMessageSet(mi, p, opts) if mi.sizecacheOffset.IsValid() { atomic.StoreInt32(p.Apply(mi.sizecacheOffset).Int32(), int32(size+1)) } return size } if mi.extensionOffset.IsValid() { e := p.Apply(mi.extensionOffset).Extensions() size += mi.sizeExtensions(e, opts) } var lazy **protolazy.XXX_lazyUnmarshalInfo var presence presence if mi.presenceOffset.IsValid() { presence = p.Apply(mi.presenceOffset).PresenceInfo() if mi.lazyOffset.IsValid() { lazy = p.Apply(mi.lazyOffset).LazyInfoPtr() } } for _, f := range mi.orderedCoderFields { if f.funcs.size == nil { continue } fptr := p.Apply(f.offset) if f.presenceIndex != noPresence { if !presence.Present(f.presenceIndex) { continue } if f.isLazy && fptr.AtomicGetPointer().IsNil() { if lazyFields(opts) { size += (*lazy).SizeField(uint32(f.num)) continue } else { mi.lazyUnmarshal(p, f.num) } } size += f.funcs.size(fptr, f, opts) continue } if f.isPointer && fptr.Elem().IsNil() { continue } size += f.funcs.size(fptr, f, opts) } if mi.unknownOffset.IsValid() { if u := mi.getUnknownBytes(p); u != nil { size += len(*u) } } if mi.sizecacheOffset.IsValid() { if size > (math.MaxInt32 - 1) { // The size is too large for the int32 sizecache field. // We will need to recompute the size when encoding; // unfortunately expensive, but better than invalid output. atomic.StoreInt32(p.Apply(mi.sizecacheOffset).Int32(), 0) } else { // The size cache contains the size + 1, to allow the // zero value to be invalid, while also allowing for a // 0 size to be cached. atomic.StoreInt32(p.Apply(mi.sizecacheOffset).Int32(), int32(size+1)) } } return size } // marshal is protoreflect.Methods.Marshal. func (mi *MessageInfo) marshal(in piface.MarshalInput) (out piface.MarshalOutput, err error) { var p pointer if ms, ok := in.Message.(*messageState); ok { p = ms.pointer() } else { p = in.Message.(*messageReflectWrapper).pointer() } b, err := mi.marshalAppendPointer(in.Buf, p, marshalOptions{ flags: in.Flags, }) return piface.MarshalOutput{Buf: b}, err } func (mi *MessageInfo) marshalAppendPointer(b []byte, p pointer, opts marshalOptions) ([]byte, error) { mi.init() if p.IsNil() { return b, nil } if flags.ProtoLegacy && mi.isMessageSet { return marshalMessageSet(mi, b, p, opts) } var err error // The old marshaler encodes extensions at beginning. if mi.extensionOffset.IsValid() { e := p.Apply(mi.extensionOffset).Extensions() // TODO: Special handling for MessageSet? b, err = mi.appendExtensions(b, e, opts) if err != nil { return b, err } } var lazy **protolazy.XXX_lazyUnmarshalInfo var presence presence if mi.presenceOffset.IsValid() { presence = p.Apply(mi.presenceOffset).PresenceInfo() if mi.lazyOffset.IsValid() { lazy = p.Apply(mi.lazyOffset).LazyInfoPtr() } } for _, f := range mi.orderedCoderFields { if f.funcs.marshal == nil { continue } fptr := p.Apply(f.offset) if f.presenceIndex != noPresence { if !presence.Present(f.presenceIndex) { continue } if f.isLazy { // Be careful, this field needs to be read atomically, like for a get if f.isPointer && fptr.AtomicGetPointer().IsNil() { if lazyFields(opts) { b, _ = (*lazy).AppendField(b, uint32(f.num)) continue } else { mi.lazyUnmarshal(p, f.num) } } b, err = f.funcs.marshal(b, fptr, f, opts) if err != nil { return b, err } continue } else if f.isPointer && fptr.Elem().IsNil() { continue } b, err = f.funcs.marshal(b, fptr, f, opts) if err != nil { return b, err } continue } if f.isPointer && fptr.Elem().IsNil() { continue } b, err = f.funcs.marshal(b, fptr, f, opts) if err != nil { return b, err } } if mi.unknownOffset.IsValid() && !mi.isMessageSet { if u := mi.getUnknownBytes(p); u != nil { b = append(b, (*u)...) } } return b, nil } // fullyLazyExtensions returns true if we should attempt to keep extensions lazy over size and marshal. func fullyLazyExtensions(opts marshalOptions) bool { // When deterministic marshaling is requested, force an unmarshal for lazy // extensions to produce a deterministic result, instead of passing through // bytes lazily that may or may not match what Go Protobuf would produce. return opts.flags&piface.MarshalDeterministic == 0 } // lazyFields returns true if we should attempt to keep fields lazy over size and marshal. func lazyFields(opts marshalOptions) bool { // When deterministic marshaling is requested, force an unmarshal for lazy // fields to produce a deterministic result, instead of passing through // bytes lazily that may or may not match what Go Protobuf would produce. return opts.flags&piface.MarshalDeterministic == 0 } func (mi *MessageInfo) sizeExtensions(ext *map[int32]ExtensionField, opts marshalOptions) (n int) { if ext == nil { return 0 } for _, x := range *ext { xi := getExtensionFieldInfo(x.Type()) if xi.funcs.size == nil { continue } if fullyLazyExtensions(opts) { // Don't expand the extension, instead use the buffer to calculate size if lb := x.lazyBuffer(); lb != nil { // We got hold of the buffer, so it's still lazy. n += len(lb) continue } } n += xi.funcs.size(x.Value(), xi.tagsize, opts) } return n } func (mi *MessageInfo) appendExtensions(b []byte, ext *map[int32]ExtensionField, opts marshalOptions) ([]byte, error) { if ext == nil { return b, nil } switch len(*ext) { case 0: return b, nil case 1: // Fast-path for one extension: Don't bother sorting the keys. var err error for _, x := range *ext { xi := getExtensionFieldInfo(x.Type()) if fullyLazyExtensions(opts) { // Don't expand the extension if it's still in wire format, instead use the buffer content. if lb := x.lazyBuffer(); lb != nil { b = append(b, lb...) continue } } b, err = xi.funcs.marshal(b, x.Value(), xi.wiretag, opts) } return b, err default: // Sort the keys to provide a deterministic encoding. // Not sure this is required, but the old code does it. keys := make([]int, 0, len(*ext)) for k := range *ext { keys = append(keys, int(k)) } sort.Ints(keys) var err error for _, k := range keys { x := (*ext)[int32(k)] xi := getExtensionFieldInfo(x.Type()) if fullyLazyExtensions(opts) { // Don't expand the extension if it's still in wire format, instead use the buffer content. if lb := x.lazyBuffer(); lb != nil { b = append(b, lb...) continue } } b, err = xi.funcs.marshal(b, x.Value(), xi.wiretag, opts) if err != nil { return b, err } } return b, nil } } ================================================ FILE: vendor/google.golang.org/protobuf/internal/impl/enum.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package impl import ( "reflect" "google.golang.org/protobuf/reflect/protoreflect" ) type EnumInfo struct { GoReflectType reflect.Type // int32 kind Desc protoreflect.EnumDescriptor } func (t *EnumInfo) New(n protoreflect.EnumNumber) protoreflect.Enum { return reflect.ValueOf(n).Convert(t.GoReflectType).Interface().(protoreflect.Enum) } func (t *EnumInfo) Descriptor() protoreflect.EnumDescriptor { return t.Desc } ================================================ FILE: vendor/google.golang.org/protobuf/internal/impl/equal.go ================================================ // Copyright 2024 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package impl import ( "bytes" "google.golang.org/protobuf/encoding/protowire" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/runtime/protoiface" ) func equal(in protoiface.EqualInput) protoiface.EqualOutput { return protoiface.EqualOutput{Equal: equalMessage(in.MessageA, in.MessageB)} } // equalMessage is a fast-path variant of protoreflect.equalMessage. // It takes advantage of the internal messageState type to avoid // unnecessary allocations, type assertions. func equalMessage(mx, my protoreflect.Message) bool { if mx == nil || my == nil { return mx == my } if mx.Descriptor() != my.Descriptor() { return false } msx, ok := mx.(*messageState) if !ok { return protoreflect.ValueOfMessage(mx).Equal(protoreflect.ValueOfMessage(my)) } msy, ok := my.(*messageState) if !ok { return protoreflect.ValueOfMessage(mx).Equal(protoreflect.ValueOfMessage(my)) } mi := msx.messageInfo() miy := msy.messageInfo() if mi != miy { return protoreflect.ValueOfMessage(mx).Equal(protoreflect.ValueOfMessage(my)) } mi.init() // Compares regular fields // Modified Message.Range code that compares two messages of the same type // while going over the fields. for _, ri := range mi.rangeInfos { var fd protoreflect.FieldDescriptor var vx, vy protoreflect.Value switch ri := ri.(type) { case *fieldInfo: hx := ri.has(msx.pointer()) hy := ri.has(msy.pointer()) if hx != hy { return false } if !hx { continue } fd = ri.fieldDesc vx = ri.get(msx.pointer()) vy = ri.get(msy.pointer()) case *oneofInfo: fnx := ri.which(msx.pointer()) fny := ri.which(msy.pointer()) if fnx != fny { return false } if fnx <= 0 { continue } fi := mi.fields[fnx] fd = fi.fieldDesc vx = fi.get(msx.pointer()) vy = fi.get(msy.pointer()) } if !equalValue(fd, vx, vy) { return false } } // Compare extensions. // This is more complicated because mx or my could have empty/nil extension maps, // however some populated extension map values are equal to nil extension maps. emx := mi.extensionMap(msx.pointer()) emy := mi.extensionMap(msy.pointer()) if emx != nil { for k, x := range *emx { xd := x.Type().TypeDescriptor() xv := x.Value() var y ExtensionField ok := false if emy != nil { y, ok = (*emy)[k] } // We need to treat empty lists as equal to nil values if emy == nil || !ok { if xd.IsList() && xv.List().Len() == 0 { continue } return false } if !equalValue(xd, xv, y.Value()) { return false } } } if emy != nil { // emy may have extensions emx does not have, need to check them as well for k, y := range *emy { if emx != nil { // emx has the field, so we already checked it if _, ok := (*emx)[k]; ok { continue } } // Empty lists are equal to nil if y.Type().TypeDescriptor().IsList() && y.Value().List().Len() == 0 { continue } // Cant be equal if the extension is populated return false } } return equalUnknown(mx.GetUnknown(), my.GetUnknown()) } func equalValue(fd protoreflect.FieldDescriptor, vx, vy protoreflect.Value) bool { // slow path if fd.Kind() != protoreflect.MessageKind { return vx.Equal(vy) } // fast path special cases if fd.IsMap() { if fd.MapValue().Kind() == protoreflect.MessageKind { return equalMessageMap(vx.Map(), vy.Map()) } return vx.Equal(vy) } if fd.IsList() { return equalMessageList(vx.List(), vy.List()) } return equalMessage(vx.Message(), vy.Message()) } // Mostly copied from protoreflect.equalMap. // This variant only works for messages as map types. // All other map types should be handled via Value.Equal. func equalMessageMap(mx, my protoreflect.Map) bool { if mx.Len() != my.Len() { return false } equal := true mx.Range(func(k protoreflect.MapKey, vx protoreflect.Value) bool { if !my.Has(k) { equal = false return false } vy := my.Get(k) equal = equalMessage(vx.Message(), vy.Message()) return equal }) return equal } // Mostly copied from protoreflect.equalList. // The only change is the usage of equalImpl instead of protoreflect.equalValue. func equalMessageList(lx, ly protoreflect.List) bool { if lx.Len() != ly.Len() { return false } for i := 0; i < lx.Len(); i++ { // We only operate on messages here since equalImpl will not call us in any other case. if !equalMessage(lx.Get(i).Message(), ly.Get(i).Message()) { return false } } return true } // equalUnknown compares unknown fields by direct comparison on the raw bytes // of each individual field number. // Copied from protoreflect.equalUnknown. func equalUnknown(x, y protoreflect.RawFields) bool { if len(x) != len(y) { return false } if bytes.Equal([]byte(x), []byte(y)) { return true } mx := make(map[protoreflect.FieldNumber]protoreflect.RawFields) my := make(map[protoreflect.FieldNumber]protoreflect.RawFields) for len(x) > 0 { fnum, _, n := protowire.ConsumeField(x) mx[fnum] = append(mx[fnum], x[:n]...) x = x[n:] } for len(y) > 0 { fnum, _, n := protowire.ConsumeField(y) my[fnum] = append(my[fnum], y[:n]...) y = y[n:] } if len(mx) != len(my) { return false } for k, v1 := range mx { if v2, ok := my[k]; !ok || !bytes.Equal([]byte(v1), []byte(v2)) { return false } } return true } ================================================ FILE: vendor/google.golang.org/protobuf/internal/impl/extension.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package impl import ( "reflect" "sync" "sync/atomic" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/runtime/protoiface" ) // ExtensionInfo implements ExtensionType. // // This type contains a number of exported fields for legacy compatibility. // The only non-deprecated use of this type is through the methods of the // ExtensionType interface. type ExtensionInfo struct { // An ExtensionInfo may exist in several stages of initialization. // // extensionInfoUninitialized: Some or all of the legacy exported // fields may be set, but none of the unexported fields have been // initialized. This is the starting state for an ExtensionInfo // in legacy generated code. // // extensionInfoDescInit: The desc field is set, but other unexported fields // may not be initialized. Legacy exported fields may or may not be set. // This is the starting state for an ExtensionInfo in newly generated code. // // extensionInfoFullInit: The ExtensionInfo is fully initialized. // This state is only entered after lazy initialization is complete. init uint32 mu sync.Mutex goType reflect.Type desc extensionTypeDescriptor conv Converter info *extensionFieldInfo // for fast-path method implementations // ExtendedType is a typed nil-pointer to the parent message type that // is being extended. It is possible for this to be unpopulated in v2 // since the message may no longer implement the MessageV1 interface. // // Deprecated: Use the ExtendedType method instead. ExtendedType protoiface.MessageV1 // ExtensionType is the zero value of the extension type. // // For historical reasons, reflect.TypeOf(ExtensionType) and the // type returned by InterfaceOf may not be identical. // // Deprecated: Use InterfaceOf(xt.Zero()) instead. ExtensionType any // Field is the field number of the extension. // // Deprecated: Use the Descriptor().Number method instead. Field int32 // Name is the fully qualified name of extension. // // Deprecated: Use the Descriptor().FullName method instead. Name string // Tag is the protobuf struct tag used in the v1 API. // // Deprecated: Do not use. Tag string // Filename is the proto filename in which the extension is defined. // // Deprecated: Use Descriptor().ParentFile().Path() instead. Filename string } // Stages of initialization: See the ExtensionInfo.init field. const ( extensionInfoUninitialized = 0 extensionInfoDescInit = 1 extensionInfoFullInit = 2 ) func InitExtensionInfo(xi *ExtensionInfo, xd protoreflect.ExtensionDescriptor, goType reflect.Type) { xi.goType = goType xi.desc = extensionTypeDescriptor{xd, xi} xi.init = extensionInfoDescInit } func (xi *ExtensionInfo) New() protoreflect.Value { return xi.lazyInit().New() } func (xi *ExtensionInfo) Zero() protoreflect.Value { return xi.lazyInit().Zero() } func (xi *ExtensionInfo) ValueOf(v any) protoreflect.Value { return xi.lazyInit().PBValueOf(reflect.ValueOf(v)) } func (xi *ExtensionInfo) InterfaceOf(v protoreflect.Value) any { return xi.lazyInit().GoValueOf(v).Interface() } func (xi *ExtensionInfo) IsValidValue(v protoreflect.Value) bool { return xi.lazyInit().IsValidPB(v) } func (xi *ExtensionInfo) IsValidInterface(v any) bool { return xi.lazyInit().IsValidGo(reflect.ValueOf(v)) } func (xi *ExtensionInfo) TypeDescriptor() protoreflect.ExtensionTypeDescriptor { if atomic.LoadUint32(&xi.init) < extensionInfoDescInit { xi.lazyInitSlow() } return &xi.desc } func (xi *ExtensionInfo) lazyInit() Converter { if atomic.LoadUint32(&xi.init) < extensionInfoFullInit { xi.lazyInitSlow() } return xi.conv } func (xi *ExtensionInfo) lazyInitSlow() { xi.mu.Lock() defer xi.mu.Unlock() if xi.init == extensionInfoFullInit { return } defer atomic.StoreUint32(&xi.init, extensionInfoFullInit) if xi.desc.ExtensionDescriptor == nil { xi.initFromLegacy() } if !xi.desc.ExtensionDescriptor.IsPlaceholder() { if xi.ExtensionType == nil { xi.initToLegacy() } xi.conv = NewConverter(xi.goType, xi.desc.ExtensionDescriptor) xi.info = makeExtensionFieldInfo(xi.desc.ExtensionDescriptor) xi.info.validation = newValidationInfo(xi.desc.ExtensionDescriptor, xi.goType) } } type extensionTypeDescriptor struct { protoreflect.ExtensionDescriptor xi *ExtensionInfo } func (xtd *extensionTypeDescriptor) Type() protoreflect.ExtensionType { return xtd.xi } func (xtd *extensionTypeDescriptor) Descriptor() protoreflect.ExtensionDescriptor { return xtd.ExtensionDescriptor } ================================================ FILE: vendor/google.golang.org/protobuf/internal/impl/lazy.go ================================================ // Copyright 2024 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package impl import ( "fmt" "math/bits" "os" "reflect" "sort" "sync/atomic" "google.golang.org/protobuf/encoding/protowire" "google.golang.org/protobuf/internal/errors" "google.golang.org/protobuf/internal/protolazy" "google.golang.org/protobuf/reflect/protoreflect" preg "google.golang.org/protobuf/reflect/protoregistry" piface "google.golang.org/protobuf/runtime/protoiface" ) var enableLazy int32 = func() int32 { if os.Getenv("GOPROTODEBUG") == "nolazy" { return 0 } return 1 }() // EnableLazyUnmarshal enables lazy unmarshaling. func EnableLazyUnmarshal(enable bool) { if enable { atomic.StoreInt32(&enableLazy, 1) return } atomic.StoreInt32(&enableLazy, 0) } // LazyEnabled reports whether lazy unmarshalling is currently enabled. func LazyEnabled() bool { return atomic.LoadInt32(&enableLazy) != 0 } // UnmarshalField unmarshals a field in a message. func UnmarshalField(m interface{}, num protowire.Number) { switch m := m.(type) { case *messageState: m.messageInfo().lazyUnmarshal(m.pointer(), num) case *messageReflectWrapper: m.messageInfo().lazyUnmarshal(m.pointer(), num) default: panic(fmt.Sprintf("unsupported wrapper type %T", m)) } } func (mi *MessageInfo) lazyUnmarshal(p pointer, num protoreflect.FieldNumber) { var f *coderFieldInfo if int(num) < len(mi.denseCoderFields) { f = mi.denseCoderFields[num] } else { f = mi.coderFields[num] } if f == nil { panic(fmt.Sprintf("lazyUnmarshal: field info for %v.%v", mi.Desc.FullName(), num)) } lazy := *p.Apply(mi.lazyOffset).LazyInfoPtr() start, end, found, _, multipleEntries := lazy.FindFieldInProto(uint32(num)) if !found && multipleEntries == nil { panic(fmt.Sprintf("lazyUnmarshal: can't find field data for %v.%v", mi.Desc.FullName(), num)) } // The actual pointer in the message can not be set until the whole struct is filled in, otherwise we will have races. // Create another pointer and set it atomically, if we won the race and the pointer in the original message is still nil. fp := pointerOfValue(reflect.New(f.ft)) if multipleEntries != nil { for _, entry := range multipleEntries { mi.unmarshalField(lazy.Buffer()[entry.Start:entry.End], fp, f, lazy, lazy.UnmarshalFlags()) } } else { mi.unmarshalField(lazy.Buffer()[start:end], fp, f, lazy, lazy.UnmarshalFlags()) } p.Apply(f.offset).AtomicSetPointerIfNil(fp.Elem()) } func (mi *MessageInfo) unmarshalField(b []byte, p pointer, f *coderFieldInfo, lazyInfo *protolazy.XXX_lazyUnmarshalInfo, flags piface.UnmarshalInputFlags) error { opts := lazyUnmarshalOptions opts.flags |= flags for len(b) > 0 { // Parse the tag (field number and wire type). var tag uint64 if b[0] < 0x80 { tag = uint64(b[0]) b = b[1:] } else if len(b) >= 2 && b[1] < 128 { tag = uint64(b[0]&0x7f) + uint64(b[1])<<7 b = b[2:] } else { var n int tag, n = protowire.ConsumeVarint(b) if n < 0 { return errors.New("invalid wire data") } b = b[n:] } var num protowire.Number if n := tag >> 3; n < uint64(protowire.MinValidNumber) || n > uint64(protowire.MaxValidNumber) { return errors.New("invalid wire data") } else { num = protowire.Number(n) } wtyp := protowire.Type(tag & 7) if num == f.num { o, err := f.funcs.unmarshal(b, p, wtyp, f, opts) if err == nil { b = b[o.n:] continue } if err != errUnknown { return err } } n := protowire.ConsumeFieldValue(num, wtyp, b) if n < 0 { return errors.New("invalid wire data") } b = b[n:] } return nil } func (mi *MessageInfo) skipField(b []byte, f *coderFieldInfo, wtyp protowire.Type, opts unmarshalOptions) (out unmarshalOutput, _ ValidationStatus) { fmi := f.validation.mi if fmi == nil { fd := mi.Desc.Fields().ByNumber(f.num) if fd == nil { return out, ValidationUnknown } messageName := fd.Message().FullName() messageType, err := preg.GlobalTypes.FindMessageByName(messageName) if err != nil { return out, ValidationUnknown } var ok bool fmi, ok = messageType.(*MessageInfo) if !ok { return out, ValidationUnknown } } fmi.init() switch f.validation.typ { case validationTypeMessage: if wtyp != protowire.BytesType { return out, ValidationWrongWireType } v, n := protowire.ConsumeBytes(b) if n < 0 { return out, ValidationInvalid } out, st := fmi.validate(v, 0, opts) out.n = n return out, st case validationTypeGroup: if wtyp != protowire.StartGroupType { return out, ValidationWrongWireType } out, st := fmi.validate(b, f.num, opts) return out, st default: return out, ValidationUnknown } } // unmarshalPointerLazy is similar to unmarshalPointerEager, but it // specifically handles lazy unmarshalling. it expects lazyOffset and // presenceOffset to both be valid. func (mi *MessageInfo) unmarshalPointerLazy(b []byte, p pointer, groupTag protowire.Number, opts unmarshalOptions) (out unmarshalOutput, err error) { initialized := true var requiredMask uint64 var lazy **protolazy.XXX_lazyUnmarshalInfo var presence presence var lazyIndex []protolazy.IndexEntry var lastNum protowire.Number outOfOrder := false lazyDecode := false presence = p.Apply(mi.presenceOffset).PresenceInfo() lazy = p.Apply(mi.lazyOffset).LazyInfoPtr() if !presence.AnyPresent(mi.presenceSize) { if opts.CanBeLazy() { // If the message contains existing data, we need to merge into it. // Lazy unmarshaling doesn't merge, so only enable it when the // message is empty (has no presence bitmap). lazyDecode = true if *lazy == nil { *lazy = &protolazy.XXX_lazyUnmarshalInfo{} } (*lazy).SetUnmarshalFlags(opts.flags) if !opts.AliasBuffer() { // Make a copy of the buffer for lazy unmarshaling. // Set the AliasBuffer flag so recursive unmarshal // operations reuse the copy. b = append([]byte{}, b...) opts.flags |= piface.UnmarshalAliasBuffer } (*lazy).SetBuffer(b) } } // Track special handling of lazy fields. // // In the common case, all fields are lazyValidateOnly (and lazyFields remains nil). // In the event that validation for a field fails, this map tracks handling of the field. type lazyAction uint8 const ( lazyValidateOnly lazyAction = iota // validate the field only lazyUnmarshalNow // eagerly unmarshal the field lazyUnmarshalLater // unmarshal the field after the message is fully processed ) var lazyFields map[*coderFieldInfo]lazyAction var exts *map[int32]ExtensionField start := len(b) pos := 0 for len(b) > 0 { // Parse the tag (field number and wire type). var tag uint64 if b[0] < 0x80 { tag = uint64(b[0]) b = b[1:] } else if len(b) >= 2 && b[1] < 128 { tag = uint64(b[0]&0x7f) + uint64(b[1])<<7 b = b[2:] } else { var n int tag, n = protowire.ConsumeVarint(b) if n < 0 { return out, errDecode } b = b[n:] } var num protowire.Number if n := tag >> 3; n < uint64(protowire.MinValidNumber) || n > uint64(protowire.MaxValidNumber) { return out, errors.New("invalid field number") } else { num = protowire.Number(n) } wtyp := protowire.Type(tag & 7) if wtyp == protowire.EndGroupType { if num != groupTag { return out, errors.New("mismatching end group marker") } groupTag = 0 break } var f *coderFieldInfo if int(num) < len(mi.denseCoderFields) { f = mi.denseCoderFields[num] } else { f = mi.coderFields[num] } var n int err := errUnknown discardUnknown := false Field: switch { case f != nil: if f.funcs.unmarshal == nil { break } if f.isLazy && lazyDecode { switch { case lazyFields == nil || lazyFields[f] == lazyValidateOnly: // Attempt to validate this field and leave it for later lazy unmarshaling. o, valid := mi.skipField(b, f, wtyp, opts) switch valid { case ValidationValid: // Skip over the valid field and continue. err = nil presence.SetPresentUnatomic(f.presenceIndex, mi.presenceSize) requiredMask |= f.validation.requiredBit if !o.initialized { initialized = false } n = o.n break Field case ValidationInvalid: return out, errors.New("invalid proto wire format") case ValidationWrongWireType: break Field case ValidationUnknown: if lazyFields == nil { lazyFields = make(map[*coderFieldInfo]lazyAction) } if presence.Present(f.presenceIndex) { // We were unable to determine if the field is valid or not, // and we've already skipped over at least one instance of this // field. Clear the presence bit (so if we stop decoding early, // we don't leave a partially-initialized field around) and flag // the field for unmarshaling before we return. presence.ClearPresent(f.presenceIndex) lazyFields[f] = lazyUnmarshalLater discardUnknown = true break Field } else { // We were unable to determine if the field is valid or not, // but this is the first time we've seen it. Flag it as needing // eager unmarshaling and fall through to the eager unmarshal case below. lazyFields[f] = lazyUnmarshalNow } } case lazyFields[f] == lazyUnmarshalLater: // This field will be unmarshaled in a separate pass below. // Skip over it here. discardUnknown = true break Field default: // Eagerly unmarshal the field. } } if f.isLazy && !lazyDecode && presence.Present(f.presenceIndex) { if p.Apply(f.offset).AtomicGetPointer().IsNil() { mi.lazyUnmarshal(p, f.num) } } var o unmarshalOutput o, err = f.funcs.unmarshal(b, p.Apply(f.offset), wtyp, f, opts) n = o.n if err != nil { break } requiredMask |= f.validation.requiredBit if f.funcs.isInit != nil && !o.initialized { initialized = false } if f.presenceIndex != noPresence { presence.SetPresentUnatomic(f.presenceIndex, mi.presenceSize) } default: // Possible extension. if exts == nil && mi.extensionOffset.IsValid() { exts = p.Apply(mi.extensionOffset).Extensions() if *exts == nil { *exts = make(map[int32]ExtensionField) } } if exts == nil { break } var o unmarshalOutput o, err = mi.unmarshalExtension(b, num, wtyp, *exts, opts) if err != nil { break } n = o.n if !o.initialized { initialized = false } } if err != nil { if err != errUnknown { return out, err } n = protowire.ConsumeFieldValue(num, wtyp, b) if n < 0 { return out, errDecode } if !discardUnknown && !opts.DiscardUnknown() && mi.unknownOffset.IsValid() { u := mi.mutableUnknownBytes(p) *u = protowire.AppendTag(*u, num, wtyp) *u = append(*u, b[:n]...) } } b = b[n:] end := start - len(b) if lazyDecode && f != nil && f.isLazy { if num != lastNum { lazyIndex = append(lazyIndex, protolazy.IndexEntry{ FieldNum: uint32(num), Start: uint32(pos), End: uint32(end), }) } else { i := len(lazyIndex) - 1 lazyIndex[i].End = uint32(end) lazyIndex[i].MultipleContiguous = true } } if num < lastNum { outOfOrder = true } pos = end lastNum = num } if groupTag != 0 { return out, errors.New("missing end group marker") } if lazyFields != nil { // Some fields failed validation, and now need to be unmarshaled. for f, action := range lazyFields { if action != lazyUnmarshalLater { continue } initialized = false if *lazy == nil { *lazy = &protolazy.XXX_lazyUnmarshalInfo{} } if err := mi.unmarshalField((*lazy).Buffer(), p.Apply(f.offset), f, *lazy, opts.flags); err != nil { return out, err } presence.SetPresentUnatomic(f.presenceIndex, mi.presenceSize) } } if lazyDecode { if outOfOrder { sort.Slice(lazyIndex, func(i, j int) bool { return lazyIndex[i].FieldNum < lazyIndex[j].FieldNum || (lazyIndex[i].FieldNum == lazyIndex[j].FieldNum && lazyIndex[i].Start < lazyIndex[j].Start) }) } if *lazy == nil { *lazy = &protolazy.XXX_lazyUnmarshalInfo{} } (*lazy).SetIndex(lazyIndex) } if mi.numRequiredFields > 0 && bits.OnesCount64(requiredMask) != int(mi.numRequiredFields) { initialized = false } if initialized { out.initialized = true } out.n = start - len(b) return out, nil } ================================================ FILE: vendor/google.golang.org/protobuf/internal/impl/legacy_enum.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package impl import ( "fmt" "reflect" "strings" "sync" "google.golang.org/protobuf/internal/filedesc" "google.golang.org/protobuf/internal/strs" "google.golang.org/protobuf/reflect/protoreflect" ) // legacyEnumName returns the name of enums used in legacy code. // It is neither the protobuf full name nor the qualified Go name, // but rather an odd hybrid of both. func legacyEnumName(ed protoreflect.EnumDescriptor) string { var protoPkg string enumName := string(ed.FullName()) if fd := ed.ParentFile(); fd != nil { protoPkg = string(fd.Package()) enumName = strings.TrimPrefix(enumName, protoPkg+".") } if protoPkg == "" { return strs.GoCamelCase(enumName) } return protoPkg + "." + strs.GoCamelCase(enumName) } // legacyWrapEnum wraps v as a protoreflect.Enum, // where v must be a int32 kind and not implement the v2 API already. func legacyWrapEnum(v reflect.Value) protoreflect.Enum { et := legacyLoadEnumType(v.Type()) return et.New(protoreflect.EnumNumber(v.Int())) } var legacyEnumTypeCache sync.Map // map[reflect.Type]protoreflect.EnumType // legacyLoadEnumType dynamically loads a protoreflect.EnumType for t, // where t must be an int32 kind and not implement the v2 API already. func legacyLoadEnumType(t reflect.Type) protoreflect.EnumType { // Fast-path: check if a EnumType is cached for this concrete type. if et, ok := legacyEnumTypeCache.Load(t); ok { return et.(protoreflect.EnumType) } // Slow-path: derive enum descriptor and initialize EnumType. var et protoreflect.EnumType ed := LegacyLoadEnumDesc(t) et = &legacyEnumType{ desc: ed, goType: t, } if et, ok := legacyEnumTypeCache.LoadOrStore(t, et); ok { return et.(protoreflect.EnumType) } return et } type legacyEnumType struct { desc protoreflect.EnumDescriptor goType reflect.Type m sync.Map // map[protoreflect.EnumNumber]proto.Enum } func (t *legacyEnumType) New(n protoreflect.EnumNumber) protoreflect.Enum { if e, ok := t.m.Load(n); ok { return e.(protoreflect.Enum) } e := &legacyEnumWrapper{num: n, pbTyp: t, goTyp: t.goType} t.m.Store(n, e) return e } func (t *legacyEnumType) Descriptor() protoreflect.EnumDescriptor { return t.desc } type legacyEnumWrapper struct { num protoreflect.EnumNumber pbTyp protoreflect.EnumType goTyp reflect.Type } func (e *legacyEnumWrapper) Descriptor() protoreflect.EnumDescriptor { return e.pbTyp.Descriptor() } func (e *legacyEnumWrapper) Type() protoreflect.EnumType { return e.pbTyp } func (e *legacyEnumWrapper) Number() protoreflect.EnumNumber { return e.num } func (e *legacyEnumWrapper) ProtoReflect() protoreflect.Enum { return e } func (e *legacyEnumWrapper) protoUnwrap() any { v := reflect.New(e.goTyp).Elem() v.SetInt(int64(e.num)) return v.Interface() } var ( _ protoreflect.Enum = (*legacyEnumWrapper)(nil) _ unwrapper = (*legacyEnumWrapper)(nil) ) var legacyEnumDescCache sync.Map // map[reflect.Type]protoreflect.EnumDescriptor // LegacyLoadEnumDesc returns an EnumDescriptor derived from the Go type, // which must be an int32 kind and not implement the v2 API already. // // This is exported for testing purposes. func LegacyLoadEnumDesc(t reflect.Type) protoreflect.EnumDescriptor { // Fast-path: check if an EnumDescriptor is cached for this concrete type. if ed, ok := legacyEnumDescCache.Load(t); ok { return ed.(protoreflect.EnumDescriptor) } // Slow-path: initialize EnumDescriptor from the raw descriptor. ev := reflect.Zero(t).Interface() if _, ok := ev.(protoreflect.Enum); ok { panic(fmt.Sprintf("%v already implements proto.Enum", t)) } edV1, ok := ev.(enumV1) if !ok { return aberrantLoadEnumDesc(t) } b, idxs := edV1.EnumDescriptor() var ed protoreflect.EnumDescriptor if len(idxs) == 1 { ed = legacyLoadFileDesc(b).Enums().Get(idxs[0]) } else { md := legacyLoadFileDesc(b).Messages().Get(idxs[0]) for _, i := range idxs[1 : len(idxs)-1] { md = md.Messages().Get(i) } ed = md.Enums().Get(idxs[len(idxs)-1]) } if ed, ok := legacyEnumDescCache.LoadOrStore(t, ed); ok { return ed.(protoreflect.EnumDescriptor) } return ed } var aberrantEnumDescCache sync.Map // map[reflect.Type]protoreflect.EnumDescriptor // aberrantLoadEnumDesc returns an EnumDescriptor derived from the Go type, // which must not implement protoreflect.Enum or enumV1. // // If the type does not implement enumV1, then there is no reliable // way to derive the original protobuf type information. // We are unable to use the global enum registry since it is // unfortunately keyed by the protobuf full name, which we also do not know. // Thus, this produces some bogus enum descriptor based on the Go type name. func aberrantLoadEnumDesc(t reflect.Type) protoreflect.EnumDescriptor { // Fast-path: check if an EnumDescriptor is cached for this concrete type. if ed, ok := aberrantEnumDescCache.Load(t); ok { return ed.(protoreflect.EnumDescriptor) } // Slow-path: construct a bogus, but unique EnumDescriptor. ed := &filedesc.Enum{L2: new(filedesc.EnumL2)} ed.L0.FullName = AberrantDeriveFullName(t) // e.g., github_com.user.repo.MyEnum ed.L0.ParentFile = filedesc.SurrogateProto3 ed.L1.EditionFeatures = ed.L0.ParentFile.L1.EditionFeatures ed.L2.Values.List = append(ed.L2.Values.List, filedesc.EnumValue{}) // TODO: Use the presence of a UnmarshalJSON method to determine proto2? vd := &ed.L2.Values.List[0] vd.L0.FullName = ed.L0.FullName + "_UNKNOWN" // e.g., github_com.user.repo.MyEnum_UNKNOWN vd.L0.ParentFile = ed.L0.ParentFile vd.L0.Parent = ed // TODO: We could use the String method to obtain some enum value names by // starting at 0 and print the enum until it produces invalid identifiers. // An exhaustive query is clearly impractical, but can be best-effort. if ed, ok := aberrantEnumDescCache.LoadOrStore(t, ed); ok { return ed.(protoreflect.EnumDescriptor) } return ed } // AberrantDeriveFullName derives a fully qualified protobuf name for the given Go type // The provided name is not guaranteed to be stable nor universally unique. // It should be sufficiently unique within a program. // // This is exported for testing purposes. func AberrantDeriveFullName(t reflect.Type) protoreflect.FullName { sanitize := func(r rune) rune { switch { case r == '/': return '.' case 'a' <= r && r <= 'z', 'A' <= r && r <= 'Z', '0' <= r && r <= '9': return r default: return '_' } } prefix := strings.Map(sanitize, t.PkgPath()) suffix := strings.Map(sanitize, t.Name()) if suffix == "" { suffix = fmt.Sprintf("UnknownX%X", reflect.ValueOf(t).Pointer()) } ss := append(strings.Split(prefix, "."), suffix) for i, s := range ss { if s == "" || ('0' <= s[0] && s[0] <= '9') { ss[i] = "x" + s } } return protoreflect.FullName(strings.Join(ss, ".")) } ================================================ FILE: vendor/google.golang.org/protobuf/internal/impl/legacy_export.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package impl import ( "encoding/binary" "encoding/json" "hash/crc32" "math" "reflect" "google.golang.org/protobuf/internal/errors" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/runtime/protoiface" ) // These functions exist to support exported APIs in generated protobufs. // While these are deprecated, they cannot be removed for compatibility reasons. // LegacyEnumName returns the name of enums used in legacy code. func (Export) LegacyEnumName(ed protoreflect.EnumDescriptor) string { return legacyEnumName(ed) } // LegacyMessageTypeOf returns the protoreflect.MessageType for m, // with name used as the message name if necessary. func (Export) LegacyMessageTypeOf(m protoiface.MessageV1, name protoreflect.FullName) protoreflect.MessageType { if mv := (Export{}).protoMessageV2Of(m); mv != nil { return mv.ProtoReflect().Type() } return legacyLoadMessageType(reflect.TypeOf(m), name) } // UnmarshalJSONEnum unmarshals an enum from a JSON-encoded input. // The input can either be a string representing the enum value by name, // or a number representing the enum number itself. func (Export) UnmarshalJSONEnum(ed protoreflect.EnumDescriptor, b []byte) (protoreflect.EnumNumber, error) { if b[0] == '"' { var name protoreflect.Name if err := json.Unmarshal(b, &name); err != nil { return 0, errors.New("invalid input for enum %v: %s", ed.FullName(), b) } ev := ed.Values().ByName(name) if ev == nil { return 0, errors.New("invalid value for enum %v: %s", ed.FullName(), name) } return ev.Number(), nil } else { var num protoreflect.EnumNumber if err := json.Unmarshal(b, &num); err != nil { return 0, errors.New("invalid input for enum %v: %s", ed.FullName(), b) } return num, nil } } // CompressGZIP compresses the input as a GZIP-encoded file. // The current implementation does no compression. func (Export) CompressGZIP(in []byte) (out []byte) { // RFC 1952, section 2.3.1. var gzipHeader = [10]byte{0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff} // RFC 1951, section 3.2.4. var blockHeader [5]byte const maxBlockSize = math.MaxUint16 numBlocks := 1 + len(in)/maxBlockSize // RFC 1952, section 2.3.1. var gzipFooter [8]byte binary.LittleEndian.PutUint32(gzipFooter[0:4], crc32.ChecksumIEEE(in)) binary.LittleEndian.PutUint32(gzipFooter[4:8], uint32(len(in))) // Encode the input without compression using raw DEFLATE blocks. out = make([]byte, 0, len(gzipHeader)+len(blockHeader)*numBlocks+len(in)+len(gzipFooter)) out = append(out, gzipHeader[:]...) for blockHeader[0] == 0 { blockSize := maxBlockSize if blockSize > len(in) { blockHeader[0] = 0x01 // final bit per RFC 1951, section 3.2.3. blockSize = len(in) } binary.LittleEndian.PutUint16(blockHeader[1:3], uint16(blockSize)) binary.LittleEndian.PutUint16(blockHeader[3:5], ^uint16(blockSize)) out = append(out, blockHeader[:]...) out = append(out, in[:blockSize]...) in = in[blockSize:] } out = append(out, gzipFooter[:]...) return out } ================================================ FILE: vendor/google.golang.org/protobuf/internal/impl/legacy_extension.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package impl import ( "reflect" "google.golang.org/protobuf/internal/descopts" "google.golang.org/protobuf/internal/encoding/messageset" ptag "google.golang.org/protobuf/internal/encoding/tag" "google.golang.org/protobuf/internal/filedesc" "google.golang.org/protobuf/internal/pragma" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/reflect/protoregistry" "google.golang.org/protobuf/runtime/protoiface" ) func (xi *ExtensionInfo) initToLegacy() { xd := xi.desc var parent protoiface.MessageV1 messageName := xd.ContainingMessage().FullName() if mt, _ := protoregistry.GlobalTypes.FindMessageByName(messageName); mt != nil { // Create a new parent message and unwrap it if possible. mv := mt.New().Interface() t := reflect.TypeOf(mv) if mv, ok := mv.(unwrapper); ok { t = reflect.TypeOf(mv.protoUnwrap()) } // Check whether the message implements the legacy v1 Message interface. mz := reflect.Zero(t).Interface() if mz, ok := mz.(protoiface.MessageV1); ok { parent = mz } } // Determine the v1 extension type, which is unfortunately not the same as // the v2 ExtensionType.GoType. extType := xi.goType switch extType.Kind() { case reflect.Bool, reflect.Int32, reflect.Int64, reflect.Uint32, reflect.Uint64, reflect.Float32, reflect.Float64, reflect.String: extType = reflect.PtrTo(extType) // T -> *T for singular scalar fields } // Reconstruct the legacy enum full name. var enumName string if xd.Kind() == protoreflect.EnumKind { enumName = legacyEnumName(xd.Enum()) } // Derive the proto file that the extension was declared within. var filename string if fd := xd.ParentFile(); fd != nil { filename = fd.Path() } // For MessageSet extensions, the name used is the parent message. name := xd.FullName() if messageset.IsMessageSetExtension(xd) { name = name.Parent() } xi.ExtendedType = parent xi.ExtensionType = reflect.Zero(extType).Interface() xi.Field = int32(xd.Number()) xi.Name = string(name) xi.Tag = ptag.Marshal(xd, enumName) xi.Filename = filename } // initFromLegacy initializes an ExtensionInfo from // the contents of the deprecated exported fields of the type. func (xi *ExtensionInfo) initFromLegacy() { // The v1 API returns "type incomplete" descriptors where only the // field number is specified. In such a case, use a placeholder. if xi.ExtendedType == nil || xi.ExtensionType == nil { xd := placeholderExtension{ name: protoreflect.FullName(xi.Name), number: protoreflect.FieldNumber(xi.Field), } xi.desc = extensionTypeDescriptor{xd, xi} return } // Resolve enum or message dependencies. var ed protoreflect.EnumDescriptor var md protoreflect.MessageDescriptor t := reflect.TypeOf(xi.ExtensionType) isOptional := t.Kind() == reflect.Ptr && t.Elem().Kind() != reflect.Struct isRepeated := t.Kind() == reflect.Slice && t.Elem().Kind() != reflect.Uint8 if isOptional || isRepeated { t = t.Elem() } switch v := reflect.Zero(t).Interface().(type) { case protoreflect.Enum: ed = v.Descriptor() case enumV1: ed = LegacyLoadEnumDesc(t) case protoreflect.ProtoMessage: md = v.ProtoReflect().Descriptor() case messageV1: md = LegacyLoadMessageDesc(t) } // Derive basic field information from the struct tag. var evs protoreflect.EnumValueDescriptors if ed != nil { evs = ed.Values() } fd := ptag.Unmarshal(xi.Tag, t, evs).(*filedesc.Field) // Construct a v2 ExtensionType. xd := &filedesc.Extension{L2: new(filedesc.ExtensionL2)} xd.L0.ParentFile = filedesc.SurrogateProto2 xd.L0.FullName = protoreflect.FullName(xi.Name) xd.L1.Number = protoreflect.FieldNumber(xi.Field) xd.L1.Cardinality = fd.L1.Cardinality xd.L1.Kind = fd.L1.Kind xd.L1.EditionFeatures = fd.L1.EditionFeatures xd.L2.Default = fd.L1.Default xd.L1.Extendee = Export{}.MessageDescriptorOf(xi.ExtendedType) xd.L2.Enum = ed xd.L2.Message = md // Derive real extension field name for MessageSets. if messageset.IsMessageSet(xd.L1.Extendee) && md.FullName() == xd.L0.FullName { xd.L0.FullName = xd.L0.FullName.Append(messageset.ExtensionName) } tt := reflect.TypeOf(xi.ExtensionType) if isOptional { tt = tt.Elem() } xi.goType = tt xi.desc = extensionTypeDescriptor{xd, xi} } type placeholderExtension struct { name protoreflect.FullName number protoreflect.FieldNumber } func (x placeholderExtension) ParentFile() protoreflect.FileDescriptor { return nil } func (x placeholderExtension) Parent() protoreflect.Descriptor { return nil } func (x placeholderExtension) Index() int { return 0 } func (x placeholderExtension) Syntax() protoreflect.Syntax { return 0 } func (x placeholderExtension) Name() protoreflect.Name { return x.name.Name() } func (x placeholderExtension) FullName() protoreflect.FullName { return x.name } func (x placeholderExtension) IsPlaceholder() bool { return true } func (x placeholderExtension) Options() protoreflect.ProtoMessage { return descopts.Field } func (x placeholderExtension) Number() protoreflect.FieldNumber { return x.number } func (x placeholderExtension) Cardinality() protoreflect.Cardinality { return 0 } func (x placeholderExtension) Kind() protoreflect.Kind { return 0 } func (x placeholderExtension) HasJSONName() bool { return false } func (x placeholderExtension) JSONName() string { return "[" + string(x.name) + "]" } func (x placeholderExtension) TextName() string { return "[" + string(x.name) + "]" } func (x placeholderExtension) HasPresence() bool { return false } func (x placeholderExtension) HasOptionalKeyword() bool { return false } func (x placeholderExtension) IsExtension() bool { return true } func (x placeholderExtension) IsWeak() bool { return false } func (x placeholderExtension) IsLazy() bool { return false } func (x placeholderExtension) IsPacked() bool { return false } func (x placeholderExtension) IsList() bool { return false } func (x placeholderExtension) IsMap() bool { return false } func (x placeholderExtension) MapKey() protoreflect.FieldDescriptor { return nil } func (x placeholderExtension) MapValue() protoreflect.FieldDescriptor { return nil } func (x placeholderExtension) HasDefault() bool { return false } func (x placeholderExtension) Default() protoreflect.Value { return protoreflect.Value{} } func (x placeholderExtension) DefaultEnumValue() protoreflect.EnumValueDescriptor { return nil } func (x placeholderExtension) ContainingOneof() protoreflect.OneofDescriptor { return nil } func (x placeholderExtension) ContainingMessage() protoreflect.MessageDescriptor { return nil } func (x placeholderExtension) Enum() protoreflect.EnumDescriptor { return nil } func (x placeholderExtension) Message() protoreflect.MessageDescriptor { return nil } func (x placeholderExtension) ProtoType(protoreflect.FieldDescriptor) { return } func (x placeholderExtension) ProtoInternal(pragma.DoNotImplement) { return } ================================================ FILE: vendor/google.golang.org/protobuf/internal/impl/legacy_file.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package impl import ( "bytes" "compress/gzip" "io" "sync" "google.golang.org/protobuf/internal/filedesc" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/reflect/protoregistry" ) // Every enum and message type generated by protoc-gen-go since commit 2fc053c5 // on February 25th, 2016 has had a method to get the raw descriptor. // Types that were not generated by protoc-gen-go or were generated prior // to that version are not supported. // // The []byte returned is the encoded form of a FileDescriptorProto message // compressed using GZIP. The []int is the path from the top-level file // to the specific message or enum declaration. type ( enumV1 interface { EnumDescriptor() ([]byte, []int) } messageV1 interface { Descriptor() ([]byte, []int) } ) var legacyFileDescCache sync.Map // map[*byte]protoreflect.FileDescriptor // legacyLoadFileDesc unmarshals b as a compressed FileDescriptorProto message. // // This assumes that b is immutable and that b does not refer to part of a // concatenated series of GZIP files (which would require shenanigans that // rely on the concatenation properties of both protobufs and GZIP). // File descriptors generated by protoc-gen-go do not rely on that property. func legacyLoadFileDesc(b []byte) protoreflect.FileDescriptor { // Fast-path: check whether we already have a cached file descriptor. if fd, ok := legacyFileDescCache.Load(&b[0]); ok { return fd.(protoreflect.FileDescriptor) } // Slow-path: decompress and unmarshal the file descriptor proto. zr, err := gzip.NewReader(bytes.NewReader(b)) if err != nil { panic(err) } b2, err := io.ReadAll(zr) if err != nil { panic(err) } fd := filedesc.Builder{ RawDescriptor: b2, FileRegistry: resolverOnly{protoregistry.GlobalFiles}, // do not register back to global registry }.Build().File if fd, ok := legacyFileDescCache.LoadOrStore(&b[0], fd); ok { return fd.(protoreflect.FileDescriptor) } return fd } type resolverOnly struct { reg *protoregistry.Files } func (r resolverOnly) FindFileByPath(path string) (protoreflect.FileDescriptor, error) { return r.reg.FindFileByPath(path) } func (r resolverOnly) FindDescriptorByName(name protoreflect.FullName) (protoreflect.Descriptor, error) { return r.reg.FindDescriptorByName(name) } func (resolverOnly) RegisterFile(protoreflect.FileDescriptor) error { return nil } ================================================ FILE: vendor/google.golang.org/protobuf/internal/impl/legacy_message.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package impl import ( "fmt" "reflect" "strings" "sync" "google.golang.org/protobuf/internal/descopts" ptag "google.golang.org/protobuf/internal/encoding/tag" "google.golang.org/protobuf/internal/errors" "google.golang.org/protobuf/internal/filedesc" "google.golang.org/protobuf/internal/strs" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/runtime/protoiface" ) // legacyWrapMessage wraps v as a protoreflect.Message, // where v must be a *struct kind and not implement the v2 API already. func legacyWrapMessage(v reflect.Value) protoreflect.Message { t := v.Type() if t.Kind() != reflect.Ptr || t.Elem().Kind() != reflect.Struct { return aberrantMessage{v: v} } mt := legacyLoadMessageInfo(t, "") return mt.MessageOf(v.Interface()) } // legacyLoadMessageType dynamically loads a protoreflect.Type for t, // where t must be not implement the v2 API already. // The provided name is used if it cannot be determined from the message. func legacyLoadMessageType(t reflect.Type, name protoreflect.FullName) protoreflect.MessageType { if t.Kind() != reflect.Ptr || t.Elem().Kind() != reflect.Struct { return aberrantMessageType{t} } return legacyLoadMessageInfo(t, name) } var legacyMessageTypeCache sync.Map // map[reflect.Type]*MessageInfo // legacyLoadMessageInfo dynamically loads a *MessageInfo for t, // where t must be a *struct kind and not implement the v2 API already. // The provided name is used if it cannot be determined from the message. func legacyLoadMessageInfo(t reflect.Type, name protoreflect.FullName) *MessageInfo { // Fast-path: check if a MessageInfo is cached for this concrete type. if mt, ok := legacyMessageTypeCache.Load(t); ok { return mt.(*MessageInfo) } // Slow-path: derive message descriptor and initialize MessageInfo. mi := &MessageInfo{ Desc: legacyLoadMessageDesc(t, name), GoReflectType: t, } var hasMarshal, hasUnmarshal bool v := reflect.Zero(t).Interface() if _, hasMarshal = v.(legacyMarshaler); hasMarshal { mi.methods.Marshal = legacyMarshal // We have no way to tell whether the type's Marshal method // supports deterministic serialization or not, but this // preserves the v1 implementation's behavior of always // calling Marshal methods when present. mi.methods.Flags |= protoiface.SupportMarshalDeterministic } if _, hasUnmarshal = v.(legacyUnmarshaler); hasUnmarshal { mi.methods.Unmarshal = legacyUnmarshal } if _, hasMerge := v.(legacyMerger); hasMerge || (hasMarshal && hasUnmarshal) { mi.methods.Merge = legacyMerge } if mi, ok := legacyMessageTypeCache.LoadOrStore(t, mi); ok { return mi.(*MessageInfo) } return mi } var legacyMessageDescCache sync.Map // map[reflect.Type]protoreflect.MessageDescriptor // LegacyLoadMessageDesc returns an MessageDescriptor derived from the Go type, // which should be a *struct kind and must not implement the v2 API already. // // This is exported for testing purposes. func LegacyLoadMessageDesc(t reflect.Type) protoreflect.MessageDescriptor { return legacyLoadMessageDesc(t, "") } func legacyLoadMessageDesc(t reflect.Type, name protoreflect.FullName) protoreflect.MessageDescriptor { // Fast-path: check if a MessageDescriptor is cached for this concrete type. if mi, ok := legacyMessageDescCache.Load(t); ok { return mi.(protoreflect.MessageDescriptor) } // Slow-path: initialize MessageDescriptor from the raw descriptor. mv := reflect.Zero(t).Interface() if _, ok := mv.(protoreflect.ProtoMessage); ok { panic(fmt.Sprintf("%v already implements proto.Message", t)) } mdV1, ok := mv.(messageV1) if !ok { return aberrantLoadMessageDesc(t, name) } // If this is a dynamic message type where there isn't a 1-1 mapping between // Go and protobuf types, calling the Descriptor method on the zero value of // the message type isn't likely to work. If it panics, swallow the panic and // continue as if the Descriptor method wasn't present. b, idxs := func() ([]byte, []int) { defer func() { recover() }() return mdV1.Descriptor() }() if b == nil { return aberrantLoadMessageDesc(t, name) } // If the Go type has no fields, then this might be a proto3 empty message // from before the size cache was added. If there are any fields, check to // see that at least one of them looks like something we generated. if t.Elem().Kind() == reflect.Struct { if nfield := t.Elem().NumField(); nfield > 0 { hasProtoField := false for i := 0; i < nfield; i++ { f := t.Elem().Field(i) if f.Tag.Get("protobuf") != "" || f.Tag.Get("protobuf_oneof") != "" || strings.HasPrefix(f.Name, "XXX_") { hasProtoField = true break } } if !hasProtoField { return aberrantLoadMessageDesc(t, name) } } } md := legacyLoadFileDesc(b).Messages().Get(idxs[0]) for _, i := range idxs[1:] { md = md.Messages().Get(i) } if name != "" && md.FullName() != name { panic(fmt.Sprintf("mismatching message name: got %v, want %v", md.FullName(), name)) } if md, ok := legacyMessageDescCache.LoadOrStore(t, md); ok { return md.(protoreflect.MessageDescriptor) } return md } var ( aberrantMessageDescLock sync.Mutex aberrantMessageDescCache map[reflect.Type]protoreflect.MessageDescriptor ) // aberrantLoadMessageDesc returns an MessageDescriptor derived from the Go type, // which must not implement protoreflect.ProtoMessage or messageV1. // // This is a best-effort derivation of the message descriptor using the protobuf // tags on the struct fields. func aberrantLoadMessageDesc(t reflect.Type, name protoreflect.FullName) protoreflect.MessageDescriptor { aberrantMessageDescLock.Lock() defer aberrantMessageDescLock.Unlock() if aberrantMessageDescCache == nil { aberrantMessageDescCache = make(map[reflect.Type]protoreflect.MessageDescriptor) } return aberrantLoadMessageDescReentrant(t, name) } func aberrantLoadMessageDescReentrant(t reflect.Type, name protoreflect.FullName) protoreflect.MessageDescriptor { // Fast-path: check if an MessageDescriptor is cached for this concrete type. if md, ok := aberrantMessageDescCache[t]; ok { return md } // Slow-path: construct a descriptor from the Go struct type (best-effort). // Cache the MessageDescriptor early on so that we can resolve internal // cyclic references. md := &filedesc.Message{L2: new(filedesc.MessageL2)} md.L0.FullName = aberrantDeriveMessageName(t, name) md.L0.ParentFile = filedesc.SurrogateProto2 aberrantMessageDescCache[t] = md if t.Kind() != reflect.Ptr || t.Elem().Kind() != reflect.Struct { return md } // Try to determine if the message is using proto3 by checking scalars. for i := 0; i < t.Elem().NumField(); i++ { f := t.Elem().Field(i) if tag := f.Tag.Get("protobuf"); tag != "" { switch f.Type.Kind() { case reflect.Bool, reflect.Int32, reflect.Int64, reflect.Uint32, reflect.Uint64, reflect.Float32, reflect.Float64, reflect.String: md.L0.ParentFile = filedesc.SurrogateProto3 } for _, s := range strings.Split(tag, ",") { if s == "proto3" { md.L0.ParentFile = filedesc.SurrogateProto3 } } } } md.L1.EditionFeatures = md.L0.ParentFile.L1.EditionFeatures // Obtain a list of oneof wrapper types. var oneofWrappers []reflect.Type methods := make([]reflect.Method, 0, 2) if m, ok := t.MethodByName("XXX_OneofFuncs"); ok { methods = append(methods, m) } if m, ok := t.MethodByName("XXX_OneofWrappers"); ok { methods = append(methods, m) } for _, fn := range methods { for _, v := range fn.Func.Call([]reflect.Value{reflect.Zero(fn.Type.In(0))}) { if vs, ok := v.Interface().([]any); ok { for _, v := range vs { oneofWrappers = append(oneofWrappers, reflect.TypeOf(v)) } } } } // Obtain a list of the extension ranges. if fn, ok := t.MethodByName("ExtensionRangeArray"); ok { vs := fn.Func.Call([]reflect.Value{reflect.Zero(fn.Type.In(0))})[0] for i := 0; i < vs.Len(); i++ { v := vs.Index(i) md.L2.ExtensionRanges.List = append(md.L2.ExtensionRanges.List, [2]protoreflect.FieldNumber{ protoreflect.FieldNumber(v.FieldByName("Start").Int()), protoreflect.FieldNumber(v.FieldByName("End").Int() + 1), }) md.L2.ExtensionRangeOptions = append(md.L2.ExtensionRangeOptions, nil) } } // Derive the message fields by inspecting the struct fields. for i := 0; i < t.Elem().NumField(); i++ { f := t.Elem().Field(i) if tag := f.Tag.Get("protobuf"); tag != "" { tagKey := f.Tag.Get("protobuf_key") tagVal := f.Tag.Get("protobuf_val") aberrantAppendField(md, f.Type, tag, tagKey, tagVal) } if tag := f.Tag.Get("protobuf_oneof"); tag != "" { n := len(md.L2.Oneofs.List) md.L2.Oneofs.List = append(md.L2.Oneofs.List, filedesc.Oneof{}) od := &md.L2.Oneofs.List[n] od.L0.FullName = md.FullName().Append(protoreflect.Name(tag)) od.L0.ParentFile = md.L0.ParentFile od.L1.EditionFeatures = md.L1.EditionFeatures od.L0.Parent = md od.L0.Index = n for _, t := range oneofWrappers { if t.Implements(f.Type) { f := t.Elem().Field(0) if tag := f.Tag.Get("protobuf"); tag != "" { aberrantAppendField(md, f.Type, tag, "", "") fd := &md.L2.Fields.List[len(md.L2.Fields.List)-1] fd.L1.ContainingOneof = od fd.L1.EditionFeatures = od.L1.EditionFeatures od.L1.Fields.List = append(od.L1.Fields.List, fd) } } } } } return md } func aberrantDeriveMessageName(t reflect.Type, name protoreflect.FullName) protoreflect.FullName { if name.IsValid() { return name } func() { defer func() { recover() }() // swallow possible nil panics if m, ok := reflect.Zero(t).Interface().(interface{ XXX_MessageName() string }); ok { name = protoreflect.FullName(m.XXX_MessageName()) } }() if name.IsValid() { return name } if t.Kind() == reflect.Ptr { t = t.Elem() } return AberrantDeriveFullName(t) } func aberrantAppendField(md *filedesc.Message, goType reflect.Type, tag, tagKey, tagVal string) { t := goType isOptional := t.Kind() == reflect.Ptr && t.Elem().Kind() != reflect.Struct isRepeated := t.Kind() == reflect.Slice && t.Elem().Kind() != reflect.Uint8 if isOptional || isRepeated { t = t.Elem() } fd := ptag.Unmarshal(tag, t, placeholderEnumValues{}).(*filedesc.Field) // Append field descriptor to the message. n := len(md.L2.Fields.List) md.L2.Fields.List = append(md.L2.Fields.List, *fd) fd = &md.L2.Fields.List[n] fd.L0.FullName = md.FullName().Append(fd.Name()) fd.L0.ParentFile = md.L0.ParentFile fd.L0.Parent = md fd.L0.Index = n if fd.L1.EditionFeatures.IsPacked { fd.L1.Options = func() protoreflect.ProtoMessage { opts := descopts.Field.ProtoReflect().New() if fd.L1.EditionFeatures.IsPacked { opts.Set(opts.Descriptor().Fields().ByName("packed"), protoreflect.ValueOfBool(fd.L1.EditionFeatures.IsPacked)) } return opts.Interface() } } // Populate Enum and Message. if fd.Enum() == nil && fd.Kind() == protoreflect.EnumKind { switch v := reflect.Zero(t).Interface().(type) { case protoreflect.Enum: fd.L1.Enum = v.Descriptor() default: fd.L1.Enum = LegacyLoadEnumDesc(t) } } if fd.Message() == nil && (fd.Kind() == protoreflect.MessageKind || fd.Kind() == protoreflect.GroupKind) { switch v := reflect.Zero(t).Interface().(type) { case protoreflect.ProtoMessage: fd.L1.Message = v.ProtoReflect().Descriptor() case messageV1: fd.L1.Message = LegacyLoadMessageDesc(t) default: if t.Kind() == reflect.Map { n := len(md.L1.Messages.List) md.L1.Messages.List = append(md.L1.Messages.List, filedesc.Message{L2: new(filedesc.MessageL2)}) md2 := &md.L1.Messages.List[n] md2.L0.FullName = md.FullName().Append(protoreflect.Name(strs.MapEntryName(string(fd.Name())))) md2.L0.ParentFile = md.L0.ParentFile md2.L0.Parent = md md2.L0.Index = n md2.L1.EditionFeatures = md.L1.EditionFeatures md2.L1.IsMapEntry = true md2.L2.Options = func() protoreflect.ProtoMessage { opts := descopts.Message.ProtoReflect().New() opts.Set(opts.Descriptor().Fields().ByName("map_entry"), protoreflect.ValueOfBool(true)) return opts.Interface() } aberrantAppendField(md2, t.Key(), tagKey, "", "") aberrantAppendField(md2, t.Elem(), tagVal, "", "") fd.L1.Message = md2 break } fd.L1.Message = aberrantLoadMessageDescReentrant(t, "") } } } type placeholderEnumValues struct { protoreflect.EnumValueDescriptors } func (placeholderEnumValues) ByNumber(n protoreflect.EnumNumber) protoreflect.EnumValueDescriptor { return filedesc.PlaceholderEnumValue(protoreflect.FullName(fmt.Sprintf("UNKNOWN_%d", n))) } // legacyMarshaler is the proto.Marshaler interface superseded by protoiface.Methoder. type legacyMarshaler interface { Marshal() ([]byte, error) } // legacyUnmarshaler is the proto.Unmarshaler interface superseded by protoiface.Methoder. type legacyUnmarshaler interface { Unmarshal([]byte) error } // legacyMerger is the proto.Merger interface superseded by protoiface.Methoder. type legacyMerger interface { Merge(protoiface.MessageV1) } var aberrantProtoMethods = &protoiface.Methods{ Marshal: legacyMarshal, Unmarshal: legacyUnmarshal, Merge: legacyMerge, // We have no way to tell whether the type's Marshal method // supports deterministic serialization or not, but this // preserves the v1 implementation's behavior of always // calling Marshal methods when present. Flags: protoiface.SupportMarshalDeterministic, } func legacyMarshal(in protoiface.MarshalInput) (protoiface.MarshalOutput, error) { v := in.Message.(unwrapper).protoUnwrap() marshaler, ok := v.(legacyMarshaler) if !ok { return protoiface.MarshalOutput{}, errors.New("%T does not implement Marshal", v) } out, err := marshaler.Marshal() if in.Buf != nil { out = append(in.Buf, out...) } return protoiface.MarshalOutput{ Buf: out, }, err } func legacyUnmarshal(in protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { v := in.Message.(unwrapper).protoUnwrap() unmarshaler, ok := v.(legacyUnmarshaler) if !ok { return protoiface.UnmarshalOutput{}, errors.New("%T does not implement Unmarshal", v) } return protoiface.UnmarshalOutput{}, unmarshaler.Unmarshal(in.Buf) } func legacyMerge(in protoiface.MergeInput) protoiface.MergeOutput { // Check whether this supports the legacy merger. dstv := in.Destination.(unwrapper).protoUnwrap() merger, ok := dstv.(legacyMerger) if ok { merger.Merge(Export{}.ProtoMessageV1Of(in.Source)) return protoiface.MergeOutput{Flags: protoiface.MergeComplete} } // If legacy merger is unavailable, implement merge in terms of // a marshal and unmarshal operation. srcv := in.Source.(unwrapper).protoUnwrap() marshaler, ok := srcv.(legacyMarshaler) if !ok { return protoiface.MergeOutput{} } dstv = in.Destination.(unwrapper).protoUnwrap() unmarshaler, ok := dstv.(legacyUnmarshaler) if !ok { return protoiface.MergeOutput{} } if !in.Source.IsValid() { // Legacy Marshal methods may not function on nil messages. // Check for a typed nil source only after we confirm that // legacy Marshal/Unmarshal methods are present, for // consistency. return protoiface.MergeOutput{Flags: protoiface.MergeComplete} } b, err := marshaler.Marshal() if err != nil { return protoiface.MergeOutput{} } err = unmarshaler.Unmarshal(b) if err != nil { return protoiface.MergeOutput{} } return protoiface.MergeOutput{Flags: protoiface.MergeComplete} } // aberrantMessageType implements MessageType for all types other than pointer-to-struct. type aberrantMessageType struct { t reflect.Type } func (mt aberrantMessageType) New() protoreflect.Message { if mt.t.Kind() == reflect.Ptr { return aberrantMessage{reflect.New(mt.t.Elem())} } return aberrantMessage{reflect.Zero(mt.t)} } func (mt aberrantMessageType) Zero() protoreflect.Message { return aberrantMessage{reflect.Zero(mt.t)} } func (mt aberrantMessageType) GoType() reflect.Type { return mt.t } func (mt aberrantMessageType) Descriptor() protoreflect.MessageDescriptor { return LegacyLoadMessageDesc(mt.t) } // aberrantMessage implements Message for all types other than pointer-to-struct. // // When the underlying type implements legacyMarshaler or legacyUnmarshaler, // the aberrant Message can be marshaled or unmarshaled. Otherwise, there is // not much that can be done with values of this type. type aberrantMessage struct { v reflect.Value } // Reset implements the v1 proto.Message.Reset method. func (m aberrantMessage) Reset() { if mr, ok := m.v.Interface().(interface{ Reset() }); ok { mr.Reset() return } if m.v.Kind() == reflect.Ptr && !m.v.IsNil() { m.v.Elem().Set(reflect.Zero(m.v.Type().Elem())) } } func (m aberrantMessage) ProtoReflect() protoreflect.Message { return m } func (m aberrantMessage) Descriptor() protoreflect.MessageDescriptor { return LegacyLoadMessageDesc(m.v.Type()) } func (m aberrantMessage) Type() protoreflect.MessageType { return aberrantMessageType{m.v.Type()} } func (m aberrantMessage) New() protoreflect.Message { if m.v.Type().Kind() == reflect.Ptr { return aberrantMessage{reflect.New(m.v.Type().Elem())} } return aberrantMessage{reflect.Zero(m.v.Type())} } func (m aberrantMessage) Interface() protoreflect.ProtoMessage { return m } func (m aberrantMessage) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { return } func (m aberrantMessage) Has(protoreflect.FieldDescriptor) bool { return false } func (m aberrantMessage) Clear(protoreflect.FieldDescriptor) { panic("invalid Message.Clear on " + string(m.Descriptor().FullName())) } func (m aberrantMessage) Get(fd protoreflect.FieldDescriptor) protoreflect.Value { if fd.Default().IsValid() { return fd.Default() } panic("invalid Message.Get on " + string(m.Descriptor().FullName())) } func (m aberrantMessage) Set(protoreflect.FieldDescriptor, protoreflect.Value) { panic("invalid Message.Set on " + string(m.Descriptor().FullName())) } func (m aberrantMessage) Mutable(protoreflect.FieldDescriptor) protoreflect.Value { panic("invalid Message.Mutable on " + string(m.Descriptor().FullName())) } func (m aberrantMessage) NewField(protoreflect.FieldDescriptor) protoreflect.Value { panic("invalid Message.NewField on " + string(m.Descriptor().FullName())) } func (m aberrantMessage) WhichOneof(protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { panic("invalid Message.WhichOneof descriptor on " + string(m.Descriptor().FullName())) } func (m aberrantMessage) GetUnknown() protoreflect.RawFields { return nil } func (m aberrantMessage) SetUnknown(protoreflect.RawFields) { // SetUnknown discards its input on messages which don't support unknown field storage. } func (m aberrantMessage) IsValid() bool { if m.v.Kind() == reflect.Ptr { return !m.v.IsNil() } return false } func (m aberrantMessage) ProtoMethods() *protoiface.Methods { return aberrantProtoMethods } func (m aberrantMessage) protoUnwrap() any { return m.v.Interface() } ================================================ FILE: vendor/google.golang.org/protobuf/internal/impl/merge.go ================================================ // Copyright 2020 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package impl import ( "fmt" "reflect" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/runtime/protoiface" ) type mergeOptions struct{} func (o mergeOptions) Merge(dst, src proto.Message) { proto.Merge(dst, src) } // merge is protoreflect.Methods.Merge. func (mi *MessageInfo) merge(in protoiface.MergeInput) protoiface.MergeOutput { dp, ok := mi.getPointer(in.Destination) if !ok { return protoiface.MergeOutput{} } sp, ok := mi.getPointer(in.Source) if !ok { return protoiface.MergeOutput{} } mi.mergePointer(dp, sp, mergeOptions{}) return protoiface.MergeOutput{Flags: protoiface.MergeComplete} } func (mi *MessageInfo) mergePointer(dst, src pointer, opts mergeOptions) { mi.init() if dst.IsNil() { panic(fmt.Sprintf("invalid value: merging into nil message")) } if src.IsNil() { return } var presenceSrc presence var presenceDst presence if mi.presenceOffset.IsValid() { presenceSrc = src.Apply(mi.presenceOffset).PresenceInfo() presenceDst = dst.Apply(mi.presenceOffset).PresenceInfo() } for _, f := range mi.orderedCoderFields { if f.funcs.merge == nil { continue } sfptr := src.Apply(f.offset) if f.presenceIndex != noPresence { if !presenceSrc.Present(f.presenceIndex) { continue } dfptr := dst.Apply(f.offset) if f.isLazy { if sfptr.AtomicGetPointer().IsNil() { mi.lazyUnmarshal(src, f.num) } if presenceDst.Present(f.presenceIndex) && dfptr.AtomicGetPointer().IsNil() { mi.lazyUnmarshal(dst, f.num) } } f.funcs.merge(dst.Apply(f.offset), sfptr, f, opts) presenceDst.SetPresentUnatomic(f.presenceIndex, mi.presenceSize) continue } if f.isPointer && sfptr.Elem().IsNil() { continue } f.funcs.merge(dst.Apply(f.offset), sfptr, f, opts) } if mi.extensionOffset.IsValid() { sext := src.Apply(mi.extensionOffset).Extensions() dext := dst.Apply(mi.extensionOffset).Extensions() if *dext == nil { *dext = make(map[int32]ExtensionField) } for num, sx := range *sext { xt := sx.Type() xi := getExtensionFieldInfo(xt) if xi.funcs.merge == nil { continue } dx := (*dext)[num] var dv protoreflect.Value if dx.Type() == sx.Type() { dv = dx.Value() } if !dv.IsValid() && xi.unmarshalNeedsValue { dv = xt.New() } dv = xi.funcs.merge(dv, sx.Value(), opts) dx.Set(sx.Type(), dv) (*dext)[num] = dx } } if mi.unknownOffset.IsValid() { su := mi.getUnknownBytes(src) if su != nil && len(*su) > 0 { du := mi.mutableUnknownBytes(dst) *du = append(*du, *su...) } } } func mergeScalarValue(dst, src protoreflect.Value, opts mergeOptions) protoreflect.Value { return src } func mergeBytesValue(dst, src protoreflect.Value, opts mergeOptions) protoreflect.Value { return protoreflect.ValueOfBytes(append(emptyBuf[:], src.Bytes()...)) } func mergeListValue(dst, src protoreflect.Value, opts mergeOptions) protoreflect.Value { dstl := dst.List() srcl := src.List() for i, llen := 0, srcl.Len(); i < llen; i++ { dstl.Append(srcl.Get(i)) } return dst } func mergeBytesListValue(dst, src protoreflect.Value, opts mergeOptions) protoreflect.Value { dstl := dst.List() srcl := src.List() for i, llen := 0, srcl.Len(); i < llen; i++ { sb := srcl.Get(i).Bytes() db := append(emptyBuf[:], sb...) dstl.Append(protoreflect.ValueOfBytes(db)) } return dst } func mergeMessageListValue(dst, src protoreflect.Value, opts mergeOptions) protoreflect.Value { dstl := dst.List() srcl := src.List() for i, llen := 0, srcl.Len(); i < llen; i++ { sm := srcl.Get(i).Message() dm := proto.Clone(sm.Interface()).ProtoReflect() dstl.Append(protoreflect.ValueOfMessage(dm)) } return dst } func mergeMessageValue(dst, src protoreflect.Value, opts mergeOptions) protoreflect.Value { opts.Merge(dst.Message().Interface(), src.Message().Interface()) return dst } func mergeMessage(dst, src pointer, f *coderFieldInfo, opts mergeOptions) { if f.mi != nil { if dst.Elem().IsNil() { dst.SetPointer(pointerOfValue(reflect.New(f.mi.GoReflectType.Elem()))) } f.mi.mergePointer(dst.Elem(), src.Elem(), opts) } else { dm := dst.AsValueOf(f.ft).Elem() sm := src.AsValueOf(f.ft).Elem() if dm.IsNil() { dm.Set(reflect.New(f.ft.Elem())) } opts.Merge(asMessage(dm), asMessage(sm)) } } func mergeMessageSlice(dst, src pointer, f *coderFieldInfo, opts mergeOptions) { for _, sp := range src.PointerSlice() { dm := reflect.New(f.ft.Elem().Elem()) if f.mi != nil { f.mi.mergePointer(pointerOfValue(dm), sp, opts) } else { opts.Merge(asMessage(dm), asMessage(sp.AsValueOf(f.ft.Elem().Elem()))) } dst.AppendPointerSlice(pointerOfValue(dm)) } } func mergeBytes(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { *dst.Bytes() = append(emptyBuf[:], *src.Bytes()...) } func mergeBytesNoZero(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { v := *src.Bytes() if len(v) > 0 { *dst.Bytes() = append(emptyBuf[:], v...) } } func mergeBytesSlice(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { ds := dst.BytesSlice() for _, v := range *src.BytesSlice() { *ds = append(*ds, append(emptyBuf[:], v...)) } } ================================================ FILE: vendor/google.golang.org/protobuf/internal/impl/merge_gen.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Code generated by generate-types. DO NOT EDIT. package impl import () func mergeBool(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { *dst.Bool() = *src.Bool() } func mergeBoolNoZero(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { v := *src.Bool() if v != false { *dst.Bool() = v } } func mergeBoolPtr(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { p := *src.BoolPtr() if p != nil { v := *p *dst.BoolPtr() = &v } } func mergeBoolSlice(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { ds := dst.BoolSlice() ss := src.BoolSlice() *ds = append(*ds, *ss...) } func mergeInt32(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { *dst.Int32() = *src.Int32() } func mergeInt32NoZero(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { v := *src.Int32() if v != 0 { *dst.Int32() = v } } func mergeInt32Ptr(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { p := *src.Int32Ptr() if p != nil { v := *p *dst.Int32Ptr() = &v } } func mergeInt32Slice(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { ds := dst.Int32Slice() ss := src.Int32Slice() *ds = append(*ds, *ss...) } func mergeUint32(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { *dst.Uint32() = *src.Uint32() } func mergeUint32NoZero(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { v := *src.Uint32() if v != 0 { *dst.Uint32() = v } } func mergeUint32Ptr(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { p := *src.Uint32Ptr() if p != nil { v := *p *dst.Uint32Ptr() = &v } } func mergeUint32Slice(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { ds := dst.Uint32Slice() ss := src.Uint32Slice() *ds = append(*ds, *ss...) } func mergeInt64(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { *dst.Int64() = *src.Int64() } func mergeInt64NoZero(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { v := *src.Int64() if v != 0 { *dst.Int64() = v } } func mergeInt64Ptr(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { p := *src.Int64Ptr() if p != nil { v := *p *dst.Int64Ptr() = &v } } func mergeInt64Slice(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { ds := dst.Int64Slice() ss := src.Int64Slice() *ds = append(*ds, *ss...) } func mergeUint64(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { *dst.Uint64() = *src.Uint64() } func mergeUint64NoZero(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { v := *src.Uint64() if v != 0 { *dst.Uint64() = v } } func mergeUint64Ptr(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { p := *src.Uint64Ptr() if p != nil { v := *p *dst.Uint64Ptr() = &v } } func mergeUint64Slice(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { ds := dst.Uint64Slice() ss := src.Uint64Slice() *ds = append(*ds, *ss...) } func mergeFloat32(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { *dst.Float32() = *src.Float32() } func mergeFloat32NoZero(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { v := *src.Float32() if v != 0 { *dst.Float32() = v } } func mergeFloat32Ptr(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { p := *src.Float32Ptr() if p != nil { v := *p *dst.Float32Ptr() = &v } } func mergeFloat32Slice(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { ds := dst.Float32Slice() ss := src.Float32Slice() *ds = append(*ds, *ss...) } func mergeFloat64(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { *dst.Float64() = *src.Float64() } func mergeFloat64NoZero(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { v := *src.Float64() if v != 0 { *dst.Float64() = v } } func mergeFloat64Ptr(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { p := *src.Float64Ptr() if p != nil { v := *p *dst.Float64Ptr() = &v } } func mergeFloat64Slice(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { ds := dst.Float64Slice() ss := src.Float64Slice() *ds = append(*ds, *ss...) } func mergeString(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { *dst.String() = *src.String() } func mergeStringNoZero(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { v := *src.String() if v != "" { *dst.String() = v } } func mergeStringPtr(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { p := *src.StringPtr() if p != nil { v := *p *dst.StringPtr() = &v } } func mergeStringSlice(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { ds := dst.StringSlice() ss := src.StringSlice() *ds = append(*ds, *ss...) } ================================================ FILE: vendor/google.golang.org/protobuf/internal/impl/message.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package impl import ( "fmt" "reflect" "strconv" "strings" "sync" "sync/atomic" "google.golang.org/protobuf/internal/genid" "google.golang.org/protobuf/reflect/protoreflect" ) // MessageInfo provides protobuf related functionality for a given Go type // that represents a message. A given instance of MessageInfo is tied to // exactly one Go type, which must be a pointer to a struct type. // // The exported fields must be populated before any methods are called // and cannot be mutated after set. type MessageInfo struct { // GoReflectType is the underlying message Go type and must be populated. GoReflectType reflect.Type // pointer to struct // Desc is the underlying message descriptor type and must be populated. Desc protoreflect.MessageDescriptor // Deprecated: Exporter will be removed the next time we bump // protoimpl.GenVersion. See https://github.com/golang/protobuf/issues/1640 Exporter exporter // OneofWrappers is list of pointers to oneof wrapper struct types. OneofWrappers []any initMu sync.Mutex // protects all unexported fields initDone uint32 reflectMessageInfo // for reflection implementation coderMessageInfo // for fast-path method implementations } // exporter is a function that returns a reference to the ith field of v, // where v is a pointer to a struct. It returns nil if it does not support // exporting the requested field (e.g., already exported). type exporter func(v any, i int) any // getMessageInfo returns the MessageInfo for any message type that // is generated by our implementation of protoc-gen-go (for v2 and on). // If it is unable to obtain a MessageInfo, it returns nil. func getMessageInfo(mt reflect.Type) *MessageInfo { m, ok := reflect.Zero(mt).Interface().(protoreflect.ProtoMessage) if !ok { return nil } mr, ok := m.ProtoReflect().(interface{ ProtoMessageInfo() *MessageInfo }) if !ok { return nil } return mr.ProtoMessageInfo() } func (mi *MessageInfo) init() { // This function is called in the hot path. Inline the sync.Once logic, // since allocating a closure for Once.Do is expensive. // Keep init small to ensure that it can be inlined. if atomic.LoadUint32(&mi.initDone) == 0 { mi.initOnce() } } func (mi *MessageInfo) initOnce() { mi.initMu.Lock() defer mi.initMu.Unlock() if mi.initDone == 1 { return } if opaqueInitHook(mi) { return } t := mi.GoReflectType if t.Kind() != reflect.Ptr && t.Elem().Kind() != reflect.Struct { panic(fmt.Sprintf("got %v, want *struct kind", t)) } t = t.Elem() si := mi.makeStructInfo(t) mi.makeReflectFuncs(t, si) mi.makeCoderMethods(t, si) atomic.StoreUint32(&mi.initDone, 1) } // getPointer returns the pointer for a message, which should be of // the type of the MessageInfo. If the message is of a different type, // it returns ok==false. func (mi *MessageInfo) getPointer(m protoreflect.Message) (p pointer, ok bool) { switch m := m.(type) { case *messageState: return m.pointer(), m.messageInfo() == mi case *messageReflectWrapper: return m.pointer(), m.messageInfo() == mi } return pointer{}, false } type ( SizeCache = int32 WeakFields = map[int32]protoreflect.ProtoMessage UnknownFields = unknownFieldsA // TODO: switch to unknownFieldsB unknownFieldsA = []byte unknownFieldsB = *[]byte ExtensionFields = map[int32]ExtensionField ) var ( sizecacheType = reflect.TypeOf(SizeCache(0)) unknownFieldsAType = reflect.TypeOf(unknownFieldsA(nil)) unknownFieldsBType = reflect.TypeOf(unknownFieldsB(nil)) extensionFieldsType = reflect.TypeOf(ExtensionFields(nil)) ) type structInfo struct { sizecacheOffset offset sizecacheType reflect.Type unknownOffset offset unknownType reflect.Type extensionOffset offset extensionType reflect.Type lazyOffset offset presenceOffset offset fieldsByNumber map[protoreflect.FieldNumber]reflect.StructField oneofsByName map[protoreflect.Name]reflect.StructField oneofWrappersByType map[reflect.Type]protoreflect.FieldNumber oneofWrappersByNumber map[protoreflect.FieldNumber]reflect.Type } func (mi *MessageInfo) makeStructInfo(t reflect.Type) structInfo { si := structInfo{ sizecacheOffset: invalidOffset, unknownOffset: invalidOffset, extensionOffset: invalidOffset, lazyOffset: invalidOffset, presenceOffset: invalidOffset, fieldsByNumber: map[protoreflect.FieldNumber]reflect.StructField{}, oneofsByName: map[protoreflect.Name]reflect.StructField{}, oneofWrappersByType: map[reflect.Type]protoreflect.FieldNumber{}, oneofWrappersByNumber: map[protoreflect.FieldNumber]reflect.Type{}, } fieldLoop: for i := 0; i < t.NumField(); i++ { switch f := t.Field(i); f.Name { case genid.SizeCache_goname, genid.SizeCacheA_goname: if f.Type == sizecacheType { si.sizecacheOffset = offsetOf(f) si.sizecacheType = f.Type } case genid.UnknownFields_goname, genid.UnknownFieldsA_goname: if f.Type == unknownFieldsAType || f.Type == unknownFieldsBType { si.unknownOffset = offsetOf(f) si.unknownType = f.Type } case genid.ExtensionFields_goname, genid.ExtensionFieldsA_goname, genid.ExtensionFieldsB_goname: if f.Type == extensionFieldsType { si.extensionOffset = offsetOf(f) si.extensionType = f.Type } case "lazyFields", "XXX_lazyUnmarshalInfo": si.lazyOffset = offsetOf(f) case "XXX_presence": si.presenceOffset = offsetOf(f) default: for _, s := range strings.Split(f.Tag.Get("protobuf"), ",") { if len(s) > 0 && strings.Trim(s, "0123456789") == "" { n, _ := strconv.ParseUint(s, 10, 64) si.fieldsByNumber[protoreflect.FieldNumber(n)] = f continue fieldLoop } } if s := f.Tag.Get("protobuf_oneof"); len(s) > 0 { si.oneofsByName[protoreflect.Name(s)] = f continue fieldLoop } } } // Derive a mapping of oneof wrappers to fields. oneofWrappers := mi.OneofWrappers methods := make([]reflect.Method, 0, 2) if m, ok := reflect.PtrTo(t).MethodByName("XXX_OneofFuncs"); ok { methods = append(methods, m) } if m, ok := reflect.PtrTo(t).MethodByName("XXX_OneofWrappers"); ok { methods = append(methods, m) } for _, fn := range methods { for _, v := range fn.Func.Call([]reflect.Value{reflect.Zero(fn.Type.In(0))}) { if vs, ok := v.Interface().([]any); ok { oneofWrappers = vs } } } for _, v := range oneofWrappers { tf := reflect.TypeOf(v).Elem() f := tf.Field(0) for _, s := range strings.Split(f.Tag.Get("protobuf"), ",") { if len(s) > 0 && strings.Trim(s, "0123456789") == "" { n, _ := strconv.ParseUint(s, 10, 64) si.oneofWrappersByType[tf] = protoreflect.FieldNumber(n) si.oneofWrappersByNumber[protoreflect.FieldNumber(n)] = tf break } } } return si } func (mi *MessageInfo) New() protoreflect.Message { m := reflect.New(mi.GoReflectType.Elem()).Interface() if r, ok := m.(protoreflect.ProtoMessage); ok { return r.ProtoReflect() } return mi.MessageOf(m) } func (mi *MessageInfo) Zero() protoreflect.Message { return mi.MessageOf(reflect.Zero(mi.GoReflectType).Interface()) } func (mi *MessageInfo) Descriptor() protoreflect.MessageDescriptor { return mi.Desc } func (mi *MessageInfo) Enum(i int) protoreflect.EnumType { mi.init() fd := mi.Desc.Fields().Get(i) return Export{}.EnumTypeOf(mi.fieldTypes[fd.Number()]) } func (mi *MessageInfo) Message(i int) protoreflect.MessageType { mi.init() fd := mi.Desc.Fields().Get(i) switch { case fd.IsMap(): return mapEntryType{fd.Message(), mi.fieldTypes[fd.Number()]} default: return Export{}.MessageTypeOf(mi.fieldTypes[fd.Number()]) } } type mapEntryType struct { desc protoreflect.MessageDescriptor valType any // zero value of enum or message type } func (mt mapEntryType) New() protoreflect.Message { return nil } func (mt mapEntryType) Zero() protoreflect.Message { return nil } func (mt mapEntryType) Descriptor() protoreflect.MessageDescriptor { return mt.desc } func (mt mapEntryType) Enum(i int) protoreflect.EnumType { fd := mt.desc.Fields().Get(i) if fd.Enum() == nil { return nil } return Export{}.EnumTypeOf(mt.valType) } func (mt mapEntryType) Message(i int) protoreflect.MessageType { fd := mt.desc.Fields().Get(i) if fd.Message() == nil { return nil } return Export{}.MessageTypeOf(mt.valType) } ================================================ FILE: vendor/google.golang.org/protobuf/internal/impl/message_opaque.go ================================================ // Copyright 2024 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package impl import ( "fmt" "math" "reflect" "strings" "sync/atomic" "google.golang.org/protobuf/internal/filedesc" "google.golang.org/protobuf/reflect/protoreflect" ) type opaqueStructInfo struct { structInfo } // isOpaque determines whether a protobuf message type is on the Opaque API. It // checks whether the type is a Go struct that protoc-gen-go would generate. // // This function only detects newly generated messages from the v2 // implementation of protoc-gen-go. It is unable to classify generated messages // that are too old or those that are generated by a different generator // such as protoc-gen-gogo. func isOpaque(t reflect.Type) bool { // The current detection mechanism is to simply check the first field // for a struct tag with the "protogen" key. if t.Kind() == reflect.Struct && t.NumField() > 0 { pgt := t.Field(0).Tag.Get("protogen") return strings.HasPrefix(pgt, "opaque.") } return false } func opaqueInitHook(mi *MessageInfo) bool { mt := mi.GoReflectType.Elem() si := opaqueStructInfo{ structInfo: mi.makeStructInfo(mt), } if !isOpaque(mt) { return false } defer atomic.StoreUint32(&mi.initDone, 1) mi.fields = map[protoreflect.FieldNumber]*fieldInfo{} fds := mi.Desc.Fields() for i := 0; i < fds.Len(); i++ { fd := fds.Get(i) fs := si.fieldsByNumber[fd.Number()] var fi fieldInfo usePresence, _ := filedesc.UsePresenceForField(fd) switch { case fd.ContainingOneof() != nil && !fd.ContainingOneof().IsSynthetic(): // Oneofs are no different for opaque. fi = fieldInfoForOneof(fd, si.oneofsByName[fd.ContainingOneof().Name()], mi.Exporter, si.oneofWrappersByNumber[fd.Number()]) case fd.IsMap(): fi = mi.fieldInfoForMapOpaque(si, fd, fs) case fd.IsList() && fd.Message() == nil && usePresence: fi = mi.fieldInfoForScalarListOpaque(si, fd, fs) case fd.IsList() && fd.Message() == nil: // Proto3 lists without presence can use same access methods as open fi = fieldInfoForList(fd, fs, mi.Exporter) case fd.IsList() && usePresence: fi = mi.fieldInfoForMessageListOpaque(si, fd, fs) case fd.IsList(): // Proto3 opaque messages that does not need presence bitmap. // Different representation than open struct, but same logic fi = mi.fieldInfoForMessageListOpaqueNoPresence(si, fd, fs) case fd.Message() != nil && usePresence: fi = mi.fieldInfoForMessageOpaque(si, fd, fs) case fd.Message() != nil: // Proto3 messages without presence can use same access methods as open fi = fieldInfoForMessage(fd, fs, mi.Exporter) default: fi = mi.fieldInfoForScalarOpaque(si, fd, fs) } mi.fields[fd.Number()] = &fi } mi.oneofs = map[protoreflect.Name]*oneofInfo{} for i := 0; i < mi.Desc.Oneofs().Len(); i++ { od := mi.Desc.Oneofs().Get(i) mi.oneofs[od.Name()] = makeOneofInfoOpaque(mi, od, si.structInfo, mi.Exporter) } mi.denseFields = make([]*fieldInfo, fds.Len()*2) for i := 0; i < fds.Len(); i++ { if fd := fds.Get(i); int(fd.Number()) < len(mi.denseFields) { mi.denseFields[fd.Number()] = mi.fields[fd.Number()] } } for i := 0; i < fds.Len(); { fd := fds.Get(i) if od := fd.ContainingOneof(); od != nil && !fd.ContainingOneof().IsSynthetic() { mi.rangeInfos = append(mi.rangeInfos, mi.oneofs[od.Name()]) i += od.Fields().Len() } else { mi.rangeInfos = append(mi.rangeInfos, mi.fields[fd.Number()]) i++ } } mi.makeExtensionFieldsFunc(mt, si.structInfo) mi.makeUnknownFieldsFunc(mt, si.structInfo) mi.makeOpaqueCoderMethods(mt, si) mi.makeFieldTypes(si.structInfo) return true } func makeOneofInfoOpaque(mi *MessageInfo, od protoreflect.OneofDescriptor, si structInfo, x exporter) *oneofInfo { oi := &oneofInfo{oneofDesc: od} if od.IsSynthetic() { fd := od.Fields().Get(0) index, _ := presenceIndex(mi.Desc, fd) oi.which = func(p pointer) protoreflect.FieldNumber { if p.IsNil() { return 0 } if !mi.present(p, index) { return 0 } return od.Fields().Get(0).Number() } return oi } // Dispatch to non-opaque oneof implementation for non-synthetic oneofs. return makeOneofInfo(od, si, x) } func (mi *MessageInfo) fieldInfoForMapOpaque(si opaqueStructInfo, fd protoreflect.FieldDescriptor, fs reflect.StructField) fieldInfo { ft := fs.Type if ft.Kind() != reflect.Map { panic(fmt.Sprintf("invalid type: got %v, want map kind", ft)) } fieldOffset := offsetOf(fs) conv := NewConverter(ft, fd) return fieldInfo{ fieldDesc: fd, has: func(p pointer) bool { if p.IsNil() { return false } // Don't bother checking presence bits, since we need to // look at the map length even if the presence bit is set. rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() return rv.Len() > 0 }, clear: func(p pointer) { rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() rv.Set(reflect.Zero(rv.Type())) }, get: func(p pointer) protoreflect.Value { if p.IsNil() { return conv.Zero() } rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() if rv.Len() == 0 { return conv.Zero() } return conv.PBValueOf(rv) }, set: func(p pointer, v protoreflect.Value) { pv := conv.GoValueOf(v) if pv.IsNil() { panic(fmt.Sprintf("invalid value: setting map field to read-only value")) } rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() rv.Set(pv) }, mutable: func(p pointer) protoreflect.Value { v := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() if v.IsNil() { v.Set(reflect.MakeMap(fs.Type)) } return conv.PBValueOf(v) }, newField: func() protoreflect.Value { return conv.New() }, } } func (mi *MessageInfo) fieldInfoForScalarListOpaque(si opaqueStructInfo, fd protoreflect.FieldDescriptor, fs reflect.StructField) fieldInfo { ft := fs.Type if ft.Kind() != reflect.Slice { panic(fmt.Sprintf("invalid type: got %v, want slice kind", ft)) } conv := NewConverter(reflect.PtrTo(ft), fd) fieldOffset := offsetOf(fs) index, _ := presenceIndex(mi.Desc, fd) return fieldInfo{ fieldDesc: fd, has: func(p pointer) bool { if p.IsNil() { return false } rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() return rv.Len() > 0 }, clear: func(p pointer) { rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() rv.Set(reflect.Zero(rv.Type())) }, get: func(p pointer) protoreflect.Value { if p.IsNil() { return conv.Zero() } rv := p.Apply(fieldOffset).AsValueOf(fs.Type) if rv.Elem().Len() == 0 { return conv.Zero() } return conv.PBValueOf(rv) }, set: func(p pointer, v protoreflect.Value) { pv := conv.GoValueOf(v) if pv.IsNil() { panic(fmt.Sprintf("invalid value: setting repeated field to read-only value")) } mi.setPresent(p, index) rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() rv.Set(pv.Elem()) }, mutable: func(p pointer) protoreflect.Value { mi.setPresent(p, index) return conv.PBValueOf(p.Apply(fieldOffset).AsValueOf(fs.Type)) }, newField: func() protoreflect.Value { return conv.New() }, } } func (mi *MessageInfo) fieldInfoForMessageListOpaque(si opaqueStructInfo, fd protoreflect.FieldDescriptor, fs reflect.StructField) fieldInfo { ft := fs.Type if ft.Kind() != reflect.Ptr || ft.Elem().Kind() != reflect.Slice { panic(fmt.Sprintf("invalid type: got %v, want slice kind", ft)) } conv := NewConverter(ft, fd) fieldOffset := offsetOf(fs) index, _ := presenceIndex(mi.Desc, fd) fieldNumber := fd.Number() return fieldInfo{ fieldDesc: fd, has: func(p pointer) bool { if p.IsNil() { return false } if !mi.present(p, index) { return false } sp := p.Apply(fieldOffset).AtomicGetPointer() if sp.IsNil() { // Lazily unmarshal this field. mi.lazyUnmarshal(p, fieldNumber) sp = p.Apply(fieldOffset).AtomicGetPointer() } rv := sp.AsValueOf(fs.Type.Elem()) return rv.Elem().Len() > 0 }, clear: func(p pointer) { fp := p.Apply(fieldOffset) sp := fp.AtomicGetPointer() if sp.IsNil() { sp = fp.AtomicSetPointerIfNil(pointerOfValue(reflect.New(fs.Type.Elem()))) mi.setPresent(p, index) } rv := sp.AsValueOf(fs.Type.Elem()) rv.Elem().Set(reflect.Zero(rv.Type().Elem())) }, get: func(p pointer) protoreflect.Value { if p.IsNil() { return conv.Zero() } if !mi.present(p, index) { return conv.Zero() } sp := p.Apply(fieldOffset).AtomicGetPointer() if sp.IsNil() { // Lazily unmarshal this field. mi.lazyUnmarshal(p, fieldNumber) sp = p.Apply(fieldOffset).AtomicGetPointer() } rv := sp.AsValueOf(fs.Type.Elem()) if rv.Elem().Len() == 0 { return conv.Zero() } return conv.PBValueOf(rv) }, set: func(p pointer, v protoreflect.Value) { fp := p.Apply(fieldOffset) sp := fp.AtomicGetPointer() if sp.IsNil() { sp = fp.AtomicSetPointerIfNil(pointerOfValue(reflect.New(fs.Type.Elem()))) mi.setPresent(p, index) } rv := sp.AsValueOf(fs.Type.Elem()) val := conv.GoValueOf(v) if val.IsNil() { panic(fmt.Sprintf("invalid value: setting repeated field to read-only value")) } else { rv.Elem().Set(val.Elem()) } }, mutable: func(p pointer) protoreflect.Value { fp := p.Apply(fieldOffset) sp := fp.AtomicGetPointer() if sp.IsNil() { if mi.present(p, index) { // Lazily unmarshal this field. mi.lazyUnmarshal(p, fieldNumber) sp = p.Apply(fieldOffset).AtomicGetPointer() } else { sp = fp.AtomicSetPointerIfNil(pointerOfValue(reflect.New(fs.Type.Elem()))) mi.setPresent(p, index) } } rv := sp.AsValueOf(fs.Type.Elem()) return conv.PBValueOf(rv) }, newField: func() protoreflect.Value { return conv.New() }, } } func (mi *MessageInfo) fieldInfoForMessageListOpaqueNoPresence(si opaqueStructInfo, fd protoreflect.FieldDescriptor, fs reflect.StructField) fieldInfo { ft := fs.Type if ft.Kind() != reflect.Ptr || ft.Elem().Kind() != reflect.Slice { panic(fmt.Sprintf("invalid type: got %v, want slice kind", ft)) } conv := NewConverter(ft, fd) fieldOffset := offsetOf(fs) return fieldInfo{ fieldDesc: fd, has: func(p pointer) bool { if p.IsNil() { return false } rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() if rv.IsNil() { return false } return rv.Elem().Len() > 0 }, clear: func(p pointer) { rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() if !rv.IsNil() { rv.Elem().Set(reflect.Zero(rv.Type().Elem())) } }, get: func(p pointer) protoreflect.Value { if p.IsNil() { return conv.Zero() } rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() if rv.IsNil() { return conv.Zero() } if rv.Elem().Len() == 0 { return conv.Zero() } return conv.PBValueOf(rv) }, set: func(p pointer, v protoreflect.Value) { rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() if rv.IsNil() { rv.Set(reflect.New(fs.Type.Elem())) } val := conv.GoValueOf(v) if val.IsNil() { panic(fmt.Sprintf("invalid value: setting repeated field to read-only value")) } else { rv.Elem().Set(val.Elem()) } }, mutable: func(p pointer) protoreflect.Value { rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() if rv.IsNil() { rv.Set(reflect.New(fs.Type.Elem())) } return conv.PBValueOf(rv) }, newField: func() protoreflect.Value { return conv.New() }, } } func (mi *MessageInfo) fieldInfoForScalarOpaque(si opaqueStructInfo, fd protoreflect.FieldDescriptor, fs reflect.StructField) fieldInfo { ft := fs.Type nullable := fd.HasPresence() if oneof := fd.ContainingOneof(); oneof != nil && oneof.IsSynthetic() { nullable = true } deref := false if nullable && ft.Kind() == reflect.Ptr { ft = ft.Elem() deref = true } conv := NewConverter(ft, fd) fieldOffset := offsetOf(fs) index, _ := presenceIndex(mi.Desc, fd) var getter func(p pointer) protoreflect.Value if !nullable { getter = getterForDirectScalar(fd, fs, conv, fieldOffset) } else { getter = getterForOpaqueNullableScalar(mi, index, fd, fs, conv, fieldOffset) } return fieldInfo{ fieldDesc: fd, has: func(p pointer) bool { if p.IsNil() { return false } if nullable { return mi.present(p, index) } rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() switch rv.Kind() { case reflect.Bool: return rv.Bool() case reflect.Int32, reflect.Int64: return rv.Int() != 0 case reflect.Uint32, reflect.Uint64: return rv.Uint() != 0 case reflect.Float32, reflect.Float64: return rv.Float() != 0 || math.Signbit(rv.Float()) case reflect.String, reflect.Slice: return rv.Len() > 0 default: panic(fmt.Sprintf("invalid type: %v", rv.Type())) // should never happen } }, clear: func(p pointer) { if nullable { mi.clearPresent(p, index) } // This is only valuable for bytes and strings, but we do it unconditionally. rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() rv.Set(reflect.Zero(rv.Type())) }, get: getter, // TODO: Implement unsafe fast path for set? set: func(p pointer, v protoreflect.Value) { rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() if deref { if rv.IsNil() { rv.Set(reflect.New(ft)) } rv = rv.Elem() } rv.Set(conv.GoValueOf(v)) if nullable && rv.Kind() == reflect.Slice && rv.IsNil() { rv.Set(emptyBytes) } if nullable { mi.setPresent(p, index) } }, newField: func() protoreflect.Value { return conv.New() }, } } func (mi *MessageInfo) fieldInfoForMessageOpaque(si opaqueStructInfo, fd protoreflect.FieldDescriptor, fs reflect.StructField) fieldInfo { ft := fs.Type conv := NewConverter(ft, fd) fieldOffset := offsetOf(fs) index, _ := presenceIndex(mi.Desc, fd) fieldNumber := fd.Number() elemType := fs.Type.Elem() return fieldInfo{ fieldDesc: fd, has: func(p pointer) bool { if p.IsNil() { return false } return mi.present(p, index) }, clear: func(p pointer) { mi.clearPresent(p, index) p.Apply(fieldOffset).AtomicSetNilPointer() }, get: func(p pointer) protoreflect.Value { if p.IsNil() || !mi.present(p, index) { return conv.Zero() } fp := p.Apply(fieldOffset) mp := fp.AtomicGetPointer() if mp.IsNil() { // Lazily unmarshal this field. mi.lazyUnmarshal(p, fieldNumber) mp = fp.AtomicGetPointer() } rv := mp.AsValueOf(elemType) return conv.PBValueOf(rv) }, set: func(p pointer, v protoreflect.Value) { val := pointerOfValue(conv.GoValueOf(v)) if val.IsNil() { panic("invalid nil pointer") } p.Apply(fieldOffset).AtomicSetPointer(val) mi.setPresent(p, index) }, mutable: func(p pointer) protoreflect.Value { fp := p.Apply(fieldOffset) mp := fp.AtomicGetPointer() if mp.IsNil() { if mi.present(p, index) { // Lazily unmarshal this field. mi.lazyUnmarshal(p, fieldNumber) mp = fp.AtomicGetPointer() } else { mp = pointerOfValue(conv.GoValueOf(conv.New())) fp.AtomicSetPointer(mp) mi.setPresent(p, index) } } return conv.PBValueOf(mp.AsValueOf(fs.Type.Elem())) }, newMessage: func() protoreflect.Message { return conv.New().Message() }, newField: func() protoreflect.Value { return conv.New() }, } } // A presenceList wraps a List, updating presence bits as necessary when the // list contents change. type presenceList struct { pvalueList setPresence func(bool) } type pvalueList interface { protoreflect.List //Unwrapper } func (list presenceList) Append(v protoreflect.Value) { list.pvalueList.Append(v) list.setPresence(true) } func (list presenceList) Truncate(i int) { list.pvalueList.Truncate(i) list.setPresence(i > 0) } // presenceIndex returns the index to pass to presence functions. // // TODO: field.Desc.Index() would be simpler, and would give space to record the presence of oneof fields. func presenceIndex(md protoreflect.MessageDescriptor, fd protoreflect.FieldDescriptor) (uint32, presenceSize) { found := false var index, numIndices uint32 for i := 0; i < md.Fields().Len(); i++ { f := md.Fields().Get(i) if f == fd { found = true index = numIndices } if f.ContainingOneof() == nil || isLastOneofField(f) { numIndices++ } } if !found { panic(fmt.Sprintf("BUG: %v not in %v", fd.Name(), md.FullName())) } return index, presenceSize(numIndices) } func isLastOneofField(fd protoreflect.FieldDescriptor) bool { fields := fd.ContainingOneof().Fields() return fields.Get(fields.Len()-1) == fd } func (mi *MessageInfo) setPresent(p pointer, index uint32) { p.Apply(mi.presenceOffset).PresenceInfo().SetPresent(index, mi.presenceSize) } func (mi *MessageInfo) clearPresent(p pointer, index uint32) { p.Apply(mi.presenceOffset).PresenceInfo().ClearPresent(index) } func (mi *MessageInfo) present(p pointer, index uint32) bool { return p.Apply(mi.presenceOffset).PresenceInfo().Present(index) } ================================================ FILE: vendor/google.golang.org/protobuf/internal/impl/message_opaque_gen.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Code generated by generate-types. DO NOT EDIT. package impl import ( "reflect" "google.golang.org/protobuf/reflect/protoreflect" ) func getterForOpaqueNullableScalar(mi *MessageInfo, index uint32, fd protoreflect.FieldDescriptor, fs reflect.StructField, conv Converter, fieldOffset offset) func(p pointer) protoreflect.Value { ft := fs.Type if ft.Kind() == reflect.Ptr { ft = ft.Elem() } if fd.Kind() == protoreflect.EnumKind { // Enums for nullable opaque types. return func(p pointer) protoreflect.Value { if p.IsNil() || !mi.present(p, index) { return conv.Zero() } rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() return conv.PBValueOf(rv) } } switch ft.Kind() { case reflect.Bool: return func(p pointer) protoreflect.Value { if p.IsNil() || !mi.present(p, index) { return conv.Zero() } x := p.Apply(fieldOffset).Bool() return protoreflect.ValueOfBool(*x) } case reflect.Int32: return func(p pointer) protoreflect.Value { if p.IsNil() || !mi.present(p, index) { return conv.Zero() } x := p.Apply(fieldOffset).Int32() return protoreflect.ValueOfInt32(*x) } case reflect.Uint32: return func(p pointer) protoreflect.Value { if p.IsNil() || !mi.present(p, index) { return conv.Zero() } x := p.Apply(fieldOffset).Uint32() return protoreflect.ValueOfUint32(*x) } case reflect.Int64: return func(p pointer) protoreflect.Value { if p.IsNil() || !mi.present(p, index) { return conv.Zero() } x := p.Apply(fieldOffset).Int64() return protoreflect.ValueOfInt64(*x) } case reflect.Uint64: return func(p pointer) protoreflect.Value { if p.IsNil() || !mi.present(p, index) { return conv.Zero() } x := p.Apply(fieldOffset).Uint64() return protoreflect.ValueOfUint64(*x) } case reflect.Float32: return func(p pointer) protoreflect.Value { if p.IsNil() || !mi.present(p, index) { return conv.Zero() } x := p.Apply(fieldOffset).Float32() return protoreflect.ValueOfFloat32(*x) } case reflect.Float64: return func(p pointer) protoreflect.Value { if p.IsNil() || !mi.present(p, index) { return conv.Zero() } x := p.Apply(fieldOffset).Float64() return protoreflect.ValueOfFloat64(*x) } case reflect.String: if fd.Kind() == protoreflect.BytesKind { return func(p pointer) protoreflect.Value { if p.IsNil() || !mi.present(p, index) { return conv.Zero() } x := p.Apply(fieldOffset).StringPtr() if *x == nil { return conv.Zero() } if len(**x) == 0 { return protoreflect.ValueOfBytes(nil) } return protoreflect.ValueOfBytes([]byte(**x)) } } return func(p pointer) protoreflect.Value { if p.IsNil() || !mi.present(p, index) { return conv.Zero() } x := p.Apply(fieldOffset).StringPtr() if *x == nil { return conv.Zero() } return protoreflect.ValueOfString(**x) } case reflect.Slice: if fd.Kind() == protoreflect.StringKind { return func(p pointer) protoreflect.Value { if p.IsNil() || !mi.present(p, index) { return conv.Zero() } x := p.Apply(fieldOffset).Bytes() return protoreflect.ValueOfString(string(*x)) } } return func(p pointer) protoreflect.Value { if p.IsNil() || !mi.present(p, index) { return conv.Zero() } x := p.Apply(fieldOffset).Bytes() return protoreflect.ValueOfBytes(*x) } } panic("unexpected protobuf kind: " + ft.Kind().String()) } ================================================ FILE: vendor/google.golang.org/protobuf/internal/impl/message_reflect.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package impl import ( "fmt" "reflect" "google.golang.org/protobuf/internal/detrand" "google.golang.org/protobuf/internal/pragma" "google.golang.org/protobuf/reflect/protoreflect" ) type reflectMessageInfo struct { fields map[protoreflect.FieldNumber]*fieldInfo oneofs map[protoreflect.Name]*oneofInfo // fieldTypes contains the zero value of an enum or message field. // For lists, it contains the element type. // For maps, it contains the entry value type. fieldTypes map[protoreflect.FieldNumber]any // denseFields is a subset of fields where: // 0 < fieldDesc.Number() < len(denseFields) // It provides faster access to the fieldInfo, but may be incomplete. denseFields []*fieldInfo // rangeInfos is a list of all fields (not belonging to a oneof) and oneofs. rangeInfos []any // either *fieldInfo or *oneofInfo getUnknown func(pointer) protoreflect.RawFields setUnknown func(pointer, protoreflect.RawFields) extensionMap func(pointer) *extensionMap nilMessage atomicNilMessage } // makeReflectFuncs generates the set of functions to support reflection. func (mi *MessageInfo) makeReflectFuncs(t reflect.Type, si structInfo) { mi.makeKnownFieldsFunc(si) mi.makeUnknownFieldsFunc(t, si) mi.makeExtensionFieldsFunc(t, si) mi.makeFieldTypes(si) } // makeKnownFieldsFunc generates functions for operations that can be performed // on each protobuf message field. It takes in a reflect.Type representing the // Go struct and matches message fields with struct fields. // // This code assumes that the struct is well-formed and panics if there are // any discrepancies. func (mi *MessageInfo) makeKnownFieldsFunc(si structInfo) { mi.fields = map[protoreflect.FieldNumber]*fieldInfo{} md := mi.Desc fds := md.Fields() for i := 0; i < fds.Len(); i++ { fd := fds.Get(i) fs := si.fieldsByNumber[fd.Number()] isOneof := fd.ContainingOneof() != nil && !fd.ContainingOneof().IsSynthetic() if isOneof { fs = si.oneofsByName[fd.ContainingOneof().Name()] } var fi fieldInfo switch { case fs.Type == nil: fi = fieldInfoForMissing(fd) // never occurs for officially generated message types case isOneof: fi = fieldInfoForOneof(fd, fs, mi.Exporter, si.oneofWrappersByNumber[fd.Number()]) case fd.IsMap(): fi = fieldInfoForMap(fd, fs, mi.Exporter) case fd.IsList(): fi = fieldInfoForList(fd, fs, mi.Exporter) case fd.Message() != nil: fi = fieldInfoForMessage(fd, fs, mi.Exporter) default: fi = fieldInfoForScalar(fd, fs, mi.Exporter) } mi.fields[fd.Number()] = &fi } mi.oneofs = map[protoreflect.Name]*oneofInfo{} for i := 0; i < md.Oneofs().Len(); i++ { od := md.Oneofs().Get(i) mi.oneofs[od.Name()] = makeOneofInfo(od, si, mi.Exporter) } mi.denseFields = make([]*fieldInfo, fds.Len()*2) for i := 0; i < fds.Len(); i++ { if fd := fds.Get(i); int(fd.Number()) < len(mi.denseFields) { mi.denseFields[fd.Number()] = mi.fields[fd.Number()] } } for i := 0; i < fds.Len(); { fd := fds.Get(i) if od := fd.ContainingOneof(); od != nil && !od.IsSynthetic() { mi.rangeInfos = append(mi.rangeInfos, mi.oneofs[od.Name()]) i += od.Fields().Len() } else { mi.rangeInfos = append(mi.rangeInfos, mi.fields[fd.Number()]) i++ } } // Introduce instability to iteration order, but keep it deterministic. if len(mi.rangeInfos) > 1 && detrand.Bool() { i := detrand.Intn(len(mi.rangeInfos) - 1) mi.rangeInfos[i], mi.rangeInfos[i+1] = mi.rangeInfos[i+1], mi.rangeInfos[i] } } func (mi *MessageInfo) makeUnknownFieldsFunc(t reflect.Type, si structInfo) { switch { case si.unknownOffset.IsValid() && si.unknownType == unknownFieldsAType: // Handle as []byte. mi.getUnknown = func(p pointer) protoreflect.RawFields { if p.IsNil() { return nil } return *p.Apply(mi.unknownOffset).Bytes() } mi.setUnknown = func(p pointer, b protoreflect.RawFields) { if p.IsNil() { panic("invalid SetUnknown on nil Message") } *p.Apply(mi.unknownOffset).Bytes() = b } case si.unknownOffset.IsValid() && si.unknownType == unknownFieldsBType: // Handle as *[]byte. mi.getUnknown = func(p pointer) protoreflect.RawFields { if p.IsNil() { return nil } bp := p.Apply(mi.unknownOffset).BytesPtr() if *bp == nil { return nil } return **bp } mi.setUnknown = func(p pointer, b protoreflect.RawFields) { if p.IsNil() { panic("invalid SetUnknown on nil Message") } bp := p.Apply(mi.unknownOffset).BytesPtr() if *bp == nil { *bp = new([]byte) } **bp = b } default: mi.getUnknown = func(pointer) protoreflect.RawFields { return nil } mi.setUnknown = func(p pointer, _ protoreflect.RawFields) { if p.IsNil() { panic("invalid SetUnknown on nil Message") } } } } func (mi *MessageInfo) makeExtensionFieldsFunc(t reflect.Type, si structInfo) { if si.extensionOffset.IsValid() { mi.extensionMap = func(p pointer) *extensionMap { if p.IsNil() { return (*extensionMap)(nil) } v := p.Apply(si.extensionOffset).AsValueOf(extensionFieldsType) return (*extensionMap)(v.Interface().(*map[int32]ExtensionField)) } } else { mi.extensionMap = func(pointer) *extensionMap { return (*extensionMap)(nil) } } } func (mi *MessageInfo) makeFieldTypes(si structInfo) { md := mi.Desc fds := md.Fields() for i := 0; i < fds.Len(); i++ { var ft reflect.Type fd := fds.Get(i) fs := si.fieldsByNumber[fd.Number()] isOneof := fd.ContainingOneof() != nil && !fd.ContainingOneof().IsSynthetic() if isOneof { fs = si.oneofsByName[fd.ContainingOneof().Name()] } var isMessage bool switch { case fs.Type == nil: continue // never occurs for officially generated message types case isOneof: if fd.Enum() != nil || fd.Message() != nil { ft = si.oneofWrappersByNumber[fd.Number()].Field(0).Type } case fd.IsMap(): if fd.MapValue().Enum() != nil || fd.MapValue().Message() != nil { ft = fs.Type.Elem() } isMessage = fd.MapValue().Message() != nil case fd.IsList(): if fd.Enum() != nil || fd.Message() != nil { ft = fs.Type.Elem() if ft.Kind() == reflect.Slice { ft = ft.Elem() } } isMessage = fd.Message() != nil case fd.Enum() != nil: ft = fs.Type if fd.HasPresence() && ft.Kind() == reflect.Ptr { ft = ft.Elem() } case fd.Message() != nil: ft = fs.Type isMessage = true } if isMessage && ft != nil && ft.Kind() != reflect.Ptr { ft = reflect.PtrTo(ft) // never occurs for officially generated message types } if ft != nil { if mi.fieldTypes == nil { mi.fieldTypes = make(map[protoreflect.FieldNumber]any) } mi.fieldTypes[fd.Number()] = reflect.Zero(ft).Interface() } } } type extensionMap map[int32]ExtensionField func (m *extensionMap) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if m != nil { for _, x := range *m { xd := x.Type().TypeDescriptor() v := x.Value() if xd.IsList() && v.List().Len() == 0 { continue } if !f(xd, v) { return } } } } func (m *extensionMap) Has(xd protoreflect.ExtensionTypeDescriptor) (ok bool) { if m == nil { return false } x, ok := (*m)[int32(xd.Number())] if !ok { return false } if x.isUnexpandedLazy() { // Avoid calling x.Value(), which triggers a lazy unmarshal. return true } switch { case xd.IsList(): return x.Value().List().Len() > 0 case xd.IsMap(): return x.Value().Map().Len() > 0 } return true } func (m *extensionMap) Clear(xd protoreflect.ExtensionTypeDescriptor) { delete(*m, int32(xd.Number())) } func (m *extensionMap) Get(xd protoreflect.ExtensionTypeDescriptor) protoreflect.Value { if m != nil { if x, ok := (*m)[int32(xd.Number())]; ok { return x.Value() } } return xd.Type().Zero() } func (m *extensionMap) Set(xd protoreflect.ExtensionTypeDescriptor, v protoreflect.Value) { xt := xd.Type() isValid := true switch { case !xt.IsValidValue(v): isValid = false case xd.IsList(): isValid = v.List().IsValid() case xd.IsMap(): isValid = v.Map().IsValid() case xd.Message() != nil: isValid = v.Message().IsValid() } if !isValid { panic(fmt.Sprintf("%v: assigning invalid value", xd.FullName())) } if *m == nil { *m = make(map[int32]ExtensionField) } var x ExtensionField x.Set(xt, v) (*m)[int32(xd.Number())] = x } func (m *extensionMap) Mutable(xd protoreflect.ExtensionTypeDescriptor) protoreflect.Value { if xd.Kind() != protoreflect.MessageKind && xd.Kind() != protoreflect.GroupKind && !xd.IsList() && !xd.IsMap() { panic("invalid Mutable on field with non-composite type") } if x, ok := (*m)[int32(xd.Number())]; ok { return x.Value() } v := xd.Type().New() m.Set(xd, v) return v } // MessageState is a data structure that is nested as the first field in a // concrete message. It provides a way to implement the ProtoReflect method // in an allocation-free way without needing to have a shadow Go type generated // for every message type. This technique only works using unsafe. // // Example generated code: // // type M struct { // state protoimpl.MessageState // // Field1 int32 // Field2 string // Field3 *BarMessage // ... // } // // func (m *M) ProtoReflect() protoreflect.Message { // mi := &file_fizz_buzz_proto_msgInfos[5] // if protoimpl.UnsafeEnabled && m != nil { // ms := protoimpl.X.MessageStateOf(Pointer(m)) // if ms.LoadMessageInfo() == nil { // ms.StoreMessageInfo(mi) // } // return ms // } // return mi.MessageOf(m) // } // // The MessageState type holds a *MessageInfo, which must be atomically set to // the message info associated with a given message instance. // By unsafely converting a *M into a *MessageState, the MessageState object // has access to all the information needed to implement protobuf reflection. // It has access to the message info as its first field, and a pointer to the // MessageState is identical to a pointer to the concrete message value. // // Requirements: // - The type M must implement protoreflect.ProtoMessage. // - The address of m must not be nil. // - The address of m and the address of m.state must be equal, // even though they are different Go types. type MessageState struct { pragma.NoUnkeyedLiterals pragma.DoNotCompare pragma.DoNotCopy atomicMessageInfo *MessageInfo } type messageState MessageState var ( _ protoreflect.Message = (*messageState)(nil) _ unwrapper = (*messageState)(nil) ) // messageDataType is a tuple of a pointer to the message data and // a pointer to the message type. It is a generalized way of providing a // reflective view over a message instance. The disadvantage of this approach // is the need to allocate this tuple of 16B. type messageDataType struct { p pointer mi *MessageInfo } type ( messageReflectWrapper messageDataType messageIfaceWrapper messageDataType ) var ( _ protoreflect.Message = (*messageReflectWrapper)(nil) _ unwrapper = (*messageReflectWrapper)(nil) _ protoreflect.ProtoMessage = (*messageIfaceWrapper)(nil) _ unwrapper = (*messageIfaceWrapper)(nil) ) // MessageOf returns a reflective view over a message. The input must be a // pointer to a named Go struct. If the provided type has a ProtoReflect method, // it must be implemented by calling this method. func (mi *MessageInfo) MessageOf(m any) protoreflect.Message { if reflect.TypeOf(m) != mi.GoReflectType { panic(fmt.Sprintf("type mismatch: got %T, want %v", m, mi.GoReflectType)) } p := pointerOfIface(m) if p.IsNil() { return mi.nilMessage.Init(mi) } return &messageReflectWrapper{p, mi} } func (m *messageReflectWrapper) pointer() pointer { return m.p } func (m *messageReflectWrapper) messageInfo() *MessageInfo { return m.mi } // Reset implements the v1 proto.Message.Reset method. func (m *messageIfaceWrapper) Reset() { if mr, ok := m.protoUnwrap().(interface{ Reset() }); ok { mr.Reset() return } rv := reflect.ValueOf(m.protoUnwrap()) if rv.Kind() == reflect.Ptr && !rv.IsNil() { rv.Elem().Set(reflect.Zero(rv.Type().Elem())) } } func (m *messageIfaceWrapper) ProtoReflect() protoreflect.Message { return (*messageReflectWrapper)(m) } func (m *messageIfaceWrapper) protoUnwrap() any { return m.p.AsIfaceOf(m.mi.GoReflectType.Elem()) } // checkField verifies that the provided field descriptor is valid. // Exactly one of the returned values is populated. func (mi *MessageInfo) checkField(fd protoreflect.FieldDescriptor) (*fieldInfo, protoreflect.ExtensionTypeDescriptor) { var fi *fieldInfo if n := fd.Number(); 0 < n && int(n) < len(mi.denseFields) { fi = mi.denseFields[n] } else { fi = mi.fields[n] } if fi != nil { if fi.fieldDesc != fd { if got, want := fd.FullName(), fi.fieldDesc.FullName(); got != want { panic(fmt.Sprintf("mismatching field: got %v, want %v", got, want)) } panic(fmt.Sprintf("mismatching field: %v", fd.FullName())) } return fi, nil } if fd.IsExtension() { if got, want := fd.ContainingMessage().FullName(), mi.Desc.FullName(); got != want { // TODO: Should this be exact containing message descriptor match? panic(fmt.Sprintf("extension %v has mismatching containing message: got %v, want %v", fd.FullName(), got, want)) } if !mi.Desc.ExtensionRanges().Has(fd.Number()) { panic(fmt.Sprintf("extension %v extends %v outside the extension range", fd.FullName(), mi.Desc.FullName())) } xtd, ok := fd.(protoreflect.ExtensionTypeDescriptor) if !ok { panic(fmt.Sprintf("extension %v does not implement protoreflect.ExtensionTypeDescriptor", fd.FullName())) } return nil, xtd } panic(fmt.Sprintf("field %v is invalid", fd.FullName())) } ================================================ FILE: vendor/google.golang.org/protobuf/internal/impl/message_reflect_field.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package impl import ( "fmt" "math" "reflect" "google.golang.org/protobuf/reflect/protoreflect" ) type fieldInfo struct { fieldDesc protoreflect.FieldDescriptor // These fields are used for protobuf reflection support. has func(pointer) bool clear func(pointer) get func(pointer) protoreflect.Value set func(pointer, protoreflect.Value) mutable func(pointer) protoreflect.Value newMessage func() protoreflect.Message newField func() protoreflect.Value } func fieldInfoForMissing(fd protoreflect.FieldDescriptor) fieldInfo { // This never occurs for generated message types. // It implies that a hand-crafted type has missing Go fields // for specific protobuf message fields. return fieldInfo{ fieldDesc: fd, has: func(p pointer) bool { return false }, clear: func(p pointer) { panic("missing Go struct field for " + string(fd.FullName())) }, get: func(p pointer) protoreflect.Value { return fd.Default() }, set: func(p pointer, v protoreflect.Value) { panic("missing Go struct field for " + string(fd.FullName())) }, mutable: func(p pointer) protoreflect.Value { panic("missing Go struct field for " + string(fd.FullName())) }, newMessage: func() protoreflect.Message { panic("missing Go struct field for " + string(fd.FullName())) }, newField: func() protoreflect.Value { if v := fd.Default(); v.IsValid() { return v } panic("missing Go struct field for " + string(fd.FullName())) }, } } func fieldInfoForOneof(fd protoreflect.FieldDescriptor, fs reflect.StructField, x exporter, ot reflect.Type) fieldInfo { ft := fs.Type if ft.Kind() != reflect.Interface { panic(fmt.Sprintf("field %v has invalid type: got %v, want interface kind", fd.FullName(), ft)) } if ot.Kind() != reflect.Struct { panic(fmt.Sprintf("field %v has invalid type: got %v, want struct kind", fd.FullName(), ot)) } if !reflect.PtrTo(ot).Implements(ft) { panic(fmt.Sprintf("field %v has invalid type: %v does not implement %v", fd.FullName(), ot, ft)) } conv := NewConverter(ot.Field(0).Type, fd) isMessage := fd.Message() != nil // TODO: Implement unsafe fast path? fieldOffset := offsetOf(fs) return fieldInfo{ // NOTE: The logic below intentionally assumes that oneof fields are // well-formatted. That is, the oneof interface never contains a // typed nil pointer to one of the wrapper structs. fieldDesc: fd, has: func(p pointer) bool { if p.IsNil() { return false } rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() if rv.IsNil() || rv.Elem().Type().Elem() != ot || rv.Elem().IsNil() { return false } return true }, clear: func(p pointer) { rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() if rv.IsNil() || rv.Elem().Type().Elem() != ot { // NOTE: We intentionally don't check for rv.Elem().IsNil() // so that (*OneofWrapperType)(nil) gets cleared to nil. return } rv.Set(reflect.Zero(rv.Type())) }, get: func(p pointer) protoreflect.Value { if p.IsNil() { return conv.Zero() } rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() if rv.IsNil() || rv.Elem().Type().Elem() != ot || rv.Elem().IsNil() { return conv.Zero() } rv = rv.Elem().Elem().Field(0) return conv.PBValueOf(rv) }, set: func(p pointer, v protoreflect.Value) { rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() if rv.IsNil() || rv.Elem().Type().Elem() != ot || rv.Elem().IsNil() { rv.Set(reflect.New(ot)) } rv = rv.Elem().Elem().Field(0) rv.Set(conv.GoValueOf(v)) }, mutable: func(p pointer) protoreflect.Value { if !isMessage { panic(fmt.Sprintf("field %v with invalid Mutable call on field with non-composite type", fd.FullName())) } rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() if rv.IsNil() || rv.Elem().Type().Elem() != ot || rv.Elem().IsNil() { rv.Set(reflect.New(ot)) } rv = rv.Elem().Elem().Field(0) if rv.Kind() == reflect.Ptr && rv.IsNil() { rv.Set(conv.GoValueOf(protoreflect.ValueOfMessage(conv.New().Message()))) } return conv.PBValueOf(rv) }, newMessage: func() protoreflect.Message { return conv.New().Message() }, newField: func() protoreflect.Value { return conv.New() }, } } func fieldInfoForMap(fd protoreflect.FieldDescriptor, fs reflect.StructField, x exporter) fieldInfo { ft := fs.Type if ft.Kind() != reflect.Map { panic(fmt.Sprintf("field %v has invalid type: got %v, want map kind", fd.FullName(), ft)) } conv := NewConverter(ft, fd) // TODO: Implement unsafe fast path? fieldOffset := offsetOf(fs) return fieldInfo{ fieldDesc: fd, has: func(p pointer) bool { if p.IsNil() { return false } rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() return rv.Len() > 0 }, clear: func(p pointer) { rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() rv.Set(reflect.Zero(rv.Type())) }, get: func(p pointer) protoreflect.Value { if p.IsNil() { return conv.Zero() } rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() if rv.Len() == 0 { return conv.Zero() } return conv.PBValueOf(rv) }, set: func(p pointer, v protoreflect.Value) { rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() pv := conv.GoValueOf(v) if pv.IsNil() { panic(fmt.Sprintf("map field %v cannot be set with read-only value", fd.FullName())) } rv.Set(pv) }, mutable: func(p pointer) protoreflect.Value { v := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() if v.IsNil() { v.Set(reflect.MakeMap(fs.Type)) } return conv.PBValueOf(v) }, newField: func() protoreflect.Value { return conv.New() }, } } func fieldInfoForList(fd protoreflect.FieldDescriptor, fs reflect.StructField, x exporter) fieldInfo { ft := fs.Type if ft.Kind() != reflect.Slice { panic(fmt.Sprintf("field %v has invalid type: got %v, want slice kind", fd.FullName(), ft)) } conv := NewConverter(reflect.PtrTo(ft), fd) // TODO: Implement unsafe fast path? fieldOffset := offsetOf(fs) return fieldInfo{ fieldDesc: fd, has: func(p pointer) bool { if p.IsNil() { return false } rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() return rv.Len() > 0 }, clear: func(p pointer) { rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() rv.Set(reflect.Zero(rv.Type())) }, get: func(p pointer) protoreflect.Value { if p.IsNil() { return conv.Zero() } rv := p.Apply(fieldOffset).AsValueOf(fs.Type) if rv.Elem().Len() == 0 { return conv.Zero() } return conv.PBValueOf(rv) }, set: func(p pointer, v protoreflect.Value) { rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() pv := conv.GoValueOf(v) if pv.IsNil() { panic(fmt.Sprintf("list field %v cannot be set with read-only value", fd.FullName())) } rv.Set(pv.Elem()) }, mutable: func(p pointer) protoreflect.Value { v := p.Apply(fieldOffset).AsValueOf(fs.Type) return conv.PBValueOf(v) }, newField: func() protoreflect.Value { return conv.New() }, } } var ( nilBytes = reflect.ValueOf([]byte(nil)) emptyBytes = reflect.ValueOf([]byte{}) ) func fieldInfoForScalar(fd protoreflect.FieldDescriptor, fs reflect.StructField, x exporter) fieldInfo { ft := fs.Type nullable := fd.HasPresence() isBytes := ft.Kind() == reflect.Slice && ft.Elem().Kind() == reflect.Uint8 var getter func(p pointer) protoreflect.Value if nullable { if ft.Kind() != reflect.Ptr && ft.Kind() != reflect.Slice { // This never occurs for generated message types. // Despite the protobuf type system specifying presence, // the Go field type cannot represent it. nullable = false } if ft.Kind() == reflect.Ptr { ft = ft.Elem() } } conv := NewConverter(ft, fd) fieldOffset := offsetOf(fs) // Generate specialized getter functions to avoid going through reflect.Value if nullable { getter = getterForNullableScalar(fd, fs, conv, fieldOffset) } else { getter = getterForDirectScalar(fd, fs, conv, fieldOffset) } return fieldInfo{ fieldDesc: fd, has: func(p pointer) bool { if p.IsNil() { return false } if nullable { return !p.Apply(fieldOffset).Elem().IsNil() } rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() switch rv.Kind() { case reflect.Bool: return rv.Bool() case reflect.Int32, reflect.Int64: return rv.Int() != 0 case reflect.Uint32, reflect.Uint64: return rv.Uint() != 0 case reflect.Float32, reflect.Float64: return rv.Float() != 0 || math.Signbit(rv.Float()) case reflect.String, reflect.Slice: return rv.Len() > 0 default: panic(fmt.Sprintf("field %v has invalid type: %v", fd.FullName(), rv.Type())) // should never happen } }, clear: func(p pointer) { rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() rv.Set(reflect.Zero(rv.Type())) }, get: getter, // TODO: Implement unsafe fast path for set? set: func(p pointer, v protoreflect.Value) { rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() if nullable && rv.Kind() == reflect.Ptr { if rv.IsNil() { rv.Set(reflect.New(ft)) } rv = rv.Elem() } rv.Set(conv.GoValueOf(v)) if isBytes && rv.Len() == 0 { if nullable { rv.Set(emptyBytes) // preserve presence } else { rv.Set(nilBytes) // do not preserve presence } } }, newField: func() protoreflect.Value { return conv.New() }, } } func fieldInfoForMessage(fd protoreflect.FieldDescriptor, fs reflect.StructField, x exporter) fieldInfo { ft := fs.Type conv := NewConverter(ft, fd) // TODO: Implement unsafe fast path? fieldOffset := offsetOf(fs) return fieldInfo{ fieldDesc: fd, has: func(p pointer) bool { if p.IsNil() { return false } rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() if fs.Type.Kind() != reflect.Ptr { return !rv.IsZero() } return !rv.IsNil() }, clear: func(p pointer) { rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() rv.Set(reflect.Zero(rv.Type())) }, get: func(p pointer) protoreflect.Value { if p.IsNil() { return conv.Zero() } rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() return conv.PBValueOf(rv) }, set: func(p pointer, v protoreflect.Value) { rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() rv.Set(conv.GoValueOf(v)) if fs.Type.Kind() == reflect.Ptr && rv.IsNil() { panic(fmt.Sprintf("field %v has invalid nil pointer", fd.FullName())) } }, mutable: func(p pointer) protoreflect.Value { rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() if fs.Type.Kind() == reflect.Ptr && rv.IsNil() { rv.Set(conv.GoValueOf(conv.New())) } return conv.PBValueOf(rv) }, newMessage: func() protoreflect.Message { return conv.New().Message() }, newField: func() protoreflect.Value { return conv.New() }, } } type oneofInfo struct { oneofDesc protoreflect.OneofDescriptor which func(pointer) protoreflect.FieldNumber } func makeOneofInfo(od protoreflect.OneofDescriptor, si structInfo, x exporter) *oneofInfo { oi := &oneofInfo{oneofDesc: od} if od.IsSynthetic() { fs := si.fieldsByNumber[od.Fields().Get(0).Number()] fieldOffset := offsetOf(fs) oi.which = func(p pointer) protoreflect.FieldNumber { if p.IsNil() { return 0 } rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() if rv.IsNil() { // valid on either *T or []byte return 0 } return od.Fields().Get(0).Number() } } else { fs := si.oneofsByName[od.Name()] fieldOffset := offsetOf(fs) oi.which = func(p pointer) protoreflect.FieldNumber { if p.IsNil() { return 0 } rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() if rv.IsNil() { return 0 } rv = rv.Elem() if rv.IsNil() { return 0 } return si.oneofWrappersByType[rv.Type().Elem()] } } return oi } ================================================ FILE: vendor/google.golang.org/protobuf/internal/impl/message_reflect_field_gen.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Code generated by generate-types. DO NOT EDIT. package impl import ( "reflect" "google.golang.org/protobuf/reflect/protoreflect" ) func getterForNullableScalar(fd protoreflect.FieldDescriptor, fs reflect.StructField, conv Converter, fieldOffset offset) func(p pointer) protoreflect.Value { ft := fs.Type if ft.Kind() == reflect.Ptr { ft = ft.Elem() } if fd.Kind() == protoreflect.EnumKind { elemType := fs.Type.Elem() // Enums for nullable types. return func(p pointer) protoreflect.Value { if p.IsNil() { return conv.Zero() } rv := p.Apply(fieldOffset).Elem().AsValueOf(elemType) if rv.IsNil() { return conv.Zero() } return conv.PBValueOf(rv.Elem()) } } switch ft.Kind() { case reflect.Bool: return func(p pointer) protoreflect.Value { if p.IsNil() { return conv.Zero() } x := p.Apply(fieldOffset).BoolPtr() if *x == nil { return conv.Zero() } return protoreflect.ValueOfBool(**x) } case reflect.Int32: return func(p pointer) protoreflect.Value { if p.IsNil() { return conv.Zero() } x := p.Apply(fieldOffset).Int32Ptr() if *x == nil { return conv.Zero() } return protoreflect.ValueOfInt32(**x) } case reflect.Uint32: return func(p pointer) protoreflect.Value { if p.IsNil() { return conv.Zero() } x := p.Apply(fieldOffset).Uint32Ptr() if *x == nil { return conv.Zero() } return protoreflect.ValueOfUint32(**x) } case reflect.Int64: return func(p pointer) protoreflect.Value { if p.IsNil() { return conv.Zero() } x := p.Apply(fieldOffset).Int64Ptr() if *x == nil { return conv.Zero() } return protoreflect.ValueOfInt64(**x) } case reflect.Uint64: return func(p pointer) protoreflect.Value { if p.IsNil() { return conv.Zero() } x := p.Apply(fieldOffset).Uint64Ptr() if *x == nil { return conv.Zero() } return protoreflect.ValueOfUint64(**x) } case reflect.Float32: return func(p pointer) protoreflect.Value { if p.IsNil() { return conv.Zero() } x := p.Apply(fieldOffset).Float32Ptr() if *x == nil { return conv.Zero() } return protoreflect.ValueOfFloat32(**x) } case reflect.Float64: return func(p pointer) protoreflect.Value { if p.IsNil() { return conv.Zero() } x := p.Apply(fieldOffset).Float64Ptr() if *x == nil { return conv.Zero() } return protoreflect.ValueOfFloat64(**x) } case reflect.String: if fd.Kind() == protoreflect.BytesKind { return func(p pointer) protoreflect.Value { if p.IsNil() { return conv.Zero() } x := p.Apply(fieldOffset).StringPtr() if *x == nil { return conv.Zero() } if len(**x) == 0 { return protoreflect.ValueOfBytes(nil) } return protoreflect.ValueOfBytes([]byte(**x)) } } return func(p pointer) protoreflect.Value { if p.IsNil() { return conv.Zero() } x := p.Apply(fieldOffset).StringPtr() if *x == nil { return conv.Zero() } return protoreflect.ValueOfString(**x) } case reflect.Slice: if fd.Kind() == protoreflect.StringKind { return func(p pointer) protoreflect.Value { if p.IsNil() { return conv.Zero() } x := p.Apply(fieldOffset).Bytes() if len(*x) == 0 { return conv.Zero() } return protoreflect.ValueOfString(string(*x)) } } return func(p pointer) protoreflect.Value { if p.IsNil() { return conv.Zero() } x := p.Apply(fieldOffset).Bytes() if *x == nil { return conv.Zero() } return protoreflect.ValueOfBytes(*x) } } panic("unexpected protobuf kind: " + ft.Kind().String()) } func getterForDirectScalar(fd protoreflect.FieldDescriptor, fs reflect.StructField, conv Converter, fieldOffset offset) func(p pointer) protoreflect.Value { ft := fs.Type if fd.Kind() == protoreflect.EnumKind { // Enums for non nullable types. return func(p pointer) protoreflect.Value { if p.IsNil() { return conv.Zero() } rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() return conv.PBValueOf(rv) } } switch ft.Kind() { case reflect.Bool: return func(p pointer) protoreflect.Value { if p.IsNil() { return conv.Zero() } x := p.Apply(fieldOffset).Bool() return protoreflect.ValueOfBool(*x) } case reflect.Int32: return func(p pointer) protoreflect.Value { if p.IsNil() { return conv.Zero() } x := p.Apply(fieldOffset).Int32() return protoreflect.ValueOfInt32(*x) } case reflect.Uint32: return func(p pointer) protoreflect.Value { if p.IsNil() { return conv.Zero() } x := p.Apply(fieldOffset).Uint32() return protoreflect.ValueOfUint32(*x) } case reflect.Int64: return func(p pointer) protoreflect.Value { if p.IsNil() { return conv.Zero() } x := p.Apply(fieldOffset).Int64() return protoreflect.ValueOfInt64(*x) } case reflect.Uint64: return func(p pointer) protoreflect.Value { if p.IsNil() { return conv.Zero() } x := p.Apply(fieldOffset).Uint64() return protoreflect.ValueOfUint64(*x) } case reflect.Float32: return func(p pointer) protoreflect.Value { if p.IsNil() { return conv.Zero() } x := p.Apply(fieldOffset).Float32() return protoreflect.ValueOfFloat32(*x) } case reflect.Float64: return func(p pointer) protoreflect.Value { if p.IsNil() { return conv.Zero() } x := p.Apply(fieldOffset).Float64() return protoreflect.ValueOfFloat64(*x) } case reflect.String: if fd.Kind() == protoreflect.BytesKind { return func(p pointer) protoreflect.Value { if p.IsNil() { return conv.Zero() } x := p.Apply(fieldOffset).String() if len(*x) == 0 { return protoreflect.ValueOfBytes(nil) } return protoreflect.ValueOfBytes([]byte(*x)) } } return func(p pointer) protoreflect.Value { if p.IsNil() { return conv.Zero() } x := p.Apply(fieldOffset).String() return protoreflect.ValueOfString(*x) } case reflect.Slice: if fd.Kind() == protoreflect.StringKind { return func(p pointer) protoreflect.Value { if p.IsNil() { return conv.Zero() } x := p.Apply(fieldOffset).Bytes() return protoreflect.ValueOfString(string(*x)) } } return func(p pointer) protoreflect.Value { if p.IsNil() { return conv.Zero() } x := p.Apply(fieldOffset).Bytes() return protoreflect.ValueOfBytes(*x) } } panic("unexpected protobuf kind: " + ft.Kind().String()) } ================================================ FILE: vendor/google.golang.org/protobuf/internal/impl/message_reflect_gen.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Code generated by generate-types. DO NOT EDIT. package impl import ( "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/runtime/protoiface" ) func (m *messageState) Descriptor() protoreflect.MessageDescriptor { return m.messageInfo().Desc } func (m *messageState) Type() protoreflect.MessageType { return m.messageInfo() } func (m *messageState) New() protoreflect.Message { return m.messageInfo().New() } func (m *messageState) Interface() protoreflect.ProtoMessage { return m.protoUnwrap().(protoreflect.ProtoMessage) } func (m *messageState) protoUnwrap() any { return m.pointer().AsIfaceOf(m.messageInfo().GoReflectType.Elem()) } func (m *messageState) ProtoMethods() *protoiface.Methods { mi := m.messageInfo() mi.init() return &mi.methods } // ProtoMessageInfo is a pseudo-internal API for allowing the v1 code // to be able to retrieve a v2 MessageInfo struct. // // WARNING: This method is exempt from the compatibility promise and // may be removed in the future without warning. func (m *messageState) ProtoMessageInfo() *MessageInfo { return m.messageInfo() } func (m *messageState) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { mi := m.messageInfo() mi.init() for _, ri := range mi.rangeInfos { switch ri := ri.(type) { case *fieldInfo: if ri.has(m.pointer()) { if !f(ri.fieldDesc, ri.get(m.pointer())) { return } } case *oneofInfo: if n := ri.which(m.pointer()); n > 0 { fi := mi.fields[n] if !f(fi.fieldDesc, fi.get(m.pointer())) { return } } } } mi.extensionMap(m.pointer()).Range(f) } func (m *messageState) Has(fd protoreflect.FieldDescriptor) bool { mi := m.messageInfo() mi.init() if fi, xd := mi.checkField(fd); fi != nil { return fi.has(m.pointer()) } else { return mi.extensionMap(m.pointer()).Has(xd) } } func (m *messageState) Clear(fd protoreflect.FieldDescriptor) { mi := m.messageInfo() mi.init() if fi, xd := mi.checkField(fd); fi != nil { fi.clear(m.pointer()) } else { mi.extensionMap(m.pointer()).Clear(xd) } } func (m *messageState) Get(fd protoreflect.FieldDescriptor) protoreflect.Value { mi := m.messageInfo() mi.init() if fi, xd := mi.checkField(fd); fi != nil { return fi.get(m.pointer()) } else { return mi.extensionMap(m.pointer()).Get(xd) } } func (m *messageState) Set(fd protoreflect.FieldDescriptor, v protoreflect.Value) { mi := m.messageInfo() mi.init() if fi, xd := mi.checkField(fd); fi != nil { fi.set(m.pointer(), v) } else { mi.extensionMap(m.pointer()).Set(xd, v) } } func (m *messageState) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { mi := m.messageInfo() mi.init() if fi, xd := mi.checkField(fd); fi != nil { return fi.mutable(m.pointer()) } else { return mi.extensionMap(m.pointer()).Mutable(xd) } } func (m *messageState) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { mi := m.messageInfo() mi.init() if fi, xd := mi.checkField(fd); fi != nil { return fi.newField() } else { return xd.Type().New() } } func (m *messageState) WhichOneof(od protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { mi := m.messageInfo() mi.init() if oi := mi.oneofs[od.Name()]; oi != nil && oi.oneofDesc == od { return od.Fields().ByNumber(oi.which(m.pointer())) } panic("invalid oneof descriptor " + string(od.FullName()) + " for message " + string(m.Descriptor().FullName())) } func (m *messageState) GetUnknown() protoreflect.RawFields { mi := m.messageInfo() mi.init() return mi.getUnknown(m.pointer()) } func (m *messageState) SetUnknown(b protoreflect.RawFields) { mi := m.messageInfo() mi.init() mi.setUnknown(m.pointer(), b) } func (m *messageState) IsValid() bool { return !m.pointer().IsNil() } func (m *messageReflectWrapper) Descriptor() protoreflect.MessageDescriptor { return m.messageInfo().Desc } func (m *messageReflectWrapper) Type() protoreflect.MessageType { return m.messageInfo() } func (m *messageReflectWrapper) New() protoreflect.Message { return m.messageInfo().New() } func (m *messageReflectWrapper) Interface() protoreflect.ProtoMessage { if m, ok := m.protoUnwrap().(protoreflect.ProtoMessage); ok { return m } return (*messageIfaceWrapper)(m) } func (m *messageReflectWrapper) protoUnwrap() any { return m.pointer().AsIfaceOf(m.messageInfo().GoReflectType.Elem()) } func (m *messageReflectWrapper) ProtoMethods() *protoiface.Methods { mi := m.messageInfo() mi.init() return &mi.methods } // ProtoMessageInfo is a pseudo-internal API for allowing the v1 code // to be able to retrieve a v2 MessageInfo struct. // // WARNING: This method is exempt from the compatibility promise and // may be removed in the future without warning. func (m *messageReflectWrapper) ProtoMessageInfo() *MessageInfo { return m.messageInfo() } func (m *messageReflectWrapper) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { mi := m.messageInfo() mi.init() for _, ri := range mi.rangeInfos { switch ri := ri.(type) { case *fieldInfo: if ri.has(m.pointer()) { if !f(ri.fieldDesc, ri.get(m.pointer())) { return } } case *oneofInfo: if n := ri.which(m.pointer()); n > 0 { fi := mi.fields[n] if !f(fi.fieldDesc, fi.get(m.pointer())) { return } } } } mi.extensionMap(m.pointer()).Range(f) } func (m *messageReflectWrapper) Has(fd protoreflect.FieldDescriptor) bool { mi := m.messageInfo() mi.init() if fi, xd := mi.checkField(fd); fi != nil { return fi.has(m.pointer()) } else { return mi.extensionMap(m.pointer()).Has(xd) } } func (m *messageReflectWrapper) Clear(fd protoreflect.FieldDescriptor) { mi := m.messageInfo() mi.init() if fi, xd := mi.checkField(fd); fi != nil { fi.clear(m.pointer()) } else { mi.extensionMap(m.pointer()).Clear(xd) } } func (m *messageReflectWrapper) Get(fd protoreflect.FieldDescriptor) protoreflect.Value { mi := m.messageInfo() mi.init() if fi, xd := mi.checkField(fd); fi != nil { return fi.get(m.pointer()) } else { return mi.extensionMap(m.pointer()).Get(xd) } } func (m *messageReflectWrapper) Set(fd protoreflect.FieldDescriptor, v protoreflect.Value) { mi := m.messageInfo() mi.init() if fi, xd := mi.checkField(fd); fi != nil { fi.set(m.pointer(), v) } else { mi.extensionMap(m.pointer()).Set(xd, v) } } func (m *messageReflectWrapper) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { mi := m.messageInfo() mi.init() if fi, xd := mi.checkField(fd); fi != nil { return fi.mutable(m.pointer()) } else { return mi.extensionMap(m.pointer()).Mutable(xd) } } func (m *messageReflectWrapper) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { mi := m.messageInfo() mi.init() if fi, xd := mi.checkField(fd); fi != nil { return fi.newField() } else { return xd.Type().New() } } func (m *messageReflectWrapper) WhichOneof(od protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { mi := m.messageInfo() mi.init() if oi := mi.oneofs[od.Name()]; oi != nil && oi.oneofDesc == od { return od.Fields().ByNumber(oi.which(m.pointer())) } panic("invalid oneof descriptor " + string(od.FullName()) + " for message " + string(m.Descriptor().FullName())) } func (m *messageReflectWrapper) GetUnknown() protoreflect.RawFields { mi := m.messageInfo() mi.init() return mi.getUnknown(m.pointer()) } func (m *messageReflectWrapper) SetUnknown(b protoreflect.RawFields) { mi := m.messageInfo() mi.init() mi.setUnknown(m.pointer(), b) } func (m *messageReflectWrapper) IsValid() bool { return !m.pointer().IsNil() } ================================================ FILE: vendor/google.golang.org/protobuf/internal/impl/pointer_unsafe.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package impl import ( "reflect" "sync/atomic" "unsafe" "google.golang.org/protobuf/internal/protolazy" ) const UnsafeEnabled = true // Pointer is an opaque pointer type. type Pointer unsafe.Pointer // offset represents the offset to a struct field, accessible from a pointer. // The offset is the byte offset to the field from the start of the struct. type offset uintptr // offsetOf returns a field offset for the struct field. func offsetOf(f reflect.StructField) offset { return offset(f.Offset) } // IsValid reports whether the offset is valid. func (f offset) IsValid() bool { return f != invalidOffset } // invalidOffset is an invalid field offset. var invalidOffset = ^offset(0) // zeroOffset is a noop when calling pointer.Apply. var zeroOffset = offset(0) // pointer is a pointer to a message struct or field. type pointer struct{ p unsafe.Pointer } // pointerOf returns p as a pointer. func pointerOf(p Pointer) pointer { return pointer{p: unsafe.Pointer(p)} } // pointerOfValue returns v as a pointer. func pointerOfValue(v reflect.Value) pointer { return pointer{p: unsafe.Pointer(v.Pointer())} } // pointerOfIface returns the pointer portion of an interface. func pointerOfIface(v any) pointer { type ifaceHeader struct { Type unsafe.Pointer Data unsafe.Pointer } return pointer{p: (*ifaceHeader)(unsafe.Pointer(&v)).Data} } // IsNil reports whether the pointer is nil. func (p pointer) IsNil() bool { return p.p == nil } // Apply adds an offset to the pointer to derive a new pointer // to a specified field. The pointer must be valid and pointing at a struct. func (p pointer) Apply(f offset) pointer { if p.IsNil() { panic("invalid nil pointer") } return pointer{p: unsafe.Pointer(uintptr(p.p) + uintptr(f))} } // AsValueOf treats p as a pointer to an object of type t and returns the value. // It is equivalent to reflect.ValueOf(p.AsIfaceOf(t)) func (p pointer) AsValueOf(t reflect.Type) reflect.Value { return reflect.NewAt(t, p.p) } // AsIfaceOf treats p as a pointer to an object of type t and returns the value. // It is equivalent to p.AsValueOf(t).Interface() func (p pointer) AsIfaceOf(t reflect.Type) any { // TODO: Use tricky unsafe magic to directly create ifaceHeader. return p.AsValueOf(t).Interface() } func (p pointer) Bool() *bool { return (*bool)(p.p) } func (p pointer) BoolPtr() **bool { return (**bool)(p.p) } func (p pointer) BoolSlice() *[]bool { return (*[]bool)(p.p) } func (p pointer) Int32() *int32 { return (*int32)(p.p) } func (p pointer) Int32Ptr() **int32 { return (**int32)(p.p) } func (p pointer) Int32Slice() *[]int32 { return (*[]int32)(p.p) } func (p pointer) Int64() *int64 { return (*int64)(p.p) } func (p pointer) Int64Ptr() **int64 { return (**int64)(p.p) } func (p pointer) Int64Slice() *[]int64 { return (*[]int64)(p.p) } func (p pointer) Uint32() *uint32 { return (*uint32)(p.p) } func (p pointer) Uint32Ptr() **uint32 { return (**uint32)(p.p) } func (p pointer) Uint32Slice() *[]uint32 { return (*[]uint32)(p.p) } func (p pointer) Uint64() *uint64 { return (*uint64)(p.p) } func (p pointer) Uint64Ptr() **uint64 { return (**uint64)(p.p) } func (p pointer) Uint64Slice() *[]uint64 { return (*[]uint64)(p.p) } func (p pointer) Float32() *float32 { return (*float32)(p.p) } func (p pointer) Float32Ptr() **float32 { return (**float32)(p.p) } func (p pointer) Float32Slice() *[]float32 { return (*[]float32)(p.p) } func (p pointer) Float64() *float64 { return (*float64)(p.p) } func (p pointer) Float64Ptr() **float64 { return (**float64)(p.p) } func (p pointer) Float64Slice() *[]float64 { return (*[]float64)(p.p) } func (p pointer) String() *string { return (*string)(p.p) } func (p pointer) StringPtr() **string { return (**string)(p.p) } func (p pointer) StringSlice() *[]string { return (*[]string)(p.p) } func (p pointer) Bytes() *[]byte { return (*[]byte)(p.p) } func (p pointer) BytesPtr() **[]byte { return (**[]byte)(p.p) } func (p pointer) BytesSlice() *[][]byte { return (*[][]byte)(p.p) } func (p pointer) Extensions() *map[int32]ExtensionField { return (*map[int32]ExtensionField)(p.p) } func (p pointer) LazyInfoPtr() **protolazy.XXX_lazyUnmarshalInfo { return (**protolazy.XXX_lazyUnmarshalInfo)(p.p) } func (p pointer) PresenceInfo() presence { return presence{P: p.p} } func (p pointer) Elem() pointer { return pointer{p: *(*unsafe.Pointer)(p.p)} } // PointerSlice loads []*T from p as a []pointer. // The value returned is aliased with the original slice. // This behavior differs from the implementation in pointer_reflect.go. func (p pointer) PointerSlice() []pointer { // Super-tricky - p should point to a []*T where T is a // message type. We load it as []pointer. return *(*[]pointer)(p.p) } // AppendPointerSlice appends v to p, which must be a []*T. func (p pointer) AppendPointerSlice(v pointer) { *(*[]pointer)(p.p) = append(*(*[]pointer)(p.p), v) } // SetPointer sets *p to v. func (p pointer) SetPointer(v pointer) { *(*unsafe.Pointer)(p.p) = (unsafe.Pointer)(v.p) } func (p pointer) growBoolSlice(addCap int) { sp := p.BoolSlice() s := make([]bool, 0, addCap+len(*sp)) s = s[:len(*sp)] copy(s, *sp) *sp = s } func (p pointer) growInt32Slice(addCap int) { sp := p.Int32Slice() s := make([]int32, 0, addCap+len(*sp)) s = s[:len(*sp)] copy(s, *sp) *sp = s } func (p pointer) growUint32Slice(addCap int) { p.growInt32Slice(addCap) } func (p pointer) growFloat32Slice(addCap int) { p.growInt32Slice(addCap) } func (p pointer) growInt64Slice(addCap int) { sp := p.Int64Slice() s := make([]int64, 0, addCap+len(*sp)) s = s[:len(*sp)] copy(s, *sp) *sp = s } func (p pointer) growUint64Slice(addCap int) { p.growInt64Slice(addCap) } func (p pointer) growFloat64Slice(addCap int) { p.growInt64Slice(addCap) } // Static check that MessageState does not exceed the size of a pointer. const _ = uint(unsafe.Sizeof(unsafe.Pointer(nil)) - unsafe.Sizeof(MessageState{})) func (Export) MessageStateOf(p Pointer) *messageState { // Super-tricky - see documentation on MessageState. return (*messageState)(unsafe.Pointer(p)) } func (ms *messageState) pointer() pointer { // Super-tricky - see documentation on MessageState. return pointer{p: unsafe.Pointer(ms)} } func (ms *messageState) messageInfo() *MessageInfo { mi := ms.LoadMessageInfo() if mi == nil { panic("invalid nil message info; this suggests memory corruption due to a race or shallow copy on the message struct") } return mi } func (ms *messageState) LoadMessageInfo() *MessageInfo { return (*MessageInfo)(atomic.LoadPointer((*unsafe.Pointer)(unsafe.Pointer(&ms.atomicMessageInfo)))) } func (ms *messageState) StoreMessageInfo(mi *MessageInfo) { atomic.StorePointer((*unsafe.Pointer)(unsafe.Pointer(&ms.atomicMessageInfo)), unsafe.Pointer(mi)) } type atomicNilMessage struct{ p unsafe.Pointer } // p is a *messageReflectWrapper func (m *atomicNilMessage) Init(mi *MessageInfo) *messageReflectWrapper { if p := atomic.LoadPointer(&m.p); p != nil { return (*messageReflectWrapper)(p) } w := &messageReflectWrapper{mi: mi} atomic.CompareAndSwapPointer(&m.p, nil, (unsafe.Pointer)(w)) return (*messageReflectWrapper)(atomic.LoadPointer(&m.p)) } ================================================ FILE: vendor/google.golang.org/protobuf/internal/impl/pointer_unsafe_opaque.go ================================================ // Copyright 2024 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package impl import ( "sync/atomic" "unsafe" ) func (p pointer) AtomicGetPointer() pointer { return pointer{p: atomic.LoadPointer((*unsafe.Pointer)(p.p))} } func (p pointer) AtomicSetPointer(v pointer) { atomic.StorePointer((*unsafe.Pointer)(p.p), v.p) } func (p pointer) AtomicSetNilPointer() { atomic.StorePointer((*unsafe.Pointer)(p.p), unsafe.Pointer(nil)) } func (p pointer) AtomicSetPointerIfNil(v pointer) pointer { if atomic.CompareAndSwapPointer((*unsafe.Pointer)(p.p), unsafe.Pointer(nil), v.p) { return v } return pointer{p: atomic.LoadPointer((*unsafe.Pointer)(p.p))} } type atomicV1MessageInfo struct{ p Pointer } func (mi *atomicV1MessageInfo) Get() Pointer { return Pointer(atomic.LoadPointer((*unsafe.Pointer)(&mi.p))) } func (mi *atomicV1MessageInfo) SetIfNil(p Pointer) Pointer { if atomic.CompareAndSwapPointer((*unsafe.Pointer)(&mi.p), nil, unsafe.Pointer(p)) { return p } return mi.Get() } ================================================ FILE: vendor/google.golang.org/protobuf/internal/impl/presence.go ================================================ // Copyright 2024 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package impl import ( "sync/atomic" "unsafe" ) // presenceSize represents the size of a presence set, which should be the largest index of the set+1 type presenceSize uint32 // presence is the internal representation of the bitmap array in a generated protobuf type presence struct { // This is a pointer to the beginning of an array of uint32 P unsafe.Pointer } func (p presence) toElem(num uint32) (ret *uint32) { const ( bitsPerByte = 8 siz = unsafe.Sizeof(*ret) ) // p.P points to an array of uint32, num is the bit in this array that the // caller wants to check/manipulate. Calculate the index in the array that // contains this specific bit. E.g.: 76 / 32 = 2 (integer division). offset := uintptr(num) / (siz * bitsPerByte) * siz return (*uint32)(unsafe.Pointer(uintptr(p.P) + offset)) } // Present checks for the presence of a specific field number in a presence set. func (p presence) Present(num uint32) bool { return Export{}.Present(p.toElem(num), num) } // SetPresent adds presence for a specific field number in a presence set. func (p presence) SetPresent(num uint32, size presenceSize) { Export{}.SetPresent(p.toElem(num), num, uint32(size)) } // SetPresentUnatomic adds presence for a specific field number in a presence set without using // atomic operations. Only to be called during unmarshaling. func (p presence) SetPresentUnatomic(num uint32, size presenceSize) { Export{}.SetPresentNonAtomic(p.toElem(num), num, uint32(size)) } // ClearPresent removes presence for a specific field number in a presence set. func (p presence) ClearPresent(num uint32) { Export{}.ClearPresent(p.toElem(num), num) } // LoadPresenceCache (together with PresentInCache) allows for a // cached version of checking for presence without re-reading the word // for every field. It is optimized for efficiency and assumes no // simltaneous mutation of the presence set (or at least does not have // a problem with simultaneous mutation giving inconsistent results). func (p presence) LoadPresenceCache() (current uint32) { if p.P == nil { return 0 } return atomic.LoadUint32((*uint32)(p.P)) } // PresentInCache reads presence from a cached word in the presence // bitmap. It caches up a new word if the bit is outside the // word. This is for really fast iteration through bitmaps in cases // where we either know that the bitmap will not be altered, or we // don't care about inconsistencies caused by simultaneous writes. func (p presence) PresentInCache(num uint32, cachedElement *uint32, current *uint32) bool { if num/32 != *cachedElement { o := uintptr(num/32) * unsafe.Sizeof(uint32(0)) q := (*uint32)(unsafe.Pointer(uintptr(p.P) + o)) *current = atomic.LoadUint32(q) *cachedElement = num / 32 } return (*current & (1 << (num % 32))) > 0 } // AnyPresent checks if any field is marked as present in the bitmap. func (p presence) AnyPresent(size presenceSize) bool { n := uintptr((size + 31) / 32) for j := uintptr(0); j < n; j++ { o := j * unsafe.Sizeof(uint32(0)) q := (*uint32)(unsafe.Pointer(uintptr(p.P) + o)) b := atomic.LoadUint32(q) if b > 0 { return true } } return false } // toRaceDetectData finds the preceding RaceDetectHookData in a // message by using pointer arithmetic. As the type of the presence // set (bitmap) varies with the number of fields in the protobuf, we // can not have a struct type containing the array and the // RaceDetectHookData. instead the RaceDetectHookData is placed // immediately before the bitmap array, and we find it by walking // backwards in the struct. // // This method is only called from the race-detect version of the code, // so RaceDetectHookData is never an empty struct. func (p presence) toRaceDetectData() *RaceDetectHookData { var template struct { d RaceDetectHookData a [1]uint32 } o := (uintptr(unsafe.Pointer(&template.a)) - uintptr(unsafe.Pointer(&template.d))) return (*RaceDetectHookData)(unsafe.Pointer(uintptr(p.P) - o)) } func atomicLoadShadowPresence(p **[]byte) *[]byte { return (*[]byte)(atomic.LoadPointer((*unsafe.Pointer)(unsafe.Pointer(p)))) } func atomicStoreShadowPresence(p **[]byte, v *[]byte) { atomic.CompareAndSwapPointer((*unsafe.Pointer)(unsafe.Pointer(p)), nil, unsafe.Pointer(v)) } // findPointerToRaceDetectData finds the preceding RaceDetectHookData // in a message by using pointer arithmetic. For the methods called // directy from generated code, we don't have a pointer to the // beginning of the presence set, but a pointer inside the array. As // we know the index of the bit we're manipulating (num), we can // calculate which element of the array ptr is pointing to. With that // information we find the preceding RaceDetectHookData and can // manipulate the shadow bitmap. // // This method is only called from the race-detect version of the // code, so RaceDetectHookData is never an empty struct. func findPointerToRaceDetectData(ptr *uint32, num uint32) *RaceDetectHookData { var template struct { d RaceDetectHookData a [1]uint32 } o := (uintptr(unsafe.Pointer(&template.a)) - uintptr(unsafe.Pointer(&template.d))) + uintptr(num/32)*unsafe.Sizeof(uint32(0)) return (*RaceDetectHookData)(unsafe.Pointer(uintptr(unsafe.Pointer(ptr)) - o)) } ================================================ FILE: vendor/google.golang.org/protobuf/internal/impl/validate.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package impl import ( "fmt" "math" "math/bits" "reflect" "unicode/utf8" "google.golang.org/protobuf/encoding/protowire" "google.golang.org/protobuf/internal/encoding/messageset" "google.golang.org/protobuf/internal/flags" "google.golang.org/protobuf/internal/genid" "google.golang.org/protobuf/internal/strs" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/reflect/protoregistry" "google.golang.org/protobuf/runtime/protoiface" ) // ValidationStatus is the result of validating the wire-format encoding of a message. type ValidationStatus int const ( // ValidationUnknown indicates that unmarshaling the message might succeed or fail. // The validator was unable to render a judgement. // // The only causes of this status are an aberrant message type appearing somewhere // in the message or a failure in the extension resolver. ValidationUnknown ValidationStatus = iota + 1 // ValidationInvalid indicates that unmarshaling the message will fail. ValidationInvalid // ValidationValid indicates that unmarshaling the message will succeed. ValidationValid // ValidationWrongWireType indicates that a validated field does not have // the expected wire type. ValidationWrongWireType ) func (v ValidationStatus) String() string { switch v { case ValidationUnknown: return "ValidationUnknown" case ValidationInvalid: return "ValidationInvalid" case ValidationValid: return "ValidationValid" default: return fmt.Sprintf("ValidationStatus(%d)", int(v)) } } // Validate determines whether the contents of the buffer are a valid wire encoding // of the message type. // // This function is exposed for testing. func Validate(mt protoreflect.MessageType, in protoiface.UnmarshalInput) (out protoiface.UnmarshalOutput, _ ValidationStatus) { mi, ok := mt.(*MessageInfo) if !ok { return out, ValidationUnknown } if in.Resolver == nil { in.Resolver = protoregistry.GlobalTypes } if in.Depth == 0 { in.Depth = protowire.DefaultRecursionLimit } o, st := mi.validate(in.Buf, 0, unmarshalOptions{ flags: in.Flags, resolver: in.Resolver, depth: in.Depth, }) if o.initialized { out.Flags |= protoiface.UnmarshalInitialized } return out, st } type validationInfo struct { mi *MessageInfo typ validationType keyType, valType validationType // For non-required fields, requiredBit is 0. // // For required fields, requiredBit's nth bit is set, where n is a // unique index in the range [0, MessageInfo.numRequiredFields). // // If there are more than 64 required fields, requiredBit is 0. requiredBit uint64 } type validationType uint8 const ( validationTypeOther validationType = iota validationTypeMessage validationTypeGroup validationTypeMap validationTypeRepeatedVarint validationTypeRepeatedFixed32 validationTypeRepeatedFixed64 validationTypeVarint validationTypeFixed32 validationTypeFixed64 validationTypeBytes validationTypeUTF8String validationTypeMessageSetItem ) func newFieldValidationInfo(mi *MessageInfo, si structInfo, fd protoreflect.FieldDescriptor, ft reflect.Type) validationInfo { var vi validationInfo switch { case fd.ContainingOneof() != nil && !fd.ContainingOneof().IsSynthetic(): switch fd.Kind() { case protoreflect.MessageKind: vi.typ = validationTypeMessage if ot, ok := si.oneofWrappersByNumber[fd.Number()]; ok { vi.mi = getMessageInfo(ot.Field(0).Type) } case protoreflect.GroupKind: vi.typ = validationTypeGroup if ot, ok := si.oneofWrappersByNumber[fd.Number()]; ok { vi.mi = getMessageInfo(ot.Field(0).Type) } case protoreflect.StringKind: if strs.EnforceUTF8(fd) { vi.typ = validationTypeUTF8String } } default: vi = newValidationInfo(fd, ft) } if fd.Cardinality() == protoreflect.Required { // Avoid overflow. The required field check is done with a 64-bit mask, with // any message containing more than 64 required fields always reported as // potentially uninitialized, so it is not important to get a precise count // of the required fields past 64. if mi.numRequiredFields < math.MaxUint8 { mi.numRequiredFields++ vi.requiredBit = 1 << (mi.numRequiredFields - 1) } } return vi } func newValidationInfo(fd protoreflect.FieldDescriptor, ft reflect.Type) validationInfo { var vi validationInfo switch { case fd.IsList(): switch fd.Kind() { case protoreflect.MessageKind: vi.typ = validationTypeMessage if ft.Kind() == reflect.Ptr { // Repeated opaque message fields are *[]*T. ft = ft.Elem() } if ft.Kind() == reflect.Slice { vi.mi = getMessageInfo(ft.Elem()) } case protoreflect.GroupKind: vi.typ = validationTypeGroup if ft.Kind() == reflect.Ptr { // Repeated opaque message fields are *[]*T. ft = ft.Elem() } if ft.Kind() == reflect.Slice { vi.mi = getMessageInfo(ft.Elem()) } case protoreflect.StringKind: vi.typ = validationTypeBytes if strs.EnforceUTF8(fd) { vi.typ = validationTypeUTF8String } default: switch wireTypes[fd.Kind()] { case protowire.VarintType: vi.typ = validationTypeRepeatedVarint case protowire.Fixed32Type: vi.typ = validationTypeRepeatedFixed32 case protowire.Fixed64Type: vi.typ = validationTypeRepeatedFixed64 } } case fd.IsMap(): vi.typ = validationTypeMap switch fd.MapKey().Kind() { case protoreflect.StringKind: if strs.EnforceUTF8(fd) { vi.keyType = validationTypeUTF8String } } switch fd.MapValue().Kind() { case protoreflect.MessageKind: vi.valType = validationTypeMessage if ft.Kind() == reflect.Map { vi.mi = getMessageInfo(ft.Elem()) } case protoreflect.StringKind: if strs.EnforceUTF8(fd) { vi.valType = validationTypeUTF8String } } default: switch fd.Kind() { case protoreflect.MessageKind: vi.typ = validationTypeMessage vi.mi = getMessageInfo(ft) case protoreflect.GroupKind: vi.typ = validationTypeGroup vi.mi = getMessageInfo(ft) case protoreflect.StringKind: vi.typ = validationTypeBytes if strs.EnforceUTF8(fd) { vi.typ = validationTypeUTF8String } default: switch wireTypes[fd.Kind()] { case protowire.VarintType: vi.typ = validationTypeVarint case protowire.Fixed32Type: vi.typ = validationTypeFixed32 case protowire.Fixed64Type: vi.typ = validationTypeFixed64 case protowire.BytesType: vi.typ = validationTypeBytes } } } return vi } func (mi *MessageInfo) validate(b []byte, groupTag protowire.Number, opts unmarshalOptions) (out unmarshalOutput, result ValidationStatus) { mi.init() type validationState struct { typ validationType keyType, valType validationType endGroup protowire.Number mi *MessageInfo tail []byte requiredMask uint64 } // Pre-allocate some slots to avoid repeated slice reallocation. states := make([]validationState, 0, 16) states = append(states, validationState{ typ: validationTypeMessage, mi: mi, }) if groupTag > 0 { states[0].typ = validationTypeGroup states[0].endGroup = groupTag } if opts.depth--; opts.depth < 0 { return out, ValidationInvalid } initialized := true start := len(b) State: for len(states) > 0 { st := &states[len(states)-1] for len(b) > 0 { // Parse the tag (field number and wire type). var tag uint64 if b[0] < 0x80 { tag = uint64(b[0]) b = b[1:] } else if len(b) >= 2 && b[1] < 128 { tag = uint64(b[0]&0x7f) + uint64(b[1])<<7 b = b[2:] } else { var n int tag, n = protowire.ConsumeVarint(b) if n < 0 { return out, ValidationInvalid } b = b[n:] } var num protowire.Number if n := tag >> 3; n < uint64(protowire.MinValidNumber) || n > uint64(protowire.MaxValidNumber) { return out, ValidationInvalid } else { num = protowire.Number(n) } wtyp := protowire.Type(tag & 7) if wtyp == protowire.EndGroupType { if st.endGroup == num { goto PopState } return out, ValidationInvalid } var vi validationInfo switch { case st.typ == validationTypeMap: switch num { case genid.MapEntry_Key_field_number: vi.typ = st.keyType case genid.MapEntry_Value_field_number: vi.typ = st.valType vi.mi = st.mi vi.requiredBit = 1 } case flags.ProtoLegacy && st.mi.isMessageSet: switch num { case messageset.FieldItem: vi.typ = validationTypeMessageSetItem } default: var f *coderFieldInfo if int(num) < len(st.mi.denseCoderFields) { f = st.mi.denseCoderFields[num] } else { f = st.mi.coderFields[num] } if f != nil { vi = f.validation break } // Possible extension field. // // TODO: We should return ValidationUnknown when: // 1. The resolver is not frozen. (More extensions may be added to it.) // 2. The resolver returns preg.NotFound. // In this case, a type added to the resolver in the future could cause // unmarshaling to begin failing. Supporting this requires some way to // determine if the resolver is frozen. xt, err := opts.resolver.FindExtensionByNumber(st.mi.Desc.FullName(), num) if err != nil && err != protoregistry.NotFound { return out, ValidationUnknown } if err == nil { vi = getExtensionFieldInfo(xt).validation } } if vi.requiredBit != 0 { // Check that the field has a compatible wire type. // We only need to consider non-repeated field types, // since repeated fields (and maps) can never be required. ok := false switch vi.typ { case validationTypeVarint: ok = wtyp == protowire.VarintType case validationTypeFixed32: ok = wtyp == protowire.Fixed32Type case validationTypeFixed64: ok = wtyp == protowire.Fixed64Type case validationTypeBytes, validationTypeUTF8String, validationTypeMessage: ok = wtyp == protowire.BytesType case validationTypeGroup: ok = wtyp == protowire.StartGroupType } if ok { st.requiredMask |= vi.requiredBit } } switch wtyp { case protowire.VarintType: if len(b) >= 10 { switch { case b[0] < 0x80: b = b[1:] case b[1] < 0x80: b = b[2:] case b[2] < 0x80: b = b[3:] case b[3] < 0x80: b = b[4:] case b[4] < 0x80: b = b[5:] case b[5] < 0x80: b = b[6:] case b[6] < 0x80: b = b[7:] case b[7] < 0x80: b = b[8:] case b[8] < 0x80: b = b[9:] case b[9] < 0x80 && b[9] < 2: b = b[10:] default: return out, ValidationInvalid } } else { switch { case len(b) > 0 && b[0] < 0x80: b = b[1:] case len(b) > 1 && b[1] < 0x80: b = b[2:] case len(b) > 2 && b[2] < 0x80: b = b[3:] case len(b) > 3 && b[3] < 0x80: b = b[4:] case len(b) > 4 && b[4] < 0x80: b = b[5:] case len(b) > 5 && b[5] < 0x80: b = b[6:] case len(b) > 6 && b[6] < 0x80: b = b[7:] case len(b) > 7 && b[7] < 0x80: b = b[8:] case len(b) > 8 && b[8] < 0x80: b = b[9:] case len(b) > 9 && b[9] < 2: b = b[10:] default: return out, ValidationInvalid } } continue State case protowire.BytesType: var size uint64 if len(b) >= 1 && b[0] < 0x80 { size = uint64(b[0]) b = b[1:] } else if len(b) >= 2 && b[1] < 128 { size = uint64(b[0]&0x7f) + uint64(b[1])<<7 b = b[2:] } else { var n int size, n = protowire.ConsumeVarint(b) if n < 0 { return out, ValidationInvalid } b = b[n:] } if size > uint64(len(b)) { return out, ValidationInvalid } v := b[:size] b = b[size:] switch vi.typ { case validationTypeMessage: if vi.mi == nil { return out, ValidationUnknown } vi.mi.init() fallthrough case validationTypeMap: if vi.mi != nil { vi.mi.init() } states = append(states, validationState{ typ: vi.typ, keyType: vi.keyType, valType: vi.valType, mi: vi.mi, tail: b, }) if vi.typ == validationTypeMessage || vi.typ == validationTypeGroup || vi.typ == validationTypeMap { if opts.depth--; opts.depth < 0 { return out, ValidationInvalid } } b = v continue State case validationTypeRepeatedVarint: // Packed field. for len(v) > 0 { _, n := protowire.ConsumeVarint(v) if n < 0 { return out, ValidationInvalid } v = v[n:] } case validationTypeRepeatedFixed32: // Packed field. if len(v)%4 != 0 { return out, ValidationInvalid } case validationTypeRepeatedFixed64: // Packed field. if len(v)%8 != 0 { return out, ValidationInvalid } case validationTypeUTF8String: if !utf8.Valid(v) { return out, ValidationInvalid } } case protowire.Fixed32Type: if len(b) < 4 { return out, ValidationInvalid } b = b[4:] case protowire.Fixed64Type: if len(b) < 8 { return out, ValidationInvalid } b = b[8:] case protowire.StartGroupType: switch { case vi.typ == validationTypeGroup: if vi.mi == nil { return out, ValidationUnknown } vi.mi.init() states = append(states, validationState{ typ: validationTypeGroup, mi: vi.mi, endGroup: num, }) if opts.depth--; opts.depth < 0 { return out, ValidationInvalid } continue State case flags.ProtoLegacy && vi.typ == validationTypeMessageSetItem: typeid, v, n, err := messageset.ConsumeFieldValue(b, false) if err != nil { return out, ValidationInvalid } xt, err := opts.resolver.FindExtensionByNumber(st.mi.Desc.FullName(), typeid) switch { case err == protoregistry.NotFound: b = b[n:] case err != nil: return out, ValidationUnknown default: xvi := getExtensionFieldInfo(xt).validation if xvi.mi != nil { xvi.mi.init() } states = append(states, validationState{ typ: xvi.typ, mi: xvi.mi, tail: b[n:], }) if xvi.typ == validationTypeMessage || xvi.typ == validationTypeGroup || xvi.typ == validationTypeMap { if opts.depth--; opts.depth < 0 { return out, ValidationInvalid } } b = v continue State } default: n := protowire.ConsumeFieldValue(num, wtyp, b) if n < 0 { return out, ValidationInvalid } b = b[n:] } default: return out, ValidationInvalid } } if st.endGroup != 0 { return out, ValidationInvalid } if len(b) != 0 { return out, ValidationInvalid } b = st.tail PopState: numRequiredFields := 0 switch st.typ { case validationTypeMessage, validationTypeGroup: numRequiredFields = int(st.mi.numRequiredFields) opts.depth++ case validationTypeMap: // If this is a map field with a message value that contains // required fields, require that the value be present. if st.mi != nil && st.mi.numRequiredFields > 0 { numRequiredFields = 1 } opts.depth++ } // If there are more than 64 required fields, this check will // always fail and we will report that the message is potentially // uninitialized. if numRequiredFields > 0 && bits.OnesCount64(st.requiredMask) != numRequiredFields { initialized = false } states = states[:len(states)-1] } out.n = start - len(b) if initialized { out.initialized = true } return out, ValidationValid } ================================================ FILE: vendor/google.golang.org/protobuf/internal/order/order.go ================================================ // Copyright 2020 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package order import ( "google.golang.org/protobuf/reflect/protoreflect" ) // FieldOrder specifies the ordering to visit message fields. // It is a function that reports whether x is ordered before y. type FieldOrder func(x, y protoreflect.FieldDescriptor) bool var ( // AnyFieldOrder specifies no specific field ordering. AnyFieldOrder FieldOrder = nil // LegacyFieldOrder sorts fields in the same ordering as emitted by // wire serialization in the github.com/golang/protobuf implementation. LegacyFieldOrder FieldOrder = func(x, y protoreflect.FieldDescriptor) bool { ox, oy := x.ContainingOneof(), y.ContainingOneof() inOneof := func(od protoreflect.OneofDescriptor) bool { return od != nil && !od.IsSynthetic() } // Extension fields sort before non-extension fields. if x.IsExtension() != y.IsExtension() { return x.IsExtension() && !y.IsExtension() } // Fields not within a oneof sort before those within a oneof. if inOneof(ox) != inOneof(oy) { return !inOneof(ox) && inOneof(oy) } // Fields in disjoint oneof sets are sorted by declaration index. if inOneof(ox) && inOneof(oy) && ox != oy { return ox.Index() < oy.Index() } // Fields sorted by field number. return x.Number() < y.Number() } // NumberFieldOrder sorts fields by their field number. NumberFieldOrder FieldOrder = func(x, y protoreflect.FieldDescriptor) bool { return x.Number() < y.Number() } // IndexNameFieldOrder sorts non-extension fields before extension fields. // Non-extensions are sorted according to their declaration index. // Extensions are sorted according to their full name. IndexNameFieldOrder FieldOrder = func(x, y protoreflect.FieldDescriptor) bool { // Non-extension fields sort before extension fields. if x.IsExtension() != y.IsExtension() { return !x.IsExtension() && y.IsExtension() } // Extensions sorted by fullname. if x.IsExtension() && y.IsExtension() { return x.FullName() < y.FullName() } // Non-extensions sorted by declaration index. return x.Index() < y.Index() } ) // KeyOrder specifies the ordering to visit map entries. // It is a function that reports whether x is ordered before y. type KeyOrder func(x, y protoreflect.MapKey) bool var ( // AnyKeyOrder specifies no specific key ordering. AnyKeyOrder KeyOrder = nil // GenericKeyOrder sorts false before true, numeric keys in ascending order, // and strings in lexicographical ordering according to UTF-8 codepoints. GenericKeyOrder KeyOrder = func(x, y protoreflect.MapKey) bool { switch x.Interface().(type) { case bool: return !x.Bool() && y.Bool() case int32, int64: return x.Int() < y.Int() case uint32, uint64: return x.Uint() < y.Uint() case string: return x.String() < y.String() default: panic("invalid map key type") } } ) ================================================ FILE: vendor/google.golang.org/protobuf/internal/order/range.go ================================================ // Copyright 2020 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package order provides ordered access to messages and maps. package order import ( "sort" "sync" "google.golang.org/protobuf/reflect/protoreflect" ) type messageField struct { fd protoreflect.FieldDescriptor v protoreflect.Value } var messageFieldPool = sync.Pool{ New: func() any { return new([]messageField) }, } type ( // FieldRnger is an interface for visiting all fields in a message. // The protoreflect.Message type implements this interface. FieldRanger interface{ Range(VisitField) } // VisitField is called every time a message field is visited. VisitField = func(protoreflect.FieldDescriptor, protoreflect.Value) bool ) // RangeFields iterates over the fields of fs according to the specified order. func RangeFields(fs FieldRanger, less FieldOrder, fn VisitField) { if less == nil { fs.Range(fn) return } // Obtain a pre-allocated scratch buffer. p := messageFieldPool.Get().(*[]messageField) fields := (*p)[:0] defer func() { if cap(fields) < 1024 { *p = fields messageFieldPool.Put(p) } }() // Collect all fields in the message and sort them. fs.Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool { fields = append(fields, messageField{fd, v}) return true }) sort.Slice(fields, func(i, j int) bool { return less(fields[i].fd, fields[j].fd) }) // Visit the fields in the specified ordering. for _, f := range fields { if !fn(f.fd, f.v) { return } } } type mapEntry struct { k protoreflect.MapKey v protoreflect.Value } var mapEntryPool = sync.Pool{ New: func() any { return new([]mapEntry) }, } type ( // EntryRanger is an interface for visiting all fields in a message. // The protoreflect.Map type implements this interface. EntryRanger interface{ Range(VisitEntry) } // VisitEntry is called every time a map entry is visited. VisitEntry = func(protoreflect.MapKey, protoreflect.Value) bool ) // RangeEntries iterates over the entries of es according to the specified order. func RangeEntries(es EntryRanger, less KeyOrder, fn VisitEntry) { if less == nil { es.Range(fn) return } // Obtain a pre-allocated scratch buffer. p := mapEntryPool.Get().(*[]mapEntry) entries := (*p)[:0] defer func() { if cap(entries) < 1024 { *p = entries mapEntryPool.Put(p) } }() // Collect all entries in the map and sort them. es.Range(func(k protoreflect.MapKey, v protoreflect.Value) bool { entries = append(entries, mapEntry{k, v}) return true }) sort.Slice(entries, func(i, j int) bool { return less(entries[i].k, entries[j].k) }) // Visit the entries in the specified ordering. for _, e := range entries { if !fn(e.k, e.v) { return } } } ================================================ FILE: vendor/google.golang.org/protobuf/internal/pragma/pragma.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package pragma provides types that can be embedded into a struct to // statically enforce or prevent certain language properties. package pragma import "sync" // NoUnkeyedLiterals can be embedded in a struct to prevent unkeyed literals. type NoUnkeyedLiterals struct{} // DoNotImplement can be embedded in an interface to prevent trivial // implementations of the interface. // // This is useful to prevent unauthorized implementations of an interface // so that it can be extended in the future for any protobuf language changes. type DoNotImplement interface{ ProtoInternal(DoNotImplement) } // DoNotCompare can be embedded in a struct to prevent comparability. type DoNotCompare [0]func() // DoNotCopy can be embedded in a struct to help prevent shallow copies. // This does not rely on a Go language feature, but rather a special case // within the vet checker. // // See https://golang.org/issues/8005. type DoNotCopy [0]sync.Mutex ================================================ FILE: vendor/google.golang.org/protobuf/internal/protolazy/bufferreader.go ================================================ // Copyright 2024 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Helper code for parsing a protocol buffer package protolazy import ( "errors" "fmt" "io" "google.golang.org/protobuf/encoding/protowire" ) // BufferReader is a structure encapsulating a protobuf and a current position type BufferReader struct { Buf []byte Pos int } // NewBufferReader creates a new BufferRead from a protobuf func NewBufferReader(buf []byte) BufferReader { return BufferReader{Buf: buf, Pos: 0} } var errOutOfBounds = errors.New("protobuf decoding: out of bounds") var errOverflow = errors.New("proto: integer overflow") func (b *BufferReader) DecodeVarintSlow() (x uint64, err error) { i := b.Pos l := len(b.Buf) for shift := uint(0); shift < 64; shift += 7 { if i >= l { err = io.ErrUnexpectedEOF return } v := b.Buf[i] i++ x |= (uint64(v) & 0x7F) << shift if v < 0x80 { b.Pos = i return } } // The number is too large to represent in a 64-bit value. err = errOverflow return } // decodeVarint decodes a varint at the current position func (b *BufferReader) DecodeVarint() (x uint64, err error) { i := b.Pos buf := b.Buf if i >= len(buf) { return 0, io.ErrUnexpectedEOF } else if buf[i] < 0x80 { b.Pos++ return uint64(buf[i]), nil } else if len(buf)-i < 10 { return b.DecodeVarintSlow() } var v uint64 // we already checked the first byte x = uint64(buf[i]) & 127 i++ v = uint64(buf[i]) i++ x |= (v & 127) << 7 if v < 128 { goto done } v = uint64(buf[i]) i++ x |= (v & 127) << 14 if v < 128 { goto done } v = uint64(buf[i]) i++ x |= (v & 127) << 21 if v < 128 { goto done } v = uint64(buf[i]) i++ x |= (v & 127) << 28 if v < 128 { goto done } v = uint64(buf[i]) i++ x |= (v & 127) << 35 if v < 128 { goto done } v = uint64(buf[i]) i++ x |= (v & 127) << 42 if v < 128 { goto done } v = uint64(buf[i]) i++ x |= (v & 127) << 49 if v < 128 { goto done } v = uint64(buf[i]) i++ x |= (v & 127) << 56 if v < 128 { goto done } v = uint64(buf[i]) i++ x |= (v & 127) << 63 if v < 128 { goto done } return 0, errOverflow done: b.Pos = i return } // decodeVarint32 decodes a varint32 at the current position func (b *BufferReader) DecodeVarint32() (x uint32, err error) { i := b.Pos buf := b.Buf if i >= len(buf) { return 0, io.ErrUnexpectedEOF } else if buf[i] < 0x80 { b.Pos++ return uint32(buf[i]), nil } else if len(buf)-i < 5 { v, err := b.DecodeVarintSlow() return uint32(v), err } var v uint32 // we already checked the first byte x = uint32(buf[i]) & 127 i++ v = uint32(buf[i]) i++ x |= (v & 127) << 7 if v < 128 { goto done } v = uint32(buf[i]) i++ x |= (v & 127) << 14 if v < 128 { goto done } v = uint32(buf[i]) i++ x |= (v & 127) << 21 if v < 128 { goto done } v = uint32(buf[i]) i++ x |= (v & 127) << 28 if v < 128 { goto done } return 0, errOverflow done: b.Pos = i return } // skipValue skips a value in the protobuf, based on the specified tag func (b *BufferReader) SkipValue(tag uint32) (err error) { wireType := tag & 0x7 switch protowire.Type(wireType) { case protowire.VarintType: err = b.SkipVarint() case protowire.Fixed64Type: err = b.SkipFixed64() case protowire.BytesType: var n uint32 n, err = b.DecodeVarint32() if err == nil { err = b.Skip(int(n)) } case protowire.StartGroupType: err = b.SkipGroup(tag) case protowire.Fixed32Type: err = b.SkipFixed32() default: err = fmt.Errorf("Unexpected wire type (%d)", wireType) } return } // skipGroup skips a group with the specified tag. It executes efficiently using a tag stack func (b *BufferReader) SkipGroup(tag uint32) (err error) { tagStack := make([]uint32, 0, 16) tagStack = append(tagStack, tag) var n uint32 for len(tagStack) > 0 { tag, err = b.DecodeVarint32() if err != nil { return err } switch protowire.Type(tag & 0x7) { case protowire.VarintType: err = b.SkipVarint() case protowire.Fixed64Type: err = b.Skip(8) case protowire.BytesType: n, err = b.DecodeVarint32() if err == nil { err = b.Skip(int(n)) } case protowire.StartGroupType: tagStack = append(tagStack, tag) case protowire.Fixed32Type: err = b.SkipFixed32() case protowire.EndGroupType: if protoFieldNumber(tagStack[len(tagStack)-1]) == protoFieldNumber(tag) { tagStack = tagStack[:len(tagStack)-1] } else { err = fmt.Errorf("end group tag %d does not match begin group tag %d at pos %d", protoFieldNumber(tag), protoFieldNumber(tagStack[len(tagStack)-1]), b.Pos) } } if err != nil { return err } } return nil } // skipVarint effiently skips a varint func (b *BufferReader) SkipVarint() (err error) { i := b.Pos if len(b.Buf)-i < 10 { // Use DecodeVarintSlow() to check for buffer overflow, but ignore result if _, err := b.DecodeVarintSlow(); err != nil { return err } return nil } if b.Buf[i] < 0x80 { goto out } i++ if b.Buf[i] < 0x80 { goto out } i++ if b.Buf[i] < 0x80 { goto out } i++ if b.Buf[i] < 0x80 { goto out } i++ if b.Buf[i] < 0x80 { goto out } i++ if b.Buf[i] < 0x80 { goto out } i++ if b.Buf[i] < 0x80 { goto out } i++ if b.Buf[i] < 0x80 { goto out } i++ if b.Buf[i] < 0x80 { goto out } i++ if b.Buf[i] < 0x80 { goto out } return errOverflow out: b.Pos = i + 1 return nil } // skip skips the specified number of bytes func (b *BufferReader) Skip(n int) (err error) { if len(b.Buf) < b.Pos+n { return io.ErrUnexpectedEOF } b.Pos += n return } // skipFixed64 skips a fixed64 func (b *BufferReader) SkipFixed64() (err error) { return b.Skip(8) } // skipFixed32 skips a fixed32 func (b *BufferReader) SkipFixed32() (err error) { return b.Skip(4) } // skipBytes skips a set of bytes func (b *BufferReader) SkipBytes() (err error) { n, err := b.DecodeVarint32() if err != nil { return err } return b.Skip(int(n)) } // Done returns whether we are at the end of the protobuf func (b *BufferReader) Done() bool { return b.Pos == len(b.Buf) } // Remaining returns how many bytes remain func (b *BufferReader) Remaining() int { return len(b.Buf) - b.Pos } ================================================ FILE: vendor/google.golang.org/protobuf/internal/protolazy/lazy.go ================================================ // Copyright 2024 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package protolazy contains internal data structures for lazy message decoding. package protolazy import ( "fmt" "sort" "google.golang.org/protobuf/encoding/protowire" piface "google.golang.org/protobuf/runtime/protoiface" ) // IndexEntry is the structure for an index of the fields in a message of a // proto (not descending to sub-messages) type IndexEntry struct { FieldNum uint32 // first byte of this tag/field Start uint32 // first byte after a contiguous sequence of bytes for this tag/field, which could // include a single encoding of the field, or multiple encodings for the field End uint32 // True if this protobuf segment includes multiple encodings of the field MultipleContiguous bool } // XXX_lazyUnmarshalInfo has information about a particular lazily decoded message // // Deprecated: Do not use. This will be deleted in the near future. type XXX_lazyUnmarshalInfo struct { // Index of fields and their positions in the protobuf for this // message. Make index be a pointer to a slice so it can be updated // atomically. The index pointer is only set once (lazily when/if // the index is first needed), and must always be SET and LOADED // ATOMICALLY. index *[]IndexEntry // The protobuf associated with this lazily decoded message. It is // only set during proto.Unmarshal(). It doesn't need to be set and // loaded atomically, since any simultaneous set (Unmarshal) and read // (during a get) would already be a race in the app code. Protobuf []byte // The flags present when Unmarshal was originally called for this particular message unmarshalFlags piface.UnmarshalInputFlags } // The Buffer and SetBuffer methods let v2/internal/impl interact with // XXX_lazyUnmarshalInfo via an interface, to avoid an import cycle. // Buffer returns the lazy unmarshal buffer. // // Deprecated: Do not use. This will be deleted in the near future. func (lazy *XXX_lazyUnmarshalInfo) Buffer() []byte { return lazy.Protobuf } // SetBuffer sets the lazy unmarshal buffer. // // Deprecated: Do not use. This will be deleted in the near future. func (lazy *XXX_lazyUnmarshalInfo) SetBuffer(b []byte) { lazy.Protobuf = b } // SetUnmarshalFlags is called to set a copy of the original unmarshalInputFlags. // The flags should reflect how Unmarshal was called. func (lazy *XXX_lazyUnmarshalInfo) SetUnmarshalFlags(f piface.UnmarshalInputFlags) { lazy.unmarshalFlags = f } // UnmarshalFlags returns the original unmarshalInputFlags. func (lazy *XXX_lazyUnmarshalInfo) UnmarshalFlags() piface.UnmarshalInputFlags { return lazy.unmarshalFlags } // AllowedPartial returns true if the user originally unmarshalled this message with // AllowPartial set to true func (lazy *XXX_lazyUnmarshalInfo) AllowedPartial() bool { return (lazy.unmarshalFlags & piface.UnmarshalCheckRequired) == 0 } func protoFieldNumber(tag uint32) uint32 { return tag >> 3 } // buildIndex builds an index of the specified protobuf, return the index // array and an error. func buildIndex(buf []byte) ([]IndexEntry, error) { index := make([]IndexEntry, 0, 16) var lastProtoFieldNum uint32 var outOfOrder bool var r BufferReader = NewBufferReader(buf) for !r.Done() { var tag uint32 var err error var curPos = r.Pos // INLINED: tag, err = r.DecodeVarint32() { i := r.Pos buf := r.Buf if i >= len(buf) { return nil, errOutOfBounds } else if buf[i] < 0x80 { r.Pos++ tag = uint32(buf[i]) } else if r.Remaining() < 5 { var v uint64 v, err = r.DecodeVarintSlow() tag = uint32(v) } else { var v uint32 // we already checked the first byte tag = uint32(buf[i]) & 127 i++ v = uint32(buf[i]) i++ tag |= (v & 127) << 7 if v < 128 { goto done } v = uint32(buf[i]) i++ tag |= (v & 127) << 14 if v < 128 { goto done } v = uint32(buf[i]) i++ tag |= (v & 127) << 21 if v < 128 { goto done } v = uint32(buf[i]) i++ tag |= (v & 127) << 28 if v < 128 { goto done } return nil, errOutOfBounds done: r.Pos = i } } // DONE: tag, err = r.DecodeVarint32() fieldNum := protoFieldNumber(tag) if fieldNum < lastProtoFieldNum { outOfOrder = true } // Skip the current value -- will skip over an entire group as well. // INLINED: err = r.SkipValue(tag) wireType := tag & 0x7 switch protowire.Type(wireType) { case protowire.VarintType: // INLINED: err = r.SkipVarint() i := r.Pos if len(r.Buf)-i < 10 { // Use DecodeVarintSlow() to skip while // checking for buffer overflow, but ignore result _, err = r.DecodeVarintSlow() goto out2 } if r.Buf[i] < 0x80 { goto out } i++ if r.Buf[i] < 0x80 { goto out } i++ if r.Buf[i] < 0x80 { goto out } i++ if r.Buf[i] < 0x80 { goto out } i++ if r.Buf[i] < 0x80 { goto out } i++ if r.Buf[i] < 0x80 { goto out } i++ if r.Buf[i] < 0x80 { goto out } i++ if r.Buf[i] < 0x80 { goto out } i++ if r.Buf[i] < 0x80 { goto out } i++ if r.Buf[i] < 0x80 { goto out } return nil, errOverflow out: r.Pos = i + 1 // DONE: err = r.SkipVarint() case protowire.Fixed64Type: err = r.SkipFixed64() case protowire.BytesType: var n uint32 n, err = r.DecodeVarint32() if err == nil { err = r.Skip(int(n)) } case protowire.StartGroupType: err = r.SkipGroup(tag) case protowire.Fixed32Type: err = r.SkipFixed32() default: err = fmt.Errorf("Unexpected wire type (%d)", wireType) } // DONE: err = r.SkipValue(tag) out2: if err != nil { return nil, err } if fieldNum != lastProtoFieldNum { index = append(index, IndexEntry{FieldNum: fieldNum, Start: uint32(curPos), End: uint32(r.Pos)}, ) } else { index[len(index)-1].End = uint32(r.Pos) index[len(index)-1].MultipleContiguous = true } lastProtoFieldNum = fieldNum } if outOfOrder { sort.Slice(index, func(i, j int) bool { return index[i].FieldNum < index[j].FieldNum || (index[i].FieldNum == index[j].FieldNum && index[i].Start < index[j].Start) }) } return index, nil } func (lazy *XXX_lazyUnmarshalInfo) SizeField(num uint32) (size int) { start, end, found, _, multipleEntries := lazy.FindFieldInProto(num) if multipleEntries != nil { for _, entry := range multipleEntries { size += int(entry.End - entry.Start) } return size } if !found { return 0 } return int(end - start) } func (lazy *XXX_lazyUnmarshalInfo) AppendField(b []byte, num uint32) ([]byte, bool) { start, end, found, _, multipleEntries := lazy.FindFieldInProto(num) if multipleEntries != nil { for _, entry := range multipleEntries { b = append(b, lazy.Protobuf[entry.Start:entry.End]...) } return b, true } if !found { return nil, false } b = append(b, lazy.Protobuf[start:end]...) return b, true } func (lazy *XXX_lazyUnmarshalInfo) SetIndex(index []IndexEntry) { atomicStoreIndex(&lazy.index, &index) } // FindFieldInProto looks for field fieldNum in lazyUnmarshalInfo information // (including protobuf), returns startOffset/endOffset/found. func (lazy *XXX_lazyUnmarshalInfo) FindFieldInProto(fieldNum uint32) (start, end uint32, found, multipleContiguous bool, multipleEntries []IndexEntry) { if lazy.Protobuf == nil { // There is no backing protobuf for this message -- it was made from a builder return 0, 0, false, false, nil } index := atomicLoadIndex(&lazy.index) if index == nil { r, err := buildIndex(lazy.Protobuf) if err != nil { panic(fmt.Sprintf("findFieldInfo: error building index when looking for field %d: %v", fieldNum, err)) } // lazy.index is a pointer to the slice returned by BuildIndex index = &r atomicStoreIndex(&lazy.index, index) } return lookupField(index, fieldNum) } // lookupField returns the offset at which the indicated field starts using // the index, offset immediately after field ends (including all instances of // a repeated field), and bools indicating if field was found and if there // are multiple encodings of the field in the byte range. // // To hande the uncommon case where there are repeated encodings for the same // field which are not consecutive in the protobuf (so we need to returns // multiple start/end offsets), we also return a slice multipleEntries. If // multipleEntries is non-nil, then multiple entries were found, and the // values in the slice should be used, rather than start/end/found. func lookupField(indexp *[]IndexEntry, fieldNum uint32) (start, end uint32, found bool, multipleContiguous bool, multipleEntries []IndexEntry) { // The pointer indexp to the index was already loaded atomically. // The slice is uniquely associated with the pointer, so it doesn't // need to be loaded atomically. index := *indexp for i, entry := range index { if fieldNum == entry.FieldNum { if i < len(index)-1 && entry.FieldNum == index[i+1].FieldNum { // Handle the uncommon case where there are // repeated entries for the same field which // are not contiguous in the protobuf. multiple := make([]IndexEntry, 1, 2) multiple[0] = IndexEntry{fieldNum, entry.Start, entry.End, entry.MultipleContiguous} i++ for i < len(index) && index[i].FieldNum == fieldNum { multiple = append(multiple, IndexEntry{fieldNum, index[i].Start, index[i].End, index[i].MultipleContiguous}) i++ } return 0, 0, false, false, multiple } return entry.Start, entry.End, true, entry.MultipleContiguous, nil } if fieldNum < entry.FieldNum { return 0, 0, false, false, nil } } return 0, 0, false, false, nil } ================================================ FILE: vendor/google.golang.org/protobuf/internal/protolazy/pointer_unsafe.go ================================================ // Copyright 2024 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package protolazy import ( "sync/atomic" "unsafe" ) func atomicLoadIndex(p **[]IndexEntry) *[]IndexEntry { return (*[]IndexEntry)(atomic.LoadPointer((*unsafe.Pointer)(unsafe.Pointer(p)))) } func atomicStoreIndex(p **[]IndexEntry, v *[]IndexEntry) { atomic.StorePointer((*unsafe.Pointer)(unsafe.Pointer(p)), unsafe.Pointer(v)) } ================================================ FILE: vendor/google.golang.org/protobuf/internal/set/ints.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package set provides simple set data structures for uint64s. package set import "math/bits" // int64s represents a set of integers within the range of 0..63. type int64s uint64 func (bs *int64s) Len() int { return bits.OnesCount64(uint64(*bs)) } func (bs *int64s) Has(n uint64) bool { return uint64(*bs)&(uint64(1)< 0 } func (bs *int64s) Set(n uint64) { *(*uint64)(bs) |= uint64(1) << n } func (bs *int64s) Clear(n uint64) { *(*uint64)(bs) &^= uint64(1) << n } // Ints represents a set of integers within the range of 0..math.MaxUint64. type Ints struct { lo int64s hi map[uint64]struct{} } func (bs *Ints) Len() int { return bs.lo.Len() + len(bs.hi) } func (bs *Ints) Has(n uint64) bool { if n < 64 { return bs.lo.Has(n) } _, ok := bs.hi[n] return ok } func (bs *Ints) Set(n uint64) { if n < 64 { bs.lo.Set(n) return } if bs.hi == nil { bs.hi = make(map[uint64]struct{}) } bs.hi[n] = struct{}{} } func (bs *Ints) Clear(n uint64) { if n < 64 { bs.lo.Clear(n) return } delete(bs.hi, n) } ================================================ FILE: vendor/google.golang.org/protobuf/internal/strs/strings.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package strs provides string manipulation functionality specific to protobuf. package strs import ( "go/token" "strings" "unicode" "unicode/utf8" "google.golang.org/protobuf/internal/flags" "google.golang.org/protobuf/reflect/protoreflect" ) // EnforceUTF8 reports whether to enforce strict UTF-8 validation. func EnforceUTF8(fd protoreflect.FieldDescriptor) bool { if flags.ProtoLegacy || fd.Syntax() == protoreflect.Editions { if fd, ok := fd.(interface{ EnforceUTF8() bool }); ok { return fd.EnforceUTF8() } } return fd.Syntax() == protoreflect.Proto3 } // GoCamelCase camel-cases a protobuf name for use as a Go identifier. // // If there is an interior underscore followed by a lower case letter, // drop the underscore and convert the letter to upper case. func GoCamelCase(s string) string { // Invariant: if the next letter is lower case, it must be converted // to upper case. // That is, we process a word at a time, where words are marked by _ or // upper case letter. Digits are treated as words. var b []byte for i := 0; i < len(s); i++ { c := s[i] switch { case c == '.' && i+1 < len(s) && isASCIILower(s[i+1]): // Skip over '.' in ".{{lowercase}}". case c == '.': b = append(b, '_') // convert '.' to '_' case c == '_' && (i == 0 || s[i-1] == '.'): // Convert initial '_' to ensure we start with a capital letter. // Do the same for '_' after '.' to match historic behavior. b = append(b, 'X') // convert '_' to 'X' case c == '_' && i+1 < len(s) && isASCIILower(s[i+1]): // Skip over '_' in "_{{lowercase}}". case isASCIIDigit(c): b = append(b, c) default: // Assume we have a letter now - if not, it's a bogus identifier. // The next word is a sequence of characters that must start upper case. if isASCIILower(c) { c -= 'a' - 'A' // convert lowercase to uppercase } b = append(b, c) // Accept lower case sequence that follows. for ; i+1 < len(s) && isASCIILower(s[i+1]); i++ { b = append(b, s[i+1]) } } } return string(b) } // GoSanitized converts a string to a valid Go identifier. func GoSanitized(s string) string { // Sanitize the input to the set of valid characters, // which must be '_' or be in the Unicode L or N categories. s = strings.Map(func(r rune) rune { if unicode.IsLetter(r) || unicode.IsDigit(r) { return r } return '_' }, s) // Prepend '_' in the event of a Go keyword conflict or if // the identifier is invalid (does not start in the Unicode L category). r, _ := utf8.DecodeRuneInString(s) if token.Lookup(s).IsKeyword() || !unicode.IsLetter(r) { return "_" + s } return s } // JSONCamelCase converts a snake_case identifier to a camelCase identifier, // according to the protobuf JSON specification. func JSONCamelCase(s string) string { var b []byte var wasUnderscore bool for i := 0; i < len(s); i++ { // proto identifiers are always ASCII c := s[i] if c != '_' { if wasUnderscore && isASCIILower(c) { c -= 'a' - 'A' // convert to uppercase } b = append(b, c) } wasUnderscore = c == '_' } return string(b) } // JSONSnakeCase converts a camelCase identifier to a snake_case identifier, // according to the protobuf JSON specification. func JSONSnakeCase(s string) string { var b []byte for i := 0; i < len(s); i++ { // proto identifiers are always ASCII c := s[i] if isASCIIUpper(c) { b = append(b, '_') c += 'a' - 'A' // convert to lowercase } b = append(b, c) } return string(b) } // MapEntryName derives the name of the map entry message given the field name. // See protoc v3.8.0: src/google/protobuf/descriptor.cc:254-276,6057 func MapEntryName(s string) string { var b []byte upperNext := true for _, c := range s { switch { case c == '_': upperNext = true case upperNext: b = append(b, byte(unicode.ToUpper(c))) upperNext = false default: b = append(b, byte(c)) } } b = append(b, "Entry"...) return string(b) } // EnumValueName derives the camel-cased enum value name. // See protoc v3.8.0: src/google/protobuf/descriptor.cc:297-313 func EnumValueName(s string) string { var b []byte upperNext := true for _, c := range s { switch { case c == '_': upperNext = true case upperNext: b = append(b, byte(unicode.ToUpper(c))) upperNext = false default: b = append(b, byte(unicode.ToLower(c))) upperNext = false } } return string(b) } // TrimEnumPrefix trims the enum name prefix from an enum value name, // where the prefix is all lowercase without underscores. // See protoc v3.8.0: src/google/protobuf/descriptor.cc:330-375 func TrimEnumPrefix(s, prefix string) string { s0 := s // original input for len(s) > 0 && len(prefix) > 0 { if s[0] == '_' { s = s[1:] continue } if unicode.ToLower(rune(s[0])) != rune(prefix[0]) { return s0 // no prefix match } s, prefix = s[1:], prefix[1:] } if len(prefix) > 0 { return s0 // no prefix match } s = strings.TrimLeft(s, "_") if len(s) == 0 { return s0 // avoid returning empty string } return s } func isASCIILower(c byte) bool { return 'a' <= c && c <= 'z' } func isASCIIUpper(c byte) bool { return 'A' <= c && c <= 'Z' } func isASCIIDigit(c byte) bool { return '0' <= c && c <= '9' } ================================================ FILE: vendor/google.golang.org/protobuf/internal/strs/strings_unsafe.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package strs import ( "unsafe" "google.golang.org/protobuf/reflect/protoreflect" ) // UnsafeString returns an unsafe string reference of b. // The caller must treat the input slice as immutable. // // WARNING: Use carefully. The returned result must not leak to the end user // unless the input slice is provably immutable. func UnsafeString(b []byte) string { return unsafe.String(unsafe.SliceData(b), len(b)) } // UnsafeBytes returns an unsafe bytes slice reference of s. // The caller must treat returned slice as immutable. // // WARNING: Use carefully. The returned result must not leak to the end user. func UnsafeBytes(s string) []byte { return unsafe.Slice(unsafe.StringData(s), len(s)) } // Builder builds a set of strings with shared lifetime. // This differs from strings.Builder, which is for building a single string. type Builder struct { buf []byte } // AppendFullName is equivalent to protoreflect.FullName.Append, // but optimized for large batches where each name has a shared lifetime. func (sb *Builder) AppendFullName(prefix protoreflect.FullName, name protoreflect.Name) protoreflect.FullName { n := len(prefix) + len(".") + len(name) if len(prefix) == 0 { n -= len(".") } sb.grow(n) sb.buf = append(sb.buf, prefix...) sb.buf = append(sb.buf, '.') sb.buf = append(sb.buf, name...) return protoreflect.FullName(sb.last(n)) } // MakeString is equivalent to string(b), but optimized for large batches // with a shared lifetime. func (sb *Builder) MakeString(b []byte) string { sb.grow(len(b)) sb.buf = append(sb.buf, b...) return sb.last(len(b)) } func (sb *Builder) grow(n int) { if cap(sb.buf)-len(sb.buf) >= n { return } // Unlike strings.Builder, we do not need to copy over the contents // of the old buffer since our builder provides no API for // retrieving previously created strings. sb.buf = make([]byte, 0, 2*(cap(sb.buf)+n)) } func (sb *Builder) last(n int) string { return UnsafeString(sb.buf[len(sb.buf)-n:]) } ================================================ FILE: vendor/google.golang.org/protobuf/internal/version/version.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package version records versioning information about this module. package version import ( "fmt" "strings" ) // These constants determine the current version of this module. // // For our release process, we enforce the following rules: // - Tagged releases use a tag that is identical to String. // - Tagged releases never reference a commit where the String // contains "devel". // - The set of all commits in this repository where String // does not contain "devel" must have a unique String. // // Steps for tagging a new release: // // 1. Create a new CL. // // 2. Update Minor, Patch, and/or PreRelease as necessary. // PreRelease must not contain the string "devel". // // 3. Since the last released minor version, have there been any changes to // generator that relies on new functionality in the runtime? // If yes, then increment RequiredGenerated. // // 4. Since the last released minor version, have there been any changes to // the runtime that removes support for old .pb.go source code? // If yes, then increment SupportMinimum. // // 5. Send out the CL for review and submit it. // Note that the next CL in step 8 must be submitted after this CL // without any other CLs in-between. // // 6. Tag a new version, where the tag is is the current String. // // 7. Write release notes for all notable changes // between this release and the last release. // // 8. Create a new CL. // // 9. Update PreRelease to include the string "devel". // For example: "" -> "devel" or "rc.1" -> "rc.1.devel" // // 10. Send out the CL for review and submit it. const ( Major = 1 Minor = 36 Patch = 11 PreRelease = "" ) // String formats the version string for this module in semver format. // // Examples: // // v1.20.1 // v1.21.0-rc.1 func String() string { v := fmt.Sprintf("v%d.%d.%d", Major, Minor, Patch) if PreRelease != "" { v += "-" + PreRelease // TODO: Add metadata about the commit or build hash. // See https://golang.org/issue/29814 // See https://golang.org/issue/33533 var metadata string if strings.Contains(PreRelease, "devel") && metadata != "" { v += "+" + metadata } } return v } ================================================ FILE: vendor/google.golang.org/protobuf/proto/checkinit.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package proto import ( "google.golang.org/protobuf/internal/errors" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/runtime/protoiface" ) // CheckInitialized returns an error if any required fields in m are not set. func CheckInitialized(m Message) error { // Treat a nil message interface as an "untyped" empty message, // which we assume to have no required fields. if m == nil { return nil } return checkInitialized(m.ProtoReflect()) } // CheckInitialized returns an error if any required fields in m are not set. func checkInitialized(m protoreflect.Message) error { if methods := protoMethods(m); methods != nil && methods.CheckInitialized != nil { _, err := methods.CheckInitialized(protoiface.CheckInitializedInput{ Message: m, }) return err } return checkInitializedSlow(m) } func checkInitializedSlow(m protoreflect.Message) error { md := m.Descriptor() fds := md.Fields() for i, nums := 0, md.RequiredNumbers(); i < nums.Len(); i++ { fd := fds.ByNumber(nums.Get(i)) if !m.Has(fd) { return errors.RequiredNotSet(string(fd.FullName())) } } var err error m.Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool { switch { case fd.IsList(): if fd.Message() == nil { return true } for i, list := 0, v.List(); i < list.Len() && err == nil; i++ { err = checkInitialized(list.Get(i).Message()) } case fd.IsMap(): if fd.MapValue().Message() == nil { return true } v.Map().Range(func(key protoreflect.MapKey, v protoreflect.Value) bool { err = checkInitialized(v.Message()) return err == nil }) default: if fd.Message() == nil { return true } err = checkInitialized(v.Message()) } return err == nil }) return err } ================================================ FILE: vendor/google.golang.org/protobuf/proto/decode.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package proto import ( "google.golang.org/protobuf/encoding/protowire" "google.golang.org/protobuf/internal/encoding/messageset" "google.golang.org/protobuf/internal/errors" "google.golang.org/protobuf/internal/genid" "google.golang.org/protobuf/internal/pragma" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/reflect/protoregistry" "google.golang.org/protobuf/runtime/protoiface" ) // UnmarshalOptions configures the unmarshaler. // // Example usage: // // err := UnmarshalOptions{DiscardUnknown: true}.Unmarshal(b, m) type UnmarshalOptions struct { pragma.NoUnkeyedLiterals // Merge merges the input into the destination message. // The default behavior is to always reset the message before unmarshaling, // unless Merge is specified. Merge bool // AllowPartial accepts input for messages that will result in missing // required fields. If AllowPartial is false (the default), Unmarshal will // return an error if there are any missing required fields. AllowPartial bool // If DiscardUnknown is set, unknown fields are ignored. DiscardUnknown bool // Resolver is used for looking up types when unmarshaling extension fields. // If nil, this defaults to using protoregistry.GlobalTypes. Resolver interface { FindExtensionByName(field protoreflect.FullName) (protoreflect.ExtensionType, error) FindExtensionByNumber(message protoreflect.FullName, field protoreflect.FieldNumber) (protoreflect.ExtensionType, error) } // RecursionLimit limits how deeply messages may be nested. // If zero, a default limit is applied. RecursionLimit int // // NoLazyDecoding turns off lazy decoding, which otherwise is enabled by // default. Lazy decoding only affects submessages (annotated with [lazy = // true] in the .proto file) within messages that use the Opaque API. NoLazyDecoding bool } // Unmarshal parses the wire-format message in b and places the result in m. // The provided message must be mutable (e.g., a non-nil pointer to a message). // // See the [UnmarshalOptions] type if you need more control. func Unmarshal(b []byte, m Message) error { _, err := UnmarshalOptions{RecursionLimit: protowire.DefaultRecursionLimit}.unmarshal(b, m.ProtoReflect()) return err } // Unmarshal parses the wire-format message in b and places the result in m. // The provided message must be mutable (e.g., a non-nil pointer to a message). func (o UnmarshalOptions) Unmarshal(b []byte, m Message) error { if o.RecursionLimit == 0 { o.RecursionLimit = protowire.DefaultRecursionLimit } _, err := o.unmarshal(b, m.ProtoReflect()) return err } // UnmarshalState parses a wire-format message and places the result in m. // // This method permits fine-grained control over the unmarshaler. // Most users should use [Unmarshal] instead. func (o UnmarshalOptions) UnmarshalState(in protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { if o.RecursionLimit == 0 { o.RecursionLimit = protowire.DefaultRecursionLimit } return o.unmarshal(in.Buf, in.Message) } // unmarshal is a centralized function that all unmarshal operations go through. // For profiling purposes, avoid changing the name of this function or // introducing other code paths for unmarshal that do not go through this. func (o UnmarshalOptions) unmarshal(b []byte, m protoreflect.Message) (out protoiface.UnmarshalOutput, err error) { if o.Resolver == nil { o.Resolver = protoregistry.GlobalTypes } if !o.Merge { Reset(m.Interface()) } allowPartial := o.AllowPartial o.Merge = true o.AllowPartial = true methods := protoMethods(m) if methods != nil && methods.Unmarshal != nil && !(o.DiscardUnknown && methods.Flags&protoiface.SupportUnmarshalDiscardUnknown == 0) { in := protoiface.UnmarshalInput{ Message: m, Buf: b, Resolver: o.Resolver, Depth: o.RecursionLimit, } if o.DiscardUnknown { in.Flags |= protoiface.UnmarshalDiscardUnknown } if !allowPartial { // This does not affect how current unmarshal functions work, it just allows them // to record this for lazy the decoding case. in.Flags |= protoiface.UnmarshalCheckRequired } if o.NoLazyDecoding { in.Flags |= protoiface.UnmarshalNoLazyDecoding } out, err = methods.Unmarshal(in) } else { if o.RecursionLimit--; o.RecursionLimit < 0 { return out, errRecursionDepth } err = o.unmarshalMessageSlow(b, m) } if err != nil { return out, err } if allowPartial || (out.Flags&protoiface.UnmarshalInitialized != 0) { return out, nil } return out, checkInitialized(m) } func (o UnmarshalOptions) unmarshalMessage(b []byte, m protoreflect.Message) error { _, err := o.unmarshal(b, m) return err } func (o UnmarshalOptions) unmarshalMessageSlow(b []byte, m protoreflect.Message) error { md := m.Descriptor() if messageset.IsMessageSet(md) { return o.unmarshalMessageSet(b, m) } fields := md.Fields() for len(b) > 0 { // Parse the tag (field number and wire type). num, wtyp, tagLen := protowire.ConsumeTag(b) if tagLen < 0 { return errDecode } if num > protowire.MaxValidNumber { return errDecode } // Find the field descriptor for this field number. fd := fields.ByNumber(num) if fd == nil && md.ExtensionRanges().Has(num) { extType, err := o.Resolver.FindExtensionByNumber(md.FullName(), num) if err != nil && err != protoregistry.NotFound { return errors.New("%v: unable to resolve extension %v: %v", md.FullName(), num, err) } if extType != nil { fd = extType.TypeDescriptor() } } var err error if fd == nil { err = errUnknown } // Parse the field value. var valLen int switch { case err != nil: case fd.IsList(): valLen, err = o.unmarshalList(b[tagLen:], wtyp, m.Mutable(fd).List(), fd) case fd.IsMap(): valLen, err = o.unmarshalMap(b[tagLen:], wtyp, m.Mutable(fd).Map(), fd) default: valLen, err = o.unmarshalSingular(b[tagLen:], wtyp, m, fd) } if err != nil { if err != errUnknown { return err } valLen = protowire.ConsumeFieldValue(num, wtyp, b[tagLen:]) if valLen < 0 { return errDecode } if !o.DiscardUnknown { m.SetUnknown(append(m.GetUnknown(), b[:tagLen+valLen]...)) } } b = b[tagLen+valLen:] } return nil } func (o UnmarshalOptions) unmarshalSingular(b []byte, wtyp protowire.Type, m protoreflect.Message, fd protoreflect.FieldDescriptor) (n int, err error) { v, n, err := o.unmarshalScalar(b, wtyp, fd) if err != nil { return 0, err } switch fd.Kind() { case protoreflect.GroupKind, protoreflect.MessageKind: m2 := m.Mutable(fd).Message() if err := o.unmarshalMessage(v.Bytes(), m2); err != nil { return n, err } default: // Non-message scalars replace the previous value. m.Set(fd, v) } return n, nil } func (o UnmarshalOptions) unmarshalMap(b []byte, wtyp protowire.Type, mapv protoreflect.Map, fd protoreflect.FieldDescriptor) (n int, err error) { if o.RecursionLimit--; o.RecursionLimit < 0 { return 0, errRecursionDepth } if wtyp != protowire.BytesType { return 0, errUnknown } b, n = protowire.ConsumeBytes(b) if n < 0 { return 0, errDecode } var ( keyField = fd.MapKey() valField = fd.MapValue() key protoreflect.Value val protoreflect.Value haveKey bool haveVal bool ) switch valField.Kind() { case protoreflect.GroupKind, protoreflect.MessageKind: val = mapv.NewValue() } // Map entries are represented as a two-element message with fields // containing the key and value. for len(b) > 0 { num, wtyp, n := protowire.ConsumeTag(b) if n < 0 { return 0, errDecode } if num > protowire.MaxValidNumber { return 0, errDecode } b = b[n:] err = errUnknown switch num { case genid.MapEntry_Key_field_number: key, n, err = o.unmarshalScalar(b, wtyp, keyField) if err != nil { break } haveKey = true case genid.MapEntry_Value_field_number: var v protoreflect.Value v, n, err = o.unmarshalScalar(b, wtyp, valField) if err != nil { break } switch valField.Kind() { case protoreflect.GroupKind, protoreflect.MessageKind: if err := o.unmarshalMessage(v.Bytes(), val.Message()); err != nil { return 0, err } default: val = v } haveVal = true } if err == errUnknown { n = protowire.ConsumeFieldValue(num, wtyp, b) if n < 0 { return 0, errDecode } } else if err != nil { return 0, err } b = b[n:] } // Every map entry should have entries for key and value, but this is not strictly required. if !haveKey { key = keyField.Default() } if !haveVal { switch valField.Kind() { case protoreflect.GroupKind, protoreflect.MessageKind: default: val = valField.Default() } } mapv.Set(key.MapKey(), val) return n, nil } // errUnknown is used internally to indicate fields which should be added // to the unknown field set of a message. It is never returned from an exported // function. var errUnknown = errors.New("BUG: internal error (unknown)") var errDecode = errors.New("cannot parse invalid wire-format data") var errRecursionDepth = errors.New("exceeded maximum recursion depth") ================================================ FILE: vendor/google.golang.org/protobuf/proto/decode_gen.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Code generated by generate-types. DO NOT EDIT. package proto import ( "math" "unicode/utf8" "google.golang.org/protobuf/encoding/protowire" "google.golang.org/protobuf/internal/errors" "google.golang.org/protobuf/internal/strs" "google.golang.org/protobuf/reflect/protoreflect" ) // unmarshalScalar decodes a value of the given kind. // // Message values are decoded into a []byte which aliases the input data. func (o UnmarshalOptions) unmarshalScalar(b []byte, wtyp protowire.Type, fd protoreflect.FieldDescriptor) (val protoreflect.Value, n int, err error) { switch fd.Kind() { case protoreflect.BoolKind: if wtyp != protowire.VarintType { return val, 0, errUnknown } v, n := protowire.ConsumeVarint(b) if n < 0 { return val, 0, errDecode } return protoreflect.ValueOfBool(protowire.DecodeBool(v)), n, nil case protoreflect.EnumKind: if wtyp != protowire.VarintType { return val, 0, errUnknown } v, n := protowire.ConsumeVarint(b) if n < 0 { return val, 0, errDecode } return protoreflect.ValueOfEnum(protoreflect.EnumNumber(v)), n, nil case protoreflect.Int32Kind: if wtyp != protowire.VarintType { return val, 0, errUnknown } v, n := protowire.ConsumeVarint(b) if n < 0 { return val, 0, errDecode } return protoreflect.ValueOfInt32(int32(v)), n, nil case protoreflect.Sint32Kind: if wtyp != protowire.VarintType { return val, 0, errUnknown } v, n := protowire.ConsumeVarint(b) if n < 0 { return val, 0, errDecode } return protoreflect.ValueOfInt32(int32(protowire.DecodeZigZag(v & math.MaxUint32))), n, nil case protoreflect.Uint32Kind: if wtyp != protowire.VarintType { return val, 0, errUnknown } v, n := protowire.ConsumeVarint(b) if n < 0 { return val, 0, errDecode } return protoreflect.ValueOfUint32(uint32(v)), n, nil case protoreflect.Int64Kind: if wtyp != protowire.VarintType { return val, 0, errUnknown } v, n := protowire.ConsumeVarint(b) if n < 0 { return val, 0, errDecode } return protoreflect.ValueOfInt64(int64(v)), n, nil case protoreflect.Sint64Kind: if wtyp != protowire.VarintType { return val, 0, errUnknown } v, n := protowire.ConsumeVarint(b) if n < 0 { return val, 0, errDecode } return protoreflect.ValueOfInt64(protowire.DecodeZigZag(v)), n, nil case protoreflect.Uint64Kind: if wtyp != protowire.VarintType { return val, 0, errUnknown } v, n := protowire.ConsumeVarint(b) if n < 0 { return val, 0, errDecode } return protoreflect.ValueOfUint64(v), n, nil case protoreflect.Sfixed32Kind: if wtyp != protowire.Fixed32Type { return val, 0, errUnknown } v, n := protowire.ConsumeFixed32(b) if n < 0 { return val, 0, errDecode } return protoreflect.ValueOfInt32(int32(v)), n, nil case protoreflect.Fixed32Kind: if wtyp != protowire.Fixed32Type { return val, 0, errUnknown } v, n := protowire.ConsumeFixed32(b) if n < 0 { return val, 0, errDecode } return protoreflect.ValueOfUint32(uint32(v)), n, nil case protoreflect.FloatKind: if wtyp != protowire.Fixed32Type { return val, 0, errUnknown } v, n := protowire.ConsumeFixed32(b) if n < 0 { return val, 0, errDecode } return protoreflect.ValueOfFloat32(math.Float32frombits(uint32(v))), n, nil case protoreflect.Sfixed64Kind: if wtyp != protowire.Fixed64Type { return val, 0, errUnknown } v, n := protowire.ConsumeFixed64(b) if n < 0 { return val, 0, errDecode } return protoreflect.ValueOfInt64(int64(v)), n, nil case protoreflect.Fixed64Kind: if wtyp != protowire.Fixed64Type { return val, 0, errUnknown } v, n := protowire.ConsumeFixed64(b) if n < 0 { return val, 0, errDecode } return protoreflect.ValueOfUint64(v), n, nil case protoreflect.DoubleKind: if wtyp != protowire.Fixed64Type { return val, 0, errUnknown } v, n := protowire.ConsumeFixed64(b) if n < 0 { return val, 0, errDecode } return protoreflect.ValueOfFloat64(math.Float64frombits(v)), n, nil case protoreflect.StringKind: if wtyp != protowire.BytesType { return val, 0, errUnknown } v, n := protowire.ConsumeBytes(b) if n < 0 { return val, 0, errDecode } if strs.EnforceUTF8(fd) && !utf8.Valid(v) { return protoreflect.Value{}, 0, errors.InvalidUTF8(string(fd.FullName())) } return protoreflect.ValueOfString(string(v)), n, nil case protoreflect.BytesKind: if wtyp != protowire.BytesType { return val, 0, errUnknown } v, n := protowire.ConsumeBytes(b) if n < 0 { return val, 0, errDecode } return protoreflect.ValueOfBytes(append(emptyBuf[:], v...)), n, nil case protoreflect.MessageKind: if wtyp != protowire.BytesType { return val, 0, errUnknown } v, n := protowire.ConsumeBytes(b) if n < 0 { return val, 0, errDecode } return protoreflect.ValueOfBytes(v), n, nil case protoreflect.GroupKind: if wtyp != protowire.StartGroupType { return val, 0, errUnknown } v, n := protowire.ConsumeGroup(fd.Number(), b) if n < 0 { return val, 0, errDecode } return protoreflect.ValueOfBytes(v), n, nil default: return val, 0, errUnknown } } func (o UnmarshalOptions) unmarshalList(b []byte, wtyp protowire.Type, list protoreflect.List, fd protoreflect.FieldDescriptor) (n int, err error) { switch fd.Kind() { case protoreflect.BoolKind: if wtyp == protowire.BytesType { buf, n := protowire.ConsumeBytes(b) if n < 0 { return 0, errDecode } for len(buf) > 0 { v, n := protowire.ConsumeVarint(buf) if n < 0 { return 0, errDecode } buf = buf[n:] list.Append(protoreflect.ValueOfBool(protowire.DecodeBool(v))) } return n, nil } if wtyp != protowire.VarintType { return 0, errUnknown } v, n := protowire.ConsumeVarint(b) if n < 0 { return 0, errDecode } list.Append(protoreflect.ValueOfBool(protowire.DecodeBool(v))) return n, nil case protoreflect.EnumKind: if wtyp == protowire.BytesType { buf, n := protowire.ConsumeBytes(b) if n < 0 { return 0, errDecode } for len(buf) > 0 { v, n := protowire.ConsumeVarint(buf) if n < 0 { return 0, errDecode } buf = buf[n:] list.Append(protoreflect.ValueOfEnum(protoreflect.EnumNumber(v))) } return n, nil } if wtyp != protowire.VarintType { return 0, errUnknown } v, n := protowire.ConsumeVarint(b) if n < 0 { return 0, errDecode } list.Append(protoreflect.ValueOfEnum(protoreflect.EnumNumber(v))) return n, nil case protoreflect.Int32Kind: if wtyp == protowire.BytesType { buf, n := protowire.ConsumeBytes(b) if n < 0 { return 0, errDecode } for len(buf) > 0 { v, n := protowire.ConsumeVarint(buf) if n < 0 { return 0, errDecode } buf = buf[n:] list.Append(protoreflect.ValueOfInt32(int32(v))) } return n, nil } if wtyp != protowire.VarintType { return 0, errUnknown } v, n := protowire.ConsumeVarint(b) if n < 0 { return 0, errDecode } list.Append(protoreflect.ValueOfInt32(int32(v))) return n, nil case protoreflect.Sint32Kind: if wtyp == protowire.BytesType { buf, n := protowire.ConsumeBytes(b) if n < 0 { return 0, errDecode } for len(buf) > 0 { v, n := protowire.ConsumeVarint(buf) if n < 0 { return 0, errDecode } buf = buf[n:] list.Append(protoreflect.ValueOfInt32(int32(protowire.DecodeZigZag(v & math.MaxUint32)))) } return n, nil } if wtyp != protowire.VarintType { return 0, errUnknown } v, n := protowire.ConsumeVarint(b) if n < 0 { return 0, errDecode } list.Append(protoreflect.ValueOfInt32(int32(protowire.DecodeZigZag(v & math.MaxUint32)))) return n, nil case protoreflect.Uint32Kind: if wtyp == protowire.BytesType { buf, n := protowire.ConsumeBytes(b) if n < 0 { return 0, errDecode } for len(buf) > 0 { v, n := protowire.ConsumeVarint(buf) if n < 0 { return 0, errDecode } buf = buf[n:] list.Append(protoreflect.ValueOfUint32(uint32(v))) } return n, nil } if wtyp != protowire.VarintType { return 0, errUnknown } v, n := protowire.ConsumeVarint(b) if n < 0 { return 0, errDecode } list.Append(protoreflect.ValueOfUint32(uint32(v))) return n, nil case protoreflect.Int64Kind: if wtyp == protowire.BytesType { buf, n := protowire.ConsumeBytes(b) if n < 0 { return 0, errDecode } for len(buf) > 0 { v, n := protowire.ConsumeVarint(buf) if n < 0 { return 0, errDecode } buf = buf[n:] list.Append(protoreflect.ValueOfInt64(int64(v))) } return n, nil } if wtyp != protowire.VarintType { return 0, errUnknown } v, n := protowire.ConsumeVarint(b) if n < 0 { return 0, errDecode } list.Append(protoreflect.ValueOfInt64(int64(v))) return n, nil case protoreflect.Sint64Kind: if wtyp == protowire.BytesType { buf, n := protowire.ConsumeBytes(b) if n < 0 { return 0, errDecode } for len(buf) > 0 { v, n := protowire.ConsumeVarint(buf) if n < 0 { return 0, errDecode } buf = buf[n:] list.Append(protoreflect.ValueOfInt64(protowire.DecodeZigZag(v))) } return n, nil } if wtyp != protowire.VarintType { return 0, errUnknown } v, n := protowire.ConsumeVarint(b) if n < 0 { return 0, errDecode } list.Append(protoreflect.ValueOfInt64(protowire.DecodeZigZag(v))) return n, nil case protoreflect.Uint64Kind: if wtyp == protowire.BytesType { buf, n := protowire.ConsumeBytes(b) if n < 0 { return 0, errDecode } for len(buf) > 0 { v, n := protowire.ConsumeVarint(buf) if n < 0 { return 0, errDecode } buf = buf[n:] list.Append(protoreflect.ValueOfUint64(v)) } return n, nil } if wtyp != protowire.VarintType { return 0, errUnknown } v, n := protowire.ConsumeVarint(b) if n < 0 { return 0, errDecode } list.Append(protoreflect.ValueOfUint64(v)) return n, nil case protoreflect.Sfixed32Kind: if wtyp == protowire.BytesType { buf, n := protowire.ConsumeBytes(b) if n < 0 { return 0, errDecode } for len(buf) > 0 { v, n := protowire.ConsumeFixed32(buf) if n < 0 { return 0, errDecode } buf = buf[n:] list.Append(protoreflect.ValueOfInt32(int32(v))) } return n, nil } if wtyp != protowire.Fixed32Type { return 0, errUnknown } v, n := protowire.ConsumeFixed32(b) if n < 0 { return 0, errDecode } list.Append(protoreflect.ValueOfInt32(int32(v))) return n, nil case protoreflect.Fixed32Kind: if wtyp == protowire.BytesType { buf, n := protowire.ConsumeBytes(b) if n < 0 { return 0, errDecode } for len(buf) > 0 { v, n := protowire.ConsumeFixed32(buf) if n < 0 { return 0, errDecode } buf = buf[n:] list.Append(protoreflect.ValueOfUint32(uint32(v))) } return n, nil } if wtyp != protowire.Fixed32Type { return 0, errUnknown } v, n := protowire.ConsumeFixed32(b) if n < 0 { return 0, errDecode } list.Append(protoreflect.ValueOfUint32(uint32(v))) return n, nil case protoreflect.FloatKind: if wtyp == protowire.BytesType { buf, n := protowire.ConsumeBytes(b) if n < 0 { return 0, errDecode } for len(buf) > 0 { v, n := protowire.ConsumeFixed32(buf) if n < 0 { return 0, errDecode } buf = buf[n:] list.Append(protoreflect.ValueOfFloat32(math.Float32frombits(uint32(v)))) } return n, nil } if wtyp != protowire.Fixed32Type { return 0, errUnknown } v, n := protowire.ConsumeFixed32(b) if n < 0 { return 0, errDecode } list.Append(protoreflect.ValueOfFloat32(math.Float32frombits(uint32(v)))) return n, nil case protoreflect.Sfixed64Kind: if wtyp == protowire.BytesType { buf, n := protowire.ConsumeBytes(b) if n < 0 { return 0, errDecode } for len(buf) > 0 { v, n := protowire.ConsumeFixed64(buf) if n < 0 { return 0, errDecode } buf = buf[n:] list.Append(protoreflect.ValueOfInt64(int64(v))) } return n, nil } if wtyp != protowire.Fixed64Type { return 0, errUnknown } v, n := protowire.ConsumeFixed64(b) if n < 0 { return 0, errDecode } list.Append(protoreflect.ValueOfInt64(int64(v))) return n, nil case protoreflect.Fixed64Kind: if wtyp == protowire.BytesType { buf, n := protowire.ConsumeBytes(b) if n < 0 { return 0, errDecode } for len(buf) > 0 { v, n := protowire.ConsumeFixed64(buf) if n < 0 { return 0, errDecode } buf = buf[n:] list.Append(protoreflect.ValueOfUint64(v)) } return n, nil } if wtyp != protowire.Fixed64Type { return 0, errUnknown } v, n := protowire.ConsumeFixed64(b) if n < 0 { return 0, errDecode } list.Append(protoreflect.ValueOfUint64(v)) return n, nil case protoreflect.DoubleKind: if wtyp == protowire.BytesType { buf, n := protowire.ConsumeBytes(b) if n < 0 { return 0, errDecode } for len(buf) > 0 { v, n := protowire.ConsumeFixed64(buf) if n < 0 { return 0, errDecode } buf = buf[n:] list.Append(protoreflect.ValueOfFloat64(math.Float64frombits(v))) } return n, nil } if wtyp != protowire.Fixed64Type { return 0, errUnknown } v, n := protowire.ConsumeFixed64(b) if n < 0 { return 0, errDecode } list.Append(protoreflect.ValueOfFloat64(math.Float64frombits(v))) return n, nil case protoreflect.StringKind: if wtyp != protowire.BytesType { return 0, errUnknown } v, n := protowire.ConsumeBytes(b) if n < 0 { return 0, errDecode } if strs.EnforceUTF8(fd) && !utf8.Valid(v) { return 0, errors.InvalidUTF8(string(fd.FullName())) } list.Append(protoreflect.ValueOfString(string(v))) return n, nil case protoreflect.BytesKind: if wtyp != protowire.BytesType { return 0, errUnknown } v, n := protowire.ConsumeBytes(b) if n < 0 { return 0, errDecode } list.Append(protoreflect.ValueOfBytes(append(emptyBuf[:], v...))) return n, nil case protoreflect.MessageKind: if wtyp != protowire.BytesType { return 0, errUnknown } v, n := protowire.ConsumeBytes(b) if n < 0 { return 0, errDecode } m := list.NewElement() if err := o.unmarshalMessage(v, m.Message()); err != nil { return 0, err } list.Append(m) return n, nil case protoreflect.GroupKind: if wtyp != protowire.StartGroupType { return 0, errUnknown } v, n := protowire.ConsumeGroup(fd.Number(), b) if n < 0 { return 0, errDecode } m := list.NewElement() if err := o.unmarshalMessage(v, m.Message()); err != nil { return 0, err } list.Append(m) return n, nil default: return 0, errUnknown } } // We append to an empty array rather than a nil []byte to get non-nil zero-length byte slices. var emptyBuf [0]byte ================================================ FILE: vendor/google.golang.org/protobuf/proto/doc.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package proto provides functions operating on protocol buffer messages. // // For documentation on protocol buffers in general, see: // https://protobuf.dev. // // For a tutorial on using protocol buffers with Go, see: // https://protobuf.dev/getting-started/gotutorial. // // For a guide to generated Go protocol buffer code, see: // https://protobuf.dev/reference/go/go-generated. // // # Binary serialization // // This package contains functions to convert to and from the wire format, // an efficient binary serialization of protocol buffers. // // - [Size] reports the size of a message in the wire format. // // - [Marshal] converts a message to the wire format. // The [MarshalOptions] type provides more control over wire marshaling. // // - [Unmarshal] converts a message from the wire format. // The [UnmarshalOptions] type provides more control over wire unmarshaling. // // # Basic message operations // // - [Clone] makes a deep copy of a message. // // - [Merge] merges the content of a message into another. // // - [Equal] compares two messages. For more control over comparisons // and detailed reporting of differences, see package // [google.golang.org/protobuf/testing/protocmp]. // // - [Reset] clears the content of a message. // // - [CheckInitialized] reports whether all required fields in a message are set. // // # Optional scalar constructors // // The API for some generated messages represents optional scalar fields // as pointers to a value. For example, an optional string field has the // Go type *string. // // - [Bool], [Int32], [Int64], [Uint32], [Uint64], [Float32], [Float64], and [String] // take a value and return a pointer to a new instance of it, // to simplify construction of optional field values. // // Generated enum types usually have an Enum method which performs the // same operation. // // Optional scalar fields are only supported in proto2. // // # Extension accessors // // - [HasExtension], [GetExtension], [SetExtension], and [ClearExtension] // access extension field values in a protocol buffer message. // // Extension fields are only supported in proto2. // // # Related packages // // - Package [google.golang.org/protobuf/encoding/protojson] converts messages to // and from JSON. // // - Package [google.golang.org/protobuf/encoding/prototext] converts messages to // and from the text format. // // - Package [google.golang.org/protobuf/reflect/protoreflect] provides a // reflection interface for protocol buffer data types. // // - Package [google.golang.org/protobuf/testing/protocmp] provides features // to compare protocol buffer messages with the [github.com/google/go-cmp/cmp] // package. // // - Package [google.golang.org/protobuf/types/dynamicpb] provides a dynamic // message type, suitable for working with messages where the protocol buffer // type is only known at runtime. // // This module contains additional packages for more specialized use cases. // Consult the individual package documentation for details. package proto ================================================ FILE: vendor/google.golang.org/protobuf/proto/encode.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package proto import ( "errors" "fmt" "google.golang.org/protobuf/encoding/protowire" "google.golang.org/protobuf/internal/encoding/messageset" "google.golang.org/protobuf/internal/order" "google.golang.org/protobuf/internal/pragma" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/runtime/protoiface" protoerrors "google.golang.org/protobuf/internal/errors" ) // MarshalOptions configures the marshaler. // // Example usage: // // b, err := MarshalOptions{Deterministic: true}.Marshal(m) type MarshalOptions struct { pragma.NoUnkeyedLiterals // AllowPartial allows messages that have missing required fields to marshal // without returning an error. If AllowPartial is false (the default), // Marshal will return an error if there are any missing required fields. AllowPartial bool // Deterministic controls whether the same message will always be // serialized to the same bytes within the same binary. // // Setting this option guarantees that repeated serialization of // the same message will return the same bytes, and that different // processes of the same binary (which may be executing on different // machines) will serialize equal messages to the same bytes. // It has no effect on the resulting size of the encoded message compared // to a non-deterministic marshal. // // Note that the deterministic serialization is NOT canonical across // languages. It is not guaranteed to remain stable over time. It is // unstable across different builds with schema changes due to unknown // fields. Users who need canonical serialization (e.g., persistent // storage in a canonical form, fingerprinting, etc.) must define // their own canonicalization specification and implement their own // serializer rather than relying on this API. // // If deterministic serialization is requested, map entries will be // sorted by keys in lexographical order. This is an implementation // detail and subject to change. Deterministic bool // UseCachedSize indicates that the result of a previous Size call // may be reused. // // Setting this option asserts that: // // 1. Size has previously been called on this message with identical // options (except for UseCachedSize itself). // // 2. The message and all its submessages have not changed in any // way since the Size call. For lazily decoded messages, accessing // a message results in decoding the message, which is a change. // // If either of these invariants is violated, // the results are undefined and may include panics or corrupted output. // // Implementations MAY take this option into account to provide // better performance, but there is no guarantee that they will do so. // There is absolutely no guarantee that Size followed by Marshal with // UseCachedSize set will perform equivalently to Marshal alone. UseCachedSize bool } // flags turns the specified MarshalOptions (user-facing) into // protoiface.MarshalInputFlags (used internally by the marshaler). // // See impl.marshalOptions.Options for the inverse operation. func (o MarshalOptions) flags() protoiface.MarshalInputFlags { var flags protoiface.MarshalInputFlags // Note: o.AllowPartial is always forced to true by MarshalOptions.marshal, // which is why it is not a part of MarshalInputFlags. if o.Deterministic { flags |= protoiface.MarshalDeterministic } if o.UseCachedSize { flags |= protoiface.MarshalUseCachedSize } return flags } // Marshal returns the wire-format encoding of m. // // This is the most common entry point for encoding a Protobuf message. // // See the [MarshalOptions] type if you need more control. func Marshal(m Message) ([]byte, error) { // Treat nil message interface as an empty message; nothing to output. if m == nil { return nil, nil } out, err := MarshalOptions{}.marshal(nil, m.ProtoReflect()) if len(out.Buf) == 0 && err == nil { out.Buf = emptyBytesForMessage(m) } return out.Buf, err } // Marshal returns the wire-format encoding of m. func (o MarshalOptions) Marshal(m Message) ([]byte, error) { // Treat nil message interface as an empty message; nothing to output. if m == nil { return nil, nil } out, err := o.marshal(nil, m.ProtoReflect()) if len(out.Buf) == 0 && err == nil { out.Buf = emptyBytesForMessage(m) } return out.Buf, err } // emptyBytesForMessage returns a nil buffer if and only if m is invalid, // otherwise it returns a non-nil empty buffer. // // This is to assist the edge-case where user-code does the following: // // m1.OptionalBytes, _ = proto.Marshal(m2) // // where they expect the proto2 "optional_bytes" field to be populated // if any only if m2 is a valid message. func emptyBytesForMessage(m Message) []byte { if m == nil || !m.ProtoReflect().IsValid() { return nil } return emptyBuf[:] } // MarshalAppend appends the wire-format encoding of m to b, // returning the result. // // This is a less common entry point than [Marshal], which is only needed if you // need to supply your own buffers for performance reasons. func (o MarshalOptions) MarshalAppend(b []byte, m Message) ([]byte, error) { // Treat nil message interface as an empty message; nothing to append. if m == nil { return b, nil } out, err := o.marshal(b, m.ProtoReflect()) return out.Buf, err } // MarshalState returns the wire-format encoding of a message. // // This method permits fine-grained control over the marshaler. // Most users should use [Marshal] instead. func (o MarshalOptions) MarshalState(in protoiface.MarshalInput) (protoiface.MarshalOutput, error) { return o.marshal(in.Buf, in.Message) } // marshal is a centralized function that all marshal operations go through. // For profiling purposes, avoid changing the name of this function or // introducing other code paths for marshal that do not go through this. func (o MarshalOptions) marshal(b []byte, m protoreflect.Message) (out protoiface.MarshalOutput, err error) { allowPartial := o.AllowPartial o.AllowPartial = true if methods := protoMethods(m); methods != nil && methods.Marshal != nil && !(o.Deterministic && methods.Flags&protoiface.SupportMarshalDeterministic == 0) { in := protoiface.MarshalInput{ Message: m, Buf: b, Flags: o.flags(), } if methods.Size != nil { sout := methods.Size(protoiface.SizeInput{ Message: m, Flags: in.Flags, }) if cap(b) < len(b)+sout.Size { in.Buf = make([]byte, len(b), growcap(cap(b), len(b)+sout.Size)) copy(in.Buf, b) } in.Flags |= protoiface.MarshalUseCachedSize } out, err = methods.Marshal(in) } else { out.Buf, err = o.marshalMessageSlow(b, m) } if err != nil { var mismatch *protoerrors.SizeMismatchError if errors.As(err, &mismatch) { return out, fmt.Errorf("marshaling %s: %v", string(m.Descriptor().FullName()), err) } return out, err } if allowPartial { return out, nil } return out, checkInitialized(m) } func (o MarshalOptions) marshalMessage(b []byte, m protoreflect.Message) ([]byte, error) { out, err := o.marshal(b, m) return out.Buf, err } // growcap scales up the capacity of a slice. // // Given a slice with a current capacity of oldcap and a desired // capacity of wantcap, growcap returns a new capacity >= wantcap. // // The algorithm is mostly identical to the one used by append as of Go 1.14. func growcap(oldcap, wantcap int) (newcap int) { if wantcap > oldcap*2 { newcap = wantcap } else if oldcap < 1024 { // The Go 1.14 runtime takes this case when len(s) < 1024, // not when cap(s) < 1024. The difference doesn't seem // significant here. newcap = oldcap * 2 } else { newcap = oldcap for 0 < newcap && newcap < wantcap { newcap += newcap / 4 } if newcap <= 0 { newcap = wantcap } } return newcap } func (o MarshalOptions) marshalMessageSlow(b []byte, m protoreflect.Message) ([]byte, error) { if messageset.IsMessageSet(m.Descriptor()) { return o.marshalMessageSet(b, m) } fieldOrder := order.AnyFieldOrder if o.Deterministic { // TODO: This should use a more natural ordering like NumberFieldOrder, // but doing so breaks golden tests that make invalid assumption about // output stability of this implementation. fieldOrder = order.LegacyFieldOrder } var err error order.RangeFields(m, fieldOrder, func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool { b, err = o.marshalField(b, fd, v) return err == nil }) if err != nil { return b, err } b = append(b, m.GetUnknown()...) return b, nil } func (o MarshalOptions) marshalField(b []byte, fd protoreflect.FieldDescriptor, value protoreflect.Value) ([]byte, error) { switch { case fd.IsList(): return o.marshalList(b, fd, value.List()) case fd.IsMap(): return o.marshalMap(b, fd, value.Map()) default: b = protowire.AppendTag(b, fd.Number(), wireTypes[fd.Kind()]) return o.marshalSingular(b, fd, value) } } func (o MarshalOptions) marshalList(b []byte, fd protoreflect.FieldDescriptor, list protoreflect.List) ([]byte, error) { if fd.IsPacked() && list.Len() > 0 { b = protowire.AppendTag(b, fd.Number(), protowire.BytesType) b, pos := appendSpeculativeLength(b) for i, llen := 0, list.Len(); i < llen; i++ { var err error b, err = o.marshalSingular(b, fd, list.Get(i)) if err != nil { return b, err } } b = finishSpeculativeLength(b, pos) return b, nil } kind := fd.Kind() for i, llen := 0, list.Len(); i < llen; i++ { var err error b = protowire.AppendTag(b, fd.Number(), wireTypes[kind]) b, err = o.marshalSingular(b, fd, list.Get(i)) if err != nil { return b, err } } return b, nil } func (o MarshalOptions) marshalMap(b []byte, fd protoreflect.FieldDescriptor, mapv protoreflect.Map) ([]byte, error) { keyf := fd.MapKey() valf := fd.MapValue() keyOrder := order.AnyKeyOrder if o.Deterministic { keyOrder = order.GenericKeyOrder } var err error order.RangeEntries(mapv, keyOrder, func(key protoreflect.MapKey, value protoreflect.Value) bool { b = protowire.AppendTag(b, fd.Number(), protowire.BytesType) var pos int b, pos = appendSpeculativeLength(b) b, err = o.marshalField(b, keyf, key.Value()) if err != nil { return false } b, err = o.marshalField(b, valf, value) if err != nil { return false } b = finishSpeculativeLength(b, pos) return true }) return b, err } // When encoding length-prefixed fields, we speculatively set aside some number of bytes // for the length, encode the data, and then encode the length (shifting the data if necessary // to make room). const speculativeLength = 1 func appendSpeculativeLength(b []byte) ([]byte, int) { pos := len(b) b = append(b, "\x00\x00\x00\x00"[:speculativeLength]...) return b, pos } func finishSpeculativeLength(b []byte, pos int) []byte { mlen := len(b) - pos - speculativeLength msiz := protowire.SizeVarint(uint64(mlen)) if msiz != speculativeLength { for i := 0; i < msiz-speculativeLength; i++ { b = append(b, 0) } copy(b[pos+msiz:], b[pos+speculativeLength:]) b = b[:pos+msiz+mlen] } protowire.AppendVarint(b[:pos], uint64(mlen)) return b } ================================================ FILE: vendor/google.golang.org/protobuf/proto/encode_gen.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Code generated by generate-types. DO NOT EDIT. package proto import ( "math" "unicode/utf8" "google.golang.org/protobuf/encoding/protowire" "google.golang.org/protobuf/internal/errors" "google.golang.org/protobuf/internal/strs" "google.golang.org/protobuf/reflect/protoreflect" ) var wireTypes = map[protoreflect.Kind]protowire.Type{ protoreflect.BoolKind: protowire.VarintType, protoreflect.EnumKind: protowire.VarintType, protoreflect.Int32Kind: protowire.VarintType, protoreflect.Sint32Kind: protowire.VarintType, protoreflect.Uint32Kind: protowire.VarintType, protoreflect.Int64Kind: protowire.VarintType, protoreflect.Sint64Kind: protowire.VarintType, protoreflect.Uint64Kind: protowire.VarintType, protoreflect.Sfixed32Kind: protowire.Fixed32Type, protoreflect.Fixed32Kind: protowire.Fixed32Type, protoreflect.FloatKind: protowire.Fixed32Type, protoreflect.Sfixed64Kind: protowire.Fixed64Type, protoreflect.Fixed64Kind: protowire.Fixed64Type, protoreflect.DoubleKind: protowire.Fixed64Type, protoreflect.StringKind: protowire.BytesType, protoreflect.BytesKind: protowire.BytesType, protoreflect.MessageKind: protowire.BytesType, protoreflect.GroupKind: protowire.StartGroupType, } func (o MarshalOptions) marshalSingular(b []byte, fd protoreflect.FieldDescriptor, v protoreflect.Value) ([]byte, error) { switch fd.Kind() { case protoreflect.BoolKind: b = protowire.AppendVarint(b, protowire.EncodeBool(v.Bool())) case protoreflect.EnumKind: b = protowire.AppendVarint(b, uint64(v.Enum())) case protoreflect.Int32Kind: b = protowire.AppendVarint(b, uint64(int32(v.Int()))) case protoreflect.Sint32Kind: b = protowire.AppendVarint(b, protowire.EncodeZigZag(int64(int32(v.Int())))) case protoreflect.Uint32Kind: b = protowire.AppendVarint(b, uint64(uint32(v.Uint()))) case protoreflect.Int64Kind: b = protowire.AppendVarint(b, uint64(v.Int())) case protoreflect.Sint64Kind: b = protowire.AppendVarint(b, protowire.EncodeZigZag(v.Int())) case protoreflect.Uint64Kind: b = protowire.AppendVarint(b, v.Uint()) case protoreflect.Sfixed32Kind: b = protowire.AppendFixed32(b, uint32(v.Int())) case protoreflect.Fixed32Kind: b = protowire.AppendFixed32(b, uint32(v.Uint())) case protoreflect.FloatKind: b = protowire.AppendFixed32(b, math.Float32bits(float32(v.Float()))) case protoreflect.Sfixed64Kind: b = protowire.AppendFixed64(b, uint64(v.Int())) case protoreflect.Fixed64Kind: b = protowire.AppendFixed64(b, v.Uint()) case protoreflect.DoubleKind: b = protowire.AppendFixed64(b, math.Float64bits(v.Float())) case protoreflect.StringKind: if strs.EnforceUTF8(fd) && !utf8.ValidString(v.String()) { return b, errors.InvalidUTF8(string(fd.FullName())) } b = protowire.AppendString(b, v.String()) case protoreflect.BytesKind: b = protowire.AppendBytes(b, v.Bytes()) case protoreflect.MessageKind: var pos int var err error b, pos = appendSpeculativeLength(b) b, err = o.marshalMessage(b, v.Message()) if err != nil { return b, err } b = finishSpeculativeLength(b, pos) case protoreflect.GroupKind: var err error b, err = o.marshalMessage(b, v.Message()) if err != nil { return b, err } b = protowire.AppendVarint(b, protowire.EncodeTag(fd.Number(), protowire.EndGroupType)) default: return b, errors.New("invalid kind %v", fd.Kind()) } return b, nil } ================================================ FILE: vendor/google.golang.org/protobuf/proto/equal.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package proto import ( "reflect" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/runtime/protoiface" ) // Equal reports whether two messages are equal, // by recursively comparing the fields of the message. // // - Bytes fields are equal if they contain identical bytes. // Empty bytes (regardless of nil-ness) are considered equal. // // - Floating-point fields are equal if they contain the same value. // Unlike the == operator, a NaN is equal to another NaN. // // - Other scalar fields are equal if they contain the same value. // // - Message fields are equal if they have // the same set of populated known and extension field values, and // the same set of unknown fields values. // // - Lists are equal if they are the same length and // each corresponding element is equal. // // - Maps are equal if they have the same set of keys and // the corresponding value for each key is equal. // // An invalid message is not equal to a valid message. // An invalid message is only equal to another invalid message of the // same type. An invalid message often corresponds to a nil pointer // of the concrete message type. For example, (*pb.M)(nil) is not equal // to &pb.M{}. // If two valid messages marshal to the same bytes under deterministic // serialization, then Equal is guaranteed to report true. func Equal(x, y Message) bool { if x == nil || y == nil { return x == nil && y == nil } if reflect.TypeOf(x).Kind() == reflect.Ptr && x == y { // Avoid an expensive comparison if both inputs are identical pointers. return true } mx := x.ProtoReflect() my := y.ProtoReflect() if mx.IsValid() != my.IsValid() { return false } // Only one of the messages needs to implement the fast-path for it to work. pmx := protoMethods(mx) pmy := protoMethods(my) if pmx != nil && pmy != nil && pmx.Equal != nil && pmy.Equal != nil { return pmx.Equal(protoiface.EqualInput{MessageA: mx, MessageB: my}).Equal } vx := protoreflect.ValueOfMessage(mx) vy := protoreflect.ValueOfMessage(my) return vx.Equal(vy) } ================================================ FILE: vendor/google.golang.org/protobuf/proto/extension.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package proto import ( "google.golang.org/protobuf/reflect/protoreflect" ) // HasExtension reports whether an extension field is populated. // It returns false if m is invalid or if xt does not extend m. func HasExtension(m Message, xt protoreflect.ExtensionType) bool { // Treat nil message interface or descriptor as an empty message; no populated // fields. if m == nil || xt == nil { return false } // As a special-case, we reports invalid or mismatching descriptors // as always not being populated (since they aren't). mr := m.ProtoReflect() xd := xt.TypeDescriptor() if mr.Descriptor() != xd.ContainingMessage() { return false } return mr.Has(xd) } // ClearExtension clears an extension field such that subsequent // [HasExtension] calls return false. // It panics if m is invalid or if xt does not extend m. func ClearExtension(m Message, xt protoreflect.ExtensionType) { m.ProtoReflect().Clear(xt.TypeDescriptor()) } // GetExtension retrieves the value for an extension field. // If the field is unpopulated, it returns the default value for // scalars and an immutable, empty value for lists or messages. // It panics if xt does not extend m. // // The type of the value is dependent on the field type of the extension. // For extensions generated by protoc-gen-go, the Go type is as follows: // // ╔═══════════════════╤═════════════════════════╗ // ║ Go type │ Protobuf kind ║ // ╠═══════════════════╪═════════════════════════╣ // ║ bool │ bool ║ // ║ int32 │ int32, sint32, sfixed32 ║ // ║ int64 │ int64, sint64, sfixed64 ║ // ║ uint32 │ uint32, fixed32 ║ // ║ uint64 │ uint64, fixed64 ║ // ║ float32 │ float ║ // ║ float64 │ double ║ // ║ string │ string ║ // ║ []byte │ bytes ║ // ║ protoreflect.Enum │ enum ║ // ║ proto.Message │ message, group ║ // ╚═══════════════════╧═════════════════════════╝ // // The protoreflect.Enum and proto.Message types are the concrete Go type // associated with the named enum or message. Repeated fields are represented // using a Go slice of the base element type. // // If a generated extension descriptor variable is directly passed to // GetExtension, then the call should be followed immediately by a // type assertion to the expected output value. For example: // // mm := proto.GetExtension(m, foopb.E_MyExtension).(*foopb.MyMessage) // // This pattern enables static analysis tools to verify that the asserted type // matches the Go type associated with the extension field and // also enables a possible future migration to a type-safe extension API. // // Since singular messages are the most common extension type, the pattern of // calling HasExtension followed by GetExtension may be simplified to: // // if mm := proto.GetExtension(m, foopb.E_MyExtension).(*foopb.MyMessage); mm != nil { // ... // make use of mm // } // // The mm variable is non-nil if and only if HasExtension reports true. func GetExtension(m Message, xt protoreflect.ExtensionType) any { // Treat nil message interface as an empty message; return the default. if m == nil { return xt.InterfaceOf(xt.Zero()) } return xt.InterfaceOf(m.ProtoReflect().Get(xt.TypeDescriptor())) } // SetExtension stores the value of an extension field. // It panics if m is invalid, xt does not extend m, or if type of v // is invalid for the specified extension field. // // The type of the value is dependent on the field type of the extension. // For extensions generated by protoc-gen-go, the Go type is as follows: // // ╔═══════════════════╤═════════════════════════╗ // ║ Go type │ Protobuf kind ║ // ╠═══════════════════╪═════════════════════════╣ // ║ bool │ bool ║ // ║ int32 │ int32, sint32, sfixed32 ║ // ║ int64 │ int64, sint64, sfixed64 ║ // ║ uint32 │ uint32, fixed32 ║ // ║ uint64 │ uint64, fixed64 ║ // ║ float32 │ float ║ // ║ float64 │ double ║ // ║ string │ string ║ // ║ []byte │ bytes ║ // ║ protoreflect.Enum │ enum ║ // ║ proto.Message │ message, group ║ // ╚═══════════════════╧═════════════════════════╝ // // The protoreflect.Enum and proto.Message types are the concrete Go type // associated with the named enum or message. Repeated fields are represented // using a Go slice of the base element type. // // If a generated extension descriptor variable is directly passed to // SetExtension (e.g., foopb.E_MyExtension), then the value should be a // concrete type that matches the expected Go type for the extension descriptor // so that static analysis tools can verify type correctness. // This also enables a possible future migration to a type-safe extension API. func SetExtension(m Message, xt protoreflect.ExtensionType, v any) { xd := xt.TypeDescriptor() pv := xt.ValueOf(v) // Specially treat an invalid list, map, or message as clear. isValid := true switch { case xd.IsList(): isValid = pv.List().IsValid() case xd.IsMap(): isValid = pv.Map().IsValid() case xd.Message() != nil: isValid = pv.Message().IsValid() } if !isValid { m.ProtoReflect().Clear(xd) return } m.ProtoReflect().Set(xd, pv) } // RangeExtensions iterates over every populated extension field in m in an // undefined order, calling f for each extension type and value encountered. // It returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current extension field. func RangeExtensions(m Message, f func(protoreflect.ExtensionType, any) bool) { // Treat nil message interface as an empty message; nothing to range over. if m == nil { return } m.ProtoReflect().Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool { if fd.IsExtension() { xt := fd.(protoreflect.ExtensionTypeDescriptor).Type() vi := xt.InterfaceOf(v) return f(xt, vi) } return true }) } ================================================ FILE: vendor/google.golang.org/protobuf/proto/merge.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package proto import ( "fmt" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/runtime/protoiface" ) // Merge merges src into dst, which must be a message with the same descriptor. // // Populated scalar fields in src are copied to dst, while populated // singular messages in src are merged into dst by recursively calling Merge. // The elements of every list field in src is appended to the corresponded // list fields in dst. The entries of every map field in src is copied into // the corresponding map field in dst, possibly replacing existing entries. // The unknown fields of src are appended to the unknown fields of dst. // // It is semantically equivalent to unmarshaling the encoded form of src // into dst with the [UnmarshalOptions.Merge] option specified. func Merge(dst, src Message) { // TODO: Should nil src be treated as semantically equivalent to a // untyped, read-only, empty message? What about a nil dst? dstMsg, srcMsg := dst.ProtoReflect(), src.ProtoReflect() if dstMsg.Descriptor() != srcMsg.Descriptor() { if got, want := dstMsg.Descriptor().FullName(), srcMsg.Descriptor().FullName(); got != want { panic(fmt.Sprintf("descriptor mismatch: %v != %v", got, want)) } panic("descriptor mismatch") } mergeOptions{}.mergeMessage(dstMsg, srcMsg) } // Clone returns a deep copy of m. // If the top-level message is invalid, it returns an invalid message as well. func Clone(m Message) Message { // NOTE: Most usages of Clone assume the following properties: // t := reflect.TypeOf(m) // t == reflect.TypeOf(m.ProtoReflect().New().Interface()) // t == reflect.TypeOf(m.ProtoReflect().Type().Zero().Interface()) // // Embedding protobuf messages breaks this since the parent type will have // a forwarded ProtoReflect method, but the Interface method will return // the underlying embedded message type. if m == nil { return nil } src := m.ProtoReflect() if !src.IsValid() { return src.Type().Zero().Interface() } dst := src.New() mergeOptions{}.mergeMessage(dst, src) return dst.Interface() } // CloneOf returns a deep copy of m. If the top-level message is invalid, // it returns an invalid message as well. func CloneOf[M Message](m M) M { return Clone(m).(M) } // mergeOptions provides a namespace for merge functions, and can be // exported in the future if we add user-visible merge options. type mergeOptions struct{} func (o mergeOptions) mergeMessage(dst, src protoreflect.Message) { methods := protoMethods(dst) if methods != nil && methods.Merge != nil { in := protoiface.MergeInput{ Destination: dst, Source: src, } out := methods.Merge(in) if out.Flags&protoiface.MergeComplete != 0 { return } } if !dst.IsValid() { panic(fmt.Sprintf("cannot merge into invalid %v message", dst.Descriptor().FullName())) } src.Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool { switch { case fd.IsList(): o.mergeList(dst.Mutable(fd).List(), v.List(), fd) case fd.IsMap(): o.mergeMap(dst.Mutable(fd).Map(), v.Map(), fd.MapValue()) case fd.Message() != nil: o.mergeMessage(dst.Mutable(fd).Message(), v.Message()) case fd.Kind() == protoreflect.BytesKind: dst.Set(fd, o.cloneBytes(v)) default: dst.Set(fd, v) } return true }) if len(src.GetUnknown()) > 0 { dst.SetUnknown(append(dst.GetUnknown(), src.GetUnknown()...)) } } func (o mergeOptions) mergeList(dst, src protoreflect.List, fd protoreflect.FieldDescriptor) { // Merge semantics appends to the end of the existing list. for i, n := 0, src.Len(); i < n; i++ { switch v := src.Get(i); { case fd.Message() != nil: dstv := dst.NewElement() o.mergeMessage(dstv.Message(), v.Message()) dst.Append(dstv) case fd.Kind() == protoreflect.BytesKind: dst.Append(o.cloneBytes(v)) default: dst.Append(v) } } } func (o mergeOptions) mergeMap(dst, src protoreflect.Map, fd protoreflect.FieldDescriptor) { // Merge semantics replaces, rather than merges into existing entries. src.Range(func(k protoreflect.MapKey, v protoreflect.Value) bool { switch { case fd.Message() != nil: dstv := dst.NewValue() o.mergeMessage(dstv.Message(), v.Message()) dst.Set(k, dstv) case fd.Kind() == protoreflect.BytesKind: dst.Set(k, o.cloneBytes(v)) default: dst.Set(k, v) } return true }) } func (o mergeOptions) cloneBytes(v protoreflect.Value) protoreflect.Value { return protoreflect.ValueOfBytes(append([]byte{}, v.Bytes()...)) } ================================================ FILE: vendor/google.golang.org/protobuf/proto/messageset.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package proto import ( "google.golang.org/protobuf/encoding/protowire" "google.golang.org/protobuf/internal/encoding/messageset" "google.golang.org/protobuf/internal/errors" "google.golang.org/protobuf/internal/flags" "google.golang.org/protobuf/internal/order" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/reflect/protoregistry" ) func (o MarshalOptions) sizeMessageSet(m protoreflect.Message) (size int) { m.Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool { size += messageset.SizeField(fd.Number()) size += protowire.SizeTag(messageset.FieldMessage) size += protowire.SizeBytes(o.size(v.Message())) return true }) size += messageset.SizeUnknown(m.GetUnknown()) return size } func (o MarshalOptions) marshalMessageSet(b []byte, m protoreflect.Message) ([]byte, error) { if !flags.ProtoLegacy { return b, errors.New("no support for message_set_wire_format") } fieldOrder := order.AnyFieldOrder if o.Deterministic { fieldOrder = order.NumberFieldOrder } var err error order.RangeFields(m, fieldOrder, func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool { b, err = o.marshalMessageSetField(b, fd, v) return err == nil }) if err != nil { return b, err } return messageset.AppendUnknown(b, m.GetUnknown()) } func (o MarshalOptions) marshalMessageSetField(b []byte, fd protoreflect.FieldDescriptor, value protoreflect.Value) ([]byte, error) { b = messageset.AppendFieldStart(b, fd.Number()) b = protowire.AppendTag(b, messageset.FieldMessage, protowire.BytesType) calculatedSize := o.Size(value.Message().Interface()) b = protowire.AppendVarint(b, uint64(calculatedSize)) before := len(b) b, err := o.marshalMessage(b, value.Message()) if err != nil { return b, err } if measuredSize := len(b) - before; calculatedSize != measuredSize { return nil, errors.MismatchedSizeCalculation(calculatedSize, measuredSize) } b = messageset.AppendFieldEnd(b) return b, nil } func (o UnmarshalOptions) unmarshalMessageSet(b []byte, m protoreflect.Message) error { if !flags.ProtoLegacy { return errors.New("no support for message_set_wire_format") } return messageset.Unmarshal(b, false, func(num protowire.Number, v []byte) error { err := o.unmarshalMessageSetField(m, num, v) if err == errUnknown { unknown := m.GetUnknown() unknown = protowire.AppendTag(unknown, num, protowire.BytesType) unknown = protowire.AppendBytes(unknown, v) m.SetUnknown(unknown) return nil } return err }) } func (o UnmarshalOptions) unmarshalMessageSetField(m protoreflect.Message, num protowire.Number, v []byte) error { md := m.Descriptor() if !md.ExtensionRanges().Has(num) { return errUnknown } xt, err := o.Resolver.FindExtensionByNumber(md.FullName(), num) if err == protoregistry.NotFound { return errUnknown } if err != nil { return errors.New("%v: unable to resolve extension %v: %v", md.FullName(), num, err) } xd := xt.TypeDescriptor() if err := o.unmarshalMessage(v, m.Mutable(xd).Message()); err != nil { return err } return nil } ================================================ FILE: vendor/google.golang.org/protobuf/proto/proto.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package proto import ( "google.golang.org/protobuf/internal/errors" "google.golang.org/protobuf/reflect/protoreflect" ) // Message is the top-level interface that all messages must implement. // It provides access to a reflective view of a message. // Any implementation of this interface may be used with all functions in the // protobuf module that accept a Message, except where otherwise specified. // // This is the v2 interface definition for protobuf messages. // The v1 interface definition is [github.com/golang/protobuf/proto.Message]. // // - To convert a v1 message to a v2 message, // use [google.golang.org/protobuf/protoadapt.MessageV2Of]. // - To convert a v2 message to a v1 message, // use [google.golang.org/protobuf/protoadapt.MessageV1Of]. type Message = protoreflect.ProtoMessage // Error matches all errors produced by packages in the protobuf module // according to [errors.Is]. // // Example usage: // // if errors.Is(err, proto.Error) { ... } var Error error func init() { Error = errors.Error } // MessageName returns the full name of m. // If m is nil, it returns an empty string. func MessageName(m Message) protoreflect.FullName { if m == nil { return "" } return m.ProtoReflect().Descriptor().FullName() } ================================================ FILE: vendor/google.golang.org/protobuf/proto/proto_methods.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // The protoreflect build tag disables use of fast-path methods. //go:build !protoreflect // +build !protoreflect package proto import ( "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/runtime/protoiface" ) const hasProtoMethods = true func protoMethods(m protoreflect.Message) *protoiface.Methods { return m.ProtoMethods() } ================================================ FILE: vendor/google.golang.org/protobuf/proto/proto_reflect.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // The protoreflect build tag disables use of fast-path methods. //go:build protoreflect // +build protoreflect package proto import ( "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/runtime/protoiface" ) const hasProtoMethods = false func protoMethods(m protoreflect.Message) *protoiface.Methods { return nil } ================================================ FILE: vendor/google.golang.org/protobuf/proto/reset.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package proto import ( "fmt" "google.golang.org/protobuf/reflect/protoreflect" ) // Reset clears every field in the message. // The resulting message shares no observable memory with its previous state // other than the memory for the message itself. func Reset(m Message) { if mr, ok := m.(interface{ Reset() }); ok && hasProtoMethods { mr.Reset() return } resetMessage(m.ProtoReflect()) } func resetMessage(m protoreflect.Message) { if !m.IsValid() { panic(fmt.Sprintf("cannot reset invalid %v message", m.Descriptor().FullName())) } // Clear all known fields. fds := m.Descriptor().Fields() for i := 0; i < fds.Len(); i++ { m.Clear(fds.Get(i)) } // Clear extension fields. m.Range(func(fd protoreflect.FieldDescriptor, _ protoreflect.Value) bool { m.Clear(fd) return true }) // Clear unknown fields. m.SetUnknown(nil) } ================================================ FILE: vendor/google.golang.org/protobuf/proto/size.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package proto import ( "google.golang.org/protobuf/encoding/protowire" "google.golang.org/protobuf/internal/encoding/messageset" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/runtime/protoiface" ) // Size returns the size in bytes of the wire-format encoding of m. // // Note that Size might return more bytes than Marshal will write in the case of // lazily decoded messages that arrive in non-minimal wire format: see // https://protobuf.dev/reference/go/size/ for more details. func Size(m Message) int { return MarshalOptions{}.Size(m) } // Size returns the size in bytes of the wire-format encoding of m. // // Note that Size might return more bytes than Marshal will write in the case of // lazily decoded messages that arrive in non-minimal wire format: see // https://protobuf.dev/reference/go/size/ for more details. func (o MarshalOptions) Size(m Message) int { // Treat a nil message interface as an empty message; nothing to output. if m == nil { return 0 } return o.size(m.ProtoReflect()) } // size is a centralized function that all size operations go through. // For profiling purposes, avoid changing the name of this function or // introducing other code paths for size that do not go through this. func (o MarshalOptions) size(m protoreflect.Message) (size int) { methods := protoMethods(m) if methods != nil && methods.Size != nil { out := methods.Size(protoiface.SizeInput{ Message: m, Flags: o.flags(), }) return out.Size } if methods != nil && methods.Marshal != nil { // This is not efficient, but we don't have any choice. // This case is mainly used for legacy types with a Marshal method. out, _ := methods.Marshal(protoiface.MarshalInput{ Message: m, Flags: o.flags(), }) return len(out.Buf) } return o.sizeMessageSlow(m) } func (o MarshalOptions) sizeMessageSlow(m protoreflect.Message) (size int) { if messageset.IsMessageSet(m.Descriptor()) { return o.sizeMessageSet(m) } m.Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool { size += o.sizeField(fd, v) return true }) size += len(m.GetUnknown()) return size } func (o MarshalOptions) sizeField(fd protoreflect.FieldDescriptor, value protoreflect.Value) (size int) { num := fd.Number() switch { case fd.IsList(): return o.sizeList(num, fd, value.List()) case fd.IsMap(): return o.sizeMap(num, fd, value.Map()) default: return protowire.SizeTag(num) + o.sizeSingular(num, fd.Kind(), value) } } func (o MarshalOptions) sizeList(num protowire.Number, fd protoreflect.FieldDescriptor, list protoreflect.List) (size int) { sizeTag := protowire.SizeTag(num) if fd.IsPacked() && list.Len() > 0 { content := 0 for i, llen := 0, list.Len(); i < llen; i++ { content += o.sizeSingular(num, fd.Kind(), list.Get(i)) } return sizeTag + protowire.SizeBytes(content) } for i, llen := 0, list.Len(); i < llen; i++ { size += sizeTag + o.sizeSingular(num, fd.Kind(), list.Get(i)) } return size } func (o MarshalOptions) sizeMap(num protowire.Number, fd protoreflect.FieldDescriptor, mapv protoreflect.Map) (size int) { sizeTag := protowire.SizeTag(num) mapv.Range(func(key protoreflect.MapKey, value protoreflect.Value) bool { size += sizeTag size += protowire.SizeBytes(o.sizeField(fd.MapKey(), key.Value()) + o.sizeField(fd.MapValue(), value)) return true }) return size } ================================================ FILE: vendor/google.golang.org/protobuf/proto/size_gen.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Code generated by generate-types. DO NOT EDIT. package proto import ( "google.golang.org/protobuf/encoding/protowire" "google.golang.org/protobuf/reflect/protoreflect" ) func (o MarshalOptions) sizeSingular(num protowire.Number, kind protoreflect.Kind, v protoreflect.Value) int { switch kind { case protoreflect.BoolKind: return protowire.SizeVarint(protowire.EncodeBool(v.Bool())) case protoreflect.EnumKind: return protowire.SizeVarint(uint64(v.Enum())) case protoreflect.Int32Kind: return protowire.SizeVarint(uint64(int32(v.Int()))) case protoreflect.Sint32Kind: return protowire.SizeVarint(protowire.EncodeZigZag(int64(int32(v.Int())))) case protoreflect.Uint32Kind: return protowire.SizeVarint(uint64(uint32(v.Uint()))) case protoreflect.Int64Kind: return protowire.SizeVarint(uint64(v.Int())) case protoreflect.Sint64Kind: return protowire.SizeVarint(protowire.EncodeZigZag(v.Int())) case protoreflect.Uint64Kind: return protowire.SizeVarint(v.Uint()) case protoreflect.Sfixed32Kind: return protowire.SizeFixed32() case protoreflect.Fixed32Kind: return protowire.SizeFixed32() case protoreflect.FloatKind: return protowire.SizeFixed32() case protoreflect.Sfixed64Kind: return protowire.SizeFixed64() case protoreflect.Fixed64Kind: return protowire.SizeFixed64() case protoreflect.DoubleKind: return protowire.SizeFixed64() case protoreflect.StringKind: return protowire.SizeBytes(len(v.String())) case protoreflect.BytesKind: return protowire.SizeBytes(len(v.Bytes())) case protoreflect.MessageKind: return protowire.SizeBytes(o.size(v.Message())) case protoreflect.GroupKind: return protowire.SizeGroup(num, o.size(v.Message())) default: return 0 } } ================================================ FILE: vendor/google.golang.org/protobuf/proto/wrapperopaque.go ================================================ // Copyright 2024 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package proto // ValueOrNil returns nil if has is false, or a pointer to a new variable // containing the value returned by the specified getter. // // This function is similar to the wrappers (proto.Int32(), proto.String(), // etc.), but is generic (works for any field type) and works with the hasser // and getter of a field, as opposed to a value. // // This is convenient when populating builder fields. // // Example: // // hop := attr.GetDirectHop() // injectedRoute := ripb.InjectedRoute_builder{ // Prefixes: route.GetPrefixes(), // NextHop: proto.ValueOrNil(hop.HasAddress(), hop.GetAddress), // } func ValueOrNil[T any](has bool, getter func() T) *T { if !has { return nil } v := getter() return &v } // ValueOrDefault returns the protobuf message val if val is not nil, otherwise // it returns a pointer to an empty val message. // // This function allows for translating code from the old Open Struct API to the // new Opaque API. // // The old Open Struct API represented oneof fields with a wrapper struct: // // var signedImg *accountpb.SignedImage // profile := &accountpb.Profile{ // // The Avatar oneof will be set, with an empty SignedImage. // Avatar: &accountpb.Profile_SignedImage{signedImg}, // } // // The new Opaque API treats oneof fields like regular fields, there are no more // wrapper structs: // // var signedImg *accountpb.SignedImage // profile := &accountpb.Profile{} // profile.SetSignedImage(signedImg) // // For convenience, the Opaque API also offers Builders, which allow for a // direct translation of struct initialization. However, because Builders use // nilness to represent field presence (but there is no non-nil wrapper struct // anymore), Builders cannot distinguish between an unset oneof and a set oneof // with nil message. The above code would need to be translated with help of the // ValueOrDefault function to retain the same behavior: // // var signedImg *accountpb.SignedImage // return &accountpb.Profile_builder{ // SignedImage: proto.ValueOrDefault(signedImg), // }.Build() func ValueOrDefault[T interface { *P Message }, P any](val T) T { if val == nil { return T(new(P)) } return val } // ValueOrDefaultBytes is like ValueOrDefault but for working with fields of // type []byte. func ValueOrDefaultBytes(val []byte) []byte { if val == nil { return []byte{} } return val } ================================================ FILE: vendor/google.golang.org/protobuf/proto/wrappers.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package proto // Bool stores v in a new bool value and returns a pointer to it. func Bool(v bool) *bool { return &v } // Int32 stores v in a new int32 value and returns a pointer to it. func Int32(v int32) *int32 { return &v } // Int64 stores v in a new int64 value and returns a pointer to it. func Int64(v int64) *int64 { return &v } // Float32 stores v in a new float32 value and returns a pointer to it. func Float32(v float32) *float32 { return &v } // Float64 stores v in a new float64 value and returns a pointer to it. func Float64(v float64) *float64 { return &v } // Uint32 stores v in a new uint32 value and returns a pointer to it. func Uint32(v uint32) *uint32 { return &v } // Uint64 stores v in a new uint64 value and returns a pointer to it. func Uint64(v uint64) *uint64 { return &v } // String stores v in a new string value and returns a pointer to it. func String(v string) *string { return &v } ================================================ FILE: vendor/google.golang.org/protobuf/protoadapt/convert.go ================================================ // Copyright 2023 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package protoadapt bridges the original and new proto APIs. package protoadapt import ( "google.golang.org/protobuf/proto" "google.golang.org/protobuf/runtime/protoiface" "google.golang.org/protobuf/runtime/protoimpl" ) // MessageV1 is the original [github.com/golang/protobuf/proto.Message] type. type MessageV1 = protoiface.MessageV1 // MessageV2 is the [google.golang.org/protobuf/proto.Message] type used by the // current [google.golang.org/protobuf] module, adding support for reflection. type MessageV2 = proto.Message // MessageV1Of converts a v2 message to a v1 message. // It returns nil if m is nil. func MessageV1Of(m MessageV2) MessageV1 { return protoimpl.X.ProtoMessageV1Of(m) } // MessageV2Of converts a v1 message to a v2 message. // It returns nil if m is nil. func MessageV2Of(m MessageV1) MessageV2 { return protoimpl.X.ProtoMessageV2Of(m) } ================================================ FILE: vendor/google.golang.org/protobuf/reflect/protodesc/desc.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package protodesc provides functionality for converting // FileDescriptorProto messages to/from [protoreflect.FileDescriptor] values. // // The google.protobuf.FileDescriptorProto is a protobuf message that describes // the type information for a .proto file in a form that is easily serializable. // The [protoreflect.FileDescriptor] is a more structured representation of // the FileDescriptorProto message where references and remote dependencies // can be directly followed. package protodesc import ( "strings" "google.golang.org/protobuf/internal/editionssupport" "google.golang.org/protobuf/internal/errors" "google.golang.org/protobuf/internal/filedesc" "google.golang.org/protobuf/internal/pragma" "google.golang.org/protobuf/internal/strs" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/reflect/protoregistry" "google.golang.org/protobuf/types/descriptorpb" ) // Resolver is the resolver used by [NewFile] to resolve dependencies. // The enums and messages provided must belong to some parent file, // which is also registered. // // It is implemented by [protoregistry.Files]. type Resolver interface { FindFileByPath(string) (protoreflect.FileDescriptor, error) FindDescriptorByName(protoreflect.FullName) (protoreflect.Descriptor, error) } // FileOptions configures the construction of file descriptors. type FileOptions struct { pragma.NoUnkeyedLiterals // AllowUnresolvable configures New to permissively allow unresolvable // file, enum, or message dependencies. Unresolved dependencies are replaced // by placeholder equivalents. // // The following dependencies may be left unresolved: // • Resolving an imported file. // • Resolving the type for a message field or extension field. // If the kind of the field is unknown, then a placeholder is used for both // the Enum and Message accessors on the protoreflect.FieldDescriptor. // • Resolving an enum value set as the default for an optional enum field. // If unresolvable, the protoreflect.FieldDescriptor.Default is set to the // first value in the associated enum (or zero if the also enum dependency // is also unresolvable). The protoreflect.FieldDescriptor.DefaultEnumValue // is populated with a placeholder. // • Resolving the extended message type for an extension field. // • Resolving the input or output message type for a service method. // // If the unresolved dependency uses a relative name, // then the placeholder will contain an invalid FullName with a "*." prefix, // indicating that the starting prefix of the full name is unknown. AllowUnresolvable bool } // NewFile creates a new [protoreflect.FileDescriptor] from the provided // file descriptor message. See [FileOptions.New] for more information. func NewFile(fd *descriptorpb.FileDescriptorProto, r Resolver) (protoreflect.FileDescriptor, error) { return FileOptions{}.New(fd, r) } // NewFiles creates a new [protoregistry.Files] from the provided // FileDescriptorSet message. See [FileOptions.NewFiles] for more information. func NewFiles(fd *descriptorpb.FileDescriptorSet) (*protoregistry.Files, error) { return FileOptions{}.NewFiles(fd) } // New creates a new [protoreflect.FileDescriptor] from the provided // file descriptor message. The file must represent a valid proto file according // to protobuf semantics. The returned descriptor is a deep copy of the input. // // Any imported files, enum types, or message types referenced in the file are // resolved using the provided registry. When looking up an import file path, // the path must be unique. The newly created file descriptor is not registered // back into the provided file registry. func (o FileOptions) New(fd *descriptorpb.FileDescriptorProto, r Resolver) (protoreflect.FileDescriptor, error) { if r == nil { r = (*protoregistry.Files)(nil) // empty resolver } // Handle the file descriptor content. f := &filedesc.File{L2: &filedesc.FileL2{}} switch fd.GetSyntax() { case "proto2", "": f.L1.Syntax = protoreflect.Proto2 f.L1.Edition = filedesc.EditionProto2 case "proto3": f.L1.Syntax = protoreflect.Proto3 f.L1.Edition = filedesc.EditionProto3 case "editions": f.L1.Syntax = protoreflect.Editions f.L1.Edition = fromEditionProto(fd.GetEdition()) default: return nil, errors.New("invalid syntax: %q", fd.GetSyntax()) } f.L1.Path = fd.GetName() if f.L1.Path == "" { return nil, errors.New("file path must be populated") } if f.L1.Syntax == protoreflect.Editions && (fd.GetEdition() < editionssupport.Minimum || fd.GetEdition() > editionssupport.Maximum) && fd.GetEdition() != descriptorpb.Edition_EDITION_UNSTABLE { // Allow cmd/protoc-gen-go/testdata to use any edition for easier // testing of upcoming edition features. if !strings.HasPrefix(fd.GetName(), "cmd/protoc-gen-go/testdata/") { return nil, errors.New("use of edition %v not yet supported by the Go Protobuf runtime", fd.GetEdition()) } } f.L1.Package = protoreflect.FullName(fd.GetPackage()) if !f.L1.Package.IsValid() && f.L1.Package != "" { return nil, errors.New("invalid package: %q", f.L1.Package) } if opts := fd.GetOptions(); opts != nil { opts = proto.Clone(opts).(*descriptorpb.FileOptions) f.L2.Options = func() protoreflect.ProtoMessage { return opts } } initFileDescFromFeatureSet(f, fd.GetOptions().GetFeatures()) f.L2.Imports = make(filedesc.FileImports, len(fd.GetDependency())) for _, i := range fd.GetPublicDependency() { if !(0 <= i && int(i) < len(f.L2.Imports)) || f.L2.Imports[i].IsPublic { return nil, errors.New("invalid or duplicate public import index: %d", i) } f.L2.Imports[i].IsPublic = true } imps := importSet{f.Path(): true} for i, path := range fd.GetDependency() { imp := &f.L2.Imports[i] f, err := r.FindFileByPath(path) if err == protoregistry.NotFound && o.AllowUnresolvable { f = filedesc.PlaceholderFile(path) } else if err != nil { return nil, errors.New("could not resolve import %q: %v", path, err) } imp.FileDescriptor = f if imps[imp.Path()] { return nil, errors.New("already imported %q", path) } imps[imp.Path()] = true } for i := range fd.GetDependency() { imp := &f.L2.Imports[i] imps.importPublic(imp.Imports()) } optionImps := importSet{f.Path(): true} if len(fd.GetOptionDependency()) > 0 { optionImports := make(filedesc.FileImports, len(fd.GetOptionDependency())) for i, path := range fd.GetOptionDependency() { imp := &optionImports[i] f, err := r.FindFileByPath(path) if err == protoregistry.NotFound { // We always allow option imports to be unresolvable. f = filedesc.PlaceholderFile(path) } else if err != nil { return nil, errors.New("could not resolve import %q: %v", path, err) } imp.FileDescriptor = f if imps[imp.Path()] || optionImps[imp.Path()] { return nil, errors.New("already imported %q", path) } // This needs to be a separate map so that we don't recognize non-options // symbols coming from option imports. optionImps[imp.Path()] = true } f.L2.OptionImports = func() protoreflect.FileImports { return &optionImports } } // Handle source locations. f.L2.Locations.File = f for _, loc := range fd.GetSourceCodeInfo().GetLocation() { var l protoreflect.SourceLocation // TODO: Validate that the path points to an actual declaration? l.Path = protoreflect.SourcePath(loc.GetPath()) s := loc.GetSpan() switch len(s) { case 3: l.StartLine, l.StartColumn, l.EndLine, l.EndColumn = int(s[0]), int(s[1]), int(s[0]), int(s[2]) case 4: l.StartLine, l.StartColumn, l.EndLine, l.EndColumn = int(s[0]), int(s[1]), int(s[2]), int(s[3]) default: return nil, errors.New("invalid span: %v", s) } // TODO: Validate that the span information is sensible? // See https://github.com/protocolbuffers/protobuf/issues/6378. if false && (l.EndLine < l.StartLine || l.StartLine < 0 || l.StartColumn < 0 || l.EndColumn < 0 || (l.StartLine == l.EndLine && l.EndColumn <= l.StartColumn)) { return nil, errors.New("invalid span: %v", s) } l.LeadingDetachedComments = loc.GetLeadingDetachedComments() l.LeadingComments = loc.GetLeadingComments() l.TrailingComments = loc.GetTrailingComments() f.L2.Locations.List = append(f.L2.Locations.List, l) } // Step 1: Allocate and derive the names for all declarations. // This copies all fields from the descriptor proto except: // google.protobuf.FieldDescriptorProto.type_name // google.protobuf.FieldDescriptorProto.default_value // google.protobuf.FieldDescriptorProto.oneof_index // google.protobuf.FieldDescriptorProto.extendee // google.protobuf.MethodDescriptorProto.input // google.protobuf.MethodDescriptorProto.output var err error sb := new(strs.Builder) r1 := make(descsByName) if f.L1.Enums.List, err = r1.initEnumDeclarations(fd.GetEnumType(), f, sb); err != nil { return nil, err } if f.L1.Messages.List, err = r1.initMessagesDeclarations(fd.GetMessageType(), f, sb); err != nil { return nil, err } if f.L1.Extensions.List, err = r1.initExtensionDeclarations(fd.GetExtension(), f, sb); err != nil { return nil, err } if f.L1.Services.List, err = r1.initServiceDeclarations(fd.GetService(), f, sb); err != nil { return nil, err } // Step 2: Resolve every dependency reference not handled by step 1. r2 := &resolver{local: r1, remote: r, imports: imps, allowUnresolvable: o.AllowUnresolvable} if err := r2.resolveMessageDependencies(f.L1.Messages.List, fd.GetMessageType()); err != nil { return nil, err } if err := r2.resolveExtensionDependencies(f.L1.Extensions.List, fd.GetExtension()); err != nil { return nil, err } if err := r2.resolveServiceDependencies(f.L1.Services.List, fd.GetService()); err != nil { return nil, err } // Step 3: Validate every enum, message, and extension declaration. if err := validateEnumDeclarations(f.L1.Enums.List, fd.GetEnumType()); err != nil { return nil, err } if err := validateMessageDeclarations(f, f.L1.Messages.List, fd.GetMessageType()); err != nil { return nil, err } if err := validateExtensionDeclarations(f, f.L1.Extensions.List, fd.GetExtension()); err != nil { return nil, err } return f, nil } type importSet map[string]bool func (is importSet) importPublic(imps protoreflect.FileImports) { for i := 0; i < imps.Len(); i++ { if imp := imps.Get(i); imp.IsPublic { is[imp.Path()] = true is.importPublic(imp.Imports()) } } } // NewFiles creates a new [protoregistry.Files] from the provided // FileDescriptorSet message. The descriptor set must include only // valid files according to protobuf semantics. The returned descriptors // are a deep copy of the input. func (o FileOptions) NewFiles(fds *descriptorpb.FileDescriptorSet) (*protoregistry.Files, error) { files := make(map[string]*descriptorpb.FileDescriptorProto) for _, fd := range fds.File { if _, ok := files[fd.GetName()]; ok { return nil, errors.New("file appears multiple times: %q", fd.GetName()) } files[fd.GetName()] = fd } r := &protoregistry.Files{} for _, fd := range files { if err := o.addFileDeps(r, fd, files); err != nil { return nil, err } } return r, nil } func (o FileOptions) addFileDeps(r *protoregistry.Files, fd *descriptorpb.FileDescriptorProto, files map[string]*descriptorpb.FileDescriptorProto) error { // Set the entry to nil while descending into a file's dependencies to detect cycles. files[fd.GetName()] = nil for _, dep := range fd.Dependency { depfd, ok := files[dep] if depfd == nil { if ok { return errors.New("import cycle in file: %q", dep) } continue } if err := o.addFileDeps(r, depfd, files); err != nil { return err } } // Delete the entry once dependencies are processed. delete(files, fd.GetName()) f, err := o.New(fd, r) if err != nil { return err } return r.RegisterFile(f) } ================================================ FILE: vendor/google.golang.org/protobuf/reflect/protodesc/desc_init.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package protodesc import ( "google.golang.org/protobuf/internal/errors" "google.golang.org/protobuf/internal/filedesc" "google.golang.org/protobuf/internal/strs" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/types/descriptorpb" ) type descsByName map[protoreflect.FullName]protoreflect.Descriptor func (r descsByName) initEnumDeclarations(eds []*descriptorpb.EnumDescriptorProto, parent protoreflect.Descriptor, sb *strs.Builder) (es []filedesc.Enum, err error) { es = make([]filedesc.Enum, len(eds)) // allocate up-front to ensure stable pointers for i, ed := range eds { e := &es[i] e.L2 = new(filedesc.EnumL2) if e.L0, err = r.makeBase(e, parent, ed.GetName(), i, sb); err != nil { return nil, err } if opts := ed.GetOptions(); opts != nil { opts = proto.Clone(opts).(*descriptorpb.EnumOptions) e.L2.Options = func() protoreflect.ProtoMessage { return opts } } e.L1.EditionFeatures = mergeEditionFeatures(parent, ed.GetOptions().GetFeatures()) e.L1.Visibility = int32(ed.GetVisibility()) for _, s := range ed.GetReservedName() { e.L2.ReservedNames.List = append(e.L2.ReservedNames.List, protoreflect.Name(s)) } for _, rr := range ed.GetReservedRange() { e.L2.ReservedRanges.List = append(e.L2.ReservedRanges.List, [2]protoreflect.EnumNumber{ protoreflect.EnumNumber(rr.GetStart()), protoreflect.EnumNumber(rr.GetEnd()), }) } if e.L2.Values.List, err = r.initEnumValuesFromDescriptorProto(ed.GetValue(), e, sb); err != nil { return nil, err } } return es, nil } func (r descsByName) initEnumValuesFromDescriptorProto(vds []*descriptorpb.EnumValueDescriptorProto, parent protoreflect.Descriptor, sb *strs.Builder) (vs []filedesc.EnumValue, err error) { vs = make([]filedesc.EnumValue, len(vds)) // allocate up-front to ensure stable pointers for i, vd := range vds { v := &vs[i] if v.L0, err = r.makeBase(v, parent, vd.GetName(), i, sb); err != nil { return nil, err } if opts := vd.GetOptions(); opts != nil { opts = proto.Clone(opts).(*descriptorpb.EnumValueOptions) v.L1.Options = func() protoreflect.ProtoMessage { return opts } } v.L1.Number = protoreflect.EnumNumber(vd.GetNumber()) } return vs, nil } func (r descsByName) initMessagesDeclarations(mds []*descriptorpb.DescriptorProto, parent protoreflect.Descriptor, sb *strs.Builder) (ms []filedesc.Message, err error) { ms = make([]filedesc.Message, len(mds)) // allocate up-front to ensure stable pointers for i, md := range mds { m := &ms[i] m.L2 = new(filedesc.MessageL2) if m.L0, err = r.makeBase(m, parent, md.GetName(), i, sb); err != nil { return nil, err } m.L1.EditionFeatures = mergeEditionFeatures(parent, md.GetOptions().GetFeatures()) m.L1.Visibility = int32(md.GetVisibility()) if opts := md.GetOptions(); opts != nil { opts = proto.Clone(opts).(*descriptorpb.MessageOptions) m.L2.Options = func() protoreflect.ProtoMessage { return opts } m.L1.IsMapEntry = opts.GetMapEntry() m.L1.IsMessageSet = opts.GetMessageSetWireFormat() } for _, s := range md.GetReservedName() { m.L2.ReservedNames.List = append(m.L2.ReservedNames.List, protoreflect.Name(s)) } for _, rr := range md.GetReservedRange() { m.L2.ReservedRanges.List = append(m.L2.ReservedRanges.List, [2]protoreflect.FieldNumber{ protoreflect.FieldNumber(rr.GetStart()), protoreflect.FieldNumber(rr.GetEnd()), }) } for _, xr := range md.GetExtensionRange() { m.L2.ExtensionRanges.List = append(m.L2.ExtensionRanges.List, [2]protoreflect.FieldNumber{ protoreflect.FieldNumber(xr.GetStart()), protoreflect.FieldNumber(xr.GetEnd()), }) var optsFunc func() protoreflect.ProtoMessage if opts := xr.GetOptions(); opts != nil { opts = proto.Clone(opts).(*descriptorpb.ExtensionRangeOptions) optsFunc = func() protoreflect.ProtoMessage { return opts } } m.L2.ExtensionRangeOptions = append(m.L2.ExtensionRangeOptions, optsFunc) } if m.L2.Fields.List, err = r.initFieldsFromDescriptorProto(md.GetField(), m, sb); err != nil { return nil, err } if m.L2.Oneofs.List, err = r.initOneofsFromDescriptorProto(md.GetOneofDecl(), m, sb); err != nil { return nil, err } if m.L1.Enums.List, err = r.initEnumDeclarations(md.GetEnumType(), m, sb); err != nil { return nil, err } if m.L1.Messages.List, err = r.initMessagesDeclarations(md.GetNestedType(), m, sb); err != nil { return nil, err } if m.L1.Extensions.List, err = r.initExtensionDeclarations(md.GetExtension(), m, sb); err != nil { return nil, err } } return ms, nil } // canBePacked returns whether the field can use packed encoding: // https://protobuf.dev/programming-guides/encoding/#packed func canBePacked(fd *descriptorpb.FieldDescriptorProto) bool { if fd.GetLabel() != descriptorpb.FieldDescriptorProto_LABEL_REPEATED { return false // not a repeated field } switch protoreflect.Kind(fd.GetType()) { case protoreflect.MessageKind, protoreflect.GroupKind: return false // not a scalar type field case protoreflect.StringKind, protoreflect.BytesKind: // string and bytes can explicitly not be declared as packed, // see https://protobuf.dev/programming-guides/encoding/#packed return false default: return true } } func (r descsByName) initFieldsFromDescriptorProto(fds []*descriptorpb.FieldDescriptorProto, parent protoreflect.Descriptor, sb *strs.Builder) (fs []filedesc.Field, err error) { fs = make([]filedesc.Field, len(fds)) // allocate up-front to ensure stable pointers for i, fd := range fds { f := &fs[i] if f.L0, err = r.makeBase(f, parent, fd.GetName(), i, sb); err != nil { return nil, err } f.L1.EditionFeatures = mergeEditionFeatures(parent, fd.GetOptions().GetFeatures()) f.L1.IsProto3Optional = fd.GetProto3Optional() if opts := fd.GetOptions(); opts != nil { opts = proto.Clone(opts).(*descriptorpb.FieldOptions) f.L1.Options = func() protoreflect.ProtoMessage { return opts } f.L1.IsLazy = opts.GetLazy() if opts.Packed != nil { f.L1.EditionFeatures.IsPacked = opts.GetPacked() } } f.L1.Number = protoreflect.FieldNumber(fd.GetNumber()) f.L1.Cardinality = protoreflect.Cardinality(fd.GetLabel()) if fd.Type != nil { f.L1.Kind = protoreflect.Kind(fd.GetType()) } if fd.JsonName != nil { f.L1.StringName.InitJSON(fd.GetJsonName()) } if f.L1.EditionFeatures.IsLegacyRequired { f.L1.Cardinality = protoreflect.Required } if f.L1.Kind == protoreflect.MessageKind && f.L1.EditionFeatures.IsDelimitedEncoded { f.L1.Kind = protoreflect.GroupKind } } return fs, nil } func (r descsByName) initOneofsFromDescriptorProto(ods []*descriptorpb.OneofDescriptorProto, parent protoreflect.Descriptor, sb *strs.Builder) (os []filedesc.Oneof, err error) { os = make([]filedesc.Oneof, len(ods)) // allocate up-front to ensure stable pointers for i, od := range ods { o := &os[i] if o.L0, err = r.makeBase(o, parent, od.GetName(), i, sb); err != nil { return nil, err } o.L1.EditionFeatures = mergeEditionFeatures(parent, od.GetOptions().GetFeatures()) if opts := od.GetOptions(); opts != nil { opts = proto.Clone(opts).(*descriptorpb.OneofOptions) o.L1.Options = func() protoreflect.ProtoMessage { return opts } } } return os, nil } func (r descsByName) initExtensionDeclarations(xds []*descriptorpb.FieldDescriptorProto, parent protoreflect.Descriptor, sb *strs.Builder) (xs []filedesc.Extension, err error) { xs = make([]filedesc.Extension, len(xds)) // allocate up-front to ensure stable pointers for i, xd := range xds { x := &xs[i] x.L2 = new(filedesc.ExtensionL2) if x.L0, err = r.makeBase(x, parent, xd.GetName(), i, sb); err != nil { return nil, err } x.L1.EditionFeatures = mergeEditionFeatures(parent, xd.GetOptions().GetFeatures()) if opts := xd.GetOptions(); opts != nil { opts = proto.Clone(opts).(*descriptorpb.FieldOptions) x.L2.Options = func() protoreflect.ProtoMessage { return opts } if opts.Packed != nil { x.L1.EditionFeatures.IsPacked = opts.GetPacked() } } x.L1.Number = protoreflect.FieldNumber(xd.GetNumber()) x.L1.Cardinality = protoreflect.Cardinality(xd.GetLabel()) if xd.Type != nil { x.L1.Kind = protoreflect.Kind(xd.GetType()) } if xd.JsonName != nil { x.L2.StringName.InitJSON(xd.GetJsonName()) } if x.L1.Kind == protoreflect.MessageKind && x.L1.EditionFeatures.IsDelimitedEncoded { x.L1.Kind = protoreflect.GroupKind } } return xs, nil } func (r descsByName) initServiceDeclarations(sds []*descriptorpb.ServiceDescriptorProto, parent protoreflect.Descriptor, sb *strs.Builder) (ss []filedesc.Service, err error) { ss = make([]filedesc.Service, len(sds)) // allocate up-front to ensure stable pointers for i, sd := range sds { s := &ss[i] s.L2 = new(filedesc.ServiceL2) if s.L0, err = r.makeBase(s, parent, sd.GetName(), i, sb); err != nil { return nil, err } if opts := sd.GetOptions(); opts != nil { opts = proto.Clone(opts).(*descriptorpb.ServiceOptions) s.L2.Options = func() protoreflect.ProtoMessage { return opts } } if s.L2.Methods.List, err = r.initMethodsFromDescriptorProto(sd.GetMethod(), s, sb); err != nil { return nil, err } } return ss, nil } func (r descsByName) initMethodsFromDescriptorProto(mds []*descriptorpb.MethodDescriptorProto, parent protoreflect.Descriptor, sb *strs.Builder) (ms []filedesc.Method, err error) { ms = make([]filedesc.Method, len(mds)) // allocate up-front to ensure stable pointers for i, md := range mds { m := &ms[i] if m.L0, err = r.makeBase(m, parent, md.GetName(), i, sb); err != nil { return nil, err } if opts := md.GetOptions(); opts != nil { opts = proto.Clone(opts).(*descriptorpb.MethodOptions) m.L1.Options = func() protoreflect.ProtoMessage { return opts } } m.L1.IsStreamingClient = md.GetClientStreaming() m.L1.IsStreamingServer = md.GetServerStreaming() } return ms, nil } func (r descsByName) makeBase(child, parent protoreflect.Descriptor, name string, idx int, sb *strs.Builder) (filedesc.BaseL0, error) { if !protoreflect.Name(name).IsValid() { return filedesc.BaseL0{}, errors.New("descriptor %q has an invalid nested name: %q", parent.FullName(), name) } // Derive the full name of the child. // Note that enum values are a sibling to the enum parent in the namespace. var fullName protoreflect.FullName if _, ok := parent.(protoreflect.EnumDescriptor); ok { fullName = sb.AppendFullName(parent.FullName().Parent(), protoreflect.Name(name)) } else { fullName = sb.AppendFullName(parent.FullName(), protoreflect.Name(name)) } if _, ok := r[fullName]; ok { return filedesc.BaseL0{}, errors.New("descriptor %q already declared", fullName) } r[fullName] = child // TODO: Verify that the full name does not already exist in the resolver? // This is not as critical since most usages of NewFile will register // the created file back into the registry, which will perform this check. return filedesc.BaseL0{ FullName: fullName, ParentFile: parent.ParentFile().(*filedesc.File), Parent: parent, Index: idx, }, nil } ================================================ FILE: vendor/google.golang.org/protobuf/reflect/protodesc/desc_resolve.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package protodesc import ( "google.golang.org/protobuf/internal/encoding/defval" "google.golang.org/protobuf/internal/errors" "google.golang.org/protobuf/internal/filedesc" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/reflect/protoregistry" "google.golang.org/protobuf/types/descriptorpb" ) // resolver is a wrapper around a local registry of declarations within the file // and the remote resolver. The remote resolver is restricted to only return // descriptors that have been imported. type resolver struct { local descsByName remote Resolver imports importSet allowUnresolvable bool } func (r *resolver) resolveMessageDependencies(ms []filedesc.Message, mds []*descriptorpb.DescriptorProto) (err error) { for i, md := range mds { m := &ms[i] for j, fd := range md.GetField() { f := &m.L2.Fields.List[j] if f.L1.Cardinality == protoreflect.Required { m.L2.RequiredNumbers.List = append(m.L2.RequiredNumbers.List, f.L1.Number) } if fd.OneofIndex != nil { k := int(fd.GetOneofIndex()) if !(0 <= k && k < len(md.GetOneofDecl())) { return errors.New("message field %q has an invalid oneof index: %d", f.FullName(), k) } o := &m.L2.Oneofs.List[k] f.L1.ContainingOneof = o o.L1.Fields.List = append(o.L1.Fields.List, f) } if f.L1.Kind, f.L1.Enum, f.L1.Message, err = r.findTarget(f.Kind(), f.Parent().FullName(), partialName(fd.GetTypeName())); err != nil { return errors.New("message field %q cannot resolve type: %v", f.FullName(), err) } if f.L1.Kind == protoreflect.GroupKind && (f.IsMap() || f.IsMapEntry()) { // A map field might inherit delimited encoding from a file-wide default feature. // But maps never actually use delimited encoding. (At least for now...) f.L1.Kind = protoreflect.MessageKind } if fd.DefaultValue != nil { v, ev, err := unmarshalDefault(fd.GetDefaultValue(), f, r.allowUnresolvable) if err != nil { return errors.New("message field %q has invalid default: %v", f.FullName(), err) } f.L1.Default = filedesc.DefaultValue(v, ev) } } if err := r.resolveMessageDependencies(m.L1.Messages.List, md.GetNestedType()); err != nil { return err } if err := r.resolveExtensionDependencies(m.L1.Extensions.List, md.GetExtension()); err != nil { return err } } return nil } func (r *resolver) resolveExtensionDependencies(xs []filedesc.Extension, xds []*descriptorpb.FieldDescriptorProto) (err error) { for i, xd := range xds { x := &xs[i] if x.L1.Extendee, err = r.findMessageDescriptor(x.Parent().FullName(), partialName(xd.GetExtendee())); err != nil { return errors.New("extension field %q cannot resolve extendee: %v", x.FullName(), err) } if x.L1.Kind, x.L2.Enum, x.L2.Message, err = r.findTarget(x.Kind(), x.Parent().FullName(), partialName(xd.GetTypeName())); err != nil { return errors.New("extension field %q cannot resolve type: %v", x.FullName(), err) } if xd.DefaultValue != nil { v, ev, err := unmarshalDefault(xd.GetDefaultValue(), x, r.allowUnresolvable) if err != nil { return errors.New("extension field %q has invalid default: %v", x.FullName(), err) } x.L2.Default = filedesc.DefaultValue(v, ev) } } return nil } func (r *resolver) resolveServiceDependencies(ss []filedesc.Service, sds []*descriptorpb.ServiceDescriptorProto) (err error) { for i, sd := range sds { s := &ss[i] for j, md := range sd.GetMethod() { m := &s.L2.Methods.List[j] m.L1.Input, err = r.findMessageDescriptor(m.Parent().FullName(), partialName(md.GetInputType())) if err != nil { return errors.New("service method %q cannot resolve input: %v", m.FullName(), err) } m.L1.Output, err = r.findMessageDescriptor(s.FullName(), partialName(md.GetOutputType())) if err != nil { return errors.New("service method %q cannot resolve output: %v", m.FullName(), err) } } } return nil } // findTarget finds an enum or message descriptor if k is an enum, message, // group, or unknown. If unknown, and the name could be resolved, the kind // returned kind is set based on the type of the resolved descriptor. func (r *resolver) findTarget(k protoreflect.Kind, scope protoreflect.FullName, ref partialName) (protoreflect.Kind, protoreflect.EnumDescriptor, protoreflect.MessageDescriptor, error) { switch k { case protoreflect.EnumKind: ed, err := r.findEnumDescriptor(scope, ref) if err != nil { return 0, nil, nil, err } return k, ed, nil, nil case protoreflect.MessageKind, protoreflect.GroupKind: md, err := r.findMessageDescriptor(scope, ref) if err != nil { return 0, nil, nil, err } return k, nil, md, nil case 0: // Handle unspecified kinds (possible with parsers that operate // on a per-file basis without knowledge of dependencies). d, err := r.findDescriptor(scope, ref) if err == protoregistry.NotFound && r.allowUnresolvable { return k, filedesc.PlaceholderEnum(ref.FullName()), filedesc.PlaceholderMessage(ref.FullName()), nil } else if err == protoregistry.NotFound { return 0, nil, nil, errors.New("%q not found", ref.FullName()) } else if err != nil { return 0, nil, nil, err } switch d := d.(type) { case protoreflect.EnumDescriptor: return protoreflect.EnumKind, d, nil, nil case protoreflect.MessageDescriptor: return protoreflect.MessageKind, nil, d, nil default: return 0, nil, nil, errors.New("unknown kind") } default: if ref != "" { return 0, nil, nil, errors.New("target name cannot be specified for %v", k) } if !k.IsValid() { return 0, nil, nil, errors.New("invalid kind: %d", k) } return k, nil, nil, nil } } // findDescriptor finds the descriptor by name, // which may be a relative name within some scope. // // Suppose the scope was "fizz.buzz" and the reference was "Foo.Bar", // then the following full names are searched: // - fizz.buzz.Foo.Bar // - fizz.Foo.Bar // - Foo.Bar func (r *resolver) findDescriptor(scope protoreflect.FullName, ref partialName) (protoreflect.Descriptor, error) { if !ref.IsValid() { return nil, errors.New("invalid name reference: %q", ref) } if ref.IsFull() { scope, ref = "", ref[1:] } var foundButNotImported protoreflect.Descriptor for { // Derive the full name to search. s := protoreflect.FullName(ref) if scope != "" { s = scope + "." + s } // Check the current file for the descriptor. if d, ok := r.local[s]; ok { return d, nil } // Check the remote registry for the descriptor. d, err := r.remote.FindDescriptorByName(s) if err == nil { // Only allow descriptors covered by one of the imports. if r.imports[d.ParentFile().Path()] { return d, nil } foundButNotImported = d } else if err != protoregistry.NotFound { return nil, errors.Wrap(err, "%q", s) } // Continue on at a higher level of scoping. if scope == "" { if d := foundButNotImported; d != nil { return nil, errors.New("resolved %q, but %q is not imported", d.FullName(), d.ParentFile().Path()) } return nil, protoregistry.NotFound } scope = scope.Parent() } } func (r *resolver) findEnumDescriptor(scope protoreflect.FullName, ref partialName) (protoreflect.EnumDescriptor, error) { d, err := r.findDescriptor(scope, ref) if err == protoregistry.NotFound && r.allowUnresolvable { return filedesc.PlaceholderEnum(ref.FullName()), nil } else if err == protoregistry.NotFound { return nil, errors.New("%q not found", ref.FullName()) } else if err != nil { return nil, err } ed, ok := d.(protoreflect.EnumDescriptor) if !ok { return nil, errors.New("resolved %q, but it is not an enum", d.FullName()) } return ed, nil } func (r *resolver) findMessageDescriptor(scope protoreflect.FullName, ref partialName) (protoreflect.MessageDescriptor, error) { d, err := r.findDescriptor(scope, ref) if err == protoregistry.NotFound && r.allowUnresolvable { return filedesc.PlaceholderMessage(ref.FullName()), nil } else if err == protoregistry.NotFound { return nil, errors.New("%q not found", ref.FullName()) } else if err != nil { return nil, err } md, ok := d.(protoreflect.MessageDescriptor) if !ok { return nil, errors.New("resolved %q, but it is not an message", d.FullName()) } return md, nil } // partialName is the partial name. A leading dot means that the name is full, // otherwise the name is relative to some current scope. // See google.protobuf.FieldDescriptorProto.type_name. type partialName string func (s partialName) IsFull() bool { return len(s) > 0 && s[0] == '.' } func (s partialName) IsValid() bool { if s.IsFull() { return protoreflect.FullName(s[1:]).IsValid() } return protoreflect.FullName(s).IsValid() } const unknownPrefix = "*." // FullName converts the partial name to a full name on a best-effort basis. // If relative, it creates an invalid full name, using a "*." prefix // to indicate that the start of the full name is unknown. func (s partialName) FullName() protoreflect.FullName { if s.IsFull() { return protoreflect.FullName(s[1:]) } return protoreflect.FullName(unknownPrefix + s) } func unmarshalDefault(s string, fd protoreflect.FieldDescriptor, allowUnresolvable bool) (protoreflect.Value, protoreflect.EnumValueDescriptor, error) { var evs protoreflect.EnumValueDescriptors if fd.Enum() != nil { evs = fd.Enum().Values() } v, ev, err := defval.Unmarshal(s, fd.Kind(), evs, defval.Descriptor) if err != nil && allowUnresolvable && evs != nil && protoreflect.Name(s).IsValid() { v = protoreflect.ValueOfEnum(0) if evs.Len() > 0 { v = protoreflect.ValueOfEnum(evs.Get(0).Number()) } ev = filedesc.PlaceholderEnumValue(fd.Enum().FullName().Parent().Append(protoreflect.Name(s))) } else if err != nil { return v, ev, err } if !fd.HasPresence() { return v, ev, errors.New("cannot be specified with implicit field presence") } if fd.Kind() == protoreflect.MessageKind || fd.Kind() == protoreflect.GroupKind || fd.Cardinality() == protoreflect.Repeated { return v, ev, errors.New("cannot be specified on composite types") } return v, ev, nil } ================================================ FILE: vendor/google.golang.org/protobuf/reflect/protodesc/desc_validate.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package protodesc import ( "strings" "unicode" "google.golang.org/protobuf/encoding/protowire" "google.golang.org/protobuf/internal/errors" "google.golang.org/protobuf/internal/filedesc" "google.golang.org/protobuf/internal/flags" "google.golang.org/protobuf/internal/genid" "google.golang.org/protobuf/internal/strs" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/types/descriptorpb" ) func validateEnumDeclarations(es []filedesc.Enum, eds []*descriptorpb.EnumDescriptorProto) error { for i, ed := range eds { e := &es[i] if err := e.L2.ReservedNames.CheckValid(); err != nil { return errors.New("enum %q reserved names has %v", e.FullName(), err) } if err := e.L2.ReservedRanges.CheckValid(); err != nil { return errors.New("enum %q reserved ranges has %v", e.FullName(), err) } if len(ed.GetValue()) == 0 { return errors.New("enum %q must contain at least one value declaration", e.FullName()) } allowAlias := ed.GetOptions().GetAllowAlias() foundAlias := false for i := 0; i < e.Values().Len(); i++ { v1 := e.Values().Get(i) if v2 := e.Values().ByNumber(v1.Number()); v1 != v2 { foundAlias = true if !allowAlias { return errors.New("enum %q has conflicting non-aliased values on number %d: %q with %q", e.FullName(), v1.Number(), v1.Name(), v2.Name()) } } } if allowAlias && !foundAlias { return errors.New("enum %q allows aliases, but none were found", e.FullName()) } if !e.IsClosed() { if v := e.Values().Get(0); v.Number() != 0 { return errors.New("enum %q using open semantics must have zero number for the first value", v.FullName()) } // Verify that value names in open enums do not conflict if the // case-insensitive prefix is removed. // See protoc v3.8.0: src/google/protobuf/descriptor.cc:4991-5055 names := map[string]protoreflect.EnumValueDescriptor{} prefix := strings.Replace(strings.ToLower(string(e.Name())), "_", "", -1) for i := 0; i < e.Values().Len(); i++ { v1 := e.Values().Get(i) s := strs.EnumValueName(strs.TrimEnumPrefix(string(v1.Name()), prefix)) if v2, ok := names[s]; ok && v1.Number() != v2.Number() { return errors.New("enum %q using open semantics has conflict: %q with %q", e.FullName(), v1.Name(), v2.Name()) } names[s] = v1 } } for j, vd := range ed.GetValue() { v := &e.L2.Values.List[j] if vd.Number == nil { return errors.New("enum value %q must have a specified number", v.FullName()) } if e.L2.ReservedNames.Has(v.Name()) { return errors.New("enum value %q must not use reserved name", v.FullName()) } if e.L2.ReservedRanges.Has(v.Number()) { return errors.New("enum value %q must not use reserved number %d", v.FullName(), v.Number()) } } } return nil } func validateMessageDeclarations(file *filedesc.File, ms []filedesc.Message, mds []*descriptorpb.DescriptorProto) error { // There are a few limited exceptions only for proto3 isProto3 := file.L1.Edition == fromEditionProto(descriptorpb.Edition_EDITION_PROTO3) for i, md := range mds { m := &ms[i] // Handle the message descriptor itself. isMessageSet := md.GetOptions().GetMessageSetWireFormat() if err := m.L2.ReservedNames.CheckValid(); err != nil { return errors.New("message %q reserved names has %v", m.FullName(), err) } if err := m.L2.ReservedRanges.CheckValid(isMessageSet); err != nil { return errors.New("message %q reserved ranges has %v", m.FullName(), err) } if err := m.L2.ExtensionRanges.CheckValid(isMessageSet); err != nil { return errors.New("message %q extension ranges has %v", m.FullName(), err) } if err := (*filedesc.FieldRanges).CheckOverlap(&m.L2.ReservedRanges, &m.L2.ExtensionRanges); err != nil { return errors.New("message %q reserved and extension ranges has %v", m.FullName(), err) } for i := 0; i < m.Fields().Len(); i++ { f1 := m.Fields().Get(i) if f2 := m.Fields().ByNumber(f1.Number()); f1 != f2 { return errors.New("message %q has conflicting fields: %q with %q", m.FullName(), f1.Name(), f2.Name()) } } if isMessageSet && !flags.ProtoLegacy { return errors.New("message %q is a MessageSet, which is a legacy proto1 feature that is no longer supported", m.FullName()) } if isMessageSet && (isProto3 || m.Fields().Len() > 0 || m.ExtensionRanges().Len() == 0) { return errors.New("message %q is an invalid proto1 MessageSet", m.FullName()) } if isProto3 { if m.ExtensionRanges().Len() > 0 { return errors.New("message %q using proto3 semantics cannot have extension ranges", m.FullName()) } } for j, fd := range md.GetField() { f := &m.L2.Fields.List[j] if m.L2.ReservedNames.Has(f.Name()) { return errors.New("message field %q must not use reserved name", f.FullName()) } if !f.Number().IsValid() { return errors.New("message field %q has an invalid number: %d", f.FullName(), f.Number()) } if !f.Cardinality().IsValid() { return errors.New("message field %q has an invalid cardinality: %d", f.FullName(), f.Cardinality()) } if m.L2.ReservedRanges.Has(f.Number()) { return errors.New("message field %q must not use reserved number %d", f.FullName(), f.Number()) } if m.L2.ExtensionRanges.Has(f.Number()) { return errors.New("message field %q with number %d in extension range", f.FullName(), f.Number()) } if fd.Extendee != nil { return errors.New("message field %q may not have extendee: %q", f.FullName(), fd.GetExtendee()) } if f.L1.IsProto3Optional { if !isProto3 { return errors.New("message field %q under proto3 optional semantics must be specified in the proto3 syntax", f.FullName()) } if f.Cardinality() != protoreflect.Optional { return errors.New("message field %q under proto3 optional semantics must have optional cardinality", f.FullName()) } if f.ContainingOneof() != nil && f.ContainingOneof().Fields().Len() != 1 { return errors.New("message field %q under proto3 optional semantics must be within a single element oneof", f.FullName()) } } if f.IsPacked() && !isPackable(f) { return errors.New("message field %q is not packable", f.FullName()) } if err := checkValidGroup(file, f); err != nil { return errors.New("message field %q is an invalid group: %v", f.FullName(), err) } if err := checkValidMap(f); err != nil { return errors.New("message field %q is an invalid map: %v", f.FullName(), err) } if isProto3 { if f.Cardinality() == protoreflect.Required { return errors.New("message field %q using proto3 semantics cannot be required", f.FullName()) } if f.Enum() != nil && !f.Enum().IsPlaceholder() && f.Enum().IsClosed() { return errors.New("message field %q using proto3 semantics may only depend on open enums", f.FullName()) } } if f.Cardinality() == protoreflect.Optional && !f.HasPresence() && f.Enum() != nil && !f.Enum().IsPlaceholder() && f.Enum().IsClosed() { return errors.New("message field %q with implicit presence may only use open enums", f.FullName()) } } seenSynthetic := false // synthetic oneofs for proto3 optional must come after real oneofs for j := range md.GetOneofDecl() { o := &m.L2.Oneofs.List[j] if o.Fields().Len() == 0 { return errors.New("message oneof %q must contain at least one field declaration", o.FullName()) } if n := o.Fields().Len(); n-1 != (o.Fields().Get(n-1).Index() - o.Fields().Get(0).Index()) { return errors.New("message oneof %q must have consecutively declared fields", o.FullName()) } if o.IsSynthetic() { seenSynthetic = true continue } if !o.IsSynthetic() && seenSynthetic { return errors.New("message oneof %q must be declared before synthetic oneofs", o.FullName()) } for i := 0; i < o.Fields().Len(); i++ { f := o.Fields().Get(i) if f.Cardinality() != protoreflect.Optional { return errors.New("message field %q belongs in a oneof and must be optional", f.FullName()) } } } if err := validateEnumDeclarations(m.L1.Enums.List, md.GetEnumType()); err != nil { return err } if err := validateMessageDeclarations(file, m.L1.Messages.List, md.GetNestedType()); err != nil { return err } if err := validateExtensionDeclarations(file, m.L1.Extensions.List, md.GetExtension()); err != nil { return err } } return nil } func validateExtensionDeclarations(f *filedesc.File, xs []filedesc.Extension, xds []*descriptorpb.FieldDescriptorProto) error { for i, xd := range xds { x := &xs[i] // NOTE: Avoid using the IsValid method since extensions to MessageSet // may have a field number higher than normal. This check only verifies // that the number is not negative or reserved. We check again later // if we know that the extendee is definitely not a MessageSet. if n := x.Number(); n < 0 || (protowire.FirstReservedNumber <= n && n <= protowire.LastReservedNumber) { return errors.New("extension field %q has an invalid number: %d", x.FullName(), x.Number()) } if !x.Cardinality().IsValid() || x.Cardinality() == protoreflect.Required { return errors.New("extension field %q has an invalid cardinality: %d", x.FullName(), x.Cardinality()) } if xd.JsonName != nil { // A bug in older versions of protoc would always populate the // "json_name" option for extensions when it is meaningless. // When it did so, it would always use the camel-cased field name. if xd.GetJsonName() != strs.JSONCamelCase(string(x.Name())) { return errors.New("extension field %q may not have an explicitly set JSON name: %q", x.FullName(), xd.GetJsonName()) } } if xd.OneofIndex != nil { return errors.New("extension field %q may not be part of a oneof", x.FullName()) } if md := x.ContainingMessage(); !md.IsPlaceholder() { if !md.ExtensionRanges().Has(x.Number()) { return errors.New("extension field %q extends %q with non-extension field number: %d", x.FullName(), md.FullName(), x.Number()) } isMessageSet := md.Options().(*descriptorpb.MessageOptions).GetMessageSetWireFormat() if isMessageSet && !isOptionalMessage(x) { return errors.New("extension field %q extends MessageSet and must be an optional message", x.FullName()) } if !isMessageSet && !x.Number().IsValid() { return errors.New("extension field %q has an invalid number: %d", x.FullName(), x.Number()) } } if x.IsPacked() && !isPackable(x) { return errors.New("extension field %q is not packable", x.FullName()) } if err := checkValidGroup(f, x); err != nil { return errors.New("extension field %q is an invalid group: %v", x.FullName(), err) } if md := x.Message(); md != nil && md.IsMapEntry() { return errors.New("extension field %q cannot be a map entry", x.FullName()) } if f.L1.Edition == fromEditionProto(descriptorpb.Edition_EDITION_PROTO3) { switch x.ContainingMessage().FullName() { case (*descriptorpb.FileOptions)(nil).ProtoReflect().Descriptor().FullName(): case (*descriptorpb.EnumOptions)(nil).ProtoReflect().Descriptor().FullName(): case (*descriptorpb.EnumValueOptions)(nil).ProtoReflect().Descriptor().FullName(): case (*descriptorpb.MessageOptions)(nil).ProtoReflect().Descriptor().FullName(): case (*descriptorpb.FieldOptions)(nil).ProtoReflect().Descriptor().FullName(): case (*descriptorpb.OneofOptions)(nil).ProtoReflect().Descriptor().FullName(): case (*descriptorpb.ExtensionRangeOptions)(nil).ProtoReflect().Descriptor().FullName(): case (*descriptorpb.ServiceOptions)(nil).ProtoReflect().Descriptor().FullName(): case (*descriptorpb.MethodOptions)(nil).ProtoReflect().Descriptor().FullName(): default: return errors.New("extension field %q cannot be declared in proto3 unless extended descriptor options", x.FullName()) } } } return nil } // isOptionalMessage reports whether this is an optional message. // If the kind is unknown, it is assumed to be a message. func isOptionalMessage(fd protoreflect.FieldDescriptor) bool { return (fd.Kind() == 0 || fd.Kind() == protoreflect.MessageKind) && fd.Cardinality() == protoreflect.Optional } // isPackable checks whether the pack option can be specified. func isPackable(fd protoreflect.FieldDescriptor) bool { switch fd.Kind() { case protoreflect.StringKind, protoreflect.BytesKind, protoreflect.MessageKind, protoreflect.GroupKind: return false } return fd.IsList() } // checkValidGroup reports whether fd is a valid group according to the same // rules that protoc imposes. func checkValidGroup(f *filedesc.File, fd protoreflect.FieldDescriptor) error { md := fd.Message() switch { case fd.Kind() != protoreflect.GroupKind: return nil case f.L1.Edition == fromEditionProto(descriptorpb.Edition_EDITION_PROTO3): return errors.New("invalid under proto3 semantics") case md == nil || md.IsPlaceholder(): return errors.New("message must be resolvable") } if f.L1.Edition < fromEditionProto(descriptorpb.Edition_EDITION_2023) { switch { case fd.FullName().Parent() != md.FullName().Parent(): return errors.New("message and field must be declared in the same scope") case !unicode.IsUpper(rune(md.Name()[0])): return errors.New("message name must start with an uppercase") case fd.Name() != protoreflect.Name(strings.ToLower(string(md.Name()))): return errors.New("field name must be lowercased form of the message name") } } return nil } // checkValidMap checks whether the field is a valid map according to the same // rules that protoc imposes. // See protoc v3.8.0: src/google/protobuf/descriptor.cc:6045-6115 func checkValidMap(fd protoreflect.FieldDescriptor) error { md := fd.Message() switch { case md == nil || !md.IsMapEntry(): return nil case fd.FullName().Parent() != md.FullName().Parent(): return errors.New("message and field must be declared in the same scope") case md.Name() != protoreflect.Name(strs.MapEntryName(string(fd.Name()))): return errors.New("incorrect implicit map entry name") case fd.Cardinality() != protoreflect.Repeated: return errors.New("field must be repeated") case md.Fields().Len() != 2: return errors.New("message must have exactly two fields") case md.ExtensionRanges().Len() > 0: return errors.New("message must not have any extension ranges") case md.Enums().Len()+md.Messages().Len()+md.Extensions().Len() > 0: return errors.New("message must not have any nested declarations") } kf := md.Fields().Get(0) vf := md.Fields().Get(1) switch { case kf.Name() != genid.MapEntry_Key_field_name || kf.Number() != genid.MapEntry_Key_field_number || kf.Cardinality() != protoreflect.Optional || kf.ContainingOneof() != nil || kf.HasDefault(): return errors.New("invalid key field") case vf.Name() != genid.MapEntry_Value_field_name || vf.Number() != genid.MapEntry_Value_field_number || vf.Cardinality() != protoreflect.Optional || vf.ContainingOneof() != nil || vf.HasDefault(): return errors.New("invalid value field") } switch kf.Kind() { case protoreflect.BoolKind: // bool case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: // int32 case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: // int64 case protoreflect.Uint32Kind, protoreflect.Fixed32Kind: // uint32 case protoreflect.Uint64Kind, protoreflect.Fixed64Kind: // uint64 case protoreflect.StringKind: // string default: return errors.New("invalid key kind: %v", kf.Kind()) } if e := vf.Enum(); e != nil && e.Values().Len() > 0 && e.Values().Get(0).Number() != 0 { return errors.New("map enum value must have zero number for the first value") } return nil } ================================================ FILE: vendor/google.golang.org/protobuf/reflect/protodesc/editions.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package protodesc import ( "fmt" "os" "sync" "google.golang.org/protobuf/internal/editiondefaults" "google.golang.org/protobuf/internal/filedesc" "google.golang.org/protobuf/internal/genid" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/types/descriptorpb" "google.golang.org/protobuf/types/gofeaturespb" ) var defaults = &descriptorpb.FeatureSetDefaults{} var defaultsCacheMu sync.Mutex var defaultsCache = make(map[filedesc.Edition]*descriptorpb.FeatureSet) func init() { err := proto.Unmarshal(editiondefaults.Defaults, defaults) if err != nil { fmt.Fprintf(os.Stderr, "unmarshal editions defaults: %v\n", err) os.Exit(1) } } func fromEditionProto(epb descriptorpb.Edition) filedesc.Edition { return filedesc.Edition(epb) } func toEditionProto(ed filedesc.Edition) descriptorpb.Edition { switch ed { case filedesc.EditionUnknown: return descriptorpb.Edition_EDITION_UNKNOWN case filedesc.EditionProto2: return descriptorpb.Edition_EDITION_PROTO2 case filedesc.EditionProto3: return descriptorpb.Edition_EDITION_PROTO3 case filedesc.Edition2023: return descriptorpb.Edition_EDITION_2023 case filedesc.Edition2024: return descriptorpb.Edition_EDITION_2024 case filedesc.EditionUnstable: return descriptorpb.Edition_EDITION_UNSTABLE default: panic(fmt.Sprintf("unknown value for edition: %v", ed)) } } func getFeatureSetFor(ed filedesc.Edition) *descriptorpb.FeatureSet { defaultsCacheMu.Lock() defer defaultsCacheMu.Unlock() if def, ok := defaultsCache[ed]; ok { return def } edpb := toEditionProto(ed) if (defaults.GetMinimumEdition() > edpb || defaults.GetMaximumEdition() < edpb) && edpb != descriptorpb.Edition_EDITION_UNSTABLE { // This should never happen protodesc.(FileOptions).New would fail when // initializing the file descriptor. // This most likely means the embedded defaults were not updated. fmt.Fprintf(os.Stderr, "internal error: unsupported edition %v (did you forget to update the embedded defaults (i.e. the bootstrap descriptor proto)?)\n", edpb) os.Exit(1) } fsed := defaults.GetDefaults()[0] // Using a linear search for now. // Editions are guaranteed to be sorted and thus we could use a binary search. // Given that there are only a handful of editions (with one more per year) // there is not much reason to use a binary search. for _, def := range defaults.GetDefaults() { if def.GetEdition() <= edpb { fsed = def } else { break } } fs := proto.Clone(fsed.GetFixedFeatures()).(*descriptorpb.FeatureSet) proto.Merge(fs, fsed.GetOverridableFeatures()) defaultsCache[ed] = fs return fs } // mergeEditionFeatures merges the parent and child feature sets. This function // should be used when initializing Go descriptors from descriptor protos which // is why the parent is a filedesc.EditionsFeatures (Go representation) while // the child is a descriptorproto.FeatureSet (protoc representation). // Any feature set by the child overwrites what is set by the parent. func mergeEditionFeatures(parentDesc protoreflect.Descriptor, child *descriptorpb.FeatureSet) filedesc.EditionFeatures { var parentFS filedesc.EditionFeatures switch p := parentDesc.(type) { case *filedesc.File: parentFS = p.L1.EditionFeatures case *filedesc.Message: parentFS = p.L1.EditionFeatures default: panic(fmt.Sprintf("unknown parent type %T", parentDesc)) } if child == nil { return parentFS } if fp := child.FieldPresence; fp != nil { parentFS.IsFieldPresence = *fp == descriptorpb.FeatureSet_LEGACY_REQUIRED || *fp == descriptorpb.FeatureSet_EXPLICIT parentFS.IsLegacyRequired = *fp == descriptorpb.FeatureSet_LEGACY_REQUIRED } if et := child.EnumType; et != nil { parentFS.IsOpenEnum = *et == descriptorpb.FeatureSet_OPEN } if rfe := child.RepeatedFieldEncoding; rfe != nil { parentFS.IsPacked = *rfe == descriptorpb.FeatureSet_PACKED } if utf8val := child.Utf8Validation; utf8val != nil { parentFS.IsUTF8Validated = *utf8val == descriptorpb.FeatureSet_VERIFY } if me := child.MessageEncoding; me != nil { parentFS.IsDelimitedEncoded = *me == descriptorpb.FeatureSet_DELIMITED } if jf := child.JsonFormat; jf != nil { parentFS.IsJSONCompliant = *jf == descriptorpb.FeatureSet_ALLOW } // We must not use proto.GetExtension(child, gofeaturespb.E_Go) // because that only works for messages we generated, but not for // dynamicpb messages. See golang/protobuf#1669. // // Further, we harden this code against adversarial inputs: a // service which accepts descriptors from a possibly malicious // source shouldn't crash. goFeatures := child.ProtoReflect().Get(gofeaturespb.E_Go.TypeDescriptor()) if !goFeatures.IsValid() { return parentFS } gf, ok := goFeatures.Interface().(protoreflect.Message) if !ok { return parentFS } // gf.Interface() could be *dynamicpb.Message or *gofeaturespb.GoFeatures. fields := gf.Descriptor().Fields() if fd := fields.ByNumber(genid.GoFeatures_LegacyUnmarshalJsonEnum_field_number); fd != nil && !fd.IsList() && fd.Kind() == protoreflect.BoolKind && gf.Has(fd) { parentFS.GenerateLegacyUnmarshalJSON = gf.Get(fd).Bool() } if fd := fields.ByNumber(genid.GoFeatures_StripEnumPrefix_field_number); fd != nil && !fd.IsList() && fd.Kind() == protoreflect.EnumKind && gf.Has(fd) { parentFS.StripEnumPrefix = int(gf.Get(fd).Enum()) } if fd := fields.ByNumber(genid.GoFeatures_ApiLevel_field_number); fd != nil && !fd.IsList() && fd.Kind() == protoreflect.EnumKind && gf.Has(fd) { parentFS.APILevel = int(gf.Get(fd).Enum()) } return parentFS } // initFileDescFromFeatureSet initializes editions related fields in fd based // on fs. If fs is nil it is assumed to be an empty featureset and all fields // will be initialized with the appropriate default. fd.L1.Edition must be set // before calling this function. func initFileDescFromFeatureSet(fd *filedesc.File, fs *descriptorpb.FeatureSet) { dfs := getFeatureSetFor(fd.L1.Edition) // initialize the featureset with the defaults fd.L1.EditionFeatures = mergeEditionFeatures(fd, dfs) // overwrite any options explicitly specified fd.L1.EditionFeatures = mergeEditionFeatures(fd, fs) } ================================================ FILE: vendor/google.golang.org/protobuf/reflect/protodesc/proto.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package protodesc import ( "fmt" "strings" "google.golang.org/protobuf/internal/encoding/defval" "google.golang.org/protobuf/internal/strs" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/types/descriptorpb" ) // ToFileDescriptorProto copies a [protoreflect.FileDescriptor] into a // google.protobuf.FileDescriptorProto message. func ToFileDescriptorProto(file protoreflect.FileDescriptor) *descriptorpb.FileDescriptorProto { p := &descriptorpb.FileDescriptorProto{ Name: proto.String(file.Path()), Options: proto.Clone(file.Options()).(*descriptorpb.FileOptions), } if file.Package() != "" { p.Package = proto.String(string(file.Package())) } for i, imports := 0, file.Imports(); i < imports.Len(); i++ { imp := imports.Get(i) p.Dependency = append(p.Dependency, imp.Path()) if imp.IsPublic { p.PublicDependency = append(p.PublicDependency, int32(i)) } } for i, locs := 0, file.SourceLocations(); i < locs.Len(); i++ { loc := locs.Get(i) l := &descriptorpb.SourceCodeInfo_Location{} l.Path = append(l.Path, loc.Path...) if loc.StartLine == loc.EndLine { l.Span = []int32{int32(loc.StartLine), int32(loc.StartColumn), int32(loc.EndColumn)} } else { l.Span = []int32{int32(loc.StartLine), int32(loc.StartColumn), int32(loc.EndLine), int32(loc.EndColumn)} } l.LeadingDetachedComments = append([]string(nil), loc.LeadingDetachedComments...) if loc.LeadingComments != "" { l.LeadingComments = proto.String(loc.LeadingComments) } if loc.TrailingComments != "" { l.TrailingComments = proto.String(loc.TrailingComments) } if p.SourceCodeInfo == nil { p.SourceCodeInfo = &descriptorpb.SourceCodeInfo{} } p.SourceCodeInfo.Location = append(p.SourceCodeInfo.Location, l) } for i, messages := 0, file.Messages(); i < messages.Len(); i++ { p.MessageType = append(p.MessageType, ToDescriptorProto(messages.Get(i))) } for i, enums := 0, file.Enums(); i < enums.Len(); i++ { p.EnumType = append(p.EnumType, ToEnumDescriptorProto(enums.Get(i))) } for i, services := 0, file.Services(); i < services.Len(); i++ { p.Service = append(p.Service, ToServiceDescriptorProto(services.Get(i))) } for i, exts := 0, file.Extensions(); i < exts.Len(); i++ { p.Extension = append(p.Extension, ToFieldDescriptorProto(exts.Get(i))) } if syntax := file.Syntax(); syntax != protoreflect.Proto2 && syntax.IsValid() { p.Syntax = proto.String(file.Syntax().String()) } desc := file if fileImportDesc, ok := file.(protoreflect.FileImport); ok { desc = fileImportDesc.FileDescriptor } if file.Syntax() == protoreflect.Editions { if editionsInterface, ok := desc.(interface{ Edition() int32 }); ok { p.Edition = descriptorpb.Edition(editionsInterface.Edition()).Enum() } } type hasOptionImports interface { OptionImports() protoreflect.FileImports } if opts, ok := desc.(hasOptionImports); ok { if optionImports := opts.OptionImports(); optionImports.Len() > 0 { optionDeps := make([]string, optionImports.Len()) for i := range optionImports.Len() { optionDeps[i] = optionImports.Get(i).Path() } p.OptionDependency = optionDeps } } return p } // ToDescriptorProto copies a [protoreflect.MessageDescriptor] into a // google.protobuf.DescriptorProto message. func ToDescriptorProto(message protoreflect.MessageDescriptor) *descriptorpb.DescriptorProto { p := &descriptorpb.DescriptorProto{ Name: proto.String(string(message.Name())), Options: proto.Clone(message.Options()).(*descriptorpb.MessageOptions), } for i, fields := 0, message.Fields(); i < fields.Len(); i++ { p.Field = append(p.Field, ToFieldDescriptorProto(fields.Get(i))) } for i, exts := 0, message.Extensions(); i < exts.Len(); i++ { p.Extension = append(p.Extension, ToFieldDescriptorProto(exts.Get(i))) } for i, messages := 0, message.Messages(); i < messages.Len(); i++ { p.NestedType = append(p.NestedType, ToDescriptorProto(messages.Get(i))) } for i, enums := 0, message.Enums(); i < enums.Len(); i++ { p.EnumType = append(p.EnumType, ToEnumDescriptorProto(enums.Get(i))) } for i, xranges := 0, message.ExtensionRanges(); i < xranges.Len(); i++ { xrange := xranges.Get(i) p.ExtensionRange = append(p.ExtensionRange, &descriptorpb.DescriptorProto_ExtensionRange{ Start: proto.Int32(int32(xrange[0])), End: proto.Int32(int32(xrange[1])), Options: proto.Clone(message.ExtensionRangeOptions(i)).(*descriptorpb.ExtensionRangeOptions), }) } for i, oneofs := 0, message.Oneofs(); i < oneofs.Len(); i++ { p.OneofDecl = append(p.OneofDecl, ToOneofDescriptorProto(oneofs.Get(i))) } for i, ranges := 0, message.ReservedRanges(); i < ranges.Len(); i++ { rrange := ranges.Get(i) p.ReservedRange = append(p.ReservedRange, &descriptorpb.DescriptorProto_ReservedRange{ Start: proto.Int32(int32(rrange[0])), End: proto.Int32(int32(rrange[1])), }) } for i, names := 0, message.ReservedNames(); i < names.Len(); i++ { p.ReservedName = append(p.ReservedName, string(names.Get(i))) } type hasVisibility interface { Visibility() int32 } if vis, ok := message.(hasVisibility); ok { if visibility := vis.Visibility(); visibility > 0 { p.Visibility = descriptorpb.SymbolVisibility(visibility).Enum() } } return p } // ToFieldDescriptorProto copies a [protoreflect.FieldDescriptor] into a // google.protobuf.FieldDescriptorProto message. func ToFieldDescriptorProto(field protoreflect.FieldDescriptor) *descriptorpb.FieldDescriptorProto { p := &descriptorpb.FieldDescriptorProto{ Name: proto.String(string(field.Name())), Number: proto.Int32(int32(field.Number())), Label: descriptorpb.FieldDescriptorProto_Label(field.Cardinality()).Enum(), Options: proto.Clone(field.Options()).(*descriptorpb.FieldOptions), } if field.IsExtension() { p.Extendee = fullNameOf(field.ContainingMessage()) } if field.Kind().IsValid() { p.Type = descriptorpb.FieldDescriptorProto_Type(field.Kind()).Enum() } if field.Enum() != nil { p.TypeName = fullNameOf(field.Enum()) } if field.Message() != nil { p.TypeName = fullNameOf(field.Message()) } if field.HasJSONName() { // A bug in older versions of protoc would always populate the // "json_name" option for extensions when it is meaningless. // When it did so, it would always use the camel-cased field name. if field.IsExtension() { p.JsonName = proto.String(strs.JSONCamelCase(string(field.Name()))) } else { p.JsonName = proto.String(field.JSONName()) } } if field.Syntax() == protoreflect.Proto3 && field.HasOptionalKeyword() { p.Proto3Optional = proto.Bool(true) } if field.Syntax() == protoreflect.Editions { // Editions have no group keyword, this type is only set so that downstream users continue // treating this as delimited encoding. if p.GetType() == descriptorpb.FieldDescriptorProto_TYPE_GROUP { p.Type = descriptorpb.FieldDescriptorProto_TYPE_MESSAGE.Enum() } // Editions have no required keyword, this label is only set so that downstream users continue // treating it as required. if p.GetLabel() == descriptorpb.FieldDescriptorProto_LABEL_REQUIRED { p.Label = descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum() } } if field.HasDefault() { def, err := defval.Marshal(field.Default(), field.DefaultEnumValue(), field.Kind(), defval.Descriptor) if err != nil && field.DefaultEnumValue() != nil { def = string(field.DefaultEnumValue().Name()) // occurs for unresolved enum values } else if err != nil { panic(fmt.Sprintf("%v: %v", field.FullName(), err)) } p.DefaultValue = proto.String(def) } if oneof := field.ContainingOneof(); oneof != nil { p.OneofIndex = proto.Int32(int32(oneof.Index())) } return p } // ToOneofDescriptorProto copies a [protoreflect.OneofDescriptor] into a // google.protobuf.OneofDescriptorProto message. func ToOneofDescriptorProto(oneof protoreflect.OneofDescriptor) *descriptorpb.OneofDescriptorProto { return &descriptorpb.OneofDescriptorProto{ Name: proto.String(string(oneof.Name())), Options: proto.Clone(oneof.Options()).(*descriptorpb.OneofOptions), } } // ToEnumDescriptorProto copies a [protoreflect.EnumDescriptor] into a // google.protobuf.EnumDescriptorProto message. func ToEnumDescriptorProto(enum protoreflect.EnumDescriptor) *descriptorpb.EnumDescriptorProto { p := &descriptorpb.EnumDescriptorProto{ Name: proto.String(string(enum.Name())), Options: proto.Clone(enum.Options()).(*descriptorpb.EnumOptions), } for i, values := 0, enum.Values(); i < values.Len(); i++ { p.Value = append(p.Value, ToEnumValueDescriptorProto(values.Get(i))) } for i, ranges := 0, enum.ReservedRanges(); i < ranges.Len(); i++ { rrange := ranges.Get(i) p.ReservedRange = append(p.ReservedRange, &descriptorpb.EnumDescriptorProto_EnumReservedRange{ Start: proto.Int32(int32(rrange[0])), End: proto.Int32(int32(rrange[1])), }) } for i, names := 0, enum.ReservedNames(); i < names.Len(); i++ { p.ReservedName = append(p.ReservedName, string(names.Get(i))) } type hasVisibility interface { Visibility() int32 } if vis, ok := enum.(hasVisibility); ok { if visibility := vis.Visibility(); visibility > 0 { p.Visibility = descriptorpb.SymbolVisibility(visibility).Enum() } } return p } // ToEnumValueDescriptorProto copies a [protoreflect.EnumValueDescriptor] into a // google.protobuf.EnumValueDescriptorProto message. func ToEnumValueDescriptorProto(value protoreflect.EnumValueDescriptor) *descriptorpb.EnumValueDescriptorProto { return &descriptorpb.EnumValueDescriptorProto{ Name: proto.String(string(value.Name())), Number: proto.Int32(int32(value.Number())), Options: proto.Clone(value.Options()).(*descriptorpb.EnumValueOptions), } } // ToServiceDescriptorProto copies a [protoreflect.ServiceDescriptor] into a // google.protobuf.ServiceDescriptorProto message. func ToServiceDescriptorProto(service protoreflect.ServiceDescriptor) *descriptorpb.ServiceDescriptorProto { p := &descriptorpb.ServiceDescriptorProto{ Name: proto.String(string(service.Name())), Options: proto.Clone(service.Options()).(*descriptorpb.ServiceOptions), } for i, methods := 0, service.Methods(); i < methods.Len(); i++ { p.Method = append(p.Method, ToMethodDescriptorProto(methods.Get(i))) } return p } // ToMethodDescriptorProto copies a [protoreflect.MethodDescriptor] into a // google.protobuf.MethodDescriptorProto message. func ToMethodDescriptorProto(method protoreflect.MethodDescriptor) *descriptorpb.MethodDescriptorProto { p := &descriptorpb.MethodDescriptorProto{ Name: proto.String(string(method.Name())), InputType: fullNameOf(method.Input()), OutputType: fullNameOf(method.Output()), Options: proto.Clone(method.Options()).(*descriptorpb.MethodOptions), } if method.IsStreamingClient() { p.ClientStreaming = proto.Bool(true) } if method.IsStreamingServer() { p.ServerStreaming = proto.Bool(true) } return p } func fullNameOf(d protoreflect.Descriptor) *string { if d == nil { return nil } if strings.HasPrefix(string(d.FullName()), unknownPrefix) { return proto.String(string(d.FullName()[len(unknownPrefix):])) } return proto.String("." + string(d.FullName())) } ================================================ FILE: vendor/google.golang.org/protobuf/reflect/protoreflect/methods.go ================================================ // Copyright 2020 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package protoreflect import ( "google.golang.org/protobuf/internal/pragma" ) // The following types are used by the fast-path Message.ProtoMethods method. // // To avoid polluting the public protoreflect API with types used only by // low-level implementations, the canonical definitions of these types are // in the runtime/protoiface package. The definitions here and in protoiface // must be kept in sync. type ( methods = struct { pragma.NoUnkeyedLiterals Flags supportFlags Size func(sizeInput) sizeOutput Marshal func(marshalInput) (marshalOutput, error) Unmarshal func(unmarshalInput) (unmarshalOutput, error) Merge func(mergeInput) mergeOutput CheckInitialized func(checkInitializedInput) (checkInitializedOutput, error) Equal func(equalInput) equalOutput } supportFlags = uint64 sizeInput = struct { pragma.NoUnkeyedLiterals Message Message Flags uint8 } sizeOutput = struct { pragma.NoUnkeyedLiterals Size int } marshalInput = struct { pragma.NoUnkeyedLiterals Message Message Buf []byte Flags uint8 } marshalOutput = struct { pragma.NoUnkeyedLiterals Buf []byte } unmarshalInput = struct { pragma.NoUnkeyedLiterals Message Message Buf []byte Flags uint8 Resolver interface { FindExtensionByName(field FullName) (ExtensionType, error) FindExtensionByNumber(message FullName, field FieldNumber) (ExtensionType, error) } Depth int } unmarshalOutput = struct { pragma.NoUnkeyedLiterals Flags uint8 } mergeInput = struct { pragma.NoUnkeyedLiterals Source Message Destination Message } mergeOutput = struct { pragma.NoUnkeyedLiterals Flags uint8 } checkInitializedInput = struct { pragma.NoUnkeyedLiterals Message Message } checkInitializedOutput = struct { pragma.NoUnkeyedLiterals } equalInput = struct { pragma.NoUnkeyedLiterals MessageA Message MessageB Message } equalOutput = struct { pragma.NoUnkeyedLiterals Equal bool } ) ================================================ FILE: vendor/google.golang.org/protobuf/reflect/protoreflect/proto.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package protoreflect provides interfaces to dynamically manipulate messages. // // This package includes type descriptors which describe the structure of types // defined in proto source files and value interfaces which provide the // ability to examine and manipulate the contents of messages. // // # Protocol Buffer Descriptors // // Protobuf descriptors (e.g., [EnumDescriptor] or [MessageDescriptor]) // are immutable objects that represent protobuf type information. // They are wrappers around the messages declared in descriptor.proto. // Protobuf descriptors alone lack any information regarding Go types. // // Enums and messages generated by this module implement [Enum] and [ProtoMessage], // where the Descriptor and ProtoReflect.Descriptor accessors respectively // return the protobuf descriptor for the values. // // The protobuf descriptor interfaces are not meant to be implemented by // user code since they might need to be extended in the future to support // additions to the protobuf language. // The [google.golang.org/protobuf/reflect/protodesc] package converts between // google.protobuf.DescriptorProto messages and protobuf descriptors. // // # Go Type Descriptors // // A type descriptor (e.g., [EnumType] or [MessageType]) is a constructor for // a concrete Go type that represents the associated protobuf descriptor. // There is commonly a one-to-one relationship between protobuf descriptors and // Go type descriptors, but it can potentially be a one-to-many relationship. // // Enums and messages generated by this module implement [Enum] and [ProtoMessage], // where the Type and ProtoReflect.Type accessors respectively // return the protobuf descriptor for the values. // // The [google.golang.org/protobuf/types/dynamicpb] package can be used to // create Go type descriptors from protobuf descriptors. // // # Value Interfaces // // The [Enum] and [Message] interfaces provide a reflective view over an // enum or message instance. For enums, it provides the ability to retrieve // the enum value number for any concrete enum type. For messages, it provides // the ability to access or manipulate fields of the message. // // To convert a [google.golang.org/protobuf/proto.Message] to a [protoreflect.Message], use the // former's ProtoReflect method. Since the ProtoReflect method is new to the // v2 message interface, it may not be present on older message implementations. // The [github.com/golang/protobuf/proto.MessageReflect] function can be used // to obtain a reflective view on older messages. // // # Relationships // // The following diagrams demonstrate the relationships between // various types declared in this package. // // ┌───────────────────────────────────┐ // V │ // ┌────────────── New(n) ─────────────┐ │ // │ │ │ // │ ┌──── Descriptor() ──┐ │ ┌── Number() ──┐ │ // │ │ V V │ V │ // ╔════════════╗ ╔════════════════╗ ╔════════╗ ╔════════════╗ // ║ EnumType ║ ║ EnumDescriptor ║ ║ Enum ║ ║ EnumNumber ║ // ╚════════════╝ ╚════════════════╝ ╚════════╝ ╚════════════╝ // Λ Λ │ │ // │ └─── Descriptor() ──┘ │ // │ │ // └────────────────── Type() ───────┘ // // • An [EnumType] describes a concrete Go enum type. // It has an EnumDescriptor and can construct an Enum instance. // // • An [EnumDescriptor] describes an abstract protobuf enum type. // // • An [Enum] is a concrete enum instance. Generated enums implement Enum. // // ┌──────────────── New() ─────────────────┐ // │ │ // │ ┌─── Descriptor() ─────┐ │ ┌── Interface() ───┐ // │ │ V V │ V // ╔═════════════╗ ╔═══════════════════╗ ╔═════════╗ ╔══════════════╗ // ║ MessageType ║ ║ MessageDescriptor ║ ║ Message ║ ║ ProtoMessage ║ // ╚═════════════╝ ╚═══════════════════╝ ╚═════════╝ ╚══════════════╝ // Λ Λ │ │ Λ │ // │ └──── Descriptor() ────┘ │ └─ ProtoReflect() ─┘ // │ │ // └─────────────────── Type() ─────────┘ // // • A [MessageType] describes a concrete Go message type. // It has a [MessageDescriptor] and can construct a [Message] instance. // Just as how Go's [reflect.Type] is a reflective description of a Go type, // a [MessageType] is a reflective description of a Go type for a protobuf message. // // • A [MessageDescriptor] describes an abstract protobuf message type. // It has no understanding of Go types. In order to construct a [MessageType] // from just a [MessageDescriptor], you can consider looking up the message type // in the global registry using the FindMessageByName method on // [google.golang.org/protobuf/reflect/protoregistry.GlobalTypes] // or constructing a dynamic [MessageType] using // [google.golang.org/protobuf/types/dynamicpb.NewMessageType]. // // • A [Message] is a reflective view over a concrete message instance. // Generated messages implement [ProtoMessage], which can convert to a [Message]. // Just as how Go's [reflect.Value] is a reflective view over a Go value, // a [Message] is a reflective view over a concrete protobuf message instance. // Using Go reflection as an analogy, the [ProtoMessage.ProtoReflect] method is similar to // calling [reflect.ValueOf], and the [Message.Interface] method is similar to // calling [reflect.Value.Interface]. // // ┌── TypeDescriptor() ──┐ ┌───── Descriptor() ─────┐ // │ V │ V // ╔═══════════════╗ ╔═════════════════════════╗ ╔═════════════════════╗ // ║ ExtensionType ║ ║ ExtensionTypeDescriptor ║ ║ ExtensionDescriptor ║ // ╚═══════════════╝ ╚═════════════════════════╝ ╚═════════════════════╝ // Λ │ │ Λ │ Λ // └─────── Type() ───────┘ │ └─── may implement ────┘ │ // │ │ // └────── implements ────────┘ // // • An [ExtensionType] describes a concrete Go implementation of an extension. // It has an [ExtensionTypeDescriptor] and can convert to/from // an abstract [Value] and a Go value. // // • An [ExtensionTypeDescriptor] is an [ExtensionDescriptor] // which also has an [ExtensionType]. // // • An [ExtensionDescriptor] describes an abstract protobuf extension field and // may not always be an [ExtensionTypeDescriptor]. package protoreflect import ( "fmt" "strings" "google.golang.org/protobuf/encoding/protowire" "google.golang.org/protobuf/internal/pragma" ) type doNotImplement pragma.DoNotImplement // ProtoMessage is the top-level interface that all proto messages implement. // This is declared in the protoreflect package to avoid a cyclic dependency; // use the [google.golang.org/protobuf/proto.Message] type instead, which aliases this type. type ProtoMessage interface{ ProtoReflect() Message } // Syntax is the language version of the proto file. type Syntax syntax type syntax int8 // keep exact type opaque as the int type may change const ( Proto2 Syntax = 2 Proto3 Syntax = 3 Editions Syntax = 4 ) // IsValid reports whether the syntax is valid. func (s Syntax) IsValid() bool { switch s { case Proto2, Proto3, Editions: return true default: return false } } // String returns s as a proto source identifier (e.g., "proto2"). func (s Syntax) String() string { switch s { case Proto2: return "proto2" case Proto3: return "proto3" case Editions: return "editions" default: return fmt.Sprintf("", s) } } // GoString returns s as a Go source identifier (e.g., "Proto2"). func (s Syntax) GoString() string { switch s { case Proto2: return "Proto2" case Proto3: return "Proto3" default: return fmt.Sprintf("Syntax(%d)", s) } } // Cardinality determines whether a field is optional, required, or repeated. type Cardinality cardinality type cardinality int8 // keep exact type opaque as the int type may change // Constants as defined by the google.protobuf.Cardinality enumeration. const ( Optional Cardinality = 1 // appears zero or one times Required Cardinality = 2 // appears exactly one time; invalid with Proto3 Repeated Cardinality = 3 // appears zero or more times ) // IsValid reports whether the cardinality is valid. func (c Cardinality) IsValid() bool { switch c { case Optional, Required, Repeated: return true default: return false } } // String returns c as a proto source identifier (e.g., "optional"). func (c Cardinality) String() string { switch c { case Optional: return "optional" case Required: return "required" case Repeated: return "repeated" default: return fmt.Sprintf("", c) } } // GoString returns c as a Go source identifier (e.g., "Optional"). func (c Cardinality) GoString() string { switch c { case Optional: return "Optional" case Required: return "Required" case Repeated: return "Repeated" default: return fmt.Sprintf("Cardinality(%d)", c) } } // Kind indicates the basic proto kind of a field. type Kind kind type kind int8 // keep exact type opaque as the int type may change // Constants as defined by the google.protobuf.Field.Kind enumeration. const ( BoolKind Kind = 8 EnumKind Kind = 14 Int32Kind Kind = 5 Sint32Kind Kind = 17 Uint32Kind Kind = 13 Int64Kind Kind = 3 Sint64Kind Kind = 18 Uint64Kind Kind = 4 Sfixed32Kind Kind = 15 Fixed32Kind Kind = 7 FloatKind Kind = 2 Sfixed64Kind Kind = 16 Fixed64Kind Kind = 6 DoubleKind Kind = 1 StringKind Kind = 9 BytesKind Kind = 12 MessageKind Kind = 11 GroupKind Kind = 10 ) // IsValid reports whether the kind is valid. func (k Kind) IsValid() bool { switch k { case BoolKind, EnumKind, Int32Kind, Sint32Kind, Uint32Kind, Int64Kind, Sint64Kind, Uint64Kind, Sfixed32Kind, Fixed32Kind, FloatKind, Sfixed64Kind, Fixed64Kind, DoubleKind, StringKind, BytesKind, MessageKind, GroupKind: return true default: return false } } // String returns k as a proto source identifier (e.g., "bool"). func (k Kind) String() string { switch k { case BoolKind: return "bool" case EnumKind: return "enum" case Int32Kind: return "int32" case Sint32Kind: return "sint32" case Uint32Kind: return "uint32" case Int64Kind: return "int64" case Sint64Kind: return "sint64" case Uint64Kind: return "uint64" case Sfixed32Kind: return "sfixed32" case Fixed32Kind: return "fixed32" case FloatKind: return "float" case Sfixed64Kind: return "sfixed64" case Fixed64Kind: return "fixed64" case DoubleKind: return "double" case StringKind: return "string" case BytesKind: return "bytes" case MessageKind: return "message" case GroupKind: return "group" default: return fmt.Sprintf("", k) } } // GoString returns k as a Go source identifier (e.g., "BoolKind"). func (k Kind) GoString() string { switch k { case BoolKind: return "BoolKind" case EnumKind: return "EnumKind" case Int32Kind: return "Int32Kind" case Sint32Kind: return "Sint32Kind" case Uint32Kind: return "Uint32Kind" case Int64Kind: return "Int64Kind" case Sint64Kind: return "Sint64Kind" case Uint64Kind: return "Uint64Kind" case Sfixed32Kind: return "Sfixed32Kind" case Fixed32Kind: return "Fixed32Kind" case FloatKind: return "FloatKind" case Sfixed64Kind: return "Sfixed64Kind" case Fixed64Kind: return "Fixed64Kind" case DoubleKind: return "DoubleKind" case StringKind: return "StringKind" case BytesKind: return "BytesKind" case MessageKind: return "MessageKind" case GroupKind: return "GroupKind" default: return fmt.Sprintf("Kind(%d)", k) } } // FieldNumber is the field number in a message. type FieldNumber = protowire.Number // FieldNumbers represent a list of field numbers. type FieldNumbers interface { // Len reports the number of fields in the list. Len() int // Get returns the ith field number. It panics if out of bounds. Get(i int) FieldNumber // Has reports whether n is within the list of fields. Has(n FieldNumber) bool doNotImplement } // FieldRanges represent a list of field number ranges. type FieldRanges interface { // Len reports the number of ranges in the list. Len() int // Get returns the ith range. It panics if out of bounds. Get(i int) [2]FieldNumber // start inclusive; end exclusive // Has reports whether n is within any of the ranges. Has(n FieldNumber) bool doNotImplement } // EnumNumber is the numeric value for an enum. type EnumNumber int32 // EnumRanges represent a list of enum number ranges. type EnumRanges interface { // Len reports the number of ranges in the list. Len() int // Get returns the ith range. It panics if out of bounds. Get(i int) [2]EnumNumber // start inclusive; end inclusive // Has reports whether n is within any of the ranges. Has(n EnumNumber) bool doNotImplement } // Name is the short name for a proto declaration. This is not the name // as used in Go source code, which might not be identical to the proto name. type Name string // e.g., "Kind" // IsValid reports whether s is a syntactically valid name. // An empty name is invalid. func (s Name) IsValid() bool { return consumeIdent(string(s)) == len(s) } // Names represent a list of names. type Names interface { // Len reports the number of names in the list. Len() int // Get returns the ith name. It panics if out of bounds. Get(i int) Name // Has reports whether s matches any names in the list. Has(s Name) bool doNotImplement } // FullName is a qualified name that uniquely identifies a proto declaration. // A qualified name is the concatenation of the proto package along with the // fully-declared name (i.e., name of parent preceding the name of the child), // with a '.' delimiter placed between each [Name]. // // This should not have any leading or trailing dots. type FullName string // e.g., "google.protobuf.Field.Kind" // IsValid reports whether s is a syntactically valid full name. // An empty full name is invalid. func (s FullName) IsValid() bool { i := consumeIdent(string(s)) if i < 0 { return false } for len(s) > i { if s[i] != '.' { return false } i++ n := consumeIdent(string(s[i:])) if n < 0 { return false } i += n } return true } func consumeIdent(s string) (i int) { if len(s) == 0 || !isLetter(s[i]) { return -1 } i++ for len(s) > i && isLetterDigit(s[i]) { i++ } return i } func isLetter(c byte) bool { return c == '_' || ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') } func isLetterDigit(c byte) bool { return isLetter(c) || ('0' <= c && c <= '9') } // Name returns the short name, which is the last identifier segment. // A single segment FullName is the [Name] itself. func (n FullName) Name() Name { if i := strings.LastIndexByte(string(n), '.'); i >= 0 { return Name(n[i+1:]) } return Name(n) } // Parent returns the full name with the trailing identifier removed. // A single segment FullName has no parent. func (n FullName) Parent() FullName { if i := strings.LastIndexByte(string(n), '.'); i >= 0 { return n[:i] } return "" } // Append returns the qualified name appended with the provided short name. // // Invariant: n == n.Parent().Append(n.Name()) // assuming n is valid func (n FullName) Append(s Name) FullName { if n == "" { return FullName(s) } return n + "." + FullName(s) } ================================================ FILE: vendor/google.golang.org/protobuf/reflect/protoreflect/source.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package protoreflect import ( "strconv" ) // SourceLocations is a list of source locations. type SourceLocations interface { // Len reports the number of source locations in the proto file. Len() int // Get returns the ith SourceLocation. It panics if out of bounds. Get(int) SourceLocation // ByPath returns the SourceLocation for the given path, // returning the first location if multiple exist for the same path. // If multiple locations exist for the same path, // then SourceLocation.Next index can be used to identify the // index of the next SourceLocation. // If no location exists for this path, it returns the zero value. ByPath(path SourcePath) SourceLocation // ByDescriptor returns the SourceLocation for the given descriptor, // returning the first location if multiple exist for the same path. // If no location exists for this descriptor, it returns the zero value. ByDescriptor(desc Descriptor) SourceLocation doNotImplement } // SourceLocation describes a source location and // corresponds with the google.protobuf.SourceCodeInfo.Location message. type SourceLocation struct { // Path is the path to the declaration from the root file descriptor. // The contents of this slice must not be mutated. Path SourcePath // StartLine and StartColumn are the zero-indexed starting location // in the source file for the declaration. StartLine, StartColumn int // EndLine and EndColumn are the zero-indexed ending location // in the source file for the declaration. // In the descriptor.proto, the end line may be omitted if it is identical // to the start line. Here, it is always populated. EndLine, EndColumn int // LeadingDetachedComments are the leading detached comments // for the declaration. The contents of this slice must not be mutated. LeadingDetachedComments []string // LeadingComments is the leading attached comment for the declaration. LeadingComments string // TrailingComments is the trailing attached comment for the declaration. TrailingComments string // Next is an index into SourceLocations for the next source location that // has the same Path. It is zero if there is no next location. Next int } // SourcePath identifies part of a file descriptor for a source location. // The SourcePath is a sequence of either field numbers or indexes into // a repeated field that form a path starting from the root file descriptor. // // See google.protobuf.SourceCodeInfo.Location.path. type SourcePath []int32 // Equal reports whether p1 equals p2. func (p1 SourcePath) Equal(p2 SourcePath) bool { if len(p1) != len(p2) { return false } for i := range p1 { if p1[i] != p2[i] { return false } } return true } // String formats the path in a humanly readable manner. // The output is guaranteed to be deterministic, // making it suitable for use as a key into a Go map. // It is not guaranteed to be stable as the exact output could change // in a future version of this module. // // Example output: // // .message_type[6].nested_type[15].field[3] func (p SourcePath) String() string { b := p.appendFileDescriptorProto(nil) for _, i := range p { b = append(b, '.') b = strconv.AppendInt(b, int64(i), 10) } return string(b) } type appendFunc func(*SourcePath, []byte) []byte func (p *SourcePath) appendSingularField(b []byte, name string, f appendFunc) []byte { if len(*p) == 0 { return b } b = append(b, '.') b = append(b, name...) *p = (*p)[1:] if f != nil { b = f(p, b) } return b } func (p *SourcePath) appendRepeatedField(b []byte, name string, f appendFunc) []byte { b = p.appendSingularField(b, name, nil) if len(*p) == 0 || (*p)[0] < 0 { return b } b = append(b, '[') b = strconv.AppendUint(b, uint64((*p)[0]), 10) b = append(b, ']') *p = (*p)[1:] if f != nil { b = f(p, b) } return b } ================================================ FILE: vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Code generated by generate-protos. DO NOT EDIT. package protoreflect func (p *SourcePath) appendFileDescriptorProto(b []byte) []byte { if len(*p) == 0 { return b } switch (*p)[0] { case 1: b = p.appendSingularField(b, "name", nil) case 2: b = p.appendSingularField(b, "package", nil) case 3: b = p.appendRepeatedField(b, "dependency", nil) case 10: b = p.appendRepeatedField(b, "public_dependency", nil) case 11: b = p.appendRepeatedField(b, "weak_dependency", nil) case 15: b = p.appendRepeatedField(b, "option_dependency", nil) case 4: b = p.appendRepeatedField(b, "message_type", (*SourcePath).appendDescriptorProto) case 5: b = p.appendRepeatedField(b, "enum_type", (*SourcePath).appendEnumDescriptorProto) case 6: b = p.appendRepeatedField(b, "service", (*SourcePath).appendServiceDescriptorProto) case 7: b = p.appendRepeatedField(b, "extension", (*SourcePath).appendFieldDescriptorProto) case 8: b = p.appendSingularField(b, "options", (*SourcePath).appendFileOptions) case 9: b = p.appendSingularField(b, "source_code_info", (*SourcePath).appendSourceCodeInfo) case 12: b = p.appendSingularField(b, "syntax", nil) case 14: b = p.appendSingularField(b, "edition", nil) } return b } func (p *SourcePath) appendDescriptorProto(b []byte) []byte { if len(*p) == 0 { return b } switch (*p)[0] { case 1: b = p.appendSingularField(b, "name", nil) case 2: b = p.appendRepeatedField(b, "field", (*SourcePath).appendFieldDescriptorProto) case 6: b = p.appendRepeatedField(b, "extension", (*SourcePath).appendFieldDescriptorProto) case 3: b = p.appendRepeatedField(b, "nested_type", (*SourcePath).appendDescriptorProto) case 4: b = p.appendRepeatedField(b, "enum_type", (*SourcePath).appendEnumDescriptorProto) case 5: b = p.appendRepeatedField(b, "extension_range", (*SourcePath).appendDescriptorProto_ExtensionRange) case 8: b = p.appendRepeatedField(b, "oneof_decl", (*SourcePath).appendOneofDescriptorProto) case 7: b = p.appendSingularField(b, "options", (*SourcePath).appendMessageOptions) case 9: b = p.appendRepeatedField(b, "reserved_range", (*SourcePath).appendDescriptorProto_ReservedRange) case 10: b = p.appendRepeatedField(b, "reserved_name", nil) case 11: b = p.appendSingularField(b, "visibility", nil) } return b } func (p *SourcePath) appendEnumDescriptorProto(b []byte) []byte { if len(*p) == 0 { return b } switch (*p)[0] { case 1: b = p.appendSingularField(b, "name", nil) case 2: b = p.appendRepeatedField(b, "value", (*SourcePath).appendEnumValueDescriptorProto) case 3: b = p.appendSingularField(b, "options", (*SourcePath).appendEnumOptions) case 4: b = p.appendRepeatedField(b, "reserved_range", (*SourcePath).appendEnumDescriptorProto_EnumReservedRange) case 5: b = p.appendRepeatedField(b, "reserved_name", nil) case 6: b = p.appendSingularField(b, "visibility", nil) } return b } func (p *SourcePath) appendServiceDescriptorProto(b []byte) []byte { if len(*p) == 0 { return b } switch (*p)[0] { case 1: b = p.appendSingularField(b, "name", nil) case 2: b = p.appendRepeatedField(b, "method", (*SourcePath).appendMethodDescriptorProto) case 3: b = p.appendSingularField(b, "options", (*SourcePath).appendServiceOptions) } return b } func (p *SourcePath) appendFieldDescriptorProto(b []byte) []byte { if len(*p) == 0 { return b } switch (*p)[0] { case 1: b = p.appendSingularField(b, "name", nil) case 3: b = p.appendSingularField(b, "number", nil) case 4: b = p.appendSingularField(b, "label", nil) case 5: b = p.appendSingularField(b, "type", nil) case 6: b = p.appendSingularField(b, "type_name", nil) case 2: b = p.appendSingularField(b, "extendee", nil) case 7: b = p.appendSingularField(b, "default_value", nil) case 9: b = p.appendSingularField(b, "oneof_index", nil) case 10: b = p.appendSingularField(b, "json_name", nil) case 8: b = p.appendSingularField(b, "options", (*SourcePath).appendFieldOptions) case 17: b = p.appendSingularField(b, "proto3_optional", nil) } return b } func (p *SourcePath) appendFileOptions(b []byte) []byte { if len(*p) == 0 { return b } switch (*p)[0] { case 1: b = p.appendSingularField(b, "java_package", nil) case 8: b = p.appendSingularField(b, "java_outer_classname", nil) case 10: b = p.appendSingularField(b, "java_multiple_files", nil) case 20: b = p.appendSingularField(b, "java_generate_equals_and_hash", nil) case 27: b = p.appendSingularField(b, "java_string_check_utf8", nil) case 9: b = p.appendSingularField(b, "optimize_for", nil) case 11: b = p.appendSingularField(b, "go_package", nil) case 16: b = p.appendSingularField(b, "cc_generic_services", nil) case 17: b = p.appendSingularField(b, "java_generic_services", nil) case 18: b = p.appendSingularField(b, "py_generic_services", nil) case 23: b = p.appendSingularField(b, "deprecated", nil) case 31: b = p.appendSingularField(b, "cc_enable_arenas", nil) case 36: b = p.appendSingularField(b, "objc_class_prefix", nil) case 37: b = p.appendSingularField(b, "csharp_namespace", nil) case 39: b = p.appendSingularField(b, "swift_prefix", nil) case 40: b = p.appendSingularField(b, "php_class_prefix", nil) case 41: b = p.appendSingularField(b, "php_namespace", nil) case 44: b = p.appendSingularField(b, "php_metadata_namespace", nil) case 45: b = p.appendSingularField(b, "ruby_package", nil) case 50: b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet) case 999: b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption) } return b } func (p *SourcePath) appendSourceCodeInfo(b []byte) []byte { if len(*p) == 0 { return b } switch (*p)[0] { case 1: b = p.appendRepeatedField(b, "location", (*SourcePath).appendSourceCodeInfo_Location) } return b } func (p *SourcePath) appendDescriptorProto_ExtensionRange(b []byte) []byte { if len(*p) == 0 { return b } switch (*p)[0] { case 1: b = p.appendSingularField(b, "start", nil) case 2: b = p.appendSingularField(b, "end", nil) case 3: b = p.appendSingularField(b, "options", (*SourcePath).appendExtensionRangeOptions) } return b } func (p *SourcePath) appendOneofDescriptorProto(b []byte) []byte { if len(*p) == 0 { return b } switch (*p)[0] { case 1: b = p.appendSingularField(b, "name", nil) case 2: b = p.appendSingularField(b, "options", (*SourcePath).appendOneofOptions) } return b } func (p *SourcePath) appendMessageOptions(b []byte) []byte { if len(*p) == 0 { return b } switch (*p)[0] { case 1: b = p.appendSingularField(b, "message_set_wire_format", nil) case 2: b = p.appendSingularField(b, "no_standard_descriptor_accessor", nil) case 3: b = p.appendSingularField(b, "deprecated", nil) case 7: b = p.appendSingularField(b, "map_entry", nil) case 11: b = p.appendSingularField(b, "deprecated_legacy_json_field_conflicts", nil) case 12: b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet) case 999: b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption) } return b } func (p *SourcePath) appendDescriptorProto_ReservedRange(b []byte) []byte { if len(*p) == 0 { return b } switch (*p)[0] { case 1: b = p.appendSingularField(b, "start", nil) case 2: b = p.appendSingularField(b, "end", nil) } return b } func (p *SourcePath) appendEnumValueDescriptorProto(b []byte) []byte { if len(*p) == 0 { return b } switch (*p)[0] { case 1: b = p.appendSingularField(b, "name", nil) case 2: b = p.appendSingularField(b, "number", nil) case 3: b = p.appendSingularField(b, "options", (*SourcePath).appendEnumValueOptions) } return b } func (p *SourcePath) appendEnumOptions(b []byte) []byte { if len(*p) == 0 { return b } switch (*p)[0] { case 2: b = p.appendSingularField(b, "allow_alias", nil) case 3: b = p.appendSingularField(b, "deprecated", nil) case 6: b = p.appendSingularField(b, "deprecated_legacy_json_field_conflicts", nil) case 7: b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet) case 999: b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption) } return b } func (p *SourcePath) appendEnumDescriptorProto_EnumReservedRange(b []byte) []byte { if len(*p) == 0 { return b } switch (*p)[0] { case 1: b = p.appendSingularField(b, "start", nil) case 2: b = p.appendSingularField(b, "end", nil) } return b } func (p *SourcePath) appendMethodDescriptorProto(b []byte) []byte { if len(*p) == 0 { return b } switch (*p)[0] { case 1: b = p.appendSingularField(b, "name", nil) case 2: b = p.appendSingularField(b, "input_type", nil) case 3: b = p.appendSingularField(b, "output_type", nil) case 4: b = p.appendSingularField(b, "options", (*SourcePath).appendMethodOptions) case 5: b = p.appendSingularField(b, "client_streaming", nil) case 6: b = p.appendSingularField(b, "server_streaming", nil) } return b } func (p *SourcePath) appendServiceOptions(b []byte) []byte { if len(*p) == 0 { return b } switch (*p)[0] { case 34: b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet) case 33: b = p.appendSingularField(b, "deprecated", nil) case 999: b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption) } return b } func (p *SourcePath) appendFieldOptions(b []byte) []byte { if len(*p) == 0 { return b } switch (*p)[0] { case 1: b = p.appendSingularField(b, "ctype", nil) case 2: b = p.appendSingularField(b, "packed", nil) case 6: b = p.appendSingularField(b, "jstype", nil) case 5: b = p.appendSingularField(b, "lazy", nil) case 15: b = p.appendSingularField(b, "unverified_lazy", nil) case 3: b = p.appendSingularField(b, "deprecated", nil) case 10: b = p.appendSingularField(b, "weak", nil) case 16: b = p.appendSingularField(b, "debug_redact", nil) case 17: b = p.appendSingularField(b, "retention", nil) case 19: b = p.appendRepeatedField(b, "targets", nil) case 20: b = p.appendRepeatedField(b, "edition_defaults", (*SourcePath).appendFieldOptions_EditionDefault) case 21: b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet) case 22: b = p.appendSingularField(b, "feature_support", (*SourcePath).appendFieldOptions_FeatureSupport) case 999: b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption) } return b } func (p *SourcePath) appendFeatureSet(b []byte) []byte { if len(*p) == 0 { return b } switch (*p)[0] { case 1: b = p.appendSingularField(b, "field_presence", nil) case 2: b = p.appendSingularField(b, "enum_type", nil) case 3: b = p.appendSingularField(b, "repeated_field_encoding", nil) case 4: b = p.appendSingularField(b, "utf8_validation", nil) case 5: b = p.appendSingularField(b, "message_encoding", nil) case 6: b = p.appendSingularField(b, "json_format", nil) case 7: b = p.appendSingularField(b, "enforce_naming_style", nil) case 8: b = p.appendSingularField(b, "default_symbol_visibility", nil) } return b } func (p *SourcePath) appendUninterpretedOption(b []byte) []byte { if len(*p) == 0 { return b } switch (*p)[0] { case 2: b = p.appendRepeatedField(b, "name", (*SourcePath).appendUninterpretedOption_NamePart) case 3: b = p.appendSingularField(b, "identifier_value", nil) case 4: b = p.appendSingularField(b, "positive_int_value", nil) case 5: b = p.appendSingularField(b, "negative_int_value", nil) case 6: b = p.appendSingularField(b, "double_value", nil) case 7: b = p.appendSingularField(b, "string_value", nil) case 8: b = p.appendSingularField(b, "aggregate_value", nil) } return b } func (p *SourcePath) appendSourceCodeInfo_Location(b []byte) []byte { if len(*p) == 0 { return b } switch (*p)[0] { case 1: b = p.appendRepeatedField(b, "path", nil) case 2: b = p.appendRepeatedField(b, "span", nil) case 3: b = p.appendSingularField(b, "leading_comments", nil) case 4: b = p.appendSingularField(b, "trailing_comments", nil) case 6: b = p.appendRepeatedField(b, "leading_detached_comments", nil) } return b } func (p *SourcePath) appendExtensionRangeOptions(b []byte) []byte { if len(*p) == 0 { return b } switch (*p)[0] { case 999: b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption) case 2: b = p.appendRepeatedField(b, "declaration", (*SourcePath).appendExtensionRangeOptions_Declaration) case 50: b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet) case 3: b = p.appendSingularField(b, "verification", nil) } return b } func (p *SourcePath) appendOneofOptions(b []byte) []byte { if len(*p) == 0 { return b } switch (*p)[0] { case 1: b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet) case 999: b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption) } return b } func (p *SourcePath) appendEnumValueOptions(b []byte) []byte { if len(*p) == 0 { return b } switch (*p)[0] { case 1: b = p.appendSingularField(b, "deprecated", nil) case 2: b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet) case 3: b = p.appendSingularField(b, "debug_redact", nil) case 4: b = p.appendSingularField(b, "feature_support", (*SourcePath).appendFieldOptions_FeatureSupport) case 999: b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption) } return b } func (p *SourcePath) appendMethodOptions(b []byte) []byte { if len(*p) == 0 { return b } switch (*p)[0] { case 33: b = p.appendSingularField(b, "deprecated", nil) case 34: b = p.appendSingularField(b, "idempotency_level", nil) case 35: b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet) case 999: b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption) } return b } func (p *SourcePath) appendFieldOptions_EditionDefault(b []byte) []byte { if len(*p) == 0 { return b } switch (*p)[0] { case 3: b = p.appendSingularField(b, "edition", nil) case 2: b = p.appendSingularField(b, "value", nil) } return b } func (p *SourcePath) appendFieldOptions_FeatureSupport(b []byte) []byte { if len(*p) == 0 { return b } switch (*p)[0] { case 1: b = p.appendSingularField(b, "edition_introduced", nil) case 2: b = p.appendSingularField(b, "edition_deprecated", nil) case 3: b = p.appendSingularField(b, "deprecation_warning", nil) case 4: b = p.appendSingularField(b, "edition_removed", nil) } return b } func (p *SourcePath) appendUninterpretedOption_NamePart(b []byte) []byte { if len(*p) == 0 { return b } switch (*p)[0] { case 1: b = p.appendSingularField(b, "name_part", nil) case 2: b = p.appendSingularField(b, "is_extension", nil) } return b } func (p *SourcePath) appendExtensionRangeOptions_Declaration(b []byte) []byte { if len(*p) == 0 { return b } switch (*p)[0] { case 1: b = p.appendSingularField(b, "number", nil) case 2: b = p.appendSingularField(b, "full_name", nil) case 3: b = p.appendSingularField(b, "type", nil) case 5: b = p.appendSingularField(b, "reserved", nil) case 6: b = p.appendSingularField(b, "repeated", nil) } return b } ================================================ FILE: vendor/google.golang.org/protobuf/reflect/protoreflect/type.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package protoreflect // Descriptor provides a set of accessors that are common to every descriptor. // Each descriptor type wraps the equivalent google.protobuf.XXXDescriptorProto, // but provides efficient lookup and immutability. // // Each descriptor is comparable. Equality implies that the two types are // exactly identical. However, it is possible for the same semantically // identical proto type to be represented by multiple type descriptors. // // For example, suppose we have t1 and t2 which are both an [MessageDescriptor]. // If t1 == t2, then the types are definitely equal and all accessors return // the same information. However, if t1 != t2, then it is still possible that // they still represent the same proto type (e.g., t1.FullName == t2.FullName). // This can occur if a descriptor type is created dynamically, or multiple // versions of the same proto type are accidentally linked into the Go binary. type Descriptor interface { // ParentFile returns the parent file descriptor that this descriptor // is declared within. The parent file for the file descriptor is itself. // // Support for this functionality is optional and may return nil. ParentFile() FileDescriptor // Parent returns the parent containing this descriptor declaration. // The following shows the mapping from child type to possible parent types: // // ╔═════════════════════╤═══════════════════════════════════╗ // ║ Child type │ Possible parent types ║ // ╠═════════════════════╪═══════════════════════════════════╣ // ║ FileDescriptor │ nil ║ // ║ MessageDescriptor │ FileDescriptor, MessageDescriptor ║ // ║ FieldDescriptor │ FileDescriptor, MessageDescriptor ║ // ║ OneofDescriptor │ MessageDescriptor ║ // ║ EnumDescriptor │ FileDescriptor, MessageDescriptor ║ // ║ EnumValueDescriptor │ EnumDescriptor ║ // ║ ServiceDescriptor │ FileDescriptor ║ // ║ MethodDescriptor │ ServiceDescriptor ║ // ╚═════════════════════╧═══════════════════════════════════╝ // // Support for this functionality is optional and may return nil. Parent() Descriptor // Index returns the index of this descriptor within its parent. // It returns 0 if the descriptor does not have a parent or if the parent // is unknown. Index() int // Syntax is the protobuf syntax. Syntax() Syntax // e.g., Proto2 or Proto3 // Name is the short name of the declaration (i.e., FullName.Name). Name() Name // e.g., "Any" // FullName is the fully-qualified name of the declaration. // // The FullName is a concatenation of the full name of the type that this // type is declared within and the declaration name. For example, // field "foo_field" in message "proto.package.MyMessage" is // uniquely identified as "proto.package.MyMessage.foo_field". // Enum values are an exception to the rule (see EnumValueDescriptor). FullName() FullName // e.g., "google.protobuf.Any" // IsPlaceholder reports whether type information is missing since a // dependency is not resolved, in which case only name information is known. // // Placeholder types may only be returned by the following accessors // as a result of unresolved dependencies: // // ╔═══════════════════════════════════╤═════════════════════╗ // ║ Accessor │ Descriptor ║ // ╠═══════════════════════════════════╪═════════════════════╣ // ║ FileImports.FileDescriptor │ FileDescriptor ║ // ║ FieldDescriptor.Enum │ EnumDescriptor ║ // ║ FieldDescriptor.Message │ MessageDescriptor ║ // ║ FieldDescriptor.DefaultEnumValue │ EnumValueDescriptor ║ // ║ FieldDescriptor.ContainingMessage │ MessageDescriptor ║ // ║ MethodDescriptor.Input │ MessageDescriptor ║ // ║ MethodDescriptor.Output │ MessageDescriptor ║ // ╚═══════════════════════════════════╧═════════════════════╝ // // If true, only Name and FullName are valid. // For FileDescriptor, the Path is also valid. IsPlaceholder() bool // Options returns the descriptor options. The caller must not modify // the returned value. // // To avoid a dependency cycle, this function returns a proto.Message value. // The proto message type returned for each descriptor type is as follows: // ╔═════════════════════╤══════════════════════════════════════════╗ // ║ Go type │ Protobuf message type ║ // ╠═════════════════════╪══════════════════════════════════════════╣ // ║ FileDescriptor │ google.protobuf.FileOptions ║ // ║ EnumDescriptor │ google.protobuf.EnumOptions ║ // ║ EnumValueDescriptor │ google.protobuf.EnumValueOptions ║ // ║ MessageDescriptor │ google.protobuf.MessageOptions ║ // ║ FieldDescriptor │ google.protobuf.FieldOptions ║ // ║ OneofDescriptor │ google.protobuf.OneofOptions ║ // ║ ServiceDescriptor │ google.protobuf.ServiceOptions ║ // ║ MethodDescriptor │ google.protobuf.MethodOptions ║ // ╚═════════════════════╧══════════════════════════════════════════╝ // // This method returns a typed nil-pointer if no options are present. // The caller must import the descriptorpb package to use this. Options() ProtoMessage doNotImplement } // FileDescriptor describes the types in a complete proto file and // corresponds with the google.protobuf.FileDescriptorProto message. // // Top-level declarations: // [EnumDescriptor], [MessageDescriptor], [FieldDescriptor], and/or [ServiceDescriptor]. type FileDescriptor interface { Descriptor // Descriptor.FullName is identical to Package // Path returns the file name, relative to the source tree root. Path() string // e.g., "path/to/file.proto" // Package returns the protobuf package namespace. Package() FullName // e.g., "google.protobuf" // Imports is a list of imported proto files. Imports() FileImports // Enums is a list of the top-level enum declarations. Enums() EnumDescriptors // Messages is a list of the top-level message declarations. Messages() MessageDescriptors // Extensions is a list of the top-level extension declarations. Extensions() ExtensionDescriptors // Services is a list of the top-level service declarations. Services() ServiceDescriptors // SourceLocations is a list of source locations. SourceLocations() SourceLocations isFileDescriptor } type isFileDescriptor interface{ ProtoType(FileDescriptor) } // FileImports is a list of file imports. type FileImports interface { // Len reports the number of files imported by this proto file. Len() int // Get returns the ith FileImport. It panics if out of bounds. Get(i int) FileImport doNotImplement } // FileImport is the declaration for a proto file import. type FileImport struct { // FileDescriptor is the file type for the given import. // It is a placeholder descriptor if IsWeak is set or if a dependency has // not been regenerated to implement the new reflection APIs. FileDescriptor // IsPublic reports whether this is a public import, which causes this file // to alias declarations within the imported file. The intended use cases // for this feature is the ability to move proto files without breaking // existing dependencies. // // The current file and the imported file must be within proto package. IsPublic bool // Deprecated: support for weak fields has been removed. IsWeak bool } // MessageDescriptor describes a message and // corresponds with the google.protobuf.DescriptorProto message. // // Nested declarations: // [FieldDescriptor], [OneofDescriptor], [FieldDescriptor], [EnumDescriptor], // and/or [MessageDescriptor]. type MessageDescriptor interface { Descriptor // IsMapEntry indicates that this is an auto-generated message type to // represent the entry type for a map field. // // Map entry messages have only two fields: // • a "key" field with a field number of 1 // • a "value" field with a field number of 2 // The key and value types are determined by these two fields. // // If IsMapEntry is true, it implies that FieldDescriptor.IsMap is true // for some field with this message type. IsMapEntry() bool // Fields is a list of nested field declarations. Fields() FieldDescriptors // Oneofs is a list of nested oneof declarations. Oneofs() OneofDescriptors // ReservedNames is a list of reserved field names. ReservedNames() Names // ReservedRanges is a list of reserved ranges of field numbers. ReservedRanges() FieldRanges // RequiredNumbers is a list of required field numbers. // In Proto3, it is always an empty list. RequiredNumbers() FieldNumbers // ExtensionRanges is the field ranges used for extension fields. // In Proto3, it is always an empty ranges. ExtensionRanges() FieldRanges // ExtensionRangeOptions returns the ith extension range options. // // To avoid a dependency cycle, this method returns a proto.Message] value, // which always contains a google.protobuf.ExtensionRangeOptions message. // This method returns a typed nil-pointer if no options are present. // The caller must import the descriptorpb package to use this. ExtensionRangeOptions(i int) ProtoMessage // Enums is a list of nested enum declarations. Enums() EnumDescriptors // Messages is a list of nested message declarations. Messages() MessageDescriptors // Extensions is a list of nested extension declarations. Extensions() ExtensionDescriptors isMessageDescriptor } type isMessageDescriptor interface{ ProtoType(MessageDescriptor) } // MessageType encapsulates a [MessageDescriptor] with a concrete Go implementation. // It is recommended that implementations of this interface also implement the // [MessageFieldTypes] interface. type MessageType interface { // New returns a newly allocated empty message. // It may return nil for synthetic messages representing a map entry. New() Message // Zero returns an empty, read-only message. // It may return nil for synthetic messages representing a map entry. Zero() Message // Descriptor returns the message descriptor. // // Invariant: t.Descriptor() == t.New().Descriptor() Descriptor() MessageDescriptor } // MessageFieldTypes extends a [MessageType] by providing type information // regarding enums and messages referenced by the message fields. type MessageFieldTypes interface { MessageType // Enum returns the EnumType for the ith field in MessageDescriptor.Fields. // It returns nil if the ith field is not an enum kind. // It panics if out of bounds. // // Invariant: mt.Enum(i).Descriptor() == mt.Descriptor().Fields(i).Enum() Enum(i int) EnumType // Message returns the MessageType for the ith field in MessageDescriptor.Fields. // It returns nil if the ith field is not a message or group kind. // It panics if out of bounds. // // Invariant: mt.Message(i).Descriptor() == mt.Descriptor().Fields(i).Message() Message(i int) MessageType } // MessageDescriptors is a list of message declarations. type MessageDescriptors interface { // Len reports the number of messages. Len() int // Get returns the ith MessageDescriptor. It panics if out of bounds. Get(i int) MessageDescriptor // ByName returns the MessageDescriptor for a message named s. // It returns nil if not found. ByName(s Name) MessageDescriptor doNotImplement } // FieldDescriptor describes a field within a message and // corresponds with the google.protobuf.FieldDescriptorProto message. // // It is used for both normal fields defined within the parent message // (e.g., [MessageDescriptor.Fields]) and fields that extend some remote message // (e.g., [FileDescriptor.Extensions] or [MessageDescriptor.Extensions]). type FieldDescriptor interface { Descriptor // Number reports the unique number for this field. Number() FieldNumber // Cardinality reports the cardinality for this field. Cardinality() Cardinality // Kind reports the basic kind for this field. Kind() Kind // HasJSONName reports whether this field has an explicitly set JSON name. HasJSONName() bool // JSONName reports the name used for JSON serialization. // It is usually the camel-cased form of the field name. // Extension fields are represented by the full name surrounded by brackets. JSONName() string // TextName reports the name used for text serialization. // It is usually the name of the field, except that groups use the name // of the inlined message, and extension fields are represented by the // full name surrounded by brackets. TextName() string // HasPresence reports whether the field distinguishes between unpopulated // and default values. HasPresence() bool // IsExtension reports whether this is an extension field. If false, // then Parent and ContainingMessage refer to the same message. // Otherwise, ContainingMessage and Parent likely differ. IsExtension() bool // HasOptionalKeyword reports whether the "optional" keyword was explicitly // specified in the source .proto file. HasOptionalKeyword() bool // Deprecated: support for weak fields has been removed. IsWeak() bool // IsPacked reports whether repeated primitive numeric kinds should be // serialized using a packed encoding. // If true, then it implies Cardinality is Repeated. IsPacked() bool // IsList reports whether this field represents a list, // where the value type for the associated field is a List. // It is equivalent to checking whether Cardinality is Repeated and // that IsMap reports false. IsList() bool // IsMap reports whether this field represents a map, // where the value type for the associated field is a Map. // It is equivalent to checking whether Cardinality is Repeated, // that the Kind is MessageKind, and that MessageDescriptor.IsMapEntry reports true. IsMap() bool // MapKey returns the field descriptor for the key in the map entry. // It returns nil if IsMap reports false. MapKey() FieldDescriptor // MapValue returns the field descriptor for the value in the map entry. // It returns nil if IsMap reports false. MapValue() FieldDescriptor // HasDefault reports whether this field has a default value. HasDefault() bool // Default returns the default value for scalar fields. // For proto2, it is the default value as specified in the proto file, // or the zero value if unspecified. // For proto3, it is always the zero value of the scalar. // The Value type is determined by the Kind. Default() Value // DefaultEnumValue returns the enum value descriptor for the default value // of an enum field, and is nil for any other kind of field. DefaultEnumValue() EnumValueDescriptor // ContainingOneof is the containing oneof that this field belongs to, // and is nil if this field is not part of a oneof. ContainingOneof() OneofDescriptor // ContainingMessage is the containing message that this field belongs to. // For extension fields, this may not necessarily be the parent message // that the field is declared within. ContainingMessage() MessageDescriptor // Enum is the enum descriptor if Kind is EnumKind. // It returns nil for any other Kind. Enum() EnumDescriptor // Message is the message descriptor if Kind is // MessageKind or GroupKind. It returns nil for any other Kind. Message() MessageDescriptor isFieldDescriptor } type isFieldDescriptor interface{ ProtoType(FieldDescriptor) } // FieldDescriptors is a list of field declarations. type FieldDescriptors interface { // Len reports the number of fields. Len() int // Get returns the ith FieldDescriptor. It panics if out of bounds. Get(i int) FieldDescriptor // ByName returns the FieldDescriptor for a field named s. // It returns nil if not found. ByName(s Name) FieldDescriptor // ByJSONName returns the FieldDescriptor for a field with s as the JSON name. // It returns nil if not found. ByJSONName(s string) FieldDescriptor // ByTextName returns the FieldDescriptor for a field with s as the text name. // It returns nil if not found. ByTextName(s string) FieldDescriptor // ByNumber returns the FieldDescriptor for a field numbered n. // It returns nil if not found. ByNumber(n FieldNumber) FieldDescriptor doNotImplement } // OneofDescriptor describes a oneof field set within a given message and // corresponds with the google.protobuf.OneofDescriptorProto message. type OneofDescriptor interface { Descriptor // IsSynthetic reports whether this is a synthetic oneof created to support // proto3 optional semantics. If true, Fields contains exactly one field // with FieldDescriptor.HasOptionalKeyword specified. IsSynthetic() bool // Fields is a list of fields belonging to this oneof. Fields() FieldDescriptors isOneofDescriptor } type isOneofDescriptor interface{ ProtoType(OneofDescriptor) } // OneofDescriptors is a list of oneof declarations. type OneofDescriptors interface { // Len reports the number of oneof fields. Len() int // Get returns the ith OneofDescriptor. It panics if out of bounds. Get(i int) OneofDescriptor // ByName returns the OneofDescriptor for a oneof named s. // It returns nil if not found. ByName(s Name) OneofDescriptor doNotImplement } // ExtensionDescriptor is an alias of [FieldDescriptor] for documentation. type ExtensionDescriptor = FieldDescriptor // ExtensionTypeDescriptor is an [ExtensionDescriptor] with an associated [ExtensionType]. type ExtensionTypeDescriptor interface { ExtensionDescriptor // Type returns the associated ExtensionType. Type() ExtensionType // Descriptor returns the plain ExtensionDescriptor without the // associated ExtensionType. Descriptor() ExtensionDescriptor } // ExtensionDescriptors is a list of field declarations. type ExtensionDescriptors interface { // Len reports the number of fields. Len() int // Get returns the ith ExtensionDescriptor. It panics if out of bounds. Get(i int) ExtensionDescriptor // ByName returns the ExtensionDescriptor for a field named s. // It returns nil if not found. ByName(s Name) ExtensionDescriptor doNotImplement } // ExtensionType encapsulates an [ExtensionDescriptor] with a concrete // Go implementation. The nested field descriptor must be for a extension field. // // While a normal field is a member of the parent message that it is declared // within (see [Descriptor.Parent]), an extension field is a member of some other // target message (see [FieldDescriptor.ContainingMessage]) and may have no // relationship with the parent. However, the full name of an extension field is // relative to the parent that it is declared within. // // For example: // // syntax = "proto2"; // package example; // message FooMessage { // extensions 100 to max; // } // message BarMessage { // extends FooMessage { optional BarMessage bar_field = 100; } // } // // Field "bar_field" is an extension of FooMessage, but its full name is // "example.BarMessage.bar_field" instead of "example.FooMessage.bar_field". type ExtensionType interface { // New returns a new value for the field. // For scalars, this returns the default value in native Go form. New() Value // Zero returns a new value for the field. // For scalars, this returns the default value in native Go form. // For composite types, this returns an empty, read-only message, list, or map. Zero() Value // TypeDescriptor returns the extension type descriptor. TypeDescriptor() ExtensionTypeDescriptor // ValueOf wraps the input and returns it as a Value. // ValueOf panics if the input value is invalid or not the appropriate type. // // ValueOf is more extensive than protoreflect.ValueOf for a given field's // value as it has more type information available. ValueOf(any) Value // InterfaceOf completely unwraps the Value to the underlying Go type. // InterfaceOf panics if the input is nil or does not represent the // appropriate underlying Go type. For composite types, it panics if the // value is not mutable. // // InterfaceOf is able to unwrap the Value further than Value.Interface // as it has more type information available. InterfaceOf(Value) any // IsValidValue reports whether the Value is valid to assign to the field. IsValidValue(Value) bool // IsValidInterface reports whether the input is valid to assign to the field. IsValidInterface(any) bool } // EnumDescriptor describes an enum and // corresponds with the google.protobuf.EnumDescriptorProto message. // // Nested declarations: // [EnumValueDescriptor]. type EnumDescriptor interface { Descriptor // Values is a list of nested enum value declarations. Values() EnumValueDescriptors // ReservedNames is a list of reserved enum names. ReservedNames() Names // ReservedRanges is a list of reserved ranges of enum numbers. ReservedRanges() EnumRanges // IsClosed reports whether this enum uses closed semantics. // See https://protobuf.dev/programming-guides/enum/#definitions. // Note: the Go protobuf implementation is not spec compliant and treats // all enums as open enums. IsClosed() bool isEnumDescriptor } type isEnumDescriptor interface{ ProtoType(EnumDescriptor) } // EnumType encapsulates an [EnumDescriptor] with a concrete Go implementation. type EnumType interface { // New returns an instance of this enum type with its value set to n. New(n EnumNumber) Enum // Descriptor returns the enum descriptor. // // Invariant: t.Descriptor() == t.New(0).Descriptor() Descriptor() EnumDescriptor } // EnumDescriptors is a list of enum declarations. type EnumDescriptors interface { // Len reports the number of enum types. Len() int // Get returns the ith EnumDescriptor. It panics if out of bounds. Get(i int) EnumDescriptor // ByName returns the EnumDescriptor for an enum named s. // It returns nil if not found. ByName(s Name) EnumDescriptor doNotImplement } // EnumValueDescriptor describes an enum value and // corresponds with the google.protobuf.EnumValueDescriptorProto message. // // All other proto declarations are in the namespace of the parent. // However, enum values do not follow this rule and are within the namespace // of the parent's parent (i.e., they are a sibling of the containing enum). // Thus, a value named "FOO_VALUE" declared within an enum uniquely identified // as "proto.package.MyEnum" has a full name of "proto.package.FOO_VALUE". type EnumValueDescriptor interface { Descriptor // Number returns the enum value as an integer. Number() EnumNumber isEnumValueDescriptor } type isEnumValueDescriptor interface{ ProtoType(EnumValueDescriptor) } // EnumValueDescriptors is a list of enum value declarations. type EnumValueDescriptors interface { // Len reports the number of enum values. Len() int // Get returns the ith EnumValueDescriptor. It panics if out of bounds. Get(i int) EnumValueDescriptor // ByName returns the EnumValueDescriptor for the enum value named s. // It returns nil if not found. ByName(s Name) EnumValueDescriptor // ByNumber returns the EnumValueDescriptor for the enum value numbered n. // If multiple have the same number, the first one defined is returned // It returns nil if not found. ByNumber(n EnumNumber) EnumValueDescriptor doNotImplement } // ServiceDescriptor describes a service and // corresponds with the google.protobuf.ServiceDescriptorProto message. // // Nested declarations: [MethodDescriptor]. type ServiceDescriptor interface { Descriptor // Methods is a list of nested message declarations. Methods() MethodDescriptors isServiceDescriptor } type isServiceDescriptor interface{ ProtoType(ServiceDescriptor) } // ServiceDescriptors is a list of service declarations. type ServiceDescriptors interface { // Len reports the number of services. Len() int // Get returns the ith ServiceDescriptor. It panics if out of bounds. Get(i int) ServiceDescriptor // ByName returns the ServiceDescriptor for a service named s. // It returns nil if not found. ByName(s Name) ServiceDescriptor doNotImplement } // MethodDescriptor describes a method and // corresponds with the google.protobuf.MethodDescriptorProto message. type MethodDescriptor interface { Descriptor // Input is the input message descriptor. Input() MessageDescriptor // Output is the output message descriptor. Output() MessageDescriptor // IsStreamingClient reports whether the client streams multiple messages. IsStreamingClient() bool // IsStreamingServer reports whether the server streams multiple messages. IsStreamingServer() bool isMethodDescriptor } type isMethodDescriptor interface{ ProtoType(MethodDescriptor) } // MethodDescriptors is a list of method declarations. type MethodDescriptors interface { // Len reports the number of methods. Len() int // Get returns the ith MethodDescriptor. It panics if out of bounds. Get(i int) MethodDescriptor // ByName returns the MethodDescriptor for a service method named s. // It returns nil if not found. ByName(s Name) MethodDescriptor doNotImplement } ================================================ FILE: vendor/google.golang.org/protobuf/reflect/protoreflect/value.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package protoreflect import "google.golang.org/protobuf/encoding/protowire" // Enum is a reflection interface for a concrete enum value, // which provides type information and a getter for the enum number. // Enum does not provide a mutable API since enums are commonly backed by // Go constants, which are not addressable. type Enum interface { // Descriptor returns enum descriptor, which contains only the protobuf // type information for the enum. Descriptor() EnumDescriptor // Type returns the enum type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the enum descriptor be used instead. Type() EnumType // Number returns the enum value as an integer. Number() EnumNumber } // Message is a reflective interface for a concrete message value, // encapsulating both type and value information for the message. // // Accessor/mutators for individual fields are keyed by [FieldDescriptor]. // For non-extension fields, the descriptor must exactly match the // field known by the parent message. // For extension fields, the descriptor must implement [ExtensionTypeDescriptor], // extend the parent message (i.e., have the same message [FullName]), and // be within the parent's extension range. // // Each field [Value] can be a scalar or a composite type ([Message], [List], or [Map]). // See [Value] for the Go types associated with a [FieldDescriptor]. // Providing a [Value] that is invalid or of an incorrect type panics. type Message interface { // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. Descriptor() MessageDescriptor // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. Type() MessageType // New returns a newly allocated and mutable empty message. New() Message // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. Interface() ProtoMessage // Range iterates over every populated field in an undefined order, // calling f for each field descriptor and value encountered. // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. Range(f func(FieldDescriptor, Value) bool) // Has reports whether a field is populated. // // Some fields have the property of nullability where it is possible to // distinguish between the default value of a field and whether the field // was explicitly populated with the default value. Singular message fields, // member fields of a oneof, and proto2 scalar fields are nullable. Such // fields are populated only if explicitly set. // // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. Has(FieldDescriptor) bool // Clear clears the field such that a subsequent Has call reports false. // // Clearing an extension field clears both the extension type and value // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. Clear(FieldDescriptor) // Get retrieves the value for a field. // // For unpopulated scalars, it returns the default value, where // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. Get(FieldDescriptor) Value // Set stores the value for a field. // // For a field belonging to a oneof, it implicitly clears any other field // that may be currently set within the same oneof. // For extension fields, it implicitly stores the provided ExtensionType. // When setting a composite type, it is unspecified whether the stored value // aliases the source's memory in any way. If the composite value is an // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. Set(FieldDescriptor, Value) // Mutable returns a mutable reference to a composite type. // // If the field is unpopulated, it may allocate a composite value. // For a field belonging to a oneof, it implicitly clears any other field // that may be currently set within the same oneof. // For extension fields, it implicitly stores the provided ExtensionType // if not already stored. // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. Mutable(FieldDescriptor) Value // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. NewField(FieldDescriptor) Value // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. WhichOneof(OneofDescriptor) FieldDescriptor // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. GetUnknown() RawFields // SetUnknown stores an entire list of unknown fields. // The raw fields must be syntactically valid according to the wire format. // An implementation may panic if this is not the case. // Once stored, the caller must not mutate the content of the RawFields. // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. SetUnknown(RawFields) // IsValid reports whether the message is valid. // // An invalid message is an empty, read-only value. // // An invalid message often corresponds to a nil pointer of the concrete // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. IsValid() bool // ProtoMethods returns optional fast-path implementations of various operations. // This method may return nil. // // The returned methods type is identical to // [google.golang.org/protobuf/runtime/protoiface.Methods]. // Consult the protoiface package documentation for details. ProtoMethods() *methods } // RawFields is the raw bytes for an ordered sequence of fields. // Each field contains both the tag (representing field number and wire type), // and also the wire data itself. type RawFields []byte // IsValid reports whether b is syntactically correct wire format. func (b RawFields) IsValid() bool { for len(b) > 0 { _, _, n := protowire.ConsumeField(b) if n < 0 { return false } b = b[n:] } return true } // List is a zero-indexed, ordered list. // The element [Value] type is determined by [FieldDescriptor.Kind]. // Providing a [Value] that is invalid or of an incorrect type panics. type List interface { // Len reports the number of entries in the List. // Get, Set, and Truncate panic with out of bound indexes. Len() int // Get retrieves the value at the given index. // It never returns an invalid value. Get(int) Value // Set stores a value for the given index. // When setting a composite type, it is unspecified whether the set // value aliases the source's memory in any way. // // Set is a mutating operation and unsafe for concurrent use. Set(int, Value) // Append appends the provided value to the end of the list. // When appending a composite type, it is unspecified whether the appended // value aliases the source's memory in any way. // // Append is a mutating operation and unsafe for concurrent use. Append(Value) // AppendMutable appends a new, empty, mutable message value to the end // of the list and returns it. // It panics if the list does not contain a message type. AppendMutable() Value // Truncate truncates the list to a smaller length. // // Truncate is a mutating operation and unsafe for concurrent use. Truncate(int) // NewElement returns a new value for a list element. // For enums, this returns the first enum value. // For other scalars, this returns the zero value. // For messages, this returns a new, empty, mutable value. NewElement() Value // IsValid reports whether the list is valid. // // An invalid list is an empty, read-only value. // // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. IsValid() bool } // Map is an unordered, associative map. // The entry [MapKey] type is determined by [FieldDescriptor.MapKey].Kind. // The entry [Value] type is determined by [FieldDescriptor.MapValue].Kind. // Providing a [MapKey] or [Value] that is invalid or of an incorrect type panics. type Map interface { // Len reports the number of elements in the map. Len() int // Range iterates over every map entry in an undefined order, // calling f for each key and value encountered. // Range calls f Len times unless f returns false, which stops iteration. // While iterating, mutating operations may only be performed // on the current map key. Range(f func(MapKey, Value) bool) // Has reports whether an entry with the given key is in the map. Has(MapKey) bool // Clear clears the entry associated with they given key. // The operation does nothing if there is no entry associated with the key. // // Clear is a mutating operation and unsafe for concurrent use. Clear(MapKey) // Get retrieves the value for an entry with the given key. // It returns an invalid value for non-existent entries. Get(MapKey) Value // Set stores the value for an entry with the given key. // It panics when given a key or value that is invalid or the wrong type. // When setting a composite type, it is unspecified whether the set // value aliases the source's memory in any way. // // Set is a mutating operation and unsafe for concurrent use. Set(MapKey, Value) // Mutable retrieves a mutable reference to the entry for the given key. // If no entry exists for the key, it creates a new, empty, mutable value // and stores it as the entry for the key. // It panics if the map value is not a message. Mutable(MapKey) Value // NewValue returns a new value assignable as a map value. // For enums, this returns the first enum value. // For other scalars, this returns the zero value. // For messages, this returns a new, empty, mutable value. NewValue() Value // IsValid reports whether the map is valid. // // An invalid map is an empty, read-only value. // // An invalid message often corresponds to a nil Go map value, // but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. IsValid() bool } ================================================ FILE: vendor/google.golang.org/protobuf/reflect/protoreflect/value_equal.go ================================================ // Copyright 2022 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package protoreflect import ( "bytes" "fmt" "math" "reflect" "google.golang.org/protobuf/encoding/protowire" ) // Equal reports whether v1 and v2 are recursively equal. // // - Values of different types are always unequal. // // - Bytes values are equal if they contain identical bytes. // Empty bytes (regardless of nil-ness) are considered equal. // // - Floating point values are equal if they contain the same value. // Unlike the == operator, a NaN is equal to another NaN. // // - Enums are equal if they contain the same number. // Since [Value] does not contain an enum descriptor, // enum values do not consider the type of the enum. // // - Other scalar values are equal if they contain the same value. // // - [Message] values are equal if they belong to the same message descriptor, // have the same set of populated known and extension field values, // and the same set of unknown fields values. // // - [List] values are equal if they are the same length and // each corresponding element is equal. // // - [Map] values are equal if they have the same set of keys and // the corresponding value for each key is equal. func (v1 Value) Equal(v2 Value) bool { return equalValue(v1, v2) } func equalValue(x, y Value) bool { eqType := x.typ == y.typ switch x.typ { case nilType: return eqType case boolType: return eqType && x.Bool() == y.Bool() case int32Type, int64Type: return eqType && x.Int() == y.Int() case uint32Type, uint64Type: return eqType && x.Uint() == y.Uint() case float32Type, float64Type: return eqType && equalFloat(x.Float(), y.Float()) case stringType: return eqType && x.String() == y.String() case bytesType: return eqType && bytes.Equal(x.Bytes(), y.Bytes()) case enumType: return eqType && x.Enum() == y.Enum() default: switch x := x.Interface().(type) { case Message: y, ok := y.Interface().(Message) return ok && equalMessage(x, y) case List: y, ok := y.Interface().(List) return ok && equalList(x, y) case Map: y, ok := y.Interface().(Map) return ok && equalMap(x, y) default: panic(fmt.Sprintf("unknown type: %T", x)) } } } // equalFloat compares two floats, where NaNs are treated as equal. func equalFloat(x, y float64) bool { if math.IsNaN(x) || math.IsNaN(y) { return math.IsNaN(x) && math.IsNaN(y) } return x == y } // equalMessage compares two messages. func equalMessage(mx, my Message) bool { if mx.Descriptor() != my.Descriptor() { return false } nx := 0 equal := true mx.Range(func(fd FieldDescriptor, vx Value) bool { nx++ vy := my.Get(fd) equal = my.Has(fd) && equalValue(vx, vy) return equal }) if !equal { return false } ny := 0 my.Range(func(fd FieldDescriptor, vx Value) bool { ny++ return true }) if nx != ny { return false } return equalUnknown(mx.GetUnknown(), my.GetUnknown()) } // equalList compares two lists. func equalList(x, y List) bool { if x.Len() != y.Len() { return false } for i := x.Len() - 1; i >= 0; i-- { if !equalValue(x.Get(i), y.Get(i)) { return false } } return true } // equalMap compares two maps. func equalMap(x, y Map) bool { if x.Len() != y.Len() { return false } equal := true x.Range(func(k MapKey, vx Value) bool { vy := y.Get(k) equal = y.Has(k) && equalValue(vx, vy) return equal }) return equal } // equalUnknown compares unknown fields by direct comparison on the raw bytes // of each individual field number. func equalUnknown(x, y RawFields) bool { if len(x) != len(y) { return false } if bytes.Equal([]byte(x), []byte(y)) { return true } mx := make(map[FieldNumber]RawFields) my := make(map[FieldNumber]RawFields) for len(x) > 0 { fnum, _, n := protowire.ConsumeField(x) mx[fnum] = append(mx[fnum], x[:n]...) x = x[n:] } for len(y) > 0 { fnum, _, n := protowire.ConsumeField(y) my[fnum] = append(my[fnum], y[:n]...) y = y[n:] } return reflect.DeepEqual(mx, my) } ================================================ FILE: vendor/google.golang.org/protobuf/reflect/protoreflect/value_union.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package protoreflect import ( "fmt" "math" ) // Value is a union where only one Go type may be set at a time. // The Value is used to represent all possible values a field may take. // The following shows which Go type is used to represent each proto [Kind]: // // ╔════════════╤═════════════════════════════════════╗ // ║ Go type │ Protobuf kind ║ // ╠════════════╪═════════════════════════════════════╣ // ║ bool │ BoolKind ║ // ║ int32 │ Int32Kind, Sint32Kind, Sfixed32Kind ║ // ║ int64 │ Int64Kind, Sint64Kind, Sfixed64Kind ║ // ║ uint32 │ Uint32Kind, Fixed32Kind ║ // ║ uint64 │ Uint64Kind, Fixed64Kind ║ // ║ float32 │ FloatKind ║ // ║ float64 │ DoubleKind ║ // ║ string │ StringKind ║ // ║ []byte │ BytesKind ║ // ║ EnumNumber │ EnumKind ║ // ║ Message │ MessageKind, GroupKind ║ // ╚════════════╧═════════════════════════════════════╝ // // Multiple protobuf Kinds may be represented by a single Go type if the type // can losslessly represent the information for the proto kind. For example, // [Int64Kind], [Sint64Kind], and [Sfixed64Kind] are all represented by int64, // but use different integer encoding methods. // // The [List] or [Map] types are used if the field cardinality is repeated. // A field is a [List] if [FieldDescriptor.IsList] reports true. // A field is a [Map] if [FieldDescriptor.IsMap] reports true. // // Converting to/from a Value and a concrete Go value panics on type mismatch. // For example, [ValueOf]("hello").Int() panics because this attempts to // retrieve an int64 from a string. // // [List], [Map], and [Message] Values are called "composite" values. // // A composite Value may alias (reference) memory at some location, // such that changes to the Value updates the that location. // A composite value acquired with a Mutable method, such as [Message.Mutable], // always references the source object. // // For example: // // // Append a 0 to a "repeated int32" field. // // Since the Value returned by Mutable is guaranteed to alias // // the source message, modifying the Value modifies the message. // message.Mutable(fieldDesc).List().Append(protoreflect.ValueOfInt32(0)) // // // Assign [0] to a "repeated int32" field by creating a new Value, // // modifying it, and assigning it. // list := message.NewField(fieldDesc).List() // list.Append(protoreflect.ValueOfInt32(0)) // message.Set(fieldDesc, list) // // ERROR: Since it is not defined whether Set aliases the source, // // appending to the List here may or may not modify the message. // list.Append(protoreflect.ValueOfInt32(0)) // // Some operations, such as [Message.Get], may return an "empty, read-only" // composite Value. Modifying an empty, read-only value panics. type Value value // The protoreflect API uses a custom Value union type instead of any // to keep the future open for performance optimizations. Using an any // always incurs an allocation for primitives (e.g., int64) since it needs to // be boxed on the heap (as interfaces can only contain pointers natively). // Instead, we represent the Value union as a flat struct that internally keeps // track of which type is set. Using unsafe, the Value union can be reduced // down to 24B, which is identical in size to a slice. // // The latest compiler (Go1.11) currently suffers from some limitations: // • With inlining, the compiler should be able to statically prove that // only one of these switch cases are taken and inline one specific case. // See https://golang.org/issue/22310. // ValueOf returns a Value initialized with the concrete value stored in v. // This panics if the type does not match one of the allowed types in the // Value union. func ValueOf(v any) Value { switch v := v.(type) { case nil: return Value{} case bool: return ValueOfBool(v) case int32: return ValueOfInt32(v) case int64: return ValueOfInt64(v) case uint32: return ValueOfUint32(v) case uint64: return ValueOfUint64(v) case float32: return ValueOfFloat32(v) case float64: return ValueOfFloat64(v) case string: return ValueOfString(v) case []byte: return ValueOfBytes(v) case EnumNumber: return ValueOfEnum(v) case Message, List, Map: return valueOfIface(v) case ProtoMessage: panic(fmt.Sprintf("invalid proto.Message(%T) type, expected a protoreflect.Message type", v)) default: panic(fmt.Sprintf("invalid type: %T", v)) } } // ValueOfBool returns a new boolean value. func ValueOfBool(v bool) Value { if v { return Value{typ: boolType, num: 1} } else { return Value{typ: boolType, num: 0} } } // ValueOfInt32 returns a new int32 value. func ValueOfInt32(v int32) Value { return Value{typ: int32Type, num: uint64(v)} } // ValueOfInt64 returns a new int64 value. func ValueOfInt64(v int64) Value { return Value{typ: int64Type, num: uint64(v)} } // ValueOfUint32 returns a new uint32 value. func ValueOfUint32(v uint32) Value { return Value{typ: uint32Type, num: uint64(v)} } // ValueOfUint64 returns a new uint64 value. func ValueOfUint64(v uint64) Value { return Value{typ: uint64Type, num: v} } // ValueOfFloat32 returns a new float32 value. func ValueOfFloat32(v float32) Value { return Value{typ: float32Type, num: uint64(math.Float64bits(float64(v)))} } // ValueOfFloat64 returns a new float64 value. func ValueOfFloat64(v float64) Value { return Value{typ: float64Type, num: uint64(math.Float64bits(float64(v)))} } // ValueOfString returns a new string value. func ValueOfString(v string) Value { return valueOfString(v) } // ValueOfBytes returns a new bytes value. func ValueOfBytes(v []byte) Value { return valueOfBytes(v[:len(v):len(v)]) } // ValueOfEnum returns a new enum value. func ValueOfEnum(v EnumNumber) Value { return Value{typ: enumType, num: uint64(v)} } // ValueOfMessage returns a new Message value. func ValueOfMessage(v Message) Value { return valueOfIface(v) } // ValueOfList returns a new List value. func ValueOfList(v List) Value { return valueOfIface(v) } // ValueOfMap returns a new Map value. func ValueOfMap(v Map) Value { return valueOfIface(v) } // IsValid reports whether v is populated with a value. func (v Value) IsValid() bool { return v.typ != nilType } // Interface returns v as an any. // // Invariant: v == ValueOf(v).Interface() func (v Value) Interface() any { switch v.typ { case nilType: return nil case boolType: return v.Bool() case int32Type: return int32(v.Int()) case int64Type: return int64(v.Int()) case uint32Type: return uint32(v.Uint()) case uint64Type: return uint64(v.Uint()) case float32Type: return float32(v.Float()) case float64Type: return float64(v.Float()) case stringType: return v.String() case bytesType: return v.Bytes() case enumType: return v.Enum() default: return v.getIface() } } func (v Value) typeName() string { switch v.typ { case nilType: return "nil" case boolType: return "bool" case int32Type: return "int32" case int64Type: return "int64" case uint32Type: return "uint32" case uint64Type: return "uint64" case float32Type: return "float32" case float64Type: return "float64" case stringType: return "string" case bytesType: return "bytes" case enumType: return "enum" default: switch v := v.getIface().(type) { case Message: return "message" case List: return "list" case Map: return "map" default: return fmt.Sprintf("", v) } } } func (v Value) panicMessage(what string) string { return fmt.Sprintf("type mismatch: cannot convert %v to %s", v.typeName(), what) } // Bool returns v as a bool and panics if the type is not a bool. func (v Value) Bool() bool { switch v.typ { case boolType: return v.num > 0 default: panic(v.panicMessage("bool")) } } // Int returns v as a int64 and panics if the type is not a int32 or int64. func (v Value) Int() int64 { switch v.typ { case int32Type, int64Type: return int64(v.num) default: panic(v.panicMessage("int")) } } // Uint returns v as a uint64 and panics if the type is not a uint32 or uint64. func (v Value) Uint() uint64 { switch v.typ { case uint32Type, uint64Type: return uint64(v.num) default: panic(v.panicMessage("uint")) } } // Float returns v as a float64 and panics if the type is not a float32 or float64. func (v Value) Float() float64 { switch v.typ { case float32Type, float64Type: return math.Float64frombits(uint64(v.num)) default: panic(v.panicMessage("float")) } } // String returns v as a string. Since this method implements [fmt.Stringer], // this returns the formatted string value for any non-string type. func (v Value) String() string { switch v.typ { case stringType: return v.getString() default: return fmt.Sprint(v.Interface()) } } // Bytes returns v as a []byte and panics if the type is not a []byte. func (v Value) Bytes() []byte { switch v.typ { case bytesType: return v.getBytes() default: panic(v.panicMessage("bytes")) } } // Enum returns v as a [EnumNumber] and panics if the type is not a [EnumNumber]. func (v Value) Enum() EnumNumber { switch v.typ { case enumType: return EnumNumber(v.num) default: panic(v.panicMessage("enum")) } } // Message returns v as a [Message] and panics if the type is not a [Message]. func (v Value) Message() Message { switch vi := v.getIface().(type) { case Message: return vi default: panic(v.panicMessage("message")) } } // List returns v as a [List] and panics if the type is not a [List]. func (v Value) List() List { switch vi := v.getIface().(type) { case List: return vi default: panic(v.panicMessage("list")) } } // Map returns v as a [Map] and panics if the type is not a [Map]. func (v Value) Map() Map { switch vi := v.getIface().(type) { case Map: return vi default: panic(v.panicMessage("map")) } } // MapKey returns v as a [MapKey] and panics for invalid [MapKey] types. func (v Value) MapKey() MapKey { switch v.typ { case boolType, int32Type, int64Type, uint32Type, uint64Type, stringType: return MapKey(v) default: panic(v.panicMessage("map key")) } } // MapKey is used to index maps, where the Go type of the MapKey must match // the specified key [Kind] (see [MessageDescriptor.IsMapEntry]). // The following shows what Go type is used to represent each proto [Kind]: // // ╔═════════╤═════════════════════════════════════╗ // ║ Go type │ Protobuf kind ║ // ╠═════════╪═════════════════════════════════════╣ // ║ bool │ BoolKind ║ // ║ int32 │ Int32Kind, Sint32Kind, Sfixed32Kind ║ // ║ int64 │ Int64Kind, Sint64Kind, Sfixed64Kind ║ // ║ uint32 │ Uint32Kind, Fixed32Kind ║ // ║ uint64 │ Uint64Kind, Fixed64Kind ║ // ║ string │ StringKind ║ // ╚═════════╧═════════════════════════════════════╝ // // A MapKey is constructed and accessed through a [Value]: // // k := ValueOf("hash").MapKey() // convert string to MapKey // s := k.String() // convert MapKey to string // // The MapKey is a strict subset of valid types used in [Value]; // converting a [Value] to a MapKey with an invalid type panics. type MapKey value // IsValid reports whether k is populated with a value. func (k MapKey) IsValid() bool { return Value(k).IsValid() } // Interface returns k as an any. func (k MapKey) Interface() any { return Value(k).Interface() } // Bool returns k as a bool and panics if the type is not a bool. func (k MapKey) Bool() bool { return Value(k).Bool() } // Int returns k as a int64 and panics if the type is not a int32 or int64. func (k MapKey) Int() int64 { return Value(k).Int() } // Uint returns k as a uint64 and panics if the type is not a uint32 or uint64. func (k MapKey) Uint() uint64 { return Value(k).Uint() } // String returns k as a string. Since this method implements [fmt.Stringer], // this returns the formatted string value for any non-string type. func (k MapKey) String() string { return Value(k).String() } // Value returns k as a [Value]. func (k MapKey) Value() Value { return Value(k) } ================================================ FILE: vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package protoreflect import ( "unsafe" "google.golang.org/protobuf/internal/pragma" ) type ( ifaceHeader struct { _ [0]any // if interfaces have greater alignment than unsafe.Pointer, this will enforce it. Type unsafe.Pointer Data unsafe.Pointer } ) var ( nilType = typeOf(nil) boolType = typeOf(*new(bool)) int32Type = typeOf(*new(int32)) int64Type = typeOf(*new(int64)) uint32Type = typeOf(*new(uint32)) uint64Type = typeOf(*new(uint64)) float32Type = typeOf(*new(float32)) float64Type = typeOf(*new(float64)) stringType = typeOf(*new(string)) bytesType = typeOf(*new([]byte)) enumType = typeOf(*new(EnumNumber)) ) // typeOf returns a pointer to the Go type information. // The pointer is comparable and equal if and only if the types are identical. func typeOf(t any) unsafe.Pointer { return (*ifaceHeader)(unsafe.Pointer(&t)).Type } // value is a union where only one type can be represented at a time. // The struct is 24B large on 64-bit systems and requires the minimum storage // necessary to represent each possible type. // // The Go GC needs to be able to scan variables containing pointers. // As such, pointers and non-pointers cannot be intermixed. type value struct { pragma.DoNotCompare // 0B // typ stores the type of the value as a pointer to the Go type. typ unsafe.Pointer // 8B // ptr stores the data pointer for a String, Bytes, or interface value. ptr unsafe.Pointer // 8B // num stores a Bool, Int32, Int64, Uint32, Uint64, Float32, Float64, or // Enum value as a raw uint64. // // It is also used to store the length of a String or Bytes value; // the capacity is ignored. num uint64 // 8B } func valueOfString(v string) Value { return Value{typ: stringType, ptr: unsafe.Pointer(unsafe.StringData(v)), num: uint64(len(v))} } func valueOfBytes(v []byte) Value { return Value{typ: bytesType, ptr: unsafe.Pointer(unsafe.SliceData(v)), num: uint64(len(v))} } func valueOfIface(v any) Value { p := (*ifaceHeader)(unsafe.Pointer(&v)) return Value{typ: p.Type, ptr: p.Data} } func (v Value) getString() string { return unsafe.String((*byte)(v.ptr), v.num) } func (v Value) getBytes() []byte { return unsafe.Slice((*byte)(v.ptr), v.num) } func (v Value) getIface() (x any) { *(*ifaceHeader)(unsafe.Pointer(&x)) = ifaceHeader{Type: v.typ, Data: v.ptr} return x } ================================================ FILE: vendor/google.golang.org/protobuf/reflect/protoregistry/registry.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package protoregistry provides data structures to register and lookup // protobuf descriptor types. // // The [Files] registry contains file descriptors and provides the ability // to iterate over the files or lookup a specific descriptor within the files. // [Files] only contains protobuf descriptors and has no understanding of Go // type information that may be associated with each descriptor. // // The [Types] registry contains descriptor types for which there is a known // Go type associated with that descriptor. It provides the ability to iterate // over the registered types or lookup a type by name. package protoregistry import ( "fmt" "os" "strings" "sync" "google.golang.org/protobuf/internal/encoding/messageset" "google.golang.org/protobuf/internal/errors" "google.golang.org/protobuf/internal/flags" "google.golang.org/protobuf/reflect/protoreflect" ) // conflictPolicy configures the policy for handling registration conflicts. // // It can be over-written at compile time with a linker-initialized variable: // // go build -ldflags "-X google.golang.org/protobuf/reflect/protoregistry.conflictPolicy=warn" // // It can be over-written at program execution with an environment variable: // // GOLANG_PROTOBUF_REGISTRATION_CONFLICT=warn ./main // // Neither of the above are covered by the compatibility promise and // may be removed in a future release of this module. var conflictPolicy = "panic" // "panic" | "warn" | "ignore" // ignoreConflict reports whether to ignore a registration conflict // given the descriptor being registered and the error. // It is a variable so that the behavior is easily overridden in another file. var ignoreConflict = func(d protoreflect.Descriptor, err error) bool { const env = "GOLANG_PROTOBUF_REGISTRATION_CONFLICT" const faq = "https://protobuf.dev/reference/go/faq#namespace-conflict" policy := conflictPolicy if v := os.Getenv(env); v != "" { policy = v } switch policy { case "panic": panic(fmt.Sprintf("%v\nSee %v\n", err, faq)) case "warn": fmt.Fprintf(os.Stderr, "WARNING: %v\nSee %v\n\n", err, faq) return true case "ignore": return true default: panic("invalid " + env + " value: " + os.Getenv(env)) } } var globalMutex sync.RWMutex // GlobalFiles is a global registry of file descriptors. var GlobalFiles *Files = new(Files) // GlobalTypes is the registry used by default for type lookups // unless a local registry is provided by the user. var GlobalTypes *Types = new(Types) // NotFound is a sentinel error value to indicate that the type was not found. // // Since registry lookup can happen in the critical performance path, resolvers // must return this exact error value, not an error wrapping it. var NotFound = errors.New("not found") // Files is a registry for looking up or iterating over files and the // descriptors contained within them. // The Find and Range methods are safe for concurrent use. type Files struct { // The map of descsByName contains: // EnumDescriptor // EnumValueDescriptor // MessageDescriptor // ExtensionDescriptor // ServiceDescriptor // *packageDescriptor // // Note that files are stored as a slice, since a package may contain // multiple files. Only top-level declarations are registered. // Note that enum values are in the top-level since that are in the same // scope as the parent enum. descsByName map[protoreflect.FullName]any filesByPath map[string][]protoreflect.FileDescriptor numFiles int } type packageDescriptor struct { files []protoreflect.FileDescriptor } // RegisterFile registers the provided file descriptor. // // If any descriptor within the file conflicts with the descriptor of any // previously registered file (e.g., two enums with the same full name), // then the file is not registered and an error is returned. // // It is permitted for multiple files to have the same file path. func (r *Files) RegisterFile(file protoreflect.FileDescriptor) error { if r == GlobalFiles { globalMutex.Lock() defer globalMutex.Unlock() } if r.descsByName == nil { r.descsByName = map[protoreflect.FullName]any{ "": &packageDescriptor{}, } r.filesByPath = make(map[string][]protoreflect.FileDescriptor) } path := file.Path() if prev := r.filesByPath[path]; len(prev) > 0 { r.checkGenProtoConflict(path) err := errors.New("file %q is already registered", file.Path()) err = amendErrorWithCaller(err, prev[0], file) if !(r == GlobalFiles && ignoreConflict(file, err)) { return err } } for name := file.Package(); name != ""; name = name.Parent() { switch prev := r.descsByName[name]; prev.(type) { case nil, *packageDescriptor: default: err := errors.New("file %q has a package name conflict over %v", file.Path(), name) err = amendErrorWithCaller(err, prev, file) if r == GlobalFiles && ignoreConflict(file, err) { err = nil } return err } } var err error var hasConflict bool rangeTopLevelDescriptors(file, func(d protoreflect.Descriptor) { if prev := r.descsByName[d.FullName()]; prev != nil { hasConflict = true err = errors.New("file %q has a name conflict over %v", file.Path(), d.FullName()) err = amendErrorWithCaller(err, prev, file) if r == GlobalFiles && ignoreConflict(d, err) { err = nil } } }) if hasConflict { return err } for name := file.Package(); name != ""; name = name.Parent() { if r.descsByName[name] == nil { r.descsByName[name] = &packageDescriptor{} } } p := r.descsByName[file.Package()].(*packageDescriptor) p.files = append(p.files, file) rangeTopLevelDescriptors(file, func(d protoreflect.Descriptor) { r.descsByName[d.FullName()] = d }) r.filesByPath[path] = append(r.filesByPath[path], file) r.numFiles++ return nil } // Several well-known types were hosted in the google.golang.org/genproto module // but were later moved to this module. To avoid a weak dependency on the // genproto module (and its relatively large set of transitive dependencies), // we rely on a registration conflict to determine whether the genproto version // is too old (i.e., does not contain aliases to the new type declarations). func (r *Files) checkGenProtoConflict(path string) { if r != GlobalFiles { return } var prevPath string const prevModule = "google.golang.org/genproto" const prevVersion = "cb27e3aa (May 26th, 2020)" switch path { case "google/protobuf/field_mask.proto": prevPath = prevModule + "/protobuf/field_mask" case "google/protobuf/api.proto": prevPath = prevModule + "/protobuf/api" case "google/protobuf/type.proto": prevPath = prevModule + "/protobuf/ptype" case "google/protobuf/source_context.proto": prevPath = prevModule + "/protobuf/source_context" default: return } pkgName := strings.TrimSuffix(strings.TrimPrefix(path, "google/protobuf/"), ".proto") pkgName = strings.Replace(pkgName, "_", "", -1) + "pb" // e.g., "field_mask" => "fieldmaskpb" currPath := "google.golang.org/protobuf/types/known/" + pkgName panic(fmt.Sprintf(""+ "duplicate registration of %q\n"+ "\n"+ "The generated definition for this file has moved:\n"+ "\tfrom: %q\n"+ "\tto: %q\n"+ "A dependency on the %q module must\n"+ "be at version %v or higher.\n"+ "\n"+ "Upgrade the dependency by running:\n"+ "\tgo get -u %v\n", path, prevPath, currPath, prevModule, prevVersion, prevPath)) } // FindDescriptorByName looks up a descriptor by the full name. // // This returns (nil, [NotFound]) if not found. func (r *Files) FindDescriptorByName(name protoreflect.FullName) (protoreflect.Descriptor, error) { if r == nil { return nil, NotFound } if r == GlobalFiles { globalMutex.RLock() defer globalMutex.RUnlock() } prefix := name suffix := nameSuffix("") for prefix != "" { if d, ok := r.descsByName[prefix]; ok { switch d := d.(type) { case protoreflect.EnumDescriptor: if d.FullName() == name { return d, nil } case protoreflect.EnumValueDescriptor: if d.FullName() == name { return d, nil } case protoreflect.MessageDescriptor: if d.FullName() == name { return d, nil } if d := findDescriptorInMessage(d, suffix); d != nil && d.FullName() == name { return d, nil } case protoreflect.ExtensionDescriptor: if d.FullName() == name { return d, nil } case protoreflect.ServiceDescriptor: if d.FullName() == name { return d, nil } if d := d.Methods().ByName(suffix.Pop()); d != nil && d.FullName() == name { return d, nil } } return nil, NotFound } prefix = prefix.Parent() suffix = nameSuffix(name[len(prefix)+len("."):]) } return nil, NotFound } func findDescriptorInMessage(md protoreflect.MessageDescriptor, suffix nameSuffix) protoreflect.Descriptor { name := suffix.Pop() if suffix == "" { if ed := md.Enums().ByName(name); ed != nil { return ed } for i := md.Enums().Len() - 1; i >= 0; i-- { if vd := md.Enums().Get(i).Values().ByName(name); vd != nil { return vd } } if xd := md.Extensions().ByName(name); xd != nil { return xd } if fd := md.Fields().ByName(name); fd != nil { return fd } if od := md.Oneofs().ByName(name); od != nil { return od } } if md := md.Messages().ByName(name); md != nil { if suffix == "" { return md } return findDescriptorInMessage(md, suffix) } return nil } type nameSuffix string func (s *nameSuffix) Pop() (name protoreflect.Name) { if i := strings.IndexByte(string(*s), '.'); i >= 0 { name, *s = protoreflect.Name((*s)[:i]), (*s)[i+1:] } else { name, *s = protoreflect.Name((*s)), "" } return name } // FindFileByPath looks up a file by the path. // // This returns (nil, [NotFound]) if not found. // This returns an error if multiple files have the same path. func (r *Files) FindFileByPath(path string) (protoreflect.FileDescriptor, error) { if r == nil { return nil, NotFound } if r == GlobalFiles { globalMutex.RLock() defer globalMutex.RUnlock() } fds := r.filesByPath[path] switch len(fds) { case 0: return nil, NotFound case 1: return fds[0], nil default: return nil, errors.New("multiple files named %q", path) } } // NumFiles reports the number of registered files, // including duplicate files with the same name. func (r *Files) NumFiles() int { if r == nil { return 0 } if r == GlobalFiles { globalMutex.RLock() defer globalMutex.RUnlock() } return r.numFiles } // RangeFiles iterates over all registered files while f returns true. // If multiple files have the same name, RangeFiles iterates over all of them. // The iteration order is undefined. func (r *Files) RangeFiles(f func(protoreflect.FileDescriptor) bool) { if r == nil { return } if r == GlobalFiles { globalMutex.RLock() defer globalMutex.RUnlock() } for _, files := range r.filesByPath { for _, file := range files { if !f(file) { return } } } } // NumFilesByPackage reports the number of registered files in a proto package. func (r *Files) NumFilesByPackage(name protoreflect.FullName) int { if r == nil { return 0 } if r == GlobalFiles { globalMutex.RLock() defer globalMutex.RUnlock() } p, ok := r.descsByName[name].(*packageDescriptor) if !ok { return 0 } return len(p.files) } // RangeFilesByPackage iterates over all registered files in a given proto package // while f returns true. The iteration order is undefined. func (r *Files) RangeFilesByPackage(name protoreflect.FullName, f func(protoreflect.FileDescriptor) bool) { if r == nil { return } if r == GlobalFiles { globalMutex.RLock() defer globalMutex.RUnlock() } p, ok := r.descsByName[name].(*packageDescriptor) if !ok { return } for _, file := range p.files { if !f(file) { return } } } // rangeTopLevelDescriptors iterates over all top-level descriptors in a file // which will be directly entered into the registry. func rangeTopLevelDescriptors(fd protoreflect.FileDescriptor, f func(protoreflect.Descriptor)) { eds := fd.Enums() for i := eds.Len() - 1; i >= 0; i-- { f(eds.Get(i)) vds := eds.Get(i).Values() for i := vds.Len() - 1; i >= 0; i-- { f(vds.Get(i)) } } mds := fd.Messages() for i := mds.Len() - 1; i >= 0; i-- { f(mds.Get(i)) } xds := fd.Extensions() for i := xds.Len() - 1; i >= 0; i-- { f(xds.Get(i)) } sds := fd.Services() for i := sds.Len() - 1; i >= 0; i-- { f(sds.Get(i)) } } // MessageTypeResolver is an interface for looking up messages. // // A compliant implementation must deterministically return the same type // if no error is encountered. // // The [Types] type implements this interface. type MessageTypeResolver interface { // FindMessageByName looks up a message by its full name. // E.g., "google.protobuf.Any" // // This return (nil, NotFound) if not found. FindMessageByName(message protoreflect.FullName) (protoreflect.MessageType, error) // FindMessageByURL looks up a message by a URL identifier. // See documentation on google.protobuf.Any.type_url for the URL format. // // This returns (nil, NotFound) if not found. FindMessageByURL(url string) (protoreflect.MessageType, error) } // ExtensionTypeResolver is an interface for looking up extensions. // // A compliant implementation must deterministically return the same type // if no error is encountered. // // The [Types] type implements this interface. type ExtensionTypeResolver interface { // FindExtensionByName looks up a extension field by the field's full name. // Note that this is the full name of the field as determined by // where the extension is declared and is unrelated to the full name of the // message being extended. // // This returns (nil, NotFound) if not found. FindExtensionByName(field protoreflect.FullName) (protoreflect.ExtensionType, error) // FindExtensionByNumber looks up a extension field by the field number // within some parent message, identified by full name. // // This returns (nil, NotFound) if not found. FindExtensionByNumber(message protoreflect.FullName, field protoreflect.FieldNumber) (protoreflect.ExtensionType, error) } var ( _ MessageTypeResolver = (*Types)(nil) _ ExtensionTypeResolver = (*Types)(nil) ) // Types is a registry for looking up or iterating over descriptor types. // The Find and Range methods are safe for concurrent use. type Types struct { typesByName typesByName extensionsByMessage extensionsByMessage numEnums int numMessages int numExtensions int } type ( typesByName map[protoreflect.FullName]any extensionsByMessage map[protoreflect.FullName]extensionsByNumber extensionsByNumber map[protoreflect.FieldNumber]protoreflect.ExtensionType ) // RegisterMessage registers the provided message type. // // If a naming conflict occurs, the type is not registered and an error is returned. func (r *Types) RegisterMessage(mt protoreflect.MessageType) error { // Under rare circumstances getting the descriptor might recursively // examine the registry, so fetch it before locking. md := mt.Descriptor() if r == GlobalTypes { globalMutex.Lock() defer globalMutex.Unlock() } if err := r.register("message", md, mt); err != nil { return err } r.numMessages++ return nil } // RegisterEnum registers the provided enum type. // // If a naming conflict occurs, the type is not registered and an error is returned. func (r *Types) RegisterEnum(et protoreflect.EnumType) error { // Under rare circumstances getting the descriptor might recursively // examine the registry, so fetch it before locking. ed := et.Descriptor() if r == GlobalTypes { globalMutex.Lock() defer globalMutex.Unlock() } if err := r.register("enum", ed, et); err != nil { return err } r.numEnums++ return nil } // RegisterExtension registers the provided extension type. // // If a naming conflict occurs, the type is not registered and an error is returned. func (r *Types) RegisterExtension(xt protoreflect.ExtensionType) error { // Under rare circumstances getting the descriptor might recursively // examine the registry, so fetch it before locking. // // A known case where this can happen: Fetching the TypeDescriptor for a // legacy ExtensionDesc can consult the global registry. xd := xt.TypeDescriptor() if r == GlobalTypes { globalMutex.Lock() defer globalMutex.Unlock() } field := xd.Number() message := xd.ContainingMessage().FullName() if prev := r.extensionsByMessage[message][field]; prev != nil { err := errors.New("extension number %d is already registered on message %v", field, message) err = amendErrorWithCaller(err, prev, xt) if !(r == GlobalTypes && ignoreConflict(xd, err)) { return err } } if err := r.register("extension", xd, xt); err != nil { return err } if r.extensionsByMessage == nil { r.extensionsByMessage = make(extensionsByMessage) } if r.extensionsByMessage[message] == nil { r.extensionsByMessage[message] = make(extensionsByNumber) } r.extensionsByMessage[message][field] = xt r.numExtensions++ return nil } func (r *Types) register(kind string, desc protoreflect.Descriptor, typ any) error { name := desc.FullName() prev := r.typesByName[name] if prev != nil { err := errors.New("%v %v is already registered", kind, name) err = amendErrorWithCaller(err, prev, typ) if !(r == GlobalTypes && ignoreConflict(desc, err)) { return err } } if r.typesByName == nil { r.typesByName = make(typesByName) } r.typesByName[name] = typ return nil } // FindEnumByName looks up an enum by its full name. // E.g., "google.protobuf.Field.Kind". // // This returns (nil, [NotFound]) if not found. func (r *Types) FindEnumByName(enum protoreflect.FullName) (protoreflect.EnumType, error) { if r == nil { return nil, NotFound } if r == GlobalTypes { globalMutex.RLock() defer globalMutex.RUnlock() } if v := r.typesByName[enum]; v != nil { if et, _ := v.(protoreflect.EnumType); et != nil { return et, nil } return nil, errors.New("found wrong type: got %v, want enum", typeName(v)) } return nil, NotFound } // FindMessageByName looks up a message by its full name, // e.g. "google.protobuf.Any". // // This returns (nil, [NotFound]) if not found. func (r *Types) FindMessageByName(message protoreflect.FullName) (protoreflect.MessageType, error) { if r == nil { return nil, NotFound } if r == GlobalTypes { globalMutex.RLock() defer globalMutex.RUnlock() } if v := r.typesByName[message]; v != nil { if mt, _ := v.(protoreflect.MessageType); mt != nil { return mt, nil } return nil, errors.New("found wrong type: got %v, want message", typeName(v)) } return nil, NotFound } // FindMessageByURL looks up a message by a URL identifier. // See documentation on google.protobuf.Any.type_url for the URL format. // // This returns (nil, [NotFound]) if not found. func (r *Types) FindMessageByURL(url string) (protoreflect.MessageType, error) { // This function is similar to FindMessageByName but // truncates anything before and including '/' in the URL. if r == nil { return nil, NotFound } if r == GlobalTypes { globalMutex.RLock() defer globalMutex.RUnlock() } message := protoreflect.FullName(url) if i := strings.LastIndexByte(url, '/'); i >= 0 { message = message[i+len("/"):] } if v := r.typesByName[message]; v != nil { if mt, _ := v.(protoreflect.MessageType); mt != nil { return mt, nil } return nil, errors.New("found wrong type: got %v, want message", typeName(v)) } return nil, NotFound } // FindExtensionByName looks up a extension field by the field's full name. // Note that this is the full name of the field as determined by // where the extension is declared and is unrelated to the full name of the // message being extended. // // This returns (nil, [NotFound]) if not found. func (r *Types) FindExtensionByName(field protoreflect.FullName) (protoreflect.ExtensionType, error) { if r == nil { return nil, NotFound } if r == GlobalTypes { globalMutex.RLock() defer globalMutex.RUnlock() } if v := r.typesByName[field]; v != nil { if xt, _ := v.(protoreflect.ExtensionType); xt != nil { return xt, nil } // MessageSet extensions are special in that the name of the extension // is the name of the message type used to extend the MessageSet. // This naming scheme is used by text and JSON serialization. // // This feature is protected by the ProtoLegacy flag since MessageSets // are a proto1 feature that is long deprecated. if flags.ProtoLegacy { if _, ok := v.(protoreflect.MessageType); ok { field := field.Append(messageset.ExtensionName) if v := r.typesByName[field]; v != nil { if xt, _ := v.(protoreflect.ExtensionType); xt != nil { if messageset.IsMessageSetExtension(xt.TypeDescriptor()) { return xt, nil } } } } } return nil, errors.New("found wrong type: got %v, want extension", typeName(v)) } return nil, NotFound } // FindExtensionByNumber looks up a extension field by the field number // within some parent message, identified by full name. // // This returns (nil, [NotFound]) if not found. func (r *Types) FindExtensionByNumber(message protoreflect.FullName, field protoreflect.FieldNumber) (protoreflect.ExtensionType, error) { if r == nil { return nil, NotFound } if r == GlobalTypes { globalMutex.RLock() defer globalMutex.RUnlock() } if xt, ok := r.extensionsByMessage[message][field]; ok { return xt, nil } return nil, NotFound } // NumEnums reports the number of registered enums. func (r *Types) NumEnums() int { if r == nil { return 0 } if r == GlobalTypes { globalMutex.RLock() defer globalMutex.RUnlock() } return r.numEnums } // RangeEnums iterates over all registered enums while f returns true. // Iteration order is undefined. func (r *Types) RangeEnums(f func(protoreflect.EnumType) bool) { if r == nil { return } if r == GlobalTypes { globalMutex.RLock() defer globalMutex.RUnlock() } for _, typ := range r.typesByName { if et, ok := typ.(protoreflect.EnumType); ok { if !f(et) { return } } } } // NumMessages reports the number of registered messages. func (r *Types) NumMessages() int { if r == nil { return 0 } if r == GlobalTypes { globalMutex.RLock() defer globalMutex.RUnlock() } return r.numMessages } // RangeMessages iterates over all registered messages while f returns true. // Iteration order is undefined. func (r *Types) RangeMessages(f func(protoreflect.MessageType) bool) { if r == nil { return } if r == GlobalTypes { globalMutex.RLock() defer globalMutex.RUnlock() } for _, typ := range r.typesByName { if mt, ok := typ.(protoreflect.MessageType); ok { if !f(mt) { return } } } } // NumExtensions reports the number of registered extensions. func (r *Types) NumExtensions() int { if r == nil { return 0 } if r == GlobalTypes { globalMutex.RLock() defer globalMutex.RUnlock() } return r.numExtensions } // RangeExtensions iterates over all registered extensions while f returns true. // Iteration order is undefined. func (r *Types) RangeExtensions(f func(protoreflect.ExtensionType) bool) { if r == nil { return } if r == GlobalTypes { globalMutex.RLock() defer globalMutex.RUnlock() } for _, typ := range r.typesByName { if xt, ok := typ.(protoreflect.ExtensionType); ok { if !f(xt) { return } } } } // NumExtensionsByMessage reports the number of registered extensions for // a given message type. func (r *Types) NumExtensionsByMessage(message protoreflect.FullName) int { if r == nil { return 0 } if r == GlobalTypes { globalMutex.RLock() defer globalMutex.RUnlock() } return len(r.extensionsByMessage[message]) } // RangeExtensionsByMessage iterates over all registered extensions filtered // by a given message type while f returns true. Iteration order is undefined. func (r *Types) RangeExtensionsByMessage(message protoreflect.FullName, f func(protoreflect.ExtensionType) bool) { if r == nil { return } if r == GlobalTypes { globalMutex.RLock() defer globalMutex.RUnlock() } for _, xt := range r.extensionsByMessage[message] { if !f(xt) { return } } } func typeName(t any) string { switch t.(type) { case protoreflect.EnumType: return "enum" case protoreflect.MessageType: return "message" case protoreflect.ExtensionType: return "extension" default: return fmt.Sprintf("%T", t) } } func amendErrorWithCaller(err error, prev, curr any) error { prevPkg := goPackage(prev) currPkg := goPackage(curr) if prevPkg == "" || currPkg == "" || prevPkg == currPkg { return err } return errors.New("%s\n\tpreviously from: %q\n\tcurrently from: %q", err, prevPkg, currPkg) } func goPackage(v any) string { switch d := v.(type) { case protoreflect.EnumType: v = d.Descriptor() case protoreflect.MessageType: v = d.Descriptor() case protoreflect.ExtensionType: v = d.TypeDescriptor() } if d, ok := v.(protoreflect.Descriptor); ok { v = d.ParentFile() } if d, ok := v.(interface{ GoPackagePath() string }); ok { return d.GoPackagePath() } return "" } ================================================ FILE: vendor/google.golang.org/protobuf/runtime/protoiface/legacy.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package protoiface type MessageV1 interface { Reset() String() string ProtoMessage() } type ExtensionRangeV1 struct { Start, End int32 // both inclusive } ================================================ FILE: vendor/google.golang.org/protobuf/runtime/protoiface/methods.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package protoiface contains types referenced or implemented by messages. // // WARNING: This package should only be imported by message implementations. // The functionality found in this package should be accessed through // higher-level abstractions provided by the proto package. package protoiface import ( "google.golang.org/protobuf/internal/pragma" "google.golang.org/protobuf/reflect/protoreflect" ) // Methods is a set of optional fast-path implementations of various operations. type Methods = struct { pragma.NoUnkeyedLiterals // Flags indicate support for optional features. Flags SupportFlags // Size returns the size in bytes of the wire-format encoding of a message. // Marshal must be provided if a custom Size is provided. Size func(SizeInput) SizeOutput // Marshal formats a message in the wire-format encoding to the provided buffer. // Size should be provided if a custom Marshal is provided. // It must not return an error for a partial message. Marshal func(MarshalInput) (MarshalOutput, error) // Unmarshal parses the wire-format encoding and merges the result into a message. // It must not reset the target message or return an error for a partial message. Unmarshal func(UnmarshalInput) (UnmarshalOutput, error) // Merge merges the contents of a source message into a destination message. Merge func(MergeInput) MergeOutput // CheckInitialized returns an error if any required fields in the message are not set. CheckInitialized func(CheckInitializedInput) (CheckInitializedOutput, error) // Equal compares two messages and returns EqualOutput.Equal == true if they are equal. Equal func(EqualInput) EqualOutput } // SupportFlags indicate support for optional features. type SupportFlags = uint64 const ( // SupportMarshalDeterministic reports whether MarshalOptions.Deterministic is supported. SupportMarshalDeterministic SupportFlags = 1 << iota // SupportUnmarshalDiscardUnknown reports whether UnmarshalOptions.DiscardUnknown is supported. SupportUnmarshalDiscardUnknown ) // SizeInput is input to the Size method. type SizeInput = struct { pragma.NoUnkeyedLiterals Message protoreflect.Message Flags MarshalInputFlags } // SizeOutput is output from the Size method. type SizeOutput = struct { pragma.NoUnkeyedLiterals Size int } // MarshalInput is input to the Marshal method. type MarshalInput = struct { pragma.NoUnkeyedLiterals Message protoreflect.Message Buf []byte // output is appended to this buffer Flags MarshalInputFlags } // MarshalOutput is output from the Marshal method. type MarshalOutput = struct { pragma.NoUnkeyedLiterals Buf []byte // contains marshaled message } // MarshalInputFlags configure the marshaler. // Most flags correspond to fields in proto.MarshalOptions. type MarshalInputFlags = uint8 const ( MarshalDeterministic MarshalInputFlags = 1 << iota MarshalUseCachedSize ) // UnmarshalInput is input to the Unmarshal method. type UnmarshalInput = struct { pragma.NoUnkeyedLiterals Message protoreflect.Message Buf []byte // input buffer Flags UnmarshalInputFlags Resolver interface { FindExtensionByName(field protoreflect.FullName) (protoreflect.ExtensionType, error) FindExtensionByNumber(message protoreflect.FullName, field protoreflect.FieldNumber) (protoreflect.ExtensionType, error) } Depth int } // UnmarshalOutput is output from the Unmarshal method. type UnmarshalOutput = struct { pragma.NoUnkeyedLiterals Flags UnmarshalOutputFlags } // UnmarshalInputFlags configure the unmarshaler. // Most flags correspond to fields in proto.UnmarshalOptions. type UnmarshalInputFlags = uint8 const ( UnmarshalDiscardUnknown UnmarshalInputFlags = 1 << iota // UnmarshalAliasBuffer permits unmarshal operations to alias the input buffer. // The unmarshaller must not modify the contents of the buffer. UnmarshalAliasBuffer // UnmarshalValidated indicates that validation has already been // performed on the input buffer. UnmarshalValidated // UnmarshalCheckRequired is set if this unmarshal operation ultimately will care if required fields are // initialized. UnmarshalCheckRequired // UnmarshalNoLazyDecoding is set if this unmarshal operation should not use // lazy decoding, even when otherwise available. UnmarshalNoLazyDecoding ) // UnmarshalOutputFlags are output from the Unmarshal method. type UnmarshalOutputFlags = uint8 const ( // UnmarshalInitialized may be set on return if all required fields are known to be set. // If unset, then it does not necessarily indicate that the message is uninitialized, // only that its status could not be confirmed. UnmarshalInitialized UnmarshalOutputFlags = 1 << iota ) // MergeInput is input to the Merge method. type MergeInput = struct { pragma.NoUnkeyedLiterals Source protoreflect.Message Destination protoreflect.Message } // MergeOutput is output from the Merge method. type MergeOutput = struct { pragma.NoUnkeyedLiterals Flags MergeOutputFlags } // MergeOutputFlags are output from the Merge method. type MergeOutputFlags = uint8 const ( // MergeComplete reports whether the merge was performed. // If unset, the merger must have made no changes to the destination. MergeComplete MergeOutputFlags = 1 << iota ) // CheckInitializedInput is input to the CheckInitialized method. type CheckInitializedInput = struct { pragma.NoUnkeyedLiterals Message protoreflect.Message } // CheckInitializedOutput is output from the CheckInitialized method. type CheckInitializedOutput = struct { pragma.NoUnkeyedLiterals } // EqualInput is input to the Equal method. type EqualInput = struct { pragma.NoUnkeyedLiterals MessageA protoreflect.Message MessageB protoreflect.Message } // EqualOutput is output from the Equal method. type EqualOutput = struct { pragma.NoUnkeyedLiterals Equal bool } ================================================ FILE: vendor/google.golang.org/protobuf/runtime/protoimpl/impl.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package protoimpl contains the default implementation for messages // generated by protoc-gen-go. // // WARNING: This package should only ever be imported by generated messages. // The compatibility agreement covers nothing except for functionality needed // to keep existing generated messages operational. Breakages that occur due // to unauthorized usages of this package are not the author's responsibility. package protoimpl import ( "google.golang.org/protobuf/internal/filedesc" "google.golang.org/protobuf/internal/filetype" "google.golang.org/protobuf/internal/impl" "google.golang.org/protobuf/internal/protolazy" ) // UnsafeEnabled specifies whether package unsafe can be used. const UnsafeEnabled = impl.UnsafeEnabled type ( // Types used by generated code in init functions. DescBuilder = filedesc.Builder TypeBuilder = filetype.Builder // Types used by generated code to implement EnumType, MessageType, and ExtensionType. EnumInfo = impl.EnumInfo MessageInfo = impl.MessageInfo ExtensionInfo = impl.ExtensionInfo // Types embedded in generated messages. MessageState = impl.MessageState SizeCache = impl.SizeCache WeakFields = impl.WeakFields UnknownFields = impl.UnknownFields ExtensionFields = impl.ExtensionFields ExtensionFieldV1 = impl.ExtensionField Pointer = impl.Pointer LazyUnmarshalInfo = *protolazy.XXX_lazyUnmarshalInfo RaceDetectHookData = impl.RaceDetectHookData ) var X impl.Export ================================================ FILE: vendor/google.golang.org/protobuf/runtime/protoimpl/version.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package protoimpl import ( "google.golang.org/protobuf/internal/version" ) const ( // MaxVersion is the maximum supported version for generated .pb.go files. // It is always the current version of the module. MaxVersion = version.Minor // GenVersion is the runtime version required by generated .pb.go files. // This is incremented when generated code relies on new functionality // in the runtime. GenVersion = 20 // MinVersion is the minimum supported version for generated .pb.go files. // This is incremented when the runtime drops support for old code. MinVersion = 0 ) // EnforceVersion is used by code generated by protoc-gen-go // to statically enforce minimum and maximum versions of this package. // A compilation failure implies either that: // - the runtime package is too old and needs to be updated OR // - the generated code is too old and needs to be regenerated. // // The runtime package can be upgraded by running: // // go get google.golang.org/protobuf // // The generated code can be regenerated by running: // // protoc --go_out=${PROTOC_GEN_GO_ARGS} ${PROTO_FILES} // // Example usage by generated code: // // const ( // // Verify that this generated code is sufficiently up-to-date. // _ = protoimpl.EnforceVersion(genVersion - protoimpl.MinVersion) // // Verify that runtime/protoimpl is sufficiently up-to-date. // _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - genVersion) // ) // // The genVersion is the current minor version used to generated the code. // This compile-time check relies on negative integer overflow of a uint // being a compilation failure (guaranteed by the Go specification). type EnforceVersion uint // This enforces the following invariant: // // MinVersion ≤ GenVersion ≤ MaxVersion const ( _ = EnforceVersion(GenVersion - MinVersion) _ = EnforceVersion(MaxVersion - GenVersion) ) ================================================ FILE: vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Author: kenton@google.com (Kenton Varda) // Based on original Protocol Buffers design by // Sanjay Ghemawat, Jeff Dean, and others. // // The messages in this file describe the definitions found in .proto files. // A valid .proto file can be translated directly to a FileDescriptorProto // without any other information (e.g. without reading its imports). // Code generated by protoc-gen-go. DO NOT EDIT. // source: google/protobuf/descriptor.proto package descriptorpb import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" unsafe "unsafe" ) // The full set of known editions. type Edition int32 const ( // A placeholder for an unknown edition value. Edition_EDITION_UNKNOWN Edition = 0 // A placeholder edition for specifying default behaviors *before* a feature // was first introduced. This is effectively an "infinite past". Edition_EDITION_LEGACY Edition = 900 // Legacy syntax "editions". These pre-date editions, but behave much like // distinct editions. These can't be used to specify the edition of proto // files, but feature definitions must supply proto2/proto3 defaults for // backwards compatibility. Edition_EDITION_PROTO2 Edition = 998 Edition_EDITION_PROTO3 Edition = 999 // Editions that have been released. The specific values are arbitrary and // should not be depended on, but they will always be time-ordered for easy // comparison. Edition_EDITION_2023 Edition = 1000 Edition_EDITION_2024 Edition = 1001 // A placeholder edition for developing and testing unscheduled features. Edition_EDITION_UNSTABLE Edition = 9999 // Placeholder editions for testing feature resolution. These should not be // used or relied on outside of tests. Edition_EDITION_1_TEST_ONLY Edition = 1 Edition_EDITION_2_TEST_ONLY Edition = 2 Edition_EDITION_99997_TEST_ONLY Edition = 99997 Edition_EDITION_99998_TEST_ONLY Edition = 99998 Edition_EDITION_99999_TEST_ONLY Edition = 99999 // Placeholder for specifying unbounded edition support. This should only // ever be used by plugins that can expect to never require any changes to // support a new edition. Edition_EDITION_MAX Edition = 2147483647 ) // Enum value maps for Edition. var ( Edition_name = map[int32]string{ 0: "EDITION_UNKNOWN", 900: "EDITION_LEGACY", 998: "EDITION_PROTO2", 999: "EDITION_PROTO3", 1000: "EDITION_2023", 1001: "EDITION_2024", 9999: "EDITION_UNSTABLE", 1: "EDITION_1_TEST_ONLY", 2: "EDITION_2_TEST_ONLY", 99997: "EDITION_99997_TEST_ONLY", 99998: "EDITION_99998_TEST_ONLY", 99999: "EDITION_99999_TEST_ONLY", 2147483647: "EDITION_MAX", } Edition_value = map[string]int32{ "EDITION_UNKNOWN": 0, "EDITION_LEGACY": 900, "EDITION_PROTO2": 998, "EDITION_PROTO3": 999, "EDITION_2023": 1000, "EDITION_2024": 1001, "EDITION_UNSTABLE": 9999, "EDITION_1_TEST_ONLY": 1, "EDITION_2_TEST_ONLY": 2, "EDITION_99997_TEST_ONLY": 99997, "EDITION_99998_TEST_ONLY": 99998, "EDITION_99999_TEST_ONLY": 99999, "EDITION_MAX": 2147483647, } ) func (x Edition) Enum() *Edition { p := new(Edition) *p = x return p } func (x Edition) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (Edition) Descriptor() protoreflect.EnumDescriptor { return file_google_protobuf_descriptor_proto_enumTypes[0].Descriptor() } func (Edition) Type() protoreflect.EnumType { return &file_google_protobuf_descriptor_proto_enumTypes[0] } func (x Edition) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Do not use. func (x *Edition) UnmarshalJSON(b []byte) error { num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) if err != nil { return err } *x = Edition(num) return nil } // Deprecated: Use Edition.Descriptor instead. func (Edition) EnumDescriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{0} } // Describes the 'visibility' of a symbol with respect to the proto import // system. Symbols can only be imported when the visibility rules do not prevent // it (ex: local symbols cannot be imported). Visibility modifiers can only set // on `message` and `enum` as they are the only types available to be referenced // from other files. type SymbolVisibility int32 const ( SymbolVisibility_VISIBILITY_UNSET SymbolVisibility = 0 SymbolVisibility_VISIBILITY_LOCAL SymbolVisibility = 1 SymbolVisibility_VISIBILITY_EXPORT SymbolVisibility = 2 ) // Enum value maps for SymbolVisibility. var ( SymbolVisibility_name = map[int32]string{ 0: "VISIBILITY_UNSET", 1: "VISIBILITY_LOCAL", 2: "VISIBILITY_EXPORT", } SymbolVisibility_value = map[string]int32{ "VISIBILITY_UNSET": 0, "VISIBILITY_LOCAL": 1, "VISIBILITY_EXPORT": 2, } ) func (x SymbolVisibility) Enum() *SymbolVisibility { p := new(SymbolVisibility) *p = x return p } func (x SymbolVisibility) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (SymbolVisibility) Descriptor() protoreflect.EnumDescriptor { return file_google_protobuf_descriptor_proto_enumTypes[1].Descriptor() } func (SymbolVisibility) Type() protoreflect.EnumType { return &file_google_protobuf_descriptor_proto_enumTypes[1] } func (x SymbolVisibility) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Do not use. func (x *SymbolVisibility) UnmarshalJSON(b []byte) error { num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) if err != nil { return err } *x = SymbolVisibility(num) return nil } // Deprecated: Use SymbolVisibility.Descriptor instead. func (SymbolVisibility) EnumDescriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{1} } // The verification state of the extension range. type ExtensionRangeOptions_VerificationState int32 const ( // All the extensions of the range must be declared. ExtensionRangeOptions_DECLARATION ExtensionRangeOptions_VerificationState = 0 ExtensionRangeOptions_UNVERIFIED ExtensionRangeOptions_VerificationState = 1 ) // Enum value maps for ExtensionRangeOptions_VerificationState. var ( ExtensionRangeOptions_VerificationState_name = map[int32]string{ 0: "DECLARATION", 1: "UNVERIFIED", } ExtensionRangeOptions_VerificationState_value = map[string]int32{ "DECLARATION": 0, "UNVERIFIED": 1, } ) func (x ExtensionRangeOptions_VerificationState) Enum() *ExtensionRangeOptions_VerificationState { p := new(ExtensionRangeOptions_VerificationState) *p = x return p } func (x ExtensionRangeOptions_VerificationState) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (ExtensionRangeOptions_VerificationState) Descriptor() protoreflect.EnumDescriptor { return file_google_protobuf_descriptor_proto_enumTypes[2].Descriptor() } func (ExtensionRangeOptions_VerificationState) Type() protoreflect.EnumType { return &file_google_protobuf_descriptor_proto_enumTypes[2] } func (x ExtensionRangeOptions_VerificationState) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Do not use. func (x *ExtensionRangeOptions_VerificationState) UnmarshalJSON(b []byte) error { num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) if err != nil { return err } *x = ExtensionRangeOptions_VerificationState(num) return nil } // Deprecated: Use ExtensionRangeOptions_VerificationState.Descriptor instead. func (ExtensionRangeOptions_VerificationState) EnumDescriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{3, 0} } type FieldDescriptorProto_Type int32 const ( // 0 is reserved for errors. // Order is weird for historical reasons. FieldDescriptorProto_TYPE_DOUBLE FieldDescriptorProto_Type = 1 FieldDescriptorProto_TYPE_FLOAT FieldDescriptorProto_Type = 2 // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if // negative values are likely. FieldDescriptorProto_TYPE_INT64 FieldDescriptorProto_Type = 3 FieldDescriptorProto_TYPE_UINT64 FieldDescriptorProto_Type = 4 // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if // negative values are likely. FieldDescriptorProto_TYPE_INT32 FieldDescriptorProto_Type = 5 FieldDescriptorProto_TYPE_FIXED64 FieldDescriptorProto_Type = 6 FieldDescriptorProto_TYPE_FIXED32 FieldDescriptorProto_Type = 7 FieldDescriptorProto_TYPE_BOOL FieldDescriptorProto_Type = 8 FieldDescriptorProto_TYPE_STRING FieldDescriptorProto_Type = 9 // Tag-delimited aggregate. // Group type is deprecated and not supported after google.protobuf. However, Proto3 // implementations should still be able to parse the group wire format and // treat group fields as unknown fields. In Editions, the group wire format // can be enabled via the `message_encoding` feature. FieldDescriptorProto_TYPE_GROUP FieldDescriptorProto_Type = 10 FieldDescriptorProto_TYPE_MESSAGE FieldDescriptorProto_Type = 11 // Length-delimited aggregate. // New in version 2. FieldDescriptorProto_TYPE_BYTES FieldDescriptorProto_Type = 12 FieldDescriptorProto_TYPE_UINT32 FieldDescriptorProto_Type = 13 FieldDescriptorProto_TYPE_ENUM FieldDescriptorProto_Type = 14 FieldDescriptorProto_TYPE_SFIXED32 FieldDescriptorProto_Type = 15 FieldDescriptorProto_TYPE_SFIXED64 FieldDescriptorProto_Type = 16 FieldDescriptorProto_TYPE_SINT32 FieldDescriptorProto_Type = 17 // Uses ZigZag encoding. FieldDescriptorProto_TYPE_SINT64 FieldDescriptorProto_Type = 18 // Uses ZigZag encoding. ) // Enum value maps for FieldDescriptorProto_Type. var ( FieldDescriptorProto_Type_name = map[int32]string{ 1: "TYPE_DOUBLE", 2: "TYPE_FLOAT", 3: "TYPE_INT64", 4: "TYPE_UINT64", 5: "TYPE_INT32", 6: "TYPE_FIXED64", 7: "TYPE_FIXED32", 8: "TYPE_BOOL", 9: "TYPE_STRING", 10: "TYPE_GROUP", 11: "TYPE_MESSAGE", 12: "TYPE_BYTES", 13: "TYPE_UINT32", 14: "TYPE_ENUM", 15: "TYPE_SFIXED32", 16: "TYPE_SFIXED64", 17: "TYPE_SINT32", 18: "TYPE_SINT64", } FieldDescriptorProto_Type_value = map[string]int32{ "TYPE_DOUBLE": 1, "TYPE_FLOAT": 2, "TYPE_INT64": 3, "TYPE_UINT64": 4, "TYPE_INT32": 5, "TYPE_FIXED64": 6, "TYPE_FIXED32": 7, "TYPE_BOOL": 8, "TYPE_STRING": 9, "TYPE_GROUP": 10, "TYPE_MESSAGE": 11, "TYPE_BYTES": 12, "TYPE_UINT32": 13, "TYPE_ENUM": 14, "TYPE_SFIXED32": 15, "TYPE_SFIXED64": 16, "TYPE_SINT32": 17, "TYPE_SINT64": 18, } ) func (x FieldDescriptorProto_Type) Enum() *FieldDescriptorProto_Type { p := new(FieldDescriptorProto_Type) *p = x return p } func (x FieldDescriptorProto_Type) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (FieldDescriptorProto_Type) Descriptor() protoreflect.EnumDescriptor { return file_google_protobuf_descriptor_proto_enumTypes[3].Descriptor() } func (FieldDescriptorProto_Type) Type() protoreflect.EnumType { return &file_google_protobuf_descriptor_proto_enumTypes[3] } func (x FieldDescriptorProto_Type) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Do not use. func (x *FieldDescriptorProto_Type) UnmarshalJSON(b []byte) error { num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) if err != nil { return err } *x = FieldDescriptorProto_Type(num) return nil } // Deprecated: Use FieldDescriptorProto_Type.Descriptor instead. func (FieldDescriptorProto_Type) EnumDescriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{4, 0} } type FieldDescriptorProto_Label int32 const ( // 0 is reserved for errors FieldDescriptorProto_LABEL_OPTIONAL FieldDescriptorProto_Label = 1 FieldDescriptorProto_LABEL_REPEATED FieldDescriptorProto_Label = 3 // The required label is only allowed in google.protobuf. In proto3 and Editions // it's explicitly prohibited. In Editions, the `field_presence` feature // can be used to get this behavior. FieldDescriptorProto_LABEL_REQUIRED FieldDescriptorProto_Label = 2 ) // Enum value maps for FieldDescriptorProto_Label. var ( FieldDescriptorProto_Label_name = map[int32]string{ 1: "LABEL_OPTIONAL", 3: "LABEL_REPEATED", 2: "LABEL_REQUIRED", } FieldDescriptorProto_Label_value = map[string]int32{ "LABEL_OPTIONAL": 1, "LABEL_REPEATED": 3, "LABEL_REQUIRED": 2, } ) func (x FieldDescriptorProto_Label) Enum() *FieldDescriptorProto_Label { p := new(FieldDescriptorProto_Label) *p = x return p } func (x FieldDescriptorProto_Label) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (FieldDescriptorProto_Label) Descriptor() protoreflect.EnumDescriptor { return file_google_protobuf_descriptor_proto_enumTypes[4].Descriptor() } func (FieldDescriptorProto_Label) Type() protoreflect.EnumType { return &file_google_protobuf_descriptor_proto_enumTypes[4] } func (x FieldDescriptorProto_Label) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Do not use. func (x *FieldDescriptorProto_Label) UnmarshalJSON(b []byte) error { num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) if err != nil { return err } *x = FieldDescriptorProto_Label(num) return nil } // Deprecated: Use FieldDescriptorProto_Label.Descriptor instead. func (FieldDescriptorProto_Label) EnumDescriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{4, 1} } // Generated classes can be optimized for speed or code size. type FileOptions_OptimizeMode int32 const ( FileOptions_SPEED FileOptions_OptimizeMode = 1 // Generate complete code for parsing, serialization, // etc. FileOptions_CODE_SIZE FileOptions_OptimizeMode = 2 // Use ReflectionOps to implement these methods. FileOptions_LITE_RUNTIME FileOptions_OptimizeMode = 3 // Generate code using MessageLite and the lite runtime. ) // Enum value maps for FileOptions_OptimizeMode. var ( FileOptions_OptimizeMode_name = map[int32]string{ 1: "SPEED", 2: "CODE_SIZE", 3: "LITE_RUNTIME", } FileOptions_OptimizeMode_value = map[string]int32{ "SPEED": 1, "CODE_SIZE": 2, "LITE_RUNTIME": 3, } ) func (x FileOptions_OptimizeMode) Enum() *FileOptions_OptimizeMode { p := new(FileOptions_OptimizeMode) *p = x return p } func (x FileOptions_OptimizeMode) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (FileOptions_OptimizeMode) Descriptor() protoreflect.EnumDescriptor { return file_google_protobuf_descriptor_proto_enumTypes[5].Descriptor() } func (FileOptions_OptimizeMode) Type() protoreflect.EnumType { return &file_google_protobuf_descriptor_proto_enumTypes[5] } func (x FileOptions_OptimizeMode) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Do not use. func (x *FileOptions_OptimizeMode) UnmarshalJSON(b []byte) error { num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) if err != nil { return err } *x = FileOptions_OptimizeMode(num) return nil } // Deprecated: Use FileOptions_OptimizeMode.Descriptor instead. func (FileOptions_OptimizeMode) EnumDescriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{10, 0} } type FieldOptions_CType int32 const ( // Default mode. FieldOptions_STRING FieldOptions_CType = 0 // The option [ctype=CORD] may be applied to a non-repeated field of type // "bytes". It indicates that in C++, the data should be stored in a Cord // instead of a string. For very large strings, this may reduce memory // fragmentation. It may also allow better performance when parsing from a // Cord, or when parsing with aliasing enabled, as the parsed Cord may then // alias the original buffer. FieldOptions_CORD FieldOptions_CType = 1 FieldOptions_STRING_PIECE FieldOptions_CType = 2 ) // Enum value maps for FieldOptions_CType. var ( FieldOptions_CType_name = map[int32]string{ 0: "STRING", 1: "CORD", 2: "STRING_PIECE", } FieldOptions_CType_value = map[string]int32{ "STRING": 0, "CORD": 1, "STRING_PIECE": 2, } ) func (x FieldOptions_CType) Enum() *FieldOptions_CType { p := new(FieldOptions_CType) *p = x return p } func (x FieldOptions_CType) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (FieldOptions_CType) Descriptor() protoreflect.EnumDescriptor { return file_google_protobuf_descriptor_proto_enumTypes[6].Descriptor() } func (FieldOptions_CType) Type() protoreflect.EnumType { return &file_google_protobuf_descriptor_proto_enumTypes[6] } func (x FieldOptions_CType) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Do not use. func (x *FieldOptions_CType) UnmarshalJSON(b []byte) error { num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) if err != nil { return err } *x = FieldOptions_CType(num) return nil } // Deprecated: Use FieldOptions_CType.Descriptor instead. func (FieldOptions_CType) EnumDescriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{12, 0} } type FieldOptions_JSType int32 const ( // Use the default type. FieldOptions_JS_NORMAL FieldOptions_JSType = 0 // Use JavaScript strings. FieldOptions_JS_STRING FieldOptions_JSType = 1 // Use JavaScript numbers. FieldOptions_JS_NUMBER FieldOptions_JSType = 2 ) // Enum value maps for FieldOptions_JSType. var ( FieldOptions_JSType_name = map[int32]string{ 0: "JS_NORMAL", 1: "JS_STRING", 2: "JS_NUMBER", } FieldOptions_JSType_value = map[string]int32{ "JS_NORMAL": 0, "JS_STRING": 1, "JS_NUMBER": 2, } ) func (x FieldOptions_JSType) Enum() *FieldOptions_JSType { p := new(FieldOptions_JSType) *p = x return p } func (x FieldOptions_JSType) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (FieldOptions_JSType) Descriptor() protoreflect.EnumDescriptor { return file_google_protobuf_descriptor_proto_enumTypes[7].Descriptor() } func (FieldOptions_JSType) Type() protoreflect.EnumType { return &file_google_protobuf_descriptor_proto_enumTypes[7] } func (x FieldOptions_JSType) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Do not use. func (x *FieldOptions_JSType) UnmarshalJSON(b []byte) error { num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) if err != nil { return err } *x = FieldOptions_JSType(num) return nil } // Deprecated: Use FieldOptions_JSType.Descriptor instead. func (FieldOptions_JSType) EnumDescriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{12, 1} } // If set to RETENTION_SOURCE, the option will be omitted from the binary. type FieldOptions_OptionRetention int32 const ( FieldOptions_RETENTION_UNKNOWN FieldOptions_OptionRetention = 0 FieldOptions_RETENTION_RUNTIME FieldOptions_OptionRetention = 1 FieldOptions_RETENTION_SOURCE FieldOptions_OptionRetention = 2 ) // Enum value maps for FieldOptions_OptionRetention. var ( FieldOptions_OptionRetention_name = map[int32]string{ 0: "RETENTION_UNKNOWN", 1: "RETENTION_RUNTIME", 2: "RETENTION_SOURCE", } FieldOptions_OptionRetention_value = map[string]int32{ "RETENTION_UNKNOWN": 0, "RETENTION_RUNTIME": 1, "RETENTION_SOURCE": 2, } ) func (x FieldOptions_OptionRetention) Enum() *FieldOptions_OptionRetention { p := new(FieldOptions_OptionRetention) *p = x return p } func (x FieldOptions_OptionRetention) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (FieldOptions_OptionRetention) Descriptor() protoreflect.EnumDescriptor { return file_google_protobuf_descriptor_proto_enumTypes[8].Descriptor() } func (FieldOptions_OptionRetention) Type() protoreflect.EnumType { return &file_google_protobuf_descriptor_proto_enumTypes[8] } func (x FieldOptions_OptionRetention) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Do not use. func (x *FieldOptions_OptionRetention) UnmarshalJSON(b []byte) error { num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) if err != nil { return err } *x = FieldOptions_OptionRetention(num) return nil } // Deprecated: Use FieldOptions_OptionRetention.Descriptor instead. func (FieldOptions_OptionRetention) EnumDescriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{12, 2} } // This indicates the types of entities that the field may apply to when used // as an option. If it is unset, then the field may be freely used as an // option on any kind of entity. type FieldOptions_OptionTargetType int32 const ( FieldOptions_TARGET_TYPE_UNKNOWN FieldOptions_OptionTargetType = 0 FieldOptions_TARGET_TYPE_FILE FieldOptions_OptionTargetType = 1 FieldOptions_TARGET_TYPE_EXTENSION_RANGE FieldOptions_OptionTargetType = 2 FieldOptions_TARGET_TYPE_MESSAGE FieldOptions_OptionTargetType = 3 FieldOptions_TARGET_TYPE_FIELD FieldOptions_OptionTargetType = 4 FieldOptions_TARGET_TYPE_ONEOF FieldOptions_OptionTargetType = 5 FieldOptions_TARGET_TYPE_ENUM FieldOptions_OptionTargetType = 6 FieldOptions_TARGET_TYPE_ENUM_ENTRY FieldOptions_OptionTargetType = 7 FieldOptions_TARGET_TYPE_SERVICE FieldOptions_OptionTargetType = 8 FieldOptions_TARGET_TYPE_METHOD FieldOptions_OptionTargetType = 9 ) // Enum value maps for FieldOptions_OptionTargetType. var ( FieldOptions_OptionTargetType_name = map[int32]string{ 0: "TARGET_TYPE_UNKNOWN", 1: "TARGET_TYPE_FILE", 2: "TARGET_TYPE_EXTENSION_RANGE", 3: "TARGET_TYPE_MESSAGE", 4: "TARGET_TYPE_FIELD", 5: "TARGET_TYPE_ONEOF", 6: "TARGET_TYPE_ENUM", 7: "TARGET_TYPE_ENUM_ENTRY", 8: "TARGET_TYPE_SERVICE", 9: "TARGET_TYPE_METHOD", } FieldOptions_OptionTargetType_value = map[string]int32{ "TARGET_TYPE_UNKNOWN": 0, "TARGET_TYPE_FILE": 1, "TARGET_TYPE_EXTENSION_RANGE": 2, "TARGET_TYPE_MESSAGE": 3, "TARGET_TYPE_FIELD": 4, "TARGET_TYPE_ONEOF": 5, "TARGET_TYPE_ENUM": 6, "TARGET_TYPE_ENUM_ENTRY": 7, "TARGET_TYPE_SERVICE": 8, "TARGET_TYPE_METHOD": 9, } ) func (x FieldOptions_OptionTargetType) Enum() *FieldOptions_OptionTargetType { p := new(FieldOptions_OptionTargetType) *p = x return p } func (x FieldOptions_OptionTargetType) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (FieldOptions_OptionTargetType) Descriptor() protoreflect.EnumDescriptor { return file_google_protobuf_descriptor_proto_enumTypes[9].Descriptor() } func (FieldOptions_OptionTargetType) Type() protoreflect.EnumType { return &file_google_protobuf_descriptor_proto_enumTypes[9] } func (x FieldOptions_OptionTargetType) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Do not use. func (x *FieldOptions_OptionTargetType) UnmarshalJSON(b []byte) error { num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) if err != nil { return err } *x = FieldOptions_OptionTargetType(num) return nil } // Deprecated: Use FieldOptions_OptionTargetType.Descriptor instead. func (FieldOptions_OptionTargetType) EnumDescriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{12, 3} } // Is this method side-effect-free (or safe in HTTP parlance), or idempotent, // or neither? HTTP based RPC implementation may choose GET verb for safe // methods, and PUT verb for idempotent methods instead of the default POST. type MethodOptions_IdempotencyLevel int32 const ( MethodOptions_IDEMPOTENCY_UNKNOWN MethodOptions_IdempotencyLevel = 0 MethodOptions_NO_SIDE_EFFECTS MethodOptions_IdempotencyLevel = 1 // implies idempotent MethodOptions_IDEMPOTENT MethodOptions_IdempotencyLevel = 2 // idempotent, but may have side effects ) // Enum value maps for MethodOptions_IdempotencyLevel. var ( MethodOptions_IdempotencyLevel_name = map[int32]string{ 0: "IDEMPOTENCY_UNKNOWN", 1: "NO_SIDE_EFFECTS", 2: "IDEMPOTENT", } MethodOptions_IdempotencyLevel_value = map[string]int32{ "IDEMPOTENCY_UNKNOWN": 0, "NO_SIDE_EFFECTS": 1, "IDEMPOTENT": 2, } ) func (x MethodOptions_IdempotencyLevel) Enum() *MethodOptions_IdempotencyLevel { p := new(MethodOptions_IdempotencyLevel) *p = x return p } func (x MethodOptions_IdempotencyLevel) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (MethodOptions_IdempotencyLevel) Descriptor() protoreflect.EnumDescriptor { return file_google_protobuf_descriptor_proto_enumTypes[10].Descriptor() } func (MethodOptions_IdempotencyLevel) Type() protoreflect.EnumType { return &file_google_protobuf_descriptor_proto_enumTypes[10] } func (x MethodOptions_IdempotencyLevel) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Do not use. func (x *MethodOptions_IdempotencyLevel) UnmarshalJSON(b []byte) error { num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) if err != nil { return err } *x = MethodOptions_IdempotencyLevel(num) return nil } // Deprecated: Use MethodOptions_IdempotencyLevel.Descriptor instead. func (MethodOptions_IdempotencyLevel) EnumDescriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{17, 0} } type FeatureSet_FieldPresence int32 const ( FeatureSet_FIELD_PRESENCE_UNKNOWN FeatureSet_FieldPresence = 0 FeatureSet_EXPLICIT FeatureSet_FieldPresence = 1 FeatureSet_IMPLICIT FeatureSet_FieldPresence = 2 FeatureSet_LEGACY_REQUIRED FeatureSet_FieldPresence = 3 ) // Enum value maps for FeatureSet_FieldPresence. var ( FeatureSet_FieldPresence_name = map[int32]string{ 0: "FIELD_PRESENCE_UNKNOWN", 1: "EXPLICIT", 2: "IMPLICIT", 3: "LEGACY_REQUIRED", } FeatureSet_FieldPresence_value = map[string]int32{ "FIELD_PRESENCE_UNKNOWN": 0, "EXPLICIT": 1, "IMPLICIT": 2, "LEGACY_REQUIRED": 3, } ) func (x FeatureSet_FieldPresence) Enum() *FeatureSet_FieldPresence { p := new(FeatureSet_FieldPresence) *p = x return p } func (x FeatureSet_FieldPresence) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (FeatureSet_FieldPresence) Descriptor() protoreflect.EnumDescriptor { return file_google_protobuf_descriptor_proto_enumTypes[11].Descriptor() } func (FeatureSet_FieldPresence) Type() protoreflect.EnumType { return &file_google_protobuf_descriptor_proto_enumTypes[11] } func (x FeatureSet_FieldPresence) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Do not use. func (x *FeatureSet_FieldPresence) UnmarshalJSON(b []byte) error { num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) if err != nil { return err } *x = FeatureSet_FieldPresence(num) return nil } // Deprecated: Use FeatureSet_FieldPresence.Descriptor instead. func (FeatureSet_FieldPresence) EnumDescriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{19, 0} } type FeatureSet_EnumType int32 const ( FeatureSet_ENUM_TYPE_UNKNOWN FeatureSet_EnumType = 0 FeatureSet_OPEN FeatureSet_EnumType = 1 FeatureSet_CLOSED FeatureSet_EnumType = 2 ) // Enum value maps for FeatureSet_EnumType. var ( FeatureSet_EnumType_name = map[int32]string{ 0: "ENUM_TYPE_UNKNOWN", 1: "OPEN", 2: "CLOSED", } FeatureSet_EnumType_value = map[string]int32{ "ENUM_TYPE_UNKNOWN": 0, "OPEN": 1, "CLOSED": 2, } ) func (x FeatureSet_EnumType) Enum() *FeatureSet_EnumType { p := new(FeatureSet_EnumType) *p = x return p } func (x FeatureSet_EnumType) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (FeatureSet_EnumType) Descriptor() protoreflect.EnumDescriptor { return file_google_protobuf_descriptor_proto_enumTypes[12].Descriptor() } func (FeatureSet_EnumType) Type() protoreflect.EnumType { return &file_google_protobuf_descriptor_proto_enumTypes[12] } func (x FeatureSet_EnumType) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Do not use. func (x *FeatureSet_EnumType) UnmarshalJSON(b []byte) error { num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) if err != nil { return err } *x = FeatureSet_EnumType(num) return nil } // Deprecated: Use FeatureSet_EnumType.Descriptor instead. func (FeatureSet_EnumType) EnumDescriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{19, 1} } type FeatureSet_RepeatedFieldEncoding int32 const ( FeatureSet_REPEATED_FIELD_ENCODING_UNKNOWN FeatureSet_RepeatedFieldEncoding = 0 FeatureSet_PACKED FeatureSet_RepeatedFieldEncoding = 1 FeatureSet_EXPANDED FeatureSet_RepeatedFieldEncoding = 2 ) // Enum value maps for FeatureSet_RepeatedFieldEncoding. var ( FeatureSet_RepeatedFieldEncoding_name = map[int32]string{ 0: "REPEATED_FIELD_ENCODING_UNKNOWN", 1: "PACKED", 2: "EXPANDED", } FeatureSet_RepeatedFieldEncoding_value = map[string]int32{ "REPEATED_FIELD_ENCODING_UNKNOWN": 0, "PACKED": 1, "EXPANDED": 2, } ) func (x FeatureSet_RepeatedFieldEncoding) Enum() *FeatureSet_RepeatedFieldEncoding { p := new(FeatureSet_RepeatedFieldEncoding) *p = x return p } func (x FeatureSet_RepeatedFieldEncoding) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (FeatureSet_RepeatedFieldEncoding) Descriptor() protoreflect.EnumDescriptor { return file_google_protobuf_descriptor_proto_enumTypes[13].Descriptor() } func (FeatureSet_RepeatedFieldEncoding) Type() protoreflect.EnumType { return &file_google_protobuf_descriptor_proto_enumTypes[13] } func (x FeatureSet_RepeatedFieldEncoding) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Do not use. func (x *FeatureSet_RepeatedFieldEncoding) UnmarshalJSON(b []byte) error { num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) if err != nil { return err } *x = FeatureSet_RepeatedFieldEncoding(num) return nil } // Deprecated: Use FeatureSet_RepeatedFieldEncoding.Descriptor instead. func (FeatureSet_RepeatedFieldEncoding) EnumDescriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{19, 2} } type FeatureSet_Utf8Validation int32 const ( FeatureSet_UTF8_VALIDATION_UNKNOWN FeatureSet_Utf8Validation = 0 FeatureSet_VERIFY FeatureSet_Utf8Validation = 2 FeatureSet_NONE FeatureSet_Utf8Validation = 3 ) // Enum value maps for FeatureSet_Utf8Validation. var ( FeatureSet_Utf8Validation_name = map[int32]string{ 0: "UTF8_VALIDATION_UNKNOWN", 2: "VERIFY", 3: "NONE", } FeatureSet_Utf8Validation_value = map[string]int32{ "UTF8_VALIDATION_UNKNOWN": 0, "VERIFY": 2, "NONE": 3, } ) func (x FeatureSet_Utf8Validation) Enum() *FeatureSet_Utf8Validation { p := new(FeatureSet_Utf8Validation) *p = x return p } func (x FeatureSet_Utf8Validation) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (FeatureSet_Utf8Validation) Descriptor() protoreflect.EnumDescriptor { return file_google_protobuf_descriptor_proto_enumTypes[14].Descriptor() } func (FeatureSet_Utf8Validation) Type() protoreflect.EnumType { return &file_google_protobuf_descriptor_proto_enumTypes[14] } func (x FeatureSet_Utf8Validation) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Do not use. func (x *FeatureSet_Utf8Validation) UnmarshalJSON(b []byte) error { num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) if err != nil { return err } *x = FeatureSet_Utf8Validation(num) return nil } // Deprecated: Use FeatureSet_Utf8Validation.Descriptor instead. func (FeatureSet_Utf8Validation) EnumDescriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{19, 3} } type FeatureSet_MessageEncoding int32 const ( FeatureSet_MESSAGE_ENCODING_UNKNOWN FeatureSet_MessageEncoding = 0 FeatureSet_LENGTH_PREFIXED FeatureSet_MessageEncoding = 1 FeatureSet_DELIMITED FeatureSet_MessageEncoding = 2 ) // Enum value maps for FeatureSet_MessageEncoding. var ( FeatureSet_MessageEncoding_name = map[int32]string{ 0: "MESSAGE_ENCODING_UNKNOWN", 1: "LENGTH_PREFIXED", 2: "DELIMITED", } FeatureSet_MessageEncoding_value = map[string]int32{ "MESSAGE_ENCODING_UNKNOWN": 0, "LENGTH_PREFIXED": 1, "DELIMITED": 2, } ) func (x FeatureSet_MessageEncoding) Enum() *FeatureSet_MessageEncoding { p := new(FeatureSet_MessageEncoding) *p = x return p } func (x FeatureSet_MessageEncoding) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (FeatureSet_MessageEncoding) Descriptor() protoreflect.EnumDescriptor { return file_google_protobuf_descriptor_proto_enumTypes[15].Descriptor() } func (FeatureSet_MessageEncoding) Type() protoreflect.EnumType { return &file_google_protobuf_descriptor_proto_enumTypes[15] } func (x FeatureSet_MessageEncoding) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Do not use. func (x *FeatureSet_MessageEncoding) UnmarshalJSON(b []byte) error { num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) if err != nil { return err } *x = FeatureSet_MessageEncoding(num) return nil } // Deprecated: Use FeatureSet_MessageEncoding.Descriptor instead. func (FeatureSet_MessageEncoding) EnumDescriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{19, 4} } type FeatureSet_JsonFormat int32 const ( FeatureSet_JSON_FORMAT_UNKNOWN FeatureSet_JsonFormat = 0 FeatureSet_ALLOW FeatureSet_JsonFormat = 1 FeatureSet_LEGACY_BEST_EFFORT FeatureSet_JsonFormat = 2 ) // Enum value maps for FeatureSet_JsonFormat. var ( FeatureSet_JsonFormat_name = map[int32]string{ 0: "JSON_FORMAT_UNKNOWN", 1: "ALLOW", 2: "LEGACY_BEST_EFFORT", } FeatureSet_JsonFormat_value = map[string]int32{ "JSON_FORMAT_UNKNOWN": 0, "ALLOW": 1, "LEGACY_BEST_EFFORT": 2, } ) func (x FeatureSet_JsonFormat) Enum() *FeatureSet_JsonFormat { p := new(FeatureSet_JsonFormat) *p = x return p } func (x FeatureSet_JsonFormat) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (FeatureSet_JsonFormat) Descriptor() protoreflect.EnumDescriptor { return file_google_protobuf_descriptor_proto_enumTypes[16].Descriptor() } func (FeatureSet_JsonFormat) Type() protoreflect.EnumType { return &file_google_protobuf_descriptor_proto_enumTypes[16] } func (x FeatureSet_JsonFormat) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Do not use. func (x *FeatureSet_JsonFormat) UnmarshalJSON(b []byte) error { num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) if err != nil { return err } *x = FeatureSet_JsonFormat(num) return nil } // Deprecated: Use FeatureSet_JsonFormat.Descriptor instead. func (FeatureSet_JsonFormat) EnumDescriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{19, 5} } type FeatureSet_EnforceNamingStyle int32 const ( FeatureSet_ENFORCE_NAMING_STYLE_UNKNOWN FeatureSet_EnforceNamingStyle = 0 FeatureSet_STYLE2024 FeatureSet_EnforceNamingStyle = 1 FeatureSet_STYLE_LEGACY FeatureSet_EnforceNamingStyle = 2 ) // Enum value maps for FeatureSet_EnforceNamingStyle. var ( FeatureSet_EnforceNamingStyle_name = map[int32]string{ 0: "ENFORCE_NAMING_STYLE_UNKNOWN", 1: "STYLE2024", 2: "STYLE_LEGACY", } FeatureSet_EnforceNamingStyle_value = map[string]int32{ "ENFORCE_NAMING_STYLE_UNKNOWN": 0, "STYLE2024": 1, "STYLE_LEGACY": 2, } ) func (x FeatureSet_EnforceNamingStyle) Enum() *FeatureSet_EnforceNamingStyle { p := new(FeatureSet_EnforceNamingStyle) *p = x return p } func (x FeatureSet_EnforceNamingStyle) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (FeatureSet_EnforceNamingStyle) Descriptor() protoreflect.EnumDescriptor { return file_google_protobuf_descriptor_proto_enumTypes[17].Descriptor() } func (FeatureSet_EnforceNamingStyle) Type() protoreflect.EnumType { return &file_google_protobuf_descriptor_proto_enumTypes[17] } func (x FeatureSet_EnforceNamingStyle) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Do not use. func (x *FeatureSet_EnforceNamingStyle) UnmarshalJSON(b []byte) error { num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) if err != nil { return err } *x = FeatureSet_EnforceNamingStyle(num) return nil } // Deprecated: Use FeatureSet_EnforceNamingStyle.Descriptor instead. func (FeatureSet_EnforceNamingStyle) EnumDescriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{19, 6} } type FeatureSet_VisibilityFeature_DefaultSymbolVisibility int32 const ( FeatureSet_VisibilityFeature_DEFAULT_SYMBOL_VISIBILITY_UNKNOWN FeatureSet_VisibilityFeature_DefaultSymbolVisibility = 0 // Default pre-EDITION_2024, all UNSET visibility are export. FeatureSet_VisibilityFeature_EXPORT_ALL FeatureSet_VisibilityFeature_DefaultSymbolVisibility = 1 // All top-level symbols default to export, nested default to local. FeatureSet_VisibilityFeature_EXPORT_TOP_LEVEL FeatureSet_VisibilityFeature_DefaultSymbolVisibility = 2 // All symbols default to local. FeatureSet_VisibilityFeature_LOCAL_ALL FeatureSet_VisibilityFeature_DefaultSymbolVisibility = 3 // All symbols local by default. Nested types cannot be exported. // With special case caveat for message { enum {} reserved 1 to max; } // This is the recommended setting for new protos. FeatureSet_VisibilityFeature_STRICT FeatureSet_VisibilityFeature_DefaultSymbolVisibility = 4 ) // Enum value maps for FeatureSet_VisibilityFeature_DefaultSymbolVisibility. var ( FeatureSet_VisibilityFeature_DefaultSymbolVisibility_name = map[int32]string{ 0: "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN", 1: "EXPORT_ALL", 2: "EXPORT_TOP_LEVEL", 3: "LOCAL_ALL", 4: "STRICT", } FeatureSet_VisibilityFeature_DefaultSymbolVisibility_value = map[string]int32{ "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": 0, "EXPORT_ALL": 1, "EXPORT_TOP_LEVEL": 2, "LOCAL_ALL": 3, "STRICT": 4, } ) func (x FeatureSet_VisibilityFeature_DefaultSymbolVisibility) Enum() *FeatureSet_VisibilityFeature_DefaultSymbolVisibility { p := new(FeatureSet_VisibilityFeature_DefaultSymbolVisibility) *p = x return p } func (x FeatureSet_VisibilityFeature_DefaultSymbolVisibility) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (FeatureSet_VisibilityFeature_DefaultSymbolVisibility) Descriptor() protoreflect.EnumDescriptor { return file_google_protobuf_descriptor_proto_enumTypes[18].Descriptor() } func (FeatureSet_VisibilityFeature_DefaultSymbolVisibility) Type() protoreflect.EnumType { return &file_google_protobuf_descriptor_proto_enumTypes[18] } func (x FeatureSet_VisibilityFeature_DefaultSymbolVisibility) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Do not use. func (x *FeatureSet_VisibilityFeature_DefaultSymbolVisibility) UnmarshalJSON(b []byte) error { num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) if err != nil { return err } *x = FeatureSet_VisibilityFeature_DefaultSymbolVisibility(num) return nil } // Deprecated: Use FeatureSet_VisibilityFeature_DefaultSymbolVisibility.Descriptor instead. func (FeatureSet_VisibilityFeature_DefaultSymbolVisibility) EnumDescriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{19, 0, 0} } // Represents the identified object's effect on the element in the original // .proto file. type GeneratedCodeInfo_Annotation_Semantic int32 const ( // There is no effect or the effect is indescribable. GeneratedCodeInfo_Annotation_NONE GeneratedCodeInfo_Annotation_Semantic = 0 // The element is set or otherwise mutated. GeneratedCodeInfo_Annotation_SET GeneratedCodeInfo_Annotation_Semantic = 1 // An alias to the element is returned. GeneratedCodeInfo_Annotation_ALIAS GeneratedCodeInfo_Annotation_Semantic = 2 ) // Enum value maps for GeneratedCodeInfo_Annotation_Semantic. var ( GeneratedCodeInfo_Annotation_Semantic_name = map[int32]string{ 0: "NONE", 1: "SET", 2: "ALIAS", } GeneratedCodeInfo_Annotation_Semantic_value = map[string]int32{ "NONE": 0, "SET": 1, "ALIAS": 2, } ) func (x GeneratedCodeInfo_Annotation_Semantic) Enum() *GeneratedCodeInfo_Annotation_Semantic { p := new(GeneratedCodeInfo_Annotation_Semantic) *p = x return p } func (x GeneratedCodeInfo_Annotation_Semantic) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (GeneratedCodeInfo_Annotation_Semantic) Descriptor() protoreflect.EnumDescriptor { return file_google_protobuf_descriptor_proto_enumTypes[19].Descriptor() } func (GeneratedCodeInfo_Annotation_Semantic) Type() protoreflect.EnumType { return &file_google_protobuf_descriptor_proto_enumTypes[19] } func (x GeneratedCodeInfo_Annotation_Semantic) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Do not use. func (x *GeneratedCodeInfo_Annotation_Semantic) UnmarshalJSON(b []byte) error { num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) if err != nil { return err } *x = GeneratedCodeInfo_Annotation_Semantic(num) return nil } // Deprecated: Use GeneratedCodeInfo_Annotation_Semantic.Descriptor instead. func (GeneratedCodeInfo_Annotation_Semantic) EnumDescriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{22, 0, 0} } // The protocol compiler can output a FileDescriptorSet containing the .proto // files it parses. type FileDescriptorSet struct { state protoimpl.MessageState `protogen:"open.v1"` File []*FileDescriptorProto `protobuf:"bytes,1,rep,name=file" json:"file,omitempty"` extensionFields protoimpl.ExtensionFields unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *FileDescriptorSet) Reset() { *x = FileDescriptorSet{} mi := &file_google_protobuf_descriptor_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *FileDescriptorSet) String() string { return protoimpl.X.MessageStringOf(x) } func (*FileDescriptorSet) ProtoMessage() {} func (x *FileDescriptorSet) ProtoReflect() protoreflect.Message { mi := &file_google_protobuf_descriptor_proto_msgTypes[0] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use FileDescriptorSet.ProtoReflect.Descriptor instead. func (*FileDescriptorSet) Descriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{0} } func (x *FileDescriptorSet) GetFile() []*FileDescriptorProto { if x != nil { return x.File } return nil } // Describes a complete .proto file. type FileDescriptorProto struct { state protoimpl.MessageState `protogen:"open.v1"` Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` // file name, relative to root of source tree Package *string `protobuf:"bytes,2,opt,name=package" json:"package,omitempty"` // e.g. "foo", "foo.bar", etc. // Names of files imported by this file. Dependency []string `protobuf:"bytes,3,rep,name=dependency" json:"dependency,omitempty"` // Indexes of the public imported files in the dependency list above. PublicDependency []int32 `protobuf:"varint,10,rep,name=public_dependency,json=publicDependency" json:"public_dependency,omitempty"` // Indexes of the weak imported files in the dependency list. // For Google-internal migration only. Do not use. WeakDependency []int32 `protobuf:"varint,11,rep,name=weak_dependency,json=weakDependency" json:"weak_dependency,omitempty"` // Names of files imported by this file purely for the purpose of providing // option extensions. These are excluded from the dependency list above. OptionDependency []string `protobuf:"bytes,15,rep,name=option_dependency,json=optionDependency" json:"option_dependency,omitempty"` // All top-level definitions in this file. MessageType []*DescriptorProto `protobuf:"bytes,4,rep,name=message_type,json=messageType" json:"message_type,omitempty"` EnumType []*EnumDescriptorProto `protobuf:"bytes,5,rep,name=enum_type,json=enumType" json:"enum_type,omitempty"` Service []*ServiceDescriptorProto `protobuf:"bytes,6,rep,name=service" json:"service,omitempty"` Extension []*FieldDescriptorProto `protobuf:"bytes,7,rep,name=extension" json:"extension,omitempty"` Options *FileOptions `protobuf:"bytes,8,opt,name=options" json:"options,omitempty"` // This field contains optional information about the original source code. // You may safely remove this entire field without harming runtime // functionality of the descriptors -- the information is needed only by // development tools. SourceCodeInfo *SourceCodeInfo `protobuf:"bytes,9,opt,name=source_code_info,json=sourceCodeInfo" json:"source_code_info,omitempty"` // The syntax of the proto file. // The supported values are "proto2", "proto3", and "editions". // // If `edition` is present, this value must be "editions". // WARNING: This field should only be used by protobuf plugins or special // cases like the proto compiler. Other uses are discouraged and // developers should rely on the protoreflect APIs for their client language. Syntax *string `protobuf:"bytes,12,opt,name=syntax" json:"syntax,omitempty"` // The edition of the proto file. // WARNING: This field should only be used by protobuf plugins or special // cases like the proto compiler. Other uses are discouraged and // developers should rely on the protoreflect APIs for their client language. Edition *Edition `protobuf:"varint,14,opt,name=edition,enum=google.protobuf.Edition" json:"edition,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *FileDescriptorProto) Reset() { *x = FileDescriptorProto{} mi := &file_google_protobuf_descriptor_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *FileDescriptorProto) String() string { return protoimpl.X.MessageStringOf(x) } func (*FileDescriptorProto) ProtoMessage() {} func (x *FileDescriptorProto) ProtoReflect() protoreflect.Message { mi := &file_google_protobuf_descriptor_proto_msgTypes[1] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use FileDescriptorProto.ProtoReflect.Descriptor instead. func (*FileDescriptorProto) Descriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{1} } func (x *FileDescriptorProto) GetName() string { if x != nil && x.Name != nil { return *x.Name } return "" } func (x *FileDescriptorProto) GetPackage() string { if x != nil && x.Package != nil { return *x.Package } return "" } func (x *FileDescriptorProto) GetDependency() []string { if x != nil { return x.Dependency } return nil } func (x *FileDescriptorProto) GetPublicDependency() []int32 { if x != nil { return x.PublicDependency } return nil } func (x *FileDescriptorProto) GetWeakDependency() []int32 { if x != nil { return x.WeakDependency } return nil } func (x *FileDescriptorProto) GetOptionDependency() []string { if x != nil { return x.OptionDependency } return nil } func (x *FileDescriptorProto) GetMessageType() []*DescriptorProto { if x != nil { return x.MessageType } return nil } func (x *FileDescriptorProto) GetEnumType() []*EnumDescriptorProto { if x != nil { return x.EnumType } return nil } func (x *FileDescriptorProto) GetService() []*ServiceDescriptorProto { if x != nil { return x.Service } return nil } func (x *FileDescriptorProto) GetExtension() []*FieldDescriptorProto { if x != nil { return x.Extension } return nil } func (x *FileDescriptorProto) GetOptions() *FileOptions { if x != nil { return x.Options } return nil } func (x *FileDescriptorProto) GetSourceCodeInfo() *SourceCodeInfo { if x != nil { return x.SourceCodeInfo } return nil } func (x *FileDescriptorProto) GetSyntax() string { if x != nil && x.Syntax != nil { return *x.Syntax } return "" } func (x *FileDescriptorProto) GetEdition() Edition { if x != nil && x.Edition != nil { return *x.Edition } return Edition_EDITION_UNKNOWN } // Describes a message type. type DescriptorProto struct { state protoimpl.MessageState `protogen:"open.v1"` Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` Field []*FieldDescriptorProto `protobuf:"bytes,2,rep,name=field" json:"field,omitempty"` Extension []*FieldDescriptorProto `protobuf:"bytes,6,rep,name=extension" json:"extension,omitempty"` NestedType []*DescriptorProto `protobuf:"bytes,3,rep,name=nested_type,json=nestedType" json:"nested_type,omitempty"` EnumType []*EnumDescriptorProto `protobuf:"bytes,4,rep,name=enum_type,json=enumType" json:"enum_type,omitempty"` ExtensionRange []*DescriptorProto_ExtensionRange `protobuf:"bytes,5,rep,name=extension_range,json=extensionRange" json:"extension_range,omitempty"` OneofDecl []*OneofDescriptorProto `protobuf:"bytes,8,rep,name=oneof_decl,json=oneofDecl" json:"oneof_decl,omitempty"` Options *MessageOptions `protobuf:"bytes,7,opt,name=options" json:"options,omitempty"` ReservedRange []*DescriptorProto_ReservedRange `protobuf:"bytes,9,rep,name=reserved_range,json=reservedRange" json:"reserved_range,omitempty"` // Reserved field names, which may not be used by fields in the same message. // A given name may only be reserved once. ReservedName []string `protobuf:"bytes,10,rep,name=reserved_name,json=reservedName" json:"reserved_name,omitempty"` // Support for `export` and `local` keywords on enums. Visibility *SymbolVisibility `protobuf:"varint,11,opt,name=visibility,enum=google.protobuf.SymbolVisibility" json:"visibility,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *DescriptorProto) Reset() { *x = DescriptorProto{} mi := &file_google_protobuf_descriptor_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *DescriptorProto) String() string { return protoimpl.X.MessageStringOf(x) } func (*DescriptorProto) ProtoMessage() {} func (x *DescriptorProto) ProtoReflect() protoreflect.Message { mi := &file_google_protobuf_descriptor_proto_msgTypes[2] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use DescriptorProto.ProtoReflect.Descriptor instead. func (*DescriptorProto) Descriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{2} } func (x *DescriptorProto) GetName() string { if x != nil && x.Name != nil { return *x.Name } return "" } func (x *DescriptorProto) GetField() []*FieldDescriptorProto { if x != nil { return x.Field } return nil } func (x *DescriptorProto) GetExtension() []*FieldDescriptorProto { if x != nil { return x.Extension } return nil } func (x *DescriptorProto) GetNestedType() []*DescriptorProto { if x != nil { return x.NestedType } return nil } func (x *DescriptorProto) GetEnumType() []*EnumDescriptorProto { if x != nil { return x.EnumType } return nil } func (x *DescriptorProto) GetExtensionRange() []*DescriptorProto_ExtensionRange { if x != nil { return x.ExtensionRange } return nil } func (x *DescriptorProto) GetOneofDecl() []*OneofDescriptorProto { if x != nil { return x.OneofDecl } return nil } func (x *DescriptorProto) GetOptions() *MessageOptions { if x != nil { return x.Options } return nil } func (x *DescriptorProto) GetReservedRange() []*DescriptorProto_ReservedRange { if x != nil { return x.ReservedRange } return nil } func (x *DescriptorProto) GetReservedName() []string { if x != nil { return x.ReservedName } return nil } func (x *DescriptorProto) GetVisibility() SymbolVisibility { if x != nil && x.Visibility != nil { return *x.Visibility } return SymbolVisibility_VISIBILITY_UNSET } type ExtensionRangeOptions struct { state protoimpl.MessageState `protogen:"open.v1"` // The parser stores options it doesn't recognize here. See above. UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` // For external users: DO NOT USE. We are in the process of open sourcing // extension declaration and executing internal cleanups before it can be // used externally. Declaration []*ExtensionRangeOptions_Declaration `protobuf:"bytes,2,rep,name=declaration" json:"declaration,omitempty"` // Any features defined in the specific edition. Features *FeatureSet `protobuf:"bytes,50,opt,name=features" json:"features,omitempty"` // The verification state of the range. // TODO: flip the default to DECLARATION once all empty ranges // are marked as UNVERIFIED. Verification *ExtensionRangeOptions_VerificationState `protobuf:"varint,3,opt,name=verification,enum=google.protobuf.ExtensionRangeOptions_VerificationState,def=1" json:"verification,omitempty"` extensionFields protoimpl.ExtensionFields unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } // Default values for ExtensionRangeOptions fields. const ( Default_ExtensionRangeOptions_Verification = ExtensionRangeOptions_UNVERIFIED ) func (x *ExtensionRangeOptions) Reset() { *x = ExtensionRangeOptions{} mi := &file_google_protobuf_descriptor_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *ExtensionRangeOptions) String() string { return protoimpl.X.MessageStringOf(x) } func (*ExtensionRangeOptions) ProtoMessage() {} func (x *ExtensionRangeOptions) ProtoReflect() protoreflect.Message { mi := &file_google_protobuf_descriptor_proto_msgTypes[3] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use ExtensionRangeOptions.ProtoReflect.Descriptor instead. func (*ExtensionRangeOptions) Descriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{3} } func (x *ExtensionRangeOptions) GetUninterpretedOption() []*UninterpretedOption { if x != nil { return x.UninterpretedOption } return nil } func (x *ExtensionRangeOptions) GetDeclaration() []*ExtensionRangeOptions_Declaration { if x != nil { return x.Declaration } return nil } func (x *ExtensionRangeOptions) GetFeatures() *FeatureSet { if x != nil { return x.Features } return nil } func (x *ExtensionRangeOptions) GetVerification() ExtensionRangeOptions_VerificationState { if x != nil && x.Verification != nil { return *x.Verification } return Default_ExtensionRangeOptions_Verification } // Describes a field within a message. type FieldDescriptorProto struct { state protoimpl.MessageState `protogen:"open.v1"` Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` Number *int32 `protobuf:"varint,3,opt,name=number" json:"number,omitempty"` Label *FieldDescriptorProto_Label `protobuf:"varint,4,opt,name=label,enum=google.protobuf.FieldDescriptorProto_Label" json:"label,omitempty"` // If type_name is set, this need not be set. If both this and type_name // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. Type *FieldDescriptorProto_Type `protobuf:"varint,5,opt,name=type,enum=google.protobuf.FieldDescriptorProto_Type" json:"type,omitempty"` // For message and enum types, this is the name of the type. If the name // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping // rules are used to find the type (i.e. first the nested types within this // message are searched, then within the parent, on up to the root // namespace). TypeName *string `protobuf:"bytes,6,opt,name=type_name,json=typeName" json:"type_name,omitempty"` // For extensions, this is the name of the type being extended. It is // resolved in the same manner as type_name. Extendee *string `protobuf:"bytes,2,opt,name=extendee" json:"extendee,omitempty"` // For numeric types, contains the original text representation of the value. // For booleans, "true" or "false". // For strings, contains the default text contents (not escaped in any way). // For bytes, contains the C escaped value. All bytes >= 128 are escaped. DefaultValue *string `protobuf:"bytes,7,opt,name=default_value,json=defaultValue" json:"default_value,omitempty"` // If set, gives the index of a oneof in the containing type's oneof_decl // list. This field is a member of that oneof. OneofIndex *int32 `protobuf:"varint,9,opt,name=oneof_index,json=oneofIndex" json:"oneof_index,omitempty"` // JSON name of this field. The value is set by protocol compiler. If the // user has set a "json_name" option on this field, that option's value // will be used. Otherwise, it's deduced from the field's name by converting // it to camelCase. JsonName *string `protobuf:"bytes,10,opt,name=json_name,json=jsonName" json:"json_name,omitempty"` Options *FieldOptions `protobuf:"bytes,8,opt,name=options" json:"options,omitempty"` // If true, this is a proto3 "optional". When a proto3 field is optional, it // tracks presence regardless of field type. // // When proto3_optional is true, this field must belong to a oneof to signal // to old proto3 clients that presence is tracked for this field. This oneof // is known as a "synthetic" oneof, and this field must be its sole member // (each proto3 optional field gets its own synthetic oneof). Synthetic oneofs // exist in the descriptor only, and do not generate any API. Synthetic oneofs // must be ordered after all "real" oneofs. // // For message fields, proto3_optional doesn't create any semantic change, // since non-repeated message fields always track presence. However it still // indicates the semantic detail of whether the user wrote "optional" or not. // This can be useful for round-tripping the .proto file. For consistency we // give message fields a synthetic oneof also, even though it is not required // to track presence. This is especially important because the parser can't // tell if a field is a message or an enum, so it must always create a // synthetic oneof. // // Proto2 optional fields do not set this flag, because they already indicate // optional with `LABEL_OPTIONAL`. Proto3Optional *bool `protobuf:"varint,17,opt,name=proto3_optional,json=proto3Optional" json:"proto3_optional,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *FieldDescriptorProto) Reset() { *x = FieldDescriptorProto{} mi := &file_google_protobuf_descriptor_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *FieldDescriptorProto) String() string { return protoimpl.X.MessageStringOf(x) } func (*FieldDescriptorProto) ProtoMessage() {} func (x *FieldDescriptorProto) ProtoReflect() protoreflect.Message { mi := &file_google_protobuf_descriptor_proto_msgTypes[4] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use FieldDescriptorProto.ProtoReflect.Descriptor instead. func (*FieldDescriptorProto) Descriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{4} } func (x *FieldDescriptorProto) GetName() string { if x != nil && x.Name != nil { return *x.Name } return "" } func (x *FieldDescriptorProto) GetNumber() int32 { if x != nil && x.Number != nil { return *x.Number } return 0 } func (x *FieldDescriptorProto) GetLabel() FieldDescriptorProto_Label { if x != nil && x.Label != nil { return *x.Label } return FieldDescriptorProto_LABEL_OPTIONAL } func (x *FieldDescriptorProto) GetType() FieldDescriptorProto_Type { if x != nil && x.Type != nil { return *x.Type } return FieldDescriptorProto_TYPE_DOUBLE } func (x *FieldDescriptorProto) GetTypeName() string { if x != nil && x.TypeName != nil { return *x.TypeName } return "" } func (x *FieldDescriptorProto) GetExtendee() string { if x != nil && x.Extendee != nil { return *x.Extendee } return "" } func (x *FieldDescriptorProto) GetDefaultValue() string { if x != nil && x.DefaultValue != nil { return *x.DefaultValue } return "" } func (x *FieldDescriptorProto) GetOneofIndex() int32 { if x != nil && x.OneofIndex != nil { return *x.OneofIndex } return 0 } func (x *FieldDescriptorProto) GetJsonName() string { if x != nil && x.JsonName != nil { return *x.JsonName } return "" } func (x *FieldDescriptorProto) GetOptions() *FieldOptions { if x != nil { return x.Options } return nil } func (x *FieldDescriptorProto) GetProto3Optional() bool { if x != nil && x.Proto3Optional != nil { return *x.Proto3Optional } return false } // Describes a oneof. type OneofDescriptorProto struct { state protoimpl.MessageState `protogen:"open.v1"` Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` Options *OneofOptions `protobuf:"bytes,2,opt,name=options" json:"options,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *OneofDescriptorProto) Reset() { *x = OneofDescriptorProto{} mi := &file_google_protobuf_descriptor_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *OneofDescriptorProto) String() string { return protoimpl.X.MessageStringOf(x) } func (*OneofDescriptorProto) ProtoMessage() {} func (x *OneofDescriptorProto) ProtoReflect() protoreflect.Message { mi := &file_google_protobuf_descriptor_proto_msgTypes[5] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use OneofDescriptorProto.ProtoReflect.Descriptor instead. func (*OneofDescriptorProto) Descriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{5} } func (x *OneofDescriptorProto) GetName() string { if x != nil && x.Name != nil { return *x.Name } return "" } func (x *OneofDescriptorProto) GetOptions() *OneofOptions { if x != nil { return x.Options } return nil } // Describes an enum type. type EnumDescriptorProto struct { state protoimpl.MessageState `protogen:"open.v1"` Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` Value []*EnumValueDescriptorProto `protobuf:"bytes,2,rep,name=value" json:"value,omitempty"` Options *EnumOptions `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"` // Range of reserved numeric values. Reserved numeric values may not be used // by enum values in the same enum declaration. Reserved ranges may not // overlap. ReservedRange []*EnumDescriptorProto_EnumReservedRange `protobuf:"bytes,4,rep,name=reserved_range,json=reservedRange" json:"reserved_range,omitempty"` // Reserved enum value names, which may not be reused. A given name may only // be reserved once. ReservedName []string `protobuf:"bytes,5,rep,name=reserved_name,json=reservedName" json:"reserved_name,omitempty"` // Support for `export` and `local` keywords on enums. Visibility *SymbolVisibility `protobuf:"varint,6,opt,name=visibility,enum=google.protobuf.SymbolVisibility" json:"visibility,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *EnumDescriptorProto) Reset() { *x = EnumDescriptorProto{} mi := &file_google_protobuf_descriptor_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *EnumDescriptorProto) String() string { return protoimpl.X.MessageStringOf(x) } func (*EnumDescriptorProto) ProtoMessage() {} func (x *EnumDescriptorProto) ProtoReflect() protoreflect.Message { mi := &file_google_protobuf_descriptor_proto_msgTypes[6] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use EnumDescriptorProto.ProtoReflect.Descriptor instead. func (*EnumDescriptorProto) Descriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{6} } func (x *EnumDescriptorProto) GetName() string { if x != nil && x.Name != nil { return *x.Name } return "" } func (x *EnumDescriptorProto) GetValue() []*EnumValueDescriptorProto { if x != nil { return x.Value } return nil } func (x *EnumDescriptorProto) GetOptions() *EnumOptions { if x != nil { return x.Options } return nil } func (x *EnumDescriptorProto) GetReservedRange() []*EnumDescriptorProto_EnumReservedRange { if x != nil { return x.ReservedRange } return nil } func (x *EnumDescriptorProto) GetReservedName() []string { if x != nil { return x.ReservedName } return nil } func (x *EnumDescriptorProto) GetVisibility() SymbolVisibility { if x != nil && x.Visibility != nil { return *x.Visibility } return SymbolVisibility_VISIBILITY_UNSET } // Describes a value within an enum. type EnumValueDescriptorProto struct { state protoimpl.MessageState `protogen:"open.v1"` Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` Number *int32 `protobuf:"varint,2,opt,name=number" json:"number,omitempty"` Options *EnumValueOptions `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *EnumValueDescriptorProto) Reset() { *x = EnumValueDescriptorProto{} mi := &file_google_protobuf_descriptor_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *EnumValueDescriptorProto) String() string { return protoimpl.X.MessageStringOf(x) } func (*EnumValueDescriptorProto) ProtoMessage() {} func (x *EnumValueDescriptorProto) ProtoReflect() protoreflect.Message { mi := &file_google_protobuf_descriptor_proto_msgTypes[7] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use EnumValueDescriptorProto.ProtoReflect.Descriptor instead. func (*EnumValueDescriptorProto) Descriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{7} } func (x *EnumValueDescriptorProto) GetName() string { if x != nil && x.Name != nil { return *x.Name } return "" } func (x *EnumValueDescriptorProto) GetNumber() int32 { if x != nil && x.Number != nil { return *x.Number } return 0 } func (x *EnumValueDescriptorProto) GetOptions() *EnumValueOptions { if x != nil { return x.Options } return nil } // Describes a service. type ServiceDescriptorProto struct { state protoimpl.MessageState `protogen:"open.v1"` Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` Method []*MethodDescriptorProto `protobuf:"bytes,2,rep,name=method" json:"method,omitempty"` Options *ServiceOptions `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *ServiceDescriptorProto) Reset() { *x = ServiceDescriptorProto{} mi := &file_google_protobuf_descriptor_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *ServiceDescriptorProto) String() string { return protoimpl.X.MessageStringOf(x) } func (*ServiceDescriptorProto) ProtoMessage() {} func (x *ServiceDescriptorProto) ProtoReflect() protoreflect.Message { mi := &file_google_protobuf_descriptor_proto_msgTypes[8] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use ServiceDescriptorProto.ProtoReflect.Descriptor instead. func (*ServiceDescriptorProto) Descriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{8} } func (x *ServiceDescriptorProto) GetName() string { if x != nil && x.Name != nil { return *x.Name } return "" } func (x *ServiceDescriptorProto) GetMethod() []*MethodDescriptorProto { if x != nil { return x.Method } return nil } func (x *ServiceDescriptorProto) GetOptions() *ServiceOptions { if x != nil { return x.Options } return nil } // Describes a method of a service. type MethodDescriptorProto struct { state protoimpl.MessageState `protogen:"open.v1"` Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` // Input and output type names. These are resolved in the same way as // FieldDescriptorProto.type_name, but must refer to a message type. InputType *string `protobuf:"bytes,2,opt,name=input_type,json=inputType" json:"input_type,omitempty"` OutputType *string `protobuf:"bytes,3,opt,name=output_type,json=outputType" json:"output_type,omitempty"` Options *MethodOptions `protobuf:"bytes,4,opt,name=options" json:"options,omitempty"` // Identifies if client streams multiple client messages ClientStreaming *bool `protobuf:"varint,5,opt,name=client_streaming,json=clientStreaming,def=0" json:"client_streaming,omitempty"` // Identifies if server streams multiple server messages ServerStreaming *bool `protobuf:"varint,6,opt,name=server_streaming,json=serverStreaming,def=0" json:"server_streaming,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } // Default values for MethodDescriptorProto fields. const ( Default_MethodDescriptorProto_ClientStreaming = bool(false) Default_MethodDescriptorProto_ServerStreaming = bool(false) ) func (x *MethodDescriptorProto) Reset() { *x = MethodDescriptorProto{} mi := &file_google_protobuf_descriptor_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *MethodDescriptorProto) String() string { return protoimpl.X.MessageStringOf(x) } func (*MethodDescriptorProto) ProtoMessage() {} func (x *MethodDescriptorProto) ProtoReflect() protoreflect.Message { mi := &file_google_protobuf_descriptor_proto_msgTypes[9] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use MethodDescriptorProto.ProtoReflect.Descriptor instead. func (*MethodDescriptorProto) Descriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{9} } func (x *MethodDescriptorProto) GetName() string { if x != nil && x.Name != nil { return *x.Name } return "" } func (x *MethodDescriptorProto) GetInputType() string { if x != nil && x.InputType != nil { return *x.InputType } return "" } func (x *MethodDescriptorProto) GetOutputType() string { if x != nil && x.OutputType != nil { return *x.OutputType } return "" } func (x *MethodDescriptorProto) GetOptions() *MethodOptions { if x != nil { return x.Options } return nil } func (x *MethodDescriptorProto) GetClientStreaming() bool { if x != nil && x.ClientStreaming != nil { return *x.ClientStreaming } return Default_MethodDescriptorProto_ClientStreaming } func (x *MethodDescriptorProto) GetServerStreaming() bool { if x != nil && x.ServerStreaming != nil { return *x.ServerStreaming } return Default_MethodDescriptorProto_ServerStreaming } type FileOptions struct { state protoimpl.MessageState `protogen:"open.v1"` // Sets the Java package where classes generated from this .proto will be // placed. By default, the proto package is used, but this is often // inappropriate because proto packages do not normally start with backwards // domain names. JavaPackage *string `protobuf:"bytes,1,opt,name=java_package,json=javaPackage" json:"java_package,omitempty"` // Controls the name of the wrapper Java class generated for the .proto file. // That class will always contain the .proto file's getDescriptor() method as // well as any top-level extensions defined in the .proto file. // If java_multiple_files is disabled, then all the other classes from the // .proto file will be nested inside the single wrapper outer class. JavaOuterClassname *string `protobuf:"bytes,8,opt,name=java_outer_classname,json=javaOuterClassname" json:"java_outer_classname,omitempty"` // If enabled, then the Java code generator will generate a separate .java // file for each top-level message, enum, and service defined in the .proto // file. Thus, these types will *not* be nested inside the wrapper class // named by java_outer_classname. However, the wrapper class will still be // generated to contain the file's getDescriptor() method as well as any // top-level extensions defined in the file. JavaMultipleFiles *bool `protobuf:"varint,10,opt,name=java_multiple_files,json=javaMultipleFiles,def=0" json:"java_multiple_files,omitempty"` // This option does nothing. // // Deprecated: Marked as deprecated in google/protobuf/descriptor.proto. JavaGenerateEqualsAndHash *bool `protobuf:"varint,20,opt,name=java_generate_equals_and_hash,json=javaGenerateEqualsAndHash" json:"java_generate_equals_and_hash,omitempty"` // A proto2 file can set this to true to opt in to UTF-8 checking for Java, // which will throw an exception if invalid UTF-8 is parsed from the wire or // assigned to a string field. // // TODO: clarify exactly what kinds of field types this option // applies to, and update these docs accordingly. // // Proto3 files already perform these checks. Setting the option explicitly to // false has no effect: it cannot be used to opt proto3 files out of UTF-8 // checks. JavaStringCheckUtf8 *bool `protobuf:"varint,27,opt,name=java_string_check_utf8,json=javaStringCheckUtf8,def=0" json:"java_string_check_utf8,omitempty"` OptimizeFor *FileOptions_OptimizeMode `protobuf:"varint,9,opt,name=optimize_for,json=optimizeFor,enum=google.protobuf.FileOptions_OptimizeMode,def=1" json:"optimize_for,omitempty"` // Sets the Go package where structs generated from this .proto will be // placed. If omitted, the Go package will be derived from the following: // - The basename of the package import path, if provided. // - Otherwise, the package statement in the .proto file, if present. // - Otherwise, the basename of the .proto file, without extension. GoPackage *string `protobuf:"bytes,11,opt,name=go_package,json=goPackage" json:"go_package,omitempty"` // Should generic services be generated in each language? "Generic" services // are not specific to any particular RPC system. They are generated by the // main code generators in each language (without additional plugins). // Generic services were the only kind of service generation supported by // early versions of google.protobuf. // // Generic services are now considered deprecated in favor of using plugins // that generate code specific to your particular RPC system. Therefore, // these default to false. Old code which depends on generic services should // explicitly set them to true. CcGenericServices *bool `protobuf:"varint,16,opt,name=cc_generic_services,json=ccGenericServices,def=0" json:"cc_generic_services,omitempty"` JavaGenericServices *bool `protobuf:"varint,17,opt,name=java_generic_services,json=javaGenericServices,def=0" json:"java_generic_services,omitempty"` PyGenericServices *bool `protobuf:"varint,18,opt,name=py_generic_services,json=pyGenericServices,def=0" json:"py_generic_services,omitempty"` // Is this file deprecated? // Depending on the target platform, this can emit Deprecated annotations // for everything in the file, or it will be completely ignored; in the very // least, this is a formalization for deprecating files. Deprecated *bool `protobuf:"varint,23,opt,name=deprecated,def=0" json:"deprecated,omitempty"` // Enables the use of arenas for the proto messages in this file. This applies // only to generated classes for C++. CcEnableArenas *bool `protobuf:"varint,31,opt,name=cc_enable_arenas,json=ccEnableArenas,def=1" json:"cc_enable_arenas,omitempty"` // Sets the objective c class prefix which is prepended to all objective c // generated classes from this .proto. There is no default. ObjcClassPrefix *string `protobuf:"bytes,36,opt,name=objc_class_prefix,json=objcClassPrefix" json:"objc_class_prefix,omitempty"` // Namespace for generated classes; defaults to the package. CsharpNamespace *string `protobuf:"bytes,37,opt,name=csharp_namespace,json=csharpNamespace" json:"csharp_namespace,omitempty"` // By default Swift generators will take the proto package and CamelCase it // replacing '.' with underscore and use that to prefix the types/symbols // defined. When this options is provided, they will use this value instead // to prefix the types/symbols defined. SwiftPrefix *string `protobuf:"bytes,39,opt,name=swift_prefix,json=swiftPrefix" json:"swift_prefix,omitempty"` // Sets the php class prefix which is prepended to all php generated classes // from this .proto. Default is empty. PhpClassPrefix *string `protobuf:"bytes,40,opt,name=php_class_prefix,json=phpClassPrefix" json:"php_class_prefix,omitempty"` // Use this option to change the namespace of php generated classes. Default // is empty. When this option is empty, the package name will be used for // determining the namespace. PhpNamespace *string `protobuf:"bytes,41,opt,name=php_namespace,json=phpNamespace" json:"php_namespace,omitempty"` // Use this option to change the namespace of php generated metadata classes. // Default is empty. When this option is empty, the proto file name will be // used for determining the namespace. PhpMetadataNamespace *string `protobuf:"bytes,44,opt,name=php_metadata_namespace,json=phpMetadataNamespace" json:"php_metadata_namespace,omitempty"` // Use this option to change the package of ruby generated classes. Default // is empty. When this option is not set, the package name will be used for // determining the ruby package. RubyPackage *string `protobuf:"bytes,45,opt,name=ruby_package,json=rubyPackage" json:"ruby_package,omitempty"` // Any features defined in the specific edition. // WARNING: This field should only be used by protobuf plugins or special // cases like the proto compiler. Other uses are discouraged and // developers should rely on the protoreflect APIs for their client language. Features *FeatureSet `protobuf:"bytes,50,opt,name=features" json:"features,omitempty"` // The parser stores options it doesn't recognize here. // See the documentation for the "Options" section above. UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` extensionFields protoimpl.ExtensionFields unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } // Default values for FileOptions fields. const ( Default_FileOptions_JavaMultipleFiles = bool(false) Default_FileOptions_JavaStringCheckUtf8 = bool(false) Default_FileOptions_OptimizeFor = FileOptions_SPEED Default_FileOptions_CcGenericServices = bool(false) Default_FileOptions_JavaGenericServices = bool(false) Default_FileOptions_PyGenericServices = bool(false) Default_FileOptions_Deprecated = bool(false) Default_FileOptions_CcEnableArenas = bool(true) ) func (x *FileOptions) Reset() { *x = FileOptions{} mi := &file_google_protobuf_descriptor_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *FileOptions) String() string { return protoimpl.X.MessageStringOf(x) } func (*FileOptions) ProtoMessage() {} func (x *FileOptions) ProtoReflect() protoreflect.Message { mi := &file_google_protobuf_descriptor_proto_msgTypes[10] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use FileOptions.ProtoReflect.Descriptor instead. func (*FileOptions) Descriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{10} } func (x *FileOptions) GetJavaPackage() string { if x != nil && x.JavaPackage != nil { return *x.JavaPackage } return "" } func (x *FileOptions) GetJavaOuterClassname() string { if x != nil && x.JavaOuterClassname != nil { return *x.JavaOuterClassname } return "" } func (x *FileOptions) GetJavaMultipleFiles() bool { if x != nil && x.JavaMultipleFiles != nil { return *x.JavaMultipleFiles } return Default_FileOptions_JavaMultipleFiles } // Deprecated: Marked as deprecated in google/protobuf/descriptor.proto. func (x *FileOptions) GetJavaGenerateEqualsAndHash() bool { if x != nil && x.JavaGenerateEqualsAndHash != nil { return *x.JavaGenerateEqualsAndHash } return false } func (x *FileOptions) GetJavaStringCheckUtf8() bool { if x != nil && x.JavaStringCheckUtf8 != nil { return *x.JavaStringCheckUtf8 } return Default_FileOptions_JavaStringCheckUtf8 } func (x *FileOptions) GetOptimizeFor() FileOptions_OptimizeMode { if x != nil && x.OptimizeFor != nil { return *x.OptimizeFor } return Default_FileOptions_OptimizeFor } func (x *FileOptions) GetGoPackage() string { if x != nil && x.GoPackage != nil { return *x.GoPackage } return "" } func (x *FileOptions) GetCcGenericServices() bool { if x != nil && x.CcGenericServices != nil { return *x.CcGenericServices } return Default_FileOptions_CcGenericServices } func (x *FileOptions) GetJavaGenericServices() bool { if x != nil && x.JavaGenericServices != nil { return *x.JavaGenericServices } return Default_FileOptions_JavaGenericServices } func (x *FileOptions) GetPyGenericServices() bool { if x != nil && x.PyGenericServices != nil { return *x.PyGenericServices } return Default_FileOptions_PyGenericServices } func (x *FileOptions) GetDeprecated() bool { if x != nil && x.Deprecated != nil { return *x.Deprecated } return Default_FileOptions_Deprecated } func (x *FileOptions) GetCcEnableArenas() bool { if x != nil && x.CcEnableArenas != nil { return *x.CcEnableArenas } return Default_FileOptions_CcEnableArenas } func (x *FileOptions) GetObjcClassPrefix() string { if x != nil && x.ObjcClassPrefix != nil { return *x.ObjcClassPrefix } return "" } func (x *FileOptions) GetCsharpNamespace() string { if x != nil && x.CsharpNamespace != nil { return *x.CsharpNamespace } return "" } func (x *FileOptions) GetSwiftPrefix() string { if x != nil && x.SwiftPrefix != nil { return *x.SwiftPrefix } return "" } func (x *FileOptions) GetPhpClassPrefix() string { if x != nil && x.PhpClassPrefix != nil { return *x.PhpClassPrefix } return "" } func (x *FileOptions) GetPhpNamespace() string { if x != nil && x.PhpNamespace != nil { return *x.PhpNamespace } return "" } func (x *FileOptions) GetPhpMetadataNamespace() string { if x != nil && x.PhpMetadataNamespace != nil { return *x.PhpMetadataNamespace } return "" } func (x *FileOptions) GetRubyPackage() string { if x != nil && x.RubyPackage != nil { return *x.RubyPackage } return "" } func (x *FileOptions) GetFeatures() *FeatureSet { if x != nil { return x.Features } return nil } func (x *FileOptions) GetUninterpretedOption() []*UninterpretedOption { if x != nil { return x.UninterpretedOption } return nil } type MessageOptions struct { state protoimpl.MessageState `protogen:"open.v1"` // Set true to use the old proto1 MessageSet wire format for extensions. // This is provided for backwards-compatibility with the MessageSet wire // format. You should not use this for any other reason: It's less // efficient, has fewer features, and is more complicated. // // The message must be defined exactly as follows: // // message Foo { // option message_set_wire_format = true; // extensions 4 to max; // } // // Note that the message cannot have any defined fields; MessageSets only // have extensions. // // All extensions of your type must be singular messages; e.g. they cannot // be int32s, enums, or repeated messages. // // Because this is an option, the above two restrictions are not enforced by // the protocol compiler. MessageSetWireFormat *bool `protobuf:"varint,1,opt,name=message_set_wire_format,json=messageSetWireFormat,def=0" json:"message_set_wire_format,omitempty"` // Disables the generation of the standard "descriptor()" accessor, which can // conflict with a field of the same name. This is meant to make migration // from proto1 easier; new code should avoid fields named "descriptor". NoStandardDescriptorAccessor *bool `protobuf:"varint,2,opt,name=no_standard_descriptor_accessor,json=noStandardDescriptorAccessor,def=0" json:"no_standard_descriptor_accessor,omitempty"` // Is this message deprecated? // Depending on the target platform, this can emit Deprecated annotations // for the message, or it will be completely ignored; in the very least, // this is a formalization for deprecating messages. Deprecated *bool `protobuf:"varint,3,opt,name=deprecated,def=0" json:"deprecated,omitempty"` // Whether the message is an automatically generated map entry type for the // maps field. // // For maps fields: // // map map_field = 1; // // The parsed descriptor looks like: // // message MapFieldEntry { // option map_entry = true; // optional KeyType key = 1; // optional ValueType value = 2; // } // repeated MapFieldEntry map_field = 1; // // Implementations may choose not to generate the map_entry=true message, but // use a native map in the target language to hold the keys and values. // The reflection APIs in such implementations still need to work as // if the field is a repeated message field. // // NOTE: Do not set the option in .proto files. Always use the maps syntax // instead. The option should only be implicitly set by the proto compiler // parser. MapEntry *bool `protobuf:"varint,7,opt,name=map_entry,json=mapEntry" json:"map_entry,omitempty"` // Enable the legacy handling of JSON field name conflicts. This lowercases // and strips underscored from the fields before comparison in proto3 only. // The new behavior takes `json_name` into account and applies to proto2 as // well. // // This should only be used as a temporary measure against broken builds due // to the change in behavior for JSON field name conflicts. // // TODO This is legacy behavior we plan to remove once downstream // teams have had time to migrate. // // Deprecated: Marked as deprecated in google/protobuf/descriptor.proto. DeprecatedLegacyJsonFieldConflicts *bool `protobuf:"varint,11,opt,name=deprecated_legacy_json_field_conflicts,json=deprecatedLegacyJsonFieldConflicts" json:"deprecated_legacy_json_field_conflicts,omitempty"` // Any features defined in the specific edition. // WARNING: This field should only be used by protobuf plugins or special // cases like the proto compiler. Other uses are discouraged and // developers should rely on the protoreflect APIs for their client language. Features *FeatureSet `protobuf:"bytes,12,opt,name=features" json:"features,omitempty"` // The parser stores options it doesn't recognize here. See above. UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` extensionFields protoimpl.ExtensionFields unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } // Default values for MessageOptions fields. const ( Default_MessageOptions_MessageSetWireFormat = bool(false) Default_MessageOptions_NoStandardDescriptorAccessor = bool(false) Default_MessageOptions_Deprecated = bool(false) ) func (x *MessageOptions) Reset() { *x = MessageOptions{} mi := &file_google_protobuf_descriptor_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *MessageOptions) String() string { return protoimpl.X.MessageStringOf(x) } func (*MessageOptions) ProtoMessage() {} func (x *MessageOptions) ProtoReflect() protoreflect.Message { mi := &file_google_protobuf_descriptor_proto_msgTypes[11] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use MessageOptions.ProtoReflect.Descriptor instead. func (*MessageOptions) Descriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{11} } func (x *MessageOptions) GetMessageSetWireFormat() bool { if x != nil && x.MessageSetWireFormat != nil { return *x.MessageSetWireFormat } return Default_MessageOptions_MessageSetWireFormat } func (x *MessageOptions) GetNoStandardDescriptorAccessor() bool { if x != nil && x.NoStandardDescriptorAccessor != nil { return *x.NoStandardDescriptorAccessor } return Default_MessageOptions_NoStandardDescriptorAccessor } func (x *MessageOptions) GetDeprecated() bool { if x != nil && x.Deprecated != nil { return *x.Deprecated } return Default_MessageOptions_Deprecated } func (x *MessageOptions) GetMapEntry() bool { if x != nil && x.MapEntry != nil { return *x.MapEntry } return false } // Deprecated: Marked as deprecated in google/protobuf/descriptor.proto. func (x *MessageOptions) GetDeprecatedLegacyJsonFieldConflicts() bool { if x != nil && x.DeprecatedLegacyJsonFieldConflicts != nil { return *x.DeprecatedLegacyJsonFieldConflicts } return false } func (x *MessageOptions) GetFeatures() *FeatureSet { if x != nil { return x.Features } return nil } func (x *MessageOptions) GetUninterpretedOption() []*UninterpretedOption { if x != nil { return x.UninterpretedOption } return nil } type FieldOptions struct { state protoimpl.MessageState `protogen:"open.v1"` // NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead. // The ctype option instructs the C++ code generator to use a different // representation of the field than it normally would. See the specific // options below. This option is only implemented to support use of // [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of // type "bytes" in the open source release. // TODO: make ctype actually deprecated. Ctype *FieldOptions_CType `protobuf:"varint,1,opt,name=ctype,enum=google.protobuf.FieldOptions_CType,def=0" json:"ctype,omitempty"` // The packed option can be enabled for repeated primitive fields to enable // a more efficient representation on the wire. Rather than repeatedly // writing the tag and type for each element, the entire array is encoded as // a single length-delimited blob. In proto3, only explicit setting it to // false will avoid using packed encoding. This option is prohibited in // Editions, but the `repeated_field_encoding` feature can be used to control // the behavior. Packed *bool `protobuf:"varint,2,opt,name=packed" json:"packed,omitempty"` // The jstype option determines the JavaScript type used for values of the // field. The option is permitted only for 64 bit integral and fixed types // (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING // is represented as JavaScript string, which avoids loss of precision that // can happen when a large value is converted to a floating point JavaScript. // Specifying JS_NUMBER for the jstype causes the generated JavaScript code to // use the JavaScript "number" type. The behavior of the default option // JS_NORMAL is implementation dependent. // // This option is an enum to permit additional types to be added, e.g. // goog.math.Integer. Jstype *FieldOptions_JSType `protobuf:"varint,6,opt,name=jstype,enum=google.protobuf.FieldOptions_JSType,def=0" json:"jstype,omitempty"` // Should this field be parsed lazily? Lazy applies only to message-type // fields. It means that when the outer message is initially parsed, the // inner message's contents will not be parsed but instead stored in encoded // form. The inner message will actually be parsed when it is first accessed. // // This is only a hint. Implementations are free to choose whether to use // eager or lazy parsing regardless of the value of this option. However, // setting this option true suggests that the protocol author believes that // using lazy parsing on this field is worth the additional bookkeeping // overhead typically needed to implement it. // // This option does not affect the public interface of any generated code; // all method signatures remain the same. Furthermore, thread-safety of the // interface is not affected by this option; const methods remain safe to // call from multiple threads concurrently, while non-const methods continue // to require exclusive access. // // Note that lazy message fields are still eagerly verified to check // ill-formed wireformat or missing required fields. Calling IsInitialized() // on the outer message would fail if the inner message has missing required // fields. Failed verification would result in parsing failure (except when // uninitialized messages are acceptable). Lazy *bool `protobuf:"varint,5,opt,name=lazy,def=0" json:"lazy,omitempty"` // unverified_lazy does no correctness checks on the byte stream. This should // only be used where lazy with verification is prohibitive for performance // reasons. UnverifiedLazy *bool `protobuf:"varint,15,opt,name=unverified_lazy,json=unverifiedLazy,def=0" json:"unverified_lazy,omitempty"` // Is this field deprecated? // Depending on the target platform, this can emit Deprecated annotations // for accessors, or it will be completely ignored; in the very least, this // is a formalization for deprecating fields. Deprecated *bool `protobuf:"varint,3,opt,name=deprecated,def=0" json:"deprecated,omitempty"` // DEPRECATED. DO NOT USE! // For Google-internal migration only. Do not use. // // Deprecated: Marked as deprecated in google/protobuf/descriptor.proto. Weak *bool `protobuf:"varint,10,opt,name=weak,def=0" json:"weak,omitempty"` // Indicate that the field value should not be printed out when using debug // formats, e.g. when the field contains sensitive credentials. DebugRedact *bool `protobuf:"varint,16,opt,name=debug_redact,json=debugRedact,def=0" json:"debug_redact,omitempty"` Retention *FieldOptions_OptionRetention `protobuf:"varint,17,opt,name=retention,enum=google.protobuf.FieldOptions_OptionRetention" json:"retention,omitempty"` Targets []FieldOptions_OptionTargetType `protobuf:"varint,19,rep,name=targets,enum=google.protobuf.FieldOptions_OptionTargetType" json:"targets,omitempty"` EditionDefaults []*FieldOptions_EditionDefault `protobuf:"bytes,20,rep,name=edition_defaults,json=editionDefaults" json:"edition_defaults,omitempty"` // Any features defined in the specific edition. // WARNING: This field should only be used by protobuf plugins or special // cases like the proto compiler. Other uses are discouraged and // developers should rely on the protoreflect APIs for their client language. Features *FeatureSet `protobuf:"bytes,21,opt,name=features" json:"features,omitempty"` FeatureSupport *FieldOptions_FeatureSupport `protobuf:"bytes,22,opt,name=feature_support,json=featureSupport" json:"feature_support,omitempty"` // The parser stores options it doesn't recognize here. See above. UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` extensionFields protoimpl.ExtensionFields unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } // Default values for FieldOptions fields. const ( Default_FieldOptions_Ctype = FieldOptions_STRING Default_FieldOptions_Jstype = FieldOptions_JS_NORMAL Default_FieldOptions_Lazy = bool(false) Default_FieldOptions_UnverifiedLazy = bool(false) Default_FieldOptions_Deprecated = bool(false) Default_FieldOptions_Weak = bool(false) Default_FieldOptions_DebugRedact = bool(false) ) func (x *FieldOptions) Reset() { *x = FieldOptions{} mi := &file_google_protobuf_descriptor_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *FieldOptions) String() string { return protoimpl.X.MessageStringOf(x) } func (*FieldOptions) ProtoMessage() {} func (x *FieldOptions) ProtoReflect() protoreflect.Message { mi := &file_google_protobuf_descriptor_proto_msgTypes[12] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use FieldOptions.ProtoReflect.Descriptor instead. func (*FieldOptions) Descriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{12} } func (x *FieldOptions) GetCtype() FieldOptions_CType { if x != nil && x.Ctype != nil { return *x.Ctype } return Default_FieldOptions_Ctype } func (x *FieldOptions) GetPacked() bool { if x != nil && x.Packed != nil { return *x.Packed } return false } func (x *FieldOptions) GetJstype() FieldOptions_JSType { if x != nil && x.Jstype != nil { return *x.Jstype } return Default_FieldOptions_Jstype } func (x *FieldOptions) GetLazy() bool { if x != nil && x.Lazy != nil { return *x.Lazy } return Default_FieldOptions_Lazy } func (x *FieldOptions) GetUnverifiedLazy() bool { if x != nil && x.UnverifiedLazy != nil { return *x.UnverifiedLazy } return Default_FieldOptions_UnverifiedLazy } func (x *FieldOptions) GetDeprecated() bool { if x != nil && x.Deprecated != nil { return *x.Deprecated } return Default_FieldOptions_Deprecated } // Deprecated: Marked as deprecated in google/protobuf/descriptor.proto. func (x *FieldOptions) GetWeak() bool { if x != nil && x.Weak != nil { return *x.Weak } return Default_FieldOptions_Weak } func (x *FieldOptions) GetDebugRedact() bool { if x != nil && x.DebugRedact != nil { return *x.DebugRedact } return Default_FieldOptions_DebugRedact } func (x *FieldOptions) GetRetention() FieldOptions_OptionRetention { if x != nil && x.Retention != nil { return *x.Retention } return FieldOptions_RETENTION_UNKNOWN } func (x *FieldOptions) GetTargets() []FieldOptions_OptionTargetType { if x != nil { return x.Targets } return nil } func (x *FieldOptions) GetEditionDefaults() []*FieldOptions_EditionDefault { if x != nil { return x.EditionDefaults } return nil } func (x *FieldOptions) GetFeatures() *FeatureSet { if x != nil { return x.Features } return nil } func (x *FieldOptions) GetFeatureSupport() *FieldOptions_FeatureSupport { if x != nil { return x.FeatureSupport } return nil } func (x *FieldOptions) GetUninterpretedOption() []*UninterpretedOption { if x != nil { return x.UninterpretedOption } return nil } type OneofOptions struct { state protoimpl.MessageState `protogen:"open.v1"` // Any features defined in the specific edition. // WARNING: This field should only be used by protobuf plugins or special // cases like the proto compiler. Other uses are discouraged and // developers should rely on the protoreflect APIs for their client language. Features *FeatureSet `protobuf:"bytes,1,opt,name=features" json:"features,omitempty"` // The parser stores options it doesn't recognize here. See above. UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` extensionFields protoimpl.ExtensionFields unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *OneofOptions) Reset() { *x = OneofOptions{} mi := &file_google_protobuf_descriptor_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *OneofOptions) String() string { return protoimpl.X.MessageStringOf(x) } func (*OneofOptions) ProtoMessage() {} func (x *OneofOptions) ProtoReflect() protoreflect.Message { mi := &file_google_protobuf_descriptor_proto_msgTypes[13] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use OneofOptions.ProtoReflect.Descriptor instead. func (*OneofOptions) Descriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{13} } func (x *OneofOptions) GetFeatures() *FeatureSet { if x != nil { return x.Features } return nil } func (x *OneofOptions) GetUninterpretedOption() []*UninterpretedOption { if x != nil { return x.UninterpretedOption } return nil } type EnumOptions struct { state protoimpl.MessageState `protogen:"open.v1"` // Set this option to true to allow mapping different tag names to the same // value. AllowAlias *bool `protobuf:"varint,2,opt,name=allow_alias,json=allowAlias" json:"allow_alias,omitempty"` // Is this enum deprecated? // Depending on the target platform, this can emit Deprecated annotations // for the enum, or it will be completely ignored; in the very least, this // is a formalization for deprecating enums. Deprecated *bool `protobuf:"varint,3,opt,name=deprecated,def=0" json:"deprecated,omitempty"` // Enable the legacy handling of JSON field name conflicts. This lowercases // and strips underscored from the fields before comparison in proto3 only. // The new behavior takes `json_name` into account and applies to proto2 as // well. // TODO Remove this legacy behavior once downstream teams have // had time to migrate. // // Deprecated: Marked as deprecated in google/protobuf/descriptor.proto. DeprecatedLegacyJsonFieldConflicts *bool `protobuf:"varint,6,opt,name=deprecated_legacy_json_field_conflicts,json=deprecatedLegacyJsonFieldConflicts" json:"deprecated_legacy_json_field_conflicts,omitempty"` // Any features defined in the specific edition. // WARNING: This field should only be used by protobuf plugins or special // cases like the proto compiler. Other uses are discouraged and // developers should rely on the protoreflect APIs for their client language. Features *FeatureSet `protobuf:"bytes,7,opt,name=features" json:"features,omitempty"` // The parser stores options it doesn't recognize here. See above. UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` extensionFields protoimpl.ExtensionFields unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } // Default values for EnumOptions fields. const ( Default_EnumOptions_Deprecated = bool(false) ) func (x *EnumOptions) Reset() { *x = EnumOptions{} mi := &file_google_protobuf_descriptor_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *EnumOptions) String() string { return protoimpl.X.MessageStringOf(x) } func (*EnumOptions) ProtoMessage() {} func (x *EnumOptions) ProtoReflect() protoreflect.Message { mi := &file_google_protobuf_descriptor_proto_msgTypes[14] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use EnumOptions.ProtoReflect.Descriptor instead. func (*EnumOptions) Descriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{14} } func (x *EnumOptions) GetAllowAlias() bool { if x != nil && x.AllowAlias != nil { return *x.AllowAlias } return false } func (x *EnumOptions) GetDeprecated() bool { if x != nil && x.Deprecated != nil { return *x.Deprecated } return Default_EnumOptions_Deprecated } // Deprecated: Marked as deprecated in google/protobuf/descriptor.proto. func (x *EnumOptions) GetDeprecatedLegacyJsonFieldConflicts() bool { if x != nil && x.DeprecatedLegacyJsonFieldConflicts != nil { return *x.DeprecatedLegacyJsonFieldConflicts } return false } func (x *EnumOptions) GetFeatures() *FeatureSet { if x != nil { return x.Features } return nil } func (x *EnumOptions) GetUninterpretedOption() []*UninterpretedOption { if x != nil { return x.UninterpretedOption } return nil } type EnumValueOptions struct { state protoimpl.MessageState `protogen:"open.v1"` // Is this enum value deprecated? // Depending on the target platform, this can emit Deprecated annotations // for the enum value, or it will be completely ignored; in the very least, // this is a formalization for deprecating enum values. Deprecated *bool `protobuf:"varint,1,opt,name=deprecated,def=0" json:"deprecated,omitempty"` // Any features defined in the specific edition. // WARNING: This field should only be used by protobuf plugins or special // cases like the proto compiler. Other uses are discouraged and // developers should rely on the protoreflect APIs for their client language. Features *FeatureSet `protobuf:"bytes,2,opt,name=features" json:"features,omitempty"` // Indicate that fields annotated with this enum value should not be printed // out when using debug formats, e.g. when the field contains sensitive // credentials. DebugRedact *bool `protobuf:"varint,3,opt,name=debug_redact,json=debugRedact,def=0" json:"debug_redact,omitempty"` // Information about the support window of a feature value. FeatureSupport *FieldOptions_FeatureSupport `protobuf:"bytes,4,opt,name=feature_support,json=featureSupport" json:"feature_support,omitempty"` // The parser stores options it doesn't recognize here. See above. UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` extensionFields protoimpl.ExtensionFields unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } // Default values for EnumValueOptions fields. const ( Default_EnumValueOptions_Deprecated = bool(false) Default_EnumValueOptions_DebugRedact = bool(false) ) func (x *EnumValueOptions) Reset() { *x = EnumValueOptions{} mi := &file_google_protobuf_descriptor_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *EnumValueOptions) String() string { return protoimpl.X.MessageStringOf(x) } func (*EnumValueOptions) ProtoMessage() {} func (x *EnumValueOptions) ProtoReflect() protoreflect.Message { mi := &file_google_protobuf_descriptor_proto_msgTypes[15] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use EnumValueOptions.ProtoReflect.Descriptor instead. func (*EnumValueOptions) Descriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{15} } func (x *EnumValueOptions) GetDeprecated() bool { if x != nil && x.Deprecated != nil { return *x.Deprecated } return Default_EnumValueOptions_Deprecated } func (x *EnumValueOptions) GetFeatures() *FeatureSet { if x != nil { return x.Features } return nil } func (x *EnumValueOptions) GetDebugRedact() bool { if x != nil && x.DebugRedact != nil { return *x.DebugRedact } return Default_EnumValueOptions_DebugRedact } func (x *EnumValueOptions) GetFeatureSupport() *FieldOptions_FeatureSupport { if x != nil { return x.FeatureSupport } return nil } func (x *EnumValueOptions) GetUninterpretedOption() []*UninterpretedOption { if x != nil { return x.UninterpretedOption } return nil } type ServiceOptions struct { state protoimpl.MessageState `protogen:"open.v1"` // Any features defined in the specific edition. // WARNING: This field should only be used by protobuf plugins or special // cases like the proto compiler. Other uses are discouraged and // developers should rely on the protoreflect APIs for their client language. Features *FeatureSet `protobuf:"bytes,34,opt,name=features" json:"features,omitempty"` // Is this service deprecated? // Depending on the target platform, this can emit Deprecated annotations // for the service, or it will be completely ignored; in the very least, // this is a formalization for deprecating services. Deprecated *bool `protobuf:"varint,33,opt,name=deprecated,def=0" json:"deprecated,omitempty"` // The parser stores options it doesn't recognize here. See above. UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` extensionFields protoimpl.ExtensionFields unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } // Default values for ServiceOptions fields. const ( Default_ServiceOptions_Deprecated = bool(false) ) func (x *ServiceOptions) Reset() { *x = ServiceOptions{} mi := &file_google_protobuf_descriptor_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *ServiceOptions) String() string { return protoimpl.X.MessageStringOf(x) } func (*ServiceOptions) ProtoMessage() {} func (x *ServiceOptions) ProtoReflect() protoreflect.Message { mi := &file_google_protobuf_descriptor_proto_msgTypes[16] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use ServiceOptions.ProtoReflect.Descriptor instead. func (*ServiceOptions) Descriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{16} } func (x *ServiceOptions) GetFeatures() *FeatureSet { if x != nil { return x.Features } return nil } func (x *ServiceOptions) GetDeprecated() bool { if x != nil && x.Deprecated != nil { return *x.Deprecated } return Default_ServiceOptions_Deprecated } func (x *ServiceOptions) GetUninterpretedOption() []*UninterpretedOption { if x != nil { return x.UninterpretedOption } return nil } type MethodOptions struct { state protoimpl.MessageState `protogen:"open.v1"` // Is this method deprecated? // Depending on the target platform, this can emit Deprecated annotations // for the method, or it will be completely ignored; in the very least, // this is a formalization for deprecating methods. Deprecated *bool `protobuf:"varint,33,opt,name=deprecated,def=0" json:"deprecated,omitempty"` IdempotencyLevel *MethodOptions_IdempotencyLevel `protobuf:"varint,34,opt,name=idempotency_level,json=idempotencyLevel,enum=google.protobuf.MethodOptions_IdempotencyLevel,def=0" json:"idempotency_level,omitempty"` // Any features defined in the specific edition. // WARNING: This field should only be used by protobuf plugins or special // cases like the proto compiler. Other uses are discouraged and // developers should rely on the protoreflect APIs for their client language. Features *FeatureSet `protobuf:"bytes,35,opt,name=features" json:"features,omitempty"` // The parser stores options it doesn't recognize here. See above. UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` extensionFields protoimpl.ExtensionFields unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } // Default values for MethodOptions fields. const ( Default_MethodOptions_Deprecated = bool(false) Default_MethodOptions_IdempotencyLevel = MethodOptions_IDEMPOTENCY_UNKNOWN ) func (x *MethodOptions) Reset() { *x = MethodOptions{} mi := &file_google_protobuf_descriptor_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *MethodOptions) String() string { return protoimpl.X.MessageStringOf(x) } func (*MethodOptions) ProtoMessage() {} func (x *MethodOptions) ProtoReflect() protoreflect.Message { mi := &file_google_protobuf_descriptor_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use MethodOptions.ProtoReflect.Descriptor instead. func (*MethodOptions) Descriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{17} } func (x *MethodOptions) GetDeprecated() bool { if x != nil && x.Deprecated != nil { return *x.Deprecated } return Default_MethodOptions_Deprecated } func (x *MethodOptions) GetIdempotencyLevel() MethodOptions_IdempotencyLevel { if x != nil && x.IdempotencyLevel != nil { return *x.IdempotencyLevel } return Default_MethodOptions_IdempotencyLevel } func (x *MethodOptions) GetFeatures() *FeatureSet { if x != nil { return x.Features } return nil } func (x *MethodOptions) GetUninterpretedOption() []*UninterpretedOption { if x != nil { return x.UninterpretedOption } return nil } // A message representing a option the parser does not recognize. This only // appears in options protos created by the compiler::Parser class. // DescriptorPool resolves these when building Descriptor objects. Therefore, // options protos in descriptor objects (e.g. returned by Descriptor::options(), // or produced by Descriptor::CopyTo()) will never have UninterpretedOptions // in them. type UninterpretedOption struct { state protoimpl.MessageState `protogen:"open.v1"` Name []*UninterpretedOption_NamePart `protobuf:"bytes,2,rep,name=name" json:"name,omitempty"` // The value of the uninterpreted option, in whatever type the tokenizer // identified it as during parsing. Exactly one of these should be set. IdentifierValue *string `protobuf:"bytes,3,opt,name=identifier_value,json=identifierValue" json:"identifier_value,omitempty"` PositiveIntValue *uint64 `protobuf:"varint,4,opt,name=positive_int_value,json=positiveIntValue" json:"positive_int_value,omitempty"` NegativeIntValue *int64 `protobuf:"varint,5,opt,name=negative_int_value,json=negativeIntValue" json:"negative_int_value,omitempty"` DoubleValue *float64 `protobuf:"fixed64,6,opt,name=double_value,json=doubleValue" json:"double_value,omitempty"` StringValue []byte `protobuf:"bytes,7,opt,name=string_value,json=stringValue" json:"string_value,omitempty"` AggregateValue *string `protobuf:"bytes,8,opt,name=aggregate_value,json=aggregateValue" json:"aggregate_value,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *UninterpretedOption) Reset() { *x = UninterpretedOption{} mi := &file_google_protobuf_descriptor_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *UninterpretedOption) String() string { return protoimpl.X.MessageStringOf(x) } func (*UninterpretedOption) ProtoMessage() {} func (x *UninterpretedOption) ProtoReflect() protoreflect.Message { mi := &file_google_protobuf_descriptor_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use UninterpretedOption.ProtoReflect.Descriptor instead. func (*UninterpretedOption) Descriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{18} } func (x *UninterpretedOption) GetName() []*UninterpretedOption_NamePart { if x != nil { return x.Name } return nil } func (x *UninterpretedOption) GetIdentifierValue() string { if x != nil && x.IdentifierValue != nil { return *x.IdentifierValue } return "" } func (x *UninterpretedOption) GetPositiveIntValue() uint64 { if x != nil && x.PositiveIntValue != nil { return *x.PositiveIntValue } return 0 } func (x *UninterpretedOption) GetNegativeIntValue() int64 { if x != nil && x.NegativeIntValue != nil { return *x.NegativeIntValue } return 0 } func (x *UninterpretedOption) GetDoubleValue() float64 { if x != nil && x.DoubleValue != nil { return *x.DoubleValue } return 0 } func (x *UninterpretedOption) GetStringValue() []byte { if x != nil { return x.StringValue } return nil } func (x *UninterpretedOption) GetAggregateValue() string { if x != nil && x.AggregateValue != nil { return *x.AggregateValue } return "" } // TODO Enums in C++ gencode (and potentially other languages) are // not well scoped. This means that each of the feature enums below can clash // with each other. The short names we've chosen maximize call-site // readability, but leave us very open to this scenario. A future feature will // be designed and implemented to handle this, hopefully before we ever hit a // conflict here. type FeatureSet struct { state protoimpl.MessageState `protogen:"open.v1"` FieldPresence *FeatureSet_FieldPresence `protobuf:"varint,1,opt,name=field_presence,json=fieldPresence,enum=google.protobuf.FeatureSet_FieldPresence" json:"field_presence,omitempty"` EnumType *FeatureSet_EnumType `protobuf:"varint,2,opt,name=enum_type,json=enumType,enum=google.protobuf.FeatureSet_EnumType" json:"enum_type,omitempty"` RepeatedFieldEncoding *FeatureSet_RepeatedFieldEncoding `protobuf:"varint,3,opt,name=repeated_field_encoding,json=repeatedFieldEncoding,enum=google.protobuf.FeatureSet_RepeatedFieldEncoding" json:"repeated_field_encoding,omitempty"` Utf8Validation *FeatureSet_Utf8Validation `protobuf:"varint,4,opt,name=utf8_validation,json=utf8Validation,enum=google.protobuf.FeatureSet_Utf8Validation" json:"utf8_validation,omitempty"` MessageEncoding *FeatureSet_MessageEncoding `protobuf:"varint,5,opt,name=message_encoding,json=messageEncoding,enum=google.protobuf.FeatureSet_MessageEncoding" json:"message_encoding,omitempty"` JsonFormat *FeatureSet_JsonFormat `protobuf:"varint,6,opt,name=json_format,json=jsonFormat,enum=google.protobuf.FeatureSet_JsonFormat" json:"json_format,omitempty"` EnforceNamingStyle *FeatureSet_EnforceNamingStyle `protobuf:"varint,7,opt,name=enforce_naming_style,json=enforceNamingStyle,enum=google.protobuf.FeatureSet_EnforceNamingStyle" json:"enforce_naming_style,omitempty"` DefaultSymbolVisibility *FeatureSet_VisibilityFeature_DefaultSymbolVisibility `protobuf:"varint,8,opt,name=default_symbol_visibility,json=defaultSymbolVisibility,enum=google.protobuf.FeatureSet_VisibilityFeature_DefaultSymbolVisibility" json:"default_symbol_visibility,omitempty"` extensionFields protoimpl.ExtensionFields unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *FeatureSet) Reset() { *x = FeatureSet{} mi := &file_google_protobuf_descriptor_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *FeatureSet) String() string { return protoimpl.X.MessageStringOf(x) } func (*FeatureSet) ProtoMessage() {} func (x *FeatureSet) ProtoReflect() protoreflect.Message { mi := &file_google_protobuf_descriptor_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use FeatureSet.ProtoReflect.Descriptor instead. func (*FeatureSet) Descriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{19} } func (x *FeatureSet) GetFieldPresence() FeatureSet_FieldPresence { if x != nil && x.FieldPresence != nil { return *x.FieldPresence } return FeatureSet_FIELD_PRESENCE_UNKNOWN } func (x *FeatureSet) GetEnumType() FeatureSet_EnumType { if x != nil && x.EnumType != nil { return *x.EnumType } return FeatureSet_ENUM_TYPE_UNKNOWN } func (x *FeatureSet) GetRepeatedFieldEncoding() FeatureSet_RepeatedFieldEncoding { if x != nil && x.RepeatedFieldEncoding != nil { return *x.RepeatedFieldEncoding } return FeatureSet_REPEATED_FIELD_ENCODING_UNKNOWN } func (x *FeatureSet) GetUtf8Validation() FeatureSet_Utf8Validation { if x != nil && x.Utf8Validation != nil { return *x.Utf8Validation } return FeatureSet_UTF8_VALIDATION_UNKNOWN } func (x *FeatureSet) GetMessageEncoding() FeatureSet_MessageEncoding { if x != nil && x.MessageEncoding != nil { return *x.MessageEncoding } return FeatureSet_MESSAGE_ENCODING_UNKNOWN } func (x *FeatureSet) GetJsonFormat() FeatureSet_JsonFormat { if x != nil && x.JsonFormat != nil { return *x.JsonFormat } return FeatureSet_JSON_FORMAT_UNKNOWN } func (x *FeatureSet) GetEnforceNamingStyle() FeatureSet_EnforceNamingStyle { if x != nil && x.EnforceNamingStyle != nil { return *x.EnforceNamingStyle } return FeatureSet_ENFORCE_NAMING_STYLE_UNKNOWN } func (x *FeatureSet) GetDefaultSymbolVisibility() FeatureSet_VisibilityFeature_DefaultSymbolVisibility { if x != nil && x.DefaultSymbolVisibility != nil { return *x.DefaultSymbolVisibility } return FeatureSet_VisibilityFeature_DEFAULT_SYMBOL_VISIBILITY_UNKNOWN } // A compiled specification for the defaults of a set of features. These // messages are generated from FeatureSet extensions and can be used to seed // feature resolution. The resolution with this object becomes a simple search // for the closest matching edition, followed by proto merges. type FeatureSetDefaults struct { state protoimpl.MessageState `protogen:"open.v1"` Defaults []*FeatureSetDefaults_FeatureSetEditionDefault `protobuf:"bytes,1,rep,name=defaults" json:"defaults,omitempty"` // The minimum supported edition (inclusive) when this was constructed. // Editions before this will not have defaults. MinimumEdition *Edition `protobuf:"varint,4,opt,name=minimum_edition,json=minimumEdition,enum=google.protobuf.Edition" json:"minimum_edition,omitempty"` // The maximum known edition (inclusive) when this was constructed. Editions // after this will not have reliable defaults. MaximumEdition *Edition `protobuf:"varint,5,opt,name=maximum_edition,json=maximumEdition,enum=google.protobuf.Edition" json:"maximum_edition,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *FeatureSetDefaults) Reset() { *x = FeatureSetDefaults{} mi := &file_google_protobuf_descriptor_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *FeatureSetDefaults) String() string { return protoimpl.X.MessageStringOf(x) } func (*FeatureSetDefaults) ProtoMessage() {} func (x *FeatureSetDefaults) ProtoReflect() protoreflect.Message { mi := &file_google_protobuf_descriptor_proto_msgTypes[20] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use FeatureSetDefaults.ProtoReflect.Descriptor instead. func (*FeatureSetDefaults) Descriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{20} } func (x *FeatureSetDefaults) GetDefaults() []*FeatureSetDefaults_FeatureSetEditionDefault { if x != nil { return x.Defaults } return nil } func (x *FeatureSetDefaults) GetMinimumEdition() Edition { if x != nil && x.MinimumEdition != nil { return *x.MinimumEdition } return Edition_EDITION_UNKNOWN } func (x *FeatureSetDefaults) GetMaximumEdition() Edition { if x != nil && x.MaximumEdition != nil { return *x.MaximumEdition } return Edition_EDITION_UNKNOWN } // Encapsulates information about the original source file from which a // FileDescriptorProto was generated. type SourceCodeInfo struct { state protoimpl.MessageState `protogen:"open.v1"` // A Location identifies a piece of source code in a .proto file which // corresponds to a particular definition. This information is intended // to be useful to IDEs, code indexers, documentation generators, and similar // tools. // // For example, say we have a file like: // // message Foo { // optional string foo = 1; // } // // Let's look at just the field definition: // // optional string foo = 1; // ^ ^^ ^^ ^ ^^^ // a bc de f ghi // // We have the following locations: // // span path represents // [a,i) [ 4, 0, 2, 0 ] The whole field definition. // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). // [c,d) [ 4, 0, 2, 0, 5 ] The type (string). // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). // [g,h) [ 4, 0, 2, 0, 3 ] The number (1). // // Notes: // - A location may refer to a repeated field itself (i.e. not to any // particular index within it). This is used whenever a set of elements are // logically enclosed in a single code segment. For example, an entire // extend block (possibly containing multiple extension definitions) will // have an outer location whose path refers to the "extensions" repeated // field without an index. // - Multiple locations may have the same path. This happens when a single // logical declaration is spread out across multiple places. The most // obvious example is the "extend" block again -- there may be multiple // extend blocks in the same scope, each of which will have the same path. // - A location's span is not always a subset of its parent's span. For // example, the "extendee" of an extension declaration appears at the // beginning of the "extend" block and is shared by all extensions within // the block. // - Just because a location's span is a subset of some other location's span // does not mean that it is a descendant. For example, a "group" defines // both a type and a field in a single declaration. Thus, the locations // corresponding to the type and field and their components will overlap. // - Code which tries to interpret locations should probably be designed to // ignore those that it doesn't understand, as more types of locations could // be recorded in the future. Location []*SourceCodeInfo_Location `protobuf:"bytes,1,rep,name=location" json:"location,omitempty"` extensionFields protoimpl.ExtensionFields unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *SourceCodeInfo) Reset() { *x = SourceCodeInfo{} mi := &file_google_protobuf_descriptor_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *SourceCodeInfo) String() string { return protoimpl.X.MessageStringOf(x) } func (*SourceCodeInfo) ProtoMessage() {} func (x *SourceCodeInfo) ProtoReflect() protoreflect.Message { mi := &file_google_protobuf_descriptor_proto_msgTypes[21] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use SourceCodeInfo.ProtoReflect.Descriptor instead. func (*SourceCodeInfo) Descriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{21} } func (x *SourceCodeInfo) GetLocation() []*SourceCodeInfo_Location { if x != nil { return x.Location } return nil } // Describes the relationship between generated code and its original source // file. A GeneratedCodeInfo message is associated with only one generated // source file, but may contain references to different source .proto files. type GeneratedCodeInfo struct { state protoimpl.MessageState `protogen:"open.v1"` // An Annotation connects some span of text in generated code to an element // of its generating .proto file. Annotation []*GeneratedCodeInfo_Annotation `protobuf:"bytes,1,rep,name=annotation" json:"annotation,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *GeneratedCodeInfo) Reset() { *x = GeneratedCodeInfo{} mi := &file_google_protobuf_descriptor_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *GeneratedCodeInfo) String() string { return protoimpl.X.MessageStringOf(x) } func (*GeneratedCodeInfo) ProtoMessage() {} func (x *GeneratedCodeInfo) ProtoReflect() protoreflect.Message { mi := &file_google_protobuf_descriptor_proto_msgTypes[22] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use GeneratedCodeInfo.ProtoReflect.Descriptor instead. func (*GeneratedCodeInfo) Descriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{22} } func (x *GeneratedCodeInfo) GetAnnotation() []*GeneratedCodeInfo_Annotation { if x != nil { return x.Annotation } return nil } type DescriptorProto_ExtensionRange struct { state protoimpl.MessageState `protogen:"open.v1"` Start *int32 `protobuf:"varint,1,opt,name=start" json:"start,omitempty"` // Inclusive. End *int32 `protobuf:"varint,2,opt,name=end" json:"end,omitempty"` // Exclusive. Options *ExtensionRangeOptions `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *DescriptorProto_ExtensionRange) Reset() { *x = DescriptorProto_ExtensionRange{} mi := &file_google_protobuf_descriptor_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *DescriptorProto_ExtensionRange) String() string { return protoimpl.X.MessageStringOf(x) } func (*DescriptorProto_ExtensionRange) ProtoMessage() {} func (x *DescriptorProto_ExtensionRange) ProtoReflect() protoreflect.Message { mi := &file_google_protobuf_descriptor_proto_msgTypes[23] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use DescriptorProto_ExtensionRange.ProtoReflect.Descriptor instead. func (*DescriptorProto_ExtensionRange) Descriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{2, 0} } func (x *DescriptorProto_ExtensionRange) GetStart() int32 { if x != nil && x.Start != nil { return *x.Start } return 0 } func (x *DescriptorProto_ExtensionRange) GetEnd() int32 { if x != nil && x.End != nil { return *x.End } return 0 } func (x *DescriptorProto_ExtensionRange) GetOptions() *ExtensionRangeOptions { if x != nil { return x.Options } return nil } // Range of reserved tag numbers. Reserved tag numbers may not be used by // fields or extension ranges in the same message. Reserved ranges may // not overlap. type DescriptorProto_ReservedRange struct { state protoimpl.MessageState `protogen:"open.v1"` Start *int32 `protobuf:"varint,1,opt,name=start" json:"start,omitempty"` // Inclusive. End *int32 `protobuf:"varint,2,opt,name=end" json:"end,omitempty"` // Exclusive. unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *DescriptorProto_ReservedRange) Reset() { *x = DescriptorProto_ReservedRange{} mi := &file_google_protobuf_descriptor_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *DescriptorProto_ReservedRange) String() string { return protoimpl.X.MessageStringOf(x) } func (*DescriptorProto_ReservedRange) ProtoMessage() {} func (x *DescriptorProto_ReservedRange) ProtoReflect() protoreflect.Message { mi := &file_google_protobuf_descriptor_proto_msgTypes[24] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use DescriptorProto_ReservedRange.ProtoReflect.Descriptor instead. func (*DescriptorProto_ReservedRange) Descriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{2, 1} } func (x *DescriptorProto_ReservedRange) GetStart() int32 { if x != nil && x.Start != nil { return *x.Start } return 0 } func (x *DescriptorProto_ReservedRange) GetEnd() int32 { if x != nil && x.End != nil { return *x.End } return 0 } type ExtensionRangeOptions_Declaration struct { state protoimpl.MessageState `protogen:"open.v1"` // The extension number declared within the extension range. Number *int32 `protobuf:"varint,1,opt,name=number" json:"number,omitempty"` // The fully-qualified name of the extension field. There must be a leading // dot in front of the full name. FullName *string `protobuf:"bytes,2,opt,name=full_name,json=fullName" json:"full_name,omitempty"` // The fully-qualified type name of the extension field. Unlike // Metadata.type, Declaration.type must have a leading dot for messages // and enums. Type *string `protobuf:"bytes,3,opt,name=type" json:"type,omitempty"` // If true, indicates that the number is reserved in the extension range, // and any extension field with the number will fail to compile. Set this // when a declared extension field is deleted. Reserved *bool `protobuf:"varint,5,opt,name=reserved" json:"reserved,omitempty"` // If true, indicates that the extension must be defined as repeated. // Otherwise the extension must be defined as optional. Repeated *bool `protobuf:"varint,6,opt,name=repeated" json:"repeated,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *ExtensionRangeOptions_Declaration) Reset() { *x = ExtensionRangeOptions_Declaration{} mi := &file_google_protobuf_descriptor_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *ExtensionRangeOptions_Declaration) String() string { return protoimpl.X.MessageStringOf(x) } func (*ExtensionRangeOptions_Declaration) ProtoMessage() {} func (x *ExtensionRangeOptions_Declaration) ProtoReflect() protoreflect.Message { mi := &file_google_protobuf_descriptor_proto_msgTypes[25] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use ExtensionRangeOptions_Declaration.ProtoReflect.Descriptor instead. func (*ExtensionRangeOptions_Declaration) Descriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{3, 0} } func (x *ExtensionRangeOptions_Declaration) GetNumber() int32 { if x != nil && x.Number != nil { return *x.Number } return 0 } func (x *ExtensionRangeOptions_Declaration) GetFullName() string { if x != nil && x.FullName != nil { return *x.FullName } return "" } func (x *ExtensionRangeOptions_Declaration) GetType() string { if x != nil && x.Type != nil { return *x.Type } return "" } func (x *ExtensionRangeOptions_Declaration) GetReserved() bool { if x != nil && x.Reserved != nil { return *x.Reserved } return false } func (x *ExtensionRangeOptions_Declaration) GetRepeated() bool { if x != nil && x.Repeated != nil { return *x.Repeated } return false } // Range of reserved numeric values. Reserved values may not be used by // entries in the same enum. Reserved ranges may not overlap. // // Note that this is distinct from DescriptorProto.ReservedRange in that it // is inclusive such that it can appropriately represent the entire int32 // domain. type EnumDescriptorProto_EnumReservedRange struct { state protoimpl.MessageState `protogen:"open.v1"` Start *int32 `protobuf:"varint,1,opt,name=start" json:"start,omitempty"` // Inclusive. End *int32 `protobuf:"varint,2,opt,name=end" json:"end,omitempty"` // Inclusive. unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *EnumDescriptorProto_EnumReservedRange) Reset() { *x = EnumDescriptorProto_EnumReservedRange{} mi := &file_google_protobuf_descriptor_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *EnumDescriptorProto_EnumReservedRange) String() string { return protoimpl.X.MessageStringOf(x) } func (*EnumDescriptorProto_EnumReservedRange) ProtoMessage() {} func (x *EnumDescriptorProto_EnumReservedRange) ProtoReflect() protoreflect.Message { mi := &file_google_protobuf_descriptor_proto_msgTypes[26] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use EnumDescriptorProto_EnumReservedRange.ProtoReflect.Descriptor instead. func (*EnumDescriptorProto_EnumReservedRange) Descriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{6, 0} } func (x *EnumDescriptorProto_EnumReservedRange) GetStart() int32 { if x != nil && x.Start != nil { return *x.Start } return 0 } func (x *EnumDescriptorProto_EnumReservedRange) GetEnd() int32 { if x != nil && x.End != nil { return *x.End } return 0 } type FieldOptions_EditionDefault struct { state protoimpl.MessageState `protogen:"open.v1"` Edition *Edition `protobuf:"varint,3,opt,name=edition,enum=google.protobuf.Edition" json:"edition,omitempty"` Value *string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` // Textproto value. unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *FieldOptions_EditionDefault) Reset() { *x = FieldOptions_EditionDefault{} mi := &file_google_protobuf_descriptor_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *FieldOptions_EditionDefault) String() string { return protoimpl.X.MessageStringOf(x) } func (*FieldOptions_EditionDefault) ProtoMessage() {} func (x *FieldOptions_EditionDefault) ProtoReflect() protoreflect.Message { mi := &file_google_protobuf_descriptor_proto_msgTypes[27] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use FieldOptions_EditionDefault.ProtoReflect.Descriptor instead. func (*FieldOptions_EditionDefault) Descriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{12, 0} } func (x *FieldOptions_EditionDefault) GetEdition() Edition { if x != nil && x.Edition != nil { return *x.Edition } return Edition_EDITION_UNKNOWN } func (x *FieldOptions_EditionDefault) GetValue() string { if x != nil && x.Value != nil { return *x.Value } return "" } // Information about the support window of a feature. type FieldOptions_FeatureSupport struct { state protoimpl.MessageState `protogen:"open.v1"` // The edition that this feature was first available in. In editions // earlier than this one, the default assigned to EDITION_LEGACY will be // used, and proto files will not be able to override it. EditionIntroduced *Edition `protobuf:"varint,1,opt,name=edition_introduced,json=editionIntroduced,enum=google.protobuf.Edition" json:"edition_introduced,omitempty"` // The edition this feature becomes deprecated in. Using this after this // edition may trigger warnings. EditionDeprecated *Edition `protobuf:"varint,2,opt,name=edition_deprecated,json=editionDeprecated,enum=google.protobuf.Edition" json:"edition_deprecated,omitempty"` // The deprecation warning text if this feature is used after the edition it // was marked deprecated in. DeprecationWarning *string `protobuf:"bytes,3,opt,name=deprecation_warning,json=deprecationWarning" json:"deprecation_warning,omitempty"` // The edition this feature is no longer available in. In editions after // this one, the last default assigned will be used, and proto files will // not be able to override it. EditionRemoved *Edition `protobuf:"varint,4,opt,name=edition_removed,json=editionRemoved,enum=google.protobuf.Edition" json:"edition_removed,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *FieldOptions_FeatureSupport) Reset() { *x = FieldOptions_FeatureSupport{} mi := &file_google_protobuf_descriptor_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *FieldOptions_FeatureSupport) String() string { return protoimpl.X.MessageStringOf(x) } func (*FieldOptions_FeatureSupport) ProtoMessage() {} func (x *FieldOptions_FeatureSupport) ProtoReflect() protoreflect.Message { mi := &file_google_protobuf_descriptor_proto_msgTypes[28] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use FieldOptions_FeatureSupport.ProtoReflect.Descriptor instead. func (*FieldOptions_FeatureSupport) Descriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{12, 1} } func (x *FieldOptions_FeatureSupport) GetEditionIntroduced() Edition { if x != nil && x.EditionIntroduced != nil { return *x.EditionIntroduced } return Edition_EDITION_UNKNOWN } func (x *FieldOptions_FeatureSupport) GetEditionDeprecated() Edition { if x != nil && x.EditionDeprecated != nil { return *x.EditionDeprecated } return Edition_EDITION_UNKNOWN } func (x *FieldOptions_FeatureSupport) GetDeprecationWarning() string { if x != nil && x.DeprecationWarning != nil { return *x.DeprecationWarning } return "" } func (x *FieldOptions_FeatureSupport) GetEditionRemoved() Edition { if x != nil && x.EditionRemoved != nil { return *x.EditionRemoved } return Edition_EDITION_UNKNOWN } // The name of the uninterpreted option. Each string represents a segment in // a dot-separated name. is_extension is true iff a segment represents an // extension (denoted with parentheses in options specs in .proto files). // E.g.,{ ["foo", false], ["bar.baz", true], ["moo", false] } represents // "foo.(bar.baz).moo". type UninterpretedOption_NamePart struct { state protoimpl.MessageState `protogen:"open.v1"` NamePart *string `protobuf:"bytes,1,req,name=name_part,json=namePart" json:"name_part,omitempty"` IsExtension *bool `protobuf:"varint,2,req,name=is_extension,json=isExtension" json:"is_extension,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *UninterpretedOption_NamePart) Reset() { *x = UninterpretedOption_NamePart{} mi := &file_google_protobuf_descriptor_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *UninterpretedOption_NamePart) String() string { return protoimpl.X.MessageStringOf(x) } func (*UninterpretedOption_NamePart) ProtoMessage() {} func (x *UninterpretedOption_NamePart) ProtoReflect() protoreflect.Message { mi := &file_google_protobuf_descriptor_proto_msgTypes[29] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use UninterpretedOption_NamePart.ProtoReflect.Descriptor instead. func (*UninterpretedOption_NamePart) Descriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{18, 0} } func (x *UninterpretedOption_NamePart) GetNamePart() string { if x != nil && x.NamePart != nil { return *x.NamePart } return "" } func (x *UninterpretedOption_NamePart) GetIsExtension() bool { if x != nil && x.IsExtension != nil { return *x.IsExtension } return false } type FeatureSet_VisibilityFeature struct { state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *FeatureSet_VisibilityFeature) Reset() { *x = FeatureSet_VisibilityFeature{} mi := &file_google_protobuf_descriptor_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *FeatureSet_VisibilityFeature) String() string { return protoimpl.X.MessageStringOf(x) } func (*FeatureSet_VisibilityFeature) ProtoMessage() {} func (x *FeatureSet_VisibilityFeature) ProtoReflect() protoreflect.Message { mi := &file_google_protobuf_descriptor_proto_msgTypes[30] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use FeatureSet_VisibilityFeature.ProtoReflect.Descriptor instead. func (*FeatureSet_VisibilityFeature) Descriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{19, 0} } // A map from every known edition with a unique set of defaults to its // defaults. Not all editions may be contained here. For a given edition, // the defaults at the closest matching edition ordered at or before it should // be used. This field must be in strict ascending order by edition. type FeatureSetDefaults_FeatureSetEditionDefault struct { state protoimpl.MessageState `protogen:"open.v1"` Edition *Edition `protobuf:"varint,3,opt,name=edition,enum=google.protobuf.Edition" json:"edition,omitempty"` // Defaults of features that can be overridden in this edition. OverridableFeatures *FeatureSet `protobuf:"bytes,4,opt,name=overridable_features,json=overridableFeatures" json:"overridable_features,omitempty"` // Defaults of features that can't be overridden in this edition. FixedFeatures *FeatureSet `protobuf:"bytes,5,opt,name=fixed_features,json=fixedFeatures" json:"fixed_features,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *FeatureSetDefaults_FeatureSetEditionDefault) Reset() { *x = FeatureSetDefaults_FeatureSetEditionDefault{} mi := &file_google_protobuf_descriptor_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *FeatureSetDefaults_FeatureSetEditionDefault) String() string { return protoimpl.X.MessageStringOf(x) } func (*FeatureSetDefaults_FeatureSetEditionDefault) ProtoMessage() {} func (x *FeatureSetDefaults_FeatureSetEditionDefault) ProtoReflect() protoreflect.Message { mi := &file_google_protobuf_descriptor_proto_msgTypes[31] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use FeatureSetDefaults_FeatureSetEditionDefault.ProtoReflect.Descriptor instead. func (*FeatureSetDefaults_FeatureSetEditionDefault) Descriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{20, 0} } func (x *FeatureSetDefaults_FeatureSetEditionDefault) GetEdition() Edition { if x != nil && x.Edition != nil { return *x.Edition } return Edition_EDITION_UNKNOWN } func (x *FeatureSetDefaults_FeatureSetEditionDefault) GetOverridableFeatures() *FeatureSet { if x != nil { return x.OverridableFeatures } return nil } func (x *FeatureSetDefaults_FeatureSetEditionDefault) GetFixedFeatures() *FeatureSet { if x != nil { return x.FixedFeatures } return nil } type SourceCodeInfo_Location struct { state protoimpl.MessageState `protogen:"open.v1"` // Identifies which part of the FileDescriptorProto was defined at this // location. // // Each element is a field number or an index. They form a path from // the root FileDescriptorProto to the place where the definition appears. // For example, this path: // // [ 4, 3, 2, 7, 1 ] // // refers to: // // file.message_type(3) // 4, 3 // .field(7) // 2, 7 // .name() // 1 // // This is because FileDescriptorProto.message_type has field number 4: // // repeated DescriptorProto message_type = 4; // // and DescriptorProto.field has field number 2: // // repeated FieldDescriptorProto field = 2; // // and FieldDescriptorProto.name has field number 1: // // optional string name = 1; // // Thus, the above path gives the location of a field name. If we removed // the last element: // // [ 4, 3, 2, 7 ] // // this path refers to the whole field declaration (from the beginning // of the label to the terminating semicolon). Path []int32 `protobuf:"varint,1,rep,packed,name=path" json:"path,omitempty"` // Always has exactly three or four elements: start line, start column, // end line (optional, otherwise assumed same as start line), end column. // These are packed into a single field for efficiency. Note that line // and column numbers are zero-based -- typically you will want to add // 1 to each before displaying to a user. Span []int32 `protobuf:"varint,2,rep,packed,name=span" json:"span,omitempty"` // If this SourceCodeInfo represents a complete declaration, these are any // comments appearing before and after the declaration which appear to be // attached to the declaration. // // A series of line comments appearing on consecutive lines, with no other // tokens appearing on those lines, will be treated as a single comment. // // leading_detached_comments will keep paragraphs of comments that appear // before (but not connected to) the current element. Each paragraph, // separated by empty lines, will be one comment element in the repeated // field. // // Only the comment content is provided; comment markers (e.g. //) are // stripped out. For block comments, leading whitespace and an asterisk // will be stripped from the beginning of each line other than the first. // Newlines are included in the output. // // Examples: // // optional int32 foo = 1; // Comment attached to foo. // // Comment attached to bar. // optional int32 bar = 2; // // optional string baz = 3; // // Comment attached to baz. // // Another line attached to baz. // // // Comment attached to moo. // // // // Another line attached to moo. // optional double moo = 4; // // // Detached comment for corge. This is not leading or trailing comments // // to moo or corge because there are blank lines separating it from // // both. // // // Detached comment for corge paragraph 2. // // optional string corge = 5; // /* Block comment attached // * to corge. Leading asterisks // * will be removed. */ // /* Block comment attached to // * grault. */ // optional int32 grault = 6; // // // ignored detached comments. LeadingComments *string `protobuf:"bytes,3,opt,name=leading_comments,json=leadingComments" json:"leading_comments,omitempty"` TrailingComments *string `protobuf:"bytes,4,opt,name=trailing_comments,json=trailingComments" json:"trailing_comments,omitempty"` LeadingDetachedComments []string `protobuf:"bytes,6,rep,name=leading_detached_comments,json=leadingDetachedComments" json:"leading_detached_comments,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *SourceCodeInfo_Location) Reset() { *x = SourceCodeInfo_Location{} mi := &file_google_protobuf_descriptor_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *SourceCodeInfo_Location) String() string { return protoimpl.X.MessageStringOf(x) } func (*SourceCodeInfo_Location) ProtoMessage() {} func (x *SourceCodeInfo_Location) ProtoReflect() protoreflect.Message { mi := &file_google_protobuf_descriptor_proto_msgTypes[32] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use SourceCodeInfo_Location.ProtoReflect.Descriptor instead. func (*SourceCodeInfo_Location) Descriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{21, 0} } func (x *SourceCodeInfo_Location) GetPath() []int32 { if x != nil { return x.Path } return nil } func (x *SourceCodeInfo_Location) GetSpan() []int32 { if x != nil { return x.Span } return nil } func (x *SourceCodeInfo_Location) GetLeadingComments() string { if x != nil && x.LeadingComments != nil { return *x.LeadingComments } return "" } func (x *SourceCodeInfo_Location) GetTrailingComments() string { if x != nil && x.TrailingComments != nil { return *x.TrailingComments } return "" } func (x *SourceCodeInfo_Location) GetLeadingDetachedComments() []string { if x != nil { return x.LeadingDetachedComments } return nil } type GeneratedCodeInfo_Annotation struct { state protoimpl.MessageState `protogen:"open.v1"` // Identifies the element in the original source .proto file. This field // is formatted the same as SourceCodeInfo.Location.path. Path []int32 `protobuf:"varint,1,rep,packed,name=path" json:"path,omitempty"` // Identifies the filesystem path to the original source .proto. SourceFile *string `protobuf:"bytes,2,opt,name=source_file,json=sourceFile" json:"source_file,omitempty"` // Identifies the starting offset in bytes in the generated code // that relates to the identified object. Begin *int32 `protobuf:"varint,3,opt,name=begin" json:"begin,omitempty"` // Identifies the ending offset in bytes in the generated code that // relates to the identified object. The end offset should be one past // the last relevant byte (so the length of the text = end - begin). End *int32 `protobuf:"varint,4,opt,name=end" json:"end,omitempty"` Semantic *GeneratedCodeInfo_Annotation_Semantic `protobuf:"varint,5,opt,name=semantic,enum=google.protobuf.GeneratedCodeInfo_Annotation_Semantic" json:"semantic,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *GeneratedCodeInfo_Annotation) Reset() { *x = GeneratedCodeInfo_Annotation{} mi := &file_google_protobuf_descriptor_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *GeneratedCodeInfo_Annotation) String() string { return protoimpl.X.MessageStringOf(x) } func (*GeneratedCodeInfo_Annotation) ProtoMessage() {} func (x *GeneratedCodeInfo_Annotation) ProtoReflect() protoreflect.Message { mi := &file_google_protobuf_descriptor_proto_msgTypes[33] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use GeneratedCodeInfo_Annotation.ProtoReflect.Descriptor instead. func (*GeneratedCodeInfo_Annotation) Descriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{22, 0} } func (x *GeneratedCodeInfo_Annotation) GetPath() []int32 { if x != nil { return x.Path } return nil } func (x *GeneratedCodeInfo_Annotation) GetSourceFile() string { if x != nil && x.SourceFile != nil { return *x.SourceFile } return "" } func (x *GeneratedCodeInfo_Annotation) GetBegin() int32 { if x != nil && x.Begin != nil { return *x.Begin } return 0 } func (x *GeneratedCodeInfo_Annotation) GetEnd() int32 { if x != nil && x.End != nil { return *x.End } return 0 } func (x *GeneratedCodeInfo_Annotation) GetSemantic() GeneratedCodeInfo_Annotation_Semantic { if x != nil && x.Semantic != nil { return *x.Semantic } return GeneratedCodeInfo_Annotation_NONE } var File_google_protobuf_descriptor_proto protoreflect.FileDescriptor const file_google_protobuf_descriptor_proto_rawDesc = "" + "\n" + " google/protobuf/descriptor.proto\x12\x0fgoogle.protobuf\"[\n" + "\x11FileDescriptorSet\x128\n" + "\x04file\x18\x01 \x03(\v2$.google.protobuf.FileDescriptorProtoR\x04file*\f\b\x80\xec\xca\xff\x01\x10\x81\xec\xca\xff\x01\"\xc5\x05\n" + "\x13FileDescriptorProto\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12\x18\n" + "\apackage\x18\x02 \x01(\tR\apackage\x12\x1e\n" + "\n" + "dependency\x18\x03 \x03(\tR\n" + "dependency\x12+\n" + "\x11public_dependency\x18\n" + " \x03(\x05R\x10publicDependency\x12'\n" + "\x0fweak_dependency\x18\v \x03(\x05R\x0eweakDependency\x12+\n" + "\x11option_dependency\x18\x0f \x03(\tR\x10optionDependency\x12C\n" + "\fmessage_type\x18\x04 \x03(\v2 .google.protobuf.DescriptorProtoR\vmessageType\x12A\n" + "\tenum_type\x18\x05 \x03(\v2$.google.protobuf.EnumDescriptorProtoR\benumType\x12A\n" + "\aservice\x18\x06 \x03(\v2'.google.protobuf.ServiceDescriptorProtoR\aservice\x12C\n" + "\textension\x18\a \x03(\v2%.google.protobuf.FieldDescriptorProtoR\textension\x126\n" + "\aoptions\x18\b \x01(\v2\x1c.google.protobuf.FileOptionsR\aoptions\x12I\n" + "\x10source_code_info\x18\t \x01(\v2\x1f.google.protobuf.SourceCodeInfoR\x0esourceCodeInfo\x12\x16\n" + "\x06syntax\x18\f \x01(\tR\x06syntax\x122\n" + "\aedition\x18\x0e \x01(\x0e2\x18.google.protobuf.EditionR\aedition\"\xfc\x06\n" + "\x0fDescriptorProto\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12;\n" + "\x05field\x18\x02 \x03(\v2%.google.protobuf.FieldDescriptorProtoR\x05field\x12C\n" + "\textension\x18\x06 \x03(\v2%.google.protobuf.FieldDescriptorProtoR\textension\x12A\n" + "\vnested_type\x18\x03 \x03(\v2 .google.protobuf.DescriptorProtoR\n" + "nestedType\x12A\n" + "\tenum_type\x18\x04 \x03(\v2$.google.protobuf.EnumDescriptorProtoR\benumType\x12X\n" + "\x0fextension_range\x18\x05 \x03(\v2/.google.protobuf.DescriptorProto.ExtensionRangeR\x0eextensionRange\x12D\n" + "\n" + "oneof_decl\x18\b \x03(\v2%.google.protobuf.OneofDescriptorProtoR\toneofDecl\x129\n" + "\aoptions\x18\a \x01(\v2\x1f.google.protobuf.MessageOptionsR\aoptions\x12U\n" + "\x0ereserved_range\x18\t \x03(\v2..google.protobuf.DescriptorProto.ReservedRangeR\rreservedRange\x12#\n" + "\rreserved_name\x18\n" + " \x03(\tR\freservedName\x12A\n" + "\n" + "visibility\x18\v \x01(\x0e2!.google.protobuf.SymbolVisibilityR\n" + "visibility\x1az\n" + "\x0eExtensionRange\x12\x14\n" + "\x05start\x18\x01 \x01(\x05R\x05start\x12\x10\n" + "\x03end\x18\x02 \x01(\x05R\x03end\x12@\n" + "\aoptions\x18\x03 \x01(\v2&.google.protobuf.ExtensionRangeOptionsR\aoptions\x1a7\n" + "\rReservedRange\x12\x14\n" + "\x05start\x18\x01 \x01(\x05R\x05start\x12\x10\n" + "\x03end\x18\x02 \x01(\x05R\x03end\"\xcc\x04\n" + "\x15ExtensionRangeOptions\x12X\n" + "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption\x12Y\n" + "\vdeclaration\x18\x02 \x03(\v22.google.protobuf.ExtensionRangeOptions.DeclarationB\x03\x88\x01\x02R\vdeclaration\x127\n" + "\bfeatures\x182 \x01(\v2\x1b.google.protobuf.FeatureSetR\bfeatures\x12m\n" + "\fverification\x18\x03 \x01(\x0e28.google.protobuf.ExtensionRangeOptions.VerificationState:\n" + "UNVERIFIEDB\x03\x88\x01\x02R\fverification\x1a\x94\x01\n" + "\vDeclaration\x12\x16\n" + "\x06number\x18\x01 \x01(\x05R\x06number\x12\x1b\n" + "\tfull_name\x18\x02 \x01(\tR\bfullName\x12\x12\n" + "\x04type\x18\x03 \x01(\tR\x04type\x12\x1a\n" + "\breserved\x18\x05 \x01(\bR\breserved\x12\x1a\n" + "\brepeated\x18\x06 \x01(\bR\brepeatedJ\x04\b\x04\x10\x05\"4\n" + "\x11VerificationState\x12\x0f\n" + "\vDECLARATION\x10\x00\x12\x0e\n" + "\n" + "UNVERIFIED\x10\x01*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\xc1\x06\n" + "\x14FieldDescriptorProto\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12\x16\n" + "\x06number\x18\x03 \x01(\x05R\x06number\x12A\n" + "\x05label\x18\x04 \x01(\x0e2+.google.protobuf.FieldDescriptorProto.LabelR\x05label\x12>\n" + "\x04type\x18\x05 \x01(\x0e2*.google.protobuf.FieldDescriptorProto.TypeR\x04type\x12\x1b\n" + "\ttype_name\x18\x06 \x01(\tR\btypeName\x12\x1a\n" + "\bextendee\x18\x02 \x01(\tR\bextendee\x12#\n" + "\rdefault_value\x18\a \x01(\tR\fdefaultValue\x12\x1f\n" + "\voneof_index\x18\t \x01(\x05R\n" + "oneofIndex\x12\x1b\n" + "\tjson_name\x18\n" + " \x01(\tR\bjsonName\x127\n" + "\aoptions\x18\b \x01(\v2\x1d.google.protobuf.FieldOptionsR\aoptions\x12'\n" + "\x0fproto3_optional\x18\x11 \x01(\bR\x0eproto3Optional\"\xb6\x02\n" + "\x04Type\x12\x0f\n" + "\vTYPE_DOUBLE\x10\x01\x12\x0e\n" + "\n" + "TYPE_FLOAT\x10\x02\x12\x0e\n" + "\n" + "TYPE_INT64\x10\x03\x12\x0f\n" + "\vTYPE_UINT64\x10\x04\x12\x0e\n" + "\n" + "TYPE_INT32\x10\x05\x12\x10\n" + "\fTYPE_FIXED64\x10\x06\x12\x10\n" + "\fTYPE_FIXED32\x10\a\x12\r\n" + "\tTYPE_BOOL\x10\b\x12\x0f\n" + "\vTYPE_STRING\x10\t\x12\x0e\n" + "\n" + "TYPE_GROUP\x10\n" + "\x12\x10\n" + "\fTYPE_MESSAGE\x10\v\x12\x0e\n" + "\n" + "TYPE_BYTES\x10\f\x12\x0f\n" + "\vTYPE_UINT32\x10\r\x12\r\n" + "\tTYPE_ENUM\x10\x0e\x12\x11\n" + "\rTYPE_SFIXED32\x10\x0f\x12\x11\n" + "\rTYPE_SFIXED64\x10\x10\x12\x0f\n" + "\vTYPE_SINT32\x10\x11\x12\x0f\n" + "\vTYPE_SINT64\x10\x12\"C\n" + "\x05Label\x12\x12\n" + "\x0eLABEL_OPTIONAL\x10\x01\x12\x12\n" + "\x0eLABEL_REPEATED\x10\x03\x12\x12\n" + "\x0eLABEL_REQUIRED\x10\x02\"c\n" + "\x14OneofDescriptorProto\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x127\n" + "\aoptions\x18\x02 \x01(\v2\x1d.google.protobuf.OneofOptionsR\aoptions\"\xa6\x03\n" + "\x13EnumDescriptorProto\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12?\n" + "\x05value\x18\x02 \x03(\v2).google.protobuf.EnumValueDescriptorProtoR\x05value\x126\n" + "\aoptions\x18\x03 \x01(\v2\x1c.google.protobuf.EnumOptionsR\aoptions\x12]\n" + "\x0ereserved_range\x18\x04 \x03(\v26.google.protobuf.EnumDescriptorProto.EnumReservedRangeR\rreservedRange\x12#\n" + "\rreserved_name\x18\x05 \x03(\tR\freservedName\x12A\n" + "\n" + "visibility\x18\x06 \x01(\x0e2!.google.protobuf.SymbolVisibilityR\n" + "visibility\x1a;\n" + "\x11EnumReservedRange\x12\x14\n" + "\x05start\x18\x01 \x01(\x05R\x05start\x12\x10\n" + "\x03end\x18\x02 \x01(\x05R\x03end\"\x83\x01\n" + "\x18EnumValueDescriptorProto\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12\x16\n" + "\x06number\x18\x02 \x01(\x05R\x06number\x12;\n" + "\aoptions\x18\x03 \x01(\v2!.google.protobuf.EnumValueOptionsR\aoptions\"\xb5\x01\n" + "\x16ServiceDescriptorProto\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12>\n" + "\x06method\x18\x02 \x03(\v2&.google.protobuf.MethodDescriptorProtoR\x06method\x129\n" + "\aoptions\x18\x03 \x01(\v2\x1f.google.protobuf.ServiceOptionsR\aoptionsJ\x04\b\x04\x10\x05R\x06stream\"\x89\x02\n" + "\x15MethodDescriptorProto\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12\x1d\n" + "\n" + "input_type\x18\x02 \x01(\tR\tinputType\x12\x1f\n" + "\voutput_type\x18\x03 \x01(\tR\n" + "outputType\x128\n" + "\aoptions\x18\x04 \x01(\v2\x1e.google.protobuf.MethodOptionsR\aoptions\x120\n" + "\x10client_streaming\x18\x05 \x01(\b:\x05falseR\x0fclientStreaming\x120\n" + "\x10server_streaming\x18\x06 \x01(\b:\x05falseR\x0fserverStreaming\"\xad\t\n" + "\vFileOptions\x12!\n" + "\fjava_package\x18\x01 \x01(\tR\vjavaPackage\x120\n" + "\x14java_outer_classname\x18\b \x01(\tR\x12javaOuterClassname\x125\n" + "\x13java_multiple_files\x18\n" + " \x01(\b:\x05falseR\x11javaMultipleFiles\x12D\n" + "\x1djava_generate_equals_and_hash\x18\x14 \x01(\bB\x02\x18\x01R\x19javaGenerateEqualsAndHash\x12:\n" + "\x16java_string_check_utf8\x18\x1b \x01(\b:\x05falseR\x13javaStringCheckUtf8\x12S\n" + "\foptimize_for\x18\t \x01(\x0e2).google.protobuf.FileOptions.OptimizeMode:\x05SPEEDR\voptimizeFor\x12\x1d\n" + "\n" + "go_package\x18\v \x01(\tR\tgoPackage\x125\n" + "\x13cc_generic_services\x18\x10 \x01(\b:\x05falseR\x11ccGenericServices\x129\n" + "\x15java_generic_services\x18\x11 \x01(\b:\x05falseR\x13javaGenericServices\x125\n" + "\x13py_generic_services\x18\x12 \x01(\b:\x05falseR\x11pyGenericServices\x12%\n" + "\n" + "deprecated\x18\x17 \x01(\b:\x05falseR\n" + "deprecated\x12.\n" + "\x10cc_enable_arenas\x18\x1f \x01(\b:\x04trueR\x0eccEnableArenas\x12*\n" + "\x11objc_class_prefix\x18$ \x01(\tR\x0fobjcClassPrefix\x12)\n" + "\x10csharp_namespace\x18% \x01(\tR\x0fcsharpNamespace\x12!\n" + "\fswift_prefix\x18' \x01(\tR\vswiftPrefix\x12(\n" + "\x10php_class_prefix\x18( \x01(\tR\x0ephpClassPrefix\x12#\n" + "\rphp_namespace\x18) \x01(\tR\fphpNamespace\x124\n" + "\x16php_metadata_namespace\x18, \x01(\tR\x14phpMetadataNamespace\x12!\n" + "\fruby_package\x18- \x01(\tR\vrubyPackage\x127\n" + "\bfeatures\x182 \x01(\v2\x1b.google.protobuf.FeatureSetR\bfeatures\x12X\n" + "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption\":\n" + "\fOptimizeMode\x12\t\n" + "\x05SPEED\x10\x01\x12\r\n" + "\tCODE_SIZE\x10\x02\x12\x10\n" + "\fLITE_RUNTIME\x10\x03*\t\b\xe8\a\x10\x80\x80\x80\x80\x02J\x04\b*\x10+J\x04\b&\x10'R\x14php_generic_services\"\xf4\x03\n" + "\x0eMessageOptions\x12<\n" + "\x17message_set_wire_format\x18\x01 \x01(\b:\x05falseR\x14messageSetWireFormat\x12L\n" + "\x1fno_standard_descriptor_accessor\x18\x02 \x01(\b:\x05falseR\x1cnoStandardDescriptorAccessor\x12%\n" + "\n" + "deprecated\x18\x03 \x01(\b:\x05falseR\n" + "deprecated\x12\x1b\n" + "\tmap_entry\x18\a \x01(\bR\bmapEntry\x12V\n" + "&deprecated_legacy_json_field_conflicts\x18\v \x01(\bB\x02\x18\x01R\"deprecatedLegacyJsonFieldConflicts\x127\n" + "\bfeatures\x18\f \x01(\v2\x1b.google.protobuf.FeatureSetR\bfeatures\x12X\n" + "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\t\b\xe8\a\x10\x80\x80\x80\x80\x02J\x04\b\x04\x10\x05J\x04\b\x05\x10\x06J\x04\b\x06\x10\aJ\x04\b\b\x10\tJ\x04\b\t\x10\n" + "\"\xa1\r\n" + "\fFieldOptions\x12A\n" + "\x05ctype\x18\x01 \x01(\x0e2#.google.protobuf.FieldOptions.CType:\x06STRINGR\x05ctype\x12\x16\n" + "\x06packed\x18\x02 \x01(\bR\x06packed\x12G\n" + "\x06jstype\x18\x06 \x01(\x0e2$.google.protobuf.FieldOptions.JSType:\tJS_NORMALR\x06jstype\x12\x19\n" + "\x04lazy\x18\x05 \x01(\b:\x05falseR\x04lazy\x12.\n" + "\x0funverified_lazy\x18\x0f \x01(\b:\x05falseR\x0eunverifiedLazy\x12%\n" + "\n" + "deprecated\x18\x03 \x01(\b:\x05falseR\n" + "deprecated\x12\x1d\n" + "\x04weak\x18\n" + " \x01(\b:\x05falseB\x02\x18\x01R\x04weak\x12(\n" + "\fdebug_redact\x18\x10 \x01(\b:\x05falseR\vdebugRedact\x12K\n" + "\tretention\x18\x11 \x01(\x0e2-.google.protobuf.FieldOptions.OptionRetentionR\tretention\x12H\n" + "\atargets\x18\x13 \x03(\x0e2..google.protobuf.FieldOptions.OptionTargetTypeR\atargets\x12W\n" + "\x10edition_defaults\x18\x14 \x03(\v2,.google.protobuf.FieldOptions.EditionDefaultR\x0feditionDefaults\x127\n" + "\bfeatures\x18\x15 \x01(\v2\x1b.google.protobuf.FeatureSetR\bfeatures\x12U\n" + "\x0ffeature_support\x18\x16 \x01(\v2,.google.protobuf.FieldOptions.FeatureSupportR\x0efeatureSupport\x12X\n" + "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption\x1aZ\n" + "\x0eEditionDefault\x122\n" + "\aedition\x18\x03 \x01(\x0e2\x18.google.protobuf.EditionR\aedition\x12\x14\n" + "\x05value\x18\x02 \x01(\tR\x05value\x1a\x96\x02\n" + "\x0eFeatureSupport\x12G\n" + "\x12edition_introduced\x18\x01 \x01(\x0e2\x18.google.protobuf.EditionR\x11editionIntroduced\x12G\n" + "\x12edition_deprecated\x18\x02 \x01(\x0e2\x18.google.protobuf.EditionR\x11editionDeprecated\x12/\n" + "\x13deprecation_warning\x18\x03 \x01(\tR\x12deprecationWarning\x12A\n" + "\x0fedition_removed\x18\x04 \x01(\x0e2\x18.google.protobuf.EditionR\x0eeditionRemoved\"/\n" + "\x05CType\x12\n" + "\n" + "\x06STRING\x10\x00\x12\b\n" + "\x04CORD\x10\x01\x12\x10\n" + "\fSTRING_PIECE\x10\x02\"5\n" + "\x06JSType\x12\r\n" + "\tJS_NORMAL\x10\x00\x12\r\n" + "\tJS_STRING\x10\x01\x12\r\n" + "\tJS_NUMBER\x10\x02\"U\n" + "\x0fOptionRetention\x12\x15\n" + "\x11RETENTION_UNKNOWN\x10\x00\x12\x15\n" + "\x11RETENTION_RUNTIME\x10\x01\x12\x14\n" + "\x10RETENTION_SOURCE\x10\x02\"\x8c\x02\n" + "\x10OptionTargetType\x12\x17\n" + "\x13TARGET_TYPE_UNKNOWN\x10\x00\x12\x14\n" + "\x10TARGET_TYPE_FILE\x10\x01\x12\x1f\n" + "\x1bTARGET_TYPE_EXTENSION_RANGE\x10\x02\x12\x17\n" + "\x13TARGET_TYPE_MESSAGE\x10\x03\x12\x15\n" + "\x11TARGET_TYPE_FIELD\x10\x04\x12\x15\n" + "\x11TARGET_TYPE_ONEOF\x10\x05\x12\x14\n" + "\x10TARGET_TYPE_ENUM\x10\x06\x12\x1a\n" + "\x16TARGET_TYPE_ENUM_ENTRY\x10\a\x12\x17\n" + "\x13TARGET_TYPE_SERVICE\x10\b\x12\x16\n" + "\x12TARGET_TYPE_METHOD\x10\t*\t\b\xe8\a\x10\x80\x80\x80\x80\x02J\x04\b\x04\x10\x05J\x04\b\x12\x10\x13\"\xac\x01\n" + "\fOneofOptions\x127\n" + "\bfeatures\x18\x01 \x01(\v2\x1b.google.protobuf.FeatureSetR\bfeatures\x12X\n" + "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\xd1\x02\n" + "\vEnumOptions\x12\x1f\n" + "\vallow_alias\x18\x02 \x01(\bR\n" + "allowAlias\x12%\n" + "\n" + "deprecated\x18\x03 \x01(\b:\x05falseR\n" + "deprecated\x12V\n" + "&deprecated_legacy_json_field_conflicts\x18\x06 \x01(\bB\x02\x18\x01R\"deprecatedLegacyJsonFieldConflicts\x127\n" + "\bfeatures\x18\a \x01(\v2\x1b.google.protobuf.FeatureSetR\bfeatures\x12X\n" + "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\t\b\xe8\a\x10\x80\x80\x80\x80\x02J\x04\b\x05\x10\x06\"\xd8\x02\n" + "\x10EnumValueOptions\x12%\n" + "\n" + "deprecated\x18\x01 \x01(\b:\x05falseR\n" + "deprecated\x127\n" + "\bfeatures\x18\x02 \x01(\v2\x1b.google.protobuf.FeatureSetR\bfeatures\x12(\n" + "\fdebug_redact\x18\x03 \x01(\b:\x05falseR\vdebugRedact\x12U\n" + "\x0ffeature_support\x18\x04 \x01(\v2,.google.protobuf.FieldOptions.FeatureSupportR\x0efeatureSupport\x12X\n" + "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\xd5\x01\n" + "\x0eServiceOptions\x127\n" + "\bfeatures\x18\" \x01(\v2\x1b.google.protobuf.FeatureSetR\bfeatures\x12%\n" + "\n" + "deprecated\x18! \x01(\b:\x05falseR\n" + "deprecated\x12X\n" + "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\x99\x03\n" + "\rMethodOptions\x12%\n" + "\n" + "deprecated\x18! \x01(\b:\x05falseR\n" + "deprecated\x12q\n" + "\x11idempotency_level\x18\" \x01(\x0e2/.google.protobuf.MethodOptions.IdempotencyLevel:\x13IDEMPOTENCY_UNKNOWNR\x10idempotencyLevel\x127\n" + "\bfeatures\x18# \x01(\v2\x1b.google.protobuf.FeatureSetR\bfeatures\x12X\n" + "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption\"P\n" + "\x10IdempotencyLevel\x12\x17\n" + "\x13IDEMPOTENCY_UNKNOWN\x10\x00\x12\x13\n" + "\x0fNO_SIDE_EFFECTS\x10\x01\x12\x0e\n" + "\n" + "IDEMPOTENT\x10\x02*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\x9a\x03\n" + "\x13UninterpretedOption\x12A\n" + "\x04name\x18\x02 \x03(\v2-.google.protobuf.UninterpretedOption.NamePartR\x04name\x12)\n" + "\x10identifier_value\x18\x03 \x01(\tR\x0fidentifierValue\x12,\n" + "\x12positive_int_value\x18\x04 \x01(\x04R\x10positiveIntValue\x12,\n" + "\x12negative_int_value\x18\x05 \x01(\x03R\x10negativeIntValue\x12!\n" + "\fdouble_value\x18\x06 \x01(\x01R\vdoubleValue\x12!\n" + "\fstring_value\x18\a \x01(\fR\vstringValue\x12'\n" + "\x0faggregate_value\x18\b \x01(\tR\x0eaggregateValue\x1aJ\n" + "\bNamePart\x12\x1b\n" + "\tname_part\x18\x01 \x02(\tR\bnamePart\x12!\n" + "\fis_extension\x18\x02 \x02(\bR\visExtension\"\x8e\x0f\n" + "\n" + "FeatureSet\x12\x91\x01\n" + "\x0efield_presence\x18\x01 \x01(\x0e2).google.protobuf.FeatureSet.FieldPresenceB?\x88\x01\x01\x98\x01\x04\x98\x01\x01\xa2\x01\r\x12\bEXPLICIT\x18\x84\a\xa2\x01\r\x12\bIMPLICIT\x18\xe7\a\xa2\x01\r\x12\bEXPLICIT\x18\xe8\a\xb2\x01\x03\b\xe8\aR\rfieldPresence\x12l\n" + "\tenum_type\x18\x02 \x01(\x0e2$.google.protobuf.FeatureSet.EnumTypeB)\x88\x01\x01\x98\x01\x06\x98\x01\x01\xa2\x01\v\x12\x06CLOSED\x18\x84\a\xa2\x01\t\x12\x04OPEN\x18\xe7\a\xb2\x01\x03\b\xe8\aR\benumType\x12\x98\x01\n" + "\x17repeated_field_encoding\x18\x03 \x01(\x0e21.google.protobuf.FeatureSet.RepeatedFieldEncodingB-\x88\x01\x01\x98\x01\x04\x98\x01\x01\xa2\x01\r\x12\bEXPANDED\x18\x84\a\xa2\x01\v\x12\x06PACKED\x18\xe7\a\xb2\x01\x03\b\xe8\aR\x15repeatedFieldEncoding\x12~\n" + "\x0futf8_validation\x18\x04 \x01(\x0e2*.google.protobuf.FeatureSet.Utf8ValidationB)\x88\x01\x01\x98\x01\x04\x98\x01\x01\xa2\x01\t\x12\x04NONE\x18\x84\a\xa2\x01\v\x12\x06VERIFY\x18\xe7\a\xb2\x01\x03\b\xe8\aR\x0eutf8Validation\x12~\n" + "\x10message_encoding\x18\x05 \x01(\x0e2+.google.protobuf.FeatureSet.MessageEncodingB&\x88\x01\x01\x98\x01\x04\x98\x01\x01\xa2\x01\x14\x12\x0fLENGTH_PREFIXED\x18\x84\a\xb2\x01\x03\b\xe8\aR\x0fmessageEncoding\x12\x82\x01\n" + "\vjson_format\x18\x06 \x01(\x0e2&.google.protobuf.FeatureSet.JsonFormatB9\x88\x01\x01\x98\x01\x03\x98\x01\x06\x98\x01\x01\xa2\x01\x17\x12\x12LEGACY_BEST_EFFORT\x18\x84\a\xa2\x01\n" + "\x12\x05ALLOW\x18\xe7\a\xb2\x01\x03\b\xe8\aR\n" + "jsonFormat\x12\xab\x01\n" + "\x14enforce_naming_style\x18\a \x01(\x0e2..google.protobuf.FeatureSet.EnforceNamingStyleBI\x88\x01\x02\x98\x01\x01\x98\x01\x02\x98\x01\x03\x98\x01\x04\x98\x01\x05\x98\x01\x06\x98\x01\a\x98\x01\b\x98\x01\t\xa2\x01\x11\x12\fSTYLE_LEGACY\x18\x84\a\xa2\x01\x0e\x12\tSTYLE2024\x18\xe9\a\xb2\x01\x03\b\xe9\aR\x12enforceNamingStyle\x12\xb9\x01\n" + "\x19default_symbol_visibility\x18\b \x01(\x0e2E.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibilityB6\x88\x01\x02\x98\x01\x01\xa2\x01\x0f\x12\n" + "EXPORT_ALL\x18\x84\a\xa2\x01\x15\x12\x10EXPORT_TOP_LEVEL\x18\xe9\a\xb2\x01\x03\b\xe9\aR\x17defaultSymbolVisibility\x1a\xa1\x01\n" + "\x11VisibilityFeature\"\x81\x01\n" + "\x17DefaultSymbolVisibility\x12%\n" + "!DEFAULT_SYMBOL_VISIBILITY_UNKNOWN\x10\x00\x12\x0e\n" + "\n" + "EXPORT_ALL\x10\x01\x12\x14\n" + "\x10EXPORT_TOP_LEVEL\x10\x02\x12\r\n" + "\tLOCAL_ALL\x10\x03\x12\n" + "\n" + "\x06STRICT\x10\x04J\b\b\x01\x10\x80\x80\x80\x80\x02\"\\\n" + "\rFieldPresence\x12\x1a\n" + "\x16FIELD_PRESENCE_UNKNOWN\x10\x00\x12\f\n" + "\bEXPLICIT\x10\x01\x12\f\n" + "\bIMPLICIT\x10\x02\x12\x13\n" + "\x0fLEGACY_REQUIRED\x10\x03\"7\n" + "\bEnumType\x12\x15\n" + "\x11ENUM_TYPE_UNKNOWN\x10\x00\x12\b\n" + "\x04OPEN\x10\x01\x12\n" + "\n" + "\x06CLOSED\x10\x02\"V\n" + "\x15RepeatedFieldEncoding\x12#\n" + "\x1fREPEATED_FIELD_ENCODING_UNKNOWN\x10\x00\x12\n" + "\n" + "\x06PACKED\x10\x01\x12\f\n" + "\bEXPANDED\x10\x02\"I\n" + "\x0eUtf8Validation\x12\x1b\n" + "\x17UTF8_VALIDATION_UNKNOWN\x10\x00\x12\n" + "\n" + "\x06VERIFY\x10\x02\x12\b\n" + "\x04NONE\x10\x03\"\x04\b\x01\x10\x01\"S\n" + "\x0fMessageEncoding\x12\x1c\n" + "\x18MESSAGE_ENCODING_UNKNOWN\x10\x00\x12\x13\n" + "\x0fLENGTH_PREFIXED\x10\x01\x12\r\n" + "\tDELIMITED\x10\x02\"H\n" + "\n" + "JsonFormat\x12\x17\n" + "\x13JSON_FORMAT_UNKNOWN\x10\x00\x12\t\n" + "\x05ALLOW\x10\x01\x12\x16\n" + "\x12LEGACY_BEST_EFFORT\x10\x02\"W\n" + "\x12EnforceNamingStyle\x12 \n" + "\x1cENFORCE_NAMING_STYLE_UNKNOWN\x10\x00\x12\r\n" + "\tSTYLE2024\x10\x01\x12\x10\n" + "\fSTYLE_LEGACY\x10\x02*\x06\b\xe8\a\x10\x8bN*\x06\b\x8bN\x10\x90N*\x06\b\x90N\x10\x91NJ\x06\b\xe7\a\x10\xe8\a\"\xef\x03\n" + "\x12FeatureSetDefaults\x12X\n" + "\bdefaults\x18\x01 \x03(\v2<.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefaultR\bdefaults\x12A\n" + "\x0fminimum_edition\x18\x04 \x01(\x0e2\x18.google.protobuf.EditionR\x0eminimumEdition\x12A\n" + "\x0fmaximum_edition\x18\x05 \x01(\x0e2\x18.google.protobuf.EditionR\x0emaximumEdition\x1a\xf8\x01\n" + "\x18FeatureSetEditionDefault\x122\n" + "\aedition\x18\x03 \x01(\x0e2\x18.google.protobuf.EditionR\aedition\x12N\n" + "\x14overridable_features\x18\x04 \x01(\v2\x1b.google.protobuf.FeatureSetR\x13overridableFeatures\x12B\n" + "\x0efixed_features\x18\x05 \x01(\v2\x1b.google.protobuf.FeatureSetR\rfixedFeaturesJ\x04\b\x01\x10\x02J\x04\b\x02\x10\x03R\bfeatures\"\xb5\x02\n" + "\x0eSourceCodeInfo\x12D\n" + "\blocation\x18\x01 \x03(\v2(.google.protobuf.SourceCodeInfo.LocationR\blocation\x1a\xce\x01\n" + "\bLocation\x12\x16\n" + "\x04path\x18\x01 \x03(\x05B\x02\x10\x01R\x04path\x12\x16\n" + "\x04span\x18\x02 \x03(\x05B\x02\x10\x01R\x04span\x12)\n" + "\x10leading_comments\x18\x03 \x01(\tR\x0fleadingComments\x12+\n" + "\x11trailing_comments\x18\x04 \x01(\tR\x10trailingComments\x12:\n" + "\x19leading_detached_comments\x18\x06 \x03(\tR\x17leadingDetachedComments*\f\b\x80\xec\xca\xff\x01\x10\x81\xec\xca\xff\x01\"\xd0\x02\n" + "\x11GeneratedCodeInfo\x12M\n" + "\n" + "annotation\x18\x01 \x03(\v2-.google.protobuf.GeneratedCodeInfo.AnnotationR\n" + "annotation\x1a\xeb\x01\n" + "\n" + "Annotation\x12\x16\n" + "\x04path\x18\x01 \x03(\x05B\x02\x10\x01R\x04path\x12\x1f\n" + "\vsource_file\x18\x02 \x01(\tR\n" + "sourceFile\x12\x14\n" + "\x05begin\x18\x03 \x01(\x05R\x05begin\x12\x10\n" + "\x03end\x18\x04 \x01(\x05R\x03end\x12R\n" + "\bsemantic\x18\x05 \x01(\x0e26.google.protobuf.GeneratedCodeInfo.Annotation.SemanticR\bsemantic\"(\n" + "\bSemantic\x12\b\n" + "\x04NONE\x10\x00\x12\a\n" + "\x03SET\x10\x01\x12\t\n" + "\x05ALIAS\x10\x02*\xbe\x02\n" + "\aEdition\x12\x13\n" + "\x0fEDITION_UNKNOWN\x10\x00\x12\x13\n" + "\x0eEDITION_LEGACY\x10\x84\a\x12\x13\n" + "\x0eEDITION_PROTO2\x10\xe6\a\x12\x13\n" + "\x0eEDITION_PROTO3\x10\xe7\a\x12\x11\n" + "\fEDITION_2023\x10\xe8\a\x12\x11\n" + "\fEDITION_2024\x10\xe9\a\x12\x15\n" + "\x10EDITION_UNSTABLE\x10\x8fN\x12\x17\n" + "\x13EDITION_1_TEST_ONLY\x10\x01\x12\x17\n" + "\x13EDITION_2_TEST_ONLY\x10\x02\x12\x1d\n" + "\x17EDITION_99997_TEST_ONLY\x10\x9d\x8d\x06\x12\x1d\n" + "\x17EDITION_99998_TEST_ONLY\x10\x9e\x8d\x06\x12\x1d\n" + "\x17EDITION_99999_TEST_ONLY\x10\x9f\x8d\x06\x12\x13\n" + "\vEDITION_MAX\x10\xff\xff\xff\xff\a*U\n" + "\x10SymbolVisibility\x12\x14\n" + "\x10VISIBILITY_UNSET\x10\x00\x12\x14\n" + "\x10VISIBILITY_LOCAL\x10\x01\x12\x15\n" + "\x11VISIBILITY_EXPORT\x10\x02B~\n" + "\x13com.google.protobufB\x10DescriptorProtosH\x01Z-google.golang.org/protobuf/types/descriptorpb\xf8\x01\x01\xa2\x02\x03GPB\xaa\x02\x1aGoogle.Protobuf.Reflection" var ( file_google_protobuf_descriptor_proto_rawDescOnce sync.Once file_google_protobuf_descriptor_proto_rawDescData []byte ) func file_google_protobuf_descriptor_proto_rawDescGZIP() []byte { file_google_protobuf_descriptor_proto_rawDescOnce.Do(func() { file_google_protobuf_descriptor_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_google_protobuf_descriptor_proto_rawDesc), len(file_google_protobuf_descriptor_proto_rawDesc))) }) return file_google_protobuf_descriptor_proto_rawDescData } var file_google_protobuf_descriptor_proto_enumTypes = make([]protoimpl.EnumInfo, 20) var file_google_protobuf_descriptor_proto_msgTypes = make([]protoimpl.MessageInfo, 34) var file_google_protobuf_descriptor_proto_goTypes = []any{ (Edition)(0), // 0: google.protobuf.Edition (SymbolVisibility)(0), // 1: google.protobuf.SymbolVisibility (ExtensionRangeOptions_VerificationState)(0), // 2: google.protobuf.ExtensionRangeOptions.VerificationState (FieldDescriptorProto_Type)(0), // 3: google.protobuf.FieldDescriptorProto.Type (FieldDescriptorProto_Label)(0), // 4: google.protobuf.FieldDescriptorProto.Label (FileOptions_OptimizeMode)(0), // 5: google.protobuf.FileOptions.OptimizeMode (FieldOptions_CType)(0), // 6: google.protobuf.FieldOptions.CType (FieldOptions_JSType)(0), // 7: google.protobuf.FieldOptions.JSType (FieldOptions_OptionRetention)(0), // 8: google.protobuf.FieldOptions.OptionRetention (FieldOptions_OptionTargetType)(0), // 9: google.protobuf.FieldOptions.OptionTargetType (MethodOptions_IdempotencyLevel)(0), // 10: google.protobuf.MethodOptions.IdempotencyLevel (FeatureSet_FieldPresence)(0), // 11: google.protobuf.FeatureSet.FieldPresence (FeatureSet_EnumType)(0), // 12: google.protobuf.FeatureSet.EnumType (FeatureSet_RepeatedFieldEncoding)(0), // 13: google.protobuf.FeatureSet.RepeatedFieldEncoding (FeatureSet_Utf8Validation)(0), // 14: google.protobuf.FeatureSet.Utf8Validation (FeatureSet_MessageEncoding)(0), // 15: google.protobuf.FeatureSet.MessageEncoding (FeatureSet_JsonFormat)(0), // 16: google.protobuf.FeatureSet.JsonFormat (FeatureSet_EnforceNamingStyle)(0), // 17: google.protobuf.FeatureSet.EnforceNamingStyle (FeatureSet_VisibilityFeature_DefaultSymbolVisibility)(0), // 18: google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility (GeneratedCodeInfo_Annotation_Semantic)(0), // 19: google.protobuf.GeneratedCodeInfo.Annotation.Semantic (*FileDescriptorSet)(nil), // 20: google.protobuf.FileDescriptorSet (*FileDescriptorProto)(nil), // 21: google.protobuf.FileDescriptorProto (*DescriptorProto)(nil), // 22: google.protobuf.DescriptorProto (*ExtensionRangeOptions)(nil), // 23: google.protobuf.ExtensionRangeOptions (*FieldDescriptorProto)(nil), // 24: google.protobuf.FieldDescriptorProto (*OneofDescriptorProto)(nil), // 25: google.protobuf.OneofDescriptorProto (*EnumDescriptorProto)(nil), // 26: google.protobuf.EnumDescriptorProto (*EnumValueDescriptorProto)(nil), // 27: google.protobuf.EnumValueDescriptorProto (*ServiceDescriptorProto)(nil), // 28: google.protobuf.ServiceDescriptorProto (*MethodDescriptorProto)(nil), // 29: google.protobuf.MethodDescriptorProto (*FileOptions)(nil), // 30: google.protobuf.FileOptions (*MessageOptions)(nil), // 31: google.protobuf.MessageOptions (*FieldOptions)(nil), // 32: google.protobuf.FieldOptions (*OneofOptions)(nil), // 33: google.protobuf.OneofOptions (*EnumOptions)(nil), // 34: google.protobuf.EnumOptions (*EnumValueOptions)(nil), // 35: google.protobuf.EnumValueOptions (*ServiceOptions)(nil), // 36: google.protobuf.ServiceOptions (*MethodOptions)(nil), // 37: google.protobuf.MethodOptions (*UninterpretedOption)(nil), // 38: google.protobuf.UninterpretedOption (*FeatureSet)(nil), // 39: google.protobuf.FeatureSet (*FeatureSetDefaults)(nil), // 40: google.protobuf.FeatureSetDefaults (*SourceCodeInfo)(nil), // 41: google.protobuf.SourceCodeInfo (*GeneratedCodeInfo)(nil), // 42: google.protobuf.GeneratedCodeInfo (*DescriptorProto_ExtensionRange)(nil), // 43: google.protobuf.DescriptorProto.ExtensionRange (*DescriptorProto_ReservedRange)(nil), // 44: google.protobuf.DescriptorProto.ReservedRange (*ExtensionRangeOptions_Declaration)(nil), // 45: google.protobuf.ExtensionRangeOptions.Declaration (*EnumDescriptorProto_EnumReservedRange)(nil), // 46: google.protobuf.EnumDescriptorProto.EnumReservedRange (*FieldOptions_EditionDefault)(nil), // 47: google.protobuf.FieldOptions.EditionDefault (*FieldOptions_FeatureSupport)(nil), // 48: google.protobuf.FieldOptions.FeatureSupport (*UninterpretedOption_NamePart)(nil), // 49: google.protobuf.UninterpretedOption.NamePart (*FeatureSet_VisibilityFeature)(nil), // 50: google.protobuf.FeatureSet.VisibilityFeature (*FeatureSetDefaults_FeatureSetEditionDefault)(nil), // 51: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault (*SourceCodeInfo_Location)(nil), // 52: google.protobuf.SourceCodeInfo.Location (*GeneratedCodeInfo_Annotation)(nil), // 53: google.protobuf.GeneratedCodeInfo.Annotation } var file_google_protobuf_descriptor_proto_depIdxs = []int32{ 21, // 0: google.protobuf.FileDescriptorSet.file:type_name -> google.protobuf.FileDescriptorProto 22, // 1: google.protobuf.FileDescriptorProto.message_type:type_name -> google.protobuf.DescriptorProto 26, // 2: google.protobuf.FileDescriptorProto.enum_type:type_name -> google.protobuf.EnumDescriptorProto 28, // 3: google.protobuf.FileDescriptorProto.service:type_name -> google.protobuf.ServiceDescriptorProto 24, // 4: google.protobuf.FileDescriptorProto.extension:type_name -> google.protobuf.FieldDescriptorProto 30, // 5: google.protobuf.FileDescriptorProto.options:type_name -> google.protobuf.FileOptions 41, // 6: google.protobuf.FileDescriptorProto.source_code_info:type_name -> google.protobuf.SourceCodeInfo 0, // 7: google.protobuf.FileDescriptorProto.edition:type_name -> google.protobuf.Edition 24, // 8: google.protobuf.DescriptorProto.field:type_name -> google.protobuf.FieldDescriptorProto 24, // 9: google.protobuf.DescriptorProto.extension:type_name -> google.protobuf.FieldDescriptorProto 22, // 10: google.protobuf.DescriptorProto.nested_type:type_name -> google.protobuf.DescriptorProto 26, // 11: google.protobuf.DescriptorProto.enum_type:type_name -> google.protobuf.EnumDescriptorProto 43, // 12: google.protobuf.DescriptorProto.extension_range:type_name -> google.protobuf.DescriptorProto.ExtensionRange 25, // 13: google.protobuf.DescriptorProto.oneof_decl:type_name -> google.protobuf.OneofDescriptorProto 31, // 14: google.protobuf.DescriptorProto.options:type_name -> google.protobuf.MessageOptions 44, // 15: google.protobuf.DescriptorProto.reserved_range:type_name -> google.protobuf.DescriptorProto.ReservedRange 1, // 16: google.protobuf.DescriptorProto.visibility:type_name -> google.protobuf.SymbolVisibility 38, // 17: google.protobuf.ExtensionRangeOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption 45, // 18: google.protobuf.ExtensionRangeOptions.declaration:type_name -> google.protobuf.ExtensionRangeOptions.Declaration 39, // 19: google.protobuf.ExtensionRangeOptions.features:type_name -> google.protobuf.FeatureSet 2, // 20: google.protobuf.ExtensionRangeOptions.verification:type_name -> google.protobuf.ExtensionRangeOptions.VerificationState 4, // 21: google.protobuf.FieldDescriptorProto.label:type_name -> google.protobuf.FieldDescriptorProto.Label 3, // 22: google.protobuf.FieldDescriptorProto.type:type_name -> google.protobuf.FieldDescriptorProto.Type 32, // 23: google.protobuf.FieldDescriptorProto.options:type_name -> google.protobuf.FieldOptions 33, // 24: google.protobuf.OneofDescriptorProto.options:type_name -> google.protobuf.OneofOptions 27, // 25: google.protobuf.EnumDescriptorProto.value:type_name -> google.protobuf.EnumValueDescriptorProto 34, // 26: google.protobuf.EnumDescriptorProto.options:type_name -> google.protobuf.EnumOptions 46, // 27: google.protobuf.EnumDescriptorProto.reserved_range:type_name -> google.protobuf.EnumDescriptorProto.EnumReservedRange 1, // 28: google.protobuf.EnumDescriptorProto.visibility:type_name -> google.protobuf.SymbolVisibility 35, // 29: google.protobuf.EnumValueDescriptorProto.options:type_name -> google.protobuf.EnumValueOptions 29, // 30: google.protobuf.ServiceDescriptorProto.method:type_name -> google.protobuf.MethodDescriptorProto 36, // 31: google.protobuf.ServiceDescriptorProto.options:type_name -> google.protobuf.ServiceOptions 37, // 32: google.protobuf.MethodDescriptorProto.options:type_name -> google.protobuf.MethodOptions 5, // 33: google.protobuf.FileOptions.optimize_for:type_name -> google.protobuf.FileOptions.OptimizeMode 39, // 34: google.protobuf.FileOptions.features:type_name -> google.protobuf.FeatureSet 38, // 35: google.protobuf.FileOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption 39, // 36: google.protobuf.MessageOptions.features:type_name -> google.protobuf.FeatureSet 38, // 37: google.protobuf.MessageOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption 6, // 38: google.protobuf.FieldOptions.ctype:type_name -> google.protobuf.FieldOptions.CType 7, // 39: google.protobuf.FieldOptions.jstype:type_name -> google.protobuf.FieldOptions.JSType 8, // 40: google.protobuf.FieldOptions.retention:type_name -> google.protobuf.FieldOptions.OptionRetention 9, // 41: google.protobuf.FieldOptions.targets:type_name -> google.protobuf.FieldOptions.OptionTargetType 47, // 42: google.protobuf.FieldOptions.edition_defaults:type_name -> google.protobuf.FieldOptions.EditionDefault 39, // 43: google.protobuf.FieldOptions.features:type_name -> google.protobuf.FeatureSet 48, // 44: google.protobuf.FieldOptions.feature_support:type_name -> google.protobuf.FieldOptions.FeatureSupport 38, // 45: google.protobuf.FieldOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption 39, // 46: google.protobuf.OneofOptions.features:type_name -> google.protobuf.FeatureSet 38, // 47: google.protobuf.OneofOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption 39, // 48: google.protobuf.EnumOptions.features:type_name -> google.protobuf.FeatureSet 38, // 49: google.protobuf.EnumOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption 39, // 50: google.protobuf.EnumValueOptions.features:type_name -> google.protobuf.FeatureSet 48, // 51: google.protobuf.EnumValueOptions.feature_support:type_name -> google.protobuf.FieldOptions.FeatureSupport 38, // 52: google.protobuf.EnumValueOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption 39, // 53: google.protobuf.ServiceOptions.features:type_name -> google.protobuf.FeatureSet 38, // 54: google.protobuf.ServiceOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption 10, // 55: google.protobuf.MethodOptions.idempotency_level:type_name -> google.protobuf.MethodOptions.IdempotencyLevel 39, // 56: google.protobuf.MethodOptions.features:type_name -> google.protobuf.FeatureSet 38, // 57: google.protobuf.MethodOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption 49, // 58: google.protobuf.UninterpretedOption.name:type_name -> google.protobuf.UninterpretedOption.NamePart 11, // 59: google.protobuf.FeatureSet.field_presence:type_name -> google.protobuf.FeatureSet.FieldPresence 12, // 60: google.protobuf.FeatureSet.enum_type:type_name -> google.protobuf.FeatureSet.EnumType 13, // 61: google.protobuf.FeatureSet.repeated_field_encoding:type_name -> google.protobuf.FeatureSet.RepeatedFieldEncoding 14, // 62: google.protobuf.FeatureSet.utf8_validation:type_name -> google.protobuf.FeatureSet.Utf8Validation 15, // 63: google.protobuf.FeatureSet.message_encoding:type_name -> google.protobuf.FeatureSet.MessageEncoding 16, // 64: google.protobuf.FeatureSet.json_format:type_name -> google.protobuf.FeatureSet.JsonFormat 17, // 65: google.protobuf.FeatureSet.enforce_naming_style:type_name -> google.protobuf.FeatureSet.EnforceNamingStyle 18, // 66: google.protobuf.FeatureSet.default_symbol_visibility:type_name -> google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility 51, // 67: google.protobuf.FeatureSetDefaults.defaults:type_name -> google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault 0, // 68: google.protobuf.FeatureSetDefaults.minimum_edition:type_name -> google.protobuf.Edition 0, // 69: google.protobuf.FeatureSetDefaults.maximum_edition:type_name -> google.protobuf.Edition 52, // 70: google.protobuf.SourceCodeInfo.location:type_name -> google.protobuf.SourceCodeInfo.Location 53, // 71: google.protobuf.GeneratedCodeInfo.annotation:type_name -> google.protobuf.GeneratedCodeInfo.Annotation 23, // 72: google.protobuf.DescriptorProto.ExtensionRange.options:type_name -> google.protobuf.ExtensionRangeOptions 0, // 73: google.protobuf.FieldOptions.EditionDefault.edition:type_name -> google.protobuf.Edition 0, // 74: google.protobuf.FieldOptions.FeatureSupport.edition_introduced:type_name -> google.protobuf.Edition 0, // 75: google.protobuf.FieldOptions.FeatureSupport.edition_deprecated:type_name -> google.protobuf.Edition 0, // 76: google.protobuf.FieldOptions.FeatureSupport.edition_removed:type_name -> google.protobuf.Edition 0, // 77: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.edition:type_name -> google.protobuf.Edition 39, // 78: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.overridable_features:type_name -> google.protobuf.FeatureSet 39, // 79: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fixed_features:type_name -> google.protobuf.FeatureSet 19, // 80: google.protobuf.GeneratedCodeInfo.Annotation.semantic:type_name -> google.protobuf.GeneratedCodeInfo.Annotation.Semantic 81, // [81:81] is the sub-list for method output_type 81, // [81:81] is the sub-list for method input_type 81, // [81:81] is the sub-list for extension type_name 81, // [81:81] is the sub-list for extension extendee 0, // [0:81] is the sub-list for field type_name } func init() { file_google_protobuf_descriptor_proto_init() } func file_google_protobuf_descriptor_proto_init() { if File_google_protobuf_descriptor_proto != nil { return } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_google_protobuf_descriptor_proto_rawDesc), len(file_google_protobuf_descriptor_proto_rawDesc)), NumEnums: 20, NumMessages: 34, NumExtensions: 0, NumServices: 0, }, GoTypes: file_google_protobuf_descriptor_proto_goTypes, DependencyIndexes: file_google_protobuf_descriptor_proto_depIdxs, EnumInfos: file_google_protobuf_descriptor_proto_enumTypes, MessageInfos: file_google_protobuf_descriptor_proto_msgTypes, }.Build() File_google_protobuf_descriptor_proto = out.File file_google_protobuf_descriptor_proto_goTypes = nil file_google_protobuf_descriptor_proto_depIdxs = nil } ================================================ FILE: vendor/google.golang.org/protobuf/types/gofeaturespb/go_features.pb.go ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2023 Google Inc. All rights reserved. // // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd // Code generated by protoc-gen-go. DO NOT EDIT. // source: google/protobuf/go_features.proto package gofeaturespb import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" descriptorpb "google.golang.org/protobuf/types/descriptorpb" reflect "reflect" sync "sync" unsafe "unsafe" ) type GoFeatures_APILevel int32 const ( // API_LEVEL_UNSPECIFIED results in selecting the OPEN API, // but needs to be a separate value to distinguish between // an explicitly set api level or a missing api level. GoFeatures_API_LEVEL_UNSPECIFIED GoFeatures_APILevel = 0 GoFeatures_API_OPEN GoFeatures_APILevel = 1 GoFeatures_API_HYBRID GoFeatures_APILevel = 2 GoFeatures_API_OPAQUE GoFeatures_APILevel = 3 ) // Enum value maps for GoFeatures_APILevel. var ( GoFeatures_APILevel_name = map[int32]string{ 0: "API_LEVEL_UNSPECIFIED", 1: "API_OPEN", 2: "API_HYBRID", 3: "API_OPAQUE", } GoFeatures_APILevel_value = map[string]int32{ "API_LEVEL_UNSPECIFIED": 0, "API_OPEN": 1, "API_HYBRID": 2, "API_OPAQUE": 3, } ) func (x GoFeatures_APILevel) Enum() *GoFeatures_APILevel { p := new(GoFeatures_APILevel) *p = x return p } func (x GoFeatures_APILevel) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (GoFeatures_APILevel) Descriptor() protoreflect.EnumDescriptor { return file_google_protobuf_go_features_proto_enumTypes[0].Descriptor() } func (GoFeatures_APILevel) Type() protoreflect.EnumType { return &file_google_protobuf_go_features_proto_enumTypes[0] } func (x GoFeatures_APILevel) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Do not use. func (x *GoFeatures_APILevel) UnmarshalJSON(b []byte) error { num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) if err != nil { return err } *x = GoFeatures_APILevel(num) return nil } // Deprecated: Use GoFeatures_APILevel.Descriptor instead. func (GoFeatures_APILevel) EnumDescriptor() ([]byte, []int) { return file_google_protobuf_go_features_proto_rawDescGZIP(), []int{0, 0} } type GoFeatures_StripEnumPrefix int32 const ( GoFeatures_STRIP_ENUM_PREFIX_UNSPECIFIED GoFeatures_StripEnumPrefix = 0 GoFeatures_STRIP_ENUM_PREFIX_KEEP GoFeatures_StripEnumPrefix = 1 GoFeatures_STRIP_ENUM_PREFIX_GENERATE_BOTH GoFeatures_StripEnumPrefix = 2 GoFeatures_STRIP_ENUM_PREFIX_STRIP GoFeatures_StripEnumPrefix = 3 ) // Enum value maps for GoFeatures_StripEnumPrefix. var ( GoFeatures_StripEnumPrefix_name = map[int32]string{ 0: "STRIP_ENUM_PREFIX_UNSPECIFIED", 1: "STRIP_ENUM_PREFIX_KEEP", 2: "STRIP_ENUM_PREFIX_GENERATE_BOTH", 3: "STRIP_ENUM_PREFIX_STRIP", } GoFeatures_StripEnumPrefix_value = map[string]int32{ "STRIP_ENUM_PREFIX_UNSPECIFIED": 0, "STRIP_ENUM_PREFIX_KEEP": 1, "STRIP_ENUM_PREFIX_GENERATE_BOTH": 2, "STRIP_ENUM_PREFIX_STRIP": 3, } ) func (x GoFeatures_StripEnumPrefix) Enum() *GoFeatures_StripEnumPrefix { p := new(GoFeatures_StripEnumPrefix) *p = x return p } func (x GoFeatures_StripEnumPrefix) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (GoFeatures_StripEnumPrefix) Descriptor() protoreflect.EnumDescriptor { return file_google_protobuf_go_features_proto_enumTypes[1].Descriptor() } func (GoFeatures_StripEnumPrefix) Type() protoreflect.EnumType { return &file_google_protobuf_go_features_proto_enumTypes[1] } func (x GoFeatures_StripEnumPrefix) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Do not use. func (x *GoFeatures_StripEnumPrefix) UnmarshalJSON(b []byte) error { num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) if err != nil { return err } *x = GoFeatures_StripEnumPrefix(num) return nil } // Deprecated: Use GoFeatures_StripEnumPrefix.Descriptor instead. func (GoFeatures_StripEnumPrefix) EnumDescriptor() ([]byte, []int) { return file_google_protobuf_go_features_proto_rawDescGZIP(), []int{0, 1} } type GoFeatures struct { state protoimpl.MessageState `protogen:"open.v1"` // Whether or not to generate the deprecated UnmarshalJSON method for enums. // Can only be true for proto using the Open Struct api. LegacyUnmarshalJsonEnum *bool `protobuf:"varint,1,opt,name=legacy_unmarshal_json_enum,json=legacyUnmarshalJsonEnum" json:"legacy_unmarshal_json_enum,omitempty"` // One of OPEN, HYBRID or OPAQUE. ApiLevel *GoFeatures_APILevel `protobuf:"varint,2,opt,name=api_level,json=apiLevel,enum=pb.GoFeatures_APILevel" json:"api_level,omitempty"` StripEnumPrefix *GoFeatures_StripEnumPrefix `protobuf:"varint,3,opt,name=strip_enum_prefix,json=stripEnumPrefix,enum=pb.GoFeatures_StripEnumPrefix" json:"strip_enum_prefix,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *GoFeatures) Reset() { *x = GoFeatures{} mi := &file_google_protobuf_go_features_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *GoFeatures) String() string { return protoimpl.X.MessageStringOf(x) } func (*GoFeatures) ProtoMessage() {} func (x *GoFeatures) ProtoReflect() protoreflect.Message { mi := &file_google_protobuf_go_features_proto_msgTypes[0] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use GoFeatures.ProtoReflect.Descriptor instead. func (*GoFeatures) Descriptor() ([]byte, []int) { return file_google_protobuf_go_features_proto_rawDescGZIP(), []int{0} } func (x *GoFeatures) GetLegacyUnmarshalJsonEnum() bool { if x != nil && x.LegacyUnmarshalJsonEnum != nil { return *x.LegacyUnmarshalJsonEnum } return false } func (x *GoFeatures) GetApiLevel() GoFeatures_APILevel { if x != nil && x.ApiLevel != nil { return *x.ApiLevel } return GoFeatures_API_LEVEL_UNSPECIFIED } func (x *GoFeatures) GetStripEnumPrefix() GoFeatures_StripEnumPrefix { if x != nil && x.StripEnumPrefix != nil { return *x.StripEnumPrefix } return GoFeatures_STRIP_ENUM_PREFIX_UNSPECIFIED } var file_google_protobuf_go_features_proto_extTypes = []protoimpl.ExtensionInfo{ { ExtendedType: (*descriptorpb.FeatureSet)(nil), ExtensionType: (*GoFeatures)(nil), Field: 1002, Name: "pb.go", Tag: "bytes,1002,opt,name=go", Filename: "google/protobuf/go_features.proto", }, } // Extension fields to descriptorpb.FeatureSet. var ( // optional pb.GoFeatures go = 1002; E_Go = &file_google_protobuf_go_features_proto_extTypes[0] ) var File_google_protobuf_go_features_proto protoreflect.FileDescriptor const file_google_protobuf_go_features_proto_rawDesc = "" + "\n" + "!google/protobuf/go_features.proto\x12\x02pb\x1a google/protobuf/descriptor.proto\"\xab\x05\n" + "\n" + "GoFeatures\x12\xbe\x01\n" + "\x1alegacy_unmarshal_json_enum\x18\x01 \x01(\bB\x80\x01\x88\x01\x01\x98\x01\x06\x98\x01\x01\xa2\x01\t\x12\x04true\x18\x84\a\xa2\x01\n" + "\x12\x05false\x18\xe7\a\xb2\x01[\b\xe8\a\x10\xe8\a\x1aSThe legacy UnmarshalJSON API is deprecated and will be removed in a future edition.R\x17legacyUnmarshalJsonEnum\x12t\n" + "\tapi_level\x18\x02 \x01(\x0e2\x17.pb.GoFeatures.APILevelB>\x88\x01\x01\x98\x01\x03\x98\x01\x01\xa2\x01\x1a\x12\x15API_LEVEL_UNSPECIFIED\x18\x84\a\xa2\x01\x0f\x12\n" + "API_OPAQUE\x18\xe9\a\xb2\x01\x03\b\xe8\aR\bapiLevel\x12|\n" + "\x11strip_enum_prefix\x18\x03 \x01(\x0e2\x1e.pb.GoFeatures.StripEnumPrefixB0\x88\x01\x01\x98\x01\x06\x98\x01\a\x98\x01\x01\xa2\x01\x1b\x12\x16STRIP_ENUM_PREFIX_KEEP\x18\x84\a\xb2\x01\x03\b\xe9\aR\x0fstripEnumPrefix\"S\n" + "\bAPILevel\x12\x19\n" + "\x15API_LEVEL_UNSPECIFIED\x10\x00\x12\f\n" + "\bAPI_OPEN\x10\x01\x12\x0e\n" + "\n" + "API_HYBRID\x10\x02\x12\x0e\n" + "\n" + "API_OPAQUE\x10\x03\"\x92\x01\n" + "\x0fStripEnumPrefix\x12!\n" + "\x1dSTRIP_ENUM_PREFIX_UNSPECIFIED\x10\x00\x12\x1a\n" + "\x16STRIP_ENUM_PREFIX_KEEP\x10\x01\x12#\n" + "\x1fSTRIP_ENUM_PREFIX_GENERATE_BOTH\x10\x02\x12\x1b\n" + "\x17STRIP_ENUM_PREFIX_STRIP\x10\x03:<\n" + "\x02go\x12\x1b.google.protobuf.FeatureSet\x18\xea\a \x01(\v2\x0e.pb.GoFeaturesR\x02goB/Z-google.golang.org/protobuf/types/gofeaturespb" var ( file_google_protobuf_go_features_proto_rawDescOnce sync.Once file_google_protobuf_go_features_proto_rawDescData []byte ) func file_google_protobuf_go_features_proto_rawDescGZIP() []byte { file_google_protobuf_go_features_proto_rawDescOnce.Do(func() { file_google_protobuf_go_features_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_google_protobuf_go_features_proto_rawDesc), len(file_google_protobuf_go_features_proto_rawDesc))) }) return file_google_protobuf_go_features_proto_rawDescData } var file_google_protobuf_go_features_proto_enumTypes = make([]protoimpl.EnumInfo, 2) var file_google_protobuf_go_features_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_google_protobuf_go_features_proto_goTypes = []any{ (GoFeatures_APILevel)(0), // 0: pb.GoFeatures.APILevel (GoFeatures_StripEnumPrefix)(0), // 1: pb.GoFeatures.StripEnumPrefix (*GoFeatures)(nil), // 2: pb.GoFeatures (*descriptorpb.FeatureSet)(nil), // 3: google.protobuf.FeatureSet } var file_google_protobuf_go_features_proto_depIdxs = []int32{ 0, // 0: pb.GoFeatures.api_level:type_name -> pb.GoFeatures.APILevel 1, // 1: pb.GoFeatures.strip_enum_prefix:type_name -> pb.GoFeatures.StripEnumPrefix 3, // 2: pb.go:extendee -> google.protobuf.FeatureSet 2, // 3: pb.go:type_name -> pb.GoFeatures 4, // [4:4] is the sub-list for method output_type 4, // [4:4] is the sub-list for method input_type 3, // [3:4] is the sub-list for extension type_name 2, // [2:3] is the sub-list for extension extendee 0, // [0:2] is the sub-list for field type_name } func init() { file_google_protobuf_go_features_proto_init() } func file_google_protobuf_go_features_proto_init() { if File_google_protobuf_go_features_proto != nil { return } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_google_protobuf_go_features_proto_rawDesc), len(file_google_protobuf_go_features_proto_rawDesc)), NumEnums: 2, NumMessages: 1, NumExtensions: 1, NumServices: 0, }, GoTypes: file_google_protobuf_go_features_proto_goTypes, DependencyIndexes: file_google_protobuf_go_features_proto_depIdxs, EnumInfos: file_google_protobuf_go_features_proto_enumTypes, MessageInfos: file_google_protobuf_go_features_proto_msgTypes, ExtensionInfos: file_google_protobuf_go_features_proto_extTypes, }.Build() File_google_protobuf_go_features_proto = out.File file_google_protobuf_go_features_proto_goTypes = nil file_google_protobuf_go_features_proto_depIdxs = nil } ================================================ FILE: vendor/google.golang.org/protobuf/types/known/anypb/any.pb.go ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Code generated by protoc-gen-go. DO NOT EDIT. // source: google/protobuf/any.proto // Package anypb contains generated types for google/protobuf/any.proto. // // The Any message is a dynamic representation of any other message value. // It is functionally a tuple of the full name of the remote message type and // the serialized bytes of the remote message value. // // # Constructing an Any // // An Any message containing another message value is constructed using New: // // any, err := anypb.New(m) // if err != nil { // ... // handle error // } // ... // make use of any // // # Unmarshaling an Any // // With a populated Any message, the underlying message can be serialized into // a remote concrete message value in a few ways. // // If the exact concrete type is known, then a new (or pre-existing) instance // of that message can be passed to the UnmarshalTo method: // // m := new(foopb.MyMessage) // if err := any.UnmarshalTo(m); err != nil { // ... // handle error // } // ... // make use of m // // If the exact concrete type is not known, then the UnmarshalNew method can be // used to unmarshal the contents into a new instance of the remote message type: // // m, err := any.UnmarshalNew() // if err != nil { // ... // handle error // } // ... // make use of m // // UnmarshalNew uses the global type registry to resolve the message type and // construct a new instance of that message to unmarshal into. In order for a // message type to appear in the global registry, the Go type representing that // protobuf message type must be linked into the Go binary. For messages // generated by protoc-gen-go, this is achieved through an import of the // generated Go package representing a .proto file. // // A common pattern with UnmarshalNew is to use a type switch with the resulting // proto.Message value: // // switch m := m.(type) { // case *foopb.MyMessage: // ... // make use of m as a *foopb.MyMessage // case *barpb.OtherMessage: // ... // make use of m as a *barpb.OtherMessage // case *bazpb.SomeMessage: // ... // make use of m as a *bazpb.SomeMessage // } // // This pattern ensures that the generated packages containing the message types // listed in the case clauses are linked into the Go binary and therefore also // registered in the global registry. // // # Type checking an Any // // In order to type check whether an Any message represents some other message, // then use the MessageIs method: // // if any.MessageIs((*foopb.MyMessage)(nil)) { // ... // make use of any, knowing that it contains a foopb.MyMessage // } // // The MessageIs method can also be used with an allocated instance of the target // message type if the intention is to unmarshal into it if the type matches: // // m := new(foopb.MyMessage) // if any.MessageIs(m) { // if err := any.UnmarshalTo(m); err != nil { // ... // handle error // } // ... // make use of m // } package anypb import ( proto "google.golang.org/protobuf/proto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoregistry "google.golang.org/protobuf/reflect/protoregistry" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" strings "strings" sync "sync" unsafe "unsafe" ) // `Any` contains an arbitrary serialized protocol buffer message along with a // URL that describes the type of the serialized message. // // Protobuf library provides support to pack/unpack Any values in the form // of utility functions or additional generated methods of the Any type. // // Example 1: Pack and unpack a message in C++. // // Foo foo = ...; // Any any; // any.PackFrom(foo); // ... // if (any.UnpackTo(&foo)) { // ... // } // // Example 2: Pack and unpack a message in Java. // // Foo foo = ...; // Any any = Any.pack(foo); // ... // if (any.is(Foo.class)) { // foo = any.unpack(Foo.class); // } // // or ... // if (any.isSameTypeAs(Foo.getDefaultInstance())) { // foo = any.unpack(Foo.getDefaultInstance()); // } // // Example 3: Pack and unpack a message in Python. // // foo = Foo(...) // any = Any() // any.Pack(foo) // ... // if any.Is(Foo.DESCRIPTOR): // any.Unpack(foo) // ... // // Example 4: Pack and unpack a message in Go // // foo := &pb.Foo{...} // any, err := anypb.New(foo) // if err != nil { // ... // } // ... // foo := &pb.Foo{} // if err := any.UnmarshalTo(foo); err != nil { // ... // } // // The pack methods provided by protobuf library will by default use // 'type.googleapis.com/full.type.name' as the type URL and the unpack // methods only use the fully qualified type name after the last '/' // in the type URL, for example "foo.bar.com/x/y.z" will yield type // name "y.z". // // JSON // ==== // The JSON representation of an `Any` value uses the regular // representation of the deserialized, embedded message, with an // additional field `@type` which contains the type URL. Example: // // package google.profile; // message Person { // string first_name = 1; // string last_name = 2; // } // // { // "@type": "type.googleapis.com/google.profile.Person", // "firstName": , // "lastName": // } // // If the embedded message type is well-known and has a custom JSON // representation, that representation will be embedded adding a field // `value` which holds the custom JSON in addition to the `@type` // field. Example (for message [google.protobuf.Duration][]): // // { // "@type": "type.googleapis.com/google.protobuf.Duration", // "value": "1.212s" // } type Any struct { state protoimpl.MessageState `protogen:"open.v1"` // A URL/resource name that uniquely identifies the type of the serialized // protocol buffer message. This string must contain at least // one "/" character. The last segment of the URL's path must represent // the fully qualified name of the type (as in // `path/google.protobuf.Duration`). The name should be in a canonical form // (e.g., leading "." is not accepted). // // In practice, teams usually precompile into the binary all types that they // expect it to use in the context of Any. However, for URLs which use the // scheme `http`, `https`, or no scheme, one can optionally set up a type // server that maps type URLs to message definitions as follows: // // - If no scheme is provided, `https` is assumed. // - An HTTP GET on the URL must yield a [google.protobuf.Type][] // value in binary format, or produce an error. // - Applications are allowed to cache lookup results based on the // URL, or have them precompiled into a binary to avoid any // lookup. Therefore, binary compatibility needs to be preserved // on changes to types. (Use versioned type names to manage // breaking changes.) // // Note: this functionality is not currently available in the official // protobuf release, and it is not used for type URLs beginning with // type.googleapis.com. As of May 2023, there are no widely used type server // implementations and no plans to implement one. // // Schemes other than `http`, `https` (or the empty scheme) might be // used with implementation specific semantics. TypeUrl string `protobuf:"bytes,1,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"` // Must be a valid serialized protocol buffer of the above specified type. Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } // New marshals src into a new Any instance. func New(src proto.Message) (*Any, error) { dst := new(Any) if err := dst.MarshalFrom(src); err != nil { return nil, err } return dst, nil } // MarshalFrom marshals src into dst as the underlying message // using the provided marshal options. // // If no options are specified, call dst.MarshalFrom instead. func MarshalFrom(dst *Any, src proto.Message, opts proto.MarshalOptions) error { const urlPrefix = "type.googleapis.com/" if src == nil { return protoimpl.X.NewError("invalid nil source message") } b, err := opts.Marshal(src) if err != nil { return err } dst.TypeUrl = urlPrefix + string(src.ProtoReflect().Descriptor().FullName()) dst.Value = b return nil } // UnmarshalTo unmarshals the underlying message from src into dst // using the provided unmarshal options. // It reports an error if dst is not of the right message type. // // If no options are specified, call src.UnmarshalTo instead. func UnmarshalTo(src *Any, dst proto.Message, opts proto.UnmarshalOptions) error { if src == nil { return protoimpl.X.NewError("invalid nil source message") } if !src.MessageIs(dst) { got := dst.ProtoReflect().Descriptor().FullName() want := src.MessageName() return protoimpl.X.NewError("mismatched message type: got %q, want %q", got, want) } return opts.Unmarshal(src.GetValue(), dst) } // UnmarshalNew unmarshals the underlying message from src into dst, // which is newly created message using a type resolved from the type URL. // The message type is resolved according to opt.Resolver, // which should implement protoregistry.MessageTypeResolver. // It reports an error if the underlying message type could not be resolved. // // If no options are specified, call src.UnmarshalNew instead. func UnmarshalNew(src *Any, opts proto.UnmarshalOptions) (dst proto.Message, err error) { if src.GetTypeUrl() == "" { return nil, protoimpl.X.NewError("invalid empty type URL") } if opts.Resolver == nil { opts.Resolver = protoregistry.GlobalTypes } r, ok := opts.Resolver.(protoregistry.MessageTypeResolver) if !ok { return nil, protoregistry.NotFound } mt, err := r.FindMessageByURL(src.GetTypeUrl()) if err != nil { if err == protoregistry.NotFound { return nil, err } return nil, protoimpl.X.NewError("could not resolve %q: %v", src.GetTypeUrl(), err) } dst = mt.New().Interface() return dst, opts.Unmarshal(src.GetValue(), dst) } // MessageIs reports whether the underlying message is of the same type as m. func (x *Any) MessageIs(m proto.Message) bool { if m == nil { return false } url := x.GetTypeUrl() name := string(m.ProtoReflect().Descriptor().FullName()) if !strings.HasSuffix(url, name) { return false } return len(url) == len(name) || url[len(url)-len(name)-1] == '/' } // MessageName reports the full name of the underlying message, // returning an empty string if invalid. func (x *Any) MessageName() protoreflect.FullName { url := x.GetTypeUrl() name := protoreflect.FullName(url) if i := strings.LastIndexByte(url, '/'); i >= 0 { name = name[i+len("/"):] } if !name.IsValid() { return "" } return name } // MarshalFrom marshals m into x as the underlying message. func (x *Any) MarshalFrom(m proto.Message) error { return MarshalFrom(x, m, proto.MarshalOptions{}) } // UnmarshalTo unmarshals the contents of the underlying message of x into m. // It resets m before performing the unmarshal operation. // It reports an error if m is not of the right message type. func (x *Any) UnmarshalTo(m proto.Message) error { return UnmarshalTo(x, m, proto.UnmarshalOptions{}) } // UnmarshalNew unmarshals the contents of the underlying message of x into // a newly allocated message of the specified type. // It reports an error if the underlying message type could not be resolved. func (x *Any) UnmarshalNew() (proto.Message, error) { return UnmarshalNew(x, proto.UnmarshalOptions{}) } func (x *Any) Reset() { *x = Any{} mi := &file_google_protobuf_any_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *Any) String() string { return protoimpl.X.MessageStringOf(x) } func (*Any) ProtoMessage() {} func (x *Any) ProtoReflect() protoreflect.Message { mi := &file_google_protobuf_any_proto_msgTypes[0] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Any.ProtoReflect.Descriptor instead. func (*Any) Descriptor() ([]byte, []int) { return file_google_protobuf_any_proto_rawDescGZIP(), []int{0} } func (x *Any) GetTypeUrl() string { if x != nil { return x.TypeUrl } return "" } func (x *Any) GetValue() []byte { if x != nil { return x.Value } return nil } var File_google_protobuf_any_proto protoreflect.FileDescriptor const file_google_protobuf_any_proto_rawDesc = "" + "\n" + "\x19google/protobuf/any.proto\x12\x0fgoogle.protobuf\"6\n" + "\x03Any\x12\x19\n" + "\btype_url\x18\x01 \x01(\tR\atypeUrl\x12\x14\n" + "\x05value\x18\x02 \x01(\fR\x05valueBv\n" + "\x13com.google.protobufB\bAnyProtoP\x01Z,google.golang.org/protobuf/types/known/anypb\xa2\x02\x03GPB\xaa\x02\x1eGoogle.Protobuf.WellKnownTypesb\x06proto3" var ( file_google_protobuf_any_proto_rawDescOnce sync.Once file_google_protobuf_any_proto_rawDescData []byte ) func file_google_protobuf_any_proto_rawDescGZIP() []byte { file_google_protobuf_any_proto_rawDescOnce.Do(func() { file_google_protobuf_any_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_google_protobuf_any_proto_rawDesc), len(file_google_protobuf_any_proto_rawDesc))) }) return file_google_protobuf_any_proto_rawDescData } var file_google_protobuf_any_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_google_protobuf_any_proto_goTypes = []any{ (*Any)(nil), // 0: google.protobuf.Any } var file_google_protobuf_any_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name } func init() { file_google_protobuf_any_proto_init() } func file_google_protobuf_any_proto_init() { if File_google_protobuf_any_proto != nil { return } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_google_protobuf_any_proto_rawDesc), len(file_google_protobuf_any_proto_rawDesc)), NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, GoTypes: file_google_protobuf_any_proto_goTypes, DependencyIndexes: file_google_protobuf_any_proto_depIdxs, MessageInfos: file_google_protobuf_any_proto_msgTypes, }.Build() File_google_protobuf_any_proto = out.File file_google_protobuf_any_proto_goTypes = nil file_google_protobuf_any_proto_depIdxs = nil } ================================================ FILE: vendor/google.golang.org/protobuf/types/known/durationpb/duration.pb.go ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Code generated by protoc-gen-go. DO NOT EDIT. // source: google/protobuf/duration.proto // Package durationpb contains generated types for google/protobuf/duration.proto. // // The Duration message represents a signed span of time. // // # Conversion to a Go Duration // // The AsDuration method can be used to convert a Duration message to a // standard Go time.Duration value: // // d := dur.AsDuration() // ... // make use of d as a time.Duration // // Converting to a time.Duration is a common operation so that the extensive // set of time-based operations provided by the time package can be leveraged. // See https://golang.org/pkg/time for more information. // // The AsDuration method performs the conversion on a best-effort basis. // Durations with denormal values (e.g., nanoseconds beyond -99999999 and // +99999999, inclusive; or seconds and nanoseconds with opposite signs) // are normalized during the conversion to a time.Duration. To manually check for // invalid Duration per the documented limitations in duration.proto, // additionally call the CheckValid method: // // if err := dur.CheckValid(); err != nil { // ... // handle error // } // // Note that the documented limitations in duration.proto does not protect a // Duration from overflowing the representable range of a time.Duration in Go. // The AsDuration method uses saturation arithmetic such that an overflow clamps // the resulting value to the closest representable value (e.g., math.MaxInt64 // for positive overflow and math.MinInt64 for negative overflow). // // # Conversion from a Go Duration // // The durationpb.New function can be used to construct a Duration message // from a standard Go time.Duration value: // // dur := durationpb.New(d) // ... // make use of d as a *durationpb.Duration package durationpb import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" math "math" reflect "reflect" sync "sync" time "time" unsafe "unsafe" ) // A Duration represents a signed, fixed-length span of time represented // as a count of seconds and fractions of seconds at nanosecond // resolution. It is independent of any calendar and concepts like "day" // or "month". It is related to Timestamp in that the difference between // two Timestamp values is a Duration and it can be added or subtracted // from a Timestamp. Range is approximately +-10,000 years. // // # Examples // // Example 1: Compute Duration from two Timestamps in pseudo code. // // Timestamp start = ...; // Timestamp end = ...; // Duration duration = ...; // // duration.seconds = end.seconds - start.seconds; // duration.nanos = end.nanos - start.nanos; // // if (duration.seconds < 0 && duration.nanos > 0) { // duration.seconds += 1; // duration.nanos -= 1000000000; // } else if (duration.seconds > 0 && duration.nanos < 0) { // duration.seconds -= 1; // duration.nanos += 1000000000; // } // // Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. // // Timestamp start = ...; // Duration duration = ...; // Timestamp end = ...; // // end.seconds = start.seconds + duration.seconds; // end.nanos = start.nanos + duration.nanos; // // if (end.nanos < 0) { // end.seconds -= 1; // end.nanos += 1000000000; // } else if (end.nanos >= 1000000000) { // end.seconds += 1; // end.nanos -= 1000000000; // } // // Example 3: Compute Duration from datetime.timedelta in Python. // // td = datetime.timedelta(days=3, minutes=10) // duration = Duration() // duration.FromTimedelta(td) // // # JSON Mapping // // In JSON format, the Duration type is encoded as a string rather than an // object, where the string ends in the suffix "s" (indicating seconds) and // is preceded by the number of seconds, with nanoseconds expressed as // fractional seconds. For example, 3 seconds with 0 nanoseconds should be // encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should // be expressed in JSON format as "3.000000001s", and 3 seconds and 1 // microsecond should be expressed in JSON format as "3.000001s". type Duration struct { state protoimpl.MessageState `protogen:"open.v1"` // Signed seconds of the span of time. Must be from -315,576,000,000 // to +315,576,000,000 inclusive. Note: these bounds are computed from: // 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years Seconds int64 `protobuf:"varint,1,opt,name=seconds,proto3" json:"seconds,omitempty"` // Signed fractions of a second at nanosecond resolution of the span // of time. Durations less than one second are represented with a 0 // `seconds` field and a positive or negative `nanos` field. For durations // of one second or more, a non-zero value for the `nanos` field must be // of the same sign as the `seconds` field. Must be from -999,999,999 // to +999,999,999 inclusive. Nanos int32 `protobuf:"varint,2,opt,name=nanos,proto3" json:"nanos,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } // New constructs a new Duration from the provided time.Duration. func New(d time.Duration) *Duration { nanos := d.Nanoseconds() secs := nanos / 1e9 nanos -= secs * 1e9 return &Duration{Seconds: int64(secs), Nanos: int32(nanos)} } // AsDuration converts x to a time.Duration, // returning the closest duration value in the event of overflow. func (x *Duration) AsDuration() time.Duration { secs := x.GetSeconds() nanos := x.GetNanos() d := time.Duration(secs) * time.Second overflow := d/time.Second != time.Duration(secs) d += time.Duration(nanos) * time.Nanosecond overflow = overflow || (secs < 0 && nanos < 0 && d > 0) overflow = overflow || (secs > 0 && nanos > 0 && d < 0) if overflow { switch { case secs < 0: return time.Duration(math.MinInt64) case secs > 0: return time.Duration(math.MaxInt64) } } return d } // IsValid reports whether the duration is valid. // It is equivalent to CheckValid == nil. func (x *Duration) IsValid() bool { return x.check() == 0 } // CheckValid returns an error if the duration is invalid. // In particular, it checks whether the value is within the range of // -10000 years to +10000 years inclusive. // An error is reported for a nil Duration. func (x *Duration) CheckValid() error { switch x.check() { case invalidNil: return protoimpl.X.NewError("invalid nil Duration") case invalidUnderflow: return protoimpl.X.NewError("duration (%v) exceeds -10000 years", x) case invalidOverflow: return protoimpl.X.NewError("duration (%v) exceeds +10000 years", x) case invalidNanosRange: return protoimpl.X.NewError("duration (%v) has out-of-range nanos", x) case invalidNanosSign: return protoimpl.X.NewError("duration (%v) has seconds and nanos with different signs", x) default: return nil } } const ( _ = iota invalidNil invalidUnderflow invalidOverflow invalidNanosRange invalidNanosSign ) func (x *Duration) check() uint { const absDuration = 315576000000 // 10000yr * 365.25day/yr * 24hr/day * 60min/hr * 60sec/min secs := x.GetSeconds() nanos := x.GetNanos() switch { case x == nil: return invalidNil case secs < -absDuration: return invalidUnderflow case secs > +absDuration: return invalidOverflow case nanos <= -1e9 || nanos >= +1e9: return invalidNanosRange case (secs > 0 && nanos < 0) || (secs < 0 && nanos > 0): return invalidNanosSign default: return 0 } } func (x *Duration) Reset() { *x = Duration{} mi := &file_google_protobuf_duration_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *Duration) String() string { return protoimpl.X.MessageStringOf(x) } func (*Duration) ProtoMessage() {} func (x *Duration) ProtoReflect() protoreflect.Message { mi := &file_google_protobuf_duration_proto_msgTypes[0] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Duration.ProtoReflect.Descriptor instead. func (*Duration) Descriptor() ([]byte, []int) { return file_google_protobuf_duration_proto_rawDescGZIP(), []int{0} } func (x *Duration) GetSeconds() int64 { if x != nil { return x.Seconds } return 0 } func (x *Duration) GetNanos() int32 { if x != nil { return x.Nanos } return 0 } var File_google_protobuf_duration_proto protoreflect.FileDescriptor const file_google_protobuf_duration_proto_rawDesc = "" + "\n" + "\x1egoogle/protobuf/duration.proto\x12\x0fgoogle.protobuf\":\n" + "\bDuration\x12\x18\n" + "\aseconds\x18\x01 \x01(\x03R\aseconds\x12\x14\n" + "\x05nanos\x18\x02 \x01(\x05R\x05nanosB\x83\x01\n" + "\x13com.google.protobufB\rDurationProtoP\x01Z1google.golang.org/protobuf/types/known/durationpb\xf8\x01\x01\xa2\x02\x03GPB\xaa\x02\x1eGoogle.Protobuf.WellKnownTypesb\x06proto3" var ( file_google_protobuf_duration_proto_rawDescOnce sync.Once file_google_protobuf_duration_proto_rawDescData []byte ) func file_google_protobuf_duration_proto_rawDescGZIP() []byte { file_google_protobuf_duration_proto_rawDescOnce.Do(func() { file_google_protobuf_duration_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_google_protobuf_duration_proto_rawDesc), len(file_google_protobuf_duration_proto_rawDesc))) }) return file_google_protobuf_duration_proto_rawDescData } var file_google_protobuf_duration_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_google_protobuf_duration_proto_goTypes = []any{ (*Duration)(nil), // 0: google.protobuf.Duration } var file_google_protobuf_duration_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name } func init() { file_google_protobuf_duration_proto_init() } func file_google_protobuf_duration_proto_init() { if File_google_protobuf_duration_proto != nil { return } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_google_protobuf_duration_proto_rawDesc), len(file_google_protobuf_duration_proto_rawDesc)), NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, GoTypes: file_google_protobuf_duration_proto_goTypes, DependencyIndexes: file_google_protobuf_duration_proto_depIdxs, MessageInfos: file_google_protobuf_duration_proto_msgTypes, }.Build() File_google_protobuf_duration_proto = out.File file_google_protobuf_duration_proto_goTypes = nil file_google_protobuf_duration_proto_depIdxs = nil } ================================================ FILE: vendor/google.golang.org/protobuf/types/known/timestamppb/timestamp.pb.go ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Code generated by protoc-gen-go. DO NOT EDIT. // source: google/protobuf/timestamp.proto // Package timestamppb contains generated types for google/protobuf/timestamp.proto. // // The Timestamp message represents a timestamp, // an instant in time since the Unix epoch (January 1st, 1970). // // # Conversion to a Go Time // // The AsTime method can be used to convert a Timestamp message to a // standard Go time.Time value in UTC: // // t := ts.AsTime() // ... // make use of t as a time.Time // // Converting to a time.Time is a common operation so that the extensive // set of time-based operations provided by the time package can be leveraged. // See https://golang.org/pkg/time for more information. // // The AsTime method performs the conversion on a best-effort basis. Timestamps // with denormal values (e.g., nanoseconds beyond 0 and 99999999, inclusive) // are normalized during the conversion to a time.Time. To manually check for // invalid Timestamps per the documented limitations in timestamp.proto, // additionally call the CheckValid method: // // if err := ts.CheckValid(); err != nil { // ... // handle error // } // // # Conversion from a Go Time // // The timestamppb.New function can be used to construct a Timestamp message // from a standard Go time.Time value: // // ts := timestamppb.New(t) // ... // make use of ts as a *timestamppb.Timestamp // // In order to construct a Timestamp representing the current time, use Now: // // ts := timestamppb.Now() // ... // make use of ts as a *timestamppb.Timestamp package timestamppb import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" time "time" unsafe "unsafe" ) // A Timestamp represents a point in time independent of any time zone or local // calendar, encoded as a count of seconds and fractions of seconds at // nanosecond resolution. The count is relative to an epoch at UTC midnight on // January 1, 1970, in the proleptic Gregorian calendar which extends the // Gregorian calendar backwards to year one. // // All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap // second table is needed for interpretation, using a [24-hour linear // smear](https://developers.google.com/time/smear). // // The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By // restricting to that range, we ensure that we can convert to and from [RFC // 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. // // # Examples // // Example 1: Compute Timestamp from POSIX `time()`. // // Timestamp timestamp; // timestamp.set_seconds(time(NULL)); // timestamp.set_nanos(0); // // Example 2: Compute Timestamp from POSIX `gettimeofday()`. // // struct timeval tv; // gettimeofday(&tv, NULL); // // Timestamp timestamp; // timestamp.set_seconds(tv.tv_sec); // timestamp.set_nanos(tv.tv_usec * 1000); // // Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. // // FILETIME ft; // GetSystemTimeAsFileTime(&ft); // UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // // // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. // Timestamp timestamp; // timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); // timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); // // Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. // // long millis = System.currentTimeMillis(); // // Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) // .setNanos((int) ((millis % 1000) * 1000000)).build(); // // Example 5: Compute Timestamp from Java `Instant.now()`. // // Instant now = Instant.now(); // // Timestamp timestamp = // Timestamp.newBuilder().setSeconds(now.getEpochSecond()) // .setNanos(now.getNano()).build(); // // Example 6: Compute Timestamp from current time in Python. // // timestamp = Timestamp() // timestamp.GetCurrentTime() // // # JSON Mapping // // In JSON format, the Timestamp type is encoded as a string in the // [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the // format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" // where {year} is always expressed using four digits while {month}, {day}, // {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional // seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), // are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone // is required. A proto3 JSON serializer should always use UTC (as indicated by // "Z") when printing the Timestamp type and a proto3 JSON parser should be // able to accept both UTC and other timezones (as indicated by an offset). // // For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past // 01:30 UTC on January 15, 2017. // // In JavaScript, one can convert a Date object to this format using the // standard // [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) // method. In Python, a standard `datetime.datetime` object can be converted // to this format using // [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with // the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use // the Joda Time's [`ISODateTimeFormat.dateTime()`]( // http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() // ) to obtain a formatter capable of generating timestamps in this format. type Timestamp struct { state protoimpl.MessageState `protogen:"open.v1"` // Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must // be between -315576000000 and 315576000000 inclusive (which corresponds to // 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z). Seconds int64 `protobuf:"varint,1,opt,name=seconds,proto3" json:"seconds,omitempty"` // Non-negative fractions of a second at nanosecond resolution. This field is // the nanosecond portion of the duration, not an alternative to seconds. // Negative second values with fractions must still have non-negative nanos // values that count forward in time. Must be between 0 and 999,999,999 // inclusive. Nanos int32 `protobuf:"varint,2,opt,name=nanos,proto3" json:"nanos,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } // Now constructs a new Timestamp from the current time. func Now() *Timestamp { return New(time.Now()) } // New constructs a new Timestamp from the provided time.Time. func New(t time.Time) *Timestamp { return &Timestamp{Seconds: int64(t.Unix()), Nanos: int32(t.Nanosecond())} } // AsTime converts x to a time.Time. func (x *Timestamp) AsTime() time.Time { return time.Unix(int64(x.GetSeconds()), int64(x.GetNanos())).UTC() } // IsValid reports whether the timestamp is valid. // It is equivalent to CheckValid == nil. func (x *Timestamp) IsValid() bool { return x.check() == 0 } // CheckValid returns an error if the timestamp is invalid. // In particular, it checks whether the value represents a date that is // in the range of 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive. // An error is reported for a nil Timestamp. func (x *Timestamp) CheckValid() error { switch x.check() { case invalidNil: return protoimpl.X.NewError("invalid nil Timestamp") case invalidUnderflow: return protoimpl.X.NewError("timestamp (%v) before 0001-01-01", x) case invalidOverflow: return protoimpl.X.NewError("timestamp (%v) after 9999-12-31", x) case invalidNanos: return protoimpl.X.NewError("timestamp (%v) has out-of-range nanos", x) default: return nil } } const ( _ = iota invalidNil invalidUnderflow invalidOverflow invalidNanos ) func (x *Timestamp) check() uint { const minTimestamp = -62135596800 // Seconds between 1970-01-01T00:00:00Z and 0001-01-01T00:00:00Z, inclusive const maxTimestamp = +253402300799 // Seconds between 1970-01-01T00:00:00Z and 9999-12-31T23:59:59Z, inclusive secs := x.GetSeconds() nanos := x.GetNanos() switch { case x == nil: return invalidNil case secs < minTimestamp: return invalidUnderflow case secs > maxTimestamp: return invalidOverflow case nanos < 0 || nanos >= 1e9: return invalidNanos default: return 0 } } func (x *Timestamp) Reset() { *x = Timestamp{} mi := &file_google_protobuf_timestamp_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } func (x *Timestamp) String() string { return protoimpl.X.MessageStringOf(x) } func (*Timestamp) ProtoMessage() {} func (x *Timestamp) ProtoReflect() protoreflect.Message { mi := &file_google_protobuf_timestamp_proto_msgTypes[0] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Timestamp.ProtoReflect.Descriptor instead. func (*Timestamp) Descriptor() ([]byte, []int) { return file_google_protobuf_timestamp_proto_rawDescGZIP(), []int{0} } func (x *Timestamp) GetSeconds() int64 { if x != nil { return x.Seconds } return 0 } func (x *Timestamp) GetNanos() int32 { if x != nil { return x.Nanos } return 0 } var File_google_protobuf_timestamp_proto protoreflect.FileDescriptor const file_google_protobuf_timestamp_proto_rawDesc = "" + "\n" + "\x1fgoogle/protobuf/timestamp.proto\x12\x0fgoogle.protobuf\";\n" + "\tTimestamp\x12\x18\n" + "\aseconds\x18\x01 \x01(\x03R\aseconds\x12\x14\n" + "\x05nanos\x18\x02 \x01(\x05R\x05nanosB\x85\x01\n" + "\x13com.google.protobufB\x0eTimestampProtoP\x01Z2google.golang.org/protobuf/types/known/timestamppb\xf8\x01\x01\xa2\x02\x03GPB\xaa\x02\x1eGoogle.Protobuf.WellKnownTypesb\x06proto3" var ( file_google_protobuf_timestamp_proto_rawDescOnce sync.Once file_google_protobuf_timestamp_proto_rawDescData []byte ) func file_google_protobuf_timestamp_proto_rawDescGZIP() []byte { file_google_protobuf_timestamp_proto_rawDescOnce.Do(func() { file_google_protobuf_timestamp_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_google_protobuf_timestamp_proto_rawDesc), len(file_google_protobuf_timestamp_proto_rawDesc))) }) return file_google_protobuf_timestamp_proto_rawDescData } var file_google_protobuf_timestamp_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_google_protobuf_timestamp_proto_goTypes = []any{ (*Timestamp)(nil), // 0: google.protobuf.Timestamp } var file_google_protobuf_timestamp_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name } func init() { file_google_protobuf_timestamp_proto_init() } func file_google_protobuf_timestamp_proto_init() { if File_google_protobuf_timestamp_proto != nil { return } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_google_protobuf_timestamp_proto_rawDesc), len(file_google_protobuf_timestamp_proto_rawDesc)), NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, GoTypes: file_google_protobuf_timestamp_proto_goTypes, DependencyIndexes: file_google_protobuf_timestamp_proto_depIdxs, MessageInfos: file_google_protobuf_timestamp_proto_msgTypes, }.Build() File_google_protobuf_timestamp_proto = out.File file_google_protobuf_timestamp_proto_goTypes = nil file_google_protobuf_timestamp_proto_depIdxs = nil } ================================================ FILE: vendor/gopkg.in/yaml.v3/LICENSE ================================================ This project is covered by two different licenses: MIT and Apache. #### MIT License #### The following files were ported to Go from C files of libyaml, and thus are still covered by their original MIT license, with the additional copyright staring in 2011 when the project was ported over: apic.go emitterc.go parserc.go readerc.go scannerc.go writerc.go yamlh.go yamlprivateh.go Copyright (c) 2006-2010 Kirill Simonov Copyright (c) 2006-2011 Kirill Simonov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ### Apache License ### All the remaining project files are covered by the Apache license: Copyright (c) 2011-2019 Canonical Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: vendor/gopkg.in/yaml.v3/NOTICE ================================================ Copyright 2011-2016 Canonical Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: vendor/gopkg.in/yaml.v3/README.md ================================================ # YAML support for the Go language Introduction ------------ The yaml package enables Go programs to comfortably encode and decode YAML values. It was developed within [Canonical](https://www.canonical.com) as part of the [juju](https://juju.ubuntu.com) project, and is based on a pure Go port of the well-known [libyaml](http://pyyaml.org/wiki/LibYAML) C library to parse and generate YAML data quickly and reliably. Compatibility ------------- The yaml package supports most of YAML 1.2, but preserves some behavior from 1.1 for backwards compatibility. Specifically, as of v3 of the yaml package: - YAML 1.1 bools (_yes/no, on/off_) are supported as long as they are being decoded into a typed bool value. Otherwise they behave as a string. Booleans in YAML 1.2 are _true/false_ only. - Octals encode and decode as _0777_ per YAML 1.1, rather than _0o777_ as specified in YAML 1.2, because most parsers still use the old format. Octals in the _0o777_ format are supported though, so new files work. - Does not support base-60 floats. These are gone from YAML 1.2, and were actually never supported by this package as it's clearly a poor choice. and offers backwards compatibility with YAML 1.1 in some cases. 1.2, including support for anchors, tags, map merging, etc. Multi-document unmarshalling is not yet implemented, and base-60 floats from YAML 1.1 are purposefully not supported since they're a poor design and are gone in YAML 1.2. Installation and usage ---------------------- The import path for the package is *gopkg.in/yaml.v3*. To install it, run: go get gopkg.in/yaml.v3 API documentation ----------------- If opened in a browser, the import path itself leads to the API documentation: - [https://gopkg.in/yaml.v3](https://gopkg.in/yaml.v3) API stability ------------- The package API for yaml v3 will remain stable as described in [gopkg.in](https://gopkg.in). License ------- The yaml package is licensed under the MIT and Apache License 2.0 licenses. Please see the LICENSE file for details. Example ------- ```Go package main import ( "fmt" "log" "gopkg.in/yaml.v3" ) var data = ` a: Easy! b: c: 2 d: [3, 4] ` // Note: struct fields must be public in order for unmarshal to // correctly populate the data. type T struct { A string B struct { RenamedC int `yaml:"c"` D []int `yaml:",flow"` } } func main() { t := T{} err := yaml.Unmarshal([]byte(data), &t) if err != nil { log.Fatalf("error: %v", err) } fmt.Printf("--- t:\n%v\n\n", t) d, err := yaml.Marshal(&t) if err != nil { log.Fatalf("error: %v", err) } fmt.Printf("--- t dump:\n%s\n\n", string(d)) m := make(map[interface{}]interface{}) err = yaml.Unmarshal([]byte(data), &m) if err != nil { log.Fatalf("error: %v", err) } fmt.Printf("--- m:\n%v\n\n", m) d, err = yaml.Marshal(&m) if err != nil { log.Fatalf("error: %v", err) } fmt.Printf("--- m dump:\n%s\n\n", string(d)) } ``` This example will generate the following output: ``` --- t: {Easy! {2 [3 4]}} --- t dump: a: Easy! b: c: 2 d: [3, 4] --- m: map[a:Easy! b:map[c:2 d:[3 4]]] --- m dump: a: Easy! b: c: 2 d: - 3 - 4 ``` ================================================ FILE: vendor/gopkg.in/yaml.v3/apic.go ================================================ // // Copyright (c) 2011-2019 Canonical Ltd // Copyright (c) 2006-2010 Kirill Simonov // // Permission is hereby granted, free of charge, to any person obtaining a copy of // this software and associated documentation files (the "Software"), to deal in // the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies // of the Software, and to permit persons to whom the Software is furnished to do // so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. package yaml import ( "io" ) func yaml_insert_token(parser *yaml_parser_t, pos int, token *yaml_token_t) { //fmt.Println("yaml_insert_token", "pos:", pos, "typ:", token.typ, "head:", parser.tokens_head, "len:", len(parser.tokens)) // Check if we can move the queue at the beginning of the buffer. if parser.tokens_head > 0 && len(parser.tokens) == cap(parser.tokens) { if parser.tokens_head != len(parser.tokens) { copy(parser.tokens, parser.tokens[parser.tokens_head:]) } parser.tokens = parser.tokens[:len(parser.tokens)-parser.tokens_head] parser.tokens_head = 0 } parser.tokens = append(parser.tokens, *token) if pos < 0 { return } copy(parser.tokens[parser.tokens_head+pos+1:], parser.tokens[parser.tokens_head+pos:]) parser.tokens[parser.tokens_head+pos] = *token } // Create a new parser object. func yaml_parser_initialize(parser *yaml_parser_t) bool { *parser = yaml_parser_t{ raw_buffer: make([]byte, 0, input_raw_buffer_size), buffer: make([]byte, 0, input_buffer_size), } return true } // Destroy a parser object. func yaml_parser_delete(parser *yaml_parser_t) { *parser = yaml_parser_t{} } // String read handler. func yaml_string_read_handler(parser *yaml_parser_t, buffer []byte) (n int, err error) { if parser.input_pos == len(parser.input) { return 0, io.EOF } n = copy(buffer, parser.input[parser.input_pos:]) parser.input_pos += n return n, nil } // Reader read handler. func yaml_reader_read_handler(parser *yaml_parser_t, buffer []byte) (n int, err error) { return parser.input_reader.Read(buffer) } // Set a string input. func yaml_parser_set_input_string(parser *yaml_parser_t, input []byte) { if parser.read_handler != nil { panic("must set the input source only once") } parser.read_handler = yaml_string_read_handler parser.input = input parser.input_pos = 0 } // Set a file input. func yaml_parser_set_input_reader(parser *yaml_parser_t, r io.Reader) { if parser.read_handler != nil { panic("must set the input source only once") } parser.read_handler = yaml_reader_read_handler parser.input_reader = r } // Set the source encoding. func yaml_parser_set_encoding(parser *yaml_parser_t, encoding yaml_encoding_t) { if parser.encoding != yaml_ANY_ENCODING { panic("must set the encoding only once") } parser.encoding = encoding } // Create a new emitter object. func yaml_emitter_initialize(emitter *yaml_emitter_t) { *emitter = yaml_emitter_t{ buffer: make([]byte, output_buffer_size), raw_buffer: make([]byte, 0, output_raw_buffer_size), states: make([]yaml_emitter_state_t, 0, initial_stack_size), events: make([]yaml_event_t, 0, initial_queue_size), best_width: -1, } } // Destroy an emitter object. func yaml_emitter_delete(emitter *yaml_emitter_t) { *emitter = yaml_emitter_t{} } // String write handler. func yaml_string_write_handler(emitter *yaml_emitter_t, buffer []byte) error { *emitter.output_buffer = append(*emitter.output_buffer, buffer...) return nil } // yaml_writer_write_handler uses emitter.output_writer to write the // emitted text. func yaml_writer_write_handler(emitter *yaml_emitter_t, buffer []byte) error { _, err := emitter.output_writer.Write(buffer) return err } // Set a string output. func yaml_emitter_set_output_string(emitter *yaml_emitter_t, output_buffer *[]byte) { if emitter.write_handler != nil { panic("must set the output target only once") } emitter.write_handler = yaml_string_write_handler emitter.output_buffer = output_buffer } // Set a file output. func yaml_emitter_set_output_writer(emitter *yaml_emitter_t, w io.Writer) { if emitter.write_handler != nil { panic("must set the output target only once") } emitter.write_handler = yaml_writer_write_handler emitter.output_writer = w } // Set the output encoding. func yaml_emitter_set_encoding(emitter *yaml_emitter_t, encoding yaml_encoding_t) { if emitter.encoding != yaml_ANY_ENCODING { panic("must set the output encoding only once") } emitter.encoding = encoding } // Set the canonical output style. func yaml_emitter_set_canonical(emitter *yaml_emitter_t, canonical bool) { emitter.canonical = canonical } // Set the indentation increment. func yaml_emitter_set_indent(emitter *yaml_emitter_t, indent int) { if indent < 2 || indent > 9 { indent = 2 } emitter.best_indent = indent } // Set the preferred line width. func yaml_emitter_set_width(emitter *yaml_emitter_t, width int) { if width < 0 { width = -1 } emitter.best_width = width } // Set if unescaped non-ASCII characters are allowed. func yaml_emitter_set_unicode(emitter *yaml_emitter_t, unicode bool) { emitter.unicode = unicode } // Set the preferred line break character. func yaml_emitter_set_break(emitter *yaml_emitter_t, line_break yaml_break_t) { emitter.line_break = line_break } ///* // * Destroy a token object. // */ // //YAML_DECLARE(void) //yaml_token_delete(yaml_token_t *token) //{ // assert(token); // Non-NULL token object expected. // // switch (token.type) // { // case YAML_TAG_DIRECTIVE_TOKEN: // yaml_free(token.data.tag_directive.handle); // yaml_free(token.data.tag_directive.prefix); // break; // // case YAML_ALIAS_TOKEN: // yaml_free(token.data.alias.value); // break; // // case YAML_ANCHOR_TOKEN: // yaml_free(token.data.anchor.value); // break; // // case YAML_TAG_TOKEN: // yaml_free(token.data.tag.handle); // yaml_free(token.data.tag.suffix); // break; // // case YAML_SCALAR_TOKEN: // yaml_free(token.data.scalar.value); // break; // // default: // break; // } // // memset(token, 0, sizeof(yaml_token_t)); //} // ///* // * Check if a string is a valid UTF-8 sequence. // * // * Check 'reader.c' for more details on UTF-8 encoding. // */ // //static int //yaml_check_utf8(yaml_char_t *start, size_t length) //{ // yaml_char_t *end = start+length; // yaml_char_t *pointer = start; // // while (pointer < end) { // unsigned char octet; // unsigned int width; // unsigned int value; // size_t k; // // octet = pointer[0]; // width = (octet & 0x80) == 0x00 ? 1 : // (octet & 0xE0) == 0xC0 ? 2 : // (octet & 0xF0) == 0xE0 ? 3 : // (octet & 0xF8) == 0xF0 ? 4 : 0; // value = (octet & 0x80) == 0x00 ? octet & 0x7F : // (octet & 0xE0) == 0xC0 ? octet & 0x1F : // (octet & 0xF0) == 0xE0 ? octet & 0x0F : // (octet & 0xF8) == 0xF0 ? octet & 0x07 : 0; // if (!width) return 0; // if (pointer+width > end) return 0; // for (k = 1; k < width; k ++) { // octet = pointer[k]; // if ((octet & 0xC0) != 0x80) return 0; // value = (value << 6) + (octet & 0x3F); // } // if (!((width == 1) || // (width == 2 && value >= 0x80) || // (width == 3 && value >= 0x800) || // (width == 4 && value >= 0x10000))) return 0; // // pointer += width; // } // // return 1; //} // // Create STREAM-START. func yaml_stream_start_event_initialize(event *yaml_event_t, encoding yaml_encoding_t) { *event = yaml_event_t{ typ: yaml_STREAM_START_EVENT, encoding: encoding, } } // Create STREAM-END. func yaml_stream_end_event_initialize(event *yaml_event_t) { *event = yaml_event_t{ typ: yaml_STREAM_END_EVENT, } } // Create DOCUMENT-START. func yaml_document_start_event_initialize( event *yaml_event_t, version_directive *yaml_version_directive_t, tag_directives []yaml_tag_directive_t, implicit bool, ) { *event = yaml_event_t{ typ: yaml_DOCUMENT_START_EVENT, version_directive: version_directive, tag_directives: tag_directives, implicit: implicit, } } // Create DOCUMENT-END. func yaml_document_end_event_initialize(event *yaml_event_t, implicit bool) { *event = yaml_event_t{ typ: yaml_DOCUMENT_END_EVENT, implicit: implicit, } } // Create ALIAS. func yaml_alias_event_initialize(event *yaml_event_t, anchor []byte) bool { *event = yaml_event_t{ typ: yaml_ALIAS_EVENT, anchor: anchor, } return true } // Create SCALAR. func yaml_scalar_event_initialize(event *yaml_event_t, anchor, tag, value []byte, plain_implicit, quoted_implicit bool, style yaml_scalar_style_t) bool { *event = yaml_event_t{ typ: yaml_SCALAR_EVENT, anchor: anchor, tag: tag, value: value, implicit: plain_implicit, quoted_implicit: quoted_implicit, style: yaml_style_t(style), } return true } // Create SEQUENCE-START. func yaml_sequence_start_event_initialize(event *yaml_event_t, anchor, tag []byte, implicit bool, style yaml_sequence_style_t) bool { *event = yaml_event_t{ typ: yaml_SEQUENCE_START_EVENT, anchor: anchor, tag: tag, implicit: implicit, style: yaml_style_t(style), } return true } // Create SEQUENCE-END. func yaml_sequence_end_event_initialize(event *yaml_event_t) bool { *event = yaml_event_t{ typ: yaml_SEQUENCE_END_EVENT, } return true } // Create MAPPING-START. func yaml_mapping_start_event_initialize(event *yaml_event_t, anchor, tag []byte, implicit bool, style yaml_mapping_style_t) { *event = yaml_event_t{ typ: yaml_MAPPING_START_EVENT, anchor: anchor, tag: tag, implicit: implicit, style: yaml_style_t(style), } } // Create MAPPING-END. func yaml_mapping_end_event_initialize(event *yaml_event_t) { *event = yaml_event_t{ typ: yaml_MAPPING_END_EVENT, } } // Destroy an event object. func yaml_event_delete(event *yaml_event_t) { *event = yaml_event_t{} } ///* // * Create a document object. // */ // //YAML_DECLARE(int) //yaml_document_initialize(document *yaml_document_t, // version_directive *yaml_version_directive_t, // tag_directives_start *yaml_tag_directive_t, // tag_directives_end *yaml_tag_directive_t, // start_implicit int, end_implicit int) //{ // struct { // error yaml_error_type_t // } context // struct { // start *yaml_node_t // end *yaml_node_t // top *yaml_node_t // } nodes = { NULL, NULL, NULL } // version_directive_copy *yaml_version_directive_t = NULL // struct { // start *yaml_tag_directive_t // end *yaml_tag_directive_t // top *yaml_tag_directive_t // } tag_directives_copy = { NULL, NULL, NULL } // value yaml_tag_directive_t = { NULL, NULL } // mark yaml_mark_t = { 0, 0, 0 } // // assert(document) // Non-NULL document object is expected. // assert((tag_directives_start && tag_directives_end) || // (tag_directives_start == tag_directives_end)) // // Valid tag directives are expected. // // if (!STACK_INIT(&context, nodes, INITIAL_STACK_SIZE)) goto error // // if (version_directive) { // version_directive_copy = yaml_malloc(sizeof(yaml_version_directive_t)) // if (!version_directive_copy) goto error // version_directive_copy.major = version_directive.major // version_directive_copy.minor = version_directive.minor // } // // if (tag_directives_start != tag_directives_end) { // tag_directive *yaml_tag_directive_t // if (!STACK_INIT(&context, tag_directives_copy, INITIAL_STACK_SIZE)) // goto error // for (tag_directive = tag_directives_start // tag_directive != tag_directives_end; tag_directive ++) { // assert(tag_directive.handle) // assert(tag_directive.prefix) // if (!yaml_check_utf8(tag_directive.handle, // strlen((char *)tag_directive.handle))) // goto error // if (!yaml_check_utf8(tag_directive.prefix, // strlen((char *)tag_directive.prefix))) // goto error // value.handle = yaml_strdup(tag_directive.handle) // value.prefix = yaml_strdup(tag_directive.prefix) // if (!value.handle || !value.prefix) goto error // if (!PUSH(&context, tag_directives_copy, value)) // goto error // value.handle = NULL // value.prefix = NULL // } // } // // DOCUMENT_INIT(*document, nodes.start, nodes.end, version_directive_copy, // tag_directives_copy.start, tag_directives_copy.top, // start_implicit, end_implicit, mark, mark) // // return 1 // //error: // STACK_DEL(&context, nodes) // yaml_free(version_directive_copy) // while (!STACK_EMPTY(&context, tag_directives_copy)) { // value yaml_tag_directive_t = POP(&context, tag_directives_copy) // yaml_free(value.handle) // yaml_free(value.prefix) // } // STACK_DEL(&context, tag_directives_copy) // yaml_free(value.handle) // yaml_free(value.prefix) // // return 0 //} // ///* // * Destroy a document object. // */ // //YAML_DECLARE(void) //yaml_document_delete(document *yaml_document_t) //{ // struct { // error yaml_error_type_t // } context // tag_directive *yaml_tag_directive_t // // context.error = YAML_NO_ERROR // Eliminate a compiler warning. // // assert(document) // Non-NULL document object is expected. // // while (!STACK_EMPTY(&context, document.nodes)) { // node yaml_node_t = POP(&context, document.nodes) // yaml_free(node.tag) // switch (node.type) { // case YAML_SCALAR_NODE: // yaml_free(node.data.scalar.value) // break // case YAML_SEQUENCE_NODE: // STACK_DEL(&context, node.data.sequence.items) // break // case YAML_MAPPING_NODE: // STACK_DEL(&context, node.data.mapping.pairs) // break // default: // assert(0) // Should not happen. // } // } // STACK_DEL(&context, document.nodes) // // yaml_free(document.version_directive) // for (tag_directive = document.tag_directives.start // tag_directive != document.tag_directives.end // tag_directive++) { // yaml_free(tag_directive.handle) // yaml_free(tag_directive.prefix) // } // yaml_free(document.tag_directives.start) // // memset(document, 0, sizeof(yaml_document_t)) //} // ///** // * Get a document node. // */ // //YAML_DECLARE(yaml_node_t *) //yaml_document_get_node(document *yaml_document_t, index int) //{ // assert(document) // Non-NULL document object is expected. // // if (index > 0 && document.nodes.start + index <= document.nodes.top) { // return document.nodes.start + index - 1 // } // return NULL //} // ///** // * Get the root object. // */ // //YAML_DECLARE(yaml_node_t *) //yaml_document_get_root_node(document *yaml_document_t) //{ // assert(document) // Non-NULL document object is expected. // // if (document.nodes.top != document.nodes.start) { // return document.nodes.start // } // return NULL //} // ///* // * Add a scalar node to a document. // */ // //YAML_DECLARE(int) //yaml_document_add_scalar(document *yaml_document_t, // tag *yaml_char_t, value *yaml_char_t, length int, // style yaml_scalar_style_t) //{ // struct { // error yaml_error_type_t // } context // mark yaml_mark_t = { 0, 0, 0 } // tag_copy *yaml_char_t = NULL // value_copy *yaml_char_t = NULL // node yaml_node_t // // assert(document) // Non-NULL document object is expected. // assert(value) // Non-NULL value is expected. // // if (!tag) { // tag = (yaml_char_t *)YAML_DEFAULT_SCALAR_TAG // } // // if (!yaml_check_utf8(tag, strlen((char *)tag))) goto error // tag_copy = yaml_strdup(tag) // if (!tag_copy) goto error // // if (length < 0) { // length = strlen((char *)value) // } // // if (!yaml_check_utf8(value, length)) goto error // value_copy = yaml_malloc(length+1) // if (!value_copy) goto error // memcpy(value_copy, value, length) // value_copy[length] = '\0' // // SCALAR_NODE_INIT(node, tag_copy, value_copy, length, style, mark, mark) // if (!PUSH(&context, document.nodes, node)) goto error // // return document.nodes.top - document.nodes.start // //error: // yaml_free(tag_copy) // yaml_free(value_copy) // // return 0 //} // ///* // * Add a sequence node to a document. // */ // //YAML_DECLARE(int) //yaml_document_add_sequence(document *yaml_document_t, // tag *yaml_char_t, style yaml_sequence_style_t) //{ // struct { // error yaml_error_type_t // } context // mark yaml_mark_t = { 0, 0, 0 } // tag_copy *yaml_char_t = NULL // struct { // start *yaml_node_item_t // end *yaml_node_item_t // top *yaml_node_item_t // } items = { NULL, NULL, NULL } // node yaml_node_t // // assert(document) // Non-NULL document object is expected. // // if (!tag) { // tag = (yaml_char_t *)YAML_DEFAULT_SEQUENCE_TAG // } // // if (!yaml_check_utf8(tag, strlen((char *)tag))) goto error // tag_copy = yaml_strdup(tag) // if (!tag_copy) goto error // // if (!STACK_INIT(&context, items, INITIAL_STACK_SIZE)) goto error // // SEQUENCE_NODE_INIT(node, tag_copy, items.start, items.end, // style, mark, mark) // if (!PUSH(&context, document.nodes, node)) goto error // // return document.nodes.top - document.nodes.start // //error: // STACK_DEL(&context, items) // yaml_free(tag_copy) // // return 0 //} // ///* // * Add a mapping node to a document. // */ // //YAML_DECLARE(int) //yaml_document_add_mapping(document *yaml_document_t, // tag *yaml_char_t, style yaml_mapping_style_t) //{ // struct { // error yaml_error_type_t // } context // mark yaml_mark_t = { 0, 0, 0 } // tag_copy *yaml_char_t = NULL // struct { // start *yaml_node_pair_t // end *yaml_node_pair_t // top *yaml_node_pair_t // } pairs = { NULL, NULL, NULL } // node yaml_node_t // // assert(document) // Non-NULL document object is expected. // // if (!tag) { // tag = (yaml_char_t *)YAML_DEFAULT_MAPPING_TAG // } // // if (!yaml_check_utf8(tag, strlen((char *)tag))) goto error // tag_copy = yaml_strdup(tag) // if (!tag_copy) goto error // // if (!STACK_INIT(&context, pairs, INITIAL_STACK_SIZE)) goto error // // MAPPING_NODE_INIT(node, tag_copy, pairs.start, pairs.end, // style, mark, mark) // if (!PUSH(&context, document.nodes, node)) goto error // // return document.nodes.top - document.nodes.start // //error: // STACK_DEL(&context, pairs) // yaml_free(tag_copy) // // return 0 //} // ///* // * Append an item to a sequence node. // */ // //YAML_DECLARE(int) //yaml_document_append_sequence_item(document *yaml_document_t, // sequence int, item int) //{ // struct { // error yaml_error_type_t // } context // // assert(document) // Non-NULL document is required. // assert(sequence > 0 // && document.nodes.start + sequence <= document.nodes.top) // // Valid sequence id is required. // assert(document.nodes.start[sequence-1].type == YAML_SEQUENCE_NODE) // // A sequence node is required. // assert(item > 0 && document.nodes.start + item <= document.nodes.top) // // Valid item id is required. // // if (!PUSH(&context, // document.nodes.start[sequence-1].data.sequence.items, item)) // return 0 // // return 1 //} // ///* // * Append a pair of a key and a value to a mapping node. // */ // //YAML_DECLARE(int) //yaml_document_append_mapping_pair(document *yaml_document_t, // mapping int, key int, value int) //{ // struct { // error yaml_error_type_t // } context // // pair yaml_node_pair_t // // assert(document) // Non-NULL document is required. // assert(mapping > 0 // && document.nodes.start + mapping <= document.nodes.top) // // Valid mapping id is required. // assert(document.nodes.start[mapping-1].type == YAML_MAPPING_NODE) // // A mapping node is required. // assert(key > 0 && document.nodes.start + key <= document.nodes.top) // // Valid key id is required. // assert(value > 0 && document.nodes.start + value <= document.nodes.top) // // Valid value id is required. // // pair.key = key // pair.value = value // // if (!PUSH(&context, // document.nodes.start[mapping-1].data.mapping.pairs, pair)) // return 0 // // return 1 //} // // ================================================ FILE: vendor/gopkg.in/yaml.v3/decode.go ================================================ // // Copyright (c) 2011-2019 Canonical Ltd // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package yaml import ( "encoding" "encoding/base64" "fmt" "io" "math" "reflect" "strconv" "time" ) // ---------------------------------------------------------------------------- // Parser, produces a node tree out of a libyaml event stream. type parser struct { parser yaml_parser_t event yaml_event_t doc *Node anchors map[string]*Node doneInit bool textless bool } func newParser(b []byte) *parser { p := parser{} if !yaml_parser_initialize(&p.parser) { panic("failed to initialize YAML emitter") } if len(b) == 0 { b = []byte{'\n'} } yaml_parser_set_input_string(&p.parser, b) return &p } func newParserFromReader(r io.Reader) *parser { p := parser{} if !yaml_parser_initialize(&p.parser) { panic("failed to initialize YAML emitter") } yaml_parser_set_input_reader(&p.parser, r) return &p } func (p *parser) init() { if p.doneInit { return } p.anchors = make(map[string]*Node) p.expect(yaml_STREAM_START_EVENT) p.doneInit = true } func (p *parser) destroy() { if p.event.typ != yaml_NO_EVENT { yaml_event_delete(&p.event) } yaml_parser_delete(&p.parser) } // expect consumes an event from the event stream and // checks that it's of the expected type. func (p *parser) expect(e yaml_event_type_t) { if p.event.typ == yaml_NO_EVENT { if !yaml_parser_parse(&p.parser, &p.event) { p.fail() } } if p.event.typ == yaml_STREAM_END_EVENT { failf("attempted to go past the end of stream; corrupted value?") } if p.event.typ != e { p.parser.problem = fmt.Sprintf("expected %s event but got %s", e, p.event.typ) p.fail() } yaml_event_delete(&p.event) p.event.typ = yaml_NO_EVENT } // peek peeks at the next event in the event stream, // puts the results into p.event and returns the event type. func (p *parser) peek() yaml_event_type_t { if p.event.typ != yaml_NO_EVENT { return p.event.typ } // It's curious choice from the underlying API to generally return a // positive result on success, but on this case return true in an error // scenario. This was the source of bugs in the past (issue #666). if !yaml_parser_parse(&p.parser, &p.event) || p.parser.error != yaml_NO_ERROR { p.fail() } return p.event.typ } func (p *parser) fail() { var where string var line int if p.parser.context_mark.line != 0 { line = p.parser.context_mark.line // Scanner errors don't iterate line before returning error if p.parser.error == yaml_SCANNER_ERROR { line++ } } else if p.parser.problem_mark.line != 0 { line = p.parser.problem_mark.line // Scanner errors don't iterate line before returning error if p.parser.error == yaml_SCANNER_ERROR { line++ } } if line != 0 { where = "line " + strconv.Itoa(line) + ": " } var msg string if len(p.parser.problem) > 0 { msg = p.parser.problem } else { msg = "unknown problem parsing YAML content" } failf("%s%s", where, msg) } func (p *parser) anchor(n *Node, anchor []byte) { if anchor != nil { n.Anchor = string(anchor) p.anchors[n.Anchor] = n } } func (p *parser) parse() *Node { p.init() switch p.peek() { case yaml_SCALAR_EVENT: return p.scalar() case yaml_ALIAS_EVENT: return p.alias() case yaml_MAPPING_START_EVENT: return p.mapping() case yaml_SEQUENCE_START_EVENT: return p.sequence() case yaml_DOCUMENT_START_EVENT: return p.document() case yaml_STREAM_END_EVENT: // Happens when attempting to decode an empty buffer. return nil case yaml_TAIL_COMMENT_EVENT: panic("internal error: unexpected tail comment event (please report)") default: panic("internal error: attempted to parse unknown event (please report): " + p.event.typ.String()) } } func (p *parser) node(kind Kind, defaultTag, tag, value string) *Node { var style Style if tag != "" && tag != "!" { tag = shortTag(tag) style = TaggedStyle } else if defaultTag != "" { tag = defaultTag } else if kind == ScalarNode { tag, _ = resolve("", value) } n := &Node{ Kind: kind, Tag: tag, Value: value, Style: style, } if !p.textless { n.Line = p.event.start_mark.line + 1 n.Column = p.event.start_mark.column + 1 n.HeadComment = string(p.event.head_comment) n.LineComment = string(p.event.line_comment) n.FootComment = string(p.event.foot_comment) } return n } func (p *parser) parseChild(parent *Node) *Node { child := p.parse() parent.Content = append(parent.Content, child) return child } func (p *parser) document() *Node { n := p.node(DocumentNode, "", "", "") p.doc = n p.expect(yaml_DOCUMENT_START_EVENT) p.parseChild(n) if p.peek() == yaml_DOCUMENT_END_EVENT { n.FootComment = string(p.event.foot_comment) } p.expect(yaml_DOCUMENT_END_EVENT) return n } func (p *parser) alias() *Node { n := p.node(AliasNode, "", "", string(p.event.anchor)) n.Alias = p.anchors[n.Value] if n.Alias == nil { failf("unknown anchor '%s' referenced", n.Value) } p.expect(yaml_ALIAS_EVENT) return n } func (p *parser) scalar() *Node { var parsedStyle = p.event.scalar_style() var nodeStyle Style switch { case parsedStyle&yaml_DOUBLE_QUOTED_SCALAR_STYLE != 0: nodeStyle = DoubleQuotedStyle case parsedStyle&yaml_SINGLE_QUOTED_SCALAR_STYLE != 0: nodeStyle = SingleQuotedStyle case parsedStyle&yaml_LITERAL_SCALAR_STYLE != 0: nodeStyle = LiteralStyle case parsedStyle&yaml_FOLDED_SCALAR_STYLE != 0: nodeStyle = FoldedStyle } var nodeValue = string(p.event.value) var nodeTag = string(p.event.tag) var defaultTag string if nodeStyle == 0 { if nodeValue == "<<" { defaultTag = mergeTag } } else { defaultTag = strTag } n := p.node(ScalarNode, defaultTag, nodeTag, nodeValue) n.Style |= nodeStyle p.anchor(n, p.event.anchor) p.expect(yaml_SCALAR_EVENT) return n } func (p *parser) sequence() *Node { n := p.node(SequenceNode, seqTag, string(p.event.tag), "") if p.event.sequence_style()&yaml_FLOW_SEQUENCE_STYLE != 0 { n.Style |= FlowStyle } p.anchor(n, p.event.anchor) p.expect(yaml_SEQUENCE_START_EVENT) for p.peek() != yaml_SEQUENCE_END_EVENT { p.parseChild(n) } n.LineComment = string(p.event.line_comment) n.FootComment = string(p.event.foot_comment) p.expect(yaml_SEQUENCE_END_EVENT) return n } func (p *parser) mapping() *Node { n := p.node(MappingNode, mapTag, string(p.event.tag), "") block := true if p.event.mapping_style()&yaml_FLOW_MAPPING_STYLE != 0 { block = false n.Style |= FlowStyle } p.anchor(n, p.event.anchor) p.expect(yaml_MAPPING_START_EVENT) for p.peek() != yaml_MAPPING_END_EVENT { k := p.parseChild(n) if block && k.FootComment != "" { // Must be a foot comment for the prior value when being dedented. if len(n.Content) > 2 { n.Content[len(n.Content)-3].FootComment = k.FootComment k.FootComment = "" } } v := p.parseChild(n) if k.FootComment == "" && v.FootComment != "" { k.FootComment = v.FootComment v.FootComment = "" } if p.peek() == yaml_TAIL_COMMENT_EVENT { if k.FootComment == "" { k.FootComment = string(p.event.foot_comment) } p.expect(yaml_TAIL_COMMENT_EVENT) } } n.LineComment = string(p.event.line_comment) n.FootComment = string(p.event.foot_comment) if n.Style&FlowStyle == 0 && n.FootComment != "" && len(n.Content) > 1 { n.Content[len(n.Content)-2].FootComment = n.FootComment n.FootComment = "" } p.expect(yaml_MAPPING_END_EVENT) return n } // ---------------------------------------------------------------------------- // Decoder, unmarshals a node into a provided value. type decoder struct { doc *Node aliases map[*Node]bool terrors []string stringMapType reflect.Type generalMapType reflect.Type knownFields bool uniqueKeys bool decodeCount int aliasCount int aliasDepth int mergedFields map[interface{}]bool } var ( nodeType = reflect.TypeOf(Node{}) durationType = reflect.TypeOf(time.Duration(0)) stringMapType = reflect.TypeOf(map[string]interface{}{}) generalMapType = reflect.TypeOf(map[interface{}]interface{}{}) ifaceType = generalMapType.Elem() timeType = reflect.TypeOf(time.Time{}) ptrTimeType = reflect.TypeOf(&time.Time{}) ) func newDecoder() *decoder { d := &decoder{ stringMapType: stringMapType, generalMapType: generalMapType, uniqueKeys: true, } d.aliases = make(map[*Node]bool) return d } func (d *decoder) terror(n *Node, tag string, out reflect.Value) { if n.Tag != "" { tag = n.Tag } value := n.Value if tag != seqTag && tag != mapTag { if len(value) > 10 { value = " `" + value[:7] + "...`" } else { value = " `" + value + "`" } } d.terrors = append(d.terrors, fmt.Sprintf("line %d: cannot unmarshal %s%s into %s", n.Line, shortTag(tag), value, out.Type())) } func (d *decoder) callUnmarshaler(n *Node, u Unmarshaler) (good bool) { err := u.UnmarshalYAML(n) if e, ok := err.(*TypeError); ok { d.terrors = append(d.terrors, e.Errors...) return false } if err != nil { fail(err) } return true } func (d *decoder) callObsoleteUnmarshaler(n *Node, u obsoleteUnmarshaler) (good bool) { terrlen := len(d.terrors) err := u.UnmarshalYAML(func(v interface{}) (err error) { defer handleErr(&err) d.unmarshal(n, reflect.ValueOf(v)) if len(d.terrors) > terrlen { issues := d.terrors[terrlen:] d.terrors = d.terrors[:terrlen] return &TypeError{issues} } return nil }) if e, ok := err.(*TypeError); ok { d.terrors = append(d.terrors, e.Errors...) return false } if err != nil { fail(err) } return true } // d.prepare initializes and dereferences pointers and calls UnmarshalYAML // if a value is found to implement it. // It returns the initialized and dereferenced out value, whether // unmarshalling was already done by UnmarshalYAML, and if so whether // its types unmarshalled appropriately. // // If n holds a null value, prepare returns before doing anything. func (d *decoder) prepare(n *Node, out reflect.Value) (newout reflect.Value, unmarshaled, good bool) { if n.ShortTag() == nullTag { return out, false, false } again := true for again { again = false if out.Kind() == reflect.Ptr { if out.IsNil() { out.Set(reflect.New(out.Type().Elem())) } out = out.Elem() again = true } if out.CanAddr() { outi := out.Addr().Interface() if u, ok := outi.(Unmarshaler); ok { good = d.callUnmarshaler(n, u) return out, true, good } if u, ok := outi.(obsoleteUnmarshaler); ok { good = d.callObsoleteUnmarshaler(n, u) return out, true, good } } } return out, false, false } func (d *decoder) fieldByIndex(n *Node, v reflect.Value, index []int) (field reflect.Value) { if n.ShortTag() == nullTag { return reflect.Value{} } for _, num := range index { for { if v.Kind() == reflect.Ptr { if v.IsNil() { v.Set(reflect.New(v.Type().Elem())) } v = v.Elem() continue } break } v = v.Field(num) } return v } const ( // 400,000 decode operations is ~500kb of dense object declarations, or // ~5kb of dense object declarations with 10000% alias expansion alias_ratio_range_low = 400000 // 4,000,000 decode operations is ~5MB of dense object declarations, or // ~4.5MB of dense object declarations with 10% alias expansion alias_ratio_range_high = 4000000 // alias_ratio_range is the range over which we scale allowed alias ratios alias_ratio_range = float64(alias_ratio_range_high - alias_ratio_range_low) ) func allowedAliasRatio(decodeCount int) float64 { switch { case decodeCount <= alias_ratio_range_low: // allow 99% to come from alias expansion for small-to-medium documents return 0.99 case decodeCount >= alias_ratio_range_high: // allow 10% to come from alias expansion for very large documents return 0.10 default: // scale smoothly from 99% down to 10% over the range. // this maps to 396,000 - 400,000 allowed alias-driven decodes over the range. // 400,000 decode operations is ~100MB of allocations in worst-case scenarios (single-item maps). return 0.99 - 0.89*(float64(decodeCount-alias_ratio_range_low)/alias_ratio_range) } } func (d *decoder) unmarshal(n *Node, out reflect.Value) (good bool) { d.decodeCount++ if d.aliasDepth > 0 { d.aliasCount++ } if d.aliasCount > 100 && d.decodeCount > 1000 && float64(d.aliasCount)/float64(d.decodeCount) > allowedAliasRatio(d.decodeCount) { failf("document contains excessive aliasing") } if out.Type() == nodeType { out.Set(reflect.ValueOf(n).Elem()) return true } switch n.Kind { case DocumentNode: return d.document(n, out) case AliasNode: return d.alias(n, out) } out, unmarshaled, good := d.prepare(n, out) if unmarshaled { return good } switch n.Kind { case ScalarNode: good = d.scalar(n, out) case MappingNode: good = d.mapping(n, out) case SequenceNode: good = d.sequence(n, out) case 0: if n.IsZero() { return d.null(out) } fallthrough default: failf("cannot decode node with unknown kind %d", n.Kind) } return good } func (d *decoder) document(n *Node, out reflect.Value) (good bool) { if len(n.Content) == 1 { d.doc = n d.unmarshal(n.Content[0], out) return true } return false } func (d *decoder) alias(n *Node, out reflect.Value) (good bool) { if d.aliases[n] { // TODO this could actually be allowed in some circumstances. failf("anchor '%s' value contains itself", n.Value) } d.aliases[n] = true d.aliasDepth++ good = d.unmarshal(n.Alias, out) d.aliasDepth-- delete(d.aliases, n) return good } var zeroValue reflect.Value func resetMap(out reflect.Value) { for _, k := range out.MapKeys() { out.SetMapIndex(k, zeroValue) } } func (d *decoder) null(out reflect.Value) bool { if out.CanAddr() { switch out.Kind() { case reflect.Interface, reflect.Ptr, reflect.Map, reflect.Slice: out.Set(reflect.Zero(out.Type())) return true } } return false } func (d *decoder) scalar(n *Node, out reflect.Value) bool { var tag string var resolved interface{} if n.indicatedString() { tag = strTag resolved = n.Value } else { tag, resolved = resolve(n.Tag, n.Value) if tag == binaryTag { data, err := base64.StdEncoding.DecodeString(resolved.(string)) if err != nil { failf("!!binary value contains invalid base64 data") } resolved = string(data) } } if resolved == nil { return d.null(out) } if resolvedv := reflect.ValueOf(resolved); out.Type() == resolvedv.Type() { // We've resolved to exactly the type we want, so use that. out.Set(resolvedv) return true } // Perhaps we can use the value as a TextUnmarshaler to // set its value. if out.CanAddr() { u, ok := out.Addr().Interface().(encoding.TextUnmarshaler) if ok { var text []byte if tag == binaryTag { text = []byte(resolved.(string)) } else { // We let any value be unmarshaled into TextUnmarshaler. // That might be more lax than we'd like, but the // TextUnmarshaler itself should bowl out any dubious values. text = []byte(n.Value) } err := u.UnmarshalText(text) if err != nil { fail(err) } return true } } switch out.Kind() { case reflect.String: if tag == binaryTag { out.SetString(resolved.(string)) return true } out.SetString(n.Value) return true case reflect.Interface: out.Set(reflect.ValueOf(resolved)) return true case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: // This used to work in v2, but it's very unfriendly. isDuration := out.Type() == durationType switch resolved := resolved.(type) { case int: if !isDuration && !out.OverflowInt(int64(resolved)) { out.SetInt(int64(resolved)) return true } case int64: if !isDuration && !out.OverflowInt(resolved) { out.SetInt(resolved) return true } case uint64: if !isDuration && resolved <= math.MaxInt64 && !out.OverflowInt(int64(resolved)) { out.SetInt(int64(resolved)) return true } case float64: if !isDuration && resolved <= math.MaxInt64 && !out.OverflowInt(int64(resolved)) { out.SetInt(int64(resolved)) return true } case string: if out.Type() == durationType { d, err := time.ParseDuration(resolved) if err == nil { out.SetInt(int64(d)) return true } } } case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: switch resolved := resolved.(type) { case int: if resolved >= 0 && !out.OverflowUint(uint64(resolved)) { out.SetUint(uint64(resolved)) return true } case int64: if resolved >= 0 && !out.OverflowUint(uint64(resolved)) { out.SetUint(uint64(resolved)) return true } case uint64: if !out.OverflowUint(uint64(resolved)) { out.SetUint(uint64(resolved)) return true } case float64: if resolved <= math.MaxUint64 && !out.OverflowUint(uint64(resolved)) { out.SetUint(uint64(resolved)) return true } } case reflect.Bool: switch resolved := resolved.(type) { case bool: out.SetBool(resolved) return true case string: // This offers some compatibility with the 1.1 spec (https://yaml.org/type/bool.html). // It only works if explicitly attempting to unmarshal into a typed bool value. switch resolved { case "y", "Y", "yes", "Yes", "YES", "on", "On", "ON": out.SetBool(true) return true case "n", "N", "no", "No", "NO", "off", "Off", "OFF": out.SetBool(false) return true } } case reflect.Float32, reflect.Float64: switch resolved := resolved.(type) { case int: out.SetFloat(float64(resolved)) return true case int64: out.SetFloat(float64(resolved)) return true case uint64: out.SetFloat(float64(resolved)) return true case float64: out.SetFloat(resolved) return true } case reflect.Struct: if resolvedv := reflect.ValueOf(resolved); out.Type() == resolvedv.Type() { out.Set(resolvedv) return true } case reflect.Ptr: panic("yaml internal error: please report the issue") } d.terror(n, tag, out) return false } func settableValueOf(i interface{}) reflect.Value { v := reflect.ValueOf(i) sv := reflect.New(v.Type()).Elem() sv.Set(v) return sv } func (d *decoder) sequence(n *Node, out reflect.Value) (good bool) { l := len(n.Content) var iface reflect.Value switch out.Kind() { case reflect.Slice: out.Set(reflect.MakeSlice(out.Type(), l, l)) case reflect.Array: if l != out.Len() { failf("invalid array: want %d elements but got %d", out.Len(), l) } case reflect.Interface: // No type hints. Will have to use a generic sequence. iface = out out = settableValueOf(make([]interface{}, l)) default: d.terror(n, seqTag, out) return false } et := out.Type().Elem() j := 0 for i := 0; i < l; i++ { e := reflect.New(et).Elem() if ok := d.unmarshal(n.Content[i], e); ok { out.Index(j).Set(e) j++ } } if out.Kind() != reflect.Array { out.Set(out.Slice(0, j)) } if iface.IsValid() { iface.Set(out) } return true } func (d *decoder) mapping(n *Node, out reflect.Value) (good bool) { l := len(n.Content) if d.uniqueKeys { nerrs := len(d.terrors) for i := 0; i < l; i += 2 { ni := n.Content[i] for j := i + 2; j < l; j += 2 { nj := n.Content[j] if ni.Kind == nj.Kind && ni.Value == nj.Value { d.terrors = append(d.terrors, fmt.Sprintf("line %d: mapping key %#v already defined at line %d", nj.Line, nj.Value, ni.Line)) } } } if len(d.terrors) > nerrs { return false } } switch out.Kind() { case reflect.Struct: return d.mappingStruct(n, out) case reflect.Map: // okay case reflect.Interface: iface := out if isStringMap(n) { out = reflect.MakeMap(d.stringMapType) } else { out = reflect.MakeMap(d.generalMapType) } iface.Set(out) default: d.terror(n, mapTag, out) return false } outt := out.Type() kt := outt.Key() et := outt.Elem() stringMapType := d.stringMapType generalMapType := d.generalMapType if outt.Elem() == ifaceType { if outt.Key().Kind() == reflect.String { d.stringMapType = outt } else if outt.Key() == ifaceType { d.generalMapType = outt } } mergedFields := d.mergedFields d.mergedFields = nil var mergeNode *Node mapIsNew := false if out.IsNil() { out.Set(reflect.MakeMap(outt)) mapIsNew = true } for i := 0; i < l; i += 2 { if isMerge(n.Content[i]) { mergeNode = n.Content[i+1] continue } k := reflect.New(kt).Elem() if d.unmarshal(n.Content[i], k) { if mergedFields != nil { ki := k.Interface() if mergedFields[ki] { continue } mergedFields[ki] = true } kkind := k.Kind() if kkind == reflect.Interface { kkind = k.Elem().Kind() } if kkind == reflect.Map || kkind == reflect.Slice { failf("invalid map key: %#v", k.Interface()) } e := reflect.New(et).Elem() if d.unmarshal(n.Content[i+1], e) || n.Content[i+1].ShortTag() == nullTag && (mapIsNew || !out.MapIndex(k).IsValid()) { out.SetMapIndex(k, e) } } } d.mergedFields = mergedFields if mergeNode != nil { d.merge(n, mergeNode, out) } d.stringMapType = stringMapType d.generalMapType = generalMapType return true } func isStringMap(n *Node) bool { if n.Kind != MappingNode { return false } l := len(n.Content) for i := 0; i < l; i += 2 { shortTag := n.Content[i].ShortTag() if shortTag != strTag && shortTag != mergeTag { return false } } return true } func (d *decoder) mappingStruct(n *Node, out reflect.Value) (good bool) { sinfo, err := getStructInfo(out.Type()) if err != nil { panic(err) } var inlineMap reflect.Value var elemType reflect.Type if sinfo.InlineMap != -1 { inlineMap = out.Field(sinfo.InlineMap) elemType = inlineMap.Type().Elem() } for _, index := range sinfo.InlineUnmarshalers { field := d.fieldByIndex(n, out, index) d.prepare(n, field) } mergedFields := d.mergedFields d.mergedFields = nil var mergeNode *Node var doneFields []bool if d.uniqueKeys { doneFields = make([]bool, len(sinfo.FieldsList)) } name := settableValueOf("") l := len(n.Content) for i := 0; i < l; i += 2 { ni := n.Content[i] if isMerge(ni) { mergeNode = n.Content[i+1] continue } if !d.unmarshal(ni, name) { continue } sname := name.String() if mergedFields != nil { if mergedFields[sname] { continue } mergedFields[sname] = true } if info, ok := sinfo.FieldsMap[sname]; ok { if d.uniqueKeys { if doneFields[info.Id] { d.terrors = append(d.terrors, fmt.Sprintf("line %d: field %s already set in type %s", ni.Line, name.String(), out.Type())) continue } doneFields[info.Id] = true } var field reflect.Value if info.Inline == nil { field = out.Field(info.Num) } else { field = d.fieldByIndex(n, out, info.Inline) } d.unmarshal(n.Content[i+1], field) } else if sinfo.InlineMap != -1 { if inlineMap.IsNil() { inlineMap.Set(reflect.MakeMap(inlineMap.Type())) } value := reflect.New(elemType).Elem() d.unmarshal(n.Content[i+1], value) inlineMap.SetMapIndex(name, value) } else if d.knownFields { d.terrors = append(d.terrors, fmt.Sprintf("line %d: field %s not found in type %s", ni.Line, name.String(), out.Type())) } } d.mergedFields = mergedFields if mergeNode != nil { d.merge(n, mergeNode, out) } return true } func failWantMap() { failf("map merge requires map or sequence of maps as the value") } func (d *decoder) merge(parent *Node, merge *Node, out reflect.Value) { mergedFields := d.mergedFields if mergedFields == nil { d.mergedFields = make(map[interface{}]bool) for i := 0; i < len(parent.Content); i += 2 { k := reflect.New(ifaceType).Elem() if d.unmarshal(parent.Content[i], k) { d.mergedFields[k.Interface()] = true } } } switch merge.Kind { case MappingNode: d.unmarshal(merge, out) case AliasNode: if merge.Alias != nil && merge.Alias.Kind != MappingNode { failWantMap() } d.unmarshal(merge, out) case SequenceNode: for i := 0; i < len(merge.Content); i++ { ni := merge.Content[i] if ni.Kind == AliasNode { if ni.Alias != nil && ni.Alias.Kind != MappingNode { failWantMap() } } else if ni.Kind != MappingNode { failWantMap() } d.unmarshal(ni, out) } default: failWantMap() } d.mergedFields = mergedFields } func isMerge(n *Node) bool { return n.Kind == ScalarNode && n.Value == "<<" && (n.Tag == "" || n.Tag == "!" || shortTag(n.Tag) == mergeTag) } ================================================ FILE: vendor/gopkg.in/yaml.v3/emitterc.go ================================================ // // Copyright (c) 2011-2019 Canonical Ltd // Copyright (c) 2006-2010 Kirill Simonov // // Permission is hereby granted, free of charge, to any person obtaining a copy of // this software and associated documentation files (the "Software"), to deal in // the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies // of the Software, and to permit persons to whom the Software is furnished to do // so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. package yaml import ( "bytes" "fmt" ) // Flush the buffer if needed. func flush(emitter *yaml_emitter_t) bool { if emitter.buffer_pos+5 >= len(emitter.buffer) { return yaml_emitter_flush(emitter) } return true } // Put a character to the output buffer. func put(emitter *yaml_emitter_t, value byte) bool { if emitter.buffer_pos+5 >= len(emitter.buffer) && !yaml_emitter_flush(emitter) { return false } emitter.buffer[emitter.buffer_pos] = value emitter.buffer_pos++ emitter.column++ return true } // Put a line break to the output buffer. func put_break(emitter *yaml_emitter_t) bool { if emitter.buffer_pos+5 >= len(emitter.buffer) && !yaml_emitter_flush(emitter) { return false } switch emitter.line_break { case yaml_CR_BREAK: emitter.buffer[emitter.buffer_pos] = '\r' emitter.buffer_pos += 1 case yaml_LN_BREAK: emitter.buffer[emitter.buffer_pos] = '\n' emitter.buffer_pos += 1 case yaml_CRLN_BREAK: emitter.buffer[emitter.buffer_pos+0] = '\r' emitter.buffer[emitter.buffer_pos+1] = '\n' emitter.buffer_pos += 2 default: panic("unknown line break setting") } if emitter.column == 0 { emitter.space_above = true } emitter.column = 0 emitter.line++ // [Go] Do this here and below and drop from everywhere else (see commented lines). emitter.indention = true return true } // Copy a character from a string into buffer. func write(emitter *yaml_emitter_t, s []byte, i *int) bool { if emitter.buffer_pos+5 >= len(emitter.buffer) && !yaml_emitter_flush(emitter) { return false } p := emitter.buffer_pos w := width(s[*i]) switch w { case 4: emitter.buffer[p+3] = s[*i+3] fallthrough case 3: emitter.buffer[p+2] = s[*i+2] fallthrough case 2: emitter.buffer[p+1] = s[*i+1] fallthrough case 1: emitter.buffer[p+0] = s[*i+0] default: panic("unknown character width") } emitter.column++ emitter.buffer_pos += w *i += w return true } // Write a whole string into buffer. func write_all(emitter *yaml_emitter_t, s []byte) bool { for i := 0; i < len(s); { if !write(emitter, s, &i) { return false } } return true } // Copy a line break character from a string into buffer. func write_break(emitter *yaml_emitter_t, s []byte, i *int) bool { if s[*i] == '\n' { if !put_break(emitter) { return false } *i++ } else { if !write(emitter, s, i) { return false } if emitter.column == 0 { emitter.space_above = true } emitter.column = 0 emitter.line++ // [Go] Do this here and above and drop from everywhere else (see commented lines). emitter.indention = true } return true } // Set an emitter error and return false. func yaml_emitter_set_emitter_error(emitter *yaml_emitter_t, problem string) bool { emitter.error = yaml_EMITTER_ERROR emitter.problem = problem return false } // Emit an event. func yaml_emitter_emit(emitter *yaml_emitter_t, event *yaml_event_t) bool { emitter.events = append(emitter.events, *event) for !yaml_emitter_need_more_events(emitter) { event := &emitter.events[emitter.events_head] if !yaml_emitter_analyze_event(emitter, event) { return false } if !yaml_emitter_state_machine(emitter, event) { return false } yaml_event_delete(event) emitter.events_head++ } return true } // Check if we need to accumulate more events before emitting. // // We accumulate extra // - 1 event for DOCUMENT-START // - 2 events for SEQUENCE-START // - 3 events for MAPPING-START // func yaml_emitter_need_more_events(emitter *yaml_emitter_t) bool { if emitter.events_head == len(emitter.events) { return true } var accumulate int switch emitter.events[emitter.events_head].typ { case yaml_DOCUMENT_START_EVENT: accumulate = 1 break case yaml_SEQUENCE_START_EVENT: accumulate = 2 break case yaml_MAPPING_START_EVENT: accumulate = 3 break default: return false } if len(emitter.events)-emitter.events_head > accumulate { return false } var level int for i := emitter.events_head; i < len(emitter.events); i++ { switch emitter.events[i].typ { case yaml_STREAM_START_EVENT, yaml_DOCUMENT_START_EVENT, yaml_SEQUENCE_START_EVENT, yaml_MAPPING_START_EVENT: level++ case yaml_STREAM_END_EVENT, yaml_DOCUMENT_END_EVENT, yaml_SEQUENCE_END_EVENT, yaml_MAPPING_END_EVENT: level-- } if level == 0 { return false } } return true } // Append a directive to the directives stack. func yaml_emitter_append_tag_directive(emitter *yaml_emitter_t, value *yaml_tag_directive_t, allow_duplicates bool) bool { for i := 0; i < len(emitter.tag_directives); i++ { if bytes.Equal(value.handle, emitter.tag_directives[i].handle) { if allow_duplicates { return true } return yaml_emitter_set_emitter_error(emitter, "duplicate %TAG directive") } } // [Go] Do we actually need to copy this given garbage collection // and the lack of deallocating destructors? tag_copy := yaml_tag_directive_t{ handle: make([]byte, len(value.handle)), prefix: make([]byte, len(value.prefix)), } copy(tag_copy.handle, value.handle) copy(tag_copy.prefix, value.prefix) emitter.tag_directives = append(emitter.tag_directives, tag_copy) return true } // Increase the indentation level. func yaml_emitter_increase_indent(emitter *yaml_emitter_t, flow, indentless bool) bool { emitter.indents = append(emitter.indents, emitter.indent) if emitter.indent < 0 { if flow { emitter.indent = emitter.best_indent } else { emitter.indent = 0 } } else if !indentless { // [Go] This was changed so that indentations are more regular. if emitter.states[len(emitter.states)-1] == yaml_EMIT_BLOCK_SEQUENCE_ITEM_STATE { // The first indent inside a sequence will just skip the "- " indicator. emitter.indent += 2 } else { // Everything else aligns to the chosen indentation. emitter.indent = emitter.best_indent*((emitter.indent+emitter.best_indent)/emitter.best_indent) } } return true } // State dispatcher. func yaml_emitter_state_machine(emitter *yaml_emitter_t, event *yaml_event_t) bool { switch emitter.state { default: case yaml_EMIT_STREAM_START_STATE: return yaml_emitter_emit_stream_start(emitter, event) case yaml_EMIT_FIRST_DOCUMENT_START_STATE: return yaml_emitter_emit_document_start(emitter, event, true) case yaml_EMIT_DOCUMENT_START_STATE: return yaml_emitter_emit_document_start(emitter, event, false) case yaml_EMIT_DOCUMENT_CONTENT_STATE: return yaml_emitter_emit_document_content(emitter, event) case yaml_EMIT_DOCUMENT_END_STATE: return yaml_emitter_emit_document_end(emitter, event) case yaml_EMIT_FLOW_SEQUENCE_FIRST_ITEM_STATE: return yaml_emitter_emit_flow_sequence_item(emitter, event, true, false) case yaml_EMIT_FLOW_SEQUENCE_TRAIL_ITEM_STATE: return yaml_emitter_emit_flow_sequence_item(emitter, event, false, true) case yaml_EMIT_FLOW_SEQUENCE_ITEM_STATE: return yaml_emitter_emit_flow_sequence_item(emitter, event, false, false) case yaml_EMIT_FLOW_MAPPING_FIRST_KEY_STATE: return yaml_emitter_emit_flow_mapping_key(emitter, event, true, false) case yaml_EMIT_FLOW_MAPPING_TRAIL_KEY_STATE: return yaml_emitter_emit_flow_mapping_key(emitter, event, false, true) case yaml_EMIT_FLOW_MAPPING_KEY_STATE: return yaml_emitter_emit_flow_mapping_key(emitter, event, false, false) case yaml_EMIT_FLOW_MAPPING_SIMPLE_VALUE_STATE: return yaml_emitter_emit_flow_mapping_value(emitter, event, true) case yaml_EMIT_FLOW_MAPPING_VALUE_STATE: return yaml_emitter_emit_flow_mapping_value(emitter, event, false) case yaml_EMIT_BLOCK_SEQUENCE_FIRST_ITEM_STATE: return yaml_emitter_emit_block_sequence_item(emitter, event, true) case yaml_EMIT_BLOCK_SEQUENCE_ITEM_STATE: return yaml_emitter_emit_block_sequence_item(emitter, event, false) case yaml_EMIT_BLOCK_MAPPING_FIRST_KEY_STATE: return yaml_emitter_emit_block_mapping_key(emitter, event, true) case yaml_EMIT_BLOCK_MAPPING_KEY_STATE: return yaml_emitter_emit_block_mapping_key(emitter, event, false) case yaml_EMIT_BLOCK_MAPPING_SIMPLE_VALUE_STATE: return yaml_emitter_emit_block_mapping_value(emitter, event, true) case yaml_EMIT_BLOCK_MAPPING_VALUE_STATE: return yaml_emitter_emit_block_mapping_value(emitter, event, false) case yaml_EMIT_END_STATE: return yaml_emitter_set_emitter_error(emitter, "expected nothing after STREAM-END") } panic("invalid emitter state") } // Expect STREAM-START. func yaml_emitter_emit_stream_start(emitter *yaml_emitter_t, event *yaml_event_t) bool { if event.typ != yaml_STREAM_START_EVENT { return yaml_emitter_set_emitter_error(emitter, "expected STREAM-START") } if emitter.encoding == yaml_ANY_ENCODING { emitter.encoding = event.encoding if emitter.encoding == yaml_ANY_ENCODING { emitter.encoding = yaml_UTF8_ENCODING } } if emitter.best_indent < 2 || emitter.best_indent > 9 { emitter.best_indent = 2 } if emitter.best_width >= 0 && emitter.best_width <= emitter.best_indent*2 { emitter.best_width = 80 } if emitter.best_width < 0 { emitter.best_width = 1<<31 - 1 } if emitter.line_break == yaml_ANY_BREAK { emitter.line_break = yaml_LN_BREAK } emitter.indent = -1 emitter.line = 0 emitter.column = 0 emitter.whitespace = true emitter.indention = true emitter.space_above = true emitter.foot_indent = -1 if emitter.encoding != yaml_UTF8_ENCODING { if !yaml_emitter_write_bom(emitter) { return false } } emitter.state = yaml_EMIT_FIRST_DOCUMENT_START_STATE return true } // Expect DOCUMENT-START or STREAM-END. func yaml_emitter_emit_document_start(emitter *yaml_emitter_t, event *yaml_event_t, first bool) bool { if event.typ == yaml_DOCUMENT_START_EVENT { if event.version_directive != nil { if !yaml_emitter_analyze_version_directive(emitter, event.version_directive) { return false } } for i := 0; i < len(event.tag_directives); i++ { tag_directive := &event.tag_directives[i] if !yaml_emitter_analyze_tag_directive(emitter, tag_directive) { return false } if !yaml_emitter_append_tag_directive(emitter, tag_directive, false) { return false } } for i := 0; i < len(default_tag_directives); i++ { tag_directive := &default_tag_directives[i] if !yaml_emitter_append_tag_directive(emitter, tag_directive, true) { return false } } implicit := event.implicit if !first || emitter.canonical { implicit = false } if emitter.open_ended && (event.version_directive != nil || len(event.tag_directives) > 0) { if !yaml_emitter_write_indicator(emitter, []byte("..."), true, false, false) { return false } if !yaml_emitter_write_indent(emitter) { return false } } if event.version_directive != nil { implicit = false if !yaml_emitter_write_indicator(emitter, []byte("%YAML"), true, false, false) { return false } if !yaml_emitter_write_indicator(emitter, []byte("1.1"), true, false, false) { return false } if !yaml_emitter_write_indent(emitter) { return false } } if len(event.tag_directives) > 0 { implicit = false for i := 0; i < len(event.tag_directives); i++ { tag_directive := &event.tag_directives[i] if !yaml_emitter_write_indicator(emitter, []byte("%TAG"), true, false, false) { return false } if !yaml_emitter_write_tag_handle(emitter, tag_directive.handle) { return false } if !yaml_emitter_write_tag_content(emitter, tag_directive.prefix, true) { return false } if !yaml_emitter_write_indent(emitter) { return false } } } if yaml_emitter_check_empty_document(emitter) { implicit = false } if !implicit { if !yaml_emitter_write_indent(emitter) { return false } if !yaml_emitter_write_indicator(emitter, []byte("---"), true, false, false) { return false } if emitter.canonical || true { if !yaml_emitter_write_indent(emitter) { return false } } } if len(emitter.head_comment) > 0 { if !yaml_emitter_process_head_comment(emitter) { return false } if !put_break(emitter) { return false } } emitter.state = yaml_EMIT_DOCUMENT_CONTENT_STATE return true } if event.typ == yaml_STREAM_END_EVENT { if emitter.open_ended { if !yaml_emitter_write_indicator(emitter, []byte("..."), true, false, false) { return false } if !yaml_emitter_write_indent(emitter) { return false } } if !yaml_emitter_flush(emitter) { return false } emitter.state = yaml_EMIT_END_STATE return true } return yaml_emitter_set_emitter_error(emitter, "expected DOCUMENT-START or STREAM-END") } // Expect the root node. func yaml_emitter_emit_document_content(emitter *yaml_emitter_t, event *yaml_event_t) bool { emitter.states = append(emitter.states, yaml_EMIT_DOCUMENT_END_STATE) if !yaml_emitter_process_head_comment(emitter) { return false } if !yaml_emitter_emit_node(emitter, event, true, false, false, false) { return false } if !yaml_emitter_process_line_comment(emitter) { return false } if !yaml_emitter_process_foot_comment(emitter) { return false } return true } // Expect DOCUMENT-END. func yaml_emitter_emit_document_end(emitter *yaml_emitter_t, event *yaml_event_t) bool { if event.typ != yaml_DOCUMENT_END_EVENT { return yaml_emitter_set_emitter_error(emitter, "expected DOCUMENT-END") } // [Go] Force document foot separation. emitter.foot_indent = 0 if !yaml_emitter_process_foot_comment(emitter) { return false } emitter.foot_indent = -1 if !yaml_emitter_write_indent(emitter) { return false } if !event.implicit { // [Go] Allocate the slice elsewhere. if !yaml_emitter_write_indicator(emitter, []byte("..."), true, false, false) { return false } if !yaml_emitter_write_indent(emitter) { return false } } if !yaml_emitter_flush(emitter) { return false } emitter.state = yaml_EMIT_DOCUMENT_START_STATE emitter.tag_directives = emitter.tag_directives[:0] return true } // Expect a flow item node. func yaml_emitter_emit_flow_sequence_item(emitter *yaml_emitter_t, event *yaml_event_t, first, trail bool) bool { if first { if !yaml_emitter_write_indicator(emitter, []byte{'['}, true, true, false) { return false } if !yaml_emitter_increase_indent(emitter, true, false) { return false } emitter.flow_level++ } if event.typ == yaml_SEQUENCE_END_EVENT { if emitter.canonical && !first && !trail { if !yaml_emitter_write_indicator(emitter, []byte{','}, false, false, false) { return false } } emitter.flow_level-- emitter.indent = emitter.indents[len(emitter.indents)-1] emitter.indents = emitter.indents[:len(emitter.indents)-1] if emitter.column == 0 || emitter.canonical && !first { if !yaml_emitter_write_indent(emitter) { return false } } if !yaml_emitter_write_indicator(emitter, []byte{']'}, false, false, false) { return false } if !yaml_emitter_process_line_comment(emitter) { return false } if !yaml_emitter_process_foot_comment(emitter) { return false } emitter.state = emitter.states[len(emitter.states)-1] emitter.states = emitter.states[:len(emitter.states)-1] return true } if !first && !trail { if !yaml_emitter_write_indicator(emitter, []byte{','}, false, false, false) { return false } } if !yaml_emitter_process_head_comment(emitter) { return false } if emitter.column == 0 { if !yaml_emitter_write_indent(emitter) { return false } } if emitter.canonical || emitter.column > emitter.best_width { if !yaml_emitter_write_indent(emitter) { return false } } if len(emitter.line_comment)+len(emitter.foot_comment)+len(emitter.tail_comment) > 0 { emitter.states = append(emitter.states, yaml_EMIT_FLOW_SEQUENCE_TRAIL_ITEM_STATE) } else { emitter.states = append(emitter.states, yaml_EMIT_FLOW_SEQUENCE_ITEM_STATE) } if !yaml_emitter_emit_node(emitter, event, false, true, false, false) { return false } if len(emitter.line_comment)+len(emitter.foot_comment)+len(emitter.tail_comment) > 0 { if !yaml_emitter_write_indicator(emitter, []byte{','}, false, false, false) { return false } } if !yaml_emitter_process_line_comment(emitter) { return false } if !yaml_emitter_process_foot_comment(emitter) { return false } return true } // Expect a flow key node. func yaml_emitter_emit_flow_mapping_key(emitter *yaml_emitter_t, event *yaml_event_t, first, trail bool) bool { if first { if !yaml_emitter_write_indicator(emitter, []byte{'{'}, true, true, false) { return false } if !yaml_emitter_increase_indent(emitter, true, false) { return false } emitter.flow_level++ } if event.typ == yaml_MAPPING_END_EVENT { if (emitter.canonical || len(emitter.head_comment)+len(emitter.foot_comment)+len(emitter.tail_comment) > 0) && !first && !trail { if !yaml_emitter_write_indicator(emitter, []byte{','}, false, false, false) { return false } } if !yaml_emitter_process_head_comment(emitter) { return false } emitter.flow_level-- emitter.indent = emitter.indents[len(emitter.indents)-1] emitter.indents = emitter.indents[:len(emitter.indents)-1] if emitter.canonical && !first { if !yaml_emitter_write_indent(emitter) { return false } } if !yaml_emitter_write_indicator(emitter, []byte{'}'}, false, false, false) { return false } if !yaml_emitter_process_line_comment(emitter) { return false } if !yaml_emitter_process_foot_comment(emitter) { return false } emitter.state = emitter.states[len(emitter.states)-1] emitter.states = emitter.states[:len(emitter.states)-1] return true } if !first && !trail { if !yaml_emitter_write_indicator(emitter, []byte{','}, false, false, false) { return false } } if !yaml_emitter_process_head_comment(emitter) { return false } if emitter.column == 0 { if !yaml_emitter_write_indent(emitter) { return false } } if emitter.canonical || emitter.column > emitter.best_width { if !yaml_emitter_write_indent(emitter) { return false } } if !emitter.canonical && yaml_emitter_check_simple_key(emitter) { emitter.states = append(emitter.states, yaml_EMIT_FLOW_MAPPING_SIMPLE_VALUE_STATE) return yaml_emitter_emit_node(emitter, event, false, false, true, true) } if !yaml_emitter_write_indicator(emitter, []byte{'?'}, true, false, false) { return false } emitter.states = append(emitter.states, yaml_EMIT_FLOW_MAPPING_VALUE_STATE) return yaml_emitter_emit_node(emitter, event, false, false, true, false) } // Expect a flow value node. func yaml_emitter_emit_flow_mapping_value(emitter *yaml_emitter_t, event *yaml_event_t, simple bool) bool { if simple { if !yaml_emitter_write_indicator(emitter, []byte{':'}, false, false, false) { return false } } else { if emitter.canonical || emitter.column > emitter.best_width { if !yaml_emitter_write_indent(emitter) { return false } } if !yaml_emitter_write_indicator(emitter, []byte{':'}, true, false, false) { return false } } if len(emitter.line_comment)+len(emitter.foot_comment)+len(emitter.tail_comment) > 0 { emitter.states = append(emitter.states, yaml_EMIT_FLOW_MAPPING_TRAIL_KEY_STATE) } else { emitter.states = append(emitter.states, yaml_EMIT_FLOW_MAPPING_KEY_STATE) } if !yaml_emitter_emit_node(emitter, event, false, false, true, false) { return false } if len(emitter.line_comment)+len(emitter.foot_comment)+len(emitter.tail_comment) > 0 { if !yaml_emitter_write_indicator(emitter, []byte{','}, false, false, false) { return false } } if !yaml_emitter_process_line_comment(emitter) { return false } if !yaml_emitter_process_foot_comment(emitter) { return false } return true } // Expect a block item node. func yaml_emitter_emit_block_sequence_item(emitter *yaml_emitter_t, event *yaml_event_t, first bool) bool { if first { if !yaml_emitter_increase_indent(emitter, false, false) { return false } } if event.typ == yaml_SEQUENCE_END_EVENT { emitter.indent = emitter.indents[len(emitter.indents)-1] emitter.indents = emitter.indents[:len(emitter.indents)-1] emitter.state = emitter.states[len(emitter.states)-1] emitter.states = emitter.states[:len(emitter.states)-1] return true } if !yaml_emitter_process_head_comment(emitter) { return false } if !yaml_emitter_write_indent(emitter) { return false } if !yaml_emitter_write_indicator(emitter, []byte{'-'}, true, false, true) { return false } emitter.states = append(emitter.states, yaml_EMIT_BLOCK_SEQUENCE_ITEM_STATE) if !yaml_emitter_emit_node(emitter, event, false, true, false, false) { return false } if !yaml_emitter_process_line_comment(emitter) { return false } if !yaml_emitter_process_foot_comment(emitter) { return false } return true } // Expect a block key node. func yaml_emitter_emit_block_mapping_key(emitter *yaml_emitter_t, event *yaml_event_t, first bool) bool { if first { if !yaml_emitter_increase_indent(emitter, false, false) { return false } } if !yaml_emitter_process_head_comment(emitter) { return false } if event.typ == yaml_MAPPING_END_EVENT { emitter.indent = emitter.indents[len(emitter.indents)-1] emitter.indents = emitter.indents[:len(emitter.indents)-1] emitter.state = emitter.states[len(emitter.states)-1] emitter.states = emitter.states[:len(emitter.states)-1] return true } if !yaml_emitter_write_indent(emitter) { return false } if len(emitter.line_comment) > 0 { // [Go] A line comment was provided for the key. That's unusual as the // scanner associates line comments with the value. Either way, // save the line comment and render it appropriately later. emitter.key_line_comment = emitter.line_comment emitter.line_comment = nil } if yaml_emitter_check_simple_key(emitter) { emitter.states = append(emitter.states, yaml_EMIT_BLOCK_MAPPING_SIMPLE_VALUE_STATE) return yaml_emitter_emit_node(emitter, event, false, false, true, true) } if !yaml_emitter_write_indicator(emitter, []byte{'?'}, true, false, true) { return false } emitter.states = append(emitter.states, yaml_EMIT_BLOCK_MAPPING_VALUE_STATE) return yaml_emitter_emit_node(emitter, event, false, false, true, false) } // Expect a block value node. func yaml_emitter_emit_block_mapping_value(emitter *yaml_emitter_t, event *yaml_event_t, simple bool) bool { if simple { if !yaml_emitter_write_indicator(emitter, []byte{':'}, false, false, false) { return false } } else { if !yaml_emitter_write_indent(emitter) { return false } if !yaml_emitter_write_indicator(emitter, []byte{':'}, true, false, true) { return false } } if len(emitter.key_line_comment) > 0 { // [Go] Line comments are generally associated with the value, but when there's // no value on the same line as a mapping key they end up attached to the // key itself. if event.typ == yaml_SCALAR_EVENT { if len(emitter.line_comment) == 0 { // A scalar is coming and it has no line comments by itself yet, // so just let it handle the line comment as usual. If it has a // line comment, we can't have both so the one from the key is lost. emitter.line_comment = emitter.key_line_comment emitter.key_line_comment = nil } } else if event.sequence_style() != yaml_FLOW_SEQUENCE_STYLE && (event.typ == yaml_MAPPING_START_EVENT || event.typ == yaml_SEQUENCE_START_EVENT) { // An indented block follows, so write the comment right now. emitter.line_comment, emitter.key_line_comment = emitter.key_line_comment, emitter.line_comment if !yaml_emitter_process_line_comment(emitter) { return false } emitter.line_comment, emitter.key_line_comment = emitter.key_line_comment, emitter.line_comment } } emitter.states = append(emitter.states, yaml_EMIT_BLOCK_MAPPING_KEY_STATE) if !yaml_emitter_emit_node(emitter, event, false, false, true, false) { return false } if !yaml_emitter_process_line_comment(emitter) { return false } if !yaml_emitter_process_foot_comment(emitter) { return false } return true } func yaml_emitter_silent_nil_event(emitter *yaml_emitter_t, event *yaml_event_t) bool { return event.typ == yaml_SCALAR_EVENT && event.implicit && !emitter.canonical && len(emitter.scalar_data.value) == 0 } // Expect a node. func yaml_emitter_emit_node(emitter *yaml_emitter_t, event *yaml_event_t, root bool, sequence bool, mapping bool, simple_key bool) bool { emitter.root_context = root emitter.sequence_context = sequence emitter.mapping_context = mapping emitter.simple_key_context = simple_key switch event.typ { case yaml_ALIAS_EVENT: return yaml_emitter_emit_alias(emitter, event) case yaml_SCALAR_EVENT: return yaml_emitter_emit_scalar(emitter, event) case yaml_SEQUENCE_START_EVENT: return yaml_emitter_emit_sequence_start(emitter, event) case yaml_MAPPING_START_EVENT: return yaml_emitter_emit_mapping_start(emitter, event) default: return yaml_emitter_set_emitter_error(emitter, fmt.Sprintf("expected SCALAR, SEQUENCE-START, MAPPING-START, or ALIAS, but got %v", event.typ)) } } // Expect ALIAS. func yaml_emitter_emit_alias(emitter *yaml_emitter_t, event *yaml_event_t) bool { if !yaml_emitter_process_anchor(emitter) { return false } emitter.state = emitter.states[len(emitter.states)-1] emitter.states = emitter.states[:len(emitter.states)-1] return true } // Expect SCALAR. func yaml_emitter_emit_scalar(emitter *yaml_emitter_t, event *yaml_event_t) bool { if !yaml_emitter_select_scalar_style(emitter, event) { return false } if !yaml_emitter_process_anchor(emitter) { return false } if !yaml_emitter_process_tag(emitter) { return false } if !yaml_emitter_increase_indent(emitter, true, false) { return false } if !yaml_emitter_process_scalar(emitter) { return false } emitter.indent = emitter.indents[len(emitter.indents)-1] emitter.indents = emitter.indents[:len(emitter.indents)-1] emitter.state = emitter.states[len(emitter.states)-1] emitter.states = emitter.states[:len(emitter.states)-1] return true } // Expect SEQUENCE-START. func yaml_emitter_emit_sequence_start(emitter *yaml_emitter_t, event *yaml_event_t) bool { if !yaml_emitter_process_anchor(emitter) { return false } if !yaml_emitter_process_tag(emitter) { return false } if emitter.flow_level > 0 || emitter.canonical || event.sequence_style() == yaml_FLOW_SEQUENCE_STYLE || yaml_emitter_check_empty_sequence(emitter) { emitter.state = yaml_EMIT_FLOW_SEQUENCE_FIRST_ITEM_STATE } else { emitter.state = yaml_EMIT_BLOCK_SEQUENCE_FIRST_ITEM_STATE } return true } // Expect MAPPING-START. func yaml_emitter_emit_mapping_start(emitter *yaml_emitter_t, event *yaml_event_t) bool { if !yaml_emitter_process_anchor(emitter) { return false } if !yaml_emitter_process_tag(emitter) { return false } if emitter.flow_level > 0 || emitter.canonical || event.mapping_style() == yaml_FLOW_MAPPING_STYLE || yaml_emitter_check_empty_mapping(emitter) { emitter.state = yaml_EMIT_FLOW_MAPPING_FIRST_KEY_STATE } else { emitter.state = yaml_EMIT_BLOCK_MAPPING_FIRST_KEY_STATE } return true } // Check if the document content is an empty scalar. func yaml_emitter_check_empty_document(emitter *yaml_emitter_t) bool { return false // [Go] Huh? } // Check if the next events represent an empty sequence. func yaml_emitter_check_empty_sequence(emitter *yaml_emitter_t) bool { if len(emitter.events)-emitter.events_head < 2 { return false } return emitter.events[emitter.events_head].typ == yaml_SEQUENCE_START_EVENT && emitter.events[emitter.events_head+1].typ == yaml_SEQUENCE_END_EVENT } // Check if the next events represent an empty mapping. func yaml_emitter_check_empty_mapping(emitter *yaml_emitter_t) bool { if len(emitter.events)-emitter.events_head < 2 { return false } return emitter.events[emitter.events_head].typ == yaml_MAPPING_START_EVENT && emitter.events[emitter.events_head+1].typ == yaml_MAPPING_END_EVENT } // Check if the next node can be expressed as a simple key. func yaml_emitter_check_simple_key(emitter *yaml_emitter_t) bool { length := 0 switch emitter.events[emitter.events_head].typ { case yaml_ALIAS_EVENT: length += len(emitter.anchor_data.anchor) case yaml_SCALAR_EVENT: if emitter.scalar_data.multiline { return false } length += len(emitter.anchor_data.anchor) + len(emitter.tag_data.handle) + len(emitter.tag_data.suffix) + len(emitter.scalar_data.value) case yaml_SEQUENCE_START_EVENT: if !yaml_emitter_check_empty_sequence(emitter) { return false } length += len(emitter.anchor_data.anchor) + len(emitter.tag_data.handle) + len(emitter.tag_data.suffix) case yaml_MAPPING_START_EVENT: if !yaml_emitter_check_empty_mapping(emitter) { return false } length += len(emitter.anchor_data.anchor) + len(emitter.tag_data.handle) + len(emitter.tag_data.suffix) default: return false } return length <= 128 } // Determine an acceptable scalar style. func yaml_emitter_select_scalar_style(emitter *yaml_emitter_t, event *yaml_event_t) bool { no_tag := len(emitter.tag_data.handle) == 0 && len(emitter.tag_data.suffix) == 0 if no_tag && !event.implicit && !event.quoted_implicit { return yaml_emitter_set_emitter_error(emitter, "neither tag nor implicit flags are specified") } style := event.scalar_style() if style == yaml_ANY_SCALAR_STYLE { style = yaml_PLAIN_SCALAR_STYLE } if emitter.canonical { style = yaml_DOUBLE_QUOTED_SCALAR_STYLE } if emitter.simple_key_context && emitter.scalar_data.multiline { style = yaml_DOUBLE_QUOTED_SCALAR_STYLE } if style == yaml_PLAIN_SCALAR_STYLE { if emitter.flow_level > 0 && !emitter.scalar_data.flow_plain_allowed || emitter.flow_level == 0 && !emitter.scalar_data.block_plain_allowed { style = yaml_SINGLE_QUOTED_SCALAR_STYLE } if len(emitter.scalar_data.value) == 0 && (emitter.flow_level > 0 || emitter.simple_key_context) { style = yaml_SINGLE_QUOTED_SCALAR_STYLE } if no_tag && !event.implicit { style = yaml_SINGLE_QUOTED_SCALAR_STYLE } } if style == yaml_SINGLE_QUOTED_SCALAR_STYLE { if !emitter.scalar_data.single_quoted_allowed { style = yaml_DOUBLE_QUOTED_SCALAR_STYLE } } if style == yaml_LITERAL_SCALAR_STYLE || style == yaml_FOLDED_SCALAR_STYLE { if !emitter.scalar_data.block_allowed || emitter.flow_level > 0 || emitter.simple_key_context { style = yaml_DOUBLE_QUOTED_SCALAR_STYLE } } if no_tag && !event.quoted_implicit && style != yaml_PLAIN_SCALAR_STYLE { emitter.tag_data.handle = []byte{'!'} } emitter.scalar_data.style = style return true } // Write an anchor. func yaml_emitter_process_anchor(emitter *yaml_emitter_t) bool { if emitter.anchor_data.anchor == nil { return true } c := []byte{'&'} if emitter.anchor_data.alias { c[0] = '*' } if !yaml_emitter_write_indicator(emitter, c, true, false, false) { return false } return yaml_emitter_write_anchor(emitter, emitter.anchor_data.anchor) } // Write a tag. func yaml_emitter_process_tag(emitter *yaml_emitter_t) bool { if len(emitter.tag_data.handle) == 0 && len(emitter.tag_data.suffix) == 0 { return true } if len(emitter.tag_data.handle) > 0 { if !yaml_emitter_write_tag_handle(emitter, emitter.tag_data.handle) { return false } if len(emitter.tag_data.suffix) > 0 { if !yaml_emitter_write_tag_content(emitter, emitter.tag_data.suffix, false) { return false } } } else { // [Go] Allocate these slices elsewhere. if !yaml_emitter_write_indicator(emitter, []byte("!<"), true, false, false) { return false } if !yaml_emitter_write_tag_content(emitter, emitter.tag_data.suffix, false) { return false } if !yaml_emitter_write_indicator(emitter, []byte{'>'}, false, false, false) { return false } } return true } // Write a scalar. func yaml_emitter_process_scalar(emitter *yaml_emitter_t) bool { switch emitter.scalar_data.style { case yaml_PLAIN_SCALAR_STYLE: return yaml_emitter_write_plain_scalar(emitter, emitter.scalar_data.value, !emitter.simple_key_context) case yaml_SINGLE_QUOTED_SCALAR_STYLE: return yaml_emitter_write_single_quoted_scalar(emitter, emitter.scalar_data.value, !emitter.simple_key_context) case yaml_DOUBLE_QUOTED_SCALAR_STYLE: return yaml_emitter_write_double_quoted_scalar(emitter, emitter.scalar_data.value, !emitter.simple_key_context) case yaml_LITERAL_SCALAR_STYLE: return yaml_emitter_write_literal_scalar(emitter, emitter.scalar_data.value) case yaml_FOLDED_SCALAR_STYLE: return yaml_emitter_write_folded_scalar(emitter, emitter.scalar_data.value) } panic("unknown scalar style") } // Write a head comment. func yaml_emitter_process_head_comment(emitter *yaml_emitter_t) bool { if len(emitter.tail_comment) > 0 { if !yaml_emitter_write_indent(emitter) { return false } if !yaml_emitter_write_comment(emitter, emitter.tail_comment) { return false } emitter.tail_comment = emitter.tail_comment[:0] emitter.foot_indent = emitter.indent if emitter.foot_indent < 0 { emitter.foot_indent = 0 } } if len(emitter.head_comment) == 0 { return true } if !yaml_emitter_write_indent(emitter) { return false } if !yaml_emitter_write_comment(emitter, emitter.head_comment) { return false } emitter.head_comment = emitter.head_comment[:0] return true } // Write an line comment. func yaml_emitter_process_line_comment(emitter *yaml_emitter_t) bool { if len(emitter.line_comment) == 0 { return true } if !emitter.whitespace { if !put(emitter, ' ') { return false } } if !yaml_emitter_write_comment(emitter, emitter.line_comment) { return false } emitter.line_comment = emitter.line_comment[:0] return true } // Write a foot comment. func yaml_emitter_process_foot_comment(emitter *yaml_emitter_t) bool { if len(emitter.foot_comment) == 0 { return true } if !yaml_emitter_write_indent(emitter) { return false } if !yaml_emitter_write_comment(emitter, emitter.foot_comment) { return false } emitter.foot_comment = emitter.foot_comment[:0] emitter.foot_indent = emitter.indent if emitter.foot_indent < 0 { emitter.foot_indent = 0 } return true } // Check if a %YAML directive is valid. func yaml_emitter_analyze_version_directive(emitter *yaml_emitter_t, version_directive *yaml_version_directive_t) bool { if version_directive.major != 1 || version_directive.minor != 1 { return yaml_emitter_set_emitter_error(emitter, "incompatible %YAML directive") } return true } // Check if a %TAG directive is valid. func yaml_emitter_analyze_tag_directive(emitter *yaml_emitter_t, tag_directive *yaml_tag_directive_t) bool { handle := tag_directive.handle prefix := tag_directive.prefix if len(handle) == 0 { return yaml_emitter_set_emitter_error(emitter, "tag handle must not be empty") } if handle[0] != '!' { return yaml_emitter_set_emitter_error(emitter, "tag handle must start with '!'") } if handle[len(handle)-1] != '!' { return yaml_emitter_set_emitter_error(emitter, "tag handle must end with '!'") } for i := 1; i < len(handle)-1; i += width(handle[i]) { if !is_alpha(handle, i) { return yaml_emitter_set_emitter_error(emitter, "tag handle must contain alphanumerical characters only") } } if len(prefix) == 0 { return yaml_emitter_set_emitter_error(emitter, "tag prefix must not be empty") } return true } // Check if an anchor is valid. func yaml_emitter_analyze_anchor(emitter *yaml_emitter_t, anchor []byte, alias bool) bool { if len(anchor) == 0 { problem := "anchor value must not be empty" if alias { problem = "alias value must not be empty" } return yaml_emitter_set_emitter_error(emitter, problem) } for i := 0; i < len(anchor); i += width(anchor[i]) { if !is_alpha(anchor, i) { problem := "anchor value must contain alphanumerical characters only" if alias { problem = "alias value must contain alphanumerical characters only" } return yaml_emitter_set_emitter_error(emitter, problem) } } emitter.anchor_data.anchor = anchor emitter.anchor_data.alias = alias return true } // Check if a tag is valid. func yaml_emitter_analyze_tag(emitter *yaml_emitter_t, tag []byte) bool { if len(tag) == 0 { return yaml_emitter_set_emitter_error(emitter, "tag value must not be empty") } for i := 0; i < len(emitter.tag_directives); i++ { tag_directive := &emitter.tag_directives[i] if bytes.HasPrefix(tag, tag_directive.prefix) { emitter.tag_data.handle = tag_directive.handle emitter.tag_data.suffix = tag[len(tag_directive.prefix):] return true } } emitter.tag_data.suffix = tag return true } // Check if a scalar is valid. func yaml_emitter_analyze_scalar(emitter *yaml_emitter_t, value []byte) bool { var ( block_indicators = false flow_indicators = false line_breaks = false special_characters = false tab_characters = false leading_space = false leading_break = false trailing_space = false trailing_break = false break_space = false space_break = false preceded_by_whitespace = false followed_by_whitespace = false previous_space = false previous_break = false ) emitter.scalar_data.value = value if len(value) == 0 { emitter.scalar_data.multiline = false emitter.scalar_data.flow_plain_allowed = false emitter.scalar_data.block_plain_allowed = true emitter.scalar_data.single_quoted_allowed = true emitter.scalar_data.block_allowed = false return true } if len(value) >= 3 && ((value[0] == '-' && value[1] == '-' && value[2] == '-') || (value[0] == '.' && value[1] == '.' && value[2] == '.')) { block_indicators = true flow_indicators = true } preceded_by_whitespace = true for i, w := 0, 0; i < len(value); i += w { w = width(value[i]) followed_by_whitespace = i+w >= len(value) || is_blank(value, i+w) if i == 0 { switch value[i] { case '#', ',', '[', ']', '{', '}', '&', '*', '!', '|', '>', '\'', '"', '%', '@', '`': flow_indicators = true block_indicators = true case '?', ':': flow_indicators = true if followed_by_whitespace { block_indicators = true } case '-': if followed_by_whitespace { flow_indicators = true block_indicators = true } } } else { switch value[i] { case ',', '?', '[', ']', '{', '}': flow_indicators = true case ':': flow_indicators = true if followed_by_whitespace { block_indicators = true } case '#': if preceded_by_whitespace { flow_indicators = true block_indicators = true } } } if value[i] == '\t' { tab_characters = true } else if !is_printable(value, i) || !is_ascii(value, i) && !emitter.unicode { special_characters = true } if is_space(value, i) { if i == 0 { leading_space = true } if i+width(value[i]) == len(value) { trailing_space = true } if previous_break { break_space = true } previous_space = true previous_break = false } else if is_break(value, i) { line_breaks = true if i == 0 { leading_break = true } if i+width(value[i]) == len(value) { trailing_break = true } if previous_space { space_break = true } previous_space = false previous_break = true } else { previous_space = false previous_break = false } // [Go]: Why 'z'? Couldn't be the end of the string as that's the loop condition. preceded_by_whitespace = is_blankz(value, i) } emitter.scalar_data.multiline = line_breaks emitter.scalar_data.flow_plain_allowed = true emitter.scalar_data.block_plain_allowed = true emitter.scalar_data.single_quoted_allowed = true emitter.scalar_data.block_allowed = true if leading_space || leading_break || trailing_space || trailing_break { emitter.scalar_data.flow_plain_allowed = false emitter.scalar_data.block_plain_allowed = false } if trailing_space { emitter.scalar_data.block_allowed = false } if break_space { emitter.scalar_data.flow_plain_allowed = false emitter.scalar_data.block_plain_allowed = false emitter.scalar_data.single_quoted_allowed = false } if space_break || tab_characters || special_characters { emitter.scalar_data.flow_plain_allowed = false emitter.scalar_data.block_plain_allowed = false emitter.scalar_data.single_quoted_allowed = false } if space_break || special_characters { emitter.scalar_data.block_allowed = false } if line_breaks { emitter.scalar_data.flow_plain_allowed = false emitter.scalar_data.block_plain_allowed = false } if flow_indicators { emitter.scalar_data.flow_plain_allowed = false } if block_indicators { emitter.scalar_data.block_plain_allowed = false } return true } // Check if the event data is valid. func yaml_emitter_analyze_event(emitter *yaml_emitter_t, event *yaml_event_t) bool { emitter.anchor_data.anchor = nil emitter.tag_data.handle = nil emitter.tag_data.suffix = nil emitter.scalar_data.value = nil if len(event.head_comment) > 0 { emitter.head_comment = event.head_comment } if len(event.line_comment) > 0 { emitter.line_comment = event.line_comment } if len(event.foot_comment) > 0 { emitter.foot_comment = event.foot_comment } if len(event.tail_comment) > 0 { emitter.tail_comment = event.tail_comment } switch event.typ { case yaml_ALIAS_EVENT: if !yaml_emitter_analyze_anchor(emitter, event.anchor, true) { return false } case yaml_SCALAR_EVENT: if len(event.anchor) > 0 { if !yaml_emitter_analyze_anchor(emitter, event.anchor, false) { return false } } if len(event.tag) > 0 && (emitter.canonical || (!event.implicit && !event.quoted_implicit)) { if !yaml_emitter_analyze_tag(emitter, event.tag) { return false } } if !yaml_emitter_analyze_scalar(emitter, event.value) { return false } case yaml_SEQUENCE_START_EVENT: if len(event.anchor) > 0 { if !yaml_emitter_analyze_anchor(emitter, event.anchor, false) { return false } } if len(event.tag) > 0 && (emitter.canonical || !event.implicit) { if !yaml_emitter_analyze_tag(emitter, event.tag) { return false } } case yaml_MAPPING_START_EVENT: if len(event.anchor) > 0 { if !yaml_emitter_analyze_anchor(emitter, event.anchor, false) { return false } } if len(event.tag) > 0 && (emitter.canonical || !event.implicit) { if !yaml_emitter_analyze_tag(emitter, event.tag) { return false } } } return true } // Write the BOM character. func yaml_emitter_write_bom(emitter *yaml_emitter_t) bool { if !flush(emitter) { return false } pos := emitter.buffer_pos emitter.buffer[pos+0] = '\xEF' emitter.buffer[pos+1] = '\xBB' emitter.buffer[pos+2] = '\xBF' emitter.buffer_pos += 3 return true } func yaml_emitter_write_indent(emitter *yaml_emitter_t) bool { indent := emitter.indent if indent < 0 { indent = 0 } if !emitter.indention || emitter.column > indent || (emitter.column == indent && !emitter.whitespace) { if !put_break(emitter) { return false } } if emitter.foot_indent == indent { if !put_break(emitter) { return false } } for emitter.column < indent { if !put(emitter, ' ') { return false } } emitter.whitespace = true //emitter.indention = true emitter.space_above = false emitter.foot_indent = -1 return true } func yaml_emitter_write_indicator(emitter *yaml_emitter_t, indicator []byte, need_whitespace, is_whitespace, is_indention bool) bool { if need_whitespace && !emitter.whitespace { if !put(emitter, ' ') { return false } } if !write_all(emitter, indicator) { return false } emitter.whitespace = is_whitespace emitter.indention = (emitter.indention && is_indention) emitter.open_ended = false return true } func yaml_emitter_write_anchor(emitter *yaml_emitter_t, value []byte) bool { if !write_all(emitter, value) { return false } emitter.whitespace = false emitter.indention = false return true } func yaml_emitter_write_tag_handle(emitter *yaml_emitter_t, value []byte) bool { if !emitter.whitespace { if !put(emitter, ' ') { return false } } if !write_all(emitter, value) { return false } emitter.whitespace = false emitter.indention = false return true } func yaml_emitter_write_tag_content(emitter *yaml_emitter_t, value []byte, need_whitespace bool) bool { if need_whitespace && !emitter.whitespace { if !put(emitter, ' ') { return false } } for i := 0; i < len(value); { var must_write bool switch value[i] { case ';', '/', '?', ':', '@', '&', '=', '+', '$', ',', '_', '.', '~', '*', '\'', '(', ')', '[', ']': must_write = true default: must_write = is_alpha(value, i) } if must_write { if !write(emitter, value, &i) { return false } } else { w := width(value[i]) for k := 0; k < w; k++ { octet := value[i] i++ if !put(emitter, '%') { return false } c := octet >> 4 if c < 10 { c += '0' } else { c += 'A' - 10 } if !put(emitter, c) { return false } c = octet & 0x0f if c < 10 { c += '0' } else { c += 'A' - 10 } if !put(emitter, c) { return false } } } } emitter.whitespace = false emitter.indention = false return true } func yaml_emitter_write_plain_scalar(emitter *yaml_emitter_t, value []byte, allow_breaks bool) bool { if len(value) > 0 && !emitter.whitespace { if !put(emitter, ' ') { return false } } spaces := false breaks := false for i := 0; i < len(value); { if is_space(value, i) { if allow_breaks && !spaces && emitter.column > emitter.best_width && !is_space(value, i+1) { if !yaml_emitter_write_indent(emitter) { return false } i += width(value[i]) } else { if !write(emitter, value, &i) { return false } } spaces = true } else if is_break(value, i) { if !breaks && value[i] == '\n' { if !put_break(emitter) { return false } } if !write_break(emitter, value, &i) { return false } //emitter.indention = true breaks = true } else { if breaks { if !yaml_emitter_write_indent(emitter) { return false } } if !write(emitter, value, &i) { return false } emitter.indention = false spaces = false breaks = false } } if len(value) > 0 { emitter.whitespace = false } emitter.indention = false if emitter.root_context { emitter.open_ended = true } return true } func yaml_emitter_write_single_quoted_scalar(emitter *yaml_emitter_t, value []byte, allow_breaks bool) bool { if !yaml_emitter_write_indicator(emitter, []byte{'\''}, true, false, false) { return false } spaces := false breaks := false for i := 0; i < len(value); { if is_space(value, i) { if allow_breaks && !spaces && emitter.column > emitter.best_width && i > 0 && i < len(value)-1 && !is_space(value, i+1) { if !yaml_emitter_write_indent(emitter) { return false } i += width(value[i]) } else { if !write(emitter, value, &i) { return false } } spaces = true } else if is_break(value, i) { if !breaks && value[i] == '\n' { if !put_break(emitter) { return false } } if !write_break(emitter, value, &i) { return false } //emitter.indention = true breaks = true } else { if breaks { if !yaml_emitter_write_indent(emitter) { return false } } if value[i] == '\'' { if !put(emitter, '\'') { return false } } if !write(emitter, value, &i) { return false } emitter.indention = false spaces = false breaks = false } } if !yaml_emitter_write_indicator(emitter, []byte{'\''}, false, false, false) { return false } emitter.whitespace = false emitter.indention = false return true } func yaml_emitter_write_double_quoted_scalar(emitter *yaml_emitter_t, value []byte, allow_breaks bool) bool { spaces := false if !yaml_emitter_write_indicator(emitter, []byte{'"'}, true, false, false) { return false } for i := 0; i < len(value); { if !is_printable(value, i) || (!emitter.unicode && !is_ascii(value, i)) || is_bom(value, i) || is_break(value, i) || value[i] == '"' || value[i] == '\\' { octet := value[i] var w int var v rune switch { case octet&0x80 == 0x00: w, v = 1, rune(octet&0x7F) case octet&0xE0 == 0xC0: w, v = 2, rune(octet&0x1F) case octet&0xF0 == 0xE0: w, v = 3, rune(octet&0x0F) case octet&0xF8 == 0xF0: w, v = 4, rune(octet&0x07) } for k := 1; k < w; k++ { octet = value[i+k] v = (v << 6) + (rune(octet) & 0x3F) } i += w if !put(emitter, '\\') { return false } var ok bool switch v { case 0x00: ok = put(emitter, '0') case 0x07: ok = put(emitter, 'a') case 0x08: ok = put(emitter, 'b') case 0x09: ok = put(emitter, 't') case 0x0A: ok = put(emitter, 'n') case 0x0b: ok = put(emitter, 'v') case 0x0c: ok = put(emitter, 'f') case 0x0d: ok = put(emitter, 'r') case 0x1b: ok = put(emitter, 'e') case 0x22: ok = put(emitter, '"') case 0x5c: ok = put(emitter, '\\') case 0x85: ok = put(emitter, 'N') case 0xA0: ok = put(emitter, '_') case 0x2028: ok = put(emitter, 'L') case 0x2029: ok = put(emitter, 'P') default: if v <= 0xFF { ok = put(emitter, 'x') w = 2 } else if v <= 0xFFFF { ok = put(emitter, 'u') w = 4 } else { ok = put(emitter, 'U') w = 8 } for k := (w - 1) * 4; ok && k >= 0; k -= 4 { digit := byte((v >> uint(k)) & 0x0F) if digit < 10 { ok = put(emitter, digit+'0') } else { ok = put(emitter, digit+'A'-10) } } } if !ok { return false } spaces = false } else if is_space(value, i) { if allow_breaks && !spaces && emitter.column > emitter.best_width && i > 0 && i < len(value)-1 { if !yaml_emitter_write_indent(emitter) { return false } if is_space(value, i+1) { if !put(emitter, '\\') { return false } } i += width(value[i]) } else if !write(emitter, value, &i) { return false } spaces = true } else { if !write(emitter, value, &i) { return false } spaces = false } } if !yaml_emitter_write_indicator(emitter, []byte{'"'}, false, false, false) { return false } emitter.whitespace = false emitter.indention = false return true } func yaml_emitter_write_block_scalar_hints(emitter *yaml_emitter_t, value []byte) bool { if is_space(value, 0) || is_break(value, 0) { indent_hint := []byte{'0' + byte(emitter.best_indent)} if !yaml_emitter_write_indicator(emitter, indent_hint, false, false, false) { return false } } emitter.open_ended = false var chomp_hint [1]byte if len(value) == 0 { chomp_hint[0] = '-' } else { i := len(value) - 1 for value[i]&0xC0 == 0x80 { i-- } if !is_break(value, i) { chomp_hint[0] = '-' } else if i == 0 { chomp_hint[0] = '+' emitter.open_ended = true } else { i-- for value[i]&0xC0 == 0x80 { i-- } if is_break(value, i) { chomp_hint[0] = '+' emitter.open_ended = true } } } if chomp_hint[0] != 0 { if !yaml_emitter_write_indicator(emitter, chomp_hint[:], false, false, false) { return false } } return true } func yaml_emitter_write_literal_scalar(emitter *yaml_emitter_t, value []byte) bool { if !yaml_emitter_write_indicator(emitter, []byte{'|'}, true, false, false) { return false } if !yaml_emitter_write_block_scalar_hints(emitter, value) { return false } if !yaml_emitter_process_line_comment(emitter) { return false } //emitter.indention = true emitter.whitespace = true breaks := true for i := 0; i < len(value); { if is_break(value, i) { if !write_break(emitter, value, &i) { return false } //emitter.indention = true breaks = true } else { if breaks { if !yaml_emitter_write_indent(emitter) { return false } } if !write(emitter, value, &i) { return false } emitter.indention = false breaks = false } } return true } func yaml_emitter_write_folded_scalar(emitter *yaml_emitter_t, value []byte) bool { if !yaml_emitter_write_indicator(emitter, []byte{'>'}, true, false, false) { return false } if !yaml_emitter_write_block_scalar_hints(emitter, value) { return false } if !yaml_emitter_process_line_comment(emitter) { return false } //emitter.indention = true emitter.whitespace = true breaks := true leading_spaces := true for i := 0; i < len(value); { if is_break(value, i) { if !breaks && !leading_spaces && value[i] == '\n' { k := 0 for is_break(value, k) { k += width(value[k]) } if !is_blankz(value, k) { if !put_break(emitter) { return false } } } if !write_break(emitter, value, &i) { return false } //emitter.indention = true breaks = true } else { if breaks { if !yaml_emitter_write_indent(emitter) { return false } leading_spaces = is_blank(value, i) } if !breaks && is_space(value, i) && !is_space(value, i+1) && emitter.column > emitter.best_width { if !yaml_emitter_write_indent(emitter) { return false } i += width(value[i]) } else { if !write(emitter, value, &i) { return false } } emitter.indention = false breaks = false } } return true } func yaml_emitter_write_comment(emitter *yaml_emitter_t, comment []byte) bool { breaks := false pound := false for i := 0; i < len(comment); { if is_break(comment, i) { if !write_break(emitter, comment, &i) { return false } //emitter.indention = true breaks = true pound = false } else { if breaks && !yaml_emitter_write_indent(emitter) { return false } if !pound { if comment[i] != '#' && (!put(emitter, '#') || !put(emitter, ' ')) { return false } pound = true } if !write(emitter, comment, &i) { return false } emitter.indention = false breaks = false } } if !breaks && !put_break(emitter) { return false } emitter.whitespace = true //emitter.indention = true return true } ================================================ FILE: vendor/gopkg.in/yaml.v3/encode.go ================================================ // // Copyright (c) 2011-2019 Canonical Ltd // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package yaml import ( "encoding" "fmt" "io" "reflect" "regexp" "sort" "strconv" "strings" "time" "unicode/utf8" ) type encoder struct { emitter yaml_emitter_t event yaml_event_t out []byte flow bool indent int doneInit bool } func newEncoder() *encoder { e := &encoder{} yaml_emitter_initialize(&e.emitter) yaml_emitter_set_output_string(&e.emitter, &e.out) yaml_emitter_set_unicode(&e.emitter, true) return e } func newEncoderWithWriter(w io.Writer) *encoder { e := &encoder{} yaml_emitter_initialize(&e.emitter) yaml_emitter_set_output_writer(&e.emitter, w) yaml_emitter_set_unicode(&e.emitter, true) return e } func (e *encoder) init() { if e.doneInit { return } if e.indent == 0 { e.indent = 4 } e.emitter.best_indent = e.indent yaml_stream_start_event_initialize(&e.event, yaml_UTF8_ENCODING) e.emit() e.doneInit = true } func (e *encoder) finish() { e.emitter.open_ended = false yaml_stream_end_event_initialize(&e.event) e.emit() } func (e *encoder) destroy() { yaml_emitter_delete(&e.emitter) } func (e *encoder) emit() { // This will internally delete the e.event value. e.must(yaml_emitter_emit(&e.emitter, &e.event)) } func (e *encoder) must(ok bool) { if !ok { msg := e.emitter.problem if msg == "" { msg = "unknown problem generating YAML content" } failf("%s", msg) } } func (e *encoder) marshalDoc(tag string, in reflect.Value) { e.init() var node *Node if in.IsValid() { node, _ = in.Interface().(*Node) } if node != nil && node.Kind == DocumentNode { e.nodev(in) } else { yaml_document_start_event_initialize(&e.event, nil, nil, true) e.emit() e.marshal(tag, in) yaml_document_end_event_initialize(&e.event, true) e.emit() } } func (e *encoder) marshal(tag string, in reflect.Value) { tag = shortTag(tag) if !in.IsValid() || in.Kind() == reflect.Ptr && in.IsNil() { e.nilv() return } iface := in.Interface() switch value := iface.(type) { case *Node: e.nodev(in) return case Node: if !in.CanAddr() { var n = reflect.New(in.Type()).Elem() n.Set(in) in = n } e.nodev(in.Addr()) return case time.Time: e.timev(tag, in) return case *time.Time: e.timev(tag, in.Elem()) return case time.Duration: e.stringv(tag, reflect.ValueOf(value.String())) return case Marshaler: v, err := value.MarshalYAML() if err != nil { fail(err) } if v == nil { e.nilv() return } e.marshal(tag, reflect.ValueOf(v)) return case encoding.TextMarshaler: text, err := value.MarshalText() if err != nil { fail(err) } in = reflect.ValueOf(string(text)) case nil: e.nilv() return } switch in.Kind() { case reflect.Interface: e.marshal(tag, in.Elem()) case reflect.Map: e.mapv(tag, in) case reflect.Ptr: e.marshal(tag, in.Elem()) case reflect.Struct: e.structv(tag, in) case reflect.Slice, reflect.Array: e.slicev(tag, in) case reflect.String: e.stringv(tag, in) case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: e.intv(tag, in) case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: e.uintv(tag, in) case reflect.Float32, reflect.Float64: e.floatv(tag, in) case reflect.Bool: e.boolv(tag, in) default: panic("cannot marshal type: " + in.Type().String()) } } func (e *encoder) mapv(tag string, in reflect.Value) { e.mappingv(tag, func() { keys := keyList(in.MapKeys()) sort.Sort(keys) for _, k := range keys { e.marshal("", k) e.marshal("", in.MapIndex(k)) } }) } func (e *encoder) fieldByIndex(v reflect.Value, index []int) (field reflect.Value) { for _, num := range index { for { if v.Kind() == reflect.Ptr { if v.IsNil() { return reflect.Value{} } v = v.Elem() continue } break } v = v.Field(num) } return v } func (e *encoder) structv(tag string, in reflect.Value) { sinfo, err := getStructInfo(in.Type()) if err != nil { panic(err) } e.mappingv(tag, func() { for _, info := range sinfo.FieldsList { var value reflect.Value if info.Inline == nil { value = in.Field(info.Num) } else { value = e.fieldByIndex(in, info.Inline) if !value.IsValid() { continue } } if info.OmitEmpty && isZero(value) { continue } e.marshal("", reflect.ValueOf(info.Key)) e.flow = info.Flow e.marshal("", value) } if sinfo.InlineMap >= 0 { m := in.Field(sinfo.InlineMap) if m.Len() > 0 { e.flow = false keys := keyList(m.MapKeys()) sort.Sort(keys) for _, k := range keys { if _, found := sinfo.FieldsMap[k.String()]; found { panic(fmt.Sprintf("cannot have key %q in inlined map: conflicts with struct field", k.String())) } e.marshal("", k) e.flow = false e.marshal("", m.MapIndex(k)) } } } }) } func (e *encoder) mappingv(tag string, f func()) { implicit := tag == "" style := yaml_BLOCK_MAPPING_STYLE if e.flow { e.flow = false style = yaml_FLOW_MAPPING_STYLE } yaml_mapping_start_event_initialize(&e.event, nil, []byte(tag), implicit, style) e.emit() f() yaml_mapping_end_event_initialize(&e.event) e.emit() } func (e *encoder) slicev(tag string, in reflect.Value) { implicit := tag == "" style := yaml_BLOCK_SEQUENCE_STYLE if e.flow { e.flow = false style = yaml_FLOW_SEQUENCE_STYLE } e.must(yaml_sequence_start_event_initialize(&e.event, nil, []byte(tag), implicit, style)) e.emit() n := in.Len() for i := 0; i < n; i++ { e.marshal("", in.Index(i)) } e.must(yaml_sequence_end_event_initialize(&e.event)) e.emit() } // isBase60 returns whether s is in base 60 notation as defined in YAML 1.1. // // The base 60 float notation in YAML 1.1 is a terrible idea and is unsupported // in YAML 1.2 and by this package, but these should be marshalled quoted for // the time being for compatibility with other parsers. func isBase60Float(s string) (result bool) { // Fast path. if s == "" { return false } c := s[0] if !(c == '+' || c == '-' || c >= '0' && c <= '9') || strings.IndexByte(s, ':') < 0 { return false } // Do the full match. return base60float.MatchString(s) } // From http://yaml.org/type/float.html, except the regular expression there // is bogus. In practice parsers do not enforce the "\.[0-9_]*" suffix. var base60float = regexp.MustCompile(`^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+(?:\.[0-9_]*)?$`) // isOldBool returns whether s is bool notation as defined in YAML 1.1. // // We continue to force strings that YAML 1.1 would interpret as booleans to be // rendered as quotes strings so that the marshalled output valid for YAML 1.1 // parsing. func isOldBool(s string) (result bool) { switch s { case "y", "Y", "yes", "Yes", "YES", "on", "On", "ON", "n", "N", "no", "No", "NO", "off", "Off", "OFF": return true default: return false } } func (e *encoder) stringv(tag string, in reflect.Value) { var style yaml_scalar_style_t s := in.String() canUsePlain := true switch { case !utf8.ValidString(s): if tag == binaryTag { failf("explicitly tagged !!binary data must be base64-encoded") } if tag != "" { failf("cannot marshal invalid UTF-8 data as %s", shortTag(tag)) } // It can't be encoded directly as YAML so use a binary tag // and encode it as base64. tag = binaryTag s = encodeBase64(s) case tag == "": // Check to see if it would resolve to a specific // tag when encoded unquoted. If it doesn't, // there's no need to quote it. rtag, _ := resolve("", s) canUsePlain = rtag == strTag && !(isBase60Float(s) || isOldBool(s)) } // Note: it's possible for user code to emit invalid YAML // if they explicitly specify a tag and a string containing // text that's incompatible with that tag. switch { case strings.Contains(s, "\n"): if e.flow { style = yaml_DOUBLE_QUOTED_SCALAR_STYLE } else { style = yaml_LITERAL_SCALAR_STYLE } case canUsePlain: style = yaml_PLAIN_SCALAR_STYLE default: style = yaml_DOUBLE_QUOTED_SCALAR_STYLE } e.emitScalar(s, "", tag, style, nil, nil, nil, nil) } func (e *encoder) boolv(tag string, in reflect.Value) { var s string if in.Bool() { s = "true" } else { s = "false" } e.emitScalar(s, "", tag, yaml_PLAIN_SCALAR_STYLE, nil, nil, nil, nil) } func (e *encoder) intv(tag string, in reflect.Value) { s := strconv.FormatInt(in.Int(), 10) e.emitScalar(s, "", tag, yaml_PLAIN_SCALAR_STYLE, nil, nil, nil, nil) } func (e *encoder) uintv(tag string, in reflect.Value) { s := strconv.FormatUint(in.Uint(), 10) e.emitScalar(s, "", tag, yaml_PLAIN_SCALAR_STYLE, nil, nil, nil, nil) } func (e *encoder) timev(tag string, in reflect.Value) { t := in.Interface().(time.Time) s := t.Format(time.RFC3339Nano) e.emitScalar(s, "", tag, yaml_PLAIN_SCALAR_STYLE, nil, nil, nil, nil) } func (e *encoder) floatv(tag string, in reflect.Value) { // Issue #352: When formatting, use the precision of the underlying value precision := 64 if in.Kind() == reflect.Float32 { precision = 32 } s := strconv.FormatFloat(in.Float(), 'g', -1, precision) switch s { case "+Inf": s = ".inf" case "-Inf": s = "-.inf" case "NaN": s = ".nan" } e.emitScalar(s, "", tag, yaml_PLAIN_SCALAR_STYLE, nil, nil, nil, nil) } func (e *encoder) nilv() { e.emitScalar("null", "", "", yaml_PLAIN_SCALAR_STYLE, nil, nil, nil, nil) } func (e *encoder) emitScalar(value, anchor, tag string, style yaml_scalar_style_t, head, line, foot, tail []byte) { // TODO Kill this function. Replace all initialize calls by their underlining Go literals. implicit := tag == "" if !implicit { tag = longTag(tag) } e.must(yaml_scalar_event_initialize(&e.event, []byte(anchor), []byte(tag), []byte(value), implicit, implicit, style)) e.event.head_comment = head e.event.line_comment = line e.event.foot_comment = foot e.event.tail_comment = tail e.emit() } func (e *encoder) nodev(in reflect.Value) { e.node(in.Interface().(*Node), "") } func (e *encoder) node(node *Node, tail string) { // Zero nodes behave as nil. if node.Kind == 0 && node.IsZero() { e.nilv() return } // If the tag was not explicitly requested, and dropping it won't change the // implicit tag of the value, don't include it in the presentation. var tag = node.Tag var stag = shortTag(tag) var forceQuoting bool if tag != "" && node.Style&TaggedStyle == 0 { if node.Kind == ScalarNode { if stag == strTag && node.Style&(SingleQuotedStyle|DoubleQuotedStyle|LiteralStyle|FoldedStyle) != 0 { tag = "" } else { rtag, _ := resolve("", node.Value) if rtag == stag { tag = "" } else if stag == strTag { tag = "" forceQuoting = true } } } else { var rtag string switch node.Kind { case MappingNode: rtag = mapTag case SequenceNode: rtag = seqTag } if rtag == stag { tag = "" } } } switch node.Kind { case DocumentNode: yaml_document_start_event_initialize(&e.event, nil, nil, true) e.event.head_comment = []byte(node.HeadComment) e.emit() for _, node := range node.Content { e.node(node, "") } yaml_document_end_event_initialize(&e.event, true) e.event.foot_comment = []byte(node.FootComment) e.emit() case SequenceNode: style := yaml_BLOCK_SEQUENCE_STYLE if node.Style&FlowStyle != 0 { style = yaml_FLOW_SEQUENCE_STYLE } e.must(yaml_sequence_start_event_initialize(&e.event, []byte(node.Anchor), []byte(longTag(tag)), tag == "", style)) e.event.head_comment = []byte(node.HeadComment) e.emit() for _, node := range node.Content { e.node(node, "") } e.must(yaml_sequence_end_event_initialize(&e.event)) e.event.line_comment = []byte(node.LineComment) e.event.foot_comment = []byte(node.FootComment) e.emit() case MappingNode: style := yaml_BLOCK_MAPPING_STYLE if node.Style&FlowStyle != 0 { style = yaml_FLOW_MAPPING_STYLE } yaml_mapping_start_event_initialize(&e.event, []byte(node.Anchor), []byte(longTag(tag)), tag == "", style) e.event.tail_comment = []byte(tail) e.event.head_comment = []byte(node.HeadComment) e.emit() // The tail logic below moves the foot comment of prior keys to the following key, // since the value for each key may be a nested structure and the foot needs to be // processed only the entirety of the value is streamed. The last tail is processed // with the mapping end event. var tail string for i := 0; i+1 < len(node.Content); i += 2 { k := node.Content[i] foot := k.FootComment if foot != "" { kopy := *k kopy.FootComment = "" k = &kopy } e.node(k, tail) tail = foot v := node.Content[i+1] e.node(v, "") } yaml_mapping_end_event_initialize(&e.event) e.event.tail_comment = []byte(tail) e.event.line_comment = []byte(node.LineComment) e.event.foot_comment = []byte(node.FootComment) e.emit() case AliasNode: yaml_alias_event_initialize(&e.event, []byte(node.Value)) e.event.head_comment = []byte(node.HeadComment) e.event.line_comment = []byte(node.LineComment) e.event.foot_comment = []byte(node.FootComment) e.emit() case ScalarNode: value := node.Value if !utf8.ValidString(value) { if stag == binaryTag { failf("explicitly tagged !!binary data must be base64-encoded") } if stag != "" { failf("cannot marshal invalid UTF-8 data as %s", stag) } // It can't be encoded directly as YAML so use a binary tag // and encode it as base64. tag = binaryTag value = encodeBase64(value) } style := yaml_PLAIN_SCALAR_STYLE switch { case node.Style&DoubleQuotedStyle != 0: style = yaml_DOUBLE_QUOTED_SCALAR_STYLE case node.Style&SingleQuotedStyle != 0: style = yaml_SINGLE_QUOTED_SCALAR_STYLE case node.Style&LiteralStyle != 0: style = yaml_LITERAL_SCALAR_STYLE case node.Style&FoldedStyle != 0: style = yaml_FOLDED_SCALAR_STYLE case strings.Contains(value, "\n"): style = yaml_LITERAL_SCALAR_STYLE case forceQuoting: style = yaml_DOUBLE_QUOTED_SCALAR_STYLE } e.emitScalar(value, node.Anchor, tag, style, []byte(node.HeadComment), []byte(node.LineComment), []byte(node.FootComment), []byte(tail)) default: failf("cannot encode node with unknown kind %d", node.Kind) } } ================================================ FILE: vendor/gopkg.in/yaml.v3/parserc.go ================================================ // // Copyright (c) 2011-2019 Canonical Ltd // Copyright (c) 2006-2010 Kirill Simonov // // Permission is hereby granted, free of charge, to any person obtaining a copy of // this software and associated documentation files (the "Software"), to deal in // the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies // of the Software, and to permit persons to whom the Software is furnished to do // so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. package yaml import ( "bytes" ) // The parser implements the following grammar: // // stream ::= STREAM-START implicit_document? explicit_document* STREAM-END // implicit_document ::= block_node DOCUMENT-END* // explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* // block_node_or_indentless_sequence ::= // ALIAS // | properties (block_content | indentless_block_sequence)? // | block_content // | indentless_block_sequence // block_node ::= ALIAS // | properties block_content? // | block_content // flow_node ::= ALIAS // | properties flow_content? // | flow_content // properties ::= TAG ANCHOR? | ANCHOR TAG? // block_content ::= block_collection | flow_collection | SCALAR // flow_content ::= flow_collection | SCALAR // block_collection ::= block_sequence | block_mapping // flow_collection ::= flow_sequence | flow_mapping // block_sequence ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END // indentless_sequence ::= (BLOCK-ENTRY block_node?)+ // block_mapping ::= BLOCK-MAPPING_START // ((KEY block_node_or_indentless_sequence?)? // (VALUE block_node_or_indentless_sequence?)?)* // BLOCK-END // flow_sequence ::= FLOW-SEQUENCE-START // (flow_sequence_entry FLOW-ENTRY)* // flow_sequence_entry? // FLOW-SEQUENCE-END // flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? // flow_mapping ::= FLOW-MAPPING-START // (flow_mapping_entry FLOW-ENTRY)* // flow_mapping_entry? // FLOW-MAPPING-END // flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? // Peek the next token in the token queue. func peek_token(parser *yaml_parser_t) *yaml_token_t { if parser.token_available || yaml_parser_fetch_more_tokens(parser) { token := &parser.tokens[parser.tokens_head] yaml_parser_unfold_comments(parser, token) return token } return nil } // yaml_parser_unfold_comments walks through the comments queue and joins all // comments behind the position of the provided token into the respective // top-level comment slices in the parser. func yaml_parser_unfold_comments(parser *yaml_parser_t, token *yaml_token_t) { for parser.comments_head < len(parser.comments) && token.start_mark.index >= parser.comments[parser.comments_head].token_mark.index { comment := &parser.comments[parser.comments_head] if len(comment.head) > 0 { if token.typ == yaml_BLOCK_END_TOKEN { // No heads on ends, so keep comment.head for a follow up token. break } if len(parser.head_comment) > 0 { parser.head_comment = append(parser.head_comment, '\n') } parser.head_comment = append(parser.head_comment, comment.head...) } if len(comment.foot) > 0 { if len(parser.foot_comment) > 0 { parser.foot_comment = append(parser.foot_comment, '\n') } parser.foot_comment = append(parser.foot_comment, comment.foot...) } if len(comment.line) > 0 { if len(parser.line_comment) > 0 { parser.line_comment = append(parser.line_comment, '\n') } parser.line_comment = append(parser.line_comment, comment.line...) } *comment = yaml_comment_t{} parser.comments_head++ } } // Remove the next token from the queue (must be called after peek_token). func skip_token(parser *yaml_parser_t) { parser.token_available = false parser.tokens_parsed++ parser.stream_end_produced = parser.tokens[parser.tokens_head].typ == yaml_STREAM_END_TOKEN parser.tokens_head++ } // Get the next event. func yaml_parser_parse(parser *yaml_parser_t, event *yaml_event_t) bool { // Erase the event object. *event = yaml_event_t{} // No events after the end of the stream or error. if parser.stream_end_produced || parser.error != yaml_NO_ERROR || parser.state == yaml_PARSE_END_STATE { return true } // Generate the next event. return yaml_parser_state_machine(parser, event) } // Set parser error. func yaml_parser_set_parser_error(parser *yaml_parser_t, problem string, problem_mark yaml_mark_t) bool { parser.error = yaml_PARSER_ERROR parser.problem = problem parser.problem_mark = problem_mark return false } func 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 { parser.error = yaml_PARSER_ERROR parser.context = context parser.context_mark = context_mark parser.problem = problem parser.problem_mark = problem_mark return false } // State dispatcher. func yaml_parser_state_machine(parser *yaml_parser_t, event *yaml_event_t) bool { //trace("yaml_parser_state_machine", "state:", parser.state.String()) switch parser.state { case yaml_PARSE_STREAM_START_STATE: return yaml_parser_parse_stream_start(parser, event) case yaml_PARSE_IMPLICIT_DOCUMENT_START_STATE: return yaml_parser_parse_document_start(parser, event, true) case yaml_PARSE_DOCUMENT_START_STATE: return yaml_parser_parse_document_start(parser, event, false) case yaml_PARSE_DOCUMENT_CONTENT_STATE: return yaml_parser_parse_document_content(parser, event) case yaml_PARSE_DOCUMENT_END_STATE: return yaml_parser_parse_document_end(parser, event) case yaml_PARSE_BLOCK_NODE_STATE: return yaml_parser_parse_node(parser, event, true, false) case yaml_PARSE_BLOCK_NODE_OR_INDENTLESS_SEQUENCE_STATE: return yaml_parser_parse_node(parser, event, true, true) case yaml_PARSE_FLOW_NODE_STATE: return yaml_parser_parse_node(parser, event, false, false) case yaml_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE: return yaml_parser_parse_block_sequence_entry(parser, event, true) case yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE: return yaml_parser_parse_block_sequence_entry(parser, event, false) case yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE: return yaml_parser_parse_indentless_sequence_entry(parser, event) case yaml_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE: return yaml_parser_parse_block_mapping_key(parser, event, true) case yaml_PARSE_BLOCK_MAPPING_KEY_STATE: return yaml_parser_parse_block_mapping_key(parser, event, false) case yaml_PARSE_BLOCK_MAPPING_VALUE_STATE: return yaml_parser_parse_block_mapping_value(parser, event) case yaml_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE: return yaml_parser_parse_flow_sequence_entry(parser, event, true) case yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE: return yaml_parser_parse_flow_sequence_entry(parser, event, false) case yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE: return yaml_parser_parse_flow_sequence_entry_mapping_key(parser, event) case yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE: return yaml_parser_parse_flow_sequence_entry_mapping_value(parser, event) case yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE: return yaml_parser_parse_flow_sequence_entry_mapping_end(parser, event) case yaml_PARSE_FLOW_MAPPING_FIRST_KEY_STATE: return yaml_parser_parse_flow_mapping_key(parser, event, true) case yaml_PARSE_FLOW_MAPPING_KEY_STATE: return yaml_parser_parse_flow_mapping_key(parser, event, false) case yaml_PARSE_FLOW_MAPPING_VALUE_STATE: return yaml_parser_parse_flow_mapping_value(parser, event, false) case yaml_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE: return yaml_parser_parse_flow_mapping_value(parser, event, true) default: panic("invalid parser state") } } // Parse the production: // stream ::= STREAM-START implicit_document? explicit_document* STREAM-END // ************ func yaml_parser_parse_stream_start(parser *yaml_parser_t, event *yaml_event_t) bool { token := peek_token(parser) if token == nil { return false } if token.typ != yaml_STREAM_START_TOKEN { return yaml_parser_set_parser_error(parser, "did not find expected ", token.start_mark) } parser.state = yaml_PARSE_IMPLICIT_DOCUMENT_START_STATE *event = yaml_event_t{ typ: yaml_STREAM_START_EVENT, start_mark: token.start_mark, end_mark: token.end_mark, encoding: token.encoding, } skip_token(parser) return true } // Parse the productions: // implicit_document ::= block_node DOCUMENT-END* // * // explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* // ************************* func yaml_parser_parse_document_start(parser *yaml_parser_t, event *yaml_event_t, implicit bool) bool { token := peek_token(parser) if token == nil { return false } // Parse extra document end indicators. if !implicit { for token.typ == yaml_DOCUMENT_END_TOKEN { skip_token(parser) token = peek_token(parser) if token == nil { return false } } } if implicit && token.typ != yaml_VERSION_DIRECTIVE_TOKEN && token.typ != yaml_TAG_DIRECTIVE_TOKEN && token.typ != yaml_DOCUMENT_START_TOKEN && token.typ != yaml_STREAM_END_TOKEN { // Parse an implicit document. if !yaml_parser_process_directives(parser, nil, nil) { return false } parser.states = append(parser.states, yaml_PARSE_DOCUMENT_END_STATE) parser.state = yaml_PARSE_BLOCK_NODE_STATE var head_comment []byte if len(parser.head_comment) > 0 { // [Go] Scan the header comment backwards, and if an empty line is found, break // the header so the part before the last empty line goes into the // document header, while the bottom of it goes into a follow up event. for i := len(parser.head_comment) - 1; i > 0; i-- { if parser.head_comment[i] == '\n' { if i == len(parser.head_comment)-1 { head_comment = parser.head_comment[:i] parser.head_comment = parser.head_comment[i+1:] break } else if parser.head_comment[i-1] == '\n' { head_comment = parser.head_comment[:i-1] parser.head_comment = parser.head_comment[i+1:] break } } } } *event = yaml_event_t{ typ: yaml_DOCUMENT_START_EVENT, start_mark: token.start_mark, end_mark: token.end_mark, head_comment: head_comment, } } else if token.typ != yaml_STREAM_END_TOKEN { // Parse an explicit document. var version_directive *yaml_version_directive_t var tag_directives []yaml_tag_directive_t start_mark := token.start_mark if !yaml_parser_process_directives(parser, &version_directive, &tag_directives) { return false } token = peek_token(parser) if token == nil { return false } if token.typ != yaml_DOCUMENT_START_TOKEN { yaml_parser_set_parser_error(parser, "did not find expected ", token.start_mark) return false } parser.states = append(parser.states, yaml_PARSE_DOCUMENT_END_STATE) parser.state = yaml_PARSE_DOCUMENT_CONTENT_STATE end_mark := token.end_mark *event = yaml_event_t{ typ: yaml_DOCUMENT_START_EVENT, start_mark: start_mark, end_mark: end_mark, version_directive: version_directive, tag_directives: tag_directives, implicit: false, } skip_token(parser) } else { // Parse the stream end. parser.state = yaml_PARSE_END_STATE *event = yaml_event_t{ typ: yaml_STREAM_END_EVENT, start_mark: token.start_mark, end_mark: token.end_mark, } skip_token(parser) } return true } // Parse the productions: // explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* // *********** // func yaml_parser_parse_document_content(parser *yaml_parser_t, event *yaml_event_t) bool { token := peek_token(parser) if token == nil { return false } if token.typ == yaml_VERSION_DIRECTIVE_TOKEN || token.typ == yaml_TAG_DIRECTIVE_TOKEN || token.typ == yaml_DOCUMENT_START_TOKEN || token.typ == yaml_DOCUMENT_END_TOKEN || token.typ == yaml_STREAM_END_TOKEN { parser.state = parser.states[len(parser.states)-1] parser.states = parser.states[:len(parser.states)-1] return yaml_parser_process_empty_scalar(parser, event, token.start_mark) } return yaml_parser_parse_node(parser, event, true, false) } // Parse the productions: // implicit_document ::= block_node DOCUMENT-END* // ************* // explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* // func yaml_parser_parse_document_end(parser *yaml_parser_t, event *yaml_event_t) bool { token := peek_token(parser) if token == nil { return false } start_mark := token.start_mark end_mark := token.start_mark implicit := true if token.typ == yaml_DOCUMENT_END_TOKEN { end_mark = token.end_mark skip_token(parser) implicit = false } parser.tag_directives = parser.tag_directives[:0] parser.state = yaml_PARSE_DOCUMENT_START_STATE *event = yaml_event_t{ typ: yaml_DOCUMENT_END_EVENT, start_mark: start_mark, end_mark: end_mark, implicit: implicit, } yaml_parser_set_event_comments(parser, event) if len(event.head_comment) > 0 && len(event.foot_comment) == 0 { event.foot_comment = event.head_comment event.head_comment = nil } return true } func yaml_parser_set_event_comments(parser *yaml_parser_t, event *yaml_event_t) { event.head_comment = parser.head_comment event.line_comment = parser.line_comment event.foot_comment = parser.foot_comment parser.head_comment = nil parser.line_comment = nil parser.foot_comment = nil parser.tail_comment = nil parser.stem_comment = nil } // Parse the productions: // block_node_or_indentless_sequence ::= // ALIAS // ***** // | properties (block_content | indentless_block_sequence)? // ********** * // | block_content | indentless_block_sequence // * // block_node ::= ALIAS // ***** // | properties block_content? // ********** * // | block_content // * // flow_node ::= ALIAS // ***** // | properties flow_content? // ********** * // | flow_content // * // properties ::= TAG ANCHOR? | ANCHOR TAG? // ************************* // block_content ::= block_collection | flow_collection | SCALAR // ****** // flow_content ::= flow_collection | SCALAR // ****** func yaml_parser_parse_node(parser *yaml_parser_t, event *yaml_event_t, block, indentless_sequence bool) bool { //defer trace("yaml_parser_parse_node", "block:", block, "indentless_sequence:", indentless_sequence)() token := peek_token(parser) if token == nil { return false } if token.typ == yaml_ALIAS_TOKEN { parser.state = parser.states[len(parser.states)-1] parser.states = parser.states[:len(parser.states)-1] *event = yaml_event_t{ typ: yaml_ALIAS_EVENT, start_mark: token.start_mark, end_mark: token.end_mark, anchor: token.value, } yaml_parser_set_event_comments(parser, event) skip_token(parser) return true } start_mark := token.start_mark end_mark := token.start_mark var tag_token bool var tag_handle, tag_suffix, anchor []byte var tag_mark yaml_mark_t if token.typ == yaml_ANCHOR_TOKEN { anchor = token.value start_mark = token.start_mark end_mark = token.end_mark skip_token(parser) token = peek_token(parser) if token == nil { return false } if token.typ == yaml_TAG_TOKEN { tag_token = true tag_handle = token.value tag_suffix = token.suffix tag_mark = token.start_mark end_mark = token.end_mark skip_token(parser) token = peek_token(parser) if token == nil { return false } } } else if token.typ == yaml_TAG_TOKEN { tag_token = true tag_handle = token.value tag_suffix = token.suffix start_mark = token.start_mark tag_mark = token.start_mark end_mark = token.end_mark skip_token(parser) token = peek_token(parser) if token == nil { return false } if token.typ == yaml_ANCHOR_TOKEN { anchor = token.value end_mark = token.end_mark skip_token(parser) token = peek_token(parser) if token == nil { return false } } } var tag []byte if tag_token { if len(tag_handle) == 0 { tag = tag_suffix tag_suffix = nil } else { for i := range parser.tag_directives { if bytes.Equal(parser.tag_directives[i].handle, tag_handle) { tag = append([]byte(nil), parser.tag_directives[i].prefix...) tag = append(tag, tag_suffix...) break } } if len(tag) == 0 { yaml_parser_set_parser_error_context(parser, "while parsing a node", start_mark, "found undefined tag handle", tag_mark) return false } } } implicit := len(tag) == 0 if indentless_sequence && token.typ == yaml_BLOCK_ENTRY_TOKEN { end_mark = token.end_mark parser.state = yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE *event = yaml_event_t{ typ: yaml_SEQUENCE_START_EVENT, start_mark: start_mark, end_mark: end_mark, anchor: anchor, tag: tag, implicit: implicit, style: yaml_style_t(yaml_BLOCK_SEQUENCE_STYLE), } return true } if token.typ == yaml_SCALAR_TOKEN { var plain_implicit, quoted_implicit bool end_mark = token.end_mark if (len(tag) == 0 && token.style == yaml_PLAIN_SCALAR_STYLE) || (len(tag) == 1 && tag[0] == '!') { plain_implicit = true } else if len(tag) == 0 { quoted_implicit = true } parser.state = parser.states[len(parser.states)-1] parser.states = parser.states[:len(parser.states)-1] *event = yaml_event_t{ typ: yaml_SCALAR_EVENT, start_mark: start_mark, end_mark: end_mark, anchor: anchor, tag: tag, value: token.value, implicit: plain_implicit, quoted_implicit: quoted_implicit, style: yaml_style_t(token.style), } yaml_parser_set_event_comments(parser, event) skip_token(parser) return true } if token.typ == yaml_FLOW_SEQUENCE_START_TOKEN { // [Go] Some of the events below can be merged as they differ only on style. end_mark = token.end_mark parser.state = yaml_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE *event = yaml_event_t{ typ: yaml_SEQUENCE_START_EVENT, start_mark: start_mark, end_mark: end_mark, anchor: anchor, tag: tag, implicit: implicit, style: yaml_style_t(yaml_FLOW_SEQUENCE_STYLE), } yaml_parser_set_event_comments(parser, event) return true } if token.typ == yaml_FLOW_MAPPING_START_TOKEN { end_mark = token.end_mark parser.state = yaml_PARSE_FLOW_MAPPING_FIRST_KEY_STATE *event = yaml_event_t{ typ: yaml_MAPPING_START_EVENT, start_mark: start_mark, end_mark: end_mark, anchor: anchor, tag: tag, implicit: implicit, style: yaml_style_t(yaml_FLOW_MAPPING_STYLE), } yaml_parser_set_event_comments(parser, event) return true } if block && token.typ == yaml_BLOCK_SEQUENCE_START_TOKEN { end_mark = token.end_mark parser.state = yaml_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE *event = yaml_event_t{ typ: yaml_SEQUENCE_START_EVENT, start_mark: start_mark, end_mark: end_mark, anchor: anchor, tag: tag, implicit: implicit, style: yaml_style_t(yaml_BLOCK_SEQUENCE_STYLE), } if parser.stem_comment != nil { event.head_comment = parser.stem_comment parser.stem_comment = nil } return true } if block && token.typ == yaml_BLOCK_MAPPING_START_TOKEN { end_mark = token.end_mark parser.state = yaml_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE *event = yaml_event_t{ typ: yaml_MAPPING_START_EVENT, start_mark: start_mark, end_mark: end_mark, anchor: anchor, tag: tag, implicit: implicit, style: yaml_style_t(yaml_BLOCK_MAPPING_STYLE), } if parser.stem_comment != nil { event.head_comment = parser.stem_comment parser.stem_comment = nil } return true } if len(anchor) > 0 || len(tag) > 0 { parser.state = parser.states[len(parser.states)-1] parser.states = parser.states[:len(parser.states)-1] *event = yaml_event_t{ typ: yaml_SCALAR_EVENT, start_mark: start_mark, end_mark: end_mark, anchor: anchor, tag: tag, implicit: implicit, quoted_implicit: false, style: yaml_style_t(yaml_PLAIN_SCALAR_STYLE), } return true } context := "while parsing a flow node" if block { context = "while parsing a block node" } yaml_parser_set_parser_error_context(parser, context, start_mark, "did not find expected node content", token.start_mark) return false } // Parse the productions: // block_sequence ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END // ******************** *********** * ********* // func yaml_parser_parse_block_sequence_entry(parser *yaml_parser_t, event *yaml_event_t, first bool) bool { if first { token := peek_token(parser) if token == nil { return false } parser.marks = append(parser.marks, token.start_mark) skip_token(parser) } token := peek_token(parser) if token == nil { return false } if token.typ == yaml_BLOCK_ENTRY_TOKEN { mark := token.end_mark prior_head_len := len(parser.head_comment) skip_token(parser) yaml_parser_split_stem_comment(parser, prior_head_len) token = peek_token(parser) if token == nil { return false } if token.typ != yaml_BLOCK_ENTRY_TOKEN && token.typ != yaml_BLOCK_END_TOKEN { parser.states = append(parser.states, yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE) return yaml_parser_parse_node(parser, event, true, false) } else { parser.state = yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE return yaml_parser_process_empty_scalar(parser, event, mark) } } if token.typ == yaml_BLOCK_END_TOKEN { parser.state = parser.states[len(parser.states)-1] parser.states = parser.states[:len(parser.states)-1] parser.marks = parser.marks[:len(parser.marks)-1] *event = yaml_event_t{ typ: yaml_SEQUENCE_END_EVENT, start_mark: token.start_mark, end_mark: token.end_mark, } skip_token(parser) return true } context_mark := parser.marks[len(parser.marks)-1] parser.marks = parser.marks[:len(parser.marks)-1] return yaml_parser_set_parser_error_context(parser, "while parsing a block collection", context_mark, "did not find expected '-' indicator", token.start_mark) } // Parse the productions: // indentless_sequence ::= (BLOCK-ENTRY block_node?)+ // *********** * func yaml_parser_parse_indentless_sequence_entry(parser *yaml_parser_t, event *yaml_event_t) bool { token := peek_token(parser) if token == nil { return false } if token.typ == yaml_BLOCK_ENTRY_TOKEN { mark := token.end_mark prior_head_len := len(parser.head_comment) skip_token(parser) yaml_parser_split_stem_comment(parser, prior_head_len) token = peek_token(parser) if token == nil { return false } if token.typ != yaml_BLOCK_ENTRY_TOKEN && token.typ != yaml_KEY_TOKEN && token.typ != yaml_VALUE_TOKEN && token.typ != yaml_BLOCK_END_TOKEN { parser.states = append(parser.states, yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE) return yaml_parser_parse_node(parser, event, true, false) } parser.state = yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE return yaml_parser_process_empty_scalar(parser, event, mark) } parser.state = parser.states[len(parser.states)-1] parser.states = parser.states[:len(parser.states)-1] *event = yaml_event_t{ typ: yaml_SEQUENCE_END_EVENT, start_mark: token.start_mark, end_mark: token.start_mark, // [Go] Shouldn't this be token.end_mark? } return true } // Split stem comment from head comment. // // When a sequence or map is found under a sequence entry, the former head comment // is assigned to the underlying sequence or map as a whole, not the individual // sequence or map entry as would be expected otherwise. To handle this case the // previous head comment is moved aside as the stem comment. func yaml_parser_split_stem_comment(parser *yaml_parser_t, stem_len int) { if stem_len == 0 { return } token := peek_token(parser) if token == nil || token.typ != yaml_BLOCK_SEQUENCE_START_TOKEN && token.typ != yaml_BLOCK_MAPPING_START_TOKEN { return } parser.stem_comment = parser.head_comment[:stem_len] if len(parser.head_comment) == stem_len { parser.head_comment = nil } else { // Copy suffix to prevent very strange bugs if someone ever appends // further bytes to the prefix in the stem_comment slice above. parser.head_comment = append([]byte(nil), parser.head_comment[stem_len+1:]...) } } // Parse the productions: // block_mapping ::= BLOCK-MAPPING_START // ******************* // ((KEY block_node_or_indentless_sequence?)? // *** * // (VALUE block_node_or_indentless_sequence?)?)* // // BLOCK-END // ********* // func yaml_parser_parse_block_mapping_key(parser *yaml_parser_t, event *yaml_event_t, first bool) bool { if first { token := peek_token(parser) if token == nil { return false } parser.marks = append(parser.marks, token.start_mark) skip_token(parser) } token := peek_token(parser) if token == nil { return false } // [Go] A tail comment was left from the prior mapping value processed. Emit an event // as it needs to be processed with that value and not the following key. if len(parser.tail_comment) > 0 { *event = yaml_event_t{ typ: yaml_TAIL_COMMENT_EVENT, start_mark: token.start_mark, end_mark: token.end_mark, foot_comment: parser.tail_comment, } parser.tail_comment = nil return true } if token.typ == yaml_KEY_TOKEN { mark := token.end_mark skip_token(parser) token = peek_token(parser) if token == nil { return false } if token.typ != yaml_KEY_TOKEN && token.typ != yaml_VALUE_TOKEN && token.typ != yaml_BLOCK_END_TOKEN { parser.states = append(parser.states, yaml_PARSE_BLOCK_MAPPING_VALUE_STATE) return yaml_parser_parse_node(parser, event, true, true) } else { parser.state = yaml_PARSE_BLOCK_MAPPING_VALUE_STATE return yaml_parser_process_empty_scalar(parser, event, mark) } } else if token.typ == yaml_BLOCK_END_TOKEN { parser.state = parser.states[len(parser.states)-1] parser.states = parser.states[:len(parser.states)-1] parser.marks = parser.marks[:len(parser.marks)-1] *event = yaml_event_t{ typ: yaml_MAPPING_END_EVENT, start_mark: token.start_mark, end_mark: token.end_mark, } yaml_parser_set_event_comments(parser, event) skip_token(parser) return true } context_mark := parser.marks[len(parser.marks)-1] parser.marks = parser.marks[:len(parser.marks)-1] return yaml_parser_set_parser_error_context(parser, "while parsing a block mapping", context_mark, "did not find expected key", token.start_mark) } // Parse the productions: // block_mapping ::= BLOCK-MAPPING_START // // ((KEY block_node_or_indentless_sequence?)? // // (VALUE block_node_or_indentless_sequence?)?)* // ***** * // BLOCK-END // // func yaml_parser_parse_block_mapping_value(parser *yaml_parser_t, event *yaml_event_t) bool { token := peek_token(parser) if token == nil { return false } if token.typ == yaml_VALUE_TOKEN { mark := token.end_mark skip_token(parser) token = peek_token(parser) if token == nil { return false } if token.typ != yaml_KEY_TOKEN && token.typ != yaml_VALUE_TOKEN && token.typ != yaml_BLOCK_END_TOKEN { parser.states = append(parser.states, yaml_PARSE_BLOCK_MAPPING_KEY_STATE) return yaml_parser_parse_node(parser, event, true, true) } parser.state = yaml_PARSE_BLOCK_MAPPING_KEY_STATE return yaml_parser_process_empty_scalar(parser, event, mark) } parser.state = yaml_PARSE_BLOCK_MAPPING_KEY_STATE return yaml_parser_process_empty_scalar(parser, event, token.start_mark) } // Parse the productions: // flow_sequence ::= FLOW-SEQUENCE-START // ******************* // (flow_sequence_entry FLOW-ENTRY)* // * ********** // flow_sequence_entry? // * // FLOW-SEQUENCE-END // ***************** // flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? // * // func yaml_parser_parse_flow_sequence_entry(parser *yaml_parser_t, event *yaml_event_t, first bool) bool { if first { token := peek_token(parser) if token == nil { return false } parser.marks = append(parser.marks, token.start_mark) skip_token(parser) } token := peek_token(parser) if token == nil { return false } if token.typ != yaml_FLOW_SEQUENCE_END_TOKEN { if !first { if token.typ == yaml_FLOW_ENTRY_TOKEN { skip_token(parser) token = peek_token(parser) if token == nil { return false } } else { context_mark := parser.marks[len(parser.marks)-1] parser.marks = parser.marks[:len(parser.marks)-1] return yaml_parser_set_parser_error_context(parser, "while parsing a flow sequence", context_mark, "did not find expected ',' or ']'", token.start_mark) } } if token.typ == yaml_KEY_TOKEN { parser.state = yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE *event = yaml_event_t{ typ: yaml_MAPPING_START_EVENT, start_mark: token.start_mark, end_mark: token.end_mark, implicit: true, style: yaml_style_t(yaml_FLOW_MAPPING_STYLE), } skip_token(parser) return true } else if token.typ != yaml_FLOW_SEQUENCE_END_TOKEN { parser.states = append(parser.states, yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE) return yaml_parser_parse_node(parser, event, false, false) } } parser.state = parser.states[len(parser.states)-1] parser.states = parser.states[:len(parser.states)-1] parser.marks = parser.marks[:len(parser.marks)-1] *event = yaml_event_t{ typ: yaml_SEQUENCE_END_EVENT, start_mark: token.start_mark, end_mark: token.end_mark, } yaml_parser_set_event_comments(parser, event) skip_token(parser) return true } // // Parse the productions: // flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? // *** * // func yaml_parser_parse_flow_sequence_entry_mapping_key(parser *yaml_parser_t, event *yaml_event_t) bool { token := peek_token(parser) if token == nil { return false } if token.typ != yaml_VALUE_TOKEN && token.typ != yaml_FLOW_ENTRY_TOKEN && token.typ != yaml_FLOW_SEQUENCE_END_TOKEN { parser.states = append(parser.states, yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE) return yaml_parser_parse_node(parser, event, false, false) } mark := token.end_mark skip_token(parser) parser.state = yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE return yaml_parser_process_empty_scalar(parser, event, mark) } // Parse the productions: // flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? // ***** * // func yaml_parser_parse_flow_sequence_entry_mapping_value(parser *yaml_parser_t, event *yaml_event_t) bool { token := peek_token(parser) if token == nil { return false } if token.typ == yaml_VALUE_TOKEN { skip_token(parser) token := peek_token(parser) if token == nil { return false } if token.typ != yaml_FLOW_ENTRY_TOKEN && token.typ != yaml_FLOW_SEQUENCE_END_TOKEN { parser.states = append(parser.states, yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE) return yaml_parser_parse_node(parser, event, false, false) } } parser.state = yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE return yaml_parser_process_empty_scalar(parser, event, token.start_mark) } // Parse the productions: // flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? // * // func yaml_parser_parse_flow_sequence_entry_mapping_end(parser *yaml_parser_t, event *yaml_event_t) bool { token := peek_token(parser) if token == nil { return false } parser.state = yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE *event = yaml_event_t{ typ: yaml_MAPPING_END_EVENT, start_mark: token.start_mark, end_mark: token.start_mark, // [Go] Shouldn't this be end_mark? } return true } // Parse the productions: // flow_mapping ::= FLOW-MAPPING-START // ****************** // (flow_mapping_entry FLOW-ENTRY)* // * ********** // flow_mapping_entry? // ****************** // FLOW-MAPPING-END // **************** // flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? // * *** * // func yaml_parser_parse_flow_mapping_key(parser *yaml_parser_t, event *yaml_event_t, first bool) bool { if first { token := peek_token(parser) parser.marks = append(parser.marks, token.start_mark) skip_token(parser) } token := peek_token(parser) if token == nil { return false } if token.typ != yaml_FLOW_MAPPING_END_TOKEN { if !first { if token.typ == yaml_FLOW_ENTRY_TOKEN { skip_token(parser) token = peek_token(parser) if token == nil { return false } } else { context_mark := parser.marks[len(parser.marks)-1] parser.marks = parser.marks[:len(parser.marks)-1] return yaml_parser_set_parser_error_context(parser, "while parsing a flow mapping", context_mark, "did not find expected ',' or '}'", token.start_mark) } } if token.typ == yaml_KEY_TOKEN { skip_token(parser) token = peek_token(parser) if token == nil { return false } if token.typ != yaml_VALUE_TOKEN && token.typ != yaml_FLOW_ENTRY_TOKEN && token.typ != yaml_FLOW_MAPPING_END_TOKEN { parser.states = append(parser.states, yaml_PARSE_FLOW_MAPPING_VALUE_STATE) return yaml_parser_parse_node(parser, event, false, false) } else { parser.state = yaml_PARSE_FLOW_MAPPING_VALUE_STATE return yaml_parser_process_empty_scalar(parser, event, token.start_mark) } } else if token.typ != yaml_FLOW_MAPPING_END_TOKEN { parser.states = append(parser.states, yaml_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE) return yaml_parser_parse_node(parser, event, false, false) } } parser.state = parser.states[len(parser.states)-1] parser.states = parser.states[:len(parser.states)-1] parser.marks = parser.marks[:len(parser.marks)-1] *event = yaml_event_t{ typ: yaml_MAPPING_END_EVENT, start_mark: token.start_mark, end_mark: token.end_mark, } yaml_parser_set_event_comments(parser, event) skip_token(parser) return true } // Parse the productions: // flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? // * ***** * // func yaml_parser_parse_flow_mapping_value(parser *yaml_parser_t, event *yaml_event_t, empty bool) bool { token := peek_token(parser) if token == nil { return false } if empty { parser.state = yaml_PARSE_FLOW_MAPPING_KEY_STATE return yaml_parser_process_empty_scalar(parser, event, token.start_mark) } if token.typ == yaml_VALUE_TOKEN { skip_token(parser) token = peek_token(parser) if token == nil { return false } if token.typ != yaml_FLOW_ENTRY_TOKEN && token.typ != yaml_FLOW_MAPPING_END_TOKEN { parser.states = append(parser.states, yaml_PARSE_FLOW_MAPPING_KEY_STATE) return yaml_parser_parse_node(parser, event, false, false) } } parser.state = yaml_PARSE_FLOW_MAPPING_KEY_STATE return yaml_parser_process_empty_scalar(parser, event, token.start_mark) } // Generate an empty scalar event. func yaml_parser_process_empty_scalar(parser *yaml_parser_t, event *yaml_event_t, mark yaml_mark_t) bool { *event = yaml_event_t{ typ: yaml_SCALAR_EVENT, start_mark: mark, end_mark: mark, value: nil, // Empty implicit: true, style: yaml_style_t(yaml_PLAIN_SCALAR_STYLE), } return true } var default_tag_directives = []yaml_tag_directive_t{ {[]byte("!"), []byte("!")}, {[]byte("!!"), []byte("tag:yaml.org,2002:")}, } // Parse directives. func yaml_parser_process_directives(parser *yaml_parser_t, version_directive_ref **yaml_version_directive_t, tag_directives_ref *[]yaml_tag_directive_t) bool { var version_directive *yaml_version_directive_t var tag_directives []yaml_tag_directive_t token := peek_token(parser) if token == nil { return false } for token.typ == yaml_VERSION_DIRECTIVE_TOKEN || token.typ == yaml_TAG_DIRECTIVE_TOKEN { if token.typ == yaml_VERSION_DIRECTIVE_TOKEN { if version_directive != nil { yaml_parser_set_parser_error(parser, "found duplicate %YAML directive", token.start_mark) return false } if token.major != 1 || token.minor != 1 { yaml_parser_set_parser_error(parser, "found incompatible YAML document", token.start_mark) return false } version_directive = &yaml_version_directive_t{ major: token.major, minor: token.minor, } } else if token.typ == yaml_TAG_DIRECTIVE_TOKEN { value := yaml_tag_directive_t{ handle: token.value, prefix: token.prefix, } if !yaml_parser_append_tag_directive(parser, value, false, token.start_mark) { return false } tag_directives = append(tag_directives, value) } skip_token(parser) token = peek_token(parser) if token == nil { return false } } for i := range default_tag_directives { if !yaml_parser_append_tag_directive(parser, default_tag_directives[i], true, token.start_mark) { return false } } if version_directive_ref != nil { *version_directive_ref = version_directive } if tag_directives_ref != nil { *tag_directives_ref = tag_directives } return true } // Append a tag directive to the directives stack. func yaml_parser_append_tag_directive(parser *yaml_parser_t, value yaml_tag_directive_t, allow_duplicates bool, mark yaml_mark_t) bool { for i := range parser.tag_directives { if bytes.Equal(value.handle, parser.tag_directives[i].handle) { if allow_duplicates { return true } return yaml_parser_set_parser_error(parser, "found duplicate %TAG directive", mark) } } // [Go] I suspect the copy is unnecessary. This was likely done // because there was no way to track ownership of the data. value_copy := yaml_tag_directive_t{ handle: make([]byte, len(value.handle)), prefix: make([]byte, len(value.prefix)), } copy(value_copy.handle, value.handle) copy(value_copy.prefix, value.prefix) parser.tag_directives = append(parser.tag_directives, value_copy) return true } ================================================ FILE: vendor/gopkg.in/yaml.v3/readerc.go ================================================ // // Copyright (c) 2011-2019 Canonical Ltd // Copyright (c) 2006-2010 Kirill Simonov // // Permission is hereby granted, free of charge, to any person obtaining a copy of // this software and associated documentation files (the "Software"), to deal in // the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies // of the Software, and to permit persons to whom the Software is furnished to do // so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. package yaml import ( "io" ) // Set the reader error and return 0. func yaml_parser_set_reader_error(parser *yaml_parser_t, problem string, offset int, value int) bool { parser.error = yaml_READER_ERROR parser.problem = problem parser.problem_offset = offset parser.problem_value = value return false } // Byte order marks. const ( bom_UTF8 = "\xef\xbb\xbf" bom_UTF16LE = "\xff\xfe" bom_UTF16BE = "\xfe\xff" ) // Determine the input stream encoding by checking the BOM symbol. If no BOM is // found, the UTF-8 encoding is assumed. Return 1 on success, 0 on failure. func yaml_parser_determine_encoding(parser *yaml_parser_t) bool { // Ensure that we had enough bytes in the raw buffer. for !parser.eof && len(parser.raw_buffer)-parser.raw_buffer_pos < 3 { if !yaml_parser_update_raw_buffer(parser) { return false } } // Determine the encoding. buf := parser.raw_buffer pos := parser.raw_buffer_pos avail := len(buf) - pos if avail >= 2 && buf[pos] == bom_UTF16LE[0] && buf[pos+1] == bom_UTF16LE[1] { parser.encoding = yaml_UTF16LE_ENCODING parser.raw_buffer_pos += 2 parser.offset += 2 } else if avail >= 2 && buf[pos] == bom_UTF16BE[0] && buf[pos+1] == bom_UTF16BE[1] { parser.encoding = yaml_UTF16BE_ENCODING parser.raw_buffer_pos += 2 parser.offset += 2 } else if avail >= 3 && buf[pos] == bom_UTF8[0] && buf[pos+1] == bom_UTF8[1] && buf[pos+2] == bom_UTF8[2] { parser.encoding = yaml_UTF8_ENCODING parser.raw_buffer_pos += 3 parser.offset += 3 } else { parser.encoding = yaml_UTF8_ENCODING } return true } // Update the raw buffer. func yaml_parser_update_raw_buffer(parser *yaml_parser_t) bool { size_read := 0 // Return if the raw buffer is full. if parser.raw_buffer_pos == 0 && len(parser.raw_buffer) == cap(parser.raw_buffer) { return true } // Return on EOF. if parser.eof { return true } // Move the remaining bytes in the raw buffer to the beginning. if parser.raw_buffer_pos > 0 && parser.raw_buffer_pos < len(parser.raw_buffer) { copy(parser.raw_buffer, parser.raw_buffer[parser.raw_buffer_pos:]) } parser.raw_buffer = parser.raw_buffer[:len(parser.raw_buffer)-parser.raw_buffer_pos] parser.raw_buffer_pos = 0 // Call the read handler to fill the buffer. size_read, err := parser.read_handler(parser, parser.raw_buffer[len(parser.raw_buffer):cap(parser.raw_buffer)]) parser.raw_buffer = parser.raw_buffer[:len(parser.raw_buffer)+size_read] if err == io.EOF { parser.eof = true } else if err != nil { return yaml_parser_set_reader_error(parser, "input error: "+err.Error(), parser.offset, -1) } return true } // Ensure that the buffer contains at least `length` characters. // Return true on success, false on failure. // // The length is supposed to be significantly less that the buffer size. func yaml_parser_update_buffer(parser *yaml_parser_t, length int) bool { if parser.read_handler == nil { panic("read handler must be set") } // [Go] This function was changed to guarantee the requested length size at EOF. // The fact we need to do this is pretty awful, but the description above implies // for that to be the case, and there are tests // If the EOF flag is set and the raw buffer is empty, do nothing. if parser.eof && parser.raw_buffer_pos == len(parser.raw_buffer) { // [Go] ACTUALLY! Read the documentation of this function above. // This is just broken. To return true, we need to have the // given length in the buffer. Not doing that means every single // check that calls this function to make sure the buffer has a // given length is Go) panicking; or C) accessing invalid memory. //return true } // Return if the buffer contains enough characters. if parser.unread >= length { return true } // Determine the input encoding if it is not known yet. if parser.encoding == yaml_ANY_ENCODING { if !yaml_parser_determine_encoding(parser) { return false } } // Move the unread characters to the beginning of the buffer. buffer_len := len(parser.buffer) if parser.buffer_pos > 0 && parser.buffer_pos < buffer_len { copy(parser.buffer, parser.buffer[parser.buffer_pos:]) buffer_len -= parser.buffer_pos parser.buffer_pos = 0 } else if parser.buffer_pos == buffer_len { buffer_len = 0 parser.buffer_pos = 0 } // Open the whole buffer for writing, and cut it before returning. parser.buffer = parser.buffer[:cap(parser.buffer)] // Fill the buffer until it has enough characters. first := true for parser.unread < length { // Fill the raw buffer if necessary. if !first || parser.raw_buffer_pos == len(parser.raw_buffer) { if !yaml_parser_update_raw_buffer(parser) { parser.buffer = parser.buffer[:buffer_len] return false } } first = false // Decode the raw buffer. inner: for parser.raw_buffer_pos != len(parser.raw_buffer) { var value rune var width int raw_unread := len(parser.raw_buffer) - parser.raw_buffer_pos // Decode the next character. switch parser.encoding { case yaml_UTF8_ENCODING: // Decode a UTF-8 character. Check RFC 3629 // (http://www.ietf.org/rfc/rfc3629.txt) for more details. // // The following table (taken from the RFC) is used for // decoding. // // Char. number range | UTF-8 octet sequence // (hexadecimal) | (binary) // --------------------+------------------------------------ // 0000 0000-0000 007F | 0xxxxxxx // 0000 0080-0000 07FF | 110xxxxx 10xxxxxx // 0000 0800-0000 FFFF | 1110xxxx 10xxxxxx 10xxxxxx // 0001 0000-0010 FFFF | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx // // Additionally, the characters in the range 0xD800-0xDFFF // are prohibited as they are reserved for use with UTF-16 // surrogate pairs. // Determine the length of the UTF-8 sequence. octet := parser.raw_buffer[parser.raw_buffer_pos] switch { case octet&0x80 == 0x00: width = 1 case octet&0xE0 == 0xC0: width = 2 case octet&0xF0 == 0xE0: width = 3 case octet&0xF8 == 0xF0: width = 4 default: // The leading octet is invalid. return yaml_parser_set_reader_error(parser, "invalid leading UTF-8 octet", parser.offset, int(octet)) } // Check if the raw buffer contains an incomplete character. if width > raw_unread { if parser.eof { return yaml_parser_set_reader_error(parser, "incomplete UTF-8 octet sequence", parser.offset, -1) } break inner } // Decode the leading octet. switch { case octet&0x80 == 0x00: value = rune(octet & 0x7F) case octet&0xE0 == 0xC0: value = rune(octet & 0x1F) case octet&0xF0 == 0xE0: value = rune(octet & 0x0F) case octet&0xF8 == 0xF0: value = rune(octet & 0x07) default: value = 0 } // Check and decode the trailing octets. for k := 1; k < width; k++ { octet = parser.raw_buffer[parser.raw_buffer_pos+k] // Check if the octet is valid. if (octet & 0xC0) != 0x80 { return yaml_parser_set_reader_error(parser, "invalid trailing UTF-8 octet", parser.offset+k, int(octet)) } // Decode the octet. value = (value << 6) + rune(octet&0x3F) } // Check the length of the sequence against the value. switch { case width == 1: case width == 2 && value >= 0x80: case width == 3 && value >= 0x800: case width == 4 && value >= 0x10000: default: return yaml_parser_set_reader_error(parser, "invalid length of a UTF-8 sequence", parser.offset, -1) } // Check the range of the value. if value >= 0xD800 && value <= 0xDFFF || value > 0x10FFFF { return yaml_parser_set_reader_error(parser, "invalid Unicode character", parser.offset, int(value)) } case yaml_UTF16LE_ENCODING, yaml_UTF16BE_ENCODING: var low, high int if parser.encoding == yaml_UTF16LE_ENCODING { low, high = 0, 1 } else { low, high = 1, 0 } // The UTF-16 encoding is not as simple as one might // naively think. Check RFC 2781 // (http://www.ietf.org/rfc/rfc2781.txt). // // Normally, two subsequent bytes describe a Unicode // character. However a special technique (called a // surrogate pair) is used for specifying character // values larger than 0xFFFF. // // A surrogate pair consists of two pseudo-characters: // high surrogate area (0xD800-0xDBFF) // low surrogate area (0xDC00-0xDFFF) // // The following formulas are used for decoding // and encoding characters using surrogate pairs: // // U = U' + 0x10000 (0x01 00 00 <= U <= 0x10 FF FF) // U' = yyyyyyyyyyxxxxxxxxxx (0 <= U' <= 0x0F FF FF) // W1 = 110110yyyyyyyyyy // W2 = 110111xxxxxxxxxx // // where U is the character value, W1 is the high surrogate // area, W2 is the low surrogate area. // Check for incomplete UTF-16 character. if raw_unread < 2 { if parser.eof { return yaml_parser_set_reader_error(parser, "incomplete UTF-16 character", parser.offset, -1) } break inner } // Get the character. value = rune(parser.raw_buffer[parser.raw_buffer_pos+low]) + (rune(parser.raw_buffer[parser.raw_buffer_pos+high]) << 8) // Check for unexpected low surrogate area. if value&0xFC00 == 0xDC00 { return yaml_parser_set_reader_error(parser, "unexpected low surrogate area", parser.offset, int(value)) } // Check for a high surrogate area. if value&0xFC00 == 0xD800 { width = 4 // Check for incomplete surrogate pair. if raw_unread < 4 { if parser.eof { return yaml_parser_set_reader_error(parser, "incomplete UTF-16 surrogate pair", parser.offset, -1) } break inner } // Get the next character. value2 := rune(parser.raw_buffer[parser.raw_buffer_pos+low+2]) + (rune(parser.raw_buffer[parser.raw_buffer_pos+high+2]) << 8) // Check for a low surrogate area. if value2&0xFC00 != 0xDC00 { return yaml_parser_set_reader_error(parser, "expected low surrogate area", parser.offset+2, int(value2)) } // Generate the value of the surrogate pair. value = 0x10000 + ((value & 0x3FF) << 10) + (value2 & 0x3FF) } else { width = 2 } default: panic("impossible") } // Check if the character is in the allowed range: // #x9 | #xA | #xD | [#x20-#x7E] (8 bit) // | #x85 | [#xA0-#xD7FF] | [#xE000-#xFFFD] (16 bit) // | [#x10000-#x10FFFF] (32 bit) switch { case value == 0x09: case value == 0x0A: case value == 0x0D: case value >= 0x20 && value <= 0x7E: case value == 0x85: case value >= 0xA0 && value <= 0xD7FF: case value >= 0xE000 && value <= 0xFFFD: case value >= 0x10000 && value <= 0x10FFFF: default: return yaml_parser_set_reader_error(parser, "control characters are not allowed", parser.offset, int(value)) } // Move the raw pointers. parser.raw_buffer_pos += width parser.offset += width // Finally put the character into the buffer. if value <= 0x7F { // 0000 0000-0000 007F . 0xxxxxxx parser.buffer[buffer_len+0] = byte(value) buffer_len += 1 } else if value <= 0x7FF { // 0000 0080-0000 07FF . 110xxxxx 10xxxxxx parser.buffer[buffer_len+0] = byte(0xC0 + (value >> 6)) parser.buffer[buffer_len+1] = byte(0x80 + (value & 0x3F)) buffer_len += 2 } else if value <= 0xFFFF { // 0000 0800-0000 FFFF . 1110xxxx 10xxxxxx 10xxxxxx parser.buffer[buffer_len+0] = byte(0xE0 + (value >> 12)) parser.buffer[buffer_len+1] = byte(0x80 + ((value >> 6) & 0x3F)) parser.buffer[buffer_len+2] = byte(0x80 + (value & 0x3F)) buffer_len += 3 } else { // 0001 0000-0010 FFFF . 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx parser.buffer[buffer_len+0] = byte(0xF0 + (value >> 18)) parser.buffer[buffer_len+1] = byte(0x80 + ((value >> 12) & 0x3F)) parser.buffer[buffer_len+2] = byte(0x80 + ((value >> 6) & 0x3F)) parser.buffer[buffer_len+3] = byte(0x80 + (value & 0x3F)) buffer_len += 4 } parser.unread++ } // On EOF, put NUL into the buffer and return. if parser.eof { parser.buffer[buffer_len] = 0 buffer_len++ parser.unread++ break } } // [Go] Read the documentation of this function above. To return true, // we need to have the given length in the buffer. Not doing that means // every single check that calls this function to make sure the buffer // has a given length is Go) panicking; or C) accessing invalid memory. // This happens here due to the EOF above breaking early. for buffer_len < length { parser.buffer[buffer_len] = 0 buffer_len++ } parser.buffer = parser.buffer[:buffer_len] return true } ================================================ FILE: vendor/gopkg.in/yaml.v3/resolve.go ================================================ // // Copyright (c) 2011-2019 Canonical Ltd // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package yaml import ( "encoding/base64" "math" "regexp" "strconv" "strings" "time" ) type resolveMapItem struct { value interface{} tag string } var resolveTable = make([]byte, 256) var resolveMap = make(map[string]resolveMapItem) func init() { t := resolveTable t[int('+')] = 'S' // Sign t[int('-')] = 'S' for _, c := range "0123456789" { t[int(c)] = 'D' // Digit } for _, c := range "yYnNtTfFoO~" { t[int(c)] = 'M' // In map } t[int('.')] = '.' // Float (potentially in map) var resolveMapList = []struct { v interface{} tag string l []string }{ {true, boolTag, []string{"true", "True", "TRUE"}}, {false, boolTag, []string{"false", "False", "FALSE"}}, {nil, nullTag, []string{"", "~", "null", "Null", "NULL"}}, {math.NaN(), floatTag, []string{".nan", ".NaN", ".NAN"}}, {math.Inf(+1), floatTag, []string{".inf", ".Inf", ".INF"}}, {math.Inf(+1), floatTag, []string{"+.inf", "+.Inf", "+.INF"}}, {math.Inf(-1), floatTag, []string{"-.inf", "-.Inf", "-.INF"}}, {"<<", mergeTag, []string{"<<"}}, } m := resolveMap for _, item := range resolveMapList { for _, s := range item.l { m[s] = resolveMapItem{item.v, item.tag} } } } const ( nullTag = "!!null" boolTag = "!!bool" strTag = "!!str" intTag = "!!int" floatTag = "!!float" timestampTag = "!!timestamp" seqTag = "!!seq" mapTag = "!!map" binaryTag = "!!binary" mergeTag = "!!merge" ) var longTags = make(map[string]string) var shortTags = make(map[string]string) func init() { for _, stag := range []string{nullTag, boolTag, strTag, intTag, floatTag, timestampTag, seqTag, mapTag, binaryTag, mergeTag} { ltag := longTag(stag) longTags[stag] = ltag shortTags[ltag] = stag } } const longTagPrefix = "tag:yaml.org,2002:" func shortTag(tag string) string { if strings.HasPrefix(tag, longTagPrefix) { if stag, ok := shortTags[tag]; ok { return stag } return "!!" + tag[len(longTagPrefix):] } return tag } func longTag(tag string) string { if strings.HasPrefix(tag, "!!") { if ltag, ok := longTags[tag]; ok { return ltag } return longTagPrefix + tag[2:] } return tag } func resolvableTag(tag string) bool { switch tag { case "", strTag, boolTag, intTag, floatTag, nullTag, timestampTag: return true } return false } var yamlStyleFloat = regexp.MustCompile(`^[-+]?(\.[0-9]+|[0-9]+(\.[0-9]*)?)([eE][-+]?[0-9]+)?$`) func resolve(tag string, in string) (rtag string, out interface{}) { tag = shortTag(tag) if !resolvableTag(tag) { return tag, in } defer func() { switch tag { case "", rtag, strTag, binaryTag: return case floatTag: if rtag == intTag { switch v := out.(type) { case int64: rtag = floatTag out = float64(v) return case int: rtag = floatTag out = float64(v) return } } } failf("cannot decode %s `%s` as a %s", shortTag(rtag), in, shortTag(tag)) }() // Any data is accepted as a !!str or !!binary. // Otherwise, the prefix is enough of a hint about what it might be. hint := byte('N') if in != "" { hint = resolveTable[in[0]] } if hint != 0 && tag != strTag && tag != binaryTag { // Handle things we can lookup in a map. if item, ok := resolveMap[in]; ok { return item.tag, item.value } // Base 60 floats are a bad idea, were dropped in YAML 1.2, and // are purposefully unsupported here. They're still quoted on // the way out for compatibility with other parser, though. switch hint { case 'M': // We've already checked the map above. case '.': // Not in the map, so maybe a normal float. floatv, err := strconv.ParseFloat(in, 64) if err == nil { return floatTag, floatv } case 'D', 'S': // Int, float, or timestamp. // Only try values as a timestamp if the value is unquoted or there's an explicit // !!timestamp tag. if tag == "" || tag == timestampTag { t, ok := parseTimestamp(in) if ok { return timestampTag, t } } plain := strings.Replace(in, "_", "", -1) intv, err := strconv.ParseInt(plain, 0, 64) if err == nil { if intv == int64(int(intv)) { return intTag, int(intv) } else { return intTag, intv } } uintv, err := strconv.ParseUint(plain, 0, 64) if err == nil { return intTag, uintv } if yamlStyleFloat.MatchString(plain) { floatv, err := strconv.ParseFloat(plain, 64) if err == nil { return floatTag, floatv } } if strings.HasPrefix(plain, "0b") { intv, err := strconv.ParseInt(plain[2:], 2, 64) if err == nil { if intv == int64(int(intv)) { return intTag, int(intv) } else { return intTag, intv } } uintv, err := strconv.ParseUint(plain[2:], 2, 64) if err == nil { return intTag, uintv } } else if strings.HasPrefix(plain, "-0b") { intv, err := strconv.ParseInt("-"+plain[3:], 2, 64) if err == nil { if true || intv == int64(int(intv)) { return intTag, int(intv) } else { return intTag, intv } } } // Octals as introduced in version 1.2 of the spec. // Octals from the 1.1 spec, spelled as 0777, are still // decoded by default in v3 as well for compatibility. // May be dropped in v4 depending on how usage evolves. if strings.HasPrefix(plain, "0o") { intv, err := strconv.ParseInt(plain[2:], 8, 64) if err == nil { if intv == int64(int(intv)) { return intTag, int(intv) } else { return intTag, intv } } uintv, err := strconv.ParseUint(plain[2:], 8, 64) if err == nil { return intTag, uintv } } else if strings.HasPrefix(plain, "-0o") { intv, err := strconv.ParseInt("-"+plain[3:], 8, 64) if err == nil { if true || intv == int64(int(intv)) { return intTag, int(intv) } else { return intTag, intv } } } default: panic("internal error: missing handler for resolver table: " + string(rune(hint)) + " (with " + in + ")") } } return strTag, in } // encodeBase64 encodes s as base64 that is broken up into multiple lines // as appropriate for the resulting length. func encodeBase64(s string) string { const lineLen = 70 encLen := base64.StdEncoding.EncodedLen(len(s)) lines := encLen/lineLen + 1 buf := make([]byte, encLen*2+lines) in := buf[0:encLen] out := buf[encLen:] base64.StdEncoding.Encode(in, []byte(s)) k := 0 for i := 0; i < len(in); i += lineLen { j := i + lineLen if j > len(in) { j = len(in) } k += copy(out[k:], in[i:j]) if lines > 1 { out[k] = '\n' k++ } } return string(out[:k]) } // This is a subset of the formats allowed by the regular expression // defined at http://yaml.org/type/timestamp.html. var allowedTimestampFormats = []string{ "2006-1-2T15:4:5.999999999Z07:00", // RCF3339Nano with short date fields. "2006-1-2t15:4:5.999999999Z07:00", // RFC3339Nano with short date fields and lower-case "t". "2006-1-2 15:4:5.999999999", // space separated with no time zone "2006-1-2", // date only // Notable exception: time.Parse cannot handle: "2001-12-14 21:59:43.10 -5" // from the set of examples. } // parseTimestamp parses s as a timestamp string and // returns the timestamp and reports whether it succeeded. // Timestamp formats are defined at http://yaml.org/type/timestamp.html func parseTimestamp(s string) (time.Time, bool) { // TODO write code to check all the formats supported by // http://yaml.org/type/timestamp.html instead of using time.Parse. // Quick check: all date formats start with YYYY-. i := 0 for ; i < len(s); i++ { if c := s[i]; c < '0' || c > '9' { break } } if i != 4 || i == len(s) || s[i] != '-' { return time.Time{}, false } for _, format := range allowedTimestampFormats { if t, err := time.Parse(format, s); err == nil { return t, true } } return time.Time{}, false } ================================================ FILE: vendor/gopkg.in/yaml.v3/scannerc.go ================================================ // // Copyright (c) 2011-2019 Canonical Ltd // Copyright (c) 2006-2010 Kirill Simonov // // Permission is hereby granted, free of charge, to any person obtaining a copy of // this software and associated documentation files (the "Software"), to deal in // the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies // of the Software, and to permit persons to whom the Software is furnished to do // so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. package yaml import ( "bytes" "fmt" ) // Introduction // ************ // // The following notes assume that you are familiar with the YAML specification // (http://yaml.org/spec/1.2/spec.html). We mostly follow it, although in // some cases we are less restrictive that it requires. // // The process of transforming a YAML stream into a sequence of events is // divided on two steps: Scanning and Parsing. // // The Scanner transforms the input stream into a sequence of tokens, while the // parser transform the sequence of tokens produced by the Scanner into a // sequence of parsing events. // // The Scanner is rather clever and complicated. The Parser, on the contrary, // is a straightforward implementation of a recursive-descendant parser (or, // LL(1) parser, as it is usually called). // // Actually there are two issues of Scanning that might be called "clever", the // rest is quite straightforward. The issues are "block collection start" and // "simple keys". Both issues are explained below in details. // // Here the Scanning step is explained and implemented. We start with the list // of all the tokens produced by the Scanner together with short descriptions. // // Now, tokens: // // STREAM-START(encoding) # The stream start. // STREAM-END # The stream end. // VERSION-DIRECTIVE(major,minor) # The '%YAML' directive. // TAG-DIRECTIVE(handle,prefix) # The '%TAG' directive. // DOCUMENT-START # '---' // DOCUMENT-END # '...' // BLOCK-SEQUENCE-START # Indentation increase denoting a block // BLOCK-MAPPING-START # sequence or a block mapping. // BLOCK-END # Indentation decrease. // FLOW-SEQUENCE-START # '[' // FLOW-SEQUENCE-END # ']' // BLOCK-SEQUENCE-START # '{' // BLOCK-SEQUENCE-END # '}' // BLOCK-ENTRY # '-' // FLOW-ENTRY # ',' // KEY # '?' or nothing (simple keys). // VALUE # ':' // ALIAS(anchor) # '*anchor' // ANCHOR(anchor) # '&anchor' // TAG(handle,suffix) # '!handle!suffix' // SCALAR(value,style) # A scalar. // // The following two tokens are "virtual" tokens denoting the beginning and the // end of the stream: // // STREAM-START(encoding) // STREAM-END // // We pass the information about the input stream encoding with the // STREAM-START token. // // The next two tokens are responsible for tags: // // VERSION-DIRECTIVE(major,minor) // TAG-DIRECTIVE(handle,prefix) // // Example: // // %YAML 1.1 // %TAG ! !foo // %TAG !yaml! tag:yaml.org,2002: // --- // // The correspoding sequence of tokens: // // STREAM-START(utf-8) // VERSION-DIRECTIVE(1,1) // TAG-DIRECTIVE("!","!foo") // TAG-DIRECTIVE("!yaml","tag:yaml.org,2002:") // DOCUMENT-START // STREAM-END // // Note that the VERSION-DIRECTIVE and TAG-DIRECTIVE tokens occupy a whole // line. // // The document start and end indicators are represented by: // // DOCUMENT-START // DOCUMENT-END // // Note that if a YAML stream contains an implicit document (without '---' // and '...' indicators), no DOCUMENT-START and DOCUMENT-END tokens will be // produced. // // In the following examples, we present whole documents together with the // produced tokens. // // 1. An implicit document: // // 'a scalar' // // Tokens: // // STREAM-START(utf-8) // SCALAR("a scalar",single-quoted) // STREAM-END // // 2. An explicit document: // // --- // 'a scalar' // ... // // Tokens: // // STREAM-START(utf-8) // DOCUMENT-START // SCALAR("a scalar",single-quoted) // DOCUMENT-END // STREAM-END // // 3. Several documents in a stream: // // 'a scalar' // --- // 'another scalar' // --- // 'yet another scalar' // // Tokens: // // STREAM-START(utf-8) // SCALAR("a scalar",single-quoted) // DOCUMENT-START // SCALAR("another scalar",single-quoted) // DOCUMENT-START // SCALAR("yet another scalar",single-quoted) // STREAM-END // // We have already introduced the SCALAR token above. The following tokens are // used to describe aliases, anchors, tag, and scalars: // // ALIAS(anchor) // ANCHOR(anchor) // TAG(handle,suffix) // SCALAR(value,style) // // The following series of examples illustrate the usage of these tokens: // // 1. A recursive sequence: // // &A [ *A ] // // Tokens: // // STREAM-START(utf-8) // ANCHOR("A") // FLOW-SEQUENCE-START // ALIAS("A") // FLOW-SEQUENCE-END // STREAM-END // // 2. A tagged scalar: // // !!float "3.14" # A good approximation. // // Tokens: // // STREAM-START(utf-8) // TAG("!!","float") // SCALAR("3.14",double-quoted) // STREAM-END // // 3. Various scalar styles: // // --- # Implicit empty plain scalars do not produce tokens. // --- a plain scalar // --- 'a single-quoted scalar' // --- "a double-quoted scalar" // --- |- // a literal scalar // --- >- // a folded // scalar // // Tokens: // // STREAM-START(utf-8) // DOCUMENT-START // DOCUMENT-START // SCALAR("a plain scalar",plain) // DOCUMENT-START // SCALAR("a single-quoted scalar",single-quoted) // DOCUMENT-START // SCALAR("a double-quoted scalar",double-quoted) // DOCUMENT-START // SCALAR("a literal scalar",literal) // DOCUMENT-START // SCALAR("a folded scalar",folded) // STREAM-END // // Now it's time to review collection-related tokens. We will start with // flow collections: // // FLOW-SEQUENCE-START // FLOW-SEQUENCE-END // FLOW-MAPPING-START // FLOW-MAPPING-END // FLOW-ENTRY // KEY // VALUE // // The tokens FLOW-SEQUENCE-START, FLOW-SEQUENCE-END, FLOW-MAPPING-START, and // FLOW-MAPPING-END represent the indicators '[', ']', '{', and '}' // correspondingly. FLOW-ENTRY represent the ',' indicator. Finally the // indicators '?' and ':', which are used for denoting mapping keys and values, // are represented by the KEY and VALUE tokens. // // The following examples show flow collections: // // 1. A flow sequence: // // [item 1, item 2, item 3] // // Tokens: // // STREAM-START(utf-8) // FLOW-SEQUENCE-START // SCALAR("item 1",plain) // FLOW-ENTRY // SCALAR("item 2",plain) // FLOW-ENTRY // SCALAR("item 3",plain) // FLOW-SEQUENCE-END // STREAM-END // // 2. A flow mapping: // // { // a simple key: a value, # Note that the KEY token is produced. // ? a complex key: another value, // } // // Tokens: // // STREAM-START(utf-8) // FLOW-MAPPING-START // KEY // SCALAR("a simple key",plain) // VALUE // SCALAR("a value",plain) // FLOW-ENTRY // KEY // SCALAR("a complex key",plain) // VALUE // SCALAR("another value",plain) // FLOW-ENTRY // FLOW-MAPPING-END // STREAM-END // // A simple key is a key which is not denoted by the '?' indicator. Note that // the Scanner still produce the KEY token whenever it encounters a simple key. // // For scanning block collections, the following tokens are used (note that we // repeat KEY and VALUE here): // // BLOCK-SEQUENCE-START // BLOCK-MAPPING-START // BLOCK-END // BLOCK-ENTRY // KEY // VALUE // // The tokens BLOCK-SEQUENCE-START and BLOCK-MAPPING-START denote indentation // increase that precedes a block collection (cf. the INDENT token in Python). // The token BLOCK-END denote indentation decrease that ends a block collection // (cf. the DEDENT token in Python). However YAML has some syntax pecularities // that makes detections of these tokens more complex. // // The tokens BLOCK-ENTRY, KEY, and VALUE are used to represent the indicators // '-', '?', and ':' correspondingly. // // The following examples show how the tokens BLOCK-SEQUENCE-START, // BLOCK-MAPPING-START, and BLOCK-END are emitted by the Scanner: // // 1. Block sequences: // // - item 1 // - item 2 // - // - item 3.1 // - item 3.2 // - // key 1: value 1 // key 2: value 2 // // Tokens: // // STREAM-START(utf-8) // BLOCK-SEQUENCE-START // BLOCK-ENTRY // SCALAR("item 1",plain) // BLOCK-ENTRY // SCALAR("item 2",plain) // BLOCK-ENTRY // BLOCK-SEQUENCE-START // BLOCK-ENTRY // SCALAR("item 3.1",plain) // BLOCK-ENTRY // SCALAR("item 3.2",plain) // BLOCK-END // BLOCK-ENTRY // BLOCK-MAPPING-START // KEY // SCALAR("key 1",plain) // VALUE // SCALAR("value 1",plain) // KEY // SCALAR("key 2",plain) // VALUE // SCALAR("value 2",plain) // BLOCK-END // BLOCK-END // STREAM-END // // 2. Block mappings: // // a simple key: a value # The KEY token is produced here. // ? a complex key // : another value // a mapping: // key 1: value 1 // key 2: value 2 // a sequence: // - item 1 // - item 2 // // Tokens: // // STREAM-START(utf-8) // BLOCK-MAPPING-START // KEY // SCALAR("a simple key",plain) // VALUE // SCALAR("a value",plain) // KEY // SCALAR("a complex key",plain) // VALUE // SCALAR("another value",plain) // KEY // SCALAR("a mapping",plain) // BLOCK-MAPPING-START // KEY // SCALAR("key 1",plain) // VALUE // SCALAR("value 1",plain) // KEY // SCALAR("key 2",plain) // VALUE // SCALAR("value 2",plain) // BLOCK-END // KEY // SCALAR("a sequence",plain) // VALUE // BLOCK-SEQUENCE-START // BLOCK-ENTRY // SCALAR("item 1",plain) // BLOCK-ENTRY // SCALAR("item 2",plain) // BLOCK-END // BLOCK-END // STREAM-END // // YAML does not always require to start a new block collection from a new // line. If the current line contains only '-', '?', and ':' indicators, a new // block collection may start at the current line. The following examples // illustrate this case: // // 1. Collections in a sequence: // // - - item 1 // - item 2 // - key 1: value 1 // key 2: value 2 // - ? complex key // : complex value // // Tokens: // // STREAM-START(utf-8) // BLOCK-SEQUENCE-START // BLOCK-ENTRY // BLOCK-SEQUENCE-START // BLOCK-ENTRY // SCALAR("item 1",plain) // BLOCK-ENTRY // SCALAR("item 2",plain) // BLOCK-END // BLOCK-ENTRY // BLOCK-MAPPING-START // KEY // SCALAR("key 1",plain) // VALUE // SCALAR("value 1",plain) // KEY // SCALAR("key 2",plain) // VALUE // SCALAR("value 2",plain) // BLOCK-END // BLOCK-ENTRY // BLOCK-MAPPING-START // KEY // SCALAR("complex key") // VALUE // SCALAR("complex value") // BLOCK-END // BLOCK-END // STREAM-END // // 2. Collections in a mapping: // // ? a sequence // : - item 1 // - item 2 // ? a mapping // : key 1: value 1 // key 2: value 2 // // Tokens: // // STREAM-START(utf-8) // BLOCK-MAPPING-START // KEY // SCALAR("a sequence",plain) // VALUE // BLOCK-SEQUENCE-START // BLOCK-ENTRY // SCALAR("item 1",plain) // BLOCK-ENTRY // SCALAR("item 2",plain) // BLOCK-END // KEY // SCALAR("a mapping",plain) // VALUE // BLOCK-MAPPING-START // KEY // SCALAR("key 1",plain) // VALUE // SCALAR("value 1",plain) // KEY // SCALAR("key 2",plain) // VALUE // SCALAR("value 2",plain) // BLOCK-END // BLOCK-END // STREAM-END // // YAML also permits non-indented sequences if they are included into a block // mapping. In this case, the token BLOCK-SEQUENCE-START is not produced: // // key: // - item 1 # BLOCK-SEQUENCE-START is NOT produced here. // - item 2 // // Tokens: // // STREAM-START(utf-8) // BLOCK-MAPPING-START // KEY // SCALAR("key",plain) // VALUE // BLOCK-ENTRY // SCALAR("item 1",plain) // BLOCK-ENTRY // SCALAR("item 2",plain) // BLOCK-END // // Ensure that the buffer contains the required number of characters. // Return true on success, false on failure (reader error or memory error). func cache(parser *yaml_parser_t, length int) bool { // [Go] This was inlined: !cache(A, B) -> unread < B && !update(A, B) return parser.unread >= length || yaml_parser_update_buffer(parser, length) } // Advance the buffer pointer. func skip(parser *yaml_parser_t) { if !is_blank(parser.buffer, parser.buffer_pos) { parser.newlines = 0 } parser.mark.index++ parser.mark.column++ parser.unread-- parser.buffer_pos += width(parser.buffer[parser.buffer_pos]) } func skip_line(parser *yaml_parser_t) { if is_crlf(parser.buffer, parser.buffer_pos) { parser.mark.index += 2 parser.mark.column = 0 parser.mark.line++ parser.unread -= 2 parser.buffer_pos += 2 parser.newlines++ } else if is_break(parser.buffer, parser.buffer_pos) { parser.mark.index++ parser.mark.column = 0 parser.mark.line++ parser.unread-- parser.buffer_pos += width(parser.buffer[parser.buffer_pos]) parser.newlines++ } } // Copy a character to a string buffer and advance pointers. func read(parser *yaml_parser_t, s []byte) []byte { if !is_blank(parser.buffer, parser.buffer_pos) { parser.newlines = 0 } w := width(parser.buffer[parser.buffer_pos]) if w == 0 { panic("invalid character sequence") } if len(s) == 0 { s = make([]byte, 0, 32) } if w == 1 && len(s)+w <= cap(s) { s = s[:len(s)+1] s[len(s)-1] = parser.buffer[parser.buffer_pos] parser.buffer_pos++ } else { s = append(s, parser.buffer[parser.buffer_pos:parser.buffer_pos+w]...) parser.buffer_pos += w } parser.mark.index++ parser.mark.column++ parser.unread-- return s } // Copy a line break character to a string buffer and advance pointers. func read_line(parser *yaml_parser_t, s []byte) []byte { buf := parser.buffer pos := parser.buffer_pos switch { case buf[pos] == '\r' && buf[pos+1] == '\n': // CR LF . LF s = append(s, '\n') parser.buffer_pos += 2 parser.mark.index++ parser.unread-- case buf[pos] == '\r' || buf[pos] == '\n': // CR|LF . LF s = append(s, '\n') parser.buffer_pos += 1 case buf[pos] == '\xC2' && buf[pos+1] == '\x85': // NEL . LF s = append(s, '\n') parser.buffer_pos += 2 case buf[pos] == '\xE2' && buf[pos+1] == '\x80' && (buf[pos+2] == '\xA8' || buf[pos+2] == '\xA9'): // LS|PS . LS|PS s = append(s, buf[parser.buffer_pos:pos+3]...) parser.buffer_pos += 3 default: return s } parser.mark.index++ parser.mark.column = 0 parser.mark.line++ parser.unread-- parser.newlines++ return s } // Get the next token. func yaml_parser_scan(parser *yaml_parser_t, token *yaml_token_t) bool { // Erase the token object. *token = yaml_token_t{} // [Go] Is this necessary? // No tokens after STREAM-END or error. if parser.stream_end_produced || parser.error != yaml_NO_ERROR { return true } // Ensure that the tokens queue contains enough tokens. if !parser.token_available { if !yaml_parser_fetch_more_tokens(parser) { return false } } // Fetch the next token from the queue. *token = parser.tokens[parser.tokens_head] parser.tokens_head++ parser.tokens_parsed++ parser.token_available = false if token.typ == yaml_STREAM_END_TOKEN { parser.stream_end_produced = true } return true } // Set the scanner error and return false. func yaml_parser_set_scanner_error(parser *yaml_parser_t, context string, context_mark yaml_mark_t, problem string) bool { parser.error = yaml_SCANNER_ERROR parser.context = context parser.context_mark = context_mark parser.problem = problem parser.problem_mark = parser.mark return false } func yaml_parser_set_scanner_tag_error(parser *yaml_parser_t, directive bool, context_mark yaml_mark_t, problem string) bool { context := "while parsing a tag" if directive { context = "while parsing a %TAG directive" } return yaml_parser_set_scanner_error(parser, context, context_mark, problem) } func trace(args ...interface{}) func() { pargs := append([]interface{}{"+++"}, args...) fmt.Println(pargs...) pargs = append([]interface{}{"---"}, args...) return func() { fmt.Println(pargs...) } } // Ensure that the tokens queue contains at least one token which can be // returned to the Parser. func yaml_parser_fetch_more_tokens(parser *yaml_parser_t) bool { // While we need more tokens to fetch, do it. for { // [Go] The comment parsing logic requires a lookahead of two tokens // so that foot comments may be parsed in time of associating them // with the tokens that are parsed before them, and also for line // comments to be transformed into head comments in some edge cases. if parser.tokens_head < len(parser.tokens)-2 { // If a potential simple key is at the head position, we need to fetch // the next token to disambiguate it. head_tok_idx, ok := parser.simple_keys_by_tok[parser.tokens_parsed] if !ok { break } else if valid, ok := yaml_simple_key_is_valid(parser, &parser.simple_keys[head_tok_idx]); !ok { return false } else if !valid { break } } // Fetch the next token. if !yaml_parser_fetch_next_token(parser) { return false } } parser.token_available = true return true } // The dispatcher for token fetchers. func yaml_parser_fetch_next_token(parser *yaml_parser_t) (ok bool) { // Ensure that the buffer is initialized. if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false } // Check if we just started scanning. Fetch STREAM-START then. if !parser.stream_start_produced { return yaml_parser_fetch_stream_start(parser) } scan_mark := parser.mark // Eat whitespaces and comments until we reach the next token. if !yaml_parser_scan_to_next_token(parser) { return false } // [Go] While unrolling indents, transform the head comments of prior // indentation levels observed after scan_start into foot comments at // the respective indexes. // Check the indentation level against the current column. if !yaml_parser_unroll_indent(parser, parser.mark.column, scan_mark) { return false } // Ensure that the buffer contains at least 4 characters. 4 is the length // of the longest indicators ('--- ' and '... '). if parser.unread < 4 && !yaml_parser_update_buffer(parser, 4) { return false } // Is it the end of the stream? if is_z(parser.buffer, parser.buffer_pos) { return yaml_parser_fetch_stream_end(parser) } // Is it a directive? if parser.mark.column == 0 && parser.buffer[parser.buffer_pos] == '%' { return yaml_parser_fetch_directive(parser) } buf := parser.buffer pos := parser.buffer_pos // Is it the document start indicator? if parser.mark.column == 0 && buf[pos] == '-' && buf[pos+1] == '-' && buf[pos+2] == '-' && is_blankz(buf, pos+3) { return yaml_parser_fetch_document_indicator(parser, yaml_DOCUMENT_START_TOKEN) } // Is it the document end indicator? if parser.mark.column == 0 && buf[pos] == '.' && buf[pos+1] == '.' && buf[pos+2] == '.' && is_blankz(buf, pos+3) { return yaml_parser_fetch_document_indicator(parser, yaml_DOCUMENT_END_TOKEN) } comment_mark := parser.mark if len(parser.tokens) > 0 && (parser.flow_level == 0 && buf[pos] == ':' || parser.flow_level > 0 && buf[pos] == ',') { // Associate any following comments with the prior token. comment_mark = parser.tokens[len(parser.tokens)-1].start_mark } defer func() { if !ok { return } if len(parser.tokens) > 0 && parser.tokens[len(parser.tokens)-1].typ == yaml_BLOCK_ENTRY_TOKEN { // Sequence indicators alone have no line comments. It becomes // a head comment for whatever follows. return } if !yaml_parser_scan_line_comment(parser, comment_mark) { ok = false return } }() // Is it the flow sequence start indicator? if buf[pos] == '[' { return yaml_parser_fetch_flow_collection_start(parser, yaml_FLOW_SEQUENCE_START_TOKEN) } // Is it the flow mapping start indicator? if parser.buffer[parser.buffer_pos] == '{' { return yaml_parser_fetch_flow_collection_start(parser, yaml_FLOW_MAPPING_START_TOKEN) } // Is it the flow sequence end indicator? if parser.buffer[parser.buffer_pos] == ']' { return yaml_parser_fetch_flow_collection_end(parser, yaml_FLOW_SEQUENCE_END_TOKEN) } // Is it the flow mapping end indicator? if parser.buffer[parser.buffer_pos] == '}' { return yaml_parser_fetch_flow_collection_end(parser, yaml_FLOW_MAPPING_END_TOKEN) } // Is it the flow entry indicator? if parser.buffer[parser.buffer_pos] == ',' { return yaml_parser_fetch_flow_entry(parser) } // Is it the block entry indicator? if parser.buffer[parser.buffer_pos] == '-' && is_blankz(parser.buffer, parser.buffer_pos+1) { return yaml_parser_fetch_block_entry(parser) } // Is it the key indicator? if parser.buffer[parser.buffer_pos] == '?' && (parser.flow_level > 0 || is_blankz(parser.buffer, parser.buffer_pos+1)) { return yaml_parser_fetch_key(parser) } // Is it the value indicator? if parser.buffer[parser.buffer_pos] == ':' && (parser.flow_level > 0 || is_blankz(parser.buffer, parser.buffer_pos+1)) { return yaml_parser_fetch_value(parser) } // Is it an alias? if parser.buffer[parser.buffer_pos] == '*' { return yaml_parser_fetch_anchor(parser, yaml_ALIAS_TOKEN) } // Is it an anchor? if parser.buffer[parser.buffer_pos] == '&' { return yaml_parser_fetch_anchor(parser, yaml_ANCHOR_TOKEN) } // Is it a tag? if parser.buffer[parser.buffer_pos] == '!' { return yaml_parser_fetch_tag(parser) } // Is it a literal scalar? if parser.buffer[parser.buffer_pos] == '|' && parser.flow_level == 0 { return yaml_parser_fetch_block_scalar(parser, true) } // Is it a folded scalar? if parser.buffer[parser.buffer_pos] == '>' && parser.flow_level == 0 { return yaml_parser_fetch_block_scalar(parser, false) } // Is it a single-quoted scalar? if parser.buffer[parser.buffer_pos] == '\'' { return yaml_parser_fetch_flow_scalar(parser, true) } // Is it a double-quoted scalar? if parser.buffer[parser.buffer_pos] == '"' { return yaml_parser_fetch_flow_scalar(parser, false) } // Is it a plain scalar? // // A plain scalar may start with any non-blank characters except // // '-', '?', ':', ',', '[', ']', '{', '}', // '#', '&', '*', '!', '|', '>', '\'', '\"', // '%', '@', '`'. // // In the block context (and, for the '-' indicator, in the flow context // too), it may also start with the characters // // '-', '?', ':' // // if it is followed by a non-space character. // // The last rule is more restrictive than the specification requires. // [Go] TODO Make this logic more reasonable. //switch parser.buffer[parser.buffer_pos] { //case '-', '?', ':', ',', '?', '-', ',', ':', ']', '[', '}', '{', '&', '#', '!', '*', '>', '|', '"', '\'', '@', '%', '-', '`': //} if !(is_blankz(parser.buffer, parser.buffer_pos) || parser.buffer[parser.buffer_pos] == '-' || parser.buffer[parser.buffer_pos] == '?' || parser.buffer[parser.buffer_pos] == ':' || parser.buffer[parser.buffer_pos] == ',' || parser.buffer[parser.buffer_pos] == '[' || parser.buffer[parser.buffer_pos] == ']' || parser.buffer[parser.buffer_pos] == '{' || parser.buffer[parser.buffer_pos] == '}' || parser.buffer[parser.buffer_pos] == '#' || parser.buffer[parser.buffer_pos] == '&' || parser.buffer[parser.buffer_pos] == '*' || parser.buffer[parser.buffer_pos] == '!' || parser.buffer[parser.buffer_pos] == '|' || parser.buffer[parser.buffer_pos] == '>' || parser.buffer[parser.buffer_pos] == '\'' || parser.buffer[parser.buffer_pos] == '"' || parser.buffer[parser.buffer_pos] == '%' || parser.buffer[parser.buffer_pos] == '@' || parser.buffer[parser.buffer_pos] == '`') || (parser.buffer[parser.buffer_pos] == '-' && !is_blank(parser.buffer, parser.buffer_pos+1)) || (parser.flow_level == 0 && (parser.buffer[parser.buffer_pos] == '?' || parser.buffer[parser.buffer_pos] == ':') && !is_blankz(parser.buffer, parser.buffer_pos+1)) { return yaml_parser_fetch_plain_scalar(parser) } // If we don't determine the token type so far, it is an error. return yaml_parser_set_scanner_error(parser, "while scanning for the next token", parser.mark, "found character that cannot start any token") } func yaml_simple_key_is_valid(parser *yaml_parser_t, simple_key *yaml_simple_key_t) (valid, ok bool) { if !simple_key.possible { return false, true } // The 1.2 specification says: // // "If the ? indicator is omitted, parsing needs to see past the // implicit key to recognize it as such. To limit the amount of // lookahead required, the “:” indicator must appear at most 1024 // Unicode characters beyond the start of the key. In addition, the key // is restricted to a single line." // if simple_key.mark.line < parser.mark.line || simple_key.mark.index+1024 < parser.mark.index { // Check if the potential simple key to be removed is required. if simple_key.required { return false, yaml_parser_set_scanner_error(parser, "while scanning a simple key", simple_key.mark, "could not find expected ':'") } simple_key.possible = false return false, true } return true, true } // Check if a simple key may start at the current position and add it if // needed. func yaml_parser_save_simple_key(parser *yaml_parser_t) bool { // A simple key is required at the current position if the scanner is in // the block context and the current column coincides with the indentation // level. required := parser.flow_level == 0 && parser.indent == parser.mark.column // // If the current position may start a simple key, save it. // if parser.simple_key_allowed { simple_key := yaml_simple_key_t{ possible: true, required: required, token_number: parser.tokens_parsed + (len(parser.tokens) - parser.tokens_head), mark: parser.mark, } if !yaml_parser_remove_simple_key(parser) { return false } parser.simple_keys[len(parser.simple_keys)-1] = simple_key parser.simple_keys_by_tok[simple_key.token_number] = len(parser.simple_keys) - 1 } return true } // Remove a potential simple key at the current flow level. func yaml_parser_remove_simple_key(parser *yaml_parser_t) bool { i := len(parser.simple_keys) - 1 if parser.simple_keys[i].possible { // If the key is required, it is an error. if parser.simple_keys[i].required { return yaml_parser_set_scanner_error(parser, "while scanning a simple key", parser.simple_keys[i].mark, "could not find expected ':'") } // Remove the key from the stack. parser.simple_keys[i].possible = false delete(parser.simple_keys_by_tok, parser.simple_keys[i].token_number) } return true } // max_flow_level limits the flow_level const max_flow_level = 10000 // Increase the flow level and resize the simple key list if needed. func yaml_parser_increase_flow_level(parser *yaml_parser_t) bool { // Reset the simple key on the next level. parser.simple_keys = append(parser.simple_keys, yaml_simple_key_t{ possible: false, required: false, token_number: parser.tokens_parsed + (len(parser.tokens) - parser.tokens_head), mark: parser.mark, }) // Increase the flow level. parser.flow_level++ if parser.flow_level > max_flow_level { return yaml_parser_set_scanner_error(parser, "while increasing flow level", parser.simple_keys[len(parser.simple_keys)-1].mark, fmt.Sprintf("exceeded max depth of %d", max_flow_level)) } return true } // Decrease the flow level. func yaml_parser_decrease_flow_level(parser *yaml_parser_t) bool { if parser.flow_level > 0 { parser.flow_level-- last := len(parser.simple_keys) - 1 delete(parser.simple_keys_by_tok, parser.simple_keys[last].token_number) parser.simple_keys = parser.simple_keys[:last] } return true } // max_indents limits the indents stack size const max_indents = 10000 // Push the current indentation level to the stack and set the new level // the current column is greater than the indentation level. In this case, // append or insert the specified token into the token queue. func yaml_parser_roll_indent(parser *yaml_parser_t, column, number int, typ yaml_token_type_t, mark yaml_mark_t) bool { // In the flow context, do nothing. if parser.flow_level > 0 { return true } if parser.indent < column { // Push the current indentation level to the stack and set the new // indentation level. parser.indents = append(parser.indents, parser.indent) parser.indent = column if len(parser.indents) > max_indents { return yaml_parser_set_scanner_error(parser, "while increasing indent level", parser.simple_keys[len(parser.simple_keys)-1].mark, fmt.Sprintf("exceeded max depth of %d", max_indents)) } // Create a token and insert it into the queue. token := yaml_token_t{ typ: typ, start_mark: mark, end_mark: mark, } if number > -1 { number -= parser.tokens_parsed } yaml_insert_token(parser, number, &token) } return true } // Pop indentation levels from the indents stack until the current level // becomes less or equal to the column. For each indentation level, append // the BLOCK-END token. func yaml_parser_unroll_indent(parser *yaml_parser_t, column int, scan_mark yaml_mark_t) bool { // In the flow context, do nothing. if parser.flow_level > 0 { return true } block_mark := scan_mark block_mark.index-- // Loop through the indentation levels in the stack. for parser.indent > column { // [Go] Reposition the end token before potential following // foot comments of parent blocks. For that, search // backwards for recent comments that were at the same // indent as the block that is ending now. stop_index := block_mark.index for i := len(parser.comments) - 1; i >= 0; i-- { comment := &parser.comments[i] if comment.end_mark.index < stop_index { // Don't go back beyond the start of the comment/whitespace scan, unless column < 0. // If requested indent column is < 0, then the document is over and everything else // is a foot anyway. break } if comment.start_mark.column == parser.indent+1 { // This is a good match. But maybe there's a former comment // at that same indent level, so keep searching. block_mark = comment.start_mark } // While the end of the former comment matches with // the start of the following one, we know there's // nothing in between and scanning is still safe. stop_index = comment.scan_mark.index } // Create a token and append it to the queue. token := yaml_token_t{ typ: yaml_BLOCK_END_TOKEN, start_mark: block_mark, end_mark: block_mark, } yaml_insert_token(parser, -1, &token) // Pop the indentation level. parser.indent = parser.indents[len(parser.indents)-1] parser.indents = parser.indents[:len(parser.indents)-1] } return true } // Initialize the scanner and produce the STREAM-START token. func yaml_parser_fetch_stream_start(parser *yaml_parser_t) bool { // Set the initial indentation. parser.indent = -1 // Initialize the simple key stack. parser.simple_keys = append(parser.simple_keys, yaml_simple_key_t{}) parser.simple_keys_by_tok = make(map[int]int) // A simple key is allowed at the beginning of the stream. parser.simple_key_allowed = true // We have started. parser.stream_start_produced = true // Create the STREAM-START token and append it to the queue. token := yaml_token_t{ typ: yaml_STREAM_START_TOKEN, start_mark: parser.mark, end_mark: parser.mark, encoding: parser.encoding, } yaml_insert_token(parser, -1, &token) return true } // Produce the STREAM-END token and shut down the scanner. func yaml_parser_fetch_stream_end(parser *yaml_parser_t) bool { // Force new line. if parser.mark.column != 0 { parser.mark.column = 0 parser.mark.line++ } // Reset the indentation level. if !yaml_parser_unroll_indent(parser, -1, parser.mark) { return false } // Reset simple keys. if !yaml_parser_remove_simple_key(parser) { return false } parser.simple_key_allowed = false // Create the STREAM-END token and append it to the queue. token := yaml_token_t{ typ: yaml_STREAM_END_TOKEN, start_mark: parser.mark, end_mark: parser.mark, } yaml_insert_token(parser, -1, &token) return true } // Produce a VERSION-DIRECTIVE or TAG-DIRECTIVE token. func yaml_parser_fetch_directive(parser *yaml_parser_t) bool { // Reset the indentation level. if !yaml_parser_unroll_indent(parser, -1, parser.mark) { return false } // Reset simple keys. if !yaml_parser_remove_simple_key(parser) { return false } parser.simple_key_allowed = false // Create the YAML-DIRECTIVE or TAG-DIRECTIVE token. token := yaml_token_t{} if !yaml_parser_scan_directive(parser, &token) { return false } // Append the token to the queue. yaml_insert_token(parser, -1, &token) return true } // Produce the DOCUMENT-START or DOCUMENT-END token. func yaml_parser_fetch_document_indicator(parser *yaml_parser_t, typ yaml_token_type_t) bool { // Reset the indentation level. if !yaml_parser_unroll_indent(parser, -1, parser.mark) { return false } // Reset simple keys. if !yaml_parser_remove_simple_key(parser) { return false } parser.simple_key_allowed = false // Consume the token. start_mark := parser.mark skip(parser) skip(parser) skip(parser) end_mark := parser.mark // Create the DOCUMENT-START or DOCUMENT-END token. token := yaml_token_t{ typ: typ, start_mark: start_mark, end_mark: end_mark, } // Append the token to the queue. yaml_insert_token(parser, -1, &token) return true } // Produce the FLOW-SEQUENCE-START or FLOW-MAPPING-START token. func yaml_parser_fetch_flow_collection_start(parser *yaml_parser_t, typ yaml_token_type_t) bool { // The indicators '[' and '{' may start a simple key. if !yaml_parser_save_simple_key(parser) { return false } // Increase the flow level. if !yaml_parser_increase_flow_level(parser) { return false } // A simple key may follow the indicators '[' and '{'. parser.simple_key_allowed = true // Consume the token. start_mark := parser.mark skip(parser) end_mark := parser.mark // Create the FLOW-SEQUENCE-START of FLOW-MAPPING-START token. token := yaml_token_t{ typ: typ, start_mark: start_mark, end_mark: end_mark, } // Append the token to the queue. yaml_insert_token(parser, -1, &token) return true } // Produce the FLOW-SEQUENCE-END or FLOW-MAPPING-END token. func yaml_parser_fetch_flow_collection_end(parser *yaml_parser_t, typ yaml_token_type_t) bool { // Reset any potential simple key on the current flow level. if !yaml_parser_remove_simple_key(parser) { return false } // Decrease the flow level. if !yaml_parser_decrease_flow_level(parser) { return false } // No simple keys after the indicators ']' and '}'. parser.simple_key_allowed = false // Consume the token. start_mark := parser.mark skip(parser) end_mark := parser.mark // Create the FLOW-SEQUENCE-END of FLOW-MAPPING-END token. token := yaml_token_t{ typ: typ, start_mark: start_mark, end_mark: end_mark, } // Append the token to the queue. yaml_insert_token(parser, -1, &token) return true } // Produce the FLOW-ENTRY token. func yaml_parser_fetch_flow_entry(parser *yaml_parser_t) bool { // Reset any potential simple keys on the current flow level. if !yaml_parser_remove_simple_key(parser) { return false } // Simple keys are allowed after ','. parser.simple_key_allowed = true // Consume the token. start_mark := parser.mark skip(parser) end_mark := parser.mark // Create the FLOW-ENTRY token and append it to the queue. token := yaml_token_t{ typ: yaml_FLOW_ENTRY_TOKEN, start_mark: start_mark, end_mark: end_mark, } yaml_insert_token(parser, -1, &token) return true } // Produce the BLOCK-ENTRY token. func yaml_parser_fetch_block_entry(parser *yaml_parser_t) bool { // Check if the scanner is in the block context. if parser.flow_level == 0 { // Check if we are allowed to start a new entry. if !parser.simple_key_allowed { return yaml_parser_set_scanner_error(parser, "", parser.mark, "block sequence entries are not allowed in this context") } // Add the BLOCK-SEQUENCE-START token if needed. if !yaml_parser_roll_indent(parser, parser.mark.column, -1, yaml_BLOCK_SEQUENCE_START_TOKEN, parser.mark) { return false } } else { // It is an error for the '-' indicator to occur in the flow context, // but we let the Parser detect and report about it because the Parser // is able to point to the context. } // Reset any potential simple keys on the current flow level. if !yaml_parser_remove_simple_key(parser) { return false } // Simple keys are allowed after '-'. parser.simple_key_allowed = true // Consume the token. start_mark := parser.mark skip(parser) end_mark := parser.mark // Create the BLOCK-ENTRY token and append it to the queue. token := yaml_token_t{ typ: yaml_BLOCK_ENTRY_TOKEN, start_mark: start_mark, end_mark: end_mark, } yaml_insert_token(parser, -1, &token) return true } // Produce the KEY token. func yaml_parser_fetch_key(parser *yaml_parser_t) bool { // In the block context, additional checks are required. if parser.flow_level == 0 { // Check if we are allowed to start a new key (not nessesary simple). if !parser.simple_key_allowed { return yaml_parser_set_scanner_error(parser, "", parser.mark, "mapping keys are not allowed in this context") } // Add the BLOCK-MAPPING-START token if needed. if !yaml_parser_roll_indent(parser, parser.mark.column, -1, yaml_BLOCK_MAPPING_START_TOKEN, parser.mark) { return false } } // Reset any potential simple keys on the current flow level. if !yaml_parser_remove_simple_key(parser) { return false } // Simple keys are allowed after '?' in the block context. parser.simple_key_allowed = parser.flow_level == 0 // Consume the token. start_mark := parser.mark skip(parser) end_mark := parser.mark // Create the KEY token and append it to the queue. token := yaml_token_t{ typ: yaml_KEY_TOKEN, start_mark: start_mark, end_mark: end_mark, } yaml_insert_token(parser, -1, &token) return true } // Produce the VALUE token. func yaml_parser_fetch_value(parser *yaml_parser_t) bool { simple_key := &parser.simple_keys[len(parser.simple_keys)-1] // Have we found a simple key? if valid, ok := yaml_simple_key_is_valid(parser, simple_key); !ok { return false } else if valid { // Create the KEY token and insert it into the queue. token := yaml_token_t{ typ: yaml_KEY_TOKEN, start_mark: simple_key.mark, end_mark: simple_key.mark, } yaml_insert_token(parser, simple_key.token_number-parser.tokens_parsed, &token) // In the block context, we may need to add the BLOCK-MAPPING-START token. if !yaml_parser_roll_indent(parser, simple_key.mark.column, simple_key.token_number, yaml_BLOCK_MAPPING_START_TOKEN, simple_key.mark) { return false } // Remove the simple key. simple_key.possible = false delete(parser.simple_keys_by_tok, simple_key.token_number) // A simple key cannot follow another simple key. parser.simple_key_allowed = false } else { // The ':' indicator follows a complex key. // In the block context, extra checks are required. if parser.flow_level == 0 { // Check if we are allowed to start a complex value. if !parser.simple_key_allowed { return yaml_parser_set_scanner_error(parser, "", parser.mark, "mapping values are not allowed in this context") } // Add the BLOCK-MAPPING-START token if needed. if !yaml_parser_roll_indent(parser, parser.mark.column, -1, yaml_BLOCK_MAPPING_START_TOKEN, parser.mark) { return false } } // Simple keys after ':' are allowed in the block context. parser.simple_key_allowed = parser.flow_level == 0 } // Consume the token. start_mark := parser.mark skip(parser) end_mark := parser.mark // Create the VALUE token and append it to the queue. token := yaml_token_t{ typ: yaml_VALUE_TOKEN, start_mark: start_mark, end_mark: end_mark, } yaml_insert_token(parser, -1, &token) return true } // Produce the ALIAS or ANCHOR token. func yaml_parser_fetch_anchor(parser *yaml_parser_t, typ yaml_token_type_t) bool { // An anchor or an alias could be a simple key. if !yaml_parser_save_simple_key(parser) { return false } // A simple key cannot follow an anchor or an alias. parser.simple_key_allowed = false // Create the ALIAS or ANCHOR token and append it to the queue. var token yaml_token_t if !yaml_parser_scan_anchor(parser, &token, typ) { return false } yaml_insert_token(parser, -1, &token) return true } // Produce the TAG token. func yaml_parser_fetch_tag(parser *yaml_parser_t) bool { // A tag could be a simple key. if !yaml_parser_save_simple_key(parser) { return false } // A simple key cannot follow a tag. parser.simple_key_allowed = false // Create the TAG token and append it to the queue. var token yaml_token_t if !yaml_parser_scan_tag(parser, &token) { return false } yaml_insert_token(parser, -1, &token) return true } // Produce the SCALAR(...,literal) or SCALAR(...,folded) tokens. func yaml_parser_fetch_block_scalar(parser *yaml_parser_t, literal bool) bool { // Remove any potential simple keys. if !yaml_parser_remove_simple_key(parser) { return false } // A simple key may follow a block scalar. parser.simple_key_allowed = true // Create the SCALAR token and append it to the queue. var token yaml_token_t if !yaml_parser_scan_block_scalar(parser, &token, literal) { return false } yaml_insert_token(parser, -1, &token) return true } // Produce the SCALAR(...,single-quoted) or SCALAR(...,double-quoted) tokens. func yaml_parser_fetch_flow_scalar(parser *yaml_parser_t, single bool) bool { // A plain scalar could be a simple key. if !yaml_parser_save_simple_key(parser) { return false } // A simple key cannot follow a flow scalar. parser.simple_key_allowed = false // Create the SCALAR token and append it to the queue. var token yaml_token_t if !yaml_parser_scan_flow_scalar(parser, &token, single) { return false } yaml_insert_token(parser, -1, &token) return true } // Produce the SCALAR(...,plain) token. func yaml_parser_fetch_plain_scalar(parser *yaml_parser_t) bool { // A plain scalar could be a simple key. if !yaml_parser_save_simple_key(parser) { return false } // A simple key cannot follow a flow scalar. parser.simple_key_allowed = false // Create the SCALAR token and append it to the queue. var token yaml_token_t if !yaml_parser_scan_plain_scalar(parser, &token) { return false } yaml_insert_token(parser, -1, &token) return true } // Eat whitespaces and comments until the next token is found. func yaml_parser_scan_to_next_token(parser *yaml_parser_t) bool { scan_mark := parser.mark // Until the next token is not found. for { // Allow the BOM mark to start a line. if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false } if parser.mark.column == 0 && is_bom(parser.buffer, parser.buffer_pos) { skip(parser) } // Eat whitespaces. // Tabs are allowed: // - in the flow context // - in the block context, but not at the beginning of the line or // after '-', '?', or ':' (complex value). if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false } for parser.buffer[parser.buffer_pos] == ' ' || ((parser.flow_level > 0 || !parser.simple_key_allowed) && parser.buffer[parser.buffer_pos] == '\t') { skip(parser) if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false } } // Check if we just had a line comment under a sequence entry that // looks more like a header to the following content. Similar to this: // // - # The comment // - Some data // // If so, transform the line comment to a head comment and reposition. if len(parser.comments) > 0 && len(parser.tokens) > 1 { tokenA := parser.tokens[len(parser.tokens)-2] tokenB := parser.tokens[len(parser.tokens)-1] comment := &parser.comments[len(parser.comments)-1] if tokenA.typ == yaml_BLOCK_SEQUENCE_START_TOKEN && tokenB.typ == yaml_BLOCK_ENTRY_TOKEN && len(comment.line) > 0 && !is_break(parser.buffer, parser.buffer_pos) { // If it was in the prior line, reposition so it becomes a // header of the follow up token. Otherwise, keep it in place // so it becomes a header of the former. comment.head = comment.line comment.line = nil if comment.start_mark.line == parser.mark.line-1 { comment.token_mark = parser.mark } } } // Eat a comment until a line break. if parser.buffer[parser.buffer_pos] == '#' { if !yaml_parser_scan_comments(parser, scan_mark) { return false } } // If it is a line break, eat it. if is_break(parser.buffer, parser.buffer_pos) { if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) { return false } skip_line(parser) // In the block context, a new line may start a simple key. if parser.flow_level == 0 { parser.simple_key_allowed = true } } else { break // We have found a token. } } return true } // Scan a YAML-DIRECTIVE or TAG-DIRECTIVE token. // // Scope: // %YAML 1.1 # a comment \n // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // %TAG !yaml! tag:yaml.org,2002: \n // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // func yaml_parser_scan_directive(parser *yaml_parser_t, token *yaml_token_t) bool { // Eat '%'. start_mark := parser.mark skip(parser) // Scan the directive name. var name []byte if !yaml_parser_scan_directive_name(parser, start_mark, &name) { return false } // Is it a YAML directive? if bytes.Equal(name, []byte("YAML")) { // Scan the VERSION directive value. var major, minor int8 if !yaml_parser_scan_version_directive_value(parser, start_mark, &major, &minor) { return false } end_mark := parser.mark // Create a VERSION-DIRECTIVE token. *token = yaml_token_t{ typ: yaml_VERSION_DIRECTIVE_TOKEN, start_mark: start_mark, end_mark: end_mark, major: major, minor: minor, } // Is it a TAG directive? } else if bytes.Equal(name, []byte("TAG")) { // Scan the TAG directive value. var handle, prefix []byte if !yaml_parser_scan_tag_directive_value(parser, start_mark, &handle, &prefix) { return false } end_mark := parser.mark // Create a TAG-DIRECTIVE token. *token = yaml_token_t{ typ: yaml_TAG_DIRECTIVE_TOKEN, start_mark: start_mark, end_mark: end_mark, value: handle, prefix: prefix, } // Unknown directive. } else { yaml_parser_set_scanner_error(parser, "while scanning a directive", start_mark, "found unknown directive name") return false } // Eat the rest of the line including any comments. if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false } for is_blank(parser.buffer, parser.buffer_pos) { skip(parser) if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false } } if parser.buffer[parser.buffer_pos] == '#' { // [Go] Discard this inline comment for the time being. //if !yaml_parser_scan_line_comment(parser, start_mark) { // return false //} for !is_breakz(parser.buffer, parser.buffer_pos) { skip(parser) if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false } } } // Check if we are at the end of the line. if !is_breakz(parser.buffer, parser.buffer_pos) { yaml_parser_set_scanner_error(parser, "while scanning a directive", start_mark, "did not find expected comment or line break") return false } // Eat a line break. if is_break(parser.buffer, parser.buffer_pos) { if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) { return false } skip_line(parser) } return true } // Scan the directive name. // // Scope: // %YAML 1.1 # a comment \n // ^^^^ // %TAG !yaml! tag:yaml.org,2002: \n // ^^^ // func yaml_parser_scan_directive_name(parser *yaml_parser_t, start_mark yaml_mark_t, name *[]byte) bool { // Consume the directive name. if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false } var s []byte for is_alpha(parser.buffer, parser.buffer_pos) { s = read(parser, s) if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false } } // Check if the name is empty. if len(s) == 0 { yaml_parser_set_scanner_error(parser, "while scanning a directive", start_mark, "could not find expected directive name") return false } // Check for an blank character after the name. if !is_blankz(parser.buffer, parser.buffer_pos) { yaml_parser_set_scanner_error(parser, "while scanning a directive", start_mark, "found unexpected non-alphabetical character") return false } *name = s return true } // Scan the value of VERSION-DIRECTIVE. // // Scope: // %YAML 1.1 # a comment \n // ^^^^^^ func yaml_parser_scan_version_directive_value(parser *yaml_parser_t, start_mark yaml_mark_t, major, minor *int8) bool { // Eat whitespaces. if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false } for is_blank(parser.buffer, parser.buffer_pos) { skip(parser) if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false } } // Consume the major version number. if !yaml_parser_scan_version_directive_number(parser, start_mark, major) { return false } // Eat '.'. if parser.buffer[parser.buffer_pos] != '.' { return yaml_parser_set_scanner_error(parser, "while scanning a %YAML directive", start_mark, "did not find expected digit or '.' character") } skip(parser) // Consume the minor version number. if !yaml_parser_scan_version_directive_number(parser, start_mark, minor) { return false } return true } const max_number_length = 2 // Scan the version number of VERSION-DIRECTIVE. // // Scope: // %YAML 1.1 # a comment \n // ^ // %YAML 1.1 # a comment \n // ^ func yaml_parser_scan_version_directive_number(parser *yaml_parser_t, start_mark yaml_mark_t, number *int8) bool { // Repeat while the next character is digit. if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false } var value, length int8 for is_digit(parser.buffer, parser.buffer_pos) { // Check if the number is too long. length++ if length > max_number_length { return yaml_parser_set_scanner_error(parser, "while scanning a %YAML directive", start_mark, "found extremely long version number") } value = value*10 + int8(as_digit(parser.buffer, parser.buffer_pos)) skip(parser) if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false } } // Check if the number was present. if length == 0 { return yaml_parser_set_scanner_error(parser, "while scanning a %YAML directive", start_mark, "did not find expected version number") } *number = value return true } // Scan the value of a TAG-DIRECTIVE token. // // Scope: // %TAG !yaml! tag:yaml.org,2002: \n // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // func yaml_parser_scan_tag_directive_value(parser *yaml_parser_t, start_mark yaml_mark_t, handle, prefix *[]byte) bool { var handle_value, prefix_value []byte // Eat whitespaces. if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false } for is_blank(parser.buffer, parser.buffer_pos) { skip(parser) if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false } } // Scan a handle. if !yaml_parser_scan_tag_handle(parser, true, start_mark, &handle_value) { return false } // Expect a whitespace. if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false } if !is_blank(parser.buffer, parser.buffer_pos) { yaml_parser_set_scanner_error(parser, "while scanning a %TAG directive", start_mark, "did not find expected whitespace") return false } // Eat whitespaces. for is_blank(parser.buffer, parser.buffer_pos) { skip(parser) if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false } } // Scan a prefix. if !yaml_parser_scan_tag_uri(parser, true, nil, start_mark, &prefix_value) { return false } // Expect a whitespace or line break. if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false } if !is_blankz(parser.buffer, parser.buffer_pos) { yaml_parser_set_scanner_error(parser, "while scanning a %TAG directive", start_mark, "did not find expected whitespace or line break") return false } *handle = handle_value *prefix = prefix_value return true } func yaml_parser_scan_anchor(parser *yaml_parser_t, token *yaml_token_t, typ yaml_token_type_t) bool { var s []byte // Eat the indicator character. start_mark := parser.mark skip(parser) // Consume the value. if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false } for is_alpha(parser.buffer, parser.buffer_pos) { s = read(parser, s) if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false } } end_mark := parser.mark /* * Check if length of the anchor is greater than 0 and it is followed by * a whitespace character or one of the indicators: * * '?', ':', ',', ']', '}', '%', '@', '`'. */ if len(s) == 0 || !(is_blankz(parser.buffer, parser.buffer_pos) || parser.buffer[parser.buffer_pos] == '?' || parser.buffer[parser.buffer_pos] == ':' || parser.buffer[parser.buffer_pos] == ',' || parser.buffer[parser.buffer_pos] == ']' || parser.buffer[parser.buffer_pos] == '}' || parser.buffer[parser.buffer_pos] == '%' || parser.buffer[parser.buffer_pos] == '@' || parser.buffer[parser.buffer_pos] == '`') { context := "while scanning an alias" if typ == yaml_ANCHOR_TOKEN { context = "while scanning an anchor" } yaml_parser_set_scanner_error(parser, context, start_mark, "did not find expected alphabetic or numeric character") return false } // Create a token. *token = yaml_token_t{ typ: typ, start_mark: start_mark, end_mark: end_mark, value: s, } return true } /* * Scan a TAG token. */ func yaml_parser_scan_tag(parser *yaml_parser_t, token *yaml_token_t) bool { var handle, suffix []byte start_mark := parser.mark // Check if the tag is in the canonical form. if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) { return false } if parser.buffer[parser.buffer_pos+1] == '<' { // Keep the handle as '' // Eat '!<' skip(parser) skip(parser) // Consume the tag value. if !yaml_parser_scan_tag_uri(parser, false, nil, start_mark, &suffix) { return false } // Check for '>' and eat it. if parser.buffer[parser.buffer_pos] != '>' { yaml_parser_set_scanner_error(parser, "while scanning a tag", start_mark, "did not find the expected '>'") return false } skip(parser) } else { // The tag has either the '!suffix' or the '!handle!suffix' form. // First, try to scan a handle. if !yaml_parser_scan_tag_handle(parser, false, start_mark, &handle) { return false } // Check if it is, indeed, handle. if handle[0] == '!' && len(handle) > 1 && handle[len(handle)-1] == '!' { // Scan the suffix now. if !yaml_parser_scan_tag_uri(parser, false, nil, start_mark, &suffix) { return false } } else { // It wasn't a handle after all. Scan the rest of the tag. if !yaml_parser_scan_tag_uri(parser, false, handle, start_mark, &suffix) { return false } // Set the handle to '!'. handle = []byte{'!'} // A special case: the '!' tag. Set the handle to '' and the // suffix to '!'. if len(suffix) == 0 { handle, suffix = suffix, handle } } } // Check the character which ends the tag. if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false } if !is_blankz(parser.buffer, parser.buffer_pos) { yaml_parser_set_scanner_error(parser, "while scanning a tag", start_mark, "did not find expected whitespace or line break") return false } end_mark := parser.mark // Create a token. *token = yaml_token_t{ typ: yaml_TAG_TOKEN, start_mark: start_mark, end_mark: end_mark, value: handle, suffix: suffix, } return true } // Scan a tag handle. func yaml_parser_scan_tag_handle(parser *yaml_parser_t, directive bool, start_mark yaml_mark_t, handle *[]byte) bool { // Check the initial '!' character. if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false } if parser.buffer[parser.buffer_pos] != '!' { yaml_parser_set_scanner_tag_error(parser, directive, start_mark, "did not find expected '!'") return false } var s []byte // Copy the '!' character. s = read(parser, s) // Copy all subsequent alphabetical and numerical characters. if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false } for is_alpha(parser.buffer, parser.buffer_pos) { s = read(parser, s) if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false } } // Check if the trailing character is '!' and copy it. if parser.buffer[parser.buffer_pos] == '!' { s = read(parser, s) } else { // It's either the '!' tag or not really a tag handle. If it's a %TAG // directive, it's an error. If it's a tag token, it must be a part of URI. if directive && string(s) != "!" { yaml_parser_set_scanner_tag_error(parser, directive, start_mark, "did not find expected '!'") return false } } *handle = s return true } // Scan a tag. func yaml_parser_scan_tag_uri(parser *yaml_parser_t, directive bool, head []byte, start_mark yaml_mark_t, uri *[]byte) bool { //size_t length = head ? strlen((char *)head) : 0 var s []byte hasTag := len(head) > 0 // Copy the head if needed. // // Note that we don't copy the leading '!' character. if len(head) > 1 { s = append(s, head[1:]...) } // Scan the tag. if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false } // The set of characters that may appear in URI is as follows: // // '0'-'9', 'A'-'Z', 'a'-'z', '_', '-', ';', '/', '?', ':', '@', '&', // '=', '+', '$', ',', '.', '!', '~', '*', '\'', '(', ')', '[', ']', // '%'. // [Go] TODO Convert this into more reasonable logic. for is_alpha(parser.buffer, parser.buffer_pos) || parser.buffer[parser.buffer_pos] == ';' || parser.buffer[parser.buffer_pos] == '/' || parser.buffer[parser.buffer_pos] == '?' || parser.buffer[parser.buffer_pos] == ':' || parser.buffer[parser.buffer_pos] == '@' || parser.buffer[parser.buffer_pos] == '&' || parser.buffer[parser.buffer_pos] == '=' || parser.buffer[parser.buffer_pos] == '+' || parser.buffer[parser.buffer_pos] == '$' || parser.buffer[parser.buffer_pos] == ',' || parser.buffer[parser.buffer_pos] == '.' || parser.buffer[parser.buffer_pos] == '!' || parser.buffer[parser.buffer_pos] == '~' || parser.buffer[parser.buffer_pos] == '*' || parser.buffer[parser.buffer_pos] == '\'' || parser.buffer[parser.buffer_pos] == '(' || parser.buffer[parser.buffer_pos] == ')' || parser.buffer[parser.buffer_pos] == '[' || parser.buffer[parser.buffer_pos] == ']' || parser.buffer[parser.buffer_pos] == '%' { // Check if it is a URI-escape sequence. if parser.buffer[parser.buffer_pos] == '%' { if !yaml_parser_scan_uri_escapes(parser, directive, start_mark, &s) { return false } } else { s = read(parser, s) } if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false } hasTag = true } if !hasTag { yaml_parser_set_scanner_tag_error(parser, directive, start_mark, "did not find expected tag URI") return false } *uri = s return true } // Decode an URI-escape sequence corresponding to a single UTF-8 character. func yaml_parser_scan_uri_escapes(parser *yaml_parser_t, directive bool, start_mark yaml_mark_t, s *[]byte) bool { // Decode the required number of characters. w := 1024 for w > 0 { // Check for a URI-escaped octet. if parser.unread < 3 && !yaml_parser_update_buffer(parser, 3) { return false } if !(parser.buffer[parser.buffer_pos] == '%' && is_hex(parser.buffer, parser.buffer_pos+1) && is_hex(parser.buffer, parser.buffer_pos+2)) { return yaml_parser_set_scanner_tag_error(parser, directive, start_mark, "did not find URI escaped octet") } // Get the octet. octet := byte((as_hex(parser.buffer, parser.buffer_pos+1) << 4) + as_hex(parser.buffer, parser.buffer_pos+2)) // If it is the leading octet, determine the length of the UTF-8 sequence. if w == 1024 { w = width(octet) if w == 0 { return yaml_parser_set_scanner_tag_error(parser, directive, start_mark, "found an incorrect leading UTF-8 octet") } } else { // Check if the trailing octet is correct. if octet&0xC0 != 0x80 { return yaml_parser_set_scanner_tag_error(parser, directive, start_mark, "found an incorrect trailing UTF-8 octet") } } // Copy the octet and move the pointers. *s = append(*s, octet) skip(parser) skip(parser) skip(parser) w-- } return true } // Scan a block scalar. func yaml_parser_scan_block_scalar(parser *yaml_parser_t, token *yaml_token_t, literal bool) bool { // Eat the indicator '|' or '>'. start_mark := parser.mark skip(parser) // Scan the additional block scalar indicators. if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false } // Check for a chomping indicator. var chomping, increment int if parser.buffer[parser.buffer_pos] == '+' || parser.buffer[parser.buffer_pos] == '-' { // Set the chomping method and eat the indicator. if parser.buffer[parser.buffer_pos] == '+' { chomping = +1 } else { chomping = -1 } skip(parser) // Check for an indentation indicator. if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false } if is_digit(parser.buffer, parser.buffer_pos) { // Check that the indentation is greater than 0. if parser.buffer[parser.buffer_pos] == '0' { yaml_parser_set_scanner_error(parser, "while scanning a block scalar", start_mark, "found an indentation indicator equal to 0") return false } // Get the indentation level and eat the indicator. increment = as_digit(parser.buffer, parser.buffer_pos) skip(parser) } } else if is_digit(parser.buffer, parser.buffer_pos) { // Do the same as above, but in the opposite order. if parser.buffer[parser.buffer_pos] == '0' { yaml_parser_set_scanner_error(parser, "while scanning a block scalar", start_mark, "found an indentation indicator equal to 0") return false } increment = as_digit(parser.buffer, parser.buffer_pos) skip(parser) if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false } if parser.buffer[parser.buffer_pos] == '+' || parser.buffer[parser.buffer_pos] == '-' { if parser.buffer[parser.buffer_pos] == '+' { chomping = +1 } else { chomping = -1 } skip(parser) } } // Eat whitespaces and comments to the end of the line. if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false } for is_blank(parser.buffer, parser.buffer_pos) { skip(parser) if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false } } if parser.buffer[parser.buffer_pos] == '#' { if !yaml_parser_scan_line_comment(parser, start_mark) { return false } for !is_breakz(parser.buffer, parser.buffer_pos) { skip(parser) if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false } } } // Check if we are at the end of the line. if !is_breakz(parser.buffer, parser.buffer_pos) { yaml_parser_set_scanner_error(parser, "while scanning a block scalar", start_mark, "did not find expected comment or line break") return false } // Eat a line break. if is_break(parser.buffer, parser.buffer_pos) { if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) { return false } skip_line(parser) } end_mark := parser.mark // Set the indentation level if it was specified. var indent int if increment > 0 { if parser.indent >= 0 { indent = parser.indent + increment } else { indent = increment } } // Scan the leading line breaks and determine the indentation level if needed. var s, leading_break, trailing_breaks []byte if !yaml_parser_scan_block_scalar_breaks(parser, &indent, &trailing_breaks, start_mark, &end_mark) { return false } // Scan the block scalar content. if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false } var leading_blank, trailing_blank bool for parser.mark.column == indent && !is_z(parser.buffer, parser.buffer_pos) { // We are at the beginning of a non-empty line. // Is it a trailing whitespace? trailing_blank = is_blank(parser.buffer, parser.buffer_pos) // Check if we need to fold the leading line break. if !literal && !leading_blank && !trailing_blank && len(leading_break) > 0 && leading_break[0] == '\n' { // Do we need to join the lines by space? if len(trailing_breaks) == 0 { s = append(s, ' ') } } else { s = append(s, leading_break...) } leading_break = leading_break[:0] // Append the remaining line breaks. s = append(s, trailing_breaks...) trailing_breaks = trailing_breaks[:0] // Is it a leading whitespace? leading_blank = is_blank(parser.buffer, parser.buffer_pos) // Consume the current line. for !is_breakz(parser.buffer, parser.buffer_pos) { s = read(parser, s) if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false } } // Consume the line break. if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) { return false } leading_break = read_line(parser, leading_break) // Eat the following indentation spaces and line breaks. if !yaml_parser_scan_block_scalar_breaks(parser, &indent, &trailing_breaks, start_mark, &end_mark) { return false } } // Chomp the tail. if chomping != -1 { s = append(s, leading_break...) } if chomping == 1 { s = append(s, trailing_breaks...) } // Create a token. *token = yaml_token_t{ typ: yaml_SCALAR_TOKEN, start_mark: start_mark, end_mark: end_mark, value: s, style: yaml_LITERAL_SCALAR_STYLE, } if !literal { token.style = yaml_FOLDED_SCALAR_STYLE } return true } // Scan indentation spaces and line breaks for a block scalar. Determine the // indentation level if needed. func 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 { *end_mark = parser.mark // Eat the indentation spaces and line breaks. max_indent := 0 for { // Eat the indentation spaces. if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false } for (*indent == 0 || parser.mark.column < *indent) && is_space(parser.buffer, parser.buffer_pos) { skip(parser) if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false } } if parser.mark.column > max_indent { max_indent = parser.mark.column } // Check for a tab character messing the indentation. if (*indent == 0 || parser.mark.column < *indent) && is_tab(parser.buffer, parser.buffer_pos) { return yaml_parser_set_scanner_error(parser, "while scanning a block scalar", start_mark, "found a tab character where an indentation space is expected") } // Have we found a non-empty line? if !is_break(parser.buffer, parser.buffer_pos) { break } // Consume the line break. if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) { return false } // [Go] Should really be returning breaks instead. *breaks = read_line(parser, *breaks) *end_mark = parser.mark } // Determine the indentation level if needed. if *indent == 0 { *indent = max_indent if *indent < parser.indent+1 { *indent = parser.indent + 1 } if *indent < 1 { *indent = 1 } } return true } // Scan a quoted scalar. func yaml_parser_scan_flow_scalar(parser *yaml_parser_t, token *yaml_token_t, single bool) bool { // Eat the left quote. start_mark := parser.mark skip(parser) // Consume the content of the quoted scalar. var s, leading_break, trailing_breaks, whitespaces []byte for { // Check that there are no document indicators at the beginning of the line. if parser.unread < 4 && !yaml_parser_update_buffer(parser, 4) { return false } if parser.mark.column == 0 && ((parser.buffer[parser.buffer_pos+0] == '-' && parser.buffer[parser.buffer_pos+1] == '-' && parser.buffer[parser.buffer_pos+2] == '-') || (parser.buffer[parser.buffer_pos+0] == '.' && parser.buffer[parser.buffer_pos+1] == '.' && parser.buffer[parser.buffer_pos+2] == '.')) && is_blankz(parser.buffer, parser.buffer_pos+3) { yaml_parser_set_scanner_error(parser, "while scanning a quoted scalar", start_mark, "found unexpected document indicator") return false } // Check for EOF. if is_z(parser.buffer, parser.buffer_pos) { yaml_parser_set_scanner_error(parser, "while scanning a quoted scalar", start_mark, "found unexpected end of stream") return false } // Consume non-blank characters. leading_blanks := false for !is_blankz(parser.buffer, parser.buffer_pos) { if single && parser.buffer[parser.buffer_pos] == '\'' && parser.buffer[parser.buffer_pos+1] == '\'' { // Is is an escaped single quote. s = append(s, '\'') skip(parser) skip(parser) } else if single && parser.buffer[parser.buffer_pos] == '\'' { // It is a right single quote. break } else if !single && parser.buffer[parser.buffer_pos] == '"' { // It is a right double quote. break } else if !single && parser.buffer[parser.buffer_pos] == '\\' && is_break(parser.buffer, parser.buffer_pos+1) { // It is an escaped line break. if parser.unread < 3 && !yaml_parser_update_buffer(parser, 3) { return false } skip(parser) skip_line(parser) leading_blanks = true break } else if !single && parser.buffer[parser.buffer_pos] == '\\' { // It is an escape sequence. code_length := 0 // Check the escape character. switch parser.buffer[parser.buffer_pos+1] { case '0': s = append(s, 0) case 'a': s = append(s, '\x07') case 'b': s = append(s, '\x08') case 't', '\t': s = append(s, '\x09') case 'n': s = append(s, '\x0A') case 'v': s = append(s, '\x0B') case 'f': s = append(s, '\x0C') case 'r': s = append(s, '\x0D') case 'e': s = append(s, '\x1B') case ' ': s = append(s, '\x20') case '"': s = append(s, '"') case '\'': s = append(s, '\'') case '\\': s = append(s, '\\') case 'N': // NEL (#x85) s = append(s, '\xC2') s = append(s, '\x85') case '_': // #xA0 s = append(s, '\xC2') s = append(s, '\xA0') case 'L': // LS (#x2028) s = append(s, '\xE2') s = append(s, '\x80') s = append(s, '\xA8') case 'P': // PS (#x2029) s = append(s, '\xE2') s = append(s, '\x80') s = append(s, '\xA9') case 'x': code_length = 2 case 'u': code_length = 4 case 'U': code_length = 8 default: yaml_parser_set_scanner_error(parser, "while parsing a quoted scalar", start_mark, "found unknown escape character") return false } skip(parser) skip(parser) // Consume an arbitrary escape code. if code_length > 0 { var value int // Scan the character value. if parser.unread < code_length && !yaml_parser_update_buffer(parser, code_length) { return false } for k := 0; k < code_length; k++ { if !is_hex(parser.buffer, parser.buffer_pos+k) { yaml_parser_set_scanner_error(parser, "while parsing a quoted scalar", start_mark, "did not find expected hexdecimal number") return false } value = (value << 4) + as_hex(parser.buffer, parser.buffer_pos+k) } // Check the value and write the character. if (value >= 0xD800 && value <= 0xDFFF) || value > 0x10FFFF { yaml_parser_set_scanner_error(parser, "while parsing a quoted scalar", start_mark, "found invalid Unicode character escape code") return false } if value <= 0x7F { s = append(s, byte(value)) } else if value <= 0x7FF { s = append(s, byte(0xC0+(value>>6))) s = append(s, byte(0x80+(value&0x3F))) } else if value <= 0xFFFF { s = append(s, byte(0xE0+(value>>12))) s = append(s, byte(0x80+((value>>6)&0x3F))) s = append(s, byte(0x80+(value&0x3F))) } else { s = append(s, byte(0xF0+(value>>18))) s = append(s, byte(0x80+((value>>12)&0x3F))) s = append(s, byte(0x80+((value>>6)&0x3F))) s = append(s, byte(0x80+(value&0x3F))) } // Advance the pointer. for k := 0; k < code_length; k++ { skip(parser) } } } else { // It is a non-escaped non-blank character. s = read(parser, s) } if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) { return false } } if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false } // Check if we are at the end of the scalar. if single { if parser.buffer[parser.buffer_pos] == '\'' { break } } else { if parser.buffer[parser.buffer_pos] == '"' { break } } // Consume blank characters. for is_blank(parser.buffer, parser.buffer_pos) || is_break(parser.buffer, parser.buffer_pos) { if is_blank(parser.buffer, parser.buffer_pos) { // Consume a space or a tab character. if !leading_blanks { whitespaces = read(parser, whitespaces) } else { skip(parser) } } else { if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) { return false } // Check if it is a first line break. if !leading_blanks { whitespaces = whitespaces[:0] leading_break = read_line(parser, leading_break) leading_blanks = true } else { trailing_breaks = read_line(parser, trailing_breaks) } } if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false } } // Join the whitespaces or fold line breaks. if leading_blanks { // Do we need to fold line breaks? if len(leading_break) > 0 && leading_break[0] == '\n' { if len(trailing_breaks) == 0 { s = append(s, ' ') } else { s = append(s, trailing_breaks...) } } else { s = append(s, leading_break...) s = append(s, trailing_breaks...) } trailing_breaks = trailing_breaks[:0] leading_break = leading_break[:0] } else { s = append(s, whitespaces...) whitespaces = whitespaces[:0] } } // Eat the right quote. skip(parser) end_mark := parser.mark // Create a token. *token = yaml_token_t{ typ: yaml_SCALAR_TOKEN, start_mark: start_mark, end_mark: end_mark, value: s, style: yaml_SINGLE_QUOTED_SCALAR_STYLE, } if !single { token.style = yaml_DOUBLE_QUOTED_SCALAR_STYLE } return true } // Scan a plain scalar. func yaml_parser_scan_plain_scalar(parser *yaml_parser_t, token *yaml_token_t) bool { var s, leading_break, trailing_breaks, whitespaces []byte var leading_blanks bool var indent = parser.indent + 1 start_mark := parser.mark end_mark := parser.mark // Consume the content of the plain scalar. for { // Check for a document indicator. if parser.unread < 4 && !yaml_parser_update_buffer(parser, 4) { return false } if parser.mark.column == 0 && ((parser.buffer[parser.buffer_pos+0] == '-' && parser.buffer[parser.buffer_pos+1] == '-' && parser.buffer[parser.buffer_pos+2] == '-') || (parser.buffer[parser.buffer_pos+0] == '.' && parser.buffer[parser.buffer_pos+1] == '.' && parser.buffer[parser.buffer_pos+2] == '.')) && is_blankz(parser.buffer, parser.buffer_pos+3) { break } // Check for a comment. if parser.buffer[parser.buffer_pos] == '#' { break } // Consume non-blank characters. for !is_blankz(parser.buffer, parser.buffer_pos) { // Check for indicators that may end a plain scalar. if (parser.buffer[parser.buffer_pos] == ':' && is_blankz(parser.buffer, parser.buffer_pos+1)) || (parser.flow_level > 0 && (parser.buffer[parser.buffer_pos] == ',' || parser.buffer[parser.buffer_pos] == '?' || parser.buffer[parser.buffer_pos] == '[' || parser.buffer[parser.buffer_pos] == ']' || parser.buffer[parser.buffer_pos] == '{' || parser.buffer[parser.buffer_pos] == '}')) { break } // Check if we need to join whitespaces and breaks. if leading_blanks || len(whitespaces) > 0 { if leading_blanks { // Do we need to fold line breaks? if leading_break[0] == '\n' { if len(trailing_breaks) == 0 { s = append(s, ' ') } else { s = append(s, trailing_breaks...) } } else { s = append(s, leading_break...) s = append(s, trailing_breaks...) } trailing_breaks = trailing_breaks[:0] leading_break = leading_break[:0] leading_blanks = false } else { s = append(s, whitespaces...) whitespaces = whitespaces[:0] } } // Copy the character. s = read(parser, s) end_mark = parser.mark if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) { return false } } // Is it the end? if !(is_blank(parser.buffer, parser.buffer_pos) || is_break(parser.buffer, parser.buffer_pos)) { break } // Consume blank characters. if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false } for is_blank(parser.buffer, parser.buffer_pos) || is_break(parser.buffer, parser.buffer_pos) { if is_blank(parser.buffer, parser.buffer_pos) { // Check for tab characters that abuse indentation. if leading_blanks && parser.mark.column < indent && is_tab(parser.buffer, parser.buffer_pos) { yaml_parser_set_scanner_error(parser, "while scanning a plain scalar", start_mark, "found a tab character that violates indentation") return false } // Consume a space or a tab character. if !leading_blanks { whitespaces = read(parser, whitespaces) } else { skip(parser) } } else { if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) { return false } // Check if it is a first line break. if !leading_blanks { whitespaces = whitespaces[:0] leading_break = read_line(parser, leading_break) leading_blanks = true } else { trailing_breaks = read_line(parser, trailing_breaks) } } if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false } } // Check indentation level. if parser.flow_level == 0 && parser.mark.column < indent { break } } // Create a token. *token = yaml_token_t{ typ: yaml_SCALAR_TOKEN, start_mark: start_mark, end_mark: end_mark, value: s, style: yaml_PLAIN_SCALAR_STYLE, } // Note that we change the 'simple_key_allowed' flag. if leading_blanks { parser.simple_key_allowed = true } return true } func yaml_parser_scan_line_comment(parser *yaml_parser_t, token_mark yaml_mark_t) bool { if parser.newlines > 0 { return true } var start_mark yaml_mark_t var text []byte for peek := 0; peek < 512; peek++ { if parser.unread < peek+1 && !yaml_parser_update_buffer(parser, peek+1) { break } if is_blank(parser.buffer, parser.buffer_pos+peek) { continue } if parser.buffer[parser.buffer_pos+peek] == '#' { seen := parser.mark.index+peek for { if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false } if is_breakz(parser.buffer, parser.buffer_pos) { if parser.mark.index >= seen { break } if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) { return false } skip_line(parser) } else if parser.mark.index >= seen { if len(text) == 0 { start_mark = parser.mark } text = read(parser, text) } else { skip(parser) } } } break } if len(text) > 0 { parser.comments = append(parser.comments, yaml_comment_t{ token_mark: token_mark, start_mark: start_mark, line: text, }) } return true } func yaml_parser_scan_comments(parser *yaml_parser_t, scan_mark yaml_mark_t) bool { token := parser.tokens[len(parser.tokens)-1] if token.typ == yaml_FLOW_ENTRY_TOKEN && len(parser.tokens) > 1 { token = parser.tokens[len(parser.tokens)-2] } var token_mark = token.start_mark var start_mark yaml_mark_t var next_indent = parser.indent if next_indent < 0 { next_indent = 0 } var recent_empty = false var first_empty = parser.newlines <= 1 var line = parser.mark.line var column = parser.mark.column var text []byte // The foot line is the place where a comment must start to // still be considered as a foot of the prior content. // If there's some content in the currently parsed line, then // the foot is the line below it. var foot_line = -1 if scan_mark.line > 0 { foot_line = parser.mark.line-parser.newlines+1 if parser.newlines == 0 && parser.mark.column > 1 { foot_line++ } } var peek = 0 for ; peek < 512; peek++ { if parser.unread < peek+1 && !yaml_parser_update_buffer(parser, peek+1) { break } column++ if is_blank(parser.buffer, parser.buffer_pos+peek) { continue } c := parser.buffer[parser.buffer_pos+peek] var close_flow = parser.flow_level > 0 && (c == ']' || c == '}') if close_flow || is_breakz(parser.buffer, parser.buffer_pos+peek) { // Got line break or terminator. if close_flow || !recent_empty { if close_flow || first_empty && (start_mark.line == foot_line && token.typ != yaml_VALUE_TOKEN || start_mark.column-1 < next_indent) { // This is the first empty line and there were no empty lines before, // so this initial part of the comment is a foot of the prior token // instead of being a head for the following one. Split it up. // Alternatively, this might also be the last comment inside a flow // scope, so it must be a footer. if len(text) > 0 { if start_mark.column-1 < next_indent { // If dedented it's unrelated to the prior token. token_mark = start_mark } parser.comments = append(parser.comments, yaml_comment_t{ scan_mark: scan_mark, token_mark: token_mark, start_mark: start_mark, end_mark: yaml_mark_t{parser.mark.index + peek, line, column}, foot: text, }) scan_mark = yaml_mark_t{parser.mark.index + peek, line, column} token_mark = scan_mark text = nil } } else { if len(text) > 0 && parser.buffer[parser.buffer_pos+peek] != 0 { text = append(text, '\n') } } } if !is_break(parser.buffer, parser.buffer_pos+peek) { break } first_empty = false recent_empty = true column = 0 line++ continue } if len(text) > 0 && (close_flow || column-1 < next_indent && column != start_mark.column) { // The comment at the different indentation is a foot of the // preceding data rather than a head of the upcoming one. parser.comments = append(parser.comments, yaml_comment_t{ scan_mark: scan_mark, token_mark: token_mark, start_mark: start_mark, end_mark: yaml_mark_t{parser.mark.index + peek, line, column}, foot: text, }) scan_mark = yaml_mark_t{parser.mark.index + peek, line, column} token_mark = scan_mark text = nil } if parser.buffer[parser.buffer_pos+peek] != '#' { break } if len(text) == 0 { start_mark = yaml_mark_t{parser.mark.index + peek, line, column} } else { text = append(text, '\n') } recent_empty = false // Consume until after the consumed comment line. seen := parser.mark.index+peek for { if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false } if is_breakz(parser.buffer, parser.buffer_pos) { if parser.mark.index >= seen { break } if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) { return false } skip_line(parser) } else if parser.mark.index >= seen { text = read(parser, text) } else { skip(parser) } } peek = 0 column = 0 line = parser.mark.line next_indent = parser.indent if next_indent < 0 { next_indent = 0 } } if len(text) > 0 { parser.comments = append(parser.comments, yaml_comment_t{ scan_mark: scan_mark, token_mark: start_mark, start_mark: start_mark, end_mark: yaml_mark_t{parser.mark.index + peek - 1, line, column}, head: text, }) } return true } ================================================ FILE: vendor/gopkg.in/yaml.v3/sorter.go ================================================ // // Copyright (c) 2011-2019 Canonical Ltd // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package yaml import ( "reflect" "unicode" ) type keyList []reflect.Value func (l keyList) Len() int { return len(l) } func (l keyList) Swap(i, j int) { l[i], l[j] = l[j], l[i] } func (l keyList) Less(i, j int) bool { a := l[i] b := l[j] ak := a.Kind() bk := b.Kind() for (ak == reflect.Interface || ak == reflect.Ptr) && !a.IsNil() { a = a.Elem() ak = a.Kind() } for (bk == reflect.Interface || bk == reflect.Ptr) && !b.IsNil() { b = b.Elem() bk = b.Kind() } af, aok := keyFloat(a) bf, bok := keyFloat(b) if aok && bok { if af != bf { return af < bf } if ak != bk { return ak < bk } return numLess(a, b) } if ak != reflect.String || bk != reflect.String { return ak < bk } ar, br := []rune(a.String()), []rune(b.String()) digits := false for i := 0; i < len(ar) && i < len(br); i++ { if ar[i] == br[i] { digits = unicode.IsDigit(ar[i]) continue } al := unicode.IsLetter(ar[i]) bl := unicode.IsLetter(br[i]) if al && bl { return ar[i] < br[i] } if al || bl { if digits { return al } else { return bl } } var ai, bi int var an, bn int64 if ar[i] == '0' || br[i] == '0' { for j := i - 1; j >= 0 && unicode.IsDigit(ar[j]); j-- { if ar[j] != '0' { an = 1 bn = 1 break } } } for ai = i; ai < len(ar) && unicode.IsDigit(ar[ai]); ai++ { an = an*10 + int64(ar[ai]-'0') } for bi = i; bi < len(br) && unicode.IsDigit(br[bi]); bi++ { bn = bn*10 + int64(br[bi]-'0') } if an != bn { return an < bn } if ai != bi { return ai < bi } return ar[i] < br[i] } return len(ar) < len(br) } // keyFloat returns a float value for v if it is a number/bool // and whether it is a number/bool or not. func keyFloat(v reflect.Value) (f float64, ok bool) { switch v.Kind() { case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: return float64(v.Int()), true case reflect.Float32, reflect.Float64: return v.Float(), true case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: return float64(v.Uint()), true case reflect.Bool: if v.Bool() { return 1, true } return 0, true } return 0, false } // numLess returns whether a < b. // a and b must necessarily have the same kind. func numLess(a, b reflect.Value) bool { switch a.Kind() { case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: return a.Int() < b.Int() case reflect.Float32, reflect.Float64: return a.Float() < b.Float() case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: return a.Uint() < b.Uint() case reflect.Bool: return !a.Bool() && b.Bool() } panic("not a number") } ================================================ FILE: vendor/gopkg.in/yaml.v3/writerc.go ================================================ // // Copyright (c) 2011-2019 Canonical Ltd // Copyright (c) 2006-2010 Kirill Simonov // // Permission is hereby granted, free of charge, to any person obtaining a copy of // this software and associated documentation files (the "Software"), to deal in // the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies // of the Software, and to permit persons to whom the Software is furnished to do // so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. package yaml // Set the writer error and return false. func yaml_emitter_set_writer_error(emitter *yaml_emitter_t, problem string) bool { emitter.error = yaml_WRITER_ERROR emitter.problem = problem return false } // Flush the output buffer. func yaml_emitter_flush(emitter *yaml_emitter_t) bool { if emitter.write_handler == nil { panic("write handler not set") } // Check if the buffer is empty. if emitter.buffer_pos == 0 { return true } if err := emitter.write_handler(emitter, emitter.buffer[:emitter.buffer_pos]); err != nil { return yaml_emitter_set_writer_error(emitter, "write error: "+err.Error()) } emitter.buffer_pos = 0 return true } ================================================ FILE: vendor/gopkg.in/yaml.v3/yaml.go ================================================ // // Copyright (c) 2011-2019 Canonical Ltd // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Package yaml implements YAML support for the Go language. // // Source code and other details for the project are available at GitHub: // // https://github.com/go-yaml/yaml // package yaml import ( "errors" "fmt" "io" "reflect" "strings" "sync" "unicode/utf8" ) // The Unmarshaler interface may be implemented by types to customize their // behavior when being unmarshaled from a YAML document. type Unmarshaler interface { UnmarshalYAML(value *Node) error } type obsoleteUnmarshaler interface { UnmarshalYAML(unmarshal func(interface{}) error) error } // The Marshaler interface may be implemented by types to customize their // behavior when being marshaled into a YAML document. The returned value // is marshaled in place of the original value implementing Marshaler. // // If an error is returned by MarshalYAML, the marshaling procedure stops // and returns with the provided error. type Marshaler interface { MarshalYAML() (interface{}, error) } // Unmarshal decodes the first document found within the in byte slice // and assigns decoded values into the out value. // // Maps and pointers (to a struct, string, int, etc) are accepted as out // values. If an internal pointer within a struct is not initialized, // the yaml package will initialize it if necessary for unmarshalling // the provided data. The out parameter must not be nil. // // The type of the decoded values should be compatible with the respective // values in out. If one or more values cannot be decoded due to a type // mismatches, decoding continues partially until the end of the YAML // content, and a *yaml.TypeError is returned with details for all // missed values. // // Struct fields are only unmarshalled if they are exported (have an // upper case first letter), and are unmarshalled using the field name // lowercased as the default key. Custom keys may be defined via the // "yaml" name in the field tag: the content preceding the first comma // is used as the key, and the following comma-separated options are // used to tweak the marshalling process (see Marshal). // Conflicting names result in a runtime error. // // For example: // // type T struct { // F int `yaml:"a,omitempty"` // B int // } // var t T // yaml.Unmarshal([]byte("a: 1\nb: 2"), &t) // // See the documentation of Marshal for the format of tags and a list of // supported tag options. // func Unmarshal(in []byte, out interface{}) (err error) { return unmarshal(in, out, false) } // A Decoder reads and decodes YAML values from an input stream. type Decoder struct { parser *parser knownFields bool } // NewDecoder returns a new decoder that reads from r. // // The decoder introduces its own buffering and may read // data from r beyond the YAML values requested. func NewDecoder(r io.Reader) *Decoder { return &Decoder{ parser: newParserFromReader(r), } } // KnownFields ensures that the keys in decoded mappings to // exist as fields in the struct being decoded into. func (dec *Decoder) KnownFields(enable bool) { dec.knownFields = enable } // Decode reads the next YAML-encoded value from its input // and stores it in the value pointed to by v. // // See the documentation for Unmarshal for details about the // conversion of YAML into a Go value. func (dec *Decoder) Decode(v interface{}) (err error) { d := newDecoder() d.knownFields = dec.knownFields defer handleErr(&err) node := dec.parser.parse() if node == nil { return io.EOF } out := reflect.ValueOf(v) if out.Kind() == reflect.Ptr && !out.IsNil() { out = out.Elem() } d.unmarshal(node, out) if len(d.terrors) > 0 { return &TypeError{d.terrors} } return nil } // Decode decodes the node and stores its data into the value pointed to by v. // // See the documentation for Unmarshal for details about the // conversion of YAML into a Go value. func (n *Node) Decode(v interface{}) (err error) { d := newDecoder() defer handleErr(&err) out := reflect.ValueOf(v) if out.Kind() == reflect.Ptr && !out.IsNil() { out = out.Elem() } d.unmarshal(n, out) if len(d.terrors) > 0 { return &TypeError{d.terrors} } return nil } func unmarshal(in []byte, out interface{}, strict bool) (err error) { defer handleErr(&err) d := newDecoder() p := newParser(in) defer p.destroy() node := p.parse() if node != nil { v := reflect.ValueOf(out) if v.Kind() == reflect.Ptr && !v.IsNil() { v = v.Elem() } d.unmarshal(node, v) } if len(d.terrors) > 0 { return &TypeError{d.terrors} } return nil } // Marshal serializes the value provided into a YAML document. The structure // of the generated document will reflect the structure of the value itself. // Maps and pointers (to struct, string, int, etc) are accepted as the in value. // // Struct fields are only marshalled if they are exported (have an upper case // first letter), and are marshalled using the field name lowercased as the // default key. Custom keys may be defined via the "yaml" name in the field // tag: the content preceding the first comma is used as the key, and the // following comma-separated options are used to tweak the marshalling process. // Conflicting names result in a runtime error. // // The field tag format accepted is: // // `(...) yaml:"[][,[,]]" (...)` // // The following flags are currently supported: // // omitempty Only include the field if it's not set to the zero // value for the type or to empty slices or maps. // Zero valued structs will be omitted if all their public // fields are zero, unless they implement an IsZero // method (see the IsZeroer interface type), in which // case the field will be excluded if IsZero returns true. // // flow Marshal using a flow style (useful for structs, // sequences and maps). // // inline Inline the field, which must be a struct or a map, // causing all of its fields or keys to be processed as if // they were part of the outer struct. For maps, keys must // not conflict with the yaml keys of other struct fields. // // In addition, if the key is "-", the field is ignored. // // For example: // // type T struct { // F int `yaml:"a,omitempty"` // B int // } // yaml.Marshal(&T{B: 2}) // Returns "b: 2\n" // yaml.Marshal(&T{F: 1}} // Returns "a: 1\nb: 0\n" // func Marshal(in interface{}) (out []byte, err error) { defer handleErr(&err) e := newEncoder() defer e.destroy() e.marshalDoc("", reflect.ValueOf(in)) e.finish() out = e.out return } // An Encoder writes YAML values to an output stream. type Encoder struct { encoder *encoder } // NewEncoder returns a new encoder that writes to w. // The Encoder should be closed after use to flush all data // to w. func NewEncoder(w io.Writer) *Encoder { return &Encoder{ encoder: newEncoderWithWriter(w), } } // Encode writes the YAML encoding of v to the stream. // If multiple items are encoded to the stream, the // second and subsequent document will be preceded // with a "---" document separator, but the first will not. // // See the documentation for Marshal for details about the conversion of Go // values to YAML. func (e *Encoder) Encode(v interface{}) (err error) { defer handleErr(&err) e.encoder.marshalDoc("", reflect.ValueOf(v)) return nil } // Encode encodes value v and stores its representation in n. // // See the documentation for Marshal for details about the // conversion of Go values into YAML. func (n *Node) Encode(v interface{}) (err error) { defer handleErr(&err) e := newEncoder() defer e.destroy() e.marshalDoc("", reflect.ValueOf(v)) e.finish() p := newParser(e.out) p.textless = true defer p.destroy() doc := p.parse() *n = *doc.Content[0] return nil } // SetIndent changes the used indentation used when encoding. func (e *Encoder) SetIndent(spaces int) { if spaces < 0 { panic("yaml: cannot indent to a negative number of spaces") } e.encoder.indent = spaces } // Close closes the encoder by writing any remaining data. // It does not write a stream terminating string "...". func (e *Encoder) Close() (err error) { defer handleErr(&err) e.encoder.finish() return nil } func handleErr(err *error) { if v := recover(); v != nil { if e, ok := v.(yamlError); ok { *err = e.err } else { panic(v) } } } type yamlError struct { err error } func fail(err error) { panic(yamlError{err}) } func failf(format string, args ...interface{}) { panic(yamlError{fmt.Errorf("yaml: "+format, args...)}) } // A TypeError is returned by Unmarshal when one or more fields in // the YAML document cannot be properly decoded into the requested // types. When this error is returned, the value is still // unmarshaled partially. type TypeError struct { Errors []string } func (e *TypeError) Error() string { return fmt.Sprintf("yaml: unmarshal errors:\n %s", strings.Join(e.Errors, "\n ")) } type Kind uint32 const ( DocumentNode Kind = 1 << iota SequenceNode MappingNode ScalarNode AliasNode ) type Style uint32 const ( TaggedStyle Style = 1 << iota DoubleQuotedStyle SingleQuotedStyle LiteralStyle FoldedStyle FlowStyle ) // Node represents an element in the YAML document hierarchy. While documents // are typically encoded and decoded into higher level types, such as structs // and maps, Node is an intermediate representation that allows detailed // control over the content being decoded or encoded. // // It's worth noting that although Node offers access into details such as // line numbers, colums, and comments, the content when re-encoded will not // have its original textual representation preserved. An effort is made to // render the data plesantly, and to preserve comments near the data they // describe, though. // // Values that make use of the Node type interact with the yaml package in the // same way any other type would do, by encoding and decoding yaml data // directly or indirectly into them. // // For example: // // var person struct { // Name string // Address yaml.Node // } // err := yaml.Unmarshal(data, &person) // // Or by itself: // // var person Node // err := yaml.Unmarshal(data, &person) // type Node struct { // Kind defines whether the node is a document, a mapping, a sequence, // a scalar value, or an alias to another node. The specific data type of // scalar nodes may be obtained via the ShortTag and LongTag methods. Kind Kind // Style allows customizing the apperance of the node in the tree. Style Style // Tag holds the YAML tag defining the data type for the value. // When decoding, this field will always be set to the resolved tag, // even when it wasn't explicitly provided in the YAML content. // When encoding, if this field is unset the value type will be // implied from the node properties, and if it is set, it will only // be serialized into the representation if TaggedStyle is used or // the implicit tag diverges from the provided one. Tag string // Value holds the unescaped and unquoted represenation of the value. Value string // Anchor holds the anchor name for this node, which allows aliases to point to it. Anchor string // Alias holds the node that this alias points to. Only valid when Kind is AliasNode. Alias *Node // Content holds contained nodes for documents, mappings, and sequences. Content []*Node // HeadComment holds any comments in the lines preceding the node and // not separated by an empty line. HeadComment string // LineComment holds any comments at the end of the line where the node is in. LineComment string // FootComment holds any comments following the node and before empty lines. FootComment string // Line and Column hold the node position in the decoded YAML text. // These fields are not respected when encoding the node. Line int Column int } // IsZero returns whether the node has all of its fields unset. func (n *Node) IsZero() bool { return n.Kind == 0 && n.Style == 0 && n.Tag == "" && n.Value == "" && n.Anchor == "" && n.Alias == nil && n.Content == nil && n.HeadComment == "" && n.LineComment == "" && n.FootComment == "" && n.Line == 0 && n.Column == 0 } // LongTag returns the long form of the tag that indicates the data type for // the node. If the Tag field isn't explicitly defined, one will be computed // based on the node properties. func (n *Node) LongTag() string { return longTag(n.ShortTag()) } // ShortTag returns the short form of the YAML tag that indicates data type for // the node. If the Tag field isn't explicitly defined, one will be computed // based on the node properties. func (n *Node) ShortTag() string { if n.indicatedString() { return strTag } if n.Tag == "" || n.Tag == "!" { switch n.Kind { case MappingNode: return mapTag case SequenceNode: return seqTag case AliasNode: if n.Alias != nil { return n.Alias.ShortTag() } case ScalarNode: tag, _ := resolve("", n.Value) return tag case 0: // Special case to make the zero value convenient. if n.IsZero() { return nullTag } } return "" } return shortTag(n.Tag) } func (n *Node) indicatedString() bool { return n.Kind == ScalarNode && (shortTag(n.Tag) == strTag || (n.Tag == "" || n.Tag == "!") && n.Style&(SingleQuotedStyle|DoubleQuotedStyle|LiteralStyle|FoldedStyle) != 0) } // SetString is a convenience function that sets the node to a string value // and defines its style in a pleasant way depending on its content. func (n *Node) SetString(s string) { n.Kind = ScalarNode if utf8.ValidString(s) { n.Value = s n.Tag = strTag } else { n.Value = encodeBase64(s) n.Tag = binaryTag } if strings.Contains(n.Value, "\n") { n.Style = LiteralStyle } } // -------------------------------------------------------------------------- // Maintain a mapping of keys to structure field indexes // The code in this section was copied from mgo/bson. // structInfo holds details for the serialization of fields of // a given struct. type structInfo struct { FieldsMap map[string]fieldInfo FieldsList []fieldInfo // InlineMap is the number of the field in the struct that // contains an ,inline map, or -1 if there's none. InlineMap int // InlineUnmarshalers holds indexes to inlined fields that // contain unmarshaler values. InlineUnmarshalers [][]int } type fieldInfo struct { Key string Num int OmitEmpty bool Flow bool // Id holds the unique field identifier, so we can cheaply // check for field duplicates without maintaining an extra map. Id int // Inline holds the field index if the field is part of an inlined struct. Inline []int } var structMap = make(map[reflect.Type]*structInfo) var fieldMapMutex sync.RWMutex var unmarshalerType reflect.Type func init() { var v Unmarshaler unmarshalerType = reflect.ValueOf(&v).Elem().Type() } func getStructInfo(st reflect.Type) (*structInfo, error) { fieldMapMutex.RLock() sinfo, found := structMap[st] fieldMapMutex.RUnlock() if found { return sinfo, nil } n := st.NumField() fieldsMap := make(map[string]fieldInfo) fieldsList := make([]fieldInfo, 0, n) inlineMap := -1 inlineUnmarshalers := [][]int(nil) for i := 0; i != n; i++ { field := st.Field(i) if field.PkgPath != "" && !field.Anonymous { continue // Private field } info := fieldInfo{Num: i} tag := field.Tag.Get("yaml") if tag == "" && strings.Index(string(field.Tag), ":") < 0 { tag = string(field.Tag) } if tag == "-" { continue } inline := false fields := strings.Split(tag, ",") if len(fields) > 1 { for _, flag := range fields[1:] { switch flag { case "omitempty": info.OmitEmpty = true case "flow": info.Flow = true case "inline": inline = true default: return nil, errors.New(fmt.Sprintf("unsupported flag %q in tag %q of type %s", flag, tag, st)) } } tag = fields[0] } if inline { switch field.Type.Kind() { case reflect.Map: if inlineMap >= 0 { return nil, errors.New("multiple ,inline maps in struct " + st.String()) } if field.Type.Key() != reflect.TypeOf("") { return nil, errors.New("option ,inline needs a map with string keys in struct " + st.String()) } inlineMap = info.Num case reflect.Struct, reflect.Ptr: ftype := field.Type for ftype.Kind() == reflect.Ptr { ftype = ftype.Elem() } if ftype.Kind() != reflect.Struct { return nil, errors.New("option ,inline may only be used on a struct or map field") } if reflect.PtrTo(ftype).Implements(unmarshalerType) { inlineUnmarshalers = append(inlineUnmarshalers, []int{i}) } else { sinfo, err := getStructInfo(ftype) if err != nil { return nil, err } for _, index := range sinfo.InlineUnmarshalers { inlineUnmarshalers = append(inlineUnmarshalers, append([]int{i}, index...)) } for _, finfo := range sinfo.FieldsList { if _, found := fieldsMap[finfo.Key]; found { msg := "duplicated key '" + finfo.Key + "' in struct " + st.String() return nil, errors.New(msg) } if finfo.Inline == nil { finfo.Inline = []int{i, finfo.Num} } else { finfo.Inline = append([]int{i}, finfo.Inline...) } finfo.Id = len(fieldsList) fieldsMap[finfo.Key] = finfo fieldsList = append(fieldsList, finfo) } } default: return nil, errors.New("option ,inline may only be used on a struct or map field") } continue } if tag != "" { info.Key = tag } else { info.Key = strings.ToLower(field.Name) } if _, found = fieldsMap[info.Key]; found { msg := "duplicated key '" + info.Key + "' in struct " + st.String() return nil, errors.New(msg) } info.Id = len(fieldsList) fieldsList = append(fieldsList, info) fieldsMap[info.Key] = info } sinfo = &structInfo{ FieldsMap: fieldsMap, FieldsList: fieldsList, InlineMap: inlineMap, InlineUnmarshalers: inlineUnmarshalers, } fieldMapMutex.Lock() structMap[st] = sinfo fieldMapMutex.Unlock() return sinfo, nil } // IsZeroer is used to check whether an object is zero to // determine whether it should be omitted when marshaling // with the omitempty flag. One notable implementation // is time.Time. type IsZeroer interface { IsZero() bool } func isZero(v reflect.Value) bool { kind := v.Kind() if z, ok := v.Interface().(IsZeroer); ok { if (kind == reflect.Ptr || kind == reflect.Interface) && v.IsNil() { return true } return z.IsZero() } switch kind { case reflect.String: return len(v.String()) == 0 case reflect.Interface, reflect.Ptr: return v.IsNil() case reflect.Slice: return v.Len() == 0 case reflect.Map: return v.Len() == 0 case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: return v.Int() == 0 case reflect.Float32, reflect.Float64: return v.Float() == 0 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: return v.Uint() == 0 case reflect.Bool: return !v.Bool() case reflect.Struct: vt := v.Type() for i := v.NumField() - 1; i >= 0; i-- { if vt.Field(i).PkgPath != "" { continue // Private field } if !isZero(v.Field(i)) { return false } } return true } return false } ================================================ FILE: vendor/gopkg.in/yaml.v3/yamlh.go ================================================ // // Copyright (c) 2011-2019 Canonical Ltd // Copyright (c) 2006-2010 Kirill Simonov // // Permission is hereby granted, free of charge, to any person obtaining a copy of // this software and associated documentation files (the "Software"), to deal in // the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies // of the Software, and to permit persons to whom the Software is furnished to do // so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. package yaml import ( "fmt" "io" ) // The version directive data. type yaml_version_directive_t struct { major int8 // The major version number. minor int8 // The minor version number. } // The tag directive data. type yaml_tag_directive_t struct { handle []byte // The tag handle. prefix []byte // The tag prefix. } type yaml_encoding_t int // The stream encoding. const ( // Let the parser choose the encoding. yaml_ANY_ENCODING yaml_encoding_t = iota yaml_UTF8_ENCODING // The default UTF-8 encoding. yaml_UTF16LE_ENCODING // The UTF-16-LE encoding with BOM. yaml_UTF16BE_ENCODING // The UTF-16-BE encoding with BOM. ) type yaml_break_t int // Line break types. const ( // Let the parser choose the break type. yaml_ANY_BREAK yaml_break_t = iota yaml_CR_BREAK // Use CR for line breaks (Mac style). yaml_LN_BREAK // Use LN for line breaks (Unix style). yaml_CRLN_BREAK // Use CR LN for line breaks (DOS style). ) type yaml_error_type_t int // Many bad things could happen with the parser and emitter. const ( // No error is produced. yaml_NO_ERROR yaml_error_type_t = iota yaml_MEMORY_ERROR // Cannot allocate or reallocate a block of memory. yaml_READER_ERROR // Cannot read or decode the input stream. yaml_SCANNER_ERROR // Cannot scan the input stream. yaml_PARSER_ERROR // Cannot parse the input stream. yaml_COMPOSER_ERROR // Cannot compose a YAML document. yaml_WRITER_ERROR // Cannot write to the output stream. yaml_EMITTER_ERROR // Cannot emit a YAML stream. ) // The pointer position. type yaml_mark_t struct { index int // The position index. line int // The position line. column int // The position column. } // Node Styles type yaml_style_t int8 type yaml_scalar_style_t yaml_style_t // Scalar styles. const ( // Let the emitter choose the style. yaml_ANY_SCALAR_STYLE yaml_scalar_style_t = 0 yaml_PLAIN_SCALAR_STYLE yaml_scalar_style_t = 1 << iota // The plain scalar style. yaml_SINGLE_QUOTED_SCALAR_STYLE // The single-quoted scalar style. yaml_DOUBLE_QUOTED_SCALAR_STYLE // The double-quoted scalar style. yaml_LITERAL_SCALAR_STYLE // The literal scalar style. yaml_FOLDED_SCALAR_STYLE // The folded scalar style. ) type yaml_sequence_style_t yaml_style_t // Sequence styles. const ( // Let the emitter choose the style. yaml_ANY_SEQUENCE_STYLE yaml_sequence_style_t = iota yaml_BLOCK_SEQUENCE_STYLE // The block sequence style. yaml_FLOW_SEQUENCE_STYLE // The flow sequence style. ) type yaml_mapping_style_t yaml_style_t // Mapping styles. const ( // Let the emitter choose the style. yaml_ANY_MAPPING_STYLE yaml_mapping_style_t = iota yaml_BLOCK_MAPPING_STYLE // The block mapping style. yaml_FLOW_MAPPING_STYLE // The flow mapping style. ) // Tokens type yaml_token_type_t int // Token types. const ( // An empty token. yaml_NO_TOKEN yaml_token_type_t = iota yaml_STREAM_START_TOKEN // A STREAM-START token. yaml_STREAM_END_TOKEN // A STREAM-END token. yaml_VERSION_DIRECTIVE_TOKEN // A VERSION-DIRECTIVE token. yaml_TAG_DIRECTIVE_TOKEN // A TAG-DIRECTIVE token. yaml_DOCUMENT_START_TOKEN // A DOCUMENT-START token. yaml_DOCUMENT_END_TOKEN // A DOCUMENT-END token. yaml_BLOCK_SEQUENCE_START_TOKEN // A BLOCK-SEQUENCE-START token. yaml_BLOCK_MAPPING_START_TOKEN // A BLOCK-SEQUENCE-END token. yaml_BLOCK_END_TOKEN // A BLOCK-END token. yaml_FLOW_SEQUENCE_START_TOKEN // A FLOW-SEQUENCE-START token. yaml_FLOW_SEQUENCE_END_TOKEN // A FLOW-SEQUENCE-END token. yaml_FLOW_MAPPING_START_TOKEN // A FLOW-MAPPING-START token. yaml_FLOW_MAPPING_END_TOKEN // A FLOW-MAPPING-END token. yaml_BLOCK_ENTRY_TOKEN // A BLOCK-ENTRY token. yaml_FLOW_ENTRY_TOKEN // A FLOW-ENTRY token. yaml_KEY_TOKEN // A KEY token. yaml_VALUE_TOKEN // A VALUE token. yaml_ALIAS_TOKEN // An ALIAS token. yaml_ANCHOR_TOKEN // An ANCHOR token. yaml_TAG_TOKEN // A TAG token. yaml_SCALAR_TOKEN // A SCALAR token. ) func (tt yaml_token_type_t) String() string { switch tt { case yaml_NO_TOKEN: return "yaml_NO_TOKEN" case yaml_STREAM_START_TOKEN: return "yaml_STREAM_START_TOKEN" case yaml_STREAM_END_TOKEN: return "yaml_STREAM_END_TOKEN" case yaml_VERSION_DIRECTIVE_TOKEN: return "yaml_VERSION_DIRECTIVE_TOKEN" case yaml_TAG_DIRECTIVE_TOKEN: return "yaml_TAG_DIRECTIVE_TOKEN" case yaml_DOCUMENT_START_TOKEN: return "yaml_DOCUMENT_START_TOKEN" case yaml_DOCUMENT_END_TOKEN: return "yaml_DOCUMENT_END_TOKEN" case yaml_BLOCK_SEQUENCE_START_TOKEN: return "yaml_BLOCK_SEQUENCE_START_TOKEN" case yaml_BLOCK_MAPPING_START_TOKEN: return "yaml_BLOCK_MAPPING_START_TOKEN" case yaml_BLOCK_END_TOKEN: return "yaml_BLOCK_END_TOKEN" case yaml_FLOW_SEQUENCE_START_TOKEN: return "yaml_FLOW_SEQUENCE_START_TOKEN" case yaml_FLOW_SEQUENCE_END_TOKEN: return "yaml_FLOW_SEQUENCE_END_TOKEN" case yaml_FLOW_MAPPING_START_TOKEN: return "yaml_FLOW_MAPPING_START_TOKEN" case yaml_FLOW_MAPPING_END_TOKEN: return "yaml_FLOW_MAPPING_END_TOKEN" case yaml_BLOCK_ENTRY_TOKEN: return "yaml_BLOCK_ENTRY_TOKEN" case yaml_FLOW_ENTRY_TOKEN: return "yaml_FLOW_ENTRY_TOKEN" case yaml_KEY_TOKEN: return "yaml_KEY_TOKEN" case yaml_VALUE_TOKEN: return "yaml_VALUE_TOKEN" case yaml_ALIAS_TOKEN: return "yaml_ALIAS_TOKEN" case yaml_ANCHOR_TOKEN: return "yaml_ANCHOR_TOKEN" case yaml_TAG_TOKEN: return "yaml_TAG_TOKEN" case yaml_SCALAR_TOKEN: return "yaml_SCALAR_TOKEN" } return "" } // The token structure. type yaml_token_t struct { // The token type. typ yaml_token_type_t // The start/end of the token. start_mark, end_mark yaml_mark_t // The stream encoding (for yaml_STREAM_START_TOKEN). encoding yaml_encoding_t // The alias/anchor/scalar value or tag/tag directive handle // (for yaml_ALIAS_TOKEN, yaml_ANCHOR_TOKEN, yaml_SCALAR_TOKEN, yaml_TAG_TOKEN, yaml_TAG_DIRECTIVE_TOKEN). value []byte // The tag suffix (for yaml_TAG_TOKEN). suffix []byte // The tag directive prefix (for yaml_TAG_DIRECTIVE_TOKEN). prefix []byte // The scalar style (for yaml_SCALAR_TOKEN). style yaml_scalar_style_t // The version directive major/minor (for yaml_VERSION_DIRECTIVE_TOKEN). major, minor int8 } // Events type yaml_event_type_t int8 // Event types. const ( // An empty event. yaml_NO_EVENT yaml_event_type_t = iota yaml_STREAM_START_EVENT // A STREAM-START event. yaml_STREAM_END_EVENT // A STREAM-END event. yaml_DOCUMENT_START_EVENT // A DOCUMENT-START event. yaml_DOCUMENT_END_EVENT // A DOCUMENT-END event. yaml_ALIAS_EVENT // An ALIAS event. yaml_SCALAR_EVENT // A SCALAR event. yaml_SEQUENCE_START_EVENT // A SEQUENCE-START event. yaml_SEQUENCE_END_EVENT // A SEQUENCE-END event. yaml_MAPPING_START_EVENT // A MAPPING-START event. yaml_MAPPING_END_EVENT // A MAPPING-END event. yaml_TAIL_COMMENT_EVENT ) var eventStrings = []string{ yaml_NO_EVENT: "none", yaml_STREAM_START_EVENT: "stream start", yaml_STREAM_END_EVENT: "stream end", yaml_DOCUMENT_START_EVENT: "document start", yaml_DOCUMENT_END_EVENT: "document end", yaml_ALIAS_EVENT: "alias", yaml_SCALAR_EVENT: "scalar", yaml_SEQUENCE_START_EVENT: "sequence start", yaml_SEQUENCE_END_EVENT: "sequence end", yaml_MAPPING_START_EVENT: "mapping start", yaml_MAPPING_END_EVENT: "mapping end", yaml_TAIL_COMMENT_EVENT: "tail comment", } func (e yaml_event_type_t) String() string { if e < 0 || int(e) >= len(eventStrings) { return fmt.Sprintf("unknown event %d", e) } return eventStrings[e] } // The event structure. type yaml_event_t struct { // The event type. typ yaml_event_type_t // The start and end of the event. start_mark, end_mark yaml_mark_t // The document encoding (for yaml_STREAM_START_EVENT). encoding yaml_encoding_t // The version directive (for yaml_DOCUMENT_START_EVENT). version_directive *yaml_version_directive_t // The list of tag directives (for yaml_DOCUMENT_START_EVENT). tag_directives []yaml_tag_directive_t // The comments head_comment []byte line_comment []byte foot_comment []byte tail_comment []byte // The anchor (for yaml_SCALAR_EVENT, yaml_SEQUENCE_START_EVENT, yaml_MAPPING_START_EVENT, yaml_ALIAS_EVENT). anchor []byte // The tag (for yaml_SCALAR_EVENT, yaml_SEQUENCE_START_EVENT, yaml_MAPPING_START_EVENT). tag []byte // The scalar value (for yaml_SCALAR_EVENT). value []byte // Is the document start/end indicator implicit, or the tag optional? // (for yaml_DOCUMENT_START_EVENT, yaml_DOCUMENT_END_EVENT, yaml_SEQUENCE_START_EVENT, yaml_MAPPING_START_EVENT, yaml_SCALAR_EVENT). implicit bool // Is the tag optional for any non-plain style? (for yaml_SCALAR_EVENT). quoted_implicit bool // The style (for yaml_SCALAR_EVENT, yaml_SEQUENCE_START_EVENT, yaml_MAPPING_START_EVENT). style yaml_style_t } func (e *yaml_event_t) scalar_style() yaml_scalar_style_t { return yaml_scalar_style_t(e.style) } func (e *yaml_event_t) sequence_style() yaml_sequence_style_t { return yaml_sequence_style_t(e.style) } func (e *yaml_event_t) mapping_style() yaml_mapping_style_t { return yaml_mapping_style_t(e.style) } // Nodes const ( yaml_NULL_TAG = "tag:yaml.org,2002:null" // The tag !!null with the only possible value: null. yaml_BOOL_TAG = "tag:yaml.org,2002:bool" // The tag !!bool with the values: true and false. yaml_STR_TAG = "tag:yaml.org,2002:str" // The tag !!str for string values. yaml_INT_TAG = "tag:yaml.org,2002:int" // The tag !!int for integer values. yaml_FLOAT_TAG = "tag:yaml.org,2002:float" // The tag !!float for float values. yaml_TIMESTAMP_TAG = "tag:yaml.org,2002:timestamp" // The tag !!timestamp for date and time values. yaml_SEQ_TAG = "tag:yaml.org,2002:seq" // The tag !!seq is used to denote sequences. yaml_MAP_TAG = "tag:yaml.org,2002:map" // The tag !!map is used to denote mapping. // Not in original libyaml. yaml_BINARY_TAG = "tag:yaml.org,2002:binary" yaml_MERGE_TAG = "tag:yaml.org,2002:merge" yaml_DEFAULT_SCALAR_TAG = yaml_STR_TAG // The default scalar tag is !!str. yaml_DEFAULT_SEQUENCE_TAG = yaml_SEQ_TAG // The default sequence tag is !!seq. yaml_DEFAULT_MAPPING_TAG = yaml_MAP_TAG // The default mapping tag is !!map. ) type yaml_node_type_t int // Node types. const ( // An empty node. yaml_NO_NODE yaml_node_type_t = iota yaml_SCALAR_NODE // A scalar node. yaml_SEQUENCE_NODE // A sequence node. yaml_MAPPING_NODE // A mapping node. ) // An element of a sequence node. type yaml_node_item_t int // An element of a mapping node. type yaml_node_pair_t struct { key int // The key of the element. value int // The value of the element. } // The node structure. type yaml_node_t struct { typ yaml_node_type_t // The node type. tag []byte // The node tag. // The node data. // The scalar parameters (for yaml_SCALAR_NODE). scalar struct { value []byte // The scalar value. length int // The length of the scalar value. style yaml_scalar_style_t // The scalar style. } // The sequence parameters (for YAML_SEQUENCE_NODE). sequence struct { items_data []yaml_node_item_t // The stack of sequence items. style yaml_sequence_style_t // The sequence style. } // The mapping parameters (for yaml_MAPPING_NODE). mapping struct { pairs_data []yaml_node_pair_t // The stack of mapping pairs (key, value). pairs_start *yaml_node_pair_t // The beginning of the stack. pairs_end *yaml_node_pair_t // The end of the stack. pairs_top *yaml_node_pair_t // The top of the stack. style yaml_mapping_style_t // The mapping style. } start_mark yaml_mark_t // The beginning of the node. end_mark yaml_mark_t // The end of the node. } // The document structure. type yaml_document_t struct { // The document nodes. nodes []yaml_node_t // The version directive. version_directive *yaml_version_directive_t // The list of tag directives. tag_directives_data []yaml_tag_directive_t tag_directives_start int // The beginning of the tag directives list. tag_directives_end int // The end of the tag directives list. start_implicit int // Is the document start indicator implicit? end_implicit int // Is the document end indicator implicit? // The start/end of the document. start_mark, end_mark yaml_mark_t } // The prototype of a read handler. // // The read handler is called when the parser needs to read more bytes from the // source. The handler should write not more than size bytes to the buffer. // The number of written bytes should be set to the size_read variable. // // [in,out] data A pointer to an application data specified by // yaml_parser_set_input(). // [out] buffer The buffer to write the data from the source. // [in] size The size of the buffer. // [out] size_read The actual number of bytes read from the source. // // On success, the handler should return 1. If the handler failed, // the returned value should be 0. On EOF, the handler should set the // size_read to 0 and return 1. type yaml_read_handler_t func(parser *yaml_parser_t, buffer []byte) (n int, err error) // This structure holds information about a potential simple key. type yaml_simple_key_t struct { possible bool // Is a simple key possible? required bool // Is a simple key required? token_number int // The number of the token. mark yaml_mark_t // The position mark. } // The states of the parser. type yaml_parser_state_t int const ( yaml_PARSE_STREAM_START_STATE yaml_parser_state_t = iota yaml_PARSE_IMPLICIT_DOCUMENT_START_STATE // Expect the beginning of an implicit document. yaml_PARSE_DOCUMENT_START_STATE // Expect DOCUMENT-START. yaml_PARSE_DOCUMENT_CONTENT_STATE // Expect the content of a document. yaml_PARSE_DOCUMENT_END_STATE // Expect DOCUMENT-END. yaml_PARSE_BLOCK_NODE_STATE // Expect a block node. yaml_PARSE_BLOCK_NODE_OR_INDENTLESS_SEQUENCE_STATE // Expect a block node or indentless sequence. yaml_PARSE_FLOW_NODE_STATE // Expect a flow node. yaml_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE // Expect the first entry of a block sequence. yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE // Expect an entry of a block sequence. yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE // Expect an entry of an indentless sequence. yaml_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE // Expect the first key of a block mapping. yaml_PARSE_BLOCK_MAPPING_KEY_STATE // Expect a block mapping key. yaml_PARSE_BLOCK_MAPPING_VALUE_STATE // Expect a block mapping value. yaml_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE // Expect the first entry of a flow sequence. yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE // Expect an entry of a flow sequence. yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE // Expect a key of an ordered mapping. yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE // Expect a value of an ordered mapping. yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE // Expect the and of an ordered mapping entry. yaml_PARSE_FLOW_MAPPING_FIRST_KEY_STATE // Expect the first key of a flow mapping. yaml_PARSE_FLOW_MAPPING_KEY_STATE // Expect a key of a flow mapping. yaml_PARSE_FLOW_MAPPING_VALUE_STATE // Expect a value of a flow mapping. yaml_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE // Expect an empty value of a flow mapping. yaml_PARSE_END_STATE // Expect nothing. ) func (ps yaml_parser_state_t) String() string { switch ps { case yaml_PARSE_STREAM_START_STATE: return "yaml_PARSE_STREAM_START_STATE" case yaml_PARSE_IMPLICIT_DOCUMENT_START_STATE: return "yaml_PARSE_IMPLICIT_DOCUMENT_START_STATE" case yaml_PARSE_DOCUMENT_START_STATE: return "yaml_PARSE_DOCUMENT_START_STATE" case yaml_PARSE_DOCUMENT_CONTENT_STATE: return "yaml_PARSE_DOCUMENT_CONTENT_STATE" case yaml_PARSE_DOCUMENT_END_STATE: return "yaml_PARSE_DOCUMENT_END_STATE" case yaml_PARSE_BLOCK_NODE_STATE: return "yaml_PARSE_BLOCK_NODE_STATE" case yaml_PARSE_BLOCK_NODE_OR_INDENTLESS_SEQUENCE_STATE: return "yaml_PARSE_BLOCK_NODE_OR_INDENTLESS_SEQUENCE_STATE" case yaml_PARSE_FLOW_NODE_STATE: return "yaml_PARSE_FLOW_NODE_STATE" case yaml_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE: return "yaml_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE" case yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE: return "yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE" case yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE: return "yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE" case yaml_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE: return "yaml_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE" case yaml_PARSE_BLOCK_MAPPING_KEY_STATE: return "yaml_PARSE_BLOCK_MAPPING_KEY_STATE" case yaml_PARSE_BLOCK_MAPPING_VALUE_STATE: return "yaml_PARSE_BLOCK_MAPPING_VALUE_STATE" case yaml_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE: return "yaml_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE" case yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE: return "yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE" case yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE: return "yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE" case yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE: return "yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE" case yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE: return "yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE" case yaml_PARSE_FLOW_MAPPING_FIRST_KEY_STATE: return "yaml_PARSE_FLOW_MAPPING_FIRST_KEY_STATE" case yaml_PARSE_FLOW_MAPPING_KEY_STATE: return "yaml_PARSE_FLOW_MAPPING_KEY_STATE" case yaml_PARSE_FLOW_MAPPING_VALUE_STATE: return "yaml_PARSE_FLOW_MAPPING_VALUE_STATE" case yaml_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE: return "yaml_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE" case yaml_PARSE_END_STATE: return "yaml_PARSE_END_STATE" } return "" } // This structure holds aliases data. type yaml_alias_data_t struct { anchor []byte // The anchor. index int // The node id. mark yaml_mark_t // The anchor mark. } // The parser structure. // // All members are internal. Manage the structure using the // yaml_parser_ family of functions. type yaml_parser_t struct { // Error handling error yaml_error_type_t // Error type. problem string // Error description. // The byte about which the problem occurred. problem_offset int problem_value int problem_mark yaml_mark_t // The error context. context string context_mark yaml_mark_t // Reader stuff read_handler yaml_read_handler_t // Read handler. input_reader io.Reader // File input data. input []byte // String input data. input_pos int eof bool // EOF flag buffer []byte // The working buffer. buffer_pos int // The current position of the buffer. unread int // The number of unread characters in the buffer. newlines int // The number of line breaks since last non-break/non-blank character raw_buffer []byte // The raw buffer. raw_buffer_pos int // The current position of the buffer. encoding yaml_encoding_t // The input encoding. offset int // The offset of the current position (in bytes). mark yaml_mark_t // The mark of the current position. // Comments head_comment []byte // The current head comments line_comment []byte // The current line comments foot_comment []byte // The current foot comments tail_comment []byte // Foot comment that happens at the end of a block. stem_comment []byte // Comment in item preceding a nested structure (list inside list item, etc) comments []yaml_comment_t // The folded comments for all parsed tokens comments_head int // Scanner stuff stream_start_produced bool // Have we started to scan the input stream? stream_end_produced bool // Have we reached the end of the input stream? flow_level int // The number of unclosed '[' and '{' indicators. tokens []yaml_token_t // The tokens queue. tokens_head int // The head of the tokens queue. tokens_parsed int // The number of tokens fetched from the queue. token_available bool // Does the tokens queue contain a token ready for dequeueing. indent int // The current indentation level. indents []int // The indentation levels stack. simple_key_allowed bool // May a simple key occur at the current position? simple_keys []yaml_simple_key_t // The stack of simple keys. simple_keys_by_tok map[int]int // possible simple_key indexes indexed by token_number // Parser stuff state yaml_parser_state_t // The current parser state. states []yaml_parser_state_t // The parser states stack. marks []yaml_mark_t // The stack of marks. tag_directives []yaml_tag_directive_t // The list of TAG directives. // Dumper stuff aliases []yaml_alias_data_t // The alias data. document *yaml_document_t // The currently parsed document. } type yaml_comment_t struct { scan_mark yaml_mark_t // Position where scanning for comments started token_mark yaml_mark_t // Position after which tokens will be associated with this comment start_mark yaml_mark_t // Position of '#' comment mark end_mark yaml_mark_t // Position where comment terminated head []byte line []byte foot []byte } // Emitter Definitions // The prototype of a write handler. // // The write handler is called when the emitter needs to flush the accumulated // characters to the output. The handler should write @a size bytes of the // @a buffer to the output. // // @param[in,out] data A pointer to an application data specified by // yaml_emitter_set_output(). // @param[in] buffer The buffer with bytes to be written. // @param[in] size The size of the buffer. // // @returns On success, the handler should return @c 1. If the handler failed, // the returned value should be @c 0. // type yaml_write_handler_t func(emitter *yaml_emitter_t, buffer []byte) error type yaml_emitter_state_t int // The emitter states. const ( // Expect STREAM-START. yaml_EMIT_STREAM_START_STATE yaml_emitter_state_t = iota yaml_EMIT_FIRST_DOCUMENT_START_STATE // Expect the first DOCUMENT-START or STREAM-END. yaml_EMIT_DOCUMENT_START_STATE // Expect DOCUMENT-START or STREAM-END. yaml_EMIT_DOCUMENT_CONTENT_STATE // Expect the content of a document. yaml_EMIT_DOCUMENT_END_STATE // Expect DOCUMENT-END. yaml_EMIT_FLOW_SEQUENCE_FIRST_ITEM_STATE // Expect the first item of a flow sequence. yaml_EMIT_FLOW_SEQUENCE_TRAIL_ITEM_STATE // Expect the next item of a flow sequence, with the comma already written out yaml_EMIT_FLOW_SEQUENCE_ITEM_STATE // Expect an item of a flow sequence. yaml_EMIT_FLOW_MAPPING_FIRST_KEY_STATE // Expect the first key of a flow mapping. yaml_EMIT_FLOW_MAPPING_TRAIL_KEY_STATE // Expect the next key of a flow mapping, with the comma already written out yaml_EMIT_FLOW_MAPPING_KEY_STATE // Expect a key of a flow mapping. yaml_EMIT_FLOW_MAPPING_SIMPLE_VALUE_STATE // Expect a value for a simple key of a flow mapping. yaml_EMIT_FLOW_MAPPING_VALUE_STATE // Expect a value of a flow mapping. yaml_EMIT_BLOCK_SEQUENCE_FIRST_ITEM_STATE // Expect the first item of a block sequence. yaml_EMIT_BLOCK_SEQUENCE_ITEM_STATE // Expect an item of a block sequence. yaml_EMIT_BLOCK_MAPPING_FIRST_KEY_STATE // Expect the first key of a block mapping. yaml_EMIT_BLOCK_MAPPING_KEY_STATE // Expect the key of a block mapping. yaml_EMIT_BLOCK_MAPPING_SIMPLE_VALUE_STATE // Expect a value for a simple key of a block mapping. yaml_EMIT_BLOCK_MAPPING_VALUE_STATE // Expect a value of a block mapping. yaml_EMIT_END_STATE // Expect nothing. ) // The emitter structure. // // All members are internal. Manage the structure using the @c yaml_emitter_ // family of functions. type yaml_emitter_t struct { // Error handling error yaml_error_type_t // Error type. problem string // Error description. // Writer stuff write_handler yaml_write_handler_t // Write handler. output_buffer *[]byte // String output data. output_writer io.Writer // File output data. buffer []byte // The working buffer. buffer_pos int // The current position of the buffer. raw_buffer []byte // The raw buffer. raw_buffer_pos int // The current position of the buffer. encoding yaml_encoding_t // The stream encoding. // Emitter stuff canonical bool // If the output is in the canonical style? best_indent int // The number of indentation spaces. best_width int // The preferred width of the output lines. unicode bool // Allow unescaped non-ASCII characters? line_break yaml_break_t // The preferred line break. state yaml_emitter_state_t // The current emitter state. states []yaml_emitter_state_t // The stack of states. events []yaml_event_t // The event queue. events_head int // The head of the event queue. indents []int // The stack of indentation levels. tag_directives []yaml_tag_directive_t // The list of tag directives. indent int // The current indentation level. flow_level int // The current flow level. root_context bool // Is it the document root context? sequence_context bool // Is it a sequence context? mapping_context bool // Is it a mapping context? simple_key_context bool // Is it a simple mapping key context? line int // The current line. column int // The current column. whitespace bool // If the last character was a whitespace? indention bool // If the last character was an indentation character (' ', '-', '?', ':')? open_ended bool // If an explicit document end is required? space_above bool // Is there's an empty line above? foot_indent int // The indent used to write the foot comment above, or -1 if none. // Anchor analysis. anchor_data struct { anchor []byte // The anchor value. alias bool // Is it an alias? } // Tag analysis. tag_data struct { handle []byte // The tag handle. suffix []byte // The tag suffix. } // Scalar analysis. scalar_data struct { value []byte // The scalar value. multiline bool // Does the scalar contain line breaks? flow_plain_allowed bool // Can the scalar be expessed in the flow plain style? block_plain_allowed bool // Can the scalar be expressed in the block plain style? single_quoted_allowed bool // Can the scalar be expressed in the single quoted style? block_allowed bool // Can the scalar be expressed in the literal or folded styles? style yaml_scalar_style_t // The output style. } // Comments head_comment []byte line_comment []byte foot_comment []byte tail_comment []byte key_line_comment []byte // Dumper stuff opened bool // If the stream was already opened? closed bool // If the stream was already closed? // The information associated with the document nodes. anchors *struct { references int // The number of references. anchor int // The anchor id. serialized bool // If the node has been emitted? } last_anchor_id int // The last assigned anchor id. document *yaml_document_t // The currently emitted document. } ================================================ FILE: vendor/gopkg.in/yaml.v3/yamlprivateh.go ================================================ // // Copyright (c) 2011-2019 Canonical Ltd // Copyright (c) 2006-2010 Kirill Simonov // // Permission is hereby granted, free of charge, to any person obtaining a copy of // this software and associated documentation files (the "Software"), to deal in // the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies // of the Software, and to permit persons to whom the Software is furnished to do // so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. package yaml const ( // The size of the input raw buffer. input_raw_buffer_size = 512 // The size of the input buffer. // It should be possible to decode the whole raw buffer. input_buffer_size = input_raw_buffer_size * 3 // The size of the output buffer. output_buffer_size = 128 // The size of the output raw buffer. // It should be possible to encode the whole output buffer. output_raw_buffer_size = (output_buffer_size*2 + 2) // The size of other stacks and queues. initial_stack_size = 16 initial_queue_size = 16 initial_string_size = 16 ) // Check if the character at the specified position is an alphabetical // character, a digit, '_', or '-'. func is_alpha(b []byte, i int) bool { return b[i] >= '0' && b[i] <= '9' || b[i] >= 'A' && b[i] <= 'Z' || b[i] >= 'a' && b[i] <= 'z' || b[i] == '_' || b[i] == '-' } // Check if the character at the specified position is a digit. func is_digit(b []byte, i int) bool { return b[i] >= '0' && b[i] <= '9' } // Get the value of a digit. func as_digit(b []byte, i int) int { return int(b[i]) - '0' } // Check if the character at the specified position is a hex-digit. func is_hex(b []byte, i int) bool { return b[i] >= '0' && b[i] <= '9' || b[i] >= 'A' && b[i] <= 'F' || b[i] >= 'a' && b[i] <= 'f' } // Get the value of a hex-digit. func as_hex(b []byte, i int) int { bi := b[i] if bi >= 'A' && bi <= 'F' { return int(bi) - 'A' + 10 } if bi >= 'a' && bi <= 'f' { return int(bi) - 'a' + 10 } return int(bi) - '0' } // Check if the character is ASCII. func is_ascii(b []byte, i int) bool { return b[i] <= 0x7F } // Check if the character at the start of the buffer can be printed unescaped. func is_printable(b []byte, i int) bool { return ((b[i] == 0x0A) || // . == #x0A (b[i] >= 0x20 && b[i] <= 0x7E) || // #x20 <= . <= #x7E (b[i] == 0xC2 && b[i+1] >= 0xA0) || // #0xA0 <= . <= #xD7FF (b[i] > 0xC2 && b[i] < 0xED) || (b[i] == 0xED && b[i+1] < 0xA0) || (b[i] == 0xEE) || (b[i] == 0xEF && // #xE000 <= . <= #xFFFD !(b[i+1] == 0xBB && b[i+2] == 0xBF) && // && . != #xFEFF !(b[i+1] == 0xBF && (b[i+2] == 0xBE || b[i+2] == 0xBF)))) } // Check if the character at the specified position is NUL. func is_z(b []byte, i int) bool { return b[i] == 0x00 } // Check if the beginning of the buffer is a BOM. func is_bom(b []byte, i int) bool { return b[0] == 0xEF && b[1] == 0xBB && b[2] == 0xBF } // Check if the character at the specified position is space. func is_space(b []byte, i int) bool { return b[i] == ' ' } // Check if the character at the specified position is tab. func is_tab(b []byte, i int) bool { return b[i] == '\t' } // Check if the character at the specified position is blank (space or tab). func is_blank(b []byte, i int) bool { //return is_space(b, i) || is_tab(b, i) return b[i] == ' ' || b[i] == '\t' } // Check if the character at the specified position is a line break. func is_break(b []byte, i int) bool { return (b[i] == '\r' || // CR (#xD) b[i] == '\n' || // LF (#xA) b[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85) b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028) b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9) // PS (#x2029) } func is_crlf(b []byte, i int) bool { return b[i] == '\r' && b[i+1] == '\n' } // Check if the character is a line break or NUL. func is_breakz(b []byte, i int) bool { //return is_break(b, i) || is_z(b, i) return ( // is_break: b[i] == '\r' || // CR (#xD) b[i] == '\n' || // LF (#xA) b[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85) b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028) b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9 || // PS (#x2029) // is_z: b[i] == 0) } // Check if the character is a line break, space, or NUL. func is_spacez(b []byte, i int) bool { //return is_space(b, i) || is_breakz(b, i) return ( // is_space: b[i] == ' ' || // is_breakz: b[i] == '\r' || // CR (#xD) b[i] == '\n' || // LF (#xA) b[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85) b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028) b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9 || // PS (#x2029) b[i] == 0) } // Check if the character is a line break, space, tab, or NUL. func is_blankz(b []byte, i int) bool { //return is_blank(b, i) || is_breakz(b, i) return ( // is_blank: b[i] == ' ' || b[i] == '\t' || // is_breakz: b[i] == '\r' || // CR (#xD) b[i] == '\n' || // LF (#xA) b[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85) b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028) b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9 || // PS (#x2029) b[i] == 0) } // Determine the width of the character. func width(b byte) int { // Don't replace these by a switch without first // confirming that it is being inlined. if b&0x80 == 0x00 { return 1 } if b&0xE0 == 0xC0 { return 2 } if b&0xF0 == 0xE0 { return 3 } if b&0xF8 == 0xF0 { return 4 } return 0 } ================================================ FILE: vendor/modules.txt ================================================ # cyphar.com/go-pathrs v0.2.4 ## explicit; go 1.18 cyphar.com/go-pathrs cyphar.com/go-pathrs/internal/fdutils cyphar.com/go-pathrs/internal/libpathrs cyphar.com/go-pathrs/procfs # dario.cat/mergo v1.0.2 ## explicit; go 1.13 dario.cat/mergo # github.com/BurntSushi/toml v1.6.0 ## explicit; go 1.18 github.com/BurntSushi/toml github.com/BurntSushi/toml/internal # github.com/Masterminds/semver/v3 v3.4.0 ## explicit; go 1.21 github.com/Masterminds/semver/v3 # github.com/Microsoft/go-winio v0.6.2 ## explicit; go 1.21 github.com/Microsoft/go-winio github.com/Microsoft/go-winio/internal/fs github.com/Microsoft/go-winio/internal/socket github.com/Microsoft/go-winio/internal/stringbuffer github.com/Microsoft/go-winio/pkg/guid # github.com/VividCortex/ewma v1.2.0 ## explicit; go 1.12 github.com/VividCortex/ewma # github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d ## explicit github.com/acarl005/stripansi # github.com/cespare/xxhash/v2 v2.3.0 ## explicit; go 1.11 github.com/cespare/xxhash/v2 # github.com/clipperhouse/uax29/v2 v2.7.0 ## explicit; go 1.18 github.com/clipperhouse/uax29/v2/graphemes # github.com/containerd/errdefs v1.0.0 ## explicit; go 1.20 github.com/containerd/errdefs # github.com/containerd/errdefs/pkg v0.3.0 ## explicit; go 1.22 github.com/containerd/errdefs/pkg/errhttp github.com/containerd/errdefs/pkg/internal/cause # github.com/containerd/stargz-snapshotter/estargz v0.18.2 ## explicit; go 1.24.0 github.com/containerd/stargz-snapshotter/estargz github.com/containerd/stargz-snapshotter/estargz/errorutil # github.com/containers/libtrust v0.0.0-20230121012942-c1716e8a8d01 ## explicit github.com/containers/libtrust # github.com/containers/ocicrypt v1.2.1 ## explicit; go 1.22 github.com/containers/ocicrypt github.com/containers/ocicrypt/blockcipher github.com/containers/ocicrypt/config github.com/containers/ocicrypt/config/keyprovider-config github.com/containers/ocicrypt/config/pkcs11config github.com/containers/ocicrypt/crypto/pkcs11 github.com/containers/ocicrypt/helpers github.com/containers/ocicrypt/keywrap github.com/containers/ocicrypt/keywrap/jwe github.com/containers/ocicrypt/keywrap/keyprovider github.com/containers/ocicrypt/keywrap/pgp github.com/containers/ocicrypt/keywrap/pkcs11 github.com/containers/ocicrypt/keywrap/pkcs7 github.com/containers/ocicrypt/spec github.com/containers/ocicrypt/utils github.com/containers/ocicrypt/utils/keyprovider # github.com/coreos/go-oidc/v3 v3.17.0 ## explicit; go 1.24.0 github.com/coreos/go-oidc/v3/oidc # github.com/cyberphone/json-canonicalization v0.0.0-20241213102144-19d51d7fe467 ## explicit github.com/cyberphone/json-canonicalization/go/src/webpki.org/jsoncanonicalizer # github.com/cyphar/filepath-securejoin v0.6.1 ## explicit; go 1.18 github.com/cyphar/filepath-securejoin github.com/cyphar/filepath-securejoin/internal/consts github.com/cyphar/filepath-securejoin/pathrs-lite github.com/cyphar/filepath-securejoin/pathrs-lite/internal github.com/cyphar/filepath-securejoin/pathrs-lite/internal/assert github.com/cyphar/filepath-securejoin/pathrs-lite/internal/fd github.com/cyphar/filepath-securejoin/pathrs-lite/internal/gocompat github.com/cyphar/filepath-securejoin/pathrs-lite/internal/gopathrs github.com/cyphar/filepath-securejoin/pathrs-lite/internal/kernelversion github.com/cyphar/filepath-securejoin/pathrs-lite/internal/linux github.com/cyphar/filepath-securejoin/pathrs-lite/internal/procfs github.com/cyphar/filepath-securejoin/pathrs-lite/procfs # github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc ## explicit github.com/davecgh/go-spew/spew # github.com/distribution/reference v0.6.0 ## explicit; go 1.20 github.com/distribution/reference # github.com/docker/distribution v2.8.3+incompatible ## explicit github.com/docker/distribution/registry/api/errcode github.com/docker/distribution/registry/api/v2 # github.com/docker/docker-credential-helpers v0.9.5 ## explicit; go 1.21 github.com/docker/docker-credential-helpers/client github.com/docker/docker-credential-helpers/credentials # github.com/docker/go-connections v0.6.0 ## explicit; go 1.18 github.com/docker/go-connections/sockets github.com/docker/go-connections/tlsconfig # github.com/docker/go-units v0.5.0 ## explicit github.com/docker/go-units # github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707 ## explicit; go 1.9 # github.com/felixge/httpsnoop v1.0.4 ## explicit; go 1.13 github.com/felixge/httpsnoop # github.com/go-jose/go-jose/v4 v4.1.3 ## explicit; go 1.24.0 github.com/go-jose/go-jose/v4 github.com/go-jose/go-jose/v4/cipher github.com/go-jose/go-jose/v4/json # github.com/go-logr/logr v1.4.3 ## explicit; go 1.18 github.com/go-logr/logr github.com/go-logr/logr/funcr # github.com/go-logr/stdr v1.2.2 ## explicit; go 1.16 github.com/go-logr/stdr # github.com/golang/protobuf v1.5.4 ## explicit; go 1.17 github.com/golang/protobuf/proto # github.com/google/go-containerregistry v0.20.7 ## explicit; go 1.24.0 github.com/google/go-containerregistry/pkg/name github.com/google/go-containerregistry/pkg/v1 github.com/google/go-containerregistry/pkg/v1/types # github.com/google/go-intervals v0.0.2 ## explicit; go 1.12 github.com/google/go-intervals/intervalset # github.com/google/uuid v1.6.0 ## explicit github.com/google/uuid # github.com/gorilla/mux v1.8.1 ## explicit; go 1.20 github.com/gorilla/mux # github.com/hashicorp/go-cleanhttp v0.5.2 ## explicit; go 1.13 github.com/hashicorp/go-cleanhttp # github.com/hashicorp/go-multierror v1.1.2-0.20250313123807-1ee6e1a1957a ## explicit; go 1.13 github.com/hashicorp/go-multierror # github.com/hashicorp/go-retryablehttp v0.7.8 ## explicit; go 1.23 github.com/hashicorp/go-retryablehttp # github.com/inconshreveable/mousetrap v1.1.0 ## explicit; go 1.18 github.com/inconshreveable/mousetrap # github.com/json-iterator/go v1.1.12 ## explicit; go 1.12 github.com/json-iterator/go # github.com/klauspost/compress v1.18.4 ## explicit; go 1.23 github.com/klauspost/compress github.com/klauspost/compress/flate github.com/klauspost/compress/fse github.com/klauspost/compress/huff0 github.com/klauspost/compress/internal/cpuinfo github.com/klauspost/compress/internal/le github.com/klauspost/compress/internal/snapref github.com/klauspost/compress/zstd github.com/klauspost/compress/zstd/internal/xxhash # github.com/klauspost/pgzip v1.2.6 ## explicit github.com/klauspost/pgzip # github.com/mattn/go-runewidth v0.0.20 ## explicit; go 1.20 github.com/mattn/go-runewidth # github.com/mattn/go-sqlite3 v1.14.34 ## explicit; go 1.19 github.com/mattn/go-sqlite3 # github.com/miekg/pkcs11 v1.1.1 ## explicit; go 1.12 github.com/miekg/pkcs11 # github.com/mistifyio/go-zfs/v4 v4.0.0 ## explicit; go 1.14 github.com/mistifyio/go-zfs/v4 # github.com/moby/docker-image-spec v1.3.1 ## explicit; go 1.18 github.com/moby/docker-image-spec/specs-go/v1 # github.com/moby/moby/api v1.54.0 ## explicit; go 1.24.0 github.com/moby/moby/api/types github.com/moby/moby/api/types/blkiodev github.com/moby/moby/api/types/build github.com/moby/moby/api/types/checkpoint github.com/moby/moby/api/types/common github.com/moby/moby/api/types/container github.com/moby/moby/api/types/events github.com/moby/moby/api/types/image github.com/moby/moby/api/types/jsonstream github.com/moby/moby/api/types/mount github.com/moby/moby/api/types/network github.com/moby/moby/api/types/plugin github.com/moby/moby/api/types/registry github.com/moby/moby/api/types/storage github.com/moby/moby/api/types/swarm github.com/moby/moby/api/types/system github.com/moby/moby/api/types/volume # github.com/moby/moby/client v0.3.0 ## explicit; go 1.24.0 github.com/moby/moby/client github.com/moby/moby/client/internal github.com/moby/moby/client/internal/timestamp github.com/moby/moby/client/pkg/versions # github.com/moby/sys/capability v0.4.0 ## explicit; go 1.21 github.com/moby/sys/capability # github.com/moby/sys/mountinfo v0.7.2 ## explicit; go 1.17 github.com/moby/sys/mountinfo # github.com/moby/sys/user v0.4.0 ## explicit; go 1.17 github.com/moby/sys/user # github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd ## explicit github.com/modern-go/concurrent # github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee ## explicit; go 1.12 github.com/modern-go/reflect2 # github.com/opencontainers/go-digest v1.0.0 ## explicit; go 1.13 github.com/opencontainers/go-digest # github.com/opencontainers/image-spec v1.1.2-0.20260226102121-a4c6ade7bb82 ## explicit; go 1.18 github.com/opencontainers/image-spec/specs-go github.com/opencontainers/image-spec/specs-go/v1 # github.com/opencontainers/image-spec/schema v0.0.0-20250717171153-ab80ff15c2dd ## explicit; go 1.21 github.com/opencontainers/image-spec/schema # github.com/opencontainers/image-tools v1.0.0-rc3 ## explicit github.com/opencontainers/image-tools/image # github.com/opencontainers/runtime-spec v1.3.0 ## explicit github.com/opencontainers/runtime-spec/specs-go # github.com/opencontainers/selinux v1.13.1 ## explicit; go 1.19 github.com/opencontainers/selinux/go-selinux github.com/opencontainers/selinux/go-selinux/label github.com/opencontainers/selinux/pkg/pwalkdir # github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c ## explicit; go 1.14 github.com/pkg/browser # github.com/pkg/errors v0.9.1 ## explicit github.com/pkg/errors # github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 ## explicit github.com/pmezard/go-difflib/difflib # github.com/proglottis/gpgme v0.1.6 ## explicit; go 1.17 github.com/proglottis/gpgme # github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 ## explicit; go 1.21 github.com/santhosh-tekuri/jsonschema/v6 github.com/santhosh-tekuri/jsonschema/v6/kind # github.com/secure-systems-lab/go-securesystemslib v0.10.0 ## explicit; go 1.24.0 github.com/secure-systems-lab/go-securesystemslib/encrypted # github.com/sigstore/fulcio v1.8.5 ## explicit; go 1.25.0 github.com/sigstore/fulcio/pkg/api github.com/sigstore/fulcio/pkg/certificate # github.com/sigstore/protobuf-specs v0.5.0 ## explicit; go 1.22.0 github.com/sigstore/protobuf-specs/gen/pb-go/common/v1 # github.com/sigstore/sigstore v1.10.4 ## explicit; go 1.25.0 github.com/sigstore/sigstore/pkg/cryptoutils github.com/sigstore/sigstore/pkg/oauth github.com/sigstore/sigstore/pkg/oauthflow github.com/sigstore/sigstore/pkg/signature github.com/sigstore/sigstore/pkg/signature/options github.com/sigstore/sigstore/pkg/signature/payload # github.com/sirupsen/logrus v1.9.4 ## explicit; go 1.17 github.com/sirupsen/logrus # github.com/smallstep/pkcs7 v0.1.1 ## explicit; go 1.14 github.com/smallstep/pkcs7 github.com/smallstep/pkcs7/internal/legacy/x509 # github.com/spf13/cobra v1.10.2 ## explicit; go 1.15 github.com/spf13/cobra # github.com/spf13/pflag v1.0.10 ## explicit; go 1.12 github.com/spf13/pflag # github.com/stefanberger/go-pkcs11uri v0.0.0-20230803200340-78284954bff6 ## explicit; go 1.19 github.com/stefanberger/go-pkcs11uri # github.com/stretchr/testify v1.11.1 ## explicit; go 1.17 github.com/stretchr/testify/assert github.com/stretchr/testify/assert/yaml github.com/stretchr/testify/require github.com/stretchr/testify/suite # github.com/sylabs/sif/v2 v2.22.0 ## explicit; go 1.24.0 github.com/sylabs/sif/v2/pkg/sif # github.com/tchap/go-patricia/v2 v2.3.3 ## explicit; go 1.16 github.com/tchap/go-patricia/v2/patricia # github.com/ulikunitz/xz v0.5.15 ## explicit; go 1.12 github.com/ulikunitz/xz github.com/ulikunitz/xz/internal/hash github.com/ulikunitz/xz/internal/xlog github.com/ulikunitz/xz/lzma # github.com/vbatts/tar-split v0.12.2 ## explicit; go 1.17 github.com/vbatts/tar-split/archive/tar github.com/vbatts/tar-split/tar/asm github.com/vbatts/tar-split/tar/storage # github.com/vbauerster/mpb/v8 v8.12.0 ## explicit; go 1.24.0 github.com/vbauerster/mpb/v8 github.com/vbauerster/mpb/v8/cwriter github.com/vbauerster/mpb/v8/decor github.com/vbauerster/mpb/v8/internal # go.opentelemetry.io/auto/sdk v1.2.1 ## explicit; go 1.24.0 go.opentelemetry.io/auto/sdk go.opentelemetry.io/auto/sdk/internal/telemetry # go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.65.0 ## explicit; go 1.24.0 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv # go.opentelemetry.io/otel v1.40.0 ## explicit; go 1.24.0 go.opentelemetry.io/otel go.opentelemetry.io/otel/attribute go.opentelemetry.io/otel/attribute/internal go.opentelemetry.io/otel/attribute/internal/xxhash go.opentelemetry.io/otel/baggage go.opentelemetry.io/otel/codes go.opentelemetry.io/otel/internal/baggage go.opentelemetry.io/otel/internal/global go.opentelemetry.io/otel/propagation go.opentelemetry.io/otel/semconv/v1.37.0 go.opentelemetry.io/otel/semconv/v1.39.0 go.opentelemetry.io/otel/semconv/v1.39.0/httpconv # go.opentelemetry.io/otel/metric v1.40.0 ## explicit; go 1.24.0 go.opentelemetry.io/otel/metric go.opentelemetry.io/otel/metric/embedded go.opentelemetry.io/otel/metric/noop # go.opentelemetry.io/otel/trace v1.40.0 ## explicit; go 1.24.0 go.opentelemetry.io/otel/trace go.opentelemetry.io/otel/trace/embedded go.opentelemetry.io/otel/trace/internal/telemetry go.opentelemetry.io/otel/trace/noop # go.podman.io/common v0.67.1-0.20260319154331-44a8de38c431 ## explicit; go 1.25.0 go.podman.io/common/pkg/auth go.podman.io/common/pkg/capabilities go.podman.io/common/pkg/completion go.podman.io/common/pkg/flag go.podman.io/common/pkg/json-proxy go.podman.io/common/pkg/password go.podman.io/common/pkg/report go.podman.io/common/pkg/report/camelcase go.podman.io/common/pkg/retry # go.podman.io/image/v5 v5.39.2-0.20260313202710-ddaabae34a06 ## explicit; go 1.25.0 go.podman.io/image/v5/copy go.podman.io/image/v5/directory go.podman.io/image/v5/directory/explicitfilepath go.podman.io/image/v5/docker go.podman.io/image/v5/docker/archive go.podman.io/image/v5/docker/daemon go.podman.io/image/v5/docker/internal/tarfile go.podman.io/image/v5/docker/policyconfiguration go.podman.io/image/v5/docker/reference go.podman.io/image/v5/image go.podman.io/image/v5/internal/blobinfocache go.podman.io/image/v5/internal/digests go.podman.io/image/v5/internal/image go.podman.io/image/v5/internal/imagedestination go.podman.io/image/v5/internal/imagedestination/impl go.podman.io/image/v5/internal/imagedestination/stubs go.podman.io/image/v5/internal/imagesource go.podman.io/image/v5/internal/imagesource/impl go.podman.io/image/v5/internal/imagesource/stubs go.podman.io/image/v5/internal/iolimits go.podman.io/image/v5/internal/manifest go.podman.io/image/v5/internal/multierr go.podman.io/image/v5/internal/pkg/platform go.podman.io/image/v5/internal/private go.podman.io/image/v5/internal/putblobdigest go.podman.io/image/v5/internal/rootless go.podman.io/image/v5/internal/set go.podman.io/image/v5/internal/signature go.podman.io/image/v5/internal/signer go.podman.io/image/v5/internal/streamdigest go.podman.io/image/v5/internal/tmpdir go.podman.io/image/v5/internal/unparsedimage go.podman.io/image/v5/internal/uploadreader go.podman.io/image/v5/internal/useragent go.podman.io/image/v5/manifest go.podman.io/image/v5/oci/archive go.podman.io/image/v5/oci/internal go.podman.io/image/v5/oci/layout go.podman.io/image/v5/openshift go.podman.io/image/v5/pkg/blobinfocache go.podman.io/image/v5/pkg/blobinfocache/internal/prioritize go.podman.io/image/v5/pkg/blobinfocache/memory go.podman.io/image/v5/pkg/blobinfocache/none go.podman.io/image/v5/pkg/blobinfocache/sqlite go.podman.io/image/v5/pkg/cli go.podman.io/image/v5/pkg/cli/basetls go.podman.io/image/v5/pkg/cli/basetls/tlsdetails go.podman.io/image/v5/pkg/cli/sigstore go.podman.io/image/v5/pkg/cli/sigstore/params go.podman.io/image/v5/pkg/compression go.podman.io/image/v5/pkg/compression/internal go.podman.io/image/v5/pkg/compression/types go.podman.io/image/v5/pkg/docker/config go.podman.io/image/v5/pkg/strslice go.podman.io/image/v5/pkg/sysregistriesv2 go.podman.io/image/v5/pkg/tlsclientconfig go.podman.io/image/v5/sif go.podman.io/image/v5/signature go.podman.io/image/v5/signature/internal go.podman.io/image/v5/signature/internal/sequoia go.podman.io/image/v5/signature/signer go.podman.io/image/v5/signature/sigstore go.podman.io/image/v5/signature/sigstore/fulcio go.podman.io/image/v5/signature/sigstore/internal go.podman.io/image/v5/signature/sigstore/rekor go.podman.io/image/v5/signature/simplesequoia go.podman.io/image/v5/signature/simplesigning go.podman.io/image/v5/storage go.podman.io/image/v5/tarball go.podman.io/image/v5/transports go.podman.io/image/v5/transports/alltransports go.podman.io/image/v5/types go.podman.io/image/v5/version # go.podman.io/storage v1.62.1-0.20260316152041-ebc34488c338 ## explicit; go 1.25.0 go.podman.io/storage go.podman.io/storage/drivers go.podman.io/storage/drivers/btrfs go.podman.io/storage/drivers/copy go.podman.io/storage/drivers/overlay go.podman.io/storage/drivers/overlayutils go.podman.io/storage/drivers/quota go.podman.io/storage/drivers/register go.podman.io/storage/drivers/vfs go.podman.io/storage/drivers/zfs go.podman.io/storage/internal/dedup go.podman.io/storage/internal/rawfilelock go.podman.io/storage/internal/staging_lockfile go.podman.io/storage/internal/tempdir go.podman.io/storage/pkg/archive go.podman.io/storage/pkg/chrootarchive go.podman.io/storage/pkg/chunked go.podman.io/storage/pkg/chunked/compressor go.podman.io/storage/pkg/chunked/dump go.podman.io/storage/pkg/chunked/internal/minimal go.podman.io/storage/pkg/chunked/internal/path go.podman.io/storage/pkg/chunked/toc go.podman.io/storage/pkg/config go.podman.io/storage/pkg/directory go.podman.io/storage/pkg/fileutils go.podman.io/storage/pkg/fsutils go.podman.io/storage/pkg/fsverity go.podman.io/storage/pkg/homedir go.podman.io/storage/pkg/idmap go.podman.io/storage/pkg/idtools go.podman.io/storage/pkg/ioutils go.podman.io/storage/pkg/lockfile go.podman.io/storage/pkg/longpath go.podman.io/storage/pkg/loopback go.podman.io/storage/pkg/mount go.podman.io/storage/pkg/parsers go.podman.io/storage/pkg/pools go.podman.io/storage/pkg/promise go.podman.io/storage/pkg/reexec go.podman.io/storage/pkg/regexp go.podman.io/storage/pkg/stringid go.podman.io/storage/pkg/stringutils go.podman.io/storage/pkg/system go.podman.io/storage/pkg/tarlog go.podman.io/storage/pkg/truncindex go.podman.io/storage/pkg/unshare go.podman.io/storage/types # golang.org/x/crypto v0.49.0 ## explicit; go 1.25.0 golang.org/x/crypto/cast5 golang.org/x/crypto/cryptobyte golang.org/x/crypto/cryptobyte/asn1 golang.org/x/crypto/internal/alias golang.org/x/crypto/internal/poly1305 golang.org/x/crypto/nacl/secretbox golang.org/x/crypto/openpgp golang.org/x/crypto/openpgp/armor golang.org/x/crypto/openpgp/elgamal golang.org/x/crypto/openpgp/errors golang.org/x/crypto/openpgp/packet golang.org/x/crypto/openpgp/s2k golang.org/x/crypto/pbkdf2 golang.org/x/crypto/salsa20/salsa golang.org/x/crypto/scrypt # golang.org/x/net v0.51.0 ## explicit; go 1.25.0 golang.org/x/net/http/httpguts golang.org/x/net/http2 golang.org/x/net/http2/hpack golang.org/x/net/idna golang.org/x/net/internal/httpcommon golang.org/x/net/internal/httpsfv golang.org/x/net/internal/timeseries golang.org/x/net/trace # golang.org/x/oauth2 v0.36.0 ## explicit; go 1.25.0 golang.org/x/oauth2 golang.org/x/oauth2/internal # golang.org/x/sync v0.20.0 ## explicit; go 1.25.0 golang.org/x/sync/errgroup golang.org/x/sync/semaphore # golang.org/x/sys v0.42.0 ## explicit; go 1.25.0 golang.org/x/sys/cpu golang.org/x/sys/plan9 golang.org/x/sys/unix golang.org/x/sys/windows # golang.org/x/term v0.41.0 ## explicit; go 1.25.0 golang.org/x/term # golang.org/x/text v0.35.0 ## explicit; go 1.25.0 golang.org/x/text/feature/plural golang.org/x/text/internal golang.org/x/text/internal/catmsg golang.org/x/text/internal/format golang.org/x/text/internal/language golang.org/x/text/internal/language/compact golang.org/x/text/internal/number golang.org/x/text/internal/stringset golang.org/x/text/internal/tag golang.org/x/text/language golang.org/x/text/message golang.org/x/text/message/catalog golang.org/x/text/secure/bidirule golang.org/x/text/transform golang.org/x/text/unicode/bidi golang.org/x/text/unicode/norm # google.golang.org/genproto/googleapis/api v0.0.0-20260128011058-8636f8732409 ## explicit; go 1.24.0 google.golang.org/genproto/googleapis/api google.golang.org/genproto/googleapis/api/annotations # google.golang.org/genproto/googleapis/rpc v0.0.0-20260128011058-8636f8732409 ## explicit; go 1.24.0 google.golang.org/genproto/googleapis/rpc/status # google.golang.org/grpc v1.78.0 ## explicit; go 1.24.0 google.golang.org/grpc google.golang.org/grpc/attributes google.golang.org/grpc/backoff google.golang.org/grpc/balancer google.golang.org/grpc/balancer/base google.golang.org/grpc/balancer/endpointsharding google.golang.org/grpc/balancer/grpclb/state google.golang.org/grpc/balancer/pickfirst google.golang.org/grpc/balancer/pickfirst/internal google.golang.org/grpc/balancer/roundrobin google.golang.org/grpc/binarylog/grpc_binarylog_v1 google.golang.org/grpc/channelz google.golang.org/grpc/codes google.golang.org/grpc/connectivity google.golang.org/grpc/credentials google.golang.org/grpc/credentials/insecure google.golang.org/grpc/encoding google.golang.org/grpc/encoding/internal google.golang.org/grpc/encoding/proto google.golang.org/grpc/experimental/stats google.golang.org/grpc/grpclog google.golang.org/grpc/grpclog/internal google.golang.org/grpc/internal google.golang.org/grpc/internal/backoff google.golang.org/grpc/internal/balancer/gracefulswitch google.golang.org/grpc/internal/balancerload google.golang.org/grpc/internal/binarylog google.golang.org/grpc/internal/buffer google.golang.org/grpc/internal/channelz google.golang.org/grpc/internal/credentials google.golang.org/grpc/internal/envconfig google.golang.org/grpc/internal/grpclog google.golang.org/grpc/internal/grpcsync google.golang.org/grpc/internal/grpcutil google.golang.org/grpc/internal/idle google.golang.org/grpc/internal/metadata google.golang.org/grpc/internal/pretty google.golang.org/grpc/internal/proxyattributes google.golang.org/grpc/internal/resolver google.golang.org/grpc/internal/resolver/delegatingresolver google.golang.org/grpc/internal/resolver/dns google.golang.org/grpc/internal/resolver/dns/internal google.golang.org/grpc/internal/resolver/passthrough google.golang.org/grpc/internal/resolver/unix google.golang.org/grpc/internal/serviceconfig google.golang.org/grpc/internal/stats google.golang.org/grpc/internal/status google.golang.org/grpc/internal/syscall google.golang.org/grpc/internal/transport google.golang.org/grpc/internal/transport/networktype google.golang.org/grpc/keepalive google.golang.org/grpc/mem google.golang.org/grpc/metadata google.golang.org/grpc/peer google.golang.org/grpc/resolver google.golang.org/grpc/resolver/dns google.golang.org/grpc/serviceconfig google.golang.org/grpc/stats google.golang.org/grpc/status google.golang.org/grpc/tap # google.golang.org/protobuf v1.36.11 ## explicit; go 1.23 google.golang.org/protobuf/encoding/protojson google.golang.org/protobuf/encoding/prototext google.golang.org/protobuf/encoding/protowire google.golang.org/protobuf/internal/descfmt google.golang.org/protobuf/internal/descopts google.golang.org/protobuf/internal/detrand google.golang.org/protobuf/internal/editiondefaults google.golang.org/protobuf/internal/editionssupport google.golang.org/protobuf/internal/encoding/defval google.golang.org/protobuf/internal/encoding/json google.golang.org/protobuf/internal/encoding/messageset google.golang.org/protobuf/internal/encoding/tag google.golang.org/protobuf/internal/encoding/text google.golang.org/protobuf/internal/errors google.golang.org/protobuf/internal/filedesc google.golang.org/protobuf/internal/filetype google.golang.org/protobuf/internal/flags google.golang.org/protobuf/internal/genid google.golang.org/protobuf/internal/impl google.golang.org/protobuf/internal/order google.golang.org/protobuf/internal/pragma google.golang.org/protobuf/internal/protolazy google.golang.org/protobuf/internal/set google.golang.org/protobuf/internal/strs google.golang.org/protobuf/internal/version google.golang.org/protobuf/proto google.golang.org/protobuf/protoadapt google.golang.org/protobuf/reflect/protodesc google.golang.org/protobuf/reflect/protoreflect google.golang.org/protobuf/reflect/protoregistry google.golang.org/protobuf/runtime/protoiface google.golang.org/protobuf/runtime/protoimpl google.golang.org/protobuf/types/descriptorpb google.golang.org/protobuf/types/gofeaturespb google.golang.org/protobuf/types/known/anypb google.golang.org/protobuf/types/known/durationpb google.golang.org/protobuf/types/known/timestamppb # gopkg.in/yaml.v3 v3.0.1 ## explicit gopkg.in/yaml.v3 ================================================ FILE: version/version.go ================================================ package version // Version is the version of the build. const Version = "1.22.0-dev"